diff --git a/.gitattributes b/.gitattributes index c09184a26008ed7f389f481c95fe05b964a2bbcc..71166666601fbf6fd1fc99627f3d3107faa202c7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3910,3 +3910,8 @@ tool_server/.venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts4 tool_server/.venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text tool_server/.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text tool_server/.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/console.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/uts46data.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/core.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/_asyncio.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/json_schema.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generate_schema.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text diff --git a/tool_server/.venv/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/licenses/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d99323a9965f146d5b0888c4ca1bf0727e12b04f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/licenses/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 the contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/annotated_types/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/annotated_types/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48b991b57c1f6d272c82693914ace7056b3adad0 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/annotated_types/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/annotated_types/__pycache__/test_cases.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/annotated_types/__pycache__/test_cases.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10885994175c227d74964aadea0f26abf972e107 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/annotated_types/__pycache__/test_cases.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio-4.10.0.dist-info/licenses/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/anyio-4.10.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..104eebf5a3002fccdaceef3a4cb936173c1c2035 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio-4.10.0.dist-info/licenses/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2018 Alex Grönholm + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd8eeabde405dc1172531d4f522e65e75fd96c26 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/from_thread.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/from_thread.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f1817cce760877aa175b89eba93c464de8b8ebb Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/from_thread.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/lowlevel.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/lowlevel.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..14348b8681c556c447a5998a96a7322248bad85e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/lowlevel.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/pytest_plugin.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/pytest_plugin.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..672cf35dbade04d77c9490c42f35904521cbbf7b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/pytest_plugin.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/to_interpreter.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/to_interpreter.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4514f8bb4d3029d64162fa21372cd8b9fc1c8c5d Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/to_interpreter.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/to_process.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/to_process.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b33aed5c0081c14d10de2b723cee948d92bf950f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/to_process.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/to_thread.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/to_thread.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe53bb54384082453c7f38a4aa2662aa4269919c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/__pycache__/to_thread.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..441be73d39e171ab6c6a819c4a8856b850309472 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/_asyncio.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/_asyncio.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be0c2a5828670888633671104b001aa2c3cf0d59 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/_asyncio.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02d1f6fe880680147cbad5d3b69777af1e7a5449c8ac729c2a78fc60c6167927 +size 137854 diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/_trio.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/_trio.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..986ab2c44cea10c7b121be89653423e2bb8cf687 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/_trio.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py new file mode 100644 index 0000000000000000000000000000000000000000..9bb742be48adab2245cb56656680d756ff39d121 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py @@ -0,0 +1,2946 @@ +from __future__ import annotations + +import array +import asyncio +import concurrent.futures +import contextvars +import math +import os +import socket +import sys +import threading +import weakref +from asyncio import ( + AbstractEventLoop, + CancelledError, + all_tasks, + create_task, + current_task, + get_running_loop, + sleep, +) +from asyncio.base_events import _run_until_complete_cb # type: ignore[attr-defined] +from collections import OrderedDict, deque +from collections.abc import ( + AsyncGenerator, + AsyncIterator, + Awaitable, + Callable, + Collection, + Coroutine, + Iterable, + Sequence, +) +from concurrent.futures import Future +from contextlib import AbstractContextManager, suppress +from contextvars import Context, copy_context +from dataclasses import dataclass +from functools import partial, wraps +from inspect import ( + CORO_RUNNING, + CORO_SUSPENDED, + getcoroutinestate, + iscoroutine, +) +from io import IOBase +from os import PathLike +from queue import Queue +from signal import Signals +from socket import AddressFamily, SocketKind +from threading import Thread +from types import CodeType, TracebackType +from typing import ( + IO, + TYPE_CHECKING, + Any, + Optional, + TypeVar, + cast, +) +from weakref import WeakKeyDictionary + +import sniffio + +from .. import ( + CapacityLimiterStatistics, + EventStatistics, + LockStatistics, + TaskInfo, + abc, +) +from .._core._eventloop import claim_worker_thread, threadlocals +from .._core._exceptions import ( + BrokenResourceError, + BusyResourceError, + ClosedResourceError, + EndOfStream, + WouldBlock, + iterate_exceptions, +) +from .._core._sockets import convert_ipv6_sockaddr +from .._core._streams import create_memory_object_stream +from .._core._synchronization import ( + CapacityLimiter as BaseCapacityLimiter, +) +from .._core._synchronization import Event as BaseEvent +from .._core._synchronization import Lock as BaseLock +from .._core._synchronization import ( + ResourceGuard, + SemaphoreStatistics, +) +from .._core._synchronization import Semaphore as BaseSemaphore +from .._core._tasks import CancelScope as BaseCancelScope +from ..abc import ( + AsyncBackend, + IPSockAddrType, + SocketListener, + UDPPacketType, + UNIXDatagramPacketType, +) +from ..abc._eventloop import StrOrBytesPath +from ..lowlevel import RunVar +from ..streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream + +if TYPE_CHECKING: + from _typeshed import FileDescriptorLike +else: + FileDescriptorLike = object + +if sys.version_info >= (3, 10): + from typing import ParamSpec +else: + from typing_extensions import ParamSpec + +if sys.version_info >= (3, 11): + from asyncio import Runner + from typing import TypeVarTuple, Unpack +else: + import contextvars + import enum + import signal + from asyncio import coroutines, events, exceptions, tasks + + from exceptiongroup import BaseExceptionGroup + from typing_extensions import TypeVarTuple, Unpack + + class _State(enum.Enum): + CREATED = "created" + INITIALIZED = "initialized" + CLOSED = "closed" + + class Runner: + # Copied from CPython 3.11 + def __init__( + self, + *, + debug: bool | None = None, + loop_factory: Callable[[], AbstractEventLoop] | None = None, + ): + self._state = _State.CREATED + self._debug = debug + self._loop_factory = loop_factory + self._loop: AbstractEventLoop | None = None + self._context = None + self._interrupt_count = 0 + self._set_event_loop = False + + def __enter__(self) -> Runner: + self._lazy_init() + return self + + def __exit__( + self, + exc_type: type[BaseException], + exc_val: BaseException, + exc_tb: TracebackType, + ) -> None: + self.close() + + def close(self) -> None: + """Shutdown and close event loop.""" + if self._state is not _State.INITIALIZED: + return + try: + loop = self._loop + _cancel_all_tasks(loop) + loop.run_until_complete(loop.shutdown_asyncgens()) + if hasattr(loop, "shutdown_default_executor"): + loop.run_until_complete(loop.shutdown_default_executor()) + else: + loop.run_until_complete(_shutdown_default_executor(loop)) + finally: + if self._set_event_loop: + events.set_event_loop(None) + loop.close() + self._loop = None + self._state = _State.CLOSED + + def get_loop(self) -> AbstractEventLoop: + """Return embedded event loop.""" + self._lazy_init() + return self._loop + + def run(self, coro: Coroutine[T_Retval], *, context=None) -> T_Retval: + """Run a coroutine inside the embedded event loop.""" + if not coroutines.iscoroutine(coro): + raise ValueError(f"a coroutine was expected, got {coro!r}") + + if events._get_running_loop() is not None: + # fail fast with short traceback + raise RuntimeError( + "Runner.run() cannot be called from a running event loop" + ) + + self._lazy_init() + + if context is None: + context = self._context + task = context.run(self._loop.create_task, coro) + + if ( + threading.current_thread() is threading.main_thread() + and signal.getsignal(signal.SIGINT) is signal.default_int_handler + ): + sigint_handler = partial(self._on_sigint, main_task=task) + try: + signal.signal(signal.SIGINT, sigint_handler) + except ValueError: + # `signal.signal` may throw if `threading.main_thread` does + # not support signals (e.g. embedded interpreter with signals + # not registered - see gh-91880) + sigint_handler = None + else: + sigint_handler = None + + self._interrupt_count = 0 + try: + return self._loop.run_until_complete(task) + except exceptions.CancelledError: + if self._interrupt_count > 0: + uncancel = getattr(task, "uncancel", None) + if uncancel is not None and uncancel() == 0: + raise KeyboardInterrupt # noqa: B904 + raise # CancelledError + finally: + if ( + sigint_handler is not None + and signal.getsignal(signal.SIGINT) is sigint_handler + ): + signal.signal(signal.SIGINT, signal.default_int_handler) + + def _lazy_init(self) -> None: + if self._state is _State.CLOSED: + raise RuntimeError("Runner is closed") + if self._state is _State.INITIALIZED: + return + if self._loop_factory is None: + self._loop = events.new_event_loop() + if not self._set_event_loop: + # Call set_event_loop only once to avoid calling + # attach_loop multiple times on child watchers + events.set_event_loop(self._loop) + self._set_event_loop = True + else: + self._loop = self._loop_factory() + if self._debug is not None: + self._loop.set_debug(self._debug) + self._context = contextvars.copy_context() + self._state = _State.INITIALIZED + + def _on_sigint(self, signum, frame, main_task: asyncio.Task) -> None: + self._interrupt_count += 1 + if self._interrupt_count == 1 and not main_task.done(): + main_task.cancel() + # wakeup loop if it is blocked by select() with long timeout + self._loop.call_soon_threadsafe(lambda: None) + return + raise KeyboardInterrupt() + + def _cancel_all_tasks(loop: AbstractEventLoop) -> None: + to_cancel = tasks.all_tasks(loop) + if not to_cancel: + return + + for task in to_cancel: + task.cancel() + + loop.run_until_complete(tasks.gather(*to_cancel, return_exceptions=True)) + + for task in to_cancel: + if task.cancelled(): + continue + if task.exception() is not None: + loop.call_exception_handler( + { + "message": "unhandled exception during asyncio.run() shutdown", + "exception": task.exception(), + "task": task, + } + ) + + async def _shutdown_default_executor(loop: AbstractEventLoop) -> None: + """Schedule the shutdown of the default executor.""" + + def _do_shutdown(future: asyncio.futures.Future) -> None: + try: + loop._default_executor.shutdown(wait=True) # type: ignore[attr-defined] + loop.call_soon_threadsafe(future.set_result, None) + except Exception as ex: + loop.call_soon_threadsafe(future.set_exception, ex) + + loop._executor_shutdown_called = True + if loop._default_executor is None: + return + future = loop.create_future() + thread = threading.Thread(target=_do_shutdown, args=(future,)) + thread.start() + try: + await future + finally: + thread.join() + + +T_Retval = TypeVar("T_Retval") +T_contra = TypeVar("T_contra", contravariant=True) +PosArgsT = TypeVarTuple("PosArgsT") +P = ParamSpec("P") + +_root_task: RunVar[asyncio.Task | None] = RunVar("_root_task") + + +def find_root_task() -> asyncio.Task: + root_task = _root_task.get(None) + if root_task is not None and not root_task.done(): + return root_task + + # Look for a task that has been started via run_until_complete() + for task in all_tasks(): + if task._callbacks and not task.done(): + callbacks = [cb for cb, context in task._callbacks] + for cb in callbacks: + if ( + cb is _run_until_complete_cb + or getattr(cb, "__module__", None) == "uvloop.loop" + ): + _root_task.set(task) + return task + + # Look up the topmost task in the AnyIO task tree, if possible + task = cast(asyncio.Task, current_task()) + state = _task_states.get(task) + if state: + cancel_scope = state.cancel_scope + while cancel_scope and cancel_scope._parent_scope is not None: + cancel_scope = cancel_scope._parent_scope + + if cancel_scope is not None: + return cast(asyncio.Task, cancel_scope._host_task) + + return task + + +def get_callable_name(func: Callable) -> str: + module = getattr(func, "__module__", None) + qualname = getattr(func, "__qualname__", None) + return ".".join([x for x in (module, qualname) if x]) + + +# +# Event loop +# + +_run_vars: WeakKeyDictionary[asyncio.AbstractEventLoop, Any] = WeakKeyDictionary() + + +def _task_started(task: asyncio.Task) -> bool: + """Return ``True`` if the task has been started and has not finished.""" + # The task coro should never be None here, as we never add finished tasks to the + # task list + coro = task.get_coro() + assert coro is not None + try: + return getcoroutinestate(coro) in (CORO_RUNNING, CORO_SUSPENDED) + except AttributeError: + # task coro is async_genenerator_asend https://bugs.python.org/issue37771 + raise Exception(f"Cannot determine if task {task} has started or not") from None + + +# +# Timeouts and cancellation +# + + +def is_anyio_cancellation(exc: CancelledError) -> bool: + # Sometimes third party frameworks catch a CancelledError and raise a new one, so as + # a workaround we have to look at the previous ones in __context__ too for a + # matching cancel message + while True: + if ( + exc.args + and isinstance(exc.args[0], str) + and exc.args[0].startswith("Cancelled by cancel scope ") + ): + return True + + if isinstance(exc.__context__, CancelledError): + exc = exc.__context__ + continue + + return False + + +class CancelScope(BaseCancelScope): + def __new__( + cls, *, deadline: float = math.inf, shield: bool = False + ) -> CancelScope: + return object.__new__(cls) + + def __init__(self, deadline: float = math.inf, shield: bool = False): + self._deadline = deadline + self._shield = shield + self._parent_scope: CancelScope | None = None + self._child_scopes: set[CancelScope] = set() + self._cancel_called = False + self._cancelled_caught = False + self._active = False + self._timeout_handle: asyncio.TimerHandle | None = None + self._cancel_handle: asyncio.Handle | None = None + self._tasks: set[asyncio.Task] = set() + self._host_task: asyncio.Task | None = None + if sys.version_info >= (3, 11): + self._pending_uncancellations: int | None = 0 + else: + self._pending_uncancellations = None + + def __enter__(self) -> CancelScope: + if self._active: + raise RuntimeError( + "Each CancelScope may only be used for a single 'with' block" + ) + + self._host_task = host_task = cast(asyncio.Task, current_task()) + self._tasks.add(host_task) + try: + task_state = _task_states[host_task] + except KeyError: + task_state = TaskState(None, self) + _task_states[host_task] = task_state + else: + self._parent_scope = task_state.cancel_scope + task_state.cancel_scope = self + if self._parent_scope is not None: + # If using an eager task factory, the parent scope may not even contain + # the host task + self._parent_scope._child_scopes.add(self) + self._parent_scope._tasks.discard(host_task) + + self._timeout() + self._active = True + + # Start cancelling the host task if the scope was cancelled before entering + if self._cancel_called: + self._deliver_cancellation(self) + + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> bool: + del exc_tb + + if not self._active: + raise RuntimeError("This cancel scope is not active") + if current_task() is not self._host_task: + raise RuntimeError( + "Attempted to exit cancel scope in a different task than it was " + "entered in" + ) + + assert self._host_task is not None + host_task_state = _task_states.get(self._host_task) + if host_task_state is None or host_task_state.cancel_scope is not self: + raise RuntimeError( + "Attempted to exit a cancel scope that isn't the current tasks's " + "current cancel scope" + ) + + try: + self._active = False + if self._timeout_handle: + self._timeout_handle.cancel() + self._timeout_handle = None + + self._tasks.remove(self._host_task) + if self._parent_scope is not None: + self._parent_scope._child_scopes.remove(self) + self._parent_scope._tasks.add(self._host_task) + + host_task_state.cancel_scope = self._parent_scope + + # Restart the cancellation effort in the closest visible, cancelled parent + # scope if necessary + self._restart_cancellation_in_parent() + + # We only swallow the exception iff it was an AnyIO CancelledError, either + # directly as exc_val or inside an exception group and there are no cancelled + # parent cancel scopes visible to us here + if self._cancel_called and not self._parent_cancellation_is_visible_to_us: + # For each level-cancel() call made on the host task, call uncancel() + while self._pending_uncancellations: + self._host_task.uncancel() + self._pending_uncancellations -= 1 + + # Update cancelled_caught and check for exceptions we must not swallow + cannot_swallow_exc_val = False + if exc_val is not None: + for exc in iterate_exceptions(exc_val): + if isinstance(exc, CancelledError) and is_anyio_cancellation( + exc + ): + self._cancelled_caught = True + else: + cannot_swallow_exc_val = True + + return self._cancelled_caught and not cannot_swallow_exc_val + else: + if self._pending_uncancellations: + assert self._parent_scope is not None + assert self._parent_scope._pending_uncancellations is not None + self._parent_scope._pending_uncancellations += ( + self._pending_uncancellations + ) + self._pending_uncancellations = 0 + + return False + finally: + self._host_task = None + del exc_val + + @property + def _effectively_cancelled(self) -> bool: + cancel_scope: CancelScope | None = self + while cancel_scope is not None: + if cancel_scope._cancel_called: + return True + + if cancel_scope.shield: + return False + + cancel_scope = cancel_scope._parent_scope + + return False + + @property + def _parent_cancellation_is_visible_to_us(self) -> bool: + return ( + self._parent_scope is not None + and not self.shield + and self._parent_scope._effectively_cancelled + ) + + def _timeout(self) -> None: + if self._deadline != math.inf: + loop = get_running_loop() + if loop.time() >= self._deadline: + self.cancel() + else: + self._timeout_handle = loop.call_at(self._deadline, self._timeout) + + def _deliver_cancellation(self, origin: CancelScope) -> bool: + """ + Deliver cancellation to directly contained tasks and nested cancel scopes. + + Schedule another run at the end if we still have tasks eligible for + cancellation. + + :param origin: the cancel scope that originated the cancellation + :return: ``True`` if the delivery needs to be retried on the next cycle + + """ + should_retry = False + current = current_task() + for task in self._tasks: + should_retry = True + if task._must_cancel: # type: ignore[attr-defined] + continue + + # The task is eligible for cancellation if it has started + if task is not current and (task is self._host_task or _task_started(task)): + waiter = task._fut_waiter # type: ignore[attr-defined] + if not isinstance(waiter, asyncio.Future) or not waiter.done(): + task.cancel(f"Cancelled by cancel scope {id(origin):x}") + if ( + task is origin._host_task + and origin._pending_uncancellations is not None + ): + origin._pending_uncancellations += 1 + + # Deliver cancellation to child scopes that aren't shielded or running their own + # cancellation callbacks + for scope in self._child_scopes: + if not scope._shield and not scope.cancel_called: + should_retry = scope._deliver_cancellation(origin) or should_retry + + # Schedule another callback if there are still tasks left + if origin is self: + if should_retry: + self._cancel_handle = get_running_loop().call_soon( + self._deliver_cancellation, origin + ) + else: + self._cancel_handle = None + + return should_retry + + def _restart_cancellation_in_parent(self) -> None: + """ + Restart the cancellation effort in the closest directly cancelled parent scope. + + """ + scope = self._parent_scope + while scope is not None: + if scope._cancel_called: + if scope._cancel_handle is None: + scope._deliver_cancellation(scope) + + break + + # No point in looking beyond any shielded scope + if scope._shield: + break + + scope = scope._parent_scope + + def cancel(self) -> None: + if not self._cancel_called: + if self._timeout_handle: + self._timeout_handle.cancel() + self._timeout_handle = None + + self._cancel_called = True + if self._host_task is not None: + self._deliver_cancellation(self) + + @property + def deadline(self) -> float: + return self._deadline + + @deadline.setter + def deadline(self, value: float) -> None: + self._deadline = float(value) + if self._timeout_handle is not None: + self._timeout_handle.cancel() + self._timeout_handle = None + + if self._active and not self._cancel_called: + self._timeout() + + @property + def cancel_called(self) -> bool: + return self._cancel_called + + @property + def cancelled_caught(self) -> bool: + return self._cancelled_caught + + @property + def shield(self) -> bool: + return self._shield + + @shield.setter + def shield(self, value: bool) -> None: + if self._shield != value: + self._shield = value + if not value: + self._restart_cancellation_in_parent() + + +# +# Task states +# + + +class TaskState: + """ + Encapsulates auxiliary task information that cannot be added to the Task instance + itself because there are no guarantees about its implementation. + """ + + __slots__ = "parent_id", "cancel_scope", "__weakref__" + + def __init__(self, parent_id: int | None, cancel_scope: CancelScope | None): + self.parent_id = parent_id + self.cancel_scope = cancel_scope + + +_task_states: WeakKeyDictionary[asyncio.Task, TaskState] = WeakKeyDictionary() + + +# +# Task groups +# + + +class _AsyncioTaskStatus(abc.TaskStatus): + def __init__(self, future: asyncio.Future, parent_id: int): + self._future = future + self._parent_id = parent_id + + def started(self, value: T_contra | None = None) -> None: + try: + self._future.set_result(value) + except asyncio.InvalidStateError: + if not self._future.cancelled(): + raise RuntimeError( + "called 'started' twice on the same task status" + ) from None + + task = cast(asyncio.Task, current_task()) + _task_states[task].parent_id = self._parent_id + + +if sys.version_info >= (3, 12): + _eager_task_factory_code: CodeType | None = asyncio.eager_task_factory.__code__ +else: + _eager_task_factory_code = None + + +class TaskGroup(abc.TaskGroup): + def __init__(self) -> None: + self.cancel_scope: CancelScope = CancelScope() + self._active = False + self._exceptions: list[BaseException] = [] + self._tasks: set[asyncio.Task] = set() + self._on_completed_fut: asyncio.Future[None] | None = None + + async def __aenter__(self) -> TaskGroup: + self.cancel_scope.__enter__() + self._active = True + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> bool: + try: + if exc_val is not None: + self.cancel_scope.cancel() + if not isinstance(exc_val, CancelledError): + self._exceptions.append(exc_val) + + loop = get_running_loop() + try: + if self._tasks: + with CancelScope() as wait_scope: + while self._tasks: + self._on_completed_fut = loop.create_future() + + try: + await self._on_completed_fut + except CancelledError as exc: + # Shield the scope against further cancellation attempts, + # as they're not productive (#695) + wait_scope.shield = True + self.cancel_scope.cancel() + + # Set exc_val from the cancellation exception if it was + # previously unset. However, we should not replace a native + # cancellation exception with one raise by a cancel scope. + if exc_val is None or ( + isinstance(exc_val, CancelledError) + and not is_anyio_cancellation(exc) + ): + exc_val = exc + + self._on_completed_fut = None + else: + # If there are no child tasks to wait on, run at least one checkpoint + # anyway + await AsyncIOBackend.cancel_shielded_checkpoint() + + self._active = False + if self._exceptions: + # The exception that got us here should already have been + # added to self._exceptions so it's ok to break exception + # chaining and avoid adding a "During handling of above..." + # for each nesting level. + raise BaseExceptionGroup( + "unhandled errors in a TaskGroup", self._exceptions + ) from None + elif exc_val: + raise exc_val + except BaseException as exc: + if self.cancel_scope.__exit__(type(exc), exc, exc.__traceback__): + return True + + raise + + return self.cancel_scope.__exit__(exc_type, exc_val, exc_tb) + finally: + del exc_val, exc_tb, self._exceptions + + def _spawn( + self, + func: Callable[[Unpack[PosArgsT]], Awaitable[Any]], + args: tuple[Unpack[PosArgsT]], + name: object, + task_status_future: asyncio.Future | None = None, + ) -> asyncio.Task: + def task_done(_task: asyncio.Task) -> None: + task_state = _task_states[_task] + assert task_state.cancel_scope is not None + assert _task in task_state.cancel_scope._tasks + task_state.cancel_scope._tasks.remove(_task) + self._tasks.remove(task) + del _task_states[_task] + + if self._on_completed_fut is not None and not self._tasks: + try: + self._on_completed_fut.set_result(None) + except asyncio.InvalidStateError: + pass + + try: + exc = _task.exception() + except CancelledError as e: + while isinstance(e.__context__, CancelledError): + e = e.__context__ + + exc = e + + if exc is not None: + # The future can only be in the cancelled state if the host task was + # cancelled, so return immediately instead of adding one more + # CancelledError to the exceptions list + if task_status_future is not None and task_status_future.cancelled(): + return + + if task_status_future is None or task_status_future.done(): + if not isinstance(exc, CancelledError): + self._exceptions.append(exc) + + if not self.cancel_scope._effectively_cancelled: + self.cancel_scope.cancel() + else: + task_status_future.set_exception(exc) + elif task_status_future is not None and not task_status_future.done(): + task_status_future.set_exception( + RuntimeError("Child exited without calling task_status.started()") + ) + + if not self._active: + raise RuntimeError( + "This task group is not active; no new tasks can be started." + ) + + kwargs = {} + if task_status_future: + parent_id = id(current_task()) + kwargs["task_status"] = _AsyncioTaskStatus( + task_status_future, id(self.cancel_scope._host_task) + ) + else: + parent_id = id(self.cancel_scope._host_task) + + coro = func(*args, **kwargs) + if not iscoroutine(coro): + prefix = f"{func.__module__}." if hasattr(func, "__module__") else "" + raise TypeError( + f"Expected {prefix}{func.__qualname__}() to return a coroutine, but " + f"the return value ({coro!r}) is not a coroutine object" + ) + + name = get_callable_name(func) if name is None else str(name) + loop = asyncio.get_running_loop() + if ( + (factory := loop.get_task_factory()) + and getattr(factory, "__code__", None) is _eager_task_factory_code + and (closure := getattr(factory, "__closure__", None)) + ): + custom_task_constructor = closure[0].cell_contents + task = custom_task_constructor(coro, loop=loop, name=name) + else: + task = create_task(coro, name=name) + + # Make the spawned task inherit the task group's cancel scope + _task_states[task] = TaskState( + parent_id=parent_id, cancel_scope=self.cancel_scope + ) + self.cancel_scope._tasks.add(task) + self._tasks.add(task) + task.add_done_callback(task_done) + return task + + def start_soon( + self, + func: Callable[[Unpack[PosArgsT]], Awaitable[Any]], + *args: Unpack[PosArgsT], + name: object = None, + ) -> None: + self._spawn(func, args, name) + + async def start( + self, func: Callable[..., Awaitable[Any]], *args: object, name: object = None + ) -> Any: + future: asyncio.Future = asyncio.Future() + task = self._spawn(func, args, name, future) + + # If the task raises an exception after sending a start value without a switch + # point between, the task group is cancelled and this method never proceeds to + # process the completed future. That's why we have to have a shielded cancel + # scope here. + try: + return await future + except CancelledError: + # Cancel the task and wait for it to exit before returning + task.cancel() + with CancelScope(shield=True), suppress(CancelledError): + await task + + raise + + +# +# Threads +# + +_Retval_Queue_Type = tuple[Optional[T_Retval], Optional[BaseException]] + + +class WorkerThread(Thread): + MAX_IDLE_TIME = 10 # seconds + + def __init__( + self, + root_task: asyncio.Task, + workers: set[WorkerThread], + idle_workers: deque[WorkerThread], + ): + super().__init__(name="AnyIO worker thread") + self.root_task = root_task + self.workers = workers + self.idle_workers = idle_workers + self.loop = root_task._loop + self.queue: Queue[ + tuple[Context, Callable, tuple, asyncio.Future, CancelScope] | None + ] = Queue(2) + self.idle_since = AsyncIOBackend.current_time() + self.stopping = False + + def _report_result( + self, future: asyncio.Future, result: Any, exc: BaseException | None + ) -> None: + self.idle_since = AsyncIOBackend.current_time() + if not self.stopping: + self.idle_workers.append(self) + + if not future.cancelled(): + if exc is not None: + if isinstance(exc, StopIteration): + new_exc = RuntimeError("coroutine raised StopIteration") + new_exc.__cause__ = exc + exc = new_exc + + future.set_exception(exc) + else: + future.set_result(result) + + def run(self) -> None: + with claim_worker_thread(AsyncIOBackend, self.loop): + while True: + item = self.queue.get() + if item is None: + # Shutdown command received + return + + context, func, args, future, cancel_scope = item + if not future.cancelled(): + result = None + exception: BaseException | None = None + threadlocals.current_cancel_scope = cancel_scope + try: + result = context.run(func, *args) + except BaseException as exc: + exception = exc + finally: + del threadlocals.current_cancel_scope + + if not self.loop.is_closed(): + self.loop.call_soon_threadsafe( + self._report_result, future, result, exception + ) + + del result, exception + + self.queue.task_done() + del item, context, func, args, future, cancel_scope + + def stop(self, f: asyncio.Task | None = None) -> None: + self.stopping = True + self.queue.put_nowait(None) + self.workers.discard(self) + try: + self.idle_workers.remove(self) + except ValueError: + pass + + +_threadpool_idle_workers: RunVar[deque[WorkerThread]] = RunVar( + "_threadpool_idle_workers" +) +_threadpool_workers: RunVar[set[WorkerThread]] = RunVar("_threadpool_workers") + + +class BlockingPortal(abc.BlockingPortal): + def __new__(cls) -> BlockingPortal: + return object.__new__(cls) + + def __init__(self) -> None: + super().__init__() + self._loop = get_running_loop() + + def _spawn_task_from_thread( + self, + func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval] | T_Retval], + args: tuple[Unpack[PosArgsT]], + kwargs: dict[str, Any], + name: object, + future: Future[T_Retval], + ) -> None: + AsyncIOBackend.run_sync_from_thread( + partial(self._task_group.start_soon, name=name), + (self._call_func, func, args, kwargs, future), + self._loop, + ) + + +# +# Subprocesses +# + + +@dataclass(eq=False) +class StreamReaderWrapper(abc.ByteReceiveStream): + _stream: asyncio.StreamReader + + async def receive(self, max_bytes: int = 65536) -> bytes: + data = await self._stream.read(max_bytes) + if data: + return data + else: + raise EndOfStream + + async def aclose(self) -> None: + self._stream.set_exception(ClosedResourceError()) + await AsyncIOBackend.checkpoint() + + +@dataclass(eq=False) +class StreamWriterWrapper(abc.ByteSendStream): + _stream: asyncio.StreamWriter + + async def send(self, item: bytes) -> None: + self._stream.write(item) + await self._stream.drain() + + async def aclose(self) -> None: + self._stream.close() + await AsyncIOBackend.checkpoint() + + +@dataclass(eq=False) +class Process(abc.Process): + _process: asyncio.subprocess.Process + _stdin: StreamWriterWrapper | None + _stdout: StreamReaderWrapper | None + _stderr: StreamReaderWrapper | None + + async def aclose(self) -> None: + with CancelScope(shield=True) as scope: + if self._stdin: + await self._stdin.aclose() + if self._stdout: + await self._stdout.aclose() + if self._stderr: + await self._stderr.aclose() + + scope.shield = False + try: + await self.wait() + except BaseException: + scope.shield = True + self.kill() + await self.wait() + raise + + async def wait(self) -> int: + return await self._process.wait() + + def terminate(self) -> None: + self._process.terminate() + + def kill(self) -> None: + self._process.kill() + + def send_signal(self, signal: int) -> None: + self._process.send_signal(signal) + + @property + def pid(self) -> int: + return self._process.pid + + @property + def returncode(self) -> int | None: + return self._process.returncode + + @property + def stdin(self) -> abc.ByteSendStream | None: + return self._stdin + + @property + def stdout(self) -> abc.ByteReceiveStream | None: + return self._stdout + + @property + def stderr(self) -> abc.ByteReceiveStream | None: + return self._stderr + + +def _forcibly_shutdown_process_pool_on_exit( + workers: set[Process], _task: object +) -> None: + """ + Forcibly shuts down worker processes belonging to this event loop.""" + child_watcher: asyncio.AbstractChildWatcher | None = None + if sys.version_info < (3, 12): + try: + child_watcher = asyncio.get_event_loop_policy().get_child_watcher() + except NotImplementedError: + pass + + # Close as much as possible (w/o async/await) to avoid warnings + for process in workers: + if process.returncode is None: + continue + + process._stdin._stream._transport.close() # type: ignore[union-attr] + process._stdout._stream._transport.close() # type: ignore[union-attr] + process._stderr._stream._transport.close() # type: ignore[union-attr] + process.kill() + if child_watcher: + child_watcher.remove_child_handler(process.pid) + + +async def _shutdown_process_pool_on_exit(workers: set[abc.Process]) -> None: + """ + Shuts down worker processes belonging to this event loop. + + NOTE: this only works when the event loop was started using asyncio.run() or + anyio.run(). + + """ + process: abc.Process + try: + await sleep(math.inf) + except asyncio.CancelledError: + for process in workers: + if process.returncode is None: + process.kill() + + for process in workers: + await process.aclose() + + +# +# Sockets and networking +# + + +class StreamProtocol(asyncio.Protocol): + read_queue: deque[bytes] + read_event: asyncio.Event + write_event: asyncio.Event + exception: Exception | None = None + is_at_eof: bool = False + + def connection_made(self, transport: asyncio.BaseTransport) -> None: + self.read_queue = deque() + self.read_event = asyncio.Event() + self.write_event = asyncio.Event() + self.write_event.set() + cast(asyncio.Transport, transport).set_write_buffer_limits(0) + + def connection_lost(self, exc: Exception | None) -> None: + if exc: + self.exception = BrokenResourceError() + self.exception.__cause__ = exc + + self.read_event.set() + self.write_event.set() + + def data_received(self, data: bytes) -> None: + # ProactorEventloop sometimes sends bytearray instead of bytes + self.read_queue.append(bytes(data)) + self.read_event.set() + + def eof_received(self) -> bool | None: + self.is_at_eof = True + self.read_event.set() + return True + + def pause_writing(self) -> None: + self.write_event = asyncio.Event() + + def resume_writing(self) -> None: + self.write_event.set() + + +class DatagramProtocol(asyncio.DatagramProtocol): + read_queue: deque[tuple[bytes, IPSockAddrType]] + read_event: asyncio.Event + write_event: asyncio.Event + exception: Exception | None = None + + def connection_made(self, transport: asyncio.BaseTransport) -> None: + self.read_queue = deque(maxlen=100) # arbitrary value + self.read_event = asyncio.Event() + self.write_event = asyncio.Event() + self.write_event.set() + + def connection_lost(self, exc: Exception | None) -> None: + self.read_event.set() + self.write_event.set() + + def datagram_received(self, data: bytes, addr: IPSockAddrType) -> None: + addr = convert_ipv6_sockaddr(addr) + self.read_queue.append((data, addr)) + self.read_event.set() + + def error_received(self, exc: Exception) -> None: + self.exception = exc + + def pause_writing(self) -> None: + self.write_event.clear() + + def resume_writing(self) -> None: + self.write_event.set() + + +class SocketStream(abc.SocketStream): + def __init__(self, transport: asyncio.Transport, protocol: StreamProtocol): + self._transport = transport + self._protocol = protocol + self._receive_guard = ResourceGuard("reading from") + self._send_guard = ResourceGuard("writing to") + self._closed = False + + @property + def _raw_socket(self) -> socket.socket: + return self._transport.get_extra_info("socket") + + async def receive(self, max_bytes: int = 65536) -> bytes: + with self._receive_guard: + if ( + not self._protocol.read_event.is_set() + and not self._transport.is_closing() + and not self._protocol.is_at_eof + ): + self._transport.resume_reading() + await self._protocol.read_event.wait() + self._transport.pause_reading() + else: + await AsyncIOBackend.checkpoint() + + try: + chunk = self._protocol.read_queue.popleft() + except IndexError: + if self._closed: + raise ClosedResourceError from None + elif self._protocol.exception: + raise self._protocol.exception from None + else: + raise EndOfStream from None + + if len(chunk) > max_bytes: + # Split the oversized chunk + chunk, leftover = chunk[:max_bytes], chunk[max_bytes:] + self._protocol.read_queue.appendleft(leftover) + + # If the read queue is empty, clear the flag so that the next call will + # block until data is available + if not self._protocol.read_queue: + self._protocol.read_event.clear() + + return chunk + + async def send(self, item: bytes) -> None: + with self._send_guard: + await AsyncIOBackend.checkpoint() + + if self._closed: + raise ClosedResourceError + elif self._protocol.exception is not None: + raise self._protocol.exception + + try: + self._transport.write(item) + except RuntimeError as exc: + if self._transport.is_closing(): + raise BrokenResourceError from exc + else: + raise + + await self._protocol.write_event.wait() + + async def send_eof(self) -> None: + try: + self._transport.write_eof() + except OSError: + pass + + async def aclose(self) -> None: + if not self._transport.is_closing(): + self._closed = True + try: + self._transport.write_eof() + except OSError: + pass + + self._transport.close() + await sleep(0) + self._transport.abort() + + +class _RawSocketMixin: + _receive_future: asyncio.Future | None = None + _send_future: asyncio.Future | None = None + _closing = False + + def __init__(self, raw_socket: socket.socket): + self.__raw_socket = raw_socket + self._receive_guard = ResourceGuard("reading from") + self._send_guard = ResourceGuard("writing to") + + @property + def _raw_socket(self) -> socket.socket: + return self.__raw_socket + + def _wait_until_readable(self, loop: asyncio.AbstractEventLoop) -> asyncio.Future: + def callback(f: object) -> None: + del self._receive_future + loop.remove_reader(self.__raw_socket) + + f = self._receive_future = asyncio.Future() + loop.add_reader(self.__raw_socket, f.set_result, None) + f.add_done_callback(callback) + return f + + def _wait_until_writable(self, loop: asyncio.AbstractEventLoop) -> asyncio.Future: + def callback(f: object) -> None: + del self._send_future + loop.remove_writer(self.__raw_socket) + + f = self._send_future = asyncio.Future() + loop.add_writer(self.__raw_socket, f.set_result, None) + f.add_done_callback(callback) + return f + + async def aclose(self) -> None: + if not self._closing: + self._closing = True + if self.__raw_socket.fileno() != -1: + self.__raw_socket.close() + + if self._receive_future: + self._receive_future.set_result(None) + if self._send_future: + self._send_future.set_result(None) + + +class UNIXSocketStream(_RawSocketMixin, abc.UNIXSocketStream): + async def send_eof(self) -> None: + with self._send_guard: + self._raw_socket.shutdown(socket.SHUT_WR) + + async def receive(self, max_bytes: int = 65536) -> bytes: + loop = get_running_loop() + await AsyncIOBackend.checkpoint() + with self._receive_guard: + while True: + try: + data = self._raw_socket.recv(max_bytes) + except BlockingIOError: + await self._wait_until_readable(loop) + except OSError as exc: + if self._closing: + raise ClosedResourceError from None + else: + raise BrokenResourceError from exc + else: + if not data: + raise EndOfStream + + return data + + async def send(self, item: bytes) -> None: + loop = get_running_loop() + await AsyncIOBackend.checkpoint() + with self._send_guard: + view = memoryview(item) + while view: + try: + bytes_sent = self._raw_socket.send(view) + except BlockingIOError: + await self._wait_until_writable(loop) + except OSError as exc: + if self._closing: + raise ClosedResourceError from None + else: + raise BrokenResourceError from exc + else: + view = view[bytes_sent:] + + async def receive_fds(self, msglen: int, maxfds: int) -> tuple[bytes, list[int]]: + if not isinstance(msglen, int) or msglen < 0: + raise ValueError("msglen must be a non-negative integer") + if not isinstance(maxfds, int) or maxfds < 1: + raise ValueError("maxfds must be a positive integer") + + loop = get_running_loop() + fds = array.array("i") + await AsyncIOBackend.checkpoint() + with self._receive_guard: + while True: + try: + message, ancdata, flags, addr = self._raw_socket.recvmsg( + msglen, socket.CMSG_LEN(maxfds * fds.itemsize) + ) + except BlockingIOError: + await self._wait_until_readable(loop) + except OSError as exc: + if self._closing: + raise ClosedResourceError from None + else: + raise BrokenResourceError from exc + else: + if not message and not ancdata: + raise EndOfStream + + break + + for cmsg_level, cmsg_type, cmsg_data in ancdata: + if cmsg_level != socket.SOL_SOCKET or cmsg_type != socket.SCM_RIGHTS: + raise RuntimeError( + f"Received unexpected ancillary data; message = {message!r}, " + f"cmsg_level = {cmsg_level}, cmsg_type = {cmsg_type}" + ) + + fds.frombytes(cmsg_data[: len(cmsg_data) - (len(cmsg_data) % fds.itemsize)]) + + return message, list(fds) + + async def send_fds(self, message: bytes, fds: Collection[int | IOBase]) -> None: + if not message: + raise ValueError("message must not be empty") + if not fds: + raise ValueError("fds must not be empty") + + loop = get_running_loop() + filenos: list[int] = [] + for fd in fds: + if isinstance(fd, int): + filenos.append(fd) + elif isinstance(fd, IOBase): + filenos.append(fd.fileno()) + + fdarray = array.array("i", filenos) + await AsyncIOBackend.checkpoint() + with self._send_guard: + while True: + try: + # The ignore can be removed after mypy picks up + # https://github.com/python/typeshed/pull/5545 + self._raw_socket.sendmsg( + [message], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, fdarray)] + ) + break + except BlockingIOError: + await self._wait_until_writable(loop) + except OSError as exc: + if self._closing: + raise ClosedResourceError from None + else: + raise BrokenResourceError from exc + + +class TCPSocketListener(abc.SocketListener): + _accept_scope: CancelScope | None = None + _closed = False + + def __init__(self, raw_socket: socket.socket): + self.__raw_socket = raw_socket + self._loop = cast(asyncio.BaseEventLoop, get_running_loop()) + self._accept_guard = ResourceGuard("accepting connections from") + + @property + def _raw_socket(self) -> socket.socket: + return self.__raw_socket + + async def accept(self) -> abc.SocketStream: + if self._closed: + raise ClosedResourceError + + with self._accept_guard: + await AsyncIOBackend.checkpoint() + with CancelScope() as self._accept_scope: + try: + client_sock, _addr = await self._loop.sock_accept(self._raw_socket) + except asyncio.CancelledError: + # Workaround for https://bugs.python.org/issue41317 + try: + self._loop.remove_reader(self._raw_socket) + except (ValueError, NotImplementedError): + pass + + if self._closed: + raise ClosedResourceError from None + + raise + finally: + self._accept_scope = None + + client_sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) + transport, protocol = await self._loop.connect_accepted_socket( + StreamProtocol, client_sock + ) + return SocketStream(transport, protocol) + + async def aclose(self) -> None: + if self._closed: + return + + self._closed = True + if self._accept_scope: + # Workaround for https://bugs.python.org/issue41317 + try: + self._loop.remove_reader(self._raw_socket) + except (ValueError, NotImplementedError): + pass + + self._accept_scope.cancel() + await sleep(0) + + self._raw_socket.close() + + +class UNIXSocketListener(abc.SocketListener): + def __init__(self, raw_socket: socket.socket): + self.__raw_socket = raw_socket + self._loop = get_running_loop() + self._accept_guard = ResourceGuard("accepting connections from") + self._closed = False + + async def accept(self) -> abc.SocketStream: + await AsyncIOBackend.checkpoint() + with self._accept_guard: + while True: + try: + client_sock, _ = self.__raw_socket.accept() + client_sock.setblocking(False) + return UNIXSocketStream(client_sock) + except BlockingIOError: + f: asyncio.Future = asyncio.Future() + self._loop.add_reader(self.__raw_socket, f.set_result, None) + f.add_done_callback( + lambda _: self._loop.remove_reader(self.__raw_socket) + ) + await f + except OSError as exc: + if self._closed: + raise ClosedResourceError from None + else: + raise BrokenResourceError from exc + + async def aclose(self) -> None: + self._closed = True + self.__raw_socket.close() + + @property + def _raw_socket(self) -> socket.socket: + return self.__raw_socket + + +class UDPSocket(abc.UDPSocket): + def __init__( + self, transport: asyncio.DatagramTransport, protocol: DatagramProtocol + ): + self._transport = transport + self._protocol = protocol + self._receive_guard = ResourceGuard("reading from") + self._send_guard = ResourceGuard("writing to") + self._closed = False + + @property + def _raw_socket(self) -> socket.socket: + return self._transport.get_extra_info("socket") + + async def aclose(self) -> None: + if not self._transport.is_closing(): + self._closed = True + self._transport.close() + + async def receive(self) -> tuple[bytes, IPSockAddrType]: + with self._receive_guard: + await AsyncIOBackend.checkpoint() + + # If the buffer is empty, ask for more data + if not self._protocol.read_queue and not self._transport.is_closing(): + self._protocol.read_event.clear() + await self._protocol.read_event.wait() + + try: + return self._protocol.read_queue.popleft() + except IndexError: + if self._closed: + raise ClosedResourceError from None + else: + raise BrokenResourceError from None + + async def send(self, item: UDPPacketType) -> None: + with self._send_guard: + await AsyncIOBackend.checkpoint() + await self._protocol.write_event.wait() + if self._closed: + raise ClosedResourceError + elif self._transport.is_closing(): + raise BrokenResourceError + else: + self._transport.sendto(*item) + + +class ConnectedUDPSocket(abc.ConnectedUDPSocket): + def __init__( + self, transport: asyncio.DatagramTransport, protocol: DatagramProtocol + ): + self._transport = transport + self._protocol = protocol + self._receive_guard = ResourceGuard("reading from") + self._send_guard = ResourceGuard("writing to") + self._closed = False + + @property + def _raw_socket(self) -> socket.socket: + return self._transport.get_extra_info("socket") + + async def aclose(self) -> None: + if not self._transport.is_closing(): + self._closed = True + self._transport.close() + + async def receive(self) -> bytes: + with self._receive_guard: + await AsyncIOBackend.checkpoint() + + # If the buffer is empty, ask for more data + if not self._protocol.read_queue and not self._transport.is_closing(): + self._protocol.read_event.clear() + await self._protocol.read_event.wait() + + try: + packet = self._protocol.read_queue.popleft() + except IndexError: + if self._closed: + raise ClosedResourceError from None + else: + raise BrokenResourceError from None + + return packet[0] + + async def send(self, item: bytes) -> None: + with self._send_guard: + await AsyncIOBackend.checkpoint() + await self._protocol.write_event.wait() + if self._closed: + raise ClosedResourceError + elif self._transport.is_closing(): + raise BrokenResourceError + else: + self._transport.sendto(item) + + +class UNIXDatagramSocket(_RawSocketMixin, abc.UNIXDatagramSocket): + async def receive(self) -> UNIXDatagramPacketType: + loop = get_running_loop() + await AsyncIOBackend.checkpoint() + with self._receive_guard: + while True: + try: + data = self._raw_socket.recvfrom(65536) + except BlockingIOError: + await self._wait_until_readable(loop) + except OSError as exc: + if self._closing: + raise ClosedResourceError from None + else: + raise BrokenResourceError from exc + else: + return data + + async def send(self, item: UNIXDatagramPacketType) -> None: + loop = get_running_loop() + await AsyncIOBackend.checkpoint() + with self._send_guard: + while True: + try: + self._raw_socket.sendto(*item) + except BlockingIOError: + await self._wait_until_writable(loop) + except OSError as exc: + if self._closing: + raise ClosedResourceError from None + else: + raise BrokenResourceError from exc + else: + return + + +class ConnectedUNIXDatagramSocket(_RawSocketMixin, abc.ConnectedUNIXDatagramSocket): + async def receive(self) -> bytes: + loop = get_running_loop() + await AsyncIOBackend.checkpoint() + with self._receive_guard: + while True: + try: + data = self._raw_socket.recv(65536) + except BlockingIOError: + await self._wait_until_readable(loop) + except OSError as exc: + if self._closing: + raise ClosedResourceError from None + else: + raise BrokenResourceError from exc + else: + return data + + async def send(self, item: bytes) -> None: + loop = get_running_loop() + await AsyncIOBackend.checkpoint() + with self._send_guard: + while True: + try: + self._raw_socket.send(item) + except BlockingIOError: + await self._wait_until_writable(loop) + except OSError as exc: + if self._closing: + raise ClosedResourceError from None + else: + raise BrokenResourceError from exc + else: + return + + +_read_events: RunVar[dict[int, asyncio.Future[bool]]] = RunVar("read_events") +_write_events: RunVar[dict[int, asyncio.Future[bool]]] = RunVar("write_events") + + +# +# Synchronization +# + + +class Event(BaseEvent): + def __new__(cls) -> Event: + return object.__new__(cls) + + def __init__(self) -> None: + self._event = asyncio.Event() + + def set(self) -> None: + self._event.set() + + def is_set(self) -> bool: + return self._event.is_set() + + async def wait(self) -> None: + if self.is_set(): + await AsyncIOBackend.checkpoint() + else: + await self._event.wait() + + def statistics(self) -> EventStatistics: + return EventStatistics(len(self._event._waiters)) + + +class Lock(BaseLock): + def __new__(cls, *, fast_acquire: bool = False) -> Lock: + return object.__new__(cls) + + def __init__(self, *, fast_acquire: bool = False) -> None: + self._fast_acquire = fast_acquire + self._owner_task: asyncio.Task | None = None + self._waiters: deque[tuple[asyncio.Task, asyncio.Future]] = deque() + + async def acquire(self) -> None: + task = cast(asyncio.Task, current_task()) + if self._owner_task is None and not self._waiters: + await AsyncIOBackend.checkpoint_if_cancelled() + self._owner_task = task + + # Unless on the "fast path", yield control of the event loop so that other + # tasks can run too + if not self._fast_acquire: + try: + await AsyncIOBackend.cancel_shielded_checkpoint() + except CancelledError: + self.release() + raise + + return + + if self._owner_task == task: + raise RuntimeError("Attempted to acquire an already held Lock") + + fut: asyncio.Future[None] = asyncio.Future() + item = task, fut + self._waiters.append(item) + try: + await fut + except CancelledError: + self._waiters.remove(item) + if self._owner_task is task: + self.release() + + raise + + self._waiters.remove(item) + + def acquire_nowait(self) -> None: + task = cast(asyncio.Task, current_task()) + if self._owner_task is None and not self._waiters: + self._owner_task = task + return + + if self._owner_task is task: + raise RuntimeError("Attempted to acquire an already held Lock") + + raise WouldBlock + + def locked(self) -> bool: + return self._owner_task is not None + + def release(self) -> None: + if self._owner_task != current_task(): + raise RuntimeError("The current task is not holding this lock") + + for task, fut in self._waiters: + if not fut.cancelled(): + self._owner_task = task + fut.set_result(None) + return + + self._owner_task = None + + def statistics(self) -> LockStatistics: + task_info = AsyncIOTaskInfo(self._owner_task) if self._owner_task else None + return LockStatistics(self.locked(), task_info, len(self._waiters)) + + +class Semaphore(BaseSemaphore): + def __new__( + cls, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ) -> Semaphore: + return object.__new__(cls) + + def __init__( + self, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ): + super().__init__(initial_value, max_value=max_value) + self._value = initial_value + self._max_value = max_value + self._fast_acquire = fast_acquire + self._waiters: deque[asyncio.Future[None]] = deque() + + async def acquire(self) -> None: + if self._value > 0 and not self._waiters: + await AsyncIOBackend.checkpoint_if_cancelled() + self._value -= 1 + + # Unless on the "fast path", yield control of the event loop so that other + # tasks can run too + if not self._fast_acquire: + try: + await AsyncIOBackend.cancel_shielded_checkpoint() + except CancelledError: + self.release() + raise + + return + + fut: asyncio.Future[None] = asyncio.Future() + self._waiters.append(fut) + try: + await fut + except CancelledError: + try: + self._waiters.remove(fut) + except ValueError: + self.release() + + raise + + def acquire_nowait(self) -> None: + if self._value == 0: + raise WouldBlock + + self._value -= 1 + + def release(self) -> None: + if self._max_value is not None and self._value == self._max_value: + raise ValueError("semaphore released too many times") + + for fut in self._waiters: + if not fut.cancelled(): + fut.set_result(None) + self._waiters.remove(fut) + return + + self._value += 1 + + @property + def value(self) -> int: + return self._value + + @property + def max_value(self) -> int | None: + return self._max_value + + def statistics(self) -> SemaphoreStatistics: + return SemaphoreStatistics(len(self._waiters)) + + +class CapacityLimiter(BaseCapacityLimiter): + _total_tokens: float = 0 + + def __new__(cls, total_tokens: float) -> CapacityLimiter: + return object.__new__(cls) + + def __init__(self, total_tokens: float): + self._borrowers: set[Any] = set() + self._wait_queue: OrderedDict[Any, asyncio.Event] = OrderedDict() + self.total_tokens = total_tokens + + async def __aenter__(self) -> None: + await self.acquire() + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.release() + + @property + def total_tokens(self) -> float: + return self._total_tokens + + @total_tokens.setter + def total_tokens(self, value: float) -> None: + if not isinstance(value, int) and not math.isinf(value): + raise TypeError("total_tokens must be an int or math.inf") + if value < 1: + raise ValueError("total_tokens must be >= 1") + + waiters_to_notify = max(value - self._total_tokens, 0) + self._total_tokens = value + + # Notify waiting tasks that they have acquired the limiter + while self._wait_queue and waiters_to_notify: + event = self._wait_queue.popitem(last=False)[1] + event.set() + waiters_to_notify -= 1 + + @property + def borrowed_tokens(self) -> int: + return len(self._borrowers) + + @property + def available_tokens(self) -> float: + return self._total_tokens - len(self._borrowers) + + def _notify_next_waiter(self) -> None: + """Notify the next task in line if this limiter has free capacity now.""" + if self._wait_queue and len(self._borrowers) < self._total_tokens: + event = self._wait_queue.popitem(last=False)[1] + event.set() + + def acquire_nowait(self) -> None: + self.acquire_on_behalf_of_nowait(current_task()) + + def acquire_on_behalf_of_nowait(self, borrower: object) -> None: + if borrower in self._borrowers: + raise RuntimeError( + "this borrower is already holding one of this CapacityLimiter's tokens" + ) + + if self._wait_queue or len(self._borrowers) >= self._total_tokens: + raise WouldBlock + + self._borrowers.add(borrower) + + async def acquire(self) -> None: + return await self.acquire_on_behalf_of(current_task()) + + async def acquire_on_behalf_of(self, borrower: object) -> None: + await AsyncIOBackend.checkpoint_if_cancelled() + try: + self.acquire_on_behalf_of_nowait(borrower) + except WouldBlock: + event = asyncio.Event() + self._wait_queue[borrower] = event + try: + await event.wait() + except BaseException: + self._wait_queue.pop(borrower, None) + if event.is_set(): + self._notify_next_waiter() + + raise + + self._borrowers.add(borrower) + else: + try: + await AsyncIOBackend.cancel_shielded_checkpoint() + except BaseException: + self.release() + raise + + def release(self) -> None: + self.release_on_behalf_of(current_task()) + + def release_on_behalf_of(self, borrower: object) -> None: + try: + self._borrowers.remove(borrower) + except KeyError: + raise RuntimeError( + "this borrower isn't holding any of this CapacityLimiter's tokens" + ) from None + + self._notify_next_waiter() + + def statistics(self) -> CapacityLimiterStatistics: + return CapacityLimiterStatistics( + self.borrowed_tokens, + self.total_tokens, + tuple(self._borrowers), + len(self._wait_queue), + ) + + +_default_thread_limiter: RunVar[CapacityLimiter] = RunVar("_default_thread_limiter") + + +# +# Operating system signals +# + + +class _SignalReceiver: + def __init__(self, signals: tuple[Signals, ...]): + self._signals = signals + self._loop = get_running_loop() + self._signal_queue: deque[Signals] = deque() + self._future: asyncio.Future = asyncio.Future() + self._handled_signals: set[Signals] = set() + + def _deliver(self, signum: Signals) -> None: + self._signal_queue.append(signum) + if not self._future.done(): + self._future.set_result(None) + + def __enter__(self) -> _SignalReceiver: + for sig in set(self._signals): + self._loop.add_signal_handler(sig, self._deliver, sig) + self._handled_signals.add(sig) + + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + for sig in self._handled_signals: + self._loop.remove_signal_handler(sig) + + def __aiter__(self) -> _SignalReceiver: + return self + + async def __anext__(self) -> Signals: + await AsyncIOBackend.checkpoint() + if not self._signal_queue: + self._future = asyncio.Future() + await self._future + + return self._signal_queue.popleft() + + +# +# Testing and debugging +# + + +class AsyncIOTaskInfo(TaskInfo): + def __init__(self, task: asyncio.Task): + task_state = _task_states.get(task) + if task_state is None: + parent_id = None + else: + parent_id = task_state.parent_id + + coro = task.get_coro() + assert coro is not None, "created TaskInfo from a completed Task" + super().__init__(id(task), parent_id, task.get_name(), coro) + self._task = weakref.ref(task) + + def has_pending_cancellation(self) -> bool: + if not (task := self._task()): + # If the task isn't around anymore, it won't have a pending cancellation + return False + + if task._must_cancel: # type: ignore[attr-defined] + return True + elif ( + isinstance(task._fut_waiter, asyncio.Future) # type: ignore[attr-defined] + and task._fut_waiter.cancelled() # type: ignore[attr-defined] + ): + return True + + if task_state := _task_states.get(task): + if cancel_scope := task_state.cancel_scope: + return cancel_scope._effectively_cancelled + + return False + + +class TestRunner(abc.TestRunner): + _send_stream: MemoryObjectSendStream[tuple[Awaitable[Any], asyncio.Future[Any]]] + + def __init__( + self, + *, + debug: bool | None = None, + use_uvloop: bool = False, + loop_factory: Callable[[], AbstractEventLoop] | None = None, + ) -> None: + if use_uvloop and loop_factory is None: + import uvloop + + loop_factory = uvloop.new_event_loop + + self._runner = Runner(debug=debug, loop_factory=loop_factory) + self._exceptions: list[BaseException] = [] + self._runner_task: asyncio.Task | None = None + + def __enter__(self) -> TestRunner: + self._runner.__enter__() + self.get_loop().set_exception_handler(self._exception_handler) + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self._runner.__exit__(exc_type, exc_val, exc_tb) + + def get_loop(self) -> AbstractEventLoop: + return self._runner.get_loop() + + def _exception_handler( + self, loop: asyncio.AbstractEventLoop, context: dict[str, Any] + ) -> None: + if isinstance(context.get("exception"), Exception): + self._exceptions.append(context["exception"]) + else: + loop.default_exception_handler(context) + + def _raise_async_exceptions(self) -> None: + # Re-raise any exceptions raised in asynchronous callbacks + if self._exceptions: + exceptions, self._exceptions = self._exceptions, [] + if len(exceptions) == 1: + raise exceptions[0] + elif exceptions: + raise BaseExceptionGroup( + "Multiple exceptions occurred in asynchronous callbacks", exceptions + ) + + async def _run_tests_and_fixtures( + self, + receive_stream: MemoryObjectReceiveStream[ + tuple[Awaitable[T_Retval], asyncio.Future[T_Retval]] + ], + ) -> None: + from _pytest.outcomes import OutcomeException + + with receive_stream, self._send_stream: + async for coro, future in receive_stream: + try: + retval = await coro + except CancelledError as exc: + if not future.cancelled(): + future.cancel(*exc.args) + + raise + except BaseException as exc: + if not future.cancelled(): + future.set_exception(exc) + + if not isinstance(exc, (Exception, OutcomeException)): + raise + else: + if not future.cancelled(): + future.set_result(retval) + + async def _call_in_runner_task( + self, + func: Callable[P, Awaitable[T_Retval]], + *args: P.args, + **kwargs: P.kwargs, + ) -> T_Retval: + if not self._runner_task: + self._send_stream, receive_stream = create_memory_object_stream[ + tuple[Awaitable[Any], asyncio.Future] + ](1) + self._runner_task = self.get_loop().create_task( + self._run_tests_and_fixtures(receive_stream) + ) + + coro = func(*args, **kwargs) + future: asyncio.Future[T_Retval] = self.get_loop().create_future() + self._send_stream.send_nowait((coro, future)) + return await future + + def run_asyncgen_fixture( + self, + fixture_func: Callable[..., AsyncGenerator[T_Retval, Any]], + kwargs: dict[str, Any], + ) -> Iterable[T_Retval]: + asyncgen = fixture_func(**kwargs) + fixturevalue: T_Retval = self.get_loop().run_until_complete( + self._call_in_runner_task(asyncgen.asend, None) + ) + self._raise_async_exceptions() + + yield fixturevalue + + try: + self.get_loop().run_until_complete( + self._call_in_runner_task(asyncgen.asend, None) + ) + except StopAsyncIteration: + self._raise_async_exceptions() + else: + self.get_loop().run_until_complete(asyncgen.aclose()) + raise RuntimeError("Async generator fixture did not stop") + + def run_fixture( + self, + fixture_func: Callable[..., Coroutine[Any, Any, T_Retval]], + kwargs: dict[str, Any], + ) -> T_Retval: + retval = self.get_loop().run_until_complete( + self._call_in_runner_task(fixture_func, **kwargs) + ) + self._raise_async_exceptions() + return retval + + def run_test( + self, test_func: Callable[..., Coroutine[Any, Any, Any]], kwargs: dict[str, Any] + ) -> None: + try: + self.get_loop().run_until_complete( + self._call_in_runner_task(test_func, **kwargs) + ) + except Exception as exc: + self._exceptions.append(exc) + + self._raise_async_exceptions() + + +class AsyncIOBackend(AsyncBackend): + @classmethod + def run( + cls, + func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], + args: tuple[Unpack[PosArgsT]], + kwargs: dict[str, Any], + options: dict[str, Any], + ) -> T_Retval: + @wraps(func) + async def wrapper() -> T_Retval: + task = cast(asyncio.Task, current_task()) + task.set_name(get_callable_name(func)) + _task_states[task] = TaskState(None, None) + + try: + return await func(*args) + finally: + del _task_states[task] + + debug = options.get("debug", None) + loop_factory = options.get("loop_factory", None) + if loop_factory is None and options.get("use_uvloop", False): + import uvloop + + loop_factory = uvloop.new_event_loop + + with Runner(debug=debug, loop_factory=loop_factory) as runner: + return runner.run(wrapper()) + + @classmethod + def current_token(cls) -> object: + return get_running_loop() + + @classmethod + def current_time(cls) -> float: + return get_running_loop().time() + + @classmethod + def cancelled_exception_class(cls) -> type[BaseException]: + return CancelledError + + @classmethod + async def checkpoint(cls) -> None: + await sleep(0) + + @classmethod + async def checkpoint_if_cancelled(cls) -> None: + task = current_task() + if task is None: + return + + try: + cancel_scope = _task_states[task].cancel_scope + except KeyError: + return + + while cancel_scope: + if cancel_scope.cancel_called: + await sleep(0) + elif cancel_scope.shield: + break + else: + cancel_scope = cancel_scope._parent_scope + + @classmethod + async def cancel_shielded_checkpoint(cls) -> None: + with CancelScope(shield=True): + await sleep(0) + + @classmethod + async def sleep(cls, delay: float) -> None: + await sleep(delay) + + @classmethod + def create_cancel_scope( + cls, *, deadline: float = math.inf, shield: bool = False + ) -> CancelScope: + return CancelScope(deadline=deadline, shield=shield) + + @classmethod + def current_effective_deadline(cls) -> float: + if (task := current_task()) is None: + return math.inf + + try: + cancel_scope = _task_states[task].cancel_scope + except KeyError: + return math.inf + + deadline = math.inf + while cancel_scope: + deadline = min(deadline, cancel_scope.deadline) + if cancel_scope._cancel_called: + deadline = -math.inf + break + elif cancel_scope.shield: + break + else: + cancel_scope = cancel_scope._parent_scope + + return deadline + + @classmethod + def create_task_group(cls) -> abc.TaskGroup: + return TaskGroup() + + @classmethod + def create_event(cls) -> abc.Event: + return Event() + + @classmethod + def create_lock(cls, *, fast_acquire: bool) -> abc.Lock: + return Lock(fast_acquire=fast_acquire) + + @classmethod + def create_semaphore( + cls, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ) -> abc.Semaphore: + return Semaphore(initial_value, max_value=max_value, fast_acquire=fast_acquire) + + @classmethod + def create_capacity_limiter(cls, total_tokens: float) -> abc.CapacityLimiter: + return CapacityLimiter(total_tokens) + + @classmethod + async def run_sync_in_worker_thread( # type: ignore[return] + cls, + func: Callable[[Unpack[PosArgsT]], T_Retval], + args: tuple[Unpack[PosArgsT]], + abandon_on_cancel: bool = False, + limiter: abc.CapacityLimiter | None = None, + ) -> T_Retval: + await cls.checkpoint() + + # If this is the first run in this event loop thread, set up the necessary + # variables + try: + idle_workers = _threadpool_idle_workers.get() + workers = _threadpool_workers.get() + except LookupError: + idle_workers = deque() + workers = set() + _threadpool_idle_workers.set(idle_workers) + _threadpool_workers.set(workers) + + async with limiter or cls.current_default_thread_limiter(): + with CancelScope(shield=not abandon_on_cancel) as scope: + future = asyncio.Future[T_Retval]() + root_task = find_root_task() + if not idle_workers: + worker = WorkerThread(root_task, workers, idle_workers) + worker.start() + workers.add(worker) + root_task.add_done_callback( + worker.stop, context=contextvars.Context() + ) + else: + worker = idle_workers.pop() + + # Prune any other workers that have been idle for MAX_IDLE_TIME + # seconds or longer + now = cls.current_time() + while idle_workers: + if ( + now - idle_workers[0].idle_since + < WorkerThread.MAX_IDLE_TIME + ): + break + + expired_worker = idle_workers.popleft() + expired_worker.root_task.remove_done_callback( + expired_worker.stop + ) + expired_worker.stop() + + context = copy_context() + context.run(sniffio.current_async_library_cvar.set, None) + if abandon_on_cancel or scope._parent_scope is None: + worker_scope = scope + else: + worker_scope = scope._parent_scope + + worker.queue.put_nowait((context, func, args, future, worker_scope)) + return await future + + @classmethod + def check_cancelled(cls) -> None: + scope: CancelScope | None = threadlocals.current_cancel_scope + while scope is not None: + if scope.cancel_called: + raise CancelledError(f"Cancelled by cancel scope {id(scope):x}") + + if scope.shield: + return + + scope = scope._parent_scope + + @classmethod + def run_async_from_thread( + cls, + func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], + args: tuple[Unpack[PosArgsT]], + token: object, + ) -> T_Retval: + async def task_wrapper(scope: CancelScope) -> T_Retval: + __tracebackhide__ = True + task = cast(asyncio.Task, current_task()) + _task_states[task] = TaskState(None, scope) + scope._tasks.add(task) + try: + return await func(*args) + except CancelledError as exc: + raise concurrent.futures.CancelledError(str(exc)) from None + finally: + scope._tasks.discard(task) + + loop = cast(AbstractEventLoop, token) + context = copy_context() + context.run(sniffio.current_async_library_cvar.set, "asyncio") + wrapper = task_wrapper(threadlocals.current_cancel_scope) + f: concurrent.futures.Future[T_Retval] = context.run( + asyncio.run_coroutine_threadsafe, wrapper, loop + ) + return f.result() + + @classmethod + def run_sync_from_thread( + cls, + func: Callable[[Unpack[PosArgsT]], T_Retval], + args: tuple[Unpack[PosArgsT]], + token: object, + ) -> T_Retval: + @wraps(func) + def wrapper() -> None: + try: + sniffio.current_async_library_cvar.set("asyncio") + f.set_result(func(*args)) + except BaseException as exc: + f.set_exception(exc) + if not isinstance(exc, Exception): + raise + + f: concurrent.futures.Future[T_Retval] = Future() + loop = cast(AbstractEventLoop, token) + loop.call_soon_threadsafe(wrapper) + return f.result() + + @classmethod + def create_blocking_portal(cls) -> abc.BlockingPortal: + return BlockingPortal() + + @classmethod + async def open_process( + cls, + command: StrOrBytesPath | Sequence[StrOrBytesPath], + *, + stdin: int | IO[Any] | None, + stdout: int | IO[Any] | None, + stderr: int | IO[Any] | None, + **kwargs: Any, + ) -> Process: + await cls.checkpoint() + if isinstance(command, PathLike): + command = os.fspath(command) + + if isinstance(command, (str, bytes)): + process = await asyncio.create_subprocess_shell( + command, + stdin=stdin, + stdout=stdout, + stderr=stderr, + **kwargs, + ) + else: + process = await asyncio.create_subprocess_exec( + *command, + stdin=stdin, + stdout=stdout, + stderr=stderr, + **kwargs, + ) + + stdin_stream = StreamWriterWrapper(process.stdin) if process.stdin else None + stdout_stream = StreamReaderWrapper(process.stdout) if process.stdout else None + stderr_stream = StreamReaderWrapper(process.stderr) if process.stderr else None + return Process(process, stdin_stream, stdout_stream, stderr_stream) + + @classmethod + def setup_process_pool_exit_at_shutdown(cls, workers: set[abc.Process]) -> None: + create_task( + _shutdown_process_pool_on_exit(workers), + name="AnyIO process pool shutdown task", + ) + find_root_task().add_done_callback( + partial(_forcibly_shutdown_process_pool_on_exit, workers) # type:ignore[arg-type] + ) + + @classmethod + async def connect_tcp( + cls, host: str, port: int, local_address: IPSockAddrType | None = None + ) -> abc.SocketStream: + transport, protocol = cast( + tuple[asyncio.Transport, StreamProtocol], + await get_running_loop().create_connection( + StreamProtocol, host, port, local_addr=local_address + ), + ) + transport.pause_reading() + return SocketStream(transport, protocol) + + @classmethod + async def connect_unix(cls, path: str | bytes) -> abc.UNIXSocketStream: + await cls.checkpoint() + loop = get_running_loop() + raw_socket = socket.socket(socket.AF_UNIX) + raw_socket.setblocking(False) + while True: + try: + raw_socket.connect(path) + except BlockingIOError: + f: asyncio.Future = asyncio.Future() + loop.add_writer(raw_socket, f.set_result, None) + f.add_done_callback(lambda _: loop.remove_writer(raw_socket)) + await f + except BaseException: + raw_socket.close() + raise + else: + return UNIXSocketStream(raw_socket) + + @classmethod + def create_tcp_listener(cls, sock: socket.socket) -> SocketListener: + return TCPSocketListener(sock) + + @classmethod + def create_unix_listener(cls, sock: socket.socket) -> SocketListener: + return UNIXSocketListener(sock) + + @classmethod + async def create_udp_socket( + cls, + family: AddressFamily, + local_address: IPSockAddrType | None, + remote_address: IPSockAddrType | None, + reuse_port: bool, + ) -> UDPSocket | ConnectedUDPSocket: + transport, protocol = await get_running_loop().create_datagram_endpoint( + DatagramProtocol, + local_addr=local_address, + remote_addr=remote_address, + family=family, + reuse_port=reuse_port, + ) + if protocol.exception: + transport.close() + raise protocol.exception + + if not remote_address: + return UDPSocket(transport, protocol) + else: + return ConnectedUDPSocket(transport, protocol) + + @classmethod + async def create_unix_datagram_socket( # type: ignore[override] + cls, raw_socket: socket.socket, remote_path: str | bytes | None + ) -> abc.UNIXDatagramSocket | abc.ConnectedUNIXDatagramSocket: + await cls.checkpoint() + loop = get_running_loop() + + if remote_path: + while True: + try: + raw_socket.connect(remote_path) + except BlockingIOError: + f: asyncio.Future = asyncio.Future() + loop.add_writer(raw_socket, f.set_result, None) + f.add_done_callback(lambda _: loop.remove_writer(raw_socket)) + await f + except BaseException: + raw_socket.close() + raise + else: + return ConnectedUNIXDatagramSocket(raw_socket) + else: + return UNIXDatagramSocket(raw_socket) + + @classmethod + async def getaddrinfo( + cls, + host: bytes | str | None, + port: str | int | None, + *, + family: int | AddressFamily = 0, + type: int | SocketKind = 0, + proto: int = 0, + flags: int = 0, + ) -> Sequence[ + tuple[ + AddressFamily, + SocketKind, + int, + str, + tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes], + ] + ]: + return await get_running_loop().getaddrinfo( + host, port, family=family, type=type, proto=proto, flags=flags + ) + + @classmethod + async def getnameinfo( + cls, sockaddr: IPSockAddrType, flags: int = 0 + ) -> tuple[str, str]: + return await get_running_loop().getnameinfo(sockaddr, flags) + + @classmethod + async def wait_readable(cls, obj: FileDescriptorLike) -> None: + try: + read_events = _read_events.get() + except LookupError: + read_events = {} + _read_events.set(read_events) + + fd = obj if isinstance(obj, int) else obj.fileno() + if read_events.get(fd): + raise BusyResourceError("reading from") + + loop = get_running_loop() + fut: asyncio.Future[bool] = loop.create_future() + + def cb() -> None: + try: + del read_events[fd] + except KeyError: + pass + else: + remove_reader(fd) + + try: + fut.set_result(True) + except asyncio.InvalidStateError: + pass + + try: + loop.add_reader(fd, cb) + except NotImplementedError: + from anyio._core._asyncio_selector_thread import get_selector + + selector = get_selector() + selector.add_reader(fd, cb) + remove_reader = selector.remove_reader + else: + remove_reader = loop.remove_reader + + read_events[fd] = fut + try: + success = await fut + finally: + try: + del read_events[fd] + except KeyError: + pass + else: + remove_reader(fd) + + if not success: + raise ClosedResourceError + + @classmethod + async def wait_writable(cls, obj: FileDescriptorLike) -> None: + try: + write_events = _write_events.get() + except LookupError: + write_events = {} + _write_events.set(write_events) + + fd = obj if isinstance(obj, int) else obj.fileno() + if write_events.get(fd): + raise BusyResourceError("writing to") + + loop = get_running_loop() + fut: asyncio.Future[bool] = loop.create_future() + + def cb() -> None: + try: + del write_events[fd] + except KeyError: + pass + else: + remove_writer(fd) + + try: + fut.set_result(True) + except asyncio.InvalidStateError: + pass + + try: + loop.add_writer(fd, cb) + except NotImplementedError: + from anyio._core._asyncio_selector_thread import get_selector + + selector = get_selector() + selector.add_writer(fd, cb) + remove_writer = selector.remove_writer + else: + remove_writer = loop.remove_writer + + write_events[fd] = fut + try: + success = await fut + finally: + try: + del write_events[fd] + except KeyError: + pass + else: + remove_writer(fd) + + if not success: + raise ClosedResourceError + + @classmethod + def notify_closing(cls, obj: FileDescriptorLike) -> None: + fd = obj if isinstance(obj, int) else obj.fileno() + loop = get_running_loop() + + try: + write_events = _write_events.get() + except LookupError: + pass + else: + try: + fut = write_events.pop(fd) + except KeyError: + pass + else: + try: + fut.set_result(False) + except asyncio.InvalidStateError: + pass + + try: + loop.remove_writer(fd) + except NotImplementedError: + from anyio._core._asyncio_selector_thread import get_selector + + get_selector().remove_writer(fd) + + try: + read_events = _read_events.get() + except LookupError: + pass + else: + try: + fut = read_events.pop(fd) + except KeyError: + pass + else: + try: + fut.set_result(False) + except asyncio.InvalidStateError: + pass + + try: + loop.remove_reader(fd) + except NotImplementedError: + from anyio._core._asyncio_selector_thread import get_selector + + get_selector().remove_reader(fd) + + @classmethod + async def wrap_listener_socket(cls, sock: socket.socket) -> SocketListener: + return TCPSocketListener(sock) + + @classmethod + async def wrap_stream_socket(cls, sock: socket.socket) -> SocketStream: + transport, protocol = await get_running_loop().create_connection( + StreamProtocol, sock=sock + ) + return SocketStream(transport, protocol) + + @classmethod + async def wrap_unix_stream_socket(cls, sock: socket.socket) -> UNIXSocketStream: + return UNIXSocketStream(sock) + + @classmethod + async def wrap_udp_socket(cls, sock: socket.socket) -> UDPSocket: + transport, protocol = await get_running_loop().create_datagram_endpoint( + DatagramProtocol, sock=sock + ) + return UDPSocket(transport, protocol) + + @classmethod + async def wrap_connected_udp_socket(cls, sock: socket.socket) -> ConnectedUDPSocket: + transport, protocol = await get_running_loop().create_datagram_endpoint( + DatagramProtocol, sock=sock + ) + return ConnectedUDPSocket(transport, protocol) + + @classmethod + async def wrap_unix_datagram_socket(cls, sock: socket.socket) -> UNIXDatagramSocket: + return UNIXDatagramSocket(sock) + + @classmethod + async def wrap_connected_unix_datagram_socket( + cls, sock: socket.socket + ) -> ConnectedUNIXDatagramSocket: + return ConnectedUNIXDatagramSocket(sock) + + @classmethod + def current_default_thread_limiter(cls) -> CapacityLimiter: + try: + return _default_thread_limiter.get() + except LookupError: + limiter = CapacityLimiter(40) + _default_thread_limiter.set(limiter) + return limiter + + @classmethod + def open_signal_receiver( + cls, *signals: Signals + ) -> AbstractContextManager[AsyncIterator[Signals]]: + return _SignalReceiver(signals) + + @classmethod + def get_current_task(cls) -> TaskInfo: + return AsyncIOTaskInfo(current_task()) # type: ignore[arg-type] + + @classmethod + def get_running_tasks(cls) -> Sequence[TaskInfo]: + return [AsyncIOTaskInfo(task) for task in all_tasks() if not task.done()] + + @classmethod + async def wait_all_tasks_blocked(cls) -> None: + await cls.checkpoint() + this_task = current_task() + while True: + for task in all_tasks(): + if task is this_task: + continue + + waiter = task._fut_waiter # type: ignore[attr-defined] + if waiter is None or waiter.done(): + await sleep(0.1) + break + else: + return + + @classmethod + def create_test_runner(cls, options: dict[str, Any]) -> TestRunner: + return TestRunner(**options) + + +backend_class = AsyncIOBackend diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/_trio.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/_trio.py new file mode 100644 index 0000000000000000000000000000000000000000..021f11170f0900511f8be3c92441d519c38f0e26 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_backends/_trio.py @@ -0,0 +1,1375 @@ +from __future__ import annotations + +import array +import math +import os +import socket +import sys +import types +import weakref +from collections.abc import ( + AsyncGenerator, + AsyncIterator, + Awaitable, + Callable, + Collection, + Coroutine, + Iterable, + Sequence, +) +from concurrent.futures import Future +from contextlib import AbstractContextManager +from dataclasses import dataclass +from functools import partial +from io import IOBase +from os import PathLike +from signal import Signals +from socket import AddressFamily, SocketKind +from types import TracebackType +from typing import ( + IO, + TYPE_CHECKING, + Any, + Generic, + NoReturn, + TypeVar, + cast, + overload, +) + +import trio.from_thread +import trio.lowlevel +from outcome import Error, Outcome, Value +from trio.lowlevel import ( + current_root_task, + current_task, + notify_closing, + wait_readable, + wait_writable, +) +from trio.socket import SocketType as TrioSocketType +from trio.to_thread import run_sync + +from .. import ( + CapacityLimiterStatistics, + EventStatistics, + LockStatistics, + TaskInfo, + WouldBlock, + abc, +) +from .._core._eventloop import claim_worker_thread +from .._core._exceptions import ( + BrokenResourceError, + BusyResourceError, + ClosedResourceError, + EndOfStream, +) +from .._core._sockets import convert_ipv6_sockaddr +from .._core._streams import create_memory_object_stream +from .._core._synchronization import ( + CapacityLimiter as BaseCapacityLimiter, +) +from .._core._synchronization import Event as BaseEvent +from .._core._synchronization import Lock as BaseLock +from .._core._synchronization import ( + ResourceGuard, + SemaphoreStatistics, +) +from .._core._synchronization import Semaphore as BaseSemaphore +from .._core._tasks import CancelScope as BaseCancelScope +from ..abc import IPSockAddrType, UDPPacketType, UNIXDatagramPacketType +from ..abc._eventloop import AsyncBackend, StrOrBytesPath +from ..streams.memory import MemoryObjectSendStream + +if TYPE_CHECKING: + from _typeshed import FileDescriptorLike + +if sys.version_info >= (3, 10): + from typing import ParamSpec +else: + from typing_extensions import ParamSpec + +if sys.version_info >= (3, 11): + from typing import TypeVarTuple, Unpack +else: + from exceptiongroup import BaseExceptionGroup + from typing_extensions import TypeVarTuple, Unpack + +T = TypeVar("T") +T_Retval = TypeVar("T_Retval") +T_SockAddr = TypeVar("T_SockAddr", str, IPSockAddrType) +PosArgsT = TypeVarTuple("PosArgsT") +P = ParamSpec("P") + + +# +# Event loop +# + +RunVar = trio.lowlevel.RunVar + + +# +# Timeouts and cancellation +# + + +class CancelScope(BaseCancelScope): + def __new__( + cls, original: trio.CancelScope | None = None, **kwargs: object + ) -> CancelScope: + return object.__new__(cls) + + def __init__(self, original: trio.CancelScope | None = None, **kwargs: Any) -> None: + self.__original = original or trio.CancelScope(**kwargs) + + def __enter__(self) -> CancelScope: + self.__original.__enter__() + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> bool: + return self.__original.__exit__(exc_type, exc_val, exc_tb) + + def cancel(self) -> None: + self.__original.cancel() + + @property + def deadline(self) -> float: + return self.__original.deadline + + @deadline.setter + def deadline(self, value: float) -> None: + self.__original.deadline = value + + @property + def cancel_called(self) -> bool: + return self.__original.cancel_called + + @property + def cancelled_caught(self) -> bool: + return self.__original.cancelled_caught + + @property + def shield(self) -> bool: + return self.__original.shield + + @shield.setter + def shield(self, value: bool) -> None: + self.__original.shield = value + + +# +# Task groups +# + + +class TaskGroup(abc.TaskGroup): + def __init__(self) -> None: + self._active = False + self._nursery_manager = trio.open_nursery(strict_exception_groups=True) + self.cancel_scope = None # type: ignore[assignment] + + async def __aenter__(self) -> TaskGroup: + self._active = True + self._nursery = await self._nursery_manager.__aenter__() + self.cancel_scope = CancelScope(self._nursery.cancel_scope) + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> bool: + try: + # trio.Nursery.__exit__ returns bool; .open_nursery has wrong type + return await self._nursery_manager.__aexit__(exc_type, exc_val, exc_tb) # type: ignore[return-value] + except BaseExceptionGroup as exc: + if not exc.split(trio.Cancelled)[1]: + raise trio.Cancelled._create() from exc + + raise + finally: + del exc_val, exc_tb + self._active = False + + def start_soon( + self, + func: Callable[[Unpack[PosArgsT]], Awaitable[Any]], + *args: Unpack[PosArgsT], + name: object = None, + ) -> None: + if not self._active: + raise RuntimeError( + "This task group is not active; no new tasks can be started." + ) + + self._nursery.start_soon(func, *args, name=name) + + async def start( + self, func: Callable[..., Awaitable[Any]], *args: object, name: object = None + ) -> Any: + if not self._active: + raise RuntimeError( + "This task group is not active; no new tasks can be started." + ) + + return await self._nursery.start(func, *args, name=name) + + +# +# Threads +# + + +class BlockingPortal(abc.BlockingPortal): + def __new__(cls) -> BlockingPortal: + return object.__new__(cls) + + def __init__(self) -> None: + super().__init__() + self._token = trio.lowlevel.current_trio_token() + + def _spawn_task_from_thread( + self, + func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval] | T_Retval], + args: tuple[Unpack[PosArgsT]], + kwargs: dict[str, Any], + name: object, + future: Future[T_Retval], + ) -> None: + trio.from_thread.run_sync( + partial(self._task_group.start_soon, name=name), + self._call_func, + func, + args, + kwargs, + future, + trio_token=self._token, + ) + + +# +# Subprocesses +# + + +@dataclass(eq=False) +class ReceiveStreamWrapper(abc.ByteReceiveStream): + _stream: trio.abc.ReceiveStream + + async def receive(self, max_bytes: int | None = None) -> bytes: + try: + data = await self._stream.receive_some(max_bytes) + except trio.ClosedResourceError as exc: + raise ClosedResourceError from exc.__cause__ + except trio.BrokenResourceError as exc: + raise BrokenResourceError from exc.__cause__ + + if data: + return bytes(data) + else: + raise EndOfStream + + async def aclose(self) -> None: + await self._stream.aclose() + + +@dataclass(eq=False) +class SendStreamWrapper(abc.ByteSendStream): + _stream: trio.abc.SendStream + + async def send(self, item: bytes) -> None: + try: + await self._stream.send_all(item) + except trio.ClosedResourceError as exc: + raise ClosedResourceError from exc.__cause__ + except trio.BrokenResourceError as exc: + raise BrokenResourceError from exc.__cause__ + + async def aclose(self) -> None: + await self._stream.aclose() + + +@dataclass(eq=False) +class Process(abc.Process): + _process: trio.Process + _stdin: abc.ByteSendStream | None + _stdout: abc.ByteReceiveStream | None + _stderr: abc.ByteReceiveStream | None + + async def aclose(self) -> None: + with CancelScope(shield=True): + if self._stdin: + await self._stdin.aclose() + if self._stdout: + await self._stdout.aclose() + if self._stderr: + await self._stderr.aclose() + + try: + await self.wait() + except BaseException: + self.kill() + with CancelScope(shield=True): + await self.wait() + raise + + async def wait(self) -> int: + return await self._process.wait() + + def terminate(self) -> None: + self._process.terminate() + + def kill(self) -> None: + self._process.kill() + + def send_signal(self, signal: Signals) -> None: + self._process.send_signal(signal) + + @property + def pid(self) -> int: + return self._process.pid + + @property + def returncode(self) -> int | None: + return self._process.returncode + + @property + def stdin(self) -> abc.ByteSendStream | None: + return self._stdin + + @property + def stdout(self) -> abc.ByteReceiveStream | None: + return self._stdout + + @property + def stderr(self) -> abc.ByteReceiveStream | None: + return self._stderr + + +class _ProcessPoolShutdownInstrument(trio.abc.Instrument): + def after_run(self) -> None: + super().after_run() + + +current_default_worker_process_limiter: trio.lowlevel.RunVar = RunVar( + "current_default_worker_process_limiter" +) + + +async def _shutdown_process_pool(workers: set[abc.Process]) -> None: + try: + await trio.sleep(math.inf) + except trio.Cancelled: + for process in workers: + if process.returncode is None: + process.kill() + + with CancelScope(shield=True): + for process in workers: + await process.aclose() + + +# +# Sockets and networking +# + + +class _TrioSocketMixin(Generic[T_SockAddr]): + def __init__(self, trio_socket: TrioSocketType) -> None: + self._trio_socket = trio_socket + self._closed = False + + def _check_closed(self) -> None: + if self._closed: + raise ClosedResourceError + if self._trio_socket.fileno() < 0: + raise BrokenResourceError + + @property + def _raw_socket(self) -> socket.socket: + return self._trio_socket._sock # type: ignore[attr-defined] + + async def aclose(self) -> None: + if self._trio_socket.fileno() >= 0: + self._closed = True + self._trio_socket.close() + + def _convert_socket_error(self, exc: BaseException) -> NoReturn: + if isinstance(exc, trio.ClosedResourceError): + raise ClosedResourceError from exc + elif self._trio_socket.fileno() < 0 and self._closed: + raise ClosedResourceError from None + elif isinstance(exc, OSError): + raise BrokenResourceError from exc + else: + raise exc + + +class SocketStream(_TrioSocketMixin, abc.SocketStream): + def __init__(self, trio_socket: TrioSocketType) -> None: + super().__init__(trio_socket) + self._receive_guard = ResourceGuard("reading from") + self._send_guard = ResourceGuard("writing to") + + async def receive(self, max_bytes: int = 65536) -> bytes: + with self._receive_guard: + try: + data = await self._trio_socket.recv(max_bytes) + except BaseException as exc: + self._convert_socket_error(exc) + + if data: + return data + else: + raise EndOfStream + + async def send(self, item: bytes) -> None: + with self._send_guard: + view = memoryview(item) + while view: + try: + bytes_sent = await self._trio_socket.send(view) + except BaseException as exc: + self._convert_socket_error(exc) + + view = view[bytes_sent:] + + async def send_eof(self) -> None: + self._trio_socket.shutdown(socket.SHUT_WR) + + +class UNIXSocketStream(SocketStream, abc.UNIXSocketStream): + async def receive_fds(self, msglen: int, maxfds: int) -> tuple[bytes, list[int]]: + if not isinstance(msglen, int) or msglen < 0: + raise ValueError("msglen must be a non-negative integer") + if not isinstance(maxfds, int) or maxfds < 1: + raise ValueError("maxfds must be a positive integer") + + fds = array.array("i") + await trio.lowlevel.checkpoint() + with self._receive_guard: + while True: + try: + message, ancdata, flags, addr = await self._trio_socket.recvmsg( + msglen, socket.CMSG_LEN(maxfds * fds.itemsize) + ) + except BaseException as exc: + self._convert_socket_error(exc) + else: + if not message and not ancdata: + raise EndOfStream + + break + + for cmsg_level, cmsg_type, cmsg_data in ancdata: + if cmsg_level != socket.SOL_SOCKET or cmsg_type != socket.SCM_RIGHTS: + raise RuntimeError( + f"Received unexpected ancillary data; message = {message!r}, " + f"cmsg_level = {cmsg_level}, cmsg_type = {cmsg_type}" + ) + + fds.frombytes(cmsg_data[: len(cmsg_data) - (len(cmsg_data) % fds.itemsize)]) + + return message, list(fds) + + async def send_fds(self, message: bytes, fds: Collection[int | IOBase]) -> None: + if not message: + raise ValueError("message must not be empty") + if not fds: + raise ValueError("fds must not be empty") + + filenos: list[int] = [] + for fd in fds: + if isinstance(fd, int): + filenos.append(fd) + elif isinstance(fd, IOBase): + filenos.append(fd.fileno()) + + fdarray = array.array("i", filenos) + await trio.lowlevel.checkpoint() + with self._send_guard: + while True: + try: + await self._trio_socket.sendmsg( + [message], + [ + ( + socket.SOL_SOCKET, + socket.SCM_RIGHTS, + fdarray, + ) + ], + ) + break + except BaseException as exc: + self._convert_socket_error(exc) + + +class TCPSocketListener(_TrioSocketMixin, abc.SocketListener): + def __init__(self, raw_socket: socket.socket): + super().__init__(trio.socket.from_stdlib_socket(raw_socket)) + self._accept_guard = ResourceGuard("accepting connections from") + + async def accept(self) -> SocketStream: + with self._accept_guard: + try: + trio_socket, _addr = await self._trio_socket.accept() + except BaseException as exc: + self._convert_socket_error(exc) + + trio_socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) + return SocketStream(trio_socket) + + +class UNIXSocketListener(_TrioSocketMixin, abc.SocketListener): + def __init__(self, raw_socket: socket.socket): + super().__init__(trio.socket.from_stdlib_socket(raw_socket)) + self._accept_guard = ResourceGuard("accepting connections from") + + async def accept(self) -> UNIXSocketStream: + with self._accept_guard: + try: + trio_socket, _addr = await self._trio_socket.accept() + except BaseException as exc: + self._convert_socket_error(exc) + + return UNIXSocketStream(trio_socket) + + +class UDPSocket(_TrioSocketMixin[IPSockAddrType], abc.UDPSocket): + def __init__(self, trio_socket: TrioSocketType) -> None: + super().__init__(trio_socket) + self._receive_guard = ResourceGuard("reading from") + self._send_guard = ResourceGuard("writing to") + + async def receive(self) -> tuple[bytes, IPSockAddrType]: + with self._receive_guard: + try: + data, addr = await self._trio_socket.recvfrom(65536) + return data, convert_ipv6_sockaddr(addr) + except BaseException as exc: + self._convert_socket_error(exc) + + async def send(self, item: UDPPacketType) -> None: + with self._send_guard: + try: + await self._trio_socket.sendto(*item) + except BaseException as exc: + self._convert_socket_error(exc) + + +class ConnectedUDPSocket(_TrioSocketMixin[IPSockAddrType], abc.ConnectedUDPSocket): + def __init__(self, trio_socket: TrioSocketType) -> None: + super().__init__(trio_socket) + self._receive_guard = ResourceGuard("reading from") + self._send_guard = ResourceGuard("writing to") + + async def receive(self) -> bytes: + with self._receive_guard: + try: + return await self._trio_socket.recv(65536) + except BaseException as exc: + self._convert_socket_error(exc) + + async def send(self, item: bytes) -> None: + with self._send_guard: + try: + await self._trio_socket.send(item) + except BaseException as exc: + self._convert_socket_error(exc) + + +class UNIXDatagramSocket(_TrioSocketMixin[str], abc.UNIXDatagramSocket): + def __init__(self, trio_socket: TrioSocketType) -> None: + super().__init__(trio_socket) + self._receive_guard = ResourceGuard("reading from") + self._send_guard = ResourceGuard("writing to") + + async def receive(self) -> UNIXDatagramPacketType: + with self._receive_guard: + try: + data, addr = await self._trio_socket.recvfrom(65536) + return data, addr + except BaseException as exc: + self._convert_socket_error(exc) + + async def send(self, item: UNIXDatagramPacketType) -> None: + with self._send_guard: + try: + await self._trio_socket.sendto(*item) + except BaseException as exc: + self._convert_socket_error(exc) + + +class ConnectedUNIXDatagramSocket( + _TrioSocketMixin[str], abc.ConnectedUNIXDatagramSocket +): + def __init__(self, trio_socket: TrioSocketType) -> None: + super().__init__(trio_socket) + self._receive_guard = ResourceGuard("reading from") + self._send_guard = ResourceGuard("writing to") + + async def receive(self) -> bytes: + with self._receive_guard: + try: + return await self._trio_socket.recv(65536) + except BaseException as exc: + self._convert_socket_error(exc) + + async def send(self, item: bytes) -> None: + with self._send_guard: + try: + await self._trio_socket.send(item) + except BaseException as exc: + self._convert_socket_error(exc) + + +# +# Synchronization +# + + +class Event(BaseEvent): + def __new__(cls) -> Event: + return object.__new__(cls) + + def __init__(self) -> None: + self.__original = trio.Event() + + def is_set(self) -> bool: + return self.__original.is_set() + + async def wait(self) -> None: + return await self.__original.wait() + + def statistics(self) -> EventStatistics: + orig_statistics = self.__original.statistics() + return EventStatistics(tasks_waiting=orig_statistics.tasks_waiting) + + def set(self) -> None: + self.__original.set() + + +class Lock(BaseLock): + def __new__(cls, *, fast_acquire: bool = False) -> Lock: + return object.__new__(cls) + + def __init__(self, *, fast_acquire: bool = False) -> None: + self._fast_acquire = fast_acquire + self.__original = trio.Lock() + + @staticmethod + def _convert_runtime_error_msg(exc: RuntimeError) -> None: + if exc.args == ("attempt to re-acquire an already held Lock",): + exc.args = ("Attempted to acquire an already held Lock",) + + async def acquire(self) -> None: + if not self._fast_acquire: + try: + await self.__original.acquire() + except RuntimeError as exc: + self._convert_runtime_error_msg(exc) + raise + + return + + # This is the "fast path" where we don't let other tasks run + await trio.lowlevel.checkpoint_if_cancelled() + try: + self.__original.acquire_nowait() + except trio.WouldBlock: + await self.__original._lot.park() + except RuntimeError as exc: + self._convert_runtime_error_msg(exc) + raise + + def acquire_nowait(self) -> None: + try: + self.__original.acquire_nowait() + except trio.WouldBlock: + raise WouldBlock from None + except RuntimeError as exc: + self._convert_runtime_error_msg(exc) + raise + + def locked(self) -> bool: + return self.__original.locked() + + def release(self) -> None: + self.__original.release() + + def statistics(self) -> LockStatistics: + orig_statistics = self.__original.statistics() + owner = TrioTaskInfo(orig_statistics.owner) if orig_statistics.owner else None + return LockStatistics( + orig_statistics.locked, owner, orig_statistics.tasks_waiting + ) + + +class Semaphore(BaseSemaphore): + def __new__( + cls, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ) -> Semaphore: + return object.__new__(cls) + + def __init__( + self, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ) -> None: + super().__init__(initial_value, max_value=max_value, fast_acquire=fast_acquire) + self.__original = trio.Semaphore(initial_value, max_value=max_value) + + async def acquire(self) -> None: + if not self._fast_acquire: + await self.__original.acquire() + return + + # This is the "fast path" where we don't let other tasks run + await trio.lowlevel.checkpoint_if_cancelled() + try: + self.__original.acquire_nowait() + except trio.WouldBlock: + await self.__original._lot.park() + + def acquire_nowait(self) -> None: + try: + self.__original.acquire_nowait() + except trio.WouldBlock: + raise WouldBlock from None + + @property + def max_value(self) -> int | None: + return self.__original.max_value + + @property + def value(self) -> int: + return self.__original.value + + def release(self) -> None: + self.__original.release() + + def statistics(self) -> SemaphoreStatistics: + orig_statistics = self.__original.statistics() + return SemaphoreStatistics(orig_statistics.tasks_waiting) + + +class CapacityLimiter(BaseCapacityLimiter): + def __new__( + cls, + total_tokens: float | None = None, + *, + original: trio.CapacityLimiter | None = None, + ) -> CapacityLimiter: + return object.__new__(cls) + + def __init__( + self, + total_tokens: float | None = None, + *, + original: trio.CapacityLimiter | None = None, + ) -> None: + if original is not None: + self.__original = original + else: + assert total_tokens is not None + self.__original = trio.CapacityLimiter(total_tokens) + + async def __aenter__(self) -> None: + return await self.__original.__aenter__() + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + await self.__original.__aexit__(exc_type, exc_val, exc_tb) + + @property + def total_tokens(self) -> float: + return self.__original.total_tokens + + @total_tokens.setter + def total_tokens(self, value: float) -> None: + self.__original.total_tokens = value + + @property + def borrowed_tokens(self) -> int: + return self.__original.borrowed_tokens + + @property + def available_tokens(self) -> float: + return self.__original.available_tokens + + def acquire_nowait(self) -> None: + self.__original.acquire_nowait() + + def acquire_on_behalf_of_nowait(self, borrower: object) -> None: + self.__original.acquire_on_behalf_of_nowait(borrower) + + async def acquire(self) -> None: + await self.__original.acquire() + + async def acquire_on_behalf_of(self, borrower: object) -> None: + await self.__original.acquire_on_behalf_of(borrower) + + def release(self) -> None: + return self.__original.release() + + def release_on_behalf_of(self, borrower: object) -> None: + return self.__original.release_on_behalf_of(borrower) + + def statistics(self) -> CapacityLimiterStatistics: + orig = self.__original.statistics() + return CapacityLimiterStatistics( + borrowed_tokens=orig.borrowed_tokens, + total_tokens=orig.total_tokens, + borrowers=tuple(orig.borrowers), + tasks_waiting=orig.tasks_waiting, + ) + + +_capacity_limiter_wrapper: trio.lowlevel.RunVar = RunVar("_capacity_limiter_wrapper") + + +# +# Signal handling +# + + +class _SignalReceiver: + _iterator: AsyncIterator[int] + + def __init__(self, signals: tuple[Signals, ...]): + self._signals = signals + + def __enter__(self) -> _SignalReceiver: + self._cm = trio.open_signal_receiver(*self._signals) + self._iterator = self._cm.__enter__() + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> bool | None: + return self._cm.__exit__(exc_type, exc_val, exc_tb) + + def __aiter__(self) -> _SignalReceiver: + return self + + async def __anext__(self) -> Signals: + signum = await self._iterator.__anext__() + return Signals(signum) + + +# +# Testing and debugging +# + + +class TestRunner(abc.TestRunner): + def __init__(self, **options: Any) -> None: + from queue import Queue + + self._call_queue: Queue[Callable[[], object]] = Queue() + self._send_stream: MemoryObjectSendStream | None = None + self._options = options + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: types.TracebackType | None, + ) -> None: + if self._send_stream: + self._send_stream.close() + while self._send_stream is not None: + self._call_queue.get()() + + async def _run_tests_and_fixtures(self) -> None: + self._send_stream, receive_stream = create_memory_object_stream(1) + with receive_stream: + async for coro, outcome_holder in receive_stream: + try: + retval = await coro + except BaseException as exc: + outcome_holder.append(Error(exc)) + else: + outcome_holder.append(Value(retval)) + + def _main_task_finished(self, outcome: object) -> None: + self._send_stream = None + + def _call_in_runner_task( + self, + func: Callable[P, Awaitable[T_Retval]], + *args: P.args, + **kwargs: P.kwargs, + ) -> T_Retval: + if self._send_stream is None: + trio.lowlevel.start_guest_run( + self._run_tests_and_fixtures, + run_sync_soon_threadsafe=self._call_queue.put, + done_callback=self._main_task_finished, + **self._options, + ) + while self._send_stream is None: + self._call_queue.get()() + + outcome_holder: list[Outcome] = [] + self._send_stream.send_nowait((func(*args, **kwargs), outcome_holder)) + while not outcome_holder: + self._call_queue.get()() + + return outcome_holder[0].unwrap() + + def run_asyncgen_fixture( + self, + fixture_func: Callable[..., AsyncGenerator[T_Retval, Any]], + kwargs: dict[str, Any], + ) -> Iterable[T_Retval]: + asyncgen = fixture_func(**kwargs) + fixturevalue: T_Retval = self._call_in_runner_task(asyncgen.asend, None) + + yield fixturevalue + + try: + self._call_in_runner_task(asyncgen.asend, None) + except StopAsyncIteration: + pass + else: + self._call_in_runner_task(asyncgen.aclose) + raise RuntimeError("Async generator fixture did not stop") + + def run_fixture( + self, + fixture_func: Callable[..., Coroutine[Any, Any, T_Retval]], + kwargs: dict[str, Any], + ) -> T_Retval: + return self._call_in_runner_task(fixture_func, **kwargs) + + def run_test( + self, test_func: Callable[..., Coroutine[Any, Any, Any]], kwargs: dict[str, Any] + ) -> None: + self._call_in_runner_task(test_func, **kwargs) + + +class TrioTaskInfo(TaskInfo): + def __init__(self, task: trio.lowlevel.Task): + parent_id = None + if task.parent_nursery and task.parent_nursery.parent_task: + parent_id = id(task.parent_nursery.parent_task) + + super().__init__(id(task), parent_id, task.name, task.coro) + self._task = weakref.proxy(task) + + def has_pending_cancellation(self) -> bool: + try: + return self._task._cancel_status.effectively_cancelled + except ReferenceError: + # If the task is no longer around, it surely doesn't have a cancellation + # pending + return False + + +class TrioBackend(AsyncBackend): + @classmethod + def run( + cls, + func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], + args: tuple[Unpack[PosArgsT]], + kwargs: dict[str, Any], + options: dict[str, Any], + ) -> T_Retval: + return trio.run(func, *args) + + @classmethod + def current_token(cls) -> object: + return trio.lowlevel.current_trio_token() + + @classmethod + def current_time(cls) -> float: + return trio.current_time() + + @classmethod + def cancelled_exception_class(cls) -> type[BaseException]: + return trio.Cancelled + + @classmethod + async def checkpoint(cls) -> None: + await trio.lowlevel.checkpoint() + + @classmethod + async def checkpoint_if_cancelled(cls) -> None: + await trio.lowlevel.checkpoint_if_cancelled() + + @classmethod + async def cancel_shielded_checkpoint(cls) -> None: + await trio.lowlevel.cancel_shielded_checkpoint() + + @classmethod + async def sleep(cls, delay: float) -> None: + await trio.sleep(delay) + + @classmethod + def create_cancel_scope( + cls, *, deadline: float = math.inf, shield: bool = False + ) -> abc.CancelScope: + return CancelScope(deadline=deadline, shield=shield) + + @classmethod + def current_effective_deadline(cls) -> float: + return trio.current_effective_deadline() + + @classmethod + def create_task_group(cls) -> abc.TaskGroup: + return TaskGroup() + + @classmethod + def create_event(cls) -> abc.Event: + return Event() + + @classmethod + def create_lock(cls, *, fast_acquire: bool) -> Lock: + return Lock(fast_acquire=fast_acquire) + + @classmethod + def create_semaphore( + cls, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ) -> abc.Semaphore: + return Semaphore(initial_value, max_value=max_value, fast_acquire=fast_acquire) + + @classmethod + def create_capacity_limiter(cls, total_tokens: float) -> CapacityLimiter: + return CapacityLimiter(total_tokens) + + @classmethod + async def run_sync_in_worker_thread( + cls, + func: Callable[[Unpack[PosArgsT]], T_Retval], + args: tuple[Unpack[PosArgsT]], + abandon_on_cancel: bool = False, + limiter: abc.CapacityLimiter | None = None, + ) -> T_Retval: + def wrapper() -> T_Retval: + with claim_worker_thread(TrioBackend, token): + return func(*args) + + token = TrioBackend.current_token() + return await run_sync( + wrapper, + abandon_on_cancel=abandon_on_cancel, + limiter=cast(trio.CapacityLimiter, limiter), + ) + + @classmethod + def check_cancelled(cls) -> None: + trio.from_thread.check_cancelled() + + @classmethod + def run_async_from_thread( + cls, + func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], + args: tuple[Unpack[PosArgsT]], + token: object, + ) -> T_Retval: + return trio.from_thread.run(func, *args) + + @classmethod + def run_sync_from_thread( + cls, + func: Callable[[Unpack[PosArgsT]], T_Retval], + args: tuple[Unpack[PosArgsT]], + token: object, + ) -> T_Retval: + return trio.from_thread.run_sync(func, *args) + + @classmethod + def create_blocking_portal(cls) -> abc.BlockingPortal: + return BlockingPortal() + + @classmethod + async def open_process( + cls, + command: StrOrBytesPath | Sequence[StrOrBytesPath], + *, + stdin: int | IO[Any] | None, + stdout: int | IO[Any] | None, + stderr: int | IO[Any] | None, + **kwargs: Any, + ) -> Process: + def convert_item(item: StrOrBytesPath) -> str: + str_or_bytes = os.fspath(item) + if isinstance(str_or_bytes, str): + return str_or_bytes + else: + return os.fsdecode(str_or_bytes) + + if isinstance(command, (str, bytes, PathLike)): + process = await trio.lowlevel.open_process( + convert_item(command), + stdin=stdin, + stdout=stdout, + stderr=stderr, + shell=True, + **kwargs, + ) + else: + process = await trio.lowlevel.open_process( + [convert_item(item) for item in command], + stdin=stdin, + stdout=stdout, + stderr=stderr, + shell=False, + **kwargs, + ) + + stdin_stream = SendStreamWrapper(process.stdin) if process.stdin else None + stdout_stream = ReceiveStreamWrapper(process.stdout) if process.stdout else None + stderr_stream = ReceiveStreamWrapper(process.stderr) if process.stderr else None + return Process(process, stdin_stream, stdout_stream, stderr_stream) + + @classmethod + def setup_process_pool_exit_at_shutdown(cls, workers: set[abc.Process]) -> None: + trio.lowlevel.spawn_system_task(_shutdown_process_pool, workers) + + @classmethod + async def connect_tcp( + cls, host: str, port: int, local_address: IPSockAddrType | None = None + ) -> SocketStream: + family = socket.AF_INET6 if ":" in host else socket.AF_INET + trio_socket = trio.socket.socket(family) + trio_socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) + if local_address: + await trio_socket.bind(local_address) + + try: + await trio_socket.connect((host, port)) + except BaseException: + trio_socket.close() + raise + + return SocketStream(trio_socket) + + @classmethod + async def connect_unix(cls, path: str | bytes) -> abc.UNIXSocketStream: + trio_socket = trio.socket.socket(socket.AF_UNIX) + try: + await trio_socket.connect(path) + except BaseException: + trio_socket.close() + raise + + return UNIXSocketStream(trio_socket) + + @classmethod + def create_tcp_listener(cls, sock: socket.socket) -> abc.SocketListener: + return TCPSocketListener(sock) + + @classmethod + def create_unix_listener(cls, sock: socket.socket) -> abc.SocketListener: + return UNIXSocketListener(sock) + + @classmethod + async def create_udp_socket( + cls, + family: socket.AddressFamily, + local_address: IPSockAddrType | None, + remote_address: IPSockAddrType | None, + reuse_port: bool, + ) -> UDPSocket | ConnectedUDPSocket: + trio_socket = trio.socket.socket(family=family, type=socket.SOCK_DGRAM) + + if reuse_port: + trio_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) + + if local_address: + await trio_socket.bind(local_address) + + if remote_address: + await trio_socket.connect(remote_address) + return ConnectedUDPSocket(trio_socket) + else: + return UDPSocket(trio_socket) + + @classmethod + @overload + async def create_unix_datagram_socket( + cls, raw_socket: socket.socket, remote_path: None + ) -> abc.UNIXDatagramSocket: ... + + @classmethod + @overload + async def create_unix_datagram_socket( + cls, raw_socket: socket.socket, remote_path: str | bytes + ) -> abc.ConnectedUNIXDatagramSocket: ... + + @classmethod + async def create_unix_datagram_socket( + cls, raw_socket: socket.socket, remote_path: str | bytes | None + ) -> abc.UNIXDatagramSocket | abc.ConnectedUNIXDatagramSocket: + trio_socket = trio.socket.from_stdlib_socket(raw_socket) + + if remote_path: + await trio_socket.connect(remote_path) + return ConnectedUNIXDatagramSocket(trio_socket) + else: + return UNIXDatagramSocket(trio_socket) + + @classmethod + async def getaddrinfo( + cls, + host: bytes | str | None, + port: str | int | None, + *, + family: int | AddressFamily = 0, + type: int | SocketKind = 0, + proto: int = 0, + flags: int = 0, + ) -> Sequence[ + tuple[ + AddressFamily, + SocketKind, + int, + str, + tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes], + ] + ]: + return await trio.socket.getaddrinfo(host, port, family, type, proto, flags) + + @classmethod + async def getnameinfo( + cls, sockaddr: IPSockAddrType, flags: int = 0 + ) -> tuple[str, str]: + return await trio.socket.getnameinfo(sockaddr, flags) + + @classmethod + async def wait_readable(cls, obj: FileDescriptorLike) -> None: + try: + await wait_readable(obj) + except trio.ClosedResourceError as exc: + raise ClosedResourceError().with_traceback(exc.__traceback__) from None + except trio.BusyResourceError: + raise BusyResourceError("reading from") from None + + @classmethod + async def wait_writable(cls, obj: FileDescriptorLike) -> None: + try: + await wait_writable(obj) + except trio.ClosedResourceError as exc: + raise ClosedResourceError().with_traceback(exc.__traceback__) from None + except trio.BusyResourceError: + raise BusyResourceError("writing to") from None + + @classmethod + def notify_closing(cls, obj: FileDescriptorLike) -> None: + notify_closing(obj) + + @classmethod + async def wrap_listener_socket(cls, sock: socket.socket) -> abc.SocketListener: + return TCPSocketListener(sock) + + @classmethod + async def wrap_stream_socket(cls, sock: socket.socket) -> SocketStream: + trio_sock = trio.socket.from_stdlib_socket(sock) + return SocketStream(trio_sock) + + @classmethod + async def wrap_unix_stream_socket(cls, sock: socket.socket) -> UNIXSocketStream: + trio_sock = trio.socket.from_stdlib_socket(sock) + return UNIXSocketStream(trio_sock) + + @classmethod + async def wrap_udp_socket(cls, sock: socket.socket) -> UDPSocket: + trio_sock = trio.socket.from_stdlib_socket(sock) + return UDPSocket(trio_sock) + + @classmethod + async def wrap_connected_udp_socket(cls, sock: socket.socket) -> ConnectedUDPSocket: + trio_sock = trio.socket.from_stdlib_socket(sock) + return ConnectedUDPSocket(trio_sock) + + @classmethod + async def wrap_unix_datagram_socket(cls, sock: socket.socket) -> UNIXDatagramSocket: + trio_sock = trio.socket.from_stdlib_socket(sock) + return UNIXDatagramSocket(trio_sock) + + @classmethod + async def wrap_connected_unix_datagram_socket( + cls, sock: socket.socket + ) -> ConnectedUNIXDatagramSocket: + trio_sock = trio.socket.from_stdlib_socket(sock) + return ConnectedUNIXDatagramSocket(trio_sock) + + @classmethod + def current_default_thread_limiter(cls) -> CapacityLimiter: + try: + return _capacity_limiter_wrapper.get() + except LookupError: + limiter = CapacityLimiter( + original=trio.to_thread.current_default_thread_limiter() + ) + _capacity_limiter_wrapper.set(limiter) + return limiter + + @classmethod + def open_signal_receiver( + cls, *signals: Signals + ) -> AbstractContextManager[AsyncIterator[Signals]]: + return _SignalReceiver(signals) + + @classmethod + def get_current_task(cls) -> TaskInfo: + task = current_task() + return TrioTaskInfo(task) + + @classmethod + def get_running_tasks(cls) -> Sequence[TaskInfo]: + root_task = current_root_task() + assert root_task + task_infos = [TrioTaskInfo(root_task)] + nurseries = root_task.child_nurseries + while nurseries: + new_nurseries: list[trio.Nursery] = [] + for nursery in nurseries: + for task in nursery.child_tasks: + task_infos.append(TrioTaskInfo(task)) + new_nurseries.extend(task.child_nurseries) + + nurseries = new_nurseries + + return task_infos + + @classmethod + async def wait_all_tasks_blocked(cls) -> None: + from trio.testing import wait_all_tasks_blocked + + await wait_all_tasks_blocked() + + @classmethod + def create_test_runner(cls, options: dict[str, Any]) -> TestRunner: + return TestRunner(**options) + + +backend_class = TrioBackend diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca888a2ecbcacafd8afda13d78a9ea88a89c2d76 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_asyncio_selector_thread.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_asyncio_selector_thread.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66256257c0122f3f05e273b120656adf68bb8a71 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_asyncio_selector_thread.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_contextmanagers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_contextmanagers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c9c8d80a252b24bf8ad66d85e5224aea4be7e03 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_contextmanagers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_eventloop.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_eventloop.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07c5df8361e24060441fc92769b06ad40d8bb564 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_eventloop.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_exceptions.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08b57ee9123d0f0c9eb02a09e9569e6dad4a1556 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_exceptions.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_fileio.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_fileio.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1122817a8ada4e9fc201d7485c0c697c0fc87003 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_fileio.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_resources.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_resources.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..268ae4580ae573516d4c831d7974c05cd0cc79bf Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_resources.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_signals.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_signals.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..24559c783949d41a660bab58066f8bcd2569ec50 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_signals.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_sockets.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_sockets.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d0da6e883cff8fbe60c8786082aa3703c6edad9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_sockets.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_streams.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_streams.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d2dcc555074056a704d753eda1f0595044591a6 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_streams.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_subprocesses.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_subprocesses.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0613f6bad352060c5dda33005e21ee4eba6f9d26 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_subprocesses.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_synchronization.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_synchronization.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ac2b5670e3e5885d2e8be6d3339ea8039e08dc3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_synchronization.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_tasks.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_tasks.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a490425a1bc1c5581d56fa3e6360495ad8a9744 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_tasks.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_tempfile.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_tempfile.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5a41ed6a715e6acd2006152697847b6e09e0574 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_tempfile.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_testing.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_testing.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f4e86895ed429d22ae2c121dbce7ec91c4af824 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_testing.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_typedattr.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_typedattr.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eff114c4aef079ab5b2764b4d5a23805252a5f2f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_typedattr.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_asyncio_selector_thread.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_asyncio_selector_thread.py new file mode 100644 index 0000000000000000000000000000000000000000..9f35bae568e33e6a9e1219761c83cc8350fa0532 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_asyncio_selector_thread.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +import asyncio +import socket +import threading +from collections.abc import Callable +from selectors import EVENT_READ, EVENT_WRITE, DefaultSelector +from typing import TYPE_CHECKING, Any + +if TYPE_CHECKING: + from _typeshed import FileDescriptorLike + +_selector_lock = threading.Lock() +_selector: Selector | None = None + + +class Selector: + def __init__(self) -> None: + self._thread = threading.Thread(target=self.run, name="AnyIO socket selector") + self._selector = DefaultSelector() + self._send, self._receive = socket.socketpair() + self._send.setblocking(False) + self._receive.setblocking(False) + # This somewhat reduces the amount of memory wasted queueing up data + # for wakeups. With these settings, maximum number of 1-byte sends + # before getting BlockingIOError: + # Linux 4.8: 6 + # macOS (darwin 15.5): 1 + # Windows 10: 525347 + # Windows you're weird. (And on Windows setting SNDBUF to 0 makes send + # blocking, even on non-blocking sockets, so don't do that.) + self._receive.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 1) + self._send.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1) + # On Windows this is a TCP socket so this might matter. On other + # platforms this fails b/c AF_UNIX sockets aren't actually TCP. + try: + self._send.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) + except OSError: + pass + + self._selector.register(self._receive, EVENT_READ) + self._closed = False + + def start(self) -> None: + self._thread.start() + threading._register_atexit(self._stop) # type: ignore[attr-defined] + + def _stop(self) -> None: + global _selector + self._closed = True + self._notify_self() + self._send.close() + self._thread.join() + self._selector.unregister(self._receive) + self._receive.close() + self._selector.close() + _selector = None + assert not self._selector.get_map(), ( + "selector still has registered file descriptors after shutdown" + ) + + def _notify_self(self) -> None: + try: + self._send.send(b"\x00") + except BlockingIOError: + pass + + def add_reader(self, fd: FileDescriptorLike, callback: Callable[[], Any]) -> None: + loop = asyncio.get_running_loop() + try: + key = self._selector.get_key(fd) + except KeyError: + self._selector.register(fd, EVENT_READ, {EVENT_READ: (loop, callback)}) + else: + if EVENT_READ in key.data: + raise ValueError( + "this file descriptor is already registered for reading" + ) + + key.data[EVENT_READ] = loop, callback + self._selector.modify(fd, key.events | EVENT_READ, key.data) + + self._notify_self() + + def add_writer(self, fd: FileDescriptorLike, callback: Callable[[], Any]) -> None: + loop = asyncio.get_running_loop() + try: + key = self._selector.get_key(fd) + except KeyError: + self._selector.register(fd, EVENT_WRITE, {EVENT_WRITE: (loop, callback)}) + else: + if EVENT_WRITE in key.data: + raise ValueError( + "this file descriptor is already registered for writing" + ) + + key.data[EVENT_WRITE] = loop, callback + self._selector.modify(fd, key.events | EVENT_WRITE, key.data) + + self._notify_self() + + def remove_reader(self, fd: FileDescriptorLike) -> bool: + try: + key = self._selector.get_key(fd) + except KeyError: + return False + + if new_events := key.events ^ EVENT_READ: + del key.data[EVENT_READ] + self._selector.modify(fd, new_events, key.data) + else: + self._selector.unregister(fd) + + return True + + def remove_writer(self, fd: FileDescriptorLike) -> bool: + try: + key = self._selector.get_key(fd) + except KeyError: + return False + + if new_events := key.events ^ EVENT_WRITE: + del key.data[EVENT_WRITE] + self._selector.modify(fd, new_events, key.data) + else: + self._selector.unregister(fd) + + return True + + def run(self) -> None: + while not self._closed: + for key, events in self._selector.select(): + if key.fileobj is self._receive: + try: + while self._receive.recv(4096): + pass + except BlockingIOError: + pass + + continue + + if events & EVENT_READ: + loop, callback = key.data[EVENT_READ] + self.remove_reader(key.fd) + try: + loop.call_soon_threadsafe(callback) + except RuntimeError: + pass # the loop was already closed + + if events & EVENT_WRITE: + loop, callback = key.data[EVENT_WRITE] + self.remove_writer(key.fd) + try: + loop.call_soon_threadsafe(callback) + except RuntimeError: + pass # the loop was already closed + + +def get_selector() -> Selector: + global _selector + + with _selector_lock: + if _selector is None: + _selector = Selector() + _selector.start() + + return _selector diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_contextmanagers.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_contextmanagers.py new file mode 100644 index 0000000000000000000000000000000000000000..302f32b0c78a7071605b195c55054cfdb0b55f37 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_contextmanagers.py @@ -0,0 +1,200 @@ +from __future__ import annotations + +from abc import abstractmethod +from contextlib import AbstractAsyncContextManager, AbstractContextManager +from inspect import isasyncgen, iscoroutine, isgenerator +from types import TracebackType +from typing import Protocol, TypeVar, cast, final + +_T_co = TypeVar("_T_co", covariant=True) +_ExitT_co = TypeVar("_ExitT_co", covariant=True, bound="bool | None") + + +class _SupportsCtxMgr(Protocol[_T_co, _ExitT_co]): + def __contextmanager__(self) -> AbstractContextManager[_T_co, _ExitT_co]: ... + + +class _SupportsAsyncCtxMgr(Protocol[_T_co, _ExitT_co]): + def __asynccontextmanager__( + self, + ) -> AbstractAsyncContextManager[_T_co, _ExitT_co]: ... + + +class ContextManagerMixin: + """ + Mixin class providing context manager functionality via a generator-based + implementation. + + This class allows you to implement a context manager via :meth:`__contextmanager__` + which should return a generator. The mechanics are meant to mirror those of + :func:`@contextmanager `. + + .. note:: Classes using this mix-in are not reentrant as context managers, meaning + that once you enter it, you can't re-enter before first exiting it. + + .. seealso:: :doc:`contextmanagers` + """ + + __cm: AbstractContextManager[object, bool | None] | None = None + + @final + def __enter__(self: _SupportsCtxMgr[_T_co, bool | None]) -> _T_co: + # Needed for mypy to assume self still has the __cm member + assert isinstance(self, ContextManagerMixin) + if self.__cm is not None: + raise RuntimeError( + f"this {self.__class__.__qualname__} has already been entered" + ) + + cm = self.__contextmanager__() + if not isinstance(cm, AbstractContextManager): + if isgenerator(cm): + raise TypeError( + "__contextmanager__() returned a generator object instead of " + "a context manager. Did you forget to add the @contextmanager " + "decorator?" + ) + + raise TypeError( + f"__contextmanager__() did not return a context manager object, " + f"but {cm.__class__!r}" + ) + + if cm is self: + raise TypeError( + f"{self.__class__.__qualname__}.__contextmanager__() returned " + f"self. Did you forget to add the @contextmanager decorator and a " + f"'yield' statement?" + ) + + value = cm.__enter__() + self.__cm = cm + return value + + @final + def __exit__( + self: _SupportsCtxMgr[object, _ExitT_co], + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> _ExitT_co: + # Needed for mypy to assume self still has the __cm member + assert isinstance(self, ContextManagerMixin) + if self.__cm is None: + raise RuntimeError( + f"this {self.__class__.__qualname__} has not been entered yet" + ) + + # Prevent circular references + cm = self.__cm + del self.__cm + + return cast(_ExitT_co, cm.__exit__(exc_type, exc_val, exc_tb)) + + @abstractmethod + def __contextmanager__(self) -> AbstractContextManager[object, bool | None]: + """ + Implement your context manager logic here. + + This method **must** be decorated with + :func:`@contextmanager `. + + .. note:: Remember that the ``yield`` will raise any exception raised in the + enclosed context block, so use a ``finally:`` block to clean up resources! + + :return: a context manager object + """ + + +class AsyncContextManagerMixin: + """ + Mixin class providing async context manager functionality via a generator-based + implementation. + + This class allows you to implement a context manager via + :meth:`__asynccontextmanager__`. The mechanics are meant to mirror those of + :func:`@asynccontextmanager `. + + .. note:: Classes using this mix-in are not reentrant as context managers, meaning + that once you enter it, you can't re-enter before first exiting it. + + .. seealso:: :doc:`contextmanagers` + """ + + __cm: AbstractAsyncContextManager[object, bool | None] | None = None + + @final + async def __aenter__(self: _SupportsAsyncCtxMgr[_T_co, bool | None]) -> _T_co: + # Needed for mypy to assume self still has the __cm member + assert isinstance(self, AsyncContextManagerMixin) + if self.__cm is not None: + raise RuntimeError( + f"this {self.__class__.__qualname__} has already been entered" + ) + + cm = self.__asynccontextmanager__() + if not isinstance(cm, AbstractAsyncContextManager): + if isasyncgen(cm): + raise TypeError( + "__asynccontextmanager__() returned an async generator instead of " + "an async context manager. Did you forget to add the " + "@asynccontextmanager decorator?" + ) + elif iscoroutine(cm): + cm.close() + raise TypeError( + "__asynccontextmanager__() returned a coroutine object instead of " + "an async context manager. Did you forget to add the " + "@asynccontextmanager decorator and a 'yield' statement?" + ) + + raise TypeError( + f"__asynccontextmanager__() did not return an async context manager, " + f"but {cm.__class__!r}" + ) + + if cm is self: + raise TypeError( + f"{self.__class__.__qualname__}.__asynccontextmanager__() returned " + f"self. Did you forget to add the @asynccontextmanager decorator and a " + f"'yield' statement?" + ) + + value = await cm.__aenter__() + self.__cm = cm + return value + + @final + async def __aexit__( + self: _SupportsAsyncCtxMgr[object, _ExitT_co], + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> _ExitT_co: + assert isinstance(self, AsyncContextManagerMixin) + if self.__cm is None: + raise RuntimeError( + f"this {self.__class__.__qualname__} has not been entered yet" + ) + + # Prevent circular references + cm = self.__cm + del self.__cm + + return cast(_ExitT_co, await cm.__aexit__(exc_type, exc_val, exc_tb)) + + @abstractmethod + def __asynccontextmanager__( + self, + ) -> AbstractAsyncContextManager[object, bool | None]: + """ + Implement your async context manager logic here. + + This method **must** be decorated with + :func:`@asynccontextmanager `. + + .. note:: Remember that the ``yield`` will raise any exception raised in the + enclosed context block, so use a ``finally:`` block to clean up resources! + + :return: an async context manager object + """ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_eventloop.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_eventloop.py new file mode 100644 index 0000000000000000000000000000000000000000..6dcb45898184ec7ea5143e42bd147138fd8ed304 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_eventloop.py @@ -0,0 +1,166 @@ +from __future__ import annotations + +import math +import sys +import threading +from collections.abc import Awaitable, Callable, Generator +from contextlib import contextmanager +from importlib import import_module +from typing import TYPE_CHECKING, Any, TypeVar + +import sniffio + +if sys.version_info >= (3, 11): + from typing import TypeVarTuple, Unpack +else: + from typing_extensions import TypeVarTuple, Unpack + +if TYPE_CHECKING: + from ..abc import AsyncBackend + +# This must be updated when new backends are introduced +BACKENDS = "asyncio", "trio" + +T_Retval = TypeVar("T_Retval") +PosArgsT = TypeVarTuple("PosArgsT") + +threadlocals = threading.local() +loaded_backends: dict[str, type[AsyncBackend]] = {} + + +def run( + func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], + *args: Unpack[PosArgsT], + backend: str = "asyncio", + backend_options: dict[str, Any] | None = None, +) -> T_Retval: + """ + Run the given coroutine function in an asynchronous event loop. + + The current thread must not be already running an event loop. + + :param func: a coroutine function + :param args: positional arguments to ``func`` + :param backend: name of the asynchronous event loop implementation – currently + either ``asyncio`` or ``trio`` + :param backend_options: keyword arguments to call the backend ``run()`` + implementation with (documented :ref:`here `) + :return: the return value of the coroutine function + :raises RuntimeError: if an asynchronous event loop is already running in this + thread + :raises LookupError: if the named backend is not found + + """ + try: + asynclib_name = sniffio.current_async_library() + except sniffio.AsyncLibraryNotFoundError: + pass + else: + raise RuntimeError(f"Already running {asynclib_name} in this thread") + + try: + async_backend = get_async_backend(backend) + except ImportError as exc: + raise LookupError(f"No such backend: {backend}") from exc + + token = None + if sniffio.current_async_library_cvar.get(None) is None: + # Since we're in control of the event loop, we can cache the name of the async + # library + token = sniffio.current_async_library_cvar.set(backend) + + try: + backend_options = backend_options or {} + return async_backend.run(func, args, {}, backend_options) + finally: + if token: + sniffio.current_async_library_cvar.reset(token) + + +async def sleep(delay: float) -> None: + """ + Pause the current task for the specified duration. + + :param delay: the duration, in seconds + + """ + return await get_async_backend().sleep(delay) + + +async def sleep_forever() -> None: + """ + Pause the current task until it's cancelled. + + This is a shortcut for ``sleep(math.inf)``. + + .. versionadded:: 3.1 + + """ + await sleep(math.inf) + + +async def sleep_until(deadline: float) -> None: + """ + Pause the current task until the given time. + + :param deadline: the absolute time to wake up at (according to the internal + monotonic clock of the event loop) + + .. versionadded:: 3.1 + + """ + now = current_time() + await sleep(max(deadline - now, 0)) + + +def current_time() -> float: + """ + Return the current value of the event loop's internal clock. + + :return: the clock value (seconds) + + """ + return get_async_backend().current_time() + + +def get_all_backends() -> tuple[str, ...]: + """Return a tuple of the names of all built-in backends.""" + return BACKENDS + + +def get_cancelled_exc_class() -> type[BaseException]: + """Return the current async library's cancellation exception class.""" + return get_async_backend().cancelled_exception_class() + + +# +# Private API +# + + +@contextmanager +def claim_worker_thread( + backend_class: type[AsyncBackend], token: object +) -> Generator[Any, None, None]: + threadlocals.current_async_backend = backend_class + threadlocals.current_token = token + try: + yield + finally: + del threadlocals.current_async_backend + del threadlocals.current_token + + +def get_async_backend(asynclib_name: str | None = None) -> type[AsyncBackend]: + if asynclib_name is None: + asynclib_name = sniffio.current_async_library() + + # We use our own dict instead of sys.modules to get the already imported back-end + # class because the appropriate modules in sys.modules could potentially be only + # partially initialized + try: + return loaded_backends[asynclib_name] + except KeyError: + module = import_module(f"anyio._backends._{asynclib_name}") + loaded_backends[asynclib_name] = module.backend_class + return module.backend_class diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_exceptions.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..daa067768a3a729662c30e965b67e8d461e22e88 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_exceptions.py @@ -0,0 +1,134 @@ +from __future__ import annotations + +import sys +from collections.abc import Generator +from textwrap import dedent +from typing import Any + +if sys.version_info < (3, 11): + from exceptiongroup import BaseExceptionGroup + + +class BrokenResourceError(Exception): + """ + Raised when trying to use a resource that has been rendered unusable due to external + causes (e.g. a send stream whose peer has disconnected). + """ + + +class BrokenWorkerProcess(Exception): + """ + Raised by :meth:`~anyio.to_process.run_sync` if the worker process terminates abruptly or + otherwise misbehaves. + """ + + +class BrokenWorkerInterpreter(Exception): + """ + Raised by :meth:`~anyio.to_interpreter.run_sync` if an unexpected exception is + raised in the subinterpreter. + """ + + def __init__(self, excinfo: Any): + # This was adapted from concurrent.futures.interpreter.ExecutionFailed + msg = excinfo.formatted + if not msg: + if excinfo.type and excinfo.msg: + msg = f"{excinfo.type.__name__}: {excinfo.msg}" + else: + msg = excinfo.type.__name__ or excinfo.msg + + super().__init__(msg) + self.excinfo = excinfo + + def __str__(self) -> str: + try: + formatted = self.excinfo.errdisplay + except Exception: + return super().__str__() + else: + return dedent( + f""" + {super().__str__()} + + Uncaught in the interpreter: + + {formatted} + """.strip() + ) + + +class BusyResourceError(Exception): + """ + Raised when two tasks are trying to read from or write to the same resource + concurrently. + """ + + def __init__(self, action: str): + super().__init__(f"Another task is already {action} this resource") + + +class ClosedResourceError(Exception): + """Raised when trying to use a resource that has been closed.""" + + +class ConnectionFailed(OSError): + """ + Raised when a connection attempt fails. + + .. note:: This class inherits from :exc:`OSError` for backwards compatibility. + """ + + +def iterate_exceptions( + exception: BaseException, +) -> Generator[BaseException, None, None]: + if isinstance(exception, BaseExceptionGroup): + for exc in exception.exceptions: + yield from iterate_exceptions(exc) + else: + yield exception + + +class DelimiterNotFound(Exception): + """ + Raised during + :meth:`~anyio.streams.buffered.BufferedByteReceiveStream.receive_until` if the + maximum number of bytes has been read without the delimiter being found. + """ + + def __init__(self, max_bytes: int) -> None: + super().__init__( + f"The delimiter was not found among the first {max_bytes} bytes" + ) + + +class EndOfStream(Exception): + """ + Raised when trying to read from a stream that has been closed from the other end. + """ + + +class IncompleteRead(Exception): + """ + Raised during + :meth:`~anyio.streams.buffered.BufferedByteReceiveStream.receive_exactly` or + :meth:`~anyio.streams.buffered.BufferedByteReceiveStream.receive_until` if the + connection is closed before the requested amount of bytes has been read. + """ + + def __init__(self) -> None: + super().__init__( + "The stream was closed before the read operation could be completed" + ) + + +class TypedAttributeLookupError(LookupError): + """ + Raised by :meth:`~anyio.TypedAttributeProvider.extra` when the given typed attribute + is not found and no default value has been given. + """ + + +class WouldBlock(Exception): + """Raised by ``X_nowait`` functions if ``X()`` would block.""" diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_fileio.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_fileio.py new file mode 100644 index 0000000000000000000000000000000000000000..2eae029e4826c27764d0d8f398ae42bd8f0856fc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_fileio.py @@ -0,0 +1,740 @@ +from __future__ import annotations + +import os +import pathlib +import sys +from collections.abc import ( + AsyncIterator, + Callable, + Iterable, + Iterator, + Sequence, +) +from dataclasses import dataclass +from functools import partial +from os import PathLike +from typing import ( + IO, + TYPE_CHECKING, + Any, + AnyStr, + ClassVar, + Final, + Generic, + overload, +) + +from .. import to_thread +from ..abc import AsyncResource + +if TYPE_CHECKING: + from types import ModuleType + + from _typeshed import OpenBinaryMode, OpenTextMode, ReadableBuffer, WriteableBuffer +else: + ReadableBuffer = OpenBinaryMode = OpenTextMode = WriteableBuffer = object + + +class AsyncFile(AsyncResource, Generic[AnyStr]): + """ + An asynchronous file object. + + This class wraps a standard file object and provides async friendly versions of the + following blocking methods (where available on the original file object): + + * read + * read1 + * readline + * readlines + * readinto + * readinto1 + * write + * writelines + * truncate + * seek + * tell + * flush + + All other methods are directly passed through. + + This class supports the asynchronous context manager protocol which closes the + underlying file at the end of the context block. + + This class also supports asynchronous iteration:: + + async with await open_file(...) as f: + async for line in f: + print(line) + """ + + def __init__(self, fp: IO[AnyStr]) -> None: + self._fp: Any = fp + + def __getattr__(self, name: str) -> object: + return getattr(self._fp, name) + + @property + def wrapped(self) -> IO[AnyStr]: + """The wrapped file object.""" + return self._fp + + async def __aiter__(self) -> AsyncIterator[AnyStr]: + while True: + line = await self.readline() + if line: + yield line + else: + break + + async def aclose(self) -> None: + return await to_thread.run_sync(self._fp.close) + + async def read(self, size: int = -1) -> AnyStr: + return await to_thread.run_sync(self._fp.read, size) + + async def read1(self: AsyncFile[bytes], size: int = -1) -> bytes: + return await to_thread.run_sync(self._fp.read1, size) + + async def readline(self) -> AnyStr: + return await to_thread.run_sync(self._fp.readline) + + async def readlines(self) -> list[AnyStr]: + return await to_thread.run_sync(self._fp.readlines) + + async def readinto(self: AsyncFile[bytes], b: WriteableBuffer) -> int: + return await to_thread.run_sync(self._fp.readinto, b) + + async def readinto1(self: AsyncFile[bytes], b: WriteableBuffer) -> int: + return await to_thread.run_sync(self._fp.readinto1, b) + + @overload + async def write(self: AsyncFile[bytes], b: ReadableBuffer) -> int: ... + + @overload + async def write(self: AsyncFile[str], b: str) -> int: ... + + async def write(self, b: ReadableBuffer | str) -> int: + return await to_thread.run_sync(self._fp.write, b) + + @overload + async def writelines( + self: AsyncFile[bytes], lines: Iterable[ReadableBuffer] + ) -> None: ... + + @overload + async def writelines(self: AsyncFile[str], lines: Iterable[str]) -> None: ... + + async def writelines(self, lines: Iterable[ReadableBuffer] | Iterable[str]) -> None: + return await to_thread.run_sync(self._fp.writelines, lines) + + async def truncate(self, size: int | None = None) -> int: + return await to_thread.run_sync(self._fp.truncate, size) + + async def seek(self, offset: int, whence: int | None = os.SEEK_SET) -> int: + return await to_thread.run_sync(self._fp.seek, offset, whence) + + async def tell(self) -> int: + return await to_thread.run_sync(self._fp.tell) + + async def flush(self) -> None: + return await to_thread.run_sync(self._fp.flush) + + +@overload +async def open_file( + file: str | PathLike[str] | int, + mode: OpenBinaryMode, + buffering: int = ..., + encoding: str | None = ..., + errors: str | None = ..., + newline: str | None = ..., + closefd: bool = ..., + opener: Callable[[str, int], int] | None = ..., +) -> AsyncFile[bytes]: ... + + +@overload +async def open_file( + file: str | PathLike[str] | int, + mode: OpenTextMode = ..., + buffering: int = ..., + encoding: str | None = ..., + errors: str | None = ..., + newline: str | None = ..., + closefd: bool = ..., + opener: Callable[[str, int], int] | None = ..., +) -> AsyncFile[str]: ... + + +async def open_file( + file: str | PathLike[str] | int, + mode: str = "r", + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + closefd: bool = True, + opener: Callable[[str, int], int] | None = None, +) -> AsyncFile[Any]: + """ + Open a file asynchronously. + + The arguments are exactly the same as for the builtin :func:`open`. + + :return: an asynchronous file object + + """ + fp = await to_thread.run_sync( + open, file, mode, buffering, encoding, errors, newline, closefd, opener + ) + return AsyncFile(fp) + + +def wrap_file(file: IO[AnyStr]) -> AsyncFile[AnyStr]: + """ + Wrap an existing file as an asynchronous file. + + :param file: an existing file-like object + :return: an asynchronous file object + + """ + return AsyncFile(file) + + +@dataclass(eq=False) +class _PathIterator(AsyncIterator["Path"]): + iterator: Iterator[PathLike[str]] + + async def __anext__(self) -> Path: + nextval = await to_thread.run_sync( + next, self.iterator, None, abandon_on_cancel=True + ) + if nextval is None: + raise StopAsyncIteration from None + + return Path(nextval) + + +class Path: + """ + An asynchronous version of :class:`pathlib.Path`. + + This class cannot be substituted for :class:`pathlib.Path` or + :class:`pathlib.PurePath`, but it is compatible with the :class:`os.PathLike` + interface. + + It implements the Python 3.10 version of :class:`pathlib.Path` interface, except for + the deprecated :meth:`~pathlib.Path.link_to` method. + + Some methods may be unavailable or have limited functionality, based on the Python + version: + + * :meth:`~pathlib.Path.copy` (available on Python 3.14 or later) + * :meth:`~pathlib.Path.copy_into` (available on Python 3.14 or later) + * :meth:`~pathlib.Path.from_uri` (available on Python 3.13 or later) + * :meth:`~pathlib.PurePath.full_match` (available on Python 3.13 or later) + * :attr:`~pathlib.Path.info` (available on Python 3.14 or later) + * :meth:`~pathlib.Path.is_junction` (available on Python 3.12 or later) + * :meth:`~pathlib.PurePath.match` (the ``case_sensitive`` parameter is only + available on Python 3.13 or later) + * :meth:`~pathlib.Path.move` (available on Python 3.14 or later) + * :meth:`~pathlib.Path.move_into` (available on Python 3.14 or later) + * :meth:`~pathlib.PurePath.relative_to` (the ``walk_up`` parameter is only available + on Python 3.12 or later) + * :meth:`~pathlib.Path.walk` (available on Python 3.12 or later) + + Any methods that do disk I/O need to be awaited on. These methods are: + + * :meth:`~pathlib.Path.absolute` + * :meth:`~pathlib.Path.chmod` + * :meth:`~pathlib.Path.cwd` + * :meth:`~pathlib.Path.exists` + * :meth:`~pathlib.Path.expanduser` + * :meth:`~pathlib.Path.group` + * :meth:`~pathlib.Path.hardlink_to` + * :meth:`~pathlib.Path.home` + * :meth:`~pathlib.Path.is_block_device` + * :meth:`~pathlib.Path.is_char_device` + * :meth:`~pathlib.Path.is_dir` + * :meth:`~pathlib.Path.is_fifo` + * :meth:`~pathlib.Path.is_file` + * :meth:`~pathlib.Path.is_junction` + * :meth:`~pathlib.Path.is_mount` + * :meth:`~pathlib.Path.is_socket` + * :meth:`~pathlib.Path.is_symlink` + * :meth:`~pathlib.Path.lchmod` + * :meth:`~pathlib.Path.lstat` + * :meth:`~pathlib.Path.mkdir` + * :meth:`~pathlib.Path.open` + * :meth:`~pathlib.Path.owner` + * :meth:`~pathlib.Path.read_bytes` + * :meth:`~pathlib.Path.read_text` + * :meth:`~pathlib.Path.readlink` + * :meth:`~pathlib.Path.rename` + * :meth:`~pathlib.Path.replace` + * :meth:`~pathlib.Path.resolve` + * :meth:`~pathlib.Path.rmdir` + * :meth:`~pathlib.Path.samefile` + * :meth:`~pathlib.Path.stat` + * :meth:`~pathlib.Path.symlink_to` + * :meth:`~pathlib.Path.touch` + * :meth:`~pathlib.Path.unlink` + * :meth:`~pathlib.Path.walk` + * :meth:`~pathlib.Path.write_bytes` + * :meth:`~pathlib.Path.write_text` + + Additionally, the following methods return an async iterator yielding + :class:`~.Path` objects: + + * :meth:`~pathlib.Path.glob` + * :meth:`~pathlib.Path.iterdir` + * :meth:`~pathlib.Path.rglob` + """ + + __slots__ = "_path", "__weakref__" + + __weakref__: Any + + def __init__(self, *args: str | PathLike[str]) -> None: + self._path: Final[pathlib.Path] = pathlib.Path(*args) + + def __fspath__(self) -> str: + return self._path.__fspath__() + + def __str__(self) -> str: + return self._path.__str__() + + def __repr__(self) -> str: + return f"{self.__class__.__name__}({self.as_posix()!r})" + + def __bytes__(self) -> bytes: + return self._path.__bytes__() + + def __hash__(self) -> int: + return self._path.__hash__() + + def __eq__(self, other: object) -> bool: + target = other._path if isinstance(other, Path) else other + return self._path.__eq__(target) + + def __lt__(self, other: pathlib.PurePath | Path) -> bool: + target = other._path if isinstance(other, Path) else other + return self._path.__lt__(target) + + def __le__(self, other: pathlib.PurePath | Path) -> bool: + target = other._path if isinstance(other, Path) else other + return self._path.__le__(target) + + def __gt__(self, other: pathlib.PurePath | Path) -> bool: + target = other._path if isinstance(other, Path) else other + return self._path.__gt__(target) + + def __ge__(self, other: pathlib.PurePath | Path) -> bool: + target = other._path if isinstance(other, Path) else other + return self._path.__ge__(target) + + def __truediv__(self, other: str | PathLike[str]) -> Path: + return Path(self._path / other) + + def __rtruediv__(self, other: str | PathLike[str]) -> Path: + return Path(other) / self + + @property + def parts(self) -> tuple[str, ...]: + return self._path.parts + + @property + def drive(self) -> str: + return self._path.drive + + @property + def root(self) -> str: + return self._path.root + + @property + def anchor(self) -> str: + return self._path.anchor + + @property + def parents(self) -> Sequence[Path]: + return tuple(Path(p) for p in self._path.parents) + + @property + def parent(self) -> Path: + return Path(self._path.parent) + + @property + def name(self) -> str: + return self._path.name + + @property + def suffix(self) -> str: + return self._path.suffix + + @property + def suffixes(self) -> list[str]: + return self._path.suffixes + + @property + def stem(self) -> str: + return self._path.stem + + async def absolute(self) -> Path: + path = await to_thread.run_sync(self._path.absolute) + return Path(path) + + def as_posix(self) -> str: + return self._path.as_posix() + + def as_uri(self) -> str: + return self._path.as_uri() + + if sys.version_info >= (3, 13): + parser: ClassVar[ModuleType] = pathlib.Path.parser + + @classmethod + def from_uri(cls, uri: str) -> Path: + return Path(pathlib.Path.from_uri(uri)) + + def full_match( + self, path_pattern: str, *, case_sensitive: bool | None = None + ) -> bool: + return self._path.full_match(path_pattern, case_sensitive=case_sensitive) + + def match( + self, path_pattern: str, *, case_sensitive: bool | None = None + ) -> bool: + return self._path.match(path_pattern, case_sensitive=case_sensitive) + else: + + def match(self, path_pattern: str) -> bool: + return self._path.match(path_pattern) + + if sys.version_info >= (3, 14): + + @property + def info(self) -> Any: # TODO: add return type annotation when Typeshed gets it + return self._path.info + + async def copy( + self, + target: str | os.PathLike[str], + *, + follow_symlinks: bool = True, + preserve_metadata: bool = False, + ) -> Path: + func = partial( + self._path.copy, + follow_symlinks=follow_symlinks, + preserve_metadata=preserve_metadata, + ) + return Path(await to_thread.run_sync(func, pathlib.Path(target))) + + async def copy_into( + self, + target_dir: str | os.PathLike[str], + *, + follow_symlinks: bool = True, + preserve_metadata: bool = False, + ) -> Path: + func = partial( + self._path.copy_into, + follow_symlinks=follow_symlinks, + preserve_metadata=preserve_metadata, + ) + return Path(await to_thread.run_sync(func, pathlib.Path(target_dir))) + + async def move(self, target: str | os.PathLike[str]) -> Path: + # Upstream does not handle anyio.Path properly as a PathLike + target = pathlib.Path(target) + return Path(await to_thread.run_sync(self._path.move, target)) + + async def move_into( + self, + target_dir: str | os.PathLike[str], + ) -> Path: + return Path(await to_thread.run_sync(self._path.move_into, target_dir)) + + def is_relative_to(self, other: str | PathLike[str]) -> bool: + try: + self.relative_to(other) + return True + except ValueError: + return False + + async def chmod(self, mode: int, *, follow_symlinks: bool = True) -> None: + func = partial(os.chmod, follow_symlinks=follow_symlinks) + return await to_thread.run_sync(func, self._path, mode) + + @classmethod + async def cwd(cls) -> Path: + path = await to_thread.run_sync(pathlib.Path.cwd) + return cls(path) + + async def exists(self) -> bool: + return await to_thread.run_sync(self._path.exists, abandon_on_cancel=True) + + async def expanduser(self) -> Path: + return Path( + await to_thread.run_sync(self._path.expanduser, abandon_on_cancel=True) + ) + + def glob(self, pattern: str) -> AsyncIterator[Path]: + gen = self._path.glob(pattern) + return _PathIterator(gen) + + async def group(self) -> str: + return await to_thread.run_sync(self._path.group, abandon_on_cancel=True) + + async def hardlink_to( + self, target: str | bytes | PathLike[str] | PathLike[bytes] + ) -> None: + if isinstance(target, Path): + target = target._path + + await to_thread.run_sync(os.link, target, self) + + @classmethod + async def home(cls) -> Path: + home_path = await to_thread.run_sync(pathlib.Path.home) + return cls(home_path) + + def is_absolute(self) -> bool: + return self._path.is_absolute() + + async def is_block_device(self) -> bool: + return await to_thread.run_sync( + self._path.is_block_device, abandon_on_cancel=True + ) + + async def is_char_device(self) -> bool: + return await to_thread.run_sync( + self._path.is_char_device, abandon_on_cancel=True + ) + + async def is_dir(self) -> bool: + return await to_thread.run_sync(self._path.is_dir, abandon_on_cancel=True) + + async def is_fifo(self) -> bool: + return await to_thread.run_sync(self._path.is_fifo, abandon_on_cancel=True) + + async def is_file(self) -> bool: + return await to_thread.run_sync(self._path.is_file, abandon_on_cancel=True) + + if sys.version_info >= (3, 12): + + async def is_junction(self) -> bool: + return await to_thread.run_sync(self._path.is_junction) + + async def is_mount(self) -> bool: + return await to_thread.run_sync( + os.path.ismount, self._path, abandon_on_cancel=True + ) + + def is_reserved(self) -> bool: + return self._path.is_reserved() + + async def is_socket(self) -> bool: + return await to_thread.run_sync(self._path.is_socket, abandon_on_cancel=True) + + async def is_symlink(self) -> bool: + return await to_thread.run_sync(self._path.is_symlink, abandon_on_cancel=True) + + async def iterdir(self) -> AsyncIterator[Path]: + gen = ( + self._path.iterdir() + if sys.version_info < (3, 13) + else await to_thread.run_sync(self._path.iterdir, abandon_on_cancel=True) + ) + async for path in _PathIterator(gen): + yield path + + def joinpath(self, *args: str | PathLike[str]) -> Path: + return Path(self._path.joinpath(*args)) + + async def lchmod(self, mode: int) -> None: + await to_thread.run_sync(self._path.lchmod, mode) + + async def lstat(self) -> os.stat_result: + return await to_thread.run_sync(self._path.lstat, abandon_on_cancel=True) + + async def mkdir( + self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False + ) -> None: + await to_thread.run_sync(self._path.mkdir, mode, parents, exist_ok) + + @overload + async def open( + self, + mode: OpenBinaryMode, + buffering: int = ..., + encoding: str | None = ..., + errors: str | None = ..., + newline: str | None = ..., + ) -> AsyncFile[bytes]: ... + + @overload + async def open( + self, + mode: OpenTextMode = ..., + buffering: int = ..., + encoding: str | None = ..., + errors: str | None = ..., + newline: str | None = ..., + ) -> AsyncFile[str]: ... + + async def open( + self, + mode: str = "r", + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + ) -> AsyncFile[Any]: + fp = await to_thread.run_sync( + self._path.open, mode, buffering, encoding, errors, newline + ) + return AsyncFile(fp) + + async def owner(self) -> str: + return await to_thread.run_sync(self._path.owner, abandon_on_cancel=True) + + async def read_bytes(self) -> bytes: + return await to_thread.run_sync(self._path.read_bytes) + + async def read_text( + self, encoding: str | None = None, errors: str | None = None + ) -> str: + return await to_thread.run_sync(self._path.read_text, encoding, errors) + + if sys.version_info >= (3, 12): + + def relative_to( + self, *other: str | PathLike[str], walk_up: bool = False + ) -> Path: + # relative_to() should work with any PathLike but it doesn't + others = [pathlib.Path(other) for other in other] + return Path(self._path.relative_to(*others, walk_up=walk_up)) + + else: + + def relative_to(self, *other: str | PathLike[str]) -> Path: + return Path(self._path.relative_to(*other)) + + async def readlink(self) -> Path: + target = await to_thread.run_sync(os.readlink, self._path) + return Path(target) + + async def rename(self, target: str | pathlib.PurePath | Path) -> Path: + if isinstance(target, Path): + target = target._path + + await to_thread.run_sync(self._path.rename, target) + return Path(target) + + async def replace(self, target: str | pathlib.PurePath | Path) -> Path: + if isinstance(target, Path): + target = target._path + + await to_thread.run_sync(self._path.replace, target) + return Path(target) + + async def resolve(self, strict: bool = False) -> Path: + func = partial(self._path.resolve, strict=strict) + return Path(await to_thread.run_sync(func, abandon_on_cancel=True)) + + def rglob(self, pattern: str) -> AsyncIterator[Path]: + gen = self._path.rglob(pattern) + return _PathIterator(gen) + + async def rmdir(self) -> None: + await to_thread.run_sync(self._path.rmdir) + + async def samefile(self, other_path: str | PathLike[str]) -> bool: + if isinstance(other_path, Path): + other_path = other_path._path + + return await to_thread.run_sync( + self._path.samefile, other_path, abandon_on_cancel=True + ) + + async def stat(self, *, follow_symlinks: bool = True) -> os.stat_result: + func = partial(os.stat, follow_symlinks=follow_symlinks) + return await to_thread.run_sync(func, self._path, abandon_on_cancel=True) + + async def symlink_to( + self, + target: str | bytes | PathLike[str] | PathLike[bytes], + target_is_directory: bool = False, + ) -> None: + if isinstance(target, Path): + target = target._path + + await to_thread.run_sync(self._path.symlink_to, target, target_is_directory) + + async def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None: + await to_thread.run_sync(self._path.touch, mode, exist_ok) + + async def unlink(self, missing_ok: bool = False) -> None: + try: + await to_thread.run_sync(self._path.unlink) + except FileNotFoundError: + if not missing_ok: + raise + + if sys.version_info >= (3, 12): + + async def walk( + self, + top_down: bool = True, + on_error: Callable[[OSError], object] | None = None, + follow_symlinks: bool = False, + ) -> AsyncIterator[tuple[Path, list[str], list[str]]]: + def get_next_value() -> tuple[pathlib.Path, list[str], list[str]] | None: + try: + return next(gen) + except StopIteration: + return None + + gen = self._path.walk(top_down, on_error, follow_symlinks) + while True: + value = await to_thread.run_sync(get_next_value) + if value is None: + return + + root, dirs, paths = value + yield Path(root), dirs, paths + + def with_name(self, name: str) -> Path: + return Path(self._path.with_name(name)) + + def with_stem(self, stem: str) -> Path: + return Path(self._path.with_name(stem + self._path.suffix)) + + def with_suffix(self, suffix: str) -> Path: + return Path(self._path.with_suffix(suffix)) + + def with_segments(self, *pathsegments: str | PathLike[str]) -> Path: + return Path(*pathsegments) + + async def write_bytes(self, data: bytes) -> int: + return await to_thread.run_sync(self._path.write_bytes, data) + + async def write_text( + self, + data: str, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + ) -> int: + # Path.write_text() does not support the "newline" parameter before Python 3.10 + def sync_write_text() -> int: + with self._path.open( + "w", encoding=encoding, errors=errors, newline=newline + ) as fp: + return fp.write(data) + + return await to_thread.run_sync(sync_write_text) + + +PathLike.register(Path) diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_resources.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_resources.py new file mode 100644 index 0000000000000000000000000000000000000000..b9a5344aef2962670f9b305a02cd0b11f2087d2f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_resources.py @@ -0,0 +1,18 @@ +from __future__ import annotations + +from ..abc import AsyncResource +from ._tasks import CancelScope + + +async def aclose_forcefully(resource: AsyncResource) -> None: + """ + Close an asynchronous resource in a cancelled scope. + + Doing this closes the resource without waiting on anything. + + :param resource: the resource to close + + """ + with CancelScope() as scope: + scope.cancel() + await resource.aclose() diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_signals.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_signals.py new file mode 100644 index 0000000000000000000000000000000000000000..f3451d302f514a6b2c9b4f96c6b3e17e36d7d050 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_signals.py @@ -0,0 +1,27 @@ +from __future__ import annotations + +from collections.abc import AsyncIterator +from contextlib import AbstractContextManager +from signal import Signals + +from ._eventloop import get_async_backend + + +def open_signal_receiver( + *signals: Signals, +) -> AbstractContextManager[AsyncIterator[Signals]]: + """ + Start receiving operating system signals. + + :param signals: signals to receive (e.g. ``signal.SIGINT``) + :return: an asynchronous context manager for an asynchronous iterator which yields + signal numbers + + .. warning:: Windows does not support signals natively so it is best to avoid + relying on this in cross-platform applications. + + .. warning:: On asyncio, this permanently replaces any previous signal handler for + the given signals, as set via :meth:`~asyncio.loop.add_signal_handler`. + + """ + return get_async_backend().open_signal_receiver(*signals) diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_sockets.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_sockets.py new file mode 100644 index 0000000000000000000000000000000000000000..9781c6022be901678e4efc1a5714fc7bcafaf4ac --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_sockets.py @@ -0,0 +1,934 @@ +from __future__ import annotations + +import errno +import os +import socket +import ssl +import stat +import sys +from collections.abc import Awaitable +from dataclasses import dataclass +from ipaddress import IPv4Address, IPv6Address, ip_address +from os import PathLike, chmod +from socket import AddressFamily, SocketKind +from typing import TYPE_CHECKING, Any, Literal, cast, overload + +from .. import ConnectionFailed, to_thread +from ..abc import ( + ByteStreamConnectable, + ConnectedUDPSocket, + ConnectedUNIXDatagramSocket, + IPAddressType, + IPSockAddrType, + SocketListener, + SocketStream, + UDPSocket, + UNIXDatagramSocket, + UNIXSocketStream, +) +from ..streams.stapled import MultiListener +from ..streams.tls import TLSConnectable, TLSStream +from ._eventloop import get_async_backend +from ._resources import aclose_forcefully +from ._synchronization import Event +from ._tasks import create_task_group, move_on_after + +if TYPE_CHECKING: + from _typeshed import FileDescriptorLike +else: + FileDescriptorLike = object + +if sys.version_info < (3, 11): + from exceptiongroup import ExceptionGroup + +if sys.version_info >= (3, 12): + from typing import override +else: + from typing_extensions import override + +if sys.version_info < (3, 13): + from typing_extensions import deprecated +else: + from warnings import deprecated + +IPPROTO_IPV6 = getattr(socket, "IPPROTO_IPV6", 41) # https://bugs.python.org/issue29515 + +AnyIPAddressFamily = Literal[ + AddressFamily.AF_UNSPEC, AddressFamily.AF_INET, AddressFamily.AF_INET6 +] +IPAddressFamily = Literal[AddressFamily.AF_INET, AddressFamily.AF_INET6] + + +# tls_hostname given +@overload +async def connect_tcp( + remote_host: IPAddressType, + remote_port: int, + *, + local_host: IPAddressType | None = ..., + ssl_context: ssl.SSLContext | None = ..., + tls_standard_compatible: bool = ..., + tls_hostname: str, + happy_eyeballs_delay: float = ..., +) -> TLSStream: ... + + +# ssl_context given +@overload +async def connect_tcp( + remote_host: IPAddressType, + remote_port: int, + *, + local_host: IPAddressType | None = ..., + ssl_context: ssl.SSLContext, + tls_standard_compatible: bool = ..., + tls_hostname: str | None = ..., + happy_eyeballs_delay: float = ..., +) -> TLSStream: ... + + +# tls=True +@overload +async def connect_tcp( + remote_host: IPAddressType, + remote_port: int, + *, + local_host: IPAddressType | None = ..., + tls: Literal[True], + ssl_context: ssl.SSLContext | None = ..., + tls_standard_compatible: bool = ..., + tls_hostname: str | None = ..., + happy_eyeballs_delay: float = ..., +) -> TLSStream: ... + + +# tls=False +@overload +async def connect_tcp( + remote_host: IPAddressType, + remote_port: int, + *, + local_host: IPAddressType | None = ..., + tls: Literal[False], + ssl_context: ssl.SSLContext | None = ..., + tls_standard_compatible: bool = ..., + tls_hostname: str | None = ..., + happy_eyeballs_delay: float = ..., +) -> SocketStream: ... + + +# No TLS arguments +@overload +async def connect_tcp( + remote_host: IPAddressType, + remote_port: int, + *, + local_host: IPAddressType | None = ..., + happy_eyeballs_delay: float = ..., +) -> SocketStream: ... + + +async def connect_tcp( + remote_host: IPAddressType, + remote_port: int, + *, + local_host: IPAddressType | None = None, + tls: bool = False, + ssl_context: ssl.SSLContext | None = None, + tls_standard_compatible: bool = True, + tls_hostname: str | None = None, + happy_eyeballs_delay: float = 0.25, +) -> SocketStream | TLSStream: + """ + Connect to a host using the TCP protocol. + + This function implements the stateless version of the Happy Eyeballs algorithm (RFC + 6555). If ``remote_host`` is a host name that resolves to multiple IP addresses, + each one is tried until one connection attempt succeeds. If the first attempt does + not connected within 250 milliseconds, a second attempt is started using the next + address in the list, and so on. On IPv6 enabled systems, an IPv6 address (if + available) is tried first. + + When the connection has been established, a TLS handshake will be done if either + ``ssl_context`` or ``tls_hostname`` is not ``None``, or if ``tls`` is ``True``. + + :param remote_host: the IP address or host name to connect to + :param remote_port: port on the target host to connect to + :param local_host: the interface address or name to bind the socket to before + connecting + :param tls: ``True`` to do a TLS handshake with the connected stream and return a + :class:`~anyio.streams.tls.TLSStream` instead + :param ssl_context: the SSL context object to use (if omitted, a default context is + created) + :param tls_standard_compatible: If ``True``, performs the TLS shutdown handshake + before closing the stream and requires that the server does this as well. + Otherwise, :exc:`~ssl.SSLEOFError` may be raised during reads from the stream. + Some protocols, such as HTTP, require this option to be ``False``. + See :meth:`~ssl.SSLContext.wrap_socket` for details. + :param tls_hostname: host name to check the server certificate against (defaults to + the value of ``remote_host``) + :param happy_eyeballs_delay: delay (in seconds) before starting the next connection + attempt + :return: a socket stream object if no TLS handshake was done, otherwise a TLS stream + :raises ConnectionFailed: if the connection fails + + """ + # Placed here due to https://github.com/python/mypy/issues/7057 + connected_stream: SocketStream | None = None + + async def try_connect(remote_host: str, event: Event) -> None: + nonlocal connected_stream + try: + stream = await asynclib.connect_tcp(remote_host, remote_port, local_address) + except OSError as exc: + oserrors.append(exc) + return + else: + if connected_stream is None: + connected_stream = stream + tg.cancel_scope.cancel() + else: + await stream.aclose() + finally: + event.set() + + asynclib = get_async_backend() + local_address: IPSockAddrType | None = None + family = socket.AF_UNSPEC + if local_host: + gai_res = await getaddrinfo(str(local_host), None) + family, *_, local_address = gai_res[0] + + target_host = str(remote_host) + try: + addr_obj = ip_address(remote_host) + except ValueError: + addr_obj = None + + if addr_obj is not None: + if isinstance(addr_obj, IPv6Address): + target_addrs = [(socket.AF_INET6, addr_obj.compressed)] + else: + target_addrs = [(socket.AF_INET, addr_obj.compressed)] + else: + # getaddrinfo() will raise an exception if name resolution fails + gai_res = await getaddrinfo( + target_host, remote_port, family=family, type=socket.SOCK_STREAM + ) + + # Organize the list so that the first address is an IPv6 address (if available) + # and the second one is an IPv4 addresses. The rest can be in whatever order. + v6_found = v4_found = False + target_addrs = [] + for af, *_, sa in gai_res: + if af == socket.AF_INET6 and not v6_found: + v6_found = True + target_addrs.insert(0, (af, sa[0])) + elif af == socket.AF_INET and not v4_found and v6_found: + v4_found = True + target_addrs.insert(1, (af, sa[0])) + else: + target_addrs.append((af, sa[0])) + + oserrors: list[OSError] = [] + try: + async with create_task_group() as tg: + for _af, addr in target_addrs: + event = Event() + tg.start_soon(try_connect, addr, event) + with move_on_after(happy_eyeballs_delay): + await event.wait() + + if connected_stream is None: + cause = ( + oserrors[0] + if len(oserrors) == 1 + else ExceptionGroup("multiple connection attempts failed", oserrors) + ) + raise OSError("All connection attempts failed") from cause + finally: + oserrors.clear() + + if tls or tls_hostname or ssl_context: + try: + return await TLSStream.wrap( + connected_stream, + server_side=False, + hostname=tls_hostname or str(remote_host), + ssl_context=ssl_context, + standard_compatible=tls_standard_compatible, + ) + except BaseException: + await aclose_forcefully(connected_stream) + raise + + return connected_stream + + +async def connect_unix(path: str | bytes | PathLike[Any]) -> UNIXSocketStream: + """ + Connect to the given UNIX socket. + + Not available on Windows. + + :param path: path to the socket + :return: a socket stream object + :raises ConnectionFailed: if the connection fails + + """ + path = os.fspath(path) + return await get_async_backend().connect_unix(path) + + +async def create_tcp_listener( + *, + local_host: IPAddressType | None = None, + local_port: int = 0, + family: AnyIPAddressFamily = socket.AddressFamily.AF_UNSPEC, + backlog: int = 65536, + reuse_port: bool = False, +) -> MultiListener[SocketStream]: + """ + Create a TCP socket listener. + + :param local_port: port number to listen on + :param local_host: IP address of the interface to listen on. If omitted, listen on + all IPv4 and IPv6 interfaces. To listen on all interfaces on a specific address + family, use ``0.0.0.0`` for IPv4 or ``::`` for IPv6. + :param family: address family (used if ``local_host`` was omitted) + :param backlog: maximum number of queued incoming connections (up to a maximum of + 2**16, or 65536) + :param reuse_port: ``True`` to allow multiple sockets to bind to the same + address/port (not supported on Windows) + :return: a multi-listener object containing one or more socket listeners + + """ + asynclib = get_async_backend() + backlog = min(backlog, 65536) + local_host = str(local_host) if local_host is not None else None + gai_res = await getaddrinfo( + local_host, + local_port, + family=family, + type=socket.SocketKind.SOCK_STREAM if sys.platform == "win32" else 0, + flags=socket.AI_PASSIVE | socket.AI_ADDRCONFIG, + ) + listeners: list[SocketListener] = [] + try: + # The set() is here to work around a glibc bug: + # https://sourceware.org/bugzilla/show_bug.cgi?id=14969 + sockaddr: tuple[str, int] | tuple[str, int, int, int] + for fam, kind, *_, sockaddr in sorted(set(gai_res)): + # Workaround for an uvloop bug where we don't get the correct scope ID for + # IPv6 link-local addresses when passing type=socket.SOCK_STREAM to + # getaddrinfo(): https://github.com/MagicStack/uvloop/issues/539 + if sys.platform != "win32" and kind is not SocketKind.SOCK_STREAM: + continue + + raw_socket = socket.socket(fam) + raw_socket.setblocking(False) + + # For Windows, enable exclusive address use. For others, enable address + # reuse. + if sys.platform == "win32": + raw_socket.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1) + else: + raw_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + + if reuse_port: + raw_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) + + # If only IPv6 was requested, disable dual stack operation + if fam == socket.AF_INET6: + raw_socket.setsockopt(IPPROTO_IPV6, socket.IPV6_V6ONLY, 1) + + # Workaround for #554 + if "%" in sockaddr[0]: + addr, scope_id = sockaddr[0].split("%", 1) + sockaddr = (addr, sockaddr[1], 0, int(scope_id)) + + raw_socket.bind(sockaddr) + raw_socket.listen(backlog) + listener = asynclib.create_tcp_listener(raw_socket) + listeners.append(listener) + except BaseException: + for listener in listeners: + await listener.aclose() + + raise + + return MultiListener(listeners) + + +async def create_unix_listener( + path: str | bytes | PathLike[Any], + *, + mode: int | None = None, + backlog: int = 65536, +) -> SocketListener: + """ + Create a UNIX socket listener. + + Not available on Windows. + + :param path: path of the socket + :param mode: permissions to set on the socket + :param backlog: maximum number of queued incoming connections (up to a maximum of + 2**16, or 65536) + :return: a listener object + + .. versionchanged:: 3.0 + If a socket already exists on the file system in the given path, it will be + removed first. + + """ + backlog = min(backlog, 65536) + raw_socket = await setup_unix_local_socket(path, mode, socket.SOCK_STREAM) + try: + raw_socket.listen(backlog) + return get_async_backend().create_unix_listener(raw_socket) + except BaseException: + raw_socket.close() + raise + + +async def create_udp_socket( + family: AnyIPAddressFamily = AddressFamily.AF_UNSPEC, + *, + local_host: IPAddressType | None = None, + local_port: int = 0, + reuse_port: bool = False, +) -> UDPSocket: + """ + Create a UDP socket. + + If ``port`` has been given, the socket will be bound to this port on the local + machine, making this socket suitable for providing UDP based services. + + :param family: address family (``AF_INET`` or ``AF_INET6``) – automatically + determined from ``local_host`` if omitted + :param local_host: IP address or host name of the local interface to bind to + :param local_port: local port to bind to + :param reuse_port: ``True`` to allow multiple sockets to bind to the same + address/port (not supported on Windows) + :return: a UDP socket + + """ + if family is AddressFamily.AF_UNSPEC and not local_host: + raise ValueError('Either "family" or "local_host" must be given') + + if local_host: + gai_res = await getaddrinfo( + str(local_host), + local_port, + family=family, + type=socket.SOCK_DGRAM, + flags=socket.AI_PASSIVE | socket.AI_ADDRCONFIG, + ) + family = cast(AnyIPAddressFamily, gai_res[0][0]) + local_address = gai_res[0][-1] + elif family is AddressFamily.AF_INET6: + local_address = ("::", 0) + else: + local_address = ("0.0.0.0", 0) + + sock = await get_async_backend().create_udp_socket( + family, local_address, None, reuse_port + ) + return cast(UDPSocket, sock) + + +async def create_connected_udp_socket( + remote_host: IPAddressType, + remote_port: int, + *, + family: AnyIPAddressFamily = AddressFamily.AF_UNSPEC, + local_host: IPAddressType | None = None, + local_port: int = 0, + reuse_port: bool = False, +) -> ConnectedUDPSocket: + """ + Create a connected UDP socket. + + Connected UDP sockets can only communicate with the specified remote host/port, an + any packets sent from other sources are dropped. + + :param remote_host: remote host to set as the default target + :param remote_port: port on the remote host to set as the default target + :param family: address family (``AF_INET`` or ``AF_INET6``) – automatically + determined from ``local_host`` or ``remote_host`` if omitted + :param local_host: IP address or host name of the local interface to bind to + :param local_port: local port to bind to + :param reuse_port: ``True`` to allow multiple sockets to bind to the same + address/port (not supported on Windows) + :return: a connected UDP socket + + """ + local_address = None + if local_host: + gai_res = await getaddrinfo( + str(local_host), + local_port, + family=family, + type=socket.SOCK_DGRAM, + flags=socket.AI_PASSIVE | socket.AI_ADDRCONFIG, + ) + family = cast(AnyIPAddressFamily, gai_res[0][0]) + local_address = gai_res[0][-1] + + gai_res = await getaddrinfo( + str(remote_host), remote_port, family=family, type=socket.SOCK_DGRAM + ) + family = cast(AnyIPAddressFamily, gai_res[0][0]) + remote_address = gai_res[0][-1] + + sock = await get_async_backend().create_udp_socket( + family, local_address, remote_address, reuse_port + ) + return cast(ConnectedUDPSocket, sock) + + +async def create_unix_datagram_socket( + *, + local_path: None | str | bytes | PathLike[Any] = None, + local_mode: int | None = None, +) -> UNIXDatagramSocket: + """ + Create a UNIX datagram socket. + + Not available on Windows. + + If ``local_path`` has been given, the socket will be bound to this path, making this + socket suitable for receiving datagrams from other processes. Other processes can + send datagrams to this socket only if ``local_path`` is set. + + If a socket already exists on the file system in the ``local_path``, it will be + removed first. + + :param local_path: the path on which to bind to + :param local_mode: permissions to set on the local socket + :return: a UNIX datagram socket + + """ + raw_socket = await setup_unix_local_socket( + local_path, local_mode, socket.SOCK_DGRAM + ) + return await get_async_backend().create_unix_datagram_socket(raw_socket, None) + + +async def create_connected_unix_datagram_socket( + remote_path: str | bytes | PathLike[Any], + *, + local_path: None | str | bytes | PathLike[Any] = None, + local_mode: int | None = None, +) -> ConnectedUNIXDatagramSocket: + """ + Create a connected UNIX datagram socket. + + Connected datagram sockets can only communicate with the specified remote path. + + If ``local_path`` has been given, the socket will be bound to this path, making + this socket suitable for receiving datagrams from other processes. Other processes + can send datagrams to this socket only if ``local_path`` is set. + + If a socket already exists on the file system in the ``local_path``, it will be + removed first. + + :param remote_path: the path to set as the default target + :param local_path: the path on which to bind to + :param local_mode: permissions to set on the local socket + :return: a connected UNIX datagram socket + + """ + remote_path = os.fspath(remote_path) + raw_socket = await setup_unix_local_socket( + local_path, local_mode, socket.SOCK_DGRAM + ) + return await get_async_backend().create_unix_datagram_socket( + raw_socket, remote_path + ) + + +async def getaddrinfo( + host: bytes | str | None, + port: str | int | None, + *, + family: int | AddressFamily = 0, + type: int | SocketKind = 0, + proto: int = 0, + flags: int = 0, +) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int]]]: + """ + Look up a numeric IP address given a host name. + + Internationalized domain names are translated according to the (non-transitional) + IDNA 2008 standard. + + .. note:: 4-tuple IPv6 socket addresses are automatically converted to 2-tuples of + (host, port), unlike what :func:`socket.getaddrinfo` does. + + :param host: host name + :param port: port number + :param family: socket family (`'AF_INET``, ...) + :param type: socket type (``SOCK_STREAM``, ...) + :param proto: protocol number + :param flags: flags to pass to upstream ``getaddrinfo()`` + :return: list of tuples containing (family, type, proto, canonname, sockaddr) + + .. seealso:: :func:`socket.getaddrinfo` + + """ + # Handle unicode hostnames + if isinstance(host, str): + try: + encoded_host: bytes | None = host.encode("ascii") + except UnicodeEncodeError: + import idna + + encoded_host = idna.encode(host, uts46=True) + else: + encoded_host = host + + gai_res = await get_async_backend().getaddrinfo( + encoded_host, port, family=family, type=type, proto=proto, flags=flags + ) + return [ + (family, type, proto, canonname, convert_ipv6_sockaddr(sockaddr)) + for family, type, proto, canonname, sockaddr in gai_res + # filter out IPv6 results when IPv6 is disabled + if not isinstance(sockaddr[0], int) + ] + + +def getnameinfo(sockaddr: IPSockAddrType, flags: int = 0) -> Awaitable[tuple[str, str]]: + """ + Look up the host name of an IP address. + + :param sockaddr: socket address (e.g. (ipaddress, port) for IPv4) + :param flags: flags to pass to upstream ``getnameinfo()`` + :return: a tuple of (host name, service name) + + .. seealso:: :func:`socket.getnameinfo` + + """ + return get_async_backend().getnameinfo(sockaddr, flags) + + +@deprecated("This function is deprecated; use `wait_readable` instead") +def wait_socket_readable(sock: socket.socket) -> Awaitable[None]: + """ + .. deprecated:: 4.7.0 + Use :func:`wait_readable` instead. + + Wait until the given socket has data to be read. + + .. warning:: Only use this on raw sockets that have not been wrapped by any higher + level constructs like socket streams! + + :param sock: a socket object + :raises ~anyio.ClosedResourceError: if the socket was closed while waiting for the + socket to become readable + :raises ~anyio.BusyResourceError: if another task is already waiting for the socket + to become readable + + """ + return get_async_backend().wait_readable(sock.fileno()) + + +@deprecated("This function is deprecated; use `wait_writable` instead") +def wait_socket_writable(sock: socket.socket) -> Awaitable[None]: + """ + .. deprecated:: 4.7.0 + Use :func:`wait_writable` instead. + + Wait until the given socket can be written to. + + This does **NOT** work on Windows when using the asyncio backend with a proactor + event loop (default on py3.8+). + + .. warning:: Only use this on raw sockets that have not been wrapped by any higher + level constructs like socket streams! + + :param sock: a socket object + :raises ~anyio.ClosedResourceError: if the socket was closed while waiting for the + socket to become writable + :raises ~anyio.BusyResourceError: if another task is already waiting for the socket + to become writable + + """ + return get_async_backend().wait_writable(sock.fileno()) + + +def wait_readable(obj: FileDescriptorLike) -> Awaitable[None]: + """ + Wait until the given object has data to be read. + + On Unix systems, ``obj`` must either be an integer file descriptor, or else an + object with a ``.fileno()`` method which returns an integer file descriptor. Any + kind of file descriptor can be passed, though the exact semantics will depend on + your kernel. For example, this probably won't do anything useful for on-disk files. + + On Windows systems, ``obj`` must either be an integer ``SOCKET`` handle, or else an + object with a ``.fileno()`` method which returns an integer ``SOCKET`` handle. File + descriptors aren't supported, and neither are handles that refer to anything besides + a ``SOCKET``. + + On backends where this functionality is not natively provided (asyncio + ``ProactorEventLoop`` on Windows), it is provided using a separate selector thread + which is set to shut down when the interpreter shuts down. + + .. warning:: Don't use this on raw sockets that have been wrapped by any higher + level constructs like socket streams! + + :param obj: an object with a ``.fileno()`` method or an integer handle + :raises ~anyio.ClosedResourceError: if the object was closed while waiting for the + object to become readable + :raises ~anyio.BusyResourceError: if another task is already waiting for the object + to become readable + + """ + return get_async_backend().wait_readable(obj) + + +def wait_writable(obj: FileDescriptorLike) -> Awaitable[None]: + """ + Wait until the given object can be written to. + + :param obj: an object with a ``.fileno()`` method or an integer handle + :raises ~anyio.ClosedResourceError: if the object was closed while waiting for the + object to become writable + :raises ~anyio.BusyResourceError: if another task is already waiting for the object + to become writable + + .. seealso:: See the documentation of :func:`wait_readable` for the definition of + ``obj`` and notes on backend compatibility. + + .. warning:: Don't use this on raw sockets that have been wrapped by any higher + level constructs like socket streams! + + """ + return get_async_backend().wait_writable(obj) + + +def notify_closing(obj: FileDescriptorLike) -> None: + """ + Call this before closing a file descriptor (on Unix) or socket (on + Windows). This will cause any `wait_readable` or `wait_writable` + calls on the given object to immediately wake up and raise + `~anyio.ClosedResourceError`. + + This doesn't actually close the object – you still have to do that + yourself afterwards. Also, you want to be careful to make sure no + new tasks start waiting on the object in between when you call this + and when it's actually closed. So to close something properly, you + usually want to do these steps in order: + + 1. Explicitly mark the object as closed, so that any new attempts + to use it will abort before they start. + 2. Call `notify_closing` to wake up any already-existing users. + 3. Actually close the object. + + It's also possible to do them in a different order if that's more + convenient, *but only if* you make sure not to have any checkpoints in + between the steps. This way they all happen in a single atomic + step, so other tasks won't be able to tell what order they happened + in anyway. + + :param obj: an object with a ``.fileno()`` method or an integer handle + + """ + get_async_backend().notify_closing(obj) + + +# +# Private API +# + + +def convert_ipv6_sockaddr( + sockaddr: tuple[str, int, int, int] | tuple[str, int], +) -> tuple[str, int]: + """ + Convert a 4-tuple IPv6 socket address to a 2-tuple (address, port) format. + + If the scope ID is nonzero, it is added to the address, separated with ``%``. + Otherwise the flow id and scope id are simply cut off from the tuple. + Any other kinds of socket addresses are returned as-is. + + :param sockaddr: the result of :meth:`~socket.socket.getsockname` + :return: the converted socket address + + """ + # This is more complicated than it should be because of MyPy + if isinstance(sockaddr, tuple) and len(sockaddr) == 4: + host, port, flowinfo, scope_id = sockaddr + if scope_id: + # PyPy (as of v7.3.11) leaves the interface name in the result, so + # we discard it and only get the scope ID from the end + # (https://foss.heptapod.net/pypy/pypy/-/issues/3938) + host = host.split("%")[0] + + # Add scope_id to the address + return f"{host}%{scope_id}", port + else: + return host, port + else: + return sockaddr + + +async def setup_unix_local_socket( + path: None | str | bytes | PathLike[Any], + mode: int | None, + socktype: int, +) -> socket.socket: + """ + Create a UNIX local socket object, deleting the socket at the given path if it + exists. + + Not available on Windows. + + :param path: path of the socket + :param mode: permissions to set on the socket + :param socktype: socket.SOCK_STREAM or socket.SOCK_DGRAM + + """ + path_str: str | None + if path is not None: + path_str = os.fsdecode(path) + + # Linux abstract namespace sockets aren't backed by a concrete file so skip stat call + if not path_str.startswith("\0"): + # Copied from pathlib... + try: + stat_result = os.stat(path) + except OSError as e: + if e.errno not in ( + errno.ENOENT, + errno.ENOTDIR, + errno.EBADF, + errno.ELOOP, + ): + raise + else: + if stat.S_ISSOCK(stat_result.st_mode): + os.unlink(path) + else: + path_str = None + + raw_socket = socket.socket(socket.AF_UNIX, socktype) + raw_socket.setblocking(False) + + if path_str is not None: + try: + await to_thread.run_sync(raw_socket.bind, path_str, abandon_on_cancel=True) + if mode is not None: + await to_thread.run_sync(chmod, path_str, mode, abandon_on_cancel=True) + except BaseException: + raw_socket.close() + raise + + return raw_socket + + +@dataclass +class TCPConnectable(ByteStreamConnectable): + """ + Connects to a TCP server at the given host and port. + + :param host: host name or IP address of the server + :param port: TCP port number of the server + """ + + host: str | IPv4Address | IPv6Address + port: int + + def __post_init__(self) -> None: + if self.port < 1 or self.port > 65535: + raise ValueError("TCP port number out of range") + + @override + async def connect(self) -> SocketStream: + try: + return await connect_tcp(self.host, self.port) + except OSError as exc: + raise ConnectionFailed( + f"error connecting to {self.host}:{self.port}: {exc}" + ) from exc + + +@dataclass +class UNIXConnectable(ByteStreamConnectable): + """ + Connects to a UNIX domain socket at the given path. + + :param path: the file system path of the socket + """ + + path: str | bytes | PathLike[str] | PathLike[bytes] + + @override + async def connect(self) -> UNIXSocketStream: + try: + return await connect_unix(self.path) + except OSError as exc: + raise ConnectionFailed(f"error connecting to {self.path!r}: {exc}") from exc + + +def as_connectable( + remote: ByteStreamConnectable + | tuple[str | IPv4Address | IPv6Address, int] + | str + | bytes + | PathLike[str], + /, + *, + tls: bool = False, + ssl_context: ssl.SSLContext | None = None, + tls_hostname: str | None = None, + tls_standard_compatible: bool = True, +) -> ByteStreamConnectable: + """ + Return a byte stream connectable from the given object. + + If a bytestream connectable is given, it is returned unchanged. + If a tuple of (host, port) is given, a TCP connectable is returned. + If a string or bytes path is given, a UNIX connectable is returned. + + If ``tls=True``, the connectable will be wrapped in a + :class:`~.streams.tls.TLSConnectable`. + + :param remote: a connectable, a tuple of (host, port) or a path to a UNIX socket + :param tls: if ``True``, wrap the plaintext connectable in a + :class:`~.streams.tls.TLSConnectable`, using the provided TLS settings) + :param ssl_context: if ``tls=True``, the SSLContext object to use (if not provided, + a secure default will be created) + :param tls_hostname: if ``tls=True``, host name of the server to use for checking + the server certificate (defaults to the host portion of the address for TCP + connectables) + :param tls_standard_compatible: if ``False`` and ``tls=True``, makes the TLS stream + skip the closing handshake when closing the connection, so it won't raise an + exception if the server does the same + + """ + connectable: TCPConnectable | UNIXConnectable | TLSConnectable + if isinstance(remote, ByteStreamConnectable): + return remote + elif isinstance(remote, tuple) and len(remote) == 2: + connectable = TCPConnectable(*remote) + elif isinstance(remote, (str, bytes, PathLike)): + connectable = UNIXConnectable(remote) + else: + raise TypeError(f"cannot convert {remote!r} to a connectable") + + if tls: + if not tls_hostname and isinstance(connectable, TCPConnectable): + tls_hostname = str(connectable.host) + + connectable = TLSConnectable( + connectable, + ssl_context=ssl_context, + hostname=tls_hostname, + standard_compatible=tls_standard_compatible, + ) + + return connectable diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_streams.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_streams.py new file mode 100644 index 0000000000000000000000000000000000000000..6a9814e5a91d64e081ecef323a761ed42d3e64de --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_streams.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +import math +from typing import TypeVar +from warnings import warn + +from ..streams.memory import ( + MemoryObjectReceiveStream, + MemoryObjectSendStream, + MemoryObjectStreamState, +) + +T_Item = TypeVar("T_Item") + + +class create_memory_object_stream( + tuple[MemoryObjectSendStream[T_Item], MemoryObjectReceiveStream[T_Item]], +): + """ + Create a memory object stream. + + The stream's item type can be annotated like + :func:`create_memory_object_stream[T_Item]`. + + :param max_buffer_size: number of items held in the buffer until ``send()`` starts + blocking + :param item_type: old way of marking the streams with the right generic type for + static typing (does nothing on AnyIO 4) + + .. deprecated:: 4.0 + Use ``create_memory_object_stream[YourItemType](...)`` instead. + :return: a tuple of (send stream, receive stream) + + """ + + def __new__( # type: ignore[misc] + cls, max_buffer_size: float = 0, item_type: object = None + ) -> tuple[MemoryObjectSendStream[T_Item], MemoryObjectReceiveStream[T_Item]]: + if max_buffer_size != math.inf and not isinstance(max_buffer_size, int): + raise ValueError("max_buffer_size must be either an integer or math.inf") + if max_buffer_size < 0: + raise ValueError("max_buffer_size cannot be negative") + if item_type is not None: + warn( + "The item_type argument has been deprecated in AnyIO 4.0. " + "Use create_memory_object_stream[YourItemType](...) instead.", + DeprecationWarning, + stacklevel=2, + ) + + state = MemoryObjectStreamState[T_Item](max_buffer_size) + return (MemoryObjectSendStream(state), MemoryObjectReceiveStream(state)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_subprocesses.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_subprocesses.py new file mode 100644 index 0000000000000000000000000000000000000000..36d9b306c992b83a8033c0ee66daa141d23d010c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_subprocesses.py @@ -0,0 +1,202 @@ +from __future__ import annotations + +import sys +from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from io import BytesIO +from os import PathLike +from subprocess import PIPE, CalledProcessError, CompletedProcess +from typing import IO, Any, Union, cast + +from ..abc import Process +from ._eventloop import get_async_backend +from ._tasks import create_task_group + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: + from typing_extensions import TypeAlias + +StrOrBytesPath: TypeAlias = Union[str, bytes, "PathLike[str]", "PathLike[bytes]"] + + +async def run_process( + command: StrOrBytesPath | Sequence[StrOrBytesPath], + *, + input: bytes | None = None, + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = PIPE, + stderr: int | IO[Any] | None = PIPE, + check: bool = True, + cwd: StrOrBytesPath | None = None, + env: Mapping[str, str] | None = None, + startupinfo: Any = None, + creationflags: int = 0, + start_new_session: bool = False, + pass_fds: Sequence[int] = (), + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, +) -> CompletedProcess[bytes]: + """ + Run an external command in a subprocess and wait until it completes. + + .. seealso:: :func:`subprocess.run` + + :param command: either a string to pass to the shell, or an iterable of strings + containing the executable name or path and its arguments + :param input: bytes passed to the standard input of the subprocess + :param stdin: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`, + a file-like object, or `None`; ``input`` overrides this + :param stdout: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`, + a file-like object, or `None` + :param stderr: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`, + :data:`subprocess.STDOUT`, a file-like object, or `None` + :param check: if ``True``, raise :exc:`~subprocess.CalledProcessError` if the + process terminates with a return code other than 0 + :param cwd: If not ``None``, change the working directory to this before running the + command + :param env: if not ``None``, this mapping replaces the inherited environment + variables from the parent process + :param startupinfo: an instance of :class:`subprocess.STARTUPINFO` that can be used + to specify process startup parameters (Windows only) + :param creationflags: flags that can be used to control the creation of the + subprocess (see :class:`subprocess.Popen` for the specifics) + :param start_new_session: if ``true`` the setsid() system call will be made in the + child process prior to the execution of the subprocess. (POSIX only) + :param pass_fds: sequence of file descriptors to keep open between the parent and + child processes. (POSIX only) + :param user: effective user to run the process as (Python >= 3.9, POSIX only) + :param group: effective group to run the process as (Python >= 3.9, POSIX only) + :param extra_groups: supplementary groups to set in the subprocess (Python >= 3.9, + POSIX only) + :param umask: if not negative, this umask is applied in the child process before + running the given command (Python >= 3.9, POSIX only) + :return: an object representing the completed process + :raises ~subprocess.CalledProcessError: if ``check`` is ``True`` and the process + exits with a nonzero return code + + """ + + async def drain_stream(stream: AsyncIterable[bytes], index: int) -> None: + buffer = BytesIO() + async for chunk in stream: + buffer.write(chunk) + + stream_contents[index] = buffer.getvalue() + + if stdin is not None and input is not None: + raise ValueError("only one of stdin and input is allowed") + + async with await open_process( + command, + stdin=PIPE if input else stdin, + stdout=stdout, + stderr=stderr, + cwd=cwd, + env=env, + startupinfo=startupinfo, + creationflags=creationflags, + start_new_session=start_new_session, + pass_fds=pass_fds, + user=user, + group=group, + extra_groups=extra_groups, + umask=umask, + ) as process: + stream_contents: list[bytes | None] = [None, None] + async with create_task_group() as tg: + if process.stdout: + tg.start_soon(drain_stream, process.stdout, 0) + + if process.stderr: + tg.start_soon(drain_stream, process.stderr, 1) + + if process.stdin and input: + await process.stdin.send(input) + await process.stdin.aclose() + + await process.wait() + + output, errors = stream_contents + if check and process.returncode != 0: + raise CalledProcessError(cast(int, process.returncode), command, output, errors) + + return CompletedProcess(command, cast(int, process.returncode), output, errors) + + +async def open_process( + command: StrOrBytesPath | Sequence[StrOrBytesPath], + *, + stdin: int | IO[Any] | None = PIPE, + stdout: int | IO[Any] | None = PIPE, + stderr: int | IO[Any] | None = PIPE, + cwd: StrOrBytesPath | None = None, + env: Mapping[str, str] | None = None, + startupinfo: Any = None, + creationflags: int = 0, + start_new_session: bool = False, + pass_fds: Sequence[int] = (), + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, +) -> Process: + """ + Start an external command in a subprocess. + + .. seealso:: :class:`subprocess.Popen` + + :param command: either a string to pass to the shell, or an iterable of strings + containing the executable name or path and its arguments + :param stdin: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`, a + file-like object, or ``None`` + :param stdout: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`, + a file-like object, or ``None`` + :param stderr: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`, + :data:`subprocess.STDOUT`, a file-like object, or ``None`` + :param cwd: If not ``None``, the working directory is changed before executing + :param env: If env is not ``None``, it must be a mapping that defines the + environment variables for the new process + :param creationflags: flags that can be used to control the creation of the + subprocess (see :class:`subprocess.Popen` for the specifics) + :param startupinfo: an instance of :class:`subprocess.STARTUPINFO` that can be used + to specify process startup parameters (Windows only) + :param start_new_session: if ``true`` the setsid() system call will be made in the + child process prior to the execution of the subprocess. (POSIX only) + :param pass_fds: sequence of file descriptors to keep open between the parent and + child processes. (POSIX only) + :param user: effective user to run the process as (POSIX only) + :param group: effective group to run the process as (POSIX only) + :param extra_groups: supplementary groups to set in the subprocess (POSIX only) + :param umask: if not negative, this umask is applied in the child process before + running the given command (POSIX only) + :return: an asynchronous process object + + """ + kwargs: dict[str, Any] = {} + if user is not None: + kwargs["user"] = user + + if group is not None: + kwargs["group"] = group + + if extra_groups is not None: + kwargs["extra_groups"] = group + + if umask >= 0: + kwargs["umask"] = umask + + return await get_async_backend().open_process( + command, + stdin=stdin, + stdout=stdout, + stderr=stderr, + cwd=cwd, + env=env, + startupinfo=startupinfo, + creationflags=creationflags, + start_new_session=start_new_session, + pass_fds=pass_fds, + **kwargs, + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_synchronization.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_synchronization.py new file mode 100644 index 0000000000000000000000000000000000000000..caa6efc66fb42e47b8289ff8fbc47a498a59780d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_synchronization.py @@ -0,0 +1,732 @@ +from __future__ import annotations + +import math +from collections import deque +from dataclasses import dataclass +from types import TracebackType + +from sniffio import AsyncLibraryNotFoundError + +from ..lowlevel import checkpoint +from ._eventloop import get_async_backend +from ._exceptions import BusyResourceError +from ._tasks import CancelScope +from ._testing import TaskInfo, get_current_task + + +@dataclass(frozen=True) +class EventStatistics: + """ + :ivar int tasks_waiting: number of tasks waiting on :meth:`~.Event.wait` + """ + + tasks_waiting: int + + +@dataclass(frozen=True) +class CapacityLimiterStatistics: + """ + :ivar int borrowed_tokens: number of tokens currently borrowed by tasks + :ivar float total_tokens: total number of available tokens + :ivar tuple borrowers: tasks or other objects currently holding tokens borrowed from + this limiter + :ivar int tasks_waiting: number of tasks waiting on + :meth:`~.CapacityLimiter.acquire` or + :meth:`~.CapacityLimiter.acquire_on_behalf_of` + """ + + borrowed_tokens: int + total_tokens: float + borrowers: tuple[object, ...] + tasks_waiting: int + + +@dataclass(frozen=True) +class LockStatistics: + """ + :ivar bool locked: flag indicating if this lock is locked or not + :ivar ~anyio.TaskInfo owner: task currently holding the lock (or ``None`` if the + lock is not held by any task) + :ivar int tasks_waiting: number of tasks waiting on :meth:`~.Lock.acquire` + """ + + locked: bool + owner: TaskInfo | None + tasks_waiting: int + + +@dataclass(frozen=True) +class ConditionStatistics: + """ + :ivar int tasks_waiting: number of tasks blocked on :meth:`~.Condition.wait` + :ivar ~anyio.LockStatistics lock_statistics: statistics of the underlying + :class:`~.Lock` + """ + + tasks_waiting: int + lock_statistics: LockStatistics + + +@dataclass(frozen=True) +class SemaphoreStatistics: + """ + :ivar int tasks_waiting: number of tasks waiting on :meth:`~.Semaphore.acquire` + + """ + + tasks_waiting: int + + +class Event: + def __new__(cls) -> Event: + try: + return get_async_backend().create_event() + except AsyncLibraryNotFoundError: + return EventAdapter() + + def set(self) -> None: + """Set the flag, notifying all listeners.""" + raise NotImplementedError + + def is_set(self) -> bool: + """Return ``True`` if the flag is set, ``False`` if not.""" + raise NotImplementedError + + async def wait(self) -> None: + """ + Wait until the flag has been set. + + If the flag has already been set when this method is called, it returns + immediately. + + """ + raise NotImplementedError + + def statistics(self) -> EventStatistics: + """Return statistics about the current state of this event.""" + raise NotImplementedError + + +class EventAdapter(Event): + _internal_event: Event | None = None + _is_set: bool = False + + def __new__(cls) -> EventAdapter: + return object.__new__(cls) + + @property + def _event(self) -> Event: + if self._internal_event is None: + self._internal_event = get_async_backend().create_event() + if self._is_set: + self._internal_event.set() + + return self._internal_event + + def set(self) -> None: + if self._internal_event is None: + self._is_set = True + else: + self._event.set() + + def is_set(self) -> bool: + if self._internal_event is None: + return self._is_set + + return self._internal_event.is_set() + + async def wait(self) -> None: + await self._event.wait() + + def statistics(self) -> EventStatistics: + if self._internal_event is None: + return EventStatistics(tasks_waiting=0) + + return self._internal_event.statistics() + + +class Lock: + def __new__(cls, *, fast_acquire: bool = False) -> Lock: + try: + return get_async_backend().create_lock(fast_acquire=fast_acquire) + except AsyncLibraryNotFoundError: + return LockAdapter(fast_acquire=fast_acquire) + + async def __aenter__(self) -> None: + await self.acquire() + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.release() + + async def acquire(self) -> None: + """Acquire the lock.""" + raise NotImplementedError + + def acquire_nowait(self) -> None: + """ + Acquire the lock, without blocking. + + :raises ~anyio.WouldBlock: if the operation would block + + """ + raise NotImplementedError + + def release(self) -> None: + """Release the lock.""" + raise NotImplementedError + + def locked(self) -> bool: + """Return True if the lock is currently held.""" + raise NotImplementedError + + def statistics(self) -> LockStatistics: + """ + Return statistics about the current state of this lock. + + .. versionadded:: 3.0 + """ + raise NotImplementedError + + +class LockAdapter(Lock): + _internal_lock: Lock | None = None + + def __new__(cls, *, fast_acquire: bool = False) -> LockAdapter: + return object.__new__(cls) + + def __init__(self, *, fast_acquire: bool = False): + self._fast_acquire = fast_acquire + + @property + def _lock(self) -> Lock: + if self._internal_lock is None: + self._internal_lock = get_async_backend().create_lock( + fast_acquire=self._fast_acquire + ) + + return self._internal_lock + + async def __aenter__(self) -> None: + await self._lock.acquire() + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + if self._internal_lock is not None: + self._internal_lock.release() + + async def acquire(self) -> None: + """Acquire the lock.""" + await self._lock.acquire() + + def acquire_nowait(self) -> None: + """ + Acquire the lock, without blocking. + + :raises ~anyio.WouldBlock: if the operation would block + + """ + self._lock.acquire_nowait() + + def release(self) -> None: + """Release the lock.""" + self._lock.release() + + def locked(self) -> bool: + """Return True if the lock is currently held.""" + return self._lock.locked() + + def statistics(self) -> LockStatistics: + """ + Return statistics about the current state of this lock. + + .. versionadded:: 3.0 + + """ + if self._internal_lock is None: + return LockStatistics(False, None, 0) + + return self._internal_lock.statistics() + + +class Condition: + _owner_task: TaskInfo | None = None + + def __init__(self, lock: Lock | None = None): + self._lock = lock or Lock() + self._waiters: deque[Event] = deque() + + async def __aenter__(self) -> None: + await self.acquire() + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.release() + + def _check_acquired(self) -> None: + if self._owner_task != get_current_task(): + raise RuntimeError("The current task is not holding the underlying lock") + + async def acquire(self) -> None: + """Acquire the underlying lock.""" + await self._lock.acquire() + self._owner_task = get_current_task() + + def acquire_nowait(self) -> None: + """ + Acquire the underlying lock, without blocking. + + :raises ~anyio.WouldBlock: if the operation would block + + """ + self._lock.acquire_nowait() + self._owner_task = get_current_task() + + def release(self) -> None: + """Release the underlying lock.""" + self._lock.release() + + def locked(self) -> bool: + """Return True if the lock is set.""" + return self._lock.locked() + + def notify(self, n: int = 1) -> None: + """Notify exactly n listeners.""" + self._check_acquired() + for _ in range(n): + try: + event = self._waiters.popleft() + except IndexError: + break + + event.set() + + def notify_all(self) -> None: + """Notify all the listeners.""" + self._check_acquired() + for event in self._waiters: + event.set() + + self._waiters.clear() + + async def wait(self) -> None: + """Wait for a notification.""" + await checkpoint() + event = Event() + self._waiters.append(event) + self.release() + try: + await event.wait() + except BaseException: + if not event.is_set(): + self._waiters.remove(event) + + raise + finally: + with CancelScope(shield=True): + await self.acquire() + + def statistics(self) -> ConditionStatistics: + """ + Return statistics about the current state of this condition. + + .. versionadded:: 3.0 + """ + return ConditionStatistics(len(self._waiters), self._lock.statistics()) + + +class Semaphore: + def __new__( + cls, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ) -> Semaphore: + try: + return get_async_backend().create_semaphore( + initial_value, max_value=max_value, fast_acquire=fast_acquire + ) + except AsyncLibraryNotFoundError: + return SemaphoreAdapter(initial_value, max_value=max_value) + + def __init__( + self, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ): + if not isinstance(initial_value, int): + raise TypeError("initial_value must be an integer") + if initial_value < 0: + raise ValueError("initial_value must be >= 0") + if max_value is not None: + if not isinstance(max_value, int): + raise TypeError("max_value must be an integer or None") + if max_value < initial_value: + raise ValueError( + "max_value must be equal to or higher than initial_value" + ) + + self._fast_acquire = fast_acquire + + async def __aenter__(self) -> Semaphore: + await self.acquire() + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.release() + + async def acquire(self) -> None: + """Decrement the semaphore value, blocking if necessary.""" + raise NotImplementedError + + def acquire_nowait(self) -> None: + """ + Acquire the underlying lock, without blocking. + + :raises ~anyio.WouldBlock: if the operation would block + + """ + raise NotImplementedError + + def release(self) -> None: + """Increment the semaphore value.""" + raise NotImplementedError + + @property + def value(self) -> int: + """The current value of the semaphore.""" + raise NotImplementedError + + @property + def max_value(self) -> int | None: + """The maximum value of the semaphore.""" + raise NotImplementedError + + def statistics(self) -> SemaphoreStatistics: + """ + Return statistics about the current state of this semaphore. + + .. versionadded:: 3.0 + """ + raise NotImplementedError + + +class SemaphoreAdapter(Semaphore): + _internal_semaphore: Semaphore | None = None + + def __new__( + cls, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ) -> SemaphoreAdapter: + return object.__new__(cls) + + def __init__( + self, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ) -> None: + super().__init__(initial_value, max_value=max_value, fast_acquire=fast_acquire) + self._initial_value = initial_value + self._max_value = max_value + + @property + def _semaphore(self) -> Semaphore: + if self._internal_semaphore is None: + self._internal_semaphore = get_async_backend().create_semaphore( + self._initial_value, max_value=self._max_value + ) + + return self._internal_semaphore + + async def acquire(self) -> None: + await self._semaphore.acquire() + + def acquire_nowait(self) -> None: + self._semaphore.acquire_nowait() + + def release(self) -> None: + self._semaphore.release() + + @property + def value(self) -> int: + if self._internal_semaphore is None: + return self._initial_value + + return self._semaphore.value + + @property + def max_value(self) -> int | None: + return self._max_value + + def statistics(self) -> SemaphoreStatistics: + if self._internal_semaphore is None: + return SemaphoreStatistics(tasks_waiting=0) + + return self._semaphore.statistics() + + +class CapacityLimiter: + def __new__(cls, total_tokens: float) -> CapacityLimiter: + try: + return get_async_backend().create_capacity_limiter(total_tokens) + except AsyncLibraryNotFoundError: + return CapacityLimiterAdapter(total_tokens) + + async def __aenter__(self) -> None: + raise NotImplementedError + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + raise NotImplementedError + + @property + def total_tokens(self) -> float: + """ + The total number of tokens available for borrowing. + + This is a read-write property. If the total number of tokens is increased, the + proportionate number of tasks waiting on this limiter will be granted their + tokens. + + .. versionchanged:: 3.0 + The property is now writable. + + """ + raise NotImplementedError + + @total_tokens.setter + def total_tokens(self, value: float) -> None: + raise NotImplementedError + + @property + def borrowed_tokens(self) -> int: + """The number of tokens that have currently been borrowed.""" + raise NotImplementedError + + @property + def available_tokens(self) -> float: + """The number of tokens currently available to be borrowed""" + raise NotImplementedError + + def acquire_nowait(self) -> None: + """ + Acquire a token for the current task without waiting for one to become + available. + + :raises ~anyio.WouldBlock: if there are no tokens available for borrowing + + """ + raise NotImplementedError + + def acquire_on_behalf_of_nowait(self, borrower: object) -> None: + """ + Acquire a token without waiting for one to become available. + + :param borrower: the entity borrowing a token + :raises ~anyio.WouldBlock: if there are no tokens available for borrowing + + """ + raise NotImplementedError + + async def acquire(self) -> None: + """ + Acquire a token for the current task, waiting if necessary for one to become + available. + + """ + raise NotImplementedError + + async def acquire_on_behalf_of(self, borrower: object) -> None: + """ + Acquire a token, waiting if necessary for one to become available. + + :param borrower: the entity borrowing a token + + """ + raise NotImplementedError + + def release(self) -> None: + """ + Release the token held by the current task. + + :raises RuntimeError: if the current task has not borrowed a token from this + limiter. + + """ + raise NotImplementedError + + def release_on_behalf_of(self, borrower: object) -> None: + """ + Release the token held by the given borrower. + + :raises RuntimeError: if the borrower has not borrowed a token from this + limiter. + + """ + raise NotImplementedError + + def statistics(self) -> CapacityLimiterStatistics: + """ + Return statistics about the current state of this limiter. + + .. versionadded:: 3.0 + + """ + raise NotImplementedError + + +class CapacityLimiterAdapter(CapacityLimiter): + _internal_limiter: CapacityLimiter | None = None + + def __new__(cls, total_tokens: float) -> CapacityLimiterAdapter: + return object.__new__(cls) + + def __init__(self, total_tokens: float) -> None: + self.total_tokens = total_tokens + + @property + def _limiter(self) -> CapacityLimiter: + if self._internal_limiter is None: + self._internal_limiter = get_async_backend().create_capacity_limiter( + self._total_tokens + ) + + return self._internal_limiter + + async def __aenter__(self) -> None: + await self._limiter.__aenter__() + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + return await self._limiter.__aexit__(exc_type, exc_val, exc_tb) + + @property + def total_tokens(self) -> float: + if self._internal_limiter is None: + return self._total_tokens + + return self._internal_limiter.total_tokens + + @total_tokens.setter + def total_tokens(self, value: float) -> None: + if not isinstance(value, int) and value is not math.inf: + raise TypeError("total_tokens must be an int or math.inf") + elif value < 1: + raise ValueError("total_tokens must be >= 1") + + if self._internal_limiter is None: + self._total_tokens = value + return + + self._limiter.total_tokens = value + + @property + def borrowed_tokens(self) -> int: + if self._internal_limiter is None: + return 0 + + return self._internal_limiter.borrowed_tokens + + @property + def available_tokens(self) -> float: + if self._internal_limiter is None: + return self._total_tokens + + return self._internal_limiter.available_tokens + + def acquire_nowait(self) -> None: + self._limiter.acquire_nowait() + + def acquire_on_behalf_of_nowait(self, borrower: object) -> None: + self._limiter.acquire_on_behalf_of_nowait(borrower) + + async def acquire(self) -> None: + await self._limiter.acquire() + + async def acquire_on_behalf_of(self, borrower: object) -> None: + await self._limiter.acquire_on_behalf_of(borrower) + + def release(self) -> None: + self._limiter.release() + + def release_on_behalf_of(self, borrower: object) -> None: + self._limiter.release_on_behalf_of(borrower) + + def statistics(self) -> CapacityLimiterStatistics: + if self._internal_limiter is None: + return CapacityLimiterStatistics( + borrowed_tokens=0, + total_tokens=self.total_tokens, + borrowers=(), + tasks_waiting=0, + ) + + return self._internal_limiter.statistics() + + +class ResourceGuard: + """ + A context manager for ensuring that a resource is only used by a single task at a + time. + + Entering this context manager while the previous has not exited it yet will trigger + :exc:`BusyResourceError`. + + :param action: the action to guard against (visible in the :exc:`BusyResourceError` + when triggered, e.g. "Another task is already {action} this resource") + + .. versionadded:: 4.1 + """ + + __slots__ = "action", "_guarded" + + def __init__(self, action: str = "using"): + self.action: str = action + self._guarded = False + + def __enter__(self) -> None: + if self._guarded: + raise BusyResourceError(self.action) + + self._guarded = True + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self._guarded = False diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_tasks.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..fe49015102b3c8d6c964dc1d85e1da2b42279112 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_tasks.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +import math +from collections.abc import Generator +from contextlib import contextmanager +from types import TracebackType + +from ..abc._tasks import TaskGroup, TaskStatus +from ._eventloop import get_async_backend + + +class _IgnoredTaskStatus(TaskStatus[object]): + def started(self, value: object = None) -> None: + pass + + +TASK_STATUS_IGNORED = _IgnoredTaskStatus() + + +class CancelScope: + """ + Wraps a unit of work that can be made separately cancellable. + + :param deadline: The time (clock value) when this scope is cancelled automatically + :param shield: ``True`` to shield the cancel scope from external cancellation + """ + + def __new__( + cls, *, deadline: float = math.inf, shield: bool = False + ) -> CancelScope: + return get_async_backend().create_cancel_scope(shield=shield, deadline=deadline) + + def cancel(self) -> None: + """Cancel this scope immediately.""" + raise NotImplementedError + + @property + def deadline(self) -> float: + """ + The time (clock value) when this scope is cancelled automatically. + + Will be ``float('inf')`` if no timeout has been set. + + """ + raise NotImplementedError + + @deadline.setter + def deadline(self, value: float) -> None: + raise NotImplementedError + + @property + def cancel_called(self) -> bool: + """``True`` if :meth:`cancel` has been called.""" + raise NotImplementedError + + @property + def cancelled_caught(self) -> bool: + """ + ``True`` if this scope suppressed a cancellation exception it itself raised. + + This is typically used to check if any work was interrupted, or to see if the + scope was cancelled due to its deadline being reached. The value will, however, + only be ``True`` if the cancellation was triggered by the scope itself (and not + an outer scope). + + """ + raise NotImplementedError + + @property + def shield(self) -> bool: + """ + ``True`` if this scope is shielded from external cancellation. + + While a scope is shielded, it will not receive cancellations from outside. + + """ + raise NotImplementedError + + @shield.setter + def shield(self, value: bool) -> None: + raise NotImplementedError + + def __enter__(self) -> CancelScope: + raise NotImplementedError + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> bool: + raise NotImplementedError + + +@contextmanager +def fail_after( + delay: float | None, shield: bool = False +) -> Generator[CancelScope, None, None]: + """ + Create a context manager which raises a :class:`TimeoutError` if does not finish in + time. + + :param delay: maximum allowed time (in seconds) before raising the exception, or + ``None`` to disable the timeout + :param shield: ``True`` to shield the cancel scope from external cancellation + :return: a context manager that yields a cancel scope + :rtype: :class:`~typing.ContextManager`\\[:class:`~anyio.CancelScope`\\] + + """ + current_time = get_async_backend().current_time + deadline = (current_time() + delay) if delay is not None else math.inf + with get_async_backend().create_cancel_scope( + deadline=deadline, shield=shield + ) as cancel_scope: + yield cancel_scope + + if cancel_scope.cancelled_caught and current_time() >= cancel_scope.deadline: + raise TimeoutError + + +def move_on_after(delay: float | None, shield: bool = False) -> CancelScope: + """ + Create a cancel scope with a deadline that expires after the given delay. + + :param delay: maximum allowed time (in seconds) before exiting the context block, or + ``None`` to disable the timeout + :param shield: ``True`` to shield the cancel scope from external cancellation + :return: a cancel scope + + """ + deadline = ( + (get_async_backend().current_time() + delay) if delay is not None else math.inf + ) + return get_async_backend().create_cancel_scope(deadline=deadline, shield=shield) + + +def current_effective_deadline() -> float: + """ + Return the nearest deadline among all the cancel scopes effective for the current + task. + + :return: a clock value from the event loop's internal clock (or ``float('inf')`` if + there is no deadline in effect, or ``float('-inf')`` if the current scope has + been cancelled) + :rtype: float + + """ + return get_async_backend().current_effective_deadline() + + +def create_task_group() -> TaskGroup: + """ + Create a task group. + + :return: a task group + + """ + return get_async_backend().create_task_group() diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_tempfile.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_tempfile.py new file mode 100644 index 0000000000000000000000000000000000000000..fbb6b14a9a8eae9dcaa66eb68ac36d2084617877 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_tempfile.py @@ -0,0 +1,616 @@ +from __future__ import annotations + +import os +import sys +import tempfile +from collections.abc import Iterable +from io import BytesIO, TextIOWrapper +from types import TracebackType +from typing import ( + TYPE_CHECKING, + Any, + AnyStr, + Generic, + overload, +) + +from .. import to_thread +from .._core._fileio import AsyncFile +from ..lowlevel import checkpoint_if_cancelled + +if TYPE_CHECKING: + from _typeshed import OpenBinaryMode, OpenTextMode, ReadableBuffer, WriteableBuffer + + +class TemporaryFile(Generic[AnyStr]): + """ + An asynchronous temporary file that is automatically created and cleaned up. + + This class provides an asynchronous context manager interface to a temporary file. + The file is created using Python's standard `tempfile.TemporaryFile` function in a + background thread, and is wrapped as an asynchronous file using `AsyncFile`. + + :param mode: The mode in which the file is opened. Defaults to "w+b". + :param buffering: The buffering policy (-1 means the default buffering). + :param encoding: The encoding used to decode or encode the file. Only applicable in + text mode. + :param newline: Controls how universal newlines mode works (only applicable in text + mode). + :param suffix: The suffix for the temporary file name. + :param prefix: The prefix for the temporary file name. + :param dir: The directory in which the temporary file is created. + :param errors: The error handling scheme used for encoding/decoding errors. + """ + + _async_file: AsyncFile[AnyStr] + + @overload + def __init__( + self: TemporaryFile[bytes], + mode: OpenBinaryMode = ..., + buffering: int = ..., + encoding: str | None = ..., + newline: str | None = ..., + suffix: str | None = ..., + prefix: str | None = ..., + dir: str | None = ..., + *, + errors: str | None = ..., + ): ... + @overload + def __init__( + self: TemporaryFile[str], + mode: OpenTextMode, + buffering: int = ..., + encoding: str | None = ..., + newline: str | None = ..., + suffix: str | None = ..., + prefix: str | None = ..., + dir: str | None = ..., + *, + errors: str | None = ..., + ): ... + + def __init__( + self, + mode: OpenTextMode | OpenBinaryMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + *, + errors: str | None = None, + ) -> None: + self.mode = mode + self.buffering = buffering + self.encoding = encoding + self.newline = newline + self.suffix: str | None = suffix + self.prefix: str | None = prefix + self.dir: str | None = dir + self.errors = errors + + async def __aenter__(self) -> AsyncFile[AnyStr]: + fp = await to_thread.run_sync( + lambda: tempfile.TemporaryFile( + self.mode, + self.buffering, + self.encoding, + self.newline, + self.suffix, + self.prefix, + self.dir, + errors=self.errors, + ) + ) + self._async_file = AsyncFile(fp) + return self._async_file + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + await self._async_file.aclose() + + +class NamedTemporaryFile(Generic[AnyStr]): + """ + An asynchronous named temporary file that is automatically created and cleaned up. + + This class provides an asynchronous context manager for a temporary file with a + visible name in the file system. It uses Python's standard + :func:`~tempfile.NamedTemporaryFile` function and wraps the file object with + :class:`AsyncFile` for asynchronous operations. + + :param mode: The mode in which the file is opened. Defaults to "w+b". + :param buffering: The buffering policy (-1 means the default buffering). + :param encoding: The encoding used to decode or encode the file. Only applicable in + text mode. + :param newline: Controls how universal newlines mode works (only applicable in text + mode). + :param suffix: The suffix for the temporary file name. + :param prefix: The prefix for the temporary file name. + :param dir: The directory in which the temporary file is created. + :param delete: Whether to delete the file when it is closed. + :param errors: The error handling scheme used for encoding/decoding errors. + :param delete_on_close: (Python 3.12+) Whether to delete the file on close. + """ + + _async_file: AsyncFile[AnyStr] + + @overload + def __init__( + self: NamedTemporaryFile[bytes], + mode: OpenBinaryMode = ..., + buffering: int = ..., + encoding: str | None = ..., + newline: str | None = ..., + suffix: str | None = ..., + prefix: str | None = ..., + dir: str | None = ..., + delete: bool = ..., + *, + errors: str | None = ..., + delete_on_close: bool = ..., + ): ... + @overload + def __init__( + self: NamedTemporaryFile[str], + mode: OpenTextMode, + buffering: int = ..., + encoding: str | None = ..., + newline: str | None = ..., + suffix: str | None = ..., + prefix: str | None = ..., + dir: str | None = ..., + delete: bool = ..., + *, + errors: str | None = ..., + delete_on_close: bool = ..., + ): ... + + def __init__( + self, + mode: OpenBinaryMode | OpenTextMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + delete: bool = True, + *, + errors: str | None = None, + delete_on_close: bool = True, + ) -> None: + self._params: dict[str, Any] = { + "mode": mode, + "buffering": buffering, + "encoding": encoding, + "newline": newline, + "suffix": suffix, + "prefix": prefix, + "dir": dir, + "delete": delete, + "errors": errors, + } + if sys.version_info >= (3, 12): + self._params["delete_on_close"] = delete_on_close + + async def __aenter__(self) -> AsyncFile[AnyStr]: + fp = await to_thread.run_sync( + lambda: tempfile.NamedTemporaryFile(**self._params) + ) + self._async_file = AsyncFile(fp) + return self._async_file + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + await self._async_file.aclose() + + +class SpooledTemporaryFile(AsyncFile[AnyStr]): + """ + An asynchronous spooled temporary file that starts in memory and is spooled to disk. + + This class provides an asynchronous interface to a spooled temporary file, much like + Python's standard :class:`~tempfile.SpooledTemporaryFile`. It supports asynchronous + write operations and provides a method to force a rollover to disk. + + :param max_size: Maximum size in bytes before the file is rolled over to disk. + :param mode: The mode in which the file is opened. Defaults to "w+b". + :param buffering: The buffering policy (-1 means the default buffering). + :param encoding: The encoding used to decode or encode the file (text mode only). + :param newline: Controls how universal newlines mode works (text mode only). + :param suffix: The suffix for the temporary file name. + :param prefix: The prefix for the temporary file name. + :param dir: The directory in which the temporary file is created. + :param errors: The error handling scheme used for encoding/decoding errors. + """ + + _rolled: bool = False + + @overload + def __init__( + self: SpooledTemporaryFile[bytes], + max_size: int = ..., + mode: OpenBinaryMode = ..., + buffering: int = ..., + encoding: str | None = ..., + newline: str | None = ..., + suffix: str | None = ..., + prefix: str | None = ..., + dir: str | None = ..., + *, + errors: str | None = ..., + ): ... + @overload + def __init__( + self: SpooledTemporaryFile[str], + max_size: int = ..., + mode: OpenTextMode = ..., + buffering: int = ..., + encoding: str | None = ..., + newline: str | None = ..., + suffix: str | None = ..., + prefix: str | None = ..., + dir: str | None = ..., + *, + errors: str | None = ..., + ): ... + + def __init__( + self, + max_size: int = 0, + mode: OpenBinaryMode | OpenTextMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + *, + errors: str | None = None, + ) -> None: + self._tempfile_params: dict[str, Any] = { + "mode": mode, + "buffering": buffering, + "encoding": encoding, + "newline": newline, + "suffix": suffix, + "prefix": prefix, + "dir": dir, + "errors": errors, + } + self._max_size = max_size + if "b" in mode: + super().__init__(BytesIO()) # type: ignore[arg-type] + else: + super().__init__( + TextIOWrapper( # type: ignore[arg-type] + BytesIO(), + encoding=encoding, + errors=errors, + newline=newline, + write_through=True, + ) + ) + + async def aclose(self) -> None: + if not self._rolled: + self._fp.close() + return + + await super().aclose() + + async def _check(self) -> None: + if self._rolled or self._fp.tell() <= self._max_size: + return + + await self.rollover() + + async def rollover(self) -> None: + if self._rolled: + return + + self._rolled = True + buffer = self._fp + buffer.seek(0) + self._fp = await to_thread.run_sync( + lambda: tempfile.TemporaryFile(**self._tempfile_params) + ) + await self.write(buffer.read()) + buffer.close() + + @property + def closed(self) -> bool: + return self._fp.closed + + async def read(self, size: int = -1) -> AnyStr: + if not self._rolled: + await checkpoint_if_cancelled() + return self._fp.read(size) + + return await super().read(size) # type: ignore[return-value] + + async def read1(self: SpooledTemporaryFile[bytes], size: int = -1) -> bytes: + if not self._rolled: + await checkpoint_if_cancelled() + return self._fp.read1(size) + + return await super().read1(size) + + async def readline(self) -> AnyStr: + if not self._rolled: + await checkpoint_if_cancelled() + return self._fp.readline() + + return await super().readline() # type: ignore[return-value] + + async def readlines(self) -> list[AnyStr]: + if not self._rolled: + await checkpoint_if_cancelled() + return self._fp.readlines() + + return await super().readlines() # type: ignore[return-value] + + async def readinto(self: SpooledTemporaryFile[bytes], b: WriteableBuffer) -> int: + if not self._rolled: + await checkpoint_if_cancelled() + self._fp.readinto(b) + + return await super().readinto(b) + + async def readinto1(self: SpooledTemporaryFile[bytes], b: WriteableBuffer) -> int: + if not self._rolled: + await checkpoint_if_cancelled() + self._fp.readinto(b) + + return await super().readinto1(b) + + async def seek(self, offset: int, whence: int | None = os.SEEK_SET) -> int: + if not self._rolled: + await checkpoint_if_cancelled() + return self._fp.seek(offset, whence) + + return await super().seek(offset, whence) + + async def tell(self) -> int: + if not self._rolled: + await checkpoint_if_cancelled() + return self._fp.tell() + + return await super().tell() + + async def truncate(self, size: int | None = None) -> int: + if not self._rolled: + await checkpoint_if_cancelled() + return self._fp.truncate(size) + + return await super().truncate(size) + + @overload + async def write(self: SpooledTemporaryFile[bytes], b: ReadableBuffer) -> int: ... + @overload + async def write(self: SpooledTemporaryFile[str], b: str) -> int: ... + + async def write(self, b: ReadableBuffer | str) -> int: + """ + Asynchronously write data to the spooled temporary file. + + If the file has not yet been rolled over, the data is written synchronously, + and a rollover is triggered if the size exceeds the maximum size. + + :param s: The data to write. + :return: The number of bytes written. + :raises RuntimeError: If the underlying file is not initialized. + + """ + if not self._rolled: + await checkpoint_if_cancelled() + result = self._fp.write(b) + await self._check() + return result + + return await super().write(b) # type: ignore[misc] + + @overload + async def writelines( + self: SpooledTemporaryFile[bytes], lines: Iterable[ReadableBuffer] + ) -> None: ... + @overload + async def writelines( + self: SpooledTemporaryFile[str], lines: Iterable[str] + ) -> None: ... + + async def writelines(self, lines: Iterable[str] | Iterable[ReadableBuffer]) -> None: + """ + Asynchronously write a list of lines to the spooled temporary file. + + If the file has not yet been rolled over, the lines are written synchronously, + and a rollover is triggered if the size exceeds the maximum size. + + :param lines: An iterable of lines to write. + :raises RuntimeError: If the underlying file is not initialized. + + """ + if not self._rolled: + await checkpoint_if_cancelled() + result = self._fp.writelines(lines) + await self._check() + return result + + return await super().writelines(lines) # type: ignore[misc] + + +class TemporaryDirectory(Generic[AnyStr]): + """ + An asynchronous temporary directory that is created and cleaned up automatically. + + This class provides an asynchronous context manager for creating a temporary + directory. It wraps Python's standard :class:`~tempfile.TemporaryDirectory` to + perform directory creation and cleanup operations in a background thread. + + :param suffix: Suffix to be added to the temporary directory name. + :param prefix: Prefix to be added to the temporary directory name. + :param dir: The parent directory where the temporary directory is created. + :param ignore_cleanup_errors: Whether to ignore errors during cleanup + (Python 3.10+). + :param delete: Whether to delete the directory upon closing (Python 3.12+). + """ + + def __init__( + self, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: AnyStr | None = None, + *, + ignore_cleanup_errors: bool = False, + delete: bool = True, + ) -> None: + self.suffix: AnyStr | None = suffix + self.prefix: AnyStr | None = prefix + self.dir: AnyStr | None = dir + self.ignore_cleanup_errors = ignore_cleanup_errors + self.delete = delete + + self._tempdir: tempfile.TemporaryDirectory | None = None + + async def __aenter__(self) -> str: + params: dict[str, Any] = { + "suffix": self.suffix, + "prefix": self.prefix, + "dir": self.dir, + } + if sys.version_info >= (3, 10): + params["ignore_cleanup_errors"] = self.ignore_cleanup_errors + + if sys.version_info >= (3, 12): + params["delete"] = self.delete + + self._tempdir = await to_thread.run_sync( + lambda: tempfile.TemporaryDirectory(**params) + ) + return await to_thread.run_sync(self._tempdir.__enter__) + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + if self._tempdir is not None: + await to_thread.run_sync( + self._tempdir.__exit__, exc_type, exc_value, traceback + ) + + async def cleanup(self) -> None: + if self._tempdir is not None: + await to_thread.run_sync(self._tempdir.cleanup) + + +@overload +async def mkstemp( + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + text: bool = False, +) -> tuple[int, str]: ... + + +@overload +async def mkstemp( + suffix: bytes | None = None, + prefix: bytes | None = None, + dir: bytes | None = None, + text: bool = False, +) -> tuple[int, bytes]: ... + + +async def mkstemp( + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: AnyStr | None = None, + text: bool = False, +) -> tuple[int, str | bytes]: + """ + Asynchronously create a temporary file and return an OS-level handle and the file + name. + + This function wraps `tempfile.mkstemp` and executes it in a background thread. + + :param suffix: Suffix to be added to the file name. + :param prefix: Prefix to be added to the file name. + :param dir: Directory in which the temporary file is created. + :param text: Whether the file is opened in text mode. + :return: A tuple containing the file descriptor and the file name. + + """ + return await to_thread.run_sync(tempfile.mkstemp, suffix, prefix, dir, text) + + +@overload +async def mkdtemp( + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, +) -> str: ... + + +@overload +async def mkdtemp( + suffix: bytes | None = None, + prefix: bytes | None = None, + dir: bytes | None = None, +) -> bytes: ... + + +async def mkdtemp( + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: AnyStr | None = None, +) -> str | bytes: + """ + Asynchronously create a temporary directory and return its path. + + This function wraps `tempfile.mkdtemp` and executes it in a background thread. + + :param suffix: Suffix to be added to the directory name. + :param prefix: Prefix to be added to the directory name. + :param dir: Parent directory where the temporary directory is created. + :return: The path of the created temporary directory. + + """ + return await to_thread.run_sync(tempfile.mkdtemp, suffix, prefix, dir) + + +async def gettempdir() -> str: + """ + Asynchronously return the name of the directory used for temporary files. + + This function wraps `tempfile.gettempdir` and executes it in a background thread. + + :return: The path of the temporary directory as a string. + + """ + return await to_thread.run_sync(tempfile.gettempdir) + + +async def gettempdirb() -> bytes: + """ + Asynchronously return the name of the directory used for temporary files in bytes. + + This function wraps `tempfile.gettempdirb` and executes it in a background thread. + + :return: The path of the temporary directory as bytes. + + """ + return await to_thread.run_sync(tempfile.gettempdirb) diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_testing.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_testing.py new file mode 100644 index 0000000000000000000000000000000000000000..9e28b22766d8a4bd0af8949445f3f1aa2f684c6a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_testing.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Awaitable, Generator +from typing import Any, cast + +from ._eventloop import get_async_backend + + +class TaskInfo: + """ + Represents an asynchronous task. + + :ivar int id: the unique identifier of the task + :ivar parent_id: the identifier of the parent task, if any + :vartype parent_id: Optional[int] + :ivar str name: the description of the task (if any) + :ivar ~collections.abc.Coroutine coro: the coroutine object of the task + """ + + __slots__ = "_name", "id", "parent_id", "name", "coro" + + def __init__( + self, + id: int, + parent_id: int | None, + name: str | None, + coro: Generator[Any, Any, Any] | Awaitable[Any], + ): + func = get_current_task + self._name = f"{func.__module__}.{func.__qualname__}" + self.id: int = id + self.parent_id: int | None = parent_id + self.name: str | None = name + self.coro: Generator[Any, Any, Any] | Awaitable[Any] = coro + + def __eq__(self, other: object) -> bool: + if isinstance(other, TaskInfo): + return self.id == other.id + + return NotImplemented + + def __hash__(self) -> int: + return hash(self.id) + + def __repr__(self) -> str: + return f"{self.__class__.__name__}(id={self.id!r}, name={self.name!r})" + + def has_pending_cancellation(self) -> bool: + """ + Return ``True`` if the task has a cancellation pending, ``False`` otherwise. + + """ + return False + + +def get_current_task() -> TaskInfo: + """ + Return the current task. + + :return: a representation of the current task + + """ + return get_async_backend().get_current_task() + + +def get_running_tasks() -> list[TaskInfo]: + """ + Return a list of running tasks in the current event loop. + + :return: a list of task info objects + + """ + return cast("list[TaskInfo]", get_async_backend().get_running_tasks()) + + +async def wait_all_tasks_blocked() -> None: + """Wait until all other tasks are waiting for something.""" + await get_async_backend().wait_all_tasks_blocked() diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_typedattr.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_typedattr.py new file mode 100644 index 0000000000000000000000000000000000000000..f358a448cb12739fd4eda4f4859d3a24ddd1de63 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/_core/_typedattr.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Callable, Mapping +from typing import Any, TypeVar, final, overload + +from ._exceptions import TypedAttributeLookupError + +T_Attr = TypeVar("T_Attr") +T_Default = TypeVar("T_Default") +undefined = object() + + +def typed_attribute() -> Any: + """Return a unique object, used to mark typed attributes.""" + return object() + + +class TypedAttributeSet: + """ + Superclass for typed attribute collections. + + Checks that every public attribute of every subclass has a type annotation. + """ + + def __init_subclass__(cls) -> None: + annotations: dict[str, Any] = getattr(cls, "__annotations__", {}) + for attrname in dir(cls): + if not attrname.startswith("_") and attrname not in annotations: + raise TypeError( + f"Attribute {attrname!r} is missing its type annotation" + ) + + super().__init_subclass__() + + +class TypedAttributeProvider: + """Base class for classes that wish to provide typed extra attributes.""" + + @property + def extra_attributes(self) -> Mapping[T_Attr, Callable[[], T_Attr]]: + """ + A mapping of the extra attributes to callables that return the corresponding + values. + + If the provider wraps another provider, the attributes from that wrapper should + also be included in the returned mapping (but the wrapper may override the + callables from the wrapped instance). + + """ + return {} + + @overload + def extra(self, attribute: T_Attr) -> T_Attr: ... + + @overload + def extra(self, attribute: T_Attr, default: T_Default) -> T_Attr | T_Default: ... + + @final + def extra(self, attribute: Any, default: object = undefined) -> object: + """ + extra(attribute, default=undefined) + + Return the value of the given typed extra attribute. + + :param attribute: the attribute (member of a :class:`~TypedAttributeSet`) to + look for + :param default: the value that should be returned if no value is found for the + attribute + :raises ~anyio.TypedAttributeLookupError: if the search failed and no default + value was given + + """ + try: + getter = self.extra_attributes[attribute] + except KeyError: + if default is undefined: + raise TypedAttributeLookupError("Attribute not found") from None + else: + return default + + return getter() diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d560ce3f1fa45a7ee4a3bc8958aa59702caa9d0c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__init__.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from ._eventloop import AsyncBackend as AsyncBackend +from ._resources import AsyncResource as AsyncResource +from ._sockets import ConnectedUDPSocket as ConnectedUDPSocket +from ._sockets import ConnectedUNIXDatagramSocket as ConnectedUNIXDatagramSocket +from ._sockets import IPAddressType as IPAddressType +from ._sockets import IPSockAddrType as IPSockAddrType +from ._sockets import SocketAttribute as SocketAttribute +from ._sockets import SocketListener as SocketListener +from ._sockets import SocketStream as SocketStream +from ._sockets import UDPPacketType as UDPPacketType +from ._sockets import UDPSocket as UDPSocket +from ._sockets import UNIXDatagramPacketType as UNIXDatagramPacketType +from ._sockets import UNIXDatagramSocket as UNIXDatagramSocket +from ._sockets import UNIXSocketStream as UNIXSocketStream +from ._streams import AnyByteReceiveStream as AnyByteReceiveStream +from ._streams import AnyByteSendStream as AnyByteSendStream +from ._streams import AnyByteStream as AnyByteStream +from ._streams import AnyByteStreamConnectable as AnyByteStreamConnectable +from ._streams import AnyUnreliableByteReceiveStream as AnyUnreliableByteReceiveStream +from ._streams import AnyUnreliableByteSendStream as AnyUnreliableByteSendStream +from ._streams import AnyUnreliableByteStream as AnyUnreliableByteStream +from ._streams import ByteReceiveStream as ByteReceiveStream +from ._streams import ByteSendStream as ByteSendStream +from ._streams import ByteStream as ByteStream +from ._streams import ByteStreamConnectable as ByteStreamConnectable +from ._streams import Listener as Listener +from ._streams import ObjectReceiveStream as ObjectReceiveStream +from ._streams import ObjectSendStream as ObjectSendStream +from ._streams import ObjectStream as ObjectStream +from ._streams import ObjectStreamConnectable as ObjectStreamConnectable +from ._streams import UnreliableObjectReceiveStream as UnreliableObjectReceiveStream +from ._streams import UnreliableObjectSendStream as UnreliableObjectSendStream +from ._streams import UnreliableObjectStream as UnreliableObjectStream +from ._subprocesses import Process as Process +from ._tasks import TaskGroup as TaskGroup +from ._tasks import TaskStatus as TaskStatus +from ._testing import TestRunner as TestRunner + +# Re-exported here, for backwards compatibility +# isort: off +from .._core._synchronization import ( + CapacityLimiter as CapacityLimiter, + Condition as Condition, + Event as Event, + Lock as Lock, + Semaphore as Semaphore, +) +from .._core._tasks import CancelScope as CancelScope +from ..from_thread import BlockingPortal as BlockingPortal + +# Re-export imports so they look like they live directly in this package +for __value in list(locals().values()): + if getattr(__value, "__module__", "").startswith("anyio.abc."): + __value.__module__ = __name__ + +del __value diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ad47f5c850fd743c764b8f753fb0922dfb2b95f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_eventloop.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_eventloop.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8fc0c0251b2cf42d3c971a84d95cbb3c12f51ede Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_eventloop.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_resources.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_resources.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2464422ae09337321fafe105a5e09a19cdc425b8 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_resources.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_sockets.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_sockets.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81be62dd8653ba7575410ccf4ecf9ce763ad6b2d Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_sockets.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_streams.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_streams.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7325e21f09dbee18fa8ebe80624a1a74e5e7fb18 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_streams.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_subprocesses.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_subprocesses.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0fcb7f1e1b6ba56fdf600b1e38af655c5025dac Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_subprocesses.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_tasks.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_tasks.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9de020f2347e26d09a51deb0332b6f3bb719be9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_tasks.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_testing.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_testing.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..890bf4a604785899fbc43f862af9c3e283188518 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/__pycache__/_testing.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_eventloop.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_eventloop.py new file mode 100644 index 0000000000000000000000000000000000000000..5bd9e08855e359542fe001b1165a0caf47a126dd --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_eventloop.py @@ -0,0 +1,418 @@ +from __future__ import annotations + +import math +import sys +from abc import ABCMeta, abstractmethod +from collections.abc import AsyncIterator, Awaitable, Callable, Sequence +from contextlib import AbstractContextManager +from os import PathLike +from signal import Signals +from socket import AddressFamily, SocketKind, socket +from typing import ( + IO, + TYPE_CHECKING, + Any, + TypeVar, + Union, + overload, +) + +if sys.version_info >= (3, 11): + from typing import TypeVarTuple, Unpack +else: + from typing_extensions import TypeVarTuple, Unpack + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: + from typing_extensions import TypeAlias + +if TYPE_CHECKING: + from _typeshed import FileDescriptorLike + + from .._core._synchronization import CapacityLimiter, Event, Lock, Semaphore + from .._core._tasks import CancelScope + from .._core._testing import TaskInfo + from ..from_thread import BlockingPortal + from ._sockets import ( + ConnectedUDPSocket, + ConnectedUNIXDatagramSocket, + IPSockAddrType, + SocketListener, + SocketStream, + UDPSocket, + UNIXDatagramSocket, + UNIXSocketStream, + ) + from ._subprocesses import Process + from ._tasks import TaskGroup + from ._testing import TestRunner + +T_Retval = TypeVar("T_Retval") +PosArgsT = TypeVarTuple("PosArgsT") +StrOrBytesPath: TypeAlias = Union[str, bytes, "PathLike[str]", "PathLike[bytes]"] + + +class AsyncBackend(metaclass=ABCMeta): + @classmethod + @abstractmethod + def run( + cls, + func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], + args: tuple[Unpack[PosArgsT]], + kwargs: dict[str, Any], + options: dict[str, Any], + ) -> T_Retval: + """ + Run the given coroutine function in an asynchronous event loop. + + The current thread must not be already running an event loop. + + :param func: a coroutine function + :param args: positional arguments to ``func`` + :param kwargs: positional arguments to ``func`` + :param options: keyword arguments to call the backend ``run()`` implementation + with + :return: the return value of the coroutine function + """ + + @classmethod + @abstractmethod + def current_token(cls) -> object: + """ + + :return: + """ + + @classmethod + @abstractmethod + def current_time(cls) -> float: + """ + Return the current value of the event loop's internal clock. + + :return: the clock value (seconds) + """ + + @classmethod + @abstractmethod + def cancelled_exception_class(cls) -> type[BaseException]: + """Return the exception class that is raised in a task if it's cancelled.""" + + @classmethod + @abstractmethod + async def checkpoint(cls) -> None: + """ + Check if the task has been cancelled, and allow rescheduling of other tasks. + + This is effectively the same as running :meth:`checkpoint_if_cancelled` and then + :meth:`cancel_shielded_checkpoint`. + """ + + @classmethod + async def checkpoint_if_cancelled(cls) -> None: + """ + Check if the current task group has been cancelled. + + This will check if the task has been cancelled, but will not allow other tasks + to be scheduled if not. + + """ + if cls.current_effective_deadline() == -math.inf: + await cls.checkpoint() + + @classmethod + async def cancel_shielded_checkpoint(cls) -> None: + """ + Allow the rescheduling of other tasks. + + This will give other tasks the opportunity to run, but without checking if the + current task group has been cancelled, unlike with :meth:`checkpoint`. + + """ + with cls.create_cancel_scope(shield=True): + await cls.sleep(0) + + @classmethod + @abstractmethod + async def sleep(cls, delay: float) -> None: + """ + Pause the current task for the specified duration. + + :param delay: the duration, in seconds + """ + + @classmethod + @abstractmethod + def create_cancel_scope( + cls, *, deadline: float = math.inf, shield: bool = False + ) -> CancelScope: + pass + + @classmethod + @abstractmethod + def current_effective_deadline(cls) -> float: + """ + Return the nearest deadline among all the cancel scopes effective for the + current task. + + :return: + - a clock value from the event loop's internal clock + - ``inf`` if there is no deadline in effect + - ``-inf`` if the current scope has been cancelled + :rtype: float + """ + + @classmethod + @abstractmethod + def create_task_group(cls) -> TaskGroup: + pass + + @classmethod + @abstractmethod + def create_event(cls) -> Event: + pass + + @classmethod + @abstractmethod + def create_lock(cls, *, fast_acquire: bool) -> Lock: + pass + + @classmethod + @abstractmethod + def create_semaphore( + cls, + initial_value: int, + *, + max_value: int | None = None, + fast_acquire: bool = False, + ) -> Semaphore: + pass + + @classmethod + @abstractmethod + def create_capacity_limiter(cls, total_tokens: float) -> CapacityLimiter: + pass + + @classmethod + @abstractmethod + async def run_sync_in_worker_thread( + cls, + func: Callable[[Unpack[PosArgsT]], T_Retval], + args: tuple[Unpack[PosArgsT]], + abandon_on_cancel: bool = False, + limiter: CapacityLimiter | None = None, + ) -> T_Retval: + pass + + @classmethod + @abstractmethod + def check_cancelled(cls) -> None: + pass + + @classmethod + @abstractmethod + def run_async_from_thread( + cls, + func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]], + args: tuple[Unpack[PosArgsT]], + token: object, + ) -> T_Retval: + pass + + @classmethod + @abstractmethod + def run_sync_from_thread( + cls, + func: Callable[[Unpack[PosArgsT]], T_Retval], + args: tuple[Unpack[PosArgsT]], + token: object, + ) -> T_Retval: + pass + + @classmethod + @abstractmethod + def create_blocking_portal(cls) -> BlockingPortal: + pass + + @classmethod + @abstractmethod + async def open_process( + cls, + command: StrOrBytesPath | Sequence[StrOrBytesPath], + *, + stdin: int | IO[Any] | None, + stdout: int | IO[Any] | None, + stderr: int | IO[Any] | None, + **kwargs: Any, + ) -> Process: + pass + + @classmethod + @abstractmethod + def setup_process_pool_exit_at_shutdown(cls, workers: set[Process]) -> None: + pass + + @classmethod + @abstractmethod + async def connect_tcp( + cls, host: str, port: int, local_address: IPSockAddrType | None = None + ) -> SocketStream: + pass + + @classmethod + @abstractmethod + async def connect_unix(cls, path: str | bytes) -> UNIXSocketStream: + pass + + @classmethod + @abstractmethod + def create_tcp_listener(cls, sock: socket) -> SocketListener: + pass + + @classmethod + @abstractmethod + def create_unix_listener(cls, sock: socket) -> SocketListener: + pass + + @classmethod + @abstractmethod + async def create_udp_socket( + cls, + family: AddressFamily, + local_address: IPSockAddrType | None, + remote_address: IPSockAddrType | None, + reuse_port: bool, + ) -> UDPSocket | ConnectedUDPSocket: + pass + + @classmethod + @overload + async def create_unix_datagram_socket( + cls, raw_socket: socket, remote_path: None + ) -> UNIXDatagramSocket: ... + + @classmethod + @overload + async def create_unix_datagram_socket( + cls, raw_socket: socket, remote_path: str | bytes + ) -> ConnectedUNIXDatagramSocket: ... + + @classmethod + @abstractmethod + async def create_unix_datagram_socket( + cls, raw_socket: socket, remote_path: str | bytes | None + ) -> UNIXDatagramSocket | ConnectedUNIXDatagramSocket: + pass + + @classmethod + @abstractmethod + async def getaddrinfo( + cls, + host: bytes | str | None, + port: str | int | None, + *, + family: int | AddressFamily = 0, + type: int | SocketKind = 0, + proto: int = 0, + flags: int = 0, + ) -> Sequence[ + tuple[ + AddressFamily, + SocketKind, + int, + str, + tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes], + ] + ]: + pass + + @classmethod + @abstractmethod + async def getnameinfo( + cls, sockaddr: IPSockAddrType, flags: int = 0 + ) -> tuple[str, str]: + pass + + @classmethod + @abstractmethod + async def wait_readable(cls, obj: FileDescriptorLike) -> None: + pass + + @classmethod + @abstractmethod + async def wait_writable(cls, obj: FileDescriptorLike) -> None: + pass + + @classmethod + @abstractmethod + def notify_closing(cls, obj: FileDescriptorLike) -> None: + pass + + @classmethod + @abstractmethod + async def wrap_listener_socket(cls, sock: socket) -> SocketListener: + pass + + @classmethod + @abstractmethod + async def wrap_stream_socket(cls, sock: socket) -> SocketStream: + pass + + @classmethod + @abstractmethod + async def wrap_unix_stream_socket(cls, sock: socket) -> UNIXSocketStream: + pass + + @classmethod + @abstractmethod + async def wrap_udp_socket(cls, sock: socket) -> UDPSocket: + pass + + @classmethod + @abstractmethod + async def wrap_connected_udp_socket(cls, sock: socket) -> ConnectedUDPSocket: + pass + + @classmethod + @abstractmethod + async def wrap_unix_datagram_socket(cls, sock: socket) -> UNIXDatagramSocket: + pass + + @classmethod + @abstractmethod + async def wrap_connected_unix_datagram_socket( + cls, sock: socket + ) -> ConnectedUNIXDatagramSocket: + pass + + @classmethod + @abstractmethod + def current_default_thread_limiter(cls) -> CapacityLimiter: + pass + + @classmethod + @abstractmethod + def open_signal_receiver( + cls, *signals: Signals + ) -> AbstractContextManager[AsyncIterator[Signals]]: + pass + + @classmethod + @abstractmethod + def get_current_task(cls) -> TaskInfo: + pass + + @classmethod + @abstractmethod + def get_running_tasks(cls) -> Sequence[TaskInfo]: + pass + + @classmethod + @abstractmethod + async def wait_all_tasks_blocked(cls) -> None: + pass + + @classmethod + @abstractmethod + def create_test_runner(cls, options: dict[str, Any]) -> TestRunner: + pass diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_resources.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_resources.py new file mode 100644 index 0000000000000000000000000000000000000000..10df115a7b9f975493476da763cc1e26dbd822e5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_resources.py @@ -0,0 +1,33 @@ +from __future__ import annotations + +from abc import ABCMeta, abstractmethod +from types import TracebackType +from typing import TypeVar + +T = TypeVar("T") + + +class AsyncResource(metaclass=ABCMeta): + """ + Abstract base class for all closeable asynchronous resources. + + Works as an asynchronous context manager which returns the instance itself on enter, + and calls :meth:`aclose` on exit. + """ + + __slots__ = () + + async def __aenter__(self: T) -> T: + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + await self.aclose() + + @abstractmethod + async def aclose(self) -> None: + """Close the resource.""" diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_sockets.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_sockets.py new file mode 100644 index 0000000000000000000000000000000000000000..3ff60d4d9dfc3c15d416c9fc4a6b3b7f79a9fdb1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_sockets.py @@ -0,0 +1,405 @@ +from __future__ import annotations + +import errno +import socket +import sys +from abc import abstractmethod +from collections.abc import Callable, Collection, Mapping +from contextlib import AsyncExitStack +from io import IOBase +from ipaddress import IPv4Address, IPv6Address +from socket import AddressFamily +from typing import Any, TypeVar, Union + +from .._core._eventloop import get_async_backend +from .._core._typedattr import ( + TypedAttributeProvider, + TypedAttributeSet, + typed_attribute, +) +from ._streams import ByteStream, Listener, UnreliableObjectStream +from ._tasks import TaskGroup + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: + from typing_extensions import TypeAlias + +IPAddressType: TypeAlias = Union[str, IPv4Address, IPv6Address] +IPSockAddrType: TypeAlias = tuple[str, int] +SockAddrType: TypeAlias = Union[IPSockAddrType, str] +UDPPacketType: TypeAlias = tuple[bytes, IPSockAddrType] +UNIXDatagramPacketType: TypeAlias = tuple[bytes, str] +T_Retval = TypeVar("T_Retval") + + +def _validate_socket( + sock_or_fd: socket.socket | int, + sock_type: socket.SocketKind, + addr_family: socket.AddressFamily = socket.AF_UNSPEC, + *, + require_connected: bool = False, + require_bound: bool = False, +) -> socket.socket: + if isinstance(sock_or_fd, int): + try: + sock = socket.socket(fileno=sock_or_fd) + except OSError as exc: + if exc.errno == errno.ENOTSOCK: + raise ValueError( + "the file descriptor does not refer to a socket" + ) from exc + elif require_connected: + raise ValueError("the socket must be connected") from exc + elif require_bound: + raise ValueError("the socket must be bound to a local address") from exc + else: + raise + elif isinstance(sock_or_fd, socket.socket): + sock = sock_or_fd + else: + raise TypeError( + f"expected an int or socket, got {type(sock_or_fd).__qualname__} instead" + ) + + try: + if require_connected: + try: + sock.getpeername() + except OSError as exc: + raise ValueError("the socket must be connected") from exc + + if require_bound: + try: + if sock.family in (socket.AF_INET, socket.AF_INET6): + bound_addr = sock.getsockname()[1] + else: + bound_addr = sock.getsockname() + except OSError: + bound_addr = None + + if not bound_addr: + raise ValueError("the socket must be bound to a local address") + + if addr_family != socket.AF_UNSPEC and sock.family != addr_family: + raise ValueError( + f"address family mismatch: expected {addr_family.name}, got " + f"{sock.family.name}" + ) + + if sock.type != sock_type: + raise ValueError( + f"socket type mismatch: expected {sock_type.name}, got {sock.type.name}" + ) + except BaseException: + # Avoid ResourceWarning from the locally constructed socket object + if isinstance(sock_or_fd, int): + sock.detach() + + raise + + sock.setblocking(False) + return sock + + +class SocketAttribute(TypedAttributeSet): + """ + .. attribute:: family + :type: socket.AddressFamily + + the address family of the underlying socket + + .. attribute:: local_address + :type: tuple[str, int] | str + + the local address the underlying socket is connected to + + .. attribute:: local_port + :type: int + + for IP based sockets, the local port the underlying socket is bound to + + .. attribute:: raw_socket + :type: socket.socket + + the underlying stdlib socket object + + .. attribute:: remote_address + :type: tuple[str, int] | str + + the remote address the underlying socket is connected to + + .. attribute:: remote_port + :type: int + + for IP based sockets, the remote port the underlying socket is connected to + """ + + family: AddressFamily = typed_attribute() + local_address: SockAddrType = typed_attribute() + local_port: int = typed_attribute() + raw_socket: socket.socket = typed_attribute() + remote_address: SockAddrType = typed_attribute() + remote_port: int = typed_attribute() + + +class _SocketProvider(TypedAttributeProvider): + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + from .._core._sockets import convert_ipv6_sockaddr as convert + + attributes: dict[Any, Callable[[], Any]] = { + SocketAttribute.family: lambda: self._raw_socket.family, + SocketAttribute.local_address: lambda: convert( + self._raw_socket.getsockname() + ), + SocketAttribute.raw_socket: lambda: self._raw_socket, + } + try: + peername: tuple[str, int] | None = convert(self._raw_socket.getpeername()) + except OSError: + peername = None + + # Provide the remote address for connected sockets + if peername is not None: + attributes[SocketAttribute.remote_address] = lambda: peername + + # Provide local and remote ports for IP based sockets + if self._raw_socket.family in (AddressFamily.AF_INET, AddressFamily.AF_INET6): + attributes[SocketAttribute.local_port] = ( + lambda: self._raw_socket.getsockname()[1] + ) + if peername is not None: + remote_port = peername[1] + attributes[SocketAttribute.remote_port] = lambda: remote_port + + return attributes + + @property + @abstractmethod + def _raw_socket(self) -> socket.socket: + pass + + +class SocketStream(ByteStream, _SocketProvider): + """ + Transports bytes over a socket. + + Supports all relevant extra attributes from :class:`~SocketAttribute`. + """ + + @classmethod + async def from_socket(cls, sock_or_fd: socket.socket | int) -> SocketStream: + """ + Wrap an existing socket object or file descriptor as a socket stream. + + The newly created socket wrapper takes ownership of the socket being passed in. + The existing socket must already be connected. + + :param sock_or_fd: a socket object or file descriptor + :return: a socket stream + + """ + sock = _validate_socket(sock_or_fd, socket.SOCK_STREAM, require_connected=True) + return await get_async_backend().wrap_stream_socket(sock) + + +class UNIXSocketStream(SocketStream): + @classmethod + async def from_socket(cls, sock_or_fd: socket.socket | int) -> UNIXSocketStream: + """ + Wrap an existing socket object or file descriptor as a UNIX socket stream. + + The newly created socket wrapper takes ownership of the socket being passed in. + The existing socket must already be connected. + + :param sock_or_fd: a socket object or file descriptor + :return: a UNIX socket stream + + """ + sock = _validate_socket( + sock_or_fd, socket.SOCK_STREAM, socket.AF_UNIX, require_connected=True + ) + return await get_async_backend().wrap_unix_stream_socket(sock) + + @abstractmethod + async def send_fds(self, message: bytes, fds: Collection[int | IOBase]) -> None: + """ + Send file descriptors along with a message to the peer. + + :param message: a non-empty bytestring + :param fds: a collection of files (either numeric file descriptors or open file + or socket objects) + """ + + @abstractmethod + async def receive_fds(self, msglen: int, maxfds: int) -> tuple[bytes, list[int]]: + """ + Receive file descriptors along with a message from the peer. + + :param msglen: length of the message to expect from the peer + :param maxfds: maximum number of file descriptors to expect from the peer + :return: a tuple of (message, file descriptors) + """ + + +class SocketListener(Listener[SocketStream], _SocketProvider): + """ + Listens to incoming socket connections. + + Supports all relevant extra attributes from :class:`~SocketAttribute`. + """ + + @classmethod + async def from_socket( + cls, + sock_or_fd: socket.socket | int, + ) -> SocketListener: + """ + Wrap an existing socket object or file descriptor as a socket listener. + + The newly created listener takes ownership of the socket being passed in. + + :param sock_or_fd: a socket object or file descriptor + :return: a socket listener + + """ + sock = _validate_socket(sock_or_fd, socket.SOCK_STREAM, require_bound=True) + return await get_async_backend().wrap_listener_socket(sock) + + @abstractmethod + async def accept(self) -> SocketStream: + """Accept an incoming connection.""" + + async def serve( + self, + handler: Callable[[SocketStream], Any], + task_group: TaskGroup | None = None, + ) -> None: + from .. import create_task_group + + async with AsyncExitStack() as stack: + if task_group is None: + task_group = await stack.enter_async_context(create_task_group()) + + while True: + stream = await self.accept() + task_group.start_soon(handler, stream) + + +class UDPSocket(UnreliableObjectStream[UDPPacketType], _SocketProvider): + """ + Represents an unconnected UDP socket. + + Supports all relevant extra attributes from :class:`~SocketAttribute`. + """ + + @classmethod + async def from_socket(cls, sock_or_fd: socket.socket | int) -> UDPSocket: + """ + Wrap an existing socket object or file descriptor as a UDP socket. + + The newly created socket wrapper takes ownership of the socket being passed in. + The existing socket must be bound to a local address. + + :param sock_or_fd: a socket object or file descriptor + :return: a UDP socket + + """ + sock = _validate_socket(sock_or_fd, socket.SOCK_DGRAM, require_bound=True) + return await get_async_backend().wrap_udp_socket(sock) + + async def sendto(self, data: bytes, host: str, port: int) -> None: + """ + Alias for :meth:`~.UnreliableObjectSendStream.send` ((data, (host, port))). + + """ + return await self.send((data, (host, port))) + + +class ConnectedUDPSocket(UnreliableObjectStream[bytes], _SocketProvider): + """ + Represents an connected UDP socket. + + Supports all relevant extra attributes from :class:`~SocketAttribute`. + """ + + @classmethod + async def from_socket(cls, sock_or_fd: socket.socket | int) -> ConnectedUDPSocket: + """ + Wrap an existing socket object or file descriptor as a connected UDP socket. + + The newly created socket wrapper takes ownership of the socket being passed in. + The existing socket must already be connected. + + :param sock_or_fd: a socket object or file descriptor + :return: a connected UDP socket + + """ + sock = _validate_socket( + sock_or_fd, + socket.SOCK_DGRAM, + require_connected=True, + ) + return await get_async_backend().wrap_connected_udp_socket(sock) + + +class UNIXDatagramSocket( + UnreliableObjectStream[UNIXDatagramPacketType], _SocketProvider +): + """ + Represents an unconnected Unix datagram socket. + + Supports all relevant extra attributes from :class:`~SocketAttribute`. + """ + + @classmethod + async def from_socket( + cls, + sock_or_fd: socket.socket | int, + ) -> UNIXDatagramSocket: + """ + Wrap an existing socket object or file descriptor as a UNIX datagram + socket. + + The newly created socket wrapper takes ownership of the socket being passed in. + + :param sock_or_fd: a socket object or file descriptor + :return: a UNIX datagram socket + + """ + sock = _validate_socket(sock_or_fd, socket.SOCK_DGRAM, socket.AF_UNIX) + return await get_async_backend().wrap_unix_datagram_socket(sock) + + async def sendto(self, data: bytes, path: str) -> None: + """Alias for :meth:`~.UnreliableObjectSendStream.send` ((data, path)).""" + return await self.send((data, path)) + + +class ConnectedUNIXDatagramSocket(UnreliableObjectStream[bytes], _SocketProvider): + """ + Represents a connected Unix datagram socket. + + Supports all relevant extra attributes from :class:`~SocketAttribute`. + """ + + @classmethod + async def from_socket( + cls, + sock_or_fd: socket.socket | int, + ) -> ConnectedUNIXDatagramSocket: + """ + Wrap an existing socket object or file descriptor as a connected UNIX datagram + socket. + + The newly created socket wrapper takes ownership of the socket being passed in. + The existing socket must already be connected. + + :param sock_or_fd: a socket object or file descriptor + :return: a connected UNIX datagram socket + + """ + sock = _validate_socket( + sock_or_fd, socket.SOCK_DGRAM, socket.AF_UNIX, require_connected=True + ) + return await get_async_backend().wrap_connected_unix_datagram_socket(sock) diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_streams.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_streams.py new file mode 100644 index 0000000000000000000000000000000000000000..369df3f36cda74aa0d0893cd98bd4b29d3786faa --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_streams.py @@ -0,0 +1,239 @@ +from __future__ import annotations + +import sys +from abc import ABCMeta, abstractmethod +from collections.abc import Callable +from typing import Any, Generic, TypeVar, Union + +from .._core._exceptions import EndOfStream +from .._core._typedattr import TypedAttributeProvider +from ._resources import AsyncResource +from ._tasks import TaskGroup + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: + from typing_extensions import TypeAlias + +T_Item = TypeVar("T_Item") +T_co = TypeVar("T_co", covariant=True) +T_contra = TypeVar("T_contra", contravariant=True) + + +class UnreliableObjectReceiveStream( + Generic[T_co], AsyncResource, TypedAttributeProvider +): + """ + An interface for receiving objects. + + This interface makes no guarantees that the received messages arrive in the order in + which they were sent, or that no messages are missed. + + Asynchronously iterating over objects of this type will yield objects matching the + given type parameter. + """ + + def __aiter__(self) -> UnreliableObjectReceiveStream[T_co]: + return self + + async def __anext__(self) -> T_co: + try: + return await self.receive() + except EndOfStream: + raise StopAsyncIteration from None + + @abstractmethod + async def receive(self) -> T_co: + """ + Receive the next item. + + :raises ~anyio.ClosedResourceError: if the receive stream has been explicitly + closed + :raises ~anyio.EndOfStream: if this stream has been closed from the other end + :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable + due to external causes + """ + + +class UnreliableObjectSendStream( + Generic[T_contra], AsyncResource, TypedAttributeProvider +): + """ + An interface for sending objects. + + This interface makes no guarantees that the messages sent will reach the + recipient(s) in the same order in which they were sent, or at all. + """ + + @abstractmethod + async def send(self, item: T_contra) -> None: + """ + Send an item to the peer(s). + + :param item: the item to send + :raises ~anyio.ClosedResourceError: if the send stream has been explicitly + closed + :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable + due to external causes + """ + + +class UnreliableObjectStream( + UnreliableObjectReceiveStream[T_Item], UnreliableObjectSendStream[T_Item] +): + """ + A bidirectional message stream which does not guarantee the order or reliability of + message delivery. + """ + + +class ObjectReceiveStream(UnreliableObjectReceiveStream[T_co]): + """ + A receive message stream which guarantees that messages are received in the same + order in which they were sent, and that no messages are missed. + """ + + +class ObjectSendStream(UnreliableObjectSendStream[T_contra]): + """ + A send message stream which guarantees that messages are delivered in the same order + in which they were sent, without missing any messages in the middle. + """ + + +class ObjectStream( + ObjectReceiveStream[T_Item], + ObjectSendStream[T_Item], + UnreliableObjectStream[T_Item], +): + """ + A bidirectional message stream which guarantees the order and reliability of message + delivery. + """ + + @abstractmethod + async def send_eof(self) -> None: + """ + Send an end-of-file indication to the peer. + + You should not try to send any further data to this stream after calling this + method. This method is idempotent (does nothing on successive calls). + """ + + +class ByteReceiveStream(AsyncResource, TypedAttributeProvider): + """ + An interface for receiving bytes from a single peer. + + Iterating this byte stream will yield a byte string of arbitrary length, but no more + than 65536 bytes. + """ + + def __aiter__(self) -> ByteReceiveStream: + return self + + async def __anext__(self) -> bytes: + try: + return await self.receive() + except EndOfStream: + raise StopAsyncIteration from None + + @abstractmethod + async def receive(self, max_bytes: int = 65536) -> bytes: + """ + Receive at most ``max_bytes`` bytes from the peer. + + .. note:: Implementers of this interface should not return an empty + :class:`bytes` object, and users should ignore them. + + :param max_bytes: maximum number of bytes to receive + :return: the received bytes + :raises ~anyio.EndOfStream: if this stream has been closed from the other end + """ + + +class ByteSendStream(AsyncResource, TypedAttributeProvider): + """An interface for sending bytes to a single peer.""" + + @abstractmethod + async def send(self, item: bytes) -> None: + """ + Send the given bytes to the peer. + + :param item: the bytes to send + """ + + +class ByteStream(ByteReceiveStream, ByteSendStream): + """A bidirectional byte stream.""" + + @abstractmethod + async def send_eof(self) -> None: + """ + Send an end-of-file indication to the peer. + + You should not try to send any further data to this stream after calling this + method. This method is idempotent (does nothing on successive calls). + """ + + +#: Type alias for all unreliable bytes-oriented receive streams. +AnyUnreliableByteReceiveStream: TypeAlias = Union[ + UnreliableObjectReceiveStream[bytes], ByteReceiveStream +] +#: Type alias for all unreliable bytes-oriented send streams. +AnyUnreliableByteSendStream: TypeAlias = Union[ + UnreliableObjectSendStream[bytes], ByteSendStream +] +#: Type alias for all unreliable bytes-oriented streams. +AnyUnreliableByteStream: TypeAlias = Union[UnreliableObjectStream[bytes], ByteStream] +#: Type alias for all bytes-oriented receive streams. +AnyByteReceiveStream: TypeAlias = Union[ObjectReceiveStream[bytes], ByteReceiveStream] +#: Type alias for all bytes-oriented send streams. +AnyByteSendStream: TypeAlias = Union[ObjectSendStream[bytes], ByteSendStream] +#: Type alias for all bytes-oriented streams. +AnyByteStream: TypeAlias = Union[ObjectStream[bytes], ByteStream] + + +class Listener(Generic[T_co], AsyncResource, TypedAttributeProvider): + """An interface for objects that let you accept incoming connections.""" + + @abstractmethod + async def serve( + self, handler: Callable[[T_co], Any], task_group: TaskGroup | None = None + ) -> None: + """ + Accept incoming connections as they come in and start tasks to handle them. + + :param handler: a callable that will be used to handle each accepted connection + :param task_group: the task group that will be used to start tasks for handling + each accepted connection (if omitted, an ad-hoc task group will be created) + """ + + +class ObjectStreamConnectable(Generic[T_co], metaclass=ABCMeta): + @abstractmethod + async def connect(self) -> ObjectStream[T_co]: + """ + Connect to the remote endpoint. + + :return: an object stream connected to the remote end + :raises ConnectionFailed: if the connection fails + """ + + +class ByteStreamConnectable(metaclass=ABCMeta): + @abstractmethod + async def connect(self) -> ByteStream: + """ + Connect to the remote endpoint. + + :return: a bytestream connected to the remote end + :raises ConnectionFailed: if the connection fails + """ + + +#: Type alias for all connectables returning bytestreams or bytes-oriented object streams +AnyByteStreamConnectable: TypeAlias = Union[ + ObjectStreamConnectable[bytes], ByteStreamConnectable +] diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_subprocesses.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_subprocesses.py new file mode 100644 index 0000000000000000000000000000000000000000..ce0564ceac8aac425675b5c8f7f7205d08061fd3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_subprocesses.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from abc import abstractmethod +from signal import Signals + +from ._resources import AsyncResource +from ._streams import ByteReceiveStream, ByteSendStream + + +class Process(AsyncResource): + """An asynchronous version of :class:`subprocess.Popen`.""" + + @abstractmethod + async def wait(self) -> int: + """ + Wait until the process exits. + + :return: the exit code of the process + """ + + @abstractmethod + def terminate(self) -> None: + """ + Terminates the process, gracefully if possible. + + On Windows, this calls ``TerminateProcess()``. + On POSIX systems, this sends ``SIGTERM`` to the process. + + .. seealso:: :meth:`subprocess.Popen.terminate` + """ + + @abstractmethod + def kill(self) -> None: + """ + Kills the process. + + On Windows, this calls ``TerminateProcess()``. + On POSIX systems, this sends ``SIGKILL`` to the process. + + .. seealso:: :meth:`subprocess.Popen.kill` + """ + + @abstractmethod + def send_signal(self, signal: Signals) -> None: + """ + Send a signal to the subprocess. + + .. seealso:: :meth:`subprocess.Popen.send_signal` + + :param signal: the signal number (e.g. :data:`signal.SIGHUP`) + """ + + @property + @abstractmethod + def pid(self) -> int: + """The process ID of the process.""" + + @property + @abstractmethod + def returncode(self) -> int | None: + """ + The return code of the process. If the process has not yet terminated, this will + be ``None``. + """ + + @property + @abstractmethod + def stdin(self) -> ByteSendStream | None: + """The stream for the standard input of the process.""" + + @property + @abstractmethod + def stdout(self) -> ByteReceiveStream | None: + """The stream for the standard output of the process.""" + + @property + @abstractmethod + def stderr(self) -> ByteReceiveStream | None: + """The stream for the standard error output of the process.""" diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_tasks.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..b4ebff9edfeaabf26396fa944752407f6ddefd7e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_tasks.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +import sys +from abc import ABCMeta, abstractmethod +from collections.abc import Awaitable, Callable +from types import TracebackType +from typing import TYPE_CHECKING, Any, Protocol, TypeVar, overload + +if sys.version_info >= (3, 11): + from typing import TypeVarTuple, Unpack +else: + from typing_extensions import TypeVarTuple, Unpack + +if TYPE_CHECKING: + from .._core._tasks import CancelScope + +T_Retval = TypeVar("T_Retval") +T_contra = TypeVar("T_contra", contravariant=True) +PosArgsT = TypeVarTuple("PosArgsT") + + +class TaskStatus(Protocol[T_contra]): + @overload + def started(self: TaskStatus[None]) -> None: ... + + @overload + def started(self, value: T_contra) -> None: ... + + def started(self, value: T_contra | None = None) -> None: + """ + Signal that the task has started. + + :param value: object passed back to the starter of the task + """ + + +class TaskGroup(metaclass=ABCMeta): + """ + Groups several asynchronous tasks together. + + :ivar cancel_scope: the cancel scope inherited by all child tasks + :vartype cancel_scope: CancelScope + + .. note:: On asyncio, support for eager task factories is considered to be + **experimental**. In particular, they don't follow the usual semantics of new + tasks being scheduled on the next iteration of the event loop, and may thus + cause unexpected behavior in code that wasn't written with such semantics in + mind. + """ + + cancel_scope: CancelScope + + @abstractmethod + def start_soon( + self, + func: Callable[[Unpack[PosArgsT]], Awaitable[Any]], + *args: Unpack[PosArgsT], + name: object = None, + ) -> None: + """ + Start a new task in this task group. + + :param func: a coroutine function + :param args: positional arguments to call the function with + :param name: name of the task, for the purposes of introspection and debugging + + .. versionadded:: 3.0 + """ + + @abstractmethod + async def start( + self, + func: Callable[..., Awaitable[Any]], + *args: object, + name: object = None, + ) -> Any: + """ + Start a new task and wait until it signals for readiness. + + The target callable must accept a keyword argument ``task_status`` (of type + :class:`TaskStatus`). Awaiting on this method will return whatever was passed to + ``task_status.started()`` (``None`` by default). + + .. note:: The :class:`TaskStatus` class is generic, and the type argument should + indicate the type of the value that will be passed to + ``task_status.started()``. + + :param func: a coroutine function that accepts the ``task_status`` keyword + argument + :param args: positional arguments to call the function with + :param name: an optional name for the task, for introspection and debugging + :return: the value passed to ``task_status.started()`` + :raises RuntimeError: if the task finishes without calling + ``task_status.started()`` + + .. seealso:: :ref:`start_initialize` + + .. versionadded:: 3.0 + """ + + @abstractmethod + async def __aenter__(self) -> TaskGroup: + """Enter the task group context and allow starting new tasks.""" + + @abstractmethod + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> bool: + """Exit the task group context waiting for all tasks to finish.""" diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_testing.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_testing.py new file mode 100644 index 0000000000000000000000000000000000000000..7c50ed76dc4d8df41262973a0122295523e2a935 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/abc/_testing.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +import types +from abc import ABCMeta, abstractmethod +from collections.abc import AsyncGenerator, Callable, Coroutine, Iterable +from typing import Any, TypeVar + +_T = TypeVar("_T") + + +class TestRunner(metaclass=ABCMeta): + """ + Encapsulates a running event loop. Every call made through this object will use the + same event loop. + """ + + def __enter__(self) -> TestRunner: + return self + + @abstractmethod + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: types.TracebackType | None, + ) -> bool | None: ... + + @abstractmethod + def run_asyncgen_fixture( + self, + fixture_func: Callable[..., AsyncGenerator[_T, Any]], + kwargs: dict[str, Any], + ) -> Iterable[_T]: + """ + Run an async generator fixture. + + :param fixture_func: the fixture function + :param kwargs: keyword arguments to call the fixture function with + :return: an iterator yielding the value yielded from the async generator + """ + + @abstractmethod + def run_fixture( + self, + fixture_func: Callable[..., Coroutine[Any, Any, _T]], + kwargs: dict[str, Any], + ) -> _T: + """ + Run an async fixture. + + :param fixture_func: the fixture function + :param kwargs: keyword arguments to call the fixture function with + :return: the return value of the fixture function + """ + + @abstractmethod + def run_test( + self, test_func: Callable[..., Coroutine[Any, Any, Any]], kwargs: dict[str, Any] + ) -> None: + """ + Run an async test function. + + :param test_func: the test function + :param kwargs: keyword arguments to call the test function with + """ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ddb788e1af2b59d3edae9c88a6b763498e3b653 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/buffered.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/buffered.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b4e1445321466591beb0cc2b13664a47e344072 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/buffered.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/file.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/file.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..99afd4ae1e1271eab9c8d916ca0a487c54421698 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/file.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/memory.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/memory.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b53da71f0a9a9ef868ecdb3438dcd16a606f62fe Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/memory.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/stapled.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/stapled.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52b6c770d6fbcb38f9852c30ba23b364eb4efc01 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/stapled.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/text.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/text.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..484e1bb4335599abee258424699c2036786124e7 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/text.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/tls.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/tls.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..035a505f2016cb917009c0333e4c20ba0cdaa76b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/tls.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/buffered.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/buffered.py new file mode 100644 index 0000000000000000000000000000000000000000..ca40eae84822e805adf075cbc231f2f056ea9808 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/buffered.py @@ -0,0 +1,182 @@ +from __future__ import annotations + +import sys +from collections.abc import Callable, Iterable, Mapping +from dataclasses import dataclass, field +from typing import Any, SupportsIndex + +from .. import ClosedResourceError, DelimiterNotFound, EndOfStream, IncompleteRead +from ..abc import ( + AnyByteReceiveStream, + AnyByteStream, + AnyByteStreamConnectable, + ByteReceiveStream, + ByteStream, + ByteStreamConnectable, +) + +if sys.version_info >= (3, 12): + from typing import override +else: + from typing_extensions import override + + +@dataclass(eq=False) +class BufferedByteReceiveStream(ByteReceiveStream): + """ + Wraps any bytes-based receive stream and uses a buffer to provide sophisticated + receiving capabilities in the form of a byte stream. + """ + + receive_stream: AnyByteReceiveStream + _buffer: bytearray = field(init=False, default_factory=bytearray) + _closed: bool = field(init=False, default=False) + + async def aclose(self) -> None: + await self.receive_stream.aclose() + self._closed = True + + @property + def buffer(self) -> bytes: + """The bytes currently in the buffer.""" + return bytes(self._buffer) + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + return self.receive_stream.extra_attributes + + def feed_data(self, data: Iterable[SupportsIndex], /) -> None: + """ + Append data directly into the buffer. + + Any data in the buffer will be consumed by receive operations before receiving + anything from the wrapped stream. + + :param data: the data to append to the buffer (can be bytes or anything else + that supports ``__index__()``) + + """ + self._buffer.extend(data) + + async def receive(self, max_bytes: int = 65536) -> bytes: + if self._closed: + raise ClosedResourceError + + if self._buffer: + chunk = bytes(self._buffer[:max_bytes]) + del self._buffer[:max_bytes] + return chunk + elif isinstance(self.receive_stream, ByteReceiveStream): + return await self.receive_stream.receive(max_bytes) + else: + # With a bytes-oriented object stream, we need to handle any surplus bytes + # we get from the receive() call + chunk = await self.receive_stream.receive() + if len(chunk) > max_bytes: + # Save the surplus bytes in the buffer + self._buffer.extend(chunk[max_bytes:]) + return chunk[:max_bytes] + else: + return chunk + + async def receive_exactly(self, nbytes: int) -> bytes: + """ + Read exactly the given amount of bytes from the stream. + + :param nbytes: the number of bytes to read + :return: the bytes read + :raises ~anyio.IncompleteRead: if the stream was closed before the requested + amount of bytes could be read from the stream + + """ + while True: + remaining = nbytes - len(self._buffer) + if remaining <= 0: + retval = self._buffer[:nbytes] + del self._buffer[:nbytes] + return bytes(retval) + + try: + if isinstance(self.receive_stream, ByteReceiveStream): + chunk = await self.receive_stream.receive(remaining) + else: + chunk = await self.receive_stream.receive() + except EndOfStream as exc: + raise IncompleteRead from exc + + self._buffer.extend(chunk) + + async def receive_until(self, delimiter: bytes, max_bytes: int) -> bytes: + """ + Read from the stream until the delimiter is found or max_bytes have been read. + + :param delimiter: the marker to look for in the stream + :param max_bytes: maximum number of bytes that will be read before raising + :exc:`~anyio.DelimiterNotFound` + :return: the bytes read (not including the delimiter) + :raises ~anyio.IncompleteRead: if the stream was closed before the delimiter + was found + :raises ~anyio.DelimiterNotFound: if the delimiter is not found within the + bytes read up to the maximum allowed + + """ + delimiter_size = len(delimiter) + offset = 0 + while True: + # Check if the delimiter can be found in the current buffer + index = self._buffer.find(delimiter, offset) + if index >= 0: + found = self._buffer[:index] + del self._buffer[: index + len(delimiter) :] + return bytes(found) + + # Check if the buffer is already at or over the limit + if len(self._buffer) >= max_bytes: + raise DelimiterNotFound(max_bytes) + + # Read more data into the buffer from the socket + try: + data = await self.receive_stream.receive() + except EndOfStream as exc: + raise IncompleteRead from exc + + # Move the offset forward and add the new data to the buffer + offset = max(len(self._buffer) - delimiter_size + 1, 0) + self._buffer.extend(data) + + +class BufferedByteStream(BufferedByteReceiveStream, ByteStream): + """ + A full-duplex variant of :class:`BufferedByteReceiveStream`. All writes are passed + through to the wrapped stream as-is. + """ + + def __init__(self, stream: AnyByteStream): + """ + :param stream: the stream to be wrapped + + """ + super().__init__(stream) + self._stream = stream + + @override + async def send_eof(self) -> None: + await self._stream.send_eof() + + @override + async def send(self, item: bytes) -> None: + await self._stream.send(item) + + +class BufferedConnectable(ByteStreamConnectable): + def __init__(self, connectable: AnyByteStreamConnectable): + """ + :param connectable: the connectable to wrap + + """ + self.connectable = connectable + + @override + async def connect(self) -> BufferedByteStream: + stream = await self.connectable.connect() + return BufferedByteStream(stream) diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/file.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/file.py new file mode 100644 index 0000000000000000000000000000000000000000..f492464267ac54b57ee9953a4aad128f06a2110a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/file.py @@ -0,0 +1,148 @@ +from __future__ import annotations + +from collections.abc import Callable, Mapping +from io import SEEK_SET, UnsupportedOperation +from os import PathLike +from pathlib import Path +from typing import Any, BinaryIO, cast + +from .. import ( + BrokenResourceError, + ClosedResourceError, + EndOfStream, + TypedAttributeSet, + to_thread, + typed_attribute, +) +from ..abc import ByteReceiveStream, ByteSendStream + + +class FileStreamAttribute(TypedAttributeSet): + #: the open file descriptor + file: BinaryIO = typed_attribute() + #: the path of the file on the file system, if available (file must be a real file) + path: Path = typed_attribute() + #: the file number, if available (file must be a real file or a TTY) + fileno: int = typed_attribute() + + +class _BaseFileStream: + def __init__(self, file: BinaryIO): + self._file = file + + async def aclose(self) -> None: + await to_thread.run_sync(self._file.close) + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + attributes: dict[Any, Callable[[], Any]] = { + FileStreamAttribute.file: lambda: self._file, + } + + if hasattr(self._file, "name"): + attributes[FileStreamAttribute.path] = lambda: Path(self._file.name) + + try: + self._file.fileno() + except UnsupportedOperation: + pass + else: + attributes[FileStreamAttribute.fileno] = lambda: self._file.fileno() + + return attributes + + +class FileReadStream(_BaseFileStream, ByteReceiveStream): + """ + A byte stream that reads from a file in the file system. + + :param file: a file that has been opened for reading in binary mode + + .. versionadded:: 3.0 + """ + + @classmethod + async def from_path(cls, path: str | PathLike[str]) -> FileReadStream: + """ + Create a file read stream by opening the given file. + + :param path: path of the file to read from + + """ + file = await to_thread.run_sync(Path(path).open, "rb") + return cls(cast(BinaryIO, file)) + + async def receive(self, max_bytes: int = 65536) -> bytes: + try: + data = await to_thread.run_sync(self._file.read, max_bytes) + except ValueError: + raise ClosedResourceError from None + except OSError as exc: + raise BrokenResourceError from exc + + if data: + return data + else: + raise EndOfStream + + async def seek(self, position: int, whence: int = SEEK_SET) -> int: + """ + Seek the file to the given position. + + .. seealso:: :meth:`io.IOBase.seek` + + .. note:: Not all file descriptors are seekable. + + :param position: position to seek the file to + :param whence: controls how ``position`` is interpreted + :return: the new absolute position + :raises OSError: if the file is not seekable + + """ + return await to_thread.run_sync(self._file.seek, position, whence) + + async def tell(self) -> int: + """ + Return the current stream position. + + .. note:: Not all file descriptors are seekable. + + :return: the current absolute position + :raises OSError: if the file is not seekable + + """ + return await to_thread.run_sync(self._file.tell) + + +class FileWriteStream(_BaseFileStream, ByteSendStream): + """ + A byte stream that writes to a file in the file system. + + :param file: a file that has been opened for writing in binary mode + + .. versionadded:: 3.0 + """ + + @classmethod + async def from_path( + cls, path: str | PathLike[str], append: bool = False + ) -> FileWriteStream: + """ + Create a file write stream by opening the given file for writing. + + :param path: path of the file to write to + :param append: if ``True``, open the file for appending; if ``False``, any + existing file at the given path will be truncated + + """ + mode = "ab" if append else "wb" + file = await to_thread.run_sync(Path(path).open, mode) + return cls(cast(BinaryIO, file)) + + async def send(self, item: bytes) -> None: + try: + await to_thread.run_sync(self._file.write, item) + except ValueError: + raise ClosedResourceError from None + except OSError as exc: + raise BrokenResourceError from exc diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/memory.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/memory.py new file mode 100644 index 0000000000000000000000000000000000000000..9a3bac474b5eba460033240b5b8c45effd7bb334 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/memory.py @@ -0,0 +1,319 @@ +from __future__ import annotations + +import warnings +from collections import OrderedDict, deque +from dataclasses import dataclass, field +from types import TracebackType +from typing import Generic, NamedTuple, TypeVar + +from .. import ( + BrokenResourceError, + ClosedResourceError, + EndOfStream, + WouldBlock, +) +from .._core._testing import TaskInfo, get_current_task +from ..abc import Event, ObjectReceiveStream, ObjectSendStream +from ..lowlevel import checkpoint + +T_Item = TypeVar("T_Item") +T_co = TypeVar("T_co", covariant=True) +T_contra = TypeVar("T_contra", contravariant=True) + + +class MemoryObjectStreamStatistics(NamedTuple): + current_buffer_used: int #: number of items stored in the buffer + #: maximum number of items that can be stored on this stream (or :data:`math.inf`) + max_buffer_size: float + open_send_streams: int #: number of unclosed clones of the send stream + open_receive_streams: int #: number of unclosed clones of the receive stream + #: number of tasks blocked on :meth:`MemoryObjectSendStream.send` + tasks_waiting_send: int + #: number of tasks blocked on :meth:`MemoryObjectReceiveStream.receive` + tasks_waiting_receive: int + + +@dataclass(eq=False) +class MemoryObjectItemReceiver(Generic[T_Item]): + task_info: TaskInfo = field(init=False, default_factory=get_current_task) + item: T_Item = field(init=False) + + def __repr__(self) -> str: + # When item is not defined, we get following error with default __repr__: + # AttributeError: 'MemoryObjectItemReceiver' object has no attribute 'item' + item = getattr(self, "item", None) + return f"{self.__class__.__name__}(task_info={self.task_info}, item={item!r})" + + +@dataclass(eq=False) +class MemoryObjectStreamState(Generic[T_Item]): + max_buffer_size: float = field() + buffer: deque[T_Item] = field(init=False, default_factory=deque) + open_send_channels: int = field(init=False, default=0) + open_receive_channels: int = field(init=False, default=0) + waiting_receivers: OrderedDict[Event, MemoryObjectItemReceiver[T_Item]] = field( + init=False, default_factory=OrderedDict + ) + waiting_senders: OrderedDict[Event, T_Item] = field( + init=False, default_factory=OrderedDict + ) + + def statistics(self) -> MemoryObjectStreamStatistics: + return MemoryObjectStreamStatistics( + len(self.buffer), + self.max_buffer_size, + self.open_send_channels, + self.open_receive_channels, + len(self.waiting_senders), + len(self.waiting_receivers), + ) + + +@dataclass(eq=False) +class MemoryObjectReceiveStream(Generic[T_co], ObjectReceiveStream[T_co]): + _state: MemoryObjectStreamState[T_co] + _closed: bool = field(init=False, default=False) + + def __post_init__(self) -> None: + self._state.open_receive_channels += 1 + + def receive_nowait(self) -> T_co: + """ + Receive the next item if it can be done without waiting. + + :return: the received item + :raises ~anyio.ClosedResourceError: if this send stream has been closed + :raises ~anyio.EndOfStream: if the buffer is empty and this stream has been + closed from the sending end + :raises ~anyio.WouldBlock: if there are no items in the buffer and no tasks + waiting to send + + """ + if self._closed: + raise ClosedResourceError + + if self._state.waiting_senders: + # Get the item from the next sender + send_event, item = self._state.waiting_senders.popitem(last=False) + self._state.buffer.append(item) + send_event.set() + + if self._state.buffer: + return self._state.buffer.popleft() + elif not self._state.open_send_channels: + raise EndOfStream + + raise WouldBlock + + async def receive(self) -> T_co: + await checkpoint() + try: + return self.receive_nowait() + except WouldBlock: + # Add ourselves in the queue + receive_event = Event() + receiver = MemoryObjectItemReceiver[T_co]() + self._state.waiting_receivers[receive_event] = receiver + + try: + await receive_event.wait() + finally: + self._state.waiting_receivers.pop(receive_event, None) + + try: + return receiver.item + except AttributeError: + raise EndOfStream from None + + def clone(self) -> MemoryObjectReceiveStream[T_co]: + """ + Create a clone of this receive stream. + + Each clone can be closed separately. Only when all clones have been closed will + the receiving end of the memory stream be considered closed by the sending ends. + + :return: the cloned stream + + """ + if self._closed: + raise ClosedResourceError + + return MemoryObjectReceiveStream(_state=self._state) + + def close(self) -> None: + """ + Close the stream. + + This works the exact same way as :meth:`aclose`, but is provided as a special + case for the benefit of synchronous callbacks. + + """ + if not self._closed: + self._closed = True + self._state.open_receive_channels -= 1 + if self._state.open_receive_channels == 0: + send_events = list(self._state.waiting_senders.keys()) + for event in send_events: + event.set() + + async def aclose(self) -> None: + self.close() + + def statistics(self) -> MemoryObjectStreamStatistics: + """ + Return statistics about the current state of this stream. + + .. versionadded:: 3.0 + """ + return self._state.statistics() + + def __enter__(self) -> MemoryObjectReceiveStream[T_co]: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.close() + + def __del__(self) -> None: + if not self._closed: + warnings.warn( + f"Unclosed <{self.__class__.__name__} at {id(self):x}>", + ResourceWarning, + stacklevel=1, + source=self, + ) + + +@dataclass(eq=False) +class MemoryObjectSendStream(Generic[T_contra], ObjectSendStream[T_contra]): + _state: MemoryObjectStreamState[T_contra] + _closed: bool = field(init=False, default=False) + + def __post_init__(self) -> None: + self._state.open_send_channels += 1 + + def send_nowait(self, item: T_contra) -> None: + """ + Send an item immediately if it can be done without waiting. + + :param item: the item to send + :raises ~anyio.ClosedResourceError: if this send stream has been closed + :raises ~anyio.BrokenResourceError: if the stream has been closed from the + receiving end + :raises ~anyio.WouldBlock: if the buffer is full and there are no tasks waiting + to receive + + """ + if self._closed: + raise ClosedResourceError + if not self._state.open_receive_channels: + raise BrokenResourceError + + while self._state.waiting_receivers: + receive_event, receiver = self._state.waiting_receivers.popitem(last=False) + if not receiver.task_info.has_pending_cancellation(): + receiver.item = item + receive_event.set() + return + + if len(self._state.buffer) < self._state.max_buffer_size: + self._state.buffer.append(item) + else: + raise WouldBlock + + async def send(self, item: T_contra) -> None: + """ + Send an item to the stream. + + If the buffer is full, this method blocks until there is again room in the + buffer or the item can be sent directly to a receiver. + + :param item: the item to send + :raises ~anyio.ClosedResourceError: if this send stream has been closed + :raises ~anyio.BrokenResourceError: if the stream has been closed from the + receiving end + + """ + await checkpoint() + try: + self.send_nowait(item) + except WouldBlock: + # Wait until there's someone on the receiving end + send_event = Event() + self._state.waiting_senders[send_event] = item + try: + await send_event.wait() + except BaseException: + self._state.waiting_senders.pop(send_event, None) + raise + + if send_event in self._state.waiting_senders: + del self._state.waiting_senders[send_event] + raise BrokenResourceError from None + + def clone(self) -> MemoryObjectSendStream[T_contra]: + """ + Create a clone of this send stream. + + Each clone can be closed separately. Only when all clones have been closed will + the sending end of the memory stream be considered closed by the receiving ends. + + :return: the cloned stream + + """ + if self._closed: + raise ClosedResourceError + + return MemoryObjectSendStream(_state=self._state) + + def close(self) -> None: + """ + Close the stream. + + This works the exact same way as :meth:`aclose`, but is provided as a special + case for the benefit of synchronous callbacks. + + """ + if not self._closed: + self._closed = True + self._state.open_send_channels -= 1 + if self._state.open_send_channels == 0: + receive_events = list(self._state.waiting_receivers.keys()) + self._state.waiting_receivers.clear() + for event in receive_events: + event.set() + + async def aclose(self) -> None: + self.close() + + def statistics(self) -> MemoryObjectStreamStatistics: + """ + Return statistics about the current state of this stream. + + .. versionadded:: 3.0 + """ + return self._state.statistics() + + def __enter__(self) -> MemoryObjectSendStream[T_contra]: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.close() + + def __del__(self) -> None: + if not self._closed: + warnings.warn( + f"Unclosed <{self.__class__.__name__} at {id(self):x}>", + ResourceWarning, + stacklevel=1, + source=self, + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/stapled.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/stapled.py new file mode 100644 index 0000000000000000000000000000000000000000..80f64a2e8e5763ae327c5c213ec12e24f023b4d3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/stapled.py @@ -0,0 +1,141 @@ +from __future__ import annotations + +from collections.abc import Callable, Mapping, Sequence +from dataclasses import dataclass +from typing import Any, Generic, TypeVar + +from ..abc import ( + ByteReceiveStream, + ByteSendStream, + ByteStream, + Listener, + ObjectReceiveStream, + ObjectSendStream, + ObjectStream, + TaskGroup, +) + +T_Item = TypeVar("T_Item") +T_Stream = TypeVar("T_Stream") + + +@dataclass(eq=False) +class StapledByteStream(ByteStream): + """ + Combines two byte streams into a single, bidirectional byte stream. + + Extra attributes will be provided from both streams, with the receive stream + providing the values in case of a conflict. + + :param ByteSendStream send_stream: the sending byte stream + :param ByteReceiveStream receive_stream: the receiving byte stream + """ + + send_stream: ByteSendStream + receive_stream: ByteReceiveStream + + async def receive(self, max_bytes: int = 65536) -> bytes: + return await self.receive_stream.receive(max_bytes) + + async def send(self, item: bytes) -> None: + await self.send_stream.send(item) + + async def send_eof(self) -> None: + await self.send_stream.aclose() + + async def aclose(self) -> None: + await self.send_stream.aclose() + await self.receive_stream.aclose() + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + return { + **self.send_stream.extra_attributes, + **self.receive_stream.extra_attributes, + } + + +@dataclass(eq=False) +class StapledObjectStream(Generic[T_Item], ObjectStream[T_Item]): + """ + Combines two object streams into a single, bidirectional object stream. + + Extra attributes will be provided from both streams, with the receive stream + providing the values in case of a conflict. + + :param ObjectSendStream send_stream: the sending object stream + :param ObjectReceiveStream receive_stream: the receiving object stream + """ + + send_stream: ObjectSendStream[T_Item] + receive_stream: ObjectReceiveStream[T_Item] + + async def receive(self) -> T_Item: + return await self.receive_stream.receive() + + async def send(self, item: T_Item) -> None: + await self.send_stream.send(item) + + async def send_eof(self) -> None: + await self.send_stream.aclose() + + async def aclose(self) -> None: + await self.send_stream.aclose() + await self.receive_stream.aclose() + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + return { + **self.send_stream.extra_attributes, + **self.receive_stream.extra_attributes, + } + + +@dataclass(eq=False) +class MultiListener(Generic[T_Stream], Listener[T_Stream]): + """ + Combines multiple listeners into one, serving connections from all of them at once. + + Any MultiListeners in the given collection of listeners will have their listeners + moved into this one. + + Extra attributes are provided from each listener, with each successive listener + overriding any conflicting attributes from the previous one. + + :param listeners: listeners to serve + :type listeners: Sequence[Listener[T_Stream]] + """ + + listeners: Sequence[Listener[T_Stream]] + + def __post_init__(self) -> None: + listeners: list[Listener[T_Stream]] = [] + for listener in self.listeners: + if isinstance(listener, MultiListener): + listeners.extend(listener.listeners) + del listener.listeners[:] # type: ignore[attr-defined] + else: + listeners.append(listener) + + self.listeners = listeners + + async def serve( + self, handler: Callable[[T_Stream], Any], task_group: TaskGroup | None = None + ) -> None: + from .. import create_task_group + + async with create_task_group() as tg: + for listener in self.listeners: + tg.start_soon(listener.serve, handler, task_group) + + async def aclose(self) -> None: + for listener in self.listeners: + await listener.aclose() + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + attributes: dict = {} + for listener in self.listeners: + attributes.update(listener.extra_attributes) + + return attributes diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/text.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/text.py new file mode 100644 index 0000000000000000000000000000000000000000..dfd8e7a2550a7e217ec280a7147826c2bc3bad96 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/text.py @@ -0,0 +1,169 @@ +from __future__ import annotations + +import codecs +import sys +from collections.abc import Callable, Mapping +from dataclasses import InitVar, dataclass, field +from typing import Any + +from ..abc import ( + AnyByteReceiveStream, + AnyByteSendStream, + AnyByteStream, + AnyByteStreamConnectable, + ObjectReceiveStream, + ObjectSendStream, + ObjectStream, + ObjectStreamConnectable, +) + +if sys.version_info >= (3, 12): + from typing import override +else: + from typing_extensions import override + + +@dataclass(eq=False) +class TextReceiveStream(ObjectReceiveStream[str]): + """ + Stream wrapper that decodes bytes to strings using the given encoding. + + Decoding is done using :class:`~codecs.IncrementalDecoder` which returns any + completely received unicode characters as soon as they come in. + + :param transport_stream: any bytes-based receive stream + :param encoding: character encoding to use for decoding bytes to strings (defaults + to ``utf-8``) + :param errors: handling scheme for decoding errors (defaults to ``strict``; see the + `codecs module documentation`_ for a comprehensive list of options) + + .. _codecs module documentation: + https://docs.python.org/3/library/codecs.html#codec-objects + """ + + transport_stream: AnyByteReceiveStream + encoding: InitVar[str] = "utf-8" + errors: InitVar[str] = "strict" + _decoder: codecs.IncrementalDecoder = field(init=False) + + def __post_init__(self, encoding: str, errors: str) -> None: + decoder_class = codecs.getincrementaldecoder(encoding) + self._decoder = decoder_class(errors=errors) + + async def receive(self) -> str: + while True: + chunk = await self.transport_stream.receive() + decoded = self._decoder.decode(chunk) + if decoded: + return decoded + + async def aclose(self) -> None: + await self.transport_stream.aclose() + self._decoder.reset() + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + return self.transport_stream.extra_attributes + + +@dataclass(eq=False) +class TextSendStream(ObjectSendStream[str]): + """ + Sends strings to the wrapped stream as bytes using the given encoding. + + :param AnyByteSendStream transport_stream: any bytes-based send stream + :param str encoding: character encoding to use for encoding strings to bytes + (defaults to ``utf-8``) + :param str errors: handling scheme for encoding errors (defaults to ``strict``; see + the `codecs module documentation`_ for a comprehensive list of options) + + .. _codecs module documentation: + https://docs.python.org/3/library/codecs.html#codec-objects + """ + + transport_stream: AnyByteSendStream + encoding: InitVar[str] = "utf-8" + errors: str = "strict" + _encoder: Callable[..., tuple[bytes, int]] = field(init=False) + + def __post_init__(self, encoding: str) -> None: + self._encoder = codecs.getencoder(encoding) + + async def send(self, item: str) -> None: + encoded = self._encoder(item, self.errors)[0] + await self.transport_stream.send(encoded) + + async def aclose(self) -> None: + await self.transport_stream.aclose() + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + return self.transport_stream.extra_attributes + + +@dataclass(eq=False) +class TextStream(ObjectStream[str]): + """ + A bidirectional stream that decodes bytes to strings on receive and encodes strings + to bytes on send. + + Extra attributes will be provided from both streams, with the receive stream + providing the values in case of a conflict. + + :param AnyByteStream transport_stream: any bytes-based stream + :param str encoding: character encoding to use for encoding/decoding strings to/from + bytes (defaults to ``utf-8``) + :param str errors: handling scheme for encoding errors (defaults to ``strict``; see + the `codecs module documentation`_ for a comprehensive list of options) + + .. _codecs module documentation: + https://docs.python.org/3/library/codecs.html#codec-objects + """ + + transport_stream: AnyByteStream + encoding: InitVar[str] = "utf-8" + errors: InitVar[str] = "strict" + _receive_stream: TextReceiveStream = field(init=False) + _send_stream: TextSendStream = field(init=False) + + def __post_init__(self, encoding: str, errors: str) -> None: + self._receive_stream = TextReceiveStream( + self.transport_stream, encoding=encoding, errors=errors + ) + self._send_stream = TextSendStream( + self.transport_stream, encoding=encoding, errors=errors + ) + + async def receive(self) -> str: + return await self._receive_stream.receive() + + async def send(self, item: str) -> None: + await self._send_stream.send(item) + + async def send_eof(self) -> None: + await self.transport_stream.send_eof() + + async def aclose(self) -> None: + await self._send_stream.aclose() + await self._receive_stream.aclose() + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + return { + **self._send_stream.extra_attributes, + **self._receive_stream.extra_attributes, + } + + +class TextConnectable(ObjectStreamConnectable[str]): + def __init__(self, connectable: AnyByteStreamConnectable): + """ + :param connectable: the bytestream endpoint to wrap + + """ + self.connectable = connectable + + @override + async def connect(self) -> TextStream: + stream = await self.connectable.connect() + return TextStream(stream) diff --git a/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/tls.py b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/tls.py new file mode 100644 index 0000000000000000000000000000000000000000..17fa200e61c77edc80a52601eb9f6edc89620023 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/anyio/streams/tls.py @@ -0,0 +1,417 @@ +from __future__ import annotations + +import logging +import re +import ssl +import sys +from collections.abc import Callable, Mapping +from dataclasses import dataclass +from functools import wraps +from ssl import SSLContext +from typing import Any, TypeVar + +from .. import ( + BrokenResourceError, + EndOfStream, + aclose_forcefully, + get_cancelled_exc_class, + to_thread, +) +from .._core._typedattr import TypedAttributeSet, typed_attribute +from ..abc import ( + AnyByteStream, + AnyByteStreamConnectable, + ByteStream, + ByteStreamConnectable, + Listener, + TaskGroup, +) + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: + from typing_extensions import TypeAlias + +if sys.version_info >= (3, 11): + from typing import TypeVarTuple, Unpack +else: + from typing_extensions import TypeVarTuple, Unpack + +if sys.version_info >= (3, 12): + from typing import override +else: + from typing_extensions import override + +T_Retval = TypeVar("T_Retval") +PosArgsT = TypeVarTuple("PosArgsT") +_PCTRTT: TypeAlias = tuple[tuple[str, str], ...] +_PCTRTTT: TypeAlias = tuple[_PCTRTT, ...] + + +class TLSAttribute(TypedAttributeSet): + """Contains Transport Layer Security related attributes.""" + + #: the selected ALPN protocol + alpn_protocol: str | None = typed_attribute() + #: the channel binding for type ``tls-unique`` + channel_binding_tls_unique: bytes = typed_attribute() + #: the selected cipher + cipher: tuple[str, str, int] = typed_attribute() + #: the peer certificate in dictionary form (see :meth:`ssl.SSLSocket.getpeercert` + # for more information) + peer_certificate: None | (dict[str, str | _PCTRTTT | _PCTRTT]) = typed_attribute() + #: the peer certificate in binary form + peer_certificate_binary: bytes | None = typed_attribute() + #: ``True`` if this is the server side of the connection + server_side: bool = typed_attribute() + #: ciphers shared by the client during the TLS handshake (``None`` if this is the + #: client side) + shared_ciphers: list[tuple[str, str, int]] | None = typed_attribute() + #: the :class:`~ssl.SSLObject` used for encryption + ssl_object: ssl.SSLObject = typed_attribute() + #: ``True`` if this stream does (and expects) a closing TLS handshake when the + #: stream is being closed + standard_compatible: bool = typed_attribute() + #: the TLS protocol version (e.g. ``TLSv1.2``) + tls_version: str = typed_attribute() + + +@dataclass(eq=False) +class TLSStream(ByteStream): + """ + A stream wrapper that encrypts all sent data and decrypts received data. + + This class has no public initializer; use :meth:`wrap` instead. + All extra attributes from :class:`~TLSAttribute` are supported. + + :var AnyByteStream transport_stream: the wrapped stream + + """ + + transport_stream: AnyByteStream + standard_compatible: bool + _ssl_object: ssl.SSLObject + _read_bio: ssl.MemoryBIO + _write_bio: ssl.MemoryBIO + + @classmethod + async def wrap( + cls, + transport_stream: AnyByteStream, + *, + server_side: bool | None = None, + hostname: str | None = None, + ssl_context: ssl.SSLContext | None = None, + standard_compatible: bool = True, + ) -> TLSStream: + """ + Wrap an existing stream with Transport Layer Security. + + This performs a TLS handshake with the peer. + + :param transport_stream: a bytes-transporting stream to wrap + :param server_side: ``True`` if this is the server side of the connection, + ``False`` if this is the client side (if omitted, will be set to ``False`` + if ``hostname`` has been provided, ``False`` otherwise). Used only to create + a default context when an explicit context has not been provided. + :param hostname: host name of the peer (if host name checking is desired) + :param ssl_context: the SSLContext object to use (if not provided, a secure + default will be created) + :param standard_compatible: if ``False``, skip the closing handshake when + closing the connection, and don't raise an exception if the peer does the + same + :raises ~ssl.SSLError: if the TLS handshake fails + + """ + if server_side is None: + server_side = not hostname + + if not ssl_context: + purpose = ( + ssl.Purpose.CLIENT_AUTH if server_side else ssl.Purpose.SERVER_AUTH + ) + ssl_context = ssl.create_default_context(purpose) + + # Re-enable detection of unexpected EOFs if it was disabled by Python + if hasattr(ssl, "OP_IGNORE_UNEXPECTED_EOF"): + ssl_context.options &= ~ssl.OP_IGNORE_UNEXPECTED_EOF + + bio_in = ssl.MemoryBIO() + bio_out = ssl.MemoryBIO() + + # External SSLContext implementations may do blocking I/O in wrap_bio(), + # but the standard library implementation won't + if type(ssl_context) is ssl.SSLContext: + ssl_object = ssl_context.wrap_bio( + bio_in, bio_out, server_side=server_side, server_hostname=hostname + ) + else: + ssl_object = await to_thread.run_sync( + ssl_context.wrap_bio, + bio_in, + bio_out, + server_side, + hostname, + None, + ) + + wrapper = cls( + transport_stream=transport_stream, + standard_compatible=standard_compatible, + _ssl_object=ssl_object, + _read_bio=bio_in, + _write_bio=bio_out, + ) + await wrapper._call_sslobject_method(ssl_object.do_handshake) + return wrapper + + async def _call_sslobject_method( + self, func: Callable[[Unpack[PosArgsT]], T_Retval], *args: Unpack[PosArgsT] + ) -> T_Retval: + while True: + try: + result = func(*args) + except ssl.SSLWantReadError: + try: + # Flush any pending writes first + if self._write_bio.pending: + await self.transport_stream.send(self._write_bio.read()) + + data = await self.transport_stream.receive() + except EndOfStream: + self._read_bio.write_eof() + except OSError as exc: + self._read_bio.write_eof() + self._write_bio.write_eof() + raise BrokenResourceError from exc + else: + self._read_bio.write(data) + except ssl.SSLWantWriteError: + await self.transport_stream.send(self._write_bio.read()) + except ssl.SSLSyscallError as exc: + self._read_bio.write_eof() + self._write_bio.write_eof() + raise BrokenResourceError from exc + except ssl.SSLError as exc: + self._read_bio.write_eof() + self._write_bio.write_eof() + if isinstance(exc, ssl.SSLEOFError) or ( + exc.strerror and "UNEXPECTED_EOF_WHILE_READING" in exc.strerror + ): + if self.standard_compatible: + raise BrokenResourceError from exc + else: + raise EndOfStream from None + + raise + else: + # Flush any pending writes first + if self._write_bio.pending: + await self.transport_stream.send(self._write_bio.read()) + + return result + + async def unwrap(self) -> tuple[AnyByteStream, bytes]: + """ + Does the TLS closing handshake. + + :return: a tuple of (wrapped byte stream, bytes left in the read buffer) + + """ + await self._call_sslobject_method(self._ssl_object.unwrap) + self._read_bio.write_eof() + self._write_bio.write_eof() + return self.transport_stream, self._read_bio.read() + + async def aclose(self) -> None: + if self.standard_compatible: + try: + await self.unwrap() + except BaseException: + await aclose_forcefully(self.transport_stream) + raise + + await self.transport_stream.aclose() + + async def receive(self, max_bytes: int = 65536) -> bytes: + data = await self._call_sslobject_method(self._ssl_object.read, max_bytes) + if not data: + raise EndOfStream + + return data + + async def send(self, item: bytes) -> None: + await self._call_sslobject_method(self._ssl_object.write, item) + + async def send_eof(self) -> None: + tls_version = self.extra(TLSAttribute.tls_version) + match = re.match(r"TLSv(\d+)(?:\.(\d+))?", tls_version) + if match: + major, minor = int(match.group(1)), int(match.group(2) or 0) + if (major, minor) < (1, 3): + raise NotImplementedError( + f"send_eof() requires at least TLSv1.3; current " + f"session uses {tls_version}" + ) + + raise NotImplementedError( + "send_eof() has not yet been implemented for TLS streams" + ) + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + return { + **self.transport_stream.extra_attributes, + TLSAttribute.alpn_protocol: self._ssl_object.selected_alpn_protocol, + TLSAttribute.channel_binding_tls_unique: ( + self._ssl_object.get_channel_binding + ), + TLSAttribute.cipher: self._ssl_object.cipher, + TLSAttribute.peer_certificate: lambda: self._ssl_object.getpeercert(False), + TLSAttribute.peer_certificate_binary: lambda: self._ssl_object.getpeercert( + True + ), + TLSAttribute.server_side: lambda: self._ssl_object.server_side, + TLSAttribute.shared_ciphers: lambda: self._ssl_object.shared_ciphers() + if self._ssl_object.server_side + else None, + TLSAttribute.standard_compatible: lambda: self.standard_compatible, + TLSAttribute.ssl_object: lambda: self._ssl_object, + TLSAttribute.tls_version: self._ssl_object.version, + } + + +@dataclass(eq=False) +class TLSListener(Listener[TLSStream]): + """ + A convenience listener that wraps another listener and auto-negotiates a TLS session + on every accepted connection. + + If the TLS handshake times out or raises an exception, + :meth:`handle_handshake_error` is called to do whatever post-mortem processing is + deemed necessary. + + Supports only the :attr:`~TLSAttribute.standard_compatible` extra attribute. + + :param Listener listener: the listener to wrap + :param ssl_context: the SSL context object + :param standard_compatible: a flag passed through to :meth:`TLSStream.wrap` + :param handshake_timeout: time limit for the TLS handshake + (passed to :func:`~anyio.fail_after`) + """ + + listener: Listener[Any] + ssl_context: ssl.SSLContext + standard_compatible: bool = True + handshake_timeout: float = 30 + + @staticmethod + async def handle_handshake_error(exc: BaseException, stream: AnyByteStream) -> None: + """ + Handle an exception raised during the TLS handshake. + + This method does 3 things: + + #. Forcefully closes the original stream + #. Logs the exception (unless it was a cancellation exception) using the + ``anyio.streams.tls`` logger + #. Reraises the exception if it was a base exception or a cancellation exception + + :param exc: the exception + :param stream: the original stream + + """ + await aclose_forcefully(stream) + + # Log all except cancellation exceptions + if not isinstance(exc, get_cancelled_exc_class()): + # CPython (as of 3.11.5) returns incorrect `sys.exc_info()` here when using + # any asyncio implementation, so we explicitly pass the exception to log + # (https://github.com/python/cpython/issues/108668). Trio does not have this + # issue because it works around the CPython bug. + logging.getLogger(__name__).exception( + "Error during TLS handshake", exc_info=exc + ) + + # Only reraise base exceptions and cancellation exceptions + if not isinstance(exc, Exception) or isinstance(exc, get_cancelled_exc_class()): + raise + + async def serve( + self, + handler: Callable[[TLSStream], Any], + task_group: TaskGroup | None = None, + ) -> None: + @wraps(handler) + async def handler_wrapper(stream: AnyByteStream) -> None: + from .. import fail_after + + try: + with fail_after(self.handshake_timeout): + wrapped_stream = await TLSStream.wrap( + stream, + ssl_context=self.ssl_context, + standard_compatible=self.standard_compatible, + ) + except BaseException as exc: + await self.handle_handshake_error(exc, stream) + else: + await handler(wrapped_stream) + + await self.listener.serve(handler_wrapper, task_group) + + async def aclose(self) -> None: + await self.listener.aclose() + + @property + def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: + return { + TLSAttribute.standard_compatible: lambda: self.standard_compatible, + } + + +class TLSConnectable(ByteStreamConnectable): + """ + Wraps another connectable and does TLS negotiation after a successful connection. + + :param connectable: the connectable to wrap + :param hostname: host name of the server (if host name checking is desired) + :param ssl_context: the SSLContext object to use (if not provided, a secure default + will be created) + :param standard_compatible: if ``False``, skip the closing handshake when closing + the connection, and don't raise an exception if the server does the same + """ + + def __init__( + self, + connectable: AnyByteStreamConnectable, + *, + hostname: str | None = None, + ssl_context: ssl.SSLContext | None = None, + standard_compatible: bool = True, + ) -> None: + self.connectable = connectable + self.ssl_context: SSLContext = ssl_context or ssl.create_default_context( + ssl.Purpose.SERVER_AUTH + ) + if not isinstance(self.ssl_context, ssl.SSLContext): + raise TypeError( + "ssl_context must be an instance of ssl.SSLContext, not " + f"{type(self.ssl_context).__name__}" + ) + self.hostname = hostname + self.standard_compatible = standard_compatible + + @override + async def connect(self) -> TLSStream: + stream = await self.connectable.connect() + try: + return await TLSStream.wrap( + stream, + hostname=self.hostname, + ssl_context=self.ssl_context, + standard_compatible=self.standard_compatible, + ) + except BaseException: + await aclose_forcefully(stream) + raise diff --git a/tool_server/.venv/lib/python3.12/site-packages/click-8.2.1.dist-info/licenses/LICENSE.txt b/tool_server/.venv/lib/python3.12/site-packages/click-8.2.1.dist-info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d12a849186982399c537c5b9a8fd77bf2edd5eab --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/click-8.2.1.dist-info/licenses/LICENSE.txt @@ -0,0 +1,28 @@ +Copyright 2014 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d90c412a5393f21c01deb4949e351a1d40355a44 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_compat.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_compat.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d38b628cfe1f500c8978cbea843cc946774b4b0d Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_compat.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_termui_impl.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_termui_impl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3d8bff14c6ae2a1ba7f6c84dbb043e2bff2f37a Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_termui_impl.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_textwrap.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_textwrap.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a1e85df65a89687d216e0579ae9bfa7d8004eb41 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_textwrap.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_winconsole.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_winconsole.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dfeb6a3fb745976fc78223cc2cac05216fa712b5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/_winconsole.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/core.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/core.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ce97ec6a73f6c21e85fa12e1213caf18c2c5c855 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/core.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb4a360bc037ec802cd2b1c4b03b2443377070982db4948dd3997cf30dda064d +size 127659 diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/decorators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/decorators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b6d21dfc61ef5b80f3ec313c562098bbd9994cf Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/decorators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/exceptions.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d1d4e236444277a7b951f5fe33250e764414c43 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/exceptions.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/formatting.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/formatting.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..56f3b5f68af49ad769401c8a176a6b25dcadddd2 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/formatting.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/globals.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/globals.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03dfee1adf5e75d21d0be8a851021104f08e5a31 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/globals.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/parser.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/parser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b2156be5b15ea54db4398cfb7fa0d6f0c7cc26c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/parser.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/shell_completion.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/shell_completion.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..99b573e0172da38412dfb26909af783b96bf1ef8 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/shell_completion.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/termui.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/termui.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3a6e54c81b1e924ce8eb488700ca2be1aa1ab7ac Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/termui.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/testing.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/testing.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a316be17371850bf9c0087d6efda590e804446c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/testing.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/types.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/types.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8c3a237120ad748356959e9e5330b7a16591ce0 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/types.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7be5fe29a1e873b0d9f12e68c9138542b951c7b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/click/__pycache__/utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/Error/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/Error/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..5dac858f382c3247ff0ce2b204af1ddcd10dace5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/Error/__init__.pyi @@ -0,0 +1,118 @@ +__all__: list[str] = [] + +# Enumerations +StsOk: int +STS_OK: int +StsBackTrace: int +STS_BACK_TRACE: int +StsError: int +STS_ERROR: int +StsInternal: int +STS_INTERNAL: int +StsNoMem: int +STS_NO_MEM: int +StsBadArg: int +STS_BAD_ARG: int +StsBadFunc: int +STS_BAD_FUNC: int +StsNoConv: int +STS_NO_CONV: int +StsAutoTrace: int +STS_AUTO_TRACE: int +HeaderIsNull: int +HEADER_IS_NULL: int +BadImageSize: int +BAD_IMAGE_SIZE: int +BadOffset: int +BAD_OFFSET: int +BadDataPtr: int +BAD_DATA_PTR: int +BadStep: int +BAD_STEP: int +BadModelOrChSeq: int +BAD_MODEL_OR_CH_SEQ: int +BadNumChannels: int +BAD_NUM_CHANNELS: int +BadNumChannel1U: int +BAD_NUM_CHANNEL1U: int +BadDepth: int +BAD_DEPTH: int +BadAlphaChannel: int +BAD_ALPHA_CHANNEL: int +BadOrder: int +BAD_ORDER: int +BadOrigin: int +BAD_ORIGIN: int +BadAlign: int +BAD_ALIGN: int +BadCallBack: int +BAD_CALL_BACK: int +BadTileSize: int +BAD_TILE_SIZE: int +BadCOI: int +BAD_COI: int +BadROISize: int +BAD_ROISIZE: int +MaskIsTiled: int +MASK_IS_TILED: int +StsNullPtr: int +STS_NULL_PTR: int +StsVecLengthErr: int +STS_VEC_LENGTH_ERR: int +StsFilterStructContentErr: int +STS_FILTER_STRUCT_CONTENT_ERR: int +StsKernelStructContentErr: int +STS_KERNEL_STRUCT_CONTENT_ERR: int +StsFilterOffsetErr: int +STS_FILTER_OFFSET_ERR: int +StsBadSize: int +STS_BAD_SIZE: int +StsDivByZero: int +STS_DIV_BY_ZERO: int +StsInplaceNotSupported: int +STS_INPLACE_NOT_SUPPORTED: int +StsObjectNotFound: int +STS_OBJECT_NOT_FOUND: int +StsUnmatchedFormats: int +STS_UNMATCHED_FORMATS: int +StsBadFlag: int +STS_BAD_FLAG: int +StsBadPoint: int +STS_BAD_POINT: int +StsBadMask: int +STS_BAD_MASK: int +StsUnmatchedSizes: int +STS_UNMATCHED_SIZES: int +StsUnsupportedFormat: int +STS_UNSUPPORTED_FORMAT: int +StsOutOfRange: int +STS_OUT_OF_RANGE: int +StsParseError: int +STS_PARSE_ERROR: int +StsNotImplemented: int +STS_NOT_IMPLEMENTED: int +StsBadMemBlock: int +STS_BAD_MEM_BLOCK: int +StsAssert: int +STS_ASSERT: int +GpuNotSupported: int +GPU_NOT_SUPPORTED: int +GpuApiCallError: int +GPU_API_CALL_ERROR: int +OpenGlNotSupported: int +OPEN_GL_NOT_SUPPORTED: int +OpenGlApiCallError: int +OPEN_GL_API_CALL_ERROR: int +OpenCLApiCallError: int +OPEN_CLAPI_CALL_ERROR: int +OpenCLDoubleNotSupported: int +OPEN_CLDOUBLE_NOT_SUPPORTED: int +OpenCLInitError: int +OPEN_CLINIT_ERROR: int +OpenCLNoAMDBlasFft: int +OPEN_CLNO_AMDBLAS_FFT: int +Code = int +"""One of [StsOk, STS_OK, StsBackTrace, STS_BACK_TRACE, StsError, STS_ERROR, StsInternal, STS_INTERNAL, StsNoMem, STS_NO_MEM, StsBadArg, STS_BAD_ARG, StsBadFunc, STS_BAD_FUNC, StsNoConv, STS_NO_CONV, StsAutoTrace, STS_AUTO_TRACE, HeaderIsNull, HEADER_IS_NULL, BadImageSize, BAD_IMAGE_SIZE, BadOffset, BAD_OFFSET, BadDataPtr, BAD_DATA_PTR, BadStep, BAD_STEP, BadModelOrChSeq, BAD_MODEL_OR_CH_SEQ, BadNumChannels, BAD_NUM_CHANNELS, BadNumChannel1U, BAD_NUM_CHANNEL1U, BadDepth, BAD_DEPTH, BadAlphaChannel, BAD_ALPHA_CHANNEL, BadOrder, BAD_ORDER, BadOrigin, BAD_ORIGIN, BadAlign, BAD_ALIGN, BadCallBack, BAD_CALL_BACK, BadTileSize, BAD_TILE_SIZE, BadCOI, BAD_COI, BadROISize, BAD_ROISIZE, MaskIsTiled, MASK_IS_TILED, StsNullPtr, STS_NULL_PTR, StsVecLengthErr, STS_VEC_LENGTH_ERR, StsFilterStructContentErr, STS_FILTER_STRUCT_CONTENT_ERR, StsKernelStructContentErr, STS_KERNEL_STRUCT_CONTENT_ERR, StsFilterOffsetErr, STS_FILTER_OFFSET_ERR, StsBadSize, STS_BAD_SIZE, StsDivByZero, STS_DIV_BY_ZERO, StsInplaceNotSupported, STS_INPLACE_NOT_SUPPORTED, StsObjectNotFound, STS_OBJECT_NOT_FOUND, StsUnmatchedFormats, STS_UNMATCHED_FORMATS, StsBadFlag, STS_BAD_FLAG, StsBadPoint, STS_BAD_POINT, StsBadMask, STS_BAD_MASK, StsUnmatchedSizes, STS_UNMATCHED_SIZES, StsUnsupportedFormat, STS_UNSUPPORTED_FORMAT, StsOutOfRange, STS_OUT_OF_RANGE, StsParseError, STS_PARSE_ERROR, StsNotImplemented, STS_NOT_IMPLEMENTED, StsBadMemBlock, STS_BAD_MEM_BLOCK, StsAssert, STS_ASSERT, GpuNotSupported, GPU_NOT_SUPPORTED, GpuApiCallError, GPU_API_CALL_ERROR, OpenGlNotSupported, OPEN_GL_NOT_SUPPORTED, OpenGlApiCallError, OPEN_GL_API_CALL_ERROR, OpenCLApiCallError, OPEN_CLAPI_CALL_ERROR, OpenCLDoubleNotSupported, OPEN_CLDOUBLE_NOT_SUPPORTED, OpenCLInitError, OPEN_CLINIT_ERROR, OpenCLNoAMDBlasFft, OPEN_CLNO_AMDBLAS_FFT]""" + + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fa1d19883c0236b74ee8188594ba15cc6c10efa Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/config-3.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/config-3.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50760bf867efdeaccb0e543eb642ff43e39d43d0 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/config-3.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/config.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/config.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c59389835dd4cb5b6bb0f88ccbdd5ea65c9df18 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/config.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/load_config_py2.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/load_config_py2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a57ad58a693ff288203e43995f36f708009385a3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/load_config_py2.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/load_config_py3.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/load_config_py3.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..abbabff3e61c45949c859cfaf2074b12664b29b3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/load_config_py3.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/version.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1db6b6123f220ec614b2e31077360b75d4fd2e7a Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/__pycache__/version.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/aruco/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/aruco/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..c0abe1ccac795113cb1e307ea3fcd4b3a19a503b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/aruco/__init__.pyi @@ -0,0 +1,316 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +# Enumerations +CORNER_REFINE_NONE: int +CORNER_REFINE_SUBPIX: int +CORNER_REFINE_CONTOUR: int +CORNER_REFINE_APRILTAG: int +CornerRefineMethod = int +"""One of [CORNER_REFINE_NONE, CORNER_REFINE_SUBPIX, CORNER_REFINE_CONTOUR, CORNER_REFINE_APRILTAG]""" + +DICT_4X4_50: int +DICT_4X4_100: int +DICT_4X4_250: int +DICT_4X4_1000: int +DICT_5X5_50: int +DICT_5X5_100: int +DICT_5X5_250: int +DICT_5X5_1000: int +DICT_6X6_50: int +DICT_6X6_100: int +DICT_6X6_250: int +DICT_6X6_1000: int +DICT_7X7_50: int +DICT_7X7_100: int +DICT_7X7_250: int +DICT_7X7_1000: int +DICT_ARUCO_ORIGINAL: int +DICT_APRILTAG_16h5: int +DICT_APRILTAG_16H5: int +DICT_APRILTAG_25h9: int +DICT_APRILTAG_25H9: int +DICT_APRILTAG_36h10: int +DICT_APRILTAG_36H10: int +DICT_APRILTAG_36h11: int +DICT_APRILTAG_36H11: int +DICT_ARUCO_MIP_36h12: int +DICT_ARUCO_MIP_36H12: int +PredefinedDictionaryType = int +"""One of [DICT_4X4_50, DICT_4X4_100, DICT_4X4_250, DICT_4X4_1000, DICT_5X5_50, DICT_5X5_100, DICT_5X5_250, DICT_5X5_1000, DICT_6X6_50, DICT_6X6_100, DICT_6X6_250, DICT_6X6_1000, DICT_7X7_50, DICT_7X7_100, DICT_7X7_250, DICT_7X7_1000, DICT_ARUCO_ORIGINAL, DICT_APRILTAG_16h5, DICT_APRILTAG_16H5, DICT_APRILTAG_25h9, DICT_APRILTAG_25H9, DICT_APRILTAG_36h10, DICT_APRILTAG_36H10, DICT_APRILTAG_36h11, DICT_APRILTAG_36H11, DICT_ARUCO_MIP_36h12, DICT_ARUCO_MIP_36H12]""" + + + +# Classes +class Board: + # Functions + @_typing.overload + def __init__(self, objPoints: _typing.Sequence[cv2.typing.MatLike], dictionary: Dictionary, ids: cv2.typing.MatLike) -> None: ... + @_typing.overload + def __init__(self, objPoints: _typing.Sequence[cv2.UMat], dictionary: Dictionary, ids: cv2.UMat) -> None: ... + + def getDictionary(self) -> Dictionary: ... + + def getObjPoints(self) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point3f]]: ... + + def getIds(self) -> _typing.Sequence[int]: ... + + def getRightBottomCorner(self) -> cv2.typing.Point3f: ... + + @_typing.overload + def matchImagePoints(self, detectedCorners: _typing.Sequence[cv2.typing.MatLike], detectedIds: cv2.typing.MatLike, objPoints: cv2.typing.MatLike | None = ..., imgPoints: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def matchImagePoints(self, detectedCorners: _typing.Sequence[cv2.UMat], detectedIds: cv2.UMat, objPoints: cv2.UMat | None = ..., imgPoints: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ... + + @_typing.overload + def generateImage(self, outSize: cv2.typing.Size, img: cv2.typing.MatLike | None = ..., marginSize: int = ..., borderBits: int = ...) -> cv2.typing.MatLike: ... + @_typing.overload + def generateImage(self, outSize: cv2.typing.Size, img: cv2.UMat | None = ..., marginSize: int = ..., borderBits: int = ...) -> cv2.UMat: ... + + +class GridBoard(Board): + # Functions + @_typing.overload + def __init__(self, size: cv2.typing.Size, markerLength: float, markerSeparation: float, dictionary: Dictionary, ids: cv2.typing.MatLike | None = ...) -> None: ... + @_typing.overload + def __init__(self, size: cv2.typing.Size, markerLength: float, markerSeparation: float, dictionary: Dictionary, ids: cv2.UMat | None = ...) -> None: ... + + def getGridSize(self) -> cv2.typing.Size: ... + + def getMarkerLength(self) -> float: ... + + def getMarkerSeparation(self) -> float: ... + + +class CharucoBoard(Board): + # Functions + @_typing.overload + def __init__(self, size: cv2.typing.Size, squareLength: float, markerLength: float, dictionary: Dictionary, ids: cv2.typing.MatLike | None = ...) -> None: ... + @_typing.overload + def __init__(self, size: cv2.typing.Size, squareLength: float, markerLength: float, dictionary: Dictionary, ids: cv2.UMat | None = ...) -> None: ... + + def setLegacyPattern(self, legacyPattern: bool) -> None: ... + + def getLegacyPattern(self) -> bool: ... + + def getChessboardSize(self) -> cv2.typing.Size: ... + + def getSquareLength(self) -> float: ... + + def getMarkerLength(self) -> float: ... + + def getChessboardCorners(self) -> _typing.Sequence[cv2.typing.Point3f]: ... + + @_typing.overload + def checkCharucoCornersCollinear(self, charucoIds: cv2.typing.MatLike) -> bool: ... + @_typing.overload + def checkCharucoCornersCollinear(self, charucoIds: cv2.UMat) -> bool: ... + + +class DetectorParameters: + adaptiveThreshWinSizeMin: int + adaptiveThreshWinSizeMax: int + adaptiveThreshWinSizeStep: int + adaptiveThreshConstant: float + minMarkerPerimeterRate: float + maxMarkerPerimeterRate: float + polygonalApproxAccuracyRate: float + minCornerDistanceRate: float + minDistanceToBorder: int + minMarkerDistanceRate: float + minGroupDistance: float + cornerRefinementMethod: int + cornerRefinementWinSize: int + relativeCornerRefinmentWinSize: float + cornerRefinementMaxIterations: int + cornerRefinementMinAccuracy: float + markerBorderBits: int + perspectiveRemovePixelPerCell: int + perspectiveRemoveIgnoredMarginPerCell: float + maxErroneousBitsInBorderRate: float + minOtsuStdDev: float + errorCorrectionRate: float + aprilTagQuadDecimate: float + aprilTagQuadSigma: float + aprilTagMinClusterPixels: int + aprilTagMaxNmaxima: int + aprilTagCriticalRad: float + aprilTagMaxLineFitMse: float + aprilTagMinWhiteBlackDiff: int + aprilTagDeglitch: int + detectInvertedMarker: bool + useAruco3Detection: bool + minSideLengthCanonicalImg: int + minMarkerLengthRatioOriginalImg: float + + # Functions + def __init__(self) -> None: ... + + def readDetectorParameters(self, fn: cv2.FileNode) -> bool: ... + + def writeDetectorParameters(self, fs: cv2.FileStorage, name: str = ...) -> bool: ... + + +class RefineParameters: + minRepDistance: float + errorCorrectionRate: float + checkAllOrders: bool + + # Functions + def __init__(self, minRepDistance: float = ..., errorCorrectionRate: float = ..., checkAllOrders: bool = ...) -> None: ... + + def readRefineParameters(self, fn: cv2.FileNode) -> bool: ... + + def writeRefineParameters(self, fs: cv2.FileStorage, name: str = ...) -> bool: ... + + +class ArucoDetector(cv2.Algorithm): + # Functions + @_typing.overload + def __init__(self, dictionary: Dictionary = ..., detectorParams: DetectorParameters = ..., refineParams: RefineParameters = ...) -> None: ... + @_typing.overload + def __init__(self, dictionaries: _typing.Sequence[Dictionary], detectorParams: DetectorParameters = ..., refineParams: RefineParameters = ...) -> None: ... + + @_typing.overload + def detectMarkers(self, image: cv2.typing.MatLike, corners: _typing.Sequence[cv2.typing.MatLike] | None = ..., ids: cv2.typing.MatLike | None = ..., rejectedImgPoints: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike]]: ... + @_typing.overload + def detectMarkers(self, image: cv2.UMat, corners: _typing.Sequence[cv2.UMat] | None = ..., ids: cv2.UMat | None = ..., rejectedImgPoints: _typing.Sequence[cv2.UMat] | None = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat, _typing.Sequence[cv2.UMat]]: ... + + @_typing.overload + def refineDetectedMarkers(self, image: cv2.typing.MatLike, board: Board, detectedCorners: _typing.Sequence[cv2.typing.MatLike], detectedIds: cv2.typing.MatLike, rejectedCorners: _typing.Sequence[cv2.typing.MatLike], cameraMatrix: cv2.typing.MatLike | None = ..., distCoeffs: cv2.typing.MatLike | None = ..., recoveredIdxs: cv2.typing.MatLike | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike]: ... + @_typing.overload + def refineDetectedMarkers(self, image: cv2.UMat, board: Board, detectedCorners: _typing.Sequence[cv2.UMat], detectedIds: cv2.UMat, rejectedCorners: _typing.Sequence[cv2.UMat], cameraMatrix: cv2.UMat | None = ..., distCoeffs: cv2.UMat | None = ..., recoveredIdxs: cv2.UMat | None = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat, _typing.Sequence[cv2.UMat], cv2.UMat]: ... + + @_typing.overload + def detectMarkersMultiDict(self, image: cv2.typing.MatLike, corners: _typing.Sequence[cv2.typing.MatLike] | None = ..., ids: cv2.typing.MatLike | None = ..., rejectedImgPoints: _typing.Sequence[cv2.typing.MatLike] | None = ..., dictIndices: cv2.typing.MatLike | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike]: ... + @_typing.overload + def detectMarkersMultiDict(self, image: cv2.UMat, corners: _typing.Sequence[cv2.UMat] | None = ..., ids: cv2.UMat | None = ..., rejectedImgPoints: _typing.Sequence[cv2.UMat] | None = ..., dictIndices: cv2.UMat | None = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat, _typing.Sequence[cv2.UMat], cv2.UMat]: ... + + def getDictionary(self) -> Dictionary: ... + + def setDictionary(self, dictionary: Dictionary) -> None: ... + + def getDictionaries(self) -> _typing.Sequence[Dictionary]: ... + + def setDictionaries(self, dictionaries: _typing.Sequence[Dictionary]) -> None: ... + + def getDetectorParameters(self) -> DetectorParameters: ... + + def setDetectorParameters(self, detectorParameters: DetectorParameters) -> None: ... + + def getRefineParameters(self) -> RefineParameters: ... + + def setRefineParameters(self, refineParameters: RefineParameters) -> None: ... + + def write(self, fs: cv2.FileStorage, name: str) -> None: ... + + def read(self, fn: cv2.FileNode) -> None: ... + + +class Dictionary: + bytesList: cv2.typing.MatLike + markerSize: int + maxCorrectionBits: int + + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, bytesList: cv2.typing.MatLike, _markerSize: int, maxcorr: int = ...) -> None: ... + + def readDictionary(self, fn: cv2.FileNode) -> bool: ... + + def writeDictionary(self, fs: cv2.FileStorage, name: str = ...) -> None: ... + + def identify(self, onlyBits: cv2.typing.MatLike, maxCorrectionRate: float) -> tuple[bool, int, int]: ... + + @_typing.overload + def getDistanceToId(self, bits: cv2.typing.MatLike, id: int, allRotations: bool = ...) -> int: ... + @_typing.overload + def getDistanceToId(self, bits: cv2.UMat, id: int, allRotations: bool = ...) -> int: ... + + @_typing.overload + def generateImageMarker(self, id: int, sidePixels: int, _img: cv2.typing.MatLike | None = ..., borderBits: int = ...) -> cv2.typing.MatLike: ... + @_typing.overload + def generateImageMarker(self, id: int, sidePixels: int, _img: cv2.UMat | None = ..., borderBits: int = ...) -> cv2.UMat: ... + + @staticmethod + def getByteListFromBits(bits: cv2.typing.MatLike) -> cv2.typing.MatLike: ... + + @staticmethod + def getBitsFromByteList(byteList: cv2.typing.MatLike, markerSize: int) -> cv2.typing.MatLike: ... + + +class CharucoParameters: + cameraMatrix: cv2.typing.MatLike + distCoeffs: cv2.typing.MatLike + minMarkers: int + tryRefineMarkers: bool + checkMarkers: bool + + # Functions + def __init__(self) -> None: ... + + +class CharucoDetector(cv2.Algorithm): + # Functions + def __init__(self, board: CharucoBoard, charucoParams: CharucoParameters = ..., detectorParams: DetectorParameters = ..., refineParams: RefineParameters = ...) -> None: ... + + def getBoard(self) -> CharucoBoard: ... + + def setBoard(self, board: CharucoBoard) -> None: ... + + def getCharucoParameters(self) -> CharucoParameters: ... + + def setCharucoParameters(self, charucoParameters: CharucoParameters) -> None: ... + + def getDetectorParameters(self) -> DetectorParameters: ... + + def setDetectorParameters(self, detectorParameters: DetectorParameters) -> None: ... + + def getRefineParameters(self) -> RefineParameters: ... + + def setRefineParameters(self, refineParameters: RefineParameters) -> None: ... + + @_typing.overload + def detectBoard(self, image: cv2.typing.MatLike, charucoCorners: cv2.typing.MatLike | None = ..., charucoIds: cv2.typing.MatLike | None = ..., markerCorners: _typing.Sequence[cv2.typing.MatLike] | None = ..., markerIds: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike]: ... + @_typing.overload + def detectBoard(self, image: cv2.UMat, charucoCorners: cv2.UMat | None = ..., charucoIds: cv2.UMat | None = ..., markerCorners: _typing.Sequence[cv2.UMat] | None = ..., markerIds: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], cv2.UMat]: ... + + @_typing.overload + def detectDiamonds(self, image: cv2.typing.MatLike, diamondCorners: _typing.Sequence[cv2.typing.MatLike] | None = ..., diamondIds: cv2.typing.MatLike | None = ..., markerCorners: _typing.Sequence[cv2.typing.MatLike] | None = ..., markerIds: cv2.typing.MatLike | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike]: ... + @_typing.overload + def detectDiamonds(self, image: cv2.UMat, diamondCorners: _typing.Sequence[cv2.UMat] | None = ..., diamondIds: cv2.UMat | None = ..., markerCorners: _typing.Sequence[cv2.UMat] | None = ..., markerIds: cv2.UMat | None = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat, _typing.Sequence[cv2.UMat], cv2.UMat]: ... + + + +# Functions +@_typing.overload +def drawDetectedCornersCharuco(image: cv2.typing.MatLike, charucoCorners: cv2.typing.MatLike, charucoIds: cv2.typing.MatLike | None = ..., cornerColor: cv2.typing.Scalar = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def drawDetectedCornersCharuco(image: cv2.UMat, charucoCorners: cv2.UMat, charucoIds: cv2.UMat | None = ..., cornerColor: cv2.typing.Scalar = ...) -> cv2.UMat: ... + +@_typing.overload +def drawDetectedDiamonds(image: cv2.typing.MatLike, diamondCorners: _typing.Sequence[cv2.typing.MatLike], diamondIds: cv2.typing.MatLike | None = ..., borderColor: cv2.typing.Scalar = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def drawDetectedDiamonds(image: cv2.UMat, diamondCorners: _typing.Sequence[cv2.UMat], diamondIds: cv2.UMat | None = ..., borderColor: cv2.typing.Scalar = ...) -> cv2.UMat: ... + +@_typing.overload +def drawDetectedMarkers(image: cv2.typing.MatLike, corners: _typing.Sequence[cv2.typing.MatLike], ids: cv2.typing.MatLike | None = ..., borderColor: cv2.typing.Scalar = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def drawDetectedMarkers(image: cv2.UMat, corners: _typing.Sequence[cv2.UMat], ids: cv2.UMat | None = ..., borderColor: cv2.typing.Scalar = ...) -> cv2.UMat: ... + +def extendDictionary(nMarkers: int, markerSize: int, baseDictionary: Dictionary = ..., randomSeed: int = ...) -> Dictionary: ... + +@_typing.overload +def generateImageMarker(dictionary: Dictionary, id: int, sidePixels: int, img: cv2.typing.MatLike | None = ..., borderBits: int = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def generateImageMarker(dictionary: Dictionary, id: int, sidePixels: int, img: cv2.UMat | None = ..., borderBits: int = ...) -> cv2.UMat: ... + +def getPredefinedDictionary(dict: int) -> Dictionary: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/barcode/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/barcode/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..2f494ae93a524cfd9daf52f666fa23d2b142ec33 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/barcode/__init__.pyi @@ -0,0 +1,39 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +# Classes +class BarcodeDetector(cv2.GraphicalCodeDetector): + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, prototxt_path: str, model_path: str) -> None: ... + + @_typing.overload + def decodeWithType(self, img: cv2.typing.MatLike, points: cv2.typing.MatLike) -> tuple[bool, _typing.Sequence[str], _typing.Sequence[str]]: ... + @_typing.overload + def decodeWithType(self, img: cv2.UMat, points: cv2.UMat) -> tuple[bool, _typing.Sequence[str], _typing.Sequence[str]]: ... + + @_typing.overload + def detectAndDecodeWithType(self, img: cv2.typing.MatLike, points: cv2.typing.MatLike | None = ...) -> tuple[bool, _typing.Sequence[str], _typing.Sequence[str], cv2.typing.MatLike]: ... + @_typing.overload + def detectAndDecodeWithType(self, img: cv2.UMat, points: cv2.UMat | None = ...) -> tuple[bool, _typing.Sequence[str], _typing.Sequence[str], cv2.UMat]: ... + + def getDownsamplingThreshold(self) -> float: ... + + def setDownsamplingThreshold(self, thresh: float) -> BarcodeDetector: ... + + def getDetectorScales(self) -> _typing.Sequence[float]: ... + + def setDetectorScales(self, sizes: _typing.Sequence[float]) -> BarcodeDetector: ... + + def getGradientThreshold(self) -> float: ... + + def setGradientThreshold(self, thresh: float) -> BarcodeDetector: ... + + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/cuda/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/cuda/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..bcf5337997bf9a6278d0b816552dd418cedd4f83 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/cuda/__init__.pyi @@ -0,0 +1,513 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +# Enumerations +FEATURE_SET_COMPUTE_10: int +FEATURE_SET_COMPUTE_11: int +FEATURE_SET_COMPUTE_12: int +FEATURE_SET_COMPUTE_13: int +FEATURE_SET_COMPUTE_20: int +FEATURE_SET_COMPUTE_21: int +FEATURE_SET_COMPUTE_30: int +FEATURE_SET_COMPUTE_32: int +FEATURE_SET_COMPUTE_35: int +FEATURE_SET_COMPUTE_50: int +GLOBAL_ATOMICS: int +SHARED_ATOMICS: int +NATIVE_DOUBLE: int +WARP_SHUFFLE_FUNCTIONS: int +DYNAMIC_PARALLELISM: int +FeatureSet = int +"""One of [FEATURE_SET_COMPUTE_10, FEATURE_SET_COMPUTE_11, FEATURE_SET_COMPUTE_12, FEATURE_SET_COMPUTE_13, FEATURE_SET_COMPUTE_20, FEATURE_SET_COMPUTE_21, FEATURE_SET_COMPUTE_30, FEATURE_SET_COMPUTE_32, FEATURE_SET_COMPUTE_35, FEATURE_SET_COMPUTE_50, GLOBAL_ATOMICS, SHARED_ATOMICS, NATIVE_DOUBLE, WARP_SHUFFLE_FUNCTIONS, DYNAMIC_PARALLELISM]""" + + +HostMem_PAGE_LOCKED: int +HOST_MEM_PAGE_LOCKED: int +HostMem_SHARED: int +HOST_MEM_SHARED: int +HostMem_WRITE_COMBINED: int +HOST_MEM_WRITE_COMBINED: int +HostMem_AllocType = int +"""One of [HostMem_PAGE_LOCKED, HOST_MEM_PAGE_LOCKED, HostMem_SHARED, HOST_MEM_SHARED, HostMem_WRITE_COMBINED, HOST_MEM_WRITE_COMBINED]""" + +Event_DEFAULT: int +EVENT_DEFAULT: int +Event_BLOCKING_SYNC: int +EVENT_BLOCKING_SYNC: int +Event_DISABLE_TIMING: int +EVENT_DISABLE_TIMING: int +Event_INTERPROCESS: int +EVENT_INTERPROCESS: int +Event_CreateFlags = int +"""One of [Event_DEFAULT, EVENT_DEFAULT, Event_BLOCKING_SYNC, EVENT_BLOCKING_SYNC, Event_DISABLE_TIMING, EVENT_DISABLE_TIMING, Event_INTERPROCESS, EVENT_INTERPROCESS]""" + +DeviceInfo_ComputeModeDefault: int +DEVICE_INFO_COMPUTE_MODE_DEFAULT: int +DeviceInfo_ComputeModeExclusive: int +DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE: int +DeviceInfo_ComputeModeProhibited: int +DEVICE_INFO_COMPUTE_MODE_PROHIBITED: int +DeviceInfo_ComputeModeExclusiveProcess: int +DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE_PROCESS: int +DeviceInfo_ComputeMode = int +"""One of [DeviceInfo_ComputeModeDefault, DEVICE_INFO_COMPUTE_MODE_DEFAULT, DeviceInfo_ComputeModeExclusive, DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE, DeviceInfo_ComputeModeProhibited, DEVICE_INFO_COMPUTE_MODE_PROHIBITED, DeviceInfo_ComputeModeExclusiveProcess, DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE_PROCESS]""" + + +# Classes +class GpuMat: + @property + def step(self) -> int: ... + + # Classes + class Allocator: + ... + + + # Functions + @_typing.overload + def __init__(self, allocator: GpuMat.Allocator = ...) -> None: ... + @_typing.overload + def __init__(self, rows: int, cols: int, type: int, allocator: GpuMat.Allocator = ...) -> None: ... + @_typing.overload + def __init__(self, size: cv2.typing.Size, type: int, allocator: GpuMat.Allocator = ...) -> None: ... + @_typing.overload + def __init__(self, rows: int, cols: int, type: int, s: cv2.typing.Scalar, allocator: GpuMat.Allocator = ...) -> None: ... + @_typing.overload + def __init__(self, size: cv2.typing.Size, type: int, s: cv2.typing.Scalar, allocator: GpuMat.Allocator = ...) -> None: ... + @_typing.overload + def __init__(self, m: GpuMat) -> None: ... + @_typing.overload + def __init__(self, m: GpuMat, rowRange: cv2.typing.Range, colRange: cv2.typing.Range) -> None: ... + @_typing.overload + def __init__(self, m: GpuMat, roi: cv2.typing.Rect) -> None: ... + @_typing.overload + def __init__(self, arr: cv2.typing.MatLike, allocator: GpuMat.Allocator = ...) -> None: ... + @_typing.overload + def __init__(self, arr: GpuMat, allocator: GpuMat.Allocator = ...) -> None: ... + @_typing.overload + def __init__(self, arr: cv2.UMat, allocator: GpuMat.Allocator = ...) -> None: ... + + @staticmethod + def defaultAllocator() -> GpuMat.Allocator: ... + + @staticmethod + def setDefaultAllocator(allocator: GpuMat.Allocator) -> None: ... + + @staticmethod + def getStdAllocator() -> GpuMat.Allocator: ... + + @_typing.overload + def create(self, rows: int, cols: int, type: int) -> None: ... + @_typing.overload + def create(self, size: cv2.typing.Size, type: int) -> None: ... + + def release(self) -> None: ... + + def swap(self, mat: GpuMat) -> None: ... + + @_typing.overload + def upload(self, arr: cv2.typing.MatLike) -> None: ... + @_typing.overload + def upload(self, arr: GpuMat) -> None: ... + @_typing.overload + def upload(self, arr: cv2.UMat) -> None: ... + @_typing.overload + def upload(self, arr: cv2.typing.MatLike, stream: Stream) -> None: ... + @_typing.overload + def upload(self, arr: GpuMat, stream: Stream) -> None: ... + @_typing.overload + def upload(self, arr: cv2.UMat, stream: Stream) -> None: ... + + @_typing.overload + def download(self, dst: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ... + @_typing.overload + def download(self, dst: GpuMat | None = ...) -> GpuMat: ... + @_typing.overload + def download(self, dst: cv2.UMat | None = ...) -> cv2.UMat: ... + @_typing.overload + def download(self, stream: Stream, dst: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ... + @_typing.overload + def download(self, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ... + @_typing.overload + def download(self, stream: Stream, dst: cv2.UMat | None = ...) -> cv2.UMat: ... + + def clone(self) -> GpuMat: ... + + @_typing.overload + def copyTo(self, dst: GpuMat | None = ...) -> GpuMat: ... + @_typing.overload + def copyTo(self, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ... + @_typing.overload + def copyTo(self, mask: GpuMat, dst: GpuMat | None = ...) -> GpuMat: ... + @_typing.overload + def copyTo(self, mask: GpuMat, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ... + + @_typing.overload + def setTo(self, s: cv2.typing.Scalar) -> GpuMat: ... + @_typing.overload + def setTo(self, s: cv2.typing.Scalar, stream: Stream) -> GpuMat: ... + @_typing.overload + def setTo(self, s: cv2.typing.Scalar, mask: cv2.typing.MatLike) -> GpuMat: ... + @_typing.overload + def setTo(self, s: cv2.typing.Scalar, mask: GpuMat) -> GpuMat: ... + @_typing.overload + def setTo(self, s: cv2.typing.Scalar, mask: cv2.UMat) -> GpuMat: ... + @_typing.overload + def setTo(self, s: cv2.typing.Scalar, mask: cv2.typing.MatLike, stream: Stream) -> GpuMat: ... + @_typing.overload + def setTo(self, s: cv2.typing.Scalar, mask: GpuMat, stream: Stream) -> GpuMat: ... + @_typing.overload + def setTo(self, s: cv2.typing.Scalar, mask: cv2.UMat, stream: Stream) -> GpuMat: ... + + @_typing.overload + def convertTo(self, rtype: int, dst: GpuMat | None = ...) -> GpuMat: ... + @_typing.overload + def convertTo(self, rtype: int, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ... + @_typing.overload + def convertTo(self, rtype: int, dst: GpuMat | None = ..., alpha: float = ..., beta: float = ...) -> GpuMat: ... + @_typing.overload + def convertTo(self, rtype: int, alpha: float, beta: float, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ... + + def assignTo(self, m: GpuMat, type: int = ...) -> None: ... + + def row(self, y: int) -> GpuMat: ... + + def col(self, x: int) -> GpuMat: ... + + @_typing.overload + def rowRange(self, startrow: int, endrow: int) -> GpuMat: ... + @_typing.overload + def rowRange(self, r: cv2.typing.Range) -> GpuMat: ... + + @_typing.overload + def colRange(self, startcol: int, endcol: int) -> GpuMat: ... + @_typing.overload + def colRange(self, r: cv2.typing.Range) -> GpuMat: ... + + def reshape(self, cn: int, rows: int = ...) -> GpuMat: ... + + def locateROI(self, wholeSize: cv2.typing.Size, ofs: cv2.typing.Point) -> None: ... + + def adjustROI(self, dtop: int, dbottom: int, dleft: int, dright: int) -> GpuMat: ... + + def isContinuous(self) -> bool: ... + + def elemSize(self) -> int: ... + + def elemSize1(self) -> int: ... + + def type(self) -> int: ... + + def depth(self) -> int: ... + + def channels(self) -> int: ... + + def step1(self) -> int: ... + + def size(self) -> cv2.typing.Size: ... + + def empty(self) -> bool: ... + + def cudaPtr(self) -> cv2.typing.IntPointer: ... + + def updateContinuityFlag(self) -> None: ... + + +class GpuData: + ... + +class GpuMatND: + ... + +class BufferPool: + # Functions + def __init__(self, stream: Stream) -> None: ... + + @_typing.overload + def getBuffer(self, rows: int, cols: int, type: int) -> GpuMat: ... + @_typing.overload + def getBuffer(self, size: cv2.typing.Size, type: int) -> GpuMat: ... + + def getAllocator(self) -> GpuMat.Allocator: ... + + +class HostMem: + @property + def step(self) -> int: ... + + # Functions + @_typing.overload + def __init__(self, alloc_type: HostMem_AllocType = ...) -> None: ... + @_typing.overload + def __init__(self, rows: int, cols: int, type: int, alloc_type: HostMem_AllocType = ...) -> None: ... + @_typing.overload + def __init__(self, size: cv2.typing.Size, type: int, alloc_type: HostMem_AllocType = ...) -> None: ... + @_typing.overload + def __init__(self, arr: cv2.typing.MatLike, alloc_type: HostMem_AllocType = ...) -> None: ... + @_typing.overload + def __init__(self, arr: GpuMat, alloc_type: HostMem_AllocType = ...) -> None: ... + @_typing.overload + def __init__(self, arr: cv2.UMat, alloc_type: HostMem_AllocType = ...) -> None: ... + + def swap(self, b: HostMem) -> None: ... + + def clone(self) -> HostMem: ... + + def create(self, rows: int, cols: int, type: int) -> None: ... + + def reshape(self, cn: int, rows: int = ...) -> HostMem: ... + + def createMatHeader(self) -> cv2.typing.MatLike: ... + + def isContinuous(self) -> bool: ... + + def elemSize(self) -> int: ... + + def elemSize1(self) -> int: ... + + def type(self) -> int: ... + + def depth(self) -> int: ... + + def channels(self) -> int: ... + + def step1(self) -> int: ... + + def size(self) -> cv2.typing.Size: ... + + def empty(self) -> bool: ... + + +class Stream: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, allocator: GpuMat.Allocator) -> None: ... + @_typing.overload + def __init__(self, cudaFlags: int) -> None: ... + + def queryIfComplete(self) -> bool: ... + + def waitForCompletion(self) -> None: ... + + def waitEvent(self, event: Event) -> None: ... + + @classmethod + def Null(cls) -> Stream: ... + + def cudaPtr(self) -> cv2.typing.IntPointer: ... + + +class Event: + # Functions + def __init__(self, flags: Event_CreateFlags = ...) -> None: ... + + def record(self, stream: Stream = ...) -> None: ... + + def queryIfComplete(self) -> bool: ... + + def waitForCompletion(self) -> None: ... + + @staticmethod + def elapsedTime(start: Event, end: Event) -> float: ... + + +class TargetArchs: + # Functions + @staticmethod + def has(major: int, minor: int) -> bool: ... + + @staticmethod + def hasPtx(major: int, minor: int) -> bool: ... + + @staticmethod + def hasBin(major: int, minor: int) -> bool: ... + + @staticmethod + def hasEqualOrLessPtx(major: int, minor: int) -> bool: ... + + @staticmethod + def hasEqualOrGreater(major: int, minor: int) -> bool: ... + + @staticmethod + def hasEqualOrGreaterPtx(major: int, minor: int) -> bool: ... + + @staticmethod + def hasEqualOrGreaterBin(major: int, minor: int) -> bool: ... + + +class DeviceInfo: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, device_id: int) -> None: ... + + def deviceID(self) -> int: ... + + def totalGlobalMem(self) -> int: ... + + def sharedMemPerBlock(self) -> int: ... + + def regsPerBlock(self) -> int: ... + + def warpSize(self) -> int: ... + + def memPitch(self) -> int: ... + + def maxThreadsPerBlock(self) -> int: ... + + def maxThreadsDim(self) -> cv2.typing.Vec3i: ... + + def maxGridSize(self) -> cv2.typing.Vec3i: ... + + def clockRate(self) -> int: ... + + def totalConstMem(self) -> int: ... + + def majorVersion(self) -> int: ... + + def minorVersion(self) -> int: ... + + def textureAlignment(self) -> int: ... + + def texturePitchAlignment(self) -> int: ... + + def multiProcessorCount(self) -> int: ... + + def kernelExecTimeoutEnabled(self) -> bool: ... + + def integrated(self) -> bool: ... + + def canMapHostMemory(self) -> bool: ... + + def computeMode(self) -> DeviceInfo_ComputeMode: ... + + def maxTexture1D(self) -> int: ... + + def maxTexture1DMipmap(self) -> int: ... + + def maxTexture1DLinear(self) -> int: ... + + def maxTexture2D(self) -> cv2.typing.Vec2i: ... + + def maxTexture2DMipmap(self) -> cv2.typing.Vec2i: ... + + def maxTexture2DLinear(self) -> cv2.typing.Vec3i: ... + + def maxTexture2DGather(self) -> cv2.typing.Vec2i: ... + + def maxTexture3D(self) -> cv2.typing.Vec3i: ... + + def maxTextureCubemap(self) -> int: ... + + def maxTexture1DLayered(self) -> cv2.typing.Vec2i: ... + + def maxTexture2DLayered(self) -> cv2.typing.Vec3i: ... + + def maxTextureCubemapLayered(self) -> cv2.typing.Vec2i: ... + + def maxSurface1D(self) -> int: ... + + def maxSurface2D(self) -> cv2.typing.Vec2i: ... + + def maxSurface3D(self) -> cv2.typing.Vec3i: ... + + def maxSurface1DLayered(self) -> cv2.typing.Vec2i: ... + + def maxSurface2DLayered(self) -> cv2.typing.Vec3i: ... + + def maxSurfaceCubemap(self) -> int: ... + + def maxSurfaceCubemapLayered(self) -> cv2.typing.Vec2i: ... + + def surfaceAlignment(self) -> int: ... + + def concurrentKernels(self) -> bool: ... + + def ECCEnabled(self) -> bool: ... + + def pciBusID(self) -> int: ... + + def pciDeviceID(self) -> int: ... + + def pciDomainID(self) -> int: ... + + def tccDriver(self) -> bool: ... + + def asyncEngineCount(self) -> int: ... + + def unifiedAddressing(self) -> bool: ... + + def memoryClockRate(self) -> int: ... + + def memoryBusWidth(self) -> int: ... + + def l2CacheSize(self) -> int: ... + + def maxThreadsPerMultiProcessor(self) -> int: ... + + def queryMemory(self, totalMemory: int, freeMemory: int) -> None: ... + + def freeMemory(self) -> int: ... + + def totalMemory(self) -> int: ... + + def isCompatible(self) -> bool: ... + + + +# Functions +@_typing.overload +def createContinuous(rows: int, cols: int, type: int, arr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def createContinuous(rows: int, cols: int, type: int, arr: GpuMat | None = ...) -> GpuMat: ... +@_typing.overload +def createContinuous(rows: int, cols: int, type: int, arr: cv2.UMat | None = ...) -> cv2.UMat: ... + +@_typing.overload +def createGpuMatFromCudaMemory(rows: int, cols: int, type: int, cudaMemoryAddress: int, step: int = ...) -> GpuMat: ... +@_typing.overload +def createGpuMatFromCudaMemory(size: cv2.typing.Size, type: int, cudaMemoryAddress: int, step: int = ...) -> GpuMat: ... + +@_typing.overload +def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: GpuMat | None = ...) -> GpuMat: ... +@_typing.overload +def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: cv2.UMat | None = ...) -> cv2.UMat: ... + +def fastNlMeansDenoising(src: GpuMat, h: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., stream: Stream = ...) -> GpuMat: ... + +def fastNlMeansDenoisingColored(src: GpuMat, h_luminance: float, photo_render: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., stream: Stream = ...) -> GpuMat: ... + +def getCudaEnabledDeviceCount() -> int: ... + +def getDevice() -> int: ... + +def nonLocalMeans(src: GpuMat, h: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., borderMode: int = ..., stream: Stream = ...) -> GpuMat: ... + +def printCudaDeviceInfo(device: int) -> None: ... + +def printShortCudaDeviceInfo(device: int) -> None: ... + +def registerPageLocked(m: cv2.typing.MatLike) -> None: ... + +def resetDevice() -> None: ... + +def setBufferPoolConfig(deviceId: int, stackSize: int, stackCount: int) -> None: ... + +def setBufferPoolUsage(on: bool) -> None: ... + +def setDevice(device: int) -> None: ... + +def unregisterPageLocked(m: cv2.typing.MatLike) -> None: ... + +def wrapStream(cudaStreamMemoryAddress: int) -> Stream: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1cad2750a50da66bc344a874d527c5452a24d5b1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/__init__.py @@ -0,0 +1,3 @@ +import os + +haarcascades = os.path.join(os.path.dirname(__file__), "") diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48281a110ea9760c987490cbf537d81ab4da2e4f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_eye.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_eye.xml new file mode 100644 index 0000000000000000000000000000000000000000..b21e3b93d74b5130b5a1323be9fc46017ab0e8c7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_eye.xml @@ -0,0 +1,12213 @@ + + + +BOOST + HAAR + 20 + 20 + + 93 + + 0 + 24 + + <_> + 6 + -1.4562760591506958e+00 + + <_> + + 0 -1 0 1.2963959574699402e-01 + + -7.7304208278656006e-01 6.8350148200988770e-01 + <_> + + 0 -1 1 -4.6326808631420135e-02 + + 5.7352751493453979e-01 -4.9097689986228943e-01 + <_> + + 0 -1 2 -1.6173090785741806e-02 + + 6.0254341363906860e-01 -3.1610709428787231e-01 + <_> + + 0 -1 3 -4.5828841626644135e-02 + + 6.4177548885345459e-01 -1.5545040369033813e-01 + <_> + + 0 -1 4 -5.3759619593620300e-02 + + 5.4219317436218262e-01 -2.0480829477310181e-01 + <_> + + 0 -1 5 3.4171190112829208e-02 + + -2.3388190567493439e-01 4.8410901427268982e-01 + <_> + 12 + -1.2550230026245117e+00 + + <_> + + 0 -1 6 -2.1727620065212250e-01 + + 7.1098899841308594e-01 -5.9360730648040771e-01 + <_> + + 0 -1 7 1.2071969918906689e-02 + + -2.8240481019020081e-01 5.9013551473617554e-01 + <_> + + 0 -1 8 -1.7854139208793640e-02 + + 5.3137522935867310e-01 -2.2758960723876953e-01 + <_> + + 0 -1 9 2.2333610802888870e-02 + + -1.7556099593639374e-01 6.3356137275695801e-01 + <_> + + 0 -1 10 -9.1420017182826996e-02 + + 6.1563092470169067e-01 -1.6899530589580536e-01 + <_> + + 0 -1 11 2.8973650187253952e-02 + + -1.2250079959630966e-01 7.4401170015335083e-01 + <_> + + 0 -1 12 7.8203463926911354e-03 + + 1.6974370181560516e-01 -6.5441650152206421e-01 + <_> + + 0 -1 13 2.0340489223599434e-02 + + -1.2556649744510651e-01 8.2710450887680054e-01 + <_> + + 0 -1 14 -1.1926149949431419e-02 + + 3.8605681061744690e-01 -2.0992340147495270e-01 + <_> + + 0 -1 15 -9.7281101625412703e-04 + + -6.3761192560195923e-01 1.2952390313148499e-01 + <_> + + 0 -1 16 1.8322050891583785e-05 + + -3.4631478786468506e-01 2.2924269735813141e-01 + <_> + + 0 -1 17 -8.0854417756199837e-03 + + -6.3665801286697388e-01 1.3078659772872925e-01 + <_> + 9 + -1.3728189468383789e+00 + + <_> + + 0 -1 18 -1.1812269687652588e-01 + + 6.7844521999359131e-01 -5.0045782327651978e-01 + <_> + + 0 -1 19 -3.4332759678363800e-02 + + 6.7186361551284790e-01 -3.5744878649711609e-01 + <_> + + 0 -1 20 -2.1530799567699432e-02 + + 7.2220700979232788e-01 -1.8192419409751892e-01 + <_> + + 0 -1 21 -2.1909970790147781e-02 + + 6.6529387235641479e-01 -2.7510228753089905e-01 + <_> + + 0 -1 22 -2.8713539242744446e-02 + + 6.9955700635910034e-01 -1.9615580141544342e-01 + <_> + + 0 -1 23 -1.1467480100691319e-02 + + 5.9267348051071167e-01 -2.2097350656986237e-01 + <_> + + 0 -1 24 -2.2611169144511223e-02 + + 3.4483069181442261e-01 -3.8379558920860291e-01 + <_> + + 0 -1 25 -1.9308089977130294e-03 + + -7.9445719718933105e-01 1.5628659725189209e-01 + <_> + + 0 -1 26 5.6419910833938047e-05 + + -3.0896010994911194e-01 3.5431089997291565e-01 + <_> + 16 + -1.2879480123519897e+00 + + <_> + + 0 -1 27 1.9886520504951477e-01 + + -5.2860701084136963e-01 3.5536721348762512e-01 + <_> + + 0 -1 28 -3.6008939146995544e-02 + + 4.2109689116477966e-01 -3.9348980784416199e-01 + <_> + + 0 -1 29 -7.7569849789142609e-02 + + 4.7991541028022766e-01 -2.5122168660163879e-01 + <_> + + 0 -1 30 8.2630853285081685e-05 + + -3.8475489616394043e-01 3.1849220395088196e-01 + <_> + + 0 -1 31 3.2773229759186506e-04 + + -2.6427319645881653e-01 3.2547241449356079e-01 + <_> + + 0 -1 32 -1.8574850633740425e-02 + + 4.6736589074134827e-01 -1.5067270398139954e-01 + <_> + + 0 -1 33 -7.0008762122597545e-05 + + 2.9313150048255920e-01 -2.5365099310874939e-01 + <_> + + 0 -1 34 -1.8552130088210106e-02 + + 4.6273660659790039e-01 -1.3148050010204315e-01 + <_> + + 0 -1 35 -1.3030420057475567e-02 + + 4.1627219319343567e-01 -1.7751489579677582e-01 + <_> + + 0 -1 36 6.5694141085259616e-05 + + -2.8035101294517517e-01 2.6680740714073181e-01 + <_> + + 0 -1 37 1.7005260451696813e-04 + + -2.7027249336242676e-01 2.3981650173664093e-01 + <_> + + 0 -1 38 -3.3129199873656034e-03 + + 4.4411438703536987e-01 -1.4428889751434326e-01 + <_> + + 0 -1 39 1.7583490116521716e-03 + + -1.6126190125942230e-01 4.2940768599510193e-01 + <_> + + 0 -1 40 -2.5194749236106873e-02 + + 4.0687298774719238e-01 -1.8202580511569977e-01 + <_> + + 0 -1 41 1.4031709870323539e-03 + + 8.4759786725044250e-02 -8.0018568038940430e-01 + <_> + + 0 -1 42 -7.3991729877889156e-03 + + 5.5766099691390991e-01 -1.1843159794807434e-01 + <_> + 23 + -1.2179850339889526e+00 + + <_> + + 0 -1 43 -2.9943080618977547e-02 + + 3.5810810327529907e-01 -3.8487631082534790e-01 + <_> + + 0 -1 44 -1.2567380070686340e-01 + + 3.9316931366920471e-01 -3.0012258887290955e-01 + <_> + + 0 -1 45 5.3635272197425365e-03 + + -4.3908619880676270e-01 1.9257010519504547e-01 + <_> + + 0 -1 46 -8.0971820279955864e-03 + + 3.9906668663024902e-01 -2.3407870531082153e-01 + <_> + + 0 -1 47 -1.6597909852862358e-02 + + 4.2095288634300232e-01 -2.2674840688705444e-01 + <_> + + 0 -1 48 -2.0199299324303865e-03 + + -7.4156731367111206e-01 1.2601189315319061e-01 + <_> + + 0 -1 49 -1.5202340437099338e-03 + + -7.6154601573944092e-01 8.6373612284660339e-02 + <_> + + 0 -1 50 -4.9663940444588661e-03 + + 4.2182239890098572e-01 -1.7904919385910034e-01 + <_> + + 0 -1 51 -1.9207600504159927e-02 + + 4.6894899010658264e-01 -1.4378750324249268e-01 + <_> + + 0 -1 52 -1.2222680263221264e-02 + + 3.2842078804969788e-01 -2.1802149713039398e-01 + <_> + + 0 -1 53 5.7548668235540390e-02 + + -3.6768808960914612e-01 2.4357110261917114e-01 + <_> + + 0 -1 54 -9.5794079825282097e-03 + + -7.2245067358016968e-01 6.3664563000202179e-02 + <_> + + 0 -1 55 -2.9545740690082312e-03 + + 3.5846439003944397e-01 -1.6696329414844513e-01 + <_> + + 0 -1 56 -4.2017991654574871e-03 + + 3.9094808697700500e-01 -1.2041790038347244e-01 + <_> + + 0 -1 57 -1.3624990358948708e-02 + + -5.8767718076705933e-01 8.8404729962348938e-02 + <_> + + 0 -1 58 6.2853112467564642e-05 + + -2.6348459720611572e-01 2.1419279277324677e-01 + <_> + + 0 -1 59 -2.6782939676195383e-03 + + -7.8390169143676758e-01 8.0526962876319885e-02 + <_> + + 0 -1 60 -7.0597179234027863e-02 + + 4.1469261050224304e-01 -1.3989959657192230e-01 + <_> + + 0 -1 61 9.2093646526336670e-02 + + -1.3055180013179779e-01 5.0435781478881836e-01 + <_> + + 0 -1 62 -8.8004386052489281e-03 + + 3.6609750986099243e-01 -1.4036649465560913e-01 + <_> + + 0 -1 63 7.5080977694597095e-05 + + -2.9704439640045166e-01 2.0702940225601196e-01 + <_> + + 0 -1 64 -2.9870450962334871e-03 + + 3.5615700483322144e-01 -1.5445969998836517e-01 + <_> + + 0 -1 65 -2.6441509835422039e-03 + + -5.4353517293930054e-01 1.0295110195875168e-01 + <_> + 27 + -1.2905240058898926e+00 + + <_> + + 0 -1 66 -4.7862470149993896e-02 + + 4.1528239846229553e-01 -3.4185820817947388e-01 + <_> + + 0 -1 67 8.7350532412528992e-02 + + -3.8749781250953674e-01 2.4204200506210327e-01 + <_> + + 0 -1 68 -1.6849499195814133e-02 + + 5.3082478046417236e-01 -1.7282910645008087e-01 + <_> + + 0 -1 69 -2.8870029374957085e-02 + + 3.5843509435653687e-01 -2.2402590513229370e-01 + <_> + + 0 -1 70 2.5679389946162701e-03 + + 1.4990499615669250e-01 -6.5609407424926758e-01 + <_> + + 0 -1 71 -2.4116659536957741e-02 + + 5.5889678001403809e-01 -1.4810280501842499e-01 + <_> + + 0 -1 72 -3.2826658338308334e-02 + + 4.6468681097030640e-01 -1.0785529762506485e-01 + <_> + + 0 -1 73 -1.5233060345053673e-02 + + -7.3954427242279053e-01 5.6236881762742996e-02 + <_> + + 0 -1 74 -3.0209511169232428e-04 + + -4.5548820495605469e-01 9.7069837152957916e-02 + <_> + + 0 -1 75 7.5365108205005527e-04 + + 9.5147296786308289e-02 -5.4895019531250000e-01 + <_> + + 0 -1 76 -1.0638950392603874e-02 + + 4.0912970900535583e-01 -1.2308409810066223e-01 + <_> + + 0 -1 77 -7.5217830017209053e-03 + + 4.0289148688316345e-01 -1.6048780083656311e-01 + <_> + + 0 -1 78 -1.0677099972963333e-01 + + 6.1759322881698608e-01 -7.3091186583042145e-02 + <_> + + 0 -1 79 1.6256919130682945e-02 + + -1.3103680312633514e-01 3.7453651428222656e-01 + <_> + + 0 -1 80 -2.0679360255599022e-02 + + -7.1402907371520996e-01 5.2390009164810181e-02 + <_> + + 0 -1 81 1.7052369192242622e-02 + + 1.2822860479354858e-01 -3.1080681085586548e-01 + <_> + + 0 -1 82 -5.7122060097754002e-03 + + -6.0556507110595703e-01 8.1884756684303284e-02 + <_> + + 0 -1 83 2.0851430235779844e-05 + + -2.6812988519668579e-01 1.4453840255737305e-01 + <_> + + 0 -1 84 7.9284431412816048e-03 + + -7.8795351088047028e-02 5.6762582063674927e-01 + <_> + + 0 -1 85 -2.5217379443347454e-03 + + 3.7068629264831543e-01 -1.3620570302009583e-01 + <_> + + 0 -1 86 -2.2426199167966843e-02 + + -6.8704998493194580e-01 5.1062859594821930e-02 + <_> + + 0 -1 87 -7.6451441273093224e-03 + + 2.3492220044136047e-01 -1.7905959486961365e-01 + <_> + + 0 -1 88 -1.1175329564139247e-03 + + -5.9869050979614258e-01 7.4324436485767365e-02 + <_> + + 0 -1 89 1.9212789833545685e-02 + + -1.5702550113201141e-01 2.9737469553947449e-01 + <_> + + 0 -1 90 5.6293429806828499e-03 + + -9.9769018590450287e-02 4.2130270600318909e-01 + <_> + + 0 -1 91 -9.5671862363815308e-03 + + -6.0858798027038574e-01 7.3506258428096771e-02 + <_> + + 0 -1 92 1.1217960156500340e-02 + + -1.0320810228586197e-01 4.1909849643707275e-01 + <_> + 28 + -1.1600480079650879e+00 + + <_> + + 0 -1 93 -1.7486440017819405e-02 + + 3.1307280063629150e-01 -3.3681181073188782e-01 + <_> + + 0 -1 94 3.0714649707078934e-02 + + -1.8766190111637115e-01 5.3780800104141235e-01 + <_> + + 0 -1 95 -2.2188719362020493e-02 + + 3.6637881398200989e-01 -1.6124810278415680e-01 + <_> + + 0 -1 96 -5.0700771680567414e-05 + + 2.1245710551738739e-01 -2.8444620966911316e-01 + <_> + + 0 -1 97 -7.0170420221984386e-03 + + 3.9543110132217407e-01 -1.3173590600490570e-01 + <_> + + 0 -1 98 -6.8563609384000301e-03 + + 3.0373859405517578e-01 -2.0657819509506226e-01 + <_> + + 0 -1 99 -1.4129259623587132e-02 + + -7.6503008604049683e-01 9.8213188350200653e-02 + <_> + + 0 -1 100 -4.7915481030941010e-02 + + 4.8307389020919800e-01 -1.3006809353828430e-01 + <_> + + 0 -1 101 4.7032979637151584e-05 + + -2.5216570496559143e-01 2.4386680126190186e-01 + <_> + + 0 -1 102 1.0221180273219943e-03 + + 6.8857602775096893e-02 -6.5861141681671143e-01 + <_> + + 0 -1 103 -2.6056109927594662e-03 + + 4.2942029237747192e-01 -1.3022460043430328e-01 + <_> + + 0 -1 104 5.4505340813193470e-05 + + -1.9288620352745056e-01 2.8958499431610107e-01 + <_> + + 0 -1 105 -6.6721157054416835e-05 + + 3.0290710926055908e-01 -1.9854369759559631e-01 + <_> + + 0 -1 106 2.6281431317329407e-01 + + -2.3293940722942352e-01 2.3692460358142853e-01 + <_> + + 0 -1 107 -2.3569669574499130e-02 + + 1.9401040673255920e-01 -2.8484618663787842e-01 + <_> + + 0 -1 108 -3.9120172150433064e-03 + + 5.5378979444503784e-01 -9.5665678381919861e-02 + <_> + + 0 -1 109 5.0788799853762612e-05 + + -2.3912659287452698e-01 2.1799489855766296e-01 + <_> + + 0 -1 110 -7.8732017427682877e-03 + + 4.0697428584098816e-01 -1.2768040597438812e-01 + <_> + + 0 -1 111 -1.6778609715402126e-03 + + -5.7744657993316650e-01 9.7324788570404053e-02 + <_> + + 0 -1 112 -2.6832430739887059e-04 + + 2.9021880030632019e-01 -1.6831269860267639e-01 + <_> + + 0 -1 113 7.8687182394787669e-05 + + -1.9551570713520050e-01 2.7720969915390015e-01 + <_> + + 0 -1 114 1.2953500263392925e-02 + + -9.6838317811489105e-02 4.0323871374130249e-01 + <_> + + 0 -1 115 -1.3043959625065327e-02 + + 4.7198569774627686e-01 -8.9287549257278442e-02 + <_> + + 0 -1 116 3.0261781066656113e-03 + + -1.3623380661010742e-01 3.0686271190643311e-01 + <_> + + 0 -1 117 -6.0438038781285286e-03 + + -7.7954101562500000e-01 5.7316310703754425e-02 + <_> + + 0 -1 118 -2.2507249377667904e-03 + + 3.0877059698104858e-01 -1.5006309747695923e-01 + <_> + + 0 -1 119 1.5826810151338577e-02 + + 6.4551889896392822e-02 -7.2455567121505737e-01 + <_> + + 0 -1 120 6.5864507632795721e-05 + + -1.7598840594291687e-01 2.3210389912128448e-01 + <_> + 36 + -1.2257250547409058e+00 + + <_> + + 0 -1 121 -2.7854869142174721e-02 + + 4.5518448948860168e-01 -1.8099910020828247e-01 + <_> + + 0 -1 122 1.2895040214061737e-01 + + -5.2565532922744751e-01 1.6188900172710419e-01 + <_> + + 0 -1 123 2.4403180927038193e-02 + + -1.4974960684776306e-01 4.2357379198074341e-01 + <_> + + 0 -1 124 -2.4458570405840874e-03 + + 3.2948669791221619e-01 -1.7447690665721893e-01 + <_> + + 0 -1 125 -3.5336529836058617e-03 + + 4.7426640987396240e-01 -7.3618359863758087e-02 + <_> + + 0 -1 126 5.1358150813030079e-05 + + -3.0421930551528931e-01 1.5633270144462585e-01 + <_> + + 0 -1 127 -1.6225680708885193e-02 + + 2.3002180457115173e-01 -2.0359820127487183e-01 + <_> + + 0 -1 128 -4.6007009223103523e-03 + + 4.0459269285202026e-01 -1.3485440611839294e-01 + <_> + + 0 -1 129 -2.1928999572992325e-02 + + -6.8724489212036133e-01 8.0684266984462738e-02 + <_> + + 0 -1 130 -2.8971210122108459e-03 + + -6.9619607925415039e-01 4.8545219004154205e-02 + <_> + + 0 -1 131 -4.4074649922549725e-03 + + 2.5166261196136475e-01 -1.6236649453639984e-01 + <_> + + 0 -1 132 2.8437169268727303e-02 + + 6.0394261032342911e-02 -6.6744458675384521e-01 + <_> + + 0 -1 133 8.3212882280349731e-02 + + 6.4357921481132507e-02 -5.3626042604446411e-01 + <_> + + 0 -1 134 -1.2419329956173897e-02 + + -7.0816862583160400e-01 5.7526610791683197e-02 + <_> + + 0 -1 135 -4.6992599964141846e-03 + + 5.1254332065582275e-01 -8.7350800633430481e-02 + <_> + + 0 -1 136 -7.8025809489190578e-04 + + 2.6687660813331604e-01 -1.7961509525775909e-01 + <_> + + 0 -1 137 -1.9724339246749878e-02 + + -6.7563730478286743e-01 7.2941906750202179e-02 + <_> + + 0 -1 138 1.0269250487908721e-03 + + 5.3919319063425064e-02 -5.5540180206298828e-01 + <_> + + 0 -1 139 -2.5957189500331879e-02 + + 5.6362527608871460e-01 -7.1898393332958221e-02 + <_> + + 0 -1 140 -1.2552699772641063e-03 + + -5.0346630811691284e-01 8.9691452682018280e-02 + <_> + + 0 -1 141 -4.9970578402280807e-02 + + 1.7685119807720184e-01 -2.2301959991455078e-01 + <_> + + 0 -1 142 -2.9899610672146082e-03 + + 3.9122420549392700e-01 -1.0149750113487244e-01 + <_> + + 0 -1 143 4.8546842299401760e-03 + + -1.1770179867744446e-01 4.2190939188003540e-01 + <_> + + 0 -1 144 1.0448860120959580e-04 + + -1.7333979904651642e-01 2.2344440221786499e-01 + <_> + + 0 -1 145 5.9689260524464771e-05 + + -2.3409630358219147e-01 1.6558240354061127e-01 + <_> + + 0 -1 146 -1.3423919677734375e-02 + + 4.3023818731307983e-01 -9.9723652005195618e-02 + <_> + + 0 -1 147 2.2581999655812979e-03 + + 7.2720989584922791e-02 -5.7501018047332764e-01 + <_> + + 0 -1 148 -1.2546280398964882e-02 + + 3.6184579133987427e-01 -1.1457010358572006e-01 + <_> + + 0 -1 149 -2.8705769218504429e-03 + + 2.8210538625717163e-01 -1.2367550283670425e-01 + <_> + + 0 -1 150 1.9785640761256218e-02 + + 4.7876749187707901e-02 -8.0666238069534302e-01 + <_> + + 0 -1 151 4.7588930465281010e-03 + + -1.0925389826297760e-01 3.3746978640556335e-01 + <_> + + 0 -1 152 -6.9974269717931747e-03 + + -8.0295938253402710e-01 4.5706700533628464e-02 + <_> + + 0 -1 153 -1.3033480383455753e-02 + + 1.8680439889431000e-01 -1.7688910663127899e-01 + <_> + + 0 -1 154 -1.3742579612880945e-03 + + 2.7725479006767273e-01 -1.2809009850025177e-01 + <_> + + 0 -1 155 2.7657810132950544e-03 + + 9.0758942067623138e-02 -4.2594739794731140e-01 + <_> + + 0 -1 156 2.8941841446794569e-04 + + -3.8816329836845398e-01 8.9267797768115997e-02 + <_> + 47 + -1.2863140106201172e+00 + + <_> + + 0 -1 157 -1.4469229616224766e-02 + + 3.7507829070091248e-01 -2.4928289651870728e-01 + <_> + + 0 -1 158 -1.3317629694938660e-01 + + 3.0166378617286682e-01 -2.2414070367813110e-01 + <_> + + 0 -1 159 -1.0132160037755966e-02 + + 3.6985591053962708e-01 -1.7850010097026825e-01 + <_> + + 0 -1 160 -7.8511182218790054e-03 + + 4.6086761355400085e-01 -1.2931390106678009e-01 + <_> + + 0 -1 161 -1.4295839704573154e-02 + + 4.4841429591178894e-01 -1.0226240009069443e-01 + <_> + + 0 -1 162 -5.9606940485537052e-03 + + 2.7927988767623901e-01 -1.5323829650878906e-01 + <_> + + 0 -1 163 1.0932769626379013e-02 + + -1.5141740441322327e-01 3.9889648556709290e-01 + <_> + + 0 -1 164 5.0430990086169913e-05 + + -2.2681570053100586e-01 2.1644389629364014e-01 + <_> + + 0 -1 165 -5.8431681245565414e-03 + + 4.5420148968696594e-01 -1.2587159872055054e-01 + <_> + + 0 -1 166 -2.2346209734678268e-02 + + -6.2690192461013794e-01 8.2403123378753662e-02 + <_> + + 0 -1 167 -4.8836669884622097e-03 + + 2.6359251141548157e-01 -1.4686630666255951e-01 + <_> + + 0 -1 168 7.5506002758629620e-05 + + -2.4507020413875580e-01 1.6678880155086517e-01 + <_> + + 0 -1 169 -4.9026997294276953e-04 + + -4.2649960517883301e-01 8.9973561465740204e-02 + <_> + + 0 -1 170 1.4861579984426498e-03 + + -1.2040250003337860e-01 3.0097651481628418e-01 + <_> + + 0 -1 171 -1.1988339945673943e-02 + + 2.7852478623390198e-01 -1.2244340032339096e-01 + <_> + + 0 -1 172 1.0502239689230919e-02 + + 4.0452759712934494e-02 -7.4050408601760864e-01 + <_> + + 0 -1 173 -3.0963009223341942e-02 + + -6.2842690944671631e-01 4.8013761639595032e-02 + <_> + + 0 -1 174 1.1414520442485809e-02 + + 3.9405211806297302e-02 -7.1674120426177979e-01 + <_> + + 0 -1 175 -1.2337000109255314e-02 + + 1.9941329956054688e-01 -1.9274300336837769e-01 + <_> + + 0 -1 176 -5.9942267835140228e-03 + + 5.1318162679672241e-01 -6.1658058315515518e-02 + <_> + + 0 -1 177 -1.1923230485990644e-03 + + -7.2605299949645996e-01 5.0652720034122467e-02 + <_> + + 0 -1 178 -7.4582789093255997e-03 + + 2.9603078961372375e-01 -1.1754789948463440e-01 + <_> + + 0 -1 179 2.7877509128302336e-03 + + 4.5068711042404175e-02 -6.9535410404205322e-01 + <_> + + 0 -1 180 -2.2503209766000509e-04 + + 2.0047250390052795e-01 -1.5775249898433685e-01 + <_> + + 0 -1 181 -5.0367889925837517e-03 + + 2.9299819469451904e-01 -1.1700499802827835e-01 + <_> + + 0 -1 182 7.4742160737514496e-02 + + -1.1392319947481155e-01 3.0256620049476624e-01 + <_> + + 0 -1 183 2.0255519077181816e-02 + + -1.0515890270471573e-01 4.0670460462570190e-01 + <_> + + 0 -1 184 4.4214509427547455e-02 + + -2.7631640434265137e-01 1.2363869696855545e-01 + <_> + + 0 -1 185 -8.7259558495134115e-04 + + 2.4355030059814453e-01 -1.3300949335098267e-01 + <_> + + 0 -1 186 -2.4453739169985056e-03 + + -5.3866171836853027e-01 6.2510646879673004e-02 + <_> + + 0 -1 187 8.2725353422574699e-05 + + -2.0772209763526917e-01 1.6270439326763153e-01 + <_> + + 0 -1 188 -3.6627110093832016e-02 + + 3.6568409204483032e-01 -9.0330280363559723e-02 + <_> + + 0 -1 189 3.0996399000287056e-03 + + -1.3183020055294037e-01 2.5354298949241638e-01 + <_> + + 0 -1 190 -2.4709280114620924e-03 + + -5.6853497028350830e-01 5.3505431860685349e-02 + <_> + + 0 -1 191 -1.4114670455455780e-02 + + -4.8599010705947876e-01 5.8485250920057297e-02 + <_> + + 0 -1 192 8.4537261864170432e-04 + + -8.0093637108802795e-02 4.0265649557113647e-01 + <_> + + 0 -1 193 -7.1098632179200649e-03 + + 4.4703239202499390e-01 -6.2947437167167664e-02 + <_> + + 0 -1 194 -1.9125960767269135e-02 + + -6.6422867774963379e-01 4.9822770059108734e-02 + <_> + + 0 -1 195 -5.0773010589182377e-03 + + 1.7379400134086609e-01 -1.6850599646568298e-01 + <_> + + 0 -1 196 -2.9198289848864079e-03 + + -6.0110282897949219e-01 5.7427939027547836e-02 + <_> + + 0 -1 197 -2.4902150034904480e-02 + + 2.3397980630397797e-01 -1.1818459630012512e-01 + <_> + + 0 -1 198 2.0147779956459999e-02 + + -8.9459821581840515e-02 3.6024400591850281e-01 + <_> + + 0 -1 199 1.7597640398889780e-03 + + 4.9458440393209457e-02 -6.3102620840072632e-01 + <_> + + 0 -1 200 1.3812039978802204e-03 + + -1.5218059718608856e-01 1.8971739709377289e-01 + <_> + + 0 -1 201 -1.0904540307819843e-02 + + -5.8097380399703979e-01 4.4862728565931320e-02 + <_> + + 0 -1 202 7.5157178798690438e-05 + + -1.3777349889278412e-01 1.9543160498142242e-01 + <_> + + 0 -1 203 3.8649770431220531e-03 + + -1.0302229970693588e-01 2.5374969840049744e-01 + <_> + 48 + -1.1189440488815308e+00 + + <_> + + 0 -1 204 -1.0215889662504196e-01 + + 4.1681259870529175e-01 -1.6655629873275757e-01 + <_> + + 0 -1 205 -5.1939819008111954e-02 + + 3.3023950457572937e-01 -2.0715710520744324e-01 + <_> + + 0 -1 206 -4.2717780917882919e-02 + + 2.6093730330467224e-01 -1.6013890504837036e-01 + <_> + + 0 -1 207 4.3890418601222336e-04 + + -3.4750530123710632e-01 1.3918919861316681e-01 + <_> + + 0 -1 208 2.4264389649033546e-02 + + -4.2552059888839722e-01 1.3578380644321442e-01 + <_> + + 0 -1 209 -2.3820599541068077e-02 + + 3.1749808788299561e-01 -1.6652040183544159e-01 + <_> + + 0 -1 210 -7.0518180727958679e-03 + + 3.0947178602218628e-01 -1.3338300585746765e-01 + <_> + + 0 -1 211 -6.8517157342284918e-04 + + -6.0082262754440308e-01 8.7747000157833099e-02 + <_> + + 0 -1 212 5.3705149330198765e-03 + + -1.2311449646949768e-01 3.8333550095558167e-01 + <_> + + 0 -1 213 -1.3403539545834064e-02 + + 3.3877369761466980e-01 -1.0140489786863327e-01 + <_> + + 0 -1 214 -6.6856360062956810e-03 + + -6.1193597316741943e-01 4.7740221023559570e-02 + <_> + + 0 -1 215 -4.2887418530881405e-03 + + 2.5275790691375732e-01 -1.4434510469436646e-01 + <_> + + 0 -1 216 -1.0876749642193317e-02 + + 5.4775732755661011e-01 -5.9455480426549911e-02 + <_> + + 0 -1 217 3.7882640026509762e-04 + + 8.3410300314426422e-02 -4.4226369261741638e-01 + <_> + + 0 -1 218 -2.4550149682909250e-03 + + 2.3330999910831451e-01 -1.3964480161666870e-01 + <_> + + 0 -1 219 1.2721839593723416e-03 + + 6.0480289161205292e-02 -4.9456089735031128e-01 + <_> + + 0 -1 220 -4.8933159559965134e-03 + + -6.6833269596099854e-01 4.6218499541282654e-02 + <_> + + 0 -1 221 2.6449989527463913e-02 + + -7.3235362768173218e-02 4.4425961375236511e-01 + <_> + + 0 -1 222 -3.3706070389598608e-03 + + -4.2464339733123779e-01 6.8676561117172241e-02 + <_> + + 0 -1 223 -2.9559480026364326e-03 + + 1.6218039393424988e-01 -1.8222999572753906e-01 + <_> + + 0 -1 224 3.0619909986853600e-02 + + -5.8643341064453125e-02 5.3263628482818604e-01 + <_> + + 0 -1 225 -9.5765907317399979e-03 + + -6.0562682151794434e-01 5.3345989435911179e-02 + <_> + + 0 -1 226 6.6372493165545166e-05 + + -1.6680839657783508e-01 1.9284160435199738e-01 + <_> + + 0 -1 227 5.0975950434803963e-03 + + 4.4119510799646378e-02 -5.7458841800689697e-01 + <_> + + 0 -1 228 3.7112718564458191e-04 + + -1.1086399853229523e-01 2.3105390369892120e-01 + <_> + + 0 -1 229 -8.6607588455080986e-03 + + 4.0456289052963257e-01 -6.2446091324090958e-02 + <_> + + 0 -1 230 8.7489158613607287e-04 + + 6.4875148236751556e-02 -4.4871041178703308e-01 + <_> + + 0 -1 231 1.1120870476588607e-03 + + -9.3861460685729980e-02 3.0453911423683167e-01 + <_> + + 0 -1 232 -2.3837819695472717e-02 + + -5.8887428045272827e-01 4.6659421175718307e-02 + <_> + + 0 -1 233 2.2272899514064193e-04 + + -1.4898599684238434e-01 1.7701950669288635e-01 + <_> + + 0 -1 234 2.4467470124363899e-02 + + -5.5789601057767868e-02 4.9208301305770874e-01 + <_> + + 0 -1 235 -1.4239320158958435e-01 + + 1.5192000567913055e-01 -1.8778899312019348e-01 + <_> + + 0 -1 236 -2.0123120397329330e-02 + + 2.1780100464820862e-01 -1.2081900238990784e-01 + <_> + + 0 -1 237 1.1513679783092812e-04 + + -1.6856589913368225e-01 1.6451929509639740e-01 + <_> + + 0 -1 238 -2.7556740678846836e-03 + + -6.9442039728164673e-01 3.9449468255043030e-02 + <_> + + 0 -1 239 -7.5843912782147527e-05 + + 1.8941369652748108e-01 -1.5183840692043304e-01 + <_> + + 0 -1 240 -7.0697711780667305e-03 + + 4.7064599394798279e-01 -5.7927619665861130e-02 + <_> + + 0 -1 241 -3.7393178790807724e-02 + + -7.5892448425292969e-01 3.4116048365831375e-02 + <_> + + 0 -1 242 -1.5995610505342484e-02 + + 3.0670469999313354e-01 -8.7525576353073120e-02 + <_> + + 0 -1 243 -3.1183990649878979e-03 + + 2.6195371150970459e-01 -9.1214887797832489e-02 + <_> + + 0 -1 244 1.0651360498741269e-03 + + -1.7427560687065125e-01 1.5277640521526337e-01 + <_> + + 0 -1 245 -1.6029420075938106e-03 + + 3.5612630844116211e-01 -7.6629996299743652e-02 + <_> + + 0 -1 246 4.3619908392429352e-03 + + 4.9356970936059952e-02 -5.9228771924972534e-01 + <_> + + 0 -1 247 -1.0779909789562225e-02 + + -6.3922178745269775e-01 3.3204540610313416e-02 + <_> + + 0 -1 248 -4.3590869754552841e-03 + + 1.6107389330863953e-01 -1.5221320092678070e-01 + <_> + + 0 -1 249 7.4596069753170013e-03 + + 3.3172961324453354e-02 -7.5007742643356323e-01 + <_> + + 0 -1 250 8.1385448575019836e-03 + + 2.6325279846787453e-02 -7.1731162071228027e-01 + <_> + + 0 -1 251 -3.3338490873575211e-02 + + 3.3536610007286072e-01 -7.0803590118885040e-02 + <_> + 55 + -1.1418989896774292e+00 + + <_> + + 0 -1 252 1.9553979858756065e-02 + + -1.0439720004796982e-01 5.3128951787948608e-01 + <_> + + 0 -1 253 2.2122919559478760e-02 + + -2.4747270345687866e-01 2.0847250521183014e-01 + <_> + + 0 -1 254 -4.1829389519989491e-03 + + 3.8289439678192139e-01 -1.4711579680442810e-01 + <_> + + 0 -1 255 -8.6381728760898113e-04 + + -6.2632888555526733e-01 1.1993259936571121e-01 + <_> + + 0 -1 256 7.9958612332120538e-04 + + 9.2573471367359161e-02 -5.5168831348419189e-01 + <_> + + 0 -1 257 9.1527570039033890e-03 + + -7.2929807007312775e-02 5.5512511730194092e-01 + <_> + + 0 -1 258 -3.9388681761920452e-03 + + 2.0196039974689484e-01 -2.0912039279937744e-01 + <_> + + 0 -1 259 1.4613410166930407e-04 + + -2.7861818671226501e-01 1.3817410171031952e-01 + <_> + + 0 -1 260 -3.1691689509898424e-03 + + 3.6685898900032043e-01 -7.6308242976665497e-02 + <_> + + 0 -1 261 -2.2189389914274216e-02 + + 3.9096599817276001e-01 -1.0971540212631226e-01 + <_> + + 0 -1 262 -7.4523608200252056e-03 + + 1.2838590145111084e-01 -2.4159869551658630e-01 + <_> + + 0 -1 263 7.7997002517804503e-04 + + 7.1978069841861725e-02 -4.3976500630378723e-01 + <_> + + 0 -1 264 -4.6783639118075371e-03 + + 2.1569849550724030e-01 -1.4205920696258545e-01 + <_> + + 0 -1 265 -1.5188639983534813e-02 + + 3.6458781361579895e-01 -8.2675926387310028e-02 + <_> + + 0 -1 266 5.0619798712432384e-03 + + -3.4380409121513367e-01 9.2068232595920563e-02 + <_> + + 0 -1 267 -1.7351920250803232e-03 + + -6.1725497245788574e-01 4.9214478582143784e-02 + <_> + + 0 -1 268 -1.2423450127243996e-02 + + -5.8558952808380127e-01 4.6112600713968277e-02 + <_> + + 0 -1 269 -1.3031429611146450e-02 + + -5.9710788726806641e-01 4.0672458708286285e-02 + <_> + + 0 -1 270 -1.2369629694148898e-03 + + -6.8334168195724487e-01 3.3156178891658783e-02 + <_> + + 0 -1 271 6.1022108420729637e-03 + + -9.4729237258434296e-02 3.0102241039276123e-01 + <_> + + 0 -1 272 6.6952849738299847e-04 + + 8.1816866993904114e-02 -3.5196030139923096e-01 + <_> + + 0 -1 273 -1.7970580374822021e-03 + + 2.3718979954719543e-01 -1.1768709868192673e-01 + <_> + + 0 -1 274 -7.1074528386816382e-04 + + -4.4763788580894470e-01 5.7682480663061142e-02 + <_> + + 0 -1 275 -5.9126471169292927e-03 + + 4.3425410985946655e-01 -6.6868573427200317e-02 + <_> + + 0 -1 276 -3.3132149837911129e-03 + + 1.8150010704994202e-01 -1.4180320501327515e-01 + <_> + + 0 -1 277 -6.0814660042524338e-02 + + 4.7221711277961731e-01 -6.1410639435052872e-02 + <_> + + 0 -1 278 -9.6714183688163757e-02 + + 2.7683168649673462e-01 -9.4490036368370056e-02 + <_> + + 0 -1 279 3.9073550142347813e-03 + + -1.2278530001640320e-01 2.1057400107383728e-01 + <_> + + 0 -1 280 -9.0431869029998779e-03 + + 3.5641568899154663e-01 -7.7806226909160614e-02 + <_> + + 0 -1 281 -4.8800031654536724e-03 + + -4.1034790873527527e-01 6.9694377481937408e-02 + <_> + + 0 -1 282 -4.3547428213059902e-03 + + -7.3017889261245728e-01 3.6655150353908539e-02 + <_> + + 0 -1 283 -9.6500627696514130e-03 + + 5.5181127786636353e-01 -5.3168080747127533e-02 + <_> + + 0 -1 284 -1.7397310584783554e-02 + + -5.7084232568740845e-01 5.0214089453220367e-02 + <_> + + 0 -1 285 -6.8304329179227352e-03 + + -4.6180281043052673e-01 5.0202690064907074e-02 + <_> + + 0 -1 286 3.3255619928240776e-04 + + -9.5362730324268341e-02 2.5983759760856628e-01 + <_> + + 0 -1 287 -2.3100529797375202e-03 + + 2.2872470319271088e-01 -1.0533530265092850e-01 + <_> + + 0 -1 288 -7.5426651164889336e-03 + + -5.6990510225296021e-01 4.8863459378480911e-02 + <_> + + 0 -1 289 -5.2723060362040997e-03 + + 3.5145181417465210e-01 -8.2390107214450836e-02 + <_> + + 0 -1 290 -4.8578968271613121e-03 + + -6.0417622327804565e-01 4.4539440423250198e-02 + <_> + + 0 -1 291 1.5867310576140881e-03 + + -1.0340909659862518e-01 2.3282019793987274e-01 + <_> + + 0 -1 292 -4.7427811659872532e-03 + + 2.8490281105041504e-01 -9.8090499639511108e-02 + <_> + + 0 -1 293 -1.3515240279957652e-03 + + 2.3096430301666260e-01 -1.1361840367317200e-01 + <_> + + 0 -1 294 2.2526069078594446e-03 + + 6.4478322863578796e-02 -4.2205891013145447e-01 + <_> + + 0 -1 295 -3.8038659840822220e-04 + + -3.8076201081275940e-01 6.0043290257453918e-02 + <_> + + 0 -1 296 4.9043921753764153e-03 + + -7.6104998588562012e-02 3.3232170343399048e-01 + <_> + + 0 -1 297 -9.0969670563936234e-03 + + 1.4287790656089783e-01 -1.6887800395488739e-01 + <_> + + 0 -1 298 -6.9317929446697235e-03 + + 2.7255409955978394e-01 -9.2879563570022583e-02 + <_> + + 0 -1 299 1.1471060570329428e-03 + + -1.5273059904575348e-01 1.9702400267124176e-01 + <_> + + 0 -1 300 -3.7662889808416367e-02 + + -5.9320437908172607e-01 4.0738601237535477e-02 + <_> + + 0 -1 301 -6.8165571428835392e-03 + + 2.5494089722633362e-01 -9.4081960618495941e-02 + <_> + + 0 -1 302 6.6205562325194478e-04 + + 4.6795718371868134e-02 -4.8454371094703674e-01 + <_> + + 0 -1 303 -4.2202551849186420e-03 + + 2.4682149291038513e-01 -9.4673976302146912e-02 + <_> + + 0 -1 304 -6.8986512720584869e-02 + + -6.6514801979064941e-01 3.5926390439271927e-02 + <_> + + 0 -1 305 6.1707608401775360e-03 + + 2.5833319872617722e-02 -7.2686272859573364e-01 + <_> + + 0 -1 306 1.0536249727010727e-02 + + -8.1828996539115906e-02 2.9760798811912537e-01 + <_> + 32 + -1.1255199909210205e+00 + + <_> + + 0 -1 307 -6.2758728861808777e-02 + + 2.7899080514907837e-01 -2.9656109213829041e-01 + <_> + + 0 -1 308 3.4516479354351759e-03 + + -3.4635880589485168e-01 2.0903840661048889e-01 + <_> + + 0 -1 309 -7.8699486330151558e-03 + + 2.4144889414310455e-01 -1.9205570220947266e-01 + <_> + + 0 -1 310 -3.4624869003891945e-03 + + -5.9151780605316162e-01 1.2486449629068375e-01 + <_> + + 0 -1 311 -9.4818761572241783e-03 + + 1.8391540646553040e-01 -2.4858260154724121e-01 + <_> + + 0 -1 312 2.3226840130519122e-04 + + -3.3047258853912354e-01 1.0999260097742081e-01 + <_> + + 0 -1 313 1.8101120367646217e-03 + + 9.8744012415409088e-02 -4.9634781479835510e-01 + <_> + + 0 -1 314 -5.4422430694103241e-03 + + 2.9344418644905090e-01 -1.3094750046730042e-01 + <_> + + 0 -1 315 7.4148122221231461e-03 + + -1.4762699604034424e-01 3.3277168869972229e-01 + <_> + + 0 -1 316 -1.5565140172839165e-02 + + -6.8404901027679443e-01 9.9872693419456482e-02 + <_> + + 0 -1 317 2.8720520436763763e-02 + + -1.4833280444145203e-01 3.0902579426765442e-01 + <_> + + 0 -1 318 9.6687392215244472e-05 + + -1.7431040108203888e-01 2.1402959525585175e-01 + <_> + + 0 -1 319 5.2371058613061905e-02 + + -7.0156857371330261e-02 4.9222990870475769e-01 + <_> + + 0 -1 320 -8.6485691368579865e-02 + + 5.0757247209548950e-01 -7.5294211506843567e-02 + <_> + + 0 -1 321 -4.2169868946075439e-02 + + 4.5680961012840271e-01 -9.0219900012016296e-02 + <_> + + 0 -1 322 4.5369830331765115e-05 + + -2.6538279652595520e-01 1.6189539432525635e-01 + <_> + + 0 -1 323 5.2918000146746635e-03 + + 7.4890151619911194e-02 -5.4054671525955200e-01 + <_> + + 0 -1 324 -7.5511651812121272e-04 + + -4.9261990189552307e-01 5.8723948895931244e-02 + <_> + + 0 -1 325 7.5108138844370842e-05 + + -2.1432100236415863e-01 1.4077760279178619e-01 + <_> + + 0 -1 326 4.9981209449470043e-03 + + -9.0547338128089905e-02 3.5716068744659424e-01 + <_> + + 0 -1 327 -1.4929979806765914e-03 + + 2.5623458623886108e-01 -1.4229069650173187e-01 + <_> + + 0 -1 328 2.7239411137998104e-03 + + -1.5649250149726868e-01 2.1088710427284241e-01 + <_> + + 0 -1 329 2.2218320518732071e-03 + + -1.5072989463806152e-01 2.6801869273185730e-01 + <_> + + 0 -1 330 -7.3993072146549821e-04 + + 2.9546990990638733e-01 -1.0692390054464340e-01 + <_> + + 0 -1 331 2.0113459322601557e-03 + + 5.0614349544048309e-02 -7.1683371067047119e-01 + <_> + + 0 -1 332 1.1452870443463326e-02 + + -1.2719069421291351e-01 2.4152779579162598e-01 + <_> + + 0 -1 333 -1.0782170575112104e-03 + + 2.4813009798526764e-01 -1.3461199402809143e-01 + <_> + + 0 -1 334 3.3417691010981798e-03 + + 5.3578309714794159e-02 -5.2274167537689209e-01 + <_> + + 0 -1 335 6.9398651248775423e-05 + + -2.1698740124702454e-01 1.2812179327011108e-01 + <_> + + 0 -1 336 -4.0982551872730255e-03 + + 2.4401889741420746e-01 -1.1570589989423752e-01 + <_> + + 0 -1 337 -1.6289720078930259e-03 + + 2.8261470794677734e-01 -1.0659469664096832e-01 + <_> + + 0 -1 338 1.3984859921038151e-02 + + 4.2715899646282196e-02 -7.3646312952041626e-01 + <_> + 30 + -1.1729990243911743e+00 + + <_> + + 0 -1 339 1.6416519880294800e-01 + + -4.8960301280021667e-01 1.7607709765434265e-01 + <_> + + 0 -1 340 8.3413062384352088e-04 + + -2.8220430016517639e-01 2.4199579656124115e-01 + <_> + + 0 -1 341 -1.7193210078403354e-03 + + -7.1485888957977295e-01 8.6162216961383820e-02 + <_> + + 0 -1 342 -1.5654950402677059e-03 + + -7.2972381114959717e-01 9.4070672988891602e-02 + <_> + + 0 -1 343 1.9124479731544852e-03 + + -3.1187158823013306e-01 1.8143390119075775e-01 + <_> + + 0 -1 344 -1.3512369990348816e-01 + + 2.9577299952507019e-01 -2.2179250419139862e-01 + <_> + + 0 -1 345 -4.0300549007952213e-03 + + -6.6595137119293213e-01 8.5431016981601715e-02 + <_> + + 0 -1 346 -2.8640460222959518e-03 + + -6.2086361646652222e-01 5.3106021136045456e-02 + <_> + + 0 -1 347 -1.4065420255064964e-03 + + 2.2346289455890656e-01 -2.0211009681224823e-01 + <_> + + 0 -1 348 -3.5820449702441692e-03 + + -5.4030400514602661e-01 6.8213619291782379e-02 + <_> + + 0 -1 349 4.1544470936059952e-02 + + -6.5215840935707092e-02 6.2109231948852539e-01 + <_> + + 0 -1 350 -9.1709550470113754e-03 + + -7.5553297996520996e-01 5.2640449255704880e-02 + <_> + + 0 -1 351 6.1552738770842552e-03 + + 9.0939402580261230e-02 -4.4246131181716919e-01 + <_> + + 0 -1 352 -1.0043520014733076e-03 + + 2.4292330443859100e-01 -1.8669790029525757e-01 + <_> + + 0 -1 353 1.1519829742610455e-02 + + -1.1763150244951248e-01 3.6723458766937256e-01 + <_> + + 0 -1 354 -8.9040733873844147e-03 + + -4.8931330442428589e-01 1.0897020250558853e-01 + <_> + + 0 -1 355 5.3973670583218336e-04 + + -2.1850399672985077e-01 1.8489989638328552e-01 + <_> + + 0 -1 356 1.3727260520681739e-03 + + -1.5072910487651825e-01 2.9173129796981812e-01 + <_> + + 0 -1 357 -1.0807390324771404e-02 + + 4.2897450923919678e-01 -1.0280139744281769e-01 + <_> + + 0 -1 358 1.2670770520344377e-03 + + 7.4192158877849579e-02 -6.4208251237869263e-01 + <_> + + 0 -1 359 2.2991129662841558e-03 + + 4.7100279480218887e-02 -7.2335231304168701e-01 + <_> + + 0 -1 360 2.7187510859221220e-03 + + -1.7086869478225708e-01 2.3513509333133698e-01 + <_> + + 0 -1 361 -6.6619180142879486e-03 + + -7.8975427150726318e-01 4.5084670186042786e-02 + <_> + + 0 -1 362 -4.8266649246215820e-02 + + -6.9579917192459106e-01 4.1976079344749451e-02 + <_> + + 0 -1 363 1.5214690007269382e-02 + + -1.0818280279636383e-01 3.6460620164871216e-01 + <_> + + 0 -1 364 -6.0080131515860558e-03 + + 3.0970990657806396e-01 -1.1359210312366486e-01 + <_> + + 0 -1 365 6.6127157770097256e-03 + + 8.0665342509746552e-02 -4.6658530831336975e-01 + <_> + + 0 -1 366 -7.9607013612985611e-03 + + -8.7201941013336182e-01 3.6774590611457825e-02 + <_> + + 0 -1 367 3.8847199175506830e-03 + + -1.1666289716959000e-01 3.3070269227027893e-01 + <_> + + 0 -1 368 -1.0988810099661350e-03 + + 2.3872570693492889e-01 -1.7656759917736053e-01 + <_> + 44 + -1.0368299484252930e+00 + + <_> + + 0 -1 369 3.5903379321098328e-03 + + -2.3688079416751862e-01 2.4631640315055847e-01 + <_> + + 0 -1 370 6.4815930090844631e-03 + + -3.1373620033264160e-01 1.8675759434700012e-01 + <_> + + 0 -1 371 7.3048402555286884e-05 + + -2.7644351124763489e-01 1.6496239602565765e-01 + <_> + + 0 -1 372 -3.8514640182256699e-03 + + -5.6014508008956909e-01 1.1294739693403244e-01 + <_> + + 0 -1 373 3.8588210009038448e-03 + + 3.9848998188972473e-02 -5.8071857690811157e-01 + <_> + + 0 -1 374 -2.4651220068335533e-02 + + 1.6755010187625885e-01 -2.5343671441078186e-01 + <_> + + 0 -1 375 4.7245521098375320e-02 + + -1.0662080347537994e-01 3.9451980590820312e-01 + <_> + + 0 -1 376 6.5964651294052601e-03 + + -1.7744250595569611e-01 2.7280190587043762e-01 + <_> + + 0 -1 377 -1.3177490327507257e-03 + + -5.4272651672363281e-01 4.8606589436531067e-02 + <_> + + 0 -1 378 -5.0261709839105606e-03 + + 2.4394249916076660e-01 -1.3143649697303772e-01 + <_> + + 0 -1 379 3.4632768947631121e-03 + + 6.9049343466758728e-02 -7.0336240530014038e-01 + <_> + + 0 -1 380 2.1692588925361633e-03 + + -1.3289460539817810e-01 2.2098529338836670e-01 + <_> + + 0 -1 381 2.9395870864391327e-02 + + -2.8530520200729370e-01 1.3543990254402161e-01 + <_> + + 0 -1 382 -9.6181448316201568e-04 + + -5.8041381835937500e-01 3.7450648844242096e-02 + <_> + + 0 -1 383 -1.0820999741554260e-01 + + 3.9467281103134155e-01 -7.8655943274497986e-02 + <_> + + 0 -1 384 -1.8024869263172150e-02 + + 2.7355629205703735e-01 -1.3415299355983734e-01 + <_> + + 0 -1 385 6.2509840354323387e-03 + + 2.3388059809803963e-02 -8.0088591575622559e-01 + <_> + + 0 -1 386 -1.6088379779830575e-03 + + -5.6762522459030151e-01 4.1215669363737106e-02 + <_> + + 0 -1 387 7.7564752427861094e-04 + + -1.4891269803047180e-01 1.9086180627346039e-01 + <_> + + 0 -1 388 8.7122338300105184e-05 + + -1.5557530522346497e-01 1.9428220391273499e-01 + <_> + + 0 -1 389 -2.0755320787429810e-02 + + -6.3006532192230225e-01 3.6134380847215652e-02 + <_> + + 0 -1 390 -6.2931738793849945e-03 + + 2.5609248876571655e-01 -1.0588269680738449e-01 + <_> + + 0 -1 391 1.0844149626791477e-02 + + -1.0124850273132324e-01 3.0322128534317017e-01 + <_> + + 0 -1 392 -6.3752777350600809e-05 + + 1.9111579656600952e-01 -1.3849230110645294e-01 + <_> + + 0 -1 393 6.6480963141657412e-05 + + -1.5205250680446625e-01 2.1706309914588928e-01 + <_> + + 0 -1 394 1.3560829684138298e-03 + + 4.9431789666414261e-02 -6.4279842376708984e-01 + <_> + + 0 -1 395 -9.0662558795884252e-04 + + 1.7982010543346405e-01 -1.4044609665870667e-01 + <_> + + 0 -1 396 1.0473709553480148e-03 + + -1.0933549702167511e-01 2.4265940487384796e-01 + <_> + + 0 -1 397 -1.0243969736620784e-03 + + 2.7162680029869080e-01 -1.1820919811725616e-01 + <_> + + 0 -1 398 -1.2024149764329195e-03 + + -7.0151102542877197e-01 3.9489898830652237e-02 + <_> + + 0 -1 399 7.6911649666726589e-03 + + -9.2218913137912750e-02 3.1046289205551147e-01 + <_> + + 0 -1 400 -1.3966549932956696e-01 + + 6.8979388475418091e-01 -3.9706118404865265e-02 + <_> + + 0 -1 401 2.1276050247251987e-03 + + 9.7277611494064331e-02 -2.8841799497604370e-01 + <_> + + 0 -1 402 -2.7594310231506824e-03 + + 2.4168670177459717e-01 -1.1277820169925690e-01 + <_> + + 0 -1 403 5.2236132323741913e-03 + + -1.1430279910564423e-01 2.4256780743598938e-01 + <_> + + 0 -1 404 -1.2590440455824137e-03 + + -5.9679388999938965e-01 4.7663960605859756e-02 + <_> + + 0 -1 405 -3.7192099262028933e-03 + + -4.6414130926132202e-01 5.2847690880298615e-02 + <_> + + 0 -1 406 5.9696151874959469e-03 + + -7.3244288563728333e-02 3.8743090629577637e-01 + <_> + + 0 -1 407 -5.1776720210909843e-03 + + -7.4193227291107178e-01 4.0496710687875748e-02 + <_> + + 0 -1 408 5.0035100430250168e-03 + + -1.3888800144195557e-01 1.8767620623111725e-01 + <_> + + 0 -1 409 -5.2013457752764225e-04 + + -5.4940617084503174e-01 4.9417849630117416e-02 + <_> + + 0 -1 410 5.3168768063187599e-03 + + -8.2482978701591492e-02 3.1740561127662659e-01 + <_> + + 0 -1 411 -1.4774589799344540e-02 + + 2.0816099643707275e-01 -1.2115559726953506e-01 + <_> + + 0 -1 412 -4.1416451334953308e-02 + + -8.2437807321548462e-01 3.3329188823699951e-02 + <_> + 53 + -1.0492420196533203e+00 + + <_> + + 0 -1 413 9.0962520334869623e-04 + + 8.4579966962337494e-02 -5.6118410825729370e-01 + <_> + + 0 -1 414 -5.6139789521694183e-02 + + 1.5341749787330627e-01 -2.6967319846153259e-01 + <_> + + 0 -1 415 1.0292009683325887e-03 + + -2.0489980280399323e-01 2.0153179764747620e-01 + <_> + + 0 -1 416 2.8783010784536600e-03 + + -1.7351140081882477e-01 2.1297949552536011e-01 + <_> + + 0 -1 417 -7.4144392274320126e-03 + + -5.9624868631362915e-01 4.7077950090169907e-02 + <_> + + 0 -1 418 -1.4831849839538336e-03 + + 1.9024610519409180e-01 -1.5986390411853790e-01 + <_> + + 0 -1 419 4.5968941412866116e-03 + + 3.1447131186723709e-02 -6.8694341182708740e-01 + <_> + + 0 -1 420 2.4255330208688974e-03 + + -2.3609359562397003e-01 1.1036109924316406e-01 + <_> + + 0 -1 421 -8.4950566291809082e-02 + + 2.3107160627841949e-01 -1.3776530325412750e-01 + <_> + + 0 -1 422 -5.0145681016147137e-03 + + 3.8676109910011292e-01 -5.6217379868030548e-02 + <_> + + 0 -1 423 -2.1482061129063368e-03 + + 1.8191599845886230e-01 -1.7615699768066406e-01 + <_> + + 0 -1 424 -1.0396770201623440e-02 + + -7.5351381301879883e-01 2.4091970175504684e-02 + <_> + + 0 -1 425 -1.3466750271618366e-02 + + -7.2118860483169556e-01 3.4949369728565216e-02 + <_> + + 0 -1 426 -8.4435477852821350e-02 + + -3.3792638778686523e-01 7.1113817393779755e-02 + <_> + + 0 -1 427 2.4771490134298801e-03 + + -1.1765109747648239e-01 2.2541989386081696e-01 + <_> + + 0 -1 428 1.5828050673007965e-02 + + -6.9536216557025909e-02 3.1395369768142700e-01 + <_> + + 0 -1 429 6.4916983246803284e-02 + + -7.5043588876724243e-02 4.0677338838577271e-01 + <_> + + 0 -1 430 2.9652469675056636e-04 + + 7.3953360319137573e-02 -3.4544008970260620e-01 + <_> + + 0 -1 431 1.3129520229995251e-03 + + -1.6909439861774445e-01 1.5258370339870453e-01 + <_> + + 0 -1 432 -5.8032129891216755e-03 + + 3.5260149836540222e-01 -8.3444066345691681e-02 + <_> + + 0 -1 433 -1.4791679382324219e-01 + + 4.3004658818244934e-01 -5.7309929281473160e-02 + <_> + + 0 -1 434 -1.6584150493144989e-02 + + 2.3432689905166626e-01 -1.0907640308141708e-01 + <_> + + 0 -1 435 3.0183270573616028e-03 + + -1.3600939512252808e-01 2.6409289240837097e-01 + <_> + + 0 -1 436 -3.6471918225288391e-02 + + -6.2809741497039795e-01 4.3545108288526535e-02 + <_> + + 0 -1 437 -7.3119226726703346e-05 + + 1.6470630466938019e-01 -1.6463780403137207e-01 + <_> + + 0 -1 438 -3.6719450727105141e-03 + + -4.7421360015869141e-01 4.8586919903755188e-02 + <_> + + 0 -1 439 -4.0151178836822510e-03 + + 1.8222180008888245e-01 -1.4097510278224945e-01 + <_> + + 0 -1 440 1.9948020577430725e-02 + + -6.9787658751010895e-02 3.6707460880279541e-01 + <_> + + 0 -1 441 7.6699437340721488e-04 + + 5.5729299783706665e-02 -4.4585430622100830e-01 + <_> + + 0 -1 442 -1.1806039838120341e-03 + + -4.6876621246337891e-01 4.8902221024036407e-02 + <_> + + 0 -1 443 1.5847349539399147e-02 + + -1.2120209634304047e-01 2.0566530525684357e-01 + <_> + + 0 -1 444 -1.1985700111836195e-03 + + 2.0262099802494049e-01 -1.2823820114135742e-01 + <_> + + 0 -1 445 -1.0964959859848022e-01 + + -8.6619192361831665e-01 3.0351849272847176e-02 + <_> + + 0 -1 446 -9.2532606795430183e-03 + + 2.9343119263648987e-01 -8.5361950099468231e-02 + <_> + + 0 -1 447 1.4686530455946922e-02 + + 3.2798621803522110e-02 -7.7556562423706055e-01 + <_> + + 0 -1 448 -1.3514430029317737e-03 + + 2.4426999688148499e-01 -1.1503250151872635e-01 + <_> + + 0 -1 449 -4.3728090822696686e-03 + + 2.1687670052051544e-01 -1.3984480500221252e-01 + <_> + + 0 -1 450 3.4263390116393566e-03 + + 4.5614220201969147e-02 -5.4567712545394897e-01 + <_> + + 0 -1 451 -3.8404068909585476e-03 + + 1.4949500560760498e-01 -1.5062509477138519e-01 + <_> + + 0 -1 452 3.7988980766385794e-03 + + -8.7301626801490784e-02 2.5481531023979187e-01 + <_> + + 0 -1 453 -2.0094281062483788e-03 + + 1.7259070277214050e-01 -1.4288470149040222e-01 + <_> + + 0 -1 454 -2.4370709434151649e-03 + + 2.6848098635673523e-01 -8.1898219883441925e-02 + <_> + + 0 -1 455 1.0485399980098009e-03 + + 4.6113260090351105e-02 -4.7243279218673706e-01 + <_> + + 0 -1 456 1.7460780218243599e-03 + + -1.1030430346727371e-01 2.0379729568958282e-01 + <_> + + 0 -1 457 5.8608627878129482e-03 + + -1.5619659423828125e-01 1.5927439928054810e-01 + <_> + + 0 -1 458 -2.7724979445338249e-02 + + 1.1349119991064072e-01 -2.1885140240192413e-01 + <_> + + 0 -1 459 4.7080639749765396e-02 + + -4.1688729077577591e-02 5.3630048036575317e-01 + <_> + + 0 -1 460 -7.9283770173788071e-03 + + -5.3595131635665894e-01 4.4237509369850159e-02 + <_> + + 0 -1 461 -1.2880540452897549e-02 + + 2.3237949609756470e-01 -1.0246250033378601e-01 + <_> + + 0 -1 462 2.3604769259691238e-02 + + -8.8291436433792114e-02 3.0561059713363647e-01 + <_> + + 0 -1 463 1.5902200713753700e-02 + + -1.2238109856843948e-01 1.7849120497703552e-01 + <_> + + 0 -1 464 7.9939495772123337e-03 + + -8.3729006350040436e-02 3.2319590449333191e-01 + <_> + + 0 -1 465 5.7100867852568626e-03 + + 3.8479208946228027e-02 -6.8138152360916138e-01 + <_> + 51 + -1.1122100353240967e+00 + + <_> + + 0 -1 466 2.2480720654129982e-03 + + -1.6416870057582855e-01 4.1648530960083008e-01 + <_> + + 0 -1 467 4.5813550241291523e-03 + + -1.2465959787368774e-01 4.0385121107101440e-01 + <_> + + 0 -1 468 -1.6073239967226982e-03 + + 2.6082459092140198e-01 -2.0282520353794098e-01 + <_> + + 0 -1 469 2.5205370038747787e-03 + + -1.0557229816913605e-01 3.6669111251831055e-01 + <_> + + 0 -1 470 2.4119189474731684e-03 + + -1.3877600431442261e-01 2.9959911108016968e-01 + <_> + + 0 -1 471 5.7156179100275040e-03 + + -7.7683463692665100e-02 4.8481920361518860e-01 + <_> + + 0 -1 472 3.1093840952962637e-03 + + -1.1229000240564346e-01 2.9215508699417114e-01 + <_> + + 0 -1 473 -8.6836628615856171e-02 + + -3.6779600381851196e-01 7.2597242891788483e-02 + <_> + + 0 -1 474 5.2652182057499886e-03 + + -1.0890290141105652e-01 3.1791260838508606e-01 + <_> + + 0 -1 475 -1.9913529977202415e-02 + + -5.3373438119888306e-01 7.0585712790489197e-02 + <_> + + 0 -1 476 3.8297839928418398e-03 + + -1.3575910031795502e-01 2.2788879275321960e-01 + <_> + + 0 -1 477 1.0431859642267227e-02 + + 8.8797912001609802e-02 -4.7958970069885254e-01 + <_> + + 0 -1 478 -2.0040439441800117e-02 + + 1.5745539963245392e-01 -1.7771570384502411e-01 + <_> + + 0 -1 479 -5.2967290394008160e-03 + + -6.8434917926788330e-01 3.5671461373567581e-02 + <_> + + 0 -1 480 -2.1624139044433832e-03 + + 2.8318038582801819e-01 -9.8511278629302979e-02 + <_> + + 0 -1 481 -3.5464888787828386e-04 + + -3.7077340483665466e-01 8.0932952463626862e-02 + <_> + + 0 -1 482 -1.8152060511056334e-04 + + -3.2207030057907104e-01 7.7551059424877167e-02 + <_> + + 0 -1 483 -2.7563021285459399e-04 + + -3.2441279292106628e-01 8.7949477136135101e-02 + <_> + + 0 -1 484 6.3823810778558254e-03 + + -8.8924713432788849e-02 3.1727218627929688e-01 + <_> + + 0 -1 485 1.1150909587740898e-02 + + 7.1019843220710754e-02 -4.0494039654731750e-01 + <_> + + 0 -1 486 -1.0593760525807738e-03 + + 2.6050668954849243e-01 -1.1765640228986740e-01 + <_> + + 0 -1 487 2.3906480055302382e-03 + + -8.4388621151447296e-02 3.1230551004409790e-01 + <_> + + 0 -1 488 -1.1000749655067921e-02 + + 1.9152249395847321e-01 -1.5210020542144775e-01 + <_> + + 0 -1 489 -2.4643228971399367e-04 + + -3.1765159964561462e-01 8.6582258343696594e-02 + <_> + + 0 -1 490 2.3053269833326340e-02 + + -1.0089760273694992e-01 2.5769290328025818e-01 + <_> + + 0 -1 491 -2.2135660983622074e-03 + + 4.5689210295677185e-01 -5.2404791116714478e-02 + <_> + + 0 -1 492 -9.7139709396287799e-04 + + -3.5518380999565125e-01 8.0094382166862488e-02 + <_> + + 0 -1 493 1.5676229959353805e-03 + + 1.0091420263051987e-01 -2.1603040397167206e-01 + <_> + + 0 -1 494 7.5460801599547267e-04 + + 5.7896178215742111e-02 -4.0461111068725586e-01 + <_> + + 0 -1 495 -2.0698970183730125e-02 + + 3.1543630361557007e-01 -8.0713048577308655e-02 + <_> + + 0 -1 496 -2.0619940012693405e-02 + + 2.7181661128997803e-01 -7.6358616352081299e-02 + <_> + + 0 -1 497 2.1611129865050316e-02 + + 3.9493449032306671e-02 -5.9429651498794556e-01 + <_> + + 0 -1 498 6.5676742233335972e-03 + + -9.8353669047355652e-02 2.3649279773235321e-01 + <_> + + 0 -1 499 -8.8434796780347824e-03 + + -5.2523428201675415e-01 4.3099921196699142e-02 + <_> + + 0 -1 500 -9.4260741025209427e-03 + + 2.4665130674839020e-01 -9.4130717217922211e-02 + <_> + + 0 -1 501 -1.9830230157822371e-03 + + 2.6743701100349426e-01 -9.0069316327571869e-02 + <_> + + 0 -1 502 -1.7358399927616119e-03 + + 1.5940019488334656e-01 -1.5789410471916199e-01 + <_> + + 0 -1 503 -1.3513869605958462e-02 + + 4.0792331099510193e-01 -6.4223118126392365e-02 + <_> + + 0 -1 504 -1.9394010305404663e-02 + + 1.8015649914741516e-01 -1.3731400668621063e-01 + <_> + + 0 -1 505 -3.2684770412743092e-03 + + 2.9080390930175781e-01 -8.0161906778812408e-02 + <_> + + 0 -1 506 4.1773589327931404e-04 + + -2.1412980556488037e-01 1.1273439973592758e-01 + <_> + + 0 -1 507 -7.6351119205355644e-03 + + -4.5365959405899048e-01 5.4625060409307480e-02 + <_> + + 0 -1 508 -8.3652976900339127e-03 + + 2.6472920179367065e-01 -9.4334110617637634e-02 + <_> + + 0 -1 509 2.7768449857831001e-02 + + -1.0136710107326508e-01 2.0743979513645172e-01 + <_> + + 0 -1 510 -5.4891228675842285e-02 + + 2.8840309381484985e-01 -7.5312040746212006e-02 + <_> + + 0 -1 511 2.5793339591473341e-03 + + -1.1088529974222183e-01 2.1724960207939148e-01 + <_> + + 0 -1 512 6.6196516854688525e-05 + + -1.8872100114822388e-01 1.4440689980983734e-01 + <_> + + 0 -1 513 5.0907251425087452e-03 + + -7.7601231634616852e-02 2.9398378729820251e-01 + <_> + + 0 -1 514 -1.0444259643554688e-01 + + 2.0133109390735626e-01 -1.0903970152139664e-01 + <_> + + 0 -1 515 -6.7273090826347470e-04 + + 1.7945900559425354e-01 -1.2023670226335526e-01 + <_> + + 0 -1 516 3.2412849832326174e-03 + + 4.0688131004571915e-02 -5.4600572586059570e-01 + <_> + 44 + -1.2529590129852295e+00 + + <_> + + 0 -1 517 5.2965320646762848e-03 + + -1.2154529988765717e-01 6.4420372247695923e-01 + <_> + + 0 -1 518 -2.5326260365545750e-03 + + 5.1233220100402832e-01 -1.1108259856700897e-01 + <_> + + 0 -1 519 -2.9183230362832546e-03 + + -5.0615429878234863e-01 1.1501979827880859e-01 + <_> + + 0 -1 520 -2.3692339658737183e-02 + + 3.7167280912399292e-01 -1.4672680199146271e-01 + <_> + + 0 -1 521 2.0177470520138741e-02 + + -1.7388840019702911e-01 4.7759491205215454e-01 + <_> + + 0 -1 522 -2.1723210811614990e-02 + + -4.3880090117454529e-01 1.3576899468898773e-01 + <_> + + 0 -1 523 2.8369780629873276e-03 + + -1.2512069940567017e-01 4.6789029240608215e-01 + <_> + + 0 -1 524 2.7148420922458172e-03 + + -8.8018856942653656e-02 3.6866518855094910e-01 + <_> + + 0 -1 525 3.2625689636915922e-03 + + -8.5335306823253632e-02 5.1644730567932129e-01 + <_> + + 0 -1 526 -3.5618850961327553e-03 + + -4.4503930211067200e-01 9.1738171875476837e-02 + <_> + + 0 -1 527 1.9227749435231090e-03 + + -1.1077310144901276e-01 3.9416998624801636e-01 + <_> + + 0 -1 528 -3.5111969918943942e-04 + + -3.7775701284408569e-01 1.2166170030832291e-01 + <_> + + 0 -1 529 1.9121779769193381e-04 + + 7.4816018342971802e-02 -4.0767100453376770e-01 + <_> + + 0 -1 530 -2.6525629800744355e-04 + + -3.3151718974113464e-01 1.1291120201349258e-01 + <_> + + 0 -1 531 2.0086700096726418e-02 + + -6.1598118394613266e-02 5.6128817796707153e-01 + <_> + + 0 -1 532 3.6783248186111450e-02 + + -6.0251388698816299e-02 5.2192491292953491e-01 + <_> + + 0 -1 533 1.3941619545221329e-03 + + -3.5503050684928894e-01 1.0863020271062851e-01 + <_> + + 0 -1 534 -1.5181669965386391e-02 + + 2.2739650309085846e-01 -1.6252990067005157e-01 + <_> + + 0 -1 535 4.6796840615570545e-03 + + -5.7535041123628616e-02 4.8124238848686218e-01 + <_> + + 0 -1 536 -1.7988319450523704e-04 + + -3.0587670207023621e-01 1.0868159681558609e-01 + <_> + + 0 -1 537 -3.5850999411195517e-03 + + 3.8596940040588379e-01 -9.2194072902202606e-02 + <_> + + 0 -1 538 1.0793360415846109e-03 + + -1.1190389841794968e-01 3.1125208735466003e-01 + <_> + + 0 -1 539 7.3285802500322461e-05 + + -2.0239910483360291e-01 1.5586680173873901e-01 + <_> + + 0 -1 540 1.3678739964962006e-01 + + -2.1672859787940979e-01 1.4420390129089355e-01 + <_> + + 0 -1 541 -1.1729259975254536e-02 + + 4.3503770232200623e-01 -7.4886530637741089e-02 + <_> + + 0 -1 542 3.9230841211974621e-03 + + -5.0289329141378403e-02 5.8831161260604858e-01 + <_> + + 0 -1 543 -2.9819121118634939e-04 + + -3.8232401013374329e-01 9.2451132833957672e-02 + <_> + + 0 -1 544 -4.7992770560085773e-03 + + 4.8488789796829224e-01 -7.3136523365974426e-02 + <_> + + 0 -1 545 -3.0155890271998942e-04 + + -3.5757359862327576e-01 1.0581880062818527e-01 + <_> + + 0 -1 546 1.0390769690275192e-02 + + 5.2920468151569366e-02 -5.7249659299850464e-01 + <_> + + 0 -1 547 -9.4488041941076517e-04 + + 4.4966828823089600e-01 -8.3075523376464844e-02 + <_> + + 0 -1 548 1.2651870492845774e-03 + + -9.6695438027381897e-02 3.1302270293235779e-01 + <_> + + 0 -1 549 1.7094539478421211e-02 + + -8.1248976290225983e-02 3.6113831400871277e-01 + <_> + + 0 -1 550 2.5973359588533640e-03 + + -1.1338350176811218e-01 2.2233949601650238e-01 + <_> + + 0 -1 551 1.4527440071105957e-03 + + 6.9750443100929260e-02 -3.6720710992813110e-01 + <_> + + 0 -1 552 4.7638658434152603e-03 + + -6.5788961946964264e-02 3.8328540325164795e-01 + <_> + + 0 -1 553 -6.2501081265509129e-03 + + -7.0754468441009521e-01 3.8350198417901993e-02 + <_> + + 0 -1 554 -3.1765329185873270e-03 + + 1.3755400478839874e-01 -2.3240029811859131e-01 + <_> + + 0 -1 555 3.2191169448196888e-03 + + -1.2935450673103333e-01 2.2737880051136017e-01 + <_> + + 0 -1 556 -5.6365579366683960e-03 + + 3.8067150115966797e-01 -6.7246839404106140e-02 + <_> + + 0 -1 557 -2.3844049428589642e-04 + + -3.1122380495071411e-01 8.3838358521461487e-02 + <_> + + 0 -1 558 -4.1017560288310051e-03 + + 2.6067280769348145e-01 -1.0449740290641785e-01 + <_> + + 0 -1 559 1.3336989795789123e-03 + + -5.8250140398740768e-02 4.7682440280914307e-01 + <_> + + 0 -1 560 -1.2090239906683564e-03 + + 1.4834509789943695e-01 -1.7329469323158264e-01 + <_> + 72 + -1.1188739538192749e+00 + + <_> + + 0 -1 561 -3.1760931015014648e-03 + + 3.3333331346511841e-01 -1.6642349958419800e-01 + <_> + + 0 -1 562 2.4858079850673676e-02 + + -7.2728872299194336e-02 5.6674581766128540e-01 + <_> + + 0 -1 563 -7.7597280032932758e-03 + + 4.6258568763732910e-01 -9.3112178146839142e-02 + <_> + + 0 -1 564 7.8239021822810173e-03 + + -2.7414610981941223e-01 1.3243049383163452e-01 + <_> + + 0 -1 565 -1.0948839597404003e-02 + + 2.2345480322837830e-01 -1.4965449273586273e-01 + <_> + + 0 -1 566 -3.4349008928984404e-03 + + 3.8724988698959351e-01 -6.6121727228164673e-02 + <_> + + 0 -1 567 -3.1156290322542191e-02 + + 2.4078279733657837e-01 -1.1406909674406052e-01 + <_> + + 0 -1 568 1.1100519914180040e-03 + + -2.8207978606224060e-01 1.3275429606437683e-01 + <_> + + 0 -1 569 3.1762740109115839e-03 + + 3.4585930407047272e-02 -5.1374310255050659e-01 + <_> + + 0 -1 570 -2.7977459132671356e-02 + + 2.3926779627799988e-01 -1.3255919516086578e-01 + <_> + + 0 -1 571 -2.3097939789295197e-02 + + 3.9019620418548584e-01 -7.8478008508682251e-02 + <_> + + 0 -1 572 -3.9731930010020733e-03 + + 3.0691069364547729e-01 -7.0601403713226318e-02 + <_> + + 0 -1 573 3.0335749033838511e-03 + + -1.4002190530300140e-01 1.9134859740734100e-01 + <_> + + 0 -1 574 -1.0844370350241661e-02 + + 1.6548730432987213e-01 -1.5657779574394226e-01 + <_> + + 0 -1 575 -1.8150510266423225e-02 + + -6.3243591785430908e-01 3.9561819285154343e-02 + <_> + + 0 -1 576 7.1052298881113529e-04 + + -1.8515570461750031e-01 1.3408809900283813e-01 + <_> + + 0 -1 577 1.0893340222537518e-02 + + -2.6730230078101158e-02 6.0971802473068237e-01 + <_> + + 0 -1 578 -2.8780900174751878e-04 + + -3.0065140128135681e-01 7.3171459138393402e-02 + <_> + + 0 -1 579 -3.5855069290846586e-03 + + 2.6217609643936157e-01 -7.9714097082614899e-02 + <_> + + 0 -1 580 -1.9759280607104301e-02 + + -5.9039229154586792e-01 4.0698971599340439e-02 + <_> + + 0 -1 581 -1.0845210403203964e-02 + + 1.6364559531211853e-01 -1.2586060166358948e-01 + <_> + + 0 -1 582 -4.3183090165257454e-03 + + -5.7474881410598755e-01 3.7644311785697937e-02 + <_> + + 0 -1 583 1.4913700288161635e-03 + + 6.0913469642400742e-02 -3.0222928524017334e-01 + <_> + + 0 -1 584 1.5675699338316917e-02 + + -7.3145911097526550e-02 2.9379451274871826e-01 + <_> + + 0 -1 585 -1.1033560149371624e-02 + + 3.9318808913230896e-01 -4.7084320336580276e-02 + <_> + + 0 -1 586 8.8555756956338882e-03 + + 3.7601381540298462e-02 -4.9108490347862244e-01 + <_> + + 0 -1 587 -8.9665671112015843e-04 + + 1.7952020466327667e-01 -1.1086239665746689e-01 + <_> + + 0 -1 588 -3.0592409893870354e-03 + + -4.4429460167884827e-01 5.1005430519580841e-02 + <_> + + 0 -1 589 6.3201179727911949e-03 + + -5.2841089665889740e-02 3.7197101116180420e-01 + <_> + + 0 -1 590 2.0682830363512039e-02 + + 5.7667169719934464e-02 -3.6901599168777466e-01 + <_> + + 0 -1 591 9.9822662770748138e-02 + + -3.7377018481492996e-02 5.8165591955184937e-01 + <_> + + 0 -1 592 -6.5854229032993317e-03 + + 2.8509441018104553e-01 -6.0978069901466370e-02 + <_> + + 0 -1 593 -6.0900300741195679e-02 + + -5.1031768321990967e-01 3.7787400186061859e-02 + <_> + + 0 -1 594 -2.9991709161549807e-03 + + -4.7943010926246643e-01 3.8833890110254288e-02 + <_> + + 0 -1 595 -9.8906438797712326e-03 + + 4.0609079599380493e-01 -4.7869648784399033e-02 + <_> + + 0 -1 596 -8.2688927650451660e-02 + + -7.0671182870864868e-01 2.7487749233841896e-02 + <_> + + 0 -1 597 5.0060399807989597e-03 + + 2.8208440169692039e-02 -5.2909690141677856e-01 + <_> + + 0 -1 598 6.1695030890405178e-03 + + -5.4554861038923264e-02 3.2837980985641479e-01 + <_> + + 0 -1 599 -3.3914761152118444e-03 + + 9.2117667198181152e-02 -2.1637110412120819e-01 + <_> + + 0 -1 600 -2.6131230406463146e-03 + + 1.3651019334793091e-01 -1.3781130313873291e-01 + <_> + + 0 -1 601 8.0490659456700087e-04 + + -6.8637110292911530e-02 3.3581069111824036e-01 + <_> + + 0 -1 602 -3.8106508553028107e-02 + + 2.9445430636405945e-01 -6.8239226937294006e-02 + <_> + + 0 -1 603 7.2450799052603543e-05 + + -1.6750130057334900e-01 1.2178230285644531e-01 + <_> + + 0 -1 604 1.5837959945201874e-03 + + -9.2042848467826843e-02 2.1348990499973297e-01 + <_> + + 0 -1 605 1.2924340553581715e-03 + + 6.2917232513427734e-02 -3.6174508929252625e-01 + <_> + + 0 -1 606 9.9146775901317596e-03 + + 1.9534060731530190e-02 -8.1015038490295410e-01 + <_> + + 0 -1 607 -1.7086310544982553e-03 + + 2.5525239109992981e-01 -6.8229459226131439e-02 + <_> + + 0 -1 608 2.1844399161636829e-03 + + 2.3314049467444420e-02 -8.4296780824661255e-01 + <_> + + 0 -1 609 -3.4244330599904060e-03 + + 2.7213689684867859e-01 -7.6395228505134583e-02 + <_> + + 0 -1 610 2.7591470279730856e-04 + + -1.0742840170860291e-01 2.2888970375061035e-01 + <_> + + 0 -1 611 -6.0005177510902286e-04 + + -2.9854211211204529e-01 6.3479736447334290e-02 + <_> + + 0 -1 612 -2.5001438916660845e-04 + + -2.7178969979286194e-01 6.9615006446838379e-02 + <_> + + 0 -1 613 6.8751391954720020e-03 + + -5.7185899466276169e-02 3.6695951223373413e-01 + <_> + + 0 -1 614 1.2761900201439857e-02 + + 6.7955687642097473e-02 -2.8534150123596191e-01 + <_> + + 0 -1 615 -1.4752789866179228e-03 + + 2.0680660009384155e-01 -1.0059390217065811e-01 + <_> + + 0 -1 616 1.2138819694519043e-01 + + -9.7126796841621399e-02 1.9789619743824005e-01 + <_> + + 0 -1 617 -5.0081279128789902e-02 + + 2.8417178988456726e-01 -6.7879997193813324e-02 + <_> + + 0 -1 618 3.1454950571060181e-02 + + -8.9468672871589661e-02 2.1298420429229736e-01 + <_> + + 0 -1 619 1.8878319533541799e-03 + + -1.1656440049409866e-01 1.6663520038127899e-01 + <_> + + 0 -1 620 -5.7211960665881634e-03 + + 2.3702140152454376e-01 -9.0776607394218445e-02 + <_> + + 0 -1 621 -1.8076719425152987e-04 + + 1.7951929569244385e-01 -1.0793480277061462e-01 + <_> + + 0 -1 622 -1.9761849939823151e-01 + + 4.5674291253089905e-01 -4.0480159223079681e-02 + <_> + + 0 -1 623 -2.3846809926908463e-04 + + -2.3733009397983551e-01 7.5922161340713501e-02 + <_> + + 0 -1 624 2.1540730085689574e-04 + + 8.1688016653060913e-02 -2.8685030341148376e-01 + <_> + + 0 -1 625 1.0163090191781521e-02 + + -4.1250020265579224e-02 4.8038348555564880e-01 + <_> + + 0 -1 626 -7.2184870950877666e-03 + + 1.7458580434322357e-01 -1.0146500170230865e-01 + <_> + + 0 -1 627 2.4263170361518860e-01 + + 5.3426481783390045e-02 -3.2318529486656189e-01 + <_> + + 0 -1 628 6.9304101634770632e-04 + + -1.1499179899692535e-01 1.4793939888477325e-01 + <_> + + 0 -1 629 3.5475199110805988e-03 + + -3.9424978196620941e-02 5.3126180171966553e-01 + <_> + + 0 -1 630 2.1403690334409475e-04 + + 6.9753833115100861e-02 -2.7319580316543579e-01 + <_> + + 0 -1 631 -5.7119462871924043e-04 + + 3.4369900822639465e-01 -5.7699009776115417e-02 + <_> + + 0 -1 632 -6.6290069371461868e-03 + + 1.1758489906787872e-01 -1.5020139515399933e-01 + <_> + 66 + -1.0888810157775879e+00 + + <_> + + 0 -1 633 -2.6513449847698212e-02 + + 2.0568640530109406e-01 -2.6473900675773621e-01 + <_> + + 0 -1 634 9.7727458924055099e-03 + + -1.1192840337753296e-01 3.2570549845695496e-01 + <_> + + 0 -1 635 3.2290350645780563e-02 + + -9.8574757575988770e-02 3.1779170036315918e-01 + <_> + + 0 -1 636 -2.8103240765631199e-03 + + 1.5213899314403534e-01 -1.9686409831047058e-01 + <_> + + 0 -1 637 -1.0991429910063744e-02 + + 5.1407659053802490e-01 -4.3707210570573807e-02 + <_> + + 0 -1 638 6.3133831135928631e-03 + + -9.2781022191047668e-02 3.4702470898628235e-01 + <_> + + 0 -1 639 8.7105982005596161e-02 + + 3.0053649097681046e-02 -8.2814818620681763e-01 + <_> + + 0 -1 640 1.1799359926953912e-03 + + -1.2928420305252075e-01 2.0646120607852936e-01 + <_> + + 0 -1 641 -9.3056890182197094e-04 + + -5.0021439790725708e-01 9.3666993081569672e-02 + <_> + + 0 -1 642 -1.3687170110642910e-02 + + -7.9358148574829102e-01 -6.6733639687299728e-03 + <_> + + 0 -1 643 -7.5917452573776245e-02 + + 3.0469641089439392e-01 -7.9655893146991730e-02 + <_> + + 0 -1 644 -2.8559709899127483e-03 + + 2.0961460471153259e-01 -1.2732550501823425e-01 + <_> + + 0 -1 645 -4.0231510065495968e-03 + + -6.5817278623580933e-01 5.0683639943599701e-02 + <_> + + 0 -1 646 1.7558040097355843e-02 + + -8.5382692515850067e-02 3.6174559593200684e-01 + <_> + + 0 -1 647 2.1988239139318466e-02 + + 6.2943696975708008e-02 -7.0896339416503906e-01 + <_> + + 0 -1 648 -2.8599589131772518e-03 + + 1.4683780074119568e-01 -1.6465979814529419e-01 + <_> + + 0 -1 649 -1.0030849836766720e-02 + + 4.9579939246177673e-01 -2.7188340201973915e-02 + <_> + + 0 -1 650 -6.9560329429805279e-03 + + 2.7977779507637024e-01 -7.7953331172466278e-02 + <_> + + 0 -1 651 -3.8356808945536613e-03 + + -5.8163982629776001e-01 3.5739939659833908e-02 + <_> + + 0 -1 652 -3.2647319603711367e-03 + + -4.9945080280303955e-01 4.6986490488052368e-02 + <_> + + 0 -1 653 -7.8412350267171860e-03 + + 3.4532830119132996e-01 -6.8810403347015381e-02 + <_> + + 0 -1 654 -8.1718113506212831e-05 + + 1.5041710436344147e-01 -1.4146679639816284e-01 + <_> + + 0 -1 655 -3.2448628917336464e-03 + + 2.2724510729312897e-01 -9.2860206961631775e-02 + <_> + + 0 -1 656 -7.8561151167377830e-04 + + -4.4319018721580505e-01 5.7812441140413284e-02 + <_> + + 0 -1 657 -6.2474247533828020e-04 + + 1.3952389359474182e-01 -1.4668719470500946e-01 + <_> + + 0 -1 658 -3.2942948746494949e-04 + + -2.9901570081710815e-01 7.6066739857196808e-02 + <_> + + 0 -1 659 1.2605739757418633e-03 + + -1.6125600039958954e-01 1.3953800499439240e-01 + <_> + + 0 -1 660 -5.1667019724845886e-02 + + -5.3142839670181274e-01 4.0719520300626755e-02 + <_> + + 0 -1 661 -1.5285619534552097e-02 + + -7.8206378221511841e-01 2.7183769270777702e-02 + <_> + + 0 -1 662 6.9029822945594788e-02 + + -3.6427021026611328e-02 7.1102517843246460e-01 + <_> + + 0 -1 663 1.4522749697789550e-03 + + -9.6890516579151154e-02 2.1668420732021332e-01 + <_> + + 0 -1 664 -2.4765590205788612e-03 + + 1.1645310372114182e-01 -1.8227979540824890e-01 + <_> + + 0 -1 665 -1.5134819550439715e-03 + + 1.7863979935646057e-01 -1.2214969843626022e-01 + <_> + + 0 -1 666 -1.5099470037966967e-03 + + 1.8086239695549011e-01 -1.1446069926023483e-01 + <_> + + 0 -1 667 -6.7054620012640953e-03 + + 2.5106599926948547e-01 -9.1871462762355804e-02 + <_> + + 0 -1 668 -1.4075200073421001e-02 + + 1.3707509636878967e-01 -1.7333500087261200e-01 + <_> + + 0 -1 669 -2.2400720044970512e-03 + + 4.0092980861663818e-01 -4.7576878219842911e-02 + <_> + + 0 -1 670 1.9782369956374168e-02 + + -1.9040350615978241e-01 1.4923410117626190e-01 + <_> + + 0 -1 671 2.6002870872616768e-03 + + 4.6971768140792847e-02 -4.3307659029960632e-01 + <_> + + 0 -1 672 -5.3445628145709634e-04 + + -4.3744230270385742e-01 4.1520189493894577e-02 + <_> + + 0 -1 673 -1.7466509714722633e-02 + + 6.5818172693252563e-01 -3.4447491168975830e-02 + <_> + + 0 -1 674 -2.0425589755177498e-03 + + 3.9657929539680481e-01 -4.4052429497241974e-02 + <_> + + 0 -1 675 2.6661779265850782e-03 + + 5.8770958334207535e-02 -3.2806369662284851e-01 + <_> + + 0 -1 676 -5.5982369929552078e-02 + + -5.1735472679138184e-01 3.5791840404272079e-02 + <_> + + 0 -1 677 -1.5066330088302493e-03 + + 1.5123869478702545e-01 -1.2520180642604828e-01 + <_> + + 0 -1 678 -1.1472369544208050e-02 + + -6.2930530309677124e-01 3.4704331308603287e-02 + <_> + + 0 -1 679 2.3409629240632057e-02 + + -5.8063350617885590e-02 3.8668221235275269e-01 + <_> + + 0 -1 680 -2.3243729956448078e-03 + + 1.8754099309444427e-01 -9.8394669592380524e-02 + <_> + + 0 -1 681 -2.9039299115538597e-02 + + -5.4486900568008423e-01 4.0926340967416763e-02 + <_> + + 0 -1 682 -1.4474649913609028e-02 + + -6.7248392105102539e-01 2.3128850385546684e-02 + <_> + + 0 -1 683 -5.2086091600358486e-03 + + -4.3271440267562866e-01 4.3780650943517685e-02 + <_> + + 0 -1 684 4.9382899887859821e-03 + + -1.0878620296716690e-01 1.9342589378356934e-01 + <_> + + 0 -1 685 -4.3193930760025978e-03 + + 2.4080930650234222e-01 -1.0380800068378448e-01 + <_> + + 0 -1 686 2.3705669445917010e-04 + + -8.7349072098731995e-02 2.0466239750385284e-01 + <_> + + 0 -1 687 4.7858079778961837e-04 + + 4.5624580234289169e-02 -3.8854670524597168e-01 + <_> + + 0 -1 688 -8.5342838428914547e-04 + + -5.5077940225601196e-01 3.5825889557600021e-02 + <_> + + 0 -1 689 5.4772121075075120e-05 + + -1.1225239932537079e-01 1.7503519356250763e-01 + <_> + + 0 -1 690 -3.8445889949798584e-03 + + 2.4526700377464294e-01 -8.1132568418979645e-02 + <_> + + 0 -1 691 -4.0128458291292191e-02 + + -6.3122707605361938e-01 2.6972670108079910e-02 + <_> + + 0 -1 692 -1.7886360001284629e-04 + + 1.9855099916458130e-01 -1.0333680361509323e-01 + <_> + + 0 -1 693 1.7668239888735116e-04 + + -9.1359011828899384e-02 1.9848720729351044e-01 + <_> + + 0 -1 694 7.2763383388519287e-02 + + 5.0075579434633255e-02 -3.3852630853652954e-01 + <_> + + 0 -1 695 1.0181630030274391e-02 + + -9.3229979276657104e-02 2.0059590041637421e-01 + <_> + + 0 -1 696 2.4409969337284565e-03 + + 6.4636632800102234e-02 -2.6921740174293518e-01 + <_> + + 0 -1 697 -3.6227488890290260e-03 + + 1.3169890642166138e-01 -1.2514840066432953e-01 + <_> + + 0 -1 698 -1.3635610230267048e-03 + + 1.6350460052490234e-01 -1.0665939748287201e-01 + <_> + 69 + -1.0408929586410522e+00 + + <_> + + 0 -1 699 -9.6991164609789848e-03 + + 6.1125320196151733e-01 -6.6225312650203705e-02 + <_> + + 0 -1 700 -9.6426531672477722e-03 + + -1. 2.7699959464371204e-03 + <_> + + 0 -1 701 -9.6381865441799164e-03 + + 1. -2.9904270195402205e-04 + <_> + + 0 -1 702 -4.2553939856588840e-03 + + 2.8464388847351074e-01 -1.5540120005607605e-01 + <_> + + 0 -1 703 -9.6223521977663040e-03 + + -1. 4.3999180197715759e-02 + <_> + + 0 -1 704 -9.1231241822242737e-03 + + 8.6869341135025024e-01 -2.7267890982329845e-03 + <_> + + 0 -1 705 -8.6240433156490326e-03 + + 4.5352488756179810e-01 -8.6071379482746124e-02 + <_> + + 0 -1 706 -8.9324144646525383e-03 + + 1.3375559449195862e-01 -2.6012519001960754e-01 + <_> + + 0 -1 707 -1.4207810163497925e-02 + + 3.2077640295028687e-01 -9.7226411104202271e-02 + <_> + + 0 -1 708 2.5911010801792145e-02 + + -1.2964080274105072e-01 2.6218649744987488e-01 + <_> + + 0 -1 709 2.0531509653665125e-04 + + -1.2404280155897141e-01 2.1062959730625153e-01 + <_> + + 0 -1 710 -5.4795680625829846e-05 + + 1.1974299699068069e-01 -2.3201279342174530e-01 + <_> + + 0 -1 711 6.8555199541151524e-03 + + -6.3276126980781555e-02 4.1044250130653381e-01 + <_> + + 0 -1 712 -1.2253040447831154e-02 + + 5.4883331060409546e-01 -3.9731100201606750e-02 + <_> + + 0 -1 713 -3.9058770053088665e-03 + + 2.4190980195999146e-01 -9.7096011042594910e-02 + <_> + + 0 -1 714 2.7560980524867773e-03 + + -1.2569679319858551e-01 1.9456650316715240e-01 + <_> + + 0 -1 715 -7.7662160620093346e-03 + + 2.9765701293945312e-01 -9.6818156540393829e-02 + <_> + + 0 -1 716 3.8997188676148653e-04 + + 6.2188401818275452e-02 -4.2040899395942688e-01 + <_> + + 0 -1 717 3.3579880837351084e-03 + + 4.7498140484094620e-02 -6.3216882944107056e-01 + <_> + + 0 -1 718 -1.6745539382100105e-02 + + 7.1098130941390991e-01 -3.9157349616289139e-02 + <_> + + 0 -1 719 -6.5409899689257145e-03 + + -3.5043171048164368e-01 7.0616953074932098e-02 + <_> + + 0 -1 720 3.0016340315341949e-04 + + 9.1902457177639008e-02 -2.4618670344352722e-01 + <_> + + 0 -1 721 1.4918990433216095e-02 + + -5.1909450441598892e-02 5.6636041402816772e-01 + <_> + + 0 -1 722 4.8153079114854336e-04 + + 6.4659558236598969e-02 -3.6590608954429626e-01 + <_> + + 0 -1 723 -3.0211321427486837e-04 + + 1.7926569283008575e-01 -1.1410660296678543e-01 + <_> + + 0 -1 724 3.8521419628523290e-04 + + 1.0345619916915894e-01 -2.0072460174560547e-01 + <_> + + 0 -1 725 8.0837132409214973e-03 + + -6.6073462367057800e-02 3.0284249782562256e-01 + <_> + + 0 -1 726 -2.2804969921708107e-02 + + 5.2962350845336914e-01 -4.0118999779224396e-02 + <_> + + 0 -1 727 1.9440450705587864e-04 + + 8.1854820251464844e-02 -2.4663360416889191e-01 + <_> + + 0 -1 728 -1.2848090380430222e-02 + + -3.4973311424255371e-01 5.6916229426860809e-02 + <_> + + 0 -1 729 -1.0937290498986840e-03 + + 2.3368680477142334e-01 -9.1604806482791901e-02 + <_> + + 0 -1 730 1.0032650316134095e-03 + + 1.1852180212736130e-01 -1.8469190597534180e-01 + <_> + + 0 -1 731 -4.4688429683446884e-02 + + -6.4362460374832153e-01 3.0363269150257111e-02 + <_> + + 0 -1 732 8.1657543778419495e-03 + + 4.3674658983945847e-02 -4.3002089858055115e-01 + <_> + + 0 -1 733 -1.1717810295522213e-02 + + 4.1781479120254517e-01 -4.8233699053525925e-02 + <_> + + 0 -1 734 8.4277130663394928e-02 + + 5.3461279720067978e-02 -3.7952190637588501e-01 + <_> + + 0 -1 735 1.4211839996278286e-02 + + 4.4900938868522644e-02 -4.2981499433517456e-01 + <_> + + 0 -1 736 1.5028340276330709e-03 + + 8.2227639853954315e-02 -2.4706399440765381e-01 + <_> + + 0 -1 737 1.0003579780459404e-02 + + -5.7221669703722000e-02 3.4609371423721313e-01 + <_> + + 0 -1 738 -9.0706320479512215e-03 + + 4.5058089494705200e-01 -4.2795319110155106e-02 + <_> + + 0 -1 739 -3.3141620224341750e-04 + + 1.8336910009384155e-01 -1.0759949684143066e-01 + <_> + + 0 -1 740 1.9723279774188995e-01 + + -3.0363829806447029e-02 6.6423428058624268e-01 + <_> + + 0 -1 741 -7.1258801035583019e-03 + + -8.9225047826766968e-01 2.5669990107417107e-02 + <_> + + 0 -1 742 8.6921341717243195e-03 + + -7.0764370262622833e-02 2.8210529685020447e-01 + <_> + + 0 -1 743 8.9262127876281738e-03 + + 7.1078233420848846e-02 -3.0232560634613037e-01 + <_> + + 0 -1 744 5.7286009192466736e-02 + + 5.0974130630493164e-02 -3.9196950197219849e-01 + <_> + + 0 -1 745 3.7920880131423473e-03 + + 3.3841941505670547e-02 -5.1016288995742798e-01 + <_> + + 0 -1 746 -1.4508679741993546e-03 + + 3.0879148840904236e-01 -6.3845083117485046e-02 + <_> + + 0 -1 747 9.8390132188796997e-04 + + -1.3029569387435913e-01 1.4604410529136658e-01 + <_> + + 0 -1 748 -1.7221809830516577e-03 + + 2.9157009720802307e-01 -6.8549558520317078e-02 + <_> + + 0 -1 749 1.0948250070214272e-02 + + 3.4351408481597900e-02 -4.7702258825302124e-01 + <_> + + 0 -1 750 -1.7176309484057128e-05 + + 1.6055269539356232e-01 -1.1690840125083923e-01 + <_> + + 0 -1 751 -5.4884208366274834e-03 + + -4.3415889143943787e-01 4.6106241643428802e-02 + <_> + + 0 -1 752 -3.0975250992923975e-03 + + 3.7943339347839355e-01 -5.6860551238059998e-02 + <_> + + 0 -1 753 6.4182081259787083e-03 + + -1.5858210623264313e-01 1.2335419654846191e-01 + <_> + + 0 -1 754 1.1831239797174931e-02 + + -4.0929291397333145e-02 4.5878958702087402e-01 + <_> + + 0 -1 755 1.3540499843657017e-02 + + -5.3725559264421463e-02 3.5056120157241821e-01 + <_> + + 0 -1 756 -2.5932150892913342e-03 + + 1.1010520160198212e-01 -1.6752210259437561e-01 + <_> + + 0 -1 757 1.6856270376592875e-03 + + 6.6574357450008392e-02 -3.0835020542144775e-01 + <_> + + 0 -1 758 2.6524690911173820e-03 + + 6.6318482160568237e-02 -2.7861338853836060e-01 + <_> + + 0 -1 759 -7.7341729775071144e-03 + + 1.9718359410762787e-01 -1.0782919824123383e-01 + <_> + + 0 -1 760 5.0944271497428417e-03 + + 8.5337489843368530e-02 -2.4847009778022766e-01 + <_> + + 0 -1 761 -2.9162371065467596e-03 + + -4.7476351261138916e-01 3.3566489815711975e-02 + <_> + + 0 -1 762 3.0121419113129377e-03 + + -4.7575380653142929e-02 4.2586800456047058e-01 + <_> + + 0 -1 763 3.1694869976490736e-03 + + -1.0519450157880783e-01 1.7163459956645966e-01 + <_> + + 0 -1 764 2.2327560186386108e-01 + + -1.4370209537446499e-02 9.2483651638031006e-01 + <_> + + 0 -1 765 -9.5585048198699951e-02 + + -7.4206638336181641e-01 2.7818970382213593e-02 + <_> + + 0 -1 766 3.4773729566950351e-05 + + -1.2765780091285706e-01 1.2926669418811798e-01 + <_> + + 0 -1 767 7.2459770308341831e-05 + + -1.6518579423427582e-01 1.0036809742450714e-01 + <_> + 59 + -1.0566600561141968e+00 + + <_> + + 0 -1 768 -6.5778270363807678e-03 + + 3.3815258741378784e-01 -1.5281909704208374e-01 + <_> + + 0 -1 769 -1.0922809597104788e-03 + + 2.2282369434833527e-01 -1.9308499991893768e-01 + <_> + + 0 -1 770 -2.9759589582681656e-02 + + 2.5959870219230652e-01 -1.5409409999847412e-01 + <_> + + 0 -1 771 -1.3147540390491486e-02 + + 1.9033810496330261e-01 -1.6543999314308167e-01 + <_> + + 0 -1 772 -1.4396329643204808e-03 + + 2.0071710646152496e-01 -1.2338940054178238e-01 + <_> + + 0 -1 773 -3.5928250290453434e-03 + + 2.3985520005226135e-01 -1.2922149896621704e-01 + <_> + + 0 -1 774 -1.5314699849113822e-03 + + -4.9014899134635925e-01 1.0275030136108398e-01 + <_> + + 0 -1 775 -6.2372139655053616e-03 + + 3.1214639544487000e-01 -1.1405629664659500e-01 + <_> + + 0 -1 776 -3.3364649862051010e-02 + + -4.9520879983901978e-01 5.1328450441360474e-02 + <_> + + 0 -1 777 -2.2827699780464172e-02 + + 3.2558828592300415e-01 -6.5089307725429535e-02 + <_> + + 0 -1 778 -8.6199097335338593e-02 + + -6.7646330595016479e-01 2.6985699310898781e-02 + <_> + + 0 -1 779 -2.1065981127321720e-03 + + 2.2452430427074432e-01 -1.2610229849815369e-01 + <_> + + 0 -1 780 3.9120148867368698e-02 + + 1.1329399794340134e-01 -2.6860630512237549e-01 + <_> + + 0 -1 781 3.5082739777863026e-03 + + -1.1359959840774536e-01 2.5649771094322205e-01 + <_> + + 0 -1 782 5.9289898490533233e-04 + + -1.4942969381809235e-01 1.6409839689731598e-01 + <_> + + 0 -1 783 7.1766850305721164e-04 + + 9.9905692040920258e-02 -2.1967969834804535e-01 + <_> + + 0 -1 784 -2.1803600713610649e-02 + + -3.1711721420288086e-01 8.2889586687088013e-02 + <_> + + 0 -1 785 -3.2962779514491558e-03 + + -3.8048729300498962e-01 6.0819379985332489e-02 + <_> + + 0 -1 786 2.4196270387619734e-03 + + -9.6013016998767853e-02 2.8540581464767456e-01 + <_> + + 0 -1 787 -4.4187481398694217e-04 + + 2.2127939760684967e-01 -9.7434908151626587e-02 + <_> + + 0 -1 788 3.4523929934948683e-03 + + 3.7553120404481888e-02 -5.7969051599502563e-01 + <_> + + 0 -1 789 -2.1834600716829300e-02 + + 2.9562139511108398e-01 -8.0048300325870514e-02 + <_> + + 0 -1 790 -2.1309500152710825e-04 + + 2.2814509272575378e-01 -1.0114189982414246e-01 + <_> + + 0 -1 791 -1.6166249988600612e-03 + + -5.0541198253631592e-01 4.4764541089534760e-02 + <_> + + 0 -1 792 7.5959609821438789e-03 + + 4.5986540615558624e-02 -4.1197681427001953e-01 + <_> + + 0 -1 793 3.8601809646934271e-03 + + -8.6563169956207275e-02 2.4809999763965607e-01 + <_> + + 0 -1 794 6.0622231103479862e-03 + + -7.5557373464107513e-02 2.8433260321617126e-01 + <_> + + 0 -1 795 -1.7097420059144497e-03 + + -3.5295820236206055e-01 5.8410499244928360e-02 + <_> + + 0 -1 796 1.6515579074621201e-02 + + -8.0486953258514404e-02 2.3537430167198181e-01 + <_> + + 0 -1 797 4.8465100117027760e-03 + + 4.1895218193531036e-02 -4.8443049192428589e-01 + <_> + + 0 -1 798 -3.1167170032858849e-02 + + 1.9192309677600861e-01 -1.0268159955739975e-01 + <_> + + 0 -1 799 6.1892281519249082e-04 + + -2.1085770428180695e-01 9.3886926770210266e-02 + <_> + + 0 -1 800 1.1946310289204121e-02 + + 3.9096169173717499e-02 -6.2248629331588745e-01 + <_> + + 0 -1 801 -7.5677200220525265e-03 + + 1.5936839580535889e-01 -1.2250780314207077e-01 + <_> + + 0 -1 802 -5.3747411817312241e-02 + + -5.5622178316116333e-01 4.1190009564161301e-02 + <_> + + 0 -1 803 1.5513530001044273e-02 + + -3.9826881140470505e-02 6.2400728464126587e-01 + <_> + + 0 -1 804 1.5246650436893106e-03 + + 7.0138677954673767e-02 -3.0789071321487427e-01 + <_> + + 0 -1 805 -4.8315100139006972e-04 + + 1.7887659370899200e-01 -1.0958620160818100e-01 + <_> + + 0 -1 806 2.7374739293009043e-03 + + 2.7478590607643127e-02 -8.8489568233489990e-01 + <_> + + 0 -1 807 -6.5787717700004578e-02 + + -4.6432140469551086e-01 3.5037148743867874e-02 + <_> + + 0 -1 808 1.2409730115905404e-03 + + -9.6479237079620361e-02 2.8779220581054688e-01 + <_> + + 0 -1 809 8.1398809561505914e-04 + + 1.1511719971895218e-01 -1.6766160726547241e-01 + <_> + + 0 -1 810 2.3901820182800293e-02 + + -3.2603189349174500e-02 6.0017347335815430e-01 + <_> + + 0 -1 811 2.7556600049138069e-02 + + -6.6137343645095825e-02 2.9994478821754456e-01 + <_> + + 0 -1 812 -3.8070970913395286e-04 + + -3.3881181478500366e-01 6.4450770616531372e-02 + <_> + + 0 -1 813 -1.3335429830476642e-03 + + 1.4588660001754761e-01 -1.3217620551586151e-01 + <_> + + 0 -1 814 -9.3507990241050720e-03 + + -5.1177829504013062e-01 3.4969471395015717e-02 + <_> + + 0 -1 815 7.6215229928493500e-03 + + 2.3249529302120209e-02 -6.9619411230087280e-01 + <_> + + 0 -1 816 -5.3407860832521692e-05 + + 2.3727379739284515e-01 -8.6910709738731384e-02 + <_> + + 0 -1 817 -1.5332329785451293e-03 + + 1.9228410720825195e-01 -1.0422399640083313e-01 + <_> + + 0 -1 818 4.3135890737175941e-03 + + -9.6219547092914581e-02 2.5601211190223694e-01 + <_> + + 0 -1 819 -2.3042880638968199e-04 + + -3.1564751267433167e-01 5.8838598430156708e-02 + <_> + + 0 -1 820 -7.8411828726530075e-03 + + -6.6340929269790649e-01 2.4500999599695206e-02 + <_> + + 0 -1 821 1.7103740572929382e-01 + + 3.3831499516963959e-02 -4.5615941286087036e-01 + <_> + + 0 -1 822 -1.6011140542104840e-03 + + 2.1574890613555908e-01 -8.3622530102729797e-02 + <_> + + 0 -1 823 -1.0535780340433121e-02 + + 2.4552319943904877e-01 -8.2384489476680756e-02 + <_> + + 0 -1 824 -5.8351638726890087e-03 + + -4.7807329893112183e-01 4.4086221605539322e-02 + <_> + + 0 -1 825 -1.8706109374761581e-02 + + -6.0024029016494751e-01 2.1410040557384491e-02 + <_> + + 0 -1 826 -9.3307439237833023e-04 + + 2.4323590099811554e-01 -7.4165716767311096e-02 + <_> + 88 + -9.7693431377410889e-01 + + <_> + + 0 -1 827 1.0646229609847069e-02 + + -1.3861389458179474e-01 2.6494070887565613e-01 + <_> + + 0 -1 828 3.5298269242048264e-02 + + -7.5821727514266968e-02 3.9021068811416626e-01 + <_> + + 0 -1 829 7.5638387352228165e-04 + + -9.5521442592144012e-02 2.9061999917030334e-01 + <_> + + 0 -1 830 9.2497706413269043e-02 + + -2.7704238891601562e-01 7.9474702477455139e-02 + <_> + + 0 -1 831 -2.9340879991650581e-03 + + 2.2989539802074432e-01 -7.8550010919570923e-02 + <_> + + 0 -1 832 -8.6535848677158356e-02 + + 4.7744810581207275e-01 -6.8231220357120037e-03 + <_> + + 0 -1 833 5.4699288739357144e-05 + + -2.2642609477043152e-01 8.8192112743854523e-02 + <_> + + 0 -1 834 -3.6592520773410797e-02 + + 2.7353870868682861e-01 -9.8606742918491364e-02 + <_> + + 0 -1 835 2.6469118893146515e-03 + + -4.4083978980779648e-02 3.1445288658142090e-01 + <_> + + 0 -1 836 -4.4271810911595821e-03 + + 2.3822729289531708e-01 -8.6784273386001587e-02 + <_> + + 0 -1 837 -5.1882481202483177e-03 + + 1.5042769908905029e-01 -1.2672109901905060e-01 + <_> + + 0 -1 838 4.5530400238931179e-03 + + -5.5945020169019699e-02 3.6501631140708923e-01 + <_> + + 0 -1 839 1.4562410302460194e-02 + + 3.6397770047187805e-02 -5.3559190034866333e-01 + <_> + + 0 -1 840 6.8677567469421774e-05 + + -1.7479629814624786e-01 1.1068709939718246e-01 + <_> + + 0 -1 841 -5.9744901955127716e-03 + + 3.1077870726585388e-01 -6.6530227661132812e-02 + <_> + + 0 -1 842 -5.8691250160336494e-03 + + -3.1901490688323975e-01 6.3931830227375031e-02 + <_> + + 0 -1 843 -1.1140310205519199e-02 + + 2.4364790320396423e-01 -8.0935180187225342e-02 + <_> + + 0 -1 844 -5.8643531054258347e-02 + + -7.6083260774612427e-01 3.0809629708528519e-02 + <_> + + 0 -1 845 -4.6097282320261002e-03 + + -4.5315021276473999e-01 2.9879059642553329e-02 + <_> + + 0 -1 846 -9.3032103031873703e-03 + + 1.4513379335403442e-01 -1.1033169925212860e-01 + <_> + + 0 -1 847 1.3253629440441728e-03 + + -9.7698956727981567e-02 1.9646440446376801e-01 + <_> + + 0 -1 848 4.9800761044025421e-03 + + 3.3648081123828888e-02 -3.9792209863662720e-01 + <_> + + 0 -1 849 -7.6542161405086517e-03 + + 9.0841993689537048e-02 -1.5967549383640289e-01 + <_> + + 0 -1 850 -3.8920590281486511e-01 + + -6.6571092605590820e-01 1.9028829410672188e-02 + <_> + + 0 -1 851 -1.0019669681787491e-01 + + -5.7559269666671753e-01 2.4282779544591904e-02 + <_> + + 0 -1 852 7.3541211895644665e-04 + + 8.7919801473617554e-02 -1.6195340454578400e-01 + <_> + + 0 -1 853 -3.4802639856934547e-03 + + 2.6064491271972656e-01 -6.0200810432434082e-02 + <_> + + 0 -1 854 8.4000425413250923e-03 + + -1.0979729890823364e-01 1.5707309544086456e-01 + <_> + + 0 -1 855 2.3786011151969433e-03 + + 3.6058239638805389e-02 -4.7277191281318665e-01 + <_> + + 0 -1 856 7.3831682093441486e-03 + + -3.5756360739469528e-02 4.9498590826988220e-01 + <_> + + 0 -1 857 3.2115620560944080e-03 + + -1.0125560313463211e-01 1.5747989714145660e-01 + <_> + + 0 -1 858 -7.8209668397903442e-02 + + -7.6627081632614136e-01 2.2965829819440842e-02 + <_> + + 0 -1 859 5.3303989261621609e-05 + + -1.3414350152015686e-01 1.1114919930696487e-01 + <_> + + 0 -1 860 -9.6419155597686768e-03 + + 2.5068029761314392e-01 -6.6608138382434845e-02 + <_> + + 0 -1 861 -7.1092672646045685e-02 + + -4.0056818723678589e-01 4.0297791361808777e-02 + <_> + + 0 -1 862 3.5171560011804104e-04 + + 4.1861180216073990e-02 -3.2961198687553406e-01 + <_> + + 0 -1 863 -3.3458150574006140e-04 + + -2.6029831171035767e-01 6.7892737686634064e-02 + <_> + + 0 -1 864 -4.1451421566307545e-03 + + 2.3967699706554413e-01 -7.2093337774276733e-02 + <_> + + 0 -1 865 3.1754500232636929e-03 + + -7.1235269308090210e-02 2.4128450453281403e-01 + <_> + + 0 -1 866 -5.5184490047395229e-03 + + 5.0320237874984741e-01 -2.9686680063605309e-02 + <_> + + 0 -1 867 -3.0242869979701936e-04 + + 2.4879050254821777e-01 -5.6758578866720200e-02 + <_> + + 0 -1 868 -1.3125919504091144e-03 + + 3.1747800111770630e-01 -4.1845861822366714e-02 + <_> + + 0 -1 869 -2.7123570907860994e-04 + + -2.7042070031166077e-01 5.6828990578651428e-02 + <_> + + 0 -1 870 -7.3241777718067169e-03 + + 2.7556678652763367e-01 -5.4252970963716507e-02 + <_> + + 0 -1 871 -1.6851710155606270e-02 + + -3.4852910041809082e-01 4.5368999242782593e-02 + <_> + + 0 -1 872 2.9902100563049316e-02 + + 3.1621079891920090e-02 -4.3114370107650757e-01 + <_> + + 0 -1 873 2.8902660124003887e-03 + + 3.8029961287975311e-02 -3.7027099728584290e-01 + <_> + + 0 -1 874 -1.9242949783802032e-03 + + 2.4800279736518860e-01 -5.9333298355340958e-02 + <_> + + 0 -1 875 4.9354149959981441e-03 + + -8.3068400621414185e-02 2.2043809294700623e-01 + <_> + + 0 -1 876 8.2075603306293488e-02 + + -1.9413439556956291e-02 6.9089287519454956e-01 + <_> + + 0 -1 877 -2.4699489586055279e-04 + + -2.4660569429397583e-01 6.4776450395584106e-02 + <_> + + 0 -1 878 -1.8365769647061825e-03 + + 2.8836160898208618e-01 -5.3390458226203918e-02 + <_> + + 0 -1 879 -4.9553811550140381e-03 + + 1.2740829586982727e-01 -1.2559419870376587e-01 + <_> + + 0 -1 880 -8.3086621016263962e-03 + + 2.3478110134601593e-01 -7.1676492691040039e-02 + <_> + + 0 -1 881 -1.0879919677972794e-01 + + -2.5992238521575928e-01 5.8689739555120468e-02 + <_> + + 0 -1 882 -9.6786450594663620e-03 + + -7.0720428228378296e-01 1.8749259412288666e-02 + <_> + + 0 -1 883 -2.7136830613017082e-02 + + -5.8384227752685547e-01 2.1684130653738976e-02 + <_> + + 0 -1 884 -6.5389778465032578e-03 + + -5.9748911857604980e-01 2.1480310708284378e-02 + <_> + + 0 -1 885 -1.2095630168914795e-02 + + 1.3269039988517761e-01 -9.9722720682621002e-02 + <_> + + 0 -1 886 -1.6776099801063538e-01 + + -5.6655067205429077e-01 3.2123088836669922e-02 + <_> + + 0 -1 887 -1.3262550346553326e-02 + + 1.1495590209960938e-01 -1.1738389730453491e-01 + <_> + + 0 -1 888 7.6744519174098969e-02 + + -3.1413231045007706e-02 5.9935492277145386e-01 + <_> + + 0 -1 889 5.0785229541361332e-03 + + -5.2911940962076187e-02 2.3342399299144745e-01 + <_> + + 0 -1 890 3.1800279393792152e-03 + + -7.7734388411045074e-02 1.7652909457683563e-01 + <_> + + 0 -1 891 -1.7729829996824265e-03 + + 1.9591629505157471e-01 -7.9752199351787567e-02 + <_> + + 0 -1 892 -4.8560940194875002e-04 + + -2.8800371289253235e-01 4.9047119915485382e-02 + <_> + + 0 -1 893 3.6554320831783116e-04 + + 6.7922897636890411e-02 -2.2499430179595947e-01 + <_> + + 0 -1 894 -2.6938671362586319e-04 + + 1.6582170128822327e-01 -8.9744098484516144e-02 + <_> + + 0 -1 895 7.8684233129024506e-02 + + 2.6081679388880730e-02 -5.5693739652633667e-01 + <_> + + 0 -1 896 -7.3774810880422592e-04 + + 1.4036870002746582e-01 -1.1800300329923630e-01 + <_> + + 0 -1 897 2.3957829922437668e-02 + + 3.0470740050077438e-02 -4.6159979701042175e-01 + <_> + + 0 -1 898 -1.6239080578088760e-03 + + 2.6327079534530640e-01 -5.6765370070934296e-02 + <_> + + 0 -1 899 -9.0819748584181070e-04 + + 1.5462459623813629e-01 -1.1087069660425186e-01 + <_> + + 0 -1 900 3.9806248969398439e-04 + + 5.5630370974540710e-02 -2.8331959247589111e-01 + <_> + + 0 -1 901 2.0506449509412050e-03 + + -9.1604836285114288e-02 1.7585539817810059e-01 + <_> + + 0 -1 902 2.6742549613118172e-02 + + 6.2003031373023987e-02 -2.4487000703811646e-01 + <_> + + 0 -1 903 -2.1497008856385946e-03 + + 2.9449298977851868e-01 -5.3218148648738861e-02 + <_> + + 0 -1 904 5.6671658530831337e-03 + + -6.4298242330551147e-02 2.4905680119991302e-01 + <_> + + 0 -1 905 6.8317902332637459e-05 + + -1.6819630563259125e-01 9.6548579633235931e-02 + <_> + + 0 -1 906 1.7600439605303109e-04 + + 6.5308012068271637e-02 -2.4267880618572235e-01 + <_> + + 0 -1 907 4.1861608624458313e-03 + + -9.7988583147525787e-02 1.8052889406681061e-01 + <_> + + 0 -1 908 -2.1808340679854155e-03 + + 1.9231270253658295e-01 -9.4123929738998413e-02 + <_> + + 0 -1 909 2.1730400621891022e-02 + + 3.5578511655330658e-02 -4.5088538527488708e-01 + <_> + + 0 -1 910 -1.4780269935727119e-02 + + -4.3927010893821716e-01 3.1735591590404510e-02 + <_> + + 0 -1 911 -3.6145891062915325e-03 + + 1.9811479747295380e-01 -7.7701419591903687e-02 + <_> + + 0 -1 912 1.8892709631472826e-03 + + 1.9962439313530922e-02 -7.2041720151901245e-01 + <_> + + 0 -1 913 -1.3822480104863644e-03 + + 9.8466947674751282e-02 -1.4881080389022827e-01 + <_> + + 0 -1 914 -3.9505911991000175e-03 + + 1.1593230068683624e-01 -1.2791970372200012e-01 + <_> + 58 + -1.0129359960556030e+00 + + <_> + + 0 -1 915 -1.9395539537072182e-02 + + 4.7474750876426697e-01 -1.1721090227365494e-01 + <_> + + 0 -1 916 1.3118919916450977e-02 + + -2.5552129745483398e-01 1.6378800570964813e-01 + <_> + + 0 -1 917 -5.1606801571324468e-04 + + 1.9452619552612305e-01 -1.7448890209197998e-01 + <_> + + 0 -1 918 -1.3184159994125366e-02 + + 4.4181451201438904e-01 -9.0048752725124359e-02 + <_> + + 0 -1 919 3.4657081123441458e-03 + + -1.3477090001106262e-01 1.8056340515613556e-01 + <_> + + 0 -1 920 6.2980200164020061e-03 + + -5.4164979606866837e-02 3.6033380031585693e-01 + <_> + + 0 -1 921 1.6879989998415112e-03 + + -1.9997949898242950e-01 1.2021599709987640e-01 + <_> + + 0 -1 922 3.6039709812030196e-04 + + 1.0524140298366547e-01 -2.4116060137748718e-01 + <_> + + 0 -1 923 -1.5276849735528231e-03 + + 2.8135529160499573e-01 -6.8964816629886627e-02 + <_> + + 0 -1 924 3.5033570602536201e-03 + + -8.2519583404064178e-02 4.0713590383529663e-01 + <_> + + 0 -1 925 -4.7337161377072334e-03 + + 1.9727009534835815e-01 -1.1710140109062195e-01 + <_> + + 0 -1 926 -1.1557149700820446e-02 + + -5.6061112880706787e-01 6.8170957267284393e-02 + <_> + + 0 -1 927 -2.7445720508694649e-02 + + 4.9718621373176575e-01 -6.2380149960517883e-02 + <_> + + 0 -1 928 -5.2825778722763062e-02 + + 1.6921220719814301e-01 -1.3093550503253937e-01 + <_> + + 0 -1 929 -2.9849699139595032e-01 + + -6.4649671316146851e-01 4.0076818317174911e-02 + <_> + + 0 -1 930 -2.6307269581593573e-04 + + 2.5127941370010376e-01 -8.9494839310646057e-02 + <_> + + 0 -1 931 2.3261709429789335e-04 + + -8.6843989789485931e-02 2.3831979930400848e-01 + <_> + + 0 -1 932 2.3631360090803355e-04 + + 1.1554460227489471e-01 -1.8936349451541901e-01 + <_> + + 0 -1 933 2.0742209162563086e-03 + + -4.8594851046800613e-02 5.7485991716384888e-01 + <_> + + 0 -1 934 -7.0308889262378216e-03 + + -5.4120808839797974e-01 4.8743750900030136e-02 + <_> + + 0 -1 935 8.2652270793914795e-03 + + 2.6494519785046577e-02 -6.1728459596633911e-01 + <_> + + 0 -1 936 2.0042760297656059e-04 + + -1.1768630146980286e-01 1.6333860158920288e-01 + <_> + + 0 -1 937 1.6470040427520871e-03 + + -5.9954918920993805e-02 3.5179701447486877e-01 + <_> + + 0 -1 938 -3.5642538568936288e-04 + + -3.4420299530029297e-01 6.4948253333568573e-02 + <_> + + 0 -1 939 -3.0935870483517647e-02 + + 1.9979700446128845e-01 -9.7693696618080139e-02 + <_> + + 0 -1 940 -6.3578772824257612e-04 + + -3.1481391191482544e-01 5.9425041079521179e-02 + <_> + + 0 -1 941 -1.1862180195748806e-02 + + 2.0043690502643585e-01 -8.9447543025016785e-02 + <_> + + 0 -1 942 7.1508930996060371e-03 + + -3.9006061851978302e-02 5.3327161073684692e-01 + <_> + + 0 -1 943 -2.0059191156178713e-03 + + -2.8469720482826233e-01 7.0723608136177063e-02 + <_> + + 0 -1 944 3.6412389017641544e-03 + + -1.0660319775342941e-01 2.4944800138473511e-01 + <_> + + 0 -1 945 -1.3467429578304291e-01 + + 4.9910080432891846e-01 -4.0332220494747162e-02 + <_> + + 0 -1 946 -2.2547659464180470e-03 + + 1.6851690411567688e-01 -1.1119280010461807e-01 + <_> + + 0 -1 947 4.3842289596796036e-03 + + 8.6139492690563202e-02 -2.7431771159172058e-01 + <_> + + 0 -1 948 -7.3361168615520000e-03 + + 2.4875210225582123e-01 -9.5919162034988403e-02 + <_> + + 0 -1 949 6.4666912658140063e-04 + + 6.7431576550006866e-02 -3.3754080533981323e-01 + <_> + + 0 -1 950 2.2983769304119051e-04 + + -8.3903051912784576e-02 2.4584099650382996e-01 + <_> + + 0 -1 951 6.7039071582257748e-03 + + 2.9079329222440720e-02 -6.9055938720703125e-01 + <_> + + 0 -1 952 5.0734888645820320e-05 + + -1.5696719288825989e-01 1.1965429782867432e-01 + <_> + + 0 -1 953 -2.0335559546947479e-01 + + -6.9506347179412842e-01 2.7507519349455833e-02 + <_> + + 0 -1 954 9.4939414411783218e-03 + + -8.7449371814727783e-02 2.3968330025672913e-01 + <_> + + 0 -1 955 -2.4055240210145712e-03 + + 2.1150960028171539e-01 -1.3148930668830872e-01 + <_> + + 0 -1 956 -1.1342419747961685e-04 + + 1.5233789384365082e-01 -1.2725900113582611e-01 + <_> + + 0 -1 957 1.4992210082709789e-02 + + -3.4127969294786453e-02 5.0624072551727295e-01 + <_> + + 0 -1 958 7.4068200774490833e-04 + + 4.8764750361442566e-02 -4.0225321054458618e-01 + <_> + + 0 -1 959 -4.2459447868168354e-03 + + 2.1554760634899139e-01 -8.7126992642879486e-02 + <_> + + 0 -1 960 6.8655109498649836e-04 + + -7.5418718159198761e-02 2.6405909657478333e-01 + <_> + + 0 -1 961 -1.6751460731029510e-02 + + -6.7729032039642334e-01 3.2918728888034821e-02 + <_> + + 0 -1 962 -2.6301678735762835e-04 + + 2.2725869715213776e-01 -9.0534873306751251e-02 + <_> + + 0 -1 963 4.3398610432632267e-04 + + 5.5894378572702408e-02 -3.5592669248580933e-01 + <_> + + 0 -1 964 -2.0150149241089821e-02 + + 1.9162760674953461e-01 -9.4929970800876617e-02 + <_> + + 0 -1 965 -1.4452129602432251e-02 + + -6.8510341644287109e-01 2.5422170758247375e-02 + <_> + + 0 -1 966 -2.1149739623069763e-02 + + 3.7533190846443176e-01 -5.1496580243110657e-02 + <_> + + 0 -1 967 2.1137770265340805e-02 + + 2.9083080589771271e-02 -8.9430367946624756e-01 + <_> + + 0 -1 968 1.1524349683895707e-03 + + -6.9694936275482178e-02 2.7299800515174866e-01 + <_> + + 0 -1 969 -1.9070580310653895e-04 + + 1.8228119611740112e-01 -9.8367072641849518e-02 + <_> + + 0 -1 970 -3.6349631845951080e-02 + + -8.3693099021911621e-01 2.5055760517716408e-02 + <_> + + 0 -1 971 -9.0632075443863869e-03 + + 4.1463500261306763e-01 -5.4413449019193649e-02 + <_> + + 0 -1 972 -2.0535490475594997e-03 + + -1.9750310480594635e-01 1.0506899654865265e-01 + <_> + 93 + -9.7747492790222168e-01 + + <_> + + 0 -1 973 -2.2717019543051720e-02 + + 2.4288550019264221e-01 -1.4745520055294037e-01 + <_> + + 0 -1 974 2.5505950674414635e-02 + + -2.8551739454269409e-01 1.0837209969758987e-01 + <_> + + 0 -1 975 -2.6640091091394424e-03 + + 2.9275730252265930e-01 -1.0372710227966309e-01 + <_> + + 0 -1 976 -3.8115289062261581e-03 + + 2.1426899731159210e-01 -1.3811139762401581e-01 + <_> + + 0 -1 977 -1.6732690855860710e-02 + + 2.6550260186195374e-01 -4.3911330401897430e-02 + <_> + + 0 -1 978 4.9277010839432478e-04 + + 2.1104559302330017e-02 -4.2971360683441162e-01 + <_> + + 0 -1 979 -3.6691110581159592e-02 + + 5.3992420434951782e-01 -4.3648801743984222e-02 + <_> + + 0 -1 980 1.2615970335900784e-03 + + -1.2933869659900665e-01 1.6638770699501038e-01 + <_> + + 0 -1 981 -8.4106856957077980e-03 + + -9.4698411226272583e-01 2.1465849131345749e-02 + <_> + + 0 -1 982 6.4902722835540771e-02 + + -7.1727760136127472e-02 2.6613479852676392e-01 + <_> + + 0 -1 983 3.0305000022053719e-02 + + -8.2782492041587830e-02 2.7694320678710938e-01 + <_> + + 0 -1 984 2.5875340215861797e-03 + + -1.2966169416904449e-01 1.7756630480289459e-01 + <_> + + 0 -1 985 -7.0240451022982597e-03 + + -6.4243179559707642e-01 3.9943210780620575e-02 + <_> + + 0 -1 986 -1.0099769569933414e-03 + + 1.4176610112190247e-01 -1.1659970134496689e-01 + <_> + + 0 -1 987 -4.1179071558872238e-05 + + 1.5687669813632965e-01 -1.1127340048551559e-01 + <_> + + 0 -1 988 -4.7293151146732271e-04 + + -3.3554559946060181e-01 4.5977730304002762e-02 + <_> + + 0 -1 989 -1.7178079579025507e-03 + + 1.6952909529209137e-01 -1.0578069835901260e-01 + <_> + + 0 -1 990 -1.3333169743418694e-02 + + -5.8257812261581421e-01 3.0978430062532425e-02 + <_> + + 0 -1 991 -1.8783430568873882e-03 + + 1.4266879856586456e-01 -1.1131259799003601e-01 + <_> + + 0 -1 992 -6.5765981562435627e-03 + + 2.7561360597610474e-01 -5.3100328892469406e-02 + <_> + + 0 -1 993 -7.7210381277836859e-05 + + 1.3240240514278412e-01 -1.1167799681425095e-01 + <_> + + 0 -1 994 2.1968539804220200e-02 + + -2.6968160644173622e-02 5.0067168474197388e-01 + <_> + + 0 -1 995 -2.7445750311017036e-02 + + -2.4086740612983704e-01 6.0478270053863525e-02 + <_> + + 0 -1 996 7.8305849456228316e-05 + + -1.3334889709949493e-01 1.0123469680547714e-01 + <_> + + 0 -1 997 7.0190683007240295e-02 + + -5.4863780736923218e-02 2.4809940159320831e-01 + <_> + + 0 -1 998 -7.1902133524417877e-02 + + -3.7846690416336060e-01 4.2210999876260757e-02 + <_> + + 0 -1 999 -1.0780979692935944e-01 + + -3.7486588954925537e-01 4.2833440005779266e-02 + <_> + + 0 -1 1000 1.4364200178533792e-03 + + 8.0476358532905579e-02 -1.7263789474964142e-01 + <_> + + 0 -1 1001 6.8289190530776978e-02 + + -3.5595789551734924e-02 4.0761318802833557e-01 + <_> + + 0 -1 1002 -6.8037179298698902e-03 + + 1.9233790040016174e-01 -8.2368023693561554e-02 + <_> + + 0 -1 1003 -5.6193489581346512e-04 + + 1.3057120144367218e-01 -1.4355149865150452e-01 + <_> + + 0 -1 1004 -5.8276649564504623e-02 + + -3.0125439167022705e-01 5.2819650620222092e-02 + <_> + + 0 -1 1005 -6.1205718666315079e-03 + + 2.2043900191783905e-01 -7.5691752135753632e-02 + <_> + + 0 -1 1006 -1.3594309799373150e-02 + + -3.9049360156059265e-01 4.1857108473777771e-02 + <_> + + 0 -1 1007 1.3626200379803777e-03 + + -9.5363423228263855e-02 1.4970320463180542e-01 + <_> + + 0 -1 1008 -1.5074219845701009e-04 + + -2.3945580422878265e-01 6.4798332750797272e-02 + <_> + + 0 -1 1009 -7.7414259314537048e-02 + + 5.5941981077194214e-01 -2.4516880512237549e-02 + <_> + + 0 -1 1010 9.2117872554808855e-04 + + 5.4928861558437347e-02 -2.7934810519218445e-01 + <_> + + 0 -1 1011 1.0250780032947659e-03 + + -6.2167309224605560e-02 2.4976369738578796e-01 + <_> + + 0 -1 1012 -8.1174750812351704e-04 + + 2.3437939584255219e-01 -6.5725810825824738e-02 + <_> + + 0 -1 1013 8.3431020379066467e-02 + + 5.0954800099134445e-02 -3.1020981073379517e-01 + <_> + + 0 -1 1014 -9.2014456167817116e-03 + + -3.9242538809776306e-01 3.2926950603723526e-02 + <_> + + 0 -1 1015 -2.9086650465615094e-04 + + -3.1039750576019287e-01 4.9711819738149643e-02 + <_> + + 0 -1 1016 7.7576898038387299e-03 + + -4.4040750712156296e-02 3.6431351304054260e-01 + <_> + + 0 -1 1017 -1.2466090172529221e-01 + + -8.1957077980041504e-01 1.9150640815496445e-02 + <_> + + 0 -1 1018 1.3242550194263458e-02 + + 3.8988839834928513e-02 -3.3230680227279663e-01 + <_> + + 0 -1 1019 -6.6770128905773163e-03 + + -3.5790139436721802e-01 4.0460210293531418e-02 + <_> + + 0 -1 1020 -2.7479929849505424e-03 + + 2.5253900885581970e-01 -5.6427821516990662e-02 + <_> + + 0 -1 1021 8.2659651525318623e-04 + + -7.1988657116889954e-02 2.2780479490756989e-01 + <_> + + 0 -1 1022 -5.0153400748968124e-02 + + -6.3036471605300903e-01 2.7462050318717957e-02 + <_> + + 0 -1 1023 7.4203149415552616e-03 + + -6.6610716283321381e-02 2.7787339687347412e-01 + <_> + + 0 -1 1024 -6.7951780511066318e-04 + + -3.6327061057090759e-01 4.2795430868864059e-02 + <_> + + 0 -1 1025 -1.9305750029161572e-03 + + 1.4196230471134186e-01 -1.0759980231523514e-01 + <_> + + 0 -1 1026 -3.8132671033963561e-04 + + 2.1591760218143463e-01 -7.0202663540840149e-02 + <_> + + 0 -1 1027 -7.0990346372127533e-02 + + 4.5266601443290710e-01 -4.0750481188297272e-02 + <_> + + 0 -1 1028 -5.3368080407381058e-02 + + -6.7674058675765991e-01 1.9288340583443642e-02 + <_> + + 0 -1 1029 -2.0064849406480789e-02 + + -4.3365430831909180e-01 3.1853288412094116e-02 + <_> + + 0 -1 1030 1.1976360110566020e-03 + + -2.6559870690107346e-02 5.0797182321548462e-01 + <_> + + 0 -1 1031 -2.2697300300933421e-04 + + 1.8012599647045135e-01 -8.3606548607349396e-02 + <_> + + 0 -1 1032 1.5262699685990810e-02 + + -2.0238929986953735e-01 6.7422017455101013e-02 + <_> + + 0 -1 1033 -2.0811769366264343e-01 + + 6.6943860054016113e-01 -2.2452110424637794e-02 + <_> + + 0 -1 1034 1.5514369588345289e-03 + + -7.5121842324733734e-02 1.7326919734477997e-01 + <_> + + 0 -1 1035 -5.2924010902643204e-02 + + 2.4992519617080688e-01 -6.2879167497158051e-02 + <_> + + 0 -1 1036 -2.1648850291967392e-02 + + -2.9194280505180359e-01 5.2614491432905197e-02 + <_> + + 0 -1 1037 -2.2905069636180997e-04 + + -2.2117300331592560e-01 6.3168339431285858e-02 + <_> + + 0 -1 1038 5.0170070608146489e-05 + + -1.1510709673166275e-01 1.1611440032720566e-01 + <_> + + 0 -1 1039 -1.6416069411206990e-04 + + 1.5871520340442657e-01 -8.2600601017475128e-02 + <_> + + 0 -1 1040 -1.2003289535641670e-02 + + 1.2218090146780014e-01 -1.1229699850082397e-01 + <_> + + 0 -1 1041 -1.7784100025892258e-02 + + -3.5072788596153259e-01 3.1341921538114548e-02 + <_> + + 0 -1 1042 -6.3457582145929337e-03 + + 1.3078069686889648e-01 -1.0574410110712051e-01 + <_> + + 0 -1 1043 -7.9523242311552167e-04 + + 1.7204670608043671e-01 -8.6001992225646973e-02 + <_> + + 0 -1 1044 -3.1029590172693133e-04 + + -2.8433170914649963e-01 5.1817119121551514e-02 + <_> + + 0 -1 1045 -1.7053710296750069e-02 + + 3.9242428541183472e-01 -4.0143270045518875e-02 + <_> + + 0 -1 1046 4.6504959464073181e-03 + + -3.1837560236454010e-02 4.1237699985504150e-01 + <_> + + 0 -1 1047 -1.0358760133385658e-02 + + -5.6993198394775391e-01 2.9248379170894623e-02 + <_> + + 0 -1 1048 -2.2196240723133087e-02 + + -4.5605289936065674e-01 2.6285989210009575e-02 + <_> + + 0 -1 1049 -7.0536029525101185e-03 + + 1.5998320281505585e-01 -9.1594859957695007e-02 + <_> + + 0 -1 1050 -5.7094299700111151e-04 + + -1.4076329767704010e-01 1.0287419706583023e-01 + <_> + + 0 -1 1051 -2.2152599412947893e-03 + + 1.6593599319458008e-01 -8.5273988544940948e-02 + <_> + + 0 -1 1052 -2.8084890916943550e-02 + + 2.7022340893745422e-01 -5.5873811244964600e-02 + <_> + + 0 -1 1053 2.1515151020139456e-03 + + 4.2472891509532928e-02 -3.2005849480628967e-01 + <_> + + 0 -1 1054 -2.9733829433098435e-04 + + 1.6177169978618622e-01 -8.5115589201450348e-02 + <_> + + 0 -1 1055 -1.6694780439138412e-02 + + -4.2858770489692688e-01 3.0541609972715378e-02 + <_> + + 0 -1 1056 1.1982990056276321e-01 + + -1.6277290880680084e-02 7.9846781492233276e-01 + <_> + + 0 -1 1057 -3.5499420482665300e-04 + + 1.5935939550399780e-01 -8.3272881805896759e-02 + <_> + + 0 -1 1058 -1.8226269632577896e-02 + + 1.9527280330657959e-01 -7.3939889669418335e-02 + <_> + + 0 -1 1059 -4.0238600922748446e-04 + + 7.9101808369159698e-02 -2.0806129276752472e-01 + <_> + + 0 -1 1060 4.0892060496844351e-04 + + 1.0036630183458328e-01 -1.5128210186958313e-01 + <_> + + 0 -1 1061 9.5368112670257688e-04 + + -7.3011666536331177e-02 2.1752020716667175e-01 + <_> + + 0 -1 1062 4.3081799149513245e-01 + + -2.7450699359178543e-02 5.7061582803726196e-01 + <_> + + 0 -1 1063 5.3564831614494324e-04 + + 1.1587540060281754e-01 -1.2790560722351074e-01 + <_> + + 0 -1 1064 2.4430730263702571e-05 + + -1.6816629469394684e-01 8.0449983477592468e-02 + <_> + + 0 -1 1065 -5.5345650762319565e-02 + + 4.5338949561119080e-01 -3.1222779303789139e-02 + + <_> + + <_> + 0 8 20 12 -1. + <_> + 0 14 20 6 2. + <_> + + <_> + 9 1 4 15 -1. + <_> + 9 6 4 5 3. + <_> + + <_> + 6 10 9 2 -1. + <_> + 9 10 3 2 3. + <_> + + <_> + 7 0 10 9 -1. + <_> + 7 3 10 3 3. + <_> + + <_> + 12 2 2 18 -1. + <_> + 12 8 2 6 3. + <_> + + <_> + 8 6 8 6 -1. + <_> + 8 9 8 3 2. + <_> + + <_> + 2 0 17 18 -1. + <_> + 2 6 17 6 3. + <_> + + <_> + 10 10 1 8 -1. + <_> + 10 14 1 4 2. + <_> + + <_> + 7 10 9 2 -1. + <_> + 10 10 3 2 3. + <_> + + <_> + 5 1 6 6 -1. + <_> + 5 3 6 2 3. + <_> + + <_> + 3 1 15 9 -1. + <_> + 3 4 15 3 3. + <_> + + <_> + 6 3 9 6 -1. + <_> + 6 5 9 2 3. + <_> + + <_> + 8 17 6 3 -1. + <_> + 10 17 2 3 3. + <_> + + <_> + 9 10 9 1 -1. + <_> + 12 10 3 1 3. + <_> + + <_> + 1 7 6 11 -1. + <_> + 3 7 2 11 3. + <_> + + <_> + 9 18 3 1 -1. + <_> + 10 18 1 1 3. + <_> + + <_> + 16 16 1 2 -1. + <_> + 16 17 1 1 2. + <_> + + <_> + 9 17 6 3 -1. + <_> + 11 17 2 3 3. + <_> + + <_> + 8 0 5 18 -1. + <_> + 8 6 5 6 3. + <_> + + <_> + 6 7 9 7 -1. + <_> + 9 7 3 7 3. + <_> + + <_> + 14 6 6 10 -1. + <_> + 16 6 2 10 3. + <_> + + <_> + 9 8 9 5 -1. + <_> + 12 8 3 5 3. + <_> + + <_> + 3 7 9 6 -1. + <_> + 6 7 3 6 3. + <_> + + <_> + 1 7 6 6 -1. + <_> + 3 7 2 6 3. + <_> + + <_> + 16 0 4 18 -1. + <_> + 16 6 4 6 3. + <_> + + <_> + 0 17 3 3 -1. + <_> + 0 18 3 1 3. + <_> + + <_> + 16 0 2 1 -1. + <_> + 17 0 1 1 2. + <_> + + <_> + 0 8 20 12 -1. + <_> + 0 14 20 6 2. + <_> + + <_> + 6 6 9 8 -1. + <_> + 9 6 3 8 3. + <_> + + <_> + 5 3 12 9 -1. + <_> + 5 6 12 3 3. + <_> + + <_> + 4 16 1 2 -1. + <_> + 4 17 1 1 2. + <_> + + <_> + 18 10 2 1 -1. + <_> + 19 10 1 1 2. + <_> + + <_> + 9 8 6 5 -1. + <_> + 11 8 2 5 3. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 6 8 6 6 -1. + <_> + 8 8 2 6 3. + <_> + + <_> + 11 7 6 7 -1. + <_> + 13 7 2 7 3. + <_> + + <_> + 19 14 1 2 -1. + <_> + 19 15 1 1 2. + <_> + + <_> + 6 17 1 2 -1. + <_> + 6 18 1 1 2. + <_> + + <_> + 14 7 2 7 -1. + <_> + 15 7 1 7 2. + <_> + + <_> + 6 8 2 4 -1. + <_> + 7 8 1 4 2. + <_> + + <_> + 5 8 12 6 -1. + <_> + 5 10 12 2 3. + <_> + + <_> + 2 17 1 3 -1. + <_> + 2 18 1 1 3. + <_> + + <_> + 6 7 3 6 -1. + <_> + 7 7 1 6 3. + <_> + + <_> + 6 7 9 12 -1. + <_> + 9 7 3 12 3. + <_> + + <_> + 6 2 11 12 -1. + <_> + 6 6 11 4 3. + <_> + + <_> + 1 12 5 8 -1. + <_> + 1 16 5 4 2. + <_> + + <_> + 14 7 6 7 -1. + <_> + 16 7 2 7 3. + <_> + + <_> + 10 8 6 6 -1. + <_> + 12 8 2 6 3. + <_> + + <_> + 16 18 4 2 -1. + <_> + 16 19 4 1 2. + <_> + + <_> + 18 17 2 3 -1. + <_> + 18 18 2 1 3. + <_> + + <_> + 9 7 3 7 -1. + <_> + 10 7 1 7 3. + <_> + + <_> + 5 6 6 8 -1. + <_> + 7 6 2 8 3. + <_> + + <_> + 2 6 6 11 -1. + <_> + 4 6 2 11 3. + <_> + + <_> + 8 10 12 8 -1. + <_> + 8 14 12 4 2. + <_> + + <_> + 7 17 6 3 -1. + <_> + 9 17 2 3 3. + <_> + + <_> + 10 9 3 3 -1. + <_> + 11 9 1 3 3. + <_> + + <_> + 8 8 3 6 -1. + <_> + 9 8 1 6 3. + <_> + + <_> + 7 0 6 5 -1. + <_> + 9 0 2 5 3. + <_> + + <_> + 6 17 1 3 -1. + <_> + 6 18 1 1 3. + <_> + + <_> + 0 18 4 2 -1. + <_> + 0 19 4 1 2. + <_> + + <_> + 4 1 11 9 -1. + <_> + 4 4 11 3 3. + <_> + + <_> + 3 1 14 9 -1. + <_> + 3 4 14 3 3. + <_> + + <_> + 0 9 6 4 -1. + <_> + 2 9 2 4 3. + <_> + + <_> + 18 13 1 2 -1. + <_> + 18 14 1 1 2. + <_> + + <_> + 13 5 3 11 -1. + <_> + 14 5 1 11 3. + <_> + + <_> + 0 18 8 2 -1. + <_> + 0 18 4 1 2. + <_> + 4 19 4 1 2. + <_> + + <_> + 5 8 12 5 -1. + <_> + 9 8 4 5 3. + <_> + + <_> + 4 7 11 10 -1. + <_> + 4 12 11 5 2. + <_> + + <_> + 14 9 6 4 -1. + <_> + 16 9 2 4 3. + <_> + + <_> + 0 7 6 8 -1. + <_> + 3 7 3 8 2. + <_> + + <_> + 0 16 3 3 -1. + <_> + 0 17 3 1 3. + <_> + + <_> + 7 11 12 1 -1. + <_> + 11 11 4 1 3. + <_> + + <_> + 4 8 9 4 -1. + <_> + 7 8 3 4 3. + <_> + + <_> + 5 16 6 4 -1. + <_> + 7 16 2 4 3. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 4 9 4 10 -1. + <_> + 4 9 2 5 2. + <_> + 6 14 2 5 2. + <_> + + <_> + 4 8 6 4 -1. + <_> + 6 8 2 4 3. + <_> + + <_> + 10 2 2 18 -1. + <_> + 10 8 2 6 3. + <_> + + <_> + 0 5 8 6 -1. + <_> + 0 5 4 3 2. + <_> + 4 8 4 3 2. + <_> + + <_> + 6 0 6 5 -1. + <_> + 8 0 2 5 3. + <_> + + <_> + 18 0 2 14 -1. + <_> + 18 7 2 7 2. + <_> + + <_> + 8 18 4 2 -1. + <_> + 10 18 2 2 2. + <_> + + <_> + 1 17 6 3 -1. + <_> + 1 18 6 1 3. + <_> + + <_> + 11 8 3 5 -1. + <_> + 12 8 1 5 3. + <_> + + <_> + 11 8 3 4 -1. + <_> + 12 8 1 4 3. + <_> + + <_> + 11 0 6 5 -1. + <_> + 13 0 2 5 3. + <_> + + <_> + 1 7 6 7 -1. + <_> + 3 7 2 7 3. + <_> + + <_> + 0 13 1 3 -1. + <_> + 0 14 1 1 3. + <_> + + <_> + 3 2 9 6 -1. + <_> + 3 4 9 2 3. + <_> + + <_> + 8 6 9 2 -1. + <_> + 8 7 9 1 2. + <_> + + <_> + 0 14 3 6 -1. + <_> + 0 16 3 2 3. + <_> + + <_> + 1 11 6 4 -1. + <_> + 3 11 2 4 3. + <_> + + <_> + 6 9 9 3 -1. + <_> + 9 9 3 3 3. + <_> + + <_> + 6 0 9 6 -1. + <_> + 6 2 9 2 3. + <_> + + <_> + 8 5 6 6 -1. + <_> + 8 7 6 2 3. + <_> + + <_> + 1 12 2 1 -1. + <_> + 2 12 1 1 2. + <_> + + <_> + 10 10 6 2 -1. + <_> + 12 10 2 2 3. + <_> + + <_> + 13 8 6 6 -1. + <_> + 15 8 2 6 3. + <_> + + <_> + 6 16 6 4 -1. + <_> + 8 16 2 4 3. + <_> + + <_> + 8 0 9 9 -1. + <_> + 8 3 9 3 3. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 7 10 3 3 -1. + <_> + 8 10 1 3 3. + <_> + + <_> + 9 14 2 2 -1. + <_> + 9 14 1 1 2. + <_> + 10 15 1 1 2. + <_> + + <_> + 9 14 2 2 -1. + <_> + 9 14 1 1 2. + <_> + 10 15 1 1 2. + <_> + + <_> + 0 8 19 12 -1. + <_> + 0 14 19 6 2. + <_> + + <_> + 7 6 9 14 -1. + <_> + 10 6 3 14 3. + <_> + + <_> + 13 8 3 4 -1. + <_> + 14 8 1 4 3. + <_> + + <_> + 4 17 1 3 -1. + <_> + 4 18 1 1 3. + <_> + + <_> + 4 9 6 3 -1. + <_> + 6 9 2 3 3. + <_> + + <_> + 2 18 5 2 -1. + <_> + 2 19 5 1 2. + <_> + + <_> + 7 8 2 2 -1. + <_> + 7 8 1 1 2. + <_> + 8 9 1 1 2. + <_> + + <_> + 7 8 2 2 -1. + <_> + 7 8 1 1 2. + <_> + 8 9 1 1 2. + <_> + + <_> + 5 10 13 2 -1. + <_> + 5 11 13 1 2. + <_> + + <_> + 10 8 1 9 -1. + <_> + 10 11 1 3 3. + <_> + + <_> + 15 8 2 12 -1. + <_> + 15 8 1 6 2. + <_> + 16 14 1 6 2. + <_> + + <_> + 4 0 3 5 -1. + <_> + 5 0 1 5 3. + <_> + + <_> + 12 6 3 7 -1. + <_> + 13 6 1 7 3. + <_> + + <_> + 7 16 6 4 -1. + <_> + 9 16 2 4 3. + <_> + + <_> + 9 16 2 1 -1. + <_> + 10 16 1 1 2. + <_> + + <_> + 6 10 9 2 -1. + <_> + 9 10 3 2 3. + <_> + + <_> + 0 6 15 14 -1. + <_> + 0 13 15 7 2. + <_> + + <_> + 9 1 5 6 -1. + <_> + 9 3 5 2 3. + <_> + + <_> + 3 9 3 4 -1. + <_> + 4 9 1 4 3. + <_> + + <_> + 5 7 3 6 -1. + <_> + 6 7 1 6 3. + <_> + + <_> + 17 16 1 2 -1. + <_> + 17 17 1 1 2. + <_> + + <_> + 9 8 6 12 -1. + <_> + 11 8 2 12 3. + <_> + + <_> + 6 10 6 1 -1. + <_> + 8 10 2 1 3. + <_> + + <_> + 7 17 9 3 -1. + <_> + 10 17 3 3 3. + <_> + + <_> + 14 18 6 2 -1. + <_> + 14 19 6 1 2. + <_> + + <_> + 9 5 3 14 -1. + <_> + 10 5 1 14 3. + <_> + + <_> + 8 16 9 4 -1. + <_> + 11 16 3 4 3. + <_> + + <_> + 0 0 4 14 -1. + <_> + 0 7 4 7 2. + <_> + + <_> + 8 1 6 3 -1. + <_> + 10 1 2 3 3. + <_> + + <_> + 6 8 3 4 -1. + <_> + 7 8 1 4 3. + <_> + + <_> + 4 8 3 4 -1. + <_> + 5 8 1 4 3. + <_> + + <_> + 5 1 6 5 -1. + <_> + 7 1 2 5 3. + <_> + + <_> + 1 18 1 2 -1. + <_> + 1 19 1 1 2. + <_> + + <_> + 7 0 6 6 -1. + <_> + 7 2 6 2 3. + <_> + + <_> + 0 18 4 2 -1. + <_> + 0 19 4 1 2. + <_> + + <_> + 12 3 8 12 -1. + <_> + 12 7 8 4 3. + <_> + + <_> + 12 9 3 4 -1. + <_> + 13 9 1 4 3. + <_> + + <_> + 12 8 3 5 -1. + <_> + 13 8 1 5 3. + <_> + + <_> + 16 0 2 1 -1. + <_> + 17 0 1 1 2. + <_> + + <_> + 5 17 1 3 -1. + <_> + 5 18 1 1 3. + <_> + + <_> + 10 2 3 6 -1. + <_> + 10 4 3 2 3. + <_> + + <_> + 4 17 2 3 -1. + <_> + 4 18 2 1 3. + <_> + + <_> + 12 7 1 9 -1. + <_> + 12 10 1 3 3. + <_> + + <_> + 7 6 3 9 -1. + <_> + 8 6 1 9 3. + <_> + + <_> + 17 13 3 6 -1. + <_> + 17 15 3 2 3. + <_> + + <_> + 7 7 3 8 -1. + <_> + 8 7 1 8 3. + <_> + + <_> + 5 0 3 5 -1. + <_> + 6 0 1 5 3. + <_> + + <_> + 4 6 9 8 -1. + <_> + 7 6 3 8 3. + <_> + + <_> + 2 9 3 3 -1. + <_> + 3 9 1 3 3. + <_> + + <_> + 16 18 4 2 -1. + <_> + 16 19 4 1 2. + <_> + + <_> + 17 10 3 10 -1. + <_> + 17 15 3 5 2. + <_> + + <_> + 8 9 6 4 -1. + <_> + 10 9 2 4 3. + <_> + + <_> + 5 2 10 12 -1. + <_> + 5 6 10 4 3. + <_> + + <_> + 6 9 6 3 -1. + <_> + 8 9 2 3 3. + <_> + + <_> + 11 7 3 7 -1. + <_> + 12 7 1 7 3. + <_> + + <_> + 12 8 6 4 -1. + <_> + 14 8 2 4 3. + <_> + + <_> + 14 8 6 5 -1. + <_> + 16 8 2 5 3. + <_> + + <_> + 12 12 2 4 -1. + <_> + 12 14 2 2 2. + <_> + + <_> + 3 15 1 2 -1. + <_> + 3 16 1 1 2. + <_> + + <_> + 12 7 3 4 -1. + <_> + 13 7 1 4 3. + <_> + + <_> + 10 0 6 6 -1. + <_> + 12 0 2 6 3. + <_> + + <_> + 10 6 3 8 -1. + <_> + 11 6 1 8 3. + <_> + + <_> + 16 17 1 2 -1. + <_> + 16 18 1 1 2. + <_> + + <_> + 16 16 1 3 -1. + <_> + 16 17 1 1 3. + <_> + + <_> + 11 11 1 2 -1. + <_> + 11 12 1 1 2. + <_> + + <_> + 3 7 6 9 -1. + <_> + 5 7 2 9 3. + <_> + + <_> + 4 18 9 1 -1. + <_> + 7 18 3 1 3. + <_> + + <_> + 0 11 4 9 -1. + <_> + 0 14 4 3 3. + <_> + + <_> + 9 17 6 3 -1. + <_> + 11 17 2 3 3. + <_> + + <_> + 7 8 6 12 -1. + <_> + 9 8 2 12 3. + <_> + + <_> + 6 8 3 4 -1. + <_> + 7 8 1 4 3. + <_> + + <_> + 3 17 1 3 -1. + <_> + 3 18 1 1 3. + <_> + + <_> + 11 9 6 4 -1. + <_> + 13 9 2 4 3. + <_> + + <_> + 6 1 3 2 -1. + <_> + 7 1 1 2 3. + <_> + + <_> + 1 0 2 1 -1. + <_> + 2 0 1 1 2. + <_> + + <_> + 1 0 2 14 -1. + <_> + 1 0 1 7 2. + <_> + 2 7 1 7 2. + <_> + + <_> + 5 5 11 8 -1. + <_> + 5 9 11 4 2. + <_> + + <_> + 9 3 5 6 -1. + <_> + 9 5 5 2 3. + <_> + + <_> + 7 9 5 10 -1. + <_> + 7 14 5 5 2. + <_> + + <_> + 15 10 2 2 -1. + <_> + 16 10 1 2 2. + <_> + + <_> + 0 18 8 2 -1. + <_> + 0 19 8 1 2. + <_> + + <_> + 7 17 1 3 -1. + <_> + 7 18 1 1 3. + <_> + + <_> + 7 2 11 6 -1. + <_> + 7 4 11 2 3. + <_> + + <_> + 8 3 9 3 -1. + <_> + 8 4 9 1 3. + <_> + + <_> + 0 9 2 2 -1. + <_> + 0 10 2 1 2. + <_> + + <_> + 0 5 3 6 -1. + <_> + 0 7 3 2 3. + <_> + + <_> + 6 7 2 2 -1. + <_> + 6 7 1 1 2. + <_> + 7 8 1 1 2. + <_> + + <_> + 7 6 3 6 -1. + <_> + 8 6 1 6 3. + <_> + + <_> + 12 1 6 4 -1. + <_> + 14 1 2 4 3. + <_> + + <_> + 9 11 6 8 -1. + <_> + 11 11 2 8 3. + <_> + + <_> + 17 15 3 3 -1. + <_> + 17 16 3 1 3. + <_> + + <_> + 6 6 3 9 -1. + <_> + 6 9 3 3 3. + <_> + + <_> + 0 5 8 6 -1. + <_> + 0 5 4 3 2. + <_> + 4 8 4 3 2. + <_> + + <_> + 0 6 1 3 -1. + <_> + 0 7 1 1 3. + <_> + + <_> + 17 0 2 6 -1. + <_> + 18 0 1 6 2. + <_> + + <_> + 10 17 6 3 -1. + <_> + 12 17 2 3 3. + <_> + + <_> + 13 15 2 2 -1. + <_> + 13 15 1 1 2. + <_> + 14 16 1 1 2. + <_> + + <_> + 4 0 12 3 -1. + <_> + 4 1 12 1 3. + <_> + + <_> + 5 3 10 9 -1. + <_> + 5 6 10 3 3. + <_> + + <_> + 7 7 9 7 -1. + <_> + 10 7 3 7 3. + <_> + + <_> + 5 8 9 6 -1. + <_> + 8 8 3 6 3. + <_> + + <_> + 0 16 6 2 -1. + <_> + 0 17 6 1 2. + <_> + + <_> + 12 6 7 14 -1. + <_> + 12 13 7 7 2. + <_> + + <_> + 13 7 6 8 -1. + <_> + 15 7 2 8 3. + <_> + + <_> + 2 10 6 3 -1. + <_> + 4 10 2 3 3. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 7 1 6 2 -1. + <_> + 7 2 6 1 2. + <_> + + <_> + 6 0 6 4 -1. + <_> + 6 2 6 2 2. + <_> + + <_> + 8 18 6 2 -1. + <_> + 10 18 2 2 3. + <_> + + <_> + 7 6 5 2 -1. + <_> + 7 7 5 1 2. + <_> + + <_> + 6 7 3 6 -1. + <_> + 7 7 1 6 3. + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 18 1 1 2. + <_> + 19 19 1 1 2. + <_> + + <_> + 16 8 3 7 -1. + <_> + 17 8 1 7 3. + <_> + + <_> + 0 16 2 3 -1. + <_> + 0 17 2 1 3. + <_> + + <_> + 5 19 6 1 -1. + <_> + 7 19 2 1 3. + <_> + + <_> + 9 5 6 6 -1. + <_> + 9 7 6 2 3. + <_> + + <_> + 0 10 2 4 -1. + <_> + 0 12 2 2 2. + <_> + + <_> + 0 9 4 3 -1. + <_> + 2 9 2 3 2. + <_> + + <_> + 1 10 6 9 -1. + <_> + 3 10 2 9 3. + <_> + + <_> + 9 0 6 2 -1. + <_> + 11 0 2 2 3. + <_> + + <_> + 14 1 2 1 -1. + <_> + 15 1 1 1 2. + <_> + + <_> + 0 8 1 4 -1. + <_> + 0 10 1 2 2. + <_> + + <_> + 15 6 2 2 -1. + <_> + 15 6 1 1 2. + <_> + 16 7 1 1 2. + <_> + + <_> + 7 5 3 6 -1. + <_> + 8 5 1 6 3. + <_> + + <_> + 19 17 1 3 -1. + <_> + 19 18 1 1 3. + <_> + + <_> + 7 10 3 1 -1. + <_> + 8 10 1 1 3. + <_> + + <_> + 12 1 6 6 -1. + <_> + 14 1 2 6 3. + <_> + + <_> + 15 5 2 1 -1. + <_> + 16 5 1 1 2. + <_> + + <_> + 8 2 7 4 -1. + <_> + 8 4 7 2 2. + <_> + + <_> + 4 0 14 15 -1. + <_> + 4 5 14 5 3. + <_> + + <_> + 7 8 6 6 -1. + <_> + 9 8 2 6 3. + <_> + + <_> + 11 17 1 3 -1. + <_> + 11 18 1 1 3. + <_> + + <_> + 12 16 2 4 -1. + <_> + 12 16 1 2 2. + <_> + 13 18 1 2 2. + <_> + + <_> + 10 13 2 1 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 11 8 3 3 -1. + <_> + 12 8 1 3 3. + <_> + + <_> + 2 0 6 8 -1. + <_> + 4 0 2 8 3. + <_> + + <_> + 3 5 6 6 -1. + <_> + 3 5 3 3 2. + <_> + 6 8 3 3 2. + <_> + + <_> + 10 8 3 3 -1. + <_> + 11 8 1 3 3. + <_> + + <_> + 5 17 4 2 -1. + <_> + 5 18 4 1 2. + <_> + + <_> + 8 16 5 2 -1. + <_> + 8 17 5 1 2. + <_> + + <_> + 0 4 3 3 -1. + <_> + 0 5 3 1 3. + <_> + + <_> + 6 3 6 2 -1. + <_> + 8 3 2 2 3. + <_> + + <_> + 4 4 9 3 -1. + <_> + 7 4 3 3 3. + <_> + + <_> + 0 13 1 4 -1. + <_> + 0 15 1 2 2. + <_> + + <_> + 0 17 8 3 -1. + <_> + 0 18 8 1 3. + <_> + + <_> + 6 1 11 6 -1. + <_> + 6 3 11 2 3. + <_> + + <_> + 4 10 6 2 -1. + <_> + 6 10 2 2 3. + <_> + + <_> + 10 8 1 12 -1. + <_> + 10 14 1 6 2. + <_> + + <_> + 5 8 3 4 -1. + <_> + 6 8 1 4 3. + <_> + + <_> + 0 17 1 3 -1. + <_> + 0 18 1 1 3. + <_> + + <_> + 0 17 1 3 -1. + <_> + 0 18 1 1 3. + <_> + + <_> + 13 8 3 4 -1. + <_> + 14 8 1 4 3. + <_> + + <_> + 1 5 5 4 -1. + <_> + 1 7 5 2 2. + <_> + + <_> + 18 14 1 2 -1. + <_> + 18 15 1 1 2. + <_> + + <_> + 13 8 2 4 -1. + <_> + 14 8 1 4 2. + <_> + + <_> + 10 6 6 8 -1. + <_> + 12 6 2 8 3. + <_> + + <_> + 8 6 6 10 -1. + <_> + 10 6 2 10 3. + <_> + + <_> + 17 16 1 3 -1. + <_> + 17 17 1 1 3. + <_> + + <_> + 1 7 2 10 -1. + <_> + 2 7 1 10 2. + <_> + + <_> + 5 9 6 3 -1. + <_> + 7 9 2 3 3. + <_> + + <_> + 0 8 5 12 -1. + <_> + 0 14 5 6 2. + <_> + + <_> + 0 11 1 3 -1. + <_> + 0 12 1 1 3. + <_> + + <_> + 6 16 6 4 -1. + <_> + 8 16 2 4 3. + <_> + + <_> + 0 6 2 6 -1. + <_> + 0 8 2 2 3. + <_> + + <_> + 11 18 2 1 -1. + <_> + 12 18 1 1 2. + <_> + + <_> + 5 1 9 2 -1. + <_> + 5 2 9 1 2. + <_> + + <_> + 0 0 1 2 -1. + <_> + 0 1 1 1 2. + <_> + + <_> + 15 9 3 3 -1. + <_> + 16 9 1 3 3. + <_> + + <_> + 18 16 1 3 -1. + <_> + 18 17 1 1 3. + <_> + + <_> + 11 10 6 1 -1. + <_> + 13 10 2 1 3. + <_> + + <_> + 1 3 4 4 -1. + <_> + 3 3 2 4 2. + <_> + + <_> + 11 2 1 18 -1. + <_> + 11 8 1 6 3. + <_> + + <_> + 9 1 5 12 -1. + <_> + 9 5 5 4 3. + <_> + + <_> + 12 0 8 1 -1. + <_> + 16 0 4 1 2. + <_> + + <_> + 8 6 3 10 -1. + <_> + 9 6 1 10 3. + <_> + + <_> + 19 2 1 6 -1. + <_> + 19 4 1 2 3. + <_> + + <_> + 18 6 2 2 -1. + <_> + 18 7 2 1 2. + <_> + + <_> + 7 7 3 4 -1. + <_> + 8 7 1 4 3. + <_> + + <_> + 5 0 6 5 -1. + <_> + 7 0 2 5 3. + <_> + + <_> + 0 3 7 3 -1. + <_> + 0 4 7 1 3. + <_> + + <_> + 1 6 2 1 -1. + <_> + 2 6 1 1 2. + <_> + + <_> + 4 8 2 10 -1. + <_> + 4 8 1 5 2. + <_> + 5 13 1 5 2. + <_> + + <_> + 2 18 18 2 -1. + <_> + 2 18 9 1 2. + <_> + 11 19 9 1 2. + <_> + + <_> + 2 7 4 4 -1. + <_> + 2 7 2 2 2. + <_> + 4 9 2 2 2. + <_> + + <_> + 17 3 3 4 -1. + <_> + 18 3 1 4 3. + <_> + + <_> + 16 9 2 8 -1. + <_> + 16 9 1 4 2. + <_> + 17 13 1 4 2. + <_> + + <_> + 15 7 1 6 -1. + <_> + 15 9 1 2 3. + <_> + + <_> + 14 2 2 2 -1. + <_> + 14 3 2 1 2. + <_> + + <_> + 17 0 2 3 -1. + <_> + 17 1 2 1 3. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 1 2. + <_> + 17 19 1 1 2. + <_> + + <_> + 10 4 4 3 -1. + <_> + 10 5 4 1 3. + <_> + + <_> + 0 2 8 6 -1. + <_> + 4 2 4 6 2. + <_> + + <_> + 7 14 6 6 -1. + <_> + 7 16 6 2 3. + <_> + + <_> + 11 15 2 2 -1. + <_> + 11 16 2 1 2. + <_> + + <_> + 7 1 9 4 -1. + <_> + 10 1 3 4 3. + <_> + + <_> + 9 7 3 7 -1. + <_> + 10 7 1 7 3. + <_> + + <_> + 6 17 2 2 -1. + <_> + 6 17 1 1 2. + <_> + 7 18 1 1 2. + <_> + + <_> + 4 6 3 9 -1. + <_> + 5 6 1 9 3. + <_> + + <_> + 0 10 19 10 -1. + <_> + 0 15 19 5 2. + <_> + + <_> + 5 17 6 1 -1. + <_> + 7 17 2 1 3. + <_> + + <_> + 0 12 6 3 -1. + <_> + 3 12 3 3 2. + <_> + + <_> + 2 5 18 5 -1. + <_> + 8 5 6 5 3. + <_> + + <_> + 1 15 6 4 -1. + <_> + 1 17 6 2 2. + <_> + + <_> + 14 10 6 6 -1. + <_> + 16 10 2 6 3. + <_> + + <_> + 0 14 4 3 -1. + <_> + 0 15 4 1 3. + <_> + + <_> + 1 7 6 11 -1. + <_> + 3 7 2 11 3. + <_> + + <_> + 13 17 7 2 -1. + <_> + 13 18 7 1 2. + <_> + + <_> + 0 14 2 3 -1. + <_> + 0 15 2 1 3. + <_> + + <_> + 0 0 6 2 -1. + <_> + 3 0 3 2 2. + <_> + + <_> + 0 1 6 3 -1. + <_> + 3 1 3 3 2. + <_> + + <_> + 0 8 2 6 -1. + <_> + 0 10 2 2 3. + <_> + + <_> + 1 2 6 14 -1. + <_> + 1 2 3 7 2. + <_> + 4 9 3 7 2. + <_> + + <_> + 17 5 2 2 -1. + <_> + 17 5 1 1 2. + <_> + 18 6 1 1 2. + <_> + + <_> + 11 10 9 4 -1. + <_> + 14 10 3 4 3. + <_> + + <_> + 2 9 12 4 -1. + <_> + 6 9 4 4 3. + <_> + + <_> + 7 10 12 2 -1. + <_> + 11 10 4 2 3. + <_> + + <_> + 2 13 1 2 -1. + <_> + 2 14 1 1 2. + <_> + + <_> + 16 7 4 3 -1. + <_> + 16 8 4 1 3. + <_> + + <_> + 19 16 1 3 -1. + <_> + 19 17 1 1 3. + <_> + + <_> + 18 11 1 2 -1. + <_> + 18 12 1 1 2. + <_> + + <_> + 12 7 8 2 -1. + <_> + 12 7 4 1 2. + <_> + 16 8 4 1 2. + <_> + + <_> + 14 9 2 4 -1. + <_> + 15 9 1 4 2. + <_> + + <_> + 14 2 6 4 -1. + <_> + 14 2 3 2 2. + <_> + 17 4 3 2 2. + <_> + + <_> + 14 0 6 1 -1. + <_> + 17 0 3 1 2. + <_> + + <_> + 3 12 2 1 -1. + <_> + 4 12 1 1 2. + <_> + + <_> + 17 2 3 1 -1. + <_> + 18 2 1 1 3. + <_> + + <_> + 1 16 18 2 -1. + <_> + 7 16 6 2 3. + <_> + + <_> + 2 19 8 1 -1. + <_> + 6 19 4 1 2. + <_> + + <_> + 1 17 4 3 -1. + <_> + 1 18 4 1 3. + <_> + + <_> + 19 13 1 2 -1. + <_> + 19 14 1 1 2. + <_> + + <_> + 9 16 10 4 -1. + <_> + 9 16 5 2 2. + <_> + 14 18 5 2 2. + <_> + + <_> + 12 9 2 4 -1. + <_> + 12 9 1 2 2. + <_> + 13 11 1 2 2. + <_> + + <_> + 19 11 1 9 -1. + <_> + 19 14 1 3 3. + <_> + + <_> + 6 6 14 14 -1. + <_> + 6 13 14 7 2. + <_> + + <_> + 2 17 4 2 -1. + <_> + 2 18 4 1 2. + <_> + + <_> + 0 2 1 3 -1. + <_> + 0 3 1 1 3. + <_> + + <_> + 0 12 1 3 -1. + <_> + 0 13 1 1 3. + <_> + + <_> + 15 15 4 4 -1. + <_> + 15 17 4 2 2. + <_> + + <_> + 2 5 18 7 -1. + <_> + 8 5 6 7 3. + <_> + + <_> + 1 16 5 3 -1. + <_> + 1 17 5 1 3. + <_> + + <_> + 0 4 2 3 -1. + <_> + 0 5 2 1 3. + <_> + + <_> + 0 6 2 6 -1. + <_> + 1 6 1 6 2. + <_> + + <_> + 16 14 4 3 -1. + <_> + 16 15 4 1 3. + <_> + + <_> + 0 0 10 6 -1. + <_> + 0 0 5 3 2. + <_> + 5 3 5 3 2. + <_> + + <_> + 2 2 3 6 -1. + <_> + 3 2 1 6 3. + <_> + + <_> + 2 0 3 10 -1. + <_> + 3 0 1 10 3. + <_> + + <_> + 5 5 2 2 -1. + <_> + 5 6 2 1 2. + <_> + + <_> + 12 6 4 4 -1. + <_> + 12 8 4 2 2. + <_> + + <_> + 13 5 7 3 -1. + <_> + 13 6 7 1 3. + <_> + + <_> + 10 13 1 2 -1. + <_> + 10 14 1 1 2. + <_> + + <_> + 16 16 4 2 -1. + <_> + 18 16 2 2 2. + <_> + + <_> + 16 12 4 7 -1. + <_> + 18 12 2 7 2. + <_> + + <_> + 16 17 1 3 -1. + <_> + 16 18 1 1 3. + <_> + + <_> + 19 9 1 3 -1. + <_> + 19 10 1 1 3. + <_> + + <_> + 18 7 2 6 -1. + <_> + 19 7 1 6 2. + <_> + + <_> + 8 1 3 4 -1. + <_> + 9 1 1 4 3. + <_> + + <_> + 14 0 6 9 -1. + <_> + 16 0 2 9 3. + <_> + + <_> + 4 2 10 2 -1. + <_> + 9 2 5 2 2. + <_> + + <_> + 2 12 8 4 -1. + <_> + 2 12 4 2 2. + <_> + 6 14 4 2 2. + <_> + + <_> + 0 4 7 3 -1. + <_> + 0 5 7 1 3. + <_> + + <_> + 14 14 3 3 -1. + <_> + 15 14 1 3 3. + <_> + + <_> + 0 3 4 3 -1. + <_> + 2 3 2 3 2. + <_> + + <_> + 1 0 2 7 -1. + <_> + 2 0 1 7 2. + <_> + + <_> + 15 16 4 4 -1. + <_> + 15 18 4 2 2. + <_> + + <_> + 5 8 12 4 -1. + <_> + 5 10 12 2 2. + <_> + + <_> + 3 17 1 2 -1. + <_> + 3 18 1 1 2. + <_> + + <_> + 6 1 3 4 -1. + <_> + 7 1 1 4 3. + <_> + + <_> + 6 2 3 4 -1. + <_> + 7 2 1 4 3. + <_> + + <_> + 6 8 9 12 -1. + <_> + 9 8 3 12 3. + <_> + + <_> + 8 1 8 6 -1. + <_> + 8 3 8 2 3. + <_> + + <_> + 14 2 6 3 -1. + <_> + 17 2 3 3 2. + <_> + + <_> + 0 6 1 3 -1. + <_> + 0 7 1 1 3. + <_> + + <_> + 10 0 10 2 -1. + <_> + 15 0 5 2 2. + <_> + + <_> + 11 0 3 2 -1. + <_> + 12 0 1 2 3. + <_> + + <_> + 3 19 10 1 -1. + <_> + 8 19 5 1 2. + <_> + + <_> + 0 4 7 16 -1. + <_> + 0 12 7 8 2. + <_> + + <_> + 2 16 1 3 -1. + <_> + 2 17 1 1 3. + <_> + + <_> + 7 8 12 6 -1. + <_> + 11 8 4 6 3. + <_> + + <_> + 14 9 6 7 -1. + <_> + 16 9 2 7 3. + <_> + + <_> + 12 17 6 1 -1. + <_> + 14 17 2 1 3. + <_> + + <_> + 16 1 3 1 -1. + <_> + 17 1 1 1 3. + <_> + + <_> + 0 17 8 2 -1. + <_> + 0 17 4 1 2. + <_> + 4 18 4 1 2. + <_> + + <_> + 17 0 2 1 -1. + <_> + 18 0 1 1 2. + <_> + + <_> + 4 15 6 5 -1. + <_> + 6 15 2 5 3. + <_> + + <_> + 7 2 8 2 -1. + <_> + 7 3 8 1 2. + <_> + + <_> + 4 1 8 4 -1. + <_> + 4 3 8 2 2. + <_> + + <_> + 5 19 2 1 -1. + <_> + 6 19 1 1 2. + <_> + + <_> + 5 19 2 1 -1. + <_> + 6 19 1 1 2. + <_> + + <_> + 16 17 1 3 -1. + <_> + 16 18 1 1 3. + <_> + + <_> + 0 11 2 3 -1. + <_> + 1 11 1 3 2. + <_> + + <_> + 0 19 4 1 -1. + <_> + 2 19 2 1 2. + <_> + + <_> + 0 18 4 2 -1. + <_> + 2 18 2 2 2. + <_> + + <_> + 2 17 1 3 -1. + <_> + 2 18 1 1 3. + <_> + + <_> + 5 7 11 2 -1. + <_> + 5 8 11 1 2. + <_> + + <_> + 9 2 4 10 -1. + <_> + 9 7 4 5 2. + <_> + + <_> + 0 2 4 3 -1. + <_> + 0 3 4 1 3. + <_> + + <_> + 10 19 10 1 -1. + <_> + 15 19 5 1 2. + <_> + + <_> + 11 17 8 3 -1. + <_> + 15 17 4 3 2. + <_> + + <_> + 8 19 3 1 -1. + <_> + 9 19 1 1 3. + <_> + + <_> + 14 0 3 4 -1. + <_> + 15 0 1 4 3. + <_> + + <_> + 10 6 4 3 -1. + <_> + 10 7 4 1 3. + <_> + + <_> + 0 8 3 2 -1. + <_> + 0 9 3 1 2. + <_> + + <_> + 7 12 3 6 -1. + <_> + 7 14 3 2 3. + <_> + + <_> + 1 18 1 2 -1. + <_> + 1 19 1 1 2. + <_> + + <_> + 0 12 4 4 -1. + <_> + 2 12 2 4 2. + <_> + + <_> + 1 8 6 7 -1. + <_> + 3 8 2 7 3. + <_> + + <_> + 0 8 4 5 -1. + <_> + 2 8 2 5 2. + <_> + + <_> + 19 16 1 3 -1. + <_> + 19 17 1 1 3. + <_> + + <_> + 1 5 18 6 -1. + <_> + 7 5 6 6 3. + <_> + + <_> + 2 15 4 2 -1. + <_> + 2 16 4 1 2. + <_> + + <_> + 18 6 2 11 -1. + <_> + 19 6 1 11 2. + <_> + + <_> + 0 12 2 6 -1. + <_> + 0 14 2 2 3. + <_> + + <_> + 12 5 3 2 -1. + <_> + 12 6 3 1 2. + <_> + + <_> + 1 3 2 3 -1. + <_> + 1 4 2 1 3. + <_> + + <_> + 16 14 4 4 -1. + <_> + 16 16 4 2 2. + <_> + + <_> + 6 8 12 5 -1. + <_> + 10 8 4 5 3. + <_> + + <_> + 13 7 2 7 -1. + <_> + 14 7 1 7 2. + <_> + + <_> + 1 8 2 6 -1. + <_> + 2 8 1 6 2. + <_> + + <_> + 15 0 3 7 -1. + <_> + 16 0 1 7 3. + <_> + + <_> + 4 2 6 2 -1. + <_> + 6 2 2 2 3. + <_> + + <_> + 0 9 20 9 -1. + <_> + 0 12 20 3 3. + <_> + + <_> + 10 14 2 2 -1. + <_> + 10 15 2 1 2. + <_> + + <_> + 6 5 10 4 -1. + <_> + 6 7 10 2 2. + <_> + + <_> + 6 1 5 9 -1. + <_> + 6 4 5 3 3. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 1 2. + <_> + 17 19 1 1 2. + <_> + + <_> + 0 14 2 4 -1. + <_> + 0 16 2 2 2. + <_> + + <_> + 10 8 2 5 -1. + <_> + 11 8 1 5 2. + <_> + + <_> + 3 7 12 7 -1. + <_> + 7 7 4 7 3. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 1 0 4 4 -1. + <_> + 3 0 2 4 2. + <_> + + <_> + 0 0 6 8 -1. + <_> + 2 0 2 8 3. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 0 0 3 3 -1. + <_> + 0 1 3 1 3. + <_> + + <_> + 5 4 2 4 -1. + <_> + 5 6 2 2 2. + <_> + + <_> + 2 10 9 1 -1. + <_> + 5 10 3 1 3. + <_> + + <_> + 1 17 1 3 -1. + <_> + 1 18 1 1 3. + <_> + + <_> + 0 17 2 3 -1. + <_> + 0 18 2 1 3. + <_> + + <_> + 0 15 16 3 -1. + <_> + 8 15 8 3 2. + <_> + + <_> + 0 5 4 1 -1. + <_> + 2 5 2 1 2. + <_> + + <_> + 1 0 6 20 -1. + <_> + 3 0 2 20 3. + <_> + + <_> + 2 5 4 6 -1. + <_> + 2 5 2 3 2. + <_> + 4 8 2 3 2. + <_> + + <_> + 9 16 6 3 -1. + <_> + 11 16 2 3 3. + <_> + + <_> + 11 17 6 1 -1. + <_> + 14 17 3 1 2. + <_> + + <_> + 3 17 15 2 -1. + <_> + 8 17 5 2 3. + <_> + + <_> + 18 0 2 3 -1. + <_> + 18 1 2 1 3. + <_> + + <_> + 13 1 7 4 -1. + <_> + 13 3 7 2 2. + <_> + + <_> + 13 6 4 4 -1. + <_> + 13 6 2 2 2. + <_> + 15 8 2 2 2. + <_> + + <_> + 17 6 3 4 -1. + <_> + 17 8 3 2 2. + <_> + + <_> + 14 9 2 2 -1. + <_> + 15 9 1 2 2. + <_> + + <_> + 17 17 1 3 -1. + <_> + 17 18 1 1 3. + <_> + + <_> + 3 19 8 1 -1. + <_> + 7 19 4 1 2. + <_> + + <_> + 0 9 3 6 -1. + <_> + 0 12 3 3 2. + <_> + + <_> + 4 7 15 5 -1. + <_> + 9 7 5 5 3. + <_> + + <_> + 6 9 9 5 -1. + <_> + 9 9 3 5 3. + <_> + + <_> + 8 1 6 2 -1. + <_> + 10 1 2 2 3. + <_> + + <_> + 4 0 12 2 -1. + <_> + 10 0 6 2 2. + <_> + + <_> + 7 0 10 3 -1. + <_> + 12 0 5 3 2. + <_> + + <_> + 5 0 9 6 -1. + <_> + 5 2 9 2 3. + <_> + + <_> + 8 3 6 4 -1. + <_> + 8 5 6 2 2. + <_> + + <_> + 17 4 2 3 -1. + <_> + 17 5 2 1 3. + <_> + + <_> + 5 2 4 3 -1. + <_> + 5 3 4 1 3. + <_> + + <_> + 5 9 2 6 -1. + <_> + 6 9 1 6 2. + <_> + + <_> + 14 10 2 6 -1. + <_> + 15 10 1 6 2. + <_> + + <_> + 7 4 3 3 -1. + <_> + 7 5 3 1 3. + <_> + + <_> + 12 4 8 2 -1. + <_> + 12 4 4 1 2. + <_> + 16 5 4 1 2. + <_> + + <_> + 15 8 1 6 -1. + <_> + 15 10 1 2 3. + <_> + + <_> + 4 17 11 3 -1. + <_> + 4 18 11 1 3. + <_> + + <_> + 3 0 16 20 -1. + <_> + 3 10 16 10 2. + <_> + + <_> + 12 4 4 6 -1. + <_> + 12 6 4 2 3. + <_> + + <_> + 11 0 6 6 -1. + <_> + 13 0 2 6 3. + <_> + + <_> + 13 1 6 4 -1. + <_> + 13 1 3 2 2. + <_> + 16 3 3 2 2. + <_> + + <_> + 11 0 6 4 -1. + <_> + 13 0 2 4 3. + <_> + + <_> + 8 6 6 9 -1. + <_> + 10 6 2 9 3. + <_> + + <_> + 7 0 3 4 -1. + <_> + 8 0 1 4 3. + <_> + + <_> + 0 17 14 2 -1. + <_> + 0 17 7 1 2. + <_> + 7 18 7 1 2. + <_> + + <_> + 6 18 2 2 -1. + <_> + 6 18 1 1 2. + <_> + 7 19 1 1 2. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 17 18 2 2 -1. + <_> + 17 18 1 1 2. + <_> + 18 19 1 1 2. + <_> + + <_> + 5 7 1 9 -1. + <_> + 5 10 1 3 3. + <_> + + <_> + 5 3 6 4 -1. + <_> + 7 3 2 4 3. + <_> + + <_> + 1 9 6 2 -1. + <_> + 1 9 3 1 2. + <_> + 4 10 3 1 2. + <_> + + <_> + 6 9 2 3 -1. + <_> + 7 9 1 3 2. + <_> + + <_> + 6 8 6 12 -1. + <_> + 8 8 2 12 3. + <_> + + <_> + 4 18 2 2 -1. + <_> + 4 18 1 1 2. + <_> + 5 19 1 1 2. + <_> + + <_> + 9 1 6 6 -1. + <_> + 9 3 6 2 3. + <_> + + <_> + 6 17 6 2 -1. + <_> + 6 18 6 1 2. + <_> + + <_> + 3 18 16 2 -1. + <_> + 3 19 16 1 2. + <_> + + <_> + 3 0 3 11 -1. + <_> + 4 0 1 11 3. + <_> + + <_> + 13 18 3 1 -1. + <_> + 14 18 1 1 3. + <_> + + <_> + 6 0 9 6 -1. + <_> + 6 2 9 2 3. + <_> + + <_> + 1 2 12 4 -1. + <_> + 1 2 6 2 2. + <_> + 7 4 6 2 2. + <_> + + <_> + 3 3 6 4 -1. + <_> + 5 3 2 4 3. + <_> + + <_> + 12 0 8 1 -1. + <_> + 16 0 4 1 2. + <_> + + <_> + 9 0 6 2 -1. + <_> + 11 0 2 2 3. + <_> + + <_> + 3 3 12 1 -1. + <_> + 9 3 6 1 2. + <_> + + <_> + 2 7 6 2 -1. + <_> + 2 7 3 1 2. + <_> + 5 8 3 1 2. + <_> + + <_> + 0 8 4 6 -1. + <_> + 0 10 4 2 3. + <_> + + <_> + 9 6 3 7 -1. + <_> + 10 6 1 7 3. + <_> + + <_> + 9 6 6 13 -1. + <_> + 11 6 2 13 3. + <_> + + <_> + 11 12 6 1 -1. + <_> + 13 12 2 1 3. + <_> + + <_> + 18 9 2 6 -1. + <_> + 18 12 2 3 2. + <_> + + <_> + 17 2 3 9 -1. + <_> + 18 2 1 9 3. + <_> + + <_> + 13 8 4 6 -1. + <_> + 13 8 2 3 2. + <_> + 15 11 2 3 2. + <_> + + <_> + 4 2 12 6 -1. + <_> + 10 2 6 6 2. + <_> + + <_> + 4 14 16 6 -1. + <_> + 12 14 8 6 2. + <_> + + <_> + 6 19 10 1 -1. + <_> + 11 19 5 1 2. + <_> + + <_> + 6 17 1 3 -1. + <_> + 6 18 1 1 3. + <_> + + <_> + 4 14 10 3 -1. + <_> + 4 15 10 1 3. + <_> + + <_> + 6 0 12 12 -1. + <_> + 6 4 12 4 3. + <_> + + <_> + 5 7 4 2 -1. + <_> + 5 7 2 1 2. + <_> + 7 8 2 1 2. + <_> + + <_> + 17 5 3 2 -1. + <_> + 18 5 1 2 3. + <_> + + <_> + 8 13 6 3 -1. + <_> + 8 14 6 1 3. + <_> + + <_> + 8 13 5 3 -1. + <_> + 8 14 5 1 3. + <_> + + <_> + 13 2 1 18 -1. + <_> + 13 11 1 9 2. + <_> + + <_> + 6 10 9 2 -1. + <_> + 9 10 3 2 3. + <_> + + <_> + 11 0 7 4 -1. + <_> + 11 2 7 2 2. + <_> + + <_> + 1 0 6 8 -1. + <_> + 3 0 2 8 3. + <_> + + <_> + 9 15 3 3 -1. + <_> + 9 16 3 1 3. + <_> + + <_> + 9 17 9 3 -1. + <_> + 9 18 9 1 3. + <_> + + <_> + 12 12 3 3 -1. + <_> + 12 13 3 1 3. + <_> + + <_> + 4 1 3 5 -1. + <_> + 5 1 1 5 3. + <_> + + <_> + 10 14 2 3 -1. + <_> + 10 15 2 1 3. + <_> + + <_> + 18 17 2 2 -1. + <_> + 18 17 1 1 2. + <_> + 19 18 1 1 2. + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 18 1 1 2. + <_> + 19 19 1 1 2. + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 18 1 1 2. + <_> + 19 19 1 1 2. + <_> + + <_> + 4 10 9 1 -1. + <_> + 7 10 3 1 3. + <_> + + <_> + 3 9 6 5 -1. + <_> + 5 9 2 5 3. + <_> + + <_> + 18 8 1 12 -1. + <_> + 18 14 1 6 2. + <_> + + <_> + 0 2 8 6 -1. + <_> + 0 2 4 3 2. + <_> + 4 5 4 3 2. + <_> + + <_> + 9 4 3 3 -1. + <_> + 9 5 3 1 3. + <_> + + <_> + 3 18 2 2 -1. + <_> + 3 18 1 1 2. + <_> + 4 19 1 1 2. + <_> + + <_> + 6 4 4 3 -1. + <_> + 6 5 4 1 3. + <_> + + <_> + 16 7 4 2 -1. + <_> + 16 7 2 1 2. + <_> + 18 8 2 1 2. + <_> + + <_> + 5 17 1 3 -1. + <_> + 5 18 1 1 3. + <_> + + <_> + 2 0 15 20 -1. + <_> + 2 10 15 10 2. + <_> + + <_> + 8 11 6 4 -1. + <_> + 8 11 3 2 2. + <_> + 11 13 3 2 2. + <_> + + <_> + 8 16 4 3 -1. + <_> + 8 17 4 1 3. + <_> + + <_> + 8 18 2 2 -1. + <_> + 8 18 1 1 2. + <_> + 9 19 1 1 2. + <_> + + <_> + 2 16 13 3 -1. + <_> + 2 17 13 1 3. + <_> + + <_> + 16 16 2 2 -1. + <_> + 16 16 1 1 2. + <_> + 17 17 1 1 2. + <_> + + <_> + 8 1 6 3 -1. + <_> + 10 1 2 3 3. + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 1 1 2. + <_> + 17 8 1 1 2. + <_> + + <_> + 14 7 4 2 -1. + <_> + 14 7 2 1 2. + <_> + 16 8 2 1 2. + <_> + + <_> + 4 0 14 1 -1. + <_> + 11 0 7 1 2. + <_> + + <_> + 10 4 8 2 -1. + <_> + 10 4 4 1 2. + <_> + 14 5 4 1 2. + <_> + + <_> + 8 2 3 2 -1. + <_> + 9 2 1 2 3. + <_> + + <_> + 12 11 6 3 -1. + <_> + 12 12 6 1 3. + <_> + + <_> + 1 5 1 4 -1. + <_> + 1 7 1 2 2. + <_> + + <_> + 1 1 1 18 -1. + <_> + 1 7 1 6 3. + <_> + + <_> + 11 13 3 2 -1. + <_> + 11 14 3 1 2. + <_> + + <_> + 0 1 12 2 -1. + <_> + 0 1 6 1 2. + <_> + 6 2 6 1 2. + <_> + + <_> + 10 18 2 2 -1. + <_> + 10 18 1 1 2. + <_> + 11 19 1 1 2. + <_> + + <_> + 4 5 4 4 -1. + <_> + 4 5 2 2 2. + <_> + 6 7 2 2 2. + <_> + + <_> + 6 7 1 3 -1. + <_> + 6 8 1 1 3. + <_> + + <_> + 14 10 6 2 -1. + <_> + 16 10 2 2 3. + <_> + + <_> + 16 8 3 6 -1. + <_> + 17 8 1 6 3. + <_> + + <_> + 4 10 6 2 -1. + <_> + 6 10 2 2 3. + <_> + + <_> + 6 5 3 7 -1. + <_> + 7 5 1 7 3. + <_> + + <_> + 0 13 6 6 -1. + <_> + 0 16 6 3 2. + <_> + + <_> + 12 5 1 9 -1. + <_> + 12 8 1 3 3. + <_> + + <_> + 5 9 3 3 -1. + <_> + 6 9 1 3 3. + <_> + + <_> + 7 5 6 13 -1. + <_> + 9 5 2 13 3. + <_> + + <_> + 19 8 1 10 -1. + <_> + 19 13 1 5 2. + <_> + + <_> + 11 18 6 1 -1. + <_> + 13 18 2 1 3. + <_> + + <_> + 9 7 6 12 -1. + <_> + 11 7 2 12 3. + <_> + + <_> + 12 7 6 6 -1. + <_> + 14 7 2 6 3. + <_> + + <_> + 15 8 3 4 -1. + <_> + 16 8 1 4 3. + <_> + + <_> + 6 11 4 2 -1. + <_> + 6 12 4 1 2. + <_> + + <_> + 1 6 6 8 -1. + <_> + 3 6 2 8 3. + <_> + + <_> + 11 15 6 5 -1. + <_> + 13 15 2 5 3. + <_> + + <_> + 15 17 4 2 -1. + <_> + 15 18 4 1 2. + <_> + + <_> + 13 11 6 1 -1. + <_> + 15 11 2 1 3. + <_> + + <_> + 5 18 2 2 -1. + <_> + 5 18 1 1 2. + <_> + 6 19 1 1 2. + <_> + + <_> + 4 8 4 4 -1. + <_> + 4 8 2 2 2. + <_> + 6 10 2 2 2. + <_> + + <_> + 11 7 9 3 -1. + <_> + 11 8 9 1 3. + <_> + + <_> + 0 3 10 4 -1. + <_> + 0 3 5 2 2. + <_> + 5 5 5 2 2. + <_> + + <_> + 7 18 6 1 -1. + <_> + 9 18 2 1 3. + <_> + + <_> + 0 8 3 3 -1. + <_> + 0 9 3 1 3. + <_> + + <_> + 0 0 6 8 -1. + <_> + 0 0 3 4 2. + <_> + 3 4 3 4 2. + <_> + + <_> + 7 6 3 8 -1. + <_> + 8 6 1 8 3. + <_> + + <_> + 13 7 7 3 -1. + <_> + 13 8 7 1 3. + <_> + + <_> + 3 3 2 2 -1. + <_> + 3 4 2 1 2. + <_> + + <_> + 0 3 3 3 -1. + <_> + 0 4 3 1 3. + <_> + + <_> + 9 3 5 2 -1. + <_> + 9 4 5 1 2. + <_> + + <_> + 6 5 9 4 -1. + <_> + 9 5 3 4 3. + <_> + + <_> + 3 10 12 3 -1. + <_> + 7 10 4 3 3. + <_> + + <_> + 8 7 3 6 -1. + <_> + 9 7 1 6 3. + <_> + + <_> + 5 5 6 5 -1. + <_> + 8 5 3 5 2. + <_> + + <_> + 0 5 2 3 -1. + <_> + 0 6 2 1 3. + <_> + + <_> + 9 7 3 4 -1. + <_> + 10 7 1 4 3. + <_> + + <_> + 1 0 6 15 -1. + <_> + 3 0 2 15 3. + <_> + + <_> + 15 1 3 5 -1. + <_> + 16 1 1 5 3. + <_> + + <_> + 9 2 3 10 -1. + <_> + 10 2 1 10 3. + <_> + + <_> + 8 8 6 12 -1. + <_> + 10 8 2 12 3. + <_> + + <_> + 16 4 3 4 -1. + <_> + 16 6 3 2 2. + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 1 1 2. + <_> + 17 8 1 1 2. + <_> + + <_> + 13 0 6 9 -1. + <_> + 13 3 6 3 3. + <_> + + <_> + 7 17 1 3 -1. + <_> + 7 18 1 1 3. + <_> + + <_> + 12 1 4 2 -1. + <_> + 12 2 4 1 2. + <_> + + <_> + 17 3 1 3 -1. + <_> + 17 4 1 1 3. + <_> + + <_> + 0 16 9 3 -1. + <_> + 0 17 9 1 3. + <_> + + <_> + 3 6 2 4 -1. + <_> + 3 6 1 2 2. + <_> + 4 8 1 2 2. + <_> + + <_> + 13 18 3 1 -1. + <_> + 14 18 1 1 3. + <_> + + <_> + 0 18 4 2 -1. + <_> + 2 18 2 2 2. + <_> + + <_> + 1 19 2 1 -1. + <_> + 2 19 1 1 2. + <_> + + <_> + 0 18 4 2 -1. + <_> + 0 19 4 1 2. + <_> + + <_> + 2 17 1 3 -1. + <_> + 2 18 1 1 3. + <_> + + <_> + 4 8 3 5 -1. + <_> + 5 8 1 5 3. + <_> + + <_> + 2 1 6 7 -1. + <_> + 4 1 2 7 3. + <_> + + <_> + 3 6 2 8 -1. + <_> + 3 6 1 4 2. + <_> + 4 10 1 4 2. + <_> + + <_> + 4 5 11 10 -1. + <_> + 4 10 11 5 2. + <_> + + <_> + 0 13 20 2 -1. + <_> + 10 13 10 2 2. + <_> + + <_> + 1 13 16 3 -1. + <_> + 9 13 8 3 2. + <_> + + <_> + 16 4 4 4 -1. + <_> + 16 4 2 2 2. + <_> + 18 6 2 2 2. + <_> + + <_> + 16 0 4 12 -1. + <_> + 16 0 2 6 2. + <_> + 18 6 2 6 2. + <_> + + <_> + 14 15 3 1 -1. + <_> + 15 15 1 1 3. + <_> + + <_> + 3 4 12 10 -1. + <_> + 3 9 12 5 2. + <_> + + <_> + 9 18 2 2 -1. + <_> + 9 18 1 1 2. + <_> + 10 19 1 1 2. + <_> + + <_> + 9 18 2 2 -1. + <_> + 9 18 1 1 2. + <_> + 10 19 1 1 2. + <_> + + <_> + 13 4 2 14 -1. + <_> + 13 4 1 7 2. + <_> + 14 11 1 7 2. + <_> + + <_> + 4 2 6 4 -1. + <_> + 7 2 3 4 2. + <_> + + <_> + 0 0 18 20 -1. + <_> + 0 0 9 10 2. + <_> + 9 10 9 10 2. + <_> + + <_> + 15 11 1 2 -1. + <_> + 15 12 1 1 2. + <_> + + <_> + 16 10 2 4 -1. + <_> + 16 10 1 2 2. + <_> + 17 12 1 2 2. + <_> + + <_> + 18 17 2 2 -1. + <_> + 18 17 1 1 2. + <_> + 19 18 1 1 2. + <_> + + <_> + 9 17 1 2 -1. + <_> + 9 18 1 1 2. + <_> + + <_> + 8 4 9 6 -1. + <_> + 11 4 3 6 3. + <_> + + <_> + 6 9 9 10 -1. + <_> + 9 9 3 10 3. + <_> + + <_> + 5 0 5 4 -1. + <_> + 5 2 5 2 2. + <_> + + <_> + 5 7 11 4 -1. + <_> + 5 9 11 2 2. + <_> + + <_> + 2 4 2 14 -1. + <_> + 3 4 1 14 2. + <_> + + <_> + 8 6 3 5 -1. + <_> + 9 6 1 5 3. + <_> + + <_> + 8 4 3 9 -1. + <_> + 9 4 1 9 3. + <_> + + <_> + 0 8 20 6 -1. + <_> + 0 10 20 2 3. + <_> + + <_> + 14 16 6 1 -1. + <_> + 17 16 3 1 2. + <_> + + <_> + 17 18 2 2 -1. + <_> + 17 19 2 1 2. + <_> + + <_> + 8 17 6 3 -1. + <_> + 10 17 2 3 3. + <_> + + <_> + 4 1 9 15 -1. + <_> + 7 1 3 15 3. + <_> + + <_> + 11 5 3 12 -1. + <_> + 12 5 1 12 3. + <_> + + <_> + 0 15 4 3 -1. + <_> + 0 16 4 1 3. + <_> + + <_> + 0 0 15 1 -1. + <_> + 5 0 5 1 3. + <_> + + <_> + 6 0 6 4 -1. + <_> + 8 0 2 4 3. + <_> + + <_> + 2 0 9 3 -1. + <_> + 5 0 3 3 3. + <_> + + <_> + 13 6 3 7 -1. + <_> + 14 6 1 7 3. + <_> + + <_> + 7 6 4 2 -1. + <_> + 7 7 4 1 2. + <_> + + <_> + 6 18 6 1 -1. + <_> + 8 18 2 1 3. + <_> + + <_> + 18 6 2 2 -1. + <_> + 18 7 2 1 2. + <_> + + <_> + 6 4 7 3 -1. + <_> + 6 5 7 1 3. + <_> + + <_> + 12 7 3 1 -1. + <_> + 13 7 1 1 3. + <_> + + <_> + 15 1 2 10 -1. + <_> + 15 1 1 5 2. + <_> + 16 6 1 5 2. + <_> + + <_> + 0 18 2 2 -1. + <_> + 0 19 2 1 2. + <_> + + <_> + 19 4 1 8 -1. + <_> + 19 8 1 4 2. + <_> + + <_> + 1 17 1 3 -1. + <_> + 1 18 1 1 3. + <_> + + <_> + 0 15 6 4 -1. + <_> + 0 15 3 2 2. + <_> + 3 17 3 2 2. + <_> + + <_> + 19 0 1 18 -1. + <_> + 19 6 1 6 3. + <_> + + <_> + 10 2 6 2 -1. + <_> + 12 2 2 2 3. + <_> + + <_> + 2 8 12 2 -1. + <_> + 6 8 4 2 3. + <_> + + <_> + 16 0 4 1 -1. + <_> + 18 0 2 1 2. + <_> + + <_> + 8 4 2 6 -1. + <_> + 8 7 2 3 2. + <_> + + <_> + 14 5 2 10 -1. + <_> + 15 5 1 10 2. + <_> + + <_> + 13 4 2 2 -1. + <_> + 13 5 2 1 2. + <_> + + <_> + 11 1 3 6 -1. + <_> + 11 3 3 2 3. + <_> + + <_> + 6 9 12 2 -1. + <_> + 10 9 4 2 3. + <_> + + <_> + 9 16 4 2 -1. + <_> + 9 17 4 1 2. + <_> + + <_> + 5 14 15 4 -1. + <_> + 5 16 15 2 2. + <_> + + <_> + 18 16 2 2 -1. + <_> + 18 17 2 1 2. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 1 2. + <_> + 17 19 1 1 2. + <_> + + <_> + 6 4 3 8 -1. + <_> + 7 4 1 8 3. + <_> + + <_> + 5 9 3 1 -1. + <_> + 6 9 1 1 3. + <_> + + <_> + 0 8 1 6 -1. + <_> + 0 10 1 2 3. + <_> + + <_> + 11 2 9 6 -1. + <_> + 14 2 3 6 3. + <_> + + <_> + 12 2 6 4 -1. + <_> + 14 2 2 4 3. + <_> + + <_> + 1 7 2 4 -1. + <_> + 1 9 2 2 2. + <_> + + <_> + 13 1 6 4 -1. + <_> + 13 3 6 2 2. + <_> + + <_> + 4 10 2 10 -1. + <_> + 4 10 1 5 2. + <_> + 5 15 1 5 2. + <_> + + <_> + 2 16 9 3 -1. + <_> + 5 16 3 3 3. + <_> + + <_> + 1 2 3 9 -1. + <_> + 2 2 1 9 3. + <_> + + <_> + 19 7 1 4 -1. + <_> + 19 9 1 2 2. + <_> + + <_> + 14 11 6 8 -1. + <_> + 14 11 3 4 2. + <_> + 17 15 3 4 2. + <_> + + <_> + 15 12 4 6 -1. + <_> + 15 12 2 3 2. + <_> + 17 15 2 3 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 1 1 2. + <_> + 18 17 1 1 2. + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 1 1 2. + <_> + 18 17 1 1 2. + <_> + + <_> + 2 3 2 2 -1. + <_> + 2 3 1 1 2. + <_> + 3 4 1 1 2. + <_> + + <_> + 10 10 3 3 -1. + <_> + 11 10 1 3 3. + <_> + + <_> + 5 9 7 8 -1. + <_> + 5 13 7 4 2. + <_> + + <_> + 7 16 2 2 -1. + <_> + 7 16 1 1 2. + <_> + 8 17 1 1 2. + <_> + + <_> + 7 16 2 2 -1. + <_> + 7 16 1 1 2. + <_> + 8 17 1 1 2. + <_> + + <_> + 9 8 10 3 -1. + <_> + 14 8 5 3 2. + <_> + + <_> + 6 7 4 8 -1. + <_> + 6 7 2 4 2. + <_> + 8 11 2 4 2. + <_> + + <_> + 1 6 4 3 -1. + <_> + 1 7 4 1 3. + <_> + + <_> + 6 10 6 10 -1. + <_> + 8 10 2 10 3. + <_> + + <_> + 4 6 3 6 -1. + <_> + 5 6 1 6 3. + <_> + + <_> + 3 10 4 4 -1. + <_> + 3 10 2 2 2. + <_> + 5 12 2 2 2. + <_> + + <_> + 3 10 4 4 -1. + <_> + 3 10 2 2 2. + <_> + 5 12 2 2 2. + <_> + + <_> + 3 10 4 4 -1. + <_> + 3 10 2 2 2. + <_> + 5 12 2 2 2. + <_> + + <_> + 14 8 2 6 -1. + <_> + 15 8 1 6 2. + <_> + + <_> + 3 10 4 4 -1. + <_> + 3 10 2 2 2. + <_> + 5 12 2 2 2. + <_> + + <_> + 3 10 4 4 -1. + <_> + 3 10 2 2 2. + <_> + 5 12 2 2 2. + <_> + + <_> + 12 4 3 9 -1. + <_> + 13 4 1 9 3. + <_> + + <_> + 12 3 1 12 -1. + <_> + 12 7 1 4 3. + <_> + + <_> + 2 0 18 1 -1. + <_> + 8 0 6 1 3. + <_> + + <_> + 10 0 10 6 -1. + <_> + 10 0 5 3 2. + <_> + 15 3 5 3 2. + <_> + + <_> + 18 16 2 2 -1. + <_> + 18 17 2 1 2. + <_> + + <_> + 3 5 4 2 -1. + <_> + 3 5 2 1 2. + <_> + 5 6 2 1 2. + <_> + + <_> + 11 8 3 3 -1. + <_> + 12 8 1 3 3. + <_> + + <_> + 11 7 3 5 -1. + <_> + 12 7 1 5 3. + <_> + + <_> + 3 19 15 1 -1. + <_> + 8 19 5 1 3. + <_> + + <_> + 8 13 3 2 -1. + <_> + 8 14 3 1 2. + <_> + + <_> + 2 12 8 4 -1. + <_> + 2 12 4 2 2. + <_> + 6 14 4 2 2. + <_> + + <_> + 16 16 2 2 -1. + <_> + 16 16 1 1 2. + <_> + 17 17 1 1 2. + <_> + + <_> + 7 0 3 2 -1. + <_> + 8 0 1 2 3. + <_> + + <_> + 6 7 2 5 -1. + <_> + 7 7 1 5 2. + <_> + + <_> + 18 0 2 17 -1. + <_> + 19 0 1 17 2. + <_> + + <_> + 16 16 1 3 -1. + <_> + 16 17 1 1 3. + <_> + + <_> + 14 8 3 7 -1. + <_> + 15 8 1 7 3. + <_> + + <_> + 10 17 2 2 -1. + <_> + 10 17 1 1 2. + <_> + 11 18 1 1 2. + <_> + + <_> + 4 9 1 3 -1. + <_> + 4 10 1 1 3. + <_> + + <_> + 18 10 2 3 -1. + <_> + 18 11 2 1 3. + <_> + + <_> + 12 1 3 10 -1. + <_> + 13 1 1 10 3. + <_> + + <_> + 8 12 9 1 -1. + <_> + 11 12 3 1 3. + <_> + + <_> + 5 18 2 2 -1. + <_> + 5 18 1 1 2. + <_> + 6 19 1 1 2. + <_> + + <_> + 19 6 1 9 -1. + <_> + 19 9 1 3 3. + <_> + + <_> + 4 7 2 4 -1. + <_> + 4 7 1 2 2. + <_> + 5 9 1 2 2. + <_> + + <_> + 1 4 6 14 -1. + <_> + 3 4 2 14 3. + <_> + + <_> + 10 5 9 3 -1. + <_> + 13 5 3 3 3. + <_> + + <_> + 18 7 2 6 -1. + <_> + 18 9 2 2 3. + <_> + + <_> + 5 6 2 7 -1. + <_> + 6 6 1 7 2. + <_> + + <_> + 10 4 6 8 -1. + <_> + 13 4 3 8 2. + <_> + + <_> + 0 8 2 9 -1. + <_> + 0 11 2 3 3. + <_> + + <_> + 0 7 5 3 -1. + <_> + 0 8 5 1 3. + <_> + + <_> + 8 1 7 2 -1. + <_> + 8 2 7 1 2. + <_> + + <_> + 7 5 3 5 -1. + <_> + 8 5 1 5 3. + <_> + + <_> + 19 2 1 2 -1. + <_> + 19 3 1 1 2. + <_> + + <_> + 6 7 10 11 -1. + <_> + 11 7 5 11 2. + <_> + + <_> + 9 19 6 1 -1. + <_> + 11 19 2 1 3. + <_> + + <_> + 3 0 12 1 -1. + <_> + 7 0 4 1 3. + <_> + + <_> + 4 1 6 5 -1. + <_> + 6 1 2 5 3. + <_> + + <_> + 6 12 12 6 -1. + <_> + 10 12 4 6 3. + <_> + + <_> + 16 13 2 3 -1. + <_> + 16 14 2 1 3. + <_> + + <_> + 7 14 4 2 -1. + <_> + 7 15 4 1 2. + <_> + + <_> + 7 14 2 2 -1. + <_> + 7 15 2 1 2. + <_> + + <_> + 3 10 2 4 -1. + <_> + 3 10 1 2 2. + <_> + 4 12 1 2 2. + <_> + + <_> + 0 3 2 6 -1. + <_> + 0 5 2 2 3. + <_> + + <_> + 1 10 2 2 -1. + <_> + 1 10 1 1 2. + <_> + 2 11 1 1 2. + <_> + + <_> + 16 4 4 3 -1. + <_> + 16 5 4 1 3. + <_> + + <_> + 5 10 2 4 -1. + <_> + 5 10 1 2 2. + <_> + 6 12 1 2 2. + <_> + + <_> + 5 11 13 2 -1. + <_> + 5 12 13 1 2. + <_> + + <_> + 10 2 3 11 -1. + <_> + 11 2 1 11 3. + <_> + + <_> + 10 2 4 4 -1. + <_> + 10 4 4 2 2. + <_> + + <_> + 8 8 6 2 -1. + <_> + 10 8 2 2 3. + <_> + + <_> + 11 2 3 3 -1. + <_> + 12 2 1 3 3. + <_> + + <_> + 6 18 14 2 -1. + <_> + 6 18 7 1 2. + <_> + 13 19 7 1 2. + <_> + + <_> + 17 7 1 12 -1. + <_> + 17 11 1 4 3. + <_> + + <_> + 10 5 10 3 -1. + <_> + 10 6 10 1 3. + <_> + + <_> + 6 1 3 3 -1. + <_> + 7 1 1 3 3. + <_> + + <_> + 13 8 3 1 -1. + <_> + 14 8 1 1 3. + <_> + + <_> + 10 14 2 6 -1. + <_> + 10 16 2 2 3. + <_> + + <_> + 4 1 12 14 -1. + <_> + 8 1 4 14 3. + <_> + + <_> + 14 1 6 14 -1. + <_> + 16 1 2 14 3. + <_> + + <_> + 3 16 2 2 -1. + <_> + 3 16 1 1 2. + <_> + 4 17 1 1 2. + <_> + + <_> + 0 16 2 2 -1. + <_> + 0 17 2 1 2. + <_> + + <_> + 15 6 4 6 -1. + <_> + 15 6 2 3 2. + <_> + 17 9 2 3 2. + <_> + + <_> + 12 5 2 2 -1. + <_> + 12 6 2 1 2. + <_> + + <_> + 7 6 6 13 -1. + <_> + 9 6 2 13 3. + <_> + + <_> + 1 9 6 5 -1. + <_> + 3 9 2 5 3. + <_> + + <_> + 0 5 3 4 -1. + <_> + 0 7 3 2 2. + <_> + + <_> + 4 1 16 2 -1. + <_> + 4 1 8 1 2. + <_> + 12 2 8 1 2. + <_> + + <_> + 1 18 4 2 -1. + <_> + 1 18 2 1 2. + <_> + 3 19 2 1 2. + <_> + + <_> + 7 7 3 4 -1. + <_> + 8 7 1 4 3. + <_> + + <_> + 3 4 9 3 -1. + <_> + 6 4 3 3 3. + <_> + + <_> + 4 6 6 10 -1. + <_> + 6 6 2 10 3. + <_> + + <_> + 9 0 8 10 -1. + <_> + 13 0 4 10 2. + <_> + + <_> + 8 0 8 1 -1. + <_> + 12 0 4 1 2. + <_> + + <_> + 6 2 8 16 -1. + <_> + 6 2 4 8 2. + <_> + 10 10 4 8 2. + <_> + + <_> + 14 10 2 10 -1. + <_> + 14 10 1 5 2. + <_> + 15 15 1 5 2. + <_> + + <_> + 12 11 1 2 -1. + <_> + 12 12 1 1 2. + <_> + + <_> + 16 0 3 8 -1. + <_> + 17 0 1 8 3. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 10 2. + <_> + + <_> + 16 0 3 5 -1. + <_> + 17 0 1 5 3. + <_> + + <_> + 4 5 11 2 -1. + <_> + 4 6 11 1 2. + <_> + + <_> + 1 0 2 1 -1. + <_> + 2 0 1 1 2. + <_> + + <_> + 0 0 2 3 -1. + <_> + 0 1 2 1 3. + <_> + + <_> + 11 6 6 11 -1. + <_> + 13 6 2 11 3. + <_> + + <_> + 14 0 3 1 -1. + <_> + 15 0 1 1 3. + <_> + + <_> + 19 7 1 2 -1. + <_> + 19 8 1 1 2. + <_> + + <_> + 17 0 3 9 -1. + <_> + 18 0 1 9 3. + <_> + + <_> + 12 7 3 4 -1. + <_> + 13 7 1 4 3. + <_> + + <_> + 0 1 14 2 -1. + <_> + 0 1 7 1 2. + <_> + 7 2 7 1 2. + <_> + + <_> + 3 1 3 2 -1. + <_> + 4 1 1 2 3. + <_> + + <_> + 4 0 15 2 -1. + <_> + 9 0 5 2 3. + <_> + + <_> + 10 2 6 1 -1. + <_> + 12 2 2 1 3. + <_> + + <_> + 9 4 6 11 -1. + <_> + 11 4 2 11 3. + <_> + + <_> + 2 16 2 4 -1. + <_> + 2 18 2 2 2. + <_> + + <_> + 6 17 6 3 -1. + <_> + 8 17 2 3 3. + <_> + + <_> + 7 9 6 2 -1. + <_> + 9 9 2 2 3. + <_> + + <_> + 6 8 9 2 -1. + <_> + 9 8 3 2 3. + <_> + + <_> + 6 6 2 10 -1. + <_> + 6 6 1 5 2. + <_> + 7 11 1 5 2. + <_> + + <_> + 0 11 2 3 -1. + <_> + 0 12 2 1 3. + <_> + + <_> + 11 15 4 1 -1. + <_> + 13 15 2 1 2. + <_> + + <_> + 6 17 1 2 -1. + <_> + 6 18 1 1 2. + <_> + + <_> + 0 0 6 20 -1. + <_> + 2 0 2 20 3. + <_> + + <_> + 3 10 2 2 -1. + <_> + 4 10 1 2 2. + <_> + + <_> + 4 7 3 5 -1. + <_> + 5 7 1 5 3. + <_> + + <_> + 3 12 6 2 -1. + <_> + 5 12 2 2 3. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 1 1 2. + <_> + 18 17 1 1 2. + <_> + + <_> + 15 1 3 16 -1. + <_> + 16 1 1 16 3. + <_> + + <_> + 6 16 6 3 -1. + <_> + 8 16 2 3 3. + <_> + + <_> + 15 14 3 2 -1. + <_> + 15 15 3 1 2. + <_> + + <_> + 12 16 1 2 -1. + <_> + 12 17 1 1 2. + <_> + + <_> + 0 2 4 4 -1. + <_> + 0 2 2 2 2. + <_> + 2 4 2 2 2. + <_> + + <_> + 1 1 6 4 -1. + <_> + 1 1 3 2 2. + <_> + 4 3 3 2 2. + <_> + + <_> + 1 18 1 2 -1. + <_> + 1 19 1 1 2. + <_> + + <_> + 4 7 2 3 -1. + <_> + 4 8 2 1 3. + <_> + + <_> + 1 0 9 14 -1. + <_> + 1 7 9 7 2. + <_> + + <_> + 4 9 2 6 -1. + <_> + 4 9 1 3 2. + <_> + 5 12 1 3 2. + <_> + + <_> + 3 9 4 3 -1. + <_> + 5 9 2 3 2. + <_> + + <_> + 0 9 2 4 -1. + <_> + 0 11 2 2 2. + <_> + + <_> + 16 6 3 10 -1. + <_> + 17 6 1 10 3. + <_> + + <_> + 16 11 2 1 -1. + <_> + 17 11 1 1 2. + <_> + + <_> + 5 7 4 4 -1. + <_> + 5 9 4 2 2. + <_> + + <_> + 10 11 9 2 -1. + <_> + 13 11 3 2 3. + <_> + + <_> + 15 10 2 2 -1. + <_> + 15 10 1 1 2. + <_> + 16 11 1 1 2. + <_> + + <_> + 10 6 6 14 -1. + <_> + 10 13 6 7 2. + <_> + + <_> + 14 7 3 5 -1. + <_> + 15 7 1 5 3. + <_> + + <_> + 6 11 12 3 -1. + <_> + 10 11 4 3 3. + <_> + + <_> + 17 16 1 2 -1. + <_> + 17 17 1 1 2. + <_> + + <_> + 8 5 5 4 -1. + <_> + 8 7 5 2 2. + <_> + + <_> + 11 6 4 2 -1. + <_> + 11 7 4 1 2. + <_> + + <_> + 3 4 8 2 -1. + <_> + 3 4 4 1 2. + <_> + 7 5 4 1 2. + <_> + + <_> + 0 8 6 6 -1. + <_> + 2 8 2 6 3. + <_> + + <_> + 7 4 6 2 -1. + <_> + 7 5 6 1 2. + <_> + + <_> + 7 3 6 3 -1. + <_> + 9 3 2 3 3. + <_> + + <_> + 2 17 3 3 -1. + <_> + 2 18 3 1 3. + <_> + + <_> + 3 10 6 1 -1. + <_> + 5 10 2 1 3. + <_> + + <_> + 7 2 6 2 -1. + <_> + 9 2 2 2 3. + <_> + + <_> + 4 11 9 1 -1. + <_> + 7 11 3 1 3. + <_> + + <_> + 7 7 11 12 -1. + <_> + 7 13 11 6 2. + <_> + + <_> + 3 2 3 4 -1. + <_> + 4 2 1 4 3. + <_> + + <_> + 9 7 9 3 -1. + <_> + 12 7 3 3 3. + <_> + + <_> + 15 11 2 6 -1. + <_> + 15 11 1 3 2. + <_> + 16 14 1 3 2. + <_> + + <_> + 0 5 5 3 -1. + <_> + 0 6 5 1 3. + <_> + + <_> + 8 1 6 12 -1. + <_> + 10 1 2 12 3. + <_> + + <_> + 3 7 15 13 -1. + <_> + 8 7 5 13 3. + <_> + + <_> + 0 9 9 9 -1. + <_> + 0 12 9 3 3. + <_> + + <_> + 16 0 3 8 -1. + <_> + 17 0 1 8 3. + <_> + + <_> + 16 2 4 2 -1. + <_> + 18 2 2 2 2. + <_> + + <_> + 13 0 6 5 -1. + <_> + 16 0 3 5 2. + <_> + + <_> + 15 1 3 2 -1. + <_> + 16 1 1 2 3. + <_> + + <_> + 11 8 3 2 -1. + <_> + 12 8 1 2 3. + <_> + + <_> + 1 8 2 12 -1. + <_> + 1 8 1 6 2. + <_> + 2 14 1 6 2. + <_> + + <_> + 0 1 6 12 -1. + <_> + 2 1 2 12 3. + <_> + + <_> + 19 17 1 3 -1. + <_> + 19 18 1 1 3. + <_> + + <_> + 11 3 3 10 -1. + <_> + 12 3 1 10 3. + <_> + + <_> + 8 1 9 8 -1. + <_> + 11 1 3 8 3. + <_> + + <_> + 18 16 2 2 -1. + <_> + 18 16 1 1 2. + <_> + 19 17 1 1 2. + <_> + + <_> + 18 16 2 2 -1. + <_> + 18 16 1 1 2. + <_> + 19 17 1 1 2. + <_> + + <_> + 6 13 2 6 -1. + <_> + 6 15 2 2 3. + <_> + + <_> + 9 14 2 2 -1. + <_> + 9 15 2 1 2. + <_> + + <_> + 14 10 2 4 -1. + <_> + 14 10 1 2 2. + <_> + 15 12 1 2 2. + <_> + + <_> + 0 15 2 2 -1. + <_> + 0 15 1 1 2. + <_> + 1 16 1 1 2. + <_> + + <_> + 6 7 2 2 -1. + <_> + 6 7 1 1 2. + <_> + 7 8 1 1 2. + <_> + + <_> + 11 18 2 2 -1. + <_> + 11 18 1 1 2. + <_> + 12 19 1 1 2. + <_> + + <_> + 0 0 6 4 -1. + <_> + 0 0 3 2 2. + <_> + 3 2 3 2 2. + <_> + + <_> + 4 1 6 6 -1. + <_> + 6 1 2 6 3. + <_> + + <_> + 15 13 5 4 -1. + <_> + 15 15 5 2 2. + <_> + + <_> + 7 17 6 1 -1. + <_> + 9 17 2 1 3. + <_> + + <_> + 16 19 4 1 -1. + <_> + 18 19 2 1 2. + <_> + + <_> + 16 16 4 4 -1. + <_> + 18 16 2 4 2. + <_> + + <_> + 7 8 9 4 -1. + <_> + 10 8 3 4 3. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 1 2. + <_> + 17 19 1 1 2. + <_> + + <_> + 2 9 2 4 -1. + <_> + 2 9 1 2 2. + <_> + 3 11 1 2 2. + <_> + + <_> + 0 3 8 4 -1. + <_> + 0 3 4 2 2. + <_> + 4 5 4 2 2. + <_> + + <_> + 0 1 8 1 -1. + <_> + 4 1 4 1 2. + <_> + + <_> + 0 5 8 9 -1. + <_> + 4 5 4 9 2. + <_> + + <_> + 7 18 6 2 -1. + <_> + 9 18 2 2 3. + <_> + + <_> + 0 4 1 12 -1. + <_> + 0 8 1 4 3. + <_> + + <_> + 19 13 1 6 -1. + <_> + 19 15 1 2 3. + <_> + + <_> + 2 8 6 8 -1. + <_> + 4 8 2 8 3. + <_> + + <_> + 0 0 9 17 -1. + <_> + 3 0 3 17 3. + <_> + + <_> + 7 9 6 8 -1. + <_> + 9 9 2 8 3. + <_> + + <_> + 5 10 9 4 -1. + <_> + 8 10 3 4 3. + <_> + + <_> + 5 0 8 3 -1. + <_> + 5 1 8 1 3. + <_> + + <_> + 16 6 4 4 -1. + <_> + 16 6 2 2 2. + <_> + 18 8 2 2 2. + <_> + + <_> + 17 4 2 8 -1. + <_> + 17 4 1 4 2. + <_> + 18 8 1 4 2. + <_> + + <_> + 2 16 1 3 -1. + <_> + 2 17 1 1 3. + <_> + + <_> + 2 16 1 3 -1. + <_> + 2 17 1 1 3. + <_> + + <_> + 11 0 1 3 -1. + <_> + 11 1 1 1 3. + <_> + + <_> + 11 2 9 7 -1. + <_> + 14 2 3 7 3. + <_> + + <_> + 10 2 3 6 -1. + <_> + 11 2 1 6 3. + <_> + + <_> + 5 9 15 2 -1. + <_> + 5 10 15 1 2. + <_> + + <_> + 8 16 6 2 -1. + <_> + 8 17 6 1 2. + <_> + + <_> + 9 16 10 2 -1. + <_> + 9 16 5 1 2. + <_> + 14 17 5 1 2. + <_> + + <_> + 9 17 2 2 -1. + <_> + 9 17 1 1 2. + <_> + 10 18 1 1 2. + <_> + + <_> + 10 15 6 4 -1. + <_> + 10 15 3 2 2. + <_> + 13 17 3 2 2. + <_> + + <_> + 4 5 15 12 -1. + <_> + 9 5 5 12 3. + <_> + + <_> + 11 13 2 3 -1. + <_> + 11 14 2 1 3. + <_> + + <_> + 8 13 7 3 -1. + <_> + 8 14 7 1 3. + <_> + + <_> + 1 12 1 2 -1. + <_> + 1 13 1 1 2. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 1 2. + <_> + 17 19 1 1 2. + <_> + + <_> + 1 19 18 1 -1. + <_> + 7 19 6 1 3. + <_> + + <_> + 1 17 6 1 -1. + <_> + 4 17 3 1 2. + <_> + + <_> + 1 3 1 12 -1. + <_> + 1 9 1 6 2. + <_> + + <_> + 0 9 3 6 -1. + <_> + 0 11 3 2 3. + <_> + + <_> + 5 4 3 10 -1. + <_> + 6 4 1 10 3. + <_> + + <_> + 6 17 2 1 -1. + <_> + 7 17 1 1 2. + <_> + + <_> + 1 0 6 12 -1. + <_> + 3 0 2 12 3. + <_> + + <_> + 4 7 9 2 -1. + <_> + 7 7 3 2 3. + <_> + + <_> + 6 11 9 1 -1. + <_> + 9 11 3 1 3. + <_> + + <_> + 17 10 2 10 -1. + <_> + 17 15 2 5 2. + <_> + + <_> + 4 10 2 10 -1. + <_> + 4 10 1 5 2. + <_> + 5 15 1 5 2. + <_> + + <_> + 12 3 3 12 -1. + <_> + 13 3 1 12 3. + <_> + + <_> + 15 3 4 6 -1. + <_> + 15 3 2 3 2. + <_> + 17 6 2 3 2. + <_> + + <_> + 12 8 3 3 -1. + <_> + 13 8 1 3 3. + <_> + + <_> + 4 14 2 4 -1. + <_> + 4 16 2 2 2. + <_> + + <_> + 6 16 1 3 -1. + <_> + 6 17 1 1 3. + <_> + + <_> + 1 1 2 3 -1. + <_> + 2 1 1 3 2. + <_> + + <_> + 0 2 4 1 -1. + <_> + 2 2 2 1 2. + <_> + + <_> + 8 17 12 3 -1. + <_> + 12 17 4 3 3. + <_> + + <_> + 9 16 6 4 -1. + <_> + 11 16 2 4 3. + <_> + + <_> + 4 6 3 6 -1. + <_> + 4 9 3 3 2. + <_> + + <_> + 6 2 12 9 -1. + <_> + 6 5 12 3 3. + <_> + + <_> + 6 0 14 20 -1. + <_> + 6 0 7 10 2. + <_> + 13 10 7 10 2. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 19 8 1 3 -1. + <_> + 19 9 1 1 3. + <_> + + <_> + 13 4 1 2 -1. + <_> + 13 5 1 1 2. + <_> + + <_> + 0 4 4 2 -1. + <_> + 0 5 4 1 2. + <_> + + <_> + 19 5 1 6 -1. + <_> + 19 7 1 2 3. + <_> + + <_> + 16 0 2 1 -1. + <_> + 17 0 1 1 2. + <_> + + <_> + 13 1 1 3 -1. + <_> + 13 2 1 1 3. + <_> + + <_> + 17 17 1 3 -1. + <_> + 17 18 1 1 3. + <_> + + <_> + 5 4 8 8 -1. + <_> + 5 4 4 4 2. + <_> + 9 8 4 4 2. + <_> + + <_> + 1 2 2 2 -1. + <_> + 1 2 1 1 2. + <_> + 2 3 1 1 2. + <_> + + <_> + 0 0 8 6 -1. + <_> + 0 0 4 3 2. + <_> + 4 3 4 3 2. + <_> + + <_> + 6 3 4 2 -1. + <_> + 6 4 4 1 2. + <_> + + <_> + 1 0 3 3 -1. + <_> + 1 1 3 1 3. + <_> + + <_> + 6 1 7 2 -1. + <_> + 6 2 7 1 2. + <_> + + <_> + 2 6 12 6 -1. + <_> + 6 6 4 6 3. + <_> + + <_> + 1 16 9 2 -1. + <_> + 4 16 3 2 3. + <_> + + <_> + 7 15 6 4 -1. + <_> + 9 15 2 4 3. + <_> + + <_> + 6 15 12 1 -1. + <_> + 12 15 6 1 2. + <_> + + <_> + 17 17 1 3 -1. + <_> + 17 18 1 1 3. + <_> + + <_> + 17 15 2 2 -1. + <_> + 17 15 1 1 2. + <_> + 18 16 1 1 2. + <_> + + <_> + 3 13 3 3 -1. + <_> + 3 14 3 1 3. + <_> + + <_> + 10 17 1 3 -1. + <_> + 10 18 1 1 3. + <_> + + <_> + 4 0 14 8 -1. + <_> + 11 0 7 8 2. + <_> + + <_> + 2 0 12 2 -1. + <_> + 6 0 4 2 3. + <_> + + <_> + 2 0 4 3 -1. + <_> + 4 0 2 3 2. + <_> + + <_> + 13 1 1 2 -1. + <_> + 13 2 1 1 2. + <_> + + <_> + 7 5 3 6 -1. + <_> + 8 5 1 6 3. + <_> + + <_> + 18 2 2 2 -1. + <_> + 18 2 1 1 2. + <_> + 19 3 1 1 2. + <_> + + <_> + 15 1 2 14 -1. + <_> + 16 1 1 14 2. + <_> + + <_> + 15 6 2 2 -1. + <_> + 15 6 1 1 2. + <_> + 16 7 1 1 2. + <_> + + <_> + 3 1 6 3 -1. + <_> + 5 1 2 3 3. + <_> + + <_> + 7 16 2 2 -1. + <_> + 7 16 1 1 2. + <_> + 8 17 1 1 2. + <_> + + <_> + 5 17 2 2 -1. + <_> + 5 17 1 1 2. + <_> + 6 18 1 1 2. + <_> + + <_> + 9 10 6 10 -1. + <_> + 11 10 2 10 3. + <_> + + <_> + 10 17 6 3 -1. + <_> + 12 17 2 3 3. + <_> + + <_> + 14 5 2 10 -1. + <_> + 14 10 2 5 2. + <_> + + <_> + 11 12 6 2 -1. + <_> + 11 13 6 1 2. + <_> + + <_> + 8 1 1 3 -1. + <_> + 8 2 1 1 3. + <_> + + <_> + 12 15 2 2 -1. + <_> + 12 15 1 1 2. + <_> + 13 16 1 1 2. + <_> + + <_> + 6 8 6 4 -1. + <_> + 6 8 3 2 2. + <_> + 9 10 3 2 2. + <_> + + <_> + 7 5 3 5 -1. + <_> + 8 5 1 5 3. + <_> + + <_> + 0 5 7 3 -1. + <_> + 0 6 7 1 3. + <_> + + <_> + 7 9 6 6 -1. + <_> + 9 9 2 6 3. + <_> + + <_> + 5 7 8 8 -1. + <_> + 5 11 8 4 2. + <_> + + <_> + 4 9 2 6 -1. + <_> + 4 9 1 3 2. + <_> + 5 12 1 3 2. + <_> + + <_> + 10 11 6 1 -1. + <_> + 12 11 2 1 3. + <_> + + <_> + 13 6 6 11 -1. + <_> + 15 6 2 11 3. + <_> + + <_> + 8 17 2 2 -1. + <_> + 8 17 1 1 2. + <_> + 9 18 1 1 2. + <_> + + <_> + 4 12 12 1 -1. + <_> + 8 12 4 1 3. + <_> + + <_> + 11 17 3 2 -1. + <_> + 11 18 3 1 2. + <_> + + <_> + 8 17 6 1 -1. + <_> + 10 17 2 1 3. + <_> + + <_> + 4 1 14 6 -1. + <_> + 4 3 14 2 3. + <_> + + <_> + 14 2 2 12 -1. + <_> + 14 8 2 6 2. + <_> + + <_> + 12 13 3 2 -1. + <_> + 12 14 3 1 2. + <_> + + <_> + 6 1 6 1 -1. + <_> + 8 1 2 1 3. + <_> + + <_> + 10 6 6 1 -1. + <_> + 12 6 2 1 3. + <_> + + <_> + 3 19 2 1 -1. + <_> + 4 19 1 1 2. + <_> + + <_> + 18 16 2 2 -1. + <_> + 18 16 1 1 2. + <_> + 19 17 1 1 2. + <_> + + <_> + 16 11 3 7 -1. + <_> + 17 11 1 7 3. + <_> + + <_> + 19 5 1 6 -1. + <_> + 19 8 1 3 2. + <_> + + <_> + 9 8 4 3 -1. + <_> + 9 9 4 1 3. + <_> + + <_> + 16 8 4 4 -1. + <_> + 16 8 2 2 2. + <_> + 18 10 2 2 2. + <_> + + <_> + 2 8 2 2 -1. + <_> + 2 8 1 1 2. + <_> + 3 9 1 1 2. + <_> + + <_> + 3 5 6 4 -1. + <_> + 3 5 3 2 2. + <_> + 6 7 3 2 2. + <_> + + <_> + 2 3 8 16 -1. + <_> + 2 3 4 8 2. + <_> + 6 11 4 8 2. + <_> + + <_> + 17 17 1 3 -1. + <_> + 17 18 1 1 3. + <_> + + <_> + 7 2 8 11 -1. + <_> + 11 2 4 11 2. + <_> + + <_> + 13 3 6 14 -1. + <_> + 16 3 3 14 2. + <_> + + <_> + 0 9 18 2 -1. + <_> + 6 9 6 2 3. + <_> + + <_> + 6 10 14 3 -1. + <_> + 6 11 14 1 3. + <_> + + <_> + 10 9 9 3 -1. + <_> + 13 9 3 3 3. + <_> + + <_> + 3 5 4 6 -1. + <_> + 3 5 2 3 2. + <_> + 5 8 2 3 2. + <_> + + <_> + 3 7 3 7 -1. + <_> + 4 7 1 7 3. + <_> + + <_> + 2 8 11 6 -1. + <_> + 2 10 11 2 3. + <_> + + <_> + 8 9 6 3 -1. + <_> + 8 10 6 1 3. + <_> + + <_> + 3 3 3 11 -1. + <_> + 4 3 1 11 3. + <_> + + <_> + 0 19 6 1 -1. + <_> + 3 19 3 1 2. + <_> + + <_> + 18 18 1 2 -1. + <_> + 18 19 1 1 2. + <_> + + <_> + 8 0 12 6 -1. + <_> + 8 0 6 3 2. + <_> + 14 3 6 3 2. + <_> + + <_> + 19 5 1 3 -1. + <_> + 19 6 1 1 3. + <_> + + <_> + 5 8 2 1 -1. + <_> + 6 8 1 1 2. + <_> + + <_> + 13 11 2 1 -1. + <_> + 14 11 1 1 2. + <_> + + <_> + 3 6 15 13 -1. + <_> + 8 6 5 13 3. + <_> + + <_> + 4 3 6 2 -1. + <_> + 6 3 2 2 3. + <_> + + <_> + 0 18 1 2 -1. + <_> + 0 19 1 1 2. + <_> + + <_> + 7 8 2 6 -1. + <_> + 8 8 1 6 2. + <_> + + <_> + 3 0 6 19 -1. + <_> + 5 0 2 19 3. + <_> + + <_> + 3 1 6 5 -1. + <_> + 5 1 2 5 3. + <_> + + <_> + 17 14 3 6 -1. + <_> + 17 16 3 2 3. + <_> + + <_> + 17 13 2 6 -1. + <_> + 18 13 1 6 2. + <_> + + <_> + 17 18 2 2 -1. + <_> + 18 18 1 2 2. + <_> + + <_> + 11 14 9 4 -1. + <_> + 14 14 3 4 3. + <_> + + <_> + 15 8 4 6 -1. + <_> + 15 8 2 3 2. + <_> + 17 11 2 3 2. + <_> + + <_> + 1 16 1 3 -1. + <_> + 1 17 1 1 3. + <_> + + <_> + 7 0 3 14 -1. + <_> + 8 0 1 14 3. + <_> + + <_> + 12 0 2 1 -1. + <_> + 13 0 1 1 2. + <_> + + <_> + 7 9 6 5 -1. + <_> + 10 9 3 5 2. + <_> + + <_> + 15 5 4 9 -1. + <_> + 17 5 2 9 2. + <_> + + <_> + 11 0 6 6 -1. + <_> + 13 0 2 6 3. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 13 2 2 18 -1. + <_> + 13 11 2 9 2. + <_> + + <_> + 8 4 8 10 -1. + <_> + 8 9 8 5 2. + <_> + + <_> + 8 3 2 3 -1. + <_> + 8 4 2 1 3. + <_> + + <_> + 11 1 6 9 -1. + <_> + 11 4 6 3 3. + <_> + + <_> + 15 4 5 6 -1. + <_> + 15 6 5 2 3. + <_> + + <_> + 12 18 2 2 -1. + <_> + 12 18 1 1 2. + <_> + 13 19 1 1 2. + <_> + + <_> + 1 17 1 3 -1. + <_> + 1 18 1 1 3. + <_> + + <_> + 12 19 2 1 -1. + <_> + 13 19 1 1 2. + <_> + + <_> + 8 10 6 6 -1. + <_> + 10 10 2 6 3. + <_> + + <_> + 14 2 6 5 -1. + <_> + 16 2 2 5 3. + <_> + + <_> + 9 5 2 6 -1. + <_> + 9 7 2 2 3. + <_> + + <_> + 1 15 2 2 -1. + <_> + 2 15 1 2 2. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 10 14 4 6 -1. + <_> + 10 16 4 2 3. + <_> + + <_> + 9 7 3 2 -1. + <_> + 10 7 1 2 3. + <_> + + <_> + 6 9 6 2 -1. + <_> + 6 9 3 1 2. + <_> + 9 10 3 1 2. + <_> + + <_> + 0 2 1 12 -1. + <_> + 0 6 1 4 3. + <_> + + <_> + 4 0 15 1 -1. + <_> + 9 0 5 1 3. + <_> + + <_> + 9 0 8 2 -1. + <_> + 9 0 4 1 2. + <_> + 13 1 4 1 2. + <_> + + <_> + 12 2 8 1 -1. + <_> + 16 2 4 1 2. + <_> + + <_> + 7 1 10 6 -1. + <_> + 7 3 10 2 3. + <_> + + <_> + 18 6 2 3 -1. + <_> + 18 7 2 1 3. + <_> + + <_> + 4 12 2 2 -1. + <_> + 4 12 1 1 2. + <_> + 5 13 1 1 2. + <_> + + <_> + 6 6 6 2 -1. + <_> + 8 6 2 2 3. + <_> + + <_> + 0 9 9 6 -1. + <_> + 3 9 3 6 3. + <_> + + <_> + 17 18 2 2 -1. + <_> + 18 18 1 2 2. + <_> + + <_> + 11 2 6 16 -1. + <_> + 13 2 2 16 3. + <_> + + <_> + 2 4 15 13 -1. + <_> + 7 4 5 13 3. + <_> + + <_> + 16 2 3 10 -1. + <_> + 17 2 1 10 3. + <_> + + <_> + 6 10 2 1 -1. + <_> + 7 10 1 1 2. + <_> + + <_> + 1 1 18 16 -1. + <_> + 10 1 9 16 2. + <_> + + <_> + 14 4 3 15 -1. + <_> + 15 4 1 15 3. + <_> + + <_> + 19 13 1 2 -1. + <_> + 19 14 1 1 2. + <_> + + <_> + 2 6 5 8 -1. + <_> + 2 10 5 4 2. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_eye_tree_eyeglasses.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_eye_tree_eyeglasses.xml new file mode 100644 index 0000000000000000000000000000000000000000..6813d243c77e5c1819a680a60595ae4b4b635272 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_eye_tree_eyeglasses.xml @@ -0,0 +1,22619 @@ + + + +BOOST + HAAR + 20 + 20 + + 47 + + 0 + 30 + + <_> + 5 + -1.6473180055618286e+00 + + <_> + + 2 1 0 -2.6987109333276749e-02 0 -1 1 5.0670530647039413e-02 + -2 -3 2 -1.2915390729904175e-01 + + -8.0395472049713135e-01 6.0491400957107544e-01 + 9.0544581413269043e-01 4.4070810079574585e-02 + <_> + + 2 1 3 8.8827736675739288e-02 0 -1 4 -2.0398240536451340e-02 + -2 -3 5 -6.1261758208274841e-02 + + 7.9218882322311401e-01 4.0692299604415894e-02 + 4.2585361003875732e-01 -7.0325207710266113e-01 + <_> + + 2 1 6 -2.0490810275077820e-01 0 -1 7 9.4933047890663147e-02 + -2 -3 8 1.2091030366718769e-03 + + -4.4017648696899414e-01 5.3640520572662354e-01 + 6.8776458501815796e-01 -5.5879348516464233e-01 + <_> + + 1 0 9 9.2227972345426679e-04 -1 2 10 -7.2678289143368602e-04 + -2 -3 11 6.8421510513871908e-04 + + -7.2684401273727417e-01 -5.8028000593185425e-01 + 5.6177532672882080e-01 -2.9834181070327759e-01 + <_> + + 0 1 12 -5.1150590181350708e-02 2 -1 13 + 6.1622060835361481e-02 -2 -3 14 7.2873473167419434e-02 + + 5.9840762615203857e-01 7.4743932485580444e-01 + -4.9703779816627502e-01 2.8129258751869202e-01 + <_> + 7 + -1.4257860183715820e+00 + + <_> + + 2 1 15 -4.1994878649711609e-01 0 -1 16 + -5.6186288595199585e-02 -2 -3 17 -2.3711109533905983e-02 + + 2.7586200833320618e-01 -6.4623218774795532e-01 + 8.5241252183914185e-01 8.3703370764851570e-03 + <_> + + 1 0 18 4.0523439645767212e-02 -1 2 19 2.7388900518417358e-01 + -2 -3 20 -1.4293800108134747e-02 + + 7.4270218610763550e-01 -4.9286690354347229e-01 + 7.1784788370132446e-01 -4.2223978787660599e-02 + <_> + + 0 1 21 -2.1144729107618332e-03 2 -1 22 + 1.0659949621185660e-03 -2 -3 23 1.0812469990924001e-03 + + -8.0196601152420044e-01 -6.6025912761688232e-01 + 4.7916370630264282e-01 -5.1645290851593018e-01 + <_> + + 1 0 24 3.0198289081454277e-02 2 -1 25 4.0569551289081573e-02 + -2 -3 26 7.0679739117622375e-02 + + 5.1327562332153320e-01 6.6641497611999512e-01 + -4.5298659801483154e-01 5.5480718612670898e-01 + <_> + + 0 1 27 -7.8928138827905059e-04 2 -1 28 + 8.0574717139825225e-04 -2 -3 29 -2.0976560190320015e-02 + + -7.2526299953460693e-01 -5.6479871273040771e-01 + 6.9993537664413452e-01 6.8500466644763947e-02 + <_> + + 1 0 30 1.2794960290193558e-02 -1 2 31 + -8.1120636314153671e-03 -2 -3 32 -1.5506530180573463e-02 + + -8.6409568786621094e-01 4.4448360800743103e-01 + 3.6675310134887695e-01 -2.9189071059226990e-01 + <_> + + 2 1 33 -1.2915650382637978e-02 0 -1 34 + 6.6297221928834915e-03 -2 -3 35 -3.6532930098474026e-03 + + -4.7566780447959900e-01 1.0350350290536880e-01 + -6.1723059415817261e-01 5.4382532835006714e-01 + <_> + 9 + -1.4711019992828369e+00 + + <_> + + 0 1 36 -7.8731971979141235e-01 -1 2 37 + 1.6908009350299835e-01 -2 -3 38 -4.0369689464569092e-02 + + 7.1268838644027710e-01 -7.1908998489379883e-01 + 4.4148930907249451e-01 -4.2251929640769958e-01 + <_> + + 1 0 39 1.9132360816001892e-02 2 -1 40 6.4184539951384068e-04 + -2 -3 41 -7.8941037645563483e-04 + + 6.9186228513717651e-01 -7.6116967201232910e-01 + -6.8140429258346558e-01 1.6009919345378876e-01 + <_> + + 1 2 42 -7.1503049694001675e-03 0 -1 43 + -2.3156129755079746e-03 -2 -3 44 -4.1521269828081131e-02 + + -5.5916607379913330e-01 5.1284497976303101e-01 + 2.4422569572925568e-01 -4.6883401274681091e-01 + <_> + + 1 0 45 9.1200548922643065e-04 -1 2 46 + -1.5798299573361874e-03 -2 -3 47 -1.1573649942874908e-02 + + -6.9527888298034668e-01 -6.3509649038314819e-01 + 6.4686381816864014e-01 6.9198559504002333e-04 + <_> + + 2 1 48 2.1843519061803818e-03 0 -1 49 2.9345690272748470e-03 + -2 -3 50 -5.8788150548934937e-02 + + 4.5632898807525635e-01 -5.8841437101364136e-01 + 2.6704201102256775e-01 -3.8348990678787231e-01 + <_> + + 0 1 51 -5.5392808280885220e-04 -1 2 52 + -5.3035060409456491e-04 -2 -3 53 -6.8775108084082603e-03 + + -4.8913368582725525e-01 -3.8421550393104553e-01 + 6.6845697164535522e-01 9.3158259987831116e-02 + <_> + + 1 0 54 1.6710379859432578e-03 2 -1 55 1.4162790030241013e-03 + -2 -3 56 7.7876187860965729e-03 + + -6.0369372367858887e-01 -3.0418768525123596e-01 + 3.9699068665504456e-01 -6.6687589883804321e-01 + <_> + + 1 2 57 -1.2916780076920986e-02 0 -1 58 + -3.0156269203871489e-03 -2 -3 59 -1.9785940647125244e-02 + + -7.1239727735519409e-01 4.6252989768981934e-01 + 2.8338319063186646e-01 -3.5317930579185486e-01 + <_> + + 1 0 60 3.3207770902663469e-03 2 -1 61 2.9606239870190620e-02 + -2 -3 62 4.4614788144826889e-02 + + -7.3291397094726562e-01 4.9530759453773499e-01 + -1.9502809643745422e-01 7.9816418886184692e-01 + <_> + 12 + -1.3850779533386230e+00 + + <_> + + 0 1 63 -9.2366141080856323e-01 2 -1 64 + -4.8193939030170441e-02 -2 -3 65 2.8669878840446472e-01 + + 7.6915800571441650e-01 -5.1361227035522461e-01 + -2.9671901464462280e-01 6.2028187513351440e-01 + <_> + + 1 2 66 -1.3038160279393196e-02 0 -1 67 + -1.4749659458175302e-03 -2 -3 68 -4.6921748667955399e-02 + + -7.1294248104095459e-01 5.9115177392959595e-01 + 3.1303560733795166e-01 -3.6749690771102905e-01 + <_> + + 0 1 69 2.4459899868816137e-03 -1 2 70 + -2.5321498978883028e-03 -2 -3 71 1.4651260571554303e-03 + + -4.6930000185966492e-01 -7.7450162172317505e-01 + 3.6414781212806702e-01 -5.7445889711380005e-01 + <_> + + 1 2 72 -1.1307420209050179e-02 0 -1 73 + -1.2048849603161216e-03 -2 -3 74 -6.2752872705459595e-02 + + -5.5727648735046387e-01 4.7871670126914978e-01 + 2.2788530588150024e-01 -4.3667969107627869e-01 + <_> + + 0 1 75 -4.0173111483454704e-03 2 -1 76 + 1.5160309849306941e-03 -2 -3 77 1.9954680465161800e-03 + + -7.3568779230117798e-01 -5.8480697870254517e-01 + 2.1544020622968674e-02 5.5875688791275024e-01 + <_> + + 1 0 78 3.4435209818184376e-03 -1 2 79 + -2.6550020556896925e-03 -2 -3 80 -1.1407690122723579e-02 + + -7.6565897464752197e-01 -6.5447497367858887e-01 + 5.3633081912994385e-01 -3.8849171251058578e-02 + <_> + + 1 2 81 -2.3805440869182348e-03 0 -1 82 + 6.6475258208811283e-03 -2 -3 83 1.4018240571022034e-01 + + 3.3984410762786865e-01 -6.5025091171264648e-01 + -3.2491090893745422e-01 7.5067067146301270e-01 + <_> + + 0 1 84 -6.2358360737562180e-02 2 -1 85 + 1.3628599699586630e-03 -2 -3 86 -4.4609848409891129e-03 + + 4.5777168869972229e-01 -6.3202661275863647e-01 + 4.0597960352897644e-01 -2.0854069292545319e-01 + <_> + + 0 1 87 -1.0046839714050293e-02 2 -1 88 + -2.9274819418787956e-02 -2 -3 89 7.7389390207827091e-03 + + -7.4789828062057495e-01 -1.7995479702949524e-01 + 4.7782841324806213e-01 -6.5113341808319092e-01 + <_> + + 1 0 90 1.4774020528420806e-03 -1 2 91 1.4989820308983326e-02 + -2 -3 92 4.5073241926729679e-03 + + -6.6269898414611816e-01 -1.6695550084114075e-01 + 3.8702058792114258e-01 -7.3409372568130493e-01 + <_> + + 1 0 93 1.4901049435138702e-03 2 -1 94 8.9141662465408444e-04 + -2 -3 95 -1.1558219790458679e-02 + + -3.4280839562416077e-01 -2.8036740422248840e-01 + -4.2523959279060364e-01 4.5259669423103333e-01 + <_> + + 0 1 96 -2.0011950284242630e-02 -1 2 97 + -1.7092300578951836e-02 -2 -3 98 -6.7685171961784363e-02 + + 4.0133118629455566e-01 3.6970010399818420e-01 + 7.4438679218292236e-01 -3.8255840539932251e-01 + <_> + 12 + -1.4432040452957153e+00 + + <_> + + 1 2 99 -2.0911149680614471e-02 0 -1 100 + 1.4305709302425385e-01 -2 -3 101 1.1925029568374157e-02 + + -3.4965568780899048e-01 7.0134562253952026e-01 + -6.0404628515243530e-01 8.5615903139114380e-02 + <_> + + 1 0 102 2.4742009118199348e-02 2 -1 103 + 4.5732118189334869e-02 -2 -3 104 4.3204430490732193e-02 + + 8.5365587472915649e-01 4.1876411437988281e-01 + -3.9094918966293335e-01 2.7387988567352295e-01 + <_> + + 0 1 105 -7.2548422031104565e-04 2 -1 106 + 1.4243220211938024e-03 -2 -3 107 -5.3335479460656643e-03 + + -6.2011122703552246e-01 -6.1589437723159790e-01 + 6.0596448183059692e-01 1.5840480104088783e-02 + <_> + + 1 0 108 -7.1891010738909245e-03 2 -1 109 + 1.8233320442959666e-03 -2 -3 110 1.6109029529616237e-03 + + -2.0852829515933990e-01 -8.1338381767272949e-01 + 5.6780648231506348e-01 -8.7046259641647339e-01 + <_> + + 2 1 111 -4.8350278288125992e-02 0 -1 112 + 3.1746171414852142e-02 -2 -3 113 1.9233829807490110e-03 + + -3.5335820913314819e-01 4.4076570868492126e-01 + 4.0730631351470947e-01 -5.9592568874359131e-01 + <_> + + 1 0 114 1.3614529743790627e-03 -1 2 115 + -3.6934199742972851e-03 -2 -3 116 -8.5378461517393589e-04 + + -5.5307251214981079e-01 -7.3163098096847534e-01 + 4.3890678882598877e-01 -6.3009172677993774e-02 + <_> + + 0 1 117 -1.0950770229101181e-02 -1 2 118 + -7.2186449542641640e-03 -2 -3 119 1.8548289313912392e-02 + + 3.9263078570365906e-01 2.7225250005722046e-01 + -4.1208618879318237e-01 6.3790637254714966e-01 + <_> + + 1 0 120 1.0859060566872358e-03 -1 2 121 + -6.5618362277746201e-03 -2 -3 122 -6.1777420341968536e-02 + + -5.0857210159301758e-01 3.5386729240417480e-01 + 5.7568281888961792e-01 -2.8477248549461365e-01 + <_> + + 1 0 123 4.9480778397992253e-04 2 -1 124 + 1.1606880463659763e-02 -2 -3 125 -1.6142609529197216e-03 + + -4.9583891034126282e-01 -5.1320201158523560e-01 + 5.2665728330612183e-01 3.0917160212993622e-02 + <_> + + 1 0 126 2.0437680650502443e-03 -1 2 127 + -8.2394909113645554e-03 -2 -3 128 -3.9699211716651917e-02 + + -7.0948588848114014e-01 3.4189811348915100e-01 + 4.7383341193199158e-01 -2.5060850381851196e-01 + <_> + + 1 2 129 -8.0377282574772835e-04 0 -1 130 + -5.4273242130875587e-03 -2 -3 131 -5.2662738598883152e-03 + + -5.1384007930755615e-01 2.9752710461616516e-01 + 1.4577029645442963e-01 -4.6007528901100159e-01 + <_> + + 1 0 132 6.3841522205621004e-04 -1 2 133 + -1.5458120033144951e-03 -2 -3 134 1.1863360414281487e-03 + + -3.6412829160690308e-01 -5.8081609010696411e-01 + 2.9298609495162964e-01 -5.1420718431472778e-01 + <_> + 12 + -1.5415630340576172e+00 + + <_> + + 1 2 135 -2.7745011448860168e-01 0 -1 136 + -3.1200000084936619e-03 -2 -3 137 -8.0280922353267670e-02 + + 8.3265638351440430e-01 1.0233189910650253e-01 + 2.3773579299449921e-01 -6.4546662569046021e-01 + <_> + + 0 1 138 -6.9391548633575439e-02 2 -1 139 + 5.3355181589722633e-03 -2 -3 140 -5.4189618676900864e-02 + + 4.6008241176605225e-01 2.9137989878654480e-01 + 4.7026729583740234e-01 -5.7723402976989746e-01 + <_> + + 1 0 141 1.8562959507107735e-02 -1 2 142 + 4.6305730938911438e-02 -2 -3 143 -8.8262781500816345e-03 + + 7.0555502176284790e-01 -5.2839881181716919e-01 + 4.3953609466552734e-01 -1.3887490332126617e-01 + <_> + + 1 0 144 -2.8772179502993822e-03 -1 2 145 + -2.6457069907337427e-03 -2 -3 146 3.3441530540585518e-03 + + -2.7475830912590027e-01 -5.7746797800064087e-01 + 3.6615240573883057e-01 -6.3586741685867310e-01 + <_> + + 2 1 147 -8.3742372691631317e-02 0 -1 148 + 1.0164769738912582e-01 -2 -3 149 -2.1541758906096220e-03 + + -2.9664519429206848e-01 5.6140047311782837e-01 + -7.5446271896362305e-01 3.9601260423660278e-01 + <_> + + 0 1 150 -1.7133549554273486e-03 2 -1 151 + 1.3899410143494606e-02 -2 -3 152 -2.8498120605945587e-02 + + -7.3741632699966431e-01 4.8247390985488892e-01 + 4.1971048712730408e-01 -2.0021289587020874e-01 + <_> + + 0 1 153 -4.9728769809007645e-03 2 -1 154 + -3.4751880913972855e-02 -2 -3 155 -8.7171117775142193e-04 + + 3.7631350755691528e-01 -4.4797790050506592e-01 + -6.9995099306106567e-01 1.5640909969806671e-01 + <_> + + 0 1 156 -3.3666230738162994e-03 -1 2 157 + -2.1378830075263977e-02 -2 -3 158 -1.1869249865412712e-02 + + -6.7721921205520630e-01 3.3951529860496521e-01 + 5.4050672054290771e-01 -2.4071580171585083e-01 + <_> + + 0 1 159 -4.4268160127103329e-03 2 -1 160 + 4.1405398398637772e-02 -2 -3 161 -3.7884410470724106e-02 + + -7.3965507745742798e-01 8.2905638217926025e-01 + 1.7030739784240723e-01 -2.4498699605464935e-01 + <_> + + 1 0 162 3.7567419349215925e-04 -1 2 163 + -3.7140299100428820e-03 -2 -3 164 -6.1806719750165939e-03 + + -4.5103698968887329e-01 3.8348129391670227e-01 + 3.6097520589828491e-01 -2.0644439756870270e-01 + <_> + + 0 1 165 -1.2373559875413775e-03 -1 2 166 + -2.1339580416679382e-03 -2 -3 167 2.8985869139432907e-03 + + -5.8166879415512085e-01 4.1669690608978271e-01 + -2.4721260368824005e-01 3.5056841373443604e-01 + <_> + + 1 2 168 -4.4636861421167850e-03 0 -1 169 + 1.6411510296165943e-03 -2 -3 170 -7.3051019571721554e-03 + + 3.5625410079956055e-01 -4.1040098667144775e-01 + 2.0216129720211029e-01 -3.4234520792961121e-01 + <_> + 13 + -1.4762729406356812e+00 + + <_> + + 1 2 171 -5.1942609250545502e-02 0 -1 172 + -4.7268528491258621e-02 -2 -3 173 -7.8969672322273254e-03 + + 8.8198930025100708e-01 6.4829237759113312e-02 + 8.8662758469581604e-02 -5.9007811546325684e-01 + <_> + + 1 0 174 9.0199249098077416e-04 2 -1 175 + -1.7289820313453674e-01 -2 -3 176 -2.3374119773507118e-03 + + 5.9040898084640503e-01 -5.2029031515121460e-01 + 5.2981728315353394e-01 -1.4985850453376770e-01 + <_> + + 0 1 177 -1.7534950748085976e-02 -1 2 178 + 5.8875310060102493e-05 -2 -3 179 -3.2241028547286987e-01 + + 5.3269028663635254e-01 -4.5709720253944397e-01 + 5.7380169630050659e-01 -1.2866480648517609e-01 + <_> + + 1 2 180 8.3220787928439677e-05 0 -1 181 + -1.1180160072399303e-04 -2 -3 182 -1.0344980284571648e-02 + + 9.0006209909915924e-02 -5.6352388858795166e-01 + 6.3273417949676514e-01 5.0064269453287125e-02 + <_> + + 0 1 183 -9.4440882094204426e-04 2 -1 184 + -3.7474210839718580e-03 -2 -3 185 4.0574651211500168e-03 + + 4.4386640191078186e-01 -3.4999918937683105e-01 + -4.5298218727111816e-01 3.0920198559761047e-01 + <_> + + 1 2 186 5.5205920943990350e-05 0 -1 187 + -7.5678288936614990e-02 -2 -3 188 -3.0975368618965149e-01 + + 3.5544091463088989e-01 -3.6047360301017761e-01 + -6.4954018592834473e-01 3.0679279565811157e-01 + <_> + + 1 2 189 -7.9595847637392581e-05 0 -1 190 + 4.0613119490444660e-03 -2 -3 191 4.3240871280431747e-02 + + 3.3850470185279846e-01 -5.3271901607513428e-01 + -3.2592329382896423e-01 5.5076271295547485e-01 + <_> + + 0 1 192 -6.7015928216278553e-03 -1 2 193 + -1.0451120324432850e-03 -2 -3 194 8.3967261016368866e-03 + + 5.0109171867370605e-01 -5.8881980180740356e-01 + -9.5237597823143005e-02 5.6516999006271362e-01 + <_> + + 2 1 195 -6.5531006839592010e-05 0 -1 196 + 7.8218057751655579e-05 -2 -3 197 3.2988168299198151e-02 + + -4.6556711196899414e-01 5.4509781301021576e-02 + 3.5248789191246033e-01 -5.2722948789596558e-01 + <_> + + 0 1 198 -1.4161449857056141e-02 2 -1 199 + 3.1500440090894699e-02 -2 -3 200 -2.1956730633974075e-03 + + 3.6811780929565430e-01 5.2040421962738037e-01 + 1.1603529751300812e-01 -3.0985280871391296e-01 + <_> + + 0 1 201 -4.0099889039993286e-02 -1 2 202 + -3.2569639384746552e-02 -2 -3 203 -4.2014168575406075e-03 + + -4.5146378874778748e-01 -6.4392048120498657e-01 + -8.2594501972198486e-01 1.9259540736675262e-01 + <_> + + 2 1 204 2.0385689567774534e-03 0 -1 205 + -1.6212540213018656e-03 -2 -3 206 -8.6220083758234978e-03 + + -3.7723371386528015e-01 3.3918830752372742e-01 + 4.8986920714378357e-01 -2.7532070875167847e-01 + <_> + + 1 0 207 9.2185800895094872e-05 2 -1 208 + -7.1932889113668352e-05 -2 -3 209 4.4952900498174131e-04 + + 2.4223749339580536e-01 -4.2189198732376099e-01 + 2.9407840967178345e-01 -4.4028049707412720e-01 + <_> + 15 + -1.4963719844818115e+00 + + <_> + + 1 2 210 -1.9638450816273689e-02 0 -1 211 + 1.1364299803972244e-01 -2 -3 212 -1.0112149640917778e-02 + + -3.2444450259208679e-01 7.4602019786834717e-01 + 3.3333331346511841e-01 -5.6435650587081909e-01 + <_> + + 1 0 213 1.2130879797041416e-02 2 -1 214 + -1.5958850085735321e-01 -2 -3 215 -2.3524949792772532e-03 + + 7.2214919328689575e-01 -3.9274591207504272e-01 + 5.6152492761611938e-01 -1.3768480718135834e-01 + <_> + + 0 1 216 -4.1118920780718327e-03 -1 2 217 + -1.7832900583744049e-01 -2 -3 218 -7.8500732779502869e-03 + + 6.3556081056594849e-01 3.3373141288757324e-01 + 3.9536771178245544e-01 -3.3380430936813354e-01 + <_> + + 2 1 219 -4.6880490117473528e-05 0 -1 220 + 5.2934719860786572e-05 -2 -3 221 2.0851430235779844e-05 + + -6.6118270158767700e-01 -4.8232190310955048e-02 + -9.8838359117507935e-02 4.4528418779373169e-01 + <_> + + 0 1 222 -1.8425289541482925e-02 -1 2 223 + -7.6133902184665203e-03 -2 -3 224 -6.0353721491992474e-03 + + -6.5690898895263672e-01 5.3413677215576172e-01 + 3.6171048879623413e-01 -2.0478430390357971e-01 + <_> + + 2 1 225 4.3712720071198419e-05 0 -1 226 + -7.8823999501764774e-04 -2 -3 227 -4.5693209394812584e-03 + + -4.5326828956604004e-01 3.5517698526382446e-01 + 6.1721032857894897e-01 -2.9707700014114380e-01 + <_> + + 1 2 228 -3.8058571517467499e-02 0 -1 229 + -1.1797689646482468e-01 -2 -3 230 4.6841651201248169e-03 + + 3.5003998875617981e-01 -2.7257668972015381e-01 + -3.2559171319007874e-01 3.7737470865249634e-01 + <_> + + 1 2 231 -2.6372840511612594e-04 0 -1 232 + 6.2580420635640621e-03 -2 -3 233 5.6767999922158197e-05 + + 3.7421739101409912e-01 -5.8926701545715332e-01 + -4.8859021067619324e-01 -1.8623730167746544e-02 + <_> + + 1 0 234 9.2742107808589935e-03 2 -1 235 + -3.8514519110321999e-03 -2 -3 236 -5.3287498303689063e-05 + + 3.0933541059494019e-01 -3.4513729810714722e-01 + 5.2340328693389893e-01 -9.1159403324127197e-02 + <_> + + 1 0 237 9.8315975628793240e-04 2 -1 238 + 8.2858657697215676e-04 -2 -3 239 1.1229789815843105e-02 + + -5.0185352563858032e-01 -3.0529549717903137e-01 + 2.6219210028648376e-01 -4.7969821095466614e-01 + <_> + + 0 1 240 -1.0327639989554882e-02 -1 2 241 + -6.9197742268443108e-03 -2 -3 242 -5.0027170218527317e-03 + + -5.6315082311630249e-01 3.1225070357322693e-01 + 1.7820779979228973e-01 -3.0091148614883423e-01 + <_> + + 0 1 243 -1.1156810069223866e-04 -1 2 244 + 4.2464961297810078e-03 -2 -3 245 -4.7280951548600569e-05 + + 1.8883679807186127e-01 -4.0101578831672668e-01 + 4.6505901217460632e-01 -2.9863640666007996e-01 + <_> + + 0 1 246 -1.8891280051320791e-03 -1 2 247 + -5.8536308642942458e-05 -2 -3 248 2.0671950551331975e-05 + + 5.6963747739791870e-01 1.8008249998092651e-01 + -5.8659601211547852e-01 -5.4875258356332779e-03 + <_> + + 0 1 249 -1.1267509544268250e-03 2 -1 250 + 2.1378440782427788e-02 -2 -3 251 -1.2546040117740631e-02 + + -4.0261599421501160e-01 3.9230358600616455e-01 + 4.9474561214447021e-01 -1.7322529852390289e-01 + <_> + + 0 1 252 -7.2257901774719357e-04 2 -1 253 + 6.4563672058284283e-03 -2 -3 254 4.9086650833487511e-03 + + -3.0380329489707947e-01 4.7173491120338440e-01 + -1.6380549967288971e-01 3.7708491086959839e-01 + <_> + 19 + -1.5243699550628662e+00 + + <_> + + 2 1 255 -7.2617560625076294e-02 0 -1 256 + -6.9059380330145359e-03 -2 -3 257 2.1727949380874634e-01 + + 2.6602798700332642e-01 -4.9325171113014221e-01 + -1.0769230127334595e-01 8.2661122083663940e-01 + <_> + + 1 2 258 -2.0319509785622358e-03 0 -1 259 + 2.8931589797139168e-02 -2 -3 260 -4.6076569706201553e-03 + + -3.7963140755891800e-02 8.0230438709259033e-01 + 4.2468398809432983e-01 -2.9379379749298096e-01 + <_> + + 1 2 261 6.9408868439495564e-03 0 -1 262 + -5.9231962077319622e-03 -2 -3 263 5.1128160208463669e-02 + + 4.1737049818038940e-01 -2.5552588701248169e-01 + -3.8619861006736755e-01 4.7076860070228577e-01 + <_> + + 1 0 264 1.5201330184936523e-02 -1 2 265 + -1.8096340820193291e-02 -2 -3 266 7.9378951340913773e-05 + + 5.4354798793792725e-01 2.6651141047477722e-01 + -4.3927749991416931e-01 2.5831260718405247e-03 + <_> + + 0 1 267 -5.3462558425962925e-03 -1 2 268 + -6.9701080210506916e-03 -2 -3 269 8.4738981968257576e-05 + + -6.6308969259262085e-01 -7.0310682058334351e-01 + -1.7880809307098389e-01 2.5993299484252930e-01 + <_> + + 0 1 270 -2.8513800352811813e-03 2 -1 271 + 2.2954840678721666e-03 -2 -3 272 -3.5036220215260983e-03 + + 4.5053678750991821e-01 3.0560511350631714e-01 + 1.5040870010852814e-01 -3.3283078670501709e-01 + <_> + + 1 2 273 -6.9570228457450867e-02 0 -1 274 + 5.9261121350573376e-05 -2 -3 275 -5.9058349579572678e-02 + + -3.6899719387292862e-02 4.0927308797836304e-01 + 1.3826370239257812e-01 -3.8214409351348877e-01 + <_> + + 0 1 276 -8.9645627886056900e-03 -1 2 277 + 4.9211819714400917e-05 -2 -3 278 9.9640293046832085e-03 + + -5.8134728670120239e-01 -1.8481740355491638e-01 + 8.7685473263263702e-02 5.8509802818298340e-01 + <_> + + 0 1 279 -1.9302699714899063e-02 -1 2 280 + -4.3869198998436332e-04 -2 -3 281 6.5669846662785858e-05 + + 5.3263461589813232e-01 2.8891131281852722e-01 + -3.3493599295616150e-01 5.9566751122474670e-02 + <_> + + 0 1 282 -2.0224519073963165e-02 -1 2 283 + 8.7082196841947734e-05 -2 -3 284 -1.6202719882130623e-02 + + -6.5536081790924072e-01 -1.2211789935827255e-01 + -4.7076839208602905e-01 3.0990770459175110e-01 + <_> + + 1 0 285 4.4353529810905457e-03 -1 2 286 + -9.0544822160154581e-04 -2 -3 287 -1.4297979651018977e-03 + + -5.4039931297302246e-01 4.2878800630569458e-01 + 2.2322739660739899e-01 -1.8194420635700226e-01 + <_> + + 1 2 288 3.2359519973397255e-03 0 -1 289 + 1.0716189717641100e-04 -2 -3 290 -5.8802281273528934e-04 + + -2.9218220710754395e-01 1.3910460472106934e-01 + -4.6926081180572510e-01 3.8085499405860901e-01 + <_> + + 0 1 291 -9.0546347200870514e-03 -1 2 292 + -8.6048766970634460e-03 -2 -3 293 -1.2719300575554371e-03 + + -5.0426542758941650e-01 -2.7559030055999756e-01 + 3.6022108793258667e-01 -2.6484970003366470e-02 + <_> + + 0 1 294 -3.9098240085877478e-04 -1 2 295 + -3.6405251012183726e-04 -2 -3 296 -6.6685711499303579e-04 + + 2.6651731133460999e-01 1.4721649885177612e-01 + -4.9719738960266113e-01 -6.1579849570989609e-02 + <_> + + 0 1 297 -2.4845570325851440e-02 -1 2 298 + -1.5436399728059769e-02 -2 -3 299 -5.6572312116622925e-01 + + -7.0820981264114380e-01 -4.7206890583038330e-01 + 6.3965231180191040e-01 5.2069328725337982e-02 + <_> + + 0 1 300 -5.7480141520500183e-02 -1 2 301 + -1.4613820239901543e-02 -2 -3 302 -3.3993738889694214e-01 + + 2.9297390580177307e-01 6.0129672288894653e-01 + 1.9041299819946289e-02 -3.3254599571228027e-01 + <_> + + 2 1 303 -3.1427140347659588e-03 0 -1 304 + 2.1966299973428249e-03 -2 -3 305 -2.4858590215444565e-02 + + -2.2972729802131653e-01 2.2367340326309204e-01 + -5.6212967634201050e-01 3.9542859792709351e-01 + <_> + + 0 1 306 -1.6135630430653691e-03 2 -1 307 + 1.1416019697207958e-04 -2 -3 308 1.3170539750717580e-04 + + -4.8256790637969971e-01 2.6877319812774658e-01 + -3.9078921079635620e-01 1.7153440415859222e-01 + <_> + + 0 1 309 -8.5256207967177033e-05 -1 2 310 + 6.4925159676931798e-05 -2 -3 311 -1.2689639814198017e-02 + + 2.1754570305347443e-01 -4.7468620538711548e-01 + -6.6538578271865845e-01 1.2347090244293213e-01 + <_> + 27 + -1.3592849969863892e+00 + + <_> + + 2 1 312 -2.9844639822840691e-02 0 -1 313 + -4.5487660169601440e-01 -2 -3 314 2.7445149607956409e-03 + + 3.9222040772438049e-01 -3.9314880967140198e-01 + -1.5923570096492767e-01 8.2696700096130371e-01 + <_> + + 2 1 315 -1.0584670118987560e-02 0 -1 316 + -1.6308380290865898e-02 -2 -3 317 -4.8787441104650497e-02 + + 4.5954689383506775e-01 -2.1620120108127594e-01 + 7.5103652477264404e-01 7.4557967483997345e-02 + <_> + + 1 0 318 -2.9621229041367769e-03 2 -1 319 + 1.7300529405474663e-02 -2 -3 320 -1.6731169074773788e-02 + + -2.4452270567417145e-01 -3.3090409636497498e-01 + 5.3751850128173828e-01 2.9153820127248764e-02 + <_> + + 1 0 321 1.2326180003583431e-02 -1 2 322 + 5.4928299039602280e-02 -2 -3 323 2.7763319667428732e-03 + + -5.4824811220169067e-01 -2.1952770650386810e-01 + 3.6463689059019089e-02 5.0633782148361206e-01 + <_> + + 0 1 324 -4.5116998255252838e-02 2 -1 325 + 1.1207940056920052e-02 -2 -3 326 -5.7006389833986759e-03 + + 4.2339310050010681e-01 3.9984008669853210e-01 + -5.9729182720184326e-01 -9.8557651042938232e-02 + <_> + + 1 2 327 -5.3951311856508255e-03 0 -1 328 + 7.8587066382169724e-03 -2 -3 329 1.0666639544069767e-02 + + 3.4734690189361572e-01 -4.7281920909881592e-01 + -2.3315669596195221e-01 2.4360010027885437e-01 + <_> + + 2 1 330 2.8001810424029827e-03 0 -1 331 + -7.9198479652404785e-03 -2 -3 332 -2.3832279257476330e-03 + + -4.8354551196098328e-01 1.8321120738983154e-01 + 3.2168481498956680e-02 -5.0476258993148804e-01 + <_> + + 0 1 333 -9.7674019634723663e-03 -1 2 334 + -1.3897259719669819e-02 -2 -3 335 -6.4803068526089191e-03 + + -7.4415212869644165e-01 4.5425128936767578e-01 + 4.8292869329452515e-01 -1.0258570313453674e-01 + <_> + + 1 0 336 9.4482619315385818e-03 -1 2 337 + -7.0351187605410814e-04 -2 -3 338 -4.2770579457283020e-03 + + -5.3326022624969482e-01 2.9435831308364868e-01 + 1.5501999855041504e-01 -3.0867969989776611e-01 + <_> + + 1 0 339 5.8752358891069889e-03 2 -1 340 + 9.5629561692476273e-03 -2 -3 341 -6.8425266363192350e-05 + + -6.0491317510604858e-01 4.4039881229400635e-01 + 1.0206270217895508e-01 -2.5624030828475952e-01 + <_> + + 1 0 342 5.4002371616661549e-03 2 -1 343 + 2.9745819047093391e-03 -2 -3 344 -2.5536341127008200e-03 + + 4.5371580123901367e-01 -6.0967987775802612e-01 + 2.2111609578132629e-01 -1.2801170349121094e-01 + <_> + + 0 1 345 4.0425839833915234e-03 2 -1 346 + 7.6407291926443577e-03 -2 -3 347 -1.0939979692921042e-03 + + -1.9264020025730133e-01 6.1178821325302124e-01 + -3.7973681092262268e-01 1.6438940167427063e-01 + <_> + + 1 2 348 -1.1377089685993269e-04 0 -1 349 + 5.2979402244091034e-03 -2 -3 350 2.9510098975151777e-03 + + -2.7770480141043663e-02 4.3019628524780273e-01 + -3.7912338972091675e-01 1.0130850225687027e-01 + <_> + + 1 0 351 6.3235480338335037e-03 -1 2 352 + 3.9955950342118740e-03 -2 -3 353 -5.3595582721754909e-04 + + 4.0413460135459900e-01 -1.5097740292549133e-01 + 5.9522801637649536e-01 -3.4380171447992325e-02 + <_> + + 1 0 354 3.6193430423736572e-03 2 -1 355 + 3.4626820124685764e-03 -2 -3 356 2.9030859470367432e-02 + + -7.4454522132873535e-01 2.8504610061645508e-01 + -1.8565440177917480e-01 1.5829989314079285e-01 + <_> + + 1 0 357 6.0747697716578841e-04 2 -1 358 + 9.4140451401472092e-03 -2 -3 359 -2.2230610251426697e-02 + + -3.3788970112800598e-01 -3.6750578880310059e-01 + -6.4205718040466309e-01 1.7526410520076752e-01 + <_> + + 2 1 360 -4.6881791204214096e-03 0 -1 361 + -3.9184167981147766e-03 -2 -3 362 -6.3269808888435364e-03 + + 1.6476869583129883e-01 -2.2729560732841492e-01 + 5.7388627529144287e-01 5.7931281626224518e-02 + <_> + + 0 1 363 -3.7428940413519740e-04 2 -1 364 + 2.8672320768237114e-03 -2 -3 365 2.4337199283763766e-04 + + -3.5288140177726746e-01 -4.1419389843940735e-01 + 2.0027640461921692e-01 -2.8263148665428162e-01 + <_> + + 0 1 366 -9.1555183753371239e-03 -1 2 367 + -1.2892490485683084e-03 -2 -3 368 -1.6453899443149567e-03 + + -5.4508739709854126e-01 2.5321239233016968e-01 + 1.7635670304298401e-01 -2.3053619265556335e-01 + <_> + + 0 1 369 -7.6485536992549896e-02 2 -1 370 + 3.8297360879369080e-04 -2 -3 371 -2.6448920834809542e-04 + + -7.0480287075042725e-01 2.2375050187110901e-01 + 1.4251540601253510e-01 -2.4608950316905975e-01 + <_> + + 0 1 372 -7.9496540129184723e-03 -1 2 373 + -7.7398279681801796e-03 -2 -3 374 -1.0467980057001114e-02 + + -4.2123699188232422e-01 -4.6475729346275330e-01 + -4.7312980890274048e-01 1.3598929345607758e-01 + <_> + + 1 0 375 9.4248689711093903e-03 2 -1 376 + -3.7210211157798767e-03 -2 -3 377 -1.6539100557565689e-02 + + 3.5587531328201294e-01 -1.5899239480495453e-01 + -6.1142671108245850e-01 3.3778318762779236e-01 + <_> + + 1 0 378 1.8258139491081238e-02 -1 2 379 + -6.1498139984905720e-03 -2 -3 380 1.4396630227565765e-02 + + -7.0120972394943237e-01 3.8414189219474792e-01 + 2.2873559966683388e-02 -4.8029011487960815e-01 + <_> + + 1 0 381 -4.8927508294582367e-02 -1 2 382 + -4.9874751130118966e-04 -2 -3 383 -1.2338399887084961e-02 + + -1.2219530344009399e-01 4.4899681210517883e-01 + 5.8306622505187988e-01 -1.5592460334300995e-01 + <_> + + 1 0 384 4.9237860366702080e-03 -1 2 385 + 6.4515617850702256e-05 -2 -3 386 -9.0754460543394089e-03 + + 5.7889437675476074e-01 -2.2252050042152405e-01 + 2.5118181109428406e-01 -1.1915980279445648e-01 + <_> + + 0 1 387 -2.2913129068911076e-03 2 -1 388 + -1.1618229560554028e-02 -2 -3 389 -2.6231290772557259e-02 + + 2.0203049480915070e-01 -2.4990449845790863e-01 + -7.2858989238739014e-01 2.2483369708061218e-01 + <_> + + 1 0 390 2.1525719785131514e-04 2 -1 391 + 5.4147760383784771e-03 -2 -3 392 -6.8281739950180054e-03 + + -3.0237621068954468e-01 -3.4467801451683044e-01 + -5.1470118761062622e-01 1.8762029707431793e-01 + <_> + 29 + -1.3664239645004272e+00 + + <_> + + 1 2 393 8.8577903807163239e-03 0 -1 394 + 2.2660400718450546e-03 -2 -3 395 1.5509200282394886e-02 + + -3.6197811365127563e-01 3.4535628557205200e-01 + -2.2814500331878662e-01 8.0521601438522339e-01 + <_> + + 1 2 396 1.9730629399418831e-02 0 -1 397 + -5.2804131060838699e-02 -2 -3 398 -3.4123551100492477e-02 + + 2.2162230312824249e-01 -2.6307260990142822e-01 + 8.7687742710113525e-01 1.5147949755191803e-01 + <_> + + 0 1 399 -4.4995918869972229e-03 -1 2 400 + -3.8060150109231472e-03 -2 -3 401 -6.5935899328906089e-05 + + -5.1520478725433350e-01 3.1563198566436768e-01 + 1.1052650213241577e-01 -3.0016160011291504e-01 + <_> + + 1 0 402 9.5838904380798340e-03 2 -1 403 + 4.2877299711108208e-03 -2 -3 404 3.2141651026904583e-03 + + 5.2808177471160889e-01 -6.3694041967391968e-01 + 3.5910170525312424e-02 -5.4334390163421631e-01 + <_> + + 0 1 405 -7.9250690760090947e-04 2 -1 406 + -1.5514569822698832e-03 -2 -3 407 -1.7790550366044044e-02 + + -4.7867339849472046e-01 -9.1462276875972748e-02 + 4.5612779259681702e-01 1.0628259740769863e-02 + <_> + + 2 1 408 -2.5881261099129915e-03 0 -1 409 + -2.7412150520831347e-03 -2 -3 410 4.4753181282430887e-04 + + 1.6198949515819550e-01 -2.9113239049911499e-01 + -2.8482219576835632e-01 3.3902090787887573e-01 + <_> + + 0 1 411 -3.6593680270016193e-03 2 -1 412 + 2.4432500358670950e-03 -2 -3 413 -1.3546410016715527e-02 + + -5.1089602708816528e-01 -3.2154849171638489e-01 + 2.7356979250907898e-01 -1.2062689661979675e-01 + <_> + + 1 0 414 1.1241570115089417e-01 -1 2 415 + -4.5845299027860165e-03 -2 -3 416 6.3416222110390663e-03 + + 3.6505278944969177e-01 4.4773998856544495e-01 + -9.7543753683567047e-02 -6.1698240041732788e-01 + <_> + + 2 1 417 -9.1398190706968307e-03 0 -1 418 + -8.2371473312377930e-02 -2 -3 419 3.1728888861835003e-03 + + 6.1478227376937866e-01 -1.7612460255622864e-01 + 2.7462399005889893e-01 -5.3833961486816406e-01 + <_> + + 2 1 420 8.2914117956534028e-04 0 -1 421 + -1.7079230397939682e-02 -2 -3 422 -4.8665981739759445e-03 + + -4.3669781088829041e-01 1.7935889959335327e-01 + -6.2017709016799927e-02 -5.9141248464584351e-01 + <_> + + 0 1 423 -3.3614661078900099e-03 -1 2 424 + -4.4482201337814331e-02 -2 -3 425 -1.8765870481729507e-03 + + -4.3437281250953674e-01 -6.8157917261123657e-01 + -6.8667972087860107e-01 1.1657930165529251e-01 + <_> + + 1 0 426 2.3192320019006729e-02 -1 2 427 + -4.5041430741548538e-02 -2 -3 428 2.3778830654919147e-03 + + 4.0776708722114563e-01 3.7137511372566223e-01 + -7.1181386709213257e-02 -5.3898727893829346e-01 + <_> + + 1 2 429 -1.3468379620462656e-03 0 -1 430 + 4.3169260025024414e-03 -2 -3 431 4.5682261697947979e-03 + + 2.3184180259704590e-01 -3.8448938727378845e-01 + -2.4857190251350403e-01 1.2519669532775879e-01 + <_> + + 1 0 432 1.1057799682021141e-02 -1 2 433 + -6.6700251772999763e-04 -2 -3 434 4.8536141548538581e-05 + + -3.8228470087051392e-01 -2.7387779951095581e-01 + -2.9664589092135429e-02 2.8385889530181885e-01 + <_> + + 2 1 435 -3.9972390979528427e-02 0 -1 436 + -1.6880780458450317e-02 -2 -3 437 -5.6082051247358322e-02 + + 6.3570600748062134e-01 -1.9189420342445374e-01 + -9.0092360973358154e-01 1.9145509600639343e-01 + <_> + + 1 0 438 3.4141261130571365e-03 2 -1 439 + 9.1075859963893890e-03 -2 -3 440 -1.3897320022806525e-03 + + 4.2132571339607239e-01 5.5071562528610229e-01 + -5.0447541475296021e-01 -4.0802270174026489e-02 + <_> + + 2 1 441 1.7231719568371773e-02 0 -1 442 + -2.0052720792591572e-03 -2 -3 443 3.5111181205138564e-04 + + -3.1567269563674927e-01 5.5168247222900391e-01 + 5.6736338883638382e-02 -2.6553949713706970e-01 + <_> + + 0 1 444 -2.0616729743778706e-03 -1 2 445 + -1.0434100404381752e-03 -2 -3 446 2.0041360985487700e-03 + + -4.9637660384178162e-01 2.5625479221343994e-01 + -2.3637770116329193e-01 1.2562820315361023e-01 + <_> + + 0 1 447 -4.6680038794875145e-03 2 -1 448 + 1.0352090001106262e-02 -2 -3 449 2.9808359686285257e-03 + + -5.1331508159637451e-01 3.5214298963546753e-01 + -1.6628879308700562e-01 1.6649410128593445e-01 + <_> + + 1 0 450 1.0835190303623676e-02 -1 2 451 + -3.8211939390748739e-03 -2 -3 452 -3.4161040093749762e-03 + + -3.8929209113121033e-01 3.5466459393501282e-01 + -4.5814520120620728e-01 4.5853018760681152e-02 + <_> + + 2 1 453 -5.8807642199099064e-03 0 -1 454 + -3.4913890063762665e-02 -2 -3 455 4.8959217965602875e-03 + + 1.0240379720926285e-01 -2.5945249199867249e-01 + 2.6778548955917358e-01 -4.8959800601005554e-01 + <_> + + 1 0 456 5.8120768517255783e-03 -1 2 457 + 3.5575949586927891e-03 -2 -3 458 2.5241500698029995e-03 + + 3.0377060174942017e-01 -1.8064819276332855e-01 + 4.1480910778045654e-01 -1.9794499874114990e-01 + <_> + + 1 0 459 1.5492970123887062e-02 2 -1 460 + 2.3261269961949438e-04 -2 -3 461 -2.1607619710266590e-03 + + 4.7802209854125977e-01 -3.0891039967536926e-01 + -4.0223160386085510e-01 1.1098849773406982e-01 + <_> + + 1 0 462 3.5326189827173948e-03 -1 2 463 + -3.3474999945610762e-03 -2 -3 464 2.9168210923671722e-02 + + 2.2489060461521149e-01 1.6631869971752167e-01 + -7.4026778340339661e-02 -4.5744699239730835e-01 + <_> + + 0 1 465 -1.6242500394582748e-02 -1 2 466 + -7.5024510733783245e-03 -2 -3 467 1.7816389445215464e-03 + + -4.3497189879417419e-01 1.6646090149879456e-01 + -3.9155849814414978e-01 8.0571353435516357e-02 + <_> + + 2 1 468 -7.2545823059044778e-05 0 -1 469 + 6.1626458773389459e-05 -2 -3 470 -4.3781189015135169e-04 + + -4.1679731011390686e-01 6.0808397829532623e-03 + 3.1920549273490906e-01 -7.7506266534328461e-02 + <_> + + 1 2 471 -3.0576970311813056e-04 0 -1 472 + -1.3107899576425552e-02 -2 -3 473 -7.4203108670189977e-04 + + -3.6462840437889099e-01 2.2391660511493683e-01 + 6.8343617022037506e-02 -2.9597601294517517e-01 + <_> + + 0 1 474 -7.7575328759849072e-03 2 -1 475 + 3.0043099541217089e-03 -2 -3 476 -5.8561760932207108e-02 + + 4.5748728513717651e-01 1.8059000372886658e-01 + 2.6555559039115906e-01 -2.0381399989128113e-01 + <_> + + 0 1 477 -2.5295289233326912e-02 -1 2 478 + -4.9810659140348434e-02 -2 -3 479 -2.4564980994910002e-03 + + -5.8704811334609985e-01 -8.4442830085754395e-01 + 4.4017440080642700e-01 3.7946549709886312e-03 + <_> + 25 + -1.3621879816055298e+00 + + <_> + + 2 1 480 -2.3795999586582184e-02 0 -1 481 + -4.2916718870401382e-02 -2 -3 482 -9.9466904066503048e-04 + + 2.1881549619138241e-03 -4.9640420079231262e-01 + 8.3718097209930420e-01 -3.0279759317636490e-02 + <_> + + 0 1 483 1.3895650394260883e-02 2 -1 484 + -2.2832138929516077e-03 -2 -3 485 -4.8447579145431519e-01 + + -3.9495769143104553e-01 -3.8689300417900085e-02 + 8.3933347463607788e-01 2.3111909627914429e-01 + <_> + + 0 1 486 -7.3761418461799622e-03 2 -1 487 + 3.3793840557336807e-03 -2 -3 488 -3.3415269106626511e-02 + + 2.3094999790191650e-01 9.1608531773090363e-02 + 1.1462929844856262e-01 -5.4809182882308960e-01 + <_> + + 0 1 489 -7.6022851280868053e-03 2 -1 490 + 7.6229616999626160e-02 -2 -3 491 -3.7729479372501373e-03 + + -5.7959568500518799e-01 3.4666779637336731e-01 + 1.1899670213460922e-01 -2.7983540296554565e-01 + <_> + + 2 1 492 -4.2590490193106234e-04 0 -1 493 + -9.4475867226719856e-03 -2 -3 494 -8.0220031738281250e-01 + + 1.4403289556503296e-01 -2.8053888678550720e-01 + 6.6430008411407471e-01 5.4834768176078796e-02 + <_> + + 0 1 495 -2.8851430397480726e-03 -1 2 496 + -1.2341480469331145e-03 -2 -3 497 4.8669218813301995e-05 + + -3.8836699724197388e-01 -3.6734551191329956e-01 + -7.8982323408126831e-02 3.0184748768806458e-01 + <_> + + 0 1 498 -1.6491800546646118e-01 -1 2 499 + 1.0784890037029982e-03 -2 -3 500 -2.8511860873550177e-03 + + 3.8886231184005737e-01 -2.4477399885654449e-01 + 4.5753139257431030e-01 -5.3499769419431686e-02 + <_> + + 2 1 501 -3.2212301157414913e-03 0 -1 502 + 3.4995030146092176e-03 -2 -3 503 -1.0098779574036598e-02 + + -2.4303850531578064e-01 1.5881340205669403e-01 + -5.5816608667373657e-01 3.2196229696273804e-01 + <_> + + 0 1 504 -6.6468201112002134e-04 -1 2 505 + -3.6263898946344852e-03 -2 -3 506 -7.6791420578956604e-02 + + 2.4572889506816864e-01 1.8094339966773987e-01 + 2.6634529232978821e-01 -3.5051029920578003e-01 + <_> + + 0 1 507 -2.7685859240591526e-03 2 -1 508 + 2.5676529854536057e-02 -2 -3 509 -4.6753739006817341e-03 + + -4.3504360318183899e-01 -3.5143280029296875e-01 + 4.1049909591674805e-01 3.3144820481538773e-02 + <_> + + 1 0 510 6.7022559233009815e-03 -1 2 511 + 1.6208000481128693e-02 -2 -3 512 -1.1024869978427887e-02 + + -4.9738308787345886e-01 -1.7945469915866852e-01 + 4.0457150340080261e-01 -4.3077580630779266e-02 + <_> + + 2 1 513 7.7911361586302519e-04 0 -1 514 + -1.8139690160751343e-01 -2 -3 515 -1.2972550466656685e-03 + + 5.1866638660430908e-01 -7.5364969670772552e-02 + -5.0643932819366455e-01 -1.7226299270987511e-02 + <_> + + 1 0 516 2.0431660115718842e-02 2 -1 517 + 1.6622639959678054e-03 -2 -3 518 -2.7155179996043444e-03 + + -7.0584601163864136e-01 -4.5102250576019287e-01 + -4.4598218798637390e-01 1.3886100053787231e-01 + <_> + + 0 1 519 4.2074210796272382e-05 2 -1 520 + 9.3489577993750572e-03 -2 -3 521 -1.3226609677076340e-02 + + -2.2170229256153107e-01 -4.6554449200630188e-01 + 5.4859870672225952e-01 6.7970179021358490e-02 + <_> + + 0 1 522 -1.5071720117703080e-03 2 -1 523 + 8.7646767497062683e-03 -2 -3 524 -1.0542649775743484e-02 + + 4.6481129527091980e-01 2.7992910146713257e-01 + 2.1239709854125977e-01 -2.2514510154724121e-01 + <_> + + 0 1 525 -6.4357798546552658e-03 2 -1 526 + 7.8919027000665665e-03 -2 -3 527 -7.8666176705155522e-05 + + -4.1811630129814148e-01 -6.2211698293685913e-01 + 2.7184090018272400e-01 -4.2934559285640717e-02 + <_> + + 1 0 528 8.2855960354208946e-03 2 -1 529 + 5.4834279580973089e-05 -2 -3 530 2.4197530001401901e-03 + + 3.4669309854507446e-01 7.2008788585662842e-02 + -3.7774428725242615e-01 1.7871029675006866e-01 + <_> + + 2 1 531 -6.7930121440440416e-04 0 -1 532 + -5.6035388261079788e-03 -2 -3 533 8.4534510970115662e-03 + + 1.6817240417003632e-01 -2.7659809589385986e-01 + 6.9586731493473053e-02 6.7284989356994629e-01 + <_> + + 1 0 534 4.4707441702485085e-03 -1 2 535 + -9.1664772480726242e-03 -2 -3 536 -7.1168012917041779e-02 + + -4.2183759808540344e-01 3.6319440603256226e-01 + -5.9520107507705688e-01 2.3322079330682755e-02 + <_> + + 1 2 537 -3.6344379186630249e-03 0 -1 538 + -5.8278841897845268e-03 -2 -3 539 -2.5245670694857836e-03 + + -3.5108420252799988e-01 2.7366310358047485e-01 + 1.4989720284938812e-01 -2.4933290481567383e-01 + <_> + + 1 0 540 5.6592230685055256e-03 2 -1 541 + 4.0714079514145851e-03 -2 -3 542 -1.1921550147235394e-02 + + -3.4733161330223083e-01 -4.7359859943389893e-01 + -4.0016528964042664e-01 1.5767680108547211e-01 + <_> + + 1 2 543 9.8874024115502834e-04 0 -1 544 + 1.4633700484409928e-03 -2 -3 545 -7.6617081649601460e-03 + + 2.1033559739589691e-01 -1.5317709743976593e-01 + 2.3481769859790802e-01 -3.7187078595161438e-01 + <_> + + 2 1 546 -1.7770569771528244e-02 0 -1 547 + 8.8388901203870773e-03 -2 -3 548 -1.0058529675006866e-02 + + -1.6414129734039307e-01 4.8245888948440552e-01 + -5.4388159513473511e-01 2.8127178549766541e-01 + <_> + + 1 0 549 2.8392190579324961e-03 -1 2 550 + -7.8546267468482256e-04 -2 -3 551 4.2725168896140531e-05 + + -3.8577800989151001e-01 -3.2860949635505676e-01 + -4.6654768288135529e-02 2.7741169929504395e-01 + <_> + + 1 0 552 5.1506902091205120e-03 -1 2 553 + -8.3640925586223602e-03 -2 -3 554 -8.8340323418378830e-03 + + 2.7348038554191589e-01 1.4315670728683472e-01 + 5.4049361497163773e-02 -3.6266559362411499e-01 + <_> + 16 + -1.3905019760131836e+00 + + <_> + + 1 2 555 1.7114889621734619e-01 0 -1 556 + 3.2740959431976080e-03 -2 -3 557 4.8062200658023357e-03 + + -5.5645358562469482e-01 5.5018130689859390e-02 + 1.1190200224518776e-02 7.9551488161087036e-01 + <_> + + 2 1 558 1.8143800552934408e-03 0 -1 559 + -4.2795971035957336e-01 -2 -3 560 -6.3261981122195721e-03 + + 5.8408319950103760e-01 -1.3940179720520973e-02 + 1.6659989953041077e-01 -5.0161522626876831e-01 + <_> + + 1 2 561 1.0702019557356834e-02 0 -1 562 + 7.3792198672890663e-03 -2 -3 563 4.8895571380853653e-03 + + -4.0653520822525024e-01 1.2877050042152405e-01 + 4.3990871310234070e-01 -7.8997397422790527e-01 + <_> + + 1 2 564 1.0012320242822170e-02 0 -1 565 + 3.4356310963630676e-01 -2 -3 566 -7.2859530337154865e-03 + + -2.5616368651390076e-01 4.6377441287040710e-01 + 5.8014488220214844e-01 -5.4609451442956924e-02 + <_> + + 0 1 567 -1.5099609736353159e-03 2 -1 568 + 2.9597719549201429e-04 -2 -3 569 1.0984730033669621e-04 + + -6.4054518938064575e-01 3.8956710696220398e-01 + -3.4113371372222900e-01 1.1111719906330109e-01 + <_> + + 0 1 570 -3.2580990809947252e-03 -1 2 571 + -3.8750080857425928e-03 -2 -3 572 1.4542469754815102e-02 + + -7.3414462804794312e-01 -6.3508582115173340e-01 + 1.7632520198822021e-01 -6.6695272922515869e-01 + <_> + + 1 0 573 2.6616070419549942e-02 2 -1 574 + 5.2236141636967659e-03 -2 -3 575 5.8677811175584793e-03 + + -7.5831902027130127e-01 -6.2622100114822388e-01 + -3.1810950487852097e-02 4.1031879186630249e-01 + <_> + + 2 1 576 -1.0499180061742663e-03 0 -1 577 + 2.3986180312931538e-03 -2 -3 578 1.1009530164301395e-02 + + -5.2936470508575439e-01 2.2620279341936111e-02 + 3.0528450012207031e-01 -7.4659830331802368e-01 + <_> + + 0 1 579 -2.3957889527082443e-02 -1 2 580 + -3.6849190946668386e-03 -2 -3 581 3.4864700865000486e-03 + + -5.8027571439743042e-01 3.0985590815544128e-01 + -3.1498908996582031e-01 1.3219730556011200e-01 + <_> + + 0 1 582 -1.9150340557098389e-01 -1 2 583 + -8.0496361479163170e-03 -2 -3 584 1.2236339971423149e-02 + + 4.3646478652954102e-01 1.7165799438953400e-01 + -3.6382019519805908e-01 2.3967529833316803e-01 + <_> + + 0 1 585 -2.0347100216895342e-03 -1 2 586 + -5.5528031662106514e-03 -2 -3 587 -3.2379259355366230e-03 + + -5.9768581390380859e-01 -5.4164600372314453e-01 + -5.3870290517807007e-01 1.8444229662418365e-01 + <_> + + 1 0 588 9.0606305748224258e-03 -1 2 589 + -4.1239038109779358e-03 -2 -3 590 3.5246899351477623e-03 + + 3.1039738655090332e-01 1.8052390217781067e-01 + -4.7347640991210938e-01 1.5349459834396839e-02 + <_> + + 1 0 591 5.2378959953784943e-03 -1 2 592 + -9.4280708581209183e-03 -2 -3 593 -7.9351589083671570e-03 + + -4.5859739184379578e-01 -6.3323330879211426e-01 + -6.1539369821548462e-01 1.6920439898967743e-01 + <_> + + 0 1 594 -7.7211041934788227e-03 2 -1 595 + 9.0800300240516663e-03 -2 -3 596 -4.3125250376760960e-03 + + -6.5861612558364868e-01 -7.1446138620376587e-01 + 3.4336578845977783e-01 -4.6265859156847000e-02 + <_> + + 1 0 597 2.3179050534963608e-02 -1 2 598 + -2.1390080451965332e-02 -2 -3 599 -2.3761409521102905e-01 + + 3.6338710784912109e-01 1.8276840448379517e-01 + 6.1675137281417847e-01 -3.4261471033096313e-01 + <_> + + 1 0 600 2.1705040708184242e-03 -1 2 601 + 7.8210679930634797e-05 -2 -3 602 5.5145919322967529e-03 + + 3.0056789517402649e-01 -3.4116759896278381e-01 + 2.3386859893798828e-01 -4.2150521278381348e-01 + <_> + 25 + -1.3378640413284302e+00 + + <_> + + 1 2 603 -2.2743379697203636e-02 0 -1 604 + 1.8450849456712604e-03 -2 -3 605 1.3338179886341095e-01 + + -8.9552268385887146e-02 7.4778342247009277e-01 + -4.4504231214523315e-01 -1.7580920830368996e-02 + <_> + + 0 1 606 6.3608489930629730e-02 -1 2 607 + -2.5199958682060242e-01 -2 -3 608 -1.2144230306148529e-01 + + -3.7739220261573792e-01 4.9088031053543091e-01 + 6.3825917243957520e-01 -1.1822170019149780e-01 + <_> + + 1 0 609 2.6287150103598833e-03 2 -1 610 + 3.0568530783057213e-03 -2 -3 611 8.1901780504267663e-05 + + -4.6926748752593994e-01 -6.5101218223571777e-01 + -1.1639259755611420e-01 3.0188819766044617e-01 + <_> + + 1 0 612 -1.6189720481634140e-03 2 -1 613 + 1.8283469835296273e-03 -2 -3 614 -3.9073298685252666e-03 + + -2.0891909301280975e-01 -1.9859300553798676e-01 + -3.4454259276390076e-01 3.7140819430351257e-01 + <_> + + 0 1 615 8.3928240928798914e-04 2 -1 616 + 3.7175789475440979e-03 -2 -3 617 5.1694628782570362e-03 + + -1.5356570482254028e-01 -5.0904238224029541e-01 + 3.5618001222610474e-01 -5.5773228406906128e-01 + <_> + + 1 0 618 2.5797619018703699e-03 -1 2 619 + -6.0318140313029289e-03 -2 -3 620 6.4257727935910225e-03 + + -4.2096439003944397e-01 -4.3999868631362915e-01 + 1.8873579800128937e-01 -4.5191749930381775e-01 + <_> + + 1 0 621 3.4354510717093945e-03 2 -1 622 + 2.3672808893024921e-03 -2 -3 623 -2.0294289570301771e-03 + + 2.7395468950271606e-01 2.3808500170707703e-01 + -4.7586150467395782e-02 -4.8159629106521606e-01 + <_> + + 0 1 624 -4.8436429351568222e-03 2 -1 625 + 3.0318649951368570e-03 -2 -3 626 -1.1691249907016754e-02 + + -4.9325150251388550e-01 -4.7109460830688477e-01 + -5.8763760328292847e-01 1.4840489625930786e-01 + <_> + + 1 0 627 6.5642758272588253e-05 2 -1 628 + -6.9199966674204916e-05 -2 -3 629 -2.8953890432603657e-04 + + 2.0787779986858368e-01 -4.2199170589447021e-01 + -3.4657689929008484e-01 2.4809280037879944e-01 + <_> + + 1 2 630 4.0080421604216099e-03 0 -1 631 + 5.0496991025283933e-04 -2 -3 632 -8.1637818366289139e-03 + + -2.9731631278991699e-01 6.3133187592029572e-02 + 6.3499641418457031e-01 -1.4965349435806274e-01 + <_> + + 1 0 633 4.9255997873842716e-03 -1 2 634 + -1.9985990598797798e-02 -2 -3 635 6.5322928130626678e-03 + + -5.8709067106246948e-01 4.1946971416473389e-01 + -1.3393980264663696e-01 2.6131281256675720e-01 + <_> + + 1 0 636 5.1231118850409985e-03 2 -1 637 + -4.0335211087949574e-04 -2 -3 638 2.9234900139272213e-03 + + -3.6397430300712585e-01 -1.1776120215654373e-01 + -1.2529510073363781e-02 4.6132311224937439e-01 + <_> + + 1 0 639 3.5967670381069183e-02 2 -1 640 + 6.5072569996118546e-03 -2 -3 641 -1.0821050032973289e-02 + + 4.5991379022598267e-01 3.2189390063285828e-01 + 3.0423519015312195e-01 -2.0769970118999481e-01 + <_> + + 0 1 642 -3.7279170937836170e-03 -1 2 643 + -8.9352466166019440e-03 -2 -3 644 3.9792140014469624e-03 + + -4.7056239843368530e-01 3.1361898779869080e-01 + -1.8559350073337555e-01 3.0811190605163574e-01 + <_> + + 1 0 645 1.9110339926555753e-03 -1 2 646 + -6.8130958825349808e-03 -2 -3 647 -6.4241990912705660e-04 + + -4.4997429847717285e-01 -4.4663950800895691e-01 + 2.5373989343643188e-01 -6.7794866859912872e-02 + <_> + + 1 0 648 4.8487721942365170e-03 -1 2 649 + -2.2816660348325968e-03 -2 -3 650 -1.1166459880769253e-03 + + 2.1777780354022980e-01 7.4151009321212769e-02 + 1.3762679696083069e-01 -4.5716550946235657e-01 + <_> + + 1 0 651 -5.7191308587789536e-03 2 -1 652 + 1.9458220340311527e-03 -2 -3 653 1.7544110305607319e-03 + + -2.0206199586391449e-01 5.1613742113113403e-01 + 1.8209919333457947e-01 -2.4927709996700287e-01 + <_> + + 1 0 654 6.5033212304115295e-03 2 -1 655 + 2.3260021116584539e-03 -2 -3 656 -5.0675291568040848e-03 + + -6.0831350088119507e-01 -4.5783790946006775e-01 + -4.6264541149139404e-01 1.3114589452743530e-01 + <_> + + 1 2 657 -1.4921430265530944e-03 0 -1 658 + -1.3755200430750847e-02 -2 -3 659 6.3531019259244204e-04 + + -4.3485641479492188e-01 2.0381599664688110e-01 + -3.2480859756469727e-01 1.9679710268974304e-01 + <_> + + 1 2 660 -1.0971709853038192e-03 0 -1 661 + 2.1464130841195583e-03 -2 -3 662 1.0343589819967747e-02 + + 2.2354440391063690e-01 -2.5036358833312988e-01 + -2.7500569820404053e-01 3.2847368717193604e-01 + <_> + + 0 1 663 -1.3076810538768768e-01 -1 2 664 + -8.7650436908006668e-03 -2 -3 665 -3.0066180624999106e-04 + + -7.7974641323089600e-01 3.8356649875640869e-01 + -3.0849298834800720e-01 5.5713050067424774e-02 + <_> + + 0 1 666 -1.0776310227811337e-02 2 -1 667 + 7.3227831162512302e-03 -2 -3 668 -2.1263879537582397e-01 + + -5.3079968690872192e-01 3.0776378512382507e-01 + -6.5190672874450684e-01 2.3253040853887796e-03 + <_> + + 1 0 669 6.5717170946300030e-03 -1 2 670 + -1.6367210075259209e-02 -2 -3 671 -1.5086789615452290e-02 + + 2.4296599626541138e-01 4.0867790579795837e-01 + 1.5299239754676819e-01 -2.5561499595642090e-01 + <_> + + 1 2 672 4.5563760213553905e-03 0 -1 673 + 7.2980518452823162e-03 -2 -3 674 2.3971209302544594e-02 + + 8.6251303553581238e-02 -5.1425570249557495e-01 + -6.8491697311401367e-01 3.9260080456733704e-01 + <_> + + 1 0 675 3.5279770381748676e-03 -1 2 676 + -5.4452237673103809e-03 -2 -3 677 8.1267702626064420e-04 + + -5.8989018201828003e-01 4.1997981071472168e-01 + -2.5605329871177673e-01 7.9393006861209869e-02 + <_> + 30 + -1.2140669822692871e+00 + + <_> + + 1 2 678 -2.7691459283232689e-02 0 -1 679 + 1.3043059734627604e-03 -2 -3 680 -1.9430460408329964e-02 + + -1.3037249445915222e-01 7.8108358383178711e-01 + 1.4480729587376118e-02 -3.7184581160545349e-01 + <_> + + 2 1 681 -1.2235040217638016e-01 0 -1 682 + -9.8456647247076035e-03 -2 -3 683 -7.4350096285343170e-02 + + 2.8437229990959167e-01 -2.3675830662250519e-01 + 5.8174878358840942e-01 -2.8041550889611244e-02 + <_> + + 0 1 684 5.4055661894381046e-03 -1 2 685 + -3.7805580068379641e-03 -2 -3 686 -6.2997087836265564e-02 + + -3.3748638629913330e-01 -4.6232721209526062e-01 + 4.2070108652114868e-01 -1.6759809805080295e-03 + <_> + + 0 1 687 -5.5793630890548229e-03 -1 2 688 + -2.2814329713582993e-03 -2 -3 689 3.9111520163714886e-03 + + -6.4612352848052979e-01 -4.6796101331710815e-01 + -2.5594810023903847e-02 3.3460310101509094e-01 + <_> + + 2 1 690 -3.5144959110766649e-03 0 -1 691 + -5.8226250112056732e-03 -2 -3 692 -3.5309740342199802e-03 + + 1.1143500357866287e-01 -3.0549728870391846e-01 + -3.7789401412010193e-01 2.9324159026145935e-01 + <_> + + 2 1 693 -1.6653330530971289e-03 0 -1 694 + -5.3326018154621124e-02 -2 -3 695 8.0891316756606102e-03 + + 1.7236860096454620e-01 -3.9026060700416565e-01 + -1.6290800645947456e-02 3.9434731006622314e-01 + <_> + + 0 1 696 -3.7783260922878981e-03 2 -1 697 + 6.9123809225857258e-03 -2 -3 698 -2.1676100790500641e-02 + + -5.9947258234024048e-01 3.4755259752273560e-01 + 3.3966198563575745e-01 -1.2729069590568542e-01 + <_> + + 1 0 699 4.8390422016382217e-03 -1 2 700 + -8.3583313971757889e-03 -2 -3 701 3.7209360743872821e-04 + + -3.6860859394073486e-01 3.6083450913429260e-01 + 5.5149830877780914e-02 -3.8888710737228394e-01 + <_> + + 1 0 702 2.4114940315485001e-03 -1 2 703 + -2.2250239271670580e-03 -2 -3 704 5.9994249604642391e-03 + + -3.4846460819244385e-01 2.5639998912811279e-01 + -3.3086439967155457e-01 6.3943088054656982e-02 + <_> + + 1 0 705 1.2653459794819355e-02 2 -1 706 + 9.6980258822441101e-03 -2 -3 707 4.6688161790370941e-02 + + -6.5382891893386841e-01 3.2730111479759216e-01 + 6.1174212023615837e-03 -5.0968867540359497e-01 + <_> + + 1 0 708 1.7876239726319909e-03 2 -1 709 + 1.2315230444073677e-02 -2 -3 710 -5.9714429080486298e-03 + + 2.5808030366897583e-01 1.8367570638656616e-01 + 9.3017883598804474e-02 -3.3489298820495605e-01 + <_> + + 0 1 711 -4.6226778067648411e-03 -1 2 712 + -1.8949989229440689e-02 -2 -3 713 -2.6787531375885010e-01 + + -6.0853439569473267e-01 -6.2188267707824707e-01 + -4.4505828619003296e-01 1.1461599916219711e-01 + <_> + + 1 2 714 5.3505371324717999e-03 0 -1 715 + 2.8202211251482368e-04 -2 -3 716 -2.1514539548661560e-04 + + -3.3214330673217773e-01 1.1352939903736115e-01 + 3.9949831366539001e-01 -7.2412580251693726e-02 + <_> + + 0 1 717 -7.1091961581259966e-04 -1 2 718 + 3.9453650970244780e-05 -2 -3 719 -1.5662070363759995e-02 + + -3.4575951099395752e-01 -1.4114260673522949e-01 + 4.7070771455764771e-01 8.7163902819156647e-02 + <_> + + 2 1 720 -2.9816610738635063e-02 0 -1 721 + 8.2333059981465340e-04 -2 -3 722 -4.9664578400552273e-03 + + -1.4977900311350822e-02 -4.1764840483665466e-01 + 4.4018781185150146e-01 -2.0097310189157724e-03 + <_> + + 1 2 723 9.6796536818146706e-03 0 -1 724 + 1.4388150302693248e-03 -2 -3 725 -6.5185758285224438e-04 + + -2.8451511263847351e-01 1.1680959910154343e-01 + 3.4258028864860535e-01 -2.7020359039306641e-01 + <_> + + 0 1 726 -4.6871218830347061e-02 -1 2 727 + -2.2867210209369659e-02 -2 -3 728 -1.1887500295415521e-03 + + -3.9659130573272705e-01 -3.4727048873901367e-01 + 2.6036709547042847e-01 -4.2848858982324600e-02 + <_> + + 1 0 729 4.3433779501356184e-04 -1 2 730 + -2.0600060001015663e-02 -2 -3 731 3.2824440859258175e-03 + + -2.2835609316825867e-01 -5.0135952234268188e-01 + 1.6683070361614227e-01 -5.0252157449722290e-01 + <_> + + 0 1 732 -1.9087310880422592e-02 -1 2 733 + -1.1216020211577415e-02 -2 -3 734 7.7710166573524475e-02 + + 4.1381299495697021e-01 1.5498070418834686e-01 + -2.9895618557929993e-01 1.7541980743408203e-01 + <_> + + 0 1 735 3.1873160041868687e-03 -1 2 736 + -1.0656990110874176e-01 -2 -3 737 -5.1779888570308685e-02 + + -8.5479579865932465e-02 -5.1295292377471924e-01 + -5.0179839134216309e-01 3.8466781377792358e-01 + <_> + + 1 0 738 1.5107400249689817e-03 2 -1 739 + 3.1244980636984110e-03 -2 -3 740 -1.3240240514278412e-03 + + -3.3874571323394775e-01 -2.1653899550437927e-01 + 3.3594998717308044e-01 -1.2085800059139729e-02 + <_> + + 0 1 741 -1.6975030303001404e-02 2 -1 742 + 7.9635268775746226e-04 -2 -3 743 -8.4425378590822220e-03 + + 5.1493197679519653e-01 -2.2367909550666809e-01 + -5.4637181758880615e-01 1.2477649748325348e-01 + <_> + + 1 0 744 1.4797519892454147e-02 2 -1 745 + 3.8537830114364624e-03 -2 -3 746 -2.5684939697384834e-02 + + 4.0930178761482239e-01 2.5966641306877136e-01 + 4.6507820487022400e-02 -3.1387579441070557e-01 + <_> + + 0 1 747 -1.9678380340337753e-03 2 -1 748 + 1.9392849644646049e-03 -2 -3 749 -5.7980217970907688e-03 + + -3.4348770976066589e-01 -2.3071029782295227e-01 + -4.2302230000495911e-01 1.8470630049705505e-01 + <_> + + 1 0 750 6.0432781465351582e-03 2 -1 751 + 2.2162510140333325e-04 -2 -3 752 -2.5901809567585588e-04 + + 2.0985080301761627e-01 -3.4345629811286926e-01 + -4.0245899558067322e-01 9.6283361315727234e-02 + <_> + + 0 1 753 -4.6646450646221638e-03 -1 2 754 + 1.8331389874219894e-03 -2 -3 755 -5.4393261671066284e-03 + + -4.0147981047630310e-01 -7.4128046631813049e-02 + -7.1304339170455933e-01 2.5141170620918274e-01 + <_> + + 1 2 756 -4.2101307772099972e-03 0 -1 757 + -8.6573585867881775e-03 -2 -3 758 -2.5619829073548317e-02 + + 5.5250108242034912e-01 -8.8310241699218750e-02 + 4.0513488650321960e-01 -1.2086849659681320e-01 + <_> + + 0 1 759 -9.3565601855516434e-03 -1 2 760 + -9.7968382760882378e-04 -2 -3 761 4.5081991702318192e-02 + + 1.4859180152416229e-01 1.5276379883289337e-01 + -3.3007758855819702e-01 4.9553450942039490e-01 + <_> + + 1 0 762 2.0435510668903589e-03 -1 2 763 + -5.1532210782170296e-03 -2 -3 764 2.5609789881855249e-03 + + -5.4895031452178955e-01 -5.9945631027221680e-01 + -3.6197409033775330e-02 2.5463849306106567e-01 + <_> + + 2 1 765 -2.8830259107053280e-03 0 -1 766 + 2.4457499966956675e-04 -2 -3 767 3.4641250967979431e-03 + + 3.6667680740356445e-01 -8.9348360896110535e-02 + -2.2523890435695648e-01 1.6340459883213043e-01 + <_> + 23 + -1.3826370239257812e+00 + + <_> + + 2 1 768 6.3124410808086395e-03 0 -1 769 + -2.9899911023676395e-03 -2 -3 770 -5.2643599919974804e-03 + + 8.2071298360824585e-01 5.6462198495864868e-02 + 1.8240800499916077e-01 -4.2487311363220215e-01 + <_> + + 1 2 771 2.4592089466750622e-03 0 -1 772 + 4.2719349265098572e-01 -2 -3 773 3.0295109376311302e-02 + + -3.3858558535575867e-01 1.5100230276584625e-01 + 7.8724241256713867e-01 -5.8373618125915527e-01 + <_> + + 1 0 774 5.7569369673728943e-03 -1 2 775 + -9.9140219390392303e-03 -2 -3 776 8.0783478915691376e-03 + + 4.2810270190238953e-01 3.5321989655494690e-01 + -4.0107539296150208e-01 1.2523290514945984e-01 + <_> + + 0 1 777 -3.5829450935125351e-02 2 -1 778 + 3.0664550140500069e-02 -2 -3 779 -1.3575930148363113e-02 + + -3.8963070511817932e-01 6.7701917886734009e-01 + 3.0789810419082642e-01 -1.1214990168809891e-01 + <_> + + 0 1 780 -3.1188609078526497e-02 -1 2 781 + -1.7885420471429825e-02 -2 -3 782 2.3879480431787670e-04 + + -5.0550907850265503e-01 -5.2990978956222534e-01 + 2.6112490892410278e-01 -1.2882560491561890e-01 + <_> + + 1 0 783 8.5746757686138153e-03 2 -1 784 + 2.3016470950096846e-03 -2 -3 785 4.6683140099048615e-03 + + 4.8921179771423340e-01 1.5979060530662537e-01 + -3.8685420155525208e-01 2.4002879858016968e-01 + <_> + + 1 0 786 5.3485399112105370e-03 2 -1 787 + 2.3726709187030792e-02 -2 -3 788 -3.0209170654416084e-04 + + 3.4825628995895386e-01 5.2329671382904053e-01 + -4.4047841429710388e-01 -3.3358339220285416e-02 + <_> + + 0 1 789 -1.6881260275840759e-01 -1 2 790 + -1.8069280486088246e-04 -2 -3 791 -2.7342080138623714e-03 + + -6.5631157159805298e-01 -2.7557009458541870e-01 + 4.0996900200843811e-01 3.1245049089193344e-02 + <_> + + 2 1 792 -3.1896680593490601e-03 0 -1 793 + -1.6777559649199247e-03 -2 -3 794 7.5925810961052775e-04 + + 3.1674280762672424e-01 -1.3047559559345245e-01 + 8.2382179796695709e-02 7.4721777439117432e-01 + <_> + + 1 2 795 1.7604179680347443e-02 0 -1 796 + -2.5936108827590942e-01 -2 -3 797 -2.4794649798423052e-03 + + 2.6953551173210144e-01 -3.3992108702659607e-01 + 5.0643271207809448e-01 2.7994990348815918e-02 + <_> + + 0 1 798 -5.7244639843702316e-02 -1 2 799 + -2.9133851057849824e-04 -2 -3 800 3.0808679759502411e-02 + + -6.9636821746826172e-01 -3.1919568777084351e-01 + 1.3237810134887695e-01 -7.6749938726425171e-01 + <_> + + 1 0 801 2.8046660125255585e-02 2 -1 802 + -3.7829200737178326e-03 -2 -3 803 -1.3911469839513302e-02 + + 6.9832587242126465e-01 -2.1438920497894287e-01 + 3.3778458833694458e-01 -9.6943713724613190e-02 + <_> + + 0 1 804 -9.6410012338310480e-04 -1 2 805 + -4.1028819978237152e-03 -2 -3 806 7.6512782834470272e-04 + + 2.7303680777549744e-01 1.8931980431079865e-01 + -3.2082849740982056e-01 8.1871077418327332e-02 + <_> + + 0 1 807 -2.2203559638001025e-04 -1 2 808 + -2.5135980104096234e-04 -2 -3 809 -1.7842829402070493e-04 + + -2.9679200053215027e-01 -2.7259480953216553e-01 + -2.2551620006561279e-01 2.9105350375175476e-01 + <_> + + 1 0 810 2.2679679095745087e-02 -1 2 811 + -1.4839429641142488e-03 -2 -3 812 -9.7775906324386597e-02 + + 6.0594111680984497e-01 5.8346527814865112e-01 + -5.1989138126373291e-01 -2.1351039409637451e-02 + <_> + + 2 1 813 -2.1942430175840855e-03 0 -1 814 + 9.6272170543670654e-02 -2 -3 815 2.5899629108607769e-03 + + -2.3860040307044983e-01 4.5208680629730225e-01 + -3.2299709320068359e-01 2.3171809315681458e-01 + <_> + + 1 0 816 5.4749320261180401e-03 -1 2 817 + -1.4976410195231438e-02 -2 -3 818 -7.3499558493494987e-03 + + 2.6661419868469238e-01 -4.7525641322135925e-01 + 3.6936700344085693e-01 -1.0437080264091492e-01 + <_> + + 1 0 819 8.0258701927959919e-04 -1 2 820 + -3.1779240816831589e-03 -2 -3 821 -1.6361019515898079e-04 + + -2.6545119285583496e-01 -2.6746180653572083e-01 + -1.3902419805526733e-01 2.9700610041618347e-01 + <_> + + 1 0 822 -3.0408808961510658e-03 -1 2 823 + -1.2945629656314850e-02 -2 -3 824 -1.7983650788664818e-02 + + -1.0607139766216278e-01 -4.2864450812339783e-01 + 5.3250139951705933e-01 6.2068658880889416e-03 + <_> + + 1 0 825 3.5721210297197104e-03 2 -1 826 + 3.3481561113148928e-03 -2 -3 827 -2.7103780303150415e-04 + + 2.8643238544464111e-01 5.2708417177200317e-01 + -4.0083900094032288e-01 -1.1597709730267525e-02 + <_> + + 0 1 828 -3.5315480083227158e-02 -1 2 829 + -3.3448180183768272e-03 -2 -3 830 -3.6211799830198288e-02 + + -6.4248001575469971e-01 1.6799710690975189e-01 + -4.4045579433441162e-01 7.2158249095082283e-03 + <_> + + 1 0 831 9.7624881891533732e-04 2 -1 832 + 3.9304429083131254e-04 -2 -3 833 -9.0960100293159485e-02 + + -3.3223769068717957e-01 -2.9518169164657593e-01 + -2.6596671342849731e-01 1.9091020524501801e-01 + <_> + + 0 1 834 -9.7260335460305214e-03 2 -1 835 + 6.3109961338341236e-03 -2 -3 836 -1.8113269470632076e-04 + + 4.3416848778724670e-01 3.6779248714447021e-01 + -3.8609200716018677e-01 -2.1463580429553986e-02 + <_> + 33 + -1.2412749528884888e+00 + + <_> + + 2 1 837 2.1084180101752281e-02 0 -1 838 + -2.1115990821272135e-03 -2 -3 839 -3.7253301125019789e-03 + + 7.7905070781707764e-01 -9.1717608273029327e-02 + 3.5618048161268234e-02 -3.5509699583053589e-01 + <_> + + 2 1 840 -4.9224868416786194e-02 0 -1 841 + -1.2256789952516556e-02 -2 -3 842 -1.7591969808563590e-03 + + 2.3374380171298981e-01 -2.0726789534091949e-01 + 7.1231132745742798e-01 1.5468549728393555e-01 + <_> + + 1 0 843 -1.3072569854557514e-02 -1 2 844 + 1.0713989846408367e-02 -2 -3 845 2.7589630335569382e-03 + + -1.7413349449634552e-01 -1.3037489354610443e-01 + 4.3284869194030762e-01 -6.6202241182327271e-01 + <_> + + 0 1 846 -7.0322921965271235e-04 2 -1 847 + 3.2859561033546925e-03 -2 -3 848 -1.5731799649074674e-03 + + -4.2838820815086365e-01 -4.5926880836486816e-01 + -4.6182459592819214e-01 1.7856159806251526e-01 + <_> + + 0 1 849 -6.4174369908869267e-03 -1 2 850 + 1.6610589809715748e-03 -2 -3 851 1.5099810436367989e-02 + + -5.4262351989746094e-01 -6.4273983240127563e-02 + 4.0244659781455994e-01 -6.2330418825149536e-01 + <_> + + 1 0 852 1.6554270405322313e-03 -1 2 853 + -3.3705390524119139e-03 -2 -3 854 -1.0568870231509209e-02 + + -4.5953160524368286e-01 3.0769738554954529e-01 + 2.8306689858436584e-01 -1.5513870120048523e-01 + <_> + + 2 1 855 -1.5460990369319916e-02 0 -1 856 + 1.0563080199062824e-02 -2 -3 857 -2.5313820224255323e-03 + + -2.3533730208873749e-01 1.7863610386848450e-01 + -3.9789968729019165e-01 3.4673249721527100e-01 + <_> + + 1 2 858 -1.1370539665222168e-02 0 -1 859 + 5.1206751959398389e-04 -2 -3 860 2.0633509848266840e-03 + + 3.5862970352172852e-01 -2.6715761423110962e-01 + -2.3807419836521149e-01 8.9544452726840973e-02 + <_> + + 1 0 861 6.1831250786781311e-03 2 -1 862 + -1.5297930222004652e-03 -2 -3 863 -1.4521819539368153e-03 + + -3.4589260816574097e-01 -5.7744260877370834e-02 + -2.2643689811229706e-01 3.3492559194564819e-01 + <_> + + 1 0 864 9.1494834050536156e-03 -1 2 865 + -7.8258356079459190e-03 -2 -3 866 -9.1795083135366440e-03 + + -4.5102459192276001e-01 -2.0574240386486053e-01 + 2.8064918518066406e-01 -1.9400069490075111e-02 + <_> + + 1 0 867 5.2864141762256622e-03 -1 2 868 + -1.1895409785211086e-02 -2 -3 869 -2.9768719105049968e-04 + + 3.8742628693580627e-01 3.3122861385345459e-01 + -4.1473099589347839e-01 -4.6005301177501678e-02 + <_> + + 0 1 870 -9.9406214430928230e-03 -1 2 871 + 1.8322050891583785e-05 -2 -3 872 -8.9074727147817612e-03 + + -6.0510438680648804e-01 -1.5049360692501068e-01 + 4.3751770257949829e-01 4.4532001018524170e-02 + <_> + + 1 2 873 2.7458940166980028e-04 0 -1 874 + -1.0605080024106428e-04 -2 -3 875 1.3431450352072716e-02 + + 3.4243520349264145e-02 -3.1917920708656311e-01 + 5.4285280406475067e-02 5.1082128286361694e-01 + <_> + + 0 1 876 1.7373449736624025e-05 2 -1 877 + 2.6647070626495406e-05 -2 -3 878 2.8135200409451500e-05 + + -1.3858599960803986e-01 2.9074499011039734e-01 + -5.2693158388137817e-01 6.1677869409322739e-02 + <_> + + 1 0 879 -1.4079789980314672e-04 -1 2 880 + -1.0311259888112545e-02 -2 -3 881 -2.7866840362548828e-02 + + -1.4329759776592255e-01 -4.7958651185035706e-01 + 3.8226899504661560e-01 1.0630049742758274e-02 + <_> + + 1 0 882 5.8228662237524986e-03 2 -1 883 + -8.7669547647237778e-03 -2 -3 884 -2.8466230724006891e-03 + + 2.9776591062545776e-01 -1.8124760687351227e-01 + -2.4237589538097382e-01 3.0139160156250000e-01 + <_> + + 1 0 885 6.4540808089077473e-03 2 -1 886 + 6.9421119987964630e-03 -2 -3 887 -7.1991360746324062e-03 + + -4.7911441326141357e-01 -3.8983830809593201e-01 + -3.8099661469459534e-01 1.3023279607295990e-01 + <_> + + 1 0 888 1.3020260259509087e-02 -1 2 889 + -1.0113810189068317e-02 -2 -3 890 -1.9183289259672165e-02 + + 4.9582180380821228e-01 4.5563331246376038e-01 + 3.3518138527870178e-01 -1.1938130110502243e-01 + <_> + + 1 2 891 1.0314499959349632e-03 0 -1 892 + 5.7669691159389913e-05 -2 -3 893 5.0447430461645126e-02 + + -3.5977721214294434e-01 2.6054680347442627e-02 + 1.6761170327663422e-01 -2.8970599174499512e-01 + <_> + + 1 0 894 3.7453400436788797e-03 2 -1 895 + 4.7667181206634268e-05 -2 -3 896 -5.3708041377831250e-05 + + -4.6433079242706299e-01 1.8610210716724396e-01 + 5.6288938969373703e-02 -4.2427191138267517e-01 + <_> + + 0 1 897 -6.5939482301473618e-03 -1 2 898 + -2.1548079326748848e-02 -2 -3 899 1.3188139535486698e-02 + + -4.7423711419105530e-01 -4.2937740683555603e-01 + 1.1677609756588936e-02 4.2440900206565857e-01 + <_> + + 1 0 900 1.2091189622879028e-02 2 -1 901 + -6.2589373555965722e-05 -2 -3 902 1.9446300575509667e-03 + + 2.3611229658126831e-01 -2.1822200715541840e-01 + -2.5404209271073341e-02 4.2902240157127380e-01 + <_> + + 1 0 903 7.7299331314861774e-03 -1 2 904 + -3.7915860302746296e-03 -2 -3 905 4.3860040605068207e-03 + + -5.3524547815322876e-01 -4.3546271324157715e-01 + 1.2576849758625031e-01 -2.8148999810218811e-01 + <_> + + 1 0 906 -9.4350852305069566e-04 -1 2 907 + -1.1670179665088654e-03 -2 -3 908 2.9260620940476656e-03 + + -1.7022730410099030e-01 2.6141870021820068e-01 + -1.7437639832496643e-01 3.8530299067497253e-01 + <_> + + 1 0 909 1.4593300409615040e-02 2 -1 910 + 7.9177077859640121e-03 -2 -3 911 -3.1372120138257742e-03 + + -5.5104351043701172e-01 2.7703890204429626e-01 + 1.3093240559101105e-01 -1.6954340040683746e-01 + <_> + + 1 2 912 -9.2021061573177576e-04 0 -1 913 + -1.0446259751915932e-02 -2 -3 914 -8.3597414195537567e-03 + + 4.4468599557876587e-01 -3.9477398991584778e-01 + 3.4909680485725403e-01 -1.0887180455029011e-02 + <_> + + 0 1 915 -9.7741633653640747e-03 -1 2 916 + 1.2587079778313637e-02 -2 -3 917 -1.4933859929442406e-03 + + 2.1157720685005188e-01 -1.4542940258979797e-01 + -1.5098230540752411e-01 5.0790101289749146e-01 + <_> + + 0 1 918 -5.0530377775430679e-03 -1 2 919 + -2.5890849065035582e-04 -2 -3 920 4.8418638471048325e-05 + + -2.3845790326595306e-01 -2.5153321027755737e-01 + -2.4533210322260857e-02 3.0376350879669189e-01 + <_> + + 1 0 921 2.3038890212774277e-03 2 -1 922 + 3.6540660075843334e-03 -2 -3 923 -3.3346249256283045e-03 + + 2.8125861287117004e-01 -3.6965739727020264e-01 + -3.0266079306602478e-01 8.8287420570850372e-02 + <_> + + 0 1 924 -1.1975349858403206e-02 -1 2 925 + -1.8564870115369558e-03 -2 -3 926 1.5760740498080850e-03 + + -4.6360239386558533e-01 3.9942011237144470e-01 + -1.1057750135660172e-01 1.6782909631729126e-01 + <_> + + 1 0 927 4.1210349649190903e-02 2 -1 928 + -1.0635109618306160e-02 -2 -3 929 -3.3335660118609667e-03 + + -6.8945991992950439e-01 -9.5825389027595520e-02 + -4.6437320113182068e-01 2.2104820609092712e-01 + <_> + + 0 1 930 -2.4082309100776911e-03 2 -1 931 + 5.5890781804919243e-03 -2 -3 932 1.2177750468254089e-03 + + 2.0128449797630310e-01 -5.2314841747283936e-01 + 3.1367950141429901e-02 -4.1038578748703003e-01 + <_> + + 1 0 933 8.6324941366910934e-03 2 -1 934 + 3.8473210297524929e-03 -2 -3 935 -1.8842349527403712e-03 + + 3.1741571426391602e-01 -4.3851628899574280e-01 + 3.8140851259231567e-01 -6.0103170573711395e-02 + <_> + 41 + -1.2084549665451050e+00 + + <_> + + 1 0 936 -2.3675959557294846e-02 -1 2 937 + -2.0480139646679163e-03 -2 -3 938 8.1840698840096593e-04 + + -3.5308888554573059e-01 6.9878387451171875e-01 + -2.8367671370506287e-01 4.1667369008064270e-01 + <_> + + 1 2 939 1.2784999562427402e-03 0 -1 940 + -3.4423400647938251e-03 -2 -3 941 -7.4483961798250675e-03 + + 3.3807888627052307e-01 -1.6657039523124695e-01 + 6.4591968059539795e-01 -2.2018529474735260e-01 + <_> + + 0 1 942 1.1179470457136631e-02 2 -1 943 + -2.3196099698543549e-01 -2 -3 944 -4.3133709579706192e-02 + + -3.2552671432495117e-01 -8.3167977631092072e-02 + -1.6172540187835693e-01 4.6209758520126343e-01 + <_> + + 1 0 945 -1.9728920597117394e-04 -1 2 946 + -2.3259329609572887e-03 -2 -3 947 -1.0320080444216728e-02 + + -1.5667790174484253e-01 3.6914899945259094e-01 + 4.8015019297599792e-01 -8.9061602950096130e-02 + <_> + + 0 1 948 -2.0040970295667648e-02 -1 2 949 + -2.4495070101693273e-04 -2 -3 950 -1.1836830526590347e-03 + + -5.6967437267303467e-01 -2.3713299632072449e-01 + -3.4671390056610107e-01 1.4475019276142120e-01 + <_> + + 1 0 951 -2.6744368951767683e-03 2 -1 952 + -5.1904888823628426e-03 -2 -3 953 -1.9888129085302353e-02 + + -1.2661710381507874e-01 -6.4648993313312531e-02 + -4.5441371202468872e-01 3.9849451184272766e-01 + <_> + + 0 1 954 -5.7462421245872974e-03 2 -1 955 + 4.4583589769899845e-03 -2 -3 956 -1.2518949806690216e-02 + + -3.6761870980262756e-01 3.8435870409011841e-01 + -6.1902827024459839e-01 1.9050609320402145e-02 + <_> + + 0 1 957 -7.7734276652336121e-02 2 -1 958 + 6.7193829454481602e-03 -2 -3 959 1.6520710196346045e-03 + + 5.5405282974243164e-01 -4.1308841109275818e-01 + 7.3280662298202515e-02 -2.8589090704917908e-01 + <_> + + 1 0 960 2.1226350218057632e-02 2 -1 961 + 1.1231450363993645e-02 -2 -3 962 -1.8163130152970552e-04 + + 3.6871838569641113e-01 3.5591110587120056e-01 + -3.3781459927558899e-01 -8.1584807485342026e-03 + <_> + + 1 0 963 2.8726160526275635e-02 2 -1 964 + 5.0780461169779301e-03 -2 -3 965 -5.1352521404623985e-04 + + -7.2751021385192871e-01 2.6649999618530273e-01 + 1.1073680222034454e-01 -1.8206079304218292e-01 + <_> + + 0 1 966 -3.8125980645418167e-03 2 -1 967 + 9.1425428399816155e-04 -2 -3 968 1.0090490104630589e-03 + + -2.8374129533767700e-01 2.4259260296821594e-01 + 6.0151178389787674e-02 -2.7039301395416260e-01 + <_> + + 0 1 969 -7.8553140163421631e-02 -1 2 970 + -6.5192081965506077e-03 -2 -3 971 2.0706290379166603e-03 + + -5.5804842710494995e-01 2.5557601451873779e-01 + -1.0600800067186356e-01 2.7225118875503540e-01 + <_> + + 1 0 972 1.3555780053138733e-02 -1 2 973 + 7.0873757067602128e-05 -2 -3 974 -1.4444560511037707e-03 + + -4.8073831200599670e-01 -1.3499049842357635e-01 + 4.3762150406837463e-01 4.8329260200262070e-02 + <_> + + 1 0 975 -3.6353049799799919e-03 -1 2 976 + -2.7163419872522354e-03 -2 -3 977 -7.4552530422806740e-03 + + -1.2743209302425385e-01 3.3708488941192627e-01 + 5.4894310235977173e-01 -1.0238330066204071e-01 + <_> + + 1 2 978 1.8306199926882982e-03 0 -1 979 + 3.5198179539293051e-03 -2 -3 980 -3.0126908677630126e-04 + + -2.4612280726432800e-01 1.5894930064678192e-01 + -2.7785000205039978e-01 2.3901990056037903e-01 + <_> + + 2 1 981 3.1999459024518728e-03 0 -1 982 + 1.4862619573250413e-03 -2 -3 983 -1.3004139764234424e-03 + + 4.7738438844680786e-01 -3.1345888972282410e-02 + 7.1047246456146240e-02 -2.1556860208511353e-01 + <_> + + 1 0 984 1.5583000145852566e-02 2 -1 985 + 7.6356581412255764e-03 -2 -3 986 -1.4318820321932435e-03 + + 2.7187249064445496e-01 -5.1074218750000000e-01 + -1.5140180289745331e-01 1.4207449555397034e-01 + <_> + + 1 2 987 -6.7814798094332218e-03 0 -1 988 + -1.1809200048446655e-01 -2 -3 989 -2.8277190402150154e-02 + + -6.9562858343124390e-01 3.3270710706710815e-01 + 1.1135250329971313e-01 -1.7491710186004639e-01 + <_> + + 0 1 990 -3.7033241242170334e-02 -1 2 991 + -4.9177031032741070e-03 -2 -3 992 -2.7518879505805671e-04 + + 2.8885498642921448e-01 -4.0966060757637024e-01 + -3.1160330772399902e-01 6.0995019972324371e-02 + <_> + + 0 1 993 -2.3584270384162664e-03 -1 2 994 + -3.5775059368461370e-03 -2 -3 995 -4.1078119538724422e-03 + + -5.9846490621566772e-01 2.4603059887886047e-01 + 8.5180006921291351e-02 -2.0629020035266876e-01 + <_> + + 1 0 996 1.5300850383937359e-02 -1 2 997 + -1.5483479946851730e-02 -2 -3 998 -5.7852710597217083e-03 + + 3.0057510733604431e-01 -6.8350881338119507e-01 + 2.0100210607051849e-01 -9.0607739984989166e-02 + <_> + + 1 0 999 1.4448310248553753e-02 -1 2 1000 + -3.1330309808254242e-02 -2 -3 1001 -3.0594000127166510e-03 + + 2.6733011007308960e-01 -5.2288150787353516e-01 + 4.0950208902359009e-01 -6.5823979675769806e-02 + <_> + + 0 1 1002 -1.8781309481710196e-03 2 -1 1003 + -5.8503728359937668e-03 -2 -3 1004 2.6462681125849485e-03 + + -2.5463208556175232e-01 -1.2269999831914902e-01 + -7.9216457903385162e-02 2.9203468561172485e-01 + <_> + + 0 1 1005 1.3989449944347143e-03 2 -1 1006 + 9.7635984420776367e-03 -2 -3 1007 -9.4864349812269211e-03 + + 1.2148520350456238e-01 2.7110511064529419e-01 + 1.0176890343427658e-01 -3.2153740525245667e-01 + <_> + + 1 0 1008 1.5739769442006946e-03 2 -1 1009 + 4.9365921877324581e-03 -2 -3 1010 -5.0848699174821377e-04 + + -5.9908610582351685e-01 -3.8752740621566772e-01 + -1.3056530058383942e-01 1.2711940705776215e-01 + <_> + + 0 1 1011 -9.6375271677970886e-02 -1 2 1012 + -8.0375596880912781e-02 -2 -3 1013 -5.4449690505862236e-03 + + -6.8821328878402710e-01 4.1428178548812866e-01 + 8.2179926335811615e-02 -1.8036940693855286e-01 + <_> + + 0 1 1014 -7.6126731000840664e-03 2 -1 1015 + -3.1007949728518724e-03 -2 -3 1016 -2.0799610763788223e-02 + + 1.7513050138950348e-01 -2.1534129977226257e-01 + 2.9026609659194946e-01 -2.1753519773483276e-01 + <_> + + 0 1 1017 -1.7213800549507141e-01 -1 2 1018 + -1.7464880365878344e-03 -2 -3 1019 -6.8416520953178406e-02 + + 2.2739590704441071e-01 1.3240070641040802e-01 + -6.2430542707443237e-01 -1.0549639910459518e-01 + <_> + + 0 1 1020 -1.9070530310273170e-02 -1 2 1021 + -2.8794098761864007e-04 -2 -3 1022 7.3958968278020620e-04 + + 5.5033868551254272e-01 -3.4565579891204834e-01 + 1.8934780359268188e-01 -8.8741242885589600e-02 + <_> + + 0 1 1023 -7.5153419747948647e-03 -1 2 1024 + -1.2848030310124159e-03 -2 -3 1025 1.2194210430607200e-03 + + -4.5797100663185120e-01 1.2825480103492737e-01 + -2.9630279541015625e-01 1.9254499673843384e-01 + <_> + + 1 2 1026 -1.6169670224189758e-01 0 -1 1027 + 1.4747560024261475e-02 -2 -3 1028 -8.4396981401368976e-04 + + -4.4868141412734985e-01 1.3941350579261780e-01 + 2.0387759804725647e-01 -5.6935109198093414e-02 + <_> + + 1 0 1029 -1.2965890346094966e-04 -1 2 1030 + -1.3776419684290886e-02 -2 -3 1031 -9.4375656917691231e-03 + + -1.4722099900245667e-01 2.4039970338344574e-01 + 5.5077737569808960e-01 -1.5877890586853027e-01 + <_> + + 1 0 1032 1.1291690316284075e-04 -1 2 1033 + 6.6032530739903450e-03 -2 -3 1034 2.0985701121389866e-03 + + 1.3769179582595825e-01 -2.5903069972991943e-01 + 2.3297089338302612e-01 -3.7152260541915894e-01 + <_> + + 2 1 1035 -1.8329389858990908e-03 0 -1 1036 + -1.6420709434896708e-03 -2 -3 1037 6.7886798642575741e-03 + + 3.5991749167442322e-01 -1.5401339530944824e-01 + 1.8581290543079376e-01 -6.7269998788833618e-01 + <_> + + 0 1 1038 1.6932019498199224e-03 -1 2 1039 + -1.0055249556899071e-02 -2 -3 1040 -3.1679549720138311e-03 + + -1.3255499303340912e-01 3.8144260644912720e-01 + 3.2224041223526001e-01 -8.5345722734928131e-02 + <_> + + 2 1 1041 2.4724518880248070e-04 0 -1 1042 + -2.4610899854451418e-03 -2 -3 1043 4.2370590381324291e-04 + + 2.4504560232162476e-01 -4.2068049311637878e-01 + 9.6731372177600861e-02 -3.6695280671119690e-01 + <_> + + 1 2 1044 -2.3991330526769161e-03 0 -1 1045 + -1.0543569922447205e-01 -2 -3 1046 -2.9867719858884811e-03 + + -7.3811298608779907e-01 2.8551021218299866e-01 + 1.9291989505290985e-01 -1.4805729687213898e-01 + <_> + + 0 1 1047 -4.0492648258805275e-03 2 -1 1048 + -1.1622729944065213e-03 -2 -3 1049 -2.7857329696416855e-02 + + 1.0766500234603882e-01 -2.7701449394226074e-01 + 3.9593660831451416e-01 -2.0954720675945282e-01 + <_> + + 2 1 1050 8.1511605530977249e-03 0 -1 1051 + 1.5126319602131844e-02 -2 -3 1052 -1.1020600050687790e-01 + + 6.8626463413238525e-02 5.3772068023681641e-01 + -4.9161431193351746e-01 -4.4780239462852478e-02 + <_> + + 1 2 1053 -1.6588929574936628e-03 0 -1 1054 + -3.4530278295278549e-02 -2 -3 1055 1.0060180211439729e-03 + + 3.6734369397163391e-01 -2.5586590170860291e-02 + 2.7465619146823883e-02 -3.4973311424255371e-01 + <_> + + 0 1 1056 -2.8843909502029419e-02 2 -1 1057 + 2.4647780810482800e-04 -2 -3 1058 -7.4189889710396528e-04 + + -6.5100878477096558e-01 -1.8410819768905640e-01 + -9.0942107141017914e-02 2.2521719336509705e-01 + <_> + 37 + -1.2229189872741699e+00 + + <_> + + 1 2 1059 -1.2407599948346615e-02 0 -1 1060 + -1.1902820318937302e-02 -2 -3 1061 -5.5238649249076843e-02 + + 6.8965518474578857e-01 -1.3579159975051880e-01 + -4.4337168335914612e-02 -4.5446300506591797e-01 + <_> + + 1 2 1062 3.3332619350403547e-03 0 -1 1063 + 4.8620607703924179e-03 -2 -3 1064 -3.1632129102945328e-03 + + -3.1873029470443726e-01 7.0181049406528473e-02 + -3.2160758972167969e-01 7.0131868124008179e-01 + <_> + + 1 0 1065 1.8592040240764618e-01 -1 2 1066 + 3.1807690393179655e-03 -2 -3 1067 -9.4139128923416138e-03 + + 3.4192711114883423e-01 -3.3313518762588501e-01 + 3.2091590762138367e-01 -1.2491060048341751e-01 + <_> + + 1 0 1068 6.5205397550016642e-04 2 -1 1069 + -5.0521180965006351e-03 -2 -3 1070 7.6105687767267227e-03 + + -2.3811559379100800e-01 -1.4155420660972595e-01 + 3.2182168960571289e-01 -2.4797810614109039e-01 + <_> + + 0 1 1071 -1.6043110517784953e-03 -1 2 1072 + -2.7449749410152435e-02 -2 -3 1073 5.6960887741297483e-04 + + 1.9883860647678375e-01 -6.9581168889999390e-01 + 5.0723928958177567e-02 -2.9218611121177673e-01 + <_> + + 1 0 1074 2.7564789634197950e-03 2 -1 1075 + -1.1058920063078403e-02 -2 -3 1076 5.1102549768984318e-03 + + 2.0911119878292084e-01 -2.4516950547695160e-01 + -1.0658439993858337e-01 4.0211549401283264e-01 + <_> + + 1 0 1077 4.5064617879688740e-03 2 -1 1078 + 4.2800018563866615e-03 -2 -3 1079 7.8124259598553181e-03 + + -4.6300640702247620e-01 -3.9396348595619202e-01 + 1.4130340516567230e-01 -2.8671020269393921e-01 + <_> + + 1 0 1080 4.4836059212684631e-02 2 -1 1081 + 1.7986740916967392e-02 -2 -3 1082 -6.0726520605385303e-03 + + -5.0257712602615356e-01 3.1318759918212891e-01 + 9.8504282534122467e-02 -2.2500780224800110e-01 + <_> + + 0 1 1083 -1.8578730523586273e-02 2 -1 1084 + 3.5717431455850601e-02 -2 -3 1085 -1.8269789870828390e-03 + + -5.1453977823257446e-01 3.1848269701004028e-01 + 1.4090469479560852e-01 -1.8669110536575317e-01 + <_> + + 0 1 1086 -5.4818098433315754e-03 -1 2 1087 + -6.0164718888700008e-04 -2 -3 1088 9.9322739988565445e-03 + + 1.9321410357952118e-01 -3.8167670369148254e-01 + -5.8519419282674789e-02 4.8970058560371399e-01 + <_> + + 2 1 1089 1.4053160557523370e-03 0 -1 1090 + 5.2271760068833828e-03 -2 -3 1091 -1.4931050129234791e-02 + + 2.5072118639945984e-01 -6.5754747390747070e-01 + 5.5669851601123810e-02 -2.4669079482555389e-01 + <_> + + 1 2 1092 -1.2826359830796719e-02 0 -1 1093 + -2.7587350457906723e-02 -2 -3 1094 -4.7543710097670555e-03 + + -3.2225701212882996e-01 5.6484752893447876e-01 + -4.9142929911613464e-01 -8.8634714484214783e-03 + <_> + + 0 1 1095 -2.7212230488657951e-03 2 -1 1096 + 6.6132671199738979e-03 -2 -3 1097 -1.1435840278863907e-02 + + -5.7900500297546387e-01 4.5554360747337341e-01 + 1.5250509977340698e-01 -1.2167599797248840e-01 + <_> + + 0 1 1098 -1.9095990806818008e-02 2 -1 1099 + -1.2672290205955505e-01 -2 -3 1100 -1.8373519182205200e-02 + + -4.4416400790214539e-01 1.1622429639101028e-01 + 4.1248679161071777e-01 -3.0303838849067688e-01 + <_> + + 0 1 1101 -3.2425698637962341e-01 -1 2 1102 + -3.8764779455959797e-03 -2 -3 1103 -7.5138150714337826e-04 + + 4.4721060991287231e-01 7.5931303203105927e-02 + 1.1976880021393299e-02 -3.6275759339332581e-01 + <_> + + 1 0 1104 6.7106341011822224e-03 -1 2 1105 + -6.5366760827600956e-03 -2 -3 1106 -5.5684632388874888e-04 + + -3.9521178603172302e-01 -3.0311599373817444e-01 + -1.5832960605621338e-01 1.7123879492282867e-01 + <_> + + 0 1 1107 -3.9269351400434971e-03 -1 2 1108 + -1.6322469338774681e-02 -2 -3 1109 5.5038761347532272e-02 + + 2.0034509897232056e-01 4.1271069645881653e-01 + -1.7926050722599030e-01 2.6303529739379883e-01 + <_> + + 1 2 1110 1.0095089673995972e-03 0 -1 1111 + -9.8581332713365555e-03 -2 -3 1112 -7.0780781097710133e-03 + + 2.4884219467639923e-01 -3.9200861006975174e-02 + 3.7243181467056274e-01 -3.7739849090576172e-01 + <_> + + 1 0 1113 2.1169960964471102e-03 2 -1 1114 + 1.5883900225162506e-01 -2 -3 1115 -4.2488988488912582e-02 + + 1.7665450274944305e-01 7.2631222009658813e-01 + 4.8568719625473022e-01 -1.4427030086517334e-01 + <_> + + 0 1 1116 -9.4166352937463671e-05 -1 2 1117 + 8.1764090282376856e-05 -2 -3 1118 5.4165818728506565e-03 + + 1.7045879364013672e-01 -3.1940829753875732e-01 + 9.9846661090850830e-02 -4.1059550642967224e-01 + <_> + + 0 1 1119 -6.1865211464464664e-03 2 -1 1120 + 6.5089072450064123e-05 -2 -3 1121 -6.8352972448337823e-05 + + -3.8492518663406372e-01 1.6319459676742554e-01 + 2.1182140707969666e-01 -2.5311520695686340e-01 + <_> + + 1 2 1122 -4.0968839311972260e-04 0 -1 1123 + 3.5239830613136292e-03 -2 -3 1124 -8.3400387666188180e-05 + + -1.1859580129384995e-01 -7.9780608415603638e-01 + 2.2940699756145477e-01 -3.8782458752393723e-02 + <_> + + 1 2 1125 -2.7096238918602467e-03 0 -1 1126 + -6.8883160129189491e-03 -2 -3 1127 1.1571759823709726e-03 + + -5.9978920221328735e-01 3.4748208522796631e-01 + -1.5406990051269531e-01 1.3573920726776123e-01 + <_> + + 0 1 1128 9.5913361292332411e-04 -1 2 1129 + -1.8333569169044495e-02 -2 -3 1130 2.4258090183138847e-02 + + -1.0236030071973801e-01 -5.5400210618972778e-01 + 1.4270070195198059e-01 7.2077578306198120e-01 + <_> + + 2 1 1131 1.0541410185396671e-02 0 -1 1132 + 9.1231325641274452e-03 -2 -3 1133 -1.4598550042137504e-03 + + 1.9214800000190735e-01 -3.6190611124038696e-01 + 2.8950750827789307e-01 -1.8767410516738892e-01 + <_> + + 0 1 1134 -1.1819070205092430e-02 -1 2 1135 + -3.2446000725030899e-02 -2 -3 1136 -2.3319718893617392e-03 + + -5.3653758764266968e-01 -6.8713748455047607e-01 + -8.8751368224620819e-02 1.5991990268230438e-01 + <_> + + 1 2 1137 -6.5151029266417027e-03 0 -1 1138 + 2.5015550199896097e-03 -2 -3 1139 7.8799802577123046e-04 + + 6.8285889923572540e-02 5.7962691783905029e-01 + -1.9128720462322235e-01 9.7289860248565674e-02 + <_> + + 1 0 1140 6.0783070512115955e-03 -1 2 1141 + -8.7201576679944992e-03 -2 -3 1142 3.5847601247951388e-04 + + -6.1147671937942505e-01 4.7648158669471741e-01 + 9.0117119252681732e-02 -1.6770669817924500e-01 + <_> + + 1 0 1143 -1.3178629800677299e-02 -1 2 1144 + -8.5365071892738342e-02 -2 -3 1145 3.3002009149640799e-03 + + -1.2755720317363739e-01 2.6924338936805725e-01 + -1.8480269610881805e-01 5.8760780096054077e-01 + <_> + + 0 1 1146 -1.1601460166275501e-02 2 -1 1147 + 9.9076535552740097e-03 -2 -3 1148 4.3782261200249195e-03 + + 3.3849120140075684e-01 -5.5809050798416138e-01 + -7.8933097422122955e-02 2.2385579347610474e-01 + <_> + + 0 1 1149 -4.7082178294658661e-02 -1 2 1150 + -3.2685339101590216e-04 -2 -3 1151 7.8715756535530090e-03 + + 6.8917119503021240e-01 1.2139579653739929e-01 + -7.5880296528339386e-02 -6.5191179513931274e-01 + <_> + + 1 2 1152 -3.9275310700759292e-04 0 -1 1153 + -3.4211258753202856e-04 -2 -3 1154 5.6030962150543928e-04 + + -3.4082669019699097e-01 3.7230521440505981e-01 + 1.8275870010256767e-02 -2.7192598581314087e-01 + <_> + + 0 1 1155 -2.4439349770545959e-02 -1 2 1156 + 1.2128120288252831e-02 -2 -3 1157 2.2948130499571562e-03 + + -3.4894740581512451e-01 -4.1957078501582146e-03 + -2.0841300487518311e-02 8.0151557922363281e-01 + <_> + + 1 2 1158 -3.6386020947247744e-03 0 -1 1159 + -6.3949287869036198e-04 -2 -3 1160 2.0897389913443476e-04 + + -2.5389778614044189e-01 3.6606290936470032e-01 + -1.4177979528903961e-01 1.4148280024528503e-01 + <_> + + 2 1 1161 -6.7888460762333125e-05 0 -1 1162 + 3.9580671000294387e-04 -2 -3 1163 1.2493260437622666e-03 + + -2.0807999372482300e-01 2.3690980672836304e-01 + 2.4679720401763916e-01 -2.2032499313354492e-01 + <_> + + 0 1 1164 -4.6679278602823615e-04 -1 2 1165 + 1.1740219779312611e-03 -2 -3 1166 -7.1949949488043785e-03 + + -3.3990928530693054e-01 1.2153220176696777e-01 + 3.3542940020561218e-01 -3.9178979396820068e-01 + <_> + + 1 0 1167 3.2422799267806113e-04 2 -1 1168 + 2.4374879896640778e-02 -2 -3 1169 2.6271429378539324e-03 + + -2.5593858957290649e-01 4.2434880137443542e-01 + 1.0237640142440796e-01 -2.6907420158386230e-01 + <_> + 32 + -1.2001949548721313e+00 + + <_> + + 1 0 1170 -1.8586540594696999e-02 -1 2 1171 + -7.4109081178903580e-03 -2 -3 1172 -5.3711149841547012e-02 + + -3.6523258686065674e-01 7.7427452802658081e-01 + 2.4213680624961853e-01 -3.7803840637207031e-01 + <_> + + 1 2 1173 6.9198510609567165e-03 0 -1 1174 + -3.0759189277887344e-02 -2 -3 1175 -8.9597534388303757e-03 + + 1.3523690402507782e-01 -2.7957341074943542e-01 + -6.0680317878723145e-01 6.9579082727432251e-01 + <_> + + 1 0 1176 7.1816287934780121e-02 2 -1 1177 + -1.1622999794781208e-02 -2 -3 1178 -1.0627550072968006e-03 + + 3.0647501349449158e-01 -2.2690390050411224e-01 + 4.4374391436576843e-01 -3.1824579834938049e-01 + <_> + + 0 1 1179 -7.3452957440167665e-04 -1 2 1180 + -4.9303710460662842e-02 -2 -3 1181 -3.2011170405894518e-03 + + -2.2684609889984131e-01 3.4253200888633728e-01 + 3.0913218855857849e-01 -2.0078240334987640e-01 + <_> + + 2 1 1182 1.4706649817526340e-02 0 -1 1183 + -1.1798519641160965e-01 -2 -3 1184 -1.6695359721779823e-02 + + -9.4517791271209717e-01 5.7428210973739624e-01 + 2.4567030370235443e-01 -1.1707650125026703e-01 + <_> + + 1 2 1185 -6.8853241391479969e-03 0 -1 1186 + 7.8145717270672321e-04 -2 -3 1187 2.7586790919303894e-01 + + 3.9508721232414246e-01 -1.0023059695959091e-01 + -1.4659850299358368e-01 7.7942031621932983e-01 + <_> + + 0 1 1188 -2.6423679664731026e-02 -1 2 1189 + 1.8955089617520571e-03 -2 -3 1190 -5.7396688498556614e-03 + + -3.2860249280929565e-01 1.5046370029449463e-01 + -4.0492990612983704e-01 1.5257360041141510e-01 + <_> + + 0 1 1191 -7.8677870333194733e-03 -1 2 1192 + -1.9029570103157312e-04 -2 -3 1193 2.9406580142676830e-04 + + 2.2024929523468018e-01 -3.7222158908843994e-01 + 1.0350369662046432e-01 -3.6075070500373840e-01 + <_> + + 2 1 1194 -6.1921158339828253e-04 0 -1 1195 + -4.6625699847936630e-02 -2 -3 1196 8.0430079833604395e-05 + + 2.5249621272087097e-01 -3.2340309023857117e-01 + -8.7712243199348450e-02 2.5224068760871887e-01 + <_> + + 1 0 1197 2.9532159678637981e-03 -1 2 1198 + -4.5338911004364491e-03 -2 -3 1199 -1.1544080451130867e-02 + + 4.8171079158782959e-01 -4.5188549160957336e-01 + 2.5434678792953491e-01 -8.4140419960021973e-02 + <_> + + 0 1 1200 1.3043760554865003e-03 -1 2 1201 + -3.4115801099687815e-03 -2 -3 1202 -1.5855060191825032e-03 + + -1.0121349990367889e-01 5.2193498611450195e-01 + 6.8923211097717285e-01 -1.0570000112056732e-01 + <_> + + 0 1 1203 -2.9867749661207199e-02 2 -1 1204 + -2.5652049225755036e-04 -2 -3 1205 -3.9234450086951256e-03 + + -4.3362548947334290e-01 -3.3430889248847961e-02 + -2.5569188594818115e-01 4.4265130162239075e-01 + <_> + + 1 0 1206 4.6491571702063084e-03 -1 2 1207 + -2.7727609872817993e-01 -2 -3 1208 -2.2448340058326721e-01 + + 6.2878167629241943e-01 7.1006447076797485e-01 + 3.0520048737525940e-01 -9.2947281897068024e-02 + <_> + + 2 1 1209 3.8704689592123032e-02 0 -1 1210 + 8.2667707465589046e-04 -2 -3 1211 3.5339579335413873e-04 + + -7.1300238370895386e-01 3.4036791324615479e-01 + -2.7960309386253357e-01 4.1289128363132477e-02 + <_> + + 1 2 1212 1.2603959999978542e-02 0 -1 1213 + -5.5078358855098486e-05 -2 -3 1214 9.1213081032037735e-03 + + 6.5844729542732239e-02 -2.0295199751853943e-01 + 5.0578397512435913e-01 -2.8807151317596436e-01 + <_> + + 0 1 1215 -4.0084728971123695e-03 2 -1 1216 + 4.4780140742659569e-03 -2 -3 1217 -4.7284600441344082e-04 + + 2.1491059660911560e-01 2.1849650144577026e-01 + -6.7471832036972046e-01 -1.0888069868087769e-01 + <_> + + 0 1 1218 -3.7310249172151089e-04 -1 2 1219 + -1.0922510176897049e-02 -2 -3 1220 2.5496890768408775e-02 + + 1.7151309549808502e-01 4.2335990071296692e-01 + -2.3464329540729523e-01 1.9871939718723297e-01 + <_> + + 1 0 1221 7.0709688588976860e-03 -1 2 1222 + 3.5252509405836463e-04 -2 -3 1223 5.8937398716807365e-04 + + -4.3551680445671082e-01 -6.1764400452375412e-02 + -7.9512260854244232e-02 4.0493848919868469e-01 + <_> + + 2 1 1224 -8.7519101798534393e-03 0 -1 1225 + -9.4158039428293705e-04 -2 -3 1226 -8.8366247713565826e-02 + + 7.1111567318439484e-02 -3.1814581155776978e-01 + -5.9796679019927979e-01 1.9428940117359161e-01 + <_> + + 2 1 1227 4.5438520610332489e-03 0 -1 1228 + -1.3041470199823380e-02 -2 -3 1229 3.2197220716625452e-03 + + -2.1855579316616058e-01 3.0563870072364807e-01 + -1.9010399281978607e-01 1.8796740472316742e-01 + <_> + + 1 0 1230 3.2370660454034805e-02 2 -1 1231 + 8.7954197078943253e-03 -2 -3 1232 -8.5182236507534981e-03 + + -1.6135400533676147e-01 6.6259282827377319e-01 + -3.8733869791030884e-01 1.3088770210742950e-01 + <_> + + 1 2 1233 -5.4210029542446136e-02 0 -1 1234 + 2.9004408861510456e-04 -2 -3 1235 -1.2670000083744526e-02 + + -1.8559680320322514e-03 5.0099188089370728e-01 + 2.9727068543434143e-01 -1.6530840098857880e-01 + <_> + + 1 0 1236 3.7995529174804688e-01 -1 2 1237 + -4.8071850091218948e-02 -2 -3 1238 6.4968131482601166e-03 + + 4.2289760708808899e-01 1.1011490225791931e-01 + -2.6050418615341187e-01 1.7244240641593933e-01 + <_> + + 1 0 1239 -2.0901230163872242e-03 -1 2 1240 + -6.2400829046964645e-03 -2 -3 1241 8.5770338773727417e-03 + + -1.4854459464550018e-01 3.5841208696365356e-01 + -2.1481679379940033e-01 2.1504589915275574e-01 + <_> + + 1 2 1242 -6.6754068247973919e-03 0 -1 1243 + -3.8183759897947311e-03 -2 -3 1244 5.5124791106209159e-04 + + -2.3905350267887115e-01 4.4719010591506958e-01 + -2.5307258963584900e-01 3.4307420253753662e-02 + <_> + + 2 1 1245 9.0955598279833794e-03 0 -1 1246 + 1.1171290278434753e-01 -2 -3 1247 -1.7274810234084725e-03 + + -6.5154308080673218e-01 -2.6602389290928841e-02 + 6.1791652441024780e-01 2.7143610641360283e-02 + <_> + + 1 2 1248 7.5292278779670596e-04 0 -1 1249 + -3.1208951259031892e-04 -2 -3 1250 1.3574779732152820e-03 + + -5.5061008781194687e-02 2.7939450740814209e-01 + -2.9496839642524719e-01 2.3769420385360718e-01 + <_> + + 1 0 1251 2.6001129299402237e-02 2 -1 1252 + -5.1486152224242687e-03 -2 -3 1253 -4.1137751191854477e-02 + + 4.8369780182838440e-01 -1.4562819898128510e-01 + -4.8423030972480774e-01 1.9624310731887817e-01 + <_> + + 1 0 1254 1.2921179644763470e-02 2 -1 1255 + 2.9845361132174730e-03 -2 -3 1256 1.2732800096273422e-02 + + 6.0538208484649658e-01 -4.6820640563964844e-01 + -2.9540339484810829e-02 3.6185088753700256e-01 + <_> + + 0 1 1257 -1.0869900143006817e-04 -1 2 1258 + -8.9501799084246159e-04 -2 -3 1259 5.3637558594346046e-03 + + 1.6606490314006805e-01 3.5517621785402298e-02 + -3.5981449484825134e-01 4.2224168777465820e-01 + <_> + + 1 0 1260 1.4909369871020317e-02 -1 2 1261 + -1.0603530099615455e-03 -2 -3 1262 -3.6916081444360316e-04 + + -6.6308712959289551e-01 -3.8903519511222839e-01 + -1.1299440264701843e-01 1.6010889410972595e-01 + <_> + + 0 1 1263 -3.8595579098910093e-04 2 -1 1264 + 5.9791578678414226e-04 -2 -3 1265 1.0427299886941910e-02 + + 1.9961580634117126e-01 -2.5480431318283081e-01 + 1.0820420086383820e-01 -5.4060971736907959e-01 + <_> + 41 + -1.2273980379104614e+00 + + <_> + + 0 1 1266 8.5305199027061462e-03 2 -1 1267 + -7.0295208133757114e-03 -2 -3 1268 1.1181459762156010e-02 + + -2.3412899672985077e-01 -1.3273300230503082e-01 + -1.0306409746408463e-01 8.1993848085403442e-01 + <_> + + 1 0 1269 -3.3347710967063904e-02 2 -1 1270 + -5.7895448990166187e-03 -2 -3 1271 7.5207999907433987e-03 + + -2.0504109561443329e-01 -7.2138823568820953e-02 + 9.2525452375411987e-02 6.4616191387176514e-01 + <_> + + 1 0 1272 5.1975441165268421e-03 2 -1 1273 + 2.7103458996862173e-03 -2 -3 1274 -5.8099921792745590e-02 + + -3.6144751310348511e-01 -3.4319791197776794e-01 + 3.2151529192924500e-01 -3.0232580378651619e-02 + <_> + + 1 2 1275 4.1742541361600161e-04 0 -1 1276 + 5.8975181309506297e-04 -2 -3 1277 1.3578129932284355e-02 + + -2.6612699031829834e-01 1.4442689716815948e-01 + 3.6293990910053253e-02 4.4277408719062805e-01 + <_> + + 0 1 1278 -3.9278618060052395e-03 -1 2 1279 + -1.6465460881590843e-02 -2 -3 1280 -9.0516731142997742e-03 + + -4.2203828692436218e-01 -5.7036012411117554e-01 + -2.4343970417976379e-01 1.2901119887828827e-01 + <_> + + 0 1 1281 -4.0202909149229527e-03 -1 2 1282 + 1.9786891061812639e-03 -2 -3 1283 -2.1167920902371407e-02 + + 3.0336159467697144e-01 -1.1887379735708237e-01 + -5.3209340572357178e-01 3.7618291378021240e-01 + <_> + + 0 1 1284 -1.3314959593117237e-02 2 -1 1285 + -3.0734280124306679e-02 -2 -3 1286 -4.9376720190048218e-01 + + -4.7728979587554932e-01 -1.0171979665756226e-01 + -4.9745380878448486e-01 1.9965989887714386e-01 + <_> + + 1 0 1287 -2.2439099848270416e-03 -1 2 1288 + -4.3283861130475998e-02 -2 -3 1289 -9.8785851150751114e-05 + + -1.0817500203847885e-01 6.4580261707305908e-01 + 2.6985371112823486e-01 -1.5044610202312469e-01 + <_> + + 1 0 1290 2.8435129672288895e-02 -1 2 1291 + 2.7237860485911369e-03 -2 -3 1292 -4.7562850522808731e-04 + + 2.9883900284767151e-01 -1.8797110021114349e-01 + 2.8433099389076233e-01 -1.2085639685392380e-01 + <_> + + 1 0 1293 3.8944541011005640e-03 2 -1 1294 + 4.3390938080847263e-03 -2 -3 1295 -2.0263839513063431e-02 + + -2.7473360300064087e-01 -3.7163880467414856e-01 + -3.5409209132194519e-01 1.3197909295558929e-01 + <_> + + 0 1 1296 -5.5432569235563278e-02 2 -1 1297 + 5.4974798113107681e-03 -2 -3 1298 -4.8123318701982498e-03 + + -6.3836967945098877e-01 2.4118340015411377e-01 + 1.2418109923601151e-01 -1.8538869917392731e-01 + <_> + + 2 1 1299 1.4174300013110042e-03 0 -1 1300 + -3.3114890102297068e-03 -2 -3 1301 -9.4083733856678009e-03 + + 1.0947279632091522e-01 -3.1438231468200684e-01 + -5.0812500715255737e-01 1.2708969414234161e-01 + <_> + + 1 0 1302 1.6073260456323624e-02 -1 2 1303 + -3.9989468641579151e-03 -2 -3 1304 1.0122359963133931e-03 + + -3.2891270518302917e-01 2.3349060118198395e-01 + -1.7827099561691284e-01 1.6806240379810333e-01 + <_> + + 1 0 1305 1.5654880553483963e-02 2 -1 1306 + 1.3416170142591000e-02 -2 -3 1307 2.4865430314093828e-03 + + 6.6142809391021729e-01 -5.6725960969924927e-01 + 7.0396818220615387e-02 -2.1695409715175629e-01 + <_> + + 0 1 1308 -4.5016291551291943e-03 -1 2 1309 + -2.0310489460825920e-02 -2 -3 1310 2.0448309369385242e-03 + + -2.9001921415328979e-01 -5.5471527576446533e-01 + -7.5903441756963730e-03 3.0112549662590027e-01 + <_> + + 2 1 1311 3.3151761163026094e-03 0 -1 1312 + -1.1767409741878510e-02 -2 -3 1313 -9.0457782149314880e-02 + + -6.5939038991928101e-01 1.9516299664974213e-01 + 2.3783689737319946e-01 -1.6133689880371094e-01 + <_> + + 0 1 1314 -9.4386242562904954e-04 -1 2 1315 + -5.5300429463386536e-02 -2 -3 1316 1.8430839991196990e-03 + + 2.0265130698680878e-01 1.3218100368976593e-01 + -8.5232466459274292e-02 -5.0634711980819702e-01 + <_> + + 2 1 1317 -4.4628758914768696e-03 0 -1 1318 + 9.7493419889360666e-04 -2 -3 1319 -3.1454759300686419e-04 + + -2.7136290073394775e-01 1.5943349897861481e-01 + 2.7965110540390015e-01 -3.2671060413122177e-02 + <_> + + 1 2 1320 -1.6447799280285835e-02 0 -1 1321 + 2.3777380585670471e-02 -2 -3 1322 2.8008338995277882e-03 + + -4.1435249149799347e-03 3.5191389918327332e-01 + -2.2791029512882233e-01 1.8853689730167389e-01 + <_> + + 1 0 1323 1.7503320123068988e-04 -1 2 1324 + 1.3492659491021186e-04 -2 -3 1325 4.8691541451262310e-05 + + -2.1376720070838928e-01 -1.3506560027599335e-01 + -2.7009880542755127e-01 3.2778948545455933e-01 + <_> + + 1 0 1326 2.4542049504816532e-03 -1 2 1327 + -2.3232260718941689e-02 -2 -3 1328 5.2798539400100708e-03 + + 2.6363280415534973e-01 -3.8305589556694031e-01 + -7.7942140400409698e-02 2.4021050333976746e-01 + <_> + + 1 0 1329 7.0398352108895779e-03 2 -1 1330 + 4.0894638746976852e-02 -2 -3 1331 -7.9772479832172394e-02 + + 2.0972409844398499e-01 -7.0987868309020996e-01 + 5.7007771730422974e-01 -6.9354712963104248e-02 + <_> + + 1 0 1332 6.4237392507493496e-04 -1 2 1333 + 1.8864229787141085e-03 -2 -3 1334 -2.5151949375867844e-03 + + -4.0321418642997742e-01 8.4503486752510071e-02 + 7.3963850736618042e-01 -3.7004008889198303e-01 + <_> + + 2 1 1335 9.2179048806428909e-04 0 -1 1336 + -6.6281789913773537e-03 -2 -3 1337 -1.2447969987988472e-02 + + 2.4241310358047485e-01 -2.5563749670982361e-01 + 4.5645469427108765e-01 3.5875100642442703e-02 + <_> + + 1 0 1338 9.8073864355683327e-03 2 -1 1339 + 1.1752230115234852e-02 -2 -3 1340 -4.5835418859496713e-04 + + -3.5728690028190613e-01 2.2477920353412628e-01 + 9.2636883258819580e-02 -2.2759440541267395e-01 + <_> + + 1 0 1341 1.2521909549832344e-02 2 -1 1342 + 5.4397471249103546e-03 -2 -3 1343 -5.8840587735176086e-04 + + -5.0926029682159424e-01 4.6630910038948059e-01 + -2.5326851010322571e-01 4.8585399985313416e-02 + <_> + + 0 1 1344 -8.6136013269424438e-03 2 -1 1345 + 4.8513390356674790e-04 -2 -3 1346 -5.7645072229206562e-04 + + -4.6801608800888062e-01 1.5412229299545288e-01 + 3.3526080846786499e-01 -1.3425140082836151e-01 + <_> + + 0 1 1347 1.5327259898185730e-03 2 -1 1348 + 1.6712940123397857e-04 -2 -3 1349 5.0148408627137542e-04 + + -8.4655933082103729e-02 -2.9512628912925720e-01 + 4.4228151440620422e-01 7.0311659947037697e-03 + <_> + + 0 1 1350 -7.2751182597130537e-04 2 -1 1351 + 1.6298179980367422e-03 -2 -3 1352 -6.5518761985003948e-03 + + 3.6965361237525940e-01 -3.1909099221229553e-01 + -5.0437092781066895e-01 4.8704870045185089e-02 + <_> + + 0 1 1353 -1.8271349370479584e-02 2 -1 1354 + -3.1057938933372498e-01 -2 -3 1355 8.6849008221179247e-04 + + 2.6778510212898254e-01 -1.5646959841251373e-01 + 2.2130140662193298e-01 -2.3309649527072906e-01 + <_> + + 0 1 1356 -1.0790280066430569e-02 2 -1 1357 + -6.7156221484765410e-04 -2 -3 1358 7.9050064086914062e-03 + + -4.1554379463195801e-01 -8.0280020833015442e-02 + 1.7470720410346985e-01 -7.7852571010589600e-01 + <_> + + 2 1 1359 1.2352660298347473e-02 0 -1 1360 + 6.2703549861907959e-02 -2 -3 1361 -7.1864388883113861e-03 + + 4.3160900473594666e-01 -3.9224869012832642e-01 + -5.8003968000411987e-01 -2.5838220492005348e-02 + <_> + + 0 1 1362 -3.8558109663426876e-03 -1 2 1363 + -1.5419459668919444e-03 -2 -3 1364 -2.2120370995253325e-03 + + 1.5963500738143921e-01 1.6741840541362762e-01 + 2.9176110401749611e-02 -2.8822419047355652e-01 + <_> + + 0 1 1365 -2.1434590220451355e-02 2 -1 1366 + -1.9107710104435682e-03 -2 -3 1367 3.5804428160190582e-02 + + -2.2613149881362915e-01 1.0307289659976959e-01 + 7.5381852686405182e-02 -6.3267099857330322e-01 + <_> + + 1 0 1368 1.4067400479689240e-03 -1 2 1369 + 9.6554737538099289e-03 -2 -3 1370 2.4058830738067627e-01 + + 3.7057319283485413e-01 -2.0454670488834381e-01 + 2.0735639333724976e-01 -1.2661419808864594e-01 + <_> + + 1 0 1371 5.2541731856763363e-03 -1 2 1372 + -1.1480560060590506e-03 -2 -3 1373 5.2387482719495893e-04 + + -2.3812450468540192e-01 -1.8807569518685341e-02 + 5.8435738086700439e-01 -7.0002108812332153e-02 + <_> + + 1 0 1374 8.9346221648156643e-04 -1 2 1375 + -1.4664779603481293e-01 -2 -3 1376 6.4734317129477859e-04 + + -2.0343719422817230e-01 4.2429131269454956e-01 + -7.2510123252868652e-02 2.4216009676456451e-01 + <_> + + 1 0 1377 3.7285720463842154e-03 2 -1 1378 + 1.0364309855503961e-04 -2 -3 1379 -4.3523311614990234e-03 + + -4.1690871119499207e-01 1.7091989517211914e-01 + 3.1368499994277954e-01 -1.3387750089168549e-01 + <_> + + 1 2 1380 -8.2644030451774597e-02 0 -1 1381 + -8.3868228830397129e-04 -2 -3 1382 -2.6123419404029846e-02 + + 6.7182201147079468e-01 -4.5429998636245728e-01 + 2.1897830069065094e-01 -3.2377090305089951e-02 + <_> + + 2 1 1383 5.2059517474845052e-04 0 -1 1384 + -2.9154460877180099e-02 -2 -3 1385 -1.1165169999003410e-03 + + -3.6328500509262085e-01 1.6834139823913574e-01 + 1.5818840265274048e-01 -2.3134049773216248e-01 + <_> + + 1 0 1386 -1.1460180394351482e-03 2 -1 1387 + 2.0873030647635460e-02 -2 -3 1388 4.0476579219102859e-02 + + -1.2237170338630676e-01 4.0715441107749939e-01 + -4.8719130456447601e-02 6.1359512805938721e-01 + <_> + 42 + -1.1990439891815186e+00 + + <_> + + 2 1 1389 2.3152550682425499e-02 0 -1 1390 + 9.4490228220820427e-03 -2 -3 1391 1.2632790021598339e-03 + + 1.6217540204524994e-01 8.9458537101745605e-01 + -2.9920589923858643e-01 2.4114310741424561e-01 + <_> + + 1 2 1392 -6.3288196921348572e-02 0 -1 1393 + -5.4630772210657597e-03 -2 -3 1394 -5.3964817197993398e-04 + + 5.8726388216018677e-01 2.8670629486441612e-02 + 2.1043429151177406e-02 -3.3096361160278320e-01 + <_> + + 0 1 1395 -4.3574950098991394e-01 -1 2 1396 + -2.2997299674898386e-03 -2 -3 1397 2.8589849825948477e-03 + + 2.9235550761222839e-01 1.0574100166559219e-01 + -3.3370551466941833e-01 1.6990379989147186e-01 + <_> + + 0 1 1398 -2.1891849115490913e-02 -1 2 1399 + -9.2662516981363297e-03 -2 -3 1400 -1.6625279560685158e-02 + + -6.2861520051956177e-01 -4.3969720602035522e-01 + 4.0394479036331177e-01 1.1343320365995169e-03 + <_> + + 2 1 1401 2.4849560577422380e-03 0 -1 1402 + -1.8093220889568329e-02 -2 -3 1403 -1.5609259717166424e-02 + + -1.5912850201129913e-01 4.4538548588752747e-01 + 6.9278262555599213e-02 -2.2655999660491943e-01 + <_> + + 0 1 1404 -4.3753669597208500e-03 -1 2 1405 + -1.3602689432445914e-04 -2 -3 1406 3.8207470788620412e-04 + + -7.1104782819747925e-01 -1.6582900285720825e-01 + 2.1408109366893768e-01 -1.2310829758644104e-01 + <_> + + 0 1 1407 -5.7698809541761875e-03 -1 2 1408 + -6.5253339707851410e-03 -2 -3 1409 -8.3149597048759460e-02 + + 2.5808620452880859e-01 2.0068170130252838e-01 + -6.4005237817764282e-01 -9.6292853355407715e-02 + <_> + + 0 1 1410 -1.7492580227553844e-03 -1 2 1411 + -3.5885178949683905e-03 -2 -3 1412 2.8363720048218966e-03 + + -2.7996930480003357e-01 -4.2557060718536377e-01 + 1.7105630040168762e-01 -1.1548189818859100e-01 + <_> + + 2 1 1413 3.7369329947978258e-03 0 -1 1414 + 2.0398290827870369e-02 -2 -3 1415 -1.8605329096317291e-02 + + 7.5142003595829010e-02 7.1449148654937744e-01 + 6.6745537519454956e-01 -1.3011719286441803e-01 + <_> + + 1 0 1416 1.2047400232404470e-03 -1 2 1417 + -4.1799237951636314e-03 -2 -3 1418 5.3556780330836773e-03 + + 1.9936279952526093e-01 2.0625339448451996e-01 + -2.1847389638423920e-01 3.9184600114822388e-01 + <_> + + 1 2 1419 -2.3561089765280485e-03 0 -1 1420 + -5.9740748256444931e-02 -2 -3 1421 1.4918210217729211e-03 + + 6.4951920509338379e-01 -2.6147049665451050e-01 + 1.1800879985094070e-01 -3.6518579721450806e-01 + <_> + + 0 1 1422 -2.6466009020805359e-01 -1 2 1423 + -6.3644978217780590e-04 -2 -3 1424 -1.0798840224742889e-01 + + -4.7007301449775696e-01 1.5393650531768799e-01 + 2.8167989850044250e-01 -1.9636960327625275e-01 + <_> + + 0 1 1425 -3.6950930370949209e-04 -1 2 1426 + -7.9222144559025764e-03 -2 -3 1427 -7.1997018530964851e-03 + + -2.5694531202316284e-01 -3.6089059710502625e-01 + 2.1187220513820648e-01 -6.0304410755634308e-02 + <_> + + 1 0 1428 2.7865950018167496e-02 -1 2 1429 + 1.0313779785064980e-04 -2 -3 1430 9.8026450723409653e-04 + + 2.7542260289192200e-01 -2.1113120019435883e-01 + 1.2969830632209778e-01 -3.5925969481468201e-01 + <_> + + 1 0 1431 1.0869160294532776e-02 2 -1 1432 + 1.9162669777870178e-03 -2 -3 1433 -6.9466588320210576e-04 + + -2.8709220886230469e-01 1.9223760068416595e-01 + 2.6802310347557068e-01 -1.5893469750881195e-01 + <_> + + 0 1 1434 -1.5737100038677454e-03 2 -1 1435 + 2.8489651158452034e-03 -2 -3 1436 1.2300360249355435e-03 + + 4.8450559377670288e-01 1.4732420444488525e-01 + -2.2078629583120346e-02 -3.5363599658012390e-01 + <_> + + 0 1 1437 -1.7871359596028924e-03 -1 2 1438 + -7.5124297291040421e-04 -2 -3 1439 -1.5810869634151459e-02 + + 1.5130859613418579e-01 -2.5845149159431458e-01 + 3.9024001359939575e-01 -8.3249032497406006e-02 + <_> + + 2 1 1440 -8.5817109793424606e-03 0 -1 1441 + 1.4925940334796906e-01 -2 -3 1442 5.0973348319530487e-02 + + 6.5285183489322662e-02 -4.4836780428886414e-01 + -5.9802252054214478e-01 7.6314812898635864e-01 + <_> + + 2 1 1443 -1.4699130551889539e-03 0 -1 1444 + 1.8571510445326567e-03 -2 -3 1445 2.7572319377213717e-03 + + -1.5857130289077759e-01 2.0623469352722168e-01 + -1.5369700267910957e-02 3.5741418600082397e-01 + <_> + + 0 1 1446 -1.2494870461523533e-02 -1 2 1447 + -2.0542230457067490e-02 -2 -3 1448 9.8408637568354607e-03 + + 2.1646310389041901e-01 3.5183259844779968e-01 + -2.5107988715171814e-01 2.4597419425845146e-02 + <_> + + 1 0 1449 7.5531061738729477e-03 2 -1 1450 + 8.6472760885953903e-03 -2 -3 1451 -2.3343270644545555e-02 + + -7.7170521020889282e-01 -2.6535108685493469e-01 + -3.1102359294891357e-01 1.0751940310001373e-01 + <_> + + 0 1 1452 -2.3739689495414495e-03 2 -1 1453 + 4.5531010255217552e-03 -2 -3 1454 -1.7819739878177643e-02 + + 2.4833559989929199e-01 1.2766610085964203e-01 + -2.1538909524679184e-02 -3.3530569076538086e-01 + <_> + + 0 1 1455 -1.8217710778117180e-02 -1 2 1456 + -4.5768721029162407e-03 -2 -3 1457 -1.8008370534516871e-04 + + -4.1915500164031982e-01 -4.3936538696289062e-01 + -1.2697519361972809e-01 1.3539279997348785e-01 + <_> + + 0 1 1458 -7.6008588075637817e-03 2 -1 1459 + 4.5034091453999281e-04 -2 -3 1460 2.7170981047675014e-04 + + -3.3822789788246155e-01 3.1599909067153931e-01 + -7.5660146772861481e-02 2.3075099289417267e-01 + <_> + + 0 1 1461 -5.9739891439676285e-02 2 -1 1462 + -2.4159778840839863e-03 -2 -3 1463 7.5702499598264694e-03 + + -3.9958238601684570e-01 -2.9177419841289520e-02 + 3.6201998591423035e-01 -7.8775990009307861e-01 + <_> + + 1 0 1464 4.8360861837863922e-03 -1 2 1465 + -1.9794749096035957e-02 -2 -3 1466 -5.3176241926848888e-03 + + -4.7984561324119568e-01 3.1721720099449158e-01 + 2.1971449255943298e-01 -8.5302233695983887e-02 + <_> + + 2 1 1467 3.5097550135105848e-03 0 -1 1468 + -1.6063610091805458e-03 -2 -3 1469 1.8238229677081108e-03 + + 3.4705808758735657e-01 -3.2198080420494080e-01 + 9.7573727369308472e-02 -4.1784769296646118e-01 + <_> + + 2 1 1470 2.2058039903640747e-03 0 -1 1471 + 2.5601179804652929e-03 -2 -3 1472 2.2490289993584156e-03 + + -2.9866018891334534e-01 3.2085859775543213e-01 + 1.0411229729652405e-01 -3.0941790342330933e-01 + <_> + + 1 2 1473 2.2417849395424128e-03 0 -1 1474 + 9.5781440904829651e-05 -2 -3 1475 -1.0199189931154251e-01 + + -1.9861190021038055e-01 8.0484487116336823e-02 + -6.6573441028594971e-01 2.6545938849449158e-01 + <_> + + 2 1 1476 2.9278239235281944e-03 0 -1 1477 + -2.3058110382407904e-03 -2 -3 1478 -3.5818710457533598e-03 + + 4.6711549162864685e-01 -2.3293379694223404e-02 + 1.9756149500608444e-02 -2.5899839401245117e-01 + <_> + + 2 1 1479 4.8302081413567066e-03 0 -1 1480 + -2.7483499143272638e-03 -2 -3 1481 -4.5970390783622861e-04 + + -3.6909970641136169e-01 2.9650568962097168e-01 + 1.0480040311813354e-01 -1.6184529662132263e-01 + <_> + + 2 1 1482 -1.0161349549889565e-02 0 -1 1483 + 3.2342320773750544e-03 -2 -3 1484 -1.1368689592927694e-03 + + -1.5523530542850494e-01 4.8816910386085510e-01 + 2.8159290552139282e-01 -6.2790401279926300e-02 + <_> + + 1 0 1485 1.1411249870434403e-03 2 -1 1486 + 2.8695389628410339e-03 -2 -3 1487 2.4731169641017914e-01 + + 1.2081749737262726e-01 2.0992599427700043e-01 + -2.4197529256343842e-01 6.4990550279617310e-01 + <_> + + 2 1 1488 2.7829511091113091e-03 0 -1 1489 + -1.3701720163226128e-02 -2 -3 1490 4.8768401145935059e-02 + + 4.5538169145584106e-01 -3.3847901225090027e-01 + 8.9688122272491455e-02 -3.1576380133628845e-01 + <_> + + 1 0 1491 1.7329800873994827e-02 2 -1 1492 + 1.4899630099534988e-02 -2 -3 1493 -5.4528238251805305e-03 + + 4.2558190226554871e-01 6.1711931228637695e-01 + -4.0939989686012268e-01 -1.5215449966490269e-02 + <_> + + 0 1 1494 -4.6164509840309620e-03 2 -1 1495 + 2.2072680294513702e-03 -2 -3 1496 1.1780969798564911e-03 + + -3.5992878675460815e-01 2.0051500201225281e-01 + -1.7710399627685547e-01 1.3283580541610718e-01 + <_> + + 2 1 1497 -2.1226529497653246e-04 0 -1 1498 + 6.6969380713999271e-03 -2 -3 1499 4.8628589138388634e-03 + + -1.4558829367160797e-01 3.0319228768348694e-01 + 2.1147659420967102e-01 -6.5050870180130005e-01 + <_> + + 1 0 1500 1.2855669483542442e-03 -1 2 1501 + -9.8538002930581570e-04 -2 -3 1502 3.6161120515316725e-03 + + -1.4253799617290497e-01 -4.9302369356155396e-02 + 4.5496350526809692e-01 -1.2398339807987213e-01 + <_> + + 1 0 1503 7.4739390984177589e-03 2 -1 1504 + 1.4764349907636642e-02 -2 -3 1505 5.4328311234712601e-03 + + 2.5631210207939148e-01 5.8572351932525635e-01 + 3.2529931515455246e-02 -2.2187189757823944e-01 + <_> + + 1 2 1506 -2.7086320915259421e-04 0 -1 1507 + 4.2132260277867317e-03 -2 -3 1508 1.9583420362323523e-04 + + 2.6175120472908020e-01 -5.9540379047393799e-01 + -1.9159470498561859e-01 9.1520026326179504e-02 + <_> + + 0 1 1509 -7.1442658081650734e-03 2 -1 1510 + 2.3744559439364821e-04 -2 -3 1511 -8.4380080807022750e-05 + + 1.3012650609016418e-01 -3.8831448554992676e-01 + 2.1030910313129425e-01 -1.4587140083312988e-01 + <_> + + 1 0 1512 1.2161800265312195e-01 2 -1 1513 + 6.9275178248062730e-05 -2 -3 1514 -1.5904659405350685e-02 + + 2.5583249330520630e-01 1.1272220313549042e-01 + 7.2112542390823364e-01 -1.9385160505771637e-01 + <_> + 35 + -1.1545649766921997e+00 + + <_> + + 2 1 1515 1.7899930477142334e-02 0 -1 1516 + 1.5925300540402532e-03 -2 -3 1517 1.8896949477493763e-03 + + 4.6134639531373978e-02 8.3787131309509277e-01 + -3.6899039149284363e-01 1.8707709386944771e-02 + <_> + + 1 0 1518 -4.1336648166179657e-02 -1 2 1519 + -4.0737599134445190e-02 -2 -3 1520 -1.4306500088423491e-03 + + -1.9983500242233276e-01 5.5203098058700562e-01 + -5.4083228111267090e-01 1.3183380663394928e-01 + <_> + + 2 1 1521 1.4656609855592251e-03 0 -1 1522 + -1.3589359587058425e-03 -2 -3 1523 -1.5437849797308445e-03 + + 1.7477029561996460e-01 -4.5285460352897644e-01 + 2.2154679894447327e-01 -1.1437030136585236e-01 + <_> + + 2 1 1524 6.6659757867455482e-03 0 -1 1525 + -1.7080729594454169e-03 -2 -3 1526 -3.6050159484148026e-02 + + 5.6135451793670654e-01 -7.5875748880207539e-03 + 6.9391137361526489e-01 -1.3373179733753204e-01 + <_> + + 0 1 1527 -7.1983798407018185e-03 -1 2 1528 + -6.5796967828646302e-04 -2 -3 1529 -1.2115390272811055e-03 + + 1.8855899572372437e-01 -4.7130081057548523e-01 + 1.9381099939346313e-01 -1.4709189534187317e-01 + <_> + + 0 1 1530 -1.0272770188748837e-02 2 -1 1531 + -7.0025851018726826e-03 -2 -3 1532 -2.4933859705924988e-02 + + -4.1135069727897644e-01 -8.8177748024463654e-02 + -6.3464301824569702e-01 2.5403091311454773e-01 + <_> + + 2 1 1533 7.7693387866020203e-03 0 -1 1534 + -4.4885549694299698e-02 -2 -3 1535 1.9916899036616087e-03 + + -4.5445719361305237e-01 3.3884489536285400e-01 + -5.3012330085039139e-02 -5.7269239425659180e-01 + <_> + + 0 1 1536 -1.4783450402319431e-02 2 -1 1537 + 1.1688449885696173e-03 -2 -3 1538 -1.2033269740641117e-04 + + 3.7365919351577759e-01 -3.0164909362792969e-01 + 1.4958509802818298e-01 -1.4014390110969543e-01 + <_> + + 0 1 1539 -4.3730039149522781e-02 -1 2 1540 + -1.7855180427432060e-02 -2 -3 1541 8.3651271415874362e-04 + + -7.0078557729721069e-01 8.0032449960708618e-01 + 7.8825756907463074e-02 -2.0352110266685486e-01 + <_> + + 2 1 1542 -6.6671593231149018e-05 0 -1 1543 + -9.8805947345681489e-05 -2 -3 1544 -2.7336759376339614e-04 + + -3.7201121449470520e-01 1.3640309683978558e-02 + -1.6216109693050385e-01 2.6113900542259216e-01 + <_> + + 1 0 1545 4.2468630708754063e-03 2 -1 1546 + -4.9197040498256683e-03 -2 -3 1547 -1.4116670005023479e-02 + + 2.8842711448669434e-01 -1.0787279903888702e-01 + -7.0104539394378662e-01 3.3659279346466064e-01 + <_> + + 1 2 1548 -4.4507419806905091e-04 0 -1 1549 + -1.2075440026819706e-02 -2 -3 1550 -2.3437689524143934e-03 + + -7.0987367630004883e-01 1.5176150202751160e-01 + -4.0890040993690491e-01 -1.7091540619730949e-02 + <_> + + 1 0 1551 1.6248680651187897e-02 2 -1 1552 + 1.9177920185029507e-03 -2 -3 1553 -1.0359560139477253e-02 + + -6.0641109943389893e-01 3.6670050024986267e-01 + 1.9813629984855652e-01 -1.1020349711179733e-01 + <_> + + 2 1 1554 2.9234820976853371e-03 0 -1 1555 + 3.4323200583457947e-02 -2 -3 1556 1.8238219490740448e-04 + + -4.6382451057434082e-01 1.5469099581241608e-01 + -2.5076579302549362e-02 2.7050849795341492e-01 + <_> + + 0 1 1557 -8.5055502131581306e-04 2 -1 1558 + 4.7644949518144131e-03 -2 -3 1559 -2.5098009500652552e-03 + + 1.7459200322628021e-01 4.0942171216011047e-01 + 3.9601740241050720e-01 -1.7667229473590851e-01 + <_> + + 0 1 1560 -5.0978600047528744e-03 -1 2 1561 + -5.2095171064138412e-02 -2 -3 1562 3.5293150693178177e-02 + + -4.4393861293792725e-01 -6.6363197565078735e-01 + 2.7801029384136200e-02 5.6744211912155151e-01 + <_> + + 0 1 1563 -3.6938309669494629e-01 2 -1 1564 + 5.7077431119978428e-03 -2 -3 1565 5.1315332530066371e-04 + + -5.4281282424926758e-01 -3.8007241487503052e-01 + -7.5563162565231323e-02 1.8112689256668091e-01 + <_> + + 0 1 1566 -8.1165106967091560e-03 -1 2 1567 + 2.4742930690990761e-05 -2 -3 1568 -8.3282394334673882e-03 + + 4.3757191300392151e-01 -1.6252890229225159e-01 + 2.9233780503273010e-01 -5.2530951797962189e-02 + <_> + + 0 1 1569 -9.9733080714941025e-03 -1 2 1570 + -1.6291439533233643e-03 -2 -3 1571 2.3081828840076923e-03 + + 2.3018500208854675e-01 -3.8834458589553833e-01 + 1.5438289940357208e-01 -1.6248099505901337e-01 + <_> + + 0 1 1572 7.0326360873878002e-03 2 -1 1573 + -8.7802913039922714e-03 -2 -3 1574 -1.1044350266456604e-01 + + -8.2522578537464142e-02 3.2759511470794678e-01 + 6.3194888830184937e-01 -2.1398690342903137e-01 + <_> + + 0 1 1575 6.3772657886147499e-03 -1 2 1576 + -1.4427660405635834e-01 -2 -3 1577 5.2613671869039536e-03 + + -6.5774962306022644e-02 -5.2361601591110229e-01 + 3.7687599658966064e-01 -3.7297201156616211e-01 + <_> + + 0 1 1578 -9.3407719396054745e-04 2 -1 1579 + 7.0944131584838033e-04 -2 -3 1580 -2.0967289805412292e-02 + + -3.5960820317268372e-01 2.9923319816589355e-01 + -3.0739480257034302e-01 4.0209449827671051e-02 + <_> + + 1 2 1581 3.0113470274955034e-03 0 -1 1582 + -1.6325850447174162e-04 -2 -3 1583 3.9222151972353458e-03 + + 8.1960096955299377e-02 -2.3989020287990570e-01 + 3.2356649637222290e-01 -1.2140029668807983e-01 + <_> + + 1 0 1584 1.9476639572530985e-03 -1 2 1585 + -1.1166670173406601e-01 -2 -3 1586 -8.8221747428178787e-03 + + -2.0126590132713318e-01 -3.1850230693817139e-01 + -4.0777778625488281e-01 1.7498190701007843e-01 + <_> + + 1 0 1587 4.4771569082513452e-04 -1 2 1588 + -1.5389479696750641e-01 -2 -3 1589 9.9520087242126465e-02 + + 2.2826899588108063e-01 2.3346799612045288e-01 + -1.9206780195236206e-01 1.9271479547023773e-01 + <_> + + 0 1 1590 -7.3821679688990116e-03 2 -1 1591 + 3.8805850781500340e-03 -2 -3 1592 1.6339759528636932e-01 + + -4.6257901191711426e-01 -2.3733510076999664e-01 + 5.5862568318843842e-02 6.1965280771255493e-01 + <_> + + 0 1 1593 -8.8077411055564880e-02 -1 2 1594 + -3.5946018993854523e-02 -2 -3 1595 -1.6441620886325836e-02 + + -3.8033220171928406e-01 2.6925620436668396e-01 + 1.4508089423179626e-01 -1.6219359636306763e-01 + <_> + + 0 1 1596 -4.3592150323092937e-03 2 -1 1597 + 1.0485500097274780e-02 -2 -3 1598 -6.1118233134038746e-05 + + -5.1064497232437134e-01 2.8324770927429199e-01 + 7.6486147940158844e-02 -1.9800069928169250e-01 + <_> + + 0 1 1599 -4.7104779630899429e-02 2 -1 1600 + 4.4213151559233665e-03 -2 -3 1601 7.0402962155640125e-03 + + -7.2683817148208618e-01 3.9631149172782898e-01 + 1.8920229747891426e-02 -3.7019899487495422e-01 + <_> + + 1 0 1602 1.4250110089778900e-01 2 -1 1603 + -5.7172770611941814e-03 -2 -3 1604 -4.6481531113386154e-02 + + 8.8020402193069458e-01 4.3595671653747559e-02 + 7.6506501436233521e-01 -2.7619931101799011e-01 + <_> + + 0 1 1605 -4.4838748872280121e-02 2 -1 1606 + 3.0957909300923347e-02 -2 -3 1607 -8.7462607771158218e-03 + + -5.1540642976760864e-01 5.9068799018859863e-01 + -2.2899469733238220e-01 6.3833296298980713e-02 + <_> + + 1 2 1608 -1.5742169693112373e-02 0 -1 1609 + -2.6640590280294418e-02 -2 -3 1610 1.8860519630834460e-03 + + 7.8339278697967529e-01 -2.8742430731654167e-02 + -5.8971941471099854e-03 -5.2254527807235718e-01 + <_> + + 1 0 1611 9.0017020702362061e-02 2 -1 1612 + 4.1232812218368053e-03 -2 -3 1613 -3.1369640491902828e-03 + + -2.7766749262809753e-01 -3.3485591411590576e-01 + 2.3297710716724396e-01 -2.5101479142904282e-02 + <_> + + 0 1 1614 -1.9068670272827148e-01 -1 2 1615 + -1.2578029930591583e-01 -2 -3 1616 -4.1931928717531264e-04 + + -4.9549269676208496e-01 -4.1263309121131897e-01 + 3.1464719772338867e-01 -1.8672699807211757e-03 + <_> + + 0 1 1617 -3.2330630347132683e-03 -1 2 1618 + 1.7340299673378468e-03 -2 -3 1619 -2.2027179598808289e-02 + + 1.2561239302158356e-01 -3.4801191091537476e-01 + 4.4815701246261597e-01 -7.2313196957111359e-02 + <_> + 39 + -1.1791440248489380e+00 + + <_> + + 2 1 1620 3.3422548323869705e-02 0 -1 1621 + 8.5403252160176635e-04 -2 -3 1622 -7.3585510253906250e-03 + + -1.3247360289096832e-01 7.6739120483398438e-01 + 1.3871429860591888e-01 -3.1415361166000366e-01 + <_> + + 1 0 1623 -1.0222700238227844e-01 2 -1 1624 + 3.4475249703973532e-03 -2 -3 1625 -1.7645580694079399e-02 + + -2.0302750170230865e-01 6.8434572219848633e-01 + 4.2404478788375854e-01 -4.3976809829473495e-02 + <_> + + 1 0 1626 3.2828699331730604e-03 -1 2 1627 + -2.6843189261853695e-03 -2 -3 1628 2.6746080256998539e-03 + + -3.2990959286689758e-01 -3.5459449887275696e-01 + 2.0094729959964752e-01 -2.5637739896774292e-01 + <_> + + 2 1 1629 4.3111201375722885e-03 0 -1 1630 + -1.0081959888339043e-02 -2 -3 1631 -1.2621459551155567e-02 + + 6.3562941551208496e-01 7.2961407713592052e-03 + -4.7962281107902527e-01 -2.3874230682849884e-02 + <_> + + 1 0 1632 6.5851196646690369e-02 2 -1 1633 + 6.6091239452362061e-02 -2 -3 1634 1.0616159997880459e-02 + + -4.3995830416679382e-01 5.8817231655120850e-01 + 4.4144749641418457e-02 -5.2871602773666382e-01 + <_> + + 0 1 1635 -1.7077329754829407e-01 2 -1 1636 + 7.3064928874373436e-03 -2 -3 1637 -1.6232950612902641e-02 + + 3.5454490780830383e-01 -4.8716691136360168e-01 + 5.1020520925521851e-01 -4.3431609869003296e-02 + <_> + + 1 0 1638 1.7457149922847748e-02 -1 2 1639 + 1.8004700905294158e-05 -2 -3 1640 -1.8200390331912786e-04 + + 6.0515201091766357e-01 -1.7250029742717743e-01 + -1.9305349886417389e-01 1.9700099527835846e-01 + <_> + + 1 2 1641 1.9662559498101473e-04 0 -1 1642 + -1.1132629588246346e-02 -2 -3 1643 2.1626690868288279e-03 + + 5.0847887992858887e-01 -1.9962939620018005e-01 + 1.6478070616722107e-01 -4.2688089609146118e-01 + <_> + + 1 0 1644 7.7909911051392555e-03 -1 2 1645 + -1.7233919352293015e-02 -2 -3 1646 1.2938809581100941e-02 + + 4.0679588913917542e-01 -3.7941160798072815e-01 + 5.0589919090270996e-02 -3.9163780212402344e-01 + <_> + + 0 1 1647 -1.7387060448527336e-02 -1 2 1648 + -2.5230729952454567e-03 -2 -3 1649 6.4417538233101368e-03 + + 3.1603300571441650e-01 -1.7287540435791016e-01 + -9.0429611504077911e-02 3.1889480352401733e-01 + <_> + + 0 1 1650 -6.1783548444509506e-03 -1 2 1651 + -6.8178442306816578e-03 -2 -3 1652 1.2576530571095645e-04 + + -8.6734527349472046e-01 -4.4892689585685730e-01 + -9.1477192938327789e-02 1.5243050456047058e-01 + <_> + + 1 0 1653 3.7562008947134018e-03 2 -1 1654 + -7.1173519827425480e-03 -2 -3 1655 -4.5744940871372819e-04 + + -3.9259639382362366e-01 -1.9343020394444466e-02 + 5.8565497398376465e-01 -3.0873420182615519e-03 + <_> + + 1 0 1656 1.8661000067368150e-03 -1 2 1657 + 4.5793029130436480e-04 -2 -3 1658 -7.0905109168961644e-04 + + 1.2924820184707642e-01 -3.0677530169487000e-01 + -2.7637350559234619e-01 1.8316049873828888e-01 + <_> + + 1 2 1659 1.6472890274599195e-03 0 -1 1660 + 3.3973839599639177e-03 -2 -3 1661 1.0479029733687639e-03 + + 3.3831808716058731e-02 5.3982901573181152e-01 + -3.4972178936004639e-01 3.4049559384584427e-02 + <_> + + 1 0 1662 -1.2611759593710303e-03 -1 2 1663 + -1.3892400311306119e-03 -2 -3 1664 -2.3636990226805210e-03 + + -1.0801869630813599e-01 -5.8067310601472855e-02 + -1.1870750039815903e-01 4.2690658569335938e-01 + <_> + + 1 0 1665 7.7976062893867493e-02 2 -1 1666 + 2.6837061159312725e-03 -2 -3 1667 -1.8215410411357880e-02 + + 6.1271321773529053e-01 2.0893469452857971e-01 + 2.2027739882469177e-01 -1.4412580430507660e-01 + <_> + + 0 1 1668 -7.1908776590134948e-05 2 -1 1669 + -4.8738159239292145e-02 -2 -3 1670 1.0442149825394154e-02 + + 1.3836480677127838e-01 -1.8305869400501251e-01 + 2.6348349452018738e-01 -6.3504451513290405e-01 + <_> + + 1 2 1671 9.3731992819812149e-05 0 -1 1672 + -8.5826592112425715e-05 -2 -3 1673 -8.0251938197761774e-04 + + 1.4046959578990936e-01 -2.6721659302711487e-01 + -1.2936100363731384e-01 2.3326739668846130e-01 + <_> + + 0 1 1674 -4.1836570017039776e-03 2 -1 1675 + -7.2750613093376160e-02 -2 -3 1676 -2.1738439798355103e-01 + + -6.0153460502624512e-01 6.9707646965980530e-02 + 5.6727671623229980e-01 -4.5854389667510986e-01 + <_> + + 2 1 1677 1.1648099869489670e-02 0 -1 1678 + -6.2701262533664703e-02 -2 -3 1679 2.1612979471683502e-02 + + 7.8997617959976196e-01 -3.9388018846511841e-01 + 7.7059872448444366e-02 -3.8484179973602295e-01 + <_> + + 2 1 1680 1.4084950089454651e-02 0 -1 1681 + -1.9548619166016579e-02 -2 -3 1682 -3.8142129778862000e-03 + + -8.6542218923568726e-01 3.0495870113372803e-01 + 9.0823858976364136e-02 -1.5859849750995636e-01 + <_> + + 1 0 1683 -1.0152840055525303e-02 -1 2 1684 + -7.2696566581726074e-02 -2 -3 1685 6.2066782265901566e-03 + + 4.4999830424785614e-02 -5.6914567947387695e-01 + -2.0673969388008118e-01 9.0268892049789429e-01 + <_> + + 1 0 1686 6.9105483591556549e-02 -1 2 1687 + -1.4375509927049279e-03 -2 -3 1688 -1.2960369931533933e-03 + + -5.9451812505722046e-01 4.0363711118698120e-01 + -3.1941750645637512e-01 3.5984441637992859e-02 + <_> + + 1 0 1689 6.1866950243711472e-02 2 -1 1690 + -1.2085740454494953e-02 -2 -3 1691 2.4474540259689093e-03 + + -2.7787050604820251e-01 -1.3511900603771210e-01 + -1.1833719909191132e-02 3.7945300340652466e-01 + <_> + + 0 1 1692 -5.3315522382035851e-04 2 -1 1693 + 4.3831359595060349e-02 -2 -3 1694 3.1255939393304288e-04 + + -2.2559830546379089e-01 -4.7124490141868591e-01 + 1.7324599623680115e-01 -1.0789500176906586e-01 + <_> + + 0 1 1695 -3.2911780290305614e-03 2 -1 1696 + -5.8774580247700214e-03 -2 -3 1697 1.7906239954754710e-03 + + 7.7492022514343262e-01 -8.2756206393241882e-02 + 2.2471660748124123e-02 5.2061527967453003e-01 + <_> + + 1 2 1698 -2.8294209390878677e-02 0 -1 1699 + -2.0737959071993828e-02 -2 -3 1700 6.0438051819801331e-02 + + -2.7196401357650757e-01 2.4411930143833160e-01 + -1.8866230547428131e-01 1.2102810293436050e-01 + <_> + + 1 0 1701 1.0623940266668797e-02 -1 2 1702 + -5.2178360521793365e-02 -2 -3 1703 -1.0080549865961075e-02 + + -4.3548050522804260e-01 5.5961382389068604e-01 + -4.7012031078338623e-01 3.5867590457201004e-02 + <_> + + 0 1 1704 -1.8482849700376391e-03 -1 2 1705 + -1.9860679458361119e-04 -2 -3 1706 1.3552449643611908e-01 + + 1.6979730129241943e-01 7.1132831275463104e-02 + -2.6272559165954590e-01 6.1016607284545898e-01 + <_> + + 1 2 1707 -1.5910629183053970e-02 0 -1 1708 + 2.6022290810942650e-02 -2 -3 1709 4.9573001451790333e-03 + + -3.0872771143913269e-01 4.9954459071159363e-01 + 1.6577349603176117e-01 -9.6653968095779419e-02 + <_> + + 0 1 1710 -7.6060830906499177e-05 -1 2 1711 + -7.5124457478523254e-02 -2 -3 1712 -1.2995740398764610e-03 + + 1.4288060367107391e-01 2.5722241401672363e-01 + 5.3607620298862457e-02 -2.8598341345787048e-01 + <_> + + 2 1 1713 -2.2266160231083632e-03 0 -1 1714 + -1.7864009365439415e-02 -2 -3 1715 -7.8721214085817337e-03 + + 4.0117779374122620e-01 -1.5379750728607178e-01 + -5.3092598915100098e-01 2.0486819744110107e-01 + <_> + + 2 1 1716 7.2514810599386692e-03 0 -1 1717 + -3.3152610994875431e-03 -2 -3 1718 1.1477110092528164e-04 + + 4.3453741073608398e-01 9.4297742471098900e-03 + -2.5599750876426697e-01 8.4530018270015717e-02 + <_> + + 0 1 1719 -8.1627883017063141e-02 -1 2 1720 + -3.0422580894082785e-03 -2 -3 1721 9.5837161643430591e-04 + + 6.3307619094848633e-01 1.4660899341106415e-01 + -2.0023280382156372e-01 9.1823212802410126e-02 + <_> + + 0 1 1722 -2.9197218827903271e-04 -1 2 1723 + -4.1077801142819226e-04 -2 -3 1724 -3.4885460045188665e-03 + + 1.1741080135107040e-01 -4.0920740365982056e-01 + -3.9310920238494873e-01 9.1094776988029480e-02 + <_> + + 0 1 1725 -8.0458387732505798e-02 2 -1 1726 + 1.4809619635343552e-02 -2 -3 1727 -2.5831649079918861e-02 + + -3.9728361368179321e-01 -6.7901968955993652e-01 + -4.8431569337844849e-01 7.2864383459091187e-02 + <_> + + 0 1 1728 -6.8509988486766815e-03 2 -1 1729 + 7.2365561500191689e-03 -2 -3 1730 -1.5076539712026715e-03 + + -6.2457418441772461e-01 -4.1250211000442505e-01 + 4.2033711075782776e-01 4.4630239717662334e-03 + <_> + + 1 0 1731 3.1408321112394333e-02 -1 2 1732 + -1.5178160369396210e-01 -2 -3 1733 -1.4014760032296181e-02 + + 5.3995478153228760e-01 -3.0855739116668701e-01 + -5.0550711154937744e-01 4.7526750713586807e-02 + <_> + + 0 1 1734 -1.4479519426822662e-01 2 -1 1735 + -3.5547069273889065e-04 -2 -3 1736 3.9468570612370968e-03 + + -6.7499721050262451e-01 -6.9627217948436737e-02 + 2.0310120284557343e-01 -5.7640278339385986e-01 + <_> + 46 + -1.0878429412841797e+00 + + <_> + + 1 2 1737 -3.7029121071100235e-02 0 -1 1738 + 3.5863209050148726e-03 -2 -3 1739 2.0645149052143097e-03 + + 9.5846345648169518e-03 7.9992657899856567e-01 + -2.9247409105300903e-01 1.4642210304737091e-01 + <_> + + 2 1 1740 5.5934679694473743e-03 0 -1 1741 + 2.2176630795001984e-02 -2 -3 1742 4.8479600081918761e-05 + + -3.9403820037841797e-01 5.4291707277297974e-01 + -2.4063709378242493e-01 9.0213976800441742e-02 + <_> + + 1 0 1743 -1.2722389772534370e-02 2 -1 1744 + 1.1610349640250206e-02 -2 -3 1745 8.2520343363285065e-02 + + -1.7550089955329895e-01 -3.1787800788879395e-01 + 2.8798571228981018e-01 -4.4052869081497192e-01 + <_> + + 0 1 1746 -1.4208409935235977e-02 -1 2 1747 + -8.1465748371556401e-04 -2 -3 1748 -5.5117108859121799e-03 + + -8.2584899663925171e-01 1.9521759450435638e-01 + 1.8622130155563354e-01 -1.9417479634284973e-01 + <_> + + 1 0 1749 1.0232779895886779e-03 -1 2 1750 + -6.4967863261699677e-02 -2 -3 1751 2.5218280497938395e-03 + + -1.7564930021762848e-01 -6.9197070598602295e-01 + 6.9476373493671417e-02 6.7932087182998657e-01 + <_> + + 1 0 1752 1.5097549557685852e-01 -1 2 1753 + 4.3899910524487495e-03 -2 -3 1754 9.9906846880912781e-03 + + 4.6142420172691345e-01 4.2842838913202286e-02 + -4.2551028728485107e-01 3.2834030687808990e-02 + <_> + + 0 1 1755 -2.1895440295338631e-02 -1 2 1756 + -7.6050527393817902e-02 -2 -3 1757 -9.6018705517053604e-03 + + -4.7627368569374084e-01 -3.6348098516464233e-01 + 2.4625270068645477e-01 -1.4736860059201717e-02 + <_> + + 0 1 1758 6.1576829466503114e-05 -1 2 1759 + -2.2094589658081532e-03 -2 -3 1760 -1.3034399598836899e-02 + + -1.2972380220890045e-01 3.2342359423637390e-01 + 4.9937328696250916e-01 -1.3894359767436981e-01 + <_> + + 0 1 1761 -2.0411429926753044e-02 2 -1 1762 + -6.8360187113285065e-02 -2 -3 1763 -4.1714729741215706e-03 + + -4.5825520157814026e-01 -5.3202010691165924e-02 + -3.3815470337867737e-01 2.8209799528121948e-01 + <_> + + 1 0 1764 -2.2963550873100758e-03 -1 2 1765 + -7.3422670364379883e-02 -2 -3 1766 3.5119321197271347e-02 + + -8.7558113038539886e-02 5.8385127782821655e-01 + -7.8373529016971588e-02 5.2284508943557739e-01 + <_> + + 0 1 1767 -2.3843089584261179e-03 2 -1 1768 + 5.8223021915182471e-04 -2 -3 1769 5.1109357737004757e-03 + + -3.6075130105018616e-01 2.1036569774150848e-01 + -1.9436909258365631e-01 1.3681420683860779e-01 + <_> + + 0 1 1770 -6.9154787342995405e-04 2 -1 1771 + -5.5549171520397067e-04 -2 -3 1772 -7.5950571335852146e-03 + + -2.3962910473346710e-01 -1.0858660191297531e-01 + -9.1398581862449646e-02 2.7578109502792358e-01 + <_> + + 0 1 1773 2.8131629806011915e-03 -1 2 1774 + -4.5272540301084518e-02 -2 -3 1775 -2.6697120629251003e-03 + + -7.3745496571063995e-02 3.9891231060028076e-01 + 3.7440070509910583e-01 -2.5978609919548035e-01 + <_> + + 2 1 1776 -1.0849219746887684e-02 0 -1 1777 + -1.6776850447058678e-02 -2 -3 1778 -1.9630219787359238e-02 + + -6.7678660154342651e-01 -4.9237858504056931e-02 + -4.7865530848503113e-01 2.2300049662590027e-01 + <_> + + 1 0 1779 7.0901170372962952e-02 -1 2 1780 + 7.0403231075033545e-04 -2 -3 1781 3.3363080583512783e-03 + + -2.8926369547843933e-01 -5.3575031459331512e-02 + -8.7073008762672544e-04 4.0888670086860657e-01 + <_> + + 1 0 1782 9.3207405880093575e-03 2 -1 1783 + 1.1512059718370438e-02 -2 -3 1784 -1.8639869813341647e-04 + + -5.3399091958999634e-01 -5.2177387475967407e-01 + -1.1254069954156876e-01 1.3096989691257477e-01 + <_> + + 0 1 1785 1.5442570438608527e-03 -1 2 1786 + 2.5775749236345291e-03 -2 -3 1787 -1.2664040550589561e-03 + + -8.3666101098060608e-02 3.2544130086898804e-01 + 3.0370441079139709e-01 -2.6052421331405640e-01 + <_> + + 1 0 1788 3.2941689714789391e-03 -1 2 1789 + -2.3375200107693672e-03 -2 -3 1790 -7.7096500899642706e-04 + + 2.1506890654563904e-01 1.9738529622554779e-01 + 6.9986172020435333e-02 -1.9839569926261902e-01 + <_> + + 1 0 1791 -2.7190460241399705e-04 -1 2 1792 + 2.7237389236688614e-02 -2 -3 1793 -1.5080779790878296e-02 + + 8.3213888108730316e-02 -2.8429448604583740e-01 + 6.8940150737762451e-01 -5.7628151029348373e-02 + <_> + + 0 1 1794 -6.5730936825275421e-02 -1 2 1795 + -7.4283648282289505e-03 -2 -3 1796 3.4652319736778736e-03 + + -5.2482831478118896e-01 3.9523449540138245e-01 + -7.3690779507160187e-02 2.0800660550594330e-01 + <_> + + 0 1 1797 -1.2613019905984402e-02 2 -1 1798 + 2.3288120329380035e-01 -2 -3 1799 2.1903509274125099e-02 + + -6.8893492221832275e-01 7.0790272951126099e-01 + -7.7761108987033367e-03 8.4372210502624512e-01 + <_> + + 1 0 1800 1.0629750322550535e-03 -1 2 1801 + 1.8193929281551391e-04 -2 -3 1802 1.4717869926244020e-03 + + -3.4246420860290527e-01 1.0657790303230286e-01 + -3.1970989704132080e-01 7.0577569305896759e-02 + <_> + + 1 2 1803 7.5306659564375877e-03 0 -1 1804 + 1.7505730502307415e-03 -2 -3 1805 3.8401300553232431e-03 + + -1.5460279583930969e-01 2.1335080265998840e-01 + 2.3800070583820343e-01 -4.1055840253829956e-01 + <_> + + 1 2 1806 -2.5041550397872925e-01 0 -1 1807 + -2.0444789528846741e-01 -2 -3 1808 -1.2383040040731430e-02 + + -3.7927308678627014e-01 4.9870368838310242e-01 + 4.6343478560447693e-01 -6.7613303661346436e-02 + <_> + + 2 1 1809 1.9026029622182250e-03 0 -1 1810 + -1.6705439984798431e-01 -2 -3 1811 -8.6937591433525085e-02 + + 3.5356861352920532e-01 -2.4803459644317627e-01 + -5.6781381368637085e-01 1.0121189802885056e-01 + <_> + + 1 0 1812 -1.0314949788153172e-02 2 -1 1813 + 4.5044738799333572e-03 -2 -3 1814 1.5172120183706284e-02 + + -5.2530448883771896e-02 -9.0071156620979309e-02 + 7.1758699417114258e-01 -3.7740949541330338e-02 + <_> + + 0 1 1815 -5.6233601644635201e-03 2 -1 1816 + 5.4567858576774597e-02 -2 -3 1817 9.7008212469518185e-04 + + 2.3325720429420471e-01 4.8646458983421326e-01 + -2.4600529670715332e-01 2.4224309250712395e-02 + <_> + + 0 1 1818 -2.7179729659110308e-03 2 -1 1819 + -2.0419640466570854e-02 -2 -3 1820 -3.3307760953903198e-02 + + -5.3633391857147217e-01 -1.1361650191247463e-02 + 6.7398411035537720e-01 -1.4063489437103271e-01 + <_> + + 0 1 1821 -2.5500180199742317e-02 -1 2 1822 + -4.0629908442497253e-02 -2 -3 1823 -9.0600941330194473e-03 + + -3.6177828907966614e-01 -5.4579132795333862e-01 + 5.2202242612838745e-01 2.2736469283699989e-02 + <_> + + 0 1 1824 -2.5635668635368347e-01 2 -1 1825 + -9.5340751111507416e-02 -2 -3 1826 -5.9463721700012684e-03 + + -8.3328348398208618e-01 -1.6835439950227737e-02 + 5.6909567117691040e-01 -2.4973009526729584e-01 + <_> + + 2 1 1827 -9.2139927437528968e-04 0 -1 1828 + -6.8437340669333935e-03 -2 -3 1829 -8.2487165927886963e-03 + + -3.6735090613365173e-01 1.6015109419822693e-01 + 5.2686601877212524e-01 -1.5151239931583405e-01 + <_> + + 1 0 1830 4.7555859200656414e-03 2 -1 1831 + 9.3567231670022011e-04 -2 -3 1832 -6.3907768344506621e-04 + + -4.2700308561325073e-01 1.7327770590782166e-01 + 1.3155570626258850e-01 -1.8646000325679779e-01 + <_> + + 0 1 1833 -5.6550311855971813e-03 -1 2 1834 + -1.2212459929287434e-02 -2 -3 1835 -1.0550339706242085e-02 + + 3.1297039985656738e-01 4.6750861406326294e-01 + -2.4461230635643005e-01 1.6502030193805695e-02 + <_> + + 0 1 1836 -7.5216998811811209e-04 2 -1 1837 + 3.0214080470614135e-04 -2 -3 1838 2.8510420816019177e-04 + + -1.0075300186872482e-01 -2.8865608572959900e-01 + -1.1844499967992306e-02 3.6691731214523315e-01 + <_> + + 1 0 1839 -4.4020009227097034e-03 2 -1 1840 + 3.5568218678236008e-02 -2 -3 1841 6.4601990743540227e-05 + + -7.7167138457298279e-02 -4.4335851073265076e-01 + 1.3781660236418247e-02 4.5319119095802307e-01 + <_> + + 1 0 1842 9.3313469551503658e-04 -1 2 1843 + -8.7838143110275269e-02 -2 -3 1844 2.8037109877914190e-03 + + -1.2059070169925690e-01 -4.6736609935760498e-01 + 7.1518830955028534e-02 4.4593128561973572e-01 + <_> + + 1 0 1845 2.3915059864521027e-03 2 -1 1846 + -1.8183189677074552e-03 -2 -3 1847 1.9244100258219987e-04 + + -3.3277919888496399e-01 9.1478407382965088e-02 + 4.9121279269456863e-02 -4.5266890525817871e-01 + <_> + + 1 0 1848 2.1789909899234772e-01 -1 2 1849 + 1.0331439552828670e-03 -2 -3 1850 -1.4138330519199371e-01 + + 7.4892401695251465e-01 -1.0637000203132629e-01 + -4.2974629998207092e-01 1.6179689764976501e-01 + <_> + + 0 1 1851 -5.9106688946485519e-02 2 -1 1852 + 7.8279376029968262e-03 -2 -3 1853 -3.1304039293900132e-04 + + -4.0774118900299072e-01 3.9237990975379944e-01 + 1.3964369893074036e-01 -9.7562357783317566e-02 + <_> + + 0 1 1854 -6.4937800168991089e-02 -1 2 1855 + -2.1739810705184937e-01 -2 -3 1856 -2.0257150754332542e-02 + + 2.2590440511703491e-01 -3.4484180808067322e-01 + 2.4723629653453827e-01 -6.6609263420104980e-02 + <_> + + 1 2 1857 -1.1548499576747417e-02 0 -1 1858 + -6.7811407148838043e-02 -2 -3 1859 -3.4953389316797256e-02 + + 1.9427110254764557e-01 -5.8727997541427612e-01 + 7.8955358266830444e-01 1.5297190286219120e-02 + <_> + + 0 1 1860 -1.7180469632148743e-01 2 -1 1861 + -2.5918710161931813e-04 -2 -3 1862 1.2741640210151672e-02 + + -2.9612448811531067e-01 1.0281720012426376e-01 + -3.0702060461044312e-01 2.1692450344562531e-01 + <_> + + 0 1 1863 -3.1258590519428253e-02 2 -1 1864 + 3.5533700138330460e-03 -2 -3 1865 -9.2502118786796927e-04 + + 5.7348787784576416e-01 5.0475007295608521e-01 + -2.6686659455299377e-01 9.2138834297657013e-03 + <_> + + 0 1 1866 -1.2170480331405997e-03 -1 2 1867 + -2.2023949772119522e-02 -2 -3 1868 2.9549229890108109e-02 + + -3.9172619581222534e-01 2.0690579712390900e-01 + -6.0358341783285141e-02 6.9752788543701172e-01 + <_> + + 1 2 1869 -7.2058511432260275e-04 0 -1 1870 + -2.5625678896903992e-01 -2 -3 1871 3.2817238569259644e-01 + + -3.3763760328292847e-01 5.7221870869398117e-02 + 1.8268160521984100e-02 4.5866298675537109e-01 + <_> + + 0 1 1872 -5.2478950470685959e-02 -1 2 1873 + -7.2261072695255280e-02 -2 -3 1874 -1.0751239955425262e-02 + + -3.7492391467094421e-01 5.6878948211669922e-01 + -3.2823160290718079e-01 5.0447538495063782e-02 + <_> + 43 + -1.1713529825210571e+00 + + <_> + + 1 2 1875 -3.6475598812103271e-02 0 -1 1876 + 1.2570239603519440e-02 -2 -3 1877 -5.3332238458096981e-03 + + 7.8855842351913452e-01 -5.8355428278446198e-02 + 6.4850552007555962e-03 -3.8411408662796021e-01 + <_> + + 1 2 1878 -3.8449079729616642e-03 0 -1 1879 + 1.8065240001305938e-03 -2 -3 1880 4.4460720382630825e-03 + + -8.8380120694637299e-02 6.6356122493743896e-01 + -2.2651070356369019e-01 1.2168529629707336e-01 + <_> + + 1 0 1881 -1.5441340208053589e-01 2 -1 1882 + 2.8965979814529419e-02 -2 -3 1883 -1.8112070858478546e-02 + + -1.7789100110530853e-01 3.8929471373558044e-01 + 4.2137289047241211e-01 -2.0651680231094360e-01 + <_> + + 0 1 1884 -3.0437670648097992e-03 -1 2 1885 + -2.7257429901510477e-03 -2 -3 1886 -1.5535579994320869e-02 + + -4.5531120896339417e-01 2.5576180219650269e-01 + 2.9463219642639160e-01 -1.2572860717773438e-01 + <_> + + 0 1 1887 -1.4182399958372116e-02 -1 2 1888 + 2.8875279240310192e-03 -2 -3 1889 1.9505630480125546e-03 + + -4.7841429710388184e-01 -1.4739120006561279e-01 + -1.1689100414514542e-02 3.8708359003067017e-01 + <_> + + 2 1 1890 -4.1997907683253288e-03 0 -1 1891 + -1.2343189679086208e-02 -2 -3 1892 -6.5799211151897907e-03 + + 2.1066769957542419e-01 -2.4238829314708710e-01 + -4.1709339618682861e-01 1.9089350104331970e-01 + <_> + + 1 0 1893 2.0319439936429262e-03 -1 2 1894 + -2.2653149440884590e-02 -2 -3 1895 -2.4583860067650676e-04 + + 2.7525109052658081e-01 6.1857348680496216e-01 + -3.7903881072998047e-01 -1.9395859912037849e-02 + <_> + + 0 1 1896 -1.1686830548569560e-03 -1 2 1897 + 3.6638419260270894e-04 -2 -3 1898 -5.7184919569408521e-05 + + 1.3913659751415253e-01 -2.6073169708251953e-01 + 3.0361440777778625e-01 -1.7147840559482574e-01 + <_> + + 2 1 1899 -2.3458409123122692e-03 0 -1 1900 + -7.0121302269399166e-03 -2 -3 1901 2.3318149149417877e-02 + + 1.7510280013084412e-01 -1.7132690548896790e-01 + 2.2869640588760376e-01 -3.7544658780097961e-01 + <_> + + 1 0 1902 2.7293559163808823e-02 -1 2 1903 + -7.4272030033171177e-03 -2 -3 1904 -7.8977271914482117e-03 + + -2.8686890006065369e-01 -6.9167411327362061e-01 + -4.1576528549194336e-01 1.0694450139999390e-01 + <_> + + 0 1 1905 -3.6563118919730186e-03 2 -1 1906 + 1.5060990117490292e-03 -2 -3 1907 -2.2211389616131783e-02 + + -4.2580971121788025e-01 2.3827329277992249e-01 + -6.2818527221679688e-01 -1.2995249591767788e-02 + <_> + + 1 2 1908 -1.0182500118389726e-03 0 -1 1909 + 2.7624370530247688e-02 -2 -3 1910 -3.0267149209976196e-02 + + 2.0952360332012177e-01 -3.9603650569915771e-01 + -2.9257088899612427e-01 1.6949739307165146e-02 + <_> + + 1 0 1911 8.2686528563499451e-02 2 -1 1912 + 6.4655147492885590e-02 -2 -3 1913 2.7647409588098526e-03 + + 3.3863779902458191e-01 6.1647278070449829e-01 + -1.4266699552536011e-01 1.2386939674615860e-01 + <_> + + 0 1 1914 -3.1129099428653717e-02 2 -1 1915 + -1.5587930101901293e-03 -2 -3 1916 -5.9767777565866709e-04 + + -3.7931808829307556e-01 -9.2908859252929688e-02 + -1.0530649870634079e-01 2.9945549368858337e-01 + <_> + + 0 1 1917 -5.0103079527616501e-02 2 -1 1918 + 2.5710230693221092e-02 -2 -3 1919 -8.8613387197256088e-04 + + -4.4678428769111633e-01 -4.3549379706382751e-01 + 2.0978139340877533e-01 -3.8637928664684296e-02 + <_> + + 0 1 1920 -6.0174837708473206e-03 2 -1 1921 + 6.2055201269686222e-03 -2 -3 1922 2.7212419081479311e-04 + + 2.9752719402313232e-01 6.6692227125167847e-01 + 2.1671950817108154e-02 -2.7139788866043091e-01 + <_> + + 0 1 1923 -1.3685439713299274e-02 -1 2 1924 + -6.1648458242416382e-01 -2 -3 1925 -2.6253409683704376e-02 + + 4.7005081176757812e-01 -5.2666938304901123e-01 + 1.3483020663261414e-01 -1.0639149695634842e-01 + <_> + + 1 2 1926 -4.1545720887370408e-04 0 -1 1927 + -3.6237420863471925e-04 -2 -3 1928 5.5113807320594788e-04 + + -1.8588809669017792e-01 5.2727550268173218e-01 + 4.5380011200904846e-02 -2.3133419454097748e-01 + <_> + + 1 2 1929 -3.1878859736025333e-03 0 -1 1930 + -6.2446491792798042e-03 -2 -3 1931 -2.1054609678685665e-03 + + 2.8475400805473328e-01 -4.0583759546279907e-01 + 2.6000189781188965e-01 -1.6356609761714935e-02 + <_> + + 1 0 1932 2.2513020667247474e-04 2 -1 1933 + -5.1745050586760044e-03 -2 -3 1934 -2.7152549009770155e-03 + + -1.8777419626712799e-01 1.2812760472297668e-01 + 3.4431490302085876e-01 -4.2658099532127380e-01 + <_> + + 1 0 1935 2.7846530079841614e-02 2 -1 1936 + 4.3891910463571548e-03 -2 -3 1937 1.9749049097299576e-03 + + -2.8553798794746399e-01 6.4455038309097290e-01 + -8.2864962518215179e-02 1.7122590541839600e-01 + <_> + + 1 0 1938 -3.1317298999056220e-04 -1 2 1939 + -1.5486280433833599e-02 -2 -3 1940 9.5049021765589714e-03 + + -1.2443479895591736e-01 -1.8395289778709412e-01 + 3.4495291113853455e-01 -2.0286519080400467e-02 + <_> + + 2 1 1941 -3.7190609145909548e-04 0 -1 1942 + 2.9666710179299116e-03 -2 -3 1943 -5.8068940415978432e-03 + + 4.3022842146456242e-03 -3.4436589479446411e-01 + -8.4134072065353394e-01 2.8392368555068970e-01 + <_> + + 2 1 1944 -5.5204080417752266e-03 0 -1 1945 + -1.3792069512419403e-04 -2 -3 1946 -3.7187319248914719e-02 + + -2.6300218701362610e-01 2.6706520467996597e-02 + -2.9245018959045410e-01 4.0641939640045166e-01 + <_> + + 1 0 1947 -5.0016207387670875e-04 -1 2 1948 + -1.5453010564669967e-03 -2 -3 1949 1.9056679448112845e-03 + + -1.1965669691562653e-01 -4.2565101385116577e-01 + 2.9724061489105225e-01 -4.7963049262762070e-02 + <_> + + 0 1 1950 7.2636879049241543e-03 2 -1 1951 + 1.9141070079058409e-03 -2 -3 1952 1.2875479296781123e-04 + + -6.4583316445350647e-02 -3.5147330164909363e-01 + 1.1196230351924896e-01 5.7284992933273315e-01 + <_> + + 0 1 1953 -1.0092630051076412e-02 -1 2 1954 + -7.8368087997660041e-04 -2 -3 1955 -9.8703950643539429e-03 + + -3.7826448678970337e-01 2.3288239538669586e-01 + 2.1510779857635498e-01 -1.2697519361972809e-01 + <_> + + 0 1 1956 -1.0650960030034184e-03 -1 2 1957 + 8.5762650996912271e-05 -2 -3 1958 8.1163638969883323e-04 + + -3.2178428769111633e-01 -8.8832110166549683e-02 + 3.0365571379661560e-01 -8.3779007196426392e-02 + <_> + + 0 1 1959 -4.8947618342936039e-03 2 -1 1960 + 5.5883510503917933e-04 -2 -3 1961 -1.9008320523425937e-03 + + 1.6282820701599121e-01 -2.5395259261131287e-01 + -1.3888220489025116e-01 2.9919460415840149e-01 + <_> + + 1 2 1962 -2.0215269178152084e-03 0 -1 1963 + -4.4383360072970390e-03 -2 -3 1964 6.8489909172058105e-02 + + 3.9251059293746948e-01 -4.3069578707218170e-02 + 2.4472021032124758e-03 -2.9618039727210999e-01 + <_> + + 1 0 1965 5.0306279212236404e-02 2 -1 1966 + -5.6435600854456425e-03 -2 -3 1967 -8.9875478297472000e-03 + + 4.2249730229377747e-01 -9.2901676893234253e-02 + 6.6785961389541626e-01 6.2985196709632874e-02 + <_> + + 1 2 1968 -7.9090101644396782e-04 0 -1 1969 + -2.5300959125161171e-02 -2 -3 1970 7.8745762584730983e-04 + + 3.0849850177764893e-01 -6.3608251512050629e-02 + -1.4883120357990265e-01 2.6234000921249390e-01 + <_> + + 1 0 1971 7.6404176652431488e-02 -1 2 1972 + -7.9231243580579758e-03 -2 -3 1973 1.9256339874118567e-03 + + -4.5977321267127991e-01 -3.9364838600158691e-01 + -6.4516498241573572e-04 2.8573459386825562e-01 + <_> + + 1 0 1974 3.3896900713443756e-03 -1 2 1975 + 2.6566439191810787e-04 -2 -3 1976 -7.0364158600568771e-03 + + -4.1618600487709045e-01 8.7239697575569153e-02 + 5.4902660846710205e-01 -3.1658211350440979e-01 + <_> + + 1 0 1977 2.7734860777854919e-02 -1 2 1978 + 3.3155460841953754e-03 -2 -3 1979 5.4807748645544052e-02 + + 3.5683360695838928e-01 2.0545400679111481e-02 + -3.7979850172996521e-01 8.2199662923812866e-01 + <_> + + 0 1 1980 -3.1911249971017241e-04 -1 2 1981 + -2.3244849580805749e-04 -2 -3 1982 2.4389199912548065e-02 + + 2.3498380184173584e-01 1.5976969897747040e-01 + -1.6952790319919586e-01 3.8837739825248718e-01 + <_> + + 1 0 1983 3.7521280348300934e-02 -1 2 1984 + 5.3981738165020943e-04 -2 -3 1985 -1.1914219940081239e-03 + + -5.3004390001296997e-01 -9.2949196696281433e-02 + 2.5772979855537415e-01 -1.2804870307445526e-01 + <_> + + 0 1 1986 -1.9628699868917465e-02 2 -1 1987 + -2.6430340949445963e-03 -2 -3 1988 -1.0492499917745590e-02 + + -4.5749071240425110e-01 -6.6639073193073273e-02 + 3.7817710638046265e-01 -7.0677888579666615e-03 + <_> + + 1 0 1989 -8.1244978355243802e-04 2 -1 1990 + 1.4308369718492031e-02 -2 -3 1991 -2.6346129016019404e-04 + + 7.1544222533702850e-02 -4.6973049640655518e-01 + 3.2926559448242188e-01 -2.3322540521621704e-01 + <_> + + 1 0 1992 9.5907926559448242e-02 -1 2 1993 + -1.2872040271759033e-01 -2 -3 1994 -3.1911451369524002e-02 + + 9.9990457296371460e-01 5.7599371671676636e-01 + -7.3348528146743774e-01 -1.8063450232148170e-02 + <_> + + 1 2 1995 3.7128551048226655e-04 0 -1 1996 + -2.8491979464888573e-03 -2 -3 1997 -4.2754760943353176e-04 + + -5.4329651594161987e-01 1.0755009949207306e-01 + 2.2071920335292816e-01 -2.6160699129104614e-01 + <_> + + 1 2 1998 9.7452866612002254e-05 0 -1 1999 + 5.2659702487289906e-04 -2 -3 2000 5.9415772557258606e-04 + + -2.0488780736923218e-01 3.1935650110244751e-01 + 1.5211449563503265e-01 -2.8799989819526672e-01 + <_> + + 0 1 2001 -2.1307960560079664e-04 -1 2 2002 + -1.2103560147807002e-03 -2 -3 2003 1.2572610285133123e-03 + + 1.5206280350685120e-01 -2.3918260633945465e-01 + 3.7353378534317017e-01 -8.1597693264484406e-02 + <_> + 46 + -1.0940879583358765e+00 + + <_> + + 1 2 2004 -3.1007960438728333e-02 0 -1 2005 + -3.1969440169632435e-03 -2 -3 2006 -2.0676921121776104e-03 + + 6.8854278326034546e-01 -5.4836649447679520e-02 + -3.5974439978599548e-01 -3.0973760411143303e-02 + <_> + + 1 0 2007 -1.1122719943523407e-01 2 -1 2008 + 1.4844049699604511e-02 -2 -3 2009 -3.4631208982318640e-03 + + -1.5703879296779633e-01 -2.0413580536842346e-01 + 6.6245990991592407e-01 1.5534339845180511e-01 + <_> + + 0 1 2010 -1.2320470064878464e-01 2 -1 2011 + 1.1103290133178234e-02 -2 -3 2012 4.7404197975993156e-03 + + -5.2760660648345947e-01 -4.7932231426239014e-01 + -1.0074780136346817e-01 1.6249769926071167e-01 + <_> + + 1 2 2013 -5.8416109532117844e-03 0 -1 2014 + -5.1666028797626495e-02 -2 -3 2015 -3.9447061717510223e-03 + + -3.7591809034347534e-01 3.7338769435882568e-01 + 2.4347339570522308e-01 -1.4522999525070190e-01 + <_> + + 0 1 2016 -3.6320939660072327e-02 -1 2 2017 + 3.7123491056263447e-03 -2 -3 2018 -2.8242779895663261e-02 + + -3.6804199218750000e-01 1.0094779729843140e-01 + 4.2476901412010193e-01 -4.3828350305557251e-01 + <_> + + 1 2 2019 -2.0250169560313225e-02 0 -1 2020 + 3.0780840665102005e-02 -2 -3 2021 2.5205970741808414e-03 + + 1.6355019807815552e-01 -6.3770228624343872e-01 + -1.9899259507656097e-01 3.1258741021156311e-01 + <_> + + 0 1 2022 -4.2486261576414108e-02 2 -1 2023 + 3.0256640166044235e-02 -2 -3 2024 1.2559810420498252e-03 + + -6.1104768514633179e-01 7.7699762582778931e-01 + 6.8223267793655396e-02 -1.8402789533138275e-01 + <_> + + 0 1 2025 -1.8111230805516243e-02 2 -1 2026 + -7.0966721978038549e-04 -2 -3 2027 2.0517550874501467e-03 + + 3.7390831112861633e-01 7.1673221886157990e-02 + -2.3723709583282471e-01 4.2304378747940063e-01 + <_> + + 0 1 2028 -6.6939830780029297e-02 -1 2 2029 + -8.4355175495147705e-03 -2 -3 2030 -7.6646007597446442e-02 + + -6.4464849233627319e-01 -5.9667718410491943e-01 + -3.5360890626907349e-01 7.6701030135154724e-02 + <_> + + 0 1 2031 -1.8152770353481174e-03 -1 2 2032 + -2.7247369289398193e-03 -2 -3 2033 -5.4963980801403522e-04 + + 1.7099569737911224e-01 1.6262990236282349e-01 + -4.4764471054077148e-01 -7.4255913496017456e-02 + <_> + + 0 1 2034 -4.1336409747600555e-02 -1 2 2035 + -1.2627179920673370e-01 -2 -3 2036 -4.9632410518825054e-03 + + -3.0079290270805359e-01 -2.1949230134487152e-01 + 3.1715381145477295e-01 1.6522889956831932e-02 + <_> + + 0 1 2037 -6.8255789577960968e-02 2 -1 2038 + 1.7256699502468109e-02 -2 -3 2039 1.8318969523534179e-03 + + 3.7629279494285583e-01 6.0703051090240479e-01 + 4.4839300215244293e-02 -1.8284620344638824e-01 + <_> + + 1 0 2040 6.2703560106456280e-03 2 -1 2041 + 6.4142688643187284e-04 -2 -3 2042 -1.2087869690731168e-03 + + 1.5012329816818237e-01 -2.4387939274311066e-01 + -9.6486136317253113e-02 4.5252281427383423e-01 + <_> + + 1 2 2043 -1.3087630271911621e-02 0 -1 2044 + -2.0685649942606688e-03 -2 -3 2045 -9.9608547985553741e-02 + + 3.4508320689201355e-01 -4.1232489049434662e-02 + -5.4945659637451172e-01 -5.1996659487485886e-02 + <_> + + 1 2 2046 -3.6486559547483921e-03 0 -1 2047 + -2.8182850219309330e-03 -2 -3 2048 5.5368460714817047e-02 + + -3.3460721373558044e-01 1.5438309311866760e-01 + -2.0008920133113861e-01 2.6830759644508362e-01 + <_> + + 0 1 2049 -7.4223391711711884e-03 2 -1 2050 + -4.4916807673871517e-03 -2 -3 2051 -6.0621831566095352e-02 + + -2.5990688800811768e-01 9.8559968173503876e-02 + -3.5481810569763184e-01 4.1711899638175964e-01 + <_> + + 1 2 2052 2.3197410337161273e-04 0 -1 2053 + -2.6323291240260005e-04 -2 -3 2054 1.8173559510614723e-04 + + 1.1800730228424072e-01 -1.8469020724296570e-01 + 3.3645889163017273e-01 -1.6443650424480438e-01 + <_> + + 1 2 2055 -4.3080520117655396e-04 0 -1 2056 + 8.4635447710752487e-03 -2 -3 2057 3.2700230367481709e-03 + + -3.5056531429290771e-01 3.3979919552803040e-01 + -1.9305050373077393e-01 1.0525429993867874e-01 + <_> + + 2 1 2058 1.2329599820077419e-02 0 -1 2059 + 3.2368130632676184e-04 -2 -3 2060 -7.1359151042997837e-03 + + -7.0782758295536041e-02 4.2691200971603394e-01 + 2.4507419764995575e-01 -1.1304569989442825e-01 + <_> + + 0 1 2061 -3.8914520293474197e-02 2 -1 2062 + 6.6584121668711305e-04 -2 -3 2063 -9.3276530969887972e-04 + + -4.1401219367980957e-01 -1.2954230606555939e-01 + -2.8715679422020912e-02 2.9640379548072815e-01 + <_> + + 2 1 2064 9.1005821013823152e-04 0 -1 2065 + 7.4173710308969021e-03 -2 -3 2066 -5.9348379727452993e-04 + + 1.5225520357489586e-02 5.1878088712692261e-01 + 6.3158690929412842e-02 -1.6790659725666046e-01 + <_> + + 0 1 2067 -1.6713090008124709e-03 2 -1 2068 + -3.2247399212792516e-04 -2 -3 2069 -3.3846818841993809e-03 + + 1.8846319615840912e-01 -2.2796130180358887e-01 + 3.0563241243362427e-01 -8.1067040562629700e-02 + <_> + + 1 0 2070 9.5189079642295837e-02 2 -1 2071 + 9.7679207101464272e-04 -2 -3 2072 -1.0893770307302475e-01 + + 1.9821229577064514e-01 1.4671079814434052e-01 + -6.9909930229187012e-01 -1.1488740146160126e-01 + <_> + + 1 2 2073 -1.7448779195547104e-02 0 -1 2074 + -9.9434393632691354e-05 -2 -3 2075 6.4250029623508453e-02 + + 2.4062860012054443e-01 -8.9487351477146149e-02 + -1.7152050137519836e-01 5.1314127445220947e-01 + <_> + + 1 0 2076 5.9518171474337578e-03 -1 2 2077 + -9.0886192629113793e-04 -2 -3 2078 -5.1080051343888044e-04 + + 2.3301599919795990e-01 5.8810569345951080e-02 + -5.0240808725357056e-01 -8.0962918698787689e-02 + <_> + + 0 1 2079 -1.5467169694602489e-02 2 -1 2080 + 2.3221820592880249e-02 -2 -3 2081 3.9248089888133109e-04 + + -4.4010490179061890e-01 5.1546990871429443e-01 + -5.2290290594100952e-02 2.1555709838867188e-01 + <_> + + 0 1 2082 -1.1872940231114626e-03 -1 2 2083 + -1.1692909756675363e-03 -2 -3 2084 -1.8374159699305892e-03 + + 2.8682470321655273e-01 3.9871171116828918e-01 + -2.4273440241813660e-01 2.5974079966545105e-02 + <_> + + 0 1 2085 -3.9783148095011711e-03 2 -1 2086 + -4.7793678822927177e-04 -2 -3 2087 5.3964089602231979e-04 + + -2.5224199891090393e-01 1.0499279946088791e-01 + -4.1497600078582764e-01 1.0635569691658020e-01 + <_> + + 0 1 2088 -4.2262359056621790e-04 -1 2 2089 + -1.0138460248708725e-01 -2 -3 2090 -9.2142065986990929e-03 + + 2.1089179813861847e-01 -9.3101882934570312e-01 + -8.2452338933944702e-01 -2.4682279676198959e-02 + <_> + + 1 0 2091 4.3104309588670731e-02 -1 2 2092 + -5.3224200382828712e-03 -2 -3 2093 3.7746389862149954e-03 + + 9.0424752235412598e-01 -2.7320840954780579e-01 + -2.9543019831180573e-02 2.7356389164924622e-01 + <_> + + 1 0 2094 2.3850500583648682e-02 -1 2 2095 + -8.8544972240924835e-03 -2 -3 2096 -1.3691160082817078e-01 + + -5.1007378101348877e-01 4.8890089988708496e-01 + -5.5362242460250854e-01 2.5062739849090576e-02 + <_> + + 0 1 2097 -2.5274729356169701e-02 2 -1 2098 + 2.6481070090085268e-03 -2 -3 2099 -2.0161429711151868e-04 + + -7.3669922351837158e-01 2.6283189654350281e-01 + -2.4148160219192505e-01 5.1645949482917786e-02 + <_> + + 0 1 2100 -1.1898370459675789e-02 -1 2 2101 + -1.9360600272193551e-03 -2 -3 2102 2.1037699189037085e-03 + + -6.3804662227630615e-01 3.9121028780937195e-01 + -5.2923560142517090e-02 2.3925469815731049e-01 + <_> + + 0 1 2103 -1.3646620325744152e-02 -1 2 2104 + -8.8408291339874268e-03 -2 -3 2105 3.7220980972051620e-02 + + 4.5531919598579407e-01 -5.2776831388473511e-01 + -5.2423689514398575e-02 2.1479150652885437e-01 + <_> + + 1 2 2106 -4.2580282315611839e-03 0 -1 2107 + -4.6129771508276463e-03 -2 -3 2108 5.9317899867892265e-03 + + -5.8091402053833008e-01 9.2666886746883392e-02 + -6.7499437136575580e-04 3.6766529083251953e-01 + <_> + + 1 0 2109 9.4187082722783089e-03 -1 2 2110 + -4.1941772215068340e-03 -2 -3 2111 5.1073678769171238e-03 + + -6.1342322826385498e-01 -3.8310700654983521e-01 + 6.7254997789859772e-02 -3.9773949980735779e-01 + <_> + + 1 0 2112 -5.5304579436779022e-03 2 -1 2113 + -6.0295849107205868e-04 -2 -3 2114 -7.0414398796856403e-03 + + -1.2926359474658966e-01 1.8724639713764191e-01 + 4.7651541233062744e-01 -2.3238509893417358e-01 + <_> + + 1 0 2115 -1.3096419861540198e-03 2 -1 2116 + 3.2035118783824146e-04 -2 -3 2117 -3.3677490428090096e-03 + + -8.3683609962463379e-02 4.4803410768508911e-01 + 2.6184868812561035e-01 -2.1176619827747345e-01 + <_> + + 0 1 2118 -1.3419929891824722e-02 2 -1 2119 + 4.5043388381600380e-03 -2 -3 2120 -7.8677892452105880e-04 + + -5.1725488901138306e-01 -2.4854829907417297e-01 + 2.2026860713958740e-01 -2.9989460483193398e-02 + <_> + + 0 1 2121 -4.0467849373817444e-01 -1 2 2122 + -1.6472050547599792e-01 -2 -3 2123 -4.3211959302425385e-02 + + -8.6876207590103149e-01 -2.6331049203872681e-01 + -1.2996859848499298e-01 1.2739099562168121e-01 + <_> + + 0 1 2124 -1.7417479539290071e-03 2 -1 2125 + -8.3949731197208166e-04 -2 -3 2126 1.5101189492270350e-03 + + 8.2801252603530884e-02 -3.8465818762779236e-01 + 1.3933099806308746e-01 -3.5602769255638123e-01 + <_> + + 1 0 2127 3.6241519264876842e-03 2 -1 2128 + 1.6943299851845950e-04 -2 -3 2129 -5.5435068905353546e-02 + + 2.3847030103206635e-01 5.6582901626825333e-02 + 8.5272318124771118e-01 -1.9084540009498596e-01 + <_> + + 1 0 2130 -2.3511620238423347e-02 2 -1 2131 + -2.2539960627909750e-04 -2 -3 2132 1.6610369086265564e-02 + + -1.3226120173931122e-01 -2.0941901020705700e-03 + 4.0792500972747803e-01 -2.9247689247131348e-01 + <_> + + 0 1 2133 -6.3177421689033508e-03 -1 2 2134 + 8.5653591668233275e-04 -2 -3 2135 -1.1638339608907700e-02 + + 2.4937899410724640e-01 -1.5689609944820404e-01 + 4.2693111300468445e-01 -1.3493919745087624e-02 + <_> + + 0 1 2136 -5.1630330272018909e-03 2 -1 2137 + 4.8902099952101707e-03 -2 -3 2138 -2.9903270304203033e-02 + + 2.8233599662780762e-01 -2.2749769687652588e-01 + -3.1318700313568115e-01 7.2451077401638031e-02 + <_> + + 1 0 2139 3.1764109735377133e-04 -1 2 2140 + 5.2735407371073961e-04 -2 -3 2141 3.4350980422459543e-04 + + -1.3494649529457092e-01 -9.4839558005332947e-02 + -2.8737118840217590e-01 2.6408618688583374e-01 + <_> + 47 + -1.1282010078430176e+00 + + <_> + + 0 1 2142 2.0928289741277695e-03 2 -1 2143 + -2.0667549222707748e-02 -2 -3 2144 4.1186730377376080e-03 + + -2.4059830605983734e-01 -8.3949699997901917e-02 + 7.5294119119644165e-01 -2.5010040402412415e-01 + <_> + + 2 1 2145 -7.7038057148456573e-02 0 -1 2146 + 6.8526387214660645e-02 -2 -3 2147 -9.1197844594717026e-03 + + -1.6047920286655426e-01 5.8060508966445923e-01 + 4.0888330340385437e-01 -2.3711539804935455e-02 + <_> + + 2 1 2148 3.8453419692814350e-03 0 -1 2149 + -4.0648199617862701e-02 -2 -3 2150 -3.5154789686203003e-02 + + -3.6227381229400635e-01 2.8189870715141296e-01 + -6.3932722806930542e-01 -8.8311180472373962e-02 + <_> + + 1 0 2151 1.7193749547004700e-02 -1 2 2152 + -3.1834539026021957e-02 -2 -3 2153 5.9677828103303909e-03 + + 2.1619839966297150e-01 -6.1106377840042114e-01 + -1.3163220137357712e-03 -6.7810398340225220e-01 + <_> + + 0 1 2154 1.7432730237487704e-04 -1 2 2155 + -1.0427909903228283e-02 -2 -3 2156 -1.4324070070870221e-04 + + -1.6660380363464355e-01 3.0099079012870789e-01 + -3.6957770586013794e-01 7.5943082571029663e-02 + <_> + + 1 0 2157 -1.0312269441783428e-03 -1 2 2158 + -8.9528188109397888e-03 -2 -3 2159 5.4365568794310093e-03 + + -8.3984650671482086e-02 3.3358749747276306e-01 + -2.5666850805282593e-01 3.6911809444427490e-01 + <_> + + 1 0 2160 2.0321870688349009e-03 2 -1 2161 + 1.9954480230808258e-03 -2 -3 2162 1.6922239214181900e-02 + + -1.1628130078315735e-01 -2.2477209568023682e-01 + 3.6504098773002625e-01 1.8671670928597450e-02 + <_> + + 1 2 2163 -1.4152450021356344e-03 0 -1 2164 + 8.0416322452947497e-04 -2 -3 2165 6.2191791832447052e-02 + + -4.4372379779815674e-02 2.6297140121459961e-01 + -1.4997449517250061e-01 5.6759977340698242e-01 + <_> + + 0 1 2166 -4.4721928425133228e-03 -1 2 2167 + -1.9247440621256828e-02 -2 -3 2168 5.2884127944707870e-03 + + -2.9525101184844971e-01 -7.0941370725631714e-01 + 4.9494709819555283e-03 3.6569160223007202e-01 + <_> + + 1 0 2169 9.1529808938503265e-02 -1 2 2170 + -3.9309188723564148e-02 -2 -3 2171 -6.9177672266960144e-02 + + -4.7588708996772766e-01 -4.9558719992637634e-01 + 7.8180468082427979e-01 3.5177771002054214e-02 + <_> + + 1 0 2172 1.9501270726323128e-02 -1 2 2173 + -5.4460992105305195e-03 -2 -3 2174 1.0495989583432674e-02 + + 4.5107740163803101e-01 9.5154292881488800e-02 + -1.6815499961376190e-01 5.1015657186508179e-01 + <_> + + 1 0 2175 5.7117962278425694e-03 -1 2 2176 + -2.7439638972282410e-01 -2 -3 2177 -4.5373341999948025e-03 + + -7.4655741453170776e-01 -6.0310351848602295e-01 + 2.3245190083980560e-01 -4.1262548416852951e-02 + <_> + + 1 0 2178 4.7711891238577664e-04 -1 2 2179 + -6.9821202196180820e-03 -2 -3 2180 -1.0556570291519165e+00 + + -1.5402629971504211e-01 -5.2603191137313843e-01 + -5.0477248430252075e-01 1.4896139502525330e-01 + <_> + + 0 1 2181 -1.7868630588054657e-01 -1 2 2182 + 9.6028903499245644e-05 -2 -3 2183 1.4864769764244556e-03 + + 6.1333847045898438e-01 -1.2570370733737946e-01 + 1.5855489671230316e-01 -3.2419750094413757e-01 + <_> + + 2 1 2184 -2.7532540843822062e-04 0 -1 2185 + 1.9395699491724372e-03 -2 -3 2186 -3.0006670858711004e-03 + + 2.2301700711250305e-01 -1.4492830634117126e-01 + 2.5364619493484497e-01 -1.9060049951076508e-01 + <_> + + 2 1 2187 2.6949180755764246e-03 0 -1 2188 + -2.7354890480637550e-02 -2 -3 2189 -2.6278549805283546e-02 + + -6.9697231054306030e-01 2.6986810564994812e-01 + 8.3400028944015503e-01 -8.1475183367729187e-02 + <_> + + 0 1 2190 -1.1615309631451964e-03 -1 2 2191 + -7.9284235835075378e-03 -2 -3 2192 -4.0769609622657299e-03 + + 9.9186070263385773e-02 2.9844290018081665e-01 + 1.1436840146780014e-01 -3.5259690880775452e-01 + <_> + + 2 1 2193 1.3272130163386464e-03 0 -1 2194 + 9.6542192623019218e-03 -2 -3 2195 -1.8561830511316657e-03 + + 1.8691679835319519e-01 -3.3289530873298645e-01 + -4.8549610376358032e-01 -4.0883861482143402e-02 + <_> + + 1 0 2196 8.5922293365001678e-02 -1 2 2197 + -8.8873326778411865e-02 -2 -3 2198 -2.7235411107540131e-03 + + 3.6382618546485901e-01 -3.3766660094261169e-01 + 2.4199460446834564e-01 -4.2081810534000397e-02 + <_> + + 0 1 2199 -1.3049770146608353e-02 2 -1 2200 + -3.2052190508693457e-03 -2 -3 2201 -3.4975090529769659e-03 + + -3.0092039704322815e-01 -1.0076750069856644e-01 + -4.0278410911560059e-01 1.7511740326881409e-01 + <_> + + 1 2 2202 3.6366239655762911e-03 0 -1 2203 + -1.1586080305278301e-02 -2 -3 2204 3.9760980871506035e-04 + + 1.7796489596366882e-01 -1.6348969936370850e-01 + 6.7020449787378311e-03 4.4130641222000122e-01 + <_> + + 0 1 2205 -2.5880750268697739e-02 2 -1 2206 + 1.0445900261402130e-03 -2 -3 2207 -4.7445381060242653e-03 + + 6.0719907283782959e-01 -3.2216680049896240e-01 + 1.8654330074787140e-01 -5.8600809425115585e-02 + <_> + + 1 0 2208 7.0085371844470501e-03 -1 2 2209 + -7.0238402113318443e-03 -2 -3 2210 8.1113204360008240e-03 + + 3.1219249963760376e-01 -4.7851589322090149e-01 + -1.1469169706106186e-01 1.4005890488624573e-01 + <_> + + 1 2 2211 -4.0908880531787872e-02 0 -1 2212 + 6.7115128040313721e-03 -2 -3 2213 4.7661857679486275e-03 + + 1.1935690045356750e-01 -4.9553608894348145e-01 + 2.9291590908542275e-04 3.0523601174354553e-01 + <_> + + 2 1 2214 8.2969013601541519e-03 0 -1 2215 + -1.4058559900149703e-03 -2 -3 2216 3.8165580481290817e-03 + + 3.8395699858665466e-01 -5.8064288459718227e-03 + 8.5270447016227990e-05 -3.1768730282783508e-01 + <_> + + 0 1 2217 -1.5988849103450775e-02 2 -1 2218 + -4.2525809258222580e-02 -2 -3 2219 1.0341469943523407e-01 + + 5.8605968952178955e-01 1.5200969763100147e-02 + -4.2698180675506592e-01 9.1076821088790894e-01 + <_> + + 1 0 2220 1.5279020590241998e-04 -1 2 2221 + 4.4353670091368258e-04 -2 -3 2222 -2.1845809533260763e-04 + + -1.8349540233612061e-01 1.8386720120906830e-01 + -3.0458870530128479e-01 9.6679449081420898e-02 + <_> + + 0 1 2223 -6.9333161227405071e-03 2 -1 2224 + 2.6824630796909332e-02 -2 -3 2225 2.8827119618654251e-02 + + 1.9829869270324707e-01 5.7704108953475952e-01 + -1.3593469560146332e-01 1.8093059957027435e-01 + <_> + + 1 0 2226 3.4493818879127502e-02 -1 2 2227 + -3.9107841439545155e-03 -2 -3 2228 2.0955900254193693e-04 + + 2.7782711386680603e-01 1.0099980235099792e-01 + -1.6889050602912903e-02 -3.4672379493713379e-01 + <_> + + 1 2 2229 -1.1503810063004494e-02 0 -1 2230 + -5.8503649197518826e-03 -2 -3 2231 -1.9477239402476698e-04 + + 2.9069650173187256e-01 -5.7935047149658203e-01 + -1.5547400712966919e-01 8.7707668542861938e-02 + <_> + + 1 2 2232 -2.4192599812522531e-04 0 -1 2233 + -8.7722227908670902e-04 -2 -3 2234 -8.8649448007345200e-03 + + -4.9958980083465576e-01 2.2867499291896820e-01 + 1.4817740023136139e-01 -1.4039020240306854e-01 + <_> + + 1 0 2235 6.6976482048630714e-03 2 -1 2236 + 1.6602370305918157e-04 -2 -3 2237 5.6860040873289108e-02 + + -1.7738009989261627e-01 2.5650730729103088e-01 + 1.7361199483275414e-02 -7.4021261930465698e-01 + <_> + + 1 0 2238 2.4098889902234077e-02 2 -1 2239 + 8.0347352195531130e-04 -2 -3 2240 6.9724403321743011e-02 + + -5.3940677642822266e-01 1.4385139942169189e-01 + -1.0675229877233505e-01 5.4217422008514404e-01 + <_> + + 1 0 2241 9.0714782709255815e-04 -1 2 2242 + -7.3141716711688787e-05 -2 -3 2243 -1.5573799610137939e-03 + + 2.4376200139522552e-01 7.3325037956237793e-02 + 4.9846198409795761e-02 -3.1094640493392944e-01 + <_> + + 0 1 2244 -1.3867990113794804e-02 -1 2 2245 + 1.1202249443158507e-03 -2 -3 2246 -3.7206329405307770e-02 + + -6.6426891088485718e-01 7.0658437907695770e-02 + 4.2091751098632812e-01 -2.5585201382637024e-01 + <_> + + 1 2 2247 -4.2576639680191875e-04 0 -1 2248 + 5.4934259504079819e-02 -2 -3 2249 9.6833100542426109e-04 + + -3.0530530214309692e-01 2.7118149399757385e-01 + -6.7041292786598206e-02 1.7276880145072937e-01 + <_> + + 0 1 2250 7.9393703490495682e-03 -1 2 2251 + 5.0757948309183121e-02 -2 -3 2252 -3.2133560627698898e-02 + + -5.3697269409894943e-02 4.0109890699386597e-01 + 4.3551141023635864e-01 -4.1936281323432922e-01 + <_> + + 1 0 2253 9.9633932113647461e-02 -1 2 2254 + -4.5324079692363739e-03 -2 -3 2255 7.6392642222344875e-04 + + -6.1999887228012085e-01 1.6984449326992035e-01 + 1.0533300042152405e-01 -2.1900549530982971e-01 + <_> + + 1 0 2256 -1.3120270334184170e-02 2 -1 2257 + -1.2095270212739706e-03 -2 -3 2258 -6.0685798525810242e-03 + + -5.1372468471527100e-02 -1.2173540145158768e-01 + -3.2418820261955261e-01 6.5560877323150635e-01 + <_> + + 0 1 2259 -4.4329889118671417e-02 -1 2 2260 + -1.1334549635648727e-02 -2 -3 2261 -9.7028171876445413e-04 + + -2.6503491401672363e-01 -7.6205557584762573e-01 + -9.5501512289047241e-02 1.5263360738754272e-01 + <_> + + 0 1 2262 -8.4918709471821785e-03 -1 2 2263 + -6.9846503436565399e-02 -2 -3 2264 9.2466361820697784e-02 + + 1.9973739981651306e-01 3.1325021386146545e-01 + -1.1733359843492508e-01 7.7850347757339478e-01 + <_> + + 0 1 2265 -9.5799759030342102e-02 2 -1 2266 + 5.1276460289955139e-03 -2 -3 2267 6.1059608124196529e-03 + + 7.8442037105560303e-01 1.5389220416545868e-01 + -1.3577620685100555e-01 2.1575249731540680e-01 + <_> + + 2 1 2268 -5.5722601246088743e-04 0 -1 2269 + 5.2772291004657745e-02 -2 -3 2270 -3.7010889500379562e-03 + + -1.3534410297870636e-01 2.9378059506416321e-01 + -1.7292410135269165e-01 2.3805269598960876e-01 + <_> + + 1 0 2271 -1.3051830464974046e-03 -1 2 2272 + -4.0903348475694656e-02 -2 -3 2273 -6.3687269575893879e-03 + + -5.5020369589328766e-02 -3.0940970778465271e-01 + 6.5783101320266724e-01 9.2643633484840393e-02 + <_> + + 2 1 2274 1.4673050027340651e-03 0 -1 2275 + 5.3080540150403976e-02 -2 -3 2276 4.5696222223341465e-03 + + 1.1342869699001312e-01 -3.8801661133766174e-01 + 8.7235711514949799e-02 -5.5333012342453003e-01 + <_> + + 2 1 2277 2.7171480469405651e-03 0 -1 2278 + -7.5547560118138790e-03 -2 -3 2279 2.1428259788081050e-04 + + 4.6386051177978516e-01 2.2095510736107826e-02 + -1.7482960224151611e-01 1.6784119606018066e-01 + <_> + + 1 2 2280 1.1644139885902405e-03 0 -1 2281 + 2.7417868841439486e-03 -2 -3 2282 5.1555588841438293e-02 + + -3.0654639005661011e-01 5.7464569807052612e-02 + 1.3891890645027161e-01 -4.4362550973892212e-01 + <_> + 46 + -1.0841189622879028e+00 + + <_> + + 1 0 2283 -1.9345199689269066e-03 -1 2 2284 + 5.4789008572697639e-03 -2 -3 2285 1.3723999727517366e-03 + + -2.9038429260253906e-01 -4.9600031226873398e-02 + 8.1412100791931152e-01 -4.1888630390167236e-01 + <_> + + 1 2 2286 2.6495110243558884e-02 0 -1 2287 + -1.3697579503059387e-01 -2 -3 2288 -3.0566600617021322e-04 + + 2.4463020265102386e-01 -1.4825659990310669e-01 + 6.5781980752944946e-01 -7.9236596822738647e-02 + <_> + + 0 1 2289 -1.9925139844417572e-02 -1 2 2290 + -1.3427959382534027e-01 -2 -3 2291 -1.0180550161749125e-03 + + -7.2399538755416870e-01 5.6490647792816162e-01 + 1.0791130363941193e-01 -1.4493170380592346e-01 + <_> + + 2 1 2292 -1.6956209437921643e-03 0 -1 2293 + -3.9232008159160614e-02 -2 -3 2294 -1.1985700111836195e-03 + + 2.0442679524421692e-01 -2.2484399378299713e-01 + -9.8312400281429291e-02 2.5217679142951965e-01 + <_> + + 1 0 2295 5.6637298315763474e-02 -1 2 2296 + -1.4088810421526432e-02 -2 -3 2297 1.9742019474506378e-02 + + 4.2156541347503662e-01 -5.4424422979354858e-01 + -4.3038509786128998e-02 3.9660850167274475e-01 + <_> + + 0 1 2298 -3.7790019065141678e-02 -1 2 2299 + -2.1278490126132965e-01 -2 -3 2300 -7.5766840018332005e-04 + + -5.3746891021728516e-01 2.9742780327796936e-01 + -1.7239089310169220e-01 9.4371169805526733e-02 + <_> + + 0 1 2301 1.0515520116314292e-03 -1 2 2302 + -4.6967338770627975e-02 -2 -3 2303 -6.6702580079436302e-03 + + -9.4606198370456696e-02 3.8049909472465515e-01 + -3.6735290288925171e-01 1.8134810030460358e-01 + <_> + + 0 1 2304 -8.8434442877769470e-03 -1 2 2305 + -7.5162857770919800e-02 -2 -3 2306 6.0678281442960724e-05 + + 1.9733619689941406e-01 2.8719368577003479e-01 + -2.1481469273567200e-01 4.5404769480228424e-02 + <_> + + 0 1 2307 -2.6157319545745850e-02 -1 2 2308 + -2.5265390053391457e-02 -2 -3 2309 -5.3271669894456863e-03 + + -5.9915411472320557e-01 -3.2973399758338928e-01 + 4.3388798832893372e-01 1.2896250002086163e-02 + <_> + + 0 1 2310 -4.6350698918104172e-02 2 -1 2311 + 8.5780251538380980e-04 -2 -3 2312 8.7990947067737579e-03 + + -4.4396370649337769e-01 -1.0408560186624527e-01 + 2.6796650141477585e-02 3.4592410922050476e-01 + <_> + + 2 1 2313 -8.6540228221565485e-04 0 -1 2314 + 1.4915770152583718e-03 -2 -3 2315 -1.7994260415434837e-02 + + -3.0356478691101074e-01 2.4568190798163414e-02 + -3.6277890205383301e-01 2.3864120244979858e-01 + <_> + + 1 0 2316 3.1142059713602066e-02 -1 2 2317 + -1.3936620205640793e-02 -2 -3 2318 -2.1907410700805485e-04 + + 3.8710731267929077e-01 5.2351367473602295e-01 + -1.7730639874935150e-01 5.4297018796205521e-02 + <_> + + 2 1 2319 -1.5399450203403831e-03 0 -1 2320 + 2.0680578891187906e-03 -2 -3 2321 6.5148430876433849e-03 + + -1.2532320618629456e-01 1.5583939850330353e-01 + 2.7854940295219421e-01 -6.9196671247482300e-01 + <_> + + 1 0 2322 3.9056401699781418e-02 2 -1 2323 + -4.0204878896474838e-03 -2 -3 2324 2.9492459725588560e-03 + + -4.3681609630584717e-01 8.3736188709735870e-02 + -2.3137259483337402e-01 5.8771818876266479e-01 + <_> + + 2 1 2325 4.0582148358225822e-03 0 -1 2326 + 5.4531730711460114e-02 -2 -3 2327 2.4824589490890503e-03 + + 2.7056580781936646e-01 -3.6512500047683716e-01 + -2.2614318877458572e-03 3.5627979040145874e-01 + <_> + + 0 1 2328 -4.5967500656843185e-02 -1 2 2329 + -7.7245971187949181e-03 -2 -3 2330 1.0509139858186245e-02 + + -3.6472341418266296e-01 -3.5956159234046936e-01 + -1.1801080545410514e-03 2.6658898591995239e-01 + <_> + + 2 1 2331 2.7509370818734169e-02 0 -1 2332 + -3.8485318422317505e-02 -2 -3 2333 8.4051601588726044e-03 + + -5.8312857151031494e-01 2.4421650171279907e-01 + -1.2067990005016327e-01 2.0528540015220642e-01 + <_> + + 1 2 2334 -4.0405229665338993e-03 0 -1 2335 + 1.5476900443900377e-04 -2 -3 2336 2.4814540665829554e-05 + + 3.1298181414604187e-01 -2.5597780942916870e-01 + -2.2016249597072601e-01 5.4762478917837143e-02 + <_> + + 1 2 2337 -2.0571500062942505e-03 0 -1 2338 + -2.5400029495358467e-02 -2 -3 2339 -9.7940629348158836e-04 + + 1.5875819325447083e-01 -2.5695261359214783e-01 + -4.8633909225463867e-01 1.3700939714908600e-01 + <_> + + 1 0 2340 2.1806131117045879e-03 2 -1 2341 + -3.5455688834190369e-02 -2 -3 2342 7.0310868322849274e-03 + + -1.5206259489059448e-01 2.2079099714756012e-01 + -1.0352379828691483e-01 7.8391069173812866e-01 + <_> + + 2 1 2343 -1.9015279831364751e-03 0 -1 2344 + -2.7523210272192955e-02 -2 -3 2345 1.1140380054712296e-02 + + 2.2670629620552063e-01 -1.4048579335212708e-01 + 3.8015339523553848e-02 4.5577189326286316e-01 + <_> + + 0 1 2346 -1.4077059924602509e-02 -1 2 2347 + -7.5063481926918030e-03 -2 -3 2348 3.4938179887831211e-03 + + -3.4491220116615295e-01 2.4528980255126953e-01 + -1.3371880352497101e-01 1.5036830306053162e-01 + <_> + + 1 0 2349 5.0538990646600723e-02 -1 2 2350 + 5.9616268845275044e-04 -2 -3 2351 -2.0425749942660332e-02 + + 3.9677879214286804e-01 -1.6664770245552063e-01 + -3.4699028730392456e-01 1.3850739598274231e-01 + <_> + + 0 1 2352 -5.2063791081309319e-03 -1 2 2353 + -7.5247389031574130e-04 -2 -3 2354 -5.4832808673381805e-02 + + -3.6672219634056091e-01 -2.6418569684028625e-01 + 2.7295270562171936e-01 -3.5999810788780451e-03 + <_> + + 1 2 2355 1.7384309321641922e-02 0 -1 2356 + 8.1398971378803253e-03 -2 -3 2357 5.3603048436343670e-03 + + -9.5032609999179840e-02 3.2227438688278198e-01 + -1.8586769700050354e-02 4.8577728867530823e-01 + <_> + + 0 1 2358 -6.7889019846916199e-03 -1 2 2359 + -2.6219699066132307e-04 -2 -3 2360 -6.3086668960750103e-03 + + 4.3564158678054810e-01 -1.8974490463733673e-01 + -3.2145148515701294e-01 9.9988803267478943e-02 + <_> + + 1 0 2361 -7.5333809945732355e-04 -1 2 2362 + -5.1618018187582493e-04 -2 -3 2363 4.9971960484981537e-02 + + -6.4324781298637390e-02 4.0329611301422119e-01 + -1.0619989782571793e-01 7.8842008113861084e-01 + <_> + + 0 1 2364 -1.6776630282402039e-01 2 -1 2365 + 1.5873169759288430e-03 -2 -3 2366 -1.5413289656862617e-03 + + 8.3238917589187622e-01 -1.4161799848079681e-01 + -1.1225470155477524e-01 2.1630200743675232e-01 + <_> + + 1 2 2367 -6.0930051840841770e-03 0 -1 2368 + 1.2093319557607174e-02 -2 -3 2369 -1.0354000143706799e-02 + + 2.8332099318504333e-01 -7.5473171472549438e-01 + 3.1173440814018250e-01 -8.3147212862968445e-02 + <_> + + 1 2 2370 -2.2508190572261810e-01 0 -1 2371 + -3.9419779181480408e-01 -2 -3 2372 -7.0281741209328175e-03 + + 7.2753679752349854e-01 -4.7205528616905212e-01 + 2.6742509007453918e-01 -2.3675439879298210e-02 + <_> + + 0 1 2373 -1.0977389663457870e-01 -1 2 2374 + -1.8981259316205978e-02 -2 -3 2375 -1.5975029673427343e-03 + + 3.2995739579200745e-01 -4.1107800602912903e-01 + 3.9100599288940430e-01 -3.0054800212383270e-02 + <_> + + 2 1 2376 3.3699660561978817e-03 0 -1 2377 + 2.8608400374650955e-02 -2 -3 2378 1.1234980076551437e-02 + + -2.6757821440696716e-01 5.4922807216644287e-01 + 7.9798206686973572e-02 -4.9347519874572754e-01 + <_> + + 2 1 2379 1.0005270130932331e-02 0 -1 2380 + -1.3333059847354889e-01 -2 -3 2381 1.0838189627975225e-03 + + 4.3375509977340698e-01 1.4595700427889824e-02 + 9.0088322758674622e-03 -2.6673930883407593e-01 + <_> + + 1 0 2382 1.8866240279749036e-03 2 -1 2383 + -1.9594319164752960e-02 -2 -3 2384 -4.0433141402900219e-03 + + 1.6358950734138489e-01 2.3428240790963173e-02 + 1.8105390667915344e-01 -3.7628519535064697e-01 + <_> + + 1 2 2385 -1.3283960521221161e-01 0 -1 2386 + 3.8986348954495043e-05 -2 -3 2387 3.0710658757016063e-04 + + -4.7917541116476059e-02 5.7672798633575439e-01 + -1.0200879722833633e-01 1.3613240420818329e-01 + <_> + + 0 1 2388 -4.0010150521993637e-02 -1 2 2389 + -1.1752990540117025e-03 -2 -3 2390 -4.5838830992579460e-03 + + 7.0342528820037842e-01 1.1457219719886780e-01 + 7.0621937513351440e-02 -2.1597090363502502e-01 + <_> + + 1 0 2391 5.3299739956855774e-02 2 -1 2392 + 1.9961010664701462e-02 -2 -3 2393 -1.4994270168244839e-02 + + -1.6445639729499817e-01 4.0419510006904602e-01 + -4.9861040711402893e-01 6.1822768300771713e-02 + <_> + + 1 0 2394 4.2854552157223225e-03 -1 2 2395 + -1.3991270214319229e-02 -2 -3 2396 9.9598374217748642e-03 + + -7.2749477624893188e-01 1.5665039420127869e-01 + -1.2152709811925888e-01 2.4375760555267334e-01 + <_> + + 0 1 2397 -6.1463691294193268e-02 2 -1 2398 + 8.1084080738946795e-04 -2 -3 2399 1.4836339978501201e-03 + + -4.9159640073776245e-01 4.0312820672988892e-01 + 5.2907239645719528e-02 -2.0971420407295227e-01 + <_> + + 0 1 2400 2.8651900356635451e-04 2 -1 2401 + -4.9405667232349515e-04 -2 -3 2402 -1.3786340132355690e-03 + + -5.8905839920043945e-02 3.8144549727439880e-01 + -4.4638028740882874e-01 4.1437059640884399e-01 + <_> + + 1 0 2403 9.0396329760551453e-03 2 -1 2404 + 1.5593219723086804e-04 -2 -3 2405 -1.1492449790239334e-02 + + -5.8979207277297974e-01 1.4469850063323975e-01 + -6.2305951118469238e-01 -2.8079420328140259e-02 + <_> + + 0 1 2406 -1.0058670304715633e-02 -1 2 2407 + 2.8506040107458830e-03 -2 -3 2408 -1.0550140403211117e-02 + + 1.3063749670982361e-01 -1.5896910429000854e-01 + -5.8578401803970337e-01 4.1516658663749695e-01 + <_> + + 0 1 2409 -2.6834249496459961e-02 -1 2 2410 + -6.7446259781718254e-03 -2 -3 2411 -1.9539019558578730e-03 + + -2.3982690274715424e-01 -3.0731248855590820e-01 + 2.6545688509941101e-01 -2.7655568555928767e-04 + <_> + + 1 2 2412 -1.5296439826488495e-01 0 -1 2413 + 1.3547400012612343e-02 -2 -3 2414 4.4966558925807476e-03 + + 5.4796701669692993e-01 7.3741371743381023e-03 + -3.9956450928002596e-04 -3.4183570742607117e-01 + <_> + + 0 1 2415 -9.6259176731109619e-02 2 -1 2416 + 6.0006431303918362e-03 -2 -3 2417 4.8557221889495850e-03 + + -3.4981849789619446e-01 4.8977410793304443e-01 + 9.2725560069084167e-02 -1.3060179352760315e-01 + <_> + + 1 2 2418 -1.2333790073171258e-03 0 -1 2419 + -4.2365258559584618e-04 -2 -3 2420 8.3003565669059753e-03 + + 2.4704679846763611e-01 -3.9149808883666992e-01 + 9.2340186238288879e-03 4.0348419547080994e-01 + <_> + 44 + -1.1084890365600586e+00 + + <_> + + 2 1 2421 2.8592639137059450e-03 0 -1 2422 + -1.5535679645836353e-02 -2 -3 2423 -2.3885839618742466e-03 + + 8.2635468244552612e-01 2.2793740034103394e-02 + 6.7295722663402557e-02 -3.1476849317550659e-01 + <_> + + 0 1 2424 1.4029210433363914e-03 -1 2 2425 + -4.5515298843383789e-03 -2 -3 2426 9.4592738896608353e-03 + + -1.0290689766407013e-01 -3.2368329167366028e-01 + 5.4250991344451904e-01 -3.0348530411720276e-01 + <_> + + 1 0 2427 5.4062008857727051e-03 -1 2 2428 + -2.6852379087358713e-03 -2 -3 2429 -6.2019047618377954e-05 + + -2.8486549854278564e-01 2.6024919748306274e-01 + 1.6827000677585602e-01 -2.3859730362892151e-01 + <_> + + 1 0 2430 2.4147080257534981e-02 -1 2 2431 + 1.3977369526401162e-03 -2 -3 2432 2.0164279267191887e-02 + + 4.8240968585014343e-01 -3.6230188608169556e-01 + -3.6146581172943115e-02 5.0473397970199585e-01 + <_> + + 0 1 2433 -6.1244291067123413e-01 2 -1 2434 + 9.0631619095802307e-03 -2 -3 2435 1.7811909317970276e-01 + + -4.8220318555831909e-01 -5.7859402894973755e-01 + 8.5012361407279968e-02 -6.3362121582031250e-01 + <_> + + 1 0 2436 2.6881069061346352e-04 -1 2 2437 + -1.2180560268461704e-02 -2 -3 2438 4.0606390684843063e-03 + + -1.6075380146503448e-01 -6.5734118223190308e-01 + 5.4012559354305267e-02 4.9817681312561035e-01 + <_> + + 0 1 2439 -3.6952861119061708e-03 -1 2 2440 + -6.8888221867382526e-03 -2 -3 2441 2.7258940972387791e-03 + + -2.9826200008392334e-01 6.1437392234802246e-01 + -8.3065047860145569e-02 1.8066459894180298e-01 + <_> + + 2 1 2442 9.8391417413949966e-03 0 -1 2443 + 1.4573390362784266e-03 -2 -3 2444 -2.3016060004010797e-04 + + -4.8802070319652557e-02 2.9650750756263733e-01 + 8.3583436906337738e-02 -2.4457779526710510e-01 + <_> + + 1 2 2445 -1.3347089989110827e-03 0 -1 2446 + -2.3516249656677246e-01 -2 -3 2447 -3.1839110888540745e-03 + + -3.9780059456825256e-01 2.9200470447540283e-01 + 1.5484599769115448e-01 -1.3911180198192596e-01 + <_> + + 0 1 2448 -5.9498839080333710e-02 2 -1 2449 + 2.9865070246160030e-04 -2 -3 2450 -2.1592311095446348e-03 + + -8.0241578817367554e-01 -1.7932119965553284e-01 + -1.9703079760074615e-01 1.5901389718055725e-01 + <_> + + 0 1 2451 -8.7727643549442291e-02 -1 2 2452 + 1.8073969986289740e-03 -2 -3 2453 -3.0411710031330585e-04 + + 2.3391810059547424e-01 -1.9777239859104156e-01 + -2.2787599265575409e-01 2.3480290174484253e-01 + <_> + + 0 1 2454 -3.6778930574655533e-02 -1 2 2455 + -8.4806662052869797e-03 -2 -3 2456 4.4526819139719009e-02 + + 6.3471937179565430e-01 3.4320148825645447e-01 + -3.2206610776484013e-03 -3.3057790994644165e-01 + <_> + + 1 2 2457 -1.1732319835573435e-03 0 -1 2458 + 1.4339870540425181e-03 -2 -3 2459 7.7017117291688919e-04 + + -3.2894629240036011e-01 2.6812461018562317e-01 + 1.5722079575061798e-01 -1.2080919742584229e-01 + <_> + + 1 0 2460 5.0579622620716691e-04 -1 2 2461 + -1.6109919548034668e-01 -2 -3 2462 -9.3872181605547667e-04 + + 1.6917209327220917e-01 5.4838567972183228e-01 + 1.3432510197162628e-01 -1.8490299582481384e-01 + <_> + + 1 0 2463 1.0552279651165009e-02 2 -1 2464 + 4.1157208383083344e-02 -2 -3 2465 -1.3245060108602047e-03 + + -4.0745589137077332e-01 7.5326120853424072e-01 + -1.1372119933366776e-01 1.1744459718465805e-01 + <_> + + 1 0 2466 -7.3126708157360554e-03 -1 2 2467 + -1.5847360715270042e-02 -2 -3 2468 -5.2730008028447628e-03 + + -7.3187656700611115e-02 -4.7248768806457520e-01 + -3.9433181285858154e-01 3.2054188847541809e-01 + <_> + + 0 1 2469 -1.0163930244743824e-02 -1 2 2470 + -1.4269599691033363e-02 -2 -3 2471 -2.8677590307779610e-04 + + -5.2099817991256714e-01 4.4472008943557739e-01 + 1.0787820070981979e-01 -1.3239330053329468e-01 + <_> + + 1 2 2472 -4.4711050577461720e-04 0 -1 2473 + 6.9207558408379555e-03 -2 -3 2474 -4.7490649740211666e-04 + + -2.1184509992599487e-01 7.1038311719894409e-01 + -9.0368412435054779e-02 1.9339320063591003e-01 + <_> + + 0 1 2475 -1.4192230068147182e-02 -1 2 2476 + -5.9010402765125036e-04 -2 -3 2477 2.2904858924448490e-03 + + -3.8774991035461426e-01 4.2241969704627991e-01 + -8.0403536558151245e-02 1.7335900664329529e-01 + <_> + + 0 1 2478 -2.5104399770498276e-02 -1 2 2479 + -9.7052762284874916e-03 -2 -3 2480 2.7441041311249137e-04 + + -6.0312938690185547e-01 -6.5721738338470459e-01 + -5.2042860537767410e-02 1.8078009784221649e-01 + <_> + + 0 1 2481 -2.6883379905484617e-04 -1 2 2482 + 8.5731758736073971e-04 -2 -3 2483 -7.1471570990979671e-03 + + 1.8486160039901733e-01 3.6701809614896774e-02 + 3.8019171357154846e-01 -3.1314790248870850e-01 + <_> + + 0 1 2484 -5.9650279581546783e-03 2 -1 2485 + 6.5897651948034763e-03 -2 -3 2486 5.0898519111797214e-04 + + -3.7518349289894104e-01 2.1948930621147156e-01 + 5.8855868875980377e-02 -2.6831701397895813e-01 + <_> + + 0 1 2487 -1.9406380131840706e-02 2 -1 2488 + 1.0682499967515469e-02 -2 -3 2489 5.9157088398933411e-03 + + -4.0213540196418762e-01 6.6164708137512207e-01 + 3.6718819290399551e-02 -4.7886928915977478e-01 + <_> + + 0 1 2490 -4.9229031428694725e-03 -1 2 2491 + -1.2417170219123363e-02 -2 -3 2492 5.5979369208216667e-03 + + 2.2026430070400238e-01 -4.9814000725746155e-01 + -4.0141601115465164e-02 7.9332500696182251e-01 + <_> + + 0 1 2493 -1.8435899913311005e-01 2 -1 2494 + 6.4280577003955841e-02 -2 -3 2495 -1.6670690383762121e-03 + + 8.2392162084579468e-01 -5.1533687114715576e-01 + -5.7897537946701050e-01 3.1020650640130043e-02 + <_> + + 1 0 2496 4.7475788742303848e-02 2 -1 2497 + 2.5915699079632759e-03 -2 -3 2498 -6.8349228240549564e-04 + + 1.5852110087871552e-01 -2.8132149577140808e-01 + -8.4496207535266876e-02 3.4085351228713989e-01 + <_> + + 0 1 2499 -8.0965347588062286e-03 2 -1 2500 + 2.0750269293785095e-02 -2 -3 2501 2.0832920563407242e-04 + + 6.4384061098098755e-01 4.5479089021682739e-01 + -1.0736659914255142e-01 1.3257840275764465e-01 + <_> + + 0 1 2502 -3.6361071397550404e-04 -1 2 2503 + -6.1230720020830631e-03 -2 -3 2504 -4.2420169338583946e-03 + + 1.8995989859104156e-01 -5.5252599716186523e-01 + 2.9558050632476807e-01 -7.1881696581840515e-02 + <_> + + 0 1 2505 -3.2453850144520402e-04 2 -1 2506 + 1.2140260078012943e-02 -2 -3 2507 -1.8192020070273429e-04 + + -2.1697629988193512e-01 -3.1753998994827271e-01 + -1.1777029931545258e-01 1.7208409309387207e-01 + <_> + + 0 1 2508 -3.0392920598387718e-03 2 -1 2509 + 2.8347579063847661e-04 -2 -3 2510 -2.0839450880885124e-03 + + 1.8131990730762482e-01 1.4752319455146790e-01 + 1.2602719664573669e-01 -2.3448009788990021e-01 + <_> + + 2 1 2511 -1.5735890716314316e-02 0 -1 2512 + -5.9783339500427246e-02 -2 -3 2513 8.1148296594619751e-02 + + -3.7624269723892212e-01 1.0452839732170105e-01 + -4.6331068873405457e-01 1.4930450357496738e-02 + <_> + + 1 0 2514 5.8228247798979282e-03 2 -1 2515 + -5.7364261010661721e-04 -2 -3 2516 -3.6678448668681085e-04 + + -7.1261131763458252e-01 -3.9293140172958374e-02 + -1.0198889672756195e-01 4.7379100322723389e-01 + <_> + + 1 2 2517 -9.1290572891011834e-04 0 -1 2518 + 1.2561770156025887e-02 -2 -3 2519 -7.6223909854888916e-04 + + 3.5364340990781784e-02 4.8163351416587830e-01 + 4.6516609191894531e-01 -1.5139210224151611e-01 + <_> + + 0 1 2520 1.8540889723226428e-03 -1 2 2521 + -1.8188059329986572e-02 -2 -3 2522 2.5648679584264755e-02 + + 1.1853530257940292e-01 5.0805187225341797e-01 + -2.3640629649162292e-01 2.6991719007492065e-01 + <_> + + 0 1 2523 -2.5939470157027245e-02 2 -1 2524 + 9.7436201758682728e-04 -2 -3 2525 -1.2310179881751537e-03 + + -6.1304092407226562e-01 -1.6751369833946228e-01 + -2.6179370284080505e-01 1.2718600034713745e-01 + <_> + + 0 1 2526 -7.0769861340522766e-02 2 -1 2527 + 6.8592047318816185e-04 -2 -3 2528 7.2288517840206623e-03 + + 3.6499670147895813e-01 3.1916418671607971e-01 + -1.1326509714126587e-01 2.3138450086116791e-01 + <_> + + 0 1 2529 -4.7549661248922348e-03 -1 2 2530 + 3.8560681045055389e-02 -2 -3 2531 3.3737360499799252e-03 + + 1.2249550223350525e-01 -2.2969830036163330e-01 + -2.9323069378733635e-02 7.3215091228485107e-01 + <_> + + 0 1 2532 -1.4671970158815384e-02 -1 2 2533 + 3.5087150172330439e-04 -2 -3 2534 -2.0783280488103628e-03 + + -5.2395147085189819e-01 9.8115980625152588e-02 + 4.0350338816642761e-01 -2.2959670424461365e-01 + <_> + + 1 0 2535 -3.7065339274704456e-03 2 -1 2536 + 4.0150329470634460e-02 -2 -3 2537 -6.1276711523532867e-02 + + -9.2062972486019135e-02 -7.1320801973342896e-01 + 4.4615340232849121e-01 5.8714438229799271e-02 + <_> + + 1 2 2538 -9.9730096757411957e-02 0 -1 2539 + -7.7125482494011521e-04 -2 -3 2540 1.3902420178055763e-03 + + -1.4246919751167297e-01 5.1187419891357422e-01 + 1.8041240051388741e-02 -2.5729590654373169e-01 + <_> + + 0 1 2541 -2.5304889306426048e-02 -1 2 2542 + 2.5176260620355606e-02 -2 -3 2543 -2.7789679169654846e-01 + + -3.9365610480308533e-01 -1.7298270016908646e-02 + -5.1464182138442993e-01 4.1422238945960999e-01 + <_> + + 1 0 2544 4.6188719570636749e-02 -1 2 2545 + -1.7873500473797321e-03 -2 -3 2546 -1.2076550163328648e-02 + + -4.1546550393104553e-01 2.9358920454978943e-01 + 3.0501538515090942e-01 -8.3189137279987335e-02 + <_> + + 0 1 2547 -5.4004848934710026e-03 -1 2 2548 + -9.4532333314418793e-03 -2 -3 2549 -1.6526769613847136e-03 + + -4.8242959380149841e-01 -4.1864201426506042e-01 + -4.7690790891647339e-01 6.9955162703990936e-02 + <_> + + 0 1 2550 -3.1153310090303421e-02 2 -1 2551 + 5.1554460078477859e-03 -2 -3 2552 -2.7182319900020957e-04 + + 6.2633192539215088e-01 -2.2152930498123169e-01 + -2.8926940634846687e-02 3.6499640345573425e-01 + + <_> + + <_> + 8 7 12 1 -1. + <_> + 8 7 6 1 2. + 1 + <_> + + <_> + 4 7 8 6 -1. + <_> + 6 7 4 6 2. + <_> + + <_> + 5 3 12 12 -1. + <_> + 9 7 4 4 9. + <_> + + <_> + 1 8 12 12 -1. + <_> + 1 14 12 6 2. + <_> + + <_> + 5 9 9 5 -1. + <_> + 8 9 3 5 3. + <_> + + <_> + 5 7 9 6 -1. + <_> + 8 7 3 6 3. + <_> + + <_> + 2 0 18 15 -1. + <_> + 2 5 18 5 3. + <_> + + <_> + 7 1 9 9 -1. + <_> + 7 4 9 3 3. + <_> + + <_> + 8 19 3 1 -1. + <_> + 9 19 1 1 3. + <_> + + <_> + 5 17 2 2 -1. + <_> + 5 17 1 1 2. + <_> + 6 18 1 1 2. + <_> + + <_> + 5 17 2 2 -1. + <_> + 5 17 1 1 2. + <_> + 6 18 1 1 2. + <_> + + <_> + 10 18 3 1 -1. + <_> + 11 18 1 1 3. + <_> + + <_> + 7 7 9 7 -1. + <_> + 10 7 3 7 3. + <_> + + <_> + 6 8 12 5 -1. + <_> + 9 8 6 5 2. + <_> + + <_> + 13 1 6 7 -1. + <_> + 13 1 3 7 2. + 1 + <_> + + <_> + 5 2 12 15 -1. + <_> + 9 7 4 5 9. + <_> + + <_> + 6 5 14 1 -1. + <_> + 6 5 7 1 2. + 1 + <_> + + <_> + 9 9 10 1 -1. + <_> + 9 9 5 1 2. + 1 + <_> + + <_> + 2 9 9 3 -1. + <_> + 5 9 3 3 3. + <_> + + <_> + 0 8 20 12 -1. + <_> + 0 14 20 6 2. + <_> + + <_> + 0 5 4 13 -1. + <_> + 2 5 2 13 2. + <_> + + <_> + 11 18 3 2 -1. + <_> + 12 18 1 2 3. + <_> + + <_> + 11 18 3 1 -1. + <_> + 12 18 1 1 3. + <_> + + <_> + 11 19 3 1 -1. + <_> + 12 19 1 1 3. + <_> + + <_> + 10 9 9 3 -1. + <_> + 13 9 3 3 3. + <_> + + <_> + 5 8 8 7 -1. + <_> + 7 8 4 7 2. + <_> + + <_> + 8 6 9 8 -1. + <_> + 11 6 3 8 3. + <_> + + <_> + 4 18 2 2 -1. + <_> + 4 18 1 1 2. + <_> + 5 19 1 1 2. + <_> + + <_> + 4 18 2 2 -1. + <_> + 4 18 1 1 2. + <_> + 5 19 1 1 2. + <_> + + <_> + 7 6 8 14 -1. + <_> + 9 6 4 14 2. + <_> + + <_> + 16 13 4 3 -1. + <_> + 15 14 4 1 3. + 1 + <_> + + <_> + 16 13 4 2 -1. + <_> + 16 13 2 2 2. + 1 + <_> + + <_> + 5 6 6 14 -1. + <_> + 7 6 2 14 3. + <_> + + <_> + 0 7 8 11 -1. + <_> + 2 7 4 11 2. + <_> + + <_> + 0 7 8 7 -1. + <_> + 2 7 4 7 2. + <_> + + <_> + 2 16 3 1 -1. + <_> + 3 17 1 1 3. + 1 + <_> + + <_> + 3 0 15 18 -1. + <_> + 8 6 5 6 9. + <_> + + <_> + 0 6 20 14 -1. + <_> + 0 13 20 7 2. + <_> + + <_> + 6 7 9 7 -1. + <_> + 9 7 3 7 3. + <_> + + <_> + 3 9 6 2 -1. + <_> + 5 9 2 2 3. + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 1 1 2. + <_> + 18 17 1 1 2. + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 1 1 2. + <_> + 18 17 1 1 2. + <_> + + <_> + 14 8 6 5 -1. + <_> + 16 8 2 5 3. + <_> + + <_> + 16 18 4 2 -1. + <_> + 16 19 4 1 2. + <_> + + <_> + 8 8 9 12 -1. + <_> + 11 8 3 12 3. + <_> + + <_> + 8 18 3 1 -1. + <_> + 9 18 1 1 3. + <_> + + <_> + 8 18 3 2 -1. + <_> + 9 18 1 2 3. + <_> + + <_> + 0 8 4 11 -1. + <_> + 2 8 2 11 2. + <_> + + <_> + 10 0 10 1 -1. + <_> + 15 0 5 1 2. + <_> + + <_> + 13 1 3 3 -1. + <_> + 14 1 1 3 3. + <_> + + <_> + 2 8 12 12 -1. + <_> + 6 8 4 12 3. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 18 18 1 2 -1. + <_> + 18 19 1 1 2. + <_> + + <_> + 8 10 6 5 -1. + <_> + 10 10 2 5 3. + <_> + + <_> + 13 17 3 2 -1. + <_> + 14 17 1 2 3. + <_> + + <_> + 0 4 6 12 -1. + <_> + 0 8 6 4 3. + <_> + + <_> + 0 8 5 4 -1. + <_> + 0 9 5 2 2. + <_> + + <_> + 13 6 4 6 -1. + <_> + 14 7 2 6 2. + 1 + <_> + + <_> + 4 2 3 2 -1. + <_> + 5 2 1 2 3. + <_> + + <_> + 11 2 8 17 -1. + <_> + 13 2 4 17 2. + <_> + + <_> + 15 0 3 3 -1. + <_> + 16 0 1 3 3. + <_> + + <_> + 10 5 9 13 -1. + <_> + 13 5 3 13 3. + <_> + + <_> + 5 8 8 6 -1. + <_> + 7 8 4 6 2. + <_> + + <_> + 3 1 15 18 -1. + <_> + 8 7 5 6 9. + <_> + + <_> + 6 7 9 8 -1. + <_> + 9 7 3 8 3. + <_> + + <_> + 0 6 20 14 -1. + <_> + 0 13 20 7 2. + <_> + + <_> + 1 7 6 7 -1. + <_> + 3 7 2 7 3. + <_> + + <_> + 9 19 3 1 -1. + <_> + 10 19 1 1 3. + <_> + + <_> + 4 6 9 7 -1. + <_> + 7 6 3 7 3. + <_> + + <_> + 18 10 1 10 -1. + <_> + 18 15 1 5 2. + <_> + + <_> + 12 16 2 4 -1. + <_> + 12 16 1 2 2. + <_> + 13 18 1 2 2. + <_> + + <_> + 12 19 4 1 -1. + <_> + 13 19 2 1 2. + <_> + + <_> + 9 5 6 15 -1. + <_> + 11 5 2 15 3. + <_> + + <_> + 10 18 4 1 -1. + <_> + 11 18 2 1 2. + <_> + + <_> + 1 0 12 16 -1. + <_> + 5 0 4 16 3. + <_> + + <_> + 0 13 3 3 -1. + <_> + 0 14 3 1 3. + <_> + + <_> + 1 13 1 3 -1. + <_> + 1 14 1 1 3. + <_> + + <_> + 14 0 6 1 -1. + <_> + 17 0 3 1 2. + <_> + + <_> + 12 0 3 3 -1. + <_> + 13 0 1 3 3. + <_> + + <_> + 12 1 3 2 -1. + <_> + 13 1 1 2 3. + <_> + + <_> + 14 2 6 13 -1. + <_> + 16 2 2 13 3. + <_> + + <_> + 12 4 6 1 -1. + <_> + 14 6 2 1 3. + 1 + <_> + + <_> + 15 6 5 2 -1. + <_> + 15 7 5 1 2. + <_> + + <_> + 9 0 5 12 -1. + <_> + 9 4 5 4 3. + <_> + + <_> + 6 1 13 9 -1. + <_> + 6 4 13 3 3. + <_> + + <_> + 16 0 3 2 -1. + <_> + 17 0 1 2 3. + <_> + + <_> + 6 0 4 2 -1. + <_> + 6 0 2 2 2. + 1 + <_> + + <_> + 4 2 3 3 -1. + <_> + 3 3 3 1 3. + 1 + <_> + + <_> + 7 1 13 6 -1. + <_> + 5 3 13 2 3. + 1 + <_> + + <_> + 3 2 2 3 -1. + <_> + 2 3 2 1 3. + 1 + <_> + + <_> + 17 0 3 1 -1. + <_> + 18 0 1 1 3. + <_> + + <_> + 1 12 5 6 -1. + <_> + 1 15 5 3 2. + <_> + + <_> + 5 14 3 1 -1. + <_> + 6 15 1 1 3. + 1 + <_> + + <_> + 0 7 7 3 -1. + <_> + 0 8 7 1 3. + <_> + + <_> + 0 8 2 4 -1. + <_> + 0 9 2 2 2. + <_> + + <_> + 7 2 4 3 -1. + <_> + 6 3 4 1 3. + 1 + <_> + + <_> + 6 7 6 10 -1. + <_> + 8 7 2 10 3. + <_> + + <_> + 2 5 8 12 -1. + <_> + 4 5 4 12 2. + <_> + + <_> + 4 0 12 4 -1. + <_> + 4 2 12 2 2. + <_> + + <_> + 7 8 8 12 -1. + <_> + 9 8 4 12 2. + <_> + + <_> + 8 6 11 14 -1. + <_> + 8 13 11 7 2. + <_> + + <_> + 16 9 4 9 -1. + <_> + 18 9 2 9 2. + <_> + + <_> + 12 9 6 2 -1. + <_> + 14 9 2 2 3. + <_> + + <_> + 6 1 10 6 -1. + <_> + 6 3 10 2 3. + <_> + + <_> + 5 0 4 5 -1. + <_> + 5 0 2 5 2. + 1 + <_> + + <_> + 2 17 1 3 -1. + <_> + 2 18 1 1 3. + <_> + + <_> + 2 17 1 3 -1. + <_> + 2 18 1 1 3. + <_> + + <_> + 8 0 12 2 -1. + <_> + 12 0 4 2 3. + <_> + + <_> + 0 8 6 5 -1. + <_> + 2 8 2 5 3. + <_> + + <_> + 8 18 4 1 -1. + <_> + 9 18 2 1 2. + <_> + + <_> + 10 18 2 1 -1. + <_> + 11 18 1 1 2. + <_> + + <_> + 7 2 9 3 -1. + <_> + 10 5 3 3 3. + 1 + <_> + + <_> + 8 3 5 6 -1. + <_> + 8 5 5 2 3. + <_> + + <_> + 0 14 1 3 -1. + <_> + 0 15 1 1 3. + <_> + + <_> + 12 17 3 2 -1. + <_> + 13 17 1 2 3. + <_> + + <_> + 12 17 3 3 -1. + <_> + 13 17 1 3 3. + <_> + + <_> + 7 9 1 4 -1. + <_> + 6 10 1 2 2. + 1 + <_> + + <_> + 12 7 8 8 -1. + <_> + 14 7 4 8 2. + <_> + + <_> + 7 10 4 6 -1. + <_> + 5 12 4 2 3. + 1 + <_> + + <_> + 0 6 4 10 -1. + <_> + 2 6 2 10 2. + <_> + + <_> + 19 9 1 3 -1. + <_> + 19 10 1 1 3. + <_> + + <_> + 16 1 4 15 -1. + <_> + 17 2 2 15 2. + 1 + <_> + + <_> + 14 5 6 7 -1. + <_> + 16 7 2 7 3. + 1 + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 18 1 1 2. + <_> + 19 19 1 1 2. + <_> + + <_> + 0 7 4 6 -1. + <_> + 0 9 4 2 3. + <_> + + <_> + 16 9 4 4 -1. + <_> + 17 9 2 4 2. + <_> + + <_> + 0 15 1 3 -1. + <_> + 0 16 1 1 3. + <_> + + <_> + 7 5 10 3 -1. + <_> + 6 6 10 1 3. + 1 + <_> + + <_> + 9 7 9 7 -1. + <_> + 12 7 3 7 3. + <_> + + <_> + 14 4 6 8 -1. + <_> + 14 6 6 4 2. + <_> + + <_> + 17 6 3 1 -1. + <_> + 18 7 1 1 3. + 1 + <_> + + <_> + 17 1 3 8 -1. + <_> + 17 3 3 4 2. + <_> + + <_> + 0 10 1 3 -1. + <_> + 0 11 1 1 3. + <_> + + <_> + 5 2 3 1 -1. + <_> + 6 2 1 1 3. + <_> + + <_> + 5 2 3 1 -1. + <_> + 6 2 1 1 3. + <_> + + <_> + 6 2 9 15 -1. + <_> + 9 7 3 5 9. + <_> + + <_> + 0 9 6 3 -1. + <_> + 2 9 2 3 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 9 2 3 9. + <_> + + <_> + 4 3 12 9 -1. + <_> + 4 6 12 3 3. + <_> + + <_> + 8 5 6 4 -1. + <_> + 8 6 6 2 2. + <_> + + <_> + 0 1 17 8 -1. + <_> + 0 3 17 4 2. + <_> + + <_> + 2 10 9 1 -1. + <_> + 5 10 3 1 3. + <_> + + <_> + 2 11 9 8 -1. + <_> + 2 15 9 4 2. + <_> + + <_> + 14 0 6 15 -1. + <_> + 16 0 2 15 3. + <_> + + <_> + 17 6 2 9 -1. + <_> + 17 9 2 3 3. + <_> + + <_> + 16 16 1 3 -1. + <_> + 15 17 1 1 3. + 1 + <_> + + <_> + 7 0 4 2 -1. + <_> + 8 0 2 2 2. + <_> + + <_> + 6 0 12 15 -1. + <_> + 10 0 4 15 3. + <_> + + <_> + 7 8 12 6 -1. + <_> + 11 8 4 6 3. + <_> + + <_> + 11 18 4 1 -1. + <_> + 12 18 2 1 2. + <_> + + <_> + 8 18 4 1 -1. + <_> + 9 18 2 1 2. + <_> + + <_> + 7 0 8 4 -1. + <_> + 7 2 8 2 2. + <_> + + <_> + 8 0 12 8 -1. + <_> + 8 2 12 4 2. + <_> + + <_> + 4 9 6 3 -1. + <_> + 6 9 2 3 3. + <_> + + <_> + 0 4 9 12 -1. + <_> + 3 8 3 4 9. + <_> + + <_> + 6 18 1 2 -1. + <_> + 6 19 1 1 2. + <_> + + <_> + 9 2 4 2 -1. + <_> + 10 2 2 2 2. + <_> + + <_> + 6 1 8 17 -1. + <_> + 8 1 4 17 2. + <_> + + <_> + 13 9 4 4 -1. + <_> + 14 10 2 4 2. + 1 + <_> + + <_> + 7 1 4 3 -1. + <_> + 8 1 2 3 2. + <_> + + <_> + 12 8 6 4 -1. + <_> + 14 8 2 4 3. + <_> + + <_> + 13 1 7 15 -1. + <_> + 13 6 7 5 3. + <_> + + <_> + 17 18 2 2 -1. + <_> + 17 18 1 1 2. + <_> + 18 19 1 1 2. + <_> + + <_> + 3 6 4 10 -1. + <_> + 4 6 2 10 2. + <_> + + <_> + 6 4 4 11 -1. + <_> + 7 4 2 11 2. + <_> + + <_> + 7 18 4 1 -1. + <_> + 8 18 2 1 2. + <_> + + <_> + 15 0 4 2 -1. + <_> + 15 0 4 1 2. + 1 + <_> + + <_> + 8 0 10 3 -1. + <_> + 8 1 10 1 3. + <_> + + <_> + 8 0 12 3 -1. + <_> + 12 1 4 1 9. + <_> + + <_> + 16 0 3 2 -1. + <_> + 17 0 1 2 3. + <_> + + <_> + 16 10 4 6 -1. + <_> + 17 11 2 6 2. + 1 + <_> + + <_> + 11 4 5 6 -1. + <_> + 9 6 5 2 3. + 1 + <_> + + <_> + 12 3 6 10 -1. + <_> + 14 5 2 10 3. + 1 + <_> + + <_> + 9 7 5 3 -1. + <_> + 8 8 5 1 3. + 1 + <_> + + <_> + 4 10 2 1 -1. + <_> + 5 10 1 1 2. + <_> + + <_> + 4 2 16 16 -1. + <_> + 4 6 16 8 2. + <_> + + <_> + 15 8 4 6 -1. + <_> + 16 8 2 6 2. + <_> + + <_> + 15 7 2 6 -1. + <_> + 15 7 1 6 2. + 1 + <_> + + <_> + 6 17 1 2 -1. + <_> + 6 18 1 1 2. + <_> + + <_> + 7 4 12 12 -1. + <_> + 11 8 4 4 9. + <_> + + <_> + 18 16 1 2 -1. + <_> + 18 17 1 1 2. + <_> + + <_> + 17 17 2 1 -1. + <_> + 18 17 1 1 2. + <_> + + <_> + 6 4 3 6 -1. + <_> + 7 5 1 6 3. + 1 + <_> + + <_> + 4 10 4 1 -1. + <_> + 5 10 2 1 2. + <_> + + <_> + 6 10 6 9 -1. + <_> + 8 10 2 9 3. + <_> + + <_> + 1 8 2 12 -1. + <_> + 1 14 2 6 2. + <_> + + <_> + 16 0 2 1 -1. + <_> + 17 0 1 1 2. + <_> + + <_> + 8 2 7 9 -1. + <_> + 8 5 7 3 3. + <_> + + <_> + 0 0 20 20 -1. + <_> + 0 0 10 10 2. + <_> + 10 10 10 10 2. + <_> + + <_> + 18 6 1 2 -1. + <_> + 18 7 1 1 2. + <_> + + <_> + 18 5 2 1 -1. + <_> + 18 5 1 1 2. + 1 + <_> + + <_> + 7 4 10 6 -1. + <_> + 7 6 10 2 3. + <_> + + <_> + 15 9 3 3 -1. + <_> + 16 10 1 3 3. + 1 + <_> + + <_> + 17 18 3 2 -1. + <_> + 17 19 3 1 2. + <_> + + <_> + 15 9 3 2 -1. + <_> + 16 10 1 2 3. + 1 + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 1 14 1 2 -1. + <_> + 1 15 1 1 2. + <_> + + <_> + 0 18 20 1 -1. + <_> + 10 18 10 1 2. + <_> + + <_> + 9 7 6 2 -1. + <_> + 9 7 6 1 2. + 1 + <_> + + <_> + 10 9 6 5 -1. + <_> + 12 9 2 5 3. + <_> + + <_> + 11 8 4 5 -1. + <_> + 12 8 2 5 2. + <_> + + <_> + 18 0 2 18 -1. + <_> + 18 9 2 9 2. + <_> + + <_> + 3 15 9 3 -1. + <_> + 6 16 3 1 9. + <_> + + <_> + 16 16 1 3 -1. + <_> + 15 17 1 1 3. + 1 + <_> + + <_> + 2 16 9 4 -1. + <_> + 2 17 9 2 2. + <_> + + <_> + 0 18 5 2 -1. + <_> + 0 19 5 1 2. + <_> + + <_> + 17 7 2 3 -1. + <_> + 16 8 2 1 3. + 1 + <_> + + <_> + 17 17 2 1 -1. + <_> + 18 17 1 1 2. + <_> + + <_> + 16 18 2 1 -1. + <_> + 17 18 1 1 2. + <_> + + <_> + 17 18 1 2 -1. + <_> + 17 19 1 1 2. + <_> + + <_> + 6 10 9 2 -1. + <_> + 9 10 3 2 3. + <_> + + <_> + 2 8 18 12 -1. + <_> + 2 14 18 6 2. + <_> + + <_> + 12 6 3 3 -1. + <_> + 11 7 3 1 3. + 1 + <_> + + <_> + 15 8 3 3 -1. + <_> + 16 9 1 3 3. + 1 + <_> + + <_> + 2 3 17 12 -1. + <_> + 2 6 17 6 2. + <_> + + <_> + 2 7 4 9 -1. + <_> + 3 7 2 9 2. + <_> + + <_> + 4 9 2 6 -1. + <_> + 4 9 1 3 2. + <_> + 5 12 1 3 2. + <_> + + <_> + 1 6 12 9 -1. + <_> + 5 9 4 3 9. + <_> + + <_> + 8 2 1 8 -1. + <_> + 8 4 1 4 2. + <_> + + <_> + 3 16 2 1 -1. + <_> + 4 16 1 1 2. + <_> + + <_> + 3 16 2 1 -1. + <_> + 4 16 1 1 2. + <_> + + <_> + 4 17 1 3 -1. + <_> + 4 18 1 1 3. + <_> + + <_> + 6 17 9 3 -1. + <_> + 9 17 3 3 3. + <_> + + <_> + 14 8 3 4 -1. + <_> + 15 9 1 4 3. + 1 + <_> + + <_> + 17 8 3 6 -1. + <_> + 18 9 1 6 3. + 1 + <_> + + <_> + 16 17 1 3 -1. + <_> + 16 18 1 1 3. + <_> + + <_> + 14 18 3 2 -1. + <_> + 14 19 3 1 2. + <_> + + <_> + 6 8 3 3 -1. + <_> + 7 8 1 3 3. + <_> + + <_> + 3 0 16 11 -1. + <_> + 7 0 8 11 2. + <_> + + <_> + 1 0 18 20 -1. + <_> + 1 5 18 10 2. + <_> + + <_> + 15 5 4 4 -1. + <_> + 15 5 2 2 2. + <_> + 17 7 2 2 2. + <_> + + <_> + 15 10 2 1 -1. + <_> + 16 10 1 1 2. + <_> + + <_> + 7 18 6 2 -1. + <_> + 9 18 2 2 3. + <_> + + <_> + 15 10 2 1 -1. + <_> + 16 10 1 1 2. + <_> + + <_> + 2 0 18 4 -1. + <_> + 2 1 18 2 2. + <_> + + <_> + 5 0 9 4 -1. + <_> + 5 1 9 2 2. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 0 18 1 2 -1. + <_> + 0 19 1 1 2. + <_> + + <_> + 18 0 2 2 -1. + <_> + 18 1 2 1 2. + <_> + + <_> + 17 0 2 4 -1. + <_> + 17 0 1 4 2. + 1 + <_> + + <_> + 4 2 3 4 -1. + <_> + 3 3 3 2 2. + 1 + <_> + + <_> + 0 4 6 11 -1. + <_> + 2 4 2 11 3. + <_> + + <_> + 0 4 8 4 -1. + <_> + 0 4 4 2 2. + <_> + 4 6 4 2 2. + <_> + + <_> + 4 3 1 2 -1. + <_> + 4 4 1 1 2. + <_> + + <_> + 0 1 6 4 -1. + <_> + 0 1 3 2 2. + <_> + 3 3 3 2 2. + <_> + + <_> + 3 5 4 2 -1. + <_> + 3 5 2 1 2. + <_> + 5 6 2 1 2. + <_> + + <_> + 4 9 4 1 -1. + <_> + 5 9 2 1 2. + <_> + + <_> + 8 15 2 2 -1. + <_> + 8 15 1 1 2. + <_> + 9 16 1 1 2. + <_> + + <_> + 8 15 2 2 -1. + <_> + 8 15 1 1 2. + <_> + 9 16 1 1 2. + <_> + + <_> + 2 18 5 2 -1. + <_> + 2 19 5 1 2. + <_> + + <_> + 4 12 10 8 -1. + <_> + 4 14 10 4 2. + <_> + + <_> + 9 7 5 3 -1. + <_> + 8 8 5 1 3. + 1 + <_> + + <_> + 2 18 6 2 -1. + <_> + 2 18 3 1 2. + <_> + 5 19 3 1 2. + <_> + + <_> + 6 16 12 4 -1. + <_> + 6 17 12 2 2. + <_> + + <_> + 10 9 1 4 -1. + <_> + 10 11 1 2 2. + <_> + + <_> + 5 9 12 3 -1. + <_> + 9 10 4 1 9. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 8 1 1 9. + <_> + + <_> + 1 6 19 14 -1. + <_> + 1 13 19 7 2. + <_> + + <_> + 15 9 4 2 -1. + <_> + 16 9 2 2 2. + <_> + + <_> + 8 9 3 8 -1. + <_> + 8 13 3 4 2. + <_> + + <_> + 6 8 4 3 -1. + <_> + 7 8 2 3 2. + <_> + + <_> + 5 1 8 4 -1. + <_> + 5 2 8 2 2. + <_> + + <_> + 8 1 3 4 -1. + <_> + 8 2 3 2 2. + <_> + + <_> + 2 10 18 10 -1. + <_> + 2 15 18 5 2. + <_> + + <_> + 8 8 5 3 -1. + <_> + 7 9 5 1 3. + 1 + <_> + + <_> + 7 9 7 2 -1. + <_> + 7 9 7 1 2. + 1 + <_> + + <_> + 5 17 1 3 -1. + <_> + 5 18 1 1 3. + <_> + + <_> + 7 18 13 2 -1. + <_> + 7 19 13 1 2. + <_> + + <_> + 16 16 2 2 -1. + <_> + 16 16 2 1 2. + 1 + <_> + + <_> + 3 14 1 2 -1. + <_> + 3 15 1 1 2. + <_> + + <_> + 12 9 3 4 -1. + <_> + 13 9 1 4 3. + <_> + + <_> + 12 9 3 2 -1. + <_> + 13 9 1 2 3. + <_> + + <_> + 7 9 2 3 -1. + <_> + 6 10 2 1 3. + 1 + <_> + + <_> + 10 3 9 12 -1. + <_> + 10 7 9 4 3. + <_> + + <_> + 15 5 2 1 -1. + <_> + 16 5 1 1 2. + <_> + + <_> + 1 0 15 9 -1. + <_> + 1 3 15 3 3. + <_> + + <_> + 3 15 2 3 -1. + <_> + 3 15 1 3 2. + 1 + <_> + + <_> + 2 16 1 2 -1. + <_> + 2 17 1 1 2. + <_> + + <_> + 12 1 8 4 -1. + <_> + 11 2 8 2 2. + 1 + <_> + + <_> + 6 5 3 6 -1. + <_> + 7 6 1 6 3. + 1 + <_> + + <_> + 5 7 2 2 -1. + <_> + 5 7 1 1 2. + <_> + 6 8 1 1 2. + <_> + + <_> + 17 7 3 1 -1. + <_> + 18 7 1 1 3. + <_> + + <_> + 12 0 6 5 -1. + <_> + 14 0 2 5 3. + <_> + + <_> + 17 0 2 1 -1. + <_> + 18 0 1 1 2. + <_> + + <_> + 10 1 6 5 -1. + <_> + 12 1 2 5 3. + <_> + + <_> + 17 14 3 2 -1. + <_> + 17 14 3 1 2. + 1 + <_> + + <_> + 5 10 4 1 -1. + <_> + 6 10 2 1 2. + <_> + + <_> + 3 8 3 6 -1. + <_> + 4 8 1 6 3. + <_> + + <_> + 8 16 5 4 -1. + <_> + 8 17 5 2 2. + <_> + + <_> + 14 15 2 2 -1. + <_> + 14 15 1 1 2. + <_> + 15 16 1 1 2. + <_> + + <_> + 4 18 1 2 -1. + <_> + 4 19 1 1 2. + <_> + + <_> + 8 15 2 3 -1. + <_> + 8 15 1 3 2. + 1 + <_> + + <_> + 19 0 1 20 -1. + <_> + 19 10 1 10 2. + <_> + + <_> + 7 9 8 1 -1. + <_> + 9 9 4 1 2. + <_> + + <_> + 14 10 3 1 -1. + <_> + 15 10 1 1 3. + <_> + + <_> + 15 11 2 1 -1. + <_> + 16 11 1 1 2. + <_> + + <_> + 18 11 2 8 -1. + <_> + 18 11 1 4 2. + <_> + 19 15 1 4 2. + <_> + + <_> + 6 1 8 4 -1. + <_> + 8 1 4 4 2. + <_> + + <_> + 6 0 5 4 -1. + <_> + 5 1 5 2 2. + 1 + <_> + + <_> + 6 5 12 15 -1. + <_> + 10 10 4 5 9. + <_> + + <_> + 7 2 8 9 -1. + <_> + 7 5 8 3 3. + <_> + + <_> + 2 1 10 3 -1. + <_> + 2 2 10 1 3. + <_> + + <_> + 2 5 15 12 -1. + <_> + 7 9 5 4 9. + <_> + + <_> + 7 8 3 6 -1. + <_> + 8 8 1 6 3. + <_> + + <_> + 7 6 3 7 -1. + <_> + 8 6 1 7 3. + <_> + + <_> + 4 16 9 4 -1. + <_> + 7 16 3 4 3. + <_> + + <_> + 15 18 5 2 -1. + <_> + 15 19 5 1 2. + <_> + + <_> + 15 16 1 4 -1. + <_> + 15 17 1 2 2. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 6 15 2 2 -1. + <_> + 6 15 1 1 2. + <_> + 7 16 1 1 2. + <_> + + <_> + 6 15 2 2 -1. + <_> + 6 15 1 1 2. + <_> + 7 16 1 1 2. + <_> + + <_> + 8 16 8 3 -1. + <_> + 10 16 4 3 2. + <_> + + <_> + 5 10 12 1 -1. + <_> + 9 10 4 1 3. + <_> + + <_> + 6 2 9 15 -1. + <_> + 9 7 3 5 9. + <_> + + <_> + 17 6 1 14 -1. + <_> + 17 13 1 7 2. + <_> + + <_> + 9 7 3 3 -1. + <_> + 8 8 3 1 3. + 1 + <_> + + <_> + 16 5 4 3 -1. + <_> + 15 6 4 1 3. + 1 + <_> + + <_> + 13 7 4 9 -1. + <_> + 13 7 2 9 2. + 1 + <_> + + <_> + 3 10 2 2 -1. + <_> + 3 10 2 1 2. + 1 + <_> + + <_> + 0 4 3 15 -1. + <_> + 0 9 3 5 3. + <_> + + <_> + 7 8 9 6 -1. + <_> + 10 8 3 6 3. + <_> + + <_> + 5 17 9 2 -1. + <_> + 8 17 3 2 3. + <_> + + <_> + 7 2 6 18 -1. + <_> + 7 11 6 9 2. + <_> + + <_> + 15 9 2 10 -1. + <_> + 15 9 1 5 2. + <_> + 16 14 1 5 2. + <_> + + <_> + 12 7 6 4 -1. + <_> + 14 9 2 4 3. + 1 + <_> + + <_> + 13 8 3 2 -1. + <_> + 14 9 1 2 3. + 1 + <_> + + <_> + 17 4 3 2 -1. + <_> + 18 5 1 2 3. + 1 + <_> + + <_> + 10 5 8 2 -1. + <_> + 10 6 8 1 2. + <_> + + <_> + 18 4 2 2 -1. + <_> + 18 4 1 2 2. + 1 + <_> + + <_> + 7 4 7 4 -1. + <_> + 7 5 7 2 2. + <_> + + <_> + 1 15 6 4 -1. + <_> + 1 17 6 2 2. + <_> + + <_> + 0 13 2 6 -1. + <_> + 0 15 2 2 3. + <_> + + <_> + 10 13 4 2 -1. + <_> + 10 13 4 1 2. + 1 + <_> + + <_> + 16 14 2 4 -1. + <_> + 15 15 2 2 2. + 1 + <_> + + <_> + 7 4 3 4 -1. + <_> + 8 5 1 4 3. + 1 + <_> + + <_> + 5 9 4 3 -1. + <_> + 6 9 2 3 2. + <_> + + <_> + 4 1 2 4 -1. + <_> + 3 2 2 2 2. + 1 + <_> + + <_> + 2 1 2 3 -1. + <_> + 3 1 1 3 2. + <_> + + <_> + 1 2 8 4 -1. + <_> + 1 2 4 2 2. + <_> + 5 4 4 2 2. + <_> + + <_> + 6 0 4 4 -1. + <_> + 7 0 2 4 2. + <_> + + <_> + 6 4 3 5 -1. + <_> + 7 5 1 5 3. + 1 + <_> + + <_> + 3 5 1 2 -1. + <_> + 3 6 1 1 2. + <_> + + <_> + 6 8 3 3 -1. + <_> + 7 8 1 3 3. + <_> + + <_> + 5 16 3 1 -1. + <_> + 6 17 1 1 3. + 1 + <_> + + <_> + 6 9 4 4 -1. + <_> + 7 9 2 4 2. + <_> + + <_> + 9 11 9 2 -1. + <_> + 9 12 9 1 2. + <_> + + <_> + 5 2 7 2 -1. + <_> + 5 3 7 1 2. + <_> + + <_> + 12 18 8 2 -1. + <_> + 12 19 8 1 2. + <_> + + <_> + 19 0 1 4 -1. + <_> + 19 2 1 2 2. + <_> + + <_> + 14 1 6 2 -1. + <_> + 17 1 3 2 2. + <_> + + <_> + 14 2 6 4 -1. + <_> + 14 2 3 2 2. + <_> + 17 4 3 2 2. + <_> + + <_> + 7 7 3 6 -1. + <_> + 8 7 1 6 3. + <_> + + <_> + 11 6 5 4 -1. + <_> + 11 7 5 2 2. + <_> + + <_> + 17 7 3 3 -1. + <_> + 18 7 1 3 3. + <_> + + <_> + 15 16 1 2 -1. + <_> + 15 16 1 1 2. + 1 + <_> + + <_> + 7 0 4 4 -1. + <_> + 7 1 4 2 2. + <_> + + <_> + 6 1 8 8 -1. + <_> + 6 3 8 4 2. + <_> + + <_> + 0 0 1 2 -1. + <_> + 0 1 1 1 2. + <_> + + <_> + 2 0 4 2 -1. + <_> + 2 0 4 1 2. + 1 + <_> + + <_> + 10 0 6 5 -1. + <_> + 12 0 2 5 3. + <_> + + <_> + 7 7 4 7 -1. + <_> + 8 7 2 7 2. + <_> + + <_> + 9 3 2 8 -1. + <_> + 10 3 1 8 2. + <_> + + <_> + 6 1 4 4 -1. + <_> + 7 2 2 4 2. + 1 + <_> + + <_> + 0 18 1 2 -1. + <_> + 0 19 1 1 2. + <_> + + <_> + 17 2 3 1 -1. + <_> + 18 3 1 1 3. + 1 + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 18 1 1 2. + <_> + 19 19 1 1 2. + <_> + + <_> + 17 13 3 4 -1. + <_> + 16 14 3 2 2. + 1 + <_> + + <_> + 3 10 4 3 -1. + <_> + 4 10 2 3 2. + <_> + + <_> + 0 8 4 5 -1. + <_> + 1 8 2 5 2. + <_> + + <_> + 4 8 14 12 -1. + <_> + 4 14 14 6 2. + <_> + + <_> + 16 16 2 2 -1. + <_> + 17 16 1 2 2. + <_> + + <_> + 16 18 4 2 -1. + <_> + 17 18 2 2 2. + <_> + + <_> + 17 1 3 4 -1. + <_> + 18 2 1 4 3. + 1 + <_> + + <_> + 3 0 4 7 -1. + <_> + 4 0 2 7 2. + <_> + + <_> + 6 1 6 3 -1. + <_> + 8 1 2 3 3. + <_> + + <_> + 12 8 4 4 -1. + <_> + 13 8 2 4 2. + <_> + + <_> + 6 1 5 2 -1. + <_> + 6 2 5 1 2. + <_> + + <_> + 1 7 5 12 -1. + <_> + 1 13 5 6 2. + <_> + + <_> + 8 17 6 3 -1. + <_> + 10 18 2 1 9. + <_> + + <_> + 12 4 3 12 -1. + <_> + 13 4 1 12 3. + <_> + + <_> + 3 11 8 1 -1. + <_> + 5 13 4 1 2. + 1 + <_> + + <_> + 7 2 9 6 -1. + <_> + 5 4 9 2 3. + 1 + <_> + + <_> + 14 1 1 2 -1. + <_> + 14 1 1 1 2. + 1 + <_> + + <_> + 0 1 16 1 -1. + <_> + 8 1 8 1 2. + <_> + + <_> + 8 8 3 2 -1. + <_> + 9 8 1 2 3. + <_> + + <_> + 0 14 1 2 -1. + <_> + 0 15 1 1 2. + <_> + + <_> + 11 5 3 8 -1. + <_> + 11 7 3 4 2. + <_> + + <_> + 7 9 3 3 -1. + <_> + 6 10 3 1 3. + 1 + <_> + + <_> + 0 5 6 11 -1. + <_> + 2 5 2 11 3. + <_> + + <_> + 1 0 4 14 -1. + <_> + 2 0 2 14 2. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 1 2. + <_> + 17 19 1 1 2. + <_> + + <_> + 16 0 3 3 -1. + <_> + 17 1 1 3 3. + 1 + <_> + + <_> + 19 5 1 4 -1. + <_> + 19 7 1 2 2. + <_> + + <_> + 3 10 6 1 -1. + <_> + 5 10 2 1 3. + <_> + + <_> + 6 10 3 1 -1. + <_> + 7 10 1 1 3. + <_> + + <_> + 8 7 2 10 -1. + <_> + 8 12 2 5 2. + <_> + + <_> + 12 9 6 2 -1. + <_> + 14 9 2 2 3. + <_> + + <_> + 18 3 1 12 -1. + <_> + 14 7 1 4 3. + 1 + <_> + + <_> + 13 3 2 8 -1. + <_> + 11 5 2 4 2. + 1 + <_> + + <_> + 3 2 2 3 -1. + <_> + 2 3 2 1 3. + 1 + <_> + + <_> + 0 3 6 4 -1. + <_> + 0 3 3 2 2. + <_> + 3 5 3 2 2. + <_> + + <_> + 3 2 2 1 -1. + <_> + 4 2 1 1 2. + <_> + + <_> + 12 8 3 5 -1. + <_> + 13 8 1 5 3. + <_> + + <_> + 15 15 2 3 -1. + <_> + 14 16 2 1 3. + 1 + <_> + + <_> + 0 18 3 2 -1. + <_> + 0 19 3 1 2. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 5 6 2 2 -1. + <_> + 5 7 2 1 2. + <_> + + <_> + 2 7 16 2 -1. + <_> + 6 7 8 2 2. + <_> + + <_> + 16 8 4 7 -1. + <_> + 17 8 2 7 2. + <_> + + <_> + 14 9 4 5 -1. + <_> + 15 9 2 5 2. + <_> + + <_> + 0 6 3 14 -1. + <_> + 0 13 3 7 2. + <_> + + <_> + 17 3 3 1 -1. + <_> + 18 4 1 1 3. + 1 + <_> + + <_> + 18 5 2 1 -1. + <_> + 18 5 1 1 2. + 1 + <_> + + <_> + 18 0 2 18 -1. + <_> + 18 6 2 6 3. + <_> + + <_> + 4 0 13 12 -1. + <_> + 4 3 13 6 2. + <_> + + <_> + 12 9 4 2 -1. + <_> + 13 9 2 2 2. + <_> + + <_> + 4 2 3 3 -1. + <_> + 3 3 3 1 3. + 1 + <_> + + <_> + 8 10 6 3 -1. + <_> + 10 10 2 3 3. + <_> + + <_> + 11 5 4 6 -1. + <_> + 11 5 2 6 2. + 1 + <_> + + <_> + 10 2 4 2 -1. + <_> + 11 2 2 2 2. + <_> + + <_> + 4 16 2 4 -1. + <_> + 4 18 2 2 2. + <_> + + <_> + 5 18 8 2 -1. + <_> + 9 18 4 2 2. + <_> + + <_> + 19 9 1 8 -1. + <_> + 19 9 1 4 2. + 1 + <_> + + <_> + 0 15 5 3 -1. + <_> + 0 16 5 1 3. + <_> + + <_> + 19 4 1 15 -1. + <_> + 19 9 1 5 3. + <_> + + <_> + 7 19 4 1 -1. + <_> + 8 19 2 1 2. + <_> + + <_> + 6 2 12 4 -1. + <_> + 6 3 12 2 2. + <_> + + <_> + 4 1 11 6 -1. + <_> + 4 3 11 2 3. + <_> + + <_> + 0 14 2 4 -1. + <_> + 0 15 2 2 2. + <_> + + <_> + 1 9 4 5 -1. + <_> + 2 9 2 5 2. + <_> + + <_> + 4 5 2 4 -1. + <_> + 3 6 2 2 2. + 1 + <_> + + <_> + 1 17 6 3 -1. + <_> + 3 18 2 1 9. + <_> + + <_> + 11 0 6 6 -1. + <_> + 13 0 2 6 3. + <_> + + <_> + 17 18 3 2 -1. + <_> + 17 19 3 1 2. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 3 7 15 3 -1. + <_> + 8 8 5 1 9. + <_> + + <_> + 10 8 3 3 -1. + <_> + 11 9 1 1 9. + <_> + + <_> + 0 10 6 8 -1. + <_> + 0 12 6 4 2. + <_> + + <_> + 9 8 3 3 -1. + <_> + 10 8 1 3 3. + <_> + + <_> + 10 7 3 8 -1. + <_> + 11 7 1 8 3. + <_> + + <_> + 12 4 4 1 -1. + <_> + 13 4 2 1 2. + <_> + + <_> + 2 1 11 4 -1. + <_> + 2 2 11 2 2. + <_> + + <_> + 0 3 3 4 -1. + <_> + 0 4 3 2 2. + <_> + + <_> + 17 0 3 2 -1. + <_> + 17 1 3 1 2. + <_> + + <_> + 19 14 1 4 -1. + <_> + 19 15 1 2 2. + <_> + + <_> + 1 16 2 4 -1. + <_> + 2 16 1 4 2. + <_> + + <_> + 3 13 4 3 -1. + <_> + 2 14 4 1 3. + 1 + <_> + + <_> + 0 14 4 3 -1. + <_> + 0 15 4 1 3. + <_> + + <_> + 9 3 5 4 -1. + <_> + 9 4 5 2 2. + <_> + + <_> + 12 0 8 4 -1. + <_> + 12 1 8 2 2. + <_> + + <_> + 18 0 2 5 -1. + <_> + 18 0 1 5 2. + 1 + <_> + + <_> + 14 3 1 4 -1. + <_> + 14 5 1 2 2. + <_> + + <_> + 5 15 3 2 -1. + <_> + 6 16 1 2 3. + 1 + <_> + + <_> + 9 7 4 8 -1. + <_> + 10 7 2 8 2. + <_> + + <_> + 14 5 1 12 -1. + <_> + 10 9 1 4 3. + 1 + <_> + + <_> + 5 0 2 3 -1. + <_> + 4 1 2 1 3. + 1 + <_> + + <_> + 18 1 2 2 -1. + <_> + 18 1 2 1 2. + 1 + <_> + + <_> + 6 8 9 2 -1. + <_> + 6 9 9 1 2. + <_> + + <_> + 7 8 13 4 -1. + <_> + 7 9 13 2 2. + <_> + + <_> + 6 7 3 4 -1. + <_> + 7 8 1 4 3. + 1 + <_> + + <_> + 9 18 2 2 -1. + <_> + 9 18 1 1 2. + <_> + 10 19 1 1 2. + <_> + + <_> + 6 18 6 2 -1. + <_> + 6 18 3 1 2. + <_> + 9 19 3 1 2. + <_> + + <_> + 5 6 3 4 -1. + <_> + 6 7 1 4 3. + 1 + <_> + + <_> + 5 8 2 12 -1. + <_> + 5 8 1 6 2. + <_> + 6 14 1 6 2. + <_> + + <_> + 19 0 1 8 -1. + <_> + 19 0 1 4 2. + 1 + <_> + + <_> + 1 11 4 6 -1. + <_> + 1 13 4 2 3. + <_> + + <_> + 6 12 4 4 -1. + <_> + 6 12 2 4 2. + 1 + <_> + + <_> + 18 13 1 6 -1. + <_> + 18 16 1 3 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 14 15 4 4 -1. + <_> + 14 15 2 2 2. + <_> + 16 17 2 2 2. + <_> + + <_> + 4 3 1 2 -1. + <_> + 4 4 1 1 2. + <_> + + <_> + 6 3 3 4 -1. + <_> + 5 4 3 2 2. + 1 + <_> + + <_> + 2 1 3 1 -1. + <_> + 3 2 1 1 3. + 1 + <_> + + <_> + 6 8 3 5 -1. + <_> + 7 8 1 5 3. + <_> + + <_> + 8 9 1 8 -1. + <_> + 8 11 1 4 2. + <_> + + <_> + 14 10 4 4 -1. + <_> + 14 10 2 4 2. + 1 + <_> + + <_> + 5 16 9 3 -1. + <_> + 8 16 3 3 3. + <_> + + <_> + 14 11 6 6 -1. + <_> + 14 13 6 2 3. + <_> + + <_> + 9 16 5 2 -1. + <_> + 9 17 5 1 2. + <_> + + <_> + 5 10 12 1 -1. + <_> + 8 10 6 1 2. + <_> + + <_> + 1 5 18 5 -1. + <_> + 7 5 6 5 3. + <_> + + <_> + 15 9 2 3 -1. + <_> + 16 9 1 3 2. + <_> + + <_> + 0 14 20 6 -1. + <_> + 0 17 20 3 2. + <_> + + <_> + 4 9 2 6 -1. + <_> + 4 9 1 3 2. + <_> + 5 12 1 3 2. + <_> + + <_> + 5 1 12 15 -1. + <_> + 9 6 4 5 9. + <_> + + <_> + 0 0 20 1 -1. + <_> + 5 0 10 1 2. + <_> + + <_> + 0 0 12 1 -1. + <_> + 6 0 6 1 2. + <_> + + <_> + 0 0 10 6 -1. + <_> + 5 0 5 6 2. + <_> + + <_> + 3 0 4 3 -1. + <_> + 2 1 4 1 3. + 1 + <_> + + <_> + 2 0 15 6 -1. + <_> + 7 2 5 2 9. + <_> + + <_> + 0 2 6 4 -1. + <_> + 3 2 3 4 2. + <_> + + <_> + 14 10 2 1 -1. + <_> + 15 10 1 1 2. + <_> + + <_> + 2 7 6 9 -1. + <_> + 4 7 2 9 3. + <_> + + <_> + 1 0 15 18 -1. + <_> + 6 6 5 6 9. + <_> + + <_> + 3 5 1 3 -1. + <_> + 2 6 1 1 3. + 1 + <_> + + <_> + 19 12 1 3 -1. + <_> + 19 13 1 1 3. + <_> + + <_> + 19 13 1 2 -1. + <_> + 19 14 1 1 2. + <_> + + <_> + 7 5 7 12 -1. + <_> + 7 8 7 6 2. + <_> + + <_> + 15 9 3 2 -1. + <_> + 15 10 3 1 2. + <_> + + <_> + 16 9 4 4 -1. + <_> + 17 9 2 4 2. + <_> + + <_> + 10 15 9 2 -1. + <_> + 13 15 3 2 3. + <_> + + <_> + 2 15 10 1 -1. + <_> + 7 15 5 1 2. + <_> + + <_> + 15 13 4 3 -1. + <_> + 14 14 4 1 3. + 1 + <_> + + <_> + 3 17 2 3 -1. + <_> + 4 17 1 3 2. + <_> + + <_> + 12 18 8 2 -1. + <_> + 16 18 4 2 2. + <_> + + <_> + 8 7 12 6 -1. + <_> + 12 7 4 6 3. + <_> + + <_> + 18 16 1 2 -1. + <_> + 18 16 1 1 2. + 1 + <_> + + <_> + 17 11 3 9 -1. + <_> + 17 14 3 3 3. + <_> + + <_> + 16 9 4 2 -1. + <_> + 17 10 2 2 2. + 1 + <_> + + <_> + 16 0 4 7 -1. + <_> + 17 0 2 7 2. + <_> + + <_> + 5 2 2 18 -1. + <_> + 5 11 2 9 2. + <_> + + <_> + 5 9 8 9 -1. + <_> + 7 9 4 9 2. + <_> + + <_> + 5 10 2 1 -1. + <_> + 6 10 1 1 2. + <_> + + <_> + 5 5 15 9 -1. + <_> + 10 8 5 3 9. + <_> + + <_> + 0 18 4 2 -1. + <_> + 0 19 4 1 2. + <_> + + <_> + 0 12 10 3 -1. + <_> + 0 13 10 1 3. + <_> + + <_> + 1 14 1 2 -1. + <_> + 1 15 1 1 2. + <_> + + <_> + 5 1 4 2 -1. + <_> + 6 1 2 2 2. + <_> + + <_> + 2 13 1 2 -1. + <_> + 2 14 1 1 2. + <_> + + <_> + 0 13 7 3 -1. + <_> + 0 14 7 1 3. + <_> + + <_> + 15 6 3 5 -1. + <_> + 16 7 1 5 3. + 1 + <_> + + <_> + 13 10 2 1 -1. + <_> + 14 10 1 1 2. + <_> + + <_> + 5 3 3 5 -1. + <_> + 6 4 1 5 3. + 1 + <_> + + <_> + 5 3 3 5 -1. + <_> + 6 4 1 5 3. + 1 + <_> + + <_> + 17 5 3 2 -1. + <_> + 18 6 1 2 3. + 1 + <_> + + <_> + 4 0 2 3 -1. + <_> + 3 1 2 1 3. + 1 + <_> + + <_> + 11 5 2 1 -1. + <_> + 12 5 1 1 2. + <_> + + <_> + 16 6 3 3 -1. + <_> + 15 7 3 1 3. + 1 + <_> + + <_> + 2 16 1 4 -1. + <_> + 2 17 1 2 2. + <_> + + <_> + 2 13 5 2 -1. + <_> + 2 13 5 1 2. + 1 + <_> + + <_> + 12 5 1 2 -1. + <_> + 12 6 1 1 2. + <_> + + <_> + 10 3 6 4 -1. + <_> + 10 4 6 2 2. + <_> + + <_> + 13 8 4 6 -1. + <_> + 13 8 2 3 2. + <_> + 15 11 2 3 2. + <_> + + <_> + 6 15 3 2 -1. + <_> + 7 16 1 2 3. + 1 + <_> + + <_> + 16 10 4 3 -1. + <_> + 17 11 2 3 2. + 1 + <_> + + <_> + 1 2 6 8 -1. + <_> + 4 2 3 8 2. + <_> + + <_> + 4 0 15 1 -1. + <_> + 9 0 5 1 3. + <_> + + <_> + 15 13 2 2 -1. + <_> + 15 13 2 1 2. + 1 + <_> + + <_> + 14 2 6 1 -1. + <_> + 17 2 3 1 2. + <_> + + <_> + 15 0 3 3 -1. + <_> + 16 1 1 3 3. + 1 + <_> + + <_> + 18 7 2 1 -1. + <_> + 18 7 1 1 2. + 1 + <_> + + <_> + 4 3 3 4 -1. + <_> + 3 4 3 2 2. + 1 + <_> + + <_> + 16 8 4 4 -1. + <_> + 16 9 4 2 2. + <_> + + <_> + 7 4 2 4 -1. + <_> + 6 5 2 2 2. + 1 + <_> + + <_> + 16 14 4 6 -1. + <_> + 18 14 2 6 2. + <_> + + <_> + 7 9 6 3 -1. + <_> + 9 10 2 1 9. + <_> + + <_> + 8 9 3 4 -1. + <_> + 9 9 1 4 3. + <_> + + <_> + 8 0 6 3 -1. + <_> + 10 0 2 3 3. + <_> + + <_> + 0 8 3 3 -1. + <_> + 0 9 3 1 3. + <_> + + <_> + 18 16 1 3 -1. + <_> + 18 17 1 1 3. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 17 5 3 3 -1. + <_> + 16 6 3 1 3. + 1 + <_> + + <_> + 12 8 1 6 -1. + <_> + 10 10 1 2 3. + 1 + <_> + + <_> + 10 3 6 12 -1. + <_> + 12 3 2 12 3. + <_> + + <_> + 8 6 5 14 -1. + <_> + 8 13 5 7 2. + <_> + + <_> + 1 17 19 2 -1. + <_> + 1 18 19 1 2. + <_> + + <_> + 14 7 2 4 -1. + <_> + 14 9 2 2 2. + <_> + + <_> + 3 13 2 4 -1. + <_> + 3 15 2 2 2. + <_> + + <_> + 1 2 18 12 -1. + <_> + 7 6 6 4 9. + <_> + + <_> + 0 0 4 5 -1. + <_> + 2 0 2 5 2. + <_> + + <_> + 14 14 6 6 -1. + <_> + 17 14 3 6 2. + <_> + + <_> + 4 16 16 3 -1. + <_> + 8 16 8 3 2. + <_> + + <_> + 8 17 8 1 -1. + <_> + 10 17 4 1 2. + <_> + + <_> + 4 7 4 4 -1. + <_> + 4 9 4 2 2. + <_> + + <_> + 0 0 18 9 -1. + <_> + 6 3 6 3 9. + <_> + + <_> + 0 9 6 2 -1. + <_> + 2 9 2 2 3. + <_> + + <_> + 15 0 3 1 -1. + <_> + 16 0 1 1 3. + <_> + + <_> + 16 0 2 1 -1. + <_> + 17 0 1 1 2. + <_> + + <_> + 18 14 1 2 -1. + <_> + 18 15 1 1 2. + <_> + + <_> + 4 0 3 2 -1. + <_> + 5 0 1 2 3. + <_> + + <_> + 6 14 3 1 -1. + <_> + 7 15 1 1 3. + 1 + <_> + + <_> + 0 11 7 3 -1. + <_> + 0 12 7 1 3. + <_> + + <_> + 1 14 19 3 -1. + <_> + 1 15 19 1 3. + <_> + + <_> + 15 1 3 5 -1. + <_> + 16 1 1 5 3. + <_> + + <_> + 14 2 6 4 -1. + <_> + 14 2 3 2 2. + <_> + 17 4 3 2 2. + <_> + + <_> + 15 10 2 2 -1. + <_> + 16 10 1 2 2. + <_> + + <_> + 14 11 3 4 -1. + <_> + 14 13 3 2 2. + <_> + + <_> + 16 5 3 15 -1. + <_> + 17 5 1 15 3. + <_> + + <_> + 6 10 14 3 -1. + <_> + 6 11 14 1 3. + <_> + + <_> + 2 17 12 3 -1. + <_> + 6 17 4 3 3. + <_> + + <_> + 0 16 16 2 -1. + <_> + 4 16 8 2 2. + <_> + + <_> + 7 3 6 16 -1. + <_> + 7 7 6 8 2. + <_> + + <_> + 7 1 12 3 -1. + <_> + 10 1 6 3 2. + <_> + + <_> + 13 1 4 4 -1. + <_> + 13 3 4 2 2. + <_> + + <_> + 6 18 3 2 -1. + <_> + 7 18 1 2 3. + <_> + + <_> + 2 2 3 5 -1. + <_> + 3 2 1 5 3. + <_> + + <_> + 10 0 3 3 -1. + <_> + 11 0 1 3 3. + <_> + + <_> + 10 0 10 4 -1. + <_> + 10 0 5 2 2. + <_> + 15 2 5 2 2. + <_> + + <_> + 0 16 6 3 -1. + <_> + 3 16 3 3 2. + <_> + + <_> + 0 17 6 3 -1. + <_> + 3 17 3 3 2. + <_> + + <_> + 16 1 3 2 -1. + <_> + 17 2 1 2 3. + 1 + <_> + + <_> + 4 1 3 3 -1. + <_> + 3 2 3 1 3. + 1 + <_> + + <_> + 6 0 4 5 -1. + <_> + 7 0 2 5 2. + <_> + + <_> + 4 17 3 3 -1. + <_> + 5 18 1 1 9. + <_> + + <_> + 4 15 3 3 -1. + <_> + 5 16 1 1 9. + <_> + + <_> + 1 10 6 1 -1. + <_> + 3 10 2 1 3. + <_> + + <_> + 0 3 20 2 -1. + <_> + 5 3 10 2 2. + <_> + + <_> + 2 1 15 4 -1. + <_> + 7 1 5 4 3. + <_> + + <_> + 1 10 18 8 -1. + <_> + 10 10 9 8 2. + <_> + + <_> + 16 7 1 4 -1. + <_> + 16 9 1 2 2. + <_> + + <_> + 17 9 2 1 -1. + <_> + 18 9 1 1 2. + <_> + + <_> + 17 5 3 7 -1. + <_> + 18 5 1 7 3. + <_> + + <_> + 5 10 12 1 -1. + <_> + 8 10 6 1 2. + <_> + + <_> + 15 9 2 6 -1. + <_> + 15 9 1 3 2. + <_> + 16 12 1 3 2. + <_> + + <_> + 1 6 16 10 -1. + <_> + 1 11 16 5 2. + <_> + + <_> + 1 12 19 8 -1. + <_> + 1 16 19 4 2. + <_> + + <_> + 4 4 12 9 -1. + <_> + 8 7 4 3 9. + <_> + + <_> + 5 2 9 9 -1. + <_> + 5 5 9 3 3. + <_> + + <_> + 13 0 3 6 -1. + <_> + 14 0 1 6 3. + <_> + + <_> + 19 16 1 3 -1. + <_> + 18 17 1 1 3. + 1 + <_> + + <_> + 17 17 1 2 -1. + <_> + 17 18 1 1 2. + <_> + + <_> + 0 9 4 2 -1. + <_> + 2 9 2 2 2. + <_> + + <_> + 3 0 3 19 -1. + <_> + 4 0 1 19 3. + <_> + + <_> + 4 13 4 1 -1. + <_> + 5 14 2 1 2. + 1 + <_> + + <_> + 16 0 4 1 -1. + <_> + 18 0 2 1 2. + <_> + + <_> + 10 0 4 4 -1. + <_> + 11 0 2 4 2. + <_> + + <_> + 9 0 3 5 -1. + <_> + 10 0 1 5 3. + <_> + + <_> + 3 4 1 3 -1. + <_> + 2 5 1 1 3. + 1 + <_> + + <_> + 3 4 2 3 -1. + <_> + 2 5 2 1 3. + 1 + <_> + + <_> + 5 14 3 3 -1. + <_> + 6 15 1 3 3. + 1 + <_> + + <_> + 2 0 2 2 -1. + <_> + 2 0 1 2 2. + 1 + <_> + + <_> + 0 2 6 1 -1. + <_> + 3 2 3 1 2. + <_> + + <_> + 0 2 4 5 -1. + <_> + 2 2 2 5 2. + <_> + + <_> + 2 0 4 4 -1. + <_> + 3 0 2 4 2. + <_> + + <_> + 6 16 3 1 -1. + <_> + 7 17 1 1 3. + 1 + <_> + + <_> + 16 3 4 2 -1. + <_> + 17 4 2 2 2. + 1 + <_> + + <_> + 16 19 2 1 -1. + <_> + 17 19 1 1 2. + <_> + + <_> + 17 18 2 1 -1. + <_> + 18 18 1 1 2. + <_> + + <_> + 17 16 1 3 -1. + <_> + 17 17 1 1 3. + <_> + + <_> + 9 8 3 3 -1. + <_> + 9 9 3 1 3. + <_> + + <_> + 2 17 5 2 -1. + <_> + 2 18 5 1 2. + <_> + + <_> + 6 10 8 3 -1. + <_> + 8 10 4 3 2. + <_> + + <_> + 17 15 2 3 -1. + <_> + 16 16 2 1 3. + 1 + <_> + + <_> + 6 8 5 2 -1. + <_> + 6 8 5 1 2. + 1 + <_> + + <_> + 11 0 3 4 -1. + <_> + 11 2 3 2 2. + <_> + + <_> + 17 2 3 3 -1. + <_> + 18 3 1 3 3. + 1 + <_> + + <_> + 16 4 3 2 -1. + <_> + 16 5 3 1 2. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 3 2. + <_> + 17 3 3 3 2. + <_> + + <_> + 6 2 10 4 -1. + <_> + 6 4 10 2 2. + <_> + + <_> + 5 6 9 2 -1. + <_> + 5 7 9 1 2. + <_> + + <_> + 7 6 6 3 -1. + <_> + 7 7 6 1 3. + <_> + + <_> + 17 0 3 1 -1. + <_> + 18 1 1 1 3. + 1 + <_> + + <_> + 8 0 12 2 -1. + <_> + 14 0 6 2 2. + <_> + + <_> + 16 2 4 2 -1. + <_> + 18 2 2 2 2. + <_> + + <_> + 9 4 4 1 -1. + <_> + 10 4 2 1 2. + <_> + + <_> + 5 4 2 3 -1. + <_> + 4 5 2 1 3. + 1 + <_> + + <_> + 16 8 4 8 -1. + <_> + 17 8 2 8 2. + <_> + + <_> + 1 19 16 1 -1. + <_> + 9 19 8 1 2. + <_> + + <_> + 4 19 12 1 -1. + <_> + 10 19 6 1 2. + <_> + + <_> + 2 19 4 1 -1. + <_> + 4 19 2 1 2. + <_> + + <_> + 12 5 2 8 -1. + <_> + 12 7 2 4 2. + <_> + + <_> + 8 10 1 2 -1. + <_> + 8 10 1 1 2. + 1 + <_> + + <_> + 15 3 3 12 -1. + <_> + 16 3 1 12 3. + <_> + + <_> + 16 14 4 3 -1. + <_> + 16 15 4 1 3. + <_> + + <_> + 3 0 3 2 -1. + <_> + 4 0 1 2 3. + <_> + + <_> + 13 13 3 6 -1. + <_> + 14 13 1 6 3. + <_> + + <_> + 2 12 2 2 -1. + <_> + 2 12 2 1 2. + 1 + <_> + + <_> + 1 8 1 9 -1. + <_> + 1 11 1 3 3. + <_> + + <_> + 1 9 2 2 -1. + <_> + 2 9 1 2 2. + <_> + + <_> + 13 9 2 3 -1. + <_> + 12 10 2 1 3. + 1 + <_> + + <_> + 10 14 4 6 -1. + <_> + 11 14 2 6 2. + <_> + + <_> + 11 6 4 8 -1. + <_> + 12 6 2 8 2. + <_> + + <_> + 5 6 14 14 -1. + <_> + 5 13 14 7 2. + <_> + + <_> + 6 4 8 3 -1. + <_> + 6 5 8 1 3. + <_> + + <_> + 1 16 1 3 -1. + <_> + 1 17 1 1 3. + <_> + + <_> + 5 1 4 3 -1. + <_> + 4 2 4 1 3. + 1 + <_> + + <_> + 17 3 3 3 -1. + <_> + 16 4 3 1 3. + 1 + <_> + + <_> + 15 3 5 15 -1. + <_> + 15 8 5 5 3. + <_> + + <_> + 15 9 4 6 -1. + <_> + 15 9 2 3 2. + <_> + 17 12 2 3 2. + <_> + + <_> + 16 7 3 3 -1. + <_> + 15 8 3 1 3. + 1 + <_> + + <_> + 11 5 6 9 -1. + <_> + 13 5 2 9 3. + <_> + + <_> + 16 15 2 3 -1. + <_> + 15 16 2 1 3. + 1 + <_> + + <_> + 0 17 7 3 -1. + <_> + 0 18 7 1 3. + <_> + + <_> + 16 8 4 7 -1. + <_> + 17 9 2 7 2. + 1 + <_> + + <_> + 15 16 1 3 -1. + <_> + 14 17 1 1 3. + 1 + <_> + + <_> + 12 17 8 1 -1. + <_> + 16 17 4 1 2. + <_> + + <_> + 14 16 2 4 -1. + <_> + 14 18 2 2 2. + <_> + + <_> + 4 10 12 1 -1. + <_> + 8 10 4 1 3. + <_> + + <_> + 4 9 2 2 -1. + <_> + 5 9 1 2 2. + <_> + + <_> + 7 10 9 2 -1. + <_> + 10 10 3 2 3. + <_> + + <_> + 5 3 13 9 -1. + <_> + 5 6 13 3 3. + <_> + + <_> + 6 7 5 2 -1. + <_> + 6 8 5 1 2. + <_> + + <_> + 5 5 12 14 -1. + <_> + 9 5 4 14 3. + <_> + + <_> + 18 8 2 10 -1. + <_> + 18 13 2 5 2. + <_> + + <_> + 8 1 4 4 -1. + <_> + 9 1 2 4 2. + <_> + + <_> + 0 0 20 7 -1. + <_> + 5 0 10 7 2. + <_> + + <_> + 10 0 4 4 -1. + <_> + 11 0 2 4 2. + <_> + + <_> + 13 1 3 2 -1. + <_> + 14 1 1 2 3. + <_> + + <_> + 12 0 8 1 -1. + <_> + 16 0 4 1 2. + <_> + + <_> + 0 3 4 6 -1. + <_> + 0 3 2 3 2. + <_> + 2 6 2 3 2. + <_> + + <_> + 1 0 4 5 -1. + <_> + 3 0 2 5 2. + <_> + + <_> + 4 5 1 3 -1. + <_> + 3 6 1 1 3. + 1 + <_> + + <_> + 4 14 4 2 -1. + <_> + 4 14 2 2 2. + 1 + <_> + + <_> + 3 13 16 7 -1. + <_> + 11 13 8 7 2. + <_> + + <_> + 5 1 9 4 -1. + <_> + 5 2 9 2 2. + <_> + + <_> + 4 1 3 3 -1. + <_> + 5 1 1 3 3. + <_> + + <_> + 0 0 10 1 -1. + <_> + 5 0 5 1 2. + <_> + + <_> + 8 6 5 4 -1. + <_> + 7 7 5 2 2. + 1 + <_> + + <_> + 18 4 2 2 -1. + <_> + 18 4 1 2 2. + 1 + <_> + + <_> + 11 7 3 3 -1. + <_> + 12 8 1 1 9. + <_> + + <_> + 16 16 2 2 -1. + <_> + 16 16 1 1 2. + <_> + 17 17 1 1 2. + <_> + + <_> + 3 5 1 3 -1. + <_> + 2 6 1 1 3. + 1 + <_> + + <_> + 7 10 2 3 -1. + <_> + 6 11 2 1 3. + 1 + <_> + + <_> + 0 5 2 14 -1. + <_> + 0 12 2 7 2. + <_> + + <_> + 14 12 5 2 -1. + <_> + 14 13 5 1 2. + <_> + + <_> + 5 4 3 5 -1. + <_> + 6 5 1 5 3. + 1 + <_> + + <_> + 0 8 20 6 -1. + <_> + 0 10 20 2 3. + <_> + + <_> + 15 10 2 2 -1. + <_> + 15 10 1 2 2. + 1 + <_> + + <_> + 1 15 14 2 -1. + <_> + 8 15 7 2 2. + <_> + + <_> + 2 14 4 5 -1. + <_> + 4 14 2 5 2. + <_> + + <_> + 17 15 2 3 -1. + <_> + 16 16 2 1 3. + 1 + <_> + + <_> + 5 0 6 4 -1. + <_> + 7 0 2 4 3. + <_> + + <_> + 6 0 14 20 -1. + <_> + 6 10 14 10 2. + <_> + + <_> + 13 1 1 9 -1. + <_> + 13 4 1 3 3. + <_> + + <_> + 15 0 1 4 -1. + <_> + 15 1 1 2 2. + <_> + + <_> + 13 3 2 2 -1. + <_> + 14 3 1 2 2. + <_> + + <_> + 16 18 3 2 -1. + <_> + 16 19 3 1 2. + <_> + + <_> + 17 17 2 3 -1. + <_> + 17 18 2 1 3. + <_> + + <_> + 4 6 8 6 -1. + <_> + 4 6 4 3 2. + <_> + 8 9 4 3 2. + <_> + + <_> + 0 3 18 3 -1. + <_> + 6 3 6 3 3. + <_> + + <_> + 16 1 3 2 -1. + <_> + 17 1 1 2 3. + <_> + + <_> + 4 7 4 3 -1. + <_> + 4 7 2 3 2. + 1 + <_> + + <_> + 0 17 20 3 -1. + <_> + 5 17 10 3 2. + <_> + + <_> + 15 16 4 2 -1. + <_> + 17 16 2 2 2. + <_> + + <_> + 5 13 2 5 -1. + <_> + 5 13 1 5 2. + 1 + <_> + + <_> + 1 8 10 1 -1. + <_> + 1 8 5 1 2. + 1 + <_> + + <_> + 9 15 9 5 -1. + <_> + 12 15 3 5 3. + <_> + + <_> + 15 8 4 7 -1. + <_> + 16 8 2 7 2. + <_> + + <_> + 12 4 3 1 -1. + <_> + 13 4 1 1 3. + <_> + + <_> + 15 3 4 11 -1. + <_> + 16 3 2 11 2. + <_> + + <_> + 3 15 3 1 -1. + <_> + 4 16 1 1 3. + 1 + <_> + + <_> + 13 8 3 4 -1. + <_> + 14 9 1 4 3. + 1 + <_> + + <_> + 4 2 12 2 -1. + <_> + 10 2 6 2 2. + <_> + + <_> + 2 1 16 7 -1. + <_> + 10 1 8 7 2. + <_> + + <_> + 12 1 3 4 -1. + <_> + 12 2 3 2 2. + <_> + + <_> + 10 8 10 12 -1. + <_> + 10 12 10 4 3. + <_> + + <_> + 17 0 3 8 -1. + <_> + 17 4 3 4 2. + <_> + + <_> + 6 2 3 2 -1. + <_> + 7 2 1 2 3. + <_> + + <_> + 4 1 3 8 -1. + <_> + 5 1 1 8 3. + <_> + + <_> + 4 18 6 2 -1. + <_> + 7 18 3 2 2. + <_> + + <_> + 8 0 2 6 -1. + <_> + 8 0 1 6 2. + 1 + <_> + + <_> + 2 1 3 14 -1. + <_> + 3 1 1 14 3. + <_> + + <_> + 17 0 3 9 -1. + <_> + 18 0 1 9 3. + <_> + + <_> + 6 5 3 5 -1. + <_> + 7 6 1 5 3. + 1 + <_> + + <_> + 6 8 2 5 -1. + <_> + 7 8 1 5 2. + <_> + + <_> + 5 8 9 11 -1. + <_> + 8 8 3 11 3. + <_> + + <_> + 7 16 3 4 -1. + <_> + 8 16 1 4 3. + <_> + + <_> + 10 12 3 6 -1. + <_> + 11 12 1 6 3. + <_> + + <_> + 8 17 6 2 -1. + <_> + 10 17 2 2 3. + <_> + + <_> + 12 0 8 4 -1. + <_> + 12 0 4 2 2. + <_> + 16 2 4 2 2. + <_> + + <_> + 19 0 1 2 -1. + <_> + 19 1 1 1 2. + <_> + + <_> + 18 1 2 1 -1. + <_> + 19 1 1 1 2. + <_> + + <_> + 5 6 1 3 -1. + <_> + 4 7 1 1 3. + 1 + <_> + + <_> + 6 6 2 1 -1. + <_> + 6 6 1 1 2. + 1 + <_> + + <_> + 0 7 2 3 -1. + <_> + 0 8 2 1 3. + <_> + + <_> + 14 7 2 5 -1. + <_> + 15 7 1 5 2. + <_> + + <_> + 16 5 2 7 -1. + <_> + 16 5 1 7 2. + 1 + <_> + + <_> + 14 8 4 6 -1. + <_> + 15 9 2 6 2. + 1 + <_> + + <_> + 4 8 4 4 -1. + <_> + 4 8 2 4 2. + 1 + <_> + + <_> + 16 1 4 2 -1. + <_> + 18 1 2 2 2. + <_> + + <_> + 8 0 12 2 -1. + <_> + 14 0 6 2 2. + <_> + + <_> + 7 2 4 1 -1. + <_> + 8 2 2 1 2. + <_> + + <_> + 18 7 2 3 -1. + <_> + 18 8 2 1 3. + <_> + + <_> + 13 3 4 4 -1. + <_> + 13 4 4 2 2. + <_> + + <_> + 0 8 17 4 -1. + <_> + 0 9 17 2 2. + <_> + + <_> + 11 8 1 4 -1. + <_> + 11 9 1 2 2. + <_> + + <_> + 12 8 8 2 -1. + <_> + 12 8 4 1 2. + <_> + 16 9 4 1 2. + <_> + + <_> + 12 10 6 1 -1. + <_> + 14 10 2 1 3. + <_> + + <_> + 5 8 2 5 -1. + <_> + 5 8 1 5 2. + 1 + <_> + + <_> + 12 9 2 1 -1. + <_> + 12 9 1 1 2. + 1 + <_> + + <_> + 5 10 3 1 -1. + <_> + 6 10 1 1 3. + <_> + + <_> + 0 6 20 14 -1. + <_> + 0 13 20 7 2. + <_> + + <_> + 9 5 4 8 -1. + <_> + 9 5 4 4 2. + 1 + <_> + + <_> + 6 1 9 2 -1. + <_> + 6 2 9 1 2. + <_> + + <_> + 7 1 8 4 -1. + <_> + 7 2 8 2 2. + <_> + + <_> + 3 0 12 4 -1. + <_> + 3 1 12 2 2. + <_> + + <_> + 0 1 9 7 -1. + <_> + 3 1 3 7 3. + <_> + + <_> + 5 9 6 3 -1. + <_> + 7 9 2 3 3. + <_> + + <_> + 6 4 10 3 -1. + <_> + 5 5 10 1 3. + 1 + <_> + + <_> + 12 0 8 7 -1. + <_> + 14 0 4 7 2. + <_> + + <_> + 8 0 6 6 -1. + <_> + 10 0 2 6 3. + <_> + + <_> + 1 14 4 1 -1. + <_> + 1 14 2 1 2. + 1 + <_> + + <_> + 5 9 3 4 -1. + <_> + 6 10 1 4 3. + 1 + <_> + + <_> + 5 17 10 3 -1. + <_> + 5 18 10 1 3. + <_> + + <_> + 7 14 6 4 -1. + <_> + 7 15 6 2 2. + <_> + + <_> + 8 13 7 3 -1. + <_> + 8 14 7 1 3. + <_> + + <_> + 8 7 8 3 -1. + <_> + 7 8 8 1 3. + 1 + <_> + + <_> + 18 16 2 2 -1. + <_> + 18 16 1 1 2. + <_> + 19 17 1 1 2. + <_> + + <_> + 9 3 9 6 -1. + <_> + 7 5 9 2 3. + 1 + <_> + + <_> + 18 18 1 2 -1. + <_> + 18 19 1 1 2. + <_> + + <_> + 16 11 4 1 -1. + <_> + 17 12 2 1 2. + 1 + <_> + + <_> + 5 0 4 3 -1. + <_> + 5 1 4 1 3. + <_> + + <_> + 13 10 4 1 -1. + <_> + 14 10 2 1 2. + <_> + + <_> + 15 7 2 10 -1. + <_> + 15 7 1 5 2. + <_> + 16 12 1 5 2. + <_> + + <_> + 6 0 3 20 -1. + <_> + 6 10 3 10 2. + <_> + + <_> + 4 4 9 16 -1. + <_> + 4 8 9 8 2. + <_> + + <_> + 2 9 3 3 -1. + <_> + 3 9 1 3 3. + <_> + + <_> + 3 1 9 6 -1. + <_> + 6 1 3 6 3. + <_> + + <_> + 5 18 1 2 -1. + <_> + 5 19 1 1 2. + <_> + + <_> + 4 0 6 5 -1. + <_> + 6 0 2 5 3. + <_> + + <_> + 16 8 3 7 -1. + <_> + 17 9 1 7 3. + 1 + <_> + + <_> + 15 3 3 7 -1. + <_> + 16 4 1 7 3. + 1 + <_> + + <_> + 18 3 1 15 -1. + <_> + 18 8 1 5 3. + <_> + + <_> + 5 10 4 1 -1. + <_> + 6 10 2 1 2. + <_> + + <_> + 7 8 3 12 -1. + <_> + 8 8 1 12 3. + <_> + + <_> + 14 6 4 2 -1. + <_> + 14 6 2 1 2. + <_> + 16 7 2 1 2. + <_> + + <_> + 5 18 2 2 -1. + <_> + 5 18 1 1 2. + <_> + 6 19 1 1 2. + <_> + + <_> + 8 18 2 2 -1. + <_> + 8 18 1 1 2. + <_> + 9 19 1 1 2. + <_> + + <_> + 3 18 2 2 -1. + <_> + 3 18 1 1 2. + <_> + 4 19 1 1 2. + <_> + + <_> + 6 4 3 6 -1. + <_> + 7 5 1 6 3. + 1 + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 1 1 2. + <_> + 17 8 1 1 2. + <_> + + <_> + 0 8 12 3 -1. + <_> + 6 8 6 3 2. + <_> + + <_> + 9 10 6 2 -1. + <_> + 11 10 2 2 3. + <_> + + <_> + 8 5 9 8 -1. + <_> + 11 5 3 8 3. + <_> + + <_> + 16 8 4 12 -1. + <_> + 16 14 4 6 2. + <_> + + <_> + 9 16 10 4 -1. + <_> + 9 17 10 2 2. + <_> + + <_> + 12 0 1 20 -1. + <_> + 12 10 1 10 2. + <_> + + <_> + 8 9 3 3 -1. + <_> + 9 10 1 1 9. + <_> + + <_> + 5 4 3 2 -1. + <_> + 6 4 1 2 3. + <_> + + <_> + 4 0 4 5 -1. + <_> + 5 0 2 5 2. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 1 2. + <_> + 17 19 1 1 2. + <_> + + <_> + 4 10 5 3 -1. + <_> + 3 11 5 1 3. + 1 + <_> + + <_> + 0 0 4 12 -1. + <_> + 1 0 2 12 2. + <_> + + <_> + 7 1 8 14 -1. + <_> + 9 1 4 14 2. + <_> + + <_> + 5 14 7 3 -1. + <_> + 5 15 7 1 3. + <_> + + <_> + 15 7 4 2 -1. + <_> + 15 7 2 1 2. + <_> + 17 8 2 1 2. + <_> + + <_> + 8 18 3 1 -1. + <_> + 9 18 1 1 3. + <_> + + <_> + 1 9 6 6 -1. + <_> + 1 12 6 3 2. + <_> + + <_> + 9 4 5 3 -1. + <_> + 8 5 5 1 3. + 1 + <_> + + <_> + 14 6 6 2 -1. + <_> + 14 6 3 2 2. + 1 + <_> + + <_> + 8 18 3 2 -1. + <_> + 9 18 1 2 3. + <_> + + <_> + 9 16 2 2 -1. + <_> + 9 16 1 1 2. + <_> + 10 17 1 1 2. + <_> + + <_> + 0 8 13 8 -1. + <_> + 0 10 13 4 2. + <_> + + <_> + 12 6 4 7 -1. + <_> + 13 6 2 7 2. + <_> + + <_> + 5 6 5 3 -1. + <_> + 5 7 5 1 3. + <_> + + <_> + 11 18 2 2 -1. + <_> + 11 18 1 1 2. + <_> + 12 19 1 1 2. + <_> + + <_> + 12 9 6 2 -1. + <_> + 14 9 2 2 3. + <_> + + <_> + 0 9 6 2 -1. + <_> + 2 9 2 2 3. + <_> + + <_> + 2 7 4 6 -1. + <_> + 3 7 2 6 2. + <_> + + <_> + 6 4 10 4 -1. + <_> + 6 6 10 2 2. + <_> + + <_> + 9 5 2 4 -1. + <_> + 9 7 2 2 2. + <_> + + <_> + 15 9 2 2 -1. + <_> + 16 9 1 2 2. + <_> + + <_> + 0 15 20 4 -1. + <_> + 5 15 10 4 2. + <_> + + <_> + 10 9 1 8 -1. + <_> + 10 13 1 4 2. + <_> + + <_> + 8 17 4 3 -1. + <_> + 9 17 2 3 2. + <_> + + <_> + 0 17 1 3 -1. + <_> + 0 18 1 1 3. + <_> + + <_> + 18 6 2 1 -1. + <_> + 18 6 1 1 2. + 1 + <_> + + <_> + 0 15 1 4 -1. + <_> + 0 16 1 2 2. + <_> + + <_> + 7 16 6 2 -1. + <_> + 9 16 2 2 3. + <_> + + <_> + 5 10 3 1 -1. + <_> + 6 10 1 1 3. + <_> + + <_> + 4 16 8 4 -1. + <_> + 6 16 4 4 2. + <_> + + <_> + 0 6 1 3 -1. + <_> + 0 7 1 1 3. + <_> + + <_> + 1 7 4 1 -1. + <_> + 2 8 2 1 2. + 1 + <_> + + <_> + 5 4 1 8 -1. + <_> + 5 8 1 4 2. + <_> + + <_> + 7 1 5 4 -1. + <_> + 7 3 5 2 2. + <_> + + <_> + 7 1 5 4 -1. + <_> + 7 3 5 2 2. + <_> + + <_> + 18 0 2 4 -1. + <_> + 18 1 2 2 2. + <_> + + <_> + 0 0 8 3 -1. + <_> + 4 0 4 3 2. + <_> + + <_> + 0 0 2 2 -1. + <_> + 0 1 2 1 2. + <_> + + <_> + 14 0 6 1 -1. + <_> + 17 0 3 1 2. + <_> + + <_> + 6 2 3 3 -1. + <_> + 5 3 3 1 3. + 1 + <_> + + <_> + 13 4 2 2 -1. + <_> + 13 5 2 1 2. + <_> + + <_> + 18 4 2 3 -1. + <_> + 18 5 2 1 3. + <_> + + <_> + 17 0 3 4 -1. + <_> + 18 1 1 4 3. + 1 + <_> + + <_> + 16 1 4 4 -1. + <_> + 17 2 2 4 2. + 1 + <_> + + <_> + 6 9 6 9 -1. + <_> + 8 9 2 9 3. + <_> + + <_> + 6 8 2 5 -1. + <_> + 7 8 1 5 2. + <_> + + <_> + 4 3 3 4 -1. + <_> + 5 4 1 4 3. + 1 + <_> + + <_> + 0 18 1 2 -1. + <_> + 0 19 1 1 2. + <_> + + <_> + 15 13 5 4 -1. + <_> + 15 14 5 2 2. + <_> + + <_> + 19 11 1 2 -1. + <_> + 19 12 1 1 2. + <_> + + <_> + 12 8 3 2 -1. + <_> + 13 9 1 2 3. + 1 + <_> + + <_> + 15 15 1 2 -1. + <_> + 15 16 1 1 2. + <_> + + <_> + 14 15 2 3 -1. + <_> + 15 15 1 3 2. + <_> + + <_> + 14 4 4 3 -1. + <_> + 13 5 4 1 3. + 1 + <_> + + <_> + 3 17 1 3 -1. + <_> + 3 18 1 1 3. + <_> + + <_> + 2 18 6 2 -1. + <_> + 2 19 6 1 2. + <_> + + <_> + 2 16 3 3 -1. + <_> + 2 17 3 1 3. + <_> + + <_> + 16 0 4 19 -1. + <_> + 17 0 2 19 2. + <_> + + <_> + 5 16 6 4 -1. + <_> + 7 16 2 4 3. + <_> + + <_> + 5 6 6 6 -1. + <_> + 7 8 2 2 9. + <_> + + <_> + 17 0 2 2 -1. + <_> + 17 0 2 1 2. + 1 + <_> + + <_> + 8 1 12 2 -1. + <_> + 14 1 6 2 2. + <_> + + <_> + 0 0 20 2 -1. + <_> + 0 1 20 1 2. + <_> + + <_> + 18 0 2 2 -1. + <_> + 18 0 1 2 2. + 1 + <_> + + <_> + 17 2 3 3 -1. + <_> + 18 3 1 3 3. + 1 + <_> + + <_> + 3 0 4 3 -1. + <_> + 2 1 4 1 3. + 1 + <_> + + <_> + 12 7 3 4 -1. + <_> + 13 7 1 4 3. + <_> + + <_> + 12 0 1 6 -1. + <_> + 12 2 1 2 3. + <_> + + <_> + 6 4 3 4 -1. + <_> + 7 5 1 4 3. + 1 + <_> + + <_> + 9 13 2 2 -1. + <_> + 9 14 2 1 2. + <_> + + <_> + 15 15 2 2 -1. + <_> + 16 15 1 2 2. + <_> + + <_> + 15 12 5 6 -1. + <_> + 15 15 5 3 2. + <_> + + <_> + 3 1 1 3 -1. + <_> + 2 2 1 1 3. + 1 + <_> + + <_> + 15 14 2 2 -1. + <_> + 15 14 1 1 2. + <_> + 16 15 1 1 2. + <_> + + <_> + 15 14 2 2 -1. + <_> + 15 14 1 1 2. + <_> + 16 15 1 1 2. + <_> + + <_> + 7 16 2 2 -1. + <_> + 7 16 1 2 2. + 1 + <_> + + <_> + 13 0 6 6 -1. + <_> + 15 0 2 6 3. + <_> + + <_> + 15 3 5 3 -1. + <_> + 14 4 5 1 3. + 1 + <_> + + <_> + 5 15 10 2 -1. + <_> + 10 15 5 2 2. + <_> + + <_> + 9 16 2 1 -1. + <_> + 10 16 1 1 2. + <_> + + <_> + 2 14 4 2 -1. + <_> + 2 14 4 1 2. + 1 + <_> + + <_> + 17 14 3 3 -1. + <_> + 16 15 3 1 3. + 1 + <_> + + <_> + 18 14 1 4 -1. + <_> + 17 15 1 2 2. + 1 + <_> + + <_> + 1 13 5 3 -1. + <_> + 1 14 5 1 3. + <_> + + <_> + 3 12 1 2 -1. + <_> + 3 12 1 1 2. + 1 + <_> + + <_> + 18 4 2 4 -1. + <_> + 18 6 2 2 2. + <_> + + <_> + 18 0 1 2 -1. + <_> + 18 0 1 1 2. + 1 + <_> + + <_> + 1 14 8 2 -1. + <_> + 1 15 8 1 2. + <_> + + <_> + 16 2 4 3 -1. + <_> + 15 3 4 1 3. + 1 + <_> + + <_> + 16 2 2 4 -1. + <_> + 16 4 2 2 2. + <_> + + <_> + 19 5 1 3 -1. + <_> + 19 6 1 1 3. + <_> + + <_> + 11 6 4 6 -1. + <_> + 12 6 2 6 2. + <_> + + <_> + 3 9 6 3 -1. + <_> + 5 9 2 3 3. + <_> + + <_> + 2 8 4 12 -1. + <_> + 2 8 2 6 2. + <_> + 4 14 2 6 2. + <_> + + <_> + 12 5 6 1 -1. + <_> + 12 5 3 1 2. + 1 + <_> + + <_> + 7 9 12 5 -1. + <_> + 13 9 6 5 2. + <_> + + <_> + 13 9 6 3 -1. + <_> + 13 10 6 1 3. + <_> + + <_> + 19 18 1 2 -1. + <_> + 19 19 1 1 2. + <_> + + <_> + 19 17 1 3 -1. + <_> + 19 18 1 1 3. + <_> + + <_> + 15 9 2 4 -1. + <_> + 15 9 1 2 2. + <_> + 16 11 1 2 2. + <_> + + <_> + 16 5 4 3 -1. + <_> + 16 6 4 1 3. + <_> + + <_> + 5 0 3 3 -1. + <_> + 4 1 3 1 3. + 1 + <_> + + <_> + 10 1 6 3 -1. + <_> + 12 1 2 3 3. + <_> + + <_> + 13 9 3 1 -1. + <_> + 14 9 1 1 3. + <_> + + <_> + 0 2 6 4 -1. + <_> + 0 2 3 2 2. + <_> + 3 4 3 2 2. + <_> + + <_> + 0 8 19 4 -1. + <_> + 0 9 19 2 2. + <_> + + <_> + 7 5 3 6 -1. + <_> + 8 7 1 2 9. + <_> + + <_> + 4 4 1 3 -1. + <_> + 3 5 1 1 3. + 1 + <_> + + <_> + 0 2 4 4 -1. + <_> + 0 2 2 2 2. + <_> + 2 4 2 2 2. + <_> + + <_> + 5 0 3 3 -1. + <_> + 6 1 1 1 9. + <_> + + <_> + 19 2 1 3 -1. + <_> + 19 3 1 1 3. + <_> + + <_> + 7 6 5 3 -1. + <_> + 7 7 5 1 3. + <_> + + <_> + 7 5 1 4 -1. + <_> + 6 6 1 2 2. + 1 + <_> + + <_> + 14 10 2 1 -1. + <_> + 15 10 1 1 2. + <_> + + <_> + 6 10 9 2 -1. + <_> + 9 10 3 2 3. + <_> + + <_> + 15 5 2 6 -1. + <_> + 15 5 1 3 2. + <_> + 16 8 1 3 2. + <_> + + <_> + 5 10 2 2 -1. + <_> + 6 10 1 2 2. + <_> + + <_> + 6 10 2 2 -1. + <_> + 6 10 1 1 2. + <_> + 7 11 1 1 2. + <_> + + <_> + 5 9 4 2 -1. + <_> + 6 9 2 2 2. + <_> + + <_> + 12 10 4 4 -1. + <_> + 12 10 4 2 2. + 1 + <_> + + <_> + 0 9 3 10 -1. + <_> + 0 14 3 5 2. + <_> + + <_> + 3 3 15 9 -1. + <_> + 8 6 5 3 9. + <_> + + <_> + 8 1 8 18 -1. + <_> + 8 1 4 9 2. + <_> + 12 10 4 9 2. + <_> + + <_> + 3 6 3 11 -1. + <_> + 4 6 1 11 3. + <_> + + <_> + 11 8 4 3 -1. + <_> + 12 8 2 3 2. + <_> + + <_> + 17 8 2 3 -1. + <_> + 16 9 2 1 3. + 1 + <_> + + <_> + 3 1 6 5 -1. + <_> + 5 1 2 5 3. + <_> + + <_> + 6 18 2 2 -1. + <_> + 6 18 1 1 2. + <_> + 7 19 1 1 2. + <_> + + <_> + 9 18 3 2 -1. + <_> + 10 18 1 2 3. + <_> + + <_> + 15 6 4 9 -1. + <_> + 16 6 2 9 2. + <_> + + <_> + 6 9 6 5 -1. + <_> + 8 9 2 5 3. + <_> + + <_> + 15 4 3 15 -1. + <_> + 16 4 1 15 3. + <_> + + <_> + 14 4 2 16 -1. + <_> + 14 12 2 8 2. + <_> + + <_> + 12 2 4 2 -1. + <_> + 12 3 4 1 2. + <_> + + <_> + 19 5 1 6 -1. + <_> + 19 8 1 3 2. + <_> + + <_> + 5 0 9 6 -1. + <_> + 5 2 9 2 3. + <_> + + <_> + 6 3 3 3 -1. + <_> + 5 4 3 1 3. + 1 + <_> + + <_> + 17 4 3 1 -1. + <_> + 18 5 1 1 3. + 1 + <_> + + <_> + 8 5 9 4 -1. + <_> + 8 6 9 2 2. + <_> + + <_> + 9 7 4 3 -1. + <_> + 8 8 4 1 3. + 1 + <_> + + <_> + 0 18 2 2 -1. + <_> + 0 18 1 1 2. + <_> + 1 19 1 1 2. + <_> + + <_> + 0 9 10 4 -1. + <_> + 0 10 10 2 2. + <_> + + <_> + 17 8 3 3 -1. + <_> + 16 9 3 1 3. + 1 + <_> + + <_> + 14 4 3 16 -1. + <_> + 15 4 1 16 3. + <_> + + <_> + 15 4 4 1 -1. + <_> + 16 5 2 1 2. + 1 + <_> + + <_> + 14 6 4 2 -1. + <_> + 14 6 2 1 2. + <_> + 16 7 2 1 2. + <_> + + <_> + 15 5 5 3 -1. + <_> + 15 6 5 1 3. + <_> + + <_> + 0 0 6 20 -1. + <_> + 2 0 2 20 3. + <_> + + <_> + 1 7 4 9 -1. + <_> + 2 7 2 9 2. + <_> + + <_> + 1 19 4 1 -1. + <_> + 3 19 2 1 2. + <_> + + <_> + 2 0 5 2 -1. + <_> + 2 0 5 1 2. + 1 + <_> + + <_> + 18 16 1 2 -1. + <_> + 18 17 1 1 2. + <_> + + <_> + 7 9 3 1 -1. + <_> + 8 9 1 1 3. + <_> + + <_> + 5 5 1 8 -1. + <_> + 5 7 1 4 2. + <_> + + <_> + 9 9 3 2 -1. + <_> + 10 10 1 2 3. + 1 + <_> + + <_> + 9 5 2 7 -1. + <_> + 10 5 1 7 2. + <_> + + <_> + 0 17 11 3 -1. + <_> + 0 18 11 1 3. + <_> + + <_> + 6 14 5 4 -1. + <_> + 6 15 5 2 2. + <_> + + <_> + 3 18 1 2 -1. + <_> + 3 19 1 1 2. + <_> + + <_> + 2 7 11 2 -1. + <_> + 2 8 11 1 2. + <_> + + <_> + 7 7 3 6 -1. + <_> + 7 9 3 2 3. + <_> + + <_> + 12 0 8 3 -1. + <_> + 14 0 4 3 2. + <_> + + <_> + 2 2 16 1 -1. + <_> + 10 2 8 1 2. + <_> + + <_> + 10 0 6 3 -1. + <_> + 12 0 2 3 3. + <_> + + <_> + 11 8 7 4 -1. + <_> + 11 9 7 2 2. + <_> + + <_> + 8 7 4 3 -1. + <_> + 8 8 4 1 3. + <_> + + <_> + 5 8 11 12 -1. + <_> + 5 12 11 4 3. + <_> + + <_> + 11 7 6 3 -1. + <_> + 13 9 2 3 3. + 1 + <_> + + <_> + 3 2 15 6 -1. + <_> + 3 4 15 2 3. + <_> + + <_> + 3 0 3 9 -1. + <_> + 4 0 1 9 3. + <_> + + <_> + 8 18 2 2 -1. + <_> + 8 18 1 1 2. + <_> + 9 19 1 1 2. + <_> + + <_> + 15 0 4 1 -1. + <_> + 16 0 2 1 2. + <_> + + <_> + 17 0 3 2 -1. + <_> + 17 0 3 1 2. + 1 + <_> + + <_> + 10 0 9 6 -1. + <_> + 13 0 3 6 3. + <_> + + <_> + 15 6 3 6 -1. + <_> + 16 7 1 6 3. + 1 + <_> + + <_> + 14 7 5 3 -1. + <_> + 14 8 5 1 3. + <_> + + <_> + 16 11 4 4 -1. + <_> + 17 12 2 4 2. + 1 + <_> + + <_> + 16 10 4 5 -1. + <_> + 17 11 2 5 2. + 1 + <_> + + <_> + 10 4 9 3 -1. + <_> + 13 4 3 3 3. + <_> + + <_> + 5 9 2 4 -1. + <_> + 5 9 1 2 2. + <_> + 6 11 1 2 2. + <_> + + <_> + 18 6 2 8 -1. + <_> + 19 6 1 8 2. + <_> + + <_> + 19 3 1 15 -1. + <_> + 19 8 1 5 3. + <_> + + <_> + 8 9 12 2 -1. + <_> + 14 9 6 2 2. + <_> + + <_> + 18 1 2 10 -1. + <_> + 19 1 1 10 2. + <_> + + <_> + 5 4 3 4 -1. + <_> + 6 5 1 4 3. + 1 + <_> + + <_> + 4 4 4 3 -1. + <_> + 5 5 2 3 2. + 1 + <_> + + <_> + 10 18 4 1 -1. + <_> + 11 18 2 1 2. + <_> + + <_> + 0 4 3 3 -1. + <_> + 0 5 3 1 3. + <_> + + <_> + 8 5 4 1 -1. + <_> + 9 5 2 1 2. + <_> + + <_> + 12 8 8 8 -1. + <_> + 12 10 8 4 2. + <_> + + <_> + 7 7 8 7 -1. + <_> + 11 7 4 7 2. + <_> + + <_> + 11 7 4 4 -1. + <_> + 10 8 4 2 2. + 1 + <_> + + <_> + 5 5 9 3 -1. + <_> + 4 6 9 1 3. + 1 + <_> + + <_> + 6 9 4 3 -1. + <_> + 5 10 4 1 3. + 1 + <_> + + <_> + 12 4 8 6 -1. + <_> + 10 6 8 2 3. + 1 + <_> + + <_> + 9 3 10 5 -1. + <_> + 9 3 5 5 2. + 1 + <_> + + <_> + 15 11 4 2 -1. + <_> + 16 11 2 2 2. + <_> + + <_> + 8 8 8 10 -1. + <_> + 8 8 4 5 2. + <_> + 12 13 4 5 2. + <_> + + <_> + 16 0 4 3 -1. + <_> + 15 1 4 1 3. + 1 + <_> + + <_> + 17 18 1 2 -1. + <_> + 17 19 1 1 2. + <_> + + <_> + 13 18 7 2 -1. + <_> + 13 19 7 1 2. + <_> + + <_> + 5 5 1 4 -1. + <_> + 4 6 1 2 2. + 1 + <_> + + <_> + 2 4 2 4 -1. + <_> + 2 6 2 2 2. + <_> + + <_> + 1 3 4 4 -1. + <_> + 1 3 2 2 2. + <_> + 3 5 2 2 2. + <_> + + <_> + 0 0 7 12 -1. + <_> + 0 6 7 6 2. + <_> + + <_> + 1 0 15 4 -1. + <_> + 1 1 15 2 2. + <_> + + <_> + 14 3 3 14 -1. + <_> + 15 3 1 14 3. + <_> + + <_> + 19 16 1 2 -1. + <_> + 19 16 1 1 2. + 1 + <_> + + <_> + 3 4 4 6 -1. + <_> + 3 7 4 3 2. + <_> + + <_> + 9 5 5 3 -1. + <_> + 9 6 5 1 3. + <_> + + <_> + 17 16 2 1 -1. + <_> + 18 16 1 1 2. + <_> + + <_> + 8 17 12 3 -1. + <_> + 11 17 6 3 2. + <_> + + <_> + 1 12 3 3 -1. + <_> + 1 13 3 1 3. + <_> + + <_> + 7 17 8 2 -1. + <_> + 11 17 4 2 2. + <_> + + <_> + 13 17 4 2 -1. + <_> + 13 18 4 1 2. + <_> + + <_> + 11 17 6 3 -1. + <_> + 13 17 2 3 3. + <_> + + <_> + 6 8 3 4 -1. + <_> + 6 10 3 2 2. + <_> + + <_> + 6 8 3 6 -1. + <_> + 7 10 1 2 9. + <_> + + <_> + 7 4 3 5 -1. + <_> + 8 4 1 5 3. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 1 2. + <_> + 17 19 1 1 2. + <_> + + <_> + 12 0 8 1 -1. + <_> + 14 0 4 1 2. + <_> + + <_> + 16 17 2 2 -1. + <_> + 16 17 1 1 2. + <_> + 17 18 1 1 2. + <_> + + <_> + 1 0 4 1 -1. + <_> + 2 1 2 1 2. + 1 + <_> + + <_> + 3 0 5 10 -1. + <_> + 3 5 5 5 2. + <_> + + <_> + 4 2 3 2 -1. + <_> + 4 3 3 1 2. + <_> + + <_> + 8 9 8 2 -1. + <_> + 10 9 4 2 2. + <_> + + <_> + 13 10 2 3 -1. + <_> + 14 10 1 3 2. + <_> + + <_> + 11 6 1 10 -1. + <_> + 11 6 1 5 2. + 1 + <_> + + <_> + 5 15 12 2 -1. + <_> + 11 15 6 2 2. + <_> + + <_> + 6 3 14 2 -1. + <_> + 6 3 14 1 2. + 1 + <_> + + <_> + 15 1 5 10 -1. + <_> + 15 6 5 5 2. + <_> + + <_> + 18 10 2 2 -1. + <_> + 18 10 2 1 2. + 1 + <_> + + <_> + 12 4 8 3 -1. + <_> + 14 6 4 3 2. + 1 + <_> + + <_> + 2 0 16 2 -1. + <_> + 2 0 8 1 2. + <_> + 10 1 8 1 2. + <_> + + <_> + 0 11 4 8 -1. + <_> + 0 13 4 4 2. + <_> + + <_> + 8 16 2 2 -1. + <_> + 8 16 1 1 2. + <_> + 9 17 1 1 2. + <_> + + <_> + 6 0 12 2 -1. + <_> + 6 0 6 1 2. + <_> + 12 1 6 1 2. + <_> + + <_> + 0 8 6 3 -1. + <_> + 2 8 2 3 3. + <_> + + <_> + 2 2 13 2 -1. + <_> + 2 2 13 1 2. + 1 + <_> + + <_> + 0 7 20 13 -1. + <_> + 5 7 10 13 2. + <_> + + <_> + 15 10 4 2 -1. + <_> + 15 10 2 1 2. + <_> + 17 11 2 1 2. + <_> + + <_> + 16 12 2 6 -1. + <_> + 16 15 2 3 2. + <_> + + <_> + 17 11 1 3 -1. + <_> + 16 12 1 1 3. + 1 + <_> + + <_> + 0 0 16 9 -1. + <_> + 0 3 16 3 3. + <_> + + <_> + 0 15 6 4 -1. + <_> + 0 17 6 2 2. + <_> + + <_> + 14 5 3 6 -1. + <_> + 14 7 3 2 3. + <_> + + <_> + 16 8 3 5 -1. + <_> + 17 8 1 5 3. + <_> + + <_> + 7 10 6 8 -1. + <_> + 9 10 2 8 3. + <_> + + <_> + 14 11 5 4 -1. + <_> + 13 12 5 2 2. + 1 + <_> + + <_> + 14 9 4 3 -1. + <_> + 15 9 2 3 2. + <_> + + <_> + 5 9 9 1 -1. + <_> + 8 9 3 1 3. + <_> + + <_> + 16 1 3 6 -1. + <_> + 17 1 1 6 3. + <_> + + <_> + 10 3 10 2 -1. + <_> + 10 3 5 1 2. + <_> + 15 4 5 1 2. + <_> + + <_> + 2 1 18 1 -1. + <_> + 8 1 6 1 3. + <_> + + <_> + 14 3 5 4 -1. + <_> + 13 4 5 2 2. + 1 + <_> + + <_> + 4 0 4 4 -1. + <_> + 5 0 2 4 2. + <_> + + <_> + 12 1 4 5 -1. + <_> + 13 1 2 5 2. + <_> + + <_> + 9 9 7 3 -1. + <_> + 9 10 7 1 3. + <_> + + <_> + 19 3 1 16 -1. + <_> + 19 11 1 8 2. + <_> + + <_> + 4 0 16 3 -1. + <_> + 8 0 8 3 2. + <_> + + <_> + 8 0 12 3 -1. + <_> + 12 0 4 3 3. + <_> + + <_> + 11 0 6 5 -1. + <_> + 13 0 2 5 3. + <_> + + <_> + 12 4 5 8 -1. + <_> + 12 8 5 4 2. + <_> + + <_> + 6 9 2 4 -1. + <_> + 5 10 2 2 2. + 1 + <_> + + <_> + 13 6 2 3 -1. + <_> + 12 7 2 1 3. + 1 + <_> + + <_> + 10 5 3 1 -1. + <_> + 11 5 1 1 3. + <_> + + <_> + 10 6 4 5 -1. + <_> + 11 6 2 5 2. + <_> + + <_> + 15 17 4 2 -1. + <_> + 17 17 2 2 2. + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 2 1 2. + 1 + <_> + + <_> + 15 7 3 6 -1. + <_> + 13 9 3 2 3. + 1 + <_> + + <_> + 3 0 4 3 -1. + <_> + 4 1 2 3 2. + 1 + <_> + + <_> + 0 2 6 3 -1. + <_> + 2 3 2 1 9. + <_> + + <_> + 2 15 3 2 -1. + <_> + 3 16 1 2 3. + 1 + <_> + + <_> + 19 8 1 2 -1. + <_> + 19 9 1 1 2. + <_> + + <_> + 7 8 4 2 -1. + <_> + 8 8 2 2 2. + <_> + + <_> + 4 8 9 2 -1. + <_> + 7 8 3 2 3. + <_> + + <_> + 6 10 11 6 -1. + <_> + 6 13 11 3 2. + <_> + + <_> + 0 8 20 5 -1. + <_> + 5 8 10 5 2. + <_> + + <_> + 8 12 6 3 -1. + <_> + 10 12 2 3 3. + <_> + + <_> + 2 2 14 18 -1. + <_> + 9 2 7 18 2. + <_> + + <_> + 10 3 1 8 -1. + <_> + 8 5 1 4 2. + 1 + <_> + + <_> + 0 14 8 2 -1. + <_> + 2 14 4 2 2. + <_> + + <_> + 6 13 3 3 -1. + <_> + 7 14 1 3 3. + 1 + <_> + + <_> + 3 2 4 3 -1. + <_> + 2 3 4 1 3. + 1 + <_> + + <_> + 5 6 3 1 -1. + <_> + 6 6 1 1 3. + <_> + + <_> + 2 5 9 1 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 6 2 8 3 -1. + <_> + 6 3 8 1 3. + <_> + + <_> + 1 0 16 5 -1. + <_> + 5 0 8 5 2. + <_> + + <_> + 8 3 3 2 -1. + <_> + 9 3 1 2 3. + <_> + + <_> + 0 0 20 1 -1. + <_> + 5 0 10 1 2. + <_> + + <_> + 9 4 3 4 -1. + <_> + 9 5 3 2 2. + <_> + + <_> + 18 4 1 2 -1. + <_> + 18 4 1 1 2. + 1 + <_> + + <_> + 8 0 9 4 -1. + <_> + 11 3 3 4 3. + 1 + <_> + + <_> + 5 12 9 2 -1. + <_> + 8 12 3 2 3. + <_> + + <_> + 3 15 2 2 -1. + <_> + 3 15 1 1 2. + <_> + 4 16 1 1 2. + <_> + + <_> + 3 15 2 2 -1. + <_> + 3 15 1 1 2. + <_> + 4 16 1 1 2. + <_> + + <_> + 8 13 3 4 -1. + <_> + 9 14 1 4 3. + 1 + <_> + + <_> + 8 13 3 4 -1. + <_> + 9 14 1 4 3. + 1 + <_> + + <_> + 14 17 1 3 -1. + <_> + 14 18 1 1 3. + <_> + + <_> + 15 16 1 2 -1. + <_> + 15 17 1 1 2. + <_> + + <_> + 13 18 3 2 -1. + <_> + 13 19 3 1 2. + <_> + + <_> + 13 17 6 2 -1. + <_> + 13 18 6 1 2. + <_> + + <_> + 5 19 2 1 -1. + <_> + 6 19 1 1 2. + <_> + + <_> + 2 9 2 4 -1. + <_> + 2 11 2 2 2. + <_> + + <_> + 5 1 3 3 -1. + <_> + 4 2 3 1 3. + 1 + <_> + + <_> + 3 10 1 2 -1. + <_> + 3 11 1 1 2. + <_> + + <_> + 8 8 3 2 -1. + <_> + 8 9 3 1 2. + <_> + + <_> + 2 5 7 2 -1. + <_> + 2 6 7 1 2. + <_> + + <_> + 0 0 12 3 -1. + <_> + 3 0 6 3 2. + <_> + + <_> + 12 5 5 4 -1. + <_> + 12 5 5 2 2. + 1 + <_> + + <_> + 17 1 3 17 -1. + <_> + 18 1 1 17 3. + <_> + + <_> + 7 12 2 2 -1. + <_> + 7 13 2 1 2. + <_> + + <_> + 19 4 1 8 -1. + <_> + 19 6 1 4 2. + <_> + + <_> + 11 3 6 3 -1. + <_> + 14 3 3 3 2. + <_> + + <_> + 3 0 17 2 -1. + <_> + 3 1 17 1 2. + <_> + + <_> + 15 1 3 4 -1. + <_> + 15 3 3 2 2. + <_> + + <_> + 12 8 2 2 -1. + <_> + 12 8 1 2 2. + 1 + <_> + + <_> + 7 17 4 2 -1. + <_> + 9 17 2 2 2. + <_> + + <_> + 6 1 6 1 -1. + <_> + 8 1 2 1 3. + <_> + + <_> + 13 3 2 10 -1. + <_> + 13 3 1 5 2. + <_> + 14 8 1 5 2. + <_> + + <_> + 18 1 2 4 -1. + <_> + 18 1 1 2 2. + <_> + 19 3 1 2 2. + <_> + + <_> + 15 2 4 8 -1. + <_> + 16 3 2 8 2. + 1 + <_> + + <_> + 17 3 3 14 -1. + <_> + 17 3 3 7 2. + 1 + <_> + + <_> + 8 7 4 3 -1. + <_> + 9 7 2 3 2. + <_> + + <_> + 8 9 4 3 -1. + <_> + 7 10 4 1 3. + 1 + <_> + + <_> + 10 13 3 3 -1. + <_> + 11 14 1 3 3. + 1 + <_> + + <_> + 7 15 7 4 -1. + <_> + 7 16 7 2 2. + <_> + + <_> + 6 0 10 4 -1. + <_> + 6 1 10 2 2. + <_> + + <_> + 15 14 3 1 -1. + <_> + 16 15 1 1 3. + 1 + <_> + + <_> + 4 10 3 2 -1. + <_> + 4 11 3 1 2. + <_> + + <_> + 7 16 2 2 -1. + <_> + 7 16 1 1 2. + <_> + 8 17 1 1 2. + <_> + + <_> + 0 18 1 2 -1. + <_> + 0 19 1 1 2. + <_> + + <_> + 11 12 2 4 -1. + <_> + 11 12 1 2 2. + <_> + 12 14 1 2 2. + <_> + + <_> + 10 8 3 8 -1. + <_> + 11 9 1 8 3. + 1 + <_> + + <_> + 5 9 4 3 -1. + <_> + 6 9 2 3 2. + <_> + + <_> + 11 11 3 2 -1. + <_> + 11 12 3 1 2. + <_> + + <_> + 6 17 14 2 -1. + <_> + 6 17 7 1 2. + <_> + 13 18 7 1 2. + <_> + + <_> + 2 18 8 2 -1. + <_> + 2 18 4 1 2. + <_> + 6 19 4 1 2. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 14 14 4 2 -1. + <_> + 15 14 2 2 2. + <_> + + <_> + 16 16 2 2 -1. + <_> + 16 16 1 1 2. + <_> + 17 17 1 1 2. + <_> + + <_> + 19 15 1 3 -1. + <_> + 18 16 1 1 3. + 1 + <_> + + <_> + 16 8 4 6 -1. + <_> + 16 8 2 3 2. + <_> + 18 11 2 3 2. + <_> + + <_> + 6 17 2 2 -1. + <_> + 6 17 1 1 2. + <_> + 7 18 1 1 2. + <_> + + <_> + 3 7 6 3 -1. + <_> + 5 9 2 3 3. + 1 + <_> + + <_> + 3 0 3 18 -1. + <_> + 4 0 1 18 3. + <_> + + <_> + 8 4 10 4 -1. + <_> + 7 5 10 2 2. + 1 + <_> + + <_> + 3 9 4 6 -1. + <_> + 3 9 2 3 2. + <_> + 5 12 2 3 2. + <_> + + <_> + 10 1 8 7 -1. + <_> + 12 3 4 7 2. + 1 + <_> + + <_> + 14 8 3 1 -1. + <_> + 15 9 1 1 3. + 1 + <_> + + <_> + 16 3 3 12 -1. + <_> + 17 7 1 4 9. + <_> + + <_> + 5 12 3 3 -1. + <_> + 6 13 1 3 3. + 1 + <_> + + <_> + 0 1 17 6 -1. + <_> + 0 3 17 2 3. + <_> + + <_> + 0 18 18 2 -1. + <_> + 6 18 6 2 3. + <_> + + <_> + 2 15 3 2 -1. + <_> + 2 15 3 1 2. + 1 + <_> + + <_> + 18 1 2 6 -1. + <_> + 19 1 1 6 2. + <_> + + <_> + 11 7 8 4 -1. + <_> + 11 7 8 2 2. + 1 + <_> + + <_> + 6 10 3 3 -1. + <_> + 7 11 1 1 9. + <_> + + <_> + 5 5 3 8 -1. + <_> + 6 5 1 8 3. + <_> + + <_> + 2 8 10 2 -1. + <_> + 2 8 5 2 2. + 1 + <_> + + <_> + 2 9 6 5 -1. + <_> + 4 9 2 5 3. + <_> + + <_> + 8 7 5 3 -1. + <_> + 7 8 5 1 3. + 1 + <_> + + <_> + 2 8 3 10 -1. + <_> + 3 8 1 10 3. + <_> + + <_> + 4 2 15 9 -1. + <_> + 4 5 15 3 3. + <_> + + <_> + 9 7 9 3 -1. + <_> + 8 8 9 1 3. + 1 + <_> + + <_> + 2 12 4 3 -1. + <_> + 2 13 4 1 3. + <_> + + <_> + 5 12 6 1 -1. + <_> + 5 12 3 1 2. + 1 + <_> + + <_> + 9 9 3 3 -1. + <_> + 10 10 1 1 9. + <_> + + <_> + 1 18 1 2 -1. + <_> + 1 19 1 1 2. + <_> + + <_> + 0 18 2 2 -1. + <_> + 0 18 1 1 2. + <_> + 1 19 1 1 2. + <_> + + <_> + 6 6 8 3 -1. + <_> + 8 6 4 3 2. + <_> + + <_> + 9 7 9 6 -1. + <_> + 12 7 3 6 3. + <_> + + <_> + 5 16 1 4 -1. + <_> + 5 17 1 2 2. + <_> + + <_> + 9 9 4 1 -1. + <_> + 10 9 2 1 2. + <_> + + <_> + 14 1 4 4 -1. + <_> + 15 1 2 4 2. + <_> + + <_> + 0 0 6 3 -1. + <_> + 3 0 3 3 2. + <_> + + <_> + 0 0 4 3 -1. + <_> + 2 0 2 3 2. + <_> + + <_> + 0 12 8 2 -1. + <_> + 2 12 4 2 2. + <_> + + <_> + 5 10 2 1 -1. + <_> + 6 10 1 1 2. + <_> + + <_> + 11 6 9 3 -1. + <_> + 10 7 9 1 3. + 1 + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 16 14 3 3 -1. + <_> + 15 15 3 1 3. + 1 + <_> + + <_> + 11 4 1 3 -1. + <_> + 11 5 1 1 3. + <_> + + <_> + 0 6 12 9 -1. + <_> + 0 9 12 3 3. + <_> + + <_> + 1 9 18 10 -1. + <_> + 10 9 9 10 2. + <_> + + <_> + 12 3 5 10 -1. + <_> + 12 8 5 5 2. + <_> + + <_> + 1 6 12 14 -1. + <_> + 1 13 12 7 2. + <_> + + <_> + 13 5 2 1 -1. + <_> + 13 5 1 1 2. + 1 + <_> + + <_> + 0 0 16 3 -1. + <_> + 0 1 16 1 3. + <_> + + <_> + 1 11 2 1 -1. + <_> + 1 11 1 1 2. + 1 + <_> + + <_> + 14 5 6 5 -1. + <_> + 16 5 2 5 3. + <_> + + <_> + 16 8 3 4 -1. + <_> + 16 10 3 2 2. + <_> + + <_> + 18 9 2 4 -1. + <_> + 17 10 2 2 2. + 1 + <_> + + <_> + 18 18 1 2 -1. + <_> + 18 19 1 1 2. + <_> + + <_> + 5 5 2 1 -1. + <_> + 6 5 1 1 2. + <_> + + <_> + 7 2 12 2 -1. + <_> + 7 2 6 1 2. + <_> + 13 3 6 1 2. + <_> + + <_> + 6 0 12 6 -1. + <_> + 9 0 6 6 2. + <_> + + <_> + 4 0 3 3 -1. + <_> + 3 1 3 1 3. + 1 + <_> + + <_> + 12 19 4 1 -1. + <_> + 14 19 2 1 2. + <_> + + <_> + 12 11 1 2 -1. + <_> + 12 12 1 1 2. + <_> + + <_> + 0 0 20 2 -1. + <_> + 5 0 10 2 2. + <_> + + <_> + 13 0 4 2 -1. + <_> + 15 0 2 2 2. + <_> + + <_> + 17 1 3 12 -1. + <_> + 18 5 1 4 9. + <_> + + <_> + 0 0 10 2 -1. + <_> + 5 0 5 2 2. + <_> + + <_> + 4 15 12 2 -1. + <_> + 10 15 6 2 2. + <_> + + <_> + 10 1 3 2 -1. + <_> + 10 2 3 1 2. + <_> + + <_> + 5 2 15 6 -1. + <_> + 10 4 5 2 9. + <_> + + <_> + 7 6 3 5 -1. + <_> + 8 6 1 5 3. + <_> + + <_> + 15 2 3 3 -1. + <_> + 16 3 1 3 3. + 1 + <_> + + <_> + 6 2 9 6 -1. + <_> + 4 4 9 2 3. + 1 + <_> + + <_> + 15 9 2 1 -1. + <_> + 15 9 1 1 2. + 1 + <_> + + <_> + 3 8 4 6 -1. + <_> + 3 8 2 3 2. + <_> + 5 11 2 3 2. + <_> + + <_> + 2 7 16 10 -1. + <_> + 2 12 16 5 2. + <_> + + <_> + 7 3 9 16 -1. + <_> + 10 3 3 16 3. + <_> + + <_> + 15 9 1 6 -1. + <_> + 13 11 1 2 3. + 1 + <_> + + <_> + 2 11 2 2 -1. + <_> + 2 11 2 1 2. + 1 + <_> + + <_> + 9 4 4 3 -1. + <_> + 10 5 2 3 2. + 1 + <_> + + <_> + 13 13 4 4 -1. + <_> + 13 15 4 2 2. + <_> + + <_> + 3 1 4 3 -1. + <_> + 4 2 2 3 2. + 1 + <_> + + <_> + 0 7 3 5 -1. + <_> + 1 7 1 5 3. + <_> + + <_> + 3 0 3 6 -1. + <_> + 3 2 3 2 3. + <_> + + <_> + 4 9 15 4 -1. + <_> + 4 10 15 2 2. + <_> + + <_> + 3 0 12 20 -1. + <_> + 3 10 12 10 2. + <_> + + <_> + 0 18 2 2 -1. + <_> + 1 18 1 2 2. + <_> + + <_> + 16 0 3 8 -1. + <_> + 17 0 1 8 3. + <_> + + <_> + 16 3 3 4 -1. + <_> + 17 3 1 4 3. + <_> + + <_> + 0 0 2 6 -1. + <_> + 0 0 1 3 2. + <_> + 1 3 1 3 2. + <_> + + <_> + 16 10 4 5 -1. + <_> + 17 11 2 5 2. + 1 + <_> + + <_> + 8 14 12 3 -1. + <_> + 12 15 4 1 9. + <_> + + <_> + 5 13 12 4 -1. + <_> + 8 13 6 4 2. + <_> + + <_> + 3 9 4 3 -1. + <_> + 4 9 2 3 2. + <_> + + <_> + 0 14 3 3 -1. + <_> + 0 15 3 1 3. + <_> + + <_> + 14 3 1 14 -1. + <_> + 14 3 1 7 2. + 1 + <_> + + <_> + 9 0 3 1 -1. + <_> + 10 0 1 1 3. + <_> + + <_> + 8 9 8 1 -1. + <_> + 10 9 4 1 2. + <_> + + <_> + 16 8 3 2 -1. + <_> + 17 9 1 2 3. + 1 + <_> + + <_> + 14 7 6 4 -1. + <_> + 14 8 6 2 2. + <_> + + <_> + 0 14 1 3 -1. + <_> + 0 15 1 1 3. + <_> + + <_> + 18 8 1 3 -1. + <_> + 18 9 1 1 3. + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 1 1 2. + <_> + 17 8 1 1 2. + <_> + + <_> + 15 0 3 17 -1. + <_> + 16 0 1 17 3. + <_> + + <_> + 11 15 6 4 -1. + <_> + 13 15 2 4 3. + <_> + + <_> + 12 10 6 1 -1. + <_> + 14 10 2 1 3. + <_> + + <_> + 9 7 1 4 -1. + <_> + 9 7 1 2 2. + 1 + <_> + + <_> + 9 10 1 10 -1. + <_> + 9 15 1 5 2. + <_> + + <_> + 4 6 16 14 -1. + <_> + 8 6 8 14 2. + <_> + + <_> + 1 6 6 11 -1. + <_> + 3 6 2 11 3. + <_> + + <_> + 5 6 3 6 -1. + <_> + 5 9 3 3 2. + <_> + + <_> + 14 0 4 9 -1. + <_> + 15 0 2 9 2. + <_> + + <_> + 9 13 3 6 -1. + <_> + 10 13 1 6 3. + <_> + + <_> + 11 3 6 7 -1. + <_> + 13 5 2 7 3. + 1 + <_> + + <_> + 18 12 1 2 -1. + <_> + 18 13 1 1 2. + <_> + + <_> + 17 0 2 1 -1. + <_> + 18 0 1 1 2. + <_> + + <_> + 1 2 15 3 -1. + <_> + 1 3 15 1 3. + <_> + + <_> + 3 1 3 5 -1. + <_> + 4 1 1 5 3. + <_> + + <_> + 4 3 6 3 -1. + <_> + 6 3 2 3 3. + <_> + + <_> + 7 1 6 5 -1. + <_> + 9 1 2 5 3. + <_> + + <_> + 13 7 2 5 -1. + <_> + 14 7 1 5 2. + <_> + + <_> + 8 10 2 2 -1. + <_> + 8 10 2 1 2. + 1 + <_> + + <_> + 2 10 12 4 -1. + <_> + 2 12 12 2 2. + <_> + + <_> + 3 5 3 3 -1. + <_> + 2 6 3 1 3. + 1 + <_> + + <_> + 11 6 6 6 -1. + <_> + 9 8 6 2 3. + 1 + <_> + + <_> + 4 5 9 12 -1. + <_> + 7 9 3 4 9. + <_> + + <_> + 12 6 1 3 -1. + <_> + 11 7 1 1 3. + 1 + <_> + + <_> + 11 1 5 9 -1. + <_> + 11 4 5 3 3. + <_> + + <_> + 10 7 4 1 -1. + <_> + 11 7 2 1 2. + <_> + + <_> + 0 0 10 6 -1. + <_> + 0 0 5 3 2. + <_> + 5 3 5 3 2. + <_> + + <_> + 2 0 3 6 -1. + <_> + 2 2 3 2 3. + <_> + + <_> + 6 6 4 3 -1. + <_> + 7 6 2 3 2. + <_> + + <_> + 5 0 2 3 -1. + <_> + 4 1 2 1 3. + 1 + <_> + + <_> + 13 15 2 3 -1. + <_> + 12 16 2 1 3. + 1 + <_> + + <_> + 10 2 8 4 -1. + <_> + 12 2 4 4 2. + <_> + + <_> + 6 8 2 6 -1. + <_> + 4 10 2 2 3. + 1 + <_> + + <_> + 18 0 2 4 -1. + <_> + 17 1 2 2 2. + 1 + <_> + + <_> + 6 0 12 2 -1. + <_> + 10 0 4 2 3. + <_> + + <_> + 2 0 18 2 -1. + <_> + 2 0 9 1 2. + <_> + 11 1 9 1 2. + <_> + + <_> + 17 8 3 2 -1. + <_> + 18 9 1 2 3. + 1 + <_> + + <_> + 5 2 3 3 -1. + <_> + 4 3 3 1 3. + 1 + <_> + + <_> + 18 0 2 20 -1. + <_> + 19 0 1 20 2. + <_> + + <_> + 16 11 4 5 -1. + <_> + 17 12 2 5 2. + 1 + <_> + + <_> + 7 0 6 1 -1. + <_> + 10 0 3 1 2. + <_> + + <_> + 15 11 3 2 -1. + <_> + 16 12 1 2 3. + 1 + <_> + + <_> + 13 11 7 2 -1. + <_> + 13 11 7 1 2. + 1 + <_> + + <_> + 0 1 2 17 -1. + <_> + 1 1 1 17 2. + <_> + + <_> + 4 4 2 3 -1. + <_> + 3 5 2 1 3. + 1 + <_> + + <_> + 18 5 1 8 -1. + <_> + 18 9 1 4 2. + <_> + + <_> + 13 7 2 1 -1. + <_> + 13 7 1 1 2. + 1 + <_> + + <_> + 7 4 12 2 -1. + <_> + 7 4 6 1 2. + <_> + 13 5 6 1 2. + <_> + + <_> + 6 18 6 2 -1. + <_> + 9 18 3 2 2. + <_> + + <_> + 0 1 20 4 -1. + <_> + 5 1 10 4 2. + <_> + + <_> + 14 10 2 1 -1. + <_> + 15 10 1 1 2. + <_> + + <_> + 5 4 10 10 -1. + <_> + 10 4 5 10 2. + <_> + + <_> + 3 2 1 3 -1. + <_> + 2 3 1 1 3. + 1 + <_> + + <_> + 3 13 4 3 -1. + <_> + 3 13 2 3 2. + 1 + <_> + + <_> + 16 19 4 1 -1. + <_> + 18 19 2 1 2. + <_> + + <_> + 3 14 4 2 -1. + <_> + 4 14 2 2 2. + <_> + + <_> + 8 7 6 3 -1. + <_> + 10 9 2 3 3. + 1 + <_> + + <_> + 12 2 8 6 -1. + <_> + 12 4 8 2 3. + <_> + + <_> + 0 0 6 1 -1. + <_> + 3 0 3 1 2. + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 18 1 1 2. + <_> + 19 19 1 1 2. + <_> + + <_> + 17 17 2 3 -1. + <_> + 17 18 2 1 3. + <_> + + <_> + 18 16 1 2 -1. + <_> + 18 17 1 1 2. + <_> + + <_> + 15 9 2 4 -1. + <_> + 15 9 1 2 2. + <_> + 16 11 1 2 2. + <_> + + <_> + 4 10 16 4 -1. + <_> + 4 11 16 2 2. + <_> + + <_> + 16 5 3 3 -1. + <_> + 15 6 3 1 3. + 1 + <_> + + <_> + 16 12 4 4 -1. + <_> + 17 13 2 4 2. + 1 + <_> + + <_> + 18 3 2 15 -1. + <_> + 18 8 2 5 3. + <_> + + <_> + 13 4 1 12 -1. + <_> + 13 4 1 6 2. + 1 + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 1 1 2. + <_> + 18 17 1 1 2. + <_> + + <_> + 0 0 2 2 -1. + <_> + 0 1 2 1 2. + <_> + + <_> + 5 4 1 2 -1. + <_> + 5 5 1 1 2. + <_> + + <_> + 2 2 3 18 -1. + <_> + 3 2 1 18 3. + <_> + + <_> + 7 9 2 3 -1. + <_> + 6 10 2 1 3. + 1 + <_> + + <_> + 8 2 7 4 -1. + <_> + 8 3 7 2 2. + <_> + + <_> + 16 0 4 1 -1. + <_> + 16 0 2 1 2. + 1 + <_> + + <_> + 0 17 20 2 -1. + <_> + 5 17 10 2 2. + <_> + + <_> + 1 18 6 1 -1. + <_> + 4 18 3 1 2. + <_> + + <_> + 5 18 6 2 -1. + <_> + 8 18 3 2 2. + <_> + + <_> + 9 8 3 2 -1. + <_> + 10 8 1 2 3. + <_> + + <_> + 11 1 3 1 -1. + <_> + 12 1 1 1 3. + <_> + + <_> + 0 18 20 2 -1. + <_> + 0 18 10 1 2. + <_> + 10 19 10 1 2. + <_> + + <_> + 15 9 1 2 -1. + <_> + 15 10 1 1 2. + <_> + + <_> + 17 1 2 1 -1. + <_> + 18 1 1 1 2. + <_> + + <_> + 15 0 4 1 -1. + <_> + 17 0 2 1 2. + <_> + + <_> + 19 0 1 2 -1. + <_> + 19 1 1 1 2. + <_> + + <_> + 2 18 18 2 -1. + <_> + 2 18 9 1 2. + <_> + 11 19 9 1 2. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 16 15 1 3 -1. + <_> + 15 16 1 1 3. + 1 + <_> + + <_> + 2 9 1 2 -1. + <_> + 2 9 1 1 2. + 1 + <_> + + <_> + 6 4 4 3 -1. + <_> + 7 5 2 3 2. + 1 + <_> + + <_> + 3 5 12 12 -1. + <_> + 7 9 4 4 9. + <_> + + <_> + 7 12 3 4 -1. + <_> + 8 12 1 4 3. + <_> + + <_> + 17 4 3 3 -1. + <_> + 18 5 1 3 3. + 1 + <_> + + <_> + 17 16 2 1 -1. + <_> + 17 16 1 1 2. + 1 + <_> + + <_> + 7 6 1 2 -1. + <_> + 7 6 1 1 2. + 1 + <_> + + <_> + 1 0 12 1 -1. + <_> + 7 0 6 1 2. + <_> + + <_> + 0 7 18 8 -1. + <_> + 6 7 6 8 3. + <_> + + <_> + 13 14 4 6 -1. + <_> + 14 14 2 6 2. + <_> + + <_> + 6 10 3 3 -1. + <_> + 5 11 3 1 3. + 1 + <_> + + <_> + 16 2 4 2 -1. + <_> + 18 2 2 2 2. + <_> + + <_> + 9 13 8 4 -1. + <_> + 13 13 4 4 2. + <_> + + <_> + 12 0 6 20 -1. + <_> + 12 10 6 10 2. + <_> + + <_> + 18 0 2 8 -1. + <_> + 19 0 1 8 2. + <_> + + <_> + 18 5 2 14 -1. + <_> + 18 12 2 7 2. + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 1 1 2. + <_> + 17 8 1 1 2. + <_> + + <_> + 9 13 8 4 -1. + <_> + 9 15 8 2 2. + <_> + + <_> + 0 10 14 10 -1. + <_> + 0 15 14 5 2. + <_> + + <_> + 1 8 14 4 -1. + <_> + 1 9 14 2 2. + <_> + + <_> + 2 8 11 4 -1. + <_> + 2 9 11 2 2. + <_> + + <_> + 4 0 6 2 -1. + <_> + 4 0 3 1 2. + <_> + 7 1 3 1 2. + <_> + + <_> + 8 16 4 2 -1. + <_> + 9 16 2 2 2. + <_> + + <_> + 7 4 4 12 -1. + <_> + 7 8 4 4 3. + <_> + + <_> + 17 10 2 6 -1. + <_> + 17 10 1 6 2. + 1 + <_> + + <_> + 7 0 4 3 -1. + <_> + 8 0 2 3 2. + <_> + + <_> + 16 7 4 1 -1. + <_> + 17 7 2 1 2. + <_> + + <_> + 17 3 2 8 -1. + <_> + 17 3 1 4 2. + <_> + 18 7 1 4 2. + <_> + + <_> + 9 8 10 8 -1. + <_> + 9 8 5 4 2. + <_> + 14 12 5 4 2. + <_> + + <_> + 9 14 3 1 -1. + <_> + 10 14 1 1 3. + <_> + + <_> + 9 0 6 14 -1. + <_> + 11 0 2 14 3. + <_> + + <_> + 11 11 4 1 -1. + <_> + 12 12 2 1 2. + 1 + <_> + + <_> + 2 14 9 6 -1. + <_> + 5 14 3 6 3. + <_> + + <_> + 14 2 6 1 -1. + <_> + 17 2 3 1 2. + <_> + + <_> + 2 16 9 2 -1. + <_> + 5 16 3 2 3. + <_> + + <_> + 4 5 3 8 -1. + <_> + 4 9 3 4 2. + <_> + + <_> + 1 1 7 4 -1. + <_> + 1 3 7 2 2. + <_> + + <_> + 3 9 6 3 -1. + <_> + 5 9 2 3 3. + <_> + + <_> + 13 9 4 2 -1. + <_> + 14 9 2 2 2. + <_> + + <_> + 7 10 2 2 -1. + <_> + 7 10 1 1 2. + <_> + 8 11 1 1 2. + <_> + + <_> + 13 7 4 7 -1. + <_> + 13 7 2 7 2. + 1 + <_> + + <_> + 19 6 1 4 -1. + <_> + 18 7 1 2 2. + 1 + <_> + + <_> + 1 14 4 2 -1. + <_> + 3 14 2 2 2. + <_> + + <_> + 0 2 16 16 -1. + <_> + 0 6 16 8 2. + <_> + + <_> + 1 1 6 1 -1. + <_> + 4 1 3 1 2. + <_> + + <_> + 6 9 2 3 -1. + <_> + 7 9 1 3 2. + <_> + + <_> + 16 5 4 9 -1. + <_> + 17 5 2 9 2. + <_> + + <_> + 7 12 3 5 -1. + <_> + 8 13 1 5 3. + 1 + <_> + + <_> + 5 6 3 4 -1. + <_> + 6 7 1 4 3. + 1 + <_> + + <_> + 16 1 4 1 -1. + <_> + 18 1 2 1 2. + <_> + + <_> + 8 0 12 16 -1. + <_> + 8 0 6 8 2. + <_> + 14 8 6 8 2. + <_> + + <_> + 4 5 13 2 -1. + <_> + 4 5 13 1 2. + 1 + <_> + + <_> + 17 17 1 2 -1. + <_> + 17 17 1 1 2. + 1 + <_> + + <_> + 17 18 3 2 -1. + <_> + 17 19 3 1 2. + <_> + + <_> + 16 10 3 3 -1. + <_> + 17 10 1 3 3. + <_> + + <_> + 11 4 3 2 -1. + <_> + 11 5 3 1 2. + <_> + + <_> + 8 2 8 4 -1. + <_> + 8 3 8 2 2. + <_> + + <_> + 14 3 5 9 -1. + <_> + 14 6 5 3 3. + <_> + + <_> + 0 18 9 2 -1. + <_> + 0 19 9 1 2. + <_> + + <_> + 17 3 3 1 -1. + <_> + 18 4 1 1 3. + 1 + <_> + + <_> + 13 12 5 3 -1. + <_> + 12 13 5 1 3. + 1 + <_> + + <_> + 10 13 4 2 -1. + <_> + 10 14 4 1 2. + <_> + + <_> + 8 8 3 3 -1. + <_> + 7 9 3 1 3. + 1 + <_> + + <_> + 16 3 3 3 -1. + <_> + 15 4 3 1 3. + 1 + <_> + + <_> + 15 18 4 1 -1. + <_> + 17 18 2 1 2. + <_> + + <_> + 5 0 2 3 -1. + <_> + 5 0 1 3 2. + 1 + <_> + + <_> + 11 10 3 2 -1. + <_> + 12 10 1 2 3. + <_> + + <_> + 0 2 2 18 -1. + <_> + 0 2 1 9 2. + <_> + 1 11 1 9 2. + <_> + + <_> + 1 8 8 7 -1. + <_> + 3 8 4 7 2. + <_> + + <_> + 12 18 4 2 -1. + <_> + 12 18 2 1 2. + <_> + 14 19 2 1 2. + <_> + + <_> + 3 4 16 12 -1. + <_> + 7 4 8 12 2. + <_> + + <_> + 5 8 6 1 -1. + <_> + 7 8 2 1 3. + <_> + + <_> + 7 4 12 8 -1. + <_> + 11 4 4 8 3. + <_> + + <_> + 8 16 2 2 -1. + <_> + 8 16 1 1 2. + <_> + 9 17 1 1 2. + <_> + + <_> + 3 4 3 3 -1. + <_> + 2 5 3 1 3. + 1 + <_> + + <_> + 8 5 3 6 -1. + <_> + 9 7 1 2 9. + <_> + + <_> + 2 5 18 2 -1. + <_> + 8 5 6 2 3. + <_> + + <_> + 14 8 1 2 -1. + <_> + 14 9 1 1 2. + <_> + + <_> + 5 1 4 1 -1. + <_> + 6 1 2 1 2. + <_> + + <_> + 1 9 17 3 -1. + <_> + 1 10 17 1 3. + <_> + + <_> + 1 17 9 3 -1. + <_> + 1 18 9 1 3. + <_> + + <_> + 4 16 6 2 -1. + <_> + 4 17 6 1 2. + <_> + + <_> + 3 8 2 2 -1. + <_> + 3 8 1 1 2. + <_> + 4 9 1 1 2. + <_> + + <_> + 17 8 3 3 -1. + <_> + 16 9 3 1 3. + 1 + <_> + + <_> + 7 3 4 2 -1. + <_> + 8 3 2 2 2. + <_> + + <_> + 4 9 2 1 -1. + <_> + 4 9 1 1 2. + 1 + <_> + + <_> + 0 4 2 4 -1. + <_> + 1 4 1 4 2. + <_> + + <_> + 6 3 1 12 -1. + <_> + 6 9 1 6 2. + <_> + + <_> + 0 7 4 2 -1. + <_> + 0 8 4 1 2. + <_> + + <_> + 2 0 5 16 -1. + <_> + 2 8 5 8 2. + <_> + + <_> + 11 0 3 6 -1. + <_> + 9 2 3 2 3. + 1 + <_> + + <_> + 5 16 12 1 -1. + <_> + 8 16 6 1 2. + <_> + + <_> + 9 8 3 2 -1. + <_> + 10 8 1 2 3. + <_> + + <_> + 14 8 3 6 -1. + <_> + 15 9 1 6 3. + 1 + <_> + + <_> + 13 8 4 7 -1. + <_> + 14 9 2 7 2. + 1 + <_> + + <_> + 16 7 3 4 -1. + <_> + 15 8 3 2 2. + 1 + <_> + + <_> + 13 1 1 16 -1. + <_> + 13 9 1 8 2. + <_> + + <_> + 7 17 8 1 -1. + <_> + 9 17 4 1 2. + <_> + + <_> + 9 10 3 5 -1. + <_> + 10 11 1 5 3. + 1 + <_> + + <_> + 4 11 6 3 -1. + <_> + 6 13 2 3 3. + 1 + <_> + + <_> + 3 16 1 2 -1. + <_> + 3 16 1 1 2. + 1 + <_> + + <_> + 5 13 3 4 -1. + <_> + 4 14 3 2 2. + 1 + <_> + + <_> + 7 5 8 8 -1. + <_> + 9 5 4 8 2. + <_> + + <_> + 17 5 2 4 -1. + <_> + 17 5 1 4 2. + 1 + <_> + + <_> + 0 14 3 4 -1. + <_> + 0 15 3 2 2. + <_> + + <_> + 16 16 2 2 -1. + <_> + 16 16 1 1 2. + <_> + 17 17 1 1 2. + <_> + + <_> + 6 16 6 4 -1. + <_> + 8 16 2 4 3. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 9 17 2 1 -1. + <_> + 10 17 1 1 2. + <_> + + <_> + 14 5 5 8 -1. + <_> + 14 7 5 4 2. + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 8 2 1 2. + <_> + + <_> + 9 11 2 7 -1. + <_> + 10 11 1 7 2. + <_> + + <_> + 2 5 1 2 -1. + <_> + 2 5 1 1 2. + 1 + <_> + + <_> + 4 6 11 3 -1. + <_> + 4 7 11 1 3. + <_> + + <_> + 5 4 8 3 -1. + <_> + 5 5 8 1 3. + <_> + + <_> + 0 8 20 3 -1. + <_> + 0 9 20 1 3. + <_> + + <_> + 15 8 3 3 -1. + <_> + 15 9 3 1 3. + <_> + + <_> + 17 9 3 1 -1. + <_> + 18 9 1 1 3. + <_> + + <_> + 15 6 5 3 -1. + <_> + 15 7 5 1 3. + <_> + + <_> + 9 15 8 2 -1. + <_> + 9 15 4 1 2. + <_> + 13 16 4 1 2. + <_> + + <_> + 0 3 1 4 -1. + <_> + 0 4 1 2 2. + <_> + + <_> + 9 3 5 2 -1. + <_> + 9 4 5 1 2. + <_> + + <_> + 15 3 2 2 -1. + <_> + 15 3 1 1 2. + <_> + 16 4 1 1 2. + <_> + + <_> + 12 0 4 12 -1. + <_> + 12 0 2 12 2. + 1 + <_> + + <_> + 10 6 8 2 -1. + <_> + 10 7 8 1 2. + <_> + + <_> + 15 3 2 13 -1. + <_> + 16 3 1 13 2. + <_> + + <_> + 11 11 5 2 -1. + <_> + 11 11 5 1 2. + 1 + <_> + + <_> + 0 0 6 2 -1. + <_> + 3 0 3 2 2. + <_> + + <_> + 4 0 1 3 -1. + <_> + 3 1 1 1 3. + 1 + <_> + + <_> + 1 0 2 1 -1. + <_> + 2 0 1 1 2. + <_> + + <_> + 3 0 16 5 -1. + <_> + 7 0 8 5 2. + <_> + + <_> + 18 10 1 2 -1. + <_> + 18 10 1 1 2. + 1 + <_> + + <_> + 4 6 2 4 -1. + <_> + 4 7 2 2 2. + <_> + + <_> + 13 5 2 1 -1. + <_> + 13 5 1 1 2. + 1 + <_> + + <_> + 0 5 8 2 -1. + <_> + 0 5 4 1 2. + <_> + 4 6 4 1 2. + <_> + + <_> + 7 7 10 13 -1. + <_> + 12 7 5 13 2. + <_> + + <_> + 17 3 3 2 -1. + <_> + 18 4 1 2 3. + 1 + <_> + + <_> + 2 0 9 2 -1. + <_> + 2 1 9 1 2. + <_> + + <_> + 4 8 12 6 -1. + <_> + 4 10 12 2 3. + <_> + + <_> + 13 8 3 2 -1. + <_> + 14 9 1 2 3. + 1 + <_> + + <_> + 10 9 3 8 -1. + <_> + 11 9 1 8 3. + <_> + + <_> + 13 13 4 6 -1. + <_> + 14 13 2 6 2. + <_> + + <_> + 7 0 6 1 -1. + <_> + 9 0 2 1 3. + <_> + + <_> + 11 1 4 2 -1. + <_> + 11 2 4 1 2. + <_> + + <_> + 13 0 6 3 -1. + <_> + 13 1 6 1 3. + <_> + + <_> + 7 18 2 1 -1. + <_> + 8 18 1 1 2. + <_> + + <_> + 6 15 6 4 -1. + <_> + 6 16 6 2 2. + <_> + + <_> + 13 15 2 3 -1. + <_> + 12 16 2 1 3. + 1 + <_> + + <_> + 0 18 20 2 -1. + <_> + 0 18 10 1 2. + <_> + 10 19 10 1 2. + <_> + + <_> + 2 18 18 2 -1. + <_> + 2 18 9 1 2. + <_> + 11 19 9 1 2. + <_> + + <_> + 4 0 3 17 -1. + <_> + 5 0 1 17 3. + <_> + + <_> + 4 9 4 4 -1. + <_> + 4 9 2 2 2. + <_> + 6 11 2 2 2. + <_> + + <_> + 6 10 2 4 -1. + <_> + 5 11 2 2 2. + 1 + <_> + + <_> + 12 2 2 12 -1. + <_> + 12 2 1 12 2. + 1 + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 1 9 2 4 -1. + <_> + 1 9 1 2 2. + <_> + 2 11 1 2 2. + <_> + + <_> + 15 17 2 1 -1. + <_> + 16 17 1 1 2. + <_> + + <_> + 14 6 3 4 -1. + <_> + 15 7 1 4 3. + 1 + <_> + + <_> + 16 16 2 2 -1. + <_> + 16 16 1 1 2. + <_> + 17 17 1 1 2. + <_> + + <_> + 15 14 2 1 -1. + <_> + 16 14 1 1 2. + <_> + + <_> + 2 3 18 10 -1. + <_> + 2 3 9 5 2. + <_> + 11 8 9 5 2. + <_> + + <_> + 15 17 2 2 -1. + <_> + 15 17 1 1 2. + <_> + 16 18 1 1 2. + <_> + + <_> + 6 1 3 10 -1. + <_> + 7 1 1 10 3. + <_> + + <_> + 3 9 6 2 -1. + <_> + 5 9 2 2 3. + <_> + + <_> + 15 10 4 2 -1. + <_> + 15 10 2 1 2. + <_> + 17 11 2 1 2. + <_> + + <_> + 0 11 1 4 -1. + <_> + 0 13 1 2 2. + <_> + + <_> + 7 7 9 13 -1. + <_> + 10 7 3 13 3. + <_> + + <_> + 8 5 11 6 -1. + <_> + 8 7 11 2 3. + <_> + + <_> + 7 15 3 3 -1. + <_> + 8 15 1 3 3. + <_> + + <_> + 0 9 2 11 -1. + <_> + 1 9 1 11 2. + <_> + + <_> + 4 8 4 2 -1. + <_> + 5 8 2 2 2. + <_> + + <_> + 9 6 4 1 -1. + <_> + 10 7 2 1 2. + 1 + <_> + + <_> + 5 1 5 4 -1. + <_> + 5 2 5 2 2. + <_> + + <_> + 15 10 4 3 -1. + <_> + 16 10 2 3 2. + <_> + + <_> + 0 1 16 3 -1. + <_> + 0 2 16 1 3. + <_> + + <_> + 8 9 4 3 -1. + <_> + 9 10 2 3 2. + 1 + <_> + + <_> + 18 17 2 3 -1. + <_> + 18 18 2 1 3. + <_> + + <_> + 5 13 4 6 -1. + <_> + 5 13 2 3 2. + <_> + 7 16 2 3 2. + <_> + + <_> + 0 0 3 17 -1. + <_> + 1 0 1 17 3. + <_> + + <_> + 10 7 3 3 -1. + <_> + 9 8 3 1 3. + 1 + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 8 1 3 3. + 1 + <_> + + <_> + 7 5 5 6 -1. + <_> + 7 8 5 3 2. + <_> + + <_> + 12 4 2 9 -1. + <_> + 12 7 2 3 3. + <_> + + <_> + 14 0 3 2 -1. + <_> + 15 0 1 2 3. + <_> + + <_> + 11 8 3 3 -1. + <_> + 12 9 1 1 9. + <_> + + <_> + 4 16 2 3 -1. + <_> + 4 17 2 1 3. + <_> + + <_> + 6 10 14 3 -1. + <_> + 6 11 14 1 3. + <_> + + <_> + 0 10 14 4 -1. + <_> + 0 11 14 2 2. + <_> + + <_> + 12 7 3 4 -1. + <_> + 13 7 1 4 3. + <_> + + <_> + 3 2 3 3 -1. + <_> + 4 2 1 3 3. + <_> + + <_> + 17 17 2 2 -1. + <_> + 17 17 1 1 2. + <_> + 18 18 1 1 2. + <_> + + <_> + 18 16 2 2 -1. + <_> + 18 16 1 1 2. + <_> + 19 17 1 1 2. + <_> + + <_> + 17 16 1 3 -1. + <_> + 17 17 1 1 3. + <_> + + <_> + 6 8 2 1 -1. + <_> + 6 8 1 1 2. + 1 + <_> + + <_> + 8 7 3 1 -1. + <_> + 9 8 1 1 3. + 1 + <_> + + <_> + 9 6 3 1 -1. + <_> + 10 7 1 1 3. + 1 + <_> + + <_> + 3 9 3 10 -1. + <_> + 4 9 1 10 3. + <_> + + <_> + 5 15 6 3 -1. + <_> + 7 15 2 3 3. + <_> + + <_> + 0 4 2 12 -1. + <_> + 0 4 1 6 2. + <_> + 1 10 1 6 2. + <_> + + <_> + 4 2 2 10 -1. + <_> + 5 2 1 10 2. + <_> + + <_> + 4 9 2 1 -1. + <_> + 5 9 1 1 2. + <_> + + <_> + 14 7 4 6 -1. + <_> + 15 8 2 6 2. + 1 + <_> + + <_> + 17 5 3 2 -1. + <_> + 18 6 1 2 3. + 1 + <_> + + <_> + 2 10 16 5 -1. + <_> + 10 10 8 5 2. + <_> + + <_> + 7 17 2 2 -1. + <_> + 7 17 1 1 2. + <_> + 8 18 1 1 2. + <_> + + <_> + 4 17 4 1 -1. + <_> + 6 17 2 1 2. + <_> + + <_> + 8 6 3 3 -1. + <_> + 9 6 1 3 3. + <_> + + <_> + 16 10 1 4 -1. + <_> + 16 12 1 2 2. + <_> + + <_> + 17 13 2 3 -1. + <_> + 16 14 2 1 3. + 1 + <_> + + <_> + 3 8 13 10 -1. + <_> + 3 13 13 5 2. + <_> + + <_> + 9 6 9 1 -1. + <_> + 12 9 3 1 3. + 1 + <_> + + <_> + 2 5 15 6 -1. + <_> + 7 7 5 2 9. + <_> + + <_> + 16 0 3 2 -1. + <_> + 17 1 1 2 3. + 1 + <_> + + <_> + 0 17 6 3 -1. + <_> + 0 18 6 1 3. + <_> + + <_> + 11 1 2 2 -1. + <_> + 11 1 1 2 2. + 1 + <_> + + <_> + 12 5 2 2 -1. + <_> + 12 5 1 1 2. + <_> + 13 6 1 1 2. + <_> + + <_> + 8 0 12 2 -1. + <_> + 12 0 4 2 3. + <_> + + <_> + 10 9 3 3 -1. + <_> + 11 10 1 1 9. + <_> + + <_> + 12 18 8 2 -1. + <_> + 12 19 8 1 2. + <_> + + <_> + 8 18 9 2 -1. + <_> + 8 19 9 1 2. + <_> + + <_> + 6 0 9 4 -1. + <_> + 6 1 9 2 2. + <_> + + <_> + 3 8 12 4 -1. + <_> + 3 9 12 2 2. + <_> + + <_> + 13 4 2 9 -1. + <_> + 10 7 2 3 3. + 1 + <_> + + <_> + 5 15 12 4 -1. + <_> + 5 15 6 2 2. + <_> + 11 17 6 2 2. + <_> + + <_> + 6 3 14 10 -1. + <_> + 13 3 7 10 2. + <_> + + <_> + 9 2 6 2 -1. + <_> + 11 2 2 2 3. + <_> + + <_> + 11 16 3 1 -1. + <_> + 12 16 1 1 3. + <_> + + <_> + 15 16 2 4 -1. + <_> + 15 16 1 2 2. + <_> + 16 18 1 2 2. + <_> + + <_> + 3 11 14 4 -1. + <_> + 3 11 7 2 2. + <_> + 10 13 7 2 2. + <_> + + <_> + 1 19 16 1 -1. + <_> + 5 19 8 1 2. + <_> + + <_> + 3 18 2 1 -1. + <_> + 4 18 1 1 2. + <_> + + <_> + 12 7 1 8 -1. + <_> + 10 9 1 4 2. + 1 + <_> + + <_> + 18 3 2 16 -1. + <_> + 18 3 1 8 2. + <_> + 19 11 1 8 2. + <_> + + <_> + 0 9 20 3 -1. + <_> + 5 9 10 3 2. + <_> + + <_> + 7 15 2 3 -1. + <_> + 7 15 1 3 2. + 1 + <_> + + <_> + 7 1 2 2 -1. + <_> + 7 1 1 1 2. + <_> + 8 2 1 1 2. + <_> + + <_> + 5 5 12 11 -1. + <_> + 9 5 4 11 3. + <_> + + <_> + 14 0 4 14 -1. + <_> + 14 0 4 7 2. + 1 + <_> + + <_> + 15 1 2 8 -1. + <_> + 16 1 1 8 2. + <_> + + <_> + 0 1 3 4 -1. + <_> + 0 2 3 2 2. + <_> + + <_> + 5 9 9 9 -1. + <_> + 8 12 3 3 9. + <_> + + <_> + 12 7 4 6 -1. + <_> + 10 9 4 2 3. + 1 + <_> + + <_> + 5 5 8 9 -1. + <_> + 7 5 4 9 2. + <_> + + <_> + 2 3 16 2 -1. + <_> + 10 3 8 2 2. + <_> + + <_> + 7 1 4 3 -1. + <_> + 8 1 2 3 2. + <_> + + <_> + 8 1 12 3 -1. + <_> + 11 1 6 3 2. + <_> + + <_> + 18 1 1 2 -1. + <_> + 18 2 1 1 2. + <_> + + <_> + 6 9 8 2 -1. + <_> + 8 9 4 2 2. + <_> + + <_> + 5 7 2 4 -1. + <_> + 5 7 1 2 2. + <_> + 6 9 1 2 2. + <_> + + <_> + 2 15 9 1 -1. + <_> + 5 15 3 1 3. + <_> + + <_> + 3 10 6 9 -1. + <_> + 5 13 2 3 9. + <_> + + <_> + 0 9 7 3 -1. + <_> + 0 10 7 1 3. + <_> + + <_> + 0 9 16 1 -1. + <_> + 8 9 8 1 2. + <_> + + <_> + 6 1 12 3 -1. + <_> + 5 2 12 1 3. + 1 + <_> + + <_> + 9 9 9 1 -1. + <_> + 12 9 3 1 3. + <_> + + <_> + 12 10 4 10 -1. + <_> + 14 10 2 10 2. + <_> + + <_> + 5 10 4 8 -1. + <_> + 5 10 2 4 2. + <_> + 7 14 2 4 2. + <_> + + <_> + 0 0 16 10 -1. + <_> + 0 0 8 5 2. + <_> + 8 5 8 5 2. + <_> + + <_> + 5 15 2 4 -1. + <_> + 5 15 1 2 2. + <_> + 6 17 1 2 2. + <_> + + <_> + 14 2 6 16 -1. + <_> + 17 2 3 16 2. + <_> + + <_> + 7 5 6 1 -1. + <_> + 9 5 2 1 3. + <_> + + <_> + 18 12 2 2 -1. + <_> + 18 12 1 2 2. + 1 + <_> + + <_> + 16 0 3 18 -1. + <_> + 17 6 1 6 9. + <_> + + <_> + 0 2 20 3 -1. + <_> + 10 2 10 3 2. + <_> + + <_> + 1 19 2 1 -1. + <_> + 2 19 1 1 2. + <_> + + <_> + 8 0 6 3 -1. + <_> + 11 0 3 3 2. + <_> + + <_> + 7 0 8 3 -1. + <_> + 11 0 4 3 2. + <_> + + <_> + 18 9 1 6 -1. + <_> + 18 9 1 3 2. + 1 + <_> + + <_> + 3 9 6 3 -1. + <_> + 5 10 2 1 9. + <_> + + <_> + 15 9 2 6 -1. + <_> + 15 9 1 3 2. + <_> + 16 12 1 3 2. + <_> + + <_> + 12 6 4 1 -1. + <_> + 13 7 2 1 2. + 1 + <_> + + <_> + 1 6 18 14 -1. + <_> + 7 6 6 14 3. + <_> + + <_> + 15 10 4 2 -1. + <_> + 15 10 2 1 2. + <_> + 17 11 2 1 2. + <_> + + <_> + 14 8 6 7 -1. + <_> + 16 8 2 7 3. + <_> + + <_> + 0 10 2 10 -1. + <_> + 1 10 1 10 2. + <_> + + <_> + 18 0 2 12 -1. + <_> + 19 0 1 12 2. + <_> + + <_> + 4 7 10 1 -1. + <_> + 4 7 5 1 2. + 1 + <_> + + <_> + 12 1 6 2 -1. + <_> + 12 2 6 1 2. + <_> + + <_> + 8 8 3 2 -1. + <_> + 8 8 3 1 2. + 1 + <_> + + <_> + 14 10 4 3 -1. + <_> + 13 11 4 1 3. + 1 + <_> + + <_> + 10 7 5 6 -1. + <_> + 10 10 5 3 2. + <_> + + <_> + 11 5 5 8 -1. + <_> + 9 7 5 4 2. + 1 + <_> + + <_> + 16 2 2 3 -1. + <_> + 16 2 1 3 2. + 1 + <_> + + <_> + 4 2 13 9 -1. + <_> + 4 5 13 3 3. + <_> + + <_> + 9 2 6 2 -1. + <_> + 11 2 2 2 3. + <_> + + <_> + 0 0 9 2 -1. + <_> + 0 1 9 1 2. + <_> + + <_> + 11 2 3 12 -1. + <_> + 12 2 1 12 3. + <_> + + <_> + 19 17 1 3 -1. + <_> + 19 18 1 1 3. + <_> + + <_> + 19 18 1 2 -1. + <_> + 19 19 1 1 2. + <_> + + <_> + 13 4 2 4 -1. + <_> + 13 4 1 2 2. + <_> + 14 6 1 2 2. + <_> + + <_> + 14 7 1 4 -1. + <_> + 13 8 1 2 2. + 1 + <_> + + <_> + 1 10 3 1 -1. + <_> + 2 10 1 1 3. + <_> + + <_> + 18 9 1 4 -1. + <_> + 17 10 1 2 2. + 1 + <_> + + <_> + 8 9 6 4 -1. + <_> + 8 9 3 2 2. + <_> + 11 11 3 2 2. + <_> + + <_> + 0 9 15 3 -1. + <_> + 0 10 15 1 3. + <_> + + <_> + 16 6 4 3 -1. + <_> + 15 7 4 1 3. + 1 + <_> + + <_> + 11 8 9 4 -1. + <_> + 11 9 9 2 2. + <_> + + <_> + 16 5 1 6 -1. + <_> + 16 5 1 3 2. + 1 + <_> + + <_> + 7 17 4 3 -1. + <_> + 8 17 2 3 2. + <_> + + <_> + 4 5 1 4 -1. + <_> + 3 6 1 2 2. + 1 + <_> + + <_> + 17 16 3 4 -1. + <_> + 17 17 3 2 2. + <_> + + <_> + 14 17 4 3 -1. + <_> + 14 18 4 1 3. + <_> + + <_> + 6 3 8 3 -1. + <_> + 6 4 8 1 3. + <_> + + <_> + 9 4 1 8 -1. + <_> + 9 6 1 4 2. + <_> + + <_> + 14 0 6 1 -1. + <_> + 17 0 3 1 2. + <_> + + <_> + 15 3 2 1 -1. + <_> + 15 3 1 1 2. + 1 + <_> + + <_> + 16 1 3 4 -1. + <_> + 17 1 1 4 3. + <_> + + <_> + 16 5 2 4 -1. + <_> + 17 5 1 4 2. + <_> + + <_> + 12 7 2 3 -1. + <_> + 12 8 2 1 3. + <_> + + <_> + 17 3 3 7 -1. + <_> + 18 3 1 7 3. + <_> + + <_> + 15 7 5 2 -1. + <_> + 15 8 5 1 2. + <_> + + <_> + 16 7 3 1 -1. + <_> + 17 8 1 1 3. + 1 + <_> + + <_> + 0 10 3 6 -1. + <_> + 1 10 1 6 3. + <_> + + <_> + 8 4 8 13 -1. + <_> + 10 4 4 13 2. + <_> + + <_> + 5 10 2 2 -1. + <_> + 6 10 1 2 2. + <_> + + <_> + 5 10 6 3 -1. + <_> + 7 11 2 1 9. + <_> + + <_> + 5 9 3 2 -1. + <_> + 6 9 1 2 3. + <_> + + <_> + 6 7 9 3 -1. + <_> + 9 8 3 1 9. + <_> + + <_> + 0 6 4 6 -1. + <_> + 1 6 2 6 2. + <_> + + <_> + 10 17 1 3 -1. + <_> + 10 18 1 1 3. + <_> + + <_> + 8 16 4 2 -1. + <_> + 8 17 4 1 2. + <_> + + <_> + 1 18 10 2 -1. + <_> + 1 18 5 1 2. + <_> + 6 19 5 1 2. + <_> + + <_> + 5 0 4 2 -1. + <_> + 6 0 2 2 2. + <_> + + <_> + 8 5 6 3 -1. + <_> + 10 7 2 3 3. + 1 + <_> + + <_> + 6 5 7 9 -1. + <_> + 6 8 7 3 3. + <_> + + <_> + 16 12 2 4 -1. + <_> + 16 14 2 2 2. + <_> + + <_> + 9 7 10 6 -1. + <_> + 9 7 5 3 2. + <_> + 14 10 5 3 2. + <_> + + <_> + 9 5 8 4 -1. + <_> + 8 6 8 2 2. + 1 + <_> + + <_> + 3 14 6 6 -1. + <_> + 3 16 6 2 3. + <_> + + <_> + 5 14 6 6 -1. + <_> + 5 14 3 3 2. + <_> + 8 17 3 3 2. + <_> + + <_> + 2 7 4 6 -1. + <_> + 3 7 2 6 2. + <_> + + <_> + 2 0 3 20 -1. + <_> + 3 0 1 20 3. + <_> + + <_> + 4 7 10 3 -1. + <_> + 4 7 5 3 2. + 1 + <_> + + <_> + 1 10 4 6 -1. + <_> + 1 10 2 3 2. + <_> + 3 13 2 3 2. + <_> + + <_> + 4 9 2 10 -1. + <_> + 4 14 2 5 2. + <_> + + <_> + 4 7 2 2 -1. + <_> + 4 7 1 1 2. + <_> + 5 8 1 1 2. + <_> + + <_> + 0 18 6 2 -1. + <_> + 0 19 6 1 2. + <_> + + <_> + 19 0 1 10 -1. + <_> + 19 0 1 5 2. + 1 + <_> + + <_> + 9 2 2 12 -1. + <_> + 9 5 2 6 2. + <_> + + <_> + 4 14 2 4 -1. + <_> + 3 15 2 2 2. + 1 + <_> + + <_> + 8 17 4 1 -1. + <_> + 9 17 2 1 2. + <_> + + <_> + 1 9 10 4 -1. + <_> + 1 9 5 2 2. + <_> + 6 11 5 2 2. + <_> + + <_> + 5 4 3 1 -1. + <_> + 6 4 1 1 3. + <_> + + <_> + 14 7 2 2 -1. + <_> + 14 7 1 1 2. + <_> + 15 8 1 1 2. + <_> + + <_> + 13 7 3 3 -1. + <_> + 14 8 1 1 9. + <_> + + <_> + 6 2 6 1 -1. + <_> + 9 2 3 1 2. + <_> + + <_> + 8 0 12 7 -1. + <_> + 12 0 4 7 3. + <_> + + <_> + 16 0 4 4 -1. + <_> + 16 0 2 4 2. + 1 + <_> + + <_> + 2 0 16 7 -1. + <_> + 10 0 8 7 2. + <_> + + <_> + 7 1 8 2 -1. + <_> + 9 1 4 2 2. + <_> + + <_> + 4 6 12 1 -1. + <_> + 7 9 6 1 2. + 1 + <_> + + <_> + 3 17 6 3 -1. + <_> + 5 17 2 3 3. + <_> + + <_> + 0 19 12 1 -1. + <_> + 4 19 4 1 3. + <_> + + <_> + 12 14 8 1 -1. + <_> + 14 14 4 1 2. + <_> + + <_> + 4 10 12 6 -1. + <_> + 8 12 4 2 9. + <_> + + <_> + 12 4 8 6 -1. + <_> + 14 4 4 6 2. + <_> + + <_> + 9 2 2 8 -1. + <_> + 9 2 1 8 2. + 1 + <_> + + <_> + 1 18 19 2 -1. + <_> + 1 19 19 1 2. + <_> + + <_> + 9 18 3 2 -1. + <_> + 10 18 1 2 3. + <_> + + <_> + 10 3 8 3 -1. + <_> + 10 3 4 3 2. + 1 + <_> + + <_> + 4 0 9 1 -1. + <_> + 7 0 3 1 3. + <_> + + <_> + 9 2 8 1 -1. + <_> + 13 2 4 1 2. + <_> + + <_> + 7 1 10 2 -1. + <_> + 7 2 10 1 2. + <_> + + <_> + 0 11 3 3 -1. + <_> + 1 12 1 1 9. + <_> + + <_> + 0 10 12 9 -1. + <_> + 4 10 4 9 3. + <_> + + <_> + 4 0 6 3 -1. + <_> + 6 0 2 3 3. + <_> + + <_> + 17 2 3 2 -1. + <_> + 18 2 1 2 3. + <_> + + <_> + 14 10 4 4 -1. + <_> + 14 10 2 4 2. + 1 + <_> + + <_> + 7 10 2 3 -1. + <_> + 6 11 2 1 3. + 1 + <_> + + <_> + 4 5 1 2 -1. + <_> + 4 5 1 1 2. + 1 + <_> + + <_> + 0 0 4 1 -1. + <_> + 2 0 2 1 2. + <_> + + <_> + 1 18 3 2 -1. + <_> + 1 19 3 1 2. + <_> + + <_> + 0 0 4 6 -1. + <_> + 0 2 4 2 3. + <_> + + <_> + 0 10 12 10 -1. + <_> + 0 10 6 5 2. + <_> + 6 15 6 5 2. + <_> + + <_> + 7 15 6 2 -1. + <_> + 7 16 6 1 2. + <_> + + <_> + 14 8 6 3 -1. + <_> + 13 9 6 1 3. + 1 + <_> + + <_> + 6 0 1 2 -1. + <_> + 6 0 1 1 2. + 1 + <_> + + <_> + 17 1 2 2 -1. + <_> + 17 1 1 2 2. + 1 + <_> + + <_> + 15 10 1 2 -1. + <_> + 15 11 1 1 2. + <_> + + <_> + 16 9 3 6 -1. + <_> + 17 10 1 6 3. + 1 + <_> + + <_> + 2 8 16 9 -1. + <_> + 6 8 8 9 2. + <_> + + <_> + 12 1 6 3 -1. + <_> + 14 1 2 3 3. + <_> + + <_> + 9 6 9 4 -1. + <_> + 9 6 9 2 2. + 1 + <_> + + <_> + 3 17 2 2 -1. + <_> + 4 17 1 2 2. + <_> + + <_> + 0 7 2 4 -1. + <_> + 0 8 2 2 2. + <_> + + <_> + 5 10 12 1 -1. + <_> + 9 10 4 1 3. + <_> + + <_> + 15 9 4 4 -1. + <_> + 15 9 2 2 2. + <_> + 17 11 2 2 2. + <_> + + <_> + 4 10 4 1 -1. + <_> + 5 10 2 1 2. + <_> + + <_> + 13 9 3 2 -1. + <_> + 14 9 1 2 3. + <_> + + <_> + 2 12 13 8 -1. + <_> + 2 16 13 4 2. + <_> + + <_> + 16 17 1 3 -1. + <_> + 16 18 1 1 3. + <_> + + <_> + 9 5 3 6 -1. + <_> + 10 7 1 2 9. + <_> + + <_> + 1 9 12 4 -1. + <_> + 1 10 12 2 2. + <_> + + <_> + 12 2 6 17 -1. + <_> + 14 2 2 17 3. + <_> + + <_> + 8 18 8 2 -1. + <_> + 10 18 4 2 2. + <_> + + <_> + 0 18 4 2 -1. + <_> + 2 18 2 2 2. + <_> + + <_> + 10 15 10 4 -1. + <_> + 10 15 5 2 2. + <_> + 15 17 5 2 2. + <_> + + <_> + 15 1 3 14 -1. + <_> + 16 1 1 14 3. + <_> + + <_> + 3 8 6 12 -1. + <_> + 3 14 6 6 2. + <_> + + <_> + 4 8 1 2 -1. + <_> + 4 9 1 1 2. + <_> + + <_> + 3 8 12 6 -1. + <_> + 7 10 4 2 9. + <_> + + <_> + 18 3 2 7 -1. + <_> + 19 3 1 7 2. + <_> + + <_> + 16 5 4 6 -1. + <_> + 14 7 4 2 3. + 1 + <_> + + <_> + 14 9 2 4 -1. + <_> + 13 10 2 2 2. + 1 + <_> + + <_> + 0 1 20 2 -1. + <_> + 10 1 10 2 2. + <_> + + <_> + 0 0 6 5 -1. + <_> + 3 0 3 5 2. + <_> + + <_> + 18 0 2 1 -1. + <_> + 19 0 1 1 2. + <_> + + <_> + 13 9 1 3 -1. + <_> + 12 10 1 1 3. + 1 + <_> + + <_> + 8 12 6 2 -1. + <_> + 10 12 2 2 3. + <_> + + <_> + 2 1 6 6 -1. + <_> + 4 1 2 6 3. + <_> + + <_> + 4 1 6 12 -1. + <_> + 4 4 6 6 2. + <_> + + <_> + 3 3 2 3 -1. + <_> + 2 4 2 1 3. + 1 + <_> + + <_> + 7 9 2 3 -1. + <_> + 6 10 2 1 3. + 1 + <_> + + <_> + 2 4 14 5 -1. + <_> + 9 4 7 5 2. + <_> + + <_> + 10 0 9 4 -1. + <_> + 13 3 3 4 3. + 1 + <_> + + <_> + 0 15 3 3 -1. + <_> + 0 16 3 1 3. + <_> + + <_> + 5 17 2 3 -1. + <_> + 5 18 2 1 3. + <_> + + <_> + 7 12 2 8 -1. + <_> + 7 14 2 4 2. + <_> + + <_> + 3 18 5 2 -1. + <_> + 3 19 5 1 2. + <_> + + <_> + 18 10 1 2 -1. + <_> + 18 10 1 1 2. + 1 + <_> + + <_> + 0 0 1 18 -1. + <_> + 0 9 1 9 2. + <_> + + <_> + 8 1 4 2 -1. + <_> + 8 2 4 1 2. + <_> + + <_> + 10 8 5 4 -1. + <_> + 10 8 5 2 2. + 1 + <_> + + <_> + 5 11 6 1 -1. + <_> + 7 11 2 1 3. + <_> + + <_> + 14 8 4 12 -1. + <_> + 14 12 4 4 3. + <_> + + <_> + 1 6 2 4 -1. + <_> + 1 8 2 2 2. + <_> + + <_> + 13 14 6 3 -1. + <_> + 15 15 2 1 9. + <_> + + <_> + 10 12 4 8 -1. + <_> + 10 16 4 4 2. + <_> + + <_> + 5 11 2 2 -1. + <_> + 6 11 1 2 2. + <_> + + <_> + 7 14 8 2 -1. + <_> + 7 15 8 1 2. + <_> + + <_> + 17 6 2 2 -1. + <_> + 17 6 1 2 2. + 1 + <_> + + <_> + 5 1 3 2 -1. + <_> + 5 1 3 1 2. + 1 + <_> + + <_> + 0 16 2 3 -1. + <_> + 0 17 2 1 3. + <_> + + <_> + 7 0 5 3 -1. + <_> + 7 1 5 1 3. + <_> + + <_> + 0 0 16 2 -1. + <_> + 0 1 16 1 2. + <_> + + <_> + 5 8 4 2 -1. + <_> + 5 8 2 1 2. + <_> + 7 9 2 1 2. + <_> + + <_> + 14 5 6 2 -1. + <_> + 14 5 3 1 2. + <_> + 17 6 3 1 2. + <_> + + <_> + 2 1 2 4 -1. + <_> + 3 1 1 4 2. + <_> + + <_> + 2 7 1 2 -1. + <_> + 2 8 1 1 2. + <_> + + <_> + 0 0 2 4 -1. + <_> + 0 0 1 2 2. + <_> + 1 2 1 2 2. + <_> + + <_> + 8 0 8 10 -1. + <_> + 8 0 4 5 2. + <_> + 12 5 4 5 2. + <_> + + <_> + 3 3 2 8 -1. + <_> + 3 5 2 4 2. + <_> + + <_> + 7 9 9 2 -1. + <_> + 10 9 3 2 3. + <_> + + <_> + 6 3 2 3 -1. + <_> + 6 3 1 3 2. + 1 + <_> + + <_> + 11 13 2 2 -1. + <_> + 11 14 2 1 2. + <_> + + <_> + 16 2 4 5 -1. + <_> + 17 2 2 5 2. + <_> + + <_> + 7 10 12 6 -1. + <_> + 11 12 4 2 9. + <_> + + <_> + 14 6 2 7 -1. + <_> + 15 6 1 7 2. + <_> + + <_> + 18 16 1 3 -1. + <_> + 18 17 1 1 3. + <_> + + <_> + 18 9 2 2 -1. + <_> + 18 9 1 1 2. + <_> + 19 10 1 1 2. + <_> + + <_> + 16 7 4 4 -1. + <_> + 16 7 2 2 2. + <_> + 18 9 2 2 2. + <_> + + <_> + 14 10 6 6 -1. + <_> + 14 10 3 3 2. + <_> + 17 13 3 3 2. + <_> + + <_> + 8 16 2 4 -1. + <_> + 8 17 2 2 2. + <_> + + <_> + 18 11 2 8 -1. + <_> + 18 11 1 4 2. + <_> + 19 15 1 4 2. + <_> + + <_> + 7 4 6 12 -1. + <_> + 7 8 6 4 3. + <_> + + <_> + 0 7 20 9 -1. + <_> + 5 7 10 9 2. + <_> + + <_> + 12 7 3 4 -1. + <_> + 13 7 1 4 3. + <_> + + <_> + 6 3 3 4 -1. + <_> + 5 4 3 2 2. + 1 + <_> + + <_> + 14 3 3 12 -1. + <_> + 14 3 3 6 2. + 1 + <_> + + <_> + 11 5 8 6 -1. + <_> + 11 7 8 2 3. + <_> + + <_> + 17 7 3 5 -1. + <_> + 18 8 1 5 3. + 1 + <_> + + <_> + 3 11 6 6 -1. + <_> + 5 13 2 2 9. + <_> + + <_> + 15 6 4 5 -1. + <_> + 15 6 2 5 2. + 1 + <_> + + <_> + 8 9 3 3 -1. + <_> + 7 10 3 1 3. + 1 + <_> + + <_> + 6 7 9 2 -1. + <_> + 9 10 3 2 3. + 1 + <_> + + <_> + 7 8 2 12 -1. + <_> + 7 8 1 6 2. + <_> + 8 14 1 6 2. + <_> + + <_> + 5 17 3 2 -1. + <_> + 6 17 1 2 3. + <_> + + <_> + 4 5 3 4 -1. + <_> + 5 6 1 4 3. + 1 + <_> + + <_> + 11 1 6 10 -1. + <_> + 11 1 6 5 2. + 1 + <_> + + <_> + 2 6 6 1 -1. + <_> + 2 6 3 1 2. + 1 + <_> + + <_> + 16 6 1 6 -1. + <_> + 14 8 1 2 3. + 1 + <_> + + <_> + 14 6 1 3 -1. + <_> + 13 7 1 1 3. + 1 + <_> + + <_> + 0 6 18 3 -1. + <_> + 6 7 6 1 9. + <_> + + <_> + 14 7 6 3 -1. + <_> + 14 7 3 3 2. + 1 + <_> + + <_> + 7 12 4 3 -1. + <_> + 7 12 2 3 2. + 1 + <_> + + <_> + 18 8 2 8 -1. + <_> + 18 8 1 4 2. + <_> + 19 12 1 4 2. + <_> + + <_> + 15 1 4 2 -1. + <_> + 16 2 2 2 2. + 1 + <_> + + <_> + 14 0 2 10 -1. + <_> + 14 0 1 5 2. + <_> + 15 5 1 5 2. + <_> + + <_> + 10 1 2 6 -1. + <_> + 10 1 1 3 2. + <_> + 11 4 1 3 2. + <_> + + <_> + 16 2 2 3 -1. + <_> + 17 2 1 3 2. + <_> + + <_> + 12 2 4 1 -1. + <_> + 14 2 2 1 2. + <_> + + <_> + 0 1 4 2 -1. + <_> + 0 2 4 1 2. + <_> + + <_> + 12 11 3 4 -1. + <_> + 13 12 1 4 3. + 1 + <_> + + <_> + 8 12 8 7 -1. + <_> + 10 12 4 7 2. + <_> + + <_> + 2 5 6 8 -1. + <_> + 4 5 2 8 3. + <_> + + <_> + 18 17 2 2 -1. + <_> + 18 17 1 1 2. + <_> + 19 18 1 1 2. + <_> + + <_> + 5 14 1 2 -1. + <_> + 5 15 1 1 2. + <_> + + <_> + 1 10 6 1 -1. + <_> + 3 10 2 1 3. + <_> + + <_> + 6 6 6 12 -1. + <_> + 9 6 3 12 2. + <_> + + <_> + 18 2 2 12 -1. + <_> + 18 2 1 6 2. + <_> + 19 8 1 6 2. + <_> + + <_> + 2 16 9 3 -1. + <_> + 2 17 9 1 3. + <_> + + <_> + 10 9 10 9 -1. + <_> + 10 12 10 3 3. + <_> + + <_> + 13 14 3 4 -1. + <_> + 13 15 3 2 2. + <_> + + <_> + 8 9 1 3 -1. + <_> + 8 10 1 1 3. + <_> + + <_> + 2 16 5 3 -1. + <_> + 2 17 5 1 3. + <_> + + <_> + 11 19 6 1 -1. + <_> + 13 19 2 1 3. + <_> + + <_> + 9 1 6 15 -1. + <_> + 11 6 2 5 9. + <_> + + <_> + 15 10 2 8 -1. + <_> + 15 10 1 4 2. + <_> + 16 14 1 4 2. + <_> + + <_> + 0 7 6 12 -1. + <_> + 2 11 2 4 9. + <_> + + <_> + 11 2 9 4 -1. + <_> + 11 2 9 2 2. + 1 + <_> + + <_> + 5 9 2 3 -1. + <_> + 5 9 1 3 2. + 1 + <_> + + <_> + 14 8 3 4 -1. + <_> + 15 8 1 4 3. + <_> + + <_> + 2 13 18 4 -1. + <_> + 11 13 9 4 2. + <_> + + <_> + 0 0 20 14 -1. + <_> + 10 0 10 14 2. + <_> + + <_> + 0 9 6 11 -1. + <_> + 2 9 2 11 3. + <_> + + <_> + 2 0 3 17 -1. + <_> + 3 0 1 17 3. + <_> + + <_> + 1 0 18 7 -1. + <_> + 7 0 6 7 3. + <_> + + <_> + 7 3 4 6 -1. + <_> + 9 3 2 6 2. + <_> + + <_> + 6 0 14 20 -1. + <_> + 6 0 7 10 2. + <_> + 13 10 7 10 2. + <_> + + <_> + 18 6 2 2 -1. + <_> + 18 6 1 1 2. + <_> + 19 7 1 1 2. + <_> + + <_> + 13 9 4 3 -1. + <_> + 14 10 2 3 2. + 1 + <_> + + <_> + 10 11 2 6 -1. + <_> + 8 13 2 2 3. + 1 + <_> + + <_> + 18 15 2 1 -1. + <_> + 18 15 1 1 2. + 1 + <_> + + <_> + 8 16 4 2 -1. + <_> + 9 16 2 2 2. + <_> + + <_> + 6 17 4 1 -1. + <_> + 7 17 2 1 2. + <_> + + <_> + 7 0 12 5 -1. + <_> + 10 0 6 5 2. + <_> + + <_> + 6 4 9 3 -1. + <_> + 6 5 9 1 3. + <_> + + <_> + 15 0 4 2 -1. + <_> + 15 1 4 1 2. + <_> + + <_> + 6 0 9 20 -1. + <_> + 6 5 9 10 2. + <_> + + <_> + 0 7 11 12 -1. + <_> + 0 13 11 6 2. + <_> + + <_> + 1 8 10 1 -1. + <_> + 1 8 5 1 2. + 1 + <_> + + <_> + 12 1 2 10 -1. + <_> + 12 6 2 5 2. + <_> + + <_> + 18 5 1 6 -1. + <_> + 18 8 1 3 2. + <_> + + <_> + 5 10 12 1 -1. + <_> + 9 10 4 1 3. + <_> + + <_> + 11 12 9 4 -1. + <_> + 14 12 3 4 3. + <_> + + <_> + 12 8 7 4 -1. + <_> + 11 9 7 2 2. + 1 + <_> + + <_> + 4 9 2 6 -1. + <_> + 4 9 1 3 2. + <_> + 5 12 1 3 2. + <_> + + <_> + 15 8 2 8 -1. + <_> + 15 8 1 4 2. + <_> + 16 12 1 4 2. + <_> + + <_> + 1 16 9 2 -1. + <_> + 1 17 9 1 2. + <_> + + <_> + 5 2 14 12 -1. + <_> + 5 5 14 6 2. + <_> + + <_> + 2 10 2 10 -1. + <_> + 2 15 2 5 2. + <_> + + <_> + 1 0 12 5 -1. + <_> + 5 0 4 5 3. + <_> + + <_> + 16 17 1 2 -1. + <_> + 16 17 1 1 2. + 1 + <_> + + <_> + 12 1 8 2 -1. + <_> + 12 1 4 1 2. + <_> + 16 2 4 1 2. + <_> + + <_> + 3 5 8 6 -1. + <_> + 5 5 4 6 2. + <_> + + <_> + 5 1 4 4 -1. + <_> + 4 2 4 2 2. + 1 + <_> + + <_> + 6 3 1 14 -1. + <_> + 6 10 1 7 2. + <_> + + <_> + 15 10 2 10 -1. + <_> + 15 10 1 5 2. + <_> + 16 15 1 5 2. + <_> + + <_> + 10 2 9 4 -1. + <_> + 13 2 3 4 3. + <_> + + <_> + 15 6 1 9 -1. + <_> + 15 9 1 3 3. + <_> + + <_> + 3 2 6 2 -1. + <_> + 5 2 2 2 3. + <_> + + <_> + 15 5 4 2 -1. + <_> + 15 5 2 1 2. + <_> + 17 6 2 1 2. + <_> + + <_> + 8 2 6 4 -1. + <_> + 8 3 6 2 2. + <_> + + <_> + 17 18 1 2 -1. + <_> + 17 19 1 1 2. + <_> + + <_> + 1 13 6 3 -1. + <_> + 3 14 2 1 9. + <_> + + <_> + 2 16 14 2 -1. + <_> + 2 16 7 1 2. + <_> + 9 17 7 1 2. + <_> + + <_> + 4 0 2 3 -1. + <_> + 5 0 1 3 2. + <_> + + <_> + 8 6 3 1 -1. + <_> + 9 7 1 1 3. + 1 + <_> + + <_> + 11 6 2 3 -1. + <_> + 10 7 2 1 3. + 1 + <_> + + <_> + 4 11 10 2 -1. + <_> + 4 12 10 1 2. + <_> + + <_> + 0 8 15 6 -1. + <_> + 0 10 15 2 3. + <_> + + <_> + 3 18 8 1 -1. + <_> + 5 18 4 1 2. + <_> + + <_> + 14 2 3 2 -1. + <_> + 15 3 1 2 3. + 1 + <_> + + <_> + 17 1 3 4 -1. + <_> + 18 1 1 4 3. + <_> + + <_> + 8 17 4 2 -1. + <_> + 10 17 2 2 2. + <_> + + <_> + 12 8 2 3 -1. + <_> + 11 9 2 1 3. + 1 + <_> + + <_> + 5 7 4 2 -1. + <_> + 5 7 2 1 2. + <_> + 7 8 2 1 2. + <_> + + <_> + 3 12 6 5 -1. + <_> + 6 12 3 5 2. + <_> + + <_> + 7 7 10 6 -1. + <_> + 7 9 10 2 3. + <_> + + <_> + 4 3 9 16 -1. + <_> + 7 3 3 16 3. + <_> + + <_> + 5 10 6 8 -1. + <_> + 5 12 6 4 2. + <_> + + <_> + 17 7 2 3 -1. + <_> + 17 7 1 3 2. + 1 + <_> + + <_> + 16 0 1 12 -1. + <_> + 16 6 1 6 2. + <_> + + <_> + 13 4 5 2 -1. + <_> + 13 5 5 1 2. + <_> + + <_> + 17 4 3 3 -1. + <_> + 17 5 3 1 3. + <_> + + <_> + 10 1 9 6 -1. + <_> + 13 1 3 6 3. + <_> + + <_> + 7 7 13 4 -1. + <_> + 7 8 13 2 2. + <_> + + <_> + 13 11 6 2 -1. + <_> + 13 11 3 1 2. + <_> + 16 12 3 1 2. + <_> + + <_> + 10 2 5 3 -1. + <_> + 10 3 5 1 3. + <_> + + <_> + 1 8 4 2 -1. + <_> + 1 8 2 1 2. + <_> + 3 9 2 1 2. + <_> + + <_> + 19 8 1 4 -1. + <_> + 19 9 1 2 2. + <_> + + <_> + 4 9 3 2 -1. + <_> + 5 10 1 2 3. + 1 + <_> + + <_> + 4 4 15 9 -1. + <_> + 9 7 5 3 9. + <_> + + <_> + 8 0 9 11 -1. + <_> + 11 0 3 11 3. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 16 16 1 3 -1. + <_> + 16 17 1 1 3. + <_> + + <_> + 14 16 3 3 -1. + <_> + 14 17 3 1 3. + <_> + + <_> + 12 12 4 6 -1. + <_> + 13 12 2 6 2. + <_> + + <_> + 10 10 1 6 -1. + <_> + 8 12 1 2 3. + 1 + <_> + + <_> + 8 19 12 1 -1. + <_> + 11 19 6 1 2. + <_> + + <_> + 14 16 2 2 -1. + <_> + 14 16 1 1 2. + <_> + 15 17 1 1 2. + <_> + + <_> + 4 8 1 4 -1. + <_> + 3 9 1 2 2. + 1 + <_> + + <_> + 6 9 4 2 -1. + <_> + 6 9 2 1 2. + <_> + 8 10 2 1 2. + <_> + + <_> + 2 2 6 1 -1. + <_> + 2 2 3 1 2. + 1 + <_> + + <_> + 12 8 3 1 -1. + <_> + 13 8 1 1 3. + <_> + + <_> + 13 3 2 6 -1. + <_> + 13 3 1 3 2. + <_> + 14 6 1 3 2. + <_> + + <_> + 7 9 3 5 -1. + <_> + 8 9 1 5 3. + <_> + + <_> + 6 1 2 17 -1. + <_> + 7 1 1 17 2. + <_> + + <_> + 15 1 4 11 -1. + <_> + 17 1 2 11 2. + <_> + + <_> + 12 9 2 1 -1. + <_> + 13 9 1 1 2. + <_> + + <_> + 14 6 3 3 -1. + <_> + 15 6 1 3 3. + <_> + + <_> + 1 6 2 4 -1. + <_> + 1 6 1 2 2. + <_> + 2 8 1 2 2. + <_> + + <_> + 3 7 2 12 -1. + <_> + 3 7 1 6 2. + <_> + 4 13 1 6 2. + <_> + + <_> + 2 18 2 2 -1. + <_> + 2 18 1 1 2. + <_> + 3 19 1 1 2. + <_> + + <_> + 8 9 4 7 -1. + <_> + 8 9 2 7 2. + 1 + <_> + + <_> + 19 5 1 4 -1. + <_> + 19 7 1 2 2. + <_> + + <_> + 5 18 3 2 -1. + <_> + 5 19 3 1 2. + <_> + + <_> + 8 14 8 5 -1. + <_> + 10 14 4 5 2. + <_> + + <_> + 0 16 8 3 -1. + <_> + 4 16 4 3 2. + <_> + + <_> + 2 4 1 4 -1. + <_> + 2 5 1 2 2. + <_> + + <_> + 0 17 1 3 -1. + <_> + 0 18 1 1 3. + <_> + + <_> + 7 17 8 3 -1. + <_> + 9 17 4 3 2. + <_> + + <_> + 7 19 8 1 -1. + <_> + 9 19 4 1 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 0 0 3 3 2. + <_> + 3 3 3 3 2. + <_> + + <_> + 9 5 2 2 -1. + <_> + 9 5 1 1 2. + <_> + 10 6 1 1 2. + <_> + + <_> + 8 17 1 3 -1. + <_> + 8 18 1 1 3. + <_> + + <_> + 8 18 12 2 -1. + <_> + 8 18 6 1 2. + <_> + 14 19 6 1 2. + <_> + + <_> + 9 8 4 1 -1. + <_> + 10 9 2 1 2. + 1 + <_> + + <_> + 8 18 3 2 -1. + <_> + 8 19 3 1 2. + <_> + + <_> + 0 2 2 18 -1. + <_> + 1 2 1 18 2. + <_> + + <_> + 0 19 12 1 -1. + <_> + 3 19 6 1 2. + <_> + + <_> + 3 12 6 1 -1. + <_> + 3 12 3 1 2. + 1 + <_> + + <_> + 6 11 14 5 -1. + <_> + 13 11 7 5 2. + <_> + + <_> + 13 4 6 10 -1. + <_> + 15 4 2 10 3. + <_> + + <_> + 0 0 6 1 -1. + <_> + 3 0 3 1 2. + <_> + + <_> + 15 7 1 12 -1. + <_> + 15 10 1 6 2. + <_> + + <_> + 14 9 4 2 -1. + <_> + 15 9 2 2 2. + <_> + + <_> + 6 9 9 11 -1. + <_> + 9 9 3 11 3. + <_> + + <_> + 12 10 2 2 -1. + <_> + 12 10 1 1 2. + <_> + 13 11 1 1 2. + <_> + + <_> + 2 3 6 13 -1. + <_> + 5 3 3 13 2. + <_> + + <_> + 16 7 4 3 -1. + <_> + 16 8 4 1 3. + <_> + + <_> + 6 7 2 6 -1. + <_> + 7 7 1 6 2. + <_> + + <_> + 17 0 3 1 -1. + <_> + 18 1 1 1 3. + 1 + <_> + + <_> + 18 16 2 2 -1. + <_> + 18 16 1 1 2. + <_> + 19 17 1 1 2. + <_> + + <_> + 12 2 8 2 -1. + <_> + 12 2 4 1 2. + <_> + 16 3 4 1 2. + <_> + + <_> + 4 1 10 4 -1. + <_> + 4 2 10 2 2. + <_> + + <_> + 4 0 2 3 -1. + <_> + 3 1 2 1 3. + 1 + <_> + + <_> + 12 7 3 8 -1. + <_> + 10 9 3 4 2. + 1 + <_> + + <_> + 1 15 2 2 -1. + <_> + 1 15 1 1 2. + <_> + 2 16 1 1 2. + <_> + + <_> + 7 16 2 2 -1. + <_> + 7 16 1 1 2. + <_> + 8 17 1 1 2. + <_> + + <_> + 0 8 2 12 -1. + <_> + 0 11 2 6 2. + <_> + + <_> + 10 6 4 8 -1. + <_> + 10 6 2 4 2. + <_> + 12 10 2 4 2. + <_> + + <_> + 12 6 2 4 -1. + <_> + 12 6 1 2 2. + <_> + 13 8 1 2 2. + <_> + + <_> + 3 12 4 2 -1. + <_> + 3 12 2 2 2. + 1 + <_> + + <_> + 7 9 8 1 -1. + <_> + 9 9 4 1 2. + <_> + + <_> + 3 1 3 16 -1. + <_> + 4 1 1 16 3. + <_> + + <_> + 8 10 6 9 -1. + <_> + 10 10 2 9 3. + <_> + + <_> + 16 14 3 3 -1. + <_> + 17 14 1 3 3. + <_> + + <_> + 14 8 6 12 -1. + <_> + 14 11 6 6 2. + <_> + + <_> + 14 19 6 1 -1. + <_> + 16 19 2 1 3. + <_> + + <_> + 5 8 8 5 -1. + <_> + 9 8 4 5 2. + <_> + + <_> + 9 3 8 3 -1. + <_> + 11 5 4 3 2. + 1 + <_> + + <_> + 9 9 6 10 -1. + <_> + 9 14 6 5 2. + <_> + + <_> + 16 8 3 2 -1. + <_> + 17 8 1 2 3. + <_> + + <_> + 3 0 3 2 -1. + <_> + 4 0 1 2 3. + <_> + + <_> + 13 10 2 1 -1. + <_> + 14 10 1 1 2. + <_> + + <_> + 17 17 2 3 -1. + <_> + 17 18 2 1 3. + <_> + + <_> + 15 14 2 2 -1. + <_> + 15 14 1 1 2. + <_> + 16 15 1 1 2. + <_> + + <_> + 16 18 4 2 -1. + <_> + 16 18 2 1 2. + <_> + 18 19 2 1 2. + <_> + + <_> + 4 17 3 2 -1. + <_> + 5 17 1 2 3. + <_> + + <_> + 1 0 11 2 -1. + <_> + 1 1 11 1 2. + <_> + + <_> + 2 0 10 2 -1. + <_> + 2 1 10 1 2. + <_> + + <_> + 4 10 12 1 -1. + <_> + 8 10 4 1 3. + <_> + + <_> + 2 9 4 6 -1. + <_> + 2 9 2 3 2. + <_> + 4 12 2 3 2. + <_> + + <_> + 15 6 4 14 -1. + <_> + 15 6 2 7 2. + <_> + 17 13 2 7 2. + <_> + + <_> + 10 2 6 12 -1. + <_> + 12 6 2 4 9. + <_> + + <_> + 8 5 6 15 -1. + <_> + 10 10 2 5 9. + <_> + + <_> + 17 8 3 5 -1. + <_> + 18 9 1 5 3. + 1 + <_> + + <_> + 10 6 6 6 -1. + <_> + 12 8 2 6 3. + 1 + <_> + + <_> + 17 8 3 12 -1. + <_> + 18 8 1 12 3. + <_> + + <_> + 5 8 3 4 -1. + <_> + 5 10 3 2 2. + <_> + + <_> + 16 0 4 6 -1. + <_> + 16 0 2 3 2. + <_> + 18 3 2 3 2. + <_> + + <_> + 15 0 5 10 -1. + <_> + 15 5 5 5 2. + <_> + + <_> + 14 8 2 3 -1. + <_> + 15 8 1 3 2. + <_> + + <_> + 3 1 14 3 -1. + <_> + 2 2 14 1 3. + 1 + <_> + + <_> + 0 0 2 13 -1. + <_> + 1 0 1 13 2. + <_> + + <_> + 2 8 6 12 -1. + <_> + 4 8 2 12 3. + <_> + + <_> + 8 7 6 5 -1. + <_> + 10 9 2 5 3. + 1 + <_> + + <_> + 9 8 1 12 -1. + <_> + 9 12 1 4 3. + <_> + + <_> + 1 0 2 4 -1. + <_> + 2 0 1 4 2. + <_> + + <_> + 6 8 8 2 -1. + <_> + 8 8 4 2 2. + <_> + + <_> + 4 6 4 6 -1. + <_> + 5 6 2 6 2. + <_> + + <_> + 12 1 4 6 -1. + <_> + 13 1 2 6 2. + <_> + + <_> + 3 0 9 2 -1. + <_> + 3 0 9 1 2. + 1 + <_> + + <_> + 12 0 4 2 -1. + <_> + 12 1 4 1 2. + <_> + + <_> + 14 18 2 2 -1. + <_> + 14 19 2 1 2. + <_> + + <_> + 12 3 8 4 -1. + <_> + 12 5 8 2 2. + <_> + + <_> + 4 11 1 2 -1. + <_> + 4 11 1 1 2. + 1 + <_> + + <_> + 8 4 9 6 -1. + <_> + 11 4 3 6 3. + <_> + + <_> + 5 10 2 6 -1. + <_> + 5 10 1 3 2. + <_> + 6 13 1 3 2. + <_> + + <_> + 5 10 4 3 -1. + <_> + 6 10 2 3 2. + <_> + + <_> + 12 4 3 1 -1. + <_> + 13 4 1 1 3. + <_> + + <_> + 2 11 18 6 -1. + <_> + 2 13 18 2 3. + <_> + + <_> + 8 6 10 14 -1. + <_> + 8 6 5 7 2. + <_> + 13 13 5 7 2. + <_> + + <_> + 2 2 12 2 -1. + <_> + 2 2 6 1 2. + <_> + 8 3 6 1 2. + <_> + + <_> + 10 7 6 10 -1. + <_> + 10 7 3 5 2. + <_> + 13 12 3 5 2. + <_> + + <_> + 1 2 4 4 -1. + <_> + 3 2 2 4 2. + <_> + + <_> + 3 0 13 2 -1. + <_> + 3 1 13 1 2. + <_> + + <_> + 3 2 11 3 -1. + <_> + 3 3 11 1 3. + <_> + + <_> + 14 8 3 4 -1. + <_> + 14 9 3 2 2. + <_> + + <_> + 9 8 10 4 -1. + <_> + 9 9 10 2 2. + <_> + + <_> + 6 8 6 12 -1. + <_> + 8 8 2 12 3. + <_> + + <_> + 4 7 3 3 -1. + <_> + 5 8 1 1 9. + <_> + + <_> + 1 5 12 15 -1. + <_> + 4 5 6 15 2. + <_> + + <_> + 8 8 8 2 -1. + <_> + 10 8 4 2 2. + <_> + + <_> + 18 0 2 6 -1. + <_> + 19 0 1 6 2. + <_> + + <_> + 6 1 12 5 -1. + <_> + 12 1 6 5 2. + <_> + + <_> + 8 1 6 4 -1. + <_> + 10 1 2 4 3. + <_> + + <_> + 17 5 3 2 -1. + <_> + 18 6 1 2 3. + 1 + <_> + + <_> + 11 1 6 9 -1. + <_> + 8 4 6 3 3. + 1 + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 16 16 2 2 -1. + <_> + 16 16 1 1 2. + <_> + 17 17 1 1 2. + <_> + + <_> + 18 16 1 3 -1. + <_> + 18 17 1 1 3. + <_> + + <_> + 5 7 8 2 -1. + <_> + 9 7 4 2 2. + <_> + + <_> + 8 3 1 16 -1. + <_> + 8 11 1 8 2. + <_> + + <_> + 17 2 2 8 -1. + <_> + 17 2 1 8 2. + 1 + <_> + + <_> + 5 3 4 2 -1. + <_> + 7 3 2 2 2. + <_> + + <_> + 14 6 3 3 -1. + <_> + 15 7 1 1 9. + <_> + + <_> + 2 0 8 9 -1. + <_> + 4 0 4 9 2. + <_> + + <_> + 16 0 3 8 -1. + <_> + 17 0 1 8 3. + <_> + + <_> + 16 0 3 8 -1. + <_> + 17 0 1 8 3. + <_> + + <_> + 17 18 2 2 -1. + <_> + 18 18 1 2 2. + <_> + + <_> + 11 10 8 4 -1. + <_> + 13 10 4 4 2. + <_> + + <_> + 17 5 2 2 -1. + <_> + 17 6 2 1 2. + <_> + + <_> + 12 9 4 3 -1. + <_> + 13 9 2 3 2. + <_> + + <_> + 15 7 3 7 -1. + <_> + 16 7 1 7 3. + <_> + + <_> + 1 5 4 6 -1. + <_> + 2 5 2 6 2. + <_> + + <_> + 2 2 18 10 -1. + <_> + 2 2 9 5 2. + <_> + 11 7 9 5 2. + <_> + + <_> + 8 4 2 3 -1. + <_> + 9 4 1 3 2. + <_> + + <_> + 3 3 12 2 -1. + <_> + 6 6 6 2 2. + 1 + <_> + + <_> + 5 3 12 6 -1. + <_> + 9 3 4 6 3. + <_> + + <_> + 15 7 2 3 -1. + <_> + 15 8 2 1 3. + <_> + + <_> + 5 9 4 6 -1. + <_> + 5 12 4 3 2. + <_> + + <_> + 1 15 6 4 -1. + <_> + 1 15 3 2 2. + <_> + 4 17 3 2 2. + <_> + + <_> + 2 9 2 6 -1. + <_> + 3 9 1 6 2. + <_> + + <_> + 1 18 3 2 -1. + <_> + 1 19 3 1 2. + <_> + + <_> + 16 9 3 2 -1. + <_> + 17 10 1 2 3. + 1 + <_> + + <_> + 7 10 3 4 -1. + <_> + 6 11 3 2 2. + 1 + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 1 1 2. + <_> + 17 8 1 1 2. + <_> + + <_> + 16 5 2 2 -1. + <_> + 16 5 1 1 2. + <_> + 17 6 1 1 2. + <_> + + <_> + 0 1 2 8 -1. + <_> + 0 1 1 4 2. + <_> + 1 5 1 4 2. + <_> + + <_> + 7 17 6 3 -1. + <_> + 9 17 2 3 3. + <_> + + <_> + 1 2 3 1 -1. + <_> + 2 2 1 1 3. + <_> + + <_> + 2 13 2 6 -1. + <_> + 2 13 1 3 2. + <_> + 3 16 1 3 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 2 10 16 10 -1. + <_> + 2 15 16 5 2. + <_> + + <_> + 10 18 4 2 -1. + <_> + 12 18 2 2 2. + <_> + + <_> + 6 6 4 8 -1. + <_> + 7 6 2 8 2. + <_> + + <_> + 9 10 3 1 -1. + <_> + 10 11 1 1 3. + 1 + <_> + + <_> + 1 13 4 3 -1. + <_> + 3 13 2 3 2. + <_> + + <_> + 5 11 7 2 -1. + <_> + 5 12 7 1 2. + <_> + + <_> + 1 9 3 3 -1. + <_> + 1 10 3 1 3. + <_> + + <_> + 10 7 6 6 -1. + <_> + 12 9 2 2 9. + <_> + + <_> + 5 7 2 4 -1. + <_> + 4 8 2 2 2. + 1 + <_> + + <_> + 5 10 2 4 -1. + <_> + 5 10 1 2 2. + <_> + 6 12 1 2 2. + <_> + + <_> + 14 16 2 2 -1. + <_> + 14 16 1 1 2. + <_> + 15 17 1 1 2. + <_> + + <_> + 2 9 2 10 -1. + <_> + 2 9 1 5 2. + <_> + 3 14 1 5 2. + <_> + + <_> + 14 17 4 2 -1. + <_> + 14 18 4 1 2. + <_> + + <_> + 4 16 1 3 -1. + <_> + 3 17 1 1 3. + 1 + <_> + + <_> + 13 12 4 3 -1. + <_> + 14 13 2 3 2. + 1 + <_> + + <_> + 16 6 4 1 -1. + <_> + 17 7 2 1 2. + 1 + <_> + + <_> + 11 0 9 6 -1. + <_> + 11 3 9 3 2. + <_> + + <_> + 16 13 3 3 -1. + <_> + 15 14 3 1 3. + 1 + <_> + + <_> + 0 7 3 6 -1. + <_> + 1 9 1 2 9. + <_> + + <_> + 11 5 7 2 -1. + <_> + 11 6 7 1 2. + <_> + + <_> + 6 17 6 3 -1. + <_> + 6 18 6 1 3. + <_> + + <_> + 15 17 3 3 -1. + <_> + 16 18 1 1 9. + <_> + + <_> + 7 4 6 1 -1. + <_> + 9 4 2 1 3. + <_> + + <_> + 8 10 6 3 -1. + <_> + 10 10 2 3 3. + <_> + + <_> + 1 5 1 4 -1. + <_> + 1 6 1 2 2. + <_> + + <_> + 12 6 1 4 -1. + <_> + 12 8 1 2 2. + <_> + + <_> + 2 6 3 1 -1. + <_> + 3 7 1 1 3. + 1 + <_> + + <_> + 9 7 1 2 -1. + <_> + 9 8 1 1 2. + <_> + + <_> + 2 2 12 1 -1. + <_> + 8 2 6 1 2. + <_> + + <_> + 18 0 2 4 -1. + <_> + 18 0 1 4 2. + 1 + <_> + + <_> + 1 6 2 1 -1. + <_> + 1 6 1 1 2. + 1 + <_> + + <_> + 4 6 1 4 -1. + <_> + 4 7 1 2 2. + <_> + + <_> + 1 3 19 9 -1. + <_> + 1 6 19 3 3. + <_> + + <_> + 0 0 4 20 -1. + <_> + 0 5 4 10 2. + <_> + + <_> + 0 9 12 2 -1. + <_> + 6 9 6 2 2. + <_> + + <_> + 6 8 6 11 -1. + <_> + 8 8 2 11 3. + <_> + + <_> + 9 7 9 1 -1. + <_> + 12 7 3 1 3. + <_> + + <_> + 4 3 3 8 -1. + <_> + 5 3 1 8 3. + <_> + + <_> + 7 3 2 11 -1. + <_> + 8 3 1 11 2. + <_> + + <_> + 18 4 2 1 -1. + <_> + 18 4 1 1 2. + 1 + <_> + + <_> + 3 8 4 9 -1. + <_> + 5 8 2 9 2. + <_> + + <_> + 16 5 1 12 -1. + <_> + 12 9 1 4 3. + 1 + <_> + + <_> + 2 19 2 1 -1. + <_> + 3 19 1 1 2. + <_> + + <_> + 2 1 6 6 -1. + <_> + 5 1 3 6 2. + <_> + + <_> + 11 0 8 1 -1. + <_> + 15 0 4 1 2. + <_> + + <_> + 14 0 4 1 -1. + <_> + 16 0 2 1 2. + <_> + + <_> + 5 4 12 1 -1. + <_> + 11 4 6 1 2. + <_> + + <_> + 10 6 8 2 -1. + <_> + 10 6 4 1 2. + <_> + 14 7 4 1 2. + <_> + + <_> + 6 0 9 3 -1. + <_> + 5 1 9 1 3. + 1 + <_> + + <_> + 0 8 4 6 -1. + <_> + 2 8 2 6 2. + <_> + + <_> + 2 8 3 12 -1. + <_> + 3 8 1 12 3. + <_> + + <_> + 1 17 7 3 -1. + <_> + 1 18 7 1 3. + <_> + + <_> + 1 16 8 2 -1. + <_> + 1 17 8 1 2. + <_> + + <_> + 15 9 2 6 -1. + <_> + 15 9 1 3 2. + <_> + 16 12 1 3 2. + <_> + + <_> + 5 10 12 1 -1. + <_> + 8 10 6 1 2. + <_> + + <_> + 14 11 4 3 -1. + <_> + 15 11 2 3 2. + <_> + + <_> + 2 2 3 15 -1. + <_> + 3 7 1 5 9. + <_> + + <_> + 4 5 3 9 -1. + <_> + 5 8 1 3 9. + <_> + + <_> + 1 8 12 2 -1. + <_> + 7 8 6 2 2. + <_> + + <_> + 15 15 4 5 -1. + <_> + 17 15 2 5 2. + <_> + + <_> + 10 13 9 7 -1. + <_> + 13 13 3 7 3. + <_> + + <_> + 9 5 5 3 -1. + <_> + 8 6 5 1 3. + 1 + <_> + + <_> + 9 0 8 4 -1. + <_> + 9 2 8 2 2. + <_> + + <_> + 6 3 2 6 -1. + <_> + 4 5 2 2 3. + 1 + <_> + + <_> + 10 10 1 4 -1. + <_> + 10 11 1 2 2. + <_> + + <_> + 1 17 5 3 -1. + <_> + 1 18 5 1 3. + <_> + + <_> + 2 4 10 1 -1. + <_> + 2 4 5 1 2. + 1 + <_> + + <_> + 4 18 1 2 -1. + <_> + 4 19 1 1 2. + <_> + + <_> + 5 7 1 3 -1. + <_> + 5 8 1 1 3. + <_> + + <_> + 6 11 4 3 -1. + <_> + 6 11 2 3 2. + 1 + <_> + + <_> + 17 16 3 4 -1. + <_> + 17 18 3 2 2. + <_> + + <_> + 6 11 11 4 -1. + <_> + 6 12 11 2 2. + <_> + + <_> + 6 5 6 1 -1. + <_> + 8 5 2 1 3. + <_> + + <_> + 17 12 2 8 -1. + <_> + 17 16 2 4 2. + <_> + + <_> + 17 6 2 4 -1. + <_> + 17 8 2 2 2. + <_> + + <_> + 10 8 6 2 -1. + <_> + 10 9 6 1 2. + <_> + + <_> + 5 8 3 12 -1. + <_> + 5 12 3 4 3. + <_> + + <_> + 19 7 1 4 -1. + <_> + 19 9 1 2 2. + <_> + + <_> + 1 10 6 1 -1. + <_> + 3 10 2 1 3. + <_> + + <_> + 7 10 3 2 -1. + <_> + 7 10 3 1 2. + 1 + <_> + + <_> + 2 2 8 11 -1. + <_> + 6 2 4 11 2. + <_> + + <_> + 18 4 2 7 -1. + <_> + 18 4 1 7 2. + 1 + <_> + + <_> + 11 3 2 8 -1. + <_> + 11 7 2 4 2. + <_> + + <_> + 16 6 3 3 -1. + <_> + 15 7 3 1 3. + 1 + <_> + + <_> + 10 8 3 7 -1. + <_> + 11 9 1 7 3. + 1 + <_> + + <_> + 14 9 2 6 -1. + <_> + 15 9 1 6 2. + <_> + + <_> + 9 17 6 1 -1. + <_> + 11 17 2 1 3. + <_> + + <_> + 11 4 9 9 -1. + <_> + 14 7 3 3 9. + <_> + + <_> + 14 7 4 7 -1. + <_> + 15 7 2 7 2. + <_> + + <_> + 16 2 3 6 -1. + <_> + 17 2 1 6 3. + <_> + + <_> + 14 13 2 7 -1. + <_> + 15 13 1 7 2. + <_> + + <_> + 0 4 18 12 -1. + <_> + 6 8 6 4 9. + <_> + + <_> + 3 6 7 9 -1. + <_> + 3 9 7 3 3. + <_> + + <_> + 17 4 3 4 -1. + <_> + 18 4 1 4 3. + <_> + + <_> + 5 15 3 3 -1. + <_> + 6 15 1 3 3. + <_> + + <_> + 0 12 2 1 -1. + <_> + 1 12 1 1 2. + <_> + + <_> + 5 8 11 4 -1. + <_> + 5 9 11 2 2. + <_> + + <_> + 8 13 4 7 -1. + <_> + 9 13 2 7 2. + <_> + + <_> + 7 7 5 2 -1. + <_> + 7 8 5 1 2. + <_> + + <_> + 5 9 14 3 -1. + <_> + 5 10 14 1 3. + <_> + + <_> + 15 9 5 4 -1. + <_> + 15 10 5 2 2. + <_> + + <_> + 13 9 3 3 -1. + <_> + 12 10 3 1 3. + 1 + <_> + + <_> + 4 11 4 4 -1. + <_> + 3 12 4 2 2. + 1 + <_> + + <_> + 13 7 2 13 -1. + <_> + 14 7 1 13 2. + <_> + + <_> + 8 8 5 2 -1. + <_> + 8 9 5 1 2. + <_> + + <_> + 5 14 6 4 -1. + <_> + 7 14 2 4 3. + <_> + + <_> + 6 16 3 1 -1. + <_> + 7 17 1 1 3. + 1 + <_> + + <_> + 1 0 18 3 -1. + <_> + 7 1 6 1 9. + <_> + + <_> + 8 0 2 15 -1. + <_> + 8 5 2 5 3. + <_> + + <_> + 13 1 2 4 -1. + <_> + 13 2 2 2 2. + <_> + + <_> + 11 11 9 4 -1. + <_> + 11 12 9 2 2. + <_> + + <_> + 2 11 3 2 -1. + <_> + 2 11 3 1 2. + 1 + <_> + + <_> + 3 5 1 3 -1. + <_> + 2 6 1 1 3. + 1 + <_> + + <_> + 4 17 16 1 -1. + <_> + 8 17 8 1 2. + <_> + + <_> + 4 16 8 3 -1. + <_> + 8 16 4 3 2. + <_> + + <_> + 4 2 4 1 -1. + <_> + 6 2 2 1 2. + <_> + + <_> + 6 4 9 3 -1. + <_> + 6 5 9 1 3. + <_> + + <_> + 6 1 4 1 -1. + <_> + 7 1 2 1 2. + <_> + + <_> + 3 0 7 3 -1. + <_> + 2 1 7 1 3. + 1 + <_> + + <_> + 6 9 3 2 -1. + <_> + 7 9 1 2 3. + <_> + + <_> + 18 3 2 10 -1. + <_> + 18 3 1 5 2. + <_> + 19 8 1 5 2. + <_> + + <_> + 0 9 10 4 -1. + <_> + 0 9 5 2 2. + <_> + 5 11 5 2 2. + <_> + + <_> + 0 3 8 6 -1. + <_> + 0 3 4 3 2. + <_> + 4 6 4 3 2. + <_> + + <_> + 14 8 6 4 -1. + <_> + 14 10 6 2 2. + <_> + + <_> + 17 6 1 2 -1. + <_> + 17 6 1 1 2. + 1 + <_> + + <_> + 14 4 1 10 -1. + <_> + 14 9 1 5 2. + <_> + + <_> + 16 15 2 1 -1. + <_> + 16 15 1 1 2. + 1 + <_> + + <_> + 4 11 4 8 -1. + <_> + 5 11 2 8 2. + <_> + + <_> + 6 13 8 1 -1. + <_> + 8 13 4 1 2. + <_> + + <_> + 13 0 6 11 -1. + <_> + 16 0 3 11 2. + <_> + + <_> + 10 1 8 12 -1. + <_> + 10 4 8 6 2. + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 18 1 1 2. + <_> + 19 19 1 1 2. + <_> + + <_> + 0 15 2 4 -1. + <_> + 0 16 2 2 2. + <_> + + <_> + 16 0 1 2 -1. + <_> + 16 1 1 1 2. + <_> + + <_> + 10 3 10 4 -1. + <_> + 10 3 5 2 2. + <_> + 15 5 5 2 2. + <_> + + <_> + 16 7 3 3 -1. + <_> + 15 8 3 1 3. + 1 + <_> + + <_> + 1 0 12 6 -1. + <_> + 4 0 6 6 2. + <_> + + <_> + 7 0 12 8 -1. + <_> + 10 0 6 8 2. + <_> + + <_> + 5 8 2 3 -1. + <_> + 5 8 1 3 2. + 1 + <_> + + <_> + 16 11 2 2 -1. + <_> + 16 11 1 1 2. + <_> + 17 12 1 1 2. + <_> + + <_> + 15 0 3 12 -1. + <_> + 16 0 1 12 3. + <_> + + <_> + 14 1 3 5 -1. + <_> + 15 2 1 5 3. + 1 + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 18 1 1 2. + <_> + 19 19 1 1 2. + <_> + + <_> + 6 15 2 2 -1. + <_> + 6 15 1 1 2. + <_> + 7 16 1 1 2. + <_> + + <_> + 4 16 2 2 -1. + <_> + 4 16 1 1 2. + <_> + 5 17 1 1 2. + <_> + + <_> + 9 8 3 3 -1. + <_> + 8 9 3 1 3. + 1 + <_> + + <_> + 3 8 3 8 -1. + <_> + 3 10 3 4 2. + <_> + + <_> + 7 16 2 2 -1. + <_> + 7 16 1 1 2. + <_> + 8 17 1 1 2. + <_> + + <_> + 17 4 1 8 -1. + <_> + 17 4 1 4 2. + 1 + <_> + + <_> + 3 15 10 4 -1. + <_> + 3 15 5 2 2. + <_> + 8 17 5 2 2. + <_> + + <_> + 13 0 4 1 -1. + <_> + 15 0 2 1 2. + <_> + + <_> + 8 5 8 7 -1. + <_> + 8 5 4 7 2. + 1 + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 1 1 2. + <_> + 17 8 1 1 2. + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 1 1 2. + <_> + 17 8 1 1 2. + <_> + + <_> + 15 10 2 3 -1. + <_> + 14 11 2 1 3. + 1 + <_> + + <_> + 11 9 2 3 -1. + <_> + 11 10 2 1 3. + <_> + + <_> + 17 8 3 3 -1. + <_> + 17 9 3 1 3. + <_> + + <_> + 4 1 2 12 -1. + <_> + 4 4 2 6 2. + <_> + + <_> + 11 6 2 2 -1. + <_> + 11 6 1 1 2. + <_> + 12 7 1 1 2. + <_> + + <_> + 5 2 9 12 -1. + <_> + 5 8 9 6 2. + <_> + + <_> + 13 5 6 4 -1. + <_> + 13 5 3 2 2. + <_> + 16 7 3 2 2. + <_> + + <_> + 14 0 4 3 -1. + <_> + 13 1 4 1 3. + 1 + <_> + + <_> + 3 5 10 12 -1. + <_> + 3 5 5 6 2. + <_> + 8 11 5 6 2. + <_> + + <_> + 0 9 9 6 -1. + <_> + 3 11 3 2 9. + <_> + + <_> + 1 4 8 7 -1. + <_> + 5 4 4 7 2. + <_> + + <_> + 15 7 4 5 -1. + <_> + 16 7 2 5 2. + <_> + + <_> + 18 6 2 4 -1. + <_> + 19 6 1 4 2. + <_> + + <_> + 16 9 2 3 -1. + <_> + 16 9 1 3 2. + 1 + <_> + + <_> + 3 2 3 17 -1. + <_> + 4 2 1 17 3. + <_> + + <_> + 18 9 2 10 -1. + <_> + 18 14 2 5 2. + <_> + + <_> + 6 0 14 4 -1. + <_> + 5 1 14 2 2. + 1 + <_> + + <_> + 17 8 3 1 -1. + <_> + 18 9 1 1 3. + 1 + <_> + + <_> + 8 13 4 3 -1. + <_> + 9 13 2 3 2. + <_> + + <_> + 6 8 6 3 -1. + <_> + 5 9 6 1 3. + 1 + <_> + + <_> + 10 7 10 1 -1. + <_> + 10 7 5 1 2. + 1 + <_> + + <_> + 9 7 6 5 -1. + <_> + 12 7 3 5 2. + <_> + + <_> + 13 5 1 12 -1. + <_> + 13 5 1 6 2. + 1 + <_> + + <_> + 1 13 6 5 -1. + <_> + 4 13 3 5 2. + <_> + + <_> + 4 6 4 3 -1. + <_> + 5 7 2 3 2. + 1 + <_> + + <_> + 3 16 2 3 -1. + <_> + 4 16 1 3 2. + <_> + + <_> + 7 2 5 4 -1. + <_> + 7 2 5 2 2. + 1 + <_> + + <_> + 3 13 3 7 -1. + <_> + 4 13 1 7 3. + <_> + + <_> + 16 6 1 3 -1. + <_> + 16 7 1 1 3. + <_> + + <_> + 1 6 8 3 -1. + <_> + 5 6 4 3 2. + <_> + + <_> + 14 9 3 4 -1. + <_> + 13 10 3 2 2. + 1 + <_> + + <_> + 8 10 4 5 -1. + <_> + 9 10 2 5 2. + <_> + + <_> + 0 11 13 6 -1. + <_> + 0 14 13 3 2. + <_> + + <_> + 2 3 1 2 -1. + <_> + 2 3 1 1 2. + 1 + <_> + + <_> + 3 15 12 4 -1. + <_> + 6 15 6 4 2. + <_> + + <_> + 6 7 4 13 -1. + <_> + 7 7 2 13 2. + <_> + + <_> + 17 15 2 2 -1. + <_> + 17 15 1 1 2. + <_> + 18 16 1 1 2. + <_> + + <_> + 12 15 5 2 -1. + <_> + 12 16 5 1 2. + <_> + + <_> + 13 12 1 6 -1. + <_> + 13 14 1 2 3. + <_> + + <_> + 15 0 1 9 -1. + <_> + 12 3 1 3 3. + 1 + <_> + + <_> + 4 9 2 6 -1. + <_> + 4 9 1 3 2. + <_> + 5 12 1 3 2. + <_> + + <_> + 12 10 6 1 -1. + <_> + 14 10 2 1 3. + <_> + + <_> + 11 11 2 3 -1. + <_> + 11 11 1 3 2. + 1 + <_> + + <_> + 12 9 6 2 -1. + <_> + 14 9 2 2 3. + <_> + + <_> + 12 6 2 12 -1. + <_> + 12 6 2 6 2. + 1 + <_> + + <_> + 11 11 2 8 -1. + <_> + 11 11 1 4 2. + <_> + 12 15 1 4 2. + <_> + + <_> + 5 3 6 3 -1. + <_> + 7 3 2 3 3. + <_> + + <_> + 8 7 12 6 -1. + <_> + 8 9 12 2 3. + <_> + + <_> + 3 15 1 2 -1. + <_> + 3 15 1 1 2. + 1 + <_> + + <_> + 12 1 8 3 -1. + <_> + 14 1 4 3 2. + <_> + + <_> + 0 0 12 7 -1. + <_> + 4 0 4 7 3. + <_> + + <_> + 18 2 2 6 -1. + <_> + 18 2 1 3 2. + <_> + 19 5 1 3 2. + <_> + + <_> + 4 0 6 16 -1. + <_> + 4 0 3 8 2. + <_> + 7 8 3 8 2. + <_> + + <_> + 3 16 6 4 -1. + <_> + 5 16 2 4 3. + <_> + + <_> + 4 7 6 3 -1. + <_> + 3 8 6 1 3. + 1 + <_> + + <_> + 11 6 5 3 -1. + <_> + 10 7 5 1 3. + 1 + <_> + + <_> + 3 3 12 8 -1. + <_> + 3 7 12 4 2. + <_> + + <_> + 12 8 2 3 -1. + <_> + 12 9 2 1 3. + <_> + + <_> + 5 10 2 2 -1. + <_> + 6 10 1 2 2. + <_> + + <_> + 17 4 1 14 -1. + <_> + 17 4 1 7 2. + 1 + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 10 1 3 2. + 1 + <_> + + <_> + 6 5 4 9 -1. + <_> + 7 5 2 9 2. + <_> + + <_> + 7 5 12 1 -1. + <_> + 7 5 6 1 2. + 1 + <_> + + <_> + 2 16 2 2 -1. + <_> + 2 16 1 1 2. + <_> + 3 17 1 1 2. + <_> + + <_> + 15 5 3 3 -1. + <_> + 16 6 1 3 3. + 1 + <_> + + <_> + 10 7 3 8 -1. + <_> + 11 8 1 8 3. + 1 + <_> + + <_> + 7 3 3 3 -1. + <_> + 7 4 3 1 3. + <_> + + <_> + 13 3 5 6 -1. + <_> + 13 5 5 2 3. + <_> + + <_> + 0 15 5 3 -1. + <_> + 0 16 5 1 3. + <_> + + <_> + 2 18 18 1 -1. + <_> + 11 18 9 1 2. + <_> + + <_> + 11 14 4 2 -1. + <_> + 13 14 2 2 2. + <_> + + <_> + 3 15 7 2 -1. + <_> + 3 16 7 1 2. + <_> + + <_> + 13 9 3 3 -1. + <_> + 12 10 3 1 3. + 1 + <_> + + <_> + 13 0 3 12 -1. + <_> + 14 1 1 12 3. + 1 + <_> + + <_> + 9 5 3 5 -1. + <_> + 10 5 1 5 3. + <_> + + <_> + 18 14 2 4 -1. + <_> + 18 14 1 2 2. + <_> + 19 16 1 2 2. + <_> + + <_> + 16 19 4 1 -1. + <_> + 18 19 2 1 2. + <_> + + <_> + 17 15 2 5 -1. + <_> + 18 15 1 5 2. + <_> + + <_> + 0 17 6 3 -1. + <_> + 0 18 6 1 3. + <_> + + <_> + 0 4 1 14 -1. + <_> + 0 11 1 7 2. + <_> + + <_> + 5 11 3 5 -1. + <_> + 6 12 1 5 3. + 1 + <_> + + <_> + 12 8 3 1 -1. + <_> + 13 8 1 1 3. + <_> + + <_> + 18 0 2 7 -1. + <_> + 19 0 1 7 2. + <_> + + <_> + 3 8 6 10 -1. + <_> + 3 13 6 5 2. + <_> + + <_> + 17 0 2 5 -1. + <_> + 18 0 1 5 2. + <_> + + <_> + 18 0 2 12 -1. + <_> + 18 0 2 6 2. + 1 + <_> + + <_> + 2 1 3 2 -1. + <_> + 2 1 3 1 2. + 1 + <_> + + <_> + 1 1 5 12 -1. + <_> + 1 4 5 6 2. + <_> + + <_> + 2 5 1 14 -1. + <_> + 2 12 1 7 2. + <_> + + <_> + 6 0 9 7 -1. + <_> + 9 0 3 7 3. + <_> + + <_> + 16 1 4 6 -1. + <_> + 16 1 2 3 2. + <_> + 18 4 2 3 2. + <_> + + <_> + 16 0 4 6 -1. + <_> + 16 0 2 3 2. + <_> + 18 3 2 3 2. + <_> + + <_> + 18 0 1 2 -1. + <_> + 18 1 1 1 2. + <_> + + <_> + 17 1 1 3 -1. + <_> + 17 2 1 1 3. + <_> + + <_> + 1 8 3 4 -1. + <_> + 1 9 3 2 2. + <_> + + <_> + 6 0 4 15 -1. + <_> + 8 0 2 15 2. + <_> + + <_> + 18 17 1 3 -1. + <_> + 18 18 1 1 3. + <_> + + <_> + 3 7 6 3 -1. + <_> + 5 8 2 1 9. + <_> + + <_> + 0 5 12 12 -1. + <_> + 4 5 4 12 3. + <_> + + <_> + 14 9 1 3 -1. + <_> + 13 10 1 1 3. + 1 + <_> + + <_> + 4 4 2 2 -1. + <_> + 4 5 2 1 2. + <_> + + <_> + 6 4 2 10 -1. + <_> + 6 9 2 5 2. + <_> + + <_> + 14 6 6 14 -1. + <_> + 14 6 3 7 2. + <_> + 17 13 3 7 2. + <_> + + <_> + 6 7 11 8 -1. + <_> + 6 11 11 4 2. + <_> + + <_> + 17 8 3 5 -1. + <_> + 18 9 1 5 3. + 1 + <_> + + <_> + 10 4 10 2 -1. + <_> + 10 4 5 1 2. + <_> + 15 5 5 1 2. + <_> + + <_> + 5 1 8 8 -1. + <_> + 5 5 8 4 2. + <_> + + <_> + 19 16 1 4 -1. + <_> + 19 18 1 2 2. + <_> + + <_> + 19 0 1 10 -1. + <_> + 19 5 1 5 2. + <_> + + <_> + 17 0 3 3 -1. + <_> + 17 1 3 1 3. + <_> + + <_> + 9 2 3 1 -1. + <_> + 10 2 1 1 3. + <_> + + <_> + 2 0 18 5 -1. + <_> + 8 0 6 5 3. + <_> + + <_> + 15 8 3 9 -1. + <_> + 15 11 3 3 3. + <_> + + <_> + 13 11 1 8 -1. + <_> + 13 13 1 4 2. + <_> + + <_> + 10 14 8 3 -1. + <_> + 14 14 4 3 2. + <_> + + <_> + 7 8 2 8 -1. + <_> + 7 8 1 4 2. + <_> + 8 12 1 4 2. + <_> + + <_> + 2 18 4 2 -1. + <_> + 2 18 2 1 2. + <_> + 4 19 2 1 2. + <_> + + <_> + 5 5 2 3 -1. + <_> + 4 6 2 1 3. + 1 + <_> + + <_> + 15 1 4 1 -1. + <_> + 17 1 2 1 2. + <_> + + <_> + 7 1 4 3 -1. + <_> + 6 2 4 1 3. + 1 + <_> + + <_> + 3 1 6 19 -1. + <_> + 6 1 3 19 2. + <_> + + <_> + 8 3 5 8 -1. + <_> + 8 7 5 4 2. + <_> + + <_> + 0 0 20 2 -1. + <_> + 0 0 10 1 2. + <_> + 10 1 10 1 2. + <_> + + <_> + 7 0 8 2 -1. + <_> + 7 0 4 1 2. + <_> + 11 1 4 1 2. + <_> + + <_> + 3 6 3 3 -1. + <_> + 4 7 1 1 9. + <_> + + <_> + 1 6 2 8 -1. + <_> + 1 6 1 4 2. + <_> + 2 10 1 4 2. + <_> + + <_> + 18 9 2 3 -1. + <_> + 17 10 2 1 3. + 1 + <_> + + <_> + 16 2 4 12 -1. + <_> + 13 5 4 6 2. + 1 + <_> + + <_> + 8 0 7 20 -1. + <_> + 8 5 7 10 2. + <_> + + <_> + 11 6 4 3 -1. + <_> + 11 7 4 1 3. + <_> + + <_> + 12 2 4 12 -1. + <_> + 12 8 4 6 2. + <_> + + <_> + 11 9 7 4 -1. + <_> + 11 10 7 2 2. + <_> + + <_> + 2 9 1 2 -1. + <_> + 2 10 1 1 2. + <_> + + <_> + 6 9 5 3 -1. + <_> + 6 10 5 1 3. + <_> + + <_> + 8 6 12 2 -1. + <_> + 12 6 4 2 3. + <_> + + <_> + 0 11 4 4 -1. + <_> + 0 11 2 2 2. + <_> + 2 13 2 2 2. + <_> + + <_> + 0 9 4 8 -1. + <_> + 0 9 2 4 2. + <_> + 2 13 2 4 2. + <_> + + <_> + 14 7 3 10 -1. + <_> + 14 7 3 5 2. + 1 + <_> + + <_> + 0 1 2 7 -1. + <_> + 1 1 1 7 2. + <_> + + <_> + 1 1 8 2 -1. + <_> + 1 1 4 1 2. + <_> + 5 2 4 1 2. + <_> + + <_> + 0 2 4 10 -1. + <_> + 2 2 2 10 2. + <_> + + <_> + 15 11 4 9 -1. + <_> + 16 11 2 9 2. + <_> + + <_> + 8 1 12 3 -1. + <_> + 8 1 6 3 2. + 1 + <_> + + <_> + 0 1 3 6 -1. + <_> + 1 1 1 6 3. + <_> + + <_> + 2 15 3 1 -1. + <_> + 3 15 1 1 3. + <_> + + <_> + 2 1 11 3 -1. + <_> + 2 2 11 1 3. + <_> + + <_> + 6 6 1 2 -1. + <_> + 6 7 1 1 2. + <_> + + <_> + 13 8 3 3 -1. + <_> + 14 9 1 3 3. + 1 + <_> + + <_> + 0 3 12 6 -1. + <_> + 4 5 4 2 9. + <_> + + <_> + 2 6 9 3 -1. + <_> + 5 6 3 3 3. + <_> + + <_> + 1 5 5 4 -1. + <_> + 1 6 5 2 2. + <_> + + <_> + 14 0 2 2 -1. + <_> + 15 0 1 2 2. + <_> + + <_> + 5 0 15 2 -1. + <_> + 10 0 5 2 3. + <_> + + <_> + 10 5 8 1 -1. + <_> + 14 5 4 1 2. + <_> + + <_> + 0 15 12 3 -1. + <_> + 4 16 4 1 9. + <_> + + <_> + 7 16 2 1 -1. + <_> + 8 16 1 1 2. + <_> + + <_> + 0 8 2 12 -1. + <_> + 1 8 1 12 2. + <_> + + <_> + 7 16 2 2 -1. + <_> + 7 16 1 1 2. + <_> + 8 17 1 1 2. + <_> + + <_> + 11 2 2 10 -1. + <_> + 11 2 1 5 2. + <_> + 12 7 1 5 2. + <_> + + <_> + 7 1 2 13 -1. + <_> + 8 1 1 13 2. + <_> + + <_> + 15 14 2 4 -1. + <_> + 14 15 2 2 2. + 1 + <_> + + <_> + 13 7 2 1 -1. + <_> + 13 7 1 1 2. + 1 + <_> + + <_> + 6 8 10 2 -1. + <_> + 6 8 5 1 2. + <_> + 11 9 5 1 2. + <_> + + <_> + 7 6 8 4 -1. + <_> + 7 7 8 2 2. + <_> + + <_> + 9 5 4 2 -1. + <_> + 9 6 4 1 2. + <_> + + <_> + 4 9 10 2 -1. + <_> + 4 9 5 1 2. + <_> + 9 10 5 1 2. + <_> + + <_> + 14 4 6 2 -1. + <_> + 16 6 2 2 3. + 1 + <_> + + <_> + 9 2 3 2 -1. + <_> + 10 3 1 2 3. + 1 + <_> + + <_> + 14 1 2 12 -1. + <_> + 15 1 1 12 2. + <_> + + <_> + 6 0 12 14 -1. + <_> + 10 0 4 14 3. + <_> + + <_> + 16 5 3 4 -1. + <_> + 16 5 3 2 2. + 1 + <_> + + <_> + 0 3 3 3 -1. + <_> + 1 4 1 1 9. + <_> + + <_> + 5 5 8 6 -1. + <_> + 9 5 4 6 2. + <_> + + <_> + 9 7 4 2 -1. + <_> + 10 7 2 2 2. + <_> + + <_> + 0 18 18 2 -1. + <_> + 0 19 18 1 2. + <_> + + <_> + 3 18 16 2 -1. + <_> + 3 19 16 1 2. + <_> + + <_> + 13 17 6 3 -1. + <_> + 13 18 6 1 3. + <_> + + <_> + 1 17 17 3 -1. + <_> + 1 18 17 1 3. + <_> + + <_> + 15 8 1 4 -1. + <_> + 15 9 1 2 2. + <_> + + <_> + 1 9 6 6 -1. + <_> + 1 9 3 3 2. + <_> + 4 12 3 3 2. + <_> + + <_> + 8 15 12 2 -1. + <_> + 12 15 4 2 3. + <_> + + <_> + 4 10 2 1 -1. + <_> + 5 10 1 1 2. + <_> + + <_> + 5 11 2 1 -1. + <_> + 5 11 1 1 2. + 1 + <_> + + <_> + 9 0 6 17 -1. + <_> + 11 0 2 17 3. + <_> + + <_> + 4 1 4 8 -1. + <_> + 4 1 2 4 2. + <_> + 6 5 2 4 2. + <_> + + <_> + 6 13 2 2 -1. + <_> + 6 13 1 2 2. + 1 + <_> + + <_> + 2 19 2 1 -1. + <_> + 3 19 1 1 2. + <_> + + <_> + 0 1 19 3 -1. + <_> + 0 2 19 1 3. + <_> + + <_> + 4 8 13 6 -1. + <_> + 4 11 13 3 2. + <_> + + <_> + 4 2 10 3 -1. + <_> + 4 3 10 1 3. + <_> + + <_> + 4 4 15 9 -1. + <_> + 9 7 5 3 9. + <_> + + <_> + 6 2 2 2 -1. + <_> + 6 2 2 1 2. + 1 + <_> + + <_> + 8 2 3 18 -1. + <_> + 8 11 3 9 2. + <_> + + <_> + 3 16 1 3 -1. + <_> + 3 17 1 1 3. + <_> + + <_> + 3 12 15 2 -1. + <_> + 3 13 15 1 2. + <_> + + <_> + 3 16 6 4 -1. + <_> + 3 16 3 2 2. + <_> + 6 18 3 2 2. + <_> + + <_> + 16 0 2 9 -1. + <_> + 17 0 1 9 2. + <_> + + <_> + 17 9 2 3 -1. + <_> + 17 10 2 1 3. + <_> + + <_> + 14 4 4 4 -1. + <_> + 13 5 4 2 2. + 1 + <_> + + <_> + 11 3 6 6 -1. + <_> + 11 3 3 3 2. + <_> + 14 6 3 3 2. + <_> + + <_> + 3 15 1 4 -1. + <_> + 3 17 1 2 2. + <_> + + <_> + 2 0 2 1 -1. + <_> + 3 0 1 1 2. + <_> + + <_> + 4 9 3 2 -1. + <_> + 5 9 1 2 3. + <_> + + <_> + 7 5 6 9 -1. + <_> + 9 8 2 3 9. + <_> + + <_> + 11 7 2 2 -1. + <_> + 11 7 1 2 2. + 1 + <_> + + <_> + 0 11 5 9 -1. + <_> + 0 14 5 3 3. + <_> + + <_> + 8 10 4 1 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 4 3 1 4 -1. + <_> + 3 4 1 2 2. + 1 + <_> + + <_> + 1 2 18 12 -1. + <_> + 1 2 9 6 2. + <_> + 10 8 9 6 2. + <_> + + <_> + 5 2 1 4 -1. + <_> + 5 2 1 2 2. + 1 + <_> + + <_> + 0 2 2 2 -1. + <_> + 1 2 1 2 2. + <_> + + <_> + 4 2 12 4 -1. + <_> + 4 3 12 2 2. + <_> + + <_> + 7 7 3 3 -1. + <_> + 8 7 1 3 3. + <_> + + <_> + 4 6 6 6 -1. + <_> + 6 6 2 6 3. + <_> + + <_> + 0 6 2 3 -1. + <_> + 0 7 2 1 3. + <_> + + <_> + 17 11 3 3 -1. + <_> + 17 12 3 1 3. + <_> + + <_> + 16 0 3 9 -1. + <_> + 17 0 1 9 3. + <_> + + <_> + 13 1 2 2 -1. + <_> + 14 1 1 2 2. + <_> + + <_> + 4 5 8 9 -1. + <_> + 8 5 4 9 2. + <_> + + <_> + 10 0 2 2 -1. + <_> + 11 0 1 2 2. + <_> + + <_> + 10 3 4 4 -1. + <_> + 10 3 2 2 2. + <_> + 12 5 2 2 2. + <_> + + <_> + 5 0 8 1 -1. + <_> + 7 2 4 1 2. + 1 + <_> + + <_> + 0 3 2 12 -1. + <_> + 0 3 1 6 2. + <_> + 1 9 1 6 2. + <_> + + <_> + 5 8 2 4 -1. + <_> + 4 9 2 2 2. + 1 + <_> + + <_> + 0 1 1 12 -1. + <_> + 0 4 1 6 2. + <_> + + <_> + 16 11 3 6 -1. + <_> + 16 14 3 3 2. + <_> + + <_> + 6 9 1 3 -1. + <_> + 5 10 1 1 3. + 1 + <_> + + <_> + 13 0 4 18 -1. + <_> + 14 0 2 18 2. + <_> + + <_> + 15 11 2 2 -1. + <_> + 16 11 1 2 2. + <_> + + <_> + 15 16 3 3 -1. + <_> + 15 17 3 1 3. + <_> + + <_> + 16 9 4 1 -1. + <_> + 17 10 2 1 2. + 1 + <_> + + <_> + 4 0 8 2 -1. + <_> + 4 0 4 1 2. + <_> + 8 1 4 1 2. + <_> + + <_> + 9 15 8 4 -1. + <_> + 11 15 4 4 2. + <_> + + <_> + 15 18 2 2 -1. + <_> + 15 18 1 1 2. + <_> + 16 19 1 1 2. + <_> + + <_> + 15 2 4 4 -1. + <_> + 15 2 2 2 2. + <_> + 17 4 2 2 2. + <_> + + <_> + 19 5 1 12 -1. + <_> + 19 8 1 6 2. + <_> + + <_> + 15 14 5 3 -1. + <_> + 15 15 5 1 3. + <_> + + <_> + 15 18 2 2 -1. + <_> + 16 18 1 2 2. + <_> + + <_> + 15 18 2 1 -1. + <_> + 16 18 1 1 2. + <_> + + <_> + 0 0 18 2 -1. + <_> + 0 0 9 1 2. + <_> + 9 1 9 1 2. + <_> + + <_> + 5 6 2 4 -1. + <_> + 5 7 2 2 2. + <_> + + <_> + 16 11 2 3 -1. + <_> + 15 12 2 1 3. + 1 + <_> + + <_> + 8 4 4 7 -1. + <_> + 9 5 2 7 2. + 1 + <_> + + <_> + 5 8 2 4 -1. + <_> + 5 9 2 2 2. + <_> + + <_> + 8 9 4 2 -1. + <_> + 9 10 2 2 2. + 1 + <_> + + <_> + 11 10 3 3 -1. + <_> + 12 10 1 3 3. + <_> + + <_> + 15 0 2 5 -1. + <_> + 16 0 1 5 2. + <_> + + <_> + 4 8 3 1 -1. + <_> + 5 9 1 1 3. + 1 + <_> + + <_> + 9 5 1 4 -1. + <_> + 9 7 1 2 2. + <_> + + <_> + 12 11 2 1 -1. + <_> + 13 11 1 1 2. + <_> + + <_> + 9 3 5 10 -1. + <_> + 9 8 5 5 2. + <_> + + <_> + 4 13 9 4 -1. + <_> + 4 15 9 2 2. + <_> + + <_> + 15 2 2 1 -1. + <_> + 16 2 1 1 2. + <_> + + <_> + 7 1 13 6 -1. + <_> + 7 3 13 2 3. + <_> + + <_> + 3 0 15 2 -1. + <_> + 3 1 15 1 2. + <_> + + <_> + 4 0 12 2 -1. + <_> + 4 1 12 1 2. + <_> + + <_> + 17 2 2 4 -1. + <_> + 17 3 2 2 2. + <_> + + <_> + 5 6 4 6 -1. + <_> + 5 6 2 3 2. + <_> + 7 9 2 3 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 7 18 13 2 -1. + <_> + 7 19 13 1 2. + <_> + + <_> + 16 2 1 6 -1. + <_> + 16 4 1 2 3. + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 1 1 2. + <_> + 18 17 1 1 2. + <_> + + <_> + 4 4 5 2 -1. + <_> + 4 4 5 1 2. + 1 + <_> + + <_> + 14 17 2 2 -1. + <_> + 14 17 1 1 2. + <_> + 15 18 1 1 2. + <_> + + <_> + 15 1 2 2 -1. + <_> + 15 1 2 1 2. + 1 + <_> + + <_> + 15 1 2 2 -1. + <_> + 15 1 1 1 2. + <_> + 16 2 1 1 2. + <_> + + <_> + 6 10 3 7 -1. + <_> + 7 10 1 7 3. + <_> + + <_> + 12 9 6 5 -1. + <_> + 15 9 3 5 2. + <_> + + <_> + 7 4 3 6 -1. + <_> + 7 4 3 3 2. + 1 + <_> + + <_> + 2 6 8 10 -1. + <_> + 2 11 8 5 2. + <_> + + <_> + 3 13 2 3 -1. + <_> + 3 14 2 1 3. + <_> + + <_> + 1 11 4 2 -1. + <_> + 1 12 4 1 2. + <_> + + <_> + 5 16 15 4 -1. + <_> + 5 17 15 2 2. + <_> + + <_> + 15 6 2 4 -1. + <_> + 15 7 2 2 2. + <_> + + <_> + 6 2 9 3 -1. + <_> + 6 3 9 1 3. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 8 2 10 3 -1. + <_> + 8 3 10 1 3. + <_> + + <_> + 18 8 2 4 -1. + <_> + 17 9 2 2 2. + 1 + <_> + + <_> + 2 5 1 12 -1. + <_> + 2 11 1 6 2. + <_> + + <_> + 17 13 3 6 -1. + <_> + 18 15 1 2 9. + <_> + + <_> + 13 5 3 2 -1. + <_> + 14 5 1 2 3. + <_> + + <_> + 3 2 3 2 -1. + <_> + 4 2 1 2 3. + <_> + + <_> + 4 4 12 5 -1. + <_> + 7 4 6 5 2. + <_> + + <_> + 5 15 2 2 -1. + <_> + 5 15 1 1 2. + <_> + 6 16 1 1 2. + <_> + + <_> + 10 0 8 3 -1. + <_> + 12 0 4 3 2. + <_> + + <_> + 11 0 8 6 -1. + <_> + 13 0 4 6 2. + <_> + + <_> + 4 1 12 8 -1. + <_> + 10 1 6 8 2. + <_> + + <_> + 18 10 2 3 -1. + <_> + 17 11 2 1 3. + 1 + <_> + + <_> + 12 1 6 3 -1. + <_> + 14 1 2 3 3. + <_> + + <_> + 1 16 1 3 -1. + <_> + 1 17 1 1 3. + <_> + + <_> + 10 9 1 2 -1. + <_> + 10 10 1 1 2. + <_> + + <_> + 19 13 1 4 -1. + <_> + 19 13 1 2 2. + 1 + <_> + + <_> + 9 6 3 6 -1. + <_> + 9 9 3 3 2. + <_> + + <_> + 2 9 18 10 -1. + <_> + 2 9 9 5 2. + <_> + 11 14 9 5 2. + <_> + + <_> + 11 4 5 6 -1. + <_> + 11 4 5 3 2. + 1 + <_> + + <_> + 17 0 2 4 -1. + <_> + 17 1 2 2 2. + <_> + + <_> + 2 3 3 4 -1. + <_> + 3 3 1 4 3. + <_> + + <_> + 19 0 1 10 -1. + <_> + 19 5 1 5 2. + <_> + + <_> + 1 7 6 6 -1. + <_> + 1 7 3 3 2. + <_> + 4 10 3 3 2. + <_> + + <_> + 15 2 3 12 -1. + <_> + 11 6 3 4 3. + 1 + <_> + + <_> + 3 9 7 6 -1. + <_> + 3 11 7 2 3. + <_> + + <_> + 8 8 1 3 -1. + <_> + 8 9 1 1 3. + <_> + + <_> + 4 13 6 6 -1. + <_> + 4 15 6 2 3. + <_> + + <_> + 1 13 4 3 -1. + <_> + 1 14 4 1 3. + <_> + + <_> + 7 1 4 4 -1. + <_> + 7 1 2 2 2. + <_> + 9 3 2 2 2. + <_> + + <_> + 2 4 2 2 -1. + <_> + 2 4 1 1 2. + <_> + 3 5 1 1 2. + <_> + + <_> + 2 4 16 3 -1. + <_> + 2 5 16 1 3. + <_> + + <_> + 0 6 17 3 -1. + <_> + 0 7 17 1 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 7 10 1 3. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalcatface.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalcatface.xml new file mode 100644 index 0000000000000000000000000000000000000000..1c38a8bab222c50f2962713930b7e971c6cc3abc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalcatface.xml @@ -0,0 +1,14382 @@ + + + + + BOOST + HAAR + 24 + 24 + + GAB + 9.9500000476837158e-01 + 5.0000000000000000e-01 + 9.4999999999999996e-01 + 1 + 100 + + 0 + 1 + BASIC + 20 + + + <_> + 16 + -1.4806525707244873e+00 + + <_> + + 0 -1 472 -1.5126220881938934e-02 + + 7.5887596607208252e-01 -3.4230688214302063e-01 + <_> + + 0 -1 839 3.9337221533060074e-03 + + -3.3288389444351196e-01 5.2361363172531128e-01 + <_> + + 0 -1 858 -1.5044892206788063e-02 + + 5.5565774440765381e-01 -2.2505992650985718e-01 + <_> + + 0 -1 387 -1.2927042320370674e-02 + + 5.7442700862884521e-01 -1.9708566367626190e-01 + <_> + + 0 -1 137 5.5960696190595627e-03 + + -3.0430641770362854e-01 4.0241482853889465e-01 + <_> + + 0 -1 207 1.5758406370878220e-02 + + -1.9767063856124878e-01 4.5033392310142517e-01 + <_> + + 0 -1 678 2.4262722581624985e-02 + + -1.6931040585041046e-01 5.9707510471343994e-01 + <_> + + 0 -1 267 -3.5242564976215363e-02 + + 6.5973556041717529e-01 -1.4519356191158295e-01 + <_> + + 0 -1 687 2.6568008586764336e-02 + + -1.3476610183715820e-01 5.4296624660491943e-01 + <_> + + 0 -1 228 4.7154121100902557e-02 + + -1.7337851226329803e-01 4.6071702241897583e-01 + <_> + + 0 -1 925 -5.3081759251654148e-03 + + 5.4976856708526611e-01 -1.1913410574197769e-01 + <_> + + 0 -1 608 5.3415738046169281e-02 + + -1.2382411211729050e-01 6.3972741365432739e-01 + <_> + + 0 -1 671 -3.0798995867371559e-03 + + -8.2048600912094116e-01 1.0249497741460800e-01 + <_> + + 0 -1 676 -2.3766520898789167e-03 + + -7.0665025711059570e-01 6.7025005817413330e-02 + <_> + + 0 -1 180 1.1965663870796561e-03 + + -2.4753804504871368e-01 3.0198124051094055e-01 + <_> + + 0 -1 830 -4.2106406763195992e-03 + + 3.8455343246459961e-01 -1.8334107100963593e-01 + + <_> + 26 + -1.4618960618972778e+00 + + <_> + + 0 -1 725 1.0133055038750172e-02 + + -2.8207325935363770e-01 6.2703561782836914e-01 + <_> + + 0 -1 356 3.8468956947326660e-02 + + -1.4483113586902618e-01 7.4971008300781250e-01 + <_> + + 0 -1 2 -3.7523733917623758e-03 + + 4.2959973216056824e-01 -2.1445912122726440e-01 + <_> + + 0 -1 844 9.9978316575288773e-04 + + -1.9259409606456757e-01 4.2325544357299805e-01 + <_> + + 0 -1 387 -1.6786376014351845e-02 + + 5.0582861900329590e-01 -1.8607729673385620e-01 + <_> + + 0 -1 208 3.0330579727888107e-02 + + -2.1100421249866486e-01 4.2819553613662720e-01 + <_> + + 0 -1 206 1.5150709077715874e-02 + + -2.1129198372364044e-01 3.6263525485992432e-01 + <_> + + 0 -1 451 -3.6349350120872259e-03 + + 3.9500275254249573e-01 -1.8650630116462708e-01 + <_> + + 0 -1 270 -7.2061517275869846e-03 + + -7.2816300392150879e-01 1.1153221875429153e-01 + <_> + + 0 -1 866 -2.0212728530168533e-02 + + 5.6296736001968384e-01 -1.2056054919958115e-01 + <_> + + 0 -1 265 2.5640423409640789e-03 + + -2.3753854632377625e-01 3.5794413089752197e-01 + <_> + + 0 -1 230 -6.2726587057113647e-03 + + -6.7750877141952515e-01 1.2570948898792267e-01 + <_> + + 0 -1 126 7.8710336238145828e-03 + + 6.9211356341838837e-02 -7.6449161767959595e-01 + <_> + + 0 -1 306 5.9134580194950104e-02 + + -1.7324967682361603e-01 3.3361187577247620e-01 + <_> + + 0 -1 185 -2.8770491480827332e-03 + + 3.6101511120796204e-01 -1.6122241318225861e-01 + <_> + + 0 -1 388 -5.7046953588724136e-03 + + -6.7659336328506470e-01 8.4153175354003906e-02 + <_> + + 0 -1 13 -7.8070178627967834e-02 + + 6.0763663053512573e-01 -1.1037797480821609e-01 + <_> + + 0 -1 321 6.5858578309416771e-03 + + 9.3060031533241272e-02 -7.0068693161010742e-01 + <_> + + 0 -1 796 -2.0920131355524063e-03 + + 2.8173315525054932e-01 -1.8406434357166290e-01 + <_> + + 0 -1 578 -2.1252598613500595e-02 + + 3.9672371745109558e-01 -1.5127600729465485e-01 + <_> + + 0 -1 770 -3.2937981188297272e-02 + + 3.9487251639366150e-01 -1.3228580355644226e-01 + <_> + + 0 -1 1016 4.9491915851831436e-03 + + 1.1234261840581894e-01 -4.7414371371269226e-01 + <_> + + 0 -1 215 3.4271054901182652e-03 + + 7.8623600304126740e-02 -5.7828009128570557e-01 + <_> + + 0 -1 200 -6.0859560035169125e-03 + + -5.0091904401779175e-01 9.1926425695419312e-02 + <_> + + 0 -1 990 1.2116413563489914e-02 + + -1.7154470086097717e-01 2.6759135723114014e-01 + <_> + + 0 -1 456 8.2814376801252365e-03 + + -1.2938241660594940e-01 3.5665917396545410e-01 + + <_> + 26 + -1.4103703498840332e+00 + + <_> + + 0 -1 532 -1.0988018475472927e-02 + + 6.4358645677566528e-01 -2.3149165511131287e-01 + <_> + + 0 -1 750 -7.8163212165236473e-03 + + 5.4850798845291138e-01 -1.7881108820438385e-01 + <_> + + 0 -1 289 7.1337133646011353e-02 + + -1.7631703615188599e-01 4.5873588323593140e-01 + <_> + + 0 -1 549 5.2656695246696472e-02 + + -1.3836050033569336e-01 5.6253266334533691e-01 + <_> + + 0 -1 8 1.5166129916906357e-02 + + -2.0990008115768433e-01 4.0483391284942627e-01 + <_> + + 0 -1 970 -1.4538960531353951e-03 + + 3.3692672848701477e-01 -2.1745139360427856e-01 + <_> + + 0 -1 875 1.1136244982481003e-02 + + -1.5003634989261627e-01 5.2208083868026733e-01 + <_> + + 0 -1 925 -3.3187635708600283e-03 + + 3.9145255088806152e-01 -1.9418042898178101e-01 + <_> + + 0 -1 485 4.9791105091571808e-02 + + -1.0192432254552841e-01 5.4612094163894653e-01 + <_> + + 0 -1 828 4.3476112186908722e-02 + + -1.2768918275833130e-01 5.0825607776641846e-01 + <_> + + 0 -1 719 -2.8149634599685669e-03 + + -7.0453292131423950e-01 1.2536850571632385e-01 + <_> + + 0 -1 846 1.6101204091683030e-03 + + -2.6965174078941345e-01 2.2737979888916016e-01 + <_> + + 0 -1 715 -1.5866891480982304e-03 + + -6.6891485452651978e-01 1.1686278134584427e-01 + <_> + + 0 -1 677 -3.2338392920792103e-03 + + -6.7284232378005981e-01 6.6228114068508148e-02 + <_> + + 0 -1 479 -9.9909156560897827e-03 + + 3.6961549520492554e-01 -1.5993835031986237e-01 + <_> + + 0 -1 350 4.8409838229417801e-02 + + -1.0068884491920471e-01 5.0648134946823120e-01 + <_> + + 0 -1 273 8.0585200339555740e-03 + + -1.6782654821872711e-01 3.5382467508316040e-01 + <_> + + 0 -1 338 -1.1718695983290672e-02 + + 4.3832498788833618e-01 -1.2780784070491791e-01 + <_> + + 0 -1 594 5.7147610932588577e-03 + + 7.5814604759216309e-02 -7.2597140073776245e-01 + <_> + + 0 -1 603 -2.0917234942317009e-03 + + -6.0916984081268311e-01 8.4811411798000336e-02 + <_> + + 0 -1 855 5.7651996612548828e-03 + + -1.9243443012237549e-01 2.8976503014564514e-01 + <_> + + 0 -1 565 -2.8093710541725159e-02 + + 5.4229170083999634e-01 -1.0005526244640350e-01 + <_> + + 0 -1 136 8.9291334152221680e-03 + + 8.3808921277523041e-02 -6.3219338655471802e-01 + <_> + + 0 -1 268 -5.1958961412310600e-03 + + -5.4964137077331543e-01 7.9588212072849274e-02 + <_> + + 0 -1 95 9.2318728566169739e-03 + + -1.2818163633346558e-01 4.2056322097778320e-01 + <_> + + 0 -1 964 -2.0556427538394928e-02 + + 3.2048463821411133e-01 -1.3858842849731445e-01 + + <_> + 35 + -1.4265209436416626e+00 + + <_> + + 0 -1 683 1.8821602687239647e-02 + + -1.7807419598102570e-01 5.9040957689285278e-01 + <_> + + 0 -1 471 -9.5066539943218231e-03 + + 5.0587177276611328e-01 -1.7767964303493500e-01 + <_> + + 0 -1 884 1.3296608813107014e-03 + + -1.6886346042156219e-01 3.6326614022254944e-01 + <_> + + 0 -1 473 3.5266026854515076e-02 + + -1.1824090778827667e-01 5.8951085805892944e-01 + <_> + + 0 -1 340 1.7804209142923355e-02 + + -1.4211210608482361e-01 5.1762068271636963e-01 + <_> + + 0 -1 1001 4.7029324923641980e-04 + + -2.4296821653842926e-01 2.5087893009185791e-01 + <_> + + 0 -1 182 7.1838246658444405e-03 + + 9.2609666287899017e-02 -6.7694115638732910e-01 + <_> + + 0 -1 390 -5.7565318420529366e-03 + + -7.3053181171417236e-01 8.2794629037380219e-02 + <_> + + 0 -1 203 2.0850602537393570e-02 + + -1.7353208363056183e-01 3.3287450671195984e-01 + <_> + + 0 -1 805 3.1848326325416565e-03 + + -2.0941653847694397e-01 2.6059800386428833e-01 + <_> + + 0 -1 234 -7.5752258300781250e-02 + + 5.1588213443756104e-01 -1.0057342052459717e-01 + <_> + + 0 -1 5 2.8725115582346916e-02 + + -1.5012685954570770e-01 4.1436919569969177e-01 + <_> + + 0 -1 175 -1.7325732856988907e-02 + + 3.8678762316703796e-01 -1.3586300611495972e-01 + <_> + + 0 -1 47 -3.2187681645154953e-03 + + -5.1590150594711304e-01 1.1511231958866119e-01 + <_> + + 0 -1 1020 -6.1595086008310318e-03 + + -7.0271849632263184e-01 5.5648274719715118e-02 + <_> + + 0 -1 768 -8.7264683097600937e-03 + + 2.6393634080886841e-01 -1.8446569144725800e-01 + <_> + + 0 -1 57 8.1868227571249008e-03 + + 8.0838531255722046e-02 -5.5512112379074097e-01 + <_> + + 0 -1 139 -7.8468751162290573e-03 + + -5.7306796312332153e-01 8.3454042673110962e-02 + <_> + + 0 -1 665 2.9962153639644384e-03 + + 6.2645487487316132e-02 -5.8123600482940674e-01 + <_> + + 0 -1 414 -4.3795984238386154e-03 + + 2.2211562097072601e-01 -1.9649308919906616e-01 + <_> + + 0 -1 908 -6.3172029331326485e-03 + + -6.6067039966583252e-01 6.4884319901466370e-02 + <_> + + 0 -1 465 1.3302030274644494e-03 + + -1.0496762394905090e-01 4.2326071858406067e-01 + <_> + + 0 -1 951 -4.3333107605576515e-03 + + -4.9972066283226013e-01 8.7225496768951416e-02 + <_> + + 0 -1 244 -3.5346355289220810e-03 + + 3.0818134546279907e-01 -1.4765550196170807e-01 + <_> + + 0 -1 256 -8.7353587150573730e-03 + + -6.5214675664901733e-01 7.1881487965583801e-02 + <_> + + 0 -1 491 -1.5620354562997818e-02 + + 3.5721915960311890e-01 -1.1427627503871918e-01 + <_> + + 0 -1 778 -3.9745438843965530e-03 + + -6.6090464591979980e-01 6.2067609280347824e-02 + <_> + + 0 -1 689 -6.7040426656603813e-03 + + 2.7337384223937988e-01 -1.4059108495712280e-01 + <_> + + 0 -1 125 3.5359347239136696e-03 + + 6.1201948672533035e-02 -6.0017114877700806e-01 + <_> + + 0 -1 118 6.0818484053015709e-03 + + -1.5247075259685516e-01 2.4383027851581573e-01 + <_> + + 0 -1 880 -7.2771648410707712e-04 + + 3.0065426230430603e-01 -1.2037902325391769e-01 + <_> + + 0 -1 643 4.6168416738510132e-03 + + 5.5311698466539383e-02 -7.5343269109725952e-01 + <_> + + 0 -1 676 2.5280299596488476e-03 + + 5.7204965502023697e-02 -5.3993463516235352e-01 + <_> + + 0 -1 878 1.5074670314788818e-02 + + -9.6106290817260742e-02 3.9084190130233765e-01 + <_> + + 0 -1 831 -8.4932018071413040e-03 + + 3.4130987524986267e-01 -1.4117397367954254e-01 + + <_> + 37 + -1.3977209329605103e+00 + + <_> + + 0 -1 794 -2.5338861159980297e-03 + + 5.7321399450302124e-01 -2.0396080613136292e-01 + <_> + + 0 -1 588 -6.5112011507153511e-03 + + 3.7378740310668945e-01 -2.5049039721488953e-01 + <_> + + 0 -1 238 1.6318978741765022e-03 + + -2.1858637034893036e-01 3.5027471184730530e-01 + <_> + + 0 -1 189 3.3452022820711136e-02 + + -1.4827065169811249e-01 4.7324529290199280e-01 + <_> + + 0 -1 192 -1.1114047840237617e-02 + + 4.1662359237670898e-01 -2.1660456061363220e-01 + <_> + + 0 -1 527 -1.2996498262509704e-03 + + 4.7613915801048279e-01 -1.6742442548274994e-01 + <_> + + 0 -1 648 -3.2986078877002001e-03 + + -6.7662662267684937e-01 8.6653761565685272e-02 + <_> + + 0 -1 4 6.6831205040216446e-03 + + -2.0158858597278595e-01 2.6189696788787842e-01 + <_> + + 0 -1 482 2.1282089874148369e-03 + + -1.1156299710273743e-01 4.0097075700759888e-01 + <_> + + 0 -1 682 -9.0472139418125153e-03 + + 3.2078295946121216e-01 -1.6775439679622650e-01 + <_> + + 0 -1 226 -5.3160609677433968e-03 + + -5.5567348003387451e-01 1.2950280308723450e-01 + <_> + + 0 -1 205 7.9724024981260300e-03 + + -2.1466700732707977e-01 2.2514854371547699e-01 + <_> + + 0 -1 920 -2.1980279125273228e-03 + + 2.8711742162704468e-01 -1.6561916470527649e-01 + <_> + + 0 -1 312 5.3897619247436523e-02 + + -1.4823001623153687e-01 3.4951418638229370e-01 + <_> + + 0 -1 13 -7.6241128146648407e-02 + + 6.0101884603500366e-01 -8.8328786194324493e-02 + <_> + + 0 -1 129 -8.3202747628092766e-03 + + -7.2828358411788940e-01 8.7956465780735016e-02 + <_> + + 0 -1 401 5.3778752684593201e-02 + + -1.0316975414752960e-01 5.0247919559478760e-01 + <_> + + 0 -1 416 -1.2401826679706573e-02 + + 2.7538898587226868e-01 -1.5569972991943359e-01 + <_> + + 0 -1 986 1.3729928061366081e-02 + + -1.3373774290084839e-01 3.0739122629165649e-01 + <_> + + 0 -1 905 -2.2788168862462044e-03 + + 2.2555501759052277e-01 -1.9497908651828766e-01 + <_> + + 0 -1 667 3.6288173869252205e-03 + + 4.8981692641973495e-02 -7.9248648881912231e-01 + <_> + + 0 -1 85 5.2453137934207916e-02 + + -1.3389803469181061e-01 3.2700663805007935e-01 + <_> + + 0 -1 821 3.1685843132436275e-03 + + -1.4415425062179565e-01 2.8044179081916809e-01 + <_> + + 0 -1 193 8.9051481336355209e-03 + + 6.1227656900882721e-02 -7.0277702808380127e-01 + <_> + + 0 -1 837 -1.3966157566756010e-03 + + 4.2409667372703552e-01 -1.0888981819152832e-01 + <_> + + 0 -1 271 -6.7695947363972664e-03 + + -5.1588076353073120e-01 8.3254821598529816e-02 + <_> + + 0 -1 404 2.2157761268317699e-03 + + -1.3696527481079102e-01 2.8638482093811035e-01 + <_> + + 0 -1 619 2.7808796148747206e-03 + + 7.1316704154014587e-02 -6.0322999954223633e-01 + <_> + + 0 -1 515 4.5836241915822029e-03 + + -1.2486589699983597e-01 3.2929363846778870e-01 + <_> + + 0 -1 1042 -5.1459800451993942e-03 + + -5.3781992197036743e-01 7.6631128787994385e-02 + <_> + + 0 -1 1043 2.4449056945741177e-03 + + 8.5920669138431549e-02 -4.0670683979988098e-01 + <_> + + 0 -1 71 -2.7756379917263985e-02 + + 3.7449231743812561e-01 -1.0538945347070694e-01 + <_> + + 0 -1 809 -1.8243372440338135e-02 + + 3.4281516075134277e-01 -9.9502928555011749e-02 + <_> + + 0 -1 372 3.8416781462728977e-03 + + 7.3987491428852081e-02 -4.8903524875640869e-01 + <_> + + 0 -1 376 -1.2322908267378807e-02 + + 2.1036790311336517e-01 -1.5852701663970947e-01 + <_> + + 0 -1 391 -4.1760304011404514e-03 + + 3.1288132071495056e-01 -1.1697492748498917e-01 + <_> + + 0 -1 859 -2.8026863932609558e-02 + + 3.3711743354797363e-01 -1.2294299900531769e-01 + + <_> + 42 + -1.3775455951690674e+00 + + <_> + + 0 -1 725 1.3382414355874062e-02 + + -1.7922241985797882e-01 5.0368404388427734e-01 + <_> + + 0 -1 967 1.9935802556574345e-03 + + -2.5249919295310974e-01 3.5295018553733826e-01 + <_> + + 0 -1 891 -1.3569685397669673e-03 + + 4.1222429275512695e-01 -1.8140394985675812e-01 + <_> + + 0 -1 911 2.5418698787689209e-03 + + -2.3195247352123260e-01 2.5945317745208740e-01 + <_> + + 0 -1 362 1.1867792345583439e-03 + + -1.1509010195732117e-01 4.0095508098602295e-01 + <_> + + 0 -1 280 -4.0491363033652306e-03 + + -7.6275551319122314e-01 8.0663219094276428e-02 + <_> + + 0 -1 264 2.4698153138160706e-02 + + -9.9053405225276947e-02 4.6469488739967346e-01 + <_> + + 0 -1 832 1.3041709549725056e-02 + + -1.3049817085266113e-01 4.7066822648048401e-01 + <_> + + 0 -1 257 -2.0927201956510544e-02 + + -7.2363191843032837e-01 7.5520738959312439e-02 + <_> + + 0 -1 41 1.6108792275190353e-02 + + 8.9385204017162323e-02 -5.0678378343582153e-01 + <_> + + 0 -1 872 -8.6308103054761887e-03 + + 3.1878158450126648e-01 -1.3526505231857300e-01 + <_> + + 0 -1 347 1.2651814613491297e-03 + + -1.2344279885292053e-01 4.0271109342575073e-01 + <_> + + 0 -1 735 -3.0170590616762638e-03 + + -5.6960099935531616e-01 7.0437252521514893e-02 + <_> + + 0 -1 538 -3.5529488231986761e-03 + + 2.0624065399169922e-01 -1.8426756560802460e-01 + <_> + + 0 -1 735 2.8021419420838356e-03 + + 7.2748780250549316e-02 -5.3796368837356567e-01 + <_> + + 0 -1 447 -9.9331419914960861e-04 + + 2.4827398359775543e-01 -1.5866567194461823e-01 + <_> + + 0 -1 440 -7.1950745768845081e-03 + + -5.0943744182586670e-01 7.3041573166847229e-02 + <_> + + 0 -1 906 -8.7737981230020523e-03 + + 2.4838714301586151e-01 -1.5162147581577301e-01 + <_> + + 0 -1 608 5.6750684976577759e-02 + + -8.4416143596172333e-02 4.4269657135009766e-01 + <_> + + 0 -1 772 1.8110256642103195e-03 + + -1.7787678539752960e-01 2.2753682732582092e-01 + <_> + + 0 -1 117 6.1733853071928024e-02 + + -1.4452947676181793e-01 2.6785543560981750e-01 + <_> + + 0 -1 718 1.7999792471528053e-03 + + 5.3869031369686127e-02 -7.0216673612594604e-01 + <_> + + 0 -1 718 -1.7839821521192789e-03 + + -7.3474282026290894e-01 4.3809492141008377e-02 + <_> + + 0 -1 795 -2.2269869223237038e-03 + + 2.5256577134132385e-01 -1.4765015244483948e-01 + <_> + + 0 -1 845 7.7408831566572189e-04 + + -1.6781617701053619e-01 2.5267890095710754e-01 + <_> + + 0 -1 710 9.6316616982221603e-03 + + 5.8525908738374710e-02 -6.3684886693954468e-01 + <_> + + 0 -1 181 -1.1892126873135567e-02 + + 2.6363542675971985e-01 -1.4106634259223938e-01 + <_> + + 0 -1 326 4.8407237976789474e-02 + + -1.0837136209011078e-01 3.6018091440200806e-01 + <_> + + 0 -1 572 -1.0315750539302826e-01 + + -7.3309695720672607e-01 6.4976803958415985e-02 + <_> + + 0 -1 415 -2.6544972788542509e-03 + + 2.7709859609603882e-01 -1.3764445483684540e-01 + <_> + + 0 -1 1033 -4.8850756138563156e-03 + + -5.0026285648345947e-01 6.8797707557678223e-02 + <_> + + 0 -1 299 -1.1310833506286144e-02 + + 2.5653550028800964e-01 -1.3755545020103455e-01 + <_> + + 0 -1 152 -3.8394361734390259e-02 + + 2.6404461264610291e-01 -1.3614650070667267e-01 + <_> + + 0 -1 486 5.8298893272876740e-03 + + 6.0382172465324402e-02 -5.9578329324722290e-01 + <_> + + 0 -1 393 2.2631133906543255e-03 + + -1.0302778333425522e-01 3.4782779216766357e-01 + <_> + + 0 -1 629 -1.8709234893321991e-02 + + -7.6758313179016113e-01 4.6181913465261459e-02 + <_> + + 0 -1 67 3.7359733134508133e-02 + + -1.3407541811466217e-01 2.5607112050056458e-01 + <_> + + 0 -1 504 -5.3099328652024269e-03 + + -6.9016355276107788e-01 4.7683756798505783e-02 + <_> + + 0 -1 527 -1.5396323287859559e-03 + + 3.7874689698219299e-01 -9.2663109302520752e-02 + <_> + + 0 -1 470 -2.6333518326282501e-03 + + 2.9358446598052979e-01 -1.2460695207118988e-01 + <_> + + 0 -1 171 1.6515964642167091e-02 + + -1.4082725346088409e-01 2.3664724826812744e-01 + <_> + + 0 -1 681 -4.4658156111836433e-03 + + -5.9253305196762085e-01 5.5994171649217606e-02 + + <_> + 50 + -1.3835698366165161e+00 + + <_> + + 0 -1 898 1.5156399458646774e-03 + + -1.0024535655975342e-01 5.8807808160781860e-01 + <_> + + 0 -1 802 -3.5168868489563465e-03 + + 4.0972998738288879e-01 -1.6088742017745972e-01 + <_> + + 0 -1 180 2.3035616613924503e-03 + + -1.8985269963741302e-01 2.9883998632431030e-01 + <_> + + 0 -1 254 4.5840561389923096e-02 + + -1.4383240044116974e-01 4.7528687119483948e-01 + <_> + + 0 -1 405 5.5156396701931953e-03 + + -1.7356806993484497e-01 3.4583050012588501e-01 + <_> + + 0 -1 436 3.9731184951961040e-03 + + 7.8886620700359344e-02 -5.6442558765411377e-01 + <_> + + 0 -1 412 -5.6995991617441177e-03 + + -4.7576662898063660e-01 9.4875656068325043e-02 + <_> + + 0 -1 539 -9.6501735970377922e-03 + + 2.3381656408309937e-01 -1.8310526013374329e-01 + <_> + + 0 -1 209 6.1656545847654343e-02 + + -1.4697165787220001e-01 3.6247691512107849e-01 + <_> + + 0 -1 398 1.1418928205966949e-01 + + -8.8033527135848999e-02 4.4633501768112183e-01 + <_> + + 0 -1 3 -1.1903396807610989e-02 + + 3.3496665954589844e-01 -1.2121009081602097e-01 + <_> + + 0 -1 546 -4.1371315717697144e-02 + + 4.1400006413459778e-01 -9.7229279577732086e-02 + <_> + + 0 -1 380 7.8342631459236145e-03 + + -1.6631671786308289e-01 2.5738984346389771e-01 + <_> + + 0 -1 304 -4.5139621943235397e-03 + + -4.6883803606033325e-01 8.7662570178508759e-02 + <_> + + 0 -1 929 1.5914421528577805e-03 + + -1.1636006087064743e-01 3.2739594578742981e-01 + <_> + + 0 -1 942 -5.2607608959078789e-03 + + -6.7755740880966187e-01 5.1752120256423950e-02 + <_> + + 0 -1 941 3.1824512407183647e-03 + + 5.2379645407199860e-02 -6.0918039083480835e-01 + <_> + + 0 -1 939 -3.6813789047300816e-03 + + 4.8251116275787354e-01 -9.2318780720233917e-02 + <_> + + 0 -1 622 -4.3226117268204689e-03 + + -5.7561415433883667e-01 5.9672243893146515e-02 + <_> + + 0 -1 250 -7.1843853220343590e-03 + + 2.6631006598472595e-01 -1.4015418291091919e-01 + <_> + + 0 -1 871 2.1028071641921997e-03 + + -1.1286304146051407e-01 3.5946926474571228e-01 + <_> + + 0 -1 22 8.5248583927750587e-03 + + 6.9424033164978027e-02 -5.2462881803512573e-01 + <_> + + 0 -1 147 6.9785099476575851e-03 + + 5.6668873876333237e-02 -5.6192052364349365e-01 + <_> + + 0 -1 474 -5.2639590576291084e-03 + + -5.8648955821990967e-01 5.0352573394775391e-02 + <_> + + 0 -1 406 2.8417459689080715e-03 + + -1.3425759971141815e-01 2.7325555682182312e-01 + <_> + + 0 -1 394 -1.3187457807362080e-02 + + 4.0453648567199707e-01 -9.1843754053115845e-02 + <_> + + 0 -1 722 -6.7344801500439644e-03 + + -7.5647395849227905e-01 5.0157479941844940e-02 + <_> + + 0 -1 187 2.1363141015172005e-02 + + 4.7982390969991684e-02 -5.5388218164443970e-01 + <_> + + 0 -1 623 1.6145884292200208e-03 + + 7.9808227717876434e-02 -3.7233716249465942e-01 + <_> + + 0 -1 525 -2.2595757618546486e-03 + + 2.8343635797500610e-01 -1.1216876655817032e-01 + <_> + + 0 -1 214 1.4407988637685776e-02 + + -1.0392460227012634e-01 3.1299999356269836e-01 + <_> + + 0 -1 476 -1.4912552433088422e-03 + + 2.8538599610328674e-01 -1.0644508898258209e-01 + <_> + + 0 -1 195 9.8895151168107986e-03 + + 5.0090074539184570e-02 -6.2053185701370239e-01 + <_> + + 0 -1 115 4.2754956521093845e-03 + + 6.5051443874835968e-02 -4.2582303285598755e-01 + <_> + + 0 -1 754 -2.5489409454166889e-03 + + 3.1278640031814575e-01 -9.9601686000823975e-02 + <_> + + 0 -1 717 -6.0358326882123947e-03 + + 2.2685267031192780e-01 -1.3849361240863800e-01 + <_> + + 0 -1 875 1.1879121884703636e-02 + + -8.9687183499336243e-02 3.7642294168472290e-01 + <_> + + 0 -1 111 1.2982923537492752e-02 + + 4.3990727514028549e-02 -7.3371982574462891e-01 + <_> + + 0 -1 993 -2.8599319048225880e-03 + + -4.3102917075157166e-01 5.9561621397733688e-02 + <_> + + 0 -1 737 -3.5829999251291156e-04 + + 1.7152757942676544e-01 -1.6511310636997223e-01 + <_> + + 0 -1 27 2.5972571223974228e-02 + + -1.2855969369411469e-01 2.2820757329463959e-01 + <_> + + 0 -1 516 4.2565623298287392e-03 + + 5.7662181556224823e-02 -5.3734982013702393e-01 + <_> + + 0 -1 50 -2.9159568250179291e-02 + + -6.3020753860473633e-01 4.0746636688709259e-02 + <_> + + 0 -1 413 3.1341956928372383e-03 + + -8.1374719738960266e-02 4.1371321678161621e-01 + <_> + + 0 -1 935 -1.3592604082077742e-03 + + 3.2382342219352722e-01 -9.7880341112613678e-02 + <_> + + 0 -1 758 -6.9904811680316925e-03 + + -6.8850576877593994e-01 4.2428225278854370e-02 + <_> + + 0 -1 93 -8.7879784405231476e-03 + + -5.8945190906524658e-01 3.7613209336996078e-02 + <_> + + 0 -1 491 -1.7947785556316376e-02 + + 3.1659606099128723e-01 -8.7437197566032410e-02 + <_> + + 0 -1 490 8.0379713326692581e-03 + + -1.1311284452676773e-01 3.0860018730163574e-01 + <_> + + 0 -1 716 3.0642822384834290e-03 + + 4.8351831734180450e-02 -6.0563534498214722e-01 + + <_> + 54 + -1.3756012916564941e+00 + + <_> + + 0 -1 798 -1.7431776504963636e-03 + + 5.5538344383239746e-01 -1.0357239097356796e-01 + <_> + + 0 -1 425 4.4551412574946880e-03 + + -1.2460361421108246e-01 5.1942145824432373e-01 + <_> + + 0 -1 843 3.5308140795677900e-03 + + -2.2974169254302979e-01 2.7043044567108154e-01 + <_> + + 0 -1 532 -1.5887852758169174e-02 + + 4.1745069622993469e-01 -1.1281611770391464e-01 + <_> + + 0 -1 7 1.1611310765147209e-02 + + -1.9416445493698120e-01 2.5554594397544861e-01 + <_> + + 0 -1 935 1.5740045346319675e-03 + + -1.2263108044862747e-01 3.8852572441101074e-01 + <_> + + 0 -1 547 5.1882643252611160e-02 + + -7.5461924076080322e-02 5.0257563591003418e-01 + <_> + + 0 -1 251 -3.8624972105026245e-02 + + 4.0001305937767029e-01 -9.6231088042259216e-02 + <_> + + 0 -1 272 -3.9408572018146515e-02 + + 3.0533725023269653e-01 -1.6677139699459076e-01 + <_> + + 0 -1 29 7.5884531252086163e-03 + + 9.8107770085334778e-02 -5.8249044418334961e-01 + <_> + + 0 -1 218 7.2114326059818268e-02 + + -1.4419755339622498e-01 2.8208708763122559e-01 + <_> + + 0 -1 268 5.5582458153367043e-03 + + 7.2843901813030243e-02 -5.5255079269409180e-01 + <_> + + 0 -1 877 -4.7345291823148727e-03 + + 3.3209753036499023e-01 -1.2499606609344482e-01 + <_> + + 0 -1 577 5.1413839682936668e-03 + + 6.4787313342094421e-02 -6.4880597591400146e-01 + <_> + + 0 -1 999 5.4608630016446114e-03 + + 3.7491828203201294e-02 -7.5315922498703003e-01 + <_> + + 0 -1 542 -8.6404485045932233e-05 + + 1.7464619874954224e-01 -1.8258170783519745e-01 + <_> + + 0 -1 442 6.1132330447435379e-03 + + 7.5624085962772369e-02 -4.3711006641387939e-01 + <_> + + 0 -1 889 -7.0670098066329956e-03 + + 2.1796958148479462e-01 -1.4547325670719147e-01 + <_> + + 0 -1 347 9.4080460257828236e-04 + + -1.2536728382110596e-01 2.8143358230590820e-01 + <_> + + 0 -1 580 -2.6800869964063168e-03 + + -4.2977494001388550e-01 8.2963027060031891e-02 + <_> + + 0 -1 297 5.8945640921592712e-03 + + 4.2834181338548660e-02 -6.0937494039535522e-01 + <_> + + 0 -1 465 1.0121082887053490e-03 + + -1.1036285758018494e-01 2.9971688985824585e-01 + <_> + + 0 -1 56 3.1157936900854111e-03 + + 7.3115289211273193e-02 -4.3226471543312073e-01 + <_> + + 0 -1 411 -3.3052214421331882e-03 + + -4.9826300144195557e-01 5.1225960254669189e-02 + <_> + + 0 -1 109 8.3188470453023911e-03 + + 5.0362452864646912e-02 -4.8688000440597534e-01 + <_> + + 0 -1 393 -2.5094528682529926e-03 + + 2.6902040839195251e-01 -1.0433372855186462e-01 + <_> + + 0 -1 924 1.1217880528420210e-03 + + -1.1188100278377533e-01 3.1254816055297852e-01 + <_> + + 0 -1 716 -2.9259414877742529e-03 + + -5.7495939731597900e-01 5.3564101457595825e-02 + <_> + + 0 -1 733 -1.1687271296977997e-02 + + 2.5880128145217896e-01 -1.0639669001102448e-01 + <_> + + 0 -1 763 3.5054073669016361e-03 + + 5.4045904427766800e-02 -5.5625277757644653e-01 + <_> + + 0 -1 552 1.9068794324994087e-02 + + -1.1246301978826523e-01 2.5745245814323425e-01 + <_> + + 0 -1 230 4.6145436353981495e-03 + + 6.7216314375400543e-02 -4.1385611891746521e-01 + <_> + + 0 -1 857 -8.2267355173826218e-03 + + 2.1265375614166260e-01 -1.3443692028522491e-01 + <_> + + 0 -1 149 -1.4355888590216637e-02 + + 2.5618723034858704e-01 -1.0785522311925888e-01 + <_> + + 0 -1 61 8.0431215465068817e-03 + + -1.4258129894733429e-01 2.2692860662937164e-01 + <_> + + 0 -1 170 -5.6914249435067177e-03 + + -4.8886317014694214e-01 6.0331270098686218e-02 + <_> + + 0 -1 133 -2.5912215933203697e-03 + + 2.1062785387039185e-01 -1.4967896044254303e-01 + <_> + + 0 -1 461 5.5204275995492935e-03 + + -8.1333734095096588e-02 3.8316065073013306e-01 + <_> + + 0 -1 515 5.3790090605616570e-03 + + -9.3129634857177734e-02 3.2883483171463013e-01 + <_> + + 0 -1 199 -7.2196200489997864e-03 + + -6.6427856683731079e-01 4.4702950865030289e-02 + <_> + + 0 -1 94 -8.3873540163040161e-02 + + -7.9910254478454590e-01 2.7107261121273041e-02 + <_> + + 0 -1 513 -3.4268260933458805e-03 + + 2.5298807024955750e-01 -1.0898132622241974e-01 + <_> + + 0 -1 763 -3.7466005887836218e-03 + + -5.5346089601516724e-01 5.2094604820013046e-02 + <_> + + 0 -1 276 1.2452949304133654e-03 + + -8.2017965614795685e-02 3.5483068227767944e-01 + <_> + + 0 -1 1013 -6.2445802614092827e-03 + + -5.0969594717025757e-01 5.4533429443836212e-02 + <_> + + 0 -1 276 -1.1970927007496357e-03 + + 3.6470764875411987e-01 -7.7394872903823853e-02 + <_> + + 0 -1 757 3.0796977225691080e-03 + + 5.3208738565444946e-02 -5.0689512491226196e-01 + <_> + + 0 -1 33 -3.9015077054500580e-02 + + 1.9598089158535004e-01 -1.3218660652637482e-01 + <_> + + 0 -1 680 -7.7085788361728191e-03 + + 2.2754703462123871e-01 -1.2544488906860352e-01 + <_> + + 0 -1 655 3.2509677112102509e-02 + + -6.7099742591381073e-02 4.1469818353652954e-01 + <_> + + 0 -1 569 3.0232844874262810e-03 + + 6.6373795270919800e-02 -4.2127549648284912e-01 + <_> + + 0 -1 54 2.5392756797373295e-03 + + -1.1576391756534576e-01 2.3464009165763855e-01 + <_> + + 0 -1 1013 6.8497275933623314e-03 + + 4.5596633106470108e-02 -5.8435302972793579e-01 + <_> + + 0 -1 231 -4.4358119368553162e-02 + + -3.9718165993690491e-01 6.2707424163818359e-02 + + <_> + 63 + -1.4057025909423828e+00 + + <_> + + 0 -1 804 5.0806580111384392e-03 + + -7.9617008566856384e-02 5.6362086534500122e-01 + <_> + + 0 -1 965 2.0602284930646420e-03 + + -1.8717131018638611e-01 3.4062680602073669e-01 + <_> + + 0 -1 495 6.1347078531980515e-02 + + -1.3253036141395569e-01 4.0938606858253479e-01 + <_> + + 0 -1 13 -6.0383215546607971e-02 + + 4.1172346472740173e-01 -1.4447186887264252e-01 + <_> + + 0 -1 478 -3.0238348990678787e-03 + + 3.4262558817863464e-01 -1.0982885956764221e-01 + <_> + + 0 -1 458 4.0474245324730873e-03 + + 7.1186766028404236e-02 -5.0650447607040405e-01 + <_> + + 0 -1 633 -2.0359824411571026e-03 + + 2.2166600823402405e-01 -1.6060648858547211e-01 + <_> + + 0 -1 887 2.7303429305902682e-05 + + -2.6211214065551758e-01 1.2801185250282288e-01 + <_> + + 0 -1 352 1.2323079630732536e-02 + + 8.2502633333206177e-02 -4.5231887698173523e-01 + <_> + + 0 -1 878 2.2477287799119949e-02 + + -7.7229477465152740e-02 4.5144733786582947e-01 + <_> + + 0 -1 395 -1.4673802070319653e-02 + + 3.5660189390182495e-01 -1.1584777384996414e-01 + <_> + + 0 -1 141 9.9029816687107086e-02 + + -1.6957059502601624e-01 2.2625257074832916e-01 + <_> + + 0 -1 144 -1.0632930323481560e-02 + + -5.6829780340194702e-01 7.1929946541786194e-02 + <_> + + 0 -1 808 2.5341216474771500e-02 + + -1.2931844592094421e-01 2.6161769032478333e-01 + <_> + + 0 -1 816 5.8172484859824181e-03 + + -1.5375703573226929e-01 2.0636843144893646e-01 + <_> + + 0 -1 68 -2.0786169171333313e-01 + + 3.9931070804595947e-01 -7.7051497995853424e-02 + <_> + + 0 -1 140 2.2137831151485443e-01 + + -7.2486869990825653e-02 3.9756566286087036e-01 + <_> + + 0 -1 554 3.4148676786571741e-04 + + -1.5928100049495697e-01 1.8005076050758362e-01 + <_> + + 0 -1 307 -6.7202709615230560e-03 + + -6.7838191986083984e-01 4.5886330306529999e-02 + <_> + + 0 -1 392 1.4110710471868515e-03 + + -9.7257830202579498e-02 3.2224002480506897e-01 + <_> + + 0 -1 266 4.2120069265365601e-02 + + -8.8405482470989227e-02 3.2538983225822449e-01 + <_> + + 0 -1 242 -1.3846142683178186e-03 + + 2.0695628225803375e-01 -1.5275791287422180e-01 + <_> + + 0 -1 817 3.5425978712737560e-03 + + -1.2709444761276245e-01 2.1816165745258331e-01 + <_> + + 0 -1 959 3.3351695165038109e-03 + + 4.8398405313491821e-02 -6.0871434211730957e-01 + <_> + + 0 -1 958 -3.3201207406818867e-03 + + -4.8987022042274475e-01 5.5623263120651245e-02 + <_> + + 0 -1 915 1.0103111853823066e-03 + + -1.5765775740146637e-01 1.6940611600875854e-01 + <_> + + 0 -1 151 4.9717966467142105e-03 + + 5.1272217184305191e-02 -5.4395431280136108e-01 + <_> + + 0 -1 799 1.7913591582328081e-03 + + -7.2745941579341888e-02 4.0087917447090149e-01 + <_> + + 0 -1 102 -1.3228422030806541e-02 + + -3.5441592335700989e-01 7.9325266182422638e-02 + <_> + + 0 -1 276 2.0421743392944336e-03 + + -5.9137169271707535e-02 4.6143886446952820e-01 + <_> + + 0 -1 276 -5.9784355107694864e-04 + + 2.5433012843132019e-01 -1.0601133853197098e-01 + <_> + + 0 -1 396 -5.1422840915620327e-03 + + -4.4627833366394043e-01 6.1951976269483566e-02 + <_> + + 0 -1 86 6.4243013039231300e-03 + + 3.1528502702713013e-02 -7.2403544187545776e-01 + <_> + + 0 -1 1035 3.4636156633496284e-03 + + 3.7317775189876556e-02 -5.4165351390838623e-01 + <_> + + 0 -1 14 3.2000489532947540e-02 + + 3.0169567093253136e-02 -7.1302002668380737e-01 + <_> + + 0 -1 498 -5.8225672692060471e-03 + + -4.4310861825942993e-01 4.7724053263664246e-02 + <_> + + 0 -1 24 -8.4763765335083008e-03 + + -6.0832363367080688e-01 3.6428902298212051e-02 + <_> + + 0 -1 598 2.7582058683037758e-03 + + -1.0180406272411346e-01 2.4450653791427612e-01 + <_> + + 0 -1 695 -3.0314538162201643e-03 + + -5.6130182743072510e-01 4.1730970144271851e-02 + <_> + + 0 -1 691 3.8132141344249249e-03 + + 4.3826375156641006e-02 -4.8639413714408875e-01 + <_> + + 0 -1 799 -1.1944114230573177e-03 + + 1.9191412627696991e-01 -1.2599647045135498e-01 + <_> + + 0 -1 751 -3.2212696969509125e-02 + + -7.3205161094665527e-01 3.3331435173749924e-02 + <_> + + 0 -1 521 -1.0144908446818590e-03 + + 3.0479896068572998e-01 -8.2489714026451111e-02 + <_> + + 0 -1 836 -1.4355147257447243e-02 + + 2.1706604957580566e-01 -1.0914804041385651e-01 + <_> + + 0 -1 574 -4.8122168518602848e-03 + + -6.7199075222015381e-01 4.0943562984466553e-02 + <_> + + 0 -1 236 3.3706519752740860e-04 + + -1.4588885009288788e-01 1.6099508106708527e-01 + <_> + + 0 -1 43 -1.8943618983030319e-02 + + -5.9796541929244995e-01 3.7877634167671204e-02 + <_> + + 0 -1 69 1.5444982796907425e-02 + + 2.6846721768379211e-02 -7.2375786304473877e-01 + <_> + + 0 -1 303 1.0463559068739414e-02 + + 3.2184243202209473e-02 -6.0756552219390869e-01 + <_> + + 0 -1 292 2.5047133676707745e-03 + + -1.1925315856933594e-01 1.9379882514476776e-01 + <_> + + 0 -1 797 -1.4791900292038918e-02 + + 1.9981779158115387e-01 -1.2553811073303223e-01 + <_> + + 0 -1 146 -6.1217732727527618e-03 + + -4.2455345392227173e-01 5.5959124118089676e-02 + <_> + + 0 -1 563 -3.5850135609507561e-03 + + 3.2560044527053833e-01 -7.1894593536853790e-02 + <_> + + 0 -1 1048 -3.2580485567450523e-03 + + -5.4515779018402100e-01 4.5138467103242874e-02 + <_> + + 0 -1 367 8.5870809853076935e-03 + + -9.2699222266674042e-02 2.7361676096916199e-01 + <_> + + 0 -1 384 -3.5999938845634460e-03 + + 1.7715592682361603e-01 -1.3859097659587860e-01 + <_> + + 0 -1 650 1.5299995429813862e-03 + + -1.0419535636901855e-01 2.1118766069412231e-01 + <_> + + 0 -1 413 2.7578026056289673e-03 + + -7.0944413542747498e-02 2.9870492219924927e-01 + <_> + + 0 -1 283 -6.1489176005125046e-03 + + -5.1581281423568726e-01 4.6433247625827789e-02 + <_> + + 0 -1 979 8.3175086183473468e-04 + + -8.4185592830181122e-02 2.8132751584053040e-01 + <_> + + 0 -1 979 -6.7444925662130117e-04 + + 2.6548036932945251e-01 -9.7815677523612976e-02 + <_> + + 0 -1 555 -5.6643221527338028e-02 + + 3.8170987367630005e-01 -6.2833912670612335e-02 + <_> + + 0 -1 602 -7.5360340997576714e-03 + + 2.2137185931205750e-01 -1.0336405038833618e-01 + + <_> + 54 + -1.3439358472824097e+00 + + <_> + + 0 -1 526 -4.8420722596347332e-03 + + 5.7400572299957275e-01 -9.5008336007595062e-02 + <_> + + 0 -1 786 -5.9993756003677845e-03 + + 4.5479923486709595e-01 -1.5483228862285614e-01 + <_> + + 0 -1 531 -3.1531709246337414e-03 + + 4.2504432797431946e-01 -1.2935030460357666e-01 + <_> + + 0 -1 884 1.2363551650196314e-03 + + -1.5872104465961456e-01 3.1463247537612915e-01 + <_> + + 0 -1 925 -6.7780278623104095e-03 + + 4.1302111744880676e-01 -1.7017546296119690e-01 + <_> + + 0 -1 259 1.3960017822682858e-03 + + -1.3419999182224274e-01 3.3868113160133362e-01 + <_> + + 0 -1 564 -3.5894233733415604e-03 + + 3.3102113008499146e-01 -1.1498286575078964e-01 + <_> + + 0 -1 551 5.4187951609492302e-03 + + -1.2790408730506897e-01 3.1275641918182373e-01 + <_> + + 0 -1 934 -3.3248444087803364e-03 + + -5.1654219627380371e-01 7.1216024458408356e-02 + <_> + + 0 -1 49 7.9970825463533401e-03 + + 6.3098005950450897e-02 -5.8896148204803467e-01 + <_> + + 0 -1 124 6.0347835533320904e-03 + + 6.4018696546554565e-02 -4.7639665007591248e-01 + <_> + + 0 -1 124 -6.9478121586143970e-03 + + -6.0485291481018066e-01 7.2506561875343323e-02 + <_> + + 0 -1 30 1.9063859945163131e-03 + + -1.8492227792739868e-01 1.9994279742240906e-01 + <_> + + 0 -1 752 2.1343495696783066e-02 + + -8.6192794144153595e-02 4.8719888925552368e-01 + <_> + + 0 -1 261 -2.2514071315526962e-03 + + 3.5809755325317383e-01 -7.6123438775539398e-02 + <_> + + 0 -1 480 -4.4778124429285526e-03 + + -4.5578238368034363e-01 7.3516018688678741e-02 + <_> + + 0 -1 533 3.9280336350202560e-03 + + 6.2599055469036102e-02 -5.2695369720458984e-01 + <_> + + 0 -1 365 -4.5666974037885666e-03 + + -6.1827522516250610e-01 4.1984613984823227e-02 + <_> + + 0 -1 743 -6.1424830928444862e-03 + + 3.0607789754867554e-01 -9.1138295829296112e-02 + <_> + + 0 -1 1019 3.4258943051099777e-03 + + 5.5657953023910522e-02 -5.3350126743316650e-01 + <_> + + 0 -1 731 3.3122287131845951e-03 + + -1.5935245156288147e-01 1.7000633478164673e-01 + <_> + + 0 -1 135 7.4128687381744385e-02 + + 3.3975400030612946e-02 -6.4646822214126587e-01 + <_> + + 0 -1 496 -6.0862921178340912e-02 + + 3.1012952327728271e-01 -9.1380268335342407e-02 + <_> + + 0 -1 575 -4.3243117630481720e-02 + + -4.5051410794258118e-01 6.6722445189952850e-02 + <_> + + 0 -1 322 -5.4576778784394264e-03 + + -4.8368638753890991e-01 5.5113438516855240e-02 + <_> + + 0 -1 196 -2.1073617972433567e-03 + + 2.3326623439788818e-01 -1.2007984519004822e-01 + <_> + + 0 -1 252 -1.1282963678240776e-02 + + 2.9159554839134216e-01 -1.0025029629468918e-01 + <_> + + 0 -1 339 2.9302681796252728e-03 + + -8.5840485990047455e-02 3.3159431815147400e-01 + <_> + + 0 -1 53 -2.8825225308537483e-03 + + -5.3361582756042480e-01 5.7994876056909561e-02 + <_> + + 0 -1 76 6.2230005860328674e-03 + + 4.4393569231033325e-02 -5.3072142601013184e-01 + <_> + + 0 -1 971 1.1437942739576101e-03 + + -9.5763660967350006e-02 2.8212538361549377e-01 + <_> + + 0 -1 1052 1.2469270732253790e-03 + + 6.5446242690086365e-02 -4.1902217268943787e-01 + <_> + + 0 -1 612 -1.1369751766324043e-02 + + -7.0747911930084229e-01 3.4916084259748459e-02 + <_> + + 0 -1 35 1.0013033449649811e-01 + + -6.7160040140151978e-02 4.2184004187583923e-01 + <_> + + 0 -1 653 -2.6742245536297560e-03 + + 1.7217047512531281e-01 -1.6229687631130219e-01 + <_> + + 0 -1 713 -3.4254738129675388e-03 + + 2.9603767395019531e-01 -8.9177258312702179e-02 + <_> + + 0 -1 669 1.5813322970643640e-03 + + 4.8733744770288467e-02 -5.6422549486160278e-01 + <_> + + 0 -1 917 2.7555555789149366e-05 + + -1.7079097032546997e-01 1.4066468179225922e-01 + <_> + + 0 -1 466 -8.2116597332060337e-04 + + 1.8260034918785095e-01 -1.3242910802364349e-01 + <_> + + 0 -1 353 -1.0168720036745071e-02 + + -4.1390055418014526e-01 6.5349683165550232e-02 + <_> + + 0 -1 96 2.5848036631941795e-02 + + 4.6910341829061508e-02 -4.7531116008758545e-01 + <_> + + 0 -1 75 5.9797330759465694e-03 + + 4.5450355857610703e-02 -4.5701387524604797e-01 + <_> + + 0 -1 81 -2.4257015902549028e-03 + + 1.8431460857391357e-01 -1.1879430711269379e-01 + <_> + + 0 -1 346 -4.1334740817546844e-02 + + 3.0460721254348755e-01 -9.4910860061645508e-02 + <_> + + 0 -1 537 7.5982198119163513e-02 + + -6.5890170633792877e-02 3.3325287699699402e-01 + <_> + + 0 -1 318 -2.7852014682139270e-05 + + 1.4771287143230438e-01 -1.4524473249912262e-01 + <_> + + 0 -1 669 -1.4885163400322199e-03 + + -4.6987643837928772e-01 4.7233786433935165e-02 + <_> + + 0 -1 897 -3.3519542776048183e-03 + + 2.4128976464271545e-01 -9.3788638710975647e-02 + <_> + + 0 -1 935 1.3348343782126904e-03 + + -9.9509775638580322e-02 2.9368522763252258e-01 + <_> + + 0 -1 704 3.2456549815833569e-03 + + -9.8895303905010223e-02 2.3363485932350159e-01 + <_> + + 0 -1 611 4.2385179549455643e-03 + + 5.9986904263496399e-02 -4.5745995640754700e-01 + <_> + + 0 -1 170 8.4751443937420845e-03 + + 3.0937874689698219e-02 -6.7139619588851929e-01 + <_> + + 0 -1 995 3.0964510515332222e-03 + + 3.0879957601428032e-02 -6.2686437368392944e-01 + <_> + + 0 -1 212 2.3455230984836817e-03 + + -1.3303077220916748e-01 1.6908498108386993e-01 + + <_> + 72 + -1.4052674770355225e+00 + + <_> + + 0 -1 534 -8.4834604058414698e-04 + + 4.6746683120727539e-01 -1.2498743087053299e-01 + <_> + + 0 -1 838 1.1534148361533880e-03 + + -2.1341361105442047e-01 3.0533915758132935e-01 + <_> + + 0 -1 728 1.3660041615366936e-02 + + -1.5390963852405548e-01 3.2113197445869446e-01 + <_> + + 0 -1 528 -1.3363182079046965e-03 + + 2.4346974492073059e-01 -1.8074017763137817e-01 + <_> + + 0 -1 1002 5.5064354091882706e-04 + + -1.9600959122180939e-01 2.1903340518474579e-01 + <_> + + 0 -1 340 2.8026416897773743e-02 + + -9.9956467747688293e-02 5.1314896345138550e-01 + <_> + + 0 -1 930 -9.8200759384781122e-04 + + 2.0671010017395020e-01 -1.9585600495338440e-01 + <_> + + 0 -1 249 -1.9661948084831238e-02 + + -5.1859843730926514e-01 7.9988524317741394e-02 + <_> + + 0 -1 514 5.7550622150301933e-03 + + -1.0230549424886703e-01 2.9102912545204163e-01 + <_> + + 0 -1 854 4.8226406797766685e-03 + + -1.2503834068775177e-01 2.2606587409973145e-01 + <_> + + 0 -1 1025 -3.5137422382831573e-03 + + -6.8291509151458740e-01 4.6296034008264542e-02 + <_> + + 0 -1 468 2.7717142074834555e-05 + + -2.1390475332736969e-01 1.3291628658771515e-01 + <_> + + 0 -1 875 -2.2634968161582947e-02 + + 4.0156257152557373e-01 -9.0922117233276367e-02 + <_> + + 0 -1 890 -2.6544253341853619e-04 + + 2.1944612264633179e-01 -1.5686984360218048e-01 + <_> + + 0 -1 45 1.7469950020313263e-02 + + 5.9605021029710770e-02 -5.4529672861099243e-01 + <_> + + 0 -1 812 3.6130528897047043e-03 + + 5.2721742540597916e-02 -4.4890201091766357e-01 + <_> + + 0 -1 813 -3.8260491564869881e-03 + + -5.1076781749725342e-01 4.7858215868473053e-02 + <_> + + 0 -1 348 -4.6305969590321183e-04 + + 2.0340332388877869e-01 -1.3007256388664246e-01 + <_> + + 0 -1 685 -7.3791583999991417e-03 + + -5.4855078458786011e-01 5.1355980336666107e-02 + <_> + + 0 -1 397 -4.1331160813570023e-02 + + -3.7914556264877319e-01 6.2432620674371719e-02 + <_> + + 0 -1 720 -1.4983891742303967e-03 + + -5.2967226505279541e-01 4.2461462318897247e-02 + <_> + + 0 -1 785 -2.5054097641259432e-03 + + 2.0288434624671936e-01 -1.2341590225696564e-01 + <_> + + 0 -1 259 -7.1871257387101650e-04 + + 2.4784520268440247e-01 -9.8167583346366882e-02 + <_> + + 0 -1 260 -6.8983237724751234e-04 + + 2.7780577540397644e-01 -9.7512029111385345e-02 + <_> + + 0 -1 274 4.8434769269078970e-04 + + -1.1704409867525101e-01 2.4324342608451843e-01 + <_> + + 0 -1 508 -3.6378027871251106e-03 + + -5.7295501232147217e-01 4.9037151038646698e-02 + <_> + + 0 -1 709 -2.6648804545402527e-02 + + -6.0253041982650757e-01 3.6413222551345825e-02 + <_> + + 0 -1 825 -4.3416651897132397e-03 + + 4.7109794616699219e-01 -5.9058945626020432e-02 + <_> + + 0 -1 60 -2.7588163502514362e-03 + + -4.9160134792327881e-01 5.4663125425577164e-02 + <_> + + 0 -1 987 4.7046472318470478e-03 + + 3.7025094032287598e-02 -5.6842529773712158e-01 + <_> + + 0 -1 77 4.9029560759663582e-03 + + 4.8207473009824753e-02 -4.2965477705001831e-01 + <_> + + 0 -1 837 -7.0135248824954033e-04 + + 2.2556030750274658e-01 -9.9117368459701538e-02 + <_> + + 0 -1 332 2.7165210340172052e-03 + + 4.3833449482917786e-02 -5.5271440744400024e-01 + <_> + + 0 -1 837 8.9941755868494511e-04 + + -8.9474648237228394e-02 2.6415902376174927e-01 + <_> + + 0 -1 723 -1.7575379461050034e-03 + + -5.7822185754776001e-01 4.4655490666627884e-02 + <_> + + 0 -1 323 2.2079560905694962e-02 + + -9.1862626373767853e-02 2.6927500963211060e-01 + <_> + + 0 -1 247 -2.4989219382405281e-03 + + 1.9282613694667816e-01 -1.4004705846309662e-01 + <_> + + 0 -1 388 4.4558709487318993e-03 + + 5.2965965121984482e-02 -4.6530798077583313e-01 + <_> + + 0 -1 345 8.9809950441122055e-03 + + -6.9099865853786469e-02 3.5005539655685425e-01 + <_> + + 0 -1 589 -4.6078087761998177e-03 + + 1.5373907983303070e-01 -1.5948937833309174e-01 + <_> + + 0 -1 10 -8.9063167572021484e-02 + + 4.8500600457191467e-01 -5.1386959850788116e-02 + <_> + + 0 -1 540 4.8636873252689838e-03 + + 5.1732856780290604e-02 -4.9787709116935730e-01 + <_> + + 0 -1 992 -5.4465518333017826e-03 + + 1.5584819018840790e-01 -1.4326727390289307e-01 + <_> + + 0 -1 788 6.4384475350379944e-02 + + 3.1540591269731522e-02 -7.1331930160522461e-01 + <_> + + 0 -1 25 -9.3528348952531815e-03 + + -5.8800560235977173e-01 3.2534934580326080e-02 + <_> + + 0 -1 374 6.5686285961419344e-04 + + -1.6972899436950684e-01 1.4208021759986877e-01 + <_> + + 0 -1 744 -6.5707243047654629e-03 + + 3.1901842355728149e-01 -7.0233277976512909e-02 + <_> + + 0 -1 370 7.0676081813871861e-03 + + 3.0735086649656296e-02 -7.6451587677001953e-01 + <_> + + 0 -1 875 -1.1614331044256687e-02 + + 2.0416912436485291e-01 -1.0650242120027542e-01 + <_> + + 0 -1 227 -3.0933439731597900e-02 + + -3.5186296701431274e-01 6.3158944249153137e-02 + <_> + + 0 -1 31 8.9404191821813583e-03 + + 4.1301336139440536e-02 -5.2171415090560913e-01 + <_> + + 0 -1 542 -3.0004943255335093e-04 + + 1.8332102894783020e-01 -1.1965552717447281e-01 + <_> + + 0 -1 753 -4.2704585939645767e-03 + + -4.1220253705978394e-01 5.2136015146970749e-02 + <_> + + 0 -1 979 9.1349193826317787e-04 + + -8.2035504281520844e-02 2.7817621827125549e-01 + <_> + + 0 -1 97 2.8089310973882675e-02 + + 6.0909613966941833e-02 -3.7705209851264954e-01 + <_> + + 0 -1 979 -1.1489203898236156e-03 + + 2.9547268152236938e-01 -7.8550107777118683e-02 + <_> + + 0 -1 766 -8.5876882076263428e-04 + + 1.6158875823020935e-01 -1.3613829016685486e-01 + <_> + + 0 -1 862 3.3645064104348421e-03 + + 3.6055568605661392e-02 -5.5788111686706543e-01 + <_> + + 0 -1 1034 -1.2699423357844353e-02 + + -4.2199519276618958e-01 4.3876208364963531e-02 + <_> + + 0 -1 158 -1.3306856155395508e-01 + + -7.5723612308502197e-01 2.4755204096436501e-02 + <_> + + 0 -1 822 4.9831219017505646e-02 + + 2.5250671431422234e-02 -6.3122928142547607e-01 + <_> + + 0 -1 569 5.8193420991301537e-03 + + 2.2189516574144363e-02 -7.2821933031082153e-01 + <_> + + 0 -1 422 -6.3158385455608368e-03 + + 1.9480472803115845e-01 -1.0275462269783020e-01 + <_> + + 0 -1 58 -2.6879269629716873e-02 + + -4.3909311294555664e-01 4.5222271233797073e-02 + <_> + + 0 -1 900 -1.6478844918310642e-03 + + 2.7425831556320190e-01 -7.7650256454944611e-02 + <_> + + 0 -1 947 4.4362144544720650e-03 + + 3.2876692712306976e-02 -6.0907542705535889e-01 + <_> + + 0 -1 760 -1.5154483262449503e-03 + + 2.2985421121120453e-01 -8.5810013115406036e-02 + <_> + + 0 -1 157 7.0627350360155106e-03 + + 3.4827440977096558e-02 -5.9273594617843628e-01 + <_> + + 0 -1 393 4.5482232235372066e-03 + + -5.2113339304924011e-02 4.0603092312812805e-01 + <_> + + 0 -1 183 -3.9095789194107056e-02 + + 2.5562492012977600e-01 -8.1410482525825500e-02 + <_> + + 0 -1 718 -1.9122204976156354e-03 + + -6.5523076057434082e-01 3.1964879482984543e-02 + <_> + + 0 -1 622 5.1604928448796272e-03 + + 2.8228869661688805e-02 -6.0336226224899292e-01 + + <_> + 63 + -1.2550007104873657e+00 + + <_> + + 0 -1 532 -1.3708438724279404e-02 + + 4.5314663648605347e-01 -1.2558805942535400e-01 + <_> + + 0 -1 32 1.2687301263213158e-02 + + -1.5584127604961395e-01 3.8753288984298706e-01 + <_> + + 0 -1 254 3.3966779708862305e-02 + + -1.1772038787603378e-01 4.0628942847251892e-01 + <_> + + 0 -1 756 8.0258902162313461e-03 + + -1.4661933481693268e-01 4.0369525551795959e-01 + <_> + + 0 -1 2 -4.2836386710405350e-03 + + 2.2167153656482697e-01 -1.9662868976593018e-01 + <_> + + 0 -1 164 -2.7807329315692186e-03 + + -4.6929144859313965e-01 6.9577261805534363e-02 + <_> + + 0 -1 172 1.9090694840997458e-03 + + 5.9488739818334579e-02 -6.3101488351821899e-01 + <_> + + 0 -1 426 3.1442400068044662e-03 + + -1.1149841547012329e-01 3.0095639824867249e-01 + <_> + + 0 -1 324 -2.8418585658073425e-02 + + 3.6157062649726868e-01 -9.6387691795825958e-02 + <_> + + 0 -1 449 -4.4032465666532516e-03 + + 3.2977014780044556e-01 -9.8187342286109924e-02 + <_> + + 0 -1 400 -2.6041134260594845e-03 + + 2.8221642971038818e-01 -1.0142992436885834e-01 + <_> + + 0 -1 357 -5.8917067945003510e-03 + + -5.8254349231719971e-01 6.0040380805730820e-02 + <_> + + 0 -1 998 1.3956660404801369e-03 + + -1.6574928164482117e-01 1.7746162414550781e-01 + <_> + + 0 -1 1022 -1.7630932852625847e-03 + + -5.7597070932388306e-01 6.2388133257627487e-02 + <_> + + 0 -1 697 -1.3517161132767797e-03 + + -5.1934504508972168e-01 4.7232870012521744e-02 + <_> + + 0 -1 507 -3.8743610493838787e-03 + + 2.9165247082710266e-01 -9.9355563521385193e-02 + <_> + + 0 -1 765 1.0973589494824409e-02 + + -7.7571205794811249e-02 3.4312543272972107e-01 + <_> + + 0 -1 128 -3.5274624824523926e-03 + + -6.7513287067413330e-01 3.6897819489240646e-02 + <_> + + 0 -1 605 -2.4239125195890665e-03 + + 2.5701349973678589e-01 -1.0465545207262039e-01 + <_> + + 0 -1 727 -8.3098262548446655e-03 + + 2.6842510700225830e-01 -9.9635124206542969e-02 + <_> + + 0 -1 269 -2.7831714600324631e-02 + + -3.9901316165924072e-01 6.5086022019386292e-02 + <_> + + 0 -1 399 8.1690559163689613e-03 + + -1.1402101069688797e-01 2.2761905193328857e-01 + <_> + + 0 -1 368 2.8635351918637753e-03 + + -1.4034478366374969e-01 1.8733198940753937e-01 + <_> + + 0 -1 286 -2.1204156801104546e-03 + + -5.9949654340744019e-01 4.9501683562994003e-02 + <_> + + 0 -1 669 -9.4446074217557907e-04 + + -3.8145086169242859e-01 5.9254929423332214e-02 + <_> + + 0 -1 686 2.1901372820138931e-03 + + 3.6901079118251801e-02 -5.6260800361633301e-01 + <_> + + 0 -1 103 4.2550573125481606e-03 + + -9.8831087350845337e-02 2.3313422501087189e-01 + <_> + + 0 -1 281 4.2771790176630020e-03 + + 4.2207289487123489e-02 -5.6859022378921509e-01 + <_> + + 0 -1 422 -7.8792609274387360e-03 + + 2.2428077459335327e-01 -9.9518932402133942e-02 + <_> + + 0 -1 561 -3.5514549817889929e-03 + + -5.6150603294372559e-01 3.9242122322320938e-02 + <_> + + 0 -1 738 -6.8606354761868715e-04 + + 2.1056549251079559e-01 -1.2413132935762405e-01 + <_> + + 0 -1 433 5.2483025938272476e-03 + + 3.4256864339113235e-02 -7.2566890716552734e-01 + <_> + + 0 -1 658 -3.6910744383931160e-03 + + 2.6440864801406860e-01 -8.9745096862316132e-02 + <_> + + 0 -1 127 2.0369128324091434e-03 + + 4.6990364789962769e-02 -5.3132331371307373e-01 + <_> + + 0 -1 662 3.8735207635909319e-03 + + -9.1540865600109100e-02 2.7486115694046021e-01 + <_> + + 0 -1 126 6.0556940734386444e-03 + + 5.3909529000520706e-02 -4.6437451243400574e-01 + <_> + + 0 -1 912 4.8301572678610682e-04 + + -1.6165176033973694e-01 1.3917934894561768e-01 + <_> + + 0 -1 101 -1.4880476519465446e-02 + + -5.9634107351303101e-01 3.9811171591281891e-02 + <_> + + 0 -1 609 2.9731846880167723e-03 + + 3.0903076753020287e-02 -6.2935864925384521e-01 + <_> + + 0 -1 90 -1.1181155219674110e-02 + + 3.5473996400833130e-01 -6.4499482512474060e-02 + <_> + + 0 -1 1009 -9.8370900377631187e-04 + + 2.9858112335205078e-01 -8.4500424563884735e-02 + <_> + + 0 -1 975 -1.0228222236037254e-03 + + 2.7100124955177307e-01 -1.0033085197210312e-01 + <_> + + 0 -1 913 2.0134919323027134e-03 + + 4.3533660471439362e-02 -5.4969471693038940e-01 + <_> + + 0 -1 881 -3.1473359558731318e-03 + + 3.1102818250656128e-01 -8.0141142010688782e-02 + <_> + + 0 -1 991 -2.9232497327029705e-03 + + -6.7808300256729126e-01 3.5025410354137421e-02 + <_> + + 0 -1 494 -3.8992143236100674e-03 + + 2.5711989402770996e-01 -8.4509201347827911e-02 + <_> + + 0 -1 547 -3.8403570652008057e-02 + + 2.8463324904441833e-01 -7.5673028826713562e-02 + <_> + + 0 -1 700 -2.2210094612091780e-03 + + -5.6876182556152344e-01 4.0759250521659851e-02 + <_> + + 0 -1 989 6.9615743122994900e-03 + + -7.8118488192558289e-02 2.8128826618194580e-01 + <_> + + 0 -1 948 -1.8219950143247843e-03 + + 1.8647159636020660e-01 -1.3465921580791473e-01 + <_> + + 0 -1 697 1.0106971021741629e-03 + + 5.7168632745742798e-02 -4.1419604420661926e-01 + <_> + + 0 -1 945 -3.3746981061995029e-03 + + -5.2892911434173584e-01 4.0065344423055649e-02 + <_> + + 0 -1 1030 -8.5245687514543533e-03 + + -5.0935691595077515e-01 3.8823168724775314e-02 + <_> + + 0 -1 1012 -2.2426969371736050e-03 + + 2.5891116261482239e-01 -8.8167145848274231e-02 + <_> + + 0 -1 402 -5.9730862267315388e-03 + + -4.3465223908424377e-01 4.9864508211612701e-02 + <_> + + 0 -1 452 -5.5482299067080021e-03 + + 2.5288850069046021e-01 -9.3322932720184326e-02 + <_> + + 0 -1 51 3.7344563007354736e-01 + + -4.9019347876310349e-02 4.3872711062431335e-01 + <_> + + 0 -1 615 -4.0881419554352760e-03 + + 3.1952694058418274e-01 -7.7735908329486847e-02 + <_> + + 0 -1 202 3.1661842949688435e-03 + + -1.0995075106620789e-01 1.7701222002506256e-01 + <_> + + 0 -1 17 -2.1666671335697174e-01 + + -4.5134860277175903e-01 4.9127347767353058e-02 + <_> + + 0 -1 241 -3.1139418482780457e-02 + + 2.5138390064239502e-01 -9.4933450222015381e-02 + <_> + + 0 -1 459 9.1597874416038394e-04 + + -7.4231699109077454e-02 3.1368830800056458e-01 + <_> + + 0 -1 747 -6.1164153739809990e-03 + + -7.0417582988739014e-01 3.4018490463495255e-02 + + <_> + 77 + -1.3230814933776855e+00 + + <_> + + 0 -1 522 -3.3400340471416712e-03 + + 4.2352598905563354e-01 -1.2572944164276123e-01 + <_> + + 0 -1 799 -2.3890279699116945e-03 + + 3.8169610500335693e-01 -1.4501731097698212e-01 + <_> + + 0 -1 448 -2.4045775644481182e-03 + + 3.4690696001052856e-01 -1.2821178138256073e-01 + <_> + + 0 -1 524 1.2546034995466471e-03 + + -1.4823316037654877e-01 2.9894015192985535e-01 + <_> + + 0 -1 752 -1.8236635252833366e-02 + + 3.0641126632690430e-01 -1.2427721172571182e-01 + <_> + + 0 -1 229 4.1921215597540140e-04 + + -1.8449674546718597e-01 1.7403297126293182e-01 + <_> + + 0 -1 914 -3.0837533995509148e-03 + + -6.2562137842178345e-01 3.4162398427724838e-02 + <_> + + 0 -1 587 -3.4897932782769203e-03 + + 2.0127655565738678e-01 -1.4677318930625916e-01 + <_> + + 0 -1 882 -3.4818234853446484e-03 + + 2.9465374350547791e-01 -1.0961814969778061e-01 + <_> + + 0 -1 13 6.2356598675251007e-02 + + -9.8056003451347351e-02 3.1733244657516479e-01 + <_> + + 0 -1 607 -1.8334560096263885e-02 + + 3.1992998719215393e-01 -7.8213296830654144e-02 + <_> + + 0 -1 885 3.7803263403475285e-03 + + 5.3678415715694427e-02 -5.0315982103347778e-01 + <_> + + 0 -1 1027 -3.6906298249959946e-02 + + -6.3056147098541260e-01 3.8218058645725250e-02 + <_> + + 0 -1 923 4.6968068927526474e-03 + + -1.1338837444782257e-01 2.6388064026832581e-01 + <_> + + 0 -1 708 -1.1566210538148880e-02 + + 1.6388712823390961e-01 -1.6043519973754883e-01 + <_> + + 0 -1 489 3.1895786523818970e-03 + + 6.0215596109628677e-02 -4.7157511115074158e-01 + <_> + + 0 -1 50 -2.5480750948190689e-02 + + -5.5096846818923950e-01 3.9257630705833435e-02 + <_> + + 0 -1 480 3.9267786778509617e-03 + + 6.1174295842647552e-02 -4.1686600446701050e-01 + <_> + + 0 -1 874 4.2923549190163612e-03 + + -6.9901801645755768e-02 3.6233785748481750e-01 + <_> + + 0 -1 929 1.5720827504992485e-03 + + -9.2891335487365723e-02 2.6970732212066650e-01 + <_> + + 0 -1 937 4.2968937195837498e-03 + + 4.5402236282825470e-02 -6.1771476268768311e-01 + <_> + + 0 -1 223 5.8442405425012112e-03 + + 3.4459017217159271e-02 -6.2251347303390503e-01 + <_> + + 0 -1 663 2.6888614520430565e-03 + + 3.6230482161045074e-02 -5.7353609800338745e-01 + <_> + + 0 -1 424 4.4175283983349800e-03 + + -6.4959764480590820e-02 3.7311050295829773e-01 + <_> + + 0 -1 138 1.4900951646268368e-03 + + -1.0781793296337128e-01 2.0226408541202545e-01 + <_> + + 0 -1 373 2.4665119126439095e-03 + + 5.7804334908723831e-02 -4.1689205169677734e-01 + <_> + + 0 -1 441 9.3985523562878370e-04 + + -1.4865192770957947e-01 1.3861793279647827e-01 + <_> + + 0 -1 132 -5.3606871515512466e-03 + + 1.8524695932865143e-01 -1.1567704379558563e-01 + <_> + + 0 -1 636 -4.6638157218694687e-03 + + 1.6163532435894012e-01 -1.3586524128913879e-01 + <_> + + 0 -1 120 3.7256032228469849e-03 + + 5.2170656621456146e-02 -4.2538973689079285e-01 + <_> + + 0 -1 106 -8.9184641838073730e-03 + + -5.0052535533905029e-01 4.7540370374917984e-02 + <_> + + 0 -1 474 5.6020710617303848e-03 + + 3.4621786326169968e-02 -5.4071390628814697e-01 + <_> + + 0 -1 475 -3.7551699206233025e-03 + + -3.9268767833709717e-01 5.2867397665977478e-02 + <_> + + 0 -1 567 4.0759481489658356e-03 + + 3.7209436297416687e-02 -4.7708320617675781e-01 + <_> + + 0 -1 413 4.1836635209619999e-03 + + -5.8815345168113708e-02 3.6573976278305054e-01 + <_> + + 0 -1 477 -9.3902507796883583e-04 + + 1.9424098730087280e-01 -1.1125016957521439e-01 + <_> + + 0 -1 985 -9.9178254604339600e-03 + + -5.9317117929458618e-01 3.3418238162994385e-02 + <_> + + 0 -1 646 3.3355036284774542e-03 + + -8.7399490177631378e-02 2.4422888457775116e-01 + <_> + + 0 -1 646 -3.4440397284924984e-03 + + 2.9363137483596802e-01 -7.5259201228618622e-02 + <_> + + 0 -1 42 2.1378418896347284e-03 + + 5.6551665067672729e-02 -3.9630606770515442e-01 + <_> + + 0 -1 1005 -4.5215697027742863e-03 + + 1.6443158686161041e-01 -1.1997994035482407e-01 + <_> + + 0 -1 47 -1.2263706885278225e-03 + + -2.6839572191238403e-01 7.8797832131385803e-02 + <_> + + 0 -1 926 -7.3856199160218239e-03 + + -7.5282222032546997e-01 2.3323338478803635e-02 + <_> + + 0 -1 1044 1.1934632435441017e-02 + + 3.9068166166543961e-02 -4.3301787972450256e-01 + <_> + + 0 -1 826 -4.2066089808940887e-03 + + 3.1933805346488953e-01 -6.1786398291587830e-02 + <_> + + 0 -1 779 -1.5679887728765607e-03 + + 2.1744215488433838e-01 -9.4651907682418823e-02 + <_> + + 0 -1 78 2.5083343498408794e-03 + + 5.7137917727231979e-02 -3.3361336588859558e-01 + <_> + + 0 -1 660 3.6224797368049622e-03 + + 3.1345754861831665e-02 -5.7247912883758545e-01 + <_> + + 0 -1 870 -7.7814143151044846e-03 + + 2.9652404785156250e-01 -6.6501826047897339e-02 + <_> + + 0 -1 800 -4.1631370550021529e-04 + + 2.2159980237483978e-01 -1.0610108822584152e-01 + <_> + + 0 -1 596 4.7841453924775124e-03 + + 3.3327136188745499e-02 -5.7043993473052979e-01 + <_> + + 0 -1 347 1.2740758247673512e-03 + + -7.9592645168304443e-02 2.4728350341320038e-01 + <_> + + 0 -1 59 -2.0162630826234818e-02 + + -7.0677626132965088e-01 2.7118822559714317e-02 + <_> + + 0 -1 165 -2.5762226432561874e-02 + + -5.9367066621780396e-01 2.7015525847673416e-02 + <_> + + 0 -1 255 -1.1241633910685778e-03 + + 2.9121127724647522e-01 -6.5690472722053528e-02 + <_> + + 0 -1 818 2.9669383540749550e-02 + + 3.4585461020469666e-02 -5.4837781190872192e-01 + <_> + + 0 -1 501 -6.3295168802142143e-03 + + 2.3453639447689056e-01 -8.5172846913337708e-02 + <_> + + 0 -1 1046 4.0143523365259171e-03 + + 3.5306803882122040e-02 -5.4817456007003784e-01 + <_> + + 0 -1 949 -2.4633856955915689e-03 + + 1.6164709627628326e-01 -1.1111633479595184e-01 + <_> + + 0 -1 38 -2.6468174532055855e-02 + + 2.5775042176246643e-01 -7.2721429169178009e-02 + <_> + + 0 -1 1047 -2.5992670562118292e-03 + + -3.1405648589134216e-01 5.9779226779937744e-02 + <_> + + 0 -1 809 -2.2960878908634186e-02 + + 2.8405818343162537e-01 -6.8080194294452667e-02 + <_> + + 0 -1 437 -1.6940593719482422e-02 + + 3.0056476593017578e-01 -6.7668616771697998e-02 + <_> + + 0 -1 528 1.7171052750200033e-03 + + -6.5253980457782745e-02 2.9430890083312988e-01 + <_> + + 0 -1 142 -5.2873874083161354e-03 + + -4.5413893461227417e-01 4.3044254183769226e-02 + <_> + + 0 -1 14 -1.8073642626404762e-02 + + -3.4945023059844971e-01 5.2509855479001999e-02 + <_> + + 0 -1 627 -2.0803229417651892e-03 + + -4.0171647071838379e-01 4.5229051262140274e-02 + <_> + + 0 -1 918 -1.1218651343369856e-04 + + 1.2830497324466705e-01 -1.4649079740047455e-01 + <_> + + 0 -1 84 -6.6526420414447784e-03 + + -3.4429419040679932e-01 5.4524090141057968e-02 + <_> + + 0 -1 162 -4.1576132178306580e-02 + + -5.5132204294204712e-01 3.2239176332950592e-02 + <_> + + 0 -1 659 -3.2582432031631470e-03 + + 2.1904261410236359e-01 -9.0739406645298004e-02 + <_> + + 0 -1 711 -4.4706808403134346e-03 + + 2.2556288540363312e-01 -9.5258384943008423e-02 + <_> + + 0 -1 177 -6.5750535577535629e-03 + + -4.8511472344398499e-01 4.1734144091606140e-02 + <_> + + 0 -1 251 -3.7532784044742584e-02 + + 2.0968079566955566e-01 -8.8354945182800293e-02 + <_> + + 0 -1 530 -1.2600638438016176e-03 + + 2.2111406922340393e-01 -9.0988010168075562e-02 + <_> + + 0 -1 28 -2.3967802524566650e-02 + + -6.2524855136871338e-01 3.0603738501667976e-02 + <_> + + 0 -1 225 -3.1747903674840927e-02 + + -6.2007570266723633e-01 2.5801742449402809e-02 + + <_> + 84 + -1.3265128135681152e+00 + + <_> + + 0 -1 801 -2.4247136898338795e-03 + + 4.3507692217826843e-01 -1.1363404244184494e-01 + <_> + + 0 -1 239 3.6287805996835232e-03 + + -1.5781879425048828e-01 3.3899685740470886e-01 + <_> + + 0 -1 591 -4.2556263506412506e-03 + + 2.2901295125484467e-01 -2.0403152704238892e-01 + <_> + + 0 -1 847 1.6322638839483261e-03 + + -1.9230945408344269e-01 2.0004445314407349e-01 + <_> + + 0 -1 338 1.4746835455298424e-02 + + -1.2184409052133560e-01 3.9130899310112000e-01 + <_> + + 0 -1 192 -1.5139304101467133e-02 + + 2.6918080449104309e-01 -1.4086124300956726e-01 + <_> + + 0 -1 21 -7.4753491207957268e-03 + + 2.1792158484458923e-01 -1.6056208312511444e-01 + <_> + + 0 -1 287 2.3232740350067616e-03 + + -1.6489887237548828e-01 1.7108000814914703e-01 + <_> + + 0 -1 899 -2.7532558888196945e-03 + + -5.3275841474533081e-01 5.2368167787790298e-02 + <_> + + 0 -1 896 -3.9793960750102997e-03 + + 3.4057796001434326e-01 -8.0085732042789459e-02 + <_> + + 0 -1 608 7.1728855371475220e-02 + + -7.2147607803344727e-02 4.0667375922203064e-01 + <_> + + 0 -1 883 -5.3792679682374001e-04 + + 1.7865169048309326e-01 -1.4902706444263458e-01 + <_> + + 0 -1 248 6.0019297525286674e-03 + + 7.1029536426067352e-02 -3.9921376109123230e-01 + <_> + + 0 -1 369 6.9427289068698883e-02 + + -9.5279395580291748e-02 2.6865223050117493e-01 + <_> + + 0 -1 130 -8.8401548564434052e-03 + + -5.3491175174713135e-01 5.0447739660739899e-02 + <_> + + 0 -1 699 -1.4551014639437199e-02 + + 1.9883459806442261e-01 -1.1586152762174606e-01 + <_> + + 0 -1 754 -1.7498439410701394e-03 + + 2.2214990854263306e-01 -9.8238572478294373e-02 + <_> + + 0 -1 246 -2.1636944264173508e-02 + + 2.8814041614532471e-01 -8.2750618457794189e-02 + <_> + + 0 -1 833 1.2786949053406715e-02 + + -8.7337315082550049e-02 2.6530647277832031e-01 + <_> + + 0 -1 57 -8.7271071970462799e-03 + + -5.3538525104522705e-01 5.0595279783010483e-02 + <_> + + 0 -1 1039 3.3185956999659538e-03 + + 4.5733701437711716e-02 -4.4758048653602600e-01 + <_> + + 0 -1 795 -1.2216938193887472e-03 + + 1.5257745981216431e-01 -1.4963941276073456e-01 + <_> + + 0 -1 562 3.9857804775238037e-02 + + -8.5655666887760162e-02 2.6823255419731140e-01 + <_> + + 0 -1 764 2.4454984813928604e-03 + + 4.6102020889520645e-02 -5.0574064254760742e-01 + <_> + + 0 -1 98 -4.2114150524139404e-01 + + 6.9476419687271118e-01 -3.2907195389270782e-02 + <_> + + 0 -1 558 2.3470625281333923e-02 + + -8.6790844798088074e-02 2.2723633050918579e-01 + <_> + + 0 -1 253 -1.1454307474195957e-02 + + 2.5413584709167480e-01 -8.8991768658161163e-02 + <_> + + 0 -1 624 5.0260839052498341e-03 + + 3.8961157202720642e-02 -5.9463697671890259e-01 + <_> + + 0 -1 873 1.6196466749534011e-03 + + -9.0231269598007202e-02 2.6204809546470642e-01 + <_> + + 0 -1 408 8.1676244735717773e-02 + + -8.0785289406776428e-02 2.5112318992614746e-01 + <_> + + 0 -1 483 -5.4313270375132561e-03 + + 1.6463221609592438e-01 -1.3186016678810120e-01 + <_> + + 0 -1 291 5.7006161659955978e-03 + + -1.3998855650424957e-01 1.4326113462448120e-01 + <_> + + 0 -1 221 -7.5926873832941055e-03 + + -5.5559343099594116e-01 3.7072587758302689e-02 + <_> + + 0 -1 618 7.5261802412569523e-03 + + 2.8434989973902702e-02 -5.8689045906066895e-01 + <_> + + 0 -1 869 -6.3516031950712204e-03 + + 1.4447389543056488e-01 -1.4542055130004883e-01 + <_> + + 0 -1 980 -7.6800247188657522e-04 + + 1.8556322157382965e-01 -1.0404425859451294e-01 + <_> + + 0 -1 941 -4.4167470186948776e-03 + + -7.0306748151779175e-01 3.0874395743012428e-02 + <_> + + 0 -1 1010 3.3405693247914314e-03 + + -6.6534630954265594e-02 3.4018290042877197e-01 + <_> + + 0 -1 114 1.1457607150077820e-02 + + 3.3658623695373535e-02 -6.1056423187255859e-01 + <_> + + 0 -1 1000 -1.8547235522419214e-03 + + -7.4722522497177124e-01 2.2372998297214508e-02 + <_> + + 0 -1 9 -1.9720013439655304e-01 + + -5.9932583570480347e-01 2.9283462092280388e-02 + <_> + + 0 -1 544 -2.6251156814396381e-03 + + -3.0683135986328125e-01 5.5391944944858551e-02 + <_> + + 0 -1 17 -2.7104711532592773e-01 + + -6.4121168851852417e-01 2.6428909972310066e-02 + <_> + + 0 -1 349 1.0233232751488686e-02 + + 4.5153360813856125e-02 -3.6883556842803955e-01 + <_> + + 0 -1 363 4.0971953421831131e-03 + + 4.1385501623153687e-02 -4.3035930395126343e-01 + <_> + + 0 -1 464 -8.8650803081691265e-04 + + 1.6314724087715149e-01 -1.1271495372056961e-01 + <_> + + 0 -1 721 -4.1144760325551033e-03 + + -5.5176359415054321e-01 3.3540870994329453e-02 + <_> + + 0 -1 940 -9.8663510289043188e-04 + + 2.1676342189311981e-01 -8.5408315062522888e-02 + <_> + + 0 -1 428 6.0831783339381218e-03 + + -8.7310679256916046e-02 2.3208071291446686e-01 + <_> + + 0 -1 789 -1.4624604955315590e-02 + + -5.9713214635848999e-01 3.0128041282296181e-02 + <_> + + 0 -1 787 1.3654056005179882e-02 + + 2.4816744029521942e-02 -6.2301605939865112e-01 + <_> + + 0 -1 820 4.2229411192238331e-03 + + -7.3886208236217499e-02 2.4938605725765228e-01 + <_> + + 0 -1 168 1.3268929906189442e-03 + + 4.0760166943073273e-02 -4.3510803580284119e-01 + <_> + + 0 -1 275 -9.6903974190354347e-04 + + 2.2486831247806549e-01 -7.8642837703227997e-02 + <_> + + 0 -1 274 1.0329007636755705e-03 + + -7.3648050427436829e-02 2.6808246970176697e-01 + <_> + + 0 -1 474 -4.2711962014436722e-03 + + -4.0931078791618347e-01 4.7851666808128357e-02 + <_> + + 0 -1 983 -3.7627927958965302e-03 + + -5.0520634651184082e-01 3.0405685305595398e-02 + <_> + + 0 -1 979 -1.7928264569491148e-03 + + 3.3886525034904480e-01 -5.3929597139358521e-02 + <_> + + 0 -1 148 3.9475625380873680e-03 + + 3.4511350095272064e-02 -5.2250456809997559e-01 + <_> + + 0 -1 827 -4.4537894427776337e-03 + + 2.2575919330120087e-01 -7.4650920927524567e-02 + <_> + + 0 -1 774 -2.9974281787872314e-02 + + -6.0629475116729736e-01 3.4456655383110046e-02 + <_> + + 0 -1 123 2.6775486767292023e-02 + + -8.8883727788925171e-02 2.0147153735160828e-01 + <_> + + 0 -1 302 -4.4971965253353119e-03 + + -5.3158396482467651e-01 3.3491309732198715e-02 + <_> + + 0 -1 620 -1.5196309424936771e-02 + + 2.8140705823898315e-01 -6.4074374735355377e-02 + <_> + + 0 -1 560 -2.1833679638803005e-03 + + 2.1953551471233368e-01 -8.5029341280460358e-02 + <_> + + 0 -1 317 -5.4325433447957039e-03 + + -4.8182886838912964e-01 3.8184959441423416e-02 + <_> + + 0 -1 463 -3.9055421948432922e-03 + + -3.5678783059120178e-01 4.5511916279792786e-02 + <_> + + 0 -1 1017 -5.0043486990034580e-03 + + -3.5324424505233765e-01 4.9539435654878616e-02 + <_> + + 0 -1 595 4.2052613571286201e-03 + + -7.6765090227127075e-02 2.4410718679428101e-01 + <_> + + 0 -1 642 -2.9198043048381805e-03 + + 2.8657916188240051e-01 -9.1479435563087463e-02 + <_> + + 0 -1 116 1.4442477375268936e-02 + + 2.2604020312428474e-02 -7.7516084909439087e-01 + <_> + + 0 -1 956 1.0879908688366413e-02 + + -8.9434660971164703e-02 1.8898591399192810e-01 + <_> + + 0 -1 707 1.2304648756980896e-01 + + 2.9145279899239540e-02 -5.6789475679397583e-01 + <_> + + 0 -1 301 5.4486069828271866e-02 + + -8.0465197563171387e-02 2.1073351800441742e-01 + <_> + + 0 -1 37 -1.0112209245562553e-02 + + 2.5688818097114563e-01 -7.3113977909088135e-02 + <_> + + 0 -1 145 -4.3551158159971237e-03 + + -4.0537205338478088e-01 5.1149621605873108e-02 + <_> + + 0 -1 377 2.8712721541523933e-03 + + -8.9186541736125946e-02 2.0391693711280823e-01 + <_> + + 0 -1 220 2.4744076654314995e-02 + + 3.1359996646642685e-02 -5.9586691856384277e-01 + <_> + + 0 -1 19 6.0209888033568859e-03 + + -8.2612000405788422e-02 2.1787849068641663e-01 + <_> + + 0 -1 852 6.0595902614295483e-03 + + 4.7610606998205185e-02 -3.5010379552841187e-01 + <_> + + 0 -1 324 -2.1957855671644211e-02 + + 2.2477181255817413e-01 -7.5377546250820160e-02 + <_> + + 0 -1 385 -3.9967135526239872e-03 + + 4.3043723702430725e-01 -3.9885677397251129e-02 + <_> + + 0 -1 745 -2.0381226204335690e-03 + + -5.8131587505340576e-01 3.2071832567453384e-02 + <_> + + 0 -1 337 3.8902673404663801e-03 + + -6.0279250144958496e-02 2.9424437880516052e-01 + + <_> + 82 + -1.2607949972152710e+00 + + <_> + + 0 -1 798 -1.9003680208697915e-03 + + 4.8600798845291138e-01 -7.5834542512893677e-02 + <_> + + 0 -1 238 1.5605278313159943e-03 + + -1.9763922691345215e-01 2.5329649448394775e-01 + <_> + + 0 -1 584 -4.8138713464140892e-03 + + 3.5302931070327759e-01 -1.2585695087909698e-01 + <_> + + 0 -1 870 5.7447804138064384e-03 + + -1.5453046560287476e-01 3.5572248697280884e-01 + <_> + + 0 -1 806 3.2787662930786610e-03 + + -1.8419209122657776e-01 1.6216333210468292e-01 + <_> + + 0 -1 423 2.8142044320702553e-03 + + -9.4009101390838623e-02 2.7667456865310669e-01 + <_> + + 0 -1 259 1.8096582498401403e-03 + + -8.9050479233264923e-02 2.9622453451156616e-01 + <_> + + 0 -1 988 7.2106244042515755e-03 + + -1.0854976624250412e-01 2.2157947719097137e-01 + <_> + + 0 -1 342 1.3368867337703705e-02 + + 5.8126326650381088e-02 -3.8564166426658630e-01 + <_> + + 0 -1 276 1.6755410470068455e-03 + + -6.9541916251182556e-02 3.6275833845138550e-01 + <_> + + 0 -1 198 -4.5782830566167831e-03 + + -5.6317430734634399e-01 3.9351724088191986e-02 + <_> + + 0 -1 729 3.6364984698593616e-03 + + -1.5140864253044128e-01 1.4790520071983337e-01 + <_> + + 0 -1 928 -1.1279541999101639e-02 + + -4.8907181620597839e-01 5.1109701395034790e-02 + <_> + + 0 -1 867 -1.2224027886986732e-02 + + -6.0496371984481812e-01 3.5609807819128036e-02 + <_> + + 0 -1 769 -2.8662174940109253e-02 + + 2.4556699395179749e-01 -9.9369116127490997e-02 + <_> + + 0 -1 496 6.7924216389656067e-02 + + -7.8038521111011505e-02 3.3691942691802979e-01 + <_> + + 0 -1 962 2.2719642147421837e-03 + + 5.8022607117891312e-02 -4.7124773263931274e-01 + <_> + + 0 -1 210 8.5627539083361626e-03 + + 3.4671626985073090e-02 -4.6883812546730042e-01 + <_> + + 0 -1 362 1.1866856366395950e-03 + + -8.0339640378952026e-02 2.5030750036239624e-01 + <_> + + 0 -1 979 8.1023329403251410e-04 + + -8.0605715513229370e-02 2.5741192698478699e-01 + <_> + + 0 -1 281 -4.0647285059094429e-03 + + -5.0938653945922852e-01 4.0403041988611221e-02 + <_> + + 0 -1 309 -1.9617568701505661e-02 + + -5.4703706502914429e-01 3.5078343003988266e-02 + <_> + + 0 -1 233 6.9989012554287910e-03 + + 2.6246270164847374e-02 -6.0453557968139648e-01 + <_> + + 0 -1 450 -6.2460554763674736e-03 + + 2.3062629997730255e-01 -8.3763726055622101e-02 + <_> + + 0 -1 529 7.5731135439127684e-04 + + -9.5188923180103302e-02 2.3367822170257568e-01 + <_> + + 0 -1 462 -3.2256892882287502e-03 + + 2.1003848314285278e-01 -1.2173316627740860e-01 + <_> + + 0 -1 941 -2.8797222767025232e-03 + + -4.8621371388435364e-01 4.3998546898365021e-02 + <_> + + 0 -1 740 5.9399371966719627e-03 + + 2.7645273134112358e-02 -6.2591820955276489e-01 + <_> + + 0 -1 742 -5.4768389090895653e-03 + + 2.5695452094078064e-01 -8.1276804208755493e-02 + <_> + + 0 -1 107 -2.2785080596804619e-02 + + -6.7479509115219116e-01 2.9845010489225388e-02 + <_> + + 0 -1 240 -6.0453559271991253e-03 + + -4.5132589340209961e-01 4.0413774549961090e-02 + <_> + + 0 -1 216 5.9022027999162674e-03 + + 4.6321801841259003e-02 -3.9377251267433167e-01 + <_> + + 0 -1 775 -1.1740738991647959e-03 + + 2.2063454985618591e-01 -8.9038714766502380e-02 + <_> + + 0 -1 835 -3.7963264621794224e-03 + + 1.7901860177516937e-01 -1.0518371313810349e-01 + <_> + + 0 -1 871 2.4132090620696545e-03 + + -9.3182116746902466e-02 2.9489630460739136e-01 + <_> + + 0 -1 543 4.5318575575947762e-04 + + -1.4386458694934845e-01 1.3717848062515259e-01 + <_> + + 0 -1 1029 1.8930386751890182e-02 + + 3.3168405294418335e-02 -5.5337232351303101e-01 + <_> + + 0 -1 652 -2.6878318749368191e-03 + + -5.4439735412597656e-01 3.1048862263560295e-02 + <_> + + 0 -1 672 -3.9407592266798019e-03 + + -6.5507227182388306e-01 2.4424355477094650e-02 + <_> + + 0 -1 599 2.1629813127219677e-03 + + -1.0160741209983826e-01 1.8277852237224579e-01 + <_> + + 0 -1 222 -2.9370808042585850e-03 + + -4.7847637534141541e-01 3.8538910448551178e-02 + <_> + + 0 -1 6 3.8221649825572968e-02 + + -7.6206430792808533e-02 2.3375664651393890e-01 + <_> + + 0 -1 393 -3.1483019702136517e-03 + + 2.5192636251449585e-01 -7.3695883154869080e-02 + <_> + + 0 -1 613 -4.5907422900199890e-03 + + -6.2766075134277344e-01 2.8896089643239975e-02 + <_> + + 0 -1 26 -9.5378428697586060e-02 + + -7.4559724330902100e-01 2.1207747980952263e-02 + <_> + + 0 -1 639 2.0872952882200480e-03 + + -8.7810918688774109e-02 2.0629811286926270e-01 + <_> + + 0 -1 635 -6.9244997575879097e-03 + + 1.8590562045574188e-01 -9.8790608346462250e-02 + <_> + + 0 -1 590 2.4594084825366735e-03 + + -1.0049589723348618e-01 2.2963477671146393e-01 + <_> + + 0 -1 1021 -5.2931695245206356e-03 + + -4.5924744009971619e-01 4.3104480952024460e-02 + <_> + + 0 -1 994 4.8847724683582783e-03 + + 4.6008609235286713e-02 -4.4277390837669373e-01 + <_> + + 0 -1 454 1.4400177169591188e-03 + + -5.9334080666303635e-02 3.0132320523262024e-01 + <_> + + 0 -1 156 -8.6052305996417999e-03 + + 1.9737368822097778e-01 -8.9747570455074310e-02 + <_> + + 0 -1 193 -6.1248587444424629e-03 + + -4.5141929388046265e-01 3.8760874420404434e-02 + <_> + + 0 -1 464 -1.8148655071854591e-03 + + 2.2768247127532959e-01 -8.2637414336204529e-02 + <_> + + 0 -1 330 -8.5119507275521755e-04 + + 1.9616322219371796e-01 -1.0013028979301453e-01 + <_> + + 0 -1 417 1.4472046867012978e-02 + + -8.8336527347564697e-02 1.9660694897174835e-01 + <_> + + 0 -1 628 1.4135142788290977e-02 + + -6.4112767577171326e-02 3.1887489557266235e-01 + <_> + + 0 -1 390 4.8004039563238621e-03 + + 4.8681098967790604e-02 -4.6234726905822754e-01 + <_> + + 0 -1 279 -3.3503584563732147e-02 + + 2.5094386935234070e-01 -8.0808885395526886e-02 + <_> + + 0 -1 943 2.4153569247573614e-03 + + -7.2777584195137024e-02 2.6076248288154602e-01 + <_> + + 0 -1 34 -1.3153228908777237e-02 + + 2.3979008197784424e-01 -7.6283767819404602e-02 + <_> + + 0 -1 718 -8.5048296023160219e-04 + + -3.2108953595161438e-01 5.7150222361087799e-02 + <_> + + 0 -1 511 2.0031477324664593e-03 + + -7.5618073344230652e-02 2.3024985194206238e-01 + <_> + + 0 -1 505 -3.9609652012586594e-03 + + -4.3856775760650635e-01 3.7756573408842087e-02 + <_> + + 0 -1 311 5.9846425428986549e-03 + + 3.5378426313400269e-02 -4.7760033607482910e-01 + <_> + + 0 -1 83 2.0205255597829819e-02 + + -8.0130979418754578e-02 2.2919151186943054e-01 + <_> + + 0 -1 927 -2.7492402587085962e-03 + + 2.1395626664161682e-01 -7.6452419161796570e-02 + <_> + + 0 -1 506 -8.3101191557943821e-04 + + 1.6961804032325745e-01 -9.9106967449188232e-02 + <_> + + 0 -1 604 -1.8657972104847431e-03 + + -3.8131290674209595e-01 4.6056091785430908e-02 + <_> + + 0 -1 74 2.0824437960982323e-03 + + 6.4966239035129547e-02 -2.3824627697467804e-01 + <_> + + 0 -1 70 -4.4267112389206886e-03 + + -3.5809823870658875e-01 4.6749643981456757e-02 + <_> + + 0 -1 211 1.3552411692216992e-03 + + -1.2307690829038620e-01 1.3934792578220367e-01 + <_> + + 0 -1 213 -4.4114869087934494e-03 + + 2.6617470383644104e-01 -7.4502207338809967e-02 + <_> + + 0 -1 432 5.2309304010123014e-04 + + -1.0876630991697311e-01 1.5687976777553558e-01 + <_> + + 0 -1 976 6.4505764748901129e-04 + + -8.0842182040214539e-02 2.0263716578483582e-01 + <_> + + 0 -1 975 2.0405012182891369e-03 + + -6.2390543520450592e-02 3.3067914843559265e-01 + <_> + + 0 -1 888 1.9838459789752960e-02 + + 2.3488542065024376e-02 -8.1695795059204102e-01 + <_> + + 0 -1 953 2.3998366668820381e-03 + + 4.1017178446054459e-02 -3.7197592854499817e-01 + <_> + + 0 -1 664 -1.1092903092503548e-02 + + -5.5750596523284912e-01 2.9520254582166672e-02 + <_> + + 0 -1 981 1.4876715838909149e-02 + + -6.5797492861747742e-02 2.5957426428794861e-01 + <_> + + 0 -1 621 -3.0385032296180725e-02 + + 2.2640630602836609e-01 -7.6991938054561615e-02 + <_> + + 0 -1 666 1.2216348201036453e-02 + + -7.0106968283653259e-02 2.4013392627239227e-01 + + <_> + 94 + -1.2798616886138916e+00 + + <_> + + 0 -1 801 -3.8322431501001120e-03 + + 4.8065602779388428e-01 -4.9388073384761810e-02 + <_> + + 0 -1 966 2.5449637323617935e-03 + + -1.7564620077610016e-01 2.5865191221237183e-01 + <_> + + 0 -1 448 -5.4743299260735512e-03 + + 4.9321442842483521e-01 -7.0596724748611450e-02 + <_> + + 0 -1 294 1.5188493765890598e-02 + + -1.8555639684200287e-01 1.5278494358062744e-01 + <_> + + 0 -1 954 7.5815798481926322e-04 + + -1.5043407678604126e-01 1.8612807989120483e-01 + <_> + + 0 -1 963 -3.4232349134981632e-03 + + -4.5882478356361389e-01 4.3279532343149185e-02 + <_> + + 0 -1 842 2.4103666655719280e-03 + + -8.4217190742492676e-02 2.6687353849411011e-01 + <_> + + 0 -1 340 -2.3144368082284927e-02 + + 2.9155749082565308e-01 -9.9449791014194489e-02 + <_> + + 0 -1 419 -4.2331898584961891e-03 + + -3.7696760892868042e-01 8.0511704087257385e-02 + <_> + + 0 -1 282 4.9294121563434601e-03 + + -1.3016121089458466e-01 1.8470372259616852e-01 + <_> + + 0 -1 481 -2.7466980100143701e-05 + + 1.4074377715587616e-01 -1.7928679287433624e-01 + <_> + + 0 -1 724 2.2430901881307364e-03 + + -1.4674974977970123e-01 1.5197925269603729e-01 + <_> + + 0 -1 849 7.5493026524782181e-03 + + 2.4894557893276215e-02 -6.5740859508514404e-01 + <_> + + 0 -1 245 -3.3066330943256617e-03 + + 1.8501703441143036e-01 -1.1837758123874664e-01 + <_> + + 0 -1 345 6.9540860131382942e-03 + + -7.3770649731159210e-02 2.9017251729965210e-01 + <_> + + 0 -1 790 -8.6210696026682854e-03 + + 2.0990766584873199e-01 -1.0644201189279556e-01 + <_> + + 0 -1 978 -6.0504255816340446e-04 + + 2.2373022139072418e-01 -9.6104651689529419e-02 + <_> + + 0 -1 46 -4.5433510094881058e-03 + + -5.4173427820205688e-01 4.7511249780654907e-02 + <_> + + 0 -1 694 -2.2248399909585714e-03 + + -4.6854707598686218e-01 3.8701556622982025e-02 + <_> + + 0 -1 10 -5.3389102220535278e-02 + + 2.9293462634086609e-01 -7.2517670691013336e-02 + <_> + + 0 -1 13 4.6098522841930389e-02 + + -1.0042577981948853e-01 2.3779328167438507e-01 + <_> + + 0 -1 243 7.7845109626650810e-03 + + 3.7205196917057037e-02 -4.9194374680519104e-01 + <_> + + 0 -1 182 6.0175172984600067e-03 + + 4.4034618884325027e-02 -4.3780878186225891e-01 + <_> + + 0 -1 876 4.8966710455715656e-03 + + -1.0375351458787918e-01 1.9480220973491669e-01 + <_> + + 0 -1 494 -3.1284091528505087e-03 + + 2.3669239878654480e-01 -9.6020378172397614e-02 + <_> + + 0 -1 190 -1.3859109021723270e-03 + + 2.8487151861190796e-01 -7.2190955281257629e-02 + <_> + + 0 -1 191 2.6260318700224161e-03 + + -8.5511997342109680e-02 3.0152606964111328e-01 + <_> + + 0 -1 65 1.7782470583915710e-01 + + -6.4100205898284912e-02 3.3825826644897461e-01 + <_> + + 0 -1 50 1.7538113519549370e-02 + + 5.9994459152221680e-02 -3.5529783368110657e-01 + <_> + + 0 -1 946 -3.2135979272425175e-03 + + 1.3668337464332581e-01 -1.3979049026966095e-01 + <_> + + 0 -1 461 6.1371903866529465e-03 + + -6.2439329922199249e-02 3.0614212155342102e-01 + <_> + + 0 -1 467 -4.6563488431274891e-03 + + -4.3073609471321106e-01 4.9068968743085861e-02 + <_> + + 0 -1 668 -4.0680947713553905e-03 + + -4.6810126304626465e-01 3.7441805005073547e-02 + <_> + + 0 -1 696 1.4199400320649147e-03 + + -8.7975829839706421e-02 2.1591611206531525e-01 + <_> + + 0 -1 851 3.5254685208201408e-03 + + 4.6650484204292297e-02 -4.3687531352043152e-01 + <_> + + 0 -1 487 1.8623860552906990e-02 + + -7.6216101646423340e-02 2.3812168836593628e-01 + <_> + + 0 -1 314 -2.6926528662443161e-02 + + -6.7117422819137573e-01 2.9464269056916237e-02 + <_> + + 0 -1 632 2.2593191824853420e-03 + + 2.8521748259663582e-02 -5.4787307977676392e-01 + <_> + + 0 -1 919 1.7519816174171865e-04 + + -1.6111046075820923e-01 1.0367503762245178e-01 + <_> + + 0 -1 493 1.0614154860377312e-02 + + 4.5461904257535934e-02 -3.8087964057922363e-01 + <_> + + 0 -1 20 -4.4702589511871338e-03 + + 1.4304992556571960e-01 -1.3372300565242767e-01 + <_> + + 0 -1 557 6.2367701902985573e-03 + + -7.7783808112144470e-02 2.1545551717281342e-01 + <_> + + 0 -1 76 4.6502514742314816e-03 + + 4.6132039278745651e-02 -3.7130251526832581e-01 + <_> + + 0 -1 544 -4.3315230868756771e-03 + + -4.1549521684646606e-01 3.8484618067741394e-02 + <_> + + 0 -1 764 -1.6567837446928024e-03 + + -3.4637498855590820e-01 4.6623144298791885e-02 + <_> + + 0 -1 415 4.7653233632445335e-03 + + -5.0808548927307129e-02 3.4609997272491455e-01 + <_> + + 0 -1 413 -3.2579647377133369e-03 + + 2.6948198676109314e-01 -8.5287831723690033e-02 + <_> + + 0 -1 614 2.3307730443775654e-03 + + -7.4774339795112610e-02 2.3053503036499023e-01 + <_> + + 0 -1 176 -2.7928136289119720e-02 + + 1.9429244101047516e-01 -8.7820984423160553e-02 + <_> + + 0 -1 366 -9.8205050453543663e-03 + + -5.9664642810821533e-01 3.1795132905244827e-02 + <_> + + 0 -1 767 4.9811266362667084e-03 + + -1.1911241710186005e-01 1.5268225967884064e-01 + <_> + + 0 -1 508 -2.4869772605597973e-03 + + -3.8041505217552185e-01 4.4293139129877090e-02 + <_> + + 0 -1 780 5.4475376382470131e-03 + + -4.6219147741794586e-02 3.9531415700912476e-01 + <_> + + 0 -1 277 -2.1438062191009521e-02 + + -5.2191144227981567e-01 3.4259662032127380e-02 + <_> + + 0 -1 566 -4.1901203803718090e-03 + + -5.2377271652221680e-01 2.8632357716560364e-02 + <_> + + 0 -1 262 -4.7237933613359928e-03 + + 1.8694585561752319e-01 -8.3333678543567657e-02 + <_> + + 0 -1 845 1.2320578098297119e-03 + + -9.6744544804096222e-02 1.8287587165832520e-01 + <_> + + 0 -1 617 2.0271677523851395e-02 + + -6.4628154039382935e-02 2.7641129493713379e-01 + <_> + + 0 -1 375 -1.0729704797267914e-01 + + 4.3015307188034058e-01 -3.8674801588058472e-02 + <_> + + 0 -1 166 -4.0820333361625671e-01 + + 5.0520670413970947e-01 -3.0450601130723953e-02 + <_> + + 0 -1 305 4.4355981051921844e-02 + + -9.2204704880714417e-02 1.7342080175876617e-01 + <_> + + 0 -1 879 -1.0999260703101754e-03 + + 2.0996508002281189e-01 -7.7222190797328949e-02 + <_> + + 0 -1 325 -3.2928451895713806e-02 + + 2.7598264813423157e-01 -6.4115919172763824e-02 + <_> + + 0 -1 52 2.3981094360351562e-02 + + 2.5229524821043015e-02 -6.9560426473617554e-01 + <_> + + 0 -1 961 4.1703339666128159e-03 + + 2.9712976887822151e-02 -4.8132696747779846e-01 + <_> + + 0 -1 776 -1.4920771354809403e-03 + + 1.6165184974670410e-01 -9.6420668065547943e-02 + <_> + + 0 -1 652 1.8172110430896282e-03 + + 4.2247310280799866e-02 -3.5703054070472717e-01 + <_> + + 0 -1 739 -2.5937356986105442e-03 + + 2.2665317356586456e-01 -6.9081544876098633e-02 + <_> + + 0 -1 706 -2.4995308369398117e-02 + + -6.3855916261672974e-01 2.8458235785365105e-02 + <_> + + 0 -1 909 1.2001263909041882e-02 + + 1.4999576844274998e-02 -7.8175085783004761e-01 + <_> + + 0 -1 640 2.2153530735522509e-03 + + -8.8839285075664520e-02 1.8819671869277954e-01 + <_> + + 0 -1 179 2.7237991162110120e-05 + + -1.4949426054954529e-01 9.8739065229892731e-02 + <_> + + 0 -1 91 -2.6735704392194748e-02 + + -4.5522138476371765e-01 3.2516691833734512e-02 + <_> + + 0 -1 644 -2.3417242337018251e-03 + + -3.1453001499176025e-01 4.7598775476217270e-02 + <_> + + 0 -1 72 4.7831580042839050e-02 + + 2.1954061463475227e-02 -6.1162966489791870e-01 + <_> + + 0 -1 160 -5.7228151708841324e-03 + + -6.3381904363632202e-01 2.0299639552831650e-02 + <_> + + 0 -1 163 3.4780064597725868e-03 + + 3.1021401286125183e-02 -4.2342424392700195e-01 + <_> + + 0 -1 385 -5.4140854626893997e-03 + + 4.7739461064338684e-01 -3.4031655639410019e-02 + <_> + + 0 -1 383 1.5283382963389158e-03 + + -9.6935935318470001e-02 1.9429819285869598e-01 + <_> + + 0 -1 428 -8.6789112538099289e-03 + + 2.4826894700527191e-01 -6.0082063078880310e-02 + <_> + + 0 -1 901 3.0333681497722864e-03 + + -7.4087560176849365e-02 2.6165533065795898e-01 + <_> + + 0 -1 684 6.5222466364502907e-03 + + 3.0176062136888504e-02 -5.5570882558822632e-01 + <_> + + 0 -1 902 5.9719551354646683e-03 + + 2.3057831451296806e-02 -5.7078248262405396e-01 + <_> + + 0 -1 155 -1.3977952767163515e-03 + + 1.5342144668102264e-01 -9.8401337862014771e-02 + <_> + + 0 -1 897 5.9919534251093864e-03 + + -3.9796624332666397e-02 3.5881185531616211e-01 + <_> + + 0 -1 354 2.6286500506103039e-03 + + -9.3140766024589539e-02 1.6334943473339081e-01 + <_> + + 0 -1 296 -4.4777179136872292e-03 + + -4.8081240057945251e-01 3.2935630530118942e-02 + <_> + + 0 -1 333 5.2724601700901985e-03 + + 3.0787551775574684e-02 -4.5133110880851746e-01 + <_> + + 0 -1 1049 -3.2540475949645042e-03 + + -4.7695344686508179e-01 2.8554188087582588e-02 + <_> + + 0 -1 736 1.8083681166172028e-01 + + 2.7366345748305321e-02 -4.9431446194648743e-01 + <_> + + 0 -1 431 2.7535988483577967e-03 + + 1.9968675449490547e-02 -6.4471620321273804e-01 + <_> + + 0 -1 15 -1.4123708009719849e-02 + + -5.2748751640319824e-01 2.4596616625785828e-02 + <_> + + 0 -1 421 -3.2076485455036163e-02 + + -7.2171974182128906e-01 1.6940405592322350e-02 + <_> + + 0 -1 434 -3.2569766044616699e-02 + + 2.2400286793708801e-01 -6.3403561711311340e-02 + + <_> + 100 + -1.2990239858627319e+00 + + <_> + + 0 -1 728 1.1235726065933704e-02 + + -1.2534695863723755e-01 3.9147180318832397e-01 + <_> + + 0 -1 922 5.0947451964020729e-03 + + -1.2666413187980652e-01 4.0618515014648438e-01 + <_> + + 0 -1 891 -1.5323986299335957e-03 + + 2.8940162062644958e-01 -1.4350101351737976e-01 + <_> + + 0 -1 284 3.7766513414680958e-03 + + -1.9189934432506561e-01 1.4756591618061066e-01 + <_> + + 0 -1 514 4.8757870681583881e-03 + + -1.2341982126235962e-01 2.3298588395118713e-01 + <_> + + 0 -1 344 3.1278211623430252e-02 + + -7.6286941766738892e-02 3.4027433395385742e-01 + <_> + + 0 -1 63 6.3753505237400532e-03 + + 7.3992513120174408e-02 -3.2609656453132629e-01 + <_> + + 0 -1 936 -9.8742637783288956e-04 + + 2.4873960018157959e-01 -9.0153135359287262e-02 + <_> + + 0 -1 217 -3.0144110321998596e-02 + + -5.1088541746139526e-01 5.0071869045495987e-02 + <_> + + 0 -1 268 4.7727730125188828e-03 + + 5.1353454589843750e-02 -4.1142973303794861e-01 + <_> + + 0 -1 420 6.4554966986179352e-02 + + 4.5133572071790695e-02 -4.8264691233634949e-01 + <_> + + 0 -1 744 8.0438675358891487e-03 + + -6.3803412020206451e-02 3.0405151844024658e-01 + <_> + + 0 -1 1051 1.0576066561043262e-03 + + 4.9984093755483627e-02 -3.3949175477027893e-01 + <_> + + 0 -1 938 6.8522170186042786e-03 + + 3.5091523081064224e-02 -6.7847234010696411e-01 + <_> + + 0 -1 860 -1.7977621406316757e-02 + + -3.7503832578659058e-01 4.0370170027017593e-02 + <_> + + 0 -1 748 -2.9955487698316574e-02 + + -4.2023807764053345e-01 4.2222321033477783e-02 + <_> + + 0 -1 14 2.0934976637363434e-02 + + 4.3809924274682999e-02 -4.1159108281135559e-01 + <_> + + 0 -1 499 -1.0348223149776459e-03 + + 1.7594149708747864e-01 -1.0171056538820267e-01 + <_> + + 0 -1 15 1.1026043444871902e-02 + + 3.7518307566642761e-02 -4.9795153737068176e-01 + <_> + + 0 -1 201 4.1434396989643574e-03 + + -7.7400334179401398e-02 2.3505100607872009e-01 + <_> + + 0 -1 423 -1.4838734641671181e-03 + + 2.9909220337867737e-01 -9.2648021876811981e-02 + <_> + + 0 -1 1025 4.0641101077198982e-03 + + 3.8187902420759201e-02 -5.9566622972488403e-01 + <_> + + 0 -1 108 -2.6055248454213142e-03 + + 1.4647382497787476e-01 -1.1769902706146240e-01 + <_> + + 0 -1 834 -1.8873009830713272e-02 + + 2.0791313052177429e-01 -9.1127894818782806e-02 + <_> + + 0 -1 960 1.0428125038743019e-02 + + 4.3083548545837402e-02 -4.1407048702239990e-01 + <_> + + 0 -1 460 1.9560819491744041e-03 + + -6.5898597240447998e-02 2.6488196849822998e-01 + <_> + + 0 -1 402 6.1143590137362480e-03 + + 4.7718580812215805e-02 -4.3339842557907104e-01 + <_> + + 0 -1 411 3.9817169308662415e-03 + + 2.8663935139775276e-02 -5.4472506046295166e-01 + <_> + + 0 -1 497 -9.0858177281916142e-04 + + 1.2656490504741669e-01 -1.3804104924201965e-01 + <_> + + 0 -1 548 -5.1833119243383408e-02 + + 2.9838389158248901e-01 -6.4876683056354523e-02 + <_> + + 0 -1 550 -6.1461031436920166e-02 + + 2.2751982510089874e-01 -7.7075794339179993e-02 + <_> + + 0 -1 771 -3.8890805444680154e-04 + + 1.4823918044567108e-01 -1.2443733215332031e-01 + <_> + + 0 -1 819 6.3632195815443993e-03 + + 3.3928975462913513e-02 -5.5825293064117432e-01 + <_> + + 0 -1 929 2.3877150379121304e-03 + + -6.0555700212717056e-02 2.9875907301902771e-01 + <_> + + 0 -1 718 2.1584378555417061e-03 + + 2.6707226410508156e-02 -6.5327596664428711e-01 + <_> + + 0 -1 972 1.3073299778625369e-03 + + -6.5057143568992615e-02 2.8509995341300964e-01 + <_> + + 0 -1 1023 2.7173646230949089e-05 + + -1.4736446738243103e-01 1.1435943096876144e-01 + <_> + + 0 -1 630 2.5558518245816231e-03 + + 2.2957315668463707e-02 -6.1825275421142578e-01 + <_> + + 0 -1 435 4.4789682142436504e-03 + + 3.6877695471048355e-02 -4.1827708482742310e-01 + <_> + + 0 -1 335 -4.0298998355865479e-02 + + -6.8164646625518799e-01 2.1755648776888847e-02 + <_> + + 0 -1 782 -3.2729938626289368e-02 + + -5.4164266586303711e-01 2.6013873517513275e-02 + <_> + + 0 -1 1011 -1.6982981469482183e-03 + + 3.5175332427024841e-01 -4.7216285020112991e-02 + <_> + + 0 -1 331 3.6859638057649136e-03 + + 4.9838334321975708e-02 -3.0565607547760010e-01 + <_> + + 0 -1 235 1.8905990291386843e-03 + + 2.3341298103332520e-02 -6.6700172424316406e-01 + <_> + + 0 -1 714 4.9954187124967575e-03 + + 2.5513354688882828e-02 -5.4635345935821533e-01 + <_> + + 0 -1 336 -5.5998284369707108e-03 + + 2.9532432556152344e-01 -5.9350244700908661e-02 + <_> + + 0 -1 1008 -1.0907559189945459e-03 + + 1.8265166878700256e-01 -9.8137028515338898e-02 + <_> + + 0 -1 975 -7.4323470471426845e-04 + + 1.9020494818687439e-01 -8.7386451661586761e-02 + <_> + + 0 -1 914 2.7787161525338888e-03 + + 3.2241951674222946e-02 -4.8055323958396912e-01 + <_> + + 0 -1 153 2.4344769772142172e-03 + + 4.6477138996124268e-02 -2.9923307895660400e-01 + <_> + + 0 -1 293 2.8132982552051544e-03 + + -9.0026579797267914e-02 1.6738441586494446e-01 + <_> + + 0 -1 73 3.2191604375839233e-02 + + -6.3697919249534607e-02 2.8380525112152100e-01 + <_> + + 0 -1 656 -1.8642821814864874e-03 + + 2.0616722106933594e-01 -7.4722714722156525e-02 + <_> + + 0 -1 657 4.0091956034302711e-03 + + -7.1015752851963043e-02 2.5589218735694885e-01 + <_> + + 0 -1 150 -5.1108514890074730e-03 + + -4.8940917849540710e-01 3.4555420279502869e-02 + <_> + + 0 -1 600 -1.9523575901985168e-02 + + 3.1921747326850891e-01 -5.1439035683870316e-02 + <_> + + 0 -1 298 -1.4431261457502842e-02 + + 1.4213174581527710e-01 -1.1113181710243225e-01 + <_> + + 0 -1 732 4.5302580110728741e-04 + + -1.0926237702369690e-01 1.4363190531730652e-01 + <_> + + 0 -1 78 -5.4108840413391590e-03 + + -4.6926099061965942e-01 3.1095381826162338e-02 + <_> + + 0 -1 259 1.6963672824203968e-03 + + -6.7337587475776672e-02 2.2115154564380646e-01 + <_> + + 0 -1 190 1.8719944637268782e-03 + + -5.8433420956134796e-02 2.7830049395561218e-01 + <_> + + 0 -1 1014 -8.3780642598867416e-03 + + -4.6290600299835205e-01 3.3701810985803604e-02 + <_> + + 0 -1 510 1.0720299184322357e-01 + + 2.6600774377584457e-02 -5.0957643985748291e-01 + <_> + + 0 -1 670 -1.5523867914453149e-03 + + -5.7974040508270264e-01 2.2188233211636543e-02 + <_> + + 0 -1 649 -1.0537400841712952e-02 + + -4.3835061788558960e-01 2.9434528201818466e-02 + <_> + + 0 -1 1038 3.1337797641754150e-02 + + 2.0445786416530609e-02 -6.3010692596435547e-01 + <_> + + 0 -1 1004 -5.1124744117259979e-02 + + -6.7282766103744507e-01 1.8230145797133446e-02 + <_> + + 0 -1 362 -6.0091790510341525e-04 + + 2.0237097144126892e-01 -7.2557553648948669e-02 + <_> + + 0 -1 409 1.6933252336457372e-03 + + -5.9000160545110703e-02 2.4010565876960754e-01 + <_> + + 0 -1 18 5.7134744711220264e-03 + + 2.9386352747678757e-02 -5.1309728622436523e-01 + <_> + + 0 -1 429 -9.6922749653458595e-03 + + -5.4907989501953125e-01 2.3704739287495613e-02 + <_> + + 0 -1 308 -1.2504560872912407e-02 + + -6.1863696575164795e-01 1.9876839593052864e-02 + <_> + + 0 -1 382 -9.1812955215573311e-03 + + -4.7697570919990540e-01 2.5203671306371689e-02 + <_> + + 0 -1 570 2.8069302439689636e-02 + + -5.5565606802701950e-02 2.5318285822868347e-01 + <_> + + 0 -1 573 4.6324366703629494e-03 + + 2.5273589417338371e-02 -5.9603255987167358e-01 + <_> + + 0 -1 784 2.9409723356366158e-03 + + -5.1576137542724609e-02 2.9322555661201477e-01 + <_> + + 0 -1 159 -1.6009721904993057e-02 + + 2.9389014840126038e-01 -4.7874812036752701e-02 + <_> + + 0 -1 355 -2.0468614995479584e-02 + + 1.4383009076118469e-01 -1.0160042345523834e-01 + <_> + + 0 -1 868 2.3338340222835541e-02 + + -5.7301126420497894e-02 2.9121819138526917e-01 + <_> + + 0 -1 921 -2.1875634789466858e-02 + + -6.4106851816177368e-01 2.4203805252909660e-02 + <_> + + 0 -1 427 1.1228370480239391e-02 + + -5.2143514156341553e-02 2.8465506434440613e-01 + <_> + + 0 -1 197 -4.3659657239913940e-03 + + -6.0558545589447021e-01 2.5440702214837074e-02 + <_> + + 0 -1 824 1.1577639961615205e-03 + + -8.9793093502521515e-02 1.6500258445739746e-01 + <_> + + 0 -1 781 1.1090341955423355e-02 + + 2.4472476914525032e-02 -6.1380225419998169e-01 + <_> + + 0 -1 1015 4.7660744749009609e-03 + + 4.1726417839527130e-02 -3.2548862695693970e-01 + <_> + + 0 -1 864 2.4865168597898446e-05 + + -1.2436556816101074e-01 1.1702288687229156e-01 + <_> + + 0 -1 823 -7.6379198580980301e-03 + + -4.9008071422576904e-01 2.9381709173321724e-02 + <_> + + 0 -1 445 -3.2750256359577179e-03 + + 1.7950019240379333e-01 -8.0592408776283264e-02 + <_> + + 0 -1 448 1.3944536913186312e-03 + + -8.0001771450042725e-02 2.2785140573978424e-01 + <_> + + 0 -1 444 1.9776031840592623e-03 + + 3.4109916538000107e-02 -4.8504865169525146e-01 + <_> + + 0 -1 39 -3.9329148828983307e-02 + + -6.8790251016616821e-01 1.7370922490954399e-02 + <_> + + 0 -1 645 -2.8447234071791172e-03 + + 2.3028372228145599e-01 -6.6618286073207855e-02 + <_> + + 0 -1 232 3.2375190407037735e-02 + + -7.5743824243545532e-02 1.7864570021629333e-01 + <_> + + 0 -1 5 5.1314428448677063e-02 + + -5.3142681717872620e-02 2.8643575310707092e-01 + <_> + + 0 -1 79 4.6999715268611908e-03 + + 3.5749543458223343e-02 -4.0437424182891846e-01 + <_> + + 0 -1 173 -2.0850417204201221e-03 + + -3.0815458297729492e-01 4.2763352394104004e-02 + <_> + + 0 -1 455 -9.1223767958581448e-04 + + 2.1245715022087097e-01 -6.7729450762271881e-02 + <_> + + 0 -1 690 -2.2479293693322688e-04 + + 1.3159312307834625e-01 -1.0141336172819138e-01 + <_> + + 0 -1 974 3.1234124675393105e-02 + + -8.9100256562232971e-02 1.5734429657459259e-01 + <_> + + 0 -1 465 -1.5079543227329850e-03 + + 3.2412421703338623e-01 -4.4387526810169220e-02 + + <_> + 100 + -1.2500010728836060e+00 + + <_> + + 0 -1 803 -5.5631361901760101e-03 + + 4.5343571901321411e-01 -5.2330773323774338e-02 + <_> + + 0 -1 426 4.1911248117685318e-03 + + -1.2266161292791367e-01 3.6830583214759827e-01 + <_> + + 0 -1 424 -1.8559540621936321e-03 + + 2.4044598639011383e-01 -1.5207393467426300e-01 + <_> + + 0 -1 532 -1.1846812441945076e-02 + + 2.7016878128051758e-01 -1.1934488266706467e-01 + <_> + + 0 -1 180 1.0401019826531410e-03 + + -2.3527304828166962e-01 9.5964968204498291e-02 + <_> + + 0 -1 462 9.3873767182230949e-03 + + -5.6923847645521164e-02 4.2236638069152832e-01 + <_> + + 0 -1 13 9.0843521058559418e-02 + + -6.3625380396842957e-02 3.8295668363571167e-01 + <_> + + 0 -1 439 -1.6221515834331512e-03 + + 1.8148291110992432e-01 -1.3424767553806305e-01 + <_> + + 0 -1 875 -1.8008962273597717e-02 + + 2.7346464991569519e-01 -7.6283894479274750e-02 + <_> + + 0 -1 278 8.6509017273783684e-03 + + 5.8148156851530075e-02 -5.2620184421539307e-01 + <_> + + 0 -1 726 2.8817038983106613e-03 + + 2.6940831914544106e-02 -4.7911167144775391e-01 + <_> + + 0 -1 263 -6.1017833650112152e-03 + + 1.7878855764865875e-01 -1.2378337979316711e-01 + <_> + + 0 -1 403 -5.9294269885867834e-04 + + -2.7179723978042603e-01 8.0951526761054993e-02 + <_> + + 0 -1 996 3.1696190126240253e-04 + + -1.7311862111091614e-01 1.0296358913183212e-01 + <_> + + 0 -1 519 6.6280784085392952e-03 + + -5.8870136737823486e-02 2.9477587342262268e-01 + <_> + + 0 -1 916 -4.5112203806638718e-03 + + -5.9672296047210693e-01 2.7053238824009895e-02 + <_> + + 0 -1 679 -4.3381296098232269e-02 + + -4.2040801048278809e-01 4.0890187025070190e-02 + <_> + + 0 -1 813 2.0323593635112047e-03 + + 5.5178079754114151e-02 -3.0439695715904236e-01 + <_> + + 0 -1 973 1.8127080984413624e-03 + + -8.2048252224922180e-02 2.1907366812229156e-01 + <_> + + 0 -1 359 -6.6424394026398659e-03 + + -4.7840338945388794e-01 4.4878169894218445e-02 + <_> + + 0 -1 903 -8.5755460895597935e-04 + + 1.3301849365234375e-01 -1.2699788808822632e-01 + <_> + + 0 -1 904 3.4769098274409771e-03 + + -7.1578972041606903e-02 2.5448271632194519e-01 + <_> + + 0 -1 950 -1.8520625308156013e-03 + + 1.5127970278263092e-01 -1.2349219620227814e-01 + <_> + + 0 -1 777 5.4582338780164719e-03 + + 3.5001352429389954e-02 -4.8021456599235535e-01 + <_> + + 0 -1 894 -6.4206691458821297e-03 + + -5.6509351730346680e-01 2.6883032172918320e-02 + <_> + + 0 -1 895 8.2498416304588318e-03 + + 4.3442543596029282e-02 -3.7965279817581177e-01 + <_> + + 0 -1 825 3.0813394114375114e-03 + + -5.6544844061136246e-02 3.2101437449455261e-01 + <_> + + 0 -1 865 2.8121876530349255e-03 + + -7.1444042026996613e-02 2.8035575151443481e-01 + <_> + + 0 -1 418 -1.1791236698627472e-02 + + 2.0067863166332245e-01 -1.0047248005867004e-01 + <_> + + 0 -1 476 1.4931729529052973e-03 + + -6.6428750753402710e-02 2.6187655329704285e-01 + <_> + + 0 -1 364 -2.8772680088877678e-03 + + -4.5838123559951782e-01 4.2477916926145554e-02 + <_> + + 0 -1 592 -4.5857336372137070e-03 + + 1.2718579173088074e-01 -1.3642288744449615e-01 + <_> + + 0 -1 585 -1.3770985417068005e-02 + + -6.4000308513641357e-01 2.7297915890812874e-02 + <_> + + 0 -1 746 -3.6472730338573456e-02 + + -5.1465278863906860e-01 3.1265191733837128e-02 + <_> + + 0 -1 378 1.0626764036715031e-02 + + 2.4199636653065681e-02 -6.3441967964172363e-01 + <_> + + 0 -1 509 -3.6817211657762527e-03 + + -4.4575414061546326e-01 3.1119547784328461e-02 + <_> + + 0 -1 856 -3.4752404317259789e-03 + + 1.4008119702339172e-01 -1.0539831966161728e-01 + <_> + + 0 -1 815 -4.7973562031984329e-03 + + 2.8762820363044739e-01 -6.0662355273962021e-02 + <_> + + 0 -1 773 6.4153699204325676e-03 + + -1.1230263859033585e-01 1.4087037742137909e-01 + <_> + + 0 -1 814 -1.0156400967389345e-03 + + -3.3441004157066345e-01 4.3477565050125122e-02 + <_> + + 0 -1 968 3.3057793043553829e-03 + + 1.9609324634075165e-02 -7.0060092210769653e-01 + <_> + + 0 -1 100 -5.3275022655725479e-03 + + 2.4580952525138855e-01 -6.0118518769741058e-02 + <_> + + 0 -1 469 1.5886269975453615e-03 + + -7.7446170151233673e-02 1.9878011941909790e-01 + <_> + + 0 -1 520 4.7287968918681145e-03 + + 3.0098341405391693e-02 -5.0950014591217041e-01 + <_> + + 0 -1 741 -1.9788878853432834e-04 + + 1.5142950415611267e-01 -9.6688762307167053e-02 + <_> + + 0 -1 389 -4.9208370037376881e-03 + + -4.5343187451362610e-01 3.7627156823873520e-02 + <_> + + 0 -1 361 4.5094583183526993e-02 + + -8.5510566830635071e-02 1.7849470674991608e-01 + <_> + + 0 -1 944 1.4799998607486486e-03 + + -6.4638271927833557e-02 2.3496921360492706e-01 + <_> + + 0 -1 517 1.0061380267143250e-01 + + -3.0139762908220291e-02 4.9012109637260437e-01 + <_> + + 0 -1 688 -5.2844230085611343e-03 + + 1.7104546725749969e-01 -8.7710574269294739e-02 + <_> + + 0 -1 626 -8.3214940968900919e-04 + + -2.6654696464538574e-01 5.3875535726547241e-02 + <_> + + 0 -1 190 -8.8889291509985924e-04 + + 1.8824113905429840e-01 -8.0119885504245758e-02 + <_> + + 0 -1 191 2.2177316714078188e-03 + + -6.9703146815299988e-02 2.0391084253787994e-01 + <_> + + 0 -1 674 -1.1522162239998579e-03 + + -3.6508113145828247e-01 3.9048090577125549e-02 + <_> + + 0 -1 1036 -1.0836161673069000e-02 + + -5.8106678724288940e-01 2.1713526919484138e-02 + <_> + + 0 -1 82 -1.6731536388397217e-01 + + -4.7344669699668884e-01 2.6662701740860939e-02 + <_> + + 0 -1 515 -9.5267388969659805e-03 + + 2.7732986211776733e-01 -5.6512769311666489e-02 + <_> + + 0 -1 329 6.6450019367039204e-03 + + 2.9381312429904938e-02 -5.3565382957458496e-01 + <_> + + 0 -1 104 -2.1554589271545410e-02 + + -6.2839144468307495e-01 1.8782904371619225e-02 + <_> + + 0 -1 892 1.4288825332187116e-04 + + -1.2763719260692596e-01 1.0616952925920486e-01 + <_> + + 0 -1 319 1.8068919889628887e-03 + + 4.2757544666528702e-02 -3.2102146744728088e-01 + <_> + + 0 -1 979 1.2280542869120836e-03 + + -5.7478122413158417e-02 2.5948432087898254e-01 + <_> + + 0 -1 89 2.6250675320625305e-02 + + -9.5928788185119629e-02 1.4502045512199402e-01 + <_> + + 0 -1 336 1.8192850984632969e-03 + + -6.8028703331947327e-02 2.3167446255683899e-01 + <_> + + 0 -1 44 -4.8545510508120060e-03 + + -4.3374514579772949e-01 3.6196250468492508e-02 + <_> + + 0 -1 762 2.8766903560608625e-03 + + 3.8431353867053986e-02 -3.3900904655456543e-01 + <_> + + 0 -1 793 4.4511677697300911e-03 + + -4.8704307526350021e-02 2.9764902591705322e-01 + <_> + + 0 -1 545 -9.9098179489374161e-03 + + 2.5863200426101685e-01 -5.7418409734964371e-02 + <_> + + 0 -1 2 -2.6503708213567734e-03 + + 1.3571591675281525e-01 -1.1608450859785080e-01 + <_> + + 0 -1 1 -3.0543167144060135e-02 + + 2.8910955786705017e-01 -5.1689133048057556e-02 + <_> + + 0 -1 698 -2.6757145300507545e-02 + + 1.8446540832519531e-01 -7.7666454017162323e-02 + <_> + + 0 -1 131 -2.2985447198152542e-02 + + -3.5471677780151367e-01 4.1345477104187012e-02 + <_> + + 0 -1 536 9.5467511564493179e-03 + + -5.5719308555126190e-02 2.4589607119560242e-01 + <_> + + 0 -1 730 2.6181992143392563e-03 + + -1.0256808251142502e-01 1.3319683074951172e-01 + <_> + + 0 -1 1031 -3.5491142421960831e-02 + + -5.9519535303115845e-01 2.2935084998607635e-02 + <_> + + 0 -1 703 1.5474080573767424e-03 + + -8.4649838507175446e-02 1.6198579967021942e-01 + <_> + + 0 -1 861 -3.4878745209425688e-03 + + -5.0121647119522095e-01 2.6359066367149353e-02 + <_> + + 0 -1 601 3.6612942349165678e-03 + + -7.2178244590759277e-02 1.8415448069572449e-01 + <_> + + 0 -1 692 -2.1762652322649956e-03 + + 2.1102276444435120e-01 -6.4692504703998566e-02 + <_> + + 0 -1 66 -6.9864131510257721e-03 + + -4.3104550242424011e-01 3.3448409289121628e-02 + <_> + + 0 -1 64 4.7067347913980484e-03 + + 4.7681909054517746e-02 -3.1132212281227112e-01 + <_> + + 0 -1 1054 -7.0012239739298820e-03 + + -3.4665238857269287e-01 3.6263268440961838e-02 + <_> + + 0 -1 36 1.0144514963030815e-02 + + 3.3140499144792557e-02 -3.7149414420127869e-01 + <_> + + 0 -1 927 2.5893552228808403e-03 + + -5.6186988949775696e-02 2.3859155178070068e-01 + <_> + + 0 -1 877 -3.8091647438704967e-03 + + 1.8803173303604126e-01 -9.0667806565761566e-02 + <_> + + 0 -1 559 -2.5004068017005920e-01 + + -5.7437247037887573e-01 2.3015361279249191e-02 + <_> + + 0 -1 651 -8.5459719412028790e-04 + + -3.0019384622573853e-01 4.1898671537637711e-02 + <_> + + 0 -1 556 -1.5604835003614426e-02 + + -5.8520871400833130e-01 2.1410541608929634e-02 + <_> + + 0 -1 654 -1.9794562458992004e-01 + + -6.7963910102844238e-01 1.6488522291183472e-02 + <_> + + 0 -1 896 -1.9824346527457237e-03 + + 1.4493939280509949e-01 -8.7999224662780762e-02 + <_> + + 0 -1 582 -2.1158650517463684e-02 + + -6.4664304256439209e-01 2.4590896442532539e-02 + <_> + + 0 -1 837 -9.3553803162649274e-04 + + 1.8229192495346069e-01 -7.2682343423366547e-02 + <_> + + 0 -1 610 -1.1120189446955919e-03 + + 1.5188181400299072e-01 -8.6225852370262146e-02 + <_> + + 0 -1 316 1.1543033272027969e-01 + + -4.7091111540794373e-02 3.5574361681938171e-01 + <_> + + 0 -1 568 -5.2959467284381390e-03 + + 2.0496748387813568e-01 -6.1289250850677490e-02 + <_> + + 0 -1 310 -2.6194794103503227e-02 + + 1.7320305109024048e-01 -1.1094193905591965e-01 + <_> + + 0 -1 167 1.4183738268911839e-02 + + -9.7011148929595947e-02 1.4372280240058899e-01 + <_> + + 0 -1 1032 -3.6340979859232903e-03 + + -4.0951785445213318e-01 3.0991807579994202e-02 + <_> + + 0 -1 1028 1.4448106288909912e-02 + + -6.1627220362424850e-02 2.0916682481765747e-01 + <_> + + 0 -1 982 -1.1399465613067150e-02 + + 1.8926219642162323e-01 -8.7004892528057098e-02 + + <_> + 100 + -1.2953979969024658e+00 + + <_> + + 0 -1 725 1.6048721969127655e-02 + + -9.5187164843082428e-02 3.7635341286659241e-01 + <_> + + 0 -1 239 4.1785854846239090e-03 + + -1.4184002578258514e-01 3.1887301802635193e-01 + <_> + + 0 -1 526 -6.7659835331141949e-03 + + 3.7005490064620972e-01 -8.9318118989467621e-02 + <_> + + 0 -1 186 1.4478694647550583e-02 + + -1.3418816030025482e-01 2.8370034694671631e-01 + <_> + + 0 -1 411 -1.8653089646250010e-03 + + -3.5015934705734253e-01 6.9187328219413757e-02 + <_> + + 0 -1 901 3.7634610198438168e-03 + + -7.7612839639186859e-02 3.0384179949760437e-01 + <_> + + 0 -1 353 8.9913085103034973e-03 + + 6.0584690421819687e-02 -4.7271341085433960e-01 + <_> + + 0 -1 121 -3.0867164023220539e-03 + + 1.6870087385177612e-01 -1.3231597840785980e-01 + <_> + + 0 -1 388 -4.0246914140880108e-03 + + -4.1840493679046631e-01 6.4627721905708313e-02 + <_> + + 0 -1 896 4.8679644241929054e-03 + + -5.6233335286378860e-02 4.2156839370727539e-01 + <_> + + 0 -1 480 5.5472417734563351e-03 + + 3.7891130894422531e-02 -5.1408857107162476e-01 + <_> + + 0 -1 1003 6.5884483046829700e-04 + + -1.6457377374172211e-01 1.1204792559146881e-01 + <_> + + 0 -1 1050 -1.0980388615280390e-03 + + -3.3544427156448364e-01 4.6025454998016357e-02 + <_> + + 0 -1 583 -2.8328509069979191e-03 + + 2.3426958918571472e-01 -7.2758100926876068e-02 + <_> + + 0 -1 56 1.5504788607358932e-03 + + 6.2664858996868134e-02 -2.5632002949714661e-01 + <_> + + 0 -1 348 -6.2153179896995425e-04 + + 1.7485393583774567e-01 -9.9982917308807373e-02 + <_> + + 0 -1 675 -1.4540781266987324e-02 + + -4.4969236850738525e-01 3.7324137985706329e-02 + <_> + + 0 -1 792 -1.6624422278255224e-03 + + 1.4047256112098694e-01 -1.1892398446798325e-01 + <_> + + 0 -1 893 1.6246617306023836e-03 + + 6.1172962188720703e-02 -2.7449882030487061e-01 + <_> + + 0 -1 87 -1.1364535987377167e-01 + + -4.3175131082534790e-01 3.8861453533172607e-02 + <_> + + 0 -1 29 6.3355863094329834e-03 + + 4.3615639209747314e-02 -3.7530297040939331e-01 + <_> + + 0 -1 88 -7.9950205981731415e-03 + + -5.6157833337783813e-01 2.7148496359586716e-02 + <_> + + 0 -1 825 -6.0972268693149090e-03 + + 4.7499263286590576e-01 -3.5678520798683167e-02 + <_> + + 0 -1 933 1.3845593202859163e-03 + + -1.1575383692979813e-01 1.3405258953571320e-01 + <_> + + 0 -1 351 8.5432223975658417e-02 + + -5.6930482387542725e-02 3.1373351812362671e-01 + <_> + + 0 -1 661 -1.2029780447483063e-01 + + -4.7989824414253235e-01 3.8594469428062439e-02 + <_> + + 0 -1 829 -8.3766942843794823e-03 + + -2.0806340873241425e-01 7.6934777200222015e-02 + <_> + + 0 -1 673 -4.6590538695454597e-03 + + -5.0349289178848267e-01 3.0419014394283295e-02 + <_> + + 0 -1 453 -3.2761119306087494e-02 + + 3.2354715466499329e-01 -5.6276485323905945e-02 + <_> + + 0 -1 783 8.3009023219347000e-03 + + -8.3831317722797394e-02 2.3335608839988708e-01 + <_> + + 0 -1 848 5.7156109251081944e-03 + + -8.6484365165233612e-02 1.8363620340824127e-01 + <_> + + 0 -1 518 -1.0080671310424805e-01 + + 3.8774350285530090e-01 -4.0828518569469452e-02 + <_> + + 0 -1 14 -2.5552421808242798e-02 + + -5.0166463851928711e-01 3.8269419223070145e-02 + <_> + + 0 -1 23 -6.1748407781124115e-02 + + -3.5811841487884521e-01 4.6544160693883896e-02 + <_> + + 0 -1 702 -1.2269845232367516e-02 + + 2.0786920189857483e-01 -7.8518457710742950e-02 + <_> + + 0 -1 11 2.8048269450664520e-02 + + -5.6248739361763000e-02 2.8977242112159729e-01 + <_> + + 0 -1 523 -7.2269486263394356e-03 + + -7.2842431068420410e-01 2.3379294201731682e-02 + <_> + + 0 -1 952 4.7771912068128586e-03 + + 2.3226773366332054e-02 -5.6412339210510254e-01 + <_> + + 0 -1 276 2.8181755915284157e-03 + + -3.3893339335918427e-02 4.3989458680152893e-01 + <_> + + 0 -1 194 -8.4437360055744648e-04 + + 1.9623728096485138e-01 -7.8485630452632904e-02 + <_> + + 0 -1 407 -4.3037505820393562e-03 + + -3.6311796307563782e-01 4.0526941418647766e-02 + <_> + + 0 -1 105 4.9789976328611374e-03 + + 4.8658054322004318e-02 -3.1162264943122864e-01 + <_> + + 0 -1 1041 -5.0353109836578369e-03 + + -5.5396872758865356e-01 2.3420164361596107e-02 + <_> + + 0 -1 837 -1.3716940302401781e-03 + + 2.2532704472541809e-01 -6.2741614878177643e-02 + <_> + + 0 -1 910 3.3456790260970592e-03 + + 3.8516163825988770e-02 -3.6224716901779175e-01 + <_> + + 0 -1 476 1.9023896893486381e-03 + + -5.4677281528711319e-02 2.5294607877731323e-01 + <_> + + 0 -1 1037 -1.4274399727582932e-03 + + -3.7934723496437073e-01 3.8707002997398376e-02 + <_> + + 0 -1 512 1.1010284069925547e-03 + + -9.5659099519252777e-02 1.4958517253398895e-01 + <_> + + 0 -1 219 -4.4154529459774494e-03 + + -5.1156622171401978e-01 2.5640288367867470e-02 + <_> + + 0 -1 448 3.7023271434009075e-03 + + -4.3221119791269302e-02 3.2581970095634460e-01 + <_> + + 0 -1 237 -5.4480084218084812e-03 + + -4.7611567378044128e-01 3.5773757845163345e-02 + <_> + + 0 -1 313 -3.1974539160728455e-04 + + 1.1916244029998779e-01 -1.1832383275032043e-01 + <_> + + 0 -1 381 -2.8494147583842278e-02 + + -6.5004557371139526e-01 2.0599177107214928e-02 + <_> + + 0 -1 941 -2.7449331246316433e-03 + + -3.9275056123733521e-01 3.3223718404769897e-02 + <_> + + 0 -1 937 4.1362000629305840e-03 + + 2.7191400527954102e-02 -4.7952741384506226e-01 + <_> + + 0 -1 638 3.3568721264600754e-03 + + -6.0983922332525253e-02 2.2964073717594147e-01 + <_> + + 0 -1 571 -5.7129040360450745e-03 + + -5.9052920341491699e-01 2.3388050496578217e-02 + <_> + + 0 -1 477 -1.1567326728254557e-03 + + 1.5093772113323212e-01 -9.1553181409835815e-02 + <_> + + 0 -1 143 -8.9379055425524712e-03 + + -3.5481104254722595e-01 3.6294396966695786e-02 + <_> + + 0 -1 811 3.6097350530326366e-03 + + 3.2780081033706665e-02 -3.8517734408378601e-01 + <_> + + 0 -1 975 2.0727193914353848e-03 + + -5.3627125918865204e-02 2.5666573643684387e-01 + <_> + + 0 -1 977 -1.8177125602960587e-03 + + 2.0363596081733704e-01 -7.0555560290813446e-02 + <_> + + 0 -1 932 -3.3223466016352177e-03 + + -4.8926571011543274e-01 2.8675178065896034e-02 + <_> + + 0 -1 553 -4.4222660362720490e-03 + + -4.0920063853263855e-01 3.0863059684634209e-02 + <_> + + 0 -1 705 -7.8024319373071194e-04 + + 1.2166435271501541e-01 -1.0897941887378693e-01 + <_> + + 0 -1 850 7.9855127260088921e-03 + + 2.5865448638796806e-02 -4.8917418718338013e-01 + <_> + + 0 -1 99 -2.7752606911235489e-05 + + 1.1611134558916092e-01 -1.1225233227014542e-01 + <_> + + 0 -1 641 3.0770362354815006e-03 + + -6.4753420650959015e-02 1.9632078707218170e-01 + <_> + + 0 -1 593 -2.1007210016250610e-03 + + 1.9681814312934875e-01 -9.4167068600654602e-02 + <_> + + 0 -1 112 -6.1383144930005074e-03 + + -3.9225277304649353e-01 3.5275831818580627e-02 + <_> + + 0 -1 119 1.1184177361428738e-02 + + 2.9410628601908684e-02 -4.3673589825630188e-01 + <_> + + 0 -1 1007 1.0432782582938671e-03 + + -6.7393802106380463e-02 1.9237922132015228e-01 + <_> + + 0 -1 931 8.5366604616865516e-04 + + -8.4067851305007935e-02 1.6720806062221527e-01 + <_> + + 0 -1 55 -3.3059090375900269e-02 + + 2.6451063156127930e-01 -5.2662543952465057e-02 + <_> + + 0 -1 161 -8.7435375899076462e-03 + + -3.0780994892120361e-01 4.8419766128063202e-02 + <_> + + 0 -1 907 -1.1587596964091063e-03 + + 1.4863640069961548e-01 -9.4251774251461029e-02 + <_> + + 0 -1 295 -2.2717786952853203e-02 + + -4.2414310574531555e-01 3.5150803625583649e-02 + <_> + + 0 -1 810 -8.4660220891237259e-03 + + 2.5765278935432434e-01 -5.4796367883682251e-02 + <_> + + 0 -1 492 -1.4943551504984498e-03 + + -2.7729934453964233e-01 4.9375709146261215e-02 + <_> + + 0 -1 0 -7.5480109080672264e-04 + + 1.2197802960872650e-01 -1.0845532268285751e-01 + <_> + + 0 -1 853 2.9903287068009377e-03 + + -8.4785357117652893e-02 1.5424512326717377e-01 + <_> + + 0 -1 1040 1.7600806895643473e-03 + + 7.0044547319412231e-02 -1.9795240461826324e-01 + <_> + + 0 -1 154 1.2243577279150486e-02 + + -7.8472696244716644e-02 1.7095038294792175e-01 + <_> + + 0 -1 80 -2.7739753946661949e-02 + + 2.0475350320339203e-01 -6.9862313568592072e-02 + <_> + + 0 -1 300 -6.4486754126846790e-03 + + -3.7651637196540833e-01 3.3540505915880203e-02 + <_> + + 0 -1 341 -1.3427068479359150e-02 + + 1.5320046246051788e-01 -8.3272159099578857e-02 + <_> + + 0 -1 360 8.2654636353254318e-03 + + -8.1395141780376434e-02 1.9696740806102753e-01 + <_> + + 0 -1 616 3.0615129508078098e-03 + + -5.8534789830446243e-02 2.1799990534782410e-01 + <_> + + 0 -1 616 -1.4359520282596350e-03 + + 1.8553669750690460e-01 -7.9428143799304962e-02 + <_> + + 0 -1 488 2.8793164528906345e-03 + + 3.7499722093343735e-02 -3.5483118891716003e-01 + <_> + + 0 -1 631 -9.0899681672453880e-03 + + -5.9031629562377930e-01 2.0012531429529190e-02 + <_> + + 0 -1 896 1.6797243151813745e-03 + + -6.8868115544319153e-02 1.8992543220520020e-01 + <_> + + 0 -1 581 -1.1759581044316292e-02 + + 3.6288693547248840e-01 -3.3578243106603622e-02 + <_> + + 0 -1 749 3.8305222988128662e-03 + + -6.6793553531169891e-02 1.9304293394088745e-01 + <_> + + 0 -1 1018 1.2506111524999142e-03 + + -8.1618689000606537e-02 1.5481384098529816e-01 + <_> + + 0 -1 379 -1.6119323670864105e-02 + + 1.4024992287158966e-01 -9.3965478241443634e-02 + <_> + + 0 -1 576 -7.2789913974702358e-04 + + 1.9554650783538818e-01 -7.2329640388488770e-02 + <_> + + 0 -1 178 1.4888901496306062e-03 + + 3.3372651785612106e-02 -4.0691211819648743e-01 + <_> + + 0 -1 984 -4.9822013825178146e-03 + + -3.3125448226928711e-01 3.6899805068969727e-02 + <_> + + 0 -1 1053 9.4443336129188538e-03 + + 3.1763385981321335e-02 -3.7651473283767700e-01 + + <_> + 100 + -1.3101767301559448e+00 + + <_> + + 0 -1 535 -1.2652185745537281e-02 + + 4.0350878238677979e-01 -8.6829073727130890e-02 + <_> + + 0 -1 386 4.8778904601931572e-03 + + -9.1208808124065399e-02 4.8882400989532471e-01 + <_> + + 0 -1 875 -2.4099014699459076e-02 + + 3.6089360713958740e-01 -1.1495783179998398e-01 + <_> + + 0 -1 955 1.7244052141904831e-03 + + -1.5974776446819305e-01 1.6197346150875092e-01 + <_> + + 0 -1 478 -3.6334272008389235e-03 + + 2.7575418353080750e-01 -9.4314105808734894e-02 + <_> + + 0 -1 874 -3.4076566807925701e-03 + + 2.2806543111801147e-01 -1.1266379803419113e-01 + <_> + + 0 -1 343 8.8951038196682930e-03 + + -6.6720969974994659e-02 3.3090111613273621e-01 + <_> + + 0 -1 886 -2.4365000426769257e-03 + + -4.6264356374740601e-01 5.9559248387813568e-02 + <_> + + 0 -1 134 1.6330357640981674e-02 + + 6.1187297105789185e-02 -4.2252638936042786e-01 + <_> + + 0 -1 92 8.4438512567430735e-04 + + -1.6640183329582214e-01 1.1608948558568954e-01 + <_> + + 0 -1 841 2.9493896290659904e-03 + + -9.1952294111251831e-02 2.0670032501220703e-01 + <_> + + 0 -1 40 3.4696407616138458e-02 + + -8.0334044992923737e-02 2.8779104351997375e-01 + <_> + + 0 -1 893 -3.3343117684125900e-03 + + -5.9474521875381470e-01 3.6547001451253891e-02 + <_> + + 0 -1 761 9.3975086929276586e-04 + + -1.5703736245632172e-01 1.1884722858667374e-01 + <_> + + 0 -1 174 -3.4337402321398258e-03 + + -5.6122291088104248e-01 3.2535579055547714e-02 + <_> + + 0 -1 1010 2.6463428512215614e-03 + + -7.0756055414676666e-02 2.5195503234863281e-01 + <_> + + 0 -1 334 -5.4167490452528000e-04 + + 1.2782673537731171e-01 -1.3642209768295288e-01 + <_> + + 0 -1 219 2.6469756849110126e-03 + + 4.3448049575090408e-02 -4.2012536525726318e-01 + <_> + + 0 -1 467 -3.8945327978581190e-03 + + -3.4613665938377380e-01 4.6863511204719543e-02 + <_> + + 0 -1 258 1.0849055834114552e-03 + + -7.2841711342334747e-02 2.2674085199832916e-01 + <_> + + 0 -1 258 -9.8655023612082005e-04 + + 2.5967630743980408e-01 -8.0196425318717957e-02 + <_> + + 0 -1 204 4.3801497668027878e-03 + + 2.8548270463943481e-02 -6.2486541271209717e-01 + <_> + + 0 -1 554 3.1944573856890202e-04 + + -1.4062304794788361e-01 1.1761485785245895e-01 + <_> + + 0 -1 300 6.6440929658710957e-03 + + 3.2654736191034317e-02 -4.6211913228034973e-01 + <_> + + 0 -1 42 7.0357543881982565e-04 + + 7.5751155614852905e-02 -1.9804775714874268e-01 + <_> + + 0 -1 446 5.4024737328290939e-03 + + -6.1951220035552979e-02 2.4502439796924591e-01 + <_> + + 0 -1 502 7.2796619497239590e-03 + + -5.9379905462265015e-02 2.5588110089302063e-01 + <_> + + 0 -1 169 -1.5059831552207470e-02 + + -6.6548824310302734e-01 2.2492453455924988e-02 + <_> + + 0 -1 270 -4.6248016878962517e-03 + + -3.4483894705772400e-01 4.2247168719768524e-02 + <_> + + 0 -1 290 1.4736279845237732e-03 + + 3.3624436706304550e-02 -4.1066497564315796e-01 + <_> + + 0 -1 110 4.0667224675416946e-03 + + -8.6238399147987366e-02 1.6550070047378540e-01 + <_> + + 0 -1 113 -1.2728295987471938e-03 + + 1.9737298786640167e-01 -9.5425128936767578e-02 + <_> + + 0 -1 957 -1.5297440811991692e-02 + + -5.9287589788436890e-01 2.3890895769000053e-02 + <_> + + 0 -1 969 -2.9415758326649666e-03 + + -4.8744291067123413e-01 2.8945079073309898e-02 + <_> + + 0 -1 840 9.3173712957650423e-04 + + -8.9065223932266235e-02 1.6721877455711365e-01 + <_> + + 0 -1 791 2.1161064505577087e-03 + + -5.8501452207565308e-02 2.7767315506935120e-01 + <_> + + 0 -1 579 -3.7564497906714678e-03 + + 2.6502594351768494e-01 -5.3400754928588867e-02 + <_> + + 0 -1 224 1.9215289503335953e-02 + + 3.6197379231452942e-02 -3.9996260404586792e-01 + <_> + + 0 -1 276 -5.8480387087911367e-04 + + 1.7670612037181854e-01 -8.0434471368789673e-02 + <_> + + 0 -1 62 1.7193648964166641e-02 + + 2.1810308098793030e-02 -6.6349571943283081e-01 + <_> + + 0 -1 394 -1.5182361006736755e-02 + + 2.4825552105903625e-01 -6.3092373311519623e-02 + <_> + + 0 -1 712 3.0793007463216782e-03 + + 2.4977168068289757e-02 -5.3303867578506470e-01 + <_> + + 0 -1 410 -2.4421955458819866e-03 + + -3.6828973889350891e-01 3.3543743193149567e-02 + <_> + + 0 -1 1011 7.0760864764451981e-04 + + -7.0839107036590576e-02 1.9299270212650299e-01 + <_> + + 0 -1 280 -2.9198618140071630e-03 + + -4.2773759365081787e-01 3.4788779914379120e-02 + <_> + + 0 -1 77 4.9937088042497635e-03 + + 3.5642433911561966e-02 -3.7421676516532898e-01 + <_> + + 0 -1 701 3.1980490311980247e-03 + + -6.5103210508823395e-02 2.1381905674934387e-01 + <_> + + 0 -1 320 -1.1253832839429379e-02 + + 1.9790579378604889e-01 -7.1859836578369141e-02 + <_> + + 0 -1 496 -3.6279223859310150e-02 + + 1.7960831522941589e-01 -9.7373597323894501e-02 + <_> + + 0 -1 606 2.5160997174680233e-03 + + 4.7910790890455246e-02 -2.7035105228424072e-01 + <_> + + 0 -1 597 1.2429051566869020e-03 + + -7.8723609447479248e-02 1.7209371924400330e-01 + <_> + + 0 -1 600 -1.6120750457048416e-02 + + 2.6868200302124023e-01 -5.0688084214925766e-02 + <_> + + 0 -1 676 1.9487962126731873e-03 + + 4.2773328721523285e-02 -3.2401460409164429e-01 + <_> + + 0 -1 371 7.1887858211994171e-04 + + -9.3979224562644958e-02 1.4450067281723022e-01 + <_> + + 0 -1 315 2.4896476417779922e-02 + + 3.0655095353722572e-02 -4.5330229401588440e-01 + <_> + + 0 -1 1026 -3.9382722228765488e-02 + + -7.5473642349243164e-01 1.4460344798862934e-02 + <_> + + 0 -1 16 1.6916246712207794e-01 + + 1.8219815567135811e-02 -6.0212779045104980e-01 + <_> + + 0 -1 327 2.6912155590252951e-05 + + -1.3110430538654327e-01 1.0080647468566895e-01 + <_> + + 0 -1 720 -1.1350987479090691e-03 + + -3.5285457968711853e-01 3.5424951463937759e-02 + <_> + + 0 -1 275 -5.3854554425925016e-04 + + 1.6519539058208466e-01 -8.5205554962158203e-02 + <_> + + 0 -1 1006 -7.9703063238412142e-04 + + 1.2170238047838211e-01 -1.1191177368164062e-01 + <_> + + 0 -1 1055 6.4357938244938850e-03 + + 2.3892326280474663e-02 -5.2907115221023560e-01 + <_> + + 0 -1 184 3.5384115763008595e-03 + + 1.5895446762442589e-02 -7.3063355684280396e-01 + <_> + + 0 -1 503 -5.9715351089835167e-03 + + -4.9897637963294983e-01 2.2720154374837875e-02 + <_> + + 0 -1 500 -1.3486531376838684e-01 + + 4.7622504830360413e-01 -3.0212458223104477e-02 + <_> + + 0 -1 824 1.5813487116247416e-03 + + -6.4366899430751801e-02 1.9106543064117432e-01 + <_> + + 0 -1 438 1.2239011703059077e-03 + + 3.5654775798320770e-02 -3.6865225434303284e-01 + <_> + + 0 -1 871 1.5586249064654112e-03 + + -7.6894849538803101e-02 1.7627324163913727e-01 + <_> + + 0 -1 807 8.1224087625741959e-03 + + -9.0349502861499786e-02 1.4695085585117340e-01 + <_> + + 0 -1 693 -1.1717316228896379e-03 + + -4.2172068357467651e-01 3.2626960426568985e-02 + <_> + + 0 -1 863 3.1573872547596693e-03 + + 1.6080003231763840e-02 -7.3708915710449219e-01 + <_> + + 0 -1 328 -6.0417165514081717e-04 + + 1.3188406825065613e-01 -1.0221557319164276e-01 + <_> + + 0 -1 870 5.9989960864186287e-03 + + -5.6194521486759186e-02 2.4262723326683044e-01 + <_> + + 0 -1 285 9.2063043266534805e-03 + + -7.4052155017852783e-02 1.9847218692302704e-01 + <_> + + 0 -1 759 5.9181386604905128e-03 + + 2.7928760275244713e-02 -5.3380137681961060e-01 + <_> + + 0 -1 637 2.2121241781860590e-03 + + -7.4788182973861694e-02 1.9799898564815521e-01 + <_> + + 0 -1 634 1.5453733503818512e-03 + + -8.1615962088108063e-02 1.7845135927200317e-01 + <_> + + 0 -1 48 -2.7309993747621775e-03 + + -2.9415401816368103e-01 4.8099983483552933e-02 + <_> + + 0 -1 288 1.5755122527480125e-02 + + -8.2719191908836365e-02 1.5387716889381409e-01 + <_> + + 0 -1 358 -5.5120363831520081e-02 + + -2.7076271176338196e-01 5.2753895521163940e-02 + <_> + + 0 -1 188 2.9593750834465027e-01 + + -2.5313137099146843e-02 5.3404790163040161e-01 + <_> + + 0 -1 755 -1.1218986473977566e-03 + + 1.1400944739580154e-01 -1.1270149052143097e-01 + <_> + + 0 -1 12 -3.7802509963512421e-02 + + 3.1571185588836670e-01 -4.9672659486532211e-02 + <_> + + 0 -1 122 7.6384171843528748e-03 + + -1.0544487833976746e-01 1.6579298675060272e-01 + <_> + + 0 -1 586 6.8679507821798325e-03 + + -6.0160953551530838e-02 2.2640766203403473e-01 + <_> + + 0 -1 443 5.1510091871023178e-02 + + 2.6919802650809288e-02 -5.1188707351684570e-01 + <_> + + 0 -1 997 -1.7317479476332664e-02 + + 2.8218811750411987e-01 -4.4739942997694016e-02 + <_> + + 0 -1 430 8.3876429125666618e-03 + + -5.7016383856534958e-02 2.2617760300636292e-01 + <_> + + 0 -1 625 9.2909142374992371e-02 + + 3.1283479183912277e-02 -4.9390810728073120e-01 + <_> + + 0 -1 457 4.8232711851596832e-03 + + 2.4896934628486633e-02 -4.5571261644363403e-01 + <_> + + 0 -1 484 2.3969253525137901e-03 + + 2.3365976288914680e-02 -4.8319596052169800e-01 + <_> + + 0 -1 599 -3.8546645082533360e-03 + + 2.0274488627910614e-01 -5.8264043182134628e-02 + <_> + + 0 -1 647 -1.2048919452354312e-03 + + -3.4361392259597778e-01 3.4746967256069183e-02 + <_> + + 0 -1 734 -1.6053356230258942e-02 + + 1.8685258924961090e-01 -6.7979305982589722e-02 + <_> + + 0 -1 1045 -2.1703056991100311e-02 + + -5.0804340839385986e-01 2.5113353505730629e-02 + <_> + + 0 -1 541 -1.9719875417649746e-03 + + -2.7325069904327393e-01 4.3638698756694794e-02 + <_> + + 0 -1 465 -1.3189280871301889e-03 + + 2.5198838114738464e-01 -4.8170279711484909e-02 + <_> + + 0 -1 465 1.3257672544568777e-03 + + -6.6290155053138733e-02 2.6572498679161072e-01 + <_> + + 0 -1 1024 -2.5993511080741882e-03 + + -7.1209841966629028e-01 1.9255550578236580e-02 + <_> + + 0 -1 926 4.0416182018816471e-03 + + 2.4820772930979729e-02 -4.3810126185417175e-01 + + <_> + + <_> + 0 0 2 4 -1. + <_> + 0 2 2 2 2. + 0 + <_> + + <_> + 0 0 6 14 -1. + <_> + 0 0 3 7 2. + <_> + 3 7 3 7 2. + 0 + <_> + + <_> + 0 0 8 1 -1. + <_> + 4 0 4 1 2. + 0 + <_> + + <_> + 0 0 8 2 -1. + <_> + 4 0 4 2 2. + 0 + <_> + + <_> + 0 0 8 6 -1. + <_> + 0 0 4 3 2. + <_> + 4 3 4 3 2. + 0 + <_> + + <_> + 0 0 8 12 -1. + <_> + 0 0 4 6 2. + <_> + 4 6 4 6 2. + 0 + <_> + + <_> + 0 0 8 14 -1. + <_> + 0 0 4 7 2. + <_> + 4 7 4 7 2. + 0 + <_> + + <_> + 0 0 10 6 -1. + <_> + 0 0 5 3 2. + <_> + 5 3 5 3 2. + 0 + <_> + + <_> + 0 0 10 8 -1. + <_> + 0 0 5 4 2. + <_> + 5 4 5 4 2. + 0 + <_> + + <_> + 0 0 18 13 -1. + <_> + 6 0 6 13 3. + 0 + <_> + + <_> + 0 0 14 10 -1. + <_> + 0 0 7 5 2. + <_> + 7 5 7 5 2. + 0 + <_> + + <_> + 0 0 24 1 -1. + <_> + 8 0 8 1 3. + 0 + <_> + + <_> + 0 0 16 6 -1. + <_> + 0 0 8 3 2. + <_> + 8 3 8 3 2. + 0 + <_> + + <_> + 0 0 16 10 -1. + <_> + 0 0 8 5 2. + <_> + 8 5 8 5 2. + 0 + <_> + + <_> + 0 0 24 1 -1. + <_> + 12 0 12 1 2. + 0 + <_> + + <_> + 0 0 24 2 -1. + <_> + 0 0 12 1 2. + <_> + 12 1 12 1 2. + 0 + <_> + + <_> + 0 0 12 12 -1. + <_> + 0 6 12 6 2. + 0 + <_> + + <_> + 0 0 15 18 -1. + <_> + 0 6 15 6 3. + 0 + <_> + + <_> + 0 1 1 6 -1. + <_> + 0 3 1 2 3. + 0 + <_> + + <_> + 0 1 4 6 -1. + <_> + 2 1 2 6 2. + 0 + <_> + + <_> + 0 1 15 1 -1. + <_> + 5 1 5 1 3. + 0 + <_> + + <_> + 0 1 10 2 -1. + <_> + 5 1 5 2 2. + 0 + <_> + + <_> + 0 2 24 2 -1. + <_> + 0 2 12 1 2. + <_> + 12 3 12 1 2. + 0 + <_> + + <_> + 0 2 24 10 -1. + <_> + 0 2 12 5 2. + <_> + 12 7 12 5 2. + 0 + <_> + + <_> + 0 3 7 3 -1. + <_> + 0 4 7 1 3. + 0 + <_> + + <_> + 0 3 24 2 -1. + <_> + 0 3 12 1 2. + <_> + 12 4 12 1 2. + 0 + <_> + + <_> + 0 4 6 12 -1. + <_> + 0 8 6 4 3. + 0 + <_> + + <_> + 0 4 24 6 -1. + <_> + 0 6 24 2 3. + 0 + <_> + + <_> + 0 5 2 9 -1. + <_> + 0 8 2 3 3. + 0 + <_> + + <_> + 0 5 24 2 -1. + <_> + 0 5 12 1 2. + <_> + 12 6 12 1 2. + 0 + <_> + + <_> + 0 6 6 3 -1. + <_> + 0 7 6 1 3. + 0 + <_> + + <_> + 0 6 24 2 -1. + <_> + 0 6 12 1 2. + <_> + 12 7 12 1 2. + 0 + <_> + + <_> + 0 6 22 3 -1. + <_> + 0 7 22 1 3. + 0 + <_> + + <_> + 0 6 24 9 -1. + <_> + 0 9 24 3 3. + 0 + <_> + + <_> + 0 7 16 1 -1. + <_> + 8 7 8 1 2. + 0 + <_> + + <_> + 0 7 24 3 -1. + <_> + 8 7 8 3 3. + 0 + <_> + + <_> + 0 7 24 2 -1. + <_> + 0 7 12 1 2. + <_> + 12 8 12 1 2. + 0 + <_> + + <_> + 0 8 4 6 -1. + <_> + 2 8 2 6 2. + 0 + <_> + + <_> + 0 8 6 15 -1. + <_> + 3 8 3 15 2. + 0 + <_> + + <_> + 0 8 4 9 -1. + <_> + 0 11 4 3 3. + 0 + <_> + + <_> + 0 8 24 1 -1. + <_> + 8 8 8 1 3. + 0 + <_> + + <_> + 0 8 24 4 -1. + <_> + 0 8 12 2 2. + <_> + 12 10 12 2 2. + 0 + <_> + + <_> + 0 9 2 3 -1. + <_> + 0 10 2 1 3. + 0 + <_> + + <_> + 0 9 2 9 -1. + <_> + 0 12 2 3 3. + 0 + <_> + + <_> + 0 9 5 3 -1. + <_> + 0 10 5 1 3. + 0 + <_> + + <_> + 0 9 5 6 -1. + <_> + 0 11 5 2 3. + 0 + <_> + + <_> + 0 9 7 2 -1. + <_> + 0 10 7 1 2. + 0 + <_> + + <_> + 0 9 8 2 -1. + <_> + 0 10 8 1 2. + 0 + <_> + + <_> + 0 9 10 2 -1. + <_> + 0 10 10 1 2. + 0 + <_> + + <_> + 0 9 22 2 -1. + <_> + 0 9 11 1 2. + <_> + 11 10 11 1 2. + 0 + <_> + + <_> + 0 9 24 4 -1. + <_> + 0 9 12 2 2. + <_> + 12 11 12 2 2. + 0 + <_> + + <_> + 0 9 24 15 -1. + <_> + 12 9 12 15 2. + 0 + <_> + + <_> + 0 9 15 3 -1. + <_> + 0 10 15 1 3. + 0 + <_> + + <_> + 0 10 2 3 -1. + <_> + 0 11 2 1 3. + 0 + <_> + + <_> + 0 10 6 1 -1. + <_> + 3 10 3 1 2. + 0 + <_> + + <_> + 0 10 6 14 -1. + <_> + 3 10 3 14 2. + 0 + <_> + + <_> + 0 10 4 3 -1. + <_> + 0 11 4 1 3. + 0 + <_> + + <_> + 0 10 24 2 -1. + <_> + 0 10 12 1 2. + <_> + 12 11 12 1 2. + 0 + <_> + + <_> + 0 10 24 4 -1. + <_> + 0 10 12 2 2. + <_> + 12 12 12 2 2. + 0 + <_> + + <_> + 0 10 13 3 -1. + <_> + 0 11 13 1 3. + 0 + <_> + + <_> + 0 11 2 3 -1. + <_> + 0 12 2 1 3. + 0 + <_> + + <_> + 0 11 6 8 -1. + <_> + 0 11 3 4 2. + <_> + 3 15 3 4 2. + 0 + <_> + + <_> + 0 11 10 3 -1. + <_> + 0 12 10 1 3. + 0 + <_> + + <_> + 0 11 24 2 -1. + <_> + 0 11 12 1 2. + <_> + 12 12 12 1 2. + 0 + <_> + + <_> + 0 12 3 10 -1. + <_> + 1 12 1 10 3. + 0 + <_> + + <_> + 0 12 22 10 -1. + <_> + 11 12 11 10 2. + 0 + <_> + + <_> + 0 13 3 9 -1. + <_> + 1 13 1 9 3. + 0 + <_> + + <_> + 0 13 12 10 -1. + <_> + 6 13 6 10 2. + 0 + <_> + + <_> + 0 13 24 10 -1. + <_> + 12 13 12 10 2. + 0 + <_> + + <_> + 0 14 24 2 -1. + <_> + 0 14 12 1 2. + <_> + 12 15 12 1 2. + 0 + <_> + + <_> + 0 15 3 8 -1. + <_> + 1 15 1 8 3. + 0 + <_> + + <_> + 0 15 12 8 -1. + <_> + 0 15 6 4 2. + <_> + 6 19 6 4 2. + 0 + <_> + + <_> + 0 15 10 6 -1. + <_> + 0 17 10 2 3. + 0 + <_> + + <_> + 0 16 12 8 -1. + <_> + 0 16 6 4 2. + <_> + 6 20 6 4 2. + 0 + <_> + + <_> + 0 17 3 7 -1. + <_> + 1 17 1 7 3. + 0 + <_> + + <_> + 0 18 6 3 -1. + <_> + 0 19 6 1 3. + 0 + <_> + + <_> + 0 19 6 3 -1. + <_> + 0 20 6 1 3. + 0 + <_> + + <_> + 0 20 6 3 -1. + <_> + 0 21 6 1 3. + 0 + <_> + + <_> + 0 21 4 3 -1. + <_> + 0 22 4 1 3. + 0 + <_> + + <_> + 0 21 5 3 -1. + <_> + 0 22 5 1 3. + 0 + <_> + + <_> + 0 22 22 2 -1. + <_> + 11 22 11 2 2. + 0 + <_> + + <_> + 1 0 6 1 -1. + <_> + 4 0 3 1 2. + 0 + <_> + + <_> + 1 0 15 13 -1. + <_> + 6 0 5 13 3. + 0 + <_> + + <_> + 1 0 12 6 -1. + <_> + 1 0 6 3 2. + <_> + 7 3 6 3 2. + 0 + <_> + + <_> + 1 1 22 2 -1. + <_> + 1 1 11 1 2. + <_> + 12 2 11 1 2. + 0 + <_> + + <_> + 1 2 23 9 -1. + <_> + 1 5 23 3 3. + 0 + <_> + + <_> + 1 3 4 3 -1. + <_> + 1 4 4 1 3. + 0 + <_> + + <_> + 1 3 12 18 -1. + <_> + 5 3 4 18 3. + 0 + <_> + + <_> + 1 4 8 3 -1. + <_> + 1 5 8 1 3. + 0 + <_> + + <_> + 1 4 23 6 -1. + <_> + 1 6 23 2 3. + 0 + <_> + + <_> + 1 6 6 4 -1. + <_> + 1 6 3 2 2. + <_> + 4 8 3 2 2. + 0 + <_> + + <_> + 1 6 3 9 -1. + <_> + 1 9 3 3 3. + 0 + <_> + + <_> + 1 6 4 3 -1. + <_> + 1 7 4 1 3. + 0 + <_> + + <_> + 1 6 22 2 -1. + <_> + 1 6 11 1 2. + <_> + 12 7 11 1 2. + 0 + <_> + + <_> + 1 6 12 8 -1. + <_> + 1 10 12 4 2. + 0 + <_> + + <_> + 1 7 8 4 -1. + <_> + 1 7 4 2 2. + <_> + 5 9 4 2 2. + 0 + <_> + + <_> + 1 7 20 4 -1. + <_> + 1 7 10 2 2. + <_> + 11 9 10 2 2. + 0 + <_> + + <_> + 1 7 22 6 -1. + <_> + 1 7 11 3 2. + <_> + 12 10 11 3 2. + 0 + <_> + + <_> + 1 7 22 14 -1. + <_> + 12 7 11 14 2. + 0 + <_> + + <_> + 1 8 1 2 -1. + <_> + 1 9 1 1 2. + 0 + <_> + + <_> + 1 8 8 2 -1. + <_> + 1 8 4 1 2. + <_> + 5 9 4 1 2. + 0 + <_> + + <_> + 1 8 7 4 -1. + <_> + 1 10 7 2 2. + 0 + <_> + + <_> + 1 8 22 4 -1. + <_> + 1 8 11 2 2. + <_> + 12 10 11 2 2. + 0 + <_> + + <_> + 1 9 4 3 -1. + <_> + 3 9 2 3 2. + 0 + <_> + + <_> + 1 9 4 6 -1. + <_> + 1 11 4 2 3. + 0 + <_> + + <_> + 1 9 20 2 -1. + <_> + 1 9 10 1 2. + <_> + 11 10 10 1 2. + 0 + <_> + + <_> + 1 10 3 13 -1. + <_> + 2 10 1 13 3. + 0 + <_> + + <_> + 1 10 4 6 -1. + <_> + 1 12 4 2 3. + 0 + <_> + + <_> + 1 10 8 3 -1. + <_> + 1 11 8 1 3. + 0 + <_> + + <_> + 1 10 20 2 -1. + <_> + 1 10 10 1 2. + <_> + 11 11 10 1 2. + 0 + <_> + + <_> + 1 11 6 2 -1. + <_> + 4 11 3 2 2. + 0 + <_> + + <_> + 1 11 22 2 -1. + <_> + 1 11 11 1 2. + <_> + 12 12 11 1 2. + 0 + <_> + + <_> + 1 12 3 8 -1. + <_> + 2 12 1 8 3. + 0 + <_> + + <_> + 1 12 4 1 -1. + <_> + 3 12 2 1 2. + 0 + <_> + + <_> + 1 12 20 2 -1. + <_> + 1 12 10 1 2. + <_> + 11 13 10 1 2. + 0 + <_> + + <_> + 1 13 3 8 -1. + <_> + 2 13 1 8 3. + 0 + <_> + + <_> + 1 13 9 3 -1. + <_> + 1 14 9 1 3. + 0 + <_> + + <_> + 1 13 21 8 -1. + <_> + 1 17 21 4 2. + 0 + <_> + + <_> + 1 15 8 2 -1. + <_> + 5 15 4 2 2. + 0 + <_> + + <_> + 1 17 22 2 -1. + <_> + 1 17 11 1 2. + <_> + 12 18 11 1 2. + 0 + <_> + + <_> + 1 18 3 6 -1. + <_> + 2 18 1 6 3. + 0 + <_> + + <_> + 2 0 6 1 -1. + <_> + 5 0 3 1 2. + 0 + <_> + + <_> + 2 0 8 6 -1. + <_> + 2 0 4 3 2. + <_> + 6 3 4 3 2. + 0 + <_> + + <_> + 2 0 12 5 -1. + <_> + 8 0 6 5 2. + 0 + <_> + + <_> + 2 3 20 2 -1. + <_> + 2 3 10 1 2. + <_> + 12 4 10 1 2. + 0 + <_> + + <_> + 2 4 3 3 -1. + <_> + 2 5 3 1 3. + 0 + <_> + + <_> + 2 4 20 2 -1. + <_> + 2 4 10 1 2. + <_> + 12 5 10 1 2. + 0 + <_> + + <_> + 2 5 1 3 -1. + <_> + 2 6 1 1 3. + 0 + <_> + + <_> + 2 5 2 3 -1. + <_> + 2 6 2 1 3. + 0 + <_> + + <_> + 2 5 20 2 -1. + <_> + 2 5 10 1 2. + <_> + 12 6 10 1 2. + 0 + <_> + + <_> + 2 6 22 2 -1. + <_> + 2 6 11 1 2. + <_> + 13 7 11 1 2. + 0 + <_> + + <_> + 2 6 22 4 -1. + <_> + 2 6 11 2 2. + <_> + 13 8 11 2 2. + 0 + <_> + + <_> + 2 7 15 3 -1. + <_> + 2 8 15 1 3. + 0 + <_> + + <_> + 2 8 8 3 -1. + <_> + 2 9 8 1 3. + 0 + <_> + + <_> + 2 8 20 4 -1. + <_> + 2 8 10 2 2. + <_> + 12 10 10 2 2. + 0 + <_> + + <_> + 2 9 20 8 -1. + <_> + 2 9 10 4 2. + <_> + 12 13 10 4 2. + 0 + <_> + + <_> + 2 9 22 2 -1. + <_> + 2 9 11 1 2. + <_> + 13 10 11 1 2. + 0 + <_> + + <_> + 2 9 19 3 -1. + <_> + 2 10 19 1 3. + 0 + <_> + + <_> + 2 10 4 1 -1. + <_> + 4 10 2 1 2. + 0 + <_> + + <_> + 2 10 22 2 -1. + <_> + 2 10 11 1 2. + <_> + 13 11 11 1 2. + 0 + <_> + + <_> + 2 10 22 14 -1. + <_> + 13 10 11 14 2. + 0 + <_> + + <_> + 2 10 20 12 -1. + <_> + 2 16 20 6 2. + 0 + <_> + + <_> + 2 11 3 5 -1. + <_> + 3 11 1 5 3. + 0 + <_> + + <_> + 2 11 20 2 -1. + <_> + 2 11 10 1 2. + <_> + 12 12 10 1 2. + 0 + <_> + + <_> + 2 11 22 2 -1. + <_> + 2 11 11 1 2. + <_> + 13 12 11 1 2. + 0 + <_> + + <_> + 2 12 3 5 -1. + <_> + 3 12 1 5 3. + 0 + <_> + + <_> + 2 12 3 9 -1. + <_> + 3 12 1 9 3. + 0 + <_> + + <_> + 2 12 3 11 -1. + <_> + 3 12 1 11 3. + 0 + <_> + + <_> + 2 14 3 3 -1. + <_> + 3 14 1 3 3. + 0 + <_> + + <_> + 2 14 8 8 -1. + <_> + 2 14 4 4 2. + <_> + 6 18 4 4 2. + 0 + <_> + + <_> + 2 17 3 5 -1. + <_> + 3 17 1 5 3. + 0 + <_> + + <_> + 2 17 3 6 -1. + <_> + 3 17 1 6 3. + 0 + <_> + + <_> + 2 17 21 4 -1. + <_> + 9 17 7 4 3. + 0 + <_> + + <_> + 2 18 3 5 -1. + <_> + 3 18 1 5 3. + 0 + <_> + + <_> + 2 18 10 4 -1. + <_> + 7 18 5 4 2. + 0 + <_> + + <_> + 2 20 6 2 -1. + <_> + 5 20 3 2 2. + 0 + <_> + + <_> + 2 21 12 2 -1. + <_> + 8 21 6 2 2. + 0 + <_> + + <_> + 3 0 3 5 -1. + <_> + 4 0 1 5 3. + 0 + <_> + + <_> + 3 0 9 22 -1. + <_> + 6 0 3 22 3. + 0 + <_> + + <_> + 3 0 12 4 -1. + <_> + 3 0 6 2 2. + <_> + 9 2 6 2 2. + 0 + <_> + + <_> + 3 1 3 3 -1. + <_> + 4 1 1 3 3. + 0 + <_> + + <_> + 3 1 3 20 -1. + <_> + 4 1 1 20 3. + 0 + <_> + + <_> + 3 1 6 20 -1. + <_> + 5 1 2 20 3. + 0 + <_> + + <_> + 3 2 3 3 -1. + <_> + 4 2 1 3 3. + 0 + <_> + + <_> + 3 3 3 3 -1. + <_> + 4 3 1 3 3. + 0 + <_> + + <_> + 3 3 3 9 -1. + <_> + 3 6 3 3 3. + 0 + <_> + + <_> + 3 3 20 19 -1. + <_> + 13 3 10 19 2. + 0 + <_> + + <_> + 3 3 19 4 -1. + <_> + 3 5 19 2 2. + 0 + <_> + + <_> + 3 4 1 3 -1. + <_> + 3 5 1 1 3. + 0 + <_> + + <_> + 3 4 6 3 -1. + <_> + 5 4 2 3 3. + 0 + <_> + + <_> + 3 4 18 2 -1. + <_> + 3 4 9 1 2. + <_> + 12 5 9 1 2. + 0 + <_> + + <_> + 3 4 16 6 -1. + <_> + 3 6 16 2 3. + 0 + <_> + + <_> + 3 5 3 1 -1. + <_> + 4 5 1 1 3. + 0 + <_> + + <_> + 3 5 3 2 -1. + <_> + 4 5 1 2 3. + 0 + <_> + + <_> + 3 5 2 3 -1. + <_> + 3 6 2 1 3. + 0 + <_> + + <_> + 3 5 10 3 -1. + <_> + 8 5 5 3 2. + 0 + <_> + + <_> + 3 5 18 3 -1. + <_> + 9 5 6 3 3. + 0 + <_> + + <_> + 3 5 18 2 -1. + <_> + 3 5 9 1 2. + <_> + 12 6 9 1 2. + 0 + <_> + + <_> + 3 6 2 1 -1. + <_> + 4 6 1 1 2. + 0 + <_> + + <_> + 3 6 1 3 -1. + <_> + 3 7 1 1 3. + 0 + <_> + + <_> + 3 6 3 3 -1. + <_> + 3 7 3 1 3. + 0 + <_> + + <_> + 3 6 6 6 -1. + <_> + 3 8 6 2 3. + 0 + <_> + + <_> + 3 6 18 2 -1. + <_> + 3 6 9 1 2. + <_> + 12 7 9 1 2. + 0 + <_> + + <_> + 3 6 17 6 -1. + <_> + 3 8 17 2 3. + 0 + <_> + + <_> + 3 7 3 1 -1. + <_> + 4 7 1 1 3. + 0 + <_> + + <_> + 3 7 4 2 -1. + <_> + 3 8 4 1 2. + 0 + <_> + + <_> + 3 7 6 6 -1. + <_> + 3 9 6 2 3. + 0 + <_> + + <_> + 3 7 18 4 -1. + <_> + 3 7 9 2 2. + <_> + 12 9 9 2 2. + 0 + <_> + + <_> + 3 7 20 11 -1. + <_> + 13 7 10 11 2. + 0 + <_> + + <_> + 3 7 17 6 -1. + <_> + 3 9 17 2 3. + 0 + <_> + + <_> + 3 9 3 1 -1. + <_> + 4 9 1 1 3. + 0 + <_> + + <_> + 3 9 3 2 -1. + <_> + 4 9 1 2 3. + 0 + <_> + + <_> + 3 9 9 2 -1. + <_> + 6 9 3 2 3. + 0 + <_> + + <_> + 3 9 18 2 -1. + <_> + 3 9 9 1 2. + <_> + 12 10 9 1 2. + 0 + <_> + + <_> + 3 10 3 1 -1. + <_> + 4 10 1 1 3. + 0 + <_> + + <_> + 3 10 3 13 -1. + <_> + 4 10 1 13 3. + 0 + <_> + + <_> + 3 10 6 2 -1. + <_> + 3 11 6 1 2. + 0 + <_> + + <_> + 3 11 3 2 -1. + <_> + 4 11 1 2 3. + 0 + <_> + + <_> + 3 11 3 3 -1. + <_> + 4 11 1 3 3. + 0 + <_> + + <_> + 3 11 3 5 -1. + <_> + 4 11 1 5 3. + 0 + <_> + + <_> + 3 11 3 13 -1. + <_> + 4 11 1 13 3. + 0 + <_> + + <_> + 3 11 6 2 -1. + <_> + 3 11 3 1 2. + <_> + 6 12 3 1 2. + 0 + <_> + + <_> + 3 11 3 4 -1. + <_> + 3 13 3 2 2. + 0 + <_> + + <_> + 3 11 4 8 -1. + <_> + 3 15 4 4 2. + 0 + <_> + + <_> + 3 12 3 3 -1. + <_> + 4 12 1 3 3. + 0 + <_> + + <_> + 3 12 3 6 -1. + <_> + 3 15 3 3 2. + 0 + <_> + + <_> + 3 12 9 7 -1. + <_> + 6 12 3 7 3. + 0 + <_> + + <_> + 3 12 4 8 -1. + <_> + 3 16 4 4 2. + 0 + <_> + + <_> + 3 12 8 8 -1. + <_> + 3 16 8 4 2. + 0 + <_> + + <_> + 3 12 19 6 -1. + <_> + 3 15 19 3 2. + 0 + <_> + + <_> + 3 13 18 2 -1. + <_> + 3 13 9 1 2. + <_> + 12 14 9 1 2. + 0 + <_> + + <_> + 3 15 4 2 -1. + <_> + 5 15 2 2 2. + 0 + <_> + + <_> + 3 15 4 3 -1. + <_> + 5 15 2 3 2. + 0 + <_> + + <_> + 3 15 6 2 -1. + <_> + 6 15 3 2 2. + 0 + <_> + + <_> + 3 16 8 8 -1. + <_> + 3 16 4 4 2. + <_> + 7 20 4 4 2. + 0 + <_> + + <_> + 3 20 3 4 -1. + <_> + 4 20 1 4 3. + 0 + <_> + + <_> + 4 1 3 8 -1. + <_> + 5 1 1 8 3. + 0 + <_> + + <_> + 4 1 3 12 -1. + <_> + 4 5 3 4 3. + 0 + <_> + + <_> + 4 1 15 10 -1. + <_> + 4 6 15 5 2. + 0 + <_> + + <_> + 4 2 3 3 -1. + <_> + 5 2 1 3 3. + 0 + <_> + + <_> + 4 2 6 5 -1. + <_> + 6 2 2 5 3. + 0 + <_> + + <_> + 4 2 16 2 -1. + <_> + 4 2 8 1 2. + <_> + 12 3 8 1 2. + 0 + <_> + + <_> + 4 3 3 2 -1. + <_> + 5 3 1 2 3. + 0 + <_> + + <_> + 4 3 6 1 -1. + <_> + 6 3 2 1 3. + 0 + <_> + + <_> + 4 3 6 5 -1. + <_> + 6 3 2 5 3. + 0 + <_> + + <_> + 4 3 9 3 -1. + <_> + 7 3 3 3 3. + 0 + <_> + + <_> + 4 3 16 2 -1. + <_> + 4 3 8 1 2. + <_> + 12 4 8 1 2. + 0 + <_> + + <_> + 4 3 16 8 -1. + <_> + 4 3 8 4 2. + <_> + 12 7 8 4 2. + 0 + <_> + + <_> + 4 3 17 8 -1. + <_> + 4 7 17 4 2. + 0 + <_> + + <_> + 4 4 1 4 -1. + <_> + 4 6 1 2 2. + 0 + <_> + + <_> + 4 4 16 2 -1. + <_> + 4 4 8 1 2. + <_> + 12 5 8 1 2. + 0 + <_> + + <_> + 4 4 16 10 -1. + <_> + 4 4 8 5 2. + <_> + 12 9 8 5 2. + 0 + <_> + + <_> + 4 4 20 6 -1. + <_> + 4 6 20 2 3. + 0 + <_> + + <_> + 4 5 16 2 -1. + <_> + 4 5 8 1 2. + <_> + 12 6 8 1 2. + 0 + <_> + + <_> + 4 5 16 9 -1. + <_> + 4 8 16 3 3. + 0 + <_> + + <_> + 4 6 2 2 -1. + <_> + 4 6 1 1 2. + <_> + 5 7 1 1 2. + 0 + <_> + + <_> + 4 6 2 2 -1. + <_> + 4 7 2 1 2. + 0 + <_> + + <_> + 4 6 6 1 -1. + <_> + 6 6 2 1 3. + 0 + <_> + + <_> + 4 6 2 3 -1. + <_> + 4 7 2 1 3. + 0 + <_> + + <_> + 4 6 3 3 -1. + <_> + 4 7 3 1 3. + 0 + <_> + + <_> + 4 6 16 2 -1. + <_> + 4 6 8 1 2. + <_> + 12 7 8 1 2. + 0 + <_> + + <_> + 4 6 15 6 -1. + <_> + 4 8 15 2 3. + 0 + <_> + + <_> + 4 7 2 3 -1. + <_> + 4 8 2 1 3. + 0 + <_> + + <_> + 4 7 4 3 -1. + <_> + 6 7 2 3 2. + 0 + <_> + + <_> + 4 7 4 3 -1. + <_> + 4 8 4 1 3. + 0 + <_> + + <_> + 4 7 5 3 -1. + <_> + 4 8 5 1 3. + 0 + <_> + + <_> + 4 7 5 6 -1. + <_> + 4 9 5 2 3. + 0 + <_> + + <_> + 4 7 7 3 -1. + <_> + 4 8 7 1 3. + 0 + <_> + + <_> + 4 7 18 2 -1. + <_> + 4 7 9 1 2. + <_> + 13 8 9 1 2. + 0 + <_> + + <_> + 4 7 18 4 -1. + <_> + 4 7 9 2 2. + <_> + 13 9 9 2 2. + 0 + <_> + + <_> + 4 7 16 3 -1. + <_> + 4 8 16 1 3. + 0 + <_> + + <_> + 4 7 16 6 -1. + <_> + 4 9 16 2 3. + 0 + <_> + + <_> + 4 7 17 2 -1. + <_> + 4 8 17 1 2. + 0 + <_> + + <_> + 4 7 17 3 -1. + <_> + 4 8 17 1 3. + 0 + <_> + + <_> + 4 7 17 6 -1. + <_> + 4 9 17 2 3. + 0 + <_> + + <_> + 4 8 2 2 -1. + <_> + 4 8 1 1 2. + <_> + 5 9 1 1 2. + 0 + <_> + + <_> + 4 8 16 2 -1. + <_> + 4 8 8 1 2. + <_> + 12 9 8 1 2. + 0 + <_> + + <_> + 4 8 18 4 -1. + <_> + 4 8 9 2 2. + <_> + 13 10 9 2 2. + 0 + <_> + + <_> + 4 9 2 1 -1. + <_> + 5 9 1 1 2. + 0 + <_> + + <_> + 4 9 3 1 -1. + <_> + 5 9 1 1 3. + 0 + <_> + + <_> + 4 9 2 2 -1. + <_> + 4 9 1 1 2. + <_> + 5 10 1 1 2. + 0 + <_> + + <_> + 4 9 2 2 -1. + <_> + 5 9 1 2 2. + 0 + <_> + + <_> + 4 9 6 1 -1. + <_> + 6 9 2 1 3. + 0 + <_> + + <_> + 4 9 2 9 -1. + <_> + 4 12 2 3 3. + 0 + <_> + + <_> + 4 9 15 1 -1. + <_> + 9 9 5 1 3. + 0 + <_> + + <_> + 4 9 5 3 -1. + <_> + 4 10 5 1 3. + 0 + <_> + + <_> + 4 9 15 2 -1. + <_> + 9 9 5 2 3. + 0 + <_> + + <_> + 4 9 15 3 -1. + <_> + 9 9 5 3 3. + 0 + <_> + + <_> + 4 9 16 2 -1. + <_> + 4 9 8 1 2. + <_> + 12 10 8 1 2. + 0 + <_> + + <_> + 4 9 16 6 -1. + <_> + 4 9 8 3 2. + <_> + 12 12 8 3 2. + 0 + <_> + + <_> + 4 9 18 2 -1. + <_> + 4 9 9 1 2. + <_> + 13 10 9 1 2. + 0 + <_> + + <_> + 4 9 20 2 -1. + <_> + 4 9 10 1 2. + <_> + 14 10 10 1 2. + 0 + <_> + + <_> + 4 9 17 9 -1. + <_> + 4 12 17 3 3. + 0 + <_> + + <_> + 4 9 18 3 -1. + <_> + 4 10 18 1 3. + 0 + <_> + + <_> + 4 10 2 1 -1. + <_> + 5 10 1 1 2. + 0 + <_> + + <_> + 4 10 3 1 -1. + <_> + 5 10 1 1 3. + 0 + <_> + + <_> + 4 10 2 2 -1. + <_> + 4 10 1 1 2. + <_> + 5 11 1 1 2. + 0 + <_> + + <_> + 4 10 6 3 -1. + <_> + 7 10 3 3 2. + 0 + <_> + + <_> + 4 10 18 2 -1. + <_> + 4 10 9 1 2. + <_> + 13 11 9 1 2. + 0 + <_> + + <_> + 4 10 17 6 -1. + <_> + 4 12 17 2 3. + 0 + <_> + + <_> + 4 11 3 2 -1. + <_> + 5 11 1 2 3. + 0 + <_> + + <_> + 4 11 3 3 -1. + <_> + 5 11 1 3 3. + 0 + <_> + + <_> + 4 11 1 8 -1. + <_> + 4 15 1 4 2. + 0 + <_> + + <_> + 4 11 3 6 -1. + <_> + 5 11 1 6 3. + 0 + <_> + + <_> + 4 11 6 3 -1. + <_> + 6 11 2 3 3. + 0 + <_> + + <_> + 4 11 15 2 -1. + <_> + 4 12 15 1 2. + 0 + <_> + + <_> + 4 12 3 1 -1. + <_> + 5 12 1 1 3. + 0 + <_> + + <_> + 4 12 4 4 -1. + <_> + 6 12 2 4 2. + 0 + <_> + + <_> + 4 12 3 8 -1. + <_> + 4 16 3 4 2. + 0 + <_> + + <_> + 4 12 17 12 -1. + <_> + 4 16 17 4 3. + 0 + <_> + + <_> + 4 13 3 1 -1. + <_> + 5 13 1 1 3. + 0 + <_> + + <_> + 4 13 3 9 -1. + <_> + 4 16 3 3 3. + 0 + <_> + + <_> + 4 14 4 2 -1. + <_> + 6 14 2 2 2. + 0 + <_> + + <_> + 4 15 4 2 -1. + <_> + 6 15 2 2 2. + 0 + <_> + + <_> + 4 15 9 4 -1. + <_> + 7 15 3 4 3. + 0 + <_> + + <_> + 4 15 16 4 -1. + <_> + 4 15 8 2 2. + <_> + 12 17 8 2 2. + 0 + <_> + + <_> + 4 18 3 5 -1. + <_> + 5 18 1 5 3. + 0 + <_> + + <_> + 4 18 3 6 -1. + <_> + 5 18 1 6 3. + 0 + <_> + + <_> + 4 18 15 5 -1. + <_> + 9 18 5 5 3. + 0 + <_> + + <_> + 4 18 9 6 -1. + <_> + 4 21 9 3 2. + 0 + <_> + + <_> + 5 1 14 2 -1. + <_> + 5 1 7 1 2. + <_> + 12 2 7 1 2. + 0 + <_> + + <_> + 5 1 11 8 -1. + <_> + 5 5 11 4 2. + 0 + <_> + + <_> + 5 2 3 3 -1. + <_> + 6 2 1 3 3. + 0 + <_> + + <_> + 5 2 6 2 -1. + <_> + 7 2 2 2 3. + 0 + <_> + + <_> + 5 2 14 2 -1. + <_> + 5 2 7 1 2. + <_> + 12 3 7 1 2. + 0 + <_> + + <_> + 5 2 14 8 -1. + <_> + 5 6 14 4 2. + 0 + <_> + + <_> + 5 2 16 10 -1. + <_> + 5 7 16 5 2. + 0 + <_> + + <_> + 5 3 6 1 -1. + <_> + 7 3 2 1 3. + 0 + <_> + + <_> + 5 3 6 2 -1. + <_> + 7 3 2 2 3. + 0 + <_> + + <_> + 5 3 4 10 -1. + <_> + 5 3 2 5 2. + <_> + 7 8 2 5 2. + 0 + <_> + + <_> + 5 3 9 12 -1. + <_> + 8 3 3 12 3. + 0 + <_> + + <_> + 5 3 14 2 -1. + <_> + 5 3 7 1 2. + <_> + 12 4 7 1 2. + 0 + <_> + + <_> + 5 3 15 8 -1. + <_> + 5 7 15 4 2. + 0 + <_> + + <_> + 5 4 2 4 -1. + <_> + 5 4 1 2 2. + <_> + 6 6 1 2 2. + 0 + <_> + + <_> + 5 4 6 4 -1. + <_> + 7 4 2 4 3. + 0 + <_> + + <_> + 5 4 4 12 -1. + <_> + 7 4 2 12 2. + 0 + <_> + + <_> + 5 4 12 8 -1. + <_> + 9 4 4 8 3. + 0 + <_> + + <_> + 5 4 14 2 -1. + <_> + 5 4 7 1 2. + <_> + 12 5 7 1 2. + 0 + <_> + + <_> + 5 5 2 2 -1. + <_> + 5 5 1 1 2. + <_> + 6 6 1 1 2. + 0 + <_> + + <_> + 5 5 2 4 -1. + <_> + 5 5 1 2 2. + <_> + 6 7 1 2 2. + 0 + <_> + + <_> + 5 5 6 6 -1. + <_> + 5 7 6 2 3. + 0 + <_> + + <_> + 5 5 14 2 -1. + <_> + 5 5 7 1 2. + <_> + 12 6 7 1 2. + 0 + <_> + + <_> + 5 5 16 2 -1. + <_> + 5 5 8 1 2. + <_> + 13 6 8 1 2. + 0 + <_> + + <_> + 5 5 13 6 -1. + <_> + 5 7 13 2 3. + 0 + <_> + + <_> + 5 5 14 6 -1. + <_> + 5 7 14 2 3. + 0 + <_> + + <_> + 5 5 15 6 -1. + <_> + 5 7 15 2 3. + 0 + <_> + + <_> + 5 5 15 9 -1. + <_> + 5 8 15 3 3. + 0 + <_> + + <_> + 5 6 1 2 -1. + <_> + 5 7 1 1 2. + 0 + <_> + + <_> + 5 6 2 4 -1. + <_> + 5 6 1 2 2. + <_> + 6 8 1 2 2. + 0 + <_> + + <_> + 5 6 6 1 -1. + <_> + 7 6 2 1 3. + 0 + <_> + + <_> + 5 6 4 3 -1. + <_> + 5 7 4 1 3. + 0 + <_> + + <_> + 5 6 14 2 -1. + <_> + 5 6 7 1 2. + <_> + 12 7 7 1 2. + 0 + <_> + + <_> + 5 7 2 2 -1. + <_> + 6 7 1 2 2. + 0 + <_> + + <_> + 5 7 2 6 -1. + <_> + 5 7 1 3 2. + <_> + 6 10 1 3 2. + 0 + <_> + + <_> + 5 7 4 1 -1. + <_> + 7 7 2 1 2. + 0 + <_> + + <_> + 5 7 6 5 -1. + <_> + 7 7 2 5 3. + 0 + <_> + + <_> + 5 7 3 2 -1. + <_> + 5 8 3 1 2. + 0 + <_> + + <_> + 5 7 3 3 -1. + <_> + 5 8 3 1 3. + 0 + <_> + + <_> + 5 7 3 6 -1. + <_> + 5 9 3 2 3. + 0 + <_> + + <_> + 5 7 4 3 -1. + <_> + 5 8 4 1 3. + 0 + <_> + + <_> + 5 7 4 6 -1. + <_> + 5 9 4 2 3. + 0 + <_> + + <_> + 5 7 5 6 -1. + <_> + 5 9 5 2 3. + 0 + <_> + + <_> + 5 7 14 4 -1. + <_> + 5 7 7 2 2. + <_> + 12 9 7 2 2. + 0 + <_> + + <_> + 5 7 14 2 -1. + <_> + 5 8 14 1 2. + 0 + <_> + + <_> + 5 7 14 4 -1. + <_> + 5 9 14 2 2. + 0 + <_> + + <_> + 5 7 15 2 -1. + <_> + 5 8 15 1 2. + 0 + <_> + + <_> + 5 7 15 6 -1. + <_> + 5 9 15 2 3. + 0 + <_> + + <_> + 5 8 1 3 -1. + <_> + 5 9 1 1 3. + 0 + <_> + + <_> + 5 8 2 2 -1. + <_> + 5 8 1 1 2. + <_> + 6 9 1 1 2. + 0 + <_> + + <_> + 5 8 4 5 -1. + <_> + 7 8 2 5 2. + 0 + <_> + + <_> + 5 8 12 4 -1. + <_> + 9 8 4 4 3. + 0 + <_> + + <_> + 5 8 15 3 -1. + <_> + 10 8 5 3 3. + 0 + <_> + + <_> + 5 8 14 4 -1. + <_> + 5 8 7 2 2. + <_> + 12 10 7 2 2. + 0 + <_> + + <_> + 5 9 4 4 -1. + <_> + 7 9 2 4 2. + 0 + <_> + + <_> + 5 9 4 3 -1. + <_> + 5 10 4 1 3. + 0 + <_> + + <_> + 5 9 8 8 -1. + <_> + 5 9 4 4 2. + <_> + 9 13 4 4 2. + 0 + <_> + + <_> + 5 9 15 2 -1. + <_> + 10 9 5 2 3. + 0 + <_> + + <_> + 5 9 14 2 -1. + <_> + 5 9 7 1 2. + <_> + 12 10 7 1 2. + 0 + <_> + + <_> + 5 9 14 12 -1. + <_> + 5 9 7 6 2. + <_> + 12 15 7 6 2. + 0 + <_> + + <_> + 5 9 18 2 -1. + <_> + 5 9 9 1 2. + <_> + 14 10 9 1 2. + 0 + <_> + + <_> + 5 9 13 3 -1. + <_> + 5 10 13 1 3. + 0 + <_> + + <_> + 5 9 15 6 -1. + <_> + 5 12 15 3 2. + 0 + <_> + + <_> + 5 10 2 2 -1. + <_> + 5 10 1 1 2. + <_> + 6 11 1 1 2. + 0 + <_> + + <_> + 5 10 3 3 -1. + <_> + 6 10 1 3 3. + 0 + <_> + + <_> + 5 11 3 2 -1. + <_> + 6 11 1 2 3. + 0 + <_> + + <_> + 5 11 3 3 -1. + <_> + 6 11 1 3 3. + 0 + <_> + + <_> + 5 11 3 13 -1. + <_> + 6 11 1 13 3. + 0 + <_> + + <_> + 5 11 14 2 -1. + <_> + 5 12 14 1 2. + 0 + <_> + + <_> + 5 12 1 6 -1. + <_> + 5 15 1 3 2. + 0 + <_> + + <_> + 5 13 15 8 -1. + <_> + 5 17 15 4 2. + 0 + <_> + + <_> + 5 14 3 3 -1. + <_> + 5 15 3 1 3. + 0 + <_> + + <_> + 5 15 2 2 -1. + <_> + 6 15 1 2 2. + 0 + <_> + + <_> + 5 19 3 5 -1. + <_> + 6 19 1 5 3. + 0 + <_> + + <_> + 5 21 3 3 -1. + <_> + 6 21 1 3 3. + 0 + <_> + + <_> + 6 0 1 6 -1. + <_> + 6 3 1 3 2. + 0 + <_> + + <_> + 6 0 11 10 -1. + <_> + 6 5 11 5 2. + 0 + <_> + + <_> + 6 1 6 12 -1. + <_> + 8 1 2 12 3. + 0 + <_> + + <_> + 6 2 3 6 -1. + <_> + 7 2 1 6 3. + 0 + <_> + + <_> + 6 2 6 2 -1. + <_> + 8 2 2 2 3. + 0 + <_> + + <_> + 6 2 6 10 -1. + <_> + 8 2 2 10 3. + 0 + <_> + + <_> + 6 2 12 4 -1. + <_> + 6 4 12 2 2. + 0 + <_> + + <_> + 6 3 6 4 -1. + <_> + 8 3 2 4 3. + 0 + <_> + + <_> + 6 3 9 1 -1. + <_> + 9 3 3 1 3. + 0 + <_> + + <_> + 6 4 3 3 -1. + <_> + 7 4 1 3 3. + 0 + <_> + + <_> + 6 4 6 4 -1. + <_> + 8 4 2 4 3. + 0 + <_> + + <_> + 6 5 3 2 -1. + <_> + 7 5 1 2 3. + 0 + <_> + + <_> + 6 5 3 3 -1. + <_> + 7 5 1 3 3. + 0 + <_> + + <_> + 6 5 2 9 -1. + <_> + 6 8 2 3 3. + 0 + <_> + + <_> + 6 5 12 2 -1. + <_> + 6 5 6 1 2. + <_> + 12 6 6 1 2. + 0 + <_> + + <_> + 6 6 4 1 -1. + <_> + 8 6 2 1 2. + 0 + <_> + + <_> + 6 6 12 2 -1. + <_> + 6 6 6 1 2. + <_> + 12 7 6 1 2. + 0 + <_> + + <_> + 6 7 1 6 -1. + <_> + 6 9 1 2 3. + 0 + <_> + + <_> + 6 7 2 2 -1. + <_> + 6 8 2 1 2. + 0 + <_> + + <_> + 6 7 2 3 -1. + <_> + 6 8 2 1 3. + 0 + <_> + + <_> + 6 7 2 6 -1. + <_> + 6 9 2 2 3. + 0 + <_> + + <_> + 6 7 3 6 -1. + <_> + 6 9 3 2 3. + 0 + <_> + + <_> + 6 7 12 2 -1. + <_> + 6 7 6 1 2. + <_> + 12 8 6 1 2. + 0 + <_> + + <_> + 6 7 8 12 -1. + <_> + 6 13 8 6 2. + 0 + <_> + + <_> + 6 7 12 15 -1. + <_> + 6 12 12 5 3. + 0 + <_> + + <_> + 6 8 2 6 -1. + <_> + 6 11 2 3 2. + 0 + <_> + + <_> + 6 8 3 2 -1. + <_> + 6 9 3 1 2. + 0 + <_> + + <_> + 6 8 12 3 -1. + <_> + 10 8 4 3 3. + 0 + <_> + + <_> + 6 8 12 2 -1. + <_> + 6 8 6 1 2. + <_> + 12 9 6 1 2. + 0 + <_> + + <_> + 6 9 2 2 -1. + <_> + 6 10 2 1 2. + 0 + <_> + + <_> + 6 9 2 3 -1. + <_> + 6 10 2 1 3. + 0 + <_> + + <_> + 6 9 6 1 -1. + <_> + 9 9 3 1 2. + 0 + <_> + + <_> + 6 9 3 3 -1. + <_> + 6 10 3 1 3. + 0 + <_> + + <_> + 6 9 12 2 -1. + <_> + 6 9 6 1 2. + <_> + 12 10 6 1 2. + 0 + <_> + + <_> + 6 9 13 12 -1. + <_> + 6 13 13 4 3. + 0 + <_> + + <_> + 6 10 1 3 -1. + <_> + 6 11 1 1 3. + 0 + <_> + + <_> + 6 10 2 2 -1. + <_> + 7 10 1 2 2. + 0 + <_> + + <_> + 6 10 2 3 -1. + <_> + 7 10 1 3 2. + 0 + <_> + + <_> + 6 10 3 14 -1. + <_> + 7 10 1 14 3. + 0 + <_> + + <_> + 6 10 2 3 -1. + <_> + 6 11 2 1 3. + 0 + <_> + + <_> + 6 10 6 3 -1. + <_> + 8 10 2 3 3. + 0 + <_> + + <_> + 6 10 3 3 -1. + <_> + 6 11 3 1 3. + 0 + <_> + + <_> + 6 10 9 5 -1. + <_> + 9 10 3 5 3. + 0 + <_> + + <_> + 6 10 12 1 -1. + <_> + 10 10 4 1 3. + 0 + <_> + + <_> + 6 10 8 4 -1. + <_> + 6 10 4 2 2. + <_> + 10 12 4 2 2. + 0 + <_> + + <_> + 6 10 12 2 -1. + <_> + 6 10 6 1 2. + <_> + 12 11 6 1 2. + 0 + <_> + + <_> + 6 10 12 12 -1. + <_> + 6 10 6 6 2. + <_> + 12 16 6 6 2. + 0 + <_> + + <_> + 6 10 18 1 -1. + <_> + 15 10 9 1 2. + 0 + <_> + + <_> + 6 10 13 3 -1. + <_> + 6 11 13 1 3. + 0 + <_> + + <_> + 6 11 2 2 -1. + <_> + 6 12 2 1 2. + 0 + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + 0 + <_> + + <_> + 6 11 3 2 -1. + <_> + 6 12 3 1 2. + 0 + <_> + + <_> + 6 11 3 3 -1. + <_> + 6 12 3 1 3. + 0 + <_> + + <_> + 6 11 12 3 -1. + <_> + 6 12 12 1 3. + 0 + <_> + + <_> + 6 11 13 3 -1. + <_> + 6 12 13 1 3. + 0 + <_> + + <_> + 6 12 14 2 -1. + <_> + 6 12 7 1 2. + <_> + 13 13 7 1 2. + 0 + <_> + + <_> + 6 12 13 2 -1. + <_> + 6 13 13 1 2. + 0 + <_> + + <_> + 6 14 1 3 -1. + <_> + 6 15 1 1 3. + 0 + <_> + + <_> + 6 14 2 2 -1. + <_> + 7 14 1 2 2. + 0 + <_> + + <_> + 6 15 2 3 -1. + <_> + 6 16 2 1 3. + 0 + <_> + + <_> + 6 17 10 6 -1. + <_> + 6 20 10 3 2. + 0 + <_> + + <_> + 6 18 3 6 -1. + <_> + 7 18 1 6 3. + 0 + <_> + + <_> + 6 19 3 5 -1. + <_> + 7 19 1 5 3. + 0 + <_> + + <_> + 6 20 9 4 -1. + <_> + 6 22 9 2 2. + 0 + <_> + + <_> + 6 23 3 1 -1. + <_> + 7 23 1 1 3. + 0 + <_> + + <_> + 7 0 2 8 -1. + <_> + 7 0 1 4 2. + <_> + 8 4 1 4 2. + 0 + <_> + + <_> + 7 0 10 1 -1. + <_> + 12 0 5 1 2. + 0 + <_> + + <_> + 7 1 2 4 -1. + <_> + 7 3 2 2 2. + 0 + <_> + + <_> + 7 1 10 1 -1. + <_> + 12 1 5 1 2. + 0 + <_> + + <_> + 7 2 4 21 -1. + <_> + 9 2 2 21 2. + 0 + <_> + + <_> + 7 3 1 3 -1. + <_> + 7 4 1 1 3. + 0 + <_> + + <_> + 7 3 3 5 -1. + <_> + 8 3 1 5 3. + 0 + <_> + + <_> + 7 4 3 10 -1. + <_> + 8 4 1 10 3. + 0 + <_> + + <_> + 7 5 2 2 -1. + <_> + 8 5 1 2 2. + 0 + <_> + + <_> + 7 5 3 2 -1. + <_> + 8 5 1 2 3. + 0 + <_> + + <_> + 7 5 3 3 -1. + <_> + 8 5 1 3 3. + 0 + <_> + + <_> + 7 5 3 6 -1. + <_> + 8 5 1 6 3. + 0 + <_> + + <_> + 7 5 2 7 -1. + <_> + 8 5 1 7 2. + 0 + <_> + + <_> + 7 5 2 6 -1. + <_> + 7 7 2 2 3. + 0 + <_> + + <_> + 7 5 11 6 -1. + <_> + 7 7 11 2 3. + 0 + <_> + + <_> + 7 6 3 1 -1. + <_> + 8 6 1 1 3. + 0 + <_> + + <_> + 7 6 1 3 -1. + <_> + 7 7 1 1 3. + 0 + <_> + + <_> + 7 6 4 6 -1. + <_> + 9 6 2 6 2. + 0 + <_> + + <_> + 7 6 10 2 -1. + <_> + 7 6 5 1 2. + <_> + 12 7 5 1 2. + 0 + <_> + + <_> + 7 6 12 2 -1. + <_> + 7 6 6 1 2. + <_> + 13 7 6 1 2. + 0 + <_> + + <_> + 7 7 1 2 -1. + <_> + 7 8 1 1 2. + 0 + <_> + + <_> + 7 7 1 3 -1. + <_> + 7 8 1 1 3. + 0 + <_> + + <_> + 7 7 1 6 -1. + <_> + 7 9 1 2 3. + 0 + <_> + + <_> + 7 7 2 4 -1. + <_> + 7 9 2 2 2. + 0 + <_> + + <_> + 7 7 10 2 -1. + <_> + 7 7 5 1 2. + <_> + 12 8 5 1 2. + 0 + <_> + + <_> + 7 8 1 3 -1. + <_> + 7 9 1 1 3. + 0 + <_> + + <_> + 7 8 2 2 -1. + <_> + 7 8 1 1 2. + <_> + 8 9 1 1 2. + 0 + <_> + + <_> + 7 8 2 4 -1. + <_> + 7 8 1 2 2. + <_> + 8 10 1 2 2. + 0 + <_> + + <_> + 7 8 10 2 -1. + <_> + 7 8 5 1 2. + <_> + 12 9 5 1 2. + 0 + <_> + + <_> + 7 9 1 2 -1. + <_> + 7 10 1 1 2. + 0 + <_> + + <_> + 7 9 1 3 -1. + <_> + 7 10 1 1 3. + 0 + <_> + + <_> + 7 9 3 3 -1. + <_> + 8 9 1 3 3. + 0 + <_> + + <_> + 7 9 4 6 -1. + <_> + 7 9 2 3 2. + <_> + 9 12 2 3 2. + 0 + <_> + + <_> + 7 9 6 10 -1. + <_> + 7 9 3 5 2. + <_> + 10 14 3 5 2. + 0 + <_> + + <_> + 7 9 12 2 -1. + <_> + 11 9 4 2 3. + 0 + <_> + + <_> + 7 9 10 2 -1. + <_> + 7 9 5 1 2. + <_> + 12 10 5 1 2. + 0 + <_> + + <_> + 7 9 12 2 -1. + <_> + 7 9 6 1 2. + <_> + 13 10 6 1 2. + 0 + <_> + + <_> + 7 10 3 1 -1. + <_> + 8 10 1 1 3. + 0 + <_> + + <_> + 7 10 1 3 -1. + <_> + 7 11 1 1 3. + 0 + <_> + + <_> + 7 10 2 3 -1. + <_> + 7 11 2 1 3. + 0 + <_> + + <_> + 7 10 6 4 -1. + <_> + 9 10 2 4 3. + 0 + <_> + + <_> + 7 10 10 2 -1. + <_> + 7 10 5 1 2. + <_> + 12 11 5 1 2. + 0 + <_> + + <_> + 7 11 2 1 -1. + <_> + 8 11 1 1 2. + 0 + <_> + + <_> + 7 11 2 2 -1. + <_> + 7 12 2 1 2. + 0 + <_> + + <_> + 7 11 6 4 -1. + <_> + 9 11 2 4 3. + 0 + <_> + + <_> + 7 14 1 3 -1. + <_> + 7 15 1 1 3. + 0 + <_> + + <_> + 7 16 10 8 -1. + <_> + 7 20 10 4 2. + 0 + <_> + + <_> + 7 18 3 6 -1. + <_> + 8 18 1 6 3. + 0 + <_> + + <_> + 7 18 9 6 -1. + <_> + 7 20 9 2 3. + 0 + <_> + + <_> + 7 19 3 3 -1. + <_> + 8 19 1 3 3. + 0 + <_> + + <_> + 7 20 3 4 -1. + <_> + 8 20 1 4 3. + 0 + <_> + + <_> + 7 20 7 4 -1. + <_> + 7 22 7 2 2. + 0 + <_> + + <_> + 7 20 11 4 -1. + <_> + 7 22 11 2 2. + 0 + <_> + + <_> + 7 22 3 2 -1. + <_> + 8 22 1 2 3. + 0 + <_> + + <_> + 8 0 8 2 -1. + <_> + 12 0 4 2 2. + 0 + <_> + + <_> + 8 0 8 2 -1. + <_> + 8 1 8 1 2. + 0 + <_> + + <_> + 8 0 8 10 -1. + <_> + 8 5 8 5 2. + 0 + <_> + + <_> + 8 0 16 10 -1. + <_> + 8 0 8 5 2. + <_> + 16 5 8 5 2. + 0 + <_> + + <_> + 8 0 10 3 -1. + <_> + 8 1 10 1 3. + 0 + <_> + + <_> + 8 1 8 1 -1. + <_> + 12 1 4 1 2. + 0 + <_> + + <_> + 8 2 3 2 -1. + <_> + 9 2 1 2 3. + 0 + <_> + + <_> + 8 2 8 20 -1. + <_> + 12 2 4 20 2. + 0 + <_> + + <_> + 8 3 3 8 -1. + <_> + 9 3 1 8 3. + 0 + <_> + + <_> + 8 3 3 9 -1. + <_> + 9 3 1 9 3. + 0 + <_> + + <_> + 8 3 6 1 -1. + <_> + 11 3 3 1 2. + 0 + <_> + + <_> + 8 3 4 3 -1. + <_> + 8 4 4 1 3. + 0 + <_> + + <_> + 8 3 8 2 -1. + <_> + 8 3 4 1 2. + <_> + 12 4 4 1 2. + 0 + <_> + + <_> + 8 4 3 2 -1. + <_> + 9 4 1 2 3. + 0 + <_> + + <_> + 8 4 2 8 -1. + <_> + 9 4 1 8 2. + 0 + <_> + + <_> + 8 4 3 3 -1. + <_> + 8 5 3 1 3. + 0 + <_> + + <_> + 8 4 8 2 -1. + <_> + 8 4 4 1 2. + <_> + 12 5 4 1 2. + 0 + <_> + + <_> + 8 4 7 15 -1. + <_> + 8 9 7 5 3. + 0 + <_> + + <_> + 8 5 3 2 -1. + <_> + 9 5 1 2 3. + 0 + <_> + + <_> + 8 5 2 3 -1. + <_> + 9 5 1 3 2. + 0 + <_> + + <_> + 8 5 3 5 -1. + <_> + 9 5 1 5 3. + 0 + <_> + + <_> + 8 5 2 6 -1. + <_> + 9 5 1 6 2. + 0 + <_> + + <_> + 8 5 3 7 -1. + <_> + 9 5 1 7 3. + 0 + <_> + + <_> + 8 5 4 3 -1. + <_> + 8 6 4 1 3. + 0 + <_> + + <_> + 8 5 8 12 -1. + <_> + 12 5 4 12 2. + 0 + <_> + + <_> + 8 5 8 19 -1. + <_> + 12 5 4 19 2. + 0 + <_> + + <_> + 8 6 3 5 -1. + <_> + 9 6 1 5 3. + 0 + <_> + + <_> + 8 6 10 2 -1. + <_> + 8 6 5 1 2. + <_> + 13 7 5 1 2. + 0 + <_> + + <_> + 8 8 2 2 -1. + <_> + 8 8 1 1 2. + <_> + 9 9 1 1 2. + 0 + <_> + + <_> + 8 8 1 6 -1. + <_> + 8 10 1 2 3. + 0 + <_> + + <_> + 8 8 3 3 -1. + <_> + 8 9 3 1 3. + 0 + <_> + + <_> + 8 9 1 3 -1. + <_> + 8 10 1 1 3. + 0 + <_> + + <_> + 8 9 3 2 -1. + <_> + 9 9 1 2 3. + 0 + <_> + + <_> + 8 9 2 6 -1. + <_> + 8 9 1 3 2. + <_> + 9 12 1 3 2. + 0 + <_> + + <_> + 8 10 2 1 -1. + <_> + 9 10 1 1 2. + 0 + <_> + + <_> + 8 10 3 1 -1. + <_> + 9 10 1 1 3. + 0 + <_> + + <_> + 8 10 2 2 -1. + <_> + 8 10 1 1 2. + <_> + 9 11 1 1 2. + 0 + <_> + + <_> + 8 10 2 2 -1. + <_> + 9 10 1 2 2. + 0 + <_> + + <_> + 8 10 3 2 -1. + <_> + 9 10 1 2 3. + 0 + <_> + + <_> + 8 10 4 8 -1. + <_> + 8 10 2 4 2. + <_> + 10 14 2 4 2. + 0 + <_> + + <_> + 8 10 8 2 -1. + <_> + 8 10 4 1 2. + <_> + 12 11 4 1 2. + 0 + <_> + + <_> + 8 11 2 2 -1. + <_> + 8 11 1 1 2. + <_> + 9 12 1 1 2. + 0 + <_> + + <_> + 8 11 4 8 -1. + <_> + 8 11 2 4 2. + <_> + 10 15 2 4 2. + 0 + <_> + + <_> + 8 11 4 10 -1. + <_> + 8 11 2 5 2. + <_> + 10 16 2 5 2. + 0 + <_> + + <_> + 8 13 9 10 -1. + <_> + 8 18 9 5 2. + 0 + <_> + + <_> + 8 15 4 4 -1. + <_> + 10 15 2 4 2. + 0 + <_> + + <_> + 8 16 9 3 -1. + <_> + 11 16 3 3 3. + 0 + <_> + + <_> + 8 19 3 5 -1. + <_> + 9 19 1 5 3. + 0 + <_> + + <_> + 8 20 3 3 -1. + <_> + 9 20 1 3 3. + 0 + <_> + + <_> + 9 0 1 2 -1. + <_> + 9 1 1 1 2. + 0 + <_> + + <_> + 9 0 2 4 -1. + <_> + 10 0 1 4 2. + 0 + <_> + + <_> + 9 0 6 1 -1. + <_> + 12 0 3 1 2. + 0 + <_> + + <_> + 9 0 5 4 -1. + <_> + 9 2 5 2 2. + 0 + <_> + + <_> + 9 0 6 10 -1. + <_> + 9 5 6 5 2. + 0 + <_> + + <_> + 9 0 14 8 -1. + <_> + 9 0 7 4 2. + <_> + 16 4 7 4 2. + 0 + <_> + + <_> + 9 0 7 10 -1. + <_> + 9 5 7 5 2. + 0 + <_> + + <_> + 9 0 14 10 -1. + <_> + 9 0 7 5 2. + <_> + 16 5 7 5 2. + 0 + <_> + + <_> + 9 0 14 12 -1. + <_> + 9 0 7 6 2. + <_> + 16 6 7 6 2. + 0 + <_> + + <_> + 9 1 3 12 -1. + <_> + 10 1 1 12 3. + 0 + <_> + + <_> + 9 1 4 15 -1. + <_> + 11 1 2 15 2. + 0 + <_> + + <_> + 9 1 6 1 -1. + <_> + 12 1 3 1 2. + 0 + <_> + + <_> + 9 2 2 2 -1. + <_> + 10 2 1 2 2. + 0 + <_> + + <_> + 9 2 6 18 -1. + <_> + 12 2 3 18 2. + 0 + <_> + + <_> + 9 2 15 3 -1. + <_> + 9 3 15 1 3. + 0 + <_> + + <_> + 9 3 3 9 -1. + <_> + 10 3 1 9 3. + 0 + <_> + + <_> + 9 3 8 6 -1. + <_> + 9 6 8 3 2. + 0 + <_> + + <_> + 9 3 15 15 -1. + <_> + 9 8 15 5 3. + 0 + <_> + + <_> + 9 4 3 4 -1. + <_> + 10 4 1 4 3. + 0 + <_> + + <_> + 9 4 6 2 -1. + <_> + 9 4 3 1 2. + <_> + 12 5 3 1 2. + 0 + <_> + + <_> + 9 4 14 5 -1. + <_> + 16 4 7 5 2. + 0 + <_> + + <_> + 9 5 2 5 -1. + <_> + 10 5 1 5 2. + 0 + <_> + + <_> + 9 5 3 6 -1. + <_> + 10 5 1 6 3. + 0 + <_> + + <_> + 9 5 4 15 -1. + <_> + 11 5 2 15 2. + 0 + <_> + + <_> + 9 5 3 3 -1. + <_> + 9 6 3 1 3. + 0 + <_> + + <_> + 9 5 4 3 -1. + <_> + 9 6 4 1 3. + 0 + <_> + + <_> + 9 6 4 4 -1. + <_> + 11 6 2 4 2. + 0 + <_> + + <_> + 9 6 3 3 -1. + <_> + 9 7 3 1 3. + 0 + <_> + + <_> + 9 6 6 7 -1. + <_> + 12 6 3 7 2. + 0 + <_> + + <_> + 9 6 4 3 -1. + <_> + 9 7 4 1 3. + 0 + <_> + + <_> + 9 6 15 10 -1. + <_> + 9 11 15 5 2. + 0 + <_> + + <_> + 9 7 6 2 -1. + <_> + 9 7 3 1 2. + <_> + 12 8 3 1 2. + 0 + <_> + + <_> + 9 8 3 3 -1. + <_> + 9 9 3 1 3. + 0 + <_> + + <_> + 9 8 7 10 -1. + <_> + 9 13 7 5 2. + 0 + <_> + + <_> + 9 9 2 2 -1. + <_> + 10 9 1 2 2. + 0 + <_> + + <_> + 9 9 3 3 -1. + <_> + 9 10 3 1 3. + 0 + <_> + + <_> + 9 9 9 6 -1. + <_> + 12 9 3 6 3. + 0 + <_> + + <_> + 9 10 2 4 -1. + <_> + 9 10 1 2 2. + <_> + 10 12 1 2 2. + 0 + <_> + + <_> + 9 10 6 2 -1. + <_> + 9 10 3 1 2. + <_> + 12 11 3 1 2. + 0 + <_> + + <_> + 9 10 8 1 -1. + <_> + 13 10 4 1 2. + 0 + <_> + + <_> + 9 10 15 3 -1. + <_> + 9 11 15 1 3. + 0 + <_> + + <_> + 9 11 2 4 -1. + <_> + 9 11 1 2 2. + <_> + 10 13 1 2 2. + 0 + <_> + + <_> + 9 11 2 6 -1. + <_> + 9 11 1 3 2. + <_> + 10 14 1 3 2. + 0 + <_> + + <_> + 9 13 2 11 -1. + <_> + 10 13 1 11 2. + 0 + <_> + + <_> + 9 14 6 3 -1. + <_> + 11 14 2 3 3. + 0 + <_> + + <_> + 9 16 4 3 -1. + <_> + 11 16 2 3 2. + 0 + <_> + + <_> + 9 16 6 4 -1. + <_> + 11 16 2 4 3. + 0 + <_> + + <_> + 9 16 6 8 -1. + <_> + 11 16 2 8 3. + 0 + <_> + + <_> + 9 16 6 3 -1. + <_> + 9 17 6 1 3. + 0 + <_> + + <_> + 9 17 6 2 -1. + <_> + 11 17 2 2 3. + 0 + <_> + + <_> + 9 17 6 7 -1. + <_> + 11 17 2 7 3. + 0 + <_> + + <_> + 9 18 5 3 -1. + <_> + 9 19 5 1 3. + 0 + <_> + + <_> + 9 19 3 5 -1. + <_> + 10 19 1 5 3. + 0 + <_> + + <_> + 9 19 7 3 -1. + <_> + 9 20 7 1 3. + 0 + <_> + + <_> + 9 20 3 4 -1. + <_> + 10 20 1 4 3. + 0 + <_> + + <_> + 9 20 3 2 -1. + <_> + 9 21 3 1 2. + 0 + <_> + + <_> + 9 20 5 3 -1. + <_> + 9 21 5 1 3. + 0 + <_> + + <_> + 9 20 6 3 -1. + <_> + 9 21 6 1 3. + 0 + <_> + + <_> + 9 20 6 4 -1. + <_> + 9 22 6 2 2. + 0 + <_> + + <_> + 9 20 7 3 -1. + <_> + 9 21 7 1 3. + 0 + <_> + + <_> + 9 20 8 4 -1. + <_> + 9 22 8 2 2. + 0 + <_> + + <_> + 9 21 3 2 -1. + <_> + 10 21 1 2 3. + 0 + <_> + + <_> + 9 22 3 2 -1. + <_> + 10 22 1 2 3. + 0 + <_> + + <_> + 10 0 1 6 -1. + <_> + 10 3 1 3 2. + 0 + <_> + + <_> + 10 0 6 1 -1. + <_> + 13 0 3 1 2. + 0 + <_> + + <_> + 10 0 4 8 -1. + <_> + 10 4 4 4 2. + 0 + <_> + + <_> + 10 0 14 10 -1. + <_> + 10 0 7 5 2. + <_> + 17 5 7 5 2. + 0 + <_> + + <_> + 10 1 4 2 -1. + <_> + 10 1 2 1 2. + <_> + 12 2 2 1 2. + 0 + <_> + + <_> + 10 2 1 6 -1. + <_> + 10 5 1 3 2. + 0 + <_> + + <_> + 10 3 6 1 -1. + <_> + 13 3 3 1 2. + 0 + <_> + + <_> + 10 3 9 1 -1. + <_> + 13 3 3 1 3. + 0 + <_> + + <_> + 10 3 3 3 -1. + <_> + 10 4 3 1 3. + 0 + <_> + + <_> + 10 4 3 3 -1. + <_> + 11 4 1 3 3. + 0 + <_> + + <_> + 10 4 2 8 -1. + <_> + 11 4 1 8 2. + 0 + <_> + + <_> + 10 5 3 3 -1. + <_> + 11 5 1 3 3. + 0 + <_> + + <_> + 10 5 4 11 -1. + <_> + 12 5 2 11 2. + 0 + <_> + + <_> + 10 6 6 3 -1. + <_> + 10 7 6 1 3. + 0 + <_> + + <_> + 10 7 2 3 -1. + <_> + 10 8 2 1 3. + 0 + <_> + + <_> + 10 7 4 7 -1. + <_> + 12 7 2 7 2. + 0 + <_> + + <_> + 10 7 9 6 -1. + <_> + 13 7 3 6 3. + 0 + <_> + + <_> + 10 7 4 3 -1. + <_> + 10 8 4 1 3. + 0 + <_> + + <_> + 10 8 2 3 -1. + <_> + 10 9 2 1 3. + 0 + <_> + + <_> + 10 8 4 2 -1. + <_> + 10 9 4 1 2. + 0 + <_> + + <_> + 10 8 8 10 -1. + <_> + 10 13 8 5 2. + 0 + <_> + + <_> + 10 9 1 3 -1. + <_> + 10 10 1 1 3. + 0 + <_> + + <_> + 10 9 2 3 -1. + <_> + 10 10 2 1 3. + 0 + <_> + + <_> + 10 9 6 4 -1. + <_> + 13 9 3 4 2. + 0 + <_> + + <_> + 10 10 14 3 -1. + <_> + 10 11 14 1 3. + 0 + <_> + + <_> + 10 11 1 3 -1. + <_> + 10 12 1 1 3. + 0 + <_> + + <_> + 10 11 4 3 -1. + <_> + 10 12 4 1 3. + 0 + <_> + + <_> + 10 12 1 3 -1. + <_> + 10 13 1 1 3. + 0 + <_> + + <_> + 10 12 2 8 -1. + <_> + 10 12 1 4 2. + <_> + 11 16 1 4 2. + 0 + <_> + + <_> + 10 15 4 3 -1. + <_> + 10 16 4 1 3. + 0 + <_> + + <_> + 10 15 6 6 -1. + <_> + 10 17 6 2 3. + 0 + <_> + + <_> + 10 16 6 8 -1. + <_> + 10 16 3 4 2. + <_> + 13 20 3 4 2. + 0 + <_> + + <_> + 10 16 4 2 -1. + <_> + 10 17 4 1 2. + 0 + <_> + + <_> + 10 16 4 3 -1. + <_> + 10 17 4 1 3. + 0 + <_> + + <_> + 10 17 4 3 -1. + <_> + 10 18 4 1 3. + 0 + <_> + + <_> + 10 17 5 3 -1. + <_> + 10 18 5 1 3. + 0 + <_> + + <_> + 10 18 5 3 -1. + <_> + 10 19 5 1 3. + 0 + <_> + + <_> + 10 19 5 3 -1. + <_> + 10 20 5 1 3. + 0 + <_> + + <_> + 10 20 3 3 -1. + <_> + 11 20 1 3 3. + 0 + <_> + + <_> + 10 20 3 4 -1. + <_> + 11 20 1 4 3. + 0 + <_> + + <_> + 10 20 4 3 -1. + <_> + 10 21 4 1 3. + 0 + <_> + + <_> + 10 20 5 3 -1. + <_> + 10 21 5 1 3. + 0 + <_> + + <_> + 10 21 3 1 -1. + <_> + 11 21 1 1 3. + 0 + <_> + + <_> + 10 21 3 3 -1. + <_> + 11 21 1 3 3. + 0 + <_> + + <_> + 10 21 6 3 -1. + <_> + 12 21 2 3 3. + 0 + <_> + + <_> + 10 21 5 2 -1. + <_> + 10 22 5 1 2. + 0 + <_> + + <_> + 10 22 3 1 -1. + <_> + 11 22 1 1 3. + 0 + <_> + + <_> + 10 22 3 2 -1. + <_> + 11 22 1 2 3. + 0 + <_> + + <_> + 11 0 2 12 -1. + <_> + 11 4 2 4 3. + 0 + <_> + + <_> + 11 0 12 19 -1. + <_> + 15 0 4 19 3. + 0 + <_> + + <_> + 11 2 4 20 -1. + <_> + 13 2 2 20 2. + 0 + <_> + + <_> + 11 3 3 3 -1. + <_> + 12 3 1 3 3. + 0 + <_> + + <_> + 11 3 3 5 -1. + <_> + 12 3 1 5 3. + 0 + <_> + + <_> + 11 3 3 6 -1. + <_> + 12 3 1 6 3. + 0 + <_> + + <_> + 11 3 3 7 -1. + <_> + 12 3 1 7 3. + 0 + <_> + + <_> + 11 3 2 3 -1. + <_> + 11 4 2 1 3. + 0 + <_> + + <_> + 11 3 12 14 -1. + <_> + 15 3 4 14 3. + 0 + <_> + + <_> + 11 4 3 5 -1. + <_> + 12 4 1 5 3. + 0 + <_> + + <_> + 11 4 2 3 -1. + <_> + 11 5 2 1 3. + 0 + <_> + + <_> + 11 4 9 1 -1. + <_> + 14 4 3 1 3. + 0 + <_> + + <_> + 11 4 3 3 -1. + <_> + 11 5 3 1 3. + 0 + <_> + + <_> + 11 5 8 4 -1. + <_> + 11 7 8 2 2. + 0 + <_> + + <_> + 11 6 2 3 -1. + <_> + 11 7 2 1 3. + 0 + <_> + + <_> + 11 6 4 3 -1. + <_> + 11 7 4 1 3. + 0 + <_> + + <_> + 11 7 1 3 -1. + <_> + 11 8 1 1 3. + 0 + <_> + + <_> + 11 7 2 2 -1. + <_> + 11 7 1 1 2. + <_> + 12 8 1 1 2. + 0 + <_> + + <_> + 11 7 2 3 -1. + <_> + 11 8 2 1 3. + 0 + <_> + + <_> + 11 7 4 2 -1. + <_> + 11 7 2 1 2. + <_> + 13 8 2 1 2. + 0 + <_> + + <_> + 11 7 4 3 -1. + <_> + 11 8 4 1 3. + 0 + <_> + + <_> + 11 8 1 3 -1. + <_> + 11 9 1 1 3. + 0 + <_> + + <_> + 11 8 1 10 -1. + <_> + 11 13 1 5 2. + 0 + <_> + + <_> + 11 8 2 3 -1. + <_> + 11 9 2 1 3. + 0 + <_> + + <_> + 11 8 3 3 -1. + <_> + 11 9 3 1 3. + 0 + <_> + + <_> + 11 8 8 8 -1. + <_> + 11 8 4 4 2. + <_> + 15 12 4 4 2. + 0 + <_> + + <_> + 11 8 7 10 -1. + <_> + 11 13 7 5 2. + 0 + <_> + + <_> + 11 9 6 6 -1. + <_> + 13 9 2 6 3. + 0 + <_> + + <_> + 11 9 4 3 -1. + <_> + 11 10 4 1 3. + 0 + <_> + + <_> + 11 10 6 4 -1. + <_> + 13 10 2 4 3. + 0 + <_> + + <_> + 11 10 6 8 -1. + <_> + 11 10 3 4 2. + <_> + 14 14 3 4 2. + 0 + <_> + + <_> + 11 10 4 3 -1. + <_> + 11 11 4 1 3. + 0 + <_> + + <_> + 11 10 5 3 -1. + <_> + 11 11 5 1 3. + 0 + <_> + + <_> + 11 11 1 3 -1. + <_> + 11 12 1 1 3. + 0 + <_> + + <_> + 11 11 10 10 -1. + <_> + 11 11 5 5 2. + <_> + 16 16 5 5 2. + 0 + <_> + + <_> + 11 13 6 2 -1. + <_> + 13 13 2 2 3. + 0 + <_> + + <_> + 11 14 2 9 -1. + <_> + 11 17 2 3 3. + 0 + <_> + + <_> + 11 15 1 2 -1. + <_> + 11 16 1 1 2. + 0 + <_> + + <_> + 11 20 3 4 -1. + <_> + 12 20 1 4 3. + 0 + <_> + + <_> + 11 20 3 3 -1. + <_> + 11 21 3 1 3. + 0 + <_> + + <_> + 11 21 2 1 -1. + <_> + 12 21 1 1 2. + 0 + <_> + + <_> + 11 21 3 2 -1. + <_> + 12 21 1 2 3. + 0 + <_> + + <_> + 11 21 2 3 -1. + <_> + 12 21 1 3 2. + 0 + <_> + + <_> + 11 21 3 2 -1. + <_> + 11 22 3 1 2. + 0 + <_> + + <_> + 11 23 3 1 -1. + <_> + 12 23 1 1 3. + 0 + <_> + + <_> + 12 0 8 12 -1. + <_> + 12 0 4 6 2. + <_> + 16 6 4 6 2. + 0 + <_> + + <_> + 12 0 12 6 -1. + <_> + 12 0 6 3 2. + <_> + 18 3 6 3 2. + 0 + <_> + + <_> + 12 1 1 3 -1. + <_> + 12 2 1 1 3. + 0 + <_> + + <_> + 12 1 2 7 -1. + <_> + 13 1 1 7 2. + 0 + <_> + + <_> + 12 1 12 4 -1. + <_> + 12 1 6 2 2. + <_> + 18 3 6 2 2. + 0 + <_> + + <_> + 12 2 3 3 -1. + <_> + 13 2 1 3 3. + 0 + <_> + + <_> + 12 2 3 7 -1. + <_> + 13 2 1 7 3. + 0 + <_> + + <_> + 12 2 6 1 -1. + <_> + 14 2 2 1 3. + 0 + <_> + + <_> + 12 2 6 4 -1. + <_> + 14 2 2 4 3. + 0 + <_> + + <_> + 12 2 6 18 -1. + <_> + 12 8 6 6 3. + 0 + <_> + + <_> + 12 3 6 11 -1. + <_> + 14 3 2 11 3. + 0 + <_> + + <_> + 12 3 9 3 -1. + <_> + 15 3 3 3 3. + 0 + <_> + + <_> + 12 3 12 3 -1. + <_> + 12 4 12 1 3. + 0 + <_> + + <_> + 12 4 2 12 -1. + <_> + 13 4 1 12 2. + 0 + <_> + + <_> + 12 4 2 3 -1. + <_> + 12 5 2 1 3. + 0 + <_> + + <_> + 12 5 3 5 -1. + <_> + 13 5 1 5 3. + 0 + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. + 0 + <_> + + <_> + 12 6 1 3 -1. + <_> + 12 7 1 1 3. + 0 + <_> + + <_> + 12 6 2 3 -1. + <_> + 12 7 2 1 3. + 0 + <_> + + <_> + 12 6 8 4 -1. + <_> + 12 6 4 2 2. + <_> + 16 8 4 2 2. + 0 + <_> + + <_> + 12 7 1 3 -1. + <_> + 12 8 1 1 3. + 0 + <_> + + <_> + 12 7 2 3 -1. + <_> + 12 8 2 1 3. + 0 + <_> + + <_> + 12 8 1 3 -1. + <_> + 12 9 1 1 3. + 0 + <_> + + <_> + 12 8 3 3 -1. + <_> + 12 9 3 1 3. + 0 + <_> + + <_> + 12 8 4 3 -1. + <_> + 12 9 4 1 3. + 0 + <_> + + <_> + 12 9 1 3 -1. + <_> + 12 10 1 1 3. + 0 + <_> + + <_> + 12 10 2 12 -1. + <_> + 12 10 1 6 2. + <_> + 13 16 1 6 2. + 0 + <_> + + <_> + 12 10 4 10 -1. + <_> + 12 10 2 5 2. + <_> + 14 15 2 5 2. + 0 + <_> + + <_> + 12 11 2 3 -1. + <_> + 12 12 2 1 3. + 0 + <_> + + <_> + 12 11 4 4 -1. + <_> + 14 11 2 4 2. + 0 + <_> + + <_> + 12 11 4 8 -1. + <_> + 12 11 2 4 2. + <_> + 14 15 2 4 2. + 0 + <_> + + <_> + 12 15 6 5 -1. + <_> + 14 15 2 5 3. + 0 + <_> + + <_> + 12 15 10 4 -1. + <_> + 12 15 5 2 2. + <_> + 17 17 5 2 2. + 0 + <_> + + <_> + 12 16 4 3 -1. + <_> + 14 16 2 3 2. + 0 + <_> + + <_> + 12 17 3 3 -1. + <_> + 13 17 1 3 3. + 0 + <_> + + <_> + 12 17 8 6 -1. + <_> + 12 17 4 3 2. + <_> + 16 20 4 3 2. + 0 + <_> + + <_> + 12 18 12 6 -1. + <_> + 12 18 6 3 2. + <_> + 18 21 6 3 2. + 0 + <_> + + <_> + 12 21 3 3 -1. + <_> + 13 21 1 3 3. + 0 + <_> + + <_> + 13 0 11 14 -1. + <_> + 13 7 11 7 2. + 0 + <_> + + <_> + 13 2 2 3 -1. + <_> + 14 2 1 3 2. + 0 + <_> + + <_> + 13 3 1 4 -1. + <_> + 13 5 1 2 2. + 0 + <_> + + <_> + 13 3 3 3 -1. + <_> + 14 3 1 3 3. + 0 + <_> + + <_> + 13 3 6 1 -1. + <_> + 15 3 2 1 3. + 0 + <_> + + <_> + 13 4 1 2 -1. + <_> + 13 5 1 1 2. + 0 + <_> + + <_> + 13 4 3 7 -1. + <_> + 14 4 1 7 3. + 0 + <_> + + <_> + 13 4 3 8 -1. + <_> + 14 4 1 8 3. + 0 + <_> + + <_> + 13 5 3 6 -1. + <_> + 14 5 1 6 3. + 0 + <_> + + <_> + 13 6 1 3 -1. + <_> + 13 7 1 1 3. + 0 + <_> + + <_> + 13 7 6 6 -1. + <_> + 15 7 2 6 3. + 0 + <_> + + <_> + 13 7 3 3 -1. + <_> + 13 8 3 1 3. + 0 + <_> + + <_> + 13 8 6 8 -1. + <_> + 15 8 2 8 3. + 0 + <_> + + <_> + 13 9 3 4 -1. + <_> + 14 9 1 4 3. + 0 + <_> + + <_> + 13 9 4 3 -1. + <_> + 15 9 2 3 2. + 0 + <_> + + <_> + 13 9 6 4 -1. + <_> + 15 9 2 4 3. + 0 + <_> + + <_> + 13 9 9 2 -1. + <_> + 16 9 3 2 3. + 0 + <_> + + <_> + 13 9 9 2 -1. + <_> + 13 10 9 1 2. + 0 + <_> + + <_> + 13 10 3 2 -1. + <_> + 14 10 1 2 3. + 0 + <_> + + <_> + 13 10 4 1 -1. + <_> + 15 10 2 1 2. + 0 + <_> + + <_> + 13 10 4 4 -1. + <_> + 13 10 2 2 2. + <_> + 15 12 2 2 2. + 0 + <_> + + <_> + 13 11 2 3 -1. + <_> + 13 12 2 1 3. + 0 + <_> + + <_> + 13 11 3 3 -1. + <_> + 13 12 3 1 3. + 0 + <_> + + <_> + 13 12 3 3 -1. + <_> + 13 13 3 1 3. + 0 + <_> + + <_> + 13 13 2 6 -1. + <_> + 13 13 1 3 2. + <_> + 14 16 1 3 2. + 0 + <_> + + <_> + 13 15 2 5 -1. + <_> + 14 15 1 5 2. + 0 + <_> + + <_> + 13 19 3 3 -1. + <_> + 14 19 1 3 3. + 0 + <_> + + <_> + 13 20 3 3 -1. + <_> + 14 20 1 3 3. + 0 + <_> + + <_> + 13 22 3 2 -1. + <_> + 14 22 1 2 3. + 0 + <_> + + <_> + 14 0 1 10 -1. + <_> + 14 5 1 5 2. + 0 + <_> + + <_> + 14 0 2 7 -1. + <_> + 15 0 1 7 2. + 0 + <_> + + <_> + 14 0 2 22 -1. + <_> + 14 0 1 11 2. + <_> + 15 11 1 11 2. + 0 + <_> + + <_> + 14 0 10 6 -1. + <_> + 14 0 5 3 2. + <_> + 19 3 5 3 2. + 0 + <_> + + <_> + 14 0 10 8 -1. + <_> + 14 0 5 4 2. + <_> + 19 4 5 4 2. + 0 + <_> + + <_> + 14 0 10 12 -1. + <_> + 14 0 5 6 2. + <_> + 19 6 5 6 2. + 0 + <_> + + <_> + 14 1 2 2 -1. + <_> + 15 1 1 2 2. + 0 + <_> + + <_> + 14 1 4 4 -1. + <_> + 14 3 4 2 2. + 0 + <_> + + <_> + 14 1 10 2 -1. + <_> + 19 1 5 2 2. + 0 + <_> + + <_> + 14 2 6 7 -1. + <_> + 16 2 2 7 3. + 0 + <_> + + <_> + 14 3 2 4 -1. + <_> + 14 3 1 2 2. + <_> + 15 5 1 2 2. + 0 + <_> + + <_> + 14 4 3 3 -1. + <_> + 15 4 1 3 3. + 0 + <_> + + <_> + 14 4 6 1 -1. + <_> + 16 4 2 1 3. + 0 + <_> + + <_> + 14 4 3 3 -1. + <_> + 14 5 3 1 3. + 0 + <_> + + <_> + 14 5 3 2 -1. + <_> + 15 5 1 2 3. + 0 + <_> + + <_> + 14 5 3 3 -1. + <_> + 15 5 1 3 3. + 0 + <_> + + <_> + 14 5 4 2 -1. + <_> + 16 5 2 2 2. + 0 + <_> + + <_> + 14 5 3 10 -1. + <_> + 14 10 3 5 2. + 0 + <_> + + <_> + 14 5 4 6 -1. + <_> + 14 7 4 2 3. + 0 + <_> + + <_> + 14 6 3 2 -1. + <_> + 15 6 1 2 3. + 0 + <_> + + <_> + 14 6 3 4 -1. + <_> + 15 6 1 4 3. + 0 + <_> + + <_> + 14 6 2 6 -1. + <_> + 15 6 1 6 2. + 0 + <_> + + <_> + 14 6 6 2 -1. + <_> + 16 6 2 2 3. + 0 + <_> + + <_> + 14 6 6 17 -1. + <_> + 16 6 2 17 3. + 0 + <_> + + <_> + 14 8 2 13 -1. + <_> + 15 8 1 13 2. + 0 + <_> + + <_> + 14 8 4 6 -1. + <_> + 14 10 4 2 3. + 0 + <_> + + <_> + 14 9 2 2 -1. + <_> + 15 9 1 2 2. + 0 + <_> + + <_> + 14 9 3 2 -1. + <_> + 15 9 1 2 3. + 0 + <_> + + <_> + 14 9 2 4 -1. + <_> + 14 9 1 2 2. + <_> + 15 11 1 2 2. + 0 + <_> + + <_> + 14 9 2 3 -1. + <_> + 15 9 1 3 2. + 0 + <_> + + <_> + 14 9 4 1 -1. + <_> + 16 9 2 1 2. + 0 + <_> + + <_> + 14 9 6 1 -1. + <_> + 16 9 2 1 3. + 0 + <_> + + <_> + 14 9 9 9 -1. + <_> + 14 12 9 3 3. + 0 + <_> + + <_> + 14 10 2 1 -1. + <_> + 15 10 1 1 2. + 0 + <_> + + <_> + 14 10 3 1 -1. + <_> + 15 10 1 1 3. + 0 + <_> + + <_> + 14 10 2 2 -1. + <_> + 14 10 1 1 2. + <_> + 15 11 1 1 2. + 0 + <_> + + <_> + 14 10 2 2 -1. + <_> + 15 10 1 2 2. + 0 + <_> + + <_> + 14 10 3 2 -1. + <_> + 15 10 1 2 3. + 0 + <_> + + <_> + 14 10 3 3 -1. + <_> + 15 10 1 3 3. + 0 + <_> + + <_> + 14 10 2 6 -1. + <_> + 14 10 1 3 2. + <_> + 15 13 1 3 2. + 0 + <_> + + <_> + 14 12 6 2 -1. + <_> + 16 12 2 2 3. + 0 + <_> + + <_> + 14 12 6 5 -1. + <_> + 16 12 2 5 3. + 0 + <_> + + <_> + 14 14 8 6 -1. + <_> + 14 14 4 3 2. + <_> + 18 17 4 3 2. + 0 + <_> + + <_> + 14 14 10 10 -1. + <_> + 14 14 5 5 2. + <_> + 19 19 5 5 2. + 0 + <_> + + <_> + 14 16 10 8 -1. + <_> + 14 16 5 4 2. + <_> + 19 20 5 4 2. + 0 + <_> + + <_> + 14 18 8 4 -1. + <_> + 14 18 4 2 2. + <_> + 18 20 4 2 2. + 0 + <_> + + <_> + 14 19 3 4 -1. + <_> + 15 19 1 4 3. + 0 + <_> + + <_> + 14 19 3 5 -1. + <_> + 15 19 1 5 3. + 0 + <_> + + <_> + 14 20 3 4 -1. + <_> + 15 20 1 4 3. + 0 + <_> + + <_> + 14 23 3 1 -1. + <_> + 15 23 1 1 3. + 0 + <_> + + <_> + 15 0 8 1 -1. + <_> + 19 0 4 1 2. + 0 + <_> + + <_> + 15 0 8 2 -1. + <_> + 19 0 4 2 2. + 0 + <_> + + <_> + 15 2 2 10 -1. + <_> + 16 2 1 10 2. + 0 + <_> + + <_> + 15 2 6 7 -1. + <_> + 17 2 2 7 3. + 0 + <_> + + <_> + 15 2 5 3 -1. + <_> + 15 3 5 1 3. + 0 + <_> + + <_> + 15 4 2 6 -1. + <_> + 16 4 1 6 2. + 0 + <_> + + <_> + 15 4 2 8 -1. + <_> + 16 4 1 8 2. + 0 + <_> + + <_> + 15 4 6 8 -1. + <_> + 18 4 3 8 2. + 0 + <_> + + <_> + 15 4 8 3 -1. + <_> + 15 5 8 1 3. + 0 + <_> + + <_> + 15 5 2 2 -1. + <_> + 16 5 1 2 2. + 0 + <_> + + <_> + 15 5 3 2 -1. + <_> + 16 5 1 2 3. + 0 + <_> + + <_> + 15 5 3 3 -1. + <_> + 16 5 1 3 3. + 0 + <_> + + <_> + 15 5 3 6 -1. + <_> + 16 5 1 6 3. + 0 + <_> + + <_> + 15 6 3 18 -1. + <_> + 15 12 3 6 3. + 0 + <_> + + <_> + 15 6 6 7 -1. + <_> + 18 6 3 7 2. + 0 + <_> + + <_> + 15 6 8 4 -1. + <_> + 15 6 4 2 2. + <_> + 19 8 4 2 2. + 0 + <_> + + <_> + 15 7 3 6 -1. + <_> + 15 9 3 2 3. + 0 + <_> + + <_> + 15 7 5 4 -1. + <_> + 15 9 5 2 2. + 0 + <_> + + <_> + 15 7 5 6 -1. + <_> + 15 9 5 2 3. + 0 + <_> + + <_> + 15 7 6 6 -1. + <_> + 15 9 6 2 3. + 0 + <_> + + <_> + 15 7 7 3 -1. + <_> + 15 8 7 1 3. + 0 + <_> + + <_> + 15 7 9 6 -1. + <_> + 15 9 9 2 3. + 0 + <_> + + <_> + 15 8 2 2 -1. + <_> + 15 8 1 1 2. + <_> + 16 9 1 1 2. + 0 + <_> + + <_> + 15 8 2 4 -1. + <_> + 15 8 1 2 2. + <_> + 16 10 1 2 2. + 0 + <_> + + <_> + 15 8 1 12 -1. + <_> + 15 14 1 6 2. + 0 + <_> + + <_> + 15 9 2 2 -1. + <_> + 15 9 1 1 2. + <_> + 16 10 1 1 2. + 0 + <_> + + <_> + 15 9 3 4 -1. + <_> + 16 9 1 4 3. + 0 + <_> + + <_> + 15 9 2 3 -1. + <_> + 15 10 2 1 3. + 0 + <_> + + <_> + 15 9 7 3 -1. + <_> + 15 10 7 1 3. + 0 + <_> + + <_> + 15 10 2 1 -1. + <_> + 16 10 1 1 2. + 0 + <_> + + <_> + 15 10 3 1 -1. + <_> + 16 10 1 1 3. + 0 + <_> + + <_> + 15 10 3 4 -1. + <_> + 16 10 1 4 3. + 0 + <_> + + <_> + 15 10 3 5 -1. + <_> + 16 10 1 5 3. + 0 + <_> + + <_> + 15 12 4 8 -1. + <_> + 15 12 2 4 2. + <_> + 17 16 2 4 2. + 0 + <_> + + <_> + 15 15 4 3 -1. + <_> + 15 16 4 1 3. + 0 + <_> + + <_> + 15 16 5 3 -1. + <_> + 15 17 5 1 3. + 0 + <_> + + <_> + 15 19 3 4 -1. + <_> + 16 19 1 4 3. + 0 + <_> + + <_> + 15 19 9 3 -1. + <_> + 15 20 9 1 3. + 0 + <_> + + <_> + 15 20 6 3 -1. + <_> + 18 20 3 3 2. + 0 + <_> + + <_> + 16 0 8 1 -1. + <_> + 20 0 4 1 2. + 0 + <_> + + <_> + 16 0 8 2 -1. + <_> + 20 0 4 2 2. + 0 + <_> + + <_> + 16 0 8 4 -1. + <_> + 16 0 4 2 2. + <_> + 20 2 4 2 2. + 0 + <_> + + <_> + 16 0 8 6 -1. + <_> + 16 0 4 3 2. + <_> + 20 3 4 3 2. + 0 + <_> + + <_> + 16 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 20 4 4 4 2. + 0 + <_> + + <_> + 16 0 8 12 -1. + <_> + 16 0 4 6 2. + <_> + 20 6 4 6 2. + 0 + <_> + + <_> + 16 1 4 13 -1. + <_> + 18 1 2 13 2. + 0 + <_> + + <_> + 16 2 3 2 -1. + <_> + 17 2 1 2 3. + 0 + <_> + + <_> + 16 3 2 3 -1. + <_> + 16 4 2 1 3. + 0 + <_> + + <_> + 16 4 1 3 -1. + <_> + 16 5 1 1 3. + 0 + <_> + + <_> + 16 4 2 2 -1. + <_> + 16 4 1 1 2. + <_> + 17 5 1 1 2. + 0 + <_> + + <_> + 16 5 2 3 -1. + <_> + 17 5 1 3 2. + 0 + <_> + + <_> + 16 6 2 9 -1. + <_> + 16 9 2 3 3. + 0 + <_> + + <_> + 16 6 4 4 -1. + <_> + 18 6 2 4 2. + 0 + <_> + + <_> + 16 6 3 9 -1. + <_> + 16 9 3 3 3. + 0 + <_> + + <_> + 16 6 7 6 -1. + <_> + 16 8 7 2 3. + 0 + <_> + + <_> + 16 7 1 6 -1. + <_> + 16 9 1 2 3. + 0 + <_> + + <_> + 16 7 2 3 -1. + <_> + 16 8 2 1 3. + 0 + <_> + + <_> + 16 7 2 6 -1. + <_> + 16 9 2 2 3. + 0 + <_> + + <_> + 16 7 3 2 -1. + <_> + 16 8 3 1 2. + 0 + <_> + + <_> + 16 7 3 3 -1. + <_> + 16 8 3 1 3. + 0 + <_> + + <_> + 16 7 3 6 -1. + <_> + 16 9 3 2 3. + 0 + <_> + + <_> + 16 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 19 9 3 2 2. + 0 + <_> + + <_> + 16 7 4 3 -1. + <_> + 16 8 4 1 3. + 0 + <_> + + <_> + 16 7 4 6 -1. + <_> + 16 9 4 2 3. + 0 + <_> + + <_> + 16 8 1 2 -1. + <_> + 16 9 1 1 2. + 0 + <_> + + <_> + 16 8 2 2 -1. + <_> + 16 8 1 1 2. + <_> + 17 9 1 1 2. + 0 + <_> + + <_> + 16 8 2 2 -1. + <_> + 16 9 2 1 2. + 0 + <_> + + <_> + 16 8 8 2 -1. + <_> + 16 8 4 1 2. + <_> + 20 9 4 1 2. + 0 + <_> + + <_> + 16 9 3 1 -1. + <_> + 17 9 1 1 3. + 0 + <_> + + <_> + 16 9 1 3 -1. + <_> + 16 10 1 1 3. + 0 + <_> + + <_> + 16 9 2 3 -1. + <_> + 17 9 1 3 2. + 0 + <_> + + <_> + 16 9 4 1 -1. + <_> + 18 9 2 1 2. + 0 + <_> + + <_> + 16 9 2 2 -1. + <_> + 16 10 2 1 2. + 0 + <_> + + <_> + 16 9 4 4 -1. + <_> + 18 9 2 4 2. + 0 + <_> + + <_> + 16 9 6 6 -1. + <_> + 16 9 3 3 2. + <_> + 19 12 3 3 2. + 0 + <_> + + <_> + 16 10 1 2 -1. + <_> + 16 11 1 1 2. + 0 + <_> + + <_> + 16 10 1 3 -1. + <_> + 16 11 1 1 3. + 0 + <_> + + <_> + 16 10 2 2 -1. + <_> + 16 10 1 1 2. + <_> + 17 11 1 1 2. + 0 + <_> + + <_> + 16 10 2 2 -1. + <_> + 17 10 1 2 2. + 0 + <_> + + <_> + 16 10 2 5 -1. + <_> + 17 10 1 5 2. + 0 + <_> + + <_> + 16 10 3 13 -1. + <_> + 17 10 1 13 3. + 0 + <_> + + <_> + 16 10 2 3 -1. + <_> + 16 11 2 1 3. + 0 + <_> + + <_> + 16 10 3 3 -1. + <_> + 16 11 3 1 3. + 0 + <_> + + <_> + 16 11 1 2 -1. + <_> + 16 12 1 1 2. + 0 + <_> + + <_> + 16 11 3 2 -1. + <_> + 17 11 1 2 3. + 0 + <_> + + <_> + 16 11 2 2 -1. + <_> + 16 12 2 1 2. + 0 + <_> + + <_> + 16 11 2 3 -1. + <_> + 16 12 2 1 3. + 0 + <_> + + <_> + 16 13 3 3 -1. + <_> + 16 14 3 1 3. + 0 + <_> + + <_> + 16 14 4 1 -1. + <_> + 18 14 2 1 2. + 0 + <_> + + <_> + 16 15 4 3 -1. + <_> + 18 15 2 3 2. + 0 + <_> + + <_> + 16 15 6 2 -1. + <_> + 19 15 3 2 2. + 0 + <_> + + <_> + 16 15 8 3 -1. + <_> + 20 15 4 3 2. + 0 + <_> + + <_> + 16 16 4 1 -1. + <_> + 18 16 2 1 2. + 0 + <_> + + <_> + 16 17 3 7 -1. + <_> + 17 17 1 7 3. + 0 + <_> + + <_> + 16 17 6 3 -1. + <_> + 16 18 6 1 3. + 0 + <_> + + <_> + 16 19 3 4 -1. + <_> + 17 19 1 4 3. + 0 + <_> + + <_> + 17 0 6 1 -1. + <_> + 20 0 3 1 2. + 0 + <_> + + <_> + 17 2 1 4 -1. + <_> + 17 4 1 2 2. + 0 + <_> + + <_> + 17 3 3 1 -1. + <_> + 18 3 1 1 3. + 0 + <_> + + <_> + 17 3 3 2 -1. + <_> + 18 3 1 2 3. + 0 + <_> + + <_> + 17 3 2 8 -1. + <_> + 17 3 1 4 2. + <_> + 18 7 1 4 2. + 0 + <_> + + <_> + 17 3 3 3 -1. + <_> + 17 4 3 1 3. + 0 + <_> + + <_> + 17 4 1 3 -1. + <_> + 17 5 1 1 3. + 0 + <_> + + <_> + 17 4 2 2 -1. + <_> + 18 4 1 2 2. + 0 + <_> + + <_> + 17 4 2 6 -1. + <_> + 17 4 1 3 2. + <_> + 18 7 1 3 2. + 0 + <_> + + <_> + 17 6 1 6 -1. + <_> + 17 8 1 2 3. + 0 + <_> + + <_> + 17 6 4 8 -1. + <_> + 17 6 2 4 2. + <_> + 19 10 2 4 2. + 0 + <_> + + <_> + 17 6 3 3 -1. + <_> + 17 7 3 1 3. + 0 + <_> + + <_> + 17 6 5 3 -1. + <_> + 17 7 5 1 3. + 0 + <_> + + <_> + 17 7 1 3 -1. + <_> + 17 8 1 1 3. + 0 + <_> + + <_> + 17 7 1 6 -1. + <_> + 17 9 1 2 3. + 0 + <_> + + <_> + 17 7 2 6 -1. + <_> + 17 7 1 3 2. + <_> + 18 10 1 3 2. + 0 + <_> + + <_> + 17 7 2 3 -1. + <_> + 17 8 2 1 3. + 0 + <_> + + <_> + 17 8 6 4 -1. + <_> + 17 10 6 2 2. + 0 + <_> + + <_> + 17 9 3 1 -1. + <_> + 18 9 1 1 3. + 0 + <_> + + <_> + 17 9 2 6 -1. + <_> + 17 9 1 3 2. + <_> + 18 12 1 3 2. + 0 + <_> + + <_> + 17 9 4 2 -1. + <_> + 17 9 2 1 2. + <_> + 19 10 2 1 2. + 0 + <_> + + <_> + 17 9 3 2 -1. + <_> + 17 10 3 1 2. + 0 + <_> + + <_> + 17 9 5 3 -1. + <_> + 17 10 5 1 3. + 0 + <_> + + <_> + 17 9 7 2 -1. + <_> + 17 10 7 1 2. + 0 + <_> + + <_> + 17 10 1 3 -1. + <_> + 17 11 1 1 3. + 0 + <_> + + <_> + 17 10 2 2 -1. + <_> + 17 10 1 1 2. + <_> + 18 11 1 1 2. + 0 + <_> + + <_> + 17 10 2 4 -1. + <_> + 18 10 1 4 2. + 0 + <_> + + <_> + 17 10 3 4 -1. + <_> + 18 10 1 4 3. + 0 + <_> + + <_> + 17 10 4 2 -1. + <_> + 17 10 2 1 2. + <_> + 19 11 2 1 2. + 0 + <_> + + <_> + 17 11 1 3 -1. + <_> + 17 12 1 1 3. + 0 + <_> + + <_> + 17 11 3 2 -1. + <_> + 18 11 1 2 3. + 0 + <_> + + <_> + 17 11 3 3 -1. + <_> + 18 11 1 3 3. + 0 + <_> + + <_> + 17 11 2 2 -1. + <_> + 17 12 2 1 2. + 0 + <_> + + <_> + 17 11 4 2 -1. + <_> + 17 11 2 1 2. + <_> + 19 12 2 1 2. + 0 + <_> + + <_> + 17 12 3 2 -1. + <_> + 18 12 1 2 3. + 0 + <_> + + <_> + 17 13 4 5 -1. + <_> + 19 13 2 5 2. + 0 + <_> + + <_> + 17 14 2 3 -1. + <_> + 17 15 2 1 3. + 0 + <_> + + <_> + 17 14 4 2 -1. + <_> + 19 14 2 2 2. + 0 + <_> + + <_> + 17 15 4 2 -1. + <_> + 19 15 2 2 2. + 0 + <_> + + <_> + 17 16 4 3 -1. + <_> + 19 16 2 3 2. + 0 + <_> + + <_> + 17 17 3 7 -1. + <_> + 18 17 1 7 3. + 0 + <_> + + <_> + 17 19 3 4 -1. + <_> + 18 19 1 4 3. + 0 + <_> + + <_> + 17 21 3 3 -1. + <_> + 18 21 1 3 3. + 0 + <_> + + <_> + 18 0 4 1 -1. + <_> + 20 0 2 1 2. + 0 + <_> + + <_> + 18 0 6 1 -1. + <_> + 21 0 3 1 2. + 0 + <_> + + <_> + 18 0 6 4 -1. + <_> + 21 0 3 4 2. + 0 + <_> + + <_> + 18 1 1 12 -1. + <_> + 18 5 1 4 3. + 0 + <_> + + <_> + 18 2 3 3 -1. + <_> + 19 2 1 3 3. + 0 + <_> + + <_> + 18 3 3 2 -1. + <_> + 19 3 1 2 3. + 0 + <_> + + <_> + 18 3 1 9 -1. + <_> + 18 6 1 3 3. + 0 + <_> + + <_> + 18 3 3 4 -1. + <_> + 19 3 1 4 3. + 0 + <_> + + <_> + 18 4 3 2 -1. + <_> + 19 4 1 2 3. + 0 + <_> + + <_> + 18 4 3 4 -1. + <_> + 19 4 1 4 3. + 0 + <_> + + <_> + 18 5 6 15 -1. + <_> + 21 5 3 15 2. + 0 + <_> + + <_> + 18 6 2 3 -1. + <_> + 18 7 2 1 3. + 0 + <_> + + <_> + 18 6 3 3 -1. + <_> + 18 7 3 1 3. + 0 + <_> + + <_> + 18 6 4 3 -1. + <_> + 18 7 4 1 3. + 0 + <_> + + <_> + 18 7 3 1 -1. + <_> + 19 7 1 1 3. + 0 + <_> + + <_> + 18 7 2 2 -1. + <_> + 19 7 1 2 2. + 0 + <_> + + <_> + 18 7 3 2 -1. + <_> + 18 8 3 1 2. + 0 + <_> + + <_> + 18 8 1 3 -1. + <_> + 18 9 1 1 3. + 0 + <_> + + <_> + 18 8 2 2 -1. + <_> + 18 8 1 1 2. + <_> + 19 9 1 1 2. + 0 + <_> + + <_> + 18 8 2 3 -1. + <_> + 18 9 2 1 3. + 0 + <_> + + <_> + 18 8 3 14 -1. + <_> + 18 15 3 7 2. + 0 + <_> + + <_> + 18 9 3 1 -1. + <_> + 19 9 1 1 3. + 0 + <_> + + <_> + 18 9 2 2 -1. + <_> + 18 9 1 1 2. + <_> + 19 10 1 1 2. + 0 + <_> + + <_> + 18 9 3 2 -1. + <_> + 19 9 1 2 3. + 0 + <_> + + <_> + 18 10 2 1 -1. + <_> + 19 10 1 1 2. + 0 + <_> + + <_> + 18 10 2 2 -1. + <_> + 18 10 1 1 2. + <_> + 19 11 1 1 2. + 0 + <_> + + <_> + 18 10 2 2 -1. + <_> + 18 11 2 1 2. + 0 + <_> + + <_> + 18 10 6 4 -1. + <_> + 21 10 3 4 2. + 0 + <_> + + <_> + 18 10 6 5 -1. + <_> + 21 10 3 5 2. + 0 + <_> + + <_> + 18 11 3 2 -1. + <_> + 19 11 1 2 3. + 0 + <_> + + <_> + 18 11 3 6 -1. + <_> + 19 11 1 6 3. + 0 + <_> + + <_> + 18 11 3 9 -1. + <_> + 19 11 1 9 3. + 0 + <_> + + <_> + 18 11 3 8 -1. + <_> + 18 15 3 4 2. + 0 + <_> + + <_> + 18 12 3 4 -1. + <_> + 19 12 1 4 3. + 0 + <_> + + <_> + 18 12 2 6 -1. + <_> + 18 15 2 3 2. + 0 + <_> + + <_> + 18 12 6 2 -1. + <_> + 21 12 3 2 2. + 0 + <_> + + <_> + 18 12 3 12 -1. + <_> + 18 16 3 4 3. + 0 + <_> + + <_> + 18 13 3 1 -1. + <_> + 19 13 1 1 3. + 0 + <_> + + <_> + 18 14 6 6 -1. + <_> + 21 14 3 6 2. + 0 + <_> + + <_> + 18 20 3 4 -1. + <_> + 19 20 1 4 3. + 0 + <_> + + <_> + 18 20 6 3 -1. + <_> + 18 21 6 1 3. + 0 + <_> + + <_> + 19 2 2 4 -1. + <_> + 19 2 1 2 2. + <_> + 20 4 1 2 2. + 0 + <_> + + <_> + 19 4 1 4 -1. + <_> + 19 6 1 2 2. + 0 + <_> + + <_> + 19 4 1 20 -1. + <_> + 19 14 1 10 2. + 0 + <_> + + <_> + 19 4 2 4 -1. + <_> + 19 6 2 2 2. + 0 + <_> + + <_> + 19 4 4 3 -1. + <_> + 19 5 4 1 3. + 0 + <_> + + <_> + 19 5 2 2 -1. + <_> + 19 5 1 1 2. + <_> + 20 6 1 1 2. + 0 + <_> + + <_> + 19 6 1 3 -1. + <_> + 19 7 1 1 3. + 0 + <_> + + <_> + 19 6 2 3 -1. + <_> + 19 7 2 1 3. + 0 + <_> + + <_> + 19 6 5 3 -1. + <_> + 19 7 5 1 3. + 0 + <_> + + <_> + 19 6 5 9 -1. + <_> + 19 9 5 3 3. + 0 + <_> + + <_> + 19 7 1 12 -1. + <_> + 19 11 1 4 3. + 0 + <_> + + <_> + 19 7 2 3 -1. + <_> + 19 8 2 1 3. + 0 + <_> + + <_> + 19 8 1 3 -1. + <_> + 19 9 1 1 3. + 0 + <_> + + <_> + 19 8 2 3 -1. + <_> + 20 8 1 3 2. + 0 + <_> + + <_> + 19 9 2 1 -1. + <_> + 20 9 1 1 2. + 0 + <_> + + <_> + 19 9 3 2 -1. + <_> + 20 9 1 2 3. + 0 + <_> + + <_> + 19 10 2 2 -1. + <_> + 19 10 1 1 2. + <_> + 20 11 1 1 2. + 0 + <_> + + <_> + 19 10 4 1 -1. + <_> + 21 10 2 1 2. + 0 + <_> + + <_> + 19 11 3 7 -1. + <_> + 20 11 1 7 3. + 0 + <_> + + <_> + 19 11 3 10 -1. + <_> + 20 11 1 10 3. + 0 + <_> + + <_> + 19 11 3 11 -1. + <_> + 20 11 1 11 3. + 0 + <_> + + <_> + 19 11 3 13 -1. + <_> + 20 11 1 13 3. + 0 + <_> + + <_> + 19 14 3 10 -1. + <_> + 20 14 1 10 3. + 0 + <_> + + <_> + 19 15 3 2 -1. + <_> + 19 16 3 1 2. + 0 + <_> + + <_> + 19 18 3 3 -1. + <_> + 20 18 1 3 3. + 0 + <_> + + <_> + 19 18 3 6 -1. + <_> + 20 18 1 6 3. + 0 + <_> + + <_> + 19 20 5 3 -1. + <_> + 19 21 5 1 3. + 0 + <_> + + <_> + 20 4 1 3 -1. + <_> + 20 5 1 1 3. + 0 + <_> + + <_> + 20 5 1 2 -1. + <_> + 20 6 1 1 2. + 0 + <_> + + <_> + 20 5 1 3 -1. + <_> + 20 6 1 1 3. + 0 + <_> + + <_> + 20 5 2 3 -1. + <_> + 20 6 2 1 3. + 0 + <_> + + <_> + 20 5 3 9 -1. + <_> + 20 8 3 3 3. + 0 + <_> + + <_> + 20 6 4 9 -1. + <_> + 20 9 4 3 3. + 0 + <_> + + <_> + 20 8 4 16 -1. + <_> + 22 8 2 16 2. + 0 + <_> + + <_> + 20 9 4 6 -1. + <_> + 20 11 4 2 3. + 0 + <_> + + <_> + 20 10 3 10 -1. + <_> + 21 10 1 10 3. + 0 + <_> + + <_> + 20 10 3 9 -1. + <_> + 20 13 3 3 3. + 0 + <_> + + <_> + 20 16 3 3 -1. + <_> + 21 16 1 3 3. + 0 + <_> + + <_> + 20 17 3 7 -1. + <_> + 21 17 1 7 3. + 0 + <_> + + <_> + 20 17 4 6 -1. + <_> + 20 19 4 2 3. + 0 + <_> + + <_> + 20 18 3 3 -1. + <_> + 21 18 1 3 3. + 0 + <_> + + <_> + 21 1 2 4 -1. + <_> + 21 3 2 2 2. + 0 + <_> + + <_> + 21 5 1 3 -1. + <_> + 21 6 1 1 3. + 0 + <_> + + <_> + 21 6 3 9 -1. + <_> + 21 9 3 3 3. + 0 + <_> + + <_> + 21 10 3 3 -1. + <_> + 21 11 3 1 3. + 0 + <_> + + <_> + 21 13 3 7 -1. + <_> + 22 13 1 7 3. + 0 + <_> + + <_> + 21 16 3 3 -1. + <_> + 22 16 1 3 3. + 0 + <_> + + <_> + 21 16 3 7 -1. + <_> + 22 16 1 7 3. + 0 + <_> + + <_> + 21 17 3 5 -1. + <_> + 22 17 1 5 3. + 0 + <_> + + <_> + 21 17 3 6 -1. + <_> + 21 19 3 2 3. + 0 + <_> + + <_> + 21 17 3 6 -1. + <_> + 21 20 3 3 2. + 0 + <_> + + <_> + 21 19 3 3 -1. + <_> + 22 19 1 3 3. + 0 + <_> + + <_> + 21 19 3 5 -1. + <_> + 22 19 1 5 3. + 0 + <_> + + <_> + 22 10 2 3 -1. + <_> + 22 11 2 1 3. + 0 + <_> + + <_> + 22 11 2 3 -1. + <_> + 22 12 2 1 3. + 0 + <_> + + <_> + 23 7 1 3 -1. + <_> + 23 8 1 1 3. + 0 + <_> + + <_> + 23 9 1 3 -1. + <_> + 23 10 1 1 3. + 0 + <_> + + <_> + 23 10 1 3 -1. + <_> + 23 11 1 1 3. + 0 + <_> + + <_> + 23 14 1 9 -1. + <_> + 23 17 1 3 3. + 0 + <_> + + <_> + 23 15 1 9 -1. + <_> + 23 18 1 3 3. + 0 + <_> + + <_> + 23 18 1 6 -1. + <_> + 23 20 1 2 3. + 0 + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalcatface_extended.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalcatface_extended.xml new file mode 100644 index 0000000000000000000000000000000000000000..892d5cb1a14d8dbb41c03e1cf207268ffa80b834 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalcatface_extended.xml @@ -0,0 +1,13394 @@ + + + + + BOOST + HAAR + 24 + 24 + + GAB + 9.9500000476837158e-01 + 5.0000000000000000e-01 + 9.4999999999999996e-01 + 1 + 100 + + 0 + 1 + ALL + 20 + + + <_> + 13 + -1.4294912815093994e+00 + + <_> + + 0 -1 394 -1.5126220881938934e-02 + + 7.5887596607208252e-01 -3.4230688214302063e-01 + <_> + + 0 -1 737 3.9337221533060074e-03 + + -3.3288389444351196e-01 5.2361363172531128e-01 + <_> + + 0 -1 757 -1.5044892206788063e-02 + + 5.5565774440765381e-01 -2.2505992650985718e-01 + <_> + + 0 -1 450 -1.5777055174112320e-02 + + 7.2692525386810303e-01 -1.6206762194633484e-01 + <_> + + 0 -1 443 3.0781796202063560e-02 + + -1.8173390626907349e-01 7.3483395576477051e-01 + <_> + + 0 -1 220 1.8483418971300125e-02 + + -1.8690711259841919e-01 5.0116515159606934e-01 + <_> + + 0 -1 681 1.3474167324602604e-02 + + -1.5681208670139313e-01 5.8611637353897095e-01 + <_> + + 0 -1 554 5.3415738046169281e-02 + + -1.6418528556823730e-01 6.8128466606140137e-01 + <_> + + 0 -1 741 5.4243900813162327e-03 + + -1.8231739103794098e-01 4.6716138720512390e-01 + <_> + + 0 -1 336 1.7689792439341545e-02 + + -1.3713267445564270e-01 6.0434049367904663e-01 + <_> + + 0 -1 187 2.2149257711134851e-04 + + -2.7738124132156372e-01 2.8165665268898010e-01 + <_> + + 0 -1 288 -2.8517641127109528e-02 + + 5.5257320404052734e-01 -1.2970162928104401e-01 + <_> + + 0 -1 369 4.3854981660842896e-02 + + -1.9231440126895905e-01 4.2093500494956970e-01 + + <_> + 27 + -1.5509251356124878e+00 + + <_> + + 0 -1 337 2.4014184251427650e-02 + + -2.1038578450679779e-01 7.3892170190811157e-01 + <_> + + 0 -1 475 -5.5319909006357193e-03 + + 4.4344031810760498e-01 -2.8907662630081177e-01 + <_> + + 0 -1 4 2.7481060475111008e-02 + + -1.9128543138504028e-01 5.1661676168441772e-01 + <_> + + 0 -1 457 -1.1628001928329468e-02 + + 5.1978123188018799e-01 -1.7051684856414795e-01 + <_> + + 0 -1 393 1.5159824397414923e-03 + + -2.9784303903579712e-01 3.9050224423408508e-01 + <_> + + 0 -1 901 1.3662670738995075e-02 + + -1.4316783845424652e-01 4.4111710786819458e-01 + <_> + + 0 -1 780 -3.6911026109009981e-03 + + 3.2185173034667969e-01 -2.3853960633277893e-01 + <_> + + 0 -1 769 3.3176485449075699e-02 + + -7.4603199958801270e-02 7.5860917568206787e-01 + <_> + + 0 -1 317 -5.7046953588724136e-03 + + -7.5004047155380249e-01 1.0240622609853745e-01 + <_> + + 0 -1 73 7.9660946503281593e-03 + + 9.8882928490638733e-02 -7.3491615056991577e-01 + <_> + + 0 -1 739 3.0965393409132957e-02 + + -1.6046196222305298e-01 4.5570060610771179e-01 + <_> + + 0 -1 612 -4.0078125894069672e-03 + + -7.1539020538330078e-01 6.9276176393032074e-02 + <_> + + 0 -1 647 -8.2283765077590942e-03 + + 3.2576236128807068e-01 -1.8509653210639954e-01 + <_> + + 0 -1 170 3.4253271296620369e-03 + + 1.0964145511388779e-01 -5.8205413818359375e-01 + <_> + + 0 -1 434 9.0980646200478077e-04 + + -2.0425215363502502e-01 2.7488732337951660e-01 + <_> + + 0 -1 427 5.9772443026304245e-02 + + -1.3786207139492035e-01 4.0762668848037720e-01 + <_> + + 0 -1 209 -4.1712004691362381e-02 + + 4.9409377574920654e-01 -1.1713714897632599e-01 + <_> + + 0 -1 248 -3.0311278998851776e-02 + + 5.1191121339797974e-01 -1.0507214814424515e-01 + <_> + + 0 -1 339 -6.5785087645053864e-03 + + -7.6472043991088867e-01 8.0923363566398621e-02 + <_> + + 0 -1 37 1.1685060337185860e-02 + + 5.0379037857055664e-02 -7.9744982719421387e-01 + <_> + + 0 -1 423 6.5714016556739807e-02 + + -1.1398456245660782e-01 4.9489131569862366e-01 + <_> + + 0 -1 755 9.7422497346997261e-03 + + -1.4347794651985168e-01 3.6561754345893860e-01 + <_> + + 0 -1 870 4.9857441335916519e-03 + + 7.9834438860416412e-02 -7.2391557693481445e-01 + <_> + + 0 -1 735 -1.1547822505235672e-03 + + 4.1867440938949585e-01 -1.2869183719158173e-01 + <_> + + 0 -1 519 -4.4658007100224495e-03 + + -6.7933702468872070e-01 8.2867160439491272e-02 + <_> + + 0 -1 862 3.6325352266430855e-03 + + 6.6807270050048828e-02 -6.0182958841323853e-01 + <_> + + 0 -1 127 7.4123376980423927e-03 + + -1.5108695626258850e-01 3.2046884298324585e-01 + + <_> + 26 + -1.3890913724899292e+00 + + <_> + + 0 -1 619 1.7836617305874825e-02 + + -2.1508488059043884e-01 6.6796410083770752e-01 + <_> + + 0 -1 457 -8.5781915113329887e-03 + + 5.0962758064270020e-01 -2.2129471600055695e-01 + <_> + + 0 -1 165 3.1586211174726486e-02 + + -2.1485456824302673e-01 4.2591696977615356e-01 + <_> + + 0 -1 518 2.5690056383609772e-02 + + -1.5910078585147858e-01 6.7842948436737061e-01 + <_> + + 0 -1 768 -2.2857591509819031e-02 + + 5.7221925258636475e-01 -1.3710150122642517e-01 + <_> + + 0 -1 741 4.7176675871014595e-03 + + -2.3617559671401978e-01 3.9870622754096985e-01 + <_> + + 0 -1 615 -2.3281413596123457e-03 + + -7.0095318555831909e-01 1.3746888935565948e-01 + <_> + + 0 -1 139 1.0266102617606521e-03 + + -2.6873087882995605e-01 2.6495781540870667e-01 + <_> + + 0 -1 2 -7.6808528974652290e-03 + + 3.6925876140594482e-01 -2.1339643001556396e-01 + <_> + + 0 -1 454 6.4357556402683258e-02 + + -1.1779088526964188e-01 5.5030888319015503e-01 + <_> + + 0 -1 296 8.9486092329025269e-02 + + -1.4395782351493835e-01 5.3468054533004761e-01 + <_> + + 0 -1 253 -5.6334878318011761e-03 + + -6.5704786777496338e-01 1.3971389830112457e-01 + <_> + + 0 -1 834 -8.0200601369142532e-03 + + 3.6956611275672913e-01 -1.8284171819686890e-01 + <_> + + 0 -1 732 8.3984360098838806e-03 + + -1.3507588207721710e-01 4.4903004169464111e-01 + <_> + + 0 -1 246 -5.7764705270528793e-03 + + -6.5459579229354858e-01 1.1050829291343689e-01 + <_> + + 0 -1 630 3.9896301925182343e-02 + + -1.5822732448577881e-01 3.6069712042808533e-01 + <_> + + 0 -1 11 -6.8376958370208740e-02 + + 6.2642019987106323e-01 -8.3647280931472778e-02 + <_> + + 0 -1 696 -2.7075063437223434e-02 + + 4.0549215674400330e-01 -1.4247153699398041e-01 + <_> + + 0 -1 933 6.8107023835182190e-03 + + 7.7754773199558258e-02 -6.4665120840072632e-01 + <_> + + 0 -1 131 3.6659452598541975e-03 + + 7.9356946051120758e-02 -5.4679936170578003e-01 + <_> + + 0 -1 182 2.3308303207159042e-02 + + -1.4383231103420258e-01 3.4179633855819702e-01 + <_> + + 0 -1 389 -3.2547116279602051e-02 + + 3.6395668983459473e-01 -1.2551946938037872e-01 + <_> + + 0 -1 471 1.6501296311616898e-02 + + -1.0674661397933960e-01 4.2714300751686096e-01 + <_> + + 0 -1 616 -2.9296698048710823e-03 + + -5.7476091384887695e-01 8.5429534316062927e-02 + <_> + + 0 -1 828 1.3306898763403296e-03 + + -1.2303277105093002e-01 3.7224721908569336e-01 + <_> + + 0 -1 18 9.8933260887861252e-03 + + 6.7675270140171051e-02 -6.7935848236083984e-01 + + <_> + 31 + -1.4026626348495483e+00 + + <_> + + 0 -1 876 -1.4927964657545090e-02 + + 6.3834953308105469e-01 -1.8698258697986603e-01 + <_> + + 0 -1 467 -1.1759694665670395e-02 + + 5.0763273239135742e-01 -2.0944127440452576e-01 + <_> + + 0 -1 775 1.1289508081972599e-02 + + -1.4533838629722595e-01 5.3039866685867310e-01 + <_> + + 0 -1 335 1.3691024854779243e-02 + + -1.3143934309482574e-01 5.9853446483612061e-01 + <_> + + 0 -1 399 -8.6051290854811668e-03 + + 3.1604155898094177e-01 -2.2497664391994476e-01 + <_> + + 0 -1 898 1.1611104011535645e-02 + + -1.7180299758911133e-01 3.6340636014938354e-01 + <_> + + 0 -1 919 5.4911419283598661e-04 + + -2.0625770092010498e-01 3.0243906378746033e-01 + <_> + + 0 -1 448 -1.1997690424323082e-02 + + 6.7541980743408203e-01 -1.0784135758876801e-01 + <_> + + 0 -1 610 -2.0809918642044067e-03 + + -5.7404327392578125e-01 1.1769672483205795e-01 + <_> + + 0 -1 277 6.8656861782073975e-02 + + -1.4633083343505859e-01 4.1269731521606445e-01 + <_> + + 0 -1 215 -4.5645810663700104e-02 + + 5.4341620206832886e-01 -1.1726979166269302e-01 + <_> + + 0 -1 890 -1.8052812665700912e-02 + + 3.6646232008934021e-01 -1.3256482779979706e-01 + <_> + + 0 -1 897 9.2329997569322586e-03 + + 9.1808989644050598e-02 -6.4987671375274658e-01 + <_> + + 0 -1 142 -2.9587259050458670e-03 + + 2.4805040657520294e-01 -2.0830279588699341e-01 + <_> + + 0 -1 151 -7.1467030793428421e-03 + + -6.6564339399337769e-01 8.8065519928932190e-02 + <_> + + 0 -1 756 -5.7738199830055237e-03 + + 2.4252247810363770e-01 -2.1394193172454834e-01 + <_> + + 0 -1 207 6.4636822789907455e-03 + + 8.4821723401546478e-02 -6.4125812053680420e-01 + <_> + + 0 -1 527 -2.8782974928617477e-02 + + 3.5874211788177490e-01 -1.4370997250080109e-01 + <_> + + 0 -1 715 -1.8174832221120596e-03 + + 3.7480926513671875e-01 -1.2761794030666351e-01 + <_> + + 0 -1 590 -1.9234847277402878e-03 + + -5.6678783893585205e-01 9.0299606323242188e-02 + <_> + + 0 -1 588 2.8048637323081493e-03 + + 8.5870750248432159e-02 -5.8541411161422729e-01 + <_> + + 0 -1 178 7.0693701505661011e-02 + + -1.2318307906389236e-01 3.9827430248260498e-01 + <_> + + 0 -1 554 6.2659628689289093e-02 + + -9.1229990124702454e-02 5.0639665126800537e-01 + <_> + + 0 -1 321 -3.7420655135065317e-03 + + 3.5059738159179688e-01 -1.2444343417882919e-01 + <_> + + 0 -1 273 6.8388320505619049e-03 + + -1.0419095307588577e-01 4.5085826516151428e-01 + <_> + + 0 -1 76 7.1193519979715347e-03 + + 9.1205865144729614e-02 -5.2279585599899292e-01 + <_> + + 0 -1 791 -9.8787562455981970e-04 + + 2.8105542063713074e-01 -1.5169830620288849e-01 + <_> + + 0 -1 639 1.8099821172654629e-03 + + 6.5428622066974640e-02 -6.9196063280105591e-01 + <_> + + 0 -1 726 -6.0212425887584686e-03 + + -6.2636482715606689e-01 5.1543414592742920e-02 + <_> + + 0 -1 818 5.1644006744027138e-03 + + 6.3040286302566528e-02 -6.3455927371978760e-01 + <_> + + 0 -1 205 9.4506526365876198e-03 + + -1.3443979620933533e-01 3.1506177783012390e-01 + + <_> + 38 + -1.4621645212173462e+00 + + <_> + + 0 -1 383 -1.5925668179988861e-02 + + 6.2127149105072021e-01 -1.8520653247833252e-01 + <_> + + 0 -1 648 1.0260052047669888e-02 + + -2.4736632406711578e-01 4.2336893081665039e-01 + <_> + + 0 -1 3 5.7025998830795288e-03 + + -2.3670144379138947e-01 3.3228391408920288e-01 + <_> + + 0 -1 264 9.3164276331663132e-03 + + -1.7946784198284149e-01 4.6311038732528687e-01 + <_> + + 0 -1 830 -5.0438079051673412e-03 + + 4.4613519310951233e-01 -1.6072992980480194e-01 + <_> + + 0 -1 793 2.8381291776895523e-03 + + -1.8486896157264709e-01 3.5892590880393982e-01 + <_> + + 0 -1 455 6.7377656698226929e-02 + + -1.7760114371776581e-01 3.9539518952369690e-01 + <_> + + 0 -1 44 -8.7916189804673195e-03 + + -5.9182339906692505e-01 1.1145308613777161e-01 + <_> + + 0 -1 874 1.3353329151868820e-02 + + -1.1993711441755295e-01 4.8862439393997192e-01 + <_> + + 0 -1 324 -1.0008489713072777e-02 + + 4.1768664121627808e-01 -1.2453128397464752e-01 + <_> + + 0 -1 795 -1.4410717412829399e-03 + + 3.4100320935249329e-01 -1.6849595308303833e-01 + <_> + + 0 -1 123 1.1647527664899826e-01 + + -9.7596585750579834e-02 4.2289251089096069e-01 + <_> + + 0 -1 301 -9.8112244158983231e-03 + + 2.6155915856361389e-01 -2.0234876871109009e-01 + <_> + + 0 -1 425 6.3042029738426208e-02 + + -1.2662252783775330e-01 3.6811619997024536e-01 + <_> + + 0 -1 553 -1.7675247043371201e-02 + + 4.1690909862518311e-01 -1.1987055838108063e-01 + <_> + + 0 -1 105 4.0485346689820290e-03 + + 7.0249855518341064e-02 -7.3556905984878540e-01 + <_> + + 0 -1 675 8.2748252898454666e-03 + + -1.6168670356273651e-01 2.8835350275039673e-01 + <_> + + 0 -1 313 -5.0843162462115288e-03 + + -5.8562570810317993e-01 8.9675068855285645e-02 + <_> + + 0 -1 249 6.0826279222965240e-03 + + 4.7766357660293579e-02 -6.8612217903137207e-01 + <_> + + 0 -1 48 8.5826087743043900e-03 + + -1.6963686048984528e-01 2.6875671744346619e-01 + <_> + + 0 -1 38 2.4908576160669327e-02 + + 8.5034154355525970e-02 -5.7059210538864136e-01 + <_> + + 0 -1 879 2.0448346622288227e-03 + + -1.8642950057983398e-01 2.3178242146968842e-01 + <_> + + 0 -1 16 2.4130716919898987e-02 + + -1.2823060154914856e-01 3.4394741058349609e-01 + <_> + + 0 -1 154 -4.7494415193796158e-03 + + -7.1827727556228638e-01 6.8053275346755981e-02 + <_> + + 0 -1 199 -1.7751917243003845e-02 + + -5.5972510576248169e-01 5.2141726016998291e-02 + <_> + + 0 -1 339 5.5826390162110329e-03 + + 4.8266090452671051e-02 -5.9813541173934937e-01 + <_> + + 0 -1 387 1.4416726771742105e-03 + + -9.2707693576812744e-02 4.1495534777641296e-01 + <_> + + 0 -1 192 -2.1779362577944994e-03 + + 2.7112621068954468e-01 -1.5071788430213928e-01 + <_> + + 0 -1 607 3.0656920280307531e-03 + + 6.0340058058500290e-02 -6.5465551614761353e-01 + <_> + + 0 -1 469 1.9947460293769836e-01 + + -9.5098674297332764e-02 3.9016976952552795e-01 + <_> + + 0 -1 857 -2.0255323499441147e-02 + + 4.3044877052307129e-01 -8.8302992284297943e-02 + <_> + + 0 -1 446 5.4685659706592560e-03 + + -8.7241113185882568e-02 3.9513549208641052e-01 + <_> + + 0 -1 463 -1.0883151553571224e-03 + + 2.9802373051643372e-01 -1.3696449995040894e-01 + <_> + + 0 -1 655 -5.0911568105220795e-03 + + -6.2439930438995361e-01 6.2544539570808411e-02 + <_> + + 0 -1 221 -5.2395770326256752e-03 + + -6.9036418199539185e-01 4.5142117887735367e-02 + <_> + + 0 -1 955 4.0486194193363190e-02 + + -7.5753845274448395e-02 5.2426725625991821e-01 + <_> + + 0 -1 300 4.1610337793827057e-03 + + 6.6071115434169769e-02 -5.8079534769058228e-01 + <_> + + 0 -1 272 -6.4253048039972782e-03 + + 3.0481830239295959e-01 -1.1435022950172424e-01 + + <_> + 44 + -1.4235107898712158e+00 + + <_> + + 0 -1 716 -2.2738082334399223e-03 + + 5.9519726037979126e-01 -1.6779936850070953e-01 + <_> + + 0 -1 457 -1.2204157188534737e-02 + + 4.6985983848571777e-01 -1.7339397966861725e-01 + <_> + + 0 -1 754 3.1242824625223875e-03 + + -2.2488421201705933e-01 3.4029743075370789e-01 + <_> + + 0 -1 777 -3.9868438616394997e-03 + + 3.8314539194107056e-01 -1.8952924013137817e-01 + <_> + + 0 -1 538 -5.4737669415771961e-03 + + 2.4583901464939117e-01 -2.3114782571792603e-01 + <_> + + 0 -1 453 1.5154287219047546e-02 + + -1.0675037652254105e-01 5.8347207307815552e-01 + <_> + + 0 -1 397 -1.4294658321887255e-03 + + 3.8292840123176575e-01 -1.2911921739578247e-01 + <_> + + 0 -1 750 -7.4405185878276825e-03 + + 2.8356546163558960e-01 -1.7810684442520142e-01 + <_> + + 0 -1 786 -4.0357224643230438e-03 + + 2.6303085684776306e-01 -1.6862161457538605e-01 + <_> + + 0 -1 618 -5.8342106640338898e-03 + + 3.2040205597877502e-01 -1.4103877544403076e-01 + <_> + + 0 -1 161 1.7279960215091705e-02 + + -1.7433850467205048e-01 2.7985212206840515e-01 + <_> + + 0 -1 292 2.2125110030174255e-02 + + -1.1797516793012619e-01 4.0373948216438293e-01 + <_> + + 0 -1 958 -4.4059187173843384e-02 + + 5.2820503711700439e-01 -7.0916719734668732e-02 + <_> + + 0 -1 194 -3.8316637277603149e-02 + + 3.8833045959472656e-01 -1.0811555385589600e-01 + <_> + + 0 -1 178 4.5704744756221771e-02 + + -1.7566929757595062e-01 3.4665411710739136e-01 + <_> + + 0 -1 434 1.1523386929184198e-03 + + -1.7257389426231384e-01 2.5989890098571777e-01 + <_> + + 0 -1 121 -1.0491746477782726e-02 + + -6.1285555362701416e-01 7.1230083703994751e-02 + <_> + + 0 -1 395 -4.5014433562755585e-03 + + -5.7712453603744507e-01 5.8887075632810593e-02 + <_> + + 0 -1 950 -3.7281280383467674e-03 + + -6.7359894514083862e-01 5.2957162261009216e-02 + <_> + + 0 -1 331 3.4461893141269684e-02 + + -1.0375578701496124e-01 3.7974634766578674e-01 + <_> + + 0 -1 462 -1.3906960375607014e-03 + + 3.9171192049980164e-01 -1.0048408061265945e-01 + <_> + + 0 -1 85 1.6332454979419708e-02 + + 8.6256101727485657e-02 -4.5887523889541626e-01 + <_> + + 0 -1 356 -6.0738036409020424e-03 + + -5.2265202999114990e-01 6.5308839082717896e-02 + <_> + + 0 -1 486 -3.3630726393312216e-03 + + -5.6505429744720459e-01 5.5844355374574661e-02 + <_> + + 0 -1 418 -1.5329496003687382e-02 + + 3.4475114941596985e-01 -1.0086353123188019e-01 + <_> + + 0 -1 587 -9.0496204793453217e-03 + + 2.9553902149200439e-01 -1.1406829208135605e-01 + <_> + + 0 -1 794 -3.1109917908906937e-03 + + -4.4897687435150146e-01 7.3615357279777527e-02 + <_> + + 0 -1 939 3.3499556593596935e-03 + + 5.4718658328056335e-02 -5.4810231924057007e-01 + <_> + + 0 -1 188 1.8374501960352063e-03 + + -1.3522666692733765e-01 2.4655479192733765e-01 + <_> + + 0 -1 908 2.6134990621358156e-03 + + 6.6369861364364624e-02 -4.7342041134834290e-01 + <_> + + 0 -1 65 -7.4155852198600769e-03 + + 2.0866124331951141e-01 -1.5775154531002045e-01 + <_> + + 0 -1 515 3.9352793246507645e-03 + + 5.1660846918821335e-02 -6.2589824199676514e-01 + <_> + + 0 -1 735 -1.0450070258229971e-03 + + 3.3525371551513672e-01 -1.0084854811429977e-01 + <_> + + 0 -1 784 1.2639444321393967e-03 + + -1.2103077769279480e-01 2.7691018581390381e-01 + <_> + + 0 -1 479 7.7577251940965652e-03 + + 4.6813234686851501e-02 -7.3385792970657349e-01 + <_> + + 0 -1 18 -1.0632604360580444e-02 + + -7.1024382114410400e-01 3.3777639269828796e-02 + <_> + + 0 -1 183 1.8631946295499802e-02 + + -1.4613701403141022e-01 2.1491082012653351e-01 + <_> + + 0 -1 608 4.9128942191600800e-03 + + 5.3445268422365189e-02 -6.3314527273178101e-01 + <_> + + 0 -1 473 -9.8230186849832535e-03 + + 2.6917773485183716e-01 -1.1376978456974030e-01 + <_> + + 0 -1 910 -3.0754944309592247e-03 + + -5.0787961483001709e-01 6.1582125723361969e-02 + <_> + + 0 -1 659 -6.7374799400568008e-03 + + 2.3871047794818878e-01 -1.2552142143249512e-01 + <_> + + 0 -1 507 -1.1759715154767036e-02 + + 3.3646693825721741e-01 -9.4460532069206238e-02 + <_> + + 0 -1 318 -4.1377237066626549e-03 + + -5.0522220134735107e-01 6.2668189406394958e-02 + <_> + + 0 -1 320 1.7267453949898481e-03 + + -8.0607026815414429e-02 3.8304185867309570e-01 + + <_> + 47 + -1.4313566684722900e+00 + + <_> + + 0 -1 882 -1.1920252814888954e-02 + + 5.6617152690887451e-01 -1.5811842679977417e-01 + <_> + + 0 -1 568 -4.3085627257823944e-03 + + 4.4759327173233032e-01 -1.6846470534801483e-01 + <_> + + 0 -1 883 1.1177745182067156e-03 + + -1.5351393818855286e-01 4.3508940935134888e-01 + <_> + + 0 -1 798 3.5418532788753510e-02 + + -1.2973460555076599e-01 3.6943939328193665e-01 + <_> + + 0 -1 393 2.2405586205422878e-03 + + -1.8800468742847443e-01 3.2498928904533386e-01 + <_> + + 0 -1 265 -1.7982896417379379e-02 + + 4.5607218146324158e-01 -1.0459473729133606e-01 + <_> + + 0 -1 152 -4.9088716506958008e-02 + + 3.4279289841651917e-01 -1.5114119648933411e-01 + <_> + + 0 -1 275 7.1780886501073837e-03 + + 6.3825756311416626e-02 -6.2449872493743896e-01 + <_> + + 0 -1 849 3.9123920723795891e-03 + + 7.1502417325973511e-02 -6.3956946134567261e-01 + <_> + + 0 -1 689 -4.1980943642556667e-03 + + 2.1998657286167145e-01 -1.9890366494655609e-01 + <_> + + 0 -1 660 -4.5476644299924374e-03 + + 2.1866278350353241e-01 -1.9852560758590698e-01 + <_> + + 0 -1 944 -4.4158436357975006e-03 + + 2.3959043622016907e-01 -1.7090958356857300e-01 + <_> + + 0 -1 281 -4.7058244235813618e-03 + + -5.1537507772445679e-01 9.0310461819171906e-02 + <_> + + 0 -1 116 -8.7488889694213867e-03 + + 2.2937677800655365e-01 -1.8315380811691284e-01 + <_> + + 0 -1 645 -3.1655649654567242e-03 + + -7.3091191053390503e-01 6.5193220973014832e-02 + <_> + + 0 -1 267 6.4696683548390865e-03 + + -1.1077737808227539e-01 3.7207809090614319e-01 + <_> + + 0 -1 615 2.2985613904893398e-03 + + 7.7800542116165161e-02 -5.1104581356048584e-01 + <_> + + 0 -1 359 4.5809363946318626e-03 + + 5.7778771966695786e-02 -5.7898092269897461e-01 + <_> + + 0 -1 188 1.1279166210442781e-03 + + -1.7981146275997162e-01 1.9939005374908447e-01 + <_> + + 0 -1 347 -1.2820301577448845e-02 + + 5.1867282390594482e-01 -6.9989629089832306e-02 + <_> + + 0 -1 810 4.4866472482681274e-02 + + -1.4253044128417969e-01 3.0062338709831238e-01 + <_> + + 0 -1 412 -3.5413210280239582e-03 + + -5.7618641853332520e-01 6.0328345745801926e-02 + <_> + + 0 -1 362 -7.4678594246506691e-03 + + -5.0187259912490845e-01 6.1294022947549820e-02 + <_> + + 0 -1 678 1.8058011308312416e-02 + + 5.3603217005729675e-02 -5.8919399976730347e-01 + <_> + + 0 -1 935 -6.8098572082817554e-03 + + -5.4100829362869263e-01 5.5898215621709824e-02 + <_> + + 0 -1 307 3.6491458304226398e-03 + + 4.7378763556480408e-02 -5.9323132038116455e-01 + <_> + + 0 -1 284 1.4524955768138170e-03 + + -8.8994570076465607e-02 3.8729071617126465e-01 + <_> + + 0 -1 219 -6.2408884987235069e-03 + + -6.6442847251892090e-01 5.1082015037536621e-02 + <_> + + 0 -1 744 -9.9360430613160133e-04 + + 3.2972389459609985e-01 -1.0494423657655716e-01 + <_> + + 0 -1 285 3.9777760393917561e-03 + + 5.4083213210105896e-02 -6.2114214897155762e-01 + <_> + + 0 -1 380 -1.4884659089148045e-02 + + 2.4066454172134399e-01 -1.2317410856485367e-01 + <_> + + 0 -1 436 3.3154981210827827e-03 + + -1.1744727939367294e-01 2.9429042339324951e-01 + <_> + + 0 -1 976 -4.7508114948868752e-03 + + -4.5763325691223145e-01 6.7066885530948639e-02 + <_> + + 0 -1 779 -1.1973761022090912e-02 + + 2.5750914216041565e-01 -1.1354148387908936e-01 + <_> + + 0 -1 740 4.9072699621319771e-03 + + -1.1266437917947769e-01 3.0022394657135010e-01 + <_> + + 0 -1 56 6.5630510449409485e-02 + + -1.0180503129959106e-01 3.0517497658729553e-01 + <_> + + 0 -1 354 -2.3393325507640839e-02 + + 3.2443770766258240e-01 -9.5363102853298187e-02 + <_> + + 0 -1 834 -3.8902116939425468e-03 + + 2.0148487389087677e-01 -1.4944279193878174e-01 + <_> + + 0 -1 185 -2.5926973670721054e-02 + + -4.4917497038841248e-01 6.9752328097820282e-02 + <_> + + 0 -1 173 -7.1825529448688030e-03 + + -5.6838059425354004e-01 4.9584377557039261e-02 + <_> + + 0 -1 548 -9.9399685859680176e-03 + + 3.0747908353805542e-01 -1.1064232140779495e-01 + <_> + + 0 -1 978 -3.6286246031522751e-03 + + -6.0276371240615845e-01 5.2405584603548050e-02 + <_> + + 0 -1 820 1.5756220091134310e-03 + + -1.1615782976150513e-01 2.6717522740364075e-01 + <_> + + 0 -1 426 3.5662509500980377e-02 + + -1.0885569453239441e-01 2.9044550657272339e-01 + <_> + + 0 -1 554 5.3282946348190308e-02 + + -8.1855505704879761e-02 4.0298762917518616e-01 + <_> + + 0 -1 988 3.3901704009622335e-03 + + 5.5047694593667984e-02 -5.4021596908569336e-01 + <_> + + 0 -1 384 1.3204356655478477e-03 + + -9.4643965363502502e-02 3.0430349707603455e-01 + + <_> + 48 + -1.3744181394577026e+00 + + <_> + + 0 -1 788 3.9594387635588646e-03 + + -1.5454453229904175e-01 4.9922767281532288e-01 + <_> + + 0 -1 467 -1.6322813928127289e-02 + + 4.2537182569503784e-01 -1.5276345610618591e-01 + <_> + + 0 -1 746 1.6230947803705931e-03 + + -2.2640861570835114e-01 2.5220483541488647e-01 + <_> + + 0 -1 115 -6.0441931709647179e-03 + + 2.2711095213890076e-01 -2.1762822568416595e-01 + <_> + + 0 -1 6 1.1688062921166420e-02 + + -1.6991630196571350e-01 2.8343129158020020e-01 + <_> + + 0 -1 624 -3.1942571513354778e-03 + + -6.2475329637527466e-01 7.3184341192245483e-02 + <_> + + 0 -1 11 -7.6569117605686188e-02 + + 5.5236744880676270e-01 -7.7832877635955811e-02 + <_> + + 0 -1 306 1.8717286875471473e-03 + + 8.4293909370899200e-02 -5.2716743946075439e-01 + <_> + + 0 -1 351 3.5880310460925102e-03 + + -1.2907223403453827e-01 3.3967444300651550e-01 + <_> + + 0 -1 176 -5.7136151008307934e-03 + + -5.9208476543426514e-01 7.7793844044208527e-02 + <_> + + 0 -1 150 -1.9309867173433304e-02 + + 2.5386241078376770e-01 -1.7397734522819519e-01 + <_> + + 0 -1 327 -2.4289516732096672e-03 + + 3.2221227884292603e-01 -1.2751287221908569e-01 + <_> + + 0 -1 25 -8.5500031709671021e-02 + + -7.7962499856948853e-01 5.0715133547782898e-02 + <_> + + 0 -1 770 5.7447291910648346e-03 + + -1.1523491144180298e-01 3.6400210857391357e-01 + <_> + + 0 -1 781 5.8936916291713715e-02 + + -8.7829843163490295e-02 4.1893997788429260e-01 + <_> + + 0 -1 984 -4.1379006579518318e-03 + + -6.3083720207214355e-01 6.4935714006423950e-02 + <_> + + 0 -1 565 -4.6407114714384079e-03 + + -6.5650087594985962e-01 5.4394256323575974e-02 + <_> + + 0 -1 877 1.5865347813814878e-03 + + -1.7255148291587830e-01 2.3248092830181122e-01 + <_> + + 0 -1 624 2.8971401043236256e-03 + + 6.0526229441165924e-02 -5.4368048906326294e-01 + <_> + + 0 -1 773 1.5737174544483423e-03 + + -1.1744406074285507e-01 3.0534917116165161e-01 + <_> + + 0 -1 609 1.6838097944855690e-03 + + 6.6153712570667267e-02 -5.9224641323089600e-01 + <_> + + 0 -1 912 3.2287575304508209e-03 + + 5.2678912878036499e-02 -5.7474386692047119e-01 + <_> + + 0 -1 850 -3.1512752175331116e-03 + + 3.7773844599723816e-01 -8.7322145700454712e-02 + <_> + + 0 -1 894 8.2073279190808535e-04 + + -1.0513201355934143e-01 3.4025487303733826e-01 + <_> + + 0 -1 603 2.8983387164771557e-03 + + 5.1720291376113892e-02 -6.5431916713714600e-01 + <_> + + 0 -1 852 -5.7246205396950245e-03 + + -7.8483843803405762e-01 3.5195719450712204e-02 + <_> + + 0 -1 44 -1.1572695337235928e-02 + + -6.7286187410354614e-01 3.5210411995649338e-02 + <_> + + 0 -1 80 -1.4562263153493404e-02 + + 2.4655815958976746e-01 -1.2278749793767929e-01 + <_> + + 0 -1 269 7.8490225132554770e-04 + + -1.4652141928672791e-01 3.0276218056678772e-01 + <_> + + 0 -1 725 -1.4289810787886381e-03 + + 1.8906314671039581e-01 -1.5791040658950806e-01 + <_> + + 0 -1 108 -9.4615388661623001e-03 + + -6.9036215543746948e-01 3.9911076426506042e-02 + <_> + + 0 -1 21 2.3225568234920502e-02 + + 5.0278317183256149e-02 -5.2323836088180542e-01 + <_> + + 0 -1 959 1.4046948403120041e-02 + + -7.9005211591720581e-02 4.0158179402351379e-01 + <_> + + 0 -1 126 3.7851710803806782e-03 + + -1.3530673086643219e-01 2.1973098814487457e-01 + <_> + + 0 -1 142 -3.6725951358675957e-03 + + 1.9924460351467133e-01 -1.5001934766769409e-01 + <_> + + 0 -1 963 -3.1669549643993378e-03 + + -4.2041611671447754e-01 7.4019186198711395e-02 + <_> + + 0 -1 695 -1.3667810708284378e-02 + + 2.5204744935035706e-01 -1.2807497382164001e-01 + <_> + + 0 -1 214 -3.5862527787685394e-02 + + 3.2997950911521912e-01 -8.9863941073417664e-02 + <_> + + 0 -1 946 -6.2667285092175007e-03 + + -5.5024039745330811e-01 5.7369034737348557e-02 + <_> + + 0 -1 438 -6.4383493736386299e-03 + + 3.3817592263221741e-01 -9.3247875571250916e-02 + <_> + + 0 -1 439 5.4173925891518593e-03 + + -1.0427469760179520e-01 2.9482829570770264e-01 + <_> + + 0 -1 400 -1.5132453292608261e-02 + + 3.2000914216041565e-01 -9.8272062838077545e-02 + <_> + + 0 -1 606 -1.2513613328337669e-02 + + 2.8962445259094238e-01 -1.2084391713142395e-01 + <_> + + 0 -1 91 -9.8966564983129501e-03 + + -5.8358079195022583e-01 5.1291342824697495e-02 + <_> + + 0 -1 932 1.3835988938808441e-02 + + -9.0702146291732788e-02 3.2527267932891846e-01 + <_> + + 0 -1 92 3.6492943763732910e-03 + + 8.4720104932785034e-02 -3.4649613499641418e-01 + <_> + + 0 -1 478 -1.3878188095986843e-02 + + 2.9309025406837463e-01 -9.6585884690284729e-02 + <_> + + 0 -1 580 2.8816664125770330e-03 + + -1.0839603841304779e-01 2.5134062767028809e-01 + + <_> + 57 + -1.3757541179656982e+00 + + <_> + + 0 -1 742 -4.1507836431264877e-03 + + 4.7857573628425598e-01 -1.5079282224178314e-01 + <_> + + 0 -1 539 -4.2431484907865524e-03 + + 2.7976706624031067e-01 -2.1182695031166077e-01 + <_> + + 0 -1 422 7.2727665305137634e-02 + + -1.1322361230850220e-01 4.6931907534599304e-01 + <_> + + 0 -1 120 7.3349894955754280e-03 + + -2.2507375478744507e-01 2.3486614227294922e-01 + <_> + + 0 -1 79 -1.3757663965225220e-01 + + 5.5153369903564453e-01 -8.4895148873329163e-02 + <_> + + 0 -1 592 6.8098353222012520e-04 + + -1.7585472762584686e-01 2.2849111258983612e-01 + <_> + + 0 -1 110 2.7579340338706970e-01 + + -1.1671220511198044e-01 3.2674804329872131e-01 + <_> + + 0 -1 921 5.4910051403567195e-04 + + -2.0603717863559723e-01 1.8896938860416412e-01 + <_> + + 0 -1 155 -5.5065844208002090e-03 + + -5.7701790332794189e-01 6.9212622940540314e-02 + <_> + + 0 -1 824 -8.3996364846825600e-03 + + 4.6683028340339661e-01 -7.4202880263328552e-02 + <_> + + 0 -1 843 -1.1010931339114904e-03 + + 1.9711431860923767e-01 -1.7736457288265228e-01 + <_> + + 0 -1 217 -4.4837296009063721e-03 + + -6.0108631849288940e-01 4.9327563494443893e-02 + <_> + + 0 -1 211 2.5086081586778164e-03 + + 6.9480538368225098e-02 -4.8671180009841919e-01 + <_> + + 0 -1 201 1.5808893367648125e-03 + + -1.0519328713417053e-01 3.2050549983978271e-01 + <_> + + 0 -1 210 1.4971228083595634e-03 + + -8.4364958107471466e-02 4.3016371130943298e-01 + <_> + + 0 -1 343 -2.6089220773428679e-03 + + -4.2146065831184387e-01 8.8990658521652222e-02 + <_> + + 0 -1 42 -7.7147269621491432e-03 + + -6.6330111026763916e-01 5.0671890377998352e-02 + <_> + + 0 -1 85 -1.7141735181212425e-02 + + -4.8750495910644531e-01 5.6981299072504044e-02 + <_> + + 0 -1 146 1.3850606046617031e-02 + + 7.4964463710784912e-02 -4.4079580903053284e-01 + <_> + + 0 -1 341 -1.4932476915419102e-03 + + 3.1057041883468628e-01 -1.0369800031185150e-01 + <_> + + 0 -1 382 -8.3094676956534386e-03 + + 2.2514784336090088e-01 -1.4621259272098541e-01 + <_> + + 0 -1 462 -7.2969077154994011e-04 + + 2.6934301853179932e-01 -1.2512375414371490e-01 + <_> + + 0 -1 430 -1.3652374967932701e-02 + + -4.9215099215507507e-01 7.3141731321811676e-02 + <_> + + 0 -1 20 9.4011947512626648e-03 + + 4.1364993900060654e-02 -6.5001028776168823e-01 + <_> + + 0 -1 657 4.0921592153608799e-03 + + 4.0478449314832687e-02 -5.9830683469772339e-01 + <_> + + 0 -1 847 1.5591707779094577e-03 + + -9.3049824237823486e-02 3.1007137894630432e-01 + <_> + + 0 -1 973 3.4408085048198700e-03 + + 4.7337688505649567e-02 -6.5880972146987915e-01 + <_> + + 0 -1 847 -1.3411687687039375e-03 + + 2.8307750821113586e-01 -1.0693576931953430e-01 + <_> + + 0 -1 534 -5.7181939482688904e-03 + + -4.7754487395286560e-01 6.3519261777400970e-02 + <_> + + 0 -1 374 -5.0096530467271805e-03 + + -6.1091655492782593e-01 3.9555240422487259e-02 + <_> + + 0 -1 1 -4.1508115828037262e-03 + + 2.1694649755954742e-01 -1.3193054497241974e-01 + <_> + + 0 -1 844 -1.6968715935945511e-02 + + 2.7644789218902588e-01 -1.0202119499444962e-01 + <_> + + 0 -1 103 1.0276203043758869e-02 + + -9.0598084032535553e-02 2.9703584313392639e-01 + <_> + + 0 -1 350 -1.8649294506758451e-03 + + 2.8791305422782898e-01 -9.2735975980758667e-02 + <_> + + 0 -1 942 3.3354205079376698e-03 + + 5.3746312856674194e-02 -5.0940161943435669e-01 + <_> + + 0 -1 396 -1.4105688314884901e-03 + + 2.4489782750606537e-01 -1.1008579283952713e-01 + <_> + + 0 -1 611 2.3928448557853699e-02 + + 5.2839644253253937e-02 -4.9896511435508728e-01 + <_> + + 0 -1 807 -3.8580424152314663e-03 + + -4.8197838664054871e-01 5.3767576813697815e-02 + <_> + + 0 -1 679 -3.0590491369366646e-03 + + -5.2978992462158203e-01 4.6741079539060593e-02 + <_> + + 0 -1 468 -2.9391471762210131e-03 + + -3.4711557626724243e-01 6.9464050233364105e-02 + <_> + + 0 -1 667 -7.0184348151087761e-03 + + 3.1962895393371582e-01 -8.3362981677055359e-02 + <_> + + 0 -1 664 1.0384586639702320e-03 + + -1.0797444730997086e-01 2.4896475672721863e-01 + <_> + + 0 -1 628 -8.0418614670634270e-03 + + -7.3527222871780396e-01 3.6740459501743317e-02 + <_> + + 0 -1 193 -3.1738542020320892e-02 + + 2.6166516542434692e-01 -1.0992183536291122e-01 + <_> + + 0 -1 194 3.6780342459678650e-02 + + -8.7741106748580933e-02 3.7106978893280029e-01 + <_> + + 0 -1 494 -6.4193591475486755e-02 + + 3.1807181239128113e-01 -8.8648937642574310e-02 + <_> + + 0 -1 46 3.4801474213600159e-01 + + -5.5967021733522415e-02 5.3631168603897095e-01 + <_> + + 0 -1 490 7.5712919235229492e-02 + + -5.9786085039377213e-02 4.1973164677619934e-01 + <_> + + 0 -1 983 7.8374873846769333e-03 + + -6.8252839148044586e-02 3.9001336693763733e-01 + <_> + + 0 -1 867 3.3967243507504463e-03 + + 5.7270396500825882e-02 -4.7492286562919617e-01 + <_> + + 0 -1 158 3.2095968723297119e-02 + + 3.0982470139861107e-02 -7.2973543405532837e-01 + <_> + + 0 -1 939 4.1734268888831139e-03 + + 3.0397623777389526e-02 -6.8009066581726074e-01 + <_> + + 0 -1 545 3.2336891163140535e-03 + + -9.4194613397121429e-02 2.5351443886756897e-01 + <_> + + 0 -1 55 -3.8070861250162125e-02 + + 2.7447724342346191e-01 -8.3862110972404480e-02 + <_> + + 0 -1 358 4.6657784841954708e-03 + + 3.7179920822381973e-02 -6.7654901742935181e-01 + <_> + + 0 -1 247 -3.9379103109240532e-03 + + -5.9923279285430908e-01 3.2963614910840988e-02 + <_> + + 0 -1 699 -4.8031057231128216e-03 + + 2.2248022258281708e-01 -1.0560184717178345e-01 + + <_> + 55 + -1.3843152523040771e+00 + + <_> + + 0 -1 456 6.7532630637288094e-03 + + -1.5934121608734131e-01 5.1630091667175293e-01 + <_> + + 0 -1 685 1.6582473181188107e-03 + + -1.4192129671573639e-01 4.6970281004905701e-01 + <_> + + 0 -1 741 8.5381623357534409e-03 + + -1.4064009487628937e-01 4.3454051017761230e-01 + <_> + + 0 -1 711 -5.8347072452306747e-02 + + 4.8053690791130066e-01 -1.1435888707637787e-01 + <_> + + 0 -1 200 7.5503322295844555e-04 + + -1.6613751649856567e-01 3.5059270262718201e-01 + <_> + + 0 -1 463 -1.6263198340311646e-03 + + 3.3983412384986877e-01 -1.2952369451522827e-01 + <_> + + 0 -1 982 -4.9476943910121918e-02 + + 5.1085108518600464e-01 -7.6757252216339111e-02 + <_> + + 0 -1 148 1.5736839268356562e-03 + + -9.8503805696964264e-02 4.2097148299217224e-01 + <_> + + 0 -1 970 2.8940830379724503e-03 + + 8.0476768314838409e-02 -5.9272909164428711e-01 + <_> + + 0 -1 470 -8.5198890883475542e-04 + + 2.7713751792907715e-01 -1.2991340458393097e-01 + <_> + + 0 -1 513 -3.2718123402446508e-03 + + 3.1215441226959229e-01 -1.2980756163597107e-01 + <_> + + 0 -1 244 6.0219354927539825e-03 + + 7.2135269641876221e-02 -5.9813290834426880e-01 + <_> + + 0 -1 81 2.3065296933054924e-02 + + 7.1330830454826355e-02 -5.3722465038299561e-01 + <_> + + 0 -1 187 2.7176631192560308e-05 + + -2.6853099465370178e-01 1.4315985143184662e-01 + <_> + + 0 -1 401 5.4575498215854168e-03 + + 5.5034745484590530e-02 -5.7176333665847778e-01 + <_> + + 0 -1 391 2.5911496777553111e-05 + + -2.3133303225040436e-01 1.4060766994953156e-01 + <_> + + 0 -1 12 2.1752633154392242e-02 + + 5.9929180890321732e-02 -5.0224888324737549e-01 + <_> + + 0 -1 860 3.5099866800010204e-03 + + 4.7387380152940750e-02 -5.8126205205917358e-01 + <_> + + 0 -1 755 8.6558861657977104e-03 + + -1.3651072978973389e-01 2.2407715022563934e-01 + <_> + + 0 -1 990 3.0432851053774357e-03 + + 5.7905938476324081e-02 -5.5585581064224243e-01 + <_> + + 0 -1 240 3.4083288628607988e-03 + + 4.6358574181795120e-02 -5.6204903125762939e-01 + <_> + + 0 -1 241 -4.1327420622110367e-03 + + -4.3748503923416138e-01 6.6312022507190704e-02 + <_> + + 0 -1 887 5.4382300004363060e-04 + + -1.2188895046710968e-01 2.6694831252098083e-01 + <_> + + 0 -1 886 2.0359107293188572e-03 + + -6.9375663995742798e-02 4.1734528541564941e-01 + <_> + + 0 -1 894 5.6087510893121362e-04 + + -1.2235503643751144e-01 2.9018589854240417e-01 + <_> + + 0 -1 957 5.4084453731775284e-03 + + 5.1494579762220383e-02 -6.3784217834472656e-01 + <_> + + 0 -1 99 1.9748538732528687e-02 + + -7.0414997637271881e-02 4.8995351791381836e-01 + <_> + + 0 -1 147 -2.0231239497661591e-02 + + -5.9452813863754272e-01 5.5317912250757217e-02 + <_> + + 0 -1 763 -8.5184378549456596e-03 + + -4.9081006646156311e-01 5.1023125648498535e-02 + <_> + + 0 -1 952 6.4936149865388870e-03 + + -8.6577519774436951e-02 3.6036944389343262e-01 + <_> + + 0 -1 30 -4.0995404124259949e-02 + + 4.0132537484169006e-01 -7.1912504732608795e-02 + <_> + + 0 -1 501 3.1340471468865871e-03 + + -1.2547470629215240e-01 2.2158138453960419e-01 + <_> + + 0 -1 184 -1.9882351160049438e-02 + + -7.1213179826736450e-01 4.2412471026182175e-02 + <_> + + 0 -1 559 2.0461969077587128e-02 + + -1.0324169695377350e-01 2.9102885723114014e-01 + <_> + + 0 -1 686 -1.2761610560119152e-03 + + 2.3810100555419922e-01 -1.1509060114622116e-01 + <_> + + 0 -1 549 -3.3783772960305214e-03 + + -5.6838840246200562e-01 5.6331343948841095e-02 + <_> + + 0 -1 302 5.0912564620375633e-03 + + 4.7987211495637894e-02 -4.7997272014617920e-01 + <_> + + 0 -1 508 -4.1752815246582031e-02 + + -5.9290748834609985e-01 4.2219188064336777e-02 + <_> + + 0 -1 263 -1.3672109693288803e-02 + + 2.7416154742240906e-01 -9.8633147776126862e-02 + <_> + + 0 -1 329 4.5463615097105503e-03 + + -9.5323033630847931e-02 3.3586710691452026e-01 + <_> + + 0 -1 472 -1.1957241222262383e-02 + + 1.6140049695968628e-01 -1.6837921738624573e-01 + <_> + + 0 -1 95 -2.4866103194653988e-03 + + -3.8348227739334106e-01 6.6880211234092712e-02 + <_> + + 0 -1 130 3.3222150523215532e-03 + + 4.9669362604618073e-02 -5.2419567108154297e-01 + <_> + + 0 -1 767 1.2700627557933331e-03 + + -1.0981336981058121e-01 2.4314954876899719e-01 + <_> + + 0 -1 643 -4.0526064112782478e-03 + + -5.4617625474929810e-01 4.6236973255872726e-02 + <_> + + 0 -1 889 -1.7611857037991285e-03 + + 2.0527404546737671e-01 -1.1924317479133606e-01 + <_> + + 0 -1 832 -2.8845192864537239e-03 + + 2.0061042904853821e-01 -1.4499643445014954e-01 + <_> + + 0 -1 969 -9.4242449849843979e-03 + + -7.2513866424560547e-01 3.4894362092018127e-02 + <_> + + 0 -1 972 3.7029895465821028e-03 + + 5.5003125220537186e-02 -4.1173446178436279e-01 + <_> + + 0 -1 785 -8.4825151134282351e-04 + + 2.6719486713409424e-01 -9.9083028733730316e-02 + <_> + + 0 -1 54 1.5727356076240540e-02 + + -1.2551975250244141e-01 2.0588764548301697e-01 + <_> + + 0 -1 106 5.9068910777568817e-03 + + 6.0179408639669418e-02 -4.1827461123466492e-01 + <_> + + 0 -1 27 -3.9538964629173279e-02 + + 3.4726879000663757e-01 -7.4968926608562469e-02 + <_> + + 0 -1 10 4.7501657158136368e-02 + + -7.6978117227554321e-02 3.5068345069885254e-01 + <_> + + 0 -1 259 -5.9454172151163220e-04 + + 1.6073931753635406e-01 -1.5279982984066010e-01 + + <_> + 58 + -1.2862224578857422e+00 + + <_> + + 0 -1 882 -1.3625519350171089e-02 + + 5.0128185749053955e-01 -1.1663150042295456e-01 + <_> + + 0 -1 375 -2.2920668125152588e-03 + + 3.9538189768791199e-01 -1.3872602581977844e-01 + <_> + + 0 -1 792 1.0770710650831461e-03 + + -1.7133137583732605e-01 3.1510788202285767e-01 + <_> + + 0 -1 452 -1.2591466307640076e-02 + + 3.9579889178276062e-01 -1.4279782772064209e-01 + <_> + + 0 -1 460 -4.7927081584930420e-02 + + -4.9305588006973267e-01 5.6685980409383774e-02 + <_> + + 0 -1 474 -2.5895023718476295e-03 + + 1.6586430370807648e-01 -2.2577352821826935e-01 + <_> + + 0 -1 112 9.8585948348045349e-02 + + -7.2541341185569763e-02 5.3971153497695923e-01 + <_> + + 0 -1 521 7.2299325838685036e-03 + + 7.2869211435317993e-02 -6.0541796684265137e-01 + <_> + + 0 -1 202 -6.0262705665081739e-04 + + 2.7961328625679016e-01 -1.3374039530754089e-01 + <_> + + 0 -1 253 5.3171166218817234e-03 + + 6.1562143266201019e-02 -5.3435516357421875e-01 + <_> + + 0 -1 109 -7.3790093883872032e-03 + + -5.8770626783370972e-01 5.2599798887968063e-02 + <_> + + 0 -1 179 2.2994203027337790e-04 + + -2.2165967524051666e-01 1.6663813591003418e-01 + <_> + + 0 -1 366 -2.7968082576990128e-03 + + -4.5023602247238159e-01 6.7983791232109070e-02 + <_> + + 0 -1 949 -4.4262632727622986e-03 + + -5.4457426071166992e-01 5.3928002715110779e-02 + <_> + + 0 -1 431 -6.1236601322889328e-03 + + 2.9386061429977417e-01 -1.0868654400110245e-01 + <_> + + 0 -1 364 6.1672870069742203e-03 + + 6.7409984767436981e-02 -4.2896196246147156e-01 + <_> + + 0 -1 335 1.5454929322004318e-02 + + -9.3371987342834473e-02 3.2237896323204041e-01 + <_> + + 0 -1 285 -5.5358107201755047e-03 + + -6.3797932863235474e-01 4.7232467681169510e-02 + <_> + + 0 -1 210 -5.8793288189917803e-04 + + 2.6480975747108459e-01 -1.1852940917015076e-01 + <_> + + 0 -1 203 1.2575921136885881e-03 + + -1.2490244954824448e-01 2.8103300929069519e-01 + <_> + + 0 -1 41 3.3034523949027061e-03 + + 6.2105692923069000e-02 -4.5968556404113770e-01 + <_> + + 0 -1 45 -2.6582641527056694e-02 + + -5.0849837064743042e-01 5.3966015577316284e-02 + <_> + + 0 -1 49 2.7427850291132927e-02 + + 5.2529457956552505e-02 -5.3614085912704468e-01 + <_> + + 0 -1 39 -2.1938718855381012e-03 + + -5.6713318824768066e-01 4.6497207134962082e-02 + <_> + + 0 -1 926 8.5861550178378820e-04 + + -1.1162154376506805e-01 2.8105884790420532e-01 + <_> + + 0 -1 886 -8.4925384726375341e-04 + + 3.1280112266540527e-01 -1.2138028442859650e-01 + <_> + + 0 -1 956 2.9905270785093307e-03 + + 6.1607286334037781e-02 -5.1581907272338867e-01 + <_> + + 0 -1 968 5.8231391012668610e-03 + + 4.7376025468111038e-02 -5.1492005586624146e-01 + <_> + + 0 -1 480 4.2811138555407524e-03 + + 3.2761037349700928e-02 -6.7820072174072266e-01 + <_> + + 0 -1 915 9.5272483304142952e-04 + + -1.5452747046947479e-01 1.7837351560592651e-01 + <_> + + 0 -1 270 -2.7698231860995293e-04 + + 1.8924367427825928e-01 -1.3868112862110138e-01 + <_> + + 0 -1 370 3.0586202628910542e-03 + + 5.3298473358154297e-02 -4.7908756136894226e-01 + <_> + + 0 -1 639 2.0293965935707092e-03 + + 3.1667634844779968e-02 -6.7199909687042236e-01 + <_> + + 0 -1 639 -1.8073513638228178e-03 + + -6.4894622564315796e-01 3.3469315618276596e-02 + <_> + + 0 -1 320 -1.1197938583791256e-03 + + 2.2734998166561127e-01 -1.1382233351469040e-01 + <_> + + 0 -1 828 1.2703117681667209e-03 + + -9.7680233418941498e-02 2.9997348785400391e-01 + <_> + + 0 -1 835 -1.8036495894193649e-03 + + 2.3566392064094543e-01 -1.1566326767206192e-01 + <_> + + 0 -1 222 2.3318463936448097e-03 + + 5.5787801742553711e-02 -4.4648987054824829e-01 + <_> + + 0 -1 111 1.8485619220882654e-03 + + -1.0420991480350494e-01 2.4521166086196899e-01 + <_> + + 0 -1 101 8.2633290439844131e-03 + + 5.3129263222217560e-02 -4.8460647463798523e-01 + <_> + + 0 -1 760 2.7392050469643436e-05 + + -1.7487643659114838e-01 1.3620604574680328e-01 + <_> + + 0 -1 352 2.6163433212786913e-03 + + -9.9586494266986847e-02 2.4075058102607727e-01 + <_> + + 0 -1 94 3.6149267107248306e-03 + + 4.2312353849411011e-02 -5.5195075273513794e-01 + <_> + + 0 -1 403 1.4812931418418884e-02 + + -6.7619144916534424e-02 3.7573158740997314e-01 + <_> + + 0 -1 814 -2.8877586591988802e-03 + + -5.3493702411651611e-01 5.1065266132354736e-02 + <_> + + 0 -1 930 3.5591312916949391e-04 + + -1.2231220304965973e-01 1.9974029064178467e-01 + <_> + + 0 -1 36 -1.0347569361329079e-02 + + -6.3408315181732178e-01 4.0167611092329025e-02 + <_> + + 0 -1 34 -4.4028884731233120e-03 + + -5.1359844207763672e-01 4.3052427470684052e-02 + <_> + + 0 -1 856 -1.6173283802345395e-03 + + 1.4859439432621002e-01 -1.4985026419162750e-01 + <_> + + 0 -1 996 -3.1839800067245960e-03 + + -4.1493499279022217e-01 6.0393124818801880e-02 + <_> + + 0 -1 960 -7.9784039407968521e-03 + + 2.8296649456024170e-01 -8.6312569677829742e-02 + <_> + + 0 -1 797 2.8750954661518335e-03 + + -6.7822508513927460e-02 3.2967612147331238e-01 + <_> + + 0 -1 992 -1.1433581821620464e-03 + + -3.4375748038291931e-01 6.8774074316024780e-02 + <_> + + 0 -1 668 1.7783213406801224e-03 + + -8.8273152709007263e-02 2.6904863119125366e-01 + <_> + + 0 -1 670 -6.3564153388142586e-03 + + 3.4165042638778687e-01 -7.6342806220054626e-02 + <_> + + 0 -1 712 5.8753319084644318e-02 + + 3.6884155124425888e-02 -7.0002478361129761e-01 + <_> + + 0 -1 345 -1.2118986342102289e-03 + + 1.8067996203899384e-01 -1.2888990342617035e-01 + <_> + + 0 -1 268 -3.4786794334650040e-02 + + 2.8380703926086426e-01 -1.0494612902402878e-01 + + <_> + 61 + -1.3526766300201416e+00 + + <_> + + 0 -1 875 9.3241240829229355e-03 + + -1.1945860832929611e-01 4.8265087604522705e-01 + <_> + + 0 -1 573 -4.0869116783142090e-03 + + 2.7903670072555542e-01 -2.3448269069194794e-01 + <_> + + 0 -1 676 8.3140000700950623e-02 + + -8.5437655448913574e-02 5.4905670881271362e-01 + <_> + + 0 -1 802 2.6708254590630531e-03 + + -1.6097296774387360e-01 3.5868695378303528e-01 + <_> + + 0 -1 75 2.2817514836788177e-03 + + -1.6324259340763092e-01 2.3956388235092163e-01 + <_> + + 0 -1 745 6.7889376077800989e-04 + + -2.5205141305923462e-01 1.6190616786479950e-01 + <_> + + 0 -1 811 3.1512721907347441e-03 + + -1.3325424492359161e-01 2.7017220854759216e-01 + <_> + + 0 -1 53 5.7821646332740784e-02 + + -6.7158013582229614e-02 4.1875806450843811e-01 + <_> + + 0 -1 442 2.8442896902561188e-02 + + 5.5711831897497177e-02 -5.8136337995529175e-01 + <_> + + 0 -1 644 -1.7370734130963683e-03 + + -6.7132610082626343e-01 3.2464105635881424e-02 + <_> + + 0 -1 324 -1.9680276513099670e-02 + + 3.9044600725173950e-01 -8.8745564222335815e-02 + <_> + + 0 -1 224 1.0001409798860550e-02 + + -1.5947268903255463e-01 2.7087828516960144e-01 + <_> + + 0 -1 644 1.2495646951720119e-03 + + 8.3702936768531799e-02 -4.6324184536933899e-01 + <_> + + 0 -1 144 3.0510198324918747e-02 + + -1.0709584504365921e-01 3.2648065686225891e-01 + <_> + + 0 -1 995 -3.7916197907179594e-03 + + -6.1073684692382812e-01 4.7788143157958984e-02 + <_> + + 0 -1 880 8.5655774455517530e-04 + + -2.0807541906833649e-01 1.5517778694629669e-01 + <_> + + 0 -1 986 -3.2812850549817085e-03 + + -5.8795136213302612e-01 4.5926980674266815e-02 + <_> + + 0 -1 499 3.6125673796050251e-04 + + -1.6806155443191528e-01 1.7441834509372711e-01 + <_> + + 0 -1 591 -1.2282358948141336e-03 + + -4.7641313076019287e-01 5.6790668517351151e-02 + <_> + + 0 -1 411 9.3263220041990280e-03 + + -7.4045926332473755e-02 3.7817317247390747e-01 + <_> + + 0 -1 591 7.4745330493897200e-04 + + 8.0762349069118500e-02 -3.5692575573921204e-01 + <_> + + 0 -1 900 7.4315653182566166e-03 + + -8.5764542222023010e-02 3.2155406475067139e-01 + <_> + + 0 -1 776 2.7057509869337082e-02 + + 6.9296583533287048e-02 -4.2836430668830872e-01 + <_> + + 0 -1 504 3.9283365011215210e-02 + + -1.0806435346603394e-01 2.9007008671760559e-01 + <_> + + 0 -1 23 -3.4139624238014221e-01 + + 5.0227731466293335e-01 -6.3795588910579681e-02 + <_> + + 0 -1 502 -1.8172953277826309e-02 + + 2.7207729220390320e-01 -1.0322675853967667e-01 + <_> + + 0 -1 509 1.5265008434653282e-02 + + -1.0788526386022568e-01 2.4405729770660400e-01 + <_> + + 0 -1 465 -1.4973650686442852e-03 + + 2.8644701838493347e-01 -1.0436929017305374e-01 + <_> + + 0 -1 674 2.1207414101809263e-03 + + 4.5713264495134354e-02 -6.6571021080017090e-01 + <_> + + 0 -1 254 1.3393461704254150e-02 + + -8.4284797310829163e-02 3.6480179429054260e-01 + <_> + + 0 -1 560 9.7873376216739416e-04 + + -1.2960052490234375e-01 2.2095513343811035e-01 + <_> + + 0 -1 747 -4.9731796607375145e-03 + + 2.7467787265777588e-01 -1.0236363112926483e-01 + <_> + + 0 -1 294 -7.9883169382810593e-03 + + -5.3638678789138794e-01 5.3369920700788498e-02 + <_> + + 0 -1 413 2.3855306208133698e-03 + + 5.4967612028121948e-02 -4.2117682099342346e-01 + <_> + + 0 -1 899 -3.0849636532366276e-03 + + 2.6192533969879150e-01 -9.4207443296909332e-02 + <_> + + 0 -1 653 4.3416069820523262e-03 + + -1.5543100237846375e-01 1.6663897037506104e-01 + <_> + + 0 -1 451 3.8728015497326851e-03 + + 4.9280565232038498e-02 -4.9337747693061829e-01 + <_> + + 0 -1 563 1.8099667504429817e-03 + + 4.2697191238403320e-02 -5.2748012542724609e-01 + <_> + + 0 -1 157 -3.3727339468896389e-03 + + 2.0491680502891541e-01 -1.2846539914608002e-01 + <_> + + 0 -1 344 3.1393815297633410e-03 + + -7.3090612888336182e-02 3.4941059350967407e-01 + <_> + + 0 -1 851 3.2568261958658695e-03 + + 4.5729346573352814e-02 -5.7302659749984741e-01 + <_> + + 0 -1 853 -2.0513155031949282e-03 + + -5.4655516147613525e-01 3.8907390087842941e-02 + <_> + + 0 -1 656 -2.7090720832347870e-03 + + -5.2781039476394653e-01 3.8093525916337967e-02 + <_> + + 0 -1 738 -3.6282267421483994e-02 + + -5.8760797977447510e-01 3.4759882837533951e-02 + <_> + + 0 -1 558 3.7925848737359047e-03 + + -8.5966393351554871e-02 2.6226586103439331e-01 + <_> + + 0 -1 991 -3.7565450184047222e-03 + + -5.7828390598297119e-01 3.9440535008907318e-02 + <_> + + 0 -1 906 -7.8137982636690140e-03 + + 3.5042202472686768e-01 -6.6597603261470795e-02 + <_> + + 0 -1 904 -3.1100357882678509e-03 + + 1.8389418721199036e-01 -1.4107073843479156e-01 + <_> + + 0 -1 449 9.1797057539224625e-03 + + -6.2711343169212341e-02 3.4819519519805908e-01 + <_> + + 0 -1 255 -2.9698751866817474e-02 + + 2.8956320881843567e-01 -8.5679493844509125e-02 + <_> + + 0 -1 720 7.9502481967210770e-03 + + 3.9165180176496506e-02 -6.0753583908081055e-01 + <_> + + 0 -1 621 2.2064188960939646e-03 + + 3.5431943833827972e-02 -5.5480444431304932e-01 + <_> + + 0 -1 175 -3.1044434756040573e-02 + + -6.2628567218780518e-01 3.1049268320202827e-02 + <_> + + 0 -1 0 -1.3199620880186558e-03 + + 1.5564316511154175e-01 -1.3879336416721344e-01 + <_> + + 0 -1 397 -9.6068280981853604e-04 + + 1.9332279264926910e-01 -1.1179215461015701e-01 + <_> + + 0 -1 43 7.4608568102121353e-03 + + 5.7219974696636200e-02 -4.2135125398635864e-01 + <_> + + 0 -1 293 -4.3320422992110252e-03 + + -6.8079024553298950e-01 2.9504306614398956e-02 + <_> + + 0 -1 274 -6.5548438578844070e-03 + + 2.9043409228324890e-01 -8.7089523673057556e-02 + <_> + + 0 -1 204 4.2611984536051750e-03 + + -8.5929870605468750e-02 3.1930494308471680e-01 + <_> + + 0 -1 635 -7.2978977113962173e-03 + + 1.4620631933212280e-01 -1.7617914080619812e-01 + <_> + + 0 -1 225 -2.2543172817677259e-03 + + -5.9305733442306519e-01 3.9764832705259323e-02 + + <_> + 70 + -1.3067549467086792e+00 + + <_> + + 0 -1 742 -5.6160744279623032e-03 + + 4.7913768887519836e-01 -9.8717339336872101e-02 + <_> + + 0 -1 536 -5.6263338774442673e-03 + + 2.8639736771583557e-01 -1.7997759580612183e-01 + <_> + + 0 -1 795 -1.6268140170723200e-03 + + 3.0874463915824890e-01 -1.3907180726528168e-01 + <_> + + 0 -1 802 -1.3920383062213659e-03 + + 3.2034638524055481e-01 -1.3876211643218994e-01 + <_> + + 0 -1 826 3.4234612248837948e-03 + + -1.0860712081193924e-01 3.2174232602119446e-01 + <_> + + 0 -1 525 4.3767906725406647e-02 + + -1.3255064189434052e-01 3.7021124362945557e-01 + <_> + + 0 -1 401 -4.4696494005620480e-03 + + -4.5687621831893921e-01 8.2243621349334717e-02 + <_> + + 0 -1 332 -7.1945399977266788e-03 + + -6.4334297180175781e-01 4.5623987913131714e-02 + <_> + + 0 -1 273 6.5287351608276367e-03 + + -8.9336074888706207e-02 3.3727860450744629e-01 + <_> + + 0 -1 771 2.8297028038650751e-03 + + -1.0177894681692123e-01 3.5831856727600098e-01 + <_> + + 0 -1 925 1.1526069603860378e-02 + + 7.5238041579723358e-02 -4.8319393396377563e-01 + <_> + + 0 -1 207 4.7937319613993168e-03 + + 5.7682428508996964e-02 -4.7086900472640991e-01 + <_> + + 0 -1 395 -3.6777029745280743e-03 + + -4.2743790149688721e-01 7.4363298714160919e-02 + <_> + + 0 -1 839 -8.0760312266647816e-04 + + 1.4320656657218933e-01 -1.9929704070091248e-01 + <_> + + 0 -1 233 3.7253312766551971e-03 + + 5.2736207842826843e-02 -5.2105212211608887e-01 + <_> + + 0 -1 416 -2.3560712113976479e-02 + + 4.0658730268478394e-01 -7.3024936020374298e-02 + <_> + + 0 -1 311 -4.5593185350298882e-03 + + -6.3590377569198608e-01 3.5127460956573486e-02 + <_> + + 0 -1 551 -2.4863984435796738e-03 + + -4.5599257946014404e-01 5.3035512566566467e-02 + <_> + + 0 -1 424 -2.6802124921232462e-03 + + 1.9116453826427460e-01 -1.3404799997806549e-01 + <_> + + 0 -1 11 -7.7647715806961060e-02 + + 4.1297465562820435e-01 -6.3970938324928284e-02 + <_> + + 0 -1 566 2.3329094983637333e-03 + + -1.2160944193601608e-01 2.3117628693580627e-01 + <_> + + 0 -1 5 -6.6609308123588562e-03 + + 2.2600707411766052e-01 -1.2069495767354965e-01 + <_> + + 0 -1 133 -5.0821684300899506e-02 + + 3.2217630743980408e-01 -7.6335281133651733e-02 + <_> + + 0 -1 537 -7.0379404351115227e-03 + + 1.8399104475975037e-01 -1.4812190830707550e-01 + <_> + + 0 -1 134 -3.3276520669460297e-02 + + -6.0358065366744995e-01 3.5330448299646378e-02 + <_> + + 0 -1 392 7.5909225270152092e-03 + + 3.1779482960700989e-02 -6.4767998456954956e-01 + <_> + + 0 -1 613 -5.6639023125171661e-02 + + -4.6455994248390198e-01 4.6072337776422501e-02 + <_> + + 0 -1 124 3.7777128163725138e-03 + + 5.7451672852039337e-02 -3.7793967127799988e-01 + <_> + + 0 -1 271 8.9145395904779434e-03 + + -7.5942978262901306e-02 3.1487807631492615e-01 + <_> + + 0 -1 841 -1.4818884432315826e-02 + + 2.7122247219085693e-01 -9.8314434289932251e-02 + <_> + + 0 -1 381 -5.5922558531165123e-03 + + -6.4762401580810547e-01 4.1314963251352310e-02 + <_> + + 0 -1 595 3.1491921981796622e-04 + + -1.4864055812358856e-01 1.4411780238151550e-01 + <_> + + 0 -1 136 -5.7063563726842403e-03 + + -4.6024248003959656e-01 4.7999884933233261e-02 + <_> + + 0 -1 210 -1.2257394846528769e-03 + + 3.2288366556167603e-01 -7.0425607264041901e-02 + <_> + + 0 -1 775 -1.6291948035359383e-02 + + 2.7573275566101074e-01 -8.3055868744850159e-02 + <_> + + 0 -1 156 -8.1639690324664116e-04 + + 1.7044979333877563e-01 -1.4129574596881866e-01 + <_> + + 0 -1 975 5.1114819943904877e-03 + + 3.3882420510053635e-02 -6.9941717386245728e-01 + <_> + + 0 -1 977 -2.8371806256473064e-03 + + -3.7707236409187317e-01 5.7759616523981094e-02 + <_> + + 0 -1 772 5.3479857742786407e-03 + + 4.1541736572980881e-02 -4.8687714338302612e-01 + <_> + + 0 -1 735 1.1360908392816782e-03 + + -7.8717894852161407e-02 2.9692038893699646e-01 + <_> + + 0 -1 947 1.4100213302299380e-03 + + 4.3843001127243042e-02 -5.1339787244796753e-01 + <_> + + 0 -1 387 8.7079760851338506e-04 + + -9.8695866763591766e-02 2.2730629146099091e-01 + <_> + + 0 -1 211 -5.4065873846411705e-03 + + -6.3011974096298218e-01 3.7802927196025848e-02 + <_> + + 0 -1 816 -1.6894804313778877e-02 + + -5.0091201066970825e-01 3.5215172916650772e-02 + <_> + + 0 -1 766 1.4164673630148172e-03 + + -8.8441111147403717e-02 2.4102251231670380e-01 + <_> + + 0 -1 704 -1.1464871931821108e-03 + + 1.9273723661899567e-01 -1.1090471595525742e-01 + <_> + + 0 -1 861 -3.2706123311072588e-03 + + -4.5202803611755371e-01 4.7059688717126846e-02 + <_> + + 0 -1 70 1.1416582390666008e-02 + + 2.6714416220784187e-02 -6.9660711288452148e-01 + <_> + + 0 -1 310 2.7643535286188126e-03 + + 4.7252438962459564e-02 -3.9458727836608887e-01 + <_> + + 0 -1 435 2.4567130021750927e-03 + + -7.5188823044300079e-02 2.9944056272506714e-01 + <_> + + 0 -1 441 -7.3516201227903366e-03 + + 2.8476437926292419e-01 -9.2367134988307953e-02 + <_> + + 0 -1 662 -4.3670929968357086e-02 + + -6.8588620424270630e-01 3.3353023231029510e-02 + <_> + + 0 -1 138 -6.4992159605026245e-02 + + -7.9678738117218018e-01 2.0331909880042076e-02 + <_> + + 0 -1 286 -1.1700032278895378e-02 + + -6.1183351278305054e-01 2.7328895404934883e-02 + <_> + + 0 -1 589 3.0743866227567196e-03 + + -7.7295452356338501e-02 2.6685911417007446e-01 + <_> + + 0 -1 584 -1.5546076931059361e-02 + + -5.5246621370315552e-01 4.0912687778472900e-02 + <_> + + 0 -1 40 6.5568592399358749e-03 + + -1.0432150214910507e-01 1.9379787147045135e-01 + <_> + + 0 -1 29 -8.0047458410263062e-02 + + 3.9228948950767517e-01 -5.2565738558769226e-02 + <_> + + 0 -1 227 1.5684183686971664e-02 + + -1.1151826381683350e-01 1.8633136153221130e-01 + <_> + + 0 -1 546 2.3603178560733795e-03 + + -1.0219112038612366e-01 2.0333246886730194e-01 + <_> + + 0 -1 585 -3.5169085022062063e-03 + + 2.7427124977111816e-01 -8.6362943053245544e-02 + <_> + + 0 -1 476 9.4871241599321365e-03 + + 3.5626750439405441e-02 -6.2631088495254517e-01 + <_> + + 0 -1 629 -9.3261618167161942e-03 + + -7.1806514263153076e-01 2.4241568520665169e-02 + <_> + + 0 -1 666 -6.3302312046289444e-03 + + 2.1094995737075806e-01 -9.2475786805152893e-02 + <_> + + 0 -1 598 -2.8244811110198498e-03 + + 2.6596403121948242e-01 -8.0099694430828094e-02 + <_> + + 0 -1 145 -1.1591307818889618e-02 + + 2.3619163036346436e-01 -8.5169024765491486e-02 + <_> + + 0 -1 117 2.1401243284344673e-03 + + -1.0995808988809586e-01 2.1230246126651764e-01 + <_> + + 0 -1 562 4.2046746239066124e-03 + + 3.6688093096017838e-02 -6.1654287576675415e-01 + <_> + + 0 -1 605 1.1085141450166702e-03 + + -8.0656312406063080e-02 2.7754181623458862e-01 + <_> + + 0 -1 829 -8.2805287092924118e-03 + + -6.5883606672286987e-01 3.6048211157321930e-02 + + <_> + 70 + -1.2368309497833252e+00 + + <_> + + 0 -1 716 -3.3105849288403988e-03 + + 5.0566112995147705e-01 -8.2956805825233459e-02 + <_> + + 0 -1 190 4.5855166390538216e-03 + + -1.3226345181465149e-01 3.9034894108772278e-01 + <_> + + 0 -1 576 -2.6665716432034969e-03 + + 2.7508354187011719e-01 -1.3807572424411774e-01 + <_> + + 0 -1 734 1.8106825649738312e-02 + + -1.2738862633705139e-01 3.5449108481407166e-01 + <_> + + 0 -1 830 -5.7813120074570179e-03 + + 2.7463605999946594e-01 -1.2951526045799255e-01 + <_> + + 0 -1 379 8.9321136474609375e-03 + + 4.8491790890693665e-02 -5.8104276657104492e-01 + <_> + + 0 -1 17 6.2806839123368263e-03 + + -1.3215491175651550e-01 2.1852293610572815e-01 + <_> + + 0 -1 9 -4.3670572340488434e-02 + + 3.8786840438842773e-01 -7.4191503226757050e-02 + <_> + + 0 -1 554 -6.2309622764587402e-02 + + 3.3408007025718689e-01 -8.7087221443653107e-02 + <_> + + 0 -1 686 -3.2859744969755411e-03 + + 3.3486780524253845e-01 -8.9008949697017670e-02 + <_> + + 0 -1 346 -3.9627305231988430e-03 + + 2.6155433058738708e-01 -9.5614455640316010e-02 + <_> + + 0 -1 434 1.0877416934818029e-03 + + -1.4199735224246979e-01 1.8414285778999329e-01 + <_> + + 0 -1 249 5.4819821380078793e-03 + + 7.4260123074054718e-02 -5.6989872455596924e-01 + <_> + + 0 -1 916 4.9011572264134884e-04 + + -1.9576059281826019e-01 1.3506270945072174e-01 + <_> + + 0 -1 911 -7.7052684500813484e-03 + + -5.0443643331527710e-01 6.1383318156003952e-02 + <_> + + 0 -1 164 4.8691947013139725e-03 + + 4.3469026684761047e-02 -5.2802342176437378e-01 + <_> + + 0 -1 344 2.4673391599208117e-03 + + -8.9178681373596191e-02 3.0606627464294434e-01 + <_> + + 0 -1 172 -3.6682826466858387e-03 + + -6.5514552593231201e-01 4.7427203506231308e-02 + <_> + + 0 -1 365 2.5194899644702673e-03 + + 4.9365170300006866e-02 -4.0812951326370239e-01 + <_> + + 0 -1 531 5.8970693498849869e-03 + + 3.5579398274421692e-02 -6.4191317558288574e-01 + <_> + + 0 -1 842 1.7767311073839664e-03 + + -8.6629316210746765e-02 2.7705979347229004e-01 + <_> + + 0 -1 885 4.0457276627421379e-03 + + 5.6002113968133926e-02 -4.7005215287208557e-01 + <_> + + 0 -1 522 3.2862280495464802e-03 + + -1.2930884957313538e-01 2.0613414049148560e-01 + <_> + + 0 -1 322 1.4660503948107362e-03 + + -9.9395424127578735e-02 3.3950179815292358e-01 + <_> + + 0 -1 266 1.9015703350305557e-02 + + 6.0197159647941589e-02 -5.1893943548202515e-01 + <_> + + 0 -1 102 -7.1178808808326721e-02 + + -4.3668299913406372e-01 4.7340013086795807e-02 + <_> + + 0 -1 795 -4.6305771684274077e-04 + + 1.4736598730087280e-01 -1.5406486392021179e-01 + <_> + + 0 -1 298 -4.7644632868468761e-03 + + -5.0336647033691406e-01 4.4053792953491211e-02 + <_> + + 0 -1 761 -8.5318256169557571e-03 + + -5.9967356920242310e-01 3.2567754387855530e-02 + <_> + + 0 -1 713 -2.7496295515447855e-03 + + 1.3502316176891327e-01 -1.6025592386722565e-01 + <_> + + 0 -1 607 4.2666587978601456e-03 + + 2.5802688673138618e-02 -7.8170543909072876e-01 + <_> + + 0 -1 216 -2.9856398701667786e-02 + + 2.4982222914695740e-01 -8.8180385529994965e-02 + <_> + + 0 -1 226 2.2136634215712547e-03 + + -1.4314906299114227e-01 1.6945528984069824e-01 + <_> + + 0 -1 640 1.6336794942617416e-02 + + 4.6008959412574768e-02 -4.9338266253471375e-01 + <_> + + 0 -1 459 7.9861842095851898e-03 + + -1.1460029333829880e-01 1.9282819330692291e-01 + <_> + + 0 -1 650 -1.7455726629123092e-03 + + 1.7520657181739807e-01 -1.2269173562526703e-01 + <_> + + 0 -1 124 -6.2451506964862347e-03 + + -4.5638361573219299e-01 4.8106320202350616e-02 + <_> + + 0 -1 406 8.5668899118900299e-03 + + -8.0403454601764679e-02 3.0411326885223389e-01 + <_> + + 0 -1 974 8.6863581091165543e-03 + + 3.4176670014858246e-02 -7.3028022050857544e-01 + <_> + + 0 -1 36 1.0814646258950233e-02 + + 2.5131458416581154e-02 -6.7325627803802490e-01 + <_> + + 0 -1 709 4.4222913682460785e-02 + + 3.9326712489128113e-02 -5.1067680120468140e-01 + <_> + + 0 -1 903 3.7128489930182695e-03 + + -1.3248492777347565e-01 1.6692358255386353e-01 + <_> + + 0 -1 129 -4.6475054696202278e-03 + + 1.7683532834053040e-01 -1.2570241093635559e-01 + <_> + + 0 -1 291 4.2433524504303932e-03 + + 3.6985948681831360e-02 -5.8369445800781250e-01 + <_> + + 0 -1 315 -5.1774000748991966e-03 + + 5.1487326622009277e-01 -4.1473735123872757e-02 + <_> + + 0 -1 855 4.2645614594221115e-03 + + 3.7253957241773605e-02 -5.7676959037780762e-01 + <_> + + 0 -1 83 4.8632645048201084e-03 + + -6.7035257816314697e-02 3.1131938099861145e-01 + <_> + + 0 -1 250 2.6089766994118690e-02 + + -8.2920446991920471e-02 3.0445784330368042e-01 + <_> + + 0 -1 625 -1.9001008477061987e-03 + + -4.3419414758682251e-01 4.6812325716018677e-02 + <_> + + 0 -1 891 -6.0952613130211830e-03 + + -5.1850622892379761e-01 3.6754775792360306e-02 + <_> + + 0 -1 564 1.2120242230594158e-02 + + -7.4773810803890228e-02 2.6738941669464111e-01 + <_> + + 0 -1 817 -1.8978580832481384e-02 + + 2.5657230615615845e-01 -8.0304212868213654e-02 + <_> + + 0 -1 338 4.3438978493213654e-02 + + -6.2818735837936401e-02 3.2261833548545837e-01 + <_> + + 0 -1 773 9.4384723342955112e-04 + + -9.8582215607166290e-02 2.2370135784149170e-01 + <_> + + 0 -1 519 -4.1803726926445961e-03 + + -4.9802374839782715e-01 4.3809909373521805e-02 + <_> + + 0 -1 195 -9.7246468067169189e-03 + + 2.2823798656463623e-01 -9.8547600209712982e-02 + <_> + + 0 -1 658 2.7193846181035042e-03 + + -9.1188244521617889e-02 2.2684387862682343e-01 + <_> + + 0 -1 174 6.2224082648754120e-03 + + 3.2258503139019012e-02 -6.0108250379562378e-01 + <_> + + 0 -1 77 -4.8602908849716187e-01 + + 6.3337916135787964e-01 -3.3006772398948669e-02 + <_> + + 0 -1 550 -5.3604291751980782e-03 + + 2.9434949159622192e-01 -6.1312302947044373e-02 + <_> + + 0 -1 541 5.5021280422806740e-03 + + 4.1839476674795151e-02 -4.5681878924369812e-01 + <_> + + 0 -1 326 -1.3823953922837973e-03 + + 1.6067574918270111e-01 -1.1796293407678604e-01 + <_> + + 0 -1 514 2.0954519510269165e-02 + + -5.7253565639257431e-02 3.3830171823501587e-01 + <_> + + 0 -1 409 7.4234008789062500e-03 + + -7.4798591434955597e-02 2.6430690288543701e-01 + <_> + + 0 -1 578 2.1767318248748779e-03 + + -8.0530151724815369e-02 2.5947657227516174e-01 + <_> + + 0 -1 623 1.8930230289697647e-03 + + -8.1788897514343262e-02 2.2988820075988770e-01 + <_> + + 0 -1 533 6.9275917485356331e-03 + + 2.6962997391819954e-02 -7.6910203695297241e-01 + <_> + + 0 -1 334 6.7140227183699608e-03 + + 2.3244854062795639e-02 -6.8406605720520020e-01 + <_> + + 0 -1 632 -3.4494437277317047e-02 + + -6.5257686376571655e-01 2.4584138765931129e-02 + <_> + + 0 -1 787 1.9636256620287895e-03 + + -9.1118760406970978e-02 2.0629465579986572e-01 + + <_> + 80 + -1.3304495811462402e+00 + + <_> + + 0 -1 572 -9.1053368523716927e-03 + + 4.8031216859817505e-01 -9.3147851526737213e-02 + <_> + + 0 -1 715 -2.1384856663644314e-03 + + 3.4027156233787537e-01 -1.4834050834178925e-01 + <_> + + 0 -1 953 1.2453617528080940e-02 + + -8.0359503626823425e-02 4.7585478425025940e-01 + <_> + + 0 -1 198 5.0965799018740654e-03 + + -1.6364066302776337e-01 2.9590085148811340e-01 + <_> + + 0 -1 477 -3.1894792336970568e-03 + + 1.7039565742015839e-01 -2.1295401453971863e-01 + <_> + + 0 -1 314 -1.4799979981034994e-03 + + -4.1050529479980469e-01 5.3783610463142395e-02 + <_> + + 0 -1 66 6.0710287652909756e-03 + + -1.5162153542041779e-01 1.8406888842582703e-01 + <_> + + 0 -1 401 4.3081510812044144e-03 + + 5.0293717533349991e-02 -4.6324169635772705e-01 + <_> + + 0 -1 970 1.8933035898953676e-03 + + 6.5655551850795746e-02 -3.9198148250579834e-01 + <_> + + 0 -1 782 -1.6021143645048141e-02 + + 2.2748421132564545e-01 -1.0609938949346542e-01 + <_> + + 0 -1 928 -8.9298677630722523e-04 + + 3.1164079904556274e-01 -1.1380065232515335e-01 + <_> + + 0 -1 888 -1.4284942299127579e-03 + + 2.7966943383216858e-01 -9.6580952405929565e-02 + <_> + + 0 -1 822 2.5015190243721008e-02 + + 4.2534209787845612e-02 -6.2623745203018188e-01 + <_> + + 0 -1 583 -2.8645459096878767e-03 + + -4.1426309943199158e-01 5.1780503243207932e-02 + <_> + + 0 -1 902 3.2044243998825550e-03 + + -1.1883606761693954e-01 1.9546063244342804e-01 + <_> + + 0 -1 319 -1.0433372110128403e-02 + + 2.6159819960594177e-01 -9.3164652585983276e-02 + <_> + + 0 -1 287 -9.7299478948116302e-03 + + -4.9464005231857300e-01 5.0998747348785400e-02 + <_> + + 0 -1 206 -2.1688457578420639e-02 + + 5.6923902034759521e-01 -4.9958106130361557e-02 + <_> + + 0 -1 38 -2.9492072761058807e-02 + + -6.1336356401443481e-01 4.7003138810396194e-02 + <_> + + 0 -1 35 -2.4866596795618534e-03 + + -3.9986124634742737e-01 5.7781789451837540e-02 + <_> + + 0 -1 965 4.0488247759640217e-03 + + 4.6429801732301712e-02 -4.4500553607940674e-01 + <_> + + 0 -1 735 -9.3909690622240305e-04 + + 2.4617424607276917e-01 -9.0848781168460846e-02 + <_> + + 0 -1 989 -5.2673118188977242e-03 + + -6.4129960536956787e-01 3.5207435488700867e-02 + <_> + + 0 -1 806 -6.1755320057272911e-03 + + 1.7039734125137329e-01 -1.3195209205150604e-01 + <_> + + 0 -1 201 1.5832348726689816e-03 + + -9.2635877430438995e-02 2.5755262374877930e-01 + <_> + + 0 -1 914 2.8633023612201214e-03 + + 5.0923369824886322e-02 -4.6171438694000244e-01 + <_> + + 0 -1 12 -2.3722708225250244e-02 + + -4.5609694719314575e-01 4.3677136301994324e-02 + <_> + + 0 -1 419 5.8846692554652691e-03 + + 5.1512561738491058e-02 -4.4899132847785950e-01 + <_> + + 0 -1 201 -8.2513026427477598e-04 + + 2.4914309382438660e-01 -8.9795768260955811e-02 + <_> + + 0 -1 690 -2.9888928402215242e-03 + + -4.0133482217788696e-01 5.5449619889259338e-02 + <_> + + 0 -1 237 1.8384978175163269e-02 + + 4.9513496458530426e-02 -4.2024865746498108e-01 + <_> + + 0 -1 947 -2.4238843470811844e-03 + + -6.7325645685195923e-01 2.8972415253520012e-02 + <_> + + 0 -1 724 8.1563717685639858e-04 + + -1.4400914311408997e-01 1.5184181928634644e-01 + <_> + + 0 -1 315 2.1788734011352062e-03 + + -8.2650899887084961e-02 2.5927037000656128e-01 + <_> + + 0 -1 376 3.7263201083987951e-03 + + -6.3213117420673370e-02 3.8062268495559692e-01 + <_> + + 0 -1 631 3.0819473322480917e-03 + + 3.9066124707460403e-02 -6.2055569887161255e-01 + <_> + + 0 -1 691 2.7417289093136787e-03 + + 3.2166294753551483e-02 -5.6402361392974854e-01 + <_> + + 0 -1 581 -3.8205389864742756e-03 + + 2.5668358802795410e-01 -7.9121366143226624e-02 + <_> + + 0 -1 61 -1.2516178190708160e-02 + + -7.0402121543884277e-01 3.2493114471435547e-02 + <_> + + 0 -1 60 4.6941628679633141e-03 + + 4.7352086752653122e-02 -4.0129581093788147e-01 + <_> + + 0 -1 483 5.0501096993684769e-03 + + -1.0563907027244568e-01 2.3647888004779816e-01 + <_> + + 0 -1 497 1.5111428685486317e-02 + + -6.7443214356899261e-02 2.7579694986343384e-01 + <_> + + 0 -1 423 7.4835181236267090e-02 + + -6.2918186187744141e-02 3.6493194103240967e-01 + <_> + + 0 -1 498 1.3086002320051193e-02 + + 2.9699811711907387e-02 -7.4420636892318726e-01 + <_> + + 0 -1 778 -5.4838880896568298e-03 + + 2.2497597336769104e-01 -8.8018722832202911e-02 + <_> + + 0 -1 261 3.3699360210448503e-03 + + -6.9213069975376129e-02 2.9263094067573547e-01 + <_> + + 0 -1 118 7.7881952747702599e-03 + + 5.8034870773553848e-02 -3.9803403615951538e-01 + <_> + + 0 -1 421 -1.9298251718282700e-02 + + 2.1273820102214813e-01 -9.6075013279914856e-02 + <_> + + 0 -1 440 1.3059679418802261e-02 + + 4.0989801287651062e-02 -4.9787399172782898e-01 + <_> + + 0 -1 510 -2.2303011268377304e-02 + + -6.5915608406066895e-01 2.7258813381195068e-02 + <_> + + 0 -1 260 -5.2872681990265846e-03 + + 2.9461637139320374e-01 -6.9564543664455414e-02 + <_> + + 0 -1 464 6.0780980857089162e-04 + + -9.5468334853649139e-02 2.0951601862907410e-01 + <_> + + 0 -1 444 4.8917778767645359e-03 + + 3.9317954331636429e-02 -5.3803342580795288e-01 + <_> + + 0 -1 238 -1.0402110219001770e-01 + + 5.4199391603469849e-01 -3.9763871580362320e-02 + <_> + + 0 -1 687 3.8908584974706173e-03 + + 3.8185238838195801e-02 -5.3280067443847656e-01 + <_> + + 0 -1 353 8.0125425010919571e-03 + + -7.8310973942279816e-02 2.4926608800888062e-01 + <_> + + 0 -1 954 -3.4356187097728252e-03 + + 2.3415692150592804e-01 -9.2279240489006042e-02 + <_> + + 0 -1 896 -5.2030328661203384e-03 + + -5.0255048274993896e-01 4.4738721102476120e-02 + <_> + + 0 -1 555 -5.5568795651197433e-03 + + 2.8329169750213623e-01 -7.0860259234905243e-02 + <_> + + 0 -1 627 -7.6205702498555183e-03 + + 2.5350978970527649e-01 -7.2612494230270386e-02 + <_> + + 0 -1 309 2.7379104495048523e-01 + + -5.6398060172796249e-02 3.6085364222526550e-01 + <_> + + 0 -1 622 7.3067229241132736e-03 + + -6.2759615480899811e-02 3.1996127963066101e-01 + <_> + + 0 -1 415 3.2574313227087259e-03 + + 4.1181974112987518e-02 -4.9355933070182800e-01 + <_> + + 0 -1 57 -1.2764024734497070e-01 + + 2.5147503614425659e-01 -7.5440123677253723e-02 + <_> + + 0 -1 530 -3.2227888703346252e-02 + + 3.9548832178115845e-01 -4.7284111380577087e-02 + <_> + + 0 -1 764 2.3350853472948074e-02 + + -7.2977773845195770e-02 2.5172060728073120e-01 + <_> + + 0 -1 26 2.7610745746642351e-05 + + -1.3625738024711609e-01 1.3250400125980377e-01 + <_> + + 0 -1 808 6.9611091166734695e-03 + + 2.9794082045555115e-02 -5.8855760097503662e-01 + <_> + + 0 -1 210 -9.9057564511895180e-04 + + 2.5895762443542480e-01 -7.1211874485015869e-02 + <_> + + 0 -1 218 -3.7965672090649605e-03 + + -6.4451014995574951e-01 3.5450231283903122e-02 + <_> + + 0 -1 346 3.9518065750598907e-03 + + -6.3615679740905762e-02 3.0333930253982544e-01 + <_> + + 0 -1 282 -5.4976264946162701e-03 + + -4.3285435438156128e-01 4.7526597976684570e-02 + <_> + + 0 -1 721 7.1266246959567070e-03 + + -6.6810697317123413e-02 2.8491511940956116e-01 + <_> + + 0 -1 912 -3.0366722494363785e-03 + + -4.3046197295188904e-01 4.4313102960586548e-02 + <_> + + 0 -1 714 -1.7097850795835257e-03 + + 2.5873449444770813e-01 -7.3857538402080536e-02 + <_> + + 0 -1 702 -4.4310283847153187e-03 + + 2.1451152861118317e-01 -8.7626561522483826e-02 + <_> + + 0 -1 47 -3.9760642684996128e-03 + + -4.6889033913612366e-01 3.8441929966211319e-02 + <_> + + 0 -1 683 -2.9741778969764709e-02 + + -5.5860131978988647e-01 3.0309556052088737e-02 + <_> + + 0 -1 13 1.3289751112461090e-01 + + 2.8634676709771156e-02 -5.6014162302017212e-01 + <_> + + 0 -1 386 -1.1272695846855640e-03 + + 1.7104774713516235e-01 -1.0818520933389664e-01 + + <_> + 83 + -1.2789946794509888e+00 + + <_> + + 0 -1 649 1.3820428401231766e-02 + + -1.0330537706613541e-01 4.5001628994941711e-01 + <_> + + 0 -1 834 -1.0161036625504494e-02 + + 3.2188063859939575e-01 -1.5805941820144653e-01 + <_> + + 0 -1 398 -3.8372592534869909e-03 + + 3.2943242788314819e-01 -1.1501405388116837e-01 + <_> + + 0 -1 769 3.4624878317117691e-02 + + -9.8698168992996216e-02 5.4050970077514648e-01 + <_> + + 0 -1 437 5.7967011816799641e-03 + + -1.1608023941516876e-01 2.8170758485794067e-01 + <_> + + 0 -1 754 4.7825248911976814e-03 + + -1.3033217191696167e-01 2.4669390916824341e-01 + <_> + + 0 -1 74 7.1141775697469711e-04 + + -2.0435671508312225e-01 1.1761441081762314e-01 + <_> + + 0 -1 22 -2.9168082401156425e-02 + + -6.2692928314208984e-01 5.5113222450017929e-02 + <_> + + 0 -1 796 2.1553519181907177e-03 + + 5.3858544677495956e-02 -4.2096143960952759e-01 + <_> + + 0 -1 894 -2.1254396997392178e-03 + + 4.2603659629821777e-01 -5.0405498594045639e-02 + <_> + + 0 -1 894 8.4234733367338777e-04 + + -9.3583315610885620e-02 2.6316204667091370e-01 + <_> + + 0 -1 948 -1.6576268244534731e-03 + + -3.5802370309829712e-01 6.8603202700614929e-02 + <_> + + 0 -1 554 6.5620511770248413e-02 + + -6.4758449792861938e-02 3.8339248299598694e-01 + <_> + + 0 -1 361 -1.8485928885638714e-03 + + 1.7337062954902649e-01 -1.3676019012928009e-01 + <_> + + 0 -1 305 -1.8170465528964996e-01 + + 4.0350264310836792e-01 -5.3196940571069717e-02 + <_> + + 0 -1 848 -3.4317909739911556e-03 + + -5.2157330513000488e-01 4.6489212661981583e-02 + <_> + + 0 -1 800 -2.7482535224407911e-03 + + -5.1078474521636963e-01 4.3557438999414444e-02 + <_> + + 0 -1 731 -4.7894287854433060e-03 + + 3.4981805086135864e-01 -6.5036587417125702e-02 + <_> + + 0 -1 706 -3.3211666159331799e-03 + + 2.1143883466720581e-01 -1.1754662543535233e-01 + <_> + + 0 -1 677 3.5642951726913452e-02 + + 3.7131600081920624e-02 -6.2165355682373047e-01 + <_> + + 0 -1 481 -3.1561930663883686e-03 + + -4.2197883129119873e-01 4.7645546495914459e-02 + <_> + + 0 -1 872 5.2224877290427685e-03 + + -1.0117106884717941e-01 2.1957167983055115e-01 + <_> + + 0 -1 140 2.5758458301424980e-02 + + -9.6981137990951538e-02 3.0423089861869812e-01 + <_> + + 0 -1 567 2.8883803170174360e-03 + + 4.4947806745767593e-02 -5.5540132522583008e-01 + <_> + + 0 -1 484 2.6014349423348904e-03 + + 4.5947834849357605e-02 -4.1711980104446411e-01 + <_> + + 0 -1 257 -7.8792509157210588e-04 + + 1.5732656419277191e-01 -1.2769798934459686e-01 + <_> + + 0 -1 252 4.2199464514851570e-03 + + -9.4008974730968475e-02 2.6868444681167603e-01 + <_> + + 0 -1 571 -2.4246796965599060e-03 + + -4.9610009789466858e-01 4.6141009777784348e-02 + <_> + + 0 -1 465 -1.8996626604348421e-03 + + 2.6260954141616821e-01 -8.5721127688884735e-02 + <_> + + 0 -1 945 1.8048105994239450e-03 + + 7.1231566369533539e-02 -3.2751160860061646e-01 + <_> + + 0 -1 249 -5.6593962945044041e-03 + + -5.0264769792556763e-01 4.0275387465953827e-02 + <_> + + 0 -1 940 -3.4701074473559856e-03 + + -4.9033272266387939e-01 3.6995064467191696e-02 + <_> + + 0 -1 766 1.1992279905825853e-03 + + -9.3982182443141937e-02 2.2527951002120972e-01 + <_> + + 0 -1 528 -3.3614276908338070e-03 + + 1.5591301023960114e-01 -1.3875743746757507e-01 + <_> + + 0 -1 758 9.2923380434513092e-03 + + 2.8368480503559113e-02 -6.3946157693862915e-01 + <_> + + 0 -1 98 -1.6806223988533020e-01 + + -6.3519150018692017e-01 2.4432161822915077e-02 + <_> + + 0 -1 614 -1.5483988681808114e-03 + + -4.9389392137527466e-01 3.4452050924301147e-02 + <_> + + 0 -1 961 7.9401559196412563e-04 + + -1.6395612061023712e-01 1.1427336186170578e-01 + <_> + + 0 -1 245 -5.3670424968004227e-03 + + -5.4615026712417603e-01 3.2274313271045685e-02 + <_> + + 0 -1 923 -5.1019818056374788e-04 + + 1.4040225744247437e-01 -1.2673649191856384e-01 + <_> + + 0 -1 846 -9.6546392887830734e-04 + + 2.3117446899414062e-01 -7.7826015651226044e-02 + <_> + + 0 -1 994 -9.7423873376101255e-04 + + -4.0673121809959412e-01 4.6749390661716461e-02 + <_> + + 0 -1 970 -4.7841384075582027e-03 + + -5.0288796424865723e-01 3.4186109900474548e-02 + <_> + + 0 -1 89 6.8537802435457706e-03 + + 5.0501946359872818e-02 -3.5414797067642212e-01 + <_> + + 0 -1 651 4.1695050895214081e-03 + + -6.8471699953079224e-02 2.8334242105484009e-01 + <_> + + 0 -1 391 2.6521178369875997e-05 + + -1.7646598815917969e-01 1.0057727992534637e-01 + <_> + + 0 -1 674 -1.8193974392488599e-03 + + -5.2059328556060791e-01 3.4266594797372818e-02 + <_> + + 0 -1 284 1.1680822353810072e-03 + + -7.5169444084167480e-02 2.3740953207015991e-01 + <_> + + 0 -1 284 -5.8111123507842422e-04 + + 2.4673853814601898e-01 -8.9036554098129272e-02 + <_> + + 0 -1 789 5.5753946304321289e-02 + + -4.8898559063673019e-02 3.7110447883605957e-01 + <_> + + 0 -1 388 -6.0947462916374207e-03 + + -4.8019152879714966e-01 3.6990296095609665e-02 + <_> + + 0 -1 988 3.3249799162149429e-03 + + 3.2017692923545837e-02 -4.8544195294380188e-01 + <_> + + 0 -1 586 -1.1994136497378349e-02 + + 2.7767661213874817e-01 -6.2677264213562012e-02 + <_> + + 0 -1 940 1.9462420605123043e-03 + + 5.7167824357748032e-02 -3.2460683584213257e-01 + <_> + + 0 -1 482 -3.5742400214076042e-03 + + 2.1856486797332764e-01 -7.7333562076091766e-02 + <_> + + 0 -1 543 3.4013153053820133e-03 + + -9.4114005565643311e-02 2.3269242048263550e-01 + <_> + + 0 -1 859 6.4494553953409195e-03 + + 3.4765381366014481e-02 -5.1627504825592041e-01 + <_> + + 0 -1 163 -1.2767435982823372e-02 + + 2.5566741824150085e-01 -6.7411571741104126e-02 + <_> + + 0 -1 230 2.2043818607926369e-03 + + -1.3278621435165405e-01 1.7942063510417938e-01 + <_> + + 0 -1 229 -4.0757502429187298e-03 + + -3.8042715191841125e-01 4.4863421469926834e-02 + <_> + + 0 -1 730 2.2066584788262844e-03 + + -7.0331946015357971e-02 2.5572371482849121e-01 + <_> + + 0 -1 700 2.2714279592037201e-02 + + 4.1653785854578018e-02 -4.4101753830909729e-01 + <_> + + 0 -1 749 -1.1373223736882210e-02 + + 3.2443967461585999e-01 -5.8059785515069962e-02 + <_> + + 0 -1 835 1.8165379296988249e-03 + + -7.2351627051830292e-02 2.2953742742538452e-01 + <_> + + 0 -1 235 -2.8745923191308975e-03 + + -3.9090758562088013e-01 4.6148840337991714e-02 + <_> + + 0 -1 673 -5.7676057331264019e-03 + + 2.4503223598003387e-01 -7.2128646075725555e-02 + <_> + + 0 -1 177 1.2852130457758904e-02 + + -1.1143829673528671e-01 1.6758553683757782e-01 + <_> + + 0 -1 141 -4.2651765048503876e-02 + + 2.3846423625946045e-01 -7.9255387187004089e-02 + <_> + + 0 -1 24 -6.8766735494136810e-03 + + -3.9145267009735107e-01 5.2240811288356781e-02 + <_> + + 0 -1 15 -1.5351611375808716e-01 + + -5.4598790407180786e-01 2.9950620606541634e-02 + <_> + + 0 -1 280 -1.7586871981620789e-02 + + 2.4160921573638916e-01 -7.7404774725437164e-02 + <_> + + 0 -1 557 2.8469474054872990e-03 + + -7.1562752127647400e-02 2.3895153403282166e-01 + <_> + + 0 -1 493 -2.6379337534308434e-02 + + 2.7370086312294006e-01 -6.5483018755912781e-02 + <_> + + 0 -1 759 -6.6346197854727507e-04 + + 1.7174075543880463e-01 -1.0841262340545654e-01 + <_> + + 0 -1 736 1.4637422282248735e-03 + + -1.1365657299757004e-01 1.6123561561107635e-01 + <_> + + 0 -1 569 -1.3798776781186461e-03 + + 2.3192690312862396e-01 -7.5626462697982788e-02 + <_> + + 0 -1 516 -6.8256547674536705e-03 + + 2.4984428286552429e-01 -7.2457753121852875e-02 + <_> + + 0 -1 312 -9.0181883424520493e-03 + + 2.0358866453170776e-01 -9.5499873161315918e-02 + <_> + + 0 -1 218 3.1383798923343420e-03 + + 4.0804021060466766e-02 -4.9618390202522278e-01 + <_> + + 0 -1 171 -1.8526764586567879e-02 + + 2.2743205726146698e-01 -8.6628310382366180e-02 + <_> + + 0 -1 594 -2.2562327794730663e-03 + + -3.2850387692451477e-01 5.9250634163618088e-02 + <_> + + 0 -1 432 -4.1183121502399445e-03 + + -5.0281947851181030e-01 3.2455049455165863e-02 + <_> + + 0 -1 96 4.8136096447706223e-03 + + 3.1708184629678726e-02 -4.9248033761978149e-01 + + <_> + 90 + -1.2794928550720215e+00 + + <_> + + 0 -1 568 -4.7569684684276581e-03 + + 4.4339472055435181e-01 -1.0486443340778351e-01 + <_> + + 0 -1 795 -2.5423073675483465e-03 + + 3.9922216534614563e-01 -1.0431514680385590e-01 + <_> + + 0 -1 649 1.1162508279085159e-02 + + -1.5686489641666412e-01 2.3129878938198090e-01 + <_> + + 0 -1 847 1.7287035007029772e-03 + + -1.5123696625232697e-01 2.9676723480224609e-01 + <_> + + 0 -1 265 2.5025676935911179e-02 + + -5.1661748439073563e-02 4.8509848117828369e-01 + <_> + + 0 -1 78 1.2561861425638199e-02 + + -1.1817755550146103e-01 2.6937758922576904e-01 + <_> + + 0 -1 812 4.6598571352660656e-03 + + -1.3565555214881897e-01 2.1206009387969971e-01 + <_> + + 0 -1 434 7.4310216587036848e-04 + + -1.7020516097545624e-01 1.5990819036960602e-01 + <_> + + 0 -1 231 1.0259399190545082e-02 + + -1.4796857535839081e-01 1.8798792362213135e-01 + <_> + + 0 -1 278 -1.2777388095855713e-02 + + -5.4041445255279541e-01 4.8501875251531601e-02 + <_> + + 0 -1 489 -1.1427352204918861e-02 + + -5.1071381568908691e-01 4.8088576644659042e-02 + <_> + + 0 -1 819 2.8340169592411257e-05 + + -2.0961570739746094e-01 1.0582420229911804e-01 + <_> + + 0 -1 325 -6.4714960753917694e-03 + + -5.0862830877304077e-01 4.8812258988618851e-02 + <_> + + 0 -1 367 1.3540303334593773e-02 + + 2.7134107425808907e-02 -7.1317195892333984e-01 + <_> + + 0 -1 210 1.8916794797405601e-03 + + -6.2187314033508301e-02 3.6233416199684143e-01 + <_> + + 0 -1 51 1.0457850992679596e-02 + + 4.0487006306648254e-02 -5.3173840045928955e-01 + <_> + + 0 -1 893 -9.0822251513600349e-04 + + 2.0090451836585999e-01 -1.0807146877050400e-01 + <_> + + 0 -1 535 -1.9299473613500595e-02 + + -6.4914399385452271e-01 4.0790289640426636e-02 + <_> + + 0 -1 663 -8.2283990923315287e-04 + + 1.5708251297473907e-01 -1.3143004477024078e-01 + <_> + + 0 -1 523 3.7520762998610735e-03 + + 3.8761712610721588e-02 -4.9775493144989014e-01 + <_> + + 0 -1 762 8.2424264401197433e-03 + + 3.6369498819112778e-02 -5.1153117418289185e-01 + <_> + + 0 -1 805 -1.1945937294512987e-03 + + 1.3862735033035278e-01 -1.3917639851570129e-01 + <_> + + 0 -1 985 -1.0589268989861012e-02 + + 3.2981950044631958e-01 -7.6042778789997101e-02 + <_> + + 0 -1 128 2.6780981570482254e-02 + + 4.6954374760389328e-02 -4.5390221476554871e-01 + <_> + + 0 -1 705 5.2458671852946281e-03 + + -4.7804936766624451e-02 4.0361502766609192e-01 + <_> + + 0 -1 729 1.0518019553273916e-03 + + -1.0052871704101562e-01 1.9928459823131561e-01 + <_> + + 0 -1 407 3.9210864342749119e-03 + + 3.6381114274263382e-02 -5.4954099655151367e-01 + <_> + + 0 -1 873 -1.5182888135313988e-02 + + 2.8286656737327576e-01 -7.6106920838356018e-02 + <_> + + 0 -1 279 2.7552489191293716e-03 + + -1.2027227133512497e-01 2.0814672112464905e-01 + <_> + + 0 -1 869 1.3051946647465229e-02 + + 3.6561664193868637e-02 -6.8296074867248535e-01 + <_> + + 0 -1 849 4.4104140251874924e-03 + + 2.9448021203279495e-02 -5.9994471073150635e-01 + <_> + + 0 -1 799 2.3885946720838547e-03 + + 3.9816807955503464e-02 -4.6116915345191956e-01 + <_> + + 0 -1 551 2.3683100007474422e-03 + + 4.9801617860794067e-02 -3.9546611905097961e-01 + <_> + + 0 -1 707 -4.1178334504365921e-03 + + 1.6903834044933319e-01 -1.1102814227342606e-01 + <_> + + 0 -1 466 -2.7111368253827095e-03 + + 2.0166625082492828e-01 -9.3054622411727905e-02 + <_> + + 0 -1 360 -2.4442467838525772e-03 + + 1.3419428467750549e-01 -1.4021472632884979e-01 + <_> + + 0 -1 104 -6.9398069754242897e-03 + + -4.7041961550712585e-01 3.8327444344758987e-02 + <_> + + 0 -1 14 -7.5376339256763458e-02 + + 3.5196593403816223e-01 -5.8293107897043228e-02 + <_> + + 0 -1 270 -7.3061959119513631e-04 + + 2.0563322305679321e-01 -9.7862586379051208e-02 + <_> + + 0 -1 339 -4.4864090159535408e-03 + + -4.3219071626663208e-01 4.6815373003482819e-02 + <_> + + 0 -1 679 -3.3369990997016430e-03 + + -5.7968968152999878e-01 3.2250367105007172e-02 + <_> + + 0 -1 636 -5.7756435126066208e-03 + + -6.3823670148849487e-01 2.6716385036706924e-02 + <_> + + 0 -1 352 3.8174313958734274e-03 + + -7.8204549849033356e-02 2.4104152619838715e-01 + <_> + + 0 -1 414 3.9163082838058472e-03 + + 4.0961768478155136e-02 -4.2656800150871277e-01 + <_> + + 0 -1 670 -3.7615487817674875e-03 + + 2.0846015214920044e-01 -8.6097449064254761e-02 + <_> + + 0 -1 371 -9.5803234726190567e-03 + + -7.0837384462356567e-01 2.8397833928465843e-02 + <_> + + 0 -1 93 1.4632595703005791e-02 + + 1.8669826909899712e-02 -7.4236363172531128e-01 + <_> + + 0 -1 234 5.3799869492650032e-03 + + 3.0915707349777222e-02 -4.7074958682060242e-01 + <_> + + 0 -1 701 -2.4318110663443804e-03 + + 3.0304560065269470e-01 -5.6169599294662476e-02 + <_> + + 0 -1 641 3.8594864308834076e-02 + + 2.5472542271018028e-02 -6.8472218513488770e-01 + <_> + + 0 -1 125 1.6673290729522705e-01 + + -5.9959251433610916e-02 2.9591250419616699e-01 + <_> + + 0 -1 854 -5.0129964947700500e-03 + + 1.9718486070632935e-01 -9.4902090728282928e-02 + <_> + + 0 -1 960 -9.3115903437137604e-03 + + 2.8306549787521362e-01 -6.8168632686138153e-02 + <_> + + 0 -1 804 -2.7176579460501671e-03 + + 2.4883794784545898e-01 -7.3830418288707733e-02 + <_> + + 0 -1 787 6.9358374457806349e-04 + + -1.2474948167800903e-01 1.6316886246204376e-01 + <_> + + 0 -1 783 1.3523821253329515e-03 + + -7.3475763201713562e-02 3.0120497941970825e-01 + <_> + + 0 -1 532 -2.6339504867792130e-02 + + 4.7823980450630188e-01 -3.9222836494445801e-02 + <_> + + 0 -1 866 3.3510509878396988e-02 + + -3.8013227283954620e-02 4.1955846548080444e-01 + <_> + + 0 -1 694 -2.8097369067836553e-05 + + 1.2249568104743958e-01 -1.4184975624084473e-01 + <_> + + 0 -1 988 -4.0141213685274124e-03 + + -4.5551317930221558e-01 3.6903131753206253e-02 + <_> + + 0 -1 934 5.7984986342489719e-03 + + 3.9383981376886368e-02 -4.0305584669113159e-01 + <_> + + 0 -1 753 7.5392555445432663e-03 + + -9.3996182084083557e-02 1.8520636856555939e-01 + <_> + + 0 -1 943 4.5007485896348953e-03 + + 4.2565450072288513e-02 -4.0628531575202942e-01 + <_> + + 0 -1 500 5.0333794206380844e-03 + + -6.7051678895950317e-02 2.5224363803863525e-01 + <_> + + 0 -1 511 8.7359821191057563e-04 + + -9.5469102263450623e-02 1.7292767763137817e-01 + <_> + + 0 -1 771 3.0778967775404453e-03 + + -6.1908006668090820e-02 2.5266119837760925e-01 + <_> + + 0 -1 835 -2.2874618880450726e-03 + + 1.9187310338020325e-01 -8.5145145654678345e-02 + <_> + + 0 -1 634 4.0947222150862217e-03 + + 3.0908439308404922e-02 -5.5290663242340088e-01 + <_> + + 0 -1 488 2.1358881145715714e-02 + + 4.0033571422100067e-02 -3.8174301385879517e-01 + <_> + + 0 -1 159 -4.5840246602892876e-03 + + -5.2027910947799683e-01 3.0034648254513741e-02 + <_> + + 0 -1 232 9.8655056208372116e-03 + + 2.1588459610939026e-02 -6.3089925050735474e-01 + <_> + + 0 -1 223 2.5678081437945366e-03 + + -1.1046713590621948e-01 1.4713281393051147e-01 + <_> + + 0 -1 688 -2.6078277733176947e-03 + + 2.7103677392005920e-01 -5.9257075190544128e-02 + <_> + + 0 -1 355 2.6908484287559986e-03 + + 2.7514556422829628e-02 -6.3733005523681641e-01 + <_> + + 0 -1 715 -1.3983637327328324e-03 + + 1.5699537098407745e-01 -1.0462216287851334e-01 + <_> + + 0 -1 433 1.0498151183128357e-01 + + 3.0471364036202431e-02 -4.9990084767341614e-01 + <_> + + 0 -1 491 -1.4592260122299194e-01 + + 3.2007977366447449e-01 -5.2097231149673462e-02 + <_> + + 0 -1 825 7.8754723072052002e-03 + + -6.7778728902339935e-02 2.8044930100440979e-01 + <_> + + 0 -1 262 -5.3792521357536316e-03 + + 2.1354769170284271e-01 -8.2902953028678894e-02 + <_> + + 0 -1 420 -1.0021779686212540e-02 + + 2.5685080885887146e-01 -7.3165819048881531e-02 + <_> + + 0 -1 1 -4.2762188240885735e-03 + + 1.7162682116031647e-01 -9.7696490585803986e-02 + <_> + + 0 -1 67 1.0965526103973389e-02 + + -7.5053967535495758e-02 2.3615135252475739e-01 + <_> + + 0 -1 328 -4.4276113621890545e-03 + + 2.5747051835060120e-01 -6.3898853957653046e-02 + <_> + + 0 -1 276 -8.6840223520994186e-03 + + -4.7478455305099487e-01 3.6790292710065842e-02 + <_> + + 0 -1 938 2.8339526616036892e-03 + + 4.0944386273622513e-02 -3.6514538526535034e-01 + <_> + + 0 -1 790 7.6391562819480896e-02 + + -4.9489263445138931e-02 3.4142583608627319e-01 + <_> + + 0 -1 148 1.9103729864582419e-03 + + -5.6329321116209030e-02 2.9177185893058777e-01 + <_> + + 0 -1 304 5.2499733865261078e-02 + + 2.8848636895418167e-02 -5.9306102991104126e-01 + <_> + + 0 -1 956 -5.0793914124369621e-03 + + -5.0588577985763550e-01 2.8303196653723717e-02 + <_> + + 0 -1 967 -7.1491668932139874e-03 + + -6.2660187482833862e-01 2.3113224655389786e-02 + + <_> + 88 + -1.2153301239013672e+00 + + <_> + + 0 -1 803 3.5730558447539806e-03 + + -4.2218949645757675e-02 5.5067819356918335e-01 + <_> + + 0 -1 520 1.0531613603234291e-02 + + -1.0848262906074524e-01 4.2079353332519531e-01 + <_> + + 0 -1 570 -2.8240748215466738e-03 + + 1.5155430138111115e-01 -2.2742147743701935e-01 + <_> + + 0 -1 384 -1.6008135862648487e-03 + + 2.9879093170166016e-01 -1.0573560744524002e-01 + <_> + + 0 -1 90 -1.2082614004611969e-02 + + 2.5803449749946594e-01 -1.1197961121797562e-01 + <_> + + 0 -1 746 9.8490377422422171e-04 + + -1.8312133848667145e-01 1.3942104578018188e-01 + <_> + + 0 -1 347 1.3184763491153717e-02 + + -1.0306112468242645e-01 2.5403776764869690e-01 + <_> + + 0 -1 143 2.5388993322849274e-02 + + 6.4101323485374451e-02 -4.2444714903831482e-01 + <_> + + 0 -1 196 7.8083951957523823e-03 + + -7.8133262693881989e-02 3.2170715928077698e-01 + <_> + + 0 -1 921 1.2125947978347540e-03 + + -1.4831624925136566e-01 1.6055701673030853e-01 + <_> + + 0 -1 920 -5.7722916826605797e-03 + + -6.2254351377487183e-01 4.7926213592290878e-02 + <_> + + 0 -1 987 -6.7740413360297680e-03 + + -6.4991837739944458e-01 1.9058052450418472e-02 + <_> + + 0 -1 291 -2.8847754001617432e-03 + + -5.1574712991714478e-01 4.2939033359289169e-02 + <_> + + 0 -1 922 -5.1092512905597687e-02 + + -7.1794927120208740e-01 3.0500946566462517e-02 + <_> + + 0 -1 303 -3.0863287393003702e-03 + + -5.1027435064315796e-01 3.7360988557338715e-02 + <_> + + 0 -1 593 -3.1833123648539186e-04 + + 1.1626140773296356e-01 -1.7245446145534515e-01 + <_> + + 0 -1 210 1.2636608444154263e-03 + + -7.4942886829376221e-02 2.7081242203712463e-01 + <_> + + 0 -1 693 -2.7436314150691032e-02 + + -5.7718968391418457e-01 3.3168055117130280e-02 + <_> + + 0 -1 342 -1.8837231909856200e-03 + + -3.0960574746131897e-01 6.1044581234455109e-02 + <_> + + 0 -1 797 3.2289433293044567e-03 + + -6.8203814327716827e-02 2.9658797383308411e-01 + <_> + + 0 -1 503 -3.6236688029021025e-03 + + -4.9605649709701538e-01 4.2492914944887161e-02 + <_> + + 0 -1 135 -1.3776571722701192e-03 + + 1.3447758555412292e-01 -1.3678476214408875e-01 + <_> + + 0 -1 579 2.9051192104816437e-03 + + -1.2944447994232178e-01 1.4306847751140594e-01 + <_> + + 0 -1 722 4.4553354382514954e-03 + + 3.8421813398599625e-02 -4.5035859942436218e-01 + <_> + + 0 -1 622 1.0964765213429928e-02 + + -4.8769049346446991e-02 3.9813303947448730e-01 + <_> + + 0 -1 682 2.8863823972642422e-03 + + 5.1313977688550949e-02 -3.6272794008255005e-01 + <_> + + 0 -1 283 8.8652484118938446e-03 + + -9.4886533915996552e-02 2.1068450808525085e-01 + <_> + + 0 -1 333 -1.9646657630801201e-02 + + 2.2927023470401764e-01 -1.0384474694728851e-01 + <_> + + 0 -1 684 -2.3328745737671852e-03 + + -3.0931735038757324e-01 6.4516365528106689e-02 + <_> + + 0 -1 8 -4.0204055607318878e-02 + + 2.7381995320320129e-01 -7.6448827981948853e-02 + <_> + + 0 -1 100 1.9051276147365570e-02 + + 4.9466736614704132e-02 -3.6089882254600525e-01 + <_> + + 0 -1 936 1.1553505435585976e-02 + + -7.4454858899116516e-02 2.5223839282989502e-01 + <_> + + 0 -1 76 6.0810474678874016e-03 + + 4.9583721905946732e-02 -3.6660569906234741e-01 + <_> + + 0 -1 212 5.4147411137819290e-03 + + 3.2274514436721802e-02 -4.9895319342613220e-01 + <_> + + 0 -1 544 4.6544210053980350e-03 + + 2.5989409536123276e-02 -6.1053085327148438e-01 + <_> + + 0 -1 166 2.4446439929306507e-03 + + -1.2073440849781036e-01 1.4529803395271301e-01 + <_> + + 0 -1 698 4.6318914974108338e-04 + + -1.0553400218486786e-01 1.7337696254253387e-01 + <_> + + 0 -1 642 -3.7485856562852859e-02 + + -4.0581890940666199e-01 4.1759915649890900e-02 + <_> + + 0 -1 529 -2.0438145846128464e-02 + + 2.9171264171600342e-01 -6.6287793219089508e-02 + <_> + + 0 -1 524 -3.8345486391335726e-03 + + 1.5750087797641754e-01 -1.2569475173950195e-01 + <_> + + 0 -1 884 8.8059913832694292e-04 + + -1.0610871762037277e-01 1.7642241716384888e-01 + <_> + + 0 -1 33 2.0514219067990780e-03 + + 3.4303460270166397e-02 -5.5235451459884644e-01 + <_> + + 0 -1 851 -3.5282317548990250e-03 + + -5.3414058685302734e-01 3.0512372031807899e-02 + <_> + + 0 -1 506 6.1051873490214348e-03 + + -8.4812760353088379e-02 1.9969700276851654e-01 + <_> + + 0 -1 137 -6.4141638576984406e-03 + + -4.0772309899330139e-01 4.3864764273166656e-02 + <_> + + 0 -1 823 1.7272554337978363e-02 + + 2.1965105086565018e-02 -6.9809681177139282e-01 + <_> + + 0 -1 512 -1.9691141787916422e-03 + + 1.8511210381984711e-01 -9.0554594993591309e-02 + <_> + + 0 -1 59 -5.5513512343168259e-03 + + -4.2040807008743286e-01 4.0062893182039261e-02 + <_> + + 0 -1 626 -1.1905157566070557e-01 + + -6.4312189817428589e-01 2.3472266271710396e-02 + <_> + + 0 -1 290 4.0823101997375488e-02 + + -7.3068141937255859e-02 2.4851579964160919e-01 + <_> + + 0 -1 119 -8.1011475995182991e-03 + + 2.2747313976287842e-01 -7.5412914156913757e-02 + <_> + + 0 -1 87 4.7750310041010380e-03 + + -7.8901365399360657e-02 2.3182301223278046e-01 + <_> + + 0 -1 404 -2.7586806565523148e-02 + + -6.4926701784133911e-01 2.5375340133905411e-02 + <_> + + 0 -1 907 4.3069543316960335e-03 + + 2.4360222741961479e-02 -5.7372909784317017e-01 + <_> + + 0 -1 385 -6.1931653181090951e-04 + + 2.2557340562343597e-01 -7.5787223875522614e-02 + <_> + + 0 -1 50 -1.1459679901599884e-01 + + 3.0668416619300842e-01 -5.2840072661638260e-02 + <_> + + 0 -1 239 3.1560026109218597e-02 + + -9.5666781067848206e-02 1.7659574747085571e-01 + <_> + + 0 -1 871 1.5142546035349369e-03 + + -9.2694908380508423e-02 2.0833927392959595e-01 + <_> + + 0 -1 731 4.7312509268522263e-03 + + -4.9851816147565842e-02 3.4422698616981506e-01 + <_> + + 0 -1 253 -5.9051956050097942e-03 + + -4.6798244118690491e-01 3.6009732633829117e-02 + <_> + + 0 -1 703 3.3569703809916973e-03 + + -5.1445800811052322e-02 3.3950069546699524e-01 + <_> + + 0 -1 966 -1.1821147799491882e-01 + + 4.6877983212471008e-01 -3.2708466053009033e-02 + <_> + + 0 -1 363 -8.8651233818382025e-04 + + 1.5177871286869049e-01 -1.0880727320909500e-01 + <_> + + 0 -1 680 -2.5330238044261932e-02 + + 1.7184022068977356e-01 -9.8979160189628601e-02 + <_> + + 0 -1 770 5.5901473388075829e-03 + + -7.1004293859004974e-02 2.7359166741371155e-01 + <_> + + 0 -1 189 1.2344302609562874e-02 + + 3.2738436013460159e-02 -5.2876019477844238e-01 + <_> + + 0 -1 348 -7.4871592223644257e-03 + + -5.1955360174179077e-01 2.7597136795520782e-02 + <_> + + 0 -1 646 -2.6753707788884640e-03 + + -4.7180628776550293e-01 3.1411368399858475e-02 + <_> + + 0 -1 168 -3.2419776543974876e-03 + + 1.5980260074138641e-01 -9.5776490867137909e-02 + <_> + + 0 -1 169 8.8083129376173019e-03 + + -8.2104682922363281e-02 2.0850872993469238e-01 + <_> + + 0 -1 58 2.7282098308205605e-03 + + 6.1908718198537827e-02 -2.6338595151901245e-01 + <_> + + 0 -1 671 5.0587565638124943e-03 + + -8.2083821296691895e-02 1.9557759165763855e-01 + <_> + + 0 -1 708 -2.1199107170104980e-02 + + -5.0425887107849121e-01 3.0914928764104843e-02 + <_> + + 0 -1 723 3.4958114847540855e-03 + + -8.2294017076492310e-02 1.9164223968982697e-01 + <_> + + 0 -1 842 1.5914414543658495e-03 + + -6.9352962076663971e-02 2.1474194526672363e-01 + <_> + + 0 -1 193 -5.0045788288116455e-02 + + 2.4582423269748688e-01 -6.2959901988506317e-02 + <_> + + 0 -1 19 -4.1983526200056076e-02 + + -6.3210010528564453e-01 2.5985429063439369e-02 + <_> + + 0 -1 402 -6.9432961754500866e-04 + + 2.2444137930870056e-01 -7.0591680705547333e-02 + <_> + + 0 -1 540 6.0177911072969437e-03 + + 3.7622205913066864e-02 -4.1375440359115601e-01 + <_> + + 0 -1 492 4.7936867922544479e-03 + + -9.0203136205673218e-02 1.7498855292797089e-01 + <_> + + 0 -1 390 -4.7484524548053741e-03 + + -3.9998278021812439e-01 3.8966752588748932e-02 + <_> + + 0 -1 620 -7.7324017882347107e-02 + + -4.8634868860244751e-01 2.9687402769923210e-02 + <_> + + 0 -1 417 1.1184449307620525e-02 + + -4.9598570913076401e-02 3.2780852913856506e-01 + <_> + + 0 -1 132 -1.0921864770352840e-02 + + 1.7756749689579010e-01 -8.5219532251358032e-02 + <_> + + 0 -1 357 4.5135535299777985e-02 + + 2.8995228931307793e-02 -5.3758519887924194e-01 + <_> + + 0 -1 341 -1.1866749264299870e-03 + + 1.8304300308227539e-01 -8.5605643689632416e-02 + <_> + + 0 -1 609 2.0626676268875599e-03 + + 2.5438303127884865e-02 -5.9883767366409302e-01 + <_> + + 0 -1 251 2.7453177608549595e-05 + + -1.3831512629985809e-01 1.0590004175901413e-01 + + <_> + 98 + -1.2823635339736938e+00 + + <_> + + 0 -1 840 -8.7535101920366287e-03 + + 3.7845414876937866e-01 -1.2724789977073669e-01 + <_> + + 0 -1 376 -5.7867290452122688e-03 + + 4.6451708674430847e-01 -1.0028645396232605e-01 + <_> + + 0 -1 467 -1.5636831521987915e-02 + + 2.7137696743011475e-01 -1.3237486779689789e-01 + <_> + + 0 -1 743 7.9419813118875027e-04 + + -2.2457434237003326e-01 1.8765783309936523e-01 + <_> + + 0 -1 511 9.8101666662842035e-04 + + -1.1674020439386368e-01 2.3788549005985260e-01 + <_> + + 0 -1 148 -1.1779682245105505e-03 + + 2.5913080573081970e-01 -8.3949849009513855e-02 + <_> + + 0 -1 330 9.6748135983943939e-03 + + -8.3296068012714386e-02 3.4700453281402588e-01 + <_> + + 0 -1 307 2.9431451112031937e-03 + + 4.6826824545860291e-02 -5.1865130662918091e-01 + <_> + + 0 -1 918 -1.0496248723939061e-03 + + -2.9976195096969604e-01 6.9594070315361023e-02 + <_> + + 0 -1 697 -1.6385620459914207e-02 + + 2.1480703353881836e-01 -9.7807772457599640e-02 + <_> + + 0 -1 910 4.9830954521894455e-03 + + 2.2837642580270767e-02 -7.7743059396743774e-01 + <_> + + 0 -1 796 -3.1421617604792118e-03 + + -5.6898134946823120e-01 3.6988433450460434e-02 + <_> + + 0 -1 901 1.6069117933511734e-02 + + -1.0548119246959686e-01 1.9650301337242126e-01 + <_> + + 0 -1 751 1.5043821185827255e-02 + + -1.0749972611665726e-01 2.0178599655628204e-01 + <_> + + 0 -1 295 6.8444460630416870e-03 + + 5.0306834280490875e-02 -4.3162798881530762e-01 + <_> + + 0 -1 827 1.1850953102111816e-02 + + 3.2905589789152145e-02 -5.1617246866226196e-01 + <_> + + 0 -1 831 2.1246306598186493e-02 + + -6.3726536929607391e-02 3.0544599890708923e-01 + <_> + + 0 -1 256 1.1852337047457695e-02 + + -8.9553833007812500e-02 2.9359081387519836e-01 + <_> + + 0 -1 323 -2.5085010565817356e-03 + + 2.2805334627628326e-01 -9.5263637602329254e-02 + <_> + + 0 -1 752 7.5797801837325096e-03 + + 3.8756053894758224e-02 -5.7552194595336914e-01 + <_> + + 0 -1 86 5.4980744607746601e-03 + + 4.6144284307956696e-02 -3.6506399512290955e-01 + <_> + + 0 -1 208 -3.0190458055585623e-03 + + -2.9709556698799133e-01 7.5851216912269592e-02 + <_> + + 0 -1 552 -7.0441095158457756e-03 + + 1.6086654365062714e-01 -1.1914677917957306e-01 + <_> + + 0 -1 364 -6.9178184494376183e-03 + + -4.1069602966308594e-01 4.4916272163391113e-02 + <_> + + 0 -1 351 5.0740875303745270e-03 + + -7.4677795171737671e-02 2.4945564568042755e-01 + <_> + + 0 -1 121 -1.0403880849480629e-02 + + -5.3336864709854126e-01 3.9480298757553101e-02 + <_> + + 0 -1 323 2.3738082963973284e-03 + + -7.8084513545036316e-02 2.3774850368499756e-01 + <_> + + 0 -1 391 2.7033074729843065e-05 + + -1.8558554351329803e-01 9.6640095114707947e-02 + <_> + + 0 -1 167 2.9049259610474110e-03 + + 4.6409133821725845e-02 -3.9720407128334045e-01 + <_> + + 0 -1 181 -5.6298477575182915e-03 + + -4.5908093452453613e-01 3.7730857729911804e-02 + <_> + + 0 -1 638 5.0751655362546444e-03 + + 2.3507807403802872e-02 -6.4602053165435791e-01 + <_> + + 0 -1 909 -7.5826002284884453e-04 + + 1.2444372475147247e-01 -1.3639765977859497e-01 + <_> + + 0 -1 11 -9.7201213240623474e-02 + + 3.9986947178840637e-01 -4.4366274029016495e-02 + <_> + + 0 -1 496 -2.3840454220771790e-01 + + -5.3094118833541870e-01 3.8410611450672150e-02 + <_> + + 0 -1 114 -1.3428549282252789e-02 + + 2.2794343531131744e-01 -7.7827021479606628e-02 + <_> + + 0 -1 64 -5.0623202696442604e-04 + + 1.5778008103370667e-01 -1.2732668220996857e-01 + <_> + + 0 -1 931 -8.6578715126961470e-04 + + 1.4809772372245789e-01 -1.1785575747489929e-01 + <_> + + 0 -1 544 -2.7892580255866051e-03 + + -4.2324438691139221e-01 4.1194166988134384e-02 + <_> + + 0 -1 654 2.9110969044268131e-03 + + -1.2145258486270905e-01 1.4758351445198059e-01 + <_> + + 0 -1 122 -1.7908504605293274e-01 + + 4.0684828162193298e-01 -4.6298943459987640e-02 + <_> + + 0 -1 894 4.2685694643296301e-04 + + -9.4548642635345459e-02 1.8615303933620453e-01 + <_> + + 0 -1 72 1.9871112704277039e-01 + + -5.6818448007106781e-02 3.2197028398513794e-01 + <_> + + 0 -1 892 1.2496551498770714e-03 + + -7.0664338767528534e-02 2.5729593634605408e-01 + <_> + + 0 -1 447 1.6119793057441711e-02 + + -5.0713617354631424e-02 3.9684635400772095e-01 + <_> + + 0 -1 964 -2.5047704111784697e-03 + + -3.5733562707901001e-01 4.9460943788290024e-02 + <_> + + 0 -1 672 5.2866833284497261e-03 + + 3.2510578632354736e-02 -4.4326359033584595e-01 + <_> + + 0 -1 633 -3.4677600488066673e-03 + + 2.3254001140594482e-01 -7.3516972362995148e-02 + <_> + + 0 -1 600 -3.3557973802089691e-03 + + 2.3221854865550995e-01 -6.9719336926937103e-02 + <_> + + 0 -1 801 -6.3276281580328941e-03 + + -4.0112924575805664e-01 4.3525256216526031e-02 + <_> + + 0 -1 218 -4.3456726707518101e-03 + + -6.8020933866500854e-01 1.9806224852800369e-02 + <_> + + 0 -1 604 6.2400596216320992e-03 + + 1.8352568149566650e-02 -7.0223194360733032e-01 + <_> + + 0 -1 979 3.3795731142163277e-03 + + 4.3487045913934708e-02 -3.0831974744796753e-01 + <_> + + 0 -1 937 1.3499217107892036e-02 + + -4.4923197478055954e-02 3.2624542713165283e-01 + <_> + + 0 -1 408 -1.0585743002593517e-03 + + 1.6033367812633514e-01 -9.8465800285339355e-02 + <_> + + 0 -1 405 -5.3765797056257725e-03 + + 2.6544988155364990e-01 -6.7050188779830933e-02 + <_> + + 0 -1 980 -2.4880110286176205e-03 + + -2.9397118091583252e-01 5.4097402840852737e-02 + <_> + + 0 -1 505 -2.1792344748973846e-02 + + -7.2506862878799438e-01 1.9187789410352707e-02 + <_> + + 0 -1 714 4.7056311741471291e-03 + + -5.2215453237295151e-02 3.1615570187568665e-01 + <_> + + 0 -1 669 -4.2645912617444992e-03 + + 2.3567616939544678e-01 -6.8938009440898895e-02 + <_> + + 0 -1 774 5.8556320145726204e-03 + + 4.2000979185104370e-02 -4.6045160293579102e-01 + <_> + + 0 -1 926 1.3632343616336584e-03 + + -6.5663956105709076e-02 2.3397234082221985e-01 + <_> + + 0 -1 895 -6.0495175421237946e-03 + + -4.3943586945533752e-01 3.6742802709341049e-02 + <_> + + 0 -1 308 6.7223357036709785e-03 + + 1.9922675564885139e-02 -6.8767511844635010e-01 + <_> + + 0 -1 917 -5.1960002630949020e-02 + + -7.5993520021438599e-01 1.5627101063728333e-02 + <_> + + 0 -1 542 3.3762669190764427e-03 + + -7.7943108975887299e-02 1.9545321166515350e-01 + <_> + + 0 -1 582 -1.8302195239812136e-03 + + 1.9154363870620728e-01 -9.4946600496768951e-02 + <_> + + 0 -1 71 -4.3824277818202972e-03 + + -5.3172159194946289e-01 2.8438575565814972e-02 + <_> + + 0 -1 107 4.8605538904666901e-03 + + 1.8084224313497543e-02 -7.0419138669967651e-01 + <_> + + 0 -1 289 -5.0755832344293594e-03 + + 1.3961549103260040e-01 -1.0557857155799866e-01 + <_> + + 0 -1 349 9.0303886681795120e-03 + + -5.6681722402572632e-02 3.0537691712379456e-01 + <_> + + 0 -1 52 1.7635107040405273e-01 + + -3.5581633448600769e-02 3.9358299970626831e-01 + <_> + + 0 -1 728 1.1068049352616072e-03 + + -9.6729792654514313e-02 1.6677951812744141e-01 + <_> + + 0 -1 162 1.1059102602303028e-02 + + 2.9283966869115829e-02 -5.1121145486831665e-01 + <_> + + 0 -1 236 -5.0462923943996429e-02 + + -4.2722624540328979e-01 3.1082244589924812e-02 + <_> + + 0 -1 316 -3.8071773014962673e-03 + + 2.9747742414474487e-01 -5.1289469003677368e-02 + <_> + + 0 -1 373 -1.5183673240244389e-03 + + 1.8215130269527435e-01 -1.0301912575960159e-01 + <_> + + 0 -1 258 2.1069757640361786e-02 + + 2.4503789842128754e-02 -5.8991265296936035e-01 + <_> + + 0 -1 68 6.6435593180358410e-03 + + 4.3313629925251007e-02 -3.1504327058792114e-01 + <_> + + 0 -1 574 -8.2504414021968842e-03 + + -4.7998124361038208e-01 3.0433293431997299e-02 + <_> + + 0 -1 617 -1.0892231017351151e-02 + + 3.1449675559997559e-01 -5.2475348114967346e-02 + <_> + + 0 -1 213 8.1554818898439407e-03 + + 3.9224579930305481e-02 -3.8470247387886047e-01 + <_> + + 0 -1 838 -5.4475883953273296e-03 + + -6.5578418970108032e-01 2.0117431879043579e-02 + <_> + + 0 -1 487 -2.6005427935160697e-04 + + 1.4328984916210175e-01 -9.8999619483947754e-02 + <_> + + 0 -1 461 1.3821206521242857e-03 + + -5.2590593695640564e-02 2.7557003498077393e-01 + <_> + + 0 -1 445 -1.1740636080503464e-02 + + 2.7564841508865356e-01 -5.9799015522003174e-02 + <_> + + 0 -1 941 2.7866149321198463e-03 + + 5.0002526491880417e-02 -3.5232934355735779e-01 + <_> + + 0 -1 962 6.6179647110402584e-03 + + -6.3348092138767242e-02 2.3150660097599030e-01 + <_> + + 0 -1 297 -1.3244405854493380e-03 + + -2.6642721891403198e-01 5.5936500430107117e-02 + <_> + + 0 -1 485 1.1830568313598633e-02 + + -6.9061063230037689e-02 2.1172530949115753e-01 + <_> + + 0 -1 644 2.5925931986421347e-03 + + 1.9716180860996246e-02 -7.7208590507507324e-01 + <_> + + 0 -1 748 -2.8010653331875801e-03 + + 1.3846111297607422e-01 -9.7015053033828735e-02 + <_> + + 0 -1 144 -4.7637272626161575e-02 + + 2.1245625615119934e-01 -7.0445045828819275e-02 + <_> + + 0 -1 197 1.3677144888788462e-03 + + -8.5676178336143494e-02 1.9613882899284363e-01 + <_> + + 0 -1 556 -1.3261453807353973e-01 + + 4.3639957904815674e-01 -3.4653130918741226e-02 + <_> + + 0 -1 69 7.1225965023040771e-01 + + 1.9474601373076439e-02 -8.7232232093811035e-01 + <_> + + 0 -1 149 -5.9057516045868397e-03 + + -3.7135502696037292e-01 3.5206548869609833e-02 + <_> + + 0 -1 971 3.5532126203179359e-03 + + -6.6334858536720276e-02 2.3531165719032288e-01 + <_> + + 0 -1 31 -1.9724387675523758e-02 + + 2.5173032283782959e-01 -5.7575348764657974e-02 + + <_> + 100 + -1.3067311048507690e+00 + + <_> + + 0 -1 458 8.1832958385348320e-03 + + -1.1180391162633896e-01 3.9526882767677307e-01 + <_> + + 0 -1 717 -5.5650249123573303e-03 + + 3.3437621593475342e-01 -1.2654128670692444e-01 + <_> + + 0 -1 577 8.1406952813267708e-04 + + -1.7086146771907806e-01 1.8384252488613129e-01 + <_> + + 0 -1 113 -2.0645279437303543e-03 + + 1.7057111859321594e-01 -1.7103828489780426e-01 + <_> + + 0 -1 864 1.9037863239645958e-03 + + -1.6791534423828125e-01 1.5749432146549225e-01 + <_> + + 0 -1 242 1.1136581189930439e-02 + + 4.0173061192035675e-02 -3.7364640831947327e-01 + <_> + + 0 -1 228 5.6379067245870829e-04 + + -1.6792711615562439e-01 1.4207355678081512e-01 + <_> + + 0 -1 797 -3.3720356877893209e-03 + + 2.5698736310005188e-01 -7.5178287923336029e-02 + <_> + + 0 -1 710 -1.7311582341790199e-02 + + -5.2065086364746094e-01 4.7350786626338959e-02 + <_> + + 0 -1 845 -3.3407085575163364e-03 + + -4.5184752345085144e-01 3.2597322016954422e-02 + <_> + + 0 -1 661 -3.4317255020141602e-02 + + 2.5700893998146057e-01 -8.3455510437488556e-02 + <_> + + 0 -1 423 -6.8267658352851868e-02 + + 2.8288829326629639e-01 -7.8631594777107239e-02 + <_> + + 0 -1 951 2.8722581191686913e-05 + + -1.8466357886791229e-01 1.1576397716999054e-01 + <_> + + 0 -1 267 9.9579263478517532e-03 + + -6.3400641083717346e-02 3.6796927452087402e-01 + <_> + + 0 -1 733 -1.8424488604068756e-02 + + 2.4584248661994934e-01 -9.4283707439899445e-02 + <_> + + 0 -1 837 6.8876314908266068e-03 + + -9.9725127220153809e-02 2.8111982345581055e-01 + <_> + + 0 -1 657 -2.2637452930212021e-03 + + -4.1033151745796204e-01 6.1188895255327225e-02 + <_> + + 0 -1 191 -8.5531552031170577e-05 + + 1.1543370783329010e-01 -1.6276736557483673e-01 + <_> + + 0 -1 32 3.3203132450580597e-02 + + 4.8811107873916626e-02 -3.7535405158996582e-01 + <_> + + 0 -1 929 5.1993243396282196e-03 + + 3.9811953902244568e-02 -4.8758861422538757e-01 + <_> + + 0 -1 365 4.8818998038768768e-03 + + 2.4118293076753616e-02 -6.7809182405471802e-01 + <_> + + 0 -1 82 -7.2956003248691559e-02 + + 1.8825025856494904e-01 -9.5193333923816681e-02 + <_> + + 0 -1 836 9.4123989343643188e-02 + + -7.2761356830596924e-02 2.7999758720397949e-01 + <_> + + 0 -1 718 1.0472428984940052e-03 + + -7.4624419212341309e-02 2.4220877885818481e-01 + <_> + + 0 -1 446 8.0979522317647934e-03 + + -5.4950036108493805e-02 3.0833497643470764e-01 + <_> + + 0 -1 463 -2.8517602477222681e-03 + + 3.2442548871040344e-01 -7.1306072175502777e-02 + <_> + + 0 -1 63 3.7457090802490711e-03 + + 5.7812750339508057e-02 -3.3119776844978333e-01 + <_> + + 0 -1 217 -3.9520347490906715e-03 + + -4.3750977516174316e-01 3.9293695241212845e-02 + <_> + + 0 -1 865 -5.8175362646579742e-03 + + 2.0937338471412659e-01 -8.1724949181079865e-02 + <_> + + 0 -1 878 7.8594256192445755e-03 + + 4.8747915774583817e-02 -4.1596582531929016e-01 + <_> + + 0 -1 913 -6.7130924435332417e-04 + + 1.4715777337551117e-01 -1.2916122376918793e-01 + <_> + + 0 -1 62 -4.2964564636349678e-03 + + -3.5870963335037231e-01 4.8831127583980560e-02 + <_> + + 0 -1 868 -3.8814521394670010e-03 + + -4.7464737296104431e-01 3.4466378390789032e-02 + <_> + + 0 -1 950 -1.8017216352745891e-03 + + -3.5517925024032593e-01 4.9101348966360092e-02 + <_> + + 0 -1 813 7.7566690742969513e-03 + + 2.7035165578126907e-02 -5.5951416492462158e-01 + <_> + + 0 -1 886 1.9125882536172867e-03 + + -6.3309118151664734e-02 2.5223699212074280e-01 + <_> + + 0 -1 886 -9.9804997444152832e-04 + + 2.4349449574947357e-01 -8.9007876813411713e-02 + <_> + + 0 -1 97 -7.5093598570674658e-04 + + 1.3702079653739929e-01 -1.2293258309364319e-01 + <_> + + 0 -1 7 1.0788314975798130e-02 + + -7.3592424392700195e-02 2.3694764077663422e-01 + <_> + + 0 -1 428 -1.2814668007194996e-03 + + 1.7014959454536438e-01 -9.3263216316699982e-02 + <_> + + 0 -1 851 3.5997035447508097e-03 + + 2.4880735203623772e-02 -5.7666695117950439e-01 + <_> + + 0 -1 410 5.9913634322583675e-03 + + -6.6571407020092010e-02 2.3750782012939453e-01 + <_> + + 0 -1 299 3.7381309084594250e-03 + + 3.7266705185174942e-02 -4.3619966506958008e-01 + <_> + + 0 -1 372 8.8815446943044662e-03 + + 3.0544634908437729e-02 -4.6924960613250732e-01 + <_> + + 0 -1 243 -3.1860180199146271e-02 + + -4.8059463500976562e-01 3.1165035441517830e-02 + <_> + + 0 -1 881 -5.4914336651563644e-03 + + 1.7584608495235443e-01 -9.0091012418270111e-02 + <_> + + 0 -1 821 -1.2325609102845192e-02 + + 3.4678825736045837e-01 -5.6969922035932541e-02 + <_> + + 0 -1 281 5.8694169856607914e-03 + + 3.9381653070449829e-02 -4.6237498521804810e-01 + <_> + + 0 -1 207 -5.0925426185131073e-03 + + -4.0191245079040527e-01 4.1170045733451843e-02 + <_> + + 0 -1 636 4.5132841914892197e-03 + + 2.7933681383728981e-02 -4.8419687151908875e-01 + <_> + + 0 -1 665 2.2130757570266724e-02 + + 2.1358741447329521e-02 -6.0434627532958984e-01 + <_> + + 0 -1 597 -1.8624030053615570e-03 + + 1.9556084275245667e-01 -7.8905813395977020e-02 + <_> + + 0 -1 599 3.2466566190123558e-03 + + -8.3141714334487915e-02 2.5859814882278442e-01 + <_> + + 0 -1 575 1.9641252234578133e-02 + + 2.1901637315750122e-02 -7.2247391939163208e-01 + <_> + + 0 -1 271 1.2722628191113472e-02 + + -4.9173772335052490e-02 3.1656193733215332e-01 + <_> + + 0 -1 210 -3.9457585080526769e-04 + + 1.7969387769699097e-01 -1.0087045282125473e-01 + <_> + + 0 -1 88 -3.0111533123999834e-04 + + 1.2916654348373413e-01 -1.5019074082374573e-01 + <_> + + 0 -1 84 -4.1901473887264729e-03 + + 1.6727919876575470e-01 -9.4101771712303162e-02 + <_> + + 0 -1 186 -2.9096096754074097e-02 + + 2.4397623538970947e-01 -6.5033406019210815e-02 + <_> + + 0 -1 815 -3.0687432736158371e-02 + + -5.3695982694625854e-01 3.6870311945676804e-02 + <_> + + 0 -1 596 8.9634142816066742e-02 + + -4.5044522732496262e-02 3.7668040394783020e-01 + <_> + + 0 -1 765 -1.8486939370632172e-02 + + -4.5869186520576477e-01 3.6696173250675201e-02 + <_> + + 0 -1 561 -2.0481455139815807e-03 + + 1.9705456495285034e-01 -8.1085532903671265e-02 + <_> + + 0 -1 160 7.9915560781955719e-03 + + 2.6794398203492165e-02 -6.0658437013626099e-01 + <_> + + 0 -1 368 -4.5167207717895508e-03 + + -3.5664665699005127e-01 4.1606105864048004e-02 + <_> + + 0 -1 429 -8.8896900415420532e-03 + + -5.6794744729995728e-01 2.4264462292194366e-02 + <_> + + 0 -1 601 -2.7863893657922745e-02 + + -6.6293621063232422e-01 1.7915287986397743e-02 + <_> + + 0 -1 153 1.9837494473904371e-03 + + -5.5686347186565399e-02 2.7396288514137268e-01 + <_> + + 0 -1 624 -2.9144049622118473e-03 + + -4.3623712658882141e-01 3.1940482556819916e-02 + <_> + + 0 -1 924 -1.1720246402546763e-03 + + 1.5299941599369049e-01 -8.8886320590972900e-02 + <_> + + 0 -1 927 2.1249109413474798e-03 + + -7.1360021829605103e-02 2.0698173344135284e-01 + <_> + + 0 -1 602 4.6013649553060532e-03 + + 2.5328675284981728e-02 -5.1310408115386963e-01 + <_> + + 0 -1 644 -9.4112986698746681e-04 + + -2.9404127597808838e-01 4.4868268072605133e-02 + <_> + + 0 -1 719 5.2681900560855865e-03 + + -6.4163528382778168e-02 2.2999708354473114e-01 + <_> + + 0 -1 652 1.4232876710593700e-03 + + -7.8037962317466736e-02 1.9061613082885742e-01 + <_> + + 0 -1 858 -1.0191567242145538e-02 + + -5.7409489154815674e-01 2.2581731900572777e-02 + <_> + + 0 -1 547 -4.9564028158783913e-03 + + 2.4646909534931183e-01 -5.9094201773405075e-02 + <_> + + 0 -1 545 2.2057720925658941e-03 + + -9.8776444792747498e-02 1.9191808998584747e-01 + <_> + + 0 -1 809 -4.7279503196477890e-03 + + -2.9638877511024475e-01 4.7132529318332672e-02 + <_> + + 0 -1 905 1.8900397699326277e-03 + + -1.2390431761741638e-01 1.2199163436889648e-01 + <_> + + 0 -1 692 -3.9616838330402970e-04 + + -2.0177872478961945e-01 6.7829817533493042e-02 + <_> + + 0 -1 378 1.5198520850390196e-03 + + -5.0418090075254440e-02 2.8014704585075378e-01 + <_> + + 0 -1 377 -3.0729006975889206e-03 + + 1.6384753584861755e-01 -9.6394442021846771e-02 + <_> + + 0 -1 637 3.3707641065120697e-02 + + 3.3062599599361420e-02 -4.3530252575874329e-01 + <_> + + 0 -1 993 -2.7547087520360947e-03 + + -6.2498420476913452e-01 2.0407166332006454e-02 + <_> + + 0 -1 993 1.0800797026604414e-03 + + 4.3235320597887039e-02 -3.1784874200820923e-01 + <_> + + 0 -1 981 -2.4060246068984270e-03 + + 1.3923163712024689e-01 -9.8239123821258545e-02 + <_> + + 0 -1 727 4.6191983856260777e-03 + + 2.3523205891251564e-02 -6.0865134000778198e-01 + <_> + + 0 -1 284 2.1874131634831429e-03 + + -4.4655255973339081e-02 3.2406413555145264e-01 + <_> + + 0 -1 137 7.9257078468799591e-03 + + 2.8643675148487091e-02 -5.0231784582138062e-01 + <_> + + 0 -1 340 9.6561573445796967e-03 + + -6.7481219768524170e-02 2.0780794322490692e-01 + <_> + + 0 -1 180 -4.3771188706159592e-02 + + 2.0091144740581512e-01 -8.7350860238075256e-02 + <_> + + 0 -1 28 -3.9570517838001251e-02 + + -6.9823634624481201e-01 2.2996466606855392e-02 + <_> + + 0 -1 517 -7.4827047064900398e-03 + + -3.2485857605934143e-01 4.2747449129819870e-02 + <_> + + 0 -1 863 -9.5894857076928020e-04 + + 1.3692225515842438e-01 -1.0624063760042191e-01 + <_> + + 0 -1 495 -5.6482471525669098e-02 + + 2.7130955457687378e-01 -5.5133864283561707e-02 + <_> + + 0 -1 526 -5.5641448125243187e-03 + + -6.5910613536834717e-01 2.6108600199222565e-02 + <_> + + 0 -1 833 4.5432001352310181e-03 + + -1.0277131199836731e-01 1.4715240895748138e-01 + <_> + + 0 -1 804 -1.9441416952759027e-03 + + 1.7929133772850037e-01 -7.8247167170047760e-02 + <_> + + 0 -1 615 1.5584268840029836e-03 + + 5.2101351320743561e-02 -2.7727204561233521e-01 + + <_> + + <_> + 0 0 6 1 -1. + <_> + 3 0 3 1 2. + 0 + <_> + + <_> + 0 0 8 1 -1. + <_> + 4 0 4 1 2. + 0 + <_> + + <_> + 0 0 8 2 -1. + <_> + 4 0 4 2 2. + 0 + <_> + + <_> + 0 0 8 6 -1. + <_> + 0 0 4 3 2. + <_> + 4 3 4 3 2. + 0 + <_> + + <_> + 0 0 8 12 -1. + <_> + 0 0 4 6 2. + <_> + 4 6 4 6 2. + 0 + <_> + + <_> + 0 0 10 1 -1. + <_> + 5 0 5 1 2. + 0 + <_> + + <_> + 0 0 10 6 -1. + <_> + 0 0 5 3 2. + <_> + 5 3 5 3 2. + 0 + <_> + + <_> + 0 0 24 1 -1. + <_> + 6 0 12 1 2. + 0 + <_> + + <_> + 0 0 24 2 -1. + <_> + 6 0 12 2 2. + 0 + <_> + + <_> + 0 0 14 8 -1. + <_> + 0 0 7 4 2. + <_> + 7 4 7 4 2. + 0 + <_> + + <_> + 0 0 16 8 -1. + <_> + 0 0 8 4 2. + <_> + 8 4 8 4 2. + 0 + <_> + + <_> + 0 0 16 10 -1. + <_> + 0 0 8 5 2. + <_> + 8 5 8 5 2. + 0 + <_> + + <_> + 0 0 24 1 -1. + <_> + 12 0 12 1 2. + 0 + <_> + + <_> + 0 0 13 10 -1. + <_> + 0 5 13 5 2. + 0 + <_> + + <_> + 0 1 16 10 -1. + <_> + 0 1 8 5 2. + <_> + 8 6 8 5 2. + 0 + <_> + + <_> + 0 1 13 15 -1. + <_> + 0 6 13 5 3. + 0 + <_> + + <_> + 0 2 8 12 -1. + <_> + 0 2 4 6 2. + <_> + 4 8 4 6 2. + 0 + <_> + + <_> + 0 2 10 4 -1. + <_> + 0 2 5 2 2. + <_> + 5 4 5 2 2. + 0 + <_> + + <_> + 0 4 24 2 -1. + <_> + 0 4 12 1 2. + <_> + 12 5 12 1 2. + 0 + <_> + + <_> + 0 5 4 9 -1. + <_> + 0 8 4 3 3. + 0 + <_> + + <_> + 0 5 24 2 -1. + <_> + 0 5 12 1 2. + <_> + 12 6 12 1 2. + 0 + <_> + + <_> + 0 5 24 4 -1. + <_> + 0 5 12 2 2. + <_> + 12 7 12 2 2. + 0 + <_> + + <_> + 0 6 5 8 -1. + <_> + 0 8 5 4 2. + 0 + <_> + + <_> + 0 6 22 17 -1. + <_> + 11 6 11 17 2. + 0 + <_> + + <_> + 0 6 24 2 -1. + <_> + 0 6 12 1 2. + <_> + 12 7 12 1 2. + 0 + <_> + + <_> + 0 6 14 8 -1. + <_> + 0 10 14 4 2. + 0 + <_> + + <_> + 0 7 2 3 -1. + <_> + 0 8 2 1 3. + 0 + <_> + + <_> + 0 7 6 16 -1. + <_> + 3 7 3 16 2. + 0 + <_> + + <_> + 0 7 4 9 -1. + <_> + 0 10 4 3 3. + 0 + <_> + + <_> + 0 7 8 17 -1. + <_> + 4 7 4 17 2. + 0 + <_> + + <_> + 0 7 24 2 -1. + <_> + 6 7 12 2 2. + 0 + <_> + + <_> + 0 8 4 16 -1. + <_> + 2 8 2 16 2. + 0 + <_> + + <_> + 0 8 24 6 -1. + <_> + 0 8 12 3 2. + <_> + 12 11 12 3 2. + 0 + <_> + + <_> + 0 9 1 3 -1. + <_> + 0 10 1 1 3. + 0 + <_> + + <_> + 0 9 7 2 -1. + <_> + 0 10 7 1 2. + 0 + <_> + + <_> + 0 9 8 2 -1. + <_> + 0 10 8 1 2. + 0 + <_> + + <_> + 0 9 22 2 -1. + <_> + 0 9 11 1 2. + <_> + 11 10 11 1 2. + 0 + <_> + + <_> + 0 9 24 2 -1. + <_> + 0 9 12 1 2. + <_> + 12 10 12 1 2. + 0 + <_> + + <_> + 0 9 24 4 -1. + <_> + 0 9 12 2 2. + <_> + 12 11 12 2 2. + 0 + <_> + + <_> + 0 10 2 2 -1. + <_> + 0 11 2 1 2. + 0 + <_> + + <_> + 0 10 4 10 -1. + <_> + 2 10 2 10 2. + 0 + <_> + + <_> + 0 10 4 3 -1. + <_> + 0 11 4 1 3. + 0 + <_> + + <_> + 0 10 5 3 -1. + <_> + 0 11 5 1 3. + 0 + <_> + + <_> + 0 10 22 2 -1. + <_> + 0 10 11 1 2. + <_> + 11 11 11 1 2. + 0 + <_> + + <_> + 0 10 24 2 -1. + <_> + 0 10 12 1 2. + <_> + 12 11 12 1 2. + 0 + <_> + + <_> + 0 10 24 4 -1. + <_> + 0 10 12 2 2. + <_> + 12 12 12 2 2. + 0 + <_> + + <_> + 0 10 24 14 -1. + <_> + 12 10 12 14 2. + 0 + <_> + + <_> + 0 11 3 3 -1. + <_> + 0 12 3 1 3. + 0 + <_> + + <_> + 0 11 6 8 -1. + <_> + 0 11 3 4 2. + <_> + 3 15 3 4 2. + 0 + <_> + + <_> + 0 11 24 4 -1. + <_> + 0 11 12 2 2. + <_> + 12 13 12 2 2. + 0 + <_> + + <_> + 0 12 18 7 -1. + <_> + 9 12 9 7 2. + 0 + <_> + + <_> + 0 12 22 2 -1. + <_> + 0 12 11 1 2. + <_> + 11 13 11 1 2. + 0 + <_> + + <_> + 0 12 24 6 -1. + <_> + 12 12 12 6 2. + 0 + <_> + + <_> + 0 13 24 3 -1. + <_> + 6 13 12 3 2. + 0 + <_> + + <_> + 0 14 8 7 -1. + <_> + 4 14 4 7 2. + 0 + <_> + + <_> + 0 14 12 10 -1. + <_> + 0 14 6 5 2. + <_> + 6 19 6 5 2. + 0 + <_> + + <_> + 0 14 18 8 -1. + <_> + 6 14 6 8 3. + 0 + <_> + + <_> + 0 14 20 10 -1. + <_> + 10 14 10 10 2. + 0 + <_> + + <_> + 0 15 3 8 -1. + <_> + 1 15 1 8 3. + 0 + <_> + + <_> + 0 16 3 7 -1. + <_> + 1 16 1 7 3. + 0 + <_> + + <_> + 0 19 6 3 -1. + <_> + 0 20 6 1 3. + 0 + <_> + + <_> + 0 19 9 3 -1. + <_> + 0 20 9 1 3. + 0 + <_> + + <_> + 0 21 6 3 -1. + <_> + 0 22 6 1 3. + 0 + <_> + + <_> + 0 21 7 3 -1. + <_> + 0 22 7 1 3. + 0 + <_> + + <_> + 1 0 1 4 -1. + <_> + 1 2 1 2 2. + 0 + <_> + + <_> + 1 0 12 3 -1. + <_> + 4 0 6 3 2. + 0 + <_> + + <_> + 1 0 8 6 -1. + <_> + 1 0 4 3 2. + <_> + 5 3 4 3 2. + 0 + <_> + + <_> + 1 0 8 4 -1. + <_> + 5 0 4 4 2. + 0 + <_> + + <_> + 1 0 22 2 -1. + <_> + 1 0 11 1 2. + <_> + 12 1 11 1 2. + 0 + <_> + + <_> + 1 3 21 15 -1. + <_> + 8 8 7 5 9. + 0 + <_> + + <_> + 1 3 11 3 -1. + <_> + 1 4 11 1 3. + 0 + <_> + + <_> + 1 5 3 3 -1. + <_> + 1 6 3 1 3. + 0 + <_> + + <_> + 1 5 21 6 -1. + <_> + 8 7 7 2 9. + 0 + <_> + + <_> + 1 5 22 2 -1. + <_> + 1 5 11 1 2. + <_> + 12 6 11 1 2. + 0 + <_> + + <_> + 1 6 4 3 -1. + <_> + 1 7 4 1 3. + 0 + <_> + + <_> + 1 6 5 3 -1. + <_> + 1 7 5 1 3. + 0 + <_> + + <_> + 1 6 22 2 -1. + <_> + 1 6 11 1 2. + <_> + 12 7 11 1 2. + 0 + <_> + + <_> + 1 6 22 17 -1. + <_> + 12 6 11 17 2. + 0 + <_> + + <_> + 1 6 20 3 -1. + <_> + 1 7 20 1 3. + 0 + <_> + + <_> + 1 7 12 6 -1. + <_> + 5 9 4 2 9. + 0 + <_> + + <_> + 1 7 8 6 -1. + <_> + 1 9 8 2 3. + 0 + <_> + + <_> + 1 7 20 4 -1. + <_> + 1 7 10 2 2. + <_> + 11 9 10 2 2. + 0 + <_> + + <_> + 1 7 22 12 -1. + <_> + 1 11 22 4 3. + 0 + <_> + + <_> + 1 8 8 2 -1. + <_> + 1 8 4 1 2. + <_> + 5 9 4 1 2. + 0 + <_> + + <_> + 1 8 9 3 -1. + <_> + 1 9 9 1 3. + 0 + <_> + + <_> + 1 8 22 4 -1. + <_> + 1 8 11 2 2. + <_> + 12 10 11 2 2. + 0 + <_> + + <_> + 1 9 20 2 -1. + <_> + 1 9 10 1 2. + <_> + 11 10 10 1 2. + 0 + <_> + + <_> + 1 10 4 3 -1. + <_> + 3 10 2 3 2. + 0 + <_> + + <_> + 1 10 4 4 -1. + <_> + 1 11 4 2 2. + 0 + <_> + + <_> + 1 10 22 2 -1. + <_> + 1 10 11 1 2. + <_> + 12 11 11 1 2. + 0 + <_> + + <_> + 1 10 21 4 -1. + <_> + 1 11 21 2 2. + 0 + <_> + + <_> + 1 11 3 13 -1. + <_> + 2 11 1 13 3. + 0 + <_> + + <_> + 1 13 3 10 -1. + <_> + 2 13 1 10 3. + 0 + <_> + + <_> + 1 14 22 2 -1. + <_> + 1 14 11 1 2. + <_> + 12 15 11 1 2. + 0 + <_> + + <_> + 1 16 3 1 -1. + <_> + 2 17 1 1 3. + 1 + <_> + + <_> + 1 17 4 1 -1. + <_> + 2 18 2 1 2. + 1 + <_> + + <_> + 1 19 4 1 -1. + <_> + 2 20 2 1 2. + 1 + <_> + + <_> + 2 0 4 1 -1. + <_> + 4 0 2 1 2. + 0 + <_> + + <_> + 2 0 12 14 -1. + <_> + 6 0 4 14 3. + 0 + <_> + + <_> + 2 0 20 1 -1. + <_> + 7 0 10 1 2. + 0 + <_> + + <_> + 2 0 22 1 -1. + <_> + 13 0 11 1 2. + 0 + <_> + + <_> + 2 2 22 2 -1. + <_> + 2 2 11 1 2. + <_> + 13 3 11 1 2. + 0 + <_> + + <_> + 2 2 22 10 -1. + <_> + 2 2 11 5 2. + <_> + 13 7 11 5 2. + 0 + <_> + + <_> + 2 3 20 1 -1. + <_> + 7 3 10 1 2. + 0 + <_> + + <_> + 2 3 20 2 -1. + <_> + 2 3 10 1 2. + <_> + 12 4 10 1 2. + 0 + <_> + + <_> + 2 4 3 3 -1. + <_> + 2 5 3 1 3. + 0 + <_> + + <_> + 2 4 20 2 -1. + <_> + 2 4 10 1 2. + <_> + 12 5 10 1 2. + 0 + <_> + + <_> + 2 5 2 3 -1. + <_> + 2 6 2 1 3. + 0 + <_> + + <_> + 2 5 20 2 -1. + <_> + 2 5 10 1 2. + <_> + 12 6 10 1 2. + 0 + <_> + + <_> + 2 6 20 2 -1. + <_> + 2 6 10 1 2. + <_> + 12 7 10 1 2. + 0 + <_> + + <_> + 2 6 21 18 -1. + <_> + 2 15 21 9 2. + 0 + <_> + + <_> + 2 7 6 2 -1. + <_> + 2 7 3 1 2. + <_> + 5 8 3 1 2. + 0 + <_> + + <_> + 2 7 9 6 -1. + <_> + 5 9 3 2 9. + 0 + <_> + + <_> + 2 7 7 3 -1. + <_> + 2 8 7 1 3. + 0 + <_> + + <_> + 2 7 18 2 -1. + <_> + 2 8 18 1 2. + 0 + <_> + + <_> + 2 7 18 3 -1. + <_> + 2 8 18 1 3. + 0 + <_> + + <_> + 2 7 21 4 -1. + <_> + 2 8 21 2 2. + 0 + <_> + + <_> + 2 8 4 2 -1. + <_> + 4 8 2 2 2. + 0 + <_> + + <_> + 2 8 22 2 -1. + <_> + 2 8 11 1 2. + <_> + 13 9 11 1 2. + 0 + <_> + + <_> + 2 9 7 2 -1. + <_> + 2 9 7 1 2. + 1 + <_> + + <_> + 2 9 20 3 -1. + <_> + 2 10 20 1 3. + 0 + <_> + + <_> + 2 11 22 2 -1. + <_> + 2 11 11 1 2. + <_> + 13 12 11 1 2. + 0 + <_> + + <_> + 2 12 22 7 -1. + <_> + 13 12 11 7 2. + 0 + <_> + + <_> + 2 12 19 10 -1. + <_> + 2 17 19 5 2. + 0 + <_> + + <_> + 2 13 3 8 -1. + <_> + 3 13 1 8 3. + 0 + <_> + + <_> + 2 13 20 10 -1. + <_> + 12 13 10 10 2. + 0 + <_> + + <_> + 2 15 6 2 -1. + <_> + 5 15 3 2 2. + 0 + <_> + + <_> + 2 15 6 3 -1. + <_> + 5 15 3 3 2. + 0 + <_> + + <_> + 2 15 20 4 -1. + <_> + 2 15 10 2 2. + <_> + 12 17 10 2 2. + 0 + <_> + + <_> + 2 16 6 6 -1. + <_> + 2 16 3 3 2. + <_> + 5 19 3 3 2. + 0 + <_> + + <_> + 2 17 3 1 -1. + <_> + 3 18 1 1 3. + 1 + <_> + + <_> + 2 18 3 5 -1. + <_> + 3 18 1 5 3. + 0 + <_> + + <_> + 2 21 12 3 -1. + <_> + 8 21 6 3 2. + 0 + <_> + + <_> + 3 2 20 1 -1. + <_> + 3 2 10 1 2. + 1 + <_> + + <_> + 3 3 8 6 -1. + <_> + 5 3 4 6 2. + 0 + <_> + + <_> + 3 4 6 4 -1. + <_> + 3 4 3 2 2. + <_> + 6 6 3 2 2. + 0 + <_> + + <_> + 3 4 18 2 -1. + <_> + 3 4 9 1 2. + <_> + 12 5 9 1 2. + 0 + <_> + + <_> + 3 5 20 2 -1. + <_> + 3 5 10 1 2. + <_> + 13 6 10 1 2. + 0 + <_> + + <_> + 3 5 20 6 -1. + <_> + 3 5 10 3 2. + <_> + 13 8 10 3 2. + 0 + <_> + + <_> + 3 6 3 3 -1. + <_> + 3 7 3 1 3. + 0 + <_> + + <_> + 3 6 16 8 -1. + <_> + 3 8 16 4 2. + 0 + <_> + + <_> + 3 6 19 6 -1. + <_> + 3 8 19 2 3. + 0 + <_> + + <_> + 3 7 5 4 -1. + <_> + 3 8 5 2 2. + 0 + <_> + + <_> + 3 7 18 6 -1. + <_> + 3 7 9 3 2. + <_> + 12 10 9 3 2. + 0 + <_> + + <_> + 3 7 17 6 -1. + <_> + 3 9 17 2 3. + 0 + <_> + + <_> + 3 7 19 2 -1. + <_> + 3 8 19 1 2. + 0 + <_> + + <_> + 3 8 18 4 -1. + <_> + 3 8 9 2 2. + <_> + 12 10 9 2 2. + 0 + <_> + + <_> + 3 8 20 4 -1. + <_> + 3 8 10 2 2. + <_> + 13 10 10 2 2. + 0 + <_> + + <_> + 3 9 3 1 -1. + <_> + 4 9 1 1 3. + 0 + <_> + + <_> + 3 9 3 3 -1. + <_> + 4 10 1 3 3. + 1 + <_> + + <_> + 3 9 8 9 -1. + <_> + 3 12 8 3 3. + 0 + <_> + + <_> + 3 9 20 2 -1. + <_> + 3 9 10 1 2. + <_> + 13 10 10 1 2. + 0 + <_> + + <_> + 3 9 19 9 -1. + <_> + 3 12 19 3 3. + 0 + <_> + + <_> + 3 10 3 1 -1. + <_> + 4 10 1 1 3. + 0 + <_> + + <_> + 3 10 3 1 -1. + <_> + 4 11 1 1 3. + 1 + <_> + + <_> + 3 10 3 2 -1. + <_> + 4 11 1 2 3. + 1 + <_> + + <_> + 3 10 2 4 -1. + <_> + 3 11 2 2 2. + 0 + <_> + + <_> + 3 10 8 3 -1. + <_> + 3 11 8 1 3. + 0 + <_> + + <_> + 3 10 18 4 -1. + <_> + 3 10 9 2 2. + <_> + 12 12 9 2 2. + 0 + <_> + + <_> + 3 11 3 1 -1. + <_> + 4 12 1 1 3. + 1 + <_> + + <_> + 3 11 3 8 -1. + <_> + 4 11 1 8 3. + 0 + <_> + + <_> + 3 11 4 8 -1. + <_> + 3 15 4 4 2. + 0 + <_> + + <_> + 3 11 18 2 -1. + <_> + 3 11 9 1 2. + <_> + 12 12 9 1 2. + 0 + <_> + + <_> + 3 11 10 2 -1. + <_> + 3 11 10 1 2. + 1 + <_> + + <_> + 3 12 3 2 -1. + <_> + 4 13 1 2 3. + 1 + <_> + + <_> + 3 12 8 12 -1. + <_> + 3 16 8 4 3. + 0 + <_> + + <_> + 3 15 4 3 -1. + <_> + 5 15 2 3 2. + 0 + <_> + + <_> + 3 16 3 1 -1. + <_> + 4 17 1 1 3. + 1 + <_> + + <_> + 3 16 6 4 -1. + <_> + 3 16 3 2 2. + <_> + 6 18 3 2 2. + 0 + <_> + + <_> + 3 16 8 6 -1. + <_> + 3 16 4 3 2. + <_> + 7 19 4 3 2. + 0 + <_> + + <_> + 3 20 3 4 -1. + <_> + 4 20 1 4 3. + 0 + <_> + + <_> + 4 0 6 4 -1. + <_> + 6 2 2 4 3. + 1 + <_> + + <_> + 4 2 3 2 -1. + <_> + 5 2 1 2 3. + 0 + <_> + + <_> + 4 2 16 2 -1. + <_> + 4 2 8 1 2. + <_> + 12 3 8 1 2. + 0 + <_> + + <_> + 4 3 6 1 -1. + <_> + 6 3 2 1 3. + 0 + <_> + + <_> + 4 3 9 3 -1. + <_> + 7 3 3 3 3. + 0 + <_> + + <_> + 4 3 16 2 -1. + <_> + 4 3 8 1 2. + <_> + 12 4 8 1 2. + 0 + <_> + + <_> + 4 3 9 6 -1. + <_> + 4 6 9 3 2. + 0 + <_> + + <_> + 4 3 16 8 -1. + <_> + 4 7 16 4 2. + 0 + <_> + + <_> + 4 4 1 4 -1. + <_> + 4 6 1 2 2. + 0 + <_> + + <_> + 4 4 9 4 -1. + <_> + 7 7 3 4 3. + 1 + <_> + + <_> + 4 4 16 2 -1. + <_> + 4 4 8 1 2. + <_> + 12 5 8 1 2. + 0 + <_> + + <_> + 4 4 18 6 -1. + <_> + 4 6 18 2 3. + 0 + <_> + + <_> + 4 4 20 6 -1. + <_> + 4 6 20 2 3. + 0 + <_> + + <_> + 4 5 4 5 -1. + <_> + 6 5 2 5 2. + 0 + <_> + + <_> + 4 5 16 6 -1. + <_> + 4 5 8 3 2. + <_> + 12 8 8 3 2. + 0 + <_> + + <_> + 4 5 15 6 -1. + <_> + 4 7 15 2 3. + 0 + <_> + + <_> + 4 6 1 3 -1. + <_> + 4 7 1 1 3. + 0 + <_> + + <_> + 4 6 2 3 -1. + <_> + 4 7 2 1 3. + 0 + <_> + + <_> + 4 6 6 2 -1. + <_> + 6 6 2 2 3. + 0 + <_> + + <_> + 4 6 3 3 -1. + <_> + 4 7 3 1 3. + 0 + <_> + + <_> + 4 6 6 2 -1. + <_> + 4 6 3 1 2. + <_> + 7 7 3 1 2. + 0 + <_> + + <_> + 4 7 4 3 -1. + <_> + 4 8 4 1 3. + 0 + <_> + + <_> + 4 7 15 6 -1. + <_> + 4 9 15 2 3. + 0 + <_> + + <_> + 4 7 16 6 -1. + <_> + 4 9 16 2 3. + 0 + <_> + + <_> + 4 7 17 3 -1. + <_> + 4 8 17 1 3. + 0 + <_> + + <_> + 4 8 3 3 -1. + <_> + 5 9 1 1 9. + 0 + <_> + + <_> + 4 8 2 3 -1. + <_> + 4 9 2 1 3. + 0 + <_> + + <_> + 4 8 5 4 -1. + <_> + 4 9 5 2 2. + 0 + <_> + + <_> + 4 8 18 4 -1. + <_> + 4 8 9 2 2. + <_> + 13 10 9 2 2. + 0 + <_> + + <_> + 4 9 2 1 -1. + <_> + 5 9 1 1 2. + 0 + <_> + + <_> + 4 9 3 1 -1. + <_> + 5 9 1 1 3. + 0 + <_> + + <_> + 4 9 2 2 -1. + <_> + 4 9 1 1 2. + <_> + 5 10 1 1 2. + 0 + <_> + + <_> + 4 9 2 4 -1. + <_> + 4 9 1 2 2. + <_> + 5 11 1 2 2. + 0 + <_> + + <_> + 4 9 3 2 -1. + <_> + 4 9 3 1 2. + 1 + <_> + + <_> + 4 9 6 6 -1. + <_> + 4 9 3 3 2. + <_> + 7 12 3 3 2. + 0 + <_> + + <_> + 4 9 16 1 -1. + <_> + 8 9 8 1 2. + 0 + <_> + + <_> + 4 9 16 2 -1. + <_> + 4 9 8 1 2. + <_> + 12 10 8 1 2. + 0 + <_> + + <_> + 4 9 18 2 -1. + <_> + 4 9 9 1 2. + <_> + 13 10 9 1 2. + 0 + <_> + + <_> + 4 9 11 4 -1. + <_> + 4 9 11 2 2. + 1 + <_> + + <_> + 4 10 2 2 -1. + <_> + 4 10 1 1 2. + <_> + 5 11 1 1 2. + 0 + <_> + + <_> + 4 10 3 1 -1. + <_> + 5 11 1 1 3. + 1 + <_> + + <_> + 4 10 3 2 -1. + <_> + 5 11 1 2 3. + 1 + <_> + + <_> + 4 10 3 14 -1. + <_> + 5 10 1 14 3. + 0 + <_> + + <_> + 4 10 9 4 -1. + <_> + 4 10 9 2 2. + 1 + <_> + + <_> + 4 10 10 4 -1. + <_> + 4 10 10 2 2. + 1 + <_> + + <_> + 4 10 16 6 -1. + <_> + 4 12 16 2 3. + 0 + <_> + + <_> + 4 11 3 1 -1. + <_> + 5 12 1 1 3. + 1 + <_> + + <_> + 4 11 3 2 -1. + <_> + 5 11 1 2 3. + 0 + <_> + + <_> + 4 11 3 4 -1. + <_> + 5 11 1 4 3. + 0 + <_> + + <_> + 4 11 3 10 -1. + <_> + 4 16 3 5 2. + 0 + <_> + + <_> + 4 12 3 1 -1. + <_> + 5 13 1 1 3. + 1 + <_> + + <_> + 4 12 3 2 -1. + <_> + 5 12 1 2 3. + 0 + <_> + + <_> + 4 12 1 6 -1. + <_> + 4 15 1 3 2. + 0 + <_> + + <_> + 4 12 2 8 -1. + <_> + 4 16 2 4 2. + 0 + <_> + + <_> + 4 13 3 1 -1. + <_> + 5 13 1 1 3. + 0 + <_> + + <_> + 4 13 4 3 -1. + <_> + 6 13 2 3 2. + 0 + <_> + + <_> + 4 13 9 5 -1. + <_> + 7 13 3 5 3. + 0 + <_> + + <_> + 4 14 4 1 -1. + <_> + 6 14 2 1 2. + 0 + <_> + + <_> + 4 15 3 2 -1. + <_> + 5 16 1 2 3. + 1 + <_> + + <_> + 4 15 4 3 -1. + <_> + 6 15 2 3 2. + 0 + <_> + + <_> + 4 15 9 4 -1. + <_> + 7 15 3 4 3. + 0 + <_> + + <_> + 4 15 4 4 -1. + <_> + 4 16 4 2 2. + 0 + <_> + + <_> + 4 17 3 1 -1. + <_> + 5 18 1 1 3. + 1 + <_> + + <_> + 4 18 3 6 -1. + <_> + 5 18 1 6 3. + 0 + <_> + + <_> + 4 20 3 4 -1. + <_> + 5 20 1 4 3. + 0 + <_> + + <_> + 5 0 6 18 -1. + <_> + 7 0 2 18 3. + 0 + <_> + + <_> + 5 2 4 12 -1. + <_> + 7 2 2 12 2. + 0 + <_> + + <_> + 5 2 14 2 -1. + <_> + 5 2 7 2 2. + 1 + <_> + + <_> + 5 2 15 6 -1. + <_> + 5 5 15 3 2. + 0 + <_> + + <_> + 5 3 1 3 -1. + <_> + 4 4 1 1 3. + 1 + <_> + + <_> + 5 3 2 3 -1. + <_> + 4 4 2 1 3. + 1 + <_> + + <_> + 5 3 4 9 -1. + <_> + 7 3 2 9 2. + 0 + <_> + + <_> + 5 3 9 3 -1. + <_> + 8 4 3 1 9. + 0 + <_> + + <_> + 5 3 14 2 -1. + <_> + 5 3 7 1 2. + <_> + 12 4 7 1 2. + 0 + <_> + + <_> + 5 4 2 3 -1. + <_> + 4 5 2 1 3. + 1 + <_> + + <_> + 5 4 16 2 -1. + <_> + 5 4 8 1 2. + <_> + 13 5 8 1 2. + 0 + <_> + + <_> + 5 5 1 3 -1. + <_> + 4 6 1 1 3. + 1 + <_> + + <_> + 5 5 4 9 -1. + <_> + 5 8 4 3 3. + 0 + <_> + + <_> + 5 5 14 2 -1. + <_> + 5 5 7 1 2. + <_> + 12 6 7 1 2. + 0 + <_> + + <_> + 5 5 15 6 -1. + <_> + 5 7 15 2 3. + 0 + <_> + + <_> + 5 6 1 2 -1. + <_> + 5 7 1 1 2. + 0 + <_> + + <_> + 5 6 4 4 -1. + <_> + 5 7 4 2 2. + 0 + <_> + + <_> + 5 6 14 2 -1. + <_> + 5 6 7 1 2. + <_> + 12 7 7 1 2. + 0 + <_> + + <_> + 5 6 14 4 -1. + <_> + 5 7 14 2 2. + 0 + <_> + + <_> + 5 6 14 6 -1. + <_> + 5 8 14 2 3. + 0 + <_> + + <_> + 5 6 15 4 -1. + <_> + 5 7 15 2 2. + 0 + <_> + + <_> + 5 7 1 3 -1. + <_> + 5 8 1 1 3. + 0 + <_> + + <_> + 5 7 4 15 -1. + <_> + 6 7 2 15 2. + 0 + <_> + + <_> + 5 7 4 1 -1. + <_> + 7 7 2 1 2. + 0 + <_> + + <_> + 5 7 3 2 -1. + <_> + 5 8 3 1 2. + 0 + <_> + + <_> + 5 7 3 3 -1. + <_> + 5 8 3 1 3. + 0 + <_> + + <_> + 5 7 3 4 -1. + <_> + 5 8 3 2 2. + 0 + <_> + + <_> + 5 7 3 6 -1. + <_> + 5 9 3 2 3. + 0 + <_> + + <_> + 5 7 4 4 -1. + <_> + 5 9 4 2 2. + 0 + <_> + + <_> + 5 7 4 6 -1. + <_> + 5 9 4 2 3. + 0 + <_> + + <_> + 5 7 16 4 -1. + <_> + 5 7 8 2 2. + <_> + 13 9 8 2 2. + 0 + <_> + + <_> + 5 7 14 2 -1. + <_> + 5 8 14 1 2. + 0 + <_> + + <_> + 5 7 16 6 -1. + <_> + 5 9 16 2 3. + 0 + <_> + + <_> + 5 8 1 3 -1. + <_> + 5 9 1 1 3. + 0 + <_> + + <_> + 5 8 2 2 -1. + <_> + 5 8 1 1 2. + <_> + 6 9 1 1 2. + 0 + <_> + + <_> + 5 8 3 3 -1. + <_> + 4 9 3 1 3. + 1 + <_> + + <_> + 5 8 3 4 -1. + <_> + 4 9 3 2 2. + 1 + <_> + + <_> + 5 8 4 4 -1. + <_> + 5 9 4 2 2. + 0 + <_> + + <_> + 5 8 4 3 -1. + <_> + 4 9 4 1 3. + 1 + <_> + + <_> + 5 8 14 2 -1. + <_> + 5 8 7 1 2. + <_> + 12 9 7 1 2. + 0 + <_> + + <_> + 5 8 16 2 -1. + <_> + 5 8 8 1 2. + <_> + 13 9 8 1 2. + 0 + <_> + + <_> + 5 8 13 16 -1. + <_> + 5 12 13 8 2. + 0 + <_> + + <_> + 5 9 4 4 -1. + <_> + 7 9 2 4 2. + 0 + <_> + + <_> + 5 9 4 3 -1. + <_> + 5 10 4 1 3. + 0 + <_> + + <_> + 5 9 4 4 -1. + <_> + 5 9 4 2 2. + 1 + <_> + + <_> + 5 9 14 2 -1. + <_> + 5 9 7 1 2. + <_> + 12 10 7 1 2. + 0 + <_> + + <_> + 5 9 16 2 -1. + <_> + 5 9 8 1 2. + <_> + 13 10 8 1 2. + 0 + <_> + + <_> + 5 9 15 3 -1. + <_> + 5 10 15 1 3. + 0 + <_> + + <_> + 5 10 2 2 -1. + <_> + 5 10 1 1 2. + <_> + 6 11 1 1 2. + 0 + <_> + + <_> + 5 10 3 1 -1. + <_> + 6 11 1 1 3. + 1 + <_> + + <_> + 5 10 3 14 -1. + <_> + 6 10 1 14 3. + 0 + <_> + + <_> + 5 10 4 3 -1. + <_> + 7 10 2 3 2. + 0 + <_> + + <_> + 5 10 12 4 -1. + <_> + 9 10 4 4 3. + 0 + <_> + + <_> + 5 10 14 3 -1. + <_> + 5 11 14 1 3. + 0 + <_> + + <_> + 5 10 16 8 -1. + <_> + 5 12 16 4 2. + 0 + <_> + + <_> + 5 11 3 2 -1. + <_> + 6 11 1 2 3. + 0 + <_> + + <_> + 5 11 9 4 -1. + <_> + 5 11 9 2 2. + 1 + <_> + + <_> + 5 12 3 2 -1. + <_> + 6 12 1 2 3. + 0 + <_> + + <_> + 5 12 14 2 -1. + <_> + 5 12 7 1 2. + <_> + 12 13 7 1 2. + 0 + <_> + + <_> + 5 13 14 2 -1. + <_> + 5 13 7 1 2. + <_> + 12 14 7 1 2. + 0 + <_> + + <_> + 5 13 14 10 -1. + <_> + 5 18 14 5 2. + 0 + <_> + + <_> + 5 15 4 1 -1. + <_> + 6 16 2 1 2. + 1 + <_> + + <_> + 5 15 3 2 -1. + <_> + 6 16 1 2 3. + 1 + <_> + + <_> + 5 19 3 4 -1. + <_> + 6 19 1 4 3. + 0 + <_> + + <_> + 5 20 3 4 -1. + <_> + 6 20 1 4 3. + 0 + <_> + + <_> + 6 1 6 11 -1. + <_> + 8 1 2 11 3. + 0 + <_> + + <_> + 6 1 12 2 -1. + <_> + 6 1 6 1 2. + <_> + 12 2 6 1 2. + 0 + <_> + + <_> + 6 2 1 3 -1. + <_> + 5 3 1 1 3. + 1 + <_> + + <_> + 6 2 4 6 -1. + <_> + 6 2 4 3 2. + 1 + <_> + + <_> + 6 2 12 6 -1. + <_> + 6 2 6 6 2. + 1 + <_> + + <_> + 6 3 1 2 -1. + <_> + 6 3 1 1 2. + 1 + <_> + + <_> + 6 3 1 3 -1. + <_> + 5 4 1 1 3. + 1 + <_> + + <_> + 6 3 6 1 -1. + <_> + 8 3 2 1 3. + 0 + <_> + + <_> + 6 3 18 21 -1. + <_> + 15 3 9 21 2. + 0 + <_> + + <_> + 6 4 1 3 -1. + <_> + 5 5 1 1 3. + 1 + <_> + + <_> + 6 4 4 3 -1. + <_> + 6 5 4 1 3. + 0 + <_> + + <_> + 6 4 5 4 -1. + <_> + 5 5 5 2 2. + 1 + <_> + + <_> + 6 4 6 3 -1. + <_> + 6 5 6 1 3. + 0 + <_> + + <_> + 6 5 1 3 -1. + <_> + 5 6 1 1 3. + 1 + <_> + + <_> + 6 5 3 2 -1. + <_> + 7 5 1 2 3. + 0 + <_> + + <_> + 6 5 3 3 -1. + <_> + 7 5 1 3 3. + 0 + <_> + + <_> + 6 5 12 2 -1. + <_> + 6 5 6 1 2. + <_> + 12 6 6 1 2. + 0 + <_> + + <_> + 6 6 10 2 -1. + <_> + 6 6 5 1 2. + <_> + 11 7 5 1 2. + 0 + <_> + + <_> + 6 6 5 3 -1. + <_> + 5 7 5 1 3. + 1 + <_> + + <_> + 6 7 1 3 -1. + <_> + 6 8 1 1 3. + 0 + <_> + + <_> + 6 7 1 6 -1. + <_> + 6 9 1 2 3. + 0 + <_> + + <_> + 6 7 2 2 -1. + <_> + 6 8 2 1 2. + 0 + <_> + + <_> + 6 7 2 3 -1. + <_> + 6 8 2 1 3. + 0 + <_> + + <_> + 6 7 3 6 -1. + <_> + 6 9 3 2 3. + 0 + <_> + + <_> + 6 7 12 2 -1. + <_> + 6 7 6 1 2. + <_> + 12 8 6 1 2. + 0 + <_> + + <_> + 6 8 3 1 -1. + <_> + 7 9 1 1 3. + 1 + <_> + + <_> + 6 8 2 3 -1. + <_> + 6 9 2 1 3. + 0 + <_> + + <_> + 6 8 2 3 -1. + <_> + 5 9 2 1 3. + 1 + <_> + + <_> + 6 8 3 4 -1. + <_> + 6 9 3 2 2. + 0 + <_> + + <_> + 6 8 3 3 -1. + <_> + 5 9 3 1 3. + 1 + <_> + + <_> + 6 8 12 3 -1. + <_> + 9 8 6 3 2. + 0 + <_> + + <_> + 6 8 12 2 -1. + <_> + 6 8 6 1 2. + <_> + 12 9 6 1 2. + 0 + <_> + + <_> + 6 8 13 6 -1. + <_> + 6 10 13 2 3. + 0 + <_> + + <_> + 6 9 2 2 -1. + <_> + 6 9 1 2 2. + 1 + <_> + + <_> + 6 9 12 1 -1. + <_> + 9 9 6 1 2. + 0 + <_> + + <_> + 6 9 12 2 -1. + <_> + 9 9 6 2 2. + 0 + <_> + + <_> + 6 9 12 3 -1. + <_> + 9 9 6 3 2. + 0 + <_> + + <_> + 6 9 12 2 -1. + <_> + 10 9 4 2 3. + 0 + <_> + + <_> + 6 9 12 2 -1. + <_> + 6 9 6 1 2. + <_> + 12 10 6 1 2. + 0 + <_> + + <_> + 6 9 12 3 -1. + <_> + 6 10 12 1 3. + 0 + <_> + + <_> + 6 10 1 3 -1. + <_> + 6 11 1 1 3. + 0 + <_> + + <_> + 6 10 2 3 -1. + <_> + 7 10 1 3 2. + 0 + <_> + + <_> + 6 10 2 4 -1. + <_> + 7 10 1 4 2. + 0 + <_> + + <_> + 6 10 2 3 -1. + <_> + 6 11 2 1 3. + 0 + <_> + + <_> + 6 10 2 4 -1. + <_> + 6 11 2 2 2. + 0 + <_> + + <_> + 6 10 3 3 -1. + <_> + 6 11 3 1 3. + 0 + <_> + + <_> + 6 10 12 1 -1. + <_> + 9 10 6 1 2. + 0 + <_> + + <_> + 6 10 12 2 -1. + <_> + 6 10 6 1 2. + <_> + 12 11 6 1 2. + 0 + <_> + + <_> + 6 10 13 3 -1. + <_> + 6 11 13 1 3. + 0 + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + 0 + <_> + + <_> + 6 11 3 2 -1. + <_> + 6 12 3 1 2. + 0 + <_> + + <_> + 6 11 3 3 -1. + <_> + 6 12 3 1 3. + 0 + <_> + + <_> + 6 11 13 3 -1. + <_> + 6 12 13 1 3. + 0 + <_> + + <_> + 6 13 7 4 -1. + <_> + 6 13 7 2 2. + 1 + <_> + + <_> + 6 14 1 3 -1. + <_> + 6 15 1 1 3. + 0 + <_> + + <_> + 6 15 3 4 -1. + <_> + 7 16 1 4 3. + 1 + <_> + + <_> + 6 15 6 3 -1. + <_> + 6 15 3 3 2. + 1 + <_> + + <_> + 6 18 3 1 -1. + <_> + 7 19 1 1 3. + 1 + <_> + + <_> + 6 19 3 5 -1. + <_> + 7 19 1 5 3. + 0 + <_> + + <_> + 7 0 3 4 -1. + <_> + 7 0 3 2 2. + 1 + <_> + + <_> + 7 0 4 2 -1. + <_> + 7 0 4 1 2. + 1 + <_> + + <_> + 7 0 10 1 -1. + <_> + 12 0 5 1 2. + 0 + <_> + + <_> + 7 1 2 6 -1. + <_> + 7 1 1 3 2. + <_> + 8 4 1 3 2. + 0 + <_> + + <_> + 7 1 10 1 -1. + <_> + 12 1 5 1 2. + 0 + <_> + + <_> + 7 2 1 3 -1. + <_> + 6 3 1 1 3. + 1 + <_> + + <_> + 7 2 1 4 -1. + <_> + 6 3 1 2 2. + 1 + <_> + + <_> + 7 2 3 4 -1. + <_> + 6 3 3 2 2. + 1 + <_> + + <_> + 7 2 6 3 -1. + <_> + 7 3 6 1 3. + 0 + <_> + + <_> + 7 2 13 10 -1. + <_> + 7 7 13 5 2. + 0 + <_> + + <_> + 7 3 1 3 -1. + <_> + 6 4 1 1 3. + 1 + <_> + + <_> + 7 3 2 4 -1. + <_> + 6 4 2 2 2. + 1 + <_> + + <_> + 7 3 4 2 -1. + <_> + 7 3 4 1 2. + 1 + <_> + + <_> + 7 4 3 3 -1. + <_> + 8 4 1 3 3. + 0 + <_> + + <_> + 7 4 10 2 -1. + <_> + 7 4 5 1 2. + <_> + 12 5 5 1 2. + 0 + <_> + + <_> + 7 5 3 2 -1. + <_> + 8 5 1 2 3. + 0 + <_> + + <_> + 7 5 3 3 -1. + <_> + 8 5 1 3 3. + 0 + <_> + + <_> + 7 5 3 5 -1. + <_> + 8 5 1 5 3. + 0 + <_> + + <_> + 7 6 3 1 -1. + <_> + 8 6 1 1 3. + 0 + <_> + + <_> + 7 6 1 4 -1. + <_> + 7 6 1 2 2. + 1 + <_> + + <_> + 7 6 6 10 -1. + <_> + 9 6 2 10 3. + 0 + <_> + + <_> + 7 6 10 2 -1. + <_> + 7 6 5 1 2. + <_> + 12 7 5 1 2. + 0 + <_> + + <_> + 7 6 5 3 -1. + <_> + 6 7 5 1 3. + 1 + <_> + + <_> + 7 6 8 4 -1. + <_> + 6 7 8 2 2. + 1 + <_> + + <_> + 7 7 1 3 -1. + <_> + 7 8 1 1 3. + 0 + <_> + + <_> + 7 7 2 2 -1. + <_> + 7 7 1 1 2. + <_> + 8 8 1 1 2. + 0 + <_> + + <_> + 7 8 1 3 -1. + <_> + 7 9 1 1 3. + 0 + <_> + + <_> + 7 8 2 2 -1. + <_> + 7 8 1 1 2. + <_> + 8 9 1 1 2. + 0 + <_> + + <_> + 7 8 2 2 -1. + <_> + 7 8 1 2 2. + 1 + <_> + + <_> + 7 8 12 7 -1. + <_> + 11 8 4 7 3. + 0 + <_> + + <_> + 7 8 10 2 -1. + <_> + 7 8 5 1 2. + <_> + 12 9 5 1 2. + 0 + <_> + + <_> + 7 9 1 2 -1. + <_> + 7 10 1 1 2. + 0 + <_> + + <_> + 7 9 2 3 -1. + <_> + 7 9 1 3 2. + 1 + <_> + + <_> + 7 9 2 3 -1. + <_> + 7 10 2 1 3. + 0 + <_> + + <_> + 7 9 6 10 -1. + <_> + 7 9 3 5 2. + <_> + 10 14 3 5 2. + 0 + <_> + + <_> + 7 9 10 2 -1. + <_> + 7 9 5 1 2. + <_> + 12 10 5 1 2. + 0 + <_> + + <_> + 7 10 3 1 -1. + <_> + 8 10 1 1 3. + 0 + <_> + + <_> + 7 10 1 3 -1. + <_> + 7 11 1 1 3. + 0 + <_> + + <_> + 7 10 2 3 -1. + <_> + 7 11 2 1 3. + 0 + <_> + + <_> + 7 10 6 5 -1. + <_> + 9 10 2 5 3. + 0 + <_> + + <_> + 7 10 9 4 -1. + <_> + 10 10 3 4 3. + 0 + <_> + + <_> + 7 10 10 2 -1. + <_> + 7 10 5 1 2. + <_> + 12 11 5 1 2. + 0 + <_> + + <_> + 7 11 1 2 -1. + <_> + 7 12 1 1 2. + 0 + <_> + + <_> + 7 15 5 4 -1. + <_> + 6 16 5 2 2. + 1 + <_> + + <_> + 7 16 6 2 -1. + <_> + 9 18 2 2 3. + 1 + <_> + + <_> + 7 16 4 2 -1. + <_> + 7 16 4 1 2. + 1 + <_> + + <_> + 7 16 4 4 -1. + <_> + 6 17 4 2 2. + 1 + <_> + + <_> + 7 17 3 1 -1. + <_> + 8 18 1 1 3. + 1 + <_> + + <_> + 7 17 1 4 -1. + <_> + 7 19 1 2 2. + 0 + <_> + + <_> + 7 17 3 6 -1. + <_> + 7 20 3 3 2. + 0 + <_> + + <_> + 7 17 4 3 -1. + <_> + 6 18 4 1 3. + 1 + <_> + + <_> + 7 17 5 2 -1. + <_> + 7 17 5 1 2. + 1 + <_> + + <_> + 7 18 3 1 -1. + <_> + 8 19 1 1 3. + 1 + <_> + + <_> + 7 19 3 1 -1. + <_> + 8 20 1 1 3. + 1 + <_> + + <_> + 7 19 3 5 -1. + <_> + 8 19 1 5 3. + 0 + <_> + + <_> + 7 20 3 1 -1. + <_> + 8 21 1 1 3. + 1 + <_> + + <_> + 7 20 9 4 -1. + <_> + 7 22 9 2 2. + 0 + <_> + + <_> + 7 20 10 4 -1. + <_> + 7 21 10 2 2. + 0 + <_> + + <_> + 7 20 10 4 -1. + <_> + 7 22 10 2 2. + 0 + <_> + + <_> + 8 0 8 1 -1. + <_> + 12 0 4 1 2. + 0 + <_> + + <_> + 8 0 7 4 -1. + <_> + 8 2 7 2 2. + 0 + <_> + + <_> + 8 0 16 6 -1. + <_> + 8 0 8 3 2. + <_> + 16 3 8 3 2. + 0 + <_> + + <_> + 8 0 8 10 -1. + <_> + 8 5 8 5 2. + 0 + <_> + + <_> + 8 0 16 10 -1. + <_> + 8 0 8 5 2. + <_> + 16 5 8 5 2. + 0 + <_> + + <_> + 8 0 9 4 -1. + <_> + 8 1 9 2 2. + 0 + <_> + + <_> + 8 0 9 10 -1. + <_> + 8 5 9 5 2. + 0 + <_> + + <_> + 8 1 8 8 -1. + <_> + 8 5 8 4 2. + 0 + <_> + + <_> + 8 1 12 10 -1. + <_> + 8 6 12 5 2. + 0 + <_> + + <_> + 8 2 3 3 -1. + <_> + 9 2 1 3 3. + 0 + <_> + + <_> + 8 2 2 4 -1. + <_> + 7 3 2 2 2. + 1 + <_> + + <_> + 8 2 2 6 -1. + <_> + 6 4 2 2 3. + 1 + <_> + + <_> + 8 3 3 8 -1. + <_> + 9 3 1 8 3. + 0 + <_> + + <_> + 8 4 8 2 -1. + <_> + 8 4 4 1 2. + <_> + 12 5 4 1 2. + 0 + <_> + + <_> + 8 4 7 15 -1. + <_> + 8 9 7 5 3. + 0 + <_> + + <_> + 8 5 2 1 -1. + <_> + 8 5 1 1 2. + 1 + <_> + + <_> + 8 5 3 2 -1. + <_> + 9 5 1 2 3. + 0 + <_> + + <_> + 8 5 2 5 -1. + <_> + 9 5 1 5 2. + 0 + <_> + + <_> + 8 5 2 6 -1. + <_> + 9 5 1 6 2. + 0 + <_> + + <_> + 8 5 3 6 -1. + <_> + 9 5 1 6 3. + 0 + <_> + + <_> + 8 5 2 7 -1. + <_> + 9 5 1 7 2. + 0 + <_> + + <_> + 8 5 3 7 -1. + <_> + 9 6 1 7 3. + 1 + <_> + + <_> + 8 5 3 8 -1. + <_> + 9 5 1 8 3. + 0 + <_> + + <_> + 8 5 3 6 -1. + <_> + 8 5 3 3 2. + 1 + <_> + + <_> + 8 5 4 6 -1. + <_> + 6 7 4 2 3. + 1 + <_> + + <_> + 8 5 10 2 -1. + <_> + 8 5 5 1 2. + <_> + 13 6 5 1 2. + 0 + <_> + + <_> + 8 5 5 3 -1. + <_> + 7 6 5 1 3. + 1 + <_> + + <_> + 8 6 3 6 -1. + <_> + 9 6 1 6 3. + 0 + <_> + + <_> + 8 6 3 4 -1. + <_> + 7 7 3 2 2. + 1 + <_> + + <_> + 8 6 4 2 -1. + <_> + 8 6 4 1 2. + 1 + <_> + + <_> + 8 6 4 3 -1. + <_> + 7 7 4 1 3. + 1 + <_> + + <_> + 8 6 4 4 -1. + <_> + 7 7 4 2 2. + 1 + <_> + + <_> + 8 6 10 2 -1. + <_> + 8 6 5 1 2. + <_> + 13 7 5 1 2. + 0 + <_> + + <_> + 8 7 3 3 -1. + <_> + 7 8 3 1 3. + 1 + <_> + + <_> + 8 7 3 4 -1. + <_> + 7 8 3 2 2. + 1 + <_> + + <_> + 8 7 9 5 -1. + <_> + 11 10 3 5 3. + 1 + <_> + + <_> + 8 7 9 8 -1. + <_> + 11 10 3 8 3. + 1 + <_> + + <_> + 8 7 4 2 -1. + <_> + 8 7 4 1 2. + 1 + <_> + + <_> + 8 7 4 3 -1. + <_> + 7 8 4 1 3. + 1 + <_> + + <_> + 8 7 5 2 -1. + <_> + 8 7 5 1 2. + 1 + <_> + + <_> + 8 7 8 2 -1. + <_> + 8 7 8 1 2. + 1 + <_> + + <_> + 8 7 10 12 -1. + <_> + 8 13 10 6 2. + 0 + <_> + + <_> + 8 8 2 2 -1. + <_> + 8 8 1 1 2. + <_> + 9 9 1 1 2. + 0 + <_> + + <_> + 8 10 2 1 -1. + <_> + 9 10 1 1 2. + 0 + <_> + + <_> + 8 10 3 1 -1. + <_> + 9 10 1 1 3. + 0 + <_> + + <_> + 8 10 2 2 -1. + <_> + 8 10 1 1 2. + <_> + 9 11 1 1 2. + 0 + <_> + + <_> + 8 10 2 2 -1. + <_> + 9 10 1 2 2. + 0 + <_> + + <_> + 8 10 3 2 -1. + <_> + 9 10 1 2 3. + 0 + <_> + + <_> + 8 10 4 8 -1. + <_> + 8 10 2 4 2. + <_> + 10 14 2 4 2. + 0 + <_> + + <_> + 8 10 8 2 -1. + <_> + 8 10 4 1 2. + <_> + 12 11 4 1 2. + 0 + <_> + + <_> + 8 10 15 12 -1. + <_> + 13 14 5 4 9. + 0 + <_> + + <_> + 8 11 2 2 -1. + <_> + 8 11 1 1 2. + <_> + 9 12 1 1 2. + 0 + <_> + + <_> + 8 13 9 3 -1. + <_> + 11 13 3 3 3. + 0 + <_> + + <_> + 8 15 9 6 -1. + <_> + 11 15 3 6 3. + 0 + <_> + + <_> + 8 15 8 6 -1. + <_> + 8 17 8 2 3. + 0 + <_> + + <_> + 8 16 8 2 -1. + <_> + 10 16 4 2 2. + 0 + <_> + + <_> + 8 16 8 3 -1. + <_> + 10 16 4 3 2. + 0 + <_> + + <_> + 8 17 3 3 -1. + <_> + 9 18 1 3 3. + 1 + <_> + + <_> + 8 17 8 3 -1. + <_> + 10 17 4 3 2. + 0 + <_> + + <_> + 8 17 9 6 -1. + <_> + 8 19 9 2 3. + 0 + <_> + + <_> + 8 18 3 6 -1. + <_> + 9 18 1 6 3. + 0 + <_> + + <_> + 8 19 3 1 -1. + <_> + 9 20 1 1 3. + 1 + <_> + + <_> + 8 19 3 4 -1. + <_> + 9 19 1 4 3. + 0 + <_> + + <_> + 8 19 7 3 -1. + <_> + 8 20 7 1 3. + 0 + <_> + + <_> + 8 19 9 4 -1. + <_> + 8 20 9 2 2. + 0 + <_> + + <_> + 8 20 3 3 -1. + <_> + 9 20 1 3 3. + 0 + <_> + + <_> + 8 20 16 4 -1. + <_> + 8 20 8 2 2. + <_> + 16 22 8 2 2. + 0 + <_> + + <_> + 8 21 3 3 -1. + <_> + 9 21 1 3 3. + 0 + <_> + + <_> + 9 0 1 2 -1. + <_> + 9 1 1 1 2. + 0 + <_> + + <_> + 9 0 3 6 -1. + <_> + 7 2 3 2 3. + 1 + <_> + + <_> + 9 0 6 3 -1. + <_> + 12 0 3 3 2. + 0 + <_> + + <_> + 9 0 6 9 -1. + <_> + 9 0 3 9 2. + 1 + <_> + + <_> + 9 0 8 9 -1. + <_> + 9 0 4 9 2. + 1 + <_> + + <_> + 9 0 5 4 -1. + <_> + 9 2 5 2 2. + 0 + <_> + + <_> + 9 0 5 8 -1. + <_> + 9 4 5 4 2. + 0 + <_> + + <_> + 9 0 14 12 -1. + <_> + 9 0 7 6 2. + <_> + 16 6 7 6 2. + 0 + <_> + + <_> + 9 0 8 10 -1. + <_> + 9 5 8 5 2. + 0 + <_> + + <_> + 9 0 15 18 -1. + <_> + 9 6 15 6 3. + 0 + <_> + + <_> + 9 1 2 8 -1. + <_> + 9 5 2 4 2. + 0 + <_> + + <_> + 9 1 3 4 -1. + <_> + 8 2 3 2 2. + 1 + <_> + + <_> + 9 2 2 2 -1. + <_> + 10 2 1 2 2. + 0 + <_> + + <_> + 9 2 1 6 -1. + <_> + 9 5 1 3 2. + 0 + <_> + + <_> + 9 2 3 10 -1. + <_> + 10 2 1 10 3. + 0 + <_> + + <_> + 9 2 8 4 -1. + <_> + 11 4 4 4 2. + 1 + <_> + + <_> + 9 2 6 2 -1. + <_> + 9 2 3 1 2. + <_> + 12 3 3 1 2. + 0 + <_> + + <_> + 9 2 7 8 -1. + <_> + 9 6 7 4 2. + 0 + <_> + + <_> + 9 3 3 7 -1. + <_> + 10 4 1 7 3. + 1 + <_> + + <_> + 9 3 3 12 -1. + <_> + 10 3 1 12 3. + 0 + <_> + + <_> + 9 3 6 7 -1. + <_> + 11 3 2 7 3. + 0 + <_> + + <_> + 9 3 12 3 -1. + <_> + 13 4 4 1 9. + 0 + <_> + + <_> + 9 3 11 4 -1. + <_> + 8 4 11 2 2. + 1 + <_> + + <_> + 9 4 3 8 -1. + <_> + 10 5 1 8 3. + 1 + <_> + + <_> + 9 5 2 1 -1. + <_> + 9 5 1 1 2. + 1 + <_> + + <_> + 9 5 3 4 -1. + <_> + 10 5 1 4 3. + 0 + <_> + + <_> + 9 5 3 6 -1. + <_> + 10 5 1 6 3. + 0 + <_> + + <_> + 9 5 6 4 -1. + <_> + 11 5 2 4 3. + 0 + <_> + + <_> + 9 5 3 3 -1. + <_> + 9 6 3 1 3. + 0 + <_> + + <_> + 9 5 4 3 -1. + <_> + 8 6 4 1 3. + 1 + <_> + + <_> + 9 6 3 2 -1. + <_> + 10 7 1 2 3. + 1 + <_> + + <_> + 9 6 2 6 -1. + <_> + 7 8 2 2 3. + 1 + <_> + + <_> + 9 6 4 3 -1. + <_> + 9 7 4 1 3. + 0 + <_> + + <_> + 9 6 4 3 -1. + <_> + 8 7 4 1 3. + 1 + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 7 1 3 2. + 1 + <_> + + <_> + 9 7 2 2 -1. + <_> + 9 7 2 1 2. + 1 + <_> + + <_> + 9 7 6 2 -1. + <_> + 9 7 3 1 2. + <_> + 12 8 3 1 2. + 0 + <_> + + <_> + 9 8 2 3 -1. + <_> + 8 9 2 1 3. + 1 + <_> + + <_> + 9 8 6 5 -1. + <_> + 11 10 2 5 3. + 1 + <_> + + <_> + 9 8 3 3 -1. + <_> + 9 9 3 1 3. + 0 + <_> + + <_> + 9 8 9 9 -1. + <_> + 12 8 3 9 3. + 0 + <_> + + <_> + 9 9 2 12 -1. + <_> + 9 9 1 6 2. + <_> + 10 15 1 6 2. + 0 + <_> + + <_> + 9 9 6 3 -1. + <_> + 11 11 2 3 3. + 1 + <_> + + <_> + 9 9 6 4 -1. + <_> + 11 11 2 4 3. + 1 + <_> + + <_> + 9 9 3 3 -1. + <_> + 9 10 3 1 3. + 0 + <_> + + <_> + 9 9 6 4 -1. + <_> + 12 9 3 4 2. + 0 + <_> + + <_> + 9 10 3 3 -1. + <_> + 9 11 3 1 3. + 0 + <_> + + <_> + 9 10 5 3 -1. + <_> + 9 11 5 1 3. + 0 + <_> + + <_> + 9 10 14 3 -1. + <_> + 9 11 14 1 3. + 0 + <_> + + <_> + 9 13 4 6 -1. + <_> + 9 13 2 3 2. + <_> + 11 16 2 3 2. + 0 + <_> + + <_> + 9 13 9 4 -1. + <_> + 12 13 3 4 3. + 0 + <_> + + <_> + 9 16 6 5 -1. + <_> + 11 16 2 5 3. + 0 + <_> + + <_> + 9 17 6 2 -1. + <_> + 11 17 2 2 3. + 0 + <_> + + <_> + 9 18 3 3 -1. + <_> + 10 19 1 3 3. + 1 + <_> + + <_> + 9 19 3 2 -1. + <_> + 10 20 1 2 3. + 1 + <_> + + <_> + 9 19 6 3 -1. + <_> + 9 20 6 1 3. + 0 + <_> + + <_> + 9 19 7 3 -1. + <_> + 9 20 7 1 3. + 0 + <_> + + <_> + 9 20 3 3 -1. + <_> + 10 20 1 3 3. + 0 + <_> + + <_> + 9 20 5 3 -1. + <_> + 9 21 5 1 3. + 0 + <_> + + <_> + 9 20 6 3 -1. + <_> + 9 21 6 1 3. + 0 + <_> + + <_> + 9 20 7 3 -1. + <_> + 9 21 7 1 3. + 0 + <_> + + <_> + 9 20 7 4 -1. + <_> + 9 22 7 2 2. + 0 + <_> + + <_> + 9 21 3 3 -1. + <_> + 10 21 1 3 3. + 0 + <_> + + <_> + 9 21 8 2 -1. + <_> + 9 22 8 1 2. + 0 + <_> + + <_> + 10 0 4 1 -1. + <_> + 12 0 2 1 2. + 0 + <_> + + <_> + 10 0 3 12 -1. + <_> + 10 4 3 4 3. + 0 + <_> + + <_> + 10 0 4 8 -1. + <_> + 10 4 4 4 2. + 0 + <_> + + <_> + 10 0 14 10 -1. + <_> + 10 0 7 5 2. + <_> + 17 5 7 5 2. + 0 + <_> + + <_> + 10 2 4 6 -1. + <_> + 11 2 2 6 2. + 0 + <_> + + <_> + 10 2 6 10 -1. + <_> + 10 2 3 10 2. + 1 + <_> + + <_> + 10 3 2 5 -1. + <_> + 11 3 1 5 2. + 0 + <_> + + <_> + 10 4 3 5 -1. + <_> + 11 4 1 5 3. + 0 + <_> + + <_> + 10 4 4 19 -1. + <_> + 12 4 2 19 2. + 0 + <_> + + <_> + 10 5 1 2 -1. + <_> + 10 5 1 1 2. + 1 + <_> + + <_> + 10 5 4 3 -1. + <_> + 11 5 2 3 2. + 0 + <_> + + <_> + 10 5 3 3 -1. + <_> + 10 6 3 1 3. + 0 + <_> + + <_> + 10 6 1 3 -1. + <_> + 10 7 1 1 3. + 0 + <_> + + <_> + 10 6 4 6 -1. + <_> + 12 6 2 6 2. + 0 + <_> + + <_> + 10 7 4 3 -1. + <_> + 10 8 4 1 3. + 0 + <_> + + <_> + 10 8 1 2 -1. + <_> + 10 8 1 1 2. + 1 + <_> + + <_> + 10 8 2 2 -1. + <_> + 10 9 2 1 2. + 0 + <_> + + <_> + 10 9 1 3 -1. + <_> + 9 10 1 1 3. + 1 + <_> + + <_> + 10 9 2 3 -1. + <_> + 11 9 1 3 2. + 0 + <_> + + <_> + 10 9 2 12 -1. + <_> + 10 9 1 6 2. + <_> + 11 15 1 6 2. + 0 + <_> + + <_> + 10 9 2 3 -1. + <_> + 10 10 2 1 3. + 0 + <_> + + <_> + 10 9 2 3 -1. + <_> + 9 10 2 1 3. + 1 + <_> + + <_> + 10 10 3 3 -1. + <_> + 9 11 3 1 3. + 1 + <_> + + <_> + 10 11 5 3 -1. + <_> + 10 12 5 1 3. + 0 + <_> + + <_> + 10 12 14 3 -1. + <_> + 10 13 14 1 3. + 0 + <_> + + <_> + 10 17 4 2 -1. + <_> + 11 17 2 2 2. + 0 + <_> + + <_> + 10 17 2 6 -1. + <_> + 10 17 1 3 2. + <_> + 11 20 1 3 2. + 0 + <_> + + <_> + 10 17 3 3 -1. + <_> + 10 18 3 1 3. + 0 + <_> + + <_> + 10 17 6 2 -1. + <_> + 13 17 3 2 2. + 0 + <_> + + <_> + 10 18 5 4 -1. + <_> + 10 19 5 2 2. + 0 + <_> + + <_> + 10 19 5 4 -1. + <_> + 10 20 5 2 2. + 0 + <_> + + <_> + 10 19 6 3 -1. + <_> + 10 20 6 1 3. + 0 + <_> + + <_> + 10 20 3 4 -1. + <_> + 11 20 1 4 3. + 0 + <_> + + <_> + 10 20 6 4 -1. + <_> + 12 20 2 4 3. + 0 + <_> + + <_> + 10 20 5 4 -1. + <_> + 10 21 5 2 2. + 0 + <_> + + <_> + 10 20 5 4 -1. + <_> + 10 22 5 2 2. + 0 + <_> + + <_> + 10 20 14 4 -1. + <_> + 10 20 7 2 2. + <_> + 17 22 7 2 2. + 0 + <_> + + <_> + 10 21 3 3 -1. + <_> + 11 21 1 3 3. + 0 + <_> + + <_> + 10 21 5 2 -1. + <_> + 10 22 5 1 2. + 0 + <_> + + <_> + 10 22 3 2 -1. + <_> + 11 22 1 2 3. + 0 + <_> + + <_> + 10 23 3 1 -1. + <_> + 11 23 1 1 3. + 0 + <_> + + <_> + 11 0 1 2 -1. + <_> + 11 0 1 1 2. + 1 + <_> + + <_> + 11 0 1 4 -1. + <_> + 10 1 1 2 2. + 1 + <_> + + <_> + 11 0 4 1 -1. + <_> + 13 0 2 1 2. + 0 + <_> + + <_> + 11 1 1 2 -1. + <_> + 11 1 1 1 2. + 1 + <_> + + <_> + 11 2 8 9 -1. + <_> + 13 4 4 9 2. + 1 + <_> + + <_> + 11 3 3 3 -1. + <_> + 12 3 1 3 3. + 0 + <_> + + <_> + 11 3 3 4 -1. + <_> + 12 3 1 4 3. + 0 + <_> + + <_> + 11 4 3 4 -1. + <_> + 12 4 1 4 3. + 0 + <_> + + <_> + 11 4 3 5 -1. + <_> + 12 4 1 5 3. + 0 + <_> + + <_> + 11 4 3 7 -1. + <_> + 12 5 1 7 3. + 1 + <_> + + <_> + 11 4 4 1 -1. + <_> + 13 4 2 1 2. + 0 + <_> + + <_> + 11 4 2 3 -1. + <_> + 11 5 2 1 3. + 0 + <_> + + <_> + 11 4 4 3 -1. + <_> + 11 5 4 1 3. + 0 + <_> + + <_> + 11 5 3 1 -1. + <_> + 12 5 1 1 3. + 0 + <_> + + <_> + 11 5 4 11 -1. + <_> + 13 5 2 11 2. + 0 + <_> + + <_> + 11 6 2 3 -1. + <_> + 11 7 2 1 3. + 0 + <_> + + <_> + 11 6 4 3 -1. + <_> + 11 7 4 1 3. + 0 + <_> + + <_> + 11 7 1 3 -1. + <_> + 11 8 1 1 3. + 0 + <_> + + <_> + 11 7 2 3 -1. + <_> + 11 8 2 1 3. + 0 + <_> + + <_> + 11 7 2 6 -1. + <_> + 11 7 2 3 2. + 1 + <_> + + <_> + 11 7 3 3 -1. + <_> + 11 8 3 1 3. + 0 + <_> + + <_> + 11 7 3 8 -1. + <_> + 11 7 3 4 2. + 1 + <_> + + <_> + 11 8 1 3 -1. + <_> + 11 9 1 1 3. + 0 + <_> + + <_> + 11 8 2 3 -1. + <_> + 11 9 2 1 3. + 0 + <_> + + <_> + 11 9 3 3 -1. + <_> + 11 10 3 1 3. + 0 + <_> + + <_> + 11 10 4 5 -1. + <_> + 12 11 2 5 2. + 1 + <_> + + <_> + 11 10 6 3 -1. + <_> + 13 10 2 3 3. + 0 + <_> + + <_> + 11 10 6 8 -1. + <_> + 11 10 3 4 2. + <_> + 14 14 3 4 2. + 0 + <_> + + <_> + 11 10 8 6 -1. + <_> + 9 12 8 2 3. + 1 + <_> + + <_> + 11 11 1 3 -1. + <_> + 11 12 1 1 3. + 0 + <_> + + <_> + 11 14 3 3 -1. + <_> + 10 15 3 1 3. + 1 + <_> + + <_> + 11 16 3 3 -1. + <_> + 11 17 3 1 3. + 0 + <_> + + <_> + 11 21 3 3 -1. + <_> + 12 21 1 3 3. + 0 + <_> + + <_> + 11 22 3 2 -1. + <_> + 12 22 1 2 3. + 0 + <_> + + <_> + 12 0 9 17 -1. + <_> + 15 0 3 17 3. + 0 + <_> + + <_> + 12 2 2 14 -1. + <_> + 13 2 1 14 2. + 0 + <_> + + <_> + 12 3 6 1 -1. + <_> + 14 3 2 1 3. + 0 + <_> + + <_> + 12 3 8 3 -1. + <_> + 12 4 8 1 3. + 0 + <_> + + <_> + 12 3 12 6 -1. + <_> + 10 5 12 2 3. + 1 + <_> + + <_> + 12 4 2 3 -1. + <_> + 12 5 2 1 3. + 0 + <_> + + <_> + 12 4 9 3 -1. + <_> + 15 5 3 1 9. + 0 + <_> + + <_> + 12 5 3 5 -1. + <_> + 13 5 1 5 3. + 0 + <_> + + <_> + 12 5 3 3 -1. + <_> + 12 6 3 1 3. + 0 + <_> + + <_> + 12 5 9 8 -1. + <_> + 15 5 3 8 3. + 0 + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. + 0 + <_> + + <_> + 12 6 2 8 -1. + <_> + 12 6 2 4 2. + 1 + <_> + + <_> + 12 6 3 3 -1. + <_> + 12 7 3 1 3. + 0 + <_> + + <_> + 12 7 1 3 -1. + <_> + 12 8 1 1 3. + 0 + <_> + + <_> + 12 7 1 8 -1. + <_> + 12 7 1 4 2. + 1 + <_> + + <_> + 12 7 2 6 -1. + <_> + 12 7 2 3 2. + 1 + <_> + + <_> + 12 7 2 8 -1. + <_> + 12 7 2 4 2. + 1 + <_> + + <_> + 12 7 3 3 -1. + <_> + 12 8 3 1 3. + 0 + <_> + + <_> + 12 8 1 3 -1. + <_> + 12 9 1 1 3. + 0 + <_> + + <_> + 12 8 2 3 -1. + <_> + 12 9 2 1 3. + 0 + <_> + + <_> + 12 9 2 3 -1. + <_> + 12 10 2 1 3. + 0 + <_> + + <_> + 12 10 6 4 -1. + <_> + 14 10 2 4 3. + 0 + <_> + + <_> + 12 10 4 10 -1. + <_> + 12 10 2 5 2. + <_> + 14 15 2 5 2. + 0 + <_> + + <_> + 12 11 4 8 -1. + <_> + 12 11 2 4 2. + <_> + 14 15 2 4 2. + 0 + <_> + + <_> + 12 13 4 3 -1. + <_> + 13 13 2 3 2. + 0 + <_> + + <_> + 12 14 3 2 -1. + <_> + 13 15 1 2 3. + 1 + <_> + + <_> + 12 15 2 4 -1. + <_> + 12 15 1 2 2. + <_> + 13 17 1 2 2. + 0 + <_> + + <_> + 12 15 4 5 -1. + <_> + 14 15 2 5 2. + 0 + <_> + + <_> + 12 16 6 2 -1. + <_> + 14 16 2 2 3. + 0 + <_> + + <_> + 12 19 3 5 -1. + <_> + 13 19 1 5 3. + 0 + <_> + + <_> + 12 21 3 2 -1. + <_> + 13 21 1 2 3. + 0 + <_> + + <_> + 12 21 3 3 -1. + <_> + 13 21 1 3 3. + 0 + <_> + + <_> + 13 0 2 10 -1. + <_> + 13 0 1 5 2. + <_> + 14 5 1 5 2. + 0 + <_> + + <_> + 13 0 4 12 -1. + <_> + 14 0 2 12 2. + 0 + <_> + + <_> + 13 0 6 10 -1. + <_> + 15 0 2 10 3. + 0 + <_> + + <_> + 13 0 11 8 -1. + <_> + 11 2 11 4 2. + 1 + <_> + + <_> + 13 1 6 8 -1. + <_> + 15 1 2 8 3. + 0 + <_> + + <_> + 13 2 4 2 -1. + <_> + 14 2 2 2 2. + 0 + <_> + + <_> + 13 3 2 4 -1. + <_> + 13 3 1 2 2. + <_> + 14 5 1 2 2. + 0 + <_> + + <_> + 13 3 6 3 -1. + <_> + 15 4 2 1 9. + 0 + <_> + + <_> + 13 4 4 7 -1. + <_> + 14 4 2 7 2. + 0 + <_> + + <_> + 13 4 3 8 -1. + <_> + 14 4 1 8 3. + 0 + <_> + + <_> + 13 5 3 2 -1. + <_> + 14 5 1 2 3. + 0 + <_> + + <_> + 13 5 3 5 -1. + <_> + 14 5 1 5 3. + 0 + <_> + + <_> + 13 5 3 6 -1. + <_> + 14 5 1 6 3. + 0 + <_> + + <_> + 13 5 3 8 -1. + <_> + 14 5 1 8 3. + 0 + <_> + + <_> + 13 5 6 1 -1. + <_> + 15 5 2 1 3. + 0 + <_> + + <_> + 13 6 7 4 -1. + <_> + 13 7 7 2 2. + 0 + <_> + + <_> + 13 7 1 3 -1. + <_> + 13 8 1 1 3. + 0 + <_> + + <_> + 13 7 4 8 -1. + <_> + 13 7 2 4 2. + <_> + 15 11 2 4 2. + 0 + <_> + + <_> + 13 7 9 6 -1. + <_> + 16 9 3 2 9. + 0 + <_> + + <_> + 13 7 6 2 -1. + <_> + 13 7 3 2 2. + 1 + <_> + + <_> + 13 7 8 1 -1. + <_> + 13 7 4 1 2. + 1 + <_> + + <_> + 13 8 2 3 -1. + <_> + 13 9 2 1 3. + 0 + <_> + + <_> + 13 8 9 3 -1. + <_> + 16 9 3 1 9. + 0 + <_> + + <_> + 13 8 6 8 -1. + <_> + 13 8 3 4 2. + <_> + 16 12 3 4 2. + 0 + <_> + + <_> + 13 9 2 3 -1. + <_> + 13 10 2 1 3. + 0 + <_> + + <_> + 13 9 6 4 -1. + <_> + 15 9 2 4 3. + 0 + <_> + + <_> + 13 9 10 2 -1. + <_> + 13 10 10 1 2. + 0 + <_> + + <_> + 13 10 3 1 -1. + <_> + 14 10 1 1 3. + 0 + <_> + + <_> + 13 10 3 2 -1. + <_> + 14 10 1 2 3. + 0 + <_> + + <_> + 13 11 2 3 -1. + <_> + 13 12 2 1 3. + 0 + <_> + + <_> + 13 13 2 6 -1. + <_> + 13 13 1 3 2. + <_> + 14 16 1 3 2. + 0 + <_> + + <_> + 13 13 4 6 -1. + <_> + 14 14 2 6 2. + 1 + <_> + + <_> + 13 20 3 4 -1. + <_> + 14 20 1 4 3. + 0 + <_> + + <_> + 13 22 3 2 -1. + <_> + 14 22 1 2 3. + 0 + <_> + + <_> + 13 23 3 1 -1. + <_> + 14 23 1 1 3. + 0 + <_> + + <_> + 14 0 3 11 -1. + <_> + 15 1 1 11 3. + 1 + <_> + + <_> + 14 0 2 3 -1. + <_> + 14 1 2 1 3. + 0 + <_> + + <_> + 14 0 10 6 -1. + <_> + 14 0 5 3 2. + <_> + 19 3 5 3 2. + 0 + <_> + + <_> + 14 0 10 10 -1. + <_> + 14 0 5 5 2. + <_> + 19 5 5 5 2. + 0 + <_> + + <_> + 14 1 10 6 -1. + <_> + 14 1 5 3 2. + <_> + 19 4 5 3 2. + 0 + <_> + + <_> + 14 2 1 2 -1. + <_> + 14 2 1 1 2. + 1 + <_> + + <_> + 14 2 3 8 -1. + <_> + 15 2 1 8 3. + 0 + <_> + + <_> + 14 2 6 7 -1. + <_> + 16 2 2 7 3. + 0 + <_> + + <_> + 14 3 2 4 -1. + <_> + 14 3 1 2 2. + <_> + 15 5 1 2 2. + 0 + <_> + + <_> + 14 3 2 7 -1. + <_> + 15 3 1 7 2. + 0 + <_> + + <_> + 14 5 3 2 -1. + <_> + 15 5 1 2 3. + 0 + <_> + + <_> + 14 5 2 3 -1. + <_> + 15 5 1 3 2. + 0 + <_> + + <_> + 14 5 3 3 -1. + <_> + 15 5 1 3 3. + 0 + <_> + + <_> + 14 5 3 5 -1. + <_> + 15 5 1 5 3. + 0 + <_> + + <_> + 14 5 2 7 -1. + <_> + 15 5 1 7 2. + 0 + <_> + + <_> + 14 5 6 4 -1. + <_> + 16 5 2 4 3. + 0 + <_> + + <_> + 14 6 6 3 -1. + <_> + 14 6 3 3 2. + 1 + <_> + + <_> + 14 7 4 16 -1. + <_> + 15 7 2 16 2. + 0 + <_> + + <_> + 14 7 6 6 -1. + <_> + 16 9 2 2 9. + 0 + <_> + + <_> + 14 7 6 16 -1. + <_> + 16 7 2 16 3. + 0 + <_> + + <_> + 14 7 9 4 -1. + <_> + 14 8 9 2 2. + 0 + <_> + + <_> + 14 9 2 4 -1. + <_> + 14 9 1 2 2. + <_> + 15 11 1 2 2. + 0 + <_> + + <_> + 14 10 3 1 -1. + <_> + 15 10 1 1 3. + 0 + <_> + + <_> + 14 10 2 2 -1. + <_> + 15 10 1 2 2. + 0 + <_> + + <_> + 14 10 3 3 -1. + <_> + 15 10 1 3 3. + 0 + <_> + + <_> + 14 12 2 1 -1. + <_> + 15 12 1 1 2. + 0 + <_> + + <_> + 14 14 3 4 -1. + <_> + 15 15 1 4 3. + 1 + <_> + + <_> + 14 14 5 3 -1. + <_> + 14 15 5 1 3. + 0 + <_> + + <_> + 14 15 3 3 -1. + <_> + 15 16 1 3 3. + 1 + <_> + + <_> + 14 19 3 5 -1. + <_> + 15 19 1 5 3. + 0 + <_> + + <_> + 14 21 10 1 -1. + <_> + 19 21 5 1 2. + 0 + <_> + + <_> + 15 0 2 2 -1. + <_> + 15 0 1 2 2. + 1 + <_> + + <_> + 15 0 4 2 -1. + <_> + 16 1 2 2 2. + 1 + <_> + + <_> + 15 3 6 3 -1. + <_> + 15 4 6 1 3. + 0 + <_> + + <_> + 15 4 2 3 -1. + <_> + 15 5 2 1 3. + 0 + <_> + + <_> + 15 5 2 1 -1. + <_> + 15 5 1 1 2. + 1 + <_> + + <_> + 15 5 2 2 -1. + <_> + 16 5 1 2 2. + 0 + <_> + + <_> + 15 5 3 2 -1. + <_> + 16 5 1 2 3. + 0 + <_> + + <_> + 15 5 3 3 -1. + <_> + 16 5 1 3 3. + 0 + <_> + + <_> + 15 7 4 4 -1. + <_> + 15 9 4 2 2. + 0 + <_> + + <_> + 15 7 4 6 -1. + <_> + 15 9 4 2 3. + 0 + <_> + + <_> + 15 7 5 6 -1. + <_> + 15 9 5 2 3. + 0 + <_> + + <_> + 15 8 2 2 -1. + <_> + 15 8 1 1 2. + <_> + 16 9 1 1 2. + 0 + <_> + + <_> + 15 8 2 1 -1. + <_> + 15 8 1 1 2. + 1 + <_> + + <_> + 15 8 1 12 -1. + <_> + 15 14 1 6 2. + 0 + <_> + + <_> + 15 8 6 2 -1. + <_> + 15 8 3 2 2. + 1 + <_> + + <_> + 15 8 3 16 -1. + <_> + 15 12 3 8 2. + 0 + <_> + + <_> + 15 8 5 4 -1. + <_> + 15 9 5 2 2. + 0 + <_> + + <_> + 15 9 3 3 -1. + <_> + 16 10 1 1 9. + 0 + <_> + + <_> + 15 9 3 1 -1. + <_> + 16 10 1 1 3. + 1 + <_> + + <_> + 15 10 3 1 -1. + <_> + 16 10 1 1 3. + 0 + <_> + + <_> + 15 10 2 2 -1. + <_> + 15 10 1 1 2. + <_> + 16 11 1 1 2. + 0 + <_> + + <_> + 15 10 2 2 -1. + <_> + 16 10 1 2 2. + 0 + <_> + + <_> + 15 10 3 5 -1. + <_> + 16 10 1 5 3. + 0 + <_> + + <_> + 15 10 3 4 -1. + <_> + 14 11 3 2 2. + 1 + <_> + + <_> + 15 10 5 4 -1. + <_> + 15 11 5 2 2. + 0 + <_> + + <_> + 15 10 5 4 -1. + <_> + 14 11 5 2 2. + 1 + <_> + + <_> + 15 15 8 3 -1. + <_> + 19 15 4 3 2. + 0 + <_> + + <_> + 15 15 8 8 -1. + <_> + 15 15 4 4 2. + <_> + 19 19 4 4 2. + 0 + <_> + + <_> + 15 16 5 3 -1. + <_> + 15 17 5 1 3. + 0 + <_> + + <_> + 15 18 8 6 -1. + <_> + 15 18 4 3 2. + <_> + 19 21 4 3 2. + 0 + <_> + + <_> + 16 0 8 1 -1. + <_> + 20 0 4 1 2. + 0 + <_> + + <_> + 16 0 8 2 -1. + <_> + 20 0 4 2 2. + 0 + <_> + + <_> + 16 0 8 6 -1. + <_> + 16 0 4 3 2. + <_> + 20 3 4 3 2. + 0 + <_> + + <_> + 16 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 20 4 4 4 2. + 0 + <_> + + <_> + 16 1 3 3 -1. + <_> + 17 2 1 1 9. + 0 + <_> + + <_> + 16 1 2 1 -1. + <_> + 16 1 1 1 2. + 1 + <_> + + <_> + 16 2 1 2 -1. + <_> + 16 3 1 1 2. + 0 + <_> + + <_> + 16 2 3 3 -1. + <_> + 17 3 1 1 9. + 0 + <_> + + <_> + 16 2 4 2 -1. + <_> + 17 3 2 2 2. + 1 + <_> + + <_> + 16 2 6 1 -1. + <_> + 18 4 2 1 3. + 1 + <_> + + <_> + 16 3 4 12 -1. + <_> + 17 4 2 12 2. + 1 + <_> + + <_> + 16 4 6 3 -1. + <_> + 15 5 6 1 3. + 1 + <_> + + <_> + 16 5 1 2 -1. + <_> + 16 5 1 1 2. + 1 + <_> + + <_> + 16 5 3 2 -1. + <_> + 17 5 1 2 3. + 0 + <_> + + <_> + 16 5 3 9 -1. + <_> + 16 8 3 3 3. + 0 + <_> + + <_> + 16 6 6 2 -1. + <_> + 18 8 2 2 3. + 1 + <_> + + <_> + 16 7 1 6 -1. + <_> + 16 9 1 2 3. + 0 + <_> + + <_> + 16 7 2 3 -1. + <_> + 16 8 2 1 3. + 0 + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 2 1 2. + 1 + <_> + + <_> + 16 7 3 2 -1. + <_> + 16 8 3 1 2. + 0 + <_> + + <_> + 16 7 3 2 -1. + <_> + 16 7 3 1 2. + 1 + <_> + + <_> + 16 7 3 6 -1. + <_> + 16 9 3 2 3. + 0 + <_> + + <_> + 16 7 6 4 -1. + <_> + 16 7 3 4 2. + 1 + <_> + + <_> + 16 7 4 3 -1. + <_> + 16 8 4 1 3. + 0 + <_> + + <_> + 16 7 5 3 -1. + <_> + 16 8 5 1 3. + 0 + <_> + + <_> + 16 7 5 6 -1. + <_> + 16 9 5 2 3. + 0 + <_> + + <_> + 16 7 6 4 -1. + <_> + 16 8 6 2 2. + 0 + <_> + + <_> + 16 7 7 8 -1. + <_> + 14 9 7 4 2. + 1 + <_> + + <_> + 16 7 8 6 -1. + <_> + 16 9 8 2 3. + 0 + <_> + + <_> + 16 8 1 2 -1. + <_> + 16 9 1 1 2. + 0 + <_> + + <_> + 16 8 1 4 -1. + <_> + 16 9 1 2 2. + 0 + <_> + + <_> + 16 8 2 2 -1. + <_> + 16 8 1 1 2. + <_> + 17 9 1 1 2. + 0 + <_> + + <_> + 16 8 3 3 -1. + <_> + 17 9 1 1 9. + 0 + <_> + + <_> + 16 8 2 1 -1. + <_> + 16 8 1 1 2. + 1 + <_> + + <_> + 16 8 2 2 -1. + <_> + 16 8 1 2 2. + 1 + <_> + + <_> + 16 8 5 6 -1. + <_> + 14 10 5 2 3. + 1 + <_> + + <_> + 16 8 7 8 -1. + <_> + 14 10 7 4 2. + 1 + <_> + + <_> + 16 9 3 1 -1. + <_> + 17 9 1 1 3. + 0 + <_> + + <_> + 16 9 1 3 -1. + <_> + 16 10 1 1 3. + 0 + <_> + + <_> + 16 9 5 3 -1. + <_> + 16 10 5 1 3. + 0 + <_> + + <_> + 16 9 8 2 -1. + <_> + 16 10 8 1 2. + 0 + <_> + + <_> + 16 10 1 3 -1. + <_> + 16 11 1 1 3. + 0 + <_> + + <_> + 16 10 2 2 -1. + <_> + 17 10 1 2 2. + 0 + <_> + + <_> + 16 10 2 3 -1. + <_> + 16 11 2 1 3. + 0 + <_> + + <_> + 16 10 6 6 -1. + <_> + 14 12 6 2 3. + 1 + <_> + + <_> + 16 11 3 1 -1. + <_> + 17 11 1 1 3. + 0 + <_> + + <_> + 16 11 3 2 -1. + <_> + 17 11 1 2 3. + 0 + <_> + + <_> + 16 11 3 13 -1. + <_> + 17 11 1 13 3. + 0 + <_> + + <_> + 16 11 2 2 -1. + <_> + 16 12 2 1 2. + 0 + <_> + + <_> + 16 11 2 3 -1. + <_> + 16 12 2 1 3. + 0 + <_> + + <_> + 16 11 3 3 -1. + <_> + 16 12 3 1 3. + 0 + <_> + + <_> + 16 14 4 2 -1. + <_> + 18 14 2 2 2. + 0 + <_> + + <_> + 16 14 6 3 -1. + <_> + 19 14 3 3 2. + 0 + <_> + + <_> + 16 19 3 5 -1. + <_> + 17 19 1 5 3. + 0 + <_> + + <_> + 16 19 2 3 -1. + <_> + 15 20 2 1 3. + 1 + <_> + + <_> + 16 19 8 3 -1. + <_> + 16 20 8 1 3. + 0 + <_> + + <_> + 17 0 6 15 -1. + <_> + 19 2 2 15 3. + 1 + <_> + + <_> + 17 0 6 1 -1. + <_> + 20 0 3 1 2. + 0 + <_> + + <_> + 17 0 6 2 -1. + <_> + 20 0 3 2 2. + 0 + <_> + + <_> + 17 2 3 3 -1. + <_> + 18 3 1 1 9. + 0 + <_> + + <_> + 17 3 3 2 -1. + <_> + 18 3 1 2 3. + 0 + <_> + + <_> + 17 3 3 9 -1. + <_> + 18 6 1 3 9. + 0 + <_> + + <_> + 17 3 6 2 -1. + <_> + 19 5 2 2 3. + 1 + <_> + + <_> + 17 3 3 8 -1. + <_> + 15 5 3 4 2. + 1 + <_> + + <_> + 17 3 5 3 -1. + <_> + 17 4 5 1 3. + 0 + <_> + + <_> + 17 4 2 6 -1. + <_> + 17 4 1 3 2. + <_> + 18 7 1 3 2. + 0 + <_> + + <_> + 17 5 1 2 -1. + <_> + 17 5 1 1 2. + 1 + <_> + + <_> + 17 5 3 4 -1. + <_> + 18 6 1 4 3. + 1 + <_> + + <_> + 17 5 6 2 -1. + <_> + 17 5 3 2 2. + 1 + <_> + + <_> + 17 5 7 3 -1. + <_> + 16 6 7 1 3. + 1 + <_> + + <_> + 17 6 2 3 -1. + <_> + 17 6 1 3 2. + 1 + <_> + + <_> + 17 6 3 4 -1. + <_> + 18 7 1 4 3. + 1 + <_> + + <_> + 17 6 3 3 -1. + <_> + 17 7 3 1 3. + 0 + <_> + + <_> + 17 6 6 1 -1. + <_> + 17 6 3 1 2. + 1 + <_> + + <_> + 17 7 1 3 -1. + <_> + 17 8 1 1 3. + 0 + <_> + + <_> + 17 7 1 3 -1. + <_> + 16 8 1 1 3. + 1 + <_> + + <_> + 17 7 1 6 -1. + <_> + 17 9 1 2 3. + 0 + <_> + + <_> + 17 7 3 6 -1. + <_> + 18 9 1 2 9. + 0 + <_> + + <_> + 17 7 3 2 -1. + <_> + 18 8 1 2 3. + 1 + <_> + + <_> + 17 7 2 3 -1. + <_> + 17 7 1 3 2. + 1 + <_> + + <_> + 17 7 3 3 -1. + <_> + 18 8 1 3 3. + 1 + <_> + + <_> + 17 7 2 3 -1. + <_> + 17 8 2 1 3. + 0 + <_> + + <_> + 17 7 6 9 -1. + <_> + 14 10 6 3 3. + 1 + <_> + + <_> + 17 8 3 3 -1. + <_> + 18 9 1 1 9. + 0 + <_> + + <_> + 17 8 2 4 -1. + <_> + 17 8 1 2 2. + <_> + 18 10 1 2 2. + 0 + <_> + + <_> + 17 8 2 8 -1. + <_> + 17 8 1 4 2. + <_> + 18 12 1 4 2. + 0 + <_> + + <_> + 17 8 3 4 -1. + <_> + 18 9 1 4 3. + 1 + <_> + + <_> + 17 8 4 6 -1. + <_> + 15 10 4 2 3. + 1 + <_> + + <_> + 17 9 3 1 -1. + <_> + 18 9 1 1 3. + 0 + <_> + + <_> + 17 9 2 6 -1. + <_> + 17 9 1 3 2. + <_> + 18 12 1 3 2. + 0 + <_> + + <_> + 17 9 6 10 -1. + <_> + 17 9 3 5 2. + <_> + 20 14 3 5 2. + 0 + <_> + + <_> + 17 9 7 2 -1. + <_> + 17 10 7 1 2. + 0 + <_> + + <_> + 17 10 3 1 -1. + <_> + 18 10 1 1 3. + 0 + <_> + + <_> + 17 10 1 3 -1. + <_> + 17 11 1 1 3. + 0 + <_> + + <_> + 17 10 2 3 -1. + <_> + 18 10 1 3 2. + 0 + <_> + + <_> + 17 10 2 4 -1. + <_> + 18 10 1 4 2. + 0 + <_> + + <_> + 17 10 4 2 -1. + <_> + 17 10 2 1 2. + <_> + 19 11 2 1 2. + 0 + <_> + + <_> + 17 11 3 2 -1. + <_> + 18 11 1 2 3. + 0 + <_> + + <_> + 17 11 3 3 -1. + <_> + 18 11 1 3 3. + 0 + <_> + + <_> + 17 12 3 1 -1. + <_> + 18 12 1 1 3. + 0 + <_> + + <_> + 17 12 6 2 -1. + <_> + 20 12 3 2 2. + 0 + <_> + + <_> + 17 15 2 3 -1. + <_> + 17 16 2 1 3. + 0 + <_> + + <_> + 17 15 4 3 -1. + <_> + 19 15 2 3 2. + 0 + <_> + + <_> + 17 15 4 4 -1. + <_> + 17 15 2 4 2. + 1 + <_> + + <_> + 17 18 2 4 -1. + <_> + 16 19 2 2 2. + 1 + <_> + + <_> + 17 18 5 3 -1. + <_> + 17 19 5 1 3. + 0 + <_> + + <_> + 17 19 1 3 -1. + <_> + 16 20 1 1 3. + 1 + <_> + + <_> + 17 20 1 3 -1. + <_> + 16 21 1 1 3. + 1 + <_> + + <_> + 17 20 3 4 -1. + <_> + 18 20 1 4 3. + 0 + <_> + + <_> + 18 0 2 2 -1. + <_> + 18 0 1 2 2. + 1 + <_> + + <_> + 18 0 6 1 -1. + <_> + 21 0 3 1 2. + 0 + <_> + + <_> + 18 0 6 5 -1. + <_> + 21 0 3 5 2. + 0 + <_> + + <_> + 18 0 6 12 -1. + <_> + 18 0 3 6 2. + <_> + 21 6 3 6 2. + 0 + <_> + + <_> + 18 2 3 1 -1. + <_> + 19 3 1 1 3. + 1 + <_> + + <_> + 18 2 4 1 -1. + <_> + 19 3 2 1 2. + 1 + <_> + + <_> + 18 2 4 3 -1. + <_> + 19 3 2 3 2. + 1 + <_> + + <_> + 18 4 4 3 -1. + <_> + 18 5 4 1 3. + 0 + <_> + + <_> + 18 5 1 2 -1. + <_> + 18 5 1 1 2. + 1 + <_> + + <_> + 18 6 2 3 -1. + <_> + 18 6 1 3 2. + 1 + <_> + + <_> + 18 6 4 3 -1. + <_> + 19 7 2 3 2. + 1 + <_> + + <_> + 18 6 4 4 -1. + <_> + 19 7 2 4 2. + 1 + <_> + + <_> + 18 6 2 5 -1. + <_> + 18 6 1 5 2. + 1 + <_> + + <_> + 18 6 4 6 -1. + <_> + 19 7 2 6 2. + 1 + <_> + + <_> + 18 6 2 3 -1. + <_> + 18 7 2 1 3. + 0 + <_> + + <_> + 18 6 4 1 -1. + <_> + 18 6 2 1 2. + 1 + <_> + + <_> + 18 6 5 3 -1. + <_> + 18 7 5 1 3. + 0 + <_> + + <_> + 18 6 6 3 -1. + <_> + 18 7 6 1 3. + 0 + <_> + + <_> + 18 7 3 2 -1. + <_> + 19 8 1 2 3. + 1 + <_> + + <_> + 18 7 3 5 -1. + <_> + 19 8 1 5 3. + 1 + <_> + + <_> + 18 8 1 3 -1. + <_> + 18 9 1 1 3. + 0 + <_> + + <_> + 18 8 2 3 -1. + <_> + 18 9 2 1 3. + 0 + <_> + + <_> + 18 8 2 2 -1. + <_> + 18 8 2 1 2. + 1 + <_> + + <_> + 18 9 3 1 -1. + <_> + 19 9 1 1 3. + 0 + <_> + + <_> + 18 9 2 2 -1. + <_> + 18 9 1 1 2. + <_> + 19 10 1 1 2. + 0 + <_> + + <_> + 18 9 3 2 -1. + <_> + 19 9 1 2 3. + 0 + <_> + + <_> + 18 9 2 4 -1. + <_> + 18 11 2 2 2. + 0 + <_> + + <_> + 18 9 6 9 -1. + <_> + 21 9 3 9 2. + 0 + <_> + + <_> + 18 9 6 3 -1. + <_> + 18 10 6 1 3. + 0 + <_> + + <_> + 18 10 2 1 -1. + <_> + 19 10 1 1 2. + 0 + <_> + + <_> + 18 10 1 3 -1. + <_> + 18 11 1 1 3. + 0 + <_> + + <_> + 18 10 2 2 -1. + <_> + 18 10 1 1 2. + <_> + 19 11 1 1 2. + 0 + <_> + + <_> + 18 10 6 2 -1. + <_> + 18 11 6 1 2. + 0 + <_> + + <_> + 18 11 3 4 -1. + <_> + 19 11 1 4 3. + 0 + <_> + + <_> + 18 11 3 13 -1. + <_> + 19 11 1 13 3. + 0 + <_> + + <_> + 18 11 2 8 -1. + <_> + 18 15 2 4 2. + 0 + <_> + + <_> + 18 11 6 1 -1. + <_> + 21 11 3 1 2. + 0 + <_> + + <_> + 18 12 6 2 -1. + <_> + 21 12 3 2 2. + 0 + <_> + + <_> + 18 12 3 8 -1. + <_> + 18 16 3 4 2. + 0 + <_> + + <_> + 18 13 2 4 -1. + <_> + 18 15 2 2 2. + 0 + <_> + + <_> + 18 14 4 4 -1. + <_> + 18 16 4 2 2. + 0 + <_> + + <_> + 18 15 4 5 -1. + <_> + 20 15 2 5 2. + 0 + <_> + + <_> + 18 16 2 4 -1. + <_> + 18 16 2 2 2. + 1 + <_> + + <_> + 18 17 2 5 -1. + <_> + 18 17 1 5 2. + 1 + <_> + + <_> + 18 18 1 3 -1. + <_> + 17 19 1 1 3. + 1 + <_> + + <_> + 18 20 1 3 -1. + <_> + 17 21 1 1 3. + 1 + <_> + + <_> + 19 0 2 3 -1. + <_> + 19 0 1 3 2. + 1 + <_> + + <_> + 19 2 3 1 -1. + <_> + 20 3 1 1 3. + 1 + <_> + + <_> + 19 2 4 3 -1. + <_> + 20 3 2 3 2. + 1 + <_> + + <_> + 19 3 3 1 -1. + <_> + 20 4 1 1 3. + 1 + <_> + + <_> + 19 4 1 2 -1. + <_> + 19 4 1 1 2. + 1 + <_> + + <_> + 19 4 3 1 -1. + <_> + 20 5 1 1 3. + 1 + <_> + + <_> + 19 4 1 3 -1. + <_> + 18 5 1 1 3. + 1 + <_> + + <_> + 19 4 1 4 -1. + <_> + 19 6 1 2 2. + 0 + <_> + + <_> + 19 4 5 9 -1. + <_> + 19 7 5 3 3. + 0 + <_> + + <_> + 19 5 3 1 -1. + <_> + 20 6 1 1 3. + 1 + <_> + + <_> + 19 6 1 3 -1. + <_> + 19 7 1 1 3. + 0 + <_> + + <_> + 19 6 1 3 -1. + <_> + 18 7 1 1 3. + 1 + <_> + + <_> + 19 6 2 3 -1. + <_> + 19 7 2 1 3. + 0 + <_> + + <_> + 19 6 5 9 -1. + <_> + 19 9 5 3 3. + 0 + <_> + + <_> + 19 7 1 3 -1. + <_> + 19 8 1 1 3. + 0 + <_> + + <_> + 19 7 3 4 -1. + <_> + 20 7 1 4 3. + 0 + <_> + + <_> + 19 7 2 4 -1. + <_> + 19 7 2 2 2. + 1 + <_> + + <_> + 19 8 1 3 -1. + <_> + 19 9 1 1 3. + 0 + <_> + + <_> + 19 8 3 3 -1. + <_> + 20 8 1 3 3. + 0 + <_> + + <_> + 19 9 2 1 -1. + <_> + 20 9 1 1 2. + 0 + <_> + + <_> + 19 9 2 2 -1. + <_> + 19 9 2 1 2. + 1 + <_> + + <_> + 19 10 2 2 -1. + <_> + 19 10 1 1 2. + <_> + 20 11 1 1 2. + 0 + <_> + + <_> + 19 10 3 4 -1. + <_> + 19 11 3 2 2. + 0 + <_> + + <_> + 19 12 4 8 -1. + <_> + 20 13 2 8 2. + 1 + <_> + + <_> + 19 12 3 10 -1. + <_> + 20 12 1 10 3. + 0 + <_> + + <_> + 19 12 3 12 -1. + <_> + 20 12 1 12 3. + 0 + <_> + + <_> + 19 13 3 9 -1. + <_> + 20 13 1 9 3. + 0 + <_> + + <_> + 19 14 4 6 -1. + <_> + 20 15 2 6 2. + 1 + <_> + + <_> + 19 15 3 6 -1. + <_> + 20 16 1 6 3. + 1 + <_> + + <_> + 19 17 1 3 -1. + <_> + 18 18 1 1 3. + 1 + <_> + + <_> + 19 18 1 3 -1. + <_> + 18 19 1 1 3. + 1 + <_> + + <_> + 19 19 1 3 -1. + <_> + 18 20 1 1 3. + 1 + <_> + + <_> + 19 19 1 4 -1. + <_> + 18 20 1 2 2. + 1 + <_> + + <_> + 19 20 1 3 -1. + <_> + 18 21 1 1 3. + 1 + <_> + + <_> + 19 21 5 3 -1. + <_> + 19 22 5 1 3. + 0 + <_> + + <_> + 20 0 4 4 -1. + <_> + 19 1 4 2 2. + 1 + <_> + + <_> + 20 3 3 1 -1. + <_> + 21 4 1 1 3. + 1 + <_> + + <_> + 20 3 3 2 -1. + <_> + 21 4 1 2 3. + 1 + <_> + + <_> + 20 4 1 3 -1. + <_> + 20 5 1 1 3. + 0 + <_> + + <_> + 20 4 3 1 -1. + <_> + 21 5 1 1 3. + 1 + <_> + + <_> + 20 4 3 2 -1. + <_> + 21 5 1 2 3. + 1 + <_> + + <_> + 20 5 3 1 -1. + <_> + 21 6 1 1 3. + 1 + <_> + + <_> + 20 6 4 3 -1. + <_> + 20 7 4 1 3. + 0 + <_> + + <_> + 20 8 3 2 -1. + <_> + 21 9 1 2 3. + 1 + <_> + + <_> + 20 8 3 3 -1. + <_> + 21 9 1 3 3. + 1 + <_> + + <_> + 20 9 3 2 -1. + <_> + 21 10 1 2 3. + 1 + <_> + + <_> + 20 9 4 10 -1. + <_> + 20 9 2 10 2. + 1 + <_> + + <_> + 20 10 1 3 -1. + <_> + 19 11 1 1 3. + 1 + <_> + + <_> + 20 10 2 2 -1. + <_> + 20 10 2 1 2. + 1 + <_> + + <_> + 20 11 4 9 -1. + <_> + 20 11 2 9 2. + 1 + <_> + + <_> + 20 14 4 6 -1. + <_> + 21 15 2 6 2. + 1 + <_> + + <_> + 20 14 2 7 -1. + <_> + 20 14 1 7 2. + 1 + <_> + + <_> + 20 15 3 4 -1. + <_> + 19 16 3 2 2. + 1 + <_> + + <_> + 20 16 4 4 -1. + <_> + 21 17 2 4 2. + 1 + <_> + + <_> + 20 17 3 5 -1. + <_> + 21 17 1 5 3. + 0 + <_> + + <_> + 20 20 1 3 -1. + <_> + 19 21 1 1 3. + 1 + <_> + + <_> + 20 20 4 3 -1. + <_> + 20 21 4 1 3. + 0 + <_> + + <_> + 21 1 2 16 -1. + <_> + 21 1 2 8 2. + 1 + <_> + + <_> + 21 1 3 4 -1. + <_> + 21 2 3 2 2. + 0 + <_> + + <_> + 21 3 3 2 -1. + <_> + 22 4 1 2 3. + 1 + <_> + + <_> + 21 4 3 3 -1. + <_> + 22 5 1 3 3. + 1 + <_> + + <_> + 21 10 1 3 -1. + <_> + 20 11 1 1 3. + 1 + <_> + + <_> + 21 10 2 2 -1. + <_> + 21 10 1 2 2. + 1 + <_> + + <_> + 21 10 3 4 -1. + <_> + 21 11 3 2 2. + 0 + <_> + + <_> + 21 11 1 2 -1. + <_> + 21 11 1 1 2. + 1 + <_> + + <_> + 21 15 2 3 -1. + <_> + 20 16 2 1 3. + 1 + <_> + + <_> + 21 16 1 3 -1. + <_> + 20 17 1 1 3. + 1 + <_> + + <_> + 21 16 3 8 -1. + <_> + 22 16 1 8 3. + 0 + <_> + + <_> + 21 16 2 3 -1. + <_> + 20 17 2 1 3. + 1 + <_> + + <_> + 21 17 1 3 -1. + <_> + 20 18 1 1 3. + 1 + <_> + + <_> + 21 17 3 7 -1. + <_> + 22 17 1 7 3. + 0 + <_> + + <_> + 21 19 3 5 -1. + <_> + 22 19 1 5 3. + 0 + <_> + + <_> + 22 1 2 4 -1. + <_> + 21 2 2 2 2. + 1 + <_> + + <_> + 22 2 1 16 -1. + <_> + 22 2 1 8 2. + 1 + <_> + + <_> + 22 9 2 4 -1. + <_> + 22 9 1 4 2. + 1 + <_> + + <_> + 22 10 1 3 -1. + <_> + 21 11 1 1 3. + 1 + <_> + + <_> + 22 10 2 7 -1. + <_> + 22 10 1 7 2. + 1 + <_> + + <_> + 22 10 2 3 -1. + <_> + 22 11 2 1 3. + 0 + <_> + + <_> + 22 10 2 3 -1. + <_> + 21 11 2 1 3. + 1 + <_> + + <_> + 22 11 1 3 -1. + <_> + 21 12 1 1 3. + 1 + <_> + + <_> + 22 12 1 3 -1. + <_> + 21 13 1 1 3. + 1 + <_> + + <_> + 22 13 1 3 -1. + <_> + 21 14 1 1 3. + 1 + <_> + + <_> + 22 16 1 3 -1. + <_> + 21 17 1 1 3. + 1 + <_> + + <_> + 23 7 1 3 -1. + <_> + 23 8 1 1 3. + 0 + <_> + + <_> + 23 10 1 3 -1. + <_> + 23 11 1 1 3. + 0 + <_> + + <_> + 23 11 1 2 -1. + <_> + 23 12 1 1 2. + 0 + <_> + + <_> + 23 11 1 3 -1. + <_> + 22 12 1 1 3. + 1 + <_> + + <_> + 23 15 1 4 -1. + <_> + 22 16 1 2 2. + 1 + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_alt.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_alt.xml new file mode 100644 index 0000000000000000000000000000000000000000..ade4b2121a68e6967cc558f4393dc8d828cee60e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_alt.xml @@ -0,0 +1,24350 @@ + + + +BOOST + HAAR + 20 + 20 + + 213 + + 0 + 22 + + <_> + 3 + 8.2268941402435303e-01 + + <_> + + 0 -1 0 4.0141958743333817e-03 + + 3.3794190734624863e-02 8.3781069517135620e-01 + <_> + + 0 -1 1 1.5151339583098888e-02 + + 1.5141320228576660e-01 7.4888122081756592e-01 + <_> + + 0 -1 2 4.2109931819140911e-03 + + 9.0049281716346741e-02 6.3748198747634888e-01 + <_> + 16 + 6.9566087722778320e+00 + + <_> + + 0 -1 3 1.6227109590545297e-03 + + 6.9308586418628693e-02 7.1109461784362793e-01 + <_> + + 0 -1 4 2.2906649392098188e-03 + + 1.7958030104637146e-01 6.6686922311782837e-01 + <_> + + 0 -1 5 5.0025708042085171e-03 + + 1.6936729848384857e-01 6.5540069341659546e-01 + <_> + + 0 -1 6 7.9659894108772278e-03 + + 5.8663320541381836e-01 9.1414518654346466e-02 + <_> + + 0 -1 7 -3.5227010957896709e-03 + + 1.4131669700145721e-01 6.0318958759307861e-01 + <_> + + 0 -1 8 3.6667689681053162e-02 + + 3.6756721138954163e-01 7.9203182458877563e-01 + <_> + + 0 -1 9 9.3361474573612213e-03 + + 6.1613857746124268e-01 2.0885099470615387e-01 + <_> + + 0 -1 10 8.6961314082145691e-03 + + 2.8362309932708740e-01 6.3602739572525024e-01 + <_> + + 0 -1 11 1.1488880263641477e-03 + + 2.2235809266567230e-01 5.8007007837295532e-01 + <_> + + 0 -1 12 -2.1484689787030220e-03 + + 2.4064640700817108e-01 5.7870548963546753e-01 + <_> + + 0 -1 13 2.1219060290604830e-03 + + 5.5596548318862915e-01 1.3622370362281799e-01 + <_> + + 0 -1 14 -9.3949146568775177e-02 + + 8.5027372837066650e-01 4.7177401185035706e-01 + <_> + + 0 -1 15 1.3777789426967502e-03 + + 5.9936738014221191e-01 2.8345298767089844e-01 + <_> + + 0 -1 16 7.3063157498836517e-02 + + 4.3418860435485840e-01 7.0600342750549316e-01 + <_> + + 0 -1 17 3.6767389974556863e-04 + + 3.0278879404067993e-01 6.0515749454498291e-01 + <_> + + 0 -1 18 -6.0479710809886456e-03 + + 1.7984339594841003e-01 5.6752568483352661e-01 + <_> + 21 + 9.4985427856445312e+00 + + <_> + + 0 -1 19 -1.6510689631104469e-02 + + 6.6442251205444336e-01 1.4248579740524292e-01 + <_> + + 0 -1 20 2.7052499353885651e-03 + + 6.3253521919250488e-01 1.2884770333766937e-01 + <_> + + 0 -1 21 2.8069869149476290e-03 + + 1.2402880191802979e-01 6.1931931972503662e-01 + <_> + + 0 -1 22 -1.5402400167658925e-03 + + 1.4321430027484894e-01 5.6700158119201660e-01 + <_> + + 0 -1 23 -5.6386279175058007e-04 + + 1.6574330627918243e-01 5.9052079916000366e-01 + <_> + + 0 -1 24 1.9253729842603207e-03 + + 2.6955071091651917e-01 5.7388240098953247e-01 + <_> + + 0 -1 25 -5.0214841030538082e-03 + + 1.8935389816761017e-01 5.7827740907669067e-01 + <_> + + 0 -1 26 2.6365420781075954e-03 + + 2.3093290627002716e-01 5.6954258680343628e-01 + <_> + + 0 -1 27 -1.5127769438549876e-03 + + 2.7596020698547363e-01 5.9566420316696167e-01 + <_> + + 0 -1 28 -1.0157439857721329e-02 + + 1.7325380444526672e-01 5.5220472812652588e-01 + <_> + + 0 -1 29 -1.1953660286962986e-02 + + 1.3394099473953247e-01 5.5590140819549561e-01 + <_> + + 0 -1 30 4.8859491944313049e-03 + + 3.6287039518356323e-01 6.1888492107391357e-01 + <_> + + 0 -1 31 -8.0132916569709778e-02 + + 9.1211050748825073e-02 5.4759448766708374e-01 + <_> + + 0 -1 32 1.0643280111253262e-03 + + 3.7151429057121277e-01 5.7113999128341675e-01 + <_> + + 0 -1 33 -1.3419450260698795e-03 + + 5.9533137083053589e-01 3.3180978894233704e-01 + <_> + + 0 -1 34 -5.4601140320301056e-02 + + 1.8440659344196320e-01 5.6028461456298828e-01 + <_> + + 0 -1 35 2.9071690514683723e-03 + + 3.5942441225051880e-01 6.1317151784896851e-01 + <_> + + 0 -1 36 7.4718717951327562e-04 + + 5.9943532943725586e-01 3.4595629572868347e-01 + <_> + + 0 -1 37 4.3013808317482471e-03 + + 4.1726520657539368e-01 6.9908452033996582e-01 + <_> + + 0 -1 38 4.5017572119832039e-03 + + 4.5097151398658752e-01 7.8014570474624634e-01 + <_> + + 0 -1 39 2.4138500913977623e-02 + + 5.4382127523422241e-01 1.3198269903659821e-01 + <_> + 39 + 1.8412969589233398e+01 + + <_> + + 0 -1 40 1.9212230108678341e-03 + + 1.4152669906616211e-01 6.1998707056045532e-01 + <_> + + 0 -1 41 -1.2748669541906565e-04 + + 6.1910742521286011e-01 1.8849289417266846e-01 + <_> + + 0 -1 42 5.1409931620582938e-04 + + 1.4873969554901123e-01 5.8579277992248535e-01 + <_> + + 0 -1 43 4.1878609918057919e-03 + + 2.7469098567962646e-01 6.3592398166656494e-01 + <_> + + 0 -1 44 5.1015717908740044e-03 + + 5.8708512783050537e-01 2.1756289899349213e-01 + <_> + + 0 -1 45 -2.1448440384119749e-03 + + 5.8809447288513184e-01 2.9795908927917480e-01 + <_> + + 0 -1 46 -2.8977119363844395e-03 + + 2.3733270168304443e-01 5.8766472339630127e-01 + <_> + + 0 -1 47 -2.1610679104924202e-02 + + 1.2206549942493439e-01 5.1942020654678345e-01 + <_> + + 0 -1 48 -4.6299318782985210e-03 + + 2.6312309503555298e-01 5.8174091577529907e-01 + <_> + + 0 -1 49 5.9393711853772402e-04 + + 3.6386200785636902e-01 5.6985449790954590e-01 + <_> + + 0 -1 50 5.3878661245107651e-02 + + 4.3035310506820679e-01 7.5593662261962891e-01 + <_> + + 0 -1 51 1.8887349870055914e-03 + + 2.1226030588150024e-01 5.6134271621704102e-01 + <_> + + 0 -1 52 -2.3635339457541704e-03 + + 5.6318491697311401e-01 2.6427671313285828e-01 + <_> + + 0 -1 53 2.4017799645662308e-02 + + 5.7971078157424927e-01 2.7517059445381165e-01 + <_> + + 0 -1 54 2.0543030404951423e-04 + + 2.7052420377731323e-01 5.7525688409805298e-01 + <_> + + 0 -1 55 8.4790197433903813e-04 + + 5.4356247186660767e-01 2.3348769545555115e-01 + <_> + + 0 -1 56 1.4091329649090767e-03 + + 5.3194248676300049e-01 2.0631550252437592e-01 + <_> + + 0 -1 57 1.4642629539594054e-03 + + 5.4189807176589966e-01 3.0688610672950745e-01 + <_> + + 0 -1 58 1.6352549428120255e-03 + + 3.6953729391098022e-01 6.1128681898117065e-01 + <_> + + 0 -1 59 8.3172752056270838e-04 + + 3.5650369524955750e-01 6.0252362489700317e-01 + <_> + + 0 -1 60 -2.0998890977352858e-03 + + 1.9139820337295532e-01 5.3628271818161011e-01 + <_> + + 0 -1 61 -7.4213981861248612e-04 + + 3.8355550169944763e-01 5.5293101072311401e-01 + <_> + + 0 -1 62 3.2655049581080675e-03 + + 4.3128961324691772e-01 7.1018958091735840e-01 + <_> + + 0 -1 63 8.9134991867467761e-04 + + 3.9848309755325317e-01 6.3919639587402344e-01 + <_> + + 0 -1 64 -1.5284179709851742e-02 + + 2.3667329549789429e-01 5.4337137937545776e-01 + <_> + + 0 -1 65 4.8381411470472813e-03 + + 5.8175009489059448e-01 3.2391890883445740e-01 + <_> + + 0 -1 66 -9.1093179071322083e-04 + + 5.5405938625335693e-01 2.9118689894676208e-01 + <_> + + 0 -1 67 -6.1275060288608074e-03 + + 1.7752550542354584e-01 5.1966291666030884e-01 + <_> + + 0 -1 68 -4.4576259097084403e-04 + + 3.0241701006889343e-01 5.5335938930511475e-01 + <_> + + 0 -1 69 2.2646540775895119e-02 + + 4.4149309396743774e-01 6.9753772020339966e-01 + <_> + + 0 -1 70 -1.8804960418492556e-03 + + 2.7913948893547058e-01 5.4979521036148071e-01 + <_> + + 0 -1 71 7.0889107882976532e-03 + + 5.2631992101669312e-01 2.3855470120906830e-01 + <_> + + 0 -1 72 1.7318050377070904e-03 + + 4.3193790316581726e-01 6.9836008548736572e-01 + <_> + + 0 -1 73 -6.8482700735330582e-03 + + 3.0820429325103760e-01 5.3909200429916382e-01 + <_> + + 0 -1 74 -1.5062530110299122e-05 + + 5.5219221115112305e-01 3.1203660368919373e-01 + <_> + + 0 -1 75 2.9475569725036621e-02 + + 5.4013228416442871e-01 1.7706030607223511e-01 + <_> + + 0 -1 76 8.1387329846620560e-03 + + 5.1786178350448608e-01 1.2110190093517303e-01 + <_> + + 0 -1 77 2.0942950621247292e-02 + + 5.2902942895889282e-01 3.3112218976020813e-01 + <_> + + 0 -1 78 -9.5665529370307922e-03 + + 7.4719941616058350e-01 4.4519689679145813e-01 + <_> + 33 + 1.5324139595031738e+01 + + <_> + + 0 -1 79 -2.8206960996612906e-04 + + 2.0640860497951508e-01 6.0767322778701782e-01 + <_> + + 0 -1 80 1.6790600493550301e-03 + + 5.8519971370697021e-01 1.2553839385509491e-01 + <_> + + 0 -1 81 6.9827912375330925e-04 + + 9.4018429517745972e-02 5.7289612293243408e-01 + <_> + + 0 -1 82 7.8959012171253562e-04 + + 1.7819879949092865e-01 5.6943088769912720e-01 + <_> + + 0 -1 83 -2.8560499195009470e-03 + + 1.6383990645408630e-01 5.7886648178100586e-01 + <_> + + 0 -1 84 -3.8122469559311867e-03 + + 2.0854400098323822e-01 5.5085647106170654e-01 + <_> + + 0 -1 85 1.5896620461717248e-03 + + 5.7027608156204224e-01 1.8572150170803070e-01 + <_> + + 0 -1 86 1.0078339837491512e-02 + + 5.1169431209564209e-01 2.1897700428962708e-01 + <_> + + 0 -1 87 -6.3526302576065063e-02 + + 7.1313798427581787e-01 4.0438130497932434e-01 + <_> + + 0 -1 88 -9.1031491756439209e-03 + + 2.5671818852424622e-01 5.4639732837677002e-01 + <_> + + 0 -1 89 -2.4035000242292881e-03 + + 1.7006659507751465e-01 5.5909740924835205e-01 + <_> + + 0 -1 90 1.5226360410451889e-03 + + 5.4105567932128906e-01 2.6190540194511414e-01 + <_> + + 0 -1 91 1.7997439950704575e-02 + + 3.7324368953704834e-01 6.5352207422256470e-01 + <_> + + 0 -1 92 -6.4538191072642803e-03 + + 2.6264819502830505e-01 5.5374461412429810e-01 + <_> + + 0 -1 93 -1.1880760081112385e-02 + + 2.0037539303302765e-01 5.5447459220886230e-01 + <_> + + 0 -1 94 1.2713660253211856e-03 + + 5.5919027328491211e-01 3.0319759249687195e-01 + <_> + + 0 -1 95 1.1376109905540943e-03 + + 2.7304071187973022e-01 5.6465089321136475e-01 + <_> + + 0 -1 96 -4.2651998810470104e-03 + + 1.4059090614318848e-01 5.4618209600448608e-01 + <_> + + 0 -1 97 -2.9602861031889915e-03 + + 1.7950350046157837e-01 5.4592901468276978e-01 + <_> + + 0 -1 98 -8.8448226451873779e-03 + + 5.7367831468582153e-01 2.8092199563980103e-01 + <_> + + 0 -1 99 -6.6430689767003059e-03 + + 2.3706759512424469e-01 5.5038261413574219e-01 + <_> + + 0 -1 100 3.9997808635234833e-03 + + 5.6081998348236084e-01 3.3042821288108826e-01 + <_> + + 0 -1 101 -4.1221720166504383e-03 + + 1.6401059925556183e-01 5.3789931535720825e-01 + <_> + + 0 -1 102 1.5624909661710262e-02 + + 5.2276492118835449e-01 2.2886039316654205e-01 + <_> + + 0 -1 103 -1.0356419719755650e-02 + + 7.0161938667297363e-01 4.2529278993606567e-01 + <_> + + 0 -1 104 -8.7960809469223022e-03 + + 2.7673470973968506e-01 5.3558301925659180e-01 + <_> + + 0 -1 105 1.6226939857006073e-01 + + 4.3422400951385498e-01 7.4425792694091797e-01 + <_> + + 0 -1 106 4.5542530715465546e-03 + + 5.7264858484268188e-01 2.5821250677108765e-01 + <_> + + 0 -1 107 -2.1309209987521172e-03 + + 2.1068480610847473e-01 5.3610187768936157e-01 + <_> + + 0 -1 108 -1.3208420015871525e-02 + + 7.5937908887863159e-01 4.5524680614471436e-01 + <_> + + 0 -1 109 -6.5996676683425903e-02 + + 1.2524759769439697e-01 5.3440397977828979e-01 + <_> + + 0 -1 110 7.9142656177282333e-03 + + 3.3153840899467468e-01 5.6010431051254272e-01 + <_> + + 0 -1 111 2.0894279703497887e-02 + + 5.5060499906539917e-01 2.7688381075859070e-01 + <_> + 44 + 2.1010639190673828e+01 + + <_> + + 0 -1 112 1.1961159761995077e-03 + + 1.7626909911632538e-01 6.1562412977218628e-01 + <_> + + 0 -1 113 -1.8679830245673656e-03 + + 6.1181068420410156e-01 1.8323999643325806e-01 + <_> + + 0 -1 114 -1.9579799845814705e-04 + + 9.9044263362884521e-02 5.7238161563873291e-01 + <_> + + 0 -1 115 -8.0255657667294145e-04 + + 5.5798798799514771e-01 2.3772829771041870e-01 + <_> + + 0 -1 116 -2.4510810617357492e-03 + + 2.2314579784870148e-01 5.8589351177215576e-01 + <_> + + 0 -1 117 5.0361850298941135e-04 + + 2.6539939641952515e-01 5.7941037416458130e-01 + <_> + + 0 -1 118 4.0293349884450436e-03 + + 5.8038270473480225e-01 2.4848650395870209e-01 + <_> + + 0 -1 119 -1.4451709575951099e-02 + + 1.8303519487380981e-01 5.4842048883438110e-01 + <_> + + 0 -1 120 2.0380979403853416e-03 + + 3.3635589480400085e-01 6.0510927438735962e-01 + <_> + + 0 -1 121 -1.6155190533027053e-03 + + 2.2866420447826385e-01 5.4412460327148438e-01 + <_> + + 0 -1 122 3.3458340913057327e-03 + + 5.6259131431579590e-01 2.3923380672931671e-01 + <_> + + 0 -1 123 1.6379579901695251e-03 + + 3.9069938659667969e-01 5.9646219015121460e-01 + <_> + + 0 -1 124 3.0251210555434227e-02 + + 5.2484822273254395e-01 1.5757469832897186e-01 + <_> + + 0 -1 125 3.7251990288496017e-02 + + 4.1943109035491943e-01 6.7484188079833984e-01 + <_> + + 0 -1 126 -2.5109790265560150e-02 + + 1.8825499713420868e-01 5.4734510183334351e-01 + <_> + + 0 -1 127 -5.3099058568477631e-03 + + 1.3399730622768402e-01 5.2271109819412231e-01 + <_> + + 0 -1 128 1.2086479691788554e-03 + + 3.7620881199836731e-01 6.1096358299255371e-01 + <_> + + 0 -1 129 -2.1907679736614227e-02 + + 2.6631429791450500e-01 5.4040068387985229e-01 + <_> + + 0 -1 130 5.4116579703986645e-03 + + 5.3635787963867188e-01 2.2322730720043182e-01 + <_> + + 0 -1 131 6.9946326315402985e-02 + + 5.3582328557968140e-01 2.4536980688571930e-01 + <_> + + 0 -1 132 3.4520021290518343e-04 + + 2.4096719920635223e-01 5.3769302368164062e-01 + <_> + + 0 -1 133 1.2627709656953812e-03 + + 5.4258567094802856e-01 3.1556931138038635e-01 + <_> + + 0 -1 134 2.2719509899616241e-02 + + 4.1584059596061707e-01 6.5978652238845825e-01 + <_> + + 0 -1 135 -1.8111000536009669e-03 + + 2.8112530708312988e-01 5.5052447319030762e-01 + <_> + + 0 -1 136 3.3469670452177525e-03 + + 5.2600282430648804e-01 1.8914650380611420e-01 + <_> + + 0 -1 137 4.0791751234792173e-04 + + 5.6735092401504517e-01 3.3442100882530212e-01 + <_> + + 0 -1 138 1.2734799645841122e-02 + + 5.3435921669006348e-01 2.3956120014190674e-01 + <_> + + 0 -1 139 -7.3119727894663811e-03 + + 6.0108900070190430e-01 4.0222078561782837e-01 + <_> + + 0 -1 140 -5.6948751211166382e-02 + + 8.1991511583328247e-01 4.5431908965110779e-01 + <_> + + 0 -1 141 -5.0116591155529022e-03 + + 2.2002810239791870e-01 5.3577107191085815e-01 + <_> + + 0 -1 142 6.0334368608891964e-03 + + 4.4130811095237732e-01 7.1817511320114136e-01 + <_> + + 0 -1 143 3.9437441155314445e-03 + + 5.4788607358932495e-01 2.7917331457138062e-01 + <_> + + 0 -1 144 -3.6591119132936001e-03 + + 6.3578677177429199e-01 3.9897239208221436e-01 + <_> + + 0 -1 145 -3.8456181064248085e-03 + + 3.4936860203742981e-01 5.3006649017333984e-01 + <_> + + 0 -1 146 -7.1926261298358440e-03 + + 1.1196149885654449e-01 5.2296727895736694e-01 + <_> + + 0 -1 147 -5.2798941731452942e-02 + + 2.3871029913425446e-01 5.4534512758255005e-01 + <_> + + 0 -1 148 -7.9537667334079742e-03 + + 7.5869178771972656e-01 4.4393768906593323e-01 + <_> + + 0 -1 149 -2.7344180271029472e-03 + + 2.5654768943786621e-01 5.4893219470977783e-01 + <_> + + 0 -1 150 -1.8507939530536532e-03 + + 6.7343479394912720e-01 4.2524749040603638e-01 + <_> + + 0 -1 151 1.5918919816613197e-02 + + 5.4883527755737305e-01 2.2926619648933411e-01 + <_> + + 0 -1 152 -1.2687679845839739e-03 + + 6.1043310165405273e-01 4.0223899483680725e-01 + <_> + + 0 -1 153 6.2883910723030567e-03 + + 5.3108531236648560e-01 1.5361930429935455e-01 + <_> + + 0 -1 154 -6.2259892001748085e-03 + + 1.7291119694709778e-01 5.2416062355041504e-01 + <_> + + 0 -1 155 -1.2132599949836731e-02 + + 6.5977597236633301e-01 4.3251821398735046e-01 + <_> + 50 + 2.3918790817260742e+01 + + <_> + + 0 -1 156 -3.9184908382594585e-03 + + 6.1034351587295532e-01 1.4693309366703033e-01 + <_> + + 0 -1 157 1.5971299726516008e-03 + + 2.6323631405830383e-01 5.8964669704437256e-01 + <_> + + 0 -1 158 1.7780110239982605e-02 + + 5.8728742599487305e-01 1.7603619396686554e-01 + <_> + + 0 -1 159 6.5334769897162914e-04 + + 1.5678019821643829e-01 5.5960661172866821e-01 + <_> + + 0 -1 160 -2.8353091329336166e-04 + + 1.9131539762020111e-01 5.7320362329483032e-01 + <_> + + 0 -1 161 1.6104689566418529e-03 + + 2.9149138927459717e-01 5.6230807304382324e-01 + <_> + + 0 -1 162 -9.7750619053840637e-02 + + 1.9434769451618195e-01 5.6482332944869995e-01 + <_> + + 0 -1 163 5.5182358482852578e-04 + + 3.1346169114112854e-01 5.5046397447586060e-01 + <_> + + 0 -1 164 -1.2858220376074314e-02 + + 2.5364819169044495e-01 5.7601428031921387e-01 + <_> + + 0 -1 165 4.1530239395797253e-03 + + 5.7677221298217773e-01 3.6597740650177002e-01 + <_> + + 0 -1 166 1.7092459602281451e-03 + + 2.8431910276412964e-01 5.9189391136169434e-01 + <_> + + 0 -1 167 7.5217359699308872e-03 + + 4.0524271130561829e-01 6.1831092834472656e-01 + <_> + + 0 -1 168 2.2479810286313295e-03 + + 5.7837551832199097e-01 3.1354010105133057e-01 + <_> + + 0 -1 169 5.2006211131811142e-02 + + 5.5413120985031128e-01 1.9166369736194611e-01 + <_> + + 0 -1 170 1.2085529975593090e-02 + + 4.0326559543609619e-01 6.6445910930633545e-01 + <_> + + 0 -1 171 1.4687820112158079e-05 + + 3.5359779000282288e-01 5.7093828916549683e-01 + <_> + + 0 -1 172 7.1395188570022583e-06 + + 3.0374449491500854e-01 5.6102699041366577e-01 + <_> + + 0 -1 173 -4.6001640148460865e-03 + + 7.1810871362686157e-01 4.5803260803222656e-01 + <_> + + 0 -1 174 2.0058949012309313e-03 + + 5.6219518184661865e-01 2.9536840319633484e-01 + <_> + + 0 -1 175 4.5050270855426788e-03 + + 4.6153879165649414e-01 7.6190179586410522e-01 + <_> + + 0 -1 176 1.1746830306947231e-02 + + 5.3438371419906616e-01 1.7725290358066559e-01 + <_> + + 0 -1 177 -5.8316338807344437e-02 + + 1.6862459480762482e-01 5.3407722711563110e-01 + <_> + + 0 -1 178 2.3629379575140774e-04 + + 3.7920561432838440e-01 6.0268038511276245e-01 + <_> + + 0 -1 179 -7.8156180679798126e-03 + + 1.5128670632839203e-01 5.3243237733840942e-01 + <_> + + 0 -1 180 -1.0876160115003586e-02 + + 2.0818220078945160e-01 5.3199452161788940e-01 + <_> + + 0 -1 181 -2.7745519764721394e-03 + + 4.0982469916343689e-01 5.2103281021118164e-01 + <_> + + 0 -1 182 -7.8276381827890873e-04 + + 5.6932741403579712e-01 3.4788420796394348e-01 + <_> + + 0 -1 183 1.3870409689843655e-02 + + 5.3267508745193481e-01 2.2576980292797089e-01 + <_> + + 0 -1 184 -2.3674910888075829e-02 + + 1.5513050556182861e-01 5.2007079124450684e-01 + <_> + + 0 -1 185 -1.4879409718560055e-05 + + 5.5005669593811035e-01 3.8201761245727539e-01 + <_> + + 0 -1 186 3.6190641112625599e-03 + + 4.2386838793754578e-01 6.6397482156753540e-01 + <_> + + 0 -1 187 -1.9817110151052475e-02 + + 2.1500380337238312e-01 5.3823578357696533e-01 + <_> + + 0 -1 188 -3.8154039066284895e-03 + + 6.6757112741470337e-01 4.2152971029281616e-01 + <_> + + 0 -1 189 -4.9775829538702965e-03 + + 2.2672890126705170e-01 5.3863281011581421e-01 + <_> + + 0 -1 190 2.2441020701080561e-03 + + 4.3086910247802734e-01 6.8557357788085938e-01 + <_> + + 0 -1 191 1.2282459996640682e-02 + + 5.8366149663925171e-01 3.4674790501594543e-01 + <_> + + 0 -1 192 -2.8548699337989092e-03 + + 7.0169448852539062e-01 4.3114539980888367e-01 + <_> + + 0 -1 193 -3.7875669077038765e-03 + + 2.8953450918197632e-01 5.2249461412429810e-01 + <_> + + 0 -1 194 -1.2201230274513364e-03 + + 2.9755708575248718e-01 5.4816448688507080e-01 + <_> + + 0 -1 195 1.0160599835216999e-02 + + 4.8888179659843445e-01 8.1826978921890259e-01 + <_> + + 0 -1 196 -1.6174569725990295e-02 + + 1.4814929664134979e-01 5.2399927377700806e-01 + <_> + + 0 -1 197 1.9292460754513741e-02 + + 4.7863098978996277e-01 7.3781907558441162e-01 + <_> + + 0 -1 198 -3.2479539513587952e-03 + + 7.3742228746414185e-01 4.4706439971923828e-01 + <_> + + 0 -1 199 -9.3803480267524719e-03 + + 3.4891548752784729e-01 5.5379962921142578e-01 + <_> + + 0 -1 200 -1.2606129981577396e-02 + + 2.3796869814395905e-01 5.3154432773590088e-01 + <_> + + 0 -1 201 -2.5621930137276649e-02 + + 1.9646880030632019e-01 5.1387697458267212e-01 + <_> + + 0 -1 202 -7.5741496402770281e-05 + + 5.5905228853225708e-01 3.3658531308174133e-01 + <_> + + 0 -1 203 -8.9210882782936096e-02 + + 6.3404656946659088e-02 5.1626348495483398e-01 + <_> + + 0 -1 204 -2.7670480776578188e-03 + + 7.3234677314758301e-01 4.4907060265541077e-01 + <_> + + 0 -1 205 2.7152578695677221e-04 + + 4.1148349642753601e-01 5.9855180978775024e-01 + <_> + 51 + 2.4527879714965820e+01 + + <_> + + 0 -1 206 1.4786219689995050e-03 + + 2.6635450124740601e-01 6.6433167457580566e-01 + <_> + + 0 -1 207 -1.8741659587249160e-03 + + 6.1438488960266113e-01 2.5185129046440125e-01 + <_> + + 0 -1 208 -1.7151009524241090e-03 + + 5.7663410902023315e-01 2.3974630236625671e-01 + <_> + + 0 -1 209 -1.8939269939437509e-03 + + 5.6820458173751831e-01 2.5291448831558228e-01 + <_> + + 0 -1 210 -5.3006052039563656e-03 + + 1.6406759619712830e-01 5.5560797452926636e-01 + <_> + + 0 -1 211 -4.6662531793117523e-02 + + 6.1231541633605957e-01 4.7628301382064819e-01 + <_> + + 0 -1 212 -7.9431332414969802e-04 + + 5.7078588008880615e-01 2.8394040465354919e-01 + <_> + + 0 -1 213 1.4891670085489750e-02 + + 4.0896728634834290e-01 6.0063672065734863e-01 + <_> + + 0 -1 214 -1.2046529445797205e-03 + + 5.7124507427215576e-01 2.7052891254425049e-01 + <_> + + 0 -1 215 6.0619381256401539e-03 + + 5.2625042200088501e-01 3.2622259855270386e-01 + <_> + + 0 -1 216 -2.5286648888140917e-03 + + 6.8538308143615723e-01 4.1992568969726562e-01 + <_> + + 0 -1 217 -5.9010218828916550e-03 + + 3.2662820816040039e-01 5.4348129034042358e-01 + <_> + + 0 -1 218 5.6702760048210621e-03 + + 5.4684108495712280e-01 2.3190039396286011e-01 + <_> + + 0 -1 219 -3.0304100364446640e-03 + + 5.5706679821014404e-01 2.7082380652427673e-01 + <_> + + 0 -1 220 2.9803649522364140e-03 + + 3.7005689740180969e-01 5.8906257152557373e-01 + <_> + + 0 -1 221 -7.5840510427951813e-02 + + 2.1400700509548187e-01 5.4199481010437012e-01 + <_> + + 0 -1 222 1.9262539222836494e-02 + + 5.5267721414566040e-01 2.7265900373458862e-01 + <_> + + 0 -1 223 1.8888259364757687e-04 + + 3.9580118656158447e-01 6.0172098875045776e-01 + <_> + + 0 -1 224 2.9369549825787544e-02 + + 5.2413737773895264e-01 1.4357580244541168e-01 + <_> + + 0 -1 225 1.0417619487270713e-03 + + 3.3854091167449951e-01 5.9299832582473755e-01 + <_> + + 0 -1 226 2.6125640142709017e-03 + + 5.4853779077529907e-01 3.0215978622436523e-01 + <_> + + 0 -1 227 9.6977467183023691e-04 + + 3.3752760291099548e-01 5.5320328474044800e-01 + <_> + + 0 -1 228 5.9512659208849072e-04 + + 5.6317430734634399e-01 3.3593991398811340e-01 + <_> + + 0 -1 229 -1.0156559944152832e-01 + + 6.3735038042068481e-02 5.2304250001907349e-01 + <_> + + 0 -1 230 3.6156699061393738e-02 + + 5.1369631290435791e-01 1.0295289754867554e-01 + <_> + + 0 -1 231 3.4624140243977308e-03 + + 3.8793200254440308e-01 5.5582892894744873e-01 + <_> + + 0 -1 232 1.9554980099201202e-02 + + 5.2500867843627930e-01 1.8758599460124969e-01 + <_> + + 0 -1 233 -2.3121440317481756e-03 + + 6.6720288991928101e-01 4.6796411275863647e-01 + <_> + + 0 -1 234 -1.8605289515107870e-03 + + 7.1633791923522949e-01 4.3346709012985229e-01 + <_> + + 0 -1 235 -9.4026362057775259e-04 + + 3.0213609337806702e-01 5.6502032279968262e-01 + <_> + + 0 -1 236 -5.2418331615626812e-03 + + 1.8200090527534485e-01 5.2502560615539551e-01 + <_> + + 0 -1 237 1.1729019752237946e-04 + + 3.3891880512237549e-01 5.4459732770919800e-01 + <_> + + 0 -1 238 1.1878840159624815e-03 + + 4.0853491425514221e-01 6.2535631656646729e-01 + <_> + + 0 -1 239 -1.0881359688937664e-02 + + 3.3783990144729614e-01 5.7000827789306641e-01 + <_> + + 0 -1 240 1.7354859737679362e-03 + + 4.2046359181404114e-01 6.5230387449264526e-01 + <_> + + 0 -1 241 -6.5119052305817604e-03 + + 2.5952160358428955e-01 5.4281437397003174e-01 + <_> + + 0 -1 242 -1.2136430013924837e-03 + + 6.1651438474655151e-01 3.9778938889503479e-01 + <_> + + 0 -1 243 -1.0354240424931049e-02 + + 1.6280280053615570e-01 5.2195048332214355e-01 + <_> + + 0 -1 244 5.5858830455690622e-04 + + 3.1996509432792664e-01 5.5035740137100220e-01 + <_> + + 0 -1 245 1.5299649909138680e-02 + + 4.1039940714836121e-01 6.1223882436752319e-01 + <_> + + 0 -1 246 -2.1588210016489029e-02 + + 1.0349129885435104e-01 5.1973849534988403e-01 + <_> + + 0 -1 247 -1.2834629416465759e-01 + + 8.4938651323318481e-01 4.8931029438972473e-01 + <_> + + 0 -1 248 -2.2927189711481333e-03 + + 3.1301578879356384e-01 5.4715752601623535e-01 + <_> + + 0 -1 249 7.9915106296539307e-02 + + 4.8563209176063538e-01 6.0739892721176147e-01 + <_> + + 0 -1 250 -7.9441092908382416e-02 + + 8.3946740627288818e-01 4.6245330572128296e-01 + <_> + + 0 -1 251 -5.2800010889768600e-03 + + 1.8816959857940674e-01 5.3066980838775635e-01 + <_> + + 0 -1 252 1.0463109938427806e-03 + + 5.2712291479110718e-01 2.5830659270286560e-01 + <_> + + 0 -1 253 2.6317298761568964e-04 + + 4.2353048920631409e-01 5.7354408502578735e-01 + <_> + + 0 -1 254 -3.6173160187900066e-03 + + 6.9343960285186768e-01 4.4954448938369751e-01 + <_> + + 0 -1 255 1.1421879753470421e-02 + + 5.9009212255477905e-01 4.1381931304931641e-01 + <_> + + 0 -1 256 -1.9963278900831938e-03 + + 6.4663827419281006e-01 4.3272399902343750e-01 + <_> + 56 + 2.7153350830078125e+01 + + <_> + + 0 -1 257 -9.9691245704889297e-03 + + 6.1423242092132568e-01 2.4822120368480682e-01 + <_> + + 0 -1 258 7.3073059320449829e-04 + + 5.7049518823623657e-01 2.3219659924507141e-01 + <_> + + 0 -1 259 6.4045301405712962e-04 + + 2.1122519671916962e-01 5.8149331808090210e-01 + <_> + + 0 -1 260 4.5424019917845726e-03 + + 2.9504820704460144e-01 5.8663117885589600e-01 + <_> + + 0 -1 261 9.2477443104144186e-05 + + 2.9909908771514893e-01 5.7913267612457275e-01 + <_> + + 0 -1 262 -8.6603146046400070e-03 + + 2.8130298852920532e-01 5.6355422735214233e-01 + <_> + + 0 -1 263 8.0515816807746887e-03 + + 3.5353690385818481e-01 6.0547572374343872e-01 + <_> + + 0 -1 264 4.3835240649059415e-04 + + 5.5965322256088257e-01 2.7315109968185425e-01 + <_> + + 0 -1 265 -9.8168973636347800e-05 + + 5.9780317544937134e-01 3.6385610699653625e-01 + <_> + + 0 -1 266 -1.1298790341243148e-03 + + 2.7552521228790283e-01 5.4327291250228882e-01 + <_> + + 0 -1 267 6.4356150105595589e-03 + + 4.3056419491767883e-01 7.0698332786560059e-01 + <_> + + 0 -1 268 -5.6829329580068588e-02 + + 2.4952429533004761e-01 5.2949970960617065e-01 + <_> + + 0 -1 269 4.0668169967830181e-03 + + 5.4785531759262085e-01 2.4977239966392517e-01 + <_> + + 0 -1 270 4.8164798499783501e-05 + + 3.9386010169982910e-01 5.7063561677932739e-01 + <_> + + 0 -1 271 6.1795017682015896e-03 + + 4.4076061248779297e-01 7.3947668075561523e-01 + <_> + + 0 -1 272 6.4985752105712891e-03 + + 5.4452431201934814e-01 2.4791529774665833e-01 + <_> + + 0 -1 273 -1.0211090557277203e-03 + + 2.5447669625282288e-01 5.3389710187911987e-01 + <_> + + 0 -1 274 -5.4247528314590454e-03 + + 2.7188581228256226e-01 5.3240692615509033e-01 + <_> + + 0 -1 275 -1.0559899965301156e-03 + + 3.1782880425453186e-01 5.5345088243484497e-01 + <_> + + 0 -1 276 6.6465808777138591e-04 + + 4.2842191457748413e-01 6.5581941604614258e-01 + <_> + + 0 -1 277 -2.7524109464138746e-04 + + 5.9028607606887817e-01 3.8102629780769348e-01 + <_> + + 0 -1 278 4.2293202131986618e-03 + + 3.8164898753166199e-01 5.7093858718872070e-01 + <_> + + 0 -1 279 -3.2868210691958666e-03 + + 1.7477439343929291e-01 5.2595442533493042e-01 + <_> + + 0 -1 280 1.5611879643984139e-04 + + 3.6017221212387085e-01 5.7256120443344116e-01 + <_> + + 0 -1 281 -7.3621381488919724e-06 + + 5.4018580913543701e-01 3.0444970726966858e-01 + <_> + + 0 -1 282 -1.4767250046133995e-02 + + 3.2207700610160828e-01 5.5734348297119141e-01 + <_> + + 0 -1 283 2.4489590898156166e-02 + + 4.3015280365943909e-01 6.5188127756118774e-01 + <_> + + 0 -1 284 -3.7652091123163700e-04 + + 3.5645830631256104e-01 5.5982369184494019e-01 + <_> + + 0 -1 285 7.3657688517414499e-06 + + 3.4907829761505127e-01 5.5618977546691895e-01 + <_> + + 0 -1 286 -1.5099939890205860e-02 + + 1.7762720584869385e-01 5.3352999687194824e-01 + <_> + + 0 -1 287 -3.8316650316119194e-03 + + 6.1496877670288086e-01 4.2213940620422363e-01 + <_> + + 0 -1 288 1.6925400123000145e-02 + + 5.4130148887634277e-01 2.1665850281715393e-01 + <_> + + 0 -1 289 -3.0477850232273340e-03 + + 6.4494907855987549e-01 4.3546178936958313e-01 + <_> + + 0 -1 290 3.2140589319169521e-03 + + 5.4001551866531372e-01 3.5232171416282654e-01 + <_> + + 0 -1 291 -4.0023201145231724e-03 + + 2.7745240926742554e-01 5.3384172916412354e-01 + <_> + + 0 -1 292 7.4182129465043545e-03 + + 5.6767392158508301e-01 3.7028178572654724e-01 + <_> + + 0 -1 293 -8.8764587417244911e-03 + + 7.7492219209671021e-01 4.5836889743804932e-01 + <_> + + 0 -1 294 2.7311739977449179e-03 + + 5.3387218713760376e-01 3.9966610074043274e-01 + <_> + + 0 -1 295 -2.5082379579544067e-03 + + 5.6119632720947266e-01 3.7774989008903503e-01 + <_> + + 0 -1 296 -8.0541074275970459e-03 + + 2.9152289032936096e-01 5.1791828870773315e-01 + <_> + + 0 -1 297 -9.7938813269138336e-04 + + 5.5364328622817993e-01 3.7001928687095642e-01 + <_> + + 0 -1 298 -5.8745909482240677e-03 + + 3.7543910741806030e-01 5.6793761253356934e-01 + <_> + + 0 -1 299 -4.4936719350516796e-03 + + 7.0196992158889771e-01 4.4809499382972717e-01 + <_> + + 0 -1 300 -5.4389229044318199e-03 + + 2.3103649914264679e-01 5.3133869171142578e-01 + <_> + + 0 -1 301 -7.5094640487805009e-04 + + 5.8648687601089478e-01 4.1293430328369141e-01 + <_> + + 0 -1 302 1.4528800420521293e-05 + + 3.7324070930480957e-01 5.6196212768554688e-01 + <_> + + 0 -1 303 4.0758069604635239e-02 + + 5.3120911121368408e-01 2.7205219864845276e-01 + <_> + + 0 -1 304 6.6505931317806244e-03 + + 4.7100159525871277e-01 6.6934937238693237e-01 + <_> + + 0 -1 305 4.5759351924061775e-03 + + 5.1678192615509033e-01 1.6372759640216827e-01 + <_> + + 0 -1 306 6.5269311890006065e-03 + + 5.3976088762283325e-01 2.9385319352149963e-01 + <_> + + 0 -1 307 -1.3660379685461521e-02 + + 7.0864880084991455e-01 4.5322000980377197e-01 + <_> + + 0 -1 308 2.7358869090676308e-02 + + 5.2064812183380127e-01 3.5892319679260254e-01 + <_> + + 0 -1 309 6.2197551596909761e-04 + + 3.5070759057998657e-01 5.4411232471466064e-01 + <_> + + 0 -1 310 -3.3077080734074116e-03 + + 5.8595228195190430e-01 4.0248918533325195e-01 + <_> + + 0 -1 311 -1.0631109587848186e-02 + + 6.7432671785354614e-01 4.4226029515266418e-01 + <_> + + 0 -1 312 1.9441649317741394e-02 + + 5.2827161550521851e-01 1.7979049682617188e-01 + <_> + 71 + 3.4554111480712891e+01 + + <_> + + 0 -1 313 -5.5052167735993862e-03 + + 5.9147310256958008e-01 2.6265591382980347e-01 + <_> + + 0 -1 314 1.9562279339879751e-03 + + 2.3125819861888885e-01 5.7416272163391113e-01 + <_> + + 0 -1 315 -8.8924784213304520e-03 + + 1.6565300524234772e-01 5.6266540288925171e-01 + <_> + + 0 -1 316 8.3638377487659454e-02 + + 5.4234498739242554e-01 1.9572949409484863e-01 + <_> + + 0 -1 317 1.2282270472496748e-03 + + 3.4179040789604187e-01 5.9925037622451782e-01 + <_> + + 0 -1 318 5.7629169896245003e-03 + + 3.7195819616317749e-01 6.0799038410186768e-01 + <_> + + 0 -1 319 -1.6417410224676132e-03 + + 2.5774860382080078e-01 5.5769157409667969e-01 + <_> + + 0 -1 320 3.4113149158656597e-03 + + 2.9507490992546082e-01 5.5141717195510864e-01 + <_> + + 0 -1 321 -1.1069320142269135e-02 + + 7.5693589448928833e-01 4.4770789146423340e-01 + <_> + + 0 -1 322 3.4865971654653549e-02 + + 5.5837088823318481e-01 2.6696211099624634e-01 + <_> + + 0 -1 323 6.5701099811121821e-04 + + 5.6273132562637329e-01 2.9888901114463806e-01 + <_> + + 0 -1 324 -2.4339130148291588e-02 + + 2.7711850404739380e-01 5.1088631153106689e-01 + <_> + + 0 -1 325 5.9435202274471521e-04 + + 5.5806517601013184e-01 3.1203418970108032e-01 + <_> + + 0 -1 326 2.2971509024500847e-03 + + 3.3302500844001770e-01 5.6790757179260254e-01 + <_> + + 0 -1 327 -3.7801829166710377e-03 + + 2.9905349016189575e-01 5.3448081016540527e-01 + <_> + + 0 -1 328 -1.3420669734477997e-01 + + 1.4638589322566986e-01 5.3925681114196777e-01 + <_> + + 0 -1 329 7.5224548345431685e-04 + + 3.7469539046287537e-01 5.6927347183227539e-01 + <_> + + 0 -1 330 -4.0545541793107986e-02 + + 2.7547478675842285e-01 5.4842978715896606e-01 + <_> + + 0 -1 331 1.2572970008477569e-03 + + 3.7445840239524841e-01 5.7560759782791138e-01 + <_> + + 0 -1 332 -7.4249948374927044e-03 + + 7.5138592720031738e-01 4.7282311320304871e-01 + <_> + + 0 -1 333 5.0908129196614027e-04 + + 5.4048967361450195e-01 2.9323211312294006e-01 + <_> + + 0 -1 334 -1.2808450264856219e-03 + + 6.1697798967361450e-01 4.2733490467071533e-01 + <_> + + 0 -1 335 -1.8348860321566463e-03 + + 2.0484960079193115e-01 5.2064722776412964e-01 + <_> + + 0 -1 336 2.7484869584441185e-02 + + 5.2529847621917725e-01 1.6755220293998718e-01 + <_> + + 0 -1 337 2.2372419480234385e-03 + + 5.2677828073501587e-01 2.7776581048965454e-01 + <_> + + 0 -1 338 -8.8635291904211044e-03 + + 6.9545578956604004e-01 4.8120489716529846e-01 + <_> + + 0 -1 339 4.1753971017897129e-03 + + 4.2918878793716431e-01 6.3491958379745483e-01 + <_> + + 0 -1 340 -1.7098189564421773e-03 + + 2.9305368661880493e-01 5.3612488508224487e-01 + <_> + + 0 -1 341 6.5328548662364483e-03 + + 4.4953250885009766e-01 7.4096941947937012e-01 + <_> + + 0 -1 342 -9.5372907817363739e-03 + + 3.1491199135780334e-01 5.4165017604827881e-01 + <_> + + 0 -1 343 2.5310989469289780e-02 + + 5.1218920946121216e-01 1.3117079436779022e-01 + <_> + + 0 -1 344 3.6460969597101212e-02 + + 5.1759117841720581e-01 2.5913399457931519e-01 + <_> + + 0 -1 345 2.0854329690337181e-02 + + 5.1371401548385620e-01 1.5823160111904144e-01 + <_> + + 0 -1 346 -8.7207747856155038e-04 + + 5.5743098258972168e-01 4.3989789485931396e-01 + <_> + + 0 -1 347 -1.5227000403683633e-05 + + 5.5489408969879150e-01 3.7080699205398560e-01 + <_> + + 0 -1 348 -8.4316509310156107e-04 + + 3.3874198794364929e-01 5.5542111396789551e-01 + <_> + + 0 -1 349 3.6037859972566366e-03 + + 5.3580617904663086e-01 3.4111711382865906e-01 + <_> + + 0 -1 350 -6.8057891912758350e-03 + + 6.1252027750015259e-01 4.3458628654479980e-01 + <_> + + 0 -1 351 -4.7021660953760147e-02 + + 2.3581659793853760e-01 5.1937389373779297e-01 + <_> + + 0 -1 352 -3.6954108625650406e-02 + + 7.3231112957000732e-01 4.7609439492225647e-01 + <_> + + 0 -1 353 1.0439479956403375e-03 + + 5.4194551706314087e-01 3.4113308787345886e-01 + <_> + + 0 -1 354 -2.1050689974799752e-04 + + 2.8216940164566040e-01 5.5549472570419312e-01 + <_> + + 0 -1 355 -8.0831587314605713e-02 + + 9.1299301385879517e-01 4.6974349021911621e-01 + <_> + + 0 -1 356 -3.6579059087671340e-04 + + 6.0226702690124512e-01 3.9782929420471191e-01 + <_> + + 0 -1 357 -1.2545920617412776e-04 + + 5.6132131814956665e-01 3.8455399870872498e-01 + <_> + + 0 -1 358 -6.8786486983299255e-02 + + 2.2616119682788849e-01 5.3004968166351318e-01 + <_> + + 0 -1 359 1.2415789999067783e-02 + + 4.0756919980049133e-01 5.8288121223449707e-01 + <_> + + 0 -1 360 -4.7174817882478237e-03 + + 2.8272539377212524e-01 5.2677577733993530e-01 + <_> + + 0 -1 361 3.8136858493089676e-02 + + 5.0747412443161011e-01 1.0236159712076187e-01 + <_> + + 0 -1 362 -2.8168049175292253e-03 + + 6.1690068244934082e-01 4.3596929311752319e-01 + <_> + + 0 -1 363 8.1303603947162628e-03 + + 4.5244330167770386e-01 7.6060950756072998e-01 + <_> + + 0 -1 364 6.0056019574403763e-03 + + 5.2404087781906128e-01 1.8597120046615601e-01 + <_> + + 0 -1 365 1.9139319658279419e-02 + + 5.2093791961669922e-01 2.3320719599723816e-01 + <_> + + 0 -1 366 1.6445759683847427e-02 + + 5.4507029056549072e-01 3.2642349600791931e-01 + <_> + + 0 -1 367 -3.7356890738010406e-02 + + 6.9990468025207520e-01 4.5332419872283936e-01 + <_> + + 0 -1 368 -1.9727900624275208e-02 + + 2.6536649465560913e-01 5.4128098487854004e-01 + <_> + + 0 -1 369 6.6972579807043076e-03 + + 4.4805660843849182e-01 7.1386522054672241e-01 + <_> + + 0 -1 370 7.4457528535276651e-04 + + 4.2313501238822937e-01 5.4713201522827148e-01 + <_> + + 0 -1 371 1.1790640419349074e-03 + + 5.3417021036148071e-01 3.1304550170898438e-01 + <_> + + 0 -1 372 3.4980610013008118e-02 + + 5.1186597347259521e-01 3.4305301308631897e-01 + <_> + + 0 -1 373 5.6859792675822973e-04 + + 3.5321870446205139e-01 5.4686397314071655e-01 + <_> + + 0 -1 374 -1.1340649798512459e-02 + + 2.8423538804054260e-01 5.3487008810043335e-01 + <_> + + 0 -1 375 -6.6228108480572701e-03 + + 6.8836402893066406e-01 4.4926649332046509e-01 + <_> + + 0 -1 376 -8.0160330981016159e-03 + + 1.7098939418792725e-01 5.2243089675903320e-01 + <_> + + 0 -1 377 1.4206819469109178e-03 + + 5.2908462285995483e-01 2.9933831095695496e-01 + <_> + + 0 -1 378 -2.7801711112260818e-03 + + 6.4988541603088379e-01 4.4604998826980591e-01 + <_> + + 0 -1 379 -1.4747589593753219e-03 + + 3.2604381442070007e-01 5.3881132602691650e-01 + <_> + + 0 -1 380 -2.3830339312553406e-02 + + 7.5289410352706909e-01 4.8012199997901917e-01 + <_> + + 0 -1 381 6.9369790144264698e-03 + + 5.3351658582687378e-01 3.2614278793334961e-01 + <_> + + 0 -1 382 8.2806255668401718e-03 + + 4.5803940296173096e-01 5.7378298044204712e-01 + <_> + + 0 -1 383 -1.0439500212669373e-02 + + 2.5923201441764832e-01 5.2338278293609619e-01 + <_> + 80 + 3.9107288360595703e+01 + + <_> + + 0 -1 384 7.2006587870419025e-03 + + 3.2588860392570496e-01 6.8498080968856812e-01 + <_> + + 0 -1 385 -2.8593589086085558e-03 + + 5.8388811349868774e-01 2.5378298759460449e-01 + <_> + + 0 -1 386 6.8580528022721410e-04 + + 5.7080817222595215e-01 2.8124240040779114e-01 + <_> + + 0 -1 387 7.9580191522836685e-03 + + 2.5010511279106140e-01 5.5442607402801514e-01 + <_> + + 0 -1 388 -1.2124150525778532e-03 + + 2.3853680491447449e-01 5.4333502054214478e-01 + <_> + + 0 -1 389 7.9426132142543793e-03 + + 3.9550709724426270e-01 6.2207579612731934e-01 + <_> + + 0 -1 390 2.4630590341985226e-03 + + 5.6397080421447754e-01 2.9923579096794128e-01 + <_> + + 0 -1 391 -6.0396599583327770e-03 + + 2.1865129470825195e-01 5.4116767644882202e-01 + <_> + + 0 -1 392 -1.2988339876756072e-03 + + 2.3507060110569000e-01 5.3645849227905273e-01 + <_> + + 0 -1 393 2.2299369447864592e-04 + + 3.8041129708290100e-01 5.7296061515808105e-01 + <_> + + 0 -1 394 1.4654280385002494e-03 + + 2.5101679563522339e-01 5.2582687139511108e-01 + <_> + + 0 -1 395 -8.1210042117163539e-04 + + 5.9928238391876221e-01 3.8511589169502258e-01 + <_> + + 0 -1 396 -1.3836020370945334e-03 + + 5.6813961267471313e-01 3.6365869641304016e-01 + <_> + + 0 -1 397 -2.7936449274420738e-02 + + 1.4913170039653778e-01 5.3775602579116821e-01 + <_> + + 0 -1 398 -4.6919551095925272e-04 + + 3.6924299597740173e-01 5.5724847316741943e-01 + <_> + + 0 -1 399 -4.9829659983515739e-03 + + 6.7585092782974243e-01 4.5325040817260742e-01 + <_> + + 0 -1 400 1.8815309740602970e-03 + + 5.3680229187011719e-01 2.9325398802757263e-01 + <_> + + 0 -1 401 -1.9067550078034401e-02 + + 1.6493770480155945e-01 5.3300672769546509e-01 + <_> + + 0 -1 402 -4.6906559728085995e-03 + + 1.9639259576797485e-01 5.1193618774414062e-01 + <_> + + 0 -1 403 5.9777139686048031e-03 + + 4.6711719036102295e-01 7.0083981752395630e-01 + <_> + + 0 -1 404 -3.3303130418062210e-02 + + 1.1554169654846191e-01 5.1041620969772339e-01 + <_> + + 0 -1 405 9.0744107961654663e-02 + + 5.1496601104736328e-01 1.3061730563640594e-01 + <_> + + 0 -1 406 9.3555898638442159e-04 + + 3.6054810881614685e-01 5.4398590326309204e-01 + <_> + + 0 -1 407 1.4901650138199329e-02 + + 4.8862120509147644e-01 7.6875698566436768e-01 + <_> + + 0 -1 408 6.1594118596985936e-04 + + 5.3568130731582642e-01 3.2409390807151794e-01 + <_> + + 0 -1 409 -5.0670988857746124e-02 + + 1.8486219644546509e-01 5.2304041385650635e-01 + <_> + + 0 -1 410 6.8665749859064817e-04 + + 3.8405799865722656e-01 5.5179458856582642e-01 + <_> + + 0 -1 411 8.3712432533502579e-03 + + 4.2885640263557434e-01 6.1317539215087891e-01 + <_> + + 0 -1 412 -1.2953069526702166e-03 + + 2.9136741161346436e-01 5.2807378768920898e-01 + <_> + + 0 -1 413 -4.1941680014133453e-02 + + 7.5547999143600464e-01 4.8560309410095215e-01 + <_> + + 0 -1 414 -2.3529380559921265e-02 + + 2.8382799029350281e-01 5.2560812234878540e-01 + <_> + + 0 -1 415 4.0857449173927307e-02 + + 4.8709350824356079e-01 6.2772971391677856e-01 + <_> + + 0 -1 416 -2.5406869128346443e-02 + + 7.0997077226638794e-01 4.5750290155410767e-01 + <_> + + 0 -1 417 -4.1415440500713885e-04 + + 4.0308868885040283e-01 5.4694122076034546e-01 + <_> + + 0 -1 418 2.1824119612574577e-02 + + 4.5020240545272827e-01 6.7687010765075684e-01 + <_> + + 0 -1 419 1.4114039950072765e-02 + + 5.4428607225418091e-01 3.7917000055313110e-01 + <_> + + 0 -1 420 6.7214590671937913e-05 + + 4.2004638910293579e-01 5.8734762668609619e-01 + <_> + + 0 -1 421 -7.9417638480663300e-03 + + 3.7925618886947632e-01 5.5852657556533813e-01 + <_> + + 0 -1 422 -7.2144409641623497e-03 + + 7.2531038522720337e-01 4.6035489439964294e-01 + <_> + + 0 -1 423 2.5817339774221182e-03 + + 4.6933019161224365e-01 5.9002387523651123e-01 + <_> + + 0 -1 424 1.3409319519996643e-01 + + 5.1492130756378174e-01 1.8088449537754059e-01 + <_> + + 0 -1 425 2.2962710354477167e-03 + + 5.3997439146041870e-01 3.7178671360015869e-01 + <_> + + 0 -1 426 -2.1575849968940020e-03 + + 2.4084959924221039e-01 5.1488637924194336e-01 + <_> + + 0 -1 427 -4.9196188338100910e-03 + + 6.5735882520675659e-01 4.7387400269508362e-01 + <_> + + 0 -1 428 1.6267469618469477e-03 + + 4.1928219795227051e-01 6.3031142950057983e-01 + <_> + + 0 -1 429 3.3413388882763684e-04 + + 5.5402982234954834e-01 3.7021011114120483e-01 + <_> + + 0 -1 430 -2.6698080822825432e-02 + + 1.7109179496765137e-01 5.1014107465744019e-01 + <_> + + 0 -1 431 -3.0561879277229309e-02 + + 1.9042180478572845e-01 5.1687937974929810e-01 + <_> + + 0 -1 432 2.8511548880487680e-03 + + 4.4475069642066956e-01 6.3138538599014282e-01 + <_> + + 0 -1 433 -3.6211479455232620e-02 + + 2.4907270073890686e-01 5.3773492574691772e-01 + <_> + + 0 -1 434 -2.4115189444273710e-03 + + 5.3812432289123535e-01 3.6642369627952576e-01 + <_> + + 0 -1 435 -7.7253201743587852e-04 + + 5.5302321910858154e-01 3.5415500402450562e-01 + <_> + + 0 -1 436 2.9481729143299162e-04 + + 4.1326990723609924e-01 5.6672430038452148e-01 + <_> + + 0 -1 437 -6.2334560789167881e-03 + + 9.8787233233451843e-02 5.1986688375473022e-01 + <_> + + 0 -1 438 -2.6274729520082474e-02 + + 9.1127492487430573e-02 5.0281071662902832e-01 + <_> + + 0 -1 439 5.3212260827422142e-03 + + 4.7266489267349243e-01 6.2227207422256470e-01 + <_> + + 0 -1 440 -4.1129058226943016e-03 + + 2.1574570238590240e-01 5.1378047466278076e-01 + <_> + + 0 -1 441 3.2457809429615736e-03 + + 5.4107707738876343e-01 3.7217769026756287e-01 + <_> + + 0 -1 442 -1.6359709203243256e-02 + + 7.7878749370574951e-01 4.6852919459342957e-01 + <_> + + 0 -1 443 3.2166109303943813e-04 + + 5.4789870977401733e-01 4.2403739690780640e-01 + <_> + + 0 -1 444 6.4452440710738301e-04 + + 5.3305608034133911e-01 3.5013249516487122e-01 + <_> + + 0 -1 445 -7.8909732401371002e-03 + + 6.9235211610794067e-01 4.7265690565109253e-01 + <_> + + 0 -1 446 4.8336211591959000e-02 + + 5.0559002161026001e-01 7.5749203562736511e-02 + <_> + + 0 -1 447 -7.5178127735853195e-04 + + 3.7837418913841248e-01 5.5385738611221313e-01 + <_> + + 0 -1 448 -2.4953910615295172e-03 + + 3.0816510319709778e-01 5.3596121072769165e-01 + <_> + + 0 -1 449 -2.2385010961443186e-03 + + 6.6339588165283203e-01 4.6493428945541382e-01 + <_> + + 0 -1 450 -1.7988430336117744e-03 + + 6.5968447923660278e-01 4.3471878767013550e-01 + <_> + + 0 -1 451 8.7860915809869766e-03 + + 5.2318328619003296e-01 2.3155799508094788e-01 + <_> + + 0 -1 452 3.6715380847454071e-03 + + 5.2042502164840698e-01 2.9773768782615662e-01 + <_> + + 0 -1 453 -3.5336449742317200e-02 + + 7.2388780117034912e-01 4.8615050315856934e-01 + <_> + + 0 -1 454 -6.9189240457490087e-04 + + 3.1050220131874084e-01 5.2298247814178467e-01 + <_> + + 0 -1 455 -3.3946109469980001e-03 + + 3.1389680504798889e-01 5.2101737260818481e-01 + <_> + + 0 -1 456 9.8569283727556467e-04 + + 4.5365801453590393e-01 6.5850979089736938e-01 + <_> + + 0 -1 457 -5.0163101404905319e-02 + + 1.8044540286064148e-01 5.1989167928695679e-01 + <_> + + 0 -1 458 -2.2367259953171015e-03 + + 7.2557020187377930e-01 4.6513590216636658e-01 + <_> + + 0 -1 459 7.4326287722215056e-04 + + 4.4129210710525513e-01 5.8985459804534912e-01 + <_> + + 0 -1 460 -9.3485182151198387e-04 + + 3.5000529885292053e-01 5.3660178184509277e-01 + <_> + + 0 -1 461 1.7497939988970757e-02 + + 4.9121949076652527e-01 8.3152848482131958e-01 + <_> + + 0 -1 462 -1.5200000489130616e-03 + + 3.5702759027481079e-01 5.3705602884292603e-01 + <_> + + 0 -1 463 7.8003940870985389e-04 + + 4.3537721037864685e-01 5.9673351049423218e-01 + <_> + 103 + 5.0610481262207031e+01 + + <_> + + 0 -1 464 -9.9945552647113800e-03 + + 6.1625832319259644e-01 3.0545330047607422e-01 + <_> + + 0 -1 465 -1.1085229925811291e-03 + + 5.8182948827743530e-01 3.1555780768394470e-01 + <_> + + 0 -1 466 1.0364380432292819e-03 + + 2.5520521402359009e-01 5.6929117441177368e-01 + <_> + + 0 -1 467 6.8211311008781195e-04 + + 3.6850899457931519e-01 5.9349310398101807e-01 + <_> + + 0 -1 468 -6.8057340104132891e-04 + + 2.3323920369148254e-01 5.4747921228408813e-01 + <_> + + 0 -1 469 2.6068789884448051e-04 + + 3.2574570178985596e-01 5.6675457954406738e-01 + <_> + + 0 -1 470 5.1607372006401420e-04 + + 3.7447169423103333e-01 5.8454728126525879e-01 + <_> + + 0 -1 471 8.5007521556690335e-04 + + 3.4203711152076721e-01 5.5228072404861450e-01 + <_> + + 0 -1 472 -1.8607829697430134e-03 + + 2.8044199943542480e-01 5.3754240274429321e-01 + <_> + + 0 -1 473 -1.5033970121294260e-03 + + 2.5790509581565857e-01 5.4989522695541382e-01 + <_> + + 0 -1 474 2.3478909861296415e-03 + + 4.1751560568809509e-01 6.3137108087539673e-01 + <_> + + 0 -1 475 -2.8880240279249847e-04 + + 5.8651697635650635e-01 4.0526661276817322e-01 + <_> + + 0 -1 476 8.9405477046966553e-03 + + 5.2111411094665527e-01 2.3186540603637695e-01 + <_> + + 0 -1 477 -1.9327739253640175e-02 + + 2.7534329891204834e-01 5.2415257692337036e-01 + <_> + + 0 -1 478 -2.0202060113660991e-04 + + 5.7229787111282349e-01 3.6771959066390991e-01 + <_> + + 0 -1 479 2.1179069299250841e-03 + + 4.4661080837249756e-01 5.5424308776855469e-01 + <_> + + 0 -1 480 -1.7743760254234076e-03 + + 2.8132531046867371e-01 5.3009599447250366e-01 + <_> + + 0 -1 481 4.2234458960592747e-03 + + 4.3997099995613098e-01 5.7954281568527222e-01 + <_> + + 0 -1 482 -1.4375220052897930e-02 + + 2.9811179637908936e-01 5.2920591831207275e-01 + <_> + + 0 -1 483 -1.5349180437624454e-02 + + 7.7052152156829834e-01 4.7481718659400940e-01 + <_> + + 0 -1 484 1.5152279956964776e-05 + + 3.7188440561294556e-01 5.5768972635269165e-01 + <_> + + 0 -1 485 -9.1293919831514359e-03 + + 3.6151960492134094e-01 5.2867668867111206e-01 + <_> + + 0 -1 486 2.2512159775942564e-03 + + 5.3647047281265259e-01 3.4862980246543884e-01 + <_> + + 0 -1 487 -4.9696918576955795e-03 + + 6.9276517629623413e-01 4.6768361330032349e-01 + <_> + + 0 -1 488 -1.2829010374844074e-02 + + 7.7121537923812866e-01 4.6607351303100586e-01 + <_> + + 0 -1 489 -9.3660065904259682e-03 + + 3.3749839663505554e-01 5.3512877225875854e-01 + <_> + + 0 -1 490 3.2452319283038378e-03 + + 5.3251898288726807e-01 3.2896101474761963e-01 + <_> + + 0 -1 491 -1.1723560281097889e-02 + + 6.8376529216766357e-01 4.7543001174926758e-01 + <_> + + 0 -1 492 2.9257940695970319e-05 + + 3.5720878839492798e-01 5.3605020046234131e-01 + <_> + + 0 -1 493 -2.2244219508138485e-05 + + 5.5414271354675293e-01 3.5520640015602112e-01 + <_> + + 0 -1 494 5.0881509669125080e-03 + + 5.0708442926406860e-01 1.2564620375633240e-01 + <_> + + 0 -1 495 2.7429679408669472e-02 + + 5.2695602178573608e-01 1.6258180141448975e-01 + <_> + + 0 -1 496 -6.4142867922782898e-03 + + 7.1455889940261841e-01 4.5841971039772034e-01 + <_> + + 0 -1 497 3.3479959238320589e-03 + + 5.3986120223999023e-01 3.4946969151496887e-01 + <_> + + 0 -1 498 -8.2635492086410522e-02 + + 2.4391929805278778e-01 5.1602262258529663e-01 + <_> + + 0 -1 499 1.0261740535497665e-03 + + 3.8868919014930725e-01 5.7679080963134766e-01 + <_> + + 0 -1 500 -1.6307090409100056e-03 + + 3.3894580602645874e-01 5.3477007150650024e-01 + <_> + + 0 -1 501 2.4546680506318808e-03 + + 4.6014139056205750e-01 6.3872468471527100e-01 + <_> + + 0 -1 502 -9.9476519972085953e-04 + + 5.7698792219161987e-01 4.1203960776329041e-01 + <_> + + 0 -1 503 1.5409190207719803e-02 + + 4.8787090182304382e-01 7.0898222923278809e-01 + <_> + + 0 -1 504 1.1784400558099151e-03 + + 5.2635532617568970e-01 2.8952449560165405e-01 + <_> + + 0 -1 505 -2.7701919898390770e-02 + + 1.4988289773464203e-01 5.2196067571640015e-01 + <_> + + 0 -1 506 -2.9505399987101555e-02 + + 2.4893319234251976e-02 4.9998161196708679e-01 + <_> + + 0 -1 507 4.5159430010244250e-04 + + 5.4646229743957520e-01 4.0296629071235657e-01 + <_> + + 0 -1 508 7.1772639639675617e-03 + + 4.2710569500923157e-01 5.8662968873977661e-01 + <_> + + 0 -1 509 -7.4182048439979553e-02 + + 6.8741792440414429e-01 4.9190279841423035e-01 + <_> + + 0 -1 510 -1.7254160717129707e-02 + + 3.3706760406494141e-01 5.3487390279769897e-01 + <_> + + 0 -1 511 1.4851559884846210e-02 + + 4.6267929673194885e-01 6.1299049854278564e-01 + <_> + + 0 -1 512 1.0002000257372856e-02 + + 5.3461229801177979e-01 3.4234538674354553e-01 + <_> + + 0 -1 513 2.0138120744377375e-03 + + 4.6438300609588623e-01 5.8243042230606079e-01 + <_> + + 0 -1 514 1.5135470312088728e-03 + + 5.1963961124420166e-01 2.8561499714851379e-01 + <_> + + 0 -1 515 3.1381431035697460e-03 + + 4.8381629586219788e-01 5.9585297107696533e-01 + <_> + + 0 -1 516 -5.1450440660119057e-03 + + 8.9203029870986938e-01 4.7414121031761169e-01 + <_> + + 0 -1 517 -4.4736708514392376e-03 + + 2.0339429378509521e-01 5.3372788429260254e-01 + <_> + + 0 -1 518 1.9628470763564110e-03 + + 4.5716339349746704e-01 6.7258632183074951e-01 + <_> + + 0 -1 519 5.4260450415313244e-03 + + 5.2711081504821777e-01 2.8456708788871765e-01 + <_> + + 0 -1 520 4.9611460417509079e-04 + + 4.1383129358291626e-01 5.7185977697372437e-01 + <_> + + 0 -1 521 9.3728788197040558e-03 + + 5.2251511812210083e-01 2.8048470616340637e-01 + <_> + + 0 -1 522 6.0500897234305739e-04 + + 5.2367687225341797e-01 3.3145239949226379e-01 + <_> + + 0 -1 523 5.6792551185935736e-04 + + 4.5310598611831665e-01 6.2769711017608643e-01 + <_> + + 0 -1 524 2.4644339457154274e-02 + + 5.1308518648147583e-01 2.0171439647674561e-01 + <_> + + 0 -1 525 -1.0290450416505337e-02 + + 7.7865952253341675e-01 4.8766410350799561e-01 + <_> + + 0 -1 526 2.0629419013857841e-03 + + 4.2885988950729370e-01 5.8812642097473145e-01 + <_> + + 0 -1 527 -5.0519481301307678e-03 + + 3.5239779949188232e-01 5.2860087156295776e-01 + <_> + + 0 -1 528 -5.7692620903253555e-03 + + 6.8410861492156982e-01 4.5880940556526184e-01 + <_> + + 0 -1 529 -4.5789941214025021e-04 + + 3.5655200481414795e-01 5.4859781265258789e-01 + <_> + + 0 -1 530 -7.5918837683275342e-04 + + 3.3687931299209595e-01 5.2541971206665039e-01 + <_> + + 0 -1 531 -1.7737259622663260e-03 + + 3.4221610426902771e-01 5.4540151357650757e-01 + <_> + + 0 -1 532 -8.5610467940568924e-03 + + 6.5336120128631592e-01 4.4858568906784058e-01 + <_> + + 0 -1 533 1.7277270089834929e-03 + + 5.3075802326202393e-01 3.9253529906272888e-01 + <_> + + 0 -1 534 -2.8199609369039536e-02 + + 6.8574589490890503e-01 4.5885840058326721e-01 + <_> + + 0 -1 535 -1.7781109781935811e-03 + + 4.0378510951995850e-01 5.3698569536209106e-01 + <_> + + 0 -1 536 3.3177141449414194e-04 + + 5.3997987508773804e-01 3.7057501077651978e-01 + <_> + + 0 -1 537 2.6385399978607893e-03 + + 4.6654370427131653e-01 6.4527308940887451e-01 + <_> + + 0 -1 538 -2.1183069329708815e-03 + + 5.9147810935974121e-01 4.0646770596504211e-01 + <_> + + 0 -1 539 -1.4773289673030376e-02 + + 3.6420381069183350e-01 5.2947628498077393e-01 + <_> + + 0 -1 540 -1.6815440729260445e-02 + + 2.6642319560050964e-01 5.1449728012084961e-01 + <_> + + 0 -1 541 -6.3370140269398689e-03 + + 6.7795312404632568e-01 4.8520979285240173e-01 + <_> + + 0 -1 542 -4.4560048991115764e-05 + + 5.6139647960662842e-01 4.1530540585517883e-01 + <_> + + 0 -1 543 -1.0240620467811823e-03 + + 5.9644782543182373e-01 4.5663040876388550e-01 + <_> + + 0 -1 544 -2.3161689750850201e-03 + + 2.9761150479316711e-01 5.1881599426269531e-01 + <_> + + 0 -1 545 5.3217571973800659e-01 + + 5.1878392696380615e-01 2.2026319801807404e-01 + <_> + + 0 -1 546 -1.6643050312995911e-01 + + 1.8660229444503784e-01 5.0603431463241577e-01 + <_> + + 0 -1 547 1.1253529787063599e-01 + + 5.2121251821517944e-01 1.1850229650735855e-01 + <_> + + 0 -1 548 9.3046864494681358e-03 + + 4.5899370312690735e-01 6.8261492252349854e-01 + <_> + + 0 -1 549 -4.6255099587142467e-03 + + 3.0799409747123718e-01 5.2250087261199951e-01 + <_> + + 0 -1 550 -1.1116469651460648e-01 + + 2.1010440587997437e-01 5.0808018445968628e-01 + <_> + + 0 -1 551 -1.0888439603149891e-02 + + 5.7653552293777466e-01 4.7904640436172485e-01 + <_> + + 0 -1 552 5.8564301580190659e-03 + + 5.0651001930236816e-01 1.5635989606380463e-01 + <_> + + 0 -1 553 5.4854389280080795e-02 + + 4.9669149518013000e-01 7.2305107116699219e-01 + <_> + + 0 -1 554 -1.1197339743375778e-02 + + 2.1949790418148041e-01 5.0987982749938965e-01 + <_> + + 0 -1 555 4.4069071300327778e-03 + + 4.7784018516540527e-01 6.7709028720855713e-01 + <_> + + 0 -1 556 -6.3665293157100677e-02 + + 1.9363629817962646e-01 5.0810241699218750e-01 + <_> + + 0 -1 557 -9.8081491887569427e-03 + + 5.9990632534027100e-01 4.8103410005569458e-01 + <_> + + 0 -1 558 -2.1717099007219076e-03 + + 3.3383339643478394e-01 5.2354729175567627e-01 + <_> + + 0 -1 559 -1.3315520249307156e-02 + + 6.6170698404312134e-01 4.9192130565643311e-01 + <_> + + 0 -1 560 2.5442079640924931e-03 + + 4.4887441396713257e-01 6.0821849107742310e-01 + <_> + + 0 -1 561 1.2037839740514755e-02 + + 5.4093921184539795e-01 3.2924321293830872e-01 + <_> + + 0 -1 562 -2.0701050758361816e-02 + + 6.8191200494766235e-01 4.5949959754943848e-01 + <_> + + 0 -1 563 2.7608279138803482e-02 + + 4.6307921409606934e-01 5.7672828435897827e-01 + <_> + + 0 -1 564 1.2370620388537645e-03 + + 5.1653790473937988e-01 2.6350161433219910e-01 + <_> + + 0 -1 565 -3.7669338285923004e-02 + + 2.5363931059837341e-01 5.2789801359176636e-01 + <_> + + 0 -1 566 -1.8057259730994701e-03 + + 3.9851561188697815e-01 5.5175000429153442e-01 + <_> + 111 + 5.4620071411132812e+01 + + <_> + + 0 -1 567 4.4299028813838959e-03 + + 2.8910180926322937e-01 6.3352262973785400e-01 + <_> + + 0 -1 568 -2.3813319858163595e-03 + + 6.2117892503738403e-01 3.4774878621101379e-01 + <_> + + 0 -1 569 2.2915711160749197e-03 + + 2.2544120252132416e-01 5.5821180343627930e-01 + <_> + + 0 -1 570 9.9457940086722374e-04 + + 3.7117108702659607e-01 5.9300708770751953e-01 + <_> + + 0 -1 571 7.7164667891338468e-04 + + 5.6517201662063599e-01 3.3479958772659302e-01 + <_> + + 0 -1 572 -1.1386410333216190e-03 + + 3.0691260099411011e-01 5.5086308717727661e-01 + <_> + + 0 -1 573 -1.6403039626311511e-04 + + 5.7628279924392700e-01 3.6990478634834290e-01 + <_> + + 0 -1 574 2.9793529392918572e-05 + + 2.6442441344261169e-01 5.4379111528396606e-01 + <_> + + 0 -1 575 8.5774902254343033e-03 + + 5.0511389970779419e-01 1.7957249283790588e-01 + <_> + + 0 -1 576 -2.6032689493149519e-04 + + 5.8269691467285156e-01 4.4468268752098083e-01 + <_> + + 0 -1 577 -6.1404630541801453e-03 + + 3.1138521432876587e-01 5.3469717502593994e-01 + <_> + + 0 -1 578 -2.3086950182914734e-02 + + 3.2779461145401001e-01 5.3311979770660400e-01 + <_> + + 0 -1 579 -1.4243650250136852e-02 + + 7.3817098140716553e-01 4.5880630612373352e-01 + <_> + + 0 -1 580 1.9487129524350166e-02 + + 5.2566307783126831e-01 2.2744719684123993e-01 + <_> + + 0 -1 581 -9.6681108698248863e-04 + + 5.5112308263778687e-01 3.8150069117546082e-01 + <_> + + 0 -1 582 3.1474709976464510e-03 + + 5.4256367683410645e-01 2.5437268614768982e-01 + <_> + + 0 -1 583 -1.8026070029009134e-04 + + 5.3801918029785156e-01 3.4063041210174561e-01 + <_> + + 0 -1 584 -6.0266260989010334e-03 + + 3.0358019471168518e-01 5.4205721616744995e-01 + <_> + + 0 -1 585 4.4462960795499384e-04 + + 3.9909970760345459e-01 5.6601101160049438e-01 + <_> + + 0 -1 586 2.2609760053455830e-03 + + 5.5628067255020142e-01 3.9406880736351013e-01 + <_> + + 0 -1 587 5.1133058965206146e-02 + + 4.6096539497375488e-01 7.1185618638992310e-01 + <_> + + 0 -1 588 -1.7786309123039246e-02 + + 2.3161660134792328e-01 5.3221440315246582e-01 + <_> + + 0 -1 589 -4.9679628573358059e-03 + + 2.3307719826698303e-01 5.1220291852951050e-01 + <_> + + 0 -1 590 2.0667689386755228e-03 + + 4.6574440598487854e-01 6.4554882049560547e-01 + <_> + + 0 -1 591 7.4413768015801907e-03 + + 5.1543921232223511e-01 2.3616339266300201e-01 + <_> + + 0 -1 592 -3.6277279723435640e-03 + + 6.2197732925415039e-01 4.4766610860824585e-01 + <_> + + 0 -1 593 -5.3530759178102016e-03 + + 1.8373550474643707e-01 5.1022082567214966e-01 + <_> + + 0 -1 594 1.4530919492244720e-01 + + 5.1459872722625732e-01 1.5359309315681458e-01 + <_> + + 0 -1 595 2.4394490756094456e-03 + + 5.3436601161956787e-01 3.6246618628501892e-01 + <_> + + 0 -1 596 -3.1283390708267689e-03 + + 6.2150079011917114e-01 4.8455920815467834e-01 + <_> + + 0 -1 597 1.7940260004252195e-03 + + 4.2992618680000305e-01 5.8241981267929077e-01 + <_> + + 0 -1 598 3.6253821104764938e-02 + + 5.2603340148925781e-01 1.4394679665565491e-01 + <_> + + 0 -1 599 -5.1746722310781479e-03 + + 3.5065388679504395e-01 5.2870452404022217e-01 + <_> + + 0 -1 600 6.5383297624066472e-04 + + 4.8096409440040588e-01 6.1220401525497437e-01 + <_> + + 0 -1 601 -2.6480229571461678e-02 + + 1.1393620073795319e-01 5.0455862283706665e-01 + <_> + + 0 -1 602 -3.0440660193562508e-03 + + 6.3520950078964233e-01 4.7947341203689575e-01 + <_> + + 0 -1 603 3.6993520334362984e-03 + + 5.1311182975769043e-01 2.4985109269618988e-01 + <_> + + 0 -1 604 -3.6762931267730892e-04 + + 5.4213947057723999e-01 3.7095320224761963e-01 + <_> + + 0 -1 605 -4.1382260620594025e-02 + + 1.8949599564075470e-01 5.0816917419433594e-01 + <_> + + 0 -1 606 -1.0532729793339968e-03 + + 6.4543670415878296e-01 4.7836089134216309e-01 + <_> + + 0 -1 607 -2.1648600231856108e-03 + + 6.2150311470031738e-01 4.4998261332511902e-01 + <_> + + 0 -1 608 -5.6747748749330640e-04 + + 3.7126109004020691e-01 5.4193347692489624e-01 + <_> + + 0 -1 609 1.7375840246677399e-01 + + 5.0236439704895020e-01 1.2157420068979263e-01 + <_> + + 0 -1 610 -2.9049699660390615e-03 + + 3.2402679324150085e-01 5.3818839788436890e-01 + <_> + + 0 -1 611 1.2299539521336555e-03 + + 4.1655078530311584e-01 5.7034862041473389e-01 + <_> + + 0 -1 612 -5.4329237900674343e-04 + + 3.8540428876876831e-01 5.5475491285324097e-01 + <_> + + 0 -1 613 -8.3297258242964745e-03 + + 2.2044940292835236e-01 5.0970828533172607e-01 + <_> + + 0 -1 614 -1.0417630255687982e-04 + + 5.6070661544799805e-01 4.3030360341072083e-01 + <_> + + 0 -1 615 3.1204700469970703e-02 + + 4.6216571331024170e-01 6.9820040464401245e-01 + <_> + + 0 -1 616 7.8943502157926559e-03 + + 5.2695941925048828e-01 2.2690680623054504e-01 + <_> + + 0 -1 617 -4.3645310215651989e-03 + + 6.3592231273651123e-01 4.5379561185836792e-01 + <_> + + 0 -1 618 7.6793059706687927e-03 + + 5.2747678756713867e-01 2.7404838800430298e-01 + <_> + + 0 -1 619 -2.5431139394640923e-02 + + 2.0385199785232544e-01 5.0717329978942871e-01 + <_> + + 0 -1 620 8.2000601105391979e-04 + + 4.5874550938606262e-01 6.1198681592941284e-01 + <_> + + 0 -1 621 2.9284600168466568e-03 + + 5.0712740421295166e-01 2.0282049477100372e-01 + <_> + + 0 -1 622 4.5256470912136137e-05 + + 4.8121041059494019e-01 5.4308217763900757e-01 + <_> + + 0 -1 623 1.3158309739083052e-03 + + 4.6258139610290527e-01 6.7793232202529907e-01 + <_> + + 0 -1 624 1.5870389761403203e-03 + + 5.3862917423248291e-01 3.4314650297164917e-01 + <_> + + 0 -1 625 -2.1539660170674324e-02 + + 2.5942500680685043e-02 5.0032228231430054e-01 + <_> + + 0 -1 626 1.4334480278193951e-02 + + 5.2028447389602661e-01 1.5906329452991486e-01 + <_> + + 0 -1 627 -8.3881383761763573e-03 + + 7.2824811935424805e-01 4.6480441093444824e-01 + <_> + + 0 -1 628 9.1906841844320297e-03 + + 5.5623567104339600e-01 3.9231911301612854e-01 + <_> + + 0 -1 629 -5.8453059755265713e-03 + + 6.8033927679061890e-01 4.6291279792785645e-01 + <_> + + 0 -1 630 -5.4707799106836319e-02 + + 2.5616711378097534e-01 5.2061259746551514e-01 + <_> + + 0 -1 631 9.1142775490880013e-03 + + 5.1896202564239502e-01 3.0538770556449890e-01 + <_> + + 0 -1 632 -1.5575000084936619e-02 + + 1.2950749695301056e-01 5.1690948009490967e-01 + <_> + + 0 -1 633 -1.2050600344082341e-04 + + 5.7350981235504150e-01 4.2308250069618225e-01 + <_> + + 0 -1 634 1.2273970060050488e-03 + + 5.2898782491683960e-01 4.0797919034957886e-01 + <_> + + 0 -1 635 -1.2186600361019373e-03 + + 6.5756398439407349e-01 4.5744091272354126e-01 + <_> + + 0 -1 636 -3.3256649039685726e-03 + + 3.6280471086502075e-01 5.1950198411941528e-01 + <_> + + 0 -1 637 -1.3288309797644615e-02 + + 1.2842659652233124e-01 5.0434887409210205e-01 + <_> + + 0 -1 638 -3.3839771058410406e-03 + + 6.2922400236129761e-01 4.7575059533119202e-01 + <_> + + 0 -1 639 -2.1954220533370972e-01 + + 1.4877319335937500e-01 5.0650137662887573e-01 + <_> + + 0 -1 640 4.9111708067357540e-03 + + 4.2561021447181702e-01 5.6658387184143066e-01 + <_> + + 0 -1 641 -1.8744950648397207e-04 + + 4.0041440725326538e-01 5.5868571996688843e-01 + <_> + + 0 -1 642 -5.2178641781210899e-03 + + 6.0091161727905273e-01 4.8127061128616333e-01 + <_> + + 0 -1 643 -1.1111519997939467e-03 + + 3.5149338841438293e-01 5.2870899438858032e-01 + <_> + + 0 -1 644 4.4036400504410267e-03 + + 4.6422758698463440e-01 5.9240859746932983e-01 + <_> + + 0 -1 645 1.2299499660730362e-01 + + 5.0255292654037476e-01 6.9152481853961945e-02 + <_> + + 0 -1 646 -1.2313510291278362e-02 + + 5.8845919370651245e-01 4.9340128898620605e-01 + <_> + + 0 -1 647 4.1471039876341820e-03 + + 4.3722391128540039e-01 5.8934777975082397e-01 + <_> + + 0 -1 648 -3.5502649843692780e-03 + + 4.3275511264801025e-01 5.3962701559066772e-01 + <_> + + 0 -1 649 -1.9224269315600395e-02 + + 1.9131340086460114e-01 5.0683307647705078e-01 + <_> + + 0 -1 650 1.4395059552043676e-03 + + 5.3081780672073364e-01 4.2435330152511597e-01 + <_> + + 0 -1 651 -6.7751999013125896e-03 + + 6.3653957843780518e-01 4.5400860905647278e-01 + <_> + + 0 -1 652 7.0119630545377731e-03 + + 5.1898342370986938e-01 3.0261999368667603e-01 + <_> + + 0 -1 653 5.4014651104807854e-03 + + 5.1050621271133423e-01 2.5576829910278320e-01 + <_> + + 0 -1 654 9.0274988906458020e-04 + + 4.6969148516654968e-01 5.8618277311325073e-01 + <_> + + 0 -1 655 1.1474450118839741e-02 + + 5.0536459684371948e-01 1.5271779894828796e-01 + <_> + + 0 -1 656 -6.7023430019617081e-03 + + 6.5089809894561768e-01 4.8906040191650391e-01 + <_> + + 0 -1 657 -2.0462959073483944e-03 + + 6.2418168783187866e-01 4.5146000385284424e-01 + <_> + + 0 -1 658 -9.9951568990945816e-03 + + 3.4327811002731323e-01 5.4009538888931274e-01 + <_> + + 0 -1 659 -3.5700708627700806e-02 + + 1.8780590593814850e-01 5.0740778446197510e-01 + <_> + + 0 -1 660 4.5584561303257942e-04 + + 3.8052770495414734e-01 5.4025697708129883e-01 + <_> + + 0 -1 661 -5.4260600358247757e-02 + + 6.8437147140502930e-01 4.5950970053672791e-01 + <_> + + 0 -1 662 6.0600461438298225e-03 + + 5.5029052495956421e-01 4.5005279779434204e-01 + <_> + + 0 -1 663 -6.4791832119226456e-03 + + 3.3688580989837646e-01 5.3107571601867676e-01 + <_> + + 0 -1 664 -1.4939469983801246e-03 + + 6.4876401424407959e-01 4.7561758756637573e-01 + <_> + + 0 -1 665 1.4610530342906713e-05 + + 4.0345790982246399e-01 5.4510641098022461e-01 + <_> + + 0 -1 666 -7.2321938350796700e-03 + + 6.3868737220764160e-01 4.8247399926185608e-01 + <_> + + 0 -1 667 -4.0645818226039410e-03 + + 2.9864218831062317e-01 5.1573359966278076e-01 + <_> + + 0 -1 668 3.0463080853223801e-02 + + 5.0221997499465942e-01 7.1599560976028442e-01 + <_> + + 0 -1 669 -8.0544911324977875e-03 + + 6.4924520254135132e-01 4.6192750334739685e-01 + <_> + + 0 -1 670 3.9505138993263245e-02 + + 5.1505708694458008e-01 2.4506139755249023e-01 + <_> + + 0 -1 671 8.4530208259820938e-03 + + 4.5736691355705261e-01 6.3940370082855225e-01 + <_> + + 0 -1 672 -1.1688120430335402e-03 + + 3.8655120134353638e-01 5.4836612939834595e-01 + <_> + + 0 -1 673 2.8070670086890459e-03 + + 5.1285791397094727e-01 2.7014800906181335e-01 + <_> + + 0 -1 674 4.7365209320560098e-04 + + 4.0515819191932678e-01 5.3874611854553223e-01 + <_> + + 0 -1 675 1.1741080321371555e-02 + + 5.2959501743316650e-01 3.7194138765335083e-01 + <_> + + 0 -1 676 3.1833238899707794e-03 + + 4.7894069552421570e-01 6.8951261043548584e-01 + <_> + + 0 -1 677 7.0241501089185476e-04 + + 5.3844892978668213e-01 3.9180809259414673e-01 + <_> + 102 + 5.0169731140136719e+01 + + <_> + + 0 -1 678 1.7059929668903351e-02 + + 3.9485278725624084e-01 7.1425348520278931e-01 + <_> + + 0 -1 679 2.1840840578079224e-02 + + 3.3703160285949707e-01 6.0900169610977173e-01 + <_> + + 0 -1 680 2.4520049919374287e-04 + + 3.5005760192871094e-01 5.9879022836685181e-01 + <_> + + 0 -1 681 8.3272606134414673e-03 + + 3.2675281167030334e-01 5.6972408294677734e-01 + <_> + + 0 -1 682 5.7148298947140574e-04 + + 3.0445998907089233e-01 5.5316567420959473e-01 + <_> + + 0 -1 683 6.7373987985774875e-04 + + 3.6500120162963867e-01 5.6726312637329102e-01 + <_> + + 0 -1 684 3.4681590477703139e-05 + + 3.3135411143302917e-01 5.3887271881103516e-01 + <_> + + 0 -1 685 -5.8563398197293282e-03 + + 2.6979428529739380e-01 5.4987788200378418e-01 + <_> + + 0 -1 686 8.5102273151278496e-03 + + 5.2693581581115723e-01 2.7628791332244873e-01 + <_> + + 0 -1 687 -6.9817207753658295e-02 + + 2.9096031188964844e-01 5.2592468261718750e-01 + <_> + + 0 -1 688 -8.6113670840859413e-04 + + 5.8925771713256836e-01 4.0736979246139526e-01 + <_> + + 0 -1 689 9.7149249631911516e-04 + + 3.5235640406608582e-01 5.4158622026443481e-01 + <_> + + 0 -1 690 -1.4727490452060010e-05 + + 5.4230177402496338e-01 3.5031560063362122e-01 + <_> + + 0 -1 691 4.8420291393995285e-02 + + 5.1939457654953003e-01 3.4111958742141724e-01 + <_> + + 0 -1 692 1.3257140526548028e-03 + + 3.1577691435813904e-01 5.3353762626647949e-01 + <_> + + 0 -1 693 1.4922149603080470e-05 + + 4.4512999057769775e-01 5.5365538597106934e-01 + <_> + + 0 -1 694 -2.7173398993909359e-03 + + 3.0317419767379761e-01 5.2480888366699219e-01 + <_> + + 0 -1 695 2.9219500720500946e-03 + + 4.7814530134201050e-01 6.6060417890548706e-01 + <_> + + 0 -1 696 -1.9804988987743855e-03 + + 3.1863081455230713e-01 5.2876251935958862e-01 + <_> + + 0 -1 697 -4.0012109093368053e-03 + + 6.4135968685150146e-01 4.7499281167984009e-01 + <_> + + 0 -1 698 -4.3491991236805916e-03 + + 1.5074980258941650e-01 5.0989967584609985e-01 + <_> + + 0 -1 699 1.3490889687091112e-03 + + 4.3161588907241821e-01 5.8811670541763306e-01 + <_> + + 0 -1 700 1.8597070127725601e-02 + + 4.7355538606643677e-01 9.0897941589355469e-01 + <_> + + 0 -1 701 -1.8562379991635680e-03 + + 3.5531890392303467e-01 5.5778372287750244e-01 + <_> + + 0 -1 702 2.2940430790185928e-03 + + 4.5000949501991272e-01 6.5808779001235962e-01 + <_> + + 0 -1 703 2.9982850537635386e-04 + + 5.6292420625686646e-01 3.9758789539337158e-01 + <_> + + 0 -1 704 3.5455459728837013e-03 + + 5.3815472126007080e-01 3.6054858565330505e-01 + <_> + + 0 -1 705 9.6104722470045090e-03 + + 5.2559971809387207e-01 1.7967459559440613e-01 + <_> + + 0 -1 706 -6.2783220782876015e-03 + + 2.2728569805622101e-01 5.1140302419662476e-01 + <_> + + 0 -1 707 3.4598479978740215e-03 + + 4.6263080835342407e-01 6.6082191467285156e-01 + <_> + + 0 -1 708 -1.3112019514665008e-03 + + 6.3175398111343384e-01 4.4368579983711243e-01 + <_> + + 0 -1 709 2.6876179035753012e-03 + + 5.4211097955703735e-01 4.0540221333503723e-01 + <_> + + 0 -1 710 3.9118169806897640e-03 + + 5.3584778308868408e-01 3.2734549045562744e-01 + <_> + + 0 -1 711 -1.4206450432538986e-02 + + 7.7935767173767090e-01 4.9757811427116394e-01 + <_> + + 0 -1 712 7.1705528534948826e-04 + + 5.2973198890686035e-01 3.5609039664268494e-01 + <_> + + 0 -1 713 1.6635019565001130e-03 + + 4.6780940890312195e-01 5.8164817094802856e-01 + <_> + + 0 -1 714 3.3686188980937004e-03 + + 5.2767342329025269e-01 3.4464201331138611e-01 + <_> + + 0 -1 715 1.2799530290067196e-02 + + 4.8346799612045288e-01 7.4721592664718628e-01 + <_> + + 0 -1 716 3.3901201095432043e-03 + + 4.5118591189384460e-01 6.4017212390899658e-01 + <_> + + 0 -1 717 4.7070779837667942e-03 + + 5.3356587886810303e-01 3.5552209615707397e-01 + <_> + + 0 -1 718 1.4819339849054813e-03 + + 4.2507070302963257e-01 5.7727241516113281e-01 + <_> + + 0 -1 719 -6.9995759986341000e-03 + + 3.0033200979232788e-01 5.2929002046585083e-01 + <_> + + 0 -1 720 1.5939010307192802e-02 + + 5.0673192739486694e-01 1.6755819320678711e-01 + <_> + + 0 -1 721 7.6377349905669689e-03 + + 4.7950699925422668e-01 7.0856010913848877e-01 + <_> + + 0 -1 722 6.7334040068089962e-03 + + 5.1331132650375366e-01 2.1624700725078583e-01 + <_> + + 0 -1 723 -1.2858809903264046e-02 + + 1.9388419389724731e-01 5.2513718605041504e-01 + <_> + + 0 -1 724 -6.2270800117403269e-04 + + 5.6865382194519043e-01 4.1978681087493896e-01 + <_> + + 0 -1 725 -5.2651681471616030e-04 + + 4.2241689562797546e-01 5.4296958446502686e-01 + <_> + + 0 -1 726 1.1075099930167198e-02 + + 5.1137751340866089e-01 2.5145179033279419e-01 + <_> + + 0 -1 727 -3.6728251725435257e-02 + + 7.1946620941162109e-01 4.8496189713478088e-01 + <_> + + 0 -1 728 -2.8207109426148236e-04 + + 3.8402619957923889e-01 5.3944462537765503e-01 + <_> + + 0 -1 729 -2.7489690110087395e-03 + + 5.9370887279510498e-01 4.5691820979118347e-01 + <_> + + 0 -1 730 1.0047519579529762e-02 + + 5.1385760307312012e-01 2.8022980690002441e-01 + <_> + + 0 -1 731 -8.1497840583324432e-03 + + 6.0900372266769409e-01 4.6361210942268372e-01 + <_> + + 0 -1 732 -6.8833888508379459e-03 + + 3.4586110711097717e-01 5.2546602487564087e-01 + <_> + + 0 -1 733 -1.4039360394235700e-05 + + 5.6931042671203613e-01 4.0820831060409546e-01 + <_> + + 0 -1 734 1.5498419525101781e-03 + + 4.3505370616912842e-01 5.8065170049667358e-01 + <_> + + 0 -1 735 -6.7841499112546444e-03 + + 1.4688730239868164e-01 5.1827752590179443e-01 + <_> + + 0 -1 736 2.1705629478674382e-04 + + 5.2935242652893066e-01 3.4561741352081299e-01 + <_> + + 0 -1 737 3.1198898795992136e-04 + + 4.6524509787559509e-01 5.9424138069152832e-01 + <_> + + 0 -1 738 5.4507530294358730e-03 + + 4.6535089612007141e-01 7.0248460769653320e-01 + <_> + + 0 -1 739 -2.5818689027801156e-04 + + 5.4972952604293823e-01 3.7689670920372009e-01 + <_> + + 0 -1 740 -1.7442539334297180e-02 + + 3.9190879464149475e-01 5.4574978351593018e-01 + <_> + + 0 -1 741 -4.5343529433012009e-02 + + 1.6313570737838745e-01 5.1549088954925537e-01 + <_> + + 0 -1 742 1.9190689781680703e-03 + + 5.1458978652954102e-01 2.7918958663940430e-01 + <_> + + 0 -1 743 -6.0177869163453579e-03 + + 6.5176361799240112e-01 4.7563329339027405e-01 + <_> + + 0 -1 744 -4.0720738470554352e-03 + + 5.5146527290344238e-01 4.0926858782768250e-01 + <_> + + 0 -1 745 3.9855059003457427e-04 + + 3.1652408838272095e-01 5.2855509519577026e-01 + <_> + + 0 -1 746 -6.5418570302426815e-03 + + 6.8533778190612793e-01 4.6528089046478271e-01 + <_> + + 0 -1 747 3.4845089539885521e-03 + + 5.4845881462097168e-01 4.5027598738670349e-01 + <_> + + 0 -1 748 -1.3696780428290367e-02 + + 6.3957798480987549e-01 4.5725551247596741e-01 + <_> + + 0 -1 749 -1.7347140237689018e-02 + + 2.7510729432106018e-01 5.1816147565841675e-01 + <_> + + 0 -1 750 -4.0885428898036480e-03 + + 3.3256360888481140e-01 5.1949840784072876e-01 + <_> + + 0 -1 751 -9.4687901437282562e-03 + + 5.9422808885574341e-01 4.8518198728561401e-01 + <_> + + 0 -1 752 1.7084840219467878e-03 + + 4.1671109199523926e-01 5.5198061466217041e-01 + <_> + + 0 -1 753 9.4809094443917274e-03 + + 5.4338949918746948e-01 4.2085149884223938e-01 + <_> + + 0 -1 754 -4.7389650717377663e-03 + + 6.4071899652481079e-01 4.5606550574302673e-01 + <_> + + 0 -1 755 6.5761050209403038e-03 + + 5.2145552635192871e-01 2.2582270205020905e-01 + <_> + + 0 -1 756 -2.1690549328923225e-03 + + 3.1515279412269592e-01 5.1567047834396362e-01 + <_> + + 0 -1 757 1.4660170301795006e-02 + + 4.8708370327949524e-01 6.6899412870407104e-01 + <_> + + 0 -1 758 1.7231999663636088e-04 + + 3.5697489976882935e-01 5.2510780096054077e-01 + <_> + + 0 -1 759 -2.1803760901093483e-02 + + 8.8259208202362061e-01 4.9663299322128296e-01 + <_> + + 0 -1 760 -9.4736106693744659e-02 + + 1.4461620151996613e-01 5.0611138343811035e-01 + <_> + + 0 -1 761 5.5825551971793175e-03 + + 5.3964787721633911e-01 4.2380660772323608e-01 + <_> + + 0 -1 762 1.9517090404406190e-03 + + 4.1704109311103821e-01 5.4977869987487793e-01 + <_> + + 0 -1 763 1.2149900197982788e-02 + + 4.6983671188354492e-01 5.6642740964889526e-01 + <_> + + 0 -1 764 -7.5169620104134083e-03 + + 6.2677729129791260e-01 4.4631358981132507e-01 + <_> + + 0 -1 765 -7.1667909622192383e-02 + + 3.0970111489295959e-01 5.2210032939910889e-01 + <_> + + 0 -1 766 -8.8292419910430908e-02 + + 8.1123888492584229e-02 5.0063651800155640e-01 + <_> + + 0 -1 767 3.1063079833984375e-02 + + 5.1555037498474121e-01 1.2822559475898743e-01 + <_> + + 0 -1 768 4.6621840447187424e-02 + + 4.6997779607772827e-01 7.3639607429504395e-01 + <_> + + 0 -1 769 -1.2189489789307117e-02 + + 3.9205300807952881e-01 5.5189967155456543e-01 + <_> + + 0 -1 770 1.3016110286116600e-02 + + 5.2606582641601562e-01 3.6851361393928528e-01 + <_> + + 0 -1 771 -3.4952899441123009e-03 + + 6.3392949104309082e-01 4.7162809967994690e-01 + <_> + + 0 -1 772 -4.4015039748046547e-05 + + 5.3330272436141968e-01 3.7761849164962769e-01 + <_> + + 0 -1 773 -1.0966490209102631e-01 + + 1.7653420567512512e-01 5.1983469724655151e-01 + <_> + + 0 -1 774 -9.0279558207839727e-04 + + 5.3241598606109619e-01 3.8389080762863159e-01 + <_> + + 0 -1 775 7.1126641705632210e-04 + + 4.6479299664497375e-01 5.7552242279052734e-01 + <_> + + 0 -1 776 -3.1250279862433672e-03 + + 3.2367089390754700e-01 5.1667708158493042e-01 + <_> + + 0 -1 777 2.4144679773598909e-03 + + 4.7874391078948975e-01 6.4597177505493164e-01 + <_> + + 0 -1 778 4.4391240226104856e-04 + + 4.4093081355094910e-01 6.0102558135986328e-01 + <_> + + 0 -1 779 -2.2611189342569560e-04 + + 4.0381139516830444e-01 5.4932558536529541e-01 + <_> + 135 + 6.6669120788574219e+01 + + <_> + + 0 -1 780 -4.6901289373636246e-02 + + 6.6001719236373901e-01 3.7438011169433594e-01 + <_> + + 0 -1 781 -1.4568349579349160e-03 + + 5.7839912176132202e-01 3.4377971291542053e-01 + <_> + + 0 -1 782 5.5598369799554348e-03 + + 3.6222669482231140e-01 5.9082162380218506e-01 + <_> + + 0 -1 783 7.3170487303286791e-04 + + 5.5004191398620605e-01 2.8735581040382385e-01 + <_> + + 0 -1 784 1.3318009441718459e-03 + + 2.6731699705123901e-01 5.4310190677642822e-01 + <_> + + 0 -1 785 2.4347059661522508e-04 + + 3.8550278544425964e-01 5.7413887977600098e-01 + <_> + + 0 -1 786 -3.0512469820678234e-03 + + 5.5032098293304443e-01 3.4628450870513916e-01 + <_> + + 0 -1 787 -6.8657199153676629e-04 + + 3.2912218570709229e-01 5.4295092821121216e-01 + <_> + + 0 -1 788 1.4668200165033340e-03 + + 3.5883820056915283e-01 5.3518110513687134e-01 + <_> + + 0 -1 789 3.2021870720200241e-04 + + 4.2968419194221497e-01 5.7002341747283936e-01 + <_> + + 0 -1 790 7.4122188379988074e-04 + + 5.2821648120880127e-01 3.3668708801269531e-01 + <_> + + 0 -1 791 3.8330298848450184e-03 + + 4.5595678687095642e-01 6.2573361396789551e-01 + <_> + + 0 -1 792 -1.5456439927220345e-02 + + 2.3501169681549072e-01 5.1294529438018799e-01 + <_> + + 0 -1 793 2.6796779129654169e-03 + + 5.3294152021408081e-01 4.1550621390342712e-01 + <_> + + 0 -1 794 2.8296569362282753e-03 + + 4.2730879783630371e-01 5.8045381307601929e-01 + <_> + + 0 -1 795 -3.9444249123334885e-03 + + 2.9126119613647461e-01 5.2026861906051636e-01 + <_> + + 0 -1 796 2.7179559692740440e-03 + + 5.3076881170272827e-01 3.5856771469116211e-01 + <_> + + 0 -1 797 5.9077627956867218e-03 + + 4.7037750482559204e-01 5.9415858983993530e-01 + <_> + + 0 -1 798 -4.2240349575877190e-03 + + 2.1415670216083527e-01 5.0887960195541382e-01 + <_> + + 0 -1 799 4.0725888684391975e-03 + + 4.7664138674736023e-01 6.8410611152648926e-01 + <_> + + 0 -1 800 1.0149530135095119e-02 + + 5.3607988357543945e-01 3.7484970688819885e-01 + <_> + + 0 -1 801 -1.8864999583456665e-04 + + 5.7201302051544189e-01 3.8538050651550293e-01 + <_> + + 0 -1 802 -4.8864358104765415e-03 + + 3.6931228637695312e-01 5.3409588336944580e-01 + <_> + + 0 -1 803 2.6158479973673820e-02 + + 4.9623748660087585e-01 6.0599899291992188e-01 + <_> + + 0 -1 804 4.8560759751126170e-04 + + 4.4389459490776062e-01 6.0124689340591431e-01 + <_> + + 0 -1 805 1.1268709786236286e-02 + + 5.2442502975463867e-01 1.8403880298137665e-01 + <_> + + 0 -1 806 -2.8114619199186563e-03 + + 6.0602837800979614e-01 4.4098970293998718e-01 + <_> + + 0 -1 807 -5.6112729944288731e-03 + + 3.8911709189414978e-01 5.5892372131347656e-01 + <_> + + 0 -1 808 8.5680093616247177e-03 + + 5.0693458318710327e-01 2.0626190304756165e-01 + <_> + + 0 -1 809 -3.8172779022715986e-04 + + 5.8822017908096313e-01 4.1926109790802002e-01 + <_> + + 0 -1 810 -1.7680290329735726e-04 + + 5.5336058139801025e-01 4.0033689141273499e-01 + <_> + + 0 -1 811 6.5112537704408169e-03 + + 3.3101469278335571e-01 5.4441910982131958e-01 + <_> + + 0 -1 812 -6.5948683186434209e-05 + + 5.4338318109512329e-01 3.9449059963226318e-01 + <_> + + 0 -1 813 6.9939051754772663e-03 + + 5.6003582477569580e-01 4.1927140951156616e-01 + <_> + + 0 -1 814 -4.6744439750909805e-03 + + 6.6854667663574219e-01 4.6049609780311584e-01 + <_> + + 0 -1 815 1.1589850299060345e-02 + + 5.3571212291717529e-01 2.9268300533294678e-01 + <_> + + 0 -1 816 1.3007840141654015e-02 + + 4.6798178553581238e-01 7.3074632883071899e-01 + <_> + + 0 -1 817 -1.1008579749614000e-03 + + 3.9375010132789612e-01 5.4150652885437012e-01 + <_> + + 0 -1 818 6.0472649056464434e-04 + + 4.2423760890960693e-01 5.6040412187576294e-01 + <_> + + 0 -1 819 -1.4494840055704117e-02 + + 3.6312100291252136e-01 5.2931827306747437e-01 + <_> + + 0 -1 820 -5.3056948818266392e-03 + + 6.8604522943496704e-01 4.6218210458755493e-01 + <_> + + 0 -1 821 -8.1829127157106996e-04 + + 3.9440968632698059e-01 5.4204392433166504e-01 + <_> + + 0 -1 822 -1.9077520817518234e-02 + + 1.9626219570636749e-01 5.0378918647766113e-01 + <_> + + 0 -1 823 3.5549470339901745e-04 + + 4.0862590074539185e-01 5.6139731407165527e-01 + <_> + + 0 -1 824 1.9679730758070946e-03 + + 4.4891211390495300e-01 5.9261232614517212e-01 + <_> + + 0 -1 825 6.9189141504466534e-03 + + 5.3359258174896240e-01 3.7283858656883240e-01 + <_> + + 0 -1 826 2.9872779268771410e-03 + + 5.1113212108612061e-01 2.9756438732147217e-01 + <_> + + 0 -1 827 -6.2264618463814259e-03 + + 5.5414897203445435e-01 4.8245379328727722e-01 + <_> + + 0 -1 828 1.3353300280869007e-02 + + 4.5864239335060120e-01 6.4147979021072388e-01 + <_> + + 0 -1 829 3.3505238592624664e-02 + + 5.3924250602722168e-01 3.4299948811531067e-01 + <_> + + 0 -1 830 -2.5294460356235504e-03 + + 1.7037139832973480e-01 5.0133150815963745e-01 + <_> + + 0 -1 831 -1.2801629491150379e-03 + + 5.3054618835449219e-01 4.6974050998687744e-01 + <_> + + 0 -1 832 7.0687388069927692e-03 + + 4.6155458688735962e-01 6.4365047216415405e-01 + <_> + + 0 -1 833 9.6880499040707946e-04 + + 4.8335990309715271e-01 6.0438942909240723e-01 + <_> + + 0 -1 834 3.9647659286856651e-03 + + 5.1876372098922729e-01 3.2318168878555298e-01 + <_> + + 0 -1 835 -2.2057730704545975e-02 + + 4.0792569518089294e-01 5.2009809017181396e-01 + <_> + + 0 -1 836 -6.6906312713399529e-04 + + 5.3316092491149902e-01 3.8156008720397949e-01 + <_> + + 0 -1 837 -6.7009328631684184e-04 + + 5.6554222106933594e-01 4.6889019012451172e-01 + <_> + + 0 -1 838 7.4284552829340100e-04 + + 4.5343810319900513e-01 6.2874001264572144e-01 + <_> + + 0 -1 839 2.2227810695767403e-03 + + 5.3506332635879517e-01 3.3036559820175171e-01 + <_> + + 0 -1 840 -5.4130521602928638e-03 + + 1.1136870086193085e-01 5.0054347515106201e-01 + <_> + + 0 -1 841 -1.4520040167553816e-05 + + 5.6287378072738647e-01 4.3251338601112366e-01 + <_> + + 0 -1 842 2.3369169502984732e-04 + + 4.1658350825309753e-01 5.4477912187576294e-01 + <_> + + 0 -1 843 4.2894547805190086e-03 + + 4.8603910207748413e-01 6.7786490917205811e-01 + <_> + + 0 -1 844 5.9103150852024555e-03 + + 5.2623051404953003e-01 3.6121138930320740e-01 + <_> + + 0 -1 845 1.2900539673864841e-02 + + 5.3193771839141846e-01 3.2502880692481995e-01 + <_> + + 0 -1 846 4.6982979401946068e-03 + + 4.6182450652122498e-01 6.6659259796142578e-01 + <_> + + 0 -1 847 1.0439859703183174e-02 + + 5.5056709051132202e-01 3.8836041092872620e-01 + <_> + + 0 -1 848 3.0443191062659025e-03 + + 4.6978530287742615e-01 7.3018449544906616e-01 + <_> + + 0 -1 849 -6.1593751888722181e-04 + + 3.8308390974998474e-01 5.4649841785430908e-01 + <_> + + 0 -1 850 -3.4247159492224455e-03 + + 2.5663000345230103e-01 5.0895309448242188e-01 + <_> + + 0 -1 851 -9.3538565561175346e-03 + + 6.4699661731719971e-01 4.9407958984375000e-01 + <_> + + 0 -1 852 5.2338998764753342e-02 + + 4.7459828853607178e-01 7.8787708282470703e-01 + <_> + + 0 -1 853 3.5765620414167643e-03 + + 5.3066647052764893e-01 2.7484980225563049e-01 + <_> + + 0 -1 854 7.1555317845195532e-04 + + 5.4131257534027100e-01 4.0419089794158936e-01 + <_> + + 0 -1 855 -1.0516679845750332e-02 + + 6.1585122346878052e-01 4.8152831196784973e-01 + <_> + + 0 -1 856 7.7347927726805210e-03 + + 4.6958059072494507e-01 7.0289808511734009e-01 + <_> + + 0 -1 857 -4.3226778507232666e-03 + + 2.8495660424232483e-01 5.3046840429306030e-01 + <_> + + 0 -1 858 -2.5534399319440126e-03 + + 7.0569849014282227e-01 4.6888920664787292e-01 + <_> + + 0 -1 859 1.0268510231981054e-04 + + 3.9029321074485779e-01 5.5734640359878540e-01 + <_> + + 0 -1 860 7.1395188570022583e-06 + + 3.6842319369316101e-01 5.2639877796173096e-01 + <_> + + 0 -1 861 -1.6711989883333445e-03 + + 3.8491758704185486e-01 5.3872710466384888e-01 + <_> + + 0 -1 862 4.9260449595749378e-03 + + 4.7297719120979309e-01 7.4472510814666748e-01 + <_> + + 0 -1 863 4.3908702209591866e-03 + + 4.8091810941696167e-01 5.5919218063354492e-01 + <_> + + 0 -1 864 -1.7793629318475723e-02 + + 6.9036781787872314e-01 4.6769270300865173e-01 + <_> + + 0 -1 865 2.0469669252634048e-03 + + 5.3706902265548706e-01 3.3081620931625366e-01 + <_> + + 0 -1 866 2.9891489073634148e-02 + + 5.1398652791976929e-01 3.3090591430664062e-01 + <_> + + 0 -1 867 1.5494900289922953e-03 + + 4.6602371335029602e-01 6.0783427953720093e-01 + <_> + + 0 -1 868 1.4956969534978271e-03 + + 4.4048359990119934e-01 5.8639198541641235e-01 + <_> + + 0 -1 869 9.5885928021743894e-04 + + 5.4359710216522217e-01 4.2085230350494385e-01 + <_> + + 0 -1 870 4.9643701640889049e-04 + + 5.3705781698226929e-01 4.0006220340728760e-01 + <_> + + 0 -1 871 -2.7280810754746199e-03 + + 5.6594127416610718e-01 4.2596429586410522e-01 + <_> + + 0 -1 872 2.3026480339467525e-03 + + 5.1616579294204712e-01 3.3508691191673279e-01 + <_> + + 0 -1 873 2.5151631236076355e-01 + + 4.8696619272232056e-01 7.1473097801208496e-01 + <_> + + 0 -1 874 -4.6328022144734859e-03 + + 2.7274489402770996e-01 5.0837898254394531e-01 + <_> + + 0 -1 875 -4.0434490889310837e-02 + + 6.8514388799667358e-01 5.0217670202255249e-01 + <_> + + 0 -1 876 1.4972220014897175e-05 + + 4.2844650149345398e-01 5.5225551128387451e-01 + <_> + + 0 -1 877 -2.4050309730228037e-04 + + 4.2261189222335815e-01 5.3900748491287231e-01 + <_> + + 0 -1 878 2.3657839745283127e-02 + + 4.7446319460868835e-01 7.5043660402297974e-01 + <_> + + 0 -1 879 -8.1449104472994804e-03 + + 4.2450588941574097e-01 5.5383628606796265e-01 + <_> + + 0 -1 880 -3.6992130335420370e-03 + + 5.9523570537567139e-01 4.5297130942344666e-01 + <_> + + 0 -1 881 -6.7718601785600185e-03 + + 4.1377940773963928e-01 5.4733997583389282e-01 + <_> + + 0 -1 882 4.2669530957937241e-03 + + 4.4841149449348450e-01 5.7979941368103027e-01 + <_> + + 0 -1 883 1.7791989957913756e-03 + + 5.6248587369918823e-01 4.4324448704719543e-01 + <_> + + 0 -1 884 1.6774770338088274e-03 + + 4.6377518773078918e-01 6.3642418384552002e-01 + <_> + + 0 -1 885 1.1732629500329494e-03 + + 4.5445030927658081e-01 5.9144157171249390e-01 + <_> + + 0 -1 886 8.6998171173036098e-04 + + 5.3347527980804443e-01 3.8859179615974426e-01 + <_> + + 0 -1 887 7.6378340600058436e-04 + + 5.3985852003097534e-01 3.7449419498443604e-01 + <_> + + 0 -1 888 1.5684569370932877e-04 + + 4.3178731203079224e-01 5.6146162748336792e-01 + <_> + + 0 -1 889 -2.1511370316147804e-02 + + 1.7859250307083130e-01 5.1855427026748657e-01 + <_> + + 0 -1 890 1.3081369979772717e-04 + + 4.3424990773200989e-01 5.6828498840332031e-01 + <_> + + 0 -1 891 2.1992040798068047e-02 + + 5.1617169380187988e-01 2.3793940246105194e-01 + <_> + + 0 -1 892 -8.0136500764638186e-04 + + 5.9867632389068604e-01 4.4664269685745239e-01 + <_> + + 0 -1 893 -8.2736099138855934e-03 + + 4.1082179546356201e-01 5.2510571479797363e-01 + <_> + + 0 -1 894 3.6831789184361696e-03 + + 5.1738142967224121e-01 3.3975180983543396e-01 + <_> + + 0 -1 895 -7.9525681212544441e-03 + + 6.8889832496643066e-01 4.8459240794181824e-01 + <_> + + 0 -1 896 1.5382299898192286e-03 + + 5.1785671710968018e-01 3.4541139006614685e-01 + <_> + + 0 -1 897 -1.4043530449271202e-02 + + 1.6784210503101349e-01 5.1886677742004395e-01 + <_> + + 0 -1 898 1.4315890148282051e-03 + + 4.3682569265365601e-01 5.6557738780975342e-01 + <_> + + 0 -1 899 -3.4014228731393814e-02 + + 7.8022962808609009e-01 4.9592170119285583e-01 + <_> + + 0 -1 900 -1.2027299962937832e-02 + + 1.5851010382175446e-01 5.0322318077087402e-01 + <_> + + 0 -1 901 1.3316619396209717e-01 + + 5.1633048057556152e-01 2.7551281452178955e-01 + <_> + + 0 -1 902 -1.5221949433907866e-03 + + 3.7283179163932800e-01 5.2145522832870483e-01 + <_> + + 0 -1 903 -9.3929271679371595e-04 + + 5.8383792638778687e-01 4.5111650228500366e-01 + <_> + + 0 -1 904 2.7719739824533463e-02 + + 4.7282868623733521e-01 7.3315447568893433e-01 + <_> + + 0 -1 905 3.1030150130391121e-03 + + 5.3022021055221558e-01 4.1015630960464478e-01 + <_> + + 0 -1 906 7.7861219644546509e-02 + + 4.9983340501785278e-01 1.2729619443416595e-01 + <_> + + 0 -1 907 -1.5854939818382263e-02 + + 5.0833359360694885e-02 5.1656562089920044e-01 + <_> + + 0 -1 908 -4.9725300632417202e-03 + + 6.7981338500976562e-01 4.6842318773269653e-01 + <_> + + 0 -1 909 -9.7676506265997887e-04 + + 6.0107719898223877e-01 4.7889319062232971e-01 + <_> + + 0 -1 910 -2.4647710379213095e-03 + + 3.3933979272842407e-01 5.2205038070678711e-01 + <_> + + 0 -1 911 -6.7937700077891350e-03 + + 4.3651369214057922e-01 5.2396631240844727e-01 + <_> + + 0 -1 912 3.2608021050691605e-02 + + 5.0527238845825195e-01 2.4252149462699890e-01 + <_> + + 0 -1 913 -5.8514421107247472e-04 + + 5.7339739799499512e-01 4.7585740685462952e-01 + <_> + + 0 -1 914 -2.9632600024342537e-02 + + 3.8922891020774841e-01 5.2635979652404785e-01 + <_> + 137 + 6.7698921203613281e+01 + + <_> + + 0 -1 915 4.6550851315259933e-02 + + 3.2769501209259033e-01 6.2405228614807129e-01 + <_> + + 0 -1 916 7.9537127166986465e-03 + + 4.2564851045608521e-01 6.9429391622543335e-01 + <_> + + 0 -1 917 6.8221561377868056e-04 + + 3.7114870548248291e-01 5.9007328748703003e-01 + <_> + + 0 -1 918 -1.9348249770700932e-04 + + 2.0411339402198792e-01 5.3005450963973999e-01 + <_> + + 0 -1 919 -2.6710508973337710e-04 + + 5.4161262512207031e-01 3.1031790375709534e-01 + <_> + + 0 -1 920 2.7818060480058193e-03 + + 5.2778327465057373e-01 3.4670698642730713e-01 + <_> + + 0 -1 921 -4.6779078547842801e-04 + + 5.3082311153411865e-01 3.2944920659065247e-01 + <_> + + 0 -1 922 -3.0335160772665404e-05 + + 5.7738727331161499e-01 3.8520970940589905e-01 + <_> + + 0 -1 923 7.8038009814918041e-04 + + 4.3174389004707336e-01 6.1500579118728638e-01 + <_> + + 0 -1 924 -4.2553851380944252e-03 + + 2.9339039325714111e-01 5.3242927789688110e-01 + <_> + + 0 -1 925 -2.4735610350035131e-04 + + 5.4688447713851929e-01 3.8430300354957581e-01 + <_> + + 0 -1 926 -1.4724259381182492e-04 + + 4.2815428972244263e-01 5.7555872201919556e-01 + <_> + + 0 -1 927 1.1864770203828812e-03 + + 3.7473011016845703e-01 5.4714661836624146e-01 + <_> + + 0 -1 928 2.3936580400913954e-03 + + 4.5377838611602783e-01 6.1115288734436035e-01 + <_> + + 0 -1 929 -1.5390539774671197e-03 + + 2.9713419079780579e-01 5.1895380020141602e-01 + <_> + + 0 -1 930 -7.1968790143728256e-03 + + 6.6990667581558228e-01 4.7264769673347473e-01 + <_> + + 0 -1 931 -4.1499789222143590e-04 + + 3.3849540352821350e-01 5.2603179216384888e-01 + <_> + + 0 -1 932 4.4359830208122730e-03 + + 5.3991222381591797e-01 3.9201408624649048e-01 + <_> + + 0 -1 933 2.6606200262904167e-03 + + 4.4825780391693115e-01 6.1196178197860718e-01 + <_> + + 0 -1 934 -1.5287200221791863e-03 + + 3.7112379074096680e-01 5.3402662277221680e-01 + <_> + + 0 -1 935 -4.7397250309586525e-03 + + 6.0310882329940796e-01 4.4551450014114380e-01 + <_> + + 0 -1 936 -1.4829129911959171e-02 + + 2.8387540578842163e-01 5.3418618440628052e-01 + <_> + + 0 -1 937 9.2275557108223438e-04 + + 5.2095472812652588e-01 3.3616539835929871e-01 + <_> + + 0 -1 938 8.3529807627201080e-02 + + 5.1199698448181152e-01 8.1164449453353882e-02 + <_> + + 0 -1 939 -7.5633148662745953e-04 + + 3.3171200752258301e-01 5.1898312568664551e-01 + <_> + + 0 -1 940 9.8403859883546829e-03 + + 5.2475982904434204e-01 2.3349590599536896e-01 + <_> + + 0 -1 941 -1.5953830443322659e-03 + + 5.7500940561294556e-01 4.2956221103668213e-01 + <_> + + 0 -1 942 3.4766020689858124e-05 + + 4.3424451351165771e-01 5.5640292167663574e-01 + <_> + + 0 -1 943 2.9862910509109497e-02 + + 4.5791471004486084e-01 6.5791881084442139e-01 + <_> + + 0 -1 944 1.1325590312480927e-02 + + 5.2743119001388550e-01 3.6738881468772888e-01 + <_> + + 0 -1 945 -8.7828645482659340e-03 + + 7.1003687381744385e-01 4.6421670913696289e-01 + <_> + + 0 -1 946 4.3639959767460823e-03 + + 5.2792161703109741e-01 2.7058771252632141e-01 + <_> + + 0 -1 947 4.1804728098213673e-03 + + 5.0725251436233521e-01 2.4490830302238464e-01 + <_> + + 0 -1 948 -4.5668511302210391e-04 + + 4.2831051349639893e-01 5.5486911535263062e-01 + <_> + + 0 -1 949 -3.7140368949621916e-03 + + 5.5193877220153809e-01 4.1036531329154968e-01 + <_> + + 0 -1 950 -2.5304289534687996e-02 + + 6.8670022487640381e-01 4.8698890209197998e-01 + <_> + + 0 -1 951 -3.4454080741852522e-04 + + 3.7288740277290344e-01 5.2876931428909302e-01 + <_> + + 0 -1 952 -8.3935231668874621e-04 + + 6.0601520538330078e-01 4.6160620450973511e-01 + <_> + + 0 -1 953 1.7280049622058868e-02 + + 5.0496357679367065e-01 1.8198239803314209e-01 + <_> + + 0 -1 954 -6.3595077954232693e-03 + + 1.6312399506568909e-01 5.2327787876129150e-01 + <_> + + 0 -1 955 1.0298109846189618e-03 + + 4.4632780551910400e-01 6.1765491962432861e-01 + <_> + + 0 -1 956 1.0117109632119536e-03 + + 5.4733848571777344e-01 4.3006989359855652e-01 + <_> + + 0 -1 957 -1.0308800265192986e-02 + + 1.1669850349426270e-01 5.0008672475814819e-01 + <_> + + 0 -1 958 5.4682018235325813e-03 + + 4.7692871093750000e-01 6.7192137241363525e-01 + <_> + + 0 -1 959 -9.1696460731327534e-04 + + 3.4710898995399475e-01 5.1781648397445679e-01 + <_> + + 0 -1 960 2.3922820109874010e-03 + + 4.7852361202239990e-01 6.2163108587265015e-01 + <_> + + 0 -1 961 -7.5573818758130074e-03 + + 5.8147960901260376e-01 4.4100850820541382e-01 + <_> + + 0 -1 962 -7.7024032361805439e-04 + + 3.8780000805854797e-01 5.4657220840454102e-01 + <_> + + 0 -1 963 -8.7125990539789200e-03 + + 1.6600510478019714e-01 4.9958360195159912e-01 + <_> + + 0 -1 964 -1.0306320153176785e-02 + + 4.0933910012245178e-01 5.2742338180541992e-01 + <_> + + 0 -1 965 -2.0940979011356831e-03 + + 6.2061947584152222e-01 4.5722800493240356e-01 + <_> + + 0 -1 966 6.8099051713943481e-03 + + 5.5677592754364014e-01 4.1556000709533691e-01 + <_> + + 0 -1 967 -1.0746059706434608e-03 + + 5.6389278173446655e-01 4.3530249595642090e-01 + <_> + + 0 -1 968 2.1550289820879698e-03 + + 4.8262658715248108e-01 6.7497581243515015e-01 + <_> + + 0 -1 969 3.1742319464683533e-02 + + 5.0483798980712891e-01 1.8832489848136902e-01 + <_> + + 0 -1 970 -7.8382723033428192e-02 + + 2.3695489764213562e-01 5.2601581811904907e-01 + <_> + + 0 -1 971 5.7415119372308254e-03 + + 5.0488287210464478e-01 2.7764698863029480e-01 + <_> + + 0 -1 972 -2.9014600440859795e-03 + + 6.2386047840118408e-01 4.6933171153068542e-01 + <_> + + 0 -1 973 -2.6427931152284145e-03 + + 3.3141419291496277e-01 5.1697772741317749e-01 + <_> + + 0 -1 974 -1.0949660092592239e-01 + + 2.3800450563430786e-01 5.1834410429000854e-01 + <_> + + 0 -1 975 7.4075913289561868e-05 + + 4.0696358680725098e-01 5.3621500730514526e-01 + <_> + + 0 -1 976 -5.0593802006915212e-04 + + 5.5067062377929688e-01 4.3745940923690796e-01 + <_> + + 0 -1 977 -8.2131777890026569e-04 + + 5.5257099866867065e-01 4.2093759775161743e-01 + <_> + + 0 -1 978 -6.0276539443293586e-05 + + 5.4554748535156250e-01 4.7482660412788391e-01 + <_> + + 0 -1 979 6.8065142259001732e-03 + + 5.1579958200454712e-01 3.4245771169662476e-01 + <_> + + 0 -1 980 1.7202789895236492e-03 + + 5.0132077932357788e-01 6.3312637805938721e-01 + <_> + + 0 -1 981 -1.3016929733566940e-04 + + 5.5397182703018188e-01 4.2268699407577515e-01 + <_> + + 0 -1 982 -4.8016388900578022e-03 + + 4.4250950217247009e-01 5.4307800531387329e-01 + <_> + + 0 -1 983 -2.5399310979992151e-03 + + 7.1457821130752563e-01 4.6976050734519958e-01 + <_> + + 0 -1 984 -1.4278929447755218e-03 + + 4.0704450011253357e-01 5.3996050357818604e-01 + <_> + + 0 -1 985 -2.5142550468444824e-02 + + 7.8846907615661621e-01 4.7473520040512085e-01 + <_> + + 0 -1 986 -3.8899609353393316e-03 + + 4.2961919307708740e-01 5.5771100521087646e-01 + <_> + + 0 -1 987 4.3947459198534489e-03 + + 4.6931621432304382e-01 7.0239442586898804e-01 + <_> + + 0 -1 988 2.4678420275449753e-02 + + 5.2423220872879028e-01 3.8125100731849670e-01 + <_> + + 0 -1 989 3.8047678768634796e-02 + + 5.0117397308349609e-01 1.6878280043601990e-01 + <_> + + 0 -1 990 7.9424865543842316e-03 + + 4.8285821080207825e-01 6.3695681095123291e-01 + <_> + + 0 -1 991 -1.5110049862414598e-03 + + 5.9064859151840210e-01 4.4876679778099060e-01 + <_> + + 0 -1 992 6.4201741479337215e-03 + + 5.2410978078842163e-01 2.9905700683593750e-01 + <_> + + 0 -1 993 -2.9802159406244755e-03 + + 3.0414658784866333e-01 5.0784897804260254e-01 + <_> + + 0 -1 994 -7.4580078944563866e-04 + + 4.1281390190124512e-01 5.2568262815475464e-01 + <_> + + 0 -1 995 -1.0470950044691563e-02 + + 5.8083951473236084e-01 4.4942960143089294e-01 + <_> + + 0 -1 996 9.3369204550981522e-03 + + 5.2465528249740601e-01 2.6589488983154297e-01 + <_> + + 0 -1 997 2.7936900034546852e-02 + + 4.6749550104141235e-01 7.0872569084167480e-01 + <_> + + 0 -1 998 7.4277678504586220e-03 + + 5.4094868898391724e-01 3.7585180997848511e-01 + <_> + + 0 -1 999 -2.3584509268403053e-02 + + 3.7586399912834167e-01 5.2385509014129639e-01 + <_> + + 0 -1 1000 1.1452640173956752e-03 + + 4.3295788764953613e-01 5.8042472600936890e-01 + <_> + + 0 -1 1001 -4.3468660442158580e-04 + + 5.2806180715560913e-01 3.8730698823928833e-01 + <_> + + 0 -1 1002 1.0648540221154690e-02 + + 4.9021130800247192e-01 5.6812518835067749e-01 + <_> + + 0 -1 1003 -3.9418050437234342e-04 + + 5.5708801746368408e-01 4.3182510137557983e-01 + <_> + + 0 -1 1004 -1.3270479394122958e-04 + + 5.6584399938583374e-01 4.3435549736022949e-01 + <_> + + 0 -1 1005 -2.0125510636717081e-03 + + 6.0567390918731689e-01 4.5375239849090576e-01 + <_> + + 0 -1 1006 2.4854319635778666e-03 + + 5.3904771804809570e-01 4.1380101442337036e-01 + <_> + + 0 -1 1007 1.8237880431115627e-03 + + 4.3548288941383362e-01 5.7171887159347534e-01 + <_> + + 0 -1 1008 -1.6656659543514252e-02 + + 3.0109131336212158e-01 5.2161228656768799e-01 + <_> + + 0 -1 1009 8.0349558265879750e-04 + + 5.3001511096954346e-01 3.8183969259262085e-01 + <_> + + 0 -1 1010 3.4170378930866718e-03 + + 5.3280287981033325e-01 4.2414000630378723e-01 + <_> + + 0 -1 1011 -3.6222729249857366e-04 + + 5.4917281866073608e-01 4.1869771480560303e-01 + <_> + + 0 -1 1012 -1.1630020290613174e-01 + + 1.4407220482826233e-01 5.2264511585235596e-01 + <_> + + 0 -1 1013 -1.4695010147988796e-02 + + 7.7477252483367920e-01 4.7157171368598938e-01 + <_> + + 0 -1 1014 2.1972130052745342e-03 + + 5.3554338216781616e-01 3.3156448602676392e-01 + <_> + + 0 -1 1015 -4.6965209185145795e-04 + + 5.7672351598739624e-01 4.4581368565559387e-01 + <_> + + 0 -1 1016 6.5144998952746391e-03 + + 5.2156740427017212e-01 3.6478888988494873e-01 + <_> + + 0 -1 1017 2.1300060674548149e-02 + + 4.9942049384117126e-01 1.5679509937763214e-01 + <_> + + 0 -1 1018 3.1881409231573343e-03 + + 4.7422000765800476e-01 6.2872701883316040e-01 + <_> + + 0 -1 1019 9.0019777417182922e-04 + + 5.3479540348052979e-01 3.9437520503997803e-01 + <_> + + 0 -1 1020 -5.1772277802228928e-03 + + 6.7271918058395386e-01 5.0131380558013916e-01 + <_> + + 0 -1 1021 -4.3764649890363216e-03 + + 3.1066751480102539e-01 5.1287931203842163e-01 + <_> + + 0 -1 1022 2.6299960445612669e-03 + + 4.8863101005554199e-01 5.7552158832550049e-01 + <_> + + 0 -1 1023 -2.0458688959479332e-03 + + 6.0257941484451294e-01 4.5580768585205078e-01 + <_> + + 0 -1 1024 6.9482706487178802e-02 + + 5.2407479286193848e-01 2.1852590143680573e-01 + <_> + + 0 -1 1025 2.4048939347267151e-02 + + 5.0118672847747803e-01 2.0906220376491547e-01 + <_> + + 0 -1 1026 3.1095340382307768e-03 + + 4.8667120933532715e-01 7.1085482835769653e-01 + <_> + + 0 -1 1027 -1.2503260513767600e-03 + + 3.4078910946846008e-01 5.1561951637268066e-01 + <_> + + 0 -1 1028 -1.0281190043315291e-03 + + 5.5755722522735596e-01 4.4394320249557495e-01 + <_> + + 0 -1 1029 -8.8893622159957886e-03 + + 6.4020007848739624e-01 4.6204420924186707e-01 + <_> + + 0 -1 1030 -6.1094801640138030e-04 + + 3.7664419412612915e-01 5.4488998651504517e-01 + <_> + + 0 -1 1031 -5.7686357758939266e-03 + + 3.3186489343643188e-01 5.1336771249771118e-01 + <_> + + 0 -1 1032 1.8506490159779787e-03 + + 4.9035701155662537e-01 6.4069348573684692e-01 + <_> + + 0 -1 1033 -9.9799469113349915e-02 + + 1.5360510349273682e-01 5.0155621767044067e-01 + <_> + + 0 -1 1034 -3.5128349065780640e-01 + + 5.8823131024837494e-02 5.1743787527084351e-01 + <_> + + 0 -1 1035 -4.5244570821523666e-02 + + 6.9614887237548828e-01 4.6778729557991028e-01 + <_> + + 0 -1 1036 7.1481578052043915e-02 + + 5.1679861545562744e-01 1.0380929708480835e-01 + <_> + + 0 -1 1037 2.1895780228078365e-03 + + 4.2730781435966492e-01 5.5320608615875244e-01 + <_> + + 0 -1 1038 -5.9242651332169771e-04 + + 4.6389439702033997e-01 5.2763891220092773e-01 + <_> + + 0 -1 1039 1.6788389766588807e-03 + + 5.3016489744186401e-01 3.9320349693298340e-01 + <_> + + 0 -1 1040 -2.2163488902151585e-03 + + 5.6306940317153931e-01 4.7570338845252991e-01 + <_> + + 0 -1 1041 1.1568699846975505e-04 + + 4.3075358867645264e-01 5.5357027053833008e-01 + <_> + + 0 -1 1042 -7.2017288766801357e-03 + + 1.4448820054531097e-01 5.1930642127990723e-01 + <_> + + 0 -1 1043 8.9081272017210722e-04 + + 4.3844321370124817e-01 5.5936211347579956e-01 + <_> + + 0 -1 1044 1.9605009583756328e-04 + + 5.3404158353805542e-01 4.7059568762779236e-01 + <_> + + 0 -1 1045 5.2022142335772514e-04 + + 5.2138561010360718e-01 3.8100790977478027e-01 + <_> + + 0 -1 1046 9.4588572392240167e-04 + + 4.7694149613380432e-01 6.1307388544082642e-01 + <_> + + 0 -1 1047 9.1698471806012094e-05 + + 4.2450091242790222e-01 5.4293632507324219e-01 + <_> + + 0 -1 1048 2.1833200007677078e-03 + + 5.4577308893203735e-01 4.1910758614540100e-01 + <_> + + 0 -1 1049 -8.6039671441540122e-04 + + 5.7645887136459351e-01 4.4716599583625793e-01 + <_> + + 0 -1 1050 -1.3236239552497864e-02 + + 6.3728231191635132e-01 4.6950098872184753e-01 + <_> + + 0 -1 1051 4.3376701069064438e-04 + + 5.3178739547729492e-01 3.9458298683166504e-01 + <_> + 140 + 6.9229873657226562e+01 + + <_> + + 0 -1 1052 -2.4847149848937988e-02 + + 6.5555167198181152e-01 3.8733118772506714e-01 + <_> + + 0 -1 1053 6.1348611488938332e-03 + + 3.7480720877647400e-01 5.9739977121353149e-01 + <_> + + 0 -1 1054 6.4498498104512691e-03 + + 5.4254919290542603e-01 2.5488111376762390e-01 + <_> + + 0 -1 1055 6.3491211039945483e-04 + + 2.4624420702457428e-01 5.3872537612915039e-01 + <_> + + 0 -1 1056 1.4023890253156424e-03 + + 5.5943220853805542e-01 3.5286578536033630e-01 + <_> + + 0 -1 1057 3.0044000595808029e-04 + + 3.9585039019584656e-01 5.7659381628036499e-01 + <_> + + 0 -1 1058 1.0042409849120304e-04 + + 3.6989969015121460e-01 5.5349981784820557e-01 + <_> + + 0 -1 1059 -5.0841490738093853e-03 + + 3.7110909819602966e-01 5.5478000640869141e-01 + <_> + + 0 -1 1060 -1.9537260755896568e-02 + + 7.4927550554275513e-01 4.5792970061302185e-01 + <_> + + 0 -1 1061 -7.4532740654831287e-06 + + 5.6497871875762939e-01 3.9040699601173401e-01 + <_> + + 0 -1 1062 -3.6079459823668003e-03 + + 3.3810880780220032e-01 5.2678012847900391e-01 + <_> + + 0 -1 1063 2.0697501022368670e-03 + + 5.5192911624908447e-01 3.7143889069557190e-01 + <_> + + 0 -1 1064 -4.6463840408250690e-04 + + 5.6082147359848022e-01 4.1135668754577637e-01 + <_> + + 0 -1 1065 7.5490452582016587e-04 + + 3.5592061281204224e-01 5.3293561935424805e-01 + <_> + + 0 -1 1066 -9.8322238773107529e-04 + + 5.4147958755493164e-01 3.7632051110267639e-01 + <_> + + 0 -1 1067 -1.9940640777349472e-02 + + 6.3479030132293701e-01 4.7052991390228271e-01 + <_> + + 0 -1 1068 3.7680300883948803e-03 + + 3.9134898781776428e-01 5.5637162923812866e-01 + <_> + + 0 -1 1069 -9.4528505578637123e-03 + + 2.5548928976058960e-01 5.2151167392730713e-01 + <_> + + 0 -1 1070 2.9560849070549011e-03 + + 5.1746791601181030e-01 3.0639201402664185e-01 + <_> + + 0 -1 1071 9.1078737750649452e-03 + + 5.3884482383728027e-01 2.8859630227088928e-01 + <_> + + 0 -1 1072 1.8219229532405734e-03 + + 4.3360430002212524e-01 5.8521968126296997e-01 + <_> + + 0 -1 1073 1.4688739553093910e-02 + + 5.2873617410659790e-01 2.8700059652328491e-01 + <_> + + 0 -1 1074 -1.4387990348041058e-02 + + 7.0194488763809204e-01 4.6473708748817444e-01 + <_> + + 0 -1 1075 -1.8986649811267853e-02 + + 2.9865521192550659e-01 5.2470117807388306e-01 + <_> + + 0 -1 1076 1.1527639580890536e-03 + + 4.3234738707542419e-01 5.9316617250442505e-01 + <_> + + 0 -1 1077 1.0933670215308666e-02 + + 5.2868640422821045e-01 3.1303191184997559e-01 + <_> + + 0 -1 1078 -1.4932730235159397e-02 + + 2.6584190130233765e-01 5.0840771198272705e-01 + <_> + + 0 -1 1079 -2.9970539617352188e-04 + + 5.4635268449783325e-01 3.7407240271568298e-01 + <_> + + 0 -1 1080 4.1677621193230152e-03 + + 4.7034969925880432e-01 7.4357217550277710e-01 + <_> + + 0 -1 1081 -6.3905320130288601e-03 + + 2.0692589879035950e-01 5.2805382013320923e-01 + <_> + + 0 -1 1082 4.5029609464108944e-03 + + 5.1826488971710205e-01 3.4835430979728699e-01 + <_> + + 0 -1 1083 -9.2040365561842918e-03 + + 6.8037772178649902e-01 4.9323600530624390e-01 + <_> + + 0 -1 1084 8.1327259540557861e-02 + + 5.0583988428115845e-01 2.2530519962310791e-01 + <_> + + 0 -1 1085 -1.5079280734062195e-01 + + 2.9634249210357666e-01 5.2646797895431519e-01 + <_> + + 0 -1 1086 3.3179009333252907e-03 + + 4.6554958820343018e-01 7.0729321241378784e-01 + <_> + + 0 -1 1087 7.7402801252901554e-04 + + 4.7803479433059692e-01 5.6682378053665161e-01 + <_> + + 0 -1 1088 6.8199541419744492e-04 + + 4.2869961261749268e-01 5.7221567630767822e-01 + <_> + + 0 -1 1089 5.3671570494771004e-03 + + 5.2993071079254150e-01 3.1146219372749329e-01 + <_> + + 0 -1 1090 9.7018666565418243e-05 + + 3.6746388673782349e-01 5.2694618701934814e-01 + <_> + + 0 -1 1091 -1.2534089386463165e-01 + + 2.3514920473098755e-01 5.2457910776138306e-01 + <_> + + 0 -1 1092 -5.2516269497573376e-03 + + 7.1159368753433228e-01 4.6937671303749084e-01 + <_> + + 0 -1 1093 -7.8342109918594360e-03 + + 4.4626510143280029e-01 5.4090857505798340e-01 + <_> + + 0 -1 1094 -1.1310069821774960e-03 + + 5.9456187486648560e-01 4.4176620244979858e-01 + <_> + + 0 -1 1095 1.7601120052859187e-03 + + 5.3532499074935913e-01 3.9734530448913574e-01 + <_> + + 0 -1 1096 -8.1581249833106995e-04 + + 3.7602680921554565e-01 5.2647268772125244e-01 + <_> + + 0 -1 1097 -3.8687589112669230e-03 + + 6.3099128007888794e-01 4.7498199343681335e-01 + <_> + + 0 -1 1098 1.5207129763439298e-03 + + 5.2301818132400513e-01 3.3612239360809326e-01 + <_> + + 0 -1 1099 5.4586738348007202e-01 + + 5.1671397686004639e-01 1.1726350337266922e-01 + <_> + + 0 -1 1100 1.5650190412998199e-02 + + 4.9794390797615051e-01 1.3932949304580688e-01 + <_> + + 0 -1 1101 -1.1731860227882862e-02 + + 7.1296507120132446e-01 4.9211961030960083e-01 + <_> + + 0 -1 1102 -6.1765122227370739e-03 + + 2.2881029546260834e-01 5.0497019290924072e-01 + <_> + + 0 -1 1103 2.2457661107182503e-03 + + 4.6324339509010315e-01 6.0487258434295654e-01 + <_> + + 0 -1 1104 -5.1915869116783142e-03 + + 6.4674210548400879e-01 4.6021929383277893e-01 + <_> + + 0 -1 1105 -2.3827880620956421e-02 + + 1.4820009469985962e-01 5.2260792255401611e-01 + <_> + + 0 -1 1106 1.0284580057486892e-03 + + 5.1354891061782837e-01 3.3759570121765137e-01 + <_> + + 0 -1 1107 -1.0078850202262402e-02 + + 2.7405610680580139e-01 5.3035670518875122e-01 + <_> + + 0 -1 1108 2.6168930344283581e-03 + + 5.3326708078384399e-01 3.9724540710449219e-01 + <_> + + 0 -1 1109 5.4385367548093200e-04 + + 5.3656041622161865e-01 4.0634119510650635e-01 + <_> + + 0 -1 1110 5.3510512225329876e-03 + + 4.6537590026855469e-01 6.8890458345413208e-01 + <_> + + 0 -1 1111 -1.5274790348485112e-03 + + 5.4495012760162354e-01 3.6247238516807556e-01 + <_> + + 0 -1 1112 -8.0624416470527649e-02 + + 1.6560870409011841e-01 5.0002872943878174e-01 + <_> + + 0 -1 1113 2.2192029282450676e-02 + + 5.1327311992645264e-01 2.0028080046176910e-01 + <_> + + 0 -1 1114 7.3100631125271320e-03 + + 4.6179479360580444e-01 6.3665360212326050e-01 + <_> + + 0 -1 1115 -6.4063072204589844e-03 + + 5.9162509441375732e-01 4.8678609728813171e-01 + <_> + + 0 -1 1116 -7.6415040530264378e-04 + + 3.8884091377258301e-01 5.3157979249954224e-01 + <_> + + 0 -1 1117 7.6734489994123578e-04 + + 4.1590648889541626e-01 5.6052798032760620e-01 + <_> + + 0 -1 1118 6.1474501853808761e-04 + + 3.0890220403671265e-01 5.1201480627059937e-01 + <_> + + 0 -1 1119 -5.0105270929634571e-03 + + 3.9721998572349548e-01 5.2073061466217041e-01 + <_> + + 0 -1 1120 -8.6909132078289986e-03 + + 6.2574082612991333e-01 4.6085759997367859e-01 + <_> + + 0 -1 1121 -1.6391459852457047e-02 + + 2.0852099359035492e-01 5.2422660589218140e-01 + <_> + + 0 -1 1122 4.0973909199237823e-04 + + 5.2224272489547729e-01 3.7803208827972412e-01 + <_> + + 0 -1 1123 -2.5242289993911982e-03 + + 5.8039271831512451e-01 4.6118900179862976e-01 + <_> + + 0 -1 1124 5.0945312250405550e-04 + + 4.4012719392776489e-01 5.8460158109664917e-01 + <_> + + 0 -1 1125 1.9656419754028320e-03 + + 5.3223252296447754e-01 4.1845908761024475e-01 + <_> + + 0 -1 1126 5.6298897834494710e-04 + + 3.7418448925018311e-01 5.2345657348632812e-01 + <_> + + 0 -1 1127 -6.7946797935292125e-04 + + 4.6310418844223022e-01 5.3564780950546265e-01 + <_> + + 0 -1 1128 7.2856349870562553e-03 + + 5.0446701049804688e-01 2.3775640130043030e-01 + <_> + + 0 -1 1129 -1.7459489405155182e-02 + + 7.2891211509704590e-01 5.0504350662231445e-01 + <_> + + 0 -1 1130 -2.5421749800443649e-02 + + 6.6671347618103027e-01 4.6781000494956970e-01 + <_> + + 0 -1 1131 -1.5647639520466328e-03 + + 4.3917590379714966e-01 5.3236269950866699e-01 + <_> + + 0 -1 1132 1.1444360017776489e-02 + + 4.3464401364326477e-01 5.6800121068954468e-01 + <_> + + 0 -1 1133 -6.7352550104260445e-04 + + 4.4771409034729004e-01 5.2968120574951172e-01 + <_> + + 0 -1 1134 9.3194209039211273e-03 + + 4.7402000427246094e-01 7.4626070261001587e-01 + <_> + + 0 -1 1135 1.3328490604180843e-04 + + 5.3650617599487305e-01 4.7521349787712097e-01 + <_> + + 0 -1 1136 -7.8815799206495285e-03 + + 1.7522190511226654e-01 5.0152552127838135e-01 + <_> + + 0 -1 1137 -5.7985680177807808e-03 + + 7.2712367773056030e-01 4.8962008953094482e-01 + <_> + + 0 -1 1138 -3.8922499516047537e-04 + + 4.0039089322090149e-01 5.3449410200119019e-01 + <_> + + 0 -1 1139 -1.9288610201328993e-03 + + 5.6056129932403564e-01 4.8039558529853821e-01 + <_> + + 0 -1 1140 8.4214154630899429e-03 + + 4.7532469034194946e-01 7.6236087083816528e-01 + <_> + + 0 -1 1141 8.1655876711010933e-03 + + 5.3932619094848633e-01 4.1916438937187195e-01 + <_> + + 0 -1 1142 4.8280550981871784e-04 + + 4.2408001422882080e-01 5.3998219966888428e-01 + <_> + + 0 -1 1143 -2.7186630759388208e-03 + + 4.2445999383926392e-01 5.4249238967895508e-01 + <_> + + 0 -1 1144 -1.2507230043411255e-02 + + 5.8958417177200317e-01 4.5504111051559448e-01 + <_> + + 0 -1 1145 -2.4286519736051559e-02 + + 2.6471349596977234e-01 5.1891797780990601e-01 + <_> + + 0 -1 1146 -2.9676330741494894e-03 + + 7.3476827144622803e-01 4.7497498989105225e-01 + <_> + + 0 -1 1147 -1.2528999708592892e-02 + + 2.7560499310493469e-01 5.1775997877120972e-01 + <_> + + 0 -1 1148 -1.0104000102728605e-03 + + 3.5105609893798828e-01 5.1447242498397827e-01 + <_> + + 0 -1 1149 -2.1348530426621437e-03 + + 5.6379258632659912e-01 4.6673199534416199e-01 + <_> + + 0 -1 1150 1.9564259797334671e-02 + + 4.6145731210708618e-01 6.1376398801803589e-01 + <_> + + 0 -1 1151 -9.7146347165107727e-02 + + 2.9983788728713989e-01 5.1935559511184692e-01 + <_> + + 0 -1 1152 4.5014568604528904e-03 + + 5.0778847932815552e-01 3.0457559227943420e-01 + <_> + + 0 -1 1153 6.3706971704959869e-03 + + 4.8610189557075500e-01 6.8875008821487427e-01 + <_> + + 0 -1 1154 -9.0721528977155685e-03 + + 1.6733959317207336e-01 5.0175631046295166e-01 + <_> + + 0 -1 1155 -5.3537208586931229e-03 + + 2.6927569508552551e-01 5.2426332235336304e-01 + <_> + + 0 -1 1156 -1.0932840406894684e-02 + + 7.1838641166687012e-01 4.7360289096832275e-01 + <_> + + 0 -1 1157 8.2356072962284088e-03 + + 5.2239668369293213e-01 2.3898629844188690e-01 + <_> + + 0 -1 1158 -1.0038160253316164e-03 + + 5.7193559408187866e-01 4.4339430332183838e-01 + <_> + + 0 -1 1159 4.0859128348529339e-03 + + 5.4728418588638306e-01 4.1488361358642578e-01 + <_> + + 0 -1 1160 1.5485419332981110e-01 + + 4.9738121032714844e-01 6.1061598360538483e-02 + <_> + + 0 -1 1161 2.0897459762636572e-04 + + 4.7091740369796753e-01 5.4238891601562500e-01 + <_> + + 0 -1 1162 3.3316991175524890e-04 + + 4.0896269679069519e-01 5.3009921312332153e-01 + <_> + + 0 -1 1163 -1.0813400149345398e-02 + + 6.1043697595596313e-01 4.9573341012001038e-01 + <_> + + 0 -1 1164 4.5656010508537292e-02 + + 5.0696891546249390e-01 2.8666600584983826e-01 + <_> + + 0 -1 1165 1.2569549726322293e-03 + + 4.8469170928001404e-01 6.3181710243225098e-01 + <_> + + 0 -1 1166 -1.2015070021152496e-01 + + 6.0526140034198761e-02 4.9809598922729492e-01 + <_> + + 0 -1 1167 -1.0533799650147557e-04 + + 5.3631097078323364e-01 4.7080421447753906e-01 + <_> + + 0 -1 1168 -2.0703190565109253e-01 + + 5.9660330414772034e-02 4.9790981411933899e-01 + <_> + + 0 -1 1169 1.2909180077258497e-04 + + 4.7129771113395691e-01 5.3779977560043335e-01 + <_> + + 0 -1 1170 3.8818528992123902e-04 + + 4.3635380268096924e-01 5.5341911315917969e-01 + <_> + + 0 -1 1171 -2.9243610333651304e-03 + + 5.8111858367919922e-01 4.8252159357070923e-01 + <_> + + 0 -1 1172 8.3882332546636462e-04 + + 5.3117001056671143e-01 4.0381389856338501e-01 + <_> + + 0 -1 1173 -1.9061550265178084e-03 + + 3.7707018852233887e-01 5.2600151300430298e-01 + <_> + + 0 -1 1174 8.9514348655939102e-03 + + 4.7661679983139038e-01 7.6821839809417725e-01 + <_> + + 0 -1 1175 1.3083459809422493e-02 + + 5.2644628286361694e-01 3.0622220039367676e-01 + <_> + + 0 -1 1176 -2.1159330010414124e-01 + + 6.7371982336044312e-01 4.6958100795745850e-01 + <_> + + 0 -1 1177 3.1493250280618668e-03 + + 5.6448352336883545e-01 4.3869531154632568e-01 + <_> + + 0 -1 1178 3.9754100725986063e-04 + + 4.5260611176490784e-01 5.8956301212310791e-01 + <_> + + 0 -1 1179 -1.3814480043947697e-03 + + 6.0705822706222534e-01 4.9424138665199280e-01 + <_> + + 0 -1 1180 -5.8122188784182072e-04 + + 5.9982132911682129e-01 4.5082521438598633e-01 + <_> + + 0 -1 1181 -2.3905329871922731e-03 + + 4.2055889964103699e-01 5.2238482236862183e-01 + <_> + + 0 -1 1182 2.7268929407000542e-02 + + 5.2064472436904907e-01 3.5633018612861633e-01 + <_> + + 0 -1 1183 -3.7658358924090862e-03 + + 3.1447041034698486e-01 5.2188140153884888e-01 + <_> + + 0 -1 1184 -1.4903489500284195e-03 + + 3.3801960945129395e-01 5.1244372129440308e-01 + <_> + + 0 -1 1185 -1.7428230494260788e-02 + + 5.8299607038497925e-01 4.9197259545326233e-01 + <_> + + 0 -1 1186 -1.5278030186891556e-02 + + 6.1631447076797485e-01 4.6178871393203735e-01 + <_> + + 0 -1 1187 3.1995609402656555e-02 + + 5.1663571596145630e-01 1.7127640545368195e-01 + <_> + + 0 -1 1188 -3.8256710395216942e-03 + + 3.4080120921134949e-01 5.1313877105712891e-01 + <_> + + 0 -1 1189 -8.5186436772346497e-03 + + 6.1055189371109009e-01 4.9979418516159058e-01 + <_> + + 0 -1 1190 9.0641621500253677e-04 + + 4.3272709846496582e-01 5.5823111534118652e-01 + <_> + + 0 -1 1191 1.0344849899411201e-02 + + 4.8556530475616455e-01 5.4524201154708862e-01 + <_> + 160 + 7.9249076843261719e+01 + + <_> + + 0 -1 1192 7.8981826081871986e-03 + + 3.3325248956680298e-01 5.9464621543884277e-01 + <_> + + 0 -1 1193 1.6170160379260778e-03 + + 3.4906411170959473e-01 5.5778688192367554e-01 + <_> + + 0 -1 1194 -5.5449741194024682e-04 + + 5.5425661802291870e-01 3.2915300130844116e-01 + <_> + + 0 -1 1195 1.5428980113938451e-03 + + 3.6125791072845459e-01 5.5459791421890259e-01 + <_> + + 0 -1 1196 -1.0329450014978647e-03 + + 3.5301390290260315e-01 5.5761402845382690e-01 + <_> + + 0 -1 1197 7.7698158565908670e-04 + + 3.9167788624763489e-01 5.6453210115432739e-01 + <_> + + 0 -1 1198 1.4320300519466400e-01 + + 4.6674820780754089e-01 7.0236331224441528e-01 + <_> + + 0 -1 1199 -7.3866490274667740e-03 + + 3.0736848711967468e-01 5.2892577648162842e-01 + <_> + + 0 -1 1200 -6.2936742324382067e-04 + + 5.6221181154251099e-01 4.0370491147041321e-01 + <_> + + 0 -1 1201 7.8893528552725911e-04 + + 5.2676612138748169e-01 3.5578748583793640e-01 + <_> + + 0 -1 1202 -1.2228050269186497e-02 + + 6.6683208942413330e-01 4.6255499124526978e-01 + <_> + + 0 -1 1203 3.5420239437371492e-03 + + 5.5214381217956543e-01 3.8696730136871338e-01 + <_> + + 0 -1 1204 -1.0585320414975286e-03 + + 3.6286780238151550e-01 5.3209269046783447e-01 + <_> + + 0 -1 1205 1.4935660146875307e-05 + + 4.6324449777603149e-01 5.3633230924606323e-01 + <_> + + 0 -1 1206 5.2537708543241024e-03 + + 5.1322317123413086e-01 3.2657089829444885e-01 + <_> + + 0 -1 1207 -8.2338023930788040e-03 + + 6.6936898231506348e-01 4.7741401195526123e-01 + <_> + + 0 -1 1208 2.1866810129722580e-05 + + 4.0538620948791504e-01 5.4579311609268188e-01 + <_> + + 0 -1 1209 -3.8150229956954718e-03 + + 6.4549958705902100e-01 4.7931781411170959e-01 + <_> + + 0 -1 1210 1.1105879675596952e-03 + + 5.2704071998596191e-01 3.5296788811683655e-01 + <_> + + 0 -1 1211 -5.7707689702510834e-03 + + 3.8035470247268677e-01 5.3529578447341919e-01 + <_> + + 0 -1 1212 -3.0158339068293571e-03 + + 5.3394031524658203e-01 3.8871330022811890e-01 + <_> + + 0 -1 1213 -8.5453689098358154e-04 + + 3.5646161437034607e-01 5.2736037969589233e-01 + <_> + + 0 -1 1214 1.1050510220229626e-02 + + 4.6719071269035339e-01 6.8497377634048462e-01 + <_> + + 0 -1 1215 4.2605839669704437e-02 + + 5.1514732837677002e-01 7.0220090448856354e-02 + <_> + + 0 -1 1216 -3.0781750101596117e-03 + + 3.0416610836982727e-01 5.1526021957397461e-01 + <_> + + 0 -1 1217 -5.4815728217363358e-03 + + 6.4302957057952881e-01 4.8972299695014954e-01 + <_> + + 0 -1 1218 3.1881860923022032e-03 + + 5.3074932098388672e-01 3.8262099027633667e-01 + <_> + + 0 -1 1219 3.5947180003859103e-04 + + 4.6500471234321594e-01 5.4219049215316772e-01 + <_> + + 0 -1 1220 -4.0705031715333462e-03 + + 2.8496798872947693e-01 5.0791162252426147e-01 + <_> + + 0 -1 1221 -1.4594170264899731e-02 + + 2.9716458916664124e-01 5.1284617185592651e-01 + <_> + + 0 -1 1222 -1.1947689927183092e-04 + + 5.6310981512069702e-01 4.3430820107460022e-01 + <_> + + 0 -1 1223 -6.9344649091362953e-04 + + 4.4035780429840088e-01 5.3599590063095093e-01 + <_> + + 0 -1 1224 1.4834799912932795e-05 + + 3.4210088849067688e-01 5.1646977663040161e-01 + <_> + + 0 -1 1225 9.0296985581517220e-03 + + 4.6393430233001709e-01 6.1140751838684082e-01 + <_> + + 0 -1 1226 -8.0640818923711777e-03 + + 2.8201588988304138e-01 5.0754940509796143e-01 + <_> + + 0 -1 1227 2.6062119752168655e-02 + + 5.2089059352874756e-01 2.6887780427932739e-01 + <_> + + 0 -1 1228 1.7314659431576729e-02 + + 4.6637138724327087e-01 6.7385399341583252e-01 + <_> + + 0 -1 1229 2.2666640579700470e-02 + + 5.2093499898910522e-01 2.2127239406108856e-01 + <_> + + 0 -1 1230 -2.1965929772704840e-03 + + 6.0631012916564941e-01 4.5381900668144226e-01 + <_> + + 0 -1 1231 -9.5282476395368576e-03 + + 4.6352049708366394e-01 5.2474308013916016e-01 + <_> + + 0 -1 1232 8.0943619832396507e-03 + + 5.2894401550292969e-01 3.9138820767402649e-01 + <_> + + 0 -1 1233 -7.2877332568168640e-02 + + 7.7520018815994263e-01 4.9902349710464478e-01 + <_> + + 0 -1 1234 -6.9009521976113319e-03 + + 2.4280390143394470e-01 5.0480902194976807e-01 + <_> + + 0 -1 1235 -1.1308239772915840e-02 + + 5.7343649864196777e-01 4.8423761129379272e-01 + <_> + + 0 -1 1236 5.9613201767206192e-02 + + 5.0298362970352173e-01 2.5249770283699036e-01 + <_> + + 0 -1 1237 -2.8624620754271746e-03 + + 6.0730451345443726e-01 4.8984599113464355e-01 + <_> + + 0 -1 1238 4.4781449250876904e-03 + + 5.0152891874313354e-01 2.2203169763088226e-01 + <_> + + 0 -1 1239 -1.7513240454718471e-03 + + 6.6144287586212158e-01 4.9338689446449280e-01 + <_> + + 0 -1 1240 4.0163420140743256e-02 + + 5.1808780431747437e-01 3.7410449981689453e-01 + <_> + + 0 -1 1241 3.4768949262797832e-04 + + 4.7204169631004333e-01 5.8180320262908936e-01 + <_> + + 0 -1 1242 2.6551650371402502e-03 + + 3.8050109148025513e-01 5.2213358879089355e-01 + <_> + + 0 -1 1243 -8.7706279009580612e-03 + + 2.9441660642623901e-01 5.2312952280044556e-01 + <_> + + 0 -1 1244 -5.5122091434895992e-03 + + 7.3461771011352539e-01 4.7228169441223145e-01 + <_> + + 0 -1 1245 6.8672042107209563e-04 + + 5.4528760910034180e-01 4.2424130439758301e-01 + <_> + + 0 -1 1246 5.6019669864326715e-04 + + 4.3988621234893799e-01 5.6012850999832153e-01 + <_> + + 0 -1 1247 2.4143769405782223e-03 + + 4.7416868805885315e-01 6.1366218328475952e-01 + <_> + + 0 -1 1248 -1.5680900542065501e-03 + + 6.0445529222488403e-01 4.5164099335670471e-01 + <_> + + 0 -1 1249 -3.6827491130679846e-03 + + 2.4524590373039246e-01 5.2949821949005127e-01 + <_> + + 0 -1 1250 -2.9409190756268799e-04 + + 3.7328380346298218e-01 5.2514511346817017e-01 + <_> + + 0 -1 1251 4.2847759323194623e-04 + + 5.4988098144531250e-01 4.0655350685119629e-01 + <_> + + 0 -1 1252 -4.8817070201039314e-03 + + 2.1399089694023132e-01 4.9999570846557617e-01 + <_> + + 0 -1 1253 2.7272020815871656e-04 + + 4.6502870321273804e-01 5.8134287595748901e-01 + <_> + + 0 -1 1254 2.0947199664078653e-04 + + 4.3874868750572205e-01 5.5727928876876831e-01 + <_> + + 0 -1 1255 4.8501189798116684e-02 + + 5.2449727058410645e-01 3.2128891348838806e-01 + <_> + + 0 -1 1256 -4.5166411437094212e-03 + + 6.0568130016326904e-01 4.5458820462226868e-01 + <_> + + 0 -1 1257 -1.2291680090129375e-02 + + 2.0409290492534637e-01 5.1522141695022583e-01 + <_> + + 0 -1 1258 4.8549679922871292e-04 + + 5.2376049757003784e-01 3.7395030260086060e-01 + <_> + + 0 -1 1259 3.0556049197912216e-02 + + 4.9605339765548706e-01 5.9382462501525879e-01 + <_> + + 0 -1 1260 -1.5105320198927075e-04 + + 5.3513038158416748e-01 4.1452041268348694e-01 + <_> + + 0 -1 1261 2.4937440175563097e-03 + + 4.6933668851852417e-01 5.5149412155151367e-01 + <_> + + 0 -1 1262 -1.2382130138576031e-02 + + 6.7913967370986938e-01 4.6816679835319519e-01 + <_> + + 0 -1 1263 -5.1333461888134480e-03 + + 3.6087390780448914e-01 5.2291601896286011e-01 + <_> + + 0 -1 1264 5.1919277757406235e-04 + + 5.3000730276107788e-01 3.6336138844490051e-01 + <_> + + 0 -1 1265 1.5060420334339142e-01 + + 5.1573169231414795e-01 2.2117820382118225e-01 + <_> + + 0 -1 1266 7.7144149690866470e-03 + + 4.4104969501495361e-01 5.7766091823577881e-01 + <_> + + 0 -1 1267 9.4443522393703461e-03 + + 5.4018551111221313e-01 3.7566500902175903e-01 + <_> + + 0 -1 1268 2.5006249779835343e-04 + + 4.3682709336280823e-01 5.6073749065399170e-01 + <_> + + 0 -1 1269 -3.3077150583267212e-03 + + 4.2447990179061890e-01 5.5182307958602905e-01 + <_> + + 0 -1 1270 7.4048910755664110e-04 + + 4.4969621300697327e-01 5.9005767107009888e-01 + <_> + + 0 -1 1271 4.4092051684856415e-02 + + 5.2934932708740234e-01 3.1563550233840942e-01 + <_> + + 0 -1 1272 3.3639909233897924e-03 + + 4.4832968711853027e-01 5.8486622571945190e-01 + <_> + + 0 -1 1273 -3.9760079234838486e-03 + + 4.5595070719718933e-01 5.4836392402648926e-01 + <_> + + 0 -1 1274 2.7716930489987135e-03 + + 5.3417861461639404e-01 3.7924841046333313e-01 + <_> + + 0 -1 1275 -2.4123019829858094e-04 + + 5.6671887636184692e-01 4.5769730210304260e-01 + <_> + + 0 -1 1276 4.9425667384639382e-04 + + 4.4212448596954346e-01 5.6287872791290283e-01 + <_> + + 0 -1 1277 -3.8876468897797167e-04 + + 4.2883709073066711e-01 5.3910630941390991e-01 + <_> + + 0 -1 1278 -5.0048898905515671e-02 + + 6.8995130062103271e-01 4.7037428617477417e-01 + <_> + + 0 -1 1279 -3.6635480821132660e-02 + + 2.2177790105342865e-01 5.1918262243270874e-01 + <_> + + 0 -1 1280 2.4273579474538565e-03 + + 5.1362240314483643e-01 3.4973978996276855e-01 + <_> + + 0 -1 1281 1.9558030180633068e-03 + + 4.8261928558349609e-01 6.4083808660507202e-01 + <_> + + 0 -1 1282 -1.7494610510766506e-03 + + 3.9228358864784241e-01 5.2726852893829346e-01 + <_> + + 0 -1 1283 1.3955079950392246e-02 + + 5.0782018899917603e-01 8.4165048599243164e-01 + <_> + + 0 -1 1284 -2.1896739781368524e-04 + + 5.5204898118972778e-01 4.3142348527908325e-01 + <_> + + 0 -1 1285 -1.5131309628486633e-03 + + 3.9346051216125488e-01 5.3825712203979492e-01 + <_> + + 0 -1 1286 -4.3622800149023533e-03 + + 7.3706287145614624e-01 4.7364759445190430e-01 + <_> + + 0 -1 1287 6.5160587430000305e-02 + + 5.1592797040939331e-01 3.2815951108932495e-01 + <_> + + 0 -1 1288 -2.3567399475723505e-03 + + 3.6728268861770630e-01 5.1728862524032593e-01 + <_> + + 0 -1 1289 1.5146659687161446e-02 + + 5.0314939022064209e-01 6.6876041889190674e-01 + <_> + + 0 -1 1290 -2.2850960493087769e-02 + + 6.7675197124481201e-01 4.7095969319343567e-01 + <_> + + 0 -1 1291 4.8867650330066681e-03 + + 5.2579981088638306e-01 4.0598788857460022e-01 + <_> + + 0 -1 1292 1.7619599821045995e-03 + + 4.6962729096412659e-01 6.6882789134979248e-01 + <_> + + 0 -1 1293 -1.2942519970238209e-03 + + 4.3207129836082458e-01 5.3442817926406860e-01 + <_> + + 0 -1 1294 1.0929949581623077e-02 + + 4.9977061152458191e-01 1.6374860703945160e-01 + <_> + + 0 -1 1295 2.9958489903947338e-05 + + 4.2824178934097290e-01 5.6332242488861084e-01 + <_> + + 0 -1 1296 -6.5884361974895000e-03 + + 6.7721211910247803e-01 4.7005268931388855e-01 + <_> + + 0 -1 1297 3.2527779694646597e-03 + + 5.3133970499038696e-01 4.5361489057540894e-01 + <_> + + 0 -1 1298 -4.0435739792883396e-03 + + 5.6600618362426758e-01 4.4133889675140381e-01 + <_> + + 0 -1 1299 -1.2523540062829852e-03 + + 3.7319138646125793e-01 5.3564518690109253e-01 + <_> + + 0 -1 1300 1.9246719602961093e-04 + + 5.1899862289428711e-01 3.7388110160827637e-01 + <_> + + 0 -1 1301 -3.8589671254158020e-02 + + 2.9563739895820618e-01 5.1888108253479004e-01 + <_> + + 0 -1 1302 1.5489870565943420e-04 + + 4.3471351265907288e-01 5.5095332860946655e-01 + <_> + + 0 -1 1303 -3.3763848245143890e-02 + + 3.2303300499916077e-01 5.1954758167266846e-01 + <_> + + 0 -1 1304 -8.2657067105174065e-03 + + 5.9754890203475952e-01 4.5521140098571777e-01 + <_> + + 0 -1 1305 1.4481440302915871e-05 + + 4.7456780076026917e-01 5.4974269866943359e-01 + <_> + + 0 -1 1306 1.4951299817766994e-05 + + 4.3244731426239014e-01 5.4806441068649292e-01 + <_> + + 0 -1 1307 -1.8741799518465996e-02 + + 1.5800529718399048e-01 5.1785331964492798e-01 + <_> + + 0 -1 1308 1.7572239739820361e-03 + + 4.5176368951797485e-01 5.7737642526626587e-01 + <_> + + 0 -1 1309 -3.1391119118779898e-03 + + 4.1496479511260986e-01 5.4608422517776489e-01 + <_> + + 0 -1 1310 6.6656779381446540e-05 + + 4.0390908718109131e-01 5.2930849790573120e-01 + <_> + + 0 -1 1311 6.7743421532213688e-03 + + 4.7676518559455872e-01 6.1219561100006104e-01 + <_> + + 0 -1 1312 -7.3868161998689175e-03 + + 3.5862588882446289e-01 5.1872807741165161e-01 + <_> + + 0 -1 1313 1.4040930196642876e-02 + + 4.7121399641036987e-01 5.5761557817459106e-01 + <_> + + 0 -1 1314 -5.5258329957723618e-03 + + 2.6610270142555237e-01 5.0392812490463257e-01 + <_> + + 0 -1 1315 3.8684239983558655e-01 + + 5.1443397998809814e-01 2.5258991122245789e-01 + <_> + + 0 -1 1316 1.1459240340627730e-04 + + 4.2849949002265930e-01 5.4233711957931519e-01 + <_> + + 0 -1 1317 -1.8467569723725319e-02 + + 3.8858351111412048e-01 5.2130621671676636e-01 + <_> + + 0 -1 1318 -4.5907011372037232e-04 + + 5.4125630855560303e-01 4.2359098792076111e-01 + <_> + + 0 -1 1319 1.2527540093287826e-03 + + 4.8993051052093506e-01 6.6240912675857544e-01 + <_> + + 0 -1 1320 1.4910609461367130e-03 + + 5.2867782115936279e-01 4.0400519967079163e-01 + <_> + + 0 -1 1321 -7.5435562757775187e-04 + + 6.0329902172088623e-01 4.7951200604438782e-01 + <_> + + 0 -1 1322 -6.9478838704526424e-03 + + 4.0844011306762695e-01 5.3735041618347168e-01 + <_> + + 0 -1 1323 2.8092920547351241e-04 + + 4.8460629582405090e-01 5.7593822479248047e-01 + <_> + + 0 -1 1324 9.6073717577382922e-04 + + 5.1647412776947021e-01 3.5549798607826233e-01 + <_> + + 0 -1 1325 -2.6883929967880249e-04 + + 5.6775820255279541e-01 4.7317659854888916e-01 + <_> + + 0 -1 1326 2.1599370520561934e-03 + + 4.7314870357513428e-01 7.0705670118331909e-01 + <_> + + 0 -1 1327 5.6235301308333874e-03 + + 5.2402430772781372e-01 2.7817919850349426e-01 + <_> + + 0 -1 1328 -5.0243991427123547e-03 + + 2.8370139002799988e-01 5.0623041391372681e-01 + <_> + + 0 -1 1329 -9.7611639648675919e-03 + + 7.4007177352905273e-01 4.9345690011978149e-01 + <_> + + 0 -1 1330 4.1515100747346878e-03 + + 5.1191312074661255e-01 3.4070080518722534e-01 + <_> + + 0 -1 1331 6.2465080991387367e-03 + + 4.9237880110740662e-01 6.5790587663650513e-01 + <_> + + 0 -1 1332 -7.0597478188574314e-03 + + 2.4347110092639923e-01 5.0328421592712402e-01 + <_> + + 0 -1 1333 -2.0587709732353687e-03 + + 5.9003108739852905e-01 4.6950870752334595e-01 + <_> + + 0 -1 1334 -2.4146060459315777e-03 + + 3.6473178863525391e-01 5.1892018318176270e-01 + <_> + + 0 -1 1335 -1.4817609917372465e-03 + + 6.0349482297897339e-01 4.9401280283927917e-01 + <_> + + 0 -1 1336 -6.3016400672495365e-03 + + 5.8189898729324341e-01 4.5604279637336731e-01 + <_> + + 0 -1 1337 3.4763428848236799e-03 + + 5.2174758911132812e-01 3.4839931130409241e-01 + <_> + + 0 -1 1338 -2.2250870242714882e-02 + + 2.3607000708580017e-01 5.0320827960968018e-01 + <_> + + 0 -1 1339 -3.0612550675868988e-02 + + 6.4991867542266846e-01 4.9149191379547119e-01 + <_> + + 0 -1 1340 1.3057479634881020e-02 + + 4.4133231043815613e-01 5.6837642192840576e-01 + <_> + + 0 -1 1341 -6.0095742810517550e-04 + + 4.3597310781478882e-01 5.3334832191467285e-01 + <_> + + 0 -1 1342 -4.1514250915497541e-04 + + 5.5040627717971802e-01 4.3260601162910461e-01 + <_> + + 0 -1 1343 -1.3776290230453014e-02 + + 4.0641129016876221e-01 5.2015489339828491e-01 + <_> + + 0 -1 1344 -3.2296508550643921e-02 + + 4.7351971268653870e-02 4.9771949648857117e-01 + <_> + + 0 -1 1345 5.3556978702545166e-02 + + 4.8817330598831177e-01 6.6669392585754395e-01 + <_> + + 0 -1 1346 8.1889545544981956e-03 + + 5.4000371694564819e-01 4.2408201098442078e-01 + <_> + + 0 -1 1347 2.1055320394225419e-04 + + 4.8020479083061218e-01 5.5638527870178223e-01 + <_> + + 0 -1 1348 -2.4382730480283499e-03 + + 7.3877930641174316e-01 4.7736850380897522e-01 + <_> + + 0 -1 1349 3.2835570164024830e-03 + + 5.2885460853576660e-01 3.1712919473648071e-01 + <_> + + 0 -1 1350 2.3729570675641298e-03 + + 4.7508129477500916e-01 7.0601707696914673e-01 + <_> + + 0 -1 1351 -1.4541699783876538e-03 + + 3.8117301464080811e-01 5.3307390213012695e-01 + <_> + 177 + 8.7696029663085938e+01 + + <_> + + 0 -1 1352 5.5755238980054855e-02 + + 4.0191569924354553e-01 6.8060368299484253e-01 + <_> + + 0 -1 1353 2.4730248842388391e-03 + + 3.3511489629745483e-01 5.9657198190689087e-01 + <_> + + 0 -1 1354 -3.5031698644161224e-04 + + 5.5577081441879272e-01 3.4822869300842285e-01 + <_> + + 0 -1 1355 5.4167630150914192e-04 + + 4.2608588933944702e-01 5.6933808326721191e-01 + <_> + + 0 -1 1356 7.7193678589537740e-04 + + 3.4942400455474854e-01 5.4336887598037720e-01 + <_> + + 0 -1 1357 -1.5999219613149762e-03 + + 4.0284991264343262e-01 5.4843592643737793e-01 + <_> + + 0 -1 1358 -1.1832080053864047e-04 + + 3.8069018721580505e-01 5.4254651069641113e-01 + <_> + + 0 -1 1359 3.2909031142480671e-04 + + 2.6201000809669495e-01 5.4295217990875244e-01 + <_> + + 0 -1 1360 2.9518108931370080e-04 + + 3.7997689843177795e-01 5.3992640972137451e-01 + <_> + + 0 -1 1361 9.0466710389591753e-05 + + 4.4336450099945068e-01 5.4402261972427368e-01 + <_> + + 0 -1 1362 1.5007190086180344e-05 + + 3.7196549773216248e-01 5.4091197252273560e-01 + <_> + + 0 -1 1363 1.3935610651969910e-01 + + 5.5253958702087402e-01 4.4790428876876831e-01 + <_> + + 0 -1 1364 1.6461990308016539e-03 + + 4.2645010352134705e-01 5.7721698284149170e-01 + <_> + + 0 -1 1365 4.9984431825578213e-04 + + 4.3595260381698608e-01 5.6858712434768677e-01 + <_> + + 0 -1 1366 -1.0971280280500650e-03 + + 3.3901369571685791e-01 5.2054089307785034e-01 + <_> + + 0 -1 1367 6.6919892560690641e-04 + + 4.5574560761451721e-01 5.9806597232818604e-01 + <_> + + 0 -1 1368 8.6471042595803738e-04 + + 5.1348412036895752e-01 2.9440331459045410e-01 + <_> + + 0 -1 1369 -2.7182599296793342e-04 + + 3.9065781235694885e-01 5.3771811723709106e-01 + <_> + + 0 -1 1370 3.0249499104684219e-05 + + 3.6796098947525024e-01 5.2256888151168823e-01 + <_> + + 0 -1 1371 -8.5225896909832954e-03 + + 7.2931021451950073e-01 4.8923650383949280e-01 + <_> + + 0 -1 1372 1.6705560265108943e-03 + + 4.3453249335289001e-01 5.6961381435394287e-01 + <_> + + 0 -1 1373 -7.1433838456869125e-03 + + 2.5912800431251526e-01 5.2256238460540771e-01 + <_> + + 0 -1 1374 -1.6319369897246361e-02 + + 6.9222790002822876e-01 4.6515759825706482e-01 + <_> + + 0 -1 1375 4.8034260980784893e-03 + + 5.3522628545761108e-01 3.2863029837608337e-01 + <_> + + 0 -1 1376 -7.5421929359436035e-03 + + 2.0405440032482147e-01 5.0345462560653687e-01 + <_> + + 0 -1 1377 -1.4363110065460205e-02 + + 6.8048888444900513e-01 4.8890590667724609e-01 + <_> + + 0 -1 1378 8.9063588529825211e-04 + + 5.3106957674026489e-01 3.8954809308052063e-01 + <_> + + 0 -1 1379 -4.4060191139578819e-03 + + 5.7415628433227539e-01 4.3724268674850464e-01 + <_> + + 0 -1 1380 -1.8862540309783071e-04 + + 2.8317859768867493e-01 5.0982052087783813e-01 + <_> + + 0 -1 1381 -3.7979281041771173e-03 + + 3.3725079894065857e-01 5.2465802431106567e-01 + <_> + + 0 -1 1382 1.4627049677073956e-04 + + 5.3066742420196533e-01 3.9117100834846497e-01 + <_> + + 0 -1 1383 -4.9164638767251745e-05 + + 5.4624962806701660e-01 3.9427208900451660e-01 + <_> + + 0 -1 1384 -3.3582501113414764e-02 + + 2.1578240394592285e-01 5.0482118129730225e-01 + <_> + + 0 -1 1385 -3.5339309833943844e-03 + + 6.4653122425079346e-01 4.8726969957351685e-01 + <_> + + 0 -1 1386 5.0144111737608910e-03 + + 4.6176680922508240e-01 6.2480747699737549e-01 + <_> + + 0 -1 1387 1.8817370757460594e-02 + + 5.2206891775131226e-01 2.0000520348548889e-01 + <_> + + 0 -1 1388 -1.3434339780360460e-03 + + 4.0145379304885864e-01 5.3016197681427002e-01 + <_> + + 0 -1 1389 1.7557960236445069e-03 + + 4.7940391302108765e-01 5.6531697511672974e-01 + <_> + + 0 -1 1390 -9.5637463033199310e-02 + + 2.0341950654983521e-01 5.0067067146301270e-01 + <_> + + 0 -1 1391 -2.2241229191422462e-02 + + 7.6724731922149658e-01 5.0463402271270752e-01 + <_> + + 0 -1 1392 -1.5575819648802280e-02 + + 7.4903422594070435e-01 4.7558510303497314e-01 + <_> + + 0 -1 1393 5.3599118255078793e-03 + + 5.3653037548065186e-01 4.0046709775924683e-01 + <_> + + 0 -1 1394 -2.1763499826192856e-02 + + 7.4015498161315918e-02 4.9641749262809753e-01 + <_> + + 0 -1 1395 -1.6561590135097504e-01 + + 2.8591030836105347e-01 5.2180862426757812e-01 + <_> + + 0 -1 1396 1.6461320046801120e-04 + + 4.1916158795356750e-01 5.3807932138442993e-01 + <_> + + 0 -1 1397 -8.9077502489089966e-03 + + 6.2731927633285522e-01 4.8774048686027527e-01 + <_> + + 0 -1 1398 8.6346449097618461e-04 + + 5.1599407196044922e-01 3.6710259318351746e-01 + <_> + + 0 -1 1399 -1.3751760125160217e-03 + + 5.8843767642974854e-01 4.5790839195251465e-01 + <_> + + 0 -1 1400 -1.4081239933148026e-03 + + 3.5605099797248840e-01 5.1399451494216919e-01 + <_> + + 0 -1 1401 -3.9342888630926609e-03 + + 5.9942889213562012e-01 4.6642720699310303e-01 + <_> + + 0 -1 1402 -3.1966928392648697e-02 + + 3.3454620838165283e-01 5.1441830396652222e-01 + <_> + + 0 -1 1403 -1.5089280168467667e-05 + + 5.5826562643051147e-01 4.4140571355819702e-01 + <_> + + 0 -1 1404 5.1994470413774252e-04 + + 4.6236801147460938e-01 6.1689937114715576e-01 + <_> + + 0 -1 1405 -3.4220460802316666e-03 + + 6.5570747852325439e-01 4.9748051166534424e-01 + <_> + + 0 -1 1406 1.7723299970384687e-04 + + 5.2695018053054810e-01 3.9019080996513367e-01 + <_> + + 0 -1 1407 1.5716759953647852e-03 + + 4.6333730220794678e-01 5.7904577255249023e-01 + <_> + + 0 -1 1408 -8.9041329920291901e-03 + + 2.6896080374717712e-01 5.0535911321640015e-01 + <_> + + 0 -1 1409 4.0677518700249493e-04 + + 5.4566031694412231e-01 4.3298989534378052e-01 + <_> + + 0 -1 1410 6.7604780197143555e-03 + + 4.6489939093589783e-01 6.6897618770599365e-01 + <_> + + 0 -1 1411 2.9100088868290186e-03 + + 5.3097039461135864e-01 3.3778399229049683e-01 + <_> + + 0 -1 1412 1.3885459629818797e-03 + + 4.0747389197349548e-01 5.3491330146789551e-01 + <_> + + 0 -1 1413 -7.6764263212680817e-02 + + 1.9921760261058807e-01 5.2282422780990601e-01 + <_> + + 0 -1 1414 -2.2688310127705336e-04 + + 5.4385018348693848e-01 4.2530721426010132e-01 + <_> + + 0 -1 1415 -6.3094152137637138e-03 + + 4.2591789364814758e-01 5.3789097070693970e-01 + <_> + + 0 -1 1416 -1.1007279902696609e-01 + + 6.9041568040847778e-01 4.7217491269111633e-01 + <_> + + 0 -1 1417 2.8619659133255482e-04 + + 4.5249149203300476e-01 5.5483061075210571e-01 + <_> + + 0 -1 1418 2.9425329557852820e-05 + + 5.3703737258911133e-01 4.2364639043807983e-01 + <_> + + 0 -1 1419 -2.4886570870876312e-02 + + 6.4235579967498779e-01 4.9693039059638977e-01 + <_> + + 0 -1 1420 3.3148851245641708e-02 + + 4.9884751439094543e-01 1.6138119995594025e-01 + <_> + + 0 -1 1421 7.8491691965609789e-04 + + 5.4160261154174805e-01 4.2230090498924255e-01 + <_> + + 0 -1 1422 4.7087189741432667e-03 + + 4.5763289928436279e-01 6.0275578498840332e-01 + <_> + + 0 -1 1423 2.4144479539245367e-03 + + 5.3089731931686401e-01 4.4224989414215088e-01 + <_> + + 0 -1 1424 1.9523180089890957e-03 + + 4.7056341171264648e-01 6.6633248329162598e-01 + <_> + + 0 -1 1425 1.3031980488449335e-03 + + 4.4061261415481567e-01 5.5269622802734375e-01 + <_> + + 0 -1 1426 4.4735497795045376e-03 + + 5.1290237903594971e-01 3.3014988899230957e-01 + <_> + + 0 -1 1427 -2.6652868837118149e-03 + + 3.1354710459709167e-01 5.1750361919403076e-01 + <_> + + 0 -1 1428 1.3666770246345550e-04 + + 4.1193708777427673e-01 5.3068768978118896e-01 + <_> + + 0 -1 1429 -1.7126450315117836e-02 + + 6.1778062582015991e-01 4.8365789651870728e-01 + <_> + + 0 -1 1430 -2.6601430727168918e-04 + + 3.6543309688568115e-01 5.1697367429733276e-01 + <_> + + 0 -1 1431 -2.2932380437850952e-02 + + 3.4909150004386902e-01 5.1639920473098755e-01 + <_> + + 0 -1 1432 2.3316550068557262e-03 + + 5.1662999391555786e-01 3.7093898653984070e-01 + <_> + + 0 -1 1433 1.6925660893321037e-02 + + 5.0147360563278198e-01 8.0539882183074951e-01 + <_> + + 0 -1 1434 -8.9858826249837875e-03 + + 6.4707887172698975e-01 4.6570208668708801e-01 + <_> + + 0 -1 1435 -1.1874699965119362e-02 + + 3.2463788986206055e-01 5.2587550878524780e-01 + <_> + + 0 -1 1436 1.9350569345988333e-04 + + 5.1919418573379517e-01 3.8396438956260681e-01 + <_> + + 0 -1 1437 5.8713490143418312e-03 + + 4.9181339144706726e-01 6.1870431900024414e-01 + <_> + + 0 -1 1438 -2.4838790297508240e-01 + + 1.8368029594421387e-01 4.9881500005722046e-01 + <_> + + 0 -1 1439 1.2256000190973282e-02 + + 5.2270537614822388e-01 3.6320298910140991e-01 + <_> + + 0 -1 1440 8.3990179700776935e-04 + + 4.4902500510215759e-01 5.7741481065750122e-01 + <_> + + 0 -1 1441 2.5407369248569012e-03 + + 4.8047870397567749e-01 5.8582991361618042e-01 + <_> + + 0 -1 1442 -1.4822429977357388e-02 + + 2.5210499763488770e-01 5.0235372781753540e-01 + <_> + + 0 -1 1443 -5.7973959483206272e-03 + + 5.9966957569122314e-01 4.8537150025367737e-01 + <_> + + 0 -1 1444 7.2662148158997297e-04 + + 5.1537168025970459e-01 3.6717799305915833e-01 + <_> + + 0 -1 1445 -1.7232580110430717e-02 + + 6.6217190027236938e-01 4.9946561455726624e-01 + <_> + + 0 -1 1446 7.8624086454510689e-03 + + 4.6333950757980347e-01 6.2561017274856567e-01 + <_> + + 0 -1 1447 -4.7343620099127293e-03 + + 3.6155730485916138e-01 5.2818852663040161e-01 + <_> + + 0 -1 1448 8.3048478700220585e-04 + + 4.4428890943527222e-01 5.5509579181671143e-01 + <_> + + 0 -1 1449 7.6602199114859104e-03 + + 5.1629352569580078e-01 2.6133549213409424e-01 + <_> + + 0 -1 1450 -4.1048377752304077e-03 + + 2.7896320819854736e-01 5.0190317630767822e-01 + <_> + + 0 -1 1451 4.8512578941881657e-03 + + 4.9689841270446777e-01 5.6616681814193726e-01 + <_> + + 0 -1 1452 9.9896453320980072e-04 + + 4.4456079602241516e-01 5.5518132448196411e-01 + <_> + + 0 -1 1453 -2.7023631334304810e-01 + + 2.9388209804892540e-02 5.1513141393661499e-01 + <_> + + 0 -1 1454 -1.3090680353343487e-02 + + 5.6993997097015381e-01 4.4474598765373230e-01 + <_> + + 0 -1 1455 -9.4342790544033051e-03 + + 4.3054661154747009e-01 5.4878950119018555e-01 + <_> + + 0 -1 1456 -1.5482039889320731e-03 + + 3.6803171038627625e-01 5.1280808448791504e-01 + <_> + + 0 -1 1457 5.3746132180094719e-03 + + 4.8389169573783875e-01 6.1015558242797852e-01 + <_> + + 0 -1 1458 1.5786769799888134e-03 + + 5.3252232074737549e-01 4.1185480356216431e-01 + <_> + + 0 -1 1459 3.6856050137430429e-03 + + 4.8109480738639832e-01 6.2523031234741211e-01 + <_> + + 0 -1 1460 9.3887019902467728e-03 + + 5.2002298831939697e-01 3.6294108629226685e-01 + <_> + + 0 -1 1461 1.2792630121111870e-02 + + 4.9617099761962891e-01 6.7380160093307495e-01 + <_> + + 0 -1 1462 -3.3661040943115950e-03 + + 4.0602791309356689e-01 5.2835988998413086e-01 + <_> + + 0 -1 1463 3.9771420415490866e-04 + + 4.6741139888763428e-01 5.9007751941680908e-01 + <_> + + 0 -1 1464 1.4868030557408929e-03 + + 4.5191168785095215e-01 6.0820537805557251e-01 + <_> + + 0 -1 1465 -8.8686749339103699e-02 + + 2.8078991174697876e-01 5.1809918880462646e-01 + <_> + + 0 -1 1466 -7.4296112870797515e-05 + + 5.2955842018127441e-01 4.0876251459121704e-01 + <_> + + 0 -1 1467 -1.4932939848222304e-05 + + 5.4614001512527466e-01 4.5385429263114929e-01 + <_> + + 0 -1 1468 5.9162238612771034e-03 + + 5.3291612863540649e-01 4.1921341419219971e-01 + <_> + + 0 -1 1469 1.1141640134155750e-03 + + 4.5120179653167725e-01 5.7062172889709473e-01 + <_> + + 0 -1 1470 8.9249362645205110e-05 + + 4.5778059959411621e-01 5.8976382017135620e-01 + <_> + + 0 -1 1471 2.5319510605186224e-03 + + 5.2996039390563965e-01 3.3576390147209167e-01 + <_> + + 0 -1 1472 1.2426200322806835e-02 + + 4.9590590596199036e-01 1.3466019928455353e-01 + <_> + + 0 -1 1473 2.8335750102996826e-02 + + 5.1170790195465088e-01 6.1043637106195092e-04 + <_> + + 0 -1 1474 6.6165882162749767e-03 + + 4.7363498806953430e-01 7.0116281509399414e-01 + <_> + + 0 -1 1475 8.0468766391277313e-03 + + 5.2164179086685181e-01 3.2828199863433838e-01 + <_> + + 0 -1 1476 -1.1193980462849140e-03 + + 5.8098608255386353e-01 4.5637390017509460e-01 + <_> + + 0 -1 1477 1.3277590274810791e-02 + + 5.3983622789382935e-01 4.1039010882377625e-01 + <_> + + 0 -1 1478 4.8794739996083081e-04 + + 4.2492860555648804e-01 5.4105907678604126e-01 + <_> + + 0 -1 1479 1.1243170127272606e-02 + + 5.2699637413024902e-01 3.4382158517837524e-01 + <_> + + 0 -1 1480 -8.9896668214350939e-04 + + 5.6330758333206177e-01 4.4566130638122559e-01 + <_> + + 0 -1 1481 6.6677159629762173e-03 + + 5.3128892183303833e-01 4.3626791238784790e-01 + <_> + + 0 -1 1482 2.8947299346327782e-02 + + 4.7017949819564819e-01 6.5757977962493896e-01 + <_> + + 0 -1 1483 -2.3400049656629562e-02 + + 0. 5.1373988389968872e-01 + <_> + + 0 -1 1484 -8.9117050170898438e-02 + + 2.3745279759168625e-02 4.9424308538436890e-01 + <_> + + 0 -1 1485 -1.4054600149393082e-02 + + 3.1273230910301208e-01 5.1175111532211304e-01 + <_> + + 0 -1 1486 8.1239398568868637e-03 + + 5.0090491771697998e-01 2.5200259685516357e-01 + <_> + + 0 -1 1487 -4.9964650534093380e-03 + + 6.3871437311172485e-01 4.9278119206428528e-01 + <_> + + 0 -1 1488 3.1253970228135586e-03 + + 5.1368498802185059e-01 3.6804521083831787e-01 + <_> + + 0 -1 1489 6.7669642157852650e-03 + + 5.5098438262939453e-01 4.3636319041252136e-01 + <_> + + 0 -1 1490 -2.3711440153419971e-03 + + 6.1623352766036987e-01 4.5869469642639160e-01 + <_> + + 0 -1 1491 -5.3522791713476181e-03 + + 6.1854577064514160e-01 4.9204909801483154e-01 + <_> + + 0 -1 1492 -1.5968859195709229e-02 + + 1.3826179504394531e-01 4.9832528829574585e-01 + <_> + + 0 -1 1493 4.7676060348749161e-03 + + 4.6880578994750977e-01 5.4900461435317993e-01 + <_> + + 0 -1 1494 -2.4714691098779440e-03 + + 2.3685149848461151e-01 5.0039529800415039e-01 + <_> + + 0 -1 1495 -7.1033788844943047e-04 + + 5.8563941717147827e-01 4.7215330600738525e-01 + <_> + + 0 -1 1496 -1.4117559790611267e-01 + + 8.6900062859058380e-02 4.9615910649299622e-01 + <_> + + 0 -1 1497 1.0651809722185135e-01 + + 5.1388370990753174e-01 1.7410050332546234e-01 + <_> + + 0 -1 1498 -5.2744749933481216e-02 + + 7.3536360263824463e-01 4.7728818655014038e-01 + <_> + + 0 -1 1499 -4.7431760467588902e-03 + + 3.8844060897827148e-01 5.2927017211914062e-01 + <_> + + 0 -1 1500 9.9676765967160463e-04 + + 5.2234929800033569e-01 4.0034240484237671e-01 + <_> + + 0 -1 1501 8.0284131690859795e-03 + + 4.9591061472892761e-01 7.2129642963409424e-01 + <_> + + 0 -1 1502 8.6025858763605356e-04 + + 4.4448840618133545e-01 5.5384761095046997e-01 + <_> + + 0 -1 1503 9.3191501218825579e-04 + + 5.3983712196350098e-01 4.1632440686225891e-01 + <_> + + 0 -1 1504 -2.5082060601562262e-03 + + 5.8542650938034058e-01 4.5625001192092896e-01 + <_> + + 0 -1 1505 -2.1378761157393456e-03 + + 4.6080690622329712e-01 5.2802592515945435e-01 + <_> + + 0 -1 1506 -2.1546049974858761e-03 + + 3.7911269068717957e-01 5.2559971809387207e-01 + <_> + + 0 -1 1507 -7.6214009895920753e-03 + + 5.9986090660095215e-01 4.9520739912986755e-01 + <_> + + 0 -1 1508 2.2055360022932291e-03 + + 4.4842061400413513e-01 5.5885308980941772e-01 + <_> + + 0 -1 1509 1.2586950324475765e-03 + + 5.4507470130920410e-01 4.4238409399986267e-01 + <_> + + 0 -1 1510 -5.0926720723509789e-03 + + 4.1182750463485718e-01 5.2630358934402466e-01 + <_> + + 0 -1 1511 -2.5095739401876926e-03 + + 5.7879078388214111e-01 4.9984949827194214e-01 + <_> + + 0 -1 1512 -7.7327556908130646e-02 + + 8.3978658914566040e-01 4.8111200332641602e-01 + <_> + + 0 -1 1513 -4.1485819965600967e-02 + + 2.4086110293865204e-01 5.1769930124282837e-01 + <_> + + 0 -1 1514 1.0355669655837119e-04 + + 4.3553608655929565e-01 5.4170542955398560e-01 + <_> + + 0 -1 1515 1.3255809899419546e-03 + + 5.4539710283279419e-01 4.8940950632095337e-01 + <_> + + 0 -1 1516 -8.0598732456564903e-03 + + 5.7710242271423340e-01 4.5779189467430115e-01 + <_> + + 0 -1 1517 1.9058620557188988e-02 + + 5.1698678731918335e-01 3.4004750847816467e-01 + <_> + + 0 -1 1518 -3.5057891160249710e-02 + + 2.2032439708709717e-01 5.0005030632019043e-01 + <_> + + 0 -1 1519 5.7296059094369411e-03 + + 5.0434082746505737e-01 6.5975707769393921e-01 + <_> + + 0 -1 1520 -1.1648329906165600e-02 + + 2.1862849593162537e-01 4.9966529011726379e-01 + <_> + + 0 -1 1521 1.4544479781761765e-03 + + 5.0076818466186523e-01 5.5037277936935425e-01 + <_> + + 0 -1 1522 -2.5030909455381334e-04 + + 4.1298410296440125e-01 5.2416700124740601e-01 + <_> + + 0 -1 1523 -8.2907272735610604e-04 + + 5.4128682613372803e-01 4.9744960665702820e-01 + <_> + + 0 -1 1524 1.0862209601327777e-03 + + 4.6055299043655396e-01 5.8792287111282349e-01 + <_> + + 0 -1 1525 2.0000500080641359e-04 + + 5.2788549661636353e-01 4.7052091360092163e-01 + <_> + + 0 -1 1526 2.9212920926511288e-03 + + 5.1296097040176392e-01 3.7555369734764099e-01 + <_> + + 0 -1 1527 2.5387400761246681e-02 + + 4.8226919770240784e-01 5.7907682657241821e-01 + <_> + + 0 -1 1528 -3.1968469265848398e-03 + + 5.2483952045440674e-01 3.9628401398658752e-01 + <_> + 182 + 9.0253349304199219e+01 + + <_> + + 0 -1 1529 5.8031738735735416e-03 + + 3.4989839792251587e-01 5.9619832038879395e-01 + <_> + + 0 -1 1530 -9.0003069490194321e-03 + + 6.8166369199752808e-01 4.4785520434379578e-01 + <_> + + 0 -1 1531 -1.1549659539014101e-03 + + 5.5857062339782715e-01 3.5782510042190552e-01 + <_> + + 0 -1 1532 -1.1069850297644734e-03 + + 5.3650361299514771e-01 3.0504280328750610e-01 + <_> + + 0 -1 1533 1.0308309720130637e-04 + + 3.6390951275825500e-01 5.3446358442306519e-01 + <_> + + 0 -1 1534 -5.0984839908778667e-03 + + 2.8591570258140564e-01 5.5042648315429688e-01 + <_> + + 0 -1 1535 8.2572200335562229e-04 + + 5.2365237474441528e-01 3.4760418534278870e-01 + <_> + + 0 -1 1536 9.9783325567841530e-03 + + 4.7503221035003662e-01 6.2196469306945801e-01 + <_> + + 0 -1 1537 -3.7402529269456863e-02 + + 3.3433759212493896e-01 5.2780628204345703e-01 + <_> + + 0 -1 1538 4.8548257909715176e-03 + + 5.1921808719635010e-01 3.7004441022872925e-01 + <_> + + 0 -1 1539 -1.8664470408111811e-03 + + 2.9298439621925354e-01 5.0919449329376221e-01 + <_> + + 0 -1 1540 1.6888890415430069e-02 + + 3.6868458986282349e-01 5.4312258958816528e-01 + <_> + + 0 -1 1541 -5.8372621424496174e-03 + + 3.6321839690208435e-01 5.2213358879089355e-01 + <_> + + 0 -1 1542 -1.4713739510625601e-03 + + 5.8706837892532349e-01 4.7006508708000183e-01 + <_> + + 0 -1 1543 -1.1522950371727347e-03 + + 3.1958949565887451e-01 5.1409542560577393e-01 + <_> + + 0 -1 1544 -4.2560300789773464e-03 + + 6.3018590211868286e-01 4.8149210214614868e-01 + <_> + + 0 -1 1545 -6.7378291860222816e-03 + + 1.9770480692386627e-01 5.0258082151412964e-01 + <_> + + 0 -1 1546 1.1382670141756535e-02 + + 4.9541321396827698e-01 6.8670457601547241e-01 + <_> + + 0 -1 1547 5.1794708706438541e-03 + + 5.1644277572631836e-01 3.3506479859352112e-01 + <_> + + 0 -1 1548 -1.1743789911270142e-01 + + 2.3152460157871246e-01 5.2344137430191040e-01 + <_> + + 0 -1 1549 2.8703449293971062e-02 + + 4.6642971038818359e-01 6.7225211858749390e-01 + <_> + + 0 -1 1550 4.8231030814349651e-03 + + 5.2208751440048218e-01 2.7235329151153564e-01 + <_> + + 0 -1 1551 2.6798530016094446e-03 + + 5.0792771577835083e-01 2.9069489240646362e-01 + <_> + + 0 -1 1552 8.0504082143306732e-03 + + 4.8859509825706482e-01 6.3950210809707642e-01 + <_> + + 0 -1 1553 4.8054959625005722e-03 + + 5.1972568035125732e-01 3.6566638946533203e-01 + <_> + + 0 -1 1554 -2.2420159075409174e-03 + + 6.1534678936004639e-01 4.7637018561363220e-01 + <_> + + 0 -1 1555 -1.3757710345089436e-02 + + 2.6373448967933655e-01 5.0309032201766968e-01 + <_> + + 0 -1 1556 -1.0338299721479416e-01 + + 2.2875219583511353e-01 5.1824611425399780e-01 + <_> + + 0 -1 1557 -9.4432085752487183e-03 + + 6.9533038139343262e-01 4.6949490904808044e-01 + <_> + + 0 -1 1558 8.0271181650459766e-04 + + 5.4506552219390869e-01 4.2687839269638062e-01 + <_> + + 0 -1 1559 -4.1945669800043106e-03 + + 6.0913878679275513e-01 4.5716428756713867e-01 + <_> + + 0 -1 1560 1.0942210443317890e-02 + + 5.2410632371902466e-01 3.2845470309257507e-01 + <_> + + 0 -1 1561 -5.7841069065034389e-04 + + 5.3879290819168091e-01 4.1793689131736755e-01 + <_> + + 0 -1 1562 -2.0888620056211948e-03 + + 4.2926910519599915e-01 5.3017157316207886e-01 + <_> + + 0 -1 1563 3.2383969519287348e-03 + + 3.7923479080200195e-01 5.2207440137863159e-01 + <_> + + 0 -1 1564 4.9075027927756310e-03 + + 5.2372831106185913e-01 4.1267579793930054e-01 + <_> + + 0 -1 1565 -3.2277941703796387e-02 + + 1.9476559758186340e-01 4.9945020675659180e-01 + <_> + + 0 -1 1566 -8.9711230248212814e-03 + + 6.0112851858139038e-01 4.9290320277214050e-01 + <_> + + 0 -1 1567 1.5321089886128902e-02 + + 5.0097537040710449e-01 2.0398220419883728e-01 + <_> + + 0 -1 1568 2.0855569746345282e-03 + + 4.8621898889541626e-01 5.7216948270797729e-01 + <_> + + 0 -1 1569 5.0615021027624607e-03 + + 5.0002187490463257e-01 1.8018059432506561e-01 + <_> + + 0 -1 1570 -3.7174751050770283e-03 + + 5.5301171541213989e-01 4.8975929617881775e-01 + <_> + + 0 -1 1571 -1.2170500122010708e-02 + + 4.1786059737205505e-01 5.3837239742279053e-01 + <_> + + 0 -1 1572 4.6248398721218109e-03 + + 4.9971699714660645e-01 5.7613271474838257e-01 + <_> + + 0 -1 1573 -2.1040429419372231e-04 + + 5.3318071365356445e-01 4.0976810455322266e-01 + <_> + + 0 -1 1574 -1.4641780406236649e-02 + + 5.7559251785278320e-01 5.0517761707305908e-01 + <_> + + 0 -1 1575 3.3199489116668701e-03 + + 4.5769768953323364e-01 6.0318058729171753e-01 + <_> + + 0 -1 1576 3.7236879579722881e-03 + + 4.3803969025611877e-01 5.4158830642700195e-01 + <_> + + 0 -1 1577 8.2951161311939359e-04 + + 5.1630318164825439e-01 3.7022191286087036e-01 + <_> + + 0 -1 1578 -1.1408490128815174e-02 + + 6.0729467868804932e-01 4.8625651001930237e-01 + <_> + + 0 -1 1579 -4.5320121571421623e-03 + + 3.2924759387969971e-01 5.0889629125595093e-01 + <_> + + 0 -1 1580 5.1276017911732197e-03 + + 4.8297679424285889e-01 6.1227089166641235e-01 + <_> + + 0 -1 1581 9.8583158105611801e-03 + + 4.6606799960136414e-01 6.5561771392822266e-01 + <_> + + 0 -1 1582 3.6985918879508972e-02 + + 5.2048492431640625e-01 1.6904720664024353e-01 + <_> + + 0 -1 1583 4.6491161920130253e-03 + + 5.1673221588134766e-01 3.7252250313758850e-01 + <_> + + 0 -1 1584 -4.2664702050387859e-03 + + 6.4064931869506836e-01 4.9873429536819458e-01 + <_> + + 0 -1 1585 -4.7956590424291790e-04 + + 5.8972930908203125e-01 4.4648739695549011e-01 + <_> + + 0 -1 1586 3.6827160511165857e-03 + + 5.4415607452392578e-01 3.4726628661155701e-01 + <_> + + 0 -1 1587 -1.0059880092740059e-02 + + 2.1431629359722137e-01 5.0048297643661499e-01 + <_> + + 0 -1 1588 -3.0361840617842972e-04 + + 5.3864240646362305e-01 4.5903238654136658e-01 + <_> + + 0 -1 1589 -1.4545479789376259e-03 + + 5.7511842250823975e-01 4.4970950484275818e-01 + <_> + + 0 -1 1590 1.6515209572389722e-03 + + 5.4219377040863037e-01 4.2385208606719971e-01 + <_> + + 0 -1 1591 -7.8468639403581619e-03 + + 4.0779209136962891e-01 5.2581572532653809e-01 + <_> + + 0 -1 1592 -5.1259850151836872e-03 + + 4.2292758822441101e-01 5.4794532060623169e-01 + <_> + + 0 -1 1593 -3.6890961229801178e-02 + + 6.5963757038116455e-01 4.6746781468391418e-01 + <_> + + 0 -1 1594 2.4035639944486320e-04 + + 4.2511358857154846e-01 5.5732029676437378e-01 + <_> + + 0 -1 1595 -1.5150169929256663e-05 + + 5.2592468261718750e-01 4.0741148591041565e-01 + <_> + + 0 -1 1596 2.2108471021056175e-03 + + 4.6717229485511780e-01 5.8863520622253418e-01 + <_> + + 0 -1 1597 -1.1568620102480054e-03 + + 5.7110661268234253e-01 4.4871619343757629e-01 + <_> + + 0 -1 1598 4.9996292218565941e-03 + + 5.2641981840133667e-01 2.8983271121978760e-01 + <_> + + 0 -1 1599 -1.4656189596280456e-03 + + 3.8917380571365356e-01 5.1978719234466553e-01 + <_> + + 0 -1 1600 -1.1975039960816503e-03 + + 5.7958728075027466e-01 4.9279558658599854e-01 + <_> + + 0 -1 1601 -4.4954330660402775e-03 + + 2.3776030540466309e-01 5.0125551223754883e-01 + <_> + + 0 -1 1602 1.4997160178609192e-04 + + 4.8766261339187622e-01 5.6176078319549561e-01 + <_> + + 0 -1 1603 2.6391509454697371e-03 + + 5.1680880784988403e-01 3.7655091285705566e-01 + <_> + + 0 -1 1604 -2.9368131072260439e-04 + + 5.4466491937637329e-01 4.8746308684349060e-01 + <_> + + 0 -1 1605 1.4211760135367513e-03 + + 4.6878978610038757e-01 6.6913318634033203e-01 + <_> + + 0 -1 1606 7.9427637159824371e-02 + + 5.1934438943862915e-01 2.7329459786415100e-01 + <_> + + 0 -1 1607 7.9937502741813660e-02 + + 4.9717310070991516e-01 1.7820839583873749e-01 + <_> + + 0 -1 1608 1.1089259758591652e-02 + + 5.1659947633743286e-01 3.2094758749008179e-01 + <_> + + 0 -1 1609 1.6560709627810866e-04 + + 4.0584719181060791e-01 5.3072762489318848e-01 + <_> + + 0 -1 1610 -5.3354292176663876e-03 + + 3.4450569748878479e-01 5.1581299304962158e-01 + <_> + + 0 -1 1611 1.1287260567769408e-03 + + 4.5948630571365356e-01 6.0755330324172974e-01 + <_> + + 0 -1 1612 -2.1969219669699669e-02 + + 1.6804009675979614e-01 5.2285957336425781e-01 + <_> + + 0 -1 1613 -2.1775320055894554e-04 + + 3.8615968823432922e-01 5.2156728506088257e-01 + <_> + + 0 -1 1614 2.0200149447191507e-04 + + 5.5179792642593384e-01 4.3630391359329224e-01 + <_> + + 0 -1 1615 -2.1733149886131287e-02 + + 7.9994601011276245e-01 4.7898510098457336e-01 + <_> + + 0 -1 1616 -8.4399932529777288e-04 + + 4.0859758853912354e-01 5.3747731447219849e-01 + <_> + + 0 -1 1617 -4.3895249837078154e-04 + + 5.4704052209854126e-01 4.3661430478096008e-01 + <_> + + 0 -1 1618 1.5092400135472417e-03 + + 4.9889969825744629e-01 5.8421492576599121e-01 + <_> + + 0 -1 1619 -3.5547839943319559e-03 + + 6.7536902427673340e-01 4.7210058569908142e-01 + <_> + + 0 -1 1620 4.8191400128416717e-04 + + 5.4158538579940796e-01 4.3571090698242188e-01 + <_> + + 0 -1 1621 -6.0264398343861103e-03 + + 2.2585099935531616e-01 4.9918809533119202e-01 + <_> + + 0 -1 1622 -1.1668140068650246e-02 + + 6.2565547227859497e-01 4.9274989962577820e-01 + <_> + + 0 -1 1623 -2.8718370012938976e-03 + + 3.9477849006652832e-01 5.2458018064498901e-01 + <_> + + 0 -1 1624 1.7051169648766518e-02 + + 4.7525110840797424e-01 5.7942241430282593e-01 + <_> + + 0 -1 1625 -1.3352080248296261e-02 + + 6.0411047935485840e-01 4.5445358753204346e-01 + <_> + + 0 -1 1626 -3.9301801007241011e-04 + + 4.2582759261131287e-01 5.5449050664901733e-01 + <_> + + 0 -1 1627 3.0483349692076445e-03 + + 5.2334201335906982e-01 3.7802729010581970e-01 + <_> + + 0 -1 1628 -4.3579288758337498e-03 + + 6.3718891143798828e-01 4.8386740684509277e-01 + <_> + + 0 -1 1629 5.6661018170416355e-03 + + 5.3747057914733887e-01 4.1636660695075989e-01 + <_> + + 0 -1 1630 6.0677339206449687e-05 + + 4.6387958526611328e-01 5.3116250038146973e-01 + <_> + + 0 -1 1631 3.6738160997629166e-02 + + 4.6886560320854187e-01 6.4665240049362183e-01 + <_> + + 0 -1 1632 8.6528137326240540e-03 + + 5.2043187618255615e-01 2.1886579692363739e-01 + <_> + + 0 -1 1633 -1.5371359884738922e-01 + + 1.6303719580173492e-01 4.9588400125503540e-01 + <_> + + 0 -1 1634 -4.1560421232134104e-04 + + 5.7744592428207397e-01 4.6964588761329651e-01 + <_> + + 0 -1 1635 -1.2640169588848948e-03 + + 3.9771759510040283e-01 5.2171981334686279e-01 + <_> + + 0 -1 1636 -3.5473341122269630e-03 + + 6.0465282201766968e-01 4.8083150386810303e-01 + <_> + + 0 -1 1637 3.0019069527043030e-05 + + 3.9967238903045654e-01 5.2282011508941650e-01 + <_> + + 0 -1 1638 1.3113019522279501e-03 + + 4.7121581435203552e-01 5.7659977674484253e-01 + <_> + + 0 -1 1639 -1.3374709524214268e-03 + + 4.1095849871635437e-01 5.2531701326370239e-01 + <_> + + 0 -1 1640 2.0876709371805191e-02 + + 5.2029937505722046e-01 1.7579819262027740e-01 + <_> + + 0 -1 1641 -7.5497948564589024e-03 + + 6.5666097402572632e-01 4.6949750185012817e-01 + <_> + + 0 -1 1642 2.4188550189137459e-02 + + 5.1286739110946655e-01 3.3702209591865540e-01 + <_> + + 0 -1 1643 -2.9358828905969858e-03 + + 6.5807867050170898e-01 4.6945410966873169e-01 + <_> + + 0 -1 1644 5.7557929307222366e-02 + + 5.1464450359344482e-01 2.7752599120140076e-01 + <_> + + 0 -1 1645 -1.1343370424583554e-03 + + 3.8366019725799561e-01 5.1926672458648682e-01 + <_> + + 0 -1 1646 1.6816999763250351e-02 + + 5.0855928659439087e-01 6.1772608757019043e-01 + <_> + + 0 -1 1647 5.0535178743302822e-03 + + 5.1387631893157959e-01 3.6847919225692749e-01 + <_> + + 0 -1 1648 -4.5874710194766521e-03 + + 5.9896552562713623e-01 4.8352020978927612e-01 + <_> + + 0 -1 1649 1.6882460331544280e-03 + + 4.5094868540763855e-01 5.7230567932128906e-01 + <_> + + 0 -1 1650 -1.6554000321775675e-03 + + 3.4967708587646484e-01 5.2433192729949951e-01 + <_> + + 0 -1 1651 -1.9373800605535507e-02 + + 1.1205369979143143e-01 4.9687129259109497e-01 + <_> + + 0 -1 1652 1.0374450124800205e-02 + + 5.1481968164443970e-01 4.3952131271362305e-01 + <_> + + 0 -1 1653 1.4973050565458834e-04 + + 4.0849998593330383e-01 5.2698868513107300e-01 + <_> + + 0 -1 1654 -4.2981930077075958e-02 + + 6.3941049575805664e-01 5.0185042619705200e-01 + <_> + + 0 -1 1655 8.3065936341881752e-03 + + 4.7075539827346802e-01 6.6983532905578613e-01 + <_> + + 0 -1 1656 -4.1285790503025055e-03 + + 4.5413690805435181e-01 5.3236472606658936e-01 + <_> + + 0 -1 1657 1.7399420030415058e-03 + + 4.3339619040489197e-01 5.4398661851882935e-01 + <_> + + 0 -1 1658 1.1739750334527344e-04 + + 4.5796871185302734e-01 5.5434262752532959e-01 + <_> + + 0 -1 1659 1.8585780344437808e-04 + + 4.3246439099311829e-01 5.4267549514770508e-01 + <_> + + 0 -1 1660 5.5587692186236382e-03 + + 5.2572208642959595e-01 3.5506111383438110e-01 + <_> + + 0 -1 1661 -7.9851560294628143e-03 + + 6.0430181026458740e-01 4.6306359767913818e-01 + <_> + + 0 -1 1662 6.0594122624024749e-04 + + 4.5982548594474792e-01 5.5331951379776001e-01 + <_> + + 0 -1 1663 -2.2983040253166109e-04 + + 4.1307520866394043e-01 5.3224611282348633e-01 + <_> + + 0 -1 1664 4.3740210821852088e-04 + + 4.0430399775505066e-01 5.4092890024185181e-01 + <_> + + 0 -1 1665 2.9482020181603730e-04 + + 4.4949638843536377e-01 5.6288522481918335e-01 + <_> + + 0 -1 1666 1.0312659665942192e-02 + + 5.1775109767913818e-01 2.7043169736862183e-01 + <_> + + 0 -1 1667 -7.7241109684109688e-03 + + 1.9880190491676331e-01 4.9805539846420288e-01 + <_> + + 0 -1 1668 -4.6797208487987518e-03 + + 6.6447502374649048e-01 5.0182962417602539e-01 + <_> + + 0 -1 1669 -5.0755459815263748e-03 + + 3.8983049988746643e-01 5.1852691173553467e-01 + <_> + + 0 -1 1670 2.2479740437120199e-03 + + 4.8018088936805725e-01 5.6603360176086426e-01 + <_> + + 0 -1 1671 8.3327008178457618e-04 + + 5.2109199762344360e-01 3.9571881294250488e-01 + <_> + + 0 -1 1672 -4.1279330849647522e-02 + + 6.1545419692993164e-01 5.0070542097091675e-01 + <_> + + 0 -1 1673 -5.0930189900100231e-04 + + 3.9759421348571777e-01 5.2284038066864014e-01 + <_> + + 0 -1 1674 1.2568780221045017e-03 + + 4.9791380763053894e-01 5.9391832351684570e-01 + <_> + + 0 -1 1675 8.0048497766256332e-03 + + 4.9844971299171448e-01 1.6333660483360291e-01 + <_> + + 0 -1 1676 -1.1879300000146031e-03 + + 5.9049648046493530e-01 4.9426248669624329e-01 + <_> + + 0 -1 1677 6.1948952497914433e-04 + + 4.1995579004287720e-01 5.3287261724472046e-01 + <_> + + 0 -1 1678 6.6829859279096127e-03 + + 5.4186028242111206e-01 4.9058890342712402e-01 + <_> + + 0 -1 1679 -3.7062340416014194e-03 + + 3.7259390950202942e-01 5.1380002498626709e-01 + <_> + + 0 -1 1680 -3.9739411324262619e-02 + + 6.4789611101150513e-01 5.0503468513488770e-01 + <_> + + 0 -1 1681 1.4085009461268783e-03 + + 4.6823391318321228e-01 6.3778841495513916e-01 + <_> + + 0 -1 1682 3.9322688826359808e-04 + + 5.4585301876068115e-01 4.1504821181297302e-01 + <_> + + 0 -1 1683 -1.8979819724336267e-03 + + 3.6901599168777466e-01 5.1497042179107666e-01 + <_> + + 0 -1 1684 -1.3970440253615379e-02 + + 6.0505628585815430e-01 4.8113578557968140e-01 + <_> + + 0 -1 1685 -1.0100819915533066e-01 + + 2.0170800387859344e-01 4.9923619627952576e-01 + <_> + + 0 -1 1686 -1.7346920445561409e-02 + + 5.7131487131118774e-01 4.8994860053062439e-01 + <_> + + 0 -1 1687 1.5619759506080300e-04 + + 4.2153888940811157e-01 5.3926420211791992e-01 + <_> + + 0 -1 1688 1.3438929617404938e-01 + + 5.1361519098281860e-01 3.7676128745079041e-01 + <_> + + 0 -1 1689 -2.4582240730524063e-02 + + 7.0273578166961670e-01 4.7479069232940674e-01 + <_> + + 0 -1 1690 -3.8553720805794001e-03 + + 4.3174090981483459e-01 5.4277169704437256e-01 + <_> + + 0 -1 1691 -2.3165249731391668e-03 + + 5.9426987171173096e-01 4.6186479926109314e-01 + <_> + + 0 -1 1692 -4.8518120311200619e-03 + + 6.1915689706802368e-01 4.8848950862884521e-01 + <_> + + 0 -1 1693 2.4699938949197531e-03 + + 5.2566647529602051e-01 4.0171998739242554e-01 + <_> + + 0 -1 1694 4.5496959239244461e-02 + + 5.2378678321838379e-01 2.6857739686965942e-01 + <_> + + 0 -1 1695 -2.0319599658250809e-02 + + 2.1304459869861603e-01 4.9797388911247253e-01 + <_> + + 0 -1 1696 2.6994998916052282e-04 + + 4.8140418529510498e-01 5.5431222915649414e-01 + <_> + + 0 -1 1697 -1.8232699949294329e-03 + + 6.4825797080993652e-01 4.7099891304969788e-01 + <_> + + 0 -1 1698 -6.3015790656208992e-03 + + 4.5819279551506042e-01 5.3062361478805542e-01 + <_> + + 0 -1 1699 -2.4139499873854220e-04 + + 5.2320867776870728e-01 4.0517631173133850e-01 + <_> + + 0 -1 1700 -1.0330369696021080e-03 + + 5.5562019348144531e-01 4.7891938686370850e-01 + <_> + + 0 -1 1701 1.8041160365100950e-04 + + 5.2294427156448364e-01 4.0118101239204407e-01 + <_> + + 0 -1 1702 -6.1407860368490219e-02 + + 6.2986820936203003e-01 5.0107032060623169e-01 + <_> + + 0 -1 1703 -6.9543913006782532e-02 + + 7.2282809019088745e-01 4.7731840610504150e-01 + <_> + + 0 -1 1704 -7.0542663335800171e-02 + + 2.2695130109786987e-01 5.1825290918350220e-01 + <_> + + 0 -1 1705 2.4423799477517605e-03 + + 5.2370971441268921e-01 4.0981510281562805e-01 + <_> + + 0 -1 1706 1.5494349645450711e-03 + + 4.7737509012222290e-01 5.4680430889129639e-01 + <_> + + 0 -1 1707 -2.3914219811558723e-02 + + 7.1469759941101074e-01 4.7838249802589417e-01 + <_> + + 0 -1 1708 -1.2453690171241760e-02 + + 2.6352968811988831e-01 5.2411228418350220e-01 + <_> + + 0 -1 1709 -2.0760179904755205e-04 + + 3.6237570643424988e-01 5.1136088371276855e-01 + <_> + + 0 -1 1710 2.9781080229440704e-05 + + 4.7059321403503418e-01 5.4328018426895142e-01 + <_> + 211 + 1.0474919891357422e+02 + + <_> + + 0 -1 1711 1.1772749945521355e-02 + + 3.8605189323425293e-01 6.4211672544479370e-01 + <_> + + 0 -1 1712 2.7037570253014565e-02 + + 4.3856549263000488e-01 6.7540389299392700e-01 + <_> + + 0 -1 1713 -3.6419500247575343e-05 + + 5.4871010780334473e-01 3.4233158826828003e-01 + <_> + + 0 -1 1714 1.9995409529656172e-03 + + 3.2305321097373962e-01 5.4003179073333740e-01 + <_> + + 0 -1 1715 4.5278300531208515e-03 + + 5.0916397571563721e-01 2.9350438714027405e-01 + <_> + + 0 -1 1716 4.7890920541249216e-04 + + 4.1781538724899292e-01 5.3440642356872559e-01 + <_> + + 0 -1 1717 1.1720920447260141e-03 + + 2.8991821408271790e-01 5.1320707798004150e-01 + <_> + + 0 -1 1718 9.5305702416226268e-04 + + 4.2801249027252197e-01 5.5608451366424561e-01 + <_> + + 0 -1 1719 1.5099150004971307e-05 + + 4.0448719263076782e-01 5.4047602415084839e-01 + <_> + + 0 -1 1720 -6.0817901976406574e-04 + + 4.2717689275741577e-01 5.5034661293029785e-01 + <_> + + 0 -1 1721 3.3224520739167929e-03 + + 3.9627239108085632e-01 5.3697347640991211e-01 + <_> + + 0 -1 1722 -1.1037490330636501e-03 + + 4.7271779179573059e-01 5.2377498149871826e-01 + <_> + + 0 -1 1723 -1.4350269921123981e-03 + + 5.6030082702636719e-01 4.2235091328620911e-01 + <_> + + 0 -1 1724 2.0767399109899998e-03 + + 5.2259171009063721e-01 4.7327259182929993e-01 + <_> + + 0 -1 1725 -1.6412809782195836e-04 + + 3.9990758895874023e-01 5.4327398538589478e-01 + <_> + + 0 -1 1726 8.8302437216043472e-03 + + 4.6783858537673950e-01 6.0273271799087524e-01 + <_> + + 0 -1 1727 -1.0552070103585720e-02 + + 3.4939670562744141e-01 5.2139747142791748e-01 + <_> + + 0 -1 1728 -2.2731600329279900e-03 + + 6.1858189105987549e-01 4.7490629553794861e-01 + <_> + + 0 -1 1729 -8.4786332445219159e-04 + + 5.2853411436080933e-01 3.8434821367263794e-01 + <_> + + 0 -1 1730 1.2081359745934606e-03 + + 5.3606408834457397e-01 3.4473359584808350e-01 + <_> + + 0 -1 1731 2.6512730401009321e-03 + + 4.5582920312881470e-01 6.1939620971679688e-01 + <_> + + 0 -1 1732 -1.1012479662895203e-03 + + 3.6802300810813904e-01 5.3276282548904419e-01 + <_> + + 0 -1 1733 4.9561518244445324e-04 + + 3.9605951309204102e-01 5.2749407291412354e-01 + <_> + + 0 -1 1734 -4.3901771306991577e-02 + + 7.0204448699951172e-01 4.9928390979766846e-01 + <_> + + 0 -1 1735 3.4690350294113159e-02 + + 5.0491642951965332e-01 2.7666029334068298e-01 + <_> + + 0 -1 1736 -2.7442190330475569e-03 + + 2.6726329326629639e-01 5.2749711275100708e-01 + <_> + + 0 -1 1737 3.3316588960587978e-03 + + 4.5794829726219177e-01 6.0011017322540283e-01 + <_> + + 0 -1 1738 -2.0044570788741112e-02 + + 3.1715941429138184e-01 5.2357178926467896e-01 + <_> + + 0 -1 1739 1.3492030557245016e-03 + + 5.2653628587722778e-01 4.0343248844146729e-01 + <_> + + 0 -1 1740 2.9702018946409225e-03 + + 5.3324568271636963e-01 4.5719841122627258e-01 + <_> + + 0 -1 1741 6.3039981760084629e-03 + + 4.5933109521865845e-01 6.0346359014511108e-01 + <_> + + 0 -1 1742 -1.2936590239405632e-02 + + 4.4379639625549316e-01 5.3729712963104248e-01 + <_> + + 0 -1 1743 4.0148729458451271e-03 + + 4.6803238987922668e-01 6.4378339052200317e-01 + <_> + + 0 -1 1744 -2.6401679497212172e-03 + + 3.7096318602561951e-01 5.3143328428268433e-01 + <_> + + 0 -1 1745 1.3918439857661724e-02 + + 4.7235551476478577e-01 7.1308088302612305e-01 + <_> + + 0 -1 1746 -4.5087869511917233e-04 + + 4.4923940300941467e-01 5.3704041242599487e-01 + <_> + + 0 -1 1747 2.5384349282830954e-04 + + 4.4068640470504761e-01 5.5144029855728149e-01 + <_> + + 0 -1 1748 2.2710000630468130e-03 + + 4.6824169158935547e-01 5.9679841995239258e-01 + <_> + + 0 -1 1749 2.4120779708027840e-03 + + 5.0793921947479248e-01 3.0185988545417786e-01 + <_> + + 0 -1 1750 -3.6025670851813629e-05 + + 5.6010371446609497e-01 4.4710969924926758e-01 + <_> + + 0 -1 1751 -7.4905529618263245e-03 + + 2.2075350582599640e-01 4.9899441003799438e-01 + <_> + + 0 -1 1752 -1.7513120546936989e-02 + + 6.5312159061431885e-01 5.0176489353179932e-01 + <_> + + 0 -1 1753 1.4281630516052246e-01 + + 4.9679630994796753e-01 1.4820620417594910e-01 + <_> + + 0 -1 1754 5.5345268920063972e-03 + + 4.8989468812942505e-01 5.9542238712310791e-01 + <_> + + 0 -1 1755 -9.6323591424152255e-04 + + 3.9271169900894165e-01 5.1960742473602295e-01 + <_> + + 0 -1 1756 -2.0370010752230883e-03 + + 5.6133252382278442e-01 4.8848581314086914e-01 + <_> + + 0 -1 1757 1.6614829655736685e-03 + + 4.4728800654411316e-01 5.5788809061050415e-01 + <_> + + 0 -1 1758 -3.1188090797513723e-03 + + 3.8405328989028931e-01 5.3974777460098267e-01 + <_> + + 0 -1 1759 -6.4000617712736130e-03 + + 5.8439838886260986e-01 4.5332181453704834e-01 + <_> + + 0 -1 1760 3.1319601112045348e-04 + + 5.4392218589782715e-01 4.2347279191017151e-01 + <_> + + 0 -1 1761 -1.8222099170088768e-02 + + 1.2884649634361267e-01 4.9584048986434937e-01 + <_> + + 0 -1 1762 8.7969247251749039e-03 + + 4.9512979388237000e-01 7.1534800529479980e-01 + <_> + + 0 -1 1763 -4.2395070195198059e-03 + + 3.9465999603271484e-01 5.1949369907379150e-01 + <_> + + 0 -1 1764 9.7086271271109581e-03 + + 4.8975038528442383e-01 6.0649001598358154e-01 + <_> + + 0 -1 1765 -3.9934171363711357e-03 + + 3.2454401254653931e-01 5.0608289241790771e-01 + <_> + + 0 -1 1766 -1.6785059124231339e-02 + + 1.5819530189037323e-01 5.2037787437438965e-01 + <_> + + 0 -1 1767 1.8272090703248978e-02 + + 4.6809351444244385e-01 6.6269791126251221e-01 + <_> + + 0 -1 1768 5.6872838176786900e-03 + + 5.2116978168487549e-01 3.5121849179267883e-01 + <_> + + 0 -1 1769 -1.0739039862528443e-03 + + 5.7683861255645752e-01 4.5298451185226440e-01 + <_> + + 0 -1 1770 -3.7093870341777802e-03 + + 4.5077630877494812e-01 5.3135812282562256e-01 + <_> + + 0 -1 1771 -2.1110709349159151e-04 + + 5.4608201980590820e-01 4.3333768844604492e-01 + <_> + + 0 -1 1772 1.0670139454305172e-03 + + 5.3718560934066772e-01 4.0783908963203430e-01 + <_> + + 0 -1 1773 3.5943021066486835e-03 + + 4.4712871313095093e-01 5.6438362598419189e-01 + <_> + + 0 -1 1774 -5.1776031032204628e-03 + + 4.4993931055068970e-01 5.2803301811218262e-01 + <_> + + 0 -1 1775 -2.5414369883947074e-04 + + 5.5161732435226440e-01 4.4077080488204956e-01 + <_> + + 0 -1 1776 6.3522560521960258e-03 + + 5.1941901445388794e-01 2.4652279913425446e-01 + <_> + + 0 -1 1777 -4.4205080484971404e-04 + + 3.8307058811187744e-01 5.1396822929382324e-01 + <_> + + 0 -1 1778 7.4488727841526270e-04 + + 4.8910909891128540e-01 5.9747868776321411e-01 + <_> + + 0 -1 1779 -3.5116379149258137e-03 + + 7.4136817455291748e-01 4.7687649726867676e-01 + <_> + + 0 -1 1780 -1.2540910392999649e-02 + + 3.6488190293312073e-01 5.2528268098831177e-01 + <_> + + 0 -1 1781 9.4931852072477341e-03 + + 5.1004928350448608e-01 3.6295869946479797e-01 + <_> + + 0 -1 1782 1.2961150147020817e-02 + + 5.2324420213699341e-01 4.3335610628128052e-01 + <_> + + 0 -1 1783 4.7209449112415314e-03 + + 4.6481490135192871e-01 6.3310527801513672e-01 + <_> + + 0 -1 1784 -2.3119079414755106e-03 + + 5.9303098917007446e-01 4.5310580730438232e-01 + <_> + + 0 -1 1785 -2.8262299019843340e-03 + + 3.8704779744148254e-01 5.2571010589599609e-01 + <_> + + 0 -1 1786 -1.4311339473351836e-03 + + 5.5225032567977905e-01 4.5618548989295959e-01 + <_> + + 0 -1 1787 1.9378310535103083e-03 + + 4.5462208986282349e-01 5.7369667291641235e-01 + <_> + + 0 -1 1788 2.6343559147790074e-04 + + 5.3457391262054443e-01 4.5718750357627869e-01 + <_> + + 0 -1 1789 7.8257522545754910e-04 + + 3.9678159356117249e-01 5.2201879024505615e-01 + <_> + + 0 -1 1790 -1.9550440832972527e-02 + + 2.8296428918838501e-01 5.2435082197189331e-01 + <_> + + 0 -1 1791 4.3914958951063454e-04 + + 4.5900669693946838e-01 5.8990901708602905e-01 + <_> + + 0 -1 1792 2.1452000364661217e-02 + + 5.2314108610153198e-01 2.8553789854049683e-01 + <_> + + 0 -1 1793 5.8973580598831177e-04 + + 4.3972569704055786e-01 5.5064219236373901e-01 + <_> + + 0 -1 1794 -2.6157610118389130e-02 + + 3.1350791454315186e-01 5.1891750097274780e-01 + <_> + + 0 -1 1795 -1.3959860429167747e-02 + + 3.2132729887962341e-01 5.0407177209854126e-01 + <_> + + 0 -1 1796 -6.3699018210172653e-03 + + 6.3875448703765869e-01 4.8495069146156311e-01 + <_> + + 0 -1 1797 -8.5613820701837540e-03 + + 2.7591320872306824e-01 5.0320190191268921e-01 + <_> + + 0 -1 1798 9.6622901037335396e-04 + + 4.6856409311294556e-01 5.8348792791366577e-01 + <_> + + 0 -1 1799 7.6550268568098545e-04 + + 5.1752072572708130e-01 3.8964220881462097e-01 + <_> + + 0 -1 1800 -8.1833340227603912e-03 + + 2.0691369473934174e-01 5.2081221342086792e-01 + <_> + + 0 -1 1801 -9.3976939097046852e-03 + + 6.1340910196304321e-01 4.6412229537963867e-01 + <_> + + 0 -1 1802 4.8028980381786823e-03 + + 5.4541081190109253e-01 4.3952199816703796e-01 + <_> + + 0 -1 1803 -3.5680569708347321e-03 + + 6.3444852828979492e-01 4.6810939908027649e-01 + <_> + + 0 -1 1804 4.0733120404183865e-03 + + 5.2926832437515259e-01 4.0156200528144836e-01 + <_> + + 0 -1 1805 1.2568129459396005e-03 + + 4.3929880857467651e-01 5.4528248310089111e-01 + <_> + + 0 -1 1806 -2.9065010603517294e-03 + + 5.8988320827484131e-01 4.8633798956871033e-01 + <_> + + 0 -1 1807 -2.4409340694546700e-03 + + 4.0693649649620056e-01 5.2474218606948853e-01 + <_> + + 0 -1 1808 2.4830700829625130e-02 + + 5.1827257871627808e-01 3.6825248599052429e-01 + <_> + + 0 -1 1809 -4.8854008316993713e-02 + + 1.3075779378414154e-01 4.9612811207771301e-01 + <_> + + 0 -1 1810 -1.6110379947349429e-03 + + 6.4210057258605957e-01 4.8726621270179749e-01 + <_> + + 0 -1 1811 -9.7009479999542236e-02 + + 4.7769349068403244e-02 4.9509888887405396e-01 + <_> + + 0 -1 1812 1.1209240183234215e-03 + + 4.6162670850753784e-01 5.3547459840774536e-01 + <_> + + 0 -1 1813 -1.3064090162515640e-03 + + 6.2618541717529297e-01 4.6388059854507446e-01 + <_> + + 0 -1 1814 4.5771620352752507e-04 + + 5.3844177722930908e-01 4.6466401219367981e-01 + <_> + + 0 -1 1815 -6.3149951165542006e-04 + + 3.8040471076965332e-01 5.1302570104598999e-01 + <_> + + 0 -1 1816 1.4505970466416329e-04 + + 4.5543101429939270e-01 5.6644618511199951e-01 + <_> + + 0 -1 1817 -1.6474550589919090e-02 + + 6.5969580411911011e-01 4.7158598899841309e-01 + <_> + + 0 -1 1818 1.3369579799473286e-02 + + 5.1954662799835205e-01 3.0359649658203125e-01 + <_> + + 0 -1 1819 1.0271780047332868e-04 + + 5.2291762828826904e-01 4.1070660948753357e-01 + <_> + + 0 -1 1820 -5.5311559699475765e-03 + + 6.3528877496719360e-01 4.9609071016311646e-01 + <_> + + 0 -1 1821 -2.6187049224972725e-03 + + 3.8245460391044617e-01 5.1409840583801270e-01 + <_> + + 0 -1 1822 5.0834268331527710e-03 + + 4.9504399299621582e-01 6.2208187580108643e-01 + <_> + + 0 -1 1823 7.9818159341812134e-02 + + 4.9523359537124634e-01 1.3224759697914124e-01 + <_> + + 0 -1 1824 -9.9226586520671844e-02 + + 7.5427287817001343e-01 5.0084167718887329e-01 + <_> + + 0 -1 1825 -6.5174017800018191e-04 + + 3.6993029713630676e-01 5.1301211118698120e-01 + <_> + + 0 -1 1826 -1.8996849656105042e-02 + + 6.6891789436340332e-01 4.9212029576301575e-01 + <_> + + 0 -1 1827 1.7346899956464767e-02 + + 4.9833008646965027e-01 1.8591980636119843e-01 + <_> + + 0 -1 1828 5.5082101607695222e-04 + + 4.5744240283966064e-01 5.5221217870712280e-01 + <_> + + 0 -1 1829 2.0056050270795822e-03 + + 5.1317447423934937e-01 3.8564699888229370e-01 + <_> + + 0 -1 1830 -7.7688191086053848e-03 + + 4.3617001175880432e-01 5.4343092441558838e-01 + <_> + + 0 -1 1831 5.0878278911113739e-02 + + 4.6827208995819092e-01 6.8406397104263306e-01 + <_> + + 0 -1 1832 -2.2901780903339386e-03 + + 4.3292450904846191e-01 5.3060990571975708e-01 + <_> + + 0 -1 1833 -1.5715380141045898e-04 + + 5.3700572252273560e-01 4.3781641125679016e-01 + <_> + + 0 -1 1834 1.0519240051507950e-01 + + 5.1372742652893066e-01 6.7361466586589813e-02 + <_> + + 0 -1 1835 2.7198919560760260e-03 + + 4.1120609641075134e-01 5.2556651830673218e-01 + <_> + + 0 -1 1836 4.8337779939174652e-02 + + 5.4046237468719482e-01 4.4389671087265015e-01 + <_> + + 0 -1 1837 9.5703761326149106e-04 + + 4.3559691309928894e-01 5.3995108604431152e-01 + <_> + + 0 -1 1838 -2.5371259078383446e-02 + + 5.9951752424240112e-01 5.0310248136520386e-01 + <_> + + 0 -1 1839 5.2457951009273529e-02 + + 4.9502879381179810e-01 1.3983510434627533e-01 + <_> + + 0 -1 1840 -1.2365629896521568e-02 + + 6.3972991704940796e-01 4.9641060829162598e-01 + <_> + + 0 -1 1841 -1.4589719474315643e-01 + + 1.0016699880361557e-01 4.9463221430778503e-01 + <_> + + 0 -1 1842 -1.5908600762486458e-02 + + 3.3123299479484558e-01 5.2083408832550049e-01 + <_> + + 0 -1 1843 3.9486068999394774e-04 + + 4.4063639640808105e-01 5.4261028766632080e-01 + <_> + + 0 -1 1844 -5.2454001270234585e-03 + + 2.7995899319648743e-01 5.1899671554565430e-01 + <_> + + 0 -1 1845 -5.0421799533069134e-03 + + 6.9875800609588623e-01 4.7521421313285828e-01 + <_> + + 0 -1 1846 2.9812189750373363e-03 + + 4.9832889437675476e-01 6.3074797391891479e-01 + <_> + + 0 -1 1847 -7.2884308174252510e-03 + + 2.9823330044746399e-01 5.0268697738647461e-01 + <_> + + 0 -1 1848 1.5094350092113018e-03 + + 5.3084421157836914e-01 3.8329708576202393e-01 + <_> + + 0 -1 1849 -9.3340799212455750e-03 + + 2.0379640161991119e-01 4.9698171019554138e-01 + <_> + + 0 -1 1850 2.8667140752077103e-02 + + 5.0256967544555664e-01 6.9280272722244263e-01 + <_> + + 0 -1 1851 1.7019680142402649e-01 + + 4.9600529670715332e-01 1.4764429628849030e-01 + <_> + + 0 -1 1852 -3.2614478841423988e-03 + + 5.6030637025833130e-01 4.8260560631752014e-01 + <_> + + 0 -1 1853 5.5769277969375253e-04 + + 5.2055621147155762e-01 4.1296330094337463e-01 + <_> + + 0 -1 1854 3.6258339881896973e-01 + + 5.2216529846191406e-01 3.7686121463775635e-01 + <_> + + 0 -1 1855 -1.1615130119025707e-02 + + 6.0226827859878540e-01 4.6374899148941040e-01 + <_> + + 0 -1 1856 -4.0795197710394859e-03 + + 4.0704470872879028e-01 5.3374791145324707e-01 + <_> + + 0 -1 1857 5.7204300537705421e-04 + + 4.6018350124359131e-01 5.9003931283950806e-01 + <_> + + 0 -1 1858 6.7543348995968699e-04 + + 5.3982520103454590e-01 4.3454289436340332e-01 + <_> + + 0 -1 1859 6.3295697327703238e-04 + + 5.2015632390975952e-01 4.0513589978218079e-01 + <_> + + 0 -1 1860 1.2435320531949401e-03 + + 4.6423879265785217e-01 5.5474412441253662e-01 + <_> + + 0 -1 1861 -4.7363857738673687e-03 + + 6.1985671520233154e-01 4.6725520491600037e-01 + <_> + + 0 -1 1862 -6.4658462069928646e-03 + + 6.8373328447341919e-01 5.0190007686614990e-01 + <_> + + 0 -1 1863 3.5017321351915598e-04 + + 4.3448030948638916e-01 5.3636229038238525e-01 + <_> + + 0 -1 1864 1.5754920605104417e-04 + + 4.7600790858268738e-01 5.7320207357406616e-01 + <_> + + 0 -1 1865 9.9774366244673729e-03 + + 5.0909858942031860e-01 3.6350399255752563e-01 + <_> + + 0 -1 1866 -4.1464529931545258e-04 + + 5.5700647830963135e-01 4.5938020944595337e-01 + <_> + + 0 -1 1867 -3.5888899583369493e-04 + + 5.3568458557128906e-01 4.3391349911689758e-01 + <_> + + 0 -1 1868 4.0463250479660928e-04 + + 4.4398030638694763e-01 5.4367768764495850e-01 + <_> + + 0 -1 1869 -8.2184787606820464e-04 + + 4.0422949194908142e-01 5.1762992143630981e-01 + <_> + + 0 -1 1870 5.9467419050633907e-03 + + 4.9276518821716309e-01 5.6337797641754150e-01 + <_> + + 0 -1 1871 -2.1753389388322830e-02 + + 8.0062937736511230e-01 4.8008409142494202e-01 + <_> + + 0 -1 1872 -1.4540379866957664e-02 + + 3.9460548758506775e-01 5.1822227239608765e-01 + <_> + + 0 -1 1873 -4.0510769933462143e-02 + + 2.1324990317225456e-02 4.9357929825782776e-01 + <_> + + 0 -1 1874 -5.8458268176764250e-04 + + 4.0127959847450256e-01 5.3140252828598022e-01 + <_> + + 0 -1 1875 5.5151800625026226e-03 + + 4.6424189209938049e-01 5.8962607383728027e-01 + <_> + + 0 -1 1876 -6.0626221820712090e-03 + + 6.5021592378616333e-01 5.0164777040481567e-01 + <_> + + 0 -1 1877 9.4535842537879944e-02 + + 5.2647089958190918e-01 4.1268271207809448e-01 + <_> + + 0 -1 1878 4.7315051779150963e-03 + + 4.8791998624801636e-01 5.8924478292465210e-01 + <_> + + 0 -1 1879 -5.2571471314877272e-04 + + 3.9172801375389099e-01 5.1894128322601318e-01 + <_> + + 0 -1 1880 -2.5464049540460110e-03 + + 5.8375990390777588e-01 4.9857059121131897e-01 + <_> + + 0 -1 1881 -2.6075689122080803e-02 + + 1.2619839608669281e-01 4.9558219313621521e-01 + <_> + + 0 -1 1882 -5.4779709316790104e-03 + + 5.7225137948989868e-01 5.0102657079696655e-01 + <_> + + 0 -1 1883 5.1337741315364838e-03 + + 5.2732622623443604e-01 4.2263761162757874e-01 + <_> + + 0 -1 1884 4.7944980906322598e-04 + + 4.4500669836997986e-01 5.8195871114730835e-01 + <_> + + 0 -1 1885 -2.1114079281687737e-03 + + 5.7576531171798706e-01 4.5117148756980896e-01 + <_> + + 0 -1 1886 -1.3179990462958813e-02 + + 1.8843810260295868e-01 5.1607340574264526e-01 + <_> + + 0 -1 1887 -4.7968099825084209e-03 + + 6.5897899866104126e-01 4.7361189126968384e-01 + <_> + + 0 -1 1888 6.7483168095350266e-03 + + 5.2594298124313354e-01 3.3563950657844543e-01 + <_> + + 0 -1 1889 1.4623369788751006e-03 + + 5.3552711009979248e-01 4.2640921473503113e-01 + <_> + + 0 -1 1890 4.7645159065723419e-03 + + 5.0344067811965942e-01 5.7868278026580811e-01 + <_> + + 0 -1 1891 6.8066660314798355e-03 + + 4.7566050291061401e-01 6.6778290271759033e-01 + <_> + + 0 -1 1892 3.6608621012419462e-03 + + 5.3696119785308838e-01 4.3115469813346863e-01 + <_> + + 0 -1 1893 2.1449640393257141e-02 + + 4.9686419963836670e-01 1.8888160586357117e-01 + <_> + + 0 -1 1894 4.1678901761770248e-03 + + 4.9307331442832947e-01 5.8153688907623291e-01 + <_> + + 0 -1 1895 8.6467564105987549e-03 + + 5.2052050828933716e-01 4.1325950622558594e-01 + <_> + + 0 -1 1896 -3.6114078829996288e-04 + + 5.4835551977157593e-01 4.8009279370307922e-01 + <_> + + 0 -1 1897 1.0808729566633701e-03 + + 4.6899020671844482e-01 6.0414212942123413e-01 + <_> + + 0 -1 1898 5.7719959877431393e-03 + + 5.1711422204971313e-01 3.0532771348953247e-01 + <_> + + 0 -1 1899 1.5720770461484790e-03 + + 5.2199780941009521e-01 4.1788038611412048e-01 + <_> + + 0 -1 1900 -1.9307859474793077e-03 + + 5.8603698015213013e-01 4.8129200935363770e-01 + <_> + + 0 -1 1901 -7.8926272690296173e-03 + + 1.7492769658565521e-01 4.9717339873313904e-01 + <_> + + 0 -1 1902 -2.2224679123610258e-03 + + 4.3425890803337097e-01 5.2128481864929199e-01 + <_> + + 0 -1 1903 1.9011989934369922e-03 + + 4.7651869058609009e-01 6.8920552730560303e-01 + <_> + + 0 -1 1904 2.7576119173318148e-03 + + 5.2621912956237793e-01 4.3374860286712646e-01 + <_> + + 0 -1 1905 5.1787449046969414e-03 + + 4.8040691018104553e-01 7.8437292575836182e-01 + <_> + + 0 -1 1906 -9.0273341629654169e-04 + + 4.1208469867706299e-01 5.3534239530563354e-01 + <_> + + 0 -1 1907 5.1797959022223949e-03 + + 4.7403728961944580e-01 6.4259600639343262e-01 + <_> + + 0 -1 1908 -1.0114000178873539e-02 + + 2.4687920510768890e-01 5.1750177145004272e-01 + <_> + + 0 -1 1909 -1.8617060035467148e-02 + + 5.7562941312789917e-01 4.6289789676666260e-01 + <_> + + 0 -1 1910 5.9225959703326225e-03 + + 5.1696258783340454e-01 3.2142710685729980e-01 + <_> + + 0 -1 1911 -6.2945079989731312e-03 + + 3.8720148801803589e-01 5.1416367292404175e-01 + <_> + + 0 -1 1912 6.5353019163012505e-03 + + 4.8530489206314087e-01 6.3104897737503052e-01 + <_> + + 0 -1 1913 1.0878399480134249e-03 + + 5.1173150539398193e-01 3.7232589721679688e-01 + <_> + + 0 -1 1914 -2.2542240098118782e-02 + + 5.6927400827407837e-01 4.8871129751205444e-01 + <_> + + 0 -1 1915 -3.0065660830587149e-03 + + 2.5560128688812256e-01 5.0039929151535034e-01 + <_> + + 0 -1 1916 7.4741272255778313e-03 + + 4.8108729720115662e-01 5.6759268045425415e-01 + <_> + + 0 -1 1917 2.6162320747971535e-02 + + 4.9711948633193970e-01 1.7772370576858521e-01 + <_> + + 0 -1 1918 9.4352738233283162e-04 + + 4.9400109052658081e-01 5.4912507534027100e-01 + <_> + + 0 -1 1919 3.3363241702318192e-02 + + 5.0076121091842651e-01 2.7907240390777588e-01 + <_> + + 0 -1 1920 -1.5118650160729885e-02 + + 7.0595788955688477e-01 4.9730318784713745e-01 + <_> + + 0 -1 1921 9.8648946732282639e-04 + + 5.1286202669143677e-01 3.7767618894577026e-01 + <_> + 213 + 1.0576110076904297e+02 + + <_> + + 0 -1 1922 -9.5150798559188843e-02 + + 6.4707571268081665e-01 4.0172868967056274e-01 + <_> + + 0 -1 1923 6.2702340073883533e-03 + + 3.9998221397399902e-01 5.7464492321014404e-01 + <_> + + 0 -1 1924 3.0018089455552399e-04 + + 3.5587701201438904e-01 5.5388098955154419e-01 + <_> + + 0 -1 1925 1.1757409665733576e-03 + + 4.2565348744392395e-01 5.3826177120208740e-01 + <_> + + 0 -1 1926 4.4235268433112651e-05 + + 3.6829081177711487e-01 5.5899268388748169e-01 + <_> + + 0 -1 1927 -2.9936920327600092e-05 + + 5.4524701833724976e-01 4.0203678607940674e-01 + <_> + + 0 -1 1928 3.0073199886828661e-03 + + 5.2390581369400024e-01 3.3178439736366272e-01 + <_> + + 0 -1 1929 -1.0513889603316784e-02 + + 4.3206891417503357e-01 5.3079837560653687e-01 + <_> + + 0 -1 1930 8.3476826548576355e-03 + + 4.5046371221542358e-01 6.4532989263534546e-01 + <_> + + 0 -1 1931 -3.1492270063608885e-03 + + 4.3134251236915588e-01 5.3705251216888428e-01 + <_> + + 0 -1 1932 -1.4435649973165710e-05 + + 5.3266030550003052e-01 3.8179719448089600e-01 + <_> + + 0 -1 1933 -4.2855090578086674e-04 + + 4.3051639199256897e-01 5.3820097446441650e-01 + <_> + + 0 -1 1934 1.5062429883982986e-04 + + 4.2359709739685059e-01 5.5449652671813965e-01 + <_> + + 0 -1 1935 7.1559831500053406e-02 + + 5.3030598163604736e-01 2.6788029074668884e-01 + <_> + + 0 -1 1936 8.4095180500298738e-04 + + 3.5571089386940002e-01 5.2054339647293091e-01 + <_> + + 0 -1 1937 6.2986500561237335e-02 + + 5.2253627777099609e-01 2.8613761067390442e-01 + <_> + + 0 -1 1938 -3.3798629883676767e-03 + + 3.6241859197616577e-01 5.2016979455947876e-01 + <_> + + 0 -1 1939 -1.1810739670181647e-04 + + 5.4744768142700195e-01 3.9598938822746277e-01 + <_> + + 0 -1 1940 -5.4505601292476058e-04 + + 3.7404221296310425e-01 5.2157157659530640e-01 + <_> + + 0 -1 1941 -1.8454910023137927e-03 + + 5.8930522203445435e-01 4.5844489336013794e-01 + <_> + + 0 -1 1942 -4.3832371011376381e-04 + + 4.0845820307731628e-01 5.3853511810302734e-01 + <_> + + 0 -1 1943 -2.4000830017030239e-03 + + 3.7774550914764404e-01 5.2935802936553955e-01 + <_> + + 0 -1 1944 -9.8795741796493530e-02 + + 2.9636120796203613e-01 5.0700891017913818e-01 + <_> + + 0 -1 1945 3.1798239797353745e-03 + + 4.8776328563690186e-01 6.7264437675476074e-01 + <_> + + 0 -1 1946 3.2406419632025063e-04 + + 4.3669110536575317e-01 5.5611097812652588e-01 + <_> + + 0 -1 1947 -3.2547250390052795e-02 + + 3.1281578540802002e-01 5.3086161613464355e-01 + <_> + + 0 -1 1948 -7.7561130747199059e-03 + + 6.5602248907089233e-01 4.6398720145225525e-01 + <_> + + 0 -1 1949 1.6027249395847321e-02 + + 5.1726800203323364e-01 3.1418979167938232e-01 + <_> + + 0 -1 1950 7.1002350523485802e-06 + + 4.0844461321830750e-01 5.3362947702407837e-01 + <_> + + 0 -1 1951 7.3422808200120926e-03 + + 4.9669221043586731e-01 6.6034650802612305e-01 + <_> + + 0 -1 1952 -1.6970280557870865e-03 + + 5.9082370996475220e-01 4.5001828670501709e-01 + <_> + + 0 -1 1953 2.4118260480463505e-03 + + 5.3151607513427734e-01 3.5997208952903748e-01 + <_> + + 0 -1 1954 -5.5300937965512276e-03 + + 2.3340409994125366e-01 4.9968141317367554e-01 + <_> + + 0 -1 1955 -2.6478730142116547e-03 + + 5.8809357881546021e-01 4.6847340464591980e-01 + <_> + + 0 -1 1956 1.1295629665255547e-02 + + 4.9837771058082581e-01 1.8845909833908081e-01 + <_> + + 0 -1 1957 -6.6952878842130303e-04 + + 5.8721381425857544e-01 4.7990199923515320e-01 + <_> + + 0 -1 1958 1.4410680159926414e-03 + + 5.1311892271041870e-01 3.5010111331939697e-01 + <_> + + 0 -1 1959 2.4637870956212282e-03 + + 5.3393721580505371e-01 4.1176390647888184e-01 + <_> + + 0 -1 1960 3.3114518737420440e-04 + + 4.3133831024169922e-01 5.3982460498809814e-01 + <_> + + 0 -1 1961 -3.3557269722223282e-02 + + 2.6753368973731995e-01 5.1791548728942871e-01 + <_> + + 0 -1 1962 1.8539419397711754e-02 + + 4.9738699197769165e-01 2.3171770572662354e-01 + <_> + + 0 -1 1963 -2.9698139405809343e-04 + + 5.5297082662582397e-01 4.6436640620231628e-01 + <_> + + 0 -1 1964 -4.5577259152196348e-04 + + 5.6295841932296753e-01 4.4691911339759827e-01 + <_> + + 0 -1 1965 -1.0158980265259743e-02 + + 6.7062127590179443e-01 4.9259188771247864e-01 + <_> + + 0 -1 1966 -2.2413829356082715e-05 + + 5.2394217252731323e-01 3.9129018783569336e-01 + <_> + + 0 -1 1967 7.2034963523037732e-05 + + 4.7994381189346313e-01 5.5017888545989990e-01 + <_> + + 0 -1 1968 -6.9267209619283676e-03 + + 6.9300097227096558e-01 4.6980848908424377e-01 + <_> + + 0 -1 1969 -7.6997838914394379e-03 + + 4.0996238589286804e-01 5.4808831214904785e-01 + <_> + + 0 -1 1970 -7.3130549862980843e-03 + + 3.2834759354591370e-01 5.0578862428665161e-01 + <_> + + 0 -1 1971 1.9650589674711227e-03 + + 4.9780470132827759e-01 6.3982498645782471e-01 + <_> + + 0 -1 1972 7.1647600270807743e-03 + + 4.6611601114273071e-01 6.2221372127532959e-01 + <_> + + 0 -1 1973 -2.4078639224171638e-02 + + 2.3346449434757233e-01 5.2221620082855225e-01 + <_> + + 0 -1 1974 -2.1027969196438789e-02 + + 1.1836539953947067e-01 4.9382260441780090e-01 + <_> + + 0 -1 1975 3.6017020465806127e-04 + + 5.3250199556350708e-01 4.1167110204696655e-01 + <_> + + 0 -1 1976 -1.7219729721546173e-02 + + 6.2787622213363647e-01 4.6642690896987915e-01 + <_> + + 0 -1 1977 -7.8672142699360847e-03 + + 3.4034150838851929e-01 5.2497369050979614e-01 + <_> + + 0 -1 1978 -4.4777389848604798e-04 + + 3.6104118824005127e-01 5.0862592458724976e-01 + <_> + + 0 -1 1979 5.5486010387539864e-03 + + 4.8842659592628479e-01 6.2034982442855835e-01 + <_> + + 0 -1 1980 -6.9461148232221603e-03 + + 2.6259300112724304e-01 5.0110971927642822e-01 + <_> + + 0 -1 1981 1.3569870498031378e-04 + + 4.3407949805259705e-01 5.6283122301101685e-01 + <_> + + 0 -1 1982 -4.5880250632762909e-02 + + 6.5079987049102783e-01 4.6962749958038330e-01 + <_> + + 0 -1 1983 -2.1582560613751411e-02 + + 3.8265028595924377e-01 5.2876168489456177e-01 + <_> + + 0 -1 1984 -2.0209539681673050e-02 + + 3.2333680987358093e-01 5.0744771957397461e-01 + <_> + + 0 -1 1985 5.8496710844337940e-03 + + 5.1776039600372314e-01 4.4896709918975830e-01 + <_> + + 0 -1 1986 -5.7476379879517481e-05 + + 4.0208509564399719e-01 5.2463638782501221e-01 + <_> + + 0 -1 1987 -1.1513100471347570e-03 + + 6.3150721788406372e-01 4.9051541090011597e-01 + <_> + + 0 -1 1988 1.9862831104546785e-03 + + 4.7024598717689514e-01 6.4971512556076050e-01 + <_> + + 0 -1 1989 -5.2719512023031712e-03 + + 3.6503839492797852e-01 5.2276527881622314e-01 + <_> + + 0 -1 1990 1.2662699446082115e-03 + + 5.1661008596420288e-01 3.8776180148124695e-01 + <_> + + 0 -1 1991 -6.2919440679252148e-03 + + 7.3758941888809204e-01 5.0238478183746338e-01 + <_> + + 0 -1 1992 6.7360111279413104e-04 + + 4.4232261180877686e-01 5.4955857992172241e-01 + <_> + + 0 -1 1993 -1.0523450328037143e-03 + + 5.9763962030410767e-01 4.8595830798149109e-01 + <_> + + 0 -1 1994 -4.4216238893568516e-04 + + 5.9559392929077148e-01 4.3989309668540955e-01 + <_> + + 0 -1 1995 1.1747940443456173e-03 + + 5.3498882055282593e-01 4.6050581336021423e-01 + <_> + + 0 -1 1996 5.2457437850534916e-03 + + 5.0491911172866821e-01 2.9415771365165710e-01 + <_> + + 0 -1 1997 -2.4539720267057419e-02 + + 2.5501778721809387e-01 5.2185869216918945e-01 + <_> + + 0 -1 1998 7.3793041519820690e-04 + + 4.4248610734939575e-01 5.4908162355422974e-01 + <_> + + 0 -1 1999 1.4233799884095788e-03 + + 5.3195142745971680e-01 4.0813559293746948e-01 + <_> + + 0 -1 2000 -2.4149110540747643e-03 + + 4.0876591205596924e-01 5.2389502525329590e-01 + <_> + + 0 -1 2001 -1.2165299849584699e-03 + + 5.6745791435241699e-01 4.9080529808998108e-01 + <_> + + 0 -1 2002 -1.2438809499144554e-03 + + 4.1294258832931519e-01 5.2561181783676147e-01 + <_> + + 0 -1 2003 6.1942739412188530e-03 + + 5.0601941347122192e-01 7.3136532306671143e-01 + <_> + + 0 -1 2004 -1.6607169527560472e-03 + + 5.9796321392059326e-01 4.5963698625564575e-01 + <_> + + 0 -1 2005 -2.7316259220242500e-02 + + 4.1743651032447815e-01 5.3088420629501343e-01 + <_> + + 0 -1 2006 -1.5845570014789701e-03 + + 5.6158047914505005e-01 4.5194861292839050e-01 + <_> + + 0 -1 2007 -1.5514739789068699e-03 + + 4.0761870145797729e-01 5.3607851266860962e-01 + <_> + + 0 -1 2008 3.8446558755822480e-04 + + 4.3472939729690552e-01 5.4304420948028564e-01 + <_> + + 0 -1 2009 -1.4672259800136089e-02 + + 1.6593049466609955e-01 5.1460939645767212e-01 + <_> + + 0 -1 2010 8.1608882173895836e-03 + + 4.9618190526962280e-01 1.8847459554672241e-01 + <_> + + 0 -1 2011 1.1121659772470593e-03 + + 4.8682639002799988e-01 6.0938161611557007e-01 + <_> + + 0 -1 2012 -7.2603770531713963e-03 + + 6.2843251228332520e-01 4.6903759241104126e-01 + <_> + + 0 -1 2013 -2.4046430189628154e-04 + + 5.5750000476837158e-01 4.0460440516471863e-01 + <_> + + 0 -1 2014 -2.3348190006799996e-04 + + 4.1157621145248413e-01 5.2528482675552368e-01 + <_> + + 0 -1 2015 5.5736480280756950e-03 + + 4.7300729155540466e-01 5.6901007890701294e-01 + <_> + + 0 -1 2016 3.0623769387602806e-02 + + 4.9718868732452393e-01 1.7400950193405151e-01 + <_> + + 0 -1 2017 9.2074798885732889e-04 + + 5.3721177577972412e-01 4.3548721075057983e-01 + <_> + + 0 -1 2018 -4.3550739064812660e-05 + + 5.3668838739395142e-01 4.3473169207572937e-01 + <_> + + 0 -1 2019 -6.6452710889279842e-03 + + 3.4355181455612183e-01 5.1605331897735596e-01 + <_> + + 0 -1 2020 4.3221998959779739e-02 + + 4.7667920589447021e-01 7.2936528921127319e-01 + <_> + + 0 -1 2021 2.2331769578158855e-03 + + 5.0293159484863281e-01 5.6331712007522583e-01 + <_> + + 0 -1 2022 3.1829739455133677e-03 + + 4.0160921216011047e-01 5.1921367645263672e-01 + <_> + + 0 -1 2023 -1.8027749320026487e-04 + + 4.0883159637451172e-01 5.4179197549819946e-01 + <_> + + 0 -1 2024 -5.2934689447283745e-03 + + 4.0756770968437195e-01 5.2435618638992310e-01 + <_> + + 0 -1 2025 1.2750959722325206e-03 + + 4.9132829904556274e-01 6.3870108127593994e-01 + <_> + + 0 -1 2026 4.3385322205722332e-03 + + 5.0316721200942993e-01 2.9473468661308289e-01 + <_> + + 0 -1 2027 8.5250744596123695e-03 + + 4.9497890472412109e-01 6.3088691234588623e-01 + <_> + + 0 -1 2028 -9.4266352243721485e-04 + + 5.3283667564392090e-01 4.2856499552726746e-01 + <_> + + 0 -1 2029 1.3609660090878606e-03 + + 4.9915251135826111e-01 5.9415012598037720e-01 + <_> + + 0 -1 2030 4.4782509212382138e-04 + + 4.5735040307044983e-01 5.8544808626174927e-01 + <_> + + 0 -1 2031 1.3360050506889820e-03 + + 4.6043589711189270e-01 5.8490520715713501e-01 + <_> + + 0 -1 2032 -6.0967548051849008e-04 + + 3.9693889021873474e-01 5.2294230461120605e-01 + <_> + + 0 -1 2033 -2.3656780831515789e-03 + + 5.8083200454711914e-01 4.8983570933341980e-01 + <_> + + 0 -1 2034 1.0734340175986290e-03 + + 4.3512108922004700e-01 5.4700392484664917e-01 + <_> + + 0 -1 2035 2.1923359017819166e-03 + + 5.3550601005554199e-01 3.8429039716720581e-01 + <_> + + 0 -1 2036 5.4968618787825108e-03 + + 5.0181388854980469e-01 2.8271919488906860e-01 + <_> + + 0 -1 2037 -7.5368821620941162e-02 + + 1.2250760197639465e-01 5.1488268375396729e-01 + <_> + + 0 -1 2038 2.5134470313787460e-02 + + 4.7317668795585632e-01 7.0254462957382202e-01 + <_> + + 0 -1 2039 -2.9358599931583740e-05 + + 5.4305320978164673e-01 4.6560868620872498e-01 + <_> + + 0 -1 2040 -5.8355910005047917e-04 + + 4.0310400724411011e-01 5.1901197433471680e-01 + <_> + + 0 -1 2041 -2.6639450807124376e-03 + + 4.3081268668174744e-01 5.1617711782455444e-01 + <_> + + 0 -1 2042 -1.3804089976474643e-03 + + 6.2198299169540405e-01 4.6955159306526184e-01 + <_> + + 0 -1 2043 1.2313219485804439e-03 + + 5.3793638944625854e-01 4.4258311390876770e-01 + <_> + + 0 -1 2044 -1.4644179827882908e-05 + + 5.2816402912139893e-01 4.2225030064582825e-01 + <_> + + 0 -1 2045 -1.2818809598684311e-02 + + 2.5820928812026978e-01 5.1799327135086060e-01 + <_> + + 0 -1 2046 2.2852189838886261e-02 + + 4.7786930203437805e-01 7.6092642545700073e-01 + <_> + + 0 -1 2047 8.2305970136076212e-04 + + 5.3409922122955322e-01 4.6717241406440735e-01 + <_> + + 0 -1 2048 1.2770120054483414e-02 + + 4.9657610058784485e-01 1.4723660051822662e-01 + <_> + + 0 -1 2049 -5.0051510334014893e-02 + + 6.4149940013885498e-01 5.0165921449661255e-01 + <_> + + 0 -1 2050 1.5775270760059357e-02 + + 4.5223200321197510e-01 5.6853622198104858e-01 + <_> + + 0 -1 2051 -1.8501620739698410e-02 + + 2.7647489309310913e-01 5.1379591226577759e-01 + <_> + + 0 -1 2052 2.4626250378787518e-03 + + 5.1419419050216675e-01 3.7954080104827881e-01 + <_> + + 0 -1 2053 6.2916167080402374e-02 + + 5.0606489181518555e-01 6.5804338455200195e-01 + <_> + + 0 -1 2054 -2.1648500478477217e-05 + + 5.1953881978988647e-01 4.0198868513107300e-01 + <_> + + 0 -1 2055 2.1180990152060986e-03 + + 4.9623650312423706e-01 5.9544587135314941e-01 + <_> + + 0 -1 2056 -1.6634890809655190e-02 + + 3.7579330801963806e-01 5.1754468679428101e-01 + <_> + + 0 -1 2057 -2.8899470344185829e-03 + + 6.6240137815475464e-01 5.0571787357330322e-01 + <_> + + 0 -1 2058 7.6783262193202972e-02 + + 4.7957968711853027e-01 8.0477148294448853e-01 + <_> + + 0 -1 2059 3.9170677773654461e-03 + + 4.9378821253776550e-01 5.7199418544769287e-01 + <_> + + 0 -1 2060 -7.2670601308345795e-02 + + 5.3894560784101486e-02 4.9439039826393127e-01 + <_> + + 0 -1 2061 5.4039502143859863e-01 + + 5.1297742128372192e-01 1.1433389782905579e-01 + <_> + + 0 -1 2062 2.9510019812732935e-03 + + 4.5283439755439758e-01 5.6985741853713989e-01 + <_> + + 0 -1 2063 3.4508369863033295e-03 + + 5.3577268123626709e-01 4.2187309265136719e-01 + <_> + + 0 -1 2064 -4.2077939724549651e-04 + + 5.9161728620529175e-01 4.6379259228706360e-01 + <_> + + 0 -1 2065 3.3051050268113613e-03 + + 5.2733850479125977e-01 4.3820428848266602e-01 + <_> + + 0 -1 2066 4.7735060798004270e-04 + + 4.0465280413627625e-01 5.1818847656250000e-01 + <_> + + 0 -1 2067 -2.5928510352969170e-02 + + 7.4522358179092407e-01 5.0893861055374146e-01 + <_> + + 0 -1 2068 -2.9729790985584259e-03 + + 3.2954359054565430e-01 5.0587952136993408e-01 + <_> + + 0 -1 2069 5.8508329093456268e-03 + + 4.8571440577507019e-01 5.7930248975753784e-01 + <_> + + 0 -1 2070 -4.5967519283294678e-02 + + 4.3127310276031494e-01 5.3806531429290771e-01 + <_> + + 0 -1 2071 1.5585960447788239e-01 + + 5.1961702108383179e-01 1.6847139596939087e-01 + <_> + + 0 -1 2072 1.5164829790592194e-02 + + 4.7357571125030518e-01 6.7350268363952637e-01 + <_> + + 0 -1 2073 -1.0604249546304345e-03 + + 5.8229267597198486e-01 4.7757029533386230e-01 + <_> + + 0 -1 2074 6.6476291976869106e-03 + + 4.9991989135742188e-01 2.3195350170135498e-01 + <_> + + 0 -1 2075 -1.2231130152940750e-02 + + 4.7508931159973145e-01 5.2629822492599487e-01 + <_> + + 0 -1 2076 5.6528882123529911e-03 + + 5.0697678327560425e-01 3.5618188977241516e-01 + <_> + + 0 -1 2077 1.2977829901501536e-03 + + 4.8756939172744751e-01 5.6190627813339233e-01 + <_> + + 0 -1 2078 1.0781589895486832e-02 + + 4.7507700324058533e-01 6.7823082208633423e-01 + <_> + + 0 -1 2079 2.8654779307544231e-03 + + 5.3054618835449219e-01 4.2907360196113586e-01 + <_> + + 0 -1 2080 2.8663428965955973e-03 + + 4.5184791088104248e-01 5.5393511056900024e-01 + <_> + + 0 -1 2081 -5.1983320154249668e-03 + + 4.1491198539733887e-01 5.4341888427734375e-01 + <_> + + 0 -1 2082 5.3739990107715130e-03 + + 4.7178968787193298e-01 6.5076571702957153e-01 + <_> + + 0 -1 2083 -1.4641529880464077e-02 + + 2.1721640229225159e-01 5.1617771387100220e-01 + <_> + + 0 -1 2084 -1.5042580344015732e-05 + + 5.3373837471008301e-01 4.2988368868827820e-01 + <_> + + 0 -1 2085 -1.1875660129589960e-04 + + 4.6045941114425659e-01 5.5824470520019531e-01 + <_> + + 0 -1 2086 1.6995530575513840e-02 + + 4.9458950757980347e-01 7.3880076408386230e-02 + <_> + + 0 -1 2087 -3.5095941275358200e-02 + + 7.0055091381072998e-01 4.9775910377502441e-01 + <_> + + 0 -1 2088 2.4217350874096155e-03 + + 4.4662651419639587e-01 5.4776942729949951e-01 + <_> + + 0 -1 2089 -9.6340337768197060e-04 + + 4.7140988707542419e-01 5.3133380413055420e-01 + <_> + + 0 -1 2090 1.6391130338888615e-04 + + 4.3315461277961731e-01 5.3422421216964722e-01 + <_> + + 0 -1 2091 -2.1141460165381432e-02 + + 2.6447001099586487e-01 5.2044987678527832e-01 + <_> + + 0 -1 2092 8.7775202700868249e-04 + + 5.2083498239517212e-01 4.1527429223060608e-01 + <_> + + 0 -1 2093 -2.7943920344114304e-02 + + 6.3441252708435059e-01 5.0188118219375610e-01 + <_> + + 0 -1 2094 6.7297378554940224e-03 + + 5.0504380464553833e-01 3.5008639097213745e-01 + <_> + + 0 -1 2095 2.3281039670109749e-02 + + 4.9663180112838745e-01 6.9686770439147949e-01 + <_> + + 0 -1 2096 -1.1644979938864708e-02 + + 3.3002600073814392e-01 5.0496298074722290e-01 + <_> + + 0 -1 2097 1.5764309093356133e-02 + + 4.9915981292724609e-01 7.3211538791656494e-01 + <_> + + 0 -1 2098 -1.3611479662358761e-03 + + 3.9117351174354553e-01 5.1606708765029907e-01 + <_> + + 0 -1 2099 -8.1522337859496474e-04 + + 5.6289112567901611e-01 4.9497190117835999e-01 + <_> + + 0 -1 2100 -6.0066272271797061e-04 + + 5.8535951375961304e-01 4.5505958795547485e-01 + <_> + + 0 -1 2101 4.9715518252924085e-04 + + 4.2714700102806091e-01 5.4435992240905762e-01 + <_> + + 0 -1 2102 2.3475370835512877e-03 + + 5.1431107521057129e-01 3.8876569271087646e-01 + <_> + + 0 -1 2103 -8.9261569082736969e-03 + + 6.0445022583007812e-01 4.9717208743095398e-01 + <_> + + 0 -1 2104 -1.3919910416007042e-02 + + 2.5831609964370728e-01 5.0003677606582642e-01 + <_> + + 0 -1 2105 1.0209949687123299e-03 + + 4.8573741316795349e-01 5.5603581666946411e-01 + <_> + + 0 -1 2106 -2.7441629208624363e-03 + + 5.9368848800659180e-01 4.6457770466804504e-01 + <_> + + 0 -1 2107 -1.6200130805373192e-02 + + 3.1630149483680725e-01 5.1934951543807983e-01 + <_> + + 0 -1 2108 4.3331980705261230e-03 + + 5.0612241029739380e-01 3.4588789939880371e-01 + <_> + + 0 -1 2109 5.8497930876910686e-04 + + 4.7790178656578064e-01 5.8701777458190918e-01 + <_> + + 0 -1 2110 -2.2466450463980436e-03 + + 4.2978510260581970e-01 5.3747731447219849e-01 + <_> + + 0 -1 2111 2.3146099410951138e-03 + + 5.4386717081069946e-01 4.6409699320793152e-01 + <_> + + 0 -1 2112 8.7679121643304825e-03 + + 4.7268930077552795e-01 6.7717897891998291e-01 + <_> + + 0 -1 2113 -2.2448020172305405e-04 + + 4.2291730642318726e-01 5.4280489683151245e-01 + <_> + + 0 -1 2114 -7.4336021207273006e-03 + + 6.0988807678222656e-01 4.6836739778518677e-01 + <_> + + 0 -1 2115 -2.3189240600913763e-03 + + 5.6894367933273315e-01 4.4242420792579651e-01 + <_> + + 0 -1 2116 -2.1042178850620985e-03 + + 3.7622210383415222e-01 5.1870870590209961e-01 + <_> + + 0 -1 2117 4.6034841216169298e-04 + + 4.6994051337242126e-01 5.7712072134017944e-01 + <_> + + 0 -1 2118 1.0547629790380597e-03 + + 4.4652169942855835e-01 5.6017017364501953e-01 + <_> + + 0 -1 2119 8.7148818420246243e-04 + + 5.4498052597045898e-01 3.9147090911865234e-01 + <_> + + 0 -1 2120 3.3364820410497487e-04 + + 4.5640090107917786e-01 5.6457388401031494e-01 + <_> + + 0 -1 2121 -1.4853250468149781e-03 + + 5.7473778724670410e-01 4.6927788853645325e-01 + <_> + + 0 -1 2122 3.0251620337367058e-03 + + 5.1661968231201172e-01 3.7628141045570374e-01 + <_> + + 0 -1 2123 5.0280741415917873e-03 + + 5.0021117925643921e-01 6.1515271663665771e-01 + <_> + + 0 -1 2124 -5.8164511574432254e-04 + + 5.3945982456207275e-01 4.3907511234283447e-01 + <_> + + 0 -1 2125 4.5141529291868210e-02 + + 5.1883268356323242e-01 2.0630359649658203e-01 + <_> + + 0 -1 2126 -1.0795620037242770e-03 + + 3.9046850800514221e-01 5.1379072666168213e-01 + <_> + + 0 -1 2127 1.5995999274309725e-04 + + 4.8953229188919067e-01 5.4275041818618774e-01 + <_> + + 0 -1 2128 -1.9359270110726357e-02 + + 6.9752287864685059e-01 4.7735071182250977e-01 + <_> + + 0 -1 2129 2.0725509524345398e-01 + + 5.2336359024047852e-01 3.0349919199943542e-01 + <_> + + 0 -1 2130 -4.1953290929086506e-04 + + 5.4193967580795288e-01 4.4601860642433167e-01 + <_> + + 0 -1 2131 2.2582069505006075e-03 + + 4.8157641291618347e-01 6.0274088382720947e-01 + <_> + + 0 -1 2132 -6.7811207845807076e-03 + + 3.9802789688110352e-01 5.1833057403564453e-01 + <_> + + 0 -1 2133 1.1154309846460819e-02 + + 5.4312318563461304e-01 4.1887599229812622e-01 + <_> + + 0 -1 2134 4.3162431567907333e-02 + + 4.7382280230522156e-01 6.5229612588882446e-01 + + <_> + + <_> + 3 7 14 4 -1. + <_> + 3 9 14 2 2. + <_> + + <_> + 1 2 18 4 -1. + <_> + 7 2 6 4 3. + <_> + + <_> + 1 7 15 9 -1. + <_> + 1 10 15 3 3. + <_> + + <_> + 5 6 2 6 -1. + <_> + 5 9 2 3 2. + <_> + + <_> + 7 5 6 3 -1. + <_> + 9 5 2 3 3. + <_> + + <_> + 4 0 12 9 -1. + <_> + 4 3 12 3 3. + <_> + + <_> + 6 9 10 8 -1. + <_> + 6 13 10 4 2. + <_> + + <_> + 3 6 14 8 -1. + <_> + 3 10 14 4 2. + <_> + + <_> + 14 1 6 10 -1. + <_> + 14 1 3 10 2. + <_> + + <_> + 7 8 5 12 -1. + <_> + 7 12 5 4 3. + <_> + + <_> + 1 1 18 3 -1. + <_> + 7 1 6 3 3. + <_> + + <_> + 1 8 17 2 -1. + <_> + 1 9 17 1 2. + <_> + + <_> + 16 6 4 2 -1. + <_> + 16 7 4 1 2. + <_> + + <_> + 5 17 2 2 -1. + <_> + 5 18 2 1 2. + <_> + + <_> + 14 2 6 12 -1. + <_> + 14 2 3 12 2. + <_> + + <_> + 4 0 4 12 -1. + <_> + 4 0 2 6 2. + <_> + 6 6 2 6 2. + <_> + + <_> + 2 11 18 8 -1. + <_> + 8 11 6 8 3. + <_> + + <_> + 5 7 10 2 -1. + <_> + 5 8 10 1 2. + <_> + + <_> + 15 11 5 3 -1. + <_> + 15 12 5 1 3. + <_> + + <_> + 5 3 10 9 -1. + <_> + 5 6 10 3 3. + <_> + + <_> + 9 4 2 14 -1. + <_> + 9 11 2 7 2. + <_> + + <_> + 3 5 4 12 -1. + <_> + 3 9 4 4 3. + <_> + + <_> + 4 5 12 5 -1. + <_> + 8 5 4 5 3. + <_> + + <_> + 5 6 10 8 -1. + <_> + 5 10 10 4 2. + <_> + + <_> + 8 0 6 9 -1. + <_> + 8 3 6 3 3. + <_> + + <_> + 9 12 1 8 -1. + <_> + 9 16 1 4 2. + <_> + + <_> + 0 7 20 6 -1. + <_> + 0 9 20 2 3. + <_> + + <_> + 7 0 6 17 -1. + <_> + 9 0 2 17 3. + <_> + + <_> + 9 0 6 4 -1. + <_> + 11 0 2 4 3. + <_> + + <_> + 5 1 6 4 -1. + <_> + 7 1 2 4 3. + <_> + + <_> + 12 1 6 16 -1. + <_> + 14 1 2 16 3. + <_> + + <_> + 0 5 18 8 -1. + <_> + 0 5 9 4 2. + <_> + 9 9 9 4 2. + <_> + + <_> + 8 15 10 4 -1. + <_> + 13 15 5 2 2. + <_> + 8 17 5 2 2. + <_> + + <_> + 3 1 4 8 -1. + <_> + 3 1 2 4 2. + <_> + 5 5 2 4 2. + <_> + + <_> + 3 6 14 10 -1. + <_> + 10 6 7 5 2. + <_> + 3 11 7 5 2. + <_> + + <_> + 2 1 6 16 -1. + <_> + 4 1 2 16 3. + <_> + + <_> + 0 18 20 2 -1. + <_> + 0 19 20 1 2. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 0 12 9 6 -1. + <_> + 0 14 9 2 3. + <_> + + <_> + 5 7 3 4 -1. + <_> + 5 9 3 2 2. + <_> + + <_> + 9 3 2 16 -1. + <_> + 9 11 2 8 2. + <_> + + <_> + 3 6 13 8 -1. + <_> + 3 10 13 4 2. + <_> + + <_> + 12 3 8 2 -1. + <_> + 12 3 4 2 2. + <_> + + <_> + 8 8 4 12 -1. + <_> + 8 12 4 4 3. + <_> + + <_> + 11 3 8 6 -1. + <_> + 15 3 4 3 2. + <_> + 11 6 4 3 2. + <_> + + <_> + 7 1 6 19 -1. + <_> + 9 1 2 19 3. + <_> + + <_> + 9 0 6 4 -1. + <_> + 11 0 2 4 3. + <_> + + <_> + 3 1 9 3 -1. + <_> + 6 1 3 3 3. + <_> + + <_> + 8 15 10 4 -1. + <_> + 13 15 5 2 2. + <_> + 8 17 5 2 2. + <_> + + <_> + 0 3 6 10 -1. + <_> + 3 3 3 10 2. + <_> + + <_> + 3 4 15 15 -1. + <_> + 3 9 15 5 3. + <_> + + <_> + 6 5 8 6 -1. + <_> + 6 7 8 2 3. + <_> + + <_> + 4 4 12 10 -1. + <_> + 10 4 6 5 2. + <_> + 4 9 6 5 2. + <_> + + <_> + 6 4 4 4 -1. + <_> + 8 4 2 4 2. + <_> + + <_> + 15 11 1 2 -1. + <_> + 15 12 1 1 2. + <_> + + <_> + 3 11 2 2 -1. + <_> + 3 12 2 1 2. + <_> + + <_> + 16 11 1 3 -1. + <_> + 16 12 1 1 3. + <_> + + <_> + 3 15 6 4 -1. + <_> + 3 15 3 2 2. + <_> + 6 17 3 2 2. + <_> + + <_> + 6 7 8 2 -1. + <_> + 6 8 8 1 2. + <_> + + <_> + 3 11 1 3 -1. + <_> + 3 12 1 1 3. + <_> + + <_> + 6 0 12 2 -1. + <_> + 6 1 12 1 2. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 7 15 6 2 -1. + <_> + 7 16 6 1 2. + <_> + + <_> + 0 5 4 6 -1. + <_> + 0 7 4 2 3. + <_> + + <_> + 4 12 12 2 -1. + <_> + 8 12 4 2 3. + <_> + + <_> + 6 3 1 9 -1. + <_> + 6 6 1 3 3. + <_> + + <_> + 10 17 3 2 -1. + <_> + 11 17 1 2 3. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 7 6 6 4 -1. + <_> + 9 6 2 4 3. + <_> + + <_> + 7 17 3 2 -1. + <_> + 8 17 1 2 3. + <_> + + <_> + 10 17 3 3 -1. + <_> + 11 17 1 3 3. + <_> + + <_> + 8 12 3 2 -1. + <_> + 8 13 3 1 2. + <_> + + <_> + 9 3 6 2 -1. + <_> + 11 3 2 2 3. + <_> + + <_> + 3 11 14 4 -1. + <_> + 3 13 14 2 2. + <_> + + <_> + 1 10 18 4 -1. + <_> + 10 10 9 2 2. + <_> + 1 12 9 2 2. + <_> + + <_> + 0 10 3 3 -1. + <_> + 0 11 3 1 3. + <_> + + <_> + 9 1 6 6 -1. + <_> + 11 1 2 6 3. + <_> + + <_> + 8 7 3 6 -1. + <_> + 9 7 1 6 3. + <_> + + <_> + 1 0 18 9 -1. + <_> + 1 3 18 3 3. + <_> + + <_> + 12 10 2 6 -1. + <_> + 12 13 2 3 2. + <_> + + <_> + 0 5 19 8 -1. + <_> + 0 9 19 4 2. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 5 3 6 1 -1. + <_> + 7 3 2 1 3. + <_> + + <_> + 11 3 6 1 -1. + <_> + 13 3 2 1 3. + <_> + + <_> + 5 10 4 6 -1. + <_> + 5 13 4 3 2. + <_> + + <_> + 11 3 6 1 -1. + <_> + 13 3 2 1 3. + <_> + + <_> + 4 4 12 6 -1. + <_> + 4 6 12 2 3. + <_> + + <_> + 15 12 2 6 -1. + <_> + 15 14 2 2 3. + <_> + + <_> + 9 3 2 2 -1. + <_> + 10 3 1 2 2. + <_> + + <_> + 9 3 3 1 -1. + <_> + 10 3 1 1 3. + <_> + + <_> + 1 1 4 14 -1. + <_> + 3 1 2 14 2. + <_> + + <_> + 9 0 4 4 -1. + <_> + 11 0 2 2 2. + <_> + 9 2 2 2 2. + <_> + + <_> + 7 5 1 14 -1. + <_> + 7 12 1 7 2. + <_> + + <_> + 19 0 1 4 -1. + <_> + 19 2 1 2 2. + <_> + + <_> + 5 5 6 4 -1. + <_> + 8 5 3 4 2. + <_> + + <_> + 9 18 3 2 -1. + <_> + 10 18 1 2 3. + <_> + + <_> + 8 18 3 2 -1. + <_> + 9 18 1 2 3. + <_> + + <_> + 4 5 12 6 -1. + <_> + 4 7 12 2 3. + <_> + + <_> + 3 12 2 6 -1. + <_> + 3 14 2 2 3. + <_> + + <_> + 10 8 2 12 -1. + <_> + 10 12 2 4 3. + <_> + + <_> + 7 18 3 2 -1. + <_> + 8 18 1 2 3. + <_> + + <_> + 9 0 6 2 -1. + <_> + 11 0 2 2 3. + <_> + + <_> + 5 11 9 3 -1. + <_> + 5 12 9 1 3. + <_> + + <_> + 9 0 6 2 -1. + <_> + 11 0 2 2 3. + <_> + + <_> + 1 1 18 5 -1. + <_> + 7 1 6 5 3. + <_> + + <_> + 8 0 4 4 -1. + <_> + 10 0 2 2 2. + <_> + 8 2 2 2 2. + <_> + + <_> + 3 12 1 3 -1. + <_> + 3 13 1 1 3. + <_> + + <_> + 8 14 5 3 -1. + <_> + 8 15 5 1 3. + <_> + + <_> + 5 4 10 12 -1. + <_> + 5 4 5 6 2. + <_> + 10 10 5 6 2. + <_> + + <_> + 9 6 9 12 -1. + <_> + 9 10 9 4 3. + <_> + + <_> + 2 2 12 14 -1. + <_> + 2 2 6 7 2. + <_> + 8 9 6 7 2. + <_> + + <_> + 4 7 12 2 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 7 4 6 4 -1. + <_> + 7 6 6 2 2. + <_> + + <_> + 4 5 11 8 -1. + <_> + 4 9 11 4 2. + <_> + + <_> + 3 10 16 4 -1. + <_> + 3 12 16 2 2. + <_> + + <_> + 0 0 16 2 -1. + <_> + 0 1 16 1 2. + <_> + + <_> + 7 5 6 2 -1. + <_> + 9 5 2 2 3. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 10 5 8 15 -1. + <_> + 10 10 8 5 3. + <_> + + <_> + 3 14 8 6 -1. + <_> + 3 14 4 3 2. + <_> + 7 17 4 3 2. + <_> + + <_> + 14 2 2 2 -1. + <_> + 14 3 2 1 2. + <_> + + <_> + 1 10 7 6 -1. + <_> + 1 13 7 3 2. + <_> + + <_> + 15 4 4 3 -1. + <_> + 15 4 2 3 2. + <_> + + <_> + 2 9 14 6 -1. + <_> + 2 9 7 3 2. + <_> + 9 12 7 3 2. + <_> + + <_> + 5 7 10 4 -1. + <_> + 5 9 10 2 2. + <_> + + <_> + 6 9 8 8 -1. + <_> + 6 9 4 4 2. + <_> + 10 13 4 4 2. + <_> + + <_> + 14 1 3 2 -1. + <_> + 14 2 3 1 2. + <_> + + <_> + 1 4 4 2 -1. + <_> + 3 4 2 2 2. + <_> + + <_> + 11 10 2 8 -1. + <_> + 11 14 2 4 2. + <_> + + <_> + 0 0 5 3 -1. + <_> + 0 1 5 1 3. + <_> + + <_> + 2 5 18 8 -1. + <_> + 11 5 9 4 2. + <_> + 2 9 9 4 2. + <_> + + <_> + 6 6 1 6 -1. + <_> + 6 9 1 3 2. + <_> + + <_> + 19 1 1 3 -1. + <_> + 19 2 1 1 3. + <_> + + <_> + 7 6 6 6 -1. + <_> + 9 6 2 6 3. + <_> + + <_> + 19 1 1 3 -1. + <_> + 19 2 1 1 3. + <_> + + <_> + 3 13 2 3 -1. + <_> + 3 14 2 1 3. + <_> + + <_> + 8 4 8 12 -1. + <_> + 12 4 4 6 2. + <_> + 8 10 4 6 2. + <_> + + <_> + 5 2 6 3 -1. + <_> + 7 2 2 3 3. + <_> + + <_> + 6 1 9 10 -1. + <_> + 6 6 9 5 2. + <_> + + <_> + 0 4 6 12 -1. + <_> + 2 4 2 12 3. + <_> + + <_> + 15 13 2 3 -1. + <_> + 15 14 2 1 3. + <_> + + <_> + 7 14 5 3 -1. + <_> + 7 15 5 1 3. + <_> + + <_> + 15 13 3 3 -1. + <_> + 15 14 3 1 3. + <_> + + <_> + 6 14 8 3 -1. + <_> + 6 15 8 1 3. + <_> + + <_> + 15 13 3 3 -1. + <_> + 15 14 3 1 3. + <_> + + <_> + 2 13 3 3 -1. + <_> + 2 14 3 1 3. + <_> + + <_> + 4 7 12 12 -1. + <_> + 10 7 6 6 2. + <_> + 4 13 6 6 2. + <_> + + <_> + 9 7 2 6 -1. + <_> + 10 7 1 6 2. + <_> + + <_> + 8 9 5 2 -1. + <_> + 8 10 5 1 2. + <_> + + <_> + 8 6 3 4 -1. + <_> + 9 6 1 4 3. + <_> + + <_> + 9 6 2 8 -1. + <_> + 9 10 2 4 2. + <_> + + <_> + 7 7 3 6 -1. + <_> + 8 7 1 6 3. + <_> + + <_> + 11 3 3 3 -1. + <_> + 12 3 1 3 3. + <_> + + <_> + 5 4 6 1 -1. + <_> + 7 4 2 1 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 7 10 1 3. + <_> + + <_> + 7 3 6 9 -1. + <_> + 7 6 6 3 3. + <_> + + <_> + 6 7 9 1 -1. + <_> + 9 7 3 1 3. + <_> + + <_> + 2 8 16 8 -1. + <_> + 2 12 16 4 2. + <_> + + <_> + 14 6 2 6 -1. + <_> + 14 9 2 3 2. + <_> + + <_> + 1 5 6 15 -1. + <_> + 1 10 6 5 3. + <_> + + <_> + 10 0 6 9 -1. + <_> + 10 3 6 3 3. + <_> + + <_> + 6 6 7 14 -1. + <_> + 6 13 7 7 2. + <_> + + <_> + 13 7 3 6 -1. + <_> + 13 9 3 2 3. + <_> + + <_> + 1 8 15 4 -1. + <_> + 6 8 5 4 3. + <_> + + <_> + 11 2 3 10 -1. + <_> + 11 7 3 5 2. + <_> + + <_> + 3 7 4 6 -1. + <_> + 3 9 4 2 3. + <_> + + <_> + 13 3 6 10 -1. + <_> + 15 3 2 10 3. + <_> + + <_> + 5 7 8 10 -1. + <_> + 5 7 4 5 2. + <_> + 9 12 4 5 2. + <_> + + <_> + 4 4 12 12 -1. + <_> + 10 4 6 6 2. + <_> + 4 10 6 6 2. + <_> + + <_> + 1 4 6 9 -1. + <_> + 3 4 2 9 3. + <_> + + <_> + 11 3 2 5 -1. + <_> + 11 3 1 5 2. + <_> + + <_> + 7 3 2 5 -1. + <_> + 8 3 1 5 2. + <_> + + <_> + 10 14 2 3 -1. + <_> + 10 15 2 1 3. + <_> + + <_> + 5 12 6 2 -1. + <_> + 8 12 3 2 2. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 4 11 12 6 -1. + <_> + 4 14 12 3 2. + <_> + + <_> + 11 11 5 9 -1. + <_> + 11 14 5 3 3. + <_> + + <_> + 6 15 3 2 -1. + <_> + 6 16 3 1 2. + <_> + + <_> + 11 0 3 5 -1. + <_> + 12 0 1 5 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 8 5 3 7 2. + <_> + + <_> + 13 0 1 9 -1. + <_> + 13 3 1 3 3. + <_> + + <_> + 3 2 4 8 -1. + <_> + 3 2 2 4 2. + <_> + 5 6 2 4 2. + <_> + + <_> + 13 12 4 6 -1. + <_> + 13 14 4 2 3. + <_> + + <_> + 3 12 4 6 -1. + <_> + 3 14 4 2 3. + <_> + + <_> + 13 11 3 4 -1. + <_> + 13 13 3 2 2. + <_> + + <_> + 4 4 4 3 -1. + <_> + 4 5 4 1 3. + <_> + + <_> + 7 5 11 8 -1. + <_> + 7 9 11 4 2. + <_> + + <_> + 7 8 3 4 -1. + <_> + 8 8 1 4 3. + <_> + + <_> + 9 1 6 1 -1. + <_> + 11 1 2 1 3. + <_> + + <_> + 5 5 3 3 -1. + <_> + 5 6 3 1 3. + <_> + + <_> + 0 9 20 6 -1. + <_> + 10 9 10 3 2. + <_> + 0 12 10 3 2. + <_> + + <_> + 8 6 3 5 -1. + <_> + 9 6 1 5 3. + <_> + + <_> + 11 0 1 3 -1. + <_> + 11 1 1 1 3. + <_> + + <_> + 4 2 4 2 -1. + <_> + 4 3 4 1 2. + <_> + + <_> + 12 6 4 3 -1. + <_> + 12 7 4 1 3. + <_> + + <_> + 5 0 6 4 -1. + <_> + 7 0 2 4 3. + <_> + + <_> + 9 7 3 8 -1. + <_> + 10 7 1 8 3. + <_> + + <_> + 9 7 2 2 -1. + <_> + 10 7 1 2 2. + <_> + + <_> + 6 7 14 4 -1. + <_> + 13 7 7 2 2. + <_> + 6 9 7 2 2. + <_> + + <_> + 0 5 3 6 -1. + <_> + 0 7 3 2 3. + <_> + + <_> + 13 11 3 4 -1. + <_> + 13 13 3 2 2. + <_> + + <_> + 4 11 3 4 -1. + <_> + 4 13 3 2 2. + <_> + + <_> + 5 9 12 8 -1. + <_> + 11 9 6 4 2. + <_> + 5 13 6 4 2. + <_> + + <_> + 9 12 1 3 -1. + <_> + 9 13 1 1 3. + <_> + + <_> + 10 15 2 4 -1. + <_> + 10 17 2 2 2. + <_> + + <_> + 7 7 6 1 -1. + <_> + 9 7 2 1 3. + <_> + + <_> + 12 3 6 6 -1. + <_> + 15 3 3 3 2. + <_> + 12 6 3 3 2. + <_> + + <_> + 0 4 10 6 -1. + <_> + 0 6 10 2 3. + <_> + + <_> + 8 3 8 14 -1. + <_> + 12 3 4 7 2. + <_> + 8 10 4 7 2. + <_> + + <_> + 4 4 7 15 -1. + <_> + 4 9 7 5 3. + <_> + + <_> + 12 2 6 8 -1. + <_> + 15 2 3 4 2. + <_> + 12 6 3 4 2. + <_> + + <_> + 2 2 6 8 -1. + <_> + 2 2 3 4 2. + <_> + 5 6 3 4 2. + <_> + + <_> + 2 13 18 7 -1. + <_> + 8 13 6 7 3. + <_> + + <_> + 4 3 8 14 -1. + <_> + 4 3 4 7 2. + <_> + 8 10 4 7 2. + <_> + + <_> + 18 1 2 6 -1. + <_> + 18 3 2 2 3. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 18 1 2 6 -1. + <_> + 18 3 2 2 3. + <_> + + <_> + 0 1 2 6 -1. + <_> + 0 3 2 2 3. + <_> + + <_> + 1 5 18 6 -1. + <_> + 1 7 18 2 3. + <_> + + <_> + 0 2 6 7 -1. + <_> + 3 2 3 7 2. + <_> + + <_> + 7 3 6 14 -1. + <_> + 7 10 6 7 2. + <_> + + <_> + 3 7 13 10 -1. + <_> + 3 12 13 5 2. + <_> + + <_> + 11 15 2 2 -1. + <_> + 11 16 2 1 2. + <_> + + <_> + 2 11 16 4 -1. + <_> + 2 11 8 2 2. + <_> + 10 13 8 2 2. + <_> + + <_> + 13 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 13 9 3 2 2. + <_> + + <_> + 6 10 3 9 -1. + <_> + 6 13 3 3 3. + <_> + + <_> + 14 6 1 6 -1. + <_> + 14 9 1 3 2. + <_> + + <_> + 5 10 4 1 -1. + <_> + 7 10 2 1 2. + <_> + + <_> + 3 8 15 5 -1. + <_> + 8 8 5 5 3. + <_> + + <_> + 1 6 5 4 -1. + <_> + 1 8 5 2 2. + <_> + + <_> + 3 1 17 6 -1. + <_> + 3 3 17 2 3. + <_> + + <_> + 6 7 8 2 -1. + <_> + 10 7 4 2 2. + <_> + + <_> + 9 7 3 2 -1. + <_> + 10 7 1 2 3. + <_> + + <_> + 8 7 3 2 -1. + <_> + 9 7 1 2 3. + <_> + + <_> + 8 9 4 2 -1. + <_> + 8 10 4 1 2. + <_> + + <_> + 8 8 4 3 -1. + <_> + 8 9 4 1 3. + <_> + + <_> + 9 5 6 4 -1. + <_> + 9 5 3 4 2. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 4 7 12 6 -1. + <_> + 10 7 6 3 2. + <_> + 4 10 6 3 2. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 9 7 3 3 -1. + <_> + 9 8 3 1 3. + <_> + + <_> + 7 4 3 8 -1. + <_> + 8 4 1 8 3. + <_> + + <_> + 10 0 3 6 -1. + <_> + 11 0 1 6 3. + <_> + + <_> + 6 3 4 8 -1. + <_> + 8 3 2 8 2. + <_> + + <_> + 14 3 6 13 -1. + <_> + 14 3 3 13 2. + <_> + + <_> + 8 13 3 6 -1. + <_> + 8 16 3 3 2. + <_> + + <_> + 14 3 6 13 -1. + <_> + 14 3 3 13 2. + <_> + + <_> + 0 7 10 4 -1. + <_> + 0 7 5 2 2. + <_> + 5 9 5 2 2. + <_> + + <_> + 14 3 6 13 -1. + <_> + 14 3 3 13 2. + <_> + + <_> + 0 3 6 13 -1. + <_> + 3 3 3 13 2. + <_> + + <_> + 9 1 4 1 -1. + <_> + 9 1 2 1 2. + <_> + + <_> + 8 0 2 1 -1. + <_> + 9 0 1 1 2. + <_> + + <_> + 10 16 4 4 -1. + <_> + 12 16 2 2 2. + <_> + 10 18 2 2 2. + <_> + + <_> + 9 6 2 3 -1. + <_> + 10 6 1 3 2. + <_> + + <_> + 4 5 12 2 -1. + <_> + 8 5 4 2 3. + <_> + + <_> + 8 7 3 5 -1. + <_> + 9 7 1 5 3. + <_> + + <_> + 6 4 8 6 -1. + <_> + 6 6 8 2 3. + <_> + + <_> + 9 5 2 12 -1. + <_> + 9 11 2 6 2. + <_> + + <_> + 4 6 6 8 -1. + <_> + 4 10 6 4 2. + <_> + + <_> + 12 2 8 5 -1. + <_> + 12 2 4 5 2. + <_> + + <_> + 0 8 18 3 -1. + <_> + 0 9 18 1 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 0 2 8 5 -1. + <_> + 4 2 4 5 2. + <_> + + <_> + 13 11 3 4 -1. + <_> + 13 13 3 2 2. + <_> + + <_> + 5 11 6 1 -1. + <_> + 7 11 2 1 3. + <_> + + <_> + 11 3 3 1 -1. + <_> + 12 3 1 1 3. + <_> + + <_> + 7 13 5 3 -1. + <_> + 7 14 5 1 3. + <_> + + <_> + 11 11 7 6 -1. + <_> + 11 14 7 3 2. + <_> + + <_> + 2 11 7 6 -1. + <_> + 2 14 7 3 2. + <_> + + <_> + 12 14 2 6 -1. + <_> + 12 16 2 2 3. + <_> + + <_> + 8 14 3 3 -1. + <_> + 8 15 3 1 3. + <_> + + <_> + 11 0 3 5 -1. + <_> + 12 0 1 5 3. + <_> + + <_> + 6 1 4 9 -1. + <_> + 8 1 2 9 2. + <_> + + <_> + 10 3 6 1 -1. + <_> + 12 3 2 1 3. + <_> + + <_> + 8 8 3 4 -1. + <_> + 8 10 3 2 2. + <_> + + <_> + 8 12 4 2 -1. + <_> + 8 13 4 1 2. + <_> + + <_> + 5 18 4 2 -1. + <_> + 5 19 4 1 2. + <_> + + <_> + 2 1 18 6 -1. + <_> + 2 3 18 2 3. + <_> + + <_> + 6 0 3 2 -1. + <_> + 7 0 1 2 3. + <_> + + <_> + 13 8 6 2 -1. + <_> + 16 8 3 1 2. + <_> + 13 9 3 1 2. + <_> + + <_> + 6 10 3 6 -1. + <_> + 6 13 3 3 2. + <_> + + <_> + 0 13 20 4 -1. + <_> + 10 13 10 2 2. + <_> + 0 15 10 2 2. + <_> + + <_> + 7 7 6 5 -1. + <_> + 9 7 2 5 3. + <_> + + <_> + 11 0 2 2 -1. + <_> + 11 1 2 1 2. + <_> + + <_> + 1 8 6 2 -1. + <_> + 1 8 3 1 2. + <_> + 4 9 3 1 2. + <_> + + <_> + 0 2 20 2 -1. + <_> + 10 2 10 1 2. + <_> + 0 3 10 1 2. + <_> + + <_> + 7 14 5 3 -1. + <_> + 7 15 5 1 3. + <_> + + <_> + 7 13 6 6 -1. + <_> + 10 13 3 3 2. + <_> + 7 16 3 3 2. + <_> + + <_> + 9 12 2 3 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 16 11 1 6 -1. + <_> + 16 13 1 2 3. + <_> + + <_> + 3 11 1 6 -1. + <_> + 3 13 1 2 3. + <_> + + <_> + 4 4 14 12 -1. + <_> + 11 4 7 6 2. + <_> + 4 10 7 6 2. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 12 3 3 3 -1. + <_> + 13 3 1 3 3. + <_> + + <_> + 6 6 8 3 -1. + <_> + 6 7 8 1 3. + <_> + + <_> + 12 3 3 3 -1. + <_> + 13 3 1 3 3. + <_> + + <_> + 3 1 4 10 -1. + <_> + 3 1 2 5 2. + <_> + 5 6 2 5 2. + <_> + + <_> + 5 7 10 2 -1. + <_> + 5 7 5 2 2. + <_> + + <_> + 8 7 3 3 -1. + <_> + 9 7 1 3 3. + <_> + + <_> + 15 12 2 3 -1. + <_> + 15 13 2 1 3. + <_> + + <_> + 7 8 3 4 -1. + <_> + 8 8 1 4 3. + <_> + + <_> + 13 4 1 12 -1. + <_> + 13 10 1 6 2. + <_> + + <_> + 4 5 12 12 -1. + <_> + 4 5 6 6 2. + <_> + 10 11 6 6 2. + <_> + + <_> + 7 14 7 3 -1. + <_> + 7 15 7 1 3. + <_> + + <_> + 3 12 2 3 -1. + <_> + 3 13 2 1 3. + <_> + + <_> + 3 2 14 2 -1. + <_> + 10 2 7 1 2. + <_> + 3 3 7 1 2. + <_> + + <_> + 0 1 3 10 -1. + <_> + 1 1 1 10 3. + <_> + + <_> + 9 0 6 5 -1. + <_> + 11 0 2 5 3. + <_> + + <_> + 5 7 6 2 -1. + <_> + 8 7 3 2 2. + <_> + + <_> + 7 1 6 10 -1. + <_> + 7 6 6 5 2. + <_> + + <_> + 1 1 18 3 -1. + <_> + 7 1 6 3 3. + <_> + + <_> + 16 3 3 6 -1. + <_> + 16 5 3 2 3. + <_> + + <_> + 6 3 7 6 -1. + <_> + 6 6 7 3 2. + <_> + + <_> + 4 7 12 2 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 0 4 17 10 -1. + <_> + 0 9 17 5 2. + <_> + + <_> + 3 4 15 16 -1. + <_> + 3 12 15 8 2. + <_> + + <_> + 7 15 6 4 -1. + <_> + 7 17 6 2 2. + <_> + + <_> + 15 2 4 9 -1. + <_> + 15 2 2 9 2. + <_> + + <_> + 2 3 3 2 -1. + <_> + 2 4 3 1 2. + <_> + + <_> + 13 6 7 9 -1. + <_> + 13 9 7 3 3. + <_> + + <_> + 8 11 4 3 -1. + <_> + 8 12 4 1 3. + <_> + + <_> + 0 2 20 6 -1. + <_> + 10 2 10 3 2. + <_> + 0 5 10 3 2. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 13 10 3 4 -1. + <_> + 13 12 3 2 2. + <_> + + <_> + 4 10 3 4 -1. + <_> + 4 12 3 2 2. + <_> + + <_> + 7 5 6 3 -1. + <_> + 9 5 2 3 3. + <_> + + <_> + 7 6 6 8 -1. + <_> + 7 10 6 4 2. + <_> + + <_> + 0 11 20 6 -1. + <_> + 0 14 20 3 2. + <_> + + <_> + 4 13 4 6 -1. + <_> + 4 13 2 3 2. + <_> + 6 16 2 3 2. + <_> + + <_> + 6 0 8 12 -1. + <_> + 10 0 4 6 2. + <_> + 6 6 4 6 2. + <_> + + <_> + 2 0 15 2 -1. + <_> + 2 1 15 1 2. + <_> + + <_> + 9 12 2 3 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 3 12 1 2 -1. + <_> + 3 13 1 1 2. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 7 3 3 1 -1. + <_> + 8 3 1 1 3. + <_> + + <_> + 17 7 3 6 -1. + <_> + 17 9 3 2 3. + <_> + + <_> + 7 2 3 2 -1. + <_> + 8 2 1 2 3. + <_> + + <_> + 11 4 5 3 -1. + <_> + 11 5 5 1 3. + <_> + + <_> + 4 4 5 3 -1. + <_> + 4 5 5 1 3. + <_> + + <_> + 19 3 1 2 -1. + <_> + 19 4 1 1 2. + <_> + + <_> + 5 5 4 3 -1. + <_> + 5 6 4 1 3. + <_> + + <_> + 17 7 3 6 -1. + <_> + 17 9 3 2 3. + <_> + + <_> + 0 7 3 6 -1. + <_> + 0 9 3 2 3. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 0 4 5 6 -1. + <_> + 0 6 5 2 3. + <_> + + <_> + 10 5 6 2 -1. + <_> + 12 5 2 2 3. + <_> + + <_> + 4 5 6 2 -1. + <_> + 6 5 2 2 3. + <_> + + <_> + 8 1 4 6 -1. + <_> + 8 3 4 2 3. + <_> + + <_> + 0 2 3 6 -1. + <_> + 0 4 3 2 3. + <_> + + <_> + 6 6 8 3 -1. + <_> + 6 7 8 1 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 16 0 4 15 -1. + <_> + 16 0 2 15 2. + <_> + + <_> + 1 10 3 2 -1. + <_> + 1 11 3 1 2. + <_> + + <_> + 14 4 1 10 -1. + <_> + 14 9 1 5 2. + <_> + + <_> + 0 1 4 12 -1. + <_> + 2 1 2 12 2. + <_> + + <_> + 11 11 4 2 -1. + <_> + 11 11 2 2 2. + <_> + + <_> + 5 11 4 2 -1. + <_> + 7 11 2 2 2. + <_> + + <_> + 3 8 15 5 -1. + <_> + 8 8 5 5 3. + <_> + + <_> + 0 0 6 10 -1. + <_> + 3 0 3 10 2. + <_> + + <_> + 11 4 3 2 -1. + <_> + 12 4 1 2 3. + <_> + + <_> + 8 12 3 8 -1. + <_> + 8 16 3 4 2. + <_> + + <_> + 8 14 5 3 -1. + <_> + 8 15 5 1 3. + <_> + + <_> + 7 14 4 3 -1. + <_> + 7 15 4 1 3. + <_> + + <_> + 11 4 3 2 -1. + <_> + 12 4 1 2 3. + <_> + + <_> + 3 15 14 4 -1. + <_> + 3 15 7 2 2. + <_> + 10 17 7 2 2. + <_> + + <_> + 2 2 16 4 -1. + <_> + 10 2 8 2 2. + <_> + 2 4 8 2 2. + <_> + + <_> + 0 8 6 12 -1. + <_> + 3 8 3 12 2. + <_> + + <_> + 5 7 10 2 -1. + <_> + 5 7 5 2 2. + <_> + + <_> + 9 7 2 5 -1. + <_> + 10 7 1 5 2. + <_> + + <_> + 13 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 13 9 3 2 2. + <_> + + <_> + 0 13 8 2 -1. + <_> + 0 14 8 1 2. + <_> + + <_> + 13 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 13 9 3 2 2. + <_> + + <_> + 1 7 6 4 -1. + <_> + 1 7 3 2 2. + <_> + 4 9 3 2 2. + <_> + + <_> + 12 6 1 12 -1. + <_> + 12 12 1 6 2. + <_> + + <_> + 9 5 2 6 -1. + <_> + 10 5 1 6 2. + <_> + + <_> + 14 12 2 3 -1. + <_> + 14 13 2 1 3. + <_> + + <_> + 4 12 2 3 -1. + <_> + 4 13 2 1 3. + <_> + + <_> + 8 12 4 3 -1. + <_> + 8 13 4 1 3. + <_> + + <_> + 5 2 2 4 -1. + <_> + 5 2 1 2 2. + <_> + 6 4 1 2 2. + <_> + + <_> + 5 5 11 3 -1. + <_> + 5 6 11 1 3. + <_> + + <_> + 7 6 4 12 -1. + <_> + 7 12 4 6 2. + <_> + + <_> + 12 13 8 5 -1. + <_> + 12 13 4 5 2. + <_> + + <_> + 7 6 1 12 -1. + <_> + 7 12 1 6 2. + <_> + + <_> + 1 2 6 3 -1. + <_> + 4 2 3 3 2. + <_> + + <_> + 9 5 6 10 -1. + <_> + 12 5 3 5 2. + <_> + 9 10 3 5 2. + <_> + + <_> + 5 5 8 12 -1. + <_> + 5 5 4 6 2. + <_> + 9 11 4 6 2. + <_> + + <_> + 0 7 20 6 -1. + <_> + 0 9 20 2 3. + <_> + + <_> + 4 2 2 2 -1. + <_> + 4 3 2 1 2. + <_> + + <_> + 4 18 12 2 -1. + <_> + 8 18 4 2 3. + <_> + + <_> + 7 4 4 16 -1. + <_> + 7 12 4 8 2. + <_> + + <_> + 7 6 7 8 -1. + <_> + 7 10 7 4 2. + <_> + + <_> + 6 3 3 1 -1. + <_> + 7 3 1 1 3. + <_> + + <_> + 11 15 2 4 -1. + <_> + 11 17 2 2 2. + <_> + + <_> + 3 5 4 8 -1. + <_> + 3 9 4 4 2. + <_> + + <_> + 7 1 6 12 -1. + <_> + 7 7 6 6 2. + <_> + + <_> + 4 6 6 2 -1. + <_> + 6 6 2 2 3. + <_> + + <_> + 16 4 4 6 -1. + <_> + 16 6 4 2 3. + <_> + + <_> + 3 3 5 2 -1. + <_> + 3 4 5 1 2. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 2 16 4 2 -1. + <_> + 2 17 4 1 2. + <_> + + <_> + 7 13 6 6 -1. + <_> + 10 13 3 3 2. + <_> + 7 16 3 3 2. + <_> + + <_> + 7 0 3 4 -1. + <_> + 8 0 1 4 3. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 0 4 4 6 -1. + <_> + 0 6 4 2 3. + <_> + + <_> + 5 6 12 3 -1. + <_> + 9 6 4 3 3. + <_> + + <_> + 7 6 6 14 -1. + <_> + 9 6 2 14 3. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 7 1 3 3. + <_> + + <_> + 6 12 2 4 -1. + <_> + 6 14 2 2 2. + <_> + + <_> + 10 12 7 6 -1. + <_> + 10 14 7 2 3. + <_> + + <_> + 1 0 15 2 -1. + <_> + 1 1 15 1 2. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 5 3 3 1 -1. + <_> + 6 3 1 1 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 0 3 20 10 -1. + <_> + 0 8 20 5 2. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 19 15 1 2 -1. + <_> + 19 16 1 1 2. + <_> + + <_> + 0 2 4 8 -1. + <_> + 2 2 2 8 2. + <_> + + <_> + 2 1 18 4 -1. + <_> + 11 1 9 2 2. + <_> + 2 3 9 2 2. + <_> + + <_> + 8 12 1 2 -1. + <_> + 8 13 1 1 2. + <_> + + <_> + 5 2 10 6 -1. + <_> + 10 2 5 3 2. + <_> + 5 5 5 3 2. + <_> + + <_> + 9 7 2 4 -1. + <_> + 10 7 1 4 2. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 7 1 3 3. + <_> + + <_> + 4 5 12 8 -1. + <_> + 8 5 4 8 3. + <_> + + <_> + 15 15 4 3 -1. + <_> + 15 16 4 1 3. + <_> + + <_> + 8 18 3 1 -1. + <_> + 9 18 1 1 3. + <_> + + <_> + 9 13 4 3 -1. + <_> + 9 14 4 1 3. + <_> + + <_> + 7 13 4 3 -1. + <_> + 7 14 4 1 3. + <_> + + <_> + 19 15 1 2 -1. + <_> + 19 16 1 1 2. + <_> + + <_> + 0 15 8 4 -1. + <_> + 0 17 8 2 2. + <_> + + <_> + 9 3 6 4 -1. + <_> + 11 3 2 4 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 3 14 14 6 -1. + <_> + 3 16 14 2 3. + <_> + + <_> + 6 3 6 6 -1. + <_> + 6 6 6 3 2. + <_> + + <_> + 5 11 10 6 -1. + <_> + 5 14 10 3 2. + <_> + + <_> + 3 10 3 4 -1. + <_> + 4 10 1 4 3. + <_> + + <_> + 13 9 2 2 -1. + <_> + 13 9 1 2 2. + <_> + + <_> + 5 3 6 4 -1. + <_> + 7 3 2 4 3. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 7 1 3 3. + <_> + + <_> + 2 12 2 3 -1. + <_> + 2 13 2 1 3. + <_> + + <_> + 9 8 3 12 -1. + <_> + 9 12 3 4 3. + <_> + + <_> + 3 14 4 6 -1. + <_> + 3 14 2 3 2. + <_> + 5 17 2 3 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 16 2 1 2. + <_> + + <_> + 2 15 2 2 -1. + <_> + 2 16 2 1 2. + <_> + + <_> + 8 12 4 3 -1. + <_> + 8 13 4 1 3. + <_> + + <_> + 0 7 20 1 -1. + <_> + 10 7 10 1 2. + <_> + + <_> + 7 6 8 3 -1. + <_> + 7 6 4 3 2. + <_> + + <_> + 5 7 8 2 -1. + <_> + 9 7 4 2 2. + <_> + + <_> + 9 7 3 5 -1. + <_> + 10 7 1 5 3. + <_> + + <_> + 8 7 3 5 -1. + <_> + 9 7 1 5 3. + <_> + + <_> + 11 1 3 5 -1. + <_> + 12 1 1 5 3. + <_> + + <_> + 6 2 3 6 -1. + <_> + 7 2 1 6 3. + <_> + + <_> + 14 14 6 5 -1. + <_> + 14 14 3 5 2. + <_> + + <_> + 9 8 2 2 -1. + <_> + 9 9 2 1 2. + <_> + + <_> + 10 7 1 3 -1. + <_> + 10 8 1 1 3. + <_> + + <_> + 6 6 2 2 -1. + <_> + 6 6 1 1 2. + <_> + 7 7 1 1 2. + <_> + + <_> + 2 11 18 4 -1. + <_> + 11 11 9 2 2. + <_> + 2 13 9 2 2. + <_> + + <_> + 6 6 2 2 -1. + <_> + 6 6 1 1 2. + <_> + 7 7 1 1 2. + <_> + + <_> + 0 15 20 2 -1. + <_> + 0 16 20 1 2. + <_> + + <_> + 4 14 2 3 -1. + <_> + 4 15 2 1 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 8 7 2 3 -1. + <_> + 8 8 2 1 3. + <_> + + <_> + 9 10 2 3 -1. + <_> + 9 11 2 1 3. + <_> + + <_> + 5 4 10 4 -1. + <_> + 5 6 10 2 2. + <_> + + <_> + 9 7 6 4 -1. + <_> + 12 7 3 2 2. + <_> + 9 9 3 2 2. + <_> + + <_> + 4 7 3 6 -1. + <_> + 4 9 3 2 3. + <_> + + <_> + 11 15 4 4 -1. + <_> + 13 15 2 2 2. + <_> + 11 17 2 2 2. + <_> + + <_> + 7 8 4 2 -1. + <_> + 7 9 4 1 2. + <_> + + <_> + 13 1 4 3 -1. + <_> + 13 1 2 3 2. + <_> + + <_> + 5 15 4 4 -1. + <_> + 5 15 2 2 2. + <_> + 7 17 2 2 2. + <_> + + <_> + 9 5 4 7 -1. + <_> + 9 5 2 7 2. + <_> + + <_> + 5 6 8 3 -1. + <_> + 9 6 4 3 2. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 7 15 5 3 -1. + <_> + 7 16 5 1 3. + <_> + + <_> + 11 10 4 3 -1. + <_> + 11 10 2 3 2. + <_> + + <_> + 6 9 8 10 -1. + <_> + 6 14 8 5 2. + <_> + + <_> + 10 11 6 2 -1. + <_> + 10 11 3 2 2. + <_> + + <_> + 4 11 6 2 -1. + <_> + 7 11 3 2 2. + <_> + + <_> + 11 3 8 1 -1. + <_> + 11 3 4 1 2. + <_> + + <_> + 6 3 3 2 -1. + <_> + 7 3 1 2 3. + <_> + + <_> + 14 5 6 5 -1. + <_> + 14 5 3 5 2. + <_> + + <_> + 7 5 2 12 -1. + <_> + 7 11 2 6 2. + <_> + + <_> + 8 11 4 3 -1. + <_> + 8 12 4 1 3. + <_> + + <_> + 4 1 2 3 -1. + <_> + 5 1 1 3 2. + <_> + + <_> + 18 3 2 6 -1. + <_> + 18 5 2 2 3. + <_> + + <_> + 0 3 2 6 -1. + <_> + 0 5 2 2 3. + <_> + + <_> + 9 12 2 3 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 7 13 4 3 -1. + <_> + 7 14 4 1 3. + <_> + + <_> + 18 0 2 6 -1. + <_> + 18 2 2 2 3. + <_> + + <_> + 0 0 2 6 -1. + <_> + 0 2 2 2 3. + <_> + + <_> + 8 14 6 3 -1. + <_> + 8 15 6 1 3. + <_> + + <_> + 7 4 2 4 -1. + <_> + 8 4 1 4 2. + <_> + + <_> + 8 5 4 6 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 6 4 2 2 -1. + <_> + 7 4 1 2 2. + <_> + + <_> + 3 14 14 4 -1. + <_> + 10 14 7 2 2. + <_> + 3 16 7 2 2. + <_> + + <_> + 6 15 6 2 -1. + <_> + 6 15 3 1 2. + <_> + 9 16 3 1 2. + <_> + + <_> + 14 15 6 2 -1. + <_> + 14 16 6 1 2. + <_> + + <_> + 2 12 12 8 -1. + <_> + 2 16 12 4 2. + <_> + + <_> + 7 7 7 2 -1. + <_> + 7 8 7 1 2. + <_> + + <_> + 0 2 18 2 -1. + <_> + 0 3 18 1 2. + <_> + + <_> + 9 6 2 5 -1. + <_> + 9 6 1 5 2. + <_> + + <_> + 7 5 3 8 -1. + <_> + 8 5 1 8 3. + <_> + + <_> + 9 6 3 4 -1. + <_> + 10 6 1 4 3. + <_> + + <_> + 4 13 3 2 -1. + <_> + 4 14 3 1 2. + <_> + + <_> + 9 4 6 3 -1. + <_> + 11 4 2 3 3. + <_> + + <_> + 5 4 6 3 -1. + <_> + 7 4 2 3 3. + <_> + + <_> + 14 11 5 2 -1. + <_> + 14 12 5 1 2. + <_> + + <_> + 1 2 6 9 -1. + <_> + 3 2 2 9 3. + <_> + + <_> + 14 6 6 13 -1. + <_> + 14 6 3 13 2. + <_> + + <_> + 3 6 14 8 -1. + <_> + 3 6 7 4 2. + <_> + 10 10 7 4 2. + <_> + + <_> + 16 0 4 11 -1. + <_> + 16 0 2 11 2. + <_> + + <_> + 3 4 12 12 -1. + <_> + 3 4 6 6 2. + <_> + 9 10 6 6 2. + <_> + + <_> + 11 4 5 3 -1. + <_> + 11 5 5 1 3. + <_> + + <_> + 4 11 4 2 -1. + <_> + 4 12 4 1 2. + <_> + + <_> + 10 7 2 2 -1. + <_> + 10 7 1 2 2. + <_> + + <_> + 8 7 2 2 -1. + <_> + 9 7 1 2 2. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 5 6 3 3 -1. + <_> + 5 7 3 1 3. + <_> + + <_> + 10 0 3 3 -1. + <_> + 11 0 1 3 3. + <_> + + <_> + 5 6 6 2 -1. + <_> + 5 6 3 1 2. + <_> + 8 7 3 1 2. + <_> + + <_> + 12 16 4 3 -1. + <_> + 12 17 4 1 3. + <_> + + <_> + 3 12 3 2 -1. + <_> + 3 13 3 1 2. + <_> + + <_> + 9 12 3 2 -1. + <_> + 9 13 3 1 2. + <_> + + <_> + 1 11 16 4 -1. + <_> + 1 11 8 2 2. + <_> + 9 13 8 2 2. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 4 4 5 3 -1. + <_> + 4 5 5 1 3. + <_> + + <_> + 12 16 4 3 -1. + <_> + 12 17 4 1 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 9 0 2 2 -1. + <_> + 9 1 2 1 2. + <_> + + <_> + 8 9 4 2 -1. + <_> + 8 10 4 1 2. + <_> + + <_> + 8 8 4 3 -1. + <_> + 8 9 4 1 3. + <_> + + <_> + 0 13 6 3 -1. + <_> + 2 13 2 3 3. + <_> + + <_> + 16 14 3 2 -1. + <_> + 16 15 3 1 2. + <_> + + <_> + 1 18 18 2 -1. + <_> + 7 18 6 2 3. + <_> + + <_> + 16 14 3 2 -1. + <_> + 16 15 3 1 2. + <_> + + <_> + 1 14 3 2 -1. + <_> + 1 15 3 1 2. + <_> + + <_> + 7 14 6 3 -1. + <_> + 7 15 6 1 3. + <_> + + <_> + 5 14 8 3 -1. + <_> + 5 15 8 1 3. + <_> + + <_> + 10 6 4 14 -1. + <_> + 10 6 2 14 2. + <_> + + <_> + 6 6 4 14 -1. + <_> + 8 6 2 14 2. + <_> + + <_> + 13 5 2 3 -1. + <_> + 13 6 2 1 3. + <_> + + <_> + 7 16 6 1 -1. + <_> + 9 16 2 1 3. + <_> + + <_> + 9 12 3 3 -1. + <_> + 9 13 3 1 3. + <_> + + <_> + 7 0 3 3 -1. + <_> + 8 0 1 3 3. + <_> + + <_> + 4 0 16 18 -1. + <_> + 4 9 16 9 2. + <_> + + <_> + 1 1 16 14 -1. + <_> + 1 8 16 7 2. + <_> + + <_> + 3 9 15 4 -1. + <_> + 8 9 5 4 3. + <_> + + <_> + 6 12 7 3 -1. + <_> + 6 13 7 1 3. + <_> + + <_> + 14 15 2 3 -1. + <_> + 14 16 2 1 3. + <_> + + <_> + 2 3 16 14 -1. + <_> + 2 3 8 7 2. + <_> + 10 10 8 7 2. + <_> + + <_> + 16 2 4 18 -1. + <_> + 18 2 2 9 2. + <_> + 16 11 2 9 2. + <_> + + <_> + 4 15 2 3 -1. + <_> + 4 16 2 1 3. + <_> + + <_> + 16 2 4 18 -1. + <_> + 18 2 2 9 2. + <_> + 16 11 2 9 2. + <_> + + <_> + 1 1 8 3 -1. + <_> + 1 2 8 1 3. + <_> + + <_> + 8 11 4 3 -1. + <_> + 8 12 4 1 3. + <_> + + <_> + 5 11 5 9 -1. + <_> + 5 14 5 3 3. + <_> + + <_> + 16 0 4 11 -1. + <_> + 16 0 2 11 2. + <_> + + <_> + 7 0 6 1 -1. + <_> + 9 0 2 1 3. + <_> + + <_> + 16 3 3 7 -1. + <_> + 17 3 1 7 3. + <_> + + <_> + 1 3 3 7 -1. + <_> + 2 3 1 7 3. + <_> + + <_> + 7 8 6 12 -1. + <_> + 7 12 6 4 3. + <_> + + <_> + 0 0 4 11 -1. + <_> + 2 0 2 11 2. + <_> + + <_> + 14 0 6 20 -1. + <_> + 14 0 3 20 2. + <_> + + <_> + 0 3 1 2 -1. + <_> + 0 4 1 1 2. + <_> + + <_> + 5 5 10 8 -1. + <_> + 10 5 5 4 2. + <_> + 5 9 5 4 2. + <_> + + <_> + 4 7 12 4 -1. + <_> + 4 7 6 2 2. + <_> + 10 9 6 2 2. + <_> + + <_> + 2 1 6 4 -1. + <_> + 5 1 3 4 2. + <_> + + <_> + 9 7 6 4 -1. + <_> + 12 7 3 2 2. + <_> + 9 9 3 2 2. + <_> + + <_> + 5 6 2 6 -1. + <_> + 5 9 2 3 2. + <_> + + <_> + 9 16 6 4 -1. + <_> + 12 16 3 2 2. + <_> + 9 18 3 2 2. + <_> + + <_> + 9 4 2 12 -1. + <_> + 9 10 2 6 2. + <_> + + <_> + 7 1 6 18 -1. + <_> + 9 1 2 18 3. + <_> + + <_> + 4 12 12 2 -1. + <_> + 8 12 4 2 3. + <_> + + <_> + 8 8 6 2 -1. + <_> + 8 9 6 1 2. + <_> + + <_> + 8 0 3 6 -1. + <_> + 9 0 1 6 3. + <_> + + <_> + 11 18 3 2 -1. + <_> + 11 19 3 1 2. + <_> + + <_> + 1 1 17 4 -1. + <_> + 1 3 17 2 2. + <_> + + <_> + 11 8 4 12 -1. + <_> + 11 8 2 12 2. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 12 3 2 17 -1. + <_> + 12 3 1 17 2. + <_> + + <_> + 4 7 6 1 -1. + <_> + 6 7 2 1 3. + <_> + + <_> + 18 3 2 3 -1. + <_> + 18 4 2 1 3. + <_> + + <_> + 8 4 3 4 -1. + <_> + 8 6 3 2 2. + <_> + + <_> + 4 5 12 10 -1. + <_> + 4 10 12 5 2. + <_> + + <_> + 5 18 4 2 -1. + <_> + 7 18 2 2 2. + <_> + + <_> + 17 2 3 6 -1. + <_> + 17 4 3 2 3. + <_> + + <_> + 7 7 6 6 -1. + <_> + 9 7 2 6 3. + <_> + + <_> + 17 2 3 6 -1. + <_> + 17 4 3 2 3. + <_> + + <_> + 8 0 3 4 -1. + <_> + 9 0 1 4 3. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 0 12 6 3 -1. + <_> + 0 13 6 1 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 3 12 2 3 -1. + <_> + 3 13 2 1 3. + <_> + + <_> + 5 6 12 7 -1. + <_> + 9 6 4 7 3. + <_> + + <_> + 0 2 3 6 -1. + <_> + 0 4 3 2 3. + <_> + + <_> + 14 6 1 3 -1. + <_> + 14 7 1 1 3. + <_> + + <_> + 2 0 3 14 -1. + <_> + 3 0 1 14 3. + <_> + + <_> + 12 14 5 6 -1. + <_> + 12 16 5 2 3. + <_> + + <_> + 4 14 5 6 -1. + <_> + 4 16 5 2 3. + <_> + + <_> + 11 10 2 2 -1. + <_> + 12 10 1 1 2. + <_> + 11 11 1 1 2. + <_> + + <_> + 5 0 3 14 -1. + <_> + 6 0 1 14 3. + <_> + + <_> + 10 15 2 3 -1. + <_> + 10 16 2 1 3. + <_> + + <_> + 0 2 2 3 -1. + <_> + 0 3 2 1 3. + <_> + + <_> + 5 11 12 6 -1. + <_> + 5 14 12 3 2. + <_> + + <_> + 6 11 3 9 -1. + <_> + 6 14 3 3 3. + <_> + + <_> + 11 10 2 2 -1. + <_> + 12 10 1 1 2. + <_> + 11 11 1 1 2. + <_> + + <_> + 5 6 1 3 -1. + <_> + 5 7 1 1 3. + <_> + + <_> + 4 9 13 3 -1. + <_> + 4 10 13 1 3. + <_> + + <_> + 1 7 15 6 -1. + <_> + 6 7 5 6 3. + <_> + + <_> + 4 5 12 6 -1. + <_> + 8 5 4 6 3. + <_> + + <_> + 8 10 4 3 -1. + <_> + 8 11 4 1 3. + <_> + + <_> + 15 14 1 3 -1. + <_> + 15 15 1 1 3. + <_> + + <_> + 1 11 5 3 -1. + <_> + 1 12 5 1 3. + <_> + + <_> + 7 1 7 12 -1. + <_> + 7 7 7 6 2. + <_> + + <_> + 0 1 6 10 -1. + <_> + 0 1 3 5 2. + <_> + 3 6 3 5 2. + <_> + + <_> + 16 1 4 3 -1. + <_> + 16 2 4 1 3. + <_> + + <_> + 5 5 2 3 -1. + <_> + 5 6 2 1 3. + <_> + + <_> + 12 2 3 5 -1. + <_> + 13 2 1 5 3. + <_> + + <_> + 0 3 4 6 -1. + <_> + 0 5 4 2 3. + <_> + + <_> + 8 12 4 2 -1. + <_> + 8 13 4 1 2. + <_> + + <_> + 8 18 3 1 -1. + <_> + 9 18 1 1 3. + <_> + + <_> + 11 10 2 2 -1. + <_> + 12 10 1 1 2. + <_> + 11 11 1 1 2. + <_> + + <_> + 7 10 2 2 -1. + <_> + 7 10 1 1 2. + <_> + 8 11 1 1 2. + <_> + + <_> + 11 11 4 4 -1. + <_> + 11 13 4 2 2. + <_> + + <_> + 8 12 3 8 -1. + <_> + 9 12 1 8 3. + <_> + + <_> + 13 0 6 3 -1. + <_> + 13 1 6 1 3. + <_> + + <_> + 8 8 3 4 -1. + <_> + 9 8 1 4 3. + <_> + + <_> + 5 7 10 10 -1. + <_> + 10 7 5 5 2. + <_> + 5 12 5 5 2. + <_> + + <_> + 3 18 8 2 -1. + <_> + 3 18 4 1 2. + <_> + 7 19 4 1 2. + <_> + + <_> + 10 2 6 8 -1. + <_> + 12 2 2 8 3. + <_> + + <_> + 4 2 6 8 -1. + <_> + 6 2 2 8 3. + <_> + + <_> + 11 0 3 7 -1. + <_> + 12 0 1 7 3. + <_> + + <_> + 7 11 2 1 -1. + <_> + 8 11 1 1 2. + <_> + + <_> + 15 14 1 3 -1. + <_> + 15 15 1 1 3. + <_> + + <_> + 7 15 2 2 -1. + <_> + 7 15 1 1 2. + <_> + 8 16 1 1 2. + <_> + + <_> + 15 14 1 3 -1. + <_> + 15 15 1 1 3. + <_> + + <_> + 6 0 3 7 -1. + <_> + 7 0 1 7 3. + <_> + + <_> + 18 1 2 7 -1. + <_> + 18 1 1 7 2. + <_> + + <_> + 2 0 8 20 -1. + <_> + 2 10 8 10 2. + <_> + + <_> + 3 0 15 6 -1. + <_> + 3 2 15 2 3. + <_> + + <_> + 4 3 12 2 -1. + <_> + 4 4 12 1 2. + <_> + + <_> + 16 0 4 5 -1. + <_> + 16 0 2 5 2. + <_> + + <_> + 7 0 3 4 -1. + <_> + 8 0 1 4 3. + <_> + + <_> + 16 0 4 5 -1. + <_> + 16 0 2 5 2. + <_> + + <_> + 1 7 6 13 -1. + <_> + 3 7 2 13 3. + <_> + + <_> + 16 0 4 5 -1. + <_> + 16 0 2 5 2. + <_> + + <_> + 0 0 4 5 -1. + <_> + 2 0 2 5 2. + <_> + + <_> + 14 12 3 6 -1. + <_> + 14 14 3 2 3. + <_> + + <_> + 3 12 3 6 -1. + <_> + 3 14 3 2 3. + <_> + + <_> + 16 1 4 3 -1. + <_> + 16 2 4 1 3. + <_> + + <_> + 8 7 2 10 -1. + <_> + 8 7 1 5 2. + <_> + 9 12 1 5 2. + <_> + + <_> + 11 11 4 4 -1. + <_> + 11 13 4 2 2. + <_> + + <_> + 0 1 4 3 -1. + <_> + 0 2 4 1 3. + <_> + + <_> + 13 4 1 3 -1. + <_> + 13 5 1 1 3. + <_> + + <_> + 7 15 3 5 -1. + <_> + 8 15 1 5 3. + <_> + + <_> + 9 7 3 5 -1. + <_> + 10 7 1 5 3. + <_> + + <_> + 8 7 3 5 -1. + <_> + 9 7 1 5 3. + <_> + + <_> + 10 6 4 14 -1. + <_> + 10 6 2 14 2. + <_> + + <_> + 0 5 5 6 -1. + <_> + 0 7 5 2 3. + <_> + + <_> + 9 5 6 4 -1. + <_> + 9 5 3 4 2. + <_> + + <_> + 0 0 18 10 -1. + <_> + 6 0 6 10 3. + <_> + + <_> + 10 6 4 14 -1. + <_> + 10 6 2 14 2. + <_> + + <_> + 6 6 4 14 -1. + <_> + 8 6 2 14 2. + <_> + + <_> + 13 4 1 3 -1. + <_> + 13 5 1 1 3. + <_> + + <_> + 5 1 2 3 -1. + <_> + 6 1 1 3 2. + <_> + + <_> + 18 1 2 18 -1. + <_> + 19 1 1 9 2. + <_> + 18 10 1 9 2. + <_> + + <_> + 2 1 4 3 -1. + <_> + 2 2 4 1 3. + <_> + + <_> + 18 1 2 18 -1. + <_> + 19 1 1 9 2. + <_> + 18 10 1 9 2. + <_> + + <_> + 1 14 4 6 -1. + <_> + 1 14 2 3 2. + <_> + 3 17 2 3 2. + <_> + + <_> + 10 11 7 6 -1. + <_> + 10 13 7 2 3. + <_> + + <_> + 0 10 6 10 -1. + <_> + 0 10 3 5 2. + <_> + 3 15 3 5 2. + <_> + + <_> + 11 0 3 4 -1. + <_> + 12 0 1 4 3. + <_> + + <_> + 5 10 5 6 -1. + <_> + 5 13 5 3 2. + <_> + + <_> + 14 6 1 8 -1. + <_> + 14 10 1 4 2. + <_> + + <_> + 1 7 18 6 -1. + <_> + 1 7 9 3 2. + <_> + 10 10 9 3 2. + <_> + + <_> + 9 7 2 2 -1. + <_> + 9 7 1 2 2. + <_> + + <_> + 5 9 4 5 -1. + <_> + 7 9 2 5 2. + <_> + + <_> + 7 6 6 3 -1. + <_> + 9 6 2 3 3. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 7 15 2 4 -1. + <_> + 7 17 2 2 2. + <_> + + <_> + 1 0 19 9 -1. + <_> + 1 3 19 3 3. + <_> + + <_> + 3 7 3 6 -1. + <_> + 3 9 3 2 3. + <_> + + <_> + 13 7 4 4 -1. + <_> + 15 7 2 2 2. + <_> + 13 9 2 2 2. + <_> + + <_> + 3 7 4 4 -1. + <_> + 3 7 2 2 2. + <_> + 5 9 2 2 2. + <_> + + <_> + 9 6 10 8 -1. + <_> + 9 10 10 4 2. + <_> + + <_> + 3 8 14 12 -1. + <_> + 3 14 14 6 2. + <_> + + <_> + 6 5 10 12 -1. + <_> + 11 5 5 6 2. + <_> + 6 11 5 6 2. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 9 5 6 5 -1. + <_> + 9 5 3 5 2. + <_> + + <_> + 9 4 2 4 -1. + <_> + 9 6 2 2 2. + <_> + + <_> + 9 5 6 5 -1. + <_> + 9 5 3 5 2. + <_> + + <_> + 5 5 6 5 -1. + <_> + 8 5 3 5 2. + <_> + + <_> + 11 2 6 1 -1. + <_> + 13 2 2 1 3. + <_> + + <_> + 3 2 6 1 -1. + <_> + 5 2 2 1 3. + <_> + + <_> + 13 5 2 3 -1. + <_> + 13 6 2 1 3. + <_> + + <_> + 0 10 1 4 -1. + <_> + 0 12 1 2 2. + <_> + + <_> + 13 5 2 3 -1. + <_> + 13 6 2 1 3. + <_> + + <_> + 8 18 3 2 -1. + <_> + 9 18 1 2 3. + <_> + + <_> + 6 15 9 2 -1. + <_> + 6 16 9 1 2. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 18 4 2 4 -1. + <_> + 18 6 2 2 2. + <_> + + <_> + 5 5 2 3 -1. + <_> + 5 6 2 1 3. + <_> + + <_> + 15 16 3 2 -1. + <_> + 15 17 3 1 2. + <_> + + <_> + 0 0 3 9 -1. + <_> + 0 3 3 3 3. + <_> + + <_> + 9 7 3 3 -1. + <_> + 9 8 3 1 3. + <_> + + <_> + 8 7 3 3 -1. + <_> + 8 8 3 1 3. + <_> + + <_> + 9 5 2 6 -1. + <_> + 9 5 1 6 2. + <_> + + <_> + 8 6 3 4 -1. + <_> + 9 6 1 4 3. + <_> + + <_> + 7 6 8 12 -1. + <_> + 11 6 4 6 2. + <_> + 7 12 4 6 2. + <_> + + <_> + 5 6 8 12 -1. + <_> + 5 6 4 6 2. + <_> + 9 12 4 6 2. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 2 16 3 2 -1. + <_> + 2 17 3 1 2. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 2 12 6 6 -1. + <_> + 2 14 6 2 3. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 6 14 6 3 -1. + <_> + 6 15 6 1 3. + <_> + + <_> + 14 15 5 3 -1. + <_> + 14 16 5 1 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 14 15 5 3 -1. + <_> + 14 16 5 1 3. + <_> + + <_> + 5 3 6 2 -1. + <_> + 7 3 2 2 3. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 1 15 5 3 -1. + <_> + 1 16 5 1 3. + <_> + + <_> + 8 13 4 6 -1. + <_> + 10 13 2 3 2. + <_> + 8 16 2 3 2. + <_> + + <_> + 7 8 3 3 -1. + <_> + 8 8 1 3 3. + <_> + + <_> + 12 0 5 4 -1. + <_> + 12 2 5 2 2. + <_> + + <_> + 0 2 20 2 -1. + <_> + 0 2 10 1 2. + <_> + 10 3 10 1 2. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 4 3 6 1 -1. + <_> + 6 3 2 1 3. + <_> + + <_> + 4 18 13 2 -1. + <_> + 4 19 13 1 2. + <_> + + <_> + 2 10 3 6 -1. + <_> + 2 12 3 2 3. + <_> + + <_> + 14 12 6 8 -1. + <_> + 17 12 3 4 2. + <_> + 14 16 3 4 2. + <_> + + <_> + 4 13 10 6 -1. + <_> + 4 13 5 3 2. + <_> + 9 16 5 3 2. + <_> + + <_> + 14 12 1 2 -1. + <_> + 14 13 1 1 2. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 14 12 2 2 -1. + <_> + 14 13 2 1 2. + <_> + + <_> + 4 12 2 2 -1. + <_> + 4 13 2 1 2. + <_> + + <_> + 8 12 9 2 -1. + <_> + 8 13 9 1 2. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 11 10 3 6 -1. + <_> + 11 13 3 3 2. + <_> + + <_> + 5 6 9 12 -1. + <_> + 5 12 9 6 2. + <_> + + <_> + 11 10 3 6 -1. + <_> + 11 13 3 3 2. + <_> + + <_> + 6 10 3 6 -1. + <_> + 6 13 3 3 2. + <_> + + <_> + 5 4 11 3 -1. + <_> + 5 5 11 1 3. + <_> + + <_> + 7 1 5 10 -1. + <_> + 7 6 5 5 2. + <_> + + <_> + 2 8 18 2 -1. + <_> + 2 9 18 1 2. + <_> + + <_> + 7 17 5 3 -1. + <_> + 7 18 5 1 3. + <_> + + <_> + 5 9 12 1 -1. + <_> + 9 9 4 1 3. + <_> + + <_> + 0 14 6 6 -1. + <_> + 0 14 3 3 2. + <_> + 3 17 3 3 2. + <_> + + <_> + 5 9 12 1 -1. + <_> + 9 9 4 1 3. + <_> + + <_> + 3 9 12 1 -1. + <_> + 7 9 4 1 3. + <_> + + <_> + 14 10 6 7 -1. + <_> + 14 10 3 7 2. + <_> + + <_> + 1 0 16 2 -1. + <_> + 1 1 16 1 2. + <_> + + <_> + 10 9 10 9 -1. + <_> + 10 12 10 3 3. + <_> + + <_> + 0 1 10 2 -1. + <_> + 5 1 5 2 2. + <_> + + <_> + 17 3 2 3 -1. + <_> + 17 4 2 1 3. + <_> + + <_> + 1 3 2 3 -1. + <_> + 1 4 2 1 3. + <_> + + <_> + 9 7 3 6 -1. + <_> + 10 7 1 6 3. + <_> + + <_> + 6 5 4 3 -1. + <_> + 8 5 2 3 2. + <_> + + <_> + 7 5 6 6 -1. + <_> + 9 5 2 6 3. + <_> + + <_> + 3 4 12 12 -1. + <_> + 3 4 6 6 2. + <_> + 9 10 6 6 2. + <_> + + <_> + 9 2 6 15 -1. + <_> + 11 2 2 15 3. + <_> + + <_> + 2 2 6 17 -1. + <_> + 4 2 2 17 3. + <_> + + <_> + 14 10 6 7 -1. + <_> + 14 10 3 7 2. + <_> + + <_> + 0 10 6 7 -1. + <_> + 3 10 3 7 2. + <_> + + <_> + 9 2 6 15 -1. + <_> + 11 2 2 15 3. + <_> + + <_> + 5 2 6 15 -1. + <_> + 7 2 2 15 3. + <_> + + <_> + 17 9 3 6 -1. + <_> + 17 11 3 2 3. + <_> + + <_> + 6 7 6 6 -1. + <_> + 8 7 2 6 3. + <_> + + <_> + 1 10 18 6 -1. + <_> + 10 10 9 3 2. + <_> + 1 13 9 3 2. + <_> + + <_> + 0 9 10 9 -1. + <_> + 0 12 10 3 3. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 5 12 3 4 -1. + <_> + 5 14 3 2 2. + <_> + + <_> + 3 3 16 12 -1. + <_> + 3 9 16 6 2. + <_> + + <_> + 1 1 12 12 -1. + <_> + 1 1 6 6 2. + <_> + 7 7 6 6 2. + <_> + + <_> + 10 4 2 4 -1. + <_> + 11 4 1 2 2. + <_> + 10 6 1 2 2. + <_> + + <_> + 0 9 10 2 -1. + <_> + 0 9 5 1 2. + <_> + 5 10 5 1 2. + <_> + + <_> + 9 11 3 3 -1. + <_> + 9 12 3 1 3. + <_> + + <_> + 3 12 9 2 -1. + <_> + 3 13 9 1 2. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 3 4 13 6 -1. + <_> + 3 6 13 2 3. + <_> + + <_> + 9 7 6 4 -1. + <_> + 12 7 3 2 2. + <_> + 9 9 3 2 2. + <_> + + <_> + 1 0 6 8 -1. + <_> + 4 0 3 8 2. + <_> + + <_> + 9 5 2 12 -1. + <_> + 9 11 2 6 2. + <_> + + <_> + 4 4 3 10 -1. + <_> + 4 9 3 5 2. + <_> + + <_> + 6 17 8 3 -1. + <_> + 6 18 8 1 3. + <_> + + <_> + 0 5 10 6 -1. + <_> + 0 7 10 2 3. + <_> + + <_> + 13 2 3 2 -1. + <_> + 13 3 3 1 2. + <_> + + <_> + 7 5 4 5 -1. + <_> + 9 5 2 5 2. + <_> + + <_> + 12 14 3 6 -1. + <_> + 12 16 3 2 3. + <_> + + <_> + 1 11 8 2 -1. + <_> + 1 12 8 1 2. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 0 5 3 6 -1. + <_> + 0 7 3 2 3. + <_> + + <_> + 13 2 3 2 -1. + <_> + 13 3 3 1 2. + <_> + + <_> + 4 14 4 6 -1. + <_> + 4 14 2 3 2. + <_> + 6 17 2 3 2. + <_> + + <_> + 13 2 3 2 -1. + <_> + 13 3 3 1 2. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 14 0 6 8 -1. + <_> + 17 0 3 4 2. + <_> + 14 4 3 4 2. + <_> + + <_> + 7 17 3 2 -1. + <_> + 8 17 1 2 3. + <_> + + <_> + 8 12 4 2 -1. + <_> + 8 13 4 1 2. + <_> + + <_> + 6 0 8 12 -1. + <_> + 6 0 4 6 2. + <_> + 10 6 4 6 2. + <_> + + <_> + 14 0 2 10 -1. + <_> + 15 0 1 5 2. + <_> + 14 5 1 5 2. + <_> + + <_> + 5 3 8 6 -1. + <_> + 5 3 4 3 2. + <_> + 9 6 4 3 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 9 14 1 2 -1. + <_> + 9 15 1 1 2. + <_> + + <_> + 15 10 4 3 -1. + <_> + 15 11 4 1 3. + <_> + + <_> + 8 14 2 3 -1. + <_> + 8 15 2 1 3. + <_> + + <_> + 3 13 14 4 -1. + <_> + 10 13 7 2 2. + <_> + 3 15 7 2 2. + <_> + + <_> + 1 10 4 3 -1. + <_> + 1 11 4 1 3. + <_> + + <_> + 9 11 6 1 -1. + <_> + 11 11 2 1 3. + <_> + + <_> + 5 11 6 1 -1. + <_> + 7 11 2 1 3. + <_> + + <_> + 3 5 16 15 -1. + <_> + 3 10 16 5 3. + <_> + + <_> + 6 12 4 2 -1. + <_> + 8 12 2 2 2. + <_> + + <_> + 4 4 12 10 -1. + <_> + 10 4 6 5 2. + <_> + 4 9 6 5 2. + <_> + + <_> + 8 6 3 4 -1. + <_> + 9 6 1 4 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 10 12 2 4 2. + <_> + 8 16 2 4 2. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 12 2 3 2 -1. + <_> + 13 2 1 2 3. + <_> + + <_> + 8 15 3 2 -1. + <_> + 8 16 3 1 2. + <_> + + <_> + 6 0 9 14 -1. + <_> + 9 0 3 14 3. + <_> + + <_> + 9 6 2 3 -1. + <_> + 10 6 1 3 2. + <_> + + <_> + 10 8 2 3 -1. + <_> + 10 9 2 1 3. + <_> + + <_> + 0 9 4 6 -1. + <_> + 0 11 4 2 3. + <_> + + <_> + 6 0 8 2 -1. + <_> + 6 1 8 1 2. + <_> + + <_> + 6 14 7 3 -1. + <_> + 6 15 7 1 3. + <_> + + <_> + 8 10 8 9 -1. + <_> + 8 13 8 3 3. + <_> + + <_> + 5 2 3 2 -1. + <_> + 6 2 1 2 3. + <_> + + <_> + 14 1 6 8 -1. + <_> + 17 1 3 4 2. + <_> + 14 5 3 4 2. + <_> + + <_> + 0 1 6 8 -1. + <_> + 0 1 3 4 2. + <_> + 3 5 3 4 2. + <_> + + <_> + 1 2 18 6 -1. + <_> + 10 2 9 3 2. + <_> + 1 5 9 3 2. + <_> + + <_> + 9 3 2 1 -1. + <_> + 10 3 1 1 2. + <_> + + <_> + 13 2 4 6 -1. + <_> + 15 2 2 3 2. + <_> + 13 5 2 3 2. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 13 5 1 3 -1. + <_> + 13 6 1 1 3. + <_> + + <_> + 2 16 5 3 -1. + <_> + 2 17 5 1 3. + <_> + + <_> + 13 2 4 6 -1. + <_> + 15 2 2 3 2. + <_> + 13 5 2 3 2. + <_> + + <_> + 3 2 4 6 -1. + <_> + 3 2 2 3 2. + <_> + 5 5 2 3 2. + <_> + + <_> + 13 5 1 2 -1. + <_> + 13 6 1 1 2. + <_> + + <_> + 5 5 2 2 -1. + <_> + 5 6 2 1 2. + <_> + + <_> + 13 9 2 2 -1. + <_> + 13 9 1 2 2. + <_> + + <_> + 5 9 2 2 -1. + <_> + 6 9 1 2 2. + <_> + + <_> + 13 17 3 2 -1. + <_> + 13 18 3 1 2. + <_> + + <_> + 6 16 4 4 -1. + <_> + 6 16 2 2 2. + <_> + 8 18 2 2 2. + <_> + + <_> + 9 16 2 3 -1. + <_> + 9 17 2 1 3. + <_> + + <_> + 0 13 9 6 -1. + <_> + 0 15 9 2 3. + <_> + + <_> + 9 14 2 6 -1. + <_> + 9 17 2 3 2. + <_> + + <_> + 9 15 2 3 -1. + <_> + 9 16 2 1 3. + <_> + + <_> + 1 10 18 6 -1. + <_> + 1 12 18 2 3. + <_> + + <_> + 8 11 4 2 -1. + <_> + 8 12 4 1 2. + <_> + + <_> + 7 9 6 2 -1. + <_> + 7 10 6 1 2. + <_> + + <_> + 8 8 2 3 -1. + <_> + 8 9 2 1 3. + <_> + + <_> + 17 5 3 4 -1. + <_> + 18 5 1 4 3. + <_> + + <_> + 1 19 18 1 -1. + <_> + 7 19 6 1 3. + <_> + + <_> + 9 0 3 2 -1. + <_> + 10 0 1 2 3. + <_> + + <_> + 1 8 1 6 -1. + <_> + 1 10 1 2 3. + <_> + + <_> + 12 17 8 3 -1. + <_> + 12 17 4 3 2. + <_> + + <_> + 0 5 3 4 -1. + <_> + 1 5 1 4 3. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 7 11 2 2 -1. + <_> + 7 11 1 1 2. + <_> + 8 12 1 1 2. + <_> + + <_> + 11 3 2 5 -1. + <_> + 11 3 1 5 2. + <_> + + <_> + 7 3 2 5 -1. + <_> + 8 3 1 5 2. + <_> + + <_> + 15 13 2 3 -1. + <_> + 15 14 2 1 3. + <_> + + <_> + 5 6 2 3 -1. + <_> + 5 7 2 1 3. + <_> + + <_> + 4 19 15 1 -1. + <_> + 9 19 5 1 3. + <_> + + <_> + 1 19 15 1 -1. + <_> + 6 19 5 1 3. + <_> + + <_> + 15 13 2 3 -1. + <_> + 15 14 2 1 3. + <_> + + <_> + 5 0 4 15 -1. + <_> + 7 0 2 15 2. + <_> + + <_> + 9 6 2 5 -1. + <_> + 9 6 1 5 2. + <_> + + <_> + 9 5 2 7 -1. + <_> + 10 5 1 7 2. + <_> + + <_> + 16 11 3 3 -1. + <_> + 16 12 3 1 3. + <_> + + <_> + 1 11 3 3 -1. + <_> + 1 12 3 1 3. + <_> + + <_> + 6 6 8 3 -1. + <_> + 6 7 8 1 3. + <_> + + <_> + 0 15 6 2 -1. + <_> + 0 16 6 1 2. + <_> + + <_> + 1 0 18 6 -1. + <_> + 7 0 6 6 3. + <_> + + <_> + 6 0 3 4 -1. + <_> + 7 0 1 4 3. + <_> + + <_> + 14 10 4 10 -1. + <_> + 16 10 2 5 2. + <_> + 14 15 2 5 2. + <_> + + <_> + 3 2 3 2 -1. + <_> + 4 2 1 2 3. + <_> + + <_> + 11 2 2 2 -1. + <_> + 11 3 2 1 2. + <_> + + <_> + 2 10 4 10 -1. + <_> + 2 10 2 5 2. + <_> + 4 15 2 5 2. + <_> + + <_> + 0 13 20 6 -1. + <_> + 10 13 10 3 2. + <_> + 0 16 10 3 2. + <_> + + <_> + 0 5 2 15 -1. + <_> + 1 5 1 15 2. + <_> + + <_> + 1 7 18 4 -1. + <_> + 10 7 9 2 2. + <_> + 1 9 9 2 2. + <_> + + <_> + 0 0 2 17 -1. + <_> + 1 0 1 17 2. + <_> + + <_> + 2 6 16 6 -1. + <_> + 10 6 8 3 2. + <_> + 2 9 8 3 2. + <_> + + <_> + 8 14 1 3 -1. + <_> + 8 15 1 1 3. + <_> + + <_> + 8 15 4 2 -1. + <_> + 8 16 4 1 2. + <_> + + <_> + 5 2 8 2 -1. + <_> + 5 2 4 1 2. + <_> + 9 3 4 1 2. + <_> + + <_> + 6 11 8 6 -1. + <_> + 6 14 8 3 2. + <_> + + <_> + 9 13 2 2 -1. + <_> + 9 14 2 1 2. + <_> + + <_> + 18 4 2 6 -1. + <_> + 18 6 2 2 3. + <_> + + <_> + 9 12 2 2 -1. + <_> + 9 13 2 1 2. + <_> + + <_> + 18 4 2 6 -1. + <_> + 18 6 2 2 3. + <_> + + <_> + 9 13 1 3 -1. + <_> + 9 14 1 1 3. + <_> + + <_> + 18 4 2 6 -1. + <_> + 18 6 2 2 3. + <_> + + <_> + 0 4 2 6 -1. + <_> + 0 6 2 2 3. + <_> + + <_> + 9 12 3 3 -1. + <_> + 9 13 3 1 3. + <_> + + <_> + 3 13 2 3 -1. + <_> + 3 14 2 1 3. + <_> + + <_> + 13 13 4 3 -1. + <_> + 13 14 4 1 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 5 2 10 6 -1. + <_> + 5 4 10 2 3. + <_> + + <_> + 3 13 4 3 -1. + <_> + 3 14 4 1 3. + <_> + + <_> + 3 7 15 5 -1. + <_> + 8 7 5 5 3. + <_> + + <_> + 3 7 12 2 -1. + <_> + 7 7 4 2 3. + <_> + + <_> + 10 3 3 9 -1. + <_> + 11 3 1 9 3. + <_> + + <_> + 8 6 4 6 -1. + <_> + 10 6 2 6 2. + <_> + + <_> + 9 7 4 3 -1. + <_> + 9 8 4 1 3. + <_> + + <_> + 0 9 4 9 -1. + <_> + 2 9 2 9 2. + <_> + + <_> + 9 13 3 5 -1. + <_> + 10 13 1 5 3. + <_> + + <_> + 7 7 6 3 -1. + <_> + 9 7 2 3 3. + <_> + + <_> + 9 7 3 5 -1. + <_> + 10 7 1 5 3. + <_> + + <_> + 5 7 8 2 -1. + <_> + 9 7 4 2 2. + <_> + + <_> + 5 9 12 2 -1. + <_> + 9 9 4 2 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 10 6 5 3 2. + <_> + + <_> + 10 12 3 1 -1. + <_> + 11 12 1 1 3. + <_> + + <_> + 0 1 11 15 -1. + <_> + 0 6 11 5 3. + <_> + + <_> + 1 0 18 6 -1. + <_> + 7 0 6 6 3. + <_> + + <_> + 7 7 6 1 -1. + <_> + 9 7 2 1 3. + <_> + + <_> + 5 16 6 4 -1. + <_> + 5 16 3 2 2. + <_> + 8 18 3 2 2. + <_> + + <_> + 6 5 9 8 -1. + <_> + 6 9 9 4 2. + <_> + + <_> + 5 10 2 6 -1. + <_> + 5 13 2 3 2. + <_> + + <_> + 7 6 8 10 -1. + <_> + 11 6 4 5 2. + <_> + 7 11 4 5 2. + <_> + + <_> + 5 6 8 10 -1. + <_> + 5 6 4 5 2. + <_> + 9 11 4 5 2. + <_> + + <_> + 9 5 2 2 -1. + <_> + 9 6 2 1 2. + <_> + + <_> + 5 12 8 2 -1. + <_> + 5 13 8 1 2. + <_> + + <_> + 10 2 8 2 -1. + <_> + 10 3 8 1 2. + <_> + + <_> + 4 0 2 10 -1. + <_> + 4 0 1 5 2. + <_> + 5 5 1 5 2. + <_> + + <_> + 9 10 2 2 -1. + <_> + 9 11 2 1 2. + <_> + + <_> + 2 8 15 3 -1. + <_> + 2 9 15 1 3. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 7 2 3 2 -1. + <_> + 8 2 1 2 3. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 17 2 3 6 -1. + <_> + 17 4 3 2 3. + <_> + + <_> + 1 5 3 4 -1. + <_> + 2 5 1 4 3. + <_> + + <_> + 14 8 4 6 -1. + <_> + 14 10 4 2 3. + <_> + + <_> + 1 4 3 8 -1. + <_> + 2 4 1 8 3. + <_> + + <_> + 8 13 4 6 -1. + <_> + 8 16 4 3 2. + <_> + + <_> + 3 14 2 2 -1. + <_> + 3 15 2 1 2. + <_> + + <_> + 14 8 4 6 -1. + <_> + 14 10 4 2 3. + <_> + + <_> + 2 8 4 6 -1. + <_> + 2 10 4 2 3. + <_> + + <_> + 10 14 1 6 -1. + <_> + 10 17 1 3 2. + <_> + + <_> + 7 5 3 6 -1. + <_> + 8 5 1 6 3. + <_> + + <_> + 11 2 2 6 -1. + <_> + 12 2 1 3 2. + <_> + 11 5 1 3 2. + <_> + + <_> + 6 6 6 5 -1. + <_> + 8 6 2 5 3. + <_> + + <_> + 17 1 3 6 -1. + <_> + 17 3 3 2 3. + <_> + + <_> + 8 7 3 5 -1. + <_> + 9 7 1 5 3. + <_> + + <_> + 9 18 3 2 -1. + <_> + 10 18 1 2 3. + <_> + + <_> + 8 18 3 2 -1. + <_> + 9 18 1 2 3. + <_> + + <_> + 12 3 5 2 -1. + <_> + 12 4 5 1 2. + <_> + + <_> + 7 1 5 12 -1. + <_> + 7 7 5 6 2. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 4 2 2 2 -1. + <_> + 4 3 2 1 2. + <_> + + <_> + 11 14 4 2 -1. + <_> + 13 14 2 1 2. + <_> + 11 15 2 1 2. + <_> + + <_> + 0 2 3 6 -1. + <_> + 0 4 3 2 3. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 5 5 1 3 -1. + <_> + 5 6 1 1 3. + <_> + + <_> + 10 10 6 1 -1. + <_> + 10 10 3 1 2. + <_> + + <_> + 4 10 6 1 -1. + <_> + 7 10 3 1 2. + <_> + + <_> + 9 17 3 3 -1. + <_> + 9 18 3 1 3. + <_> + + <_> + 4 14 1 3 -1. + <_> + 4 15 1 1 3. + <_> + + <_> + 12 5 3 3 -1. + <_> + 12 6 3 1 3. + <_> + + <_> + 4 5 12 3 -1. + <_> + 4 6 12 1 3. + <_> + + <_> + 9 8 2 3 -1. + <_> + 9 9 2 1 3. + <_> + + <_> + 4 9 3 3 -1. + <_> + 5 9 1 3 3. + <_> + + <_> + 6 0 9 17 -1. + <_> + 9 0 3 17 3. + <_> + + <_> + 9 12 1 3 -1. + <_> + 9 13 1 1 3. + <_> + + <_> + 9 5 2 15 -1. + <_> + 9 10 2 5 3. + <_> + + <_> + 8 14 2 3 -1. + <_> + 8 15 2 1 3. + <_> + + <_> + 10 14 1 3 -1. + <_> + 10 15 1 1 3. + <_> + + <_> + 7 1 6 5 -1. + <_> + 9 1 2 5 3. + <_> + + <_> + 0 0 20 2 -1. + <_> + 0 0 10 2 2. + <_> + + <_> + 2 13 5 3 -1. + <_> + 2 14 5 1 3. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 2 5 9 15 -1. + <_> + 2 10 9 5 3. + <_> + + <_> + 5 0 12 10 -1. + <_> + 11 0 6 5 2. + <_> + 5 5 6 5 2. + <_> + + <_> + 5 1 2 3 -1. + <_> + 6 1 1 3 2. + <_> + + <_> + 10 7 6 1 -1. + <_> + 12 7 2 1 3. + <_> + + <_> + 3 1 2 10 -1. + <_> + 3 1 1 5 2. + <_> + 4 6 1 5 2. + <_> + + <_> + 13 7 2 1 -1. + <_> + 13 7 1 1 2. + <_> + + <_> + 4 13 4 6 -1. + <_> + 4 15 4 2 3. + <_> + + <_> + 13 7 2 1 -1. + <_> + 13 7 1 1 2. + <_> + + <_> + 5 7 2 1 -1. + <_> + 6 7 1 1 2. + <_> + + <_> + 2 12 18 4 -1. + <_> + 11 12 9 2 2. + <_> + 2 14 9 2 2. + <_> + + <_> + 5 7 2 2 -1. + <_> + 5 7 1 1 2. + <_> + 6 8 1 1 2. + <_> + + <_> + 16 3 4 2 -1. + <_> + 16 4 4 1 2. + <_> + + <_> + 0 2 2 18 -1. + <_> + 0 2 1 9 2. + <_> + 1 11 1 9 2. + <_> + + <_> + 1 2 18 4 -1. + <_> + 10 2 9 2 2. + <_> + 1 4 9 2 2. + <_> + + <_> + 9 14 1 3 -1. + <_> + 9 15 1 1 3. + <_> + + <_> + 2 12 18 4 -1. + <_> + 11 12 9 2 2. + <_> + 2 14 9 2 2. + <_> + + <_> + 0 12 18 4 -1. + <_> + 0 12 9 2 2. + <_> + 9 14 9 2 2. + <_> + + <_> + 11 4 5 3 -1. + <_> + 11 5 5 1 3. + <_> + + <_> + 6 4 7 3 -1. + <_> + 6 5 7 1 3. + <_> + + <_> + 13 17 3 3 -1. + <_> + 13 18 3 1 3. + <_> + + <_> + 8 1 3 4 -1. + <_> + 9 1 1 4 3. + <_> + + <_> + 11 4 2 4 -1. + <_> + 11 4 1 4 2. + <_> + + <_> + 0 17 9 3 -1. + <_> + 3 17 3 3 3. + <_> + + <_> + 11 0 2 8 -1. + <_> + 12 0 1 4 2. + <_> + 11 4 1 4 2. + <_> + + <_> + 0 8 6 12 -1. + <_> + 0 8 3 6 2. + <_> + 3 14 3 6 2. + <_> + + <_> + 10 7 4 12 -1. + <_> + 10 13 4 6 2. + <_> + + <_> + 5 3 8 14 -1. + <_> + 5 10 8 7 2. + <_> + + <_> + 14 10 6 1 -1. + <_> + 14 10 3 1 2. + <_> + + <_> + 0 4 10 4 -1. + <_> + 0 6 10 2 2. + <_> + + <_> + 10 0 5 8 -1. + <_> + 10 4 5 4 2. + <_> + + <_> + 8 1 4 8 -1. + <_> + 8 1 2 4 2. + <_> + 10 5 2 4 2. + <_> + + <_> + 9 11 6 1 -1. + <_> + 11 11 2 1 3. + <_> + + <_> + 8 9 3 4 -1. + <_> + 9 9 1 4 3. + <_> + + <_> + 18 4 2 6 -1. + <_> + 18 6 2 2 3. + <_> + + <_> + 8 8 3 4 -1. + <_> + 9 8 1 4 3. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 7 13 6 1 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 12 11 3 6 -1. + <_> + 12 13 3 2 3. + <_> + + <_> + 5 11 6 1 -1. + <_> + 7 11 2 1 3. + <_> + + <_> + 1 4 18 10 -1. + <_> + 10 4 9 5 2. + <_> + 1 9 9 5 2. + <_> + + <_> + 8 6 4 9 -1. + <_> + 8 9 4 3 3. + <_> + + <_> + 8 6 4 3 -1. + <_> + 8 7 4 1 3. + <_> + + <_> + 8 7 3 3 -1. + <_> + 9 7 1 3 3. + <_> + + <_> + 14 15 4 3 -1. + <_> + 14 16 4 1 3. + <_> + + <_> + 5 10 3 10 -1. + <_> + 6 10 1 10 3. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 0 8 1 6 -1. + <_> + 0 10 1 2 3. + <_> + + <_> + 10 15 1 3 -1. + <_> + 10 16 1 1 3. + <_> + + <_> + 2 15 4 3 -1. + <_> + 2 16 4 1 3. + <_> + + <_> + 18 3 2 8 -1. + <_> + 19 3 1 4 2. + <_> + 18 7 1 4 2. + <_> + + <_> + 0 3 2 8 -1. + <_> + 0 3 1 4 2. + <_> + 1 7 1 4 2. + <_> + + <_> + 3 7 14 10 -1. + <_> + 10 7 7 5 2. + <_> + 3 12 7 5 2. + <_> + + <_> + 0 7 19 3 -1. + <_> + 0 8 19 1 3. + <_> + + <_> + 12 6 3 3 -1. + <_> + 12 7 3 1 3. + <_> + + <_> + 0 6 1 3 -1. + <_> + 0 7 1 1 3. + <_> + + <_> + 12 6 3 3 -1. + <_> + 12 7 3 1 3. + <_> + + <_> + 5 6 3 3 -1. + <_> + 5 7 3 1 3. + <_> + + <_> + 8 2 4 2 -1. + <_> + 8 3 4 1 2. + <_> + + <_> + 6 3 4 12 -1. + <_> + 8 3 2 12 2. + <_> + + <_> + 13 6 2 3 -1. + <_> + 13 7 2 1 3. + <_> + + <_> + 0 10 20 4 -1. + <_> + 0 12 20 2 2. + <_> + + <_> + 2 0 17 14 -1. + <_> + 2 7 17 7 2. + <_> + + <_> + 0 0 6 10 -1. + <_> + 0 0 3 5 2. + <_> + 3 5 3 5 2. + <_> + + <_> + 14 6 6 4 -1. + <_> + 14 6 3 4 2. + <_> + + <_> + 0 6 6 4 -1. + <_> + 3 6 3 4 2. + <_> + + <_> + 13 2 7 2 -1. + <_> + 13 3 7 1 2. + <_> + + <_> + 0 2 7 2 -1. + <_> + 0 3 7 1 2. + <_> + + <_> + 6 11 14 2 -1. + <_> + 13 11 7 1 2. + <_> + 6 12 7 1 2. + <_> + + <_> + 8 5 2 2 -1. + <_> + 8 5 1 1 2. + <_> + 9 6 1 1 2. + <_> + + <_> + 13 9 2 3 -1. + <_> + 13 9 1 3 2. + <_> + + <_> + 1 1 3 12 -1. + <_> + 2 1 1 12 3. + <_> + + <_> + 17 4 1 3 -1. + <_> + 17 5 1 1 3. + <_> + + <_> + 2 4 1 3 -1. + <_> + 2 5 1 1 3. + <_> + + <_> + 14 5 1 3 -1. + <_> + 14 6 1 1 3. + <_> + + <_> + 7 16 2 3 -1. + <_> + 7 17 2 1 3. + <_> + + <_> + 8 13 4 6 -1. + <_> + 10 13 2 3 2. + <_> + 8 16 2 3 2. + <_> + + <_> + 5 5 1 3 -1. + <_> + 5 6 1 1 3. + <_> + + <_> + 16 0 4 20 -1. + <_> + 16 0 2 20 2. + <_> + + <_> + 5 1 2 6 -1. + <_> + 5 1 1 3 2. + <_> + 6 4 1 3 2. + <_> + + <_> + 5 4 10 4 -1. + <_> + 5 6 10 2 2. + <_> + + <_> + 15 2 4 12 -1. + <_> + 15 2 2 12 2. + <_> + + <_> + 7 6 4 12 -1. + <_> + 7 12 4 6 2. + <_> + + <_> + 14 5 1 8 -1. + <_> + 14 9 1 4 2. + <_> + + <_> + 1 4 14 10 -1. + <_> + 1 4 7 5 2. + <_> + 8 9 7 5 2. + <_> + + <_> + 11 6 6 14 -1. + <_> + 14 6 3 7 2. + <_> + 11 13 3 7 2. + <_> + + <_> + 3 6 6 14 -1. + <_> + 3 6 3 7 2. + <_> + 6 13 3 7 2. + <_> + + <_> + 4 9 15 2 -1. + <_> + 9 9 5 2 3. + <_> + + <_> + 7 14 6 3 -1. + <_> + 7 15 6 1 3. + <_> + + <_> + 6 3 14 4 -1. + <_> + 13 3 7 2 2. + <_> + 6 5 7 2 2. + <_> + + <_> + 1 9 15 2 -1. + <_> + 6 9 5 2 3. + <_> + + <_> + 6 11 8 9 -1. + <_> + 6 14 8 3 3. + <_> + + <_> + 7 4 3 8 -1. + <_> + 8 4 1 8 3. + <_> + + <_> + 14 6 2 6 -1. + <_> + 14 9 2 3 2. + <_> + + <_> + 5 7 6 4 -1. + <_> + 5 7 3 2 2. + <_> + 8 9 3 2 2. + <_> + + <_> + 1 1 18 19 -1. + <_> + 7 1 6 19 3. + <_> + + <_> + 1 2 6 5 -1. + <_> + 4 2 3 5 2. + <_> + + <_> + 12 17 6 2 -1. + <_> + 12 18 6 1 2. + <_> + + <_> + 2 17 6 2 -1. + <_> + 2 18 6 1 2. + <_> + + <_> + 17 3 3 6 -1. + <_> + 17 5 3 2 3. + <_> + + <_> + 8 17 3 3 -1. + <_> + 8 18 3 1 3. + <_> + + <_> + 10 13 2 6 -1. + <_> + 10 16 2 3 2. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 17 3 3 6 -1. + <_> + 17 5 3 2 3. + <_> + + <_> + 8 13 2 3 -1. + <_> + 8 14 2 1 3. + <_> + + <_> + 9 3 6 2 -1. + <_> + 11 3 2 2 3. + <_> + + <_> + 0 3 3 6 -1. + <_> + 0 5 3 2 3. + <_> + + <_> + 8 5 4 6 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 5 5 3 2 -1. + <_> + 5 6 3 1 2. + <_> + + <_> + 10 1 3 4 -1. + <_> + 11 1 1 4 3. + <_> + + <_> + 1 2 5 9 -1. + <_> + 1 5 5 3 3. + <_> + + <_> + 13 6 2 3 -1. + <_> + 13 7 2 1 3. + <_> + + <_> + 0 6 14 3 -1. + <_> + 7 6 7 3 2. + <_> + + <_> + 2 11 18 8 -1. + <_> + 2 15 18 4 2. + <_> + + <_> + 5 6 2 3 -1. + <_> + 5 7 2 1 3. + <_> + + <_> + 10 6 4 2 -1. + <_> + 12 6 2 1 2. + <_> + 10 7 2 1 2. + <_> + + <_> + 6 6 4 2 -1. + <_> + 6 6 2 1 2. + <_> + 8 7 2 1 2. + <_> + + <_> + 10 1 3 4 -1. + <_> + 11 1 1 4 3. + <_> + + <_> + 7 1 2 7 -1. + <_> + 8 1 1 7 2. + <_> + + <_> + 4 2 15 14 -1. + <_> + 4 9 15 7 2. + <_> + + <_> + 8 7 3 2 -1. + <_> + 9 7 1 2 3. + <_> + + <_> + 2 3 18 4 -1. + <_> + 11 3 9 2 2. + <_> + 2 5 9 2 2. + <_> + + <_> + 9 7 2 2 -1. + <_> + 10 7 1 2 2. + <_> + + <_> + 13 9 2 3 -1. + <_> + 13 9 1 3 2. + <_> + + <_> + 5 2 6 2 -1. + <_> + 7 2 2 2 3. + <_> + + <_> + 9 5 2 7 -1. + <_> + 9 5 1 7 2. + <_> + + <_> + 5 9 2 3 -1. + <_> + 6 9 1 3 2. + <_> + + <_> + 6 0 14 18 -1. + <_> + 6 9 14 9 2. + <_> + + <_> + 2 16 6 3 -1. + <_> + 2 17 6 1 3. + <_> + + <_> + 9 7 3 6 -1. + <_> + 10 7 1 6 3. + <_> + + <_> + 7 8 4 3 -1. + <_> + 7 9 4 1 3. + <_> + + <_> + 7 12 6 3 -1. + <_> + 7 13 6 1 3. + <_> + + <_> + 9 12 2 3 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 7 12 6 2 -1. + <_> + 9 12 2 2 3. + <_> + + <_> + 5 11 4 6 -1. + <_> + 5 14 4 3 2. + <_> + + <_> + 11 12 7 2 -1. + <_> + 11 13 7 1 2. + <_> + + <_> + 6 10 8 6 -1. + <_> + 6 10 4 3 2. + <_> + 10 13 4 3 2. + <_> + + <_> + 11 10 3 4 -1. + <_> + 11 12 3 2 2. + <_> + + <_> + 9 16 2 3 -1. + <_> + 9 17 2 1 3. + <_> + + <_> + 13 3 1 9 -1. + <_> + 13 6 1 3 3. + <_> + + <_> + 1 13 14 6 -1. + <_> + 1 15 14 2 3. + <_> + + <_> + 13 6 1 6 -1. + <_> + 13 9 1 3 2. + <_> + + <_> + 0 4 3 8 -1. + <_> + 1 4 1 8 3. + <_> + + <_> + 18 0 2 18 -1. + <_> + 18 0 1 18 2. + <_> + + <_> + 2 3 6 2 -1. + <_> + 2 4 6 1 2. + <_> + + <_> + 9 0 8 6 -1. + <_> + 9 2 8 2 3. + <_> + + <_> + 6 6 1 6 -1. + <_> + 6 9 1 3 2. + <_> + + <_> + 14 8 6 3 -1. + <_> + 14 9 6 1 3. + <_> + + <_> + 0 0 2 18 -1. + <_> + 1 0 1 18 2. + <_> + + <_> + 1 18 18 2 -1. + <_> + 10 18 9 1 2. + <_> + 1 19 9 1 2. + <_> + + <_> + 3 15 2 2 -1. + <_> + 3 16 2 1 2. + <_> + + <_> + 8 14 5 3 -1. + <_> + 8 15 5 1 3. + <_> + + <_> + 8 14 2 3 -1. + <_> + 8 15 2 1 3. + <_> + + <_> + 12 3 3 3 -1. + <_> + 13 3 1 3 3. + <_> + + <_> + 7 5 6 2 -1. + <_> + 9 5 2 2 3. + <_> + + <_> + 15 5 5 2 -1. + <_> + 15 6 5 1 2. + <_> + + <_> + 0 5 5 2 -1. + <_> + 0 6 5 1 2. + <_> + + <_> + 17 14 1 6 -1. + <_> + 17 17 1 3 2. + <_> + + <_> + 2 9 9 3 -1. + <_> + 5 9 3 3 3. + <_> + + <_> + 12 3 3 3 -1. + <_> + 13 3 1 3 3. + <_> + + <_> + 0 0 4 18 -1. + <_> + 2 0 2 18 2. + <_> + + <_> + 17 6 1 3 -1. + <_> + 17 7 1 1 3. + <_> + + <_> + 2 14 1 6 -1. + <_> + 2 17 1 3 2. + <_> + + <_> + 19 8 1 2 -1. + <_> + 19 9 1 1 2. + <_> + + <_> + 5 3 3 3 -1. + <_> + 6 3 1 3 3. + <_> + + <_> + 9 16 2 3 -1. + <_> + 9 17 2 1 3. + <_> + + <_> + 2 6 1 3 -1. + <_> + 2 7 1 1 3. + <_> + + <_> + 12 4 8 2 -1. + <_> + 16 4 4 1 2. + <_> + 12 5 4 1 2. + <_> + + <_> + 0 4 8 2 -1. + <_> + 0 4 4 1 2. + <_> + 4 5 4 1 2. + <_> + + <_> + 2 16 18 4 -1. + <_> + 2 18 18 2 2. + <_> + + <_> + 7 15 2 4 -1. + <_> + 7 17 2 2 2. + <_> + + <_> + 4 0 14 3 -1. + <_> + 4 1 14 1 3. + <_> + + <_> + 0 0 4 20 -1. + <_> + 2 0 2 20 2. + <_> + + <_> + 12 4 4 8 -1. + <_> + 14 4 2 4 2. + <_> + 12 8 2 4 2. + <_> + + <_> + 6 7 2 2 -1. + <_> + 6 7 1 1 2. + <_> + 7 8 1 1 2. + <_> + + <_> + 10 6 2 3 -1. + <_> + 10 7 2 1 3. + <_> + + <_> + 8 7 3 2 -1. + <_> + 8 8 3 1 2. + <_> + + <_> + 8 2 6 12 -1. + <_> + 8 8 6 6 2. + <_> + + <_> + 4 0 11 12 -1. + <_> + 4 4 11 4 3. + <_> + + <_> + 14 9 6 11 -1. + <_> + 16 9 2 11 3. + <_> + + <_> + 0 14 4 3 -1. + <_> + 0 15 4 1 3. + <_> + + <_> + 9 10 2 3 -1. + <_> + 9 11 2 1 3. + <_> + + <_> + 5 11 3 2 -1. + <_> + 5 12 3 1 2. + <_> + + <_> + 9 15 3 3 -1. + <_> + 10 15 1 3 3. + <_> + + <_> + 8 8 3 4 -1. + <_> + 9 8 1 4 3. + <_> + + <_> + 9 15 3 3 -1. + <_> + 10 15 1 3 3. + <_> + + <_> + 7 7 3 2 -1. + <_> + 8 7 1 2 3. + <_> + + <_> + 2 10 16 4 -1. + <_> + 10 10 8 2 2. + <_> + 2 12 8 2 2. + <_> + + <_> + 2 3 4 17 -1. + <_> + 4 3 2 17 2. + <_> + + <_> + 15 13 2 7 -1. + <_> + 15 13 1 7 2. + <_> + + <_> + 2 2 6 1 -1. + <_> + 5 2 3 1 2. + <_> + + <_> + 5 2 12 4 -1. + <_> + 9 2 4 4 3. + <_> + + <_> + 6 0 8 12 -1. + <_> + 6 0 4 6 2. + <_> + 10 6 4 6 2. + <_> + + <_> + 13 7 2 2 -1. + <_> + 14 7 1 1 2. + <_> + 13 8 1 1 2. + <_> + + <_> + 0 12 20 6 -1. + <_> + 0 14 20 2 3. + <_> + + <_> + 14 7 2 3 -1. + <_> + 14 7 1 3 2. + <_> + + <_> + 0 8 9 12 -1. + <_> + 3 8 3 12 3. + <_> + + <_> + 3 0 16 2 -1. + <_> + 3 0 8 2 2. + <_> + + <_> + 6 15 3 3 -1. + <_> + 6 16 3 1 3. + <_> + + <_> + 8 15 6 3 -1. + <_> + 8 16 6 1 3. + <_> + + <_> + 0 10 1 6 -1. + <_> + 0 12 1 2 3. + <_> + + <_> + 10 9 4 3 -1. + <_> + 10 10 4 1 3. + <_> + + <_> + 9 15 2 3 -1. + <_> + 9 16 2 1 3. + <_> + + <_> + 5 7 10 1 -1. + <_> + 5 7 5 1 2. + <_> + + <_> + 4 0 12 19 -1. + <_> + 10 0 6 19 2. + <_> + + <_> + 0 6 20 6 -1. + <_> + 10 6 10 3 2. + <_> + 0 9 10 3 2. + <_> + + <_> + 3 6 2 2 -1. + <_> + 3 6 1 1 2. + <_> + 4 7 1 1 2. + <_> + + <_> + 15 6 2 2 -1. + <_> + 16 6 1 1 2. + <_> + 15 7 1 1 2. + <_> + + <_> + 3 6 2 2 -1. + <_> + 3 6 1 1 2. + <_> + 4 7 1 1 2. + <_> + + <_> + 14 4 1 12 -1. + <_> + 14 10 1 6 2. + <_> + + <_> + 2 5 16 10 -1. + <_> + 2 5 8 5 2. + <_> + 10 10 8 5 2. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 1 4 2 2 -1. + <_> + 1 5 2 1 2. + <_> + + <_> + 5 0 15 5 -1. + <_> + 10 0 5 5 3. + <_> + + <_> + 0 0 15 5 -1. + <_> + 5 0 5 5 3. + <_> + + <_> + 11 2 2 17 -1. + <_> + 11 2 1 17 2. + <_> + + <_> + 7 2 2 17 -1. + <_> + 8 2 1 17 2. + <_> + + <_> + 15 11 2 9 -1. + <_> + 15 11 1 9 2. + <_> + + <_> + 3 11 2 9 -1. + <_> + 4 11 1 9 2. + <_> + + <_> + 5 16 14 4 -1. + <_> + 5 16 7 4 2. + <_> + + <_> + 1 4 18 1 -1. + <_> + 7 4 6 1 3. + <_> + + <_> + 13 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 13 9 3 2 2. + <_> + + <_> + 9 8 2 12 -1. + <_> + 9 12 2 4 3. + <_> + + <_> + 12 1 6 6 -1. + <_> + 12 3 6 2 3. + <_> + + <_> + 5 2 6 6 -1. + <_> + 5 2 3 3 2. + <_> + 8 5 3 3 2. + <_> + + <_> + 9 16 6 4 -1. + <_> + 12 16 3 2 2. + <_> + 9 18 3 2 2. + <_> + + <_> + 1 2 18 3 -1. + <_> + 7 2 6 3 3. + <_> + + <_> + 7 4 9 10 -1. + <_> + 7 9 9 5 2. + <_> + + <_> + 5 9 4 4 -1. + <_> + 7 9 2 4 2. + <_> + + <_> + 11 10 3 6 -1. + <_> + 11 13 3 3 2. + <_> + + <_> + 7 11 5 3 -1. + <_> + 7 12 5 1 3. + <_> + + <_> + 7 11 6 6 -1. + <_> + 10 11 3 3 2. + <_> + 7 14 3 3 2. + <_> + + <_> + 0 0 10 9 -1. + <_> + 0 3 10 3 3. + <_> + + <_> + 13 14 1 6 -1. + <_> + 13 16 1 2 3. + <_> + + <_> + 0 2 3 6 -1. + <_> + 0 4 3 2 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 6 14 1 6 -1. + <_> + 6 16 1 2 3. + <_> + + <_> + 9 15 2 3 -1. + <_> + 9 16 2 1 3. + <_> + + <_> + 6 4 3 3 -1. + <_> + 7 4 1 3 3. + <_> + + <_> + 9 0 11 3 -1. + <_> + 9 1 11 1 3. + <_> + + <_> + 0 6 20 3 -1. + <_> + 0 7 20 1 3. + <_> + + <_> + 10 1 1 2 -1. + <_> + 10 2 1 1 2. + <_> + + <_> + 9 6 2 6 -1. + <_> + 10 6 1 6 2. + <_> + + <_> + 5 8 12 1 -1. + <_> + 9 8 4 1 3. + <_> + + <_> + 3 8 12 1 -1. + <_> + 7 8 4 1 3. + <_> + + <_> + 9 7 3 5 -1. + <_> + 10 7 1 5 3. + <_> + + <_> + 3 9 6 2 -1. + <_> + 6 9 3 2 2. + <_> + + <_> + 12 9 3 3 -1. + <_> + 12 10 3 1 3. + <_> + + <_> + 7 0 6 1 -1. + <_> + 9 0 2 1 3. + <_> + + <_> + 12 9 3 3 -1. + <_> + 12 10 3 1 3. + <_> + + <_> + 7 10 2 1 -1. + <_> + 8 10 1 1 2. + <_> + + <_> + 6 4 9 13 -1. + <_> + 9 4 3 13 3. + <_> + + <_> + 6 8 4 2 -1. + <_> + 6 9 4 1 2. + <_> + + <_> + 16 2 4 6 -1. + <_> + 16 2 2 6 2. + <_> + + <_> + 0 17 6 3 -1. + <_> + 0 18 6 1 3. + <_> + + <_> + 10 10 3 10 -1. + <_> + 10 15 3 5 2. + <_> + + <_> + 8 7 3 5 -1. + <_> + 9 7 1 5 3. + <_> + + <_> + 10 4 4 3 -1. + <_> + 10 4 2 3 2. + <_> + + <_> + 8 4 3 8 -1. + <_> + 9 4 1 8 3. + <_> + + <_> + 6 6 9 13 -1. + <_> + 9 6 3 13 3. + <_> + + <_> + 6 0 8 12 -1. + <_> + 6 0 4 6 2. + <_> + 10 6 4 6 2. + <_> + + <_> + 14 2 6 8 -1. + <_> + 16 2 2 8 3. + <_> + + <_> + 6 0 3 6 -1. + <_> + 7 0 1 6 3. + <_> + + <_> + 14 2 6 8 -1. + <_> + 16 2 2 8 3. + <_> + + <_> + 0 5 6 6 -1. + <_> + 0 8 6 3 2. + <_> + + <_> + 9 12 6 2 -1. + <_> + 12 12 3 1 2. + <_> + 9 13 3 1 2. + <_> + + <_> + 8 17 3 2 -1. + <_> + 9 17 1 2 3. + <_> + + <_> + 11 6 2 2 -1. + <_> + 12 6 1 1 2. + <_> + 11 7 1 1 2. + <_> + + <_> + 1 9 18 2 -1. + <_> + 7 9 6 2 3. + <_> + + <_> + 11 6 2 2 -1. + <_> + 12 6 1 1 2. + <_> + 11 7 1 1 2. + <_> + + <_> + 3 4 12 8 -1. + <_> + 7 4 4 8 3. + <_> + + <_> + 13 11 5 3 -1. + <_> + 13 12 5 1 3. + <_> + + <_> + 9 10 2 3 -1. + <_> + 9 11 2 1 3. + <_> + + <_> + 14 7 2 3 -1. + <_> + 14 7 1 3 2. + <_> + + <_> + 5 4 1 3 -1. + <_> + 5 5 1 1 3. + <_> + + <_> + 13 4 2 3 -1. + <_> + 13 5 2 1 3. + <_> + + <_> + 5 4 2 3 -1. + <_> + 5 5 2 1 3. + <_> + + <_> + 9 8 2 3 -1. + <_> + 9 9 2 1 3. + <_> + + <_> + 8 9 2 2 -1. + <_> + 8 10 2 1 2. + <_> + + <_> + 15 14 1 4 -1. + <_> + 15 16 1 2 2. + <_> + + <_> + 3 12 2 2 -1. + <_> + 3 13 2 1 2. + <_> + + <_> + 12 15 2 2 -1. + <_> + 13 15 1 1 2. + <_> + 12 16 1 1 2. + <_> + + <_> + 9 13 2 2 -1. + <_> + 9 14 2 1 2. + <_> + + <_> + 4 11 14 9 -1. + <_> + 4 14 14 3 3. + <_> + + <_> + 7 13 4 3 -1. + <_> + 7 14 4 1 3. + <_> + + <_> + 15 14 1 4 -1. + <_> + 15 16 1 2 2. + <_> + + <_> + 4 14 1 4 -1. + <_> + 4 16 1 2 2. + <_> + + <_> + 14 0 6 13 -1. + <_> + 16 0 2 13 3. + <_> + + <_> + 4 1 2 12 -1. + <_> + 4 1 1 6 2. + <_> + 5 7 1 6 2. + <_> + + <_> + 11 14 6 6 -1. + <_> + 14 14 3 3 2. + <_> + 11 17 3 3 2. + <_> + + <_> + 3 14 6 6 -1. + <_> + 3 14 3 3 2. + <_> + 6 17 3 3 2. + <_> + + <_> + 14 17 3 2 -1. + <_> + 14 18 3 1 2. + <_> + + <_> + 3 17 3 2 -1. + <_> + 3 18 3 1 2. + <_> + + <_> + 14 0 6 13 -1. + <_> + 16 0 2 13 3. + <_> + + <_> + 0 0 6 13 -1. + <_> + 2 0 2 13 3. + <_> + + <_> + 10 10 7 6 -1. + <_> + 10 12 7 2 3. + <_> + + <_> + 6 15 2 2 -1. + <_> + 6 15 1 1 2. + <_> + 7 16 1 1 2. + <_> + + <_> + 6 11 8 6 -1. + <_> + 10 11 4 3 2. + <_> + 6 14 4 3 2. + <_> + + <_> + 7 6 2 2 -1. + <_> + 7 6 1 1 2. + <_> + 8 7 1 1 2. + <_> + + <_> + 2 2 16 6 -1. + <_> + 10 2 8 3 2. + <_> + 2 5 8 3 2. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 11 7 3 10 -1. + <_> + 11 12 3 5 2. + <_> + + <_> + 6 7 3 10 -1. + <_> + 6 12 3 5 2. + <_> + + <_> + 10 7 3 2 -1. + <_> + 11 7 1 2 3. + <_> + + <_> + 8 12 4 2 -1. + <_> + 8 13 4 1 2. + <_> + + <_> + 10 1 1 3 -1. + <_> + 10 2 1 1 3. + <_> + + <_> + 1 2 4 18 -1. + <_> + 1 2 2 9 2. + <_> + 3 11 2 9 2. + <_> + + <_> + 12 4 4 12 -1. + <_> + 12 10 4 6 2. + <_> + + <_> + 0 0 1 6 -1. + <_> + 0 2 1 2 3. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 8 7 4 3 -1. + <_> + 8 8 4 1 3. + <_> + + <_> + 10 7 3 2 -1. + <_> + 11 7 1 2 3. + <_> + + <_> + 7 7 3 2 -1. + <_> + 8 7 1 2 3. + <_> + + <_> + 9 4 6 1 -1. + <_> + 11 4 2 1 3. + <_> + + <_> + 8 7 2 3 -1. + <_> + 9 7 1 3 2. + <_> + + <_> + 12 7 8 6 -1. + <_> + 16 7 4 3 2. + <_> + 12 10 4 3 2. + <_> + + <_> + 0 7 8 6 -1. + <_> + 0 7 4 3 2. + <_> + 4 10 4 3 2. + <_> + + <_> + 18 2 2 10 -1. + <_> + 19 2 1 5 2. + <_> + 18 7 1 5 2. + <_> + + <_> + 0 2 6 4 -1. + <_> + 3 2 3 4 2. + <_> + + <_> + 9 4 6 1 -1. + <_> + 11 4 2 1 3. + <_> + + <_> + 7 15 2 2 -1. + <_> + 7 15 1 1 2. + <_> + 8 16 1 1 2. + <_> + + <_> + 11 13 1 6 -1. + <_> + 11 16 1 3 2. + <_> + + <_> + 8 13 1 6 -1. + <_> + 8 16 1 3 2. + <_> + + <_> + 14 3 2 1 -1. + <_> + 14 3 1 1 2. + <_> + + <_> + 8 15 2 3 -1. + <_> + 8 16 2 1 3. + <_> + + <_> + 12 15 7 4 -1. + <_> + 12 17 7 2 2. + <_> + + <_> + 4 14 12 3 -1. + <_> + 4 15 12 1 3. + <_> + + <_> + 10 3 3 2 -1. + <_> + 11 3 1 2 3. + <_> + + <_> + 4 12 2 2 -1. + <_> + 4 13 2 1 2. + <_> + + <_> + 10 11 4 6 -1. + <_> + 10 14 4 3 2. + <_> + + <_> + 7 13 2 2 -1. + <_> + 7 13 1 1 2. + <_> + 8 14 1 1 2. + <_> + + <_> + 4 11 14 4 -1. + <_> + 11 11 7 2 2. + <_> + 4 13 7 2 2. + <_> + + <_> + 1 18 18 2 -1. + <_> + 7 18 6 2 3. + <_> + + <_> + 11 18 2 2 -1. + <_> + 12 18 1 1 2. + <_> + 11 19 1 1 2. + <_> + + <_> + 7 18 2 2 -1. + <_> + 7 18 1 1 2. + <_> + 8 19 1 1 2. + <_> + + <_> + 12 18 8 2 -1. + <_> + 12 19 8 1 2. + <_> + + <_> + 7 14 6 2 -1. + <_> + 7 15 6 1 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 10 12 2 4 2. + <_> + 8 16 2 4 2. + <_> + + <_> + 4 9 3 3 -1. + <_> + 4 10 3 1 3. + <_> + + <_> + 7 10 6 2 -1. + <_> + 9 10 2 2 3. + <_> + + <_> + 5 0 4 15 -1. + <_> + 7 0 2 15 2. + <_> + + <_> + 8 6 12 14 -1. + <_> + 12 6 4 14 3. + <_> + + <_> + 5 16 3 3 -1. + <_> + 5 17 3 1 3. + <_> + + <_> + 8 1 12 19 -1. + <_> + 12 1 4 19 3. + <_> + + <_> + 3 0 3 2 -1. + <_> + 3 1 3 1 2. + <_> + + <_> + 10 12 4 5 -1. + <_> + 10 12 2 5 2. + <_> + + <_> + 6 12 4 5 -1. + <_> + 8 12 2 5 2. + <_> + + <_> + 11 11 2 2 -1. + <_> + 12 11 1 1 2. + <_> + 11 12 1 1 2. + <_> + + <_> + 0 2 3 6 -1. + <_> + 0 4 3 2 3. + <_> + + <_> + 11 11 2 2 -1. + <_> + 12 11 1 1 2. + <_> + 11 12 1 1 2. + <_> + + <_> + 7 6 4 10 -1. + <_> + 7 11 4 5 2. + <_> + + <_> + 11 11 2 2 -1. + <_> + 12 11 1 1 2. + <_> + 11 12 1 1 2. + <_> + + <_> + 2 13 5 2 -1. + <_> + 2 14 5 1 2. + <_> + + <_> + 11 11 2 2 -1. + <_> + 12 11 1 1 2. + <_> + 11 12 1 1 2. + <_> + + <_> + 7 11 2 2 -1. + <_> + 7 11 1 1 2. + <_> + 8 12 1 1 2. + <_> + + <_> + 14 13 3 3 -1. + <_> + 14 14 3 1 3. + <_> + + <_> + 3 13 3 3 -1. + <_> + 3 14 3 1 3. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 8 7 3 3 -1. + <_> + 8 8 3 1 3. + <_> + + <_> + 13 5 3 3 -1. + <_> + 13 6 3 1 3. + <_> + + <_> + 0 9 5 3 -1. + <_> + 0 10 5 1 3. + <_> + + <_> + 13 5 3 3 -1. + <_> + 13 6 3 1 3. + <_> + + <_> + 9 12 2 8 -1. + <_> + 9 12 1 4 2. + <_> + 10 16 1 4 2. + <_> + + <_> + 11 7 2 2 -1. + <_> + 12 7 1 1 2. + <_> + 11 8 1 1 2. + <_> + + <_> + 0 16 6 4 -1. + <_> + 3 16 3 4 2. + <_> + + <_> + 10 6 2 3 -1. + <_> + 10 7 2 1 3. + <_> + + <_> + 9 5 2 6 -1. + <_> + 9 7 2 2 3. + <_> + + <_> + 12 15 8 4 -1. + <_> + 12 15 4 4 2. + <_> + + <_> + 0 14 8 6 -1. + <_> + 4 14 4 6 2. + <_> + + <_> + 9 0 3 2 -1. + <_> + 10 0 1 2 3. + <_> + + <_> + 4 15 4 2 -1. + <_> + 6 15 2 2 2. + <_> + + <_> + 12 7 3 13 -1. + <_> + 13 7 1 13 3. + <_> + + <_> + 5 7 3 13 -1. + <_> + 6 7 1 13 3. + <_> + + <_> + 9 6 3 9 -1. + <_> + 9 9 3 3 3. + <_> + + <_> + 4 4 7 12 -1. + <_> + 4 10 7 6 2. + <_> + + <_> + 12 12 2 2 -1. + <_> + 13 12 1 1 2. + <_> + 12 13 1 1 2. + <_> + + <_> + 6 12 2 2 -1. + <_> + 6 12 1 1 2. + <_> + 7 13 1 1 2. + <_> + + <_> + 8 9 4 2 -1. + <_> + 10 9 2 1 2. + <_> + 8 10 2 1 2. + <_> + + <_> + 3 6 2 2 -1. + <_> + 3 6 1 1 2. + <_> + 4 7 1 1 2. + <_> + + <_> + 16 6 3 2 -1. + <_> + 16 7 3 1 2. + <_> + + <_> + 0 7 19 4 -1. + <_> + 0 9 19 2 2. + <_> + + <_> + 10 2 10 1 -1. + <_> + 10 2 5 1 2. + <_> + + <_> + 9 4 2 12 -1. + <_> + 9 10 2 6 2. + <_> + + <_> + 12 18 4 1 -1. + <_> + 12 18 2 1 2. + <_> + + <_> + 1 7 6 4 -1. + <_> + 1 7 3 2 2. + <_> + 4 9 3 2 2. + <_> + + <_> + 12 0 6 13 -1. + <_> + 14 0 2 13 3. + <_> + + <_> + 2 0 6 13 -1. + <_> + 4 0 2 13 3. + <_> + + <_> + 10 5 8 8 -1. + <_> + 10 9 8 4 2. + <_> + + <_> + 8 3 2 5 -1. + <_> + 9 3 1 5 2. + <_> + + <_> + 8 4 9 1 -1. + <_> + 11 4 3 1 3. + <_> + + <_> + 3 4 9 1 -1. + <_> + 6 4 3 1 3. + <_> + + <_> + 1 0 18 10 -1. + <_> + 7 0 6 10 3. + <_> + + <_> + 7 17 5 3 -1. + <_> + 7 18 5 1 3. + <_> + + <_> + 7 11 6 1 -1. + <_> + 9 11 2 1 3. + <_> + + <_> + 2 2 3 2 -1. + <_> + 2 3 3 1 2. + <_> + + <_> + 8 12 4 2 -1. + <_> + 8 13 4 1 2. + <_> + + <_> + 6 10 3 6 -1. + <_> + 6 13 3 3 2. + <_> + + <_> + 11 4 2 4 -1. + <_> + 11 4 1 4 2. + <_> + + <_> + 7 4 2 4 -1. + <_> + 8 4 1 4 2. + <_> + + <_> + 9 6 2 4 -1. + <_> + 9 6 1 4 2. + <_> + + <_> + 6 13 8 3 -1. + <_> + 6 14 8 1 3. + <_> + + <_> + 9 15 3 4 -1. + <_> + 10 15 1 4 3. + <_> + + <_> + 9 2 2 17 -1. + <_> + 10 2 1 17 2. + <_> + + <_> + 7 0 6 1 -1. + <_> + 9 0 2 1 3. + <_> + + <_> + 8 15 3 4 -1. + <_> + 9 15 1 4 3. + <_> + + <_> + 7 13 7 3 -1. + <_> + 7 14 7 1 3. + <_> + + <_> + 8 16 3 3 -1. + <_> + 9 16 1 3 3. + <_> + + <_> + 6 2 8 10 -1. + <_> + 6 7 8 5 2. + <_> + + <_> + 2 5 8 8 -1. + <_> + 2 9 8 4 2. + <_> + + <_> + 14 16 2 2 -1. + <_> + 14 17 2 1 2. + <_> + + <_> + 4 16 2 2 -1. + <_> + 4 17 2 1 2. + <_> + + <_> + 10 11 4 6 -1. + <_> + 10 14 4 3 2. + <_> + + <_> + 6 11 4 6 -1. + <_> + 6 14 4 3 2. + <_> + + <_> + 10 14 1 3 -1. + <_> + 10 15 1 1 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 10 0 4 6 -1. + <_> + 12 0 2 3 2. + <_> + 10 3 2 3 2. + <_> + + <_> + 0 3 20 2 -1. + <_> + 0 4 20 1 2. + <_> + + <_> + 12 0 8 2 -1. + <_> + 16 0 4 1 2. + <_> + 12 1 4 1 2. + <_> + + <_> + 2 12 10 8 -1. + <_> + 2 16 10 4 2. + <_> + + <_> + 17 7 2 10 -1. + <_> + 18 7 1 5 2. + <_> + 17 12 1 5 2. + <_> + + <_> + 1 7 2 10 -1. + <_> + 1 7 1 5 2. + <_> + 2 12 1 5 2. + <_> + + <_> + 15 10 3 6 -1. + <_> + 15 12 3 2 3. + <_> + + <_> + 4 4 6 2 -1. + <_> + 6 4 2 2 3. + <_> + + <_> + 0 5 20 6 -1. + <_> + 0 7 20 2 3. + <_> + + <_> + 0 0 8 2 -1. + <_> + 0 0 4 1 2. + <_> + 4 1 4 1 2. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 1 13 6 2 -1. + <_> + 1 14 6 1 2. + <_> + + <_> + 10 8 3 4 -1. + <_> + 11 8 1 4 3. + <_> + + <_> + 6 1 6 1 -1. + <_> + 8 1 2 1 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 1 6 18 2 -1. + <_> + 10 6 9 2 2. + <_> + + <_> + 15 11 1 2 -1. + <_> + 15 12 1 1 2. + <_> + + <_> + 6 5 1 2 -1. + <_> + 6 6 1 1 2. + <_> + + <_> + 13 4 1 3 -1. + <_> + 13 5 1 1 3. + <_> + + <_> + 2 15 1 2 -1. + <_> + 2 16 1 1 2. + <_> + + <_> + 12 4 4 3 -1. + <_> + 12 5 4 1 3. + <_> + + <_> + 0 0 7 3 -1. + <_> + 0 1 7 1 3. + <_> + + <_> + 9 12 6 2 -1. + <_> + 9 12 3 2 2. + <_> + + <_> + 5 4 2 3 -1. + <_> + 5 5 2 1 3. + <_> + + <_> + 18 4 2 3 -1. + <_> + 18 5 2 1 3. + <_> + + <_> + 3 0 8 6 -1. + <_> + 3 2 8 2 3. + <_> + + <_> + 0 2 20 6 -1. + <_> + 10 2 10 3 2. + <_> + 0 5 10 3 2. + <_> + + <_> + 4 7 2 4 -1. + <_> + 5 7 1 4 2. + <_> + + <_> + 3 10 15 2 -1. + <_> + 8 10 5 2 3. + <_> + + <_> + 3 0 12 11 -1. + <_> + 9 0 6 11 2. + <_> + + <_> + 13 0 2 6 -1. + <_> + 13 0 1 6 2. + <_> + + <_> + 0 19 2 1 -1. + <_> + 1 19 1 1 2. + <_> + + <_> + 16 10 4 10 -1. + <_> + 18 10 2 5 2. + <_> + 16 15 2 5 2. + <_> + + <_> + 4 8 10 3 -1. + <_> + 4 9 10 1 3. + <_> + + <_> + 14 12 3 3 -1. + <_> + 14 13 3 1 3. + <_> + + <_> + 0 10 4 10 -1. + <_> + 0 10 2 5 2. + <_> + 2 15 2 5 2. + <_> + + <_> + 18 3 2 6 -1. + <_> + 18 5 2 2 3. + <_> + + <_> + 6 6 1 3 -1. + <_> + 6 7 1 1 3. + <_> + + <_> + 7 7 7 2 -1. + <_> + 7 8 7 1 2. + <_> + + <_> + 0 3 2 6 -1. + <_> + 0 5 2 2 3. + <_> + + <_> + 11 1 3 1 -1. + <_> + 12 1 1 1 3. + <_> + + <_> + 5 0 2 6 -1. + <_> + 6 0 1 6 2. + <_> + + <_> + 1 1 18 14 -1. + <_> + 7 1 6 14 3. + <_> + + <_> + 4 6 8 3 -1. + <_> + 8 6 4 3 2. + <_> + + <_> + 9 12 6 2 -1. + <_> + 9 12 3 2 2. + <_> + + <_> + 5 12 6 2 -1. + <_> + 8 12 3 2 2. + <_> + + <_> + 10 7 3 5 -1. + <_> + 11 7 1 5 3. + <_> + + <_> + 7 7 3 5 -1. + <_> + 8 7 1 5 3. + <_> + + <_> + 13 0 3 10 -1. + <_> + 14 0 1 10 3. + <_> + + <_> + 4 11 3 2 -1. + <_> + 4 12 3 1 2. + <_> + + <_> + 17 3 3 6 -1. + <_> + 18 3 1 6 3. + <_> + + <_> + 1 8 18 10 -1. + <_> + 1 13 18 5 2. + <_> + + <_> + 13 0 3 10 -1. + <_> + 14 0 1 10 3. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 16 3 3 7 -1. + <_> + 17 3 1 7 3. + <_> + + <_> + 4 0 3 10 -1. + <_> + 5 0 1 10 3. + <_> + + <_> + 16 3 3 7 -1. + <_> + 17 3 1 7 3. + <_> + + <_> + 0 9 1 2 -1. + <_> + 0 10 1 1 2. + <_> + + <_> + 18 1 2 10 -1. + <_> + 18 1 1 10 2. + <_> + + <_> + 0 1 2 10 -1. + <_> + 1 1 1 10 2. + <_> + + <_> + 10 16 3 4 -1. + <_> + 11 16 1 4 3. + <_> + + <_> + 2 8 3 3 -1. + <_> + 3 8 1 3 3. + <_> + + <_> + 11 0 2 6 -1. + <_> + 12 0 1 3 2. + <_> + 11 3 1 3 2. + <_> + + <_> + 7 0 2 6 -1. + <_> + 7 0 1 3 2. + <_> + 8 3 1 3 2. + <_> + + <_> + 16 3 3 7 -1. + <_> + 17 3 1 7 3. + <_> + + <_> + 1 3 3 7 -1. + <_> + 2 3 1 7 3. + <_> + + <_> + 14 1 6 16 -1. + <_> + 16 1 2 16 3. + <_> + + <_> + 0 1 6 16 -1. + <_> + 2 1 2 16 3. + <_> + + <_> + 2 0 16 8 -1. + <_> + 10 0 8 4 2. + <_> + 2 4 8 4 2. + <_> + + <_> + 6 8 5 3 -1. + <_> + 6 9 5 1 3. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 7 1 3 3. + <_> + + <_> + 8 8 4 3 -1. + <_> + 8 9 4 1 3. + <_> + + <_> + 9 6 2 4 -1. + <_> + 9 6 1 4 2. + <_> + + <_> + 0 7 15 1 -1. + <_> + 5 7 5 1 3. + <_> + + <_> + 8 2 7 9 -1. + <_> + 8 5 7 3 3. + <_> + + <_> + 1 7 16 4 -1. + <_> + 1 7 8 2 2. + <_> + 9 9 8 2 2. + <_> + + <_> + 6 12 8 2 -1. + <_> + 6 13 8 1 2. + <_> + + <_> + 8 11 3 3 -1. + <_> + 8 12 3 1 3. + <_> + + <_> + 4 5 14 10 -1. + <_> + 11 5 7 5 2. + <_> + 4 10 7 5 2. + <_> + + <_> + 4 12 3 2 -1. + <_> + 4 13 3 1 2. + <_> + + <_> + 9 11 6 1 -1. + <_> + 11 11 2 1 3. + <_> + + <_> + 4 9 7 6 -1. + <_> + 4 11 7 2 3. + <_> + + <_> + 7 10 6 3 -1. + <_> + 7 11 6 1 3. + <_> + + <_> + 9 11 2 2 -1. + <_> + 9 12 2 1 2. + <_> + + <_> + 0 5 20 6 -1. + <_> + 0 7 20 2 3. + <_> + + <_> + 6 4 6 1 -1. + <_> + 8 4 2 1 3. + <_> + + <_> + 9 11 6 1 -1. + <_> + 11 11 2 1 3. + <_> + + <_> + 5 11 6 1 -1. + <_> + 7 11 2 1 3. + <_> + + <_> + 10 16 3 4 -1. + <_> + 11 16 1 4 3. + <_> + + <_> + 8 7 3 3 -1. + <_> + 9 7 1 3 3. + <_> + + <_> + 2 12 16 8 -1. + <_> + 2 16 16 4 2. + <_> + + <_> + 0 15 15 2 -1. + <_> + 0 16 15 1 2. + <_> + + <_> + 15 4 5 6 -1. + <_> + 15 6 5 2 3. + <_> + + <_> + 9 5 2 4 -1. + <_> + 10 5 1 4 2. + <_> + + <_> + 8 10 9 6 -1. + <_> + 8 12 9 2 3. + <_> + + <_> + 2 19 15 1 -1. + <_> + 7 19 5 1 3. + <_> + + <_> + 10 16 3 4 -1. + <_> + 11 16 1 4 3. + <_> + + <_> + 0 15 20 4 -1. + <_> + 0 17 20 2 2. + <_> + + <_> + 10 16 3 4 -1. + <_> + 11 16 1 4 3. + <_> + + <_> + 7 16 3 4 -1. + <_> + 8 16 1 4 3. + <_> + + <_> + 9 16 3 3 -1. + <_> + 9 17 3 1 3. + <_> + + <_> + 8 11 4 6 -1. + <_> + 8 14 4 3 2. + <_> + + <_> + 9 6 2 12 -1. + <_> + 9 10 2 4 3. + <_> + + <_> + 8 17 4 3 -1. + <_> + 8 18 4 1 3. + <_> + + <_> + 9 18 8 2 -1. + <_> + 13 18 4 1 2. + <_> + 9 19 4 1 2. + <_> + + <_> + 1 18 8 2 -1. + <_> + 1 19 8 1 2. + <_> + + <_> + 13 5 6 15 -1. + <_> + 15 5 2 15 3. + <_> + + <_> + 9 8 2 2 -1. + <_> + 9 9 2 1 2. + <_> + + <_> + 9 5 2 3 -1. + <_> + 9 5 1 3 2. + <_> + + <_> + 1 5 6 15 -1. + <_> + 3 5 2 15 3. + <_> + + <_> + 4 1 14 8 -1. + <_> + 11 1 7 4 2. + <_> + 4 5 7 4 2. + <_> + + <_> + 2 4 4 16 -1. + <_> + 2 4 2 8 2. + <_> + 4 12 2 8 2. + <_> + + <_> + 12 4 3 12 -1. + <_> + 12 10 3 6 2. + <_> + + <_> + 4 5 10 12 -1. + <_> + 4 5 5 6 2. + <_> + 9 11 5 6 2. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 5 4 2 3 -1. + <_> + 5 5 2 1 3. + <_> + + <_> + 12 2 4 10 -1. + <_> + 14 2 2 5 2. + <_> + 12 7 2 5 2. + <_> + + <_> + 6 4 7 3 -1. + <_> + 6 5 7 1 3. + <_> + + <_> + 2 0 18 2 -1. + <_> + 11 0 9 1 2. + <_> + 2 1 9 1 2. + <_> + + <_> + 0 0 18 2 -1. + <_> + 0 0 9 1 2. + <_> + 9 1 9 1 2. + <_> + + <_> + 13 13 4 6 -1. + <_> + 15 13 2 3 2. + <_> + 13 16 2 3 2. + <_> + + <_> + 3 13 4 6 -1. + <_> + 3 13 2 3 2. + <_> + 5 16 2 3 2. + <_> + + <_> + 10 12 2 6 -1. + <_> + 10 15 2 3 2. + <_> + + <_> + 5 9 10 10 -1. + <_> + 5 9 5 5 2. + <_> + 10 14 5 5 2. + <_> + + <_> + 11 4 4 2 -1. + <_> + 13 4 2 1 2. + <_> + 11 5 2 1 2. + <_> + + <_> + 7 12 6 8 -1. + <_> + 10 12 3 8 2. + <_> + + <_> + 12 2 4 10 -1. + <_> + 14 2 2 5 2. + <_> + 12 7 2 5 2. + <_> + + <_> + 8 11 2 1 -1. + <_> + 9 11 1 1 2. + <_> + + <_> + 10 5 1 12 -1. + <_> + 10 9 1 4 3. + <_> + + <_> + 0 11 6 9 -1. + <_> + 3 11 3 9 2. + <_> + + <_> + 12 2 4 10 -1. + <_> + 14 2 2 5 2. + <_> + 12 7 2 5 2. + <_> + + <_> + 4 2 4 10 -1. + <_> + 4 2 2 5 2. + <_> + 6 7 2 5 2. + <_> + + <_> + 11 4 4 2 -1. + <_> + 13 4 2 1 2. + <_> + 11 5 2 1 2. + <_> + + <_> + 0 14 6 3 -1. + <_> + 0 15 6 1 3. + <_> + + <_> + 11 4 4 2 -1. + <_> + 13 4 2 1 2. + <_> + 11 5 2 1 2. + <_> + + <_> + 6 1 3 2 -1. + <_> + 7 1 1 2 3. + <_> + + <_> + 11 4 4 2 -1. + <_> + 13 4 2 1 2. + <_> + 11 5 2 1 2. + <_> + + <_> + 5 4 4 2 -1. + <_> + 5 4 2 1 2. + <_> + 7 5 2 1 2. + <_> + + <_> + 13 0 2 12 -1. + <_> + 14 0 1 6 2. + <_> + 13 6 1 6 2. + <_> + + <_> + 6 0 3 10 -1. + <_> + 7 0 1 10 3. + <_> + + <_> + 3 0 17 8 -1. + <_> + 3 4 17 4 2. + <_> + + <_> + 0 4 20 4 -1. + <_> + 0 6 20 2 2. + <_> + + <_> + 0 3 8 2 -1. + <_> + 4 3 4 2 2. + <_> + + <_> + 8 11 4 3 -1. + <_> + 8 12 4 1 3. + <_> + + <_> + 5 7 6 4 -1. + <_> + 5 7 3 2 2. + <_> + 8 9 3 2 2. + <_> + + <_> + 8 3 4 9 -1. + <_> + 8 6 4 3 3. + <_> + + <_> + 8 15 1 4 -1. + <_> + 8 17 1 2 2. + <_> + + <_> + 4 5 12 7 -1. + <_> + 8 5 4 7 3. + <_> + + <_> + 4 2 4 10 -1. + <_> + 4 2 2 5 2. + <_> + 6 7 2 5 2. + <_> + + <_> + 3 0 17 2 -1. + <_> + 3 1 17 1 2. + <_> + + <_> + 2 2 16 15 -1. + <_> + 2 7 16 5 3. + <_> + + <_> + 15 2 5 2 -1. + <_> + 15 3 5 1 2. + <_> + + <_> + 9 3 2 2 -1. + <_> + 10 3 1 2 2. + <_> + + <_> + 4 5 16 15 -1. + <_> + 4 10 16 5 3. + <_> + + <_> + 7 13 5 6 -1. + <_> + 7 16 5 3 2. + <_> + + <_> + 10 7 3 2 -1. + <_> + 11 7 1 2 3. + <_> + + <_> + 8 3 3 1 -1. + <_> + 9 3 1 1 3. + <_> + + <_> + 9 16 3 3 -1. + <_> + 9 17 3 1 3. + <_> + + <_> + 0 2 5 2 -1. + <_> + 0 3 5 1 2. + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. + <_> + + <_> + 1 7 12 1 -1. + <_> + 5 7 4 1 3. + <_> + + <_> + 7 5 6 14 -1. + <_> + 7 12 6 7 2. + <_> + + <_> + 0 0 8 10 -1. + <_> + 0 0 4 5 2. + <_> + 4 5 4 5 2. + <_> + + <_> + 9 1 3 2 -1. + <_> + 10 1 1 2 3. + <_> + + <_> + 8 1 3 2 -1. + <_> + 9 1 1 2 3. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 7 4 6 16 -1. + <_> + 7 12 6 8 2. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 2 3 2 6 -1. + <_> + 2 5 2 2 3. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 5 5 2 3 -1. + <_> + 5 6 2 1 3. + <_> + + <_> + 13 11 3 6 -1. + <_> + 13 13 3 2 3. + <_> + + <_> + 3 14 2 6 -1. + <_> + 3 17 2 3 2. + <_> + + <_> + 14 3 6 2 -1. + <_> + 14 4 6 1 2. + <_> + + <_> + 0 8 16 2 -1. + <_> + 0 9 16 1 2. + <_> + + <_> + 14 3 6 2 -1. + <_> + 14 4 6 1 2. + <_> + + <_> + 0 0 5 6 -1. + <_> + 0 2 5 2 3. + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. + <_> + + <_> + 4 11 3 6 -1. + <_> + 4 13 3 2 3. + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. + <_> + + <_> + 9 5 1 3 -1. + <_> + 9 6 1 1 3. + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. + <_> + + <_> + 6 6 8 12 -1. + <_> + 6 12 8 6 2. + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. + <_> + + <_> + 5 12 9 2 -1. + <_> + 8 12 3 2 3. + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. + <_> + + <_> + 4 5 4 3 -1. + <_> + 4 6 4 1 3. + <_> + + <_> + 6 6 9 2 -1. + <_> + 9 6 3 2 3. + <_> + + <_> + 4 11 1 3 -1. + <_> + 4 12 1 1 3. + <_> + + <_> + 14 12 6 6 -1. + <_> + 14 12 3 6 2. + <_> + + <_> + 7 0 3 7 -1. + <_> + 8 0 1 7 3. + <_> + + <_> + 9 8 3 3 -1. + <_> + 10 8 1 3 3. + <_> + + <_> + 8 8 3 3 -1. + <_> + 9 8 1 3 3. + <_> + + <_> + 5 10 11 3 -1. + <_> + 5 11 11 1 3. + <_> + + <_> + 5 7 10 1 -1. + <_> + 10 7 5 1 2. + <_> + + <_> + 9 7 3 2 -1. + <_> + 10 7 1 2 3. + <_> + + <_> + 8 7 3 2 -1. + <_> + 9 7 1 2 3. + <_> + + <_> + 11 9 4 2 -1. + <_> + 11 9 2 2 2. + <_> + + <_> + 5 9 4 2 -1. + <_> + 7 9 2 2 2. + <_> + + <_> + 14 10 2 4 -1. + <_> + 14 12 2 2 2. + <_> + + <_> + 7 7 3 2 -1. + <_> + 8 7 1 2 3. + <_> + + <_> + 14 17 6 3 -1. + <_> + 14 18 6 1 3. + <_> + + <_> + 4 5 12 12 -1. + <_> + 4 5 6 6 2. + <_> + 10 11 6 6 2. + <_> + + <_> + 6 9 8 8 -1. + <_> + 10 9 4 4 2. + <_> + 6 13 4 4 2. + <_> + + <_> + 0 4 15 4 -1. + <_> + 5 4 5 4 3. + <_> + + <_> + 13 2 4 1 -1. + <_> + 13 2 2 1 2. + <_> + + <_> + 4 12 2 2 -1. + <_> + 4 13 2 1 2. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 9 13 2 3 -1. + <_> + 9 14 2 1 3. + <_> + + <_> + 13 11 2 3 -1. + <_> + 13 12 2 1 3. + <_> + + <_> + 7 12 4 4 -1. + <_> + 7 12 2 2 2. + <_> + 9 14 2 2 2. + <_> + + <_> + 10 11 2 2 -1. + <_> + 11 11 1 1 2. + <_> + 10 12 1 1 2. + <_> + + <_> + 8 17 3 2 -1. + <_> + 9 17 1 2 3. + <_> + + <_> + 10 11 2 2 -1. + <_> + 11 11 1 1 2. + <_> + 10 12 1 1 2. + <_> + + <_> + 0 17 6 3 -1. + <_> + 0 18 6 1 3. + <_> + + <_> + 10 11 2 2 -1. + <_> + 11 11 1 1 2. + <_> + 10 12 1 1 2. + <_> + + <_> + 8 11 2 2 -1. + <_> + 8 11 1 1 2. + <_> + 9 12 1 1 2. + <_> + + <_> + 12 5 8 4 -1. + <_> + 12 5 4 4 2. + <_> + + <_> + 0 5 8 4 -1. + <_> + 4 5 4 4 2. + <_> + + <_> + 13 2 4 1 -1. + <_> + 13 2 2 1 2. + <_> + + <_> + 3 2 4 1 -1. + <_> + 5 2 2 1 2. + <_> + + <_> + 10 0 4 2 -1. + <_> + 12 0 2 1 2. + <_> + 10 1 2 1 2. + <_> + + <_> + 7 12 3 1 -1. + <_> + 8 12 1 1 3. + <_> + + <_> + 8 11 4 8 -1. + <_> + 10 11 2 4 2. + <_> + 8 15 2 4 2. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 3 18 15 2 -1. + <_> + 3 19 15 1 2. + <_> + + <_> + 2 6 2 12 -1. + <_> + 2 6 1 6 2. + <_> + 3 12 1 6 2. + <_> + + <_> + 9 8 2 3 -1. + <_> + 9 9 2 1 3. + <_> + + <_> + 7 10 3 2 -1. + <_> + 8 10 1 2 3. + <_> + + <_> + 11 11 3 1 -1. + <_> + 12 11 1 1 3. + <_> + + <_> + 6 11 3 1 -1. + <_> + 7 11 1 1 3. + <_> + + <_> + 9 2 4 2 -1. + <_> + 11 2 2 1 2. + <_> + 9 3 2 1 2. + <_> + + <_> + 4 12 2 3 -1. + <_> + 4 13 2 1 3. + <_> + + <_> + 2 1 18 3 -1. + <_> + 8 1 6 3 3. + <_> + + <_> + 5 1 4 14 -1. + <_> + 7 1 2 14 2. + <_> + + <_> + 8 16 12 3 -1. + <_> + 8 16 6 3 2. + <_> + + <_> + 1 17 18 3 -1. + <_> + 7 17 6 3 3. + <_> + + <_> + 9 14 2 6 -1. + <_> + 9 17 2 3 2. + <_> + + <_> + 9 12 1 8 -1. + <_> + 9 16 1 4 2. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 9 6 2 12 -1. + <_> + 9 10 2 4 3. + <_> + + <_> + 12 9 3 3 -1. + <_> + 12 10 3 1 3. + <_> + + <_> + 0 1 4 8 -1. + <_> + 2 1 2 8 2. + <_> + + <_> + 9 1 6 2 -1. + <_> + 12 1 3 1 2. + <_> + 9 2 3 1 2. + <_> + + <_> + 1 3 12 14 -1. + <_> + 1 10 12 7 2. + <_> + + <_> + 8 12 4 2 -1. + <_> + 10 12 2 1 2. + <_> + 8 13 2 1 2. + <_> + + <_> + 1 9 10 2 -1. + <_> + 1 9 5 1 2. + <_> + 6 10 5 1 2. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 6 8 8 3 -1. + <_> + 6 9 8 1 3. + <_> + + <_> + 9 15 5 3 -1. + <_> + 9 16 5 1 3. + <_> + + <_> + 8 7 4 3 -1. + <_> + 8 8 4 1 3. + <_> + + <_> + 7 7 6 2 -1. + <_> + 7 8 6 1 2. + <_> + + <_> + 5 7 8 2 -1. + <_> + 5 7 4 1 2. + <_> + 9 8 4 1 2. + <_> + + <_> + 12 9 3 3 -1. + <_> + 12 10 3 1 3. + <_> + + <_> + 4 7 4 2 -1. + <_> + 4 8 4 1 2. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 4 9 3 3 -1. + <_> + 5 9 1 3 3. + <_> + + <_> + 12 9 3 3 -1. + <_> + 12 10 3 1 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 17 3 3 6 -1. + <_> + 18 3 1 6 3. + <_> + + <_> + 0 3 3 6 -1. + <_> + 1 3 1 6 3. + <_> + + <_> + 17 14 1 2 -1. + <_> + 17 15 1 1 2. + <_> + + <_> + 4 9 4 3 -1. + <_> + 6 9 2 3 2. + <_> + + <_> + 12 9 3 3 -1. + <_> + 12 10 3 1 3. + <_> + + <_> + 5 9 3 3 -1. + <_> + 5 10 3 1 3. + <_> + + <_> + 9 5 6 8 -1. + <_> + 12 5 3 4 2. + <_> + 9 9 3 4 2. + <_> + + <_> + 5 5 6 8 -1. + <_> + 5 5 3 4 2. + <_> + 8 9 3 4 2. + <_> + + <_> + 16 1 4 6 -1. + <_> + 16 4 4 3 2. + <_> + + <_> + 1 0 6 20 -1. + <_> + 3 0 2 20 3. + <_> + + <_> + 12 11 3 2 -1. + <_> + 13 11 1 2 3. + <_> + + <_> + 5 11 3 2 -1. + <_> + 6 11 1 2 3. + <_> + + <_> + 9 4 6 1 -1. + <_> + 11 4 2 1 3. + <_> + + <_> + 0 0 8 3 -1. + <_> + 4 0 4 3 2. + <_> + + <_> + 15 0 2 5 -1. + <_> + 15 0 1 5 2. + <_> + + <_> + 4 1 3 2 -1. + <_> + 5 1 1 2 3. + <_> + + <_> + 7 0 6 15 -1. + <_> + 9 0 2 15 3. + <_> + + <_> + 6 11 3 1 -1. + <_> + 7 11 1 1 3. + <_> + + <_> + 12 0 3 4 -1. + <_> + 13 0 1 4 3. + <_> + + <_> + 5 4 6 1 -1. + <_> + 7 4 2 1 3. + <_> + + <_> + 12 7 3 2 -1. + <_> + 12 8 3 1 2. + <_> + + <_> + 0 1 4 6 -1. + <_> + 0 4 4 3 2. + <_> + + <_> + 12 7 3 2 -1. + <_> + 12 8 3 1 2. + <_> + + <_> + 2 16 3 3 -1. + <_> + 2 17 3 1 3. + <_> + + <_> + 13 8 6 10 -1. + <_> + 16 8 3 5 2. + <_> + 13 13 3 5 2. + <_> + + <_> + 0 9 5 2 -1. + <_> + 0 10 5 1 2. + <_> + + <_> + 12 11 2 2 -1. + <_> + 13 11 1 1 2. + <_> + 12 12 1 1 2. + <_> + + <_> + 3 15 3 3 -1. + <_> + 3 16 3 1 3. + <_> + + <_> + 12 7 3 2 -1. + <_> + 12 8 3 1 2. + <_> + + <_> + 5 7 3 2 -1. + <_> + 5 8 3 1 2. + <_> + + <_> + 9 5 9 9 -1. + <_> + 9 8 9 3 3. + <_> + + <_> + 5 0 3 7 -1. + <_> + 6 0 1 7 3. + <_> + + <_> + 5 2 12 5 -1. + <_> + 9 2 4 5 3. + <_> + + <_> + 6 11 2 2 -1. + <_> + 6 11 1 1 2. + <_> + 7 12 1 1 2. + <_> + + <_> + 15 15 3 2 -1. + <_> + 15 16 3 1 2. + <_> + + <_> + 2 15 3 2 -1. + <_> + 2 16 3 1 2. + <_> + + <_> + 14 12 6 8 -1. + <_> + 17 12 3 4 2. + <_> + 14 16 3 4 2. + <_> + + <_> + 2 8 15 6 -1. + <_> + 7 8 5 6 3. + <_> + + <_> + 2 2 18 17 -1. + <_> + 8 2 6 17 3. + <_> + + <_> + 5 1 4 1 -1. + <_> + 7 1 2 1 2. + <_> + + <_> + 5 2 12 5 -1. + <_> + 9 2 4 5 3. + <_> + + <_> + 3 2 12 5 -1. + <_> + 7 2 4 5 3. + <_> + + <_> + 4 9 12 4 -1. + <_> + 10 9 6 2 2. + <_> + 4 11 6 2 2. + <_> + + <_> + 5 15 6 2 -1. + <_> + 5 15 3 1 2. + <_> + 8 16 3 1 2. + <_> + + <_> + 10 14 2 3 -1. + <_> + 10 15 2 1 3. + <_> + + <_> + 0 13 20 2 -1. + <_> + 0 13 10 1 2. + <_> + 10 14 10 1 2. + <_> + + <_> + 4 9 12 8 -1. + <_> + 10 9 6 4 2. + <_> + 4 13 6 4 2. + <_> + + <_> + 8 13 3 6 -1. + <_> + 8 16 3 3 2. + <_> + + <_> + 10 12 2 2 -1. + <_> + 10 13 2 1 2. + <_> + + <_> + 9 12 2 2 -1. + <_> + 9 12 1 1 2. + <_> + 10 13 1 1 2. + <_> + + <_> + 4 11 14 4 -1. + <_> + 11 11 7 2 2. + <_> + 4 13 7 2 2. + <_> + + <_> + 8 5 4 2 -1. + <_> + 8 6 4 1 2. + <_> + + <_> + 10 10 6 3 -1. + <_> + 12 10 2 3 3. + <_> + + <_> + 2 14 1 2 -1. + <_> + 2 15 1 1 2. + <_> + + <_> + 13 8 6 12 -1. + <_> + 16 8 3 6 2. + <_> + 13 14 3 6 2. + <_> + + <_> + 1 8 6 12 -1. + <_> + 1 8 3 6 2. + <_> + 4 14 3 6 2. + <_> + + <_> + 10 0 6 10 -1. + <_> + 12 0 2 10 3. + <_> + + <_> + 5 11 8 4 -1. + <_> + 5 11 4 2 2. + <_> + 9 13 4 2 2. + <_> + + <_> + 10 16 8 4 -1. + <_> + 14 16 4 2 2. + <_> + 10 18 4 2 2. + <_> + + <_> + 7 7 6 6 -1. + <_> + 9 7 2 6 3. + <_> + + <_> + 10 2 4 10 -1. + <_> + 10 2 2 10 2. + <_> + + <_> + 6 1 4 9 -1. + <_> + 8 1 2 9 2. + <_> + + <_> + 12 19 2 1 -1. + <_> + 12 19 1 1 2. + <_> + + <_> + 1 2 4 9 -1. + <_> + 3 2 2 9 2. + <_> + + <_> + 7 5 6 4 -1. + <_> + 9 5 2 4 3. + <_> + + <_> + 9 4 2 4 -1. + <_> + 9 6 2 2 2. + <_> + + <_> + 14 5 2 8 -1. + <_> + 14 9 2 4 2. + <_> + + <_> + 7 6 5 12 -1. + <_> + 7 12 5 6 2. + <_> + + <_> + 14 6 2 6 -1. + <_> + 14 9 2 3 2. + <_> + + <_> + 4 6 2 6 -1. + <_> + 4 9 2 3 2. + <_> + + <_> + 8 15 10 4 -1. + <_> + 13 15 5 2 2. + <_> + 8 17 5 2 2. + <_> + + <_> + 6 18 2 2 -1. + <_> + 7 18 1 2 2. + <_> + + <_> + 11 3 6 2 -1. + <_> + 11 4 6 1 2. + <_> + + <_> + 2 0 16 6 -1. + <_> + 2 2 16 2 3. + <_> + + <_> + 11 3 6 2 -1. + <_> + 11 4 6 1 2. + <_> + + <_> + 4 11 10 3 -1. + <_> + 4 12 10 1 3. + <_> + + <_> + 11 3 6 2 -1. + <_> + 11 4 6 1 2. + <_> + + <_> + 3 3 6 2 -1. + <_> + 3 4 6 1 2. + <_> + + <_> + 16 0 4 7 -1. + <_> + 16 0 2 7 2. + <_> + + <_> + 0 14 9 6 -1. + <_> + 0 16 9 2 3. + <_> + + <_> + 9 16 3 3 -1. + <_> + 9 17 3 1 3. + <_> + + <_> + 4 6 6 2 -1. + <_> + 6 6 2 2 3. + <_> + + <_> + 15 11 1 3 -1. + <_> + 15 12 1 1 3. + <_> + + <_> + 5 5 2 3 -1. + <_> + 5 6 2 1 3. + <_> + + <_> + 10 9 2 2 -1. + <_> + 10 10 2 1 2. + <_> + + <_> + 3 1 4 3 -1. + <_> + 5 1 2 3 2. + <_> + + <_> + 16 0 4 7 -1. + <_> + 16 0 2 7 2. + <_> + + <_> + 0 0 20 1 -1. + <_> + 10 0 10 1 2. + <_> + + <_> + 15 11 1 3 -1. + <_> + 15 12 1 1 3. + <_> + + <_> + 0 4 3 4 -1. + <_> + 1 4 1 4 3. + <_> + + <_> + 16 3 3 6 -1. + <_> + 16 5 3 2 3. + <_> + + <_> + 1 3 3 6 -1. + <_> + 1 5 3 2 3. + <_> + + <_> + 6 2 12 6 -1. + <_> + 12 2 6 3 2. + <_> + 6 5 6 3 2. + <_> + + <_> + 8 10 4 3 -1. + <_> + 8 11 4 1 3. + <_> + + <_> + 4 2 14 6 -1. + <_> + 11 2 7 3 2. + <_> + 4 5 7 3 2. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 15 13 2 3 -1. + <_> + 15 14 2 1 3. + <_> + + <_> + 8 12 4 3 -1. + <_> + 8 13 4 1 3. + <_> + + <_> + 15 11 1 3 -1. + <_> + 15 12 1 1 3. + <_> + + <_> + 7 13 5 2 -1. + <_> + 7 14 5 1 2. + <_> + + <_> + 7 12 6 3 -1. + <_> + 7 13 6 1 3. + <_> + + <_> + 5 11 4 4 -1. + <_> + 5 13 4 2 2. + <_> + + <_> + 11 4 3 3 -1. + <_> + 12 4 1 3 3. + <_> + + <_> + 6 4 3 3 -1. + <_> + 7 4 1 3 3. + <_> + + <_> + 16 5 3 6 -1. + <_> + 17 5 1 6 3. + <_> + + <_> + 3 6 12 7 -1. + <_> + 7 6 4 7 3. + <_> + + <_> + 16 5 3 6 -1. + <_> + 17 5 1 6 3. + <_> + + <_> + 3 13 2 3 -1. + <_> + 3 14 2 1 3. + <_> + + <_> + 16 5 3 6 -1. + <_> + 17 5 1 6 3. + <_> + + <_> + 1 5 3 6 -1. + <_> + 2 5 1 6 3. + <_> + + <_> + 1 9 18 1 -1. + <_> + 7 9 6 1 3. + <_> + + <_> + 0 9 8 7 -1. + <_> + 4 9 4 7 2. + <_> + + <_> + 12 11 8 2 -1. + <_> + 12 12 8 1 2. + <_> + + <_> + 0 11 8 2 -1. + <_> + 0 12 8 1 2. + <_> + + <_> + 9 13 2 3 -1. + <_> + 9 14 2 1 3. + <_> + + <_> + 4 10 12 4 -1. + <_> + 4 10 6 2 2. + <_> + 10 12 6 2 2. + <_> + + <_> + 9 3 3 7 -1. + <_> + 10 3 1 7 3. + <_> + + <_> + 7 2 3 5 -1. + <_> + 8 2 1 5 3. + <_> + + <_> + 9 12 4 6 -1. + <_> + 11 12 2 3 2. + <_> + 9 15 2 3 2. + <_> + + <_> + 8 7 3 6 -1. + <_> + 9 7 1 6 3. + <_> + + <_> + 15 4 4 2 -1. + <_> + 15 5 4 1 2. + <_> + + <_> + 8 7 3 3 -1. + <_> + 9 7 1 3 3. + <_> + + <_> + 14 2 6 4 -1. + <_> + 14 4 6 2 2. + <_> + + <_> + 7 16 6 1 -1. + <_> + 9 16 2 1 3. + <_> + + <_> + 15 13 2 3 -1. + <_> + 15 14 2 1 3. + <_> + + <_> + 8 7 3 10 -1. + <_> + 9 7 1 10 3. + <_> + + <_> + 11 10 2 6 -1. + <_> + 11 12 2 2 3. + <_> + + <_> + 6 10 4 1 -1. + <_> + 8 10 2 1 2. + <_> + + <_> + 10 9 2 2 -1. + <_> + 10 10 2 1 2. + <_> + + <_> + 8 9 2 2 -1. + <_> + 8 10 2 1 2. + <_> + + <_> + 12 7 2 2 -1. + <_> + 13 7 1 1 2. + <_> + 12 8 1 1 2. + <_> + + <_> + 5 7 2 2 -1. + <_> + 5 7 1 1 2. + <_> + 6 8 1 1 2. + <_> + + <_> + 13 0 3 14 -1. + <_> + 14 0 1 14 3. + <_> + + <_> + 4 0 3 14 -1. + <_> + 5 0 1 14 3. + <_> + + <_> + 13 4 3 14 -1. + <_> + 14 4 1 14 3. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 4 2 3 16 -1. + <_> + 5 2 1 16 3. + <_> + + <_> + 7 2 8 10 -1. + <_> + 7 7 8 5 2. + <_> + + <_> + 6 14 7 3 -1. + <_> + 6 15 7 1 3. + <_> + + <_> + 9 2 10 12 -1. + <_> + 14 2 5 6 2. + <_> + 9 8 5 6 2. + <_> + + <_> + 6 7 8 2 -1. + <_> + 6 8 8 1 2. + <_> + + <_> + 8 13 4 6 -1. + <_> + 8 16 4 3 2. + <_> + + <_> + 6 6 1 3 -1. + <_> + 6 7 1 1 3. + <_> + + <_> + 16 2 4 6 -1. + <_> + 16 4 4 2 3. + <_> + + <_> + 6 6 4 2 -1. + <_> + 6 6 2 1 2. + <_> + 8 7 2 1 2. + <_> + + <_> + 16 2 4 6 -1. + <_> + 16 4 4 2 3. + <_> + + <_> + 0 2 4 6 -1. + <_> + 0 4 4 2 3. + <_> + + <_> + 9 6 2 6 -1. + <_> + 9 6 1 6 2. + <_> + + <_> + 3 4 6 10 -1. + <_> + 3 9 6 5 2. + <_> + + <_> + 9 5 2 6 -1. + <_> + 9 5 1 6 2. + <_> + + <_> + 3 13 2 3 -1. + <_> + 3 14 2 1 3. + <_> + + <_> + 13 13 3 2 -1. + <_> + 13 14 3 1 2. + <_> + + <_> + 2 16 10 4 -1. + <_> + 2 16 5 2 2. + <_> + 7 18 5 2 2. + <_> + + <_> + 5 6 10 6 -1. + <_> + 10 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 7 14 1 3 -1. + <_> + 7 15 1 1 3. + <_> + + <_> + 14 16 6 3 -1. + <_> + 14 17 6 1 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 7 4 10 3 -1. + <_> + 7 5 10 1 3. + <_> + + <_> + 0 4 5 4 -1. + <_> + 0 6 5 2 2. + <_> + + <_> + 13 11 3 9 -1. + <_> + 13 14 3 3 3. + <_> + + <_> + 4 11 3 9 -1. + <_> + 4 14 3 3 3. + <_> + + <_> + 9 7 2 1 -1. + <_> + 9 7 1 1 2. + <_> + + <_> + 5 0 6 17 -1. + <_> + 7 0 2 17 3. + <_> + + <_> + 10 3 6 3 -1. + <_> + 10 3 3 3 2. + <_> + + <_> + 2 2 15 4 -1. + <_> + 7 2 5 4 3. + <_> + + <_> + 8 2 8 2 -1. + <_> + 12 2 4 1 2. + <_> + 8 3 4 1 2. + <_> + + <_> + 8 1 3 6 -1. + <_> + 8 3 3 2 3. + <_> + + <_> + 9 17 2 2 -1. + <_> + 9 18 2 1 2. + <_> + + <_> + 0 0 2 14 -1. + <_> + 1 0 1 14 2. + <_> + + <_> + 12 0 7 3 -1. + <_> + 12 1 7 1 3. + <_> + + <_> + 1 14 1 2 -1. + <_> + 1 15 1 1 2. + <_> + + <_> + 14 12 2 8 -1. + <_> + 15 12 1 4 2. + <_> + 14 16 1 4 2. + <_> + + <_> + 1 0 7 3 -1. + <_> + 1 1 7 1 3. + <_> + + <_> + 14 12 2 8 -1. + <_> + 15 12 1 4 2. + <_> + 14 16 1 4 2. + <_> + + <_> + 6 0 8 12 -1. + <_> + 6 0 4 6 2. + <_> + 10 6 4 6 2. + <_> + + <_> + 6 1 8 9 -1. + <_> + 6 4 8 3 3. + <_> + + <_> + 5 2 2 2 -1. + <_> + 5 3 2 1 2. + <_> + + <_> + 13 14 6 6 -1. + <_> + 16 14 3 3 2. + <_> + 13 17 3 3 2. + <_> + + <_> + 0 17 20 2 -1. + <_> + 0 17 10 1 2. + <_> + 10 18 10 1 2. + <_> + + <_> + 10 3 2 6 -1. + <_> + 11 3 1 3 2. + <_> + 10 6 1 3 2. + <_> + + <_> + 5 12 6 2 -1. + <_> + 8 12 3 2 2. + <_> + + <_> + 10 7 6 13 -1. + <_> + 10 7 3 13 2. + <_> + + <_> + 5 15 10 5 -1. + <_> + 10 15 5 5 2. + <_> + + <_> + 10 4 4 10 -1. + <_> + 10 4 2 10 2. + <_> + + <_> + 5 7 2 1 -1. + <_> + 6 7 1 1 2. + <_> + + <_> + 10 3 6 7 -1. + <_> + 10 3 3 7 2. + <_> + + <_> + 4 3 6 7 -1. + <_> + 7 3 3 7 2. + <_> + + <_> + 1 7 18 5 -1. + <_> + 7 7 6 5 3. + <_> + + <_> + 3 17 4 3 -1. + <_> + 5 17 2 3 2. + <_> + + <_> + 8 14 12 6 -1. + <_> + 14 14 6 3 2. + <_> + 8 17 6 3 2. + <_> + + <_> + 0 13 20 4 -1. + <_> + 0 13 10 2 2. + <_> + 10 15 10 2 2. + <_> + + <_> + 4 5 14 2 -1. + <_> + 11 5 7 1 2. + <_> + 4 6 7 1 2. + <_> + + <_> + 1 2 10 12 -1. + <_> + 1 2 5 6 2. + <_> + 6 8 5 6 2. + <_> + + <_> + 6 1 14 3 -1. + <_> + 6 2 14 1 3. + <_> + + <_> + 8 16 2 3 -1. + <_> + 8 17 2 1 3. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 5 15 4 2 -1. + <_> + 5 15 2 1 2. + <_> + 7 16 2 1 2. + <_> + + <_> + 10 15 1 3 -1. + <_> + 10 16 1 1 3. + <_> + + <_> + 8 16 4 4 -1. + <_> + 8 16 2 2 2. + <_> + 10 18 2 2 2. + <_> + + <_> + 6 11 8 6 -1. + <_> + 6 14 8 3 2. + <_> + + <_> + 2 13 5 2 -1. + <_> + 2 14 5 1 2. + <_> + + <_> + 13 14 6 6 -1. + <_> + 16 14 3 3 2. + <_> + 13 17 3 3 2. + <_> + + <_> + 1 9 18 4 -1. + <_> + 7 9 6 4 3. + <_> + + <_> + 13 14 6 6 -1. + <_> + 16 14 3 3 2. + <_> + 13 17 3 3 2. + <_> + + <_> + 0 2 1 6 -1. + <_> + 0 4 1 2 3. + <_> + + <_> + 5 0 15 20 -1. + <_> + 5 10 15 10 2. + <_> + + <_> + 1 14 6 6 -1. + <_> + 1 14 3 3 2. + <_> + 4 17 3 3 2. + <_> + + <_> + 8 14 4 6 -1. + <_> + 10 14 2 3 2. + <_> + 8 17 2 3 2. + <_> + + <_> + 7 11 2 1 -1. + <_> + 8 11 1 1 2. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 8 17 3 2 -1. + <_> + 9 17 1 2 3. + <_> + + <_> + 12 14 4 6 -1. + <_> + 14 14 2 3 2. + <_> + 12 17 2 3 2. + <_> + + <_> + 4 14 4 6 -1. + <_> + 4 14 2 3 2. + <_> + 6 17 2 3 2. + <_> + + <_> + 13 14 2 6 -1. + <_> + 14 14 1 3 2. + <_> + 13 17 1 3 2. + <_> + + <_> + 5 14 2 6 -1. + <_> + 5 14 1 3 2. + <_> + 6 17 1 3 2. + <_> + + <_> + 7 0 6 12 -1. + <_> + 7 4 6 4 3. + <_> + + <_> + 0 7 12 2 -1. + <_> + 4 7 4 2 3. + <_> + + <_> + 10 3 3 13 -1. + <_> + 11 3 1 13 3. + <_> + + <_> + 7 3 3 13 -1. + <_> + 8 3 1 13 3. + <_> + + <_> + 10 8 6 3 -1. + <_> + 10 9 6 1 3. + <_> + + <_> + 3 11 3 2 -1. + <_> + 4 11 1 2 3. + <_> + + <_> + 13 12 6 8 -1. + <_> + 16 12 3 4 2. + <_> + 13 16 3 4 2. + <_> + + <_> + 7 6 6 5 -1. + <_> + 9 6 2 5 3. + <_> + + <_> + 17 11 2 7 -1. + <_> + 17 11 1 7 2. + <_> + + <_> + 3 13 8 2 -1. + <_> + 7 13 4 2 2. + <_> + + <_> + 6 9 8 3 -1. + <_> + 6 10 8 1 3. + <_> + + <_> + 4 3 4 3 -1. + <_> + 4 4 4 1 3. + <_> + + <_> + 11 3 4 3 -1. + <_> + 11 4 4 1 3. + <_> + + <_> + 1 4 17 12 -1. + <_> + 1 8 17 4 3. + <_> + + <_> + 11 3 4 3 -1. + <_> + 11 4 4 1 3. + <_> + + <_> + 4 8 6 3 -1. + <_> + 4 9 6 1 3. + <_> + + <_> + 12 3 5 3 -1. + <_> + 12 4 5 1 3. + <_> + + <_> + 1 11 2 7 -1. + <_> + 2 11 1 7 2. + <_> + + <_> + 15 12 2 8 -1. + <_> + 16 12 1 4 2. + <_> + 15 16 1 4 2. + <_> + + <_> + 4 8 11 3 -1. + <_> + 4 9 11 1 3. + <_> + + <_> + 9 13 6 2 -1. + <_> + 12 13 3 1 2. + <_> + 9 14 3 1 2. + <_> + + <_> + 6 13 4 3 -1. + <_> + 6 14 4 1 3. + <_> + + <_> + 9 12 3 3 -1. + <_> + 10 12 1 3 3. + <_> + + <_> + 5 3 3 3 -1. + <_> + 5 4 3 1 3. + <_> + + <_> + 9 4 2 3 -1. + <_> + 9 5 2 1 3. + <_> + + <_> + 0 2 16 3 -1. + <_> + 0 3 16 1 3. + <_> + + <_> + 15 12 2 8 -1. + <_> + 16 12 1 4 2. + <_> + 15 16 1 4 2. + <_> + + <_> + 3 12 2 8 -1. + <_> + 3 12 1 4 2. + <_> + 4 16 1 4 2. + <_> + + <_> + 14 13 3 6 -1. + <_> + 14 15 3 2 3. + <_> + + <_> + 3 13 3 6 -1. + <_> + 3 15 3 2 3. + <_> + + <_> + 6 5 10 2 -1. + <_> + 11 5 5 1 2. + <_> + 6 6 5 1 2. + <_> + + <_> + 2 14 14 6 -1. + <_> + 2 17 14 3 2. + <_> + + <_> + 10 14 1 3 -1. + <_> + 10 15 1 1 3. + <_> + + <_> + 4 16 2 2 -1. + <_> + 4 16 1 1 2. + <_> + 5 17 1 1 2. + <_> + + <_> + 10 6 2 3 -1. + <_> + 10 7 2 1 3. + <_> + + <_> + 0 17 20 2 -1. + <_> + 0 17 10 1 2. + <_> + 10 18 10 1 2. + <_> + + <_> + 13 6 1 3 -1. + <_> + 13 7 1 1 3. + <_> + + <_> + 8 13 3 2 -1. + <_> + 9 13 1 2 3. + <_> + + <_> + 12 2 3 3 -1. + <_> + 13 2 1 3 3. + <_> + + <_> + 3 18 2 2 -1. + <_> + 3 18 1 1 2. + <_> + 4 19 1 1 2. + <_> + + <_> + 9 16 3 4 -1. + <_> + 10 16 1 4 3. + <_> + + <_> + 6 6 1 3 -1. + <_> + 6 7 1 1 3. + <_> + + <_> + 13 1 5 2 -1. + <_> + 13 2 5 1 2. + <_> + + <_> + 7 14 6 2 -1. + <_> + 7 14 3 1 2. + <_> + 10 15 3 1 2. + <_> + + <_> + 11 3 3 4 -1. + <_> + 12 3 1 4 3. + <_> + + <_> + 1 13 12 6 -1. + <_> + 5 13 4 6 3. + <_> + + <_> + 14 11 5 2 -1. + <_> + 14 12 5 1 2. + <_> + + <_> + 2 15 14 4 -1. + <_> + 2 15 7 2 2. + <_> + 9 17 7 2 2. + <_> + + <_> + 3 7 14 2 -1. + <_> + 10 7 7 1 2. + <_> + 3 8 7 1 2. + <_> + + <_> + 1 11 4 2 -1. + <_> + 1 12 4 1 2. + <_> + + <_> + 14 0 6 14 -1. + <_> + 16 0 2 14 3. + <_> + + <_> + 4 11 1 3 -1. + <_> + 4 12 1 1 3. + <_> + + <_> + 14 0 6 14 -1. + <_> + 16 0 2 14 3. + <_> + + <_> + 1 10 3 7 -1. + <_> + 2 10 1 7 3. + <_> + + <_> + 8 12 9 2 -1. + <_> + 8 13 9 1 2. + <_> + + <_> + 0 6 20 1 -1. + <_> + 10 6 10 1 2. + <_> + + <_> + 8 4 4 4 -1. + <_> + 8 4 2 4 2. + <_> + + <_> + 0 0 2 2 -1. + <_> + 0 1 2 1 2. + <_> + + <_> + 5 3 10 9 -1. + <_> + 5 6 10 3 3. + <_> + + <_> + 15 2 4 10 -1. + <_> + 15 2 2 10 2. + <_> + + <_> + 8 2 2 7 -1. + <_> + 9 2 1 7 2. + <_> + + <_> + 7 4 12 1 -1. + <_> + 11 4 4 1 3. + <_> + + <_> + 3 4 9 1 -1. + <_> + 6 4 3 1 3. + <_> + + <_> + 15 10 1 4 -1. + <_> + 15 12 1 2 2. + <_> + + <_> + 4 10 6 4 -1. + <_> + 7 10 3 4 2. + <_> + + <_> + 15 9 1 6 -1. + <_> + 15 12 1 3 2. + <_> + + <_> + 7 17 6 3 -1. + <_> + 7 18 6 1 3. + <_> + + <_> + 14 3 2 16 -1. + <_> + 15 3 1 8 2. + <_> + 14 11 1 8 2. + <_> + + <_> + 4 9 1 6 -1. + <_> + 4 12 1 3 2. + <_> + + <_> + 12 1 5 2 -1. + <_> + 12 2 5 1 2. + <_> + + <_> + 6 18 4 2 -1. + <_> + 6 18 2 1 2. + <_> + 8 19 2 1 2. + <_> + + <_> + 2 4 16 10 -1. + <_> + 10 4 8 5 2. + <_> + 2 9 8 5 2. + <_> + + <_> + 6 5 1 10 -1. + <_> + 6 10 1 5 2. + <_> + + <_> + 4 8 15 2 -1. + <_> + 9 8 5 2 3. + <_> + + <_> + 1 8 15 2 -1. + <_> + 6 8 5 2 3. + <_> + + <_> + 9 5 3 6 -1. + <_> + 9 7 3 2 3. + <_> + + <_> + 5 7 8 2 -1. + <_> + 9 7 4 2 2. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 1 0 16 3 -1. + <_> + 1 1 16 1 3. + <_> + + <_> + 11 2 7 2 -1. + <_> + 11 3 7 1 2. + <_> + + <_> + 5 1 10 18 -1. + <_> + 5 7 10 6 3. + <_> + + <_> + 17 4 3 2 -1. + <_> + 18 4 1 2 3. + <_> + + <_> + 8 13 1 3 -1. + <_> + 8 14 1 1 3. + <_> + + <_> + 3 14 14 6 -1. + <_> + 3 16 14 2 3. + <_> + + <_> + 0 2 3 4 -1. + <_> + 1 2 1 4 3. + <_> + + <_> + 12 1 5 2 -1. + <_> + 12 2 5 1 2. + <_> + + <_> + 3 1 5 2 -1. + <_> + 3 2 5 1 2. + <_> + + <_> + 10 13 2 3 -1. + <_> + 10 14 2 1 3. + <_> + + <_> + 8 13 2 3 -1. + <_> + 8 14 2 1 3. + <_> + + <_> + 14 12 2 3 -1. + <_> + 14 13 2 1 3. + <_> + + <_> + 7 2 2 3 -1. + <_> + 7 3 2 1 3. + <_> + + <_> + 5 6 10 4 -1. + <_> + 10 6 5 2 2. + <_> + 5 8 5 2 2. + <_> + + <_> + 9 13 1 6 -1. + <_> + 9 16 1 3 2. + <_> + + <_> + 10 12 2 2 -1. + <_> + 11 12 1 1 2. + <_> + 10 13 1 1 2. + <_> + + <_> + 4 12 2 3 -1. + <_> + 4 13 2 1 3. + <_> + + <_> + 14 4 6 6 -1. + <_> + 14 6 6 2 3. + <_> + + <_> + 8 17 2 3 -1. + <_> + 8 18 2 1 3. + <_> + + <_> + 16 4 4 6 -1. + <_> + 16 6 4 2 3. + <_> + + <_> + 0 4 4 6 -1. + <_> + 0 6 4 2 3. + <_> + + <_> + 14 6 2 3 -1. + <_> + 14 6 1 3 2. + <_> + + <_> + 4 9 8 1 -1. + <_> + 8 9 4 1 2. + <_> + + <_> + 8 12 4 3 -1. + <_> + 8 13 4 1 3. + <_> + + <_> + 5 12 10 6 -1. + <_> + 5 14 10 2 3. + <_> + + <_> + 11 12 1 2 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 8 15 4 2 -1. + <_> + 8 16 4 1 2. + <_> + + <_> + 6 9 8 8 -1. + <_> + 10 9 4 4 2. + <_> + 6 13 4 4 2. + <_> + + <_> + 7 12 4 6 -1. + <_> + 7 12 2 3 2. + <_> + 9 15 2 3 2. + <_> + + <_> + 10 11 3 1 -1. + <_> + 11 11 1 1 3. + <_> + + <_> + 9 7 2 10 -1. + <_> + 9 7 1 5 2. + <_> + 10 12 1 5 2. + <_> + + <_> + 8 0 6 6 -1. + <_> + 10 0 2 6 3. + <_> + + <_> + 3 11 2 6 -1. + <_> + 3 13 2 2 3. + <_> + + <_> + 16 12 1 2 -1. + <_> + 16 13 1 1 2. + <_> + + <_> + 1 14 6 6 -1. + <_> + 1 14 3 3 2. + <_> + 4 17 3 3 2. + <_> + + <_> + 13 1 3 6 -1. + <_> + 14 1 1 6 3. + <_> + + <_> + 8 8 2 2 -1. + <_> + 8 9 2 1 2. + <_> + + <_> + 9 9 3 3 -1. + <_> + 10 9 1 3 3. + <_> + + <_> + 8 7 3 3 -1. + <_> + 8 8 3 1 3. + <_> + + <_> + 14 0 2 3 -1. + <_> + 14 0 1 3 2. + <_> + + <_> + 1 0 18 9 -1. + <_> + 7 0 6 9 3. + <_> + + <_> + 11 5 4 15 -1. + <_> + 11 5 2 15 2. + <_> + + <_> + 5 5 4 15 -1. + <_> + 7 5 2 15 2. + <_> + + <_> + 14 0 2 3 -1. + <_> + 14 0 1 3 2. + <_> + + <_> + 4 0 2 3 -1. + <_> + 5 0 1 3 2. + <_> + + <_> + 11 12 2 2 -1. + <_> + 12 12 1 1 2. + <_> + 11 13 1 1 2. + <_> + + <_> + 7 12 2 2 -1. + <_> + 7 12 1 1 2. + <_> + 8 13 1 1 2. + <_> + + <_> + 12 0 3 4 -1. + <_> + 13 0 1 4 3. + <_> + + <_> + 4 11 3 3 -1. + <_> + 4 12 3 1 3. + <_> + + <_> + 12 7 4 2 -1. + <_> + 12 8 4 1 2. + <_> + + <_> + 8 10 3 2 -1. + <_> + 9 10 1 2 3. + <_> + + <_> + 9 9 3 2 -1. + <_> + 10 9 1 2 3. + <_> + + <_> + 8 9 3 2 -1. + <_> + 9 9 1 2 3. + <_> + + <_> + 12 0 3 4 -1. + <_> + 13 0 1 4 3. + <_> + + <_> + 5 0 3 4 -1. + <_> + 6 0 1 4 3. + <_> + + <_> + 4 14 12 4 -1. + <_> + 10 14 6 2 2. + <_> + 4 16 6 2 2. + <_> + + <_> + 8 13 2 3 -1. + <_> + 8 14 2 1 3. + <_> + + <_> + 10 10 3 8 -1. + <_> + 10 14 3 4 2. + <_> + + <_> + 8 10 4 8 -1. + <_> + 8 10 2 4 2. + <_> + 10 14 2 4 2. + <_> + + <_> + 10 8 3 1 -1. + <_> + 11 8 1 1 3. + <_> + + <_> + 9 12 1 6 -1. + <_> + 9 15 1 3 2. + <_> + + <_> + 10 8 3 1 -1. + <_> + 11 8 1 1 3. + <_> + + <_> + 7 8 3 1 -1. + <_> + 8 8 1 1 3. + <_> + + <_> + 5 2 15 14 -1. + <_> + 5 9 15 7 2. + <_> + + <_> + 2 1 2 10 -1. + <_> + 2 1 1 5 2. + <_> + 3 6 1 5 2. + <_> + + <_> + 14 14 2 3 -1. + <_> + 14 15 2 1 3. + <_> + + <_> + 2 7 3 3 -1. + <_> + 3 7 1 3 3. + <_> + + <_> + 17 4 3 3 -1. + <_> + 17 5 3 1 3. + <_> + + <_> + 0 4 3 3 -1. + <_> + 0 5 3 1 3. + <_> + + <_> + 13 5 6 2 -1. + <_> + 16 5 3 1 2. + <_> + 13 6 3 1 2. + <_> + + <_> + 4 19 12 1 -1. + <_> + 8 19 4 1 3. + <_> + + <_> + 12 12 2 4 -1. + <_> + 12 14 2 2 2. + <_> + + <_> + 3 15 1 3 -1. + <_> + 3 16 1 1 3. + <_> + + <_> + 11 16 6 4 -1. + <_> + 11 16 3 4 2. + <_> + + <_> + 2 10 3 10 -1. + <_> + 3 10 1 10 3. + <_> + + <_> + 12 8 2 4 -1. + <_> + 12 8 1 4 2. + <_> + + <_> + 6 8 2 4 -1. + <_> + 7 8 1 4 2. + <_> + + <_> + 10 14 2 3 -1. + <_> + 10 14 1 3 2. + <_> + + <_> + 5 1 10 3 -1. + <_> + 10 1 5 3 2. + <_> + + <_> + 10 7 3 2 -1. + <_> + 11 7 1 2 3. + <_> + + <_> + 5 6 9 2 -1. + <_> + 8 6 3 2 3. + <_> + + <_> + 9 8 2 2 -1. + <_> + 9 9 2 1 2. + <_> + + <_> + 2 11 16 6 -1. + <_> + 2 11 8 3 2. + <_> + 10 14 8 3 2. + <_> + + <_> + 12 7 2 2 -1. + <_> + 13 7 1 1 2. + <_> + 12 8 1 1 2. + <_> + + <_> + 9 5 2 3 -1. + <_> + 9 6 2 1 3. + <_> + + <_> + 9 7 3 2 -1. + <_> + 10 7 1 2 3. + <_> + + <_> + 5 1 8 12 -1. + <_> + 5 7 8 6 2. + <_> + + <_> + 13 5 2 2 -1. + <_> + 13 6 2 1 2. + <_> + + <_> + 5 5 2 2 -1. + <_> + 5 6 2 1 2. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 4 14 2 3 -1. + <_> + 4 15 2 1 3. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 9 14 2 6 -1. + <_> + 10 14 1 3 2. + <_> + 9 17 1 3 2. + <_> + + <_> + 8 14 3 2 -1. + <_> + 9 14 1 2 3. + <_> + + <_> + 9 5 6 6 -1. + <_> + 11 5 2 6 3. + <_> + + <_> + 5 5 6 6 -1. + <_> + 7 5 2 6 3. + <_> + + <_> + 13 13 1 2 -1. + <_> + 13 14 1 1 2. + <_> + + <_> + 0 2 10 2 -1. + <_> + 0 3 10 1 2. + <_> + + <_> + 13 13 1 2 -1. + <_> + 13 14 1 1 2. + <_> + + <_> + 5 7 2 2 -1. + <_> + 5 7 1 1 2. + <_> + 6 8 1 1 2. + <_> + + <_> + 13 5 2 7 -1. + <_> + 13 5 1 7 2. + <_> + + <_> + 6 13 1 2 -1. + <_> + 6 14 1 1 2. + <_> + + <_> + 11 0 3 7 -1. + <_> + 12 0 1 7 3. + <_> + + <_> + 0 3 2 16 -1. + <_> + 0 3 1 8 2. + <_> + 1 11 1 8 2. + <_> + + <_> + 11 0 3 7 -1. + <_> + 12 0 1 7 3. + <_> + + <_> + 6 0 3 7 -1. + <_> + 7 0 1 7 3. + <_> + + <_> + 11 16 8 4 -1. + <_> + 11 16 4 4 2. + <_> + + <_> + 1 16 8 4 -1. + <_> + 5 16 4 4 2. + <_> + + <_> + 13 5 2 7 -1. + <_> + 13 5 1 7 2. + <_> + + <_> + 5 5 2 7 -1. + <_> + 6 5 1 7 2. + <_> + + <_> + 18 6 2 14 -1. + <_> + 18 13 2 7 2. + <_> + + <_> + 6 10 3 4 -1. + <_> + 6 12 3 2 2. + <_> + + <_> + 14 7 1 2 -1. + <_> + 14 8 1 1 2. + <_> + + <_> + 0 1 18 6 -1. + <_> + 0 1 9 3 2. + <_> + 9 4 9 3 2. + <_> + + <_> + 14 7 1 2 -1. + <_> + 14 8 1 1 2. + <_> + + <_> + 0 6 2 14 -1. + <_> + 0 13 2 7 2. + <_> + + <_> + 17 0 3 12 -1. + <_> + 18 0 1 12 3. + <_> + + <_> + 0 6 18 3 -1. + <_> + 0 7 18 1 3. + <_> + + <_> + 6 0 14 16 -1. + <_> + 6 8 14 8 2. + <_> + + <_> + 0 0 3 12 -1. + <_> + 1 0 1 12 3. + <_> + + <_> + 13 0 3 7 -1. + <_> + 14 0 1 7 3. + <_> + + <_> + 5 7 1 2 -1. + <_> + 5 8 1 1 2. + <_> + + <_> + 14 4 6 6 -1. + <_> + 14 6 6 2 3. + <_> + + <_> + 5 7 7 2 -1. + <_> + 5 8 7 1 2. + <_> + + <_> + 8 6 6 9 -1. + <_> + 8 9 6 3 3. + <_> + + <_> + 5 4 6 1 -1. + <_> + 7 4 2 1 3. + <_> + + <_> + 13 0 6 4 -1. + <_> + 16 0 3 2 2. + <_> + 13 2 3 2 2. + <_> + + <_> + 1 2 18 12 -1. + <_> + 1 6 18 4 3. + <_> + + <_> + 3 2 17 12 -1. + <_> + 3 6 17 4 3. + <_> + + <_> + 5 14 7 3 -1. + <_> + 5 15 7 1 3. + <_> + + <_> + 10 14 1 3 -1. + <_> + 10 15 1 1 3. + <_> + + <_> + 3 14 3 3 -1. + <_> + 3 15 3 1 3. + <_> + + <_> + 14 4 6 6 -1. + <_> + 14 6 6 2 3. + <_> + + <_> + 0 4 6 6 -1. + <_> + 0 6 6 2 3. + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. + <_> + + <_> + 4 5 4 3 -1. + <_> + 4 6 4 1 3. + <_> + + <_> + 18 0 2 6 -1. + <_> + 18 2 2 2 3. + <_> + + <_> + 8 1 4 9 -1. + <_> + 10 1 2 9 2. + <_> + + <_> + 6 6 8 2 -1. + <_> + 6 6 4 2 2. + <_> + + <_> + 6 5 4 2 -1. + <_> + 6 5 2 1 2. + <_> + 8 6 2 1 2. + <_> + + <_> + 10 5 2 3 -1. + <_> + 10 6 2 1 3. + <_> + + <_> + 9 5 1 3 -1. + <_> + 9 6 1 1 3. + <_> + + <_> + 9 10 2 2 -1. + <_> + 9 11 2 1 2. + <_> + + <_> + 0 8 4 3 -1. + <_> + 0 9 4 1 3. + <_> + + <_> + 6 0 8 6 -1. + <_> + 6 3 8 3 2. + <_> + + <_> + 1 0 6 4 -1. + <_> + 1 0 3 2 2. + <_> + 4 2 3 2 2. + <_> + + <_> + 13 0 3 7 -1. + <_> + 14 0 1 7 3. + <_> + + <_> + 9 16 2 2 -1. + <_> + 9 17 2 1 2. + <_> + + <_> + 11 4 6 10 -1. + <_> + 11 9 6 5 2. + <_> + + <_> + 0 10 19 2 -1. + <_> + 0 11 19 1 2. + <_> + + <_> + 9 5 8 9 -1. + <_> + 9 8 8 3 3. + <_> + + <_> + 4 0 3 7 -1. + <_> + 5 0 1 7 3. + <_> + + <_> + 8 6 4 12 -1. + <_> + 10 6 2 6 2. + <_> + 8 12 2 6 2. + <_> + + <_> + 0 2 6 4 -1. + <_> + 0 4 6 2 2. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 8 0 3 7 -1. + <_> + 9 0 1 7 3. + <_> + + <_> + 9 5 3 4 -1. + <_> + 10 5 1 4 3. + <_> + + <_> + 8 5 3 4 -1. + <_> + 9 5 1 4 3. + <_> + + <_> + 7 6 6 1 -1. + <_> + 9 6 2 1 3. + <_> + + <_> + 7 14 4 4 -1. + <_> + 7 14 2 2 2. + <_> + 9 16 2 2 2. + <_> + + <_> + 13 14 4 6 -1. + <_> + 15 14 2 3 2. + <_> + 13 17 2 3 2. + <_> + + <_> + 7 8 1 8 -1. + <_> + 7 12 1 4 2. + <_> + + <_> + 16 0 2 8 -1. + <_> + 17 0 1 4 2. + <_> + 16 4 1 4 2. + <_> + + <_> + 2 0 2 8 -1. + <_> + 2 0 1 4 2. + <_> + 3 4 1 4 2. + <_> + + <_> + 6 1 14 3 -1. + <_> + 6 2 14 1 3. + <_> + + <_> + 7 9 3 10 -1. + <_> + 7 14 3 5 2. + <_> + + <_> + 9 14 2 2 -1. + <_> + 9 15 2 1 2. + <_> + + <_> + 7 7 6 8 -1. + <_> + 7 11 6 4 2. + <_> + + <_> + 9 7 3 6 -1. + <_> + 9 10 3 3 2. + <_> + + <_> + 7 13 3 3 -1. + <_> + 7 14 3 1 3. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 0 1 18 2 -1. + <_> + 6 1 6 2 3. + <_> + + <_> + 7 1 6 14 -1. + <_> + 7 8 6 7 2. + <_> + + <_> + 1 9 18 1 -1. + <_> + 7 9 6 1 3. + <_> + + <_> + 9 7 2 2 -1. + <_> + 9 7 1 2 2. + <_> + + <_> + 9 3 2 9 -1. + <_> + 10 3 1 9 2. + <_> + + <_> + 18 14 2 3 -1. + <_> + 18 15 2 1 3. + <_> + + <_> + 7 11 3 1 -1. + <_> + 8 11 1 1 3. + <_> + + <_> + 10 8 3 4 -1. + <_> + 11 8 1 4 3. + <_> + + <_> + 7 14 3 6 -1. + <_> + 8 14 1 6 3. + <_> + + <_> + 10 8 3 4 -1. + <_> + 11 8 1 4 3. + <_> + + <_> + 7 8 3 4 -1. + <_> + 8 8 1 4 3. + <_> + + <_> + 7 9 6 9 -1. + <_> + 7 12 6 3 3. + <_> + + <_> + 0 14 2 3 -1. + <_> + 0 15 2 1 3. + <_> + + <_> + 11 12 1 2 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 4 3 8 3 -1. + <_> + 8 3 4 3 2. + <_> + + <_> + 0 4 20 6 -1. + <_> + 0 4 10 6 2. + <_> + + <_> + 9 14 1 3 -1. + <_> + 9 15 1 1 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 0 15 14 4 -1. + <_> + 0 17 14 2 2. + <_> + + <_> + 1 14 18 6 -1. + <_> + 1 17 18 3 2. + <_> + + <_> + 0 0 10 6 -1. + <_> + 0 0 5 3 2. + <_> + 5 3 5 3 2. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_alt2.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_alt2.xml new file mode 100644 index 0000000000000000000000000000000000000000..b49cf5df3b0c561c9b3887d5e63a93b813847e18 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_alt2.xml @@ -0,0 +1,20719 @@ + + + +BOOST + HAAR + 20 + 20 + + 109 + + 0 + 20 + + <_> + 3 + 3.5069230198860168e-01 + + <_> + + 0 1 0 4.3272329494357109e-03 -1 -2 1 1.3076160103082657e-02 + + 3.8381900638341904e-02 8.9652568101882935e-01 + 2.6293140649795532e-01 + <_> + + 0 1 2 5.2434601821005344e-04 -1 -2 3 4.4573000632226467e-03 + + 1.0216630250215530e-01 1.2384019792079926e-01 + 6.9103831052780151e-01 + <_> + + 1 0 4 -9.2708261217921972e-04 -1 -2 5 3.3989109215326607e-04 + + 1.9536970555782318e-01 2.1014410257339478e-01 + 8.2586747407913208e-01 + <_> + 9 + 3.4721779823303223e+00 + + <_> + + 0 1 6 2.3025739938020706e-03 -1 -2 7 4.4174338690936565e-03 + + 1.0183759778738022e-01 8.2190579175949097e-01 + 1.9565549492835999e-01 + <_> + + 0 1 8 2.2203210741281509e-02 -1 -2 9 -1.7283110355492681e-04 + + 2.2054070234298706e-01 7.3263257741928101e-02 + 5.9314841032028198e-01 + <_> + + 0 1 10 4.3567270040512085e-03 -1 -2 11 + -2.6032889727503061e-03 + + 1.8441149592399597e-01 4.0322139859199524e-01 + 8.0665212869644165e-01 + <_> + + 0 1 12 1.7309630056843162e-03 -1 -2 13 + -7.8146401792764664e-03 + + 2.5483280420303345e-01 6.0570698976516724e-01 + 2.7790638804435730e-01 + <_> + + 0 1 14 -8.7343417108058929e-03 -1 -2 15 + 9.4522320432588458e-04 + + 2.8899800777435303e-01 7.6165872812271118e-01 + 3.4956431388854980e-01 + <_> + + 1 0 16 4.9414858222007751e-02 -1 -2 17 + 4.4891750440001488e-03 + + 8.1516528129577637e-01 2.8087830543518066e-01 + 6.0277748107910156e-01 + <_> + + 1 0 18 6.0313619673252106e-02 -1 -2 19 + -1.0762850288301706e-03 + + 7.6075017452239990e-01 4.4440358877182007e-01 + 1.4373120665550232e-01 + <_> + + 1 0 20 -9.5083238556981087e-03 -1 -2 21 + 7.6601309701800346e-03 + + 5.3181701898574829e-01 5.4110521078109741e-01 + 2.1806870400905609e-01 + <_> + + 1 0 22 7.6467678882181644e-03 -1 -2 23 + -8.4662932204082608e-04 + + 1.1589600145816803e-01 2.3406790196895599e-01 + 5.9903818368911743e-01 + <_> + 14 + 5.9844889640808105e+00 + + <_> + + 1 0 24 -4.8506218008697033e-03 -1 -2 25 + -4.6141650527715683e-03 + + 1.8054960668087006e-01 2.1778939664363861e-01 + 8.0182367563247681e-01 + <_> + + 0 1 26 -2.4301309604197741e-03 -1 -2 27 + 4.1787960799410939e-04 + + 1.1413549631834030e-01 1.2030939757823944e-01 + 6.1085307598114014e-01 + <_> + + 0 1 28 1.0010929545387626e-03 -1 -2 29 + 1.0577100329101086e-03 + + 2.0799599587917328e-01 3.3020541071891785e-01 + 7.5110942125320435e-01 + <_> + + 1 0 30 1.2376549420878291e-03 -1 -2 31 + 3.5315038985572755e-04 + + 2.7682220935821533e-01 1.6682930290699005e-01 + 5.8294767141342163e-01 + <_> + + 0 1 32 -1.1953660286962986e-02 -1 -2 33 + 1.4182999730110168e-03 + + 1.5087880194187164e-01 4.3912279605865479e-01 + 7.6465952396392822e-01 + <_> + + 1 0 34 3.4642980899661779e-03 -1 -2 35 + -1.4948950149118900e-02 + + 2.6515561342239380e-01 2.2980530560016632e-01 + 5.4421657323837280e-01 + <_> + + 1 0 36 -1.0506849503144622e-03 -1 -2 37 + -4.0782918222248554e-03 + + 3.6228439211845398e-01 2.6012599468231201e-01 + 7.2336578369140625e-01 + <_> + + 0 1 38 5.4242828628048301e-04 -1 -2 39 + -7.3204059153795242e-03 + + 3.8496789336204529e-01 2.9655128717422485e-01 + 5.4803091287612915e-01 + <_> + + 0 1 40 1.1421289527788758e-03 -1 -2 41 + 1.1783400550484657e-03 + + 4.1047701239585876e-01 7.2390240430831909e-01 + 2.7872839570045471e-01 + <_> + + 0 1 42 4.4077109545469284e-02 -1 -2 43 + 3.7900090683251619e-03 + + 5.6405162811279297e-01 5.9475481510162354e-01 + 3.3120200037956238e-01 + <_> + + 0 1 44 -2.4291418958455324e-03 -1 -2 45 + 9.4262324273586273e-03 + + 6.6032320261001587e-01 4.6806651353836060e-01 + 2.0643380284309387e-01 + <_> + + 0 1 46 8.0630257725715637e-03 -1 -2 47 + 5.2240812219679356e-03 + + 5.2988511323928833e-01 5.2816027402877808e-01 + 1.9095499813556671e-01 + <_> + + 0 1 48 -7.0630568079650402e-03 -1 -2 49 + 5.6897541508078575e-03 + + 1.3806459307670593e-01 5.4906368255615234e-01 + 1.2602810561656952e-01 + <_> + + 0 1 50 1.2472929665818810e-03 -1 -2 51 + 4.9543488770723343e-02 + + 2.3726630210876465e-01 5.2401661872863770e-01 + 1.7692160606384277e-01 + <_> + 19 + 8.5117864608764648e+00 + + <_> + + 1 0 52 -4.9326149746775627e-03 -1 -2 53 + 2.7918140403926373e-05 + + 1.9980649650096893e-01 2.2993800044059753e-01 + 7.3932111263275146e-01 + <_> + + 1 0 54 3.0876200180500746e-03 -1 -2 55 + 7.4669660534709692e-06 + + 1.5338400006294250e-01 2.0368589460849762e-01 + 5.8549159765243530e-01 + <_> + + 0 1 56 1.8739729421213269e-03 -1 -2 57 + 9.3380251200869679e-04 + + 2.0498959720134735e-01 3.2341998815536499e-01 + 7.3230141401290894e-01 + <_> + + 0 1 58 1.9151850137859583e-03 -1 -2 59 + -5.9683797881007195e-03 + + 3.0451491475105286e-01 2.9321339726448059e-01 + 5.6212961673736572e-01 + <_> + + 0 1 60 -7.2115601506084204e-04 -1 -2 61 + -5.9663117863237858e-03 + + 3.6580368876457214e-01 2.7121558785438538e-01 + 7.2263348102569580e-01 + <_> + + 0 1 62 3.0874179676175117e-02 -1 -2 63 + -1.1099710129201412e-02 + + 4.4198378920555115e-01 3.6129769682884216e-01 + 5.2514511346817017e-01 + <_> + + 0 1 64 2.1164179779589176e-03 -1 -2 65 + -9.4317439943552017e-03 + + 3.6286169290542603e-01 1.6010950505733490e-01 + 7.0522767305374146e-01 + <_> + + 0 1 66 -3.5266019403934479e-03 -1 -2 67 + -1.6907559474930167e-03 + + 1.3012880086898804e-01 1.7863239347934723e-01 + 5.5215299129486084e-01 + <_> + + 0 1 68 4.6470930101349950e-04 -1 -2 69 + -1.0215570218861103e-02 + + 3.4873831272125244e-01 2.6739910244941711e-01 + 6.6679191589355469e-01 + <_> + + 1 0 70 1.2634709710255265e-03 -1 -2 71 + -1.1875299736857414e-02 + + 3.4378638863563538e-01 5.9953361749649048e-01 + 3.4977179765701294e-01 + <_> + + 0 1 72 -1.0732339695096016e-02 -1 -2 73 + 7.1836481802165508e-03 + + 2.1504899859428406e-01 6.2714362144470215e-01 + 2.5195419788360596e-01 + <_> + + 0 1 74 -2.8340889140963554e-02 -1 -2 75 + -4.5813230099156499e-04 + + 8.2411892712116241e-02 5.9100568294525146e-01 + 3.7052011489868164e-01 + <_> + + 1 0 76 4.2940340936183929e-03 -1 -2 77 + 1.0751079767942429e-02 + + 1.5947279334068298e-01 5.9804809093475342e-01 + 2.8325080871582031e-01 + <_> + + 1 0 78 2.2465119138360023e-02 -1 -2 79 + -5.7988539338111877e-02 + + 7.8770911693572998e-01 1.5557409822940826e-01 + 5.2396571636199951e-01 + <_> + + 1 0 80 7.2110891342163086e-03 -1 -2 81 + -4.8367571085691452e-02 + + 6.6203659772872925e-01 1.4247199892997742e-01 + 4.4298338890075684e-01 + <_> + + 0 1 82 -1.4418059960007668e-02 -1 -2 83 + -2.3156389594078064e-02 + + 1.5885409712791443e-01 2.3757989704608917e-01 + 5.2171349525451660e-01 + <_> + + 1 0 84 7.6985340565443039e-03 -1 -2 85 + -5.6248619221150875e-03 + + 1.9417250156402588e-01 6.2784057855606079e-01 + 3.7460449337959290e-01 + <_> + + 1 0 86 -7.2936748620122671e-04 -1 -2 87 + 6.1783898854628205e-04 + + 3.8409221172332764e-01 3.1064930558204651e-01 + 5.5378472805023193e-01 + <_> + + 1 0 88 -4.5803939428878948e-05 -1 -2 89 + -1.4719359569426160e-05 + + 3.4444490075111389e-01 2.7295520901679993e-01 + 6.4289510250091553e-01 + <_> + 19 + 8.4680156707763672e+00 + + <_> + + 0 1 90 -1.3469370314851403e-03 -1 -2 91 + -2.4774789344519377e-03 + + 1.6570860147476196e-01 2.2738510370254517e-01 + 6.9893497228622437e-01 + <_> + + 0 1 92 5.2632777951657772e-03 -1 -2 93 + 4.9075339920818806e-03 + + 1.5120740234851837e-01 5.5644702911376953e-01 + 1.6054420173168182e-01 + <_> + + 0 1 94 -2.3254349362105131e-03 -1 -2 95 + -1.4665479538962245e-03 + + 1.8802590668201447e-01 3.1224989891052246e-01 + 7.1653962135314941e-01 + <_> + + 1 0 96 -1.2311690300703049e-01 -1 -2 97 + 2.2108340635895729e-03 + + 3.8595831394195557e-01 2.4552939832210541e-01 + 5.6957101821899414e-01 + <_> + + 0 1 98 2.0661531016230583e-03 -1 -2 99 + 3.6130280932411551e-04 + + 2.7165201306343079e-01 2.2933620214462280e-01 + 7.2086298465728760e-01 + <_> + + 1 0 100 7.9957872629165649e-02 -1 -2 101 + 2.6064720004796982e-03 + + 7.8336209058761597e-01 5.5452322959899902e-01 + 2.5506898760795593e-01 + <_> + + 1 0 102 6.5699010156095028e-03 -1 -2 103 + 1.6259610420092940e-03 + + 1.8193900585174561e-01 3.5298758745193481e-01 + 6.5528190135955811e-01 + <_> + + 0 1 104 3.6204981151968241e-03 -1 -2 105 + -4.4391951523721218e-03 + + 5.4623097181320190e-01 1.3598430156707764e-01 + 5.4158151149749756e-01 + <_> + + 0 1 106 -9.0540945529937744e-03 -1 -2 107 + -4.6067481162026525e-04 + + 1.1151199787855148e-01 5.8467197418212891e-01 + 2.5983488559722900e-01 + <_> + + 0 1 108 -5.6621041148900986e-03 -1 -2 109 + 5.1165837794542313e-03 + + 1.6105690598487854e-01 5.3766787052154541e-01 + 1.7394550144672394e-01 + <_> + + 0 1 110 -2.1362339612096548e-03 -1 -2 111 + -5.4809921421110630e-03 + + 1.9020730257034302e-01 3.2720080018043518e-01 + 6.3648408651351929e-01 + <_> + + 0 1 112 -8.1061907112598419e-03 -1 -2 113 + 6.0048708692193031e-03 + + 6.9148528575897217e-01 4.3273261189460754e-01 + 6.9638431072235107e-01 + <_> + + 0 1 114 -8.7028548121452332e-02 -1 -2 115 + -4.7809639945626259e-03 + + 8.5941338539123535e-01 9.7394466400146484e-02 + 4.5870301127433777e-01 + <_> + + 0 1 116 -2.2166660055518150e-03 -1 -2 117 + 1.3642730191349983e-03 + + 2.5546258687973022e-01 3.3190909028053284e-01 + 5.9641027450561523e-01 + <_> + + 0 1 118 -9.0077864006161690e-03 -1 -2 119 + -1.5494120307266712e-02 + + 2.6665949821472168e-01 1.8481859564781189e-01 + 6.2459707260131836e-01 + <_> + + 1 0 120 -4.2165028862655163e-03 -1 -2 121 + 4.3249759823083878e-02 + + 5.3799271583557129e-01 5.1830291748046875e-01 + 2.1704199910163879e-01 + <_> + + 1 0 122 2.8786511393263936e-04 -1 -2 123 + 1.2373150093480945e-03 + + 2.6133841276168823e-01 2.7865320444107056e-01 + 5.9089881181716919e-01 + <_> + + 1 0 124 1.9528300035744905e-03 -1 -2 125 + -1.4947060262784362e-03 + + 2.6128691434860229e-01 5.9154129028320312e-01 + 3.4557819366455078e-01 + <_> + + 1 0 126 3.5878680646419525e-03 -1 -2 127 + -2.5938691105693579e-03 + + 1.5870520472526550e-01 1.2704110145568848e-01 + 5.9794288873672485e-01 + <_> + 27 + 1.2578499794006348e+01 + + <_> + + 0 1 128 3.5810680128633976e-03 -1 -2 129 + -2.8552350122481585e-03 + + 1.9951049983501434e-01 7.3730701208114624e-01 + 2.9217371344566345e-01 + <_> + + 0 1 130 1.9758539274334908e-03 -1 -2 131 + 3.2583118882030249e-03 + + 1.9564199447631836e-01 5.6920468807220459e-01 + 1.8390649557113647e-01 + <_> + + 0 1 132 2.3711679386906326e-04 -1 -2 133 + 2.5942500215023756e-03 + + 2.1716670691967010e-01 2.7199891209602356e-01 + 7.1502441167831421e-01 + <_> + + 0 1 134 -2.5032449513673782e-02 -1 -2 135 + 6.3087949529290199e-03 + + 1.8251839280128479e-01 5.6998378038406372e-01 + 3.5098528861999512e-01 + <_> + + 1 0 136 -3.2494920305907726e-03 -1 -2 137 + -1.4885730110108852e-02 + + 4.0239268541336060e-01 3.6040958762168884e-01 + 7.2919952869415283e-01 + <_> + + 1 0 138 8.0623216927051544e-03 -1 -2 139 + 2.7405679225921631e-02 + + 6.4914900064468384e-01 5.5189931392669678e-01 + 2.6596811413764954e-01 + <_> + + 1 0 140 3.4368600696325302e-02 -1 -2 141 + -2.7292970567941666e-02 + + 6.7125129699707031e-01 1.6913780570030212e-01 + 4.3262779712677002e-01 + <_> + + 0 1 142 7.4452121043577790e-04 -1 -2 143 + 7.0336280623450875e-04 + + 3.4051001071929932e-01 5.5167931318283081e-01 + 3.3113878965377808e-01 + <_> + + 0 1 144 -1.2275460362434387e-01 -1 -2 145 + 3.2559928949922323e-03 + + 1.6753150522708893e-01 3.6157518625259399e-01 + 6.4207828044891357e-01 + <_> + + 0 1 146 -3.2090399414300919e-02 -1 -2 147 + 3.2957999501377344e-03 + + 2.9210790991783142e-01 5.6130319833755493e-01 + 3.3578601479530334e-01 + <_> + + 0 1 148 -3.2273170072585344e-03 -1 -2 149 + 1.1171669466421008e-03 + + 6.9706428050994873e-01 3.5411500930786133e-01 + 6.1440062522888184e-01 + <_> + + 1 0 150 -1.7279950901865959e-02 -1 -2 151 + 1.1741200461983681e-02 + + 5.5371809005737305e-01 5.3419572114944458e-01 + 2.7571049332618713e-01 + <_> + + 1 0 152 4.6405228786170483e-03 -1 -2 153 + -1.6913030296564102e-02 + + 2.4895210564136505e-01 1.7119289934635162e-01 + 5.5239528417587280e-01 + <_> + + 1 0 154 1.0060169734060764e-02 -1 -2 155 + -6.0715491417795420e-04 + + 8.2734507322311401e-01 3.7793910503387451e-01 + 5.4762518405914307e-01 + <_> + + 1 0 156 -1.0865400545299053e-03 -1 -2 157 + 8.9362077414989471e-03 + + 3.2965409755706787e-01 6.0628837347030640e-01 + 2.4342200160026550e-01 + <_> + + 1 0 158 -2.6372660067863762e-04 -1 -2 159 + 1.3110050000250340e-02 + + 3.8140949606895447e-01 5.5176162719726562e-01 + 3.7268930673599243e-01 + <_> + + 0 1 160 -2.9806280508637428e-03 -1 -2 161 + -4.1619571857154369e-03 + + 1.2296640127897263e-01 7.2522747516632080e-01 + 4.9734550714492798e-01 + <_> + + 0 1 162 3.3842328935861588e-02 -1 -2 163 + -1.2564560165628791e-03 + + 5.3483128547668457e-01 5.8519148826599121e-01 + 4.3841668963432312e-01 + <_> + + 0 1 164 -1.9635230302810669e-02 -1 -2 165 + -9.9625496659427881e-04 + + 2.2978340089321136e-01 6.2959378957748413e-01 + 4.1315990686416626e-01 + <_> + + 0 1 166 -2.3127110674977303e-02 -1 -2 167 + 2.3525709286332130e-02 + + 1.6954590380191803e-01 5.1741302013397217e-01 + 5.9519391506910324e-02 + <_> + + 0 1 168 -1.9356520846486092e-02 -1 -2 169 + -4.1787112131714821e-03 + + 1.3572479784488678e-01 2.9966288805007935e-01 + 5.7916951179504395e-01 + <_> + + 1 0 170 3.1488779932260513e-03 -1 -2 171 + 7.3972279205918312e-03 + + 6.5925890207290649e-01 5.3071719408035278e-01 + 3.7951210141181946e-01 + <_> + + 0 1 172 7.1955118983169086e-06 -1 -2 173 + 4.7114409506320953e-02 + + 3.1283149123191833e-01 5.5378931760787964e-01 + 1.0273090004920959e-01 + <_> + + 0 1 174 7.2878710925579071e-03 -1 -2 175 + -6.1887511983513832e-03 + + 4.6608591079711914e-01 7.1588581800460815e-01 + 4.7244489192962646e-01 + <_> + + 1 0 176 2.9757320880889893e-03 -1 -2 177 + -1.8449809867888689e-03 + + 5.9345688670873642e-02 7.0273017883300781e-01 + 4.7187310457229614e-01 + <_> + + 0 1 178 1.0239540279144421e-04 -1 -2 179 + 2.4277009069919586e-03 + + 5.8947342634201050e-01 4.8623558878898621e-01 + 5.2475881576538086e-01 + <_> + + 0 1 180 -6.4751312136650085e-02 -1 -2 181 + 3.9380151429213583e-04 + + 6.9174712896347046e-01 4.6696171164512634e-01 + 2.3824059963226318e-01 + <_> + 31 + 1.4546750068664551e+01 + + <_> + + 0 1 182 1.4397440245375037e-03 -1 -2 183 + -5.4068560712039471e-04 + + 2.7734708786010742e-01 7.4271547794342041e-01 + 2.4797350168228149e-01 + <_> + + 1 0 184 -7.1237959673453588e-06 -1 -2 185 + -2.3661039303988218e-03 + + 2.1995030343532562e-01 5.8899897336959839e-01 + 2.5957161188125610e-01 + <_> + + 0 1 186 1.7343269428238273e-03 -1 -2 187 + 1.5874590026214719e-03 + + 1.8601259589195251e-01 4.1518709063529968e-01 + 7.1034741401672363e-01 + <_> + + 1 0 188 3.7285638973116875e-03 -1 -2 189 + -1.2883819639682770e-01 + + 2.5279670953750610e-01 1.3930009305477142e-01 + 5.2545148134231567e-01 + <_> + + 1 0 190 7.9412180930376053e-03 -1 -2 191 + -1.2661729939281940e-02 + + 2.4877290427684784e-01 2.7107000350952148e-01 + 6.6188377141952515e-01 + <_> + + 0 1 192 3.0146789868013002e-05 -1 -2 193 + -1.6330160200595856e-02 + + 3.8128259778022766e-01 2.3264320194721222e-01 + 5.2630108594894409e-01 + <_> + + 0 1 194 1.4622770322603174e-05 -1 -2 195 + -2.0858660340309143e-02 + + 4.2933320999145508e-01 1.6004039347171783e-01 + 6.7823147773742676e-01 + <_> + + 1 0 196 2.8194559272378683e-03 -1 -2 197 + 3.7899368908256292e-03 + + 6.6792941093444824e-01 4.5877051353454590e-01 + 7.1762388944625854e-01 + <_> + + 1 0 198 3.5344641655683517e-02 -1 -2 199 + -1.1571600334718823e-03 + + 1.8640750646591187e-01 5.5382597446441650e-01 + 3.1504508852958679e-01 + <_> + + 0 1 200 -5.8742752298712730e-03 -1 -2 201 + -1.5201780115603469e-05 + + 2.8287911415100098e-01 5.8702242374420166e-01 + 3.7048238515853882e-01 + <_> + + 1 0 202 -2.2681879636365920e-04 -1 -2 203 + 3.7845689803361893e-03 + + 4.2189309000968933e-01 6.6670012474060059e-01 + 2.4611820280551910e-01 + <_> + + 1 0 204 -8.5295992903411388e-05 -1 -2 205 + -4.4394891709089279e-02 + + 3.5575878620147705e-01 1.6655470430850983e-01 + 5.2348488569259644e-01 + <_> + + 0 1 206 1.0126030538231134e-03 -1 -2 207 + -7.6327780261635780e-03 + + 2.8846129775047302e-01 2.9693400859832764e-01 + 6.0801112651824951e-01 + <_> + + 0 1 208 4.0330411866307259e-03 -1 -2 209 + 1.3676689565181732e-01 + + 4.5363900065422058e-01 5.1772642135620117e-01 + 1.4491820335388184e-01 + <_> + + 0 1 210 -5.0060478970408440e-03 -1 -2 211 + -1.2475839816033840e-02 + + 7.6169097423553467e-01 2.1597060561180115e-01 + 5.4601877927780151e-01 + <_> + + 1 0 212 -9.4012258341535926e-04 -1 -2 213 + -1.2191980145871639e-02 + + 3.9262959361076355e-01 3.4788811206817627e-01 + 5.5426627397537231e-01 + <_> + + 0 1 214 -5.4959481349214911e-04 -1 -2 215 + -2.1802430273965001e-04 + + 6.0642760992050171e-01 5.6974071264266968e-01 + 1.7797139286994934e-01 + <_> + + 0 1 216 6.9115799851715565e-03 -1 -2 217 + -9.7631698008626699e-04 + + 5.3793722391128540e-01 3.3278390765190125e-01 + 5.4615312814712524e-01 + <_> + + 0 1 218 -8.7870173156261444e-03 -1 -2 219 + -1.6761029837653041e-03 + + 2.1161609888076782e-01 6.6358232498168945e-01 + 4.3658590316772461e-01 + <_> + + 1 0 220 -5.5694948881864548e-02 -1 -2 221 + -1.9844379276037216e-02 + + 5.3874248266220093e-01 1.6028049588203430e-01 + 5.3304588794708252e-01 + <_> + + 0 1 222 -7.4751611100509763e-04 -1 -2 223 + 2.3032890632748604e-02 + + 2.9174768924713135e-01 5.6081241369247437e-01 + 1.9979810714721680e-01 + <_> + + 1 0 224 -3.0700280331075191e-03 -1 -2 225 + -1.1636839481070638e-03 + + 3.9383140206336975e-01 5.7574361562728882e-01 + 4.2394569516181946e-01 + <_> + + 1 0 226 2.2464339435100555e-01 -1 -2 227 + 1.4412109740078449e-03 + + 7.6765531301498413e-01 5.3538662195205688e-01 + 2.5147768855094910e-01 + <_> + + 0 1 228 -3.0011249706149101e-02 -1 -2 229 + -5.3078960627317429e-02 + + 2.3649039864540100e-01 2.3858639597892761e-01 + 5.4146647453308105e-01 + <_> + + 1 0 230 2.0800929050892591e-03 -1 -2 231 + -4.0738182142376900e-03 + + 6.5116149187088013e-01 6.0304141044616699e-01 + 3.5877010226249695e-01 + <_> + + 1 0 232 -1.9529370591044426e-02 -1 -2 233 + -5.3309470415115356e-02 + + 5.4235929250717163e-01 2.3609539866447449e-01 + 5.4017579555511475e-01 + <_> + + 0 1 234 -3.4849561750888824e-02 -1 -2 235 + -1.2658450007438660e-01 + + 2.8369858860969543e-01 1.8135160207748413e-01 + 5.4210460186004639e-01 + <_> + + 0 1 236 7.3325118137290701e-06 -1 -2 237 + -1.1843870393931866e-02 + + 3.9803659915924072e-01 2.6163849234580994e-01 + 5.2377301454544067e-01 + <_> + + 0 1 238 -4.8470678739249706e-03 -1 -2 239 + 8.1693977117538452e-03 + + 2.4381080269813538e-01 5.3271460533142090e-01 + 8.1903767585754395e-01 + <_> + + 1 0 240 -6.4716790802776814e-03 -1 -2 241 + -1.5188479665084742e-05 + + 4.6796938776969910e-01 5.5639117956161499e-01 + 4.3675860762596130e-01 + <_> + + 1 0 242 3.0696711037307978e-03 -1 -2 243 + -1.6296720423270017e-04 + + 6.6643488407135010e-01 5.5946111679077148e-01 + 3.0427119135856628e-01 + <_> + 39 + 1.8572250366210938e+01 + + <_> + + 1 0 244 -9.8275858908891678e-03 -1 -2 245 + -4.1693858802318573e-03 + + 2.1160189807415009e-01 6.9246852397918701e-01 + 3.0437770485877991e-01 + <_> + + 0 1 246 3.5341319744475186e-04 -1 -2 247 + 4.8054549843072891e-03 + + 3.1832858920097351e-01 5.4565590620040894e-01 + 2.5222688913345337e-01 + <_> + + 0 1 248 2.1071180526632816e-04 -1 -2 249 + -2.8318869881331921e-03 + + 2.9026180505752563e-01 3.1304559111595154e-01 + 6.8849372863769531e-01 + <_> + + 1 0 250 -7.5633679443853907e-06 -1 -2 251 + -8.2888139877468348e-04 + + 2.9624658823013306e-01 3.0996260046958923e-01 + 5.7525151968002319e-01 + <_> + + 0 1 252 1.6209259629249573e-03 -1 -2 253 + 9.1338958591222763e-03 + + 3.9931958913803101e-01 4.8273721337318420e-01 + 7.5378328561782837e-01 + <_> + + 0 1 254 -4.1212290525436401e-03 -1 -2 255 + -2.5447290390729904e-03 + + 2.6169270277023315e-01 3.1087028980255127e-01 + 5.4912358522415161e-01 + <_> + + 0 1 256 -6.2652782071381807e-04 -1 -2 257 + -3.6596331483451650e-05 + + 3.2396918535232544e-01 6.5174108743667603e-01 + 4.1789120435714722e-01 + <_> + + 1 0 258 1.3882719911634922e-02 -1 -2 259 + 1.0493700392544270e-03 + + 6.7712038755416870e-01 4.1595110297203064e-01 + 5.6528919935226440e-01 + <_> + + 1 0 260 1.8215360119938850e-02 -1 -2 261 + -1.1334580369293690e-02 + + 7.6896011829376221e-01 2.8733238577842712e-01 + 4.9889329075813293e-01 + <_> + + 1 0 262 -4.1097560897469521e-03 -1 -2 263 + 4.2612891411408782e-04 + + 5.4630082845687866e-01 3.6312350630760193e-01 + 5.5125522613525391e-01 + <_> + + 1 0 264 6.0301548801362514e-03 -1 -2 265 + 3.3587709185667336e-04 + + 1.1437670141458511e-01 2.8910788893699646e-01 + 5.4473417997360229e-01 + <_> + + 1 0 266 6.2279507983475924e-04 -1 -2 267 + -2.5837119668722153e-02 + + 3.0234318971633911e-01 2.1670059859752655e-01 + 5.2781528234481812e-01 + <_> + + 1 0 268 2.1774910390377045e-02 -1 -2 269 + 1.7682299949228764e-03 + + 3.2548341155052185e-01 5.2630507946014404e-01 + 7.5263291597366333e-01 + <_> + + 0 1 270 -1.3793810270726681e-02 -1 -2 271 + -5.0852829590439796e-03 + + 7.4103301763534546e-01 6.8366098403930664e-01 + 4.5790711045265198e-01 + <_> + + 1 0 272 6.1795017682015896e-03 -1 -2 273 + 1.0030319914221764e-02 + + 7.4499362707138062e-01 4.8607799410820007e-01 + 2.3614570498466492e-01 + <_> + + 0 1 274 -6.4201927743852139e-03 -1 -2 275 + -5.6961281225085258e-03 + + 1.4673270285129547e-01 2.3478199541568756e-01 + 5.3233772516250610e-01 + <_> + + 0 1 276 -7.1498160250484943e-03 -1 -2 277 + 2.4450740311294794e-03 + + 1.4770570397377014e-01 3.4985339641571045e-01 + 5.8035618066787720e-01 + <_> + + 1 0 278 -3.7503410130739212e-02 -1 -2 279 + 4.7799441381357610e-04 + + 5.2595508098602295e-01 4.3628829717636108e-01 + 6.2089228630065918e-01 + <_> + + 0 1 280 -7.0806080475449562e-03 -1 -2 281 + 3.2818000763654709e-02 + + 2.0394609868526459e-01 5.1983588933944702e-01 + 1.3711960613727570e-01 + <_> + + 1 0 282 6.5188988810405135e-04 -1 -2 283 + 4.6485587954521179e-03 + + 6.3234299421310425e-01 4.7201630473136902e-01 + 6.5670871734619141e-01 + <_> + + 0 1 284 -1.9827929791063070e-03 -1 -2 285 + -1.6011310508474708e-03 + + 6.0530602931976318e-01 5.0905191898345947e-01 + 3.1169331073760986e-01 + <_> + + 0 1 286 -3.0539939180016518e-03 -1 -2 287 + 4.3212040327489376e-04 + + 3.4298041462898254e-01 3.8384029269218445e-01 + 5.7755982875823975e-01 + <_> + + 0 1 288 -2.7452120557427406e-02 -1 -2 289 + 9.3099439982324839e-04 + + 2.1434690058231354e-01 5.9529662132263184e-01 + 3.7601581215858459e-01 + <_> + + 0 1 290 6.7144189961254597e-03 -1 -2 291 + -3.3701690845191479e-03 + + 5.6926268339157104e-01 5.7843041419982910e-01 + 3.9742821455001831e-01 + <_> + + 0 1 292 -1.8903959542512894e-02 -1 -2 293 + -6.5850871615111828e-03 + + 1.8188929557800293e-01 6.8491101264953613e-01 + 4.3515840172767639e-01 + <_> + + 1 0 294 5.8810501359403133e-03 -1 -2 295 + 8.0092082498595119e-04 + + 2.7266609668731689e-01 4.2364311218261719e-01 + 5.8446758985519409e-01 + <_> + + 1 0 296 1.8510579830035567e-03 -1 -2 297 + 6.3273650594055653e-03 + + 3.3713209629058838e-01 5.2702218294143677e-01 + 8.0536508560180664e-01 + <_> + + 0 1 298 -3.3820930402725935e-03 -1 -2 299 + -1.9292969955131412e-03 + + 2.8660181164741516e-01 5.8889460563659668e-01 + 3.8957870006561279e-01 + <_> + + 1 0 300 1.4995220117270947e-02 -1 -2 301 + -2.6330750435590744e-02 + + 2.1778169274330139e-01 1.7753170430660248e-01 + 5.6714701652526855e-01 + <_> + + 1 0 302 -4.1734222322702408e-03 -1 -2 303 + 2.7268350124359131e-02 + + 4.6529620885848999e-01 4.7683110833168030e-01 + 5.6952387094497681e-01 + <_> + + 1 0 304 9.8880263976752758e-04 -1 -2 305 + -1.0528849670663476e-03 + + 3.3974018692970276e-01 6.2500411272048950e-01 + 4.2884120345115662e-01 + <_> + + 0 1 306 5.2288072183728218e-03 -1 -2 307 + 3.0395459383726120e-02 + + 5.3477621078491211e-01 4.1155189275741577e-01 + 5.6607538461685181e-01 + <_> + + 0 1 308 -7.9113930463790894e-02 -1 -2 309 + 1.8231669440865517e-02 + + 7.8813230991363525e-01 3.6043399572372437e-01 + 5.5695050954818726e-01 + <_> + + 0 1 310 5.2288072183728218e-03 -1 -2 311 + 4.3922828626818955e-04 + + 5.4166442155838013e-01 5.5071568489074707e-01 + 3.8822770118713379e-01 + <_> + + 0 1 312 -8.6501962505280972e-04 -1 -2 313 + 1.0326979681849480e-03 + + 3.1858509778976440e-01 5.5783641338348389e-01 + 3.2192459702491760e-01 + <_> + + 0 1 314 -7.2997747920453548e-03 -1 -2 315 + -9.3629042385146022e-04 + + 7.0732331275939941e-01 5.5580157041549683e-01 + 4.6138420701026917e-01 + <_> + + 0 1 316 -6.0483231209218502e-03 -1 -2 317 + 6.7529221996665001e-03 + + 6.8692898750305176e-01 4.8703178763389587e-01 + 2.6503708958625793e-01 + <_> + + 0 1 318 5.3078029304742813e-02 -1 -2 319 + -1.0225810110569000e-03 + + 5.2815151214599609e-01 6.0858821868896484e-01 + 4.3048679828643799e-01 + <_> + + 1 0 320 3.1270649284124374e-02 -1 -2 321 + -6.3522169366478920e-03 + + 5.4458320140838623e-01 5.3283357620239258e-01 + 2.3643240332603455e-01 + <_> + 45 + 2.1578119277954102e+01 + + <_> + + 1 0 322 -6.2215630896389484e-03 -1 -2 323 + 2.1097389981150627e-03 + + 2.6255810260772705e-01 1.5649929642677307e-01 + 6.7928832769393921e-01 + <_> + + 0 1 324 1.0845859535038471e-02 -1 -2 325 + 6.4230401767417789e-04 + + 3.4858089685440063e-01 3.6982551217079163e-01 + 5.9216582775115967e-01 + <_> + + 1 0 326 7.3311722371727228e-04 -1 -2 327 + 1.0134200565516949e-03 + + 3.0070841312408447e-01 3.6249229311943054e-01 + 7.0724260807037354e-01 + <_> + + 0 1 328 1.1093559674918652e-02 -1 -2 329 + -7.9127531498670578e-03 + + 4.4167020916938782e-01 3.0287081003189087e-01 + 5.4173761606216431e-01 + <_> + + 0 1 330 1.2905309908092022e-02 -1 -2 331 + -4.2430912144482136e-03 + + 4.3745040893554688e-01 4.4015899300575256e-01 + 7.5651907920837402e-01 + <_> + + 0 1 332 -2.1304309484548867e-04 -1 -2 333 + -2.2308640182018280e-03 + + 2.3107869923114777e-01 3.5681959986686707e-01 + 5.7499992847442627e-01 + <_> + + 0 1 334 2.6400520000606775e-03 -1 -2 335 + 7.5101032853126526e-02 + + 3.5936889052391052e-01 6.3635677099227905e-01 + 2.3270289599895477e-01 + <_> + + 0 1 336 -7.7012968249619007e-03 -1 -2 337 + 1.5588370151817799e-03 + + 7.0746237039566040e-01 5.7002371549606323e-01 + 3.5904508829116821e-01 + <_> + + 0 1 338 -4.7687938786111772e-04 -1 -2 339 + 8.4234727546572685e-04 + + 2.8054410219192505e-01 4.1254189610481262e-01 + 6.1779958009719849e-01 + <_> + + 1 0 340 -1.2825109995901585e-02 -1 -2 341 + -6.5156567143276334e-04 + + 5.4030781984329224e-01 5.6336438655853271e-01 + 3.3565390110015869e-01 + <_> + + 0 1 342 -1.2006159871816635e-02 -1 -2 343 + 1.3213419588282704e-03 + + 7.1095108985900879e-01 4.9038508534431458e-01 + 2.8245830535888672e-01 + <_> + + 0 1 344 -2.0307440310716629e-02 -1 -2 345 + 4.0180929936468601e-03 + + 1.8913699686527252e-01 5.3779661655426025e-01 + 3.1194949150085449e-01 + <_> + + 1 0 346 4.5315311290323734e-03 -1 -2 347 + -4.4381739571690559e-03 + + 7.2067582607269287e-01 1.8546679615974426e-01 + 4.9817329645156860e-01 + <_> + + 1 0 348 1.5692010056227446e-03 -1 -2 349 + -4.9516442231833935e-03 + + 2.6382741332054138e-01 6.8710672855377197e-01 + 4.7146868705749512e-01 + <_> + + 0 1 350 -2.7429679408669472e-02 -1 -2 351 + 1.4181969454512000e-03 + + 1.5482850372791290e-01 4.3768429756164551e-01 + 6.3273680210113525e-01 + <_> + + 0 1 352 -1.3078940100967884e-02 -1 -2 353 + -3.5092779435217381e-03 + + 3.1668141484260559e-01 6.1997437477111816e-01 + 4.3796870112419128e-01 + <_> + + 1 0 354 1.8920730799436569e-02 -1 -2 355 + 2.1683350205421448e-03 + + 1.4707140624523163e-01 5.8094590902328491e-01 + 3.4319490194320679e-01 + <_> + + 0 1 356 1.6401590546593070e-03 -1 -2 357 + 1.4005920093040913e-04 + + 3.9594578742980957e-01 3.2400250434875488e-01 + 5.6466472148895264e-01 + <_> + + 1 0 358 -3.3137591090053320e-03 -1 -2 359 + -2.9459029901772738e-03 + + 4.2745280265808105e-01 3.3416679501533508e-01 + 6.6279602050781250e-01 + <_> + + 0 1 360 1.3612229668069631e-04 -1 -2 361 + 6.0512032359838486e-04 + + 4.0469279885292053e-01 5.4840582609176636e-01 + 3.5699409246444702e-01 + <_> + + 0 1 362 -1.7513990402221680e-02 -1 -2 363 + -1.8735030665993690e-02 + + 1.8241509795188904e-01 7.9718202352523804e-01 + 5.0685691833496094e-01 + <_> + + 1 0 364 1.2065649963915348e-02 -1 -2 365 + -2.6544178836047649e-03 + + 2.1670070290565491e-01 6.5841788053512573e-01 + 4.6282431483268738e-01 + <_> + + 1 0 366 1.4501289697363973e-03 -1 -2 367 + 1.0954019613564014e-02 + + 2.0902520418167114e-01 5.1123052835464478e-01 + 7.7845758199691772e-01 + <_> + + 0 1 368 1.5771709382534027e-02 -1 -2 369 + -1.4252689667046070e-02 + + 5.1323592662811279e-01 1.7424149811267853e-01 + 5.2671480178833008e-01 + <_> + + 0 1 370 3.0411860279855318e-05 -1 -2 371 + 2.3486299440264702e-02 + + 3.4184479713439941e-01 5.6312650442123413e-01 + 2.0063939690589905e-01 + <_> + + 1 0 372 5.2205449901521206e-03 -1 -2 373 + -2.5812430307269096e-02 + + 6.2496489286422729e-01 3.2032281160354614e-01 + 5.1993298530578613e-01 + <_> + + 0 1 374 -1.9526650430634618e-03 -1 -2 375 + -8.1470049917697906e-03 + + 6.1407059431076050e-01 6.5928959846496582e-01 + 3.7111249566078186e-01 + <_> + + 1 0 376 3.2962448894977570e-03 -1 -2 377 + -1.3961310032755136e-03 + + 2.9521119594573975e-01 3.3208039402961731e-01 + 5.5284148454666138e-01 + <_> + + 0 1 378 -4.1055441834032536e-03 -1 -2 379 + -1.0888779535889626e-02 + + 1.7105500400066376e-01 3.3594349026679993e-01 + 5.6749051809310913e-01 + <_> + + 1 0 380 -7.6768421567976475e-03 -1 -2 381 + -9.7729787230491638e-03 + + 4.7732418775558472e-01 8.0810451507568359e-01 + 4.8458281159400940e-01 + <_> + + 1 0 382 6.0439710505306721e-03 -1 -2 383 + -4.6134641161188483e-04 + + 6.7840021848678589e-01 5.5146390199661255e-01 + 3.6423599720001221e-01 + <_> + + 1 0 384 5.7992361485958099e-02 -1 -2 385 + 5.9384980704635382e-04 + + 1.2544350326061249e-01 4.4248789548873901e-01 + 5.7284617424011230e-01 + <_> + + 0 1 386 -6.2353480607271194e-03 -1 -2 387 + -1.2784929946064949e-02 + + 2.8050419688224792e-01 1.9509120285511017e-01 + 5.6529247760772705e-01 + <_> + + 1 0 388 4.1973669431172311e-04 -1 -2 389 + 8.0646801507100463e-04 + + 6.1664837598800659e-01 4.5265799760818481e-01 + 5.9444868564605713e-01 + <_> + + 1 0 390 -1.6339010326191783e-03 -1 -2 391 + -4.8299999907612801e-03 + + 4.0869420766830444e-01 2.7935269474983215e-01 + 6.4449352025985718e-01 + <_> + + 1 0 392 -6.3992068171501160e-03 -1 -2 393 + 1.0819199681282043e-01 + + 5.6716561317443848e-01 5.3118121623992920e-01 + 2.6143568754196167e-01 + <_> + + 1 0 394 6.5056560561060905e-04 -1 -2 395 + 2.0611250773072243e-02 + + 2.9967740178108215e-01 4.4899430871009827e-01 + 6.8882799148559570e-01 + <_> + + 1 0 396 -2.5129050016403198e-02 -1 -2 397 + 1.7922939732670784e-03 + + 5.1968640089035034e-01 3.4669959545135498e-01 + 5.5335879325866699e-01 + <_> + + 1 0 398 1.5626220265403390e-03 -1 -2 399 + -6.1898730928078294e-04 + + 3.0814400315284729e-01 2.6938709616661072e-01 + 5.5444890260696411e-01 + <_> + + 0 1 400 4.8111421056091785e-03 -1 -2 401 + 2.2484229411929846e-03 + + 5.5878478288650513e-01 4.6721130609512329e-01 + 6.0908252000808716e-01 + <_> + + 0 1 402 -3.0147239565849304e-02 -1 -2 403 + 2.7548679709434509e-01 + + 9.0275919437408447e-01 4.7198349237442017e-01 + 2.1969200670719147e-01 + <_> + + 1 0 404 3.6894630175083876e-03 -1 -2 405 + 7.2957701049745083e-03 + + 6.2730091810226440e-01 4.8392179608345032e-01 + 6.9090622663497925e-01 + <_> + + 0 1 406 -5.6211069226264954e-02 -1 -2 407 + -2.6478560175746679e-03 + + 1.7384879291057587e-01 6.3041448593139648e-01 + 4.4743019342422485e-01 + <_> + + 1 0 408 -1.4534000074490905e-03 -1 -2 409 + 2.8540920466184616e-03 + + 5.3025382757186890e-01 5.3383970260620117e-01 + 3.7968829274177551e-01 + <_> + + 1 0 410 5.8243022067472339e-04 -1 -2 411 + 9.2509482055902481e-04 + + 3.2698369026184082e-01 4.5548120141029358e-01 + 6.3583481311798096e-01 + <_> + 47 + 2.2585290908813477e+01 + + <_> + + 0 1 412 1.9806440919637680e-02 -1 -2 413 + 7.0395611692219973e-04 + + 2.8097251057624817e-01 3.1198260188102722e-01 + 7.0903062820434570e-01 + <_> + + 0 1 414 2.5563780218362808e-03 -1 -2 415 + 1.0824160417541862e-03 + + 2.9819479584693909e-01 3.0205601453781128e-01 + 5.8088111877441406e-01 + <_> + + 1 0 416 -9.2893769033253193e-04 -1 -2 417 + -1.8009729683399200e-02 + + 3.7381029129028320e-01 2.1631260216236115e-01 + 6.6192537546157837e-01 + <_> + + 1 0 418 2.3500190582126379e-03 -1 -2 419 + 8.1822491483762860e-04 + + 2.9104039072990417e-01 5.5786228179931641e-01 + 3.3666279911994934e-01 + <_> + + 0 1 420 6.2095321482047439e-04 -1 -2 421 + 9.6780969761312008e-04 + + 4.0724259614944458e-01 6.8595957756042480e-01 + 3.1054618954658508e-01 + <_> + + 1 0 422 4.8000211245380342e-04 -1 -2 423 + 9.0538640506565571e-05 + + 3.3373329043388367e-01 3.3709588646888733e-01 + 5.4512107372283936e-01 + <_> + + 0 1 424 -4.3914798647165298e-02 -1 -2 425 + -5.6501338258385658e-03 + + 2.6256701350212097e-01 6.0504627227783203e-01 + 3.2324150204658508e-01 + <_> + + 1 0 426 3.8661491125822067e-03 -1 -2 427 + -6.3069426687434316e-05 + + 3.2626131176948547e-01 5.8173078298568726e-01 + 4.1643899679183960e-01 + <_> + + 1 0 428 5.2533738315105438e-02 -1 -2 429 + 1.3818660518154502e-03 + + 7.0953989028930664e-01 5.2928757667541504e-01 + 2.5413888692855835e-01 + <_> + + 1 0 430 -8.9264067355543375e-04 -1 -2 431 + 8.5579507052898407e-02 + + 4.0853410959243774e-01 5.2632361650466919e-01 + 3.0032029747962952e-01 + <_> + + 1 0 432 -1.8343339615967125e-04 -1 -2 433 + -9.7924815490841866e-03 + + 4.0292051434516907e-01 3.5213199257850647e-01 + 6.6640049219131470e-01 + <_> + + 0 1 434 1.4428620226681232e-02 -1 -2 435 + -4.5687001198530197e-02 + + 4.5935660600662231e-01 1.4747560024261475e-01 + 5.1786321401596069e-01 + <_> + + 0 1 436 -2.5763090234249830e-03 -1 -2 437 + -3.8301859050989151e-02 + + 1.8372780084609985e-01 8.0826580524444580e-01 + 5.1666879653930664e-01 + <_> + + 0 1 438 2.8978290501981974e-03 -1 -2 439 + -2.5165060069411993e-03 + + 4.7980138659477234e-01 3.3462959527969360e-01 + 5.4444491863250732e-01 + <_> + + 0 1 440 5.6281982688233256e-04 -1 -2 441 + 3.6684391088783741e-03 + + 3.5890269279479980e-01 5.9831297397613525e-01 + 2.9839640855789185e-01 + <_> + + 1 0 442 2.1319789811968803e-03 -1 -2 443 + 7.6037310063838959e-03 + + 6.1632239818572998e-01 5.2171301841735840e-01 + 2.0541590452194214e-01 + <_> + + 1 0 444 -1.1668079969240353e-04 -1 -2 445 + 3.1659509986639023e-03 + + 3.4466689825057983e-01 5.5974847078323364e-01 + 2.6737868785858154e-01 + <_> + + 0 1 446 -2.2569499909877777e-02 -1 -2 447 + 2.7129601221531630e-04 + + 6.9002681970596313e-01 4.4866389036178589e-01 + 5.5087852478027344e-01 + <_> + + 0 1 448 -1.5434459783136845e-02 -1 -2 449 + -8.4861656650900841e-03 + + 2.0483230054378510e-01 1.2549529969692230e-01 + 5.0603562593460083e-01 + <_> + + 0 1 450 -1.1807470023632050e-01 -1 -2 451 + -1.2300079688429832e-03 + + 6.7633062601089478e-02 5.6607007980346680e-01 + 4.2922011017799377e-01 + <_> + + 0 1 452 -7.0290351286530495e-03 -1 -2 453 + 8.9325206354260445e-03 + + 7.1364039182662964e-01 4.3388760089874268e-01 + 7.0608752965927124e-01 + <_> + + 1 0 454 -4.7735981643199921e-02 -1 -2 455 + -4.4155579060316086e-02 + + 5.2686852216720581e-01 2.5805801153182983e-01 + 5.4069608449935913e-01 + <_> + + 0 1 456 -2.5983480736613274e-02 -1 -2 457 + -4.7885831445455551e-03 + + 1.9050540030002594e-01 2.5518929958343506e-01 + 5.3390771150588989e-01 + <_> + + 0 1 458 6.7423451691865921e-03 -1 -2 459 + 1.1654750443994999e-02 + + 4.6933099627494812e-01 5.2619642019271851e-01 + 3.1454348564147949e-01 + <_> + + 0 1 460 -5.6982729583978653e-03 -1 -2 461 + -7.2983349673449993e-03 + + 1.7568530142307281e-01 7.7747297286987305e-01 + 5.1242929697036743e-01 + <_> + + 0 1 462 7.9091778025031090e-03 -1 -2 463 + -1.5874979726504534e-04 + + 5.2845597267150879e-01 3.8878020644187927e-01 + 5.5011737346649170e-01 + <_> + + 0 1 464 -6.2235877849161625e-03 -1 -2 465 + 1.3308860361576080e-03 + + 2.4898290634155273e-01 4.2621460556983948e-01 + 5.9350621700286865e-01 + <_> + + 1 0 466 5.2055278792977333e-03 -1 -2 467 + 1.4065169729292393e-02 + + 2.5452229380607605e-01 4.8519900441169739e-01 + 7.0214188098907471e-01 + <_> + + 0 1 468 -6.7384149879217148e-03 -1 -2 469 + 3.3406780567020178e-03 + + 7.1432709693908691e-01 5.1757252216339111e-01 + 2.8086438775062561e-01 + <_> + + 1 0 470 -1.1880699545145035e-02 -1 -2 471 + 1.4226379571482539e-03 + + 5.1732218265533447e-01 4.5028659701347351e-01 + 5.7956951856613159e-01 + <_> + + 1 0 472 2.9858129564672709e-03 -1 -2 473 + -2.0481580868363380e-03 + + 1.9151160120964050e-01 6.5024322271347046e-01 + 4.5593151450157166e-01 + <_> + + 0 1 474 1.7122729914262891e-03 -1 -2 475 + -1.6980869695544243e-02 + + 5.3762471675872803e-01 7.0562332868576050e-01 + 4.9146059155464172e-01 + <_> + + 0 1 476 -1.1290470138192177e-03 -1 -2 477 + 2.8620059601962566e-03 + + 2.6787060499191284e-01 4.4108539819717407e-01 + 6.3683199882507324e-01 + <_> + + 0 1 478 -3.8065758999437094e-03 -1 -2 479 + 5.9090270660817623e-03 + + 2.7635639905929565e-01 4.8673018813133240e-01 + 6.7287760972976685e-01 + <_> + + 0 1 480 1.1004370171576738e-03 -1 -2 481 + -2.3396299220621586e-03 + + 4.0705141425132751e-01 2.6049488782882690e-01 + 6.1548602581024170e-01 + <_> + + 0 1 482 -3.6068160552531481e-03 -1 -2 483 + 4.0831189602613449e-02 + + 5.7319998741149902e-01 4.9733769893646240e-01 + 7.3870068788528442e-01 + <_> + + 0 1 484 -7.1082250215113163e-03 -1 -2 485 + -9.3759730225428939e-04 + + 6.9847512245178223e-01 2.6911678910255432e-01 + 4.7417798638343811e-01 + <_> + + 0 1 486 -1.6740820137783885e-03 -1 -2 487 + 8.8287703692913055e-02 + + 3.5510140657424927e-01 5.2446138858795166e-01 + 2.0966500043869019e-01 + <_> + + 0 1 488 8.2009629113599658e-04 -1 -2 489 + -7.6624617213383317e-04 + + 4.1310968995094299e-01 4.6202930808067322e-01 + 6.7754101753234863e-01 + <_> + + 1 0 490 6.5769668435677886e-04 -1 -2 491 + -2.1304790861904621e-03 + + 5.6282752752304077e-01 5.5768597126007080e-01 + 4.5776501297950745e-01 + <_> + + 1 0 492 -3.7317050737328827e-04 -1 -2 493 + -1.1172230355441570e-02 + + 4.9592560529708862e-01 5.6256359815597534e-01 + 2.0471079647541046e-01 + <_> + + 1 0 494 4.3435219675302505e-02 -1 -2 495 + 9.6736161503940821e-04 + + 2.2421480715274811e-01 4.5333439111709595e-01 + 6.1999320983886719e-01 + <_> + + 0 1 496 -3.1452889088541269e-03 -1 -2 497 + 1.5233129961416125e-03 + + 6.6627562046051025e-01 5.0079882144927979e-01 + 2.3849929869174957e-01 + <_> + + 1 0 498 2.0854279864579439e-03 -1 -2 499 + 3.6098200827836990e-02 + + 3.7535008788108826e-01 5.1771712303161621e-01 + 1.6344930231571198e-01 + <_> + + 1 0 500 1.6179570229724050e-03 -1 -2 501 + -6.2132300809025764e-04 + + 2.5873818993568420e-01 6.2995338439941406e-01 + 4.6587899327278137e-01 + <_> + + 1 0 502 7.1878539165481925e-04 -1 -2 503 + -3.9339520037174225e-02 + + 3.3540761470794678e-01 2.1541289985179901e-01 + 5.2357137203216553e-01 + <_> + + 0 1 504 -1.0988829890266061e-03 -1 -2 505 + 2.1191420964896679e-03 + + 6.4688968658447266e-01 2.8930890560150146e-01 + 5.2548158168792725e-01 + <_> + 53 + 2.5609300613403320e+01 + + <_> + + 0 1 506 5.2359891124069691e-03 -1 -2 507 + -2.2169889416545630e-03 + + 3.2997110486030579e-01 7.0415931940078735e-01 + 3.2354658842086792e-01 + <_> + + 1 0 508 -8.2303592935204506e-03 -1 -2 509 + -8.2303592935204506e-03 + + 4.9611708521842957e-01 7.1280431747436523e-01 + 4.9611708521842957e-01 + <_> + + 0 1 510 4.5343261444941163e-04 -1 -2 511 + -4.1777061414904892e-04 + + 3.2084721326828003e-01 6.6139167547225952e-01 + 3.5513329505920410e-01 + <_> + + 0 1 512 2.7823769487440586e-03 -1 -2 513 + -6.0361868236213923e-05 + + 3.7101349234580994e-01 5.7463937997817993e-01 + 3.8948801159858704e-01 + <_> + + 1 0 514 3.5061789676547050e-03 -1 -2 515 + 1.7013119941111654e-04 + + 3.0541029572486877e-01 2.8855779767036438e-01 + 6.4877450466156006e-01 + <_> + + 1 0 516 -2.3378930054605007e-03 -1 -2 517 + -2.1369170863181353e-03 + + 3.1744310259819031e-01 3.8209199905395508e-01 + 5.2328932285308838e-01 + <_> + + 0 1 518 1.0250400518998504e-03 -1 -2 519 + -4.4726220949087292e-05 + + 3.6227950453758240e-01 6.5389591455459595e-01 + 4.0036809444427490e-01 + <_> + + 1 0 520 5.7102291611954570e-04 -1 -2 521 + 5.7743012439459562e-04 + + 3.8931730389595032e-01 5.6145328283309937e-01 + 3.6876440048217773e-01 + <_> + + 1 0 522 7.9692091094329953e-04 -1 -2 523 + 3.5945948911830783e-04 + + 6.4430278539657593e-01 3.3808529376983643e-01 + 5.8246481418609619e-01 + <_> + + 1 0 524 4.3973900028504431e-04 -1 -2 525 + -8.9061429025605321e-04 + + 3.9387670159339905e-01 3.4279710054397583e-01 + 5.5156987905502319e-01 + <_> + + 1 0 526 5.4110242053866386e-03 -1 -2 527 + -8.5764907998964190e-04 + + 3.8035380840301514e-01 6.4395052194595337e-01 + 4.1683459281921387e-01 + <_> + + 0 1 528 -2.2000649943947792e-02 -1 -2 529 + -7.8731682151556015e-03 + + 6.6546010971069336e-01 4.1827228665351868e-01 + 5.6047242879867554e-01 + <_> + + 0 1 530 -2.7444459497928619e-02 -1 -2 531 + 1.9792269449681044e-03 + + 6.5868628025054932e-01 3.2449120283126831e-01 + 4.8828700184822083e-01 + <_> + + 0 1 532 -5.6783691979944706e-03 -1 -2 533 + 1.5057219570735469e-05 + + 2.2290790081024170e-01 4.1072851419448853e-01 + 5.7475912570953369e-01 + <_> + + 0 1 534 -5.4136710241436958e-03 -1 -2 535 + 5.3679239936172962e-03 + + 2.0657970011234283e-01 4.9264231324195862e-01 + 7.1394848823547363e-01 + <_> + + 0 1 536 -3.1426660716533661e-03 -1 -2 537 + 1.0907390154898167e-02 + + 6.7800867557525635e-01 5.2149301767349243e-01 + 1.1439959704875946e-01 + <_> + + 1 0 538 5.8436761610209942e-03 -1 -2 539 + 9.0507230197545141e-05 + + 1.9375260174274445e-01 3.8125771284103394e-01 + 5.5141878128051758e-01 + <_> + + 0 1 540 -1.6345789656043053e-02 -1 -2 541 + 1.5987500082701445e-03 + + 2.4740239977836609e-01 4.8177829384803772e-01 + 5.9230798482894897e-01 + <_> + + 0 1 542 -4.0257978253066540e-03 -1 -2 543 + -6.7750471644103527e-03 + + 7.5082087516784668e-01 2.8798109292984009e-01 + 5.1996952295303345e-01 + <_> + + 0 1 544 -3.2470689620822668e-03 -1 -2 545 + 1.5409620245918632e-03 + + 3.0449101328849792e-01 4.0634828805923462e-01 + 5.6765627861022949e-01 + <_> + + 0 1 546 -1.2858119793236256e-02 -1 -2 547 + -1.4824670506641269e-04 + + 9.6717558801174164e-02 4.5378330349922180e-01 + 6.1153751611709595e-01 + <_> + + 1 0 548 -9.0210810303688049e-03 -1 -2 549 + -2.8795029968023300e-02 + + 4.8077508807182312e-01 3.4037950634956360e-01 + 5.2555292844772339e-01 + <_> + + 1 0 550 9.0210810303688049e-03 -1 -2 551 + 7.4121179059147835e-03 + + 7.5058358907699585e-01 5.4554468393325806e-01 + 3.2260689139366150e-01 + <_> + + 0 1 552 -3.7217529024928808e-03 -1 -2 553 + 1.9865889847278595e-01 + + 2.3118489980697632e-01 5.2710479497909546e-01 + 1.4699299633502960e-01 + <_> + + 0 1 554 1.5208719560177997e-05 -1 -2 555 + -3.9089918136596680e-03 + + 3.6781388521194458e-01 7.1319299936294556e-01 + 4.9938669800758362e-01 + <_> + + 0 1 556 2.5106288958340883e-03 -1 -2 557 + 2.3921660613268614e-04 + + 5.3120541572570801e-01 4.6893781423568726e-01 + 5.7140219211578369e-01 + <_> + + 1 0 558 6.9443131797015667e-03 -1 -2 559 + 1.2065629707649350e-03 + + 6.9487977027893066e-01 4.0045049786567688e-01 + 5.8748817443847656e-01 + <_> + + 0 1 560 2.5106288958340883e-03 -1 -2 561 + 1.7514040227979422e-03 + + 5.3295719623565674e-01 5.5458492040634155e-01 + 3.4495818614959717e-01 + <_> + + 0 1 562 -4.1978210210800171e-03 -1 -2 563 + 1.3092850567772985e-03 + + 1.2171830236911774e-01 5.3750497102737427e-01 + 3.4156250953674316e-01 + <_> + + 0 1 564 6.7396182566881180e-04 -1 -2 565 + -1.0530710220336914e-02 + + 4.1951790452003479e-01 3.4607538580894470e-01 + 5.1558601856231689e-01 + <_> + + 0 1 566 -4.0672299265861511e-01 -1 -2 567 + -2.6314549148082733e-02 + + 5.8065678924322128e-02 1.4734490215778351e-01 + 5.5593782663345337e-01 + <_> + + 1 0 568 2.2557149641215801e-03 -1 -2 569 + 1.2154860422015190e-02 + + 5.4777151346206665e-01 4.2077910900115967e-01 + 5.6218808889389038e-01 + <_> + + 0 1 570 -1.8436539918184280e-02 -1 -2 571 + 5.3676147945225239e-04 + + 6.4471471309661865e-01 2.7651271224021912e-01 + 4.8885959386825562e-01 + <_> + + 1 0 572 -2.6265541091561317e-03 -1 -2 573 + -5.1119807176291943e-04 + + 5.2646911144256592e-01 5.7853102684020996e-01 + 4.2911028861999512e-01 + <_> + + 1 0 574 4.1454841266386211e-04 -1 -2 575 + -5.5028748465701938e-04 + + 3.4554108977317810e-01 6.0269188880920410e-01 + 4.1438931226730347e-01 + <_> + + 0 1 576 -1.0347720235586166e-03 -1 -2 577 + -3.3966631162911654e-03 + + 6.0952937602996826e-01 6.1082822084426880e-01 + 4.7077208757400513e-01 + <_> + + 1 0 578 3.1795909162610769e-03 -1 -2 579 + -1.6528950072824955e-04 + + 3.2443669438362122e-01 3.8307571411132812e-01 + 5.7343262434005737e-01 + <_> + + 1 0 580 8.3725210279226303e-03 -1 -2 581 + -2.5799809955060482e-03 + + 6.6109192371368408e-01 6.1393070220947266e-01 + 4.6861499547958374e-01 + <_> + + 1 0 582 9.0194388758391142e-04 -1 -2 583 + 3.6952210939489305e-04 + + 3.5200220346450806e-01 2.5787541270256042e-01 + 5.4672420024871826e-01 + <_> + + 0 1 584 9.9746137857437134e-04 -1 -2 585 + -3.6688039544969797e-03 + + 4.8201468586921692e-01 5.7101500034332275e-01 + 4.8319110274314880e-01 + <_> + + 0 1 586 -8.9501030743122101e-04 -1 -2 587 + 5.1904921419918537e-03 + + 6.1336791515350342e-01 4.9285829067230225e-01 + 2.5813090801239014e-01 + <_> + + 0 1 588 4.2274440056644380e-04 -1 -2 589 + 8.5176713764667511e-03 + + 4.4711241126060486e-01 5.1610249280929565e-01 + 3.3165338635444641e-01 + <_> + + 0 1 590 -3.6623608320951462e-02 -1 -2 591 + -4.1103712283074856e-03 + + 9.2606216669082642e-02 8.5221147537231445e-01 + 5.1379078626632690e-01 + <_> + + 1 0 592 -6.6017331555485725e-03 -1 -2 593 + 2.5578640401363373e-02 + + 5.4590600728988647e-01 5.2193528413772583e-01 + 1.9271859526634216e-01 + <_> + + 1 0 594 1.1447439901530743e-02 -1 -2 595 + 7.2427501436322927e-04 + + 1.9160020351409912e-01 5.2315711975097656e-01 + 3.5353401303291321e-01 + <_> + + 1 0 596 9.7127500921487808e-03 -1 -2 597 + -1.1337569914758205e-02 + + 6.4641010761260986e-01 7.3830378055572510e-01 + 4.9647438526153564e-01 + <_> + + 0 1 598 -8.1453882157802582e-03 -1 -2 599 + -8.5570756345987320e-03 + + 3.6117058992385864e-01 3.4219071269035339e-01 + 5.9435117244720459e-01 + <_> + + 0 1 600 2.2993308957666159e-03 -1 -2 601 + 3.8430930580943823e-03 + + 4.5501041412353516e-01 4.7168621420860291e-01 + 6.6561907529830933e-01 + <_> + + 1 0 602 -9.9116540513932705e-04 -1 -2 603 + 2.5496469810605049e-02 + + 4.5927169919013977e-01 6.5634012222290039e-01 + 1.2588350474834442e-01 + <_> + + 1 0 604 -1.5748359262943268e-02 -1 -2 605 + -1.8046120181679726e-02 + + 5.2395021915435791e-01 8.0158519744873047e-01 + 5.0079578161239624e-01 + <_> + + 1 0 606 1.0323390364646912e-02 -1 -2 607 + 1.6452240524813533e-03 + + 2.2748200595378876e-01 4.3519461154937744e-01 + 5.8676278591156006e-01 + <_> + + 0 1 608 1.5881149098277092e-02 -1 -2 609 + 1.0586519725620747e-02 + + 4.4650518894195557e-01 4.5444580912590027e-01 + 5.7071107625961304e-01 + <_> + + 0 1 610 -2.1531689912080765e-02 -1 -2 611 + 5.2480469457805157e-03 + + 6.5276437997817993e-01 3.4447279572486877e-01 + 5.3246361017227173e-01 + <_> + 67 + 3.2647129058837891e+01 + + <_> + + 0 1 612 1.8219340126961470e-03 -1 -2 613 + 8.1313941627740860e-03 + + 3.1087881326675415e-01 3.1332370638847351e-01 + 6.6458672285079956e-01 + <_> + + 0 1 614 1.7055979697033763e-03 -1 -2 615 + -7.4483548814896494e-05 + + 2.6401311159133911e-01 5.6472051143646240e-01 + 3.4853729605674744e-01 + <_> + + 1 0 616 3.8342390325851738e-04 -1 -2 617 + 3.1868910882622004e-03 + + 3.1406548619270325e-01 6.4891988039016724e-01 + 3.8877290487289429e-01 + <_> + + 1 0 618 1.6044320166110992e-01 -1 -2 619 + -6.7285560071468353e-03 + + 7.2165298461914062e-01 1.6531379520893097e-01 + 5.1398259401321411e-01 + <_> + + 0 1 620 7.2638481469766703e-06 -1 -2 621 + 5.5551197146996856e-04 + + 3.1406199932098389e-01 5.9936988353729248e-01 + 3.3173981308937073e-01 + <_> + + 0 1 622 -1.0822320356965065e-02 -1 -2 623 + -4.5834020711481571e-03 + + 2.6529380679130554e-01 1.8495689332485199e-01 + 5.3139579296112061e-01 + <_> + + 1 0 624 -3.0205070506781340e-03 -1 -2 625 + 7.7864617109298706e-02 + + 4.0400999784469604e-01 6.1581897735595703e-01 + 1.7864869534969330e-01 + <_> + + 0 1 626 2.6494380086660385e-02 -1 -2 627 + 3.6912109702825546e-02 + + 4.5110899209976196e-01 4.5282199978828430e-01 + 5.9722828865051270e-01 + <_> + + 1 0 628 5.7857790961861610e-03 -1 -2 629 + 9.3849771656095982e-04 + + 2.5338920950889587e-01 3.4104120731353760e-01 + 5.9236437082290649e-01 + <_> + + 0 1 630 -1.1003199964761734e-02 -1 -2 631 + -1.1737640015780926e-03 + + 6.9580441713333130e-01 3.8510841131210327e-01 + 5.4081892967224121e-01 + <_> + + 0 1 632 -3.6596669815480709e-03 -1 -2 633 + -2.4822750128805637e-03 + + 2.0093089342117310e-01 6.2953931093215942e-01 + 4.3950408697128296e-01 + <_> + + 0 1 634 -4.4606071896851063e-03 -1 -2 635 + -3.5969649907201529e-03 + + 2.4052999913692474e-01 5.4501742124557495e-01 + 3.7823578715324402e-01 + <_> + + 0 1 636 -3.6222559865564108e-03 -1 -2 637 + 1.2059339787811041e-03 + + 3.0338969826698303e-01 4.6337789297103882e-01 + 6.3359522819519043e-01 + <_> + + 1 0 638 4.3124938383698463e-03 -1 -2 639 + -4.4961250387132168e-03 + + 6.5988260507583618e-01 6.6216969490051270e-01 + 4.7552469372749329e-01 + <_> + + 0 1 640 -1.3860689941793680e-03 -1 -2 641 + -5.1588460337370634e-04 + + 2.8012010455131531e-01 3.8294890522956848e-01 + 5.6236267089843750e-01 + <_> + + 0 1 642 7.0330002927221358e-05 -1 -2 643 + -2.0976549421902746e-04 + + 4.5363429188728333e-01 5.6081390380859375e-01 + 4.2657798528671265e-01 + <_> + + 1 0 644 1.3642259873449802e-03 -1 -2 645 + 1.5483660390600562e-03 + + 2.6370918750762939e-01 4.1707509756088257e-01 + 5.9329879283905029e-01 + <_> + + 0 1 646 1.9179609417915344e-01 -1 -2 647 + -4.4776909053325653e-03 + + 5.2567642927169800e-01 6.6326218843460083e-01 + 4.8925888538360596e-01 + <_> + + 0 1 648 -1.2649179995059967e-01 -1 -2 649 + 6.5253327193204314e-05 + + 1.4997789263725281e-01 4.2333200573921204e-01 + 5.7560402154922485e-01 + <_> + + 0 1 650 4.1856421157717705e-03 -1 -2 651 + 2.7478230185806751e-04 + + 5.2888268232345581e-01 4.5240178704261780e-01 + 5.6041252613067627e-01 + <_> + + 0 1 652 -2.2906810045242310e-03 -1 -2 653 + 1.6744500026106834e-03 + + 5.5782741308212280e-01 3.3230578899383545e-01 + 5.5587881803512573e-01 + <_> + + 1 0 654 1.2349759927019477e-03 -1 -2 655 + -8.7158754467964172e-03 + + 3.6539471149444580e-01 1.9245339930057526e-01 + 5.3136497735977173e-01 + <_> + + 1 0 656 4.6613621525466442e-03 -1 -2 657 + -8.5815992206335068e-03 + + 2.0277309417724609e-01 7.6360601186752319e-01 + 5.1408261060714722e-01 + <_> + + 0 1 658 1.4352120459079742e-02 -1 -2 659 + -7.7948719263076782e-03 + + 5.2529758214950562e-01 2.6329371333122253e-01 + 5.3286892175674438e-01 + <_> + + 0 1 660 -3.4155680332332850e-03 -1 -2 661 + -4.2639090679585934e-03 + + 2.4160879850387573e-01 3.9365449547767639e-01 + 5.4787421226501465e-01 + <_> + + 0 1 662 8.7177697569131851e-03 -1 -2 663 + -3.2232629600912333e-03 + + 4.7881990671157837e-01 3.6316120624542236e-01 + 5.2883160114288330e-01 + <_> + + 0 1 664 -4.2188368737697601e-02 -1 -2 665 + 1.9875749945640564e-02 + + 6.9311392307281494e-01 4.5201000571250916e-01 + 6.8550550937652588e-01 + <_> + + 1 0 666 -3.1134510412812233e-02 -1 -2 667 + 5.7032387703657150e-03 + + 5.3004240989685059e-01 5.6068921089172363e-01 + 4.2306229472160339e-01 + <_> + + 1 0 668 5.2733682096004486e-03 -1 -2 669 + -3.1231069006025791e-03 + + 3.2472288608551025e-01 1.9856959581375122e-01 + 5.3498727083206177e-01 + <_> + + 0 1 670 4.6453849063254893e-04 -1 -2 671 + 3.0355889350175858e-02 + + 4.2075088620185852e-01 5.1534587144851685e-01 + 3.1181010603904724e-01 + <_> + + 0 1 672 -4.2992769740521908e-03 -1 -2 673 + 1.9509199773892760e-04 + + 3.2745069265365601e-01 5.9530782699584961e-01 + 4.2255210876464844e-01 + <_> + + 0 1 674 -7.7784480527043343e-03 -1 -2 675 + 1.6917599365115166e-02 + + 7.2111797332763672e-01 4.9365919828414917e-01 + 7.0302772521972656e-01 + <_> + + 0 1 676 -5.1948569715023041e-02 -1 -2 677 + -5.4751220159232616e-03 + + 1.4255349338054657e-01 6.0593318939208984e-01 + 4.3939951062202454e-01 + <_> + + 0 1 678 1.5210839592327829e-05 -1 -2 679 + 1.0235579684376717e-03 + + 4.4888499379158020e-01 4.2565500736236572e-01 + 5.7954382896423340e-01 + <_> + + 0 1 680 -1.0427719826111570e-04 -1 -2 681 + 8.7853781878948212e-03 + + 4.2460399866104126e-01 4.9580091238021851e-01 + 6.7594307661056519e-01 + <_> + + 0 1 682 3.4012699034065008e-03 -1 -2 683 + 5.8582378551363945e-04 + + 5.4234808683395386e-01 3.6365428566932678e-01 + 5.4643487930297852e-01 + <_> + + 0 1 684 -2.2973360028117895e-03 -1 -2 685 + -1.4330189675092697e-02 + + 2.5488188862800598e-01 6.5876567363739014e-01 + 4.5328021049499512e-01 + <_> + + 0 1 686 9.8565965890884399e-04 -1 -2 687 + -4.6640761196613312e-02 + + 3.8227710127830505e-01 3.0773219466209412e-01 + 5.2441328763961792e-01 + <_> + + 0 1 688 -1.1907300353050232e-01 -1 -2 689 + 1.9333280622959137e-02 + + 1.0338629782199860e-01 5.5547451972961426e-01 + 3.2213169336318970e-01 + <_> + + 0 1 690 3.1427849084138870e-02 -1 -2 691 + 2.0082130504306406e-04 + + 4.6823790669441223e-01 5.3730702400207520e-01 + 3.8006669282913208e-01 + <_> + + 0 1 692 -6.2584900297224522e-03 -1 -2 693 + 8.2861045375466347e-03 + + 1.7992070317268372e-01 5.0950688123703003e-01 + 7.5446051359176636e-01 + <_> + + 0 1 694 2.0529709290713072e-03 -1 -2 695 + 3.2524869311600924e-03 + + 5.6286448240280151e-01 4.8016890883445740e-01 + 5.8021020889282227e-01 + <_> + + 0 1 696 -3.1884901225566864e-02 -1 -2 697 + 1.8379340181127191e-03 + + 1.7427450418472290e-01 3.4665969014167786e-01 + 5.1071548461914062e-01 + <_> + + 1 0 698 -4.8512680223211646e-04 -1 -2 699 + -2.5407879147678614e-03 + + 5.3260862827301025e-01 6.3427752256393433e-01 + 4.9926930665969849e-01 + <_> + + 0 1 700 -5.1559060811996460e-03 -1 -2 701 + -4.4968750327825546e-02 + + 3.4334290027618408e-01 1.8681369721889496e-01 + 5.2154648303985596e-01 + <_> + + 1 0 702 5.8984281495213509e-03 -1 -2 703 + 3.2763120252639055e-03 + + 6.2293052673339844e-01 4.9357721209526062e-01 + 7.2179448604583740e-01 + <_> + + 1 0 704 -1.0161520185647532e-04 -1 -2 705 + -1.6290300118271261e-04 + + 5.0079762935638428e-01 6.0241490602493286e-01 + 2.3295080661773682e-01 + <_> + + 0 1 706 9.0541364625096321e-03 -1 -2 707 + 3.5398490726947784e-02 + + 4.5104169845581055e-01 5.1419967412948608e-01 + 2.8602918982505798e-01 + <_> + + 0 1 708 5.6469351984560490e-03 -1 -2 709 + -2.4807190056890249e-03 + + 4.7049251198768616e-01 4.1798511147499084e-01 + 6.7266470193862915e-01 + <_> + + 0 1 710 -4.1088787838816643e-03 -1 -2 711 + -2.0714469719678164e-03 + + 5.8098018169403076e-01 6.0747838020324707e-01 + 4.5240598917007446e-01 + <_> + + 0 1 712 -2.8939060866832733e-03 -1 -2 713 + 1.3467279495671391e-03 + + 3.3835199475288391e-01 5.6969100236892700e-01 + 3.9708450436592102e-01 + <_> + + 0 1 714 -9.0779133141040802e-02 -1 -2 715 + -8.3171762526035309e-02 + + 1.5027019381523132e-01 7.5736707448959351e-01 + 4.9364370107650757e-01 + <_> + + 0 1 716 -1.4107000315561891e-03 -1 -2 717 + 5.5668760091066360e-02 + + 3.3909329771995544e-01 5.0250971317291260e-01 + 7.4220830202102661e-01 + <_> + + 0 1 718 5.7701539248228073e-02 -1 -2 719 + -4.2503291368484497e-01 + + 5.1973718404769897e-01 9.7346916794776917e-02 + 5.1857399940490723e-01 + <_> + + 0 1 720 -4.4380719191394746e-04 -1 -2 721 + 1.7924769781529903e-04 + + 3.6493501067161560e-01 5.6192791461944580e-01 + 3.7602970004081726e-01 + <_> + + 1 0 722 5.0382469780743122e-03 -1 -2 723 + 1.5191170386970043e-02 + + 6.3284450769424438e-01 4.9360820651054382e-01 + 7.4265247583389282e-01 + <_> + + 0 1 724 -1.2300389818847179e-02 -1 -2 725 + 1.5168030513450503e-03 + + 1.3893499970436096e-01 5.0919622182846069e-01 + 3.4826481342315674e-01 + <_> + + 1 0 726 9.5754547510296106e-04 -1 -2 727 + -1.8962200731039047e-02 + + 6.0363167524337769e-01 2.3191730678081512e-01 + 5.1166528463363647e-01 + <_> + + 0 1 728 -2.2272260859608650e-02 -1 -2 729 + -2.5145230814814568e-02 + + 6.5550220012664795e-01 1.3260710239410400e-01 + 4.6740341186523438e-01 + <_> + + 0 1 730 1.9533900544047356e-02 -1 -2 731 + -1.1231349781155586e-03 + + 5.1820272207260132e-01 6.3182431459426880e-01 + 4.8255190253257751e-01 + <_> + + 0 1 732 -1.4861139934509993e-03 -1 -2 733 + 3.5002888762392104e-04 + + 2.9186710715293884e-01 5.6213712692260742e-01 + 4.2492130398750305e-01 + <_> + + 1 0 734 -1.1231349781155586e-03 -1 -2 735 + 1.0409739799797535e-02 + + 4.8137450218200684e-01 5.1840060949325562e-01 + 2.0512230694293976e-01 + <_> + + 0 1 736 -8.7832562625408173e-02 -1 -2 737 + 1.6584879485890269e-03 + + 1.1799219995737076e-01 4.9878111481666565e-01 + 6.9737559556961060e-01 + <_> + + 1 0 738 -2.3008750285953283e-03 -1 -2 739 + 3.3026169985532761e-02 + + 5.3398311138153076e-01 5.0332891941070557e-01 + 6.8519067764282227e-01 + <_> + + 0 1 740 -1.3585069682449102e-03 -1 -2 741 + 7.8067491995170712e-04 + + 3.0028221011161804e-01 4.5930838584899902e-01 + 6.4400452375411987e-01 + <_> + + 1 0 742 -1.8025759607553482e-02 -1 -2 743 + 1.2354910140857100e-03 + + 5.3112912178039551e-01 4.7291061282157898e-01 + 5.7214611768722534e-01 + <_> + + 0 1 744 -9.2583027435466647e-04 -1 -2 745 + 8.0123997759073973e-04 + + 3.6623328924179077e-01 5.3619897365570068e-01 + 3.0086329579353333e-01 + <_> + 63 + 3.0672130584716797e+01 + + <_> + + 0 1 746 2.4914839304983616e-03 -1 -2 747 + -5.0488598644733429e-02 + + 3.4223890304565430e-01 7.7034580707550049e-01 + 4.5163908600807190e-01 + <_> + + 1 0 748 -7.7838351717218757e-04 -1 -2 749 + 2.3572890495415777e-04 + + 3.2563421130180359e-01 3.4065559506416321e-01 + 5.8970272541046143e-01 + <_> + + 0 1 750 4.5575071126222610e-03 -1 -2 751 + 8.1241987645626068e-03 + + 4.3065789341926575e-01 7.1495872735977173e-01 + 4.3456849455833435e-01 + <_> + + 0 1 752 -4.4612158671952784e-04 -1 -2 753 + -2.8972938889637589e-04 + + 3.2959741353988647e-01 5.8456200361251831e-01 + 3.5266879200935364e-01 + <_> + + 0 1 754 7.1604831646254752e-06 -1 -2 755 + -3.8497708737850189e-04 + + 4.0819549560546875e-01 4.2031130194664001e-01 + 6.6341269016265869e-01 + <_> + + 0 1 756 1.9489860278554261e-04 -1 -2 757 + -1.7083849757909775e-02 + + 3.9424669742584229e-01 2.2940720617771149e-01 + 5.2389609813690186e-01 + <_> + + 0 1 758 8.3513697609305382e-04 -1 -2 759 + 7.5499608647078276e-04 + + 3.0260318517684937e-01 6.0321962833404541e-01 + 3.4124588966369629e-01 + <_> + + 1 0 760 8.0216713249683380e-03 -1 -2 761 + -3.8930509239435196e-02 + + 7.3062407970428467e-01 3.5993251204490662e-01 + 5.2343809604644775e-01 + <_> + + 1 0 762 -7.0348767621908337e-05 -1 -2 763 + -8.5350573062896729e-03 + + 3.4937581419944763e-01 2.7461090683937073e-01 + 5.6265860795974731e-01 + <_> + + 0 1 764 1.0854450054466724e-02 -1 -2 765 + 4.5329501153901219e-04 + + 5.2822262048721313e-01 4.5220491290092468e-01 + 6.0543018579483032e-01 + <_> + + 0 1 766 1.8117150466423482e-04 -1 -2 767 + 4.6641560038551688e-04 + + 3.3068621158599854e-01 1.4550000429153442e-01 + 5.3849279880523682e-01 + <_> + + 1 0 768 -8.4854792803525925e-03 -1 -2 769 + -1.8934309482574463e-02 + + 4.8141559958457947e-01 3.5637411475181580e-01 + 5.4051452875137329e-01 + <_> + + 1 0 770 4.9814549274742603e-03 -1 -2 771 + 3.4286780282855034e-03 + + 6.9577431678771973e-01 5.0508928298950195e-01 + 2.3169949650764465e-01 + <_> + + 1 0 772 4.4203791185282171e-04 -1 -2 773 + 2.3822550429031253e-04 + + 6.0185819864273071e-01 4.7550821304321289e-01 + 5.5852377414703369e-01 + <_> + + 0 1 774 -6.4261639490723610e-03 -1 -2 775 + 9.9637769162654877e-03 + + 2.2824659943580627e-01 4.0405881404876709e-01 + 5.6501698493957520e-01 + <_> + + 0 1 776 1.3654050417244434e-02 -1 -2 777 + -9.9892877042293549e-03 + + 5.2677392959594727e-01 6.7940497398376465e-01 + 4.7970339655876160e-01 + <_> + + 1 0 778 3.6558631807565689e-02 -1 -2 779 + 4.8999379941960797e-05 + + 8.8425733149051666e-02 4.0207880735397339e-01 + 5.4573321342468262e-01 + <_> + + 0 1 780 1.3654050417244434e-02 -1 -2 781 + 1.8802779959514737e-03 + + 5.2676129341125488e-01 4.8060521483421326e-01 + 6.3943648338317871e-01 + <_> + + 0 1 782 -1.3654050417244434e-02 -1 -2 783 + 1.2778700329363346e-03 + + 1.7248100042343140e-01 4.4798240065574646e-01 + 6.3100087642669678e-01 + <_> + + 1 0 784 9.8843395244330168e-04 -1 -2 785 + 1.4511500012304168e-05 + + 5.9481692314147949e-01 4.8541748523712158e-01 + 5.3093612194061279e-01 + <_> + + 0 1 786 -2.2775429533794522e-04 -1 -2 787 + -1.4753740280866623e-02 + + 3.1836318969726562e-01 3.0849760770797729e-01 + 5.3520262241363525e-01 + <_> + + 0 1 788 -3.4148250706493855e-03 -1 -2 789 + 7.5806681998074055e-03 + + 6.1153268814086914e-01 4.9516460299491882e-01 + 7.0613312721252441e-01 + <_> + + 1 0 790 -5.7734688743948936e-03 -1 -2 791 + 7.4033669079653919e-05 + + 3.7542209029197693e-01 4.1155171394348145e-01 + 5.8894449472427368e-01 + <_> + + 0 1 792 -8.2278084009885788e-03 -1 -2 793 + 5.3380909375846386e-03 + + 9.5610566437244415e-02 5.3005087375640869e-01 + 3.9618980884552002e-01 + <_> + + 0 1 794 -2.7049109339714050e-03 -1 -2 795 + 7.7341338619589806e-03 + + 6.4818692207336426e-01 5.1104402542114258e-01 + 3.1215190887451172e-01 + <_> + + 0 1 796 1.0886609554290771e-02 -1 -2 797 + 1.1038660071790218e-02 + + 4.8014289140701294e-01 5.4297101497650146e-01 + 4.1623631119728088e-01 + <_> + + 0 1 798 -1.0054199956357479e-02 -1 -2 799 + 7.7072880230844021e-03 + + 7.3293352127075195e-01 5.3568720817565918e-01 + 3.4555470943450928e-01 + <_> + + 0 1 800 -5.8278098003938794e-04 -1 -2 801 + -2.5739220436662436e-03 + + 3.6550220847129822e-01 3.7767601013183594e-01 + 5.3917747735977173e-01 + <_> + + 0 1 802 -7.0167761296033859e-03 -1 -2 803 + -1.7727289814502001e-03 + + 4.0393048524856567e-01 6.9504439830780029e-01 + 4.9811169505119324e-01 + <_> + + 1 0 804 -1.6318289563059807e-02 -1 -2 805 + -1.1663000099360943e-02 + + 5.2967327833175659e-01 5.8426398038864136e-01 + 4.7895029187202454e-01 + <_> + + 1 0 806 2.5881489273160696e-03 -1 -2 807 + -3.7328999023884535e-03 + + 6.0921788215637207e-01 6.7217427492141724e-01 + 4.0668940544128418e-01 + <_> + + 0 1 808 -1.4355930034071207e-03 -1 -2 809 + 1.8340899841859937e-03 + + 3.5850879549980164e-01 5.3711581230163574e-01 + 4.0335071086883545e-01 + <_> + + 1 0 810 1.2280289828777313e-01 -1 -2 811 + 5.0228700041770935e-02 + + 1.5475720167160034e-01 5.4338437318801880e-01 + 8.4292672574520111e-02 + <_> + + 1 0 812 -2.1437000483274460e-02 -1 -2 813 + -3.1009620055556297e-02 + + 4.8600539565086365e-01 1.8330100178718567e-01 + 5.2075541019439697e-01 + <_> + + 0 1 814 -1.2973720207810402e-02 -1 -2 815 + 1.5818020328879356e-03 + + 7.0482409000396729e-01 4.1705870628356934e-01 + 5.8651638031005859e-01 + <_> + + 1 0 816 -9.7806248813867569e-03 -1 -2 817 + 1.1735740117728710e-03 + + 5.3079181909561157e-01 5.5224531888961792e-01 + 3.5071650147438049e-01 + <_> + + 1 0 818 1.4651629608124495e-03 -1 -2 819 + 2.3532148916274309e-03 + + 3.0426511168479919e-01 5.3393232822418213e-01 + 2.8062361478805542e-01 + <_> + + 0 1 820 -6.1809681355953217e-03 -1 -2 821 + 6.5688649192452431e-04 + + 6.4101332426071167e-01 5.6208711862564087e-01 + 4.3903189897537231e-01 + <_> + + 1 0 822 2.6228010654449463e-02 -1 -2 823 + -1.7958110198378563e-02 + + 6.4455568790435791e-01 2.0027139782905579e-01 + 4.6246650815010071e-01 + <_> + + 1 0 824 -7.6468721963465214e-03 -1 -2 825 + -2.7482809964567423e-03 + + 5.2632009983062744e-01 5.8739811182022095e-01 + 4.8366001248359680e-01 + <_> + + 1 0 826 1.3851850293576717e-02 -1 -2 827 + 2.6369190309196711e-03 + + 1.5661309659481049e-01 4.2701789736747742e-01 + 5.8066600561141968e-01 + <_> + + 0 1 828 -3.1513599678874016e-03 -1 -2 829 + -1.4788460248382762e-05 + + 6.2158662080764771e-01 5.5766427516937256e-01 + 4.1220021247863770e-01 + <_> + + 0 1 830 -7.3676988482475281e-02 -1 -2 831 + -3.0912780202925205e-03 + + 1.5367099642753601e-01 6.3442689180374146e-01 + 4.5074120163917542e-01 + <_> + + 0 1 832 7.9240966588258743e-03 -1 -2 833 + 8.5778040811419487e-03 + + 5.4579752683639526e-01 5.4016572237014771e-01 + 3.8907998800277710e-01 + <_> + + 1 0 834 5.5403169244527817e-03 -1 -2 835 + -1.1886510037584230e-04 + + 3.5556110739707947e-01 5.8367502689361572e-01 + 4.2743161320686340e-01 + <_> + + 0 1 836 -1.8408369272947311e-02 -1 -2 837 + -2.3490579333156347e-03 + + 5.8604401350021362e-01 4.4989579916000366e-01 + 5.4981988668441772e-01 + <_> + + 1 0 838 -7.6157399453222752e-03 -1 -2 839 + -3.3190969843417406e-03 + + 4.1009929776191711e-01 6.7013788223266602e-01 + 4.3530011177062988e-01 + <_> + + 1 0 840 -9.4642979092895985e-04 -1 -2 841 + 8.7858550250530243e-03 + + 5.3911769390106201e-01 5.5040502548217773e-01 + 3.9909350872039795e-01 + <_> + + 1 0 842 1.6395459533669055e-04 -1 -2 843 + -2.3508940357714891e-03 + + 3.5929331183433533e-01 4.0341728925704956e-01 + 5.8060771226882935e-01 + <_> + + 1 0 844 7.5449963333085179e-05 -1 -2 845 + 2.7018489316105843e-02 + + 5.4123848676681519e-01 4.9449229240417480e-01 + 5.5894362926483154e-01 + <_> + + 1 0 846 8.4561208495870233e-04 -1 -2 847 + -1.1687109945341945e-03 + + 5.8092182874679565e-01 4.7469571232795715e-01 + 2.8458958864212036e-01 + <_> + + 1 0 848 2.2897500544786453e-02 -1 -2 849 + 7.0879262685775757e-01 + + 2.4144110083580017e-01 5.1957648992538452e-01 + 1.0300920158624649e-01 + <_> + + 1 0 850 3.7483830004930496e-02 -1 -2 851 + 1.2827500468119979e-03 + + 1.8146389722824097e-01 4.2460718750953674e-01 + 5.7079732418060303e-01 + <_> + + 0 1 852 -5.1718312315642834e-03 -1 -2 853 + 2.7545939665287733e-03 + + 6.1433231830596924e-01 5.2056711912155151e-01 + 4.2204418778419495e-01 + <_> + + 0 1 854 -3.6072919610887766e-03 -1 -2 855 + -2.5258748792111874e-04 + + 3.1825920939445496e-01 5.7104682922363281e-01 + 4.2260938882827759e-01 + <_> + + 1 0 856 -7.0514748804271221e-03 -1 -2 857 + -5.4323761723935604e-03 + + 5.1628297567367554e-01 2.6662889122962952e-01 + 5.2146798372268677e-01 + <_> + + 1 0 858 -1.4652940080850385e-05 -1 -2 859 + -1.8556920113041997e-03 + + 3.9817610383033752e-01 3.3227631449699402e-01 + 5.7058340311050415e-01 + <_> + + 1 0 860 4.7609540633857250e-03 -1 -2 861 + 1.5676260227337480e-03 + + 6.6365581750869751e-01 5.5055677890777588e-01 + 4.4206619262695312e-01 + <_> + + 1 0 862 5.4239919409155846e-03 -1 -2 863 + -6.4692399464547634e-03 + + 5.9599381685256958e-01 5.3695940971374512e-01 + 3.7443399429321289e-01 + <_> + + 0 1 864 -7.8038539504632354e-04 -1 -2 865 + 4.5086450874805450e-02 + + 4.1035950183868408e-01 5.1775068044662476e-01 + 1.8781000375747681e-01 + <_> + + 0 1 866 -5.1405387930572033e-03 -1 -2 867 + -2.1236129105091095e-02 + + 2.3528920114040375e-01 1.7087510228157043e-01 + 5.4249739646911621e-01 + <_> + + 0 1 868 -2.3763340432196856e-03 -1 -2 869 + 5.4122589528560638e-02 + + 5.8365309238433838e-01 5.1174330711364746e-01 + 1.8659310042858124e-01 + <_> + + 0 1 870 -5.3492980077862740e-04 -1 -2 871 + -5.8454048121348023e-04 + + 5.1086932420730591e-01 4.7754910588264465e-01 + 2.4398539960384369e-01 + <_> + 71 + 3.4677078247070312e+01 + + <_> + + 0 1 872 3.0031939968466759e-03 -1 -2 873 + 6.9161207647994161e-04 + + 3.3496499061584473e-01 4.5183679461479187e-01 + 7.2893542051315308e-01 + <_> + + 0 1 874 1.1212790384888649e-02 -1 -2 875 + -7.6108198845759034e-04 + + 2.9508009552955627e-01 5.6690549850463867e-01 + 2.8308510780334473e-01 + <_> + + 0 1 876 1.1984579759882763e-04 -1 -2 877 + -1.9725349557120353e-04 + + 4.0905779600143433e-01 6.9514942169189453e-01 + 4.6378681063652039e-01 + <_> + + 1 0 878 -5.5180420167744160e-03 -1 -2 879 + 1.2148249661549926e-03 + + 3.1676751375198364e-01 3.3167061209678650e-01 + 5.3963977098464966e-01 + <_> + + 0 1 880 -4.2497441172599792e-03 -1 -2 881 + -9.4915721565485001e-03 + + 2.6005738973617554e-01 7.4842947721481323e-01 + 5.0731921195983887e-01 + <_> + + 1 0 882 6.5378600265830755e-04 -1 -2 883 + -4.9741100519895554e-04 + + 3.9520108699798584e-01 5.8802747726440430e-01 + 3.5521200299263000e-01 + <_> + + 0 1 884 -4.3079249560832977e-02 -1 -2 885 + -5.1999092102050781e-04 + + 2.4348780512809753e-01 3.1955629587173462e-01 + 5.5854547023773193e-01 + <_> + + 1 0 886 -4.5451628975570202e-03 -1 -2 887 + -7.9610403627157211e-03 + + 4.8452898859977722e-01 3.8011810183525085e-01 + 5.3585118055343628e-01 + <_> + + 1 0 888 -3.1919340835884213e-04 -1 -2 889 + -1.9223889335989952e-02 + + 4.3563291430473328e-01 2.6130661368370056e-01 + 6.1554962396621704e-01 + <_> + + 0 1 890 -1.3076990144327283e-03 -1 -2 891 + 1.9825039431452751e-02 + + 5.9420621395111084e-01 4.9454280734062195e-01 + 7.3848551511764526e-01 + <_> + + 0 1 892 -2.2013280540704727e-03 -1 -2 893 + -7.8596705570816994e-03 + + 2.2144819796085358e-01 3.6009770631790161e-01 + 5.2985501289367676e-01 + <_> + + 1 0 894 1.4142199652269483e-03 -1 -2 895 + -1.1232759803533554e-02 + + 5.7765662670135498e-01 6.9344568252563477e-01 + 4.8272070288658142e-01 + <_> + + 1 0 896 2.9746301006525755e-03 -1 -2 897 + 5.3283828310668468e-04 + + 3.2166770100593567e-01 3.9625000953674316e-01 + 5.6803637742996216e-01 + <_> + + 1 0 898 1.0105259716510773e-02 -1 -2 899 + -1.1653699912130833e-02 + + 7.5674182176589966e-01 6.5235567092895508e-01 + 5.0270539522171021e-01 + <_> + + 0 1 900 -7.0609981194138527e-03 -1 -2 901 + 2.2343141026794910e-03 + + 2.5387701392173767e-01 4.3872770667076111e-01 + 6.1776322126388550e-01 + <_> + + 1 0 902 -2.9802279546856880e-02 -1 -2 903 + 1.1611840454861522e-03 + + 5.2011400461196899e-01 4.6479099988937378e-01 + 6.1842548847198486e-01 + <_> + + 1 0 904 9.4824447296559811e-04 -1 -2 905 + 4.1284630424343050e-04 + + 3.0409941077232361e-01 4.5188081264495850e-01 + 6.2457829713821411e-01 + <_> + + 0 1 906 -3.1203540042042732e-02 -1 -2 907 + 2.7652881108224392e-03 + + 2.7889358997344971e-01 4.6985000371932983e-01 + 6.5024542808532715e-01 + <_> + + 1 0 908 2.5644779205322266e-02 -1 -2 909 + -7.5331530533730984e-03 + + 1.8051710724830627e-01 3.2080689072608948e-01 + 5.5220228433609009e-01 + <_> + + 1 0 910 3.2047149725258350e-03 -1 -2 911 + -2.4282479716930538e-04 + + 6.4369338750839233e-01 5.6767052412033081e-01 + 4.5091038942337036e-01 + <_> + + 0 1 912 -6.1979342717677355e-04 -1 -2 913 + -8.0101029016077518e-04 + + 3.1221461296081543e-01 2.9651939868927002e-01 + 5.2304947376251221e-01 + <_> + + 1 0 914 -9.1816839994862676e-04 -1 -2 915 + 1.2239529751241207e-03 + + 5.4647117853164673e-01 4.6185028553009033e-01 + 5.6795489788055420e-01 + <_> + + 0 1 916 -6.8743730662390590e-04 -1 -2 917 + -1.8252469599246979e-03 + + 5.4308801889419556e-01 5.4336231946945190e-01 + 3.3852210640907288e-01 + <_> + + 1 0 918 -7.4570789001882076e-03 -1 -2 919 + 5.3775748237967491e-03 + + 5.2655947208404541e-01 4.8572158813476562e-01 + 6.8151241540908813e-01 + <_> + + 1 0 920 3.7602309603244066e-03 -1 -2 921 + 8.7752222316339612e-04 + + 2.8321608901023865e-01 3.9668309688568115e-01 + 5.5124807357788086e-01 + <_> + + 1 0 922 5.5084479972720146e-03 -1 -2 923 + -7.5949047459289432e-04 + + 6.7846202850341797e-01 3.9065030217170715e-01 + 5.4572027921676636e-01 + <_> + + 1 0 924 1.6352660022675991e-03 -1 -2 925 + -1.2750849418807775e-04 + + 3.6402040719985962e-01 5.8297240734100342e-01 + 4.1949799656867981e-01 + <_> + + 0 1 926 2.2067610174417496e-02 -1 -2 927 + -1.9203789532184601e-02 + + 4.6067029237747192e-01 3.2614830136299133e-01 + 5.2360808849334717e-01 + <_> + + 0 1 928 -1.2998109683394432e-02 -1 -2 929 + -3.1332690268754959e-03 + + 7.0221120119094849e-01 2.8704708814620972e-01 + 5.0764769315719604e-01 + <_> + + 1 0 930 -5.2937557920813560e-03 -1 -2 931 + 2.1857069805264473e-03 + + 4.7095209360122681e-01 4.7082918882369995e-01 + 6.1698418855667114e-01 + <_> + + 0 1 932 -4.5750709250569344e-03 -1 -2 933 + -4.5152138918638229e-02 + + 3.1142529845237732e-01 1.8514350056648254e-01 + 5.5048149824142456e-01 + <_> + + 1 0 934 -2.7783559635281563e-03 -1 -2 935 + -2.5752480141818523e-03 + + 4.9373480677604675e-01 6.1529481410980225e-01 + 4.7354999184608459e-01 + <_> + + 1 0 936 1.1614130344241858e-03 -1 -2 937 + 2.3350189439952374e-03 + + 6.5105718374252319e-01 4.0883418917655945e-01 + 5.6841522455215454e-01 + <_> + + 1 0 938 3.8499289657920599e-03 -1 -2 939 + 2.4529630318284035e-03 + + 3.0258288979530334e-01 5.2325028181076050e-01 + 2.0176209509372711e-01 + <_> + + 1 0 940 3.6731390282511711e-03 -1 -2 941 + 2.1937100682407618e-03 + + 6.4284259080886841e-01 4.3288651108741760e-01 + 6.4205098152160645e-01 + <_> + + 1 0 942 -6.4666871912777424e-03 -1 -2 943 + -5.7186251506209373e-03 + + 5.2540659904479980e-01 2.4909840524196625e-01 + 5.2876192331314087e-01 + <_> + + 1 0 944 9.9941878579556942e-04 -1 -2 945 + -7.8276498243212700e-04 + + 3.3297958970069885e-01 3.5983449220657349e-01 + 5.4983407258987427e-01 + <_> + + 0 1 946 4.3231188319623470e-03 -1 -2 947 + 4.0838290005922318e-03 + + 4.8187050223350525e-01 5.2663302421569824e-01 + 3.1057891249656677e-01 + <_> + + 1 0 948 3.0515898833982646e-04 -1 -2 949 + 1.2640280183404684e-03 + + 3.9952918887138367e-01 3.2284379005432129e-01 + 5.8192151784896851e-01 + <_> + + 0 1 950 -1.0152660310268402e-02 -1 -2 951 + -2.6863690000027418e-03 + + 8.0260711908340454e-01 3.8756170868873596e-01 + 5.4665708541870117e-01 + <_> + + 1 0 952 -9.0515613555908203e-03 -1 -2 953 + -6.3204211182892323e-03 + + 4.3720579147338867e-01 1.1265510320663452e-01 + 6.3954162597656250e-01 + <_> + + 0 1 954 2.6117300149053335e-03 -1 -2 955 + 1.4339019544422626e-02 + + 5.4239892959594727e-01 4.9792730808258057e-01 + 6.0422360897064209e-01 + <_> + + 1 0 956 2.8452780097723007e-03 -1 -2 957 + 1.4783289771003183e-05 + + 3.4910920262336731e-01 4.1950678825378418e-01 + 5.7759660482406616e-01 + <_> + + 0 1 958 8.1814555451273918e-03 -1 -2 959 + 6.6321990452706814e-03 + + 4.8859870433807373e-01 5.4444682598114014e-01 + 4.4209951162338257e-01 + <_> + + 0 1 960 -2.2483461070805788e-03 -1 -2 961 + 1.2374560348689556e-02 + + 6.6997921466827393e-01 4.4786059856414795e-01 + 6.5648937225341797e-01 + <_> + + 1 0 962 -6.6516688093543053e-03 -1 -2 963 + -8.5750613361597061e-03 + + 5.5118787288665771e-01 4.0174451470375061e-01 + 5.4055362939834595e-01 + <_> + + 1 0 964 6.5078441984951496e-03 -1 -2 965 + 2.8675209730863571e-02 + + 2.2943930327892303e-01 5.1779001951217651e-01 + 3.5677561163902283e-01 + <_> + + 0 1 966 7.0673860609531403e-03 -1 -2 967 + 1.2367829913273454e-03 + + 5.5646997690200806e-01 3.6276981234550476e-01 + 5.5724138021469116e-01 + <_> + + 1 0 968 7.4818679131567478e-03 -1 -2 969 + 4.7109839506447315e-03 + + 6.7849111557006836e-01 4.1212528944015503e-01 + 6.0722357034683228e-01 + <_> + + 1 0 970 -6.9405790418386459e-03 -1 -2 971 + 3.3302098512649536e-02 + + 5.4597669839859009e-01 5.2767068147659302e-01 + 2.3749159276485443e-01 + <_> + + 1 0 972 3.6104630678892136e-02 -1 -2 973 + 1.9674649462103844e-02 + + 7.2492793202400208e-02 4.6263459324836731e-01 + 8.2089632749557495e-01 + <_> + + 0 1 974 3.4766150638461113e-03 -1 -2 975 + 1.3987369602546096e-03 + + 5.2087318897247314e-01 5.4844141006469727e-01 + 4.2300349473953247e-01 + <_> + + 1 0 976 4.0974249131977558e-03 -1 -2 977 + 2.6973790954798460e-03 + + 2.7805531024932861e-01 5.4038310050964355e-01 + 3.7909889221191406e-01 + <_> + + 1 0 978 -5.6591699831187725e-03 -1 -2 979 + 3.9460969856008887e-04 + + 4.7983360290527344e-01 3.7669500708580017e-01 + 5.4292291402816772e-01 + <_> + + 1 0 980 2.1750570740550756e-03 -1 -2 981 + 1.4614439569413662e-03 + + 6.2071627378463745e-01 3.3579450845718384e-01 + 5.1426321268081665e-01 + <_> + + 1 0 982 -5.3006567759439349e-04 -1 -2 983 + 1.4869309961795807e-01 + + 5.3446400165557861e-01 5.1596081256866455e-01 + 2.5618231296539307e-01 + <_> + + 1 0 984 -5.8816498494707048e-05 -1 -2 985 + -1.6275369562208652e-03 + + 5.1230919361114502e-01 6.0176461935043335e-01 + 3.1093719601631165e-01 + <_> + + 0 1 986 -1.2881809845566750e-02 -1 -2 987 + 9.4982917653396726e-04 + + 2.7122870087623596e-01 5.4424422979354858e-01 + 4.0288880467414856e-01 + <_> + + 1 0 988 -1.2315999716520309e-02 -1 -2 989 + 9.0286601334810257e-03 + + 4.7360658645629883e-01 7.4514347314834595e-01 + 3.4879919886589050e-01 + <_> + + 0 1 990 -8.6876116693019867e-02 -1 -2 991 + -1.5107560102478601e-05 + + 2.2903330624103546e-01 5.5178898572921753e-01 + 4.3931490182876587e-01 + <_> + + 0 1 992 -1.7457660287618637e-02 -1 -2 993 + -2.5219470262527466e-03 + + 9.0167902410030365e-02 6.2335401773452759e-01 + 4.7894591093063354e-01 + <_> + + 0 1 994 1.0656520025804639e-03 -1 -2 995 + -4.2540300637483597e-03 + + 5.4896962642669678e-01 5.5798089504241943e-01 + 4.3758779764175415e-01 + <_> + + 0 1 996 -9.0349102392792702e-03 -1 -2 997 + -1.5230999561026692e-03 + + 3.5791561007499695e-01 5.6136602163314819e-01 + 3.9390438795089722e-01 + <_> + + 1 0 998 2.8441150207072496e-03 -1 -2 999 + -3.2824429217725992e-03 + + 3.9015549421310425e-01 4.5286190509796143e-01 + 5.4413431882858276e-01 + <_> + + 1 0 1000 3.2161718991119415e-05 -1 -2 1001 + 3.0118400900391862e-05 + + 5.8031117916107178e-01 3.3368501067161560e-01 + 5.5048561096191406e-01 + <_> + + 0 1 1002 -5.6150099262595177e-03 -1 -2 1003 + -1.7389209941029549e-02 + + 6.1247891187667847e-01 8.7271630764007568e-02 + 5.2045881748199463e-01 + <_> + + 0 1 1004 -4.4361080654198304e-05 -1 -2 1005 + 1.0354899859521538e-04 + + 3.9353290200233459e-01 5.9188538789749146e-01 + 4.1196140646934509e-01 + <_> + + 0 1 1006 1.5939630102366209e-03 -1 -2 1007 + 2.5440789759159088e-03 + + 4.8396238684654236e-01 4.7873649001121521e-01 + 6.3606631755828857e-01 + <_> + + 0 1 1008 1.5083180187502876e-05 -1 -2 1009 + -9.9282202427275479e-05 + + 4.2311170697212219e-01 4.2745891213417053e-01 + 6.0940480232238770e-01 + <_> + + 1 0 1010 5.5371708003804088e-04 -1 -2 1011 + 1.9186759600415826e-03 + + 4.2719879746437073e-01 4.4971078634262085e-01 + 5.5491220951080322e-01 + <_> + + 1 0 1012 -5.0764222396537662e-04 -1 -2 1013 + 1.7236480489373207e-03 + + 5.4771959781646729e-01 2.8829228878021240e-01 + 5.6151270866394043e-01 + <_> + 75 + 3.6726501464843750e+01 + + <_> + + 0 1 1014 1.3092169538140297e-02 -1 -2 1015 + 4.1446479735895991e-04 + + 3.3388701081275940e-01 3.0993521213531494e-01 + 6.6774922609329224e-01 + <_> + + 0 1 1016 2.1835729479789734e-02 -1 -2 1017 + 4.8323940485715866e-02 + + 4.3690490722656250e-01 4.3017241358757019e-01 + 6.1538851261138916e-01 + <_> + + 0 1 1018 1.6091950237751007e-03 -1 -2 1019 + 1.3469760306179523e-03 + + 3.3873260021209717e-01 6.2487137317657471e-01 + 3.5941308736801147e-01 + <_> + + 0 1 1020 1.7729059618432075e-04 -1 -2 1021 + 3.6743620876222849e-04 + + 3.8684248924255371e-01 4.4093450903892517e-01 + 5.4764741659164429e-01 + <_> + + 0 1 1022 -1.2352119665592909e-03 -1 -2 1023 + 1.1705530341714621e-03 + + 3.2601711153984070e-01 4.1113489866256714e-01 + 6.0881638526916504e-01 + <_> + + 1 0 1024 -2.9695429475395940e-05 -1 -2 1025 + 2.7050738572143018e-04 + + 4.2694228887557983e-01 4.3064668774604797e-01 + 5.8105140924453735e-01 + <_> + + 1 0 1026 -7.9626210208516568e-05 -1 -2 1027 + 3.3152441028505564e-04 + + 3.6691430211067200e-01 4.6106639504432678e-01 + 6.2905901670455933e-01 + <_> + + 1 0 1028 -5.2305828779935837e-02 -1 -2 1029 + 2.6880469173192978e-02 + + 5.3286898136138916e-01 5.2132612466812134e-01 + 3.2312199473381042e-01 + <_> + + 1 0 1030 -2.4203000066336244e-04 -1 -2 1031 + -1.6424639616161585e-03 + + 3.5685700178146362e-01 3.4406611323356628e-01 + 5.6256049871444702e-01 + <_> + + 1 0 1032 -2.6830288697965443e-04 -1 -2 1033 + -2.2649629972875118e-03 + + 4.5611730217933655e-01 5.3213518857955933e-01 + 3.6741548776626587e-01 + <_> + + 1 0 1034 1.5627209097146988e-02 -1 -2 1035 + 1.6211320459842682e-01 + + 2.0293539762496948e-01 5.5630332231521606e-01 + 2.6188498735427856e-01 + <_> + + 0 1 1036 -3.7391691002994776e-03 -1 -2 1037 + -2.0878419745713472e-03 + + 6.0621947050094604e-01 5.9507638216018677e-01 + 4.5451170206069946e-01 + <_> + + 1 0 1038 2.3334210272878408e-03 -1 -2 1039 + 6.5116386394947767e-05 + + 6.4355242252349854e-01 3.5207340121269226e-01 + 5.1797789335250854e-01 + <_> + + 0 1 1040 7.4625718407332897e-03 -1 -2 1041 + -2.2032689303159714e-02 + + 5.3266882896423340e-01 3.4919810295104980e-01 + 5.4292368888854980e-01 + <_> + + 0 1 1042 -8.3081610500812531e-03 -1 -2 1043 + -4.3259368976578116e-04 + + 2.0840230584144592e-01 3.9652720093727112e-01 + 5.4254537820816040e-01 + <_> + + 1 0 1044 -3.2209228724241257e-02 -1 -2 1045 + -9.0424838708713651e-04 + + 5.3064119815826416e-01 5.4503858089447021e-01 + 4.2566969990730286e-01 + <_> + + 1 0 1046 2.2727500181645155e-03 -1 -2 1047 + 5.9820008464157581e-03 + + 5.9686112403869629e-01 4.7581401467323303e-01 + 3.1509441137313843e-01 + <_> + + 1 0 1048 -5.8856618124991655e-04 -1 -2 1049 + -8.8227191008627415e-04 + + 4.8477488756179810e-01 5.4263162612915039e-01 + 4.3383410573005676e-01 + <_> + + 1 0 1050 -7.4473457061685622e-05 -1 -2 1051 + 3.9148979703895748e-04 + + 4.2875099182128906e-01 6.3451850414276123e-01 + 4.1018518805503845e-01 + <_> + + 1 0 1052 -3.6939629353582859e-03 -1 -2 1053 + -1.1207849718630314e-02 + + 4.8491048812866211e-01 4.1463369131088257e-01 + 5.4712641239166260e-01 + <_> + + 0 1 1054 -1.0337409563362598e-02 -1 -2 1055 + 3.6883640568703413e-03 + + 2.8771838545799255e-01 5.1019018888473511e-01 + 7.2169512510299683e-01 + <_> + + 1 0 1056 -3.8984280545264482e-03 -1 -2 1057 + -5.9986729174852371e-03 + + 5.2761822938919067e-01 6.6184598207473755e-01 + 4.8416310548782349e-01 + <_> + + 1 0 1058 4.5043681748211384e-03 -1 -2 1059 + 1.7799530178308487e-02 + + 1.8741579353809357e-01 4.6169349551200867e-01 + 7.0889657735824585e-01 + <_> + + 0 1 1060 -1.8462570384144783e-02 -1 -2 1061 + 1.4931300029275008e-05 + + 3.0019798874855042e-01 4.5618081092834473e-01 + 5.6107878684997559e-01 + <_> + + 0 1 1062 -8.6021229624748230e-02 -1 -2 1063 + -6.0818758356617764e-05 + + 2.3417009413242340e-01 5.6722861528396606e-01 + 4.1999641060829163e-01 + <_> + + 1 0 1064 1.2670679716393352e-03 -1 -2 1065 + 1.3699879636988044e-03 + + 6.2074822187423706e-01 5.3949588537216187e-01 + 3.8238629698753357e-01 + <_> + + 1 0 1066 3.3162781037390232e-03 -1 -2 1067 + -1.4532039640471339e-03 + + 7.0616811513900757e-01 3.0655130743980408e-01 + 4.8273730278015137e-01 + <_> + + 1 0 1068 -7.1492061018943787e-02 -1 -2 1069 + 1.9857978913933039e-03 + + 5.1931220293045044e-01 4.6424350142478943e-01 + 5.8076947927474976e-01 + <_> + + 1 0 1070 6.2516499310731888e-03 -1 -2 1071 + 2.7005500160157681e-03 + + 2.9498139023780823e-01 4.5858868956565857e-01 + 6.0223537683486938e-01 + <_> + + 0 1 1072 1.1130389757454395e-02 -1 -2 1073 + 1.5092849731445312e-02 + + 4.3578410148620605e-01 4.5615398883819580e-01 + 6.1190617084503174e-01 + <_> + + 0 1 1074 -2.7943300083279610e-02 -1 -2 1075 + 4.4036991312168539e-05 + + 6.5371441841125488e-01 3.4747231006622314e-01 + 5.3369677066802979e-01 + <_> + + 0 1 1076 -1.2232770211994648e-02 -1 -2 1077 + -6.8591412855312228e-04 + + 3.7316760420799255e-01 5.7172292470932007e-01 + 4.7933790087699890e-01 + <_> + + 0 1 1078 -3.8992990739643574e-03 -1 -2 1079 + 4.9113907152786851e-04 + + 4.0564361214637756e-01 6.1740481853485107e-01 + 4.4717541337013245e-01 + <_> + + 1 0 1080 8.2117747515439987e-03 -1 -2 1081 + -4.5564480125904083e-02 + + 6.1796981096267700e-01 2.2854949533939362e-01 + 5.2495658397674561e-01 + <_> + + 0 1 1082 -5.3631910122931004e-03 -1 -2 1083 + -1.2274970300495625e-02 + + 1.7849500477313995e-01 7.2619527578353882e-01 + 4.5503988862037659e-01 + <_> + + 0 1 1084 5.4185991175472736e-03 -1 -2 1085 + 8.1846961984410882e-04 + + 5.2529907226562500e-01 5.4452222585678101e-01 + 3.2722181081771851e-01 + <_> + + 1 0 1086 4.1358140297234058e-03 -1 -2 1087 + 3.9578010910190642e-04 + + 7.0138317346572876e-01 4.9659439921379089e-01 + 3.2955980300903320e-01 + <_> + + 0 1 1088 4.6887691132724285e-03 -1 -2 1089 + -1.8255440518260002e-02 + + 5.3626418113708496e-01 6.4961087703704834e-01 + 4.7571370005607605e-01 + <_> + + 0 1 1090 -6.2736468389630318e-03 -1 -2 1091 + 2.4320168886333704e-03 + + 2.3437410593032837e-01 4.6201181411743164e-01 + 6.8984192609786987e-01 + <_> + + 0 1 1092 -4.9617629498243332e-02 -1 -2 1093 + 1.1701210169121623e-03 + + 2.1007199585437775e-01 4.6215289831161499e-01 + 5.7971358299255371e-01 + <_> + + 0 1 1094 -4.5237291604280472e-02 -1 -2 1095 + 4.7563421539962292e-03 + + 2.1182620525360107e-01 4.8846149444580078e-01 + 6.8724989891052246e-01 + <_> + + 1 0 1096 -1.4835969544947147e-02 -1 -2 1097 + 7.7436608262360096e-04 + + 5.2751058340072632e-01 4.1723209619522095e-01 + 5.4911398887634277e-01 + <_> + + 1 0 1098 1.4835969544947147e-02 -1 -2 1099 + -8.0892542609944940e-04 + + 2.1248769760131836e-01 5.4952150583267212e-01 + 4.2077958583831787e-01 + <_> + + 0 1 1100 7.7517668250948191e-04 -1 -2 1101 + -6.7618978209793568e-03 + + 3.3219420909881592e-01 2.2129580378532410e-01 + 5.2326530218124390e-01 + <_> + + 0 1 1102 -4.0135860443115234e-02 -1 -2 1103 + -3.3651469275355339e-03 + + 1.1017960309982300e-01 3.8101008534431458e-01 + 5.6172919273376465e-01 + <_> + + 1 0 1104 7.4713007779791951e-04 -1 -2 1105 + -4.2727389372885227e-03 + + 5.7950568199157715e-01 6.3922691345214844e-01 + 4.7114381194114685e-01 + <_> + + 1 0 1106 3.6202510818839073e-03 -1 -2 1107 + 4.7307618660852313e-04 + + 3.4098839759826660e-01 3.6593028903007507e-01 + 5.3881710767745972e-01 + <_> + + 1 0 1108 3.3094909042119980e-02 -1 -2 1109 + -1.1544119566679001e-02 + + 7.1703857183456421e-01 6.3868182897567749e-01 + 4.6813040971755981e-01 + <_> + + 0 1 1110 -7.4234469793736935e-03 -1 -2 1111 + -4.2252950370311737e-03 + + 3.2637009024620056e-01 5.7678192853927612e-01 + 4.3464180827140808e-01 + <_> + + 0 1 1112 1.8133109435439110e-02 -1 -2 1113 + 7.0903049781918526e-03 + + 4.6978279948234558e-01 4.4373890757560730e-01 + 6.0616689920425415e-01 + <_> + + 0 1 1114 -1.3272940181195736e-02 -1 -2 1115 + 1.4632199599873275e-04 + + 6.5585112571716309e-01 3.3763539791107178e-01 + 5.0916552543640137e-01 + <_> + + 0 1 1116 -3.5790191031992435e-03 -1 -2 1117 + -4.6997101162560284e-04 + + 2.9478839039802551e-01 5.5569821596145630e-01 + 4.6654561161994934e-01 + <_> + + 0 1 1118 -4.8179440200328827e-02 -1 -2 1119 + -9.2581362696364522e-04 + + 7.3383557796478271e-01 3.5438719391822815e-01 + 5.2851498126983643e-01 + <_> + + 0 1 1120 -1.4780730009078979e-02 -1 -2 1121 + -1.0027450323104858e-01 + + 1.9444419443607330e-01 9.9049292504787445e-02 + 5.1398539543151855e-01 + <_> + + 0 1 1122 -9.3848101096227765e-04 -1 -2 1123 + -2.8861360624432564e-03 + + 5.8271098136901855e-01 3.4414279460906982e-01 + 5.1488387584686279e-01 + <_> + + 1 0 1124 -4.3682761490345001e-02 -1 -2 1125 + 2.6115700602531433e-03 + + 5.2079981565475464e-01 4.8355031013488770e-01 + 6.3222199678421021e-01 + <_> + + 1 0 1126 4.3682761490345001e-02 -1 -2 1127 + 1.7179530113935471e-03 + + 1.3645380735397339e-01 4.5373201370239258e-01 + 6.0667508840560913e-01 + <_> + + 1 0 1128 -3.3964909613132477e-02 -1 -2 1129 + -1.0993590112775564e-03 + + 4.9683749675750732e-01 5.8316808938980103e-01 + 4.6882399916648865e-01 + <_> + + 1 0 1130 5.4301079362630844e-02 -1 -2 1131 + 1.0993590112775564e-03 + + 7.5682890415191650e-01 4.3301481008529663e-01 + 5.7684689760208130e-01 + <_> + + 1 0 1132 -1.4954120160837192e-05 -1 -2 1133 + 3.1415868550539017e-02 + + 4.4432818889617920e-01 5.2744728326797485e-01 + 3.0378559231758118e-01 + <_> + + 1 0 1134 1.0831849649548531e-02 -1 -2 1135 + 8.6545711383223534e-04 + + 3.5817208886146545e-01 5.9375840425491333e-01 + 4.2946299910545349e-01 + <_> + + 1 0 1136 2.2743160370737314e-03 -1 -2 1137 + 3.9340821094810963e-03 + + 5.9545767307281494e-01 4.7922229766845703e-01 + 5.8561331033706665e-01 + <_> + + 1 0 1138 8.1451907753944397e-03 -1 -2 1139 + -5.2763288840651512e-03 + + 3.5734778642654419e-01 4.0260228514671326e-01 + 5.7647430896759033e-01 + <_> + + 1 0 1140 -8.3787851035594940e-03 -1 -2 1141 + 1.5621910570189357e-03 + + 4.9813330173492432e-01 4.7365880012512207e-01 + 5.5836081504821777e-01 + <_> + + 1 0 1142 3.2318739686161280e-03 -1 -2 1143 + 6.6804019734263420e-03 + + 6.1674368381500244e-01 4.1314241290092468e-01 + 6.2806951999664307e-01 + <_> + + 0 1 1144 -3.3396480139344931e-03 -1 -2 1145 + -2.0933480560779572e-01 + + 3.4463581442832947e-01 1.0386580228805542e-01 + 5.2044892311096191e-01 + <_> + + 1 0 1146 6.3805822283029556e-03 -1 -2 1147 + -6.0137799009680748e-03 + + 2.1674020588397980e-01 6.7383992671966553e-01 + 4.8966509103775024e-01 + <_> + + 1 0 1148 -8.1756077706813812e-03 -1 -2 1149 + 6.3951779156923294e-04 + + 5.1779150962829590e-01 4.8196458816528320e-01 + 5.4644381999969482e-01 + <_> + + 1 0 1150 1.0127760469913483e-03 -1 -2 1151 + 4.9784599104896188e-04 + + 3.4235960245132446e-01 4.4884610176086426e-01 + 5.9126710891723633e-01 + <_> + + 1 0 1152 1.3596490316558629e-04 -1 -2 1153 + 1.3571660034358501e-02 + + 5.5688631534576416e-01 5.1610678434371948e-01 + 1.7130009829998016e-01 + <_> + + 1 0 1154 3.0259079721872695e-05 -1 -2 1155 + -3.2625840976834297e-03 + + 4.9162039160728455e-01 6.4046627283096313e-01 + 2.8590849041938782e-01 + <_> + + 1 0 1156 -1.9217010412830859e-04 -1 -2 1157 + 2.1993879228830338e-02 + + 5.4592829942703247e-01 4.7157138586044312e-01 + 5.6900751590728760e-01 + <_> + + 1 0 1158 7.8907777788117528e-04 -1 -2 1159 + 5.0893891602754593e-04 + + 3.2798269391059875e-01 4.3020078539848328e-01 + 5.6960451602935791e-01 + <_> + + 1 0 1160 1.1662710312521085e-04 -1 -2 1161 + 8.0604078248143196e-03 + + 5.3872352838516235e-01 5.0214231014251709e-01 + 5.9653222560882568e-01 + <_> + + 1 0 1162 9.5925969071686268e-04 -1 -2 1163 + -1.9526129588484764e-02 + + 3.4734940528869629e-01 6.4755451679229736e-01 + 4.6437820792198181e-01 + <_> + 78 + 3.8236038208007812e+01 + + <_> + + 0 1 1164 4.1242439299821854e-02 -1 -2 1165 + 1.5626709908246994e-02 + + 3.3933150768280029e-01 5.1041001081466675e-01 + 7.7728152275085449e-01 + <_> + + 0 1 1166 2.9947189614176750e-04 -1 -2 1167 + -1.0037609608843923e-03 + + 3.6646738648414612e-01 5.4056507349014282e-01 + 3.9262050390243530e-01 + <_> + + 0 1 1168 6.8128242855891585e-04 -1 -2 1169 + 1.3098999625071883e-04 + + 4.2515191435813904e-01 4.1351449489593506e-01 + 6.9257462024688721e-01 + <_> + + 1 0 1170 3.1696720980107784e-03 -1 -2 1171 + -2.0587369799613953e-03 + + 3.4558731317520142e-01 2.2341939806938171e-01 + 5.2861189842224121e-01 + <_> + + 1 0 1172 -4.6395038953050971e-04 -1 -2 1173 + 3.5089480224996805e-03 + + 4.2065200209617615e-01 6.5029817819595337e-01 + 4.1175979375839233e-01 + <_> + + 1 0 1174 -2.3975980002433062e-03 -1 -2 1175 + 1.0901279747486115e-03 + + 3.6733010411262512e-01 2.9062381386756897e-01 + 5.4451119899749756e-01 + <_> + + 0 1 1176 -1.6524370585102588e-04 -1 -2 1177 + -4.1602319106459618e-04 + + 4.2335158586502075e-01 3.8863611221313477e-01 + 6.2691658735275269e-01 + <_> + + 0 1 1178 -2.3739910102449358e-04 -1 -2 1179 + 2.4739760905504227e-02 + + 5.5244511365890503e-01 4.9600958824157715e-01 + 5.3734910488128662e-01 + <_> + + 0 1 1180 -1.5342839993536472e-02 -1 -2 1181 + 1.1540469713509083e-02 + + 6.8494051694869995e-01 4.0372350811958313e-01 + 6.7869400978088379e-01 + <_> + + 1 0 1182 6.4230621792376041e-03 -1 -2 1183 + 1.2977809645235538e-02 + + 3.8146761059761047e-01 5.5270588397979736e-01 + 3.7449559569358826e-01 + <_> + + 0 1 1184 1.1063399724662304e-03 -1 -2 1185 + 1.3743690215051174e-03 + + 3.5209289193153381e-01 5.6419032812118530e-01 + 3.0750259757041931e-01 + <_> + + 0 1 1186 1.6233779489994049e-02 -1 -2 1187 + -8.1519351806491613e-04 + + 4.8888280987739563e-01 5.4563212394714355e-01 + 4.7435501217842102e-01 + <_> + + 0 1 1188 -9.0782493352890015e-02 -1 -2 1189 + 1.1665210127830505e-02 + + 2.9252481460571289e-01 4.6884548664093018e-01 + 6.2303477525711060e-01 + <_> + + 0 1 1190 -2.3286409676074982e-02 -1 -2 1191 + 2.1559339947998524e-03 + + 6.8958431482315063e-01 5.3558021783828735e-01 + 3.4234660863876343e-01 + <_> + + 0 1 1192 -4.3167220428586006e-03 -1 -2 1193 + 1.5610599657520652e-03 + + 5.9370762109756470e-01 4.7086599469184875e-01 + 2.7369970083236694e-01 + <_> + + 0 1 1194 1.4076639898121357e-02 -1 -2 1195 + 7.1018589660525322e-03 + + 5.2871561050415039e-01 5.3361928462982178e-01 + 3.2248139381408691e-01 + <_> + + 0 1 1196 -4.8221647739410400e-03 -1 -2 1197 + -5.3852899000048637e-03 + + 2.9839101433753967e-01 5.6239992380142212e-01 + 4.2959120869636536e-01 + <_> + + 1 0 1198 7.3483278974890709e-03 -1 -2 1199 + -3.5707519855350256e-03 + + 6.8139612674713135e-01 5.8579689264297485e-01 + 4.6034291386604309e-01 + <_> + + 1 0 1200 2.3340100888162851e-03 -1 -2 1201 + 4.7432780265808105e-03 + + 2.7448511123657227e-01 5.0475269556045532e-01 + 2.3627419769763947e-01 + <_> + + 0 1 1202 6.5055489540100098e-03 -1 -2 1203 + 1.2589249759912491e-02 + + 5.2422481775283813e-01 4.8236909508705139e-01 + 6.7525368928909302e-01 + <_> + + 0 1 1204 -6.3358368352055550e-03 -1 -2 1205 + -5.7639651931822300e-03 + + 1.7346349358558655e-01 6.3543808460235596e-01 + 4.5874750614166260e-01 + <_> + + 0 1 1206 1.3599749654531479e-03 -1 -2 1207 + 2.8404260054230690e-02 + + 4.5803809165954590e-01 5.1763808727264404e-01 + 1.2043850123882294e-01 + <_> + + 0 1 1208 -9.2958156019449234e-03 -1 -2 1209 + -1.1800320353358984e-03 + + 2.3379570245742798e-01 3.9028140902519226e-01 + 5.6529301404953003e-01 + <_> + + 0 1 1210 -2.0948140881955624e-03 -1 -2 1211 + 4.1679958812892437e-03 + + 5.5120289325714111e-01 5.4559761285781860e-01 + 4.7989490628242493e-01 + <_> + + 1 0 1212 5.4458891972899437e-03 -1 -2 1213 + -1.2766510481014848e-03 + + 6.1270868778228760e-01 5.3171318769454956e-01 + 3.8509321212768555e-01 + <_> + + 0 1 1214 5.9404270723462105e-04 -1 -2 1215 + 4.2309608310461044e-02 + + 5.4464370012283325e-01 5.2346438169479370e-01 + 2.2130440175533295e-01 + <_> + + 0 1 1216 5.6189671158790588e-03 -1 -2 1217 + 7.2401198558509350e-03 + + 4.9161979556083679e-01 1.4714759588241577e-01 + 4.8528939485549927e-01 + <_> + + 0 1 1218 -4.5610670931637287e-03 -1 -2 1219 + 4.5506159949582070e-05 + + 2.7737739682197571e-01 4.6264618635177612e-01 + 5.7680791616439819e-01 + <_> + + 0 1 1220 -6.1903791502118111e-03 -1 -2 1221 + 8.1186462193727493e-04 + + 1.6442899405956268e-01 4.7785910964012146e-01 + 6.2618649005889893e-01 + <_> + + 0 1 1222 1.3779809698462486e-02 -1 -2 1223 + 1.1290319962427020e-03 + + 5.2573078870773315e-01 5.4980480670928955e-01 + 3.9831069111824036e-01 + <_> + + 0 1 1224 -1.0610350000206381e-04 -1 -2 1225 + 1.6695790691301227e-04 + + 4.0335190296173096e-01 4.1493400931358337e-01 + 5.7953411340713501e-01 + <_> + + 1 0 1226 1.1290319962427020e-03 -1 -2 1227 + -1.2019349634647369e-01 + + 3.9341148734092712e-01 7.3400482535362244e-02 + 5.2025860548019409e-01 + <_> + + 0 1 1228 -1.5230740420520306e-02 -1 -2 1229 + 3.5759829916059971e-03 + + 3.7495058774948120e-01 5.0781500339508057e-01 + 6.6060662269592285e-01 + <_> + + 0 1 1230 1.3479460030794144e-02 -1 -2 1231 + -2.1162950433790684e-03 + + 4.5477110147476196e-01 3.3110061287879944e-01 + 5.3842592239379883e-01 + <_> + + 0 1 1232 -1.7877709120512009e-02 -1 -2 1233 + 1.0931970318779349e-03 + + 6.5132528543472290e-01 5.2647650241851807e-01 + 3.4569910168647766e-01 + <_> + + 0 1 1234 -3.0553159303963184e-03 -1 -2 1235 + 3.6365049891173840e-03 + + 6.2686139345169067e-01 5.3992128372192383e-01 + 4.3453970551490784e-01 + <_> + + 0 1 1236 9.7896481747739017e-05 -1 -2 1237 + -3.2714448752813041e-04 + + 3.8356059789657593e-01 3.3376678824424744e-01 + 5.5391657352447510e-01 + <_> + + 1 0 1238 4.3425030889920890e-04 -1 -2 1239 + 1.4005579985678196e-02 + + 5.7882702350616455e-01 5.2750778198242188e-01 + 2.7011251449584961e-01 + <_> + + 0 1 1240 -9.2654931358993053e-04 -1 -2 1241 + 3.9504268206655979e-03 + + 5.8522802591323853e-01 4.7283369302749634e-01 + 3.3139181137084961e-01 + <_> + + 1 0 1242 -5.8086868375539780e-04 -1 -2 1243 + -1.2018020264804363e-02 + + 4.2588108777999878e-01 5.6097871065139771e-01 + 4.8951920866966248e-01 + <_> + + 0 1 1244 -1.4521540701389313e-01 -1 -2 1245 + -6.6049019806087017e-03 + + 4.3894480913877487e-02 4.2291709780693054e-01 + 5.6162929534912109e-01 + <_> + + 1 0 1246 -3.4909751266241074e-02 -1 -2 1247 + 3.7478420417755842e-03 + + 4.7881281375885010e-01 4.8002821207046509e-01 + 5.8013892173767090e-01 + <_> + + 1 0 1248 3.3038031309843063e-02 -1 -2 1249 + 3.6872599739581347e-03 + + 7.0781761407852173e-01 4.4496241211891174e-01 + 5.9577310085296631e-01 + <_> + + 0 1 1250 -4.5311939902603626e-03 -1 -2 1251 + 4.1058510541915894e-03 + + 4.1770470142364502e-01 5.3729480504989624e-01 + 3.7369269132614136e-01 + <_> + + 0 1 1252 -8.7599847465753555e-03 -1 -2 1253 + -2.3003309965133667e-02 + + 6.6588079929351807e-01 2.6479220390319824e-01 + 5.1018178462982178e-01 + <_> + + 0 1 1254 5.3664818406105042e-03 -1 -2 1255 + 3.8971770554780960e-02 + + 4.5486348867416382e-01 5.1570618152618408e-01 + 3.4364390373229980e-01 + <_> + + 0 1 1256 -2.7767190709710121e-02 -1 -2 1257 + -9.8894089460372925e-03 + + 2.3543910682201385e-01 6.8877410888671875e-01 + 5.1110517978668213e-01 + <_> + + 0 1 1258 -3.2073140610009432e-03 -1 -2 1259 + -6.7484978353604674e-04 + + 5.4388678073883057e-01 5.4511487483978271e-01 + 4.8313531279563904e-01 + <_> + + 0 1 1260 -5.1947520114481449e-03 -1 -2 1261 + -2.6169899501837790e-04 + + 2.1134190261363983e-01 5.2736818790435791e-01 + 3.9925870299339294e-01 + <_> + + 0 1 1262 2.2421479225158691e-03 -1 -2 1263 + -1.2139769969508052e-03 + + 4.6882608532905579e-01 5.5042350292205811e-01 + 4.3848711252212524e-01 + <_> + + 0 1 1264 -2.9469770379364491e-03 -1 -2 1265 + -3.9291830034926534e-04 + + 3.8928470015525818e-01 6.0017228126525879e-01 + 4.5616629719734192e-01 + <_> + + 1 0 1266 6.2550729513168335e-01 -1 -2 1267 + 9.7744520753622055e-03 + + 6.8125613033771515e-02 4.8130258917808533e-01 + 5.6206572055816650e-01 + <_> + + 1 0 1268 9.4378247857093811e-02 -1 -2 1269 + -1.9560910295695066e-03 + + 6.6632293164730072e-02 3.5882329940795898e-01 + 5.2954071760177612e-01 + <_> + + 0 1 1270 9.0652769431471825e-03 -1 -2 1271 + 4.2138071148656309e-04 + + 4.8226881027221680e-01 4.6703329682350159e-01 + 5.6831127405166626e-01 + <_> + + 1 0 1272 -4.4220191193744540e-04 -1 -2 1273 + -4.7313501127064228e-03 + + 5.3607952594757080e-01 6.1372458934783936e-01 + 3.1880891323089600e-01 + <_> + + 0 1 1274 1.5395509544759989e-03 -1 -2 1275 + 2.4315000046044588e-03 + + 4.4877201318740845e-01 4.8941668868064880e-01 + 6.7166537046432495e-01 + <_> + + 0 1 1276 -1.5581619925796986e-02 -1 -2 1277 + 1.0816920548677444e-03 + + 3.3367419242858887e-01 4.7182199358940125e-01 + 5.9606271982192993e-01 + <_> + + 0 1 1278 -2.2197659127414227e-03 -1 -2 1279 + -9.3048671260476112e-04 + + 3.5885548591613770e-01 6.2187129259109497e-01 + 4.8173001408576965e-01 + <_> + + 0 1 1280 -4.7418707981705666e-03 -1 -2 1281 + -6.2950369901955128e-03 + + 2.5500270724296570e-01 6.7280787229537964e-01 + 5.0510638952255249e-01 + <_> + + 0 1 1282 3.5216049291193485e-03 -1 -2 1283 + -2.4289379362016916e-03 + + 5.4019099473953247e-01 5.4194617271423340e-01 + 4.3471428751945496e-01 + <_> + + 0 1 1284 -2.5261470582336187e-03 -1 -2 1285 + -1.4817339833825827e-03 + + 6.9706249237060547e-01 3.2634168863296509e-01 + 4.9178731441497803e-01 + <_> + + 0 1 1286 -2.2474530339241028e-01 -1 -2 1287 + 2.8342509176582098e-03 + + 7.2937291115522385e-03 4.5792299509048462e-01 + 5.3798812627792358e-01 + <_> + + 0 1 1288 -2.0821610465645790e-02 -1 -2 1289 + 1.4896340144332498e-04 + + 6.0240888595581055e-01 3.3361440896987915e-01 + 4.9628159403800964e-01 + <_> + + 0 1 1290 -3.3524499740451574e-03 -1 -2 1291 + -3.7279881536960602e-02 + + 3.5587510466575623e-01 1.6985629498958588e-01 + 5.2089858055114746e-01 + <_> + + 1 0 1292 1.3896770542487502e-04 -1 -2 1293 + -3.1912620761431754e-04 + + 5.5906862020492554e-01 5.8487337827682495e-01 + 3.7958368659019470e-01 + <_> + + 1 0 1294 5.4003461264073849e-04 -1 -2 1295 + 3.8956850767135620e-03 + + 5.6702882051467896e-01 5.1826947927474976e-01 + 3.3277091383934021e-01 + <_> + + 1 0 1296 1.6084529925137758e-03 -1 -2 1297 + -5.7474587811157107e-04 + + 5.4104858636856079e-01 6.0226422548294067e-01 + 3.6446440219879150e-01 + <_> + + 1 0 1298 1.3435039669275284e-02 -1 -2 1299 + 2.1368139423429966e-03 + + 3.4412819147109985e-01 5.2924340963363647e-01 + 2.7470758557319641e-01 + <_> + + 1 0 1300 1.4157629571855068e-02 -1 -2 1301 + 5.3884391672909260e-03 + + 8.0278682708740234e-01 5.2223151922225952e-01 + 3.5867279767990112e-01 + <_> + + 0 1 1302 8.8013410568237305e-03 -1 -2 1303 + 3.8858849438838661e-04 + + 4.9003869295120239e-01 4.6810561418533325e-01 + 5.7219529151916504e-01 + <_> + + 0 1 1304 -2.2143588867038488e-03 -1 -2 1305 + -8.4642972797155380e-03 + + 5.3888058662414551e-01 6.6755378246307373e-01 + 3.4484419226646423e-01 + <_> + + 1 0 1306 1.5044390223920345e-02 -1 -2 1307 + 7.6346402056515217e-03 + + 9.2396140098571777e-01 4.8848968744277954e-01 + 6.3060528039932251e-01 + <_> + + 1 0 1308 3.3895121305249631e-04 -1 -2 1309 + 2.1157610171940178e-04 + + 3.9974310994148254e-01 5.6639820337295532e-01 + 3.9729809761047363e-01 + <_> + + 1 0 1310 -2.7514949440956116e-02 -1 -2 1311 + 5.1603060215711594e-02 + + 5.2010637521743774e-01 5.1407301425933838e-01 + 1.2451309710741043e-01 + <_> + + 1 0 1312 3.7510651163756847e-03 -1 -2 1313 + -2.1457639522850513e-03 + + 3.8020950555801392e-01 3.3094480633735657e-01 + 5.4745388031005859e-01 + <_> + + 1 0 1314 -5.8178009930998087e-04 -1 -2 1315 + -9.3638541875407100e-04 + + 4.8926019668579102e-01 5.9373992681503296e-01 + 4.6646690368652344e-01 + <_> + + 1 0 1316 4.1667491197586060e-02 -1 -2 1317 + -6.7763780243694782e-03 + + 7.0213532447814941e-01 3.2227510213851929e-01 + 5.0683951377868652e-01 + <_> + + 1 0 1318 -2.9170580673962831e-03 -1 -2 1319 + 3.2789530814625323e-04 + + 4.7177010774612427e-01 4.5093831419944763e-01 + 5.6511628627777100e-01 + <_> + 91 + 4.4682968139648438e+01 + + <_> + + 0 1 1320 1.1729800142347813e-02 -1 -2 1321 + 1.1712179984897375e-03 + + 3.8052248954772949e-01 3.1400179862976074e-01 + 6.8581461906433105e-01 + <_> + + 1 0 1322 9.3555096536874771e-03 -1 -2 1323 + 1.6570610459893942e-03 + + 6.8346732854843140e-01 2.9924729466438293e-01 + 5.4756778478622437e-01 + <_> + + 1 0 1324 -1.3387809740379453e-03 -1 -2 1325 + 1.7580550047568977e-04 + + 2.9414069652557373e-01 3.8969779014587402e-01 + 5.8729708194732666e-01 + <_> + + 0 1 1326 -2.9473248869180679e-03 -1 -2 1327 + 8.3220899105072021e-03 + + 3.5765719413757324e-01 5.2324008941650391e-01 + 3.2310879230499268e-01 + <_> + + 1 0 1328 7.4366689659655094e-03 -1 -2 1329 + -2.1322889369912446e-04 + + 6.7156732082366943e-01 5.4705417156219482e-01 + 3.8633960485458374e-01 + <_> + + 0 1 1330 -7.8024631366133690e-03 -1 -2 1331 + 5.6611228501424193e-04 + + 2.7714601159095764e-01 4.6891361474990845e-01 + 5.8519637584686279e-01 + <_> + + 0 1 1332 -9.2346500605344772e-03 -1 -2 1333 + -1.4676499631605111e-05 + + 2.7043971419334412e-01 5.6225502490997314e-01 + 3.5793170332908630e-01 + <_> + + 0 1 1334 9.7007937729358673e-03 -1 -2 1335 + -3.5320650786161423e-03 + + 4.1738718748092651e-01 4.1950130462646484e-01 + 5.5494689941406250e-01 + <_> + + 1 0 1336 2.1616410464048386e-02 -1 -2 1337 + 3.4567608963698149e-03 + + 2.8573909401893616e-01 6.0245329141616821e-01 + 4.3775078654289246e-01 + <_> + + 0 1 1338 2.2914320230484009e-02 -1 -2 1339 + 3.4328910987824202e-03 + + 4.6893501281738281e-01 4.6646049618721008e-01 + 5.7625621557235718e-01 + <_> + + 0 1 1340 -8.6510833352804184e-03 -1 -2 1341 + 1.4510039472952485e-03 + + 6.3817399740219116e-01 3.7114879488945007e-01 + 5.5307507514953613e-01 + <_> + + 0 1 1342 7.8191719949245453e-03 -1 -2 1343 + 2.0798550394829363e-04 + + 5.2643620967864990e-01 3.7305128574371338e-01 + 5.4457312822341919e-01 + <_> + + 0 1 1344 -3.9962218143045902e-03 -1 -2 1345 + -1.5010139577498194e-05 + + 2.4381700158119202e-01 5.3246712684631348e-01 + 3.6829888820648193e-01 + <_> + + 0 1 1346 -4.2428788729012012e-03 -1 -2 1347 + 9.1374982148408890e-03 + + 6.4814740419387817e-01 4.8961588740348816e-01 + 6.5588432550430298e-01 + <_> + + 1 0 1348 8.8254585862159729e-03 -1 -2 1349 + 9.4092212384566665e-04 + + 3.6138701438903809e-01 5.5028957128524780e-01 + 3.6325180530548096e-01 + <_> + + 0 1 1350 -1.2503350153565407e-02 -1 -2 1351 + 8.6759645491838455e-03 + + 2.2611320018768311e-01 4.9878901243209839e-01 + 6.8471962213516235e-01 + <_> + + 0 1 1352 -1.0416760109364986e-02 -1 -2 1353 + 2.7432460337877274e-03 + + 2.4462990462779999e-01 3.5115250945091248e-01 + 5.3998267650604248e-01 + <_> + + 0 1 1354 -4.2385691776871681e-03 -1 -2 1355 + 1.8325870856642723e-02 + + 6.8236732482910156e-01 4.8915800452232361e-01 + 7.1356189250946045e-01 + <_> + + 0 1 1356 -2.4334540590643883e-02 -1 -2 1357 + 4.6469361404888332e-04 + + 3.5225218534469604e-01 4.0498688817024231e-01 + 5.5158257484436035e-01 + <_> + + 1 0 1358 3.4260009415447712e-03 -1 -2 1359 + -2.5827318895608187e-03 + + 4.1267699003219604e-01 2.8994289040565491e-01 + 5.3864318132400513e-01 + <_> + + 1 0 1360 1.0545699624344707e-03 -1 -2 1361 + -9.1257691383361816e-04 + + 3.7713441252708435e-01 5.8273869752883911e-01 + 4.2675569653511047e-01 + <_> + + 0 1 1362 2.6589010376483202e-03 -1 -2 1363 + 4.8598358407616615e-03 + + 4.6881249547004700e-01 4.8539221286773682e-01 + 6.1636447906494141e-01 + <_> + + 1 0 1364 8.0638676881790161e-03 -1 -2 1365 + -7.5898370705544949e-03 + + 1.7491950094699860e-01 6.8261897563934326e-01 + 4.8940700292587280e-01 + <_> + + 0 1 1366 3.6368070868775249e-04 -1 -2 1367 + 6.2594950199127197e-02 + + 4.6145960688591003e-01 5.1830172538757324e-01 + 2.6866960525512695e-01 + <_> + + 0 1 1368 -4.9753207713365555e-03 -1 -2 1369 + -2.0880119409412146e-03 + + 1.7584669589996338e-01 6.3693821430206299e-01 + 4.9300441145896912e-01 + <_> + + 1 0 1370 9.5644511748105288e-04 -1 -2 1371 + -3.1721461564302444e-02 + + 4.1393989324569702e-01 6.0455572605133057e-01 + 4.8163640499114990e-01 + <_> + + 0 1 1372 1.2898689601570368e-03 -1 -2 1373 + 9.8405163735151291e-03 + + 5.4508107900619507e-01 2.9240009188652039e-01 + 6.6996061801910400e-01 + <_> + + 1 0 1374 1.2237089686095715e-03 -1 -2 1375 + -8.4232585504651070e-03 + + 6.2828367948532104e-01 5.9865701198577881e-01 + 4.8525801301002502e-01 + <_> + + 0 1 1376 -7.2726322105154395e-04 -1 -2 1377 + 4.6842931769788265e-03 + + 3.3400490880012512e-01 5.1689237356185913e-01 + 2.6794800162315369e-01 + <_> + + 0 1 1378 -1.0379579616710544e-03 -1 -2 1379 + 9.1342730447649956e-03 + + 5.9257918596267700e-01 5.4377281665802002e-01 + 4.3468001484870911e-01 + <_> + + 0 1 1380 1.4971119817346334e-03 -1 -2 1381 + 1.5762320253998041e-03 + + 4.1295009851455688e-01 4.5228740572929382e-01 + 6.5562921762466431e-01 + <_> + + 0 1 1382 8.7496247142553329e-03 -1 -2 1383 + -8.5103599121794105e-04 + + 4.5320340991020203e-01 3.7859839200973511e-01 + 5.4169750213623047e-01 + <_> + + 0 1 1384 -1.7325570806860924e-02 -1 -2 1385 + -8.3266440778970718e-03 + + 6.8842482566833496e-01 3.0913260579109192e-01 + 5.2436548471450806e-01 + <_> + + 0 1 1386 1.5157909729168750e-05 -1 -2 1387 + 1.8041470320895314e-03 + + 4.7657939791679382e-01 4.7253859043121338e-01 + 5.7165551185607910e-01 + <_> + + 1 0 1388 3.0691560823470354e-03 -1 -2 1389 + -5.2225510444259271e-05 + + 2.1433599293231964e-01 5.6532102823257446e-01 + 4.3851110339164734e-01 + <_> + + 1 0 1390 1.0072169970953837e-04 -1 -2 1391 + 1.3573700562119484e-04 + + 5.9247761964797974e-01 4.5734488964080811e-01 + 5.7693827152252197e-01 + <_> + + 1 0 1392 9.2137878527864814e-04 -1 -2 1393 + 3.0316581251099706e-04 + + 5.9926092624664307e-01 3.6100810766220093e-01 + 5.0493258237838745e-01 + <_> + + 1 0 1394 3.9582479745149612e-02 -1 -2 1395 + 4.7519680112600327e-02 + + 1.5384890139102936e-01 5.2161407470703125e-01 + 1.4283910393714905e-01 + <_> + + 1 0 1396 1.8871759995818138e-02 -1 -2 1397 + -3.9876459049992263e-04 + + 2.8255069255828857e-01 4.0350168943405151e-01 + 5.4377931356430054e-01 + <_> + + 0 1 1398 4.6556600136682391e-04 -1 -2 1399 + 6.7090610973536968e-03 + + 4.6689969301223755e-01 5.3313547372817993e-01 + 4.1365718841552734e-01 + <_> + + 0 1 1400 -1.8931160448119044e-03 -1 -2 1401 + -1.3056949712336063e-02 + + 7.1551632881164551e-01 3.1178998947143555e-01 + 5.2084398269653320e-01 + <_> + + 1 0 1402 -1.9484119547996670e-04 -1 -2 1403 + 1.5093220099515747e-05 + + 4.6376588940620422e-01 4.5616531372070312e-01 + 5.4452341794967651e-01 + <_> + + 1 0 1404 -7.1617960202274844e-06 -1 -2 1405 + 3.0164679628796875e-04 + + 4.1931080818176270e-01 5.9662377834320068e-01 + 4.1005000472068787e-01 + <_> + + 0 1 1406 4.4195181690156460e-03 -1 -2 1407 + -7.3984181508421898e-03 + + 4.8450559377670288e-01 6.2068462371826172e-01 + 4.9312090873718262e-01 + <_> + + 1 0 1408 -7.8031201846897602e-03 -1 -2 1409 + -1.0731429792940617e-02 + + 5.2824628353118896e-01 9.1048341989517212e-01 + 3.4559220075607300e-01 + <_> + + 0 1 1410 1.4246780192479491e-03 -1 -2 1411 + -8.2717568147927523e-05 + + 4.7085541486740112e-01 5.6516230106353760e-01 + 4.7310239076614380e-01 + <_> + + 1 0 1412 4.4803409837186337e-03 -1 -2 1413 + 3.0789140146225691e-03 + + 6.1758869886398315e-01 5.1395332813262939e-01 + 3.4230878949165344e-01 + <_> + + 1 0 1414 -1.1310289846733212e-03 -1 -2 1415 + -1.0410690447315574e-03 + + 4.9182820320129395e-01 5.9420871734619141e-01 + 4.9230429530143738e-01 + <_> + + 1 0 1416 1.1648540385067463e-03 -1 -2 1417 + 9.0057362103834748e-04 + + 6.4052718877792358e-01 4.5043969154357910e-01 + 6.1920768022537231e-01 + <_> + + 0 1 1418 6.8781538866460323e-03 -1 -2 1419 + -3.5283900797367096e-02 + + 5.3748130798339844e-01 2.2471010684967041e-01 + 5.2171707153320312e-01 + <_> + + 0 1 1420 -1.3320200378075242e-03 -1 -2 1421 + -2.3177571129053831e-03 + + 2.5547030568122864e-01 3.7925159931182861e-01 + 5.2432268857955933e-01 + <_> + + 0 1 1422 2.1332940377760679e-04 -1 -2 1423 + 1.3467900454998016e-02 + + 3.8603371381759644e-01 5.3806877136230469e-01 + 4.1783639788627625e-01 + <_> + + 0 1 1424 -1.2829169863834977e-03 -1 -2 1425 + 5.1571638323366642e-04 + + 6.1336231231689453e-01 4.0285378694534302e-01 + 5.5368518829345703e-01 + <_> + + 0 1 1426 3.9254198782145977e-03 -1 -2 1427 + -3.3780589699745178e-02 + + 5.2799212932586670e-01 2.3346750438213348e-01 + 5.1759117841720581e-01 + <_> + + 0 1 1428 -3.7853721529245377e-02 -1 -2 1429 + -4.0752900531515479e-04 + + 1.0748530179262161e-01 5.3459298610687256e-01 + 4.1989380121231079e-01 + <_> + + 0 1 1430 -3.1193809118121862e-03 -1 -2 1431 + -1.5714969485998154e-02 + + 3.8558250665664673e-01 3.3351901173591614e-01 + 5.2632021903991699e-01 + <_> + + 0 1 1432 -7.8525702701881528e-04 -1 -2 1433 + -2.8750501223839819e-04 + + 5.8603972196578979e-01 5.4377847909927368e-01 + 3.7161049246788025e-01 + <_> + + 1 0 1434 2.8016859665513039e-02 -1 -2 1435 + -1.9018839811906219e-03 + + 3.3307549357414246e-01 5.3665977716445923e-01 + 4.6937939524650574e-01 + <_> + + 1 0 1436 2.0647559314966202e-02 -1 -2 1437 + 4.3002571910619736e-03 + + 1.0069560259580612e-01 4.8160359263420105e-01 + 6.2156772613525391e-01 + <_> + + 0 1 1438 1.3459140434861183e-02 -1 -2 1439 + -1.0320040397346020e-02 + + 5.4619538784027100e-01 4.5784530043601990e-01 + 5.4193097352981567e-01 + <_> + + 1 0 1440 3.1990748643875122e-01 -1 -2 1441 + 9.2198798665776849e-04 + + 2.0080469548702240e-01 5.1932811737060547e-01 + 3.9121940732002258e-01 + <_> + + 0 1 1442 4.1852539288811386e-04 -1 -2 1443 + 3.5891108564101160e-04 + + 4.2997440695762634e-01 4.3445029854774475e-01 + 5.5319738388061523e-01 + <_> + + 0 1 1444 -2.0992439985275269e-01 -1 -2 1445 + -4.9328152090311050e-03 + + 1.0757210105657578e-01 5.7627969980239868e-01 + 4.5746439695358276e-01 + <_> + + 1 0 1446 2.3409130517393351e-03 -1 -2 1447 + 4.7120270319283009e-03 + + 7.4768078327178955e-01 5.2617651224136353e-01 + 4.5055508613586426e-01 + <_> + + 0 1 1448 2.8713190928101540e-02 -1 -2 1449 + -2.6156550738960505e-03 + + 4.4071030616760254e-01 4.2442709207534790e-01 + 6.8929767608642578e-01 + <_> + + 0 1 1450 -1.3558969832956791e-02 -1 -2 1451 + -3.0331799644045532e-04 + + 1.2522679567337036e-01 4.0777918696403503e-01 + 5.4428178071975708e-01 + <_> + + 0 1 1452 -5.5601762142032385e-04 -1 -2 1453 + 2.4025330785661936e-03 + + 5.3780037164688110e-01 3.1665799021720886e-01 + 5.2857381105422974e-01 + <_> + + 1 0 1454 -3.4089901018887758e-03 -1 -2 1455 + 8.0019602319225669e-04 + + 4.9052149057388306e-01 4.5227360725402832e-01 + 5.5806142091751099e-01 + <_> + + 1 0 1456 2.1901070140302181e-03 -1 -2 1457 + 3.3745369873940945e-03 + + 6.6126817464828491e-01 5.1077651977539062e-01 + 3.3869299292564392e-01 + <_> + + 1 0 1458 8.0019602319225669e-04 -1 -2 1459 + 1.7346069216728210e-02 + + 5.7075601816177368e-01 5.0160211324691772e-01 + 6.3064599037170410e-01 + <_> + + 0 1 1460 -1.9568449351936579e-03 -1 -2 1461 + -1.1229019612073898e-02 + + 3.0178061127662659e-01 6.2938511371612549e-01 + 4.5204889774322510e-01 + <_> + + 0 1 1462 -2.6608388870954514e-03 -1 -2 1463 + -1.1615100316703320e-02 + + 3.3440071344375610e-01 2.8253790736198425e-01 + 5.1509708166122437e-01 + <_> + + 0 1 1464 -9.5248602330684662e-02 -1 -2 1465 + 7.3701781220734119e-03 + + 1.3982650637626648e-01 5.2939987182617188e-01 + 2.3317280411720276e-01 + <_> + + 1 0 1466 -1.4953900128602982e-02 -1 -2 1467 + 5.7038792874664068e-04 + + 4.9404659867286682e-01 5.4665708541870117e-01 + 4.6267679333686829e-01 + <_> + + 1 0 1468 5.8516198769211769e-03 -1 -2 1469 + 2.1150549582671374e-04 + + 6.2700408697128296e-01 5.5081409215927124e-01 + 4.0618729591369629e-01 + <_> + + 1 0 1470 -6.9679190346505493e-06 -1 -2 1471 + -7.9677387839183211e-04 + + 4.0965679287910461e-01 5.6155568361282349e-01 + 4.6668860316276550e-01 + <_> + + 1 0 1472 1.9459480419754982e-02 -1 -2 1473 + -1.1160830035805702e-02 + + 2.3114809393882751e-01 3.0870118737220764e-01 + 5.5146622657775879e-01 + <_> + + 1 0 1474 1.4056149870157242e-02 -1 -2 1475 + -3.2958350493572652e-04 + + 7.0050561428070068e-01 5.7974857091903687e-01 + 4.6916508674621582e-01 + <_> + + 0 1 1476 -5.4636420682072639e-03 -1 -2 1477 + 5.8881669247057289e-05 + + 5.9285950660705566e-01 3.7413978576660156e-01 + 5.1701688766479492e-01 + <_> + + 0 1 1478 6.6343429498374462e-03 -1 -2 1479 + 4.5263409614562988e-02 + + 5.4149878025054932e-01 5.1803272962570190e-01 + 1.5296840667724609e-01 + <_> + + 0 1 1480 -8.0646127462387085e-03 -1 -2 1481 + 4.7389548853971064e-04 + + 2.5154680013656616e-01 5.1219987869262695e-01 + 3.7259489297866821e-01 + <_> + + 1 0 1482 1.4877359717502259e-05 -1 -2 1483 + 2.4321159347891808e-02 + + 5.5324357748031616e-01 4.9607661366462708e-01 + 5.9833151102066040e-01 + <_> + + 0 1 1484 6.9931396865285933e-05 -1 -2 1485 + 2.6287760119885206e-03 + + 4.1639530658721924e-01 5.8801448345184326e-01 + 3.3996629714965820e-01 + <_> + + 1 0 1486 3.8190539926290512e-03 -1 -2 1487 + -2.5989150628447533e-02 + + 7.8466212749481201e-01 3.2881140708923340e-01 + 5.1550877094268799e-01 + <_> + + 0 1 1488 1.2062400346621871e-03 -1 -2 1489 + -1.5557400183752179e-03 + + 4.5960599184036255e-01 3.1269869208335876e-01 + 7.1833992004394531e-01 + <_> + + 1 0 1490 -2.2691930644214153e-03 -1 -2 1491 + 2.3287249496206641e-04 + + 5.2740061283111572e-01 4.8786661028862000e-01 + 5.6151527166366577e-01 + <_> + + 1 0 1492 -5.5999699980020523e-03 -1 -2 1493 + -1.0496189817786217e-02 + + 5.1608121395111084e-01 5.7016140222549438e-01 + 3.2048508524894714e-01 + <_> + + 0 1 1494 -1.4814930182183161e-05 -1 -2 1495 + -6.4287078566849232e-04 + + 5.5388379096984863e-01 5.3494292497634888e-01 + 4.4721511006355286e-01 + <_> + + 0 1 1496 -1.8891949730459601e-04 -1 -2 1497 + -9.0413521975278854e-03 + + 5.0128370523452759e-01 2.5629359483718872e-01 + 4.5033830404281616e-01 + <_> + + 1 0 1498 7.9534705728292465e-03 -1 -2 1499 + -2.7908999472856522e-03 + + 2.6304998993873596e-01 5.7565087080001831e-01 + 4.8548638820648193e-01 + <_> + + 1 0 1500 3.2857100013643503e-03 -1 -2 1501 + 7.7063008211553097e-04 + + 4.0847519040107727e-01 4.0733560919761658e-01 + 5.9202408790588379e-01 + <_> + 97 + 4.7763450622558594e+01 + + <_> + + 0 1 1502 6.3021942973136902e-02 -1 -2 1503 + -2.8374609537422657e-03 + + 3.4193828701972961e-01 6.8295639753341675e-01 + 4.4045230746269226e-01 + <_> + + 0 1 1504 4.6461950987577438e-02 -1 -2 1505 + 2.9152540490031242e-02 + + 4.3917450308799744e-01 4.6010631322860718e-01 + 6.3579368591308594e-01 + <_> + + 1 0 1506 -1.4000290320836939e-05 -1 -2 1507 + -1.2757079675793648e-03 + + 3.7300100922584534e-01 3.0938240885734558e-01 + 5.9013700485229492e-01 + <_> + + 0 1 1508 1.3596529606729746e-03 -1 -2 1509 + 1.7991929780691862e-04 + + 4.3375650048255920e-01 4.2175039649009705e-01 + 5.8468478918075562e-01 + <_> + + 1 0 1510 -1.4166639630275313e-05 -1 -2 1511 + 6.0252390539972112e-05 + + 4.0846911072731018e-01 5.0872868299484253e-01 + 7.2771841287612915e-01 + <_> + + 1 0 1512 6.4320368692278862e-03 -1 -2 1513 + 4.6682319953106344e-04 + + 2.9679030179977417e-01 4.1104629635810852e-01 + 5.5812197923660278e-01 + <_> + + 0 1 1514 5.7436279021203518e-03 -1 -2 1515 + 3.2019240316003561e-03 + + 4.2873099446296692e-01 4.2661958932876587e-01 + 6.4440459012985229e-01 + <_> + + 1 0 1516 -5.7637941790744662e-04 -1 -2 1517 + -3.7901920732110739e-03 + + 4.0848249197006226e-01 3.1819209456443787e-01 + 5.2306932210922241e-01 + <_> + + 1 0 1518 4.8914109356701374e-03 -1 -2 1519 + 4.6459292061626911e-03 + + 3.5483568906784058e-01 5.6105977296829224e-01 + 2.6938489079475403e-01 + <_> + + 0 1 1520 -6.8799369037151337e-03 -1 -2 1521 + -1.8147470429539680e-02 + + 6.2354081869125366e-01 2.8619819879531860e-01 + 5.2268481254577637e-01 + <_> + + 1 0 1522 1.1409220314817503e-04 -1 -2 1523 + -5.4334272863343358e-04 + + 3.2578331232070923e-01 3.8829690217971802e-01 + 5.3411662578582764e-01 + <_> + + 0 1 1524 -2.7602489572018385e-03 -1 -2 1525 + -1.9730569329112768e-03 + + 6.3539659976959229e-01 5.8807611465454102e-01 + 4.5930901169776917e-01 + <_> + + 1 0 1526 2.4565239436924458e-03 -1 -2 1527 + 1.9392010290175676e-04 + + 3.1340101361274719e-01 5.2771317958831787e-01 + 3.6041069030761719e-01 + <_> + + 0 1 1528 7.8643016517162323e-02 -1 -2 1529 + 6.5276869572699070e-03 + + 5.2903419733047485e-01 4.6544799208641052e-01 + 6.0449051856994629e-01 + <_> + + 0 1 1530 -7.8716799616813660e-02 -1 -2 1531 + 5.7298499159514904e-03 + + 2.5411269068717957e-01 4.3669191002845764e-01 + 5.8228862285614014e-01 + <_> + + 1 0 1532 6.2386557692661881e-04 -1 -2 1533 + -8.5267230868339539e-02 + + 5.4726922512054443e-01 1.4616079628467560e-01 + 5.1818108558654785e-01 + <_> + + 1 0 1534 4.0981110185384750e-02 -1 -2 1535 + 7.7135749161243439e-03 + + 1.2701350450515747e-01 4.8326849937438965e-01 + 2.2235789895057678e-01 + <_> + + 0 1 1536 -6.8663940764963627e-03 -1 -2 1537 + 1.4559639617800713e-02 + + 5.9189289808273315e-01 4.7615069150924683e-01 + 5.7272237539291382e-01 + <_> + + 0 1 1538 -1.0064310394227505e-02 -1 -2 1539 + 3.6274080630391836e-03 + + 3.6367309093475342e-01 5.2717310190200806e-01 + 2.7405250072479248e-01 + <_> + + 0 1 1540 -2.3421540390700102e-03 -1 -2 1541 + -2.4686409160494804e-02 + + 5.4977840185165405e-01 6.0598951578140259e-01 + 4.9603140354156494e-01 + <_> + + 1 0 1542 1.9456120207905769e-04 -1 -2 1543 + 3.1714211218059063e-04 + + 3.7694650888442993e-01 4.0623620152473450e-01 + 5.6682151556015015e-01 + <_> + + 0 1 1544 2.0793990697711706e-03 -1 -2 1545 + 1.7982709687203169e-03 + + 4.6186569333076477e-01 4.8675051331520081e-01 + 6.5184497833251953e-01 + <_> + + 0 1 1546 -2.2287059982772917e-04 -1 -2 1547 + 3.2623921288177371e-04 + + 5.6775957345962524e-01 3.7107339501380920e-01 + 5.6766051054000854e-01 + <_> + + 0 1 1548 -6.6792681813240051e-02 -1 -2 1549 + -1.4869889710098505e-03 + + 2.5115218758583069e-01 3.8867509365081787e-01 + 5.2622538805007935e-01 + <_> + + 0 1 1550 -5.0454870797693729e-03 -1 -2 1551 + -4.8297587782144547e-03 + + 6.5574729442596436e-01 5.9341061115264893e-01 + 4.2859220504760742e-01 + <_> + + 1 0 1552 -1.0722599690780044e-03 -1 -2 1553 + 8.7901195511221886e-03 + + 5.4260587692260742e-01 5.3513032197952271e-01 + 4.8342779278755188e-01 + <_> + + 0 1 1554 -7.1750381030142307e-03 -1 -2 1555 + 1.1251230025663972e-03 + + 2.0671689510345459e-01 5.1122522354125977e-01 + 3.4687140583992004e-01 + <_> + + 0 1 1556 1.0634710080921650e-02 -1 -2 1557 + -1.1763219721615314e-02 + + 4.4790080189704895e-01 6.2539017200469971e-01 + 4.9689871072769165e-01 + <_> + + 1 0 1558 9.2324063181877136e-02 -1 -2 1559 + 1.8991080578416586e-03 + + 2.0313039422035217e-01 5.6187218427658081e-01 + 4.0465721487998962e-01 + <_> + + 1 0 1560 -1.0510340332984924e-02 -1 -2 1561 + -7.4531312566250563e-04 + + 4.9432641267776489e-01 5.6134277582168579e-01 + 3.8453319668769836e-01 + <_> + + 1 0 1562 8.0041000619530678e-03 -1 -2 1563 + 5.8110528625547886e-03 + + 7.7598422765731812e-01 4.6247330307960510e-01 + 6.2862771749496460e-01 + <_> + + 0 1 1564 -2.7918580919504166e-02 -1 -2 1565 + 2.1739399526268244e-03 + + 2.4093140661716461e-01 5.3455048799514771e-01 + 3.5079580545425415e-01 + <_> + + 0 1 1566 -4.0639587678015232e-03 -1 -2 1567 + 6.0017139185220003e-04 + + 6.6471010446548462e-01 4.9985098838806152e-01 + 3.0221650004386902e-01 + <_> + + 1 0 1568 1.9214770291000605e-03 -1 -2 1569 + -1.3860830105841160e-02 + + 5.9191507101058960e-01 6.3517677783966064e-01 + 4.9933108687400818e-01 + <_> + + 1 0 1570 2.3006850853562355e-02 -1 -2 1571 + -1.3857929734513164e-03 + + 1.9023360311985016e-01 5.2533692121505737e-01 + 3.9858600497245789e-01 + <_> + + 0 1 1572 1.2637410545721650e-03 -1 -2 1573 + -1.4675210230052471e-02 + + 4.6661040186882019e-01 3.8231649994850159e-01 + 5.3266328573226929e-01 + <_> + + 0 1 1574 -2.9535070061683655e-03 -1 -2 1575 + -1.7189770005643368e-03 + + 7.0636558532714844e-01 3.8134628534317017e-01 + 5.2467352151870728e-01 + <_> + + 1 0 1576 -4.2484089499339461e-04 -1 -2 1577 + -8.5248658433556557e-04 + + 4.7916388511657715e-01 4.4912180304527283e-01 + 5.3709012269973755e-01 + <_> + + 1 0 1578 8.9034568518400192e-03 -1 -2 1579 + 1.4895649655954912e-05 + + 2.0764739811420441e-01 4.4476351141929626e-01 + 5.6671631336212158e-01 + <_> + + 0 1 1580 -4.7091601300053298e-04 -1 -2 1581 + 4.3084810022264719e-04 + + 5.4650712013244629e-01 5.4932618141174316e-01 + 4.5807081460952759e-01 + <_> + + 0 1 1582 -6.3893961487337947e-04 -1 -2 1583 + -7.3733746830839664e-05 + + 5.5015718936920166e-01 5.0857907533645630e-01 + 3.3056980371475220e-01 + <_> + + 0 1 1584 -8.8991485536098480e-03 -1 -2 1585 + -1.0253350250422955e-02 + + 4.2764690518379211e-01 1.1232180148363113e-01 + 5.1527231931686401e-01 + <_> + + 0 1 1586 -5.9637490659952164e-02 -1 -2 1587 + 2.1707199513912201e-02 + + 7.3867720365524292e-01 4.9962919950485229e-01 + 1.3394139707088470e-01 + <_> + + 0 1 1588 9.9107045680284500e-03 -1 -2 1589 + -1.0998300276696682e-02 + + 4.6790120005607605e-01 6.9286561012268066e-01 + 5.0120681524276733e-01 + <_> + + 1 0 1590 7.4608891736716032e-04 -1 -2 1591 + 2.9539171373471618e-04 + + 5.8335822820663452e-01 3.8263911008834839e-01 + 5.5663508176803589e-01 + <_> + + 1 0 1592 5.0054129213094711e-02 -1 -2 1593 + -7.2330660186707973e-03 + + 3.0027210712432861e-01 5.9080427885055542e-01 + 5.0008708238601685e-01 + <_> + + 0 1 1594 -2.6863380335271358e-03 -1 -2 1595 + -1.0195849463343620e-03 + + 3.9750349521636963e-01 3.6976858973503113e-01 + 5.7561928033828735e-01 + <_> + + 0 1 1596 -2.0204920321702957e-02 -1 -2 1597 + 2.1340379025787115e-03 + + 6.3752681016921997e-01 5.3632658720016479e-01 + 4.4331708550453186e-01 + <_> + + 0 1 1598 -1.8348889425396919e-03 -1 -2 1599 + -5.9489468112587929e-03 + + 5.8289992809295654e-01 2.6806709170341492e-01 + 4.6428859233856201e-01 + <_> + + 0 1 1600 -2.3030120064504445e-04 -1 -2 1601 + 5.0581009127199650e-03 + + 5.4753202199935913e-01 5.3208339214324951e-01 + 4.6464928984642029e-01 + <_> + + 0 1 1602 -5.1950011402368546e-04 -1 -2 1603 + -6.8620947422459722e-04 + + 5.2327448129653931e-01 4.9350860714912415e-01 + 3.1031179428100586e-01 + <_> + + 0 1 1604 -7.4936267919838428e-03 -1 -2 1605 + -1.5682930126786232e-02 + + 2.8830468654632568e-01 3.6403131484985352e-01 + 5.3687548637390137e-01 + <_> + + 0 1 1606 -3.2649750355631113e-03 -1 -2 1607 + 3.8463930832222104e-04 + + 6.4686310291290283e-01 5.2596598863601685e-01 + 3.8314279913902283e-01 + <_> + + 1 0 1608 4.4492390006780624e-03 -1 -2 1609 + 2.3118320852518082e-02 + + 2.0868189632892609e-01 4.9785330891609192e-01 + 5.9612572193145752e-01 + <_> + + 1 0 1610 2.0835159812122583e-03 -1 -2 1611 + 1.1513150529935956e-03 + + 5.7464218139648438e-01 3.5868450999259949e-01 + 5.3634738922119141e-01 + <_> + + 1 0 1612 3.6104708909988403e-02 -1 -2 1613 + 3.6256198654882610e-04 + + 2.8331369161605835e-01 5.4777222871780396e-01 + 4.1105321049690247e-01 + <_> + + 0 1 1614 -3.4635469783097506e-03 -1 -2 1615 + -2.8796829283237457e-03 + + 5.9903860092163086e-01 5.7252532243728638e-01 + 4.1495120525360107e-01 + <_> + + 1 0 1616 -8.1119500100612640e-03 -1 -2 1617 + 4.5932079665362835e-03 + + 5.3963518142700195e-01 5.3797042369842529e-01 + 3.8913029432296753e-01 + <_> + + 1 0 1618 7.0014740340411663e-03 -1 -2 1619 + 8.0169539432972670e-04 + + 3.7146711349487305e-01 5.5295670032501221e-01 + 3.7558048963546753e-01 + <_> + + 1 0 1620 -8.6652329191565514e-03 -1 -2 1621 + -2.7315050829201937e-03 + + 5.0257730484008789e-01 5.8503222465515137e-01 + 4.6175739169120789e-01 + <_> + + 1 0 1622 1.3301590224727988e-03 -1 -2 1623 + -4.2648240923881531e-03 + + 5.9377008676528931e-01 5.6453680992126465e-01 + 3.9376249909400940e-01 + <_> + + 0 1 1624 6.3251499086618423e-03 -1 -2 1625 + -3.0753740575164557e-03 + + 5.1821058988571167e-01 3.0074161291122437e-01 + 5.1964038610458374e-01 + <_> + + 0 1 1626 -7.3622138006612659e-04 -1 -2 1627 + 3.0082479497650638e-05 + + 3.6975800991058350e-01 4.3275931477546692e-01 + 5.7158088684082031e-01 + <_> + + 0 1 1628 -3.8722730241715908e-03 -1 -2 1629 + 6.2879058532416821e-04 + + 3.4737130999565125e-01 5.4382592439651489e-01 + 4.4539061188697815e-01 + <_> + + 1 0 1630 1.3411579420790076e-03 -1 -2 1631 + -8.3681922405958176e-03 + + 6.5117138624191284e-01 1.4432950317859650e-01 + 4.8881998658180237e-01 + <_> + + 1 0 1632 9.3305751215666533e-04 -1 -2 1633 + -1.0746510233730078e-03 + + 3.9511090517044067e-01 3.9102658629417419e-01 + 5.3495037555694580e-01 + <_> + + 0 1 1634 -1.8610050901770592e-02 -1 -2 1635 + 1.3651419430971146e-03 + + 1.2757439911365509e-01 5.0382888317108154e-01 + 6.9513040781021118e-01 + <_> + + 0 1 1636 7.3744421824812889e-03 -1 -2 1637 + 8.4163323044776917e-03 + + 5.2534431219100952e-01 5.0112438201904297e-01 + 7.3113328218460083e-01 + <_> + + 0 1 1638 5.1413988694548607e-03 -1 -2 1639 + 4.5847031287848949e-03 + + 4.9535360932350159e-01 2.5355559587478638e-01 + 6.4624428749084473e-01 + <_> + + 1 0 1640 2.8565239161252975e-02 -1 -2 1641 + 4.3958800961263478e-04 + + 2.3307220637798309e-01 4.7022441029548645e-01 + 5.5445492267608643e-01 + <_> + + 1 0 1642 3.1459458172321320e-02 -1 -2 1643 + 5.6011630222201347e-03 + + 3.3689688891172409e-02 4.7871211171150208e-01 + 6.3383519649505615e-01 + <_> + + 0 1 1644 7.1835669223219156e-04 -1 -2 1645 + -5.5303089320659637e-03 + + 5.4314869642257690e-01 4.1058328747749329e-01 + 5.4039907455444336e-01 + <_> + + 1 0 1646 1.4129279879853129e-03 -1 -2 1647 + 2.5530709535814822e-04 + + 3.1055399775505066e-01 4.2544719576835632e-01 + 5.4471540451049805e-01 + <_> + + 1 0 1648 3.1966410460881889e-04 -1 -2 1649 + 5.0411392003297806e-03 + + 6.1183619499206543e-01 5.2900421619415283e-01 + 4.2247870564460754e-01 + <_> + + 0 1 1650 7.7617880888283253e-03 -1 -2 1651 + 2.9374631121754646e-03 + + 4.3153458833694458e-01 6.6292631626129150e-01 + 3.0289649963378906e-01 + <_> + + 1 0 1652 -1.6497720498591661e-03 -1 -2 1653 + -5.8834417723119259e-03 + + 5.4918527603149414e-01 3.1885540485382080e-01 + 5.1842892169952393e-01 + <_> + + 1 0 1654 8.7459187489002943e-04 -1 -2 1655 + -1.5308779664337635e-02 + + 3.3288308978080750e-01 3.9236080646514893e-01 + 5.2351391315460205e-01 + <_> + + 1 0 1656 3.2292451709508896e-02 -1 -2 1657 + -4.3842519517056644e-04 + + 5.9776467084884644e-01 4.5416879653930664e-01 + 5.3694289922714233e-01 + <_> + + 1 0 1658 1.5429529594257474e-03 -1 -2 1659 + -2.4733028840273619e-03 + + 6.3181412220001221e-01 3.4906330704689026e-01 + 4.7590249776840210e-01 + <_> + + 1 0 1660 2.0994939841330051e-03 -1 -2 1661 + -5.7541108690202236e-03 + + 5.8871978521347046e-01 5.9613317251205444e-01 + 4.8419830203056335e-01 + <_> + + 0 1 1662 -1.0233130306005478e-02 -1 -2 1663 + 2.2554509341716766e-01 + + 1.7054040729999542e-01 4.7793799638748169e-01 + 9.7879663109779358e-02 + <_> + + 1 0 1664 2.9666559770703316e-02 -1 -2 1665 + -2.8518449980765581e-03 + + 5.8222240209579468e-01 5.4596269130706787e-01 + 4.6100661158561707e-01 + <_> + + 1 0 1666 9.7465328872203827e-04 -1 -2 1667 + 1.4044740055396687e-05 + + 3.6703228950500488e-01 4.3023860454559326e-01 + 5.6917107105255127e-01 + <_> + + 0 1 1668 -1.7579430714249611e-02 -1 -2 1669 + -5.2381679415702820e-02 + + 6.9173210859298706e-01 7.1100401878356934e-01 + 5.0601547956466675e-01 + <_> + + 0 1 1670 -1.1242110282182693e-02 -1 -2 1671 + -3.6728400737047195e-03 + + 8.7691891193389893e-01 6.5191918611526489e-01 + 4.5460689067840576e-01 + <_> + + 0 1 1672 3.5082760732620955e-03 -1 -2 1673 + 6.1679710634052753e-03 + + 5.3298658132553101e-01 5.2204591035842896e-01 + 2.9535189270973206e-01 + <_> + + 1 0 1674 -9.7009900491684675e-04 -1 -2 1675 + -1.0957010090351105e-02 + + 5.0486332178115845e-01 5.8373582363128662e-01 + 3.0200859904289246e-01 + <_> + + 0 1 1676 -8.3272513002157211e-03 -1 -2 1677 + 2.9798380637657829e-05 + + 3.1580638885498047e-01 4.3863898515701294e-01 + 5.4432111978530884e-01 + <_> + + 1 0 1678 2.8244039276614785e-04 -1 -2 1679 + -8.1364117795601487e-04 + + 5.6253957748413086e-01 5.2811980247497559e-01 + 3.4014078974723816e-01 + <_> + + 1 0 1680 1.8008040497079492e-03 -1 -2 1681 + -6.9944779388606548e-03 + + 3.4716591238975525e-01 4.4816970825195312e-01 + 5.3857702016830444e-01 + <_> + + 0 1 1682 4.5625398342963308e-05 -1 -2 1683 + -7.3189922841265798e-04 + + 4.4925129413604736e-01 4.1673120856285095e-01 + 6.0211020708084106e-01 + <_> + + 0 1 1684 -2.9980219551362097e-04 -1 -2 1685 + -2.9060940505587496e-05 + + 4.1484281420707703e-01 5.5920898914337158e-01 + 4.0732109546661377e-01 + <_> + + 0 1 1686 -5.9742690064013004e-04 -1 -2 1687 + 1.4831830048933625e-04 + + 6.0889142751693726e-01 5.2983051538467407e-01 + 3.7619501352310181e-01 + <_> + + 1 0 1688 -2.9441029764711857e-03 -1 -2 1689 + 1.3741210103034973e-01 + + 4.7160848975181580e-01 5.1013368368148804e-01 + 4.6746801584959030e-02 + <_> + + 0 1 1690 -8.8414177298545837e-02 -1 -2 1691 + 7.0610277354717255e-02 + + 1.1818689852952957e-01 5.1190632581710815e-01 + 7.7784419059753418e-01 + <_> + + 0 1 1692 -7.7188978902995586e-03 -1 -2 1693 + 1.5115399844944477e-02 + + 1.8741349875926971e-01 4.9800279736518860e-01 + 7.0058178901672363e-01 + <_> + + 0 1 1694 1.0671879863366485e-03 -1 -2 1695 + 7.0487911580130458e-04 + + 4.4822388887405396e-01 6.2657529115676880e-01 + 4.4026550650596619e-01 + <_> + 90 + 4.4251281738281250e+01 + + <_> + + 1 0 1696 -9.8690733313560486e-02 -1 -2 1697 + 6.2373418360948563e-02 + + 3.9994749426841736e-01 5.2477848529815674e-01 + 8.1935757398605347e-01 + <_> + + 0 1 1698 1.9496519817039371e-03 -1 -2 1699 + -8.9139147894456983e-04 + + 3.5298168659210205e-01 5.8527278900146484e-01 + 3.2459780573844910e-01 + <_> + + 0 1 1700 -5.5150408297777176e-04 -1 -2 1701 + -1.1721949558705091e-03 + + 3.8928169012069702e-01 4.3350520730018616e-01 + 6.5206241607666016e-01 + <_> + + 1 0 1702 -7.4480642797425389e-04 -1 -2 1703 + -2.6264840271323919e-03 + + 4.0411350131034851e-01 5.6249821186065674e-01 + 3.9675250649452209e-01 + <_> + + 0 1 1704 -3.9712688885629177e-04 -1 -2 1705 + 3.5984949208796024e-03 + + 3.8561120629310608e-01 5.9978890419006348e-01 + 4.2416140437126160e-01 + <_> + + 1 0 1706 5.3080618381500244e-03 -1 -2 1707 + 9.6319877775385976e-04 + + 6.6601687669754028e-01 4.4813790917396545e-01 + 5.5834877490997314e-01 + <_> + + 0 1 1708 5.0776469288393855e-04 -1 -2 1709 + 3.6223160568624735e-03 + + 3.5354590415954590e-01 3.4098070859909058e-01 + 5.4206877946853638e-01 + <_> + + 0 1 1710 -6.2061410397291183e-02 -1 -2 1711 + 6.4387189922854304e-04 + + 1.9340839982032776e-01 4.0836268663406372e-01 + 5.4902219772338867e-01 + <_> + + 1 0 1712 2.6239909231662750e-02 -1 -2 1713 + 8.1940297968685627e-04 + + 2.2857080399990082e-01 4.6486678719520569e-01 + 6.0173559188842773e-01 + <_> + + 1 0 1714 2.3833119485061616e-04 -1 -2 1715 + -1.5869759954512119e-03 + + 3.5980388522148132e-01 4.2596510052680969e-01 + 5.4764348268508911e-01 + <_> + + 0 1 1716 -6.7263417877256870e-03 -1 -2 1717 + 1.1006110347807407e-02 + + 6.5072381496429443e-01 5.1494097709655762e-01 + 3.3629849553108215e-01 + <_> + + 1 0 1718 7.1445819921791553e-03 -1 -2 1719 + -4.7233798541128635e-03 + + 2.6729300618171692e-01 5.6521821022033691e-01 + 4.2981448769569397e-01 + <_> + + 1 0 1720 9.8437406122684479e-03 -1 -2 1721 + 1.5124640412977897e-05 + + 1.1518859863281250e-01 4.3735980987548828e-01 + 5.6121289730072021e-01 + <_> + + 0 1 1722 3.9908871054649353e-02 -1 -2 1723 + 5.3903679363429546e-03 + + 5.2046489715576172e-01 4.8134678602218628e-01 + 6.3612091541290283e-01 + <_> + + 0 1 1724 -3.9908871054649353e-02 -1 -2 1725 + 5.3903679363429546e-03 + + 1.5068709850311279e-01 4.5816949009895325e-01 + 6.2002408504486084e-01 + <_> + + 1 0 1726 6.7005190066993237e-03 -1 -2 1727 + -1.2623789720237255e-02 + + 3.4322351217269897e-01 3.0882269144058228e-01 + 5.2267378568649292e-01 + <_> + + 1 0 1728 1.1806610040366650e-02 -1 -2 1729 + -3.4257229417562485e-03 + + 7.1879392862319946e-01 3.1208148598670959e-01 + 5.0658440589904785e-01 + <_> + + 0 1 1730 3.9385299896821380e-04 -1 -2 1731 + 3.4388188272714615e-02 + + 4.7545841336250305e-01 5.2616578340530396e-01 + 3.3501741290092468e-01 + <_> + + 0 1 1732 -7.5009986758232117e-02 -1 -2 1733 + 4.9022492021322250e-04 + + 1.7134809494018555e-01 4.7258019447326660e-01 + 5.9564691781997681e-01 + <_> + + 0 1 1734 -8.5525289177894592e-03 -1 -2 1735 + 1.3135520566720515e-04 + + 6.5582227706909180e-01 4.8354008793830872e-01 + 5.5869138240814209e-01 + <_> + + 1 0 1736 4.7948658466339111e-03 -1 -2 1737 + 2.0124691072851419e-03 + + 2.6457059383392334e-01 3.6579450964927673e-01 + 5.1247721910476685e-01 + <_> + + 0 1 1738 -1.1785479635000229e-01 -1 -2 1739 + 1.5575019642710686e-03 + + 2.3856540024280548e-01 5.4904741048812866e-01 + 4.2747479677200317e-01 + <_> + + 0 1 1740 -1.5573759563267231e-02 -1 -2 1741 + -2.1854790393263102e-03 + + 6.9389009475708008e-01 3.6459881067276001e-01 + 5.0925260782241821e-01 + <_> + + 0 1 1742 2.9272339306771755e-03 -1 -2 1743 + 6.4663668163120747e-03 + + 4.6858081221580505e-01 4.9734100699424744e-01 + 7.7260971069335938e-01 + <_> + + 0 1 1744 -7.6140360906720161e-03 -1 -2 1745 + 4.1512572206556797e-03 + + 6.8774658441543579e-01 4.7885251045227051e-01 + 6.9216579198837280e-01 + <_> + + 0 1 1746 2.7711640577763319e-03 -1 -2 1747 + -1.2836109846830368e-02 + + 5.4818397760391235e-01 3.8001629710197449e-01 + 5.2044928073883057e-01 + <_> + + 0 1 1748 -2.4380050599575043e-03 -1 -2 1749 + 2.1713329479098320e-03 + + 2.5824350118637085e-01 4.9611631035804749e-01 + 3.2152029871940613e-01 + <_> + + 1 0 1750 6.2800728483125567e-04 -1 -2 1751 + -9.7982389852404594e-03 + + 5.4604238271713257e-01 6.0465437173843384e-01 + 4.9399220943450928e-01 + <_> + + 1 0 1752 7.3543828912079334e-03 -1 -2 1753 + -1.4665040187537670e-02 + + 5.2910941839218140e-01 5.4461228847503662e-01 + 3.5673621296882629e-01 + <_> + + 0 1 1754 3.0244510620832443e-02 -1 -2 1755 + -5.6660208851099014e-02 + + 5.5183291435241699e-01 6.9309788942337036e-01 + 5.0933879613876343e-01 + <_> + + 0 1 1756 -5.6967479176819324e-03 -1 -2 1757 + 3.0806770548224449e-02 + + 3.2015261054039001e-01 4.9892461299896240e-01 + 2.2770540416240692e-01 + <_> + + 0 1 1758 2.2748769260942936e-03 -1 -2 1759 + 2.0436900667846203e-03 + + 4.8109310865402222e-01 5.2838671207427979e-01 + 3.2559248805046082e-01 + <_> + + 0 1 1760 -8.6277956143021584e-03 -1 -2 1761 + 6.5113382879644632e-04 + + 6.2665361166000366e-01 5.0971370935440063e-01 + 3.1919100880622864e-01 + <_> + + 0 1 1762 8.8188261725008488e-04 -1 -2 1763 + -1.4594909735023975e-02 + + 4.5495858788490295e-01 2.6450389623641968e-01 + 5.1538681983947754e-01 + <_> + + 0 1 1764 -1.2304580304771662e-03 -1 -2 1765 + -2.1867299801670015e-04 + + 6.1975848674774170e-01 5.4691988229751587e-01 + 4.2068558931350708e-01 + <_> + + 0 1 1766 -1.0909959673881531e-03 -1 -2 1767 + 3.5210378700867295e-04 + + 4.1407600045204163e-01 5.4766088724136353e-01 + 4.1550210118293762e-01 + <_> + + 0 1 1768 -7.2563779540359974e-03 -1 -2 1769 + 1.4701850013807416e-03 + + 7.1604692935943604e-01 5.2408081293106079e-01 + 3.7296628952026367e-01 + <_> + + 0 1 1770 1.1472719779703766e-04 -1 -2 1771 + 3.0506469774991274e-03 + + 4.0337988734245300e-01 5.2639859914779663e-01 + 3.5600930452346802e-01 + <_> + + 0 1 1772 2.6269949739798903e-04 -1 -2 1773 + -3.6365550477057695e-03 + + 4.5697999000549316e-01 3.0425709486007690e-01 + 5.8682537078857422e-01 + <_> + + 1 0 1774 -8.4893293678760529e-03 -1 -2 1775 + 5.8107408694922924e-03 + + 4.9141570925712585e-01 4.9185299873352051e-01 + 6.2669628858566284e-01 + <_> + + 1 0 1776 7.5583951547741890e-04 -1 -2 1777 + -2.2017690353095531e-03 + + 5.6332361698150635e-01 5.5539160966873169e-01 + 3.8276460766792297e-01 + <_> + + 0 1 1778 2.7908938936889172e-03 -1 -2 1779 + -1.8228569533675909e-03 + + 5.4986977577209473e-01 4.3822830915451050e-01 + 5.4240328073501587e-01 + <_> + + 0 1 1780 -7.2495508939027786e-03 -1 -2 1781 + -6.8744522286579013e-04 + + 2.8881219029426575e-01 3.4726551175117493e-01 + 5.0763708353042603e-01 + <_> + + 0 1 1782 2.5174440816044807e-03 -1 -2 1783 + -1.0151379741728306e-02 + + 4.6612051129341125e-01 3.7447750568389893e-01 + 5.2940011024475098e-01 + <_> + + 1 0 1784 -4.1399952024221420e-03 -1 -2 1785 + -4.7078551724553108e-03 + + 4.6604850888252258e-01 4.1750618815422058e-01 + 6.9163060188293457e-01 + <_> + + 1 0 1786 4.1981041431427002e-02 -1 -2 1787 + -1.4272999949753284e-02 + + 2.0182150602340698e-01 7.5111979246139526e-01 + 5.0320839881896973e-01 + <_> + + 1 0 1788 4.0869521908462048e-03 -1 -2 1789 + 1.7606799956411123e-03 + + 2.5045138597488403e-01 3.3014011383056641e-01 + 5.2183371782302856e-01 + <_> + + 0 1 1790 1.2550549581646919e-04 -1 -2 1791 + -2.9503209516406059e-03 + + 4.6144428849220276e-01 4.6199500560760498e-01 + 5.2470302581787109e-01 + <_> + + 0 1 1792 -1.1312420247122645e-03 -1 -2 1793 + -1.6983180539682508e-03 + + 6.3143682479858398e-01 3.4013068675994873e-01 + 5.0555270910263062e-01 + <_> + + 1 0 1794 -1.1457820422947407e-02 -1 -2 1795 + -8.4962565451860428e-03 + + 4.9399960041046143e-01 2.9654508829116821e-01 + 5.1943677663803101e-01 + <_> + + 1 0 1796 1.1919089592993259e-02 -1 -2 1797 + 6.4416420646011829e-03 + + 7.8869980573654175e-01 5.1069867610931396e-01 + 2.9671460390090942e-01 + <_> + + 0 1 1798 -8.7857811013236642e-04 -1 -2 1799 + -2.0312711130827665e-03 + + 5.7143712043762207e-01 4.4812008738517761e-01 + 5.3849118947982788e-01 + <_> + + 0 1 1800 -1.5262430533766747e-03 -1 -2 1801 + 4.2860880494117737e-03 + + 6.1935687065124512e-01 4.3398851156234741e-01 + 7.6972991228103638e-01 + <_> + + 1 0 1802 3.5010920837521553e-03 -1 -2 1803 + 1.2587670236825943e-02 + + 3.1713891029357910e-01 5.2466988563537598e-01 + 4.2412081360816956e-01 + <_> + + 0 1 1804 2.6207490009255707e-04 -1 -2 1805 + 4.4701730075757951e-05 + + 4.2318999767303467e-01 4.1741389036178589e-01 + 5.9196037054061890e-01 + <_> + + 0 1 1806 7.8084698179736733e-04 -1 -2 1807 + 8.8851212058216333e-04 + + 4.2773890495300293e-01 3.7201610207557678e-01 + 5.2268189191818237e-01 + <_> + + 0 1 1808 2.3369069676846266e-03 -1 -2 1809 + 1.6688359901309013e-03 + + 5.4780668020248413e-01 3.6286789178848267e-01 + 6.1500048637390137e-01 + <_> + + 0 1 1810 3.0844469438306987e-04 -1 -2 1811 + 3.4617560449987650e-03 + + 4.7470751404762268e-01 4.5801380276679993e-01 + 5.5856817960739136e-01 + <_> + + 0 1 1812 1.8961310386657715e-02 -1 -2 1813 + 1.7347310483455658e-01 + + 5.2988010644912720e-01 3.6983850598335266e-01 + 8.4986197948455811e-01 + <_> + + 1 0 1814 2.0020549709443003e-04 -1 -2 1815 + 1.0967060225084424e-03 + + 5.5656617879867554e-01 4.7957131266593933e-01 + 6.2862598896026611e-01 + <_> + + 0 1 1816 1.5107099898159504e-04 -1 -2 1817 + -3.4463501069694757e-03 + + 4.0524059534072876e-01 6.1730152368545532e-01 + 4.4142639636993408e-01 + <_> + + 1 0 1818 8.5176620632410049e-03 -1 -2 1819 + -3.5812109708786011e-02 + + 3.5705709457397461e-01 3.1513288617134094e-01 + 5.2527028322219849e-01 + <_> + + 0 1 1820 -2.1155400201678276e-02 -1 -2 1821 + 8.9890940580517054e-04 + + 6.1247211694717407e-01 5.1699757575988770e-01 + 3.5962718725204468e-01 + <_> + + 1 0 1822 -1.5613760333508253e-03 -1 -2 1823 + 6.7120860330760479e-04 + + 4.9149879813194275e-01 4.5462110638618469e-01 + 5.3958117961883545e-01 + <_> + + 0 1 1824 -2.1597029641270638e-02 -1 -2 1825 + -2.4947229772806168e-02 + + 1.9031339883804321e-01 6.9740772247314453e-01 + 4.9677160382270813e-01 + <_> + + 0 1 1826 1.8725979607552290e-03 -1 -2 1827 + 6.3912719488143921e-03 + + 4.7489479184150696e-01 5.1801782846450806e-01 + 2.9243218898773193e-01 + <_> + + 0 1 1828 -9.1552399098873138e-03 -1 -2 1829 + 2.1715660113841295e-03 + + 7.6658701896667480e-01 5.2155512571334839e-01 + 3.3657190203666687e-01 + <_> + + 1 0 1830 1.2330369791015983e-03 -1 -2 1831 + -4.0785901364870369e-04 + + 6.2609577178955078e-01 4.5335099101066589e-01 + 5.3864890336990356e-01 + <_> + + 0 1 1832 4.6437609125860035e-04 -1 -2 1833 + -1.1600199650274590e-04 + + 4.1034960746765137e-01 5.8303910493850708e-01 + 4.3041059374809265e-01 + <_> + + 0 1 1834 -1.2718720361590385e-02 -1 -2 1835 + 8.9431880041956902e-05 + + 2.1325829625129700e-01 4.8728910088539124e-01 + 5.4589152336120605e-01 + <_> + + 0 1 1836 -3.3913689549081028e-04 -1 -2 1837 + -1.8026340752840042e-02 + + 3.9743649959564209e-01 7.5685507059097290e-01 + 5.0456118583679199e-01 + <_> + + 1 0 1838 6.9179181009531021e-03 -1 -2 1839 + -1.1839679791592062e-04 + + 3.9662998914718628e-01 4.1980829834938049e-01 + 5.4358041286468506e-01 + <_> + + 0 1 1840 -3.9474181830883026e-03 -1 -2 1841 + 6.0050919273635373e-05 + + 6.3694578409194946e-01 5.2695667743682861e-01 + 3.8122430443763733e-01 + <_> + + 1 0 1842 9.1423643752932549e-03 -1 -2 1843 + 2.1305440168362111e-04 + + 4.1567629575729370e-01 3.5235330462455750e-01 + 5.3494542837142944e-01 + <_> + + 1 0 1844 -2.0855850016232580e-04 -1 -2 1845 + 1.3130389852449298e-03 + + 4.4033220410346985e-01 6.0581612586975098e-01 + 4.4682189822196960e-01 + <_> + + 1 0 1846 -2.9134768992662430e-03 -1 -2 1847 + 2.9645769391208887e-03 + + 4.8257058858871460e-01 4.8359981179237366e-01 + 6.0392779111862183e-01 + <_> + + 1 0 1848 1.7772549763321877e-03 -1 -2 1849 + -7.7136349864304066e-03 + + 6.8718272447586060e-01 2.8422209620475769e-01 + 5.1454281806945801e-01 + <_> + + 1 0 1850 5.1027478184551001e-04 -1 -2 1851 + 1.7460630042478442e-03 + + 6.0244262218475342e-01 4.7566100955009460e-01 + 5.7211542129516602e-01 + <_> + + 1 0 1852 3.8068278809078038e-04 -1 -2 1853 + 2.8228890150785446e-03 + + 4.9310690164566040e-01 3.3116981387138367e-01 + 6.2275981903076172e-01 + <_> + + 1 0 1854 -5.3000478073954582e-03 -1 -2 1855 + 4.4951299059903249e-05 + + 5.2320927381515503e-01 3.9952319860458374e-01 + 5.3147977590560913e-01 + <_> + + 0 1 1856 3.2752458937466145e-03 -1 -2 1857 + -2.8162579983472824e-03 + + 4.4816198945045471e-01 3.9079719781875610e-01 + 6.6716408729553223e-01 + <_> + + 0 1 1858 1.4112279750406742e-03 -1 -2 1859 + 8.3062034100294113e-03 + + 5.3570109605789185e-01 4.7709658741950989e-01 + 5.5700999498367310e-01 + <_> + + 0 1 1860 2.2164839319884777e-03 -1 -2 1861 + -4.9868631176650524e-03 + + 4.9471241235733032e-01 5.2413070201873779e-01 + 2.5126549601554871e-01 + <_> + + 1 0 1862 -3.6664260551333427e-03 -1 -2 1863 + -1.0581229813396931e-02 + + 4.6195539832115173e-01 6.3017189502716064e-01 + 4.9730318784713745e-01 + <_> + + 1 0 1864 7.3366491124033928e-03 -1 -2 1865 + -3.9318940252996981e-04 + + 2.8709700703620911e-01 4.2528051137924194e-01 + 5.5792468786239624e-01 + <_> + + 0 1 1866 -8.1375334411859512e-03 -1 -2 1867 + 2.4809150490909815e-03 + + 5.7473158836364746e-01 5.2033740282058716e-01 + 3.9035668969154358e-01 + <_> + + 1 0 1868 8.8749779388308525e-04 -1 -2 1869 + -4.2194919660687447e-04 + + 5.5343210697174072e-01 5.3380441665649414e-01 + 3.9258408546447754e-01 + <_> + + 0 1 1870 -7.9790111631155014e-03 -1 -2 1871 + 1.1439629597589374e-03 + + 4.1443160176277161e-01 4.7013729810714722e-01 + 5.2817362546920776e-01 + <_> + + 1 0 1872 7.5542130507528782e-03 -1 -2 1873 + 1.0288399644196033e-03 + + 2.5272560119628906e-01 5.6051462888717651e-01 + 4.2978560924530029e-01 + <_> + + 1 0 1874 -1.7234670231118798e-03 -1 -2 1875 + 5.7586699724197388e-01 + + 4.8396828770637512e-01 5.1105028390884399e-01 + 8.0489329993724823e-02 + <_> + 109 + 5.3755569458007812e+01 + + <_> + + 0 1 1876 6.6640521399676800e-03 -1 -2 1877 + 8.9905522763729095e-03 + + 3.8289201259613037e-01 4.8584291338920593e-01 + 7.3549592494964600e-01 + <_> + + 1 0 1878 5.7154200039803982e-03 -1 -2 1879 + 1.1257929727435112e-03 + + 6.7232239246368408e-01 4.4295778870582581e-01 + 6.0707777738571167e-01 + <_> + + 1 0 1880 -9.1789010912179947e-04 -1 -2 1881 + -1.0492859873920679e-03 + + 3.0763450264930725e-01 5.5936437845230103e-01 + 3.6510229110717773e-01 + <_> + + 0 1 1882 3.5453929740469903e-05 -1 -2 1883 + 2.9015709878876805e-04 + + 4.2779681086540222e-01 4.5835450291633606e-01 + 5.2846831083297729e-01 + <_> + + 1 0 1884 1.6071660502348095e-04 -1 -2 1885 + -5.2961107576265931e-04 + + 3.7981921434402466e-01 3.8504371047019958e-01 + 5.9396880865097046e-01 + <_> + + 0 1 1886 2.6682569296099246e-04 -1 -2 1887 + -1.3492540165316314e-04 + + 4.1230249404907227e-01 5.7605999708175659e-01 + 4.2376458644866943e-01 + <_> + + 0 1 1888 -1.0841679759323597e-02 -1 -2 1889 + 1.2077829800546169e-02 + + 3.9299210906028748e-01 5.7619231939315796e-01 + 2.7804449200630188e-01 + <_> + + 0 1 1890 2.2128869313746691e-03 -1 -2 1891 + -1.5266190283000469e-02 + + 4.7945070266723633e-01 7.4055880308151245e-02 + 5.1535779237747192e-01 + <_> + + 1 0 1892 6.7929533543065190e-05 -1 -2 1893 + 1.7633590323384851e-04 + + 5.8587378263473511e-01 3.5676109790802002e-01 + 5.5989629030227661e-01 + <_> + + 1 0 1894 8.1311381654813886e-04 -1 -2 1895 + 3.2630451023578644e-03 + + 5.3468507528305054e-01 4.7825369238853455e-01 + 5.4567539691925049e-01 + <_> + + 0 1 1896 -3.9503918960690498e-03 -1 -2 1897 + -3.9864578866399825e-04 + + 2.8318119049072266e-01 5.4852157831192017e-01 + 4.1596978902816772e-01 + <_> + + 0 1 1898 -1.1432520113885403e-02 -1 -2 1899 + 5.3339172154664993e-03 + + 5.6391012668609619e-01 4.5969840884208679e-01 + 5.9312427043914795e-01 + <_> + + 1 0 1900 8.3193257451057434e-03 -1 -2 1901 + -4.2479918920435011e-04 + + 3.2306200265884399e-01 3.7952938675880432e-01 + 5.4086112976074219e-01 + <_> + + 0 1 1902 -1.1189430207014084e-01 -1 -2 1903 + -7.5553781352937222e-03 + + 1.1322979629039764e-01 6.3393700122833252e-01 + 4.8387709259986877e-01 + <_> + + 0 1 1904 -7.0337029173970222e-03 -1 -2 1905 + -1.4833680354058743e-02 + + 5.6652551889419556e-01 6.7514181137084961e-01 + 4.1409450769424438e-01 + <_> + + 1 0 1906 8.7506724521517754e-03 -1 -2 1907 + 1.6645010327920318e-03 + + 3.5612589120864868e-01 5.3472799062728882e-01 + 3.6497798562049866e-01 + <_> + + 1 0 1908 9.4900820404291153e-03 -1 -2 1909 + 1.1133110383525491e-03 + + 2.7546560764312744e-01 4.2259928584098816e-01 + 5.6291788816452026e-01 + <_> + + 0 1 1910 9.4940755516290665e-03 -1 -2 1911 + -1.5396620146930218e-03 + + 4.9060368537902832e-01 4.0070518851280212e-01 + 5.3807091712951660e-01 + <_> + + 1 0 1912 1.3434959948062897e-01 -1 -2 1913 + -9.4940755516290665e-03 + + 2.2146719694137573e-01 7.3531562089920044e-01 + 5.0050330162048340e-01 + <_> + + 1 0 1914 2.0011790096759796e-02 -1 -2 1915 + -1.8875009845942259e-03 + + 3.3279061317443848e-01 3.9152890443801880e-01 + 5.4018497467041016e-01 + <_> + + 1 0 1916 7.1842782199382782e-03 -1 -2 1917 + 1.6976969782263041e-03 + + 7.1766048669815063e-01 4.5269781351089478e-01 + 6.0769128799438477e-01 + <_> + + 1 0 1918 4.9219978973269463e-03 -1 -2 1919 + 1.1803199537098408e-02 + + 2.5698339939117432e-01 4.9996379017829895e-01 + 5.9582281112670898e-01 + <_> + + 0 1 1920 -9.7703449428081512e-03 -1 -2 1921 + 2.1174899302423000e-03 + + 3.4590938687324524e-01 4.5151269435882568e-01 + 5.8297157287597656e-01 + <_> + + 0 1 1922 9.4801411032676697e-03 -1 -2 1923 + -2.6078789960592985e-03 + + 4.8073920607566833e-01 3.4622168540954590e-01 + 5.2015948295593262e-01 + <_> + + 0 1 1924 -5.7252747938036919e-03 -1 -2 1925 + -8.2325618714094162e-03 + + 6.5998530387878418e-01 2.8218281269073486e-01 + 5.1252847909927368e-01 + <_> + + 0 1 1926 8.9571950957179070e-04 -1 -2 1927 + -1.5021569561213255e-04 + + 4.8838189244270325e-01 4.8299181461334229e-01 + 5.4287171363830566e-01 + <_> + + 0 1 1928 4.8489659093320370e-04 -1 -2 1929 + -9.6192650496959686e-02 + + 4.4345989823341370e-01 2.2566360235214233e-01 + 5.9562277793884277e-01 + <_> + + 0 1 1930 -1.1053519556298852e-03 -1 -2 1931 + -1.0215040296316147e-01 + + 4.5272240042686462e-01 2.8443491458892822e-01 + 5.1864528656005859e-01 + <_> + + 1 0 1932 3.0147889629006386e-03 -1 -2 1933 + 7.6131648384034634e-03 + + 3.8089990615844727e-01 5.7186990976333618e-01 + 4.2625638842582703e-01 + <_> + + 1 0 1934 1.5197630273178220e-03 -1 -2 1935 + -1.4197279699146748e-02 + + 5.9427189826965332e-01 7.7311038970947266e-01 + 4.9976539611816406e-01 + <_> + + 0 1 1936 -1.3818879611790180e-02 -1 -2 1937 + -5.0701329018920660e-04 + + 6.6811382770538330e-01 3.3056080341339111e-01 + 4.7499749064445496e-01 + <_> + + 0 1 1938 -9.3537531793117523e-03 -1 -2 1939 + -9.4771059229969978e-03 + + 2.8609329462051392e-01 6.1888831853866577e-01 + 4.8421001434326172e-01 + <_> + + 1 0 1940 1.6923650400713086e-03 -1 -2 1941 + 5.8652542065829039e-04 + + 6.0702490806579590e-01 3.7826898694038391e-01 + 5.3681969642639160e-01 + <_> + + 0 1 1942 -2.5826620403677225e-03 -1 -2 1943 + -2.7307639829814434e-03 + + 3.6902099847793579e-01 3.8571149110794067e-01 + 5.3181087970733643e-01 + <_> + + 1 0 1944 2.1871570497751236e-02 -1 -2 1945 + -1.5010299648565706e-05 + + 2.3270089924335480e-01 5.5607229471206665e-01 + 4.3014100193977356e-01 + <_> + + 1 0 1946 5.3583700209856033e-03 -1 -2 1947 + 5.0057549960911274e-03 + + 6.7676377296447754e-01 5.1949042081832886e-01 + 3.6128538846969604e-01 + <_> + + 0 1 1948 -1.9030070398002863e-03 -1 -2 1949 + -7.8506693243980408e-03 + + 3.2378450036048889e-01 1.1948519945144653e-01 + 4.9917238950729370e-01 + <_> + + 1 0 1950 -2.7093670796602964e-03 -1 -2 1951 + 1.4138079714030027e-03 + + 4.8549601435661316e-01 4.8723229765892029e-01 + 5.9035778045654297e-01 + <_> + + 1 0 1952 9.0300198644399643e-03 -1 -2 1953 + -9.7925681620836258e-04 + + 6.5473157167434692e-01 5.8492732048034668e-01 + 4.5542308688163757e-01 + <_> + + 1 0 1954 1.3984439428895712e-03 -1 -2 1955 + 8.3372107474133372e-04 + + 4.0646260976791382e-01 5.3995430469512939e-01 + 4.1528099775314331e-01 + <_> + + 1 0 1956 1.0551059618592262e-02 -1 -2 1957 + 8.8344102550763637e-05 + + 1.7966809868812561e-01 4.2518630623817444e-01 + 5.4135227203369141e-01 + <_> + + 1 0 1958 -4.1022308170795441e-02 -1 -2 1959 + 7.5065628625452518e-03 + + 5.2281248569488525e-01 4.8537430167198181e-01 + 6.0934442281723022e-01 + <_> + + 1 0 1960 4.1022308170795441e-02 -1 -2 1961 + -5.3961377125233412e-04 + + 2.2050240635871887e-01 5.6927317380905151e-01 + 4.4687569141387939e-01 + <_> + + 0 1 1962 -6.8696036934852600e-02 -1 -2 1963 + -1.8447940237820148e-03 + + 1.4833140373229980e-01 6.2112838029861450e-01 + 4.9666011333465576e-01 + <_> + + 0 1 1964 -6.0959919355809689e-03 -1 -2 1965 + -4.2068301700055599e-03 + + 2.2946719825267792e-01 6.4070910215377808e-01 + 4.7485628724098206e-01 + <_> + + 1 0 1966 -7.1332789957523346e-04 -1 -2 1967 + 1.1756779998540878e-01 + + 5.3549361228942871e-01 5.1369780302047729e-01 + 1.0595739819109440e-02 + <_> + + 0 1 1968 5.9354289987822995e-05 -1 -2 1969 + -6.3173691742122173e-03 + + 3.7118038535118103e-01 1.7120739817619324e-01 + 5.0617581605911255e-01 + <_> + + 1 0 1970 1.4941499568521976e-02 -1 -2 1971 + -2.0789399277418852e-03 + + 6.7291188240051270e-01 4.4106459617614746e-01 + 5.4440277814865112e-01 + <_> + + 0 1 1972 -7.0736219640821218e-04 -1 -2 1973 + -3.1247111037373543e-03 + + 5.5689108371734619e-01 5.0238692760467529e-01 + 3.5624051094055176e-01 + <_> + + 1 0 1974 -7.8919378574937582e-04 -1 -2 1975 + 1.0179580189287663e-02 + + 5.4567861557006836e-01 5.5451387166976929e-01 + 4.6223109960556030e-01 + <_> + + 1 0 1976 -2.7506109327077866e-03 -1 -2 1977 + 1.0601329617202282e-02 + + 4.9425360560417175e-01 2.9612338542938232e-01 + 5.9643387794494629e-01 + <_> + + 0 1 1978 5.1466780714690685e-03 -1 -2 1979 + 7.6321147382259369e-02 + + 5.4952287673950195e-01 5.1739591360092163e-01 + 2.9402169585227966e-01 + <_> + + 0 1 1980 -1.5027689514681697e-03 -1 -2 1981 + 1.2266670353710651e-02 + + 3.1062999367713928e-01 4.6511501073837280e-01 + 6.8466138839721680e-01 + <_> + + 1 0 1982 -3.1118579208850861e-02 -1 -2 1983 + 2.8905589133501053e-02 + + 5.2260571718215942e-01 5.1822441816329956e-01 + 2.7054280042648315e-01 + <_> + + 1 0 1984 4.7598380595445633e-02 -1 -2 1985 + 3.0808549374341965e-02 + + 1.1095120012760162e-01 4.9386250972747803e-01 + 1.4041109383106232e-01 + <_> + + 1 0 1986 -2.1277810446918011e-04 -1 -2 1987 + 7.8969962894916534e-02 + + 4.3923568725585938e-01 5.2165520191192627e-01 + 2.2941139340400696e-01 + <_> + + 0 1 1988 -1.0257950052618980e-02 -1 -2 1989 + 1.2604889925569296e-03 + + 6.1766529083251953e-01 5.2362227439880371e-01 + 3.3289659023284912e-01 + <_> + + 1 0 1990 -3.3490460366010666e-02 -1 -2 1991 + -5.9202767442911863e-04 + + 4.8661869764328003e-01 4.1164070367813110e-01 + 5.3956401348114014e-01 + <_> + + 1 0 1992 3.0320750738610514e-05 -1 -2 1993 + -5.4369680583477020e-04 + + 5.6107360124588013e-01 5.6213891506195068e-01 + 3.4612038731575012e-01 + <_> + + 1 0 1994 -3.3490460366010666e-02 -1 -2 1995 + -5.9202767442911863e-04 + + 4.8967620730400085e-01 4.3054041266441345e-01 + 5.3407138586044312e-01 + <_> + + 0 1 1996 2.0550889894366264e-03 -1 -2 1997 + -4.4353571720421314e-03 + + 5.5449998378753662e-01 6.0385400056838989e-01 + 3.7465929985046387e-01 + <_> + + 1 0 1998 -8.4170423448085785e-02 -1 -2 1999 + 6.7419027909636497e-03 + + 5.0073480606079102e-01 5.2980971336364746e-01 + 4.7161450982093811e-01 + <_> + + 1 0 2000 1.0278150439262390e-02 -1 -2 2001 + 5.8800862170755863e-03 + + 6.2693750858306885e-01 5.1548278331756592e-01 + 3.8130408525466919e-01 + <_> + + 1 0 2002 -6.9679190346505493e-06 -1 -2 2003 + 8.2419527461752295e-04 + + 4.4402399659156799e-01 4.6975341439247131e-01 + 5.4855042695999146e-01 + <_> + + 0 1 2004 -5.5268318392336369e-03 -1 -2 2005 + 9.6128671430051327e-04 + + 5.5136048793792725e-01 3.6186391115188599e-01 + 5.8384567499160767e-01 + <_> + + 1 0 2006 2.4810510221868753e-03 -1 -2 2007 + -1.0480589699000120e-03 + + 2.5232228636741638e-01 4.1172578930854797e-01 + 5.3929960727691650e-01 + <_> + + 0 1 2008 -6.1287907883524895e-03 -1 -2 2009 + 1.1682329932227731e-04 + + 6.7263299226760864e-01 5.0411927700042725e-01 + 3.6077290773391724e-01 + <_> + + 0 1 2010 -3.9909478276968002e-02 -1 -2 2011 + 1.5859459526836872e-03 + + 1.5637390315532684e-01 4.8919808864593506e-01 + 5.7798451185226440e-01 + <_> + + 0 1 2012 -2.2690229117870331e-02 -1 -2 2013 + 2.0916070789098740e-03 + + 2.1868790686130524e-01 4.7715771198272705e-01 + 6.0992312431335449e-01 + <_> + + 0 1 2014 -2.4715419858694077e-02 -1 -2 2015 + -1.3419450260698795e-02 + + 3.4639969468116760e-01 3.6306929588317871e-01 + 5.2521961927413940e-01 + <_> + + 0 1 2016 -6.0629472136497498e-03 -1 -2 2017 + -2.0921030081808567e-03 + + 6.6663217544555664e-01 3.3995470404624939e-01 + 5.0356978178024292e-01 + <_> + + 0 1 2018 2.5961859151721001e-02 -1 -2 2019 + 1.7908669542521238e-04 + + 5.0368028879165649e-01 5.4185307025909424e-01 + 4.3189769983291626e-01 + <_> + + 0 1 2020 -3.1546850223094225e-03 -1 -2 2021 + -1.1397759662941098e-03 + + 7.2210252285003662e-01 3.3209729194641113e-01 + 5.0244337320327759e-01 + <_> + + 0 1 2022 -4.7840211540460587e-02 -1 -2 2023 + 4.1577088995836675e-04 + + 1.9387650489807129e-01 4.8021888732910156e-01 + 5.7307147979736328e-01 + <_> + + 0 1 2024 -4.4247039477340877e-04 -1 -2 2025 + 1.4479350065812469e-03 + + 4.2625150084495544e-01 5.7191711664199829e-01 + 4.0641531348228455e-01 + <_> + + 0 1 2026 1.5701510012149811e-02 -1 -2 2027 + 2.7805729769170284e-04 + + 4.9957260489463806e-01 5.2892869710922241e-01 + 4.5817288756370544e-01 + <_> + + 0 1 2028 -2.9010509606450796e-03 -1 -2 2029 + 2.0830519497394562e-04 + + 6.0121482610702515e-01 5.0579768419265747e-01 + 3.5994321107864380e-01 + <_> + + 1 0 2030 -5.1530029624700546e-02 -1 -2 2031 + 1.7163449956569821e-04 + + 4.9917969107627869e-01 4.6754699945449829e-01 + 5.3747731447219849e-01 + <_> + + 1 0 2032 2.3614279925823212e-02 -1 -2 2033 + -5.6427798699587584e-04 + + 6.5864789485931396e-01 3.8532960414886475e-01 + 5.1960402727127075e-01 + <_> + + 1 0 2034 6.6903959959745407e-03 -1 -2 2035 + -4.8789530992507935e-03 + + 6.0042357444763184e-01 3.2932278513908386e-01 + 5.2452367544174194e-01 + <_> + + 0 1 2036 -6.8537332117557526e-03 -1 -2 2037 + 9.9893810693174601e-04 + + 2.5659140944480896e-01 4.6154940128326416e-01 + 5.9424322843551636e-01 + <_> + + 0 1 2038 -1.3354700058698654e-04 -1 -2 2039 + 1.0165109997615218e-03 + + 5.4873758554458618e-01 4.5783591270446777e-01 + 5.4269278049468994e-01 + <_> + + 1 0 2040 9.1216771397739649e-04 -1 -2 2041 + 1.0080259526148438e-03 + + 3.9394611120223999e-01 4.0497899055480957e-01 + 5.5207037925720215e-01 + <_> + + 1 0 2042 -1.3102490629535168e-04 -1 -2 2043 + 5.5228749988600612e-04 + + 4.8790889978408813e-01 4.8449438810348511e-01 + 5.5128258466720581e-01 + <_> + + 1 0 2044 -1.2130969844292849e-04 -1 -2 2045 + -1.5112989785848185e-05 + + 4.3679711222648621e-01 6.4259552955627441e-01 + 4.8818269371986389e-01 + <_> + + 1 0 2046 -4.0125829400494695e-04 -1 -2 2047 + -6.5766851184889674e-04 + + 5.3720992803573608e-01 5.8345532417297363e-01 + 4.8690780997276306e-01 + <_> + + 1 0 2048 6.2220421386882663e-04 -1 -2 2049 + 1.4663359615951777e-03 + + 3.8246369361877441e-01 4.8134881258010864e-01 + 6.9667392969131470e-01 + <_> + + 0 1 2050 -4.9547709524631500e-02 -1 -2 2051 + 1.3017569435760379e-03 + + 5.3927659988403320e-02 5.3374558687210083e-01 + 4.1607481241226196e-01 + <_> + + 0 1 2052 -4.4914530590176582e-03 -1 -2 2053 + 1.6592369647696614e-03 + + 5.9974372386932373e-01 3.7271851301193237e-01 + 5.1156342029571533e-01 + <_> + + 0 1 2054 6.4695458859205246e-03 -1 -2 2055 + 4.9810269847512245e-03 + + 5.2520352602005005e-01 5.2567178010940552e-01 + 3.9344060420989990e-01 + <_> + + 0 1 2056 -3.8536980748176575e-02 -1 -2 2057 + -2.8275650739669800e-01 + + 2.0619249343872070e-01 6.1883211135864258e-02 + 4.9250578880310059e-01 + <_> + + 0 1 2058 -9.0301828458905220e-03 -1 -2 2059 + -4.3866269290447235e-02 + + 3.1575900316238403e-01 2.0336820185184479e-01 + 5.1647698879241943e-01 + <_> + + 0 1 2060 -4.5701069757342339e-03 -1 -2 2061 + -2.3362410720437765e-03 + + 6.6111832857131958e-01 2.8077891469001770e-01 + 4.9628761410713196e-01 + <_> + + 0 1 2062 5.3960331715643406e-03 -1 -2 2063 + -2.6297608856111765e-03 + + 5.1463878154754639e-01 6.2844878435134888e-01 + 4.9555888772010803e-01 + <_> + + 0 1 2064 -3.8577478844672441e-03 -1 -2 2065 + 1.3963800156489015e-03 + + 1.4867480099201202e-01 4.7013381123542786e-01 + 6.3209718465805054e-01 + <_> + + 1 0 2066 -8.8699469342827797e-03 -1 -2 2067 + -7.0626288652420044e-04 + + 5.2868181467056274e-01 4.6483701467514038e-01 + 5.3332102298736572e-01 + <_> + + 0 1 2068 4.2645810171961784e-03 -1 -2 2069 + 6.1572100967168808e-02 + + 5.0848782062530518e-01 3.6296251416206360e-01 + 8.7571567296981812e-01 + <_> + + 1 0 2070 -4.5381980016827583e-03 -1 -2 2071 + -4.0877899155020714e-03 + + 4.8566961288452148e-01 4.5841160416603088e-01 + 5.4202407598495483e-01 + <_> + + 1 0 2072 6.4308601431548595e-03 -1 -2 2073 + 7.0455260574817657e-03 + + 2.7073028683662415e-01 5.0574868917465210e-01 + 7.0265239477157593e-01 + <_> + + 1 0 2074 -2.3246440105140209e-03 -1 -2 2075 + 6.0276601288933307e-05 + + 4.8272788524627686e-01 4.2472490668296814e-01 + 5.5087631940841675e-01 + <_> + + 1 0 2076 1.8084559589624405e-02 -1 -2 2077 + 8.4693520329892635e-04 + + 8.1048011779785156e-01 5.1546192169189453e-01 + 3.5143798589706421e-01 + <_> + + 1 0 2078 -2.6931039988994598e-02 -1 -2 2079 + -4.2346641421318054e-03 + + 4.8868888616561890e-01 4.6223780512809753e-01 + 5.3824782371520996e-01 + <_> + + 1 0 2080 2.6947110891342163e-02 -1 -2 2081 + 4.6446882188320160e-03 + + 6.3665962219238281e-01 5.3685069084167480e-01 + 3.7654298543930054e-01 + <_> + + 0 1 2082 -6.9577661342918873e-03 -1 -2 2083 + 8.7609712500125170e-04 + + 4.2346870899200439e-01 4.6724060177803040e-01 + 5.3506839275360107e-01 + <_> + + 1 0 2084 1.6103329835459590e-03 -1 -2 2085 + -1.2848590267822146e-03 + + 5.7327628135681152e-01 5.4817992448806763e-01 + 3.7845930457115173e-01 + <_> + + 0 1 2086 1.0243539698421955e-02 -1 -2 2087 + 2.6889349101111293e-04 + + 5.1559072732925415e-01 5.3531897068023682e-01 + 4.3871539831161499e-01 + <_> + + 0 1 2088 3.7903659977018833e-03 -1 -2 2089 + -2.9369680210947990e-02 + + 5.0320029258728027e-01 5.8735388517379761e-01 + 2.2154450416564941e-01 + <_> + + 1 0 2090 6.0743088833987713e-03 -1 -2 2091 + -1.2710720300674438e-02 + + 5.4170298576354980e-01 6.0565119981765747e-01 + 4.9851819872856140e-01 + <_> + + 0 1 2092 -5.9445449151098728e-03 -1 -2 2093 + -2.8927479870617390e-03 + + 3.3520698547363281e-01 6.9292408227920532e-01 + 4.7782200574874878e-01 + + <_> + + <_> + 2 7 16 4 -1. + <_> + 2 9 16 2 2. + <_> + + <_> + 8 4 3 14 -1. + <_> + 8 11 3 7 2. + <_> + + <_> + 13 6 1 6 -1. + <_> + 13 9 1 3 2. + <_> + + <_> + 4 2 12 8 -1. + <_> + 8 2 4 8 3. + <_> + + <_> + 6 3 1 9 -1. + <_> + 6 6 1 3 3. + <_> + + <_> + 3 7 14 9 -1. + <_> + 3 10 14 3 3. + <_> + + <_> + 4 7 4 4 -1. + <_> + 4 9 4 2 2. + <_> + + <_> + 9 4 2 16 -1. + <_> + 9 12 2 8 2. + <_> + + <_> + 1 1 18 5 -1. + <_> + 7 1 6 5 3. + <_> + + <_> + 4 5 13 8 -1. + <_> + 4 9 13 4 2. + <_> + + <_> + 1 7 16 9 -1. + <_> + 1 10 16 3 3. + <_> + + <_> + 2 0 15 4 -1. + <_> + 2 2 15 2 2. + <_> + + <_> + 7 5 6 4 -1. + <_> + 9 5 2 4 3. + <_> + + <_> + 6 3 8 9 -1. + <_> + 6 6 8 3 3. + <_> + + <_> + 8 12 3 8 -1. + <_> + 8 16 3 4 2. + <_> + + <_> + 3 16 2 2 -1. + <_> + 3 17 2 1 2. + <_> + + <_> + 14 1 6 12 -1. + <_> + 14 1 3 12 2. + <_> + + <_> + 4 4 12 6 -1. + <_> + 8 4 4 6 3. + <_> + + <_> + 0 2 6 15 -1. + <_> + 3 2 3 15 2. + <_> + + <_> + 5 4 9 6 -1. + <_> + 5 6 9 2 3. + <_> + + <_> + 13 11 6 3 -1. + <_> + 13 12 6 1 3. + <_> + + <_> + 12 12 6 4 -1. + <_> + 12 14 6 2 2. + <_> + + <_> + 1 11 6 3 -1. + <_> + 1 12 6 1 3. + <_> + + <_> + 2 5 5 8 -1. + <_> + 2 9 5 4 2. + <_> + + <_> + 5 4 10 4 -1. + <_> + 5 6 10 2 2. + <_> + + <_> + 2 4 16 12 -1. + <_> + 2 8 16 4 3. + <_> + + <_> + 4 5 12 6 -1. + <_> + 8 5 4 6 3. + <_> + + <_> + 13 7 2 9 -1. + <_> + 13 10 2 3 3. + <_> + + <_> + 5 7 2 9 -1. + <_> + 5 10 2 3 3. + <_> + + <_> + 7 1 6 8 -1. + <_> + 9 1 2 8 3. + <_> + + <_> + 12 0 4 12 -1. + <_> + 14 0 2 6 2. + <_> + 12 6 2 6 2. + <_> + + <_> + 5 8 10 2 -1. + <_> + 5 9 10 1 2. + <_> + + <_> + 5 1 6 4 -1. + <_> + 7 1 2 4 3. + <_> + + <_> + 0 3 9 12 -1. + <_> + 3 3 3 12 3. + <_> + + <_> + 9 8 3 12 -1. + <_> + 9 12 3 4 3. + <_> + + <_> + 0 5 20 15 -1. + <_> + 0 10 20 5 3. + <_> + + <_> + 2 2 6 8 -1. + <_> + 2 2 3 4 2. + <_> + 5 6 3 4 2. + <_> + + <_> + 2 1 6 2 -1. + <_> + 2 2 6 1 2. + <_> + + <_> + 10 15 6 4 -1. + <_> + 13 15 3 2 2. + <_> + 10 17 3 2 2. + <_> + + <_> + 12 14 2 6 -1. + <_> + 12 16 2 2 3. + <_> + + <_> + 5 15 4 4 -1. + <_> + 5 15 2 2 2. + <_> + 7 17 2 2 2. + <_> + + <_> + 7 18 1 2 -1. + <_> + 7 19 1 1 2. + <_> + + <_> + 4 5 12 10 -1. + <_> + 10 5 6 5 2. + <_> + 4 10 6 5 2. + <_> + + <_> + 7 4 8 12 -1. + <_> + 11 4 4 6 2. + <_> + 7 10 4 6 2. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 3 3 12 12 -1. + <_> + 3 3 6 6 2. + <_> + 9 9 6 6 2. + <_> + + <_> + 15 11 5 3 -1. + <_> + 15 12 5 1 3. + <_> + + <_> + 10 18 3 2 -1. + <_> + 11 18 1 2 3. + <_> + + <_> + 0 11 5 3 -1. + <_> + 0 12 5 1 3. + <_> + + <_> + 7 18 3 2 -1. + <_> + 8 18 1 2 3. + <_> + + <_> + 2 8 16 2 -1. + <_> + 2 9 16 1 2. + <_> + + <_> + 9 6 5 12 -1. + <_> + 9 12 5 6 2. + <_> + + <_> + 6 3 8 6 -1. + <_> + 6 6 8 3 2. + <_> + + <_> + 4 7 12 2 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 10 9 6 8 -1. + <_> + 10 13 6 4 2. + <_> + + <_> + 12 5 3 10 -1. + <_> + 12 10 3 5 2. + <_> + + <_> + 4 6 3 9 -1. + <_> + 4 9 3 3 3. + <_> + + <_> + 7 4 6 4 -1. + <_> + 9 4 2 4 3. + <_> + + <_> + 12 3 8 3 -1. + <_> + 12 3 4 3 2. + <_> + + <_> + 15 0 3 6 -1. + <_> + 15 3 3 3 2. + <_> + + <_> + 2 12 10 8 -1. + <_> + 2 12 5 4 2. + <_> + 7 16 5 4 2. + <_> + + <_> + 5 5 6 8 -1. + <_> + 5 9 6 4 2. + <_> + + <_> + 12 3 8 3 -1. + <_> + 12 3 4 3 2. + <_> + + <_> + 15 0 3 6 -1. + <_> + 15 3 3 3 2. + <_> + + <_> + 0 3 8 3 -1. + <_> + 4 3 4 3 2. + <_> + + <_> + 2 1 4 4 -1. + <_> + 2 3 4 2 2. + <_> + + <_> + 10 2 3 2 -1. + <_> + 11 2 1 2 3. + <_> + + <_> + 10 3 3 1 -1. + <_> + 11 3 1 1 3. + <_> + + <_> + 7 15 3 4 -1. + <_> + 7 17 3 2 2. + <_> + + <_> + 4 13 3 6 -1. + <_> + 4 15 3 2 3. + <_> + + <_> + 10 5 1 14 -1. + <_> + 10 12 1 7 2. + <_> + + <_> + 5 4 10 6 -1. + <_> + 5 6 10 2 3. + <_> + + <_> + 5 0 6 3 -1. + <_> + 7 0 2 3 3. + <_> + + <_> + 6 0 3 5 -1. + <_> + 7 0 1 5 3. + <_> + + <_> + 7 15 6 5 -1. + <_> + 9 15 2 5 3. + <_> + + <_> + 9 10 2 6 -1. + <_> + 9 12 2 2 3. + <_> + + <_> + 8 17 3 2 -1. + <_> + 9 17 1 2 3. + <_> + + <_> + 1 12 7 6 -1. + <_> + 1 14 7 2 3. + <_> + + <_> + 9 6 3 7 -1. + <_> + 10 6 1 7 3. + <_> + + <_> + 16 3 4 9 -1. + <_> + 16 6 4 3 3. + <_> + + <_> + 8 6 3 7 -1. + <_> + 9 6 1 7 3. + <_> + + <_> + 0 5 18 8 -1. + <_> + 0 5 9 4 2. + <_> + 9 9 9 4 2. + <_> + + <_> + 13 5 2 10 -1. + <_> + 13 10 2 5 2. + <_> + + <_> + 12 10 2 6 -1. + <_> + 12 13 2 3 2. + <_> + + <_> + 7 0 3 5 -1. + <_> + 8 0 1 5 3. + <_> + + <_> + 6 5 8 6 -1. + <_> + 6 7 8 2 3. + <_> + + <_> + 10 3 6 14 -1. + <_> + 13 3 3 7 2. + <_> + 10 10 3 7 2. + <_> + + <_> + 13 5 1 8 -1. + <_> + 13 9 1 4 2. + <_> + + <_> + 4 3 6 14 -1. + <_> + 4 3 3 7 2. + <_> + 7 10 3 7 2. + <_> + + <_> + 6 5 1 8 -1. + <_> + 6 9 1 4 2. + <_> + + <_> + 8 1 1 6 -1. + <_> + 8 3 1 2 3. + <_> + + <_> + 2 0 15 2 -1. + <_> + 2 1 15 1 2. + <_> + + <_> + 0 7 20 6 -1. + <_> + 0 9 20 2 3. + <_> + + <_> + 10 10 6 8 -1. + <_> + 10 14 6 4 2. + <_> + + <_> + 7 1 3 2 -1. + <_> + 8 1 1 2 3. + <_> + + <_> + 8 1 2 2 -1. + <_> + 9 1 1 2 2. + <_> + + <_> + 4 3 12 9 -1. + <_> + 4 6 12 3 3. + <_> + + <_> + 6 5 9 5 -1. + <_> + 9 5 3 5 3. + <_> + + <_> + 5 5 9 5 -1. + <_> + 8 5 3 5 3. + <_> + + <_> + 4 6 6 12 -1. + <_> + 4 10 6 4 3. + <_> + + <_> + 13 0 6 18 -1. + <_> + 13 0 3 18 2. + <_> + + <_> + 10 8 1 12 -1. + <_> + 10 12 1 4 3. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 1 2 4 6 -1. + <_> + 3 2 2 6 2. + <_> + + <_> + 9 18 3 2 -1. + <_> + 10 18 1 2 3. + <_> + + <_> + 10 18 3 2 -1. + <_> + 11 18 1 2 3. + <_> + + <_> + 2 8 2 6 -1. + <_> + 2 10 2 2 3. + <_> + + <_> + 7 5 6 6 -1. + <_> + 7 7 6 2 3. + <_> + + <_> + 7 19 6 1 -1. + <_> + 9 19 2 1 3. + <_> + + <_> + 10 18 3 2 -1. + <_> + 11 18 1 2 3. + <_> + + <_> + 8 3 3 1 -1. + <_> + 9 3 1 1 3. + <_> + + <_> + 2 2 16 2 -1. + <_> + 2 2 8 1 2. + <_> + 10 3 8 1 2. + <_> + + <_> + 8 11 5 3 -1. + <_> + 8 12 5 1 3. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 0 1 6 15 -1. + <_> + 2 1 2 15 3. + <_> + + <_> + 2 12 2 3 -1. + <_> + 2 13 2 1 3. + <_> + + <_> + 16 13 1 3 -1. + <_> + 16 14 1 1 3. + <_> + + <_> + 13 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 13 9 3 2 2. + <_> + + <_> + 7 13 3 6 -1. + <_> + 7 16 3 3 2. + <_> + + <_> + 7 5 1 14 -1. + <_> + 7 12 1 7 2. + <_> + + <_> + 15 12 2 3 -1. + <_> + 15 13 2 1 3. + <_> + + <_> + 10 5 3 14 -1. + <_> + 10 12 3 7 2. + <_> + + <_> + 6 10 2 6 -1. + <_> + 6 13 2 3 2. + <_> + + <_> + 6 5 1 8 -1. + <_> + 6 9 1 4 2. + <_> + + <_> + 13 11 2 1 -1. + <_> + 13 11 1 1 2. + <_> + + <_> + 12 1 6 10 -1. + <_> + 15 1 3 5 2. + <_> + 12 6 3 5 2. + <_> + + <_> + 3 12 2 3 -1. + <_> + 3 13 2 1 3. + <_> + + <_> + 9 18 2 1 -1. + <_> + 10 18 1 1 2. + <_> + + <_> + 1 0 17 9 -1. + <_> + 1 3 17 3 3. + <_> + + <_> + 1 2 8 8 -1. + <_> + 1 2 4 4 2. + <_> + 5 6 4 4 2. + <_> + + <_> + 9 5 6 4 -1. + <_> + 9 5 3 4 2. + <_> + + <_> + 10 9 7 10 -1. + <_> + 10 14 7 5 2. + <_> + + <_> + 5 5 6 4 -1. + <_> + 8 5 3 4 2. + <_> + + <_> + 0 7 20 6 -1. + <_> + 0 9 20 2 3. + <_> + + <_> + 6 5 9 10 -1. + <_> + 6 10 9 5 2. + <_> + + <_> + 8 4 4 12 -1. + <_> + 8 10 4 6 2. + <_> + + <_> + 6 6 8 3 -1. + <_> + 6 7 8 1 3. + <_> + + <_> + 3 13 10 6 -1. + <_> + 3 13 5 3 2. + <_> + 8 16 5 3 2. + <_> + + <_> + 15 1 4 11 -1. + <_> + 15 1 2 11 2. + <_> + + <_> + 5 7 10 10 -1. + <_> + 10 7 5 5 2. + <_> + 5 12 5 5 2. + <_> + + <_> + 1 1 4 11 -1. + <_> + 3 1 2 11 2. + <_> + + <_> + 1 5 8 12 -1. + <_> + 1 11 8 6 2. + <_> + + <_> + 13 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 13 9 3 2 2. + <_> + + <_> + 11 10 7 4 -1. + <_> + 11 12 7 2 2. + <_> + + <_> + 0 4 20 12 -1. + <_> + 0 4 10 6 2. + <_> + 10 10 10 6 2. + <_> + + <_> + 1 5 6 15 -1. + <_> + 1 10 6 5 3. + <_> + + <_> + 11 10 3 8 -1. + <_> + 11 14 3 4 2. + <_> + + <_> + 11 12 7 6 -1. + <_> + 11 14 7 2 3. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 3 14 14 4 -1. + <_> + 10 14 7 2 2. + <_> + 3 16 7 2 2. + <_> + + <_> + 18 7 2 4 -1. + <_> + 18 9 2 2 2. + <_> + + <_> + 3 12 6 6 -1. + <_> + 3 14 6 2 3. + <_> + + <_> + 0 4 3 6 -1. + <_> + 0 6 3 2 3. + <_> + + <_> + 9 14 3 3 -1. + <_> + 9 15 3 1 3. + <_> + + <_> + 10 7 10 4 -1. + <_> + 15 7 5 2 2. + <_> + 10 9 5 2 2. + <_> + + <_> + 7 2 6 8 -1. + <_> + 7 6 6 4 2. + <_> + + <_> + 6 3 6 2 -1. + <_> + 8 3 2 2 3. + <_> + + <_> + 10 6 3 5 -1. + <_> + 11 6 1 5 3. + <_> + + <_> + 9 0 6 19 -1. + <_> + 11 0 2 19 3. + <_> + + <_> + 3 12 1 2 -1. + <_> + 3 13 1 1 2. + <_> + + <_> + 7 14 5 3 -1. + <_> + 7 15 5 1 3. + <_> + + <_> + 2 1 18 4 -1. + <_> + 11 1 9 2 2. + <_> + 2 3 9 2 2. + <_> + + <_> + 10 5 3 8 -1. + <_> + 11 5 1 8 3. + <_> + + <_> + 0 1 18 4 -1. + <_> + 0 1 9 2 2. + <_> + 9 3 9 2 2. + <_> + + <_> + 7 5 3 8 -1. + <_> + 8 5 1 8 3. + <_> + + <_> + 9 5 2 6 -1. + <_> + 9 7 2 2 3. + <_> + + <_> + 10 8 5 2 -1. + <_> + 10 9 5 1 2. + <_> + + <_> + 2 10 15 1 -1. + <_> + 7 10 5 1 3. + <_> + + <_> + 2 7 2 6 -1. + <_> + 2 9 2 2 3. + <_> + + <_> + 9 14 3 3 -1. + <_> + 9 15 3 1 3. + <_> + + <_> + 9 7 4 10 -1. + <_> + 9 12 4 5 2. + <_> + + <_> + 0 8 8 2 -1. + <_> + 0 8 4 1 2. + <_> + 4 9 4 1 2. + <_> + + <_> + 5 9 10 8 -1. + <_> + 5 9 5 4 2. + <_> + 10 13 5 4 2. + <_> + + <_> + 9 7 2 4 -1. + <_> + 9 7 1 4 2. + <_> + + <_> + 9 6 3 4 -1. + <_> + 10 6 1 4 3. + <_> + + <_> + 8 3 2 1 -1. + <_> + 9 3 1 1 2. + <_> + + <_> + 8 6 3 4 -1. + <_> + 9 6 1 4 3. + <_> + + <_> + 12 0 4 14 -1. + <_> + 14 0 2 7 2. + <_> + 12 7 2 7 2. + <_> + + <_> + 12 5 6 9 -1. + <_> + 12 5 3 9 2. + <_> + + <_> + 0 2 6 16 -1. + <_> + 3 2 3 16 2. + <_> + + <_> + 1 12 4 2 -1. + <_> + 1 13 4 1 2. + <_> + + <_> + 7 7 6 1 -1. + <_> + 9 7 2 1 3. + <_> + + <_> + 8 3 4 9 -1. + <_> + 8 6 4 3 3. + <_> + + <_> + 12 10 4 6 -1. + <_> + 12 13 4 3 2. + <_> + + <_> + 8 1 8 16 -1. + <_> + 12 1 4 8 2. + <_> + 8 9 4 8 2. + <_> + + <_> + 4 6 3 6 -1. + <_> + 4 9 3 3 2. + <_> + + <_> + 1 3 6 2 -1. + <_> + 4 3 3 2 2. + <_> + + <_> + 9 8 3 12 -1. + <_> + 9 12 3 4 3. + <_> + + <_> + 10 9 7 10 -1. + <_> + 10 14 7 5 2. + <_> + + <_> + 3 9 7 10 -1. + <_> + 3 14 7 5 2. + <_> + + <_> + 7 5 1 14 -1. + <_> + 7 12 1 7 2. + <_> + + <_> + 13 14 1 6 -1. + <_> + 13 16 1 2 3. + <_> + + <_> + 14 12 3 6 -1. + <_> + 14 14 3 2 3. + <_> + + <_> + 6 14 1 6 -1. + <_> + 6 16 1 2 3. + <_> + + <_> + 3 12 3 6 -1. + <_> + 3 14 3 2 3. + <_> + + <_> + 8 13 5 3 -1. + <_> + 8 14 5 1 3. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 5 1 10 8 -1. + <_> + 5 1 5 4 2. + <_> + 10 5 5 4 2. + <_> + + <_> + 6 4 5 4 -1. + <_> + 6 6 5 2 2. + <_> + + <_> + 1 10 18 1 -1. + <_> + 7 10 6 1 3. + <_> + + <_> + 11 10 4 3 -1. + <_> + 11 10 2 3 2. + <_> + + <_> + 5 11 6 1 -1. + <_> + 7 11 2 1 3. + <_> + + <_> + 3 13 2 3 -1. + <_> + 3 14 2 1 3. + <_> + + <_> + 12 12 3 4 -1. + <_> + 12 14 3 2 2. + <_> + + <_> + 11 10 5 6 -1. + <_> + 11 12 5 2 3. + <_> + + <_> + 0 8 16 2 -1. + <_> + 0 9 16 1 2. + <_> + + <_> + 2 1 3 4 -1. + <_> + 2 3 3 2 2. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 7 1 3 3. + <_> + + <_> + 5 6 12 6 -1. + <_> + 9 6 4 6 3. + <_> + + <_> + 8 7 3 3 -1. + <_> + 9 7 1 3 3. + <_> + + <_> + 3 6 12 6 -1. + <_> + 7 6 4 6 3. + <_> + + <_> + 10 5 6 5 -1. + <_> + 12 5 2 5 3. + <_> + + <_> + 5 7 10 2 -1. + <_> + 5 7 5 2 2. + <_> + + <_> + 4 5 6 5 -1. + <_> + 6 5 2 5 3. + <_> + + <_> + 9 3 2 10 -1. + <_> + 9 8 2 5 2. + <_> + + <_> + 3 1 16 2 -1. + <_> + 11 1 8 1 2. + <_> + 3 2 8 1 2. + <_> + + <_> + 9 9 3 2 -1. + <_> + 9 10 3 1 2. + <_> + + <_> + 1 1 16 2 -1. + <_> + 1 1 8 1 2. + <_> + 9 2 8 1 2. + <_> + + <_> + 8 14 1 3 -1. + <_> + 8 15 1 1 3. + <_> + + <_> + 4 5 12 10 -1. + <_> + 10 5 6 5 2. + <_> + 4 10 6 5 2. + <_> + + <_> + 7 13 6 6 -1. + <_> + 10 13 3 3 2. + <_> + 7 16 3 3 2. + <_> + + <_> + 8 9 3 2 -1. + <_> + 8 10 3 1 2. + <_> + + <_> + 7 2 6 4 -1. + <_> + 9 2 2 4 3. + <_> + + <_> + 6 6 9 3 -1. + <_> + 6 7 9 1 3. + <_> + + <_> + 10 7 6 1 -1. + <_> + 12 7 2 1 3. + <_> + + <_> + 0 0 18 6 -1. + <_> + 6 0 6 6 3. + <_> + + <_> + 6 10 2 6 -1. + <_> + 6 13 2 3 2. + <_> + + <_> + 11 12 3 6 -1. + <_> + 11 15 3 3 2. + <_> + + <_> + 4 4 12 12 -1. + <_> + 10 4 6 6 2. + <_> + 4 10 6 6 2. + <_> + + <_> + 1 2 3 6 -1. + <_> + 2 2 1 6 3. + <_> + + <_> + 1 5 3 7 -1. + <_> + 2 5 1 7 3. + <_> + + <_> + 4 13 12 4 -1. + <_> + 10 13 6 2 2. + <_> + 4 15 6 2 2. + <_> + + <_> + 3 3 17 12 -1. + <_> + 3 9 17 6 2. + <_> + + <_> + 3 3 14 12 -1. + <_> + 3 3 7 6 2. + <_> + 10 9 7 6 2. + <_> + + <_> + 2 11 16 9 -1. + <_> + 2 14 16 3 3. + <_> + + <_> + 9 14 3 6 -1. + <_> + 9 17 3 3 2. + <_> + + <_> + 8 14 4 6 -1. + <_> + 10 14 2 3 2. + <_> + 8 17 2 3 2. + <_> + + <_> + 6 2 6 1 -1. + <_> + 8 2 2 1 3. + <_> + + <_> + 9 5 2 5 -1. + <_> + 10 5 1 5 2. + <_> + + <_> + 9 8 3 5 -1. + <_> + 10 8 1 5 3. + <_> + + <_> + 9 12 6 1 -1. + <_> + 9 12 3 1 2. + <_> + + <_> + 8 8 3 5 -1. + <_> + 9 8 1 5 3. + <_> + + <_> + 6 10 4 3 -1. + <_> + 8 10 2 3 2. + <_> + + <_> + 0 4 20 6 -1. + <_> + 0 6 20 2 3. + <_> + + <_> + 1 3 8 6 -1. + <_> + 1 3 4 3 2. + <_> + 5 6 4 3 2. + <_> + + <_> + 7 15 6 4 -1. + <_> + 7 17 6 2 2. + <_> + + <_> + 3 10 14 10 -1. + <_> + 3 15 14 5 2. + <_> + + <_> + 6 4 4 4 -1. + <_> + 8 4 2 4 2. + <_> + + <_> + 0 4 20 10 -1. + <_> + 0 9 20 5 2. + <_> + + <_> + 9 4 2 14 -1. + <_> + 9 11 2 7 2. + <_> + + <_> + 2 0 16 4 -1. + <_> + 2 2 16 2 2. + <_> + + <_> + 4 12 6 8 -1. + <_> + 4 12 3 4 2. + <_> + 7 16 3 4 2. + <_> + + <_> + 0 5 6 7 -1. + <_> + 3 5 3 7 2. + <_> + + <_> + 10 7 10 4 -1. + <_> + 15 7 5 2 2. + <_> + 10 9 5 2 2. + <_> + + <_> + 5 8 12 1 -1. + <_> + 9 8 4 1 3. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 9 4 2 4 -1. + <_> + 9 6 2 2 2. + <_> + + <_> + 9 6 3 6 -1. + <_> + 10 6 1 6 3. + <_> + + <_> + 12 7 6 4 -1. + <_> + 15 7 3 2 2. + <_> + 12 9 3 2 2. + <_> + + <_> + 8 6 3 6 -1. + <_> + 9 6 1 6 3. + <_> + + <_> + 1 6 18 6 -1. + <_> + 1 6 9 3 2. + <_> + 10 9 9 3 2. + <_> + + <_> + 9 1 3 3 -1. + <_> + 10 1 1 3 3. + <_> + + <_> + 10 8 5 2 -1. + <_> + 10 9 5 1 2. + <_> + + <_> + 8 1 3 3 -1. + <_> + 9 1 1 3 3. + <_> + + <_> + 5 8 5 2 -1. + <_> + 5 9 5 1 2. + <_> + + <_> + 8 6 8 8 -1. + <_> + 12 6 4 4 2. + <_> + 8 10 4 4 2. + <_> + + <_> + 5 7 10 2 -1. + <_> + 5 7 5 2 2. + <_> + + <_> + 4 5 12 10 -1. + <_> + 4 5 6 5 2. + <_> + 10 10 6 5 2. + <_> + + <_> + 5 5 2 3 -1. + <_> + 5 6 2 1 3. + <_> + + <_> + 7 14 6 3 -1. + <_> + 7 15 6 1 3. + <_> + + <_> + 9 14 3 3 -1. + <_> + 9 15 3 1 3. + <_> + + <_> + 8 14 3 3 -1. + <_> + 8 15 3 1 3. + <_> + + <_> + 1 10 8 9 -1. + <_> + 1 13 8 3 3. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 12 3 3 3 -1. + <_> + 13 3 1 3 3. + <_> + + <_> + 5 3 3 3 -1. + <_> + 6 3 1 3 3. + <_> + + <_> + 5 6 2 12 -1. + <_> + 5 10 2 4 3. + <_> + + <_> + 1 11 18 4 -1. + <_> + 10 11 9 2 2. + <_> + 1 13 9 2 2. + <_> + + <_> + 7 12 6 2 -1. + <_> + 7 13 6 1 2. + <_> + + <_> + 6 0 3 6 -1. + <_> + 7 0 1 6 3. + <_> + + <_> + 0 11 18 4 -1. + <_> + 0 11 9 2 2. + <_> + 9 13 9 2 2. + <_> + + <_> + 7 12 6 2 -1. + <_> + 7 13 6 1 2. + <_> + + <_> + 9 12 3 3 -1. + <_> + 9 13 3 1 3. + <_> + + <_> + 9 12 2 3 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 8 11 4 3 -1. + <_> + 8 12 4 1 3. + <_> + + <_> + 13 3 4 2 -1. + <_> + 13 4 4 1 2. + <_> + + <_> + 4 0 12 2 -1. + <_> + 4 1 12 1 2. + <_> + + <_> + 6 9 8 8 -1. + <_> + 6 9 4 4 2. + <_> + 10 13 4 4 2. + <_> + + <_> + 1 11 6 2 -1. + <_> + 1 12 6 1 2. + <_> + + <_> + 2 5 18 8 -1. + <_> + 11 5 9 4 2. + <_> + 2 9 9 4 2. + <_> + + <_> + 7 1 6 10 -1. + <_> + 7 6 6 5 2. + <_> + + <_> + 0 3 3 6 -1. + <_> + 0 5 3 2 3. + <_> + + <_> + 4 5 4 3 -1. + <_> + 4 6 4 1 3. + <_> + + <_> + 19 3 1 6 -1. + <_> + 19 5 1 2 3. + <_> + + <_> + 6 15 8 2 -1. + <_> + 6 16 8 1 2. + <_> + + <_> + 0 3 1 6 -1. + <_> + 0 5 1 2 3. + <_> + + <_> + 5 5 3 3 -1. + <_> + 5 6 3 1 3. + <_> + + <_> + 8 8 4 3 -1. + <_> + 8 9 4 1 3. + <_> + + <_> + 10 6 6 3 -1. + <_> + 12 6 2 3 3. + <_> + + <_> + 8 13 2 6 -1. + <_> + 8 16 2 3 2. + <_> + + <_> + 9 11 2 8 -1. + <_> + 9 15 2 4 2. + <_> + + <_> + 10 6 6 3 -1. + <_> + 12 6 2 3 3. + <_> + + <_> + 5 15 15 5 -1. + <_> + 10 15 5 5 3. + <_> + + <_> + 2 14 2 2 -1. + <_> + 2 15 2 1 2. + <_> + + <_> + 4 7 6 2 -1. + <_> + 6 7 2 2 3. + <_> + + <_> + 8 3 6 1 -1. + <_> + 10 3 2 1 3. + <_> + + <_> + 1 0 18 12 -1. + <_> + 7 0 6 12 3. + <_> + + <_> + 0 14 8 6 -1. + <_> + 4 14 4 6 2. + <_> + + <_> + 0 15 15 5 -1. + <_> + 5 15 5 5 3. + <_> + + <_> + 8 3 6 1 -1. + <_> + 10 3 2 1 3. + <_> + + <_> + 11 11 3 6 -1. + <_> + 11 14 3 3 2. + <_> + + <_> + 6 3 6 1 -1. + <_> + 8 3 2 1 3. + <_> + + <_> + 6 11 3 6 -1. + <_> + 6 14 3 3 2. + <_> + + <_> + 9 6 3 4 -1. + <_> + 10 6 1 4 3. + <_> + + <_> + 12 10 4 7 -1. + <_> + 12 10 2 7 2. + <_> + + <_> + 8 6 3 4 -1. + <_> + 9 6 1 4 3. + <_> + + <_> + 4 6 4 7 -1. + <_> + 6 6 2 7 2. + <_> + + <_> + 10 3 4 12 -1. + <_> + 10 3 2 12 2. + <_> + + <_> + 10 8 3 4 -1. + <_> + 11 8 1 4 3. + <_> + + <_> + 1 0 18 14 -1. + <_> + 7 0 6 14 3. + <_> + + <_> + 2 8 6 11 -1. + <_> + 5 8 3 11 2. + <_> + + <_> + 1 4 15 4 -1. + <_> + 1 6 15 2 2. + <_> + + <_> + 5 5 10 8 -1. + <_> + 5 9 10 4 2. + <_> + + <_> + 14 2 6 8 -1. + <_> + 14 2 3 8 2. + <_> + + <_> + 11 6 6 14 -1. + <_> + 14 6 3 7 2. + <_> + 11 13 3 7 2. + <_> + + <_> + 9 5 2 12 -1. + <_> + 9 11 2 6 2. + <_> + + <_> + 3 7 4 6 -1. + <_> + 3 9 4 2 3. + <_> + + <_> + 14 3 6 6 -1. + <_> + 14 3 3 6 2. + <_> + + <_> + 15 2 4 4 -1. + <_> + 15 4 4 2 2. + <_> + + <_> + 0 2 6 7 -1. + <_> + 3 2 3 7 2. + <_> + + <_> + 3 6 6 14 -1. + <_> + 3 6 3 7 2. + <_> + 6 13 3 7 2. + <_> + + <_> + 4 6 16 8 -1. + <_> + 4 10 16 4 2. + <_> + + <_> + 10 12 2 8 -1. + <_> + 10 16 2 4 2. + <_> + + <_> + 7 0 6 20 -1. + <_> + 9 0 2 20 3. + <_> + + <_> + 1 7 16 12 -1. + <_> + 1 7 8 6 2. + <_> + 9 13 8 6 2. + <_> + + <_> + 9 11 3 3 -1. + <_> + 9 12 3 1 3. + <_> + + <_> + 11 9 4 5 -1. + <_> + 11 9 2 5 2. + <_> + + <_> + 3 3 1 2 -1. + <_> + 3 4 1 1 2. + <_> + + <_> + 7 17 5 3 -1. + <_> + 7 18 5 1 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 10 12 2 4 2. + <_> + 8 16 2 4 2. + <_> + + <_> + 7 4 10 12 -1. + <_> + 12 4 5 6 2. + <_> + 7 10 5 6 2. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 5 9 4 5 -1. + <_> + 7 9 2 5 2. + <_> + + <_> + 9 9 8 2 -1. + <_> + 9 9 4 2 2. + <_> + + <_> + 14 15 5 2 -1. + <_> + 14 16 5 1 2. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 1 7 8 4 -1. + <_> + 1 7 4 2 2. + <_> + 5 9 4 2 2. + <_> + + <_> + 19 3 1 2 -1. + <_> + 19 4 1 1 2. + <_> + + <_> + 9 12 2 3 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 3 14 14 4 -1. + <_> + 3 14 7 2 2. + <_> + 10 16 7 2 2. + <_> + + <_> + 5 0 10 2 -1. + <_> + 5 1 10 1 2. + <_> + + <_> + 11 14 4 6 -1. + <_> + 11 16 4 2 3. + <_> + + <_> + 7 14 6 3 -1. + <_> + 7 15 6 1 3. + <_> + + <_> + 7 13 6 6 -1. + <_> + 7 13 3 3 2. + <_> + 10 16 3 3 2. + <_> + + <_> + 0 2 1 6 -1. + <_> + 0 4 1 2 3. + <_> + + <_> + 6 7 8 2 -1. + <_> + 6 8 8 1 2. + <_> + + <_> + 9 7 6 1 -1. + <_> + 9 7 3 1 2. + <_> + + <_> + 7 1 6 10 -1. + <_> + 7 6 6 5 2. + <_> + + <_> + 0 2 6 2 -1. + <_> + 0 3 6 1 2. + <_> + + <_> + 11 4 2 4 -1. + <_> + 11 4 1 4 2. + <_> + + <_> + 11 10 3 6 -1. + <_> + 11 13 3 3 2. + <_> + + <_> + 3 9 8 2 -1. + <_> + 7 9 4 2 2. + <_> + + <_> + 0 0 4 6 -1. + <_> + 2 0 2 6 2. + <_> + + <_> + 7 0 6 2 -1. + <_> + 9 0 2 2 3. + <_> + + <_> + 9 15 2 3 -1. + <_> + 9 16 2 1 3. + <_> + + <_> + 3 12 1 2 -1. + <_> + 3 13 1 1 2. + <_> + + <_> + 4 5 11 3 -1. + <_> + 4 6 11 1 3. + <_> + + <_> + 11 4 2 4 -1. + <_> + 11 4 1 4 2. + <_> + + <_> + 8 3 6 3 -1. + <_> + 10 3 2 3 3. + <_> + + <_> + 7 4 2 4 -1. + <_> + 8 4 1 4 2. + <_> + + <_> + 6 3 6 3 -1. + <_> + 8 3 2 3 3. + <_> + + <_> + 11 4 4 3 -1. + <_> + 11 5 4 1 3. + <_> + + <_> + 11 8 2 8 -1. + <_> + 11 12 2 4 2. + <_> + + <_> + 8 7 3 5 -1. + <_> + 9 7 1 5 3. + <_> + + <_> + 9 7 2 5 -1. + <_> + 10 7 1 5 2. + <_> + + <_> + 14 11 1 6 -1. + <_> + 14 13 1 2 3. + <_> + + <_> + 8 8 4 3 -1. + <_> + 8 9 4 1 3. + <_> + + <_> + 0 3 2 2 -1. + <_> + 0 4 2 1 2. + <_> + + <_> + 4 14 5 6 -1. + <_> + 4 16 5 2 3. + <_> + + <_> + 11 4 4 3 -1. + <_> + 11 5 4 1 3. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 5 4 4 3 -1. + <_> + 5 5 4 1 3. + <_> + + <_> + 5 15 4 2 -1. + <_> + 7 15 2 2 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 9 10 3 3 -1. + <_> + 9 11 3 1 3. + <_> + + <_> + 1 6 2 6 -1. + <_> + 1 8 2 2 3. + <_> + + <_> + 2 4 8 15 -1. + <_> + 2 9 8 5 3. + <_> + + <_> + 9 12 3 2 -1. + <_> + 9 13 3 1 2. + <_> + + <_> + 9 12 3 3 -1. + <_> + 9 13 3 1 3. + <_> + + <_> + 7 6 3 5 -1. + <_> + 8 6 1 5 3. + <_> + + <_> + 5 3 6 2 -1. + <_> + 7 3 2 2 3. + <_> + + <_> + 6 1 8 10 -1. + <_> + 10 1 4 5 2. + <_> + 6 6 4 5 2. + <_> + + <_> + 0 0 20 10 -1. + <_> + 10 0 10 5 2. + <_> + 0 5 10 5 2. + <_> + + <_> + 6 3 3 1 -1. + <_> + 7 3 1 1 3. + <_> + + <_> + 0 2 6 8 -1. + <_> + 2 2 2 8 3. + <_> + + <_> + 11 10 3 4 -1. + <_> + 11 12 3 2 2. + <_> + + <_> + 12 6 3 8 -1. + <_> + 12 10 3 4 2. + <_> + + <_> + 6 10 3 4 -1. + <_> + 6 12 3 2 2. + <_> + + <_> + 5 6 3 8 -1. + <_> + 5 10 3 4 2. + <_> + + <_> + 2 6 18 6 -1. + <_> + 11 6 9 3 2. + <_> + 2 9 9 3 2. + <_> + + <_> + 7 14 7 3 -1. + <_> + 7 15 7 1 3. + <_> + + <_> + 0 0 2 12 -1. + <_> + 1 0 1 12 2. + <_> + + <_> + 1 2 18 16 -1. + <_> + 1 10 18 8 2. + <_> + + <_> + 9 13 5 3 -1. + <_> + 9 14 5 1 3. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 0 6 18 6 -1. + <_> + 0 6 9 3 2. + <_> + 9 9 9 3 2. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 17 4 1 3 -1. + <_> + 17 5 1 1 3. + <_> + + <_> + 12 11 1 9 -1. + <_> + 12 14 1 3 3. + <_> + + <_> + 2 4 1 3 -1. + <_> + 2 5 1 1 3. + <_> + + <_> + 5 4 2 3 -1. + <_> + 5 5 2 1 3. + <_> + + <_> + 1 2 18 3 -1. + <_> + 7 2 6 3 3. + <_> + + <_> + 0 1 20 6 -1. + <_> + 0 3 20 2 3. + <_> + + <_> + 7 5 6 3 -1. + <_> + 9 5 2 3 3. + <_> + + <_> + 13 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 13 9 3 2 2. + <_> + + <_> + 3 1 4 10 -1. + <_> + 3 1 2 5 2. + <_> + 5 6 2 5 2. + <_> + + <_> + 0 4 19 10 -1. + <_> + 0 9 19 5 2. + <_> + + <_> + 9 8 3 12 -1. + <_> + 9 12 3 4 3. + <_> + + <_> + 11 18 5 2 -1. + <_> + 11 19 5 1 2. + <_> + + <_> + 5 16 6 4 -1. + <_> + 5 16 3 2 2. + <_> + 8 18 3 2 2. + <_> + + <_> + 5 18 3 2 -1. + <_> + 5 19 3 1 2. + <_> + + <_> + 13 11 3 2 -1. + <_> + 13 12 3 1 2. + <_> + + <_> + 8 5 8 4 -1. + <_> + 8 5 4 4 2. + <_> + + <_> + 1 2 18 6 -1. + <_> + 1 2 9 3 2. + <_> + 10 5 9 3 2. + <_> + + <_> + 3 5 14 6 -1. + <_> + 3 7 14 2 3. + <_> + + <_> + 18 1 2 6 -1. + <_> + 18 3 2 2 3. + <_> + + <_> + 9 11 6 1 -1. + <_> + 11 11 2 1 3. + <_> + + <_> + 0 2 6 11 -1. + <_> + 3 2 3 11 2. + <_> + + <_> + 4 12 2 3 -1. + <_> + 4 13 2 1 3. + <_> + + <_> + 6 12 9 2 -1. + <_> + 9 12 3 2 3. + <_> + + <_> + 9 4 6 15 -1. + <_> + 9 4 3 15 2. + <_> + + <_> + 5 11 6 1 -1. + <_> + 7 11 2 1 3. + <_> + + <_> + 5 4 6 15 -1. + <_> + 8 4 3 15 2. + <_> + + <_> + 14 12 6 7 -1. + <_> + 14 12 3 7 2. + <_> + + <_> + 18 3 2 9 -1. + <_> + 18 6 2 3 3. + <_> + + <_> + 8 1 3 1 -1. + <_> + 9 1 1 1 3. + <_> + + <_> + 0 12 6 7 -1. + <_> + 3 12 3 7 2. + <_> + + <_> + 13 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 13 9 3 2 2. + <_> + + <_> + 8 0 10 2 -1. + <_> + 8 1 10 1 2. + <_> + + <_> + 1 7 6 4 -1. + <_> + 1 7 3 2 2. + <_> + 4 9 3 2 2. + <_> + + <_> + 1 2 3 3 -1. + <_> + 1 3 3 1 3. + <_> + + <_> + 9 13 4 3 -1. + <_> + 9 14 4 1 3. + <_> + + <_> + 12 13 7 2 -1. + <_> + 12 14 7 1 2. + <_> + + <_> + 5 12 9 2 -1. + <_> + 8 12 3 2 3. + <_> + + <_> + 6 10 4 8 -1. + <_> + 6 14 4 4 2. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 12 0 5 2 -1. + <_> + 12 1 5 1 2. + <_> + + <_> + 7 7 1 12 -1. + <_> + 7 13 1 6 2. + <_> + + <_> + 6 2 3 4 -1. + <_> + 7 2 1 4 3. + <_> + + <_> + 0 13 20 6 -1. + <_> + 0 15 20 2 3. + <_> + + <_> + 8 5 12 2 -1. + <_> + 14 5 6 1 2. + <_> + 8 6 6 1 2. + <_> + + <_> + 8 14 2 3 -1. + <_> + 8 15 2 1 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 12 13 7 6 -1. + <_> + 12 15 7 2 3. + <_> + + <_> + 6 0 8 12 -1. + <_> + 10 0 4 6 2. + <_> + 6 6 4 6 2. + <_> + + <_> + 0 15 9 4 -1. + <_> + 0 17 9 2 2. + <_> + + <_> + 9 0 2 5 -1. + <_> + 10 0 1 5 2. + <_> + + <_> + 9 5 2 6 -1. + <_> + 9 5 1 6 2. + <_> + + <_> + 17 2 3 6 -1. + <_> + 17 4 3 2 3. + <_> + + <_> + 3 11 2 3 -1. + <_> + 3 12 2 1 3. + <_> + + <_> + 7 13 3 3 -1. + <_> + 7 14 3 1 3. + <_> + + <_> + 14 12 5 3 -1. + <_> + 14 13 5 1 3. + <_> + + <_> + 4 8 14 3 -1. + <_> + 4 9 14 1 3. + <_> + + <_> + 1 12 5 3 -1. + <_> + 1 13 5 1 3. + <_> + + <_> + 1 15 12 2 -1. + <_> + 1 15 6 1 2. + <_> + 7 16 6 1 2. + <_> + + <_> + 12 11 4 2 -1. + <_> + 12 12 4 1 2. + <_> + + <_> + 9 8 3 5 -1. + <_> + 10 8 1 5 3. + <_> + + <_> + 9 5 2 6 -1. + <_> + 10 5 1 6 2. + <_> + + <_> + 0 2 3 6 -1. + <_> + 0 4 3 2 3. + <_> + + <_> + 12 11 4 2 -1. + <_> + 12 12 4 1 2. + <_> + + <_> + 9 7 3 5 -1. + <_> + 10 7 1 5 3. + <_> + + <_> + 4 11 4 2 -1. + <_> + 4 12 4 1 2. + <_> + + <_> + 8 8 3 5 -1. + <_> + 9 8 1 5 3. + <_> + + <_> + 9 3 3 1 -1. + <_> + 10 3 1 1 3. + <_> + + <_> + 16 5 3 8 -1. + <_> + 17 5 1 8 3. + <_> + + <_> + 8 3 3 1 -1. + <_> + 9 3 1 1 3. + <_> + + <_> + 1 5 3 8 -1. + <_> + 2 5 1 8 3. + <_> + + <_> + 10 1 3 3 -1. + <_> + 11 1 1 3 3. + <_> + + <_> + 17 5 2 4 -1. + <_> + 17 5 1 4 2. + <_> + + <_> + 2 8 14 3 -1. + <_> + 2 9 14 1 3. + <_> + + <_> + 9 7 1 3 -1. + <_> + 9 8 1 1 3. + <_> + + <_> + 6 1 8 10 -1. + <_> + 6 6 8 5 2. + <_> + + <_> + 13 0 6 8 -1. + <_> + 16 0 3 4 2. + <_> + 13 4 3 4 2. + <_> + + <_> + 1 5 2 4 -1. + <_> + 2 5 1 4 2. + <_> + + <_> + 4 2 12 2 -1. + <_> + 4 3 12 1 2. + <_> + + <_> + 8 8 4 4 -1. + <_> + 8 10 4 2 2. + <_> + + <_> + 5 6 12 4 -1. + <_> + 9 6 4 4 3. + <_> + + <_> + 1 2 8 1 -1. + <_> + 5 2 4 1 2. + <_> + + <_> + 1 1 6 10 -1. + <_> + 3 1 2 10 3. + <_> + + <_> + 8 6 8 2 -1. + <_> + 8 6 4 2 2. + <_> + + <_> + 10 7 6 6 -1. + <_> + 12 7 2 6 3. + <_> + + <_> + 4 6 8 2 -1. + <_> + 8 6 4 2 2. + <_> + + <_> + 4 7 6 6 -1. + <_> + 6 7 2 6 3. + <_> + + <_> + 3 14 16 4 -1. + <_> + 3 16 16 2 2. + <_> + + <_> + 8 12 4 2 -1. + <_> + 8 13 4 1 2. + <_> + + <_> + 8 12 3 3 -1. + <_> + 8 13 3 1 3. + <_> + + <_> + 5 12 6 1 -1. + <_> + 8 12 3 1 2. + <_> + + <_> + 18 10 2 3 -1. + <_> + 18 11 2 1 3. + <_> + + <_> + 16 8 4 6 -1. + <_> + 16 10 4 2 3. + <_> + + <_> + 8 3 2 1 -1. + <_> + 9 3 1 1 2. + <_> + + <_> + 7 1 3 9 -1. + <_> + 8 1 1 9 3. + <_> + + <_> + 5 11 11 6 -1. + <_> + 5 14 11 3 2. + <_> + + <_> + 12 2 3 14 -1. + <_> + 12 9 3 7 2. + <_> + + <_> + 8 7 3 3 -1. + <_> + 9 7 1 3 3. + <_> + + <_> + 3 5 12 5 -1. + <_> + 7 5 4 5 3. + <_> + + <_> + 1 2 6 3 -1. + <_> + 4 2 3 3 2. + <_> + + <_> + 5 5 6 10 -1. + <_> + 5 5 3 5 2. + <_> + 8 10 3 5 2. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 2 2. + <_> + + <_> + 16 18 2 2 -1. + <_> + 16 18 1 2 2. + <_> + + <_> + 8 4 2 5 -1. + <_> + 9 4 1 5 2. + <_> + + <_> + 8 4 1 4 -1. + <_> + 8 6 1 2 2. + <_> + + <_> + 7 15 12 4 -1. + <_> + 13 15 6 2 2. + <_> + 7 17 6 2 2. + <_> + + <_> + 11 18 6 2 -1. + <_> + 11 19 6 1 2. + <_> + + <_> + 7 7 4 10 -1. + <_> + 7 12 4 5 2. + <_> + + <_> + 5 6 10 8 -1. + <_> + 5 10 10 4 2. + <_> + + <_> + 11 1 6 12 -1. + <_> + 14 1 3 6 2. + <_> + 11 7 3 6 2. + <_> + + <_> + 5 8 12 1 -1. + <_> + 9 8 4 1 3. + <_> + + <_> + 4 7 3 6 -1. + <_> + 4 9 3 2 3. + <_> + + <_> + 4 11 3 4 -1. + <_> + 4 13 3 2 2. + <_> + + <_> + 14 16 2 2 -1. + <_> + 14 17 2 1 2. + <_> + + <_> + 15 15 2 2 -1. + <_> + 15 16 2 1 2. + <_> + + <_> + 7 12 6 2 -1. + <_> + 7 13 6 1 2. + <_> + + <_> + 8 13 4 2 -1. + <_> + 8 14 4 1 2. + <_> + + <_> + 11 1 6 12 -1. + <_> + 14 1 3 6 2. + <_> + 11 7 3 6 2. + <_> + + <_> + 12 2 4 2 -1. + <_> + 12 3 4 1 2. + <_> + + <_> + 3 10 12 6 -1. + <_> + 3 10 6 3 2. + <_> + 9 13 6 3 2. + <_> + + <_> + 3 1 6 12 -1. + <_> + 3 1 3 6 2. + <_> + 6 7 3 6 2. + <_> + + <_> + 16 6 4 14 -1. + <_> + 18 6 2 7 2. + <_> + 16 13 2 7 2. + <_> + + <_> + 5 1 10 8 -1. + <_> + 10 1 5 4 2. + <_> + 5 5 5 4 2. + <_> + + <_> + 0 6 4 14 -1. + <_> + 0 6 2 7 2. + <_> + 2 13 2 7 2. + <_> + + <_> + 1 15 12 4 -1. + <_> + 1 15 6 2 2. + <_> + 7 17 6 2 2. + <_> + + <_> + 10 17 3 3 -1. + <_> + 11 17 1 3 3. + <_> + + <_> + 11 2 2 6 -1. + <_> + 12 2 1 3 2. + <_> + 11 5 1 3 2. + <_> + + <_> + 7 17 3 3 -1. + <_> + 8 17 1 3 3. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 10 15 4 2 -1. + <_> + 12 15 2 1 2. + <_> + 10 16 2 1 2. + <_> + + <_> + 13 13 4 3 -1. + <_> + 13 14 4 1 3. + <_> + + <_> + 3 13 4 3 -1. + <_> + 3 14 4 1 3. + <_> + + <_> + 7 2 2 6 -1. + <_> + 7 2 1 3 2. + <_> + 8 5 1 3 2. + <_> + + <_> + 2 1 16 3 -1. + <_> + 2 2 16 1 3. + <_> + + <_> + 10 15 4 2 -1. + <_> + 12 15 2 1 2. + <_> + 10 16 2 1 2. + <_> + + <_> + 6 15 4 2 -1. + <_> + 6 15 2 1 2. + <_> + 8 16 2 1 2. + <_> + + <_> + 3 0 13 3 -1. + <_> + 3 1 13 1 3. + <_> + + <_> + 0 9 20 3 -1. + <_> + 0 10 20 1 3. + <_> + + <_> + 6 7 9 2 -1. + <_> + 6 8 9 1 2. + <_> + + <_> + 8 14 3 6 -1. + <_> + 9 14 1 6 3. + <_> + + <_> + 9 10 2 2 -1. + <_> + 9 11 2 1 2. + <_> + + <_> + 9 7 2 5 -1. + <_> + 9 7 1 5 2. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 9 7 2 5 -1. + <_> + 10 7 1 5 2. + <_> + + <_> + 5 6 10 3 -1. + <_> + 10 6 5 3 2. + <_> + + <_> + 13 9 2 2 -1. + <_> + 13 9 1 2 2. + <_> + + <_> + 4 3 12 11 -1. + <_> + 8 3 4 11 3. + <_> + + <_> + 7 1 2 7 -1. + <_> + 8 1 1 7 2. + <_> + + <_> + 7 4 3 8 -1. + <_> + 8 4 1 8 3. + <_> + + <_> + 13 9 2 2 -1. + <_> + 13 9 1 2 2. + <_> + + <_> + 11 6 2 2 -1. + <_> + 12 6 1 1 2. + <_> + 11 7 1 1 2. + <_> + + <_> + 5 4 2 3 -1. + <_> + 5 5 2 1 3. + <_> + + <_> + 6 5 1 3 -1. + <_> + 6 6 1 1 3. + <_> + + <_> + 13 9 2 2 -1. + <_> + 13 9 1 2 2. + <_> + + <_> + 16 14 3 3 -1. + <_> + 16 15 3 1 3. + <_> + + <_> + 5 9 2 2 -1. + <_> + 6 9 1 2 2. + <_> + + <_> + 1 14 3 3 -1. + <_> + 1 15 3 1 3. + <_> + + <_> + 13 1 1 6 -1. + <_> + 13 3 1 2 3. + <_> + + <_> + 13 3 7 2 -1. + <_> + 13 4 7 1 2. + <_> + + <_> + 0 6 20 14 -1. + <_> + 0 13 20 7 2. + <_> + + <_> + 0 4 3 6 -1. + <_> + 0 6 3 2 3. + <_> + + <_> + 10 1 9 6 -1. + <_> + 10 3 9 2 3. + <_> + + <_> + 8 0 12 5 -1. + <_> + 8 0 6 5 2. + <_> + + <_> + 0 0 18 5 -1. + <_> + 6 0 6 5 3. + <_> + + <_> + 1 1 9 6 -1. + <_> + 1 3 9 2 3. + <_> + + <_> + 15 15 2 2 -1. + <_> + 15 16 2 1 2. + <_> + + <_> + 13 16 3 4 -1. + <_> + 13 18 3 2 2. + <_> + + <_> + 3 15 2 2 -1. + <_> + 3 16 2 1 2. + <_> + + <_> + 4 16 3 4 -1. + <_> + 4 18 3 2 2. + <_> + + <_> + 11 14 1 3 -1. + <_> + 11 15 1 1 3. + <_> + + <_> + 9 13 5 3 -1. + <_> + 9 14 5 1 3. + <_> + + <_> + 0 0 3 6 -1. + <_> + 0 2 3 2 3. + <_> + + <_> + 4 1 6 3 -1. + <_> + 6 1 2 3 3. + <_> + + <_> + 9 13 4 3 -1. + <_> + 9 14 4 1 3. + <_> + + <_> + 8 15 5 3 -1. + <_> + 8 16 5 1 3. + <_> + + <_> + 8 3 3 2 -1. + <_> + 9 3 1 2 3. + <_> + + <_> + 1 8 18 2 -1. + <_> + 1 9 18 1 2. + <_> + + <_> + 11 14 1 3 -1. + <_> + 11 15 1 1 3. + <_> + + <_> + 8 13 6 3 -1. + <_> + 8 14 6 1 3. + <_> + + <_> + 8 14 1 3 -1. + <_> + 8 15 1 1 3. + <_> + + <_> + 4 13 12 4 -1. + <_> + 4 13 6 2 2. + <_> + 10 15 6 2 2. + <_> + + <_> + 10 7 2 2 -1. + <_> + 10 7 1 2 2. + <_> + + <_> + 13 4 2 8 -1. + <_> + 14 4 1 4 2. + <_> + 13 8 1 4 2. + <_> + + <_> + 0 5 4 6 -1. + <_> + 0 7 4 2 3. + <_> + + <_> + 8 7 2 2 -1. + <_> + 9 7 1 2 2. + <_> + + <_> + 13 0 3 7 -1. + <_> + 14 0 1 7 3. + <_> + + <_> + 11 2 2 14 -1. + <_> + 11 2 1 14 2. + <_> + + <_> + 4 0 3 7 -1. + <_> + 5 0 1 7 3. + <_> + + <_> + 5 5 8 12 -1. + <_> + 5 5 4 6 2. + <_> + 9 11 4 6 2. + <_> + + <_> + 11 4 6 3 -1. + <_> + 11 5 6 1 3. + <_> + + <_> + 12 3 4 3 -1. + <_> + 12 4 4 1 3. + <_> + + <_> + 5 5 10 12 -1. + <_> + 5 5 5 6 2. + <_> + 10 11 5 6 2. + <_> + + <_> + 3 6 12 3 -1. + <_> + 9 6 6 3 2. + <_> + + <_> + 9 6 2 7 -1. + <_> + 9 6 1 7 2. + <_> + + <_> + 9 5 2 4 -1. + <_> + 9 5 1 4 2. + <_> + + <_> + 8 7 3 3 -1. + <_> + 9 7 1 3 3. + <_> + + <_> + 5 1 6 4 -1. + <_> + 7 1 2 4 3. + <_> + + <_> + 13 16 7 3 -1. + <_> + 13 17 7 1 3. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 0 16 7 3 -1. + <_> + 0 17 7 1 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 12 9 8 10 -1. + <_> + 12 9 4 10 2. + <_> + + <_> + 8 10 12 5 -1. + <_> + 12 10 4 5 3. + <_> + + <_> + 0 9 8 10 -1. + <_> + 4 9 4 10 2. + <_> + + <_> + 0 10 12 5 -1. + <_> + 4 10 4 5 3. + <_> + + <_> + 2 3 6 2 -1. + <_> + 5 3 3 2 2. + <_> + + <_> + 0 0 17 9 -1. + <_> + 0 3 17 3 3. + <_> + + <_> + 4 7 12 2 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 10 4 6 4 -1. + <_> + 12 4 2 4 3. + <_> + + <_> + 0 10 20 4 -1. + <_> + 0 12 20 2 2. + <_> + + <_> + 4 3 6 5 -1. + <_> + 6 3 2 5 3. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 13 9 2 3 -1. + <_> + 13 9 1 3 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 3 17 4 2 -1. + <_> + 3 18 4 1 2. + <_> + + <_> + 9 4 8 10 -1. + <_> + 9 9 8 5 2. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 8 2 4 8 -1. + <_> + 8 6 4 4 2. + <_> + + <_> + 3 4 14 12 -1. + <_> + 3 4 7 6 2. + <_> + 10 10 7 6 2. + <_> + + <_> + 7 7 6 4 -1. + <_> + 9 7 2 4 3. + <_> + + <_> + 6 7 9 4 -1. + <_> + 6 9 9 2 2. + <_> + + <_> + 2 10 3 3 -1. + <_> + 2 11 3 1 3. + <_> + + <_> + 4 6 2 9 -1. + <_> + 4 9 2 3 3. + <_> + + <_> + 9 11 3 3 -1. + <_> + 9 12 3 1 3. + <_> + + <_> + 3 1 15 2 -1. + <_> + 3 2 15 1 2. + <_> + + <_> + 9 8 2 3 -1. + <_> + 9 9 2 1 3. + <_> + + <_> + 9 6 2 5 -1. + <_> + 10 6 1 5 2. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 4 10 12 10 -1. + <_> + 4 15 12 5 2. + <_> + + <_> + 0 10 4 2 -1. + <_> + 0 11 4 1 2. + <_> + + <_> + 5 15 9 2 -1. + <_> + 5 16 9 1 2. + <_> + + <_> + 8 14 6 3 -1. + <_> + 8 15 6 1 3. + <_> + + <_> + 8 16 4 3 -1. + <_> + 8 17 4 1 3. + <_> + + <_> + 8 9 4 2 -1. + <_> + 8 10 4 1 2. + <_> + + <_> + 3 3 14 2 -1. + <_> + 3 4 14 1 2. + <_> + + <_> + 11 12 1 2 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 4 12 12 1 -1. + <_> + 8 12 4 1 3. + <_> + + <_> + 0 2 1 2 -1. + <_> + 0 3 1 1 2. + <_> + + <_> + 7 4 4 6 -1. + <_> + 9 4 2 6 2. + <_> + + <_> + 0 2 20 14 -1. + <_> + 10 2 10 7 2. + <_> + 0 9 10 7 2. + <_> + + <_> + 14 6 1 3 -1. + <_> + 14 7 1 1 3. + <_> + + <_> + 0 4 20 12 -1. + <_> + 0 4 10 6 2. + <_> + 10 10 10 6 2. + <_> + + <_> + 8 12 1 2 -1. + <_> + 8 13 1 1 2. + <_> + + <_> + 9 18 3 2 -1. + <_> + 10 18 1 2 3. + <_> + + <_> + 9 17 6 2 -1. + <_> + 11 17 2 2 3. + <_> + + <_> + 5 6 2 3 -1. + <_> + 5 7 2 1 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 14 15 3 2 -1. + <_> + 14 16 3 1 2. + <_> + + <_> + 11 3 3 4 -1. + <_> + 12 3 1 4 3. + <_> + + <_> + 3 15 3 2 -1. + <_> + 3 16 3 1 2. + <_> + + <_> + 9 12 2 3 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 9 13 3 7 -1. + <_> + 10 13 1 7 3. + <_> + + <_> + 12 12 5 3 -1. + <_> + 12 13 5 1 3. + <_> + + <_> + 8 18 3 2 -1. + <_> + 9 18 1 2 3. + <_> + + <_> + 4 7 12 4 -1. + <_> + 4 7 6 2 2. + <_> + 10 9 6 2 2. + <_> + + <_> + 6 19 14 1 -1. + <_> + 6 19 7 1 2. + <_> + + <_> + 16 14 3 2 -1. + <_> + 16 15 3 1 2. + <_> + + <_> + 1 0 6 10 -1. + <_> + 1 0 3 5 2. + <_> + 4 5 3 5 2. + <_> + + <_> + 1 0 4 10 -1. + <_> + 1 0 2 5 2. + <_> + 3 5 2 5 2. + <_> + + <_> + 15 3 5 6 -1. + <_> + 15 5 5 2 3. + <_> + + <_> + 9 5 2 15 -1. + <_> + 9 10 2 5 3. + <_> + + <_> + 0 3 5 6 -1. + <_> + 0 5 5 2 3. + <_> + + <_> + 6 0 3 2 -1. + <_> + 7 0 1 2 3. + <_> + + <_> + 12 8 8 2 -1. + <_> + 16 8 4 1 2. + <_> + 12 9 4 1 2. + <_> + + <_> + 5 8 12 1 -1. + <_> + 9 8 4 1 3. + <_> + + <_> + 3 13 3 3 -1. + <_> + 3 14 3 1 3. + <_> + + <_> + 5 13 3 2 -1. + <_> + 5 14 3 1 2. + <_> + + <_> + 9 15 3 3 -1. + <_> + 9 16 3 1 3. + <_> + + <_> + 7 15 7 3 -1. + <_> + 7 16 7 1 3. + <_> + + <_> + 3 14 11 6 -1. + <_> + 3 16 11 2 3. + <_> + + <_> + 0 19 14 1 -1. + <_> + 7 19 7 1 2. + <_> + + <_> + 9 17 6 2 -1. + <_> + 11 17 2 2 3. + <_> + + <_> + 12 11 6 2 -1. + <_> + 14 11 2 2 3. + <_> + + <_> + 5 17 6 2 -1. + <_> + 7 17 2 2 3. + <_> + + <_> + 0 1 9 10 -1. + <_> + 3 1 3 10 3. + <_> + + <_> + 10 1 3 3 -1. + <_> + 11 1 1 3 3. + <_> + + <_> + 9 5 6 4 -1. + <_> + 9 5 3 4 2. + <_> + + <_> + 7 1 3 3 -1. + <_> + 8 1 1 3 3. + <_> + + <_> + 0 4 4 11 -1. + <_> + 2 4 2 11 2. + <_> + + <_> + 9 5 6 4 -1. + <_> + 9 5 3 4 2. + <_> + + <_> + 6 0 8 10 -1. + <_> + 10 0 4 5 2. + <_> + 6 5 4 5 2. + <_> + + <_> + 6 6 5 14 -1. + <_> + 6 13 5 7 2. + <_> + + <_> + 8 5 4 14 -1. + <_> + 8 12 4 7 2. + <_> + + <_> + 7 7 6 5 -1. + <_> + 9 7 2 5 3. + <_> + + <_> + 9 3 3 9 -1. + <_> + 9 6 3 3 3. + <_> + + <_> + 8 1 3 3 -1. + <_> + 9 1 1 3 3. + <_> + + <_> + 9 6 2 4 -1. + <_> + 10 6 1 4 2. + <_> + + <_> + 10 8 6 9 -1. + <_> + 10 8 3 9 2. + <_> + + <_> + 16 4 3 8 -1. + <_> + 17 4 1 8 3. + <_> + + <_> + 5 9 10 6 -1. + <_> + 5 9 5 3 2. + <_> + 10 12 5 3 2. + <_> + + <_> + 5 5 6 4 -1. + <_> + 8 5 3 4 2. + <_> + + <_> + 9 8 4 2 -1. + <_> + 9 9 4 1 2. + <_> + + <_> + 11 7 2 2 -1. + <_> + 11 7 1 2 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 12 2 4 2. + <_> + 10 16 2 4 2. + <_> + + <_> + 0 1 4 9 -1. + <_> + 0 4 4 3 3. + <_> + + <_> + 9 10 3 3 -1. + <_> + 9 11 3 1 3. + <_> + + <_> + 8 11 4 2 -1. + <_> + 8 12 4 1 2. + <_> + + <_> + 7 8 4 2 -1. + <_> + 7 9 4 1 2. + <_> + + <_> + 7 8 6 1 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 16 0 4 9 -1. + <_> + 16 0 2 9 2. + <_> + + <_> + 16 0 3 6 -1. + <_> + 16 3 3 3 2. + <_> + + <_> + 0 0 4 9 -1. + <_> + 2 0 2 9 2. + <_> + + <_> + 1 0 3 6 -1. + <_> + 1 3 3 3 2. + <_> + + <_> + 9 7 6 9 -1. + <_> + 11 7 2 9 3. + <_> + + <_> + 10 6 3 6 -1. + <_> + 11 6 1 6 3. + <_> + + <_> + 1 2 18 2 -1. + <_> + 1 2 9 1 2. + <_> + 10 3 9 1 2. + <_> + + <_> + 5 8 6 8 -1. + <_> + 7 8 2 8 3. + <_> + + <_> + 9 0 6 16 -1. + <_> + 11 0 2 16 3. + <_> + + <_> + 14 1 6 18 -1. + <_> + 17 1 3 9 2. + <_> + 14 10 3 9 2. + <_> + + <_> + 2 9 2 3 -1. + <_> + 2 10 2 1 3. + <_> + + <_> + 0 1 6 18 -1. + <_> + 0 1 3 9 2. + <_> + 3 10 3 9 2. + <_> + + <_> + 11 8 4 12 -1. + <_> + 11 8 2 12 2. + <_> + + <_> + 2 1 18 18 -1. + <_> + 2 10 18 9 2. + <_> + + <_> + 6 3 3 1 -1. + <_> + 7 3 1 1 3. + <_> + + <_> + 4 12 2 2 -1. + <_> + 4 13 2 1 2. + <_> + + <_> + 8 13 5 3 -1. + <_> + 8 14 5 1 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 3 12 5 3 -1. + <_> + 3 13 5 1 3. + <_> + + <_> + 6 3 3 4 -1. + <_> + 7 3 1 4 3. + <_> + + <_> + 11 10 2 2 -1. + <_> + 12 10 1 1 2. + <_> + 11 11 1 1 2. + <_> + + <_> + 5 8 12 1 -1. + <_> + 9 8 4 1 3. + <_> + + <_> + 8 4 4 8 -1. + <_> + 10 4 2 8 2. + <_> + + <_> + 6 6 8 5 -1. + <_> + 10 6 4 5 2. + <_> + + <_> + 10 4 6 4 -1. + <_> + 12 4 2 4 3. + <_> + + <_> + 12 7 2 2 -1. + <_> + 13 7 1 1 2. + <_> + 12 8 1 1 2. + <_> + + <_> + 3 5 10 8 -1. + <_> + 3 9 10 4 2. + <_> + + <_> + 7 1 2 12 -1. + <_> + 7 7 2 6 2. + <_> + + <_> + 12 7 2 2 -1. + <_> + 13 7 1 1 2. + <_> + 12 8 1 1 2. + <_> + + <_> + 11 13 1 6 -1. + <_> + 11 16 1 3 2. + <_> + + <_> + 5 1 6 15 -1. + <_> + 7 1 2 15 3. + <_> + + <_> + 6 7 2 2 -1. + <_> + 6 7 1 1 2. + <_> + 7 8 1 1 2. + <_> + + <_> + 17 5 2 2 -1. + <_> + 17 6 2 1 2. + <_> + + <_> + 10 3 4 10 -1. + <_> + 12 3 2 5 2. + <_> + 10 8 2 5 2. + <_> + + <_> + 1 5 2 2 -1. + <_> + 1 6 2 1 2. + <_> + + <_> + 7 10 2 2 -1. + <_> + 7 10 1 1 2. + <_> + 8 11 1 1 2. + <_> + + <_> + 3 12 14 4 -1. + <_> + 10 12 7 2 2. + <_> + 3 14 7 2 2. + <_> + + <_> + 9 15 3 2 -1. + <_> + 9 16 3 1 2. + <_> + + <_> + 1 13 3 3 -1. + <_> + 1 14 3 1 3. + <_> + + <_> + 0 3 1 2 -1. + <_> + 0 4 1 1 2. + <_> + + <_> + 7 7 6 1 -1. + <_> + 9 7 2 1 3. + <_> + + <_> + 0 4 16 6 -1. + <_> + 0 6 16 2 3. + <_> + + <_> + 9 3 2 14 -1. + <_> + 9 10 2 7 2. + <_> + + <_> + 12 0 4 3 -1. + <_> + 12 0 2 3 2. + <_> + + <_> + 4 18 12 2 -1. + <_> + 8 18 4 2 3. + <_> + + <_> + 4 10 12 4 -1. + <_> + 8 10 4 4 3. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 14 1 2 8 -1. + <_> + 15 1 1 4 2. + <_> + 14 5 1 4 2. + <_> + + <_> + 3 4 9 1 -1. + <_> + 6 4 3 1 3. + <_> + + <_> + 3 3 4 2 -1. + <_> + 3 4 4 1 2. + <_> + + <_> + 11 15 2 4 -1. + <_> + 11 17 2 2 2. + <_> + + <_> + 14 13 2 6 -1. + <_> + 14 15 2 2 3. + <_> + + <_> + 6 6 1 6 -1. + <_> + 6 9 1 3 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 14 8 4 2. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 10 11 4 8 -1. + <_> + 10 15 4 4 2. + <_> + + <_> + 5 11 6 1 -1. + <_> + 7 11 2 1 3. + <_> + + <_> + 5 4 6 10 -1. + <_> + 8 4 3 10 2. + <_> + + <_> + 14 2 6 3 -1. + <_> + 14 3 6 1 3. + <_> + + <_> + 9 12 3 2 -1. + <_> + 9 13 3 1 2. + <_> + + <_> + 8 1 4 6 -1. + <_> + 8 3 4 2 3. + <_> + + <_> + 3 5 13 8 -1. + <_> + 3 9 13 4 2. + <_> + + <_> + 12 5 5 3 -1. + <_> + 12 6 5 1 3. + <_> + + <_> + 5 14 15 6 -1. + <_> + 5 16 15 2 3. + <_> + + <_> + 3 5 5 3 -1. + <_> + 3 6 5 1 3. + <_> + + <_> + 9 14 2 6 -1. + <_> + 9 14 1 3 2. + <_> + 10 17 1 3 2. + <_> + + <_> + 9 12 3 2 -1. + <_> + 9 13 3 1 2. + <_> + + <_> + 9 13 3 2 -1. + <_> + 9 14 3 1 2. + <_> + + <_> + 0 2 6 3 -1. + <_> + 0 3 6 1 3. + <_> + + <_> + 0 1 9 11 -1. + <_> + 3 1 3 11 3. + <_> + + <_> + 8 13 4 6 -1. + <_> + 10 13 2 3 2. + <_> + 8 16 2 3 2. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 3 12 14 4 -1. + <_> + 3 12 7 2 2. + <_> + 10 14 7 2 2. + <_> + + <_> + 7 14 1 4 -1. + <_> + 7 16 1 2 2. + <_> + + <_> + 8 13 4 6 -1. + <_> + 10 13 2 3 2. + <_> + 8 16 2 3 2. + <_> + + <_> + 10 14 1 3 -1. + <_> + 10 15 1 1 3. + <_> + + <_> + 8 13 4 6 -1. + <_> + 8 13 2 3 2. + <_> + 10 16 2 3 2. + <_> + + <_> + 9 14 1 3 -1. + <_> + 9 15 1 1 3. + <_> + + <_> + 10 15 2 3 -1. + <_> + 10 16 2 1 3. + <_> + + <_> + 11 16 1 2 -1. + <_> + 11 17 1 1 2. + <_> + + <_> + 9 0 2 2 -1. + <_> + 9 1 2 1 2. + <_> + + <_> + 0 1 5 8 -1. + <_> + 0 5 5 4 2. + <_> + + <_> + 10 14 2 3 -1. + <_> + 10 15 2 1 3. + <_> + + <_> + 10 13 2 3 -1. + <_> + 10 14 2 1 3. + <_> + + <_> + 0 3 16 6 -1. + <_> + 0 6 16 3 2. + <_> + + <_> + 4 1 2 2 -1. + <_> + 5 1 1 2 2. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 10 8 2 12 -1. + <_> + 10 12 2 4 3. + <_> + + <_> + 9 7 2 2 -1. + <_> + 10 7 1 2 2. + <_> + + <_> + 5 0 6 8 -1. + <_> + 7 0 2 8 3. + <_> + + <_> + 9 7 3 6 -1. + <_> + 10 7 1 6 3. + <_> + + <_> + 8 12 10 8 -1. + <_> + 8 16 10 4 2. + <_> + + <_> + 8 7 3 6 -1. + <_> + 9 7 1 6 3. + <_> + + <_> + 4 7 12 2 -1. + <_> + 10 7 6 2 2. + <_> + + <_> + 8 6 8 3 -1. + <_> + 8 6 4 3 2. + <_> + + <_> + 16 15 3 3 -1. + <_> + 16 16 3 1 3. + <_> + + <_> + 4 6 12 3 -1. + <_> + 10 6 6 3 2. + <_> + + <_> + 7 8 3 5 -1. + <_> + 8 8 1 5 3. + <_> + + <_> + 0 10 20 2 -1. + <_> + 10 10 10 1 2. + <_> + 0 11 10 1 2. + <_> + + <_> + 11 16 9 4 -1. + <_> + 14 16 3 4 3. + <_> + + <_> + 0 5 3 4 -1. + <_> + 1 5 1 4 3. + <_> + + <_> + 8 15 4 2 -1. + <_> + 8 15 2 1 2. + <_> + 10 16 2 1 2. + <_> + + <_> + 1 8 19 3 -1. + <_> + 1 9 19 1 3. + <_> + + <_> + 15 16 3 3 -1. + <_> + 15 17 3 1 3. + <_> + + <_> + 0 4 20 10 -1. + <_> + 0 4 10 5 2. + <_> + 10 9 10 5 2. + <_> + + <_> + 2 14 7 6 -1. + <_> + 2 16 7 2 3. + <_> + + <_> + 8 6 6 6 -1. + <_> + 10 6 2 6 3. + <_> + + <_> + 16 4 4 6 -1. + <_> + 16 6 4 2 3. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 7 13 4 3 -1. + <_> + 7 14 4 1 3. + <_> + + <_> + 13 13 6 2 -1. + <_> + 13 14 6 1 2. + <_> + + <_> + 14 12 2 3 -1. + <_> + 14 13 2 1 3. + <_> + + <_> + 1 13 6 2 -1. + <_> + 1 14 6 1 2. + <_> + + <_> + 4 12 2 3 -1. + <_> + 4 13 2 1 3. + <_> + + <_> + 17 4 3 5 -1. + <_> + 18 4 1 5 3. + <_> + + <_> + 5 5 14 8 -1. + <_> + 12 5 7 4 2. + <_> + 5 9 7 4 2. + <_> + + <_> + 6 8 6 5 -1. + <_> + 8 8 2 5 3. + <_> + + <_> + 0 4 4 6 -1. + <_> + 0 6 4 2 3. + <_> + + <_> + 9 1 3 6 -1. + <_> + 10 1 1 6 3. + <_> + + <_> + 10 4 6 3 -1. + <_> + 10 5 6 1 3. + <_> + + <_> + 8 1 3 6 -1. + <_> + 9 1 1 6 3. + <_> + + <_> + 4 4 6 3 -1. + <_> + 4 5 6 1 3. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 12 11 4 2 -1. + <_> + 12 12 4 1 2. + <_> + + <_> + 0 2 20 6 -1. + <_> + 0 2 10 3 2. + <_> + 10 5 10 3 2. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 2 10 16 4 -1. + <_> + 10 10 8 2 2. + <_> + 2 12 8 2 2. + <_> + + <_> + 3 10 16 6 -1. + <_> + 11 10 8 3 2. + <_> + 3 13 8 3 2. + <_> + + <_> + 1 10 16 6 -1. + <_> + 1 10 8 3 2. + <_> + 9 13 8 3 2. + <_> + + <_> + 4 7 2 4 -1. + <_> + 5 7 1 4 2. + <_> + + <_> + 11 16 9 4 -1. + <_> + 14 16 3 4 3. + <_> + + <_> + 3 16 14 4 -1. + <_> + 10 16 7 2 2. + <_> + 3 18 7 2 2. + <_> + + <_> + 0 16 9 4 -1. + <_> + 3 16 3 4 3. + <_> + + <_> + 1 14 6 6 -1. + <_> + 1 14 3 3 2. + <_> + 4 17 3 3 2. + <_> + + <_> + 9 0 2 1 -1. + <_> + 9 0 1 1 2. + <_> + + <_> + 6 7 8 10 -1. + <_> + 10 7 4 5 2. + <_> + 6 12 4 5 2. + <_> + + <_> + 2 15 1 2 -1. + <_> + 2 16 1 1 2. + <_> + + <_> + 0 14 7 6 -1. + <_> + 0 16 7 2 3. + <_> + + <_> + 7 8 6 2 -1. + <_> + 7 9 6 1 2. + <_> + + <_> + 9 2 2 15 -1. + <_> + 9 7 2 5 3. + <_> + + <_> + 5 6 2 2 -1. + <_> + 5 7 2 1 2. + <_> + + <_> + 6 6 8 3 -1. + <_> + 6 7 8 1 3. + <_> + + <_> + 12 13 5 6 -1. + <_> + 12 15 5 2 3. + <_> + + <_> + 0 0 20 18 -1. + <_> + 0 9 20 9 2. + <_> + + <_> + 5 1 6 6 -1. + <_> + 7 1 2 6 3. + <_> + + <_> + 5 1 4 9 -1. + <_> + 7 1 2 9 2. + <_> + + <_> + 1 19 18 1 -1. + <_> + 7 19 6 1 3. + <_> + + <_> + 14 16 5 2 -1. + <_> + 14 17 5 1 2. + <_> + + <_> + 0 5 15 10 -1. + <_> + 0 10 15 5 2. + <_> + + <_> + 7 15 4 2 -1. + <_> + 7 15 2 1 2. + <_> + 9 16 2 1 2. + <_> + + <_> + 14 11 2 2 -1. + <_> + 14 12 2 1 2. + <_> + + <_> + 9 8 3 3 -1. + <_> + 9 9 3 1 3. + <_> + + <_> + 4 11 2 2 -1. + <_> + 4 12 2 1 2. + <_> + + <_> + 8 8 3 3 -1. + <_> + 8 9 3 1 3. + <_> + + <_> + 9 10 2 3 -1. + <_> + 9 11 2 1 3. + <_> + + <_> + 8 8 4 3 -1. + <_> + 8 9 4 1 3. + <_> + + <_> + 1 9 4 10 -1. + <_> + 1 9 2 5 2. + <_> + 3 14 2 5 2. + <_> + + <_> + 0 12 6 8 -1. + <_> + 2 12 2 8 3. + <_> + + <_> + 9 1 4 2 -1. + <_> + 11 1 2 1 2. + <_> + 9 2 2 1 2. + <_> + + <_> + 12 13 7 6 -1. + <_> + 12 15 7 2 3. + <_> + + <_> + 7 0 2 3 -1. + <_> + 7 1 2 1 3. + <_> + + <_> + 7 14 6 3 -1. + <_> + 9 14 2 3 3. + <_> + + <_> + 9 6 6 4 -1. + <_> + 11 6 2 4 3. + <_> + + <_> + 8 10 8 3 -1. + <_> + 8 10 4 3 2. + <_> + + <_> + 6 10 4 3 -1. + <_> + 8 10 2 3 2. + <_> + + <_> + 6 8 3 5 -1. + <_> + 7 8 1 5 3. + <_> + + <_> + 0 4 8 1 -1. + <_> + 4 4 4 1 2. + <_> + + <_> + 8 2 2 6 -1. + <_> + 8 2 1 3 2. + <_> + 9 5 1 3 2. + <_> + + <_> + 0 7 20 6 -1. + <_> + 0 9 20 2 3. + <_> + + <_> + 12 10 3 6 -1. + <_> + 12 13 3 3 2. + <_> + + <_> + 8 15 1 4 -1. + <_> + 8 17 1 2 2. + <_> + + <_> + 5 16 2 4 -1. + <_> + 5 18 2 2 2. + <_> + + <_> + 6 2 8 12 -1. + <_> + 6 6 8 4 3. + <_> + + <_> + 4 7 12 2 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 7 0 6 1 -1. + <_> + 9 0 2 1 3. + <_> + + <_> + 8 11 3 3 -1. + <_> + 8 12 3 1 3. + <_> + + <_> + 12 11 3 6 -1. + <_> + 12 14 3 3 2. + <_> + + <_> + 11 2 6 10 -1. + <_> + 14 2 3 5 2. + <_> + 11 7 3 5 2. + <_> + + <_> + 5 7 10 12 -1. + <_> + 5 7 5 6 2. + <_> + 10 13 5 6 2. + <_> + + <_> + 4 4 2 10 -1. + <_> + 4 9 2 5 2. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 7 1 3 2. + <_> + + <_> + 11 9 6 2 -1. + <_> + 11 9 3 2 2. + <_> + + <_> + 4 7 2 2 -1. + <_> + 5 7 1 2 2. + <_> + + <_> + 0 2 4 6 -1. + <_> + 0 4 4 2 3. + <_> + + <_> + 10 7 3 4 -1. + <_> + 11 7 1 4 3. + <_> + + <_> + 9 7 3 5 -1. + <_> + 10 7 1 5 3. + <_> + + <_> + 9 1 1 3 -1. + <_> + 9 2 1 1 3. + <_> + + <_> + 0 6 16 6 -1. + <_> + 0 6 8 3 2. + <_> + 8 9 8 3 2. + <_> + + <_> + 10 15 3 3 -1. + <_> + 10 16 3 1 3. + <_> + + <_> + 9 14 4 3 -1. + <_> + 9 15 4 1 3. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 3 0 14 2 -1. + <_> + 3 1 14 1 2. + <_> + + <_> + 9 14 3 3 -1. + <_> + 9 15 3 1 3. + <_> + + <_> + 10 15 3 3 -1. + <_> + 10 16 3 1 3. + <_> + + <_> + 9 13 2 6 -1. + <_> + 9 16 2 3 2. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 12 11 3 6 -1. + <_> + 12 14 3 3 2. + <_> + + <_> + 8 12 5 2 -1. + <_> + 8 13 5 1 2. + <_> + + <_> + 5 11 3 6 -1. + <_> + 5 14 3 3 2. + <_> + + <_> + 8 12 3 2 -1. + <_> + 8 13 3 1 2. + <_> + + <_> + 11 13 7 6 -1. + <_> + 11 15 7 2 3. + <_> + + <_> + 7 14 6 3 -1. + <_> + 7 15 6 1 3. + <_> + + <_> + 3 13 14 4 -1. + <_> + 3 13 7 2 2. + <_> + 10 15 7 2 2. + <_> + + <_> + 8 14 4 6 -1. + <_> + 8 14 2 3 2. + <_> + 10 17 2 3 2. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 7 16 6 2 -1. + <_> + 9 16 2 2 3. + <_> + + <_> + 7 7 6 2 -1. + <_> + 7 8 6 1 2. + <_> + + <_> + 3 9 13 3 -1. + <_> + 3 10 13 1 3. + <_> + + <_> + 9 8 3 4 -1. + <_> + 9 10 3 2 2. + <_> + + <_> + 8 10 4 3 -1. + <_> + 8 11 4 1 3. + <_> + + <_> + 7 7 3 4 -1. + <_> + 8 7 1 4 3. + <_> + + <_> + 8 7 3 5 -1. + <_> + 9 7 1 5 3. + <_> + + <_> + 12 3 3 4 -1. + <_> + 13 3 1 4 3. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 7 1 3 2. + <_> + + <_> + 5 3 3 4 -1. + <_> + 6 3 1 4 3. + <_> + + <_> + 3 7 12 1 -1. + <_> + 7 7 4 1 3. + <_> + + <_> + 12 5 3 3 -1. + <_> + 12 6 3 1 3. + <_> + + <_> + 11 2 6 2 -1. + <_> + 11 3 6 1 2. + <_> + + <_> + 3 2 14 2 -1. + <_> + 3 2 7 1 2. + <_> + 10 3 7 1 2. + <_> + + <_> + 6 1 7 14 -1. + <_> + 6 8 7 7 2. + <_> + + <_> + 8 0 12 5 -1. + <_> + 8 0 6 5 2. + <_> + + <_> + 1 9 18 1 -1. + <_> + 7 9 6 1 3. + <_> + + <_> + 0 0 10 5 -1. + <_> + 5 0 5 5 2. + <_> + + <_> + 2 5 8 15 -1. + <_> + 2 10 8 5 3. + <_> + + <_> + 12 5 3 3 -1. + <_> + 12 6 3 1 3. + <_> + + <_> + 13 4 2 3 -1. + <_> + 13 5 2 1 3. + <_> + + <_> + 2 15 4 3 -1. + <_> + 2 16 4 1 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 10 6 5 3 2. + <_> + + <_> + 11 6 2 2 -1. + <_> + 12 6 1 1 2. + <_> + 11 7 1 1 2. + <_> + + <_> + 12 4 4 3 -1. + <_> + 12 5 4 1 3. + <_> + + <_> + 7 6 2 2 -1. + <_> + 7 6 1 1 2. + <_> + 8 7 1 1 2. + <_> + + <_> + 4 4 4 3 -1. + <_> + 4 5 4 1 3. + <_> + + <_> + 11 4 3 3 -1. + <_> + 12 4 1 3 3. + <_> + + <_> + 9 3 2 1 -1. + <_> + 9 3 1 1 2. + <_> + + <_> + 4 5 5 3 -1. + <_> + 4 6 5 1 3. + <_> + + <_> + 4 6 4 3 -1. + <_> + 4 7 4 1 3. + <_> + + <_> + 11 4 3 3 -1. + <_> + 12 4 1 3 3. + <_> + + <_> + 8 8 4 3 -1. + <_> + 8 9 4 1 3. + <_> + + <_> + 6 4 3 3 -1. + <_> + 7 4 1 3 3. + <_> + + <_> + 4 14 1 3 -1. + <_> + 4 15 1 1 3. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 7 1 3 2. + <_> + + <_> + 17 0 3 2 -1. + <_> + 17 1 3 1 2. + <_> + + <_> + 8 10 2 9 -1. + <_> + 8 13 2 3 3. + <_> + + <_> + 0 8 18 2 -1. + <_> + 0 9 18 1 2. + <_> + + <_> + 9 15 2 3 -1. + <_> + 9 16 2 1 3. + <_> + + <_> + 8 7 4 3 -1. + <_> + 8 8 4 1 3. + <_> + + <_> + 1 14 6 6 -1. + <_> + 1 14 3 3 2. + <_> + 4 17 3 3 2. + <_> + + <_> + 0 18 6 2 -1. + <_> + 0 19 6 1 2. + <_> + + <_> + 12 9 4 3 -1. + <_> + 12 9 2 3 2. + <_> + + <_> + 9 8 3 8 -1. + <_> + 10 8 1 8 3. + <_> + + <_> + 4 9 4 3 -1. + <_> + 6 9 2 3 2. + <_> + + <_> + 4 18 6 1 -1. + <_> + 6 18 2 1 3. + <_> + + <_> + 9 7 3 2 -1. + <_> + 10 7 1 2 3. + <_> + + <_> + 6 7 8 12 -1. + <_> + 10 7 4 6 2. + <_> + 6 13 4 6 2. + <_> + + <_> + 8 7 3 2 -1. + <_> + 9 7 1 2 3. + <_> + + <_> + 8 7 3 6 -1. + <_> + 9 7 1 6 3. + <_> + + <_> + 3 16 14 4 -1. + <_> + 10 16 7 2 2. + <_> + 3 18 7 2 2. + <_> + + <_> + 1 14 18 4 -1. + <_> + 10 14 9 2 2. + <_> + 1 16 9 2 2. + <_> + + <_> + 8 7 3 3 -1. + <_> + 8 8 3 1 3. + <_> + + <_> + 0 4 20 12 -1. + <_> + 0 4 10 6 2. + <_> + 10 10 10 6 2. + <_> + + <_> + 5 5 10 12 -1. + <_> + 10 5 5 6 2. + <_> + 5 11 5 6 2. + <_> + + <_> + 10 2 4 7 -1. + <_> + 10 2 2 7 2. + <_> + + <_> + 8 11 4 3 -1. + <_> + 8 12 4 1 3. + <_> + + <_> + 8 12 3 3 -1. + <_> + 8 13 3 1 3. + <_> + + <_> + 13 13 5 6 -1. + <_> + 13 15 5 2 3. + <_> + + <_> + 7 0 6 6 -1. + <_> + 9 0 2 6 3. + <_> + + <_> + 2 13 5 6 -1. + <_> + 2 15 5 2 3. + <_> + + <_> + 0 4 2 12 -1. + <_> + 0 4 1 6 2. + <_> + 1 10 1 6 2. + <_> + + <_> + 9 19 3 1 -1. + <_> + 10 19 1 1 3. + <_> + + <_> + 18 0 2 6 -1. + <_> + 18 2 2 2 3. + <_> + + <_> + 0 3 1 6 -1. + <_> + 0 5 1 2 3. + <_> + + <_> + 0 0 3 6 -1. + <_> + 0 2 3 2 3. + <_> + + <_> + 17 2 3 7 -1. + <_> + 18 2 1 7 3. + <_> + + <_> + 10 3 4 7 -1. + <_> + 10 3 2 7 2. + <_> + + <_> + 0 2 3 7 -1. + <_> + 1 2 1 7 3. + <_> + + <_> + 6 2 4 8 -1. + <_> + 8 2 2 8 2. + <_> + + <_> + 13 0 1 4 -1. + <_> + 13 2 1 2 2. + <_> + + <_> + 5 1 12 5 -1. + <_> + 9 1 4 5 3. + <_> + + <_> + 6 0 1 4 -1. + <_> + 6 2 1 2 2. + <_> + + <_> + 3 1 12 5 -1. + <_> + 7 1 4 5 3. + <_> + + <_> + 9 12 3 8 -1. + <_> + 10 12 1 8 3. + <_> + + <_> + 7 13 6 1 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 7 14 6 3 -1. + <_> + 7 15 6 1 3. + <_> + + <_> + 5 16 7 3 -1. + <_> + 5 17 7 1 3. + <_> + + <_> + 0 12 20 6 -1. + <_> + 0 14 20 2 3. + <_> + + <_> + 4 18 14 2 -1. + <_> + 4 19 14 1 2. + <_> + + <_> + 8 12 3 8 -1. + <_> + 9 12 1 8 3. + <_> + + <_> + 7 13 3 3 -1. + <_> + 7 14 3 1 3. + <_> + + <_> + 5 5 12 10 -1. + <_> + 11 5 6 5 2. + <_> + 5 10 6 5 2. + <_> + + <_> + 8 1 5 10 -1. + <_> + 8 6 5 5 2. + <_> + + <_> + 5 4 9 12 -1. + <_> + 5 10 9 6 2. + <_> + + <_> + 7 13 6 6 -1. + <_> + 7 15 6 2 3. + <_> + + <_> + 8 4 5 16 -1. + <_> + 8 12 5 8 2. + <_> + + <_> + 8 12 4 6 -1. + <_> + 8 15 4 3 2. + <_> + + <_> + 7 13 2 2 -1. + <_> + 7 13 1 1 2. + <_> + 8 14 1 1 2. + <_> + + <_> + 7 12 2 2 -1. + <_> + 7 12 1 1 2. + <_> + 8 13 1 1 2. + <_> + + <_> + 18 0 2 14 -1. + <_> + 18 0 1 14 2. + <_> + + <_> + 12 11 7 2 -1. + <_> + 12 12 7 1 2. + <_> + + <_> + 1 18 1 2 -1. + <_> + 1 19 1 1 2. + <_> + + <_> + 2 18 1 2 -1. + <_> + 2 19 1 1 2. + <_> + + <_> + 9 7 2 1 -1. + <_> + 9 7 1 1 2. + <_> + + <_> + 9 6 2 3 -1. + <_> + 9 6 1 3 2. + <_> + + <_> + 3 1 2 2 -1. + <_> + 4 1 1 2 2. + <_> + + <_> + 3 0 3 2 -1. + <_> + 3 1 3 1 2. + <_> + + <_> + 12 10 3 4 -1. + <_> + 12 12 3 2 2. + <_> + + <_> + 7 7 8 2 -1. + <_> + 7 8 8 1 2. + <_> + + <_> + 8 8 3 4 -1. + <_> + 8 10 3 2 2. + <_> + + <_> + 7 12 6 3 -1. + <_> + 7 13 6 1 3. + <_> + + <_> + 0 2 10 3 -1. + <_> + 5 2 5 3 2. + <_> + + <_> + 0 1 20 6 -1. + <_> + 0 3 20 2 3. + <_> + + <_> + 7 6 6 3 -1. + <_> + 9 6 2 3 3. + <_> + + <_> + 3 7 14 4 -1. + <_> + 3 9 14 2 2. + <_> + + <_> + 5 7 3 6 -1. + <_> + 5 9 3 2 3. + <_> + + <_> + 8 8 3 12 -1. + <_> + 8 12 3 4 3. + <_> + + <_> + 9 17 6 2 -1. + <_> + 12 17 3 1 2. + <_> + 9 18 3 1 2. + <_> + + <_> + 10 17 4 3 -1. + <_> + 10 18 4 1 3. + <_> + + <_> + 4 2 4 2 -1. + <_> + 4 3 4 1 2. + <_> + + <_> + 7 3 6 14 -1. + <_> + 9 3 2 14 3. + <_> + + <_> + 15 13 1 6 -1. + <_> + 15 16 1 3 2. + <_> + + <_> + 13 14 2 6 -1. + <_> + 13 16 2 2 3. + <_> + + <_> + 4 11 5 6 -1. + <_> + 4 14 5 3 2. + <_> + + <_> + 4 17 4 2 -1. + <_> + 6 17 2 2 2. + <_> + + <_> + 0 6 20 2 -1. + <_> + 0 6 10 2 2. + <_> + + <_> + 6 5 10 12 -1. + <_> + 11 5 5 6 2. + <_> + 6 11 5 6 2. + <_> + + <_> + 4 0 2 12 -1. + <_> + 4 0 1 6 2. + <_> + 5 6 1 6 2. + <_> + + <_> + 4 1 6 2 -1. + <_> + 6 1 2 2 3. + <_> + + <_> + 13 7 2 1 -1. + <_> + 13 7 1 1 2. + <_> + + <_> + 5 5 15 6 -1. + <_> + 5 7 15 2 3. + <_> + + <_> + 1 10 18 2 -1. + <_> + 1 10 9 1 2. + <_> + 10 11 9 1 2. + <_> + + <_> + 1 6 15 7 -1. + <_> + 6 6 5 7 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 9 14 3 3 -1. + <_> + 9 15 3 1 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 8 13 3 2 -1. + <_> + 8 14 3 1 2. + <_> + + <_> + 15 14 5 3 -1. + <_> + 15 15 5 1 3. + <_> + + <_> + 0 14 20 1 -1. + <_> + 0 14 10 1 2. + <_> + + <_> + 0 14 6 3 -1. + <_> + 0 15 6 1 3. + <_> + + <_> + 5 3 4 2 -1. + <_> + 5 4 4 1 2. + <_> + + <_> + 0 6 20 1 -1. + <_> + 0 6 10 1 2. + <_> + + <_> + 6 3 10 14 -1. + <_> + 11 3 5 7 2. + <_> + 6 10 5 7 2. + <_> + + <_> + 8 12 4 2 -1. + <_> + 8 13 4 1 2. + <_> + + <_> + 6 3 8 6 -1. + <_> + 6 3 4 3 2. + <_> + 10 6 4 3 2. + <_> + + <_> + 13 7 2 1 -1. + <_> + 13 7 1 1 2. + <_> + + <_> + 6 3 10 14 -1. + <_> + 11 3 5 7 2. + <_> + 6 10 5 7 2. + <_> + + <_> + 5 7 2 1 -1. + <_> + 6 7 1 1 2. + <_> + + <_> + 4 3 10 14 -1. + <_> + 4 3 5 7 2. + <_> + 9 10 5 7 2. + <_> + + <_> + 9 7 2 2 -1. + <_> + 9 7 1 2 2. + <_> + + <_> + 0 3 20 1 -1. + <_> + 0 3 10 1 2. + <_> + + <_> + 2 1 10 3 -1. + <_> + 2 2 10 1 3. + <_> + + <_> + 9 7 2 2 -1. + <_> + 10 7 1 2 2. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 9 7 3 6 -1. + <_> + 10 7 1 6 3. + <_> + + <_> + 8 17 3 2 -1. + <_> + 9 17 1 2 3. + <_> + + <_> + 8 7 3 6 -1. + <_> + 9 7 1 6 3. + <_> + + <_> + 16 3 4 6 -1. + <_> + 16 5 4 2 3. + <_> + + <_> + 15 6 2 12 -1. + <_> + 16 6 1 6 2. + <_> + 15 12 1 6 2. + <_> + + <_> + 1 4 18 10 -1. + <_> + 1 4 9 5 2. + <_> + 10 9 9 5 2. + <_> + + <_> + 9 4 2 4 -1. + <_> + 9 6 2 2 2. + <_> + + <_> + 12 5 3 2 -1. + <_> + 12 6 3 1 2. + <_> + + <_> + 5 12 10 4 -1. + <_> + 5 14 10 2 2. + <_> + + <_> + 5 5 3 2 -1. + <_> + 5 6 3 1 2. + <_> + + <_> + 4 6 12 6 -1. + <_> + 8 6 4 6 3. + <_> + + <_> + 14 4 6 6 -1. + <_> + 14 6 6 2 3. + <_> + + <_> + 16 0 4 6 -1. + <_> + 18 0 2 3 2. + <_> + 16 3 2 3 2. + <_> + + <_> + 0 4 6 6 -1. + <_> + 0 6 6 2 3. + <_> + + <_> + 0 0 4 6 -1. + <_> + 0 0 2 3 2. + <_> + 2 3 2 3 2. + <_> + + <_> + 12 0 8 5 -1. + <_> + 12 0 4 5 2. + <_> + + <_> + 16 0 4 17 -1. + <_> + 16 0 2 17 2. + <_> + + <_> + 1 0 18 20 -1. + <_> + 7 0 6 20 3. + <_> + + <_> + 6 0 2 5 -1. + <_> + 7 0 1 5 2. + <_> + + <_> + 0 6 20 1 -1. + <_> + 0 6 10 1 2. + <_> + + <_> + 8 7 6 4 -1. + <_> + 10 7 2 4 3. + <_> + + <_> + 1 1 16 4 -1. + <_> + 1 1 8 2 2. + <_> + 9 3 8 2 2. + <_> + + <_> + 7 2 4 2 -1. + <_> + 7 2 2 1 2. + <_> + 9 3 2 1 2. + <_> + + <_> + 7 4 9 3 -1. + <_> + 7 5 9 1 3. + <_> + + <_> + 10 4 5 12 -1. + <_> + 10 10 5 6 2. + <_> + + <_> + 3 12 2 3 -1. + <_> + 3 13 2 1 3. + <_> + + <_> + 8 8 3 5 -1. + <_> + 9 8 1 5 3. + <_> + + <_> + 13 9 2 3 -1. + <_> + 13 9 1 3 2. + <_> + + <_> + 15 11 2 2 -1. + <_> + 15 12 2 1 2. + <_> + + <_> + 5 6 2 3 -1. + <_> + 5 7 2 1 3. + <_> + + <_> + 2 11 6 2 -1. + <_> + 2 12 6 1 2. + <_> + + <_> + 15 11 4 3 -1. + <_> + 15 12 4 1 3. + <_> + + <_> + 16 0 4 17 -1. + <_> + 16 0 2 17 2. + <_> + + <_> + 1 11 4 3 -1. + <_> + 1 12 4 1 3. + <_> + + <_> + 9 11 1 3 -1. + <_> + 9 12 1 1 3. + <_> + + <_> + 10 9 6 7 -1. + <_> + 10 9 3 7 2. + <_> + + <_> + 8 15 4 2 -1. + <_> + 8 16 4 1 2. + <_> + + <_> + 4 9 6 7 -1. + <_> + 7 9 3 7 2. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 0 2 20 2 -1. + <_> + 10 2 10 1 2. + <_> + 0 3 10 1 2. + <_> + + <_> + 6 7 8 2 -1. + <_> + 6 8 8 1 2. + <_> + + <_> + 0 2 20 2 -1. + <_> + 0 2 10 1 2. + <_> + 10 3 10 1 2. + <_> + + <_> + 3 1 2 10 -1. + <_> + 3 1 1 5 2. + <_> + 4 6 1 5 2. + <_> + + <_> + 13 4 1 10 -1. + <_> + 13 9 1 5 2. + <_> + + <_> + 9 8 4 3 -1. + <_> + 9 9 4 1 3. + <_> + + <_> + 2 11 16 4 -1. + <_> + 2 11 8 2 2. + <_> + 10 13 8 2 2. + <_> + + <_> + 5 1 3 5 -1. + <_> + 6 1 1 5 3. + <_> + + <_> + 9 10 2 3 -1. + <_> + 9 11 2 1 3. + <_> + + <_> + 9 11 2 2 -1. + <_> + 9 12 2 1 2. + <_> + + <_> + 0 10 20 2 -1. + <_> + 0 11 20 1 2. + <_> + + <_> + 1 7 6 4 -1. + <_> + 1 7 3 2 2. + <_> + 4 9 3 2 2. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 14 1 6 4 -1. + <_> + 16 1 2 4 3. + <_> + + <_> + 6 3 2 14 -1. + <_> + 6 10 2 7 2. + <_> + + <_> + 6 1 7 12 -1. + <_> + 6 7 7 6 2. + <_> + + <_> + 5 0 15 5 -1. + <_> + 10 0 5 5 3. + <_> + + <_> + 15 0 4 10 -1. + <_> + 15 0 2 10 2. + <_> + + <_> + 1 0 18 3 -1. + <_> + 7 0 6 3 3. + <_> + + <_> + 0 0 17 2 -1. + <_> + 0 1 17 1 2. + <_> + + <_> + 10 0 3 3 -1. + <_> + 11 0 1 3 3. + <_> + + <_> + 10 0 3 12 -1. + <_> + 11 0 1 12 3. + <_> + + <_> + 1 3 4 16 -1. + <_> + 1 3 2 8 2. + <_> + 3 11 2 8 2. + <_> + + <_> + 7 0 3 3 -1. + <_> + 8 0 1 3 3. + <_> + + <_> + 9 13 2 6 -1. + <_> + 9 16 2 3 2. + <_> + + <_> + 9 0 6 13 -1. + <_> + 11 0 2 13 3. + <_> + + <_> + 7 7 3 2 -1. + <_> + 8 7 1 2 3. + <_> + + <_> + 8 2 1 12 -1. + <_> + 8 6 1 4 3. + <_> + + <_> + 4 10 12 6 -1. + <_> + 10 10 6 3 2. + <_> + 4 13 6 3 2. + <_> + + <_> + 13 5 2 3 -1. + <_> + 13 6 2 1 3. + <_> + + <_> + 4 10 12 6 -1. + <_> + 4 10 6 3 2. + <_> + 10 13 6 3 2. + <_> + + <_> + 5 5 2 3 -1. + <_> + 5 6 2 1 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 9 6 2 4 -1. + <_> + 9 6 1 4 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 9 6 2 4 -1. + <_> + 10 6 1 4 2. + <_> + + <_> + 12 9 2 3 -1. + <_> + 12 9 1 3 2. + <_> + + <_> + 0 6 20 1 -1. + <_> + 0 6 10 1 2. + <_> + + <_> + 5 7 10 2 -1. + <_> + 10 7 5 2 2. + <_> + + <_> + 1 16 4 3 -1. + <_> + 1 17 4 1 3. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 10 3 5 3 -1. + <_> + 10 4 5 1 3. + <_> + + <_> + 3 9 14 8 -1. + <_> + 3 9 7 4 2. + <_> + 10 13 7 4 2. + <_> + + <_> + 6 8 8 10 -1. + <_> + 6 8 4 5 2. + <_> + 10 13 4 5 2. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 10 3 5 3 -1. + <_> + 10 4 5 1 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 5 3 5 3 -1. + <_> + 5 4 5 1 3. + <_> + + <_> + 13 16 2 3 -1. + <_> + 13 17 2 1 3. + <_> + + <_> + 0 5 20 6 -1. + <_> + 0 7 20 2 3. + <_> + + <_> + 3 14 3 3 -1. + <_> + 3 15 3 1 3. + <_> + + <_> + 7 15 5 3 -1. + <_> + 7 16 5 1 3. + <_> + + <_> + 12 9 2 3 -1. + <_> + 12 9 1 3 2. + <_> + + <_> + 15 13 2 6 -1. + <_> + 15 13 1 6 2. + <_> + + <_> + 6 9 2 3 -1. + <_> + 7 9 1 3 2. + <_> + + <_> + 3 13 2 6 -1. + <_> + 4 13 1 6 2. + <_> + + <_> + 11 4 2 4 -1. + <_> + 11 4 1 4 2. + <_> + + <_> + 13 4 2 5 -1. + <_> + 13 4 1 5 2. + <_> + + <_> + 7 4 2 4 -1. + <_> + 8 4 1 4 2. + <_> + + <_> + 5 4 2 5 -1. + <_> + 6 4 1 5 2. + <_> + + <_> + 19 6 1 2 -1. + <_> + 19 7 1 1 2. + <_> + + <_> + 12 7 8 13 -1. + <_> + 12 7 4 13 2. + <_> + + <_> + 0 6 1 2 -1. + <_> + 0 7 1 1 2. + <_> + + <_> + 6 15 4 3 -1. + <_> + 6 16 4 1 3. + <_> + + <_> + 11 8 2 2 -1. + <_> + 11 9 2 1 2. + <_> + + <_> + 11 7 2 4 -1. + <_> + 11 7 1 4 2. + <_> + + <_> + 4 13 2 3 -1. + <_> + 4 14 2 1 3. + <_> + + <_> + 0 17 18 3 -1. + <_> + 6 17 6 3 3. + <_> + + <_> + 1 0 18 5 -1. + <_> + 7 0 6 5 3. + <_> + + <_> + 5 7 3 4 -1. + <_> + 5 9 3 2 2. + <_> + + <_> + 10 6 2 2 -1. + <_> + 10 6 1 2 2. + <_> + + <_> + 6 4 14 4 -1. + <_> + 13 4 7 2 2. + <_> + 6 6 7 2 2. + <_> + + <_> + 5 16 6 4 -1. + <_> + 5 16 3 2 2. + <_> + 8 18 3 2 2. + <_> + + <_> + 7 15 2 4 -1. + <_> + 7 17 2 2 2. + <_> + + <_> + 8 5 5 14 -1. + <_> + 8 12 5 7 2. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 7 5 3 7 -1. + <_> + 8 5 1 7 3. + <_> + + <_> + 0 0 3 9 -1. + <_> + 0 3 3 3 3. + <_> + + <_> + 8 6 8 8 -1. + <_> + 12 6 4 4 2. + <_> + 8 10 4 4 2. + <_> + + <_> + 4 8 13 2 -1. + <_> + 4 9 13 1 2. + <_> + + <_> + 4 3 6 1 -1. + <_> + 6 3 2 1 3. + <_> + + <_> + 9 1 2 6 -1. + <_> + 9 3 2 2 3. + <_> + + <_> + 10 5 6 4 -1. + <_> + 12 5 2 4 3. + <_> + + <_> + 9 5 2 12 -1. + <_> + 9 9 2 4 3. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 8 12 4 3 -1. + <_> + 8 13 4 1 3. + <_> + + <_> + 10 3 6 7 -1. + <_> + 12 3 2 7 3. + <_> + + <_> + 3 10 16 6 -1. + <_> + 3 12 16 2 3. + <_> + + <_> + 5 5 3 10 -1. + <_> + 5 10 3 5 2. + <_> + + <_> + 6 10 3 6 -1. + <_> + 6 13 3 3 2. + <_> + + <_> + 17 2 2 12 -1. + <_> + 17 2 1 12 2. + <_> + + <_> + 16 6 2 14 -1. + <_> + 16 13 2 7 2. + <_> + + <_> + 3 11 12 9 -1. + <_> + 3 14 12 3 3. + <_> + + <_> + 0 2 4 12 -1. + <_> + 2 2 2 12 2. + <_> + + <_> + 18 0 2 18 -1. + <_> + 18 0 1 18 2. + <_> + + <_> + 16 12 3 2 -1. + <_> + 16 13 3 1 2. + <_> + + <_> + 0 2 2 15 -1. + <_> + 1 2 1 15 2. + <_> + + <_> + 1 10 2 4 -1. + <_> + 1 12 2 2 2. + <_> + + <_> + 11 1 2 18 -1. + <_> + 11 1 1 18 2. + <_> + + <_> + 3 2 14 2 -1. + <_> + 10 2 7 1 2. + <_> + 3 3 7 1 2. + <_> + + <_> + 7 1 2 18 -1. + <_> + 8 1 1 18 2. + <_> + + <_> + 6 1 8 12 -1. + <_> + 6 7 8 6 2. + <_> + + <_> + 8 14 4 3 -1. + <_> + 8 15 4 1 3. + <_> + + <_> + 7 14 6 3 -1. + <_> + 7 15 6 1 3. + <_> + + <_> + 0 13 5 2 -1. + <_> + 0 14 5 1 2. + <_> + + <_> + 9 0 2 6 -1. + <_> + 9 0 1 3 2. + <_> + 10 3 1 3 2. + <_> + + <_> + 9 0 2 6 -1. + <_> + 10 0 1 3 2. + <_> + 9 3 1 3 2. + <_> + + <_> + 9 7 3 6 -1. + <_> + 10 7 1 6 3. + <_> + + <_> + 9 0 2 6 -1. + <_> + 9 0 1 3 2. + <_> + 10 3 1 3 2. + <_> + + <_> + 8 7 3 6 -1. + <_> + 9 7 1 6 3. + <_> + + <_> + 9 6 2 6 -1. + <_> + 9 6 1 6 2. + <_> + + <_> + 9 4 4 3 -1. + <_> + 9 4 2 3 2. + <_> + + <_> + 0 4 4 3 -1. + <_> + 0 5 4 1 3. + <_> + + <_> + 8 7 4 2 -1. + <_> + 8 8 4 1 2. + <_> + + <_> + 10 6 6 3 -1. + <_> + 12 6 2 3 3. + <_> + + <_> + 9 6 3 12 -1. + <_> + 9 10 3 4 3. + <_> + + <_> + 5 4 2 3 -1. + <_> + 5 5 2 1 3. + <_> + + <_> + 5 6 1 3 -1. + <_> + 5 7 1 1 3. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 0 7 20 2 -1. + <_> + 0 8 20 1 2. + <_> + + <_> + 4 3 6 7 -1. + <_> + 6 3 2 7 3. + <_> + + <_> + 5 10 6 10 -1. + <_> + 5 10 3 5 2. + <_> + 8 15 3 5 2. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 9 10 2 2 -1. + <_> + 9 11 2 1 2. + <_> + + <_> + 8 17 3 2 -1. + <_> + 9 17 1 2 3. + <_> + + <_> + 5 6 1 3 -1. + <_> + 5 7 1 1 3. + <_> + + <_> + 0 1 20 2 -1. + <_> + 10 1 10 1 2. + <_> + 0 2 10 1 2. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 5 3 3 2 -1. + <_> + 5 4 3 1 2. + <_> + + <_> + 5 4 4 2 -1. + <_> + 7 4 2 2 2. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 0 12 20 6 -1. + <_> + 0 14 20 2 3. + <_> + + <_> + 2 2 16 4 -1. + <_> + 2 2 8 2 2. + <_> + 10 4 8 2 2. + <_> + + <_> + 7 12 5 3 -1. + <_> + 7 13 5 1 3. + <_> + + <_> + 14 9 6 10 -1. + <_> + 14 9 3 10 2. + <_> + + <_> + 16 6 3 2 -1. + <_> + 16 7 3 1 2. + <_> + + <_> + 0 9 6 10 -1. + <_> + 3 9 3 10 2. + <_> + + <_> + 0 16 5 2 -1. + <_> + 0 17 5 1 2. + <_> + + <_> + 9 12 2 3 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 9 7 2 12 -1. + <_> + 9 11 2 4 3. + <_> + + <_> + 3 2 6 2 -1. + <_> + 5 2 2 2 3. + <_> + + <_> + 4 1 1 2 -1. + <_> + 4 2 1 1 2. + <_> + + <_> + 11 15 1 2 -1. + <_> + 11 16 1 1 2. + <_> + + <_> + 3 1 16 2 -1. + <_> + 11 1 8 1 2. + <_> + 3 2 8 1 2. + <_> + + <_> + 3 6 2 2 -1. + <_> + 3 6 1 1 2. + <_> + 4 7 1 1 2. + <_> + + <_> + 5 11 10 6 -1. + <_> + 5 11 5 3 2. + <_> + 10 14 5 3 2. + <_> + + <_> + 10 11 4 6 -1. + <_> + 10 14 4 3 2. + <_> + + <_> + 14 9 6 11 -1. + <_> + 16 9 2 11 3. + <_> + + <_> + 0 9 6 11 -1. + <_> + 2 9 2 11 3. + <_> + + <_> + 2 11 16 6 -1. + <_> + 2 11 8 3 2. + <_> + 10 14 8 3 2. + <_> + + <_> + 12 0 8 10 -1. + <_> + 16 0 4 5 2. + <_> + 12 5 4 5 2. + <_> + + <_> + 14 2 6 4 -1. + <_> + 16 2 2 4 3. + <_> + + <_> + 0 0 8 10 -1. + <_> + 0 0 4 5 2. + <_> + 4 5 4 5 2. + <_> + + <_> + 0 2 6 4 -1. + <_> + 2 2 2 4 3. + <_> + + <_> + 4 9 15 2 -1. + <_> + 9 9 5 2 3. + <_> + + <_> + 12 3 4 8 -1. + <_> + 14 3 2 4 2. + <_> + 12 7 2 4 2. + <_> + + <_> + 9 2 2 9 -1. + <_> + 10 2 1 9 2. + <_> + + <_> + 0 2 20 1 -1. + <_> + 10 2 10 1 2. + <_> + + <_> + 16 1 4 5 -1. + <_> + 16 1 2 5 2. + <_> + + <_> + 16 0 4 6 -1. + <_> + 16 3 4 3 2. + <_> + + <_> + 4 3 6 4 -1. + <_> + 6 3 2 4 3. + <_> + + <_> + 0 0 18 5 -1. + <_> + 6 0 6 5 3. + <_> + + <_> + 6 2 12 14 -1. + <_> + 12 2 6 7 2. + <_> + 6 9 6 7 2. + <_> + + <_> + 11 8 3 5 -1. + <_> + 12 8 1 5 3. + <_> + + <_> + 5 12 2 2 -1. + <_> + 5 13 2 1 2. + <_> + + <_> + 5 10 4 3 -1. + <_> + 7 10 2 3 2. + <_> + + <_> + 4 9 15 2 -1. + <_> + 9 9 5 2 3. + <_> + + <_> + 10 7 6 2 -1. + <_> + 12 7 2 2 3. + <_> + + <_> + 1 9 15 2 -1. + <_> + 6 9 5 2 3. + <_> + + <_> + 5 0 2 10 -1. + <_> + 5 0 1 5 2. + <_> + 6 5 1 5 2. + <_> + + <_> + 0 0 20 14 -1. + <_> + 0 7 20 7 2. + <_> + + <_> + 12 7 8 4 -1. + <_> + 12 7 4 4 2. + <_> + + <_> + 0 7 8 4 -1. + <_> + 4 7 4 4 2. + <_> + + <_> + 8 1 3 3 -1. + <_> + 9 1 1 3 3. + <_> + + <_> + 9 7 3 4 -1. + <_> + 10 7 1 4 3. + <_> + + <_> + 9 9 3 1 -1. + <_> + 10 9 1 1 3. + <_> + + <_> + 8 9 3 2 -1. + <_> + 8 10 3 1 2. + <_> + + <_> + 8 4 2 8 -1. + <_> + 8 4 1 4 2. + <_> + 9 8 1 4 2. + <_> + + <_> + 5 8 12 3 -1. + <_> + 5 9 12 1 3. + <_> + + <_> + 11 14 1 3 -1. + <_> + 11 15 1 1 3. + <_> + + <_> + 6 10 3 6 -1. + <_> + 6 12 3 2 3. + <_> + + <_> + 4 17 8 3 -1. + <_> + 4 18 8 1 3. + <_> + + <_> + 17 6 2 3 -1. + <_> + 17 7 2 1 3. + <_> + + <_> + 9 12 2 2 -1. + <_> + 10 12 1 1 2. + <_> + 9 13 1 1 2. + <_> + + <_> + 9 13 2 4 -1. + <_> + 9 13 1 2 2. + <_> + 10 15 1 2 2. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 5 5 12 10 -1. + <_> + 11 5 6 5 2. + <_> + 5 10 6 5 2. + <_> + + <_> + 6 3 12 12 -1. + <_> + 12 3 6 6 2. + <_> + 6 9 6 6 2. + <_> + + <_> + 5 7 2 2 -1. + <_> + 5 7 1 1 2. + <_> + 6 8 1 1 2. + <_> + + <_> + 4 3 3 2 -1. + <_> + 5 3 1 2 3. + <_> + + <_> + 6 2 12 14 -1. + <_> + 12 2 6 7 2. + <_> + 6 9 6 7 2. + <_> + + <_> + 5 2 12 3 -1. + <_> + 9 2 4 3 3. + <_> + + <_> + 1 1 18 17 -1. + <_> + 7 1 6 17 3. + <_> + + <_> + 0 9 10 1 -1. + <_> + 5 9 5 1 2. + <_> + + <_> + 16 8 4 3 -1. + <_> + 16 9 4 1 3. + <_> + + <_> + 7 13 6 6 -1. + <_> + 7 16 6 3 2. + <_> + + <_> + 6 14 1 6 -1. + <_> + 6 16 1 2 3. + <_> + + <_> + 6 17 4 2 -1. + <_> + 6 18 4 1 2. + <_> + + <_> + 10 18 6 2 -1. + <_> + 13 18 3 1 2. + <_> + 10 19 3 1 2. + <_> + + <_> + 16 8 1 3 -1. + <_> + 16 9 1 1 3. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 9 15 1 2 -1. + <_> + 9 16 1 1 2. + <_> + + <_> + 13 0 3 12 -1. + <_> + 14 0 1 12 3. + <_> + + <_> + 15 11 1 3 -1. + <_> + 15 12 1 1 3. + <_> + + <_> + 8 15 3 3 -1. + <_> + 8 16 3 1 3. + <_> + + <_> + 4 0 3 12 -1. + <_> + 5 0 1 12 3. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 7 1 3 3. + <_> + + <_> + 9 9 3 1 -1. + <_> + 10 9 1 1 3. + <_> + + <_> + 2 2 12 14 -1. + <_> + 2 2 6 7 2. + <_> + 8 9 6 7 2. + <_> + + <_> + 4 2 12 3 -1. + <_> + 8 2 4 3 3. + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 18 1 2 2. + <_> + + <_> + 17 2 3 8 -1. + <_> + 18 2 1 8 3. + <_> + + <_> + 0 18 2 2 -1. + <_> + 1 18 1 2 2. + <_> + + <_> + 6 11 2 6 -1. + <_> + 6 14 2 3 2. + <_> + + <_> + 13 10 5 6 -1. + <_> + 13 12 5 2 3. + <_> + + <_> + 5 8 15 3 -1. + <_> + 5 9 15 1 3. + <_> + + <_> + 2 10 5 6 -1. + <_> + 2 12 5 2 3. + <_> + + <_> + 0 8 15 3 -1. + <_> + 0 9 15 1 3. + <_> + + <_> + 16 2 3 1 -1. + <_> + 17 2 1 1 3. + <_> + + <_> + 17 4 3 2 -1. + <_> + 18 4 1 2 3. + <_> + + <_> + 0 8 8 12 -1. + <_> + 0 8 4 6 2. + <_> + 4 14 4 6 2. + <_> + + <_> + 1 7 8 6 -1. + <_> + 1 7 4 3 2. + <_> + 5 10 4 3 2. + <_> + + <_> + 14 1 6 2 -1. + <_> + 16 1 2 2 3. + <_> + + <_> + 15 0 4 4 -1. + <_> + 17 0 2 2 2. + <_> + 15 2 2 2 2. + <_> + + <_> + 1 1 4 11 -1. + <_> + 3 1 2 11 2. + <_> + + <_> + 5 5 1 8 -1. + <_> + 5 9 1 4 2. + <_> + + <_> + 7 7 6 1 -1. + <_> + 9 7 2 1 3. + <_> + + <_> + 4 7 12 2 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 8 4 4 4 -1. + <_> + 8 6 4 2 2. + <_> + + <_> + 2 4 9 1 -1. + <_> + 5 4 3 1 3. + <_> + + <_> + 9 12 2 8 -1. + <_> + 9 16 2 4 2. + <_> + + <_> + 3 8 14 12 -1. + <_> + 3 14 14 6 2. + <_> + + <_> + 6 13 7 3 -1. + <_> + 6 14 7 1 3. + <_> + + <_> + 5 9 6 3 -1. + <_> + 7 9 2 3 3. + <_> + + <_> + 12 1 6 3 -1. + <_> + 12 2 6 1 3. + <_> + + <_> + 8 12 6 2 -1. + <_> + 8 13 6 1 2. + <_> + + <_> + 0 2 18 2 -1. + <_> + 0 2 9 1 2. + <_> + 9 3 9 1 2. + <_> + + <_> + 6 10 3 6 -1. + <_> + 6 13 3 3 2. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 15 0 5 8 -1. + <_> + 15 4 5 4 2. + <_> + + <_> + 7 16 6 4 -1. + <_> + 9 16 2 4 3. + <_> + + <_> + 2 11 14 4 -1. + <_> + 2 11 7 2 2. + <_> + 9 13 7 2 2. + <_> + + <_> + 14 10 6 10 -1. + <_> + 14 10 3 10 2. + <_> + + <_> + 9 8 10 12 -1. + <_> + 14 8 5 6 2. + <_> + 9 14 5 6 2. + <_> + + <_> + 0 10 6 10 -1. + <_> + 3 10 3 10 2. + <_> + + <_> + 1 8 10 12 -1. + <_> + 1 8 5 6 2. + <_> + 6 14 5 6 2. + <_> + + <_> + 9 3 6 1 -1. + <_> + 11 3 2 1 3. + <_> + + <_> + 7 4 6 3 -1. + <_> + 9 4 2 3 3. + <_> + + <_> + 5 3 6 1 -1. + <_> + 7 3 2 1 3. + <_> + + <_> + 4 5 6 3 -1. + <_> + 6 5 2 3 3. + <_> + + <_> + 9 16 3 3 -1. + <_> + 9 17 3 1 3. + <_> + + <_> + 8 14 6 3 -1. + <_> + 8 15 6 1 3. + <_> + + <_> + 6 0 8 12 -1. + <_> + 6 0 4 6 2. + <_> + 10 6 4 6 2. + <_> + + <_> + 4 12 2 3 -1. + <_> + 4 13 2 1 3. + <_> + + <_> + 12 16 6 3 -1. + <_> + 12 17 6 1 3. + <_> + + <_> + 7 12 7 2 -1. + <_> + 7 13 7 1 2. + <_> + + <_> + 2 16 6 3 -1. + <_> + 2 17 6 1 3. + <_> + + <_> + 0 7 16 6 -1. + <_> + 0 10 16 3 2. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 7 1 3 3. + <_> + + <_> + 9 7 3 5 -1. + <_> + 10 7 1 5 3. + <_> + + <_> + 0 5 20 10 -1. + <_> + 0 5 10 5 2. + <_> + 10 10 10 5 2. + <_> + + <_> + 3 1 4 2 -1. + <_> + 5 1 2 2 2. + <_> + + <_> + 7 6 8 10 -1. + <_> + 11 6 4 5 2. + <_> + 7 11 4 5 2. + <_> + + <_> + 17 6 3 2 -1. + <_> + 17 7 3 1 2. + <_> + + <_> + 5 6 8 10 -1. + <_> + 5 6 4 5 2. + <_> + 9 11 4 5 2. + <_> + + <_> + 5 12 10 6 -1. + <_> + 5 14 10 2 3. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 7 1 3 3. + <_> + + <_> + 10 3 2 6 -1. + <_> + 11 3 1 3 2. + <_> + 10 6 1 3 2. + <_> + + <_> + 0 4 3 3 -1. + <_> + 0 5 3 1 3. + <_> + + <_> + 3 16 8 4 -1. + <_> + 3 16 4 2 2. + <_> + 7 18 4 2 2. + <_> + + <_> + 8 13 5 2 -1. + <_> + 8 14 5 1 2. + <_> + + <_> + 8 7 4 12 -1. + <_> + 8 11 4 4 3. + <_> + + <_> + 5 9 2 2 -1. + <_> + 6 9 1 2 2. + <_> + + <_> + 9 15 2 3 -1. + <_> + 9 16 2 1 3. + <_> + + <_> + 13 9 2 3 -1. + <_> + 13 9 1 3 2. + <_> + + <_> + 14 0 6 17 -1. + <_> + 16 0 2 17 3. + <_> + + <_> + 5 10 2 2 -1. + <_> + 6 10 1 2 2. + <_> + + <_> + 2 9 9 1 -1. + <_> + 5 9 3 1 3. + <_> + + <_> + 9 11 2 3 -1. + <_> + 9 12 2 1 3. + <_> + + <_> + 7 11 6 3 -1. + <_> + 7 12 6 1 3. + <_> + + <_> + 0 6 3 2 -1. + <_> + 0 7 3 1 2. + <_> + + <_> + 7 0 6 1 -1. + <_> + 9 0 2 1 3. + <_> + + <_> + 9 16 3 3 -1. + <_> + 9 17 3 1 3. + <_> + + <_> + 2 13 17 6 -1. + <_> + 2 16 17 3 2. + <_> + + <_> + 1 3 3 7 -1. + <_> + 2 3 1 7 3. + <_> + + <_> + 1 1 6 4 -1. + <_> + 3 1 2 4 3. + <_> + + <_> + 14 1 6 5 -1. + <_> + 14 1 3 5 2. + <_> + + <_> + 13 2 3 2 -1. + <_> + 13 3 3 1 2. + <_> + + <_> + 0 1 6 5 -1. + <_> + 3 1 3 5 2. + <_> + + <_> + 2 3 2 6 -1. + <_> + 2 5 2 2 3. + <_> + + <_> + 9 10 3 2 -1. + <_> + 9 11 3 1 2. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 6 3 3 1 -1. + <_> + 7 3 1 1 3. + <_> + + <_> + 8 2 3 12 -1. + <_> + 8 6 3 4 3. + <_> + + <_> + 11 12 1 2 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 11 12 2 2 -1. + <_> + 12 12 1 1 2. + <_> + 11 13 1 1 2. + <_> + + <_> + 5 5 2 2 -1. + <_> + 5 6 2 1 2. + <_> + + <_> + 5 4 1 3 -1. + <_> + 5 5 1 1 3. + <_> + + <_> + 3 11 16 4 -1. + <_> + 11 11 8 2 2. + <_> + 3 13 8 2 2. + <_> + + <_> + 0 10 20 3 -1. + <_> + 0 11 20 1 3. + <_> + + <_> + 1 11 16 4 -1. + <_> + 1 11 8 2 2. + <_> + 9 13 8 2 2. + <_> + + <_> + 4 2 4 2 -1. + <_> + 4 3 4 1 2. + <_> + + <_> + 12 6 2 2 -1. + <_> + 13 6 1 1 2. + <_> + 12 7 1 1 2. + <_> + + <_> + 12 11 6 6 -1. + <_> + 12 13 6 2 3. + <_> + + <_> + 6 6 2 2 -1. + <_> + 6 6 1 1 2. + <_> + 7 7 1 1 2. + <_> + + <_> + 6 4 4 16 -1. + <_> + 8 4 2 16 2. + <_> + + <_> + 11 18 3 2 -1. + <_> + 11 19 3 1 2. + <_> + + <_> + 9 17 6 2 -1. + <_> + 12 17 3 1 2. + <_> + 9 18 3 1 2. + <_> + + <_> + 2 13 5 2 -1. + <_> + 2 14 5 1 2. + <_> + + <_> + 3 15 2 2 -1. + <_> + 3 16 2 1 2. + <_> + + <_> + 9 7 3 3 -1. + <_> + 10 7 1 3 3. + <_> + + <_> + 9 6 2 6 -1. + <_> + 9 6 1 6 2. + <_> + + <_> + 1 14 7 6 -1. + <_> + 1 16 7 2 3. + <_> + + <_> + 8 1 2 11 -1. + <_> + 9 1 1 11 2. + <_> + + <_> + 9 7 2 4 -1. + <_> + 9 7 1 4 2. + <_> + + <_> + 11 10 2 1 -1. + <_> + 11 10 1 1 2. + <_> + + <_> + 0 3 3 9 -1. + <_> + 1 3 1 9 3. + <_> + + <_> + 0 3 3 6 -1. + <_> + 0 5 3 2 3. + <_> + + <_> + 11 15 2 2 -1. + <_> + 12 15 1 1 2. + <_> + 11 16 1 1 2. + <_> + + <_> + 11 14 2 2 -1. + <_> + 12 14 1 1 2. + <_> + 11 15 1 1 2. + <_> + + <_> + 7 15 2 2 -1. + <_> + 7 15 1 1 2. + <_> + 8 16 1 1 2. + <_> + + <_> + 7 14 2 2 -1. + <_> + 7 14 1 1 2. + <_> + 8 15 1 1 2. + <_> + + <_> + 8 13 4 6 -1. + <_> + 10 13 2 3 2. + <_> + 8 16 2 3 2. + <_> + + <_> + 2 14 16 4 -1. + <_> + 10 14 8 2 2. + <_> + 2 16 8 2 2. + <_> + + <_> + 9 8 2 2 -1. + <_> + 9 9 2 1 2. + <_> + + <_> + 7 7 5 3 -1. + <_> + 7 8 5 1 3. + <_> + + <_> + 7 5 6 2 -1. + <_> + 9 5 2 2 3. + <_> + + <_> + 9 1 6 18 -1. + <_> + 11 1 2 18 3. + <_> + + <_> + 8 6 3 4 -1. + <_> + 9 6 1 4 3. + <_> + + <_> + 8 5 2 4 -1. + <_> + 8 5 1 2 2. + <_> + 9 7 1 2 2. + <_> + + <_> + 9 13 2 6 -1. + <_> + 10 13 1 3 2. + <_> + 9 16 1 3 2. + <_> + + <_> + 11 0 3 18 -1. + <_> + 12 0 1 18 3. + <_> + + <_> + 6 0 3 18 -1. + <_> + 7 0 1 18 3. + <_> + + <_> + 5 15 4 2 -1. + <_> + 7 15 2 2 2. + <_> + + <_> + 1 9 18 1 -1. + <_> + 7 9 6 1 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 9 6 2 4 -1. + <_> + 10 6 1 4 2. + <_> + + <_> + 6 10 6 2 -1. + <_> + 8 10 2 2 3. + <_> + + <_> + 0 7 20 1 -1. + <_> + 0 7 10 1 2. + <_> + + <_> + 11 3 5 4 -1. + <_> + 11 5 5 2 2. + <_> + + <_> + 5 7 10 1 -1. + <_> + 10 7 5 1 2. + <_> + + <_> + 8 10 3 3 -1. + <_> + 8 11 3 1 3. + <_> + + <_> + 2 0 16 8 -1. + <_> + 10 0 8 4 2. + <_> + 2 4 8 4 2. + <_> + + <_> + 11 0 9 10 -1. + <_> + 11 5 9 5 2. + <_> + + <_> + 0 2 8 18 -1. + <_> + 4 2 4 18 2. + <_> + + <_> + 0 0 2 6 -1. + <_> + 0 2 2 2 3. + <_> + + <_> + 6 0 9 2 -1. + <_> + 6 1 9 1 2. + <_> + + <_> + 4 1 12 2 -1. + <_> + 4 2 12 1 2. + <_> + + <_> + 2 1 16 14 -1. + <_> + 2 8 16 7 2. + <_> + + <_> + 5 1 8 12 -1. + <_> + 5 7 8 6 2. + <_> + + <_> + 9 11 2 2 -1. + <_> + 9 12 2 1 2. + <_> + + <_> + 9 10 5 6 -1. + <_> + 9 12 5 2 3. + <_> + + <_> + 3 0 13 8 -1. + <_> + 3 4 13 4 2. + <_> + + <_> + 6 7 5 8 -1. + <_> + 6 11 5 4 2. + <_> + + <_> + 9 5 2 3 -1. + <_> + 9 6 2 1 3. + <_> + + <_> + 6 8 8 3 -1. + <_> + 6 9 8 1 3. + <_> + + <_> + 2 2 7 6 -1. + <_> + 2 5 7 3 2. + <_> + + <_> + 2 1 14 4 -1. + <_> + 2 1 7 2 2. + <_> + 9 3 7 2 2. + <_> + + <_> + 11 14 1 3 -1. + <_> + 11 15 1 1 3. + <_> + + <_> + 6 15 8 2 -1. + <_> + 6 16 8 1 2. + <_> + + <_> + 8 14 1 3 -1. + <_> + 8 15 1 1 3. + <_> + + <_> + 8 11 2 8 -1. + <_> + 8 15 2 4 2. + <_> + + <_> + 6 15 8 2 -1. + <_> + 6 16 8 1 2. + <_> + + <_> + 7 16 8 3 -1. + <_> + 7 17 8 1 3. + <_> + + <_> + 0 16 2 2 -1. + <_> + 0 17 2 1 2. + <_> + + <_> + 1 16 8 4 -1. + <_> + 1 16 4 2 2. + <_> + 5 18 4 2 2. + <_> + + <_> + 2 9 16 3 -1. + <_> + 2 10 16 1 3. + <_> + + <_> + 13 11 2 4 -1. + <_> + 13 11 1 4 2. + <_> + + <_> + 0 13 16 6 -1. + <_> + 0 15 16 2 3. + <_> + + <_> + 5 11 2 4 -1. + <_> + 6 11 1 4 2. + <_> + + <_> + 18 2 2 18 -1. + <_> + 19 2 1 9 2. + <_> + 18 11 1 9 2. + <_> + + <_> + 19 7 1 9 -1. + <_> + 19 10 1 3 3. + <_> + + <_> + 0 2 2 18 -1. + <_> + 0 2 1 9 2. + <_> + 1 11 1 9 2. + <_> + + <_> + 0 7 1 9 -1. + <_> + 0 10 1 3 3. + <_> + + <_> + 14 12 2 2 -1. + <_> + 14 13 2 1 2. + <_> + + <_> + 11 14 2 3 -1. + <_> + 11 15 2 1 3. + <_> + + <_> + 7 8 6 2 -1. + <_> + 7 9 6 1 2. + <_> + + <_> + 7 12 4 6 -1. + <_> + 7 12 2 3 2. + <_> + 9 15 2 3 2. + <_> + + <_> + 8 13 5 3 -1. + <_> + 8 14 5 1 3. + <_> + + <_> + 12 14 2 2 -1. + <_> + 13 14 1 1 2. + <_> + 12 15 1 1 2. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 7 13 5 2 -1. + <_> + 7 14 5 1 2. + <_> + + <_> + 2 10 16 4 -1. + <_> + 10 10 8 2 2. + <_> + 2 12 8 2 2. + <_> + + <_> + 7 0 6 6 -1. + <_> + 9 0 2 6 3. + <_> + + <_> + 7 1 6 3 -1. + <_> + 7 2 6 1 3. + <_> + + <_> + 0 12 6 2 -1. + <_> + 0 13 6 1 2. + <_> + + <_> + 6 3 11 2 -1. + <_> + 6 4 11 1 2. + <_> + + <_> + 12 0 8 6 -1. + <_> + 16 0 4 3 2. + <_> + 12 3 4 3 2. + <_> + + <_> + 8 12 1 2 -1. + <_> + 8 13 1 1 2. + <_> + + <_> + 8 8 1 12 -1. + <_> + 8 12 1 4 3. + <_> + + <_> + 11 11 2 2 -1. + <_> + 12 11 1 1 2. + <_> + 11 12 1 1 2. + <_> + + <_> + 12 7 3 13 -1. + <_> + 13 7 1 13 3. + <_> + + <_> + 7 11 2 2 -1. + <_> + 7 11 1 1 2. + <_> + 8 12 1 1 2. + <_> + + <_> + 3 13 1 3 -1. + <_> + 3 14 1 1 3. + <_> + + <_> + 10 18 3 2 -1. + <_> + 11 18 1 2 3. + <_> + + <_> + 11 11 2 1 -1. + <_> + 11 11 1 1 2. + <_> + + <_> + 1 10 5 9 -1. + <_> + 1 13 5 3 3. + <_> + + <_> + 4 8 6 4 -1. + <_> + 6 8 2 4 3. + <_> + + <_> + 13 12 1 4 -1. + <_> + 13 14 1 2 2. + <_> + + <_> + 11 3 4 14 -1. + <_> + 13 3 2 7 2. + <_> + 11 10 2 7 2. + <_> + + <_> + 6 12 1 4 -1. + <_> + 6 14 1 2 2. + <_> + + <_> + 5 3 4 14 -1. + <_> + 5 3 2 7 2. + <_> + 7 10 2 7 2. + <_> + + <_> + 10 18 3 2 -1. + <_> + 11 18 1 2 3. + <_> + + <_> + 9 12 3 3 -1. + <_> + 9 13 3 1 3. + <_> + + <_> + 2 2 12 6 -1. + <_> + 2 2 6 3 2. + <_> + 8 5 6 3 2. + <_> + + <_> + 6 6 6 2 -1. + <_> + 9 6 3 2 2. + <_> + + <_> + 1 0 18 12 -1. + <_> + 7 0 6 12 3. + <_> + + <_> + 5 7 6 4 -1. + <_> + 5 7 3 2 2. + <_> + 8 9 3 2 2. + <_> + + <_> + 5 7 10 4 -1. + <_> + 5 9 10 2 2. + <_> + + <_> + 7 7 6 4 -1. + <_> + 9 7 2 4 3. + <_> + + <_> + 9 5 2 2 -1. + <_> + 9 6 2 1 2. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 6 17 8 3 -1. + <_> + 6 18 8 1 3. + <_> + + <_> + 9 17 6 2 -1. + <_> + 12 17 3 1 2. + <_> + 9 18 3 1 2. + <_> + + <_> + 4 12 2 2 -1. + <_> + 4 13 2 1 2. + <_> + + <_> + 3 12 9 2 -1. + <_> + 3 13 9 1 2. + <_> + + <_> + 8 3 6 1 -1. + <_> + 10 3 2 1 3. + <_> + + <_> + 9 3 4 6 -1. + <_> + 11 3 2 3 2. + <_> + 9 6 2 3 2. + <_> + + <_> + 0 3 6 5 -1. + <_> + 3 3 3 5 2. + <_> + + <_> + 2 0 2 18 -1. + <_> + 2 6 2 6 3. + <_> + + <_> + 14 2 4 9 -1. + <_> + 14 5 4 3 3. + <_> + + <_> + 10 18 3 2 -1. + <_> + 11 18 1 2 3. + <_> + + <_> + 2 2 4 9 -1. + <_> + 2 5 4 3 3. + <_> + + <_> + 7 18 3 2 -1. + <_> + 8 18 1 2 3. + <_> + + <_> + 10 14 3 3 -1. + <_> + 10 15 3 1 3. + <_> + + <_> + 10 12 2 6 -1. + <_> + 10 15 2 3 2. + <_> + + <_> + 7 5 3 6 -1. + <_> + 7 7 3 2 3. + <_> + + <_> + 3 3 6 2 -1. + <_> + 3 4 6 1 2. + <_> + + <_> + 8 4 7 3 -1. + <_> + 8 5 7 1 3. + <_> + + <_> + 13 6 2 3 -1. + <_> + 13 7 2 1 3. + <_> + + <_> + 8 8 2 12 -1. + <_> + 8 12 2 4 3. + <_> + + <_> + 5 4 8 14 -1. + <_> + 5 4 4 7 2. + <_> + 9 11 4 7 2. + <_> + + <_> + 0 1 20 8 -1. + <_> + 10 1 10 4 2. + <_> + 0 5 10 4 2. + <_> + + <_> + 4 0 12 2 -1. + <_> + 4 1 12 1 2. + <_> + + <_> + 0 1 20 8 -1. + <_> + 0 1 10 4 2. + <_> + 10 5 10 4 2. + <_> + + <_> + 4 0 12 2 -1. + <_> + 4 1 12 1 2. + <_> + + <_> + 9 5 6 3 -1. + <_> + 9 5 3 3 2. + <_> + + <_> + 8 13 10 6 -1. + <_> + 8 15 10 2 3. + <_> + + <_> + 5 5 6 3 -1. + <_> + 8 5 3 3 2. + <_> + + <_> + 6 3 6 1 -1. + <_> + 8 3 2 1 3. + <_> + + <_> + 11 18 9 2 -1. + <_> + 14 18 3 2 3. + <_> + + <_> + 13 11 6 7 -1. + <_> + 13 11 3 7 2. + <_> + + <_> + 4 6 12 10 -1. + <_> + 4 6 6 5 2. + <_> + 10 11 6 5 2. + <_> + + <_> + 8 17 3 3 -1. + <_> + 9 17 1 3 3. + <_> + + <_> + 11 18 9 2 -1. + <_> + 14 18 3 2 3. + <_> + + <_> + 13 11 6 8 -1. + <_> + 13 11 3 8 2. + <_> + + <_> + 4 16 2 2 -1. + <_> + 4 17 2 1 2. + <_> + + <_> + 7 15 4 4 -1. + <_> + 7 17 4 2 2. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 13 6 2 3 -1. + <_> + 13 7 2 1 3. + <_> + + <_> + 5 11 6 1 -1. + <_> + 7 11 2 1 3. + <_> + + <_> + 7 10 3 1 -1. + <_> + 8 10 1 1 3. + <_> + + <_> + 0 12 20 4 -1. + <_> + 0 14 20 2 2. + <_> + + <_> + 10 2 3 2 -1. + <_> + 10 3 3 1 2. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 5 5 4 3 -1. + <_> + 5 6 4 1 3. + <_> + + <_> + 8 8 4 3 -1. + <_> + 8 9 4 1 3. + <_> + + <_> + 10 4 2 12 -1. + <_> + 10 8 2 4 3. + <_> + + <_> + 0 3 4 3 -1. + <_> + 0 4 4 1 3. + <_> + + <_> + 1 3 2 3 -1. + <_> + 1 4 2 1 3. + <_> + + <_> + 16 1 4 11 -1. + <_> + 16 1 2 11 2. + <_> + + <_> + 18 2 2 16 -1. + <_> + 19 2 1 8 2. + <_> + 18 10 1 8 2. + <_> + + <_> + 1 8 6 12 -1. + <_> + 3 8 2 12 3. + <_> + + <_> + 7 2 6 2 -1. + <_> + 7 2 3 1 2. + <_> + 10 3 3 1 2. + <_> + + <_> + 12 4 8 2 -1. + <_> + 16 4 4 1 2. + <_> + 12 5 4 1 2. + <_> + + <_> + 10 6 6 2 -1. + <_> + 12 6 2 2 3. + <_> + + <_> + 0 4 8 2 -1. + <_> + 0 4 4 1 2. + <_> + 4 5 4 1 2. + <_> + + <_> + 1 3 3 5 -1. + <_> + 2 3 1 5 3. + <_> + + <_> + 16 3 4 6 -1. + <_> + 16 5 4 2 3. + <_> + + <_> + 8 6 4 3 -1. + <_> + 8 7 4 1 3. + <_> + + <_> + 8 14 1 3 -1. + <_> + 8 15 1 1 3. + <_> + + <_> + 4 11 1 2 -1. + <_> + 4 12 1 1 2. + <_> + + <_> + 8 14 6 3 -1. + <_> + 8 15 6 1 3. + <_> + + <_> + 7 15 7 3 -1. + <_> + 7 16 7 1 3. + <_> + + <_> + 9 12 2 8 -1. + <_> + 9 16 2 4 2. + <_> + + <_> + 4 6 6 2 -1. + <_> + 6 6 2 2 3. + <_> + + <_> + 12 7 4 2 -1. + <_> + 12 8 4 1 2. + <_> + + <_> + 5 3 13 10 -1. + <_> + 5 8 13 5 2. + <_> + + <_> + 4 7 4 2 -1. + <_> + 4 8 4 1 2. + <_> + + <_> + 0 8 16 2 -1. + <_> + 0 8 8 1 2. + <_> + 8 9 8 1 2. + <_> + + <_> + 11 8 2 5 -1. + <_> + 11 8 1 5 2. + <_> + + <_> + 10 0 6 13 -1. + <_> + 10 0 3 13 2. + <_> + + <_> + 1 6 4 2 -1. + <_> + 1 7 4 1 2. + <_> + + <_> + 4 3 2 1 -1. + <_> + 5 3 1 1 2. + <_> + + <_> + 11 8 2 5 -1. + <_> + 11 8 1 5 2. + <_> + + <_> + 12 10 4 8 -1. + <_> + 12 10 2 8 2. + <_> + + <_> + 7 8 2 5 -1. + <_> + 8 8 1 5 2. + <_> + + <_> + 4 10 4 8 -1. + <_> + 6 10 2 8 2. + <_> + + <_> + 6 7 9 12 -1. + <_> + 9 7 3 12 3. + <_> + + <_> + 11 13 2 3 -1. + <_> + 11 13 1 3 2. + <_> + + <_> + 7 10 6 10 -1. + <_> + 10 10 3 10 2. + <_> + + <_> + 8 11 4 8 -1. + <_> + 8 11 2 4 2. + <_> + 10 15 2 4 2. + <_> + + <_> + 16 1 4 11 -1. + <_> + 16 1 2 11 2. + <_> + + <_> + 18 2 2 4 -1. + <_> + 18 2 1 4 2. + <_> + + <_> + 5 6 6 2 -1. + <_> + 5 6 3 1 2. + <_> + 8 7 3 1 2. + <_> + + <_> + 5 4 1 3 -1. + <_> + 5 5 1 1 3. + <_> + + <_> + 11 1 4 14 -1. + <_> + 11 1 2 14 2. + <_> + + <_> + 4 2 12 3 -1. + <_> + 8 2 4 3 3. + <_> + + <_> + 5 1 4 14 -1. + <_> + 7 1 2 14 2. + <_> + + <_> + 7 3 6 2 -1. + <_> + 9 3 2 2 3. + <_> + + <_> + 2 0 18 4 -1. + <_> + 8 0 6 4 3. + <_> + + <_> + 9 5 2 10 -1. + <_> + 9 10 2 5 2. + <_> + + <_> + 8 6 3 4 -1. + <_> + 9 6 1 4 3. + <_> + + <_> + 5 5 9 11 -1. + <_> + 8 5 3 11 3. + <_> + + <_> + 10 6 3 5 -1. + <_> + 11 6 1 5 3. + <_> + + <_> + 8 9 6 5 -1. + <_> + 8 9 3 5 2. + <_> + + <_> + 7 6 3 5 -1. + <_> + 8 6 1 5 3. + <_> + + <_> + 6 10 6 3 -1. + <_> + 9 10 3 3 2. + <_> + + <_> + 10 0 3 7 -1. + <_> + 11 0 1 7 3. + <_> + + <_> + 0 3 20 12 -1. + <_> + 0 9 20 6 2. + <_> + + <_> + 9 7 2 2 -1. + <_> + 10 7 1 2 2. + <_> + + <_> + 5 9 4 1 -1. + <_> + 7 9 2 1 2. + <_> + + <_> + 13 13 3 2 -1. + <_> + 13 14 3 1 2. + <_> + + <_> + 16 9 4 6 -1. + <_> + 16 9 2 6 2. + <_> + + <_> + 7 15 6 3 -1. + <_> + 7 16 6 1 3. + <_> + + <_> + 6 16 7 3 -1. + <_> + 6 17 7 1 3. + <_> + + <_> + 11 14 9 6 -1. + <_> + 11 16 9 2 3. + <_> + + <_> + 19 14 1 3 -1. + <_> + 19 15 1 1 3. + <_> + + <_> + 0 9 6 6 -1. + <_> + 3 9 3 6 2. + <_> + + <_> + 0 19 9 1 -1. + <_> + 3 19 3 1 3. + <_> + + <_> + 11 14 9 6 -1. + <_> + 11 16 9 2 3. + <_> + + <_> + 12 12 6 6 -1. + <_> + 12 14 6 2 3. + <_> + + <_> + 1 14 8 6 -1. + <_> + 1 16 8 2 3. + <_> + + <_> + 8 1 3 2 -1. + <_> + 9 1 1 2 3. + <_> + + <_> + 18 2 2 4 -1. + <_> + 18 2 1 4 2. + <_> + + <_> + 14 0 6 3 -1. + <_> + 16 0 2 3 3. + <_> + + <_> + 0 2 2 4 -1. + <_> + 1 2 1 4 2. + <_> + + <_> + 0 0 6 3 -1. + <_> + 2 0 2 3 3. + <_> + + <_> + 9 0 3 2 -1. + <_> + 10 0 1 2 3. + <_> + + <_> + 12 1 2 2 -1. + <_> + 12 1 1 2 2. + <_> + + <_> + 8 0 3 2 -1. + <_> + 9 0 1 2 3. + <_> + + <_> + 6 1 2 2 -1. + <_> + 7 1 1 2 2. + <_> + + <_> + 10 8 2 3 -1. + <_> + 10 9 2 1 3. + <_> + + <_> + 13 15 6 2 -1. + <_> + 13 16 6 1 2. + <_> + + <_> + 8 12 2 2 -1. + <_> + 8 12 1 1 2. + <_> + 9 13 1 1 2. + <_> + + <_> + 8 15 3 5 -1. + <_> + 9 15 1 5 3. + <_> + + <_> + 8 6 4 12 -1. + <_> + 8 12 4 6 2. + <_> + + <_> + 7 6 7 8 -1. + <_> + 7 10 7 4 2. + <_> + + <_> + 0 11 8 2 -1. + <_> + 0 12 8 1 2. + <_> + + <_> + 8 11 2 2 -1. + <_> + 8 11 1 1 2. + <_> + 9 12 1 1 2. + <_> + + <_> + 7 7 12 1 -1. + <_> + 11 7 4 1 3. + <_> + + <_> + 10 8 3 2 -1. + <_> + 11 8 1 2 3. + <_> + + <_> + 1 7 12 1 -1. + <_> + 5 7 4 1 3. + <_> + + <_> + 6 5 8 2 -1. + <_> + 6 5 4 1 2. + <_> + 10 6 4 1 2. + <_> + + <_> + 9 10 3 10 -1. + <_> + 10 10 1 10 3. + <_> + + <_> + 16 0 2 4 -1. + <_> + 16 0 1 4 2. + <_> + + <_> + 8 10 3 10 -1. + <_> + 9 10 1 10 3. + <_> + + <_> + 9 10 2 3 -1. + <_> + 9 11 2 1 3. + <_> + + <_> + 8 9 4 2 -1. + <_> + 10 9 2 1 2. + <_> + 8 10 2 1 2. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 6 1 3 1 -1. + <_> + 7 1 1 1 3. + <_> + + <_> + 2 0 2 4 -1. + <_> + 3 0 1 4 2. + <_> + + <_> + 11 11 2 2 -1. + <_> + 12 11 1 1 2. + <_> + 11 12 1 1 2. + <_> + + <_> + 12 12 6 6 -1. + <_> + 12 14 6 2 3. + <_> + + <_> + 1 0 6 10 -1. + <_> + 1 0 3 5 2. + <_> + 4 5 3 5 2. + <_> + + <_> + 3 0 2 9 -1. + <_> + 3 3 2 3 3. + <_> + + <_> + 14 13 3 2 -1. + <_> + 14 14 3 1 2. + <_> + + <_> + 15 2 3 2 -1. + <_> + 15 3 3 1 2. + <_> + + <_> + 2 13 5 2 -1. + <_> + 2 14 5 1 2. + <_> + + <_> + 3 4 12 10 -1. + <_> + 3 4 6 5 2. + <_> + 9 9 6 5 2. + <_> + + <_> + 5 1 14 6 -1. + <_> + 5 3 14 2 3. + <_> + + <_> + 15 3 3 2 -1. + <_> + 15 4 3 1 2. + <_> + + <_> + 7 11 2 2 -1. + <_> + 7 11 1 1 2. + <_> + 8 12 1 1 2. + <_> + + <_> + 2 14 6 6 -1. + <_> + 2 16 6 2 3. + <_> + + <_> + 6 13 8 3 -1. + <_> + 6 14 8 1 3. + <_> + + <_> + 1 19 18 1 -1. + <_> + 7 19 6 1 3. + <_> + + <_> + 8 12 1 6 -1. + <_> + 8 15 1 3 2. + <_> + + <_> + 0 0 14 15 -1. + <_> + 0 5 14 5 3. + <_> + + <_> + 3 0 16 8 -1. + <_> + 3 4 16 4 2. + <_> + + <_> + 6 1 8 12 -1. + <_> + 6 7 8 6 2. + <_> + + <_> + 5 3 3 3 -1. + <_> + 6 3 1 3 3. + <_> + + <_> + 5 1 3 4 -1. + <_> + 6 1 1 4 3. + <_> + + <_> + 15 14 4 6 -1. + <_> + 17 14 2 3 2. + <_> + 15 17 2 3 2. + <_> + + <_> + 12 11 6 8 -1. + <_> + 15 11 3 4 2. + <_> + 12 15 3 4 2. + <_> + + <_> + 8 7 2 4 -1. + <_> + 9 7 1 4 2. + <_> + + <_> + 6 11 3 1 -1. + <_> + 7 11 1 1 3. + <_> + + <_> + 12 3 2 14 -1. + <_> + 12 3 1 14 2. + <_> + + <_> + 12 11 6 2 -1. + <_> + 15 11 3 1 2. + <_> + 12 12 3 1 2. + <_> + + <_> + 0 2 5 2 -1. + <_> + 0 3 5 1 2. + <_> + + <_> + 0 0 15 1 -1. + <_> + 5 0 5 1 3. + <_> + + <_> + 12 11 6 2 -1. + <_> + 15 11 3 1 2. + <_> + 12 12 3 1 2. + <_> + + <_> + 10 5 2 2 -1. + <_> + 10 5 1 2 2. + <_> + + <_> + 9 7 2 2 -1. + <_> + 10 7 1 2 2. + <_> + + <_> + 9 0 2 10 -1. + <_> + 9 0 1 5 2. + <_> + 10 5 1 5 2. + <_> + + <_> + 18 14 2 2 -1. + <_> + 18 15 2 1 2. + <_> + + <_> + 13 11 4 9 -1. + <_> + 13 14 4 3 3. + <_> + + <_> + 8 13 2 2 -1. + <_> + 8 13 1 1 2. + <_> + 9 14 1 1 2. + <_> + + <_> + 7 8 4 3 -1. + <_> + 7 9 4 1 3. + <_> + + <_> + 8 9 4 2 -1. + <_> + 8 10 4 1 2. + <_> + + <_> + 13 12 4 2 -1. + <_> + 13 13 4 1 2. + <_> + + <_> + 6 14 2 2 -1. + <_> + 6 14 1 1 2. + <_> + 7 15 1 1 2. + <_> + + <_> + 0 14 2 2 -1. + <_> + 0 15 2 1 2. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 7 9 10 6 -1. + <_> + 7 11 10 2 3. + <_> + + <_> + 2 9 12 4 -1. + <_> + 6 9 4 4 3. + <_> + + <_> + 7 9 6 11 -1. + <_> + 10 9 3 11 2. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 9 14 4 3 -1. + <_> + 9 15 4 1 3. + <_> + + <_> + 2 3 3 17 -1. + <_> + 3 3 1 17 3. + <_> + + <_> + 0 11 6 3 -1. + <_> + 0 12 6 1 3. + <_> + + <_> + 4 3 11 9 -1. + <_> + 4 6 11 3 3. + <_> + + <_> + 0 2 6 11 -1. + <_> + 3 2 3 11 2. + <_> + + <_> + 13 0 4 5 -1. + <_> + 13 0 2 5 2. + <_> + + <_> + 9 7 6 4 -1. + <_> + 12 7 3 2 2. + <_> + 9 9 3 2 2. + <_> + + <_> + 5 7 8 2 -1. + <_> + 9 7 4 2 2. + <_> + + <_> + 1 8 15 1 -1. + <_> + 6 8 5 1 3. + <_> + + <_> + 4 12 12 2 -1. + <_> + 8 12 4 2 3. + <_> + + <_> + 13 0 4 10 -1. + <_> + 15 0 2 5 2. + <_> + 13 5 2 5 2. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 3 9 6 2 -1. + <_> + 6 9 3 2 2. + <_> + + <_> + 8 17 4 3 -1. + <_> + 8 18 4 1 3. + <_> + + <_> + 8 3 9 2 -1. + <_> + 11 3 3 2 3. + <_> + + <_> + 3 3 9 2 -1. + <_> + 6 3 3 2 3. + <_> + + <_> + 5 0 9 14 -1. + <_> + 8 0 3 14 3. + <_> + + <_> + 7 3 7 10 -1. + <_> + 7 8 7 5 2. + <_> + + <_> + 4 8 13 3 -1. + <_> + 4 9 13 1 3. + <_> + + <_> + 3 12 14 4 -1. + <_> + 3 12 7 2 2. + <_> + 10 14 7 2 2. + <_> + + <_> + 8 12 4 2 -1. + <_> + 8 13 4 1 2. + <_> + + <_> + 6 10 9 8 -1. + <_> + 6 14 9 4 2. + <_> + + <_> + 9 12 2 8 -1. + <_> + 9 16 2 4 2. + <_> + + <_> + 8 12 3 3 -1. + <_> + 8 13 3 1 3. + <_> + + <_> + 5 5 4 10 -1. + <_> + 7 5 2 10 2. + <_> + + <_> + 14 15 3 3 -1. + <_> + 14 16 3 1 3. + <_> + + <_> + 4 6 13 3 -1. + <_> + 4 7 13 1 3. + <_> + + <_> + 3 15 3 3 -1. + <_> + 3 16 3 1 3. + <_> + + <_> + 3 9 4 2 -1. + <_> + 3 9 2 1 2. + <_> + 5 10 2 1 2. + <_> + + <_> + 0 11 20 4 -1. + <_> + 10 11 10 2 2. + <_> + 0 13 10 2 2. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 0 11 20 4 -1. + <_> + 0 11 10 2 2. + <_> + 10 13 10 2 2. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 10 13 1 6 -1. + <_> + 10 16 1 3 2. + <_> + + <_> + 2 1 18 2 -1. + <_> + 11 1 9 1 2. + <_> + 2 2 9 1 2. + <_> + + <_> + 8 14 3 3 -1. + <_> + 8 15 3 1 3. + <_> + + <_> + 4 1 6 1 -1. + <_> + 6 1 2 1 3. + <_> + + <_> + 11 13 1 3 -1. + <_> + 11 14 1 1 3. + <_> + + <_> + 13 5 2 12 -1. + <_> + 13 11 2 6 2. + <_> + + <_> + 1 14 18 6 -1. + <_> + 1 16 18 2 3. + <_> + + <_> + 8 13 1 3 -1. + <_> + 8 14 1 1 3. + <_> + + <_> + 7 13 6 3 -1. + <_> + 7 14 6 1 3. + <_> + + <_> + 9 10 3 2 -1. + <_> + 9 11 3 1 2. + <_> + + <_> + 5 1 3 3 -1. + <_> + 6 1 1 3 3. + <_> + + <_> + 5 5 6 5 -1. + <_> + 8 5 3 5 2. + <_> + + <_> + 7 5 6 14 -1. + <_> + 7 12 6 7 2. + <_> + + <_> + 7 16 6 2 -1. + <_> + 9 16 2 2 3. + <_> + + <_> + 0 2 2 12 -1. + <_> + 1 2 1 12 2. + <_> + + <_> + 1 0 5 3 -1. + <_> + 1 1 5 1 3. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 12 6 3 3 -1. + <_> + 12 7 3 1 3. + <_> + + <_> + 5 4 3 3 -1. + <_> + 5 5 3 1 3. + <_> + + <_> + 5 6 3 3 -1. + <_> + 5 7 3 1 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 10 12 2 4 2. + <_> + 8 16 2 4 2. + <_> + + <_> + 2 17 18 2 -1. + <_> + 11 17 9 1 2. + <_> + 2 18 9 1 2. + <_> + + <_> + 9 3 2 2 -1. + <_> + 9 4 2 1 2. + <_> + + <_> + 8 5 4 6 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 9 0 8 6 -1. + <_> + 9 2 8 2 3. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 0 0 4 8 -1. + <_> + 2 0 2 8 2. + <_> + + <_> + 0 4 6 9 -1. + <_> + 2 4 2 9 3. + <_> + + <_> + 1 4 18 2 -1. + <_> + 7 4 6 2 3. + <_> + + <_> + 8 16 12 4 -1. + <_> + 14 16 6 2 2. + <_> + 8 18 6 2 2. + <_> + + <_> + 0 0 18 2 -1. + <_> + 0 0 9 1 2. + <_> + 9 1 9 1 2. + <_> + + <_> + 3 0 3 18 -1. + <_> + 4 0 1 18 3. + <_> + + <_> + 14 9 4 7 -1. + <_> + 14 9 2 7 2. + <_> + + <_> + 15 14 2 2 -1. + <_> + 15 15 2 1 2. + <_> + + <_> + 2 9 4 7 -1. + <_> + 4 9 2 7 2. + <_> + + <_> + 3 14 2 2 -1. + <_> + 3 15 2 1 2. + <_> + + <_> + 11 0 6 6 -1. + <_> + 11 2 6 2 3. + <_> + + <_> + 14 0 2 6 -1. + <_> + 15 0 1 3 2. + <_> + 14 3 1 3 2. + <_> + + <_> + 7 11 2 2 -1. + <_> + 7 11 1 1 2. + <_> + 8 12 1 1 2. + <_> + + <_> + 7 10 2 2 -1. + <_> + 8 10 1 2 2. + <_> + + <_> + 9 14 2 6 -1. + <_> + 9 17 2 3 2. + <_> + + <_> + 12 18 4 2 -1. + <_> + 12 19 4 1 2. + <_> + + <_> + 8 17 4 3 -1. + <_> + 8 18 4 1 3. + <_> + + <_> + 2 18 8 2 -1. + <_> + 2 19 8 1 2. + <_> + + <_> + 2 9 16 3 -1. + <_> + 2 10 16 1 3. + <_> + + <_> + 9 9 2 2 -1. + <_> + 9 10 2 1 2. + <_> + + <_> + 5 14 2 4 -1. + <_> + 5 14 1 2 2. + <_> + 6 16 1 2 2. + <_> + + <_> + 8 9 4 2 -1. + <_> + 8 9 2 1 2. + <_> + 10 10 2 1 2. + <_> + + <_> + 9 5 2 5 -1. + <_> + 9 5 1 5 2. + <_> + + <_> + 9 9 3 2 -1. + <_> + 10 9 1 2 3. + <_> + + <_> + 8 9 3 2 -1. + <_> + 9 9 1 2 3. + <_> + + <_> + 8 8 3 6 -1. + <_> + 9 8 1 6 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 10 12 2 4 2. + <_> + 8 16 2 4 2. + <_> + + <_> + 2 17 16 2 -1. + <_> + 10 17 8 1 2. + <_> + 2 18 8 1 2. + <_> + + <_> + 8 12 3 8 -1. + <_> + 9 12 1 8 3. + <_> + + <_> + 3 10 1 3 -1. + <_> + 3 11 1 1 3. + <_> + + <_> + 9 14 10 6 -1. + <_> + 14 14 5 3 2. + <_> + 9 17 5 3 2. + <_> + + <_> + 14 13 3 6 -1. + <_> + 14 15 3 2 3. + <_> + + <_> + 1 19 18 1 -1. + <_> + 7 19 6 1 3. + <_> + + <_> + 2 10 15 2 -1. + <_> + 7 10 5 2 3. + <_> + + <_> + 4 17 16 3 -1. + <_> + 4 18 16 1 3. + <_> + + <_> + 8 6 4 9 -1. + <_> + 8 9 4 3 3. + <_> + + <_> + 9 16 2 4 -1. + <_> + 9 16 1 2 2. + <_> + 10 18 1 2 2. + <_> + + <_> + 5 5 10 8 -1. + <_> + 5 9 10 4 2. + <_> + + <_> + 13 1 4 2 -1. + <_> + 13 1 2 2 2. + <_> + + <_> + 14 0 3 6 -1. + <_> + 14 2 3 2 3. + <_> + + <_> + 6 7 2 2 -1. + <_> + 6 7 1 1 2. + <_> + 7 8 1 1 2. + <_> + + <_> + 7 1 6 1 -1. + <_> + 9 1 2 1 3. + <_> + + <_> + 9 11 3 3 -1. + <_> + 9 12 3 1 3. + <_> + + <_> + 12 9 3 3 -1. + <_> + 13 9 1 3 3. + <_> + + <_> + 8 11 3 3 -1. + <_> + 8 12 3 1 3. + <_> + + <_> + 5 9 3 3 -1. + <_> + 6 9 1 3 3. + <_> + + <_> + 10 11 1 3 -1. + <_> + 10 12 1 1 3. + <_> + + <_> + 7 9 6 4 -1. + <_> + 10 9 3 2 2. + <_> + 7 11 3 2 2. + <_> + + <_> + 4 7 2 2 -1. + <_> + 4 7 1 1 2. + <_> + 5 8 1 1 2. + <_> + + <_> + 5 7 3 1 -1. + <_> + 6 7 1 1 3. + <_> + + <_> + 18 3 2 3 -1. + <_> + 18 4 2 1 3. + <_> + + <_> + 13 1 4 2 -1. + <_> + 13 1 2 2 2. + <_> + + <_> + 3 1 4 2 -1. + <_> + 5 1 2 2 2. + <_> + + <_> + 3 0 5 2 -1. + <_> + 3 1 5 1 2. + <_> + + <_> + 14 7 6 4 -1. + <_> + 17 7 3 2 2. + <_> + 14 9 3 2 2. + <_> + + <_> + 4 8 16 2 -1. + <_> + 4 9 16 1 2. + <_> + + <_> + 2 11 5 6 -1. + <_> + 2 13 5 2 3. + <_> + + <_> + 5 16 2 4 -1. + <_> + 5 16 1 2 2. + <_> + 6 18 1 2 2. + <_> + + <_> + 15 6 2 12 -1. + <_> + 16 6 1 6 2. + <_> + 15 12 1 6 2. + <_> + + <_> + 13 3 6 16 -1. + <_> + 15 3 2 16 3. + <_> + + <_> + 4 5 12 12 -1. + <_> + 4 5 6 6 2. + <_> + 10 11 6 6 2. + <_> + + <_> + 5 1 10 13 -1. + <_> + 10 1 5 13 2. + <_> + + <_> + 11 5 2 2 -1. + <_> + 12 5 1 1 2. + <_> + 11 6 1 1 2. + <_> + + <_> + 13 5 1 3 -1. + <_> + 13 6 1 1 3. + <_> + + <_> + 7 4 2 4 -1. + <_> + 7 4 1 2 2. + <_> + 8 6 1 2 2. + <_> + + <_> + 7 5 6 4 -1. + <_> + 10 5 3 4 2. + <_> + + <_> + 12 4 4 6 -1. + <_> + 14 4 2 3 2. + <_> + 12 7 2 3 2. + <_> + + <_> + 12 11 7 6 -1. + <_> + 12 13 7 2 3. + <_> + + <_> + 5 6 6 6 -1. + <_> + 7 6 2 6 3. + <_> + + <_> + 9 8 2 2 -1. + <_> + 9 9 2 1 2. + <_> + + <_> + 15 6 2 2 -1. + <_> + 16 6 1 1 2. + <_> + 15 7 1 1 2. + <_> + + <_> + 14 7 4 4 -1. + <_> + 16 7 2 2 2. + <_> + 14 9 2 2 2. + <_> + + <_> + 5 5 6 2 -1. + <_> + 7 5 2 2 3. + <_> + + <_> + 1 19 18 1 -1. + <_> + 7 19 6 1 3. + <_> + + <_> + 12 3 3 3 -1. + <_> + 12 4 3 1 3. + <_> + + <_> + 16 0 2 3 -1. + <_> + 16 1 2 1 3. + <_> + + <_> + 5 3 3 3 -1. + <_> + 5 4 3 1 3. + <_> + + <_> + 2 0 2 3 -1. + <_> + 2 1 2 1 3. + <_> + + <_> + 15 6 2 2 -1. + <_> + 16 6 1 1 2. + <_> + 15 7 1 1 2. + <_> + + <_> + 10 13 1 6 -1. + <_> + 10 16 1 3 2. + <_> + + <_> + 0 7 10 2 -1. + <_> + 0 7 5 1 2. + <_> + 5 8 5 1 2. + <_> + + <_> + 3 10 6 2 -1. + <_> + 3 11 6 1 2. + <_> + + <_> + 12 18 4 2 -1. + <_> + 12 19 4 1 2. + <_> + + <_> + 12 18 2 2 -1. + <_> + 13 18 1 1 2. + <_> + 12 19 1 1 2. + <_> + + <_> + 6 19 2 1 -1. + <_> + 7 19 1 1 2. + <_> + + <_> + 0 4 2 16 -1. + <_> + 0 4 1 8 2. + <_> + 1 12 1 8 2. + <_> + + <_> + 16 1 4 9 -1. + <_> + 16 4 4 3 3. + <_> + + <_> + 10 2 1 2 -1. + <_> + 10 3 1 1 2. + <_> + + <_> + 4 14 4 6 -1. + <_> + 4 14 2 3 2. + <_> + 6 17 2 3 2. + <_> + + <_> + 4 15 1 4 -1. + <_> + 4 17 1 2 2. + <_> + + <_> + 0 2 20 4 -1. + <_> + 10 2 10 2 2. + <_> + 0 4 10 2 2. + <_> + + <_> + 14 5 2 8 -1. + <_> + 14 9 2 4 2. + <_> + + <_> + 5 12 4 5 -1. + <_> + 7 12 2 5 2. + <_> + + <_> + 0 13 9 6 -1. + <_> + 0 15 9 2 3. + <_> + + <_> + 9 14 11 3 -1. + <_> + 9 15 11 1 3. + <_> + + <_> + 7 14 7 3 -1. + <_> + 7 15 7 1 3. + <_> + + <_> + 3 6 2 2 -1. + <_> + 3 6 1 1 2. + <_> + 4 7 1 1 2. + <_> + + <_> + 6 7 2 7 -1. + <_> + 7 7 1 7 2. + <_> + + <_> + 14 5 1 3 -1. + <_> + 14 6 1 1 3. + <_> + + <_> + 13 4 4 3 -1. + <_> + 13 5 4 1 3. + <_> + + <_> + 2 7 4 4 -1. + <_> + 2 7 2 2 2. + <_> + 4 9 2 2 2. + <_> + + <_> + 2 9 13 6 -1. + <_> + 2 12 13 3 2. + <_> + + <_> + 10 1 3 4 -1. + <_> + 11 1 1 4 3. + <_> + + <_> + 9 8 5 2 -1. + <_> + 9 9 5 1 2. + <_> + + <_> + 0 14 11 3 -1. + <_> + 0 15 11 1 3. + <_> + + <_> + 8 11 2 8 -1. + <_> + 8 15 2 4 2. + <_> + + <_> + 5 11 10 6 -1. + <_> + 5 14 10 3 2. + <_> + + <_> + 5 13 15 5 -1. + <_> + 10 13 5 5 3. + <_> + + <_> + 8 10 1 10 -1. + <_> + 8 15 1 5 2. + <_> + + <_> + 4 14 6 2 -1. + <_> + 6 14 2 2 3. + <_> + + <_> + 7 14 7 3 -1. + <_> + 7 15 7 1 3. + <_> + + <_> + 7 16 9 3 -1. + <_> + 7 17 9 1 3. + <_> + + <_> + 8 7 3 3 -1. + <_> + 8 8 3 1 3. + <_> + + <_> + 3 5 1 6 -1. + <_> + 3 8 1 3 2. + <_> + + <_> + 6 5 11 2 -1. + <_> + 6 6 11 1 2. + <_> + + <_> + 9 0 3 2 -1. + <_> + 10 0 1 2 3. + <_> + + <_> + 5 5 1 3 -1. + <_> + 5 6 1 1 3. + <_> + + <_> + 8 7 3 2 -1. + <_> + 9 7 1 2 3. + <_> + + <_> + 5 2 10 6 -1. + <_> + 10 2 5 3 2. + <_> + 5 5 5 3 2. + <_> + + <_> + 8 4 6 4 -1. + <_> + 8 4 3 4 2. + <_> + + <_> + 8 16 3 4 -1. + <_> + 9 16 1 4 3. + <_> + + <_> + 9 13 2 6 -1. + <_> + 9 13 1 3 2. + <_> + 10 16 1 3 2. + <_> + + <_> + 9 8 3 1 -1. + <_> + 10 8 1 1 3. + <_> + + <_> + 2 5 18 15 -1. + <_> + 2 10 18 5 3. + <_> + + <_> + 1 3 6 2 -1. + <_> + 4 3 3 2 2. + <_> + + <_> + 7 6 6 2 -1. + <_> + 9 6 2 2 3. + <_> + + <_> + 8 17 4 3 -1. + <_> + 8 18 4 1 3. + <_> + + <_> + 10 13 2 3 -1. + <_> + 10 14 2 1 3. + <_> + + <_> + 0 10 20 4 -1. + <_> + 0 12 20 2 2. + <_> + + <_> + 5 7 6 4 -1. + <_> + 5 7 3 2 2. + <_> + 8 9 3 2 2. + <_> + + <_> + 11 12 1 2 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 10 10 2 3 -1. + <_> + 10 11 2 1 3. + <_> + + <_> + 9 5 2 2 -1. + <_> + 9 6 2 1 2. + <_> + + <_> + 4 4 1 10 -1. + <_> + 4 9 1 5 2. + <_> + + <_> + 11 18 4 2 -1. + <_> + 11 18 2 2 2. + <_> + + <_> + 12 18 3 2 -1. + <_> + 12 19 3 1 2. + <_> + + <_> + 0 6 16 6 -1. + <_> + 0 6 8 3 2. + <_> + 8 9 8 3 2. + <_> + + <_> + 7 6 4 12 -1. + <_> + 7 12 4 6 2. + <_> + + <_> + 11 18 4 2 -1. + <_> + 11 18 2 2 2. + <_> + + <_> + 12 18 3 2 -1. + <_> + 12 19 3 1 2. + <_> + + <_> + 8 12 1 2 -1. + <_> + 8 13 1 1 2. + <_> + + <_> + 8 13 1 3 -1. + <_> + 8 14 1 1 3. + <_> + + <_> + 11 18 4 2 -1. + <_> + 11 18 2 2 2. + <_> + + <_> + 14 12 4 6 -1. + <_> + 14 12 2 6 2. + <_> + + <_> + 6 0 3 4 -1. + <_> + 7 0 1 4 3. + <_> + + <_> + 4 0 2 8 -1. + <_> + 4 0 1 4 2. + <_> + 5 4 1 4 2. + <_> + + <_> + 11 17 9 3 -1. + <_> + 14 17 3 3 3. + <_> + + <_> + 16 2 4 5 -1. + <_> + 16 2 2 5 2. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 7 2 3 2 -1. + <_> + 8 2 1 2 3. + <_> + + <_> + 11 17 9 3 -1. + <_> + 14 17 3 3 3. + <_> + + <_> + 16 2 4 5 -1. + <_> + 16 2 2 5 2. + <_> + + <_> + 0 17 9 3 -1. + <_> + 3 17 3 3 3. + <_> + + <_> + 0 2 4 5 -1. + <_> + 2 2 2 5 2. + <_> + + <_> + 5 11 10 9 -1. + <_> + 5 14 10 3 3. + <_> + + <_> + 9 6 3 3 -1. + <_> + 9 7 3 1 3. + <_> + + <_> + 3 17 5 3 -1. + <_> + 3 18 5 1 3. + <_> + + <_> + 7 5 4 7 -1. + <_> + 9 5 2 7 2. + <_> + + <_> + 9 8 2 5 -1. + <_> + 9 8 1 5 2. + <_> + + <_> + 2 2 18 2 -1. + <_> + 2 3 18 1 2. + <_> + + <_> + 2 8 15 6 -1. + <_> + 7 8 5 6 3. + <_> + + <_> + 9 8 2 5 -1. + <_> + 10 8 1 5 2. + <_> + + <_> + 12 10 4 6 -1. + <_> + 12 12 4 2 3. + <_> + + <_> + 14 3 6 2 -1. + <_> + 14 4 6 1 2. + <_> + + <_> + 5 5 2 3 -1. + <_> + 5 6 2 1 3. + <_> + + <_> + 4 6 3 3 -1. + <_> + 4 7 3 1 3. + <_> + + <_> + 14 12 3 3 -1. + <_> + 14 13 3 1 3. + <_> + + <_> + 6 12 11 3 -1. + <_> + 6 13 11 1 3. + <_> + + <_> + 1 2 3 6 -1. + <_> + 1 4 3 2 3. + <_> + + <_> + 1 0 4 7 -1. + <_> + 3 0 2 7 2. + <_> + + <_> + 9 8 3 4 -1. + <_> + 10 8 1 4 3. + <_> + + <_> + 10 9 2 2 -1. + <_> + 10 10 2 1 2. + <_> + + <_> + 8 8 3 4 -1. + <_> + 9 8 1 4 3. + <_> + + <_> + 4 4 10 10 -1. + <_> + 4 9 10 5 2. + <_> + + <_> + 9 10 3 2 -1. + <_> + 10 10 1 2 3. + <_> + + <_> + 9 10 3 2 -1. + <_> + 9 11 3 1 2. + <_> + + <_> + 8 10 3 2 -1. + <_> + 9 10 1 2 3. + <_> + + <_> + 2 4 14 12 -1. + <_> + 2 4 7 6 2. + <_> + 9 10 7 6 2. + <_> + + <_> + 10 12 1 6 -1. + <_> + 10 15 1 3 2. + <_> + + <_> + 7 3 8 16 -1. + <_> + 11 3 4 8 2. + <_> + 7 11 4 8 2. + <_> + + <_> + 5 6 8 10 -1. + <_> + 5 6 4 5 2. + <_> + 9 11 4 5 2. + <_> + + <_> + 6 2 8 8 -1. + <_> + 6 2 4 4 2. + <_> + 10 6 4 4 2. + <_> + + <_> + 10 5 4 2 -1. + <_> + 12 5 2 1 2. + <_> + 10 6 2 1 2. + <_> + + <_> + 12 4 3 3 -1. + <_> + 12 5 3 1 3. + <_> + + <_> + 4 19 12 1 -1. + <_> + 8 19 4 1 3. + <_> + + <_> + 8 2 3 1 -1. + <_> + 9 2 1 1 3. + <_> + + <_> + 13 17 4 3 -1. + <_> + 13 18 4 1 3. + <_> + + <_> + 7 14 6 3 -1. + <_> + 7 15 6 1 3. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 7 15 6 3 -1. + <_> + 7 16 6 1 3. + <_> + + <_> + 10 18 3 2 -1. + <_> + 11 18 1 2 3. + <_> + + <_> + 14 12 2 3 -1. + <_> + 14 13 2 1 3. + <_> + + <_> + 4 10 4 6 -1. + <_> + 4 12 4 2 3. + <_> + + <_> + 4 13 3 2 -1. + <_> + 4 14 3 1 2. + <_> + + <_> + 9 16 2 3 -1. + <_> + 9 17 2 1 3. + <_> + + <_> + 10 18 3 2 -1. + <_> + 11 18 1 2 3. + <_> + + <_> + 7 18 3 2 -1. + <_> + 8 18 1 2 3. + <_> + + <_> + 1 10 4 2 -1. + <_> + 1 11 4 1 2. + <_> + + <_> + 12 4 6 3 -1. + <_> + 12 5 6 1 3. + <_> + + <_> + 14 4 1 3 -1. + <_> + 14 5 1 1 3. + <_> + + <_> + 2 4 6 3 -1. + <_> + 2 5 6 1 3. + <_> + + <_> + 5 4 1 3 -1. + <_> + 5 5 1 1 3. + <_> + + <_> + 14 12 3 3 -1. + <_> + 14 13 3 1 3. + <_> + + <_> + 15 12 2 3 -1. + <_> + 15 13 2 1 3. + <_> + + <_> + 3 16 4 3 -1. + <_> + 3 17 4 1 3. + <_> + + <_> + 8 0 4 2 -1. + <_> + 8 1 4 1 2. + <_> + + <_> + 0 0 20 1 -1. + <_> + 0 0 10 1 2. + <_> + + <_> + 9 7 3 4 -1. + <_> + 10 7 1 4 3. + <_> + + <_> + 0 0 20 1 -1. + <_> + 10 0 10 1 2. + <_> + + <_> + 8 7 3 4 -1. + <_> + 9 7 1 4 3. + <_> + + <_> + 1 6 19 3 -1. + <_> + 1 7 19 1 3. + <_> + + <_> + 12 7 4 2 -1. + <_> + 12 8 4 1 2. + <_> + + <_> + 7 8 3 3 -1. + <_> + 7 9 3 1 3. + <_> + + <_> + 7 7 3 3 -1. + <_> + 8 7 1 3 3. + <_> + + <_> + 2 9 16 3 -1. + <_> + 2 10 16 1 3. + <_> + + <_> + 9 4 2 12 -1. + <_> + 9 8 2 4 3. + <_> + + <_> + 7 3 2 5 -1. + <_> + 8 3 1 5 2. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 9 14 4 3 -1. + <_> + 9 15 4 1 3. + <_> + + <_> + 7 8 6 4 -1. + <_> + 10 8 3 2 2. + <_> + 7 10 3 2 2. + <_> + + <_> + 9 7 2 2 -1. + <_> + 10 7 1 2 2. + <_> + + <_> + 5 5 6 6 -1. + <_> + 7 5 2 6 3. + <_> + + <_> + 9 1 3 6 -1. + <_> + 10 1 1 6 3. + <_> + + <_> + 4 5 12 2 -1. + <_> + 8 5 4 2 3. + <_> + + <_> + 4 2 6 4 -1. + <_> + 6 2 2 4 3. + <_> + + <_> + 4 7 8 2 -1. + <_> + 4 8 8 1 2. + <_> + + <_> + 3 6 14 6 -1. + <_> + 10 6 7 3 2. + <_> + 3 9 7 3 2. + <_> + + <_> + 3 6 14 3 -1. + <_> + 3 6 7 3 2. + <_> + + <_> + 0 5 2 2 -1. + <_> + 0 6 2 1 2. + <_> + + <_> + 8 13 4 3 -1. + <_> + 8 14 4 1 3. + <_> + + <_> + 13 0 3 20 -1. + <_> + 14 0 1 20 3. + <_> + + <_> + 10 8 10 3 -1. + <_> + 10 9 10 1 3. + <_> + + <_> + 4 0 3 20 -1. + <_> + 5 0 1 20 3. + <_> + + <_> + 0 8 10 3 -1. + <_> + 0 9 10 1 3. + <_> + + <_> + 12 5 3 4 -1. + <_> + 13 5 1 4 3. + <_> + + <_> + 6 7 12 4 -1. + <_> + 10 7 4 4 3. + <_> + + <_> + 1 14 6 6 -1. + <_> + 1 14 3 3 2. + <_> + 4 17 3 3 2. + <_> + + <_> + 1 17 6 2 -1. + <_> + 1 18 6 1 2. + <_> + + <_> + 14 8 6 12 -1. + <_> + 17 8 3 6 2. + <_> + 14 14 3 6 2. + <_> + + <_> + 18 5 2 2 -1. + <_> + 18 6 2 1 2. + <_> + + <_> + 3 16 4 2 -1. + <_> + 3 16 2 1 2. + <_> + 5 17 2 1 2. + <_> + + <_> + 2 16 6 2 -1. + <_> + 4 16 2 2 3. + <_> + + <_> + 14 8 6 12 -1. + <_> + 17 8 3 6 2. + <_> + 14 14 3 6 2. + <_> + + <_> + 18 5 2 2 -1. + <_> + 18 6 2 1 2. + <_> + + <_> + 5 16 9 2 -1. + <_> + 8 16 3 2 3. + <_> + + <_> + 3 14 6 6 -1. + <_> + 3 14 3 3 2. + <_> + 6 17 3 3 2. + <_> + + <_> + 14 8 6 12 -1. + <_> + 17 8 3 6 2. + <_> + 14 14 3 6 2. + <_> + + <_> + 11 7 2 12 -1. + <_> + 11 11 2 4 3. + <_> + + <_> + 0 8 6 12 -1. + <_> + 0 8 3 6 2. + <_> + 3 14 3 6 2. + <_> + + <_> + 7 7 2 12 -1. + <_> + 7 11 2 4 3. + <_> + + <_> + 14 12 1 2 -1. + <_> + 14 13 1 1 2. + <_> + + <_> + 12 13 8 1 -1. + <_> + 12 13 4 1 2. + <_> + + <_> + 0 3 16 6 -1. + <_> + 0 6 16 3 2. + <_> + + <_> + 1 4 8 2 -1. + <_> + 1 4 4 1 2. + <_> + 5 5 4 1 2. + <_> + + <_> + 14 12 1 2 -1. + <_> + 14 13 1 1 2. + <_> + + <_> + 15 12 2 3 -1. + <_> + 15 13 2 1 3. + <_> + + <_> + 8 16 3 3 -1. + <_> + 8 17 3 1 3. + <_> + + <_> + 5 12 1 2 -1. + <_> + 5 13 1 1 2. + <_> + + <_> + 13 4 3 15 -1. + <_> + 14 4 1 15 3. + <_> + + <_> + 17 3 2 6 -1. + <_> + 18 3 1 3 2. + <_> + 17 6 1 3 2. + <_> + + <_> + 4 4 3 15 -1. + <_> + 5 4 1 15 3. + <_> + + <_> + 1 3 2 6 -1. + <_> + 1 3 1 3 2. + <_> + 2 6 1 3 2. + <_> + + <_> + 7 15 12 4 -1. + <_> + 7 17 12 2 2. + <_> + + <_> + 1 0 19 3 -1. + <_> + 1 1 19 1 3. + <_> + + <_> + 3 17 10 2 -1. + <_> + 3 17 5 1 2. + <_> + 8 18 5 1 2. + <_> + + <_> + 2 5 10 15 -1. + <_> + 2 10 10 5 3. + <_> + + <_> + 13 8 3 4 -1. + <_> + 13 10 3 2 2. + <_> + + <_> + 19 13 1 2 -1. + <_> + 19 14 1 1 2. + <_> + + <_> + 4 8 3 4 -1. + <_> + 4 10 3 2 2. + <_> + + <_> + 0 13 1 2 -1. + <_> + 0 14 1 1 2. + <_> + + <_> + 12 7 2 12 -1. + <_> + 12 13 2 6 2. + <_> + + <_> + 14 7 2 2 -1. + <_> + 15 7 1 1 2. + <_> + 14 8 1 1 2. + <_> + + <_> + 5 3 8 2 -1. + <_> + 5 4 8 1 2. + <_> + + <_> + 0 2 2 6 -1. + <_> + 0 4 2 2 3. + <_> + + <_> + 18 2 2 12 -1. + <_> + 19 2 1 6 2. + <_> + 18 8 1 6 2. + <_> + + <_> + 18 1 1 2 -1. + <_> + 18 2 1 1 2. + <_> + + <_> + 0 2 2 12 -1. + <_> + 0 2 1 6 2. + <_> + 1 8 1 6 2. + <_> + + <_> + 1 1 1 2 -1. + <_> + 1 2 1 1 2. + <_> + + <_> + 16 4 4 14 -1. + <_> + 18 4 2 7 2. + <_> + 16 11 2 7 2. + <_> + + <_> + 10 14 1 6 -1. + <_> + 10 17 1 3 2. + <_> + + <_> + 0 4 4 14 -1. + <_> + 0 4 2 7 2. + <_> + 2 11 2 7 2. + <_> + + <_> + 9 14 1 6 -1. + <_> + 9 17 1 3 2. + <_> + + <_> + 9 14 4 3 -1. + <_> + 9 15 4 1 3. + <_> + + <_> + 4 7 12 2 -1. + <_> + 8 7 4 2 3. + <_> + + <_> + 0 8 4 3 -1. + <_> + 0 9 4 1 3. + <_> + + <_> + 4 7 2 2 -1. + <_> + 4 7 1 1 2. + <_> + 5 8 1 1 2. + <_> + + <_> + 13 7 2 1 -1. + <_> + 13 7 1 1 2. + <_> + + <_> + 11 4 4 5 -1. + <_> + 11 4 2 5 2. + <_> + + <_> + 4 8 3 3 -1. + <_> + 5 8 1 3 3. + <_> + + <_> + 0 3 8 1 -1. + <_> + 4 3 4 1 2. + <_> + + <_> + 13 7 2 1 -1. + <_> + 13 7 1 1 2. + <_> + + <_> + 14 7 3 2 -1. + <_> + 15 7 1 2 3. + <_> + + <_> + 5 7 2 1 -1. + <_> + 6 7 1 1 2. + <_> + + <_> + 3 7 3 2 -1. + <_> + 4 7 1 2 3. + <_> + + <_> + 18 5 2 2 -1. + <_> + 18 6 2 1 2. + <_> + + <_> + 12 14 2 2 -1. + <_> + 13 14 1 1 2. + <_> + 12 15 1 1 2. + <_> + + <_> + 0 5 2 2 -1. + <_> + 0 6 2 1 2. + <_> + + <_> + 6 14 2 2 -1. + <_> + 6 14 1 1 2. + <_> + 7 15 1 1 2. + <_> + + <_> + 7 12 6 5 -1. + <_> + 9 12 2 5 3. + <_> + + <_> + 12 17 5 2 -1. + <_> + 12 18 5 1 2. + <_> + + <_> + 1 11 6 3 -1. + <_> + 4 11 3 3 2. + <_> + + <_> + 1 9 6 3 -1. + <_> + 4 9 3 3 2. + <_> + + <_> + 12 7 2 12 -1. + <_> + 12 13 2 6 2. + <_> + + <_> + 8 7 5 3 -1. + <_> + 8 8 5 1 3. + <_> + + <_> + 6 7 2 12 -1. + <_> + 6 13 2 6 2. + <_> + + <_> + 1 2 9 18 -1. + <_> + 4 2 3 18 3. + <_> + + <_> + 12 17 5 2 -1. + <_> + 12 18 5 1 2. + <_> + + <_> + 4 7 12 2 -1. + <_> + 4 7 6 2 2. + <_> + + <_> + 6 7 6 1 -1. + <_> + 8 7 2 1 3. + <_> + + <_> + 7 3 3 2 -1. + <_> + 8 3 1 2 3. + <_> + + <_> + 9 4 3 1 -1. + <_> + 10 4 1 1 3. + <_> + + <_> + 11 11 3 1 -1. + <_> + 12 11 1 1 3. + <_> + + <_> + 8 4 3 1 -1. + <_> + 9 4 1 1 3. + <_> + + <_> + 6 11 3 1 -1. + <_> + 7 11 1 1 3. + <_> + + <_> + 12 13 6 6 -1. + <_> + 12 15 6 2 3. + <_> + + <_> + 14 13 1 6 -1. + <_> + 14 15 1 2 3. + <_> + + <_> + 2 13 6 6 -1. + <_> + 2 15 6 2 3. + <_> + + <_> + 1 5 18 1 -1. + <_> + 7 5 6 1 3. + <_> + + <_> + 4 7 12 2 -1. + <_> + 10 7 6 1 2. + <_> + 4 8 6 1 2. + <_> + + <_> + 6 1 8 10 -1. + <_> + 10 1 4 5 2. + <_> + 6 6 4 5 2. + <_> + + <_> + 3 13 4 3 -1. + <_> + 3 14 4 1 3. + <_> + + <_> + 6 13 4 3 -1. + <_> + 6 14 4 1 3. + <_> + + <_> + 9 14 4 3 -1. + <_> + 9 15 4 1 3. + <_> + + <_> + 12 9 2 3 -1. + <_> + 12 10 2 1 3. + <_> + + <_> + 7 14 4 3 -1. + <_> + 7 15 4 1 3. + <_> + + <_> + 9 0 2 1 -1. + <_> + 10 0 1 1 2. + <_> + + <_> + 5 0 10 5 -1. + <_> + 5 0 5 5 2. + <_> + + <_> + 6 6 8 7 -1. + <_> + 6 6 4 7 2. + <_> + + <_> + 5 0 10 5 -1. + <_> + 10 0 5 5 2. + <_> + + <_> + 6 6 8 7 -1. + <_> + 10 6 4 7 2. + <_> + + <_> + 5 9 10 8 -1. + <_> + 10 9 5 4 2. + <_> + 5 13 5 4 2. + <_> + + <_> + 10 0 4 10 -1. + <_> + 12 0 2 5 2. + <_> + 10 5 2 5 2. + <_> + + <_> + 1 4 8 3 -1. + <_> + 1 5 8 1 3. + <_> + + <_> + 4 4 8 3 -1. + <_> + 4 5 8 1 3. + <_> + + <_> + 9 7 4 3 -1. + <_> + 9 8 4 1 3. + <_> + + <_> + 12 8 3 12 -1. + <_> + 12 14 3 6 2. + <_> + + <_> + 7 7 4 3 -1. + <_> + 7 8 4 1 3. + <_> + + <_> + 5 8 3 12 -1. + <_> + 5 14 3 6 2. + <_> + + <_> + 10 0 7 6 -1. + <_> + 10 2 7 2 3. + <_> + + <_> + 2 1 18 1 -1. + <_> + 8 1 6 1 3. + <_> + + <_> + 5 0 3 8 -1. + <_> + 6 0 1 8 3. + <_> + + <_> + 4 7 4 2 -1. + <_> + 4 8 4 1 2. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_alt_tree.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_alt_tree.xml new file mode 100644 index 0000000000000000000000000000000000000000..e0420a274333613f57ef8c2661b26780afdde6de --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_alt_tree.xml @@ -0,0 +1,96484 @@ + + + +BOOST + HAAR + 20 + 20 + + 406 + + 0 + 47 + + <_> + 3 + -1.3442519903182983e+00 + + <_> + + 0 -1 0 3.7895569112151861e-03 + + -9.2945802211761475e-01 6.4119851589202881e-01 + <_> + + 0 -1 1 1.2098110280930996e-02 + + -7.1810090541839600e-01 4.7141009569168091e-01 + <_> + + 0 -1 2 1.2138449819758534e-03 + + -7.2831612825393677e-01 3.0330690741539001e-01 + <_> + 9 + -1.6378560066223145e+00 + + <_> + + 0 -1 3 8.7510552257299423e-03 + + -8.5947072505950928e-01 3.6881381273269653e-01 + <_> + + 0 -1 4 2.1986700594425201e-02 + + -6.0180151462554932e-01 3.2897830009460449e-01 + <_> + + 0 -1 5 6.4913398819044232e-04 + + -7.9431951045989990e-01 2.5493299961090088e-01 + <_> + + 0 -1 6 -1.0192029876634479e-03 + + 2.2729329764842987e-01 -6.3627982139587402e-01 + <_> + + 0 -1 7 1.3674780493602157e-03 + + -6.0014182329177856e-01 2.4118369817733765e-01 + <_> + + 0 -1 8 1.0245250305160880e-03 + + -5.8542472124099731e-01 1.2550109624862671e-01 + <_> + + 0 -1 9 1.8465859815478325e-02 + + 1.9563560187816620e-01 -6.7630231380462646e-01 + <_> + + 0 -1 10 4.0901508182287216e-03 + + -4.4916498661041260e-01 2.6677688956260681e-01 + <_> + + 0 -1 11 1.1358099989593029e-02 + + 1.8783229589462280e-01 -6.1379361152648926e-01 + <_> + 16 + -1.7317579984664917e+00 + + <_> + + 0 -1 12 -1.1588949710130692e-02 + + 3.4567040205001831e-01 -7.6478981971740723e-01 + <_> + + 0 -1 13 5.1809530705213547e-03 + + 2.4104920029640198e-01 -6.9623559713363647e-01 + <_> + + 0 -1 14 2.1468549966812134e-03 + + -8.0553662776947021e-01 1.9838610291481018e-01 + <_> + + 0 -1 15 -3.6556499544531107e-03 + + -7.1833139657974243e-01 1.2305679917335510e-01 + <_> + + 0 -1 16 -1.9701640121638775e-03 + + 2.2777689993381500e-01 -4.7520169615745544e-01 + <_> + + 0 -1 17 -3.3645539078861475e-03 + + -4.6095049381256104e-01 2.0394650101661682e-01 + <_> + + 0 -1 18 -7.4126059189438820e-05 + + 1.8213239312171936e-01 -4.7829270362854004e-01 + <_> + + 0 -1 19 -1.7571110278367996e-02 + + -7.1737551689147949e-01 1.1311130225658417e-01 + <_> + + 0 -1 20 6.3840472139418125e-03 + + -4.0205681324005127e-01 2.0730289816856384e-01 + <_> + + 0 -1 21 -1.4723399654030800e-02 + + -6.7558771371841431e-01 6.8973086774349213e-02 + <_> + + 0 -1 22 -5.2889222279191017e-03 + + -6.2105172872543335e-01 1.3349360227584839e-01 + <_> + + 0 -1 23 2.7743630111217499e-02 + + 1.1760850250720978e-01 -5.4641121625900269e-01 + <_> + + 0 -1 24 3.9427559822797775e-02 + + -2.1134279668331146e-01 3.9452999830245972e-01 + <_> + + 0 -1 25 8.6949411779642105e-03 + + 1.2580950558185577e-01 -4.7989100217819214e-01 + <_> + + 0 -1 26 2.8245279099792242e-03 + + 1.9653140008449554e-01 -4.0256679058074951e-01 + <_> + + 0 -1 27 -2.8915189206600189e-02 + + -8.0616527795791626e-01 8.1882260739803314e-02 + <_> + 29 + -1.9308480024337769e+00 + + <_> + + 0 -1 28 8.0171944573521614e-03 + + -6.8981552124023438e-01 2.4136860668659210e-01 + <_> + + 0 -1 29 -2.4478728882968426e-03 + + 2.1353200078010559e-01 -6.4146691560745239e-01 + <_> + + 0 -1 30 1.7917619552463293e-03 + + -6.1445468664169312e-01 1.9236929714679718e-01 + <_> + + 0 -1 31 4.3905500206165016e-04 + + -7.5360429286956787e-01 1.5696890652179718e-01 + <_> + + 0 -1 32 -3.6769549478776753e-04 + + 1.7380510270595551e-01 -5.8404499292373657e-01 + <_> + + 0 -1 33 -4.2802388779819012e-03 + + -6.6968989372253418e-01 1.1289729923009872e-01 + <_> + + 0 -1 34 3.5238768905401230e-03 + + 1.2501940131187439e-01 -7.3299217224121094e-01 + <_> + + 0 -1 35 7.9299701610580087e-04 + + -4.4966199994087219e-01 2.1590930223464966e-01 + <_> + + 0 -1 36 4.4371088733896613e-04 + + -3.8909769058227539e-01 2.1181149780750275e-01 + <_> + + 0 -1 37 -2.7145470958203077e-03 + + -4.6716868877410889e-01 1.5038399398326874e-01 + <_> + + 0 -1 38 -6.9272058317437768e-04 + + -5.8596551418304443e-01 1.1714380234479904e-01 + <_> + + 0 -1 39 4.9261808395385742e-02 + + -1.3800150156021118e-01 4.9366238713264465e-01 + <_> + + 0 -1 40 -2.2837519645690918e-02 + + -6.3743507862091064e-01 1.2324090301990509e-01 + <_> + + 0 -1 41 4.8372112214565277e-03 + + -1.2391629815101624e-01 1.0620889812707901e-01 + <_> + + 0 -1 42 1.0256259702146053e-02 + + -1.8767049908638000e-01 2.9824170470237732e-01 + <_> + + 0 -1 43 1.0618680156767368e-02 + + 1.0612460225820541e-01 -3.3244881033897400e-01 + <_> + + 0 -1 44 2.4113139137625694e-02 + + 8.7200611829757690e-02 -6.6846621036529541e-01 + <_> + + 0 -1 45 -3.6754710599780083e-03 + + 1.1043280363082886e-01 -4.4581958651542664e-01 + <_> + + 0 -1 46 -3.8996201008558273e-02 + + -7.0228111743927002e-01 8.1809490919113159e-02 + <_> + + 0 -1 47 1.5777100343257189e-03 + + 1.5954199433326721e-01 -3.2860770821571350e-01 + <_> + + 0 -1 48 9.1089410707354546e-03 + + 1.0326369851827621e-01 -4.4402560591697693e-01 + <_> + + 0 -1 49 -1.7051609233021736e-02 + + -5.5853348970413208e-01 6.2711499631404877e-02 + <_> + + 0 -1 50 1.3652660418301821e-03 + + -5.3934460878372192e-01 7.0839896798133850e-02 + <_> + + 0 -1 51 -1.1186149902641773e-02 + + -4.7260180115699768e-01 8.1019416451454163e-02 + <_> + + 0 -1 52 -1.1705270037055016e-02 + + 2.4750089645385742e-01 -1.7778989672660828e-01 + <_> + + 0 -1 53 -9.7736932337284088e-02 + + -5.6177508831024170e-01 8.0921821296215057e-02 + <_> + + 0 -1 54 -8.5228063166141510e-02 + + -5.2233248949050903e-01 7.2821393609046936e-02 + <_> + + 0 -1 55 -3.6733459681272507e-02 + + 4.3623578548431396e-01 -9.9339507520198822e-02 + <_> + + 0 -1 56 -3.6704430822283030e-03 + + 1.4834220707416534e-01 -2.7119669318199158e-01 + <_> + 36 + -2.0711259841918945e+00 + + <_> + + 0 -1 57 -1.1610370129346848e-03 + + -5.6377887725830078e-01 2.3568780720233917e-01 + <_> + + 0 -1 58 1.1830299627035856e-03 + + 1.5724280476570129e-01 -6.7728179693222046e-01 + <_> + + 0 -1 59 -2.1273950114846230e-03 + + -6.6150152683258057e-01 1.4943139255046844e-01 + <_> + + 0 -1 60 -1.1893469840288162e-01 + + 5.3225821256637573e-01 -2.2968369722366333e-01 + <_> + + 0 -1 61 -1.3624870218336582e-02 + + -6.0635501146316528e-01 1.7001089453697205e-01 + <_> + + 0 -1 62 -6.3198682619258761e-04 + + -6.8972241878509521e-01 1.1584629863500595e-01 + <_> + + 0 -1 63 -4.4108428992331028e-03 + + -6.2967002391815186e-01 1.2430600076913834e-01 + <_> + + 0 -1 64 -2.2982239723205566e-02 + + -5.0497251749038696e-01 1.6636120155453682e-02 + <_> + + 0 -1 65 -2.3721898905932903e-03 + + -6.2462240457534790e-01 1.3793750107288361e-01 + <_> + + 0 -1 66 8.7364763021469116e-03 + + 1.3996620476245880e-01 -5.4822951555252075e-01 + <_> + + 0 -1 67 6.7737072706222534e-02 + + -1.9172480702400208e-01 5.4700487852096558e-01 + <_> + + 0 -1 68 -4.0138149634003639e-03 + + -5.5429118871688843e-01 1.4517059922218323e-01 + <_> + + 0 -1 69 1.2857170077040792e-04 + + -5.1031237840652466e-01 1.1023940145969391e-01 + <_> + + 0 -1 70 -3.9688948541879654e-02 + + -6.1830729246139526e-01 9.6676096320152283e-02 + <_> + + 0 -1 71 -1.6646150033921003e-03 + + 1.6449889540672302e-01 -3.7186318635940552e-01 + <_> + + 0 -1 72 5.3499247878789902e-03 + + 1.1145050078630447e-01 -3.7441021203994751e-01 + <_> + + 0 -1 73 -2.2904010489583015e-02 + + -5.8097589015960693e-01 1.1077260226011276e-01 + <_> + + 0 -1 74 1.0703450068831444e-02 + + 4.4733259826898575e-02 -5.8116632699966431e-01 + <_> + + 0 -1 75 -4.2331559234298766e-04 + + -5.4423791170120239e-01 8.7089292705059052e-02 + <_> + + 0 -1 76 1.5554429963231087e-02 + + 5.6884340941905975e-02 -3.7645170092582703e-01 + <_> + + 0 -1 77 -2.0539449527859688e-02 + + -3.8714569807052612e-01 1.1833839863538742e-01 + <_> + + 0 -1 78 -3.1234358903020620e-03 + + 8.3635427057743073e-02 -1.9862389564514160e-01 + <_> + + 0 -1 79 2.3932829499244690e-02 + + 7.9600542783737183e-02 -6.5370100736618042e-01 + <_> + + 0 -1 80 8.3920456469058990e-02 + + -1.0653129965066910e-01 4.8772820830345154e-01 + <_> + + 0 -1 81 1.6003159806132317e-02 + + 8.3643212914466858e-02 -5.9207731485366821e-01 + <_> + + 0 -1 82 5.8071441017091274e-03 + + 8.7997503578662872e-02 -3.3279138803482056e-01 + <_> + + 0 -1 83 -8.1104427576065063e-02 + + 6.3775187730789185e-01 -6.7692361772060394e-02 + <_> + + 0 -1 84 4.5403029769659042e-02 + + -5.1510389894247055e-02 3.0225670337677002e-01 + <_> + + 0 -1 85 1.3877229765057564e-02 + + 9.9967628717422485e-02 -4.6520909667015076e-01 + <_> + + 0 -1 86 3.4590709954500198e-02 + + -9.7614437341690063e-02 3.4678751230239868e-01 + <_> + + 0 -1 87 1.5704549849033356e-02 + + 7.6344117522239685e-02 -5.3356319665908813e-01 + <_> + + 0 -1 88 -1.0420549660921097e-01 + + 6.1890971660614014e-01 -4.4259760528802872e-02 + <_> + + 0 -1 89 1.3443189859390259e-01 + + -5.9853021055459976e-02 6.3635712862014771e-01 + <_> + + 0 -1 90 -2.5646309368312359e-03 + + -5.3600472211837769e-01 7.3116026818752289e-02 + <_> + + 0 -1 91 1.8647089600563049e-02 + + 6.9856151938438416e-02 -5.6878322362899780e-01 + <_> + + 0 -1 92 1.5159539878368378e-02 + + 1.8206339329481125e-02 -2.7663159370422363e-01 + <_> + 7 + -2.1360809803009033e+00 + + <_> + + 0 -1 93 1.4778429269790649e-01 + + -8.9933121204376221e-01 5.7035928964614868e-01 + <_> + + 0 -1 94 2.9984670877456665e-01 + + -6.5394151210784912e-01 3.5054451227188110e-01 + <_> + + 0 -1 95 -7.9061716794967651e-02 + + 4.4085291028022766e-01 -6.5087568759918213e-01 + <_> + + 0 -1 96 5.8428961783647537e-02 + + -4.2665359377861023e-01 5.8410567045211792e-01 + <_> + + 0 -1 97 -1.4664280228316784e-02 + + 3.2435241341590881e-01 -5.9659618139266968e-01 + <_> + + 0 -1 98 3.9517199993133545e-01 + + -7.5798347592353821e-02 4.8659950494766235e-01 + <_> + + 0 -1 99 1.1040589958429337e-01 + + -8.4556102752685547e-01 2.1374569833278656e-01 + <_> + 50 + -1.8755869865417480e+00 + + <_> + + 0 -1 100 3.7777079269289970e-03 + + 1.8744400143623352e-01 -6.5354061126708984e-01 + <_> + + 0 -1 101 5.3003188222646713e-03 + + 9.3951843678951263e-02 -5.6917887926101685e-01 + <_> + + 0 -1 102 -5.5426009930670261e-03 + + 1.6031709313392639e-01 -5.1822239160537720e-01 + <_> + + 0 -1 103 -9.1971885412931442e-03 + + -5.7420462369918823e-01 1.4791400730609894e-01 + <_> + + 0 -1 104 5.3701602155342698e-04 + + -7.0449697971343994e-01 1.0752149671316147e-01 + <_> + + 0 -1 105 -2.2125479299575090e-03 + + -5.0877428054809570e-01 1.1367189884185791e-01 + <_> + + 0 -1 106 1.1675730347633362e-02 + + 8.4258683025836945e-02 -6.7384701967239380e-01 + <_> + + 0 -1 107 -2.0404369570314884e-03 + + 1.6251119971275330e-01 -4.1435649991035461e-01 + <_> + + 0 -1 108 -7.6540438458323479e-03 + + -4.2833179235458374e-01 1.3060709834098816e-01 + <_> + + 0 -1 109 2.9370479285717010e-02 + + 5.4651051759719849e-02 -3.4795379638671875e-01 + <_> + + 0 -1 110 -9.5828901976346970e-03 + + -4.8620718717575073e-01 1.1706890165805817e-01 + <_> + + 0 -1 111 6.0666278004646301e-03 + + -3.6553880572319031e-01 8.7813600897789001e-02 + <_> + + 0 -1 112 1.7992249922826886e-03 + + 1.6035990417003632e-01 -3.0859109759330750e-01 + <_> + + 0 -1 113 -1.0092309676110744e-02 + + -3.9505869150161743e-01 1.1514779925346375e-01 + <_> + + 0 -1 114 2.5171819142997265e-03 + + -3.0043110251426697e-01 1.8256050348281860e-01 + <_> + + 0 -1 115 -1.7089240252971649e-02 + + -5.2173590660095215e-01 9.7457267343997955e-02 + <_> + + 0 -1 116 -5.5856268852949142e-02 + + 5.3540021181106567e-01 -8.9221552014350891e-02 + <_> + + 0 -1 117 -2.3930610623210669e-03 + + -4.7012439370155334e-01 8.6141407489776611e-02 + <_> + + 0 -1 118 3.6918919067829847e-03 + + -2.7755591273307800e-01 1.5186099708080292e-01 + <_> + + 0 -1 119 2.1945969201624393e-03 + + -1.6867069900035858e-01 1.1952520161867142e-01 + <_> + + 0 -1 120 2.9675459954887629e-03 + + -3.8940680027008057e-01 1.0388910025358200e-01 + <_> + + 0 -1 121 1.9976729527115822e-03 + + 9.1141343116760254e-02 -4.1050049662590027e-01 + <_> + + 0 -1 122 -2.0369699224829674e-02 + + -5.9968769550323486e-01 6.9301806390285492e-02 + <_> + + 0 -1 123 2.3318571038544178e-03 + + 6.1892550438642502e-02 -3.2886800169944763e-01 + <_> + + 0 -1 124 -4.2863588780164719e-02 + + -7.3844969272613525e-01 5.7071659713983536e-02 + <_> + + 0 -1 125 1.1471749749034643e-03 + + -5.1379621028900146e-01 7.1196496486663818e-02 + <_> + + 0 -1 126 -1.3735669665038586e-02 + + -5.3785508871078491e-01 6.5542042255401611e-02 + <_> + + 0 -1 127 4.7165591269731522e-02 + + 4.5389361679553986e-02 -6.8944799900054932e-01 + <_> + + 0 -1 128 -1.1204879730939865e-02 + + 1.6932639479637146e-01 -2.3061719536781311e-01 + <_> + + 0 -1 129 -1.5478420257568359e-01 + + -7.7705371379852295e-01 1.2142470106482506e-02 + <_> + + 0 -1 130 5.8086342178285122e-03 + + 1.1318100243806839e-01 -3.3206319808959961e-01 + <_> + + 0 -1 131 -2.8529569506645203e-02 + + -5.6747281551361084e-01 4.8734560608863831e-02 + <_> + + 0 -1 132 -3.8758948445320129e-02 + + 5.9423100948333740e-01 -7.5139336287975311e-02 + <_> + + 0 -1 133 3.1037809327244759e-02 + + 5.1973540335893631e-02 -5.8552652597427368e-01 + <_> + + 0 -1 134 7.4786080404010136e-06 + + -2.7623200416564941e-01 1.4088490605354309e-01 + <_> + + 0 -1 135 3.1000260263681412e-02 + + 3.1331729143857956e-02 -5.6860172748565674e-01 + <_> + + 0 -1 136 -4.9860659986734390e-02 + + -8.2924622297286987e-01 3.8801580667495728e-02 + <_> + + 0 -1 137 -4.2323280125856400e-02 + + -4.3062108755111694e-01 1.6579480841755867e-02 + <_> + + 0 -1 138 9.1987219639122486e-04 + + -2.1154449880123138e-01 1.5517529845237732e-01 + <_> + + 0 -1 139 2.0559869706630707e-01 + + -6.2403179705142975e-02 3.2229611277580261e-01 + <_> + + 0 -1 140 2.9118418693542480e-01 + + 3.9228469133377075e-02 -9.4128221273422241e-01 + <_> + + 0 -1 141 7.8337509185075760e-03 + + -1.4806599915027618e-01 1.7849209904670715e-01 + <_> + + 0 -1 142 1.1393319815397263e-02 + + 7.7987723052501678e-02 -4.2424258589744568e-01 + <_> + + 0 -1 143 -9.1807022690773010e-02 + + 3.3689481019973755e-01 -5.6174129247665405e-02 + <_> + + 0 -1 144 -1.6038250178098679e-02 + + -2.4954010546207428e-01 1.4570869505405426e-01 + <_> + + 0 -1 145 5.4830290377140045e-02 + + -1.5496000647544861e-01 2.0329600572586060e-01 + <_> + + 0 -1 146 2.4449700489640236e-02 + + 6.0974378138780594e-02 -6.3072341680526733e-01 + <_> + + 0 -1 147 2.9260670766234398e-02 + + 4.6833608299493790e-02 -3.7985381484031677e-01 + <_> + + 0 -1 148 3.9965552277863026e-03 + + -1.6927300393581390e-01 1.9100320339202881e-01 + <_> + + 0 -1 149 -6.9938853383064270e-02 + + 5.4655587673187256e-01 -5.4965749382972717e-02 + <_> + 25 + -1.9646480083465576e+00 + + <_> + + 0 -1 150 4.5835621654987335e-02 + + -4.9982848763465881e-01 4.0961080789566040e-01 + <_> + + 0 -1 151 2.6363100856542587e-02 + + -3.9193201065063477e-01 5.1567757129669189e-01 + <_> + + 0 -1 152 1.5189830213785172e-02 + + -5.2216362953186035e-01 3.1368219852447510e-01 + <_> + + 0 -1 153 -2.0805280655622482e-02 + + 3.7614479660987854e-01 -4.7375538945198059e-01 + <_> + + 0 -1 154 -7.4902721680700779e-03 + + 1.6283489763736725e-01 -7.0384472608566284e-01 + <_> + + 0 -1 155 2.7719369530677795e-01 + + -1.6404120624065399e-01 3.3481580018997192e-01 + <_> + + 0 -1 156 6.4188443124294281e-02 + + -8.0176621675491333e-01 1.2763829529285431e-01 + <_> + + 0 -1 157 4.0668170899152756e-02 + + -3.3386930823326111e-01 2.8456181287765503e-01 + <_> + + 0 -1 158 7.4888020753860474e-03 + + -3.7188920378684998e-01 2.5932261347770691e-01 + <_> + + 0 -1 159 6.4942672848701477e-02 + + 1.0372909903526306e-01 -7.1671068668365479e-01 + <_> + + 0 -1 160 -2.1149769891053438e-03 + + -7.5683927536010742e-01 7.9019591212272644e-02 + <_> + + 0 -1 161 -4.8293141298927367e-04 + + -4.9852079153060913e-01 8.1111326813697815e-02 + <_> + + 0 -1 162 1.3996459543704987e-01 + + 8.7497599422931671e-02 -7.6389372348785400e-01 + <_> + + 0 -1 163 5.2211988717317581e-02 + + 3.1640481203794479e-02 -5.3281372785568237e-01 + <_> + + 0 -1 164 3.0680459458380938e-03 + + -6.2458527088165283e-01 1.3869540393352509e-01 + <_> + + 0 -1 165 5.0478860735893250e-02 + + 7.9063497483730316e-02 -7.4017041921615601e-01 + <_> + + 0 -1 166 -8.5122063755989075e-03 + + -4.9971660971641541e-01 1.1132259666919708e-01 + <_> + + 0 -1 167 7.0091806352138519e-02 + + 9.7081907093524933e-02 -6.1879187822341919e-01 + <_> + + 0 -1 168 -2.7261190116405487e-03 + + 9.7546629607677460e-02 -5.7760041952133179e-01 + <_> + + 0 -1 169 1.0676559992134571e-02 + + -2.9058128595352173e-01 1.8426120281219482e-01 + <_> + + 0 -1 170 6.3848652644082904e-04 + + 1.3869750499725342e-01 -4.2546540498733521e-01 + <_> + + 0 -1 171 -4.7957260161638260e-02 + + -7.3249137401580811e-01 4.1188109666109085e-02 + <_> + + 0 -1 172 1.7140049487352371e-02 + + -3.1973451375961304e-01 1.6840089857578278e-01 + <_> + + 0 -1 173 7.8544542193412781e-02 + + 5.0053231418132782e-02 -7.1410048007965088e-01 + <_> + + 0 -1 174 -1.1342849582433701e-02 + + -3.8810971379280090e-01 1.2976409494876862e-01 + <_> + 53 + -2.1222629547119141e+00 + + <_> + + 0 -1 175 -8.6751781054772437e-05 + + 2.5179910659790039e-01 -6.7723119258880615e-01 + <_> + + 0 -1 176 2.0550179481506348e-01 + + 2.0217150449752808e-02 -3.3618199825286865e-01 + <_> + + 0 -1 177 1.3893260061740875e-01 + + 1.0678269714117050e-01 -8.6710119247436523e-01 + <_> + + 0 -1 178 2.6432450395077467e-03 + + -4.1057088971138000e-01 2.5603920221328735e-01 + <_> + + 0 -1 179 -1.6145260306075215e-03 + + 1.7448160052299500e-01 -5.0290131568908691e-01 + <_> + + 0 -1 180 -4.6492749825119972e-03 + + -8.3960932493209839e-01 1.0409969836473465e-01 + <_> + + 0 -1 181 -5.5983918718993664e-03 + + -5.2673357725143433e-01 1.2114489823579788e-01 + <_> + + 0 -1 182 2.1482799202203751e-03 + + 8.6831927299499512e-02 -5.2384740114212036e-01 + <_> + + 0 -1 183 -2.2942349314689636e-03 + + 1.5666730701923370e-01 -3.9387580752372742e-01 + <_> + + 0 -1 184 -1.0809659725055099e-03 + + 9.4777546823024750e-02 -5.7967597246170044e-01 + <_> + + 0 -1 185 -1.8739879131317139e-02 + + -4.3780770897865295e-01 1.2754319608211517e-01 + <_> + + 0 -1 186 -2.0956669468432665e-03 + + 2.1275860071182251e-01 -1.7645539343357086e-01 + <_> + + 0 -1 187 -6.1370119452476501e-02 + + -6.7007988691329956e-01 8.5291177034378052e-02 + <_> + + 0 -1 188 -4.5074969530105591e-02 + + -4.7614151239395142e-01 3.8384389132261276e-02 + <_> + + 0 -1 189 4.5961341820657253e-03 + + 9.0776696801185608e-02 -5.3642177581787109e-01 + <_> + + 0 -1 190 -5.6205179542303085e-02 + + -4.4128128886222839e-01 2.6340639218688011e-02 + <_> + + 0 -1 191 -1.7070030793547630e-02 + + 3.1962528824806213e-01 -1.5699079632759094e-01 + <_> + + 0 -1 192 1.3778540305793285e-02 + + -4.1468238830566406e-01 1.0832040011882782e-01 + <_> + + 0 -1 193 5.6932470761239529e-03 + + 1.0973270237445831e-01 -4.1420969367027283e-01 + <_> + + 0 -1 194 1.1573060182854533e-03 + + -4.6996459364891052e-01 1.4088229835033417e-01 + <_> + + 0 -1 195 -4.3259391532046720e-05 + + -5.9117478132247925e-01 7.2208836674690247e-02 + <_> + + 0 -1 196 -1.4467669825535268e-04 + + 1.4340500533580780e-01 -2.0809020102024078e-01 + <_> + + 0 -1 197 -3.0667539685964584e-02 + + -6.4181727170944214e-01 7.6316222548484802e-02 + <_> + + 0 -1 198 6.4002368599176407e-03 + + -1.5426200628280640e-01 2.0618820190429688e-01 + <_> + + 0 -1 199 2.7318780776113272e-03 + + -1.8429130315780640e-01 2.2046269476413727e-01 + <_> + + 0 -1 200 -4.1759859770536423e-02 + + 5.1284658908843994e-01 -4.3097220361232758e-02 + <_> + + 0 -1 201 -3.0174419283866882e-02 + + -3.6134809255599976e-01 1.1633390188217163e-01 + <_> + + 0 -1 202 6.8081771023571491e-03 + + -2.5953280925750732e-01 1.4927390217781067e-01 + <_> + + 0 -1 203 4.3430369347333908e-02 + + 6.8601243197917938e-02 -5.8221191167831421e-01 + <_> + + 0 -1 204 2.1121300756931305e-02 + + -8.5372917354106903e-02 8.0498583614826202e-02 + <_> + + 0 -1 205 9.9840283393859863e-02 + + 5.3292520344257355e-02 -7.1819657087326050e-01 + <_> + + 0 -1 206 5.6953770108520985e-03 + + -8.8976107537746429e-02 1.3483940064907074e-01 + <_> + + 0 -1 207 -5.9984568506479263e-02 + + 6.8324291706085205e-01 -5.1916271448135376e-02 + <_> + + 0 -1 208 5.9353262186050415e-03 + + 1.0305190086364746e-01 -2.5361439585685730e-01 + <_> + + 0 -1 209 -7.4867930379696190e-05 + + 1.3340729475021362e-01 -2.9323559999465942e-01 + <_> + + 0 -1 210 -2.5437519070692360e-04 + + 1.5335780382156372e-01 -1.9387570023536682e-01 + <_> + + 0 -1 211 7.7576987678185105e-04 + + -3.1155571341514587e-01 1.0632509738206863e-01 + <_> + + 0 -1 212 5.4478500038385391e-02 + + 2.6277480646967888e-02 -6.6687411069869995e-01 + <_> + + 0 -1 213 1.2692850083112717e-02 + + 9.3613043427467346e-02 -3.9152190089225769e-01 + <_> + + 0 -1 214 -3.0766960233449936e-02 + + -5.9238088130950928e-01 4.8314999788999557e-02 + <_> + + 0 -1 215 -1.9366150721907616e-02 + + 4.3661609292030334e-01 -8.8672943413257599e-02 + <_> + + 0 -1 216 -2.8705620206892490e-03 + + 1.5244780480861664e-01 -1.3861170411109924e-01 + <_> + + 0 -1 217 4.0003698319196701e-02 + + 5.8748051524162292e-02 -6.9119709730148315e-01 + <_> + + 0 -1 218 -8.1130467355251312e-02 + + -7.8684318065643311e-01 2.0421498920768499e-03 + <_> + + 0 -1 219 -2.1017501130700111e-03 + + 1.9100449979305267e-01 -1.9659680128097534e-01 + <_> + + 0 -1 220 8.6481617763638496e-03 + + 8.8689289987087250e-02 -3.7414151430130005e-01 + <_> + + 0 -1 221 -5.2429020404815674e-02 + + -7.2615998983383179e-01 3.9465688169002533e-02 + <_> + + 0 -1 222 3.4464800264686346e-03 + + -1.1640899628400803e-01 2.7386268973350525e-01 + <_> + + 0 -1 223 -7.0581152103841305e-03 + + -3.6283940076828003e-01 9.2023678123950958e-02 + <_> + + 0 -1 224 -5.7412259280681610e-02 + + -8.8839381933212280e-01 2.6647759601473808e-02 + <_> + + 0 -1 225 3.3479030244052410e-03 + + -1.4884050190448761e-01 1.8366430699825287e-01 + <_> + + 0 -1 226 -5.3958419710397720e-02 + + 3.8098138570785522e-01 -4.4046580791473389e-02 + <_> + + 0 -1 227 -2.5719689205288887e-02 + + 3.2570821046829224e-01 -1.0078220069408417e-01 + <_> + 44 + -2.1038460731506348e+00 + + <_> + + 0 -1 228 1.2441220134496689e-01 + + -3.8573729991912842e-01 3.9273661375045776e-01 + <_> + + 0 -1 229 3.7802878767251968e-02 + + -4.7028678655624390e-01 3.5786831378936768e-01 + <_> + + 0 -1 230 3.0441429466009140e-02 + + -3.9460399746894836e-01 3.2518500089645386e-01 + <_> + + 0 -1 231 3.9223438943736255e-04 + + -4.5166510343551636e-01 1.9672380387783051e-01 + <_> + + 0 -1 232 3.9077710360288620e-02 + + -2.1073329448699951e-01 4.3864768743515015e-01 + <_> + + 0 -1 233 -8.9118082541972399e-05 + + 1.5196959674358368e-01 -5.9563517570495605e-01 + <_> + + 0 -1 234 8.8415127247571945e-03 + + -4.9292489886283875e-01 1.7406579852104187e-01 + <_> + + 0 -1 235 1.3666059821844101e-02 + + 9.2861749231815338e-02 -5.5182307958602905e-01 + <_> + + 0 -1 236 -6.1203300952911377e-02 + + -6.7985290288925171e-01 1.0049080103635788e-01 + <_> + + 0 -1 237 5.7719892356544733e-04 + + -5.8301997184753418e-01 1.1089629679918289e-01 + <_> + + 0 -1 238 2.8370460495352745e-04 + + -5.9793341159820557e-01 9.3898378312587738e-02 + <_> + + 0 -1 239 1.7665980383753777e-02 + + -2.2015470266342163e-01 3.4533089399337769e-01 + <_> + + 0 -1 240 2.5697330012917519e-02 + + -3.6195701360702515e-01 1.6877350211143494e-01 + <_> + + 0 -1 241 -4.0316689759492874e-02 + + 2.2964400053024292e-01 -2.9301440715789795e-01 + <_> + + 0 -1 242 4.6522719785571098e-03 + + -5.8995968103408813e-01 1.0466910153627396e-01 + <_> + + 0 -1 243 -1.3406000100076199e-02 + + -3.9572098851203918e-01 8.3528116345405579e-02 + <_> + + 0 -1 244 3.6127280443906784e-02 + + 9.4165802001953125e-02 -5.4097181558609009e-01 + <_> + + 0 -1 245 2.2792080417275429e-03 + + 1.2819069623947144e-01 -3.6514538526535034e-01 + <_> + + 0 -1 246 1.4454070478677750e-03 + + -2.3281599581241608e-01 1.9829919934272766e-01 + <_> + + 0 -1 247 5.7482529431581497e-02 + + 7.5042396783828735e-02 -5.7704979181289673e-01 + <_> + + 0 -1 248 3.3360819797962904e-03 + + 8.8012017309665680e-02 -4.6779251098632812e-01 + <_> + + 0 -1 249 3.7225749343633652e-02 + + 3.2155111432075500e-02 -6.6346621513366699e-01 + <_> + + 0 -1 250 1.6612760722637177e-02 + + 9.1689839959144592e-02 -5.2128171920776367e-01 + <_> + + 0 -1 251 2.0543249323964119e-02 + + -2.8753378987312317e-01 1.4261309802532196e-01 + <_> + + 0 -1 252 -1.5633470320608467e-04 + + 2.0246730744838715e-01 -2.2424469888210297e-01 + <_> + + 0 -1 253 1.2188810110092163e-01 + + -1.6461309790611267e-01 1.7583920061588287e-01 + <_> + + 0 -1 254 4.6413440257310867e-02 + + -6.8978017568588257e-01 6.4349927008152008e-02 + <_> + + 0 -1 255 1.4946439862251282e-01 + + 3.9805840700864792e-02 -7.0177328586578369e-01 + <_> + + 0 -1 256 1.4346869662404060e-02 + + 9.2628777027130127e-02 -4.6314170956611633e-01 + <_> + + 0 -1 257 3.6158718168735504e-02 + + 6.4412936568260193e-02 -6.5277212858200073e-01 + <_> + + 0 -1 258 -5.5098228156566620e-02 + + -6.1021989583969116e-01 6.6034287214279175e-02 + <_> + + 0 -1 259 -3.2978600356727839e-03 + + 8.6579866707324982e-02 -2.1844820678234100e-01 + <_> + + 0 -1 260 4.1257790289819241e-03 + + -4.4980299472808838e-01 9.3251250684261322e-02 + <_> + + 0 -1 261 3.3465269953012466e-02 + + 1.4524499885737896e-02 -4.0200001001358032e-01 + <_> + + 0 -1 262 -2.2584630176424980e-02 + + -6.0067617893218994e-01 6.4416721463203430e-02 + <_> + + 0 -1 263 -7.1505038067698479e-03 + + 6.7139469087123871e-02 -1.2947300076484680e-01 + <_> + + 0 -1 264 -5.1440041512250900e-02 + + -4.8466479778289795e-01 8.2093752920627594e-02 + <_> + + 0 -1 265 -1.9100949168205261e-02 + + -3.5394379496574402e-01 1.0851690173149109e-01 + <_> + + 0 -1 266 6.9468282163143158e-03 + + 1.5407569706439972e-01 -2.3040190339088440e-01 + <_> + + 0 -1 267 -2.3886600509285927e-02 + + 4.9007979035377502e-01 -5.9650428593158722e-02 + <_> + + 0 -1 268 -1.3964619720354676e-03 + + -3.3704701066017151e-01 1.1569459736347198e-01 + <_> + + 0 -1 269 2.6320600882172585e-02 + + -3.9132680743932724e-02 3.7615358829498291e-01 + <_> + + 0 -1 270 5.0336541607975960e-03 + + -3.5457020998001099e-01 1.0786720365285873e-01 + <_> + + 0 -1 271 -1.1523960158228874e-02 + + 3.5148641467094421e-01 -1.1373709887266159e-01 + <_> + 72 + -1.9109580516815186e+00 + + <_> + + 0 -1 272 -5.6698019616305828e-03 + + 2.5299090147018433e-01 -5.5377197265625000e-01 + <_> + + 0 -1 273 1.2186550302430987e-03 + + 9.1723538935184479e-02 -6.5661650896072388e-01 + <_> + + 0 -1 274 3.1903409399092197e-03 + + 1.2116809934377670e-01 -5.4405361413955688e-01 + <_> + + 0 -1 275 -1.2117680162191391e-02 + + -6.8211251497268677e-01 1.1178220063447952e-01 + <_> + + 0 -1 276 2.2634069900959730e-03 + + -5.6313961744308472e-01 9.9629260599613190e-02 + <_> + + 0 -1 277 2.2871519904583693e-03 + + -5.0227242708206177e-01 1.1288029700517654e-01 + <_> + + 0 -1 278 -7.4018500745296478e-03 + + -5.0622308254241943e-01 1.0325270146131516e-01 + <_> + + 0 -1 279 6.5725757740437984e-03 + + 3.1603671610355377e-02 -4.5879349112510681e-01 + <_> + + 0 -1 280 -1.7237069085240364e-02 + + -3.6556100845336914e-01 1.4122049510478973e-01 + <_> + + 0 -1 281 -1.7646619817242026e-03 + + 1.8962210416793823e-01 -3.4349760413169861e-01 + <_> + + 0 -1 282 2.6085950434207916e-02 + + 8.7369233369827271e-02 -5.3332161903381348e-01 + <_> + + 0 -1 283 8.5357967764139175e-03 + + -3.7360730767250061e-01 1.4508520066738129e-01 + <_> + + 0 -1 284 -6.2934341840445995e-03 + + -4.5775079727172852e-01 1.0016269981861115e-01 + <_> + + 0 -1 285 9.7081549465656281e-02 + + 3.3761640079319477e-03 -8.4679859876632690e-01 + <_> + + 0 -1 286 -9.9455721676349640e-02 + + 7.7892357110977173e-01 -5.4456088691949844e-02 + <_> + + 0 -1 287 3.9128549396991730e-02 + + 3.9479929953813553e-02 -4.6620211005210876e-01 + <_> + + 0 -1 288 6.8423762917518616e-02 + + 4.8163410276174545e-02 -8.1910741329193115e-01 + <_> + + 0 -1 289 -1.7304550856351852e-02 + + -4.6001830697059631e-01 2.1781340241432190e-02 + <_> + + 0 -1 290 4.5203989429865032e-05 + + 1.5590970218181610e-01 -2.5734600424766541e-01 + <_> + + 0 -1 291 -5.3720749914646149e-02 + + -7.3984587192535400e-01 2.3658139631152153e-02 + <_> + + 0 -1 292 -2.1576840663328767e-04 + + 1.1803720146417618e-01 -3.5380458831787109e-01 + <_> + + 0 -1 293 1.2613219441846013e-03 + + -1.8313080072402954e-01 1.6306960582733154e-01 + <_> + + 0 -1 294 2.2714029997587204e-02 + + -9.5647342503070831e-02 3.8062781095504761e-01 + <_> + + 0 -1 295 2.0958330482244492e-02 + + 6.1185598373413086e-02 -5.2644938230514526e-01 + <_> + + 0 -1 296 1.5458449721336365e-02 + + 6.4466789364814758e-02 -4.7441288828849792e-01 + <_> + + 0 -1 297 -5.0828810781240463e-03 + + 1.0018830001354218e-01 -3.6397251486778259e-01 + <_> + + 0 -1 298 1.1842510430142283e-03 + + -2.0603519678115845e-01 1.7129589617252350e-01 + <_> + + 0 -1 299 5.0187770277261734e-02 + + -7.0924967527389526e-02 1.0435319691896439e-01 + <_> + + 0 -1 300 1.7535200715065002e-01 + + 3.7766210734844208e-02 -8.0802738666534424e-01 + <_> + + 0 -1 301 -6.8425558507442474e-02 + + -5.0214898586273193e-01 5.4671119898557663e-02 + <_> + + 0 -1 302 2.2496099118143320e-03 + + -2.8013509511947632e-01 1.0950099676847458e-01 + <_> + + 0 -1 303 8.5355632007122040e-02 + + 3.3376980572938919e-02 -7.3676842451095581e-01 + <_> + + 0 -1 304 -2.8825979679822922e-02 + + -4.8528099060058594e-01 4.9596078693866730e-02 + <_> + + 0 -1 305 -1.3562700478360057e-03 + + 1.8493090569972992e-01 -1.6541489958763123e-01 + <_> + + 0 -1 306 1.5731659950688481e-03 + + 9.0431816875934601e-02 -3.0193880200386047e-01 + <_> + + 0 -1 307 -5.2912188693881035e-03 + + -4.3963611125946045e-01 4.6880699694156647e-02 + <_> + + 0 -1 308 4.2200140655040741e-02 + + -7.5348012149333954e-02 3.7712809443473816e-01 + <_> + + 0 -1 309 3.1030770391225815e-02 + + 6.6053368151187897e-02 -4.7378420829772949e-01 + <_> + + 0 -1 310 8.0451928079128265e-03 + + -7.7326983213424683e-02 3.4898889064788818e-01 + <_> + + 0 -1 311 2.3791180923581123e-02 + + 4.8629928380250931e-02 -5.8155477046966553e-01 + <_> + + 0 -1 312 -2.6884680613875389e-02 + + 7.3852258920669556e-01 -4.0025118738412857e-02 + <_> + + 0 -1 313 -1.7013859469443560e-03 + + 1.4116409420967102e-01 -1.8305079638957977e-01 + <_> + + 0 -1 314 -3.2258979976177216e-02 + + -6.4598697423934937e-01 4.1774179786443710e-02 + <_> + + 0 -1 315 -9.1719552874565125e-02 + + 6.3651692867279053e-01 -4.4406279921531677e-02 + <_> + + 0 -1 316 1.1253220029175282e-02 + + -1.0398969799280167e-01 2.4386499822139740e-01 + <_> + + 0 -1 317 9.1702006757259369e-03 + + -1.0142300277948380e-01 1.7325720191001892e-01 + <_> + + 0 -1 318 -3.7584431469440460e-02 + + -6.5999048948287964e-01 3.5357259213924408e-02 + <_> + + 0 -1 319 1.4904039562679827e-04 + + -1.2504950165748596e-01 1.0161379724740982e-01 + <_> + + 0 -1 320 5.6240631965920329e-04 + + -2.1511219441890717e-01 1.0537440329790115e-01 + <_> + + 0 -1 321 -1.7314270138740540e-02 + + -1.6798290610313416e-01 6.1207499355077744e-02 + <_> + + 0 -1 322 -1.5429870225489140e-02 + + 2.5674480199813843e-01 -9.7193486988544464e-02 + <_> + + 0 -1 323 -1.5612079761922359e-02 + + -3.5797500610351562e-01 6.9260068237781525e-02 + <_> + + 0 -1 324 7.4424187187105417e-04 + + -1.5740460157394409e-01 1.4921070635318756e-01 + <_> + + 0 -1 325 7.9008340835571289e-02 + + 3.5924728959798813e-02 -6.4907592535018921e-01 + <_> + + 0 -1 326 -3.3477540127933025e-03 + + -2.5794708728790283e-01 8.1626862287521362e-02 + <_> + + 0 -1 327 3.5589419305324554e-02 + + -4.6870049089193344e-02 5.3945267200469971e-01 + <_> + + 0 -1 328 7.6168961822986603e-04 + + 8.0409869551658630e-02 -2.8045970201492310e-01 + <_> + + 0 -1 329 9.6126887947320938e-03 + + 9.2715777456760406e-02 -2.2755210101604462e-01 + <_> + + 0 -1 330 3.4582789987325668e-02 + + -9.5495507121086121e-02 2.8116491436958313e-01 + <_> + + 0 -1 331 -8.2031842321157455e-03 + + -3.3162289857864380e-01 4.0629711002111435e-02 + <_> + + 0 -1 332 2.5540109723806381e-02 + + 7.0458933711051941e-02 -3.2799351215362549e-01 + <_> + + 0 -1 333 -3.1389920040965080e-03 + + 1.2529349327087402e-01 -6.0766801238059998e-02 + <_> + + 0 -1 334 4.5892409980297089e-03 + + -9.5335446298122406e-02 2.4738679826259613e-01 + <_> + + 0 -1 335 -2.3260030895471573e-02 + + -2.3823159933090210e-01 3.3502969890832901e-02 + <_> + + 0 -1 336 1.7964519793167710e-03 + + 8.9843861758708954e-02 -2.8049159049987793e-01 + <_> + + 0 -1 337 -1.0952910035848618e-01 + + -4.6206548810005188e-01 7.4333418160676956e-03 + <_> + + 0 -1 338 6.8442770279943943e-03 + + 7.3520109057426453e-02 -3.6190700531005859e-01 + <_> + + 0 -1 339 -7.3719851672649384e-02 + + 4.1131800413131714e-01 -6.8293057382106781e-02 + <_> + + 0 -1 340 9.4485012814402580e-03 + + -1.2132299691438675e-01 2.1491959691047668e-01 + <_> + + 0 -1 341 -7.4686057865619659e-02 + + 2.4292010068893433e-01 -3.8520719856023788e-02 + <_> + + 0 -1 342 -1.8958229571580887e-02 + + -3.7263819575309753e-01 6.8381950259208679e-02 + <_> + + 0 -1 343 -8.3170487778261304e-04 + + 9.5785446465015411e-02 -1.0169020295143127e-01 + <_> + 54 + -2.0048389434814453e+00 + + <_> + + 0 -1 344 1.5233230590820312e-01 + + -3.1805351376533508e-01 4.7039988636970520e-01 + <_> + + 0 -1 345 8.8482722640037537e-03 + + -3.6134269833564758e-01 2.7332958579063416e-01 + <_> + + 0 -1 346 2.9788410291075706e-02 + + -2.8059279918670654e-01 3.6270239949226379e-01 + <_> + + 0 -1 347 5.2725639194250107e-02 + + -1.9320569932460785e-01 3.5507258772850037e-01 + <_> + + 0 -1 348 2.6077419519424438e-02 + + -3.7120199203491211e-01 2.7038440108299255e-01 + <_> + + 0 -1 349 -4.4878520071506500e-02 + + 2.9119300842285156e-01 -3.5178241133689880e-01 + <_> + + 0 -1 350 -9.3984341947361827e-04 + + -6.0143661499023438e-01 1.1815790086984634e-01 + <_> + + 0 -1 351 3.1817350536584854e-03 + + -6.1632722616195679e-01 1.0581470280885696e-01 + <_> + + 0 -1 352 -6.2214181525632739e-04 + + 1.1701049655675888e-01 -6.1873781681060791e-01 + <_> + + 0 -1 353 5.4993429221212864e-03 + + 7.1740642189979553e-02 -3.2122710347175598e-01 + <_> + + 0 -1 354 7.0621701888740063e-03 + + -3.0814599990844727e-01 1.8299129605293274e-01 + <_> + + 0 -1 355 -3.4492298960685730e-02 + + -3.6952570080757141e-01 1.1142779886722565e-01 + <_> + + 0 -1 356 -5.3783431649208069e-02 + + -6.6689962148666382e-01 8.4863640367984772e-02 + <_> + + 0 -1 357 -2.0194910466670990e-02 + + -4.2300069332122803e-01 5.6325469166040421e-02 + <_> + + 0 -1 358 -7.6839578105136752e-04 + + 1.3547450304031372e-01 -3.5696288943290710e-01 + <_> + + 0 -1 359 6.6877179779112339e-03 + + -3.4379830956459045e-01 1.3302099704742432e-01 + <_> + + 0 -1 360 1.1147409677505493e-01 + + -4.9523550271987915e-01 9.7303003072738647e-02 + <_> + + 0 -1 361 -8.5021732375025749e-03 + + -5.1778990030288696e-01 6.7188903689384460e-02 + <_> + + 0 -1 362 -1.8897019326686859e-02 + + -4.7064769268035889e-01 9.0873777866363525e-02 + <_> + + 0 -1 363 5.7387170381844044e-03 + + -1.4860689640045166e-01 3.0976840853691101e-01 + <_> + + 0 -1 364 3.2604049891233444e-02 + + 7.8677706420421600e-02 -5.4713827371597290e-01 + <_> + + 0 -1 365 1.8975350030814297e-05 + + -2.4359850585460663e-01 9.8908931016921997e-02 + <_> + + 0 -1 366 -1.9267159514129162e-03 + + -5.0522977113723755e-01 7.5119331479072571e-02 + <_> + + 0 -1 367 -7.7145430259406567e-03 + + -2.5014960765838623e-01 1.0211499780416489e-01 + <_> + + 0 -1 368 -1.8806649371981621e-02 + + -4.3269169330596924e-01 1.1147680133581161e-01 + <_> + + 0 -1 369 2.9912199825048447e-02 + + 4.6748448163270950e-02 -5.8818292617797852e-01 + <_> + + 0 -1 370 -7.4260600376874208e-04 + + 1.8389309942722321e-01 -2.0138260722160339e-01 + <_> + + 0 -1 371 4.0662181563675404e-03 + + -4.4948458671569824e-01 8.6881376802921295e-02 + <_> + + 0 -1 372 1.8681669607758522e-02 + + -1.7103520035743713e-01 2.2931230068206787e-01 + <_> + + 0 -1 373 4.6580690890550613e-02 + + 4.3874379247426987e-02 -6.6704601049423218e-01 + <_> + + 0 -1 374 -1.5030739828944206e-02 + + -7.6569449901580811e-01 4.2524490505456924e-02 + <_> + + 0 -1 375 6.3602820038795471e-02 + + 3.3629488199949265e-02 -8.6777329444885254e-01 + <_> + + 0 -1 376 -3.3613100647926331e-02 + + -6.7464047670364380e-01 4.5196920633316040e-02 + <_> + + 0 -1 377 -4.4314529746770859e-02 + + -4.7056430578231812e-01 2.0987950265407562e-02 + <_> + + 0 -1 378 2.9175819829106331e-02 + + 5.6036490947008133e-02 -6.5745961666107178e-01 + <_> + + 0 -1 379 8.4737781435251236e-03 + + -1.2312129884958267e-01 3.6037188768386841e-01 + <_> + + 0 -1 380 -2.6930740103125572e-02 + + -6.5255117416381836e-01 6.0726620256900787e-02 + <_> + + 0 -1 381 3.7930138409137726e-02 + + -1.5491360425949097e-01 2.1770450472831726e-01 + <_> + + 0 -1 382 1.6430050134658813e-02 + + -2.5250691175460815e-01 1.5458230674266815e-01 + <_> + + 0 -1 383 5.1079809665679932e-02 + + 3.0773499980568886e-02 -6.4929312467575073e-01 + <_> + + 0 -1 384 1.6663300339132547e-03 + + -3.7425559759140015e-01 8.1392176449298859e-02 + <_> + + 0 -1 385 -9.0896980836987495e-03 + + 1.7854049801826477e-01 -7.6578080654144287e-02 + <_> + + 0 -1 386 2.0629199221730232e-02 + + 7.2373263537883759e-02 -4.2050579190254211e-01 + <_> + + 0 -1 387 8.2410024479031563e-03 + + 3.2896678894758224e-02 -3.7325268983840942e-01 + <_> + + 0 -1 388 -4.6126499772071838e-02 + + -3.7356421351432800e-01 7.7336780726909637e-02 + <_> + + 0 -1 389 -8.3484929054975510e-03 + + 1.8690130114555359e-01 -1.5126839280128479e-01 + <_> + + 0 -1 390 -4.7689080238342285e-02 + + -4.0730020403862000e-01 8.7598368525505066e-02 + <_> + + 0 -1 391 -5.0166220171377063e-04 + + 1.2036769837141037e-01 -2.4717660248279572e-01 + <_> + + 0 -1 392 2.1794239728478715e-05 + + -2.9800811409950256e-01 1.2065000087022781e-01 + <_> + + 0 -1 393 -7.0597290992736816e-02 + + -6.8116611242294312e-01 6.4198948442935944e-02 + <_> + + 0 -1 394 -6.4999358728528023e-03 + + 2.6219159364700317e-01 -1.4015009999275208e-01 + <_> + + 0 -1 395 5.3664338774979115e-03 + + -3.4273180365562439e-01 9.2048570513725281e-02 + <_> + + 0 -1 396 -1.3341950252652168e-02 + + 4.0258079767227173e-01 -7.2052307426929474e-02 + <_> + + 0 -1 397 1.2243090197443962e-02 + + -8.2426831126213074e-02 3.8369199633598328e-01 + <_> + 100 + -1.8743180036544800e+00 + + <_> + + 0 -1 398 -2.8617910575121641e-03 + + 2.1443170309066772e-01 -5.1532137393951416e-01 + <_> + + 0 -1 399 1.9125089747831225e-03 + + 1.4483030140399933e-01 -6.1175411939620972e-01 + <_> + + 0 -1 400 4.8059499822556973e-03 + + -4.4235628843307495e-01 1.3466580212116241e-01 + <_> + + 0 -1 401 -9.5777623355388641e-02 + + -4.8914781212806702e-01 1.3169640302658081e-01 + <_> + + 0 -1 402 -8.9395968243479729e-03 + + 1.4790549874305725e-01 -4.6696281433105469e-01 + <_> + + 0 -1 403 8.1128235906362534e-03 + + 5.0671331584453583e-02 -4.0227508544921875e-01 + <_> + + 0 -1 404 2.2638900554738939e-04 + + -5.0928252935409546e-01 8.2113206386566162e-02 + <_> + + 0 -1 405 -6.1516009736806154e-04 + + -3.8136801123619080e-01 1.0157950222492218e-01 + <_> + + 0 -1 406 -3.2050691079348326e-03 + + -5.8352458477020264e-01 6.2385398894548416e-02 + <_> + + 0 -1 407 5.4250762332230806e-04 + + -2.5548499822616577e-01 1.4832200109958649e-01 + <_> + + 0 -1 408 1.0713520459830761e-03 + + -3.5334318876266479e-01 1.1791589856147766e-01 + <_> + + 0 -1 409 -1.7755989683791995e-03 + + -3.4087279438972473e-01 9.4740107655525208e-02 + <_> + + 0 -1 410 -9.3014203011989594e-02 + + 7.4685460329055786e-01 -5.2443340420722961e-02 + <_> + + 0 -1 411 -1.4192130416631699e-02 + + -3.1433999538421631e-01 9.0452186763286591e-02 + <_> + + 0 -1 412 -5.3375191055238247e-04 + + 1.4119710028171539e-01 -2.0296710729598999e-01 + <_> + + 0 -1 413 9.4844609498977661e-02 + + 1.4625679701566696e-02 -6.2215209007263184e-01 + <_> + + 0 -1 414 1.1853160103783011e-03 + + -2.5984010100364685e-01 1.2153120338916779e-01 + <_> + + 0 -1 415 -2.4541220627725124e-03 + + 7.1894593536853790e-02 -3.9803519845008850e-01 + <_> + + 0 -1 416 6.8703000433743000e-03 + + 6.8626098334789276e-02 -3.8565808534622192e-01 + <_> + + 0 -1 417 -6.0411270707845688e-02 + + -4.8482391238212585e-01 2.0706020295619965e-02 + <_> + + 0 -1 418 -4.6826168545521796e-04 + + 9.5856241881847382e-02 -3.1230351328849792e-01 + <_> + + 0 -1 419 -3.3507338957861066e-04 + + 7.8128658235073090e-02 -9.4751000404357910e-02 + <_> + + 0 -1 420 3.6313060671091080e-02 + + 4.4824421405792236e-02 -6.3693147897720337e-01 + <_> + + 0 -1 421 3.8052719901315868e-04 + + -2.1931269764900208e-01 1.1780519783496857e-01 + <_> + + 0 -1 422 -5.0964631140232086e-02 + + 5.5783379077911377e-01 -4.3869689106941223e-02 + <_> + + 0 -1 423 -7.6198756694793701e-02 + + 6.7789608240127563e-01 -1.7935890704393387e-02 + <_> + + 0 -1 424 -1.2677020393311977e-02 + + -6.0731011629104614e-01 4.9086190760135651e-02 + <_> + + 0 -1 425 -3.6766629200428724e-03 + + 1.5226639807224274e-01 -1.9953680038452148e-01 + <_> + + 0 -1 426 -3.8846738636493683e-02 + + -7.7045238018035889e-01 3.3732470124959946e-02 + <_> + + 0 -1 427 9.4217229634523392e-03 + + -6.9929488003253937e-02 1.3669140636920929e-01 + <_> + + 0 -1 428 7.3391180485486984e-03 + + -1.2133339792490005e-01 2.1175499260425568e-01 + <_> + + 0 -1 429 1.2211379595100880e-02 + + 6.7636847496032715e-02 -4.3353718519210815e-01 + <_> + + 0 -1 430 -9.3064550310373306e-03 + + -3.4682491421699524e-01 6.4062312245368958e-02 + <_> + + 0 -1 431 5.2111309021711349e-02 + + -3.4146990627050400e-02 3.8904741406440735e-01 + <_> + + 0 -1 432 -4.3582019861787558e-04 + + 1.3956509530544281e-01 -1.8289420008659363e-01 + <_> + + 0 -1 433 -1.0575359687209129e-02 + + -2.7782461047172546e-01 8.5667066276073456e-02 + <_> + + 0 -1 434 1.4794029993936419e-03 + + -2.3154720664024353e-01 1.1765889823436737e-01 + <_> + + 0 -1 435 9.4746891409158707e-03 + + -1.3345280289649963e-01 1.8066969513893127e-01 + <_> + + 0 -1 436 8.3355188369750977e-02 + + 3.3563960343599319e-02 -7.2860741615295410e-01 + <_> + + 0 -1 437 -6.6629007458686829e-02 + + 3.8058251142501831e-01 -3.3490750938653946e-02 + <_> + + 0 -1 438 5.0287488847970963e-03 + + -1.1418010294437408e-01 2.1534989774227142e-01 + <_> + + 0 -1 439 5.1222002506256104e-01 + + 7.6377480290830135e-03 -6.5067559480667114e-01 + <_> + + 0 -1 440 1.2300059944391251e-01 + + 3.8879081606864929e-02 -5.9420442581176758e-01 + <_> + + 0 -1 441 -1.1227129725739360e-03 + + 1.0235410183668137e-01 -1.1207509785890579e-01 + <_> + + 0 -1 442 -6.2220949679613113e-02 + + -5.1173472404479980e-01 4.1879799216985703e-02 + <_> + + 0 -1 443 -2.6323389261960983e-02 + + 3.4005990624427795e-01 -5.0624471157789230e-02 + <_> + + 0 -1 444 -1.8875019624829292e-02 + + -5.4550838470458984e-01 4.1524920612573624e-02 + <_> + + 0 -1 445 -3.4034788608551025e-01 + + -9.1541802883148193e-01 1.6561320051550865e-02 + <_> + + 0 -1 446 -8.0456008436158299e-04 + + 1.4270770549774170e-01 -1.2901450693607330e-01 + <_> + + 0 -1 447 -3.9579509757459164e-03 + + -3.3408370614051819e-01 5.8637548238039017e-02 + <_> + + 0 -1 448 1.8336549401283264e-02 + + -4.5632220804691315e-02 5.2696329355239868e-01 + <_> + + 0 -1 449 -5.7686101645231247e-02 + + -5.7604360580444336e-01 3.9550099521875381e-02 + <_> + + 0 -1 450 -8.6881890892982483e-03 + + 2.0929679274559021e-01 -1.0309000313282013e-01 + <_> + + 0 -1 451 2.0318549871444702e-01 + + 9.4080818817019463e-03 -9.9389547109603882e-01 + <_> + + 0 -1 452 2.0097799599170685e-02 + + 5.6577399373054504e-02 -3.7819018959999084e-01 + <_> + + 0 -1 453 1.3217139989137650e-02 + + -7.4322126805782318e-02 1.7874650657176971e-01 + <_> + + 0 -1 454 -9.1346688568592072e-03 + + -4.9356880784034729e-01 3.7799369543790817e-02 + <_> + + 0 -1 455 8.7239191634580493e-04 + + -1.3848680257797241e-01 1.1516919732093811e-01 + <_> + + 0 -1 456 -3.4609009162522852e-04 + + -1.6371829807758331e-01 1.1949790269136429e-01 + <_> + + 0 -1 457 -9.8570866975933313e-04 + + -5.4642897844314575e-01 4.4689279049634933e-02 + <_> + + 0 -1 458 1.0218559764325619e-02 + + -1.1570169776678085e-01 1.6723839938640594e-01 + <_> + + 0 -1 459 2.6702679693698883e-02 + + 4.3922040611505508e-02 -4.5120438933372498e-01 + <_> + + 0 -1 460 -2.0299260504543781e-03 + + 1.1932279914617538e-01 -1.6979490220546722e-01 + <_> + + 0 -1 461 -8.8023602962493896e-02 + + -8.0279791355133057e-01 9.4295190647244453e-03 + <_> + + 0 -1 462 -1.3109110295772552e-02 + + -3.0865308642387390e-01 6.0802049934864044e-02 + <_> + + 0 -1 463 -9.9501870572566986e-03 + + 1.8400619924068451e-01 -4.6465478837490082e-02 + <_> + + 0 -1 464 -3.4293539356440306e-03 + + 2.6682999730110168e-01 -9.9338643252849579e-02 + <_> + + 0 -1 465 5.4729141294956207e-02 + + 2.8731130063533783e-02 -7.7745848894119263e-01 + <_> + + 0 -1 466 7.2012972086668015e-03 + + 4.4892478734254837e-02 -3.8289341330528259e-01 + <_> + + 0 -1 467 4.2047120630741119e-02 + + -2.2562339901924133e-02 4.0646651387214661e-01 + <_> + + 0 -1 468 4.4444389641284943e-03 + + 9.1204106807708740e-02 -1.8748210370540619e-01 + <_> + + 0 -1 469 2.8441840782761574e-02 + + 4.0668040513992310e-02 -4.0552121400833130e-01 + <_> + + 0 -1 470 -1.5141829848289490e-02 + + 2.4799869954586029e-01 -8.3607338368892670e-02 + <_> + + 0 -1 471 3.9388090372085571e-02 + + 2.4279279634356499e-02 -7.6827299594879150e-01 + <_> + + 0 -1 472 6.1649468261748552e-04 + + -1.7249910533428192e-01 1.0311610251665115e-01 + <_> + + 0 -1 473 2.6001650840044022e-02 + + 2.2825349122285843e-02 -7.7545452117919922e-01 + <_> + + 0 -1 474 1.4940380351617932e-03 + + -1.1028409749269485e-01 1.6966749727725983e-01 + <_> + + 0 -1 475 -1.3777149841189384e-02 + + -3.8424721360206604e-01 3.0320269986987114e-02 + <_> + + 0 -1 476 9.9619822576642036e-03 + + -5.3764659911394119e-02 3.7887129187583923e-01 + <_> + + 0 -1 477 3.2952039036899805e-03 + + 9.4384163618087769e-02 -3.2762721180915833e-01 + <_> + + 0 -1 478 5.7747410610318184e-03 + + 5.7114940136671066e-02 -3.0719769001007080e-01 + <_> + + 0 -1 479 -4.8392590135335922e-02 + + 1.7021059989929199e-01 -8.7045513093471527e-02 + <_> + + 0 -1 480 5.6376052089035511e-04 + + -9.3816302716732025e-02 2.0642310380935669e-01 + <_> + + 0 -1 481 -2.3873809725046158e-02 + + -3.0082350969314575e-01 1.7477719113230705e-02 + <_> + + 0 -1 482 -1.0526900179684162e-02 + + -3.4418928623199463e-01 5.7995639741420746e-02 + <_> + + 0 -1 483 2.2288670763373375e-02 + + -5.7179849594831467e-02 1.9739510118961334e-01 + <_> + + 0 -1 484 -1.4589070342481136e-02 + + -4.5168799161911011e-01 4.1490409523248672e-02 + <_> + + 0 -1 485 -4.6936370432376862e-02 + + 2.0457950234413147e-01 -5.1769189536571503e-02 + <_> + + 0 -1 486 5.3777720313519239e-04 + + -3.9481449127197266e-01 4.5076690614223480e-02 + <_> + + 0 -1 487 -2.2181039676070213e-03 + + -2.4575619399547577e-01 1.0261219739913940e-01 + <_> + + 0 -1 488 3.5076549649238586e-01 + + 1.9791129976511002e-02 -9.5161467790603638e-01 + <_> + + 0 -1 489 -2.6712059974670410e-02 + + 2.2393140196800232e-01 -4.5580100268125534e-02 + <_> + + 0 -1 490 -3.9627091027796268e-03 + + -2.4207019805908203e-01 7.6588593423366547e-02 + <_> + + 0 -1 491 -4.7878702171146870e-03 + + 1.2655270099639893e-01 -1.1964710056781769e-01 + <_> + + 0 -1 492 7.1042939089238644e-03 + + -9.2130422592163086e-02 2.1519139409065247e-01 + <_> + + 0 -1 493 -2.2581929442822002e-05 + + 6.0634609311819077e-02 -1.5848989784717560e-01 + <_> + + 0 -1 494 -7.8060641884803772e-02 + + 3.4822109341621399e-01 -5.3173709660768509e-02 + <_> + + 0 -1 495 2.7555850148200989e-01 + + 7.4112107977271080e-03 -1.0000040531158447e+00 + <_> + + 0 -1 496 1.9652329385280609e-01 + + 2.0131109282374382e-02 -8.5326671600341797e-01 + <_> + + 0 -1 497 -1.6801860183477402e-03 + + 7.7082179486751556e-02 -2.2620369493961334e-01 + <_> + 71 + -1.9982930421829224e+00 + + <_> + + 0 -1 498 -1.8814710900187492e-02 + + 3.7744289636611938e-01 -4.0770640969276428e-01 + <_> + + 0 -1 499 -2.3191049695014954e-02 + + 3.4049031138420105e-01 -3.6144611239433289e-01 + <_> + + 0 -1 500 3.1333088874816895e-02 + + -4.3613511323928833e-01 1.9668689370155334e-01 + <_> + + 0 -1 501 -1.1318700388073921e-02 + + 1.1685170233249664e-01 -5.6359791755676270e-01 + <_> + + 0 -1 502 -3.1084290822036564e-04 + + -4.3396338820457458e-01 1.4264069497585297e-01 + <_> + + 0 -1 503 8.7350063025951385e-02 + + -1.9952809810638428e-01 3.3043611049652100e-01 + <_> + + 0 -1 504 -2.9018519446253777e-02 + + 3.2315209507942200e-01 -2.1707040071487427e-01 + <_> + + 0 -1 505 5.9860680252313614e-02 + + -1.8764750659465790e-01 2.7651038765907288e-01 + <_> + + 0 -1 506 -2.9682170599699020e-02 + + -4.6436330676078796e-01 1.1129009723663330e-01 + <_> + + 0 -1 507 -2.2648361045867205e-03 + + -2.7163028717041016e-01 8.6916759610176086e-02 + <_> + + 0 -1 508 -1.6869819955900311e-03 + + 1.7998990416526794e-01 -2.7152928709983826e-01 + <_> + + 0 -1 509 1.0256370296701789e-03 + + -4.3248209357261658e-01 1.0256689786911011e-01 + <_> + + 0 -1 510 -3.1762920320034027e-02 + + -6.4419168233871460e-01 6.7505106329917908e-02 + <_> + + 0 -1 511 -8.5913296788930893e-03 + + -3.7672510743141174e-01 7.2900757193565369e-02 + <_> + + 0 -1 512 -2.1636451128870249e-03 + + -4.2209509015083313e-01 1.0724630206823349e-01 + <_> + + 0 -1 513 6.0111237689852715e-04 + + 6.1302110552787781e-02 -3.8004979491233826e-01 + <_> + + 0 -1 514 -6.1244412790983915e-05 + + 7.4765786528587341e-02 -5.2644491195678711e-01 + <_> + + 0 -1 515 -2.3666430264711380e-02 + + -5.6801301240921021e-01 3.6377541720867157e-02 + <_> + + 0 -1 516 -1.4256609603762627e-02 + + -5.3446692228317261e-01 6.2768869102001190e-02 + <_> + + 0 -1 517 -1.5713909640908241e-02 + + 3.1898561120033264e-01 -1.1541239917278290e-01 + <_> + + 0 -1 518 -5.9286020696163177e-02 + + -5.7135957479476929e-01 8.1775680184364319e-02 + <_> + + 0 -1 519 -4.4122908264398575e-02 + + -7.0591008663177490e-01 2.0833099260926247e-02 + <_> + + 0 -1 520 -7.2728260420262814e-04 + + 1.0819850116968155e-01 -3.8077458739280701e-01 + <_> + + 0 -1 521 -6.6653728485107422e-02 + + -6.0824638605117798e-01 4.3248821049928665e-02 + <_> + + 0 -1 522 2.3679709993302822e-03 + + -2.9793098568916321e-01 1.2091939896345139e-01 + <_> + + 0 -1 523 3.3566180616617203e-02 + + 3.6464620381593704e-02 -5.5766987800598145e-01 + <_> + + 0 -1 524 -5.3138811141252518e-02 + + -5.6245392560958862e-01 6.5296277403831482e-02 + <_> + + 0 -1 525 -2.9401908977888525e-04 + + -5.8417952060699463e-01 5.0005510449409485e-02 + <_> + + 0 -1 526 -4.8085048911161721e-04 + + 1.4018669724464417e-01 -2.4792720377445221e-01 + <_> + + 0 -1 527 4.7777060419321060e-02 + + 5.5672798305749893e-02 -5.9540742635726929e-01 + <_> + + 0 -1 528 3.3423870801925659e-02 + + -1.4370389282703400e-01 2.3300980031490326e-01 + <_> + + 0 -1 529 2.0432810485363007e-01 + + 4.5327048748731613e-02 -7.4164307117462158e-01 + <_> + + 0 -1 530 1.4106060564517975e-01 + + -3.9674291014671326e-01 8.1692866981029510e-02 + <_> + + 0 -1 531 1.0005939839174971e-04 + + -2.2317939996719360e-01 1.3917629420757294e-01 + <_> + + 0 -1 532 6.0689389705657959e-02 + + 3.4324988722801208e-02 -8.2796847820281982e-01 + <_> + + 0 -1 533 -3.6456179805099964e-03 + + 1.5286439657211304e-01 -1.4005979895591736e-01 + <_> + + 0 -1 534 3.1945340335369110e-02 + + 6.5343692898750305e-02 -4.4296088814735413e-01 + <_> + + 0 -1 535 2.3428380489349365e-02 + + 2.5527309626340866e-02 -6.3270658254623413e-01 + <_> + + 0 -1 536 4.6067949384450912e-02 + + 4.3579101562500000e-02 -6.4929872751235962e-01 + <_> + + 0 -1 537 -5.8055151253938675e-02 + + -6.3957542181015015e-01 1.4028750360012054e-02 + <_> + + 0 -1 538 3.8783740252256393e-02 + + 5.1233518868684769e-02 -5.4144388437271118e-01 + <_> + + 0 -1 539 -1.2765520252287388e-02 + + 2.7082890272140503e-01 -9.1927766799926758e-02 + <_> + + 0 -1 540 -3.1400551088154316e-03 + + -3.4679821133613586e-01 8.3973668515682220e-02 + <_> + + 0 -1 541 -1.9719999283552170e-02 + + -2.0476959645748138e-01 6.3232198357582092e-02 + <_> + + 0 -1 542 3.2241051085293293e-03 + + 9.6259713172912598e-02 -2.8098219633102417e-01 + <_> + + 0 -1 543 -5.9271860867738724e-02 + + -2.6686909794807434e-01 3.2907258719205856e-02 + <_> + + 0 -1 544 1.5636639669537544e-02 + + 6.9188073277473450e-02 -4.1761711239814758e-01 + <_> + + 0 -1 545 -8.8900122791528702e-03 + + 1.9603550434112549e-01 -1.1249750107526779e-01 + <_> + + 0 -1 546 2.4458909407258034e-02 + + 5.6988969445228577e-02 -5.1025021076202393e-01 + <_> + + 0 -1 547 1.0101319849491119e-01 + + 9.4210049137473106e-03 -3.6691328883171082e-01 + <_> + + 0 -1 548 9.0739831328392029e-02 + + 5.3999878466129303e-02 -5.1181477308273315e-01 + <_> + + 0 -1 549 -4.9557868391275406e-02 + + -6.2467038631439209e-01 4.0988270193338394e-02 + <_> + + 0 -1 550 2.6558348536491394e-01 + + -8.6136549711227417e-02 3.2438439130783081e-01 + <_> + + 0 -1 551 1.8632459687069058e-03 + + -5.4563361406326294e-01 5.8684051036834717e-02 + <_> + + 0 -1 552 1.1804940178990364e-02 + + -2.0603899657726288e-01 1.4167340099811554e-01 + <_> + + 0 -1 553 6.8137067137286067e-04 + + -2.0806470513343811e-01 9.2627376317977905e-02 + <_> + + 0 -1 554 5.7278381427749991e-04 + + -4.3170881271362305e-01 6.3360363245010376e-02 + <_> + + 0 -1 555 -1.1041999794542789e-02 + + 1.8144379556179047e-01 -4.1707839816808701e-02 + <_> + + 0 -1 556 9.5696747303009033e-03 + + -1.2098339945077896e-01 2.1607619524002075e-01 + <_> + + 0 -1 557 7.4274197220802307e-02 + + 2.6399549096822739e-02 -7.7601867914199829e-01 + <_> + + 0 -1 558 -2.5815829634666443e-02 + + 5.3497368097305298e-01 -5.2025150507688522e-02 + <_> + + 0 -1 559 -6.3314691185951233e-02 + + 5.1900321245193481e-01 -1.9329590722918510e-02 + <_> + + 0 -1 560 -6.6432490944862366e-02 + + 7.2140932083129883e-01 -3.2882031053304672e-02 + <_> + + 0 -1 561 -7.5749039649963379e-02 + + 4.1485249996185303e-01 -5.5451728403568268e-02 + <_> + + 0 -1 562 -2.0296040922403336e-02 + + -3.3250689506530762e-01 8.2397893071174622e-02 + <_> + + 0 -1 563 2.2172650322318077e-02 + + -1.4419150352478027e-01 1.7280860245227814e-01 + <_> + + 0 -1 564 4.2085880413651466e-03 + + -3.0237489938735962e-01 8.6699083447456360e-02 + <_> + + 0 -1 565 6.8267330527305603e-02 + + 8.7291244417428970e-03 -3.6955729126930237e-01 + <_> + + 0 -1 566 5.1220320165157318e-03 + + -2.0824980735778809e-01 1.4530059695243835e-01 + <_> + + 0 -1 567 -5.3114328533411026e-02 + + -5.5142301321029663e-01 4.3421190232038498e-02 + <_> + + 0 -1 568 -4.9739979207515717e-02 + + 4.4077101349830627e-01 -6.4349673688411713e-02 + <_> + 94 + -1.8377989530563354e+00 + + <_> + + 0 -1 569 -3.3883380820043385e-04 + + 1.8997849524021149e-01 -4.6184849739074707e-01 + <_> + + 0 -1 570 -1.5632030554115772e-03 + + 1.9381409883499146e-01 -4.3518841266632080e-01 + <_> + + 0 -1 571 1.5552520053461194e-03 + + -4.7420310974121094e-01 1.2137629836797714e-01 + <_> + + 0 -1 572 -3.1417120248079300e-02 + + -3.9096689224243164e-01 1.0951930284500122e-01 + <_> + + 0 -1 573 -3.2835190650075674e-03 + + 1.6428950428962708e-01 -3.2751929759979248e-01 + <_> + + 0 -1 574 5.8749080635607243e-03 + + 7.6225973665714264e-02 -4.3470710515975952e-01 + <_> + + 0 -1 575 4.4846539385616779e-03 + + 1.2197560071945190e-01 -4.4872379302978516e-01 + <_> + + 0 -1 576 1.9835829734802246e-03 + + -6.2911021709442139e-01 1.0122530162334442e-01 + <_> + + 0 -1 577 1.2609469704329967e-02 + + 1.0438250005245209e-01 -3.5015499591827393e-01 + <_> + + 0 -1 578 -4.7475768951699138e-04 + + 1.1008159816265106e-01 -3.0429539084434509e-01 + <_> + + 0 -1 579 3.2356760930269957e-03 + + -2.7057901024818420e-01 1.2746180593967438e-01 + <_> + + 0 -1 580 9.9898613989353180e-03 + + 6.3906982541084290e-02 -4.7118431329727173e-01 + <_> + + 0 -1 581 5.6069239508360624e-04 + + -3.1783330440521240e-01 1.0404340177774429e-01 + <_> + + 0 -1 582 -5.7694699615240097e-02 + + -5.1342570781707764e-01 2.6394980028271675e-02 + <_> + + 0 -1 583 5.5947788059711456e-03 + + 7.6774753630161285e-02 -4.3374261260032654e-01 + <_> + + 0 -1 584 -3.8770840037614107e-03 + + 1.3988199830055237e-01 -2.0221559703350067e-01 + <_> + + 0 -1 585 -4.7874201089143753e-02 + + -4.7928389906883240e-01 6.8043030798435211e-02 + <_> + + 0 -1 586 2.5817550718784332e-02 + + -4.5524198561906815e-02 3.9452901482582092e-01 + <_> + + 0 -1 587 1.6696650709491223e-04 + + -3.0880719423294067e-01 1.0875239968299866e-01 + <_> + + 0 -1 588 9.8888948559761047e-04 + + 6.8699032068252563e-02 -4.1813009977340698e-01 + <_> + + 0 -1 589 -3.4260770771652460e-03 + + -2.8929701447486877e-01 1.1479649692773819e-01 + <_> + + 0 -1 590 6.6044367849826813e-02 + + 1.6809269785881042e-02 -3.3534801006317139e-01 + <_> + + 0 -1 591 2.8318059630692005e-03 + + -3.9482170343399048e-01 8.5598722100257874e-02 + <_> + + 0 -1 592 4.2680549621582031e-01 + + 5.0977780483663082e-03 -5.9331178665161133e-01 + <_> + + 0 -1 593 1.1960650235414505e-01 + + 2.7437770739197731e-02 -7.6616281270980835e-01 + <_> + + 0 -1 594 1.9571319222450256e-02 + + -1.1966180056333542e-01 2.3962239921092987e-01 + <_> + + 0 -1 595 -1.7432469874620438e-02 + + -5.8530348539352417e-01 5.6400340050458908e-02 + <_> + + 0 -1 596 -1.1196629703044891e-01 + + -6.7248320579528809e-01 2.9150659218430519e-02 + <_> + + 0 -1 597 -4.5747519470751286e-03 + + -4.7730261087417603e-01 5.6612998247146606e-02 + <_> + + 0 -1 598 -5.1501519046723843e-03 + + 1.1510629951953888e-01 -1.0732329636812210e-01 + <_> + + 0 -1 599 2.9034249484539032e-02 + + -5.3368709981441498e-02 6.4226460456848145e-01 + <_> + + 0 -1 600 -1.8050910439342260e-03 + + 1.2795349955558777e-01 -1.2329389899969101e-01 + <_> + + 0 -1 601 -2.4374839849770069e-03 + + -3.5312348604202271e-01 8.7703153491020203e-02 + <_> + + 0 -1 602 -1.9070079550147057e-02 + + -4.0662440657615662e-01 4.3273188173770905e-02 + <_> + + 0 -1 603 -5.0454240292310715e-02 + + -8.1198102235794067e-01 2.8289109468460083e-02 + <_> + + 0 -1 604 1.6544000245630741e-03 + + -1.6964040696620941e-01 1.2194740027189255e-01 + <_> + + 0 -1 605 -4.6791311353445053e-02 + + 4.0614441037178040e-01 -6.1174858361482620e-02 + <_> + + 0 -1 606 -5.5953849107027054e-02 + + -8.2662910223007202e-01 2.7774749323725700e-02 + <_> + + 0 -1 607 1.4469559537246823e-03 + + -1.4953869581222534e-01 1.5966990590095520e-01 + <_> + + 0 -1 608 -1.2529050000011921e-02 + + -4.2504650354385376e-01 2.1658079698681831e-02 + <_> + + 0 -1 609 1.1086500016972423e-03 + + -3.6006990075111389e-01 6.4415097236633301e-02 + <_> + + 0 -1 610 3.9361778646707535e-02 + + 8.2419048994779587e-03 -7.5303071737289429e-01 + <_> + + 0 -1 611 1.8823929131031036e-02 + + 4.4821120798587799e-02 -5.0604110956192017e-01 + <_> + + 0 -1 612 -3.2083000987768173e-02 + + 3.1431311368942261e-01 -3.9181869477033615e-02 + <_> + + 0 -1 613 -3.1081929802894592e-02 + + -7.6903742551803589e-01 3.0742960050702095e-02 + <_> + + 0 -1 614 2.3218210786581039e-02 + + -5.7748749852180481e-02 2.8955349326133728e-01 + <_> + + 0 -1 615 -1.1492100311443210e-03 + + 1.1501409858465195e-01 -1.9310690462589264e-01 + <_> + + 0 -1 616 -1.6593940556049347e-02 + + -4.2298540472984314e-01 4.3738979846239090e-02 + <_> + + 0 -1 617 -1.0146570391952991e-02 + + 2.5579848885536194e-01 -9.1966241598129272e-02 + <_> + + 0 -1 618 -1.3054019771516323e-02 + + 1.8339529633522034e-01 -4.0160831063985825e-02 + <_> + + 0 -1 619 3.7463540211319923e-03 + + -1.2586769461631775e-01 2.2247019410133362e-01 + <_> + + 0 -1 620 -4.8463590443134308e-02 + + -5.8155900239944458e-01 2.9713390395045280e-02 + <_> + + 0 -1 621 6.4649381674826145e-03 + + 9.3169108033180237e-02 -2.9046580195426941e-01 + <_> + + 0 -1 622 1.5607809647917747e-02 + + 4.7331970185041428e-02 -4.4805559515953064e-01 + <_> + + 0 -1 623 -5.8314641937613487e-03 + + 9.8941758275032043e-02 -2.2056859731674194e-01 + <_> + + 0 -1 624 7.3607802391052246e-02 + + 1.6780460253357887e-02 -5.4953122138977051e-01 + <_> + + 0 -1 625 -6.4223129302263260e-03 + + -2.9647961258888245e-01 7.3539912700653076e-02 + <_> + + 0 -1 626 2.2267029635258950e-05 + + -3.4211820363998413e-01 4.1858270764350891e-02 + <_> + + 0 -1 627 3.7273630499839783e-02 + + 2.7458079159259796e-02 -7.8551971912384033e-01 + <_> + + 0 -1 628 4.2738770134747028e-03 + + -8.2514517009258270e-02 1.0404880344867706e-01 + <_> + + 0 -1 629 1.1906049912795424e-03 + + -1.6300439834594727e-01 1.5300649404525757e-01 + <_> + + 0 -1 630 8.7800435721874237e-03 + + -9.2885948717594147e-02 1.3147510588169098e-01 + <_> + + 0 -1 631 2.4151368997991085e-03 + + 4.7598559409379959e-02 -4.4829669594764709e-01 + <_> + + 0 -1 632 -2.7428340166807175e-02 + + 1.9811069965362549e-01 -5.5979698896408081e-02 + <_> + + 0 -1 633 -1.4117059763520956e-03 + + -2.1138970553874969e-01 1.0409740358591080e-01 + <_> + + 0 -1 634 -2.0210200548171997e-01 + + -7.7120232582092285e-01 7.0582218468189240e-03 + <_> + + 0 -1 635 -4.1451320052146912e-02 + + 2.8295141458511353e-01 -7.1323528885841370e-02 + <_> + + 0 -1 636 4.8561887815594673e-03 + + 8.6693897843360901e-02 -2.3541820049285889e-01 + <_> + + 0 -1 637 -4.4662880100077018e-05 + + 1.3257139921188354e-01 -2.0168599486351013e-01 + <_> + + 0 -1 638 3.7671580910682678e-02 + + -7.4952289462089539e-02 3.3843380212783813e-01 + <_> + + 0 -1 639 7.4343256652355194e-02 + + 3.2905030995607376e-02 -7.3536777496337891e-01 + <_> + + 0 -1 640 -1.0186419822275639e-02 + + -3.1277081370353699e-01 4.4163990765810013e-02 + <_> + + 0 -1 641 -2.4506879970431328e-02 + + -6.1346518993377686e-01 2.9692139476537704e-02 + <_> + + 0 -1 642 -3.8238149136304855e-02 + + 3.5583540797233582e-01 -4.8388618975877762e-02 + <_> + + 0 -1 643 1.7983660101890564e-01 + + 1.9501589238643646e-02 -9.8485881090164185e-01 + <_> + + 0 -1 644 8.4765878273174167e-04 + + -2.7960330247879028e-01 7.8323036432266235e-02 + <_> + + 0 -1 645 3.7178809288889170e-03 + + 7.2525441646575928e-02 -2.4067409336566925e-01 + <_> + + 0 -1 646 -9.0932317078113556e-02 + + -7.1539151668548584e-01 8.8080493733286858e-03 + <_> + + 0 -1 647 -8.0087810754776001e-02 + + -6.7830717563629150e-01 2.4904320016503334e-02 + <_> + + 0 -1 648 7.6924148015677929e-03 + + -5.0967499613761902e-02 1.1952529847621918e-01 + <_> + + 0 -1 649 4.1485231369733810e-02 + + -4.9493920058012009e-02 3.5386860370635986e-01 + <_> + + 0 -1 650 3.4051608294248581e-02 + + 4.2200978845357895e-02 -5.0110721588134766e-01 + <_> + + 0 -1 651 -2.6235830038785934e-02 + + 4.4934839010238647e-01 -4.1851200163364410e-02 + <_> + + 0 -1 652 -5.1373958587646484e-02 + + -9.5942801237106323e-01 1.7192790284752846e-02 + <_> + + 0 -1 653 -2.6742739602923393e-02 + + -6.5632241964340210e-01 2.1778080612421036e-02 + <_> + + 0 -1 654 -1.3730529462918639e-03 + + -1.8638509511947632e-01 4.1139349341392517e-02 + <_> + + 0 -1 655 1.0963230160996318e-03 + + -1.4219370484352112e-01 1.3832019269466400e-01 + <_> + + 0 -1 656 -4.5011811889708042e-03 + + -1.8468600511550903e-01 9.1024190187454224e-02 + <_> + + 0 -1 657 4.4253250234760344e-04 + + -1.2736940383911133e-01 1.3655360043048859e-01 + <_> + + 0 -1 658 3.0500710010528564e-02 + + -5.8146148920059204e-02 2.4189910292625427e-01 + <_> + + 0 -1 659 -1.1691919714212418e-01 + + -5.5466407537460327e-01 3.0249029397964478e-02 + <_> + + 0 -1 660 -9.5684931147843599e-04 + + 5.1899868994951248e-02 -1.4152799546718597e-01 + <_> + + 0 -1 661 1.3096149777993560e-03 + + -1.4248229563236237e-01 1.2227780371904373e-01 + <_> + + 0 -1 662 3.4988880157470703e-02 + + 2.7653129771351814e-02 -6.1738812923431396e-01 + <_> + 82 + -1.9031070470809937e+00 + + <_> + + 0 -1 663 1.6489429771900177e-01 + + -2.5657209753990173e-01 4.1277718544006348e-01 + <_> + + 0 -1 664 2.0584860816597939e-02 + + -5.2442210912704468e-01 1.4910830557346344e-01 + <_> + + 0 -1 665 8.8764587417244911e-04 + + 1.3334700465202332e-01 -5.2259522676467896e-01 + <_> + + 0 -1 666 -1.3320889556780457e-03 + + -3.6568748950958252e-01 2.0482279360294342e-01 + <_> + + 0 -1 667 7.7916197478771210e-02 + + -2.1557159721851349e-01 3.1069579720497131e-01 + <_> + + 0 -1 668 2.4321360979229212e-03 + + -4.4742551445960999e-01 1.0638339817523956e-01 + <_> + + 0 -1 669 -5.8699389919638634e-03 + + -3.8800778985023499e-01 1.4410589635372162e-01 + <_> + + 0 -1 670 6.9754302501678467e-02 + + 1.3224910013377666e-02 -8.0096632242202759e-01 + <_> + + 0 -1 671 3.8338101003319025e-03 + + -4.3139308691024780e-01 1.4253990352153778e-01 + <_> + + 0 -1 672 -1.5829030424356461e-02 + + 3.0954799056053162e-01 -1.2232720106840134e-01 + <_> + + 0 -1 673 6.6198296844959259e-02 + + -2.0558249950408936e-01 1.9531220197677612e-01 + <_> + + 0 -1 674 1.7639519646763802e-02 + + 1.0770589858293533e-01 -4.3488320708274841e-01 + <_> + + 0 -1 675 -1.1082629673182964e-02 + + -3.6149570345878601e-01 1.1327210068702698e-01 + <_> + + 0 -1 676 -3.6515299230813980e-02 + + -4.3912211060523987e-01 5.5279448628425598e-02 + <_> + + 0 -1 677 -3.3373299986124039e-02 + + -5.6869208812713623e-01 8.4043957293033600e-02 + <_> + + 0 -1 678 8.1395559012889862e-02 + + -1.4235010743141174e-01 2.8748288750648499e-01 + <_> + + 0 -1 679 -4.3892292305827141e-03 + + -3.4859830141067505e-01 1.1650340259075165e-01 + <_> + + 0 -1 680 -6.3558202236890793e-03 + + -3.3823049068450928e-01 1.1005490273237228e-01 + <_> + + 0 -1 681 2.0912459120154381e-02 + + 7.8197829425334930e-02 -4.6337550878524780e-01 + <_> + + 0 -1 682 1.1600360274314880e-01 + + -2.0528669655323029e-01 1.5923389792442322e-01 + <_> + + 0 -1 683 1.6316600143909454e-02 + + -1.0633999854326248e-01 3.3453521132469177e-01 + <_> + + 0 -1 684 -2.8488141298294067e-01 + + 5.1638001203536987e-01 -3.9357859641313553e-03 + <_> + + 0 -1 685 2.4155430495738983e-02 + + -7.1670228242874146e-01 5.0031550228595734e-02 + <_> + + 0 -1 686 1.1413260363042355e-02 + + 5.9236031025648117e-02 -3.8141900300979614e-01 + <_> + + 0 -1 687 -2.4304199963808060e-02 + + 4.3475851416587830e-01 -8.6574159562587738e-02 + <_> + + 0 -1 688 -1.5267609851434827e-03 + + -6.4307600259780884e-01 5.1642779260873795e-02 + <_> + + 0 -1 689 1.0073349811136723e-02 + + 7.5743027031421661e-02 -4.2902961373329163e-01 + <_> + + 0 -1 690 -8.1224881112575531e-02 + + -4.0827330946922302e-01 5.5444631725549698e-02 + <_> + + 0 -1 691 1.5149010345339775e-02 + + 5.3084861487150192e-02 -5.4495412111282349e-01 + <_> + + 0 -1 692 -5.3490739315748215e-02 + + -4.7422149777412415e-01 3.9420779794454575e-02 + <_> + + 0 -1 693 -4.0884271264076233e-02 + + -8.8557797670364380e-01 3.2042708247900009e-02 + <_> + + 0 -1 694 -4.2768509592860937e-04 + + -3.0554470419883728e-01 5.1432881504297256e-02 + <_> + + 0 -1 695 1.8441269174218178e-02 + + 8.0688089132308960e-02 -3.5884049534797668e-01 + <_> + + 0 -1 696 -4.7630790621042252e-02 + + -4.6131908893585205e-01 6.0592770576477051e-02 + <_> + + 0 -1 697 8.2442145794630051e-03 + + 8.9793607592582703e-02 -3.7605780363082886e-01 + <_> + + 0 -1 698 1.0003759711980820e-01 + + -8.3760380744934082e-02 3.9221811294555664e-01 + <_> + + 0 -1 699 -2.8420550748705864e-02 + + -6.9483548402786255e-01 4.9100410193204880e-02 + <_> + + 0 -1 700 5.6485999375581741e-02 + + 4.4795661233365536e-03 -7.5373399257659912e-01 + <_> + + 0 -1 701 1.0085420217365026e-03 + + -3.7881261110305786e-01 7.8376993536949158e-02 + <_> + + 0 -1 702 -1.2643639929592609e-03 + + 7.5486026704311371e-02 -3.1015640497207642e-01 + <_> + + 0 -1 703 1.4146340079605579e-02 + + -8.1805020570755005e-02 3.7313848733901978e-01 + <_> + + 0 -1 704 -3.1549399718642235e-03 + + -2.1241660416126251e-01 8.9129790663719177e-02 + <_> + + 0 -1 705 1.4796239556744695e-03 + + -2.1479040384292603e-01 1.3543279469013214e-01 + <_> + + 0 -1 706 -3.1343609094619751e-02 + + -5.8114588260650635e-01 4.8576328903436661e-02 + <_> + + 0 -1 707 -7.6149761676788330e-02 + + -5.3774517774581909e-01 4.8339068889617920e-02 + <_> + + 0 -1 708 -6.1668939888477325e-02 + + -8.4525662660598755e-01 1.7448999278713018e-04 + <_> + + 0 -1 709 -2.7084920555353165e-02 + + -5.0659137964248657e-01 4.7709420323371887e-02 + <_> + + 0 -1 710 -2.4240929633378983e-02 + + -3.8534450531005859e-01 5.0300780683755875e-02 + <_> + + 0 -1 711 4.1979398578405380e-02 + + -1.0378009825944901e-01 2.6236268877983093e-01 + <_> + + 0 -1 712 2.3717690259218216e-02 + + 5.6897271424531937e-02 -2.8959441184997559e-01 + <_> + + 0 -1 713 -1.8669789656996727e-02 + + -3.9924529194831848e-01 7.3442213237285614e-02 + <_> + + 0 -1 714 -1.4987000264227390e-02 + + -3.2296919822692871e-01 4.1676748543977737e-02 + <_> + + 0 -1 715 8.7209865450859070e-03 + + 1.3521389663219452e-01 -1.8224580585956573e-01 + <_> + + 0 -1 716 -1.2239219620823860e-02 + + 1.5540809929370880e-01 -1.5208069980144501e-01 + <_> + + 0 -1 717 -4.8744980245828629e-02 + + -3.6606758832931519e-01 6.3152566552162170e-02 + <_> + + 0 -1 718 -3.8249569479376078e-03 + + 8.3472989499568939e-02 -2.4186329543590546e-01 + <_> + + 0 -1 719 1.5581659972667694e-01 + + 3.1953960657119751e-02 -6.7813181877136230e-01 + <_> + + 0 -1 720 6.8241581320762634e-02 + + 1.5478439629077911e-02 -4.2029750347137451e-01 + <_> + + 0 -1 721 -9.5974646508693695e-02 + + -9.5647841691970825e-01 2.1444590762257576e-02 + <_> + + 0 -1 722 -1.2618429958820343e-02 + + -5.0544857978820801e-01 3.0875260010361671e-02 + <_> + + 0 -1 723 7.2727642953395844e-02 + + 4.7215349972248077e-02 -4.5075151324272156e-01 + <_> + + 0 -1 724 2.9923219233751297e-02 + + -8.1444352865219116e-02 3.1656229496002197e-01 + <_> + + 0 -1 725 1.9138090312480927e-02 + + 6.8187400698661804e-02 -3.4876790642738342e-01 + <_> + + 0 -1 726 -3.4314721822738647e-02 + + -5.5220371484756470e-01 3.7325009703636169e-02 + <_> + + 0 -1 727 5.2559198811650276e-03 + + 6.4786978065967560e-02 -3.6363509297370911e-01 + <_> + + 0 -1 728 1.4092399738729000e-02 + + -4.8704359680414200e-02 2.7677831053733826e-01 + <_> + + 0 -1 729 -9.0101473033428192e-03 + + 2.3452599346637726e-01 -1.3140350580215454e-01 + <_> + + 0 -1 730 9.6720218658447266e-02 + + 2.6661360636353493e-02 -7.7422797679901123e-01 + <_> + + 0 -1 731 8.5365071892738342e-02 + + 2.3529909551143646e-02 -7.0710861682891846e-01 + <_> + + 0 -1 732 2.4384429678320885e-02 + + -6.2648482620716095e-02 3.7251880764961243e-01 + <_> + + 0 -1 733 3.6380778998136520e-02 + + 4.3358739465475082e-02 -6.0222417116165161e-01 + <_> + + 0 -1 734 -5.3780268877744675e-02 + + -3.3441001176834106e-01 3.5700578242540359e-02 + <_> + + 0 -1 735 -1.4787100255489349e-02 + + 2.9136168956756592e-01 -7.4075296521186829e-02 + <_> + + 0 -1 736 1.2491010129451752e-03 + + 4.1654240339994431e-02 -9.3758836388587952e-02 + <_> + + 0 -1 737 -2.7572909370064735e-02 + + -3.1398218870162964e-01 7.2411999106407166e-02 + <_> + + 0 -1 738 -7.8866451978683472e-02 + + 6.0655838251113892e-01 -2.3838050663471222e-02 + <_> + + 0 -1 739 -6.9339312613010406e-02 + + 7.1137732267379761e-01 -2.9814269393682480e-02 + <_> + + 0 -1 740 9.4372592866420746e-02 + + 3.3579438924789429e-02 -5.9774041175842285e-01 + <_> + + 0 -1 741 -2.6048649102449417e-02 + + -4.0574911236763000e-01 5.5603530257940292e-02 + <_> + + 0 -1 742 -7.3630206286907196e-02 + + -6.0780352354049683e-01 2.5251649320125580e-02 + <_> + + 0 -1 743 -1.8610449507832527e-02 + + 2.4013559520244598e-01 -9.5389783382415771e-02 + <_> + + 0 -1 744 1.3329629600048065e-01 + + -6.9742381572723389e-02 1.3323000073432922e-01 + <_> + 112 + -1.6909840106964111e+00 + + <_> + + 0 -1 745 -4.1724857874214649e-03 + + 1.9310890138149261e-01 -4.9630740284919739e-01 + <_> + + 0 -1 746 9.6606701845303178e-04 + + -5.4340302944183350e-01 1.2434119731187820e-01 + <_> + + 0 -1 747 1.0261629940941930e-03 + + -4.6321579813957214e-01 1.1160290241241455e-01 + <_> + + 0 -1 748 3.6368470173329115e-03 + + 8.2918949425220490e-02 -3.6662510037422180e-01 + <_> + + 0 -1 749 -2.8364539612084627e-03 + + -6.7365992069244385e-01 6.5546013414859772e-02 + <_> + + 0 -1 750 -1.0111520532518625e-03 + + 1.4055189490318298e-01 -3.5270330309867859e-01 + <_> + + 0 -1 751 -2.5434889830648899e-03 + + 1.4191180467605591e-01 -2.8350821137428284e-01 + <_> + + 0 -1 752 3.3014779910445213e-03 + + 4.6553891152143478e-02 -4.8537290096282959e-01 + <_> + + 0 -1 753 -1.1802930384874344e-02 + + -3.7958830595016479e-01 9.2071913182735443e-02 + <_> + + 0 -1 754 -1.3293370138853788e-03 + + 1.7311429977416992e-01 -1.6890439391136169e-01 + <_> + + 0 -1 755 1.4958450198173523e-01 + + 3.7626601755619049e-02 -8.0016881227493286e-01 + <_> + + 0 -1 756 1.6352189704775810e-03 + + -2.0858129858970642e-01 1.5985429286956787e-01 + <_> + + 0 -1 757 1.5483440365642309e-03 + + -1.7578269541263580e-01 1.7560100555419922e-01 + <_> + + 0 -1 758 -3.5674259066581726e-02 + + -4.6057531237602234e-01 4.3983791023492813e-02 + <_> + + 0 -1 759 -1.4558699913322926e-02 + + -3.3587411046028137e-01 8.3965480327606201e-02 + <_> + + 0 -1 760 5.2891410887241364e-03 + + -3.5635179281234741e-01 9.4101972877979279e-02 + <_> + + 0 -1 761 -9.8066125065088272e-04 + + -4.4301840662956238e-01 6.4368210732936859e-02 + <_> + + 0 -1 762 -4.0704999119043350e-02 + + -5.9700322151184082e-01 1.7846770584583282e-02 + <_> + + 0 -1 763 2.9682040214538574e-02 + + 3.8127020001411438e-02 -6.6795140504837036e-01 + <_> + + 0 -1 764 -1.7841320368461311e-04 + + 7.4118576943874359e-02 -3.2121241092681885e-01 + <_> + + 0 -1 765 1.0050840210169554e-03 + + -2.0642249286174774e-01 1.2194109708070755e-01 + <_> + + 0 -1 766 -1.6711819916963577e-03 + + -2.6586419343948364e-01 7.1882687509059906e-02 + <_> + + 0 -1 767 -6.9955319166183472e-02 + + 5.0097060203552246e-01 -5.2172549068927765e-02 + <_> + + 0 -1 768 8.3406828343868256e-03 + + -6.9546110928058624e-02 1.6949440538883209e-01 + <_> + + 0 -1 769 1.5483159571886063e-02 + + -9.5865622162818909e-02 2.8736731410026550e-01 + <_> + + 0 -1 770 -4.2621988803148270e-02 + + -2.5160768628120422e-01 1.1381790041923523e-01 + <_> + + 0 -1 771 3.6459038965404034e-03 + + 7.0138469338417053e-02 -4.0376278758049011e-01 + <_> + + 0 -1 772 -1.8889949424192309e-03 + + 1.4695550501346588e-01 -1.7879849672317505e-01 + <_> + + 0 -1 773 -3.4749018959701061e-03 + + -2.4985860288143158e-01 1.0349679738283157e-01 + <_> + + 0 -1 774 -3.7792209535837173e-02 + + -6.5756058692932129e-01 2.3007599636912346e-02 + <_> + + 0 -1 775 -4.0167139377444983e-04 + + 1.4987960457801819e-01 -1.4527609944343567e-01 + <_> + + 0 -1 776 3.4890990704298019e-02 + + -4.5207828283309937e-02 5.1295852661132812e-01 + <_> + + 0 -1 777 -9.5964537467807531e-04 + + 1.4688290655612946e-01 -1.7244540154933929e-01 + <_> + + 0 -1 778 -9.6461333334445953e-02 + + -7.1814310550689697e-01 3.2587919384241104e-02 + <_> + + 0 -1 779 -1.1924919672310352e-03 + + 1.3805310428142548e-01 -1.4162309467792511e-01 + <_> + + 0 -1 780 -1.6420070081949234e-02 + + -4.1954740881919861e-01 4.3040689080953598e-02 + <_> + + 0 -1 781 -6.1112269759178162e-02 + + 3.7761390209197998e-01 -5.6264769285917282e-02 + <_> + + 0 -1 782 -3.1682170927524567e-02 + + 2.1038809418678284e-01 -5.4475009441375732e-02 + <_> + + 0 -1 783 -7.4058552272617817e-03 + + -1.8709950149059296e-01 1.0876149684190750e-01 + <_> + + 0 -1 784 -2.8892440604977310e-04 + + 6.9734372198581696e-02 -2.4516759812831879e-01 + <_> + + 0 -1 785 -7.9921782016754150e-03 + + -2.4069899320602417e-01 8.8012270629405975e-02 + <_> + + 0 -1 786 -6.4670671708881855e-03 + + 2.0819950103759766e-01 -6.9062210619449615e-02 + <_> + + 0 -1 787 -5.3345328196883202e-03 + + 3.2469388842582703e-01 -7.4058808386325836e-02 + <_> + + 0 -1 788 -6.7914440296590328e-03 + + -1.7014460265636444e-01 3.7378448992967606e-02 + <_> + + 0 -1 789 1.6337619721889496e-01 + + 1.9682100042700768e-02 -9.1652041673660278e-01 + <_> + + 0 -1 790 1.1759659647941589e-01 + + 8.8446342851966619e-04 -7.8050827980041504e-01 + <_> + + 0 -1 791 -1.1682280153036118e-01 + + -9.6009898185729980e-01 1.7070280387997627e-02 + <_> + + 0 -1 792 4.6899251639842987e-02 + + 4.7891899943351746e-02 -3.2044771313667297e-01 + <_> + + 0 -1 793 -4.0058898739516735e-03 + + 1.1414390057325363e-01 -1.5711469948291779e-01 + <_> + + 0 -1 794 -4.4986438297200948e-05 + + 2.9008099436759949e-01 -4.2413331568241119e-02 + <_> + + 0 -1 795 2.1421080455183983e-03 + + -3.3137580752372742e-01 5.3943689912557602e-02 + <_> + + 0 -1 796 -7.1408763527870178e-02 + + -8.8519471883773804e-01 9.3488330021500587e-03 + <_> + + 0 -1 797 -1.3733670115470886e-01 + + -8.3241897821426392e-01 1.7800329253077507e-02 + <_> + + 0 -1 798 6.1765720602124929e-04 + + -1.9419220089912415e-01 6.8034619092941284e-02 + <_> + + 0 -1 799 -6.7170798778533936e-02 + + -5.7243210077285767e-01 3.0333630740642548e-02 + <_> + + 0 -1 800 2.4611391127109528e-03 + + -1.0570179671049118e-01 1.8801900744438171e-01 + <_> + + 0 -1 801 5.0573959015309811e-03 + + -6.5921753644943237e-02 2.9868951439857483e-01 + <_> + + 0 -1 802 1.4213779941201210e-02 + + 6.3767880201339722e-02 -2.1217249333858490e-01 + <_> + + 0 -1 803 -2.0629619248211384e-03 + + -2.6714050769805908e-01 7.6817572116851807e-02 + <_> + + 0 -1 804 3.3787779510021210e-02 + + 2.1774150431156158e-02 -7.4938130378723145e-01 + <_> + + 0 -1 805 -2.7371870353817940e-02 + + 3.2008060812950134e-01 -5.9622511267662048e-02 + <_> + + 0 -1 806 2.8310349211096764e-02 + + 4.4150609523057938e-02 -4.4278699159622192e-01 + <_> + + 0 -1 807 3.7205279804766178e-03 + + -1.3136489689350128e-01 1.5447700023651123e-01 + <_> + + 0 -1 808 2.3320990148931742e-03 + + -1.0849229991436005e-01 2.2682890295982361e-01 + <_> + + 0 -1 809 7.6775359921157360e-03 + + 4.9520388245582581e-02 -3.8854768872261047e-01 + <_> + + 0 -1 810 -2.9863099916838109e-04 + + -1.9632560014724731e-01 8.3448931574821472e-02 + <_> + + 0 -1 811 6.1346050351858139e-03 + + 5.1433250308036804e-02 -3.0831611156463623e-01 + <_> + + 0 -1 812 3.1090779229998589e-02 + + 2.4180799722671509e-02 -6.0184460878372192e-01 + <_> + + 0 -1 813 2.9320400953292847e-01 + + 1.1811030097305775e-02 -9.6253931522369385e-01 + <_> + + 0 -1 814 -6.6321907797828317e-04 + + 1.0245270282030106e-01 -1.4200760424137115e-01 + <_> + + 0 -1 815 4.4736359268426895e-02 + + -1.1238799989223480e-01 1.7392039299011230e-01 + <_> + + 0 -1 816 -1.5153390355408192e-02 + + -1.6100360453128815e-01 3.1116949394345284e-02 + <_> + + 0 -1 817 -1.1029309825971723e-03 + + 1.2128510326147079e-01 -1.6182290017604828e-01 + <_> + + 0 -1 818 -2.8973959852010012e-03 + + 1.0827620327472687e-01 -5.3621310740709305e-02 + <_> + + 0 -1 819 -9.5785204321146011e-03 + + -1.6808320581912994e-01 8.5053622722625732e-02 + <_> + + 0 -1 820 9.9092386662960052e-02 + + -1.5469879843294621e-02 4.1138508915901184e-01 + <_> + + 0 -1 821 3.7229780107736588e-02 + + -5.2865970879793167e-02 3.1804299354553223e-01 + <_> + + 0 -1 822 -2.4716049432754517e-02 + + -4.0339410305023193e-01 2.9964840039610863e-02 + <_> + + 0 -1 823 -9.8965302109718323e-02 + + 5.8510482311248779e-01 -2.6924170553684235e-02 + <_> + + 0 -1 824 -9.6337851136922836e-03 + + -1.7467470467090607e-01 7.5126871466636658e-02 + <_> + + 0 -1 825 1.0483879595994949e-03 + + -1.3728469610214233e-01 1.0684580355882645e-01 + <_> + + 0 -1 826 4.2523849755525589e-02 + + 1.6578629612922668e-02 -5.6332737207412720e-01 + <_> + + 0 -1 827 -3.0866260640323162e-03 + + 7.5264893472194672e-02 -1.9476540386676788e-01 + <_> + + 0 -1 828 2.8643399477005005e-02 + + -6.7578136920928955e-02 2.5766220688819885e-01 + <_> + + 0 -1 829 -1.0627339594066143e-02 + + -2.2384619712829590e-01 7.2172448039054871e-02 + <_> + + 0 -1 830 4.6080970205366611e-03 + + 5.0876080989837646e-02 -1.4076329767704010e-01 + <_> + + 0 -1 831 2.9914160259068012e-03 + + -9.7337983548641205e-02 1.7665959894657135e-01 + <_> + + 0 -1 832 -7.7902628108859062e-03 + + -9.8008237779140472e-02 3.7403069436550140e-02 + <_> + + 0 -1 833 -6.1339238891378045e-04 + + 9.9036023020744324e-02 -1.6265949606895447e-01 + <_> + + 0 -1 834 -1.0234319604933262e-02 + + 2.3654979467391968e-01 -3.7817131727933884e-02 + <_> + + 0 -1 835 -1.1867409572005272e-02 + + -8.5035067796707153e-01 1.9063299521803856e-02 + <_> + + 0 -1 836 4.1437768377363682e-03 + + 8.7878346443176270e-02 -9.4404630362987518e-02 + <_> + + 0 -1 837 -5.1355729810893536e-03 + + -3.5699799656867981e-01 4.1546490043401718e-02 + <_> + + 0 -1 838 -1.5296200290322304e-03 + + 7.7694572508335114e-02 -4.3186578899621964e-02 + <_> + + 0 -1 839 -2.7581020258367062e-03 + + 1.9065889716148376e-01 -8.0679900944232941e-02 + <_> + + 0 -1 840 2.8375169634819031e-01 + + 6.2291761860251427e-03 -8.8578152656555176e-01 + <_> + + 0 -1 841 -2.4612499773502350e-01 + + -7.0548111200332642e-01 2.1798960864543915e-02 + <_> + + 0 -1 842 -3.9965631440281868e-03 + + -1.9710969924926758e-01 8.0300606787204742e-02 + <_> + + 0 -1 843 -8.4951231256127357e-03 + + 2.1296609938144684e-01 -8.2974627614021301e-02 + <_> + + 0 -1 844 4.7206480056047440e-02 + + 9.7466083243489265e-03 -7.0066297054290771e-01 + <_> + + 0 -1 845 3.7802560254931450e-03 + + 7.7478893101215363e-02 -2.3372000455856323e-01 + <_> + + 0 -1 846 4.4631671160459518e-02 + + -2.1464770659804344e-02 3.2136338949203491e-01 + <_> + + 0 -1 847 6.8157288478687406e-04 + + 1.2177070230245590e-01 -1.2063200026750565e-01 + <_> + + 0 -1 848 -6.9712452590465546e-02 + + -9.4828051328659058e-01 1.2017440050840378e-02 + <_> + + 0 -1 849 -4.8821792006492615e-03 + + -2.1774840354919434e-01 7.7113322913646698e-02 + <_> + + 0 -1 850 3.4387600608170033e-03 + + -1.8093569576740265e-01 9.3595556914806366e-02 + <_> + + 0 -1 851 -2.5215700268745422e-02 + + -5.5714958906173706e-01 2.7420820668339729e-02 + <_> + + 0 -1 852 7.4309771880507469e-03 + + -4.6630490571260452e-02 2.1024890244007111e-01 + <_> + + 0 -1 853 -1.5789959579706192e-02 + + -3.3443140983581543e-01 4.6291690319776535e-02 + <_> + + 0 -1 854 3.5080160014331341e-03 + + -6.4612612128257751e-02 2.2737669944763184e-01 + <_> + + 0 -1 855 4.4291261583566666e-02 + + 2.2642729803919792e-02 -7.0683121681213379e-01 + <_> + + 0 -1 856 1.9108189269900322e-02 + + -3.5893321037292480e-02 1.4613699913024902e-01 + <_> + 99 + -1.8724700212478638e+00 + + <_> + + 0 -1 857 -1.6636669635772705e-02 + + 2.5966519117355347e-01 -4.1162249445915222e-01 + <_> + + 0 -1 858 2.9865810647606850e-02 + + -3.3182668685913086e-01 2.0545999705791473e-01 + <_> + + 0 -1 859 9.1892024502158165e-03 + + -3.4481799602508545e-01 1.8148690462112427e-01 + <_> + + 0 -1 860 2.8450509998947382e-03 + + -3.2904830574989319e-01 9.4392292201519012e-02 + <_> + + 0 -1 861 3.4257639199495316e-02 + + -3.2212799787521362e-01 1.7332050204277039e-01 + <_> + + 0 -1 862 3.4367710351943970e-02 + + -3.2593810558319092e-01 1.7473269999027252e-01 + <_> + + 0 -1 863 9.0881884098052979e-03 + + 1.0527010262012482e-01 -4.8131370544433594e-01 + <_> + + 0 -1 864 -5.0939731299877167e-03 + + 1.7374989390373230e-01 -2.7883121371269226e-01 + <_> + + 0 -1 865 1.1773620499297976e-03 + + -4.2217200994491577e-01 1.0231760144233704e-01 + <_> + + 0 -1 866 3.6797609180212021e-02 + + 1.1229369789361954e-01 -3.8409191370010376e-01 + <_> + + 0 -1 867 -7.2484882548451424e-04 + + -4.4795128703117371e-01 8.5079587996006012e-02 + <_> + + 0 -1 868 1.2603210285305977e-02 + + 6.0475040227174759e-02 -3.5327509045600891e-01 + <_> + + 0 -1 869 5.1925552543252707e-04 + + -3.1916388869285583e-01 1.1903370171785355e-01 + <_> + + 0 -1 870 -1.3244180008769035e-02 + + 2.1975730359554291e-01 -9.5025591552257538e-02 + <_> + + 0 -1 871 -2.7882310096174479e-03 + + -2.7294808626174927e-01 1.2419769912958145e-01 + <_> + + 0 -1 872 2.6591470465064049e-02 + + 6.0452010482549667e-02 -3.9637029170989990e-01 + <_> + + 0 -1 873 1.2505210004746914e-02 + + 7.8631103038787842e-02 -4.0303888916969299e-01 + <_> + + 0 -1 874 -1.3857340440154076e-02 + + 2.5759750604629517e-01 -1.0351459681987762e-01 + <_> + + 0 -1 875 7.2099752724170685e-02 + + -5.5193781852722168e-01 6.0020800679922104e-02 + <_> + + 0 -1 876 -9.8338630050420761e-04 + + -3.1915199756622314e-01 8.7977647781372070e-02 + <_> + + 0 -1 877 -5.8390170335769653e-02 + + -5.5988979339599609e-01 5.2990190684795380e-02 + <_> + + 0 -1 878 4.2504342272877693e-03 + + -2.8897258639335632e-01 9.2816516757011414e-02 + <_> + + 0 -1 879 -3.2332520931959152e-02 + + -4.8713520169258118e-01 6.0787629336118698e-02 + <_> + + 0 -1 880 4.7365639358758926e-02 + + -1.0111550241708755e-01 3.2597780227661133e-01 + <_> + + 0 -1 881 -3.8943330291658640e-03 + + 1.9173160195350647e-01 -1.6729380190372467e-01 + <_> + + 0 -1 882 5.7729199528694153e-02 + + 3.6343291401863098e-02 -7.3161131143569946e-01 + <_> + + 0 -1 883 -1.8925540149211884e-02 + + 3.2471498847007751e-01 -8.6188063025474548e-02 + <_> + + 0 -1 884 -3.9679601788520813e-02 + + -4.1826680302619934e-01 5.3354211151599884e-02 + <_> + + 0 -1 885 -2.0733650773763657e-02 + + -4.1205188632011414e-01 6.3596852123737335e-02 + <_> + + 0 -1 886 1.5387910604476929e-01 + + 1.9954150542616844e-02 -5.7643288373947144e-01 + <_> + + 0 -1 887 1.2131260335445404e-01 + + 4.4516459107398987e-02 -5.9093242883682251e-01 + <_> + + 0 -1 888 2.7478559786686674e-05 + + -4.0688499808311462e-01 5.2828099578619003e-02 + <_> + + 0 -1 889 8.8893681764602661e-02 + + 5.1985241472721100e-02 -5.0228989124298096e-01 + <_> + + 0 -1 890 2.8169099241495132e-03 + + 6.7726433277130127e-02 -1.3582049310207367e-01 + <_> + + 0 -1 891 -1.7215269326698035e-04 + + 8.9616917073726654e-02 -2.9589369893074036e-01 + <_> + + 0 -1 892 -3.1830620020627975e-02 + + -5.6433600187301636e-01 2.2822249680757523e-02 + <_> + + 0 -1 893 -6.3334330916404724e-02 + + -8.2371699810028076e-01 2.7576120570302010e-02 + <_> + + 0 -1 894 -6.9032818078994751e-02 + + -6.9788217544555664e-01 3.3770920708775520e-03 + <_> + + 0 -1 895 2.1021519787609577e-03 + + -2.7244049310684204e-01 8.6922891438007355e-02 + <_> + + 0 -1 896 3.4065779298543930e-02 + + 1.7670579254627228e-02 -4.3001320958137512e-01 + <_> + + 0 -1 897 8.1215314567089081e-03 + + -1.5942670404911041e-01 1.6256070137023926e-01 + <_> + + 0 -1 898 -1.6329119680449367e-03 + + 4.2009588330984116e-02 -3.2923451066017151e-01 + <_> + + 0 -1 899 -3.9110329002141953e-02 + + -6.0666251182556152e-01 4.1248850524425507e-02 + <_> + + 0 -1 900 -2.3188870400190353e-02 + + -5.5365419387817383e-01 1.7315510660409927e-02 + <_> + + 0 -1 901 -6.2944158911705017e-02 + + -5.3853708505630493e-01 4.1758351027965546e-02 + <_> + + 0 -1 902 -8.5414372384548187e-02 + + -9.3122452497482300e-01 -9.1123272432014346e-04 + <_> + + 0 -1 903 -4.1963338851928711e-02 + + -5.6720697879791260e-01 3.9175700396299362e-02 + <_> + + 0 -1 904 1.1165619827806950e-02 + + -6.7815810441970825e-02 2.9003840684890747e-01 + <_> + + 0 -1 905 -1.3730769976973534e-02 + + 3.2328099012374878e-01 -1.0592839866876602e-01 + <_> + + 0 -1 906 -7.5793050229549408e-02 + + 5.5545729398727417e-01 -3.2934208866208792e-03 + <_> + + 0 -1 907 2.7008100878447294e-03 + + 1.5311180055141449e-01 -1.6604180634021759e-01 + <_> + + 0 -1 908 1.0164660401642323e-02 + + 7.6404631137847900e-02 -2.8745749592781067e-01 + <_> + + 0 -1 909 -5.9808149933815002e-02 + + -7.3486739397048950e-01 3.0370820313692093e-02 + <_> + + 0 -1 910 9.6447616815567017e-02 + + 2.6198839768767357e-02 -6.6001427173614502e-01 + <_> + + 0 -1 911 3.2350219786167145e-02 + + 4.1407719254493713e-02 -4.7442498803138733e-01 + <_> + + 0 -1 912 2.3717279732227325e-01 + + -9.5941081643104553e-02 2.4070499837398529e-01 + <_> + + 0 -1 913 -4.0942471474409103e-02 + + -4.0582120418548584e-01 6.4327560365200043e-02 + <_> + + 0 -1 914 -3.4409161657094955e-02 + + -7.4849551916122437e-01 2.2520760074257851e-02 + <_> + + 0 -1 915 1.3847379386425018e-01 + + 2.8472309932112694e-02 -7.0612120628356934e-01 + <_> + + 0 -1 916 4.6567160636186600e-02 + + -4.1168119758367538e-02 6.9962567090988159e-01 + <_> + + 0 -1 917 -3.0492639169096947e-02 + + -6.5116977691650391e-01 3.9995279163122177e-02 + <_> + + 0 -1 918 8.6345896124839783e-03 + + -1.1207970231771469e-01 7.7241696417331696e-02 + <_> + + 0 -1 919 3.1845968216657639e-02 + + -1.1552079766988754e-01 1.7539389431476593e-01 + <_> + + 0 -1 920 1.7124590277671814e-01 + + 5.0687979906797409e-02 -4.7042238712310791e-01 + <_> + + 0 -1 921 5.2879499271512032e-03 + + 6.5041497349739075e-02 -2.8894019126892090e-01 + <_> + + 0 -1 922 1.0060779750347137e-02 + + 6.3689216971397400e-02 -2.6081889867782593e-01 + <_> + + 0 -1 923 3.3330768346786499e-02 + + 3.4809298813343048e-02 -5.7845467329025269e-01 + <_> + + 0 -1 924 -5.2802279591560364e-02 + + -6.8521040678024292e-01 1.7583779990673065e-02 + <_> + + 0 -1 925 -1.5452199615538120e-02 + + 3.1395891308784485e-01 -7.7611543238162994e-02 + <_> + + 0 -1 926 -6.5528601408004761e-04 + + 5.6181360036134720e-02 -1.5184390544891357e-01 + <_> + + 0 -1 927 3.7062149494886398e-02 + + 2.8928549960255623e-02 -7.0487600564956665e-01 + <_> + + 0 -1 928 -5.7728089392185211e-02 + + -4.3192410469055176e-01 9.2153800651431084e-03 + <_> + + 0 -1 929 -2.2813139948993921e-03 + + 1.0200300067663193e-01 -2.1657040715217590e-01 + <_> + + 0 -1 930 2.6513230055570602e-02 + + -8.3650946617126465e-02 3.0740359425544739e-01 + <_> + + 0 -1 931 7.3622196912765503e-02 + + 3.0683049932122231e-02 -7.1910232305526733e-01 + <_> + + 0 -1 932 -1.3022350147366524e-02 + + -3.6386561393737793e-01 2.5367209687829018e-02 + <_> + + 0 -1 933 -1.3319820165634155e-02 + + -5.1884061098098755e-01 3.5935029387474060e-02 + <_> + + 0 -1 934 2.3190369829535484e-03 + + -6.1515200883150101e-02 7.1100451052188873e-02 + <_> + + 0 -1 935 -2.1372830495238304e-02 + + -5.0247579813003540e-01 3.9844810962677002e-02 + <_> + + 0 -1 936 2.4474589154124260e-02 + + -4.7960858792066574e-02 2.6931110024452209e-01 + <_> + + 0 -1 937 -1.0679869912564754e-02 + + 3.1474280357360840e-01 -8.4758952260017395e-02 + <_> + + 0 -1 938 4.8961799591779709e-02 + + 2.7358099818229675e-02 -3.8229361176490784e-01 + <_> + + 0 -1 939 3.2376348972320557e-02 + + -4.7090999782085419e-02 4.5985230803489685e-01 + <_> + + 0 -1 940 -1.0995220392942429e-02 + + -1.8544240295886993e-01 3.6006979644298553e-02 + <_> + + 0 -1 941 1.7626030743122101e-01 + + 2.4375159293413162e-02 -7.7686601877212524e-01 + <_> + + 0 -1 942 7.9778492450714111e-02 + + 3.3787339925765991e-03 -7.2928887605667114e-01 + <_> + + 0 -1 943 -1.1329210363328457e-02 + + -4.6397671103477478e-01 3.9380829781293869e-02 + <_> + + 0 -1 944 6.3431300222873688e-02 + + -9.7074061632156372e-02 1.0118869692087173e-01 + <_> + + 0 -1 945 -1.2691849842667580e-02 + + 2.8142300248146057e-01 -7.2105713188648224e-02 + <_> + + 0 -1 946 -7.8238412737846375e-02 + + 5.7400637865066528e-01 -1.8400549888610840e-02 + <_> + + 0 -1 947 3.9532519876956940e-02 + + 4.3154988437891006e-02 -5.2327841520309448e-01 + <_> + + 0 -1 948 1.5355779789388180e-02 + + -4.7316178679466248e-02 4.6925771236419678e-01 + <_> + + 0 -1 949 -6.4018620178103447e-03 + + 1.3297230005264282e-01 -1.4365619421005249e-01 + <_> + + 0 -1 950 -1.0567340254783630e-01 + + 2.0206320285797119e-01 -1.4406460337340832e-02 + <_> + + 0 -1 951 2.8163839131593704e-02 + + 7.1180991828441620e-02 -3.1034231185913086e-01 + <_> + + 0 -1 952 1.1702980101108551e-01 + + 1.1619930155575275e-02 -7.1530961990356445e-01 + <_> + + 0 -1 953 -3.8921568542718887e-02 + + 2.4412679672241211e-01 -8.2244850695133209e-02 + <_> + + 0 -1 954 -2.8435489162802696e-02 + + -3.6785170435905457e-01 3.8488820195198059e-02 + <_> + + 0 -1 955 -3.6393549293279648e-02 + + 5.2206730842590332e-01 -4.7079380601644516e-02 + <_> + 139 + -1.7121059894561768e+00 + + <_> + + 0 -1 956 -2.1428510546684265e-02 + + 1.9014079868793488e-01 -5.0612741708755493e-01 + <_> + + 0 -1 957 2.0596129819750786e-02 + + -2.9283228516578674e-01 2.4655179679393768e-01 + <_> + + 0 -1 958 2.7893469668924809e-03 + + 1.1085920035839081e-01 -4.6909829974174500e-01 + <_> + + 0 -1 959 4.4722640886902809e-03 + + -2.8250780701637268e-01 1.4564670622348785e-01 + <_> + + 0 -1 960 -1.0463190264999866e-03 + + -2.6603269577026367e-01 1.2815919518470764e-01 + <_> + + 0 -1 961 1.5831940108910203e-03 + + -6.3467299938201904e-01 7.1003831923007965e-02 + <_> + + 0 -1 962 -7.3153319135599304e-06 + + 1.0248930007219315e-01 -3.4815961122512817e-01 + <_> + + 0 -1 963 5.4208859801292419e-03 + + 5.9830531477928162e-02 -3.1387779116630554e-01 + <_> + + 0 -1 964 1.2645759852603078e-03 + + -2.2709150612354279e-01 1.3160009682178497e-01 + <_> + + 0 -1 965 3.0235300073400140e-05 + + -2.6413309574127197e-01 2.8918080031871796e-02 + <_> + + 0 -1 966 1.5345469582825899e-03 + + -4.0711951255798340e-01 6.9787837564945221e-02 + <_> + + 0 -1 967 6.8222070112824440e-03 + + -1.5069720149040222e-01 2.1888419985771179e-01 + <_> + + 0 -1 968 -9.8558319732546806e-03 + + -3.5441368818283081e-01 8.6026392877101898e-02 + <_> + + 0 -1 969 -2.9890429228544235e-02 + + 2.2117440402507782e-01 -2.8611009940505028e-02 + <_> + + 0 -1 970 -2.6285760104656219e-03 + + 9.8204180598258972e-02 -2.7149739861488342e-01 + <_> + + 0 -1 971 3.2039839425124228e-04 + + -9.8540462553501129e-02 1.8785539269447327e-01 + <_> + + 0 -1 972 1.1079469695687294e-03 + + 6.4034536480903625e-02 -4.3082669377326965e-01 + <_> + + 0 -1 973 -9.1538369655609131e-02 + + -5.2440929412841797e-01 1.2250489555299282e-02 + <_> + + 0 -1 974 4.3205898255109787e-02 + + 9.6655867993831635e-02 -2.6809310913085938e-01 + <_> + + 0 -1 975 9.1920839622616768e-04 + + -1.3260160386562347e-01 1.2358319759368896e-01 + <_> + + 0 -1 976 8.9521165937185287e-03 + + 8.6445420980453491e-02 -2.3219430446624756e-01 + <_> + + 0 -1 977 5.6190020404756069e-03 + + -6.0304049402475357e-02 1.5070669353008270e-01 + <_> + + 0 -1 978 3.7380240391939878e-03 + + -1.8652540445327759e-01 1.3011780381202698e-01 + <_> + + 0 -1 979 -4.4416960328817368e-02 + + 1.9036759436130524e-01 -1.7527159303426743e-02 + <_> + + 0 -1 980 1.9832739606499672e-02 + + -5.3527630865573883e-02 4.0238130092620850e-01 + <_> + + 0 -1 981 1.2155610136687756e-02 + + 9.1288566589355469e-02 -2.6862761378288269e-01 + <_> + + 0 -1 982 5.0532341003417969e-02 + + 3.1295180320739746e-02 -6.2836539745330811e-01 + <_> + + 0 -1 983 -1.7635909607633948e-03 + + 5.6185219436883926e-02 -2.1861009299755096e-01 + <_> + + 0 -1 984 4.9412921071052551e-03 + + 5.5915899574756622e-02 -3.5954388976097107e-01 + <_> + + 0 -1 985 -1.1536119878292084e-01 + + -5.3168737888336182e-01 7.9654296860098839e-03 + <_> + + 0 -1 986 -2.0473708864301443e-03 + + 7.9633012413978577e-02 -2.5389900803565979e-01 + <_> + + 0 -1 987 4.7814860008656979e-03 + + -9.4149880111217499e-02 1.1631009727716446e-01 + <_> + + 0 -1 988 2.1274939179420471e-02 + + -4.7486610710620880e-02 3.7564519047737122e-01 + <_> + + 0 -1 989 5.1177050918340683e-03 + + 7.4936643242835999e-02 -2.6105350255966187e-01 + <_> + + 0 -1 990 -1.3952000066637993e-02 + + 2.3960170149803162e-01 -9.6836768090724945e-02 + <_> + + 0 -1 991 -1.3828179799020290e-02 + + -3.9605268836021423e-01 5.8639749884605408e-02 + <_> + + 0 -1 992 -4.7117020934820175e-02 + + -5.5717539787292480e-01 3.1678650528192520e-02 + <_> + + 0 -1 993 1.0515590198338032e-02 + + -4.3930530548095703e-02 8.5277959704399109e-02 + <_> + + 0 -1 994 4.0591089054942131e-03 + + -1.0774219781160355e-01 1.6283099353313446e-01 + <_> + + 0 -1 995 -3.0376210808753967e-02 + + 2.0997379720211029e-01 -9.9417790770530701e-02 + <_> + + 0 -1 996 -6.6932791378349066e-04 + + -3.4863340854644775e-01 5.9148021042346954e-02 + <_> + + 0 -1 997 -1.4665089547634125e-02 + + -4.3786540627479553e-01 2.8008179739117622e-02 + <_> + + 0 -1 998 -3.5847770050168037e-03 + + 9.6611537039279938e-02 -1.7948310077190399e-01 + <_> + + 0 -1 999 -5.5043050087988377e-03 + + -3.3546659350395203e-01 7.5057849287986755e-02 + <_> + + 0 -1 1000 1.0141800157725811e-03 + + -1.8602859973907471e-01 8.6880050599575043e-02 + <_> + + 0 -1 1001 1.4642399735748768e-02 + + 2.6652090251445770e-02 -2.6002681255340576e-01 + <_> + + 0 -1 1002 -5.8538499288260937e-03 + + -1.4993189275264740e-01 1.2684640288352966e-01 + <_> + + 0 -1 1003 -5.3472168743610382e-02 + + 5.2131122350692749e-01 -2.0375749096274376e-02 + <_> + + 0 -1 1004 -7.6695926487445831e-02 + + 4.5817071199417114e-01 -3.4876950085163116e-02 + <_> + + 0 -1 1005 -5.9094227617606521e-04 + + 1.1570499837398529e-01 -1.2966969609260559e-01 + <_> + + 0 -1 1006 -4.3543361127376556e-02 + + -8.2132732868194580e-01 2.0535599440336227e-02 + <_> + + 0 -1 1007 5.0691701471805573e-02 + + -3.6280639469623566e-02 4.0212449431419373e-01 + <_> + + 0 -1 1008 1.3124669902026653e-02 + + -8.3614267408847809e-02 2.0441520214080811e-01 + <_> + + 0 -1 1009 3.5445049405097961e-01 + + 1.4580509625375271e-02 -5.6883698701858521e-01 + <_> + + 0 -1 1010 -2.1929910406470299e-02 + + 1.6368280351161957e-01 -1.0018540173768997e-01 + <_> + + 0 -1 1011 3.8168739527463913e-02 + + 3.5331390798091888e-02 -5.3782612085342407e-01 + <_> + + 0 -1 1012 6.3126571476459503e-03 + + 5.6145761162042618e-02 -2.8158029913902283e-01 + <_> + + 0 -1 1013 -4.3002668768167496e-02 + + -6.4804542064666748e-01 1.7478020861744881e-02 + <_> + + 0 -1 1014 2.4681850336492062e-03 + + -1.1719709634780884e-01 1.3693059980869293e-01 + <_> + + 0 -1 1015 4.5261289924383163e-02 + + 1.5927750617265701e-02 -7.1915590763092041e-01 + <_> + + 0 -1 1016 -4.2067110538482666e-02 + + -6.4201879501342773e-01 2.0196499302983284e-02 + <_> + + 0 -1 1017 3.9601750904694200e-04 + + -3.1774568557739258e-01 7.6843477785587311e-02 + <_> + + 0 -1 1018 -1.2469319626688957e-02 + + 1.9531419873237610e-01 -7.8799232840538025e-02 + <_> + + 0 -1 1019 7.9188523814082146e-03 + + 5.6721080094575882e-02 -2.6906439661979675e-01 + <_> + + 0 -1 1020 -6.2929331324994564e-03 + + 1.5688340365886688e-01 -9.9287010729312897e-02 + <_> + + 0 -1 1021 2.2974120453000069e-02 + + -6.6930226981639862e-02 2.4427099525928497e-01 + <_> + + 0 -1 1022 -9.1710267588496208e-03 + + -2.9078531265258789e-01 5.9312019497156143e-02 + <_> + + 0 -1 1023 -9.5892272889614105e-02 + + -6.3700878620147705e-01 1.3278760015964508e-02 + <_> + + 0 -1 1024 5.6696119718253613e-03 + + 5.6131001561880112e-02 -2.9535120725631714e-01 + <_> + + 0 -1 1025 -1.3495329767465591e-02 + + 2.0205779373645782e-01 -6.3128583133220673e-02 + <_> + + 0 -1 1026 1.6108239069581032e-02 + + 4.5092061161994934e-02 -3.6163818836212158e-01 + <_> + + 0 -1 1027 1.1768710101023316e-03 + + -1.9879919290542603e-01 1.3078540563583374e-01 + <_> + + 0 -1 1028 1.4128970215097070e-03 + + -2.0856089890003204e-01 8.1473708152770996e-02 + <_> + + 0 -1 1029 -4.3028060346841812e-02 + + -2.8687548637390137e-01 2.9704660177230835e-02 + <_> + + 0 -1 1030 -1.0961409658193588e-02 + + 4.8846191167831421e-01 -3.5002779215574265e-02 + <_> + + 0 -1 1031 -4.5575079275295138e-04 + + 1.0644569993019104e-01 -1.0506340116262436e-01 + <_> + + 0 -1 1032 -5.0013329833745956e-02 + + -8.2039457559585571e-01 1.8604470416903496e-02 + <_> + + 0 -1 1033 -4.6841200441122055e-02 + + -8.6972111463546753e-01 3.9388639852404594e-03 + <_> + + 0 -1 1034 -8.0362131120637059e-04 + + 1.4196899533271790e-01 -1.2184119969606400e-01 + <_> + + 0 -1 1035 1.9802400842308998e-02 + + 4.0857948362827301e-02 -3.6116421222686768e-01 + <_> + + 0 -1 1036 2.1874029189348221e-02 + + -5.8230601251125336e-02 2.4490930140018463e-01 + <_> + + 0 -1 1037 3.2371848821640015e-02 + + 2.6172259822487831e-02 -4.0803569555282593e-01 + <_> + + 0 -1 1038 -7.0319771766662598e-03 + + -2.5175130367279053e-01 6.0090810060501099e-02 + <_> + + 0 -1 1039 2.6019799988716841e-03 + + -7.0827886462211609e-02 2.0735129714012146e-01 + <_> + + 0 -1 1040 -3.1531439162790775e-03 + + 1.7268289625644684e-01 -1.1326900124549866e-01 + <_> + + 0 -1 1041 5.8357551693916321e-02 + + 1.4668770134449005e-02 -9.2907238006591797e-01 + <_> + + 0 -1 1042 3.6941959988325834e-03 + + 6.6812008619308472e-02 -2.0454549789428711e-01 + <_> + + 0 -1 1043 1.8183739855885506e-02 + + -3.5921659320592880e-02 2.3765130341053009e-01 + <_> + + 0 -1 1044 -4.4514648616313934e-03 + + -1.8156670033931732e-01 8.0072969198226929e-02 + <_> + + 0 -1 1045 3.5554010421037674e-02 + + 1.1413309723138809e-02 -3.9503180980682373e-01 + <_> + + 0 -1 1046 1.6067499294877052e-02 + + -4.9147009849548340e-02 3.0306708812713623e-01 + <_> + + 0 -1 1047 3.6372188478708267e-02 + + 2.3675160482525826e-02 -6.8069261312484741e-01 + <_> + + 0 -1 1048 -7.4834008701145649e-03 + + 2.4146680533885956e-01 -5.8301728218793869e-02 + <_> + + 0 -1 1049 -7.2762509807944298e-03 + + -2.2373069822788239e-01 5.0284590572118759e-02 + <_> + + 0 -1 1050 -4.7946218401193619e-03 + + -2.1922710537910461e-01 6.6698201000690460e-02 + <_> + + 0 -1 1051 -1.3066439889371395e-02 + + 2.2604539990425110e-01 -3.7037428468465805e-02 + <_> + + 0 -1 1052 2.3257338907569647e-03 + + -8.1509239971637726e-02 2.3270750045776367e-01 + <_> + + 0 -1 1053 -1.1436239816248417e-02 + + 6.7732691764831543e-02 -3.3069651573896408e-02 + <_> + + 0 -1 1054 6.7957569845020771e-03 + + 9.3188859522342682e-02 -1.8542419373989105e-01 + <_> + + 0 -1 1055 -5.2705928683280945e-02 + + 4.0707829594612122e-01 -2.5846559554338455e-02 + <_> + + 0 -1 1056 1.2774269282817841e-01 + + 1.7207339406013489e-02 -8.8952672481536865e-01 + <_> + + 0 -1 1057 -2.7999880909919739e-01 + + -9.1963422298431396e-01 2.5054879370145500e-04 + <_> + + 0 -1 1058 1.2669020332396030e-02 + + -7.3152393102645874e-02 2.0872280001640320e-01 + <_> + + 0 -1 1059 -1.5894599258899689e-02 + + 1.1266420036554337e-01 -4.0140561759471893e-02 + <_> + + 0 -1 1060 5.3938169032335281e-02 + + 3.0137389898300171e-02 -5.0454300642013550e-01 + <_> + + 0 -1 1061 7.3805922875180840e-04 + + -3.5923779010772705e-01 3.3418480306863785e-02 + <_> + + 0 -1 1062 4.7065159305930138e-03 + + 4.4195190072059631e-01 -3.9396088570356369e-02 + <_> + + 0 -1 1063 3.0945870094001293e-03 + + -7.1224376559257507e-02 1.2306260317564011e-01 + <_> + + 0 -1 1064 -3.2640039920806885e-02 + + -4.4644719362258911e-01 3.4509830176830292e-02 + <_> + + 0 -1 1065 -7.8390557318925858e-03 + + -9.9895596504211426e-02 3.3491879701614380e-02 + <_> + + 0 -1 1066 7.6504289172589779e-03 + + 5.5107340216636658e-02 -2.4002109467983246e-01 + <_> + + 0 -1 1067 3.8153179921209812e-03 + + -5.7143520563840866e-02 1.7120680212974548e-01 + <_> + + 0 -1 1068 1.4295349828898907e-02 + + -5.5747661739587784e-02 2.6719009876251221e-01 + <_> + + 0 -1 1069 -1.8241480574943125e-04 + + 4.7362379729747772e-02 -2.1473219990730286e-01 + <_> + + 0 -1 1070 -3.1916480511426926e-02 + + -1.4398300647735596e-01 9.2526309192180634e-02 + <_> + + 0 -1 1071 -7.6755490154027939e-03 + + 1.2513080239295959e-01 -5.2855581045150757e-02 + <_> + + 0 -1 1072 1.4152109622955322e-02 + + -5.8198999613523483e-02 2.4444380402565002e-01 + <_> + + 0 -1 1073 -1.6701059415936470e-02 + + -3.0269339680671692e-01 2.5713469833135605e-02 + <_> + + 0 -1 1074 3.5869849380105734e-03 + + -1.1999790370464325e-01 1.2468840181827545e-01 + <_> + + 0 -1 1075 3.7683059927076101e-03 + + 5.0271350890398026e-02 -2.0477029681205750e-01 + <_> + + 0 -1 1076 9.9043175578117371e-04 + + -8.5413850843906403e-02 1.6316239535808563e-01 + <_> + + 0 -1 1077 9.3151312321424484e-03 + + 9.4177378341555595e-03 -3.5209101438522339e-01 + <_> + + 0 -1 1078 -1.5002860163804144e-04 + + 8.3480976521968842e-02 -1.7047779262065887e-01 + <_> + + 0 -1 1079 8.7790598627179861e-04 + + -1.1054719984531403e-01 1.1750820279121399e-01 + <_> + + 0 -1 1080 -3.7630271166563034e-02 + + 5.0325840711593628e-01 -2.6165060698986053e-02 + <_> + + 0 -1 1081 5.6488867849111557e-03 + + 7.4713237583637238e-02 -1.4058519899845123e-01 + <_> + + 0 -1 1082 -1.4621330192312598e-03 + + 6.7465327680110931e-02 -2.0143230259418488e-01 + <_> + + 0 -1 1083 5.3189881145954132e-03 + + -3.5997938364744186e-02 3.7376481294631958e-01 + <_> + + 0 -1 1084 2.1019520238041878e-02 + + 2.7063809335231781e-02 -5.0199657678604126e-01 + <_> + + 0 -1 1085 -1.1328969895839691e-01 + + -7.4395442008972168e-01 1.3778089545667171e-02 + <_> + + 0 -1 1086 -6.1144838109612465e-03 + + 1.4044840633869171e-01 -8.7939672172069550e-02 + <_> + + 0 -1 1087 -7.7648349106311798e-03 + + -1.4341640472412109e-01 4.3061099946498871e-02 + <_> + + 0 -1 1088 -9.1335996985435486e-02 + + -6.3246071338653564e-01 2.0902950316667557e-02 + <_> + + 0 -1 1089 -1.6339610517024994e-01 + + -7.7071088552474976e-01 1.3627690263092518e-02 + <_> + + 0 -1 1090 5.3004521131515503e-01 + + 1.2292830273509026e-02 -7.9708522558212280e-01 + <_> + + 0 -1 1091 -3.0609068926423788e-03 + + 5.7478528469800949e-02 -8.8626816868782043e-02 + <_> + + 0 -1 1092 1.3204859569668770e-03 + + -1.0473939776420593e-01 1.2416320294141769e-01 + <_> + + 0 -1 1093 -6.6045127809047699e-02 + + -7.0403701066970825e-01 7.2672651149332523e-03 + <_> + + 0 -1 1094 5.2080051973462105e-03 + + 7.3289416730403900e-02 -1.6105780005455017e-01 + <_> + 106 + -1.8098859786987305e+00 + + <_> + + 0 -1 1095 -2.4040700867772102e-02 + + 2.4318559467792511e-01 -3.8189288973808289e-01 + <_> + + 0 -1 1096 2.6374191045761108e-01 + + -2.5091141462326050e-01 2.7231940627098083e-01 + <_> + + 0 -1 1097 3.3161949831992388e-03 + + -2.8115370869636536e-01 2.2977580130100250e-01 + <_> + + 0 -1 1098 2.5751669891178608e-03 + + -6.4815878868103027e-01 8.3049327135086060e-02 + <_> + + 0 -1 1099 1.2843149714171886e-02 + + -5.4388070106506348e-01 8.6304552853107452e-02 + <_> + + 0 -1 1100 1.3005360029637814e-02 + + -2.6411589980125427e-01 2.2107879817485809e-01 + <_> + + 0 -1 1101 2.6304060593247414e-02 + + -2.2276160120964050e-01 2.2458629310131073e-01 + <_> + + 0 -1 1102 -6.8887993693351746e-02 + + 4.4677790999412537e-01 -1.8398750573396683e-02 + <_> + + 0 -1 1103 1.5864400193095207e-02 + + -3.3532321453094482e-01 1.6380620002746582e-01 + <_> + + 0 -1 1104 -7.1481592021882534e-03 + + -3.5999459028244019e-01 1.0679650306701660e-01 + <_> + + 0 -1 1105 -1.2002130039036274e-02 + + -3.7498581409454346e-01 9.6759349107742310e-02 + <_> + + 0 -1 1106 -2.6663220487535000e-03 + + -3.8941639661788940e-01 5.9776391834020615e-02 + <_> + + 0 -1 1107 5.2618351764976978e-04 + + -3.0557510256767273e-01 1.0778070241212845e-01 + <_> + + 0 -1 1108 -4.0705721825361252e-02 + + -5.8572947978973389e-01 4.0660858154296875e-02 + <_> + + 0 -1 1109 -8.7929163128137589e-03 + + 2.3699410259723663e-01 -1.3827539980411530e-01 + <_> + + 0 -1 1110 -2.2475840523838997e-03 + + -3.5475319623947144e-01 8.9079782366752625e-02 + <_> + + 0 -1 1111 5.8501982130110264e-03 + + 9.1695636510848999e-02 -3.3329799771308899e-01 + <_> + + 0 -1 1112 -3.9623910561203957e-03 + + -1.9845740497112274e-01 1.2363869696855545e-01 + <_> + + 0 -1 1113 -1.7685770289972425e-03 + + 7.3684811592102051e-02 -4.5862528681755066e-01 + <_> + + 0 -1 1114 6.3303880393505096e-02 + + 4.8690151423215866e-02 -5.7301318645477295e-01 + <_> + + 0 -1 1115 7.9875197261571884e-03 + + -8.1072300672531128e-01 2.7054410427808762e-02 + <_> + + 0 -1 1116 -1.3520400039851665e-02 + + 1.6274809837341309e-01 -1.6841860115528107e-01 + <_> + + 0 -1 1117 4.8139609396457672e-02 + + 4.5234218239784241e-02 -5.7300239801406860e-01 + <_> + + 0 -1 1118 5.0355647690594196e-03 + + 6.5225511789321899e-02 -2.5856611132621765e-01 + <_> + + 0 -1 1119 1.9625260028988123e-04 + + 1.4221550524234772e-01 -1.8481519818305969e-01 + <_> + + 0 -1 1120 2.5747891049832106e-03 + + -3.5904300212860107e-01 7.5663506984710693e-02 + <_> + + 0 -1 1121 -4.0524629876017570e-03 + + -2.1212129294872284e-01 1.1840210109949112e-01 + <_> + + 0 -1 1122 5.6920260190963745e-02 + + -4.3657299131155014e-02 3.8774600625038147e-01 + <_> + + 0 -1 1123 3.7986990064382553e-02 + + -8.1706330180168152e-02 3.9529800415039062e-01 + <_> + + 0 -1 1124 -2.2731529548764229e-02 + + -3.4693419933319092e-01 6.8438567221164703e-02 + <_> + + 0 -1 1125 9.9069473799318075e-04 + + -3.6681869626045227e-01 6.1036650091409683e-02 + <_> + + 0 -1 1126 -4.3086782097816467e-03 + + 1.4361980557441711e-01 -9.6160076558589935e-02 + <_> + + 0 -1 1127 -2.5202209129929543e-02 + + -4.6109348535537720e-01 5.9420660138130188e-02 + <_> + + 0 -1 1128 -3.3597718924283981e-02 + + -4.7127521038055420e-01 9.6356319263577461e-03 + <_> + + 0 -1 1129 -4.6891071833670139e-03 + + 1.9676209986209869e-01 -1.1853359639644623e-01 + <_> + + 0 -1 1130 2.4549920111894608e-02 + + -4.5542590320110321e-02 2.8717058897018433e-01 + <_> + + 0 -1 1131 -1.8802500562742352e-03 + + -2.9892438650131226e-01 8.0199889838695526e-02 + <_> + + 0 -1 1132 2.0160999894142151e-01 + + 3.0502580106258392e-02 -4.8414209485054016e-01 + <_> + + 0 -1 1133 -6.9803953170776367e-02 + + -6.2382811307907104e-01 3.5180661827325821e-02 + <_> + + 0 -1 1134 9.1318902559578419e-04 + + -1.9935069978237152e-01 6.8270348012447357e-02 + <_> + + 0 -1 1135 1.4578959904611111e-02 + + 1.0063359886407852e-01 -2.5353130698204041e-01 + <_> + + 0 -1 1136 5.0130348652601242e-02 + + 5.7192109525203705e-02 -4.1628059744834900e-01 + <_> + + 0 -1 1137 -1.8048109486699104e-02 + + -4.4572651386260986e-01 5.0399489700794220e-02 + <_> + + 0 -1 1138 1.4818160235881805e-01 + + 1.6779610887169838e-02 -4.5810478925704956e-01 + <_> + + 0 -1 1139 -2.6285950094461441e-02 + + 3.5442620515823364e-01 -6.1184428632259369e-02 + <_> + + 0 -1 1140 -1.8414109945297241e-02 + + -3.2132109999656677e-01 7.6148152351379395e-02 + <_> + + 0 -1 1141 6.1610070988535881e-03 + + 8.7946079671382904e-02 -2.5913208723068237e-01 + <_> + + 0 -1 1142 -2.5900160893797874e-02 + + 3.0681431293487549e-01 -6.5600410103797913e-02 + <_> + + 0 -1 1143 1.5014899894595146e-02 + + -5.6076969951391220e-02 3.8661429286003113e-01 + <_> + + 0 -1 1144 -4.3112158775329590e-02 + + 5.5926108360290527e-01 -3.9232630282640457e-02 + <_> + + 0 -1 1145 -2.1485170349478722e-02 + + -4.6384871006011963e-01 4.8264618963003159e-02 + <_> + + 0 -1 1146 -2.5131789967417717e-02 + + -4.8091739416122437e-01 4.1346170008182526e-02 + <_> + + 0 -1 1147 4.1451459401287138e-04 + + 4.4691830873489380e-02 -4.2174011468887329e-01 + <_> + + 0 -1 1148 1.0218570008873940e-02 + + 5.3744480013847351e-02 -1.9395479559898376e-01 + <_> + + 0 -1 1149 -2.0342700183391571e-02 + + 2.9722499847412109e-01 -7.1297563612461090e-02 + <_> + + 0 -1 1150 -3.0666049569845200e-02 + + -3.9920780062675476e-01 4.5510981231927872e-02 + <_> + + 0 -1 1151 -3.2767441123723984e-02 + + -5.0248539447784424e-01 4.4888608157634735e-02 + <_> + + 0 -1 1152 -5.4365001618862152e-02 + + -4.7751170396804810e-01 4.1882470250129700e-02 + <_> + + 0 -1 1153 -2.9916359111666679e-02 + + 3.5793611407279968e-01 -6.1831939965486526e-02 + <_> + + 0 -1 1154 1.0144179686903954e-02 + + -1.5790919959545135e-01 5.7373359799385071e-02 + <_> + + 0 -1 1155 1.5639010071754456e-01 + + 3.2949700951576233e-02 -6.4462232589721680e-01 + <_> + + 0 -1 1156 5.4447978734970093e-02 + + -4.1508059948682785e-02 1.2866689264774323e-01 + <_> + + 0 -1 1157 -3.9772719144821167e-02 + + -6.8962317705154419e-01 2.9046570882201195e-02 + <_> + + 0 -1 1158 6.9650667719542980e-03 + + -9.4761677086353302e-02 1.8257130682468414e-01 + <_> + + 0 -1 1159 -5.1617428660392761e-02 + + -4.4907289743423462e-01 4.3913140892982483e-02 + <_> + + 0 -1 1160 -2.6814609766006470e-02 + + -2.2568839788436890e-01 5.4928071796894073e-02 + <_> + + 0 -1 1161 1.3181920163333416e-02 + + 8.0101907253265381e-02 -2.8673300147056580e-01 + <_> + + 0 -1 1162 1.4241590164601803e-02 + + -8.4264412522315979e-02 2.1000739932060242e-01 + <_> + + 0 -1 1163 3.1410539522767067e-03 + + 1.3257560133934021e-01 -1.5610539913177490e-01 + <_> + + 0 -1 1164 1.0995150357484818e-01 + + 1.2388270348310471e-02 -4.0302368998527527e-01 + <_> + + 0 -1 1165 1.7845850437879562e-02 + + 5.2870228886604309e-02 -3.7930241227149963e-01 + <_> + + 0 -1 1166 1.0851990431547165e-02 + + -5.4071258753538132e-02 3.5186240077018738e-01 + <_> + + 0 -1 1167 -2.5958200916647911e-02 + + 4.1978350281715393e-01 -4.0477428585290909e-02 + <_> + + 0 -1 1168 4.0990379638969898e-03 + + 5.0911288708448410e-02 -3.5974949598312378e-01 + <_> + + 0 -1 1169 1.4909840188920498e-02 + + -6.1437230557203293e-02 2.8947550058364868e-01 + <_> + + 0 -1 1170 4.0265037678182125e-03 + + 1.0686399787664413e-01 -1.2979680299758911e-01 + <_> + + 0 -1 1171 3.9495688676834106e-01 + + -2.8920559212565422e-02 6.3535267114639282e-01 + <_> + + 0 -1 1172 1.2874379754066467e-02 + + -1.1910410225391388e-01 1.2068430334329605e-01 + <_> + + 0 -1 1173 -4.8598181456327438e-02 + + 4.6885690093040466e-01 -4.2797289788722992e-02 + <_> + + 0 -1 1174 1.5357979573309422e-03 + + -3.0882269144058228e-01 6.3154831528663635e-02 + <_> + + 0 -1 1175 3.5379750188440084e-03 + + 1.0132449865341187e-01 -1.7726400494575500e-01 + <_> + + 0 -1 1176 -1.9441220909357071e-02 + + 2.3254390060901642e-01 -5.3732268512248993e-02 + <_> + + 0 -1 1177 2.5940369814634323e-03 + + -3.5682299733161926e-01 5.0598859786987305e-02 + <_> + + 0 -1 1178 5.9910379350185394e-02 + + -2.4030869826674461e-02 1.7003220319747925e-01 + <_> + + 0 -1 1179 -1.1181759648025036e-02 + + 3.4869500994682312e-01 -6.2812417745590210e-02 + <_> + + 0 -1 1180 4.9201812362298369e-04 + + -1.2642909586429596e-01 3.6503899842500687e-02 + <_> + + 0 -1 1181 6.7902177572250366e-02 + + -4.2887088656425476e-01 4.6336911618709564e-02 + <_> + + 0 -1 1182 1.5728829428553581e-02 + + -6.3028946518898010e-02 1.6275769472122192e-01 + <_> + + 0 -1 1183 -1.4824390411376953e-02 + + -5.3391677141189575e-01 3.2132621854543686e-02 + <_> + + 0 -1 1184 -1.9706260412931442e-02 + + 2.5455629825592041e-01 -3.0816650018095970e-02 + <_> + + 0 -1 1185 9.6607124432921410e-03 + + 9.2674352228641510e-02 -1.7940239608287811e-01 + <_> + + 0 -1 1186 -4.9929421395063400e-02 + + 2.6743340492248535e-01 -2.5595119222998619e-02 + <_> + + 0 -1 1187 7.3459640145301819e-02 + + -5.8698959648609161e-02 2.8898829221725464e-01 + <_> + + 0 -1 1188 -8.6538150208070874e-04 + + -1.4318460226058960e-01 6.5386183559894562e-02 + <_> + + 0 -1 1189 -1.0462219826877117e-02 + + -3.2498508691787720e-01 5.4955318570137024e-02 + <_> + + 0 -1 1190 -6.3478751108050346e-03 + + -1.0396370291709900e-01 4.0321409702301025e-02 + <_> + + 0 -1 1191 1.1406400054693222e-01 + + 2.6192039251327515e-02 -6.6177910566329956e-01 + <_> + + 0 -1 1192 -2.6893770322203636e-02 + + -3.5338699817657471e-01 1.9753590226173401e-02 + <_> + + 0 -1 1193 8.0600962042808533e-02 + + 2.8878480195999146e-02 -5.4975187778472900e-01 + <_> + + 0 -1 1194 -7.4676960706710815e-02 + + -3.4416058659553528e-01 2.6990719139575958e-02 + <_> + + 0 -1 1195 -7.7004089951515198e-02 + + 4.0045699477195740e-01 -4.5340269804000854e-02 + <_> + + 0 -1 1196 -8.6920477449893951e-02 + + -3.4687021374702454e-01 3.9195980876684189e-02 + <_> + + 0 -1 1197 -4.3200692161917686e-03 + + 7.5932569801807404e-02 -2.3720650374889374e-01 + <_> + + 0 -1 1198 -3.4127760678529739e-02 + + -4.1994720697402954e-01 4.3633870780467987e-02 + <_> + + 0 -1 1199 2.1845370531082153e-02 + + -5.8681700378656387e-02 3.2972678542137146e-01 + <_> + + 0 -1 1200 1.0037229955196381e-01 + + 4.2507208883762360e-02 -4.3366080522537231e-01 + <_> + 157 + -1.5512030124664307e+00 + + <_> + + 0 -1 1201 -2.8922120109200478e-03 + + 1.4381329715251923e-01 -4.0896520018577576e-01 + <_> + + 0 -1 1202 -3.2057950738817453e-03 + + -3.3472418785095215e-01 1.2834690511226654e-01 + <_> + + 0 -1 1203 -1.4795559764024802e-05 + + 1.0139170289039612e-01 -4.4680911302566528e-01 + <_> + + 0 -1 1204 3.7529919063672423e-04 + + -2.8604930639266968e-01 1.5357840061187744e-01 + <_> + + 0 -1 1205 4.9170467536896467e-04 + + -2.8404960036277771e-01 1.3163900375366211e-01 + <_> + + 0 -1 1206 1.6417380422353745e-02 + + 7.9901106655597687e-02 -2.8092819452285767e-01 + <_> + + 0 -1 1207 1.0119860060513020e-02 + + 1.0026869922876358e-01 -4.0932568907737732e-01 + <_> + + 0 -1 1208 -6.5251751802861691e-03 + + -3.3101710677146912e-01 9.6044629812240601e-02 + <_> + + 0 -1 1209 6.1215078458189964e-03 + + -3.5483101010322571e-01 8.4309920668601990e-02 + <_> + + 0 -1 1210 2.5817379355430603e-03 + + 8.3384357392787933e-02 -2.8031709790229797e-01 + <_> + + 0 -1 1211 -1.3406439684331417e-03 + + 1.5083800256252289e-01 -1.4946520328521729e-01 + <_> + + 0 -1 1212 3.3681320492178202e-03 + + 4.2112700641155243e-02 -2.2309710085391998e-01 + <_> + + 0 -1 1213 2.8937528841197491e-03 + + 8.2953810691833496e-02 -2.9152309894561768e-01 + <_> + + 0 -1 1214 3.3696501050144434e-03 + + 4.8548549413681030e-02 -1.9542780518531799e-01 + <_> + + 0 -1 1215 -7.1538880467414856e-02 + + 5.2008682489395142e-01 -4.2644441127777100e-02 + <_> + + 0 -1 1216 7.6072360388934612e-03 + + -8.5208661854267120e-02 1.1523310095071793e-01 + <_> + + 0 -1 1217 1.9313229713588953e-03 + + 8.9357398450374603e-02 -2.3614349961280823e-01 + <_> + + 0 -1 1218 9.0475968318060040e-04 + + -7.7408589422702789e-02 1.6829580068588257e-01 + <_> + + 0 -1 1219 1.1103670112788677e-02 + + -9.5963977277278900e-02 2.0391720533370972e-01 + <_> + + 0 -1 1220 -3.1021970789879560e-03 + + -3.8605719804763794e-01 4.6329721808433533e-02 + <_> + + 0 -1 1221 1.1446890421211720e-03 + + -2.8306689858436584e-01 5.8978211134672165e-02 + <_> + + 0 -1 1222 7.7077788300812244e-03 + + 1.0474249720573425e-01 -1.7146070301532745e-01 + <_> + + 0 -1 1223 4.9893710762262344e-02 + + -6.4692601561546326e-02 3.0140951275825500e-01 + <_> + + 0 -1 1224 -1.4937819913029671e-02 + + -2.7854371070861816e-01 7.0895470678806305e-02 + <_> + + 0 -1 1225 -2.5303829461336136e-03 + + 1.2108519673347473e-01 -1.4635290205478668e-01 + <_> + + 0 -1 1226 2.8611259534955025e-02 + + -5.0357531756162643e-02 4.0651878714561462e-01 + <_> + + 0 -1 1227 3.6244060844182968e-02 + + 4.4577218592166901e-02 -5.6234288215637207e-01 + <_> + + 0 -1 1228 -3.0544339679181576e-03 + + 1.1526989936828613e-01 -2.7371090650558472e-01 + <_> + + 0 -1 1229 -1.3101019430905581e-03 + + -2.6798000931739807e-01 5.9726651757955551e-02 + <_> + + 0 -1 1230 1.0702989529818296e-03 + + -1.5439410507678986e-01 1.1206989735364914e-01 + <_> + + 0 -1 1231 -2.3467160761356354e-02 + + -6.2424921989440918e-01 2.6010479778051376e-02 + <_> + + 0 -1 1232 -2.2787749767303467e-02 + + 1.7903989553451538e-01 -6.8230852484703064e-02 + <_> + + 0 -1 1233 7.5017688795924187e-03 + + 5.2637178450822830e-02 -3.3333471417427063e-01 + <_> + + 0 -1 1234 1.3881090097129345e-02 + + 6.5118886530399323e-02 -2.4152719974517822e-01 + <_> + + 0 -1 1235 -8.7769115343689919e-03 + + 1.9925190508365631e-01 -8.8063232600688934e-02 + <_> + + 0 -1 1236 2.6523560285568237e-02 + + 4.6574778854846954e-02 -3.6550509929656982e-01 + <_> + + 0 -1 1237 7.2263809852302074e-03 + + -1.0806850343942642e-01 1.5131799876689911e-01 + <_> + + 0 -1 1238 2.3426050320267677e-03 + + -1.5072929859161377e-01 9.9945023655891418e-02 + <_> + + 0 -1 1239 -2.8811080483137630e-05 + + 6.1413038522005081e-02 -2.4344439804553986e-01 + <_> + + 0 -1 1240 -1.3911900110542774e-02 + + -3.1010839343070984e-01 2.4895850569009781e-02 + <_> + + 0 -1 1241 2.4768780916929245e-02 + + 2.3218030110001564e-02 -6.5071028470993042e-01 + <_> + + 0 -1 1242 -6.0916407965123653e-03 + + 5.9768490493297577e-02 -2.5360348820686340e-01 + <_> + + 0 -1 1243 -9.7264908254146576e-03 + + -2.5584441423416138e-01 5.5554620921611786e-02 + <_> + + 0 -1 1244 9.7499042749404907e-02 + + 5.3867488168179989e-03 -7.3567670583724976e-01 + <_> + + 0 -1 1245 3.0411418993026018e-03 + + -1.3759210705757141e-01 1.2143649905920029e-01 + <_> + + 0 -1 1246 2.7967148926109076e-03 + + 1.8048660457134247e-01 -8.4527000784873962e-02 + <_> + + 0 -1 1247 1.0707279667258263e-02 + + -4.3970860540866852e-02 3.1042009592056274e-01 + <_> + + 0 -1 1248 1.7561139538884163e-03 + + 5.1866840571165085e-02 -2.2768710553646088e-01 + <_> + + 0 -1 1249 -3.0384738929569721e-03 + + 7.1652042865753174e-01 -2.2465929388999939e-02 + <_> + + 0 -1 1250 -9.4161480665206909e-02 + + -7.9338562488555908e-01 1.3117490336298943e-02 + <_> + + 0 -1 1251 -2.3869009688496590e-02 + + 4.9338179826736450e-01 -3.2169021666049957e-02 + <_> + + 0 -1 1252 -3.9958588778972626e-02 + + -1.8914769589900970e-01 2.8500700369477272e-02 + <_> + + 0 -1 1253 6.9391070865094662e-03 + + 3.9777211844921112e-02 -3.9105901122093201e-01 + <_> + + 0 -1 1254 -3.3596780151128769e-02 + + -5.6830072402954102e-01 2.1618509665131569e-02 + <_> + + 0 -1 1255 -1.4079840481281281e-01 + + -7.9014372825622559e-01 1.4884609729051590e-02 + <_> + + 0 -1 1256 -5.7346289977431297e-03 + + -1.5512639284133911e-01 4.2879570275545120e-02 + <_> + + 0 -1 1257 -5.2841830998659134e-02 + + 3.0823838710784912e-01 -5.0709690898656845e-02 + <_> + + 0 -1 1258 1.5207099728286266e-02 + + -2.5789769366383553e-02 3.3292320370674133e-01 + <_> + + 0 -1 1259 -5.8392022037878633e-04 + + 8.8900387287139893e-02 -1.6297949850559235e-01 + <_> + + 0 -1 1260 -3.3715530298650265e-03 + + -1.7890229821205139e-01 7.5376607477664948e-02 + <_> + + 0 -1 1261 -1.2047060299664736e-03 + + 1.0491970181465149e-01 -1.2970739603042603e-01 + <_> + + 0 -1 1262 5.5276479572057724e-02 + + -4.3197508901357651e-02 3.7212029099464417e-01 + <_> + + 0 -1 1263 3.9330609142780304e-02 + + 3.0416399240493774e-02 -4.9076101183891296e-01 + <_> + + 0 -1 1264 -9.7229599487036467e-04 + + -2.1895459294319153e-01 3.9032708853483200e-02 + <_> + + 0 -1 1265 -5.6048069149255753e-02 + + 4.1632568836212158e-01 -3.3747311681509018e-02 + <_> + + 0 -1 1266 7.1376740932464600e-02 + + 1.2129209935665131e-02 -6.4814078807830811e-01 + <_> + + 0 -1 1267 1.4940260443836451e-03 + + -2.1393610537052155e-01 8.4887221455574036e-02 + <_> + + 0 -1 1268 -3.2299170270562172e-03 + + 9.0792432427406311e-02 -9.5816053450107574e-02 + <_> + + 0 -1 1269 4.2182870209217072e-02 + + -6.6914401948451996e-02 2.5217619538307190e-01 + <_> + + 0 -1 1270 -6.5001910552382469e-03 + + -1.2149559706449509e-01 3.7367988377809525e-02 + <_> + + 0 -1 1271 1.9457129761576653e-02 + + 5.0163779407739639e-02 -2.8700378537178040e-01 + <_> + + 0 -1 1272 3.7291388958692551e-02 + + 2.9608439654111862e-02 -5.7222497463226318e-01 + <_> + + 0 -1 1273 -2.5571519508957863e-02 + + 4.3941849470138550e-01 -3.6532308906316757e-02 + <_> + + 0 -1 1274 -7.9122912138700485e-03 + + -2.9618510603904724e-01 3.5483270883560181e-02 + <_> + + 0 -1 1275 3.0267490074038506e-03 + + -1.2113779783248901e-01 1.1271420121192932e-01 + <_> + + 0 -1 1276 -2.1035820245742798e-02 + + 2.9206061363220215e-01 -3.1001489609479904e-02 + <_> + + 0 -1 1277 -1.2911420315504074e-02 + + -5.4194331169128418e-01 2.6756240054965019e-02 + <_> + + 0 -1 1278 5.5096071213483810e-02 + + 8.4169982001185417e-03 -6.2873458862304688e-01 + <_> + + 0 -1 1279 -6.3893562182784081e-03 + + -2.0784839987754822e-01 6.0436788946390152e-02 + <_> + + 0 -1 1280 1.0858760215342045e-02 + + -7.8497253358364105e-02 1.2957990169525146e-01 + <_> + + 0 -1 1281 -1.5859620645642281e-02 + + 1.5772910416126251e-01 -1.0143510252237320e-01 + <_> + + 0 -1 1282 1.5203879773616791e-01 + + 2.1721320226788521e-02 -3.1713140010833740e-01 + <_> + + 0 -1 1283 1.7942039296030998e-02 + + -8.4816932678222656e-02 1.7697300016880035e-01 + <_> + + 0 -1 1284 8.8212518021464348e-03 + + 5.1800601184368134e-02 -2.1443609893321991e-01 + <_> + + 0 -1 1285 1.5715289860963821e-02 + + 4.2525820434093475e-02 -3.2278341054916382e-01 + <_> + + 0 -1 1286 -2.4744209367781878e-03 + + 1.0828550159931183e-01 -1.2953069806098938e-01 + <_> + + 0 -1 1287 1.2597530148923397e-02 + + -6.0251701623201370e-02 2.7512151002883911e-01 + <_> + + 0 -1 1288 -1.0955630568787456e-03 + + -5.4244071245193481e-01 2.8166439384222031e-02 + <_> + + 0 -1 1289 -1.4035019557923079e-03 + + -2.3625169694423676e-01 6.1887249350547791e-02 + <_> + + 0 -1 1290 -7.7294543385505676e-02 + + -5.2141982316970825e-01 1.1844149790704250e-02 + <_> + + 0 -1 1291 -7.5442157685756683e-02 + + -7.1588802337646484e-01 1.7151419073343277e-02 + <_> + + 0 -1 1292 -6.5148338675498962e-02 + + 2.4099840223789215e-01 -5.0278738141059875e-02 + <_> + + 0 -1 1293 -1.0481229983270168e-03 + + 6.5461628139019012e-02 -1.9198420643806458e-01 + <_> + + 0 -1 1294 2.0919230300933123e-03 + + 4.8702161759138107e-02 -2.0062549412250519e-01 + <_> + + 0 -1 1295 -4.2849369347095490e-02 + + -4.6154209971427917e-01 2.9137039557099342e-02 + <_> + + 0 -1 1296 -4.5563629828393459e-03 + + 1.3732179999351501e-01 -7.3871016502380371e-02 + <_> + + 0 -1 1297 6.7648440599441528e-03 + + -6.3866026699542999e-02 2.7578699588775635e-01 + <_> + + 0 -1 1298 4.2252071201801300e-02 + + 1.3583010062575340e-02 -6.2714421749114990e-01 + <_> + + 0 -1 1299 -3.5438220947980881e-02 + + -5.2436131238937378e-01 2.1047530695796013e-02 + <_> + + 0 -1 1300 -5.3693209774792194e-03 + + 1.8366709351539612e-01 -6.6432453691959381e-02 + <_> + + 0 -1 1301 1.3521539513021708e-03 + + 5.8834321796894073e-02 -2.2455100715160370e-01 + <_> + + 0 -1 1302 -3.2204028218984604e-02 + + -4.8017048835754395e-01 9.2976661399006844e-03 + <_> + + 0 -1 1303 4.0550291305407882e-04 + + -8.5948407649993896e-02 2.0100370049476624e-01 + <_> + + 0 -1 1304 -3.8419410120695829e-03 + + 2.0595569908618927e-01 -6.6863708198070526e-02 + <_> + + 0 -1 1305 -4.5518199913203716e-03 + + -2.2908920049667358e-01 5.8954399079084396e-02 + <_> + + 0 -1 1306 -4.9340371042490005e-02 + + -3.8995718955993652e-01 1.6714079305529594e-02 + <_> + + 0 -1 1307 8.6456492543220520e-02 + + -3.2278828322887421e-02 3.6371639370918274e-01 + <_> + + 0 -1 1308 5.1636258140206337e-03 + + -1.7399039864540100e-01 5.6017149239778519e-02 + <_> + + 0 -1 1309 3.5364869982004166e-03 + + -7.9630948603153229e-02 1.6313460469245911e-01 + <_> + + 0 -1 1310 -4.3170839548110962e-02 + + -3.7036859989166260e-01 1.9841130822896957e-02 + <_> + + 0 -1 1311 6.1772209592163563e-03 + + 5.9052169322967529e-02 -2.3701970279216766e-01 + <_> + + 0 -1 1312 -2.2244770079851151e-02 + + 2.5762718915939331e-01 -2.2968450561165810e-02 + <_> + + 0 -1 1313 5.0163730978965759e-02 + + 1.7468400299549103e-02 -6.8128740787506104e-01 + <_> + + 0 -1 1314 -3.0043811420910060e-04 + + 5.5781401693820953e-02 -1.2685780227184296e-01 + <_> + + 0 -1 1315 1.9783550500869751e-01 + + 1.2211419641971588e-02 -8.6064267158508301e-01 + <_> + + 0 -1 1316 6.5362468361854553e-02 + + 4.1287927888333797e-03 -6.2948238849639893e-01 + <_> + + 0 -1 1317 -1.8684990704059601e-02 + + -2.4377359449863434e-01 4.3232489377260208e-02 + <_> + + 0 -1 1318 -7.5593511573970318e-03 + + 1.7254440486431122e-01 -1.6871780157089233e-02 + <_> + + 0 -1 1319 1.4699660241603851e-03 + + -1.5561489760875702e-01 6.9231852889060974e-02 + <_> + + 0 -1 1320 1.1925940215587616e-01 + + -2.6341190561652184e-02 4.4847229123115540e-01 + <_> + + 0 -1 1321 1.3763479888439178e-02 + + 3.1852710992097855e-02 -3.8184550404548645e-01 + <_> + + 0 -1 1322 1.2966440059244633e-02 + + -3.9391368627548218e-02 1.9092699885368347e-01 + <_> + + 0 -1 1323 -1.1041419580578804e-02 + + -2.7309378981590271e-01 4.7777820378541946e-02 + <_> + + 0 -1 1324 6.8364411592483521e-01 + + 9.6240043640136719e-03 -9.7447502613067627e-01 + <_> + + 0 -1 1325 -2.4255160242319107e-03 + + -2.5439569354057312e-01 4.0732551366090775e-02 + <_> + + 0 -1 1326 6.4529682276770473e-04 + + -1.3824179768562317e-01 7.4660047888755798e-02 + <_> + + 0 -1 1327 -2.2386180236935616e-02 + + 3.9404779672622681e-01 -4.2591951787471771e-02 + <_> + + 0 -1 1328 -6.4325161278247833e-02 + + -9.6853357553482056e-01 5.4289568215608597e-03 + <_> + + 0 -1 1329 4.0803711861371994e-02 + + 1.4779980294406414e-02 -7.5445967912673950e-01 + <_> + + 0 -1 1330 -2.4066439364105463e-03 + + 7.6213918626308441e-02 -8.1325337290763855e-02 + <_> + + 0 -1 1331 -4.9865059554576874e-02 + + -7.8447979688644409e-01 1.5130150131881237e-02 + <_> + + 0 -1 1332 -8.9749991893768311e-02 + + -9.0076518058776855e-01 4.0898341685533524e-03 + <_> + + 0 -1 1333 2.1489290520548820e-03 + + -7.7873408794403076e-02 1.4538989961147308e-01 + <_> + + 0 -1 1334 1.8653910374268889e-03 + + -5.1264639943838120e-02 1.4514209330081940e-01 + <_> + + 0 -1 1335 5.4189950227737427e-02 + + 1.6740569844841957e-02 -7.2964847087860107e-01 + <_> + + 0 -1 1336 -3.7668810691684484e-03 + + 1.5345999598503113e-01 -5.9867210686206818e-02 + <_> + + 0 -1 1337 -1.5151940286159515e-01 + + -8.2612198591232300e-01 1.4488279819488525e-02 + <_> + + 0 -1 1338 1.0246659629046917e-02 + + -6.3145689666271210e-02 1.8994790315628052e-01 + <_> + + 0 -1 1339 1.0578270070254803e-02 + + 5.9726748615503311e-02 -1.9162079691886902e-01 + <_> + + 0 -1 1340 1.5032970346510410e-02 + + -7.3868520557880402e-02 1.5511709451675415e-01 + <_> + + 0 -1 1341 -4.2136289179325104e-02 + + -6.8733322620391846e-01 1.6604630276560783e-02 + <_> + + 0 -1 1342 1.8628799589350820e-03 + + -1.5732850134372711e-01 7.5714908540248871e-02 + <_> + + 0 -1 1343 2.4659639224410057e-02 + + 9.7081139683723450e-02 -1.6045799851417542e-01 + <_> + + 0 -1 1344 1.9145730137825012e-01 + + 7.1056559681892395e-03 -7.5537341833114624e-01 + <_> + + 0 -1 1345 -3.0167160555720329e-02 + + 1.7002609372138977e-01 -8.6163826286792755e-02 + <_> + + 0 -1 1346 9.2923697084188461e-03 + + 4.3352611362934113e-02 -1.9533480703830719e-01 + <_> + + 0 -1 1347 -1.9069829722866416e-03 + + 8.2421518862247467e-02 -1.4644089341163635e-01 + <_> + + 0 -1 1348 3.1027841032482684e-04 + + -1.1879319697618484e-01 9.4635762274265289e-02 + <_> + + 0 -1 1349 4.4492271263152361e-04 + + -1.5645760297775269e-01 6.8512812256813049e-02 + <_> + + 0 -1 1350 -1.2095469981431961e-02 + + -9.0144127607345581e-02 3.0050620436668396e-02 + <_> + + 0 -1 1351 -2.0358909387141466e-03 + + 1.3586470484733582e-01 -7.2631262242794037e-02 + <_> + + 0 -1 1352 -9.3594277277588844e-03 + + 1.1376120150089264e-01 -3.9632719010114670e-02 + <_> + + 0 -1 1353 4.2418478988111019e-03 + + -8.1519439816474915e-02 1.5766209363937378e-01 + <_> + + 0 -1 1354 -5.9963759034872055e-02 + + -2.3273150622844696e-01 2.0836880430579185e-02 + <_> + + 0 -1 1355 4.6651167795062065e-03 + + 1.3135330379009247e-01 -1.2394910305738449e-01 + <_> + + 0 -1 1356 6.2358117429539561e-04 + + -1.2920179963111877e-01 6.5220557153224945e-02 + <_> + + 0 -1 1357 2.0561330020427704e-03 + + -6.2910877168178558e-02 1.6288000345230103e-01 + <_> + 127 + -1.7598799467086792e+00 + + <_> + + 0 -1 1358 1.1216440051794052e-01 + + -2.9065090417861938e-01 3.1510210037231445e-01 + <_> + + 0 -1 1359 2.7850609272718430e-02 + + -3.9972350001335144e-01 1.7894990742206573e-01 + <_> + + 0 -1 1360 4.0804240852594376e-02 + + -2.4171060323715210e-01 2.2376739978790283e-01 + <_> + + 0 -1 1361 1.3134710025042295e-03 + + -4.2230761051177979e-01 6.9066837430000305e-02 + <_> + + 0 -1 1362 3.9736120961606503e-03 + + -5.5243992805480957e-01 1.0362079739570618e-01 + <_> + + 0 -1 1363 -9.7877913503907621e-05 + + 7.0300459861755371e-02 -4.1970318555831909e-01 + <_> + + 0 -1 1364 6.2921550124883652e-03 + + -3.0629968643188477e-01 1.3072040677070618e-01 + <_> + + 0 -1 1365 -8.7216142565011978e-03 + + -4.1267630457878113e-01 7.2738148272037506e-02 + <_> + + 0 -1 1366 -5.8611109852790833e-02 + + 1.9491520524024963e-01 -1.9737449288368225e-01 + <_> + + 0 -1 1367 -4.6104468405246735e-02 + + -2.6274758577346802e-01 2.4362189695239067e-02 + <_> + + 0 -1 1368 -5.2685278933495283e-04 + + 7.9876311123371124e-02 -4.4358581304550171e-01 + <_> + + 0 -1 1369 -2.5521939620375633e-02 + + -4.4183689355850220e-01 1.0705660097301006e-02 + <_> + + 0 -1 1370 -6.8350387737154961e-03 + + -3.9501190185546875e-01 7.8441992402076721e-02 + <_> + + 0 -1 1371 6.1055209487676620e-02 + + 3.5330320242792368e-03 -6.0677450895309448e-01 + <_> + + 0 -1 1372 4.7110877931118011e-03 + + -1.9310380518436432e-01 1.5259410440921783e-01 + <_> + + 0 -1 1373 3.7552498281002045e-02 + + 6.9572687149047852e-02 -4.1588190197944641e-01 + <_> + + 0 -1 1374 4.0887430310249329e-02 + + -1.3596929609775543e-01 2.4894300103187561e-01 + <_> + + 0 -1 1375 2.6306639483664185e-05 + + -2.5603210926055908e-01 1.1001589894294739e-01 + <_> + + 0 -1 1376 9.4716809689998627e-03 + + -2.2197020053863525e-01 1.3640490174293518e-01 + <_> + + 0 -1 1377 3.4596489276736975e-03 + + 1.5568970143795013e-01 -1.8454350531101227e-01 + <_> + + 0 -1 1378 -8.1670414656400681e-03 + + -3.7346610426902771e-01 8.2206420600414276e-02 + <_> + + 0 -1 1379 4.7045178711414337e-02 + + 1.2655580416321754e-02 -6.9167500734329224e-01 + <_> + + 0 -1 1380 -1.9954189192503691e-03 + + -4.2871651053428650e-01 6.0119848698377609e-02 + <_> + + 0 -1 1381 -3.2797679305076599e-02 + + -5.8513718843460083e-01 3.9739210158586502e-02 + <_> + + 0 -1 1382 4.3516121804714203e-02 + + 3.6311239004135132e-02 -5.8556967973709106e-01 + <_> + + 0 -1 1383 -1.3213600032031536e-02 + + 2.1160380542278290e-01 -8.9618362486362457e-02 + <_> + + 0 -1 1384 -3.8574080914258957e-02 + + -5.9375947713851929e-01 3.7297870963811874e-02 + <_> + + 0 -1 1385 -1.5351839363574982e-01 + + 4.4116440415382385e-01 -5.9058368206024170e-02 + <_> + + 0 -1 1386 -1.4133240096271038e-02 + + -3.4045210480690002e-01 6.6277496516704559e-02 + <_> + + 0 -1 1387 1.4061010442674160e-02 + + 1.1312460154294968e-01 -1.9001239538192749e-01 + <_> + + 0 -1 1388 3.5457469522953033e-02 + + 3.7297818809747696e-02 -5.3568178415298462e-01 + <_> + + 0 -1 1389 -1.2931039556860924e-02 + + -2.8593328595161438e-01 5.8341801166534424e-02 + <_> + + 0 -1 1390 -1.1986999772489071e-02 + + -4.0216270089149475e-01 4.7841191291809082e-02 + <_> + + 0 -1 1391 -1.3723289594054222e-02 + + 2.0238439738750458e-01 -8.9290492236614227e-02 + <_> + + 0 -1 1392 1.5990810468792915e-02 + + -6.1742551624774933e-02 3.9387008547782898e-01 + <_> + + 0 -1 1393 -1.4505759812891483e-02 + + -3.5829049348831177e-01 4.3789908289909363e-02 + <_> + + 0 -1 1394 3.1443528831005096e-02 + + -6.7374527454376221e-02 2.8779721260070801e-01 + <_> + + 0 -1 1395 3.4287340939044952e-02 + + 5.6390259414911270e-02 -3.3407160639762878e-01 + <_> + + 0 -1 1396 8.8674569269642234e-05 + + -2.8655600547790527e-01 7.0318557322025299e-02 + <_> + + 0 -1 1397 1.8266469240188599e-02 + + -5.2221570163965225e-02 1.7026390135288239e-01 + <_> + + 0 -1 1398 6.1769630759954453e-02 + + -6.8800583481788635e-02 2.7483311295509338e-01 + <_> + + 0 -1 1399 -2.3383310064673424e-02 + + -2.7845630049705505e-01 2.4131359532475471e-02 + <_> + + 0 -1 1400 -1.1182860285043716e-01 + + 4.5687168836593628e-01 -4.3217949569225311e-02 + <_> + + 0 -1 1401 -6.4386896789073944e-02 + + -3.4228751063346863e-01 6.4063712954521179e-02 + <_> + + 0 -1 1402 2.1763430535793304e-01 + + -6.0564499348402023e-02 3.6352708935737610e-01 + <_> + + 0 -1 1403 -4.9456087872385979e-03 + + -1.6526390612125397e-01 4.6035580337047577e-02 + <_> + + 0 -1 1404 -1.2704910477623343e-03 + + -2.5035798549652100e-01 8.2336440682411194e-02 + <_> + + 0 -1 1405 2.6536729186773300e-02 + + -1.3919049501419067e-01 1.9524000585079193e-01 + <_> + + 0 -1 1406 -2.0027440041303635e-02 + + -3.7472829222679138e-01 5.3981021046638489e-02 + <_> + + 0 -1 1407 -6.1987549066543579e-02 + + -1.4436429738998413e-01 1.5863290056586266e-02 + <_> + + 0 -1 1408 2.3037059232592583e-02 + + 3.8429230451583862e-02 -4.8479309678077698e-01 + <_> + + 0 -1 1409 5.7958271354436874e-02 + + 2.0750140771269798e-02 -7.6776617765426636e-01 + <_> + + 0 -1 1410 5.4419268853962421e-03 + + 7.2074413299560547e-02 -2.4254220724105835e-01 + <_> + + 0 -1 1411 7.2400430217385292e-03 + + -8.2432948052883148e-02 1.8463499844074249e-01 + <_> + + 0 -1 1412 1.4847779646515846e-02 + + 5.6245408952236176e-02 -3.6297059059143066e-01 + <_> + + 0 -1 1413 1.2084879912436008e-02 + + -6.3536256551742554e-02 2.8614228963851929e-01 + <_> + + 0 -1 1414 8.0831356346607208e-02 + + 4.7143958508968353e-02 -4.9968090653419495e-01 + <_> + + 0 -1 1415 1.9218639936298132e-03 + + -4.0469148755073547e-01 2.2093040868639946e-02 + <_> + + 0 -1 1416 -1.4179679565131664e-02 + + -1.8520280718803406e-01 8.6823917925357819e-02 + <_> + + 0 -1 1417 -2.9600440029753372e-05 + + 7.4054829776287079e-02 -1.9331359863281250e-01 + <_> + + 0 -1 1418 1.7121590208262205e-03 + + -4.9954649806022644e-01 3.8273740559816360e-02 + <_> + + 0 -1 1419 -1.3207949697971344e-01 + + 5.2964788675308228e-01 -1.0363499633967876e-02 + <_> + + 0 -1 1420 3.6922071129083633e-02 + + 1.9587470218539238e-02 -8.8954067230224609e-01 + <_> + + 0 -1 1421 -7.3079409048659727e-06 + + 6.4993053674697876e-02 -1.7331290245056152e-01 + <_> + + 0 -1 1422 -3.5222709178924561e-02 + + -3.6849930882453918e-01 5.0565738230943680e-02 + <_> + + 0 -1 1423 -5.5531110614538193e-02 + + 3.1555691361427307e-01 -4.5015729963779449e-02 + <_> + + 0 -1 1424 1.8762869760394096e-02 + + -1.9359070062637329e-01 7.9093530774116516e-02 + <_> + + 0 -1 1425 2.4971760809421539e-02 + + -8.1862196326255798e-02 2.1014890074729919e-01 + <_> + + 0 -1 1426 -2.0817129407078028e-03 + + -1.7723660171031952e-01 9.1757282614707947e-02 + <_> + + 0 -1 1427 -1.1499860137701035e-01 + + 5.0862562656402588e-01 -1.8267450854182243e-02 + <_> + + 0 -1 1428 3.2068958878517151e-01 + + 2.1651009097695351e-02 -7.6685470342636108e-01 + <_> + + 0 -1 1429 -8.1451296806335449e-02 + + -4.6331760287284851e-01 2.9383579269051552e-02 + <_> + + 0 -1 1430 -1.5007940120995045e-02 + + -3.9308649301528931e-01 3.6867558956146240e-02 + <_> + + 0 -1 1431 2.3795820772647858e-02 + + -3.2482311129570007e-02 1.6764250397682190e-01 + <_> + + 0 -1 1432 -8.8508807122707367e-02 + + 7.2103458642959595e-01 -2.1140210330486298e-02 + <_> + + 0 -1 1433 4.5011121779680252e-02 + + -2.5326130911707878e-02 2.8062760829925537e-01 + <_> + + 0 -1 1434 1.9286990165710449e-02 + + 6.5771162509918213e-02 -2.5697788596153259e-01 + <_> + + 0 -1 1435 2.2137619554996490e-02 + + 3.9154991507530212e-02 -1.9145630300045013e-01 + <_> + + 0 -1 1436 2.9847979545593262e-02 + + -1.2521019577980042e-01 1.4867870509624481e-01 + <_> + + 0 -1 1437 -6.8392023444175720e-02 + + 2.6023870706558228e-01 -4.7525301575660706e-02 + <_> + + 0 -1 1438 6.8003371357917786e-02 + + -4.5898560434579849e-02 4.0107101202011108e-01 + <_> + + 0 -1 1439 5.6098159402608871e-02 + + 2.3277789354324341e-02 -8.4457129240036011e-01 + <_> + + 0 -1 1440 -1.3024089857935905e-02 + + -3.8348990678787231e-01 3.8314189761877060e-02 + <_> + + 0 -1 1441 1.2594680301845074e-02 + + -6.7616842687129974e-02 2.9852440953254700e-01 + <_> + + 0 -1 1442 -4.9063879996538162e-02 + + -5.5862659215927124e-01 2.8511619195342064e-02 + <_> + + 0 -1 1443 -1.5734169632196426e-02 + + 2.5611931085586548e-01 -5.9407141059637070e-02 + <_> + + 0 -1 1444 1.4674849808216095e-02 + + -6.3001021742820740e-02 2.7854999899864197e-01 + <_> + + 0 -1 1445 2.5068029761314392e-02 + + -7.8861348330974579e-02 1.0577370226383209e-01 + <_> + + 0 -1 1446 7.4170758016407490e-03 + + -3.5775899887084961e-01 4.8707701265811920e-02 + <_> + + 0 -1 1447 -7.7149281278252602e-03 + + -1.8049560487270355e-01 9.7531601786613464e-02 + <_> + + 0 -1 1448 4.9982070922851562e-02 + + 2.1009320393204689e-02 -7.6537537574768066e-01 + <_> + + 0 -1 1449 -1.6759630292654037e-02 + + -5.9045380353927612e-01 2.6948049664497375e-02 + <_> + + 0 -1 1450 3.7632828950881958e-01 + + 2.1989850327372551e-02 -6.1461311578750610e-01 + <_> + + 0 -1 1451 5.2720829844474792e-02 + + -3.9074160158634186e-02 2.6600670814514160e-01 + <_> + + 0 -1 1452 2.6270199567079544e-02 + + -9.3863986432552338e-02 2.2280269861221313e-01 + <_> + + 0 -1 1453 -2.5664661079645157e-03 + + -1.8621809780597687e-01 9.8519712686538696e-02 + <_> + + 0 -1 1454 5.3800269961357117e-03 + + 1.2816059589385986e-01 -1.3671700656414032e-01 + <_> + + 0 -1 1455 2.5200050324201584e-02 + + 3.0875589698553085e-02 -2.9681420326232910e-01 + <_> + + 0 -1 1456 2.5444060564041138e-02 + + 4.3978411704301834e-02 -4.0505328774452209e-01 + <_> + + 0 -1 1457 -2.4715809151530266e-02 + + -5.8492290973663330e-01 2.3179760202765465e-02 + <_> + + 0 -1 1458 -1.6159649938344955e-02 + + -3.1950500607490540e-01 4.4603530317544937e-02 + <_> + + 0 -1 1459 6.5401610918343067e-03 + + -5.8575991541147232e-02 7.4016787111759186e-02 + <_> + + 0 -1 1460 -4.3940648436546326e-02 + + -7.7211838960647583e-01 1.9352979958057404e-02 + <_> + + 0 -1 1461 -4.5612620306201279e-04 + + 3.0397420749068260e-02 -2.6982998847961426e-01 + <_> + + 0 -1 1462 2.8633379843086004e-03 + + -1.6874340176582336e-01 8.8886268436908722e-02 + <_> + + 0 -1 1463 -5.9488460421562195e-02 + + -3.4058949351310730e-01 2.4625880643725395e-02 + <_> + + 0 -1 1464 3.0714470893144608e-02 + + 3.1796399503946304e-02 -4.1572770476341248e-01 + <_> + + 0 -1 1465 -2.2330379113554955e-02 + + 1.2896050512790680e-01 -2.4232570081949234e-02 + <_> + + 0 -1 1466 2.3971609771251678e-02 + + -7.6858058571815491e-02 2.0360720157623291e-01 + <_> + + 0 -1 1467 -6.0696780681610107e-02 + + -7.2060132026672363e-01 1.1617880314588547e-02 + <_> + + 0 -1 1468 -6.8362243473529816e-02 + + 3.5825181007385254e-01 -4.4807899743318558e-02 + <_> + + 0 -1 1469 1.3451039791107178e-01 + + 2.6008069515228271e-02 -2.5077620148658752e-01 + <_> + + 0 -1 1470 1.3341170549392700e-01 + + 4.7138180583715439e-02 -3.9661580324172974e-01 + <_> + + 0 -1 1471 2.0524330437183380e-02 + + 4.3894171714782715e-02 -2.8501969575881958e-01 + <_> + + 0 -1 1472 4.1543610394001007e-02 + + 2.5452220812439919e-02 -5.9377658367156982e-01 + <_> + + 0 -1 1473 -7.1573443710803986e-02 + + -7.8743761777877808e-01 1.3979320414364338e-02 + <_> + + 0 -1 1474 6.6264629364013672e-02 + + 2.2939130663871765e-02 -5.4304981231689453e-01 + <_> + + 0 -1 1475 4.4609569013118744e-03 + + 5.0688140094280243e-02 -2.0599000155925751e-01 + <_> + + 0 -1 1476 1.4859540387988091e-02 + + -7.3408462107181549e-02 1.9902250170707703e-01 + <_> + + 0 -1 1477 -3.9625339210033417e-02 + + -5.3522932529449463e-01 9.3211038038134575e-03 + <_> + + 0 -1 1478 -9.6143726259469986e-03 + + 2.7664861083030701e-01 -6.3087522983551025e-02 + <_> + + 0 -1 1479 5.4589830338954926e-02 + + 2.4962859228253365e-02 -5.8171188831329346e-01 + <_> + + 0 -1 1480 1.3770899735391140e-02 + + -2.2891749441623688e-01 6.9963671267032623e-02 + <_> + + 0 -1 1481 8.6862340569496155e-02 + + 2.4058010429143906e-02 -5.8642482757568359e-01 + <_> + + 0 -1 1482 -2.2433010861277580e-02 + + -9.2169362306594849e-01 1.3281799852848053e-02 + <_> + + 0 -1 1483 -7.3779597878456116e-02 + + 3.8463789224624634e-01 -8.5962712764739990e-03 + <_> + + 0 -1 1484 2.9300490859895945e-04 + + -1.7170579731464386e-01 8.8520109653472900e-02 + <_> + 178 + -1.5360039472579956e+00 + + <_> + + 0 -1 1485 5.3288340568542480e-03 + + -2.6616770029067993e-01 1.7760449647903442e-01 + <_> + + 0 -1 1486 -4.0987450629472733e-03 + + 1.2358420342206955e-01 -3.0805110931396484e-01 + <_> + + 0 -1 1487 -5.5853058584034443e-03 + + -5.0533992052078247e-01 6.2050119042396545e-02 + <_> + + 0 -1 1488 -5.1797390915453434e-04 + + 6.9178067147731781e-02 -3.4831359982490540e-01 + <_> + + 0 -1 1489 5.3605018183588982e-03 + + 6.5158672630786896e-02 -4.6262231469154358e-01 + <_> + + 0 -1 1490 3.0114270746707916e-02 + + -6.4132362604141235e-02 7.1070060133934021e-02 + <_> + + 0 -1 1491 8.9014291763305664e-02 + + 4.2987130582332611e-02 -6.0177898406982422e-01 + <_> + + 0 -1 1492 1.5248140553012490e-03 + + -3.3071789145469666e-01 7.1408301591873169e-02 + <_> + + 0 -1 1493 1.8556410213932395e-03 + + -3.4727120399475098e-01 7.0630677044391632e-02 + <_> + + 0 -1 1494 -1.6151620075106621e-02 + + -2.5611770153045654e-01 7.1255698800086975e-02 + <_> + + 0 -1 1495 -3.1278008827939630e-04 + + 7.3420330882072449e-02 -2.9594621062278748e-01 + <_> + + 0 -1 1496 -6.0263078921707347e-05 + + 6.6566191613674164e-02 -2.1802450716495514e-01 + <_> + + 0 -1 1497 7.6520902803167701e-04 + + 7.5537197291851044e-02 -3.7677881121635437e-01 + <_> + + 0 -1 1498 -6.9589070975780487e-02 + + 3.9810648560523987e-01 -2.5841819122433662e-02 + <_> + + 0 -1 1499 -9.8529577255249023e-02 + + 6.7321968078613281e-01 -3.3925469964742661e-02 + <_> + + 0 -1 1500 4.9950059503316879e-02 + + 6.1660569161176682e-02 -3.7851110100746155e-01 + <_> + + 0 -1 1501 3.9009240572340786e-04 + + -9.6428610384464264e-02 2.1700200438499451e-01 + <_> + + 0 -1 1502 -7.1598717477172613e-04 + + -1.8358109891414642e-01 1.0587400197982788e-01 + <_> + + 0 -1 1503 3.8064830005168915e-03 + + -1.7527610063552856e-01 1.1430399864912033e-01 + <_> + + 0 -1 1504 6.5288757905364037e-03 + + 6.7994527518749237e-02 -3.0726119875907898e-01 + <_> + + 0 -1 1505 2.2182099055498838e-03 + + -2.7935230731964111e-01 5.8790720999240875e-02 + <_> + + 0 -1 1506 1.7800349451135844e-04 + + 9.9489107728004456e-02 -2.6616880297660828e-01 + <_> + + 0 -1 1507 -3.2656680792570114e-02 + + 5.8734762668609619e-01 -2.6545880362391472e-02 + <_> + + 0 -1 1508 2.6773350313305855e-02 + + 3.6414410918951035e-02 -3.7188830971717834e-01 + <_> + + 0 -1 1509 1.2780309654772282e-02 + + -8.4540523588657379e-02 1.7853260040283203e-01 + <_> + + 0 -1 1510 5.5374070070683956e-03 + + -1.0892049968242645e-01 1.4403919875621796e-01 + <_> + + 0 -1 1511 -7.1258977986872196e-03 + + 1.9850020110607147e-01 -8.3359397947788239e-02 + <_> + + 0 -1 1512 8.0109452828764915e-03 + + 4.8844348639249802e-02 -2.8590029478073120e-01 + <_> + + 0 -1 1513 -2.7231130748987198e-02 + + -6.8558162450790405e-01 2.1877769380807877e-02 + <_> + + 0 -1 1514 -2.0928949117660522e-02 + + -2.0820230245590210e-01 2.6585230603814125e-02 + <_> + + 0 -1 1515 3.9801741950213909e-03 + + 6.7004777491092682e-02 -2.3015810549259186e-01 + <_> + + 0 -1 1516 2.1598068997263908e-03 + + -9.3109019100666046e-02 1.7235539853572845e-01 + <_> + + 0 -1 1517 9.9411439150571823e-03 + + -4.4999819248914719e-02 3.1830498576164246e-01 + <_> + + 0 -1 1518 -1.7938859760761261e-02 + + -2.1515959501266479e-01 7.2462916374206543e-02 + <_> + + 0 -1 1519 -1.5030350368760992e-05 + + 9.1437973082065582e-02 -1.6706299781799316e-01 + <_> + + 0 -1 1520 4.2446260340511799e-03 + + 6.4810760319232941e-02 -1.0556270182132721e-01 + <_> + + 0 -1 1521 7.4575991675374098e-06 + + -2.6309689879417419e-01 5.6588400155305862e-02 + <_> + + 0 -1 1522 -1.0457210242748260e-02 + + 1.6078880429267883e-01 -7.2708033025264740e-02 + <_> + + 0 -1 1523 -1.2225599493831396e-03 + + 1.1558330059051514e-01 -1.2233489751815796e-01 + <_> + + 0 -1 1524 1.6061630100011826e-02 + + 2.8201790526509285e-02 -5.0996178388595581e-01 + <_> + + 0 -1 1525 -1.6162030398845673e-02 + + -3.3857521414756775e-01 3.5924781113862991e-02 + <_> + + 0 -1 1526 7.2181350551545620e-03 + + -7.2706200182437897e-02 1.0624659806489944e-01 + <_> + + 0 -1 1527 -1.0416660457849503e-02 + + 1.6205810010433197e-01 -9.4567760825157166e-02 + <_> + + 0 -1 1528 1.3946600258350372e-02 + + 5.4169639945030212e-02 -3.2068040966987610e-01 + <_> + + 0 -1 1529 1.2734119780361652e-02 + + -8.6066111922264099e-02 1.9648639857769012e-01 + <_> + + 0 -1 1530 -2.7858370915055275e-02 + + -2.8409239649772644e-01 2.6706550270318985e-02 + <_> + + 0 -1 1531 -9.8931521177291870e-02 + + 5.8457607030868530e-01 -2.1955510601401329e-02 + <_> + + 0 -1 1532 2.3434299509972334e-03 + + 9.6475467085838318e-02 -1.2095340341329575e-01 + <_> + + 0 -1 1533 -2.3025700356811285e-03 + + 7.3297969996929169e-02 -2.2309069335460663e-01 + <_> + + 0 -1 1534 3.0791079625487328e-02 + + 1.1463879607617855e-02 -2.4034079909324646e-01 + <_> + + 0 -1 1535 -8.4339501336216927e-03 + + 2.9611539840698242e-01 -4.2663689702749252e-02 + <_> + + 0 -1 1536 -3.4617669880390167e-03 + + -2.1257869899272919e-01 4.2709458619356155e-02 + <_> + + 0 -1 1537 -3.3371929079294205e-02 + + 3.5299271345138550e-01 -3.5570569336414337e-02 + <_> + + 0 -1 1538 -3.7238128483295441e-02 + + -5.9177130460739136e-01 2.6775840669870377e-02 + <_> + + 0 -1 1539 -2.0860069990158081e-01 + + -5.7595241069793701e-01 1.9763559103012085e-02 + <_> + + 0 -1 1540 -6.8279817700386047e-02 + + 3.4582608938217163e-01 -3.7861179560422897e-02 + <_> + + 0 -1 1541 1.1600320227444172e-02 + + 5.7685580104589462e-02 -2.6008209586143494e-01 + <_> + + 0 -1 1542 -6.7218959331512451e-02 + + -4.5048278570175171e-01 1.2495189905166626e-02 + <_> + + 0 -1 1543 -5.1632397808134556e-03 + + 1.6146700084209442e-01 -7.6975770294666290e-02 + <_> + + 0 -1 1544 4.0113311260938644e-02 + + 1.3131230138242245e-02 -4.5731449127197266e-01 + <_> + + 0 -1 1545 3.7837740033864975e-02 + + 2.3001920431852341e-02 -5.3636288642883301e-01 + <_> + + 0 -1 1546 2.6023429818451405e-03 + + -6.1007440090179443e-02 1.7084220051765442e-01 + <_> + + 0 -1 1547 -7.1841642260551453e-02 + + -5.8330380916595459e-01 2.0075250416994095e-02 + <_> + + 0 -1 1548 -8.2885712618008256e-04 + + 5.3465340286493301e-02 -1.9092260301113129e-01 + <_> + + 0 -1 1549 -8.1979477545246482e-04 + + -2.3775930702686310e-01 4.5844908803701401e-02 + <_> + + 0 -1 1550 1.0474859736859798e-02 + + -4.0103420615196228e-02 2.4948400259017944e-01 + <_> + + 0 -1 1551 -6.3726361840963364e-03 + + -1.7087849974632263e-01 7.2894603013992310e-02 + <_> + + 0 -1 1552 -3.6113489419221878e-02 + + -3.6879929900169373e-01 1.8331730738282204e-02 + <_> + + 0 -1 1553 5.4730800911784172e-04 + + 7.2073057293891907e-02 -1.8893779814243317e-01 + <_> + + 0 -1 1554 1.7547659575939178e-02 + + -9.4452597200870514e-02 1.3311000168323517e-01 + <_> + + 0 -1 1555 6.3078789971768856e-03 + + 7.6223470270633698e-02 -1.6668230295181274e-01 + <_> + + 0 -1 1556 2.5120719801634550e-03 + + 5.0375527143478394e-01 -2.2624349221587181e-02 + <_> + + 0 -1 1557 4.5274170115590096e-03 + + -1.3446590304374695e-01 9.9167577922344208e-02 + <_> + + 0 -1 1558 -1.4772829308640212e-04 + + 3.9675179868936539e-02 -6.0015488415956497e-02 + <_> + + 0 -1 1559 1.4728739857673645e-02 + + 3.9208918809890747e-02 -3.0560019612312317e-01 + <_> + + 0 -1 1560 -5.6161261163651943e-03 + + -1.0845050215721130e-01 4.7754660248756409e-02 + <_> + + 0 -1 1561 -9.8265614360570908e-03 + + 1.6729339957237244e-01 -7.6756693422794342e-02 + <_> + + 0 -1 1562 1.7972329631447792e-02 + + -5.9147968888282776e-02 1.2773279845714569e-01 + <_> + + 0 -1 1563 1.1233139783143997e-02 + + -9.2626020312309265e-02 1.5735739469528198e-01 + <_> + + 0 -1 1564 1.3678249670192599e-03 + + -5.6156760454177856e-01 2.1800750866532326e-02 + <_> + + 0 -1 1565 -4.1535100899636745e-03 + + -2.6951169967651367e-01 4.1213478893041611e-02 + <_> + + 0 -1 1566 -6.7194692790508270e-02 + + 5.6008362770080566e-01 -2.0973740145564079e-02 + <_> + + 0 -1 1567 -8.0572411417961121e-02 + + -7.5846642255783081e-01 1.6614310443401337e-02 + <_> + + 0 -1 1568 -9.7504993900656700e-03 + + 2.2781279683113098e-01 -4.0246330201625824e-02 + <_> + + 0 -1 1569 5.6034037843346596e-03 + + -7.5519852340221405e-02 1.6372010111808777e-01 + <_> + + 0 -1 1570 -1.0232060216367245e-02 + + -3.5803198814392090e-01 4.6331088989973068e-02 + <_> + + 0 -1 1571 2.8616760391741991e-03 + + 6.7746236920356750e-02 -1.6429120302200317e-01 + <_> + + 0 -1 1572 7.7214869670569897e-03 + + 3.4494820982217789e-02 -1.7762580513954163e-01 + <_> + + 0 -1 1573 -7.0147789083421230e-03 + + 1.7282240092754364e-01 -6.5176323056221008e-02 + <_> + + 0 -1 1574 5.0470869988203049e-02 + + -2.7071960270404816e-02 3.5509440302848816e-01 + <_> + + 0 -1 1575 -5.7124681770801544e-03 + + -1.5901079773902893e-01 7.9559110105037689e-02 + <_> + + 0 -1 1576 8.7470682337880135e-03 + + 3.7789858877658844e-02 -1.9156649708747864e-01 + <_> + + 0 -1 1577 2.0058929920196533e-02 + + 2.7415299788117409e-02 -3.8070109486579895e-01 + <_> + + 0 -1 1578 -1.8094859551638365e-03 + + 1.0538379848003387e-01 -1.4996549487113953e-01 + <_> + + 0 -1 1579 -7.3339277878403664e-03 + + 2.9203268885612488e-01 -6.1218190938234329e-02 + <_> + + 0 -1 1580 4.4179419055581093e-03 + + 1.8868620693683624e-01 -5.8132741600275040e-02 + <_> + + 0 -1 1581 -1.3543309643864632e-02 + + -4.9409559369087219e-01 2.2855930030345917e-02 + <_> + + 0 -1 1582 3.6197271198034286e-02 + + -2.6089120656251907e-02 3.0890250205993652e-01 + <_> + + 0 -1 1583 -1.1831840127706528e-01 + + -5.9094661474227905e-01 1.8215280026197433e-02 + <_> + + 0 -1 1584 7.5656071305274963e-02 + + -3.5965580493211746e-02 3.0386120080947876e-01 + <_> + + 0 -1 1585 -1.3134519569575787e-02 + + -2.6306131482124329e-01 4.2262919247150421e-02 + <_> + + 0 -1 1586 1.8981160596013069e-02 + + -2.6483630761504173e-02 1.9371989369392395e-01 + <_> + + 0 -1 1587 -4.6003229916095734e-02 + + 4.0513500571250916e-01 -2.4454200640320778e-02 + <_> + + 0 -1 1588 -1.3232730329036713e-02 + + -2.9721269011497498e-01 4.7959219664335251e-02 + <_> + + 0 -1 1589 1.9586850702762604e-01 + + 1.0540399700403214e-02 -8.6647927761077881e-01 + <_> + + 0 -1 1590 9.6459556370973587e-03 + + -7.1334943175315857e-02 1.1469510197639465e-01 + <_> + + 0 -1 1591 -3.9044579025357962e-03 + + 1.0740319639444351e-01 -9.8514996469020844e-02 + <_> + + 0 -1 1592 1.6896370798349380e-02 + + -7.6805070042610168e-02 1.9533200562000275e-01 + <_> + + 0 -1 1593 -5.5025662295520306e-03 + + 5.0643190741539001e-02 -2.0898430049419403e-01 + <_> + + 0 -1 1594 -1.9621569663286209e-02 + + -2.9651358723640442e-01 3.2955050468444824e-02 + <_> + + 0 -1 1595 7.7158107887953520e-04 + + 4.6017099171876907e-02 -1.9982999563217163e-01 + <_> + + 0 -1 1596 -1.1102840304374695e-01 + + 5.7578712701797485e-01 -1.7741529271006584e-02 + <_> + + 0 -1 1597 1.4945500297471881e-03 + + 4.7335729002952576e-02 -2.0898909866809845e-01 + <_> + + 0 -1 1598 5.0667919218540192e-02 + + -1.8657619133591652e-02 3.4070459008216858e-01 + <_> + + 0 -1 1599 1.6073169186711311e-02 + + -3.6449488252401352e-02 2.6568078994750977e-01 + <_> + + 0 -1 1600 -2.6536740362644196e-02 + + -3.6141690611839294e-01 2.9734270647168159e-02 + <_> + + 0 -1 1601 -5.2550169639289379e-03 + + -1.3104499876499176e-01 8.2153528928756714e-02 + <_> + + 0 -1 1602 -1.6678560525178909e-02 + + 3.1324890255928040e-01 -4.5052528381347656e-02 + <_> + + 0 -1 1603 3.4808400087058544e-03 + + 8.2945778965950012e-02 -1.5753500163555145e-01 + <_> + + 0 -1 1604 -8.0889053642749786e-02 + + -6.4314198493957520e-01 7.1740332059562206e-03 + <_> + + 0 -1 1605 -5.4260632023215294e-03 + + 1.3533130288124084e-01 -1.0547909885644913e-01 + <_> + + 0 -1 1606 1.6630839556455612e-02 + + 4.1602101176977158e-02 -2.6668208837509155e-01 + <_> + + 0 -1 1607 1.7991060158237815e-03 + + 5.9531088918447495e-02 -1.8355309963226318e-01 + <_> + + 0 -1 1608 2.7219969779253006e-02 + + -2.6586830615997314e-02 2.2722280025482178e-01 + <_> + + 0 -1 1609 -9.6450755372643471e-03 + + -2.1428169310092926e-01 4.9515731632709503e-02 + <_> + + 0 -1 1610 8.3123803138732910e-02 + + -4.2176891118288040e-02 3.0793419480323792e-01 + <_> + + 0 -1 1611 1.4406450092792511e-02 + + -2.9500020667910576e-02 3.2144379615783691e-01 + <_> + + 0 -1 1612 4.7938730567693710e-03 + + 5.1244091242551804e-02 -1.0931850224733353e-01 + <_> + + 0 -1 1613 -2.8978011105209589e-03 + + -1.4344370365142822e-01 6.6597223281860352e-02 + <_> + + 0 -1 1614 -4.5887690037488937e-02 + + 1.8003830313682556e-01 -1.5642790123820305e-02 + <_> + + 0 -1 1615 -5.4717700928449631e-02 + + -3.5110801458358765e-01 3.0438890680670738e-02 + <_> + + 0 -1 1616 -1.9787369295954704e-02 + + 9.3385331332683563e-02 -4.9382571130990982e-02 + <_> + + 0 -1 1617 2.5110379792749882e-03 + + -6.6672600805759430e-02 1.4406199753284454e-01 + <_> + + 0 -1 1618 5.3660150617361069e-02 + + 1.4468840323388577e-02 -6.7007470130920410e-01 + <_> + + 0 -1 1619 -8.1825470551848412e-03 + + 1.1510120332241058e-01 -8.0932617187500000e-02 + <_> + + 0 -1 1620 -3.5225939936935902e-03 + + -1.4181140065193176e-01 6.1330620199441910e-02 + <_> + + 0 -1 1621 2.8271550312638283e-02 + + -2.8353890404105186e-02 3.7045130133628845e-01 + <_> + + 0 -1 1622 -6.4923018217086792e-02 + + -4.6481159329414368e-01 2.2807259112596512e-02 + <_> + + 0 -1 1623 -3.5065850615501404e-01 + + -8.2529050111770630e-01 1.1031460016965866e-02 + <_> + + 0 -1 1624 5.1821782253682613e-03 + + 3.6583270877599716e-02 -2.4567179381847382e-01 + <_> + + 0 -1 1625 9.2609220882877707e-04 + + -6.1898738145828247e-02 1.9307570159435272e-01 + <_> + + 0 -1 1626 2.5952830910682678e-03 + + 4.3015718460083008e-02 -1.9770270586013794e-01 + <_> + + 0 -1 1627 3.4880579914897680e-03 + + -6.8296536803245544e-02 1.5725280344486237e-01 + <_> + + 0 -1 1628 2.4002529680728912e-03 + + -6.8618178367614746e-02 6.8551987409591675e-02 + <_> + + 0 -1 1629 1.2020230060443282e-03 + + -1.2073139846324921e-01 9.5026522874832153e-02 + <_> + + 0 -1 1630 -2.0470360293984413e-02 + + -1.2891639769077301e-01 7.9386599361896515e-02 + <_> + + 0 -1 1631 -5.9516180306673050e-02 + + 2.4869689345359802e-01 -4.9729160964488983e-02 + <_> + + 0 -1 1632 -1.0568950325250626e-02 + + -1.8583840131759644e-01 2.0700320601463318e-02 + <_> + + 0 -1 1633 -1.4192920178174973e-02 + + -3.8137429952621460e-01 2.9879279434680939e-02 + <_> + + 0 -1 1634 -2.4968578945845366e-03 + + 9.1516681015491486e-02 -5.0178311765193939e-02 + <_> + + 0 -1 1635 1.7714010027702898e-04 + + -1.1470019817352295e-01 9.9245697259902954e-02 + <_> + + 0 -1 1636 7.8318670392036438e-02 + + 3.6057420074939728e-03 -9.9996072053909302e-01 + <_> + + 0 -1 1637 1.5502399764955044e-03 + + -1.2888610363006592e-01 7.9822011291980743e-02 + <_> + + 0 -1 1638 -6.6678877919912338e-03 + + -8.8244557380676270e-02 2.8102599084377289e-02 + <_> + + 0 -1 1639 -4.0497239679098129e-03 + + -1.4427180588245392e-01 8.7126396596431732e-02 + <_> + + 0 -1 1640 -3.5481531172990799e-02 + + -4.4681170582771301e-01 1.4808270148932934e-02 + <_> + + 0 -1 1641 -1.2597720138728619e-02 + + 8.9324191212654114e-02 -1.2518140673637390e-01 + <_> + + 0 -1 1642 7.4662449769675732e-03 + + 7.4888199567794800e-02 -1.3587780296802521e-01 + <_> + + 0 -1 1643 -6.7536987364292145e-02 + + 2.3416820168495178e-01 -4.0952268987894058e-02 + <_> + + 0 -1 1644 8.2704171538352966e-02 + + 7.6422439888119698e-03 -8.5177552700042725e-01 + <_> + + 0 -1 1645 -7.1595138870179653e-03 + + -1.8738010525703430e-01 5.5288419127464294e-02 + <_> + + 0 -1 1646 -1.0481069795787334e-02 + + 1.8271109461784363e-01 -5.9641968458890915e-02 + <_> + + 0 -1 1647 4.5238467864692211e-03 + + -8.3817601203918457e-02 1.4822180569171906e-01 + <_> + + 0 -1 1648 -2.6731120306067169e-04 + + -2.0896770060062408e-01 4.5835729688405991e-02 + <_> + + 0 -1 1649 3.3838581293821335e-02 + + 4.2582869529724121e-02 -2.1883819997310638e-01 + <_> + + 0 -1 1650 2.2287720348685980e-03 + + -1.3284230232238770e-01 8.1795319914817810e-02 + <_> + + 0 -1 1651 -5.4200361482799053e-03 + + -1.3896510004997253e-01 7.1154713630676270e-02 + <_> + + 0 -1 1652 -4.9642968922853470e-02 + + 4.8901641368865967e-01 -1.1556959711015224e-02 + <_> + + 0 -1 1653 3.3323399256914854e-03 + + 5.1426161080598831e-02 -1.8269440531730652e-01 + <_> + + 0 -1 1654 2.4343939498066902e-02 + + -3.1839560717344284e-02 1.2758859992027283e-01 + <_> + + 0 -1 1655 -2.3774489760398865e-02 + + 3.2773551344871521e-01 -2.7216760441660881e-02 + <_> + + 0 -1 1656 3.6809889134019613e-03 + + 5.2922040224075317e-02 -1.2880720198154449e-01 + <_> + + 0 -1 1657 -3.2609070185571909e-03 + + -1.4948120713233948e-01 6.5733537077903748e-02 + <_> + + 0 -1 1658 1.0793889872729778e-02 + + -3.2969951629638672e-02 3.2955420017242432e-01 + <_> + + 0 -1 1659 5.4287910461425781e-04 + + -1.0678680241107941e-01 9.8564229905605316e-02 + <_> + + 0 -1 1660 1.1902759782969952e-02 + + 3.5682920366525650e-02 -3.1317448616027832e-01 + <_> + + 0 -1 1661 2.4277849588543177e-03 + + -6.2080658972263336e-02 1.7598509788513184e-01 + <_> + + 0 -1 1662 -4.4930889271199703e-03 + + 1.1790850013494492e-01 -1.0593199729919434e-01 + <_> + 143 + -1.7262409925460815e+00 + + <_> + + 0 -1 1663 -2.0656470209360123e-02 + + 2.5365149974822998e-01 -3.1044611334800720e-01 + <_> + + 0 -1 1664 -3.6518350243568420e-02 + + 2.4484130740165710e-01 -2.3221190273761749e-01 + <_> + + 0 -1 1665 4.9312350153923035e-01 + + -1.6275240480899811e-01 2.8116190433502197e-01 + <_> + + 0 -1 1666 2.0970099285477772e-05 + + -3.0840009450912476e-01 1.7317549884319305e-01 + <_> + + 0 -1 1667 1.3082929886877537e-02 + + -2.5983220338821411e-01 1.5675869584083557e-01 + <_> + + 0 -1 1668 -4.3061940232291818e-04 + + 7.8543603420257568e-02 -3.9016070961952209e-01 + <_> + + 0 -1 1669 -1.6367400065064430e-02 + + -4.3000039458274841e-01 7.4141636490821838e-02 + <_> + + 0 -1 1670 3.6269389092922211e-02 + + -1.7073200643062592e-01 1.8045969307422638e-01 + <_> + + 0 -1 1671 1.2340269982814789e-02 + + 8.8775381445884705e-02 -3.4402659535408020e-01 + <_> + + 0 -1 1672 -7.3516286909580231e-02 + + -4.1623479127883911e-01 -2.9528199229389429e-03 + <_> + + 0 -1 1673 4.6191830188035965e-04 + + 6.5629899501800537e-02 -4.1018250584602356e-01 + <_> + + 0 -1 1674 -1.4744039624929428e-02 + + 2.2775030136108398e-01 -7.9184867441654205e-02 + <_> + + 0 -1 1675 4.2559150606393814e-03 + + -2.4004960060119629e-01 1.1321090161800385e-01 + <_> + + 0 -1 1676 -3.6180280148983002e-03 + + -2.7612069249153137e-01 1.0118050128221512e-01 + <_> + + 0 -1 1677 4.6012919396162033e-02 + + 4.5763589441776276e-02 -5.4713648557662964e-01 + <_> + + 0 -1 1678 -1.6181809827685356e-02 + + 1.9489669799804688e-01 -7.3955342173576355e-02 + <_> + + 0 -1 1679 -2.3682719984208234e-05 + + 1.1729680001735687e-01 -1.9396829605102539e-01 + <_> + + 0 -1 1680 -2.1599140018224716e-03 + + -4.5654550194740295e-01 4.2699530720710754e-02 + <_> + + 0 -1 1681 -7.9827345907688141e-03 + + -5.4107201099395752e-01 4.0036130696535110e-02 + <_> + + 0 -1 1682 -8.1530469469726086e-04 + + -2.0640519261360168e-01 6.6795073449611664e-02 + <_> + + 0 -1 1683 -4.7501060180366039e-03 + + -3.6572128534317017e-01 7.5665749609470367e-02 + <_> + + 0 -1 1684 -3.4870140254497528e-02 + + -8.0093812942504883e-01 2.2356539964675903e-02 + <_> + + 0 -1 1685 -1.9949559122323990e-02 + + -3.9110630750656128e-01 4.6844650059938431e-02 + <_> + + 0 -1 1686 -5.9008211828768253e-03 + + 9.0756498277187347e-02 -1.7600280046463013e-01 + <_> + + 0 -1 1687 -1.4019970549270511e-03 + + -2.9260930418968201e-01 6.4894109964370728e-02 + <_> + + 0 -1 1688 -2.2886939346790314e-02 + + -4.8391869664192200e-01 5.0514958798885345e-02 + <_> + + 0 -1 1689 -1.0039290413260460e-02 + + 2.6921668648719788e-01 -7.5274370610713959e-02 + <_> + + 0 -1 1690 1.6729189082980156e-02 + + -7.3217533528804779e-02 2.2045159339904785e-01 + <_> + + 0 -1 1691 -2.0423909649252892e-02 + + -4.5161980390548706e-01 4.5858111232519150e-02 + <_> + + 0 -1 1692 -3.5104680806398392e-02 + + -5.5169981718063354e-01 2.3118300363421440e-02 + <_> + + 0 -1 1693 1.0697999969124794e-02 + + 3.3516589552164078e-02 -5.2482652664184570e-01 + <_> + + 0 -1 1694 -3.8978241384029388e-02 + + -6.2331187725067139e-01 2.6838419958949089e-02 + <_> + + 0 -1 1695 4.8226700164377689e-03 + + -1.1215549707412720e-01 1.5613789856433868e-01 + <_> + + 0 -1 1696 3.6878231167793274e-01 + + 1.9857980310916901e-02 -6.1260747909545898e-01 + <_> + + 0 -1 1697 -7.7059920877218246e-03 + + -3.7371110916137695e-01 4.3724238872528076e-02 + <_> + + 0 -1 1698 -6.6843323409557343e-02 + + -5.0772088766098022e-01 2.4401089176535606e-02 + <_> + + 0 -1 1699 3.7273049354553223e-02 + + 3.6522880196571350e-02 -4.3735611438751221e-01 + <_> + + 0 -1 1700 -3.3105209469795227e-02 + + -3.4438988566398621e-01 3.2440148293972015e-02 + <_> + + 0 -1 1701 5.3402669727802277e-03 + + 9.2385761439800262e-02 -1.7823779582977295e-01 + <_> + + 0 -1 1702 2.1542439237236977e-02 + + -1.9848670065402985e-01 5.1953200250864029e-02 + <_> + + 0 -1 1703 3.3289310336112976e-01 + + -6.0750268399715424e-02 2.8925099968910217e-01 + <_> + + 0 -1 1704 -6.6301261540502310e-04 + + 3.3636718988418579e-02 -2.8510418534278870e-01 + <_> + + 0 -1 1705 4.6686761081218719e-02 + + -4.9883669614791870e-01 3.3776078373193741e-02 + <_> + + 0 -1 1706 -2.2452229168266058e-03 + + -1.9685390591621399e-01 9.5161177217960358e-02 + <_> + + 0 -1 1707 -1.1499020271003246e-02 + + -3.2423889636993408e-01 5.2468359470367432e-02 + <_> + + 0 -1 1708 1.3134529814124107e-02 + + -6.7538492381572723e-02 2.7605938911437988e-01 + <_> + + 0 -1 1709 -1.5978980809450150e-02 + + 3.1496050953865051e-01 -7.6657392084598541e-02 + <_> + + 0 -1 1710 2.4199750274419785e-02 + + 5.5836521089076996e-02 -3.6609899997711182e-01 + <_> + + 0 -1 1711 4.0229028090834618e-03 + + -1.3053479790687561e-01 1.3470110297203064e-01 + <_> + + 0 -1 1712 -1.4172590337693691e-02 + + -8.8616542518138885e-02 5.5053278803825378e-02 + <_> + + 0 -1 1713 1.8967399373650551e-02 + + 5.1348548382520676e-02 -3.1439921259880066e-01 + <_> + + 0 -1 1714 2.6502970606088638e-02 + + -1.1065970361232758e-01 8.8080927729606628e-02 + <_> + + 0 -1 1715 -3.9654489606618881e-02 + + -5.0742971897125244e-01 3.2999441027641296e-02 + <_> + + 0 -1 1716 -8.9988503605127335e-03 + + 1.2830139696598053e-01 -7.3064133524894714e-02 + <_> + + 0 -1 1717 7.4613288044929504e-02 + + 3.1729809939861298e-02 -5.3899657726287842e-01 + <_> + + 0 -1 1718 3.3414870500564575e-02 + + -6.1130590736865997e-02 2.4669900536537170e-01 + <_> + + 0 -1 1719 9.6071150619536638e-04 + + 1.2528179585933685e-01 -1.4304199814796448e-01 + <_> + + 0 -1 1720 -8.6224973201751709e-03 + + -2.2081799805164337e-01 4.7569438815116882e-02 + <_> + + 0 -1 1721 3.9893008768558502e-02 + + -5.1774360239505768e-02 3.1735679507255554e-01 + <_> + + 0 -1 1722 8.5388116538524628e-02 + + -3.5584390163421631e-02 4.1974198818206787e-01 + <_> + + 0 -1 1723 6.3205747865140438e-03 + + 6.9412536919116974e-02 -2.9979988932609558e-01 + <_> + + 0 -1 1724 -5.8932311832904816e-02 + + -4.6194219589233398e-01 2.2290540859103203e-02 + <_> + + 0 -1 1725 -1.0054419748485088e-02 + + 2.3649129271507263e-01 -6.6811926662921906e-02 + <_> + + 0 -1 1726 -2.5194720365107059e-05 + + 7.8815452754497528e-02 -1.1585489660501480e-01 + <_> + + 0 -1 1727 -5.9346649795770645e-02 + + -5.8799749612808228e-01 3.0486419796943665e-02 + <_> + + 0 -1 1728 2.0421659573912621e-02 + + 3.9184041321277618e-02 -2.6986798644065857e-01 + <_> + + 0 -1 1729 -4.0381640195846558e-02 + + -6.1601102352142334e-01 2.5353100150823593e-02 + <_> + + 0 -1 1730 1.7877650260925293e-01 + + -5.7135760784149170e-02 1.7361579835414886e-01 + <_> + + 0 -1 1731 -2.2120740264654160e-02 + + -3.7697589397430420e-01 4.2690049856901169e-02 + <_> + + 0 -1 1732 1.1585020273923874e-01 + + 9.8102567717432976e-03 -6.1380887031555176e-01 + <_> + + 0 -1 1733 9.7944810986518860e-02 + + 3.6329559981822968e-02 -4.5240780711174011e-01 + <_> + + 0 -1 1734 -2.9123030602931976e-02 + + -6.5607357025146484e-01 8.4500880911946297e-03 + <_> + + 0 -1 1735 -1.3053599745035172e-02 + + -3.4685650467872620e-01 4.6511679887771606e-02 + <_> + + 0 -1 1736 1.3451489619910717e-02 + + 3.4420430660247803e-02 -1.0168869793415070e-01 + <_> + + 0 -1 1737 -2.3957140743732452e-02 + + -8.4189480543136597e-01 1.9317319616675377e-02 + <_> + + 0 -1 1738 -1.3450190424919128e-01 + + 3.9132338762283325e-01 -2.1901259198784828e-02 + <_> + + 0 -1 1739 -1.0342430323362350e-01 + + 6.0790222883224487e-01 -2.5869879871606827e-02 + <_> + + 0 -1 1740 -4.1464429348707199e-02 + + -3.9631319046020508e-01 3.7771981209516525e-02 + <_> + + 0 -1 1741 -3.4945748746395111e-02 + + -4.5746931433677673e-01 3.2913569360971451e-02 + <_> + + 0 -1 1742 1.4289909973740578e-02 + + -5.0757531076669693e-02 3.1772908568382263e-01 + <_> + + 0 -1 1743 -5.4311589337885380e-03 + + 2.4708689749240875e-01 -7.8526623547077179e-02 + <_> + + 0 -1 1744 2.6972589548677206e-03 + + -3.4061861038208008e-01 5.0948519259691238e-02 + <_> + + 0 -1 1745 -4.3831961229443550e-03 + + 8.0095797777175903e-02 -2.0902189612388611e-01 + <_> + + 0 -1 1746 -1.5958329662680626e-02 + + -2.4625590443611145e-01 5.8348231017589569e-02 + <_> + + 0 -1 1747 4.5252371579408646e-02 + + 4.1630141437053680e-02 -3.5550931096076965e-01 + <_> + + 0 -1 1748 -1.8278149887919426e-02 + + 3.0804929137229919e-01 -4.7184839844703674e-02 + <_> + + 0 -1 1749 2.5277629494667053e-02 + + 2.9698649421334267e-02 -5.3776097297668457e-01 + <_> + + 0 -1 1750 7.2078350931406021e-03 + + -1.2820510566234589e-01 1.1753190308809280e-01 + <_> + + 0 -1 1751 -1.4014700055122375e-01 + + -4.5020869374275208e-01 3.2753791660070419e-02 + <_> + + 0 -1 1752 -4.5832369476556778e-02 + + -4.2000839114189148e-01 2.4114929139614105e-02 + <_> + + 0 -1 1753 -4.3976899236440659e-02 + + -4.5973241329193115e-01 3.3604741096496582e-02 + <_> + + 0 -1 1754 -1.0124820284545422e-02 + + 1.6260810196399689e-01 -6.6449157893657684e-02 + <_> + + 0 -1 1755 -1.3071260182186961e-03 + + 1.1608310043811798e-01 -1.3168659806251526e-01 + <_> + + 0 -1 1756 4.5284889638423920e-02 + + 3.5751760005950928e-02 -4.4795739650726318e-01 + <_> + + 0 -1 1757 -2.0851079374551773e-02 + + 2.4665319919586182e-01 -6.5854541957378387e-02 + <_> + + 0 -1 1758 2.6742550544440746e-03 + + 5.1683109253644943e-02 -1.3699389994144440e-01 + <_> + + 0 -1 1759 1.3148089637979865e-03 + + 7.7798873186111450e-02 -2.1064509451389313e-01 + <_> + + 0 -1 1760 -1.8174739554524422e-02 + + 1.7355039715766907e-01 -7.2417192161083221e-02 + <_> + + 0 -1 1761 1.4314319938421249e-02 + + 8.1756986677646637e-02 -1.7111450433731079e-01 + <_> + + 0 -1 1762 -1.6486430540680885e-02 + + 2.2809509932994843e-01 -6.5906368196010590e-02 + <_> + + 0 -1 1763 3.0756060034036636e-02 + + 3.8717139512300491e-02 -4.0505141019821167e-01 + <_> + + 0 -1 1764 2.6106089353561401e-02 + + 3.0850199982523918e-02 -2.7759250998497009e-01 + <_> + + 0 -1 1765 8.0401107668876648e-02 + + 2.9792500659823418e-02 -4.4742569327354431e-01 + <_> + + 0 -1 1766 -1.8350789323449135e-02 + + 1.1515419930219650e-01 -2.8744319453835487e-02 + <_> + + 0 -1 1767 3.4827049821615219e-02 + + 2.8738139197230339e-02 -4.8401808738708496e-01 + <_> + + 0 -1 1768 -8.8250182569026947e-02 + + -4.2635539174079895e-01 3.0173489823937416e-02 + <_> + + 0 -1 1769 1.4836989343166351e-01 + + 2.2089749574661255e-02 -5.5364227294921875e-01 + <_> + + 0 -1 1770 -1.8949609249830246e-02 + + -2.3020160198211670e-01 3.9267301559448242e-02 + <_> + + 0 -1 1771 -5.6775949895381927e-02 + + 3.5013529658317566e-01 -4.0862828493118286e-02 + <_> + + 0 -1 1772 6.2286540865898132e-02 + + 2.2344540804624557e-02 -7.1082341670989990e-01 + <_> + + 0 -1 1773 -3.8629550486803055e-02 + + -3.2933491468429565e-01 3.8508068770170212e-02 + <_> + + 0 -1 1774 2.8154330328106880e-02 + + -7.3690913617610931e-02 1.8824370205402374e-01 + <_> + + 0 -1 1775 -1.0570179671049118e-02 + + -2.7806881070137024e-01 4.7679189592599869e-02 + <_> + + 0 -1 1776 5.6604571640491486e-02 + + 2.4767610430717468e-01 -5.6830938905477524e-02 + <_> + + 0 -1 1777 -2.8522670269012451e-01 + + 5.2345401048660278e-01 -2.3652829229831696e-02 + <_> + + 0 -1 1778 3.4807138144969940e-02 + + 2.4819910526275635e-02 -4.3205270171165466e-01 + <_> + + 0 -1 1779 -2.3218799382448196e-02 + + 2.9929161071777344e-01 -4.4712670147418976e-02 + <_> + + 0 -1 1780 -6.3094392418861389e-02 + + 3.3279260993003845e-01 -1.6075499355792999e-02 + <_> + + 0 -1 1781 3.0182430148124695e-01 + + -7.5196906924247742e-02 1.9139809906482697e-01 + <_> + + 0 -1 1782 2.3077869787812233e-02 + + 3.6844979971647263e-02 -2.8761258721351624e-01 + <_> + + 0 -1 1783 1.0964149981737137e-01 + + 3.7548121064901352e-02 -4.1763558983802795e-01 + <_> + + 0 -1 1784 2.9672039672732353e-02 + + -7.8409820795059204e-02 1.3064210116863251e-01 + <_> + + 0 -1 1785 6.3356538303196430e-03 + + 6.7014321684837341e-02 -2.0481500029563904e-01 + <_> + + 0 -1 1786 -1.9940949976444244e-02 + + 8.4663636982440948e-02 -4.2069409042596817e-02 + <_> + + 0 -1 1787 -4.7988001257181168e-02 + + -6.1099517345428467e-01 2.2842260077595711e-02 + <_> + + 0 -1 1788 4.8280019313097000e-02 + + 7.4727279134094715e-03 -7.5153297185897827e-01 + <_> + + 0 -1 1789 -2.5825301418080926e-04 + + 3.5517089068889618e-02 -3.2686069607734680e-01 + <_> + + 0 -1 1790 -4.8175308853387833e-02 + + -5.8099460601806641e-01 1.9760759547352791e-02 + <_> + + 0 -1 1791 -2.8606340289115906e-02 + + 3.2096970081329346e-01 -4.0734320878982544e-02 + <_> + + 0 -1 1792 -4.3328531086444855e-02 + + -3.3021429181098938e-01 3.1527239829301834e-02 + <_> + + 0 -1 1793 2.2753410041332245e-02 + + 3.7327829748392105e-02 -3.6291739344596863e-01 + <_> + + 0 -1 1794 1.8975350030814297e-05 + + -1.1503349989652634e-01 4.1816640645265579e-02 + <_> + + 0 -1 1795 1.8077540397644043e-01 + + -5.5751871317625046e-02 2.2424830496311188e-01 + <_> + + 0 -1 1796 -1.2539149820804596e-01 + + -8.8098400831222534e-01 3.8788339588791132e-03 + <_> + + 0 -1 1797 -8.0908974632620811e-03 + + 2.6210701465606689e-01 -5.3706649690866470e-02 + <_> + + 0 -1 1798 9.9102966487407684e-03 + + -1.2978099286556244e-01 8.3635807037353516e-02 + <_> + + 0 -1 1799 2.4792920798063278e-02 + + -1.4584439992904663e-01 9.2305660247802734e-02 + <_> + + 0 -1 1800 4.5074880123138428e-02 + + -7.2375498712062836e-02 2.6057431101799011e-01 + <_> + + 0 -1 1801 -7.9205513000488281e-02 + + -6.2073522806167603e-01 2.1323349326848984e-02 + <_> + + 0 -1 1802 -4.4725250452756882e-02 + + -6.4248198270797729e-01 9.5317112281918526e-03 + <_> + + 0 -1 1803 -3.4065779298543930e-02 + + 3.0759710073471069e-01 -4.2296990752220154e-02 + <_> + + 0 -1 1804 -2.9756739735603333e-02 + + 2.5211650133132935e-01 -3.1183030456304550e-02 + <_> + + 0 -1 1805 -3.2026950269937515e-02 + + -5.5300801992416382e-01 2.8021570295095444e-02 + <_> + 193 + -1.4976780414581299e+00 + + <_> + + 0 -1 1806 2.8652619570493698e-02 + + -2.1822139620780945e-01 2.2675579786300659e-01 + <_> + + 0 -1 1807 4.3320041149854660e-03 + + -2.8597879409790039e-01 1.0589209944009781e-01 + <_> + + 0 -1 1808 5.6604119017720222e-03 + + 8.8295452296733856e-02 -3.8920480012893677e-01 + <_> + + 0 -1 1809 2.4440148845314980e-03 + + -3.5482680797576904e-01 9.9362373352050781e-02 + <_> + + 0 -1 1810 2.2643520496785641e-03 + + -2.8858441114425659e-01 8.8367857038974762e-02 + <_> + + 0 -1 1811 5.3952648304402828e-03 + + 8.5537381470203400e-02 -3.0366399884223938e-01 + <_> + + 0 -1 1812 -7.2699488373473287e-04 + + 7.4840240180492401e-02 -3.4039780497550964e-01 + <_> + + 0 -1 1813 -9.7503658616915345e-04 + + 1.2008629739284515e-01 -2.5634410977363586e-01 + <_> + + 0 -1 1814 4.0540988557040691e-03 + + 6.7266032099723816e-02 -3.5701939463615417e-01 + <_> + + 0 -1 1815 2.5258921086788177e-03 + + -4.1966471076011658e-01 5.5665798485279083e-02 + <_> + + 0 -1 1816 -1.2021360453218222e-03 + + 1.0004480183124542e-01 -2.1932320296764374e-01 + <_> + + 0 -1 1817 7.7549100387841463e-04 + + -1.3562729954719543e-01 1.1973659694194794e-01 + <_> + + 0 -1 1818 -5.0699848681688309e-02 + + 4.5418289303779602e-01 -3.9030350744724274e-02 + <_> + + 0 -1 1819 1.3364490121603012e-02 + + 1.1166039854288101e-01 -1.7938789725303650e-01 + <_> + + 0 -1 1820 -1.5418980270624161e-02 + + -3.5180059075355530e-01 4.7354999929666519e-02 + <_> + + 0 -1 1821 -4.2981099337339401e-02 + + 3.9232799410820007e-01 -4.5337028801441193e-02 + <_> + + 0 -1 1822 6.2867929227650166e-03 + + 6.4331822097301483e-02 -2.2239510715007782e-01 + <_> + + 0 -1 1823 -3.5951940808445215e-03 + + 9.5404297113418579e-02 -1.5338289737701416e-01 + <_> + + 0 -1 1824 -7.6760917901992798e-02 + + -6.5099817514419556e-01 1.7283650115132332e-02 + <_> + + 0 -1 1825 4.6225200640037656e-04 + + -4.3415609002113342e-01 2.5241859257221222e-02 + <_> + + 0 -1 1826 7.5868278509005904e-04 + + -1.4624330401420593e-01 9.6319071948528290e-02 + <_> + + 0 -1 1827 -5.0252641085535288e-04 + + 1.3584020733833313e-01 -2.3181040585041046e-01 + <_> + + 0 -1 1828 9.7315143793821335e-03 + + -8.5155591368675232e-02 2.0156989991664886e-01 + <_> + + 0 -1 1829 -2.6432229205965996e-02 + + -3.7002518773078918e-01 2.4616630747914314e-02 + <_> + + 0 -1 1830 -4.4683468877337873e-04 + + 1.0048960149288177e-01 -1.8588609993457794e-01 + <_> + + 0 -1 1831 1.9872789271175861e-03 + + 5.3223919123411179e-02 -3.1603801250457764e-01 + <_> + + 0 -1 1832 3.1368629424832761e-04 + + -1.3213190436363220e-01 9.5771767199039459e-02 + <_> + + 0 -1 1833 5.9834700077772141e-03 + + -7.5681813061237335e-02 1.5230950713157654e-01 + <_> + + 0 -1 1834 -5.0965389236807823e-03 + + -1.8477819859981537e-01 7.6022140681743622e-02 + <_> + + 0 -1 1835 -1.9187610596418381e-02 + + 2.1431809663772583e-01 -4.9764219671487808e-02 + <_> + + 0 -1 1836 2.3320479318499565e-02 + + -4.8689320683479309e-02 2.6578998565673828e-01 + <_> + + 0 -1 1837 -6.9449091097339988e-04 + + -1.5433350205421448e-01 8.7410651147365570e-02 + <_> + + 0 -1 1838 4.8893648199737072e-03 + + 5.1342789083719254e-02 -2.6165360212326050e-01 + <_> + + 0 -1 1839 -2.7428869158029556e-02 + + -3.7972038984298706e-01 3.1821161508560181e-02 + <_> + + 0 -1 1840 -1.7734549939632416e-02 + + 1.9976620376110077e-01 -6.2318049371242523e-02 + <_> + + 0 -1 1841 1.5148259699344635e-01 + + 7.4510741978883743e-03 -5.8031332492828369e-01 + <_> + + 0 -1 1842 1.5324390260502696e-03 + + -1.2510550022125244e-01 1.0431899875402451e-01 + <_> + + 0 -1 1843 -1.2310810387134552e-02 + + -2.3539729416370392e-01 5.3646210581064224e-02 + <_> + + 0 -1 1844 -1.1210800148546696e-02 + + 1.0759239643812180e-01 -1.2055230140686035e-01 + <_> + + 0 -1 1845 2.7532500680536032e-03 + + -6.6479906439781189e-02 1.7321150004863739e-01 + <_> + + 0 -1 1846 -8.4678819403052330e-03 + + -3.1850680708885193e-01 4.2280819267034531e-02 + <_> + + 0 -1 1847 -7.3283319361507893e-03 + + -1.6369259357452393e-01 3.1772349029779434e-02 + <_> + + 0 -1 1848 4.7156549990177155e-02 + + -6.1667099595069885e-02 1.7410990595817566e-01 + <_> + + 0 -1 1849 8.2125868648290634e-03 + + 6.7069798707962036e-02 -2.2030070424079895e-01 + <_> + + 0 -1 1850 7.6550841331481934e-03 + + 6.1422310769557953e-02 -1.9357620179653168e-01 + <_> + + 0 -1 1851 -4.5372851192951202e-02 + + -4.7565659880638123e-01 2.2869469597935677e-02 + <_> + + 0 -1 1852 3.7434820551425219e-03 + + -9.0940922498703003e-02 1.3841210305690765e-01 + <_> + + 0 -1 1853 2.3490150924772024e-03 + + 6.3291497528553009e-02 -1.5506389737129211e-01 + <_> + + 0 -1 1854 -2.4149749428033829e-02 + + 3.4588441252708435e-01 -3.1525820493698120e-02 + <_> + + 0 -1 1855 1.4878350310027599e-02 + + 2.4215059354901314e-02 -3.2387629151344299e-01 + <_> + + 0 -1 1856 2.9843160882592201e-02 + + -2.7817690744996071e-02 4.0939471125602722e-01 + <_> + + 0 -1 1857 7.1600051596760750e-03 + + -4.6596240252256393e-02 7.4547067284584045e-02 + <_> + + 0 -1 1858 5.6267209351062775e-02 + + 2.9551850631833076e-02 -4.0098059177398682e-01 + <_> + + 0 -1 1859 -4.5356149785220623e-03 + + 8.1820577383041382e-02 -1.0619299858808517e-01 + <_> + + 0 -1 1860 -1.3697359710931778e-02 + + -1.9359089434146881e-01 7.0917747914791107e-02 + <_> + + 0 -1 1861 -1.5458730049431324e-03 + + -2.1987679600715637e-01 2.8396489098668098e-02 + <_> + + 0 -1 1862 2.9332858975976706e-03 + + -7.6153233647346497e-02 1.6460180282592773e-01 + <_> + + 0 -1 1863 3.4973609726876020e-03 + + -6.8196080625057220e-02 1.6717350482940674e-01 + <_> + + 0 -1 1864 -1.8307069316506386e-02 + + -1.8867099285125732e-01 6.9932736456394196e-02 + <_> + + 0 -1 1865 -1.7092080414295197e-01 + + -5.0067770481109619e-01 7.8164357692003250e-03 + <_> + + 0 -1 1866 4.1620130650699139e-03 + + 5.5900041013956070e-02 -2.2972549498081207e-01 + <_> + + 0 -1 1867 -1.9724309444427490e-02 + + 3.2998558878898621e-01 -3.6602400243282318e-02 + <_> + + 0 -1 1868 5.3331600502133369e-03 + + -1.4134259521961212e-01 8.8277637958526611e-02 + <_> + + 0 -1 1869 -4.2182218283414841e-02 + + -6.6718780994415283e-01 1.5770509839057922e-02 + <_> + + 0 -1 1870 -5.2826730534434319e-03 + + 1.7025630176067352e-01 -6.8491317331790924e-02 + <_> + + 0 -1 1871 -2.3227441124618053e-03 + + 7.2378590703010559e-02 -1.0066709667444229e-01 + <_> + + 0 -1 1872 -1.6239390242844820e-03 + + -2.2501319646835327e-01 5.5898498743772507e-02 + <_> + + 0 -1 1873 5.6083410978317261e-02 + + 1.3646169565618038e-02 -4.9306789040565491e-01 + <_> + + 0 -1 1874 -3.0199930071830750e-02 + + 2.3070830106735229e-01 -5.3645938634872437e-02 + <_> + + 0 -1 1875 1.9157670438289642e-02 + + 3.6830320954322815e-02 -3.9522978663444519e-01 + <_> + + 0 -1 1876 3.5853029694408178e-03 + + -6.1893220990896225e-02 1.7583209276199341e-01 + <_> + + 0 -1 1877 -2.8775330632925034e-02 + + -3.1838440895080566e-01 2.3103740066289902e-02 + <_> + + 0 -1 1878 2.5611401069909334e-03 + + -1.0484419763088226e-01 9.7152568399906158e-02 + <_> + + 0 -1 1879 -3.1554490327835083e-02 + + 2.9366511106491089e-01 -2.4189069867134094e-02 + <_> + + 0 -1 1880 -7.3520588921383023e-04 + + 9.7711041569709778e-02 -1.5248039364814758e-01 + <_> + + 0 -1 1881 -4.7993879765272141e-02 + + -9.4587820768356323e-01 9.0406481176614761e-03 + <_> + + 0 -1 1882 5.2936570718884468e-03 + + 3.3320371061563492e-02 -3.1268939375877380e-01 + <_> + + 0 -1 1883 1.6903249546885490e-02 + + -2.4132709950208664e-02 2.8483408689498901e-01 + <_> + + 0 -1 1884 -7.0723611861467361e-03 + + -1.7524200677871704e-01 7.2713881731033325e-02 + <_> + + 0 -1 1885 6.4191617071628571e-02 + + -2.0969670265913010e-02 3.5402628779411316e-01 + <_> + + 0 -1 1886 2.9694940894842148e-03 + + -7.5086936354637146e-02 1.4321349561214447e-01 + <_> + + 0 -1 1887 -2.0105259492993355e-02 + + 6.0784012079238892e-01 -1.8104499205946922e-02 + <_> + + 0 -1 1888 -1.3169869780540466e-02 + + -5.4678368568420410e-01 2.4742240086197853e-02 + <_> + + 0 -1 1889 -1.4226729981601238e-02 + + -4.6722590923309326e-01 3.1489629298448563e-02 + <_> + + 0 -1 1890 3.7746191024780273e-02 + + -3.8495831191539764e-02 3.5333481431007385e-01 + <_> + + 0 -1 1891 -3.8704369217157364e-03 + + 1.4984290301799774e-01 -5.6549768894910812e-02 + <_> + + 0 -1 1892 -1.1565440334379673e-02 + + -1.5227930247783661e-01 7.6062962412834167e-02 + <_> + + 0 -1 1893 -8.8854476809501648e-02 + + -7.2967928647994995e-01 4.8231678083539009e-03 + <_> + + 0 -1 1894 -2.0447981078177691e-03 + + 1.4148180186748505e-01 -8.3200357854366302e-02 + <_> + + 0 -1 1895 -1.1762860231101513e-02 + + -4.0200519561767578e-01 2.6679439470171928e-02 + <_> + + 0 -1 1896 -1.7539029940962791e-02 + + -3.7316259741783142e-01 3.0171979218721390e-02 + <_> + + 0 -1 1897 3.8314110133796930e-03 + + -9.3409948050975800e-02 7.9503498971462250e-02 + <_> + + 0 -1 1898 -1.4472359791398048e-02 + + 3.4333580732345581e-01 -4.3657060712575912e-02 + <_> + + 0 -1 1899 -2.6516690850257874e-02 + + -4.8230230808258057e-01 1.6811650246381760e-02 + <_> + + 0 -1 1900 -3.3194791525602341e-02 + + -4.3580260872840881e-01 2.2644890472292900e-02 + <_> + + 0 -1 1901 4.4987560249865055e-03 + + -3.2281540334224701e-02 8.9946307241916656e-02 + <_> + + 0 -1 1902 3.6823831032961607e-03 + + -6.8755462765693665e-02 1.4339810609817505e-01 + <_> + + 0 -1 1903 -1.1184140294790268e-01 + + -7.7756762504577637e-01 5.2246451377868652e-03 + <_> + + 0 -1 1904 -7.3255039751529694e-02 + + -5.5630749464035034e-01 1.9127149134874344e-02 + <_> + + 0 -1 1905 2.9855769127607346e-02 + + 2.1178830415010452e-02 -4.0850040316581726e-01 + <_> + + 0 -1 1906 -7.3472231626510620e-02 + + 8.2820487022399902e-01 -1.2452909722924232e-02 + <_> + + 0 -1 1907 -7.2046648710966110e-04 + + 9.9630527198314667e-02 -9.5278859138488770e-02 + <_> + + 0 -1 1908 -3.8003330701030791e-04 + + 1.0231109708547592e-01 -1.0351389646530151e-01 + <_> + + 0 -1 1909 -4.5453108847141266e-02 + + -6.4885061979293823e-01 1.1966000311076641e-02 + <_> + + 0 -1 1910 -5.1456969231367111e-04 + + -1.5083299577236176e-01 6.6544473171234131e-02 + <_> + + 0 -1 1911 2.7949180454015732e-02 + + 1.7186399549245834e-02 -3.7501189112663269e-01 + <_> + + 0 -1 1912 6.3039876520633698e-02 + + -4.3821588158607483e-02 2.4789440631866455e-01 + <_> + + 0 -1 1913 -2.2690258920192719e-03 + + 7.4712008237838745e-02 -1.1131580173969269e-01 + <_> + + 0 -1 1914 -3.8063840474933386e-03 + + -1.5530909597873688e-01 6.5264508128166199e-02 + <_> + + 0 -1 1915 3.7190090864896774e-02 + + -2.9698630794882774e-02 2.3071870207786560e-01 + <_> + + 0 -1 1916 2.1895840764045715e-02 + + 1.5778519213199615e-02 -6.3006269931793213e-01 + <_> + + 0 -1 1917 -3.1993988901376724e-02 + + 2.6250898838043213e-01 -2.4627109989523888e-02 + <_> + + 0 -1 1918 -1.6778679564595222e-02 + + -4.2436981201171875e-01 2.2607849910855293e-02 + <_> + + 0 -1 1919 5.2477661520242691e-02 + + -1.6188420355319977e-02 3.1766140460968018e-01 + <_> + + 0 -1 1920 1.0443729907274246e-01 + + 1.1290200054645538e-02 -8.6021018028259277e-01 + <_> + + 0 -1 1921 -6.5574781037867069e-03 + + 1.2225849926471710e-01 -5.6091431528329849e-02 + <_> + + 0 -1 1922 1.6797389835119247e-02 + + 3.5811539739370346e-02 -3.1163010001182556e-01 + <_> + + 0 -1 1923 5.0427159294486046e-03 + + -5.0439529120922089e-02 6.3930332660675049e-02 + <_> + + 0 -1 1924 -3.4571789205074310e-02 + + -5.6278371810913086e-01 1.6692740842700005e-02 + <_> + + 0 -1 1925 3.7999521009624004e-03 + + -6.8566747009754181e-02 9.6017867326736450e-02 + <_> + + 0 -1 1926 -1.1995599605143070e-02 + + 1.3819910585880280e-01 -7.1510016918182373e-02 + <_> + + 0 -1 1927 1.1098429560661316e-02 + + 5.3506620228290558e-02 -1.0482089966535568e-01 + <_> + + 0 -1 1928 -1.2905290722846985e-01 + + -6.7262178659439087e-01 1.5195850282907486e-02 + <_> + + 0 -1 1929 6.3130040653049946e-03 + + -6.1030130833387375e-02 1.0355649888515472e-01 + <_> + + 0 -1 1930 4.0955888107419014e-03 + + 7.0534646511077881e-02 -1.4484269917011261e-01 + <_> + + 0 -1 1931 -1.0530550032854080e-02 + + 9.8569639027118683e-02 -3.7973210215568542e-02 + <_> + + 0 -1 1932 3.6035990342497826e-03 + + 5.1277790218591690e-02 -1.8671560287475586e-01 + <_> + + 0 -1 1933 1.1999369598925114e-03 + + -6.3231408596038818e-02 1.0446310043334961e-01 + <_> + + 0 -1 1934 -1.9585370318964124e-04 + + 8.6044862866401672e-02 -1.1856850236654282e-01 + <_> + + 0 -1 1935 -1.2213560193777084e-01 + + -8.8419800996780396e-01 6.3145011663436890e-03 + <_> + + 0 -1 1936 -7.7650691382586956e-03 + + 1.3725960254669189e-01 -8.0412857234477997e-02 + <_> + + 0 -1 1937 1.5734319388866425e-01 + + 1.2743320316076279e-02 -6.5401297807693481e-01 + <_> + + 0 -1 1938 -7.6066371984779835e-03 + + -1.3797719776630402e-01 7.6062493026256561e-02 + <_> + + 0 -1 1939 -4.3096300214529037e-03 + + 1.1195199936628342e-01 -3.2390709966421127e-02 + <_> + + 0 -1 1940 -3.2239840365946293e-03 + + 2.1420599520206451e-01 -5.8244630694389343e-02 + <_> + + 0 -1 1941 8.3754826337099075e-03 + + 4.7615598887205124e-02 -2.4216049909591675e-01 + <_> + + 0 -1 1942 3.0904430896043777e-03 + + -9.0418681502342224e-02 9.9244832992553711e-02 + <_> + + 0 -1 1943 9.8243616521358490e-03 + + -4.4643919914960861e-02 1.0423039644956589e-01 + <_> + + 0 -1 1944 -3.2808810938149691e-03 + + -1.9123159348964691e-01 6.3141517341136932e-02 + <_> + + 0 -1 1945 3.6370379384607077e-03 + + 3.6944739520549774e-02 -1.1988619714975357e-01 + <_> + + 0 -1 1946 7.8952945768833160e-03 + + -7.1313530206680298e-02 1.6107399761676788e-01 + <_> + + 0 -1 1947 -3.3853040076792240e-03 + + -1.1704929918050766e-01 2.5579249486327171e-02 + <_> + + 0 -1 1948 -2.6786550879478455e-03 + + -1.7064009606838226e-01 6.0627460479736328e-02 + <_> + + 0 -1 1949 -4.5887688174843788e-03 + + 3.4779790788888931e-02 -6.8817831575870514e-02 + <_> + + 0 -1 1950 -6.1642300337553024e-02 + + 5.1108109951019287e-01 -1.9752239808440208e-02 + <_> + + 0 -1 1951 2.5235159322619438e-02 + + 2.0203070715069771e-02 -3.4359911084175110e-01 + <_> + + 0 -1 1952 -2.1312809549272060e-03 + + 5.4698210209608078e-02 -1.6512370109558105e-01 + <_> + + 0 -1 1953 -8.2598842680454254e-02 + + 3.3804669976234436e-01 -2.8026569634675980e-02 + <_> + + 0 -1 1954 -5.6678601540625095e-03 + + -3.3786231279373169e-01 2.9727049171924591e-02 + <_> + + 0 -1 1955 -9.3317396938800812e-02 + + -6.7238032817840576e-01 2.0025020930916071e-03 + <_> + + 0 -1 1956 9.2052231775596738e-04 + + -1.3974259793758392e-01 6.3175596296787262e-02 + <_> + + 0 -1 1957 5.1411538152024150e-04 + + -8.1585250794887543e-02 5.9324279427528381e-02 + <_> + + 0 -1 1958 -6.7130490206182003e-03 + + -1.6645990312099457e-01 6.1560809612274170e-02 + <_> + + 0 -1 1959 3.1578689813613892e-03 + + -1.0710070282220840e-01 6.6695116460323334e-02 + <_> + + 0 -1 1960 1.2202030047774315e-02 + + -2.4845300242304802e-02 4.2458030581474304e-01 + <_> + + 0 -1 1961 -2.8585169464349747e-02 + + 2.3526839911937714e-01 -2.1121440455317497e-02 + <_> + + 0 -1 1962 2.3390499409288168e-03 + + 6.4441107213497162e-02 -1.4063580334186554e-01 + <_> + + 0 -1 1963 3.5900938510894775e-01 + + 1.2122919782996178e-02 -7.3121142387390137e-01 + <_> + + 0 -1 1964 7.6048658229410648e-03 + + -4.0700931102037430e-02 2.3581039905548096e-01 + <_> + + 0 -1 1965 4.4263368472456932e-03 + + 5.3039629012346268e-02 -1.5912020206451416e-01 + <_> + + 0 -1 1966 8.5811351891607046e-04 + + -8.5265956819057465e-02 1.0489220172166824e-01 + <_> + + 0 -1 1967 -4.2959367856383324e-03 + + -1.2851840257644653e-01 6.2752753496170044e-02 + <_> + + 0 -1 1968 4.4881720095872879e-03 + + 6.4671441912651062e-02 -1.8789650499820709e-01 + <_> + + 0 -1 1969 -4.9869619309902191e-02 + + 2.1496759355068207e-01 -3.5577021539211273e-02 + <_> + + 0 -1 1970 -1.1942230165004730e-01 + + -6.7953938245773315e-01 1.5091570094227791e-02 + <_> + + 0 -1 1971 6.2965508550405502e-04 + + -9.2145420610904694e-02 6.1806648969650269e-02 + <_> + + 0 -1 1972 2.9381969943642616e-03 + + 1.7903240025043488e-01 -4.9355998635292053e-02 + <_> + + 0 -1 1973 -2.2860679775476456e-02 + + 2.0976249873638153e-01 -3.1370889395475388e-02 + <_> + + 0 -1 1974 4.3369621038436890e-02 + + 1.8286330625414848e-02 -5.1288998126983643e-01 + <_> + + 0 -1 1975 1.9932509958744049e-01 + + 6.7204708466306329e-04 -8.9769357442855835e-01 + <_> + + 0 -1 1976 8.0751203000545502e-02 + + -2.0869649946689606e-02 4.3768700957298279e-01 + <_> + + 0 -1 1977 1.5349129680544138e-03 + + 3.6761760711669922e-02 -2.2203999757766724e-01 + <_> + + 0 -1 1978 -3.6580949090421200e-03 + + -1.5471710264682770e-01 6.7229896783828735e-02 + <_> + + 0 -1 1979 2.4743290618062019e-02 + + -5.5474709719419479e-02 1.7429579794406891e-01 + <_> + + 0 -1 1980 -1.6451500356197357e-02 + + 1.8817320466041565e-01 -5.5719010531902313e-02 + <_> + + 0 -1 1981 -8.4505761042237282e-03 + + -3.2943668961524963e-01 2.2743720561265945e-02 + <_> + + 0 -1 1982 2.9369179159402847e-02 + + 1.5479310415685177e-02 -5.9099632501602173e-01 + <_> + + 0 -1 1983 1.0524799674749374e-01 + + 2.1177560556679964e-03 -4.9212720990180969e-01 + <_> + + 0 -1 1984 -2.7816150337457657e-02 + + 3.6421439051628113e-01 -2.5163119658827782e-02 + <_> + + 0 -1 1985 5.3339339792728424e-03 + + -4.8402350395917892e-02 3.9851561188697815e-02 + <_> + + 0 -1 1986 1.1682730168104172e-02 + + 2.4898340925574303e-02 -3.5719999670982361e-01 + <_> + + 0 -1 1987 8.9094992727041245e-03 + + 4.6579260379076004e-02 -1.5088100731372833e-01 + <_> + + 0 -1 1988 7.3203681968152523e-03 + + 7.0891879498958588e-02 -1.3278549909591675e-01 + <_> + + 0 -1 1989 -2.0311130210757256e-02 + + 1.7783379554748535e-01 -3.7538051605224609e-02 + <_> + + 0 -1 1990 1.3689160114154220e-03 + + -1.2096449732780457e-01 7.8017823398113251e-02 + <_> + + 0 -1 1991 7.6994091272354126e-02 + + -8.7762605398893356e-03 3.2993561029434204e-01 + <_> + + 0 -1 1992 8.8949268683791161e-03 + + -5.5553250014781952e-02 1.6372109949588776e-01 + <_> + + 0 -1 1993 -1.8518440425395966e-02 + + -1.4479570090770721e-01 3.0250260606408119e-02 + <_> + + 0 -1 1994 -4.0174879133701324e-02 + + -2.4990509450435638e-01 4.0788788348436356e-02 + <_> + + 0 -1 1995 6.5176486968994141e-02 + + -1.4393090270459652e-02 3.7707069516181946e-01 + <_> + + 0 -1 1996 -1.4845930039882660e-02 + + 2.7375608682632446e-01 -3.3898409456014633e-02 + <_> + + 0 -1 1997 -6.1434650421142578e-01 + + -6.9167751073837280e-01 4.0905540809035301e-03 + <_> + + 0 -1 1998 1.4119890332221985e-01 + + 1.6643870621919632e-02 -5.8944582939147949e-01 + <_> + 157 + -1.5337220430374146e+00 + + <_> + + 0 -1 1999 2.1962670609354973e-02 + + -3.0903491377830505e-01 2.1529789268970490e-01 + <_> + + 0 -1 2000 5.1272530108690262e-02 + + -2.2286629676818848e-01 2.9869711399078369e-01 + <_> + + 0 -1 2001 4.1870009154081345e-02 + + -2.7849119901657104e-01 2.0416070520877838e-01 + <_> + + 0 -1 2002 6.7551871761679649e-03 + + -2.1988549828529358e-01 7.3887020349502563e-02 + <_> + + 0 -1 2003 1.7311690375208855e-02 + + -3.4227430820465088e-01 1.3190160691738129e-01 + <_> + + 0 -1 2004 1.5399109572172165e-02 + + -2.3149499297142029e-01 1.8828059732913971e-01 + <_> + + 0 -1 2005 -1.0792730376124382e-02 + + -3.0813691020011902e-01 1.1191529780626297e-01 + <_> + + 0 -1 2006 8.5879449034109712e-04 + + 7.2238206863403320e-02 -4.4624349474906921e-01 + <_> + + 0 -1 2007 9.2791311908513308e-04 + + -2.9247429966926575e-01 9.3132883310317993e-02 + <_> + + 0 -1 2008 -8.5785696282982826e-03 + + 2.0642790198326111e-01 -1.1203339695930481e-01 + <_> + + 0 -1 2009 -1.8951490521430969e-02 + + -3.9317628741264343e-01 6.7260466516017914e-02 + <_> + + 0 -1 2010 3.4939948469400406e-02 + + 2.8045989573001862e-02 -5.7410031557083130e-01 + <_> + + 0 -1 2011 -4.2870659381151199e-02 + + -5.9856891632080078e-01 3.4607890993356705e-02 + <_> + + 0 -1 2012 5.4958608234301209e-04 + + -4.1193041205406189e-01 6.7322418093681335e-02 + <_> + + 0 -1 2013 2.2494920995086432e-03 + + 1.3482889533042908e-01 -1.9777689874172211e-01 + <_> + + 0 -1 2014 -9.2442613095045090e-03 + + -1.7850719392299652e-01 7.6734513044357300e-02 + <_> + + 0 -1 2015 1.2210760032758117e-03 + + -3.4616300463676453e-01 7.5431950390338898e-02 + <_> + + 0 -1 2016 1.3654090464115143e-02 + + 7.7861636877059937e-02 -4.3963378667831421e-01 + <_> + + 0 -1 2017 1.7332829535007477e-02 + + 4.8317600041627884e-02 -4.1461798548698425e-01 + <_> + + 0 -1 2018 -1.6807779669761658e-02 + + 2.3211599886417389e-01 -8.2342058420181274e-02 + <_> + + 0 -1 2019 3.2203171402215958e-02 + + 3.4065268933773041e-02 -5.9796607494354248e-01 + <_> + + 0 -1 2020 1.6777820885181427e-02 + + -5.9402968734502792e-02 1.6782909631729126e-01 + <_> + + 0 -1 2021 1.3074859976768494e-02 + + -1.0592609643936157e-01 2.3796890676021576e-01 + <_> + + 0 -1 2022 9.4082832336425781e-02 + + 1.0573189705610275e-02 -5.3249269723892212e-01 + <_> + + 0 -1 2023 -7.6036658138036728e-03 + + -2.3031429946422577e-01 1.0104469954967499e-01 + <_> + + 0 -1 2024 8.2368071889504790e-04 + + 4.6598970890045166e-02 -1.0087580233812332e-01 + <_> + + 0 -1 2025 -7.6875449158251286e-03 + + -2.6123398542404175e-01 7.3543973267078400e-02 + <_> + + 0 -1 2026 -3.3729180693626404e-02 + + 2.1907149255275726e-01 -2.1958939731121063e-02 + <_> + + 0 -1 2027 1.3204690068960190e-02 + + -1.4203189313411713e-01 1.5107029676437378e-01 + <_> + + 0 -1 2028 8.5354369366541505e-04 + + -2.4303670227527618e-01 8.3283171057701111e-02 + <_> + + 0 -1 2029 -1.4071330428123474e-02 + + -3.6977100372314453e-01 5.5142328143119812e-02 + <_> + + 0 -1 2030 -1.1115919798612595e-02 + + -4.6575489640235901e-01 2.7285559102892876e-02 + <_> + + 0 -1 2031 1.3858900405466557e-02 + + -9.1722346842288971e-02 1.9947899878025055e-01 + <_> + + 0 -1 2032 8.5548251867294312e-02 + + 2.6189789175987244e-02 -3.6603820323944092e-01 + <_> + + 0 -1 2033 -1.9484929740428925e-02 + + 1.7259980738162994e-01 -8.9445300400257111e-02 + <_> + + 0 -1 2034 2.1631179377436638e-02 + + -5.6183289736509323e-02 6.7707277834415436e-02 + <_> + + 0 -1 2035 1.9267840310931206e-02 + + 5.5609680712223053e-02 -2.9480481147766113e-01 + <_> + + 0 -1 2036 1.1855900287628174e-02 + + 6.8580061197280884e-02 -2.7094689011573792e-01 + <_> + + 0 -1 2037 1.7135039670392871e-03 + + -1.5590840578079224e-01 9.4477489590644836e-02 + <_> + + 0 -1 2038 6.2993362545967102e-02 + + 2.9042679816484451e-02 -2.5151410698890686e-01 + <_> + + 0 -1 2039 1.7328880727291107e-02 + + -4.3562661856412888e-02 3.4017661213874817e-01 + <_> + + 0 -1 2040 2.4053089320659637e-02 + + 3.7450179457664490e-02 -2.8990021347999573e-01 + <_> + + 0 -1 2041 2.1294029429554939e-02 + + 4.8889711499214172e-02 -3.6390760540962219e-01 + <_> + + 0 -1 2042 9.2860676348209381e-02 + + -3.6604419350624084e-02 3.2365238666534424e-01 + <_> + + 0 -1 2043 2.1167730446904898e-03 + + 8.7506070733070374e-02 -1.8339939415454865e-01 + <_> + + 0 -1 2044 -8.7125040590763092e-02 + + -4.6162751317024231e-01 3.1342040747404099e-02 + <_> + + 0 -1 2045 1.9298809766769409e-01 + + 2.9041619971394539e-02 -4.4543629884719849e-01 + <_> + + 0 -1 2046 -2.4475890313624404e-05 + + 5.9352759271860123e-02 -2.0239880681037903e-01 + <_> + + 0 -1 2047 -3.4894149750471115e-02 + + -4.5676550269126892e-01 3.5249751061201096e-02 + <_> + + 0 -1 2048 1.9192209839820862e-01 + + -4.0733739733695984e-02 1.5444849431514740e-01 + <_> + + 0 -1 2049 -2.3085139691829681e-02 + + 7.1740321815013885e-02 -2.0493650436401367e-01 + <_> + + 0 -1 2050 2.9535569250583649e-02 + + 4.0762118995189667e-02 -3.6926439404487610e-01 + <_> + + 0 -1 2051 -3.6492519080638885e-02 + + -5.4941332340240479e-01 2.5431329384446144e-02 + <_> + + 0 -1 2052 4.0696229785680771e-02 + + 1.0515309870243073e-02 -4.9906229972839355e-01 + <_> + + 0 -1 2053 -3.6384560167789459e-02 + + -2.4736070632934570e-01 5.3187850862741470e-02 + <_> + + 0 -1 2054 3.7000048905611038e-02 + + -4.6731691807508469e-02 3.0095300078392029e-01 + <_> + + 0 -1 2055 3.7872981280088425e-02 + + 4.5600850135087967e-02 -3.3789730072021484e-01 + <_> + + 0 -1 2056 -1.6164340078830719e-02 + + 1.9655610620975494e-01 -5.6567810475826263e-02 + <_> + + 0 -1 2057 2.4253420531749725e-01 + + 3.7772599607706070e-02 -3.6190840601921082e-01 + <_> + + 0 -1 2058 -1.7429869621992111e-02 + + 7.8519687056541443e-02 -1.9835950806736946e-02 + <_> + + 0 -1 2059 1.4150669798254967e-02 + + -1.5143400430679321e-01 1.2028410285711288e-01 + <_> + + 0 -1 2060 6.3771687448024750e-02 + + 6.8969810381531715e-03 -8.0511492490768433e-01 + <_> + + 0 -1 2061 1.1273720301687717e-03 + + -2.6931971311569214e-01 5.2550218999385834e-02 + <_> + + 0 -1 2062 -3.8293499499559402e-02 + + 2.0563830435276031e-01 -2.1474370732903481e-02 + <_> + + 0 -1 2063 5.0103109329938889e-02 + + 2.3352440446615219e-02 -5.4645192623138428e-01 + <_> + + 0 -1 2064 -4.0057931095361710e-02 + + 2.4553330242633820e-01 -3.3474709838628769e-02 + <_> + + 0 -1 2065 1.8415290862321854e-02 + + -7.5977481901645660e-02 1.8510019779205322e-01 + <_> + + 0 -1 2066 1.0548150166869164e-02 + + 6.6050186753273010e-02 -6.4367741346359253e-02 + <_> + + 0 -1 2067 7.3007687926292419e-02 + + -2.6471909135580063e-02 4.6508520841598511e-01 + <_> + + 0 -1 2068 -3.4658040851354599e-02 + + 2.7848151326179504e-01 -4.6662889420986176e-02 + <_> + + 0 -1 2069 1.6924630850553513e-02 + + 1.1554700136184692e-01 -1.1504360288381577e-01 + <_> + + 0 -1 2070 -7.4245870113372803e-02 + + -4.3072721362113953e-01 1.6461249440908432e-02 + <_> + + 0 -1 2071 -7.3406308889389038e-02 + + -5.6626558303833008e-01 2.3453989997506142e-02 + <_> + + 0 -1 2072 1.2397419661283493e-01 + + -5.4616708308458328e-02 1.0024350136518478e-01 + <_> + + 0 -1 2073 -1.6235560178756714e-02 + + -1.9912120699882507e-01 6.8537697196006775e-02 + <_> + + 0 -1 2074 -3.0137969180941582e-02 + + -3.3398950099945068e-01 2.2806070744991302e-02 + <_> + + 0 -1 2075 -8.1836536526679993e-02 + + 4.0628650784492493e-01 -3.7828210741281509e-02 + <_> + + 0 -1 2076 5.2240878343582153e-01 + + 1.8094440922141075e-02 -4.3477010726928711e-01 + <_> + + 0 -1 2077 1.4845579862594604e-02 + + -7.0279222726821899e-01 1.9977509975433350e-02 + <_> + + 0 -1 2078 -5.5507790297269821e-02 + + 5.1214778423309326e-01 -2.8097610920667648e-02 + <_> + + 0 -1 2079 -2.7078049257397652e-02 + + 3.0834761261940002e-01 -4.0676809847354889e-02 + <_> + + 0 -1 2080 -2.4416339583694935e-03 + + -1.2054579704999924e-01 5.9857279062271118e-02 + <_> + + 0 -1 2081 1.5043720602989197e-01 + + -6.0036379843950272e-02 2.2021989524364471e-01 + <_> + + 0 -1 2082 -4.1030261665582657e-02 + + -3.3254709839820862e-01 2.5029130280017853e-02 + <_> + + 0 -1 2083 1.4609499834477901e-02 + + 5.1357660442590714e-02 -2.8190329670906067e-01 + <_> + + 0 -1 2084 1.2588420510292053e-01 + + 6.7158509045839310e-03 -4.9155730009078979e-01 + <_> + + 0 -1 2085 -3.7784978747367859e-02 + + 5.1675951480865479e-01 -2.7236010879278183e-02 + <_> + + 0 -1 2086 -1.8090210855007172e-02 + + -3.5778409242630005e-01 3.5485059022903442e-02 + <_> + + 0 -1 2087 -3.9881139993667603e-02 + + -4.8079541325569153e-01 2.7166770771145821e-02 + <_> + + 0 -1 2088 7.3324372060596943e-03 + + -5.3297691047191620e-02 1.1757290363311768e-01 + <_> + + 0 -1 2089 -6.9262558827176690e-04 + + -1.4501209557056427e-01 9.2885218560695648e-02 + <_> + + 0 -1 2090 -8.2166977226734161e-02 + + 2.3127609491348267e-01 -5.6990649551153183e-02 + <_> + + 0 -1 2091 3.8556379731744528e-03 + + 9.5330670475959778e-02 -1.5586289763450623e-01 + <_> + + 0 -1 2092 -7.4245668947696686e-03 + + -2.7692940831184387e-01 3.5343449562788010e-02 + <_> + + 0 -1 2093 2.2808350622653961e-02 + + 4.6904660761356354e-02 -3.3659911155700684e-01 + <_> + + 0 -1 2094 8.2916222512722015e-02 + + 2.8655149508267641e-03 -5.2691662311553955e-01 + <_> + + 0 -1 2095 -5.2402060478925705e-02 + + -6.9835901260375977e-01 1.8587840721011162e-02 + <_> + + 0 -1 2096 1.5193739905953407e-02 + + -6.0126390308141708e-02 2.5917008519172668e-01 + <_> + + 0 -1 2097 -1.4240809716284275e-02 + + 2.7056190371513367e-01 -6.4629502594470978e-02 + <_> + + 0 -1 2098 -3.2158840913325548e-03 + + -9.3549117445945740e-02 2.8090029954910278e-02 + <_> + + 0 -1 2099 4.7198659740388393e-03 + + -1.8783959746360779e-01 7.1021787822246552e-02 + <_> + + 0 -1 2100 -2.5415599346160889e-02 + + -3.3236810564994812e-01 4.0915489196777344e-02 + <_> + + 0 -1 2101 4.2758490890264511e-02 + + 2.6150930672883987e-02 -5.1128530502319336e-01 + <_> + + 0 -1 2102 4.2231049388647079e-02 + + -2.1398520097136497e-02 1.7453899979591370e-01 + <_> + + 0 -1 2103 -2.0674670115113258e-02 + + 2.5898760557174683e-01 -5.6440889835357666e-02 + <_> + + 0 -1 2104 2.8976969420909882e-02 + + -2.0763730630278587e-02 9.6909962594509125e-02 + <_> + + 0 -1 2105 3.4173950552940369e-03 + + 9.3572951853275299e-02 -1.5996080636978149e-01 + <_> + + 0 -1 2106 6.7922919988632202e-02 + + 1.6243519261479378e-02 -7.4624717235565186e-01 + <_> + + 0 -1 2107 -9.0270619839429855e-03 + + 3.3382698893547058e-01 -3.8774389773607254e-02 + <_> + + 0 -1 2108 -2.8317999094724655e-02 + + -3.6276119947433472e-01 2.3800129070878029e-02 + <_> + + 0 -1 2109 -1.5302050160244107e-03 + + -1.8413589894771576e-01 7.0150263607501984e-02 + <_> + + 0 -1 2110 8.4196459501981735e-03 + + 9.0586692094802856e-02 -6.1134628951549530e-02 + <_> + + 0 -1 2111 4.4346109032630920e-02 + + 6.1388049274682999e-02 -2.1231949329376221e-01 + <_> + + 0 -1 2112 2.5921100750565529e-02 + + -3.5028610378503799e-02 2.2107489407062531e-01 + <_> + + 0 -1 2113 -6.0503371059894562e-03 + + -3.2179000973701477e-01 3.9333820343017578e-02 + <_> + + 0 -1 2114 -2.5171019136905670e-02 + + 6.9517672061920166e-01 -1.8360199406743050e-02 + <_> + + 0 -1 2115 -5.2073050290346146e-02 + + -7.4727028608322144e-01 1.9030340015888214e-02 + <_> + + 0 -1 2116 -1.3639439828693867e-02 + + -6.2003239989280701e-02 4.1589640080928802e-02 + <_> + + 0 -1 2117 -3.8377299904823303e-02 + + 3.8518410921096802e-01 -3.1509511172771454e-02 + <_> + + 0 -1 2118 -1.4677719771862030e-01 + + -6.0099261999130249e-01 1.0989420115947723e-02 + <_> + + 0 -1 2119 2.0508460700511932e-02 + + 5.6464750319719315e-02 -2.5149369239807129e-01 + <_> + + 0 -1 2120 2.3784590885043144e-02 + + 5.8459620922803879e-02 -2.2233340144157410e-01 + <_> + + 0 -1 2121 1.8658170476555824e-02 + + -7.3706217110157013e-02 1.8556639552116394e-01 + <_> + + 0 -1 2122 -2.6653500273823738e-02 + + 2.1061730384826660e-01 -6.8629503250122070e-02 + <_> + + 0 -1 2123 -7.5975798070430756e-02 + + -4.8535370826721191e-01 2.7239590883255005e-02 + <_> + + 0 -1 2124 5.3205721080303192e-02 + + 5.1950141787528992e-03 -4.7940468788146973e-01 + <_> + + 0 -1 2125 4.1206479072570801e-02 + + 1.9166460260748863e-02 -6.4439648389816284e-01 + <_> + + 0 -1 2126 2.2624490782618523e-02 + + 1.7490459606051445e-02 -2.0645530521869659e-01 + <_> + + 0 -1 2127 2.1147429943084717e-02 + + -3.2944951206445694e-02 3.5154509544372559e-01 + <_> + + 0 -1 2128 1.3374770060181618e-02 + + 4.0784850716590881e-02 -1.9725930690765381e-01 + <_> + + 0 -1 2129 4.2831092141568661e-03 + + -8.5159152746200562e-02 1.4025710523128510e-01 + <_> + + 0 -1 2130 6.3718900084495544e-02 + + -4.9198199994862080e-03 4.5491519570350647e-01 + <_> + + 0 -1 2131 1.2082169763743877e-02 + + 5.3176809102296829e-02 -2.6156601309776306e-01 + <_> + + 0 -1 2132 1.8195409327745438e-02 + + -3.8999419659376144e-02 3.3412361145019531e-01 + <_> + + 0 -1 2133 2.8948329389095306e-02 + + 3.9750248193740845e-02 -3.4182530641555786e-01 + <_> + + 0 -1 2134 -9.3633607029914856e-02 + + -9.4571298360824585e-01 3.0850030016154051e-03 + <_> + + 0 -1 2135 3.4850560128688812e-02 + + 3.1342729926109314e-02 -3.5700461268424988e-01 + <_> + + 0 -1 2136 1.2895749509334564e-01 + + -3.9653491228818893e-02 3.7412929534912109e-01 + <_> + + 0 -1 2137 2.3297289386391640e-02 + + 2.5941710919141769e-02 -4.7231191396713257e-01 + <_> + + 0 -1 2138 1.5667669475078583e-02 + + -8.1445790827274323e-02 1.5750789642333984e-01 + <_> + + 0 -1 2139 1.1425570119172335e-03 + + 6.3901476562023163e-02 -2.0547799766063690e-01 + <_> + + 0 -1 2140 -5.5744551122188568e-02 + + -3.4481841325759888e-01 1.1300710029900074e-02 + <_> + + 0 -1 2141 -9.2509537935256958e-02 + + 8.9074200391769409e-01 -1.5398530289530754e-02 + <_> + + 0 -1 2142 -5.5660872021690011e-04 + + 8.7056189775466919e-02 -5.1321998238563538e-02 + <_> + + 0 -1 2143 -1.4538520015776157e-02 + + -4.5140060782432556e-01 2.8146119788289070e-02 + <_> + + 0 -1 2144 -3.7515729665756226e-02 + + -7.3286539316177368e-01 6.7265569232404232e-03 + <_> + + 0 -1 2145 -1.5516959829255939e-03 + + 9.1213479638099670e-02 -1.3395330309867859e-01 + <_> + + 0 -1 2146 -9.5461420714855194e-02 + + -9.5529359579086304e-01 2.3820339702069759e-03 + <_> + + 0 -1 2147 -1.2917599640786648e-02 + + 2.7040511369705200e-01 -4.6904701739549637e-02 + <_> + + 0 -1 2148 7.9802395775914192e-03 + + 5.5390980094671249e-02 -2.0667399466037750e-01 + <_> + + 0 -1 2149 6.6025177948176861e-03 + + 6.6448308527469635e-02 -1.9922210276126862e-01 + <_> + + 0 -1 2150 1.7824679613113403e-02 + + -1.4532490074634552e-01 8.9904323220252991e-02 + <_> + + 0 -1 2151 -2.3261539638042450e-02 + + 4.8062869906425476e-01 -2.7084289118647575e-02 + <_> + + 0 -1 2152 -5.3659449331462383e-03 + + -1.9143599271774292e-01 7.0398069918155670e-02 + <_> + + 0 -1 2153 -2.0775340497493744e-02 + + 1.6774240136146545e-01 -8.9455418288707733e-02 + <_> + + 0 -1 2154 6.2107890844345093e-02 + + 1.2815490365028381e-02 -6.4452892541885376e-01 + <_> + + 0 -1 2155 -4.4327871873974800e-03 + + 1.3405950367450714e-01 -1.0231850296258926e-01 + <_> + 210 + -1.4604519605636597e+00 + + <_> + + 0 -1 2156 -4.6693067997694016e-03 + + 1.4297600090503693e-01 -3.5293748974800110e-01 + <_> + + 0 -1 2157 -5.8510829694569111e-04 + + -2.2447289526462555e-01 7.3556646704673767e-02 + <_> + + 0 -1 2158 -3.4788011107593775e-03 + + 1.0603249818086624e-01 -2.5625610351562500e-01 + <_> + + 0 -1 2159 6.2952568987384439e-04 + + 4.1076458990573883e-02 -3.6061421036720276e-01 + <_> + + 0 -1 2160 2.1010650380048901e-04 + + -2.4425220489501953e-01 1.0942090302705765e-01 + <_> + + 0 -1 2161 -2.6671579107642174e-03 + + 8.4581501781940460e-02 -2.7449008822441101e-01 + <_> + + 0 -1 2162 7.1533219888806343e-03 + + -1.2603819370269775e-01 2.0079800486564636e-01 + <_> + + 0 -1 2163 -2.3616119287908077e-03 + + 1.6627199947834015e-01 -1.3186289370059967e-01 + <_> + + 0 -1 2164 3.9599660784006119e-02 + + 5.5119238793849945e-02 -3.4003400802612305e-01 + <_> + + 0 -1 2165 1.9385309424251318e-03 + + -2.0686650276184082e-01 1.0400419682264328e-01 + <_> + + 0 -1 2166 4.3686539866030216e-03 + + 6.4766593277454376e-02 -2.7426311373710632e-01 + <_> + + 0 -1 2167 -3.9834968629293144e-04 + + 5.2820999175310135e-02 -2.2684779763221741e-01 + <_> + + 0 -1 2168 -5.2277399227023125e-03 + + -2.5515750050544739e-01 7.6405368745326996e-02 + <_> + + 0 -1 2169 -1.0445619933307171e-02 + + 1.3513970375061035e-01 -5.0032071769237518e-02 + <_> + + 0 -1 2170 -2.0478919614106417e-03 + + -2.7669870853424072e-01 5.4732039570808411e-02 + <_> + + 0 -1 2171 9.1795288026332855e-03 + + -1.2642470002174377e-01 1.9979229569435120e-01 + <_> + + 0 -1 2172 9.4128772616386414e-04 + + -4.0286481380462646e-01 3.8918491452932358e-02 + <_> + + 0 -1 2173 -4.0410319343209267e-03 + + -2.0108319818973541e-01 5.1456429064273834e-02 + <_> + + 0 -1 2174 -1.2742569670081139e-02 + + 2.2716869413852692e-01 -6.8204790353775024e-02 + <_> + + 0 -1 2175 -4.6246009878814220e-03 + + -2.5854289531707764e-01 7.8878343105316162e-02 + <_> + + 0 -1 2176 -6.4845927990972996e-03 + + -3.1391140818595886e-01 7.1605153381824493e-02 + <_> + + 0 -1 2177 -4.8291690647602081e-02 + + 2.5488480925559998e-01 -2.1891580894589424e-02 + <_> + + 0 -1 2178 8.4315962158143520e-04 + + -1.6529269516468048e-01 8.9575611054897308e-02 + <_> + + 0 -1 2179 -1.0773389786481857e-01 + + -6.0115939378738403e-01 3.3779250225052238e-04 + <_> + + 0 -1 2180 -4.5969419181346893e-02 + + 3.6489740014076233e-01 -3.9942290633916855e-02 + <_> + + 0 -1 2181 -1.6649639233946800e-02 + + -1.1858119815587997e-01 1.0585139691829681e-01 + <_> + + 0 -1 2182 -1.4521550387144089e-02 + + -3.7954211235046387e-01 3.4867148846387863e-02 + <_> + + 0 -1 2183 1.3591590104624629e-03 + + -2.3180609941482544e-01 5.0401471555233002e-02 + <_> + + 0 -1 2184 -5.8343587443232536e-04 + + -2.8496581315994263e-01 4.0894281119108200e-02 + <_> + + 0 -1 2185 7.9833306372165680e-03 + + -3.6992359906435013e-02 1.6985300183296204e-01 + <_> + + 0 -1 2186 9.9762203171849251e-04 + + 6.4871042966842651e-02 -1.8648339807987213e-01 + <_> + + 0 -1 2187 -4.6869087964296341e-03 + + 7.6987423002719879e-02 -8.1482626497745514e-02 + <_> + + 0 -1 2188 3.0047740787267685e-02 + + -2.9839929193258286e-02 4.3676841259002686e-01 + <_> + + 0 -1 2189 1.8069539219141006e-02 + + 2.7509700506925583e-02 -4.2724269628524780e-01 + <_> + + 0 -1 2190 -1.5088430047035217e-01 + + -6.7918521165847778e-01 1.8012860789895058e-02 + <_> + + 0 -1 2191 -2.5836290791630745e-02 + + 2.5797989964485168e-01 -3.5906858742237091e-02 + <_> + + 0 -1 2192 1.8183529376983643e-02 + + 3.5895019769668579e-02 -3.7197691202163696e-01 + <_> + + 0 -1 2193 6.3127309083938599e-02 + + -7.3392972350120544e-02 1.2563429772853851e-01 + <_> + + 0 -1 2194 -6.6507689189165831e-04 + + 8.5442617535591125e-02 -1.5228550136089325e-01 + <_> + + 0 -1 2195 1.0104980319738388e-02 + + 3.4569118171930313e-02 -2.2657699882984161e-01 + <_> + + 0 -1 2196 -1.2355949729681015e-02 + + 1.5785010159015656e-01 -7.4710778892040253e-02 + <_> + + 0 -1 2197 1.5728179365396500e-02 + + 6.8844422698020935e-02 -1.6961769759654999e-01 + <_> + + 0 -1 2198 1.5084549886523746e-05 + + -1.3695539534091949e-01 9.0837597846984863e-02 + <_> + + 0 -1 2199 2.9634479433298111e-02 + + 4.9822349101305008e-02 -2.6809689402580261e-01 + <_> + + 0 -1 2200 2.8015200048685074e-02 + + -8.1799760460853577e-02 1.7842799425125122e-01 + <_> + + 0 -1 2201 2.3299450986087322e-03 + + 6.9535210728645325e-02 -1.8205040693283081e-01 + <_> + + 0 -1 2202 1.3453120365738869e-02 + + -7.0231497287750244e-02 1.8492579460144043e-01 + <_> + + 0 -1 2203 1.4049040153622627e-02 + + 7.6328299939632416e-02 -1.7219689488410950e-01 + <_> + + 0 -1 2204 -1.4648989774286747e-02 + + 3.4281060099601746e-01 -4.3134819716215134e-02 + <_> + + 0 -1 2205 1.4879769878461957e-04 + + -2.7614209055900574e-01 7.3140732944011688e-02 + <_> + + 0 -1 2206 -6.8892319686710835e-03 + + -1.8386749923229218e-01 6.5872021019458771e-02 + <_> + + 0 -1 2207 1.2898260029032826e-03 + + -1.1688020080327988e-01 1.1173330247402191e-01 + <_> + + 0 -1 2208 -2.5763860321603715e-04 + + 8.9391976594924927e-02 -1.4183540642261505e-01 + <_> + + 0 -1 2209 1.3652349822223186e-02 + + 2.5085829198360443e-02 -1.7959770560264587e-01 + <_> + + 0 -1 2210 -5.7484027929604053e-03 + + 1.6128179430961609e-01 -7.9023167490959167e-02 + <_> + + 0 -1 2211 -1.1682719923555851e-02 + + -1.8493950366973877e-01 4.5419961214065552e-02 + <_> + + 0 -1 2212 2.7498970739543438e-03 + + -6.5800942480564117e-02 1.9426700472831726e-01 + <_> + + 0 -1 2213 -1.1797569459304214e-03 + + 5.3563870489597321e-02 -5.5225171148777008e-02 + <_> + + 0 -1 2214 -3.7005849182605743e-02 + + -5.1369887590408325e-01 2.4779239669442177e-02 + <_> + + 0 -1 2215 2.3432020097970963e-02 + + 1.4517559669911861e-02 -3.2621389627456665e-01 + <_> + + 0 -1 2216 -2.4803660809993744e-02 + + 4.1374489665031433e-01 -3.1516589224338531e-02 + <_> + + 0 -1 2217 -9.1133005917072296e-03 + + -2.3262369632720947e-01 6.5307170152664185e-02 + <_> + + 0 -1 2218 -7.2223007678985596e-02 + + 3.1365010142326355e-01 -4.0287811309099197e-02 + <_> + + 0 -1 2219 6.4163007773458958e-03 + + 4.4151920825242996e-02 -1.4439010620117188e-01 + <_> + + 0 -1 2220 5.4361939430236816e-02 + + -4.9821659922599792e-02 2.6239651441574097e-01 + <_> + + 0 -1 2221 -5.9238062240183353e-03 + + 7.4054516851902008e-02 -7.2215773165225983e-02 + <_> + + 0 -1 2222 -3.4175089094787836e-03 + + -3.0714958906173706e-01 3.9461899548768997e-02 + <_> + + 0 -1 2223 1.1367879807949066e-02 + + -4.8698928207159042e-02 1.0077890008687973e-01 + <_> + + 0 -1 2224 2.3361030034720898e-03 + + 4.9539480358362198e-02 -2.3815050721168518e-01 + <_> + + 0 -1 2225 -7.2044372791424394e-04 + + 9.6084482967853546e-02 -9.8123528063297272e-02 + <_> + + 0 -1 2226 -3.4777939436025918e-04 + + 1.0546120256185532e-01 -1.0600890219211578e-01 + <_> + + 0 -1 2227 -6.6456091590225697e-03 + + -1.7471200227737427e-01 4.7264128923416138e-02 + <_> + + 0 -1 2228 4.4261440634727478e-02 + + -4.0742669254541397e-02 2.8637731075286865e-01 + <_> + + 0 -1 2229 3.4959740936756134e-02 + + 1.3479149900376797e-02 -4.4233149290084839e-01 + <_> + + 0 -1 2230 -2.5971820577979088e-02 + + -4.6334660053253174e-01 2.5301979854702950e-02 + <_> + + 0 -1 2231 1.8818200333043933e-03 + + -7.2344467043876648e-02 1.5579940378665924e-01 + <_> + + 0 -1 2232 3.2623678445816040e-02 + + 1.8171060830354691e-02 -6.3472539186477661e-01 + <_> + + 0 -1 2233 1.5041300095617771e-02 + + -5.3582038730382919e-02 1.8320439755916595e-01 + <_> + + 0 -1 2234 -5.5875489488244057e-03 + + 1.5442819893360138e-01 -6.9521442055702209e-02 + <_> + + 0 -1 2235 3.9029030594974756e-03 + + 7.2893843054771423e-02 -1.3542290031909943e-01 + <_> + + 0 -1 2236 4.5964889228343964e-02 + + 2.1482560783624649e-02 -5.4532879590988159e-01 + <_> + + 0 -1 2237 -7.4338473379611969e-02 + + -7.1795612573623657e-01 3.5341270267963409e-03 + <_> + + 0 -1 2238 2.0902850665152073e-03 + + 4.3308760970830917e-02 -2.5078159570693970e-01 + <_> + + 0 -1 2239 -7.5608417391777039e-02 + + 2.7488818764686584e-01 -3.4967329353094101e-02 + <_> + + 0 -1 2240 5.1200888119637966e-03 + + 4.7384329140186310e-02 -2.6794269680976868e-01 + <_> + + 0 -1 2241 -2.0140670239925385e-02 + + 7.2039432823657990e-02 -4.4537059962749481e-02 + <_> + + 0 -1 2242 2.6719279587268829e-02 + + -6.0671631246805191e-02 2.4019980430603027e-01 + <_> + + 0 -1 2243 -2.3299809545278549e-03 + + -1.4848700165748596e-01 6.3779368996620178e-02 + <_> + + 0 -1 2244 1.4248250052332878e-02 + + 3.9471931755542755e-02 -2.7790299057960510e-01 + <_> + + 0 -1 2245 -6.8691447377204895e-02 + + 3.1307551264762878e-01 -2.2111769765615463e-02 + <_> + + 0 -1 2246 -6.5213128924369812e-02 + + 3.6191588640213013e-01 -3.1089780852198601e-02 + <_> + + 0 -1 2247 -1.4469860121607780e-02 + + -1.9942939281463623e-01 2.6489760726690292e-02 + <_> + + 0 -1 2248 -9.4575136899948120e-03 + + -2.9698899388313293e-01 3.6693658679723740e-02 + <_> + + 0 -1 2249 -1.8222700059413910e-01 + + -4.0887731313705444e-01 7.3904348537325859e-03 + <_> + + 0 -1 2250 -2.3991869390010834e-01 + + -9.5519691705703735e-01 1.0895749554038048e-02 + <_> + + 0 -1 2251 -1.4964600093662739e-02 + + 1.3325509428977966e-01 -6.4146116375923157e-02 + <_> + + 0 -1 2252 1.1056339740753174e-01 + + -2.1147079765796661e-02 5.2262008190155029e-01 + <_> + + 0 -1 2253 -1.1857460252940655e-02 + + -2.6103261113166809e-01 2.4917129427194595e-02 + <_> + + 0 -1 2254 1.7032399773597717e-02 + + -4.2655009776353836e-02 2.4324589967727661e-01 + <_> + + 0 -1 2255 -6.6315201111137867e-03 + + -2.7996608614921570e-01 4.7972209751605988e-02 + <_> + + 0 -1 2256 -1.3527619885280728e-03 + + -1.7117640376091003e-01 6.8423986434936523e-02 + <_> + + 0 -1 2257 5.8159399777650833e-02 + + 1.4452300034463406e-02 -3.6640700697898865e-01 + <_> + + 0 -1 2258 9.6522513777017593e-03 + + 6.4102686941623688e-02 -1.9386090338230133e-01 + <_> + + 0 -1 2259 4.6681659296154976e-03 + + -6.4305387437343597e-02 1.2191460281610489e-01 + <_> + + 0 -1 2260 4.8228199593722820e-03 + + 4.2306859046220779e-02 -2.5486230850219727e-01 + <_> + + 0 -1 2261 7.2615491226315498e-03 + + -4.4169031083583832e-02 1.9888080656528473e-01 + <_> + + 0 -1 2262 2.7650638949126005e-03 + + 5.6748721748590469e-02 -1.8802900612354279e-01 + <_> + + 0 -1 2263 -1.2599739711731672e-03 + + 2.9681721329689026e-01 -3.0795339494943619e-02 + <_> + + 0 -1 2264 -1.4079749584197998e-02 + + 1.2790699303150177e-01 -7.7078782021999359e-02 + <_> + + 0 -1 2265 4.1978028602898121e-03 + + -3.2651171088218689e-02 4.4282011687755585e-02 + <_> + + 0 -1 2266 7.4891891563311219e-04 + + -1.1801239848136902e-01 1.0196279734373093e-01 + <_> + + 0 -1 2267 3.9699498564004898e-02 + + 1.6263889148831367e-02 -3.2391819357872009e-01 + <_> + + 0 -1 2268 2.9685199260711670e-03 + + 5.0729360431432724e-02 -2.2522340714931488e-01 + <_> + + 0 -1 2269 3.0207540839910507e-03 + + -6.4312063157558441e-02 6.3618481159210205e-02 + <_> + + 0 -1 2270 -1.0064570233225822e-03 + + -2.2469790279865265e-01 4.3256420642137527e-02 + <_> + + 0 -1 2271 1.6607339493930340e-03 + + -5.8126531541347504e-02 5.9540931135416031e-02 + <_> + + 0 -1 2272 4.9640638753771782e-03 + + -4.8804368823766708e-02 1.8437810242176056e-01 + <_> + + 0 -1 2273 1.7194069921970367e-01 + + 3.6377978976815939e-03 -1.0000029802322388e+00 + <_> + + 0 -1 2274 -2.0992290228605270e-03 + + 1.1951360106468201e-01 -8.8613957166671753e-02 + <_> + + 0 -1 2275 -4.0529989637434483e-03 + + -2.0199899375438690e-01 5.3564589470624924e-02 + <_> + + 0 -1 2276 1.5536800492554903e-03 + + -9.6797212958335876e-02 9.5135137438774109e-02 + <_> + + 0 -1 2277 2.2837040014564991e-03 + + -4.5535419136285782e-02 1.4682759344577789e-01 + <_> + + 0 -1 2278 -1.0094629600644112e-02 + + -1.8853099644184113e-01 4.8864368349313736e-02 + <_> + + 0 -1 2279 -7.0200799964368343e-03 + + 1.4628750085830688e-01 -4.2158648371696472e-02 + <_> + + 0 -1 2280 3.4074939321726561e-03 + + -7.7149718999862671e-02 1.3702009618282318e-01 + <_> + + 0 -1 2281 3.9907437749207020e-03 + + -6.4178831875324249e-02 8.5484616458415985e-02 + <_> + + 0 -1 2282 2.0611559972167015e-02 + + 3.7988938391208649e-02 -2.9359170794487000e-01 + <_> + + 0 -1 2283 -1.9768020138144493e-03 + + 6.0499001294374466e-02 -1.6910280287265778e-01 + <_> + + 0 -1 2284 -2.4783300235867500e-02 + + -5.5052608251571655e-01 1.5831759199500084e-02 + <_> + + 0 -1 2285 -1.5710920095443726e-02 + + 1.9716830551624298e-01 -3.1884010881185532e-02 + <_> + + 0 -1 2286 1.0070169810205698e-03 + + 4.6532750129699707e-02 -2.1853099763393402e-01 + <_> + + 0 -1 2287 -3.7466569337993860e-03 + + -2.5379389524459839e-01 3.9463929831981659e-02 + <_> + + 0 -1 2288 4.5849520713090897e-02 + + 1.3636340387165546e-02 -6.2976127862930298e-01 + <_> + + 0 -1 2289 -1.1040110141038895e-02 + + 2.4939639866352081e-01 -3.8895469158887863e-02 + <_> + + 0 -1 2290 -4.2415689677000046e-03 + + -2.1564769744873047e-01 4.5613430440425873e-02 + <_> + + 0 -1 2291 -3.1175611075013876e-03 + + 1.0641460120677948e-01 -1.2268310040235519e-01 + <_> + + 0 -1 2292 -2.3725910577923059e-03 + + 2.0573639869689941e-01 -6.6338561475276947e-02 + <_> + + 0 -1 2293 -3.6906299646943808e-03 + + -1.5802620351314545e-01 6.6760621964931488e-02 + <_> + + 0 -1 2294 1.0908120311796665e-03 + + -1.7830020189285278e-01 5.7181321084499359e-02 + <_> + + 0 -1 2295 -1.3929420150816441e-02 + + -1.4185859262943268e-01 5.8131370693445206e-02 + <_> + + 0 -1 2296 -2.8283370658755302e-02 + + 2.6451000571250916e-01 -4.5332599431276321e-02 + <_> + + 0 -1 2297 -3.9213709533214569e-04 + + 7.6039716601371765e-02 -8.4666326642036438e-02 + <_> + + 0 -1 2298 -2.0424809772521257e-03 + + -1.6393850743770599e-01 5.7595171034336090e-02 + <_> + + 0 -1 2299 -6.0634050518274307e-02 + + 2.4343550205230713e-01 -1.3630810193717480e-02 + <_> + + 0 -1 2300 5.5472988635301590e-02 + + 1.2274630367755890e-02 -7.6161897182464600e-01 + <_> + + 0 -1 2301 2.6451710611581802e-02 + + -1.6103159636259079e-02 1.4696520566940308e-01 + <_> + + 0 -1 2302 -6.5615847706794739e-02 + + -6.6936880350112915e-01 1.2788389809429646e-02 + <_> + + 0 -1 2303 -2.9287360608577728e-02 + + 3.8422039151191711e-01 -2.0979570224881172e-02 + <_> + + 0 -1 2304 -8.7814256548881531e-02 + + -5.5386292934417725e-01 1.6540929675102234e-02 + <_> + + 0 -1 2305 4.0213011205196381e-02 + + 5.5229798890650272e-03 -1.5169410407543182e-01 + <_> + + 0 -1 2306 7.5501110404729843e-03 + + -5.3081061691045761e-02 1.6791249811649323e-01 + <_> + + 0 -1 2307 7.5557199306786060e-03 + + 4.9213249236345291e-02 -1.8097420036792755e-01 + <_> + + 0 -1 2308 4.2264759540557861e-02 + + 9.8954448476433754e-03 -8.7265938520431519e-01 + <_> + + 0 -1 2309 -1.5821179375052452e-02 + + -4.9515271186828613e-01 1.0424910113215446e-02 + <_> + + 0 -1 2310 4.4557699002325535e-03 + + -5.2823610603809357e-02 1.7409110069274902e-01 + <_> + + 0 -1 2311 -6.3567152246832848e-03 + + 1.0278800129890442e-01 -9.4062283635139465e-02 + <_> + + 0 -1 2312 2.1308339200913906e-03 + + -5.7343449443578720e-02 1.5747800469398499e-01 + <_> + + 0 -1 2313 6.4157308079302311e-03 + + 4.1112188249826431e-02 -2.6482531428337097e-01 + <_> + + 0 -1 2314 -1.0572739690542221e-01 + + -9.2719399929046631e-01 8.6396038532257080e-03 + <_> + + 0 -1 2315 6.1298489570617676e-02 + + 1.1242480017244816e-02 -5.2976250648498535e-01 + <_> + + 0 -1 2316 1.0018650442361832e-02 + + -6.1801191419363022e-02 1.5441860258579254e-01 + <_> + + 0 -1 2317 2.3613891098648310e-03 + + -3.9282340556383133e-02 8.8061779737472534e-02 + <_> + + 0 -1 2318 -4.7975129564292729e-04 + + -1.0663200169801712e-01 8.3887517452239990e-02 + <_> + + 0 -1 2319 7.3982410132884979e-02 + + 4.7058681957423687e-03 -6.0129082202911377e-01 + <_> + + 0 -1 2320 6.3821911811828613e-02 + + 1.1372390203177929e-02 -7.4044847488403320e-01 + <_> + + 0 -1 2321 4.6818208647891879e-04 + + -7.6545506715774536e-02 5.3563810884952545e-02 + <_> + + 0 -1 2322 4.3877989053726196e-01 + + 1.2420959770679474e-02 -6.8776041269302368e-01 + <_> + + 0 -1 2323 2.8831470757722855e-02 + + 1.5150110237300396e-02 -1.3229629397392273e-01 + <_> + + 0 -1 2324 6.7726813256740570e-02 + + -1.8901329487562180e-02 4.8799818754196167e-01 + <_> + + 0 -1 2325 9.5125466585159302e-02 + + 1.2518660165369511e-02 -7.4607741832733154e-01 + <_> + + 0 -1 2326 3.4629011061042547e-03 + + -6.4396522939205170e-02 1.3450330495834351e-01 + <_> + + 0 -1 2327 -1.0220340453088284e-02 + + -1.2102399766445160e-01 3.5081598907709122e-02 + <_> + + 0 -1 2328 -2.5227791070938110e-01 + + 5.3186398744583130e-01 -1.7373610287904739e-02 + <_> + + 0 -1 2329 4.7006108798086643e-03 + + 2.6264479383826256e-02 -1.6305670142173767e-01 + <_> + + 0 -1 2330 8.0487072467803955e-02 + + -1.1193430051207542e-02 7.3598998785018921e-01 + <_> + + 0 -1 2331 -3.8025099784135818e-03 + + -1.1756920069456100e-01 6.4899243414402008e-02 + <_> + + 0 -1 2332 -5.1970399916172028e-02 + + 2.1764869987964630e-01 -4.6299580484628677e-02 + <_> + + 0 -1 2333 -1.2381119653582573e-02 + + -1.3483320176601410e-01 7.0956252515316010e-02 + <_> + + 0 -1 2334 4.6567008830606937e-03 + + 8.4818847477436066e-02 -1.0850810259580612e-01 + <_> + + 0 -1 2335 2.4520549923181534e-02 + + -5.6512400507926941e-02 2.0845490694046021e-01 + <_> + + 0 -1 2336 -6.0728159733116627e-03 + + 1.0253319889307022e-01 -1.0739710181951523e-01 + <_> + + 0 -1 2337 1.3803950278088450e-03 + + -1.2355019897222519e-01 3.8523931056261063e-02 + <_> + + 0 -1 2338 8.3129312843084335e-03 + + 5.0441969186067581e-02 -1.7901860177516937e-01 + <_> + + 0 -1 2339 6.8436772562563419e-04 + + -6.1334688216447830e-02 4.9543838948011398e-02 + <_> + + 0 -1 2340 7.1589440107345581e-02 + + 1.1258729733526707e-02 -7.2902548313140869e-01 + <_> + + 0 -1 2341 -3.9251110865734518e-04 + + -2.9022648930549622e-01 1.3908719643950462e-02 + <_> + + 0 -1 2342 -1.6948020085692406e-02 + + 1.4616020023822784e-01 -5.6298948824405670e-02 + <_> + + 0 -1 2343 2.3180670104920864e-03 + + 2.0289139449596405e-01 -4.3649390339851379e-02 + <_> + + 0 -1 2344 7.9764174297451973e-03 + + -4.8768021166324615e-02 1.8070909380912781e-01 + <_> + + 0 -1 2345 -1.1533150449395180e-02 + + -1.4238800108432770e-01 5.6691840291023254e-02 + <_> + + 0 -1 2346 -5.4723728680983186e-04 + + -2.3844610154628754e-01 3.2061301171779633e-02 + <_> + + 0 -1 2347 -1.1751300189644098e-03 + + 2.5394979864358902e-02 -8.9872613549232483e-02 + <_> + + 0 -1 2348 1.3655239716172218e-02 + + -2.7230219915509224e-02 3.3419778943061829e-01 + <_> + + 0 -1 2349 4.1803810745477676e-03 + + 2.6914540678262711e-02 -1.2557040154933929e-01 + <_> + + 0 -1 2350 3.1565671088173985e-04 + + 6.2177520245313644e-02 -1.3345809280872345e-01 + <_> + + 0 -1 2351 7.4048307724297047e-03 + + 3.1548298895359039e-02 -2.8247129917144775e-01 + <_> + + 0 -1 2352 -1.3977429829537868e-02 + + 1.2342610210180283e-01 -8.0493018031120300e-02 + <_> + + 0 -1 2353 -1.4240520074963570e-02 + + -2.3979499936103821e-01 1.8016669899225235e-02 + <_> + + 0 -1 2354 -2.2901569306850433e-01 + + -4.2895668745040894e-01 2.0032370463013649e-02 + <_> + + 0 -1 2355 2.6522560045123100e-02 + + -2.9899509623646736e-02 3.1195539236068726e-01 + <_> + + 0 -1 2356 5.0723659805953503e-03 + + 6.2117800116539001e-02 -1.5442310273647308e-01 + <_> + + 0 -1 2357 2.2340700961649418e-03 + + 3.0717259272933006e-02 -1.4656220376491547e-01 + <_> + + 0 -1 2358 -4.6348381787538528e-02 + + -6.7844080924987793e-01 1.2258620001375675e-02 + <_> + + 0 -1 2359 -3.0467000324279070e-03 + + 1.0547509789466858e-01 -5.4426789283752441e-02 + <_> + + 0 -1 2360 7.0065702311694622e-03 + + -5.2537959069013596e-02 2.4259300529956818e-01 + <_> + + 0 -1 2361 -2.7783720288425684e-03 + + -1.0732100158929825e-01 7.4064619839191437e-02 + <_> + + 0 -1 2362 -4.2294961167499423e-04 + + 6.8151466548442841e-02 -1.4117160439491272e-01 + <_> + + 0 -1 2363 -8.7614007294178009e-02 + + -6.5271192789077759e-01 3.3460480626672506e-03 + <_> + + 0 -1 2364 1.2552930042147636e-02 + + 3.3235169947147369e-02 -2.6571980118751526e-01 + <_> + + 0 -1 2365 -2.1863510832190514e-02 + + 1.5599909424781799e-01 -3.7561919540166855e-02 + <_> + 189 + -1.6477719545364380e+00 + + <_> + + 0 -1 2366 1.9715659320354462e-02 + + -4.0786159038543701e-01 1.6317300498485565e-01 + <_> + + 0 -1 2367 4.9977540969848633e-02 + + -2.5753161311149597e-01 2.3471170663833618e-01 + <_> + + 0 -1 2368 3.4774339292198420e-04 + + -2.7148011326789856e-01 1.5202049911022186e-01 + <_> + + 0 -1 2369 8.2787703722715378e-03 + + 8.6229562759399414e-02 -4.2272651195526123e-01 + <_> + + 0 -1 2370 1.2891810387372971e-02 + + -2.7589491009712219e-01 9.9677331745624542e-02 + <_> + + 0 -1 2371 -5.2444688044488430e-03 + + 1.4687310159206390e-01 -1.8090559542179108e-01 + <_> + + 0 -1 2372 4.7363140038214624e-04 + + 1.1544570326805115e-01 -2.3242090642452240e-01 + <_> + + 0 -1 2373 1.0767930187284946e-02 + + -2.3256160318851471e-01 5.7885929942131042e-02 + <_> + + 0 -1 2374 -2.0576089154928923e-03 + + -4.0554818511009216e-01 6.1086129397153854e-02 + <_> + + 0 -1 2375 1.2648279964923859e-01 + + 2.5926080998033285e-03 -6.0955828428268433e-01 + <_> + + 0 -1 2376 2.2029090672731400e-02 + + -2.3835970461368561e-01 1.1523839831352234e-01 + <_> + + 0 -1 2377 8.6279091192409396e-04 + + -2.4382559955120087e-01 4.8174999654293060e-02 + <_> + + 0 -1 2378 6.1232252046465874e-03 + + -3.3293130993843079e-01 7.3860548436641693e-02 + <_> + + 0 -1 2379 1.8321570241823792e-03 + + 7.4964806437492371e-02 -3.6050680279731750e-01 + <_> + + 0 -1 2380 1.3176959939301014e-02 + + 7.8650407493114471e-02 -3.0009350180625916e-01 + <_> + + 0 -1 2381 -1.5092800371348858e-02 + + -4.5663359761238098e-01 4.5359719544649124e-02 + <_> + + 0 -1 2382 -3.9765550754964352e-03 + + -3.7404119968414307e-01 5.7276591658592224e-02 + <_> + + 0 -1 2383 -1.2558099813759327e-02 + + 1.8079389631748199e-01 -9.0798392891883850e-02 + <_> + + 0 -1 2384 1.1346530169248581e-02 + + 6.7842416465282440e-02 -3.3354648947715759e-01 + <_> + + 0 -1 2385 3.0938379932194948e-03 + + -6.4362257719039917e-02 1.6250990331172943e-01 + <_> + + 0 -1 2386 -7.9837916418910027e-03 + + -2.8237259387969971e-01 6.4243227243423462e-02 + <_> + + 0 -1 2387 5.3257539868354797e-02 + + -1.1842279881238937e-01 1.5403720736503601e-01 + <_> + + 0 -1 2388 -3.2308440655469894e-02 + + -3.8174659013748169e-01 4.6444781124591827e-02 + <_> + + 0 -1 2389 7.4837519787251949e-03 + + 1.0087630152702332e-01 -1.7848369479179382e-01 + <_> + + 0 -1 2390 1.4075540006160736e-02 + + -1.3612699508666992e-01 1.2589199841022491e-01 + <_> + + 0 -1 2391 1.1945860460400581e-02 + + -4.6452131122350693e-02 3.1823348999023438e-01 + <_> + + 0 -1 2392 4.9774140119552612e-02 + + 3.7373390048742294e-02 -4.3919241428375244e-01 + <_> + + 0 -1 2393 1.1070669861510396e-03 + + 3.3163610845804214e-02 -1.8855419754981995e-01 + <_> + + 0 -1 2394 -2.8594989329576492e-02 + + -3.6906918883323669e-01 4.1930228471755981e-02 + <_> + + 0 -1 2395 -7.6013091020286083e-03 + + 5.2191480994224548e-02 -2.4689050018787384e-01 + <_> + + 0 -1 2396 1.3114510476589203e-01 + + -5.7957381010055542e-02 2.7318599820137024e-01 + <_> + + 0 -1 2397 -7.4186350502714049e-06 + + 1.1802060157060623e-01 -1.0745350271463394e-01 + <_> + + 0 -1 2398 3.1472120434045792e-02 + + -7.1733877062797546e-02 2.5617578625679016e-01 + <_> + + 0 -1 2399 3.8700491189956665e-02 + + 4.2863689363002777e-02 -6.0855817794799805e-01 + <_> + + 0 -1 2400 -3.9322520606219769e-03 + + -2.2127309441566467e-01 6.5617948770523071e-02 + <_> + + 0 -1 2401 2.3144779726862907e-02 + + -6.8200387060642242e-02 1.6107009351253510e-01 + <_> + + 0 -1 2402 4.4043041765689850e-02 + + -5.4092731326818466e-02 2.7009010314941406e-01 + <_> + + 0 -1 2403 1.6363389790058136e-02 + + -6.7165039479732513e-02 1.4292019605636597e-01 + <_> + + 0 -1 2404 4.0575690567493439e-02 + + 2.7095599099993706e-02 -5.1922810077667236e-01 + <_> + + 0 -1 2405 -8.1591978669166565e-02 + + 3.6290401220321655e-01 -5.0641149282455444e-02 + <_> + + 0 -1 2406 9.6564572304487228e-03 + + -6.5868496894836426e-02 2.0459869503974915e-01 + <_> + + 0 -1 2407 4.3875370174646378e-02 + + 2.8287120163440704e-02 -4.7316759824752808e-01 + <_> + + 0 -1 2408 -5.3375590592622757e-02 + + -6.3912391662597656e-01 1.9213579595088959e-02 + <_> + + 0 -1 2409 -4.2789369821548462e-02 + + 3.7414470314979553e-01 -3.6020539700984955e-02 + <_> + + 0 -1 2410 -1.4193350449204445e-02 + + -3.0562171339988708e-01 5.1724649965763092e-02 + <_> + + 0 -1 2411 -5.2947051823139191e-02 + + 2.2203849256038666e-01 -2.7123190462589264e-02 + <_> + + 0 -1 2412 3.0441719293594360e-01 + + 2.8107000514864922e-02 -5.1486051082611084e-01 + <_> + + 0 -1 2413 9.6917577087879181e-02 + + 7.5603500008583069e-03 -5.4642218351364136e-01 + <_> + + 0 -1 2414 4.5469900942407548e-04 + + -2.2257779538631439e-01 5.9663061052560806e-02 + <_> + + 0 -1 2415 6.4785419963300228e-03 + + 7.0507273077964783e-02 -8.6525917053222656e-02 + <_> + + 0 -1 2416 9.5442440360784531e-03 + + 1.1858390271663666e-01 -1.2846529483795166e-01 + <_> + + 0 -1 2417 1.0664040222764015e-02 + + 6.0251180082559586e-02 -2.3454129695892334e-01 + <_> + + 0 -1 2418 -5.9601400047540665e-02 + + -4.9083110690116882e-01 3.1179970130324364e-02 + <_> + + 0 -1 2419 -1.4810609631240368e-02 + + 1.7928470671176910e-01 -5.3788300603628159e-02 + <_> + + 0 -1 2420 2.4988459423184395e-02 + + 4.5585051178932190e-02 -3.1542968750000000e-01 + <_> + + 0 -1 2421 3.7159871309995651e-02 + + -2.5552989915013313e-02 1.2824480235576630e-01 + <_> + + 0 -1 2422 -3.6023799329996109e-02 + + 3.0338558554649353e-01 -5.0723869353532791e-02 + <_> + + 0 -1 2423 -4.0073681622743607e-02 + + -3.5327419638633728e-01 2.5542749091982841e-02 + <_> + + 0 -1 2424 1.0118799656629562e-01 + + 1.4954050071537495e-02 -8.5275518894195557e-01 + <_> + + 0 -1 2425 1.2551939487457275e-01 + + -5.5777598172426224e-02 3.5162329673767090e-02 + <_> + + 0 -1 2426 -1.0094200260937214e-02 + + -7.9517722129821777e-01 1.6658289358019829e-02 + <_> + + 0 -1 2427 2.7957880869507790e-02 + + 3.0823230743408203e-02 -2.9073038697242737e-01 + <_> + + 0 -1 2428 3.6360241472721100e-02 + + 2.7960959821939468e-02 -4.7691631317138672e-01 + <_> + + 0 -1 2429 -9.9100463092327118e-02 + + -3.0804800987243652e-01 4.2725458741188049e-02 + <_> + + 0 -1 2430 -5.8572040870785713e-04 + + 5.9227660298347473e-02 -2.3531119525432587e-01 + <_> + + 0 -1 2431 -5.1202569156885147e-02 + + -5.2199620008468628e-01 1.4952239580452442e-02 + <_> + + 0 -1 2432 -6.7564798519015312e-03 + + 1.4085020124912262e-01 -9.0452179312705994e-02 + <_> + + 0 -1 2433 -4.8959780484437943e-02 + + -6.6878128051757812e-01 2.0590359345078468e-02 + <_> + + 0 -1 2434 1.4971289783716202e-04 + + -1.8641050159931183e-01 6.5254852175712585e-02 + <_> + + 0 -1 2435 -3.4409679472446442e-02 + + -6.5235960483551025e-01 1.4693650417029858e-02 + <_> + + 0 -1 2436 6.4725689589977264e-02 + + 1.2329719960689545e-02 -8.4077721834182739e-01 + <_> + + 0 -1 2437 1.7888710135594010e-03 + + -3.3088308572769165e-01 2.3944050073623657e-02 + <_> + + 0 -1 2438 7.4999839067459106e-02 + + 2.6347629725933075e-02 -4.4841340184211731e-01 + <_> + + 0 -1 2439 -1.3695800304412842e-01 + + -5.7192331552505493e-01 1.2316530337557197e-03 + <_> + + 0 -1 2440 8.7679617106914520e-02 + + 9.1852411627769470e-02 -1.4714670181274414e-01 + <_> + + 0 -1 2441 -1.4691170305013657e-02 + + -2.7389299869537354e-01 5.5910948663949966e-02 + <_> + + 0 -1 2442 1.8059760332107544e-01 + + 1.8475739285349846e-02 -6.2247991561889648e-01 + <_> + + 0 -1 2443 -6.9349152036011219e-03 + + -1.6723890602588654e-01 4.2348120361566544e-02 + <_> + + 0 -1 2444 -4.5395728200674057e-02 + + 5.6401878595352173e-01 -2.0763039588928223e-02 + <_> + + 0 -1 2445 -3.7714779376983643e-02 + + -4.9726399779319763e-01 1.3457749970257282e-02 + <_> + + 0 -1 2446 -6.6780918277800083e-03 + + 1.5654189884662628e-01 -7.9254247248172760e-02 + <_> + + 0 -1 2447 -3.5693418234586716e-02 + + 3.2214561104774475e-01 -2.7933960780501366e-02 + <_> + + 0 -1 2448 2.0231369417160749e-03 + + -2.0472900569438934e-01 6.0136921703815460e-02 + <_> + + 0 -1 2449 7.7706989832222462e-03 + + -6.2275718897581100e-02 1.3619600236415863e-01 + <_> + + 0 -1 2450 -2.3846060037612915e-02 + + -6.4280962944030762e-01 1.9216870889067650e-02 + <_> + + 0 -1 2451 3.8112789392471313e-02 + + 1.6926249489188194e-02 -3.2001879811286926e-01 + <_> + + 0 -1 2452 -8.1509854644536972e-03 + + -1.8527400493621826e-01 6.7431643605232239e-02 + <_> + + 0 -1 2453 3.0041670799255371e-01 + + -3.4997869282960892e-02 3.7719568610191345e-01 + <_> + + 0 -1 2454 3.2188769546337426e-04 + + -4.3860068917274475e-01 3.1008180230855942e-02 + <_> + + 0 -1 2455 9.9805131554603577e-02 + + 2.1043010056018829e-02 -2.4182139337062836e-01 + <_> + + 0 -1 2456 -1.3132029771804810e-01 + + -6.0744529962539673e-01 1.9127229228615761e-02 + <_> + + 0 -1 2457 -4.4457878917455673e-02 + + -2.8207719326019287e-01 1.6199590638279915e-02 + <_> + + 0 -1 2458 -5.3282459266483784e-03 + + 1.9118839502334595e-01 -6.4483523368835449e-02 + <_> + + 0 -1 2459 4.0367528796195984e-02 + + 1.6362620517611504e-02 -5.5463272333145142e-01 + <_> + + 0 -1 2460 -8.7769925594329834e-03 + + -3.8903188705444336e-01 3.1277969479560852e-02 + <_> + + 0 -1 2461 -1.5031780116260052e-02 + + 4.4966968894004822e-01 -1.8708650022745132e-02 + <_> + + 0 -1 2462 -3.2085120677947998e-02 + + 2.2872669994831085e-01 -5.2647799253463745e-02 + <_> + + 0 -1 2463 1.7735429573804140e-03 + + 1.0644569993019104e-01 -1.1970230191946030e-01 + <_> + + 0 -1 2464 5.9195980429649353e-02 + + -6.4485557377338409e-02 1.8440729379653931e-01 + <_> + + 0 -1 2465 1.1976130306720734e-02 + + -4.6655338257551193e-02 2.2750610113143921e-01 + <_> + + 0 -1 2466 -7.3619361501187086e-04 + + 6.4427956938743591e-02 -1.9669359922409058e-01 + <_> + + 0 -1 2467 1.1274980008602142e-01 + + -3.2603729516267776e-02 2.6165801286697388e-01 + <_> + + 0 -1 2468 -2.9639130458235741e-02 + + -2.4286089837551117e-01 5.2550770342350006e-02 + <_> + + 0 -1 2469 -4.8972599208354950e-02 + + 2.9013419151306152e-01 -3.9936609566211700e-02 + <_> + + 0 -1 2470 -2.0732060074806213e-03 + + 6.6728956997394562e-02 -1.8385919928550720e-01 + <_> + + 0 -1 2471 1.8652489781379700e-01 + + 2.5788070634007454e-02 -3.0477121472358704e-01 + <_> + + 0 -1 2472 -6.4846210181713104e-02 + + 5.8964151144027710e-01 -2.1531870588660240e-02 + <_> + + 0 -1 2473 5.9668030589818954e-02 + + 9.0434495359659195e-03 -8.9928478002548218e-01 + <_> + + 0 -1 2474 -2.2810790687799454e-02 + + -5.5689752101898193e-01 2.1036420017480850e-02 + <_> + + 0 -1 2475 -4.3924558907747269e-02 + + -7.7569800615310669e-01 1.3244120404124260e-02 + <_> + + 0 -1 2476 -8.1411283463239670e-03 + + -1.6145749390125275e-01 6.3869751989841461e-02 + <_> + + 0 -1 2477 -1.7681140452623367e-02 + + -1.7088229954242706e-01 4.4323820620775223e-02 + <_> + + 0 -1 2478 3.5615780949592590e-01 + + 1.3911530375480652e-02 -8.2366949319839478e-01 + <_> + + 0 -1 2479 8.9791387319564819e-02 + + -3.3068671822547913e-02 3.9501950144767761e-01 + <_> + + 0 -1 2480 -5.1039960235357285e-02 + + -4.9687319993972778e-01 2.4911910295486450e-02 + <_> + + 0 -1 2481 4.4502970576286316e-01 + + 1.3085749931633472e-02 -7.1374338865280151e-01 + <_> + + 0 -1 2482 -3.1571299768984318e-03 + + -2.3235230147838593e-01 4.5422729104757309e-02 + <_> + + 0 -1 2483 2.2295509278774261e-01 + + 2.5272920727729797e-02 -4.5817920565605164e-01 + <_> + + 0 -1 2484 8.1787049770355225e-02 + + -5.6966669857501984e-02 2.0633119344711304e-01 + <_> + + 0 -1 2485 1.2290639802813530e-02 + + 1.0433530062437057e-01 -1.4129990339279175e-01 + <_> + + 0 -1 2486 3.2738980371505022e-03 + + -1.9929160177707672e-01 5.7900499552488327e-02 + <_> + + 0 -1 2487 3.1915940344333649e-03 + + -2.8649568557739258e-01 3.8445938378572464e-02 + <_> + + 0 -1 2488 -6.9429136812686920e-02 + + 3.9995300769805908e-01 -2.9228420928120613e-02 + <_> + + 0 -1 2489 3.0896291136741638e-01 + + 4.5684990473091602e-03 -9.7593581676483154e-01 + <_> + + 0 -1 2490 6.0547169297933578e-02 + + -1.7227350175380707e-01 7.3367759585380554e-02 + <_> + + 0 -1 2491 8.0296747386455536e-02 + + 1.2790890410542488e-02 -2.9636448621749878e-01 + <_> + + 0 -1 2492 9.8309047520160675e-02 + + 1.7421530559659004e-02 -7.3428112268447876e-01 + <_> + + 0 -1 2493 -6.0651078820228577e-02 + + -8.9268088340759277e-01 9.2950398102402687e-03 + <_> + + 0 -1 2494 -1.1067830026149750e-02 + + 3.6940470337867737e-01 -3.2281860709190369e-02 + <_> + + 0 -1 2495 -1.7252689227461815e-02 + + 2.0163689553737640e-01 -3.0649609863758087e-02 + <_> + + 0 -1 2496 1.1417149752378464e-01 + + -7.2567440569400787e-02 1.4580799639225006e-01 + <_> + + 0 -1 2497 -1.1878489749506116e-04 + + 6.6703669726848602e-02 -1.2044110149145126e-01 + <_> + + 0 -1 2498 4.2538821697235107e-02 + + 1.4235669374465942e-01 -9.3128196895122528e-02 + <_> + + 0 -1 2499 4.6220790594816208e-02 + + -4.5348118990659714e-02 2.6667690277099609e-01 + <_> + + 0 -1 2500 -1.2598860263824463e-01 + + -6.2195998430252075e-01 1.9361790269613266e-02 + <_> + + 0 -1 2501 1.4336410164833069e-01 + + 1.5602460131049156e-02 -3.4269729256629944e-01 + <_> + + 0 -1 2502 1.4853400178253651e-02 + + -1.9399890303611755e-01 5.9365049004554749e-02 + <_> + + 0 -1 2503 2.9607299715280533e-02 + + 2.9370859265327454e-02 -1.1840560287237167e-01 + <_> + + 0 -1 2504 4.5151200145483017e-02 + + -3.1025370582938194e-02 4.2335650324821472e-01 + <_> + + 0 -1 2505 1.7347050830721855e-02 + + 5.2468661218881607e-02 -1.7071889340877533e-01 + <_> + + 0 -1 2506 4.8696789890527725e-02 + + 1.3757590204477310e-02 -7.3853892087936401e-01 + <_> + + 0 -1 2507 -2.5120940059423447e-02 + + -2.6077219843864441e-01 3.6249000579118729e-02 + <_> + + 0 -1 2508 -1.4412039890885353e-02 + + 1.8435400724411011e-01 -5.5376049131155014e-02 + <_> + + 0 -1 2509 1.6011130064725876e-02 + + -3.3822190016508102e-02 9.8490990698337555e-02 + <_> + + 0 -1 2510 -6.3778877258300781e-02 + + 3.9596658945083618e-01 -2.6605289429426193e-02 + <_> + + 0 -1 2511 -1.2431790120899677e-02 + + -2.7103281021118164e-01 5.1153909415006638e-02 + <_> + + 0 -1 2512 1.5430289506912231e-01 + + -2.9742069542407990e-02 3.6223879456520081e-01 + <_> + + 0 -1 2513 6.8953618407249451e-02 + + 1.4560540206730366e-02 -7.1308761835098267e-01 + <_> + + 0 -1 2514 2.6809390634298325e-02 + + 3.0903020873665810e-02 -3.1453761458396912e-01 + <_> + + 0 -1 2515 -5.4339639842510223e-02 + + -5.7081592082977295e-01 6.3606691546738148e-03 + <_> + + 0 -1 2516 -7.4291341006755829e-03 + + -2.1167820692062378e-01 5.4728411138057709e-02 + <_> + + 0 -1 2517 1.5004719607532024e-02 + + -1.3576979935169220e-01 3.6672618240118027e-02 + <_> + + 0 -1 2518 2.3438859730958939e-02 + + -6.2095177173614502e-01 1.7451370134949684e-02 + <_> + + 0 -1 2519 2.1869429945945740e-01 + + -2.5175819173455238e-02 2.4256730079650879e-01 + <_> + + 0 -1 2520 7.2554901242256165e-02 + + 3.0378310009837151e-02 -3.5316839814186096e-01 + <_> + + 0 -1 2521 -6.0775190591812134e-02 + + 6.1231142282485962e-01 -2.9397750273346901e-02 + <_> + + 0 -1 2522 1.0405359789729118e-02 + + -4.8925351351499557e-02 2.0042200386524200e-01 + <_> + + 0 -1 2523 -4.4559161178767681e-03 + + -1.8175999820232391e-01 5.1460109651088715e-02 + <_> + + 0 -1 2524 5.3141661919653416e-03 + + 1.0836429893970490e-01 -1.1464370042085648e-01 + <_> + + 0 -1 2525 2.8129909187555313e-02 + + 4.8452459275722504e-02 -1.0588149726390839e-01 + <_> + + 0 -1 2526 -1.0029030032455921e-02 + + -2.8854200243949890e-01 4.6509381383657455e-02 + <_> + + 0 -1 2527 4.1623760014772415e-02 + + -5.2424181252717972e-02 2.4638059735298157e-01 + <_> + + 0 -1 2528 1.7407029867172241e-02 + + -5.9511799365282059e-02 2.2489009797573090e-01 + <_> + + 0 -1 2529 -9.1012917459011078e-02 + + 3.8434851169586182e-01 -2.6776079088449478e-02 + <_> + + 0 -1 2530 -5.5964559316635132e-02 + + 3.3512559533119202e-01 -3.7086669355630875e-02 + <_> + + 0 -1 2531 -2.3191609978675842e-01 + + -7.9937142133712769e-01 1.6157710924744606e-02 + <_> + + 0 -1 2532 1.5095779672265053e-02 + + 1.9562739878892899e-02 -4.7588780522346497e-01 + <_> + + 0 -1 2533 -6.3537202775478363e-02 + + 5.5103862285614014e-01 -9.9191991612315178e-03 + <_> + + 0 -1 2534 5.0780471414327621e-02 + + -5.0766121596097946e-02 1.9856730103492737e-01 + <_> + + 0 -1 2535 3.3435709774494171e-02 + + 1.7100030556321144e-02 -3.9106050133705139e-01 + <_> + + 0 -1 2536 2.7236310765147209e-02 + + 1.9491130486130714e-02 -4.9955821037292480e-01 + <_> + + 0 -1 2537 3.6144461482763290e-02 + + 1.9712809473276138e-02 -4.7714808583259583e-01 + <_> + + 0 -1 2538 -3.7110898643732071e-02 + + -7.1080970764160156e-01 1.3297240249812603e-02 + <_> + + 0 -1 2539 -1.6986919799819589e-03 + + -1.1454039812088013e-01 5.3833190351724625e-02 + <_> + + 0 -1 2540 7.0956937270238996e-04 + + -1.1852429807186127e-01 8.6146153509616852e-02 + <_> + + 0 -1 2541 -3.9854459464550018e-02 + + -2.1784169971942902e-01 7.9314615577459335e-03 + <_> + + 0 -1 2542 -2.6265300810337067e-02 + + 5.1828277111053467e-01 -1.9502539187669754e-02 + <_> + + 0 -1 2543 1.5767179429531097e-03 + + -9.0025149285793304e-02 4.3614149093627930e-02 + <_> + + 0 -1 2544 8.4500849246978760e-02 + + 1.9108800217509270e-02 -5.8049428462982178e-01 + <_> + + 0 -1 2545 5.8061029762029648e-02 + + 5.1128780469298363e-03 -3.6629718542098999e-01 + <_> + + 0 -1 2546 -8.6446420755237341e-04 + + 9.8551221191883087e-02 -9.9286876618862152e-02 + <_> + + 0 -1 2547 -1.6358779743313789e-02 + + -2.2353939712047577e-01 4.5100010931491852e-02 + <_> + + 0 -1 2548 1.2069500051438808e-02 + + -3.0885580927133560e-02 3.5933670401573181e-01 + <_> + + 0 -1 2549 6.4932592213153839e-02 + + 8.9946594089269638e-03 -6.5505272150039673e-01 + <_> + + 0 -1 2550 -1.6384720802307129e-02 + + 1.8374380469322205e-01 -5.8319728821516037e-02 + <_> + + 0 -1 2551 3.6467831581830978e-02 + + 3.3053800463676453e-02 -3.1176608800888062e-01 + <_> + + 0 -1 2552 -4.8026088625192642e-03 + + -1.3096930086612701e-01 8.8815420866012573e-02 + <_> + + 0 -1 2553 -9.7134411334991455e-03 + + 1.2485890090465546e-01 -4.5851919800043106e-02 + <_> + + 0 -1 2554 -3.6871319753117859e-04 + + 1.0798580199480057e-01 -1.0795330256223679e-01 + <_> + 248 + -1.3472950458526611e+00 + + <_> + + 0 -1 2555 4.8573319800198078e-03 + + -2.2165919840335846e-01 2.0661990344524384e-01 + <_> + + 0 -1 2556 -9.0601091505959630e-04 + + 9.2684216797351837e-02 -3.4692689776420593e-01 + <_> + + 0 -1 2557 3.8109601009637117e-03 + + -4.7693979740142822e-01 7.2208866477012634e-02 + <_> + + 0 -1 2558 -1.9349349895492196e-03 + + -2.3474289476871490e-01 1.0308369994163513e-01 + <_> + + 0 -1 2559 4.6932199038565159e-03 + + -2.1755599975585938e-01 1.0297770053148270e-01 + <_> + + 0 -1 2560 -4.5681721530854702e-03 + + -3.2979539036750793e-01 6.2108699232339859e-02 + <_> + + 0 -1 2561 2.0976159721612930e-03 + + -2.7585551142692566e-01 7.4447788298130035e-02 + <_> + + 0 -1 2562 -2.3434460163116455e-02 + + -2.4517090618610382e-01 2.0888300612568855e-02 + <_> + + 0 -1 2563 -7.5489659793674946e-03 + + -2.3539499938488007e-01 8.0594792962074280e-02 + <_> + + 0 -1 2564 -1.3637889642268419e-03 + + 1.2462289631366730e-01 -1.4383980631828308e-01 + <_> + + 0 -1 2565 2.0881770178675652e-02 + + -2.5486978888511658e-01 7.0480130612850189e-02 + <_> + + 0 -1 2566 -1.6712560318410397e-03 + + -1.4747080206871033e-01 9.3597747385501862e-02 + <_> + + 0 -1 2567 -5.8552708476781845e-02 + + 3.7929660081863403e-01 -3.7892241030931473e-02 + <_> + + 0 -1 2568 -4.7591641545295715e-02 + + 3.4769389033317566e-01 -2.9484409838914871e-02 + <_> + + 0 -1 2569 5.7788072153925896e-03 + + 4.1627179831266403e-02 -3.8012310862541199e-01 + <_> + + 0 -1 2570 6.1923051252961159e-03 + + -7.9854242503643036e-02 1.4662300050258636e-01 + <_> + + 0 -1 2571 8.6211357265710831e-03 + + -7.9052597284317017e-02 1.9707180559635162e-01 + <_> + + 0 -1 2572 3.8787689805030823e-01 + + 9.9500510841608047e-03 -5.4955279827117920e-01 + <_> + + 0 -1 2573 1.2184830009937286e-01 + + 2.1560879424214363e-02 -7.1182191371917725e-01 + <_> + + 0 -1 2574 5.6779510341584682e-03 + + 5.0778731703758240e-02 -1.9817540049552917e-01 + <_> + + 0 -1 2575 -3.2407268881797791e-02 + + -6.5776360034942627e-01 1.8930230289697647e-02 + <_> + + 0 -1 2576 2.3834649473428726e-03 + + 3.5910621285438538e-02 -1.9386079907417297e-01 + <_> + + 0 -1 2577 4.4861159403808415e-04 + + 6.3049189746379852e-02 -2.3067280650138855e-01 + <_> + + 0 -1 2578 2.8381360694766045e-02 + + 1.3798769563436508e-02 -2.0287990570068359e-01 + <_> + + 0 -1 2579 -2.7084869798272848e-03 + + -1.6455270349979401e-01 8.1182733178138733e-02 + <_> + + 0 -1 2580 -1.3218579813838005e-02 + + 1.2929069995880127e-01 -4.9410581588745117e-02 + <_> + + 0 -1 2581 1.8623949727043509e-03 + + -2.7398198843002319e-01 4.5746099203824997e-02 + <_> + + 0 -1 2582 -6.6727721132338047e-03 + + -1.5167540311813354e-01 5.5587619543075562e-02 + <_> + + 0 -1 2583 1.9492399878799915e-03 + + -8.5547126829624176e-02 1.3712610304355621e-01 + <_> + + 0 -1 2584 -7.0978812873363495e-02 + + -7.7429318428039551e-01 5.5506629869341850e-03 + <_> + + 0 -1 2585 5.7003321126103401e-03 + + 6.0299661010503769e-02 -2.3000110685825348e-01 + <_> + + 0 -1 2586 6.6310778260231018e-02 + + -8.5690699517726898e-02 1.5169920027256012e-01 + <_> + + 0 -1 2587 -8.5291899740695953e-03 + + 1.4297589659690857e-01 -9.1805547475814819e-02 + <_> + + 0 -1 2588 5.1141469739377499e-03 + + 4.6917989850044250e-02 -1.3319849967956543e-01 + <_> + + 0 -1 2589 1.9523530500009656e-03 + + -1.4177489280700684e-01 1.0524170100688934e-01 + <_> + + 0 -1 2590 1.9558310508728027e-01 + + 1.4478860422968864e-02 -7.9985427856445312e-01 + <_> + + 0 -1 2591 5.3029200062155724e-03 + + 3.7237700074911118e-02 -2.6131349802017212e-01 + <_> + + 0 -1 2592 6.4814360812306404e-03 + + -4.9092698842287064e-02 2.5681778788566589e-01 + <_> + + 0 -1 2593 -6.1802868731319904e-03 + + -2.1317920088768005e-01 6.1390031129121780e-02 + <_> + + 0 -1 2594 1.9895739387720823e-03 + + -7.1335382759571075e-02 1.3002429902553558e-01 + <_> + + 0 -1 2595 -4.2928531183861196e-04 + + 7.2383478283882141e-02 -1.5643799304962158e-01 + <_> + + 0 -1 2596 -4.5690318802371621e-04 + + 7.5732357800006866e-02 -1.0932859778404236e-01 + <_> + + 0 -1 2597 -1.3333739340305328e-01 + + -5.4889208078384399e-01 1.9494550302624702e-02 + <_> + + 0 -1 2598 8.2705507520586252e-04 + + -1.8739989399909973e-01 5.7498261332511902e-02 + <_> + + 0 -1 2599 -1.6954699531197548e-03 + + -1.4100700616836548e-01 8.6548388004302979e-02 + <_> + + 0 -1 2600 9.8944529891014099e-03 + + 1.7898159101605415e-02 -3.1395688652992249e-01 + <_> + + 0 -1 2601 6.0766572132706642e-03 + + -1.3120110332965851e-01 9.1578528285026550e-02 + <_> + + 0 -1 2602 -3.5680279135704041e-02 + + -3.8880988955497742e-01 1.1377809569239616e-02 + <_> + + 0 -1 2603 8.7540567619726062e-04 + + 5.3022928535938263e-02 -2.1509949862957001e-01 + <_> + + 0 -1 2604 1.9438719609752297e-03 + + -8.1035703420639038e-02 1.3382309675216675e-01 + <_> + + 0 -1 2605 5.6398138403892517e-02 + + 1.4857930131256580e-02 -6.9551151990890503e-01 + <_> + + 0 -1 2606 -1.0274930391460657e-03 + + -1.9196349382400513e-01 4.7596029937267303e-02 + <_> + + 0 -1 2607 -3.3568819053471088e-03 + + 1.0466050356626511e-01 -1.0170979797840118e-01 + <_> + + 0 -1 2608 1.1734040081501007e-01 + + -4.6565439552068710e-02 2.0878739655017853e-01 + <_> + + 0 -1 2609 8.8005866855382919e-03 + + 9.1754652559757233e-02 -1.2221500277519226e-01 + <_> + + 0 -1 2610 2.4095149710774422e-03 + + -3.6752160638570786e-02 2.3443439602851868e-01 + <_> + + 0 -1 2611 -2.8434590785764158e-04 + + -1.9996729493141174e-01 4.7353159636259079e-02 + <_> + + 0 -1 2612 1.7623709514737129e-02 + + -2.2765519097447395e-02 2.5646668672561646e-01 + <_> + + 0 -1 2613 1.4121740125119686e-02 + + 2.2659989073872566e-02 -4.2449080944061279e-01 + <_> + + 0 -1 2614 -1.5290649607777596e-02 + + 2.4445760250091553e-01 -4.3145630508661270e-02 + <_> + + 0 -1 2615 -2.5426879525184631e-02 + + 4.1280931234359741e-01 -2.5002820417284966e-02 + <_> + + 0 -1 2616 8.7438793852925301e-03 + + 4.1931539773941040e-02 -1.2433040142059326e-01 + <_> + + 0 -1 2617 4.1642960160970688e-02 + + 2.1535869687795639e-02 -4.9062231183052063e-01 + <_> + + 0 -1 2618 7.0692330598831177e-02 + + -2.4307090789079666e-02 3.3606329560279846e-01 + <_> + + 0 -1 2619 -7.7690348029136658e-02 + + -7.3883998394012451e-01 1.3576829805970192e-02 + <_> + + 0 -1 2620 3.7781539140269160e-04 + + -9.6697732806205750e-02 9.4690509140491486e-02 + <_> + + 0 -1 2621 -1.1192850070074201e-03 + + -2.1631820499897003e-01 4.4235199689865112e-02 + <_> + + 0 -1 2622 5.9772249311208725e-02 + + -3.2024260610342026e-02 3.0602660775184631e-01 + <_> + + 0 -1 2623 -1.5417120419442654e-02 + + -3.4087839722633362e-01 2.8097979724407196e-02 + <_> + + 0 -1 2624 -6.3111339695751667e-03 + + 1.5327680110931396e-01 -4.7901459038257599e-02 + <_> + + 0 -1 2625 -1.8826499581336975e-02 + + -1.5269599854946136e-01 6.0955628752708435e-02 + <_> + + 0 -1 2626 -3.9223838597536087e-02 + + 2.6624131202697754e-01 -7.6400930993258953e-03 + <_> + + 0 -1 2627 -4.8653159290552139e-02 + + -4.5488500595092773e-01 1.9853049889206886e-02 + <_> + + 0 -1 2628 6.7260518670082092e-02 + + 1.0999150108546019e-03 -7.5273478031158447e-01 + <_> + + 0 -1 2629 1.2728190049529076e-03 + + -7.8121297061443329e-02 1.1816550046205521e-01 + <_> + + 0 -1 2630 -9.4147026538848877e-02 + + -5.2153587341308594e-01 1.4973170123994350e-02 + <_> + + 0 -1 2631 -4.7454461455345154e-02 + + 2.6547148823738098e-01 -3.0587410554289818e-02 + <_> + + 0 -1 2632 -5.6014367146417499e-04 + + -1.0506449639797211e-01 6.0161281377077103e-02 + <_> + + 0 -1 2633 -2.9601220740005374e-04 + + 6.2257450073957443e-02 -1.3126540184020996e-01 + <_> + + 0 -1 2634 -2.0918490365147591e-02 + + -2.0831510424613953e-01 2.6843119412660599e-02 + <_> + + 0 -1 2635 -7.2696260176599026e-03 + + -1.6227640211582184e-01 6.1937049031257629e-02 + <_> + + 0 -1 2636 7.2555372025817633e-04 + + -1.0315939784049988e-01 6.8040877580642700e-02 + <_> + + 0 -1 2637 2.0828839391469955e-02 + + -4.4557690620422363e-02 2.2167469561100006e-01 + <_> + + 0 -1 2638 8.7201192975044250e-02 + + 9.5432223752140999e-03 -5.8706420660018921e-01 + <_> + + 0 -1 2639 4.1596628725528717e-02 + + -3.0774539336562157e-02 2.8809019923210144e-01 + <_> + + 0 -1 2640 -2.6154879480600357e-02 + + -5.9353542327880859e-01 1.4388410374522209e-02 + <_> + + 0 -1 2641 2.7175429463386536e-01 + + 1.3717720285058022e-02 -5.4619067907333374e-01 + <_> + + 0 -1 2642 2.1811699494719505e-02 + + -1.6798110678792000e-02 2.9062330722808838e-01 + <_> + + 0 -1 2643 -1.9965929910540581e-02 + + -4.3052119016647339e-01 1.8917759880423546e-02 + <_> + + 0 -1 2644 -1.1561929713934660e-03 + + 8.8031537830829620e-02 -1.9590209424495697e-01 + <_> + + 0 -1 2645 -1.6627550357952714e-03 + + 8.9111559092998505e-02 -9.0959653258323669e-02 + <_> + + 0 -1 2646 -1.7325150547549129e-03 + + -1.1540830135345459e-01 5.3636670112609863e-02 + <_> + + 0 -1 2647 -3.9231408387422562e-02 + + 6.2471270561218262e-01 -1.3666920363903046e-02 + <_> + + 0 -1 2648 1.0423580184578896e-02 + + 2.4711130186915398e-02 -1.6751749813556671e-01 + <_> + + 0 -1 2649 2.2725639864802361e-03 + + -5.5126778781414032e-02 1.4781460165977478e-01 + <_> + + 0 -1 2650 -3.9644641801714897e-03 + + 1.1337990313768387e-01 -6.8672053515911102e-02 + <_> + + 0 -1 2651 4.0544760413467884e-03 + + 4.0180210024118423e-02 -2.3837350308895111e-01 + <_> + + 0 -1 2652 2.0538640674203634e-03 + + 3.2863691449165344e-02 -1.2495829910039902e-01 + <_> + + 0 -1 2653 2.9705381020903587e-03 + + 4.1810061782598495e-02 -2.0539659261703491e-01 + <_> + + 0 -1 2654 -8.3381328731775284e-03 + + 9.2258736491203308e-02 -3.8435179740190506e-02 + <_> + + 0 -1 2655 1.5640279743820429e-03 + + -9.6661567687988281e-02 8.5594817996025085e-02 + <_> + + 0 -1 2656 -3.7052970379590988e-02 + + -7.7915471792221069e-01 1.0418290272355080e-02 + <_> + + 0 -1 2657 -1.0109930299222469e-02 + + 1.2499059736728668e-01 -6.4437836408615112e-02 + <_> + + 0 -1 2658 -7.9335980117321014e-02 + + 7.0784372091293335e-01 -3.1601081136614084e-03 + <_> + + 0 -1 2659 -2.5811919476836920e-03 + + -1.6802759468555450e-01 6.7257612943649292e-02 + <_> + + 0 -1 2660 1.8863540142774582e-02 + + -5.2749298512935638e-02 1.4578150212764740e-01 + <_> + + 0 -1 2661 6.1697891214862466e-04 + + -9.6527166664600372e-02 9.3077242374420166e-02 + <_> + + 0 -1 2662 -9.9242655560374260e-03 + + 1.2164440006017685e-01 -2.6439830660820007e-02 + <_> + + 0 -1 2663 -4.7382008284330368e-02 + + -3.7194240093231201e-01 2.4884449318051338e-02 + <_> + + 0 -1 2664 3.8585590664297342e-03 + + -4.2420830577611923e-02 1.1997900158166885e-01 + <_> + + 0 -1 2665 2.3721279576420784e-03 + + -7.2769053280353546e-02 1.3027629256248474e-01 + <_> + + 0 -1 2666 -3.1968571245670319e-02 + + -4.7088149189949036e-01 1.8863039091229439e-02 + <_> + + 0 -1 2667 -7.2849751450121403e-04 + + 2.8128319978713989e-01 -3.0785139650106430e-02 + <_> + + 0 -1 2668 -1.2096880003809929e-02 + + -7.0163071155548096e-01 1.3336709700524807e-02 + <_> + + 0 -1 2669 -1.7658369615674019e-02 + + 1.9193160533905029e-01 -4.7951001673936844e-02 + <_> + + 0 -1 2670 -1.0974059812724590e-02 + + -2.7307328581809998e-01 2.8784489259123802e-02 + <_> + + 0 -1 2671 -1.8560180440545082e-02 + + -4.4306761026382446e-01 2.0472019910812378e-02 + <_> + + 0 -1 2672 1.3861100189387798e-02 + + -3.7471339106559753e-02 1.0929849743843079e-01 + <_> + + 0 -1 2673 5.6243170052766800e-02 + + 1.3322129845619202e-02 -6.1972159147262573e-01 + <_> + + 0 -1 2674 -1.3746799901127815e-02 + + 1.8980909883975983e-01 -4.3810151517391205e-02 + <_> + + 0 -1 2675 -2.0494889758992940e-04 + + -1.4809520542621613e-01 5.9458550065755844e-02 + <_> + + 0 -1 2676 1.1416030116379261e-02 + + 4.5111801475286484e-02 -1.7277219891548157e-01 + <_> + + 0 -1 2677 4.1169788688421249e-02 + + -2.3442840203642845e-02 3.3413231372833252e-01 + <_> + + 0 -1 2678 -9.6223354339599609e-03 + + -1.6086310148239136e-01 3.3183149993419647e-02 + <_> + + 0 -1 2679 1.5951909590512514e-03 + + -6.3590511679649353e-02 1.3396669924259186e-01 + <_> + + 0 -1 2680 -6.3169049099087715e-03 + + -1.6365319490432739e-01 5.1552049815654755e-02 + <_> + + 0 -1 2681 4.6467378735542297e-02 + + -2.5627709925174713e-02 3.8097569346427917e-01 + <_> + + 0 -1 2682 9.1598592698574066e-02 + + 4.2748241685330868e-03 -5.9740132093429565e-01 + <_> + + 0 -1 2683 -1.0416290024295449e-03 + + -1.4733889698982239e-01 5.5105950683355331e-02 + <_> + + 0 -1 2684 -2.3334469646215439e-02 + + 9.2266462743282318e-02 -5.3653880953788757e-02 + <_> + + 0 -1 2685 -6.3067381270229816e-03 + + -1.6974699497222900e-01 6.0046479105949402e-02 + <_> + + 0 -1 2686 5.2549671381711960e-03 + + -8.8989406824111938e-02 4.7306548804044724e-02 + <_> + + 0 -1 2687 -1.0699460282921791e-02 + + -1.5823520720005035e-01 5.1100831478834152e-02 + <_> + + 0 -1 2688 -5.4387808777391911e-03 + + 1.2524560093879700e-01 -3.9472699165344238e-02 + <_> + + 0 -1 2689 3.4613600000739098e-03 + + -6.8892680108547211e-02 1.7920389771461487e-01 + <_> + + 0 -1 2690 -1.7894359305500984e-02 + + -9.4599656760692596e-02 6.2322728335857391e-02 + <_> + + 0 -1 2691 -2.1147909760475159e-01 + + -8.6275768280029297e-01 9.4653964042663574e-03 + <_> + + 0 -1 2692 1.4149859780445695e-03 + + -8.6214788258075714e-02 4.0635921061038971e-02 + <_> + + 0 -1 2693 -1.5357299707829952e-03 + + 9.9525436758995056e-02 -7.7558159828186035e-02 + <_> + + 0 -1 2694 2.8714749496430159e-03 + + -6.3778772950172424e-02 1.1251030117273331e-01 + <_> + + 0 -1 2695 1.8400069326162338e-02 + + 2.3700669407844543e-02 -3.5953688621520996e-01 + <_> + + 0 -1 2696 -7.3078006505966187e-02 + + -8.3836638927459717e-01 2.1687510889023542e-03 + <_> + + 0 -1 2697 9.8323542624711990e-03 + + -5.3899969905614853e-02 1.6186970472335815e-01 + <_> + + 0 -1 2698 2.2987959906458855e-02 + + 1.5955159440636635e-02 -3.3074310421943665e-01 + <_> + + 0 -1 2699 -5.4363980889320374e-03 + + -1.3372650742530823e-01 5.8162450790405273e-02 + <_> + + 0 -1 2700 1.0177739895880222e-02 + + -5.7901948690414429e-02 4.0789060294628143e-02 + <_> + + 0 -1 2701 -5.1690369844436646e-02 + + 4.7881290316581726e-01 -2.0051179453730583e-02 + <_> + + 0 -1 2702 -4.6395331621170044e-02 + + 3.5422900319099426e-01 -1.6692889854311943e-02 + <_> + + 0 -1 2703 4.0920148603618145e-04 + + -5.8872789144515991e-02 1.3617689907550812e-01 + <_> + + 0 -1 2704 3.0743801034986973e-03 + + 3.1892731785774231e-02 -2.9396781325340271e-01 + <_> + + 0 -1 2705 1.3438959419727325e-01 + + 1.5018840320408344e-02 -5.1557308435440063e-01 + <_> + + 0 -1 2706 -4.4954590499401093e-02 + + -6.5404319763183594e-01 5.8901738375425339e-03 + <_> + + 0 -1 2707 -4.1479051113128662e-02 + + -5.6925541162490845e-01 1.3012220151722431e-02 + <_> + + 0 -1 2708 2.9117099940776825e-02 + + -1.9148029386997223e-02 1.8318380415439606e-01 + <_> + + 0 -1 2709 5.1073249429464340e-02 + + 1.5260309912264347e-02 -4.9480628967285156e-01 + <_> + + 0 -1 2710 7.0886377943679690e-04 + + 8.7698653340339661e-02 -7.3333673179149628e-02 + <_> + + 0 -1 2711 1.1835389770567417e-02 + + -3.9189878851175308e-02 2.0834849774837494e-01 + <_> + + 0 -1 2712 -4.2260489426553249e-03 + + -1.8733769655227661e-01 7.4666850268840790e-02 + <_> + + 0 -1 2713 3.4847799688577652e-02 + + -3.0572960153222084e-02 2.6511108875274658e-01 + <_> + + 0 -1 2714 1.2932980433106422e-02 + + 2.2224349901080132e-02 -2.3204100131988525e-01 + <_> + + 0 -1 2715 -3.4806900657713413e-03 + + 6.0548238456249237e-02 -1.3034850358963013e-01 + <_> + + 0 -1 2716 1.7225079238414764e-02 + + -6.7219920456409454e-03 1.1128149926662445e-01 + <_> + + 0 -1 2717 -2.4316289927810431e-03 + + -1.8720659613609314e-01 4.1284140199422836e-02 + <_> + + 0 -1 2718 -1.1786689981818199e-02 + + 1.5917420387268066e-01 -3.0763400718569756e-02 + <_> + + 0 -1 2719 -5.3132520988583565e-03 + + -1.3786070048809052e-01 5.4246630519628525e-02 + <_> + + 0 -1 2720 -2.0012039691209793e-02 + + 2.9359638690948486e-01 -2.6866350322961807e-02 + <_> + + 0 -1 2721 2.0955558866262436e-03 + + 6.7963063716888428e-02 -1.2520860135555267e-01 + <_> + + 0 -1 2722 -3.9648640900850296e-02 + + -5.8195388317108154e-01 1.3146690092980862e-02 + <_> + + 0 -1 2723 -3.4485850483179092e-02 + + 4.5559158921241760e-01 -1.8659429624676704e-02 + <_> + + 0 -1 2724 -4.4569540768861771e-02 + + -9.2067569494247437e-01 5.3931041620671749e-03 + <_> + + 0 -1 2725 -1.1394550092518330e-03 + + -2.1932439506053925e-01 3.6249380558729172e-02 + <_> + + 0 -1 2726 -3.7044081836938858e-02 + + 1.6192549467086792e-01 -4.7661919146776199e-02 + <_> + + 0 -1 2727 1.9300490617752075e-02 + + -5.4432831704616547e-02 1.4432109892368317e-01 + <_> + + 0 -1 2728 -1.4382150257006288e-03 + + -6.7343980073928833e-02 4.2511381208896637e-02 + <_> + + 0 -1 2729 3.8761008530855179e-02 + + 1.4171930029988289e-02 -5.3382647037506104e-01 + <_> + + 0 -1 2730 -1.5265800058841705e-01 + + -9.1533327102661133e-01 2.1413750946521759e-03 + <_> + + 0 -1 2731 -8.4089813753962517e-03 + + 1.7705249786376953e-01 -4.3753430247306824e-02 + <_> + + 0 -1 2732 -1.6673170030117035e-01 + + -5.6390452384948730e-01 7.5904577970504761e-03 + <_> + + 0 -1 2733 -7.3619261384010315e-03 + + -1.9691839814186096e-01 3.9698500186204910e-02 + <_> + + 0 -1 2734 -9.9920090287923813e-03 + + -1.3419510424137115e-01 6.3489198684692383e-02 + <_> + + 0 -1 2735 -2.2656610235571861e-03 + + 7.9676061868667603e-02 -1.0685960203409195e-01 + <_> + + 0 -1 2736 -1.3868820667266846e-01 + + -4.7306931018829346e-01 1.5354130417108536e-02 + <_> + + 0 -1 2737 -1.3284240663051605e-01 + + -8.7984371185302734e-01 7.0595988072454929e-03 + <_> + + 0 -1 2738 -2.4882299825549126e-02 + + 1.3333520293235779e-01 -4.0933601558208466e-02 + <_> + + 0 -1 2739 -6.6814320161938667e-03 + + -1.0295540094375610e-01 7.4870042502880096e-02 + <_> + + 0 -1 2740 6.0326699167490005e-02 + + 1.3355839997529984e-02 -3.7602999806404114e-01 + <_> + + 0 -1 2741 -8.5582301020622253e-02 + + 2.1200770139694214e-01 -3.8742028176784515e-02 + <_> + + 0 -1 2742 -1.2076400220394135e-02 + + -8.2457520067691803e-02 6.7780442535877228e-02 + <_> + + 0 -1 2743 2.0311089232563972e-02 + + -1.1817990243434906e-01 6.4830578863620758e-02 + <_> + + 0 -1 2744 -3.9900741539895535e-03 + + -1.5723599493503571e-01 5.3033929318189621e-02 + <_> + + 0 -1 2745 -1.4961370034143329e-03 + + 2.4392129480838776e-01 -3.1170839443802834e-02 + <_> + + 0 -1 2746 1.8568099767435342e-04 + + -1.9409550726413727e-01 4.5490209013223648e-02 + <_> + + 0 -1 2747 1.4796480536460876e-01 + + 6.2650348991155624e-03 -9.9987298250198364e-01 + <_> + + 0 -1 2748 1.6918669641017914e-01 + + 4.2962608858942986e-04 -3.5496100783348083e-01 + <_> + + 0 -1 2749 -1.9380000594537705e-04 + + -1.3056799769401550e-01 5.4877169430255890e-02 + <_> + + 0 -1 2750 -6.2729098135605454e-04 + + 4.1053570806980133e-02 -8.3174988627433777e-02 + <_> + + 0 -1 2751 -2.6877908967435360e-03 + + 1.5513989329338074e-01 -5.5573899298906326e-02 + <_> + + 0 -1 2752 -7.6885253190994263e-02 + + -6.1440211534500122e-01 3.2789220567792654e-03 + <_> + + 0 -1 2753 -1.6956549370661378e-04 + + 6.0934148728847504e-02 -1.4717090129852295e-01 + <_> + + 0 -1 2754 3.7390850484371185e-02 + + 8.8595114648342133e-03 -2.3843410611152649e-01 + <_> + + 0 -1 2755 -3.7611280567944050e-03 + + -1.1896059662103653e-01 5.4526679217815399e-02 + <_> + + 0 -1 2756 -7.5538672506809235e-02 + + 1. -2.8170819859951735e-03 + <_> + + 0 -1 2757 5.1163119496777654e-04 + + -1.1333829909563065e-01 6.8293251097202301e-02 + <_> + + 0 -1 2758 -5.4373521357774734e-02 + + 5.6772488355636597e-01 -5.5303489789366722e-03 + <_> + + 0 -1 2759 -1.2200759723782539e-02 + + 2.6310768723487854e-01 -3.5334069281816483e-02 + <_> + + 0 -1 2760 6.5340757369995117e-02 + + 8.2145677879452705e-03 -9.7914510965347290e-01 + <_> + + 0 -1 2761 -9.7028106451034546e-02 + + -7.5845307111740112e-01 6.8704010918736458e-03 + <_> + + 0 -1 2762 -4.9768280237913132e-02 + + -8.0786317586898804e-01 1.3162019895389676e-03 + <_> + + 0 -1 2763 -2.9802118660882115e-04 + + 8.5099622607231140e-02 -9.1054826974868774e-02 + <_> + + 0 -1 2764 1.0124569758772850e-02 + + -8.9172579348087311e-02 7.7402189373970032e-02 + <_> + + 0 -1 2765 8.1574246287345886e-03 + + -6.4016029238700867e-02 1.2462829798460007e-01 + <_> + + 0 -1 2766 -1.2093920260667801e-02 + + -1.8433560431003571e-01 4.9659188836812973e-02 + <_> + + 0 -1 2767 -1.1906909756362438e-02 + + 2.6277810335159302e-01 -2.9921159148216248e-02 + <_> + + 0 -1 2768 -8.1438422203063965e-02 + + -6.4389252662658691e-01 1.7232710495591164e-02 + <_> + + 0 -1 2769 1.4961180277168751e-03 + + -1.2228660285472870e-01 5.7763870805501938e-02 + <_> + + 0 -1 2770 -2.2651249542832375e-02 + + -1.1090759932994843e-01 7.0385642349720001e-02 + <_> + + 0 -1 2771 -2.3789770901203156e-02 + + 2.9644450545310974e-01 -2.5997739285230637e-02 + <_> + + 0 -1 2772 1.4299990143626928e-03 + + -8.9716851711273193e-02 5.6030821055173874e-02 + <_> + + 0 -1 2773 -4.1593458503484726e-02 + + -5.8160471916198730e-01 1.1599930003285408e-02 + <_> + + 0 -1 2774 -2.5586199481040239e-03 + + 6.2241408973932266e-02 -1.1328329890966415e-01 + <_> + + 0 -1 2775 -1.0252290219068527e-01 + + -8.5185718536376953e-01 8.2774916663765907e-03 + <_> + + 0 -1 2776 -3.1799520365893841e-03 + + -1.3918060064315796e-01 5.3719218820333481e-02 + <_> + + 0 -1 2777 -3.9835860952734947e-03 + + 1.5531490743160248e-01 -5.3399000316858292e-02 + <_> + + 0 -1 2778 1.0895960032939911e-02 + + 3.9084900170564651e-02 -2.1268959343433380e-01 + <_> + + 0 -1 2779 1.7865100875496864e-02 + + -2.5146210566163063e-02 3.3581560850143433e-01 + <_> + + 0 -1 2780 5.5075511336326599e-03 + + 2.3314310237765312e-02 -9.3666307628154755e-02 + <_> + + 0 -1 2781 2.0092551130801439e-03 + + 5.7231310755014420e-02 -1.4091749489307404e-01 + <_> + + 0 -1 2782 -1.2218699790537357e-02 + + 1.9243550300598145e-01 -2.4631109088659286e-02 + <_> + + 0 -1 2783 1.8039119895547628e-03 + + 5.5793199688196182e-02 -1.2940339744091034e-01 + <_> + + 0 -1 2784 2.2159840911626816e-02 + + -9.0001197531819344e-03 5.2156221866607666e-01 + <_> + + 0 -1 2785 -3.5827290266752243e-02 + + -6.2905979156494141e-01 1.1712389998137951e-02 + <_> + + 0 -1 2786 8.9478418231010437e-03 + + -3.7455581128597260e-02 1.0906309634447098e-01 + <_> + + 0 -1 2787 -1.2861900031566620e-01 + + -3.9527180790901184e-01 1.8151529133319855e-02 + <_> + + 0 -1 2788 1.8464029999449849e-03 + + -3.3952530473470688e-02 9.6596188843250275e-02 + <_> + + 0 -1 2789 2.8246780857443810e-03 + + -6.2633261084556580e-02 1.1198879778385162e-01 + <_> + + 0 -1 2790 6.9075852632522583e-02 + + 1.3590560294687748e-02 -5.2598261833190918e-01 + <_> + + 0 -1 2791 -8.0794151872396469e-03 + + 1.3081569969654083e-01 -5.0100728869438171e-02 + <_> + + 0 -1 2792 -3.7193649914115667e-03 + + -1.4887580275535583e-01 5.1823489367961884e-02 + <_> + + 0 -1 2793 2.0610638894140720e-03 + + -6.5545938909053802e-02 1.1345130205154419e-01 + <_> + + 0 -1 2794 -6.0795281082391739e-02 + + -7.8219258785247803e-01 4.5540397986769676e-03 + <_> + + 0 -1 2795 -7.3096780106425285e-03 + + -1.9586810469627380e-01 3.5591870546340942e-02 + <_> + + 0 -1 2796 -2.3796008899807930e-03 + + 4.3329920619726181e-02 -6.0119420289993286e-02 + <_> + + 0 -1 2797 -3.7874478846788406e-02 + + 1.6700419783592224e-01 -4.1082471609115601e-02 + <_> + + 0 -1 2798 -1.1011550202965736e-02 + + -7.9715803265571594e-02 3.2247040420770645e-02 + <_> + + 0 -1 2799 -1.5278880018740892e-03 + + 9.7541913390159607e-02 -9.4694830477237701e-02 + <_> + + 0 -1 2800 3.7144418805837631e-02 + + -4.4054100289940834e-03 4.4159731268882751e-01 + <_> + + 0 -1 2801 -4.9948949366807938e-02 + + -8.0400061607360840e-01 9.0302517637610435e-03 + <_> + + 0 -1 2802 -1.8558859825134277e-02 + + 1.8556900322437286e-01 -2.6648480445146561e-02 + <_> + 208 + -1.5900419950485229e+00 + + <_> + + 0 -1 2803 5.9106469154357910e-02 + + -1.9395799934864044e-01 2.7272081375122070e-01 + <_> + + 0 -1 2804 2.6784019544720650e-02 + + -4.2093229293823242e-01 1.2330240011215210e-01 + <_> + + 0 -1 2805 8.6407009512186050e-03 + + -3.0236870050430298e-01 1.3153509795665741e-01 + <_> + + 0 -1 2806 -1.1792869772762060e-03 + + 8.2713536918163300e-02 -3.5140541195869446e-01 + <_> + + 0 -1 2807 -2.2481461055576801e-03 + + -5.1323968172073364e-01 5.4614610970020294e-02 + <_> + + 0 -1 2808 5.7527530007064342e-03 + + -1.9243009388446808e-01 1.3872030377388000e-01 + <_> + + 0 -1 2809 1.0034020058810711e-02 + + 6.0773681849241257e-02 -3.1631371378898621e-01 + <_> + + 0 -1 2810 -3.2057110220193863e-03 + + 1.3471069931983948e-01 -1.6333019733428955e-01 + <_> + + 0 -1 2811 1.3803630135953426e-02 + + 7.4590288102626801e-02 -2.7751418948173523e-01 + <_> + + 0 -1 2812 -1.9213010370731354e-01 + + 2.6890340447425842e-01 -6.6552907228469849e-02 + <_> + + 0 -1 2813 -7.0279821753501892e-02 + + -3.2870158553123474e-01 4.9912039190530777e-02 + <_> + + 0 -1 2814 3.1519670039415359e-02 + + 3.5865701735019684e-02 -5.0489199161529541e-01 + <_> + + 0 -1 2815 -1.1164420284330845e-02 + + -2.7422958612442017e-01 7.3949173092842102e-02 + <_> + + 0 -1 2816 6.1416681855916977e-03 + + -8.7944798171520233e-02 1.5492740273475647e-01 + <_> + + 0 -1 2817 2.5183141231536865e-01 + + -9.3605853617191315e-02 1.8827579915523529e-01 + <_> + + 0 -1 2818 -1.9524399191141129e-02 + + -2.8733500838279724e-01 4.9147769808769226e-02 + <_> + + 0 -1 2819 -2.1689489483833313e-02 + + -3.3415651321411133e-01 4.8450991511344910e-02 + <_> + + 0 -1 2820 3.4099910408258438e-02 + + -1.4776800572872162e-01 1.1322359740734100e-01 + <_> + + 0 -1 2821 -2.0377550274133682e-02 + + -2.9778409004211426e-01 5.6795541197061539e-02 + <_> + + 0 -1 2822 2.3986540734767914e-02 + + -5.5139839649200439e-02 3.5672488808631897e-01 + <_> + + 0 -1 2823 -1.4578890055418015e-02 + + -3.3595868945121765e-01 4.9776330590248108e-02 + <_> + + 0 -1 2824 -5.4530607303604484e-04 + + 1.4906319975852966e-01 -1.2674619257450104e-01 + <_> + + 0 -1 2825 3.0076410621404648e-03 + + -3.8654258847236633e-01 3.7338510155677795e-02 + <_> + + 0 -1 2826 6.1654142336919904e-04 + + 7.0350617170333862e-02 -2.7769538760185242e-01 + <_> + + 0 -1 2827 5.1461078226566315e-02 + + 2.7613859623670578e-02 -4.9107590317726135e-01 + <_> + + 0 -1 2828 5.5607639253139496e-02 + + 2.7626939117908478e-02 -2.9615479707717896e-01 + <_> + + 0 -1 2829 2.9709029942750931e-02 + + 6.5961636602878571e-02 -2.0508719980716705e-01 + <_> + + 0 -1 2830 3.4046828746795654e-02 + + -3.8902580738067627e-02 2.4681000411510468e-01 + <_> + + 0 -1 2831 2.4807849898934364e-02 + + 3.5015519708395004e-02 -4.1401639580726624e-01 + <_> + + 0 -1 2832 4.0748160332441330e-02 + + 4.2967729270458221e-02 -3.2043859362602234e-01 + <_> + + 0 -1 2833 1.0664659552276134e-02 + + 5.6952890008687973e-02 -2.4745999276638031e-01 + <_> + + 0 -1 2834 -6.3090369105339050e-02 + + 1.6899240016937256e-01 -1.8692910671234131e-02 + <_> + + 0 -1 2835 3.4371189773082733e-02 + + -4.7546751797199249e-02 3.2781639695167542e-01 + <_> + + 0 -1 2836 -1.2518119812011719e-01 + + -5.6282979249954224e-01 1.3721459545195103e-02 + <_> + + 0 -1 2837 -2.2273709997534752e-02 + + 2.8452938795089722e-01 -4.7334741801023483e-02 + <_> + + 0 -1 2838 3.1560619827359915e-03 + + 6.7093066871166229e-02 -1.5777610242366791e-01 + <_> + + 0 -1 2839 -8.5235182195901871e-03 + + -4.5404490828514099e-01 3.0238900333642960e-02 + <_> + + 0 -1 2840 9.4529008492827415e-03 + + -5.5023040622472763e-02 1.4025360345840454e-01 + <_> + + 0 -1 2841 -1.5268090181052685e-02 + + -4.1039389371871948e-01 3.3160910010337830e-02 + <_> + + 0 -1 2842 1.0665830224752426e-02 + + -1.1716780066490173e-01 9.5943398773670197e-02 + <_> + + 0 -1 2843 -1.8211569637060165e-02 + + -2.4850100278854370e-01 6.7713633179664612e-02 + <_> + + 0 -1 2844 2.9094598721712828e-04 + + 4.9981009215116501e-02 -2.2298039495944977e-01 + <_> + + 0 -1 2845 1.2524049961939454e-03 + + -2.3567390441894531e-01 6.0058139264583588e-02 + <_> + + 0 -1 2846 -1.0200130194425583e-01 + + 4.6817669272422791e-01 -1.4046870172023773e-02 + <_> + + 0 -1 2847 -5.3803320974111557e-02 + + -3.8875138759613037e-01 3.8533151149749756e-02 + <_> + + 0 -1 2848 3.5919819027185440e-02 + + 1.7687749117612839e-02 -6.3149172067642212e-01 + <_> + + 0 -1 2849 -9.9846003577113152e-03 + + 2.3914399743080139e-01 -5.8490000665187836e-02 + <_> + + 0 -1 2850 2.2157909348607063e-02 + + -4.4814221560955048e-02 1.9423240423202515e-01 + <_> + + 0 -1 2851 -1.4240739867091179e-02 + + -3.7670499086380005e-01 3.4929048269987106e-02 + <_> + + 0 -1 2852 -5.9150479733943939e-02 + + 1.6816680133342743e-01 -3.5232000052928925e-02 + <_> + + 0 -1 2853 3.6074228584766388e-02 + + 2.2868489846587181e-02 -5.7828897237777710e-01 + <_> + + 0 -1 2854 5.7692300528287888e-02 + + -2.1003179252147675e-02 3.0750969052314758e-01 + <_> + + 0 -1 2855 -5.6619398295879364e-02 + + 2.3383679986000061e-01 -5.5003248155117035e-02 + <_> + + 0 -1 2856 -1.0697569698095322e-02 + + -1.3236419856548309e-01 9.1536827385425568e-02 + <_> + + 0 -1 2857 4.2940411367453635e-04 + + 5.2362058311700821e-02 -2.3470179736614227e-01 + <_> + + 0 -1 2858 3.9490307681262493e-03 + + 5.8583620935678482e-02 -8.2533597946166992e-02 + <_> + + 0 -1 2859 2.9810430482029915e-02 + + 7.1684047579765320e-02 -1.6931280493736267e-01 + <_> + + 0 -1 2860 -1.1462910100817680e-02 + + -2.6410359144210815e-01 4.4687580317258835e-02 + <_> + + 0 -1 2861 2.2996390238404274e-02 + + 3.2992180436849594e-02 -3.4358990192413330e-01 + <_> + + 0 -1 2862 -5.6792609393596649e-02 + + -7.5760507583618164e-01 2.4003670550882816e-03 + <_> + + 0 -1 2863 -4.4709402136504650e-03 + + 1.6277609765529633e-01 -6.8193063139915466e-02 + <_> + + 0 -1 2864 -1.2394989840686321e-02 + + -4.3603330850601196e-01 2.8416140004992485e-02 + <_> + + 0 -1 2865 2.9185590147972107e-01 + + -3.3300530165433884e-02 3.9866968989372253e-01 + <_> + + 0 -1 2866 3.3633329439908266e-03 + + -1.0972090065479279e-01 5.6931249797344208e-02 + <_> + + 0 -1 2867 -3.5175260156393051e-02 + + -5.7213717699050903e-01 2.0903490483760834e-02 + <_> + + 0 -1 2868 -1.2044839560985565e-02 + + 9.1090522706508636e-02 -1.1947949975728989e-01 + <_> + + 0 -1 2869 6.5466752275824547e-03 + + 2.2512340545654297e-01 -5.8309450745582581e-02 + <_> + + 0 -1 2870 -3.3635019790381193e-03 + + 8.3123452961444855e-02 -1.6144299507141113e-01 + <_> + + 0 -1 2871 -2.3451250046491623e-02 + + 2.5118809938430786e-01 -4.8030331730842590e-02 + <_> + + 0 -1 2872 1.9356099888682365e-02 + + 5.8134589344263077e-02 -2.0791250467300415e-01 + <_> + + 0 -1 2873 -8.9994952082633972e-02 + + -7.5068491697311401e-01 1.4169859699904919e-02 + <_> + + 0 -1 2874 1.2888260185718536e-02 + + 3.3752571791410446e-02 -2.5715011358261108e-01 + <_> + + 0 -1 2875 1.8961170688271523e-02 + + 3.4717381000518799e-02 -3.6027848720550537e-01 + <_> + + 0 -1 2876 -2.0835550501942635e-02 + + 5.7851308584213257e-01 -2.2111309692263603e-02 + <_> + + 0 -1 2877 1.0018779896199703e-02 + + -3.9775848388671875e-02 2.6814839243888855e-01 + <_> + + 0 -1 2878 -8.7516820058226585e-03 + + 1.1257819831371307e-01 -4.8538278788328171e-02 + <_> + + 0 -1 2879 -6.2366750091314316e-02 + + -6.6089111566543579e-01 1.6852140426635742e-02 + <_> + + 0 -1 2880 -1.9582180306315422e-02 + + -2.1182540059089661e-01 3.5702988505363464e-02 + <_> + + 0 -1 2881 2.2675599902868271e-03 + + 6.1212919652462006e-02 -2.0048849284648895e-01 + <_> + + 0 -1 2882 -4.6558458358049393e-02 + + -5.6454938650131226e-01 9.2866625636816025e-03 + <_> + + 0 -1 2883 -7.7152079902589321e-03 + + 1.5039919316768646e-01 -8.3328150212764740e-02 + <_> + + 0 -1 2884 4.1551668196916580e-02 + + 2.6247739791870117e-02 -3.2347521185874939e-01 + <_> + + 0 -1 2885 -2.1789079532027245e-02 + + -3.2375821471214294e-01 3.1726188957691193e-02 + <_> + + 0 -1 2886 1.9698198884725571e-03 + + -9.2564247548580170e-02 1.0823410004377365e-01 + <_> + + 0 -1 2887 -5.2744988352060318e-03 + + -1.3990330696105957e-01 7.7120877802371979e-02 + <_> + + 0 -1 2888 5.6007660925388336e-02 + + -1.0328499972820282e-01 1.1455559730529785e-01 + <_> + + 0 -1 2889 2.2741030156612396e-01 + + 1.6028450801968575e-02 -6.8145108222961426e-01 + <_> + + 0 -1 2890 5.1362380385398865e-02 + + -2.3025810718536377e-02 1.5446029603481293e-01 + <_> + + 0 -1 2891 -1.3017069548368454e-02 + + -3.2606399059295654e-01 3.2892610877752304e-02 + <_> + + 0 -1 2892 1.5782029926776886e-01 + + -3.9765262044966221e-03 7.7765262126922607e-01 + <_> + + 0 -1 2893 -9.9805086851119995e-02 + + 6.8609541654586792e-01 -1.4648180454969406e-02 + <_> + + 0 -1 2894 3.7506350874900818e-01 + + 1.4925800263881683e-02 -8.3105468750000000e-01 + <_> + + 0 -1 2895 -7.9828302841633558e-04 + + -2.0161899924278259e-01 4.7897689044475555e-02 + <_> + + 0 -1 2896 -2.1241609752178192e-01 + + -3.4409451484680176e-01 1.0950430296361446e-02 + <_> + + 0 -1 2897 3.9451681077480316e-02 + + 1.3966959901154041e-02 -7.2163110971450806e-01 + <_> + + 0 -1 2898 -2.9185509309172630e-02 + + -2.7462458610534668e-01 3.5496920347213745e-02 + <_> + + 0 -1 2899 2.7055600658059120e-02 + + -4.6995740383863449e-02 2.9289430379867554e-01 + <_> + + 0 -1 2900 -2.6052350178360939e-02 + + 2.0752039551734924e-01 -3.6353081464767456e-02 + <_> + + 0 -1 2901 5.7216219604015350e-02 + + 1.8895739689469337e-02 -5.7143908739089966e-01 + <_> + + 0 -1 2902 -1.7151840031147003e-02 + + -3.3009570837020874e-01 3.8528628647327423e-02 + <_> + + 0 -1 2903 -1.2304399907588959e-01 + + -7.8316390514373779e-01 1.1679390445351601e-02 + <_> + + 0 -1 2904 5.6786160916090012e-02 + + 1.1063819751143456e-02 -5.3526097536087036e-01 + <_> + + 0 -1 2905 1.1942840367555618e-01 + + 9.5137851312756538e-03 -9.0637218952178955e-01 + <_> + + 0 -1 2906 6.7707143723964691e-02 + + -3.9227519184350967e-02 2.8176560997962952e-01 + <_> + + 0 -1 2907 -5.4918881505727768e-02 + + -6.2061691284179688e-01 1.6072269529104233e-02 + <_> + + 0 -1 2908 9.2878006398677826e-03 + + -5.0339490175247192e-02 1.9040100276470184e-01 + <_> + + 0 -1 2909 -1.3141489587724209e-02 + + 1.8629829585552216e-01 -7.5528547167778015e-02 + <_> + + 0 -1 2910 2.9876120970584452e-04 + + -1.6163469851016998e-01 5.3589500486850739e-02 + <_> + + 0 -1 2911 1.0153599828481674e-01 + + 1.8458279967308044e-01 -6.2570616602897644e-02 + <_> + + 0 -1 2912 2.7205729484558105e-01 + + 1.3762479647994041e-02 -4.9364060163497925e-01 + <_> + + 0 -1 2913 5.8730211108922958e-02 + + -2.3933680355548859e-01 7.9166807234287262e-02 + <_> + + 0 -1 2914 1.9694259390234947e-02 + + 3.7195280194282532e-02 -2.6109260320663452e-01 + <_> + + 0 -1 2915 -1.0566900164121762e-04 + + 6.7052997648715973e-02 -1.6515819728374481e-01 + <_> + + 0 -1 2916 -1.9761279225349426e-02 + + 8.6443692445755005e-02 -6.8657971918582916e-02 + <_> + + 0 -1 2917 5.3168509155511856e-02 + + 2.9767790809273720e-02 -3.5225778818130493e-01 + <_> + + 0 -1 2918 2.6071069762110710e-02 + + 2.5216359645128250e-02 -1.4159369468688965e-01 + <_> + + 0 -1 2919 -2.8720689937472343e-02 + + 3.5941401124000549e-01 -2.9199620708823204e-02 + <_> + + 0 -1 2920 1.2989250011742115e-02 + + 4.0009770542383194e-02 -1.9973039627075195e-01 + <_> + + 0 -1 2921 -5.8176040649414062e-02 + + 2.9345899820327759e-01 -4.3967530131340027e-02 + <_> + + 0 -1 2922 2.8285140171647072e-02 + + 3.7457428872585297e-02 -3.1361749768257141e-01 + <_> + + 0 -1 2923 4.2701218277215958e-02 + + -2.0987769588828087e-02 5.0845777988433838e-01 + <_> + + 0 -1 2924 2.4763600900769234e-02 + + -1.1869250237941742e-01 9.4457350671291351e-02 + <_> + + 0 -1 2925 -2.8076129965484142e-03 + + -2.3249779641628265e-01 4.5222718268632889e-02 + <_> + + 0 -1 2926 -7.5583919882774353e-02 + + -4.5907029509544373e-01 1.2932280078530312e-02 + <_> + + 0 -1 2927 8.3796821534633636e-02 + + -1.5801630914211273e-02 6.8670481443405151e-01 + <_> + + 0 -1 2928 -3.7072401493787766e-02 + + 5.4146029055118561e-02 -4.2207449674606323e-02 + <_> + + 0 -1 2929 2.4691069498658180e-02 + + 2.6097679510712624e-02 -3.7760400772094727e-01 + <_> + + 0 -1 2930 -2.7743929997086525e-02 + + -7.8631508350372314e-01 4.7534159384667873e-03 + <_> + + 0 -1 2931 1.9119970500469208e-02 + + 2.6497760787606239e-02 -3.6489969491958618e-01 + <_> + + 0 -1 2932 3.3773269969969988e-03 + + 3.1966090202331543e-02 -3.2346761226654053e-01 + <_> + + 0 -1 2933 1.9876819103956223e-02 + + -3.5128418356180191e-02 2.9078298807144165e-01 + <_> + + 0 -1 2934 1.0035640001296997e-01 + + 1.4607840217649937e-02 -5.2812242507934570e-01 + <_> + + 0 -1 2935 -1.6163289546966553e-02 + + -1.0158140212297440e-01 1.1796499788761139e-01 + <_> + + 0 -1 2936 1.0253380052745342e-02 + + 3.6024410277605057e-02 -1.6520780324935913e-01 + <_> + + 0 -1 2937 9.0665705502033234e-03 + + -3.4731701016426086e-02 3.7327200174331665e-01 + <_> + + 0 -1 2938 3.0124900862574577e-02 + + 5.1758479326963425e-02 -2.3582160472869873e-01 + <_> + + 0 -1 2939 -6.6870311275124550e-03 + + 4.3394241482019424e-02 -2.5202989578247070e-01 + <_> + + 0 -1 2940 -2.0257479045540094e-03 + + -1.2479010224342346e-01 3.9309531450271606e-02 + <_> + + 0 -1 2941 2.3254070430994034e-02 + + -4.7446910291910172e-02 2.3287700116634369e-01 + <_> + + 0 -1 2942 2.3867199197411537e-02 + + -2.7421670034527779e-02 1.4630970358848572e-01 + <_> + + 0 -1 2943 -4.0523000061511993e-02 + + -4.0472960472106934e-01 3.0415959656238556e-02 + <_> + + 0 -1 2944 1.9958209991455078e-01 + + 2.2049469873309135e-02 -4.6558481454849243e-01 + <_> + + 0 -1 2945 -1.2990590184926987e-02 + + -1.7970620095729828e-01 5.8874938637018204e-02 + <_> + + 0 -1 2946 2.5623949244618416e-02 + + 9.9402610212564468e-03 -2.6575279235839844e-01 + <_> + + 0 -1 2947 -3.2004870474338531e-02 + + 2.5087380409240723e-01 -4.6291470527648926e-02 + <_> + + 0 -1 2948 1.8758419901132584e-02 + + -2.2038230672478676e-02 9.4407431781291962e-02 + <_> + + 0 -1 2949 4.5425668358802795e-02 + + 2.3371569812297821e-02 -4.8393398523330688e-01 + <_> + + 0 -1 2950 1.5670580789446831e-02 + + -5.5109858512878418e-02 1.9907830655574799e-01 + <_> + + 0 -1 2951 5.1336981356143951e-02 + + 2.6425419375300407e-02 -4.4082790613174438e-01 + <_> + + 0 -1 2952 4.0884170681238174e-02 + + 2.0071209967136383e-01 -3.4887779504060745e-02 + <_> + + 0 -1 2953 6.9165557622909546e-02 + + -2.9303310438990593e-02 3.4936821460723877e-01 + <_> + + 0 -1 2954 4.7967158257961273e-02 + + -2.4416960775852203e-02 2.7018651366233826e-01 + <_> + + 0 -1 2955 4.4068440794944763e-02 + + -4.0497269481420517e-02 2.4382269382476807e-01 + <_> + + 0 -1 2956 -1.0287550091743469e-01 + + 7.1105289459228516e-01 -9.9055245518684387e-03 + <_> + + 0 -1 2957 2.2407740354537964e-01 + + -5.4946999996900558e-02 1.9853439927101135e-01 + <_> + + 0 -1 2958 -9.6570551395416260e-03 + + -2.5050228834152222e-01 3.7410989403724670e-02 + <_> + + 0 -1 2959 7.9199701547622681e-02 + + -2.2147569805383682e-02 4.8771071434020996e-01 + <_> + + 0 -1 2960 4.5983199030160904e-02 + + 8.2229733467102051e-02 -3.9335750043392181e-02 + <_> + + 0 -1 2961 4.2670449614524841e-01 + + 1.7132800072431564e-02 -5.3996258974075317e-01 + <_> + + 0 -1 2962 1.5413990616798401e-01 + + 1.1902350001037121e-02 -6.8533718585968018e-01 + <_> + + 0 -1 2963 -1.7699889838695526e-01 + + -6.3113832473754883e-01 1.2545200064778328e-02 + <_> + + 0 -1 2964 -2.3769829422235489e-02 + + -1.4281429350376129e-01 1.4284349977970123e-02 + <_> + + 0 -1 2965 -8.3290286362171173e-02 + + 3.6433398723602295e-01 -2.5287430733442307e-02 + <_> + + 0 -1 2966 -3.0276349280029535e-03 + + -1.7501260340213776e-01 3.5528600215911865e-02 + <_> + + 0 -1 2967 9.3518232461065054e-04 + + -3.4317269921302795e-01 2.8196020051836967e-02 + <_> + + 0 -1 2968 8.6792530491948128e-03 + + 9.1854788362979889e-02 -1.1349800229072571e-01 + <_> + + 0 -1 2969 -4.3289531022310257e-03 + + 7.6560527086257935e-02 -1.2850379943847656e-01 + <_> + + 0 -1 2970 6.1485089361667633e-02 + + 4.0065501816570759e-03 -4.2798730731010437e-01 + <_> + + 0 -1 2971 -2.3108569905161858e-02 + + -3.2999789714813232e-01 3.1228100880980492e-02 + <_> + + 0 -1 2972 -6.3490739557892084e-04 + + 5.3318761289119720e-02 -6.0307938605546951e-02 + <_> + + 0 -1 2973 -4.1278889402747154e-03 + + 1.5029670298099518e-01 -8.9805796742439270e-02 + <_> + + 0 -1 2974 1.5408970415592194e-01 + + -2.3309229873120785e-03 9.6946477890014648e-01 + <_> + + 0 -1 2975 1.8083740025758743e-02 + + -4.6674519777297974e-02 2.1941949427127838e-01 + <_> + + 0 -1 2976 -6.0022968798875809e-02 + + 3.7283098697662354e-01 -1.3637940399348736e-02 + <_> + + 0 -1 2977 -1.6025049984455109e-01 + + 3.9442360401153564e-01 -2.4808609858155251e-02 + <_> + + 0 -1 2978 -2.3220200091600418e-02 + + -2.8352069854736328e-01 3.8456469774246216e-02 + <_> + + 0 -1 2979 3.2353829592466354e-02 + + 3.0197540298104286e-02 -3.5371699929237366e-01 + <_> + + 0 -1 2980 -1.2930749915540218e-02 + + -1.8275280296802521e-01 4.0219429880380630e-02 + <_> + + 0 -1 2981 -2.9022840317338705e-03 + + 5.7583440095186234e-02 -1.8175080418586731e-01 + <_> + + 0 -1 2982 3.7042409181594849e-02 + + 2.3471569642424583e-02 -3.7222048640251160e-01 + <_> + + 0 -1 2983 -1.4371460676193237e-01 + + -6.7353278398513794e-01 1.3768459670245647e-02 + <_> + + 0 -1 2984 -1.0714099742472172e-02 + + 2.3074600100517273e-01 -5.9898581355810165e-02 + <_> + + 0 -1 2985 1.1370699852705002e-02 + + -5.5859100073575974e-02 2.1604159474372864e-01 + <_> + + 0 -1 2986 -3.3829350024461746e-02 + + -3.2868561148643494e-01 1.6743719577789307e-02 + <_> + + 0 -1 2987 3.6406058818101883e-02 + + 2.3512810468673706e-02 -4.7999539971351624e-01 + <_> + + 0 -1 2988 -3.9853308349847794e-02 + + 3.0388408899307251e-01 -2.2388210520148277e-02 + <_> + + 0 -1 2989 2.3857640102505684e-02 + + -4.3960139155387878e-02 2.5021830201148987e-01 + <_> + + 0 -1 2990 -8.6149327456951141e-02 + + -9.2641222476959229e-01 1.0180849581956863e-02 + <_> + + 0 -1 2991 -2.7360459789633751e-02 + + -4.5331078767776489e-01 1.8517250195145607e-02 + <_> + + 0 -1 2992 4.6891667880117893e-03 + + 1.4983110129833221e-02 -9.8690867424011230e-02 + <_> + + 0 -1 2993 3.6140959709882736e-02 + + 2.1240329369902611e-02 -4.2275610566139221e-01 + <_> + + 0 -1 2994 1.0714419931173325e-01 + + -4.1592169553041458e-02 2.4880869686603546e-01 + <_> + + 0 -1 2995 -1.2024450115859509e-02 + + -1.8906030058860779e-01 5.5290900170803070e-02 + <_> + + 0 -1 2996 2.1671090275049210e-02 + + -3.7164088338613510e-02 2.9896330833435059e-01 + <_> + + 0 -1 2997 -3.3205719664692879e-03 + + -9.1837689280509949e-02 1.1810839921236038e-01 + <_> + + 0 -1 2998 -8.4256403148174286e-02 + + -5.4935282468795776e-01 4.6934271231293678e-03 + <_> + + 0 -1 2999 -2.7107410132884979e-03 + + 5.2301179617643356e-02 -2.1932560205459595e-01 + <_> + + 0 -1 3000 -1.9661630503833294e-03 + + 6.9522850215435028e-02 -1.2369599938392639e-01 + <_> + + 0 -1 3001 1.0835859924554825e-01 + + -1.6028439626097679e-02 6.7538297176361084e-01 + <_> + + 0 -1 3002 -4.0661569684743881e-02 + + 2.8239870071411133e-01 -1.8643079325556755e-02 + <_> + + 0 -1 3003 9.4869043678045273e-03 + + -1.4204730093479156e-01 7.4218176305294037e-02 + <_> + + 0 -1 3004 -8.1196203827857971e-03 + + 1.2733109295368195e-01 -7.5325429439544678e-02 + <_> + + 0 -1 3005 -3.6718908697366714e-02 + + 2.5209701061248779e-01 -3.8642361760139465e-02 + <_> + + 0 -1 3006 4.2515851557254791e-02 + + 3.4613508731126785e-02 -3.1406149268150330e-01 + <_> + + 0 -1 3007 -1.6484249383211136e-02 + + -3.4622931480407715e-01 2.6470340788364410e-02 + <_> + + 0 -1 3008 1.8608599901199341e-02 + + 3.1125839799642563e-02 -2.3837919533252716e-01 + <_> + + 0 -1 3009 -1.0872060433030128e-02 + + 2.3061220347881317e-01 -4.3469380587339401e-02 + <_> + + 0 -1 3010 -4.0728081017732620e-02 + + 1.3258880376815796e-01 -3.8833290338516235e-02 + <_> + 240 + -1.3404430150985718e+00 + + <_> + + 0 -1 3011 2.7802670374512672e-02 + + -1.8535159528255463e-01 2.3777860403060913e-01 + <_> + + 0 -1 3012 1.6392730176448822e-03 + + -2.6787629723548889e-01 1.1733309924602509e-01 + <_> + + 0 -1 3013 -3.0419689137488604e-03 + + 1.9552859663963318e-01 -1.3240019977092743e-01 + <_> + + 0 -1 3014 -2.7744288672693074e-04 + + 6.0701820999383926e-02 -3.0465421080589294e-01 + <_> + + 0 -1 3015 -2.7942769229412079e-03 + + -2.5370940566062927e-01 7.6147846877574921e-02 + <_> + + 0 -1 3016 7.4005699716508389e-03 + + 6.5623492002487183e-02 -3.0128520727157593e-01 + <_> + + 0 -1 3017 1.1316470336169004e-03 + + -1.3232930004596710e-01 1.3622519373893738e-01 + <_> + + 0 -1 3018 -8.7306648492813110e-03 + + -1.0246229916810989e-01 1.0649880394339561e-02 + <_> + + 0 -1 3019 -6.4327879808843136e-03 + + -2.1301789581775665e-01 7.7425397932529449e-02 + <_> + + 0 -1 3020 -1.3303949963301420e-03 + + 9.6234247088432312e-02 -1.7086009681224823e-01 + <_> + + 0 -1 3021 -2.3770590778440237e-03 + + 1.1657089740037918e-01 -1.5135769546031952e-01 + <_> + + 0 -1 3022 -5.3865360096096992e-03 + + -1.6851960122585297e-01 4.4324558228254318e-02 + <_> + + 0 -1 3023 -5.6973858736455441e-03 + + -2.4702399969100952e-01 7.7735342085361481e-02 + <_> + + 0 -1 3024 4.5654520392417908e-02 + + -1.6687670722603798e-02 1.4222119748592377e-01 + <_> + + 0 -1 3025 -1.4929420103726443e-05 + + -3.2725390791893005e-01 4.8142101615667343e-02 + <_> + + 0 -1 3026 -1.7635900294408202e-03 + + 7.0115849375724792e-02 -1.6864499077200890e-02 + <_> + + 0 -1 3027 1.9133860478177667e-03 + + -1.9570820033550262e-01 9.0169131755828857e-02 + <_> + + 0 -1 3028 -1.9309469498693943e-03 + + 1.1824289709329605e-01 -1.2146709859371185e-01 + <_> + + 0 -1 3029 9.7775761969387531e-04 + + 1.1657200008630753e-01 -1.2770849466323853e-01 + <_> + + 0 -1 3030 -5.2643800154328346e-03 + + 1.9958360493183136e-01 -6.2928676605224609e-02 + <_> + + 0 -1 3031 -2.2730689961463213e-03 + + -2.1804699301719666e-01 6.6565290093421936e-02 + <_> + + 0 -1 3032 -3.5128789022564888e-03 + + 8.1114247441291809e-02 -1.4230330288410187e-01 + <_> + + 0 -1 3033 2.8102330397814512e-03 + + 6.0884710401296616e-02 -2.2008429467678070e-01 + <_> + + 0 -1 3034 -2.3211359977722168e-02 + + 2.3182259500026703e-01 -3.4014280885457993e-02 + <_> + + 0 -1 3035 -8.7068388238549232e-03 + + -2.0691269636154175e-01 6.8004116415977478e-02 + <_> + + 0 -1 3036 7.0584798231720924e-03 + + -1.0500799864530563e-01 1.2610189616680145e-01 + <_> + + 0 -1 3037 -6.8878240883350372e-02 + + 4.2687618732452393e-01 -3.1305618584156036e-02 + <_> + + 0 -1 3038 -1.2785149738192558e-02 + + -2.0268030464649200e-01 3.2005790621042252e-02 + <_> + + 0 -1 3039 -4.2242300696671009e-03 + + -2.1619689464569092e-01 7.5660832226276398e-02 + <_> + + 0 -1 3040 -4.1660640388727188e-02 + + 3.5601380467414856e-01 -3.6500900983810425e-02 + <_> + + 0 -1 3041 1.4983239583671093e-02 + + 3.3663559705018997e-02 -4.3016681075096130e-01 + <_> + + 0 -1 3042 1.8940219888463616e-03 + + -7.7785640954971313e-02 1.4130039513111115e-01 + <_> + + 0 -1 3043 -1.0271830251440406e-03 + + 6.1292048543691635e-02 -1.8569129705429077e-01 + <_> + + 0 -1 3044 -1.0491760447621346e-02 + + -2.1280039846897125e-01 4.6641569584608078e-02 + <_> + + 0 -1 3045 4.1263508610427380e-03 + + -6.3113473355770111e-02 2.1683399379253387e-01 + <_> + + 0 -1 3046 2.1284529939293861e-02 + + -1.9541380926966667e-02 4.0555500984191895e-01 + <_> + + 0 -1 3047 6.0370927676558495e-03 + + 6.1322800815105438e-02 -1.7558750510215759e-01 + <_> + + 0 -1 3048 2.8550080023705959e-03 + + -3.7402968853712082e-02 8.6794376373291016e-02 + <_> + + 0 -1 3049 -3.0839299783110619e-02 + + 4.5826399326324463e-01 -2.2824319079518318e-02 + <_> + + 0 -1 3050 -1.2664640322327614e-02 + + -1.5179179608821869e-01 3.8325909525156021e-02 + <_> + + 0 -1 3051 8.4788333624601364e-03 + + -7.9164452850818634e-02 1.3821309804916382e-01 + <_> + + 0 -1 3052 -9.0271160006523132e-03 + + 2.0483429729938507e-01 -5.8428239077329636e-02 + <_> + + 0 -1 3053 -5.3999028168618679e-03 + + -1.9563870131969452e-01 6.2881819903850555e-02 + <_> + + 0 -1 3054 4.8698568716645241e-03 + + 4.7269448637962341e-02 -2.0357230305671692e-01 + <_> + + 0 -1 3055 -5.6715728715062141e-03 + + 1.6232620179653168e-01 -7.2473183274269104e-02 + <_> + + 0 -1 3056 -6.3621107256039977e-04 + + -1.7648829519748688e-01 6.1553929001092911e-02 + <_> + + 0 -1 3057 -5.7404721155762672e-03 + + -2.3773890733718872e-01 4.8493091017007828e-02 + <_> + + 0 -1 3058 2.3313059937208891e-03 + + -9.8087467253208160e-02 7.6705731451511383e-02 + <_> + + 0 -1 3059 2.6579289697110653e-03 + + -1.0429590195417404e-01 1.3275440037250519e-01 + <_> + + 0 -1 3060 -1.2426489964127541e-02 + + -1.7686119675636292e-01 7.8797861933708191e-02 + <_> + + 0 -1 3061 3.7596069741994143e-03 + + 5.8028500527143478e-02 -2.0235699415206909e-01 + <_> + + 0 -1 3062 -1.3941819779574871e-02 + + 2.9365628957748413e-01 -3.1069029122591019e-02 + <_> + + 0 -1 3063 2.4605529382824898e-02 + + -4.9767840653657913e-02 2.0446600019931793e-01 + <_> + + 0 -1 3064 1.1572279781103134e-01 + + 5.7542040012776852e-03 -5.5789208412170410e-01 + <_> + + 0 -1 3065 1.4880299568176270e-03 + + -1.2870499491691589e-01 8.6191363632678986e-02 + <_> + + 0 -1 3066 -1.0085869580507278e-02 + + -1.8718029558658600e-01 2.7143789455294609e-02 + <_> + + 0 -1 3067 -4.0125781670212746e-03 + + -1.4843569695949554e-01 6.1482351273298264e-02 + <_> + + 0 -1 3068 4.5241288840770721e-02 + + -2.2187199443578720e-02 4.9022749066352844e-01 + <_> + + 0 -1 3069 -5.4588477360084653e-04 + + 1.0740750283002853e-01 -9.4784751534461975e-02 + <_> + + 0 -1 3070 1.0822109878063202e-02 + + -1.1820139735937119e-01 8.4009647369384766e-02 + <_> + + 0 -1 3071 6.4339267555624247e-04 + + -1.1072149872779846e-01 8.4126397967338562e-02 + <_> + + 0 -1 3072 9.3544989824295044e-02 + + 6.1726439744234085e-03 -3.8121530413627625e-01 + <_> + + 0 -1 3073 -3.9214221760630608e-03 + + 1.2969920039176941e-01 -7.5530029833316803e-02 + <_> + + 0 -1 3074 -4.5141312293708324e-03 + + -2.1222509443759918e-01 5.0941351801156998e-02 + <_> + + 0 -1 3075 5.1563870161771774e-02 + + 1.1215999722480774e-02 -8.4125047922134399e-01 + <_> + + 0 -1 3076 -3.7086829543113708e-02 + + -3.3443790674209595e-01 1.2198350392282009e-02 + <_> + + 0 -1 3077 -1.5274320030584931e-03 + + 1.7022849619388580e-01 -5.3171109408140182e-02 + <_> + + 0 -1 3078 -3.3183719497174025e-03 + + 1.4972689747810364e-01 -3.9522700011730194e-02 + <_> + + 0 -1 3079 -1.0695139877498150e-02 + + -2.0767690241336823e-01 4.8223540186882019e-02 + <_> + + 0 -1 3080 8.0909933894872665e-03 + + -5.5572569370269775e-02 8.1361941993236542e-02 + <_> + + 0 -1 3081 8.9193560415878892e-04 + + -1.4888229966163635e-01 5.6974019855260849e-02 + <_> + + 0 -1 3082 2.1180939802434295e-04 + + -1.8776890635490417e-01 4.5087080448865891e-02 + <_> + + 0 -1 3083 6.8865409120917320e-03 + + -7.4651539325714111e-02 1.1806459724903107e-01 + <_> + + 0 -1 3084 3.8009819388389587e-01 + + 9.6241412684321404e-03 -5.0257128477096558e-01 + <_> + + 0 -1 3085 9.4844900071620941e-02 + + 2.0284110680222511e-02 -3.9478880167007446e-01 + <_> + + 0 -1 3086 -1.1133160296594724e-04 + + 5.3717028349637985e-02 -1.5433239936828613e-01 + <_> + + 0 -1 3087 3.5911630839109421e-02 + + -2.4374049156904221e-02 3.5077759623527527e-01 + <_> + + 0 -1 3088 -2.9291780665516853e-02 + + -4.9002739787101746e-01 2.1694840863347054e-02 + <_> + + 0 -1 3089 -2.4277189746499062e-02 + + -5.0206911563873291e-01 1.5807420015335083e-02 + <_> + + 0 -1 3090 1.2620110064744949e-02 + + -4.8637848347425461e-02 2.1370050311088562e-01 + <_> + + 0 -1 3091 -4.1045118123292923e-03 + + -1.6757939755916595e-01 6.2675923109054565e-02 + <_> + + 0 -1 3092 -2.3477169871330261e-01 + + 6.2205511331558228e-01 -1.3949319720268250e-02 + <_> + + 0 -1 3093 -6.7914247512817383e-02 + + -9.7014141082763672e-01 1.0490460321307182e-02 + <_> + + 0 -1 3094 1.4207609929144382e-03 + + -6.0801118612289429e-02 1.3500739634037018e-01 + <_> + + 0 -1 3095 -5.0894408486783504e-03 + + -1.6992169618606567e-01 5.0795670598745346e-02 + <_> + + 0 -1 3096 -1.9226800650358200e-02 + + 9.8861172795295715e-02 -3.3686220645904541e-02 + <_> + + 0 -1 3097 1.0590540245175362e-02 + + 5.9616900980472565e-02 -1.6495449841022491e-01 + <_> + + 0 -1 3098 3.3726880792528391e-03 + + -3.8652341812849045e-02 5.5400568991899490e-02 + <_> + + 0 -1 3099 -8.9012801647186279e-02 + + 4.0750509500503540e-01 -2.4150330573320389e-02 + <_> + + 0 -1 3100 -2.3359079658985138e-01 + + -7.2641909122467041e-01 6.5185138955712318e-03 + <_> + + 0 -1 3101 -2.2732259333133698e-01 + + -8.9977008104324341e-01 9.1146891936659813e-03 + <_> + + 0 -1 3102 -2.9601769521832466e-02 + + -4.3270850181579590e-01 1.6021190211176872e-02 + <_> + + 0 -1 3103 -6.9494689814746380e-03 + + 1.5218999981880188e-01 -6.1896830797195435e-02 + <_> + + 0 -1 3104 -1.9150479929521680e-03 + + 7.2570547461509705e-02 -1.3121089339256287e-01 + <_> + + 0 -1 3105 8.5106380283832550e-03 + + -5.7326089590787888e-02 1.5743100643157959e-01 + <_> + + 0 -1 3106 -2.4363139644265175e-02 + + 9.5700822770595551e-02 -5.8364428579807281e-02 + <_> + + 0 -1 3107 -2.2522659972310066e-02 + + -4.6943131089210510e-01 2.0241359248757362e-02 + <_> + + 0 -1 3108 -4.4660381972789764e-03 + + 7.6211109757423401e-02 -8.1844657659530640e-02 + <_> + + 0 -1 3109 -4.2101819999516010e-03 + + -2.2083589434623718e-01 4.7010198235511780e-02 + <_> + + 0 -1 3110 5.7130381464958191e-03 + + -6.2254000455141068e-02 5.2705820649862289e-02 + <_> + + 0 -1 3111 -5.6021669879555702e-03 + + -1.8985760211944580e-01 5.0114821642637253e-02 + <_> + + 0 -1 3112 -2.2042069584131241e-02 + + 8.7683752179145813e-02 -2.4777179583907127e-02 + <_> + + 0 -1 3113 -2.1817081142216921e-03 + + 1.6766600310802460e-01 -6.6771760582923889e-02 + <_> + + 0 -1 3114 2.4545300751924515e-02 + + 4.9205120652914047e-02 -2.2503720223903656e-01 + <_> + + 0 -1 3115 -2.4728688877075911e-03 + + 1.3539670407772064e-01 -6.2330130487680435e-02 + <_> + + 0 -1 3116 2.3717728909105062e-03 + + 5.7926058769226074e-02 -1.3325250148773193e-01 + <_> + + 0 -1 3117 -3.8999661803245544e-02 + + 2.9875481128692627e-01 -3.0257239937782288e-02 + <_> + + 0 -1 3118 -1.7835620092228055e-03 + + 9.2680282890796661e-02 -7.4350588023662567e-02 + <_> + + 0 -1 3119 1.9984450191259384e-02 + + 2.2409349679946899e-02 -4.1501939296722412e-01 + <_> + + 0 -1 3120 4.1170548647642136e-03 + + 5.3432278335094452e-02 -1.5092259645462036e-01 + <_> + + 0 -1 3121 4.3995600193738937e-02 + + 1.1389889754354954e-02 -6.6494518518447876e-01 + <_> + + 0 -1 3122 -3.5350578837096691e-03 + + 1.1005590111017227e-01 -7.6377056539058685e-02 + <_> + + 0 -1 3123 1.4632029924541712e-03 + + -5.6962151080369949e-02 1.3184599578380585e-01 + <_> + + 0 -1 3124 -4.9925539642572403e-03 + + -1.4675070345401764e-01 5.5129978805780411e-02 + <_> + + 0 -1 3125 -7.8646428883075714e-02 + + -5.2768182754516602e-01 1.3662739656865597e-02 + <_> + + 0 -1 3126 -4.3559111654758453e-03 + + 9.1798119246959686e-02 -5.7598169893026352e-02 + <_> + + 0 -1 3127 8.2531487569212914e-03 + + -6.5613977611064911e-02 1.3083070516586304e-01 + <_> + + 0 -1 3128 -3.5033349413424730e-03 + + -1.2742599844932556e-01 6.0875169932842255e-02 + <_> + + 0 -1 3129 3.9662471972405910e-03 + + -5.5715151131153107e-02 1.4783249795436859e-01 + <_> + + 0 -1 3130 -1.0260219685733318e-02 + + -1.3472290337085724e-01 4.4514350593090057e-02 + <_> + + 0 -1 3131 3.6724930396303535e-04 + + -1.3727700710296631e-01 6.1179649084806442e-02 + <_> + + 0 -1 3132 1.9500199705362320e-02 + + -5.9033330529928207e-02 1.5589320659637451e-01 + <_> + + 0 -1 3133 1.4041420072317123e-02 + + 2.2140439599752426e-02 -4.2831090092658997e-01 + <_> + + 0 -1 3134 3.8459740579128265e-02 + + 1.6875730827450752e-02 -5.2425742149353027e-01 + <_> + + 0 -1 3135 -2.5901539251208305e-02 + + 2.5163099169731140e-01 -3.2579511404037476e-02 + <_> + + 0 -1 3136 2.8264479711651802e-02 + + 2.1297719329595566e-02 -2.3978309333324432e-01 + <_> + + 0 -1 3137 -5.3067881613969803e-02 + + 7.6594692468643188e-01 -1.0163240134716034e-02 + <_> + + 0 -1 3138 1.6842440236359835e-03 + + 4.0168728679418564e-02 -2.1810980141162872e-01 + <_> + + 0 -1 3139 6.5255112713202834e-04 + + -3.2155249267816544e-02 2.6028048992156982e-01 + <_> + + 0 -1 3140 -1.5381099283695221e-01 + + -7.9570180177688599e-01 9.9420538172125816e-03 + <_> + + 0 -1 3141 -1.7530319746583700e-04 + + 6.1257161200046539e-02 -1.1830890178680420e-01 + <_> + + 0 -1 3142 1.1829809518530965e-03 + + -8.2589529454708099e-02 5.8234758675098419e-02 + <_> + + 0 -1 3143 1.4753890223801136e-02 + + 4.6728778630495071e-02 -1.9874340295791626e-01 + <_> + + 0 -1 3144 1.0592579841613770e-02 + + -5.7157158851623535e-02 1.2261729687452316e-01 + <_> + + 0 -1 3145 -4.6638969331979752e-02 + + 3.9221999049186707e-01 -1.8770450726151466e-02 + <_> + + 0 -1 3146 -2.2761020809412003e-03 + + -1.9819819927215576e-01 3.2669950276613235e-02 + <_> + + 0 -1 3147 -8.9252636826131493e-05 + + -1.7795699834823608e-01 4.5088160783052444e-02 + <_> + + 0 -1 3148 -4.8888921737670898e-03 + + 3.7973329424858093e-01 -2.5622500106692314e-02 + <_> + + 0 -1 3149 -4.7039450146257877e-03 + + -1.4075440168380737e-01 5.1885869354009628e-02 + <_> + + 0 -1 3150 6.8887867964804173e-03 + + -6.0707900673151016e-02 6.7318782210350037e-02 + <_> + + 0 -1 3151 9.4449967145919800e-02 + + -4.3975159525871277e-02 1.6885830461978912e-01 + <_> + + 0 -1 3152 5.1520671695470810e-02 + + 3.8239071145653725e-03 -6.3077712059020996e-01 + <_> + + 0 -1 3153 6.3957129605114460e-03 + + 4.4094309210777283e-02 -1.8156020343303680e-01 + <_> + + 0 -1 3154 -4.9659270793199539e-02 + + 1.1174239963293076e-01 -5.5821210145950317e-02 + <_> + + 0 -1 3155 -6.9081829860806465e-03 + + -1.4038950204849243e-01 5.9535760432481766e-02 + <_> + + 0 -1 3156 9.2546567320823669e-03 + + -3.3587910234928131e-02 5.8593101799488068e-02 + <_> + + 0 -1 3157 5.0454521551728249e-03 + + 5.3777661174535751e-02 -1.3626030087471008e-01 + <_> + + 0 -1 3158 -3.3333420753479004e-02 + + 2.4641269445419312e-01 -3.1888678669929504e-02 + <_> + + 0 -1 3159 6.1201080679893494e-02 + + 2.0013030618429184e-02 -3.9326569437980652e-01 + <_> + + 0 -1 3160 -1.0175120085477829e-02 + + 7.5324602425098419e-02 -3.9622548967599869e-02 + <_> + + 0 -1 3161 1.0271370410919189e-02 + + -5.2234519273042679e-02 1.7939470708370209e-01 + <_> + + 0 -1 3162 -5.1337860524654388e-02 + + -3.1097239255905151e-01 2.1656470373272896e-02 + <_> + + 0 -1 3163 2.3615739773958921e-03 + + -6.4843319356441498e-02 1.1771979928016663e-01 + <_> + + 0 -1 3164 -2.7691819705069065e-03 + + 1.4682589471340179e-01 -5.7794518768787384e-02 + <_> + + 0 -1 3165 2.1457809954881668e-02 + + 2.5269350036978722e-02 -3.3404821157455444e-01 + <_> + + 0 -1 3166 -5.9619098901748657e-03 + + 9.9241338670253754e-02 -3.5371959209442139e-02 + <_> + + 0 -1 3167 7.5217390060424805e-01 + + 7.7095897868275642e-03 -8.6434108018875122e-01 + <_> + + 0 -1 3168 -9.2514551943168044e-04 + + 3.8251910358667374e-02 -7.5597628951072693e-02 + <_> + + 0 -1 3169 4.0818289853632450e-03 + + 6.6699139773845673e-02 -1.1289499700069427e-01 + <_> + + 0 -1 3170 1.6256010159850121e-02 + + -1.8782900646328926e-02 1.8875749409198761e-01 + <_> + + 0 -1 3171 -9.3405954539775848e-03 + + -1.6462349891662598e-01 4.6859718859195709e-02 + <_> + + 0 -1 3172 -3.8136378861963749e-04 + + 6.0498170554637909e-02 -1.0089360177516937e-01 + <_> + + 0 -1 3173 -2.3470960557460785e-02 + + 1.8546760082244873e-01 -3.9577301591634750e-02 + <_> + + 0 -1 3174 -7.8684352338314056e-02 + + -6.0540008544921875e-01 1.3162979856133461e-02 + <_> + + 0 -1 3175 1.0616140067577362e-01 + + 9.4080185517668724e-03 -7.2416877746582031e-01 + <_> + + 0 -1 3176 -6.9211378693580627e-02 + + -9.2819648981094360e-01 5.4140980355441570e-03 + <_> + + 0 -1 3177 -4.3828289955854416e-02 + + 5.4933768510818481e-01 -1.5516829676926136e-02 + <_> + + 0 -1 3178 5.6881271302700043e-03 + + 3.7328861653804779e-02 -1.2019480019807816e-01 + <_> + + 0 -1 3179 3.6933881044387817e-01 + + -9.9545158445835114e-03 8.1607538461685181e-01 + <_> + + 0 -1 3180 -1.0447519831359386e-02 + + 1.4190499484539032e-01 -4.9798399209976196e-02 + <_> + + 0 -1 3181 1.5151320025324821e-02 + + 2.2705320268869400e-02 -3.4523698687553406e-01 + <_> + + 0 -1 3182 1.2503850460052490e-01 + + -2.7150910347700119e-02 3.0379050970077515e-01 + <_> + + 0 -1 3183 -9.1995187103748322e-03 + + -1.7020559310913086e-01 4.4314298778772354e-02 + <_> + + 0 -1 3184 7.1795531548559666e-03 + + -7.8971788287162781e-02 6.3919156789779663e-02 + <_> + + 0 -1 3185 -1.8217830359935760e-01 + + -9.7598892450332642e-01 7.1003441698849201e-03 + <_> + + 0 -1 3186 1.5047369743115269e-05 + + -9.8960377275943756e-02 3.9371099323034286e-02 + <_> + + 0 -1 3187 -3.8763400167226791e-02 + + -5.9095138311386108e-01 1.0429039597511292e-02 + <_> + + 0 -1 3188 -4.3799880892038345e-02 + + 2.5290209054946899e-01 -9.5704924315214157e-03 + <_> + + 0 -1 3189 -5.6705519556999207e-02 + + -7.2466772794723511e-01 9.0332692489027977e-03 + <_> + + 0 -1 3190 7.5183928012847900e-02 + + -6.7565650679171085e-03 7.3075437545776367e-01 + <_> + + 0 -1 3191 -6.4183590002357960e-03 + + 8.5421830415725708e-02 -7.6056882739067078e-02 + <_> + + 0 -1 3192 1.3349299551919103e-03 + + 6.9977663457393646e-02 -9.2187918722629547e-02 + <_> + + 0 -1 3193 2.8028399683535099e-03 + + -5.0953198224306107e-02 1.2934680283069611e-01 + <_> + + 0 -1 3194 -6.4196899533271790e-02 + + -6.1751341819763184e-01 8.7323756888508797e-03 + <_> + + 0 -1 3195 1.7879910301417112e-03 + + -5.9445429593324661e-02 1.1325009912252426e-01 + <_> + + 0 -1 3196 2.3370790295302868e-03 + + 2.2643320262432098e-02 -1.7427070438861847e-01 + <_> + + 0 -1 3197 2.1500359289348125e-03 + + -5.1846258342266083e-02 1.5027989447116852e-01 + <_> + + 0 -1 3198 -2.9744949191808701e-02 + + -1.7235560715198517e-01 1.6160540282726288e-02 + <_> + + 0 -1 3199 -2.9182229191064835e-03 + + -1.1646019667387009e-01 5.3380940109491348e-02 + <_> + + 0 -1 3200 -5.2581899799406528e-03 + + -8.4262102842330933e-02 3.6880351603031158e-02 + <_> + + 0 -1 3201 2.0302489399909973e-02 + + -5.3297229111194611e-02 1.6949890553951263e-01 + <_> + + 0 -1 3202 3.1120770145207644e-03 + + 4.4630430638790131e-02 -1.4054660499095917e-01 + <_> + + 0 -1 3203 -7.7524736523628235e-02 + + -6.5038281679153442e-01 1.0468889959156513e-02 + <_> + + 0 -1 3204 2.0978450775146484e-02 + + -3.0001569539308548e-02 1.9233350455760956e-01 + <_> + + 0 -1 3205 2.0581670105457306e-03 + + 5.1535431295633316e-02 -1.3114020228385925e-01 + <_> + + 0 -1 3206 -7.8407032415270805e-03 + + -1.3882939517498016e-01 5.0657931715250015e-02 + <_> + + 0 -1 3207 -7.1894749999046326e-02 + + 2.1866980195045471e-01 -3.3615190535783768e-02 + <_> + + 0 -1 3208 1.4218500256538391e-01 + + 1.2880220077931881e-02 -5.8853518962860107e-01 + <_> + + 0 -1 3209 4.4800378382205963e-03 + + -5.5522039532661438e-02 1.1976230144500732e-01 + <_> + + 0 -1 3210 -9.4673000276088715e-03 + + -1.2036380171775818e-01 3.0232360586524010e-02 + <_> + + 0 -1 3211 -1.2275399640202522e-03 + + 8.3563826978206635e-02 -8.7046720087528229e-02 + <_> + + 0 -1 3212 -6.2556960619986057e-03 + + 6.9355137646198273e-02 -3.5146340727806091e-02 + <_> + + 0 -1 3213 6.4953900873661041e-02 + + -1.9296510145068169e-02 3.4898158907890320e-01 + <_> + + 0 -1 3214 -3.2067541033029556e-03 + + -1.5205690264701843e-01 5.5897928774356842e-02 + <_> + + 0 -1 3215 -4.8260089010000229e-02 + + -6.0309630632400513e-01 1.0463859885931015e-02 + <_> + + 0 -1 3216 -4.2638331651687622e-03 + + -1.5278290212154388e-01 1.8424319103360176e-02 + <_> + + 0 -1 3217 4.9363691359758377e-02 + + -2.5442009791731834e-02 3.9227759838104248e-01 + <_> + + 0 -1 3218 2.3624610621482134e-03 + + 3.8519620895385742e-01 -1.7071360722184181e-02 + <_> + + 0 -1 3219 2.5921489577740431e-03 + + -1.5459729731082916e-01 4.3975789099931717e-02 + <_> + + 0 -1 3220 1.1510170064866543e-02 + + 6.0740210115909576e-02 -9.8671890795230865e-02 + <_> + + 0 -1 3221 3.9182868786156178e-03 + + 2.6165749877691269e-02 -2.9697629809379578e-01 + <_> + + 0 -1 3222 7.3265641927719116e-02 + + 5.5715530179440975e-03 -3.0474159121513367e-01 + <_> + + 0 -1 3223 -4.8912810161709785e-03 + + 1.2753780186176300e-01 -6.6236838698387146e-02 + <_> + + 0 -1 3224 -1.3187030330300331e-02 + + -2.0257690548896790e-01 3.0369829386472702e-02 + <_> + + 0 -1 3225 1.8196239834651351e-03 + + 4.9198139458894730e-02 -1.3782709836959839e-01 + <_> + + 0 -1 3226 -1.0299400426447392e-02 + + 1.3534359633922577e-01 -2.9193470254540443e-02 + <_> + + 0 -1 3227 1.7157079279422760e-01 + + -9.5548974350094795e-03 7.1399718523025513e-01 + <_> + + 0 -1 3228 -3.4571110736578703e-03 + + 6.1094630509614944e-02 -7.6816998422145844e-02 + <_> + + 0 -1 3229 3.3349241130053997e-04 + + -1.8768610060214996e-01 3.9411719888448715e-02 + <_> + + 0 -1 3230 5.6019209325313568e-02 + + 8.5914824157953262e-03 -7.3577058315277100e-01 + <_> + + 0 -1 3231 6.2299368437379599e-04 + + -9.4062000513076782e-02 6.7965887486934662e-02 + <_> + + 0 -1 3232 -1.4288679696619511e-02 + + 2.4144929647445679e-01 -2.7025459334254265e-02 + <_> + + 0 -1 3233 -9.9114552140235901e-03 + + -1.5346029400825500e-01 5.3243361413478851e-02 + <_> + + 0 -1 3234 -7.0727966725826263e-02 + + -7.1243101358413696e-01 7.4889077804982662e-03 + <_> + + 0 -1 3235 1.6112169250845909e-02 + + -3.5437509417533875e-02 2.2026020288467407e-01 + <_> + + 0 -1 3236 2.9938609804958105e-03 + + 1.1530820280313492e-02 -9.2017240822315216e-02 + <_> + + 0 -1 3237 1.4030840247869492e-03 + + 5.4302141070365906e-02 -1.1777610331773758e-01 + <_> + + 0 -1 3238 -8.9894913136959076e-02 + + -6.7658591270446777e-01 1.5741019742563367e-03 + <_> + + 0 -1 3239 2.7459259144961834e-03 + + 2.9860800132155418e-02 -2.2091430425643921e-01 + <_> + + 0 -1 3240 2.2225940600037575e-02 + + -4.6592909842729568e-02 8.0418691039085388e-02 + <_> + + 0 -1 3241 4.4512529857456684e-03 + + 1.0706499963998795e-01 -6.5101496875286102e-02 + <_> + + 0 -1 3242 -2.1191150881350040e-03 + + 3.9871860295534134e-02 -5.2555959671735764e-02 + <_> + + 0 -1 3243 1.0229589790105820e-01 + + 1.3386270031332970e-02 -4.5546561479568481e-01 + <_> + + 0 -1 3244 -6.8260570988059044e-03 + + 1.2695349752902985e-01 -5.9704031795263290e-02 + <_> + + 0 -1 3245 -5.6890580803155899e-02 + + 4.0180799365043640e-01 -1.6048269346356392e-02 + <_> + + 0 -1 3246 -1.8590029329061508e-02 + + -4.0374109148979187e-01 1.3502580113708973e-02 + <_> + + 0 -1 3247 3.3882200717926025e-02 + + 7.8824451193213463e-03 -7.9268622398376465e-01 + <_> + + 0 -1 3248 1.8759339582175016e-03 + + -3.4521240741014481e-02 1.8177880346775055e-01 + <_> + + 0 -1 3249 1.5652549918740988e-03 + + 4.8419889062643051e-02 -1.5185169875621796e-01 + <_> + + 0 -1 3250 3.9563868194818497e-03 + + -4.2162090539932251e-02 7.8943721950054169e-02 + <_> + 199 + -1.4275209903717041e+00 + + <_> + + 0 -1 3251 8.8487491011619568e-02 + + -2.2935929894447327e-01 2.4001109600067139e-01 + <_> + + 0 -1 3252 4.3344359844923019e-02 + + -1.9927449524402618e-01 2.0298740267753601e-01 + <_> + + 0 -1 3253 1.5985079109668732e-02 + + -1.9890889525413513e-01 1.9233879446983337e-01 + <_> + + 0 -1 3254 9.8411232233047485e-02 + + -9.4830892980098724e-02 2.4474050104618073e-01 + <_> + + 0 -1 3255 1.0079979896545410e-02 + + -4.8000910878181458e-01 5.9808451682329178e-02 + <_> + + 0 -1 3256 6.2629938125610352e-02 + + -1.5902659296989441e-01 1.5163069963455200e-01 + <_> + + 0 -1 3257 1.3623869977891445e-02 + + -2.7451339364051819e-01 9.0433366596698761e-02 + <_> + + 0 -1 3258 -3.8067731074988842e-03 + + -2.9342180490493774e-01 7.3020830750465393e-02 + <_> + + 0 -1 3259 -1.4649610035121441e-02 + + 2.6059079170227051e-01 -9.5248378813266754e-02 + <_> + + 0 -1 3260 -4.9288192531093955e-04 + + 5.9352219104766846e-02 -2.8081470727920532e-01 + <_> + + 0 -1 3261 -5.1220930181443691e-03 + + -2.4218030273914337e-01 8.1701509654521942e-02 + <_> + + 0 -1 3262 3.3120220177806914e-04 + + -4.0093910694122314e-01 3.4026090055704117e-02 + <_> + + 0 -1 3263 -7.4724480509757996e-04 + + 6.0560788959264755e-02 -2.9127869009971619e-01 + <_> + + 0 -1 3264 4.8829670995473862e-02 + + -7.2298422455787659e-02 2.6132971048355103e-01 + <_> + + 0 -1 3265 2.6994010433554649e-02 + + 9.5457129180431366e-02 -2.6758649945259094e-01 + <_> + + 0 -1 3266 -2.1151660475879908e-03 + + -2.5773069262504578e-01 5.3247869014739990e-02 + <_> + + 0 -1 3267 2.2652999177807942e-05 + + -3.0092310905456543e-01 5.9096790850162506e-02 + <_> + + 0 -1 3268 1.1034930124878883e-02 + + -7.4277937412261963e-02 1.9048790633678436e-01 + <_> + + 0 -1 3269 -1.0275219567120075e-02 + + -3.2835999131202698e-01 4.9218688160181046e-02 + <_> + + 0 -1 3270 -8.3319991827011108e-03 + + -2.9651468992233276e-01 3.9428789168596268e-02 + <_> + + 0 -1 3271 5.0808671861886978e-02 + + -4.7661241143941879e-02 3.7404251098632812e-01 + <_> + + 0 -1 3272 -1.2126479996368289e-03 + + -1.2148889899253845e-01 6.5059438347816467e-02 + <_> + + 0 -1 3273 4.1254470124840736e-03 + + -1.4912040531635284e-01 1.1146119982004166e-01 + <_> + + 0 -1 3274 -1.8284359946846962e-02 + + -2.8573518991470337e-01 5.9268131852149963e-02 + <_> + + 0 -1 3275 1.4156280457973480e-01 + + -3.4436151385307312e-02 4.6374419331550598e-01 + <_> + + 0 -1 3276 -3.6982420831918716e-02 + + -5.0853198766708374e-01 2.5087080895900726e-02 + <_> + + 0 -1 3277 5.0303530879318714e-03 + + 9.4626903533935547e-02 -1.6120310127735138e-01 + <_> + + 0 -1 3278 -4.6149080991744995e-01 + + 4.5096570253372192e-01 -3.1209290027618408e-02 + <_> + + 0 -1 3279 -1.9794689491391182e-02 + + -4.1046530008316040e-01 3.8790289312601089e-02 + <_> + + 0 -1 3280 -2.3872030898928642e-02 + + -1.5252740681171417e-01 9.2825219035148621e-03 + <_> + + 0 -1 3281 1.8736299825832248e-03 + + -1.9186599552631378e-01 6.9048486649990082e-02 + <_> + + 0 -1 3282 5.8244299143552780e-02 + + -2.2612230852246284e-02 2.1975080668926239e-01 + <_> + + 0 -1 3283 1.5281150117516518e-02 + + 5.6379750370979309e-02 -2.4171100556850433e-01 + <_> + + 0 -1 3284 1.3347120583057404e-01 + + -4.1846349835395813e-02 1.3641799986362457e-01 + <_> + + 0 -1 3285 -1.8359240144491196e-02 + + 1.3650700449943542e-01 -1.0537090152502060e-01 + <_> + + 0 -1 3286 -1.1236529797315598e-02 + + -2.1045160293579102e-01 6.1872761696577072e-02 + <_> + + 0 -1 3287 -7.2013743221759796e-02 + + -3.8488849997520447e-01 3.6731179803609848e-02 + <_> + + 0 -1 3288 -1.9893420860171318e-02 + + 1.9913719594478607e-01 -5.4470948874950409e-02 + <_> + + 0 -1 3289 -8.1342989578843117e-03 + + -2.7529388666152954e-01 4.7152820974588394e-02 + <_> + + 0 -1 3290 -1.3614459894597530e-02 + + 1.9248710572719574e-01 -6.0025930404663086e-02 + <_> + + 0 -1 3291 -6.4553669653832912e-03 + + -2.1480080485343933e-01 6.2654919922351837e-02 + <_> + + 0 -1 3292 -7.2288706898689270e-02 + + -5.3200727701187134e-01 2.2132480517029762e-02 + <_> + + 0 -1 3293 -7.0425979793071747e-02 + + -3.2588490843772888e-01 3.7150900810956955e-02 + <_> + + 0 -1 3294 -1.2219670228660107e-02 + + -6.5945722162723541e-02 2.8728110715746880e-02 + <_> + + 0 -1 3295 6.9816941395401955e-03 + + -2.8508388996124268e-01 4.2512468993663788e-02 + <_> + + 0 -1 3296 -2.1437550894916058e-03 + + -1.0019320249557495e-01 7.1198999881744385e-02 + <_> + + 0 -1 3297 -1.5813990030437708e-03 + + -1.2926709651947021e-01 9.5332272350788116e-02 + <_> + + 0 -1 3298 2.1735160771640949e-05 + + -1.9246159493923187e-01 5.3724698722362518e-02 + <_> + + 0 -1 3299 -1.0075280070304871e-01 + + 5.8181059360504150e-01 -2.1155519410967827e-02 + <_> + + 0 -1 3300 8.0153037561103702e-04 + + -1.6752170026302338e-01 6.1912689357995987e-02 + <_> + + 0 -1 3301 -1.3424370437860489e-02 + + 1.7007820308208466e-01 -6.5821729600429535e-02 + <_> + + 0 -1 3302 2.5006510317325592e-02 + + 3.1838789582252502e-02 -3.5664460062980652e-01 + <_> + + 0 -1 3303 -2.3061310872435570e-02 + + -5.3446078300476074e-01 2.0500430837273598e-02 + <_> + + 0 -1 3304 -8.1409228732809424e-04 + + 7.3716811835765839e-02 -9.8385728895664215e-02 + <_> + + 0 -1 3305 -1.3083440251648426e-02 + + 2.3585100471973419e-01 -4.7893758863210678e-02 + <_> + + 0 -1 3306 1.0480909608304501e-02 + + -6.7725770175457001e-02 1.1783230304718018e-01 + <_> + + 0 -1 3307 -4.3198268860578537e-02 + + -4.3816858530044556e-01 2.5101570412516594e-02 + <_> + + 0 -1 3308 -3.2453269232064486e-03 + + -2.2451759874820709e-01 4.3056890368461609e-02 + <_> + + 0 -1 3309 -1.6294110100716352e-03 + + -2.3388780653476715e-01 4.5073401182889938e-02 + <_> + + 0 -1 3310 -3.2911408692598343e-02 + + 2.1012680232524872e-01 -2.1296700462698936e-02 + <_> + + 0 -1 3311 1.4785619896429125e-05 + + -7.0854157209396362e-02 1.4696949720382690e-01 + <_> + + 0 -1 3312 -6.0208540409803391e-02 + + -5.2135831117630005e-01 1.9577400758862495e-02 + <_> + + 0 -1 3313 1.1327289976179600e-03 + + 4.4817470014095306e-02 -2.4390450119972229e-01 + <_> + + 0 -1 3314 8.3639882504940033e-03 + + -5.6976079940795898e-02 1.1684290319681168e-01 + <_> + + 0 -1 3315 1.4313389547169209e-02 + + 4.7445211559534073e-02 -2.2202989459037781e-01 + <_> + + 0 -1 3316 -1.1530060321092606e-01 + + 8.6662977933883667e-01 -4.2397230863571167e-03 + <_> + + 0 -1 3317 -2.0798090845346451e-02 + + 2.8666529059410095e-01 -4.0919508785009384e-02 + <_> + + 0 -1 3318 -1.8268700689077377e-02 + + 1.3087140023708344e-01 -4.5348200947046280e-02 + <_> + + 0 -1 3319 -2.5494489073753357e-01 + + -3.2410839200019836e-01 4.0496330708265305e-02 + <_> + + 0 -1 3320 -2.1786570549011230e-02 + + 3.3126661181449890e-01 -3.7021800875663757e-02 + <_> + + 0 -1 3321 4.2743898928165436e-02 + + 3.2316859811544418e-02 -3.5259619355201721e-01 + <_> + + 0 -1 3322 3.4730590879917145e-02 + + 3.4049548208713531e-02 -2.1393370628356934e-01 + <_> + + 0 -1 3323 -8.8458160462323576e-05 + + -3.1134480237960815e-01 3.9364520460367203e-02 + <_> + + 0 -1 3324 2.2288469970226288e-01 + + -8.7889749556779861e-03 8.6566871404647827e-01 + <_> + + 0 -1 3325 2.7045139670372009e-01 + + -5.2694901823997498e-02 1.8746510148048401e-01 + <_> + + 0 -1 3326 -2.4789940565824509e-02 + + 2.7650299668312073e-01 -2.7306249365210533e-02 + <_> + + 0 -1 3327 -3.5731170326471329e-02 + + 4.1157469153404236e-01 -2.2886089980602264e-02 + <_> + + 0 -1 3328 4.7842580825090408e-02 + + 2.2989360615611076e-02 -4.1287249326705933e-01 + <_> + + 0 -1 3329 -3.1846091151237488e-02 + + 3.8073039054870605e-01 -2.9582230374217033e-02 + <_> + + 0 -1 3330 -6.9219218567013741e-03 + + -1.3741379976272583e-01 4.8710118979215622e-02 + <_> + + 0 -1 3331 4.1339758783578873e-02 + + 4.4119630008935928e-02 -2.3561610281467438e-01 + <_> + + 0 -1 3332 -3.4157071262598038e-02 + + -2.4877929687500000e-01 1.1872059665620327e-02 + <_> + + 0 -1 3333 -1.2198990210890770e-02 + + -2.1426199376583099e-01 5.1533300429582596e-02 + <_> + + 0 -1 3334 -7.9321218654513359e-03 + + 8.1553332507610321e-02 -6.9921717047691345e-02 + <_> + + 0 -1 3335 -4.2665388435125351e-02 + + -5.0616562366485596e-01 1.9237969070672989e-02 + <_> + + 0 -1 3336 3.5445880144834518e-02 + + -1.6394840553402901e-02 1.7057849466800690e-01 + <_> + + 0 -1 3337 4.5686280727386475e-01 + + 1.9264170899987221e-02 -5.4413592815399170e-01 + <_> + + 0 -1 3338 3.1118420884013176e-02 + + -3.0776979401707649e-02 1.3581100106239319e-01 + <_> + + 0 -1 3339 -1.6103679314255714e-02 + + 2.1244280040264130e-01 -4.8341780900955200e-02 + <_> + + 0 -1 3340 5.7916441000998020e-03 + + -7.3984377086162567e-02 3.5749029368162155e-02 + <_> + + 0 -1 3341 -6.5660297870635986e-02 + + 2.6183378696441650e-01 -4.1004821658134460e-02 + <_> + + 0 -1 3342 8.1464983522891998e-02 + + 1.2928999960422516e-02 -3.5362771153450012e-01 + <_> + + 0 -1 3343 1.2561170384287834e-02 + + -1.9108769297599792e-01 6.9965943694114685e-02 + <_> + + 0 -1 3344 7.8783802688121796e-02 + + -5.4801939986646175e-03 3.9217329025268555e-01 + <_> + + 0 -1 3345 3.3984828740358353e-02 + + 8.4328763186931610e-02 -1.2477640062570572e-01 + <_> + + 0 -1 3346 1.7718339338898659e-02 + + 4.4793829321861267e-02 -1.9760879874229431e-01 + <_> + + 0 -1 3347 -9.8835285753011703e-03 + + -1.5149329602718353e-01 6.7348048090934753e-02 + <_> + + 0 -1 3348 2.3850230500102043e-02 + + -3.3219821751117706e-02 1.6131630539894104e-01 + <_> + + 0 -1 3349 -3.9590701460838318e-02 + + 3.9903929829597473e-01 -2.8885990381240845e-02 + <_> + + 0 -1 3350 3.4961920231580734e-02 + + 2.2103229537606239e-02 -5.2885407209396362e-01 + <_> + + 0 -1 3351 9.4825841486454010e-02 + + 9.5985615625977516e-03 -8.2035672664642334e-01 + <_> + + 0 -1 3352 -1.0215540230274200e-01 + + -2.0551559329032898e-01 3.0388559680432081e-03 + <_> + + 0 -1 3353 -9.3128867447376251e-03 + + 3.6827068775892258e-02 -2.4656419456005096e-01 + <_> + + 0 -1 3354 -5.4135788232088089e-03 + + -2.3878090083599091e-01 4.1015189141035080e-02 + <_> + + 0 -1 3355 -2.6281980797648430e-02 + + 2.7853861451148987e-01 -3.6868080496788025e-02 + <_> + + 0 -1 3356 -9.9223516881465912e-03 + + -2.5322121381759644e-01 3.3522550016641617e-02 + <_> + + 0 -1 3357 -1.7109709978103638e-01 + + -2.9404911398887634e-01 3.2432679086923599e-02 + <_> + + 0 -1 3358 -8.7599586695432663e-03 + + 6.8787500262260437e-02 -1.0647170245647430e-01 + <_> + + 0 -1 3359 1.2942530214786530e-01 + + 1.3241300359368324e-02 -6.8923670053482056e-01 + <_> + + 0 -1 3360 -4.7723919153213501e-02 + + 2.2214810550212860e-01 -2.8517080470919609e-02 + <_> + + 0 -1 3361 1.0812310129404068e-01 + + 1.1902020312845707e-02 -7.7915120124816895e-01 + <_> + + 0 -1 3362 -2.7494689449667931e-02 + + -3.0192640423774719e-01 2.8540210798382759e-02 + <_> + + 0 -1 3363 -4.9534138292074203e-02 + + -3.0015140771865845e-01 3.1750950962305069e-02 + <_> + + 0 -1 3364 -1.0358350351452827e-02 + + 1.2287119776010513e-01 -3.9123039692640305e-02 + <_> + + 0 -1 3365 -3.2705869525671005e-02 + + -3.3354911208152771e-01 2.7965290471911430e-02 + <_> + + 0 -1 3366 -1.3580479659140110e-02 + + 1.1192899942398071e-01 -4.9471028149127960e-02 + <_> + + 0 -1 3367 5.5075851269066334e-03 + + -1.3118129968643188e-01 6.9403477013111115e-02 + <_> + + 0 -1 3368 7.5508110225200653e-02 + + -2.9019629582762718e-02 3.9413800835609436e-01 + <_> + + 0 -1 3369 5.6811410933732986e-02 + + 2.6788659393787384e-02 -4.1989549994468689e-01 + <_> + + 0 -1 3370 5.0004580989480019e-03 + + 4.6239160001277924e-02 -6.7620649933815002e-02 + <_> + + 0 -1 3371 1.9717490300536156e-02 + + -6.0402508825063705e-02 1.6632139682769775e-01 + <_> + + 0 -1 3372 -6.4729452133178711e-02 + + -5.2484118938446045e-01 2.7922600507736206e-02 + <_> + + 0 -1 3373 -3.0683130025863647e-02 + + 2.1945460140705109e-01 -4.8111628741025925e-02 + <_> + + 0 -1 3374 8.1467535346746445e-03 + + 6.0279220342636108e-02 -1.1600890010595322e-01 + <_> + + 0 -1 3375 7.9492190852761269e-03 + + 8.3563491702079773e-02 -1.6053000092506409e-01 + <_> + + 0 -1 3376 -2.2406199946999550e-02 + + 2.8271418809890747e-01 -2.8184479102492332e-02 + <_> + + 0 -1 3377 8.2993790507316589e-02 + + 1.0475059971213341e-02 -9.6875292062759399e-01 + <_> + + 0 -1 3378 -7.0176632143557072e-03 + + -1.3753229379653931e-01 6.8205498158931732e-02 + <_> + + 0 -1 3379 -9.7560193389654160e-03 + + -1.3707080483436584e-01 7.2890587151050568e-02 + <_> + + 0 -1 3380 -5.2217379212379456e-02 + + -6.4300441741943359e-01 1.4492220245301723e-02 + <_> + + 0 -1 3381 -7.8029942233115435e-04 + + -2.6479271054267883e-01 3.3517841249704361e-02 + <_> + + 0 -1 3382 3.7919931113719940e-02 + + -8.4846787154674530e-02 1.1260589957237244e-01 + <_> + + 0 -1 3383 3.0561289750039577e-03 + + 4.8086941242218018e-02 -1.9009250402450562e-01 + <_> + + 0 -1 3384 6.5862268209457397e-02 + + -5.2452040836215019e-03 9.1280621290206909e-01 + <_> + + 0 -1 3385 1.5568210184574127e-01 + + 2.0884050056338310e-02 -4.9580439925193787e-01 + <_> + + 0 -1 3386 -1.9058469915762544e-03 + + 1.8305900692939758e-01 -4.9756310880184174e-02 + <_> + + 0 -1 3387 -9.8356999456882477e-02 + + 4.8020449280738831e-01 -2.0384309813380241e-02 + <_> + + 0 -1 3388 4.2754490859806538e-03 + + 4.0095929056406021e-02 -1.4071129262447357e-01 + <_> + + 0 -1 3389 -1.4033010229468346e-02 + + -2.0791560411453247e-01 5.2576299756765366e-02 + <_> + + 0 -1 3390 8.0179408192634583e-02 + + -2.5790559127926826e-02 3.7651219964027405e-01 + <_> + + 0 -1 3391 1.8175759911537170e-01 + + 1.1428649537265301e-02 -8.3382111787796021e-01 + <_> + + 0 -1 3392 -1.9141690805554390e-02 + + -5.0522857904434204e-01 1.2605519965291023e-02 + <_> + + 0 -1 3393 -5.1260828971862793e-02 + + 5.8292531967163086e-01 -1.6109749674797058e-02 + <_> + + 0 -1 3394 6.4478136599063873e-02 + + 1.0237329639494419e-02 -6.0302352905273438e-01 + <_> + + 0 -1 3395 3.1238300725817680e-02 + + 2.0845850929617882e-02 -3.9785829186439514e-01 + <_> + + 0 -1 3396 -5.0772321410477161e-03 + + 1.2331540137529373e-01 -3.5224981606006622e-02 + <_> + + 0 -1 3397 -1.9385579507797956e-03 + + 1.5726689994335175e-01 -7.3316320776939392e-02 + <_> + + 0 -1 3398 2.4099789559841156e-02 + + -1.1178609728813171e-01 1.0738980025053024e-01 + <_> + + 0 -1 3399 -8.8700000196695328e-03 + + -3.6048200726509094e-01 2.7034249156713486e-02 + <_> + + 0 -1 3400 -3.7424121052026749e-02 + + -3.5229408740997314e-01 1.6786530613899231e-02 + <_> + + 0 -1 3401 -2.0067069679498672e-02 + + -2.7460938692092896e-01 3.9532590657472610e-02 + <_> + + 0 -1 3402 6.5169870853424072e-02 + + 1.1402159929275513e-02 -2.4819959700107574e-01 + <_> + + 0 -1 3403 3.8157470524311066e-02 + + 4.6323310583829880e-02 -2.0989510416984558e-01 + <_> + + 0 -1 3404 1.1075180023908615e-02 + + 3.4411158412694931e-02 -5.1256500184535980e-02 + <_> + + 0 -1 3405 1.1583480238914490e-01 + + 4.2282830923795700e-02 -2.1705499291419983e-01 + <_> + + 0 -1 3406 -4.6720780432224274e-02 + + 2.3093520104885101e-01 -8.3234477788209915e-03 + <_> + + 0 -1 3407 1.2567450106143951e-01 + + -4.9882501363754272e-02 2.1018449962139130e-01 + <_> + + 0 -1 3408 1.8088010256178677e-04 + + -1.1836589872837067e-01 8.4278896450996399e-02 + <_> + + 0 -1 3409 1.0470690205693245e-02 + + -8.6210608482360840e-02 1.1760850250720978e-01 + <_> + + 0 -1 3410 5.8065719902515411e-02 + + 1.5582700259983540e-02 -7.4217921495437622e-01 + <_> + + 0 -1 3411 2.2783069871366024e-03 + + -1.9151380658149719e-01 4.7990638762712479e-02 + <_> + + 0 -1 3412 -6.9596558809280396e-02 + + -7.3241692781448364e-01 1.1130559723824263e-03 + <_> + + 0 -1 3413 5.8907870203256607e-02 + + 1.6878390684723854e-02 -5.4400408267974854e-01 + <_> + + 0 -1 3414 -8.0658823251724243e-02 + + 2.9922959208488464e-01 -1.8570570275187492e-02 + <_> + + 0 -1 3415 1.7686929553747177e-02 + + 4.2936161160469055e-02 -2.2591550648212433e-01 + <_> + + 0 -1 3416 -1.6319070011377335e-02 + + 1.8889640271663666e-01 -4.7047398984432220e-02 + <_> + + 0 -1 3417 -3.9527568966150284e-02 + + -3.2657331228256226e-01 2.8762219473719597e-02 + <_> + + 0 -1 3418 1.9769819919019938e-03 + + -8.8217496871948242e-02 5.7402729988098145e-02 + <_> + + 0 -1 3419 -3.0272029340267181e-02 + + -5.1177912950515747e-01 1.7359249293804169e-02 + <_> + + 0 -1 3420 5.3786419332027435e-02 + + 1.2071570381522179e-02 -4.0201959013938904e-01 + <_> + + 0 -1 3421 -9.4136483967304230e-03 + + 2.4728150665760040e-01 -3.6734741181135178e-02 + <_> + + 0 -1 3422 -5.9014528989791870e-02 + + -1.3277289271354675e-01 1.5220739878714085e-02 + <_> + + 0 -1 3423 8.9417606592178345e-02 + + -2.5917148590087891e-01 3.7563629448413849e-02 + <_> + + 0 -1 3424 -8.7996140122413635e-02 + + 4.9200880527496338e-01 -2.1210839971899986e-02 + <_> + + 0 -1 3425 -5.0747569650411606e-02 + + -4.8567768931388855e-01 2.0005319267511368e-02 + <_> + + 0 -1 3426 -3.8918260484933853e-02 + + -8.9558547735214233e-01 7.8960238024592400e-03 + <_> + + 0 -1 3427 2.0968139171600342e-02 + + -5.4431710392236710e-02 1.6123360395431519e-01 + <_> + + 0 -1 3428 -3.2103069126605988e-02 + + -3.6822700500488281e-01 1.9163349643349648e-02 + <_> + + 0 -1 3429 5.5592609569430351e-03 + + 7.8368440270423889e-02 -1.1842489987611771e-01 + <_> + + 0 -1 3430 5.9554249048233032e-02 + + -5.2290938794612885e-02 3.6194879561662674e-02 + <_> + + 0 -1 3431 -1.0973160155117512e-02 + + 1.5855990350246429e-01 -5.5804491043090820e-02 + <_> + + 0 -1 3432 -1.1934650130569935e-02 + + -2.5717508792877197e-01 3.2829850912094116e-02 + <_> + + 0 -1 3433 6.0441631823778152e-02 + + -3.8720801472663879e-02 2.2971870005130768e-01 + <_> + + 0 -1 3434 -8.2118069985881448e-04 + + 6.9738790392875671e-02 -1.5992000699043274e-01 + <_> + + 0 -1 3435 2.0469389855861664e-02 + + -8.4349267184734344e-02 1.0139500349760056e-01 + <_> + + 0 -1 3436 -7.6305761933326721e-02 + + 8.3174228668212891e-01 -5.0806580111384392e-03 + <_> + + 0 -1 3437 6.0551889240741730e-02 + + -3.7971161305904388e-02 2.1850149333477020e-01 + <_> + + 0 -1 3438 -4.1085779666900635e-03 + + -1.1496649682521820e-01 3.6647479981184006e-02 + <_> + + 0 -1 3439 1.2399969622492790e-02 + + 6.2838301062583923e-02 -1.4144660532474518e-01 + <_> + + 0 -1 3440 -7.1455702185630798e-02 + + -4.2673790454864502e-01 1.3947109691798687e-02 + <_> + + 0 -1 3441 3.3709030598402023e-02 + + -1.2713599950075150e-02 7.4775099754333496e-01 + <_> + + 0 -1 3442 3.4742768853902817e-02 + + 2.0969500765204430e-02 -1.4630280435085297e-01 + <_> + + 0 -1 3443 -4.3705299496650696e-02 + + 1.8064750730991364e-01 -5.2335180342197418e-02 + <_> + + 0 -1 3444 8.4926873445510864e-02 + + 6.9014527834951878e-03 -2.6073959469795227e-01 + <_> + + 0 -1 3445 -1.7119079828262329e-02 + + -1.4590080082416534e-01 6.7484676837921143e-02 + <_> + + 0 -1 3446 3.3630719780921936e-01 + + 7.8989071771502495e-03 -8.3852928876876831e-01 + <_> + + 0 -1 3447 1.2371230125427246e-01 + + -2.5482710450887680e-02 3.9098039269447327e-01 + <_> + + 0 -1 3448 -1.1195900291204453e-01 + + -3.8317111134529114e-01 6.0780011117458344e-03 + <_> + + 0 -1 3449 -1.0881890356540680e-01 + + -7.1362990140914917e-01 1.2700069695711136e-02 + <_> + 268 + -1.3290590047836304e+00 + + <_> + + 0 -1 3450 9.6844611689448357e-03 + + -1.9455039501190186e-01 2.0048019289970398e-01 + <_> + + 0 -1 3451 -6.6196201369166374e-03 + + 9.2211641371250153e-02 -3.4824401140213013e-01 + <_> + + 0 -1 3452 5.6163137778639793e-03 + + 6.6767610609531403e-02 -4.1172260046005249e-01 + <_> + + 0 -1 3453 -1.6882510390132666e-03 + + 7.2629712522029877e-02 -2.0694479346275330e-01 + <_> + + 0 -1 3454 -2.9599820263683796e-03 + + -2.0635899901390076e-01 7.7335417270660400e-02 + <_> + + 0 -1 3455 1.7798959743231535e-03 + + -3.2149469852447510e-01 6.4107127487659454e-02 + <_> + + 0 -1 3456 -4.0264189010486007e-04 + + 7.9512253403663635e-02 -2.4051089584827423e-01 + <_> + + 0 -1 3457 -5.0024548545479774e-04 + + 8.6675606667995453e-02 -2.0504170656204224e-01 + <_> + + 0 -1 3458 -2.0284270867705345e-03 + + 1.4322499930858612e-01 -1.2220569700002670e-01 + <_> + + 0 -1 3459 6.0648359358310699e-03 + + 3.7860579788684845e-02 -2.4375459551811218e-01 + <_> + + 0 -1 3460 9.6257496625185013e-03 + + 5.7141840457916260e-02 -2.8827920556068420e-01 + <_> + + 0 -1 3461 2.5888499803841114e-03 + + -1.8906019628047943e-01 8.6430206894874573e-02 + <_> + + 0 -1 3462 2.9090950265526772e-03 + + -8.3108469843864441e-02 1.7618839442729950e-01 + <_> + + 0 -1 3463 2.2233440540730953e-03 + + 2.0150169730186462e-02 -2.4882750213146210e-01 + <_> + + 0 -1 3464 -9.8997671157121658e-03 + + -2.0639769732952118e-01 6.0985010117292404e-02 + <_> + + 0 -1 3465 1.9689390435814857e-02 + + -3.4452438354492188e-02 2.0069779455661774e-01 + <_> + + 0 -1 3466 2.1106770262122154e-02 + + 4.3886858969926834e-02 -2.6610890030860901e-01 + <_> + + 0 -1 3467 -7.2028310969471931e-03 + + 1.7015519738197327e-01 -5.4639339447021484e-02 + <_> + + 0 -1 3468 4.0647671557962894e-03 + + 5.2182808518409729e-02 -2.1304030716419220e-01 + <_> + + 0 -1 3469 -2.8419198933988810e-03 + + 5.3180210292339325e-02 -1.7669560015201569e-01 + <_> + + 0 -1 3470 -4.9461819231510162e-02 + + 3.7221330404281616e-01 -3.3969849348068237e-02 + <_> + + 0 -1 3471 4.3024159967899323e-02 + + 3.1251549720764160e-02 -3.1831890344619751e-01 + <_> + + 0 -1 3472 -7.0111698005348444e-04 + + -2.0340210199356079e-01 5.8964170515537262e-02 + <_> + + 0 -1 3473 5.7489587925374508e-04 + + -9.4937190413475037e-02 1.0538189858198166e-01 + <_> + + 0 -1 3474 -1.4911209291312844e-04 + + 6.8423688411712646e-02 -1.8207779526710510e-01 + <_> + + 0 -1 3475 8.7993890047073364e-03 + + 3.3866070210933685e-02 -1.1625579744577408e-01 + <_> + + 0 -1 3476 -8.7150773033499718e-03 + + 1.8041290342807770e-01 -6.5721526741981506e-02 + <_> + + 0 -1 3477 -1.3727629557251930e-02 + + -1.3337810337543488e-01 3.5966601222753525e-02 + <_> + + 0 -1 3478 -2.3620850406587124e-03 + + -1.9088070094585419e-01 6.1849810183048248e-02 + <_> + + 0 -1 3479 1.7863539978861809e-03 + + -8.3071537315845490e-02 9.8926126956939697e-02 + <_> + + 0 -1 3480 -9.4514712691307068e-03 + + -1.8024919927120209e-01 6.0146760195493698e-02 + <_> + + 0 -1 3481 4.8195280134677887e-02 + + -2.6617299765348434e-02 3.0134469270706177e-01 + <_> + + 0 -1 3482 -1.2248229468241334e-03 + + -2.3560139536857605e-01 4.5572910457849503e-02 + <_> + + 0 -1 3483 -4.2851101607084274e-02 + + 1.6086329519748688e-01 -2.3455940186977386e-02 + <_> + + 0 -1 3484 3.4798709675669670e-03 + + 7.6882630586624146e-02 -1.3299170136451721e-01 + <_> + + 0 -1 3485 -3.9859190583229065e-03 + + 4.3115191161632538e-02 -2.3132759332656860e-01 + <_> + + 0 -1 3486 4.3139848858118057e-02 + + -3.6780070513486862e-02 2.3883450031280518e-01 + <_> + + 0 -1 3487 -1.7436629161238670e-02 + + -1.4046260714530945e-01 5.9077050536870956e-02 + <_> + + 0 -1 3488 -7.5254887342453003e-02 + + 3.6328521370887756e-01 -3.1380280852317810e-02 + <_> + + 0 -1 3489 6.0125540941953659e-02 + + 8.2496693357825279e-03 -2.3485200107097626e-01 + <_> + + 0 -1 3490 1.2755369534716010e-03 + + -1.2268169969320297e-01 9.0071536600589752e-02 + <_> + + 0 -1 3491 -1.3465109514072537e-03 + + -1.4554239809513092e-01 7.0761166512966156e-02 + <_> + + 0 -1 3492 2.3758469149470329e-02 + + -5.1834989339113235e-02 1.7583900690078735e-01 + <_> + + 0 -1 3493 2.2376580163836479e-03 + + 9.1763339936733246e-02 -1.1206050217151642e-01 + <_> + + 0 -1 3494 3.8662939332425594e-03 + + 6.2390189617872238e-02 -1.5142339468002319e-01 + <_> + + 0 -1 3495 7.6868042349815369e-02 + + -2.7640199288725853e-02 3.7636131048202515e-01 + <_> + + 0 -1 3496 1.6617199406027794e-02 + + 3.3067818731069565e-02 -3.0950650572776794e-01 + <_> + + 0 -1 3497 -4.6145029366016388e-02 + + 1.0798139870166779e-01 -5.8277439326047897e-02 + <_> + + 0 -1 3498 9.8206609487533569e-02 + + 1.7502160742878914e-02 -5.0861918926239014e-01 + <_> + + 0 -1 3499 4.7838049940764904e-03 + + -1.0207810252904892e-01 5.7796850800514221e-02 + <_> + + 0 -1 3500 2.0467689260840416e-02 + + -2.0362010225653648e-02 4.5001450181007385e-01 + <_> + + 0 -1 3501 1.5141700394451618e-02 + + 2.8140379115939140e-02 -8.5130028426647186e-02 + <_> + + 0 -1 3502 5.2229189313948154e-03 + + -5.7789258658885956e-02 1.5580329298973083e-01 + <_> + + 0 -1 3503 1.8871299922466278e-02 + + 2.7053799480199814e-02 -1.2046360224485397e-01 + <_> + + 0 -1 3504 4.5608580112457275e-03 + + -7.9567588865756989e-02 1.1571010202169418e-01 + <_> + + 0 -1 3505 -1.2172549962997437e-02 + + -1.6149179637432098e-01 2.4571539834141731e-02 + <_> + + 0 -1 3506 -1.6468809545040131e-01 + + -6.5712791681289673e-01 1.2428689748048782e-02 + <_> + + 0 -1 3507 1.8241419456899166e-03 + + -9.1526739299297333e-02 8.7851390242576599e-02 + <_> + + 0 -1 3508 -5.4591207299381495e-04 + + -1.2581209838390350e-01 6.6968381404876709e-02 + <_> + + 0 -1 3509 2.1177160087972879e-03 + + 1.4261330664157867e-01 -6.1729468405246735e-02 + <_> + + 0 -1 3510 1.1853260220959783e-03 + + -9.1425627470016479e-02 9.2089362442493439e-02 + <_> + + 0 -1 3511 7.9899299889802933e-03 + + -6.3119217753410339e-02 1.5446299314498901e-01 + <_> + + 0 -1 3512 4.5044990256428719e-03 + + 4.0920298546552658e-02 -2.2475910186767578e-01 + <_> + + 0 -1 3513 7.4563547968864441e-03 + + -3.9540700614452362e-02 2.4208679795265198e-01 + <_> + + 0 -1 3514 6.3897971995174885e-03 + + 5.2900739014148712e-02 -1.7378969490528107e-01 + <_> + + 0 -1 3515 -5.9052068740129471e-02 + + -4.7957658767700195e-01 8.3919316530227661e-03 + <_> + + 0 -1 3516 -5.3746208548545837e-02 + + -5.0854432582855225e-01 1.6880670562386513e-02 + <_> + + 0 -1 3517 -9.1852366924285889e-02 + + 1.9466249644756317e-01 -1.1129629798233509e-02 + <_> + + 0 -1 3518 1.5038819611072540e-01 + + -2.0112350583076477e-02 4.4738510251045227e-01 + <_> + + 0 -1 3519 -2.1317429840564728e-02 + + 2.9676139354705811e-01 -2.8231840580701828e-02 + <_> + + 0 -1 3520 1.2711419723927975e-02 + + 3.3570941537618637e-02 -2.8972589969635010e-01 + <_> + + 0 -1 3521 -9.3287907540798187e-02 + + 6.4380300045013428e-01 -1.4923879876732826e-02 + <_> + + 0 -1 3522 -4.5716729946434498e-03 + + -2.6994249224662781e-01 3.3246111124753952e-02 + <_> + + 0 -1 3523 -3.4010890522040427e-04 + + 8.1715546548366547e-02 -1.0642260313034058e-01 + <_> + + 0 -1 3524 -2.6096890214830637e-03 + + 1.8403419852256775e-01 -6.4724236726760864e-02 + <_> + + 0 -1 3525 4.6332611236721277e-04 + + -1.4283409714698792e-01 4.2033299803733826e-02 + <_> + + 0 -1 3526 1.4095300436019897e-01 + + 9.4516919925808907e-03 -7.7727228403091431e-01 + <_> + + 0 -1 3527 2.0406199619174004e-03 + + -6.6505432128906250e-02 1.1805409938097000e-01 + <_> + + 0 -1 3528 -2.2302009165287018e-02 + + -1.0419870167970657e-01 8.9387677609920502e-02 + <_> + + 0 -1 3529 3.9168349467217922e-03 + + 2.5769380852580070e-02 -1.6625499725341797e-01 + <_> + + 0 -1 3530 6.1153857968747616e-03 + + -6.2531687319278717e-02 1.4075349271297455e-01 + <_> + + 0 -1 3531 -2.9564529540948570e-05 + + 4.6978309750556946e-02 -1.0862989723682404e-01 + <_> + + 0 -1 3532 1.4300559996627271e-04 + + -1.0005149990320206e-01 8.0335728824138641e-02 + <_> + + 0 -1 3533 1.1430789716541767e-02 + + 2.3201359435915947e-02 -3.1366908550262451e-01 + <_> + + 0 -1 3534 -1.3724610209465027e-02 + + 1.2814410030841827e-01 -6.1290029436349869e-02 + <_> + + 0 -1 3535 -4.5548770576715469e-02 + + -4.7528308629989624e-01 1.3631340116262436e-02 + <_> + + 0 -1 3536 7.6914107194170356e-04 + + -8.9416027069091797e-02 9.6091486513614655e-02 + <_> + + 0 -1 3537 6.3840910792350769e-02 + + 1.6064060851931572e-02 -3.8221898674964905e-01 + <_> + + 0 -1 3538 -7.2662779130041599e-03 + + -2.1940490603446960e-01 3.8170509040355682e-02 + <_> + + 0 -1 3539 -1.2828599661588669e-02 + + 1.4705429971218109e-01 -5.5832669138908386e-02 + <_> + + 0 -1 3540 -9.1467969119548798e-02 + + -7.9265332221984863e-01 1.0404639877378941e-02 + <_> + + 0 -1 3541 -2.7164160273969173e-03 + + -1.7725169658660889e-01 5.6455809623003006e-02 + <_> + + 0 -1 3542 -1.0097579658031464e-01 + + -5.9372657537460327e-01 1.3162240386009216e-02 + <_> + + 0 -1 3543 -3.7983559072017670e-02 + + -1.5072999894618988e-01 1.9557390362024307e-02 + <_> + + 0 -1 3544 5.3728191414847970e-04 + + 5.2257049828767776e-02 -1.7996260523796082e-01 + <_> + + 0 -1 3545 1.2443910352885723e-02 + + -2.8953019529581070e-02 2.5448489189147949e-01 + <_> + + 0 -1 3546 -1.8171280622482300e-02 + + 3.2203981280326843e-01 -3.1395100057125092e-02 + <_> + + 0 -1 3547 -3.0619159340858459e-02 + + -1.2817279994487762e-01 6.0485020279884338e-02 + <_> + + 0 -1 3548 2.8726200107485056e-03 + + -1.4807400107383728e-01 5.3796000778675079e-02 + <_> + + 0 -1 3549 -2.8772678971290588e-01 + + -8.3234447240829468e-01 3.6127590574324131e-03 + <_> + + 0 -1 3550 4.1057071089744568e-01 + + 8.3212452009320259e-03 -8.2476407289505005e-01 + <_> + + 0 -1 3551 1.6370510682463646e-02 + + -2.4849100038409233e-02 1.6309140622615814e-01 + <_> + + 0 -1 3552 5.3615570068359375e-02 + + 1.8034080043435097e-02 -4.6126970648765564e-01 + <_> + + 0 -1 3553 -1.0296109830960631e-03 + + 3.8824349641799927e-02 -7.3625981807708740e-02 + <_> + + 0 -1 3554 -6.3063339330255985e-03 + + 1.3288870453834534e-01 -5.5812060832977295e-02 + <_> + + 0 -1 3555 6.8714357912540436e-03 + + 6.9562442600727081e-02 -1.1383140087127686e-01 + <_> + + 0 -1 3556 -8.3098851609975100e-04 + + 1.0002700239419937e-01 -8.5704028606414795e-02 + <_> + + 0 -1 3557 1.3288210146129131e-02 + + 4.2606260627508163e-02 -1.1729510128498077e-01 + <_> + + 0 -1 3558 1.7035039141774178e-02 + + -4.2757850140333176e-02 2.2400109469890594e-01 + <_> + + 0 -1 3559 3.2128300517797470e-02 + + 1.5296909958124161e-02 -5.3317558765411377e-01 + <_> + + 0 -1 3560 1.1440330184996128e-02 + + -5.8955609798431396e-02 1.2842489778995514e-01 + <_> + + 0 -1 3561 2.5446009822189808e-03 + + 4.6037770807743073e-02 -1.4760190248489380e-01 + <_> + + 0 -1 3562 -3.5062368959188461e-02 + + -3.4721338748931885e-01 2.4020459502935410e-02 + <_> + + 0 -1 3563 4.6889069490134716e-03 + + -8.2460209727287292e-02 7.6254382729530334e-02 + <_> + + 0 -1 3564 -1.5067459571582731e-05 + + 5.8223988860845566e-02 -1.3496190309524536e-01 + <_> + + 0 -1 3565 -6.5259548136964440e-04 + + 3.6780450493097305e-02 -7.0881396532058716e-02 + <_> + + 0 -1 3566 4.5456850784830749e-04 + + 5.9895541518926620e-02 -1.4553959667682648e-01 + <_> + + 0 -1 3567 -1.0570470243692398e-01 + + 1.3766160607337952e-01 -2.2337099537253380e-02 + <_> + + 0 -1 3568 -4.6019242145121098e-03 + + -3.3811721205711365e-01 2.2578509524464607e-02 + <_> + + 0 -1 3569 5.5374279618263245e-03 + + -4.1250869631767273e-02 9.4750680029392242e-02 + <_> + + 0 -1 3570 -2.7569069061428308e-03 + + 1.7380860447883606e-01 -4.5417640358209610e-02 + <_> + + 0 -1 3571 4.1876680916175246e-04 + + -5.5233258754014969e-02 5.8342628180980682e-02 + <_> + + 0 -1 3572 -2.4587850202806294e-04 + + -8.9373029768466949e-02 8.1158749759197235e-02 + <_> + + 0 -1 3573 -7.4991412460803986e-02 + + -5.9057062864303589e-01 6.7846179008483887e-03 + <_> + + 0 -1 3574 1.7898950027301908e-03 + + 5.2262220531702042e-02 -1.5884269773960114e-01 + <_> + + 0 -1 3575 -3.2704160548746586e-03 + + 1.1216899752616882e-01 -6.2488421797752380e-02 + <_> + + 0 -1 3576 -1.7803650349378586e-02 + + -4.5739078521728516e-01 1.6650289297103882e-02 + <_> + + 0 -1 3577 -3.3537930250167847e-01 + + -8.2564651966094971e-01 7.1495971642434597e-03 + <_> + + 0 -1 3578 1.1451829969882965e-01 + + -1.8937719985842705e-02 4.1076439619064331e-01 + <_> + + 0 -1 3579 6.5141052007675171e-02 + + 1.1196400038897991e-02 -7.6225310564041138e-01 + <_> + + 0 -1 3580 -1.8442489206790924e-02 + + 1.4006440341472626e-01 -5.1568318158388138e-02 + <_> + + 0 -1 3581 2.0362680777907372e-02 + + 2.7635680511593819e-02 -2.2622610628604889e-01 + <_> + + 0 -1 3582 -5.4255980066955090e-03 + + -1.4688220620155334e-01 5.1294069737195969e-02 + <_> + + 0 -1 3583 -1.4608480036258698e-02 + + 2.8014749288558960e-01 -3.2668899744749069e-02 + <_> + + 0 -1 3584 1.2462410377338529e-03 + + -2.0888839662075043e-01 3.3212959766387939e-02 + <_> + + 0 -1 3585 -5.1487259566783905e-02 + + 1.9872699677944183e-01 -1.0376259684562683e-02 + <_> + + 0 -1 3586 -1.4138059690594673e-02 + + -1.6193750500679016e-01 4.6604789793491364e-02 + <_> + + 0 -1 3587 -8.3356946706771851e-03 + + 1.6429559886455536e-01 -4.2695630341768265e-02 + <_> + + 0 -1 3588 9.5129031687974930e-03 + + 4.4999569654464722e-02 -1.5971189737319946e-01 + <_> + + 0 -1 3589 -7.0411129854619503e-03 + + 7.0638000965118408e-01 -9.1527765616774559e-03 + <_> + + 0 -1 3590 -4.0637628990225494e-04 + + 7.0747792720794678e-02 -1.0194250196218491e-01 + <_> + + 0 -1 3591 4.2529408819973469e-03 + + 3.1937479972839355e-02 -1.0357219725847244e-01 + <_> + + 0 -1 3592 -1.9221140246372670e-04 + + 1.0241460055112839e-01 -8.9996367692947388e-02 + <_> + + 0 -1 3593 -1.3621139805763960e-03 + + -1.8157319724559784e-01 2.3933520540595055e-02 + <_> + + 0 -1 3594 -9.3250330537557602e-03 + + 1.5883359313011169e-01 -4.5317139476537704e-02 + <_> + + 0 -1 3595 -3.4641081094741821e-01 + + -3.5901129245758057e-01 9.8646534606814384e-03 + <_> + + 0 -1 3596 1.7026960849761963e-02 + + -5.9731051325798035e-02 1.2576000392436981e-01 + <_> + + 0 -1 3597 -3.9226989611051977e-04 + + 6.4828976988792419e-02 -9.2051766812801361e-02 + <_> + + 0 -1 3598 7.0719248615205288e-03 + + 3.7144500762224197e-02 -1.9167420268058777e-01 + <_> + + 0 -1 3599 2.9001249931752682e-03 + + -6.2633208930492401e-02 5.3248930722475052e-02 + <_> + + 0 -1 3600 -2.4164669215679169e-02 + + 3.0798891186714172e-01 -2.6505900546908379e-02 + <_> + + 0 -1 3601 -7.5509406626224518e-02 + + -6.1827278137207031e-01 7.8803002834320068e-03 + <_> + + 0 -1 3602 -2.6605799212120473e-04 + + 6.9619670510292053e-02 -9.9268868565559387e-02 + <_> + + 0 -1 3603 2.3389840498566628e-03 + + 4.2269691824913025e-02 -1.6290849447250366e-01 + <_> + + 0 -1 3604 -1.2518429430201650e-03 + + 9.0814828872680664e-02 -7.9618006944656372e-02 + <_> + + 0 -1 3605 -1.9330839859321713e-03 + + 7.6956093311309814e-02 -6.5234251320362091e-02 + <_> + + 0 -1 3606 2.3863440379500389e-02 + + -7.7985651791095734e-02 9.7926571965217590e-02 + <_> + + 0 -1 3607 -5.1995079964399338e-02 + + -2.0676060020923615e-01 1.2264530174434185e-02 + <_> + + 0 -1 3608 -9.4953901134431362e-04 + + 7.2090931236743927e-02 -1.2452449649572372e-01 + <_> + + 0 -1 3609 -9.0458765625953674e-03 + + -1.0756769776344299e-01 2.6017999276518822e-02 + <_> + + 0 -1 3610 3.2019101083278656e-02 + + -4.4689521193504333e-02 1.6712300479412079e-01 + <_> + + 0 -1 3611 -7.1996808983385563e-03 + + -1.2065560370683670e-01 5.3329549729824066e-02 + <_> + + 0 -1 3612 9.7247883677482605e-02 + + -2.0059280097484589e-02 4.1321530938148499e-01 + <_> + + 0 -1 3613 1.7411670414730906e-03 + + 2.5265200063586235e-02 -1.1400379985570908e-01 + <_> + + 0 -1 3614 -1.5694150328636169e-01 + + -9.6121889352798462e-01 7.4661090038716793e-03 + <_> + + 0 -1 3615 -2.0573820918798447e-02 + + 1.3207539916038513e-01 -5.3688809275627136e-02 + <_> + + 0 -1 3616 2.0626350305974483e-03 + + 3.7869140505790710e-02 -2.0333750545978546e-01 + <_> + + 0 -1 3617 1.2381599843502045e-01 + + 2.3662589956074953e-03 -4.8794668912887573e-01 + <_> + + 0 -1 3618 3.1255739741027355e-03 + + -6.4476020634174347e-02 1.5053239464759827e-01 + <_> + + 0 -1 3619 1.8766360357403755e-02 + + 1.2639230117201805e-02 -1.9121849536895752e-01 + <_> + + 0 -1 3620 -8.6109619587659836e-03 + + -1.1916559934616089e-01 6.6547170281410217e-02 + <_> + + 0 -1 3621 1.4604110270738602e-02 + + -2.1980939432978630e-02 2.6832428574562073e-01 + <_> + + 0 -1 3622 1.8387939780950546e-03 + + -1.1506830155849457e-01 6.0840509831905365e-02 + <_> + + 0 -1 3623 -5.7930707931518555e-01 + + -1. 3.7629920989274979e-03 + <_> + + 0 -1 3624 1.8690739572048187e-01 + + 6.2871198169887066e-03 -9.2426669597625732e-01 + <_> + + 0 -1 3625 1.8341749906539917e-02 + + 1.7516769468784332e-02 -1.6519400477409363e-01 + <_> + + 0 -1 3626 -1.4776510186493397e-02 + + 2.5068140029907227e-01 -2.6199640706181526e-02 + <_> + + 0 -1 3627 4.4032301753759384e-02 + + 1.1479279957711697e-02 -6.4663171768188477e-01 + <_> + + 0 -1 3628 3.5362939815968275e-03 + + 4.8670079559087753e-02 -1.3171669840812683e-01 + <_> + + 0 -1 3629 -4.5765978284180164e-03 + + 1.2401209771633148e-01 -5.3882170468568802e-02 + <_> + + 0 -1 3630 3.0529699288308620e-03 + + -5.2538860589265823e-02 1.2860049307346344e-01 + <_> + + 0 -1 3631 -1.1333939619362354e-02 + + -1.6732269525527954e-01 1.2890639714896679e-02 + <_> + + 0 -1 3632 2.7712888550013304e-04 + + 6.5776027739048004e-02 -9.4573900103569031e-02 + <_> + + 0 -1 3633 5.4571928922086954e-04 + + -5.9766601771116257e-02 1.3265900313854218e-01 + <_> + + 0 -1 3634 6.2958751805126667e-03 + + 2.8854750096797943e-02 -2.4328909814357758e-01 + <_> + + 0 -1 3635 1.5611880226060748e-03 + + -5.6346539407968521e-02 8.0620631575584412e-02 + <_> + + 0 -1 3636 1.0501279681921005e-01 + + -1.4052099548280239e-02 5.5927920341491699e-01 + <_> + + 0 -1 3637 3.6907300353050232e-02 + + 1.5443010255694389e-02 -2.0881450176239014e-01 + <_> + + 0 -1 3638 -4.0569249540567398e-02 + + 1.5851789712905884e-01 -4.3176181614398956e-02 + <_> + + 0 -1 3639 -7.2549749165773392e-03 + + -2.6104170083999634e-01 1.7242910340428352e-02 + <_> + + 0 -1 3640 4.5905262231826782e-03 + + -3.8419000804424286e-02 1.7464800179004669e-01 + <_> + + 0 -1 3641 -4.2836060747504234e-03 + + -1.2006240338087082e-01 4.1917610913515091e-02 + <_> + + 0 -1 3642 -1.0835780203342438e-01 + + 5.4927551746368408e-01 -1.2255569919943810e-02 + <_> + + 0 -1 3643 6.4851208589971066e-03 + + 4.4952411204576492e-02 -1.6583940386772156e-01 + <_> + + 0 -1 3644 -2.3725129663944244e-02 + + 5.7158672809600830e-01 -1.2361500412225723e-02 + <_> + + 0 -1 3645 -3.0070519074797630e-02 + + -3.0609959363937378e-01 1.1695429682731628e-02 + <_> + + 0 -1 3646 -7.9774633049964905e-03 + + -1.8185980618000031e-01 3.6925770342350006e-02 + <_> + + 0 -1 3647 -1.7213199287652969e-02 + + 1.2317930161952972e-01 -3.6632679402828217e-02 + <_> + + 0 -1 3648 -1.4119789702817798e-03 + + -5.0499087572097778e-01 1.3695210218429565e-02 + <_> + + 0 -1 3649 2.9909020289778709e-02 + + -2.3535439744591713e-02 1.4312979578971863e-01 + <_> + + 0 -1 3650 -1.1660479940474033e-02 + + -1.7822280526161194e-01 4.0250599384307861e-02 + <_> + + 0 -1 3651 -8.9040184393525124e-03 + + 3.5567161440849304e-01 -2.4783140048384666e-02 + <_> + + 0 -1 3652 -1.1394720058888197e-03 + + -1.4268599450588226e-01 4.9102801829576492e-02 + <_> + + 0 -1 3653 2.9107509180903435e-03 + + -5.4471809417009354e-02 1.3025890290737152e-01 + <_> + + 0 -1 3654 1.7640810459852219e-02 + + 2.0184019580483437e-02 -4.1954588890075684e-01 + <_> + + 0 -1 3655 5.0001900643110275e-02 + + 1.1975940316915512e-02 -5.1889878511428833e-01 + <_> + + 0 -1 3656 2.7523660100996494e-03 + + -6.0628410428762436e-02 1.1169119924306870e-01 + <_> + + 0 -1 3657 -3.1753338873386383e-02 + + -2.2611990571022034e-01 1.5267389826476574e-02 + <_> + + 0 -1 3658 -1.2823809869587421e-02 + + 2.3027139902114868e-01 -2.9404800385236740e-02 + <_> + + 0 -1 3659 5.2626157412305474e-04 + + -1.5677809715270996e-01 4.9938481301069260e-02 + <_> + + 0 -1 3660 1.2779150158166885e-02 + + -5.8851849287748337e-02 1.2255299836397171e-01 + <_> + + 0 -1 3661 7.7667668461799622e-02 + + 4.6644411049783230e-03 -5.0614321231842041e-01 + <_> + + 0 -1 3662 -5.2286800928413868e-03 + + -1.8939809501171112e-01 4.4714428484439850e-02 + <_> + + 0 -1 3663 8.4478305652737617e-03 + + 3.9108898490667343e-02 -1.4809159934520721e-01 + <_> + + 0 -1 3664 5.5970861576497555e-03 + + 5.4664470255374908e-02 -1.4698089659214020e-01 + <_> + + 0 -1 3665 1.6882989555597305e-02 + + -4.6449739485979080e-02 1.4121970534324646e-01 + <_> + + 0 -1 3666 -6.1205658130347729e-04 + + -1.3906019926071167e-01 5.2586868405342102e-02 + <_> + + 0 -1 3667 -3.6216019652783871e-03 + + 5.3345881402492523e-02 -3.8361679762601852e-02 + <_> + + 0 -1 3668 -1.4149090275168419e-03 + + 2.0082549750804901e-01 -3.5985361784696579e-02 + <_> + + 0 -1 3669 2.4758750805631280e-04 + + -1.8205779790878296e-01 1.5915339812636375e-02 + <_> + + 0 -1 3670 1.3457840681076050e-01 + + 9.7890906035900116e-03 -7.2879707813262939e-01 + <_> + + 0 -1 3671 1.1352010071277618e-02 + + -3.5553149878978729e-02 6.3222207129001617e-02 + <_> + + 0 -1 3672 -7.9044885933399200e-03 + + 9.0774089097976685e-02 -9.8796442151069641e-02 + <_> + + 0 -1 3673 7.9050168395042419e-02 + + 4.7087217681109905e-03 -6.0529369115829468e-01 + <_> + + 0 -1 3674 8.9114397997036576e-04 + + -9.0216107666492462e-02 8.4293842315673828e-02 + <_> + + 0 -1 3675 4.1404040530323982e-03 + + 6.0314171016216278e-02 -1.2171939760446548e-01 + <_> + + 0 -1 3676 -9.2683091759681702e-02 + + 6.7853301763534546e-01 -1.0615170001983643e-02 + <_> + + 0 -1 3677 4.2872380465269089e-02 + + 7.3283850215375423e-03 -5.2321487665176392e-01 + <_> + + 0 -1 3678 -3.0652560293674469e-02 + + -6.5578341484069824e-01 9.7402445971965790e-03 + <_> + + 0 -1 3679 7.5054399669170380e-02 + + -1.1660519987344742e-02 3.7559139728546143e-01 + <_> + + 0 -1 3680 9.3033112585544586e-02 + + 7.4912221170961857e-03 -8.1748551130294800e-01 + <_> + + 0 -1 3681 -4.0522208437323570e-03 + + 3.6431130766868591e-01 -1.8015889450907707e-02 + <_> + + 0 -1 3682 1.0411429684609175e-03 + + -1.9623729586601257e-01 3.4336969256401062e-02 + <_> + + 0 -1 3683 4.0790800005197525e-02 + + 1.7464859411120415e-02 -3.8497269153594971e-01 + <_> + + 0 -1 3684 -1.8009789346251637e-04 + + 5.2157621830701828e-02 -1.2038189917802811e-01 + <_> + + 0 -1 3685 -3.5496380180120468e-02 + + 2.1371629834175110e-01 -9.4601595774292946e-03 + <_> + + 0 -1 3686 -1.2321450049057603e-03 + + -1.2999939918518066e-01 4.8752531409263611e-02 + <_> + + 0 -1 3687 -6.6326446831226349e-02 + + -5.0795209407806396e-01 5.8305650018155575e-03 + <_> + + 0 -1 3688 -2.7689670678228140e-03 + + 1.2596920132637024e-01 -5.5794779211282730e-02 + <_> + + 0 -1 3689 3.9610429666936398e-03 + + -8.4471739828586578e-02 6.2092550098896027e-02 + <_> + + 0 -1 3690 -7.5474479235708714e-03 + + -2.0992270112037659e-01 3.1419910490512848e-02 + <_> + + 0 -1 3691 -3.2456999178975821e-03 + + 5.6223601102828979e-02 -3.6774989217519760e-02 + <_> + + 0 -1 3692 -5.0519341602921486e-03 + + 9.4136670231819153e-02 -8.0893777310848236e-02 + <_> + + 0 -1 3693 2.1375959739089012e-02 + + 4.9529589712619781e-02 -4.7989148646593094e-02 + <_> + + 0 -1 3694 -1.6724619269371033e-01 + + -9.3551367521286011e-01 7.4155409820377827e-03 + <_> + + 0 -1 3695 6.4946119673550129e-03 + + -3.6735821515321732e-02 1.0955040156841278e-01 + <_> + + 0 -1 3696 -5.5810972116887569e-03 + + -1.2764470279216766e-01 5.8691799640655518e-02 + <_> + + 0 -1 3697 -7.0414197398349643e-04 + + 3.9361558854579926e-02 -7.4844732880592346e-02 + <_> + + 0 -1 3698 -7.3160971514880657e-03 + + 2.1767179667949677e-01 -3.8703199476003647e-02 + <_> + + 0 -1 3699 -5.4676099680364132e-03 + + -5.3973350673913956e-02 5.5032800883054733e-02 + <_> + + 0 -1 3700 4.3309312313795090e-03 + + 5.7104710489511490e-02 -1.2603929638862610e-01 + <_> + + 0 -1 3701 2.8189779259264469e-03 + + -3.9729248732328415e-02 9.2701591551303864e-02 + <_> + + 0 -1 3702 -4.7759278677403927e-03 + + -1.2856410443782806e-01 6.1216689646244049e-02 + <_> + + 0 -1 3703 6.3424631953239441e-02 + + -4.8541268333792686e-03 5.9883451461791992e-01 + <_> + + 0 -1 3704 -3.5035109613090754e-03 + + 1.0191550105810165e-01 -9.8801277577877045e-02 + <_> + + 0 -1 3705 -4.1303951293230057e-03 + + 1.0890380293130875e-01 -3.8225919008255005e-02 + <_> + + 0 -1 3706 -2.2271529305726290e-03 + + -1.3501960039138794e-01 5.1316611468791962e-02 + <_> + + 0 -1 3707 -1.0730850044637918e-03 + + 5.1526721566915512e-02 -7.4171036481857300e-02 + <_> + + 0 -1 3708 -7.7973678708076477e-04 + + 7.0857577025890350e-02 -1.1204849928617477e-01 + <_> + + 0 -1 3709 -5.5701348930597305e-02 + + 3.9836230874061584e-01 -5.2183559164404869e-03 + <_> + + 0 -1 3710 1.0608229786157608e-02 + + -3.2323788851499557e-02 2.1950970590114594e-01 + <_> + + 0 -1 3711 -9.8208207637071609e-03 + + -1.6507670283317566e-01 4.2444411665201187e-02 + <_> + + 0 -1 3712 1.4465330168604851e-03 + + -7.8392669558525085e-02 8.1393733620643616e-02 + <_> + + 0 -1 3713 -4.4582188129425049e-03 + + -9.2314578592777252e-02 3.8734171539545059e-02 + <_> + + 0 -1 3714 5.6474958546459675e-03 + + 3.9651289582252502e-02 -1.7495639622211456e-01 + <_> + + 0 -1 3715 4.2097918689250946e-02 + + -1.1850739829242229e-02 1.2762710452079773e-01 + <_> + + 0 -1 3716 6.9958101958036423e-03 + + -4.7668740153312683e-02 1.4204859733581543e-01 + <_> + + 0 -1 3717 3.8686778396368027e-02 + + 1.3582780025899410e-02 -4.7315898537635803e-01 + <_> + 238 + -1.4597640037536621e+00 + + <_> + + 0 -1 3718 3.5009320825338364e-02 + + -2.7020230889320374e-01 2.0429250597953796e-01 + <_> + + 0 -1 3719 -3.6780539900064468e-02 + + 1.5254889428615570e-01 -2.6741871237754822e-01 + <_> + + 0 -1 3720 5.6993318721652031e-03 + + 1.6803050041198730e-01 -2.3068240284919739e-01 + <_> + + 0 -1 3721 7.5601637363433838e-02 + + -1.5271709859371185e-01 1.9510839879512787e-01 + <_> + + 0 -1 3722 -1.7248390242457390e-02 + + 2.9379200935363770e-01 -9.8869532346725464e-02 + <_> + + 0 -1 3723 2.8574180323630571e-03 + + -1.9790470600128174e-01 8.3361737430095673e-02 + <_> + + 0 -1 3724 3.1029269099235535e-02 + + -2.1582309901714325e-01 1.1695130169391632e-01 + <_> + + 0 -1 3725 -7.1099428460001945e-03 + + -2.5206819176673889e-01 3.6116510629653931e-02 + <_> + + 0 -1 3726 4.5894421637058258e-03 + + -2.9707619547843933e-01 1.0743969678878784e-01 + <_> + + 0 -1 3727 -7.0509258657693863e-03 + + -4.5635029673576355e-01 4.1864778846502304e-02 + <_> + + 0 -1 3728 6.6762260394170880e-04 + + -1.7432719469070435e-01 1.2306489795446396e-01 + <_> + + 0 -1 3729 -3.6481819115579128e-03 + + -4.0347629785537720e-01 4.9114771187305450e-02 + <_> + + 0 -1 3730 2.2194240242242813e-02 + + 6.1241529881954193e-02 -3.4557360410690308e-01 + <_> + + 0 -1 3731 -1.1259679449722171e-03 + + 5.2013769745826721e-02 -2.8461641073226929e-01 + <_> + + 0 -1 3732 -1.5913739800453186e-02 + + -2.7667850255966187e-01 7.5852021574974060e-02 + <_> + + 0 -1 3733 5.7643437758088112e-03 + + -2.7182090282440186e-01 6.6790662705898285e-02 + <_> + + 0 -1 3734 -4.2196471244096756e-02 + + 1.5786080062389374e-01 -1.0557679831981659e-01 + <_> + + 0 -1 3735 -1.8624680116772652e-02 + + -2.5504299998283386e-01 4.7586869448423386e-02 + <_> + + 0 -1 3736 -9.5020089065656066e-04 + + 4.9903839826583862e-02 -2.9068550467491150e-01 + <_> + + 0 -1 3737 2.0823240280151367e-02 + + 2.6825139299035072e-02 -2.0558500289916992e-01 + <_> + + 0 -1 3738 -1.3118459843099117e-02 + + -2.2395209968090057e-01 6.9013498723506927e-02 + <_> + + 0 -1 3739 -8.6902417242527008e-03 + + 1.9493189454078674e-01 -3.7850689142942429e-02 + <_> + + 0 -1 3740 4.5589819550514221e-02 + + 2.5170389562845230e-02 -5.7766669988632202e-01 + <_> + + 0 -1 3741 -4.8458490520715714e-02 + + 9.5191553235054016e-02 -1.4320190250873566e-01 + <_> + + 0 -1 3742 -7.2761103510856628e-02 + + -6.5967410802841187e-01 2.1175239235162735e-02 + <_> + + 0 -1 3743 -5.3840368986129761e-02 + + -3.6426779627799988e-01 2.4827929213643074e-02 + <_> + + 0 -1 3744 2.3190240608528256e-04 + + -1.4767690002918243e-01 8.3764038980007172e-02 + <_> + + 0 -1 3745 -3.4166979603469372e-03 + + -1.7865709960460663e-01 6.0721088200807571e-02 + <_> + + 0 -1 3746 4.9744218587875366e-02 + + 1.8918199464678764e-02 -6.6629868745803833e-01 + <_> + + 0 -1 3747 6.6813439130783081e-02 + + -2.8286559507250786e-02 1.7401529848575592e-01 + <_> + + 0 -1 3748 3.1445559114217758e-02 + + 5.2556060254573822e-02 -3.0884549021720886e-01 + <_> + + 0 -1 3749 3.9593618363142014e-02 + + -6.4875252544879913e-02 2.5706759095191956e-01 + <_> + + 0 -1 3750 1.8663380295038223e-02 + + -5.9568431228399277e-02 2.1532599627971649e-01 + <_> + + 0 -1 3751 4.0150571614503860e-02 + + 1.9589129835367203e-02 -3.5392150282859802e-01 + <_> + + 0 -1 3752 -1.8263690173625946e-02 + + -3.1224039196968079e-01 4.1845381259918213e-02 + <_> + + 0 -1 3753 -2.2579960525035858e-02 + + -1.4898709952831268e-01 1.7757140100002289e-02 + <_> + + 0 -1 3754 8.5281759500503540e-02 + + 2.4866759777069092e-02 -5.2197951078414917e-01 + <_> + + 0 -1 3755 4.9491669051349163e-03 + + 4.0433339774608612e-02 -1.1230610311031342e-01 + <_> + + 0 -1 3756 -2.7419520542025566e-02 + + -4.1119968891143799e-01 3.0549079179763794e-02 + <_> + + 0 -1 3757 3.8277640938758850e-02 + + 1.2211250141263008e-02 -8.1860828399658203e-01 + <_> + + 0 -1 3758 -2.1632280200719833e-02 + + 2.2030480206012726e-01 -5.5459130555391312e-02 + <_> + + 0 -1 3759 -2.4522699415683746e-01 + + 4.1013330221176147e-01 -2.7000149711966515e-02 + <_> + + 0 -1 3760 3.9314631372690201e-02 + + -3.1242560595273972e-02 3.6714181303977966e-01 + <_> + + 0 -1 3761 1.3630360364913940e-02 + + -1.3902300596237183e-01 9.5946237444877625e-02 + <_> + + 0 -1 3762 -6.7042862065136433e-03 + + 7.8772000968456268e-02 -1.4522729814052582e-01 + <_> + + 0 -1 3763 2.3312810808420181e-02 + + 2.2815790027379990e-02 -4.4990560412406921e-01 + <_> + + 0 -1 3764 3.0621029436588287e-02 + + -6.9781273603439331e-02 1.5422509610652924e-01 + <_> + + 0 -1 3765 5.2047189325094223e-02 + + -1.7720200121402740e-02 4.4397410750389099e-01 + <_> + + 0 -1 3766 2.0850539207458496e-02 + + -5.2309051156044006e-02 2.0608800649642944e-01 + <_> + + 0 -1 3767 8.2694664597511292e-03 + + 7.7132821083068848e-02 -1.9474139809608459e-01 + <_> + + 0 -1 3768 5.5706288665533066e-02 + + 3.3715151250362396e-02 -3.5783401131629944e-01 + <_> + + 0 -1 3769 -2.5406919419765472e-02 + + -2.1424999833106995e-01 5.3813599050045013e-02 + <_> + + 0 -1 3770 3.7127479445189238e-03 + + 5.7478290051221848e-02 -1.7734010517597198e-01 + <_> + + 0 -1 3771 9.8399087786674500e-02 + + -3.5304271150380373e-03 7.7086448669433594e-01 + <_> + + 0 -1 3772 -7.0944158360362053e-03 + + -1.3782690465450287e-01 7.0290572941303253e-02 + <_> + + 0 -1 3773 -7.8213073313236237e-02 + + 4.6844071149826050e-01 -4.8642340116202831e-03 + <_> + + 0 -1 3774 3.0407020822167397e-02 + + -2.8489479795098305e-02 3.4157308936119080e-01 + <_> + + 0 -1 3775 1.7667879583314061e-03 + + -1.4614230394363403e-01 2.3572970181703568e-02 + <_> + + 0 -1 3776 7.1991011500358582e-02 + + -3.5075180232524872e-02 2.8865718841552734e-01 + <_> + + 0 -1 3777 5.0020869821310043e-02 + + 2.4096360430121422e-02 -3.3890551328659058e-01 + <_> + + 0 -1 3778 -1.7998270690441132e-02 + + 2.9191690683364868e-01 -4.1259169578552246e-02 + <_> + + 0 -1 3779 -8.6585222743451595e-04 + + -1.2248259782791138e-01 5.9690121561288834e-02 + <_> + + 0 -1 3780 5.7470470666885376e-02 + + 2.1541740745306015e-02 -4.7508370876312256e-01 + <_> + + 0 -1 3781 -1.6517810523509979e-02 + + 1.6598740220069885e-01 -3.9656970649957657e-02 + <_> + + 0 -1 3782 2.1703030914068222e-02 + + -3.8327228277921677e-02 3.3476251363754272e-01 + <_> + + 0 -1 3783 -6.1237839981913567e-03 + + -1.4342689514160156e-01 2.6313329115509987e-02 + <_> + + 0 -1 3784 -1.0893509723246098e-02 + + -7.9468882083892822e-01 1.2403479777276516e-02 + <_> + + 0 -1 3785 -3.8589738309383392e-02 + + 3.3763501048088074e-01 -1.8747940659523010e-02 + <_> + + 0 -1 3786 1.3378040166571736e-03 + + -3.6288881301879883e-01 2.9460189864039421e-02 + <_> + + 0 -1 3787 2.7590300305746496e-04 + + 7.6419189572334290e-02 -8.6953632533550262e-02 + <_> + + 0 -1 3788 7.9552736133337021e-03 + + 5.2696179598569870e-02 -1.9200770556926727e-01 + <_> + + 0 -1 3789 -1.2174629606306553e-02 + + 8.4013037383556366e-02 -2.1740090101957321e-02 + <_> + + 0 -1 3790 -1.6361070796847343e-02 + + -2.5493758916854858e-01 3.8582589477300644e-02 + <_> + + 0 -1 3791 -3.4992128610610962e-02 + + 2.5760510563850403e-01 -1.5727080404758453e-02 + <_> + + 0 -1 3792 -7.6113208197057247e-03 + + 1.9114670157432556e-01 -5.2980780601501465e-02 + <_> + + 0 -1 3793 5.0110749900341034e-02 + + 2.4265250191092491e-02 -5.1509189605712891e-01 + <_> + + 0 -1 3794 -9.1486647725105286e-03 + + -3.3170440793037415e-01 2.6774439960718155e-02 + <_> + + 0 -1 3795 8.3293259143829346e-02 + + 4.2860410176217556e-03 -3.0381551384925842e-01 + <_> + + 0 -1 3796 -1.9334359094500542e-02 + + 3.8916379213333130e-01 -2.4908309802412987e-02 + <_> + + 0 -1 3797 -7.2061046957969666e-02 + + 4.1184291243553162e-01 -2.5687059387564659e-02 + <_> + + 0 -1 3798 2.2506359964609146e-02 + + -2.1196739375591278e-01 5.3825020790100098e-02 + <_> + + 0 -1 3799 5.5772401392459869e-02 + + -2.3104140534996986e-02 9.1578252613544464e-02 + <_> + + 0 -1 3800 -2.6210390031337738e-02 + + 3.3509409427642822e-01 -3.4225810319185257e-02 + <_> + + 0 -1 3801 -4.6085331588983536e-02 + + -5.3006750345230103e-01 1.9083080813288689e-02 + <_> + + 0 -1 3802 -3.2998260110616684e-02 + + 3.0701389908790588e-01 -3.1638059765100479e-02 + <_> + + 0 -1 3803 1.0677659884095192e-02 + + 3.8186781108379364e-02 -2.0256699621677399e-01 + <_> + + 0 -1 3804 3.7972650025039911e-03 + + 7.8951433300971985e-02 -1.3040140271186829e-01 + <_> + + 0 -1 3805 -2.4965009652078152e-03 + + -1.9799210131168365e-01 3.0743129551410675e-02 + <_> + + 0 -1 3806 1.4203139580786228e-02 + + -4.5443460345268250e-02 2.1806409955024719e-01 + <_> + + 0 -1 3807 7.7012999099679291e-05 + + -2.5858289003372192e-01 4.2508359998464584e-02 + <_> + + 0 -1 3808 2.3724909406155348e-03 + + -1.5815889835357666e-01 6.1494071036577225e-02 + <_> + + 0 -1 3809 -8.4086082875728607e-02 + + -9.3704527616500854e-01 8.3687662845477462e-04 + <_> + + 0 -1 3810 -2.2892290726304054e-02 + + 4.2960539460182190e-01 -2.7215819805860519e-02 + <_> + + 0 -1 3811 -1.1238969862461090e-01 + + -2.0607289671897888e-01 1.7798800021409988e-02 + <_> + + 0 -1 3812 6.8175032734870911e-02 + + -4.2019781470298767e-01 2.5051090866327286e-02 + <_> + + 0 -1 3813 -1.0620189830660820e-02 + + -2.1870230138301849e-01 2.4231420829892159e-02 + <_> + + 0 -1 3814 2.9390859417617321e-03 + + 8.8470183312892914e-02 -1.1958040297031403e-01 + <_> + + 0 -1 3815 5.6766260415315628e-02 + + -5.8820329606533051e-02 1.7845800518989563e-01 + <_> + + 0 -1 3816 -7.3099520523101091e-04 + + 3.0122080445289612e-01 -3.4890830516815186e-02 + <_> + + 0 -1 3817 3.4174978733062744e-02 + + 1.9614150747656822e-02 -1.7419980466365814e-01 + <_> + + 0 -1 3818 3.3152099698781967e-02 + + 2.9344469308853149e-02 -3.5163739323616028e-01 + <_> + + 0 -1 3819 1.7158590257167816e-02 + + -4.7744009643793106e-02 2.0690310001373291e-01 + <_> + + 0 -1 3820 -3.3270310610532761e-02 + + -3.6818051338195801e-01 3.0547879636287689e-02 + <_> + + 0 -1 3821 -7.5228337664157152e-04 + + -1.0068210214376450e-01 3.7446059286594391e-02 + <_> + + 0 -1 3822 -5.7363631203770638e-03 + + -2.9704639315605164e-01 3.0889809131622314e-02 + <_> + + 0 -1 3823 3.4203678369522095e-02 + + 3.2694388180971146e-02 -1.9386410713195801e-01 + <_> + + 0 -1 3824 1.1759670078754425e-01 + + 2.8010509908199310e-02 -3.4469729661941528e-01 + <_> + + 0 -1 3825 3.5684760659933090e-02 + + 1.4612049795687199e-02 -3.2323908805847168e-01 + <_> + + 0 -1 3826 -1.4562480151653290e-01 + + -4.3703469634056091e-01 2.0697519183158875e-02 + <_> + + 0 -1 3827 8.0413380637764931e-03 + + 1.8440550193190575e-02 -3.2272771000862122e-01 + <_> + + 0 -1 3828 5.3446288220584393e-03 + + 5.0503399223089218e-02 -1.8428540229797363e-01 + <_> + + 0 -1 3829 8.6473226547241211e-02 + + 6.2484769150614738e-03 -9.3612897396087646e-01 + <_> + + 0 -1 3830 6.6168710589408875e-02 + + -5.9868391603231430e-02 1.5810599923133850e-01 + <_> + + 0 -1 3831 2.8978990390896797e-02 + + 2.8844339773058891e-02 -2.8269919753074646e-01 + <_> + + 0 -1 3832 1.8636519089341164e-02 + + -5.1709290593862534e-02 1.7777459323406219e-01 + <_> + + 0 -1 3833 -2.6881769299507141e-02 + + 7.3635026812553406e-02 -3.6229219287633896e-02 + <_> + + 0 -1 3834 -1.3696019537746906e-02 + + 1.8215629458427429e-01 -5.9880878776311874e-02 + <_> + + 0 -1 3835 -4.1931979358196259e-03 + + -9.3321792781352997e-02 2.7901070192456245e-02 + <_> + + 0 -1 3836 2.2784220054745674e-02 + + 3.0631329864263535e-02 -2.8531938791275024e-01 + <_> + + 0 -1 3837 -8.3819748833775520e-03 + + -2.3251660168170929e-01 5.0801441073417664e-02 + <_> + + 0 -1 3838 -6.4928620122373104e-03 + + 1.1060830205678940e-01 -8.3281010389328003e-02 + <_> + + 0 -1 3839 5.5866848677396774e-02 + + 2.3439039289951324e-01 -4.5191779732704163e-02 + <_> + + 0 -1 3840 -1.0926710441708565e-02 + + 2.0532840490341187e-01 -5.0775919109582901e-02 + <_> + + 0 -1 3841 1.7515379935503006e-02 + + 3.6728449165821075e-02 -3.0638590455055237e-01 + <_> + + 0 -1 3842 1.4543980360031128e-02 + + 4.4784490019083023e-02 -2.0757840573787689e-01 + <_> + + 0 -1 3843 1.7274370184168220e-03 + + 2.3706600069999695e-02 -1.8639369308948517e-01 + <_> + + 0 -1 3844 2.0160499960184097e-02 + + 4.1744660586118698e-02 -2.1943749487400055e-01 + <_> + + 0 -1 3845 -5.5732231587171555e-02 + + -3.7666681408882141e-01 7.3045571334660053e-03 + <_> + + 0 -1 3846 -4.2138090357184410e-03 + + 1.1314260214567184e-01 -8.4451928734779358e-02 + <_> + + 0 -1 3847 -5.7113498449325562e-02 + + -4.1903460025787354e-01 4.2158551514148712e-03 + <_> + + 0 -1 3848 -3.3385161310434341e-02 + + -3.9007860422134399e-01 2.5290969759225845e-02 + <_> + + 0 -1 3849 -8.5305999964475632e-03 + + 5.3572379052639008e-02 -1.2238460034132004e-01 + <_> + + 0 -1 3850 -1.5144890174269676e-02 + + 4.5743760466575623e-01 -2.5002999231219292e-02 + <_> + + 0 -1 3851 7.5857941992580891e-03 + + 2.6268539950251579e-02 -9.8890319466590881e-02 + <_> + + 0 -1 3852 -6.4347468316555023e-02 + + 2.2607059776782990e-01 -4.1821580380201340e-02 + <_> + + 0 -1 3853 6.5772183239459991e-02 + + 2.4147959426045418e-02 -4.0227779746055603e-01 + <_> + + 0 -1 3854 -1.0496930032968521e-01 + + -4.6343261003494263e-01 1.9134109839797020e-02 + <_> + + 0 -1 3855 9.6320390701293945e-02 + + 8.7147848680615425e-03 -3.5269328951835632e-01 + <_> + + 0 -1 3856 1.6651069745421410e-02 + + -2.3842410743236542e-01 3.8928661495447159e-02 + <_> + + 0 -1 3857 5.8829918503761292e-02 + + -1.6538100317120552e-02 3.3465591073036194e-01 + <_> + + 0 -1 3858 5.2411198616027832e-02 + + -1.9688919186592102e-02 4.6966078877449036e-01 + <_> + + 0 -1 3859 1.2325269635766745e-03 + + -1.2056189775466919e-01 5.0563529133796692e-02 + <_> + + 0 -1 3860 -2.4530949071049690e-02 + + -3.9168059825897217e-01 2.3108620196580887e-02 + <_> + + 0 -1 3861 3.5507690161466599e-02 + + 2.0499339327216148e-02 -3.6233830451965332e-01 + <_> + + 0 -1 3862 -1.5282739885151386e-02 + + -2.4604129791259766e-01 3.4749999642372131e-02 + <_> + + 0 -1 3863 6.0466449707746506e-02 + + -5.5071748793125153e-02 2.0428660511970520e-01 + <_> + + 0 -1 3864 6.5809831023216248e-02 + + -7.1466080844402313e-02 1.2002970278263092e-01 + <_> + + 0 -1 3865 -7.9543672502040863e-02 + + 4.9044218659400940e-01 -7.8059309162199497e-03 + <_> + + 0 -1 3866 7.1057200431823730e-02 + + 4.4219430536031723e-02 -2.1077010035514832e-01 + <_> + + 0 -1 3867 1.2412209762260318e-03 + + 9.9759846925735474e-02 -7.4065141379833221e-02 + <_> + + 0 -1 3868 4.3900560587644577e-02 + + 2.0245339721441269e-02 -4.7800138592720032e-01 + <_> + + 0 -1 3869 1.3814829289913177e-01 + + -3.4169729799032211e-02 2.0662400126457214e-01 + <_> + + 0 -1 3870 6.4026713371276855e-02 + + 1.7396930605173111e-02 -5.7749879360198975e-01 + <_> + + 0 -1 3871 -1.2456770054996014e-02 + + -1.6710869967937469e-01 1.2106380425393581e-02 + <_> + + 0 -1 3872 3.7183608859777451e-02 + + -1.9024299457669258e-02 4.4476169347763062e-01 + <_> + + 0 -1 3873 -3.4905251115560532e-02 + + -1.4648060500621796e-01 2.0895779132843018e-02 + <_> + + 0 -1 3874 6.1689559370279312e-02 + + 1.2428649701178074e-02 -7.1737641096115112e-01 + <_> + + 0 -1 3875 -2.7358489111065865e-02 + + -2.4311469495296478e-01 2.6138730347156525e-02 + <_> + + 0 -1 3876 6.3740741461515427e-03 + + -8.2593016326427460e-02 1.1356580257415771e-01 + <_> + + 0 -1 3877 -1.0299839824438095e-01 + + 4.5398610830307007e-01 -1.6315529122948647e-02 + <_> + + 0 -1 3878 -1.4695020392537117e-02 + + -1.8050310015678406e-01 4.8061780631542206e-02 + <_> + + 0 -1 3879 6.0288330132607371e-05 + + -9.8974503576755524e-02 3.8105670362710953e-02 + <_> + + 0 -1 3880 -1.3763650320470333e-02 + + 4.5689401030540466e-01 -2.0808599889278412e-02 + <_> + + 0 -1 3881 5.1598600111901760e-03 + + 2.8479820117354393e-02 -1.9778659939765930e-01 + <_> + + 0 -1 3882 6.6321617923676968e-03 + + -6.1560358852148056e-02 1.4045900106430054e-01 + <_> + + 0 -1 3883 -1.1073590256273746e-02 + + 1.1272329837083817e-01 -3.8423039019107819e-02 + <_> + + 0 -1 3884 7.3836948722600937e-03 + + 2.4575280025601387e-02 -3.3994451165199280e-01 + <_> + + 0 -1 3885 -1.9277689978480339e-02 + + 1.5732249617576599e-01 -5.8382220566272736e-02 + <_> + + 0 -1 3886 -2.6209199801087379e-02 + + -3.2575431466102600e-01 3.5296149551868439e-02 + <_> + + 0 -1 3887 1.3872079551219940e-02 + + 2.7504689991474152e-02 -2.0510050654411316e-01 + <_> + + 0 -1 3888 2.5171930901706219e-03 + + 6.9805637001991272e-02 -1.1518660187721252e-01 + <_> + + 0 -1 3889 6.7753292620182037e-02 + + -3.7268139421939850e-02 2.3363080620765686e-01 + <_> + + 0 -1 3890 -2.4352179840207100e-02 + + -2.1191249787807465e-01 4.2971581220626831e-02 + <_> + + 0 -1 3891 -1.5085450373589993e-02 + + 1.4743280410766602e-01 -3.8589131087064743e-02 + <_> + + 0 -1 3892 3.0052060261368752e-02 + + 4.3882489204406738e-02 -2.0401340723037720e-01 + <_> + + 0 -1 3893 -7.9878583550453186e-02 + + 7.1355827152729034e-02 -3.5806309431791306e-02 + <_> + + 0 -1 3894 -4.9845650792121887e-02 + + 2.8991028666496277e-01 -2.9193209484219551e-02 + <_> + + 0 -1 3895 6.0983549803495407e-02 + + 1.1078090406954288e-02 -8.0549037456512451e-01 + <_> + + 0 -1 3896 -2.4187229573726654e-02 + + 2.0816670358181000e-01 -4.0332991629838943e-02 + <_> + + 0 -1 3897 2.9581909999251366e-02 + + 1.7189880833029747e-02 -3.0174249410629272e-01 + <_> + + 0 -1 3898 -9.6158936619758606e-02 + + -3.6115181446075439e-01 2.1451879292726517e-02 + <_> + + 0 -1 3899 1.1087789898738265e-03 + + 6.0711268335580826e-02 -1.2995730340480804e-01 + <_> + + 0 -1 3900 3.6577019840478897e-02 + + -1.5757689252495766e-02 6.1568331718444824e-01 + <_> + + 0 -1 3901 8.9887566864490509e-02 + + 7.5012152083218098e-03 -8.4639918804168701e-01 + <_> + + 0 -1 3902 5.2048689685761929e-03 + + -5.0408910959959030e-02 1.5618799626827240e-01 + <_> + + 0 -1 3903 3.4727361053228378e-02 + + 2.1034790202975273e-02 -2.1834190189838409e-01 + <_> + + 0 -1 3904 -5.4695051163434982e-02 + + -8.3126282691955566e-01 8.9029762893915176e-03 + <_> + + 0 -1 3905 1.5987730026245117e-01 + + 8.5425339639186859e-03 -6.9280862808227539e-01 + <_> + + 0 -1 3906 -3.8558691740036011e-02 + + -2.7078241109848022e-01 2.7025369927287102e-02 + <_> + + 0 -1 3907 -7.1866370737552643e-02 + + -3.9044618606567383e-01 1.0923280380666256e-02 + <_> + + 0 -1 3908 1.9590340554714203e-01 + + 1.3423370197415352e-02 -5.4260522127151489e-01 + <_> + + 0 -1 3909 -2.2330079227685928e-02 + + -1.7275239527225494e-01 2.9058510437607765e-02 + <_> + + 0 -1 3910 5.1018559932708740e-01 + + 1.1418639682233334e-02 -6.7876529693603516e-01 + <_> + + 0 -1 3911 -1.1239909566938877e-02 + + 1.1462499946355820e-01 -5.6867629289627075e-02 + <_> + + 0 -1 3912 1.7486160621047020e-02 + + 5.2641868591308594e-02 -1.6195179522037506e-01 + <_> + + 0 -1 3913 -1.4517609961330891e-03 + + -1.0877469927072525e-01 5.6960400193929672e-02 + <_> + + 0 -1 3914 3.7016559392213821e-02 + + 1.7460089176893234e-02 -4.6505320072174072e-01 + <_> + + 0 -1 3915 -8.6366441100835800e-03 + + 7.3076270520687103e-02 -1.0616590082645416e-01 + <_> + + 0 -1 3916 1.9361129961907864e-03 + + -1.4585369825363159e-01 5.9394489973783493e-02 + <_> + + 0 -1 3917 -2.3119550198316574e-02 + + -9.4876237213611603e-02 3.0387479811906815e-02 + <_> + + 0 -1 3918 6.3178739510476589e-03 + + -1.0537099838256836e-01 7.7892847359180450e-02 + <_> + + 0 -1 3919 1.0961949825286865e-02 + + -6.6041983664035797e-02 1.0566339641809464e-01 + <_> + + 0 -1 3920 -4.2129520326852798e-02 + + 2.4344080686569214e-01 -5.1573678851127625e-02 + <_> + + 0 -1 3921 4.5132819563150406e-02 + + 1.0772050358355045e-02 -7.6156777143478394e-01 + <_> + + 0 -1 3922 9.4924736768007278e-03 + + 4.5273378491401672e-02 -1.8770030140876770e-01 + <_> + + 0 -1 3923 -1.1573860049247742e-01 + + 4.4831728935241699e-01 -8.6225848644971848e-03 + <_> + + 0 -1 3924 1.5801179688423872e-03 + + -1.0931409895420074e-01 7.9391218721866608e-02 + <_> + + 0 -1 3925 -4.4442281126976013e-02 + + 3.3827048540115356e-01 -2.6649719104170799e-02 + <_> + + 0 -1 3926 -6.5993092954158783e-02 + + -5.3106492757797241e-01 1.7543010413646698e-02 + <_> + + 0 -1 3927 -1.0968820191919804e-02 + + -1.6612820327281952e-01 4.9488350749015808e-02 + <_> + + 0 -1 3928 3.8149021565914154e-02 + + -4.1509900242090225e-02 2.0616669952869415e-01 + <_> + + 0 -1 3929 4.0625538676977158e-03 + + 4.8925049602985382e-02 -8.4866181015968323e-02 + <_> + + 0 -1 3930 3.2693019602447748e-03 + + -1.1883019655942917e-01 8.6803138256072998e-02 + <_> + + 0 -1 3931 -1.2488859938457608e-03 + + -1.4354729652404785e-01 2.1422969177365303e-02 + <_> + + 0 -1 3932 -1.7064889892935753e-02 + + -5.2316349744796753e-01 1.6529040411114693e-02 + <_> + + 0 -1 3933 -2.3354699835181236e-02 + + -1.9698520004749298e-01 2.1972300484776497e-02 + <_> + + 0 -1 3934 2.7899529784917831e-02 + + 3.8033228367567062e-02 -2.2323200106620789e-01 + <_> + + 0 -1 3935 -6.7869402468204498e-02 + + -4.2076128721237183e-01 1.0559639893472195e-02 + <_> + + 0 -1 3936 5.7542059570550919e-02 + + -4.2111430317163467e-02 2.3515710234642029e-01 + <_> + + 0 -1 3937 -2.1877309679985046e-01 + + 6.9553351402282715e-01 -9.9031934514641762e-03 + <_> + + 0 -1 3938 3.7776291370391846e-01 + + -2.4721829220652580e-02 3.0367389321327209e-01 + <_> + + 0 -1 3939 4.1029900312423706e-02 + + 2.1999280899763107e-02 -2.4707089364528656e-01 + <_> + + 0 -1 3940 2.5587070733308792e-02 + + 4.2045179754495621e-02 -2.2333100438117981e-01 + <_> + + 0 -1 3941 6.7200772464275360e-02 + + -1.6648389399051666e-02 2.4265660345554352e-01 + <_> + + 0 -1 3942 2.8230389580130577e-02 + + 2.9572259634733200e-02 -3.0128848552703857e-01 + <_> + + 0 -1 3943 2.4588680267333984e-01 + + 1.9440819742158055e-03 -4.2153918743133545e-01 + <_> + + 0 -1 3944 -9.5752447843551636e-02 + + -6.4711397886276245e-01 1.3180449604988098e-02 + <_> + + 0 -1 3945 -1.0596579872071743e-02 + + -2.0484970510005951e-01 2.8054440394043922e-02 + <_> + + 0 -1 3946 6.7103967070579529e-02 + + 2.9053989797830582e-02 -2.6770511269569397e-01 + <_> + + 0 -1 3947 -7.9280838370323181e-02 + + 2.1911109983921051e-01 -1.5684010460972786e-02 + <_> + + 0 -1 3948 -4.0710358880460262e-03 + + 2.2031579911708832e-01 -4.0581289678812027e-02 + <_> + + 0 -1 3949 3.7690360099077225e-02 + + -1.2946240603923798e-01 6.1921589076519012e-02 + <_> + + 0 -1 3950 1.8453929573297501e-02 + + -3.2800889015197754e-01 2.9745969921350479e-02 + <_> + + 0 -1 3951 1.5218369662761688e-01 + + 1.1928870342671871e-02 -4.3678689002990723e-01 + <_> + + 0 -1 3952 1.0948959738016129e-01 + + 2.4663779884576797e-02 -3.1567180156707764e-01 + <_> + + 0 -1 3953 -4.4906709343194962e-02 + + 2.3082759976387024e-01 -2.2163389250636101e-02 + <_> + + 0 -1 3954 1.4668619632720947e-01 + + 1.8490659072995186e-02 -4.6669480204582214e-01 + <_> + + 0 -1 3955 -4.0597580373287201e-02 + + 2.0691379904747009e-01 -4.1412089020013809e-02 + <_> + 293 + -1.3393770456314087e+00 + + <_> + + 0 -1 3956 2.5723339058458805e-03 + + -2.4097059667110443e-01 1.5659730136394501e-01 + <_> + + 0 -1 3957 5.7603712193667889e-03 + + -4.3601021170616150e-01 8.0516032874584198e-02 + <_> + + 0 -1 3958 -1.0138600319623947e-01 + + 3.9704030752182007e-01 -6.5761536359786987e-02 + <_> + + 0 -1 3959 1.3221249682828784e-03 + + -4.2382979393005371e-01 2.8659680858254433e-02 + <_> + + 0 -1 3960 5.4164527682587504e-04 + + 6.7418687045574188e-02 -3.1019261479377747e-01 + <_> + + 0 -1 3961 2.4447739124298096e-03 + + 1.3928419910371304e-02 -2.4488939344882965e-01 + <_> + + 0 -1 3962 1.4049450401216745e-03 + + -1.5040999650955200e-01 1.2638579308986664e-01 + <_> + + 0 -1 3963 1.1241709580644965e-03 + + -2.7436348795890808e-01 7.1175657212734222e-02 + <_> + + 0 -1 3964 -1.3413740089163184e-03 + + -3.7685438990592957e-01 5.0038158893585205e-02 + <_> + + 0 -1 3965 4.1714560240507126e-02 + + 1.1733000166714191e-02 -5.4509437084197998e-01 + <_> + + 0 -1 3966 2.1810019388794899e-03 + + -2.0847110450267792e-01 8.4929227828979492e-02 + <_> + + 0 -1 3967 1.9655700773000717e-02 + + 2.9568189755082130e-02 -2.4840490520000458e-01 + <_> + + 0 -1 3968 4.9905799096450210e-04 + + -1.7222259938716888e-01 9.3910522758960724e-02 + <_> + + 0 -1 3969 3.3110571093857288e-03 + + 7.9480826854705811e-02 -1.8249939382076263e-01 + <_> + + 0 -1 3970 3.4921199548989534e-03 + + 6.0159709304571152e-02 -2.3041090369224548e-01 + <_> + + 0 -1 3971 1.3379369629547000e-03 + + -7.8347019851207733e-02 1.5814539790153503e-01 + <_> + + 0 -1 3972 -3.4234288614243269e-04 + + -1.5121580660343170e-01 9.5998182892799377e-02 + <_> + + 0 -1 3973 -7.2008459828794003e-03 + + 1.0716210305690765e-01 -1.2086699903011322e-01 + <_> + + 0 -1 3974 -3.3037480898201466e-03 + + -1.9142769277095795e-01 7.1347109973430634e-02 + <_> + + 0 -1 3975 -8.1909723579883575e-02 + + -8.5086518526077271e-01 6.6832960583269596e-03 + <_> + + 0 -1 3976 -5.2563002100214362e-04 + + 7.1854703128337860e-02 -2.3162660002708435e-01 + <_> + + 0 -1 3977 -2.1477319300174713e-02 + + 2.2399149835109711e-01 -3.2982278615236282e-02 + <_> + + 0 -1 3978 -5.6700430810451508e-02 + + 5.1475530862808228e-01 -2.3378230631351471e-02 + <_> + + 0 -1 3979 1.8419699743390083e-02 + + 1.8853360787034035e-02 -4.4701090455055237e-01 + <_> + + 0 -1 3980 -8.8926553726196289e-03 + + 1.8497599661350250e-01 -6.6978506743907928e-02 + <_> + + 0 -1 3981 1.2642369605600834e-02 + + 8.6571149528026581e-02 -1.4233930408954620e-01 + <_> + + 0 -1 3982 8.0502573400735855e-03 + + -7.7052421867847443e-02 2.1340900659561157e-01 + <_> + + 0 -1 3983 -6.9165248423814774e-03 + + -1.7848269641399384e-01 5.6415598839521408e-02 + <_> + + 0 -1 3984 -1.4194440096616745e-02 + + 1.8763299286365509e-01 -6.7588217556476593e-02 + <_> + + 0 -1 3985 3.5530389286577702e-03 + + 3.8925249129533768e-02 -1.4981240034103394e-01 + <_> + + 0 -1 3986 4.8001301474869251e-03 + + 4.4963311403989792e-02 -2.4595139920711517e-01 + <_> + + 0 -1 3987 9.0420730412006378e-03 + + -5.3614400327205658e-02 1.3824699819087982e-01 + <_> + + 0 -1 3988 4.3342178687453270e-03 + + -8.6166441440582275e-02 1.2793409824371338e-01 + <_> + + 0 -1 3989 1.2264699675142765e-02 + + 3.6203060299158096e-02 -3.7494099140167236e-01 + <_> + + 0 -1 3990 4.9155529588460922e-02 + + -9.1319262981414795e-02 1.2587989866733551e-01 + <_> + + 0 -1 3991 -5.8642931981012225e-04 + + 9.3702591955661774e-02 -1.0736119747161865e-01 + <_> + + 0 -1 3992 3.2971050590276718e-02 + + 2.7238529175519943e-02 -4.5005699992179871e-01 + <_> + + 0 -1 3993 1.6174600459635258e-03 + + 3.2863009721040726e-02 -1.4241309463977814e-01 + <_> + + 0 -1 3994 1.0178020456805825e-03 + + 6.9898538291454315e-02 -1.7507210373878479e-01 + <_> + + 0 -1 3995 3.4081579651683569e-03 + + -7.7970616519451141e-02 5.8423690497875214e-02 + <_> + + 0 -1 3996 -6.9078300148248672e-03 + + 1.1711090058088303e-01 -9.5380999147891998e-02 + <_> + + 0 -1 3997 -7.8317627776414156e-04 + + 6.3730940222740173e-02 -8.8190883398056030e-02 + <_> + + 0 -1 3998 -1.3578870333731174e-02 + + -2.7168250083923340e-01 3.9688158780336380e-02 + <_> + + 0 -1 3999 -8.0021530389785767e-02 + + 6.0115522146224976e-01 -2.4968839716166258e-03 + <_> + + 0 -1 4000 -1.7085570143535733e-03 + + 1.0888680070638657e-01 -1.0520359873771667e-01 + <_> + + 0 -1 4001 8.5700387135148048e-03 + + -4.1784621775150299e-02 1.4857980608940125e-01 + <_> + + 0 -1 4002 1.5518560074269772e-02 + + 2.1855160593986511e-02 -4.5708781480789185e-01 + <_> + + 0 -1 4003 -1.5739940572530031e-03 + + 5.0655461847782135e-02 -6.9658473134040833e-02 + <_> + + 0 -1 4004 -1.0979890357702971e-03 + + 7.9917587339878082e-02 -1.1895059794187546e-01 + <_> + + 0 -1 4005 -2.6248019188642502e-02 + + 7.0614987611770630e-01 -1.3660780154168606e-02 + <_> + + 0 -1 4006 -1.0281460359692574e-02 + + -1.8412110209465027e-01 6.6442340612411499e-02 + <_> + + 0 -1 4007 -3.6530280485749245e-03 + + 1.2995550036430359e-01 -5.8351561427116394e-02 + <_> + + 0 -1 4008 7.8363716602325439e-03 + + 2.7073230594396591e-02 -3.3601909875869751e-01 + <_> + + 0 -1 4009 -1.5283710323274136e-02 + + 2.5562399625778198e-01 -3.5940971225500107e-02 + <_> + + 0 -1 4010 -6.7279259674251080e-03 + + 2.4661159515380859e-01 -4.8673499375581741e-02 + <_> + + 0 -1 4011 1.7807850241661072e-01 + + 6.0471030883491039e-03 -7.2566151618957520e-01 + <_> + + 0 -1 4012 -1.0486179962754250e-03 + + -1.9335940480232239e-01 5.0940699875354767e-02 + <_> + + 0 -1 4013 8.9163314551115036e-03 + + 3.3024791628122330e-02 -1.6986289620399475e-01 + <_> + + 0 -1 4014 4.0643039392307401e-04 + + -1.3117119669914246e-01 6.6818282008171082e-02 + <_> + + 0 -1 4015 -4.7499048709869385e-01 + + -4.0152749419212341e-01 6.3146720640361309e-03 + <_> + + 0 -1 4016 1.0430049896240234e-01 + + 2.4024970829486847e-02 -3.2695800065994263e-01 + <_> + + 0 -1 4017 -5.1650121808052063e-02 + + 1.6934829950332642e-01 -1.5539200045168400e-02 + <_> + + 0 -1 4018 4.0506269782781601e-02 + + -2.2082980722188950e-02 3.9694729447364807e-01 + <_> + + 0 -1 4019 2.4179749190807343e-02 + + 2.1926779299974442e-02 -4.3460670113563538e-01 + <_> + + 0 -1 4020 -3.0531319789588451e-03 + + -1.4108030498027802e-01 5.6175179779529572e-02 + <_> + + 0 -1 4021 -1.7123650759458542e-02 + + -6.3341897726058960e-01 9.8466947674751282e-03 + <_> + + 0 -1 4022 4.1705969721078873e-02 + + 1.0977629572153091e-02 -6.7681282758712769e-01 + <_> + + 0 -1 4023 4.3895491398870945e-03 + + -5.7781290262937546e-02 1.5501640737056732e-01 + <_> + + 0 -1 4024 -4.4786250218749046e-03 + + -1.6706019639968872e-01 4.6572938561439514e-02 + <_> + + 0 -1 4025 4.8733421135693789e-04 + + -1.5037140250205994e-01 4.6920441091060638e-02 + <_> + + 0 -1 4026 1.5530640259385109e-02 + + 2.2556010633707047e-02 -3.2370451092720032e-01 + <_> + + 0 -1 4027 4.5443180948495865e-02 + + -9.8806591704487801e-03 6.0815322399139404e-01 + <_> + + 0 -1 4028 -7.7960297465324402e-02 + + 4.0743818879127502e-01 -1.8391529098153114e-02 + <_> + + 0 -1 4029 -4.5014719944447279e-04 + + -3.8319730758666992e-01 1.3420820236206055e-02 + <_> + + 0 -1 4030 -2.1852780133485794e-02 + + -4.4697651267051697e-01 1.5379330143332481e-02 + <_> + + 0 -1 4031 -6.3410878181457520e-02 + + 3.9926728606224060e-01 -2.2168820723891258e-02 + <_> + + 0 -1 4032 -6.6417120397090912e-03 + + -1.4594499766826630e-01 5.1541730761528015e-02 + <_> + + 0 -1 4033 2.0355410873889923e-02 + + -2.3113679140806198e-02 1.8792650103569031e-01 + <_> + + 0 -1 4034 9.2754261568188667e-03 + + -5.5808931589126587e-02 1.3504269719123840e-01 + <_> + + 0 -1 4035 -6.4075283706188202e-02 + + 2.6259770989418030e-01 -3.1913250684738159e-02 + <_> + + 0 -1 4036 5.7537898421287537e-02 + + 3.4703690558671951e-02 -2.7203989028930664e-01 + <_> + + 0 -1 4037 -1.3369999825954437e-02 + + -1.0251790285110474e-01 2.0719829946756363e-02 + <_> + + 0 -1 4038 2.9637520201504230e-03 + + -5.7579819113016129e-02 1.3346299529075623e-01 + <_> + + 0 -1 4039 -4.7313207760453224e-03 + + -1.4229220151901245e-01 5.3106248378753662e-02 + <_> + + 0 -1 4040 1.2967540323734283e-01 + + -2.1926470100879669e-02 3.3583769202232361e-01 + <_> + + 0 -1 4041 -2.8757948894053698e-03 + + 7.4970930814743042e-02 -1.0183060169219971e-01 + <_> + + 0 -1 4042 -1.3546359725296497e-02 + + -1.5313720703125000e-01 5.2247390151023865e-02 + <_> + + 0 -1 4043 6.3532173633575439e-02 + + 9.1543495655059814e-03 -7.4869108200073242e-01 + <_> + + 0 -1 4044 -1.0261409915983677e-02 + + 1.2742519378662109e-01 -5.6786071509122849e-02 + <_> + + 0 -1 4045 -4.3331928551197052e-02 + + -6.1829072237014771e-01 8.0406935885548592e-03 + <_> + + 0 -1 4046 4.0195342153310776e-03 + + -5.4130308330059052e-02 1.4864480495452881e-01 + <_> + + 0 -1 4047 6.7003332078456879e-03 + + 3.7507299333810806e-02 -1.9986230134963989e-01 + <_> + + 0 -1 4048 -1.1208239942789078e-02 + + -1.4704710245132446e-01 5.7189401239156723e-02 + <_> + + 0 -1 4049 -3.7890970706939697e-03 + + 1.5529400110244751e-01 -3.7930488586425781e-02 + <_> + + 0 -1 4050 -1.1098479852080345e-02 + + 1.7850440740585327e-01 -4.5689649879932404e-02 + <_> + + 0 -1 4051 -7.3761218227446079e-03 + + -1.0891640186309814e-01 7.4425593018531799e-02 + <_> + + 0 -1 4052 -3.2149269245564938e-03 + + 9.0641707181930542e-02 -9.4377033412456512e-02 + <_> + + 0 -1 4053 -3.5010059364140034e-03 + + -1.3498190045356750e-01 6.6652722656726837e-02 + <_> + + 0 -1 4054 -1.4920319699740503e-05 + + -1.0505480319261551e-01 8.4583170711994171e-02 + <_> + + 0 -1 4055 9.5882397145032883e-03 + + 1.9421499222517014e-02 -2.4732840061187744e-01 + <_> + + 0 -1 4056 5.7274959981441498e-02 + + 8.1852423027157784e-03 -7.9508548974990845e-01 + <_> + + 0 -1 4057 2.4549640715122223e-02 + + -1.5515980310738087e-02 4.8995479941368103e-01 + <_> + + 0 -1 4058 -4.6792559325695038e-02 + + -8.4720087051391602e-01 9.0526090934872627e-03 + <_> + + 0 -1 4059 3.1038739252835512e-03 + + -5.3271029144525528e-02 7.8815557062625885e-02 + <_> + + 0 -1 4060 -3.4241031855344772e-02 + + -4.8161220550537109e-01 1.3654340058565140e-02 + <_> + + 0 -1 4061 4.4056270271539688e-03 + + -4.9280438572168350e-02 7.8709162771701813e-02 + <_> + + 0 -1 4062 2.3878510110080242e-03 + + -7.6887659728527069e-02 8.4614582359790802e-02 + <_> + + 0 -1 4063 -1.1621230281889439e-02 + + -2.3086050152778625e-01 2.2584810853004456e-02 + <_> + + 0 -1 4064 2.5225759018212557e-03 + + -5.0813131034374237e-02 1.3810400664806366e-01 + <_> + + 0 -1 4065 1.3507470488548279e-01 + + 7.5730998069047928e-03 -4.7955051064491272e-01 + <_> + + 0 -1 4066 -2.2317951079457998e-03 + + -9.0258792042732239e-02 8.3118766546249390e-02 + <_> + + 0 -1 4067 -3.0061710625886917e-02 + + -5.1799142360687256e-01 1.2881710194051266e-02 + <_> + + 0 -1 4068 -4.5464351773262024e-02 + + 2.0660980045795441e-01 -3.4860398620367050e-02 + <_> + + 0 -1 4069 -9.2374589294195175e-03 + + -1.4695020020008087e-01 3.1320258975028992e-02 + <_> + + 0 -1 4070 6.0185948386788368e-03 + + 6.3885621726512909e-02 -1.1779619753360748e-01 + <_> + + 0 -1 4071 -1.0322810150682926e-02 + + 1.7958350479602814e-01 -4.6830028295516968e-02 + <_> + + 0 -1 4072 -1.7961780540645123e-03 + + -1.1374049633741379e-01 6.1730381101369858e-02 + <_> + + 0 -1 4073 7.1363700553774834e-03 + + 3.3574521541595459e-02 -1.5472589433193207e-01 + <_> + + 0 -1 4074 6.9487772881984711e-02 + + -5.9162009507417679e-02 1.3841110467910767e-01 + <_> + + 0 -1 4075 -3.8321871310472488e-02 + + 1.5628719329833984e-01 -3.1815651804208755e-02 + <_> + + 0 -1 4076 3.9706169627606869e-03 + + 5.1252529025077820e-02 -1.7615999281406403e-01 + <_> + + 0 -1 4077 -3.9275288581848145e-03 + + 7.8947998583316803e-02 -5.1486730575561523e-02 + <_> + + 0 -1 4078 1.9882800988852978e-03 + + -5.0474651157855988e-02 1.3366329669952393e-01 + <_> + + 0 -1 4079 -1.6472870483994484e-03 + + 4.9180198460817337e-02 -5.3437490016222000e-02 + <_> + + 0 -1 4080 -1.1580109596252441e-02 + + -1.3224309682846069e-01 5.8321509510278702e-02 + <_> + + 0 -1 4081 4.3496791273355484e-02 + + -2.3527380079030991e-02 1.2179140001535416e-01 + <_> + + 0 -1 4082 1.8956169951707125e-03 + + 5.6072939187288284e-02 -1.1997289955615997e-01 + <_> + + 0 -1 4083 2.4906420148909092e-03 + + -1.2799920141696930e-01 3.5218570381402969e-02 + <_> + + 0 -1 4084 -6.0253150761127472e-02 + + -7.8707909584045410e-01 7.7965850941836834e-03 + <_> + + 0 -1 4085 -1.5306809917092323e-02 + + -1.2276060134172440e-01 4.2537391185760498e-02 + <_> + + 0 -1 4086 3.6899570841342211e-04 + + -1.2192569673061371e-01 5.9650231152772903e-02 + <_> + + 0 -1 4087 3.0398070812225342e-03 + + -6.3023842871189117e-02 5.0918091088533401e-02 + <_> + + 0 -1 4088 -3.5760499304160476e-04 + + -7.6859332621097565e-02 8.6624316871166229e-02 + <_> + + 0 -1 4089 -2.7939230203628540e-03 + + 1.3074369728565216e-01 -4.6912711113691330e-02 + <_> + + 0 -1 4090 4.2060539126396179e-03 + + -5.3119719028472900e-02 1.2866240739822388e-01 + <_> + + 0 -1 4091 5.1448699086904526e-02 + + 1.1080370284616947e-02 -4.1434210538864136e-01 + <_> + + 0 -1 4092 3.2859880477190018e-02 + + 1.7495309934020042e-02 -3.7538790702819824e-01 + <_> + + 0 -1 4093 -4.8408061265945435e-02 + + 1.7011879384517670e-01 -2.3726450279355049e-02 + <_> + + 0 -1 4094 1.4061340130865574e-02 + + 2.5981390848755836e-02 -2.7635771036148071e-01 + <_> + + 0 -1 4095 5.2196439355611801e-02 + + -9.5534622669219971e-03 1.0973469913005829e-01 + <_> + + 0 -1 4096 4.4780261814594269e-02 + + -2.7032930403947830e-02 2.7434709668159485e-01 + <_> + + 0 -1 4097 -3.7703409325331450e-03 + + -1.4412869513034821e-01 5.2342470735311508e-02 + <_> + + 0 -1 4098 -4.1479258798062801e-03 + + -1.3706830143928528e-01 4.9621090292930603e-02 + <_> + + 0 -1 4099 1.4685150235891342e-02 + + -4.9949668347835541e-02 1.3658650219440460e-01 + <_> + + 0 -1 4100 1.0325849987566471e-02 + + 8.3659462630748749e-02 -1.0378009825944901e-01 + <_> + + 0 -1 4101 -1.7972270143218338e-04 + + -8.6658917367458344e-02 2.2592369467020035e-02 + <_> + + 0 -1 4102 2.0081000402569771e-02 + + -1.9589949399232864e-02 3.4358739852905273e-01 + <_> + + 0 -1 4103 -2.2905580699443817e-02 + + -4.2482820153236389e-01 1.5416770242154598e-02 + <_> + + 0 -1 4104 -5.5506028234958649e-02 + + 7.3143810033798218e-01 -9.4347409904003143e-03 + <_> + + 0 -1 4105 -1.7899540252983570e-03 + + -8.1951782107353210e-02 3.5823788493871689e-02 + <_> + + 0 -1 4106 -8.0740358680486679e-04 + + 8.6620979011058807e-02 -7.8758612275123596e-02 + <_> + + 0 -1 4107 2.4445019662380219e-02 + + -2.2004250437021255e-02 9.4158843159675598e-02 + <_> + + 0 -1 4108 -7.5640110298991203e-03 + + 1.2011729925870895e-01 -7.2349771857261658e-02 + <_> + + 0 -1 4109 2.3397218901664019e-03 + + -8.1034347414970398e-02 9.8173618316650391e-02 + <_> + + 0 -1 4110 -3.1817611306905746e-02 + + -3.5730469226837158e-01 1.9601309671998024e-02 + <_> + + 0 -1 4111 1.0028080083429813e-02 + + -2.4160459637641907e-02 3.1340339779853821e-01 + <_> + + 0 -1 4112 9.0504523541312665e-05 + + 5.8050628751516342e-02 -1.1760439723730087e-01 + <_> + + 0 -1 4113 -2.1010750904679298e-02 + + -2.0346039533615112e-01 3.4145411103963852e-02 + <_> + + 0 -1 4114 -7.1200268575921655e-04 + + 6.3303150236606598e-02 -1.0497389733791351e-01 + <_> + + 0 -1 4115 -7.6272932346910238e-04 + + -7.4432566761970520e-02 3.4912228584289551e-02 + <_> + + 0 -1 4116 -5.8506328612565994e-02 + + 5.5758380889892578e-01 -1.2666489928960800e-02 + <_> + + 0 -1 4117 2.4057500995695591e-03 + + 4.4605068862438202e-02 -1.1581590026617050e-01 + <_> + + 0 -1 4118 -1.9729519262909889e-02 + + -4.7550109028816223e-01 1.5548559837043285e-02 + <_> + + 0 -1 4119 -2.2645130753517151e-02 + + 1.1828950047492981e-01 -2.2170929238200188e-02 + <_> + + 0 -1 4120 -1.3123790267854929e-03 + + 5.0635538995265961e-02 -1.3423310220241547e-01 + <_> + + 0 -1 4121 -5.9856739826500416e-03 + + 5.4273821413516998e-02 -6.9639056921005249e-02 + <_> + + 0 -1 4122 5.2245449274778366e-02 + + -1.8341360613703728e-02 4.1689381003379822e-01 + <_> + + 0 -1 4123 -4.6837949194014072e-03 + + -1.2121260166168213e-01 3.9187919348478317e-02 + <_> + + 0 -1 4124 -1.5208399854600430e-02 + + -9.6487842500209808e-02 6.5325021743774414e-02 + <_> + + 0 -1 4125 -5.7328920811414719e-03 + + 2.1023470163345337e-01 -3.1721260398626328e-02 + <_> + + 0 -1 4126 -3.7612610030919313e-03 + + 1.0085880011320114e-01 -6.1392951756715775e-02 + <_> + + 0 -1 4127 -1.0980520397424698e-02 + + -1.8342439830303192e-01 1.7121249809861183e-02 + <_> + + 0 -1 4128 2.7213071007281542e-03 + + -5.8404140174388885e-02 1.0729049891233444e-01 + <_> + + 0 -1 4129 -1.8969269469380379e-02 + + 7.4764728546142578e-02 -3.4056201577186584e-02 + <_> + + 0 -1 4130 -7.1104627568274736e-04 + + -1.4749570190906525e-01 5.2447158843278885e-02 + <_> + + 0 -1 4131 9.4774961471557617e-03 + + -2.5232490152120590e-02 1.0677599906921387e-01 + <_> + + 0 -1 4132 1.0275880247354507e-01 + + 1.0039360262453556e-02 -6.4630568027496338e-01 + <_> + + 0 -1 4133 -1.1228179931640625e-01 + + -5.7247608900070190e-01 6.3971187919378281e-03 + <_> + + 0 -1 4134 -2.5683579966425896e-02 + + -3.2004079222679138e-01 1.7239449545741081e-02 + <_> + + 0 -1 4135 2.5494299829006195e-02 + + -2.2127779200673103e-02 1.1838120222091675e-01 + <_> + + 0 -1 4136 -3.0458789318799973e-02 + + -5.8747881650924683e-01 9.8222652450203896e-03 + <_> + + 0 -1 4137 -2.7816120535135269e-02 + + 3.6785709857940674e-01 -1.2260340154170990e-02 + <_> + + 0 -1 4138 -1.2768269516527653e-03 + + 2.4150429666042328e-01 -2.4503409862518311e-02 + <_> + + 0 -1 4139 -7.6435826718807220e-02 + + -6.3471722602844238e-01 2.7080429717898369e-03 + <_> + + 0 -1 4140 3.7574430461972952e-04 + + -1.3316820561885834e-01 4.6189591288566589e-02 + <_> + + 0 -1 4141 1.3193810358643532e-02 + + 2.6501480489969254e-02 -6.8515978753566742e-02 + <_> + + 0 -1 4142 -6.3689619302749634e-02 + + 4.1126638650894165e-01 -1.5647120773792267e-02 + <_> + + 0 -1 4143 -8.0426287604495883e-04 + + -9.4006098806858063e-02 3.1002070754766464e-02 + <_> + + 0 -1 4144 8.2476891111582518e-04 + + -1.5928819775581360e-01 3.7096790969371796e-02 + <_> + + 0 -1 4145 4.8443409614264965e-03 + + -2.5698879733681679e-02 1.5079009532928467e-01 + <_> + + 0 -1 4146 2.2941319271922112e-02 + + 2.2941149771213531e-02 -2.7759069204330444e-01 + <_> + + 0 -1 4147 5.6285588070750237e-03 + + 2.0121619105339050e-02 -6.3584417104721069e-02 + <_> + + 0 -1 4148 -8.1927451537922025e-04 + + 5.5934138596057892e-02 -1.0776060074567795e-01 + <_> + + 0 -1 4149 5.1910132169723511e-03 + + -2.6781970635056496e-02 5.5094171315431595e-02 + <_> + + 0 -1 4150 -2.0220499485731125e-02 + + -1.2501780688762665e-01 5.9274829924106598e-02 + <_> + + 0 -1 4151 -3.6798599176108837e-03 + + 6.0474321246147156e-02 -5.9632349759340286e-02 + <_> + + 0 -1 4152 1.0483860038220882e-02 + + -5.3652260452508926e-02 1.2906110286712646e-01 + <_> + + 0 -1 4153 1.7904460430145264e-02 + + 1.4318290166556835e-02 -2.7349731326103210e-01 + <_> + + 0 -1 4154 3.3693820238113403e-01 + + -8.6311781778931618e-03 7.3288571834564209e-01 + <_> + + 0 -1 4155 -1.0807479918003082e-01 + + -5.0707489252090454e-01 6.7152627743780613e-03 + <_> + + 0 -1 4156 -1.2219610065221786e-01 + + -7.9352718591690063e-01 7.4890498071908951e-03 + <_> + + 0 -1 4157 -3.7357630208134651e-03 + + -1.5436430275440216e-01 1.9933359697461128e-02 + <_> + + 0 -1 4158 4.7283530235290527e-02 + + -3.2180741429328918e-02 2.2332429885864258e-01 + <_> + + 0 -1 4159 -4.8949089832603931e-03 + + -1.4440849423408508e-01 2.7687419205904007e-02 + <_> + + 0 -1 4160 -4.6767960302531719e-03 + + 4.2589519172906876e-02 -1.3181249797344208e-01 + <_> + + 0 -1 4161 -4.0526568889617920e-02 + + 1.5155360102653503e-01 -1.3137400150299072e-02 + <_> + + 0 -1 4162 5.1309340633451939e-03 + + -4.2436398565769196e-02 1.9428129494190216e-01 + <_> + + 0 -1 4163 4.9947341904044151e-03 + + 2.0656300708651543e-02 -1.8332560360431671e-01 + <_> + + 0 -1 4164 -1.0946449823677540e-02 + + -1.1576370149850845e-01 6.1964198946952820e-02 + <_> + + 0 -1 4165 -6.7135482095181942e-03 + + 1.5796749293804169e-01 -3.5399619489908218e-02 + <_> + + 0 -1 4166 -3.0990630388259888e-02 + + -1.7271049320697784e-01 3.7916570901870728e-02 + <_> + + 0 -1 4167 -2.7503890451043844e-03 + + 4.1495159268379211e-02 -5.5152788758277893e-02 + <_> + + 0 -1 4168 -2.4700429290533066e-02 + + 2.9076111316680908e-01 -2.0552640780806541e-02 + <_> + + 0 -1 4169 -1.7607269808650017e-02 + + -9.8671503365039825e-02 3.2800450921058655e-02 + <_> + + 0 -1 4170 8.7928329594433308e-04 + + 3.6442421376705170e-02 -1.7518040537834167e-01 + <_> + + 0 -1 4171 6.9036949425935745e-03 + + 2.1444270387291908e-02 -1.1997299641370773e-01 + <_> + + 0 -1 4172 -2.2592858877032995e-03 + + 9.5944248139858246e-02 -8.1264480948448181e-02 + <_> + + 0 -1 4173 1.5885939821600914e-02 + + -3.1494110822677612e-02 8.7531946599483490e-02 + <_> + + 0 -1 4174 1.9379710778594017e-02 + + -3.5075489431619644e-02 1.6199189424514771e-01 + <_> + + 0 -1 4175 -2.3565329611301422e-02 + + 9.9367812275886536e-02 -5.0409961491823196e-02 + <_> + + 0 -1 4176 -6.2582190148532391e-03 + + -1.5962609648704529e-01 5.6871950626373291e-02 + <_> + + 0 -1 4177 1.0289040394127369e-02 + + 3.2422259449958801e-02 -1.1825840175151825e-01 + <_> + + 0 -1 4178 -5.8485912159085274e-03 + + 1.9107459485530853e-01 -3.7084739655256271e-02 + <_> + + 0 -1 4179 -8.5805162787437439e-02 + + -4.0877249836921692e-01 1.2781100347638130e-02 + <_> + + 0 -1 4180 -2.4852859787642956e-03 + + -1.0116399824619293e-01 5.6311480700969696e-02 + <_> + + 0 -1 4181 -7.1535720489919186e-03 + + -4.4118609279394150e-02 2.2217169404029846e-02 + <_> + + 0 -1 4182 1.2644700473174453e-03 + + 6.5305598080158234e-02 -1.2273000180721283e-01 + <_> + + 0 -1 4183 3.9825689047574997e-02 + + -5.0402980297803879e-02 1.4424259960651398e-01 + <_> + + 0 -1 4184 1.3322670012712479e-02 + + 2.3235419392585754e-01 -2.8198169544339180e-02 + <_> + + 0 -1 4185 2.1017350256443024e-02 + + -1.9653260707855225e-02 1.0432569682598114e-01 + <_> + + 0 -1 4186 2.4515210092067719e-01 + + 8.4479590877890587e-03 -7.4833422899246216e-01 + <_> + + 0 -1 4187 4.3030278757214546e-03 + + 3.1172480434179306e-02 -9.4183586537837982e-02 + <_> + + 0 -1 4188 2.2224480286240578e-02 + + -3.9602920413017273e-02 1.5614870190620422e-01 + <_> + + 0 -1 4189 -8.5019748657941818e-03 + + -1.0852319747209549e-01 2.8045600280165672e-02 + <_> + + 0 -1 4190 1.0845540091395378e-02 + + -6.5594159066677094e-02 1.0217399895191193e-01 + <_> + + 0 -1 4191 1.7696369905024767e-03 + + 7.5369141995906830e-02 -9.5298826694488525e-02 + <_> + + 0 -1 4192 1.0289049893617630e-01 + + -1.1767229996621609e-02 4.8167210817337036e-01 + <_> + + 0 -1 4193 -3.5074170678853989e-02 + + -2.6299050450325012e-01 1.0002779774367809e-02 + <_> + + 0 -1 4194 3.8302998989820480e-02 + + 1.0883949697017670e-02 -5.8092927932739258e-01 + <_> + + 0 -1 4195 1.2183119542896748e-02 + + 3.1098999083042145e-02 -5.4257929325103760e-02 + <_> + + 0 -1 4196 2.0388139411807060e-02 + + -3.7379540503025055e-02 1.8725450336933136e-01 + <_> + + 0 -1 4197 6.5857400186359882e-03 + + -4.4194780290126801e-02 6.0033790767192841e-02 + <_> + + 0 -1 4198 5.8739529922604561e-03 + + 3.9219710975885391e-02 -1.5857939422130585e-01 + <_> + + 0 -1 4199 -7.8279033303260803e-02 + + 2.1789179742336273e-01 -1.0094420053064823e-02 + <_> + + 0 -1 4200 1.5336579643189907e-02 + + -3.1219519674777985e-02 2.2452400624752045e-01 + <_> + + 0 -1 4201 1.4171670190989971e-03 + + -1.6625450551509857e-01 2.7684109285473824e-02 + <_> + + 0 -1 4202 -3.4021309111267328e-03 + + -2.8452378511428833e-01 2.2661060094833374e-02 + <_> + + 0 -1 4203 -1.9340340048074722e-02 + + 5.2300518751144409e-01 -5.0734821707010269e-03 + <_> + + 0 -1 4204 -1.6514319926500320e-02 + + 7.0619380474090576e-01 -8.2714930176734924e-03 + <_> + + 0 -1 4205 -6.4589809626340866e-03 + + -1.2104330211877823e-01 3.8718421012163162e-02 + <_> + + 0 -1 4206 -4.3003219179809093e-03 + + -1.2103659659624100e-01 5.5335890501737595e-02 + <_> + + 0 -1 4207 1.0784200392663479e-02 + + -3.8975819945335388e-02 1.9870519638061523e-01 + <_> + + 0 -1 4208 -1.1527650058269501e-03 + + 9.3596100807189941e-02 -6.4248889684677124e-02 + <_> + + 0 -1 4209 -4.2101260274648666e-02 + + -3.0032190680503845e-01 1.5909299254417419e-02 + <_> + + 0 -1 4210 3.0202090274542570e-03 + + -6.5310478210449219e-02 9.4754762947559357e-02 + <_> + + 0 -1 4211 2.9999990016222000e-02 + + 1.7673229798674583e-02 -2.2457149624824524e-01 + <_> + + 0 -1 4212 -1.3678170507773757e-03 + + 1.3394910097122192e-01 -5.0086550414562225e-02 + <_> + + 0 -1 4213 -2.3151950910687447e-02 + + -1.8310110270977020e-01 1.9103579223155975e-02 + <_> + + 0 -1 4214 6.3826322555541992e-02 + + 7.5651248916983604e-03 -8.3116590976715088e-01 + <_> + + 0 -1 4215 -1.4831620454788208e-01 + + -1. 3.4445689525455236e-03 + <_> + + 0 -1 4216 1.3207890151534230e-04 + + 5.1135819405317307e-02 -1.1863200366497040e-01 + <_> + + 0 -1 4217 6.6078707575798035e-02 + + 7.1528651751577854e-03 -4.2906388640403748e-01 + <_> + + 0 -1 4218 6.1758249066770077e-03 + + -5.9010580182075500e-02 1.0781309753656387e-01 + <_> + + 0 -1 4219 -3.3506110310554504e-02 + + -3.7636739015579224e-01 1.7037799581885338e-02 + <_> + + 0 -1 4220 -9.7032980993390083e-03 + + 1.3820339739322662e-01 -4.3922200798988342e-02 + <_> + + 0 -1 4221 -7.2475131601095200e-03 + + -2.2192749381065369e-01 1.2801939621567726e-02 + <_> + + 0 -1 4222 -5.3309328854084015e-02 + + -4.5594760775566101e-01 1.2495010159909725e-02 + <_> + + 0 -1 4223 1.0387069545686245e-02 + + -5.1624130457639694e-02 1.2236239761114120e-01 + <_> + + 0 -1 4224 6.7208573222160339e-02 + + 3.1655121594667435e-02 -2.1086180210113525e-01 + <_> + + 0 -1 4225 -1.5143319964408875e-02 + + 1.7224070429801941e-01 -2.9209939762949944e-02 + <_> + + 0 -1 4226 -3.9284970611333847e-02 + + -4.8226779699325562e-01 1.4366200193762779e-02 + <_> + + 0 -1 4227 -5.1000402309000492e-03 + + 1.3700410723686218e-01 -4.3541591614484787e-02 + <_> + + 0 -1 4228 4.7284159809350967e-03 + + 6.5495520830154419e-02 -1.2913839519023895e-01 + <_> + + 0 -1 4229 -1.1877629905939102e-02 + + 2.0146130025386810e-01 -2.3640049621462822e-02 + <_> + + 0 -1 4230 -4.5396368950605392e-03 + + -1.6872450709342957e-01 4.4881179928779602e-02 + <_> + + 0 -1 4231 -8.0548608675599098e-03 + + 6.5916322171688080e-02 -4.5184228569269180e-02 + <_> + + 0 -1 4232 -4.3037731200456619e-02 + + 1.2817430496215820e-01 -6.3021719455718994e-02 + <_> + + 0 -1 4233 1.0952279716730118e-01 + + 6.0560060665011406e-03 -5.1614511013031006e-01 + <_> + + 0 -1 4234 -7.0019549457356334e-04 + + -1.2845410406589508e-01 4.9936100840568542e-02 + <_> + + 0 -1 4235 -2.9595570595120080e-05 + + 6.7076332867145538e-02 -9.0397119522094727e-02 + <_> + + 0 -1 4236 1.7749640345573425e-01 + + -7.6472861692309380e-03 8.9716571569442749e-01 + <_> + + 0 -1 4237 -5.5364448577165604e-02 + + -6.5513938665390015e-01 6.7208600230515003e-03 + <_> + + 0 -1 4238 -5.1461409777402878e-02 + + -6.5337532758712769e-01 8.9703118428587914e-03 + <_> + + 0 -1 4239 -2.6581719517707825e-02 + + -2.8116428852081299e-01 1.7766090109944344e-02 + <_> + + 0 -1 4240 -6.9034337997436523e-02 + + 9.2583978176116943e-01 -6.2460578046739101e-03 + <_> + + 0 -1 4241 -3.0205730348825455e-02 + + 2.3784290254116058e-01 -1.6295459121465683e-02 + <_> + + 0 -1 4242 -9.1226873919367790e-03 + + -1.4569890499114990e-01 4.5654390007257462e-02 + <_> + + 0 -1 4243 -2.1233780682086945e-01 + + 1.6472199559211731e-01 -1.4758829958736897e-02 + <_> + + 0 -1 4244 -2.6254689320921898e-02 + + 3.0381628870964050e-01 -2.0108530297875404e-02 + <_> + + 0 -1 4245 3.0262209475040436e-03 + + -1.5298280119895935e-01 2.6878539472818375e-02 + <_> + + 0 -1 4246 8.3838596940040588e-02 + + 1.0042349807918072e-02 -5.9345102310180664e-01 + <_> + + 0 -1 4247 1.8845759332180023e-02 + + -4.5260541141033173e-02 8.4220200777053833e-02 + <_> + + 0 -1 4248 -4.8671411350369453e-03 + + -1.1234840005636215e-01 5.6676398962736130e-02 + <_> + 243 + -1.4994510412216187e+00 + + <_> + + 0 -1 4249 1.1900869756937027e-01 + + -2.0186680555343628e-01 2.4417600035667419e-01 + <_> + + 0 -1 4250 2.1277489140629768e-02 + + -2.3454399406909943e-01 1.6303069889545441e-01 + <_> + + 0 -1 4251 3.7066950462758541e-03 + + -2.0559909939765930e-01 1.4982059597969055e-01 + <_> + + 0 -1 4252 3.2929550856351852e-02 + + 7.8803077340126038e-02 -3.3688440918922424e-01 + <_> + + 0 -1 4253 2.5057960301637650e-02 + + -1.5932090580463409e-01 1.6405050456523895e-01 + <_> + + 0 -1 4254 6.5863109193742275e-04 + + -2.7804228663444519e-01 8.3028919994831085e-02 + <_> + + 0 -1 4255 -6.6210910677909851e-02 + + -3.6402150988578796e-01 6.0067348182201385e-02 + <_> + + 0 -1 4256 4.2186300270259380e-03 + + -1.8551510572433472e-01 1.2828220427036285e-01 + <_> + + 0 -1 4257 1.7119459807872772e-03 + + -2.1572509407997131e-01 8.6879499256610870e-02 + <_> + + 0 -1 4258 -2.1390480920672417e-02 + + 1.1124739795923233e-01 -1.4486509561538696e-01 + <_> + + 0 -1 4259 5.5712480098009109e-03 + + 6.2546879053115845e-02 -3.1598201394081116e-01 + <_> + + 0 -1 4260 4.5709838159382343e-03 + + -2.3647899925708771e-01 3.8399569690227509e-02 + <_> + + 0 -1 4261 -1.7086030915379524e-02 + + 2.0653559267520905e-01 -8.6405612528324127e-02 + <_> + + 0 -1 4262 -3.0640950426459312e-02 + + 4.1523000597953796e-01 -2.5601850822567940e-02 + <_> + + 0 -1 4263 2.5803469121456146e-02 + + 4.0156230330467224e-02 -3.7444010376930237e-01 + <_> + + 0 -1 4264 2.6425920426845551e-02 + + 4.2625781148672104e-02 -4.1888910531997681e-01 + <_> + + 0 -1 4265 -1.1849730275571346e-02 + + -3.0619880557060242e-01 5.1505949348211288e-02 + <_> + + 0 -1 4266 -1.6269849613308907e-02 + + -1.9878490269184113e-01 4.2683240026235580e-02 + <_> + + 0 -1 4267 -2.4036159738898277e-02 + + -3.3211991190910339e-01 4.6091418713331223e-02 + <_> + + 0 -1 4268 7.3583971243351698e-04 + + -2.0677410066127777e-01 5.7418260723352432e-02 + <_> + + 0 -1 4269 -2.0423160865902901e-02 + + -2.6922059059143066e-01 4.4893719255924225e-02 + <_> + + 0 -1 4270 1.9533000886440277e-03 + + 4.3481849133968353e-02 -1.4295850694179535e-01 + <_> + + 0 -1 4271 3.3202540129423141e-02 + + 6.1112720519304276e-02 -2.0773139595985413e-01 + <_> + + 0 -1 4272 2.1049549803137779e-02 + + -5.5196329951286316e-02 1.7273330688476562e-01 + <_> + + 0 -1 4273 -4.2487941682338715e-03 + + -3.1202110648155212e-01 3.5714551806449890e-02 + <_> + + 0 -1 4274 1.4544890262186527e-02 + + -1.2891520559787750e-01 1.0874609649181366e-01 + <_> + + 0 -1 4275 4.4858800247311592e-03 + + 5.0264850258827209e-02 -2.2729620337486267e-01 + <_> + + 0 -1 4276 -7.2019517421722412e-02 + + -5.0357151031494141e-01 2.4909170344471931e-02 + <_> + + 0 -1 4277 7.4088312685489655e-02 + + -2.6110179722309113e-02 4.6904951333999634e-01 + <_> + + 0 -1 4278 -1.9376210868358612e-02 + + -8.7742328643798828e-02 5.2696809172630310e-02 + <_> + + 0 -1 4279 -1.5192059800028801e-02 + + -1.6470350325107574e-01 7.4841916561126709e-02 + <_> + + 0 -1 4280 6.7975218407809734e-03 + + -1.2512689828872681e-01 8.2092992961406708e-02 + <_> + + 0 -1 4281 -1.9816169515252113e-03 + + 6.1259880661964417e-02 -1.9138810038566589e-01 + <_> + + 0 -1 4282 -4.0343839675188065e-02 + + -3.4634640812873840e-01 3.3814091235399246e-02 + <_> + + 0 -1 4283 -9.7851715981960297e-03 + + 2.4771960079669952e-01 -5.1031429320573807e-02 + <_> + + 0 -1 4284 1.3061050325632095e-02 + + -5.9378169476985931e-02 1.4298720657825470e-01 + <_> + + 0 -1 4285 1.2519969604909420e-02 + + -1.0087440162897110e-01 2.0617449283599854e-01 + <_> + + 0 -1 4286 6.1620049178600311e-02 + + 1.0850620456039906e-02 -4.9976751208305359e-01 + <_> + + 0 -1 4287 1.5351610258221626e-02 + + 3.0459180474281311e-02 -4.0248531103134155e-01 + <_> + + 0 -1 4288 6.7390319891273975e-03 + + -1.5230870246887207e-01 3.4763731062412262e-02 + <_> + + 0 -1 4289 2.7166040614247322e-02 + + 3.2465178519487381e-02 -3.7905651330947876e-01 + <_> + + 0 -1 4290 -4.9443650990724564e-02 + + -4.1042488813400269e-01 1.5265700407326221e-02 + <_> + + 0 -1 4291 3.2999709248542786e-02 + + 2.8922239318490028e-02 -4.3119680881500244e-01 + <_> + + 0 -1 4292 3.7604149430990219e-02 + + 2.0920699462294579e-02 -3.5471540689468384e-01 + <_> + + 0 -1 4293 1.7311640083789825e-02 + + -1.5490870177745819e-01 7.3543228209018707e-02 + <_> + + 0 -1 4294 -1.7037079669535160e-03 + + -9.5346920192241669e-02 5.1517289131879807e-02 + <_> + + 0 -1 4295 -1.5008790418505669e-02 + + 2.1057499945163727e-01 -5.2197169512510300e-02 + <_> + + 0 -1 4296 -4.1283361613750458e-02 + + -4.8727679252624512e-01 1.6686370596289635e-02 + <_> + + 0 -1 4297 -1.7190299928188324e-02 + + 2.3070749640464783e-01 -5.7094439864158630e-02 + <_> + + 0 -1 4298 3.9707008749246597e-02 + + 1.7016230151057243e-02 -3.8233861327171326e-01 + <_> + + 0 -1 4299 4.7051470726728439e-02 + + 4.2239248752593994e-02 -2.8050369024276733e-01 + <_> + + 0 -1 4300 -1.1948949657380581e-02 + + -2.3056490719318390e-01 2.6532189920544624e-02 + <_> + + 0 -1 4301 -7.9857409000396729e-02 + + -8.4963917732238770e-01 1.2582180090248585e-02 + <_> + + 0 -1 4302 2.5627639144659042e-02 + + 2.3311240598559380e-02 -2.4923819303512573e-01 + <_> + + 0 -1 4303 -3.1094370409846306e-02 + + -2.3769870400428772e-01 4.6116128563880920e-02 + <_> + + 0 -1 4304 4.6573221683502197e-02 + + 2.8770290315151215e-02 -5.3739601373672485e-01 + <_> + + 0 -1 4305 -5.4066929966211319e-02 + + 2.7794760465621948e-01 -4.7770768404006958e-02 + <_> + + 0 -1 4306 1.8918470013886690e-03 + + -9.8254829645156860e-02 4.7856420278549194e-02 + <_> + + 0 -1 4307 3.3229328691959381e-02 + + -5.2595350891351700e-02 2.3564100265502930e-01 + <_> + + 0 -1 4308 1.1775200255215168e-03 + + -2.3401489853858948e-01 2.6142070069909096e-02 + <_> + + 0 -1 4309 1.9482020288705826e-03 + + -1.5223619341850281e-01 7.8751467168331146e-02 + <_> + + 0 -1 4310 5.5945508182048798e-02 + + 1.1540699750185013e-02 -1.9889539480209351e-01 + <_> + + 0 -1 4311 2.9455369338393211e-02 + + 3.3315770328044891e-02 -3.2850489020347595e-01 + <_> + + 0 -1 4312 4.0880320593714714e-03 + + -8.6178407073020935e-02 7.9575799405574799e-02 + <_> + + 0 -1 4313 -5.9127728454768658e-03 + + -1.7738300561904907e-01 6.0648940503597260e-02 + <_> + + 0 -1 4314 -6.2419679015874863e-02 + + 2.4396699666976929e-01 -3.3243889920413494e-03 + <_> + + 0 -1 4315 -3.7195120006799698e-02 + + 2.6807048916816711e-01 -3.9979271590709686e-02 + <_> + + 0 -1 4316 -1.4324760437011719e-01 + + 2.9332828521728516e-01 -2.6897290721535683e-02 + <_> + + 0 -1 4317 -4.2845219373703003e-02 + + -2.5283750891685486e-01 4.1232049465179443e-02 + <_> + + 0 -1 4318 1.1560089886188507e-01 + + -1.4965849928557873e-02 2.4187250435352325e-01 + <_> + + 0 -1 4319 5.0169471651315689e-02 + + 8.8590547442436218e-02 -1.2442570179700851e-01 + <_> + + 0 -1 4320 1.0200110077857971e-01 + + 1.2396319769322872e-02 -3.6982178688049316e-01 + <_> + + 0 -1 4321 -5.2397060208022594e-03 + + -2.5912949442863464e-01 4.0550298988819122e-02 + <_> + + 0 -1 4322 -1.9227810204029083e-02 + + 2.0064230263233185e-01 -6.5223582088947296e-02 + <_> + + 0 -1 4323 -1.1133120395243168e-02 + + -4.6262189745903015e-01 2.4428030475974083e-02 + <_> + + 0 -1 4324 9.7551010549068451e-02 + + 1.2901189737021923e-02 -7.4022471904754639e-01 + <_> + + 0 -1 4325 4.6071741729974747e-02 + + 1.8453989177942276e-02 -4.8419821262359619e-01 + <_> + + 0 -1 4326 -8.3533532917499542e-02 + + -8.8434767723083496e-01 1.6764779575169086e-03 + <_> + + 0 -1 4327 6.0535832308232784e-03 + + -1.5865640342235565e-01 6.7758671939373016e-02 + <_> + + 0 -1 4328 -1.3178240042179823e-03 + + -8.7943129241466522e-02 6.6591359674930573e-02 + <_> + + 0 -1 4329 -2.0939730107784271e-02 + + 2.3358969390392303e-01 -5.2145671099424362e-02 + <_> + + 0 -1 4330 -8.8145419955253601e-02 + + 4.8081308603286743e-01 -1.1917640455067158e-02 + <_> + + 0 -1 4331 1.6344599425792694e-02 + + -5.3838059306144714e-02 2.2349910438060760e-01 + <_> + + 0 -1 4332 -2.2833999991416931e-01 + + 3.6013820767402649e-01 -1.8727909773588181e-02 + <_> + + 0 -1 4333 8.4737362340092659e-03 + + -5.6207131594419479e-02 1.6089470684528351e-01 + <_> + + 0 -1 4334 -9.8505034111440182e-04 + + 1.0108830034732819e-01 -1.0455229878425598e-01 + <_> + + 0 -1 4335 4.9648447893559933e-03 + + -7.9359367489814758e-02 1.3140240311622620e-01 + <_> + + 0 -1 4336 -1.3171610422432423e-02 + + -1.2099819630384445e-01 3.7730131298303604e-02 + <_> + + 0 -1 4337 8.2112876698374748e-03 + + -5.3597409278154373e-02 2.2156579792499542e-01 + <_> + + 0 -1 4338 -4.8930559307336807e-02 + + -3.9349249005317688e-01 1.9850309938192368e-02 + <_> + + 0 -1 4339 7.4527352117002010e-03 + + 5.8218438178300858e-02 -2.5317558646202087e-01 + <_> + + 0 -1 4340 7.7388651669025421e-02 + + -5.7724680751562119e-02 2.0154540240764618e-01 + <_> + + 0 -1 4341 4.9968929961323738e-03 + + 8.9260630309581757e-02 -1.3082459568977356e-01 + <_> + + 0 -1 4342 -4.0977269411087036e-02 + + -1.7190429568290710e-01 2.2051449865102768e-02 + <_> + + 0 -1 4343 3.0041709542274475e-03 + + 4.5379869639873505e-02 -2.4130369722843170e-01 + <_> + + 0 -1 4344 1.5435700118541718e-01 + + -3.2916471362113953e-02 3.2090398669242859e-01 + <_> + + 0 -1 4345 1.5153509564697742e-02 + + 5.3576458245515823e-02 -1.6273179650306702e-01 + <_> + + 0 -1 4346 9.5209293067455292e-02 + + 1.3132530264556408e-02 -4.3389630317687988e-01 + <_> + + 0 -1 4347 -2.2066019475460052e-02 + + 1.8358850479125977e-01 -5.3995680063962936e-02 + <_> + + 0 -1 4348 -4.0623430162668228e-02 + + -4.5687249302864075e-01 1.1119400151073933e-02 + <_> + + 0 -1 4349 -2.1428579930216074e-03 + + 9.5221467316150665e-02 -1.0431689769029617e-01 + <_> + + 0 -1 4350 -9.6598910167813301e-03 + + -2.8121781349182129e-01 3.1387180089950562e-02 + <_> + + 0 -1 4351 -1.7860020697116852e-01 + + 4.6675390005111694e-01 -2.2296290844678879e-02 + <_> + + 0 -1 4352 -2.0536049269139767e-03 + + -8.8460110127925873e-02 2.5863479822874069e-02 + <_> + + 0 -1 4353 -4.6333461068570614e-03 + + 6.0720779001712799e-02 -1.6562700271606445e-01 + <_> + + 0 -1 4354 4.6847991645336151e-02 + + -4.0696758776903152e-02 1.0598970204591751e-01 + <_> + + 0 -1 4355 -9.0538233518600464e-02 + + -6.3367050886154175e-01 1.6277700662612915e-02 + <_> + + 0 -1 4356 -6.6260926425457001e-02 + + -2.8792759776115417e-01 6.1133177950978279e-03 + <_> + + 0 -1 4357 2.4731729179620743e-02 + + 4.0057931095361710e-02 -2.3272530734539032e-01 + <_> + + 0 -1 4358 -1.3736580312252045e-01 + + 4.7250029444694519e-01 -8.2997139543294907e-03 + <_> + + 0 -1 4359 -6.3414901494979858e-02 + + 4.3039301037788391e-01 -2.1049000322818756e-02 + <_> + + 0 -1 4360 -3.3071819692850113e-02 + + -1.1073499917984009e-01 3.3718731254339218e-02 + <_> + + 0 -1 4361 1.0934790223836899e-01 + + 1.3508499599993229e-02 -6.5502017736434937e-01 + <_> + + 0 -1 4362 1.5925880521535873e-02 + + 3.3672690391540527e-02 -7.0779062807559967e-02 + <_> + + 0 -1 4363 -7.4891438707709312e-03 + + -2.6472839713096619e-01 3.8183860480785370e-02 + <_> + + 0 -1 4364 9.8611623980104923e-04 + + -1.6149909794330597e-01 2.9475390911102295e-02 + <_> + + 0 -1 4365 2.5206479430198669e-01 + + -3.2382488250732422e-02 3.1068611145019531e-01 + <_> + + 0 -1 4366 -2.8892729431390762e-02 + + -4.9116641283035278e-01 1.4923149719834328e-02 + <_> + + 0 -1 4367 -5.5389881134033203e-02 + + 5.7543408870697021e-01 -1.8582839518785477e-02 + <_> + + 0 -1 4368 3.1414598226547241e-02 + + 2.0720759406685829e-02 -9.4729647040367126e-02 + <_> + + 0 -1 4369 2.8307519387453794e-03 + + -2.2519350051879883e-01 4.1564159095287323e-02 + <_> + + 0 -1 4370 -3.3751260489225388e-02 + + -1.6646580398082733e-01 7.2693623602390289e-02 + <_> + + 0 -1 4371 -3.8290288299322128e-02 + + 7.9213732481002808e-01 -1.1434529908001423e-02 + <_> + + 0 -1 4372 -1.7989480867981911e-02 + + 1.1361669749021530e-01 -4.4032510370016098e-02 + <_> + + 0 -1 4373 1.8146529793739319e-02 + + 3.4219540655612946e-02 -2.5041630864143372e-01 + <_> + + 0 -1 4374 -6.9133192300796509e-02 + + -2.9793199896812439e-01 4.9929767847061157e-03 + <_> + + 0 -1 4375 1.2525920569896698e-01 + + 1.0709079913794994e-02 -7.6342308521270752e-01 + <_> + + 0 -1 4376 3.7683561444282532e-02 + + -3.4866910427808762e-02 1.9532379508018494e-01 + <_> + + 0 -1 4377 -7.6676071621477604e-03 + + 1.7114819586277008e-01 -5.1101781427860260e-02 + <_> + + 0 -1 4378 3.5654550883919001e-03 + + -6.9071911275386810e-02 6.5724693238735199e-02 + <_> + + 0 -1 4379 -1.8968600779771805e-02 + + -4.0976929664611816e-01 2.0560229197144508e-02 + <_> + + 0 -1 4380 -2.0211370661854744e-02 + + 3.3508920669555664e-01 -2.7907410636544228e-02 + <_> + + 0 -1 4381 -1.9064599648118019e-02 + + 1.9361929595470428e-01 -4.8648219555616379e-02 + <_> + + 0 -1 4382 1.0313340276479721e-01 + + 1.9382460042834282e-02 -1.1198680102825165e-01 + <_> + + 0 -1 4383 9.8863355815410614e-03 + + -2.4043160676956177e-01 4.4305600225925446e-02 + <_> + + 0 -1 4384 4.3293699622154236e-02 + + 1.0728780180215836e-02 -6.4660537242889404e-01 + <_> + + 0 -1 4385 6.1878331005573273e-02 + + 1.0291899554431438e-02 -7.2967112064361572e-01 + <_> + + 0 -1 4386 9.7703160718083382e-03 + + 3.1311180442571640e-02 -1.5605080127716064e-01 + <_> + + 0 -1 4387 -8.3175063133239746e-02 + + -3.3045348525047302e-01 2.3997390642762184e-02 + <_> + + 0 -1 4388 -3.1724658608436584e-01 + + 5.4760771989822388e-01 -1.7853379249572754e-02 + <_> + + 0 -1 4389 6.7434520460665226e-03 + + -6.6969439387321472e-02 1.2657959759235382e-01 + <_> + + 0 -1 4390 4.0886890143156052e-02 + + 4.3191551230847836e-03 -2.2032399475574493e-01 + <_> + + 0 -1 4391 6.4959921874105930e-03 + + 5.4097741842269897e-02 -1.5504899621009827e-01 + <_> + + 0 -1 4392 -3.2832350581884384e-02 + + 3.0770578980445862e-01 -2.4346910417079926e-02 + <_> + + 0 -1 4393 -1.6127960756421089e-02 + + -1.0477919876575470e-01 9.1267466545104980e-02 + <_> + + 0 -1 4394 3.4646671265363693e-02 + + 1.4030230231583118e-02 -1.8207600712776184e-01 + <_> + + 0 -1 4395 -3.3005408942699432e-02 + + 3.8698929548263550e-01 -2.1859629079699516e-02 + <_> + + 0 -1 4396 -4.3908338993787766e-02 + + -3.0621778964996338e-01 2.2774800658226013e-02 + <_> + + 0 -1 4397 2.4842899292707443e-02 + + 3.2077241688966751e-02 -2.5279021263122559e-01 + <_> + + 0 -1 4398 1.0331260040402412e-02 + + -6.0551200062036514e-02 1.2119130045175552e-01 + <_> + + 0 -1 4399 -6.7832246422767639e-02 + + -5.5833387374877930e-01 1.5336999669671059e-02 + <_> + + 0 -1 4400 3.4947868436574936e-02 + + 1.1647179722785950e-02 -2.5563651323318481e-01 + <_> + + 0 -1 4401 -2.5261789560317993e-02 + + 3.2832020521163940e-01 -2.3357210680842400e-02 + <_> + + 0 -1 4402 7.5701558962464333e-03 + + 7.1183882653713226e-02 -8.3878181874752045e-02 + <_> + + 0 -1 4403 1.1809100210666656e-01 + + -4.1809991002082825e-02 2.2083349525928497e-01 + <_> + + 0 -1 4404 3.6332231014966965e-02 + + 1.7415270209312439e-01 -5.1788080483675003e-02 + <_> + + 0 -1 4405 1.3216850347816944e-02 + + -4.7699850797653198e-01 1.8878389149904251e-02 + <_> + + 0 -1 4406 1.4325110241770744e-02 + + 2.1834760904312134e-02 -1.3961690664291382e-01 + <_> + + 0 -1 4407 1.3779220171272755e-03 + + -2.0156779885292053e-01 3.9925381541252136e-02 + <_> + + 0 -1 4408 1.4492850005626678e-01 + + -3.3947311341762543e-02 1.4805939793586731e-01 + <_> + + 0 -1 4409 2.0336720347404480e-01 + + -2.8280159458518028e-02 3.0469599366188049e-01 + <_> + + 0 -1 4410 -3.0550520867109299e-02 + + 1.5751589834690094e-01 -3.4339658915996552e-02 + <_> + + 0 -1 4411 -1.1067859828472137e-02 + + 2.4688349664211273e-01 -3.7554491311311722e-02 + <_> + + 0 -1 4412 2.5981210172176361e-02 + + 2.1994030103087425e-02 -1.4765749871730804e-01 + <_> + + 0 -1 4413 -4.8331938683986664e-02 + + -2.5580298900604248e-01 3.2857868820428848e-02 + <_> + + 0 -1 4414 1.5268280170857906e-02 + + 6.2162041664123535e-02 -5.1811810582876205e-02 + <_> + + 0 -1 4415 -2.4390730261802673e-01 + + 5.0339847803115845e-01 -1.6864169389009476e-02 + <_> + + 0 -1 4416 -3.2398870680481195e-03 + + -1.3850170373916626e-01 6.3738316297531128e-02 + <_> + + 0 -1 4417 6.1450928449630737e-02 + + -5.6962829083204269e-02 1.4706780016422272e-01 + <_> + + 0 -1 4418 4.3161489069461823e-02 + + 2.3441100493073463e-02 -2.6922780275344849e-01 + <_> + + 0 -1 4419 -1.1370860040187836e-02 + + -2.6135998964309692e-01 3.3624760806560516e-02 + <_> + + 0 -1 4420 -1.5418549999594688e-02 + + 2.2153179347515106e-01 -4.0866490453481674e-02 + <_> + + 0 -1 4421 4.5487228780984879e-02 + + -3.1598750501871109e-02 2.5687301158905029e-01 + <_> + + 0 -1 4422 -1.5879619866609573e-02 + + -2.9981338977813721e-01 2.7006199583411217e-02 + <_> + + 0 -1 4423 5.7012498378753662e-02 + + 1.5179580077528954e-02 -5.2078807353973389e-01 + <_> + + 0 -1 4424 -1.5038490295410156e-01 + + 2.5164321064949036e-01 -4.0796510875225067e-02 + <_> + + 0 -1 4425 -4.2246039956808090e-02 + + -4.8303580284118652e-01 1.9222039729356766e-02 + <_> + + 0 -1 4426 -7.4928469955921173e-02 + + -9.5458990335464478e-01 4.4229729101061821e-03 + <_> + + 0 -1 4427 -2.1251840516924858e-02 + + 3.1850698590278625e-01 -2.8021970763802528e-02 + <_> + + 0 -1 4428 5.3983781486749649e-02 + + 2.7037480846047401e-02 -3.4430688619613647e-01 + <_> + + 0 -1 4429 3.3572580665349960e-02 + + -7.6545879244804382e-02 1.4255550503730774e-01 + <_> + + 0 -1 4430 -6.7975879646837711e-03 + + 1.7748320102691650e-01 -4.3155338615179062e-02 + <_> + + 0 -1 4431 -1.3311849907040596e-03 + + 1.5498100221157074e-01 -7.6261833310127258e-02 + <_> + + 0 -1 4432 3.9364699274301529e-02 + + 3.6991588771343231e-02 -2.4243550002574921e-01 + <_> + + 0 -1 4433 -6.8364520557224751e-03 + + 1.0743640363216400e-01 -9.3058176338672638e-02 + <_> + + 0 -1 4434 1.6118010506033897e-02 + + -3.5690911114215851e-02 2.4185790121555328e-01 + <_> + + 0 -1 4435 -7.0620089769363403e-02 + + 6.3363391160964966e-01 -1.2438289821147919e-02 + <_> + + 0 -1 4436 4.4361630082130432e-01 + + -3.7221789360046387e-02 1.1892700195312500e-01 + <_> + + 0 -1 4437 -8.1899233162403107e-02 + + 3.4853339195251465e-01 -2.5211019441485405e-02 + <_> + + 0 -1 4438 -8.2997446879744530e-03 + + -3.0899089574813843e-01 2.5778239592909813e-02 + <_> + + 0 -1 4439 -2.9730390757322311e-02 + + -3.0759811401367188e-01 2.5530820712447166e-02 + <_> + + 0 -1 4440 -2.6014490053057671e-02 + + -1.2162390351295471e-01 1.8338350579142570e-02 + <_> + + 0 -1 4441 4.5121149742044508e-04 + + -5.4737848043441772e-01 1.3564749620854855e-02 + <_> + + 0 -1 4442 1.8679940700531006e-01 + + 7.8039847314357758e-02 -5.8137271553277969e-02 + <_> + + 0 -1 4443 3.1894310377538204e-03 + + -2.4976019561290741e-01 3.0865840613842010e-02 + <_> + + 0 -1 4444 -2.9449069872498512e-02 + + 1.0489200055599213e-01 -4.8869129270315170e-02 + <_> + + 0 -1 4445 2.9614970088005066e-02 + + -2.2261720150709152e-02 3.4992438554763794e-01 + <_> + + 0 -1 4446 3.9882060140371323e-02 + + 9.6727507188916206e-03 -6.7914432287216187e-01 + <_> + + 0 -1 4447 -2.4404419586062431e-02 + + -2.6743829250335693e-01 3.0360370874404907e-02 + <_> + + 0 -1 4448 4.3481849133968353e-02 + + -2.3372199386358261e-02 2.1356420218944550e-01 + <_> + + 0 -1 4449 -4.8128370195627213e-02 + + -3.6890029907226562e-01 2.2832820191979408e-02 + <_> + + 0 -1 4450 -1.3142440002411604e-03 + + 5.6764688342809677e-02 -1.3795310258865356e-01 + <_> + + 0 -1 4451 2.1767991129308939e-03 + + 8.2446262240409851e-02 -1.0511689633131027e-01 + <_> + + 0 -1 4452 -2.7471050620079041e-02 + + 9.6438340842723846e-02 -5.1520779728889465e-02 + <_> + + 0 -1 4453 5.2003171294927597e-02 + + -2.3240759968757629e-02 3.5900598764419556e-01 + <_> + + 0 -1 4454 2.9681740328669548e-02 + + 1.4641559682786465e-02 -2.1500889956951141e-01 + <_> + + 0 -1 4455 -4.7545950859785080e-02 + + -3.8834908604621887e-01 2.2062640637159348e-02 + <_> + + 0 -1 4456 -9.6900813281536102e-02 + + -4.3412810564041138e-01 6.4087379723787308e-03 + <_> + + 0 -1 4457 -3.8218989968299866e-01 + + -9.0176671743392944e-01 7.9825157299637794e-03 + <_> + + 0 -1 4458 -3.4389309585094452e-02 + + -3.1850269436836243e-01 9.1135511174798012e-03 + <_> + + 0 -1 4459 3.9068788290023804e-02 + + 2.8420960530638695e-02 -2.6570749282836914e-01 + <_> + + 0 -1 4460 1.0031700134277344e-01 + + -1.6155399382114410e-02 1.2212689965963364e-01 + <_> + + 0 -1 4461 -1.0857210308313370e-01 + + 3.7742871046066284e-01 -2.4014420807361603e-02 + <_> + + 0 -1 4462 -4.3303978600306436e-05 + + 2.0308060571551323e-02 -1.3060510158538818e-01 + <_> + + 0 -1 4463 -3.8757279515266418e-02 + + -1.5826420485973358e-01 4.9129229038953781e-02 + <_> + + 0 -1 4464 6.8668089807033539e-02 + + 5.5041261948645115e-03 -7.2222518920898438e-01 + <_> + + 0 -1 4465 -4.4268090277910233e-03 + + 8.2263059914112091e-02 -1.0354729741811752e-01 + <_> + + 0 -1 4466 -3.1016240245662630e-04 + + 9.0432256460189819e-02 -1.0348629951477051e-01 + <_> + + 0 -1 4467 3.7703070789575577e-02 + + 6.0126338154077530e-02 -1.6111390292644501e-01 + <_> + + 0 -1 4468 4.1672129184007645e-02 + + 8.5145309567451477e-03 -2.4217429757118225e-01 + <_> + + 0 -1 4469 -6.6434321925044060e-03 + + -2.7172479033470154e-01 3.1463291496038437e-02 + <_> + + 0 -1 4470 -4.0658649057149887e-02 + + -1.1673620343208313e-01 1.4849590137600899e-02 + <_> + + 0 -1 4471 -3.0082110315561295e-03 + + 4.0028568357229233e-02 -2.3079049587249756e-01 + <_> + + 0 -1 4472 -4.4187769293785095e-02 + + -1.7888109385967255e-01 1.7313620075583458e-02 + <_> + + 0 -1 4473 -1.1813719756901264e-02 + + 1.5633359551429749e-01 -5.4751630872488022e-02 + <_> + + 0 -1 4474 -2.4433450400829315e-01 + + 4.0716889500617981e-01 -3.8216509856283665e-03 + <_> + + 0 -1 4475 4.7230181097984314e-01 + + -5.5454619228839874e-02 1.6410639882087708e-01 + <_> + + 0 -1 4476 1.7955109942704439e-03 + + 9.5228001475334167e-02 -1.2934769690036774e-01 + <_> + + 0 -1 4477 -5.0934039056301117e-02 + + 2.2153440117835999e-01 -3.7975560873746872e-02 + <_> + + 0 -1 4478 -5.9531718492507935e-02 + + -4.2974939942359924e-01 1.3196409679949284e-02 + <_> + + 0 -1 4479 -3.5149399191141129e-02 + + -2.1232509613037109e-01 3.6872539669275284e-02 + <_> + + 0 -1 4480 -8.2134327385574579e-04 + + 7.4890241026878357e-02 -6.9701731204986572e-02 + <_> + + 0 -1 4481 6.3945869915187359e-03 + + 8.0602109432220459e-02 -1.0488619655370712e-01 + <_> + + 0 -1 4482 6.3735827803611755e-02 + + 1.1988660320639610e-02 -5.9508371353149414e-01 + <_> + + 0 -1 4483 6.6942021250724792e-02 + + 1.0711859911680222e-02 -7.0240277051925659e-01 + <_> + + 0 -1 4484 3.5445358604192734e-02 + + 8.8395569473505020e-03 -2.0588539540767670e-01 + <_> + + 0 -1 4485 8.2025423645973206e-02 + + 1.1511360295116901e-02 -6.7081338167190552e-01 + <_> + + 0 -1 4486 -1.2151840329170227e-01 + + 3.9124768972396851e-01 -6.0432488098740578e-03 + <_> + + 0 -1 4487 1.3732859492301941e-01 + + -1.6136020421981812e-02 4.6182548999786377e-01 + <_> + + 0 -1 4488 -1.6075259447097778e-01 + + -1. 2.4232869036495686e-03 + <_> + + 0 -1 4489 6.3080438412725925e-03 + + 4.3026689440011978e-02 -1.9072249531745911e-01 + <_> + + 0 -1 4490 -8.5772968828678131e-02 + + -5.3327548503875732e-01 1.4197999611496925e-02 + <_> + + 0 -1 4491 5.5853448808193207e-02 + + 4.0535259991884232e-02 -2.0816819369792938e-01 + <_> + 350 + -1.3171190023422241e+00 + + <_> + + 0 -1 4492 -1.1009960435330868e-02 + + 1.6106800734996796e-01 -2.3270499706268311e-01 + <_> + + 0 -1 4493 5.6892321445047855e-03 + + -2.2233660519123077e-01 1.2257739901542664e-01 + <_> + + 0 -1 4494 4.3932348489761353e-03 + + -1.5293380618095398e-01 1.5888489782810211e-01 + <_> + + 0 -1 4495 -5.0024059601128101e-04 + + 6.1716180294752121e-02 -2.3175540566444397e-01 + <_> + + 0 -1 4496 4.2015648796223104e-04 + + -3.0259498953819275e-01 6.1093948781490326e-02 + <_> + + 0 -1 4497 -4.2626978829503059e-03 + + -2.4387679994106293e-01 6.9513782858848572e-02 + <_> + + 0 -1 4498 6.5330968936905265e-04 + + -3.7112379074096680e-01 4.6169780194759369e-02 + <_> + + 0 -1 4499 -1.0163539648056030e-01 + + 4.5089960098266602e-01 -1.4424510300159454e-02 + <_> + + 0 -1 4500 -1.3200199464336038e-03 + + 7.5765132904052734e-02 -1.9461849331855774e-01 + <_> + + 0 -1 4501 -9.8261423408985138e-03 + + -2.7440890669822693e-01 5.2373219281435013e-02 + <_> + + 0 -1 4502 -6.6574551165103912e-02 + + 4.2804849147796631e-01 -3.2640948891639709e-02 + <_> + + 0 -1 4503 -9.1772843152284622e-03 + + -2.5876390933990479e-01 6.1596788465976715e-02 + <_> + + 0 -1 4504 -2.5353950913995504e-03 + + 1.1473689973354340e-01 -1.0097979754209518e-01 + <_> + + 0 -1 4505 4.9194418825209141e-03 + + 4.0027469396591187e-02 -1.6378170251846313e-01 + <_> + + 0 -1 4506 -1.6810640227049589e-03 + + -1.3706670701503754e-01 8.0321729183197021e-02 + <_> + + 0 -1 4507 2.1476070396602154e-03 + + -2.3408600687980652e-01 4.3113950639963150e-02 + <_> + + 0 -1 4508 -3.3502440899610519e-02 + + -2.4204289913177490e-01 4.9100209027528763e-02 + <_> + + 0 -1 4509 1.4241789281368256e-01 + + -2.8680980205535889e-02 4.7807058691978455e-01 + <_> + + 0 -1 4510 5.8733951300382614e-04 + + -2.1685610711574554e-01 4.8530109226703644e-02 + <_> + + 0 -1 4511 -1.2295519700273871e-03 + + 9.3180246651172638e-02 -1.0158210247755051e-01 + <_> + + 0 -1 4512 1.1210669763386250e-02 + + 3.6210179328918457e-02 -2.3106449842453003e-01 + <_> + + 0 -1 4513 -2.5235990062355995e-02 + + 8.5747621953487396e-02 -5.4415158927440643e-02 + <_> + + 0 -1 4514 -1.0014030151069164e-02 + + -1.9362440705299377e-01 5.0274729728698730e-02 + <_> + + 0 -1 4515 -4.5554949901998043e-03 + + 8.8674992322921753e-02 -1.4237509667873383e-01 + <_> + + 0 -1 4516 -9.5264799892902374e-03 + + 2.6754239201545715e-01 -3.7632450461387634e-02 + <_> + + 0 -1 4517 2.3753349669277668e-03 + + 3.9261918514966965e-02 -1.4199909567832947e-01 + <_> + + 0 -1 4518 1.2389000039547682e-03 + + 6.8643912672996521e-02 -1.8060870468616486e-01 + <_> + + 0 -1 4519 -1.5835729427635670e-03 + + -1.3684159517288208e-01 5.7875689119100571e-02 + <_> + + 0 -1 4520 6.5202586352825165e-02 + + -3.4448388963937759e-02 2.5318139791488647e-01 + <_> + + 0 -1 4521 6.6306376538705081e-05 + + -8.4601633250713348e-02 9.1657586395740509e-02 + <_> + + 0 -1 4522 1.5117590010049753e-05 + + -9.3343816697597504e-02 1.1079390347003937e-01 + <_> + + 0 -1 4523 -2.2637350484728813e-03 + + -1.9531199336051941e-01 3.8263510912656784e-02 + <_> + + 0 -1 4524 6.5463641658425331e-04 + + 4.7860879451036453e-02 -1.6354900598526001e-01 + <_> + + 0 -1 4525 5.0345290452241898e-02 + + -1.5618369914591312e-02 5.2660512924194336e-01 + <_> + + 0 -1 4526 8.5375197231769562e-03 + + 3.3894728869199753e-02 -2.7040940523147583e-01 + <_> + + 0 -1 4527 -6.1621618270874023e-01 + + -9.3156081438064575e-01 2.6866910047829151e-03 + <_> + + 0 -1 4528 -2.6742840185761452e-02 + + 1.2415560334920883e-01 -8.1576861441135406e-02 + <_> + + 0 -1 4529 -1.4756740070879459e-02 + + -4.4224148988723755e-01 2.4418739601969719e-02 + <_> + + 0 -1 4530 1.2045809999108315e-02 + + -8.4552876651287079e-02 9.2735297977924347e-02 + <_> + + 0 -1 4531 -4.0131900459527969e-02 + + -2.5734719634056091e-01 1.0692110285162926e-02 + <_> + + 0 -1 4532 -1.0760580189526081e-03 + + 2.8027180582284927e-02 -2.6805961132049561e-01 + <_> + + 0 -1 4533 7.7456878498196602e-03 + + -3.6401689052581787e-02 2.6165041327476501e-01 + <_> + + 0 -1 4534 1.3539849780499935e-02 + + 2.8945919126272202e-02 -2.8003379702568054e-01 + <_> + + 0 -1 4535 -1.2464780360460281e-02 + + -3.6258488893508911e-01 1.3006039895117283e-02 + <_> + + 0 -1 4536 3.5297829657793045e-02 + + 1.2918749824166298e-02 -5.6460797786712646e-01 + <_> + + 0 -1 4537 -5.5710550397634506e-02 + + 1.2794859707355499e-01 -3.8257118314504623e-02 + <_> + + 0 -1 4538 -4.5230439864099026e-03 + + -9.9410563707351685e-02 7.8997522592544556e-02 + <_> + + 0 -1 4539 2.9874469619244337e-03 + + -4.8509139567613602e-02 1.1298680305480957e-01 + <_> + + 0 -1 4540 -6.3613310456275940e-02 + + -6.6647279262542725e-01 1.1221170425415039e-02 + <_> + + 0 -1 4541 1.3244490139186382e-02 + + -6.1976868659257889e-02 1.3122899830341339e-01 + <_> + + 0 -1 4542 -3.6382430698722601e-04 + + 4.3054241687059402e-02 -1.6996359825134277e-01 + <_> + + 0 -1 4543 -2.1500189602375031e-01 + + -4.6784079074859619e-01 1.2286320328712463e-02 + <_> + + 0 -1 4544 6.0248938389122486e-03 + + -5.1475919783115387e-02 1.5234859287738800e-01 + <_> + + 0 -1 4545 4.3000571429729462e-02 + + 3.8120739627629519e-03 -7.5349187850952148e-01 + <_> + + 0 -1 4546 8.5592586547136307e-03 + + 2.4470439180731773e-02 -3.2796609401702881e-01 + <_> + + 0 -1 4547 2.9510160675272346e-04 + + -7.6456926763057709e-02 6.8010047078132629e-02 + <_> + + 0 -1 4548 9.9761411547660828e-04 + + -8.4680661559104919e-02 9.6316136419773102e-02 + <_> + + 0 -1 4549 5.0175599753856659e-03 + + -3.9048101752996445e-02 1.0983789712190628e-01 + <_> + + 0 -1 4550 5.5693010799586773e-03 + + 4.0719300508499146e-02 -1.8395960330963135e-01 + <_> + + 0 -1 4551 1.0486049577593803e-03 + + -4.4622048735618591e-02 7.0918112993240356e-02 + <_> + + 0 -1 4552 3.2043100800365210e-03 + + -5.8839108794927597e-02 1.2777310609817505e-01 + <_> + + 0 -1 4553 -1.0644660145044327e-01 + + 4.3339949846267700e-01 -1.2449969537556171e-02 + <_> + + 0 -1 4554 -8.9908082736656070e-04 + + -1.1510500311851501e-01 6.3306562602519989e-02 + <_> + + 0 -1 4555 2.9652470257133245e-03 + + -3.1290680170059204e-02 7.2845660150051117e-02 + <_> + + 0 -1 4556 8.9800870046019554e-04 + + -8.6840502917766571e-02 1.0022729635238647e-01 + <_> + + 0 -1 4557 -2.1874029189348221e-02 + + 7.6143169403076172e-01 -4.5735938474535942e-03 + <_> + + 0 -1 4558 1.4919589739292860e-03 + + 8.2724168896675110e-02 -9.6837893128395081e-02 + <_> + + 0 -1 4559 -2.4136069696396589e-03 + + 6.2480941414833069e-02 -5.0549559295177460e-02 + <_> + + 0 -1 4560 1.2893830426037312e-02 + + -3.3901989459991455e-02 2.8036591410636902e-01 + <_> + + 0 -1 4561 -1.9992720335721970e-03 + + -1.7152810096740723e-01 4.0084149688482285e-02 + <_> + + 0 -1 4562 1.3713949592784047e-03 + + -1.2216719985008240e-01 6.2122181057929993e-02 + <_> + + 0 -1 4563 -8.9740045368671417e-03 + + -1.7094230651855469e-01 4.4032000005245209e-02 + <_> + + 0 -1 4564 -2.9300691094249487e-03 + + 1.2364040315151215e-01 -6.3765726983547211e-02 + <_> + + 0 -1 4565 -8.0555928871035576e-03 + + 1.1552560329437256e-01 -4.4458869844675064e-02 + <_> + + 0 -1 4566 6.4662001095712185e-03 + + 7.5147427618503571e-02 -1.1281009763479233e-01 + <_> + + 0 -1 4567 -1.9541789591312408e-01 + + -8.6494231224060059e-01 3.1826570630073547e-03 + <_> + + 0 -1 4568 -1.5740759670734406e-01 + + -7.2405809164047241e-01 9.4235781580209732e-03 + <_> + + 0 -1 4569 -3.1526461243629456e-02 + + -3.8218951225280762e-01 1.6386790201067924e-02 + <_> + + 0 -1 4570 5.0439048558473587e-02 + + -2.7623040601611137e-02 2.7306279540061951e-01 + <_> + + 0 -1 4571 -5.5078428704291582e-04 + + 4.9623548984527588e-02 -5.4462801665067673e-02 + <_> + + 0 -1 4572 1.5047970227897167e-03 + + -6.2058940529823303e-02 1.2204010039567947e-01 + <_> + + 0 -1 4573 -4.5796841382980347e-02 + + -9.3314772844314575e-01 6.8162381649017334e-03 + <_> + + 0 -1 4574 -9.3235643580555916e-03 + + -2.7436700463294983e-01 2.7820749208331108e-02 + <_> + + 0 -1 4575 1.0689129680395126e-01 + + 4.7212988138198853e-03 -4.4037041068077087e-01 + <_> + + 0 -1 4576 1.1234519770368934e-03 + + -1.4162249863147736e-01 4.7511368989944458e-02 + <_> + + 0 -1 4577 6.7312899045646191e-03 + + -4.5881479978561401e-02 1.1342740058898926e-01 + <_> + + 0 -1 4578 4.1264150291681290e-02 + + 1.1406780220568180e-02 -6.2894171476364136e-01 + <_> + + 0 -1 4579 -7.3788799345493317e-02 + + -4.1924831271171570e-01 7.9344836995005608e-03 + <_> + + 0 -1 4580 -3.2669529318809509e-02 + + 2.2224910557270050e-01 -3.0845979228615761e-02 + <_> + + 0 -1 4581 -5.9001590125262737e-03 + + -1.5003520250320435e-01 4.5819710940122604e-02 + <_> + + 0 -1 4582 -7.4141867458820343e-02 + + 5.6236612796783447e-01 -1.1184119619429111e-02 + <_> + + 0 -1 4583 -1.7110589891672134e-02 + + -3.0888330936431885e-01 1.7340350896120071e-02 + <_> + + 0 -1 4584 2.4508470669388771e-03 + + -5.7074081152677536e-02 1.1306890100240707e-01 + <_> + + 0 -1 4585 -2.1157979965209961e-02 + + 2.0264630019664764e-01 -1.4705169945955276e-02 + <_> + + 0 -1 4586 7.1819419972598553e-03 + + 2.9788199812173843e-02 -2.2308370471000671e-01 + <_> + + 0 -1 4587 5.0557879731059074e-03 + + -2.6257280260324478e-02 1.2028290331363678e-01 + <_> + + 0 -1 4588 1.2610659934580326e-02 + + 2.5965299457311630e-02 -2.5755238533020020e-01 + <_> + + 0 -1 4589 3.0165250791469589e-05 + + -1.1994919925928116e-01 2.8916500508785248e-02 + <_> + + 0 -1 4590 -1.3415860012173653e-03 + + 2.0592840015888214e-01 -3.2803039997816086e-02 + <_> + + 0 -1 4591 5.9342157328501344e-04 + + 4.9788691103458405e-02 -7.0998527109622955e-02 + <_> + + 0 -1 4592 -1.5428929589688778e-02 + + 3.2733771204948425e-01 -2.0239489153027534e-02 + <_> + + 0 -1 4593 -1.1928460298804566e-04 + + 2.6405010372400284e-02 -1.4666070044040680e-01 + <_> + + 0 -1 4594 -2.1726880222558975e-02 + + -4.4014349579811096e-01 1.4264649711549282e-02 + <_> + + 0 -1 4595 -3.0710769817233086e-02 + + 1.3549150526523590e-01 -1.7586210742592812e-02 + <_> + + 0 -1 4596 4.3861479498445988e-03 + + 5.4423790425062180e-02 -1.1234579980373383e-01 + <_> + + 0 -1 4597 4.7966800630092621e-03 + + -4.3494079262018204e-02 1.3108870387077332e-01 + <_> + + 0 -1 4598 2.2497470490634441e-03 + + 5.9489808976650238e-02 -1.0955479741096497e-01 + <_> + + 0 -1 4599 4.3578739278018475e-03 + + 5.9186179190874100e-02 -1.3026049733161926e-01 + <_> + + 0 -1 4600 2.0433720201253891e-03 + + -5.1625490188598633e-02 1.3787810504436493e-01 + <_> + + 0 -1 4601 -2.0268680527806282e-03 + + 8.8105127215385437e-02 -8.5867561399936676e-02 + <_> + + 0 -1 4602 -6.5703789005056024e-04 + + 7.1044988930225372e-02 -9.0751543641090393e-02 + <_> + + 0 -1 4603 4.4309969991445541e-02 + + -1.1522290296852589e-02 2.2733740508556366e-01 + <_> + + 0 -1 4604 4.6578957699239254e-03 + + -4.6123549342155457e-02 1.5277029573917389e-01 + <_> + + 0 -1 4605 -4.0960058569908142e-02 + + -5.5988901853561401e-01 1.2064740061759949e-02 + <_> + + 0 -1 4606 -6.7416871897876263e-03 + + 1.0484070330858231e-01 -6.5152801573276520e-02 + <_> + + 0 -1 4607 -2.9713090043514967e-04 + + 3.2221201807260513e-02 -8.4709979593753815e-02 + <_> + + 0 -1 4608 -8.0926045775413513e-03 + + -1.6476640105247498e-01 4.5700121670961380e-02 + <_> + + 0 -1 4609 4.0710348635911942e-02 + + 1.0099260136485100e-02 -1.0893329977989197e-01 + <_> + + 0 -1 4610 -1.1402929667383432e-03 + + -1.9269819557666779e-01 4.4590830802917480e-02 + <_> + + 0 -1 4611 -2.0306430757045746e-02 + + 6.8668061494827271e-01 -9.8533723503351212e-03 + <_> + + 0 -1 4612 4.8631370067596436e-02 + + 1.1991590261459351e-02 -6.4770907163619995e-01 + <_> + + 0 -1 4613 -5.4414950311183929e-02 + + 3.4730699658393860e-01 -1.1940590105950832e-02 + <_> + + 0 -1 4614 -5.9532530605792999e-02 + + 3.6410269141197205e-01 -1.6050819307565689e-02 + <_> + + 0 -1 4615 -3.5089451819658279e-02 + + -1.9252899289131165e-01 2.3598629981279373e-02 + <_> + + 0 -1 4616 5.7658711448311806e-03 + + -4.6293850988149643e-02 1.5287970006465912e-01 + <_> + + 0 -1 4617 -2.3687579669058323e-03 + + 5.7345230132341385e-02 -8.8195472955703735e-02 + <_> + + 0 -1 4618 -2.7341600507497787e-03 + + -2.3896160721778870e-01 2.5761809200048447e-02 + <_> + + 0 -1 4619 -9.1599775478243828e-03 + + 1.0037499666213989e-01 -2.6731979101896286e-02 + <_> + + 0 -1 4620 -5.0623171031475067e-02 + + 4.6908378601074219e-01 -1.3880429789423943e-02 + <_> + + 0 -1 4621 -4.3487590737640858e-03 + + -1.4812940359115601e-01 5.2115358412265778e-02 + <_> + + 0 -1 4622 4.0859800577163696e-01 + + 1.5454529784619808e-02 -4.6494269371032715e-01 + <_> + + 0 -1 4623 5.3104009479284286e-02 + + 7.8609427437186241e-03 -5.3555142879486084e-01 + <_> + + 0 -1 4624 -4.1035288013517857e-03 + + -1.3777880370616913e-01 4.6847809106111526e-02 + <_> + + 0 -1 4625 -2.7622529305517673e-03 + + 5.2303940057754517e-02 -9.4970837235450745e-02 + <_> + + 0 -1 4626 9.3903020024299622e-03 + + -2.3493729531764984e-02 3.6259791254997253e-01 + <_> + + 0 -1 4627 2.3771630600094795e-02 + + 8.0746166408061981e-02 -8.2893602550029755e-02 + <_> + + 0 -1 4628 2.8008709196001291e-03 + + -2.6595699787139893e-01 2.8534680604934692e-02 + <_> + + 0 -1 4629 -6.3013769686222076e-03 + + 8.0481633543968201e-02 -2.9016179963946342e-02 + <_> + + 0 -1 4630 -5.1433448679745197e-03 + + -1.1473509669303894e-01 5.8448631316423416e-02 + <_> + + 0 -1 4631 1.0679479455575347e-03 + + -3.1661890447139740e-02 5.4522778838872910e-02 + <_> + + 0 -1 4632 1.5213950537145138e-03 + + -6.2172550708055496e-02 9.7601316869258881e-02 + <_> + + 0 -1 4633 -3.3779911696910858e-02 + + -4.9582698941230774e-01 1.2093319557607174e-02 + <_> + + 0 -1 4634 -1.0505370050668716e-01 + + -9.8738801479339600e-01 5.1499558612704277e-03 + <_> + + 0 -1 4635 1.9685840234160423e-02 + + -5.6189429014921188e-02 9.1260537505149841e-02 + <_> + + 0 -1 4636 6.6470399498939514e-02 + + 1.4097889885306358e-02 -4.5731648802757263e-01 + <_> + + 0 -1 4637 -1.5898099169135094e-02 + + -2.3317760229110718e-01 1.1369620449841022e-02 + <_> + + 0 -1 4638 4.0450799278914928e-03 + + 4.3345049023628235e-02 -1.5908020734786987e-01 + <_> + + 0 -1 4639 -3.3486548811197281e-02 + + 1.3086590170860291e-01 -3.4327559173107147e-02 + <_> + + 0 -1 4640 2.1458480507135391e-02 + + -5.0213351845741272e-02 1.1467009782791138e-01 + <_> + + 0 -1 4641 1.1672739684581757e-01 + + -3.4590030554682016e-03 4.4156730175018311e-01 + <_> + + 0 -1 4642 -5.0386278890073299e-03 + + -1.3995400071144104e-01 4.0854398161172867e-02 + <_> + + 0 -1 4643 3.7261120975017548e-02 + + -1.6399189829826355e-02 2.3627850413322449e-01 + <_> + + 0 -1 4644 -1.7991460859775543e-02 + + -5.6703627109527588e-01 1.0185079649090767e-02 + <_> + + 0 -1 4645 1.0748039931058884e-01 + + 1.8287489656358957e-03 -7.8705781698226929e-01 + <_> + + 0 -1 4646 -2.1439619362354279e-02 + + 1.8347090482711792e-01 -3.2410789281129837e-02 + <_> + + 0 -1 4647 6.8095367169007659e-04 + + 4.1675068438053131e-02 -8.9301638305187225e-02 + <_> + + 0 -1 4648 -6.8581351079046726e-03 + + -1.4511869847774506e-01 5.1585499197244644e-02 + <_> + + 0 -1 4649 1.5318280458450317e-01 + + 3.1881679315119982e-03 -4.4190090894699097e-01 + <_> + + 0 -1 4650 2.2777369245886803e-02 + + -4.3234121054410934e-02 1.7477220296859741e-01 + <_> + + 0 -1 4651 6.6160550341010094e-03 + + 4.3140821158885956e-02 -1.7188510298728943e-01 + <_> + + 0 -1 4652 -8.8224448263645172e-03 + + 1.3203169405460358e-01 -4.7509200870990753e-02 + <_> + + 0 -1 4653 -5.1209977827966213e-03 + + -1.8979160487651825e-01 5.7657308876514435e-02 + <_> + + 0 -1 4654 -1.0311880148947239e-02 + + 3.2286819815635681e-01 -1.9725019112229347e-02 + <_> + + 0 -1 4655 -2.5065759196877480e-02 + + -3.6572399735450745e-01 1.8344869837164879e-02 + <_> + + 0 -1 4656 -1.4318429864943027e-02 + + 1.5795469284057617e-01 -3.8276918232440948e-02 + <_> + + 0 -1 4657 -5.7383939623832703e-02 + + -3.6835289001464844e-01 1.6900209710001945e-02 + <_> + + 0 -1 4658 -4.3680299073457718e-02 + + 4.4766798615455627e-01 -1.3710459694266319e-02 + <_> + + 0 -1 4659 -2.4289099872112274e-01 + + -7.5490927696228027e-01 8.9195184409618378e-03 + <_> + + 0 -1 4660 3.8089449517428875e-03 + + -6.2916718423366547e-02 9.4282902777194977e-02 + <_> + + 0 -1 4661 8.9389752247370780e-05 + + -1.1253400146961212e-01 9.9447913467884064e-02 + <_> + + 0 -1 4662 2.7378369122743607e-03 + + 7.4880510568618774e-02 -9.9257610738277435e-02 + <_> + + 0 -1 4663 2.3680560290813446e-02 + + 1.2105870060622692e-02 -1.1780750006437302e-01 + <_> + + 0 -1 4664 -4.6060070395469666e-02 + + 3.9799740910530090e-01 -1.7129369080066681e-02 + <_> + + 0 -1 4665 2.1130219101905823e-03 + + -6.0906849801540375e-02 4.9974281340837479e-02 + <_> + + 0 -1 4666 1.4753149822354317e-02 + + 1.6629729419946671e-02 -3.7806668877601624e-01 + <_> + + 0 -1 4667 3.5430908203125000e-02 + + -2.3844370618462563e-02 2.6354551315307617e-01 + <_> + + 0 -1 4668 -5.0745099782943726e-02 + + -2.3141309618949890e-01 2.8320349752902985e-02 + <_> + + 0 -1 4669 8.9874058961868286e-02 + + -1.0191249661147594e-02 2.6277700066566467e-01 + <_> + + 0 -1 4670 -2.7411670889705420e-03 + + -1.3828440010547638e-01 4.6966280788183212e-02 + <_> + + 0 -1 4671 8.7385937571525574e-02 + + 1.7351199639961123e-03 -8.0810409784317017e-01 + <_> + + 0 -1 4672 -2.9055110644549131e-03 + + 6.6193267703056335e-02 -9.5981188118457794e-02 + <_> + + 0 -1 4673 -5.1255577802658081e-01 + + -1. 8.6886010831221938e-04 + <_> + + 0 -1 4674 -1.3281259685754776e-02 + + 1.0134270042181015e-01 -6.4344279468059540e-02 + <_> + + 0 -1 4675 5.3660940378904343e-02 + + 3.2843649387359619e-03 -8.0011987686157227e-01 + <_> + + 0 -1 4676 3.9290629327297211e-02 + + 9.0429633855819702e-03 -6.7074328660964966e-01 + <_> + + 0 -1 4677 6.5197132527828217e-02 + + 4.4964649714529514e-03 -9.7931307554244995e-01 + <_> + + 0 -1 4678 3.2505281269550323e-02 + + -1.2679249979555607e-02 4.9774479866027832e-01 + <_> + + 0 -1 4679 -6.5749078989028931e-02 + + -3.7844368815422058e-01 5.9391320683062077e-03 + <_> + + 0 -1 4680 -6.0045070946216583e-02 + + -3.9957770705223083e-01 1.4155699871480465e-02 + <_> + + 0 -1 4681 -4.6631351113319397e-02 + + 1.6843810677528381e-01 -3.7634961307048798e-02 + <_> + + 0 -1 4682 1.8095660198014230e-04 + + -1.0198330134153366e-01 7.2940513491630554e-02 + <_> + + 0 -1 4683 -3.7607289850711823e-03 + + 4.5154098421335220e-02 -5.4370220750570297e-02 + <_> + + 0 -1 4684 -5.0964287947863340e-04 + + 1.6106060147285461e-01 -5.4398071020841599e-02 + <_> + + 0 -1 4685 -1.6095000319182873e-03 + + -2.1058610081672668e-01 3.0864259228110313e-02 + <_> + + 0 -1 4686 -5.4673491977155209e-03 + + 1.9076080620288849e-01 -3.2738618552684784e-02 + <_> + + 0 -1 4687 4.1697090491652489e-03 + + 2.0009849220514297e-02 -6.8173840641975403e-02 + <_> + + 0 -1 4688 3.2709140796214342e-03 + + -1.1110019683837891e-01 5.8211889117956161e-02 + <_> + + 0 -1 4689 -5.1663857884705067e-03 + + -8.5210792720317841e-02 3.3905100077390671e-02 + <_> + + 0 -1 4690 -1.2914719991385937e-02 + + -1.3726939260959625e-01 4.8348769545555115e-02 + <_> + + 0 -1 4691 -3.8130749017000198e-03 + + -1.1084940284490585e-01 3.2373629510402679e-02 + <_> + + 0 -1 4692 -5.7762481272220612e-02 + + 2.1701450645923615e-01 -2.9828049242496490e-02 + <_> + + 0 -1 4693 -2.2619909141212702e-03 + + 3.5641018301248550e-02 -5.5289078503847122e-02 + <_> + + 0 -1 4694 5.2979849278926849e-02 + + 7.7050398103892803e-03 -7.2121208906173706e-01 + <_> + + 0 -1 4695 -3.3839911222457886e-01 + + -9.4540262222290039e-01 4.5049181208014488e-03 + <_> + + 0 -1 4696 5.2918092114850879e-04 + + 4.1633930057287216e-02 -1.3283179700374603e-01 + <_> + + 0 -1 4697 2.8239609673619270e-03 + + 1.3815909624099731e-01 -1.1371930129826069e-02 + <_> + + 0 -1 4698 -2.1569489035755396e-03 + + 6.3553653657436371e-02 -8.4683336317539215e-02 + <_> + + 0 -1 4699 4.1426848620176315e-03 + + 4.1431330144405365e-02 -9.1413199901580811e-02 + <_> + + 0 -1 4700 -1.1016559787094593e-02 + + 8.0382406711578369e-02 -8.3978570997714996e-02 + <_> + + 0 -1 4701 -6.5561989322304726e-03 + + -1.3563759624958038e-01 3.4514341503381729e-02 + <_> + + 0 -1 4702 -2.2384698968380690e-03 + + -1.2900340557098389e-01 6.0718830674886703e-02 + <_> + + 0 -1 4703 -1.2789719738066196e-02 + + 2.6254388689994812e-01 -2.5295289233326912e-02 + <_> + + 0 -1 4704 -1.1028759926557541e-01 + + -4.0324538946151733e-01 1.3996849767863750e-02 + <_> + + 0 -1 4705 2.9025289695709944e-03 + + -6.0133900493383408e-02 4.0657509118318558e-02 + <_> + + 0 -1 4706 1.3041580095887184e-03 + + -1.1271840333938599e-01 5.3001549094915390e-02 + <_> + + 0 -1 4707 4.8518911004066467e-02 + + 9.9352700635790825e-03 -3.3844459056854248e-01 + <_> + + 0 -1 4708 -5.0848070532083511e-03 + + -1.3072639703750610e-01 4.7106929123401642e-02 + <_> + + 0 -1 4709 5.7023460976779461e-03 + + -5.2840489894151688e-02 1.2418749928474426e-01 + <_> + + 0 -1 4710 -2.7858179528266191e-03 + + -9.6685640513896942e-02 6.6828437149524689e-02 + <_> + + 0 -1 4711 -3.0082210432738066e-03 + + 7.1778140962123871e-02 -3.8511540740728378e-02 + <_> + + 0 -1 4712 6.9350451231002808e-03 + + -5.7932149618864059e-02 1.0691670328378677e-01 + <_> + + 0 -1 4713 -4.7064341604709625e-02 + + 1.0284499824047089e-01 -2.7998289093375206e-02 + <_> + + 0 -1 4714 -8.2645736634731293e-02 + + -8.5849452018737793e-01 6.3560227863490582e-03 + <_> + + 0 -1 4715 8.9476434513926506e-03 + + -3.9904471486806870e-02 6.6897280514240265e-02 + <_> + + 0 -1 4716 3.0593979358673096e-01 + + 7.2277039289474487e-03 -7.9749721288681030e-01 + <_> + + 0 -1 4717 -5.8336472138762474e-03 + + -1.9526490569114685e-01 2.4196550250053406e-02 + <_> + + 0 -1 4718 -5.3784619085490704e-03 + + 7.1967631578445435e-02 -9.1547563672065735e-02 + <_> + + 0 -1 4719 9.2504899948835373e-03 + + 3.6146361380815506e-02 -7.4494920670986176e-02 + <_> + + 0 -1 4720 3.7581291049718857e-02 + + -2.0222729071974754e-02 3.3224269747734070e-01 + <_> + + 0 -1 4721 -4.6818740665912628e-02 + + -5.0513672828674316e-01 1.2870309874415398e-02 + <_> + + 0 -1 4722 3.3507939428091049e-02 + + -1.8688799813389778e-02 3.0542388558387756e-01 + <_> + + 0 -1 4723 6.8437248468399048e-02 + + -6.2482542125508189e-04 8.3963787555694580e-01 + <_> + + 0 -1 4724 1.0151940397918224e-02 + + 2.5653729215264320e-02 -2.1830080449581146e-01 + <_> + + 0 -1 4725 -1.3866250216960907e-01 + + 5.7341670989990234e-01 -6.0921781696379185e-03 + <_> + + 0 -1 4726 -1.1214310070499778e-03 + + 7.0692487061023712e-02 -8.2995750010013580e-02 + <_> + + 0 -1 4727 1.4782310463488102e-03 + + -3.5161279141902924e-02 5.8569159358739853e-02 + <_> + + 0 -1 4728 -2.3407500702887774e-03 + + 1.2667399644851685e-01 -7.7700607478618622e-02 + <_> + + 0 -1 4729 4.3265568092465401e-03 + + 3.1229879707098007e-02 -1.1680649966001511e-01 + <_> + + 0 -1 4730 -3.2252248376607895e-02 + + -5.4395800828933716e-01 1.0386509820818901e-02 + <_> + + 0 -1 4731 -7.1836792631074786e-04 + + -6.3850082457065582e-02 4.8989679664373398e-02 + <_> + + 0 -1 4732 1.1035969946533442e-03 + + -7.1095839142799377e-02 8.3087973296642303e-02 + <_> + + 0 -1 4733 -1.0265519842505455e-02 + + 1.1647050082683563e-01 -2.8178630396723747e-02 + <_> + + 0 -1 4734 7.2632037103176117e-02 + + 7.5578331016004086e-03 -7.1635490655899048e-01 + <_> + + 0 -1 4735 1.2232369929552078e-01 + + -3.9898478426039219e-03 6.0708892345428467e-01 + <_> + + 0 -1 4736 -1.4398260414600372e-01 + + 8.5836321115493774e-01 -5.8769038878381252e-03 + <_> + + 0 -1 4737 5.9525449760258198e-03 + + 2.1712759509682655e-02 -1.5896700322628021e-01 + <_> + + 0 -1 4738 -1.3158279471099377e-03 + + 8.3239771425724030e-02 -7.1944266557693481e-02 + <_> + + 0 -1 4739 -3.5782668739557266e-02 + + -3.1888490915298462e-01 6.7262151278555393e-03 + <_> + + 0 -1 4740 1.4122560387477279e-03 + + -6.9247573614120483e-02 8.8037729263305664e-02 + <_> + + 0 -1 4741 -1.6188029199838638e-02 + + -6.0439001768827438e-02 6.7530423402786255e-02 + <_> + + 0 -1 4742 -2.8433150146156549e-03 + + 6.4466439187526703e-02 -1.0504409670829773e-01 + <_> + + 0 -1 4743 -1.5944750048220158e-03 + + -5.1919359713792801e-02 5.3710401058197021e-02 + <_> + + 0 -1 4744 1.8808269500732422e-01 + + -8.1325937062501907e-03 7.0354807376861572e-01 + <_> + + 0 -1 4745 -3.3552229404449463e-02 + + -3.1318250298500061e-01 2.4297190830111504e-02 + <_> + + 0 -1 4746 -1.5341060236096382e-02 + + 2.3687170445919037e-01 -2.8020450845360756e-02 + <_> + + 0 -1 4747 -1.3534810394048691e-02 + + -3.1544640660285950e-01 2.3011740297079086e-02 + <_> + + 0 -1 4748 3.2969659660011530e-03 + + 3.2923359423875809e-02 -1.5933570265769958e-01 + <_> + + 0 -1 4749 -4.4846888631582260e-02 + + 1.2876190245151520e-01 -1.7795780673623085e-02 + <_> + + 0 -1 4750 5.1291137933731079e-03 + + 3.2709009945392609e-02 -1.7871360480785370e-01 + <_> + + 0 -1 4751 1.1287770466879010e-03 + + -7.6234400272369385e-02 7.1267232298851013e-02 + <_> + + 0 -1 4752 1.2759109959006310e-02 + + -5.1268041133880615e-02 1.2901780009269714e-01 + <_> + + 0 -1 4753 5.3586461581289768e-04 + + 6.6144347190856934e-02 -6.8021528422832489e-02 + <_> + + 0 -1 4754 5.8012880617752671e-04 + + 7.5946256518363953e-02 -7.2426833212375641e-02 + <_> + + 0 -1 4755 9.8113536834716797e-02 + + 4.4115697965025902e-03 -5.7646822929382324e-01 + <_> + + 0 -1 4756 3.2547891139984131e-01 + + -2.8849789872765541e-02 2.3245050013065338e-01 + <_> + + 0 -1 4757 1.6109529882669449e-02 + + 2.6149509474635124e-02 -2.2507910430431366e-01 + <_> + + 0 -1 4758 1.6630800440907478e-02 + + -5.6001648306846619e-02 1.0011140257120132e-01 + <_> + + 0 -1 4759 1.2567469850182533e-02 + + 1.1760590225458145e-01 -2.5833690539002419e-02 + <_> + + 0 -1 4760 2.4531960487365723e-02 + + 2.1979559212923050e-02 -2.4158330261707306e-01 + <_> + + 0 -1 4761 5.1343659870326519e-03 + + -1.3964179903268814e-02 1.0398290306329727e-01 + <_> + + 0 -1 4762 -1.1144300224259496e-03 + + -8.1608608365058899e-02 6.4991973340511322e-02 + <_> + + 0 -1 4763 -6.8641006946563721e-02 + + 3.7113350629806519e-01 -1.7774619162082672e-02 + <_> + + 0 -1 4764 8.8211498223245144e-04 + + -8.4080681204795837e-02 6.2524639070034027e-02 + <_> + + 0 -1 4765 1.0471940040588379e-03 + + 6.9488562643527985e-02 -8.3000160753726959e-02 + <_> + + 0 -1 4766 1.6197249293327332e-02 + + 1.6007730737328529e-02 -3.4216699004173279e-01 + <_> + + 0 -1 4767 -2.2690620273351669e-02 + + 1.3959160447120667e-01 -4.2305570095777512e-02 + <_> + + 0 -1 4768 -4.1030000895261765e-02 + + -3.4669420123100281e-01 1.7233539372682571e-02 + <_> + + 0 -1 4769 8.5194930434226990e-02 + + -8.8493460789322853e-03 6.0639351606369019e-01 + <_> + + 0 -1 4770 3.9775099605321884e-02 + + 6.5457229502499104e-03 -9.3794268369674683e-01 + <_> + + 0 -1 4771 -1.8673250451683998e-02 + + 8.4701649844646454e-02 -2.1742990240454674e-02 + <_> + + 0 -1 4772 -1.1632209643721581e-02 + + -1.6503639519214630e-01 3.2852791249752045e-02 + <_> + + 0 -1 4773 -2.1068679634481668e-03 + + 2.5774169713258743e-02 -1.0540559887886047e-01 + <_> + + 0 -1 4774 -1.0474229929968715e-03 + + 5.3470570594072342e-02 -1.0844449698925018e-01 + <_> + + 0 -1 4775 6.6169992089271545e-02 + + 2.6304489001631737e-03 -4.3908849358558655e-01 + <_> + + 0 -1 4776 -1.2816500384360552e-03 + + -8.8744208216667175e-02 6.7286081612110138e-02 + <_> + + 0 -1 4777 -1.2601809576153755e-02 + + 2.3047180473804474e-01 -1.4204639941453934e-02 + <_> + + 0 -1 4778 3.1882619950920343e-03 + + -6.0790609568357468e-02 9.3256607651710510e-02 + <_> + + 0 -1 4779 -4.4821877963840961e-03 + + -7.4911139905452728e-02 3.5563640296459198e-02 + <_> + + 0 -1 4780 1.3803370529785752e-03 + + -6.5355330705642700e-02 8.9660577476024628e-02 + <_> + + 0 -1 4781 9.3855522572994232e-03 + + 2.2601179778575897e-02 -1.6038919985294342e-01 + <_> + + 0 -1 4782 -3.3057469408959150e-03 + + -9.3390651047229767e-02 5.6599788367748260e-02 + <_> + + 0 -1 4783 -1.4823249541223049e-02 + + 6.3946582376956940e-02 -3.7617258727550507e-02 + <_> + + 0 -1 4784 -2.4304309859871864e-02 + + 1.1825300008058548e-01 -5.3607080131769180e-02 + <_> + + 0 -1 4785 -2.6398031041026115e-03 + + -7.8462429344654083e-02 4.7125939279794693e-02 + <_> + + 0 -1 4786 -6.6844499669969082e-03 + + -1.4298090338706970e-01 5.4876580834388733e-02 + <_> + + 0 -1 4787 -1.8713249592110515e-03 + + 6.5964557230472565e-02 -5.9726029634475708e-02 + <_> + + 0 -1 4788 -5.0526339560747147e-02 + + 5.2933692932128906e-01 -1.0625099763274193e-02 + <_> + + 0 -1 4789 -7.1036286652088165e-02 + + -3.3027708530426025e-01 5.6759058497846127e-03 + <_> + + 0 -1 4790 -5.4212540388107300e-02 + + 3.7536340951919556e-01 -1.6479549929499626e-02 + <_> + + 0 -1 4791 1.4903850387781858e-04 + + -5.2896250039339066e-02 1.0646480321884155e-01 + <_> + + 0 -1 4792 1.0254220105707645e-03 + + -5.1714900881052017e-02 1.0771189630031586e-01 + <_> + + 0 -1 4793 7.6022921130061150e-03 + + 2.4376839399337769e-02 -1.2493179738521576e-01 + <_> + + 0 -1 4794 6.8572920281440020e-04 + + 7.1341581642627716e-02 -7.6490812003612518e-02 + <_> + + 0 -1 4795 -1.3697240501642227e-03 + + -1.5173940360546112e-01 3.9827719330787659e-02 + <_> + + 0 -1 4796 -2.4336120113730431e-03 + + 6.5315209329128265e-02 -7.9230897128582001e-02 + <_> + + 0 -1 4797 -1.4390869997441769e-02 + + -2.3706260323524475e-01 1.6740530729293823e-02 + <_> + + 0 -1 4798 7.8907981514930725e-02 + + -4.2810469865798950e-02 1.4248989522457123e-01 + <_> + + 0 -1 4799 1.0681129992008209e-01 + + 3.4115819726139307e-03 -7.7656471729278564e-01 + <_> + + 0 -1 4800 5.1377359777688980e-02 + + 1.0703410021960735e-02 -5.3400570154190063e-01 + <_> + + 0 -1 4801 -8.6883217096328735e-02 + + 1. -3.0740019865334034e-03 + <_> + + 0 -1 4802 -2.4080339353531599e-03 + + -1.0685530304908752e-01 4.9721568822860718e-02 + <_> + + 0 -1 4803 -1.5590289607644081e-02 + + 1.0636159777641296e-01 -2.4414319545030594e-02 + <_> + + 0 -1 4804 2.3770150728523731e-03 + + 3.9840381592512131e-02 -1.4689840376377106e-01 + <_> + + 0 -1 4805 -9.0648621320724487e-02 + + 1.8861660361289978e-01 -1.2951680459082127e-02 + <_> + + 0 -1 4806 4.4955732300877571e-03 + + -2.6563400402665138e-02 2.3943750560283661e-01 + <_> + + 0 -1 4807 -6.4725756645202637e-02 + + -5.4622077941894531e-01 9.2595359310507774e-03 + <_> + + 0 -1 4808 2.1703580394387245e-02 + + -8.8741881772875786e-03 6.4019817113876343e-01 + <_> + + 0 -1 4809 6.1110239475965500e-02 + + 9.5075201243162155e-03 -4.3702909350395203e-01 + <_> + + 0 -1 4810 2.0086880773305893e-02 + + 2.2985199466347694e-02 -2.2840890288352966e-01 + <_> + + 0 -1 4811 4.1216641664505005e-02 + + -1.4420590363442898e-02 1.3452969491481781e-01 + <_> + + 0 -1 4812 -2.3712279275059700e-02 + + -2.9533639550209045e-01 1.8435720354318619e-02 + <_> + + 0 -1 4813 -6.8324371241033077e-03 + + 1.2094250321388245e-01 -4.3016240000724792e-02 + <_> + + 0 -1 4814 1.0880210250616074e-01 + + -1.0228149592876434e-02 5.2824842929840088e-01 + <_> + + 0 -1 4815 9.8231732845306396e-03 + + 4.1886411607265472e-02 -1.3665479421615601e-01 + <_> + + 0 -1 4816 -1.5005770139396191e-02 + + 1.8148930370807648e-01 -3.0691139400005341e-02 + <_> + + 0 -1 4817 -4.4110611081123352e-01 + + -1. 1.4937899541109800e-03 + <_> + + 0 -1 4818 -3.4122800827026367e-01 + + -4.9184858798980713e-01 1.0096929967403412e-02 + <_> + + 0 -1 4819 9.3225948512554169e-03 + + -2.2894829511642456e-02 7.0796586573123932e-02 + <_> + + 0 -1 4820 7.3594371788203716e-03 + + 1.3842869549989700e-02 -3.6142700910568237e-01 + <_> + + 0 -1 4821 -8.4109082818031311e-02 + + -6.2284982204437256e-01 7.3129259981215000e-03 + <_> + + 0 -1 4822 1.0704870335757732e-02 + + -4.2617131024599075e-02 1.1360719799995422e-01 + <_> + + 0 -1 4823 1.1478140018880367e-02 + + 3.6586448550224304e-02 -9.6474952995777130e-02 + <_> + + 0 -1 4824 1.6416399739682674e-03 + + -9.8777309060096741e-02 5.5158369243144989e-02 + <_> + + 0 -1 4825 -1.5731199528090656e-04 + + -6.1207920312881470e-02 5.6053601205348969e-02 + <_> + + 0 -1 4826 4.1953278705477715e-03 + + 5.0657391548156738e-02 -1.0238680243492126e-01 + <_> + + 0 -1 4827 -1.6238249838352203e-02 + + 1.1267519742250443e-01 -1.3786830008029938e-02 + <_> + + 0 -1 4828 3.2428819686174393e-02 + + -2.5513019412755966e-02 2.3171940445899963e-01 + <_> + + 0 -1 4829 -8.3901472389698029e-03 + + -6.2842369079589844e-02 2.3776959627866745e-02 + <_> + + 0 -1 4830 4.9057020805776119e-03 + + 5.7676758617162704e-02 -1.2715479731559753e-01 + <_> + + 0 -1 4831 1.4458860270678997e-02 + + -5.0932768732309341e-02 6.2239319086074829e-02 + <_> + + 0 -1 4832 1.2484519928693771e-01 + + -1.1612229980528355e-02 4.9361020326614380e-01 + <_> + + 0 -1 4833 4.8587709665298462e-01 + + 4.8130601644515991e-03 -5.5395811796188354e-01 + <_> + + 0 -1 4834 1.6886210441589355e-01 + + 7.8053288161754608e-03 -7.3394978046417236e-01 + <_> + + 0 -1 4835 -2.1220340568106622e-04 + + 3.1656648963689804e-02 -1.0314700007438660e-01 + <_> + + 0 -1 4836 1.9249629694968462e-03 + + 5.5135779082775116e-02 -1.0309369862079620e-01 + <_> + + 0 -1 4837 -2.8178339824080467e-02 + + 1.1637330055236816e-01 -3.4630060195922852e-02 + <_> + + 0 -1 4838 -1.4069500379264355e-02 + + -1.4737719297409058e-01 4.4723790138959885e-02 + <_> + + 0 -1 4839 -1.2483589816838503e-03 + + -1.1185120046138763e-01 6.8806178867816925e-02 + <_> + + 0 -1 4840 5.3278112318366766e-04 + + -9.3908883631229401e-02 6.7072838544845581e-02 + <_> + + 0 -1 4841 1.1722769588232040e-02 + + -1.9012469798326492e-02 1.8834389746189117e-01 + <_> + 249 + -1.4526200294494629e+00 + + <_> + + 0 -1 4842 5.8254651725292206e-02 + + -2.3232789337635040e-01 2.1454159915447235e-01 + <_> + + 0 -1 4843 3.4433450549840927e-02 + + -2.6520681381225586e-01 1.3274359703063965e-01 + <_> + + 0 -1 4844 1.4937009662389755e-02 + + -2.3927900195121765e-01 1.5786519646644592e-01 + <_> + + 0 -1 4845 3.1153639778494835e-02 + + -1.5004000067710876e-01 1.6116039454936981e-01 + <_> + + 0 -1 4846 2.6988480240106583e-03 + + -2.3409889638423920e-01 9.9983781576156616e-02 + <_> + + 0 -1 4847 9.2046073405072093e-05 + + -2.9268169403076172e-01 4.7872740775346756e-02 + <_> + + 0 -1 4848 5.0020251364912838e-05 + + -3.6815708875656128e-01 5.8189608156681061e-02 + <_> + + 0 -1 4849 -1.4902159571647644e-02 + + -3.8818851113319397e-01 2.6158519089221954e-02 + <_> + + 0 -1 4850 2.0448720082640648e-02 + + 6.0846891254186630e-02 -3.0645281076431274e-01 + <_> + + 0 -1 4851 6.2656581576447934e-05 + + -1.7161040008068085e-01 1.0800299793481827e-01 + <_> + + 0 -1 4852 -7.0627559907734394e-03 + + -2.3428949713706970e-01 7.6327130198478699e-02 + <_> + + 0 -1 4853 -2.9078179504722357e-03 + + -2.1010600030422211e-01 7.8605473041534424e-02 + <_> + + 0 -1 4854 -3.6554310470819473e-02 + + 1.7013889551162720e-01 -1.2837870419025421e-01 + <_> + + 0 -1 4855 -1.3991629704833031e-02 + + -1.5198560059070587e-01 3.1168300658464432e-02 + <_> + + 0 -1 4856 7.4681073427200317e-02 + + 3.6079999059438705e-02 -4.6322378516197205e-01 + <_> + + 0 -1 4857 -1.0407929867506027e-01 + + -3.1802299618721008e-01 2.0612560212612152e-02 + <_> + + 0 -1 4858 1.2444700114428997e-02 + + 7.7818617224693298e-02 -1.6825589537620544e-01 + <_> + + 0 -1 4859 3.4679330885410309e-02 + + 3.2584380358457565e-02 -2.6884159445762634e-01 + <_> + + 0 -1 4860 -2.9028469696640968e-02 + + -4.4522678852081299e-01 2.9661040753126144e-02 + <_> + + 0 -1 4861 2.3345749650616199e-04 + + -1.3071049749851227e-01 6.1756659299135208e-02 + <_> + + 0 -1 4862 3.6993178725242615e-01 + + 1.7400909215211868e-02 -7.0418548583984375e-01 + <_> + + 0 -1 4863 -2.1505730226635933e-02 + + -2.4095299839973450e-01 2.8891649097204208e-02 + <_> + + 0 -1 4864 5.4181810468435287e-02 + + -8.4053620696067810e-02 1.3876989483833313e-01 + <_> + + 0 -1 4865 -3.2677378505468369e-02 + + -2.9904881119728088e-01 2.8195250779390335e-02 + <_> + + 0 -1 4866 1.1804300360381603e-02 + + 4.9124121665954590e-02 -2.5538289546966553e-01 + <_> + + 0 -1 4867 -9.5703108236193657e-03 + + 1.1865220218896866e-01 -7.9305157065391541e-02 + <_> + + 0 -1 4868 -8.5534068057313561e-04 + + -9.0315766632556915e-02 1.2984269857406616e-01 + <_> + + 0 -1 4869 7.1445330977439880e-02 + + 1.4396210201084614e-02 -5.3161299228668213e-01 + <_> + + 0 -1 4870 6.1263251118361950e-03 + + -2.4559390544891357e-01 4.8353280872106552e-02 + <_> + + 0 -1 4871 -4.8277149908244610e-03 + + -2.3828850686550140e-01 7.5664043426513672e-02 + <_> + + 0 -1 4872 -2.6015359908342361e-03 + + 4.5826680958271027e-02 -2.4928370118141174e-01 + <_> + + 0 -1 4873 -4.7515620826743543e-04 + + 3.8604840636253357e-02 -1.3118830323219299e-01 + <_> + + 0 -1 4874 -5.4591469466686249e-02 + + 5.5260437726974487e-01 -1.9622489809989929e-02 + <_> + + 0 -1 4875 5.3931411355733871e-02 + + -4.8285599797964096e-02 2.2110609710216522e-01 + <_> + + 0 -1 4876 -9.1672148555517197e-03 + + -2.5744551420211792e-01 4.0833171457052231e-02 + <_> + + 0 -1 4877 -2.9818129260092974e-03 + + -7.5891457498073578e-02 6.0899209231138229e-02 + <_> + + 0 -1 4878 7.4697382748126984e-02 + + 3.6657888442277908e-02 -2.6946181058883667e-01 + <_> + + 0 -1 4879 -2.7006270363926888e-02 + + 1.8391659855842590e-01 -5.5832479149103165e-02 + <_> + + 0 -1 4880 -6.0810879804193974e-03 + + -3.2777228951454163e-01 3.5269659012556076e-02 + <_> + + 0 -1 4881 3.8182068616151810e-02 + + -5.6075371801853180e-02 2.1839509904384613e-01 + <_> + + 0 -1 4882 9.5723047852516174e-03 + + 8.4293976426124573e-02 -1.1767770349979401e-01 + <_> + + 0 -1 4883 7.8028216958045959e-02 + + 5.6959469802677631e-03 -8.1442731618881226e-01 + <_> + + 0 -1 4884 -3.2862029969692230e-02 + + -4.7212830185890198e-01 1.9418969750404358e-02 + <_> + + 0 -1 4885 4.2359679937362671e-02 + + -1.7929280176758766e-02 3.1368249654769897e-01 + <_> + + 0 -1 4886 -2.1030420437455177e-02 + + 1.4199249446392059e-01 -6.7171506583690643e-02 + <_> + + 0 -1 4887 -4.6487968415021896e-02 + + -3.0455109477043152e-01 3.1824499368667603e-02 + <_> + + 0 -1 4888 -8.5280627012252808e-02 + + 2.4725529551506042e-01 -4.0726520121097565e-02 + <_> + + 0 -1 4889 4.7598700039088726e-03 + + -6.4076490700244904e-02 1.0103560239076614e-01 + <_> + + 0 -1 4890 6.0733199119567871e-02 + + -8.8772647082805634e-02 1.1654719710350037e-01 + <_> + + 0 -1 4891 5.4770488291978836e-02 + + 2.2390449419617653e-02 -4.9855118989944458e-01 + <_> + + 0 -1 4892 -3.7478970625670627e-05 + + 6.2433928251266479e-02 -1.6515359282493591e-01 + <_> + + 0 -1 4893 -2.3898750543594360e-02 + + -1.9021050631999969e-01 1.4979549683630466e-02 + <_> + + 0 -1 4894 -1.8465859815478325e-02 + + 2.3008669912815094e-01 -4.5363288372755051e-02 + <_> + + 0 -1 4895 -3.8619639817625284e-03 + + -1.1168369650840759e-01 7.9550966620445251e-02 + <_> + + 0 -1 4896 6.0682989656925201e-02 + + 2.5401040911674500e-02 -4.1787821054458618e-01 + <_> + + 0 -1 4897 -6.1235381290316582e-03 + + -2.4201570451259613e-01 1.9984690472483635e-02 + <_> + + 0 -1 4898 -2.7558460831642151e-02 + + -4.5678210258483887e-01 2.0328069105744362e-02 + <_> + + 0 -1 4899 2.4938629940152168e-02 + + -3.8399018347263336e-02 1.3205289840698242e-01 + <_> + + 0 -1 4900 -4.7081429511308670e-02 + + 3.1839731335639954e-01 -3.2127480953931808e-02 + <_> + + 0 -1 4901 6.2321990728378296e-02 + + 1.7846960574388504e-02 -5.0114768743515015e-01 + <_> + + 0 -1 4902 -5.5789871839806437e-04 + + 1.0673029720783234e-01 -9.0454310178756714e-02 + <_> + + 0 -1 4903 -2.0528730005025864e-02 + + 2.2777000069618225e-01 -4.6683758497238159e-02 + <_> + + 0 -1 4904 1.4043749542906880e-03 + + -2.0688509941101074e-01 6.7320853471755981e-02 + <_> + + 0 -1 4905 3.1474549323320389e-02 + + 2.5873050093650818e-02 -3.1385809183120728e-01 + <_> + + 0 -1 4906 -3.1364340335130692e-02 + + -3.5079669952392578e-01 2.4890480563044548e-02 + <_> + + 0 -1 4907 -1.0076019912958145e-01 + + -2.2738389670848846e-01 1.0731879621744156e-02 + <_> + + 0 -1 4908 1.4409960247576237e-02 + + 2.4001860618591309e-01 -3.8389049470424652e-02 + <_> + + 0 -1 4909 5.6410171091556549e-02 + + -4.0667269378900528e-02 1.9880810379981995e-01 + <_> + + 0 -1 4910 -1.4310100115835667e-02 + + -2.2484239935874939e-01 5.1415968686342239e-02 + <_> + + 0 -1 4911 3.8093481212854385e-02 + + 1.0602000169456005e-02 -6.5031349658966064e-01 + <_> + + 0 -1 4912 7.3483381420373917e-03 + + 3.7624299526214600e-02 -2.3660179972648621e-01 + <_> + + 0 -1 4913 1.5990389883518219e-01 + + -3.1958691775798798e-02 7.8257188200950623e-02 + <_> + + 0 -1 4914 7.5298376381397247e-02 + + -2.2225739434361458e-02 4.7734829783439636e-01 + <_> + + 0 -1 4915 1.0515630245208740e-02 + + 2.4979539215564728e-02 -4.3517309427261353e-01 + <_> + + 0 -1 4916 1.1720249801874161e-01 + + -3.7235978990793228e-02 2.6529499888420105e-01 + <_> + + 0 -1 4917 1.5799700122443028e-05 + + -1.0837449878454208e-01 7.2809703648090363e-02 + <_> + + 0 -1 4918 1.2115119956433773e-02 + + 6.5032199025154114e-02 -1.4378160238265991e-01 + <_> + + 0 -1 4919 -1.7766270786523819e-02 + + 1.0095430165529251e-01 -2.4499140679836273e-02 + <_> + + 0 -1 4920 4.2227920144796371e-02 + + -3.6625079810619354e-02 2.8341490030288696e-01 + <_> + + 0 -1 4921 2.4346679449081421e-02 + + 2.4560010060667992e-02 -1.9787840545177460e-01 + <_> + + 0 -1 4922 3.1748838722705841e-02 + + 2.9603859409689903e-02 -3.0412709712982178e-01 + <_> + + 0 -1 4923 -5.2616238594055176e-02 + + 1.7751359939575195e-01 -3.1825721263885498e-02 + <_> + + 0 -1 4924 -5.4358910769224167e-02 + + 2.2886650264263153e-01 -4.0221411734819412e-02 + <_> + + 0 -1 4925 1.1845750268548727e-03 + + 6.1528120189905167e-02 -1.2204740196466446e-01 + <_> + + 0 -1 4926 -3.6325298249721527e-02 + + -2.9528170824050903e-01 3.3452831208705902e-02 + <_> + + 0 -1 4927 1.5100809931755066e-01 + + -2.5661900639533997e-02 3.8788089156150818e-01 + <_> + + 0 -1 4928 2.8278939425945282e-02 + + -3.5951491445302963e-02 2.5251358747482300e-01 + <_> + + 0 -1 4929 -8.3803251385688782e-02 + + -7.2599482536315918e-01 4.1993269696831703e-03 + <_> + + 0 -1 4930 -2.9865629039704800e-04 + + 5.5302988737821579e-02 -1.6678869724273682e-01 + <_> + + 0 -1 4931 -1.6872739419341087e-02 + + -1.9040539860725403e-01 5.2307758480310440e-02 + <_> + + 0 -1 4932 -5.9451311826705933e-02 + + -4.7634351253509521e-01 2.0981209352612495e-02 + <_> + + 0 -1 4933 -1.8378829583525658e-02 + + 6.6858462989330292e-02 -6.0389090329408646e-02 + <_> + + 0 -1 4934 4.8198848962783813e-02 + + 4.2580351233482361e-02 -2.6010730862617493e-01 + <_> + + 0 -1 4935 -4.3217130005359650e-02 + + -2.5067010521888733e-01 1.7225300893187523e-02 + <_> + + 0 -1 4936 -6.3647949136793613e-03 + + -1.6788710653781891e-01 6.8857319653034210e-02 + <_> + + 0 -1 4937 2.4770569801330566e-01 + + -3.3154450356960297e-02 1.4794079959392548e-01 + <_> + + 0 -1 4938 -1.1216869950294495e-01 + + 5.1129728555679321e-01 -1.7360100522637367e-02 + <_> + + 0 -1 4939 3.6601010710000992e-02 + + -4.3869979679584503e-02 1.9755239784717560e-01 + <_> + + 0 -1 4940 -7.2332553565502167e-02 + + -8.2932412624359131e-01 1.1810120195150375e-02 + <_> + + 0 -1 4941 7.7837951481342316e-02 + + 2.4520579725503922e-02 -2.7260521054267883e-01 + <_> + + 0 -1 4942 7.2094596922397614e-02 + + 3.7606250494718552e-02 -2.7291780710220337e-01 + <_> + + 0 -1 4943 -8.7373353540897369e-02 + + -9.5344787836074829e-01 3.2734218984842300e-03 + <_> + + 0 -1 4944 -3.6240059882402420e-02 + + -3.2300001382827759e-01 2.6389310136437416e-02 + <_> + + 0 -1 4945 -8.7862694635987282e-03 + + -1.4808210730552673e-01 4.6761561185121536e-02 + <_> + + 0 -1 4946 6.5432381816208363e-03 + + 6.0071479529142380e-02 -1.5036399662494659e-01 + <_> + + 0 -1 4947 2.7910009957849979e-03 + + -7.9585656523704529e-02 6.4064942300319672e-02 + <_> + + 0 -1 4948 2.9471930116415024e-02 + + 3.6904528737068176e-02 -2.7659609913825989e-01 + <_> + + 0 -1 4949 -4.4924151152372360e-02 + + 3.5313630104064941e-01 -2.7219140902161598e-02 + <_> + + 0 -1 4950 7.8969523310661316e-02 + + 1.0873800143599510e-02 -9.3217527866363525e-01 + <_> + + 0 -1 4951 -3.1053030863404274e-02 + + 2.4087889492511749e-01 -2.7155969291925430e-02 + <_> + + 0 -1 4952 5.0429090857505798e-02 + + -5.4164800792932510e-02 2.0343920588493347e-01 + <_> + + 0 -1 4953 -3.7637658417224884e-02 + + 3.2998979091644287e-01 -3.4573089331388474e-02 + <_> + + 0 -1 4954 -1.7269999952986836e-03 + + -1.2339779734611511e-01 7.5958393514156342e-02 + <_> + + 0 -1 4955 1.2604339979588985e-02 + + 3.6150000989437103e-02 -2.1591770648956299e-01 + <_> + + 0 -1 4956 1.1010640300810337e-02 + + -1.4330290257930756e-01 6.3043266534805298e-02 + <_> + + 0 -1 4957 1.3539699837565422e-02 + + -7.8418523073196411e-02 1.8389409780502319e-01 + <_> + + 0 -1 4958 -3.8949768990278244e-02 + + 3.4183630347251892e-01 -2.9505429789423943e-02 + <_> + + 0 -1 4959 -4.9093078821897507e-02 + + -3.6278200149536133e-01 1.7093619331717491e-02 + <_> + + 0 -1 4960 4.2306110262870789e-03 + + 5.8190550655126572e-02 -1.8383790552616119e-01 + <_> + + 0 -1 4961 8.9376904070377350e-03 + + -5.1576498895883560e-02 1.9376990199089050e-01 + <_> + + 0 -1 4962 4.0846280753612518e-02 + + 1.3241729699075222e-02 -7.0892220735549927e-01 + <_> + + 0 -1 4963 -3.6945961415767670e-02 + + -3.4456318616867065e-01 7.1702878922224045e-03 + <_> + + 0 -1 4964 -1.2924180366098881e-02 + + -1.9354179501533508e-01 4.8157788813114166e-02 + <_> + + 0 -1 4965 3.3079650253057480e-02 + + -5.1704820245504379e-02 1.3492329418659210e-01 + <_> + + 0 -1 4966 2.2233519703149796e-02 + + 5.2919991314411163e-02 -1.7628639936447144e-01 + <_> + + 0 -1 4967 -1.4483500272035599e-02 + + 1.5105240046977997e-01 -3.9817798882722855e-02 + <_> + + 0 -1 4968 1.5934909880161285e-01 + + -3.3422928303480148e-02 2.8085818886756897e-01 + <_> + + 0 -1 4969 1.2470430135726929e-01 + + 1.1225829832255840e-02 -4.5520108938217163e-01 + <_> + + 0 -1 4970 7.0243299007415771e-02 + + 2.6213169097900391e-02 -3.4778589010238647e-01 + <_> + + 0 -1 4971 6.1747688055038452e-01 + + 9.0320473536849022e-03 -5.5216097831726074e-01 + <_> + + 0 -1 4972 7.7007927000522614e-02 + + 9.3850009143352509e-03 -6.9495117664337158e-01 + <_> + + 0 -1 4973 4.2874120175838470e-02 + + -3.3166319131851196e-02 1.3550239801406860e-01 + <_> + + 0 -1 4974 -2.4558259174227715e-02 + + 3.8989260792732239e-01 -2.0506320521235466e-02 + <_> + + 0 -1 4975 1.0723150335252285e-02 + + -5.1526758819818497e-02 8.9461207389831543e-02 + <_> + + 0 -1 4976 3.8331970572471619e-02 + + -3.9952859282493591e-02 1.8591549992561340e-01 + <_> + + 0 -1 4977 1.2556019425392151e-01 + + 5.1561538130044937e-03 -8.4782391786575317e-01 + <_> + + 0 -1 4978 1.1590070277452469e-01 + + 9.7828712314367294e-03 -7.6437431573867798e-01 + <_> + + 0 -1 4979 -1.5016060322523117e-02 + + -1.8328569829463959e-01 3.2125338912010193e-02 + <_> + + 0 -1 4980 -4.1521931998431683e-03 + + 9.8160982131958008e-02 -8.2769006490707397e-02 + <_> + + 0 -1 4981 1.4998050173744559e-03 + + 4.1228689253330231e-02 -8.4460526704788208e-02 + <_> + + 0 -1 4982 3.8117531687021255e-02 + + 1.9691960886120796e-02 -3.9931151270866394e-01 + <_> + + 0 -1 4983 9.4391452148556709e-04 + + -1.9674700498580933e-01 5.6476209312677383e-02 + <_> + + 0 -1 4984 2.4907960323616862e-04 + + 9.2797473073005676e-02 -1.0708689689636230e-01 + <_> + + 0 -1 4985 2.5447670370340347e-02 + + -2.5304390117526054e-02 1.0032439976930618e-01 + <_> + + 0 -1 4986 -2.8884090483188629e-02 + + -1.7259830236434937e-01 4.9671061336994171e-02 + <_> + + 0 -1 4987 1.2102840095758438e-01 + + -5.5194748565554619e-03 9.5438259840011597e-01 + <_> + + 0 -1 4988 -7.9245921224355698e-03 + + 6.4903482794761658e-02 -1.2671549618244171e-01 + <_> + + 0 -1 4989 -6.5536066889762878e-02 + + -3.7892189621925354e-01 1.6463089734315872e-02 + <_> + + 0 -1 4990 -1.6883460804820061e-02 + + 5.8534818887710571e-01 -1.4671769924461842e-02 + <_> + + 0 -1 4991 6.7252418957650661e-03 + + 2.7604229748249054e-02 -3.4817421436309814e-01 + <_> + + 0 -1 4992 -6.3783898949623108e-02 + + -3.9567160606384277e-01 1.9867889583110809e-02 + <_> + + 0 -1 4993 1.8600550293922424e-01 + + -4.5898579061031342e-02 7.3586076498031616e-02 + <_> + + 0 -1 4994 4.9724031239748001e-02 + + -2.0517630502581596e-02 4.3107840418815613e-01 + <_> + + 0 -1 4995 1.5011380426585674e-02 + + 4.0192149579524994e-02 -1.0242489725351334e-01 + <_> + + 0 -1 4996 -1.5085030347108841e-02 + + 2.3888920247554779e-01 -3.5642918199300766e-02 + <_> + + 0 -1 4997 -1.2931490316987038e-02 + + -3.6863088607788086e-01 1.7377890646457672e-02 + <_> + + 0 -1 4998 -1.3186899945139885e-02 + + -4.3170270323753357e-01 1.7947910353541374e-02 + <_> + + 0 -1 4999 -6.6814959049224854e-02 + + 4.1336119174957275e-01 -2.0904310047626495e-02 + <_> + + 0 -1 5000 4.4064331799745560e-02 + + -3.8615190982818604e-01 2.1414510905742645e-02 + <_> + + 0 -1 5001 4.1341730952262878e-01 + + 1.0130990296602249e-02 -4.7053098678588867e-01 + <_> + + 0 -1 5002 2.4443659931421280e-02 + + 9.3184120953083038e-02 -8.6774162948131561e-02 + <_> + + 0 -1 5003 1.5779680013656616e-01 + + 4.8137311823666096e-03 -5.8746212720870972e-01 + <_> + + 0 -1 5004 -2.0141510292887688e-02 + + 2.2643919289112091e-01 -4.6824630349874496e-02 + <_> + + 0 -1 5005 3.8796770386397839e-03 + + -7.7155217528343201e-02 3.6106169223785400e-02 + <_> + + 0 -1 5006 1.5064960345625877e-02 + + -5.6656859815120697e-02 1.4758649468421936e-01 + <_> + + 0 -1 5007 1.2925310060381889e-02 + + 3.5308018326759338e-02 -1.1645320057868958e-01 + <_> + + 0 -1 5008 -1.4788310043513775e-02 + + -1.1459939926862717e-01 7.5000070035457611e-02 + <_> + + 0 -1 5009 -2.0497168879956007e-03 + + 4.2067401111125946e-02 -7.0409573614597321e-02 + <_> + + 0 -1 5010 8.9428946375846863e-03 + + 5.3989838808774948e-02 -1.5380840003490448e-01 + <_> + + 0 -1 5011 1.0064999759197235e-01 + + -2.9709249734878540e-02 3.1293758749961853e-01 + <_> + + 0 -1 5012 -4.6580079942941666e-02 + + -7.2227877378463745e-01 1.3004340231418610e-02 + <_> + + 0 -1 5013 -3.8618590682744980e-02 + + 3.3867758512496948e-01 -2.1726610139012337e-02 + <_> + + 0 -1 5014 8.5657741874456406e-03 + + 7.0621289312839508e-02 -1.3055880367755890e-01 + <_> + + 0 -1 5015 -1.0986299812793732e-01 + + 3.7974509596824646e-01 -5.1755867898464203e-03 + <_> + + 0 -1 5016 3.0184251070022583e-01 + + -2.4274839088320732e-02 3.6632651090621948e-01 + <_> + + 0 -1 5017 -5.3246088325977325e-02 + + -5.5290502309799194e-01 6.2071220017969608e-03 + <_> + + 0 -1 5018 3.6629870533943176e-02 + + 2.3161249235272408e-02 -3.5514861345291138e-01 + <_> + + 0 -1 5019 6.9993197917938232e-02 + + 8.9623704552650452e-03 -8.2245421409606934e-01 + <_> + + 0 -1 5020 -8.7623577564954758e-03 + + -2.8028720617294312e-01 2.6217460632324219e-02 + <_> + + 0 -1 5021 1.5275989659130573e-02 + + -5.0123069435358047e-02 1.5774080157279968e-01 + <_> + + 0 -1 5022 1.8836189806461334e-01 + + 1.1483459733426571e-02 -7.4004447460174561e-01 + <_> + + 0 -1 5023 -1.4518629759550095e-02 + + 8.2921922206878662e-02 -5.2536141127347946e-02 + <_> + + 0 -1 5024 1.9221989437937737e-02 + + 4.0790341794490814e-02 -2.0889760553836823e-01 + <_> + + 0 -1 5025 -3.1274989247322083e-02 + + 8.0864340066909790e-01 -1.0754980146884918e-02 + <_> + + 0 -1 5026 -4.9813431687653065e-03 + + -1.9617860019207001e-01 4.1330069303512573e-02 + <_> + + 0 -1 5027 3.7296909838914871e-02 + + 3.0313879251480103e-02 -2.7336311340332031e-01 + <_> + + 0 -1 5028 -1.9014550372958183e-02 + + 1.3439440727233887e-01 -6.0782499611377716e-02 + <_> + + 0 -1 5029 -7.9229613766074181e-03 + + -7.9689770936965942e-02 4.0497440844774246e-02 + <_> + + 0 -1 5030 9.6371799707412720e-02 + + -2.5576870888471603e-02 3.2440510392189026e-01 + <_> + + 0 -1 5031 -1.7210310325026512e-02 + + 2.9772299528121948e-01 -3.0994139611721039e-02 + <_> + + 0 -1 5032 1.0736179538071156e-02 + + -7.0299342274665833e-02 1.2448900192975998e-01 + <_> + + 0 -1 5033 -4.0398869663476944e-02 + + -6.4470887184143066e-01 6.9025149568915367e-03 + <_> + + 0 -1 5034 -3.1870428472757339e-02 + + -5.3339338302612305e-01 1.5221790410578251e-02 + <_> + + 0 -1 5035 3.6518078297376633e-02 + + -7.7875651419162750e-02 1.4458900690078735e-01 + <_> + + 0 -1 5036 1.2330260127782822e-01 + + 1.7689300701022148e-02 -5.1895797252655029e-01 + <_> + + 0 -1 5037 1.0086199641227722e-01 + + 6.6002830862998962e-03 -5.5289500951766968e-01 + <_> + + 0 -1 5038 1.0026770085096359e-01 + + 1.0175090283155441e-02 -7.1554392576217651e-01 + <_> + + 0 -1 5039 3.6956761032342911e-02 + + 2.2131860256195068e-02 -3.1452280282974243e-01 + <_> + + 0 -1 5040 8.5017476230859756e-03 + + 4.9146678298711777e-02 -1.5193499624729156e-01 + <_> + + 0 -1 5041 5.3833048790693283e-02 + + 2.5698679964989424e-03 -5.0750207901000977e-01 + <_> + + 0 -1 5042 4.8958938568830490e-02 + + 9.2353876680135727e-03 -7.9371142387390137e-01 + <_> + + 0 -1 5043 4.0810879319906235e-02 + + -4.6270430088043213e-02 1.9726410508155823e-01 + <_> + + 0 -1 5044 -3.3165120985358953e-03 + + -2.1495009958744049e-01 3.8868401199579239e-02 + <_> + + 0 -1 5045 4.8434760537929833e-04 + + -1.7870649695396423e-01 5.7129681110382080e-02 + <_> + + 0 -1 5046 7.9494096338748932e-02 + + -2.2463550791144371e-02 3.6770978569984436e-01 + <_> + + 0 -1 5047 -8.8844364508986473e-03 + + -3.3796560764312744e-01 2.5869650766253471e-02 + <_> + + 0 -1 5048 -1.0575620457530022e-02 + + 1.2438619881868362e-01 -6.8147383630275726e-02 + <_> + + 0 -1 5049 7.3358109220862389e-03 + + -4.3375171720981598e-02 1.5483480691909790e-01 + <_> + + 0 -1 5050 4.2306821793317795e-02 + + 1.0016439855098724e-01 -8.8011689484119415e-02 + <_> + + 0 -1 5051 7.1759216487407684e-02 + + -8.9269876480102539e-03 2.3254199326038361e-01 + <_> + + 0 -1 5052 -2.2478280588984489e-02 + + -5.4057407379150391e-01 1.4396119862794876e-02 + <_> + + 0 -1 5053 -2.5606580078601837e-02 + + -4.3508179485797882e-02 6.4285047352313995e-02 + <_> + + 0 -1 5054 2.5733409449458122e-02 + + 2.3084849119186401e-02 -3.4278741478919983e-01 + <_> + + 0 -1 5055 -7.0163339376449585e-02 + + 4.0744331479072571e-01 -1.1836090125143528e-02 + <_> + + 0 -1 5056 -1.2527329847216606e-02 + + 9.1184526681900024e-02 -8.7035633623600006e-02 + <_> + + 0 -1 5057 5.9983458369970322e-02 + + 3.6528799682855606e-03 -8.0261522531509399e-01 + <_> + + 0 -1 5058 -5.2271911408752203e-04 + + 6.9573827087879181e-02 -1.2091639637947083e-01 + <_> + + 0 -1 5059 -2.0996539294719696e-01 + + -4.6747279167175293e-01 9.4682360067963600e-03 + <_> + + 0 -1 5060 -1.8358640372753143e-02 + + 1.4919880032539368e-01 -5.7198900729417801e-02 + <_> + + 0 -1 5061 -1.3342049904167652e-02 + + 1.4447879791259766e-01 -2.2494640201330185e-02 + <_> + + 0 -1 5062 -3.0613059177994728e-02 + + -3.3590090274810791e-01 2.4433709681034088e-02 + <_> + + 0 -1 5063 -1.9018750637769699e-02 + + 1.5518119931221008e-01 -2.5613630190491676e-02 + <_> + + 0 -1 5064 -4.5201808214187622e-02 + + 4.8730811476707458e-01 -1.7641659826040268e-02 + <_> + + 0 -1 5065 6.3432596623897552e-02 + + -5.1946818828582764e-02 1.2361440062522888e-01 + <_> + + 0 -1 5066 3.4017860889434814e-03 + + -1.7030030488967896e-01 5.4143410176038742e-02 + <_> + + 0 -1 5067 -8.5307076573371887e-02 + + -7.1878427267074585e-01 1.0392259806394577e-02 + <_> + + 0 -1 5068 -5.3066499531269073e-02 + + 5.2359157800674438e-01 -1.8369760364294052e-02 + <_> + + 0 -1 5069 -2.8319370001554489e-02 + + -1.1979889869689941e-01 5.8951549232006073e-02 + <_> + + 0 -1 5070 -8.7353803217411041e-02 + + 2.7089080214500427e-01 -2.9345329850912094e-02 + <_> + + 0 -1 5071 2.7152231335639954e-01 + + -1.1648589745163918e-02 5.5842977762222290e-01 + <_> + + 0 -1 5072 1.9388480111956596e-02 + + 5.0895590335130692e-02 -1.7962279915809631e-01 + <_> + + 0 -1 5073 2.1159179508686066e-02 + + -4.8424899578094482e-02 9.5020256936550140e-02 + <_> + + 0 -1 5074 1.2039250135421753e-01 + + 9.2587787657976151e-03 -8.7804621458053589e-01 + <_> + + 0 -1 5075 5.0090719014406204e-02 + + -2.1926950663328171e-02 2.0202030241489410e-01 + <_> + + 0 -1 5076 -5.5227670818567276e-03 + + 2.1560280025005341e-01 -3.6554779857397079e-02 + <_> + + 0 -1 5077 2.7551440522074699e-02 + + -3.2782018184661865e-02 1.6503919661045074e-01 + <_> + + 0 -1 5078 -2.5543190538883209e-02 + + -3.6424461007118225e-01 2.1275209262967110e-02 + <_> + + 0 -1 5079 -2.6791828870773315e-01 + + 4.8525270819664001e-01 -4.7535290941596031e-03 + <_> + + 0 -1 5080 -1.6798110306262970e-01 + + 3.9280641078948975e-01 -1.9414989277720451e-02 + <_> + + 0 -1 5081 4.5900348573923111e-02 + + -3.6706160753965378e-02 2.0677609741687775e-01 + <_> + + 0 -1 5082 3.6797890788875520e-04 + + -8.7039902806282043e-02 9.2830970883369446e-02 + <_> + + 0 -1 5083 -9.9194556474685669e-02 + + -3.6096671223640442e-01 2.1962769329547882e-02 + <_> + + 0 -1 5084 8.0924080975819379e-05 + + -7.9007692635059357e-02 9.5904067158699036e-02 + <_> + + 0 -1 5085 7.0894961245357990e-03 + + 3.7076078355312347e-02 -5.0917111337184906e-02 + <_> + + 0 -1 5086 -1.2181960046291351e-03 + + 4.9094028770923615e-02 -1.5975970029830933e-01 + <_> + + 0 -1 5087 -9.2138662934303284e-02 + + 5.5284732580184937e-01 -1.3595860451459885e-02 + <_> + + 0 -1 5088 6.2209279276430607e-03 + + 4.6889189630746841e-02 -1.8105800449848175e-01 + <_> + + 0 -1 5089 6.5014839172363281e-02 + + 9.4407051801681519e-03 -5.1224017143249512e-01 + <_> + + 0 -1 5090 5.4055921733379364e-02 + + 1.6289059072732925e-02 -4.2684501409530640e-01 + <_> + 368 + -1.3073990345001221e+00 + + <_> + + 0 -1 5091 3.7594079971313477e-02 + + -1.5953080356121063e-01 2.4245350062847137e-01 + <_> + + 0 -1 5092 4.0349629707634449e-03 + + -2.5617128610610962e-01 8.0420561134815216e-02 + <_> + + 0 -1 5093 2.1681638900190592e-03 + + -2.8089070320129395e-01 7.0903629064559937e-02 + <_> + + 0 -1 5094 -7.4014628808072302e-06 + + 4.9326181411743164e-02 -1.9688490033149719e-01 + <_> + + 0 -1 5095 -2.2384349722415209e-03 + + 6.8618856370449066e-02 -2.1775339543819427e-01 + <_> + + 0 -1 5096 2.9939650557935238e-03 + + -2.4257700145244598e-01 2.9716130346059799e-02 + <_> + + 0 -1 5097 4.5135850086808205e-03 + + 8.9443869888782501e-02 -1.9461549818515778e-01 + <_> + + 0 -1 5098 3.8457550108432770e-03 + + 5.0935801118612289e-02 -2.7721929550170898e-01 + <_> + + 0 -1 5099 4.0572669240646064e-04 + + -8.5517741739749908e-02 1.6446280479431152e-01 + <_> + + 0 -1 5100 -7.0624578256683890e-06 + + 7.8454487025737762e-02 -1.2395980209112167e-01 + <_> + + 0 -1 5101 -2.8428720543161035e-04 + + 1.0774250328540802e-01 -1.2222009897232056e-01 + <_> + + 0 -1 5102 7.3404680006206036e-03 + + 4.7837160527706146e-02 -2.4441170692443848e-01 + <_> + + 0 -1 5103 3.6235509905964136e-03 + + -3.1533789634704590e-01 3.5066880285739899e-02 + <_> + + 0 -1 5104 -1.5671759610995650e-03 + + -1.7147080600261688e-01 6.5121836960315704e-02 + <_> + + 0 -1 5105 4.2834067717194557e-03 + + -1.3190010190010071e-01 9.2709146440029144e-02 + <_> + + 0 -1 5106 -8.9772082865238190e-03 + + 1.2469480186700821e-01 -2.8118500486016273e-02 + <_> + + 0 -1 5107 5.5919871665537357e-03 + + 4.8671621829271317e-02 -2.2460219264030457e-01 + <_> + + 0 -1 5108 1.1782390065491199e-02 + + 3.1041109934449196e-02 -2.9882109165191650e-01 + <_> + + 0 -1 5109 -5.5568912066519260e-03 + + 1.3689100742340088e-01 -7.7152192592620850e-02 + <_> + + 0 -1 5110 1.7162049189209938e-02 + + -4.0298670530319214e-02 1.1232800036668777e-01 + <_> + + 0 -1 5111 3.5631000064313412e-03 + + 5.6056100875139236e-02 -1.9608840346336365e-01 + <_> + + 0 -1 5112 2.2586699575185776e-02 + + 1.1250300332903862e-02 -5.0490778684616089e-01 + <_> + + 0 -1 5113 2.6307879015803337e-03 + + 4.1528269648551941e-02 -2.2185860574245453e-01 + <_> + + 0 -1 5114 -1.0008380049839616e-03 + + 5.9657059609889984e-02 -1.5395790338516235e-01 + <_> + + 0 -1 5115 -7.1316999383270741e-03 + + 1.0590689629316330e-01 -8.9700952172279358e-02 + <_> + + 0 -1 5116 -6.1685360968112946e-02 + + 1.2677849829196930e-01 -2.2709969431161880e-02 + <_> + + 0 -1 5117 1.3120709918439388e-02 + + -6.3731230795383453e-02 1.5842080116271973e-01 + <_> + + 0 -1 5118 3.2676599919795990e-02 + + 2.5724250823259354e-02 -3.3406201004981995e-01 + <_> + + 0 -1 5119 1.8886770308017731e-01 + + -1.7100410535931587e-02 5.3700131177902222e-01 + <_> + + 0 -1 5120 -1.6522880468983203e-04 + + 5.4908581078052521e-02 -1.1608000099658966e-01 + <_> + + 0 -1 5121 -1.4789770357310772e-03 + + 7.7602192759513855e-02 -1.0971190035343170e-01 + <_> + + 0 -1 5122 -1.2441210448741913e-02 + + -1.4090730249881744e-01 6.8732522428035736e-02 + <_> + + 0 -1 5123 1.9457910209894180e-02 + + -3.7276178598403931e-02 2.6319879293441772e-01 + <_> + + 0 -1 5124 -2.9123809654265642e-03 + + -1.8960340321063995e-01 2.9360920190811157e-02 + <_> + + 0 -1 5125 -2.3870699107646942e-02 + + 2.5528749823570251e-01 -3.1279411166906357e-02 + <_> + + 0 -1 5126 -2.6912079192698002e-03 + + -1.4431649446487427e-01 4.8498779535293579e-02 + <_> + + 0 -1 5127 -1.7636029515415430e-03 + + -1.3328640162944794e-01 5.4250828921794891e-02 + <_> + + 0 -1 5128 -1.8844179809093475e-02 + + 1.1653099954128265e-01 -3.8028150796890259e-02 + <_> + + 0 -1 5129 3.8752850145101547e-02 + + -3.6811299622058868e-02 2.1002089977264404e-01 + <_> + + 0 -1 5130 9.4316434115171432e-03 + + 5.7964589446783066e-02 -1.8342800438404083e-01 + <_> + + 0 -1 5131 -1.1705379933118820e-02 + + 1.7905050516128540e-01 -4.9799650907516479e-02 + <_> + + 0 -1 5132 -4.4072889722883701e-03 + + -1.9810500741004944e-01 4.4608719646930695e-02 + <_> + + 0 -1 5133 -4.7192219644784927e-03 + + -1.8307499587535858e-01 4.2252171784639359e-02 + <_> + + 0 -1 5134 -4.5182029716670513e-03 + + 9.5572151243686676e-02 -6.0799460858106613e-02 + <_> + + 0 -1 5135 -5.4851798340678215e-03 + + -1.7556129395961761e-01 4.0092539042234421e-02 + <_> + + 0 -1 5136 -9.9079031497240067e-04 + + -1.3978339731693268e-01 4.8252910375595093e-02 + <_> + + 0 -1 5137 -5.0425329245626926e-03 + + -8.8625833392143250e-02 7.9794026911258698e-02 + <_> + + 0 -1 5138 -6.3926707953214645e-03 + + 3.5854909569025040e-02 -8.5030712187290192e-02 + <_> + + 0 -1 5139 -1.1408809572458267e-02 + + 7.7756106853485107e-02 -1.0200379788875580e-01 + <_> + + 0 -1 5140 5.9286449104547501e-02 + + 6.4652841538190842e-03 -4.9082350730895996e-01 + <_> + + 0 -1 5141 -5.7389298453927040e-03 + + -1.6221189498901367e-01 5.9541791677474976e-02 + <_> + + 0 -1 5142 4.4626160524785519e-03 + + -2.4659389629960060e-02 2.8509560227394104e-01 + <_> + + 0 -1 5143 -7.4683688580989838e-04 + + 5.5159430950880051e-02 -1.4510269463062286e-01 + <_> + + 0 -1 5144 7.5665451586246490e-03 + + -3.0510440468788147e-02 9.2685796320438385e-02 + <_> + + 0 -1 5145 8.1203378736972809e-02 + + 8.3315223455429077e-03 -8.8626891374588013e-01 + <_> + + 0 -1 5146 2.5454829446971416e-03 + + -5.4131258279085159e-02 1.6551689803600311e-01 + <_> + + 0 -1 5147 5.6319180876016617e-02 + + 1.5744749456644058e-02 -4.6605950593948364e-01 + <_> + + 0 -1 5148 -2.7670960873365402e-02 + + 2.7910009026527405e-01 -2.1267570555210114e-02 + <_> + + 0 -1 5149 5.7495549321174622e-02 + + 1.3765430077910423e-02 -5.6881892681121826e-01 + <_> + + 0 -1 5150 1.1847530258819461e-03 + + 6.3452966511249542e-02 -1.6044929623603821e-01 + <_> + + 0 -1 5151 4.2551690712571144e-03 + + 6.3017703592777252e-02 -1.3584609329700470e-01 + <_> + + 0 -1 5152 -2.1190859377384186e-02 + + 1.9623500108718872e-01 -2.8249129652976990e-02 + <_> + + 0 -1 5153 8.3922911435365677e-03 + + -6.2064249068498611e-02 1.1225070059299469e-01 + <_> + + 0 -1 5154 -3.5534579306840897e-02 + + 1.8565779924392700e-01 -2.1027710288763046e-02 + <_> + + 0 -1 5155 -9.2783384025096893e-03 + + -1.6255140304565430e-01 5.3493771702051163e-02 + <_> + + 0 -1 5156 -7.4480189941823483e-03 + + 5.6045979261398315e-02 -2.7357129380106926e-02 + <_> + + 0 -1 5157 3.4573610872030258e-02 + + 2.7872329577803612e-02 -2.5443691015243530e-01 + <_> + + 0 -1 5158 1.0644230060279369e-02 + + -2.5041149929165840e-02 1.2895500659942627e-01 + <_> + + 0 -1 5159 -6.9164121523499489e-03 + + 5.5145461112260818e-02 -1.4286629855632782e-01 + <_> + + 0 -1 5160 4.0446728467941284e-02 + + 4.3409019708633423e-03 -3.0095139145851135e-01 + <_> + + 0 -1 5161 -2.1182280033826828e-02 + + 2.3987750709056854e-01 -3.0267970636487007e-02 + <_> + + 0 -1 5162 -1.8278649076819420e-02 + + -2.8024369478225708e-01 2.0352259278297424e-02 + <_> + + 0 -1 5163 -6.0500060208141804e-03 + + -1.5138089656829834e-01 4.5843418687582016e-02 + <_> + + 0 -1 5164 -7.4632540345191956e-03 + + 7.3087826371192932e-02 -3.9645120501518250e-02 + <_> + + 0 -1 5165 -3.1640689820051193e-02 + + 3.8544759154319763e-01 -1.8987689167261124e-02 + <_> + + 0 -1 5166 -4.9488719552755356e-02 + + -3.7455439567565918e-01 4.6011591330170631e-03 + <_> + + 0 -1 5167 -2.4384791031479836e-03 + + -1.0864440351724625e-01 7.0171296596527100e-02 + <_> + + 0 -1 5168 7.4253929778933525e-03 + + -4.4223289936780930e-02 7.5678370893001556e-02 + <_> + + 0 -1 5169 -5.3592741489410400e-02 + + 1.9981780648231506e-01 -3.8047380745410919e-02 + <_> + + 0 -1 5170 -2.1555580198764801e-02 + + -5.2737689018249512e-01 7.7934260480105877e-03 + <_> + + 0 -1 5171 4.1731819510459900e-03 + + 3.8742069154977798e-02 -1.6946560144424438e-01 + <_> + + 0 -1 5172 4.1882280260324478e-02 + + -1.1853899806737900e-02 2.9235321283340454e-01 + <_> + + 0 -1 5173 -2.2035069763660431e-02 + + -1.3629269599914551e-01 4.7323219478130341e-02 + <_> + + 0 -1 5174 1.6916249878704548e-03 + + -4.9461908638477325e-02 7.4048481881618500e-02 + <_> + + 0 -1 5175 -1.9994638860225677e-03 + + 9.3016393482685089e-02 -7.5230561196804047e-02 + <_> + + 0 -1 5176 -8.7527623400092125e-03 + + 8.4076300263404846e-02 -3.7777189165353775e-02 + <_> + + 0 -1 5177 2.8121439740061760e-02 + + 3.8471631705760956e-02 -1.9039680063724518e-01 + <_> + + 0 -1 5178 2.4713769555091858e-02 + + -1.1225669644773006e-02 1.3408440351486206e-01 + <_> + + 0 -1 5179 2.1718820556998253e-02 + + -1.7361419275403023e-02 3.4876769781112671e-01 + <_> + + 0 -1 5180 -4.3202299624681473e-02 + + -5.1877439022064209e-01 1.2914709746837616e-02 + <_> + + 0 -1 5181 -1.6658119857311249e-03 + + -3.0727219581604004e-01 1.9104089587926865e-02 + <_> + + 0 -1 5182 -3.2269109040498734e-02 + + 3.1825730204582214e-01 -6.1126789078116417e-03 + <_> + + 0 -1 5183 -9.6689872443675995e-03 + + 3.3182978630065918e-01 -1.8409479409456253e-02 + <_> + + 0 -1 5184 1.7683519981801510e-03 + + 3.1587228178977966e-02 -1.1481689661741257e-01 + <_> + + 0 -1 5185 3.4618038684129715e-02 + + -1.8013959750533104e-02 3.4668689966201782e-01 + <_> + + 0 -1 5186 -9.3643896281719208e-02 + + -5.1143682003021240e-01 1.4282460324466228e-02 + <_> + + 0 -1 5187 4.3095857836306095e-03 + + 2.4471389129757881e-02 -2.3517690598964691e-01 + <_> + + 0 -1 5188 6.6311933100223541e-02 + + -1.5711139887571335e-02 2.4676759541034698e-01 + <_> + + 0 -1 5189 -9.2896772548556328e-03 + + -1.3924039900302887e-01 4.8822149634361267e-02 + <_> + + 0 -1 5190 -3.3214599825441837e-03 + + 1.3379609584808350e-01 -3.6818679422140121e-02 + <_> + + 0 -1 5191 4.0180981159210205e-02 + + -1.2793520465493202e-02 5.2580958604812622e-01 + <_> + + 0 -1 5192 8.7590962648391724e-02 + + 1.2522599659860134e-02 -5.5810731649398804e-01 + <_> + + 0 -1 5193 3.5475298762321472e-02 + + 2.3128280416131020e-02 -2.7402919530868530e-01 + <_> + + 0 -1 5194 5.2033789455890656e-02 + + -6.1640930362045765e-03 1.9052730500698090e-01 + <_> + + 0 -1 5195 -1.3046549260616302e-01 + + 2.5712540745735168e-01 -2.3529190570116043e-02 + <_> + + 0 -1 5196 2.8882310725748539e-03 + + -6.0755409300327301e-02 6.0243420302867889e-02 + <_> + + 0 -1 5197 1.5083160251379013e-02 + + 2.1192179992794991e-02 -2.8479540348052979e-01 + <_> + + 0 -1 5198 8.0875161802396178e-04 + + -8.5497900843620300e-02 5.4305519908666611e-02 + <_> + + 0 -1 5199 1.4947880059480667e-02 + + -5.7983450591564178e-02 1.0115720331668854e-01 + <_> + + 0 -1 5200 -4.5683588832616806e-02 + + -3.9345711469650269e-01 1.7556620761752129e-02 + <_> + + 0 -1 5201 -9.4226107466965914e-04 + + 1.3064099848270416e-01 -5.1675319671630859e-02 + <_> + + 0 -1 5202 -2.8342329896986485e-03 + + 1.5992760658264160e-01 -3.4787811338901520e-02 + <_> + + 0 -1 5203 -1.8812920898199081e-02 + + -2.9807311296463013e-01 2.2536030039191246e-02 + <_> + + 0 -1 5204 1.9601570442318916e-02 + + 1.3461099937558174e-02 -1.6885930299758911e-01 + <_> + + 0 -1 5205 -6.4929589629173279e-02 + + -7.1198761463165283e-01 8.5184276103973389e-03 + <_> + + 0 -1 5206 -1.4283999800682068e-02 + + -7.8602321445941925e-02 4.2226359248161316e-02 + <_> + + 0 -1 5207 2.5105919688940048e-02 + + -2.9744949191808701e-02 2.2586929798126221e-01 + <_> + + 0 -1 5208 3.8459669798612595e-02 + + 1.7592959105968475e-02 -3.4457311034202576e-01 + <_> + + 0 -1 5209 2.9701360035687685e-03 + + -5.2914209663867950e-02 1.1567460000514984e-01 + <_> + + 0 -1 5210 -3.5584170836955309e-03 + + 1.2957760691642761e-01 -6.1714299023151398e-02 + <_> + + 0 -1 5211 5.5475500412285328e-03 + + 4.9168299883604050e-02 -1.2925429642200470e-01 + <_> + + 0 -1 5212 7.1379862725734711e-02 + + -1.1528199538588524e-02 3.2423359155654907e-01 + <_> + + 0 -1 5213 -1.1731989681720734e-01 + + -9.0184438228607178e-01 6.3025541603565216e-03 + <_> + + 0 -1 5214 2.2931929677724838e-02 + + -1.1425419710576534e-02 4.1168990731239319e-01 + <_> + + 0 -1 5215 3.6658400204032660e-03 + + 2.8030570596456528e-02 -2.0567989349365234e-01 + <_> + + 0 -1 5216 -7.0796072483062744e-02 + + -2.1817129850387573e-01 1.2820649892091751e-02 + <_> + + 0 -1 5217 6.7239440977573395e-03 + + -4.2305160313844681e-02 1.4150319993495941e-01 + <_> + + 0 -1 5218 -2.0242671016603708e-03 + + 9.1976962983608246e-02 -4.6815071254968643e-02 + <_> + + 0 -1 5219 2.3123170249164104e-03 + + -7.1074202656745911e-02 9.8617300391197205e-02 + <_> + + 0 -1 5220 2.7525359764695168e-03 + + -5.0785668194293976e-02 7.5282126665115356e-02 + <_> + + 0 -1 5221 -3.4460208844393492e-03 + + 9.6368476748466492e-02 -7.8051783144474030e-02 + <_> + + 0 -1 5222 -1.1416469700634480e-02 + + -1.1313349753618240e-01 7.5080856680870056e-02 + <_> + + 0 -1 5223 3.0283999876701273e-05 + + -1.3886189460754395e-01 4.3761149048805237e-02 + <_> + + 0 -1 5224 -1.4150349888950586e-03 + + 3.7164621055126190e-02 -1.1095599830150604e-01 + <_> + + 0 -1 5225 -1.9245060393586755e-03 + + 7.0604592561721802e-02 -9.4269059598445892e-02 + <_> + + 0 -1 5226 3.0031649395823479e-02 + + -5.1407739520072937e-02 1.6337560117244720e-01 + <_> + + 0 -1 5227 -2.5132829323410988e-03 + + -1.4933520555496216e-01 5.1749840378761292e-02 + <_> + + 0 -1 5228 1.9437290029600263e-04 + + -4.8553969711065292e-02 1.0562740266323090e-01 + <_> + + 0 -1 5229 2.9679399449378252e-03 + + 3.6664169281721115e-02 -1.5650020539760590e-01 + <_> + + 0 -1 5230 3.2629880588501692e-03 + + 4.2934000492095947e-02 -1.4514559507369995e-01 + <_> + + 0 -1 5231 2.9959511011838913e-03 + + -6.3821822404861450e-02 9.3514777719974518e-02 + <_> + + 0 -1 5232 -1.5483190305531025e-02 + + -2.0184549689292908e-01 3.1191380694508553e-02 + <_> + + 0 -1 5233 -2.3956559598445892e-02 + + 3.6116409301757812e-01 -2.4698240682482719e-02 + <_> + + 0 -1 5234 -1.7136270180344582e-02 + + -2.6252090930938721e-01 2.4616269394755363e-02 + <_> + + 0 -1 5235 -6.2233610078692436e-03 + + 1.1059129983186722e-01 -5.7947199791669846e-02 + <_> + + 0 -1 5236 2.9878519475460052e-02 + + 7.8794546425342560e-03 -2.8504589200019836e-01 + <_> + + 0 -1 5237 -9.6910241991281509e-03 + + -1.5696419775485992e-01 3.8263391703367233e-02 + <_> + + 0 -1 5238 -1.2825420498847961e-01 + + 2.8350758552551270e-01 -2.7224350720643997e-02 + <_> + + 0 -1 5239 -3.9670959813520312e-04 + + -1.3316330313682556e-01 5.3896941244602203e-02 + <_> + + 0 -1 5240 -8.2217011367902160e-04 + + -1.3680179417133331e-01 7.7957339584827423e-02 + <_> + + 0 -1 5241 7.4795359978452325e-05 + + -9.0496443212032318e-02 6.8528160452842712e-02 + <_> + + 0 -1 5242 9.3816556036472321e-03 + + -9.9184580147266388e-02 6.4078651368618011e-02 + <_> + + 0 -1 5243 -6.6485297866165638e-03 + + 1.4783580601215363e-01 -4.6988330781459808e-02 + <_> + + 0 -1 5244 -5.5821631103754044e-03 + + -1.3562120497226715e-01 5.5308390408754349e-02 + <_> + + 0 -1 5245 -3.0224759131669998e-02 + + 3.4760668873786926e-01 -1.6698839142918587e-02 + <_> + + 0 -1 5246 -2.7506949380040169e-02 + + 2.8031051158905029e-01 -1.0123490355908871e-02 + <_> + + 0 -1 5247 1.5043930150568485e-02 + + 1.5279079787433147e-02 -3.9506959915161133e-01 + <_> + + 0 -1 5248 9.2139653861522675e-03 + + 2.6678409427404404e-02 -1.4255590736865997e-01 + <_> + + 0 -1 5249 6.3955582678318024e-02 + + 6.2569188885390759e-03 -8.8076668977737427e-01 + <_> + + 0 -1 5250 3.0171850085025653e-05 + + -1.1047919839620590e-01 5.1936849951744080e-02 + <_> + + 0 -1 5251 -5.1049161702394485e-03 + + 2.1350729465484619e-01 -2.7889270335435867e-02 + <_> + + 0 -1 5252 -9.1436346992850304e-03 + + -1.9197109341621399e-01 3.0341459438204765e-02 + <_> + + 0 -1 5253 -7.6746046543121338e-02 + + -7.2468912601470947e-01 7.1879802271723747e-03 + <_> + + 0 -1 5254 4.8780560493469238e-02 + + -2.1447779610753059e-02 3.0364468693733215e-01 + <_> + + 0 -1 5255 4.2551410198211670e-01 + + 6.3504311256110668e-03 -9.4783991575241089e-01 + <_> + + 0 -1 5256 2.2590209264308214e-03 + + 1.8893169239163399e-02 -1.9443869590759277e-01 + <_> + + 0 -1 5257 -3.8309961091727018e-03 + + -1.2813219428062439e-01 4.7748729586601257e-02 + <_> + + 0 -1 5258 7.5495108030736446e-03 + + -6.7982822656631470e-02 7.6470799744129181e-02 + <_> + + 0 -1 5259 1.4784730039536953e-02 + + -3.4885041415691376e-02 1.7936830222606659e-01 + <_> + + 0 -1 5260 5.6762639433145523e-02 + + 1.2816789560019970e-02 -4.8105829954147339e-01 + <_> + + 0 -1 5261 -2.5854599662125111e-03 + + 1.2653970718383789e-01 -4.7761850059032440e-02 + <_> + + 0 -1 5262 -5.5542518384754658e-03 + + 7.2126902639865875e-02 -3.8657661527395248e-02 + <_> + + 0 -1 5263 2.6672501116991043e-03 + + -6.1485260725021362e-02 1.2647840380668640e-01 + <_> + + 0 -1 5264 -2.2879959642887115e-01 + + -4.8435351252555847e-01 4.5618140138685703e-03 + <_> + + 0 -1 5265 3.7851329892873764e-02 + + 1.8769560381770134e-02 -3.0806949734687805e-01 + <_> + + 0 -1 5266 2.4275709874927998e-03 + + -7.1589171886444092e-02 8.1694543361663818e-02 + <_> + + 0 -1 5267 -7.9000797122716904e-03 + + -1.2589320540428162e-01 4.7421310096979141e-02 + <_> + + 0 -1 5268 -6.7925411276519299e-03 + + 6.1758730560541153e-02 -5.3803559392690659e-02 + <_> + + 0 -1 5269 -1.7522360384464264e-01 + + 3.3726111054420471e-01 -1.7961960285902023e-02 + <_> + + 0 -1 5270 6.6033959388732910e-02 + + 4.4206557795405388e-03 -5.5819147825241089e-01 + <_> + + 0 -1 5271 5.1699979230761528e-03 + + 5.3349301218986511e-02 -1.2245289981365204e-01 + <_> + + 0 -1 5272 1.2047989666461945e-01 + + -6.9788158871233463e-03 7.9341912269592285e-01 + <_> + + 0 -1 5273 -4.2617730796337128e-03 + + 7.8014120459556580e-02 -6.8260386586189270e-02 + <_> + + 0 -1 5274 3.0685370787978172e-02 + + 9.3320813030004501e-03 -2.7420249581336975e-01 + <_> + + 0 -1 5275 -6.8651121109724045e-03 + + -1.3084979355335236e-01 4.7273408621549606e-02 + <_> + + 0 -1 5276 -3.9284229278564453e-03 + + 1.1553719639778137e-01 -5.5044289678335190e-02 + <_> + + 0 -1 5277 -4.2112590745091438e-03 + + 1.3730779290199280e-01 -5.2514389157295227e-02 + <_> + + 0 -1 5278 -7.6999869197607040e-03 + + -3.4011191129684448e-01 1.7478680238127708e-02 + <_> + + 0 -1 5279 -1.1867909692227840e-02 + + 2.5731179118156433e-01 -2.5691770017147064e-02 + <_> + + 0 -1 5280 5.3619472309947014e-03 + + 1.1936780065298080e-02 -2.8930050134658813e-01 + <_> + + 0 -1 5281 -2.3130229674279690e-03 + + -1.0821309685707092e-01 5.3640749305486679e-02 + <_> + + 0 -1 5282 -2.2222870588302612e-01 + + 3.1654310226440430e-01 -1.4542319811880589e-02 + <_> + + 0 -1 5283 6.2593920156359673e-03 + + 3.7795171141624451e-02 -1.5100699663162231e-01 + <_> + + 0 -1 5284 3.4754760563373566e-03 + + -6.3047468662261963e-02 8.5025683045387268e-02 + <_> + + 0 -1 5285 -2.8249478782527149e-04 + + -1.1442869901657104e-01 5.6041400879621506e-02 + <_> + + 0 -1 5286 4.8107700422406197e-04 + + -9.6898466348648071e-02 2.8347050771117210e-02 + <_> + + 0 -1 5287 2.4178959429264069e-02 + + -2.1033059805631638e-02 2.5629448890686035e-01 + <_> + + 0 -1 5288 2.9526960104703903e-02 + + 1.6122579574584961e-02 -3.4472090005874634e-01 + <_> + + 0 -1 5289 -3.0501780565828085e-03 + + -1.3633529841899872e-01 4.0983788669109344e-02 + <_> + + 0 -1 5290 1.0082300286740065e-03 + + -6.0927029699087143e-02 4.0717199444770813e-02 + <_> + + 0 -1 5291 -3.0384280253201723e-03 + + 6.1883278191089630e-02 -9.7887121140956879e-02 + <_> + + 0 -1 5292 3.2816259190440178e-03 + + -4.7950621694326401e-02 6.2675401568412781e-02 + <_> + + 0 -1 5293 1.3182610273361206e-02 + + 2.2476239502429962e-01 -2.5649169459939003e-02 + <_> + + 0 -1 5294 -2.3278119042515755e-03 + + 7.3735602200031281e-02 -5.1023889333009720e-02 + <_> + + 0 -1 5295 -1.0695509612560272e-02 + + -7.5625538825988770e-01 7.3301601223647594e-03 + <_> + + 0 -1 5296 7.8046746551990509e-02 + + 1.8139410531148314e-03 -6.2067931890487671e-01 + <_> + + 0 -1 5297 5.6678339838981628e-02 + + 6.2128840945661068e-03 -7.8200930356979370e-01 + <_> + + 0 -1 5298 7.2442921809852123e-03 + + -4.8852469772100449e-02 1.0644549876451492e-01 + <_> + + 0 -1 5299 -6.6754333674907684e-02 + + -6.4796060323715210e-01 8.7654050439596176e-03 + <_> + + 0 -1 5300 -3.4662630409002304e-02 + + 3.3293959498405457e-01 -1.7286069691181183e-02 + <_> + + 0 -1 5301 -1.5084750019013882e-02 + + -1.2696580588817596e-01 4.5507699251174927e-02 + <_> + + 0 -1 5302 -2.3421730846166611e-02 + + -2.5279340147972107e-01 1.5818970277905464e-02 + <_> + + 0 -1 5303 2.5689320638775826e-02 + + -3.7194628268480301e-02 1.6223169863224030e-01 + <_> + + 0 -1 5304 6.3883140683174133e-03 + + 3.0617009848356247e-02 -1.3695000112056732e-01 + <_> + + 0 -1 5305 -1.0519590228796005e-01 + + -8.4453481435775757e-01 6.6635669209063053e-03 + <_> + + 0 -1 5306 1.8773669376969337e-02 + + 4.6610347926616669e-03 -1.7115519940853119e-01 + <_> + + 0 -1 5307 -1.3318320270627737e-03 + + 6.5780423581600189e-02 -8.7241567671298981e-02 + <_> + + 0 -1 5308 -2.1417330205440521e-01 + + 4.7866639494895935e-01 -3.0801231041550636e-03 + <_> + + 0 -1 5309 -5.5097872018814087e-01 + + -6.3633698225021362e-01 8.8994754478335381e-03 + <_> + + 0 -1 5310 -3.3415539655834436e-03 + + 1.2846040725708008e-01 -3.2317079603672028e-02 + <_> + + 0 -1 5311 1.0858159512281418e-03 + + -1.1438050121068954e-01 4.7090869396924973e-02 + <_> + + 0 -1 5312 4.2784498073160648e-03 + + 4.3842699378728867e-02 -8.0856688320636749e-02 + <_> + + 0 -1 5313 -2.0054390188306570e-03 + + 1.0532370209693909e-01 -5.0866328179836273e-02 + <_> + + 0 -1 5314 -3.4336079843342304e-03 + + -7.9986043274402618e-02 4.2570270597934723e-02 + <_> + + 0 -1 5315 -1.2204749509692192e-03 + + 4.1162941604852676e-02 -1.3378110527992249e-01 + <_> + + 0 -1 5316 -1.3440379500389099e-01 + + -5.2044588327407837e-01 2.9635489918291569e-03 + <_> + + 0 -1 5317 1.4581819996237755e-02 + + -1.9067969173192978e-02 4.0065661072731018e-01 + <_> + + 0 -1 5318 -2.8450360987335443e-03 + + -5.8998711407184601e-02 3.1797751784324646e-02 + <_> + + 0 -1 5319 4.8618339933454990e-03 + + 3.9754759520292282e-02 -1.4741879701614380e-01 + <_> + + 0 -1 5320 5.6295008398592472e-03 + + -4.2094878852367401e-02 4.1394129395484924e-02 + <_> + + 0 -1 5321 -4.5936359092593193e-03 + + 2.0751099288463593e-01 -2.7909379452466965e-02 + <_> + + 0 -1 5322 -3.0693739652633667e-02 + + -3.4029048681259155e-01 5.0333337858319283e-03 + <_> + + 0 -1 5323 3.1476689036935568e-04 + + -8.8118873536586761e-02 6.3354291021823883e-02 + <_> + + 0 -1 5324 -3.4313879441469908e-03 + + 5.9088770300149918e-02 -6.7773580551147461e-02 + <_> + + 0 -1 5325 -3.4075058647431433e-04 + + -9.8268762230873108e-02 5.8783698827028275e-02 + <_> + + 0 -1 5326 -3.7829359062016010e-03 + + 1.7841720581054688e-01 -4.6912178397178650e-02 + <_> + + 0 -1 5327 -4.6322058886289597e-02 + + -1.6307410597801208e-01 3.9191931486129761e-02 + <_> + + 0 -1 5328 1.8471380695700645e-02 + + 1.5975039452314377e-02 -2.8808701038360596e-01 + <_> + + 0 -1 5329 9.0416809543967247e-03 + + -3.1815830618143082e-02 1.6392929852008820e-01 + <_> + + 0 -1 5330 -3.1387940049171448e-02 + + 1.5696319937705994e-01 -1.5333149582147598e-02 + <_> + + 0 -1 5331 -7.5614887464325875e-05 + + 7.4591353535652161e-02 -8.4359541535377502e-02 + <_> + + 0 -1 5332 -2.3939300328493118e-02 + + -1.1604589968919754e-01 3.0868789181113243e-02 + <_> + + 0 -1 5333 2.2537580225616693e-03 + + 4.0261909365653992e-02 -1.6604030132293701e-01 + <_> + + 0 -1 5334 -5.3389810025691986e-02 + + 1.0318890213966370e-01 -2.0877240225672722e-02 + <_> + + 0 -1 5335 5.6420508772134781e-03 + + -4.6839520335197449e-02 1.1634089797735214e-01 + <_> + + 0 -1 5336 4.2355400510132313e-03 + + 2.5631250813603401e-02 -9.3193583190441132e-02 + <_> + + 0 -1 5337 -2.1929260343313217e-02 + + -3.5141220688819885e-01 1.5704020857810974e-02 + <_> + + 0 -1 5338 1.3050789944827557e-02 + + -7.6834131032228470e-03 1.3095930218696594e-01 + <_> + + 0 -1 5339 2.2426109760999680e-02 + + 6.3964631408452988e-03 -8.0513131618499756e-01 + <_> + + 0 -1 5340 -8.8755652308464050e-02 + + 3.9323249459266663e-01 -1.0365420021116734e-02 + <_> + + 0 -1 5341 1.1768270283937454e-02 + + -7.5270563364028931e-02 7.1183227002620697e-02 + <_> + + 0 -1 5342 2.1221570670604706e-02 + + 2.4082770571112633e-02 -1.6292670369148254e-01 + <_> + + 0 -1 5343 -5.2887611091136932e-02 + + 3.3231079578399658e-01 -1.5548040159046650e-02 + <_> + + 0 -1 5344 2.5847768783569336e-01 + + 9.5278248190879822e-03 -6.3773447275161743e-01 + <_> + + 0 -1 5345 -2.8695159126073122e-03 + + -9.8719991743564606e-02 5.5244650691747665e-02 + <_> + + 0 -1 5346 1.2492690235376358e-01 + + 1.9365450134500861e-03 -9.9999272823333740e-01 + <_> + + 0 -1 5347 4.3900720775127411e-02 + + -1.6385570168495178e-02 3.7183851003646851e-01 + <_> + + 0 -1 5348 5.2520469762384892e-03 + + 4.7758270055055618e-02 -1.3461829721927643e-01 + <_> + + 0 -1 5349 -2.0031959284096956e-03 + + 8.3587102591991425e-02 -6.7750580608844757e-02 + <_> + + 0 -1 5350 4.4535310007631779e-03 + + -8.9202463626861572e-02 4.6748258173465729e-02 + <_> + + 0 -1 5351 1.5174630284309387e-01 + + 5.6481529027223587e-03 -8.2450437545776367e-01 + <_> + + 0 -1 5352 -6.1992209404706955e-02 + + -4.3334591388702393e-01 5.3922580555081367e-03 + <_> + + 0 -1 5353 -9.3085348606109619e-02 + + 5.2169102430343628e-01 -9.9382782354950905e-03 + <_> + + 0 -1 5354 -4.9394429661333561e-03 + + -2.0004139840602875e-01 2.7710979804396629e-02 + <_> + + 0 -1 5355 -1.3681269483640790e-03 + + 8.5065416991710663e-02 -7.4542969465255737e-02 + <_> + + 0 -1 5356 -2.7988219517283142e-04 + + -7.6987631618976593e-02 6.8912938237190247e-02 + <_> + + 0 -1 5357 -3.2129848841577768e-03 + + 1.5940999984741211e-01 -3.4221589565277100e-02 + <_> + + 0 -1 5358 3.9533369243144989e-02 + + 3.1095379963517189e-03 -8.5460907220840454e-01 + <_> + + 0 -1 5359 2.0442719105631113e-03 + + -6.4074553549289703e-02 7.8644759953022003e-02 + <_> + + 0 -1 5360 -2.0770760253071785e-02 + + -3.1129410862922668e-01 4.3864948675036430e-03 + <_> + + 0 -1 5361 -4.7200381755828857e-02 + + 1.0526890307664871e-01 -5.1456131041049957e-02 + <_> + + 0 -1 5362 1.3096869923174381e-02 + + 9.9430568516254425e-03 -1.4253680408000946e-01 + <_> + + 0 -1 5363 -1.0935390368103981e-02 + + -1.6756610572338104e-01 3.5863548517227173e-02 + <_> + + 0 -1 5364 -1.6354349255561829e-01 + + -8.2129329442977905e-01 1.9741130527108908e-03 + <_> + + 0 -1 5365 3.8668718189001083e-02 + + -1.1329679749906063e-02 4.7532460093498230e-01 + <_> + + 0 -1 5366 6.0949958860874176e-02 + + 1.1516530066728592e-02 -5.7472079992294312e-01 + <_> + + 0 -1 5367 -1.2101690284907818e-02 + + 1.5505610406398773e-01 -3.2629158347845078e-02 + <_> + + 0 -1 5368 -1.0064270347356796e-02 + + -9.2389531433582306e-02 3.2318059355020523e-02 + <_> + + 0 -1 5369 -5.8900681324303150e-03 + + -2.6503130793571472e-01 1.9127139821648598e-02 + <_> + + 0 -1 5370 -3.1361039727926254e-02 + + 5.6730771064758301e-01 -9.6010044217109680e-03 + <_> + + 0 -1 5371 -4.7777321189641953e-02 + + 5.9038662910461426e-01 -7.4091539718210697e-03 + <_> + + 0 -1 5372 -1.0792270302772522e-02 + + -1.2814930081367493e-01 4.0264949202537537e-02 + <_> + + 0 -1 5373 -1.4374120160937309e-02 + + 2.0772540569305420e-01 -2.9854990541934967e-02 + <_> + + 0 -1 5374 5.2079811692237854e-02 + + -3.8335260469466448e-03 7.5818628072738647e-01 + <_> + + 0 -1 5375 6.1354418285191059e-03 + + 3.0476450920104980e-02 -1.7281690239906311e-01 + <_> + + 0 -1 5376 -3.0654598958790302e-03 + + 5.8025300502777100e-02 -7.9617038369178772e-02 + <_> + + 0 -1 5377 5.7721929624676704e-03 + + -3.6747518926858902e-02 1.6319790482521057e-01 + <_> + + 0 -1 5378 2.7028471231460571e-01 + + -3.9847781881690025e-03 4.9476540088653564e-01 + <_> + + 0 -1 5379 -1.5034529566764832e-01 + + -5.2624911069869995e-01 1.0567910037934780e-02 + <_> + + 0 -1 5380 7.6101601123809814e-02 + + -2.3525250144302845e-03 9.1819989681243896e-01 + <_> + + 0 -1 5381 -5.5953811854124069e-02 + + -7.8321272134780884e-01 6.8363421596586704e-03 + <_> + + 0 -1 5382 -2.4320950731635094e-02 + + 2.2739610075950623e-01 -1.1622290126979351e-02 + <_> + + 0 -1 5383 1.6274319961667061e-02 + + 1.4024170115590096e-02 -3.4222239255905151e-01 + <_> + + 0 -1 5384 7.7015208080410957e-04 + + -4.4768709689378738e-02 5.7412229478359222e-02 + <_> + + 0 -1 5385 1.3995269546285272e-03 + + -6.0614239424467087e-02 8.4398999810218811e-02 + <_> + + 0 -1 5386 -2.0544769242405891e-02 + + -1.8160410225391388e-01 2.0795119926333427e-02 + <_> + + 0 -1 5387 -3.6872550845146179e-02 + + 2.6817229390144348e-01 -1.9921269267797470e-02 + <_> + + 0 -1 5388 -2.5466610677540302e-03 + + -1.3361929357051849e-01 1.9191939383745193e-02 + <_> + + 0 -1 5389 3.3513590693473816e-02 + + 9.8206587135791779e-03 -5.2659887075424194e-01 + <_> + + 0 -1 5390 -5.5437661707401276e-02 + + 4.5292490720748901e-01 -9.3475803732872009e-03 + <_> + + 0 -1 5391 -5.3564338013529778e-03 + + -1.4787580072879791e-01 3.3617950975894928e-02 + <_> + + 0 -1 5392 1.1551200412213802e-02 + + -3.2851058989763260e-02 6.3716597855091095e-02 + <_> + + 0 -1 5393 7.2917826473712921e-02 + + -1.6388719901442528e-02 3.1580808758735657e-01 + <_> + + 0 -1 5394 -8.9563012123107910e-02 + + 7.5366562604904175e-01 -2.0717559382319450e-03 + <_> + + 0 -1 5395 -2.2225419525057077e-03 + + -9.2733852565288544e-02 6.0395851731300354e-02 + <_> + + 0 -1 5396 -1.7847110331058502e-01 + + 4.7988530993461609e-01 -1.0481510311365128e-02 + <_> + + 0 -1 5397 6.7723011597990990e-03 + + 5.2660830318927765e-02 -1.0471290349960327e-01 + <_> + + 0 -1 5398 2.8399130329489708e-02 + + -2.2862000390887260e-02 2.5348138809204102e-01 + <_> + + 0 -1 5399 -7.0053818635642529e-03 + + -1.3017000257968903e-01 4.3448921293020248e-02 + <_> + + 0 -1 5400 -5.1440461538732052e-03 + + -1.4800100028514862e-01 4.5171629637479782e-02 + <_> + + 0 -1 5401 -1.1269059963524342e-02 + + 1.1185359954833984e-01 -5.4867088794708252e-02 + <_> + + 0 -1 5402 2.2866109386086464e-02 + + -1.5563690103590488e-02 2.1705490350723267e-01 + <_> + + 0 -1 5403 5.1559228450059891e-02 + + 1.0421809740364552e-02 -5.3233247995376587e-01 + <_> + + 0 -1 5404 1.8902059644460678e-02 + + -3.0878869816660881e-02 5.5574499070644379e-02 + <_> + + 0 -1 5405 5.5700382217764854e-03 + + 5.3661361336708069e-02 -9.4876497983932495e-02 + <_> + + 0 -1 5406 -2.3021729663014412e-02 + + 1.2766240537166595e-01 -2.2307910025119781e-02 + <_> + + 0 -1 5407 7.1334750391542912e-03 + + 3.1089689582586288e-02 -1.6293430328369141e-01 + <_> + + 0 -1 5408 -2.9335260391235352e-02 + + 1.0503090173006058e-01 -2.6008550077676773e-02 + <_> + + 0 -1 5409 4.6253278851509094e-02 + + 7.8362170606851578e-03 -6.6226661205291748e-01 + <_> + + 0 -1 5410 3.9622580516152084e-04 + + -9.4567127525806427e-02 2.6796899735927582e-02 + <_> + + 0 -1 5411 -1.1323750019073486e-02 + + 7.4313652515411377e-01 -6.7432140931487083e-03 + <_> + + 0 -1 5412 -1.7217209935188293e-01 + + -7.1483498811721802e-01 8.1747565418481827e-03 + <_> + + 0 -1 5413 1.8156579462811351e-03 + + 4.8135720193386078e-02 -1.0678470134735107e-01 + <_> + + 0 -1 5414 5.8022491633892059e-02 + + -7.4218288064002991e-03 3.8226440548896790e-01 + <_> + + 0 -1 5415 1.4357370091602206e-03 + + -2.2542880475521088e-01 2.1576719358563423e-02 + <_> + + 0 -1 5416 5.5960440076887608e-03 + + 2.5731930136680603e-01 -2.1246509626507759e-02 + <_> + + 0 -1 5417 2.5314849335700274e-03 + + -3.6227720975875854e-01 1.5138260088860989e-02 + <_> + + 0 -1 5418 -4.2207110673189163e-03 + + -4.6638991683721542e-02 2.6125539094209671e-02 + <_> + + 0 -1 5419 -5.4260431788861752e-03 + + 1.0110379755496979e-01 -5.2066121250391006e-02 + <_> + + 0 -1 5420 1.6170790186151862e-03 + + -4.1680540889501572e-02 9.6459351480007172e-02 + <_> + + 0 -1 5421 -3.2414530869573355e-03 + + -1.2638680636882782e-01 3.9169210940599442e-02 + <_> + + 0 -1 5422 4.5421482063829899e-03 + + -2.9149880632758141e-02 6.9948889315128326e-02 + <_> + + 0 -1 5423 5.3024510852992535e-03 + + -7.9129062592983246e-02 6.1111859977245331e-02 + <_> + + 0 -1 5424 -4.6412080526351929e-02 + + 3.1127449870109558e-01 -6.2580788508057594e-03 + <_> + + 0 -1 5425 -6.2991487793624401e-03 + + -8.3928130567073822e-02 6.6761530935764313e-02 + <_> + + 0 -1 5426 7.9948090016841888e-02 + + 2.6887101121246815e-03 -5.6553709506988525e-01 + <_> + + 0 -1 5427 9.9693494848906994e-04 + + -7.2051003575325012e-02 9.2260897159576416e-02 + <_> + + 0 -1 5428 -2.1847949828952551e-03 + + 8.3864517509937286e-02 -6.6099606454372406e-02 + <_> + + 0 -1 5429 -1.5286840498447418e-01 + + 6.1705768108367920e-01 -8.1674018874764442e-03 + <_> + + 0 -1 5430 1.7121130600571632e-02 + + 2.6676440611481667e-02 -1.4158309996128082e-01 + <_> + + 0 -1 5431 1.8799189710989594e-03 + + -7.7865563333034515e-02 6.7955218255519867e-02 + <_> + + 0 -1 5432 5.5029629729688168e-03 + + -7.9979859292507172e-02 6.4055956900119781e-02 + <_> + + 0 -1 5433 2.7474550530314445e-02 + + 6.0482721775770187e-02 -8.8957548141479492e-02 + <_> + + 0 -1 5434 2.7708879113197327e-01 + + 4.4098719954490662e-03 -1.0000040531158447e+00 + <_> + + 0 -1 5435 -4.9538668245077133e-03 + + 1.4720940589904785e-01 -3.5671569406986237e-02 + <_> + + 0 -1 5436 4.7095369547605515e-02 + + -6.0950522311031818e-03 2.4319580197334290e-01 + <_> + + 0 -1 5437 -3.1939700711518526e-03 + + -1.3417580723762512e-01 3.9335511624813080e-02 + <_> + + 0 -1 5438 3.5586568992584944e-03 + + 2.1399470046162605e-02 -4.3609801679849625e-02 + <_> + + 0 -1 5439 -1.0028639808297157e-02 + + 1.6288889944553375e-01 -3.1448449939489365e-02 + <_> + + 0 -1 5440 -2.9802629724144936e-03 + + -7.0220857858657837e-02 3.7910789251327515e-02 + <_> + + 0 -1 5441 1.7347529530525208e-02 + + 1.1053959839046001e-02 -4.5107790827751160e-01 + <_> + + 0 -1 5442 -4.4207129627466202e-02 + + 1.4115320146083832e-01 -6.2362072058022022e-03 + <_> + + 0 -1 5443 -3.2249989453703165e-03 + + -1.0305760055780411e-01 4.9647849053144455e-02 + <_> + + 0 -1 5444 7.5196991674602032e-03 + + -2.8604390099644661e-02 9.8367802798748016e-02 + <_> + + 0 -1 5445 -6.1209458857774734e-02 + + 2.2113859653472900e-01 -2.9835490509867668e-02 + <_> + + 0 -1 5446 2.0107250660657883e-02 + + 1.6412479802966118e-02 -1.2316829711198807e-01 + <_> + + 0 -1 5447 -1.6578679904341698e-02 + + -2.3395630717277527e-01 3.0250690877437592e-02 + <_> + + 0 -1 5448 -6.0900870710611343e-02 + + 3.1688570976257324e-01 -1.8433200195431709e-02 + <_> + + 0 -1 5449 4.2772209271788597e-03 + + -4.3859448283910751e-02 1.2858760356903076e-01 + <_> + + 0 -1 5450 6.6130697727203369e-02 + + 2.0941190421581268e-02 -2.0549100637435913e-01 + <_> + + 0 -1 5451 2.5896991137415171e-03 + + -8.2597322762012482e-02 7.7048726379871368e-02 + <_> + + 0 -1 5452 -1.7113700509071350e-02 + + -9.9560201168060303e-02 2.0174279808998108e-02 + <_> + + 0 -1 5453 6.2078679911792278e-03 + + -1.5074240043759346e-02 3.5393691062927246e-01 + <_> + + 0 -1 5454 -3.3676949143409729e-01 + + -4.9838671088218689e-01 7.4067250825464725e-03 + <_> + + 0 -1 5455 5.0239380449056625e-02 + + -1.8589239567518234e-02 2.8223350644111633e-01 + <_> + + 0 -1 5456 1.1036300100386143e-02 + + 2.9623959213495255e-02 -2.0078790187835693e-01 + <_> + + 0 -1 5457 6.0965020209550858e-02 + + -1.1036460287868977e-02 5.0334519147872925e-01 + <_> + + 0 -1 5458 1.5966590493917465e-02 + + 1.3941870070993900e-02 -2.4742470681667328e-01 + <_> + 243 + -1.4138590097427368e+00 + + <_> + + 0 -1 5459 -3.8829419761896133e-02 + + 3.1823828816413879e-01 -1.4062009751796722e-01 + <_> + + 0 -1 5460 -6.7771300673484802e-02 + + 2.0526969432830811e-01 -1.7867469787597656e-01 + <_> + + 0 -1 5461 9.3152940273284912e-02 + + -1.3293810188770294e-01 2.3252120614051819e-01 + <_> + + 0 -1 5462 -6.0846367850899696e-03 + + 1.9817650318145752e-01 -1.5535140037536621e-01 + <_> + + 0 -1 5463 -1.7230149358510971e-02 + + 2.5784310698509216e-01 -9.0387366712093353e-02 + <_> + + 0 -1 5464 4.1907798498868942e-02 + + 6.2066148966550827e-02 -3.2303139567375183e-01 + <_> + + 0 -1 5465 -3.4084350336343050e-03 + + -3.1667909026145935e-01 6.0275040566921234e-02 + <_> + + 0 -1 5466 3.4909289330244064e-02 + + -1.2456309795379639e-01 1.6099859774112701e-01 + <_> + + 0 -1 5467 1.1676900088787079e-02 + + -1.8025660514831543e-01 1.2234430015087128e-01 + <_> + + 0 -1 5468 -1.2773449998348951e-03 + + -2.4735580384731293e-01 6.2129739671945572e-02 + <_> + + 0 -1 5469 1.6917299479246140e-02 + + 6.9671042263507843e-02 -2.5292581319808960e-01 + <_> + + 0 -1 5470 2.5656640529632568e-02 + + 2.6212580502033234e-02 -1.6348999738693237e-01 + <_> + + 0 -1 5471 1.9884048961102962e-03 + + -3.1018510460853577e-01 5.0259251147508621e-02 + <_> + + 0 -1 5472 4.2548488825559616e-02 + + 1.7065819352865219e-02 -4.7830620408058167e-01 + <_> + + 0 -1 5473 6.0466718859970570e-03 + + -2.2118049860000610e-01 7.2842411696910858e-02 + <_> + + 0 -1 5474 -8.0229081213474274e-03 + + -1.4530059695243835e-01 4.9906261265277863e-02 + <_> + + 0 -1 5475 3.7937261164188385e-02 + + -3.4007780253887177e-02 4.3715330958366394e-01 + <_> + + 0 -1 5476 -5.2960298955440521e-02 + + -2.8856590390205383e-01 1.8457209691405296e-02 + <_> + + 0 -1 5477 7.5578060932457447e-03 + + -2.3534600436687469e-01 6.0302570462226868e-02 + <_> + + 0 -1 5478 -1.5554980374872684e-02 + + -2.6567730307579041e-01 5.5279370397329330e-02 + <_> + + 0 -1 5479 3.4035260323435068e-03 + + 4.6175889670848846e-02 -3.3651891350746155e-01 + <_> + + 0 -1 5480 -1.9370270892977715e-02 + + 1.9603839516639709e-01 -8.0186828970909119e-02 + <_> + + 0 -1 5481 2.1719569340348244e-02 + + 4.1932079941034317e-02 -3.4327590465545654e-01 + <_> + + 0 -1 5482 -3.8787510129623115e-04 + + -2.5382238626480103e-01 4.5200780034065247e-02 + <_> + + 0 -1 5483 3.3794559538364410e-02 + + -6.4901560544967651e-02 2.1238659322261810e-01 + <_> + + 0 -1 5484 -9.1701336205005646e-03 + + -2.3874589800834656e-01 4.0796380490064621e-02 + <_> + + 0 -1 5485 -1.3741330476477742e-03 + + -1.6430020332336426e-01 8.1496283411979675e-02 + <_> + + 0 -1 5486 -1.2352719902992249e-02 + + 1.6805070638656616e-01 -5.7883970439434052e-02 + <_> + + 0 -1 5487 -1.1177700012922287e-02 + + -1.9775860011577606e-01 6.3408702611923218e-02 + <_> + + 0 -1 5488 2.5044390931725502e-03 + + -1.2900459766387939e-01 5.8973610401153564e-02 + <_> + + 0 -1 5489 2.1939110010862350e-03 + + 1.4937159419059753e-01 -7.9897291958332062e-02 + <_> + + 0 -1 5490 -4.6443499624729156e-02 + + -4.4332349300384521e-01 2.0691359415650368e-02 + <_> + + 0 -1 5491 -3.8867309689521790e-02 + + -5.3450870513916016e-01 2.1435650065541267e-02 + <_> + + 0 -1 5492 -2.0838780328631401e-03 + + 5.3876239806413651e-02 -1.6674530506134033e-01 + <_> + + 0 -1 5493 -1.7784969881176949e-02 + + 2.5898349285125732e-01 -6.5794423222541809e-02 + <_> + + 0 -1 5494 -9.9478460848331451e-02 + + -7.2332090139389038e-01 6.1601991765201092e-03 + <_> + + 0 -1 5495 -2.5733250658959150e-03 + + 7.2027653455734253e-02 -1.7522309720516205e-01 + <_> + + 0 -1 5496 6.9977439939975739e-02 + + -3.0238330364227295e-02 3.9809378981590271e-01 + <_> + + 0 -1 5497 -1.0880780406296253e-02 + + -3.0606269836425781e-01 4.5210558921098709e-02 + <_> + + 0 -1 5498 4.8081401735544205e-02 + + 4.3911099433898926e-02 -2.5686219334602356e-01 + <_> + + 0 -1 5499 7.9688243567943573e-02 + + -3.3741600811481476e-02 3.6532700061798096e-01 + <_> + + 0 -1 5500 -1.5404020436108112e-02 + + -1.7731459438800812e-01 2.3800730705261230e-02 + <_> + + 0 -1 5501 -3.6643899977207184e-02 + + -6.3931107521057129e-01 1.7518630251288414e-02 + <_> + + 0 -1 5502 -1.3072500005364418e-02 + + -2.4119360744953156e-01 5.8876950293779373e-02 + <_> + + 0 -1 5503 -2.5379280559718609e-03 + + -2.0509210228919983e-01 5.8915760368108749e-02 + <_> + + 0 -1 5504 4.7491278499364853e-02 + + 2.2842779755592346e-02 -3.9453479647636414e-01 + <_> + + 0 -1 5505 -2.1489640697836876e-02 + + -3.1091120839118958e-01 3.8020871579647064e-02 + <_> + + 0 -1 5506 1.3841330073773861e-02 + + -5.6039519608020782e-02 2.1308979392051697e-01 + <_> + + 0 -1 5507 4.9399589188396931e-03 + + -1.8838630616664886e-01 6.2171839177608490e-02 + <_> + + 0 -1 5508 1.3483439572155476e-02 + + 3.6875329911708832e-02 -2.4952369928359985e-01 + <_> + + 0 -1 5509 -8.4225656464695930e-03 + + 7.1501091122627258e-02 -1.3996620476245880e-01 + <_> + + 0 -1 5510 -4.3786991387605667e-02 + + 2.0128419995307922e-01 -5.3744260221719742e-02 + <_> + + 0 -1 5511 -1.0068439878523350e-02 + + -1.6707019507884979e-01 6.1345089226961136e-02 + <_> + + 0 -1 5512 2.4383061099797487e-03 + + -1.2105459719896317e-01 4.9807701259851456e-02 + <_> + + 0 -1 5513 3.2083820551633835e-03 + + -5.6045360863208771e-02 1.7955709993839264e-01 + <_> + + 0 -1 5514 -2.0389519631862640e-02 + + -3.1983590126037598e-01 3.4141618758440018e-02 + <_> + + 0 -1 5515 -2.2914420813322067e-02 + + -3.9454650878906250e-01 2.3838970810174942e-02 + <_> + + 0 -1 5516 1.8566900864243507e-02 + + 3.8432560861110687e-02 -2.2991999983787537e-01 + <_> + + 0 -1 5517 -1.0277030058205128e-02 + + 2.2557449340820312e-01 -4.9223229289054871e-02 + <_> + + 0 -1 5518 -9.7914133220911026e-03 + + 1.9327880442142487e-01 -3.6139059811830521e-02 + <_> + + 0 -1 5519 1.2699839659035206e-02 + + 5.6297991424798965e-02 -2.0981599390506744e-01 + <_> + + 0 -1 5520 3.9867468178272247e-02 + + 9.4982674345374107e-03 -4.7686201333999634e-01 + <_> + + 0 -1 5521 3.3704519271850586e-02 + + 1.8848460167646408e-02 -5.3707981109619141e-01 + <_> + + 0 -1 5522 -3.3695269376039505e-02 + + -2.7003350853919983e-01 3.8956340402364731e-02 + <_> + + 0 -1 5523 2.3961249738931656e-02 + + -9.5000430941581726e-02 1.0282819718122482e-01 + <_> + + 0 -1 5524 8.2990229129791260e-02 + + 3.7828568369150162e-02 -3.0267751216888428e-01 + <_> + + 0 -1 5525 1.6537210345268250e-01 + + 2.3912150412797928e-02 -4.1214409470558167e-01 + <_> + + 0 -1 5526 1.8202569335699081e-02 + + 2.6127459481358528e-02 -6.9227010011672974e-02 + <_> + + 0 -1 5527 -4.5322380959987640e-02 + + -4.4437649846076965e-01 2.1279569715261459e-02 + <_> + + 0 -1 5528 4.7620609402656555e-02 + + -3.4070000052452087e-02 2.1065680682659149e-01 + <_> + + 0 -1 5529 1.0596530046314001e-03 + + 9.8347820341587067e-02 -9.2732593417167664e-02 + <_> + + 0 -1 5530 3.2028049230575562e-02 + + 2.3833949118852615e-02 -4.3276590108871460e-01 + <_> + + 0 -1 5531 -1.3764370232820511e-02 + + -4.1726619005203247e-01 2.1883359178900719e-02 + <_> + + 0 -1 5532 3.6652158945798874e-02 + + -2.6851410046219826e-02 1.0051230341196060e-01 + <_> + + 0 -1 5533 -1.5507760457694530e-02 + + 4.8519268631935120e-01 -2.4900710210204124e-02 + <_> + + 0 -1 5534 7.1460101753473282e-03 + + 5.7906471192836761e-02 -5.1613971590995789e-02 + <_> + + 0 -1 5535 2.4280229583382607e-02 + + -3.7341829389333725e-02 2.9201799631118774e-01 + <_> + + 0 -1 5536 -8.3522319793701172e-02 + + 3.7447971105575562e-01 -3.4602559171617031e-03 + <_> + + 0 -1 5537 3.1485721468925476e-02 + + 2.4092009291052818e-02 -3.9594879746437073e-01 + <_> + + 0 -1 5538 9.4820279628038406e-03 + + -7.3714673519134521e-02 1.3066330552101135e-01 + <_> + + 0 -1 5539 4.0116958320140839e-02 + + 3.0453719198703766e-02 -3.0641159415245056e-01 + <_> + + 0 -1 5540 -5.2815478295087814e-02 + + 4.5792409777641296e-01 -2.3906230926513672e-02 + <_> + + 0 -1 5541 4.6821571886539459e-03 + + -8.8395930826663971e-02 1.2858130037784576e-01 + <_> + + 0 -1 5542 -1.3448280096054077e-01 + + -2.7471750974655151e-01 1.5970310196280479e-02 + <_> + + 0 -1 5543 5.4646627977490425e-03 + + -2.1628439426422119e-01 4.3035320937633514e-02 + <_> + + 0 -1 5544 -3.5996358841657639e-02 + + -4.8524090647697449e-01 1.0563749819993973e-02 + <_> + + 0 -1 5545 2.5235998630523682e-01 + + 9.3745701014995575e-03 -8.8613390922546387e-01 + <_> + + 0 -1 5546 -2.5067269802093506e-02 + + -2.2364640235900879e-01 3.7146601825952530e-02 + <_> + + 0 -1 5547 -1.4150329865515232e-02 + + 3.7856650352478027e-01 -2.7817489579319954e-02 + <_> + + 0 -1 5548 1.0049570351839066e-01 + + 1.1244839988648891e-02 -7.1869522333145142e-01 + <_> + + 0 -1 5549 1.9989080727100372e-02 + + 2.6056809350848198e-02 -3.2147800922393799e-01 + <_> + + 0 -1 5550 -4.9160558730363846e-02 + + -2.3164880275726318e-01 1.6317559406161308e-02 + <_> + + 0 -1 5551 2.2118790075182915e-02 + + -5.0569478422403336e-02 1.7572580277919769e-01 + <_> + + 0 -1 5552 -7.6390360482037067e-03 + + 2.2264319658279419e-01 -4.3685391545295715e-02 + <_> + + 0 -1 5553 -1.6813250258564949e-03 + + 5.5582441389560699e-02 -1.7739319801330566e-01 + <_> + + 0 -1 5554 -1.6619000583887100e-02 + + -2.7812969684600830e-01 1.9737830385565758e-02 + <_> + + 0 -1 5555 -3.2801620662212372e-02 + + -2.3325189948081970e-01 3.6663819104433060e-02 + <_> + + 0 -1 5556 2.4526590108871460e-01 + + -2.9738940298557281e-02 3.1338408589363098e-01 + <_> + + 0 -1 5557 -1.7271770164370537e-02 + + 5.2818918228149414e-01 -1.4151779934763908e-02 + <_> + + 0 -1 5558 2.0111909136176109e-02 + + 2.7173580601811409e-02 -8.3122722804546356e-02 + <_> + + 0 -1 5559 1.6076749190688133e-02 + + 5.6346639990806580e-02 -1.5893140435218811e-01 + <_> + + 0 -1 5560 -1.0179769992828369e-01 + + 6.0448008775711060e-01 -7.6062050648033619e-03 + <_> + + 0 -1 5561 -4.4865649193525314e-02 + + 3.3077031373977661e-01 -2.5329189375042915e-02 + <_> + + 0 -1 5562 2.7094980701804161e-02 + + -6.9251723587512970e-02 1.5350599586963654e-01 + <_> + + 0 -1 5563 -3.7675891071557999e-02 + + -3.1949838995933533e-01 2.9909679666161537e-02 + <_> + + 0 -1 5564 -8.2310457946732640e-04 + + 6.0612969100475311e-02 -1.0531579703092575e-01 + <_> + + 0 -1 5565 5.5686049163341522e-02 + + -4.0920350700616837e-02 2.2959649562835693e-01 + <_> + + 0 -1 5566 -1.6866069927345961e-04 + + -7.7643588185310364e-02 2.9549270868301392e-02 + <_> + + 0 -1 5567 -2.3873209953308105e-02 + + 2.7944079041481018e-01 -3.1888458877801895e-02 + <_> + + 0 -1 5568 -1.5003600157797337e-02 + + 2.5077390670776367e-01 -4.5932788401842117e-02 + <_> + + 0 -1 5569 -1.4522319659590721e-02 + + -1.6453540325164795e-01 5.5180910974740982e-02 + <_> + + 0 -1 5570 -7.4650160968303680e-03 + + -1.2690469622612000e-01 7.1543112397193909e-02 + <_> + + 0 -1 5571 5.4984640330076218e-02 + + -1.3730799779295921e-02 6.5119642019271851e-01 + <_> + + 0 -1 5572 -8.8030762970447540e-02 + + 2.5416490435600281e-01 -1.2233870103955269e-02 + <_> + + 0 -1 5573 -3.6195501685142517e-02 + + -4.4917309284210205e-01 2.1093770861625671e-02 + <_> + + 0 -1 5574 3.7063211202621460e-02 + + -6.6644148901104927e-03 2.4940170347690582e-01 + <_> + + 0 -1 5575 -1.0568380355834961e-02 + + -4.1061571240425110e-01 2.1398089826107025e-02 + <_> + + 0 -1 5576 1.2662780284881592e-01 + + 5.2506178617477417e-03 -3.3240249752998352e-01 + <_> + + 0 -1 5577 -8.7341770995408297e-04 + + 3.2687219977378845e-01 -2.7704829350113869e-02 + <_> + + 0 -1 5578 -1.0967969428747892e-03 + + -2.7710831165313721e-01 3.6352828145027161e-02 + <_> + + 0 -1 5579 -7.9738020896911621e-02 + + -5.8329159021377563e-01 1.4061779715120792e-02 + <_> + + 0 -1 5580 -3.8278030697256327e-03 + + 3.5459451377391815e-02 -1.3996809720993042e-01 + <_> + + 0 -1 5581 2.0333999767899513e-02 + + -2.1421350538730621e-02 5.1610380411148071e-01 + <_> + + 0 -1 5582 7.5564032886177301e-04 + + -1.0803470015525818e-01 3.3538289368152618e-02 + <_> + + 0 -1 5583 1.7855849862098694e-01 + + 9.4842249527573586e-03 -8.1858187913894653e-01 + <_> + + 0 -1 5584 -3.4745071083307266e-02 + + -5.8172190189361572e-01 1.1315549723803997e-02 + <_> + + 0 -1 5585 5.1304209046065807e-03 + + -1.0659860074520111e-01 7.4440896511077881e-02 + <_> + + 0 -1 5586 -3.3936198800802231e-02 + + -4.5997759699821472e-01 1.5264419838786125e-02 + <_> + + 0 -1 5587 -1.0171560570597649e-03 + + 1.0301309823989868e-01 -8.9842960238456726e-02 + <_> + + 0 -1 5588 6.3489019870758057e-02 + + 6.8669100292026997e-03 -7.6022517681121826e-01 + <_> + + 0 -1 5589 2.4077939987182617e-01 + + -2.1571479737758636e-02 4.1113030910491943e-01 + <_> + + 0 -1 5590 -5.1963441073894501e-02 + + -2.8517320752143860e-01 4.0943060070276260e-02 + <_> + + 0 -1 5591 3.6408171057701111e-02 + + -5.0460960716009140e-02 1.6671819984912872e-01 + <_> + + 0 -1 5592 9.6712149679660797e-03 + + -4.8915110528469086e-02 1.8224430084228516e-01 + <_> + + 0 -1 5593 2.2268150001764297e-02 + + 6.1390981078147888e-02 -1.5445849299430847e-01 + <_> + + 0 -1 5594 -7.0929281413555145e-02 + + 5.0010168552398682e-01 -3.9896317757666111e-03 + <_> + + 0 -1 5595 2.0806699467357248e-04 + + -1.4475630223751068e-01 6.3607528805732727e-02 + <_> + + 0 -1 5596 -9.2365043237805367e-03 + + -2.1817289292812347e-01 3.8856260478496552e-02 + <_> + + 0 -1 5597 2.2781990468502045e-02 + + 2.0108619704842567e-02 -3.8452360033988953e-01 + <_> + + 0 -1 5598 -7.0844120346009731e-03 + + -4.8885490745306015e-02 4.6367339789867401e-02 + <_> + + 0 -1 5599 -8.4006279706954956e-02 + + 3.5921669006347656e-01 -2.2461889311671257e-02 + <_> + + 0 -1 5600 -7.0446580648422241e-02 + + -8.8395321369171143e-01 2.9730550013482571e-03 + <_> + + 0 -1 5601 4.8899810761213303e-02 + + 2.3936219513416290e-02 -3.6770141124725342e-01 + <_> + + 0 -1 5602 2.9677329584956169e-02 + + 1.6608120873570442e-02 -2.2972689568996429e-01 + <_> + + 0 -1 5603 2.5721399579197168e-03 + + -3.2572209835052490e-01 2.4146009236574173e-02 + <_> + + 0 -1 5604 1.6117929480969906e-03 + + 2.9355300590395927e-02 -3.7541579455137253e-02 + <_> + + 0 -1 5605 1.7546640709042549e-02 + + -5.0879240036010742e-02 1.5283130109310150e-01 + <_> + + 0 -1 5606 -4.6326398849487305e-02 + + -2.2843320667743683e-01 1.4442530460655689e-02 + <_> + + 0 -1 5607 -3.3205670118331909e-01 + + 7.4457818269729614e-01 -1.0856879875063896e-02 + <_> + + 0 -1 5608 -4.2317830026149750e-02 + + -1.4666019380092621e-01 5.7799231261014938e-02 + <_> + + 0 -1 5609 3.2436659093946218e-03 + + 5.4021451622247696e-02 -1.7029410600662231e-01 + <_> + + 0 -1 5610 -2.0900890231132507e-02 + + -4.0789291262626648e-01 2.5334810838103294e-02 + <_> + + 0 -1 5611 2.0325010642409325e-02 + + 3.3015929162502289e-02 -2.4503390491008759e-01 + <_> + + 0 -1 5612 -4.6341929584741592e-02 + + 1.5976649522781372e-01 -4.1177939623594284e-02 + <_> + + 0 -1 5613 -3.4356329590082169e-02 + + 1.6021409630775452e-01 -6.2500953674316406e-02 + <_> + + 0 -1 5614 2.4465970695018768e-02 + + -3.7487599998712540e-02 2.2807280719280243e-01 + <_> + + 0 -1 5615 -1.8139539286494255e-02 + + -1.5909589827060699e-01 6.0539811849594116e-02 + <_> + + 0 -1 5616 6.4394161105155945e-02 + + 6.6441670060157776e-03 -7.4860227108001709e-01 + <_> + + 0 -1 5617 9.6367759397253394e-04 + + -9.0620808303356171e-02 9.4118133187294006e-02 + <_> + + 0 -1 5618 2.0024490356445312e-01 + + 5.9731658548116684e-03 -8.2521688938140869e-01 + <_> + + 0 -1 5619 -6.3498668372631073e-02 + + -6.9635838270187378e-01 9.3487137928605080e-03 + <_> + + 0 -1 5620 -1.9232399761676788e-02 + + 1.1236680299043655e-01 -2.9199739918112755e-02 + <_> + + 0 -1 5621 2.5418749451637268e-01 + + 1.3959039933979511e-02 -5.1584947109222412e-01 + <_> + + 0 -1 5622 1.0437460243701935e-01 + + -2.7743030339479446e-02 2.7373430132865906e-01 + <_> + + 0 -1 5623 8.5034370422363281e-03 + + 5.4144650697708130e-02 -1.3029509782791138e-01 + <_> + + 0 -1 5624 5.2647730335593224e-03 + + -4.8077501356601715e-02 1.0371380299329758e-01 + <_> + + 0 -1 5625 -2.4193519726395607e-02 + + 1.9932989776134491e-01 -3.7111040204763412e-02 + <_> + + 0 -1 5626 -4.6968772076070309e-03 + + -6.5797090530395508e-02 3.3837348222732544e-02 + <_> + + 0 -1 5627 -2.3464579135179520e-02 + + -2.6043030619621277e-01 3.0933089554309845e-02 + <_> + + 0 -1 5628 -2.9029840603470802e-02 + + 2.0683619379997253e-01 -2.7628650888800621e-02 + <_> + + 0 -1 5629 7.9100236296653748e-02 + + 7.7356752008199692e-03 -9.1816711425781250e-01 + <_> + + 0 -1 5630 6.2152887694537640e-03 + + -7.3988027870655060e-02 8.7727412581443787e-02 + <_> + + 0 -1 5631 -6.7013278603553772e-02 + + 3.7628298997879028e-01 -2.0892709493637085e-02 + <_> + + 0 -1 5632 -7.9359989613294601e-03 + + -8.9532703161239624e-02 6.6559307277202606e-02 + <_> + + 0 -1 5633 1.3035970041528344e-03 + + -6.6657140851020813e-02 1.1399099975824356e-01 + <_> + + 0 -1 5634 -1.1964319646358490e-01 + + -6.0656189918518066e-01 7.3508038185536861e-03 + <_> + + 0 -1 5635 -2.2869240492582321e-03 + + 7.3336817324161530e-02 -1.1889570206403732e-01 + <_> + + 0 -1 5636 -1.1462569981813431e-01 + + 2.9288530349731445e-01 -6.7763519473373890e-03 + <_> + + 0 -1 5637 4.8477489501237869e-02 + + -1.7062950879335403e-02 4.2953211069107056e-01 + <_> + + 0 -1 5638 -1.3129960279911757e-03 + + -7.4319638311862946e-02 6.2149789184331894e-02 + <_> + + 0 -1 5639 -6.6344782710075378e-02 + + -5.8945667743682861e-01 1.3225819915533066e-02 + <_> + + 0 -1 5640 -4.6543189091607928e-04 + + 5.7886548340320587e-02 -6.4295299351215363e-02 + <_> + + 0 -1 5641 -1.3286540284752846e-02 + + 1.4123329520225525e-01 -6.1506468802690506e-02 + <_> + + 0 -1 5642 7.3928399942815304e-03 + + -7.2719991207122803e-02 4.2179141193628311e-02 + <_> + + 0 -1 5643 -4.7434169799089432e-02 + + 3.2672271132469177e-01 -2.9001530259847641e-02 + <_> + + 0 -1 5644 1.3546790182590485e-01 + + 1.0393570177257061e-02 -4.5354479551315308e-01 + <_> + + 0 -1 5645 -2.5216810405254364e-02 + + -1.9075979292392731e-01 4.1522741317749023e-02 + <_> + + 0 -1 5646 -4.9431398510932922e-02 + + -9.4192171096801758e-01 3.5473550669848919e-03 + <_> + + 0 -1 5647 -4.8375181853771210e-02 + + -8.3028668165206909e-01 7.2369067929685116e-03 + <_> + + 0 -1 5648 -1.4348509721457958e-02 + + -2.1860499680042267e-01 3.1486429274082184e-02 + <_> + + 0 -1 5649 -5.5373171344399452e-03 + + -2.1521030366420746e-01 4.4235888868570328e-02 + <_> + + 0 -1 5650 2.1771800518035889e-01 + + -5.0501842051744461e-03 4.9025520682334900e-01 + <_> + + 0 -1 5651 1.7441399395465851e-01 + + -9.7074145451188087e-03 7.4196231365203857e-01 + <_> + + 0 -1 5652 8.8840499520301819e-02 + + -5.8005251921713352e-03 3.3403220772743225e-01 + <_> + + 0 -1 5653 -3.8012791424989700e-02 + + 5.0677591562271118e-01 -1.3809430412948132e-02 + <_> + + 0 -1 5654 -6.3611388206481934e-02 + + -5.6696820259094238e-01 7.9266652464866638e-03 + <_> + + 0 -1 5655 9.8358482122421265e-02 + + 3.4634899348020554e-02 -1.9651760160923004e-01 + <_> + + 0 -1 5656 2.2929610684514046e-02 + + -4.4682640582323074e-02 6.0062419623136520e-02 + <_> + + 0 -1 5657 -3.9763651788234711e-02 + + -2.8310349583625793e-01 2.6087069883942604e-02 + <_> + + 0 -1 5658 1.1215689778327942e-01 + + -4.3225709348917007e-02 1.5505640208721161e-01 + <_> + + 0 -1 5659 -1.4957940578460693e-01 + + 4.1476088762283325e-01 -2.5112669914960861e-02 + <_> + + 0 -1 5660 1.4239370357245207e-03 + + -2.2813330590724945e-01 2.2414619103074074e-02 + <_> + + 0 -1 5661 -1.1346139945089817e-02 + + -2.6083931326866150e-01 2.6456480845808983e-02 + <_> + + 0 -1 5662 -9.0518407523632050e-02 + + 6.0067182779312134e-01 -1.2559159658849239e-02 + <_> + + 0 -1 5663 3.6097481846809387e-02 + + 1.9451009109616280e-02 -4.0998241305351257e-01 + <_> + + 0 -1 5664 -2.5657469406723976e-02 + + 2.3453080654144287e-01 -3.2354518771171570e-02 + <_> + + 0 -1 5665 -9.2462729662656784e-03 + + 1.4458569884300232e-01 -5.7280141860246658e-02 + <_> + + 0 -1 5666 6.1006739735603333e-02 + + 1.9963319599628448e-01 -3.5018790513277054e-02 + <_> + + 0 -1 5667 -2.2736669052392244e-03 + + -2.7180460095405579e-01 3.5324309021234512e-02 + <_> + + 0 -1 5668 -1.1173350363969803e-01 + + 2.6010888814926147e-01 -8.4183625876903534e-03 + <_> + + 0 -1 5669 1.4601589739322662e-01 + + -4.3707858771085739e-02 1.9343809783458710e-01 + <_> + + 0 -1 5670 -3.9008598774671555e-02 + + -2.4021549522876740e-01 1.9324809312820435e-02 + <_> + + 0 -1 5671 -3.2065149396657944e-02 + + -1.4616030454635620e-01 5.0410438328981400e-02 + <_> + + 0 -1 5672 -3.9755292236804962e-03 + + 8.6786061525344849e-02 -7.5101003050804138e-02 + <_> + + 0 -1 5673 -2.2264609113335609e-02 + + -1.7820209264755249e-01 4.2221881449222565e-02 + <_> + + 0 -1 5674 -6.0096651315689087e-02 + + 3.3062270283699036e-01 -1.3347219675779343e-02 + <_> + + 0 -1 5675 -8.3170406520366669e-02 + + 6.9863271713256836e-01 -1.1014309711754322e-02 + <_> + + 0 -1 5676 -7.7182397246360779e-02 + + -2.5630331039428711e-01 8.8049499318003654e-03 + <_> + + 0 -1 5677 6.8902172148227692e-02 + + 1.0996440425515175e-02 -6.3520067930221558e-01 + <_> + + 0 -1 5678 -5.0353281199932098e-02 + + 2.2927890717983246e-01 -3.2763719558715820e-02 + <_> + + 0 -1 5679 2.4320879019796848e-03 + + -1.3213059306144714e-01 7.1088582277297974e-02 + <_> + + 0 -1 5680 -1.4196460135281086e-02 + + 7.1845069527626038e-02 -4.5263659209012985e-02 + <_> + + 0 -1 5681 -4.5774779282510281e-03 + + -2.5832280516624451e-01 2.9419040307402611e-02 + <_> + + 0 -1 5682 -1.4008210273459554e-03 + + 4.4636521488428116e-02 -1.2310150265693665e-01 + <_> + + 0 -1 5683 3.5062711685895920e-02 + + -1.8722500652074814e-02 4.5533668994903564e-01 + <_> + + 0 -1 5684 3.9364919066429138e-02 + + -3.8776830770075321e-03 4.8229390382766724e-01 + <_> + + 0 -1 5685 2.9430290684103966e-02 + + -5.6632690131664276e-02 1.3604450225830078e-01 + <_> + + 0 -1 5686 7.9320840537548065e-02 + + -4.0827351622283459e-03 9.9998551607131958e-01 + <_> + + 0 -1 5687 4.2696330696344376e-02 + + 2.3583339527249336e-02 -3.7798878550529480e-01 + <_> + + 0 -1 5688 2.5937719270586967e-02 + + 5.0283338874578476e-02 -6.7249342799186707e-02 + <_> + + 0 -1 5689 2.7053659781813622e-02 + + 1.0406839847564697e-01 -1.0069710016250610e-01 + <_> + + 0 -1 5690 3.0322301387786865e-01 + + -5.1615409553050995e-02 1.2398669868707657e-01 + <_> + + 0 -1 5691 7.4373193085193634e-02 + + -2.9979649931192398e-02 2.5944980978965759e-01 + <_> + + 0 -1 5692 4.6059768646955490e-02 + + 6.1678960919380188e-03 -7.0887911319732666e-01 + <_> + + 0 -1 5693 3.6883510649204254e-02 + + 1.5985019505023956e-02 -4.4436019659042358e-01 + <_> + + 0 -1 5694 1.3493379950523376e-01 + + 8.8313389569520950e-03 -7.3426938056945801e-01 + <_> + + 0 -1 5695 1.4799199998378754e-01 + + 6.9719799794256687e-03 -8.2078450918197632e-01 + <_> + + 0 -1 5696 3.9690379053354263e-02 + + -1.8247799947857857e-02 2.6955920457839966e-01 + <_> + + 0 -1 5697 -5.3511280566453934e-02 + + 2.0000250637531281e-01 -3.9136700332164764e-02 + <_> + + 0 -1 5698 6.3795700669288635e-02 + + 1.1616130359470844e-02 -2.5315120816230774e-01 + <_> + + 0 -1 5699 -8.1078916788101196e-02 + + -7.7582788467407227e-01 9.7084697335958481e-03 + <_> + + 0 -1 5700 -4.8272658139467239e-02 + + -3.0734309554100037e-01 1.1298010125756264e-02 + <_> + + 0 -1 5701 4.3912570923566818e-02 + + -3.9403300732374191e-02 1.9216950237751007e-01 + <_> + 394 + -1.2940989732742310e+00 + + <_> + + 0 -1 5702 1.9188739359378815e-02 + + -2.1150399744510651e-01 1.3286529481410980e-01 + <_> + + 0 -1 5703 -8.1222038716077805e-03 + + 9.2491082847118378e-02 -1.7585119605064392e-01 + <_> + + 0 -1 5704 1.5851219650357962e-03 + + -2.8565698862075806e-01 6.6710568964481354e-02 + <_> + + 0 -1 5705 -4.3140850029885769e-03 + + -1.3885229825973511e-01 5.2694689482450485e-02 + <_> + + 0 -1 5706 -1.7131429631263018e-03 + + 1.3135610520839691e-01 -1.3149109482765198e-01 + <_> + + 0 -1 5707 6.8447366356849670e-02 + + 9.3052154406905174e-03 -2.5063261389732361e-01 + <_> + + 0 -1 5708 -2.4445978924632072e-03 + + -1.7205530405044556e-01 9.8322823643684387e-02 + <_> + + 0 -1 5709 1.0310600046068430e-03 + + 2.3039160296320915e-02 -2.7527621388435364e-01 + <_> + + 0 -1 5710 7.4603251414373517e-04 + + -2.3276780545711517e-01 5.2693009376525879e-02 + <_> + + 0 -1 5711 -6.6399492789059877e-04 + + 6.8990781903266907e-02 -8.4687709808349609e-02 + <_> + + 0 -1 5712 -4.0997468749992549e-04 + + 1.0501380264759064e-01 -1.0819009691476822e-01 + <_> + + 0 -1 5713 -1.8094549886882305e-03 + + -1.8178839981555939e-01 4.4184140861034393e-02 + <_> + + 0 -1 5714 9.3385757645592093e-04 + + -1.4622689783573151e-01 7.2726443409919739e-02 + <_> + + 0 -1 5715 -3.8197741378098726e-04 + + 2.4009939283132553e-02 -1.7295800149440765e-01 + <_> + + 0 -1 5716 -1.4950280310586095e-03 + + -1.9403380155563354e-01 4.8807919025421143e-02 + <_> + + 0 -1 5717 -1.0159100405871868e-02 + + 1.9173899292945862e-01 -5.2749071270227432e-02 + <_> + + 0 -1 5718 5.9903519286308438e-05 + + -1.0791549831628799e-01 9.0988166630268097e-02 + <_> + + 0 -1 5719 -3.1967550516128540e-02 + + 4.1109889745712280e-01 -2.2650640457868576e-02 + <_> + + 0 -1 5720 1.4343270100653172e-02 + + 2.4315539747476578e-02 -4.2680150270462036e-01 + <_> + + 0 -1 5721 1.1039529927074909e-02 + + -6.2717013061046600e-02 1.1330530047416687e-01 + <_> + + 0 -1 5722 -8.4228850901126862e-03 + + -2.1369309723377228e-01 4.2059201747179031e-02 + <_> + + 0 -1 5723 -2.0549839362502098e-02 + + 1.5161630511283875e-01 -2.4594139307737350e-02 + <_> + + 0 -1 5724 -6.5411031246185303e-03 + + 1.4883629977703094e-01 -6.1179339885711670e-02 + <_> + + 0 -1 5725 -1.3324400410056114e-02 + + -2.0791970193386078e-01 4.8333309590816498e-02 + <_> + + 0 -1 5726 7.0111267268657684e-02 + + -2.6863219216465950e-02 3.6322259902954102e-01 + <_> + + 0 -1 5727 -2.6973750209435821e-04 + + 6.0876660048961639e-02 -1.1272370070219040e-01 + <_> + + 0 -1 5728 -1.3509000418707728e-03 + + -1.8552079796791077e-01 5.2154958248138428e-02 + <_> + + 0 -1 5729 -2.8083190321922302e-02 + + 3.5111880302429199e-01 -2.3596329614520073e-02 + <_> + + 0 -1 5730 -1.0003290139138699e-02 + + -2.9058480262756348e-01 3.2125689089298248e-02 + <_> + + 0 -1 5731 -1.6111029544845223e-03 + + 9.8113670945167542e-02 -5.2203711122274399e-02 + <_> + + 0 -1 5732 -1.8411900848150253e-02 + + -1.8082669377326965e-01 5.4536700248718262e-02 + <_> + + 0 -1 5733 -7.1738816797733307e-02 + + -7.6654988527297974e-01 3.3518690615892410e-03 + <_> + + 0 -1 5734 -2.7943260502070189e-03 + + 1.5871369838714600e-01 -6.4271800220012665e-02 + <_> + + 0 -1 5735 -1.6874749958515167e-01 + + -6.9956189393997192e-01 4.8861699178814888e-03 + <_> + + 0 -1 5736 -1.2672400334849954e-03 + + 3.1616039574146271e-02 -2.4953269958496094e-01 + <_> + + 0 -1 5737 2.0807750523090363e-02 + + 1.7053410410881042e-02 -2.4331410229206085e-01 + <_> + + 0 -1 5738 -1.5869849594309926e-03 + + 9.3171089887619019e-02 -8.1361927092075348e-02 + <_> + + 0 -1 5739 -1.0014690458774567e-02 + + -2.7789619565010071e-01 2.6569239795207977e-02 + <_> + + 0 -1 5740 -5.7948171161115170e-03 + + -2.2287739813327789e-01 3.5975661128759384e-02 + <_> + + 0 -1 5741 2.7189950924366713e-03 + + -9.0631909668445587e-02 5.6820400059223175e-02 + <_> + + 0 -1 5742 3.8845159113407135e-02 + + 1.2280859984457493e-02 -5.8521348237991333e-01 + <_> + + 0 -1 5743 -1.4158680103719234e-02 + + 1.8153870105743408e-01 -3.1109429895877838e-02 + <_> + + 0 -1 5744 -1.8278600275516510e-01 + + -9.0013808012008667e-01 7.6544750481843948e-03 + <_> + + 0 -1 5745 2.7588419616222382e-02 + + -1.2460039928555489e-02 2.0069369673728943e-01 + <_> + + 0 -1 5746 -1.4784430153667927e-02 + + -8.9910492300987244e-02 8.1648677587509155e-02 + <_> + + 0 -1 5747 1.1625719815492630e-01 + + 2.3692469112575054e-03 -9.9998068809509277e-01 + <_> + + 0 -1 5748 3.5341090988367796e-03 + + -6.1760541051626205e-02 1.3490639626979828e-01 + <_> + + 0 -1 5749 5.1878788508474827e-03 + + 1.8745860084891319e-02 -1.7449170351028442e-01 + <_> + + 0 -1 5750 7.9457357525825500e-02 + + -2.3402990773320198e-02 3.3502200245857239e-01 + <_> + + 0 -1 5751 2.7684379369020462e-02 + + 2.3663910105824471e-02 -3.3256360888481140e-01 + <_> + + 0 -1 5752 -4.4806320220232010e-03 + + -1.4658750593662262e-01 4.7376811504364014e-02 + <_> + + 0 -1 5753 5.6939688511192799e-03 + + -5.6776121258735657e-02 6.7580856382846832e-02 + <_> + + 0 -1 5754 7.7299480326473713e-03 + + -3.1156649813055992e-02 2.3102590441703796e-01 + <_> + + 0 -1 5755 3.9786100387573242e-03 + + -5.6882441043853760e-02 1.3271529972553253e-01 + <_> + + 0 -1 5756 -1.1275880038738251e-02 + + -2.0938649773597717e-01 3.5291459411382675e-02 + <_> + + 0 -1 5757 -2.4308220017701387e-03 + + -2.0176360011100769e-01 3.4513931721448898e-02 + <_> + + 0 -1 5758 5.7369591668248177e-03 + + -5.5607158690690994e-02 1.1532089859247208e-01 + <_> + + 0 -1 5759 4.6170800924301147e-03 + + -5.6083500385284424e-02 8.1762917339801788e-02 + <_> + + 0 -1 5760 -4.7089671716094017e-03 + + -1.3351219892501831e-01 5.6296080350875854e-02 + <_> + + 0 -1 5761 -3.2688070088624954e-02 + + 2.7922388911247253e-01 -1.0867659933865070e-02 + <_> + + 0 -1 5762 8.8686197996139526e-02 + + 1.8268220126628876e-02 -3.5637390613555908e-01 + <_> + + 0 -1 5763 4.5751677826046944e-03 + + -5.1558461040258408e-02 6.3948810100555420e-02 + <_> + + 0 -1 5764 4.9765850417315960e-03 + + -5.4684590548276901e-02 1.1907110363245010e-01 + <_> + + 0 -1 5765 -6.4881290309131145e-03 + + -9.9121123552322388e-02 2.6508849114179611e-02 + <_> + + 0 -1 5766 2.4523450993001461e-03 + + -9.5045946538448334e-02 6.6802926361560822e-02 + <_> + + 0 -1 5767 7.0354789495468140e-03 + + 1.0705590248107910e-01 -6.2395099550485611e-02 + <_> + + 0 -1 5768 4.2746789753437042e-02 + + -1.6092179343104362e-02 4.3256199359893799e-01 + <_> + + 0 -1 5769 -4.5301730278879404e-04 + + 3.6420568823814392e-02 -9.9322892725467682e-02 + <_> + + 0 -1 5770 -5.2631930448114872e-03 + + -1.1416749656200409e-01 5.7260219007730484e-02 + <_> + + 0 -1 5771 1.0581909446045756e-03 + + 3.3220488578081131e-02 -1.1831220239400864e-01 + <_> + + 0 -1 5772 2.5088949128985405e-02 + + -6.0655020177364349e-02 1.2601740658283234e-01 + <_> + + 0 -1 5773 2.4252159893512726e-01 + + 2.2060840856283903e-03 -1.0000120401382446e+00 + <_> + + 0 -1 5774 -1.4393079280853271e-01 + + 3.7419798970222473e-01 -2.2252110764384270e-02 + <_> + + 0 -1 5775 -6.0972762294113636e-03 + + -1.1038099974393845e-01 4.5996960252523422e-02 + <_> + + 0 -1 5776 6.1375470831990242e-03 + + 3.8307808339595795e-02 -1.8086770176887512e-01 + <_> + + 0 -1 5777 -3.6617079749703407e-03 + + 3.8439918309450150e-02 -6.2540791928768158e-02 + <_> + + 0 -1 5778 -1.5854850411415100e-01 + + 3.4469398856163025e-01 -1.9837500527501106e-02 + <_> + + 0 -1 5779 6.7219287157058716e-02 + + 9.5165139064192772e-03 -5.0206458568572998e-01 + <_> + + 0 -1 5780 2.2499680053442717e-03 + + -1.3063929975032806e-01 6.4832933247089386e-02 + <_> + + 0 -1 5781 8.4626786410808563e-02 + + 5.9339799918234348e-03 -4.1516590118408203e-01 + <_> + + 0 -1 5782 -9.5411221263930202e-04 + + -9.3790747225284576e-02 7.5486607849597931e-02 + <_> + + 0 -1 5783 -7.6813949272036552e-03 + + -1.4821960031986237e-01 2.9010580852627754e-02 + <_> + + 0 -1 5784 -2.5593319907784462e-02 + + 1.4859579503536224e-01 -4.7195930033922195e-02 + <_> + + 0 -1 5785 2.1508369594812393e-02 + + 2.3782620206475258e-02 -9.6659287810325623e-02 + <_> + + 0 -1 5786 3.4463100135326385e-02 + + -3.7410069257020950e-02 2.2015300393104553e-01 + <_> + + 0 -1 5787 -3.7860300391912460e-02 + + -5.0047469139099121e-01 1.4059869572520256e-02 + <_> + + 0 -1 5788 1.2028450146317482e-03 + + -6.5087057650089264e-02 8.9583486318588257e-02 + <_> + + 0 -1 5789 1.6753520816564560e-02 + + 4.9179811030626297e-03 -4.3030908703804016e-01 + <_> + + 0 -1 5790 1.6640779795125127e-03 + + 4.0807429701089859e-02 -1.4469960331916809e-01 + <_> + + 0 -1 5791 3.4473428968340158e-03 + + -3.9910178631544113e-02 1.5272960066795349e-01 + <_> + + 0 -1 5792 8.9918142184615135e-03 + + 7.1071267127990723e-02 -8.6169913411140442e-02 + <_> + + 0 -1 5793 8.3185202674940228e-04 + + -2.5739189982414246e-01 1.7941089347004890e-02 + <_> + + 0 -1 5794 -6.8142730742692947e-03 + + 1.3823160529136658e-01 -5.3994540125131607e-02 + <_> + + 0 -1 5795 2.9746210202574730e-03 + + -4.1550260037183762e-02 3.9839770644903183e-02 + <_> + + 0 -1 5796 2.5836620479822159e-03 + + -7.0656493306159973e-02 9.5045506954193115e-02 + <_> + + 0 -1 5797 2.7143809711560607e-04 + + 5.8070071041584015e-02 -1.2781760096549988e-01 + <_> + + 0 -1 5798 3.5418298840522766e-01 + + 5.4909070022404194e-03 -9.7960698604583740e-01 + <_> + + 0 -1 5799 2.5318650528788567e-02 + + -1.4410969801247120e-02 2.6219129562377930e-01 + <_> + + 0 -1 5800 -2.2658439411316067e-04 + + 5.2997849881649017e-02 -1.1629349738359451e-01 + <_> + + 0 -1 5801 6.8859090097248554e-03 + + 1.6437310725450516e-02 -2.0349490642547607e-01 + <_> + + 0 -1 5802 1.1607459746301174e-02 + + -3.6651011556386948e-02 1.5184010565280914e-01 + <_> + + 0 -1 5803 -4.8253959976136684e-03 + + -2.3476150631904602e-01 3.7914011627435684e-02 + <_> + + 0 -1 5804 2.5656020734459162e-03 + + 3.5185638815164566e-02 -1.8540710210800171e-01 + <_> + + 0 -1 5805 1.2601399421691895e-01 + + -9.8542850464582443e-03 2.5520691275596619e-01 + <_> + + 0 -1 5806 2.7164958883076906e-03 + + -2.1748440340161324e-02 2.5467529892921448e-01 + <_> + + 0 -1 5807 3.2356029748916626e-01 + + 8.8657345622777939e-03 -7.0383572578430176e-01 + <_> + + 0 -1 5808 -8.4016058826819062e-04 + + 3.6831360310316086e-02 -1.4953260123729706e-01 + <_> + + 0 -1 5809 3.3291990403085947e-03 + + 4.8185840249061584e-02 -1.2290470302104950e-01 + <_> + + 0 -1 5810 2.1130539476871490e-01 + + 6.5245870500802994e-03 -8.8293862342834473e-01 + <_> + + 0 -1 5811 5.0388509407639503e-03 + + -6.7079946398735046e-02 3.7849709391593933e-02 + <_> + + 0 -1 5812 -2.7862399816513062e-02 + + 3.3469489216804504e-01 -1.8816500902175903e-02 + <_> + + 0 -1 5813 3.8636629469692707e-03 + + 4.3644730001688004e-02 -1.7481489479541779e-01 + <_> + + 0 -1 5814 1.0480300337076187e-01 + + -1.5737529844045639e-02 4.2094239592552185e-01 + <_> + + 0 -1 5815 -3.4130848944187164e-03 + + -1.0835570096969604e-01 4.3717790395021439e-02 + <_> + + 0 -1 5816 -4.6396970748901367e-02 + + -7.5680077075958252e-01 8.6701400578022003e-03 + <_> + + 0 -1 5817 5.3708078339695930e-03 + + -4.1797801852226257e-02 1.4824719727039337e-01 + <_> + + 0 -1 5818 -6.1126388609409332e-03 + + 1.8673719465732574e-01 -4.3387491255998611e-02 + <_> + + 0 -1 5819 4.2509321123361588e-02 + + 1.1690679937601089e-02 -4.3740659952163696e-01 + <_> + + 0 -1 5820 1.0473020374774933e-02 + + 4.3143630027770996e-02 -1.5654399991035461e-01 + <_> + + 0 -1 5821 -4.7223959118127823e-02 + + -7.4483537673950195e-01 3.4918629098683596e-03 + <_> + + 0 -1 5822 5.3090360015630722e-02 + + 1.0408150032162666e-02 -5.3499448299407959e-01 + <_> + + 0 -1 5823 -7.0432561915367842e-04 + + 3.3384170383214951e-02 -7.3706030845642090e-02 + <_> + + 0 -1 5824 7.5942431576550007e-03 + + -2.9107049107551575e-02 1.9468860328197479e-01 + <_> + + 0 -1 5825 2.2676989436149597e-02 + + 3.3803820610046387e-02 -2.7627611160278320e-01 + <_> + + 0 -1 5826 6.6533521749079227e-03 + + -2.6578240096569061e-02 2.4283319711685181e-01 + <_> + + 0 -1 5827 3.7712270859628916e-03 + + 2.6554299518465996e-02 -6.4952917397022247e-02 + <_> + + 0 -1 5828 -2.0740530453622341e-03 + + -1.7968970537185669e-01 3.1532160937786102e-02 + <_> + + 0 -1 5829 -1.5632519498467445e-03 + + 5.3109679371118546e-02 -8.7415628135204315e-02 + <_> + + 0 -1 5830 1.2540889903903008e-02 + + -3.4136459231376648e-02 2.2097539901733398e-01 + <_> + + 0 -1 5831 -3.2660199794918299e-03 + + -5.5261608213186264e-02 3.2669559121131897e-02 + <_> + + 0 -1 5832 -8.2185603678226471e-03 + + -1.4478379487991333e-01 5.5743928998708725e-02 + <_> + + 0 -1 5833 -5.5811040103435516e-02 + + 1.7237940430641174e-01 -1.4456519857048988e-02 + <_> + + 0 -1 5834 -1.4723159372806549e-01 + + -8.1392312049865723e-01 7.4356291443109512e-03 + <_> + + 0 -1 5835 -5.8468529023230076e-03 + + -6.9043442606925964e-02 1.9456790760159492e-02 + <_> + + 0 -1 5836 1.9462220370769501e-02 + + -3.5472229123115540e-02 1.6666300594806671e-01 + <_> + + 0 -1 5837 5.8353468775749207e-02 + + 3.0551329255104065e-03 -3.9289128780364990e-01 + <_> + + 0 -1 5838 4.3785829097032547e-02 + + 1.3574630022048950e-02 -4.6152359247207642e-01 + <_> + + 0 -1 5839 -5.1904350519180298e-02 + + 6.3802438974380493e-01 -9.6664745360612869e-03 + <_> + + 0 -1 5840 -7.7811058145016432e-04 + + -9.9303223192691803e-02 5.6094601750373840e-02 + <_> + + 0 -1 5841 4.9657518975436687e-03 + + 4.1419368237257004e-02 -1.1274819821119308e-01 + <_> + + 0 -1 5842 -5.4516079835593700e-03 + + 1.7399060726165771e-01 -4.1147731244564056e-02 + <_> + + 0 -1 5843 5.0428751856088638e-03 + + -4.1255220770835876e-02 1.3794229924678802e-01 + <_> + + 0 -1 5844 -1.6985220136120915e-03 + + -2.2874790430068970e-01 2.5274980813264847e-02 + <_> + + 0 -1 5845 8.2764238119125366e-02 + + 3.3066510222852230e-03 -6.9113439321517944e-01 + <_> + + 0 -1 5846 3.9285849779844284e-03 + + -7.9043358564376831e-02 6.6218852996826172e-02 + <_> + + 0 -1 5847 -3.0601240694522858e-02 + + -2.6517450809478760e-01 1.6467850655317307e-02 + <_> + + 0 -1 5848 -1.9941160455346107e-02 + + 1.5431809425354004e-01 -3.6100689321756363e-02 + <_> + + 0 -1 5849 8.0520063638687134e-02 + + 1.7015919089317322e-02 -3.3448880910873413e-01 + <_> + + 0 -1 5850 7.0323847234249115e-02 + + 1.7122440040111542e-02 -3.3302140235900879e-01 + <_> + + 0 -1 5851 -5.2850939333438873e-02 + + 6.2421400099992752e-02 -1.4690199866890907e-02 + <_> + + 0 -1 5852 -7.1594159817323089e-04 + + -1.1335150152444839e-01 5.2260790020227432e-02 + <_> + + 0 -1 5853 2.1469970047473907e-01 + + 9.9299731664359570e-04 -9.9997580051422119e-01 + <_> + + 0 -1 5854 8.7042592465877533e-02 + + -1.2329760007560253e-02 5.0260668992996216e-01 + <_> + + 0 -1 5855 -5.8731262106448412e-04 + + -9.9346466362476349e-02 5.1705610007047653e-02 + <_> + + 0 -1 5856 -4.4215220957994461e-02 + + -3.9368900656700134e-01 1.3920850120484829e-02 + <_> + + 0 -1 5857 -8.7676227092742920e-02 + + 3.0157440900802612e-01 -6.8702381104230881e-03 + <_> + + 0 -1 5858 -4.8453990370035172e-02 + + 2.5477871298789978e-01 -2.2457750514149666e-02 + <_> + + 0 -1 5859 -2.1567570511251688e-03 + + -1.3562899827957153e-01 3.1725399196147919e-02 + <_> + + 0 -1 5860 3.9050900377333164e-03 + + 4.9100890755653381e-02 -1.1861059814691544e-01 + <_> + + 0 -1 5861 -3.9808028377592564e-03 + + 4.8333909362554550e-02 -5.5897079408168793e-02 + <_> + + 0 -1 5862 2.9744929634034634e-03 + + -6.4802452921867371e-02 9.3583501875400543e-02 + <_> + + 0 -1 5863 2.5875229388475418e-02 + + 1.8487609922885895e-02 -3.3436349034309387e-01 + <_> + + 0 -1 5864 -1.9373580580577254e-03 + + 2.2000649571418762e-01 -2.5404980406165123e-02 + <_> + + 0 -1 5865 -2.0171629264950752e-02 + + -7.8228309750556946e-02 4.5462790876626968e-02 + <_> + + 0 -1 5866 -2.6088140904903412e-02 + + 1.7637069523334503e-01 -4.5097298920154572e-02 + <_> + + 0 -1 5867 -2.6868300512433052e-02 + + -3.2656419277191162e-01 1.7994230613112450e-02 + <_> + + 0 -1 5868 -7.0211151614785194e-04 + + 3.9671998471021652e-02 -1.4533540606498718e-01 + <_> + + 0 -1 5869 8.3507681265473366e-03 + + -2.3051729425787926e-02 1.8850760161876678e-01 + <_> + + 0 -1 5870 4.6823569573462009e-03 + + 2.9996560886502266e-02 -2.0701029896736145e-01 + <_> + + 0 -1 5871 3.3109660726040602e-03 + + 5.6536730378866196e-02 -1.6835589706897736e-01 + <_> + + 0 -1 5872 7.6425541192293167e-03 + + -4.1423950344324112e-02 1.2557519972324371e-01 + <_> + + 0 -1 5873 -2.4713110178709030e-03 + + 7.2156153619289398e-02 -1.0767730325460434e-01 + <_> + + 0 -1 5874 -9.9495360627770424e-03 + + -1.8187619745731354e-01 3.3567231148481369e-02 + <_> + + 0 -1 5875 1.9820800516754389e-03 + + -5.6488718837499619e-02 1.0741490125656128e-01 + <_> + + 0 -1 5876 2.3254439234733582e-02 + + -1.6543349251151085e-02 3.6466678977012634e-01 + <_> + + 0 -1 5877 -5.4177921265363693e-02 + + -1. 3.3418419770896435e-03 + <_> + + 0 -1 5878 6.1567849479615688e-04 + + 4.0159329771995544e-02 -1.6460220515727997e-01 + <_> + + 0 -1 5879 -4.2699510231614113e-03 + + -5.6978620588779449e-02 4.4480901211500168e-02 + <_> + + 0 -1 5880 1.9749389030039310e-03 + + 5.9283681213855743e-02 -1.0791260004043579e-01 + <_> + + 0 -1 5881 -5.8583128266036510e-03 + + 1.3734050095081329e-01 -3.4231521189212799e-02 + <_> + + 0 -1 5882 -7.2995189111679792e-04 + + -1.0075060278177261e-01 5.4733160883188248e-02 + <_> + + 0 -1 5883 -2.9930740594863892e-02 + + 6.3882559537887573e-02 -4.1027020663022995e-02 + <_> + + 0 -1 5884 -5.1738750189542770e-02 + + -7.2713458538055420e-01 7.4993381276726723e-03 + <_> + + 0 -1 5885 2.4021189659833908e-02 + + 7.8491801396012306e-03 -5.5794471502304077e-01 + <_> + + 0 -1 5886 -3.7574321031570435e-03 + + -1.6086879372596741e-01 3.1015990301966667e-02 + <_> + + 0 -1 5887 -6.2635682523250580e-02 + + 9.0577863156795502e-02 -2.9033770784735680e-02 + <_> + + 0 -1 5888 1.9363429397344589e-02 + + -4.9920588731765747e-02 1.2835779786109924e-01 + <_> + + 0 -1 5889 -3.5072889178991318e-02 + + 2.1391840279102325e-01 -8.8168960064649582e-03 + <_> + + 0 -1 5890 -1.3243310153484344e-02 + + 2.3349699378013611e-01 -2.3088019341230392e-02 + <_> + + 0 -1 5891 -3.1290829181671143e-02 + + -6.9495099782943726e-01 9.3020889908075333e-03 + <_> + + 0 -1 5892 7.2391419671475887e-03 + + 2.8485849499702454e-02 -1.8310770392417908e-01 + <_> + + 0 -1 5893 6.6785318776965141e-03 + + -4.9132950603961945e-02 5.4181691259145737e-02 + <_> + + 0 -1 5894 -3.6825571209192276e-02 + + 3.3120208978652954e-01 -2.1359929814934731e-02 + <_> + + 0 -1 5895 -4.5507341623306274e-02 + + -1.2893490493297577e-01 4.9545988440513611e-02 + <_> + + 0 -1 5896 7.7639957889914513e-03 + + -3.6255620419979095e-02 1.5321409702301025e-01 + <_> + + 0 -1 5897 6.0417611151933670e-02 + + 4.5740022324025631e-03 -6.7541092634201050e-01 + <_> + + 0 -1 5898 2.4624960497021675e-03 + + 5.3674161434173584e-02 -1.1326540261507034e-01 + <_> + + 0 -1 5899 7.3594506829977036e-05 + + -3.5648930817842484e-02 2.5458969175815582e-02 + <_> + + 0 -1 5900 -4.0958370082080364e-03 + + 1.5562909841537476e-01 -3.9390601217746735e-02 + <_> + + 0 -1 5901 2.8689370083156973e-05 + + -8.4823302924633026e-02 3.8254238665103912e-02 + <_> + + 0 -1 5902 -4.6220528893172741e-03 + + -1.8994529545307159e-01 3.3508758991956711e-02 + <_> + + 0 -1 5903 -8.5343196988105774e-03 + + 1.1212539672851562e-01 -3.3968489617109299e-02 + <_> + + 0 -1 5904 -5.8803848922252655e-02 + + -5.1244312524795532e-01 1.0789549909532070e-02 + <_> + + 0 -1 5905 6.0719929635524750e-02 + + -1.2555030174553394e-02 2.2509759664535522e-01 + <_> + + 0 -1 5906 1.1038020020350814e-03 + + -9.6294492483139038e-02 5.6727480143308640e-02 + <_> + + 0 -1 5907 -3.8484560791403055e-03 + + 4.0573459118604660e-02 -2.5326859205961227e-02 + <_> + + 0 -1 5908 -1.0771050117909908e-02 + + 8.8735632598400116e-02 -5.5628679692745209e-02 + <_> + + 0 -1 5909 1.2016809545457363e-02 + + 2.3566279560327530e-02 -2.4590580165386200e-01 + <_> + + 0 -1 5910 -1.1656560236588120e-03 + + -3.7417300045490265e-02 1.6503289341926575e-01 + <_> + + 0 -1 5911 3.2137628644704819e-02 + + 1.4245970174670219e-02 -2.6480850577354431e-01 + <_> + + 0 -1 5912 2.3331670090556145e-02 + + -3.5288721323013306e-02 1.8447829782962799e-01 + <_> + + 0 -1 5913 -1.2685320340096951e-02 + + -1.1757309734821320e-01 1.6436910256743431e-02 + <_> + + 0 -1 5914 7.3903938755393028e-05 + + -1.0271479934453964e-01 7.4301436543464661e-02 + <_> + + 0 -1 5915 -1.0925470292568207e-01 + + -8.3165317773818970e-01 5.6438110768795013e-03 + <_> + + 0 -1 5916 -1.3324350118637085e-01 + + 7.7729821205139160e-01 -8.3403270691633224e-03 + <_> + + 0 -1 5917 8.9381448924541473e-04 + + -5.9524301439523697e-02 4.1173089295625687e-02 + <_> + + 0 -1 5918 1.0318649932742119e-02 + + 1.5926430001854897e-02 -3.1637790799140930e-01 + <_> + + 0 -1 5919 -5.2297548390924931e-03 + + -7.1166560053825378e-02 3.3489290624856949e-02 + <_> + + 0 -1 5920 1.6409620642662048e-02 + + -2.6454120874404907e-02 1.9589969515800476e-01 + <_> + + 0 -1 5921 1.4068709686398506e-02 + + -3.9364140480756760e-02 1.3977420330047607e-01 + <_> + + 0 -1 5922 6.6486410796642303e-03 + + 6.4070828258991241e-02 -1.0493399947881699e-01 + <_> + + 0 -1 5923 -1.8030619248747826e-02 + + 8.3942912518978119e-02 -1.3399159535765648e-02 + <_> + + 0 -1 5924 -4.4034369289875031e-02 + + -5.5825459957122803e-01 9.7633162513375282e-03 + <_> + + 0 -1 5925 -8.0966893583536148e-03 + + -2.0489789545536041e-01 2.6520200073719025e-02 + <_> + + 0 -1 5926 5.0180461257696152e-03 + + -1.1661209911108017e-01 4.5791670680046082e-02 + <_> + + 0 -1 5927 -1.7064629122614861e-02 + + 2.6282730698585510e-01 -2.0390639081597328e-02 + <_> + + 0 -1 5928 7.1850173175334930e-02 + + -6.9503681734204292e-03 6.7032539844512939e-01 + <_> + + 0 -1 5929 -5.6914370507001877e-02 + + -1.3477900624275208e-01 1.8399080261588097e-02 + <_> + + 0 -1 5930 -3.2365729566663504e-03 + + 6.9673851132392883e-02 -7.2314530611038208e-02 + <_> + + 0 -1 5931 4.1818909347057343e-02 + + 1.1151459999382496e-02 -5.1680111885070801e-01 + <_> + + 0 -1 5932 -6.1106588691473007e-03 + + -1.3163940608501434e-01 4.3796509504318237e-02 + <_> + + 0 -1 5933 -3.5560909658670425e-02 + + 6.8005502223968506e-02 -3.6331020295619965e-02 + <_> + + 0 -1 5934 6.8789169192314148e-02 + + 1.4698959887027740e-02 -3.8212299346923828e-01 + <_> + + 0 -1 5935 -7.8313373029232025e-02 + + 2.0296069979667664e-01 -8.6810020729899406e-03 + <_> + + 0 -1 5936 3.9626220241189003e-03 + + -3.5797890275716782e-02 1.3905510306358337e-01 + <_> + + 0 -1 5937 -3.3874038606882095e-02 + + -2.2253429889678955e-01 7.5455638580024242e-03 + <_> + + 0 -1 5938 -6.4755856990814209e-02 + + 4.7521549463272095e-01 -1.0970680043101311e-02 + <_> + + 0 -1 5939 2.6647940278053284e-02 + + 1.5445309691131115e-02 -2.6785778999328613e-01 + <_> + + 0 -1 5940 -3.0731109902262688e-02 + + -4.7668689489364624e-01 9.6429884433746338e-03 + <_> + + 0 -1 5941 -2.4022700265049934e-02 + + -1.0633960366249084e-01 1.2849040329456329e-02 + <_> + + 0 -1 5942 -1.3036349555477500e-03 + + 7.3524177074432373e-02 -6.8074919283390045e-02 + <_> + + 0 -1 5943 -9.8344050347805023e-03 + + -1.1843550205230713e-01 4.2866699397563934e-02 + <_> + + 0 -1 5944 8.7102197110652924e-02 + + -4.0088258683681488e-02 1.7804540693759918e-01 + <_> + + 0 -1 5945 2.0411569625139236e-02 + + 1.6849989071488380e-02 -3.8953658938407898e-01 + <_> + + 0 -1 5946 9.5875263214111328e-02 + + 5.9905550442636013e-03 -8.1525659561157227e-01 + <_> + + 0 -1 5947 6.4893220551311970e-03 + + -2.4039229378104210e-02 5.3871169686317444e-02 + <_> + + 0 -1 5948 -9.6279237186536193e-04 + + 9.4299189746379852e-02 -6.4436018466949463e-02 + <_> + + 0 -1 5949 -3.7659960798919201e-04 + + -6.2296878546476364e-02 4.1251849383115768e-02 + <_> + + 0 -1 5950 6.5272641368210316e-03 + + 5.1325131207704544e-02 -1.3037790358066559e-01 + <_> + + 0 -1 5951 2.1429110318422318e-02 + + -1.1989659629762173e-02 2.6280459761619568e-01 + <_> + + 0 -1 5952 -5.0938720814883709e-03 + + 6.3418947160243988e-02 -9.0566337108612061e-02 + <_> + + 0 -1 5953 -2.5309680495411158e-03 + + 6.0297761112451553e-02 -2.5049470365047455e-02 + <_> + + 0 -1 5954 -1.5915350522845984e-03 + + -1.2171190232038498e-01 3.7737991660833359e-02 + <_> + + 0 -1 5955 -3.4030709415674210e-02 + + 4.6413430571556091e-01 -3.5409750416874886e-03 + <_> + + 0 -1 5956 5.1074200309813023e-03 + + 3.9823830127716064e-02 -1.2645539641380310e-01 + <_> + + 0 -1 5957 -9.6449116244912148e-03 + + 3.3464258909225464e-01 -6.6040740348398685e-03 + <_> + + 0 -1 5958 1.1422860436141491e-02 + + -3.6080420017242432e-02 1.3714550435543060e-01 + <_> + + 0 -1 5959 -5.1042139530181885e-03 + + -9.3986809253692627e-02 2.8844779357314110e-02 + <_> + + 0 -1 5960 -2.6332271099090576e-01 + + 4.9980929493904114e-01 -1.0173249989748001e-02 + <_> + + 0 -1 5961 -2.4556639790534973e-01 + + -8.1778347492218018e-01 6.9596339017152786e-03 + <_> + + 0 -1 5962 -2.1419329941272736e-01 + + -5.1040518283843994e-01 9.4540230929851532e-03 + <_> + + 0 -1 5963 -1.4363219961524010e-02 + + -9.1000981628894806e-02 2.4646669626235962e-02 + <_> + + 0 -1 5964 -1.2388969771564007e-03 + + 1.1544570326805115e-01 -4.9565620720386505e-02 + <_> + + 0 -1 5965 2.1015120670199394e-02 + + -1.7765879631042480e-02 1.9577859342098236e-01 + <_> + + 0 -1 5966 -4.1783051565289497e-03 + + -1.1172860115766525e-01 4.4625449925661087e-02 + <_> + + 0 -1 5967 2.0896939095109701e-03 + + -3.3988729119300842e-02 6.5539501607418060e-02 + <_> + + 0 -1 5968 1.6410060226917267e-02 + + -2.0373269915580750e-02 2.5331538915634155e-01 + <_> + + 0 -1 5969 -6.4266882836818695e-02 + + -6.5880149602890015e-01 3.4550630953162909e-03 + <_> + + 0 -1 5970 6.8898178869858384e-04 + + 6.7643247544765472e-02 -8.7556242942810059e-02 + <_> + + 0 -1 5971 5.6662331335246563e-03 + + 3.0638309195637703e-02 -1.1895540356636047e-01 + <_> + + 0 -1 5972 -4.3778121471405029e-02 + + -2.8309130668640137e-01 1.7713630571961403e-02 + <_> + + 0 -1 5973 3.4748481120914221e-03 + + -9.5787122845649719e-02 4.2630400508642197e-02 + <_> + + 0 -1 5974 -1.1673940345644951e-02 + + -1.0502570122480392e-01 5.0903890281915665e-02 + <_> + + 0 -1 5975 -3.4004659391939640e-03 + + 1.0470719635486603e-01 -4.0939141064882278e-02 + <_> + + 0 -1 5976 2.7091780211776495e-03 + + -6.0524601489305496e-02 1.3978950679302216e-01 + <_> + + 0 -1 5977 -1.7439300194382668e-02 + + -3.2391169667243958e-01 1.4630249701440334e-02 + <_> + + 0 -1 5978 -1.2598330155014992e-02 + + -2.0682629942893982e-01 2.5501869618892670e-02 + <_> + + 0 -1 5979 1.8755869939923286e-02 + + -4.7925960272550583e-02 1.0864380002021790e-01 + <_> + + 0 -1 5980 -4.2074159719049931e-03 + + -8.2077808678150177e-02 6.3647769391536713e-02 + <_> + + 0 -1 5981 -1.6427719674538821e-04 + + 1.0120390355587006e-01 -3.4067928791046143e-02 + <_> + + 0 -1 5982 4.3847691267728806e-02 + + 6.0980222187936306e-03 -8.3685982227325439e-01 + <_> + + 0 -1 5983 -3.9284680038690567e-02 + + 2.8250560164451599e-01 -2.2389259189367294e-02 + <_> + + 0 -1 5984 3.8550909608602524e-02 + + 1.5570489689707756e-02 -3.3978620171546936e-01 + <_> + + 0 -1 5985 -6.9177031517028809e-02 + + 1.2258320301771164e-01 -1.7850179225206375e-02 + <_> + + 0 -1 5986 -1.9251030171290040e-03 + + -1.0687749832868576e-01 4.6379510313272476e-02 + <_> + + 0 -1 5987 -8.6635202169418335e-03 + + 9.6412748098373413e-02 -1.7563249915838242e-02 + <_> + + 0 -1 5988 1.3393509387969971e-01 + + 6.3692941330373287e-03 -7.0170587301254272e-01 + <_> + + 0 -1 5989 4.1082348674535751e-02 + + -1.1077569797635078e-02 1.3463750481605530e-01 + <_> + + 0 -1 5990 1.4911450445652008e-01 + + 9.5263421535491943e-03 -5.0872552394866943e-01 + <_> + + 0 -1 5991 -5.2500818856060505e-03 + + 7.0025578141212463e-02 -4.2880270630121231e-02 + <_> + + 0 -1 5992 2.2823570296168327e-02 + + -4.1884049773216248e-02 1.1770319938659668e-01 + <_> + + 0 -1 5993 -8.5306530818343163e-03 + + 6.1222139745950699e-02 -2.4944549426436424e-02 + <_> + + 0 -1 5994 1.1971729807555676e-02 + + 3.9662770926952362e-02 -1.6267740726470947e-01 + <_> + + 0 -1 5995 -3.8938269019126892e-02 + + 2.5743520259857178e-01 -1.6356239095330238e-02 + <_> + + 0 -1 5996 -2.1706389263272285e-02 + + -3.1998679041862488e-01 1.7135290428996086e-02 + <_> + + 0 -1 5997 6.6900630481541157e-03 + + 2.6101849973201752e-02 -1.0980729758739471e-01 + <_> + + 0 -1 5998 -7.2270832955837250e-02 + + 1.9431130588054657e-01 -2.6044359430670738e-02 + <_> + + 0 -1 5999 -6.7073688842356205e-03 + + -1.7747850716114044e-01 4.5862998813390732e-02 + <_> + + 0 -1 6000 5.5019360035657883e-02 + + -8.3471573889255524e-03 6.0511541366577148e-01 + <_> + + 0 -1 6001 1.3142649829387665e-01 + + -5.7535418309271336e-03 2.9167538881301880e-01 + <_> + + 0 -1 6002 -1.6564460238441825e-03 + + 7.0003032684326172e-02 -6.2690876424312592e-02 + <_> + + 0 -1 6003 1.5445409715175629e-01 + + 6.1896732077002525e-03 -7.4323302507400513e-01 + <_> + + 0 -1 6004 -5.0357519648969173e-03 + + -1.1333289742469788e-01 3.8741771131753922e-02 + <_> + + 0 -1 6005 2.2772569209337234e-03 + + -1.1340530216693878e-01 2.1319400519132614e-02 + <_> + + 0 -1 6006 3.3173530828207731e-03 + + 4.4273331761360168e-02 -1.0459829866886139e-01 + <_> + + 0 -1 6007 -2.9692800715565681e-02 + + 9.2483766376972198e-02 -2.3342609405517578e-02 + <_> + + 0 -1 6008 6.2937840819358826e-02 + + -1.2998280115425587e-02 3.8887938857078552e-01 + <_> + + 0 -1 6009 3.6641359329223633e-03 + + 3.2099820673465729e-02 -3.9647988975048065e-02 + <_> + + 0 -1 6010 4.4782999902963638e-03 + + -4.5701328665018082e-02 1.0697010159492493e-01 + <_> + + 0 -1 6011 1.8147319788113236e-03 + + -3.2871820032596588e-02 1.0647939890623093e-01 + <_> + + 0 -1 6012 4.8941639252007008e-03 + + 2.7911009266972542e-02 -2.1725590527057648e-01 + <_> + + 0 -1 6013 -4.4425828382372856e-03 + + -1.3470150530338287e-01 1.0781410150229931e-02 + <_> + + 0 -1 6014 -2.5493400171399117e-02 + + 6.8371468782424927e-01 -7.7452720142900944e-03 + <_> + + 0 -1 6015 2.7835449203848839e-02 + + 2.4144299328327179e-02 -1.5170599520206451e-01 + <_> + + 0 -1 6016 7.5548859313130379e-03 + + -4.7643400728702545e-02 1.1925770342350006e-01 + <_> + + 0 -1 6017 1.0329609736800194e-02 + + 1.8646810203790665e-02 -1.6122570633888245e-01 + <_> + + 0 -1 6018 -1.2393389828503132e-02 + + 6.0304921865463257e-01 -7.7566630207002163e-03 + <_> + + 0 -1 6019 1.3833769597113132e-02 + + -2.7617299929261208e-02 5.1266878843307495e-02 + <_> + + 0 -1 6020 -2.5669319555163383e-02 + + 2.3801359534263611e-01 -2.3971909657120705e-02 + <_> + + 0 -1 6021 -5.2043660543859005e-03 + + -1.0721790045499802e-01 2.6645049452781677e-02 + <_> + + 0 -1 6022 3.4628969151526690e-03 + + 5.4313410073518753e-02 -1.3458320498466492e-01 + <_> + + 0 -1 6023 -1.9220679998397827e-02 + + 7.2996392846107483e-02 -4.0652111172676086e-02 + <_> + + 0 -1 6024 -2.5009829550981522e-03 + + -7.7671296894550323e-02 5.9096541255712509e-02 + <_> + + 0 -1 6025 -8.5285156965255737e-03 + + 4.9050811678171158e-02 -6.4078353345394135e-02 + <_> + + 0 -1 6026 4.3327538296580315e-03 + + 2.5221010670065880e-02 -1.9358980655670166e-01 + <_> + + 0 -1 6027 3.6595970392227173e-02 + + -1.6262590885162354e-02 1.5651239454746246e-01 + <_> + + 0 -1 6028 -1.1795730097219348e-03 + + -7.2468072175979614e-02 7.0449486374855042e-02 + <_> + + 0 -1 6029 -1.3975829817354679e-02 + + -1.1789470165967941e-01 2.1292049437761307e-02 + <_> + + 0 -1 6030 -1.3828700175508857e-03 + + 7.9283542931079865e-02 -9.5104120671749115e-02 + <_> + + 0 -1 6031 -2.9435830656439066e-03 + + 7.0368431508541107e-02 -3.3217910677194595e-02 + <_> + + 0 -1 6032 9.5262555405497551e-03 + + -2.9733620584011078e-02 1.6670459508895874e-01 + <_> + + 0 -1 6033 -9.0114273130893707e-02 + + -1.6625370085239410e-01 8.6199166253209114e-03 + <_> + + 0 -1 6034 -1.2089919764548540e-03 + + 8.1083856523036957e-02 -7.3029123246669769e-02 + <_> + + 0 -1 6035 -1.4199960231781006e-01 + + -1. 2.2284830920398235e-03 + <_> + + 0 -1 6036 8.0690719187259674e-03 + + 4.7412220388650894e-02 -1.0178930312395096e-01 + <_> + + 0 -1 6037 -4.7410889528691769e-03 + + 1.2051119655370712e-01 -4.9957480281591415e-02 + <_> + + 0 -1 6038 -1.6977200284600258e-03 + + -2.4171440303325653e-01 1.9534369930624962e-02 + <_> + + 0 -1 6039 -2.8892089612782001e-03 + + 2.5727990269660950e-01 -1.1625059880316257e-02 + <_> + + 0 -1 6040 -1.5177440363913774e-03 + + -9.8784193396568298e-02 4.6706128865480423e-02 + <_> + + 0 -1 6041 1.4197319746017456e-01 + + -2.5096370372921228e-03 7.5450611114501953e-01 + <_> + + 0 -1 6042 9.7517937421798706e-02 + + -6.9059049710631371e-03 6.5184432268142700e-01 + <_> + + 0 -1 6043 1.3567379675805569e-02 + + -7.6325193047523499e-02 8.8054582476615906e-02 + <_> + + 0 -1 6044 8.0981463193893433e-02 + + 1.5558109618723392e-02 -3.4601628780364990e-01 + <_> + + 0 -1 6045 -4.7192731872200966e-03 + + 8.1620022654533386e-02 -4.6072289347648621e-02 + <_> + + 0 -1 6046 2.0368969999253750e-03 + + -4.4817630201578140e-02 1.2861390411853790e-01 + <_> + + 0 -1 6047 -1.7878509825095534e-03 + + 4.3731331825256348e-02 -4.4995948672294617e-02 + <_> + + 0 -1 6048 -7.1685528382658958e-03 + + -1.3597999513149261e-01 3.8796991109848022e-02 + <_> + + 0 -1 6049 -6.7460887134075165e-02 + + -2.9265740513801575e-01 3.5135280340909958e-03 + <_> + + 0 -1 6050 -1.5598500147461891e-02 + + 2.3105660080909729e-01 -2.2405069321393967e-02 + <_> + + 0 -1 6051 -2.1026479080319405e-02 + + -1.5283830463886261e-01 3.1531449407339096e-02 + <_> + + 0 -1 6052 -1.0558360069990158e-01 + + -6.8366038799285889e-01 6.8997950293123722e-03 + <_> + + 0 -1 6053 -3.6966579500585794e-03 + + 3.4315150231122971e-02 -4.8922799527645111e-02 + <_> + + 0 -1 6054 -6.0826627304777503e-04 + + -5.2638430148363113e-02 8.9546948671340942e-02 + <_> + + 0 -1 6055 -2.8936540707945824e-02 + + 4.1818480938673019e-02 -1.3818169943988323e-02 + <_> + + 0 -1 6056 -5.8082528412342072e-03 + + 6.7874796688556671e-02 -8.5578799247741699e-02 + <_> + + 0 -1 6057 -4.6095378696918488e-02 + + -1.2584780156612396e-01 2.0466970279812813e-02 + <_> + + 0 -1 6058 5.2972920238971710e-02 + + -1.2453259900212288e-02 3.4565049409866333e-01 + <_> + + 0 -1 6059 4.9351599067449570e-02 + + 1.0901239700615406e-02 -4.8506981134414673e-01 + <_> + + 0 -1 6060 4.4377800077199936e-02 + + 9.9294837564229965e-03 -4.3877899646759033e-01 + <_> + + 0 -1 6061 -1.1464890092611313e-01 + + 2.6874598860740662e-01 -9.2000560835003853e-03 + <_> + + 0 -1 6062 1.6887830197811127e-01 + + 5.7101310230791569e-03 -8.5972881317138672e-01 + <_> + + 0 -1 6063 5.1198098808526993e-02 + + -8.5723921656608582e-03 1.3395169377326965e-01 + <_> + + 0 -1 6064 -3.0789880547672510e-03 + + -1.0338760167360306e-01 4.3459478765726089e-02 + <_> + + 0 -1 6065 4.7223128378391266e-02 + + 8.1934239715337753e-03 -4.3803408741950989e-01 + <_> + + 0 -1 6066 -7.6270569115877151e-03 + + 1.8713890016078949e-01 -2.4660250172019005e-02 + <_> + + 0 -1 6067 5.4106907919049263e-03 + + 4.1099831461906433e-02 -7.8868232667446136e-02 + <_> + + 0 -1 6068 -1.4900229871273041e-03 + + -2.0115040242671967e-01 3.1898159533739090e-02 + <_> + + 0 -1 6069 -8.3831608295440674e-02 + + 5.8017939329147339e-01 -5.2973427809774876e-03 + <_> + + 0 -1 6070 6.2233800999820232e-03 + + -3.9786059409379959e-02 1.2283950299024582e-01 + <_> + + 0 -1 6071 1.1475080251693726e-01 + + -1.1975419707596302e-02 2.1586710214614868e-01 + <_> + + 0 -1 6072 -1.5253260498866439e-03 + + 1.3804529607295990e-01 -3.9941880851984024e-02 + <_> + + 0 -1 6073 -5.2878521382808685e-03 + + -1.2790650129318237e-01 3.2893560826778412e-02 + <_> + + 0 -1 6074 8.9670647867023945e-04 + + -1.2481059879064560e-01 4.4544249773025513e-02 + <_> + + 0 -1 6075 3.8421660661697388e-02 + + 7.7155791223049164e-03 -6.5575468540191650e-01 + <_> + + 0 -1 6076 -9.3785318313166499e-04 + + 5.5608510971069336e-02 -8.9876912534236908e-02 + <_> + + 0 -1 6077 1.9965849351137877e-03 + + -2.5297610089182854e-02 1.9413180649280548e-01 + <_> + + 0 -1 6078 4.5782068627886474e-04 + + 3.9089199155569077e-02 -1.2908570468425751e-01 + <_> + + 0 -1 6079 3.8373940624296665e-03 + + -2.8748869895935059e-02 1.9429750740528107e-01 + <_> + + 0 -1 6080 3.7142829387448728e-04 + + 3.8272358477115631e-02 -1.3759189844131470e-01 + <_> + + 0 -1 6081 7.5116259977221489e-03 + + -1.4461129903793335e-02 1.2656949460506439e-01 + <_> + + 0 -1 6082 -5.0362840294837952e-02 + + 3.5183578729629517e-01 -1.4051860198378563e-02 + <_> + + 0 -1 6083 3.9921641349792480e-02 + + 2.7280429378151894e-02 -1.9958199560642242e-01 + <_> + + 0 -1 6084 2.2605259716510773e-01 + + -6.8001961335539818e-03 7.3006898164749146e-01 + <_> + + 0 -1 6085 1.1081779748201370e-01 + + 4.3370737694203854e-03 -8.6829161643981934e-01 + <_> + + 0 -1 6086 -9.7494889050722122e-03 + + -6.3740663230419159e-02 8.4537997841835022e-02 + <_> + + 0 -1 6087 -2.2887689992785454e-03 + + 9.9654018878936768e-02 -4.1565418243408203e-02 + <_> + + 0 -1 6088 2.0008319988846779e-03 + + -5.5650699883699417e-02 1.0709869861602783e-01 + <_> + + 0 -1 6089 -1.5160050243139267e-02 + + -1.4098760485649109e-01 3.8741599768400192e-02 + <_> + + 0 -1 6090 -6.3132969662547112e-03 + + -1. 4.4605308212339878e-03 + <_> + + 0 -1 6091 -1.3970009982585907e-02 + + 1.2481089681386948e-01 -2.1425830200314522e-02 + <_> + + 0 -1 6092 -4.4321279972791672e-02 + + -5.3340071439743042e-01 1.0165239684283733e-02 + <_> + + 0 -1 6093 1.4885979471728206e-03 + + -4.8868600279092789e-02 3.6077901721000671e-02 + <_> + + 0 -1 6094 6.5139681100845337e-02 + + 7.6331058517098427e-03 -5.8781641721725464e-01 + <_> + + 0 -1 6095 -2.0741410553455353e-02 + + -2.9658278822898865e-01 1.8622800707817078e-02 + <_> + 394 + -1.2940989732742310e+00 + + <_> + + 0 -1 6096 1.9188739359378815e-02 + + -2.1150399744510651e-01 1.3286529481410980e-01 + <_> + + 0 -1 6097 -8.1222038716077805e-03 + + 9.2491082847118378e-02 -1.7585119605064392e-01 + <_> + + 0 -1 6098 1.5851219650357962e-03 + + -2.8565698862075806e-01 6.6710568964481354e-02 + <_> + + 0 -1 6099 -4.3140850029885769e-03 + + -1.3885229825973511e-01 5.2694689482450485e-02 + <_> + + 0 -1 6100 -1.7131429631263018e-03 + + 1.3135610520839691e-01 -1.3149109482765198e-01 + <_> + + 0 -1 6101 6.8447366356849670e-02 + + 9.3052154406905174e-03 -2.5063261389732361e-01 + <_> + + 0 -1 6102 -2.4445978924632072e-03 + + -1.7205530405044556e-01 9.8322823643684387e-02 + <_> + + 0 -1 6103 1.0310600046068430e-03 + + 2.3039160296320915e-02 -2.7527621388435364e-01 + <_> + + 0 -1 6104 7.4603251414373517e-04 + + -2.3276780545711517e-01 5.2693009376525879e-02 + <_> + + 0 -1 6105 -6.6399492789059877e-04 + + 6.8990781903266907e-02 -8.4687709808349609e-02 + <_> + + 0 -1 6106 -4.0997468749992549e-04 + + 1.0501380264759064e-01 -1.0819009691476822e-01 + <_> + + 0 -1 6107 -1.8094549886882305e-03 + + -1.8178839981555939e-01 4.4184140861034393e-02 + <_> + + 0 -1 6108 9.3385757645592093e-04 + + -1.4622689783573151e-01 7.2726443409919739e-02 + <_> + + 0 -1 6109 -3.8197741378098726e-04 + + 2.4009939283132553e-02 -1.7295800149440765e-01 + <_> + + 0 -1 6110 -1.4950280310586095e-03 + + -1.9403380155563354e-01 4.8807919025421143e-02 + <_> + + 0 -1 6111 -1.0159100405871868e-02 + + 1.9173899292945862e-01 -5.2749071270227432e-02 + <_> + + 0 -1 6112 5.9903519286308438e-05 + + -1.0791549831628799e-01 9.0988166630268097e-02 + <_> + + 0 -1 6113 -3.1967550516128540e-02 + + 4.1109889745712280e-01 -2.2650640457868576e-02 + <_> + + 0 -1 6114 1.4343270100653172e-02 + + 2.4315539747476578e-02 -4.2680150270462036e-01 + <_> + + 0 -1 6115 1.1039529927074909e-02 + + -6.2717013061046600e-02 1.1330530047416687e-01 + <_> + + 0 -1 6116 -8.4228850901126862e-03 + + -2.1369309723377228e-01 4.2059201747179031e-02 + <_> + + 0 -1 6117 -2.0549839362502098e-02 + + 1.5161630511283875e-01 -2.4594139307737350e-02 + <_> + + 0 -1 6118 -6.5411031246185303e-03 + + 1.4883629977703094e-01 -6.1179339885711670e-02 + <_> + + 0 -1 6119 -1.3324400410056114e-02 + + -2.0791970193386078e-01 4.8333309590816498e-02 + <_> + + 0 -1 6120 7.0111267268657684e-02 + + -2.6863219216465950e-02 3.6322259902954102e-01 + <_> + + 0 -1 6121 -2.6973750209435821e-04 + + 6.0876660048961639e-02 -1.1272370070219040e-01 + <_> + + 0 -1 6122 -1.3509000418707728e-03 + + -1.8552079796791077e-01 5.2154958248138428e-02 + <_> + + 0 -1 6123 -2.8083190321922302e-02 + + 3.5111880302429199e-01 -2.3596329614520073e-02 + <_> + + 0 -1 6124 -1.0003290139138699e-02 + + -2.9058480262756348e-01 3.2125689089298248e-02 + <_> + + 0 -1 6125 -1.6111029544845223e-03 + + 9.8113670945167542e-02 -5.2203711122274399e-02 + <_> + + 0 -1 6126 -1.8411900848150253e-02 + + -1.8082669377326965e-01 5.4536700248718262e-02 + <_> + + 0 -1 6127 -7.1738816797733307e-02 + + -7.6654988527297974e-01 3.3518690615892410e-03 + <_> + + 0 -1 6128 -2.7943260502070189e-03 + + 1.5871369838714600e-01 -6.4271800220012665e-02 + <_> + + 0 -1 6129 -1.6874749958515167e-01 + + -6.9956189393997192e-01 4.8861699178814888e-03 + <_> + + 0 -1 6130 -1.2672400334849954e-03 + + 3.1616039574146271e-02 -2.4953269958496094e-01 + <_> + + 0 -1 6131 2.0807750523090363e-02 + + 1.7053410410881042e-02 -2.4331410229206085e-01 + <_> + + 0 -1 6132 -1.5869849594309926e-03 + + 9.3171089887619019e-02 -8.1361927092075348e-02 + <_> + + 0 -1 6133 -1.0014690458774567e-02 + + -2.7789619565010071e-01 2.6569239795207977e-02 + <_> + + 0 -1 6134 -5.7948171161115170e-03 + + -2.2287739813327789e-01 3.5975661128759384e-02 + <_> + + 0 -1 6135 2.7189950924366713e-03 + + -9.0631909668445587e-02 5.6820400059223175e-02 + <_> + + 0 -1 6136 3.8845159113407135e-02 + + 1.2280859984457493e-02 -5.8521348237991333e-01 + <_> + + 0 -1 6137 -1.4158680103719234e-02 + + 1.8153870105743408e-01 -3.1109429895877838e-02 + <_> + + 0 -1 6138 -1.8278600275516510e-01 + + -9.0013808012008667e-01 7.6544750481843948e-03 + <_> + + 0 -1 6139 2.7588419616222382e-02 + + -1.2460039928555489e-02 2.0069369673728943e-01 + <_> + + 0 -1 6140 -1.4784430153667927e-02 + + -8.9910492300987244e-02 8.1648677587509155e-02 + <_> + + 0 -1 6141 1.1625719815492630e-01 + + 2.3692469112575054e-03 -9.9998068809509277e-01 + <_> + + 0 -1 6142 3.5341090988367796e-03 + + -6.1760541051626205e-02 1.3490639626979828e-01 + <_> + + 0 -1 6143 5.1878788508474827e-03 + + 1.8745860084891319e-02 -1.7449170351028442e-01 + <_> + + 0 -1 6144 7.9457357525825500e-02 + + -2.3402990773320198e-02 3.3502200245857239e-01 + <_> + + 0 -1 6145 2.7684379369020462e-02 + + 2.3663910105824471e-02 -3.3256360888481140e-01 + <_> + + 0 -1 6146 -4.4806320220232010e-03 + + -1.4658750593662262e-01 4.7376811504364014e-02 + <_> + + 0 -1 6147 5.6939688511192799e-03 + + -5.6776121258735657e-02 6.7580856382846832e-02 + <_> + + 0 -1 6148 7.7299480326473713e-03 + + -3.1156649813055992e-02 2.3102590441703796e-01 + <_> + + 0 -1 6149 3.9786100387573242e-03 + + -5.6882441043853760e-02 1.3271529972553253e-01 + <_> + + 0 -1 6150 -1.1275880038738251e-02 + + -2.0938649773597717e-01 3.5291459411382675e-02 + <_> + + 0 -1 6151 -2.4308220017701387e-03 + + -2.0176360011100769e-01 3.4513931721448898e-02 + <_> + + 0 -1 6152 5.7369591668248177e-03 + + -5.5607158690690994e-02 1.1532089859247208e-01 + <_> + + 0 -1 6153 4.6170800924301147e-03 + + -5.6083500385284424e-02 8.1762917339801788e-02 + <_> + + 0 -1 6154 -4.7089671716094017e-03 + + -1.3351219892501831e-01 5.6296080350875854e-02 + <_> + + 0 -1 6155 -3.2688070088624954e-02 + + 2.7922388911247253e-01 -1.0867659933865070e-02 + <_> + + 0 -1 6156 8.8686197996139526e-02 + + 1.8268220126628876e-02 -3.5637390613555908e-01 + <_> + + 0 -1 6157 4.5751677826046944e-03 + + -5.1558461040258408e-02 6.3948810100555420e-02 + <_> + + 0 -1 6158 4.9765850417315960e-03 + + -5.4684590548276901e-02 1.1907110363245010e-01 + <_> + + 0 -1 6159 -6.4881290309131145e-03 + + -9.9121123552322388e-02 2.6508849114179611e-02 + <_> + + 0 -1 6160 2.4523450993001461e-03 + + -9.5045946538448334e-02 6.6802926361560822e-02 + <_> + + 0 -1 6161 7.0354789495468140e-03 + + 1.0705590248107910e-01 -6.2395099550485611e-02 + <_> + + 0 -1 6162 4.2746789753437042e-02 + + -1.6092179343104362e-02 4.3256199359893799e-01 + <_> + + 0 -1 6163 -4.5301730278879404e-04 + + 3.6420568823814392e-02 -9.9322892725467682e-02 + <_> + + 0 -1 6164 -5.2631930448114872e-03 + + -1.1416749656200409e-01 5.7260219007730484e-02 + <_> + + 0 -1 6165 1.0581909446045756e-03 + + 3.3220488578081131e-02 -1.1831220239400864e-01 + <_> + + 0 -1 6166 2.5088949128985405e-02 + + -6.0655020177364349e-02 1.2601740658283234e-01 + <_> + + 0 -1 6167 2.4252159893512726e-01 + + 2.2060840856283903e-03 -1.0000120401382446e+00 + <_> + + 0 -1 6168 -1.4393079280853271e-01 + + 3.7419798970222473e-01 -2.2252110764384270e-02 + <_> + + 0 -1 6169 -6.0972762294113636e-03 + + -1.1038099974393845e-01 4.5996960252523422e-02 + <_> + + 0 -1 6170 6.1375470831990242e-03 + + 3.8307808339595795e-02 -1.8086770176887512e-01 + <_> + + 0 -1 6171 -3.6617079749703407e-03 + + 3.8439918309450150e-02 -6.2540791928768158e-02 + <_> + + 0 -1 6172 -1.5854850411415100e-01 + + 3.4469398856163025e-01 -1.9837500527501106e-02 + <_> + + 0 -1 6173 6.7219287157058716e-02 + + 9.5165139064192772e-03 -5.0206458568572998e-01 + <_> + + 0 -1 6174 2.2499680053442717e-03 + + -1.3063929975032806e-01 6.4832933247089386e-02 + <_> + + 0 -1 6175 8.4626786410808563e-02 + + 5.9339799918234348e-03 -4.1516590118408203e-01 + <_> + + 0 -1 6176 -9.5411221263930202e-04 + + -9.3790747225284576e-02 7.5486607849597931e-02 + <_> + + 0 -1 6177 -7.6813949272036552e-03 + + -1.4821960031986237e-01 2.9010580852627754e-02 + <_> + + 0 -1 6178 -2.5593319907784462e-02 + + 1.4859579503536224e-01 -4.7195930033922195e-02 + <_> + + 0 -1 6179 2.1508369594812393e-02 + + 2.3782620206475258e-02 -9.6659287810325623e-02 + <_> + + 0 -1 6180 3.4463100135326385e-02 + + -3.7410069257020950e-02 2.2015300393104553e-01 + <_> + + 0 -1 6181 -3.7860300391912460e-02 + + -5.0047469139099121e-01 1.4059869572520256e-02 + <_> + + 0 -1 6182 1.2028450146317482e-03 + + -6.5087057650089264e-02 8.9583486318588257e-02 + <_> + + 0 -1 6183 1.6753520816564560e-02 + + 4.9179811030626297e-03 -4.3030908703804016e-01 + <_> + + 0 -1 6184 1.6640779795125127e-03 + + 4.0807429701089859e-02 -1.4469960331916809e-01 + <_> + + 0 -1 6185 3.4473428968340158e-03 + + -3.9910178631544113e-02 1.5272960066795349e-01 + <_> + + 0 -1 6186 8.9918142184615135e-03 + + 7.1071267127990723e-02 -8.6169913411140442e-02 + <_> + + 0 -1 6187 8.3185202674940228e-04 + + -2.5739189982414246e-01 1.7941089347004890e-02 + <_> + + 0 -1 6188 -6.8142730742692947e-03 + + 1.3823160529136658e-01 -5.3994540125131607e-02 + <_> + + 0 -1 6189 2.9746210202574730e-03 + + -4.1550260037183762e-02 3.9839770644903183e-02 + <_> + + 0 -1 6190 2.5836620479822159e-03 + + -7.0656493306159973e-02 9.5045506954193115e-02 + <_> + + 0 -1 6191 2.7143809711560607e-04 + + 5.8070071041584015e-02 -1.2781760096549988e-01 + <_> + + 0 -1 6192 3.5418298840522766e-01 + + 5.4909070022404194e-03 -9.7960698604583740e-01 + <_> + + 0 -1 6193 2.5318650528788567e-02 + + -1.4410969801247120e-02 2.6219129562377930e-01 + <_> + + 0 -1 6194 -2.2658439411316067e-04 + + 5.2997849881649017e-02 -1.1629349738359451e-01 + <_> + + 0 -1 6195 6.8859090097248554e-03 + + 1.6437310725450516e-02 -2.0349490642547607e-01 + <_> + + 0 -1 6196 1.1607459746301174e-02 + + -3.6651011556386948e-02 1.5184010565280914e-01 + <_> + + 0 -1 6197 -4.8253959976136684e-03 + + -2.3476150631904602e-01 3.7914011627435684e-02 + <_> + + 0 -1 6198 2.5656020734459162e-03 + + 3.5185638815164566e-02 -1.8540710210800171e-01 + <_> + + 0 -1 6199 1.2601399421691895e-01 + + -9.8542850464582443e-03 2.5520691275596619e-01 + <_> + + 0 -1 6200 2.7164958883076906e-03 + + -2.1748440340161324e-02 2.5467529892921448e-01 + <_> + + 0 -1 6201 3.2356029748916626e-01 + + 8.8657345622777939e-03 -7.0383572578430176e-01 + <_> + + 0 -1 6202 -8.4016058826819062e-04 + + 3.6831360310316086e-02 -1.4953260123729706e-01 + <_> + + 0 -1 6203 3.3291990403085947e-03 + + 4.8185840249061584e-02 -1.2290470302104950e-01 + <_> + + 0 -1 6204 2.1130539476871490e-01 + + 6.5245870500802994e-03 -8.8293862342834473e-01 + <_> + + 0 -1 6205 5.0388509407639503e-03 + + -6.7079946398735046e-02 3.7849709391593933e-02 + <_> + + 0 -1 6206 -2.7862399816513062e-02 + + 3.3469489216804504e-01 -1.8816500902175903e-02 + <_> + + 0 -1 6207 3.8636629469692707e-03 + + 4.3644730001688004e-02 -1.7481489479541779e-01 + <_> + + 0 -1 6208 1.0480300337076187e-01 + + -1.5737529844045639e-02 4.2094239592552185e-01 + <_> + + 0 -1 6209 -3.4130848944187164e-03 + + -1.0835570096969604e-01 4.3717790395021439e-02 + <_> + + 0 -1 6210 -4.6396970748901367e-02 + + -7.5680077075958252e-01 8.6701400578022003e-03 + <_> + + 0 -1 6211 5.3708078339695930e-03 + + -4.1797801852226257e-02 1.4824719727039337e-01 + <_> + + 0 -1 6212 -6.1126388609409332e-03 + + 1.8673719465732574e-01 -4.3387491255998611e-02 + <_> + + 0 -1 6213 4.2509321123361588e-02 + + 1.1690679937601089e-02 -4.3740659952163696e-01 + <_> + + 0 -1 6214 1.0473020374774933e-02 + + 4.3143630027770996e-02 -1.5654399991035461e-01 + <_> + + 0 -1 6215 -4.7223959118127823e-02 + + -7.4483537673950195e-01 3.4918629098683596e-03 + <_> + + 0 -1 6216 5.3090360015630722e-02 + + 1.0408150032162666e-02 -5.3499448299407959e-01 + <_> + + 0 -1 6217 -7.0432561915367842e-04 + + 3.3384170383214951e-02 -7.3706030845642090e-02 + <_> + + 0 -1 6218 7.5942431576550007e-03 + + -2.9107049107551575e-02 1.9468860328197479e-01 + <_> + + 0 -1 6219 2.2676989436149597e-02 + + 3.3803820610046387e-02 -2.7627611160278320e-01 + <_> + + 0 -1 6220 6.6533521749079227e-03 + + -2.6578240096569061e-02 2.4283319711685181e-01 + <_> + + 0 -1 6221 3.7712270859628916e-03 + + 2.6554299518465996e-02 -6.4952917397022247e-02 + <_> + + 0 -1 6222 -2.0740530453622341e-03 + + -1.7968970537185669e-01 3.1532160937786102e-02 + <_> + + 0 -1 6223 -1.5632519498467445e-03 + + 5.3109679371118546e-02 -8.7415628135204315e-02 + <_> + + 0 -1 6224 1.2540889903903008e-02 + + -3.4136459231376648e-02 2.2097539901733398e-01 + <_> + + 0 -1 6225 -3.2660199794918299e-03 + + -5.5261608213186264e-02 3.2669559121131897e-02 + <_> + + 0 -1 6226 -8.2185603678226471e-03 + + -1.4478379487991333e-01 5.5743928998708725e-02 + <_> + + 0 -1 6227 -5.5811040103435516e-02 + + 1.7237940430641174e-01 -1.4456519857048988e-02 + <_> + + 0 -1 6228 -1.4723159372806549e-01 + + -8.1392312049865723e-01 7.4356291443109512e-03 + <_> + + 0 -1 6229 -5.8468529023230076e-03 + + -6.9043442606925964e-02 1.9456790760159492e-02 + <_> + + 0 -1 6230 1.9462220370769501e-02 + + -3.5472229123115540e-02 1.6666300594806671e-01 + <_> + + 0 -1 6231 5.8353468775749207e-02 + + 3.0551329255104065e-03 -3.9289128780364990e-01 + <_> + + 0 -1 6232 4.3785829097032547e-02 + + 1.3574630022048950e-02 -4.6152359247207642e-01 + <_> + + 0 -1 6233 -5.1904350519180298e-02 + + 6.3802438974380493e-01 -9.6664745360612869e-03 + <_> + + 0 -1 6234 -7.7811058145016432e-04 + + -9.9303223192691803e-02 5.6094601750373840e-02 + <_> + + 0 -1 6235 4.9657518975436687e-03 + + 4.1419368237257004e-02 -1.1274819821119308e-01 + <_> + + 0 -1 6236 -5.4516079835593700e-03 + + 1.7399060726165771e-01 -4.1147731244564056e-02 + <_> + + 0 -1 6237 5.0428751856088638e-03 + + -4.1255220770835876e-02 1.3794229924678802e-01 + <_> + + 0 -1 6238 -1.6985220136120915e-03 + + -2.2874790430068970e-01 2.5274980813264847e-02 + <_> + + 0 -1 6239 8.2764238119125366e-02 + + 3.3066510222852230e-03 -6.9113439321517944e-01 + <_> + + 0 -1 6240 3.9285849779844284e-03 + + -7.9043358564376831e-02 6.6218852996826172e-02 + <_> + + 0 -1 6241 -3.0601240694522858e-02 + + -2.6517450809478760e-01 1.6467850655317307e-02 + <_> + + 0 -1 6242 -1.9941160455346107e-02 + + 1.5431809425354004e-01 -3.6100689321756363e-02 + <_> + + 0 -1 6243 8.0520063638687134e-02 + + 1.7015919089317322e-02 -3.3448880910873413e-01 + <_> + + 0 -1 6244 7.0323847234249115e-02 + + 1.7122440040111542e-02 -3.3302140235900879e-01 + <_> + + 0 -1 6245 -5.2850939333438873e-02 + + 6.2421400099992752e-02 -1.4690199866890907e-02 + <_> + + 0 -1 6246 -7.1594159817323089e-04 + + -1.1335150152444839e-01 5.2260790020227432e-02 + <_> + + 0 -1 6247 2.1469970047473907e-01 + + 9.9299731664359570e-04 -9.9997580051422119e-01 + <_> + + 0 -1 6248 8.7042592465877533e-02 + + -1.2329760007560253e-02 5.0260668992996216e-01 + <_> + + 0 -1 6249 -5.8731262106448412e-04 + + -9.9346466362476349e-02 5.1705610007047653e-02 + <_> + + 0 -1 6250 -4.4215220957994461e-02 + + -3.9368900656700134e-01 1.3920850120484829e-02 + <_> + + 0 -1 6251 -8.7676227092742920e-02 + + 3.0157440900802612e-01 -6.8702381104230881e-03 + <_> + + 0 -1 6252 -4.8453990370035172e-02 + + 2.5477871298789978e-01 -2.2457750514149666e-02 + <_> + + 0 -1 6253 -2.1567570511251688e-03 + + -1.3562899827957153e-01 3.1725399196147919e-02 + <_> + + 0 -1 6254 3.9050900377333164e-03 + + 4.9100890755653381e-02 -1.1861059814691544e-01 + <_> + + 0 -1 6255 -3.9808028377592564e-03 + + 4.8333909362554550e-02 -5.5897079408168793e-02 + <_> + + 0 -1 6256 2.9744929634034634e-03 + + -6.4802452921867371e-02 9.3583501875400543e-02 + <_> + + 0 -1 6257 2.5875229388475418e-02 + + 1.8487609922885895e-02 -3.3436349034309387e-01 + <_> + + 0 -1 6258 -1.9373580580577254e-03 + + 2.2000649571418762e-01 -2.5404980406165123e-02 + <_> + + 0 -1 6259 -2.0171629264950752e-02 + + -7.8228309750556946e-02 4.5462790876626968e-02 + <_> + + 0 -1 6260 -2.6088140904903412e-02 + + 1.7637069523334503e-01 -4.5097298920154572e-02 + <_> + + 0 -1 6261 -2.6868300512433052e-02 + + -3.2656419277191162e-01 1.7994230613112450e-02 + <_> + + 0 -1 6262 -7.0211151614785194e-04 + + 3.9671998471021652e-02 -1.4533540606498718e-01 + <_> + + 0 -1 6263 8.3507681265473366e-03 + + -2.3051729425787926e-02 1.8850760161876678e-01 + <_> + + 0 -1 6264 4.6823569573462009e-03 + + 2.9996560886502266e-02 -2.0701029896736145e-01 + <_> + + 0 -1 6265 3.3109660726040602e-03 + + 5.6536730378866196e-02 -1.6835589706897736e-01 + <_> + + 0 -1 6266 7.6425541192293167e-03 + + -4.1423950344324112e-02 1.2557519972324371e-01 + <_> + + 0 -1 6267 -2.4713110178709030e-03 + + 7.2156153619289398e-02 -1.0767730325460434e-01 + <_> + + 0 -1 6268 -9.9495360627770424e-03 + + -1.8187619745731354e-01 3.3567231148481369e-02 + <_> + + 0 -1 6269 1.9820800516754389e-03 + + -5.6488718837499619e-02 1.0741490125656128e-01 + <_> + + 0 -1 6270 2.3254439234733582e-02 + + -1.6543349251151085e-02 3.6466678977012634e-01 + <_> + + 0 -1 6271 -5.4177921265363693e-02 + + -1. 3.3418419770896435e-03 + <_> + + 0 -1 6272 6.1567849479615688e-04 + + 4.0159329771995544e-02 -1.6460220515727997e-01 + <_> + + 0 -1 6273 -4.2699510231614113e-03 + + -5.6978620588779449e-02 4.4480901211500168e-02 + <_> + + 0 -1 6274 1.9749389030039310e-03 + + 5.9283681213855743e-02 -1.0791260004043579e-01 + <_> + + 0 -1 6275 -5.8583128266036510e-03 + + 1.3734050095081329e-01 -3.4231521189212799e-02 + <_> + + 0 -1 6276 -7.2995189111679792e-04 + + -1.0075060278177261e-01 5.4733160883188248e-02 + <_> + + 0 -1 6277 -2.9930740594863892e-02 + + 6.3882559537887573e-02 -4.1027020663022995e-02 + <_> + + 0 -1 6278 -5.1738750189542770e-02 + + -7.2713458538055420e-01 7.4993381276726723e-03 + <_> + + 0 -1 6279 2.4021189659833908e-02 + + 7.8491801396012306e-03 -5.5794471502304077e-01 + <_> + + 0 -1 6280 -3.7574321031570435e-03 + + -1.6086879372596741e-01 3.1015990301966667e-02 + <_> + + 0 -1 6281 -6.2635682523250580e-02 + + 9.0577863156795502e-02 -2.9033770784735680e-02 + <_> + + 0 -1 6282 1.9363429397344589e-02 + + -4.9920588731765747e-02 1.2835779786109924e-01 + <_> + + 0 -1 6283 -3.5072889178991318e-02 + + 2.1391840279102325e-01 -8.8168960064649582e-03 + <_> + + 0 -1 6284 -1.3243310153484344e-02 + + 2.3349699378013611e-01 -2.3088019341230392e-02 + <_> + + 0 -1 6285 -3.1290829181671143e-02 + + -6.9495099782943726e-01 9.3020889908075333e-03 + <_> + + 0 -1 6286 7.2391419671475887e-03 + + 2.8485849499702454e-02 -1.8310770392417908e-01 + <_> + + 0 -1 6287 6.6785318776965141e-03 + + -4.9132950603961945e-02 5.4181691259145737e-02 + <_> + + 0 -1 6288 -3.6825571209192276e-02 + + 3.3120208978652954e-01 -2.1359929814934731e-02 + <_> + + 0 -1 6289 -4.5507341623306274e-02 + + -1.2893490493297577e-01 4.9545988440513611e-02 + <_> + + 0 -1 6290 7.7639957889914513e-03 + + -3.6255620419979095e-02 1.5321409702301025e-01 + <_> + + 0 -1 6291 6.0417611151933670e-02 + + 4.5740022324025631e-03 -6.7541092634201050e-01 + <_> + + 0 -1 6292 2.4624960497021675e-03 + + 5.3674161434173584e-02 -1.1326540261507034e-01 + <_> + + 0 -1 6293 7.3594506829977036e-05 + + -3.5648930817842484e-02 2.5458969175815582e-02 + <_> + + 0 -1 6294 -4.0958370082080364e-03 + + 1.5562909841537476e-01 -3.9390601217746735e-02 + <_> + + 0 -1 6295 2.8689370083156973e-05 + + -8.4823302924633026e-02 3.8254238665103912e-02 + <_> + + 0 -1 6296 -4.6220528893172741e-03 + + -1.8994529545307159e-01 3.3508758991956711e-02 + <_> + + 0 -1 6297 -8.5343196988105774e-03 + + 1.1212539672851562e-01 -3.3968489617109299e-02 + <_> + + 0 -1 6298 -5.8803848922252655e-02 + + -5.1244312524795532e-01 1.0789549909532070e-02 + <_> + + 0 -1 6299 6.0719929635524750e-02 + + -1.2555030174553394e-02 2.2509759664535522e-01 + <_> + + 0 -1 6300 1.1038020020350814e-03 + + -9.6294492483139038e-02 5.6727480143308640e-02 + <_> + + 0 -1 6301 -3.8484560791403055e-03 + + 4.0573459118604660e-02 -2.5326859205961227e-02 + <_> + + 0 -1 6302 -1.0771050117909908e-02 + + 8.8735632598400116e-02 -5.5628679692745209e-02 + <_> + + 0 -1 6303 1.2016809545457363e-02 + + 2.3566279560327530e-02 -2.4590580165386200e-01 + <_> + + 0 -1 6304 -1.1656560236588120e-03 + + -3.7417300045490265e-02 1.6503289341926575e-01 + <_> + + 0 -1 6305 3.2137628644704819e-02 + + 1.4245970174670219e-02 -2.6480850577354431e-01 + <_> + + 0 -1 6306 2.3331670090556145e-02 + + -3.5288721323013306e-02 1.8447829782962799e-01 + <_> + + 0 -1 6307 -1.2685320340096951e-02 + + -1.1757309734821320e-01 1.6436910256743431e-02 + <_> + + 0 -1 6308 7.3903938755393028e-05 + + -1.0271479934453964e-01 7.4301436543464661e-02 + <_> + + 0 -1 6309 -1.0925470292568207e-01 + + -8.3165317773818970e-01 5.6438110768795013e-03 + <_> + + 0 -1 6310 -1.3324350118637085e-01 + + 7.7729821205139160e-01 -8.3403270691633224e-03 + <_> + + 0 -1 6311 8.9381448924541473e-04 + + -5.9524301439523697e-02 4.1173089295625687e-02 + <_> + + 0 -1 6312 1.0318649932742119e-02 + + 1.5926430001854897e-02 -3.1637790799140930e-01 + <_> + + 0 -1 6313 -5.2297548390924931e-03 + + -7.1166560053825378e-02 3.3489290624856949e-02 + <_> + + 0 -1 6314 1.6409620642662048e-02 + + -2.6454120874404907e-02 1.9589969515800476e-01 + <_> + + 0 -1 6315 1.4068709686398506e-02 + + -3.9364140480756760e-02 1.3977420330047607e-01 + <_> + + 0 -1 6316 6.6486410796642303e-03 + + 6.4070828258991241e-02 -1.0493399947881699e-01 + <_> + + 0 -1 6317 -1.8030619248747826e-02 + + 8.3942912518978119e-02 -1.3399159535765648e-02 + <_> + + 0 -1 6318 -4.4034369289875031e-02 + + -5.5825459957122803e-01 9.7633162513375282e-03 + <_> + + 0 -1 6319 -8.0966893583536148e-03 + + -2.0489789545536041e-01 2.6520200073719025e-02 + <_> + + 0 -1 6320 5.0180461257696152e-03 + + -1.1661209911108017e-01 4.5791670680046082e-02 + <_> + + 0 -1 6321 -1.7064629122614861e-02 + + 2.6282730698585510e-01 -2.0390639081597328e-02 + <_> + + 0 -1 6322 7.1850173175334930e-02 + + -6.9503681734204292e-03 6.7032539844512939e-01 + <_> + + 0 -1 6323 -5.6914370507001877e-02 + + -1.3477900624275208e-01 1.8399080261588097e-02 + <_> + + 0 -1 6324 -3.2365729566663504e-03 + + 6.9673851132392883e-02 -7.2314530611038208e-02 + <_> + + 0 -1 6325 4.1818909347057343e-02 + + 1.1151459999382496e-02 -5.1680111885070801e-01 + <_> + + 0 -1 6326 -6.1106588691473007e-03 + + -1.3163940608501434e-01 4.3796509504318237e-02 + <_> + + 0 -1 6327 -3.5560909658670425e-02 + + 6.8005502223968506e-02 -3.6331020295619965e-02 + <_> + + 0 -1 6328 6.8789169192314148e-02 + + 1.4698959887027740e-02 -3.8212299346923828e-01 + <_> + + 0 -1 6329 -7.8313373029232025e-02 + + 2.0296069979667664e-01 -8.6810020729899406e-03 + <_> + + 0 -1 6330 3.9626220241189003e-03 + + -3.5797890275716782e-02 1.3905510306358337e-01 + <_> + + 0 -1 6331 -3.3874038606882095e-02 + + -2.2253429889678955e-01 7.5455638580024242e-03 + <_> + + 0 -1 6332 -6.4755856990814209e-02 + + 4.7521549463272095e-01 -1.0970680043101311e-02 + <_> + + 0 -1 6333 2.6647940278053284e-02 + + 1.5445309691131115e-02 -2.6785778999328613e-01 + <_> + + 0 -1 6334 -3.0731109902262688e-02 + + -4.7668689489364624e-01 9.6429884433746338e-03 + <_> + + 0 -1 6335 -2.4022700265049934e-02 + + -1.0633960366249084e-01 1.2849040329456329e-02 + <_> + + 0 -1 6336 -1.3036349555477500e-03 + + 7.3524177074432373e-02 -6.8074919283390045e-02 + <_> + + 0 -1 6337 -9.8344050347805023e-03 + + -1.1843550205230713e-01 4.2866699397563934e-02 + <_> + + 0 -1 6338 8.7102197110652924e-02 + + -4.0088258683681488e-02 1.7804540693759918e-01 + <_> + + 0 -1 6339 2.0411569625139236e-02 + + 1.6849989071488380e-02 -3.8953658938407898e-01 + <_> + + 0 -1 6340 9.5875263214111328e-02 + + 5.9905550442636013e-03 -8.1525659561157227e-01 + <_> + + 0 -1 6341 6.4893220551311970e-03 + + -2.4039229378104210e-02 5.3871169686317444e-02 + <_> + + 0 -1 6342 -9.6279237186536193e-04 + + 9.4299189746379852e-02 -6.4436018466949463e-02 + <_> + + 0 -1 6343 -3.7659960798919201e-04 + + -6.2296878546476364e-02 4.1251849383115768e-02 + <_> + + 0 -1 6344 6.5272641368210316e-03 + + 5.1325131207704544e-02 -1.3037790358066559e-01 + <_> + + 0 -1 6345 2.1429110318422318e-02 + + -1.1989659629762173e-02 2.6280459761619568e-01 + <_> + + 0 -1 6346 -5.0938720814883709e-03 + + 6.3418947160243988e-02 -9.0566337108612061e-02 + <_> + + 0 -1 6347 -2.5309680495411158e-03 + + 6.0297761112451553e-02 -2.5049470365047455e-02 + <_> + + 0 -1 6348 -1.5915350522845984e-03 + + -1.2171190232038498e-01 3.7737991660833359e-02 + <_> + + 0 -1 6349 -3.4030709415674210e-02 + + 4.6413430571556091e-01 -3.5409750416874886e-03 + <_> + + 0 -1 6350 5.1074200309813023e-03 + + 3.9823830127716064e-02 -1.2645539641380310e-01 + <_> + + 0 -1 6351 -9.6449116244912148e-03 + + 3.3464258909225464e-01 -6.6040740348398685e-03 + <_> + + 0 -1 6352 1.1422860436141491e-02 + + -3.6080420017242432e-02 1.3714550435543060e-01 + <_> + + 0 -1 6353 -5.1042139530181885e-03 + + -9.3986809253692627e-02 2.8844779357314110e-02 + <_> + + 0 -1 6354 -2.6332271099090576e-01 + + 4.9980929493904114e-01 -1.0173249989748001e-02 + <_> + + 0 -1 6355 -2.4556639790534973e-01 + + -8.1778347492218018e-01 6.9596339017152786e-03 + <_> + + 0 -1 6356 -2.1419329941272736e-01 + + -5.1040518283843994e-01 9.4540230929851532e-03 + <_> + + 0 -1 6357 -1.4363219961524010e-02 + + -9.1000981628894806e-02 2.4646669626235962e-02 + <_> + + 0 -1 6358 -1.2388969771564007e-03 + + 1.1544570326805115e-01 -4.9565620720386505e-02 + <_> + + 0 -1 6359 2.1015120670199394e-02 + + -1.7765879631042480e-02 1.9577859342098236e-01 + <_> + + 0 -1 6360 -4.1783051565289497e-03 + + -1.1172860115766525e-01 4.4625449925661087e-02 + <_> + + 0 -1 6361 2.0896939095109701e-03 + + -3.3988729119300842e-02 6.5539501607418060e-02 + <_> + + 0 -1 6362 1.6410060226917267e-02 + + -2.0373269915580750e-02 2.5331538915634155e-01 + <_> + + 0 -1 6363 -6.4266882836818695e-02 + + -6.5880149602890015e-01 3.4550630953162909e-03 + <_> + + 0 -1 6364 6.8898178869858384e-04 + + 6.7643247544765472e-02 -8.7556242942810059e-02 + <_> + + 0 -1 6365 5.6662331335246563e-03 + + 3.0638309195637703e-02 -1.1895540356636047e-01 + <_> + + 0 -1 6366 -4.3778121471405029e-02 + + -2.8309130668640137e-01 1.7713630571961403e-02 + <_> + + 0 -1 6367 3.4748481120914221e-03 + + -9.5787122845649719e-02 4.2630400508642197e-02 + <_> + + 0 -1 6368 -1.1673940345644951e-02 + + -1.0502570122480392e-01 5.0903890281915665e-02 + <_> + + 0 -1 6369 -3.4004659391939640e-03 + + 1.0470719635486603e-01 -4.0939141064882278e-02 + <_> + + 0 -1 6370 2.7091780211776495e-03 + + -6.0524601489305496e-02 1.3978950679302216e-01 + <_> + + 0 -1 6371 -1.7439300194382668e-02 + + -3.2391169667243958e-01 1.4630249701440334e-02 + <_> + + 0 -1 6372 -1.2598330155014992e-02 + + -2.0682629942893982e-01 2.5501869618892670e-02 + <_> + + 0 -1 6373 1.8755869939923286e-02 + + -4.7925960272550583e-02 1.0864380002021790e-01 + <_> + + 0 -1 6374 -4.2074159719049931e-03 + + -8.2077808678150177e-02 6.3647769391536713e-02 + <_> + + 0 -1 6375 -1.6427719674538821e-04 + + 1.0120390355587006e-01 -3.4067928791046143e-02 + <_> + + 0 -1 6376 4.3847691267728806e-02 + + 6.0980222187936306e-03 -8.3685982227325439e-01 + <_> + + 0 -1 6377 -3.9284680038690567e-02 + + 2.8250560164451599e-01 -2.2389259189367294e-02 + <_> + + 0 -1 6378 3.8550909608602524e-02 + + 1.5570489689707756e-02 -3.3978620171546936e-01 + <_> + + 0 -1 6379 -6.9177031517028809e-02 + + 1.2258320301771164e-01 -1.7850179225206375e-02 + <_> + + 0 -1 6380 -1.9251030171290040e-03 + + -1.0687749832868576e-01 4.6379510313272476e-02 + <_> + + 0 -1 6381 -8.6635202169418335e-03 + + 9.6412748098373413e-02 -1.7563249915838242e-02 + <_> + + 0 -1 6382 1.3393509387969971e-01 + + 6.3692941330373287e-03 -7.0170587301254272e-01 + <_> + + 0 -1 6383 4.1082348674535751e-02 + + -1.1077569797635078e-02 1.3463750481605530e-01 + <_> + + 0 -1 6384 1.4911450445652008e-01 + + 9.5263421535491943e-03 -5.0872552394866943e-01 + <_> + + 0 -1 6385 -5.2500818856060505e-03 + + 7.0025578141212463e-02 -4.2880270630121231e-02 + <_> + + 0 -1 6386 2.2823570296168327e-02 + + -4.1884049773216248e-02 1.1770319938659668e-01 + <_> + + 0 -1 6387 -8.5306530818343163e-03 + + 6.1222139745950699e-02 -2.4944549426436424e-02 + <_> + + 0 -1 6388 1.1971729807555676e-02 + + 3.9662770926952362e-02 -1.6267740726470947e-01 + <_> + + 0 -1 6389 -3.8938269019126892e-02 + + 2.5743520259857178e-01 -1.6356239095330238e-02 + <_> + + 0 -1 6390 -2.1706389263272285e-02 + + -3.1998679041862488e-01 1.7135290428996086e-02 + <_> + + 0 -1 6391 6.6900630481541157e-03 + + 2.6101849973201752e-02 -1.0980729758739471e-01 + <_> + + 0 -1 6392 -7.2270832955837250e-02 + + 1.9431130588054657e-01 -2.6044359430670738e-02 + <_> + + 0 -1 6393 -6.7073688842356205e-03 + + -1.7747850716114044e-01 4.5862998813390732e-02 + <_> + + 0 -1 6394 5.5019360035657883e-02 + + -8.3471573889255524e-03 6.0511541366577148e-01 + <_> + + 0 -1 6395 1.3142649829387665e-01 + + -5.7535418309271336e-03 2.9167538881301880e-01 + <_> + + 0 -1 6396 -1.6564460238441825e-03 + + 7.0003032684326172e-02 -6.2690876424312592e-02 + <_> + + 0 -1 6397 1.5445409715175629e-01 + + 6.1896732077002525e-03 -7.4323302507400513e-01 + <_> + + 0 -1 6398 -5.0357519648969173e-03 + + -1.1333289742469788e-01 3.8741771131753922e-02 + <_> + + 0 -1 6399 2.2772569209337234e-03 + + -1.1340530216693878e-01 2.1319400519132614e-02 + <_> + + 0 -1 6400 3.3173530828207731e-03 + + 4.4273331761360168e-02 -1.0459829866886139e-01 + <_> + + 0 -1 6401 -2.9692800715565681e-02 + + 9.2483766376972198e-02 -2.3342609405517578e-02 + <_> + + 0 -1 6402 6.2937840819358826e-02 + + -1.2998280115425587e-02 3.8887938857078552e-01 + <_> + + 0 -1 6403 3.6641359329223633e-03 + + 3.2099820673465729e-02 -3.9647988975048065e-02 + <_> + + 0 -1 6404 4.4782999902963638e-03 + + -4.5701328665018082e-02 1.0697010159492493e-01 + <_> + + 0 -1 6405 1.8147319788113236e-03 + + -3.2871820032596588e-02 1.0647939890623093e-01 + <_> + + 0 -1 6406 4.8941639252007008e-03 + + 2.7911009266972542e-02 -2.1725590527057648e-01 + <_> + + 0 -1 6407 -4.4425828382372856e-03 + + -1.3470150530338287e-01 1.0781410150229931e-02 + <_> + + 0 -1 6408 -2.5493400171399117e-02 + + 6.8371468782424927e-01 -7.7452720142900944e-03 + <_> + + 0 -1 6409 2.7835449203848839e-02 + + 2.4144299328327179e-02 -1.5170599520206451e-01 + <_> + + 0 -1 6410 7.5548859313130379e-03 + + -4.7643400728702545e-02 1.1925770342350006e-01 + <_> + + 0 -1 6411 1.0329609736800194e-02 + + 1.8646810203790665e-02 -1.6122570633888245e-01 + <_> + + 0 -1 6412 -1.2393389828503132e-02 + + 6.0304921865463257e-01 -7.7566630207002163e-03 + <_> + + 0 -1 6413 1.3833769597113132e-02 + + -2.7617299929261208e-02 5.1266878843307495e-02 + <_> + + 0 -1 6414 -2.5669319555163383e-02 + + 2.3801359534263611e-01 -2.3971909657120705e-02 + <_> + + 0 -1 6415 -5.2043660543859005e-03 + + -1.0721790045499802e-01 2.6645049452781677e-02 + <_> + + 0 -1 6416 3.4628969151526690e-03 + + 5.4313410073518753e-02 -1.3458320498466492e-01 + <_> + + 0 -1 6417 -1.9220679998397827e-02 + + 7.2996392846107483e-02 -4.0652111172676086e-02 + <_> + + 0 -1 6418 -2.5009829550981522e-03 + + -7.7671296894550323e-02 5.9096541255712509e-02 + <_> + + 0 -1 6419 -8.5285156965255737e-03 + + 4.9050811678171158e-02 -6.4078353345394135e-02 + <_> + + 0 -1 6420 4.3327538296580315e-03 + + 2.5221010670065880e-02 -1.9358980655670166e-01 + <_> + + 0 -1 6421 3.6595970392227173e-02 + + -1.6262590885162354e-02 1.5651239454746246e-01 + <_> + + 0 -1 6422 -1.1795730097219348e-03 + + -7.2468072175979614e-02 7.0449486374855042e-02 + <_> + + 0 -1 6423 -1.3975829817354679e-02 + + -1.1789470165967941e-01 2.1292049437761307e-02 + <_> + + 0 -1 6424 -1.3828700175508857e-03 + + 7.9283542931079865e-02 -9.5104120671749115e-02 + <_> + + 0 -1 6425 -2.9435830656439066e-03 + + 7.0368431508541107e-02 -3.3217910677194595e-02 + <_> + + 0 -1 6426 9.5262555405497551e-03 + + -2.9733620584011078e-02 1.6670459508895874e-01 + <_> + + 0 -1 6427 -9.0114273130893707e-02 + + -1.6625370085239410e-01 8.6199166253209114e-03 + <_> + + 0 -1 6428 -1.2089919764548540e-03 + + 8.1083856523036957e-02 -7.3029123246669769e-02 + <_> + + 0 -1 6429 -1.4199960231781006e-01 + + -1. 2.2284830920398235e-03 + <_> + + 0 -1 6430 8.0690719187259674e-03 + + 4.7412220388650894e-02 -1.0178930312395096e-01 + <_> + + 0 -1 6431 -4.7410889528691769e-03 + + 1.2051119655370712e-01 -4.9957480281591415e-02 + <_> + + 0 -1 6432 -1.6977200284600258e-03 + + -2.4171440303325653e-01 1.9534369930624962e-02 + <_> + + 0 -1 6433 -2.8892089612782001e-03 + + 2.5727990269660950e-01 -1.1625059880316257e-02 + <_> + + 0 -1 6434 -1.5177440363913774e-03 + + -9.8784193396568298e-02 4.6706128865480423e-02 + <_> + + 0 -1 6435 1.4197319746017456e-01 + + -2.5096370372921228e-03 7.5450611114501953e-01 + <_> + + 0 -1 6436 9.7517937421798706e-02 + + -6.9059049710631371e-03 6.5184432268142700e-01 + <_> + + 0 -1 6437 1.3567379675805569e-02 + + -7.6325193047523499e-02 8.8054582476615906e-02 + <_> + + 0 -1 6438 8.0981463193893433e-02 + + 1.5558109618723392e-02 -3.4601628780364990e-01 + <_> + + 0 -1 6439 -4.7192731872200966e-03 + + 8.1620022654533386e-02 -4.6072289347648621e-02 + <_> + + 0 -1 6440 2.0368969999253750e-03 + + -4.4817630201578140e-02 1.2861390411853790e-01 + <_> + + 0 -1 6441 -1.7878509825095534e-03 + + 4.3731331825256348e-02 -4.4995948672294617e-02 + <_> + + 0 -1 6442 -7.1685528382658958e-03 + + -1.3597999513149261e-01 3.8796991109848022e-02 + <_> + + 0 -1 6443 -6.7460887134075165e-02 + + -2.9265740513801575e-01 3.5135280340909958e-03 + <_> + + 0 -1 6444 -1.5598500147461891e-02 + + 2.3105660080909729e-01 -2.2405069321393967e-02 + <_> + + 0 -1 6445 -2.1026479080319405e-02 + + -1.5283830463886261e-01 3.1531449407339096e-02 + <_> + + 0 -1 6446 -1.0558360069990158e-01 + + -6.8366038799285889e-01 6.8997950293123722e-03 + <_> + + 0 -1 6447 -3.6966579500585794e-03 + + 3.4315150231122971e-02 -4.8922799527645111e-02 + <_> + + 0 -1 6448 -6.0826627304777503e-04 + + -5.2638430148363113e-02 8.9546948671340942e-02 + <_> + + 0 -1 6449 -2.8936540707945824e-02 + + 4.1818480938673019e-02 -1.3818169943988323e-02 + <_> + + 0 -1 6450 -5.8082528412342072e-03 + + 6.7874796688556671e-02 -8.5578799247741699e-02 + <_> + + 0 -1 6451 -4.6095378696918488e-02 + + -1.2584780156612396e-01 2.0466970279812813e-02 + <_> + + 0 -1 6452 5.2972920238971710e-02 + + -1.2453259900212288e-02 3.4565049409866333e-01 + <_> + + 0 -1 6453 4.9351599067449570e-02 + + 1.0901239700615406e-02 -4.8506981134414673e-01 + <_> + + 0 -1 6454 4.4377800077199936e-02 + + 9.9294837564229965e-03 -4.3877899646759033e-01 + <_> + + 0 -1 6455 -1.1464890092611313e-01 + + 2.6874598860740662e-01 -9.2000560835003853e-03 + <_> + + 0 -1 6456 1.6887830197811127e-01 + + 5.7101310230791569e-03 -8.5972881317138672e-01 + <_> + + 0 -1 6457 5.1198098808526993e-02 + + -8.5723921656608582e-03 1.3395169377326965e-01 + <_> + + 0 -1 6458 -3.0789880547672510e-03 + + -1.0338760167360306e-01 4.3459478765726089e-02 + <_> + + 0 -1 6459 4.7223128378391266e-02 + + 8.1934239715337753e-03 -4.3803408741950989e-01 + <_> + + 0 -1 6460 -7.6270569115877151e-03 + + 1.8713890016078949e-01 -2.4660250172019005e-02 + <_> + + 0 -1 6461 5.4106907919049263e-03 + + 4.1099831461906433e-02 -7.8868232667446136e-02 + <_> + + 0 -1 6462 -1.4900229871273041e-03 + + -2.0115040242671967e-01 3.1898159533739090e-02 + <_> + + 0 -1 6463 -8.3831608295440674e-02 + + 5.8017939329147339e-01 -5.2973427809774876e-03 + <_> + + 0 -1 6464 6.2233800999820232e-03 + + -3.9786059409379959e-02 1.2283950299024582e-01 + <_> + + 0 -1 6465 1.1475080251693726e-01 + + -1.1975419707596302e-02 2.1586710214614868e-01 + <_> + + 0 -1 6466 -1.5253260498866439e-03 + + 1.3804529607295990e-01 -3.9941880851984024e-02 + <_> + + 0 -1 6467 -5.2878521382808685e-03 + + -1.2790650129318237e-01 3.2893560826778412e-02 + <_> + + 0 -1 6468 8.9670647867023945e-04 + + -1.2481059879064560e-01 4.4544249773025513e-02 + <_> + + 0 -1 6469 3.8421660661697388e-02 + + 7.7155791223049164e-03 -6.5575468540191650e-01 + <_> + + 0 -1 6470 -9.3785318313166499e-04 + + 5.5608510971069336e-02 -8.9876912534236908e-02 + <_> + + 0 -1 6471 1.9965849351137877e-03 + + -2.5297610089182854e-02 1.9413180649280548e-01 + <_> + + 0 -1 6472 4.5782068627886474e-04 + + 3.9089199155569077e-02 -1.2908570468425751e-01 + <_> + + 0 -1 6473 3.8373940624296665e-03 + + -2.8748869895935059e-02 1.9429750740528107e-01 + <_> + + 0 -1 6474 3.7142829387448728e-04 + + 3.8272358477115631e-02 -1.3759189844131470e-01 + <_> + + 0 -1 6475 7.5116259977221489e-03 + + -1.4461129903793335e-02 1.2656949460506439e-01 + <_> + + 0 -1 6476 -5.0362840294837952e-02 + + 3.5183578729629517e-01 -1.4051860198378563e-02 + <_> + + 0 -1 6477 3.9921641349792480e-02 + + 2.7280429378151894e-02 -1.9958199560642242e-01 + <_> + + 0 -1 6478 2.2605259716510773e-01 + + -6.8001961335539818e-03 7.3006898164749146e-01 + <_> + + 0 -1 6479 1.1081779748201370e-01 + + 4.3370737694203854e-03 -8.6829161643981934e-01 + <_> + + 0 -1 6480 -9.7494889050722122e-03 + + -6.3740663230419159e-02 8.4537997841835022e-02 + <_> + + 0 -1 6481 -2.2887689992785454e-03 + + 9.9654018878936768e-02 -4.1565418243408203e-02 + <_> + + 0 -1 6482 2.0008319988846779e-03 + + -5.5650699883699417e-02 1.0709869861602783e-01 + <_> + + 0 -1 6483 -1.5160050243139267e-02 + + -1.4098760485649109e-01 3.8741599768400192e-02 + <_> + + 0 -1 6484 -6.3132969662547112e-03 + + -1. 4.4605308212339878e-03 + <_> + + 0 -1 6485 -1.3970009982585907e-02 + + 1.2481089681386948e-01 -2.1425830200314522e-02 + <_> + + 0 -1 6486 -4.4321279972791672e-02 + + -5.3340071439743042e-01 1.0165239684283733e-02 + <_> + + 0 -1 6487 1.4885979471728206e-03 + + -4.8868600279092789e-02 3.6077901721000671e-02 + <_> + + 0 -1 6488 6.5139681100845337e-02 + + 7.6331058517098427e-03 -5.8781641721725464e-01 + <_> + + 0 -1 6489 -2.0741410553455353e-02 + + -2.9658278822898865e-01 1.8622800707817078e-02 + <_> + 396 + -1.2181390523910522e+00 + + <_> + + 0 -1 6490 1.3575689867138863e-02 + + -1.4249590039253235e-01 2.3337620496749878e-01 + <_> + + 0 -1 6491 -7.5882389210164547e-03 + + 8.6464479565620422e-02 -2.3954319953918457e-01 + <_> + + 0 -1 6492 4.2986529879271984e-03 + + 5.0282090902328491e-02 -3.5250121355056763e-01 + <_> + + 0 -1 6493 -1.9793119281530380e-02 + + -1.6827470064163208e-01 4.3712720274925232e-02 + <_> + + 0 -1 6494 6.6613829694688320e-03 + + -2.0371539890766144e-01 7.1225747466087341e-02 + <_> + + 0 -1 6495 3.2715050037950277e-03 + + 5.4536718875169754e-02 -2.2428829967975616e-01 + <_> + + 0 -1 6496 -3.6143321543931961e-02 + + 5.5044889450073242e-01 -2.3597210645675659e-02 + <_> + + 0 -1 6497 3.1145319808274508e-03 + + 2.2049430757761002e-02 -3.0109429359436035e-01 + <_> + + 0 -1 6498 8.9540961198508739e-04 + + -1.2279850244522095e-01 1.0751420259475708e-01 + <_> + + 0 -1 6499 8.0573331797495484e-04 + + -8.7587781250476837e-02 5.4632049053907394e-02 + <_> + + 0 -1 6500 -6.5726130269467831e-03 + + -1.5649870038032532e-01 7.6560758054256439e-02 + <_> + + 0 -1 6501 2.2269350010901690e-03 + + 2.9490780085325241e-02 -5.9210199862718582e-02 + <_> + + 0 -1 6502 6.2076752074062824e-03 + + 7.5727343559265137e-02 -1.7675329744815826e-01 + <_> + + 0 -1 6503 6.0021011158823967e-03 + + -7.8353807330131531e-02 1.4492890238761902e-01 + <_> + + 0 -1 6504 1.1996340006589890e-02 + + 2.8644030913710594e-02 -3.1982469558715820e-01 + <_> + + 0 -1 6505 6.7174229770898819e-03 + + -1.0739900171756744e-01 1.3106329739093781e-01 + <_> + + 0 -1 6506 5.7567027397453785e-04 + + -6.4126797020435333e-02 1.6293540596961975e-01 + <_> + + 0 -1 6507 3.9552329108119011e-03 + + 3.7347421050071716e-02 -1.5253570675849915e-01 + <_> + + 0 -1 6508 1.5598450554534793e-03 + + -9.8687313497066498e-02 9.8718203604221344e-02 + <_> + + 0 -1 6509 -8.4324590861797333e-03 + + 2.0905649662017822e-01 -6.0484018176794052e-02 + <_> + + 0 -1 6510 8.7580326944589615e-03 + + 5.0603430718183517e-02 -2.1845470368862152e-01 + <_> + + 0 -1 6511 -1.1965750157833099e-01 + + 2.6711589097976685e-01 -7.4574039317667484e-03 + <_> + + 0 -1 6512 2.0653149113059044e-03 + + 3.5194810479879379e-02 -2.5230750441551208e-01 + <_> + + 0 -1 6513 -5.7491107145324349e-04 + + 8.2424223423004150e-02 -1.0830479860305786e-01 + <_> + + 0 -1 6514 -6.7591401748359203e-03 + + -1.3704189658164978e-01 7.0154368877410889e-02 + <_> + + 0 -1 6515 1.8210740759968758e-02 + + -2.5407770648598671e-02 1.0123729705810547e-01 + <_> + + 0 -1 6516 -8.8006846606731415e-02 + + 3.6638718843460083e-01 -3.0893180519342422e-02 + <_> + + 0 -1 6517 -4.4944360852241516e-03 + + -1.5753810107707977e-01 6.0070630162954330e-02 + <_> + + 0 -1 6518 -6.3741360791027546e-03 + + 2.1189889311790466e-01 -3.9567999541759491e-02 + <_> + + 0 -1 6519 -3.1097440049052238e-02 + + -5.9965521097183228e-01 9.9493442103266716e-03 + <_> + + 0 -1 6520 5.8496380224823952e-03 + + 2.8244689106941223e-02 -2.9778000712394714e-01 + <_> + + 0 -1 6521 -2.2763800807297230e-03 + + 1.0270419716835022e-01 -7.3711991310119629e-02 + <_> + + 0 -1 6522 3.9103049784898758e-03 + + 5.2445668727159500e-02 -2.0123919844627380e-01 + <_> + + 0 -1 6523 2.8906730003654957e-03 + + -2.1692280471324921e-01 3.7294570356607437e-02 + <_> + + 0 -1 6524 4.5904931612312794e-03 + + -8.1276580691337585e-02 1.1013159900903702e-01 + <_> + + 0 -1 6525 -3.4245800226926804e-02 + + -1.1541730165481567e-01 1.4384049922227859e-02 + <_> + + 0 -1 6526 -1.7881620442494750e-04 + + 6.2885977327823639e-02 -1.3267129659652710e-01 + <_> + + 0 -1 6527 -4.0114559233188629e-03 + + -1.8961720168590546e-01 3.6701768636703491e-02 + <_> + + 0 -1 6528 3.1429999507963657e-03 + + -4.9915120005607605e-02 1.7299769818782806e-01 + <_> + + 0 -1 6529 7.8082352876663208e-02 + + 4.7195390798151493e-03 -3.4015879034996033e-01 + <_> + + 0 -1 6530 2.0370949804782867e-01 + + -2.1733140572905540e-02 3.7422651052474976e-01 + <_> + + 0 -1 6531 9.7424820065498352e-02 + + -6.8117439514026046e-04 4.9639159440994263e-01 + <_> + + 0 -1 6532 -2.6366419624537230e-03 + + -1.8532100319862366e-01 4.3768830597400665e-02 + <_> + + 0 -1 6533 4.1020149365067482e-04 + + 2.7802910655736923e-02 -8.7706968188285828e-02 + <_> + + 0 -1 6534 -5.9666559100151062e-02 + + -5.6872707605361938e-01 1.3388640247285366e-02 + <_> + + 0 -1 6535 -5.1892381161451340e-03 + + 5.0499498844146729e-02 -1.4465869963169098e-01 + <_> + + 0 -1 6536 1.0377140343189240e-01 + + -1.8952060490846634e-02 4.1107979416847229e-01 + <_> + + 0 -1 6537 -1.4075759798288345e-02 + + -2.0367360115051270e-01 3.2513279467821121e-02 + <_> + + 0 -1 6538 -6.8877148441970348e-03 + + 1.2401729822158813e-01 -7.6617129147052765e-02 + <_> + + 0 -1 6539 2.9345849528908730e-02 + + 8.4471162408590317e-03 -3.4656980633735657e-01 + <_> + + 0 -1 6540 -8.3123557269573212e-03 + + -1.9180110096931458e-01 3.8585629314184189e-02 + <_> + + 0 -1 6541 6.4493268728256226e-02 + + -2.7158880606293678e-02 3.0217999219894409e-01 + <_> + + 0 -1 6542 8.0413377145305276e-04 + + -1.0444170236587524e-01 6.4721979200839996e-02 + <_> + + 0 -1 6543 -6.5569980069994926e-03 + + -1.0658600181341171e-01 2.5238489732146263e-02 + <_> + + 0 -1 6544 -3.8326930254697800e-02 + + -6.8506389856338501e-01 9.6486946567893028e-03 + <_> + + 0 -1 6545 -4.0327329188585281e-02 + + 1.9759850203990936e-01 -2.5184169411659241e-02 + <_> + + 0 -1 6546 6.1981407925486565e-03 + + 4.6415790915489197e-02 -1.7171670496463776e-01 + <_> + + 0 -1 6547 3.7465501576662064e-02 + + -1.5010279603302479e-02 8.6962252855300903e-02 + <_> + + 0 -1 6548 -6.0584479942917824e-03 + + 6.9242753088474274e-02 -9.4594202935695648e-02 + <_> + + 0 -1 6549 -1.4991699717938900e-02 + + -1.4969819784164429e-01 4.6579450368881226e-02 + <_> + + 0 -1 6550 6.4760357141494751e-02 + + -2.6089169085025787e-02 2.7072009444236755e-01 + <_> + + 0 -1 6551 5.9020328521728516e-01 + + 3.9715780876576900e-03 -6.3918071985244751e-01 + <_> + + 0 -1 6552 7.3892213404178619e-02 + + -6.2506332993507385e-02 1.3100719451904297e-01 + <_> + + 0 -1 6553 4.3928170204162598e-01 + + 5.0452877767384052e-03 -3.7628439068794250e-01 + <_> + + 0 -1 6554 1.0192040354013443e-01 + + 2.2053290158510208e-02 -3.3408200740814209e-01 + <_> + + 0 -1 6555 1.1084219813346863e-01 + + 1.6215540468692780e-02 -3.4900701045989990e-01 + <_> + + 0 -1 6556 5.5628088302910328e-03 + + -5.2196711301803589e-02 1.1796370148658752e-01 + <_> + + 0 -1 6557 -6.3897081417962909e-04 + + -1.5659700334072113e-01 4.4744450598955154e-02 + <_> + + 0 -1 6558 -3.5426639951765537e-03 + + 1.4490570127964020e-01 -4.2518708854913712e-02 + <_> + + 0 -1 6559 -3.3016160130500793e-02 + + -3.6942940950393677e-01 7.6470980420708656e-03 + <_> + + 0 -1 6560 9.6050858497619629e-02 + + 6.5154801122844219e-03 -8.7827038764953613e-01 + <_> + + 0 -1 6561 -4.9572009593248367e-02 + + -4.2723020911216736e-01 3.1567770056426525e-03 + <_> + + 0 -1 6562 2.5885479408316314e-04 + + -1.5689669549465179e-01 3.8051828742027283e-02 + <_> + + 0 -1 6563 -1.5898289857432246e-03 + + -1.8845720589160919e-01 2.4630049243569374e-02 + <_> + + 0 -1 6564 -1.3463890354614705e-04 + + 1.4452700316905975e-01 -4.4172260910272598e-02 + <_> + + 0 -1 6565 1.1674249544739723e-02 + + -2.5676380842924118e-02 1.9527709484100342e-01 + <_> + + 0 -1 6566 -2.3507000878453255e-02 + + -3.2271888852119446e-01 1.8514839932322502e-02 + <_> + + 0 -1 6567 3.1225800514221191e-02 + + -1.9622299820184708e-02 1.4570100605487823e-01 + <_> + + 0 -1 6568 8.0607319250702858e-04 + + 4.4379990547895432e-02 -1.3635620474815369e-01 + <_> + + 0 -1 6569 -2.6445880532264709e-01 + + 4.1771200299263000e-01 -6.3821650110185146e-03 + <_> + + 0 -1 6570 3.5479381680488586e-02 + + -2.2758480161428452e-02 2.6946100592613220e-01 + <_> + + 0 -1 6571 -3.8137599825859070e-02 + + -3.6719909310340881e-01 1.8722059205174446e-02 + <_> + + 0 -1 6572 3.9108810015022755e-03 + + -1.8176819384098053e-01 3.9054948836565018e-02 + <_> + + 0 -1 6573 4.1834539733827114e-03 + + 4.8676248639822006e-02 -1.3558860123157501e-01 + <_> + + 0 -1 6574 -4.6641420572996140e-02 + + -5.8741682767868042e-01 9.8590552806854248e-03 + <_> + + 0 -1 6575 1.1950139887630939e-02 + + -2.5506049394607544e-02 2.7971199154853821e-01 + <_> + + 0 -1 6576 -6.3585072755813599e-02 + + -7.0940697193145752e-01 8.8691459968686104e-03 + <_> + + 0 -1 6577 9.7221415489912033e-03 + + -2.7885029092431068e-02 5.4626680910587311e-02 + <_> + + 0 -1 6578 -1.6111459583044052e-02 + + -6.8265482783317566e-02 8.0932967364788055e-02 + <_> + + 0 -1 6579 -7.9950511455535889e-02 + + 2.0425680279731750e-01 -3.4306850284337997e-02 + <_> + + 0 -1 6580 3.1421340536326170e-03 + + 4.2196881026029587e-02 -1.5366910398006439e-01 + <_> + + 0 -1 6581 2.9253180400701240e-05 + + -7.6382257044315338e-02 3.1748879700899124e-02 + <_> + + 0 -1 6582 -5.4587088525295258e-02 + + -6.4891487360000610e-01 9.1545386239886284e-03 + <_> + + 0 -1 6583 -2.1083420142531395e-02 + + 1.9058999419212341e-01 -2.4686640128493309e-02 + <_> + + 0 -1 6584 3.9170900708995759e-04 + + -1.0570889711380005e-01 5.2946768701076508e-02 + <_> + + 0 -1 6585 2.2588829696178436e-01 + + 2.3077470250427723e-03 -9.2606049776077271e-01 + <_> + + 0 -1 6586 -1.8899979069828987e-02 + + 1.4503970742225647e-01 -3.8506619632244110e-02 + <_> + + 0 -1 6587 -8.7533425539731979e-03 + + 8.3958826959133148e-02 -3.7479098886251450e-02 + <_> + + 0 -1 6588 -2.0821259915828705e-01 + + -6.7948538064956665e-01 9.8609952256083488e-03 + <_> + + 0 -1 6589 1.6270060092210770e-02 + + 1.4115580357611179e-02 -1.8218359351158142e-01 + <_> + + 0 -1 6590 3.0145489145070314e-03 + + 5.2013739943504333e-02 -1.1450190097093582e-01 + <_> + + 0 -1 6591 1.8547449260950089e-02 + + -2.5681620463728905e-02 1.6456380486488342e-01 + <_> + + 0 -1 6592 4.2732958681881428e-03 + + -5.9573240578174591e-02 1.0390280187129974e-01 + <_> + + 0 -1 6593 -2.8249630704522133e-02 + + -7.8161589801311493e-02 2.9064230620861053e-02 + <_> + + 0 -1 6594 -1.5538600273430347e-02 + + -1.4481380581855774e-01 3.8434058427810669e-02 + <_> + + 0 -1 6595 3.8620950654149055e-03 + + -3.8745380938053131e-02 9.8183527588844299e-02 + <_> + + 0 -1 6596 1.5253369696438313e-02 + + 1.7946500331163406e-02 -3.0948030948638916e-01 + <_> + + 0 -1 6597 -4.2140888981521130e-03 + + 5.7521570473909378e-02 -2.7782430872321129e-02 + <_> + + 0 -1 6598 -2.1610679104924202e-03 + + 1.0617449879646301e-01 -5.9411250054836273e-02 + <_> + + 0 -1 6599 -1.8687519477680326e-03 + + -1.2807689607143402e-01 4.7781638801097870e-02 + <_> + + 0 -1 6600 -6.2083022203296423e-04 + + 1.1725349724292755e-01 -4.7861199826002121e-02 + <_> + + 0 -1 6601 -2.5575871113687754e-03 + + 5.7900648564100266e-02 -8.4036856889724731e-02 + <_> + + 0 -1 6602 4.1207410395145416e-03 + + 5.4239779710769653e-02 -1.2611140310764313e-01 + <_> + + 0 -1 6603 1.7525779083371162e-02 + + 2.8792750090360641e-02 -1.9793170690536499e-01 + <_> + + 0 -1 6604 -1.9012490287423134e-02 + + 1.1444319784641266e-01 -6.6813051700592041e-02 + <_> + + 0 -1 6605 9.5198452472686768e-03 + + -3.9105638861656189e-02 8.8588982820510864e-02 + <_> + + 0 -1 6606 7.7857482247054577e-03 + + 4.7903850674629211e-02 -1.1941280215978622e-01 + <_> + + 0 -1 6607 -2.5355129037052393e-03 + + 6.1377499252557755e-02 -5.1576390862464905e-02 + <_> + + 0 -1 6608 1.3886679708957672e-01 + + 7.1258218958973885e-03 -7.5076061487197876e-01 + <_> + + 0 -1 6609 -3.0958889983594418e-03 + + 7.3432266712188721e-02 -4.0409181267023087e-02 + <_> + + 0 -1 6610 4.7118910588324070e-03 + + 2.2374270483851433e-02 -2.3885080218315125e-01 + <_> + + 0 -1 6611 6.3587618060410023e-03 + + 5.3684379905462265e-02 -1.3398240506649017e-01 + <_> + + 0 -1 6612 6.8367011845111847e-02 + + -3.6103919148445129e-02 1.7410080134868622e-01 + <_> + + 0 -1 6613 -3.2802459318190813e-03 + + -1.4603079855442047e-01 4.8215139657258987e-02 + <_> + + 0 -1 6614 -6.6430270671844482e-02 + + 4.6738991141319275e-01 -1.3140380382537842e-02 + <_> + + 0 -1 6615 -4.2274069041013718e-02 + + -6.3253331184387207e-01 1.0359439998865128e-02 + <_> + + 0 -1 6616 -1.0691370116546750e-03 + + -1.1469829827547073e-01 4.5048121362924576e-02 + <_> + + 0 -1 6617 5.4235469549894333e-02 + + -1.9809609279036522e-02 3.1430730223655701e-01 + <_> + + 0 -1 6618 -7.2852471930673346e-06 + + 5.8051250874996185e-02 -1.0246170312166214e-01 + <_> + + 0 -1 6619 2.0893309265375137e-02 + + 1.5608809888362885e-02 -2.1545739471912384e-01 + <_> + + 0 -1 6620 -5.3765181452035904e-02 + + 2.0559239387512207e-01 -3.2525919377803802e-02 + <_> + + 0 -1 6621 -1.5972670167684555e-02 + + -1.7119890451431274e-01 1.4773829840123653e-02 + <_> + + 0 -1 6622 -1.4591409824788570e-02 + + -2.3046019673347473e-01 2.3345010355114937e-02 + <_> + + 0 -1 6623 2.4016639217734337e-03 + + -2.8272429481148720e-02 9.5124237239360809e-02 + <_> + + 0 -1 6624 -2.0430689677596092e-02 + + 4.0655559301376343e-01 -1.6212539747357368e-02 + <_> + + 0 -1 6625 8.1926792860031128e-02 + + 8.7937163189053535e-03 -4.0210300683975220e-01 + <_> + + 0 -1 6626 -1.2892849743366241e-02 + + -1.1946929991245270e-01 4.5022130012512207e-02 + <_> + + 0 -1 6627 9.4712682068347931e-02 + + -1.0760080069303513e-02 2.1693980693817139e-01 + <_> + + 0 -1 6628 4.0901689790189266e-03 + + -8.4592603147029877e-02 7.0457696914672852e-02 + <_> + + 0 -1 6629 -1.2496539950370789e-01 + + 2.8276950120925903e-01 -4.2760102078318596e-03 + <_> + + 0 -1 6630 1.5758169814944267e-02 + + -4.8926588147878647e-02 1.2380229681730270e-01 + <_> + + 0 -1 6631 -5.2818129770457745e-03 + + 6.1836440116167068e-02 -3.6712940782308578e-02 + <_> + + 0 -1 6632 8.6735859513282776e-03 + + -4.7372240573167801e-02 1.5809150040149689e-01 + <_> + + 0 -1 6633 -5.2273580804467201e-03 + + -1.1694569885730743e-01 2.9156440868973732e-02 + <_> + + 0 -1 6634 6.1831828206777573e-02 + + 8.0447606742382050e-03 -6.8530529737472534e-01 + <_> + + 0 -1 6635 6.6815607249736786e-02 + + -8.4813889116048813e-03 1.4523769915103912e-01 + <_> + + 0 -1 6636 -1.0062000155448914e-01 + + 7.4605828523635864e-01 -6.8016690202057362e-03 + <_> + + 0 -1 6637 -1.4751539565622807e-02 + + -1.4893519878387451e-01 3.9579190313816071e-02 + <_> + + 0 -1 6638 3.4616589546203613e-02 + + -2.0749099552631378e-02 2.8549820184707642e-01 + <_> + + 0 -1 6639 -1.2966389954090118e-01 + + -5.5446487665176392e-01 4.6082548797130585e-03 + <_> + + 0 -1 6640 7.4035510420799255e-02 + + 5.3174998611211777e-03 -8.4149527549743652e-01 + <_> + + 0 -1 6641 1.0177110135555267e-01 + + -7.6451660133898258e-03 3.5442221164703369e-01 + <_> + + 0 -1 6642 8.9658737182617188e-02 + + -9.3901483342051506e-03 5.0577938556671143e-01 + <_> + + 0 -1 6643 -1.6180740296840668e-01 + + -6.5451782941818237e-01 8.7116202339529991e-03 + <_> + + 0 -1 6644 1.8784119747579098e-03 + + 5.2064418792724609e-02 -9.0741947293281555e-02 + <_> + + 0 -1 6645 1.9505689851939678e-03 + + -5.4091621190309525e-02 3.5506200045347214e-02 + <_> + + 0 -1 6646 -6.0789179988205433e-03 + + 1.2238519638776779e-01 -4.6803738921880722e-02 + <_> + + 0 -1 6647 -2.2403250634670258e-01 + + -7.7728492021560669e-01 2.3639709688723087e-03 + <_> + + 0 -1 6648 -1.3039590418338776e-01 + + -2.7692648768424988e-01 2.1548289805650711e-02 + <_> + + 0 -1 6649 7.2587423026561737e-02 + + 1.0621299967169762e-02 -1.6270780563354492e-01 + <_> + + 0 -1 6650 7.3180042207241058e-02 + + -1.7519259825348854e-02 3.3697870373725891e-01 + <_> + + 0 -1 6651 -3.4525979310274124e-02 + + -5.3538697957992554e-01 1.0397709906101227e-02 + <_> + + 0 -1 6652 2.3753559216856956e-03 + + 5.1910828799009323e-02 -9.6959516406059265e-02 + <_> + + 0 -1 6653 -6.8947779946029186e-03 + + 8.2409977912902832e-02 -2.3098999634385109e-02 + <_> + + 0 -1 6654 -9.4773292541503906e-02 + + -7.0510691404342651e-01 7.7322297729551792e-03 + <_> + + 0 -1 6655 5.6327427737414837e-03 + + 1.7960680648684502e-02 -7.2307042777538300e-02 + <_> + + 0 -1 6656 6.6090249456465244e-03 + + -3.6701079457998276e-02 1.3706339895725250e-01 + <_> + + 0 -1 6657 -2.4978399276733398e-02 + + -1.6281390190124512e-01 7.6992698013782501e-03 + <_> + + 0 -1 6658 -6.0882410034537315e-03 + + 1.0555619746446609e-01 -4.8507411032915115e-02 + <_> + + 0 -1 6659 6.1161588877439499e-02 + + 1.1127579491585493e-03 -5.6657880544662476e-01 + <_> + + 0 -1 6660 -3.8722809404134750e-02 + + -5.9797358512878418e-01 8.4153199568390846e-03 + <_> + + 0 -1 6661 6.2335198745131493e-03 + + 3.1563021242618561e-02 -1.8769240379333496e-01 + <_> + + 0 -1 6662 1.6939510405063629e-01 + + -1.7183739691972733e-02 3.1440049409866333e-01 + <_> + + 0 -1 6663 8.5851341485977173e-02 + + 5.7081878185272217e-03 -4.9966809153556824e-01 + <_> + + 0 -1 6664 -2.0315010100603104e-02 + + -1.2359900027513504e-01 4.4704839587211609e-02 + <_> + + 0 -1 6665 -4.0276069194078445e-03 + + 4.7957219183444977e-02 -9.7137056291103363e-02 + <_> + + 0 -1 6666 -3.9274509996175766e-02 + + 1.8804270029067993e-01 -2.9754199087619781e-02 + <_> + + 0 -1 6667 -2.1163629367947578e-02 + + -1.5724900364875793e-01 3.9636529982089996e-02 + <_> + + 0 -1 6668 4.0783579461276531e-03 + + -4.7562818974256516e-02 1.0976249724626541e-01 + <_> + + 0 -1 6669 1.0180410463362932e-03 + + -6.6306091845035553e-02 9.8773077130317688e-02 + <_> + + 0 -1 6670 2.8516049496829510e-03 + + -5.1101740449666977e-02 9.6994958817958832e-02 + <_> + + 0 -1 6671 4.8373742029070854e-03 + + 4.0866550058126450e-02 -1.2480360269546509e-01 + <_> + + 0 -1 6672 -3.4715479705482721e-04 + + 4.1778691112995148e-02 -1.2574540078639984e-01 + <_> + + 0 -1 6673 -6.3760261982679367e-03 + + 1.5754230320453644e-01 -4.1692778468132019e-02 + <_> + + 0 -1 6674 -1.2534069828689098e-02 + + -1.3565440475940704e-01 4.1295569390058517e-02 + <_> + + 0 -1 6675 -2.3321550339460373e-02 + + 1.2518349289894104e-01 -1.3427260331809521e-02 + <_> + + 0 -1 6676 2.1691620349884033e-03 + + 1.4331200718879700e-01 -3.5120349377393723e-02 + <_> + + 0 -1 6677 -5.0005540251731873e-02 + + 2.1500219404697418e-01 -2.7628419920802116e-02 + <_> + + 0 -1 6678 1.3818169943988323e-02 + + 2.2208500653505325e-02 -2.6048558950424194e-01 + <_> + + 0 -1 6679 -1.1389379948377609e-01 + + -2.6434680819511414e-01 5.8247619308531284e-03 + <_> + + 0 -1 6680 1.4204699546098709e-03 + + -7.1546286344528198e-02 7.0379182696342468e-02 + <_> + + 0 -1 6681 1.2329610064625740e-02 + + 2.9475130140781403e-02 -1.9224089384078979e-01 + <_> + + 0 -1 6682 3.4679430536925793e-03 + + -6.1920940876007080e-02 9.0893089771270752e-02 + <_> + + 0 -1 6683 -1.2088479846715927e-01 + + 4.6626859903335571e-01 -2.7361230459064245e-03 + <_> + + 0 -1 6684 -1.5827519819140434e-02 + + -9.5342837274074554e-02 5.5003169924020767e-02 + <_> + + 0 -1 6685 -5.3695850074291229e-03 + + 1.6891020536422729e-01 -4.6700950711965561e-02 + <_> + + 0 -1 6686 5.2695080637931824e-02 + + -5.6889699772000313e-03 9.0487861633300781e-01 + <_> + + 0 -1 6687 -1.1397979687899351e-03 + + 3.4316681325435638e-02 -7.5787901878356934e-02 + <_> + + 0 -1 6688 -2.8946578968316317e-03 + + 7.5482390820980072e-02 -7.6466552913188934e-02 + <_> + + 0 -1 6689 -5.1091420464217663e-03 + + -1.2294950336217880e-01 4.9972750246524811e-02 + <_> + + 0 -1 6690 1.8837359966710210e-03 + + 4.3406400829553604e-02 -1.2572230398654938e-01 + <_> + + 0 -1 6691 1.5422919765114784e-02 + + 1.5831289812922478e-02 -2.0917390286922455e-01 + <_> + + 0 -1 6692 2.1666040644049644e-02 + + -2.4713400751352310e-02 2.4171669781208038e-01 + <_> + + 0 -1 6693 -9.4336412847042084e-02 + + 8.0389547348022461e-01 -2.6913180481642485e-03 + <_> + + 0 -1 6694 -6.0154758393764496e-03 + + -1.3231749832630157e-01 4.9613710492849350e-02 + <_> + + 0 -1 6695 4.3775320053100586e-02 + + 4.5396219938993454e-03 -5.8732748031616211e-01 + <_> + + 0 -1 6696 1.0561950039118528e-03 + + -8.8057562708854675e-02 7.1294106543064117e-02 + <_> + + 0 -1 6697 -1.6394529957324266e-03 + + 9.0810842812061310e-02 -3.7760701030492783e-02 + <_> + + 0 -1 6698 2.6742160320281982e-01 + + 9.4182817265391350e-03 -5.2740138769149780e-01 + <_> + + 0 -1 6699 -2.1629330515861511e-01 + + -6.1128187179565430e-01 5.2118571475148201e-03 + <_> + + 0 -1 6700 -2.6974570751190186e-01 + + -7.3394459486007690e-01 6.0041057877242565e-03 + <_> + + 0 -1 6701 -6.0050850734114647e-03 + + 1.1067090183496475e-01 -2.0614199340343475e-02 + <_> + + 0 -1 6702 4.9247939139604568e-02 + + 1.0287189856171608e-02 -4.9581390619277954e-01 + <_> + + 0 -1 6703 4.9235569313168526e-03 + + 1.4880360104143620e-02 -1.1287470161914825e-01 + <_> + + 0 -1 6704 -8.2946997135877609e-03 + + 5.6476062536239624e-01 -1.0442149825394154e-02 + <_> + + 0 -1 6705 2.3567330092191696e-02 + + -2.9235871043056250e-03 2.4979250133037567e-01 + <_> + + 0 -1 6706 -4.1040919721126556e-02 + + 4.0030491352081299e-01 -1.3312620110809803e-02 + <_> + + 0 -1 6707 -5.3690220229327679e-03 + + -2.9186370968818665e-01 1.6781600192189217e-02 + <_> + + 0 -1 6708 3.6616099532693624e-03 + + -4.7920960932970047e-02 1.0898339748382568e-01 + <_> + + 0 -1 6709 -2.4735789746046066e-02 + + 6.7270919680595398e-02 -1.6207970678806305e-02 + <_> + + 0 -1 6710 8.6064152419567108e-03 + + -6.0250200331211090e-02 1.0674320161342621e-01 + <_> + + 0 -1 6711 -3.3892609179019928e-02 + + -1.9795329868793488e-01 1.9014969468116760e-02 + <_> + + 0 -1 6712 1.0522030293941498e-01 + + 6.0530952177941799e-03 -7.5238007307052612e-01 + <_> + + 0 -1 6713 -5.9583578258752823e-03 + + 9.9094383418560028e-02 -3.5570640116930008e-02 + <_> + + 0 -1 6714 2.7306210249662399e-03 + + -8.8879808783531189e-02 6.4843989908695221e-02 + <_> + + 0 -1 6715 4.3243571417406201e-04 + + 3.2528489828109741e-02 -9.1479070484638214e-02 + <_> + + 0 -1 6716 -5.2608880214393139e-03 + + 1.3896170258522034e-01 -4.0624819695949554e-02 + <_> + + 0 -1 6717 -1.5605129301548004e-01 + + -7.3170071840286255e-01 2.5103189982473850e-03 + <_> + + 0 -1 6718 -1.1245990172028542e-02 + + -1.1834110319614410e-01 5.2261721342802048e-02 + <_> + + 0 -1 6719 -9.2654878972098231e-04 + + 4.3350778520107269e-02 -7.6521359384059906e-02 + <_> + + 0 -1 6720 1.5148459933698177e-03 + + -7.1485839784145355e-02 7.3206916451454163e-02 + <_> + + 0 -1 6721 4.6230577863752842e-03 + + 2.0211879163980484e-02 -4.6565961092710495e-02 + <_> + + 0 -1 6722 1.2555140256881714e-01 + + 9.2135155573487282e-03 -5.4831707477569580e-01 + <_> + + 0 -1 6723 4.0751680731773376e-02 + + -4.5771248638629913e-02 5.6990999728441238e-02 + <_> + + 0 -1 6724 -2.2074349224567413e-02 + + -3.9075499773025513e-01 1.1654710397124290e-02 + <_> + + 0 -1 6725 1.2412919849157333e-01 + + -6.0688108205795288e-03 2.6376709342002869e-01 + <_> + + 0 -1 6726 6.0741119086742401e-03 + + 1.0768520087003708e-01 -5.0139870494604111e-02 + <_> + + 0 -1 6727 -1.4694149792194366e-01 + + -4.3452548980712891e-01 5.5836569517850876e-03 + <_> + + 0 -1 6728 -1.2046460062265396e-01 + + -5.4068279266357422e-01 9.8318615928292274e-03 + <_> + + 0 -1 6729 -9.0990159660577774e-03 + + -1.3625259697437286e-01 9.5357475802302361e-03 + <_> + + 0 -1 6730 1.0966449975967407e-02 + + -3.1344298273324966e-02 1.7068630456924438e-01 + <_> + + 0 -1 6731 -2.1763380616903305e-02 + + 7.3918178677558899e-02 -1.7846420407295227e-02 + <_> + + 0 -1 6732 -4.9578789621591568e-02 + + -5.8034032583236694e-01 1.0063209570944309e-02 + <_> + + 0 -1 6733 -6.6796392202377319e-03 + + -4.7280300408601761e-02 3.8668069988489151e-02 + <_> + + 0 -1 6734 -1.0112039744853973e-03 + + 4.5412030071020126e-02 -1.4603359997272491e-01 + <_> + + 0 -1 6735 2.5813570246100426e-03 + + 3.1112480908632278e-02 -1.0001499950885773e-01 + <_> + + 0 -1 6736 2.0418369676917791e-03 + + 4.8378061503171921e-02 -1.4722709357738495e-01 + <_> + + 0 -1 6737 5.6246068328619003e-02 + + 3.7779449485242367e-03 -6.1013627052307129e-01 + <_> + + 0 -1 6738 -2.6130750775337219e-02 + + 2.6240581274032593e-01 -2.4313600733876228e-02 + <_> + + 0 -1 6739 -1.2151029892265797e-02 + + -5.6114129722118378e-02 2.9739160090684891e-02 + <_> + + 0 -1 6740 -5.1036469638347626e-02 + + 2.7955740690231323e-01 -2.1683510392904282e-02 + <_> + + 0 -1 6741 8.7444618344306946e-02 + + -3.7635879125446081e-03 5.2711361646652222e-01 + <_> + + 0 -1 6742 3.4982790239155293e-03 + + 5.6673228740692139e-02 -9.2554636299610138e-02 + <_> + + 0 -1 6743 9.7861722111701965e-02 + + 3.7442990578711033e-03 -5.4237729310989380e-01 + <_> + + 0 -1 6744 -6.3886200077831745e-03 + + -9.7468167543411255e-02 6.0299299657344818e-02 + <_> + + 0 -1 6745 -1.0128310322761536e-01 + + -6.5173667669296265e-01 3.4321940038353205e-03 + <_> + + 0 -1 6746 -3.9312228560447693e-02 + + 2.6476991176605225e-01 -2.6981310918927193e-02 + <_> + + 0 -1 6747 1.1417990177869797e-01 + + 7.5375889427959919e-03 -6.8553638458251953e-01 + <_> + + 0 -1 6748 8.4078265354037285e-03 + + -3.0973089858889580e-02 1.7200429737567902e-01 + <_> + + 0 -1 6749 -1.5489499783143401e-03 + + 4.6454809606075287e-02 -6.9261766970157623e-02 + <_> + + 0 -1 6750 2.9730569804087281e-04 + + 3.7772700190544128e-02 -1.3767069578170776e-01 + <_> + + 0 -1 6751 2.8460770845413208e-03 + + -4.3182320892810822e-02 9.9634610116481781e-02 + <_> + + 0 -1 6752 4.9144420772790909e-02 + + 5.9465290978550911e-03 -8.2366597652435303e-01 + <_> + + 0 -1 6753 1.0286020115017891e-02 + + 2.8591090813279152e-02 -1.5941999852657318e-01 + <_> + + 0 -1 6754 1.9976280629634857e-02 + + -2.9617030173540115e-02 1.5943069756031036e-01 + <_> + + 0 -1 6755 2.3533409461379051e-02 + + 7.5594270601868629e-03 -2.3041130602359772e-01 + <_> + + 0 -1 6756 -9.0482197701931000e-03 + + -1.2408699840307236e-01 4.1615001857280731e-02 + <_> + + 0 -1 6757 -3.8635660894215107e-03 + + 8.7811216711997986e-02 -4.1511181741952896e-02 + <_> + + 0 -1 6758 -2.7298410423099995e-03 + + 9.4712667167186737e-02 -5.2838958799839020e-02 + <_> + + 0 -1 6759 -4.5442068949341774e-03 + + -1.0748460143804550e-01 1.7744770273566246e-02 + <_> + + 0 -1 6760 2.3271010722965002e-03 + + -8.3826236426830292e-02 5.7210709899663925e-02 + <_> + + 0 -1 6761 -1.2409550137817860e-02 + + 2.3100300133228302e-01 -2.2110419347882271e-02 + <_> + + 0 -1 6762 -4.5268908143043518e-03 + + -1.6244150698184967e-01 3.2564349472522736e-02 + <_> + + 0 -1 6763 -4.4666860048891976e-05 + + 2.4341119825839996e-01 -2.6702800765633583e-02 + <_> + + 0 -1 6764 7.7015289571136236e-04 + + -1.2858650088310242e-01 4.2308151721954346e-02 + <_> + + 0 -1 6765 4.4863048940896988e-02 + + 1.0781999677419662e-02 -3.5814240574836731e-01 + <_> + + 0 -1 6766 3.7869490683078766e-02 + + -1.4966360293328762e-02 3.4195008873939514e-01 + <_> + + 0 -1 6767 -8.3092376589775085e-03 + + -2.7514660358428955e-01 2.0139539614319801e-02 + <_> + + 0 -1 6768 -4.3290119618177414e-02 + + 3.0036559700965881e-01 -1.9493019208312035e-02 + <_> + + 0 -1 6769 -1.0075629688799381e-02 + + -1.2262579798698425e-01 9.1246366500854492e-03 + <_> + + 0 -1 6770 -3.3486529719084501e-03 + + 1.1790259927511215e-01 -4.1050188243389130e-02 + <_> + + 0 -1 6771 -6.4645247766748071e-04 + + -7.8154936432838440e-02 4.6990569680929184e-02 + <_> + + 0 -1 6772 3.5247370600700378e-02 + + 1.0365270078182220e-02 -5.1507127285003662e-01 + <_> + + 0 -1 6773 3.5965928691439331e-04 + + -7.7936813235282898e-02 3.0275240540504456e-02 + <_> + + 0 -1 6774 -1.5898740384727716e-03 + + -1.0594320297241211e-01 5.0036150962114334e-02 + <_> + + 0 -1 6775 -2.1408300846815109e-02 + + 1.1649339646100998e-01 -3.7540700286626816e-02 + <_> + + 0 -1 6776 -2.7612380217760801e-03 + + 3.4751810133457184e-02 -1.3718530535697937e-01 + <_> + + 0 -1 6777 6.4307968132197857e-03 + + -1.3667429797351360e-02 1.4938560128211975e-01 + <_> + + 0 -1 6778 -6.9555612280964851e-03 + + -1.2171459943056107e-01 5.6100189685821533e-02 + <_> + + 0 -1 6779 -2.7654969692230225e-01 + + -8.5077387094497681e-01 3.8885050453245640e-03 + <_> + + 0 -1 6780 4.7567309811711311e-03 + + -6.5594427287578583e-02 7.5947061181068420e-02 + <_> + + 0 -1 6781 8.9218050241470337e-02 + + 6.5016360022127628e-03 -3.2032990455627441e-01 + <_> + + 0 -1 6782 6.7748151719570160e-02 + + -1.1878870427608490e-02 4.4954490661621094e-01 + <_> + + 0 -1 6783 4.5336190611124039e-02 + + 7.4317739345133305e-03 -4.3144878745079041e-01 + <_> + + 0 -1 6784 1.0965850204229355e-02 + + 2.5135010480880737e-02 -2.0359070599079132e-01 + <_> + + 0 -1 6785 -6.5938562154769897e-02 + + 4.5524141192436218e-01 -7.5815711170434952e-03 + <_> + + 0 -1 6786 -4.2270109057426453e-02 + + 3.8470050692558289e-01 -1.1672279797494411e-02 + <_> + + 0 -1 6787 -6.3518402166664600e-03 + + -8.7010167539119720e-02 3.4159921109676361e-02 + <_> + + 0 -1 6788 3.2269880175590515e-02 + + -4.0711440145969391e-02 1.2469469755887985e-01 + <_> + + 0 -1 6789 -3.9068311452865601e-02 + + -1.0403119772672653e-01 6.7032999359071255e-03 + <_> + + 0 -1 6790 -1.0384949855506420e-03 + + 5.8422528207302094e-02 -1.0154890269041061e-01 + <_> + + 0 -1 6791 2.9740650206804276e-02 + + 1.2596059590578079e-02 -1.5170450508594513e-01 + <_> + + 0 -1 6792 5.3193639032542706e-03 + + -4.6843089163303375e-02 1.1005250364542007e-01 + <_> + + 0 -1 6793 -3.2385820522904396e-03 + + -1.0309839993715286e-01 5.0686061382293701e-02 + <_> + + 0 -1 6794 4.2344750836491585e-03 + + -4.9582429230213165e-02 1.2092150002717972e-01 + <_> + + 0 -1 6795 -7.4786663055419922e-02 + + -4.6895131468772888e-01 3.8582859560847282e-03 + <_> + + 0 -1 6796 8.5299033671617508e-03 + + 3.8806159049272537e-02 -1.2022049725055695e-01 + <_> + + 0 -1 6797 -4.8662569373846054e-02 + + 1.6113990545272827e-01 -1.1717130430042744e-02 + <_> + + 0 -1 6798 -1.3677199603989720e-03 + + -8.5303716361522675e-02 5.5394109338521957e-02 + <_> + + 0 -1 6799 -5.8111362159252167e-03 + + 4.7039270401000977e-02 -5.1736868917942047e-02 + <_> + + 0 -1 6800 -3.9951619692146778e-03 + + -7.8167162835597992e-02 6.3919343054294586e-02 + <_> + + 0 -1 6801 3.0817699152976274e-03 + + -6.9289833307266235e-02 2.8242539614439011e-02 + <_> + + 0 -1 6802 -4.6279471367597580e-02 + + -3.4760490059852600e-01 1.3878909870982170e-02 + <_> + + 0 -1 6803 -1.8725780770182610e-02 + + 1.5222269296646118e-01 -1.5724090859293938e-02 + <_> + + 0 -1 6804 -2.1445369347929955e-02 + + -3.5962730646133423e-01 1.2764260172843933e-02 + <_> + + 0 -1 6805 -9.1003477573394775e-02 + + -7.9615950584411621e-01 4.9090441316366196e-03 + <_> + + 0 -1 6806 2.5607119314372540e-03 + + -5.4551690816879272e-02 8.4403410553932190e-02 + <_> + + 0 -1 6807 -1.3662099838256836e-02 + + 9.4987250864505768e-02 -6.2036819756031036e-02 + <_> + + 0 -1 6808 9.2437807470560074e-03 + + 5.3822331130504608e-02 -9.9236510694026947e-02 + <_> + + 0 -1 6809 -1.4612140133976936e-02 + + -1.5248660743236542e-01 4.2905550450086594e-02 + <_> + + 0 -1 6810 -3.9584659039974213e-02 + + 1.5883240103721619e-01 -3.5484429448843002e-02 + <_> + + 0 -1 6811 -6.7460699938237667e-03 + + 1.1749260127544403e-01 -3.7934441119432449e-02 + <_> + + 0 -1 6812 2.0449559669941664e-03 + + 6.1626188457012177e-02 -9.4409346580505371e-02 + <_> + + 0 -1 6813 -1.5146560035645962e-02 + + -3.3887571096420288e-01 6.8320450372993946e-03 + <_> + + 0 -1 6814 -2.0916219800710678e-03 + + -1.4829570055007935e-01 3.3358350396156311e-02 + <_> + + 0 -1 6815 1.3274390250444412e-02 + + -3.8169000297784805e-02 4.6379629522562027e-02 + <_> + + 0 -1 6816 1.2404330074787140e-02 + + -1.8498679623007774e-02 2.7952960133552551e-01 + <_> + + 0 -1 6817 -2.3678259924054146e-02 + + -4.7142859548330307e-02 2.3141339421272278e-02 + <_> + + 0 -1 6818 6.7575983703136444e-02 + + -1.8598400056362152e-02 2.7481150627136230e-01 + <_> + + 0 -1 6819 7.6359122991561890e-02 + + 2.9178129509091377e-02 -2.0572820305824280e-01 + <_> + + 0 -1 6820 -1.0918889939785004e-01 + + 6.2577211856842041e-01 -9.8246810957789421e-03 + <_> + + 0 -1 6821 1.2964319903403521e-03 + + -3.1776499003171921e-02 6.7833930253982544e-02 + <_> + + 0 -1 6822 4.1218679398298264e-02 + + 8.5701625794172287e-03 -5.8379119634628296e-01 + <_> + + 0 -1 6823 -1.8773629562929273e-03 + + 5.3263541311025620e-02 -4.1702788323163986e-02 + <_> + + 0 -1 6824 -2.9402649961411953e-03 + + 8.6931921541690826e-02 -7.1344070136547089e-02 + <_> + + 0 -1 6825 -3.0833749100565910e-02 + + -3.9439570903778076e-01 6.0907239094376564e-03 + <_> + + 0 -1 6826 -3.7960989866405725e-03 + + 7.4150532484054565e-02 -6.1881281435489655e-02 + <_> + + 0 -1 6827 -6.3087488524615765e-03 + + -1.1662469804286957e-01 2.5016760453581810e-02 + <_> + + 0 -1 6828 4.0001370944082737e-03 + + -5.7236731052398682e-02 9.7589701414108276e-02 + <_> + + 0 -1 6829 6.7752957344055176e-02 + + 9.5101362094283104e-03 -3.3777019381523132e-01 + <_> + + 0 -1 6830 -9.2353783547878265e-02 + + 7.9015249013900757e-01 -6.2939748167991638e-03 + <_> + + 0 -1 6831 -2.4050839245319366e-02 + + -1.5585710108280182e-01 1.8099930137395859e-02 + <_> + + 0 -1 6832 3.2272089738398790e-03 + + -4.7936741262674332e-02 1.0735899955034256e-01 + <_> + + 0 -1 6833 -7.2444709949195385e-03 + + 9.6775539219379425e-02 -2.4095900356769562e-02 + <_> + + 0 -1 6834 -1.0888259857892990e-01 + + -8.1255799531936646e-01 6.0875630006194115e-03 + <_> + + 0 -1 6835 -1.4077230356633663e-02 + + -1.3358989357948303e-01 2.5421140715479851e-02 + <_> + + 0 -1 6836 -3.0071370303630829e-02 + + 3.5427039861679077e-01 -1.3553430326282978e-02 + <_> + + 0 -1 6837 3.4985799342393875e-02 + + -3.0686240643262863e-03 4.6311178803443909e-01 + <_> + + 0 -1 6838 1.8354769796133041e-02 + + 1.1218019761145115e-02 -4.6143579483032227e-01 + <_> + + 0 -1 6839 -6.4306408166885376e-02 + + -6.1207151412963867e-01 1.9155009649693966e-03 + <_> + + 0 -1 6840 8.2096129655838013e-02 + + -8.8210906833410263e-03 5.4885977506637573e-01 + <_> + + 0 -1 6841 7.7698810491710901e-04 + + 1.3247950375080109e-01 -3.3915128558874130e-02 + <_> + + 0 -1 6842 6.4568981528282166e-02 + + 6.4043831080198288e-03 -7.7150177955627441e-01 + <_> + + 0 -1 6843 -1.5833489596843719e-02 + + -1.9498950242996216e-01 7.5541301630437374e-03 + <_> + + 0 -1 6844 3.4125618636608124e-02 + + -1.5915289521217346e-02 2.9716441035270691e-01 + <_> + + 0 -1 6845 -1.2615050189197063e-02 + + -2.4650709331035614e-01 2.2699799388647079e-02 + <_> + + 0 -1 6846 1.8272679299116135e-02 + + -4.0593959391117096e-02 1.1693490296602249e-01 + <_> + + 0 -1 6847 -6.6374349407851696e-03 + + -1.4557109773159027e-01 3.5353910177946091e-02 + <_> + + 0 -1 6848 -2.6520919054746628e-03 + + 7.6382592320442200e-02 -6.6688627004623413e-02 + <_> + + 0 -1 6849 2.2452129051089287e-03 + + -8.9759878814220428e-02 5.5091369897127151e-02 + <_> + + 0 -1 6850 -4.4775419519282877e-04 + + 2.1264159679412842e-01 -2.6620639488101006e-02 + <_> + + 0 -1 6851 -1.1115259677171707e-01 + + -4.3139949440956116e-01 4.6484731137752533e-03 + <_> + + 0 -1 6852 -1.1578770354390144e-02 + + -3.5296261310577393e-01 1.2750539928674698e-02 + <_> + + 0 -1 6853 -2.5290170684456825e-02 + + 5.1385980844497681e-01 -6.7363809794187546e-03 + <_> + + 0 -1 6854 -3.2232340425252914e-02 + + -5.7690191268920898e-01 7.7741048298776150e-03 + <_> + + 0 -1 6855 -4.1698799468576908e-03 + + -1.7519310116767883e-01 1.1018699966371059e-02 + <_> + + 0 -1 6856 -2.0664500072598457e-02 + + 2.5821951031684875e-01 -1.7920289188623428e-02 + <_> + + 0 -1 6857 -1.0834420099854469e-03 + + -1.3178519904613495e-01 2.5419749319553375e-02 + <_> + + 0 -1 6858 -9.5458701252937317e-03 + + 4.4964689016342163e-01 -1.1315030045807362e-02 + <_> + + 0 -1 6859 5.3232181817293167e-02 + + 7.4498020112514496e-03 -6.8122059106826782e-01 + <_> + + 0 -1 6860 -1.3852520287036896e-01 + + -6.0117882490158081e-01 6.5434179268777370e-03 + <_> + + 0 -1 6861 1.7173439264297485e-02 + + -2.5120509788393974e-02 8.6516633629798889e-02 + <_> + + 0 -1 6862 3.9947189390659332e-02 + + 5.8647249825298786e-03 -7.4653059244155884e-01 + <_> + + 0 -1 6863 2.0647009834647179e-02 + + -1.0226000100374222e-02 1.7227609455585480e-01 + <_> + + 0 -1 6864 -1.8602909985929728e-03 + + -6.5767973661422729e-02 6.9248490035533905e-02 + <_> + + 0 -1 6865 -3.4106068313121796e-02 + + 1.5908730030059814e-01 -1.3241630047559738e-02 + <_> + + 0 -1 6866 6.3425069674849510e-03 + + 3.5119149833917618e-02 -1.3436080515384674e-01 + <_> + + 0 -1 6867 1.6866199439391494e-03 + + -4.3401770293712616e-02 5.0606630742549896e-02 + <_> + + 0 -1 6868 -3.0595089774578810e-03 + + 5.6976709514856339e-02 -8.1074528396129608e-02 + <_> + + 0 -1 6869 2.7664829976856709e-03 + + 2.0497009158134460e-02 -8.0963827669620514e-02 + <_> + + 0 -1 6870 -3.2909188885241747e-03 + + -1.0803789645433426e-01 4.6237960457801819e-02 + <_> + + 0 -1 6871 1.7244400456547737e-02 + + -2.5127060711383820e-02 2.4591030180454254e-01 + <_> + + 0 -1 6872 9.1161586344242096e-02 + + 1.0174980387091637e-02 -4.6983879804611206e-01 + <_> + + 0 -1 6873 2.5459621101617813e-03 + + -3.0003750696778297e-02 1.4800469577312469e-01 + <_> + + 0 -1 6874 1.7582690343260765e-03 + + 5.4400689899921417e-02 -7.7444270253181458e-02 + <_> + + 0 -1 6875 -1.6833960544317961e-03 + + 8.1838123500347137e-02 -4.3751198798418045e-02 + <_> + + 0 -1 6876 -7.6617579907178879e-04 + + -1.3564400374889374e-01 3.6041948944330215e-02 + <_> + + 0 -1 6877 1.1155450483784080e-03 + + -4.8263888806104660e-02 5.0273448228836060e-02 + <_> + + 0 -1 6878 -2.6005289983004332e-03 + + 8.8793486356735229e-02 -5.4554209113121033e-02 + <_> + + 0 -1 6879 -3.2424980308860540e-03 + + -1.3159190118312836e-01 3.4248508512973785e-02 + <_> + + 0 -1 6880 -1.4817930059507489e-04 + + 3.7875428795814514e-02 -1.2225220352411270e-01 + <_> + + 0 -1 6881 1.1546639725565910e-02 + + 1.5370969660580158e-02 -1.0286240279674530e-01 + <_> + + 0 -1 6882 2.4446300230920315e-03 + + -5.1783051341772079e-02 1.0735079646110535e-01 + <_> + + 0 -1 6883 4.5723789371550083e-03 + + -3.6362100392580032e-02 1.3289859890937805e-01 + <_> + + 0 -1 6884 -1.1938340030610561e-02 + + -1.0882350057363510e-01 4.7698900103569031e-02 + <_> + + 0 -1 6885 -4.1671381331980228e-03 + + 1.1637099832296371e-01 -3.0638780444860458e-02 + <_> + 399 + -1.2330470085144043e+00 + + <_> + + 0 -1 6886 3.3659618347883224e-02 + + -1.5576040744781494e-01 1.9109010696411133e-01 + <_> + + 0 -1 6887 -1.5392389614135027e-03 + + 7.2527736425399780e-02 -2.8808951377868652e-01 + <_> + + 0 -1 6888 1.5648789703845978e-03 + + -1.1329220235347748e-01 1.5057389438152313e-01 + <_> + + 0 -1 6889 5.6565739214420319e-04 + + -4.0502288937568665e-01 3.0235100537538528e-02 + <_> + + 0 -1 6890 -2.9683491447940469e-04 + + -1.2592320144176483e-01 1.0352999716997147e-01 + <_> + + 0 -1 6891 4.3946141377091408e-03 + + -1.0582420229911804e-01 2.3163750767707825e-02 + <_> + + 0 -1 6892 3.2444300595670938e-03 + + 5.0188560038805008e-02 -2.5477260351181030e-01 + <_> + + 0 -1 6893 3.8864749949425459e-03 + + -1.4332659542560577e-01 2.9871070757508278e-02 + <_> + + 0 -1 6894 3.3563380129635334e-03 + + -1.8739770352840424e-01 6.1354521661996841e-02 + <_> + + 0 -1 6895 1.9797699525952339e-02 + + 2.7567919343709946e-02 -7.3189876973628998e-02 + <_> + + 0 -1 6896 3.3829871099442244e-03 + + -2.6915690302848816e-01 4.7561220824718475e-02 + <_> + + 0 -1 6897 5.0223460420966148e-03 + + 4.2572669684886932e-02 -2.0097489655017853e-01 + <_> + + 0 -1 6898 1.4903279952704906e-03 + + -1.0160639882087708e-01 1.1291279643774033e-01 + <_> + + 0 -1 6899 -5.5050072260200977e-03 + + -2.1760410070419312e-01 2.5067379698157310e-02 + <_> + + 0 -1 6900 4.1127130389213562e-03 + + -1.3703300058841705e-01 6.6536687314510345e-02 + <_> + + 0 -1 6901 1.9442260265350342e-02 + + 4.2253911495208740e-02 -1.1731100082397461e-01 + <_> + + 0 -1 6902 -1.9445870071649551e-02 + + 2.8616631031036377e-01 -3.0423089861869812e-02 + <_> + + 0 -1 6903 -1.5500449808314443e-03 + + -1.5157119929790497e-01 6.3723236322402954e-02 + <_> + + 0 -1 6904 -3.2575910445302725e-03 + + 6.1063949018716812e-02 -1.3006690144538879e-01 + <_> + + 0 -1 6905 8.5774611216038465e-04 + + -6.2051288783550262e-02 5.4809290915727615e-02 + <_> + + 0 -1 6906 6.8592262687161565e-04 + + -9.2828713357448578e-02 9.2287853360176086e-02 + <_> + + 0 -1 6907 4.8905659466981888e-02 + + -1.2098040431737900e-02 2.4674870073795319e-01 + <_> + + 0 -1 6908 -4.6415459364652634e-03 + + -1.7103439569473267e-01 5.1900148391723633e-02 + <_> + + 0 -1 6909 -9.9253775551915169e-03 + + 1.6824729740619659e-01 -4.3742731213569641e-02 + <_> + + 0 -1 6910 -7.2820088826119900e-04 + + -1.5762010216712952e-01 4.9283239990472794e-02 + <_> + + 0 -1 6911 7.1829417720437050e-03 + + -7.5083851814270020e-02 1.5677660703659058e-01 + <_> + + 0 -1 6912 7.4819842120632529e-04 + + 9.4303682446479797e-02 -9.4410486519336700e-02 + <_> + + 0 -1 6913 1.3856319710612297e-02 + + 4.2250029742717743e-02 -2.4046279489994049e-01 + <_> + + 0 -1 6914 -5.0514908507466316e-03 + + 2.0170919597148895e-01 -4.4972479343414307e-02 + <_> + + 0 -1 6915 -2.5696419179439545e-03 + + -1.4004689455032349e-01 4.1754510253667831e-02 + <_> + + 0 -1 6916 5.4275751113891602e-02 + + -2.6094799861311913e-02 2.8374740481376648e-01 + <_> + + 0 -1 6917 -3.7299469113349915e-02 + + -5.8281177282333374e-01 1.3501949608325958e-02 + <_> + + 0 -1 6918 3.0674990266561508e-03 + + 5.6224178522825241e-02 -1.1995050311088562e-01 + <_> + + 0 -1 6919 -3.5402809735387564e-03 + + 6.6515468060970306e-02 -1.1834269762039185e-01 + <_> + + 0 -1 6920 4.1401982307434082e-03 + + 2.0988019183278084e-02 -3.1807440519332886e-01 + <_> + + 0 -1 6921 -1.1183559894561768e-02 + + 1.2467139959335327e-01 -4.1797909885644913e-02 + <_> + + 0 -1 6922 1.0800679447129369e-03 + + 4.5548491179943085e-02 -1.5857310593128204e-01 + <_> + + 0 -1 6923 -7.7602718956768513e-03 + + -1.7031720280647278e-01 3.3989530056715012e-02 + <_> + + 0 -1 6924 -3.1192360911518335e-03 + + 9.6817880868911743e-02 -8.6022533476352692e-02 + <_> + + 0 -1 6925 -1.3673380017280579e-02 + + -2.2536599636077881e-01 1.5587169677019119e-02 + <_> + + 0 -1 6926 -2.0611209329217672e-03 + + -1.5269860625267029e-01 5.0227679312229156e-02 + <_> + + 0 -1 6927 2.2635459899902344e-03 + + -4.2889460921287537e-02 7.6818563044071198e-02 + <_> + + 0 -1 6928 -3.4530080854892731e-02 + + 1.2874439358711243e-01 -6.7660316824913025e-02 + <_> + + 0 -1 6929 6.1309239827096462e-03 + + -6.3456058502197266e-02 6.4237646758556366e-02 + <_> + + 0 -1 6930 -1.0171280242502689e-02 + + -2.9192021489143372e-01 2.6645509526133537e-02 + <_> + + 0 -1 6931 -1.3060650229454041e-01 + + -9.6297067403793335e-01 1.5367489540949464e-03 + <_> + + 0 -1 6932 6.8621779792010784e-03 + + -4.7239519655704498e-02 1.5440399944782257e-01 + <_> + + 0 -1 6933 1.2950079981237650e-03 + + -7.1122348308563232e-02 5.8697238564491272e-02 + <_> + + 0 -1 6934 -5.6443549692630768e-03 + + -1.7261339724063873e-01 4.4769309461116791e-02 + <_> + + 0 -1 6935 1.6346110403537750e-01 + + -2.1536830812692642e-02 3.6825808882713318e-01 + <_> + + 0 -1 6936 1.4170600101351738e-02 + + 2.3462019860744476e-02 -3.0498749017715454e-01 + <_> + + 0 -1 6937 -1.0679910331964493e-01 + + 3.1485679745674133e-01 -9.1049326583743095e-03 + <_> + + 0 -1 6938 7.0258649066090584e-03 + + -6.5418191254138947e-02 1.0200239717960358e-01 + <_> + + 0 -1 6939 -4.3358937837183475e-03 + + 1.1601199954748154e-01 -5.5041059851646423e-02 + <_> + + 0 -1 6940 3.5394240170717239e-02 + + 2.7795480564236641e-02 -2.5534549355506897e-01 + <_> + + 0 -1 6941 2.1599680185317993e-02 + + -1.0513960383832455e-02 2.6087591052055359e-01 + <_> + + 0 -1 6942 4.3032150715589523e-03 + + -4.6745400875806808e-02 1.3318620622158051e-01 + <_> + + 0 -1 6943 7.8372862190008163e-03 + + 6.1899811029434204e-02 -1.2405169755220413e-01 + <_> + + 0 -1 6944 -1.6856989823281765e-03 + + -9.5696307718753815e-02 7.7667310833930969e-02 + <_> + + 0 -1 6945 -4.1602249257266521e-03 + + 6.5850533545017242e-02 -7.6837591826915741e-02 + <_> + + 0 -1 6946 -5.0864819437265396e-02 + + 5.2419060468673706e-01 -1.7342429608106613e-02 + <_> + + 0 -1 6947 -6.4477883279323578e-02 + + -4.1972258687019348e-01 1.2231100350618362e-02 + <_> + + 0 -1 6948 -2.4949579965323210e-03 + + 6.4242206513881683e-02 -9.7457312047481537e-02 + <_> + + 0 -1 6949 3.2167730387300253e-03 + + -3.7902288138866425e-02 8.2197092473506927e-02 + <_> + + 0 -1 6950 -2.3393060546368361e-03 + + -1.0608460009098053e-01 7.2004899382591248e-02 + <_> + + 0 -1 6951 -8.0535542219877243e-03 + + -1.0991869866847992e-01 2.5643279775977135e-02 + <_> + + 0 -1 6952 1.5007739886641502e-02 + + -3.1267128884792328e-02 2.0507030189037323e-01 + <_> + + 0 -1 6953 -4.7144708223640919e-03 + + -1.4058899879455566e-01 4.8687249422073364e-02 + <_> + + 0 -1 6954 -2.7188581228256226e-01 + + -7.7086192369461060e-01 8.2119107246398926e-03 + <_> + + 0 -1 6955 -3.7261729594320059e-03 + + 7.8386418521404266e-02 -6.1110321432352066e-02 + <_> + + 0 -1 6956 8.1726117059588432e-03 + + 2.5872390717267990e-02 -2.4203300476074219e-01 + <_> + + 0 -1 6957 -1.5384130179882050e-01 + + -8.3681619167327881e-01 1.0526239639148116e-03 + <_> + + 0 -1 6958 -4.2209690436720848e-03 + + 1.0987819731235504e-01 -6.0973130166530609e-02 + <_> + + 0 -1 6959 3.4641180187463760e-02 + + 5.9377611614763737e-03 -7.3021429777145386e-01 + <_> + + 0 -1 6960 -1.0757029522210360e-03 + + 6.3253231346607208e-02 -9.3954533338546753e-02 + <_> + + 0 -1 6961 6.0506182489916682e-04 + + -7.2633743286132812e-02 5.4847791790962219e-02 + <_> + + 0 -1 6962 -4.9192002043128014e-03 + + -1.4617989957332611e-01 4.9854889512062073e-02 + <_> + + 0 -1 6963 5.8641340583562851e-02 + + -1.4487889595329762e-02 2.1949279308319092e-01 + <_> + + 0 -1 6964 -9.5993638038635254e-02 + + -4.2456990480422974e-01 1.5611169859766960e-02 + <_> + + 0 -1 6965 -1.7546750605106354e-01 + + -5.7154530286788940e-01 2.7310380246490240e-03 + <_> + + 0 -1 6966 5.3192701190710068e-02 + + -2.0759610459208488e-02 3.1531611084938049e-01 + <_> + + 0 -1 6967 -3.0862109735608101e-02 + + -4.0818691253662109e-01 9.1538606211543083e-03 + <_> + + 0 -1 6968 -2.9243549797683954e-03 + + 1.6538919508457184e-01 -3.7048339843750000e-02 + <_> + + 0 -1 6969 7.9757552593946457e-03 + + 4.0010299533605576e-02 -1.0603089630603790e-01 + <_> + + 0 -1 6970 1.0228200256824493e-01 + + 9.6151717007160187e-03 -6.5299248695373535e-01 + <_> + + 0 -1 6971 2.3435470648109913e-03 + + -4.3119609355926514e-02 1.1908730119466782e-01 + <_> + + 0 -1 6972 -3.3627110533416271e-03 + + 1.0518670082092285e-01 -6.9644443690776825e-02 + <_> + + 0 -1 6973 4.9040392041206360e-03 + + 4.8949901014566422e-02 -1.2949359416961670e-01 + <_> + + 0 -1 6974 4.5119290007278323e-05 + + -1.6148559749126434e-01 4.1733540594577789e-02 + <_> + + 0 -1 6975 1.6195859760046005e-02 + + -1.2759320437908173e-02 2.0746350288391113e-01 + <_> + + 0 -1 6976 -6.4254719763994217e-03 + + -1.3736939430236816e-01 4.3490421026945114e-02 + <_> + + 0 -1 6977 -6.6467811120674014e-04 + + 6.6771537065505981e-02 -7.4648462235927582e-02 + <_> + + 0 -1 6978 -2.3743628989905119e-03 + + -1.2377700209617615e-01 5.1728729158639908e-02 + <_> + + 0 -1 6979 -8.3166018128395081e-02 + + 1.5261100232601166e-01 -2.1502759307622910e-02 + <_> + + 0 -1 6980 1.3301270082592964e-03 + + -6.1925448477268219e-02 1.0591439902782440e-01 + <_> + + 0 -1 6981 9.0925350785255432e-02 + + 6.9404938258230686e-03 -5.1022678613662720e-01 + <_> + + 0 -1 6982 5.7555912062525749e-03 + + 5.2849009633064270e-02 -1.0758169740438461e-01 + <_> + + 0 -1 6983 9.3440711498260498e-04 + + -1.0605130344629288e-01 4.7824278473854065e-02 + <_> + + 0 -1 6984 5.2353799343109131e-02 + + -1.6387209296226501e-02 4.2318668961524963e-01 + <_> + + 0 -1 6985 -2.4307209998369217e-02 + + 1.3521690666675568e-01 -1.0088359937071800e-02 + <_> + + 0 -1 6986 -1.3722239993512630e-02 + + -4.9520999193191528e-01 1.1784340254962444e-02 + <_> + + 0 -1 6987 -1.1442030081525445e-03 + + 4.3818730860948563e-02 -6.9104023277759552e-02 + <_> + + 0 -1 6988 -7.8848190605640411e-02 + + 3.5198599100112915e-01 -1.6464689746499062e-02 + <_> + + 0 -1 6989 1.7305529909208417e-03 + + -6.6790081560611725e-02 8.2463577389717102e-02 + <_> + + 0 -1 6990 -1.2928839772939682e-02 + + -8.1002123653888702e-02 8.5223287343978882e-02 + <_> + + 0 -1 6991 8.7096104398369789e-03 + + -5.0021901726722717e-02 1.3493220508098602e-01 + <_> + + 0 -1 6992 -6.3483066856861115e-02 + + -7.7681750059127808e-01 7.0912609808146954e-03 + <_> + + 0 -1 6993 -4.3746097944676876e-03 + + -1.3329389691352844e-01 4.2627040296792984e-02 + <_> + + 0 -1 6994 -4.3985169380903244e-02 + + 1.5131869912147522e-01 -4.0801558643579483e-02 + <_> + + 0 -1 6995 -6.0488767921924591e-03 + + -5.3645741194486618e-02 1.7832729965448380e-02 + <_> + + 0 -1 6996 -5.1487190648913383e-04 + + 6.2102951109409332e-02 -9.5339402556419373e-02 + <_> + + 0 -1 6997 -3.3046479802578688e-03 + + -2.4732820689678192e-01 2.1977340802550316e-02 + <_> + + 0 -1 6998 -3.0949179199524224e-04 + + -3.4656081348657608e-02 1.9599510729312897e-01 + <_> + + 0 -1 6999 -8.3323381841182709e-03 + + 1.7436729371547699e-01 -3.2631549984216690e-02 + <_> + + 0 -1 7000 6.6935829818248749e-03 + + 2.5050759315490723e-02 -2.7362829446792603e-01 + <_> + + 0 -1 7001 1.4068570453673601e-03 + + -2.9797010123729706e-02 6.5752580761909485e-02 + <_> + + 0 -1 7002 4.0725398808717728e-02 + + 1.4967479743063450e-02 -3.7111800909042358e-01 + <_> + + 0 -1 7003 -2.1524120122194290e-02 + + 3.7294471263885498e-01 -1.4142910018563271e-02 + <_> + + 0 -1 7004 4.1689630597829819e-02 + + 8.3227548748254776e-03 -6.6822868585586548e-01 + <_> + + 0 -1 7005 -3.2075429335236549e-03 + + 6.2741018831729889e-02 -1.3061609864234924e-01 + <_> + + 0 -1 7006 2.6418430730700493e-02 + + 6.6760168410837650e-03 -7.5557070970535278e-01 + <_> + + 0 -1 7007 -5.1153838634490967e-02 + + -5.0382971763610840e-01 2.2476969752460718e-03 + <_> + + 0 -1 7008 1.5723450342193246e-03 + + -6.0214620083570480e-02 7.9933151602745056e-02 + <_> + + 0 -1 7009 1.2616170570254326e-03 + + 4.4674988836050034e-02 -8.3830736577510834e-02 + <_> + + 0 -1 7010 -2.8608670458197594e-02 + + -3.0249071121215820e-01 1.6254810616374016e-02 + <_> + + 0 -1 7011 1.4726459980010986e-02 + + -4.9459420144557953e-02 1.1457759886980057e-01 + <_> + + 0 -1 7012 3.5319201648235321e-02 + + 1.1276819743216038e-02 -4.8055538535118103e-01 + <_> + + 0 -1 7013 2.2470189630985260e-01 + + -1.0596769861876965e-02 5.4026299715042114e-01 + <_> + + 0 -1 7014 -7.0188841782510281e-03 + + -1.1836989969015121e-01 5.2995279431343079e-02 + <_> + + 0 -1 7015 -2.9194930568337440e-02 + + 2.8498569130897522e-01 -1.4652130194008350e-02 + <_> + + 0 -1 7016 -1.6918469918891788e-03 + + 6.7731522023677826e-02 -7.4129588901996613e-02 + <_> + + 0 -1 7017 1.3110489584505558e-02 + + -4.0418051183223724e-02 9.6537798643112183e-02 + <_> + + 0 -1 7018 7.5334981374908239e-05 + + -7.3065057396888733e-02 7.1049667894840240e-02 + <_> + + 0 -1 7019 2.9962710104882717e-03 + + 2.4401130154728889e-02 -1.0679820179939270e-01 + <_> + + 0 -1 7020 -4.1236128658056259e-02 + + 2.5446560978889465e-01 -1.9801229238510132e-02 + <_> + + 0 -1 7021 2.2827479988336563e-03 + + -5.9622149914503098e-02 8.6871787905693054e-02 + <_> + + 0 -1 7022 -2.1318379731383175e-04 + + 4.0506061166524887e-02 -1.2357629835605621e-01 + <_> + + 0 -1 7023 4.1725938208401203e-03 + + 4.1674789041280746e-02 -1.3029229640960693e-01 + <_> + + 0 -1 7024 -1.7945859581232071e-02 + + 2.5395989418029785e-01 -2.0783929154276848e-02 + <_> + + 0 -1 7025 -6.0957930982112885e-02 + + -5.9399938583374023e-01 5.6327730417251587e-03 + <_> + + 0 -1 7026 -8.3080737385898829e-04 + + 4.8011310398578644e-02 -1.1289869993925095e-01 + <_> + + 0 -1 7027 2.7037229388952255e-02 + + 2.6524379849433899e-02 -1.7208619415760040e-01 + <_> + + 0 -1 7028 3.7293829955160618e-03 + + -5.0795450806617737e-02 1.1093439906835556e-01 + <_> + + 0 -1 7029 -1.0271129431203008e-03 + + -8.9025869965553284e-02 4.9861740320920944e-02 + <_> + + 0 -1 7030 4.3261310202069581e-04 + + -7.6471529901027679e-02 7.2490736842155457e-02 + <_> + + 0 -1 7031 -8.3997912704944611e-02 + + 4.0178960561752319e-01 -8.4397885948419571e-03 + <_> + + 0 -1 7032 -3.4407388884574175e-03 + + -1.4326460659503937e-01 3.9170410484075546e-02 + <_> + + 0 -1 7033 -2.1418789401650429e-02 + + 1.5835569798946381e-01 -1.3701870106160641e-02 + <_> + + 0 -1 7034 2.4877830874174833e-03 + + -5.6875430047512054e-02 1.0218720138072968e-01 + <_> + + 0 -1 7035 -1.0390300303697586e-03 + + 8.1530712544918060e-02 -4.7183711081743240e-02 + <_> + + 0 -1 7036 4.6788761392235756e-04 + + 7.0995680987834930e-02 -8.8464602828025818e-02 + <_> + + 0 -1 7037 2.7436260133981705e-02 + + 1.5190550126135349e-02 -1.2117669731378555e-01 + <_> + + 0 -1 7038 -5.8917858405038714e-04 + + -8.1471607089042664e-02 6.8480782210826874e-02 + <_> + + 0 -1 7039 7.9439081251621246e-02 + + -7.3907868936657906e-03 1.4902259409427643e-01 + <_> + + 0 -1 7040 -3.5153090953826904e-02 + + 4.1942089796066284e-01 -1.2480289675295353e-02 + <_> + + 0 -1 7041 6.8230971693992615e-02 + + 9.3489149585366249e-03 -2.5965470075607300e-01 + <_> + + 0 -1 7042 8.1733033061027527e-02 + + 1.5513390302658081e-02 -3.2704469561576843e-01 + <_> + + 0 -1 7043 -3.0718350317329168e-03 + + 6.6938467323780060e-02 -4.2225748300552368e-02 + <_> + + 0 -1 7044 5.6301880627870560e-02 + + -2.5680650025606155e-02 2.1728150546550751e-01 + <_> + + 0 -1 7045 2.5166019797325134e-02 + + 2.3228300735354424e-02 -9.2791043221950531e-02 + <_> + + 0 -1 7046 6.5088197588920593e-02 + + 6.8949609994888306e-03 -8.2639491558074951e-01 + <_> + + 0 -1 7047 2.2007930092513561e-03 + + -7.4394248425960541e-02 8.7209381163120270e-02 + <_> + + 0 -1 7048 -8.8553391396999359e-03 + + -1.3203050196170807e-01 3.7658430635929108e-02 + <_> + + 0 -1 7049 6.0942411422729492e-02 + + 1.0197839699685574e-02 -5.4252862930297852e-01 + <_> + + 0 -1 7050 -5.2589550614356995e-04 + + 4.8835718631744385e-01 -1.1828079819679260e-02 + <_> + + 0 -1 7051 1.3005370274186134e-03 + + -3.8898441195487976e-01 1.4226339757442474e-02 + <_> + + 0 -1 7052 -1.6531689465045929e-01 + + 4.0004518628120422e-01 -1.2666770257055759e-02 + <_> + + 0 -1 7053 1.8595480360090733e-03 + + 4.7802660614252090e-02 -1.1368919909000397e-01 + <_> + + 0 -1 7054 1.3065179809927940e-02 + + -3.3714219927787781e-02 1.5762269496917725e-01 + <_> + + 0 -1 7055 3.1612750142812729e-02 + + 7.6767429709434509e-03 -5.9641021490097046e-01 + <_> + + 0 -1 7056 -2.2566620260477066e-02 + + 1.0603710263967514e-01 -4.7383170574903488e-02 + <_> + + 0 -1 7057 6.2679480761289597e-03 + + 3.4595031291246414e-02 -7.7622346580028534e-02 + <_> + + 0 -1 7058 -3.1758081167936325e-02 + + -3.2147431373596191e-01 1.5986470505595207e-02 + <_> + + 0 -1 7059 -2.1477609872817993e-02 + + 2.0527760684490204e-01 -1.8074609339237213e-02 + <_> + + 0 -1 7060 1.8594050779938698e-02 + + 1.6375590115785599e-02 -2.9955211281776428e-01 + <_> + + 0 -1 7061 1.4604429714381695e-02 + + -2.0433440804481506e-02 2.2725510597229004e-01 + <_> + + 0 -1 7062 1.9902919884771109e-03 + + -5.8518249541521072e-02 1.0997360199689865e-01 + <_> + + 0 -1 7063 9.7299525514245033e-03 + + 3.1371861696243286e-02 -4.4369909912347794e-02 + <_> + + 0 -1 7064 -2.3401379585266113e-03 + + 9.6488200128078461e-02 -5.7249929755926132e-02 + <_> + + 0 -1 7065 -1.9590060692280531e-03 + + -1.4031149446964264e-01 1.3546340167522430e-02 + <_> + + 0 -1 7066 8.4066856652498245e-03 + + 6.6289551556110382e-02 -8.0348283052444458e-02 + <_> + + 0 -1 7067 5.2574548870325089e-02 + + -3.6297008395195007e-02 1.4638340473175049e-01 + <_> + + 0 -1 7068 4.1065202094614506e-03 + + 3.0372349545359612e-02 -1.8155770003795624e-01 + <_> + + 0 -1 7069 -4.1818427853286266e-03 + + 5.5590789765119553e-02 -3.7148520350456238e-02 + <_> + + 0 -1 7070 -1.5470250509679317e-03 + + 1.0347150266170502e-01 -4.6374730765819550e-02 + <_> + + 0 -1 7071 -8.2695618038997054e-04 + + -9.3296989798545837e-02 4.3734461069107056e-02 + <_> + + 0 -1 7072 4.1385791264474392e-03 + + -4.4266488403081894e-02 1.0968980193138123e-01 + <_> + + 0 -1 7073 -3.3684119582176208e-02 + + -6.4337152242660522e-01 7.9893283545970917e-03 + <_> + + 0 -1 7074 5.2798818796873093e-02 + + -1.2490300461649895e-02 4.1572460532188416e-01 + <_> + + 0 -1 7075 -2.9699259996414185e-01 + + -1.9598379731178284e-01 9.4300797209143639e-03 + <_> + + 0 -1 7076 1.1196310073137283e-01 + + 1.1162719689309597e-02 -4.6838051080703735e-01 + <_> + + 0 -1 7077 -1.8544310703873634e-02 + + -7.4080787599086761e-02 1.9528210163116455e-02 + <_> + + 0 -1 7078 -1.0937429964542389e-02 + + 8.8206529617309570e-02 -6.2830187380313873e-02 + <_> + + 0 -1 7079 2.7186619117856026e-03 + + 3.0855480581521988e-02 -9.2405863106250763e-02 + <_> + + 0 -1 7080 2.0727319642901421e-02 + + -5.2543301135301590e-02 1.0608410090208054e-01 + <_> + + 0 -1 7081 -2.7961930260062218e-02 + + 2.1735160052776337e-01 -2.1356139332056046e-02 + <_> + + 0 -1 7082 -9.0406360104680061e-03 + + -1.9535389542579651e-01 3.0077420175075531e-02 + <_> + + 0 -1 7083 -1.0906349867582321e-02 + + 1.4888639748096466e-01 -3.1188679859042168e-02 + <_> + + 0 -1 7084 -3.8616119418293238e-03 + + -1.2094800174236298e-01 4.5144081115722656e-02 + <_> + + 0 -1 7085 4.3162601068615913e-03 + + -1.0713649913668633e-02 2.8116491436958313e-01 + <_> + + 0 -1 7086 -1.4098359970375896e-03 + + 6.4685508608818054e-02 -9.9471300840377808e-02 + <_> + + 0 -1 7087 3.2964099664241076e-03 + + 1.4295330643653870e-01 -3.1101010739803314e-02 + <_> + + 0 -1 7088 -2.9802869539707899e-03 + + -2.4578930437564850e-01 2.1760260686278343e-02 + <_> + + 0 -1 7089 6.7178793251514435e-02 + + 3.3457649406045675e-03 -4.5685601234436035e-01 + <_> + + 0 -1 7090 2.9182849451899529e-02 + + -1.7016859725117683e-02 3.3545929193496704e-01 + <_> + + 0 -1 7091 1.7935150535777211e-03 + + 3.0516179278492928e-02 -1.2526740133762360e-01 + <_> + + 0 -1 7092 2.0465679466724396e-02 + + -1.0909980162978172e-02 4.3552139401435852e-01 + <_> + + 0 -1 7093 -2.6115079526789486e-04 + + 3.8759760558605194e-02 -6.4098693430423737e-02 + <_> + + 0 -1 7094 3.7161160726100206e-03 + + 3.7150889635086060e-02 -1.5467320382595062e-01 + <_> + + 0 -1 7095 -7.4094999581575394e-03 + + -8.2704223692417145e-02 6.2809906899929047e-02 + <_> + + 0 -1 7096 1.7094809561967850e-02 + + -4.8347331583499908e-02 9.8770812153816223e-02 + <_> + + 0 -1 7097 -3.0473200604319572e-03 + + -1.0638830065727234e-01 3.0948650091886520e-02 + <_> + + 0 -1 7098 3.4502498805522919e-02 + + 1.0997230187058449e-02 -4.2861738801002502e-01 + <_> + + 0 -1 7099 -2.6834919117391109e-03 + + -1.4986449480056763e-01 3.3157639205455780e-02 + <_> + + 0 -1 7100 9.2392861843109131e-03 + + -3.7733338773250580e-02 1.5778259932994843e-01 + <_> + + 0 -1 7101 8.8205106556415558e-02 + + -1.0704769752919674e-02 3.2353109121322632e-01 + <_> + + 0 -1 7102 7.7868886291980743e-02 + + 1.0804659686982632e-02 -4.4243350625038147e-01 + <_> + + 0 -1 7103 -3.1202291138470173e-03 + + 2.0444509387016296e-01 -2.3976439610123634e-02 + <_> + + 0 -1 7104 2.6000461075454950e-03 + + 4.5765019953250885e-02 -1.0138899832963943e-01 + <_> + + 0 -1 7105 7.0194108411669731e-03 + + 2.5740729644894600e-02 -4.9060840159654617e-02 + <_> + + 0 -1 7106 -2.4108150973916054e-03 + + -1.1837480217218399e-01 4.8649929463863373e-02 + <_> + + 0 -1 7107 4.9886249005794525e-02 + + -1.4449880458414555e-02 2.0894059538841248e-01 + <_> + + 0 -1 7108 -7.2655039839446545e-03 + + 8.9042186737060547e-02 -4.9845550209283829e-02 + <_> + + 0 -1 7109 1.0560270398855209e-02 + + 5.2911709994077682e-02 -1.1509139835834503e-01 + <_> + + 0 -1 7110 5.6417449377477169e-03 + + -6.8672746419906616e-02 7.7489316463470459e-02 + <_> + + 0 -1 7111 4.3234648182988167e-03 + + -7.9207062721252441e-02 5.3491309285163879e-02 + <_> + + 0 -1 7112 1.1184070259332657e-02 + + 7.1656093001365662e-02 -1.0634940117597580e-01 + <_> + + 0 -1 7113 -9.9230423569679260e-02 + + 3.7169519066810608e-01 -6.6843931563198566e-03 + <_> + + 0 -1 7114 -4.4848727993667126e-03 + + 7.5577408075332642e-02 -6.9481082260608673e-02 + <_> + + 0 -1 7115 -1.9104180857539177e-02 + + -1.7291219532489777e-01 1.1360409669578075e-02 + <_> + + 0 -1 7116 -1.7672680551186204e-03 + + 9.2567160725593567e-02 -5.2470050752162933e-02 + <_> + + 0 -1 7117 5.9071529656648636e-02 + + 9.2153968289494514e-03 -2.6687648892402649e-01 + <_> + + 0 -1 7118 -3.4362819045782089e-02 + + -5.7914721965789795e-01 7.9972539097070694e-03 + <_> + + 0 -1 7119 5.6766539812088013e-02 + + 5.8937501162290573e-03 -5.2275192737579346e-01 + <_> + + 0 -1 7120 -1.2173549830913544e-01 + + -5.2229601144790649e-01 7.9296948388218880e-03 + <_> + + 0 -1 7121 3.4274619072675705e-02 + + -1.7069879919290543e-02 1.2958990037441254e-01 + <_> + + 0 -1 7122 -6.7191021516919136e-03 + + 1.1187720298767090e-01 -4.4685728847980499e-02 + <_> + + 0 -1 7123 3.1698260456323624e-02 + + 2.8529319912195206e-02 -1.1617069691419601e-01 + <_> + + 0 -1 7124 -9.5326751470565796e-02 + + 3.6362048983573914e-01 -1.3523319736123085e-02 + <_> + + 0 -1 7125 1.2620569765567780e-01 + + 6.0956259258091450e-03 -8.4947621822357178e-01 + <_> + + 0 -1 7126 -2.7324870228767395e-02 + + -2.9046019911766052e-01 1.4303879812359810e-02 + <_> + + 0 -1 7127 -7.3618680238723755e-02 + + 4.8824289441108704e-01 -1.0269859805703163e-02 + <_> + + 0 -1 7128 5.0417389720678329e-03 + + -8.4770277142524719e-02 5.6035611778497696e-02 + <_> + + 0 -1 7129 2.7569099329411983e-03 + + -4.8269480466842651e-02 3.8525570183992386e-02 + <_> + + 0 -1 7130 2.1967370063066483e-02 + + 8.6190566420555115e-02 -8.0797329545021057e-02 + <_> + + 0 -1 7131 -3.8637530803680420e-01 + + -8.3998018503189087e-01 3.6657860036939383e-03 + <_> + + 0 -1 7132 -4.1083219647407532e-01 + + -9.7182428836822510e-01 3.9403690025210381e-03 + <_> + + 0 -1 7133 -4.1033279150724411e-02 + + 1. -3.3212041016668081e-03 + <_> + + 0 -1 7134 2.4305000901222229e-02 + + 1.8234970048069954e-02 -2.4954320490360260e-01 + <_> + + 0 -1 7135 1.6170740127563477e-03 + + -1.2958160042762756e-01 3.2725200057029724e-02 + <_> + + 0 -1 7136 4.4785268604755402e-02 + + -2.3868849501013756e-02 1.9763439893722534e-01 + <_> + + 0 -1 7137 4.0209591388702393e-02 + + 5.3034191951155663e-03 -6.6284531354904175e-01 + <_> + + 0 -1 7138 3.3616109285503626e-03 + + 3.0226179957389832e-01 -1.6103280708193779e-02 + <_> + + 0 -1 7139 -1.1624400503933430e-03 + + -2.7934190630912781e-01 1.8276169896125793e-02 + <_> + + 0 -1 7140 5.5524259805679321e-02 + + -6.5288958139717579e-03 7.5690442323684692e-01 + <_> + + 0 -1 7141 4.6308599412441254e-03 + + 2.8254630044102669e-02 -9.4945177435874939e-02 + <_> + + 0 -1 7142 2.7387610170990229e-03 + + -4.6980410814285278e-02 9.4511218369007111e-02 + <_> + + 0 -1 7143 2.9127181041985750e-03 + + -2.2264670580625534e-02 7.2091333568096161e-02 + <_> + + 0 -1 7144 -2.3628510534763336e-02 + + -3.9147511124610901e-01 1.2840859591960907e-02 + <_> + + 0 -1 7145 7.1669870521873236e-04 + + 2.0413680002093315e-02 -1.6587799787521362e-01 + <_> + + 0 -1 7146 3.2723631709814072e-02 + + 8.5352789610624313e-03 -5.1838648319244385e-01 + <_> + + 0 -1 7147 5.6393269449472427e-02 + + -2.4937599897384644e-02 1.9025549292564392e-01 + <_> + + 0 -1 7148 2.9392001032829285e-01 + + 5.7944031432271004e-03 -8.5530591011047363e-01 + <_> + + 0 -1 7149 -5.6904228404164314e-03 + + -2.4354919791221619e-01 1.0601679794490337e-02 + <_> + + 0 -1 7150 9.8184328526258469e-03 + + -1.3599770143628120e-02 3.3795401453971863e-01 + <_> + + 0 -1 7151 -3.6970589309930801e-02 + + -5.7309299707412720e-01 1.0090970434248447e-02 + <_> + + 0 -1 7152 1.8607610836625099e-02 + + -1.2938570231199265e-02 4.1123750805854797e-01 + <_> + + 0 -1 7153 -1.5049210051074624e-03 + + -8.4678567945957184e-02 3.3724751323461533e-02 + <_> + + 0 -1 7154 -3.9040379226207733e-02 + + -4.7390699386596680e-01 9.5385275781154633e-03 + <_> + + 0 -1 7155 -3.4379279240965843e-03 + + 1.4112870395183563e-01 -2.2367769852280617e-02 + <_> + + 0 -1 7156 -1.1330900015309453e-03 + + -1.3950189948081970e-01 3.2505869865417480e-02 + <_> + + 0 -1 7157 -6.5370470285415649e-02 + + 1.4801700413227081e-01 -2.2039920091629028e-02 + <_> + + 0 -1 7158 -2.0970970392227173e-01 + + -7.4392271041870117e-01 7.5829490087926388e-03 + <_> + + 0 -1 7159 -5.8827060274779797e-03 + + -6.3253037631511688e-02 2.3363839834928513e-02 + <_> + + 0 -1 7160 -2.9759449884295464e-02 + + 4.8733299970626831e-01 -9.2995148152112961e-03 + <_> + + 0 -1 7161 -5.3064361214637756e-02 + + -3.8064101338386536e-01 5.6431228294968605e-03 + <_> + + 0 -1 7162 6.6667333245277405e-02 + + 4.6323328278958797e-03 -9.1536080837249756e-01 + <_> + + 0 -1 7163 -9.2325232923030853e-02 + + 2.9184600710868835e-01 -7.4540497735142708e-03 + <_> + + 0 -1 7164 8.5644036531448364e-02 + + -1.0288530029356480e-02 4.1251561045646667e-01 + <_> + + 0 -1 7165 2.2969970107078552e-01 + + -4.6802540309727192e-03 3.6509141325950623e-01 + <_> + + 0 -1 7166 8.7508037686347961e-03 + + 7.7816851437091827e-02 -6.3657559454441071e-02 + <_> + + 0 -1 7167 5.7104961015284061e-03 + + -5.9653200209140778e-02 4.2732730507850647e-02 + <_> + + 0 -1 7168 -4.8026451840996742e-03 + + -9.8918512463569641e-02 4.4956978410482407e-02 + <_> + + 0 -1 7169 3.2986800651997328e-03 + + 3.3164538443088531e-02 -1.3477820158004761e-01 + <_> + + 0 -1 7170 -4.0092850103974342e-03 + + 1.3551770150661469e-01 -3.7139780819416046e-02 + <_> + + 0 -1 7171 -7.7049341052770615e-04 + + 2.6690600439906120e-02 -8.4502391517162323e-02 + <_> + + 0 -1 7172 2.3074099794030190e-02 + + -2.6398969814181328e-02 1.8520879745483398e-01 + <_> + + 0 -1 7173 9.9315540865063667e-03 + + 2.1702500060200691e-02 -1.4147830009460449e-01 + <_> + + 0 -1 7174 -4.3977480381727219e-02 + + -5.9306997060775757e-01 7.6594059355556965e-03 + <_> + + 0 -1 7175 -2.1170598920434713e-03 + + 9.6989497542381287e-02 -4.9988958984613419e-02 + <_> + + 0 -1 7176 -1.1178949847817421e-02 + + -1.5058480203151703e-01 3.1385689973831177e-02 + <_> + + 0 -1 7177 -1.1888720327988267e-03 + + 8.7665252387523651e-02 -6.8861946463584900e-02 + <_> + + 0 -1 7178 -1.2205859646201134e-02 + + 8.2670666277408600e-02 -6.5326899290084839e-02 + <_> + + 0 -1 7179 -3.7645969539880753e-02 + + -4.8226159811019897e-01 5.5899759754538536e-03 + <_> + + 0 -1 7180 -1.7758710309863091e-03 + + -9.1606341302394867e-02 5.8380361646413803e-02 + <_> + + 0 -1 7181 -1.1116299778223038e-02 + + 1.4710609614849091e-01 -2.9255999252200127e-02 + <_> + + 0 -1 7182 4.3831788934767246e-04 + + -1.0494749993085861e-01 4.4445890933275223e-02 + <_> + + 0 -1 7183 -9.8695211112499237e-02 + + 2.6521149277687073e-01 -9.5453672111034393e-03 + <_> + + 0 -1 7184 1.1736120097339153e-02 + + 2.8968680649995804e-02 -1.5355010330677032e-01 + <_> + + 0 -1 7185 -3.6601141095161438e-02 + + 2.4063609540462494e-01 -2.2525599226355553e-02 + <_> + + 0 -1 7186 -5.2371289581060410e-02 + + -4.9006670713424683e-01 1.0319559834897518e-02 + <_> + + 0 -1 7187 -3.1134579330682755e-03 + + 6.2287129461765289e-02 -4.5234039425849915e-02 + <_> + + 0 -1 7188 1.0345289483666420e-03 + + -5.6548729538917542e-02 1.1970130354166031e-01 + <_> + + 0 -1 7189 -2.3240610025823116e-03 + + -9.5265246927738190e-02 3.2402478158473969e-02 + <_> + + 0 -1 7190 -2.7458980679512024e-02 + + 2.9548159241676331e-01 -1.6016509383916855e-02 + <_> + + 0 -1 7191 -9.3150883913040161e-03 + + -1.1465849727392197e-01 2.8171680867671967e-02 + <_> + + 0 -1 7192 7.6356199570000172e-03 + + 2.9264479875564575e-02 -1.6166350245475769e-01 + <_> + + 0 -1 7193 1.6107590869069099e-02 + + -3.0923349782824516e-02 1.6677390038967133e-01 + <_> + + 0 -1 7194 6.1460789293050766e-02 + + 8.1282109022140503e-03 -5.4833447933197021e-01 + <_> + + 0 -1 7195 4.3377321213483810e-02 + + -7.7782347798347473e-03 3.5578370094299316e-01 + <_> + + 0 -1 7196 -1.5809480100870132e-02 + + -3.1237179040908813e-01 1.4910760335624218e-02 + <_> + + 0 -1 7197 -4.3263029307126999e-02 + + 4.7393178939819336e-01 -9.4731850549578667e-03 + <_> + + 0 -1 7198 1.0775650152936578e-03 + + -1.0892640054225922e-01 5.0780758261680603e-02 + <_> + + 0 -1 7199 -6.8012787960469723e-03 + + -9.3841306865215302e-02 3.8555730134248734e-02 + <_> + + 0 -1 7200 -3.8845991366542876e-04 + + 6.4071871340274811e-02 -9.3577213585376740e-02 + <_> + + 0 -1 7201 3.8177249953150749e-03 + + -4.7590740025043488e-02 7.1997672319412231e-02 + <_> + + 0 -1 7202 -3.1246189028024673e-03 + + 1.5269869565963745e-01 -4.8789650201797485e-02 + <_> + + 0 -1 7203 6.0980509966611862e-02 + + 8.0068446695804596e-03 -6.7602759599685669e-01 + <_> + + 0 -1 7204 2.1819709800183773e-03 + + -6.8491749465465546e-02 7.5863577425479889e-02 + <_> + + 0 -1 7205 2.4469599593430758e-03 + + -7.4371293187141418e-02 3.2011859118938446e-02 + <_> + + 0 -1 7206 1.4674840494990349e-03 + + -1.1912509799003601e-01 4.6667739748954773e-02 + <_> + + 0 -1 7207 -2.1786419674754143e-03 + + -6.5324276685714722e-02 7.6355278491973877e-02 + <_> + + 0 -1 7208 -2.8284740983508527e-04 + + 5.8292400091886520e-02 -8.7847188115119934e-02 + <_> + + 0 -1 7209 1.4723110012710094e-02 + + 1.9820490479469299e-01 -2.4962980300188065e-02 + <_> + + 0 -1 7210 4.6598021872341633e-03 + + -9.3732737004756927e-02 5.4197840392589569e-02 + <_> + + 0 -1 7211 -6.0316991060972214e-02 + + -6.2958812713623047e-01 6.8706739693880081e-03 + <_> + + 0 -1 7212 -3.6654649302363396e-03 + + 3.6130189895629883e-02 -1.2816099822521210e-01 + <_> + + 0 -1 7213 1.4875479973852634e-02 + + -2.4313909932971001e-02 4.6657409518957138e-02 + <_> + + 0 -1 7214 1.1842879652976990e-01 + + 1.0476130060851574e-02 -5.1786392927169800e-01 + <_> + + 0 -1 7215 1.9809199869632721e-01 + + 1.0157800279557705e-02 -4.1872209310531616e-01 + <_> + + 0 -1 7216 -1.0167530179023743e-01 + + -8.5121291875839233e-01 4.4935508631169796e-03 + <_> + + 0 -1 7217 -3.0325200408697128e-02 + + -3.1803390383720398e-01 6.4301840029656887e-03 + <_> + + 0 -1 7218 3.4531850367784500e-02 + + -1.2561430223286152e-02 3.4778198599815369e-01 + <_> + + 0 -1 7219 -3.5133380442857742e-02 + + 1.1475030332803726e-01 -1.7527149990200996e-02 + <_> + + 0 -1 7220 5.3501729853451252e-03 + + 3.5263419151306152e-02 -1.3867680728435516e-01 + <_> + + 0 -1 7221 3.1209299340844154e-02 + + -2.0925100892782211e-02 1.4748610556125641e-01 + <_> + + 0 -1 7222 -5.5827602045610547e-04 + + -9.5544241368770599e-02 5.6234899908304214e-02 + <_> + + 0 -1 7223 -2.1599860489368439e-01 + + 5.9710198640823364e-01 -3.9994427934288979e-03 + <_> + + 0 -1 7224 7.7018201351165771e-02 + + -1.2182369828224182e-02 3.5995039343833923e-01 + <_> + + 0 -1 7225 -2.5808349251747131e-02 + + -1.9994600117206573e-01 1.6562040895223618e-02 + <_> + + 0 -1 7226 4.0148189291357994e-03 + + 3.8874860852956772e-02 -1.1775989830493927e-01 + <_> + + 0 -1 7227 7.4287859206378926e-06 + + 3.1405460089445114e-02 -4.9142509698867798e-02 + <_> + + 0 -1 7228 -2.8249230235815048e-03 + + -5.5889118462800980e-02 1.1791130155324936e-01 + <_> + + 0 -1 7229 -2.2713130339980125e-02 + + 1.0733339935541153e-01 -4.1647680103778839e-02 + <_> + + 0 -1 7230 -1.0052169673144817e-02 + + -1.4102290570735931e-01 3.7707269191741943e-02 + <_> + + 0 -1 7231 -2.1023969352245331e-01 + + -6.3184642791748047e-01 3.6316630430519581e-03 + <_> + + 0 -1 7232 -1.1812710203230381e-02 + + 1.2123010307550430e-01 -5.0373788923025131e-02 + <_> + + 0 -1 7233 6.3666589558124542e-03 + + 3.0198849737644196e-02 -9.5920257270336151e-02 + <_> + + 0 -1 7234 -1.2146410346031189e-01 + + -6.8696069717407227e-01 6.8671889603137970e-03 + <_> + + 0 -1 7235 2.3568300530314445e-02 + + -1.0376869700849056e-02 2.6333120465278625e-01 + <_> + + 0 -1 7236 -4.9841329455375671e-03 + + 5.2314449101686478e-02 -8.6597919464111328e-02 + <_> + + 0 -1 7237 1.4171230141073465e-03 + + -4.1445188224315643e-02 9.3332767486572266e-02 + <_> + + 0 -1 7238 1.6522710211575031e-03 + + 2.7292339131236076e-02 -1.7193740606307983e-01 + <_> + + 0 -1 7239 -4.2191468179225922e-02 + + 7.7588337659835815e-01 -2.4552440736442804e-03 + <_> + + 0 -1 7240 -1.5193390427157283e-03 + + 2.3297169804573059e-01 -1.9499920308589935e-02 + <_> + + 0 -1 7241 -5.9203859418630600e-03 + + -8.3495929837226868e-02 1.9756000488996506e-02 + <_> + + 0 -1 7242 6.4658280462026596e-03 + + -4.0668301284313202e-02 1.2236029654741287e-01 + <_> + + 0 -1 7243 -4.8110671341419220e-02 + + -3.1629499793052673e-01 1.2694340199232101e-02 + <_> + + 0 -1 7244 5.0246939063072205e-03 + + 3.1356900930404663e-02 -1.9190339744091034e-01 + <_> + + 0 -1 7245 1.1158010363578796e-01 + + -1.4073889702558517e-02 1.7848959565162659e-01 + <_> + + 0 -1 7246 -6.4665876328945160e-02 + + -5.6230849027633667e-01 8.2082729786634445e-03 + <_> + + 0 -1 7247 -5.7942468672990799e-02 + + 7.7341747283935547e-01 -4.3547940440475941e-03 + <_> + + 0 -1 7248 -8.1669846549630165e-03 + + 2.1019349992275238e-01 -2.0802220329642296e-02 + <_> + + 0 -1 7249 2.8506839647889137e-02 + + 8.1413127481937408e-02 -6.2663510441780090e-02 + <_> + + 0 -1 7250 2.4857679381966591e-03 + + -1.5635970234870911e-01 3.5210859030485153e-02 + <_> + + 0 -1 7251 1.9798949360847473e-02 + + 1.1353739537298679e-02 -1.6531160473823547e-01 + <_> + + 0 -1 7252 -2.7027919888496399e-02 + + 2.8912219405174255e-01 -1.6753070056438446e-02 + <_> + + 0 -1 7253 -6.9706928916275501e-03 + + -2.5769388675689697e-01 1.6355020925402641e-02 + <_> + + 0 -1 7254 1.1425119591876864e-03 + + -4.1056800633668900e-02 1.1580900102853775e-01 + <_> + + 0 -1 7255 -1.3041249476373196e-03 + + 5.1082979887723923e-02 -1.1724369972944260e-01 + <_> + + 0 -1 7256 3.7698419764637947e-03 + + 5.8557331562042236e-02 -8.2840107381343842e-02 + <_> + + 0 -1 7257 -4.8689868301153183e-02 + + -3.8769158720970154e-01 8.6165666580200195e-03 + <_> + + 0 -1 7258 -1.1471740156412125e-01 + + 1.3444100320339203e-01 -4.2848691344261169e-02 + <_> + + 0 -1 7259 2.3503519594669342e-02 + + 3.8586359005421400e-03 -4.3615299463272095e-01 + <_> + + 0 -1 7260 -5.9582752874121070e-04 + + 4.2376730591058731e-02 -1.2161590158939362e-01 + <_> + + 0 -1 7261 5.4052029736340046e-03 + + -2.3753000423312187e-02 2.0137269794940948e-01 + <_> + + 0 -1 7262 9.1158300638198853e-03 + + 2.8088169172406197e-02 -1.9667729735374451e-01 + <_> + + 0 -1 7263 3.3211729023605585e-03 + + -5.1258899271488190e-02 4.7993980348110199e-02 + <_> + + 0 -1 7264 1.2975499965250492e-02 + + 1.1851020157337189e-02 -3.9444020390510559e-01 + <_> + + 0 -1 7265 -5.0546238198876381e-03 + + -1.0956159979104996e-01 4.2662780731916428e-02 + <_> + + 0 -1 7266 -7.6824478805065155e-02 + + 7.6269572973251343e-01 -6.6229291260242462e-03 + <_> + + 0 -1 7267 -1.8690669676288962e-03 + + 4.0112659335136414e-02 -7.1398198604583740e-02 + <_> + + 0 -1 7268 -6.0407500714063644e-03 + + 1.2614290416240692e-01 -3.9585150778293610e-02 + <_> + + 0 -1 7269 -4.5013230293989182e-02 + + -2.1871440112590790e-01 6.5213250927627087e-03 + <_> + + 0 -1 7270 3.8492688909173012e-03 + + -9.2213302850723267e-02 6.6925182938575745e-02 + <_> + + 0 -1 7271 -4.3247821740806103e-03 + + 1.4973750710487366e-01 -3.1123559921979904e-02 + <_> + + 0 -1 7272 -2.6776840910315514e-02 + + -1.1432229727506638e-01 5.3090259432792664e-02 + <_> + + 0 -1 7273 2.0645130425691605e-03 + + -3.8483418524265289e-02 7.1507766842842102e-02 + <_> + + 0 -1 7274 5.7206518948078156e-02 + + 1.2463140301406384e-02 -3.9884459972381592e-01 + <_> + + 0 -1 7275 7.7696829102933407e-03 + + -2.4309959262609482e-02 6.1120841652154922e-02 + <_> + + 0 -1 7276 2.8191099409013987e-03 + + 6.2243871390819550e-02 -7.9774282872676849e-02 + <_> + + 0 -1 7277 -5.1747109740972519e-02 + + -2.0475579798221588e-01 9.8433922976255417e-03 + <_> + + 0 -1 7278 4.2840079404413700e-03 + + -3.6799129098653793e-02 1.2380699813365936e-01 + <_> + + 0 -1 7279 -8.0563372466713190e-04 + + -5.3742490708827972e-02 6.8746432662010193e-02 + <_> + + 0 -1 7280 4.6062450855970383e-02 + + 7.3871058411896229e-03 -6.1133211851119995e-01 + <_> + + 0 -1 7281 6.6807270050048828e-02 + + -1.2545309960842133e-02 1.5731689333915710e-01 + <_> + + 0 -1 7282 2.0568699110299349e-03 + + 4.3087389320135117e-02 -1.1062700301408768e-01 + <_> + + 0 -1 7283 2.8760819695889950e-03 + + 2.5800980627536774e-02 -8.4697857499122620e-02 + <_> + + 0 -1 7284 -4.9642049707472324e-03 + + 8.3168722689151764e-02 -5.6750860065221786e-02 + <_> + 385 + -1.1474020481109619e+00 + + <_> + + 0 -1 7285 1.5166849829256535e-02 + + -1.7501029372215271e-01 1.5165300667285919e-01 + <_> + + 0 -1 7286 4.1852002032101154e-03 + + -1.8253259360790253e-01 1.0545530170202255e-01 + <_> + + 0 -1 7287 -2.6159440167248249e-03 + + -2.1517610549926758e-01 7.7460259199142456e-02 + <_> + + 0 -1 7288 2.7645078953355551e-03 + + -1.1506909877061844e-01 6.7771263420581818e-02 + <_> + + 0 -1 7289 -2.7296729967929423e-04 + + 5.5712651461362839e-02 -2.8723669052124023e-01 + <_> + + 0 -1 7290 2.4992981343530118e-04 + + 5.5202499032020569e-02 -1.5191499888896942e-01 + <_> + + 0 -1 7291 1.3287579640746117e-03 + + -1.2567579746246338e-01 9.4094827771186829e-02 + <_> + + 0 -1 7292 -2.4653770960867405e-03 + + 4.9393590539693832e-02 -2.2239279747009277e-01 + <_> + + 0 -1 7293 -3.2979049719870090e-03 + + -1.7367990314960480e-01 6.9391071796417236e-02 + <_> + + 0 -1 7294 -4.9667809158563614e-02 + + 3.2854220271110535e-01 -3.3067218959331512e-02 + <_> + + 0 -1 7295 5.7844468392431736e-03 + + 6.1289519071578979e-02 -1.6873429715633392e-01 + <_> + + 0 -1 7296 2.9754149727523327e-03 + + -2.4017000198364258e-01 5.7906478643417358e-02 + <_> + + 0 -1 7297 2.3769649851601571e-04 + + 1.1141020059585571e-01 -8.6508020758628845e-02 + <_> + + 0 -1 7298 5.4410300217568874e-03 + + -8.9257702231407166e-02 2.8492979705333710e-02 + <_> + + 0 -1 7299 2.5746610481292009e-03 + + 6.0383580625057220e-02 -1.4771540462970734e-01 + <_> + + 0 -1 7300 -1.2155439704656601e-02 + + 1.8026730418205261e-01 -3.5744961351156235e-02 + <_> + + 0 -1 7301 5.5069979280233383e-03 + + 6.1453469097614288e-02 -1.6147279739379883e-01 + <_> + + 0 -1 7302 -3.0918378615751863e-04 + + -9.1295689344406128e-02 6.8111963570117950e-02 + <_> + + 0 -1 7303 -7.7705271542072296e-02 + + 3.3344480395317078e-01 -2.6795169338583946e-02 + <_> + + 0 -1 7304 4.5874878764152527e-02 + + 6.2387371435761452e-03 -2.2738909721374512e-01 + <_> + + 0 -1 7305 3.1658360967412591e-04 + + -1.1297920346260071e-01 9.8602570593357086e-02 + <_> + + 0 -1 7306 -5.2962768822908401e-02 + + -6.0117399692535400e-01 1.0004489682614803e-02 + <_> + + 0 -1 7307 5.3028380498290062e-03 + + 3.6164399236440659e-02 -2.6359859108924866e-01 + <_> + + 0 -1 7308 -2.3473590612411499e-02 + + 1.0663519799709320e-01 -3.0653990805149078e-02 + <_> + + 0 -1 7309 -1.5029460191726685e-03 + + 6.2882840633392334e-02 -1.2285350263118744e-01 + <_> + + 0 -1 7310 -1.2232650071382523e-02 + + -2.3047080636024475e-01 4.0048789232969284e-02 + <_> + + 0 -1 7311 -4.7428268939256668e-02 + + 4.4135141372680664e-01 -1.8873579800128937e-02 + <_> + + 0 -1 7312 3.6379251629114151e-02 + + -1.3020380400121212e-02 1.4685730636119843e-01 + <_> + + 0 -1 7313 3.6343511193990707e-02 + + 3.8788039237260818e-02 -1.9903139770030975e-01 + <_> + + 0 -1 7314 -1.0792929679155350e-01 + + 1.6177520155906677e-01 -6.3546439632773399e-03 + <_> + + 0 -1 7315 -9.5479741692543030e-02 + + 3.7320658564567566e-01 -2.3940289393067360e-02 + <_> + + 0 -1 7316 3.8954298943281174e-02 + + 1.1239799670875072e-02 -3.4794488549232483e-01 + <_> + + 0 -1 7317 -3.2646209001541138e-02 + + -3.1797638535499573e-01 2.1780189126729965e-02 + <_> + + 0 -1 7318 -2.5872089900076389e-03 + + 4.7268610447645187e-02 -1.5624779462814331e-01 + <_> + + 0 -1 7319 1.2979200109839439e-02 + + -2.4394070729613304e-02 3.0341750383377075e-01 + <_> + + 0 -1 7320 -1.7490500584244728e-02 + + 1.1967100203037262e-01 -3.4825209528207779e-02 + <_> + + 0 -1 7321 8.2290060818195343e-03 + + 5.1706299185752869e-02 -1.4124310016632080e-01 + <_> + + 0 -1 7322 8.7701035663485527e-03 + + 1.2139629572629929e-02 -9.3410186469554901e-02 + <_> + + 0 -1 7323 -2.5523800868541002e-03 + + 9.1882079839706421e-02 -7.9693943262100220e-02 + <_> + + 0 -1 7324 1.2640489730983973e-03 + + -4.2868331074714661e-02 9.8469160497188568e-02 + <_> + + 0 -1 7325 -3.8762169424444437e-03 + + 6.4477890729904175e-02 -1.1426970362663269e-01 + <_> + + 0 -1 7326 1.5416350215673447e-03 + + -3.8240168243646622e-02 5.0880789756774902e-02 + <_> + + 0 -1 7327 7.6829752651974559e-04 + + -1.2869219481945038e-01 5.8161370456218719e-02 + <_> + + 0 -1 7328 1.6587260179221630e-03 + + 1.6391919553279877e-01 -4.7164998948574066e-02 + <_> + + 0 -1 7329 1.6514799790456891e-03 + + -5.9221718460321426e-02 1.3165080547332764e-01 + <_> + + 0 -1 7330 -3.8682940066792071e-04 + + 6.4493581652641296e-02 -1.0728739947080612e-01 + <_> + + 0 -1 7331 -3.4595469478517771e-03 + + 8.0743201076984406e-02 -9.2568591237068176e-02 + <_> + + 0 -1 7332 3.5130660980939865e-02 + + 1.5520620159804821e-02 -1.9732579588890076e-01 + <_> + + 0 -1 7333 1.2025350332260132e-01 + + -2.0497029647231102e-02 4.0905651450157166e-01 + <_> + + 0 -1 7334 7.8581331763416529e-04 + + -9.4858787953853607e-02 6.9316640496253967e-02 + <_> + + 0 -1 7335 6.1606317758560181e-03 + + 6.0556668788194656e-02 -1.2436509877443314e-01 + <_> + + 0 -1 7336 1.3351559638977051e-02 + + 1.7634969204664230e-02 -1.4649459719657898e-01 + <_> + + 0 -1 7337 1.9873639568686485e-02 + + -2.4449799209833145e-02 2.7322331070899963e-01 + <_> + + 0 -1 7338 -2.3918889928609133e-03 + + -4.0744900703430176e-02 4.9925319850444794e-02 + <_> + + 0 -1 7339 8.6433859542012215e-03 + + 2.8967950493097305e-02 -2.3661069571971893e-01 + <_> + + 0 -1 7340 -8.8321920484304428e-03 + + 1.2054029852151871e-01 -2.7702990919351578e-02 + <_> + + 0 -1 7341 -4.4150479137897491e-02 + + 5.0038051605224609e-01 -1.2251130305230618e-02 + <_> + + 0 -1 7342 -4.0243011899292469e-03 + + -1.9502529501914978e-01 2.5193009525537491e-02 + <_> + + 0 -1 7343 9.8465122282505035e-03 + + -6.0283869504928589e-02 1.2665469944477081e-01 + <_> + + 0 -1 7344 -2.7608149684965611e-03 + + -8.3926528692245483e-02 6.0102649033069611e-02 + <_> + + 0 -1 7345 3.9076831191778183e-02 + + 1.5327650122344494e-02 -4.3197798728942871e-01 + <_> + + 0 -1 7346 3.8136269431561232e-03 + + -3.1281091272830963e-02 7.7942118048667908e-02 + <_> + + 0 -1 7347 2.7646059170365334e-03 + + 1.7334839329123497e-02 -3.4732720255851746e-01 + <_> + + 0 -1 7348 -3.6096980329602957e-03 + + -8.2286708056926727e-02 2.8170879930257797e-02 + <_> + + 0 -1 7349 3.5445080138742924e-03 + + -1.0557620227336884e-01 6.0050919651985168e-02 + <_> + + 0 -1 7350 1.2985900044441223e-02 + + 1.8597990274429321e-02 -9.4987802207469940e-02 + <_> + + 0 -1 7351 -2.0027540624141693e-02 + + 2.6007258892059326e-01 -2.7079159393906593e-02 + <_> + + 0 -1 7352 -7.2966597974300385e-02 + + -7.6848107576370239e-01 2.3947900626808405e-03 + <_> + + 0 -1 7353 -2.1148719824850559e-03 + + -1.0763320326805115e-01 5.2361391484737396e-02 + <_> + + 0 -1 7354 -7.7667146921157837e-02 + + 1.7822329699993134e-01 -3.1463298946619034e-02 + <_> + + 0 -1 7355 -4.6600410714745522e-03 + + -2.0386479794979095e-01 3.9025411009788513e-02 + <_> + + 0 -1 7356 1.7059499397873878e-02 + + 1.8954740837216377e-02 -1.7260240018367767e-01 + <_> + + 0 -1 7357 4.3174691498279572e-02 + + -3.1685609370470047e-02 2.3346449434757233e-01 + <_> + + 0 -1 7358 -4.8927929997444153e-01 + + -7.1043139696121216e-01 4.6672620810568333e-03 + <_> + + 0 -1 7359 9.1495506465435028e-02 + + 1.6027629375457764e-02 -4.0538018941879272e-01 + <_> + + 0 -1 7360 -4.6843249350786209e-02 + + 6.9358861446380615e-01 -2.0055349450558424e-03 + <_> + + 0 -1 7361 6.0863760299980640e-03 + + -1.5218159556388855e-01 4.0408309549093246e-02 + <_> + + 0 -1 7362 4.3676611036062241e-02 + + 1.2257159687578678e-02 -2.5996598601341248e-01 + <_> + + 0 -1 7363 -4.9580529332160950e-02 + + 6.7571347951889038e-01 -8.0354865640401840e-03 + <_> + + 0 -1 7364 -2.8614638722501695e-04 + + 3.4548770636320114e-02 -6.1849180608987808e-02 + <_> + + 0 -1 7365 -1.1863199993968010e-02 + + -1.2061329931020737e-01 5.1416579633951187e-02 + <_> + + 0 -1 7366 1.4754010364413261e-02 + + -2.4638049304485321e-02 1.5234139561653137e-01 + <_> + + 0 -1 7367 -5.1772277802228928e-03 + + 1.8428930640220642e-01 -4.2200319468975067e-02 + <_> + + 0 -1 7368 -2.0033530890941620e-02 + + -2.0986419916152954e-01 2.3016780614852905e-02 + <_> + + 0 -1 7369 4.1349478997290134e-03 + + 3.8500111550092697e-02 -1.5400919318199158e-01 + <_> + + 0 -1 7370 4.9832498189061880e-04 + + -5.6834470480680466e-02 1.1737540364265442e-01 + <_> + + 0 -1 7371 1.5235079918056726e-03 + + -8.2305751740932465e-02 7.3340758681297302e-02 + <_> + + 0 -1 7372 2.6669060811400414e-02 + + 1.7131920903921127e-02 -3.3337280154228210e-01 + <_> + + 0 -1 7373 -2.5192899629473686e-02 + + 1.8348090350627899e-01 -3.5275999456644058e-02 + <_> + + 0 -1 7374 1.1769080301746726e-03 + + -1.3197030127048492e-01 2.4242419749498367e-02 + <_> + + 0 -1 7375 -6.6034111659973860e-04 + + -1.0725550353527069e-01 5.8605268597602844e-02 + <_> + + 0 -1 7376 4.3386619538068771e-02 + + -1.6498409211635590e-02 3.9293581247329712e-01 + <_> + + 0 -1 7377 -1.1490290053188801e-02 + + -2.6332950592041016e-01 2.4240590631961823e-02 + <_> + + 0 -1 7378 8.5933692753314972e-02 + + -1.6279760748147964e-02 4.1729450225830078e-01 + <_> + + 0 -1 7379 2.0756269805133343e-03 + + 5.2543889731168747e-02 -1.0574310272932053e-01 + <_> + + 0 -1 7380 1.4016899513080716e-03 + + -4.6594541519880295e-02 1.1355359852313995e-01 + <_> + + 0 -1 7381 -3.4351870417594910e-03 + + -1.0806330293416977e-01 5.8778531849384308e-02 + <_> + + 0 -1 7382 -1.8299809889867902e-03 + + 6.0645598918199539e-02 -6.6084399819374084e-02 + <_> + + 0 -1 7383 -3.4186599077656865e-04 + + -1.2682560086250305e-01 4.9244668334722519e-02 + <_> + + 0 -1 7384 1.0616290383040905e-02 + + -5.5619470775127411e-02 1.2270829826593399e-01 + <_> + + 0 -1 7385 3.9490770548582077e-02 + + 8.2882875576615334e-03 -6.6194152832031250e-01 + <_> + + 0 -1 7386 -1.9746040925383568e-02 + + 1.5761069953441620e-01 -9.3961963430047035e-03 + <_> + + 0 -1 7387 4.6383799053728580e-04 + + -2.0127220451831818e-01 2.6706330478191376e-02 + <_> + + 0 -1 7388 5.1521410932764411e-04 + + -8.6019717156887054e-02 6.7131496965885162e-02 + <_> + + 0 -1 7389 -1.1283540166914463e-02 + + -2.2754089534282684e-01 2.2250600159168243e-02 + <_> + + 0 -1 7390 -8.4253363311290741e-03 + + 1.6505259275436401e-01 -5.0438180565834045e-02 + <_> + + 0 -1 7391 3.0604569241404533e-02 + + 2.7500540018081665e-02 -2.0984129607677460e-01 + <_> + + 0 -1 7392 5.0000958144664764e-03 + + -3.8911771029233932e-02 1.1553470045328140e-01 + <_> + + 0 -1 7393 4.1644461452960968e-02 + + -1.4164280146360397e-02 4.4004911184310913e-01 + <_> + + 0 -1 7394 -3.9140251465141773e-03 + + -1.1528140306472778e-01 2.7629520744085312e-02 + <_> + + 0 -1 7395 -2.2060431074351072e-03 + + 7.4794493615627289e-02 -7.5950391590595245e-02 + <_> + + 0 -1 7396 -7.4060507118701935e-02 + + -6.0902571678161621e-01 3.8528270088136196e-03 + <_> + + 0 -1 7397 1.5966329956427217e-03 + + -7.0015199482440948e-02 1.1019259691238403e-01 + <_> + + 0 -1 7398 2.0102860871702433e-03 + + -3.1859181821346283e-02 7.1592740714550018e-02 + <_> + + 0 -1 7399 3.2757699955254793e-03 + + -5.2260760217905045e-02 1.2652389705181122e-01 + <_> + + 0 -1 7400 3.6700100172311068e-03 + + 5.4018720984458923e-02 -4.6530380845069885e-02 + <_> + + 0 -1 7401 -5.7776779867708683e-03 + + -2.2940860688686371e-01 2.4704450741410255e-02 + <_> + + 0 -1 7402 3.7388929631561041e-03 + + -4.8273131251335144e-02 7.6772913336753845e-02 + <_> + + 0 -1 7403 -1.2404560111463070e-02 + + 1.1491999775171280e-01 -4.9308139830827713e-02 + <_> + + 0 -1 7404 9.0428609400987625e-03 + + 4.3013140559196472e-02 -1.4439429342746735e-01 + <_> + + 0 -1 7405 6.1762649565935135e-03 + + -3.9362821727991104e-02 1.6073490679264069e-01 + <_> + + 0 -1 7406 2.1051440387964249e-02 + + 2.4608060717582703e-02 -1.3768480718135834e-01 + <_> + + 0 -1 7407 2.7457328978925943e-03 + + -6.3271999359130859e-02 9.1269433498382568e-02 + <_> + + 0 -1 7408 -1.0777959600090981e-02 + + 9.1245301067829132e-02 -3.0110929161310196e-02 + <_> + + 0 -1 7409 1.6699189320206642e-02 + + 4.3539609760046005e-02 -1.5240140259265900e-01 + <_> + + 0 -1 7410 5.4665589705109596e-03 + + -5.3575031459331512e-02 6.0266200453042984e-02 + <_> + + 0 -1 7411 -3.2001500949263573e-03 + + 1.4220920205116272e-01 -4.0823381394147873e-02 + <_> + + 0 -1 7412 4.7289058566093445e-02 + + 1.5853699296712875e-02 -2.7123591303825378e-01 + <_> + + 0 -1 7413 -1.3604690320789814e-03 + + 4.0636081248521805e-02 -1.4885699748992920e-01 + <_> + + 0 -1 7414 6.2847061781212687e-04 + + 4.1833158582448959e-02 -1.2394890189170837e-01 + <_> + + 0 -1 7415 -3.7036079913377762e-02 + + -3.6944690346717834e-01 1.3664159923791885e-02 + <_> + + 0 -1 7416 -2.2578550502657890e-02 + + 1.1812049895524979e-01 -2.2939860820770264e-02 + <_> + + 0 -1 7417 3.2851321157068014e-03 + + 3.1136950850486755e-01 -1.8856419250369072e-02 + <_> + + 0 -1 7418 -2.0225369930267334e-01 + + -6.2465697526931763e-01 3.9239428006112576e-03 + <_> + + 0 -1 7419 -4.9903858453035355e-03 + + 1.0674989968538284e-01 -6.0000490397214890e-02 + <_> + + 0 -1 7420 -2.2539479658007622e-02 + + -1.9891190528869629e-01 1.8829969689249992e-02 + <_> + + 0 -1 7421 2.6878459379076958e-02 + + -3.1185189262032509e-02 2.0841309428215027e-01 + <_> + + 0 -1 7422 -6.3416860066354275e-03 + + -8.3658866584300995e-02 4.0603660047054291e-02 + <_> + + 0 -1 7423 2.8207020368427038e-03 + + -5.8255858719348907e-02 9.7203142940998077e-02 + <_> + + 0 -1 7424 2.4739980697631836e-02 + + -1.8699239939451218e-02 9.9858507513999939e-02 + <_> + + 0 -1 7425 7.4140671640634537e-03 + + 2.9613019898533821e-02 -1.9177620112895966e-01 + <_> + + 0 -1 7426 -8.3040986210107803e-03 + + 1.2958979606628418e-01 -4.2671140283346176e-02 + <_> + + 0 -1 7427 1.1470559984445572e-03 + + -1.5365119278430939e-01 4.1083239018917084e-02 + <_> + + 0 -1 7428 -1.6470700502395630e-01 + + -4.1437658667564392e-01 1.3509290292859077e-02 + <_> + + 0 -1 7429 2.4328620731830597e-01 + + -1.2499390169978142e-02 4.4623729586601257e-01 + <_> + + 0 -1 7430 2.4545079097151756e-02 + + 2.2270770743489265e-02 -1.0766860097646713e-01 + <_> + + 0 -1 7431 -3.6004021763801575e-02 + + 2.1495530009269714e-01 -2.3298330605030060e-02 + <_> + + 0 -1 7432 1.7012679949402809e-02 + + 2.8566520661115646e-02 -1.3689860701560974e-01 + <_> + + 0 -1 7433 -1.7947000451385975e-03 + + 2.6063710451126099e-02 -1.8060439825057983e-01 + <_> + + 0 -1 7434 -3.4492081403732300e-01 + + -5.9101992845535278e-01 1.3455889420583844e-03 + <_> + + 0 -1 7435 -1.0471549816429615e-02 + + -6.4394369721412659e-02 8.1244252622127533e-02 + <_> + + 0 -1 7436 6.4335219562053680e-02 + + -5.0874471664428711e-02 8.3752527832984924e-02 + <_> + + 0 -1 7437 4.6703450381755829e-02 + + 8.1825926899909973e-03 -6.2220478057861328e-01 + <_> + + 0 -1 7438 6.7396290600299835e-02 + + -4.0585128590464592e-03 3.1115430593490601e-01 + <_> + + 0 -1 7439 -1.8122399342246354e-04 + + 6.3599228858947754e-02 -8.3870701491832733e-02 + <_> + + 0 -1 7440 -4.6783890575170517e-02 + + -4.3748119473457336e-01 3.6999220028519630e-03 + <_> + + 0 -1 7441 1.2537419795989990e-01 + + -7.1869022212922573e-03 6.9267672300338745e-01 + <_> + + 0 -1 7442 3.5549318999983370e-04 + + 3.5804919898509979e-02 -4.1999049484729767e-02 + <_> + + 0 -1 7443 -1.8169870600104332e-02 + + -2.6467940211296082e-01 1.9274869933724403e-02 + <_> + + 0 -1 7444 2.7509370818734169e-02 + + -9.9343024194240570e-03 1.2481729686260223e-01 + <_> + + 0 -1 7445 -3.1984839588403702e-02 + + 2.5694110989570618e-01 -2.6392020285129547e-02 + <_> + + 0 -1 7446 -1.2891650199890137e-02 + + -1.8838110566139221e-01 1.6135750338435173e-02 + <_> + + 0 -1 7447 4.5009091496467590e-02 + + 8.4453048184514046e-03 -5.7920891046524048e-01 + <_> + + 0 -1 7448 3.9589041844010353e-03 + + -4.3672330677509308e-02 1.2087629735469818e-01 + <_> + + 0 -1 7449 2.7181839104741812e-03 + + -4.0779389441013336e-02 1.2974439561367035e-01 + <_> + + 0 -1 7450 -7.5994711369276047e-04 + + 3.2954100519418716e-02 -8.6419321596622467e-02 + <_> + + 0 -1 7451 6.6315899603068829e-03 + + 3.6079831421375275e-02 -1.5763629972934723e-01 + <_> + + 0 -1 7452 -3.6433320492506027e-03 + + -2.9832119122147560e-02 6.2801547348499298e-02 + <_> + + 0 -1 7453 -6.4768336713314056e-02 + + -8.4351742267608643e-01 6.0920589603483677e-03 + <_> + + 0 -1 7454 4.1712251305580139e-01 + + 3.0659181065857410e-03 -4.4269698858261108e-01 + <_> + + 0 -1 7455 1.8854279816150665e-01 + + 4.8159952275454998e-03 -9.5497727394104004e-01 + <_> + + 0 -1 7456 2.3751270025968552e-02 + + -1.2166289612650871e-02 3.0827128887176514e-01 + <_> + + 0 -1 7457 1.8907970516011119e-03 + + -1.2497080117464066e-01 3.7261988967657089e-02 + <_> + + 0 -1 7458 -1.5546990325674415e-03 + + 7.3636576533317566e-02 -4.9398850649595261e-02 + <_> + + 0 -1 7459 -9.2505775392055511e-03 + + 1.2446039915084839e-01 -3.8673549890518188e-02 + <_> + + 0 -1 7460 -9.9219558760523796e-03 + + -1.2231759727001190e-01 2.7252480387687683e-02 + <_> + + 0 -1 7461 -6.7504931939765811e-04 + + 8.0792732536792755e-02 -6.1003699898719788e-02 + <_> + + 0 -1 7462 -1.3286190107464790e-02 + + 1.7295649647712708e-01 -3.0486939474940300e-02 + <_> + + 0 -1 7463 4.3905568309128284e-03 + + 2.9421260580420494e-02 -1.8230539560317993e-01 + <_> + + 0 -1 7464 -1.8879309296607971e-02 + + -5.3837429732084274e-02 2.8330469503998756e-02 + <_> + + 0 -1 7465 -6.9391563534736633e-02 + + 5.4713129997253418e-01 -9.0404544025659561e-03 + <_> + + 0 -1 7466 7.8226983547210693e-02 + + 6.9561759009957314e-03 -1.5992170572280884e-01 + <_> + + 0 -1 7467 -9.5910448580980301e-03 + + 8.3477370440959930e-02 -6.0714289546012878e-02 + <_> + + 0 -1 7468 8.0856353044509888e-02 + + -3.1028070952743292e-03 8.1530278921127319e-01 + <_> + + 0 -1 7469 -6.9029820151627064e-03 + + -6.2625996768474579e-02 7.7994093298912048e-02 + <_> + + 0 -1 7470 3.8219179958105087e-02 + + -9.4691133126616478e-03 4.1828629374504089e-01 + <_> + + 0 -1 7471 -7.2923908010125160e-04 + + 5.4394990205764771e-02 -1.0869490355253220e-01 + <_> + + 0 -1 7472 -1.1224360205233097e-02 + + -2.8774300217628479e-01 1.9332440569996834e-02 + <_> + + 0 -1 7473 -2.3755239322781563e-02 + + 2.9632499814033508e-01 -1.6995029523968697e-02 + <_> + + 0 -1 7474 2.5170940905809402e-02 + + 1.8151640892028809e-02 -6.9211177527904510e-02 + <_> + + 0 -1 7475 8.4619410336017609e-02 + + -1.2618330307304859e-02 4.0188309550285339e-01 + <_> + + 0 -1 7476 -2.8461799956858158e-03 + + -1.6565479338169098e-01 3.5540379583835602e-02 + <_> + + 0 -1 7477 9.9000544287264347e-04 + + -7.0647209882736206e-02 9.2070832848548889e-02 + <_> + + 0 -1 7478 8.5722869262099266e-03 + + -1.6599319875240326e-02 6.0025580227375031e-02 + <_> + + 0 -1 7479 7.7498499304056168e-03 + + 2.5065049529075623e-02 -2.0419560372829437e-01 + <_> + + 0 -1 7480 -5.1633790135383606e-03 + + 5.6465640664100647e-02 -3.9366569370031357e-02 + <_> + + 0 -1 7481 3.4570649731904268e-03 + + -4.8712749034166336e-02 1.1756400018930435e-01 + <_> + + 0 -1 7482 1.5435590175911784e-03 + + -1.2385150045156479e-01 4.7240950167179108e-02 + <_> + + 0 -1 7483 3.9221469312906265e-02 + + 9.7949290648102760e-03 -5.5965268611907959e-01 + <_> + + 0 -1 7484 -4.8019930720329285e-02 + + -2.4514609575271606e-01 1.5544380061328411e-02 + <_> + + 0 -1 7485 1.7867749556899071e-02 + + -2.6458689942955971e-02 1.8536129593849182e-01 + <_> + + 0 -1 7486 -7.8233405947685242e-03 + + -1.2305969744920731e-01 2.1850170567631721e-02 + <_> + + 0 -1 7487 -4.8894518986344337e-03 + + 2.5086471438407898e-01 -1.9914150238037109e-02 + <_> + + 0 -1 7488 1.1090599745512009e-01 + + 2.1982348989695311e-03 -9.6110188961029053e-01 + <_> + + 0 -1 7489 5.3139701485633850e-03 + + -7.0207841694355011e-02 7.4792057275772095e-02 + <_> + + 0 -1 7490 -4.0226429700851440e-03 + + -9.2982061207294464e-02 2.7642169967293739e-02 + <_> + + 0 -1 7491 -9.9820762872695923e-02 + + -8.2527607679367065e-01 5.8367499150335789e-03 + <_> + + 0 -1 7492 3.2612269278615713e-03 + + 3.0481850728392601e-02 -4.8289291560649872e-02 + <_> + + 0 -1 7493 -4.1559059172868729e-02 + + 5.8879297971725464e-01 -8.5169300436973572e-03 + <_> + + 0 -1 7494 5.4297139868140221e-03 + + 1.8141800537705421e-02 -1.3948309421539307e-01 + <_> + + 0 -1 7495 1.6756299883127213e-02 + + 1.2322929687798023e-02 -4.1245520114898682e-01 + <_> + + 0 -1 7496 -1.7563860863447189e-02 + + 1.1385770142078400e-01 -3.0968630686402321e-02 + <_> + + 0 -1 7497 1.8308760598301888e-02 + + -3.5930249840021133e-02 1.4697270095348358e-01 + <_> + + 0 -1 7498 3.5556308925151825e-02 + + 1.0190679691731930e-02 -2.5837650895118713e-01 + <_> + + 0 -1 7499 -5.1635081035783514e-05 + + 4.6089090406894684e-02 -1.1719120293855667e-01 + <_> + + 0 -1 7500 2.5128800189122558e-04 + + -4.0896330028772354e-02 1.0669410228729248e-01 + <_> + + 0 -1 7501 -1.5876770485192537e-03 + + 1.0786730051040649e-01 -4.5890059322118759e-02 + <_> + + 0 -1 7502 -9.5712337642908096e-03 + + -1.5212120115756989e-01 3.7137780338525772e-02 + <_> + + 0 -1 7503 2.8643130790442228e-03 + + 3.6075118929147720e-02 -1.4268599450588226e-01 + <_> + + 0 -1 7504 -5.0454098731279373e-02 + + 1.9622960686683655e-01 -2.8599070385098457e-02 + <_> + + 0 -1 7505 -2.8714470099657774e-03 + + 7.3919989168643951e-02 -8.6024001240730286e-02 + <_> + + 0 -1 7506 4.9587138928472996e-03 + + 9.4060972332954407e-03 -2.4880349636077881e-01 + <_> + + 0 -1 7507 -7.8270390629768372e-02 + + 4.3305158615112305e-01 -1.1123429983854294e-02 + <_> + + 0 -1 7508 -6.4656808972358704e-02 + + -1.9539129734039307e-01 9.3969572335481644e-03 + <_> + + 0 -1 7509 -4.0213608741760254e-01 + + -9.3731278181076050e-01 4.8170168884098530e-03 + <_> + + 0 -1 7510 4.2917151004076004e-02 + + 5.9442862402647734e-04 -7.9430317878723145e-01 + <_> + + 0 -1 7511 2.1517940331250429e-03 + + -2.4127319455146790e-02 2.1096949279308319e-01 + <_> + + 0 -1 7512 9.5514237880706787e-02 + + 3.0073130037635565e-03 -3.0030760169029236e-01 + <_> + + 0 -1 7513 3.5949420183897018e-02 + + 9.1736158356070518e-03 -5.3301852941513062e-01 + <_> + + 0 -1 7514 1.4061479270458221e-01 + + -1.9780038855969906e-03 5.8360362052917480e-01 + <_> + + 0 -1 7515 -1.0000269860029221e-01 + + -4.6577060222625732e-01 1.0447300039231777e-02 + <_> + + 0 -1 7516 -1.6898410022258759e-01 + + 4.7578391432762146e-01 -3.0947721097618341e-03 + <_> + + 0 -1 7517 2.6123190298676491e-02 + + -1.8673470243811607e-02 2.5583058595657349e-01 + <_> + + 0 -1 7518 8.8816967036109418e-05 + + 1.2931160628795624e-01 -2.2033900022506714e-02 + <_> + + 0 -1 7519 -2.5785199832171202e-03 + + 7.7590242028236389e-02 -5.8669801801443100e-02 + <_> + + 0 -1 7520 -5.5829741060733795e-02 + + -5.6296068429946899e-01 8.2240002229809761e-03 + <_> + + 0 -1 7521 -3.5114258527755737e-02 + + -4.1525208950042725e-01 1.0237259790301323e-02 + <_> + + 0 -1 7522 3.0091139487922192e-03 + + -3.2801661640405655e-02 1.1237899959087372e-01 + <_> + + 0 -1 7523 -3.0068641062825918e-03 + + -1.5794169902801514e-01 3.0354220420122147e-02 + <_> + + 0 -1 7524 -2.0059049129486084e-03 + + 1.1346399784088135e-01 -3.3372201025485992e-02 + <_> + + 0 -1 7525 -1.3963360106572509e-03 + + 1.4454230666160583e-01 -5.0115231424570084e-02 + <_> + + 0 -1 7526 -5.4588310420513153e-02 + + -9.6552258729934692e-01 2.6290758978575468e-03 + <_> + + 0 -1 7527 -5.0577907823026180e-03 + + -2.1536730229854584e-01 2.7823869138956070e-02 + <_> + + 0 -1 7528 -7.4430949985980988e-02 + + 5.9244579076766968e-01 -3.5832428839057684e-03 + <_> + + 0 -1 7529 -6.9759570062160492e-02 + + 6.5854609012603760e-01 -7.1275448426604271e-03 + <_> + + 0 -1 7530 3.4715738729573786e-04 + + 4.3214511126279831e-02 -6.5209239721298218e-02 + <_> + + 0 -1 7531 6.5575069747865200e-03 + + 4.1032981127500534e-02 -1.2200939655303955e-01 + <_> + + 0 -1 7532 9.2287212610244751e-02 + + -2.1933389827609062e-02 8.9953176677227020e-02 + <_> + + 0 -1 7533 5.2685599774122238e-02 + + 1.6439350321888924e-02 -2.7847930788993835e-01 + <_> + + 0 -1 7534 7.2394758462905884e-03 + + -3.3217910677194595e-02 9.7244061529636383e-02 + <_> + + 0 -1 7535 -2.2218099329620600e-03 + + 3.5860918462276459e-02 -1.3876199722290039e-01 + <_> + + 0 -1 7536 -2.3309379816055298e-02 + + -2.7913948893547058e-01 1.6362229362130165e-02 + <_> + + 0 -1 7537 1.4036920038051903e-04 + + -4.0096871554851532e-02 1.2379959970712662e-01 + <_> + + 0 -1 7538 5.3702849894762039e-02 + + 1.4607049524784088e-03 -8.6436408758163452e-01 + <_> + + 0 -1 7539 4.1926259291358292e-04 + + -4.9342829734086990e-02 1.0289549827575684e-01 + <_> + + 0 -1 7540 -1.6786300111562014e-03 + + -1.9065080583095551e-01 2.5145059451460838e-02 + <_> + + 0 -1 7541 1.6603240743279457e-02 + + -1.8125709146261215e-02 2.6887449622154236e-01 + <_> + + 0 -1 7542 -2.2621789947152138e-02 + + 1.3145700097084045e-01 -2.5288559496402740e-02 + <_> + + 0 -1 7543 4.4634779915213585e-03 + + 5.6568209081888199e-02 -1.0306429862976074e-01 + <_> + + 0 -1 7544 3.3281201031059027e-03 + + 2.1517809480428696e-02 -1.4086639881134033e-01 + <_> + + 0 -1 7545 -2.5311840698122978e-02 + + 1.1237470060586929e-01 -4.1784498840570450e-02 + <_> + + 0 -1 7546 -2.6119880378246307e-02 + + 1.2703700363636017e-01 -2.3530310019850731e-02 + <_> + + 0 -1 7547 -7.2608642280101776e-02 + + -3.3052888512611389e-01 2.1741159260272980e-02 + <_> + + 0 -1 7548 5.8377808891236782e-03 + + -2.8170680627226830e-02 6.1300031840801239e-02 + <_> + + 0 -1 7549 1.7830949509516358e-03 + + -7.6140716671943665e-02 8.4391303360462189e-02 + <_> + + 0 -1 7550 -1.4502589404582977e-01 + + -2.8886368870735168e-01 9.4371382147073746e-03 + <_> + + 0 -1 7551 -2.4291570298373699e-03 + + -6.3645169138908386e-02 9.0057007968425751e-02 + <_> + + 0 -1 7552 1.0977900028228760e-01 + + -1.4906959841027856e-03 8.9710217714309692e-01 + <_> + + 0 -1 7553 -3.8412429857999086e-03 + + 7.3980011045932770e-02 -6.9378383457660675e-02 + <_> + + 0 -1 7554 3.9507250767201185e-04 + + -7.1166411042213440e-02 6.3150741159915924e-02 + <_> + + 0 -1 7555 -6.6879019141197205e-03 + + -1.4211960136890411e-01 5.1007200032472610e-02 + <_> + + 0 -1 7556 -2.1278159320354462e-01 + + 1.7479549348354340e-01 -1.6866499558091164e-02 + <_> + + 0 -1 7557 4.3913610279560089e-02 + + -7.9228030517697334e-03 5.9994518756866455e-01 + <_> + + 0 -1 7558 3.0486818868666887e-03 + + 2.7880100533366203e-02 -1.4996689558029175e-01 + <_> + + 0 -1 7559 1.7128599574789405e-03 + + -6.1575889587402344e-02 1.0793119668960571e-01 + <_> + + 0 -1 7560 -1.3061589561402798e-02 + + -3.5864189267158508e-01 1.2332689948379993e-02 + <_> + + 0 -1 7561 1.4779239427298307e-03 + + -5.5280618369579315e-02 7.6400339603424072e-02 + <_> + + 0 -1 7562 -7.4117183685302734e-02 + + 3.3055660128593445e-01 -5.4406579583883286e-03 + <_> + + 0 -1 7563 4.1532788425683975e-02 + + 1.2762749567627907e-02 -3.4091010689735413e-01 + <_> + + 0 -1 7564 -1.6474310308694839e-02 + + -1.1935900151729584e-01 3.5997871309518814e-02 + <_> + + 0 -1 7565 -1.3384450227022171e-02 + + 1.4927010238170624e-01 -3.7151250988245010e-02 + <_> + + 0 -1 7566 -4.3293130584061146e-03 + + -1.5257209539413452e-01 2.0008029416203499e-02 + <_> + + 0 -1 7567 3.7254339549690485e-03 + + 3.8249280303716660e-02 -1.3562840223312378e-01 + <_> + + 0 -1 7568 -3.5788780078291893e-03 + + 1.1951140314340591e-01 -5.1356971263885498e-02 + <_> + + 0 -1 7569 9.0936541557312012e-02 + + -9.6294376999139786e-03 5.0582927465438843e-01 + <_> + + 0 -1 7570 -3.1301870476454496e-03 + + 2.4587530642747879e-02 -1.5752519667148590e-01 + <_> + + 0 -1 7571 -3.0295769684016705e-03 + + -9.6669957041740417e-02 4.7402460128068924e-02 + <_> + + 0 -1 7572 -3.1865050550550222e-03 + + 3.5035319626331329e-02 -4.0841709822416306e-02 + <_> + + 0 -1 7573 4.4836260378360748e-02 + + -7.4580628424882889e-03 6.5190207958221436e-01 + <_> + + 0 -1 7574 -6.4811948686838150e-03 + + 1.3163930177688599e-01 -3.6060128360986710e-02 + <_> + + 0 -1 7575 -2.0486880093812943e-03 + + -1.1097510159015656e-01 5.1011908799409866e-02 + <_> + + 0 -1 7576 4.9175620079040527e-02 + + 5.1457029767334461e-03 -8.9148598909378052e-01 + <_> + + 0 -1 7577 8.4772880654782057e-04 + + -9.0741790831089020e-02 4.4853020459413528e-02 + <_> + + 0 -1 7578 -1.6545709222555161e-02 + + 2.5329568982124329e-01 -1.6997080296278000e-02 + <_> + + 0 -1 7579 6.9274050183594227e-03 + + 3.8941461592912674e-02 -1.3961300253868103e-01 + <_> + + 0 -1 7580 -6.5109939314424992e-03 + + 1.5610300004482269e-01 -2.4493880569934845e-02 + <_> + + 0 -1 7581 -4.9708629958331585e-03 + + -9.8298586905002594e-02 5.7903841137886047e-02 + <_> + + 0 -1 7582 1.3074609637260437e-01 + + -2.7071859221905470e-04 1.0000669956207275e+00 + <_> + + 0 -1 7583 -2.6705920696258545e-02 + + -4.2577031254768372e-01 1.0705970227718353e-02 + <_> + + 0 -1 7584 -1.0329060256481171e-01 + + 2.5896188616752625e-01 -1.8414590507745743e-02 + <_> + + 0 -1 7585 -2.0166130736470222e-02 + + -1.1455850303173065e-01 4.0439568459987640e-02 + <_> + + 0 -1 7586 -4.2215920984745026e-03 + + 4.3039258569478989e-02 -4.8735860735177994e-02 + <_> + + 0 -1 7587 -1.0038839653134346e-02 + + 7.1608737111091614e-02 -6.6204607486724854e-02 + <_> + + 0 -1 7588 1.5833059325814247e-02 + + -3.2066859304904938e-02 8.9950896799564362e-02 + <_> + + 0 -1 7589 3.4065160434693098e-03 + + 4.7216009348630905e-02 -1.0898789763450623e-01 + <_> + + 0 -1 7590 -9.8251160234212875e-03 + + 1.0213229805231094e-01 -5.2902109920978546e-02 + <_> + + 0 -1 7591 1.6804629936814308e-02 + + -3.7189990282058716e-02 1.3787649571895599e-01 + <_> + + 0 -1 7592 8.5175316780805588e-03 + + 2.7141440659761429e-02 -1.3569560647010803e-01 + <_> + + 0 -1 7593 -6.3797592883929610e-04 + + 6.9217190146446228e-02 -9.0696737170219421e-02 + <_> + + 0 -1 7594 -9.6052087610587478e-04 + + 2.2472479939460754e-01 -2.4032639339566231e-02 + <_> + + 0 -1 7595 7.2245922638103366e-04 + + -4.6731200069189072e-02 9.6905507147312164e-02 + <_> + + 0 -1 7596 1.0769399814307690e-03 + + 3.8259491324424744e-02 -6.6674157977104187e-02 + <_> + + 0 -1 7597 4.1620191186666489e-02 + + 9.3473913148045540e-03 -4.9046689271926880e-01 + <_> + + 0 -1 7598 -8.1712089013308287e-04 + + 5.2797440439462662e-02 -9.6458092331886292e-02 + <_> + + 0 -1 7599 6.2240879051387310e-03 + + -3.5350788384675980e-02 1.6484160721302032e-01 + <_> + + 0 -1 7600 2.0862540695816278e-03 + + 3.3958710730075836e-02 -1.3114009797573090e-01 + <_> + + 0 -1 7601 4.2804637923836708e-03 + + 3.0104041099548340e-01 -1.6245450824499130e-02 + <_> + + 0 -1 7602 -3.3040030393749475e-04 + + -1.1665459722280502e-01 3.8146208971738815e-02 + <_> + + 0 -1 7603 2.8100309427827597e-03 + + 4.1940510272979736e-02 -1.1180300265550613e-01 + <_> + + 0 -1 7604 1.9832739606499672e-02 + + -1.1701569892466068e-02 2.0122130215167999e-01 + <_> + + 0 -1 7605 7.0879682898521423e-02 + + -1.8197819590568542e-02 2.5429588556289673e-01 + <_> + + 0 -1 7606 -8.3893969655036926e-02 + + -3.8719230890274048e-01 1.1727290228009224e-02 + <_> + + 0 -1 7607 2.8477620333433151e-02 + + 1.3701519928872585e-02 -3.2496619224548340e-01 + <_> + + 0 -1 7608 1.2077310122549534e-02 + + -2.3975890129804611e-02 2.5232788920402527e-01 + <_> + + 0 -1 7609 -7.5613409280776978e-02 + + -6.0866451263427734e-01 8.2847801968455315e-03 + <_> + + 0 -1 7610 -1.7563860863447189e-02 + + 1.0811589658260345e-01 -2.8622759506106377e-02 + <_> + + 0 -1 7611 1.1809109710156918e-02 + + 3.4758269786834717e-02 -1.4444710314273834e-01 + <_> + + 0 -1 7612 3.3459219336509705e-01 + + 3.5104870330542326e-03 -9.1507577896118164e-01 + <_> + + 0 -1 7613 9.8447836935520172e-02 + + -1.0290330275893211e-02 4.7943019866943359e-01 + <_> + + 0 -1 7614 -4.0277838706970215e-02 + + -7.3793828487396240e-01 4.8832078464329243e-03 + <_> + + 0 -1 7615 4.6712718904018402e-03 + + 2.5037309154868126e-02 -1.7003759741783142e-01 + <_> + + 0 -1 7616 1.3958489894866943e-01 + + 1.9962170626968145e-03 -7.1547168493270874e-01 + <_> + + 0 -1 7617 6.9742716848850250e-02 + + -8.4846932440996170e-03 5.5378282070159912e-01 + <_> + + 0 -1 7618 4.0283710695803165e-03 + + -1.6718029975891113e-02 2.3914240300655365e-01 + <_> + + 0 -1 7619 1.0911709628999233e-02 + + 1.5781659632921219e-02 -2.6813709735870361e-01 + <_> + + 0 -1 7620 -6.7120362073183060e-03 + + 1.1087659746408463e-01 -3.1365878880023956e-02 + <_> + + 0 -1 7621 -1.3467820361256599e-02 + + -2.0741519331932068e-01 2.3459080606698990e-02 + <_> + + 0 -1 7622 -2.1431609056890011e-03 + + 7.8274592757225037e-02 -2.7959430590271950e-02 + <_> + + 0 -1 7623 1.5163370408117771e-02 + + 2.1727830171585083e-02 -1.8995440006256104e-01 + <_> + + 0 -1 7624 -1.8551949411630630e-02 + + 1.1164160072803497e-01 -3.0374029651284218e-02 + <_> + + 0 -1 7625 -1.1083459854125977e-01 + + -5.6379908323287964e-01 7.6859779655933380e-03 + <_> + + 0 -1 7626 5.6210728362202644e-03 + + 3.2930258661508560e-02 -1.0337010025978088e-01 + <_> + + 0 -1 7627 3.0593289993703365e-03 + + -6.8871803581714630e-02 6.0389719903469086e-02 + <_> + + 0 -1 7628 -6.9845258258283138e-04 + + 3.8080908358097076e-02 -7.0112928748130798e-02 + <_> + + 0 -1 7629 -1.3236569939181209e-03 + + 7.5004093348979950e-02 -6.3950046896934509e-02 + <_> + + 0 -1 7630 -1.6736539546400309e-03 + + -1.0580399632453918e-01 4.9476388841867447e-02 + <_> + + 0 -1 7631 7.0728380233049393e-03 + + -3.6582119762897491e-02 1.3126540184020996e-01 + <_> + + 0 -1 7632 1.8164990469813347e-03 + + 3.9953831583261490e-02 -5.1589578390121460e-02 + <_> + + 0 -1 7633 4.1909920983016491e-03 + + 4.8665199428796768e-02 -1.0598509758710861e-01 + <_> + + 0 -1 7634 1.1940020322799683e-01 + + -6.7811049520969391e-03 7.4523490667343140e-01 + <_> + + 0 -1 7635 -1.4965030131861567e-03 + + 6.6805936396121979e-02 -6.7798472940921783e-02 + <_> + + 0 -1 7636 -1.1722999811172485e-01 + + -8.7860488891601562e-01 1.8648250261321664e-03 + <_> + + 0 -1 7637 3.2925528939813375e-03 + + 3.5634901374578476e-02 -1.5030789375305176e-01 + <_> + + 0 -1 7638 6.8493567407131195e-02 + + -9.8042488098144531e-03 3.0161941051483154e-01 + <_> + + 0 -1 7639 2.1837449166923761e-03 + + -5.3420849144458771e-02 8.5626326501369476e-02 + <_> + + 0 -1 7640 6.9181360304355621e-03 + + -4.3685518205165863e-02 1.2706759572029114e-01 + <_> + + 0 -1 7641 -1.5878600534051657e-03 + + -1.2640440464019775e-01 3.9026089012622833e-02 + <_> + + 0 -1 7642 3.8289129734039307e-03 + + 3.9025381207466125e-02 -7.9675689339637756e-02 + <_> + + 0 -1 7643 1.2253260239958763e-02 + + -4.4809628278017044e-02 9.7772710025310516e-02 + <_> + + 0 -1 7644 6.4031239598989487e-03 + + 3.3579610288143158e-02 -1.3300299644470215e-01 + <_> + + 0 -1 7645 7.0500532165169716e-03 + + -5.1121409982442856e-02 1.1772400140762329e-01 + <_> + + 0 -1 7646 1.3216730207204819e-02 + + 2.6454009115695953e-02 -1.3190220296382904e-01 + <_> + + 0 -1 7647 6.7367991432547569e-03 + + -1.0153199546039104e-02 4.1570469737052917e-01 + <_> + + 0 -1 7648 2.4951510131359100e-03 + + 1.4631019905209541e-02 -1.6560359299182892e-01 + <_> + + 0 -1 7649 3.8302998989820480e-02 + + 7.2940620593726635e-03 -6.0744607448577881e-01 + <_> + + 0 -1 7650 -1.6491059213876724e-02 + + 1.6788350045681000e-01 -1.5062170103192329e-02 + <_> + + 0 -1 7651 -2.7071639895439148e-02 + + -4.6381551027297974e-01 1.0335059836506844e-02 + <_> + + 0 -1 7652 -5.8714959770441055e-02 + + 1.4860999584197998e-01 -1.6663730144500732e-02 + <_> + + 0 -1 7653 9.2380512505769730e-03 + + 4.3830338865518570e-02 -1.0612689703702927e-01 + <_> + + 0 -1 7654 3.0808299779891968e-03 + + -3.6781489849090576e-02 8.9559197425842285e-02 + <_> + + 0 -1 7655 2.9910521116107702e-03 + + 1.6019189730286598e-02 -2.9177838563919067e-01 + <_> + + 0 -1 7656 4.4786609709262848e-02 + + -6.7814979702234268e-03 3.6695161461830139e-01 + <_> + + 0 -1 7657 -2.9985690489411354e-03 + + -9.0316072106361389e-02 4.8048041760921478e-02 + <_> + + 0 -1 7658 -8.9135952293872833e-03 + + 1.6903600096702576e-01 -2.1880460903048515e-02 + <_> + + 0 -1 7659 -3.9598200470209122e-02 + + -4.4884848594665527e-01 1.0027219541370869e-02 + <_> + + 0 -1 7660 -3.7064809352159500e-02 + + -4.4183561205863953e-01 2.2891450207680464e-03 + <_> + + 0 -1 7661 -9.3376229051500559e-04 + + 7.3633059859275818e-02 -5.8901689946651459e-02 + <_> + + 0 -1 7662 8.0887757241725922e-02 + + -2.4963580071926117e-02 6.0303758829832077e-02 + <_> + + 0 -1 7663 -3.0697569251060486e-02 + + -1.7819009721279144e-01 2.6090290397405624e-02 + <_> + + 0 -1 7664 -1.8495260179042816e-01 + + 3.4901228547096252e-01 -3.8219890557229519e-03 + <_> + + 0 -1 7665 1.1218319647014141e-02 + + -2.6781549677252769e-02 1.7431420087814331e-01 + <_> + + 0 -1 7666 6.2761609442532063e-03 + + 1.4532440342009068e-02 -1.1864569783210754e-01 + <_> + + 0 -1 7667 -8.8509358465671539e-03 + + -1.0515689849853516e-01 5.7655680924654007e-02 + <_> + + 0 -1 7668 -3.8575798273086548e-02 + + 1.5004560351371765e-01 -3.6080200225114822e-02 + <_> + + 0 -1 7669 -5.2720211446285248e-02 + + -4.7556790709495544e-01 1.1126070283353329e-02 + <_> + 392 + -1.1210759878158569e+00 + + <_> + + 0 -1 7670 -3.8506588898599148e-03 + + 1.1209569871425629e-01 -2.7330291271209717e-01 + <_> + + 0 -1 7671 -4.9427259713411331e-02 + + 3.9270120859146118e-01 -3.9871849119663239e-02 + <_> + + 0 -1 7672 1.3538210187107325e-03 + + -1.5965040028095245e-01 1.2521059811115265e-01 + <_> + + 0 -1 7673 3.9328690618276596e-03 + + -3.4043839573860168e-01 4.7437489032745361e-02 + <_> + + 0 -1 7674 2.3011169396340847e-03 + + -2.0827749371528625e-01 7.4891701340675354e-02 + <_> + + 0 -1 7675 5.9128052089363337e-04 + + -2.0842720568180084e-01 3.7798780947923660e-02 + <_> + + 0 -1 7676 1.7478190129622817e-03 + + -1.9635179638862610e-01 6.4582027494907379e-02 + <_> + + 0 -1 7677 5.8316658250987530e-03 + + 3.1582038849592209e-02 -1.9084580242633820e-01 + <_> + + 0 -1 7678 1.2435190146788955e-03 + + -5.3213578462600708e-01 2.2162230685353279e-02 + <_> + + 0 -1 7679 1.6247769817709923e-03 + + -1.3276180624961853e-01 8.0135673284530640e-02 + <_> + + 0 -1 7680 -2.2734089288860559e-03 + + -1.7344699800014496e-01 5.4782990366220474e-02 + <_> + + 0 -1 7681 5.7859059423208237e-02 + + -1.5829589683562517e-03 -6.6367942094802856e-01 + <_> + + 0 -1 7682 5.7728560641407967e-03 + + 3.9815168827772141e-02 -2.2919249534606934e-01 + <_> + + 0 -1 7683 -4.4039610773324966e-02 + + 2.1793280541896820e-01 -2.3534009233117104e-02 + <_> + + 0 -1 7684 3.0226248782128096e-04 + + -8.9419580996036530e-02 1.1042869836091995e-01 + <_> + + 0 -1 7685 -3.4470859915018082e-02 + + -3.6666679382324219e-01 2.7858279645442963e-02 + <_> + + 0 -1 7686 3.2460398972034454e-02 + + 1.5733880922198296e-02 -4.9733749032020569e-01 + <_> + + 0 -1 7687 9.9335552658885717e-04 + + -9.1800943017005920e-02 8.4003977477550507e-02 + <_> + + 0 -1 7688 -2.3473830893635750e-02 + + -4.4375669956207275e-01 1.5148010104894638e-02 + <_> + + 0 -1 7689 -2.9013049788773060e-03 + + 5.4642349481582642e-02 -2.0156529545783997e-01 + <_> + + 0 -1 7690 -6.5832951804623008e-04 + + -1.2285769730806351e-01 5.6707888841629028e-02 + <_> + + 0 -1 7691 2.0407158881425858e-03 + + -1.0899069905281067e-01 5.9933699667453766e-02 + <_> + + 0 -1 7692 -1.3161499984562397e-02 + + 1.4091959595680237e-01 -4.7396201640367508e-02 + <_> + + 0 -1 7693 -4.2273551225662231e-03 + + -1.2498269975185394e-01 5.1124658435583115e-02 + <_> + + 0 -1 7694 7.6580629684031010e-03 + + 3.8773480802774429e-02 -1.8095690011978149e-01 + <_> + + 0 -1 7695 -5.1912548951804638e-03 + + 1.2545259296894073e-01 -4.4012580066919327e-02 + <_> + + 0 -1 7696 1.1874590069055557e-01 + + -1.4801479876041412e-02 4.0071210265159607e-01 + <_> + + 0 -1 7697 4.5105828903615475e-03 + + 5.3336851298809052e-02 -1.5709049999713898e-01 + <_> + + 0 -1 7698 4.5015379786491394e-02 + + -3.3278778195381165e-02 2.0535139739513397e-01 + <_> + + 0 -1 7699 -2.0866969134658575e-03 + + 4.2103528976440430e-02 -1.0361789911985397e-01 + <_> + + 0 -1 7700 -1.3008449459448457e-03 + + 6.4424470067024231e-02 -9.7897060215473175e-02 + <_> + + 0 -1 7701 -1.3591230381280184e-03 + + 7.2987347841262817e-02 -9.4451002776622772e-02 + <_> + + 0 -1 7702 -7.4056759476661682e-03 + + -1.5320360660552979e-01 5.3242001682519913e-02 + <_> + + 0 -1 7703 2.0208859350532293e-03 + + -3.3245529979467392e-02 6.0319710522890091e-02 + <_> + + 0 -1 7704 -1.0342149995267391e-02 + + 8.5510559380054474e-02 -8.3920828998088837e-02 + <_> + + 0 -1 7705 2.4865860119462013e-02 + + 1.2639460153877735e-02 -3.4757199883460999e-01 + <_> + + 0 -1 7706 9.9798657000064850e-02 + + -1.8823970109224319e-02 3.4465000033378601e-01 + <_> + + 0 -1 7707 2.1201390773057938e-02 + + -1.0467799752950668e-01 3.1494509428739548e-02 + <_> + + 0 -1 7708 -5.1909908652305603e-03 + + -1.5792340040206909e-01 5.0269961357116699e-02 + <_> + + 0 -1 7709 6.6961228847503662e-02 + + 3.2651789952069521e-03 -5.6049168109893799e-01 + <_> + + 0 -1 7710 1.1809109710156918e-02 + + -2.8513789176940918e-02 2.1226319670677185e-01 + <_> + + 0 -1 7711 -1.7645660787820816e-02 + + -4.4503360986709595e-01 5.0029670819640160e-03 + <_> + + 0 -1 7712 -6.8918941542506218e-03 + + -4.2199620604515076e-01 1.4813040383160114e-02 + <_> + + 0 -1 7713 2.1675550378859043e-03 + + -1.3125190138816833e-01 6.7140422761440277e-02 + <_> + + 0 -1 7714 -3.3283489756286144e-03 + + -1.0765329748392105e-01 5.3610768169164658e-02 + <_> + + 0 -1 7715 4.8869621008634567e-02 + + 6.4427889883518219e-03 -6.4563280344009399e-01 + <_> + + 0 -1 7716 7.2693959809839725e-03 + + -3.9603620767593384e-02 1.5369640290737152e-01 + <_> + + 0 -1 7717 8.8849991559982300e-02 + + -1.3234400190412998e-02 2.8555288910865784e-01 + <_> + + 0 -1 7718 1.5455950051546097e-02 + + 3.9694100618362427e-02 -1.7206269502639771e-01 + <_> + + 0 -1 7719 -1.3747200369834900e-02 + + 1.0079269856214523e-01 -4.3812029063701630e-02 + <_> + + 0 -1 7720 -2.2805750370025635e-02 + + 1.5014170110225677e-01 -4.3767798691987991e-02 + <_> + + 0 -1 7721 2.3838039487600327e-02 + + 5.3901281207799911e-02 -1.4610290527343750e-01 + <_> + + 0 -1 7722 -1.0181629657745361e-01 + + 3.1905040144920349e-01 -2.0011590793728828e-02 + <_> + + 0 -1 7723 7.1074268780648708e-03 + + 5.6244179606437683e-02 -1.2587560713291168e-01 + <_> + + 0 -1 7724 7.6678092591464520e-04 + + -1.0704190284013748e-01 6.6436298191547394e-02 + <_> + + 0 -1 7725 3.7424071342684329e-04 + + -3.7826299667358398e-02 4.7234989702701569e-02 + <_> + + 0 -1 7726 -2.0078169181942940e-03 + + -9.3316286802291870e-02 6.7641608417034149e-02 + <_> + + 0 -1 7727 3.3469051122665405e-02 + + -2.7926150709390640e-02 2.5293371081352234e-01 + <_> + + 0 -1 7728 -1.5507030300796032e-02 + + -5.5145150423049927e-01 1.2821160256862640e-02 + <_> + + 0 -1 7729 -1.9248709082603455e-02 + + 5.2688628435134888e-02 -3.0364990234375000e-02 + <_> + + 0 -1 7730 -1.7556030303239822e-02 + + -3.3247348666191101e-01 1.8780380487442017e-02 + <_> + + 0 -1 7731 1.9324380904436111e-02 + + -3.2458461821079254e-02 9.4986997544765472e-02 + <_> + + 0 -1 7732 -2.0367160439491272e-02 + + 1.1348400264978409e-01 -5.8434821665287018e-02 + <_> + + 0 -1 7733 5.1770661957561970e-03 + + 4.7030560672283173e-02 -8.4960326552391052e-02 + <_> + + 0 -1 7734 1.9768481142818928e-03 + + -7.0794142782688141e-02 1.0375150293111801e-01 + <_> + + 0 -1 7735 -7.0216279709711671e-04 + + 3.0781729146838188e-02 -1.0170820355415344e-01 + <_> + + 0 -1 7736 -2.4710369762033224e-03 + + 5.1577620208263397e-02 -1.1920809745788574e-01 + <_> + + 0 -1 7737 2.3278540000319481e-02 + + 3.0191570520401001e-02 -9.3937888741493225e-02 + <_> + + 0 -1 7738 1.3673819601535797e-02 + + -2.6758959516882896e-02 2.4014200270175934e-01 + <_> + + 0 -1 7739 -8.3967903628945351e-03 + + -5.0403770059347153e-02 2.2368110716342926e-02 + <_> + + 0 -1 7740 4.7878470271825790e-02 + + -2.3758050054311752e-02 2.6486390829086304e-01 + <_> + + 0 -1 7741 -2.2483520209789276e-02 + + -2.3042780160903931e-01 1.2840679846704006e-02 + <_> + + 0 -1 7742 -1.0883989743888378e-02 + + -1.8380180001258850e-01 3.2639708369970322e-02 + <_> + + 0 -1 7743 -4.4901989400386810e-02 + + 2.4195960164070129e-01 -2.6507280766963959e-02 + <_> + + 0 -1 7744 -8.3042927086353302e-02 + + -8.0491328239440918e-01 7.5420029461383820e-03 + <_> + + 0 -1 7745 -3.7240530364215374e-03 + + -8.0228239297866821e-02 3.1584471464157104e-02 + <_> + + 0 -1 7746 -7.3502189479768276e-03 + + 6.8962231278419495e-02 -9.7391247749328613e-02 + <_> + + 0 -1 7747 5.5313981138169765e-03 + + -3.0180720612406731e-02 6.0174800455570221e-02 + <_> + + 0 -1 7748 1.7293080687522888e-02 + + 4.0732100605964661e-02 -1.5600660443305969e-01 + <_> + + 0 -1 7749 -3.3298740163445473e-03 + + 4.1001088917255402e-02 -7.6909027993679047e-02 + <_> + + 0 -1 7750 -4.9308240413665771e-03 + + 1.7031539976596832e-01 -4.0582239627838135e-02 + <_> + + 0 -1 7751 8.6011141538619995e-03 + + 3.1656920909881592e-02 -1.4050039649009705e-01 + <_> + + 0 -1 7752 1.3674340210855007e-02 + + -2.1845709532499313e-02 3.0128660798072815e-01 + <_> + + 0 -1 7753 -1.1375419795513153e-02 + + -1.5687340497970581e-01 2.8256019577383995e-02 + <_> + + 0 -1 7754 -4.2750681750476360e-03 + + -1.2155970185995102e-01 5.0146799534559250e-02 + <_> + + 0 -1 7755 1.6484759747982025e-02 + + -3.6557890474796295e-02 1.2583729624748230e-01 + <_> + + 0 -1 7756 -3.9056900888681412e-02 + + 2.4053129553794861e-01 -2.6983890682458878e-02 + <_> + + 0 -1 7757 -5.7546719908714294e-03 + + -1.3337680697441101e-01 2.0266020670533180e-02 + <_> + + 0 -1 7758 5.1583289168775082e-03 + + 6.4666390419006348e-02 -1.1428499966859818e-01 + <_> + + 0 -1 7759 -3.0463270377367735e-03 + + 4.5018680393695831e-02 -8.1573590636253357e-02 + <_> + + 0 -1 7760 7.4743861332535744e-03 + + 3.1246710568666458e-02 -1.8929730355739594e-01 + <_> + + 0 -1 7761 1.6480450285598636e-03 + + -2.5895040482282639e-02 1.8652880191802979e-01 + <_> + + 0 -1 7762 4.5184311456978321e-03 + + 5.4803468286991119e-02 -1.0444000363349915e-01 + <_> + + 0 -1 7763 -3.3209871035069227e-03 + + 4.3959401547908783e-02 -8.1240482628345490e-02 + <_> + + 0 -1 7764 5.2665979601442814e-03 + + -4.4853471219539642e-02 1.1343909800052643e-01 + <_> + + 0 -1 7765 -4.7867707908153534e-03 + + 7.6319009065628052e-02 -2.8551170602440834e-02 + <_> + + 0 -1 7766 -4.4710118323564529e-02 + + -3.4795719385147095e-01 1.4928230084478855e-02 + <_> + + 0 -1 7767 4.3861730955541134e-03 + + 7.4540950357913971e-02 -4.6298071742057800e-02 + <_> + + 0 -1 7768 9.2240851372480392e-03 + + -5.8626178652048111e-02 9.8693408071994781e-02 + <_> + + 0 -1 7769 -1.1849260190501809e-03 + + 1.0023140162229538e-01 -5.6729640811681747e-02 + <_> + + 0 -1 7770 -1.8546540290117264e-02 + + -3.8236171007156372e-01 1.5141529962420464e-02 + <_> + + 0 -1 7771 3.4743950236588717e-03 + + 2.6523910462856293e-02 -1.1289829760789871e-01 + <_> + + 0 -1 7772 1.0274019837379456e-01 + + -6.6097700037062168e-03 7.7561777830123901e-01 + <_> + + 0 -1 7773 2.0479390025138855e-01 + + 6.9657550193369389e-03 -3.5988980531692505e-01 + <_> + + 0 -1 7774 1.2094060331583023e-01 + + 1.8174450844526291e-02 -3.3531171083450317e-01 + <_> + + 0 -1 7775 1.2224229983985424e-02 + + -3.1454049050807953e-02 7.9004973173141479e-02 + <_> + + 0 -1 7776 1.5176460146903992e-01 + + -1.0826669633388519e-02 4.5583090186119080e-01 + <_> + + 0 -1 7777 -9.9692150950431824e-02 + + -3.5422179102897644e-01 3.1256359070539474e-03 + <_> + + 0 -1 7778 -6.3465638086199760e-03 + + -1.1098819971084595e-01 5.3735308349132538e-02 + <_> + + 0 -1 7779 -6.7007602192461491e-03 + + 1.8910090625286102e-01 -3.0930159613490105e-02 + <_> + + 0 -1 7780 -1.0101199895143509e-01 + + 2.3763500154018402e-01 -2.2213969379663467e-02 + <_> + + 0 -1 7781 4.6111021190881729e-02 + + -3.7543330341577530e-02 4.8733759671449661e-02 + <_> + + 0 -1 7782 1.4146809279918671e-01 + + 1.1148019693791866e-02 -5.1474362611770630e-01 + <_> + + 0 -1 7783 -1.1394499801099300e-02 + + -7.0824302732944489e-02 3.1759370118379593e-02 + <_> + + 0 -1 7784 3.1667309813201427e-03 + + 4.1177280247211456e-02 -1.4900580048561096e-01 + <_> + + 0 -1 7785 8.9959725737571716e-03 + + -4.1186511516571045e-02 7.2816781699657440e-02 + <_> + + 0 -1 7786 -6.1559271067380905e-02 + + -7.3937642574310303e-01 6.6859079524874687e-03 + <_> + + 0 -1 7787 -3.5607949830591679e-03 + + 1.3260509818792343e-02 -6.1150819063186646e-02 + <_> + + 0 -1 7788 -1.2476339936256409e-01 + + -7.8580498695373535e-01 6.2701301649212837e-03 + <_> + + 0 -1 7789 6.2739187479019165e-01 + + 3.5465341061353683e-03 -7.3363810777664185e-01 + <_> + + 0 -1 7790 3.4219160676002502e-02 + + 8.2031572237610817e-03 -5.3330212831497192e-01 + <_> + + 0 -1 7791 1.0574149928288534e-04 + + -5.0354700535535812e-02 4.7019489109516144e-02 + <_> + + 0 -1 7792 -3.2112289220094681e-02 + + 1.7085300385951996e-01 -3.4734141081571579e-02 + <_> + + 0 -1 7793 -1.6140839084982872e-02 + + -6.4753092825412750e-02 5.6943111121654510e-02 + <_> + + 0 -1 7794 1.9737280905246735e-02 + + -1.8065180629491806e-02 2.6183420419692993e-01 + <_> + + 0 -1 7795 2.7895450592041016e-02 + + 1.7641060054302216e-02 -3.0951151251792908e-01 + <_> + + 0 -1 7796 3.5123159177601337e-03 + + -8.3447068929672241e-02 6.5015971660614014e-02 + <_> + + 0 -1 7797 -4.4775637798011303e-03 + + -1.2423449754714966e-01 4.7061119228601456e-02 + <_> + + 0 -1 7798 -6.1348858289420605e-03 + + 1.0248269885778427e-01 -5.9700958430767059e-02 + <_> + + 0 -1 7799 1.4047959819436073e-02 + + 1.4833379536867142e-02 -1.1229590326547623e-01 + <_> + + 0 -1 7800 1.1907520238310099e-03 + + 4.9986690282821655e-02 -1.1696290224790573e-01 + <_> + + 0 -1 7801 1.7617389559745789e-02 + + -1.7687700688838959e-02 1.5416090190410614e-01 + <_> + + 0 -1 7802 -4.9166870303452015e-03 + + -1.0227180272340775e-01 4.6994391828775406e-02 + <_> + + 0 -1 7803 -3.9010820910334587e-03 + + 1.4229449629783630e-01 -4.5312799513339996e-02 + <_> + + 0 -1 7804 -1.7458139918744564e-03 + + -1.0853090137243271e-01 7.5689561665058136e-02 + <_> + + 0 -1 7805 -1.2748650042340159e-03 + + 2.2384520620107651e-02 -7.5150527060031891e-02 + <_> + + 0 -1 7806 -7.9109556972980499e-02 + + 4.8773929476737976e-01 -9.6941655501723289e-03 + <_> + + 0 -1 7807 -1.4103270135819912e-02 + + -2.3263689875602722e-01 1.5091559849679470e-02 + <_> + + 0 -1 7808 -2.2076119203120470e-03 + + 1.9268399477005005e-01 -2.5429060682654381e-02 + <_> + + 0 -1 7809 3.9626058191061020e-02 + + -1.5630759298801422e-02 1.2270029634237289e-01 + <_> + + 0 -1 7810 -7.8973636846058071e-05 + + -7.3257647454738617e-02 6.5848693251609802e-02 + <_> + + 0 -1 7811 5.1964947488158941e-04 + + -1.1366380006074905e-01 8.1133492290973663e-02 + <_> + + 0 -1 7812 -1.1722079943865538e-03 + + -9.7602643072605133e-02 5.9839569032192230e-02 + <_> + + 0 -1 7813 3.9326730184257030e-03 + + -5.7026151567697525e-02 4.2226128280162811e-02 + <_> + + 0 -1 7814 -8.7386153638362885e-02 + + -3.7896049022674561e-01 1.2869279831647873e-02 + <_> + + 0 -1 7815 -2.1324040368199348e-02 + + 3.0886441469192505e-01 -1.7734240740537643e-02 + <_> + + 0 -1 7816 -2.3385910317301750e-03 + + -1.1322320252656937e-01 4.3914940208196640e-02 + <_> + + 0 -1 7817 1.5183660434558988e-03 + + -1.4337620139122009e-01 3.9441708475351334e-02 + <_> + + 0 -1 7818 -1.1085519939661026e-01 + + 7.4037587642669678e-01 -6.7982021719217300e-03 + <_> + + 0 -1 7819 -1.0009120218455791e-02 + + -3.9203230291604996e-02 3.1749211251735687e-02 + <_> + + 0 -1 7820 -2.0916430279612541e-02 + + 1.8927730619907379e-01 -3.0490230768918991e-02 + <_> + + 0 -1 7821 7.4165337719023228e-03 + + 4.6797450631856918e-02 -1.1113610118627548e-01 + <_> + + 0 -1 7822 3.3599510788917542e-03 + + -4.5254990458488464e-02 1.1508409678936005e-01 + <_> + + 0 -1 7823 -5.7189498329535127e-04 + + -6.3472077250480652e-02 5.2049949765205383e-02 + <_> + + 0 -1 7824 -6.8120293319225311e-02 + + 5.0806027650833130e-01 -9.5091843977570534e-03 + <_> + + 0 -1 7825 2.5180799420922995e-03 + + 5.5305320769548416e-02 -1.4402769505977631e-01 + <_> + + 0 -1 7826 5.6055251508951187e-02 + + -2.3359170183539391e-02 2.1935400366783142e-01 + <_> + + 0 -1 7827 -4.0386710315942764e-02 + + -1.9183440506458282e-01 7.8779058530926704e-03 + <_> + + 0 -1 7828 3.1857648864388466e-03 + + 2.7605779469013214e-02 -2.0084309577941895e-01 + <_> + + 0 -1 7829 2.5159550830721855e-02 + + 1.1265699751675129e-02 -4.3628180027008057e-01 + <_> + + 0 -1 7830 -2.7010419871658087e-03 + + 1.1336500197649002e-01 -4.6904269605875015e-02 + <_> + + 0 -1 7831 -3.0056890100240707e-02 + + -6.2368732690811157e-01 7.3214052245020866e-03 + <_> + + 0 -1 7832 -1.2088020145893097e-01 + + -8.6428368091583252e-01 4.3813590891659260e-03 + <_> + + 0 -1 7833 4.0104859508574009e-03 + + -5.3471650928258896e-02 7.1113802492618561e-02 + <_> + + 0 -1 7834 -2.9688570648431778e-03 + + 1.0076630115509033e-01 -4.9233928322792053e-02 + <_> + + 0 -1 7835 -3.7600689101964235e-03 + + -2.0928700268268585e-01 2.6549680158495903e-02 + <_> + + 0 -1 7836 -1.5982619952410460e-03 + + 6.1070188879966736e-02 -7.9623572528362274e-02 + <_> + + 0 -1 7837 5.4285880178213120e-03 + + 3.9766579866409302e-02 -1.1746849864721298e-01 + <_> + + 0 -1 7838 1.0872900020331144e-03 + + -6.4596228301525116e-02 7.4964426457881927e-02 + <_> + + 0 -1 7839 -2.8442030306905508e-03 + + 1.1738350242376328e-01 -4.0159400552511215e-02 + <_> + + 0 -1 7840 3.5546101629734039e-02 + + 1.2194969691336155e-02 -4.2184820771217346e-01 + <_> + + 0 -1 7841 -4.8542950302362442e-02 + + 3.1292769312858582e-01 -1.2773830443620682e-02 + <_> + + 0 -1 7842 -3.0732100829482079e-02 + + -5.0631237030029297e-01 1.0600729845464230e-02 + <_> + + 0 -1 7843 1.3066929765045643e-02 + + -5.0003118813037872e-02 4.4005930423736572e-02 + <_> + + 0 -1 7844 2.9200640320777893e-01 + + 5.3693680092692375e-03 -8.9039158821105957e-01 + <_> + + 0 -1 7845 -8.7579451501369476e-03 + + 9.6666730940341949e-02 -3.1310658901929855e-02 + <_> + + 0 -1 7846 -2.3599369451403618e-03 + + 4.3046280741691589e-02 -1.0992430150508881e-01 + <_> + + 0 -1 7847 6.9077489897608757e-03 + + -2.9174160212278366e-02 8.9174896478652954e-02 + <_> + + 0 -1 7848 2.0849689841270447e-02 + + 1.2614700198173523e-01 -4.4358100742101669e-02 + <_> + + 0 -1 7849 -5.8846421539783478e-02 + + 2.1661500632762909e-01 -8.7285088375210762e-03 + <_> + + 0 -1 7850 2.5576311163604259e-03 + + -1.1648210138082504e-01 5.4756019264459610e-02 + <_> + + 0 -1 7851 3.8973900955170393e-03 + + 3.5759489983320236e-02 -9.7868561744689941e-02 + <_> + + 0 -1 7852 -1.2494160328060389e-03 + + 9.1347962617874146e-02 -5.7817179709672928e-02 + <_> + + 0 -1 7853 3.4928850363940001e-03 + + 2.0634220913052559e-02 -1.4494930207729340e-01 + <_> + + 0 -1 7854 -1.1378509923815727e-02 + + 2.1203260123729706e-01 -2.4150850251317024e-02 + <_> + + 0 -1 7855 -4.4060450047254562e-02 + + 4.2267361283302307e-01 -4.7765900380909443e-03 + <_> + + 0 -1 7856 -8.3084795624017715e-03 + + -8.4928646683692932e-02 6.0228090733289719e-02 + <_> + + 0 -1 7857 -9.1945994645357132e-03 + + 7.2318702936172485e-02 -2.0472260192036629e-02 + <_> + + 0 -1 7858 6.5575107932090759e-02 + + 5.0813751295208931e-03 -8.9693188667297363e-01 + <_> + + 0 -1 7859 1.8510420620441437e-01 + + 2.2485901135951281e-03 -7.5125169754028320e-01 + <_> + + 0 -1 7860 -1.7608819901943207e-01 + + -7.8969222307205200e-01 5.2678477950394154e-03 + <_> + + 0 -1 7861 9.8349712789058685e-02 + + 2.8081049676984549e-03 -2.5828519463539124e-01 + <_> + + 0 -1 7862 -1.8191979324910790e-04 + + -8.6206100881099701e-02 5.2294798195362091e-02 + <_> + + 0 -1 7863 -5.2928649820387363e-03 + + -5.4600238800048828e-02 2.8304630890488625e-02 + <_> + + 0 -1 7864 1.1537299724295735e-03 + + 4.6684168279170990e-02 -1.1234779655933380e-01 + <_> + + 0 -1 7865 -3.8274680264294147e-03 + + 6.0145508497953415e-02 -8.2371100783348083e-02 + <_> + + 0 -1 7866 -8.6957857012748718e-02 + + -4.8363038897514343e-01 9.2326821759343147e-03 + <_> + + 0 -1 7867 -2.4195960722863674e-03 + + -3.5221140831708908e-02 2.7081709355115891e-02 + <_> + + 0 -1 7868 -4.7905668616294861e-03 + + 5.8955200016498566e-02 -7.8748136758804321e-02 + <_> + + 0 -1 7869 -4.0910490788519382e-03 + + -1.7550939321517944e-01 2.6454729959368706e-02 + <_> + + 0 -1 7870 2.5641750544309616e-03 + + -3.6814831197261810e-02 1.5140229463577271e-01 + <_> + + 0 -1 7871 5.4726968519389629e-03 + + 3.1243579462170601e-02 -9.7890958189964294e-02 + <_> + + 0 -1 7872 -1.0310260113328695e-03 + + -1.2424050271511078e-01 4.0365029126405716e-02 + <_> + + 0 -1 7873 -1.3030169904232025e-01 + + 1.7106169462203979e-01 -6.9856629706919193e-03 + <_> + + 0 -1 7874 3.5753389820456505e-03 + + -2.5437129661440849e-02 2.1967570483684540e-01 + <_> + + 0 -1 7875 8.4238024428486824e-03 + + 2.9582399874925613e-02 -1.7390090227127075e-01 + <_> + + 0 -1 7876 4.1154649108648300e-02 + + -1.3265499845147133e-02 3.6282411217689514e-01 + <_> + + 0 -1 7877 -1.8620759248733521e-02 + + -2.2806780040264130e-01 2.1502569317817688e-02 + <_> + + 0 -1 7878 2.3307619616389275e-02 + + -2.3047760128974915e-02 2.3208670318126678e-01 + <_> + + 0 -1 7879 4.6518299728631973e-02 + + 1.0585400275886059e-02 -4.6076700091362000e-01 + <_> + + 0 -1 7880 -8.3499401807785034e-02 + + 3.7845119833946228e-01 -1.4105740003287792e-02 + <_> + + 0 -1 7881 -9.6897013485431671e-02 + + -3.2995849847793579e-01 6.2883920036256313e-03 + <_> + + 0 -1 7882 6.9753699935972691e-03 + + 2.4593630805611610e-02 -2.1003679931163788e-01 + <_> + + 0 -1 7883 -3.3859949558973312e-02 + + 1.8927900493144989e-01 -8.7296841666102409e-03 + <_> + + 0 -1 7884 1.0354740079492331e-03 + + -6.4493343234062195e-02 8.0192290246486664e-02 + <_> + + 0 -1 7885 3.9950661361217499e-02 + + 2.5073040276765823e-02 -1.1636939644813538e-01 + <_> + + 0 -1 7886 3.0460350681096315e-03 + + -3.3754941076040268e-02 1.3324250280857086e-01 + <_> + + 0 -1 7887 -1.5341850230470300e-03 + + 6.2442861497402191e-02 -5.6061070412397385e-02 + <_> + + 0 -1 7888 2.0531520713120699e-03 + + -8.4790043532848358e-02 5.3408049046993256e-02 + <_> + + 0 -1 7889 2.1295580081641674e-03 + + 4.0650319308042526e-02 -1.1124719679355621e-01 + <_> + + 0 -1 7890 -1.5462029725313187e-02 + + 1.3806979358196259e-01 -3.3944208174943924e-02 + <_> + + 0 -1 7891 -2.7878239750862122e-02 + + -1.0025399923324585e-01 1.3444880023598671e-02 + <_> + + 0 -1 7892 1.7255680635571480e-02 + + 1.5361789613962173e-02 -3.6930799484252930e-01 + <_> + + 0 -1 7893 -1.7870500683784485e-02 + + 5.2870798856019974e-02 -2.5108009576797485e-02 + <_> + + 0 -1 7894 -1.4443919993937016e-02 + + -2.2763819992542267e-01 2.0391609519720078e-02 + <_> + + 0 -1 7895 -8.3497241139411926e-03 + + -8.7055817246437073e-02 3.2707940787076950e-02 + <_> + + 0 -1 7896 2.7514319866895676e-02 + + -2.0628409460186958e-02 2.5977128744125366e-01 + <_> + + 0 -1 7897 1.8610119819641113e-02 + + -8.0523788928985596e-03 1.6925090551376343e-01 + <_> + + 0 -1 7898 -9.5786049962043762e-02 + + -5.0116628408432007e-01 8.7666641920804977e-03 + <_> + + 0 -1 7899 1.2036979943513870e-01 + + 9.8632962908595800e-04 -1.0000280141830444e+00 + <_> + + 0 -1 7900 2.4782579392194748e-02 + + -1.2519709765911102e-02 3.5919609665870667e-01 + <_> + + 0 -1 7901 -5.0353828817605972e-02 + + -3.3340519666671753e-01 6.9066900759935379e-03 + <_> + + 0 -1 7902 3.1298059970140457e-02 + + 1.0963119566440582e-02 -4.0645220875740051e-01 + <_> + + 0 -1 7903 7.4575231410562992e-03 + + -2.1207600831985474e-02 1.3167420029640198e-01 + <_> + + 0 -1 7904 5.5791479535400867e-03 + + -3.4098070114850998e-02 1.2983830273151398e-01 + <_> + + 0 -1 7905 5.9088319540023804e-03 + + -2.6940669864416122e-02 1.6839459538459778e-01 + <_> + + 0 -1 7906 1.7543360590934753e-02 + + 4.2376369237899780e-02 -1.2350399792194366e-01 + <_> + + 0 -1 7907 -9.6103046089410782e-03 + + 5.2223920822143555e-02 -2.5582559406757355e-02 + <_> + + 0 -1 7908 2.0607879851013422e-03 + + 4.0174130350351334e-02 -1.0548079758882523e-01 + <_> + + 0 -1 7909 -5.3874161094427109e-03 + + -6.4995579421520233e-02 2.7807140722870827e-02 + <_> + + 0 -1 7910 1.1102309823036194e-01 + + -4.9670711159706116e-03 8.1718921661376953e-01 + <_> + + 0 -1 7911 -3.7374150007963181e-02 + + -6.2611418962478638e-01 3.0927599873393774e-03 + <_> + + 0 -1 7912 5.0286632031202316e-03 + + 2.4978660047054291e-01 -1.8151100724935532e-02 + <_> + + 0 -1 7913 2.9225579928606749e-03 + + -6.0576818883419037e-02 2.6497339829802513e-02 + <_> + + 0 -1 7914 -5.4296620190143585e-02 + + -5.7990437746047974e-01 6.5989522263407707e-03 + <_> + + 0 -1 7915 1.2996720150113106e-02 + + -2.6128260418772697e-02 9.7030609846115112e-02 + <_> + + 0 -1 7916 3.3001229166984558e-02 + + 1.4960479922592640e-02 -3.2304659485816956e-01 + <_> + + 0 -1 7917 -1.1660449951887131e-01 + + 2.5725141167640686e-01 -1.2625830247998238e-02 + <_> + + 0 -1 7918 7.0706337690353394e-02 + + 7.0192231796681881e-03 -6.9260591268539429e-01 + <_> + + 0 -1 7919 -4.4549949467182159e-02 + + -7.1134221553802490e-01 4.9668429419398308e-03 + <_> + + 0 -1 7920 4.2873818427324295e-02 + + 6.7160711623728275e-03 -5.2660852670669556e-01 + <_> + + 0 -1 7921 2.5025280192494392e-02 + + -1.8445409834384918e-02 7.8793220221996307e-02 + <_> + + 0 -1 7922 2.1663550287485123e-03 + + 3.2540310174226761e-02 -1.3115049898624420e-01 + <_> + + 0 -1 7923 2.5540040805935860e-02 + + -3.4693568944931030e-02 4.1404798626899719e-02 + <_> + + 0 -1 7924 -8.3627507090568542e-02 + + -5.2143442630767822e-01 7.7060810290277004e-03 + <_> + + 0 -1 7925 3.7637550849467516e-03 + + -2.9463630169630051e-02 7.4424192309379578e-02 + <_> + + 0 -1 7926 3.7175719626247883e-03 + + -4.2123001068830490e-02 1.0287009924650192e-01 + <_> + + 0 -1 7927 -5.2892807871103287e-03 + + -1.2348390370607376e-01 3.7152700126171112e-02 + <_> + + 0 -1 7928 -9.1878473758697510e-03 + + 9.0256750583648682e-02 -5.2674051374197006e-02 + <_> + + 0 -1 7929 -5.5448919534683228e-02 + + -5.3639650344848633e-01 2.6584670413285494e-03 + <_> + + 0 -1 7930 6.4754108898341656e-03 + + 5.5367350578308105e-02 -9.2722631990909576e-02 + <_> + + 0 -1 7931 -1.5773440245538950e-03 + + 1.3578939437866211e-01 -4.0911730378866196e-02 + <_> + + 0 -1 7932 -4.9912789836525917e-04 + + -1.4728380739688873e-01 5.3603630512952805e-02 + <_> + + 0 -1 7933 1.5690509974956512e-01 + + -7.8873159363865852e-03 3.7397789955139160e-01 + <_> + + 0 -1 7934 3.6391850560903549e-02 + + 4.9765990115702152e-03 -9.1157531738281250e-01 + <_> + + 0 -1 7935 -9.5625342801213264e-03 + + 1.2767709791660309e-01 -1.4394680038094521e-02 + <_> + + 0 -1 7936 2.4007901083678007e-03 + + -1.3107380270957947e-01 4.4731479138135910e-02 + <_> + + 0 -1 7937 3.2929850276559591e-03 + + 4.0428631007671356e-02 -5.3223561495542526e-02 + <_> + + 0 -1 7938 -3.1314359512180090e-03 + + 3.6826111376285553e-02 -1.2113159894943237e-01 + <_> + + 0 -1 7939 5.2008330821990967e-02 + + 5.9283021837472916e-03 -4.3858841061592102e-01 + <_> + + 0 -1 7940 5.7681259931996465e-04 + + -6.9851770997047424e-02 6.4286291599273682e-02 + <_> + + 0 -1 7941 6.1443001031875610e-03 + + 3.0908059328794479e-02 -1.8229809403419495e-01 + <_> + + 0 -1 7942 3.5959720611572266e-02 + + -4.1680991649627686e-02 1.4244790375232697e-01 + <_> + + 0 -1 7943 -2.1290820091962814e-02 + + -9.6662320196628571e-02 5.5888749659061432e-02 + <_> + + 0 -1 7944 -6.2724511371925473e-04 + + 9.0150557458400726e-02 -6.9430753588676453e-02 + <_> + + 0 -1 7945 -2.5145700201392174e-03 + + -6.9526046514511108e-02 4.5552581548690796e-02 + <_> + + 0 -1 7946 5.7874649763107300e-02 + + -2.5036580860614777e-02 2.0633180439472198e-01 + <_> + + 0 -1 7947 1.5898469835519791e-02 + + -1.7133399844169617e-02 1.1004959791898727e-01 + <_> + + 0 -1 7948 2.7882799506187439e-02 + + 2.7713179588317871e-02 -1.6536410152912140e-01 + <_> + + 0 -1 7949 8.8283112272620201e-03 + + -2.7497250586748123e-02 5.9822890907526016e-02 + <_> + + 0 -1 7950 -1.5679910778999329e-02 + + -2.6984989643096924e-01 1.6398239880800247e-02 + <_> + + 0 -1 7951 4.1906189173460007e-02 + + -8.0525986850261688e-03 3.1556311249732971e-01 + <_> + + 0 -1 7952 -4.1068609803915024e-02 + + 2.5637561082839966e-01 -1.8357910215854645e-02 + <_> + + 0 -1 7953 3.5570110194385052e-03 + + 2.9343830421566963e-02 -1.2668469548225403e-01 + <_> + + 0 -1 7954 -2.1371750626713037e-03 + + 1.2923260033130646e-01 -4.0102209895849228e-02 + <_> + + 0 -1 7955 3.3638089895248413e-02 + + 8.1196166574954987e-03 -4.0394780039787292e-01 + <_> + + 0 -1 7956 1.0182919912040234e-02 + + -4.2566180229187012e-02 1.1843100190162659e-01 + <_> + + 0 -1 7957 -7.0302112726494670e-04 + + 3.8721978664398193e-02 -7.9703420400619507e-02 + <_> + + 0 -1 7958 -2.8552680741995573e-03 + + 9.1274276375770569e-02 -6.1691451817750931e-02 + <_> + + 0 -1 7959 -2.9935541097074747e-03 + + -1.0913450270891190e-01 3.8736950606107712e-02 + <_> + + 0 -1 7960 -5.3608341841027141e-04 + + -4.3252488970756531e-01 1.0958270169794559e-02 + <_> + + 0 -1 7961 5.1431890577077866e-02 + + 4.7060111537575722e-03 -2.6765900850296021e-01 + <_> + + 0 -1 7962 -4.8872891813516617e-02 + + 2.0144729316234589e-01 -2.2844519466161728e-02 + <_> + + 0 -1 7963 -1.6080449521541595e-01 + + -1. 1.9577229395508766e-03 + <_> + + 0 -1 7964 1.8509939312934875e-02 + + 1.7808660864830017e-02 -2.7871158719062805e-01 + <_> + + 0 -1 7965 -4.2106948792934418e-02 + + -6.2493157386779785e-01 7.0520970039069653e-03 + <_> + + 0 -1 7966 -9.7096778452396393e-02 + + -8.4505838155746460e-01 4.4749649241566658e-03 + <_> + + 0 -1 7967 -9.4244757201522589e-04 + + 1.9796760380268097e-01 -2.2733120247721672e-02 + <_> + + 0 -1 7968 -1.8040809780359268e-02 + + -3.3424109220504761e-01 1.3358039781451225e-02 + <_> + + 0 -1 7969 6.3626631163060665e-04 + + -1.0530749708414078e-01 4.4016160070896149e-02 + <_> + + 0 -1 7970 -3.4530549310147762e-03 + + -1.3687069714069366e-01 3.0288280919194221e-02 + <_> + + 0 -1 7971 1.7589809373021126e-02 + + -2.8031280264258385e-02 1.8331700563430786e-01 + <_> + + 0 -1 7972 -1.4289390528574586e-03 + + 6.7616157233715057e-02 -6.4400359988212585e-02 + <_> + + 0 -1 7973 1.4584570191800594e-02 + + -3.2548811286687851e-02 7.7070221304893494e-02 + <_> + + 0 -1 7974 7.4579578638076782e-01 + + 9.1963959857821465e-03 -4.5680120587348938e-01 + <_> + + 0 -1 7975 -1.2285649776458740e-01 + + -6.4423608779907227e-01 2.0847769919782877e-03 + <_> + + 0 -1 7976 -1.1613000184297562e-01 + + -7.9274278879165649e-01 4.9578230828046799e-03 + <_> + + 0 -1 7977 5.5644840002059937e-02 + + -5.7718120515346527e-03 3.0834281444549561e-01 + <_> + + 0 -1 7978 2.0566429942846298e-02 + + -1.5474709682166576e-02 2.8002938628196716e-01 + <_> + + 0 -1 7979 3.8393519935198128e-04 + + 3.4390248358249664e-02 -1.0244189947843552e-01 + <_> + + 0 -1 7980 4.0198508650064468e-03 + + 5.2533138543367386e-02 -1.1492720246315002e-01 + <_> + + 0 -1 7981 -7.4124410748481750e-02 + + -3.0216461420059204e-01 4.2779031209647655e-03 + <_> + + 0 -1 7982 -3.4346429165452719e-03 + + 6.5627492964267731e-02 -6.9991588592529297e-02 + <_> + + 0 -1 7983 -4.3740049004554749e-03 + + -1.2934839725494385e-01 5.1233518868684769e-02 + <_> + + 0 -1 7984 6.9464151747524738e-03 + + -3.2591849565505981e-02 1.5098060667514801e-01 + <_> + + 0 -1 7985 -1.8434170633554459e-02 + + -3.1364220380783081e-01 9.5867328345775604e-03 + <_> + + 0 -1 7986 -3.2201830763369799e-03 + + -1.7494319379329681e-01 3.3579058945178986e-02 + <_> + + 0 -1 7987 -3.2273299992084503e-02 + + 2.4136200547218323e-01 -2.4392010644078255e-02 + <_> + + 0 -1 7988 -4.8193791881203651e-03 + + -1.3610219955444336e-01 4.1156660765409470e-02 + <_> + + 0 -1 7989 -9.8347626626491547e-02 + + -5.3324717283248901e-01 8.8729923591017723e-03 + <_> + + 0 -1 7990 1.9054619595408440e-02 + + -3.2564271241426468e-02 1.6729709506034851e-01 + <_> + + 0 -1 7991 -8.1796169281005859e-02 + + -6.4131242036819458e-01 8.7052602320909500e-03 + <_> + + 0 -1 7992 3.2996949739754200e-03 + + -5.9765439480543137e-02 7.1879856288433075e-02 + <_> + + 0 -1 7993 -7.5977660715579987e-02 + + -5.0415420532226562e-01 5.6795510463416576e-03 + <_> + + 0 -1 7994 3.0508760362863541e-02 + + 1.0317360050976276e-02 -4.3552881479263306e-01 + <_> + + 0 -1 7995 -3.7642959505319595e-02 + + 3.7324428558349609e-01 -1.7276229336857796e-02 + <_> + + 0 -1 7996 -9.9801109172403812e-04 + + -1.4508770406246185e-01 3.0973700806498528e-02 + <_> + + 0 -1 7997 -2.0703389309346676e-03 + + 1.2285920232534409e-01 -2.5285899639129639e-02 + <_> + + 0 -1 7998 7.1816377341747284e-02 + + 7.2997398674488068e-03 -6.2621092796325684e-01 + <_> + + 0 -1 7999 1.6781920194625854e-01 + + -1.0094069875776768e-02 2.2531180083751678e-01 + <_> + + 0 -1 8000 1.5028619964141399e-04 + + -4.9013838171958923e-02 9.5635637640953064e-02 + <_> + + 0 -1 8001 9.5139637589454651e-02 + + -2.3964960128068924e-03 7.8972822427749634e-01 + <_> + + 0 -1 8002 3.8569360040128231e-03 + + 4.0852431207895279e-02 -1.1976979672908783e-01 + <_> + + 0 -1 8003 2.3172760382294655e-02 + + -8.1755416467785835e-03 3.4895899891853333e-01 + <_> + + 0 -1 8004 1.3417989946901798e-02 + + 2.9357729479670525e-02 -1.4476950466632843e-01 + <_> + + 0 -1 8005 -1.4165779948234558e-01 + + 3.4960448741912842e-01 -3.9633908309042454e-03 + <_> + + 0 -1 8006 5.5483141914010048e-03 + + -4.6736769378185272e-02 8.7630823254585266e-02 + <_> + + 0 -1 8007 -4.7431029379367828e-03 + + 6.2899678945541382e-02 -2.6983590796589851e-02 + <_> + + 0 -1 8008 -6.6862776875495911e-02 + + -9.5272868871688843e-01 3.9776111952960491e-03 + <_> + + 0 -1 8009 2.2987840697169304e-02 + + -1.7802899703383446e-02 1.4564949274063110e-01 + <_> + + 0 -1 8010 -2.2234279662370682e-02 + + -9.3360446393489838e-02 5.1537070423364639e-02 + <_> + + 0 -1 8011 1.5045719919726253e-05 + + -3.0237749218940735e-02 2.6654670014977455e-02 + <_> + + 0 -1 8012 -4.7994707711040974e-03 + + 1.0105530172586441e-01 -5.0083991140127182e-02 + <_> + + 0 -1 8013 -2.4227909743785858e-01 + + -6.8399482965469360e-01 2.1470880601555109e-03 + <_> + + 0 -1 8014 4.6939790248870850e-02 + + 8.1193735823035240e-03 -4.7671818733215332e-01 + <_> + + 0 -1 8015 -6.0940280556678772e-02 + + 2.3827329277992249e-01 -9.5430584624409676e-03 + <_> + + 0 -1 8016 2.4104740470647812e-02 + + -1.5799079090356827e-02 2.6727899909019470e-01 + <_> + + 0 -1 8017 -4.6567570418119431e-02 + + -3.1017771363258362e-01 8.3353007212281227e-03 + <_> + + 0 -1 8018 1.8709240248426795e-03 + + -7.2588071227073669e-02 6.5608270466327667e-02 + <_> + + 0 -1 8019 -5.9872400015592575e-03 + + -1.8159690499305725e-01 1.4030029997229576e-02 + <_> + + 0 -1 8020 -7.3103660724882502e-06 + + 4.0913790464401245e-02 -1.0656440258026123e-01 + <_> + + 0 -1 8021 -2.3244550451636314e-02 + + -1.9035540521144867e-01 1.5966059640049934e-02 + <_> + + 0 -1 8022 -1.1853489559143782e-03 + + 5.9956710785627365e-02 -7.6678447425365448e-02 + <_> + + 0 -1 8023 -1.2981820106506348e-01 + + 4.0999498963356018e-01 -5.0850748084485531e-03 + <_> + + 0 -1 8024 -5.1512669771909714e-02 + + -3.0527231097221375e-01 1.4186340384185314e-02 + <_> + + 0 -1 8025 -3.9303461089730263e-03 + + -7.9763479530811310e-02 2.6248890906572342e-02 + <_> + + 0 -1 8026 1.5822829678654671e-02 + + -1.6849309206008911e-02 2.7549791336059570e-01 + <_> + + 0 -1 8027 1.1561570316553116e-01 + + 6.7870649509131908e-03 -1.2709319591522217e-01 + <_> + + 0 -1 8028 1.1260829633101821e-03 + + 8.1908516585826874e-02 -5.8194048702716827e-02 + <_> + + 0 -1 8029 1.5513430349528790e-02 + + -4.2989719659090042e-02 7.8364297747612000e-02 + <_> + + 0 -1 8030 4.6268731355667114e-02 + + 1.1759550310671329e-02 -3.9947330951690674e-01 + <_> + + 0 -1 8031 7.9535972326993942e-03 + + 1.6848539933562279e-02 -8.8599078357219696e-02 + <_> + + 0 -1 8032 -1.8991220742464066e-02 + + 2.4813260138034821e-01 -1.7320850864052773e-02 + <_> + + 0 -1 8033 3.7058200687170029e-03 + + -2.1747030317783356e-02 5.8276090770959854e-02 + <_> + + 0 -1 8034 2.5829279329627752e-03 + + 5.0559278577566147e-02 -9.3193918466567993e-02 + <_> + + 0 -1 8035 -3.1010560691356659e-02 + + 2.2110439836978912e-01 -1.4786499552428722e-02 + <_> + + 0 -1 8036 2.5402549654245377e-03 + + -8.6743600666522980e-02 5.7932410389184952e-02 + <_> + + 0 -1 8037 -8.9100487530231476e-03 + + 5.3846079856157303e-02 -4.5931909233331680e-02 + <_> + + 0 -1 8038 4.0557151660323143e-03 + + 5.9298399835824966e-02 -8.3007253706455231e-02 + <_> + + 0 -1 8039 6.1204940080642700e-02 + + 9.2248879373073578e-03 -2.1082369983196259e-01 + <_> + + 0 -1 8040 7.7630057930946350e-03 + + -7.5927056372165680e-02 5.7865709066390991e-02 + <_> + + 0 -1 8041 1.5921150147914886e-01 + + 8.3040859317407012e-04 -1.0000480413436890e+00 + <_> + + 0 -1 8042 3.9196189492940903e-02 + + 7.1930838748812675e-03 -6.0338622331619263e-01 + <_> + + 0 -1 8043 1.0220289975404739e-01 + + -3.6227719392627478e-03 5.4500752687454224e-01 + <_> + + 0 -1 8044 -1.5064980089664459e-01 + + -7.0450758934020996e-01 6.6995541565120220e-03 + <_> + + 0 -1 8045 1.3819299638271332e-01 + + -1.1153860017657280e-02 1.7932909727096558e-01 + <_> + + 0 -1 8046 -3.8313010009005666e-04 + + -7.2442352771759033e-02 5.7925980538129807e-02 + <_> + + 0 -1 8047 -2.7796919457614422e-03 + + -8.6280398070812225e-02 4.1014600545167923e-02 + <_> + + 0 -1 8048 3.9365138858556747e-02 + + -4.6629320830106735e-02 8.8124006986618042e-02 + <_> + + 0 -1 8049 -6.1933819204568863e-02 + + 7.0118552446365356e-01 -2.5661089457571507e-03 + <_> + + 0 -1 8050 -5.9742941521108150e-03 + + -1.6519010066986084e-01 3.7947021424770355e-02 + <_> + + 0 -1 8051 7.5101079419255257e-03 + + 5.4191488772630692e-02 -7.9166658222675323e-02 + <_> + + 0 -1 8052 -9.7005672752857208e-02 + + -8.8104772567749023e-01 4.8486101441085339e-03 + <_> + + 0 -1 8053 -6.7751510068774223e-03 + + 9.1601163148880005e-02 -4.8942770808935165e-02 + <_> + + 0 -1 8054 -9.2599419876933098e-03 + + -1.3298119604587555e-01 4.1785500943660736e-02 + <_> + + 0 -1 8055 1.5215040184557438e-03 + + 5.2633590996265411e-02 -6.0624439269304276e-02 + <_> + + 0 -1 8056 5.4703168570995331e-03 + + -4.7825179994106293e-02 1.1194570362567902e-01 + <_> + + 0 -1 8057 2.5002110749483109e-02 + + -2.0354969426989555e-02 1.0175590217113495e-01 + <_> + + 0 -1 8058 3.2576780766248703e-02 + + 2.5629660114645958e-02 -1.9484190642833710e-01 + <_> + + 0 -1 8059 -7.7732130885124207e-03 + + 1.2477400153875351e-01 -3.4667998552322388e-02 + <_> + + 0 -1 8060 1.7777189612388611e-02 + + 3.3261820673942566e-02 -1.4155229926109314e-01 + <_> + + 0 -1 8061 1.0459429584443569e-02 + + -4.4039878994226456e-02 6.1871558427810669e-02 + <_> + 406 + -1.1700680255889893e+00 + + <_> + + 0 -1 8062 1.8751189112663269e-02 + + -1.7775079607963562e-01 1.7157439887523651e-01 + <_> + + 0 -1 8063 -2.1875950042158365e-03 + + 7.5339153409004211e-02 -2.5842121243476868e-01 + <_> + + 0 -1 8064 -1.1698690056800842e-01 + + 4.2645370960235596e-01 -3.7121698260307312e-02 + <_> + + 0 -1 8065 3.8377330638468266e-03 + + 3.5092439502477646e-02 -1.5757289528846741e-01 + <_> + + 0 -1 8066 -1.2941210297867656e-03 + + -2.0068730413913727e-01 5.5704809725284576e-02 + <_> + + 0 -1 8067 4.3927300721406937e-03 + + 5.7497099041938782e-02 -1.9302740693092346e-01 + <_> + + 0 -1 8068 -1.5021540457382798e-03 + + 7.2378978133201599e-02 -1.4534910023212433e-01 + <_> + + 0 -1 8069 1.2381949927657843e-03 + + -9.0413779020309448e-02 8.2838788628578186e-02 + <_> + + 0 -1 8070 3.0004729051142931e-03 + + 6.0199409723281860e-02 -1.5556170046329498e-01 + <_> + + 0 -1 8071 4.5666601508855820e-03 + + -7.6936639845371246e-02 1.3762770593166351e-01 + <_> + + 0 -1 8072 9.9231943022459745e-04 + + 4.7918211668729782e-02 -2.0472359657287598e-01 + <_> + + 0 -1 8073 -3.8909649010747671e-03 + + -2.1067039668560028e-01 5.9297189116477966e-02 + <_> + + 0 -1 8074 2.4324860423803329e-03 + + -7.3611870408058167e-02 1.4165569841861725e-01 + <_> + + 0 -1 8075 -3.3090400975197554e-03 + + -1.6489060223102570e-01 4.3310891836881638e-02 + <_> + + 0 -1 8076 5.9596560895442963e-03 + + -2.1388399600982666e-01 4.3472908437252045e-02 + <_> + + 0 -1 8077 9.7754271700978279e-03 + + 2.7664290741086006e-02 -1.9119890034198761e-01 + <_> + + 0 -1 8078 -3.8124300539493561e-02 + + 3.1658840179443359e-01 -2.9972679913043976e-02 + <_> + + 0 -1 8079 1.4401610242202878e-03 + + -1.6602130234241486e-01 6.1300911009311676e-02 + <_> + + 0 -1 8080 7.5199408456683159e-04 + + -1.3568510115146637e-01 5.7345770299434662e-02 + <_> + + 0 -1 8081 2.4780649691820145e-03 + + -7.7258758246898651e-02 5.3781200200319290e-02 + <_> + + 0 -1 8082 9.2068109661340714e-03 + + 7.4349351227283478e-02 -1.3886499404907227e-01 + <_> + + 0 -1 8083 1.7634540796279907e-02 + + -2.6817159727215767e-02 3.4912449121475220e-01 + <_> + + 0 -1 8084 1.0517879854887724e-03 + + 8.3444483578205109e-02 -8.3271436393260956e-02 + <_> + + 0 -1 8085 -7.2119189426302910e-03 + + 1.4149050414562225e-01 -3.0853189527988434e-02 + <_> + + 0 -1 8086 8.1929508596658707e-03 + + 6.4249828457832336e-02 -1.4224460721015930e-01 + <_> + + 0 -1 8087 -5.7932751951739192e-04 + + -6.1768930405378342e-02 3.4835230559110641e-02 + <_> + + 0 -1 8088 4.5172017998993397e-03 + + -7.3925666511058807e-02 9.5347866415977478e-02 + <_> + + 0 -1 8089 2.2280250489711761e-01 + + 2.8079450130462646e-02 -2.6174598932266235e-01 + <_> + + 0 -1 8090 -8.1560667604207993e-04 + + -1.1128710210323334e-01 6.1751261353492737e-02 + <_> + + 0 -1 8091 1.9009260460734367e-02 + + -3.5914849489927292e-02 9.5332697033882141e-02 + <_> + + 0 -1 8092 -1.1708099627867341e-03 + + -1.7809429764747620e-01 3.8471758365631104e-02 + <_> + + 0 -1 8093 -2.7492839843034744e-02 + + 1.5674190223217010e-01 -3.6307450383901596e-02 + <_> + + 0 -1 8094 -5.4139150306582451e-03 + + -1.6014580428600311e-01 4.5228298753499985e-02 + <_> + + 0 -1 8095 1.1325670406222343e-02 + + -5.2679128944873810e-02 1.2411580234766006e-01 + <_> + + 0 -1 8096 -1.3919079303741455e-01 + + -2.8573009371757507e-01 2.5642180815339088e-02 + <_> + + 0 -1 8097 -7.6183810830116272e-02 + + 2.0390880107879639e-01 -1.2701939791440964e-02 + <_> + + 0 -1 8098 1.3947900151833892e-03 + + -1.1320529878139496e-01 5.7419300079345703e-02 + <_> + + 0 -1 8099 4.6532237902283669e-03 + + 5.7795990258455276e-02 -1.0997010022401810e-01 + <_> + + 0 -1 8100 4.5034389942884445e-02 + + -2.8761979192495346e-02 2.2605720162391663e-01 + <_> + + 0 -1 8101 1.6864009201526642e-02 + + 3.6318089812994003e-02 -2.0162770152091980e-01 + <_> + + 0 -1 8102 1.9251279532909393e-01 + + -1.3869989663362503e-02 5.4226338863372803e-01 + <_> + + 0 -1 8103 -1.6758369747549295e-03 + + -1.1462789773941040e-01 4.9984849989414215e-02 + <_> + + 0 -1 8104 -4.5270361006259918e-03 + + 1.1731909960508347e-01 -6.1384700238704681e-02 + <_> + + 0 -1 8105 5.4975082166492939e-03 + + 3.2194830477237701e-02 -1.5348540246486664e-01 + <_> + + 0 -1 8106 3.5562040284276009e-03 + + -6.3937939703464508e-02 1.0787469893693924e-01 + <_> + + 0 -1 8107 2.1489830687642097e-03 + + -5.0976738333702087e-02 2.9315000399947166e-02 + <_> + + 0 -1 8108 -1.0464210063219070e-02 + + 1.9548749923706055e-01 -3.2784409821033478e-02 + <_> + + 0 -1 8109 -2.9779719188809395e-02 + + -3.9286538958549500e-01 1.2266620062291622e-02 + <_> + + 0 -1 8110 9.6993939951062202e-04 + + -1.0772799700498581e-01 6.1684250831604004e-02 + <_> + + 0 -1 8111 -4.0499098598957062e-02 + + -3.6696648597717285e-01 1.1805539950728416e-02 + <_> + + 0 -1 8112 -2.3762779310345650e-03 + + -1.3933740556240082e-01 5.0010170787572861e-02 + <_> + + 0 -1 8113 -5.1528858020901680e-03 + + 9.7424000501632690e-02 -2.3820690810680389e-02 + <_> + + 0 -1 8114 -2.8726980090141296e-02 + + 2.1031719446182251e-01 -3.6088269203901291e-02 + <_> + + 0 -1 8115 1.4215350151062012e-02 + + 3.4664131700992584e-02 -1.5814340114593506e-01 + <_> + + 0 -1 8116 2.0164670422673225e-03 + + 5.0487071275711060e-02 -1.2704199552536011e-01 + <_> + + 0 -1 8117 4.1724709444679320e-04 + + -5.6635189801454544e-02 1.0789140313863754e-01 + <_> + + 0 -1 8118 7.3380130343139172e-03 + + 5.0891719758510590e-02 -1.2210439890623093e-01 + <_> + + 0 -1 8119 -7.5930766761302948e-02 + + 2.2627210617065430e-01 -6.6569480113685131e-03 + <_> + + 0 -1 8120 -4.2873369529843330e-03 + + 7.2104290127754211e-02 -8.0106139183044434e-02 + <_> + + 0 -1 8121 -2.4101670831441879e-02 + + 9.1355301439762115e-02 -3.4591969102621078e-02 + <_> + + 0 -1 8122 1.9936550408601761e-02 + + -3.7764240056276321e-02 1.8896919488906860e-01 + <_> + + 0 -1 8123 5.6939899921417236e-01 + + 3.1492649577558041e-03 -5.9846472740173340e-01 + <_> + + 0 -1 8124 1.0352060198783875e-01 + + 2.3323200643062592e-02 -3.2129231095314026e-01 + <_> + + 0 -1 8125 5.9556990861892700e-02 + + 4.2170342057943344e-03 -3.3442139625549316e-01 + <_> + + 0 -1 8126 -5.0575539469718933e-02 + + -8.4793227910995483e-01 6.6583030857145786e-03 + <_> + + 0 -1 8127 -5.5158971808850765e-03 + + -7.0507496595382690e-02 2.1716769784688950e-02 + <_> + + 0 -1 8128 2.9419310390949249e-02 + + -3.6319408565759659e-02 1.7510940134525299e-01 + <_> + + 0 -1 8129 1.0972440242767334e-02 + + 1.8267199397087097e-02 -1.8641340732574463e-01 + <_> + + 0 -1 8130 -3.8842339999973774e-03 + + -1.0735920071601868e-01 6.0849040746688843e-02 + <_> + + 0 -1 8131 -1.1936859664274380e-04 + + 5.2348621189594269e-02 -1.2701539695262909e-01 + <_> + + 0 -1 8132 -5.0230980850756168e-03 + + 5.2682720124721527e-02 -1.2703679502010345e-01 + <_> + + 0 -1 8133 1.8986819684505463e-01 + + 1.7255579587072134e-03 -3.2701051235198975e-01 + <_> + + 0 -1 8134 -2.4319409858435392e-03 + + 1.3875140249729156e-01 -4.3046601116657257e-02 + <_> + + 0 -1 8135 -2.0888550207018852e-03 + + -1.1241009831428528e-01 3.7676859647035599e-02 + <_> + + 0 -1 8136 4.2116310447454453e-02 + + 8.1929191946983337e-03 -6.8541908264160156e-01 + <_> + + 0 -1 8137 2.7380110695958138e-02 + + 4.4103930704295635e-03 -5.3421849012374878e-01 + <_> + + 0 -1 8138 2.1348569542169571e-02 + + -5.1160380244255066e-02 1.0021480172872543e-01 + <_> + + 0 -1 8139 -1.7236869782209396e-02 + + -3.9995738863945007e-01 2.0257489755749702e-02 + <_> + + 0 -1 8140 7.8617185354232788e-03 + + 2.8996279463171959e-02 -1.8014070391654968e-01 + <_> + + 0 -1 8141 8.1942398101091385e-03 + + -2.5498030707240105e-02 8.4693931043148041e-02 + <_> + + 0 -1 8142 6.2367911450564861e-03 + + 1.8659260123968124e-02 -2.6443660259246826e-01 + <_> + + 0 -1 8143 2.1872919751331210e-04 + + -1.5943029522895813e-01 3.0722649767994881e-02 + <_> + + 0 -1 8144 -6.4004249870777130e-03 + + 2.8331050276756287e-01 -1.9352490082383156e-02 + <_> + + 0 -1 8145 -1.0007199645042419e-01 + + -4.0704050660133362e-01 6.1583020724356174e-03 + <_> + + 0 -1 8146 1.5690149739384651e-02 + + -1.6772339120507240e-02 2.9049569368362427e-01 + <_> + + 0 -1 8147 -7.0421490818262100e-03 + + -6.7985177040100098e-02 3.1130369752645493e-02 + <_> + + 0 -1 8148 -1.5320030041038990e-02 + + 3.6400088667869568e-01 -1.3608699664473534e-02 + <_> + + 0 -1 8149 5.8485660701990128e-02 + + 7.4363988824188709e-03 -7.5599330663681030e-01 + <_> + + 0 -1 8150 -3.5200670827180147e-03 + + -1.3923290371894836e-01 3.7657551467418671e-02 + <_> + + 0 -1 8151 -8.7158178212121129e-04 + + 4.2339839041233063e-02 -5.3530458360910416e-02 + <_> + + 0 -1 8152 2.4548629298806190e-03 + + -4.4667050242424011e-02 1.3785070180892944e-01 + <_> + + 0 -1 8153 -6.1778929084539413e-02 + + -3.5338079929351807e-01 4.5869671739637852e-03 + <_> + + 0 -1 8154 -3.8533521001227200e-04 + + 7.2278007864952087e-02 -1.0433299839496613e-01 + <_> + + 0 -1 8155 7.6227717101573944e-02 + + -1.1004550382494926e-02 5.0025188922882080e-01 + <_> + + 0 -1 8156 -4.4210380874574184e-03 + + -8.6290426552295685e-02 5.8773420751094818e-02 + <_> + + 0 -1 8157 1.5068270266056061e-02 + + -5.8916270732879639e-02 1.0025119781494141e-01 + <_> + + 0 -1 8158 2.5007940828800201e-02 + + 7.6251477003097534e-02 -8.8744960725307465e-02 + <_> + + 0 -1 8159 -7.7328123152256012e-02 + + 2.5363400578498840e-01 -1.5778530389070511e-02 + <_> + + 0 -1 8160 3.5588641185313463e-04 + + 6.2983699142932892e-02 -7.7181987464427948e-02 + <_> + + 0 -1 8161 6.9400526583194733e-02 + + -8.9571140706539154e-03 1.5102629363536835e-01 + <_> + + 0 -1 8162 -1.8577709794044495e-01 + + -6.9518351554870605e-01 7.8398203477263451e-03 + <_> + + 0 -1 8163 -6.6014728508889675e-03 + + -5.6056641042232513e-02 2.4557920172810555e-02 + <_> + + 0 -1 8164 4.0490310639142990e-02 + + -2.0202599465847015e-02 2.7736270427703857e-01 + <_> + + 0 -1 8165 1.6997240018099546e-03 + + -1.1403460055589676e-01 1.9222680479288101e-02 + <_> + + 0 -1 8166 8.4750041365623474e-02 + + 1.8607510253787041e-02 -3.0505430698394775e-01 + <_> + + 0 -1 8167 -1.6975879669189453e-02 + + 1.2357109785079956e-01 -2.9016660526394844e-02 + <_> + + 0 -1 8168 4.6773189678788185e-03 + + -4.5864760875701904e-02 1.1718840152025223e-01 + <_> + + 0 -1 8169 -1.4066020026803017e-02 + + -1.3670490682125092e-01 1.7362629994750023e-02 + <_> + + 0 -1 8170 5.0944689661264420e-02 + + 1.3865640386939049e-02 -3.9529040455818176e-01 + <_> + + 0 -1 8171 9.8265796899795532e-02 + + -1.2339199893176556e-02 3.6408239603042603e-01 + <_> + + 0 -1 8172 1.1730480473488569e-03 + + 6.6400513052940369e-02 -8.2091093063354492e-02 + <_> + + 0 -1 8173 1.0979039967060089e-01 + + 4.6397978439927101e-03 -6.1344558000564575e-01 + <_> + + 0 -1 8174 4.9452850362285972e-04 + + -1.0062679648399353e-01 5.7191990315914154e-02 + <_> + + 0 -1 8175 3.5673558712005615e-01 + + -1.4482989907264709e-02 3.9276111125946045e-01 + <_> + + 0 -1 8176 8.7493062019348145e-03 + + -4.8551220446825027e-02 1.0460250079631805e-01 + <_> + + 0 -1 8177 2.2463349625468254e-02 + + 2.2396000102162361e-02 -1.3587850332260132e-01 + <_> + + 0 -1 8178 1.8538760021328926e-02 + + 3.0029479414224625e-02 -2.0861870050430298e-01 + <_> + + 0 -1 8179 3.4236259758472443e-02 + + -1.0644080117344856e-02 1.6675490140914917e-01 + <_> + + 0 -1 8180 4.0900480002164841e-02 + + -1.2056970037519932e-02 4.3773320317268372e-01 + <_> + + 0 -1 8181 1.0512579977512360e-01 + + -9.4033451750874519e-04 7.8061622381210327e-01 + <_> + + 0 -1 8182 7.4799366295337677e-02 + + 7.8805796802043915e-03 -6.6342961788177490e-01 + <_> + + 0 -1 8183 4.3973559513688087e-05 + + -5.8106150478124619e-02 1.0466519743204117e-01 + <_> + + 0 -1 8184 6.6341059282422066e-03 + + 1.9750369712710381e-02 -2.7033481001853943e-01 + <_> + + 0 -1 8185 6.9901258684694767e-03 + + -3.2210368663072586e-02 5.6677810847759247e-02 + <_> + + 0 -1 8186 -6.9424291141331196e-03 + + 8.3492629230022430e-02 -6.4236722886562347e-02 + <_> + + 0 -1 8187 1.2524950504302979e-01 + + 1.9679870456457138e-03 -8.7889492511749268e-01 + <_> + + 0 -1 8188 -6.0555808246135712e-02 + + -6.5825527906417847e-01 7.3593561537563801e-03 + <_> + + 0 -1 8189 4.2092729359865189e-02 + + 9.0475538745522499e-03 -3.7676310539245605e-01 + <_> + + 0 -1 8190 1.6190059483051300e-02 + + 1.4534840360283852e-02 -3.4089210629463196e-01 + <_> + + 0 -1 8191 -2.6756960898637772e-02 + + 1.6862440109252930e-01 -1.0768949985504150e-02 + <_> + + 0 -1 8192 -5.1163539290428162e-02 + + -9.4068449735641479e-01 4.8503028228878975e-03 + <_> + + 0 -1 8193 -2.9093079268932343e-02 + + 1.3051369786262512e-01 -2.7216060087084770e-02 + <_> + + 0 -1 8194 -1.3433809578418732e-01 + + -5.3713047504425049e-01 1.0605730116367340e-02 + <_> + + 0 -1 8195 -4.0363678708672523e-03 + + -7.8597947955131531e-02 4.5609310269355774e-02 + <_> + + 0 -1 8196 -1.6303880512714386e-01 + + 6.9153147935867310e-01 -6.8249078467488289e-03 + <_> + + 0 -1 8197 5.3527228534221649e-02 + + -8.2422774285078049e-03 2.3649579286575317e-01 + <_> + + 0 -1 8198 9.3209616839885712e-02 + + -7.0793349295854568e-03 6.3985627889633179e-01 + <_> + + 0 -1 8199 -4.1583351790904999e-02 + + -4.0527749061584473e-01 1.1953369714319706e-02 + <_> + + 0 -1 8200 1.5241269767284393e-01 + + -1.6016889363527298e-02 3.7084808945655823e-01 + <_> + + 0 -1 8201 -1.3017480261623859e-02 + + -1.2366600334644318e-01 4.4537510722875595e-02 + <_> + + 0 -1 8202 5.4946541786193848e-02 + + 2.4852929636836052e-02 -2.1955069899559021e-01 + <_> + + 0 -1 8203 3.0320021323859692e-04 + + -1.3367289304733276e-01 4.0226090699434280e-02 + <_> + + 0 -1 8204 1.3891180045902729e-02 + + -2.6901820674538612e-02 1.9647410511970520e-01 + <_> + + 0 -1 8205 1.0848880046978593e-03 + + 3.6422070115804672e-02 -8.3430632948875427e-02 + <_> + + 0 -1 8206 2.3160090204328299e-03 + + -6.1215829104185104e-02 1.1277849972248077e-01 + <_> + + 0 -1 8207 -7.1280319243669510e-03 + + -1.4642429351806641e-01 3.1300168484449387e-02 + <_> + + 0 -1 8208 -3.5769429523497820e-03 + + 1.0159090161323547e-01 -6.0789510607719421e-02 + <_> + + 0 -1 8209 7.6856701634824276e-03 + + 4.2229469865560532e-02 -1.2583130598068237e-01 + <_> + + 0 -1 8210 8.4121264517307281e-03 + + -4.6872619539499283e-02 1.3011389970779419e-01 + <_> + + 0 -1 8211 7.5839929282665253e-02 + + -9.2988023534417152e-03 2.4260810017585754e-01 + <_> + + 0 -1 8212 8.6365960305556655e-04 + + 9.1133847832679749e-02 -6.1323560774326324e-02 + <_> + + 0 -1 8213 -1.0632569901645184e-02 + + -6.7818403244018555e-02 1.9036499783396721e-02 + <_> + + 0 -1 8214 -1.4120140112936497e-02 + + 2.9123929142951965e-01 -1.7482239753007889e-02 + <_> + + 0 -1 8215 2.0944620482623577e-03 + + -1.1744289845228195e-01 5.4129518568515778e-02 + <_> + + 0 -1 8216 4.2378879152238369e-03 + + 3.8495510816574097e-02 -1.4472819864749908e-01 + <_> + + 0 -1 8217 -2.2818730212748051e-03 + + -1.1576230078935623e-01 2.7663499116897583e-02 + <_> + + 0 -1 8218 9.4367301790043712e-04 + + -9.4088926911354065e-02 5.3373821079730988e-02 + <_> + + 0 -1 8219 1.4890190213918686e-02 + + -1.1562420055270195e-02 1.0941980034112930e-01 + <_> + + 0 -1 8220 5.2381302230060101e-03 + + 3.5265430808067322e-02 -1.5212060511112213e-01 + <_> + + 0 -1 8221 1.2663690140470862e-03 + + -3.3352568745613098e-02 7.9812049865722656e-02 + <_> + + 0 -1 8222 -5.3786882199347019e-03 + + 2.0934769511222839e-01 -2.4073069915175438e-02 + <_> + + 0 -1 8223 -1.9063480431213975e-03 + + -2.0774979889392853e-01 2.5406830012798309e-02 + <_> + + 0 -1 8224 3.0771149322390556e-03 + + -5.1940180361270905e-02 1.0475979745388031e-01 + <_> + + 0 -1 8225 9.5619028434157372e-03 + + 3.0633790418505669e-02 -1.0758169740438461e-01 + <_> + + 0 -1 8226 2.0540829747915268e-02 + + -2.2028919309377670e-02 2.3570840060710907e-01 + <_> + + 0 -1 8227 7.0854742079973221e-03 + + -4.7188248485326767e-02 8.4122747182846069e-02 + <_> + + 0 -1 8228 -6.2047559767961502e-03 + + -1.2209820002317429e-01 4.5177329331636429e-02 + <_> + + 0 -1 8229 -2.3474119603633881e-02 + + -2.8770458698272705e-01 1.0876529850065708e-02 + <_> + + 0 -1 8230 9.1368835419416428e-03 + + -3.3426750451326370e-02 2.0680120587348938e-01 + <_> + + 0 -1 8231 1.0512090520933270e-03 + + 4.7006800770759583e-02 -9.5018379390239716e-02 + <_> + + 0 -1 8232 -6.0899247182533145e-04 + + 5.3419198840856552e-02 -1.0444770008325577e-01 + <_> + + 0 -1 8233 -7.4382261373102665e-03 + + -4.8089329153299332e-02 1.9244499504566193e-02 + <_> + + 0 -1 8234 1.9495990127325058e-02 + + -3.0136700719594955e-02 2.0381480455398560e-01 + <_> + + 0 -1 8235 7.7799506485462189e-02 + + 4.2237630113959312e-03 -7.2407877445220947e-01 + <_> + + 0 -1 8236 3.1717489473521709e-03 + + 2.8818940743803978e-02 -1.6305699944496155e-01 + <_> + + 0 -1 8237 -3.9012718945741653e-02 + + -2.9151159524917603e-01 1.1131940409541130e-02 + <_> + + 0 -1 8238 -3.1845991034060717e-03 + + 6.3072219491004944e-02 -7.7291563153266907e-02 + <_> + + 0 -1 8239 1.7876720055937767e-02 + + 5.1196590065956116e-02 -3.7885930389165878e-02 + <_> + + 0 -1 8240 1.2821210548281670e-03 + + -5.7314708828926086e-02 8.7054982781410217e-02 + <_> + + 0 -1 8241 1.0710550099611282e-01 + + -1.5561000443994999e-02 3.1525009870529175e-01 + <_> + + 0 -1 8242 6.9577127695083618e-02 + + 8.9664813131093979e-03 -5.8589607477188110e-01 + <_> + + 0 -1 8243 -4.1071181185543537e-03 + + 9.5472246408462524e-02 -3.5176470875740051e-02 + <_> + + 0 -1 8244 -2.4557299911975861e-03 + + -1.6605280339717865e-01 3.7322919815778732e-02 + <_> + + 0 -1 8245 -2.0908420905470848e-02 + + 1.3989880681037903e-01 -2.9987450689077377e-02 + <_> + + 0 -1 8246 -8.1008402630686760e-03 + + -1.0529220104217529e-01 7.0245787501335144e-02 + <_> + + 0 -1 8247 -2.5671819224953651e-02 + + 4.4254720211029053e-01 -1.1081459932029247e-02 + <_> + + 0 -1 8248 -9.3759642913937569e-03 + + -6.0765031725168228e-02 8.1338323652744293e-02 + <_> + + 0 -1 8249 5.1140699535608292e-02 + + -1.0516249574720860e-02 3.4041538834571838e-01 + <_> + + 0 -1 8250 -4.0337219834327698e-03 + + 8.5099473595619202e-02 -6.3421532511711121e-02 + <_> + + 0 -1 8251 3.3258409239351749e-03 + + -8.4625139832496643e-02 4.7368369996547699e-02 + <_> + + 0 -1 8252 -3.9332117885351181e-03 + + -1.2637099623680115e-01 4.2450599372386932e-02 + <_> + + 0 -1 8253 -4.7937841154634953e-03 + + -4.2527411133050919e-02 2.5126809254288673e-02 + <_> + + 0 -1 8254 2.5972370058298111e-03 + + 4.1884120553731918e-02 -1.4374159276485443e-01 + <_> + + 0 -1 8255 5.2807550877332687e-02 + + -1.2467020191252232e-02 4.0223389863967896e-01 + <_> + + 0 -1 8256 -8.1413555890321732e-03 + + -1.2783770263195038e-01 3.8975879549980164e-02 + <_> + + 0 -1 8257 2.9801739379763603e-02 + + -1.6747390851378441e-02 1.2424229830503464e-01 + <_> + + 0 -1 8258 -8.9907720685005188e-02 + + 3.1418469548225403e-01 -1.8360419198870659e-02 + <_> + + 0 -1 8259 1.7845210433006287e-01 + + 1.0455190204083920e-02 -3.2048919796943665e-01 + <_> + + 0 -1 8260 1.8588220700621605e-02 + + -3.8541439920663834e-02 1.5135329961776733e-01 + <_> + + 0 -1 8261 -4.5074601075612009e-05 + + 5.0462849438190460e-02 -5.6574851274490356e-02 + <_> + + 0 -1 8262 3.8339050952345133e-03 + + 4.7501549124717712e-02 -1.4327140152454376e-01 + <_> + + 0 -1 8263 8.8608250021934509e-02 + + -3.3567149657756090e-03 5.8598208427429199e-01 + <_> + + 0 -1 8264 -7.0611469447612762e-02 + + 6.0292667150497437e-01 -8.3463769406080246e-03 + <_> + + 0 -1 8265 -1.3958199322223663e-01 + + -9.1693513095378876e-02 1.5311989933252335e-02 + <_> + + 0 -1 8266 7.6274941675364971e-03 + + -4.0825009346008301e-02 1.1937720328569412e-01 + <_> + + 0 -1 8267 -7.0419587194919586e-02 + + -6.6531497240066528e-01 2.6815559249371290e-03 + <_> + + 0 -1 8268 2.2952680010348558e-03 + + -7.9496517777442932e-02 5.7034268975257874e-02 + <_> + + 0 -1 8269 3.6756680347025394e-03 + + -2.9180280864238739e-02 5.6333038955926895e-02 + <_> + + 0 -1 8270 4.6072501689195633e-02 + + 1.9100179895758629e-02 -2.9163768887519836e-01 + <_> + + 0 -1 8271 2.1738489158451557e-03 + + -2.6912130415439606e-02 2.0199960470199585e-01 + <_> + + 0 -1 8272 -5.3164511919021606e-03 + + 9.3022979795932770e-02 -7.1548640727996826e-02 + <_> + + 0 -1 8273 -1.1198960244655609e-02 + + -1.0618919879198074e-01 4.8395581543445587e-02 + <_> + + 0 -1 8274 1.7013610340654850e-03 + + -1.3111209869384766e-01 4.3086219578981400e-02 + <_> + + 0 -1 8275 -1.1626269668340683e-02 + + 1.5684530138969421e-01 -2.4698950350284576e-02 + <_> + + 0 -1 8276 9.3881830573081970e-02 + + -1.2058589607477188e-02 3.7941938638687134e-01 + <_> + + 0 -1 8277 1.2041090056300163e-02 + + 2.9569109901785851e-02 -1.3328549265861511e-01 + <_> + + 0 -1 8278 -4.1863098740577698e-03 + + 6.7244023084640503e-02 -7.2228990495204926e-02 + <_> + + 0 -1 8279 8.8373906910419464e-02 + + 7.5915241613984108e-03 -6.2512797117233276e-01 + <_> + + 0 -1 8280 -1.4876410365104675e-02 + + 1.1762090027332306e-01 -4.3840218335390091e-02 + <_> + + 0 -1 8281 1.3433529995381832e-02 + + 1.9615789875388145e-02 -1.1923760175704956e-01 + <_> + + 0 -1 8282 1.5091040730476379e-01 + + -9.9040074273943901e-03 5.6262481212615967e-01 + <_> + + 0 -1 8283 -1.7507839947938919e-02 + + -2.3439739644527435e-01 1.8828360363841057e-02 + <_> + + 0 -1 8284 -1.4707089960575104e-01 + + -7.4530661106109619e-01 7.0233740843832493e-03 + <_> + + 0 -1 8285 3.1485889106988907e-02 + + -3.6193220876157284e-03 6.9215708971023560e-01 + <_> + + 0 -1 8286 -1.6217399388551712e-04 + + 4.6460039913654327e-02 -1.0642550140619278e-01 + <_> + + 0 -1 8287 5.6881760247051716e-04 + + -2.8816150501370430e-02 7.4378728866577148e-02 + <_> + + 0 -1 8288 -1.9876200705766678e-02 + + -2.0997400581836700e-01 2.3018810898065567e-02 + <_> + + 0 -1 8289 -8.7401196360588074e-03 + + 1.7325100302696228e-01 -3.5786859691143036e-02 + <_> + + 0 -1 8290 -5.0579208880662918e-02 + + -5.2024918794631958e-01 9.2388605698943138e-03 + <_> + + 0 -1 8291 9.3982152640819550e-02 + + 3.4048059023916721e-03 -2.9207429289817810e-01 + <_> + + 0 -1 8292 -1.3326539658010006e-02 + + 1.3661830127239227e-01 -3.4405559301376343e-02 + <_> + + 0 -1 8293 -2.2472620010375977e-02 + + -2.5913679599761963e-01 1.1266170069575310e-02 + <_> + + 0 -1 8294 -4.1125040501356125e-02 + + -6.6921561956405640e-01 7.3854308575391769e-03 + <_> + + 0 -1 8295 6.9720767438411713e-02 + + 5.0764488987624645e-03 -2.4747189879417419e-01 + <_> + + 0 -1 8296 2.5198599323630333e-02 + + -1.5660049393773079e-02 2.9408401250839233e-01 + <_> + + 0 -1 8297 4.2568319477140903e-03 + + 3.8112118840217590e-02 -1.2368690222501755e-01 + <_> + + 0 -1 8298 -1.2679009698331356e-02 + + -1.9976189732551575e-01 2.8806639835238457e-02 + <_> + + 0 -1 8299 -1.6080659627914429e-01 + + 1.8710459768772125e-01 -8.2025080919265747e-03 + <_> + + 0 -1 8300 1.2181399762630463e-01 + + -1.0855929926037788e-02 4.5412290096282959e-01 + <_> + + 0 -1 8301 2.8687159065157175e-03 + + -9.8563097417354584e-03 1.9689890742301941e-01 + <_> + + 0 -1 8302 -3.4924471401609480e-04 + + 4.7955259680747986e-02 -1.2549050152301788e-01 + <_> + + 0 -1 8303 4.3789181858301163e-02 + + 5.1197651773691177e-03 -6.6044712066650391e-01 + <_> + + 0 -1 8304 4.9425449222326279e-02 + + 7.9704420641064644e-03 -5.1537191867828369e-01 + <_> + + 0 -1 8305 1.2263789772987366e-02 + + 9.8127601668238640e-03 -1.6274920105934143e-01 + <_> + + 0 -1 8306 -6.7564379423856735e-03 + + -6.6992767155170441e-02 7.8426092863082886e-02 + <_> + + 0 -1 8307 1.9599240273237228e-02 + + -2.4508479982614517e-02 1.7892380058765411e-01 + <_> + + 0 -1 8308 1.3520059874281287e-03 + + -7.5853422284126282e-02 5.7282470166683197e-02 + <_> + + 0 -1 8309 5.1610758528113365e-03 + + 5.0592619925737381e-02 -9.6658922731876373e-02 + <_> + + 0 -1 8310 2.7124589309096336e-02 + + -1.3078499585390091e-02 3.3894819021224976e-01 + <_> + + 0 -1 8311 -7.3659062385559082e-02 + + -9.0775561332702637e-01 5.3760888986289501e-03 + <_> + + 0 -1 8312 -2.7619479224085808e-03 + + 1.3446320593357086e-01 -3.4483309835195541e-02 + <_> + + 0 -1 8313 -1.5638889744877815e-03 + + -1.9992120563983917e-01 1.4003699645400047e-02 + <_> + + 0 -1 8314 4.0559601038694382e-03 + + 5.3183209151029587e-02 -1.0070829838514328e-01 + <_> + + 0 -1 8315 -3.2189621124416590e-03 + + 6.2624312937259674e-02 -3.0276089906692505e-02 + <_> + + 0 -1 8316 4.1666622273623943e-03 + + -9.1761156916618347e-02 5.8400500565767288e-02 + <_> + + 0 -1 8317 2.0393060520291328e-02 + + 4.8048538155853748e-03 -3.8386350870132446e-01 + <_> + + 0 -1 8318 -9.9844802170991898e-03 + + -6.9473296403884888e-02 7.0034191012382507e-02 + <_> + + 0 -1 8319 1.9515320658683777e-02 + + -3.4106500446796417e-02 1.0831409692764282e-01 + <_> + + 0 -1 8320 8.7807718664407730e-03 + + 3.6990050226449966e-02 -1.3089330494403839e-01 + <_> + + 0 -1 8321 1.7314519500359893e-03 + + -4.2123470455408096e-02 8.4982097148895264e-02 + <_> + + 0 -1 8322 -2.6709519326686859e-02 + + 3.2326829433441162e-01 -1.5427160076797009e-02 + <_> + + 0 -1 8323 7.8696580603718758e-03 + + 3.1361158937215805e-02 -1.0568609833717346e-01 + <_> + + 0 -1 8324 3.2152980566024780e-03 + + -6.5161801874637604e-02 7.6189488172531128e-02 + <_> + + 0 -1 8325 -2.3215120658278465e-02 + + 2.2522650659084320e-01 -1.4838770031929016e-02 + <_> + + 0 -1 8326 -4.4935368932783604e-03 + + -1.3131460547447205e-01 4.2855940759181976e-02 + <_> + + 0 -1 8327 -1.1850389651954174e-02 + + 1.4825740456581116e-01 -2.9456850141286850e-02 + <_> + + 0 -1 8328 -9.3039282364770770e-04 + + 7.9329937696456909e-02 -7.5784526765346527e-02 + <_> + + 0 -1 8329 -7.2138011455535889e-04 + + 2.2042410448193550e-02 -2.0893280208110809e-01 + <_> + + 0 -1 8330 1.3078770041465759e-01 + + -1.2214420363306999e-02 4.3224608898162842e-01 + <_> + + 0 -1 8331 2.7863389253616333e-01 + + -7.4468360980972648e-04 9.9999761581420898e-01 + <_> + + 0 -1 8332 -4.0815200656652451e-02 + + -6.1310279369354248e-01 8.2405265420675278e-03 + <_> + + 0 -1 8333 1.5054940013214946e-03 + + -1.8053399398922920e-02 6.5230727195739746e-02 + <_> + + 0 -1 8334 6.5729310736060143e-03 + + 3.0967630445957184e-02 -1.5021359920501709e-01 + <_> + + 0 -1 8335 -1.4033170044422150e-01 + + -4.4641208648681641e-01 5.0997259095311165e-03 + <_> + + 0 -1 8336 -1.2781560420989990e-02 + + 1.2579609453678131e-01 -4.6258769929409027e-02 + <_> + + 0 -1 8337 1.3383819721639156e-02 + + 7.5233832001686096e-02 -2.9858419671654701e-02 + <_> + + 0 -1 8338 9.5225386321544647e-03 + + -4.4135529547929764e-02 1.0822969675064087e-01 + <_> + + 0 -1 8339 -7.2484686970710754e-02 + + -1. 1.3005880173295736e-03 + <_> + + 0 -1 8340 3.6246789386495948e-04 + + -6.6878542304039001e-02 7.3916479945182800e-02 + <_> + + 0 -1 8341 -1.5511980280280113e-02 + + -1.8414540588855743e-01 1.5999039635062218e-02 + <_> + + 0 -1 8342 5.1146611571311951e-02 + + -9.4361994415521622e-03 5.4720860719680786e-01 + <_> + + 0 -1 8343 -8.9448272774461657e-05 + + 3.2970890402793884e-02 -4.5103389769792557e-02 + <_> + + 0 -1 8344 1.0151580208912492e-03 + + 4.8603180795907974e-02 -9.8257049918174744e-02 + <_> + + 0 -1 8345 5.3570970892906189e-02 + + 1.0325700044631958e-02 -1.4304420351982117e-01 + <_> + + 0 -1 8346 1.2302629649639130e-01 + + -5.2219899371266365e-03 8.6903452873229980e-01 + <_> + + 0 -1 8347 -6.0005468549206853e-04 + + 5.3572040051221848e-02 -5.8203268796205521e-02 + <_> + + 0 -1 8348 -4.4715698808431625e-02 + + 4.4988310337066650e-01 -1.0549419559538364e-02 + <_> + + 0 -1 8349 6.3781379722058773e-03 + + 2.6184290647506714e-02 -1.0640030354261398e-01 + <_> + + 0 -1 8350 -5.6618300732225180e-04 + + 5.7264849543571472e-02 -7.7750243246555328e-02 + <_> + + 0 -1 8351 -1.5853339573368430e-04 + + 2.5316949933767319e-02 -5.7189941406250000e-02 + <_> + + 0 -1 8352 -4.9790769815444946e-02 + + -3.7127709388732910e-01 1.3125170022249222e-02 + <_> + + 0 -1 8353 -1.0477020405232906e-02 + + 8.4245949983596802e-02 -3.6731608211994171e-02 + <_> + + 0 -1 8354 -9.0497080236673355e-03 + + -1.6894440352916718e-01 2.8471369296312332e-02 + <_> + + 0 -1 8355 -3.5202078521251678e-02 + + -4.3810841441154480e-01 5.8491500094532967e-03 + <_> + + 0 -1 8356 -2.0730090327560902e-03 + + 9.4890840351581573e-02 -5.3059589117765427e-02 + <_> + + 0 -1 8357 -5.0727208144962788e-03 + + -1.1221739649772644e-01 4.4165991246700287e-02 + <_> + + 0 -1 8358 2.5876651052385569e-03 + + -5.5557820945978165e-02 1.1426319926977158e-01 + <_> + + 0 -1 8359 -2.4757650680840015e-03 + + -4.8213180154561996e-02 3.1529899686574936e-02 + <_> + + 0 -1 8360 -1.2912530452013016e-02 + + 1.1486659944057465e-01 -3.8589760661125183e-02 + <_> + + 0 -1 8361 7.0194348692893982e-02 + + 3.5798270255327225e-03 -7.3008167743682861e-01 + <_> + + 0 -1 8362 -1.2016300112009048e-01 + + -6.7217922210693359e-01 5.8088749647140503e-03 + <_> + + 0 -1 8363 1.3109490275382996e-01 + + 1.5340699814260006e-02 -1.2917870283126831e-01 + <_> + + 0 -1 8364 -1.1350499838590622e-01 + + 4.7297981381416321e-01 -1.0574280284345150e-02 + <_> + + 0 -1 8365 -7.1533523499965668e-02 + + -3.4910291433334351e-01 9.8157208412885666e-03 + <_> + + 0 -1 8366 1.5889670699834824e-02 + + -3.0149290338158607e-02 1.5134809911251068e-01 + <_> + + 0 -1 8367 2.6840370893478394e-01 + + 9.9974423646926880e-03 -1.2243749946355820e-01 + <_> + + 0 -1 8368 -1.4922569692134857e-01 + + -1.5773139894008636e-01 2.7682509273290634e-02 + <_> + + 0 -1 8369 -2.2858489304780960e-02 + + 1.7340719699859619e-01 -2.1124770864844322e-02 + <_> + + 0 -1 8370 -9.0983451809734106e-04 + + 5.5269908159971237e-02 -8.5052981972694397e-02 + <_> + + 0 -1 8371 -1.1462160386145115e-02 + + -1.4397600293159485e-01 1.3809709809720516e-02 + <_> + + 0 -1 8372 8.7118431925773621e-02 + + 6.4688520506024361e-03 -7.2809070348739624e-01 + <_> + + 0 -1 8373 5.3810589015483856e-02 + + -2.8251519426703453e-02 1.3615800440311432e-01 + <_> + + 0 -1 8374 -1.6928049735724926e-03 + + -1.0114800184965134e-01 5.2096601575613022e-02 + <_> + + 0 -1 8375 -1.4526920393109322e-02 + + -1.0613209754228592e-01 2.7218030765652657e-02 + <_> + + 0 -1 8376 -5.9082340449094772e-03 + + 1.1257000267505646e-01 -6.1032701283693314e-02 + <_> + + 0 -1 8377 -2.1421469748020172e-02 + + -1.5464189648628235e-01 1.1853870004415512e-02 + <_> + + 0 -1 8378 8.0171570181846619e-02 + + 5.5826799944043159e-03 -8.2389092445373535e-01 + <_> + + 0 -1 8379 -1.0931739816442132e-03 + + -7.8393906354904175e-02 1.3433099724352360e-02 + <_> + + 0 -1 8380 4.1605130536481738e-04 + + -4.3186139315366745e-02 1.0500840097665787e-01 + <_> + + 0 -1 8381 -2.8376420959830284e-03 + + 7.8960210084915161e-02 -4.2247280478477478e-02 + <_> + + 0 -1 8382 -2.8522519394755363e-02 + + -1.0722970217466354e-01 4.7789189964532852e-02 + <_> + + 0 -1 8383 4.0068081021308899e-01 + + -5.7991011999547482e-03 3.0695509910583496e-01 + <_> + + 0 -1 8384 -8.1703867763280869e-03 + + 1.0851760208606720e-01 -5.6153468787670135e-02 + <_> + + 0 -1 8385 9.3125440180301666e-03 + + -4.4560939073562622e-02 4.3634049594402313e-02 + <_> + + 0 -1 8386 5.8274720795452595e-03 + + 3.1310841441154480e-02 -1.6053420305252075e-01 + <_> + + 0 -1 8387 -2.9063750989735126e-03 + + 3.7148229777812958e-02 -2.7310580015182495e-02 + <_> + + 0 -1 8388 1.6421969980001450e-02 + + -3.1616371124982834e-02 1.6195470094680786e-01 + <_> + + 0 -1 8389 -1.3876060023903847e-02 + + -1.7840880155563354e-01 2.6925239711999893e-02 + <_> + + 0 -1 8390 -2.9935980215668678e-02 + + 2.0069709420204163e-01 -2.7372730895876884e-02 + <_> + + 0 -1 8391 8.1381313502788544e-03 + + 4.0951769798994064e-02 -7.4756972491741180e-02 + <_> + + 0 -1 8392 -5.8591389097273350e-03 + + -1.2337020039558411e-01 3.9641879498958588e-02 + <_> + + 0 -1 8393 7.1592196822166443e-02 + + -1.0293760336935520e-02 2.2391259670257568e-01 + <_> + + 0 -1 8394 5.0111521035432816e-02 + + 2.4072999134659767e-02 -2.1443809568881989e-01 + <_> + + 0 -1 8395 4.2603579349815845e-03 + + -2.3712050169706345e-02 7.3603406548500061e-02 + <_> + + 0 -1 8396 6.5065422095358372e-03 + + -6.7402780055999756e-02 7.6926141977310181e-02 + <_> + + 0 -1 8397 2.0325470250099897e-03 + + -9.9664673209190369e-02 5.7994231581687927e-02 + <_> + + 0 -1 8398 -9.3465158715844154e-03 + + 1.9432920217514038e-01 -3.1387709081172943e-02 + <_> + + 0 -1 8399 9.5768114551901817e-03 + + 2.2594990208745003e-02 -1.6090850532054901e-01 + <_> + + 0 -1 8400 -4.6763911843299866e-02 + + -3.5020270943641663e-01 1.5035149641335011e-02 + <_> + + 0 -1 8401 -5.0164870917797089e-02 + + 1.2763389945030212e-01 -1.1035620234906673e-02 + <_> + + 0 -1 8402 2.3148149251937866e-02 + + -2.4636579677462578e-02 2.0264349877834320e-01 + <_> + + 0 -1 8403 -7.4168562889099121e-02 + + -9.4854289293289185e-01 2.2216918878257275e-03 + <_> + + 0 -1 8404 -2.0698629319667816e-02 + + -2.4585549533367157e-01 2.1370820701122284e-02 + <_> + + 0 -1 8405 -5.8187540620565414e-02 + + 3.0531001091003418e-01 -8.1265745684504509e-03 + <_> + + 0 -1 8406 -5.2451588213443756e-02 + + 5.0567781925201416e-01 -9.7108660265803337e-03 + <_> + + 0 -1 8407 -4.6721640974283218e-02 + + 8.0896109342575073e-01 -1.8908439669758081e-03 + <_> + + 0 -1 8408 -1.0385509580373764e-02 + + -2.8369909524917603e-01 1.9166229292750359e-02 + <_> + + 0 -1 8409 5.4432367905974388e-03 + + 4.1430719196796417e-02 -1.6033279895782471e-01 + <_> + + 0 -1 8410 2.4030160158872604e-02 + + -4.3751548975706100e-02 1.0553020238876343e-01 + <_> + + 0 -1 8411 -2.6430420577526093e-02 + + -8.7448269128799438e-02 2.8769830241799355e-02 + <_> + + 0 -1 8412 4.8743681982159615e-03 + + 3.5032961517572403e-02 -1.5881679952144623e-01 + <_> + + 0 -1 8413 -2.5106489192694426e-03 + + 8.8161677122116089e-02 -3.0205590650439262e-02 + <_> + + 0 -1 8414 -5.2146320231258869e-03 + + -1.1350130289793015e-01 4.2001061141490936e-02 + <_> + + 0 -1 8415 -1.0986009612679482e-02 + + 8.4428779780864716e-02 -3.8272839039564133e-02 + <_> + + 0 -1 8416 -6.0057129710912704e-02 + + -7.9249101877212524e-01 5.2951448597013950e-03 + <_> + + 0 -1 8417 1.3621809892356396e-02 + + -1.7419820651412010e-02 2.1612060070037842e-01 + <_> + + 0 -1 8418 -2.2223800420761108e-02 + + 2.6721641421318054e-01 -2.0207190886139870e-02 + <_> + + 0 -1 8419 5.8124359697103500e-02 + + 6.0539757832884789e-03 -4.0927109122276306e-01 + <_> + + 0 -1 8420 -2.8097970411181450e-02 + + -1.1217900365591049e-01 5.4144639521837234e-02 + <_> + + 0 -1 8421 6.5278373658657074e-02 + + -7.4973162263631821e-03 1.2384270131587982e-01 + <_> + + 0 -1 8422 -2.5233640335500240e-03 + + -1.8224379420280457e-01 2.4537850171327591e-02 + <_> + + 0 -1 8423 1.1478599905967712e-01 + + 1.9617579877376556e-02 -1.1905120313167572e-01 + <_> + + 0 -1 8424 9.6991509199142456e-03 + + -5.3946550935506821e-02 1.1180210113525391e-01 + <_> + + 0 -1 8425 2.9359150677919388e-02 + + -2.3395609110593796e-02 1.8534250557422638e-01 + <_> + + 0 -1 8426 7.8490097075700760e-03 + + 1.6454109549522400e-01 -4.2129490524530411e-02 + <_> + + 0 -1 8427 4.0329899638891220e-03 + + 2.4495590478181839e-02 -6.5955489873886108e-02 + <_> + + 0 -1 8428 2.1471390128135681e-01 + + -1.0462880134582520e-02 4.7438031435012817e-01 + <_> + + 0 -1 8429 -2.2316209506243467e-03 + + 4.9796439707279205e-02 -1.0328280180692673e-01 + <_> + + 0 -1 8430 2.1833330392837524e-02 + + -5.3884848952293396e-02 9.3277551233768463e-02 + <_> + + 0 -1 8431 2.4430779740214348e-02 + + 1.5706099569797516e-02 -2.8244438767433167e-01 + <_> + + 0 -1 8432 1.2532520107924938e-02 + + -3.0983900651335716e-02 1.5599699318408966e-01 + <_> + + 0 -1 8433 7.9741179943084717e-03 + + 2.6650540530681610e-02 -1.3689580559730530e-01 + <_> + + 0 -1 8434 7.9444557428359985e-02 + + 6.4238710328936577e-03 -7.8485661745071411e-01 + <_> + + 0 -1 8435 -1.7925030551850796e-03 + + 3.9645589888095856e-02 -1.1497259885072708e-01 + <_> + + 0 -1 8436 -9.0927572455257177e-04 + + 6.3256889581680298e-02 -7.5250372290611267e-02 + <_> + + 0 -1 8437 -2.6040049269795418e-02 + + 1.4864259958267212e-01 -1.8506240099668503e-02 + <_> + + 0 -1 8438 4.1452320292592049e-03 + + 3.3959619700908661e-02 -1.4355990290641785e-01 + <_> + + 0 -1 8439 5.7123368605971336e-04 + + -6.8550966680049896e-02 6.9944731891155243e-02 + <_> + + 0 -1 8440 -4.9577720463275909e-02 + + 3.9880838990211487e-01 -1.1339910328388214e-02 + <_> + + 0 -1 8441 -1.5334860421717167e-02 + + -8.3445623517036438e-02 3.2276369631290436e-02 + <_> + + 0 -1 8442 -1.7406089231371880e-02 + + 1.3560940325260162e-01 -3.1945578753948212e-02 + <_> + + 0 -1 8443 -2.1422259509563446e-02 + + -1.1050239950418472e-01 2.8536040335893631e-02 + <_> + + 0 -1 8444 1.9694769289344549e-03 + + 4.3834108859300613e-02 -1.0551860183477402e-01 + <_> + + 0 -1 8445 -1.9115379080176353e-02 + + 1.4690290391445160e-01 -1.5405310317873955e-02 + <_> + + 0 -1 8446 4.6963259577751160e-02 + + 8.1654358655214310e-03 -5.8734887838363647e-01 + <_> + + 0 -1 8447 2.0964320003986359e-01 + + 3.1721789855509996e-03 -8.0437898635864258e-01 + <_> + + 0 -1 8448 6.2511406838893890e-02 + + -1.6422789543867111e-02 3.0976039171218872e-01 + <_> + + 0 -1 8449 -1.0126180201768875e-01 + + -6.1639147996902466e-01 7.2699659503996372e-03 + <_> + + 0 -1 8450 3.3980670850723982e-03 + + -1.9664889201521873e-02 2.2541929781436920e-01 + <_> + + 0 -1 8451 -1.7059950157999992e-02 + + -1.7193520441651344e-02 6.9114550948143005e-02 + <_> + + 0 -1 8452 3.7455849815160036e-03 + + 5.1737461239099503e-02 -8.2748822867870331e-02 + <_> + + 0 -1 8453 8.7769806385040283e-02 + + -6.3681108877062798e-03 7.9492002725601196e-02 + <_> + + 0 -1 8454 2.3725361097604036e-03 + + -3.0487439036369324e-01 1.4520769938826561e-02 + <_> + + 0 -1 8455 -1.9282909110188484e-02 + + 1.8806980550289154e-01 -1.3220929540693760e-02 + <_> + + 0 -1 8456 3.8580079562962055e-03 + + 3.3978439867496490e-02 -1.2854169309139252e-01 + <_> + + 0 -1 8457 2.6525680441409349e-03 + + -3.9146900177001953e-02 9.9119357764720917e-02 + <_> + + 0 -1 8458 9.9175602197647095e-02 + + 5.0618657842278481e-03 -8.7370461225509644e-01 + <_> + + 0 -1 8459 -7.0648840628564358e-03 + + 8.5219286382198334e-02 -2.4467790499329567e-02 + <_> + + 0 -1 8460 -5.2547529339790344e-03 + + -1.2158469855785370e-01 3.7228528410196304e-02 + <_> + + 0 -1 8461 5.0068609416484833e-03 + + -3.5557191818952560e-02 7.8515462577342987e-02 + <_> + + 0 -1 8462 -6.8118162453174591e-02 + + -2.6292499899864197e-01 1.8325960263609886e-02 + <_> + + 0 -1 8463 9.3348289374262094e-04 + + -3.0107179656624794e-02 4.4869720935821533e-02 + <_> + + 0 -1 8464 -2.1996269933879375e-03 + + 1.1136700212955475e-01 -6.6201932728290558e-02 + <_> + + 0 -1 8465 -6.6485330462455750e-03 + + -7.8398697078227997e-02 2.0472070202231407e-02 + <_> + + 0 -1 8466 1.4126920141279697e-03 + + -5.2428670227527618e-02 8.9471399784088135e-02 + <_> + + 0 -1 8467 5.1406599581241608e-02 + + -1.4306739903986454e-03 6.3885271549224854e-01 + + <_> + + <_> + 2 7 14 4 -1. + <_> + 2 9 14 2 2. + <_> + + <_> + 1 2 18 4 -1. + <_> + 7 2 6 4 3. + <_> + + <_> + 5 5 9 5 -1. + <_> + 8 5 3 5 3. + <_> + + <_> + 3 6 14 9 -1. + <_> + 3 9 14 3 3. + <_> + + <_> + 1 1 18 5 -1. + <_> + 7 1 6 5 3. + <_> + + <_> + 4 6 12 8 -1. + <_> + 4 10 12 4 2. + <_> + + <_> + 9 5 6 10 -1. + <_> + 12 5 3 5 2. + <_> + 9 10 3 5 2. + <_> + + <_> + 4 0 11 9 -1. + <_> + 4 3 11 3 3. + <_> + + <_> + 12 5 4 8 -1. + <_> + 12 9 4 4 2. + <_> + + <_> + 4 5 10 10 -1. + <_> + 4 5 5 5 2. + <_> + 9 10 5 5 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 3 8 5 12 -1. + <_> + 3 14 5 6 2. + <_> + + <_> + 5 3 9 9 -1. + <_> + 5 6 9 3 3. + <_> + + <_> + 8 5 4 12 -1. + <_> + 8 11 4 6 2. + <_> + + <_> + 3 6 5 6 -1. + <_> + 3 9 5 3 2. + <_> + + <_> + 4 5 12 5 -1. + <_> + 8 5 4 5 3. + <_> + + <_> + 1 2 8 8 -1. + <_> + 1 2 4 4 2. + <_> + 5 6 4 4 2. + <_> + + <_> + 8 12 10 8 -1. + <_> + 13 12 5 4 2. + <_> + 8 16 5 4 2. + <_> + + <_> + 4 9 3 10 -1. + <_> + 4 14 3 5 2. + <_> + + <_> + 0 4 20 10 -1. + <_> + 0 9 20 5 2. + <_> + + <_> + 3 0 13 9 -1. + <_> + 3 3 13 3 3. + <_> + + <_> + 10 1 4 11 -1. + <_> + 10 1 2 11 2. + <_> + + <_> + 6 1 4 11 -1. + <_> + 8 1 2 11 2. + <_> + + <_> + 4 6 12 8 -1. + <_> + 10 6 6 4 2. + <_> + 4 10 6 4 2. + <_> + + <_> + 4 7 12 4 -1. + <_> + 4 9 12 2 2. + <_> + + <_> + 11 9 4 7 -1. + <_> + 11 9 2 7 2. + <_> + + <_> + 5 9 4 7 -1. + <_> + 7 9 2 7 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 0 7 20 6 -1. + <_> + 0 9 20 2 3. + <_> + + <_> + 6 3 8 6 -1. + <_> + 6 6 8 3 2. + <_> + + <_> + 7 2 6 7 -1. + <_> + 9 2 2 7 3. + <_> + + <_> + 11 7 5 9 -1. + <_> + 11 10 5 3 3. + <_> + + <_> + 4 6 8 8 -1. + <_> + 4 6 4 4 2. + <_> + 8 10 4 4 2. + <_> + + <_> + 9 5 6 8 -1. + <_> + 9 9 6 4 2. + <_> + + <_> + 4 10 5 6 -1. + <_> + 4 13 5 3 2. + <_> + + <_> + 12 0 6 5 -1. + <_> + 12 0 3 5 2. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 3 2 17 2 -1. + <_> + 3 3 17 1 2. + <_> + + <_> + 5 6 4 8 -1. + <_> + 5 10 4 4 2. + <_> + + <_> + 14 3 6 9 -1. + <_> + 14 3 3 9 2. + <_> + + <_> + 3 0 9 5 -1. + <_> + 6 0 3 5 3. + <_> + + <_> + 15 2 4 9 -1. + <_> + 15 2 2 9 2. + <_> + + <_> + 1 2 4 9 -1. + <_> + 3 2 2 9 2. + <_> + + <_> + 8 8 6 12 -1. + <_> + 8 12 6 4 3. + <_> + + <_> + 2 13 16 4 -1. + <_> + 2 13 8 2 2. + <_> + 10 15 8 2 2. + <_> + + <_> + 6 5 8 6 -1. + <_> + 6 7 8 2 3. + <_> + + <_> + 0 11 8 6 -1. + <_> + 0 13 8 2 3. + <_> + + <_> + 0 18 20 2 -1. + <_> + 0 19 20 1 2. + <_> + + <_> + 1 12 7 6 -1. + <_> + 1 14 7 2 3. + <_> + + <_> + 3 1 17 3 -1. + <_> + 3 2 17 1 3. + <_> + + <_> + 3 6 5 6 -1. + <_> + 3 9 5 3 2. + <_> + + <_> + 4 5 12 7 -1. + <_> + 8 5 4 7 3. + <_> + + <_> + 0 4 14 4 -1. + <_> + 0 4 7 2 2. + <_> + 7 6 7 2 2. + <_> + + <_> + 4 11 12 9 -1. + <_> + 4 14 12 3 3. + <_> + + <_> + 3 2 14 16 -1. + <_> + 3 2 7 8 2. + <_> + 10 10 7 8 2. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 3 1 10 16 -1. + <_> + 3 1 5 8 2. + <_> + 8 9 5 8 2. + <_> + + <_> + 1 0 16 2 -1. + <_> + 1 1 16 1 2. + <_> + + <_> + 2 10 16 4 -1. + <_> + 2 12 16 2 2. + <_> + + <_> + 7 0 6 8 -1. + <_> + 9 0 2 8 3. + <_> + + <_> + 5 3 10 9 -1. + <_> + 5 6 10 3 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 10 6 8 12 -1. + <_> + 10 10 8 4 3. + <_> + + <_> + 2 8 15 3 -1. + <_> + 2 9 15 1 3. + <_> + + <_> + 10 6 9 12 -1. + <_> + 10 10 9 4 3. + <_> + + <_> + 4 6 6 8 -1. + <_> + 4 10 6 4 2. + <_> + + <_> + 9 8 4 12 -1. + <_> + 9 12 4 4 3. + <_> + + <_> + 1 0 6 18 -1. + <_> + 4 0 3 18 2. + <_> + + <_> + 5 2 13 2 -1. + <_> + 5 3 13 1 2. + <_> + + <_> + 5 5 6 5 -1. + <_> + 8 5 3 5 2. + <_> + + <_> + 6 0 8 12 -1. + <_> + 10 0 4 6 2. + <_> + 6 6 4 6 2. + <_> + + <_> + 2 1 6 10 -1. + <_> + 2 1 3 5 2. + <_> + 5 6 3 5 2. + <_> + + <_> + 11 12 7 6 -1. + <_> + 11 14 7 2 3. + <_> + + <_> + 0 12 18 4 -1. + <_> + 0 12 9 2 2. + <_> + 9 14 9 2 2. + <_> + + <_> + 5 5 15 6 -1. + <_> + 5 7 15 2 3. + <_> + + <_> + 2 6 5 9 -1. + <_> + 2 9 5 3 3. + <_> + + <_> + 9 8 10 6 -1. + <_> + 14 8 5 3 2. + <_> + 9 11 5 3 2. + <_> + + <_> + 5 6 10 10 -1. + <_> + 5 6 5 5 2. + <_> + 10 11 5 5 2. + <_> + + <_> + 7 4 12 4 -1. + <_> + 7 6 12 2 2. + <_> + + <_> + 1 10 16 4 -1. + <_> + 1 10 8 2 2. + <_> + 9 12 8 2 2. + <_> + + <_> + 1 17 18 3 -1. + <_> + 7 17 6 3 3. + <_> + + <_> + 6 0 3 17 -1. + <_> + 7 0 1 17 3. + <_> + + <_> + 9 4 4 16 -1. + <_> + 11 4 2 8 2. + <_> + 9 12 2 8 2. + <_> + + <_> + 0 0 4 20 -1. + <_> + 2 0 2 20 2. + <_> + + <_> + 13 2 6 13 -1. + <_> + 15 2 2 13 3. + <_> + + <_> + 6 1 6 18 -1. + <_> + 6 1 3 9 2. + <_> + 9 10 3 9 2. + <_> + + <_> + 15 0 4 13 -1. + <_> + 15 0 2 13 2. + <_> + + <_> + 5 6 3 14 -1. + <_> + 6 6 1 14 3. + <_> + + <_> + 14 2 6 13 -1. + <_> + 14 2 3 13 2. + <_> + + <_> + 1 2 18 3 -1. + <_> + 7 2 6 3 3. + <_> + + <_> + 5 5 11 8 -1. + <_> + 5 9 11 4 2. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 11 4 7 4 -1. + <_> + 11 6 7 2 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 1 0 18 20 -1. + <_> + 7 0 6 20 3. + <_> + + <_> + 5 3 10 9 -1. + <_> + 5 6 10 3 3. + <_> + + <_> + 14 3 6 11 -1. + <_> + 14 3 3 11 2. + <_> + + <_> + 3 9 4 10 -1. + <_> + 3 14 4 5 2. + <_> + + <_> + 8 1 12 19 -1. + <_> + 8 1 6 19 2. + <_> + + <_> + 0 1 12 19 -1. + <_> + 6 1 6 19 2. + <_> + + <_> + 8 4 4 16 -1. + <_> + 8 12 4 8 2. + <_> + + <_> + 9 8 4 12 -1. + <_> + 9 12 4 4 3. + <_> + + <_> + 6 2 8 12 -1. + <_> + 6 6 8 4 3. + <_> + + <_> + 7 7 6 13 -1. + <_> + 9 7 2 13 3. + <_> + + <_> + 0 6 7 6 -1. + <_> + 0 9 7 3 2. + <_> + + <_> + 1 8 19 3 -1. + <_> + 1 9 19 1 3. + <_> + + <_> + 5 0 3 14 -1. + <_> + 6 0 1 14 3. + <_> + + <_> + 10 3 10 6 -1. + <_> + 15 3 5 3 2. + <_> + 10 6 5 3 2. + <_> + + <_> + 5 1 8 8 -1. + <_> + 5 1 4 4 2. + <_> + 9 5 4 4 2. + <_> + + <_> + 6 7 14 4 -1. + <_> + 13 7 7 2 2. + <_> + 6 9 7 2 2. + <_> + + <_> + 0 7 14 4 -1. + <_> + 0 7 7 2 2. + <_> + 7 9 7 2 2. + <_> + + <_> + 10 6 9 12 -1. + <_> + 10 10 9 4 3. + <_> + + <_> + 4 10 8 4 -1. + <_> + 8 10 4 4 2. + <_> + + <_> + 11 14 8 6 -1. + <_> + 11 16 8 2 3. + <_> + + <_> + 2 7 13 2 -1. + <_> + 2 8 13 1 2. + <_> + + <_> + 3 14 14 4 -1. + <_> + 10 14 7 2 2. + <_> + 3 16 7 2 2. + <_> + + <_> + 0 11 6 9 -1. + <_> + 3 11 3 9 2. + <_> + + <_> + 5 9 13 2 -1. + <_> + 5 10 13 1 2. + <_> + + <_> + 3 0 7 9 -1. + <_> + 3 3 7 3 3. + <_> + + <_> + 8 14 10 6 -1. + <_> + 13 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 5 4 9 5 -1. + <_> + 8 4 3 5 3. + <_> + + <_> + 11 10 7 4 -1. + <_> + 11 12 7 2 2. + <_> + + <_> + 2 5 8 15 -1. + <_> + 2 10 8 5 3. + <_> + + <_> + 10 11 5 6 -1. + <_> + 10 14 5 3 2. + <_> + + <_> + 5 11 5 6 -1. + <_> + 5 14 5 3 2. + <_> + + <_> + 4 8 13 2 -1. + <_> + 4 9 13 1 2. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 0 1 14 12 -1. + <_> + 0 1 7 6 2. + <_> + 7 7 7 6 2. + <_> + + <_> + 10 10 10 9 -1. + <_> + 10 13 10 3 3. + <_> + + <_> + 0 10 10 9 -1. + <_> + 0 13 10 3 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 8 5 4 10 -1. + <_> + 10 5 2 10 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 7 1 4 14 -1. + <_> + 9 1 2 14 2. + <_> + + <_> + 13 12 7 6 -1. + <_> + 13 14 7 2 3. + <_> + + <_> + 0 12 7 6 -1. + <_> + 0 14 7 2 3. + <_> + + <_> + 3 8 15 3 -1. + <_> + 8 8 5 3 3. + <_> + + <_> + 6 15 8 4 -1. + <_> + 6 17 8 2 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 15 0 4 11 -1. + <_> + 15 0 2 11 2. + <_> + + <_> + 7 0 4 18 -1. + <_> + 7 0 2 9 2. + <_> + 9 9 2 9 2. + <_> + + <_> + 12 2 8 18 -1. + <_> + 16 2 4 9 2. + <_> + 12 11 4 9 2. + <_> + + <_> + 4 2 12 18 -1. + <_> + 4 2 6 9 2. + <_> + 10 11 6 9 2. + <_> + + <_> + 4 6 12 6 -1. + <_> + 4 9 12 3 2. + <_> + + <_> + 0 9 18 4 -1. + <_> + 0 9 9 2 2. + <_> + 9 11 9 2 2. + <_> + + <_> + 2 0 18 4 -1. + <_> + 11 0 9 2 2. + <_> + 2 2 9 2 2. + <_> + + <_> + 1 0 4 11 -1. + <_> + 3 0 2 11 2. + <_> + + <_> + 16 0 4 15 -1. + <_> + 16 0 2 15 2. + <_> + + <_> + 0 2 6 11 -1. + <_> + 3 2 3 11 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 2 17 15 3 -1. + <_> + 7 17 5 3 3. + <_> + + <_> + 5 4 10 4 -1. + <_> + 5 6 10 2 2. + <_> + + <_> + 3 9 14 8 -1. + <_> + 3 13 14 4 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 3 7 14 6 -1. + <_> + 3 9 14 2 3. + <_> + + <_> + 3 10 6 8 -1. + <_> + 5 10 2 8 3. + <_> + + <_> + 0 5 20 8 -1. + <_> + 10 5 10 4 2. + <_> + 0 9 10 4 2. + <_> + + <_> + 0 5 16 8 -1. + <_> + 0 9 16 4 2. + <_> + + <_> + 9 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 2 6 15 5 -1. + <_> + 7 6 5 5 3. + <_> + + <_> + 9 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 5 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 6 8 8 12 -1. + <_> + 10 8 4 6 2. + <_> + 6 14 4 6 2. + <_> + + <_> + 1 1 7 4 -1. + <_> + 1 3 7 2 2. + <_> + + <_> + 0 0 20 8 -1. + <_> + 10 0 10 4 2. + <_> + 0 4 10 4 2. + <_> + + <_> + 5 3 5 9 -1. + <_> + 5 6 5 3 3. + <_> + + <_> + 11 3 8 4 -1. + <_> + 11 3 4 4 2. + <_> + + <_> + 1 10 7 4 -1. + <_> + 1 12 7 2 2. + <_> + + <_> + 5 10 12 6 -1. + <_> + 11 10 6 3 2. + <_> + 5 13 6 3 2. + <_> + + <_> + 1 3 8 4 -1. + <_> + 5 3 4 4 2. + <_> + + <_> + 6 0 9 5 -1. + <_> + 9 0 3 5 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 9 4 2 14 -1. + <_> + 9 11 2 7 2. + <_> + + <_> + 8 1 12 19 -1. + <_> + 8 1 6 19 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 7 6 6 10 -1. + <_> + 9 6 2 10 3. + <_> + + <_> + 0 3 10 6 -1. + <_> + 0 3 5 3 2. + <_> + 5 6 5 3 2. + <_> + + <_> + 6 5 8 8 -1. + <_> + 6 9 8 4 2. + <_> + + <_> + 7 13 5 6 -1. + <_> + 7 16 5 3 2. + <_> + + <_> + 11 10 4 8 -1. + <_> + 11 14 4 4 2. + <_> + + <_> + 4 6 8 8 -1. + <_> + 4 6 4 4 2. + <_> + 8 10 4 4 2. + <_> + + <_> + 2 5 16 6 -1. + <_> + 2 7 16 2 3. + <_> + + <_> + 5 7 10 12 -1. + <_> + 5 7 5 6 2. + <_> + 10 13 5 6 2. + <_> + + <_> + 6 11 13 3 -1. + <_> + 6 12 13 1 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 12 11 7 6 -1. + <_> + 12 14 7 3 2. + <_> + + <_> + 0 4 7 6 -1. + <_> + 0 6 7 2 3. + <_> + + <_> + 3 10 16 6 -1. + <_> + 11 10 8 3 2. + <_> + 3 13 8 3 2. + <_> + + <_> + 0 8 6 12 -1. + <_> + 3 8 3 12 2. + <_> + + <_> + 0 5 20 15 -1. + <_> + 0 10 20 5 3. + <_> + + <_> + 1 11 16 4 -1. + <_> + 1 11 8 2 2. + <_> + 9 13 8 2 2. + <_> + + <_> + 9 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 3 6 5 9 -1. + <_> + 3 9 5 3 3. + <_> + + <_> + 10 10 6 5 -1. + <_> + 10 10 3 5 2. + <_> + + <_> + 4 10 6 5 -1. + <_> + 7 10 3 5 2. + <_> + + <_> + 13 4 6 9 -1. + <_> + 15 4 2 9 3. + <_> + + <_> + 1 4 6 7 -1. + <_> + 3 4 2 7 3. + <_> + + <_> + 16 0 4 8 -1. + <_> + 16 0 2 8 2. + <_> + + <_> + 2 5 12 12 -1. + <_> + 2 11 12 6 2. + <_> + + <_> + 3 1 14 6 -1. + <_> + 3 3 14 2 3. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 10 2 10 18 -1. + <_> + 10 2 5 18 2. + <_> + + <_> + 0 3 10 17 -1. + <_> + 5 3 5 17 2. + <_> + + <_> + 16 0 4 8 -1. + <_> + 16 0 2 8 2. + <_> + + <_> + 0 0 4 8 -1. + <_> + 2 0 2 8 2. + <_> + + <_> + 10 10 10 6 -1. + <_> + 10 12 10 2 3. + <_> + + <_> + 5 11 5 9 -1. + <_> + 5 14 5 3 3. + <_> + + <_> + 5 18 13 2 -1. + <_> + 5 19 13 1 2. + <_> + + <_> + 5 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 5 6 14 2 -1. + <_> + 5 6 7 2 2. + <_> + + <_> + 1 6 14 2 -1. + <_> + 8 6 7 2 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 10 10 4 4 2. + <_> + 6 14 4 4 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 10 5 2 7 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 9 6 4 14 -1. + <_> + 9 13 4 7 2. + <_> + + <_> + 3 7 12 5 -1. + <_> + 7 7 4 5 3. + <_> + + <_> + 3 13 14 3 -1. + <_> + 3 14 14 1 3. + <_> + + <_> + 1 0 16 4 -1. + <_> + 1 2 16 2 2. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 0 1 6 8 -1. + <_> + 3 1 3 8 2. + <_> + + <_> + 14 0 6 9 -1. + <_> + 14 0 3 9 2. + <_> + + <_> + 0 0 6 9 -1. + <_> + 3 0 3 9 2. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 4 7 12 4 -1. + <_> + 4 9 12 2 2. + <_> + + <_> + 1 9 9 8 -1. + <_> + 4 9 3 8 3. + <_> + + <_> + 2 0 16 2 -1. + <_> + 2 1 16 1 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 12 10 5 6 -1. + <_> + 12 13 5 3 2. + <_> + + <_> + 1 16 10 3 -1. + <_> + 6 16 5 3 2. + <_> + + <_> + 9 5 3 12 -1. + <_> + 9 11 3 6 2. + <_> + + <_> + 3 4 14 12 -1. + <_> + 3 4 7 6 2. + <_> + 10 10 7 6 2. + <_> + + <_> + 6 6 9 8 -1. + <_> + 6 10 9 4 2. + <_> + + <_> + 0 7 7 4 -1. + <_> + 0 9 7 2 2. + <_> + + <_> + 16 3 4 8 -1. + <_> + 16 3 2 8 2. + <_> + + <_> + 0 3 6 10 -1. + <_> + 3 3 3 10 2. + <_> + + <_> + 5 4 10 6 -1. + <_> + 5 6 10 2 3. + <_> + + <_> + 4 5 12 4 -1. + <_> + 8 5 4 4 3. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 11 2 6 10 -1. + <_> + 14 2 3 5 2. + <_> + 11 7 3 5 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 3 14 15 6 -1. + <_> + 3 17 15 3 2. + <_> + + <_> + 0 11 7 4 -1. + <_> + 0 13 7 2 2. + <_> + + <_> + 5 9 12 6 -1. + <_> + 11 9 6 3 2. + <_> + 5 12 6 3 2. + <_> + + <_> + 2 10 14 4 -1. + <_> + 2 10 7 2 2. + <_> + 9 12 7 2 2. + <_> + + <_> + 1 0 19 9 -1. + <_> + 1 3 19 3 3. + <_> + + <_> + 1 11 16 3 -1. + <_> + 1 12 16 1 3. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 3 6 15 5 -1. + <_> + 8 6 5 5 3. + <_> + + <_> + 4 2 6 7 -1. + <_> + 6 2 2 7 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 2 11 7 6 -1. + <_> + 2 14 7 3 2. + <_> + + <_> + 12 11 5 6 -1. + <_> + 12 14 5 3 2. + <_> + + <_> + 4 5 3 15 -1. + <_> + 4 10 3 5 3. + <_> + + <_> + 11 2 6 10 -1. + <_> + 14 2 3 5 2. + <_> + 11 7 3 5 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 7 10 10 9 -1. + <_> + 7 13 10 3 3. + <_> + + <_> + 2 6 16 10 -1. + <_> + 2 6 8 5 2. + <_> + 10 11 8 5 2. + <_> + + <_> + 0 9 20 4 -1. + <_> + 10 9 10 2 2. + <_> + 0 11 10 2 2. + <_> + + <_> + 4 6 4 7 -1. + <_> + 6 6 2 7 2. + <_> + + <_> + 18 0 2 20 -1. + <_> + 18 0 1 20 2. + <_> + + <_> + 3 1 13 2 -1. + <_> + 3 2 13 1 2. + <_> + + <_> + 17 0 3 18 -1. + <_> + 18 0 1 18 3. + <_> + + <_> + 1 7 15 5 -1. + <_> + 6 7 5 5 3. + <_> + + <_> + 9 3 2 15 -1. + <_> + 9 3 1 15 2. + <_> + + <_> + 5 3 10 6 -1. + <_> + 5 6 10 3 2. + <_> + + <_> + 10 9 4 8 -1. + <_> + 10 13 4 4 2. + <_> + + <_> + 7 8 4 12 -1. + <_> + 7 12 4 4 3. + <_> + + <_> + 5 5 15 10 -1. + <_> + 5 10 15 5 2. + <_> + + <_> + 4 7 7 4 -1. + <_> + 4 9 7 2 2. + <_> + + <_> + 4 5 12 4 -1. + <_> + 8 5 4 4 3. + <_> + + <_> + 1 1 7 4 -1. + <_> + 1 3 7 2 2. + <_> + + <_> + 11 9 4 8 -1. + <_> + 11 13 4 4 2. + <_> + + <_> + 4 6 12 12 -1. + <_> + 4 6 6 6 2. + <_> + 10 12 6 6 2. + <_> + + <_> + 11 1 6 10 -1. + <_> + 14 1 3 5 2. + <_> + 11 6 3 5 2. + <_> + + <_> + 1 5 16 12 -1. + <_> + 1 5 8 6 2. + <_> + 9 11 8 6 2. + <_> + + <_> + 4 7 12 6 -1. + <_> + 4 9 12 2 3. + <_> + + <_> + 6 0 6 10 -1. + <_> + 6 0 3 5 2. + <_> + 9 5 3 5 2. + <_> + + <_> + 7 1 12 8 -1. + <_> + 13 1 6 4 2. + <_> + 7 5 6 4 2. + <_> + + <_> + 0 1 4 18 -1. + <_> + 2 1 2 18 2. + <_> + + <_> + 15 9 5 9 -1. + <_> + 15 12 5 3 3. + <_> + + <_> + 0 12 20 6 -1. + <_> + 0 12 10 3 2. + <_> + 10 15 10 3 2. + <_> + + <_> + 10 4 4 15 -1. + <_> + 10 9 4 5 3. + <_> + + <_> + 1 1 12 8 -1. + <_> + 1 1 6 4 2. + <_> + 7 5 6 4 2. + <_> + + <_> + 11 11 5 6 -1. + <_> + 11 14 5 3 2. + <_> + + <_> + 4 11 5 6 -1. + <_> + 4 14 5 3 2. + <_> + + <_> + 4 14 13 6 -1. + <_> + 4 16 13 2 3. + <_> + + <_> + 0 0 6 9 -1. + <_> + 2 0 2 9 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 5 5 10 6 -1. + <_> + 5 7 10 2 3. + <_> + + <_> + 2 0 16 2 -1. + <_> + 2 1 16 1 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 1 2 18 10 -1. + <_> + 10 2 9 5 2. + <_> + 1 7 9 5 2. + <_> + + <_> + 5 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 5 4 10 14 -1. + <_> + 10 4 5 7 2. + <_> + 5 11 5 7 2. + <_> + + <_> + 0 11 5 6 -1. + <_> + 0 14 5 3 2. + <_> + + <_> + 7 11 13 3 -1. + <_> + 7 12 13 1 3. + <_> + + <_> + 0 11 8 4 -1. + <_> + 0 13 8 2 2. + <_> + + <_> + 5 6 14 8 -1. + <_> + 5 10 14 4 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 1 13 18 3 -1. + <_> + 1 14 18 1 3. + <_> + + <_> + 3 15 14 4 -1. + <_> + 10 15 7 2 2. + <_> + 3 17 7 2 2. + <_> + + <_> + 0 2 2 13 -1. + <_> + 1 2 1 13 2. + <_> + + <_> + 4 9 12 8 -1. + <_> + 8 9 4 8 3. + <_> + + <_> + 4 9 6 5 -1. + <_> + 7 9 3 5 2. + <_> + + <_> + 16 0 4 20 -1. + <_> + 16 0 2 20 2. + <_> + + <_> + 0 0 4 20 -1. + <_> + 2 0 2 20 2. + <_> + + <_> + 16 1 4 19 -1. + <_> + 16 1 2 19 2. + <_> + + <_> + 1 0 16 4 -1. + <_> + 1 0 8 2 2. + <_> + 9 2 8 2 2. + <_> + + <_> + 12 6 4 14 -1. + <_> + 14 6 2 7 2. + <_> + 12 13 2 7 2. + <_> + + <_> + 2 8 15 3 -1. + <_> + 2 9 15 1 3. + <_> + + <_> + 7 6 8 10 -1. + <_> + 11 6 4 5 2. + <_> + 7 11 4 5 2. + <_> + + <_> + 0 0 4 20 -1. + <_> + 2 0 2 20 2. + <_> + + <_> + 5 5 10 3 -1. + <_> + 5 5 5 3 2. + <_> + + <_> + 1 17 14 3 -1. + <_> + 1 18 14 1 3. + <_> + + <_> + 15 6 5 9 -1. + <_> + 15 9 5 3 3. + <_> + + <_> + 7 6 4 10 -1. + <_> + 9 6 2 10 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 5 4 8 14 -1. + <_> + 5 4 4 7 2. + <_> + 9 11 4 7 2. + <_> + + <_> + 4 6 12 8 -1. + <_> + 10 6 6 4 2. + <_> + 4 10 6 4 2. + <_> + + <_> + 3 2 13 6 -1. + <_> + 3 4 13 2 3. + <_> + + <_> + 10 4 7 10 -1. + <_> + 10 9 7 5 2. + <_> + + <_> + 3 4 14 10 -1. + <_> + 3 4 7 5 2. + <_> + 10 9 7 5 2. + <_> + + <_> + 16 4 3 13 -1. + <_> + 17 4 1 13 3. + <_> + + <_> + 1 4 3 13 -1. + <_> + 2 4 1 13 3. + <_> + + <_> + 11 10 8 6 -1. + <_> + 11 12 8 2 3. + <_> + + <_> + 0 10 9 4 -1. + <_> + 0 12 9 2 2. + <_> + + <_> + 7 8 12 8 -1. + <_> + 13 8 6 4 2. + <_> + 7 12 6 4 2. + <_> + + <_> + 1 8 12 8 -1. + <_> + 1 8 6 4 2. + <_> + 7 12 6 4 2. + <_> + + <_> + 1 0 18 10 -1. + <_> + 7 0 6 10 3. + <_> + + <_> + 0 2 12 12 -1. + <_> + 4 2 4 12 3. + <_> + + <_> + 8 11 12 9 -1. + <_> + 12 11 4 9 3. + <_> + + <_> + 5 10 4 9 -1. + <_> + 7 10 2 9 2. + <_> + + <_> + 10 2 3 10 -1. + <_> + 10 7 3 5 2. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 9 12 8 8 -1. + <_> + 13 12 4 4 2. + <_> + 9 16 4 4 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 10 2 9 15 -1. + <_> + 13 2 3 15 3. + <_> + + <_> + 1 1 9 15 -1. + <_> + 4 1 3 15 3. + <_> + + <_> + 5 4 10 6 -1. + <_> + 5 6 10 2 3. + <_> + + <_> + 5 6 5 8 -1. + <_> + 5 10 5 4 2. + <_> + + <_> + 4 6 12 4 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 3 9 5 8 -1. + <_> + 3 13 5 4 2. + <_> + + <_> + 11 1 6 12 -1. + <_> + 14 1 3 6 2. + <_> + 11 7 3 6 2. + <_> + + <_> + 3 12 8 8 -1. + <_> + 3 12 4 4 2. + <_> + 7 16 4 4 2. + <_> + + <_> + 15 0 3 15 -1. + <_> + 15 5 3 5 3. + <_> + + <_> + 2 5 14 8 -1. + <_> + 2 5 7 4 2. + <_> + 9 9 7 4 2. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 3 1 6 10 -1. + <_> + 3 1 3 5 2. + <_> + 6 6 3 5 2. + <_> + + <_> + 4 8 13 2 -1. + <_> + 4 9 13 1 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 1 2 19 2 -1. + <_> + 1 3 19 1 2. + <_> + + <_> + 1 14 7 6 -1. + <_> + 1 16 7 2 3. + <_> + + <_> + 5 13 13 3 -1. + <_> + 5 14 13 1 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 7 0 13 2 -1. + <_> + 7 1 13 1 2. + <_> + + <_> + 6 6 8 12 -1. + <_> + 6 10 8 4 3. + <_> + + <_> + 7 1 8 8 -1. + <_> + 11 1 4 4 2. + <_> + 7 5 4 4 2. + <_> + + <_> + 5 1 8 8 -1. + <_> + 5 1 4 4 2. + <_> + 9 5 4 4 2. + <_> + + <_> + 10 10 8 6 -1. + <_> + 10 12 8 2 3. + <_> + + <_> + 8 2 3 12 -1. + <_> + 8 8 3 6 2. + <_> + + <_> + 12 5 7 8 -1. + <_> + 12 9 7 4 2. + <_> + + <_> + 1 2 6 14 -1. + <_> + 3 2 2 14 3. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 1 5 7 8 -1. + <_> + 1 9 7 4 2. + <_> + + <_> + 8 4 4 16 -1. + <_> + 8 12 4 8 2. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 11 10 7 6 -1. + <_> + 11 12 7 2 3. + <_> + + <_> + 2 10 7 6 -1. + <_> + 2 12 7 2 3. + <_> + + <_> + 5 12 13 3 -1. + <_> + 5 13 13 1 3. + <_> + + <_> + 1 15 7 4 -1. + <_> + 1 17 7 2 2. + <_> + + <_> + 2 2 17 6 -1. + <_> + 2 4 17 2 3. + <_> + + <_> + 1 15 8 4 -1. + <_> + 5 15 4 4 2. + <_> + + <_> + 10 1 4 8 -1. + <_> + 10 1 2 8 2. + <_> + + <_> + 6 1 4 8 -1. + <_> + 8 1 2 8 2. + <_> + + <_> + 10 3 3 14 -1. + <_> + 11 3 1 14 3. + <_> + + <_> + 0 11 18 4 -1. + <_> + 0 11 9 2 2. + <_> + 9 13 9 2 2. + <_> + + <_> + 11 11 7 4 -1. + <_> + 11 13 7 2 2. + <_> + + <_> + 2 7 12 12 -1. + <_> + 2 7 6 6 2. + <_> + 8 13 6 6 2. + <_> + + <_> + 4 11 13 2 -1. + <_> + 4 12 13 1 2. + <_> + + <_> + 0 4 15 12 -1. + <_> + 0 10 15 6 2. + <_> + + <_> + 5 2 11 8 -1. + <_> + 5 6 11 4 2. + <_> + + <_> + 2 8 13 3 -1. + <_> + 2 9 13 1 3. + <_> + + <_> + 15 3 5 9 -1. + <_> + 15 6 5 3 3. + <_> + + <_> + 7 3 3 13 -1. + <_> + 8 3 1 13 3. + <_> + + <_> + 1 9 18 3 -1. + <_> + 7 9 6 3 3. + <_> + + <_> + 8 1 3 13 -1. + <_> + 9 1 1 13 3. + <_> + + <_> + 9 3 2 13 -1. + <_> + 9 3 1 13 2. + <_> + + <_> + 1 2 8 8 -1. + <_> + 1 2 4 4 2. + <_> + 5 6 4 4 2. + <_> + + <_> + 9 5 3 12 -1. + <_> + 9 11 3 6 2. + <_> + + <_> + 5 4 9 5 -1. + <_> + 8 4 3 5 3. + <_> + + <_> + 0 3 20 16 -1. + <_> + 0 11 20 8 2. + <_> + + <_> + 0 4 16 6 -1. + <_> + 0 6 16 2 3. + <_> + + <_> + 9 6 5 12 -1. + <_> + 9 12 5 6 2. + <_> + + <_> + 5 6 10 8 -1. + <_> + 5 10 10 4 2. + <_> + + <_> + 2 8 16 3 -1. + <_> + 2 9 16 1 3. + <_> + + <_> + 2 9 16 3 -1. + <_> + 2 10 16 1 3. + <_> + + <_> + 7 15 7 4 -1. + <_> + 7 17 7 2 2. + <_> + + <_> + 6 1 7 6 -1. + <_> + 6 3 7 2 3. + <_> + + <_> + 3 10 14 3 -1. + <_> + 3 11 14 1 3. + <_> + + <_> + 1 4 6 16 -1. + <_> + 1 4 3 8 2. + <_> + 4 12 3 8 2. + <_> + + <_> + 1 14 19 6 -1. + <_> + 1 16 19 2 3. + <_> + + <_> + 5 9 4 8 -1. + <_> + 7 9 2 8 2. + <_> + + <_> + 5 7 12 4 -1. + <_> + 9 7 4 4 3. + <_> + + <_> + 3 6 12 4 -1. + <_> + 7 6 4 4 3. + <_> + + <_> + 6 5 8 6 -1. + <_> + 6 7 8 2 3. + <_> + + <_> + 4 0 6 10 -1. + <_> + 6 0 2 10 3. + <_> + + <_> + 11 9 4 8 -1. + <_> + 11 13 4 4 2. + <_> + + <_> + 5 9 4 8 -1. + <_> + 5 13 4 4 2. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 4 0 13 2 -1. + <_> + 4 1 13 1 2. + <_> + + <_> + 0 0 4 7 -1. + <_> + 2 0 2 7 2. + <_> + + <_> + 14 3 6 7 -1. + <_> + 16 3 2 7 3. + <_> + + <_> + 5 4 5 10 -1. + <_> + 5 9 5 5 2. + <_> + + <_> + 8 1 5 10 -1. + <_> + 8 6 5 5 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 14 3 6 9 -1. + <_> + 16 3 2 9 3. + <_> + + <_> + 0 3 6 9 -1. + <_> + 2 3 2 9 3. + <_> + + <_> + 1 1 19 3 -1. + <_> + 1 2 19 1 3. + <_> + + <_> + 6 6 4 14 -1. + <_> + 8 6 2 14 2. + <_> + + <_> + 8 5 6 8 -1. + <_> + 10 5 2 8 3. + <_> + + <_> + 4 10 12 4 -1. + <_> + 8 10 4 4 3. + <_> + + <_> + 0 6 20 2 -1. + <_> + 0 6 10 2 2. + <_> + + <_> + 6 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 13 2 6 11 -1. + <_> + 13 2 3 11 2. + <_> + + <_> + 0 6 5 9 -1. + <_> + 0 9 5 3 3. + <_> + + <_> + 13 2 6 8 -1. + <_> + 13 2 3 8 2. + <_> + + <_> + 1 2 6 8 -1. + <_> + 4 2 3 8 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 7 11 13 3 -1. + <_> + 7 12 13 1 3. + <_> + + <_> + 0 2 20 6 -1. + <_> + 0 2 10 3 2. + <_> + 10 5 10 3 2. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 5 0 3 13 -1. + <_> + 6 0 1 13 3. + <_> + + <_> + 0 1 20 10 -1. + <_> + 0 6 20 5 2. + <_> + + <_> + 7 1 3 13 -1. + <_> + 8 1 1 13 3. + <_> + + <_> + 11 0 2 16 -1. + <_> + 11 0 1 16 2. + <_> + + <_> + 0 0 2 13 -1. + <_> + 1 0 1 13 2. + <_> + + <_> + 0 13 20 6 -1. + <_> + 10 13 10 3 2. + <_> + 0 16 10 3 2. + <_> + + <_> + 0 7 4 13 -1. + <_> + 2 7 2 13 2. + <_> + + <_> + 5 10 15 10 -1. + <_> + 5 15 15 5 2. + <_> + + <_> + 0 10 15 10 -1. + <_> + 0 15 15 5 2. + <_> + + <_> + 2 17 18 3 -1. + <_> + 8 17 6 3 3. + <_> + + <_> + 7 0 2 16 -1. + <_> + 8 0 1 16 2. + <_> + + <_> + 6 14 9 4 -1. + <_> + 6 16 9 2 2. + <_> + + <_> + 1 3 15 2 -1. + <_> + 1 4 15 1 2. + <_> + + <_> + 6 5 13 8 -1. + <_> + 6 9 13 4 2. + <_> + + <_> + 4 0 11 6 -1. + <_> + 4 2 11 2 3. + <_> + + <_> + 1 9 18 4 -1. + <_> + 10 9 9 2 2. + <_> + 1 11 9 2 2. + <_> + + <_> + 3 9 6 8 -1. + <_> + 6 9 3 8 2. + <_> + + <_> + 5 8 12 4 -1. + <_> + 9 8 4 4 3. + <_> + + <_> + 3 8 12 4 -1. + <_> + 7 8 4 4 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 5 7 8 8 -1. + <_> + 5 7 4 4 2. + <_> + 9 11 4 4 2. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 4 6 12 3 -1. + <_> + 10 6 6 3 2. + <_> + + <_> + 0 0 20 4 -1. + <_> + 10 0 10 2 2. + <_> + 0 2 10 2 2. + <_> + + <_> + 3 6 13 3 -1. + <_> + 3 7 13 1 3. + <_> + + <_> + 11 2 4 7 -1. + <_> + 11 2 2 7 2. + <_> + + <_> + 5 2 4 7 -1. + <_> + 7 2 2 7 2. + <_> + + <_> + 1 16 18 2 -1. + <_> + 1 17 18 1 2. + <_> + + <_> + 0 13 14 3 -1. + <_> + 0 14 14 1 3. + <_> + + <_> + 13 0 3 13 -1. + <_> + 14 0 1 13 3. + <_> + + <_> + 3 14 13 3 -1. + <_> + 3 15 13 1 3. + <_> + + <_> + 11 12 7 6 -1. + <_> + 11 14 7 2 3. + <_> + + <_> + 2 12 7 6 -1. + <_> + 2 14 7 2 3. + <_> + + <_> + 2 10 18 10 -1. + <_> + 8 10 6 10 3. + <_> + + <_> + 0 12 13 2 -1. + <_> + 0 13 13 1 2. + <_> + + <_> + 5 7 14 4 -1. + <_> + 12 7 7 2 2. + <_> + 5 9 7 2 2. + <_> + + <_> + 1 7 14 4 -1. + <_> + 1 7 7 2 2. + <_> + 8 9 7 2 2. + <_> + + <_> + 2 17 18 3 -1. + <_> + 8 17 6 3 3. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 9 7 9 9 -1. + <_> + 12 7 3 9 3. + <_> + + <_> + 0 8 15 2 -1. + <_> + 0 9 15 1 2. + <_> + + <_> + 15 4 5 6 -1. + <_> + 15 7 5 3 2. + <_> + + <_> + 4 0 9 18 -1. + <_> + 4 9 9 9 2. + <_> + + <_> + 14 15 6 5 -1. + <_> + 14 15 3 5 2. + <_> + + <_> + 0 4 5 6 -1. + <_> + 0 7 5 3 2. + <_> + + <_> + 9 1 5 10 -1. + <_> + 9 6 5 5 2. + <_> + + <_> + 0 11 6 8 -1. + <_> + 3 11 3 8 2. + <_> + + <_> + 9 7 6 10 -1. + <_> + 12 7 3 5 2. + <_> + 9 12 3 5 2. + <_> + + <_> + 1 5 9 10 -1. + <_> + 4 5 3 10 3. + <_> + + <_> + 6 2 9 16 -1. + <_> + 9 2 3 16 3. + <_> + + <_> + 5 2 9 16 -1. + <_> + 8 2 3 16 3. + <_> + + <_> + 5 10 10 10 -1. + <_> + 5 15 10 5 2. + <_> + + <_> + 5 4 6 10 -1. + <_> + 5 4 3 5 2. + <_> + 8 9 3 5 2. + <_> + + <_> + 11 2 8 8 -1. + <_> + 15 2 4 4 2. + <_> + 11 6 4 4 2. + <_> + + <_> + 0 2 6 10 -1. + <_> + 3 2 3 10 2. + <_> + + <_> + 4 10 13 8 -1. + <_> + 4 14 13 4 2. + <_> + + <_> + 5 6 8 4 -1. + <_> + 9 6 4 4 2. + <_> + + <_> + 1 17 18 3 -1. + <_> + 7 17 6 3 3. + <_> + + <_> + 1 2 8 8 -1. + <_> + 1 2 4 4 2. + <_> + 5 6 4 4 2. + <_> + + <_> + 4 7 12 6 -1. + <_> + 4 9 12 2 3. + <_> + + <_> + 4 5 12 10 -1. + <_> + 4 5 6 5 2. + <_> + 10 10 6 5 2. + <_> + + <_> + 8 12 8 8 -1. + <_> + 12 12 4 4 2. + <_> + 8 16 4 4 2. + <_> + + <_> + 3 14 5 6 -1. + <_> + 3 17 5 3 2. + <_> + + <_> + 7 4 6 8 -1. + <_> + 9 4 2 8 3. + <_> + + <_> + 4 0 6 8 -1. + <_> + 6 0 2 8 3. + <_> + + <_> + 7 0 13 3 -1. + <_> + 7 1 13 1 3. + <_> + + <_> + 3 1 14 2 -1. + <_> + 3 2 14 1 2. + <_> + + <_> + 12 10 5 6 -1. + <_> + 12 13 5 3 2. + <_> + + <_> + 0 5 20 6 -1. + <_> + 0 7 20 2 3. + <_> + + <_> + 13 1 3 18 -1. + <_> + 14 1 1 18 3. + <_> + + <_> + 4 1 3 15 -1. + <_> + 5 1 1 15 3. + <_> + + <_> + 6 14 13 3 -1. + <_> + 6 15 13 1 3. + <_> + + <_> + 0 12 20 4 -1. + <_> + 0 14 20 2 2. + <_> + + <_> + 12 11 7 4 -1. + <_> + 12 13 7 2 2. + <_> + + <_> + 1 11 7 4 -1. + <_> + 1 13 7 2 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 7 20 2 -1. + <_> + 0 8 20 1 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 5 5 10 8 -1. + <_> + 5 9 10 4 2. + <_> + + <_> + 7 1 3 10 -1. + <_> + 7 6 3 5 2. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 4 9 12 11 -1. + <_> + 8 9 4 11 3. + <_> + + <_> + 1 0 18 20 -1. + <_> + 7 0 6 20 3. + <_> + + <_> + 7 15 7 4 -1. + <_> + 7 17 7 2 2. + <_> + + <_> + 2 15 16 4 -1. + <_> + 2 17 16 2 2. + <_> + + <_> + 5 18 13 2 -1. + <_> + 5 19 13 1 2. + <_> + + <_> + 3 0 6 8 -1. + <_> + 5 0 2 8 3. + <_> + + <_> + 12 0 2 15 -1. + <_> + 12 0 1 15 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 10 14 9 6 -1. + <_> + 10 16 9 2 3. + <_> + + <_> + 1 14 9 6 -1. + <_> + 1 16 9 2 3. + <_> + + <_> + 5 13 13 3 -1. + <_> + 5 14 13 1 3. + <_> + + <_> + 3 2 13 2 -1. + <_> + 3 3 13 1 2. + <_> + + <_> + 4 6 16 3 -1. + <_> + 4 6 8 3 2. + <_> + + <_> + 0 10 17 2 -1. + <_> + 0 11 17 1 2. + <_> + + <_> + 11 6 6 12 -1. + <_> + 11 12 6 6 2. + <_> + + <_> + 0 10 16 4 -1. + <_> + 0 10 8 2 2. + <_> + 8 12 8 2 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 3 14 14 4 -1. + <_> + 3 14 7 2 2. + <_> + 10 16 7 2 2. + <_> + + <_> + 6 6 14 3 -1. + <_> + 6 6 7 3 2. + <_> + + <_> + 0 6 14 3 -1. + <_> + 7 6 7 3 2. + <_> + + <_> + 5 8 10 8 -1. + <_> + 10 8 5 4 2. + <_> + 5 12 5 4 2. + <_> + + <_> + 1 2 18 7 -1. + <_> + 7 2 6 7 3. + <_> + + <_> + 12 6 5 6 -1. + <_> + 12 9 5 3 2. + <_> + + <_> + 1 10 4 7 -1. + <_> + 3 10 2 7 2. + <_> + + <_> + 4 0 14 2 -1. + <_> + 4 1 14 1 2. + <_> + + <_> + 0 6 7 9 -1. + <_> + 0 9 7 3 3. + <_> + + <_> + 9 6 3 14 -1. + <_> + 10 6 1 14 3. + <_> + + <_> + 3 4 13 3 -1. + <_> + 3 5 13 1 3. + <_> + + <_> + 13 2 7 6 -1. + <_> + 13 4 7 2 3. + <_> + + <_> + 0 1 18 5 -1. + <_> + 6 1 6 5 3. + <_> + + <_> + 12 10 6 10 -1. + <_> + 15 10 3 5 2. + <_> + 12 15 3 5 2. + <_> + + <_> + 2 10 6 10 -1. + <_> + 2 10 3 5 2. + <_> + 5 15 3 5 2. + <_> + + <_> + 4 3 12 6 -1. + <_> + 4 5 12 2 3. + <_> + + <_> + 0 2 18 4 -1. + <_> + 0 2 9 2 2. + <_> + 9 4 9 2 2. + <_> + + <_> + 7 6 6 10 -1. + <_> + 9 6 2 10 3. + <_> + + <_> + 3 0 6 5 -1. + <_> + 6 0 3 5 2. + <_> + + <_> + 10 10 6 10 -1. + <_> + 13 10 3 5 2. + <_> + 10 15 3 5 2. + <_> + + <_> + 4 10 6 10 -1. + <_> + 4 10 3 5 2. + <_> + 7 15 3 5 2. + <_> + + <_> + 6 0 8 10 -1. + <_> + 10 0 4 5 2. + <_> + 6 5 4 5 2. + <_> + + <_> + 1 0 6 10 -1. + <_> + 1 0 3 5 2. + <_> + 4 5 3 5 2. + <_> + + <_> + 9 3 2 14 -1. + <_> + 9 10 2 7 2. + <_> + + <_> + 12 1 6 10 -1. + <_> + 15 1 3 5 2. + <_> + 12 6 3 5 2. + <_> + + <_> + 4 6 12 4 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 11 1 9 18 -1. + <_> + 11 10 9 9 2. + <_> + + <_> + 2 1 6 10 -1. + <_> + 2 1 3 5 2. + <_> + 5 6 3 5 2. + <_> + + <_> + 4 10 16 4 -1. + <_> + 12 10 8 2 2. + <_> + 4 12 8 2 2. + <_> + + <_> + 0 10 18 4 -1. + <_> + 0 10 9 2 2. + <_> + 9 12 9 2 2. + <_> + + <_> + 12 5 4 8 -1. + <_> + 12 9 4 4 2. + <_> + + <_> + 0 4 18 10 -1. + <_> + 0 4 9 5 2. + <_> + 9 9 9 5 2. + <_> + + <_> + 2 11 18 2 -1. + <_> + 2 12 18 1 2. + <_> + + <_> + 4 0 5 9 -1. + <_> + 4 3 5 3 3. + <_> + + <_> + 10 2 6 8 -1. + <_> + 12 2 2 8 3. + <_> + + <_> + 1 7 13 2 -1. + <_> + 1 8 13 1 2. + <_> + + <_> + 10 2 6 8 -1. + <_> + 12 2 2 8 3. + <_> + + <_> + 4 2 6 8 -1. + <_> + 6 2 2 8 3. + <_> + + <_> + 8 5 8 8 -1. + <_> + 12 5 4 4 2. + <_> + 8 9 4 4 2. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 13 0 6 10 -1. + <_> + 16 0 3 5 2. + <_> + 13 5 3 5 2. + <_> + + <_> + 3 9 13 3 -1. + <_> + 3 10 13 1 3. + <_> + + <_> + 5 11 11 6 -1. + <_> + 5 14 11 3 2. + <_> + + <_> + 1 14 7 6 -1. + <_> + 1 16 7 2 3. + <_> + + <_> + 13 5 4 8 -1. + <_> + 13 9 4 4 2. + <_> + + <_> + 3 5 4 8 -1. + <_> + 3 9 4 4 2. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 0 1 16 3 -1. + <_> + 0 2 16 1 3. + <_> + + <_> + 8 9 6 10 -1. + <_> + 8 14 6 5 2. + <_> + + <_> + 3 8 14 3 -1. + <_> + 3 9 14 1 3. + <_> + + <_> + 13 0 6 10 -1. + <_> + 16 0 3 5 2. + <_> + 13 5 3 5 2. + <_> + + <_> + 1 0 6 10 -1. + <_> + 1 0 3 5 2. + <_> + 4 5 3 5 2. + <_> + + <_> + 7 1 8 12 -1. + <_> + 7 7 8 6 2. + <_> + + <_> + 1 2 17 2 -1. + <_> + 1 3 17 1 2. + <_> + + <_> + 11 0 3 18 -1. + <_> + 12 0 1 18 3. + <_> + + <_> + 0 13 8 6 -1. + <_> + 0 15 8 2 3. + <_> + + <_> + 7 15 7 4 -1. + <_> + 7 17 7 2 2. + <_> + + <_> + 0 6 6 14 -1. + <_> + 0 6 3 7 2. + <_> + 3 13 3 7 2. + <_> + + <_> + 12 11 8 6 -1. + <_> + 12 13 8 2 3. + <_> + + <_> + 2 16 12 4 -1. + <_> + 6 16 4 4 3. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 5 6 4 8 -1. + <_> + 5 10 4 4 2. + <_> + + <_> + 3 11 16 4 -1. + <_> + 11 11 8 2 2. + <_> + 3 13 8 2 2. + <_> + + <_> + 1 11 16 4 -1. + <_> + 1 11 8 2 2. + <_> + 9 13 8 2 2. + <_> + + <_> + 16 3 4 8 -1. + <_> + 16 3 2 8 2. + <_> + + <_> + 6 0 3 18 -1. + <_> + 7 0 1 18 3. + <_> + + <_> + 16 3 4 8 -1. + <_> + 16 3 2 8 2. + <_> + + <_> + 4 12 12 4 -1. + <_> + 8 12 4 4 3. + <_> + + <_> + 4 0 16 3 -1. + <_> + 4 1 16 1 3. + <_> + + <_> + 0 3 4 8 -1. + <_> + 2 3 2 8 2. + <_> + + <_> + 16 0 4 7 -1. + <_> + 16 0 2 7 2. + <_> + + <_> + 0 0 4 7 -1. + <_> + 2 0 2 7 2. + <_> + + <_> + 9 6 6 12 -1. + <_> + 9 6 3 12 2. + <_> + + <_> + 0 10 10 6 -1. + <_> + 0 12 10 2 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 4 10 12 10 -1. + <_> + 4 15 12 5 2. + <_> + + <_> + 10 4 4 16 -1. + <_> + 10 4 2 16 2. + <_> + + <_> + 6 4 4 16 -1. + <_> + 8 4 2 16 2. + <_> + + <_> + 7 8 13 2 -1. + <_> + 7 9 13 1 2. + <_> + + <_> + 0 8 13 2 -1. + <_> + 0 9 13 1 2. + <_> + + <_> + 8 0 9 5 -1. + <_> + 11 0 3 5 3. + <_> + + <_> + 3 0 9 5 -1. + <_> + 6 0 3 5 3. + <_> + + <_> + 14 6 6 10 -1. + <_> + 14 6 3 10 2. + <_> + + <_> + 1 5 17 6 -1. + <_> + 1 7 17 2 3. + <_> + + <_> + 14 6 6 10 -1. + <_> + 14 6 3 10 2. + <_> + + <_> + 0 17 14 3 -1. + <_> + 0 18 14 1 3. + <_> + + <_> + 14 6 6 10 -1. + <_> + 14 6 3 10 2. + <_> + + <_> + 0 6 6 10 -1. + <_> + 3 6 3 10 2. + <_> + + <_> + 10 9 6 5 -1. + <_> + 10 9 3 5 2. + <_> + + <_> + 4 9 6 5 -1. + <_> + 7 9 3 5 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 2 7 6 13 -1. + <_> + 4 7 2 13 3. + <_> + + <_> + 13 3 3 15 -1. + <_> + 14 3 1 15 3. + <_> + + <_> + 4 3 3 15 -1. + <_> + 5 3 1 15 3. + <_> + + <_> + 3 2 15 5 -1. + <_> + 8 2 5 5 3. + <_> + + <_> + 5 4 9 14 -1. + <_> + 5 11 9 7 2. + <_> + + <_> + 9 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 4 6 10 12 -1. + <_> + 4 6 5 6 2. + <_> + 9 12 5 6 2. + <_> + + <_> + 5 5 12 10 -1. + <_> + 11 5 6 5 2. + <_> + 5 10 6 5 2. + <_> + + <_> + 3 5 12 10 -1. + <_> + 3 5 6 5 2. + <_> + 9 10 6 5 2. + <_> + + <_> + 12 0 8 12 -1. + <_> + 16 0 4 6 2. + <_> + 12 6 4 6 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 0 2 20 4 -1. + <_> + 10 2 10 2 2. + <_> + 0 4 10 2 2. + <_> + + <_> + 6 6 6 8 -1. + <_> + 8 6 2 8 3. + <_> + + <_> + 10 0 3 20 -1. + <_> + 11 0 1 20 3. + <_> + + <_> + 7 0 3 20 -1. + <_> + 8 0 1 20 3. + <_> + + <_> + 10 0 2 13 -1. + <_> + 10 0 1 13 2. + <_> + + <_> + 8 0 2 13 -1. + <_> + 9 0 1 13 2. + <_> + + <_> + 0 15 20 4 -1. + <_> + 10 15 10 2 2. + <_> + 0 17 10 2 2. + <_> + + <_> + 2 3 3 13 -1. + <_> + 3 3 1 13 3. + <_> + + <_> + 7 2 7 6 -1. + <_> + 7 4 7 2 3. + <_> + + <_> + 0 2 15 14 -1. + <_> + 0 9 15 7 2. + <_> + + <_> + 12 10 4 8 -1. + <_> + 12 14 4 4 2. + <_> + + <_> + 4 14 12 6 -1. + <_> + 4 16 12 2 3. + <_> + + <_> + 1 13 18 4 -1. + <_> + 10 13 9 2 2. + <_> + 1 15 9 2 2. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 5 7 11 4 -1. + <_> + 5 9 11 2 2. + <_> + + <_> + 9 4 2 14 -1. + <_> + 9 11 2 7 2. + <_> + + <_> + 11 6 6 14 -1. + <_> + 14 6 3 7 2. + <_> + 11 13 3 7 2. + <_> + + <_> + 0 2 6 11 -1. + <_> + 3 2 3 11 2. + <_> + + <_> + 9 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 3 7 6 12 -1. + <_> + 3 7 3 6 2. + <_> + 6 13 3 6 2. + <_> + + <_> + 7 6 10 3 -1. + <_> + 7 6 5 3 2. + <_> + + <_> + 3 6 10 3 -1. + <_> + 8 6 5 3 2. + <_> + + <_> + 6 14 13 3 -1. + <_> + 6 15 13 1 3. + <_> + + <_> + 3 0 14 9 -1. + <_> + 3 3 14 3 3. + <_> + + <_> + 3 1 14 4 -1. + <_> + 10 1 7 2 2. + <_> + 3 3 7 2 2. + <_> + + <_> + 1 14 7 6 -1. + <_> + 1 16 7 2 3. + <_> + + <_> + 6 9 10 10 -1. + <_> + 11 9 5 5 2. + <_> + 6 14 5 5 2. + <_> + + <_> + 4 9 10 10 -1. + <_> + 4 9 5 5 2. + <_> + 9 14 5 5 2. + <_> + + <_> + 5 6 10 6 -1. + <_> + 5 9 10 3 2. + <_> + + <_> + 1 1 7 4 -1. + <_> + 1 3 7 2 2. + <_> + + <_> + 3 0 14 3 -1. + <_> + 3 1 14 1 3. + <_> + + <_> + 6 7 7 10 -1. + <_> + 6 12 7 5 2. + <_> + + <_> + 10 1 10 19 -1. + <_> + 10 1 5 19 2. + <_> + + <_> + 8 6 3 14 -1. + <_> + 9 6 1 14 3. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 12 0 2 13 -1. + <_> + 12 0 1 13 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 5 5 12 8 -1. + <_> + 5 9 12 4 2. + <_> + + <_> + 1 14 7 4 -1. + <_> + 1 16 7 2 2. + <_> + + <_> + 7 12 11 8 -1. + <_> + 7 16 11 4 2. + <_> + + <_> + 6 0 2 13 -1. + <_> + 7 0 1 13 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 10 3 4 7 -1. + <_> + 10 3 2 7 2. + <_> + + <_> + 2 15 16 4 -1. + <_> + 2 15 8 2 2. + <_> + 10 17 8 2 2. + <_> + + <_> + 1 1 18 6 -1. + <_> + 10 1 9 3 2. + <_> + 1 4 9 3 2. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 3 0 14 6 -1. + <_> + 3 3 14 3 2. + <_> + + <_> + 0 6 10 6 -1. + <_> + 0 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 10 3 4 7 -1. + <_> + 10 3 2 7 2. + <_> + + <_> + 6 3 4 7 -1. + <_> + 8 3 2 7 2. + <_> + + <_> + 4 2 13 12 -1. + <_> + 4 6 13 4 3. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 15 4 5 6 -1. + <_> + 15 7 5 3 2. + <_> + + <_> + 3 10 13 3 -1. + <_> + 3 11 13 1 3. + <_> + + <_> + 5 10 10 6 -1. + <_> + 10 10 5 3 2. + <_> + 5 13 5 3 2. + <_> + + <_> + 3 5 12 12 -1. + <_> + 3 5 6 6 2. + <_> + 9 11 6 6 2. + <_> + + <_> + 15 4 5 6 -1. + <_> + 15 7 5 3 2. + <_> + + <_> + 1 3 4 8 -1. + <_> + 1 7 4 4 2. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 2 1 18 3 -1. + <_> + 2 2 18 1 3. + <_> + + <_> + 4 11 6 6 -1. + <_> + 7 11 3 6 2. + <_> + + <_> + 4 6 13 3 -1. + <_> + 4 7 13 1 3. + <_> + + <_> + 1 12 18 4 -1. + <_> + 1 14 18 2 2. + <_> + + <_> + 12 10 5 6 -1. + <_> + 12 13 5 3 2. + <_> + + <_> + 0 1 5 14 -1. + <_> + 0 8 5 7 2. + <_> + + <_> + 2 12 18 6 -1. + <_> + 11 12 9 3 2. + <_> + 2 15 9 3 2. + <_> + + <_> + 5 2 6 13 -1. + <_> + 7 2 2 13 3. + <_> + + <_> + 13 8 7 6 -1. + <_> + 13 10 7 2 3. + <_> + + <_> + 2 5 16 10 -1. + <_> + 2 5 8 5 2. + <_> + 10 10 8 5 2. + <_> + + <_> + 14 4 6 7 -1. + <_> + 16 4 2 7 3. + <_> + + <_> + 4 1 6 7 -1. + <_> + 6 1 2 7 3. + <_> + + <_> + 13 10 7 4 -1. + <_> + 13 12 7 2 2. + <_> + + <_> + 0 10 7 4 -1. + <_> + 0 12 7 2 2. + <_> + + <_> + 6 14 14 3 -1. + <_> + 6 15 14 1 3. + <_> + + <_> + 1 14 13 3 -1. + <_> + 1 15 13 1 3. + <_> + + <_> + 2 14 17 6 -1. + <_> + 2 16 17 2 3. + <_> + + <_> + 7 7 5 12 -1. + <_> + 7 11 5 4 3. + <_> + + <_> + 8 6 4 7 -1. + <_> + 8 6 2 7 2. + <_> + + <_> + 7 10 6 10 -1. + <_> + 7 10 3 5 2. + <_> + 10 15 3 5 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 13 15 3 -1. + <_> + 0 14 15 1 3. + <_> + + <_> + 13 12 5 8 -1. + <_> + 13 16 5 4 2. + <_> + + <_> + 0 12 18 6 -1. + <_> + 0 12 9 3 2. + <_> + 9 15 9 3 2. + <_> + + <_> + 12 10 6 10 -1. + <_> + 15 10 3 5 2. + <_> + 12 15 3 5 2. + <_> + + <_> + 2 10 6 10 -1. + <_> + 2 10 3 5 2. + <_> + 5 15 3 5 2. + <_> + + <_> + 4 7 15 3 -1. + <_> + 9 7 5 3 3. + <_> + + <_> + 0 12 7 6 -1. + <_> + 0 14 7 2 3. + <_> + + <_> + 5 7 15 3 -1. + <_> + 10 7 5 3 3. + <_> + + <_> + 2 5 16 3 -1. + <_> + 2 6 16 1 3. + <_> + + <_> + 8 8 12 12 -1. + <_> + 8 8 6 12 2. + <_> + + <_> + 6 3 7 6 -1. + <_> + 6 6 7 3 2. + <_> + + <_> + 9 5 6 5 -1. + <_> + 9 5 3 5 2. + <_> + + <_> + 5 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 9 8 5 12 -1. + <_> + 9 12 5 4 3. + <_> + + <_> + 6 5 8 8 -1. + <_> + 6 9 8 4 2. + <_> + + <_> + 11 0 6 12 -1. + <_> + 14 0 3 6 2. + <_> + 11 6 3 6 2. + <_> + + <_> + 3 0 6 12 -1. + <_> + 3 0 3 6 2. + <_> + 6 6 3 6 2. + <_> + + <_> + 10 10 4 8 -1. + <_> + 10 14 4 4 2. + <_> + + <_> + 5 9 10 8 -1. + <_> + 5 9 5 4 2. + <_> + 10 13 5 4 2. + <_> + + <_> + 4 11 13 3 -1. + <_> + 4 12 13 1 3. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 14 0 4 7 -1. + <_> + 14 0 2 7 2. + <_> + + <_> + 2 0 4 7 -1. + <_> + 4 0 2 7 2. + <_> + + <_> + 6 5 14 6 -1. + <_> + 13 5 7 3 2. + <_> + 6 8 7 3 2. + <_> + + <_> + 0 6 16 6 -1. + <_> + 0 6 8 3 2. + <_> + 8 9 8 3 2. + <_> + + <_> + 12 6 5 9 -1. + <_> + 12 9 5 3 3. + <_> + + <_> + 1 6 9 8 -1. + <_> + 1 10 9 4 2. + <_> + + <_> + 13 10 7 6 -1. + <_> + 13 12 7 2 3. + <_> + + <_> + 0 10 7 6 -1. + <_> + 0 12 7 2 3. + <_> + + <_> + 9 5 2 14 -1. + <_> + 9 12 2 7 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 1 2 19 2 -1. + <_> + 1 3 19 1 2. + <_> + + <_> + 0 0 4 13 -1. + <_> + 2 0 2 13 2. + <_> + + <_> + 14 1 6 9 -1. + <_> + 16 1 2 9 3. + <_> + + <_> + 0 1 6 9 -1. + <_> + 2 1 2 9 3. + <_> + + <_> + 0 11 20 9 -1. + <_> + 0 14 20 3 3. + <_> + + <_> + 0 11 8 4 -1. + <_> + 0 13 8 2 2. + <_> + + <_> + 9 3 6 10 -1. + <_> + 11 3 2 10 3. + <_> + + <_> + 4 6 10 3 -1. + <_> + 9 6 5 3 2. + <_> + + <_> + 10 9 6 5 -1. + <_> + 10 9 3 5 2. + <_> + + <_> + 5 9 9 5 -1. + <_> + 8 9 3 5 3. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 5 3 6 9 -1. + <_> + 7 3 2 9 3. + <_> + + <_> + 1 0 18 8 -1. + <_> + 10 0 9 4 2. + <_> + 1 4 9 4 2. + <_> + + <_> + 3 18 14 2 -1. + <_> + 3 19 14 1 2. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 0 4 6 16 -1. + <_> + 0 4 3 8 2. + <_> + 3 12 3 8 2. + <_> + + <_> + 14 6 6 13 -1. + <_> + 14 6 3 13 2. + <_> + + <_> + 6 7 3 12 -1. + <_> + 6 13 3 6 2. + <_> + + <_> + 11 11 5 6 -1. + <_> + 11 14 5 3 2. + <_> + + <_> + 1 8 15 4 -1. + <_> + 6 8 5 4 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 6 4 6 7 -1. + <_> + 8 4 2 7 3. + <_> + + <_> + 9 0 6 10 -1. + <_> + 12 0 3 5 2. + <_> + 9 5 3 5 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 15 10 4 10 -1. + <_> + 15 10 2 10 2. + <_> + + <_> + 1 10 4 10 -1. + <_> + 3 10 2 10 2. + <_> + + <_> + 5 0 10 16 -1. + <_> + 10 0 5 8 2. + <_> + 5 8 5 8 2. + <_> + + <_> + 3 6 13 3 -1. + <_> + 3 7 13 1 3. + <_> + + <_> + 8 6 5 9 -1. + <_> + 8 9 5 3 3. + <_> + + <_> + 4 6 6 12 -1. + <_> + 4 10 6 4 3. + <_> + + <_> + 8 13 9 6 -1. + <_> + 8 16 9 3 2. + <_> + + <_> + 0 5 12 6 -1. + <_> + 0 7 12 2 3. + <_> + + <_> + 4 8 13 3 -1. + <_> + 4 9 13 1 3. + <_> + + <_> + 6 6 4 12 -1. + <_> + 6 12 4 6 2. + <_> + + <_> + 4 15 13 3 -1. + <_> + 4 16 13 1 3. + <_> + + <_> + 2 14 13 3 -1. + <_> + 2 15 13 1 3. + <_> + + <_> + 11 1 4 14 -1. + <_> + 11 1 2 14 2. + <_> + + <_> + 3 6 12 4 -1. + <_> + 7 6 4 4 3. + <_> + + <_> + 8 0 4 7 -1. + <_> + 8 0 2 7 2. + <_> + + <_> + 0 0 4 8 -1. + <_> + 2 0 2 8 2. + <_> + + <_> + 2 11 16 9 -1. + <_> + 2 14 16 3 3. + <_> + + <_> + 0 4 6 7 -1. + <_> + 2 4 2 7 3. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 0 10 16 4 -1. + <_> + 0 10 8 2 2. + <_> + 8 12 8 2 2. + <_> + + <_> + 3 1 14 2 -1. + <_> + 3 2 14 1 2. + <_> + + <_> + 4 10 5 9 -1. + <_> + 4 13 5 3 3. + <_> + + <_> + 2 14 16 4 -1. + <_> + 10 14 8 2 2. + <_> + 2 16 8 2 2. + <_> + + <_> + 0 0 19 8 -1. + <_> + 0 4 19 4 2. + <_> + + <_> + 10 10 6 5 -1. + <_> + 10 10 3 5 2. + <_> + + <_> + 1 1 18 15 -1. + <_> + 7 1 6 15 3. + <_> + + <_> + 10 10 6 5 -1. + <_> + 10 10 3 5 2. + <_> + + <_> + 4 7 4 8 -1. + <_> + 6 7 2 8 2. + <_> + + <_> + 17 3 3 14 -1. + <_> + 18 3 1 14 3. + <_> + + <_> + 4 6 12 12 -1. + <_> + 4 6 6 6 2. + <_> + 10 12 6 6 2. + <_> + + <_> + 12 6 8 14 -1. + <_> + 16 6 4 7 2. + <_> + 12 13 4 7 2. + <_> + + <_> + 0 6 8 14 -1. + <_> + 0 6 4 7 2. + <_> + 4 13 4 7 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 2 4 6 16 -1. + <_> + 2 4 3 8 2. + <_> + 5 12 3 8 2. + <_> + + <_> + 14 11 5 9 -1. + <_> + 14 14 5 3 3. + <_> + + <_> + 3 3 14 3 -1. + <_> + 3 4 14 1 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 5 1 6 16 -1. + <_> + 5 1 3 8 2. + <_> + 8 9 3 8 2. + <_> + + <_> + 7 7 6 10 -1. + <_> + 9 7 2 10 3. + <_> + + <_> + 5 9 4 11 -1. + <_> + 7 9 2 11 2. + <_> + + <_> + 10 9 6 6 -1. + <_> + 10 9 3 6 2. + <_> + + <_> + 0 3 3 14 -1. + <_> + 1 3 1 14 3. + <_> + + <_> + 10 9 6 6 -1. + <_> + 10 9 3 6 2. + <_> + + <_> + 5 10 4 7 -1. + <_> + 7 10 2 7 2. + <_> + + <_> + 18 7 2 13 -1. + <_> + 18 7 1 13 2. + <_> + + <_> + 2 5 16 8 -1. + <_> + 2 9 16 4 2. + <_> + + <_> + 6 2 12 10 -1. + <_> + 6 7 12 5 2. + <_> + + <_> + 0 7 7 6 -1. + <_> + 0 9 7 2 3. + <_> + + <_> + 18 7 2 13 -1. + <_> + 18 7 1 13 2. + <_> + + <_> + 0 7 2 13 -1. + <_> + 1 7 1 13 2. + <_> + + <_> + 12 3 8 12 -1. + <_> + 12 3 4 12 2. + <_> + + <_> + 0 3 8 12 -1. + <_> + 4 3 4 12 2. + <_> + + <_> + 15 3 5 6 -1. + <_> + 15 6 5 3 2. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 2 11 18 4 -1. + <_> + 11 11 9 2 2. + <_> + 2 13 9 2 2. + <_> + + <_> + 0 11 18 4 -1. + <_> + 0 11 9 2 2. + <_> + 9 13 9 2 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 4 1 9 12 -1. + <_> + 4 7 9 6 2. + <_> + + <_> + 15 3 5 6 -1. + <_> + 15 6 5 3 2. + <_> + + <_> + 0 3 5 6 -1. + <_> + 0 6 5 3 2. + <_> + + <_> + 6 6 8 4 -1. + <_> + 6 8 8 2 2. + <_> + + <_> + 0 9 7 6 -1. + <_> + 0 11 7 2 3. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 5 2 4 13 -1. + <_> + 7 2 2 13 2. + <_> + + <_> + 4 14 13 3 -1. + <_> + 4 15 13 1 3. + <_> + + <_> + 0 7 20 2 -1. + <_> + 0 8 20 1 2. + <_> + + <_> + 11 0 9 5 -1. + <_> + 14 0 3 5 3. + <_> + + <_> + 0 3 10 6 -1. + <_> + 0 3 5 3 2. + <_> + 5 6 5 3 2. + <_> + + <_> + 6 4 9 5 -1. + <_> + 9 4 3 5 3. + <_> + + <_> + 3 12 8 8 -1. + <_> + 3 12 4 4 2. + <_> + 7 16 4 4 2. + <_> + + <_> + 4 7 15 3 -1. + <_> + 9 7 5 3 3. + <_> + + <_> + 0 4 6 9 -1. + <_> + 3 4 3 9 2. + <_> + + <_> + 4 7 12 4 -1. + <_> + 4 9 12 2 2. + <_> + + <_> + 7 6 4 12 -1. + <_> + 7 12 4 6 2. + <_> + + <_> + 6 1 8 15 -1. + <_> + 6 6 8 5 3. + <_> + + <_> + 1 7 15 3 -1. + <_> + 6 7 5 3 3. + <_> + + <_> + 4 9 12 5 -1. + <_> + 8 9 4 5 3. + <_> + + <_> + 6 6 8 8 -1. + <_> + 6 10 8 4 2. + <_> + + <_> + 12 12 8 6 -1. + <_> + 12 14 8 2 3. + <_> + + <_> + 2 0 14 2 -1. + <_> + 2 1 14 1 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 1 3 16 2 -1. + <_> + 1 4 16 1 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 0 12 8 6 -1. + <_> + 0 14 8 2 3. + <_> + + <_> + 5 11 13 3 -1. + <_> + 5 12 13 1 3. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 2 8 17 3 -1. + <_> + 2 9 17 1 3. + <_> + + <_> + 1 1 18 6 -1. + <_> + 1 1 9 3 2. + <_> + 10 4 9 3 2. + <_> + + <_> + 1 1 19 6 -1. + <_> + 1 3 19 2 3. + <_> + + <_> + 4 6 12 6 -1. + <_> + 4 6 6 3 2. + <_> + 10 9 6 3 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 3 18 13 2 -1. + <_> + 3 19 13 1 2. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 8 5 4 7 -1. + <_> + 10 5 2 7 2. + <_> + + <_> + 10 12 8 6 -1. + <_> + 10 14 8 2 3. + <_> + + <_> + 0 0 18 4 -1. + <_> + 0 0 9 2 2. + <_> + 9 2 9 2 2. + <_> + + <_> + 4 6 15 5 -1. + <_> + 9 6 5 5 3. + <_> + + <_> + 0 7 15 4 -1. + <_> + 5 7 5 4 3. + <_> + + <_> + 12 4 4 10 -1. + <_> + 12 9 4 5 2. + <_> + + <_> + 0 6 18 12 -1. + <_> + 0 6 9 6 2. + <_> + 9 12 9 6 2. + <_> + + <_> + 16 5 2 14 -1. + <_> + 16 12 2 7 2. + <_> + + <_> + 2 9 5 6 -1. + <_> + 2 12 5 3 2. + <_> + + <_> + 12 0 3 19 -1. + <_> + 13 0 1 19 3. + <_> + + <_> + 0 10 9 6 -1. + <_> + 0 12 9 2 3. + <_> + + <_> + 11 12 7 6 -1. + <_> + 11 14 7 2 3. + <_> + + <_> + 5 0 4 7 -1. + <_> + 7 0 2 7 2. + <_> + + <_> + 12 0 3 19 -1. + <_> + 13 0 1 19 3. + <_> + + <_> + 0 15 14 4 -1. + <_> + 0 15 7 2 2. + <_> + 7 17 7 2 2. + <_> + + <_> + 4 5 14 6 -1. + <_> + 4 7 14 2 3. + <_> + + <_> + 3 1 6 7 -1. + <_> + 5 1 2 7 3. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 0 1 6 9 -1. + <_> + 0 4 6 3 3. + <_> + + <_> + 11 12 7 6 -1. + <_> + 11 14 7 2 3. + <_> + + <_> + 2 12 7 6 -1. + <_> + 2 14 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 8 9 6 5 -1. + <_> + 8 9 3 5 2. + <_> + + <_> + 6 9 6 5 -1. + <_> + 9 9 3 5 2. + <_> + + <_> + 12 11 7 6 -1. + <_> + 12 13 7 2 3. + <_> + + <_> + 5 8 10 10 -1. + <_> + 5 8 5 5 2. + <_> + 10 13 5 5 2. + <_> + + <_> + 1 5 18 10 -1. + <_> + 10 5 9 5 2. + <_> + 1 10 9 5 2. + <_> + + <_> + 4 0 6 9 -1. + <_> + 6 0 2 9 3. + <_> + + <_> + 1 0 18 6 -1. + <_> + 7 0 6 6 3. + <_> + + <_> + 4 3 5 14 -1. + <_> + 4 10 5 7 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 0 0 8 10 -1. + <_> + 0 5 8 5 2. + <_> + + <_> + 7 2 6 6 -1. + <_> + 7 5 6 3 2. + <_> + + <_> + 0 0 19 3 -1. + <_> + 0 1 19 1 3. + <_> + + <_> + 8 0 8 6 -1. + <_> + 8 2 8 2 3. + <_> + + <_> + 7 5 6 11 -1. + <_> + 9 5 2 11 3. + <_> + + <_> + 4 3 12 10 -1. + <_> + 8 3 4 10 3. + <_> + + <_> + 0 4 18 4 -1. + <_> + 0 6 18 2 2. + <_> + + <_> + 12 0 2 15 -1. + <_> + 12 0 1 15 2. + <_> + + <_> + 0 13 7 6 -1. + <_> + 0 15 7 2 3. + <_> + + <_> + 12 11 7 6 -1. + <_> + 12 13 7 2 3. + <_> + + <_> + 2 13 13 3 -1. + <_> + 2 14 13 1 3. + <_> + + <_> + 10 4 4 14 -1. + <_> + 12 4 2 7 2. + <_> + 10 11 2 7 2. + <_> + + <_> + 2 10 7 6 -1. + <_> + 2 12 7 2 3. + <_> + + <_> + 10 4 4 14 -1. + <_> + 12 4 2 7 2. + <_> + 10 11 2 7 2. + <_> + + <_> + 6 4 4 14 -1. + <_> + 6 4 2 7 2. + <_> + 8 11 2 7 2. + <_> + + <_> + 14 3 6 7 -1. + <_> + 16 3 2 7 3. + <_> + + <_> + 6 6 8 4 -1. + <_> + 6 8 8 2 2. + <_> + + <_> + 12 0 2 15 -1. + <_> + 12 0 1 15 2. + <_> + + <_> + 6 0 2 15 -1. + <_> + 7 0 1 15 2. + <_> + + <_> + 12 1 3 17 -1. + <_> + 13 1 1 17 3. + <_> + + <_> + 5 1 3 17 -1. + <_> + 6 1 1 17 3. + <_> + + <_> + 9 4 3 13 -1. + <_> + 10 4 1 13 3. + <_> + + <_> + 9 3 2 14 -1. + <_> + 10 3 1 14 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 8 5 4 7 -1. + <_> + 10 5 2 7 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 0 5 20 4 -1. + <_> + 10 5 10 4 2. + <_> + + <_> + 13 2 7 6 -1. + <_> + 13 4 7 2 3. + <_> + + <_> + 0 2 19 2 -1. + <_> + 0 3 19 1 2. + <_> + + <_> + 10 9 10 11 -1. + <_> + 10 9 5 11 2. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 3 0 15 9 -1. + <_> + 8 0 5 9 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 3 4 14 2 -1. + <_> + 3 5 14 1 2. + <_> + + <_> + 0 11 6 7 -1. + <_> + 2 11 2 7 3. + <_> + + <_> + 10 9 10 11 -1. + <_> + 10 9 5 11 2. + <_> + + <_> + 3 13 6 7 -1. + <_> + 5 13 2 7 3. + <_> + + <_> + 3 8 15 3 -1. + <_> + 8 8 5 3 3. + <_> + + <_> + 0 1 8 8 -1. + <_> + 0 1 4 4 2. + <_> + 4 5 4 4 2. + <_> + + <_> + 9 8 10 4 -1. + <_> + 9 8 5 4 2. + <_> + + <_> + 0 0 18 6 -1. + <_> + 6 0 6 6 3. + <_> + + <_> + 4 3 12 9 -1. + <_> + 4 6 12 3 3. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 8 6 4 10 -1. + <_> + 8 11 4 5 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 0 3 17 2 -1. + <_> + 0 4 17 1 2. + <_> + + <_> + 12 6 5 6 -1. + <_> + 12 9 5 3 2. + <_> + + <_> + 5 6 8 8 -1. + <_> + 5 6 4 4 2. + <_> + 9 10 4 4 2. + <_> + + <_> + 9 10 7 6 -1. + <_> + 9 12 7 2 3. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 13 6 5 9 -1. + <_> + 13 9 5 3 3. + <_> + + <_> + 2 6 5 9 -1. + <_> + 2 9 5 3 3. + <_> + + <_> + 14 2 6 5 -1. + <_> + 14 2 3 5 2. + <_> + + <_> + 5 6 6 11 -1. + <_> + 8 6 3 11 2. + <_> + + <_> + 14 2 6 5 -1. + <_> + 14 2 3 5 2. + <_> + + <_> + 0 3 10 6 -1. + <_> + 0 3 5 3 2. + <_> + 5 6 5 3 2. + <_> + + <_> + 6 12 13 2 -1. + <_> + 6 13 13 1 2. + <_> + + <_> + 5 11 10 6 -1. + <_> + 5 14 10 3 2. + <_> + + <_> + 12 11 8 8 -1. + <_> + 12 15 8 4 2. + <_> + + <_> + 4 0 12 7 -1. + <_> + 8 0 4 7 3. + <_> + + <_> + 5 15 13 2 -1. + <_> + 5 16 13 1 2. + <_> + + <_> + 0 12 20 6 -1. + <_> + 0 12 10 3 2. + <_> + 10 15 10 3 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 4 0 12 6 -1. + <_> + 4 2 12 2 3. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 0 0 6 10 -1. + <_> + 0 0 3 5 2. + <_> + 3 5 3 5 2. + <_> + + <_> + 5 6 10 12 -1. + <_> + 10 6 5 6 2. + <_> + 5 12 5 6 2. + <_> + + <_> + 1 15 15 4 -1. + <_> + 1 17 15 2 2. + <_> + + <_> + 10 5 9 6 -1. + <_> + 10 7 9 2 3. + <_> + + <_> + 4 2 6 7 -1. + <_> + 6 2 2 7 3. + <_> + + <_> + 10 5 10 6 -1. + <_> + 10 7 10 2 3. + <_> + + <_> + 0 5 10 6 -1. + <_> + 0 7 10 2 3. + <_> + + <_> + 8 9 12 4 -1. + <_> + 12 9 4 4 3. + <_> + + <_> + 0 0 4 8 -1. + <_> + 2 0 2 8 2. + <_> + + <_> + 0 1 20 3 -1. + <_> + 0 2 20 1 3. + <_> + + <_> + 0 0 4 17 -1. + <_> + 2 0 2 17 2. + <_> + + <_> + 5 6 12 3 -1. + <_> + 5 6 6 3 2. + <_> + + <_> + 6 7 3 12 -1. + <_> + 6 13 3 6 2. + <_> + + <_> + 14 2 6 5 -1. + <_> + 14 2 3 5 2. + <_> + + <_> + 0 2 6 5 -1. + <_> + 3 2 3 5 2. + <_> + + <_> + 1 3 18 16 -1. + <_> + 7 3 6 16 3. + <_> + + <_> + 4 4 11 10 -1. + <_> + 4 9 11 5 2. + <_> + + <_> + 6 1 13 3 -1. + <_> + 6 2 13 1 3. + <_> + + <_> + 3 4 8 10 -1. + <_> + 3 4 4 5 2. + <_> + 7 9 4 5 2. + <_> + + <_> + 6 7 14 4 -1. + <_> + 13 7 7 2 2. + <_> + 6 9 7 2 2. + <_> + + <_> + 1 1 8 6 -1. + <_> + 1 3 8 2 3. + <_> + + <_> + 15 3 5 9 -1. + <_> + 15 6 5 3 3. + <_> + + <_> + 0 3 5 9 -1. + <_> + 0 6 5 3 3. + <_> + + <_> + 14 6 4 14 -1. + <_> + 16 6 2 7 2. + <_> + 14 13 2 7 2. + <_> + + <_> + 0 1 6 12 -1. + <_> + 2 1 2 12 3. + <_> + + <_> + 10 9 6 5 -1. + <_> + 10 9 3 5 2. + <_> + + <_> + 4 9 6 5 -1. + <_> + 7 9 3 5 2. + <_> + + <_> + 8 5 6 8 -1. + <_> + 10 5 2 8 3. + <_> + + <_> + 0 13 18 7 -1. + <_> + 6 13 6 7 3. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 9 10 11 -1. + <_> + 5 9 5 11 2. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 5 8 10 12 -1. + <_> + 5 14 10 6 2. + <_> + + <_> + 12 13 7 6 -1. + <_> + 12 15 7 2 3. + <_> + + <_> + 1 10 6 7 -1. + <_> + 3 10 2 7 3. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 7 20 3 -1. + <_> + 0 8 20 1 3. + <_> + + <_> + 10 3 4 7 -1. + <_> + 10 3 2 7 2. + <_> + + <_> + 0 6 6 14 -1. + <_> + 0 6 3 7 2. + <_> + 3 13 3 7 2. + <_> + + <_> + 12 13 7 6 -1. + <_> + 12 15 7 2 3. + <_> + + <_> + 2 1 11 12 -1. + <_> + 2 7 11 6 2. + <_> + + <_> + 5 0 10 8 -1. + <_> + 5 4 10 4 2. + <_> + + <_> + 1 5 8 8 -1. + <_> + 1 5 4 4 2. + <_> + 5 9 4 4 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 16 4 4 16 -1. + <_> + 18 4 2 8 2. + <_> + 16 12 2 8 2. + <_> + + <_> + 0 13 7 6 -1. + <_> + 0 15 7 2 3. + <_> + + <_> + 6 15 14 4 -1. + <_> + 13 15 7 2 2. + <_> + 6 17 7 2 2. + <_> + + <_> + 6 3 4 7 -1. + <_> + 8 3 2 7 2. + <_> + + <_> + 10 11 5 9 -1. + <_> + 10 14 5 3 3. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 10 0 3 14 -1. + <_> + 11 0 1 14 3. + <_> + + <_> + 6 13 6 7 -1. + <_> + 8 13 2 7 3. + <_> + + <_> + 10 1 3 13 -1. + <_> + 11 1 1 13 3. + <_> + + <_> + 7 1 3 13 -1. + <_> + 8 1 1 13 3. + <_> + + <_> + 5 14 10 6 -1. + <_> + 10 14 5 3 2. + <_> + 5 17 5 3 2. + <_> + + <_> + 6 8 8 4 -1. + <_> + 6 10 8 2 2. + <_> + + <_> + 11 14 8 6 -1. + <_> + 11 16 8 2 3. + <_> + + <_> + 1 14 8 6 -1. + <_> + 1 16 8 2 3. + <_> + + <_> + 4 14 13 3 -1. + <_> + 4 15 13 1 3. + <_> + + <_> + 1 14 13 3 -1. + <_> + 1 15 13 1 3. + <_> + + <_> + 7 9 13 3 -1. + <_> + 7 10 13 1 3. + <_> + + <_> + 2 2 12 6 -1. + <_> + 2 2 6 3 2. + <_> + 8 5 6 3 2. + <_> + + <_> + 16 4 4 16 -1. + <_> + 18 4 2 8 2. + <_> + 16 12 2 8 2. + <_> + + <_> + 0 8 5 12 -1. + <_> + 0 12 5 4 3. + <_> + + <_> + 10 10 9 6 -1. + <_> + 10 12 9 2 3. + <_> + + <_> + 5 2 6 10 -1. + <_> + 5 2 3 5 2. + <_> + 8 7 3 5 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 6 5 6 8 -1. + <_> + 8 5 2 8 3. + <_> + + <_> + 11 0 4 14 -1. + <_> + 11 0 2 14 2. + <_> + + <_> + 5 0 4 14 -1. + <_> + 7 0 2 14 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 8 3 12 17 -1. + <_> + 8 3 6 17 2. + <_> + + <_> + 4 6 10 4 -1. + <_> + 9 6 5 4 2. + <_> + + <_> + 16 4 4 16 -1. + <_> + 18 4 2 8 2. + <_> + 16 12 2 8 2. + <_> + + <_> + 0 6 12 14 -1. + <_> + 6 6 6 14 2. + <_> + + <_> + 12 9 8 10 -1. + <_> + 12 9 4 10 2. + <_> + + <_> + 0 9 8 10 -1. + <_> + 4 9 4 10 2. + <_> + + <_> + 13 2 6 18 -1. + <_> + 13 2 3 18 2. + <_> + + <_> + 1 2 6 18 -1. + <_> + 4 2 3 18 2. + <_> + + <_> + 4 8 13 2 -1. + <_> + 4 9 13 1 2. + <_> + + <_> + 0 6 18 9 -1. + <_> + 0 9 18 3 3. + <_> + + <_> + 5 4 15 3 -1. + <_> + 5 5 15 1 3. + <_> + + <_> + 0 3 19 15 -1. + <_> + 0 8 19 5 3. + <_> + + <_> + 10 10 9 6 -1. + <_> + 10 12 9 2 3. + <_> + + <_> + 1 10 9 6 -1. + <_> + 1 12 9 2 3. + <_> + + <_> + 5 12 13 3 -1. + <_> + 5 13 13 1 3. + <_> + + <_> + 0 4 4 16 -1. + <_> + 0 4 2 8 2. + <_> + 2 12 2 8 2. + <_> + + <_> + 10 10 5 6 -1. + <_> + 10 13 5 3 2. + <_> + + <_> + 0 10 20 8 -1. + <_> + 0 14 20 4 2. + <_> + + <_> + 14 0 6 7 -1. + <_> + 16 0 2 7 3. + <_> + + <_> + 0 0 6 7 -1. + <_> + 2 0 2 7 3. + <_> + + <_> + 13 0 3 19 -1. + <_> + 14 0 1 19 3. + <_> + + <_> + 0 2 8 4 -1. + <_> + 4 2 4 4 2. + <_> + + <_> + 12 12 7 6 -1. + <_> + 12 14 7 2 3. + <_> + + <_> + 6 11 7 6 -1. + <_> + 6 13 7 2 3. + <_> + + <_> + 10 10 5 6 -1. + <_> + 10 13 5 3 2. + <_> + + <_> + 3 10 6 9 -1. + <_> + 3 13 6 3 3. + <_> + + <_> + 13 5 4 14 -1. + <_> + 15 5 2 7 2. + <_> + 13 12 2 7 2. + <_> + + <_> + 3 5 10 9 -1. + <_> + 3 8 10 3 3. + <_> + + <_> + 2 15 18 4 -1. + <_> + 2 17 18 2 2. + <_> + + <_> + 0 4 8 6 -1. + <_> + 0 6 8 2 3. + <_> + + <_> + 4 5 13 2 -1. + <_> + 4 6 13 1 2. + <_> + + <_> + 1 12 7 6 -1. + <_> + 1 14 7 2 3. + <_> + + <_> + 0 12 20 6 -1. + <_> + 0 14 20 2 3. + <_> + + <_> + 0 10 6 8 -1. + <_> + 3 10 3 8 2. + <_> + + <_> + 4 8 15 3 -1. + <_> + 9 8 5 3 3. + <_> + + <_> + 1 9 9 6 -1. + <_> + 4 9 3 6 3. + <_> + + <_> + 2 0 16 14 -1. + <_> + 10 0 8 7 2. + <_> + 2 7 8 7 2. + <_> + + <_> + 3 0 14 18 -1. + <_> + 3 9 14 9 2. + <_> + + <_> + 9 7 6 10 -1. + <_> + 12 7 3 5 2. + <_> + 9 12 3 5 2. + <_> + + <_> + 3 4 4 16 -1. + <_> + 3 4 2 8 2. + <_> + 5 12 2 8 2. + <_> + + <_> + 12 14 8 6 -1. + <_> + 12 16 8 2 3. + <_> + + <_> + 0 14 8 6 -1. + <_> + 0 16 8 2 3. + <_> + + <_> + 5 4 10 4 -1. + <_> + 5 6 10 2 2. + <_> + + <_> + 1 0 18 10 -1. + <_> + 7 0 6 10 3. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 13 4 3 15 -1. + <_> + 13 9 3 5 3. + <_> + + <_> + 4 4 3 15 -1. + <_> + 4 9 3 5 3. + <_> + + <_> + 14 3 6 5 -1. + <_> + 14 3 3 5 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 14 2 6 7 -1. + <_> + 14 2 3 7 2. + <_> + + <_> + 0 2 6 7 -1. + <_> + 3 2 3 7 2. + <_> + + <_> + 11 6 8 8 -1. + <_> + 15 6 4 4 2. + <_> + 11 10 4 4 2. + <_> + + <_> + 2 14 7 6 -1. + <_> + 2 16 7 2 3. + <_> + + <_> + 5 9 13 3 -1. + <_> + 5 10 13 1 3. + <_> + + <_> + 0 8 15 3 -1. + <_> + 0 9 15 1 3. + <_> + + <_> + 11 5 4 12 -1. + <_> + 11 11 4 6 2. + <_> + + <_> + 2 11 13 3 -1. + <_> + 2 12 13 1 3. + <_> + + <_> + 2 1 16 2 -1. + <_> + 2 2 16 1 2. + <_> + + <_> + 5 6 8 10 -1. + <_> + 5 6 4 5 2. + <_> + 9 11 4 5 2. + <_> + + <_> + 8 8 10 12 -1. + <_> + 13 8 5 6 2. + <_> + 8 14 5 6 2. + <_> + + <_> + 3 10 6 6 -1. + <_> + 3 13 6 3 2. + <_> + + <_> + 1 5 18 8 -1. + <_> + 10 5 9 4 2. + <_> + 1 9 9 4 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 4 6 13 3 -1. + <_> + 4 7 13 1 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 11 2 6 10 -1. + <_> + 14 2 3 5 2. + <_> + 11 7 3 5 2. + <_> + + <_> + 5 9 4 7 -1. + <_> + 7 9 2 7 2. + <_> + + <_> + 1 9 18 3 -1. + <_> + 7 9 6 3 3. + <_> + + <_> + 2 6 8 14 -1. + <_> + 2 6 4 7 2. + <_> + 6 13 4 7 2. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 6 0 4 9 -1. + <_> + 8 0 2 9 2. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 7 0 3 13 -1. + <_> + 8 0 1 13 3. + <_> + + <_> + 9 1 3 13 -1. + <_> + 10 1 1 13 3. + <_> + + <_> + 0 9 13 2 -1. + <_> + 0 10 13 1 2. + <_> + + <_> + 7 3 13 16 -1. + <_> + 7 11 13 8 2. + <_> + + <_> + 0 3 5 9 -1. + <_> + 0 6 5 3 3. + <_> + + <_> + 11 1 7 6 -1. + <_> + 11 3 7 2 3. + <_> + + <_> + 1 1 16 4 -1. + <_> + 1 1 8 2 2. + <_> + 9 3 8 2 2. + <_> + + <_> + 0 2 20 6 -1. + <_> + 10 2 10 3 2. + <_> + 0 5 10 3 2. + <_> + + <_> + 0 4 19 10 -1. + <_> + 0 9 19 5 2. + <_> + + <_> + 4 6 15 5 -1. + <_> + 9 6 5 5 3. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 1 12 9 8 -1. + <_> + 1 16 9 4 2. + <_> + + <_> + 3 5 14 3 -1. + <_> + 3 6 14 1 3. + <_> + + <_> + 3 5 13 3 -1. + <_> + 3 6 13 1 3. + <_> + + <_> + 16 0 4 7 -1. + <_> + 16 0 2 7 2. + <_> + + <_> + 3 11 14 4 -1. + <_> + 3 11 7 2 2. + <_> + 10 13 7 2 2. + <_> + + <_> + 3 11 14 4 -1. + <_> + 10 11 7 2 2. + <_> + 3 13 7 2 2. + <_> + + <_> + 2 5 14 6 -1. + <_> + 2 7 14 2 3. + <_> + + <_> + 11 15 9 4 -1. + <_> + 11 17 9 2 2. + <_> + + <_> + 1 14 13 3 -1. + <_> + 1 15 13 1 3. + <_> + + <_> + 12 13 7 6 -1. + <_> + 12 15 7 2 3. + <_> + + <_> + 1 13 7 6 -1. + <_> + 1 15 7 2 3. + <_> + + <_> + 0 16 20 4 -1. + <_> + 0 18 20 2 2. + <_> + + <_> + 0 14 12 6 -1. + <_> + 0 14 6 3 2. + <_> + 6 17 6 3 2. + <_> + + <_> + 4 6 15 5 -1. + <_> + 9 6 5 5 3. + <_> + + <_> + 1 6 15 5 -1. + <_> + 6 6 5 5 3. + <_> + + <_> + 11 5 6 9 -1. + <_> + 11 8 6 3 3. + <_> + + <_> + 5 0 6 8 -1. + <_> + 7 0 2 8 3. + <_> + + <_> + 5 17 13 3 -1. + <_> + 5 18 13 1 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 5 3 14 3 -1. + <_> + 5 4 14 1 3. + <_> + + <_> + 6 9 6 5 -1. + <_> + 9 9 3 5 2. + <_> + + <_> + 12 6 8 5 -1. + <_> + 12 6 4 5 2. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 4 14 13 2 -1. + <_> + 4 15 13 1 2. + <_> + + <_> + 0 0 4 7 -1. + <_> + 2 0 2 7 2. + <_> + + <_> + 6 9 8 8 -1. + <_> + 6 13 8 4 2. + <_> + + <_> + 3 13 13 3 -1. + <_> + 3 14 13 1 3. + <_> + + <_> + 9 3 3 10 -1. + <_> + 9 8 3 5 2. + <_> + + <_> + 4 0 12 20 -1. + <_> + 10 0 6 20 2. + <_> + + <_> + 13 12 6 6 -1. + <_> + 13 12 3 6 2. + <_> + + <_> + 3 2 12 4 -1. + <_> + 9 2 6 4 2. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 6 4 2 13 -1. + <_> + 7 4 1 13 2. + <_> + + <_> + 13 4 4 12 -1. + <_> + 13 4 2 12 2. + <_> + + <_> + 0 9 12 3 -1. + <_> + 6 9 6 3 2. + <_> + + <_> + 13 4 4 12 -1. + <_> + 13 4 2 12 2. + <_> + + <_> + 3 4 4 12 -1. + <_> + 5 4 2 12 2. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 5 4 13 3 -1. + <_> + 5 5 13 1 3. + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 7 15 13 3 -1. + <_> + 7 16 13 1 3. + <_> + + <_> + 0 2 18 4 -1. + <_> + 0 2 9 2 2. + <_> + 9 4 9 2 2. + <_> + + <_> + 12 6 8 5 -1. + <_> + 12 6 4 5 2. + <_> + + <_> + 5 0 10 8 -1. + <_> + 5 4 10 4 2. + <_> + + <_> + 9 0 10 6 -1. + <_> + 9 2 10 2 3. + <_> + + <_> + 3 0 14 3 -1. + <_> + 3 1 14 1 3. + <_> + + <_> + 12 6 8 5 -1. + <_> + 12 6 4 5 2. + <_> + + <_> + 0 6 8 5 -1. + <_> + 4 6 4 5 2. + <_> + + <_> + 11 15 7 4 -1. + <_> + 11 17 7 2 2. + <_> + + <_> + 4 2 9 5 -1. + <_> + 7 2 3 5 3. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 5 3 10 6 -1. + <_> + 5 5 10 2 3. + <_> + + <_> + 8 4 6 14 -1. + <_> + 8 11 6 7 2. + <_> + + <_> + 1 5 9 6 -1. + <_> + 1 7 9 2 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 8 3 4 7 -1. + <_> + 10 3 2 7 2. + <_> + + <_> + 0 4 20 12 -1. + <_> + 10 4 10 6 2. + <_> + 0 10 10 6 2. + <_> + + <_> + 5 4 7 4 -1. + <_> + 5 6 7 2 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 8 6 3 12 -1. + <_> + 8 12 3 6 2. + <_> + + <_> + 3 0 14 2 -1. + <_> + 3 1 14 1 2. + <_> + + <_> + 7 7 6 13 -1. + <_> + 9 7 2 13 3. + <_> + + <_> + 3 4 16 12 -1. + <_> + 11 4 8 6 2. + <_> + 3 10 8 6 2. + <_> + + <_> + 1 4 16 12 -1. + <_> + 1 4 8 6 2. + <_> + 9 10 8 6 2. + <_> + + <_> + 7 5 6 10 -1. + <_> + 7 10 6 5 2. + <_> + + <_> + 3 6 5 9 -1. + <_> + 3 9 5 3 3. + <_> + + <_> + 6 3 14 4 -1. + <_> + 13 3 7 2 2. + <_> + 6 5 7 2 2. + <_> + + <_> + 3 18 13 2 -1. + <_> + 3 19 13 1 2. + <_> + + <_> + 4 10 16 4 -1. + <_> + 12 10 8 2 2. + <_> + 4 12 8 2 2. + <_> + + <_> + 2 10 14 4 -1. + <_> + 2 10 7 2 2. + <_> + 9 12 7 2 2. + <_> + + <_> + 12 12 7 6 -1. + <_> + 12 14 7 2 3. + <_> + + <_> + 0 0 4 11 -1. + <_> + 2 0 2 11 2. + <_> + + <_> + 14 0 6 9 -1. + <_> + 14 0 3 9 2. + <_> + + <_> + 1 12 7 6 -1. + <_> + 1 14 7 2 3. + <_> + + <_> + 6 12 13 2 -1. + <_> + 6 13 13 1 2. + <_> + + <_> + 0 0 6 9 -1. + <_> + 3 0 3 9 2. + <_> + + <_> + 0 9 20 3 -1. + <_> + 0 10 20 1 3. + <_> + + <_> + 5 5 3 10 -1. + <_> + 5 10 3 5 2. + <_> + + <_> + 1 5 18 8 -1. + <_> + 10 5 9 4 2. + <_> + 1 9 9 4 2. + <_> + + <_> + 4 2 10 6 -1. + <_> + 4 4 10 2 3. + <_> + + <_> + 6 0 8 12 -1. + <_> + 10 0 4 6 2. + <_> + 6 6 4 6 2. + <_> + + <_> + 5 6 6 7 -1. + <_> + 7 6 2 7 3. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 9 4 6 10 -1. + <_> + 12 4 3 5 2. + <_> + 9 9 3 5 2. + <_> + + <_> + 0 8 19 3 -1. + <_> + 0 9 19 1 3. + <_> + + <_> + 1 10 18 3 -1. + <_> + 1 11 18 1 3. + <_> + + <_> + 5 1 3 13 -1. + <_> + 6 1 1 13 3. + <_> + + <_> + 12 11 8 9 -1. + <_> + 12 11 4 9 2. + <_> + + <_> + 5 0 3 20 -1. + <_> + 6 0 1 20 3. + <_> + + <_> + 15 0 5 9 -1. + <_> + 15 3 5 3 3. + <_> + + <_> + 0 1 4 14 -1. + <_> + 2 1 2 14 2. + <_> + + <_> + 0 1 20 4 -1. + <_> + 10 1 10 2 2. + <_> + 0 3 10 2 2. + <_> + + <_> + 0 1 6 12 -1. + <_> + 2 1 2 12 3. + <_> + + <_> + 11 0 6 6 -1. + <_> + 11 0 3 6 2. + <_> + + <_> + 6 10 4 8 -1. + <_> + 6 14 4 4 2. + <_> + + <_> + 7 0 13 3 -1. + <_> + 7 1 13 1 3. + <_> + + <_> + 0 0 13 3 -1. + <_> + 0 1 13 1 3. + <_> + + <_> + 5 5 10 6 -1. + <_> + 5 7 10 2 3. + <_> + + <_> + 4 5 4 14 -1. + <_> + 4 5 2 7 2. + <_> + 6 12 2 7 2. + <_> + + <_> + 11 0 6 6 -1. + <_> + 11 0 3 6 2. + <_> + + <_> + 3 0 6 6 -1. + <_> + 6 0 3 6 2. + <_> + + <_> + 1 0 18 7 -1. + <_> + 7 0 6 7 3. + <_> + + <_> + 2 13 13 3 -1. + <_> + 2 14 13 1 3. + <_> + + <_> + 13 4 7 6 -1. + <_> + 13 6 7 2 3. + <_> + + <_> + 2 6 14 9 -1. + <_> + 2 9 14 3 3. + <_> + + <_> + 13 4 7 6 -1. + <_> + 13 6 7 2 3. + <_> + + <_> + 2 13 13 3 -1. + <_> + 2 14 13 1 3. + <_> + + <_> + 13 4 7 6 -1. + <_> + 13 6 7 2 3. + <_> + + <_> + 0 4 7 6 -1. + <_> + 0 6 7 2 3. + <_> + + <_> + 1 14 18 4 -1. + <_> + 10 14 9 2 2. + <_> + 1 16 9 2 2. + <_> + + <_> + 2 8 15 6 -1. + <_> + 7 8 5 6 3. + <_> + + <_> + 16 2 4 8 -1. + <_> + 16 6 4 4 2. + <_> + + <_> + 0 1 8 8 -1. + <_> + 0 1 4 4 2. + <_> + 4 5 4 4 2. + <_> + + <_> + 7 3 8 4 -1. + <_> + 7 5 8 2 2. + <_> + + <_> + 0 3 14 4 -1. + <_> + 0 3 7 2 2. + <_> + 7 5 7 2 2. + <_> + + <_> + 3 12 14 4 -1. + <_> + 10 12 7 2 2. + <_> + 3 14 7 2 2. + <_> + + <_> + 4 9 8 5 -1. + <_> + 8 9 4 5 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 8 5 8 4 -1. + <_> + 8 5 4 4 2. + <_> + + <_> + 2 2 15 7 -1. + <_> + 7 2 5 7 3. + <_> + + <_> + 8 5 8 4 -1. + <_> + 8 5 4 4 2. + <_> + + <_> + 4 5 8 4 -1. + <_> + 8 5 4 4 2. + <_> + + <_> + 7 1 7 12 -1. + <_> + 7 7 7 6 2. + <_> + + <_> + 4 0 12 10 -1. + <_> + 4 5 12 5 2. + <_> + + <_> + 6 6 14 4 -1. + <_> + 13 6 7 2 2. + <_> + 6 8 7 2 2. + <_> + + <_> + 0 1 5 6 -1. + <_> + 0 4 5 3 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 12 2 2 14 -1. + <_> + 12 2 1 14 2. + <_> + + <_> + 0 15 14 4 -1. + <_> + 0 15 7 2 2. + <_> + 7 17 7 2 2. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 6 2 2 14 -1. + <_> + 7 2 1 14 2. + <_> + + <_> + 6 6 14 4 -1. + <_> + 13 6 7 2 2. + <_> + 6 8 7 2 2. + <_> + + <_> + 0 6 14 4 -1. + <_> + 0 6 7 2 2. + <_> + 7 8 7 2 2. + <_> + + <_> + 12 11 8 9 -1. + <_> + 12 11 4 9 2. + <_> + + <_> + 0 11 8 9 -1. + <_> + 4 11 4 9 2. + <_> + + <_> + 7 1 12 18 -1. + <_> + 11 1 4 18 3. + <_> + + <_> + 1 1 12 18 -1. + <_> + 5 1 4 18 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 8 1 4 10 -1. + <_> + 8 6 4 5 2. + <_> + + <_> + 6 3 7 6 -1. + <_> + 6 5 7 2 3. + <_> + + <_> + 5 5 13 8 -1. + <_> + 5 9 13 4 2. + <_> + + <_> + 1 2 14 2 -1. + <_> + 1 3 14 1 2. + <_> + + <_> + 15 4 5 9 -1. + <_> + 15 7 5 3 3. + <_> + + <_> + 0 4 5 9 -1. + <_> + 0 7 5 3 3. + <_> + + <_> + 7 1 8 8 -1. + <_> + 7 5 8 4 2. + <_> + + <_> + 2 5 12 12 -1. + <_> + 2 5 6 6 2. + <_> + 8 11 6 6 2. + <_> + + <_> + 12 11 8 4 -1. + <_> + 12 13 8 2 2. + <_> + + <_> + 5 7 10 10 -1. + <_> + 5 7 5 5 2. + <_> + 10 12 5 5 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 2 14 16 3 -1. + <_> + 2 15 16 1 3. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 0 13 18 4 -1. + <_> + 0 13 9 2 2. + <_> + 9 15 9 2 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 0 11 8 4 -1. + <_> + 0 13 8 2 2. + <_> + + <_> + 6 12 13 2 -1. + <_> + 6 13 13 1 2. + <_> + + <_> + 1 12 13 2 -1. + <_> + 1 13 13 1 2. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 0 7 14 4 -1. + <_> + 0 7 7 2 2. + <_> + 7 9 7 2 2. + <_> + + <_> + 13 3 7 6 -1. + <_> + 13 5 7 2 3. + <_> + + <_> + 0 4 3 16 -1. + <_> + 0 12 3 8 2. + <_> + + <_> + 13 5 5 15 -1. + <_> + 13 10 5 5 3. + <_> + + <_> + 2 10 6 10 -1. + <_> + 2 10 3 5 2. + <_> + 5 15 3 5 2. + <_> + + <_> + 11 11 9 6 -1. + <_> + 11 13 9 2 3. + <_> + + <_> + 0 11 9 6 -1. + <_> + 0 13 9 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 1 3 18 4 -1. + <_> + 1 3 9 2 2. + <_> + 10 5 9 2 2. + <_> + + <_> + 10 10 10 6 -1. + <_> + 15 10 5 3 2. + <_> + 10 13 5 3 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 8 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 3 6 12 7 -1. + <_> + 7 6 4 7 3. + <_> + + <_> + 8 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 6 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 7 1 6 19 -1. + <_> + 7 1 3 19 2. + <_> + + <_> + 6 0 3 20 -1. + <_> + 7 0 1 20 3. + <_> + + <_> + 9 1 3 13 -1. + <_> + 10 1 1 13 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 2 0 18 16 -1. + <_> + 2 8 18 8 2. + <_> + + <_> + 1 5 6 15 -1. + <_> + 1 10 6 5 3. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 1 14 12 6 -1. + <_> + 1 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 6 13 10 6 -1. + <_> + 11 13 5 3 2. + <_> + 6 16 5 3 2. + <_> + + <_> + 0 10 14 3 -1. + <_> + 0 11 14 1 3. + <_> + + <_> + 11 9 6 8 -1. + <_> + 11 9 3 8 2. + <_> + + <_> + 1 13 7 6 -1. + <_> + 1 15 7 2 3. + <_> + + <_> + 9 0 3 12 -1. + <_> + 9 6 3 6 2. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 4 14 13 2 -1. + <_> + 4 15 13 1 2. + <_> + + <_> + 6 13 6 7 -1. + <_> + 8 13 2 7 3. + <_> + + <_> + 16 10 4 7 -1. + <_> + 16 10 2 7 2. + <_> + + <_> + 0 6 4 13 -1. + <_> + 2 6 2 13 2. + <_> + + <_> + 1 15 18 3 -1. + <_> + 7 15 6 3 3. + <_> + + <_> + 0 1 16 4 -1. + <_> + 0 1 8 2 2. + <_> + 8 3 8 2 2. + <_> + + <_> + 3 0 14 4 -1. + <_> + 3 2 14 2 2. + <_> + + <_> + 3 13 12 6 -1. + <_> + 3 13 6 3 2. + <_> + 9 16 6 3 2. + <_> + + <_> + 6 8 8 9 -1. + <_> + 6 11 8 3 3. + <_> + + <_> + 0 8 18 9 -1. + <_> + 0 11 18 3 3. + <_> + + <_> + 10 13 10 7 -1. + <_> + 10 13 5 7 2. + <_> + + <_> + 0 13 10 7 -1. + <_> + 5 13 5 7 2. + <_> + + <_> + 12 10 8 6 -1. + <_> + 12 12 8 2 3. + <_> + + <_> + 0 12 17 6 -1. + <_> + 0 15 17 3 2. + <_> + + <_> + 5 14 10 4 -1. + <_> + 5 16 10 2 2. + <_> + + <_> + 1 8 13 3 -1. + <_> + 1 9 13 1 3. + <_> + + <_> + 11 10 9 4 -1. + <_> + 11 12 9 2 2. + <_> + + <_> + 0 2 2 18 -1. + <_> + 1 2 1 18 2. + <_> + + <_> + 14 12 6 7 -1. + <_> + 14 12 3 7 2. + <_> + + <_> + 0 12 6 7 -1. + <_> + 3 12 3 7 2. + <_> + + <_> + 8 2 8 14 -1. + <_> + 8 9 8 7 2. + <_> + + <_> + 4 2 8 14 -1. + <_> + 4 9 8 7 2. + <_> + + <_> + 7 9 13 3 -1. + <_> + 7 10 13 1 3. + <_> + + <_> + 3 5 13 3 -1. + <_> + 3 6 13 1 3. + <_> + + <_> + 1 2 18 3 -1. + <_> + 7 2 6 3 3. + <_> + + <_> + 12 6 5 9 -1. + <_> + 12 9 5 3 3. + <_> + + <_> + 0 4 9 12 -1. + <_> + 3 4 3 12 3. + <_> + + <_> + 9 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 5 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 13 9 4 10 -1. + <_> + 13 14 4 5 2. + <_> + + <_> + 3 12 10 8 -1. + <_> + 3 12 5 4 2. + <_> + 8 16 5 4 2. + <_> + + <_> + 12 1 7 4 -1. + <_> + 12 3 7 2 2. + <_> + + <_> + 2 4 12 6 -1. + <_> + 2 6 12 2 3. + <_> + + <_> + 13 10 5 6 -1. + <_> + 13 13 5 3 2. + <_> + + <_> + 2 10 5 6 -1. + <_> + 2 13 5 3 2. + <_> + + <_> + 12 1 7 4 -1. + <_> + 12 3 7 2 2. + <_> + + <_> + 5 5 9 10 -1. + <_> + 5 10 9 5 2. + <_> + + <_> + 12 1 7 4 -1. + <_> + 12 3 7 2 2. + <_> + + <_> + 0 0 17 2 -1. + <_> + 0 1 17 1 2. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 11 10 6 8 -1. + <_> + 13 10 2 8 3. + <_> + + <_> + 3 10 6 8 -1. + <_> + 5 10 2 8 3. + <_> + + <_> + 5 1 10 12 -1. + <_> + 5 7 10 6 2. + <_> + + <_> + 1 1 7 4 -1. + <_> + 1 3 7 2 2. + <_> + + <_> + 10 10 8 6 -1. + <_> + 10 12 8 2 3. + <_> + + <_> + 0 7 8 6 -1. + <_> + 0 9 8 2 3. + <_> + + <_> + 5 11 10 6 -1. + <_> + 10 11 5 3 2. + <_> + 5 14 5 3 2. + <_> + + <_> + 0 8 20 3 -1. + <_> + 0 9 20 1 3. + <_> + + <_> + 7 11 13 3 -1. + <_> + 7 12 13 1 3. + <_> + + <_> + 2 7 15 5 -1. + <_> + 7 7 5 5 3. + <_> + + <_> + 2 9 16 6 -1. + <_> + 2 9 8 6 2. + <_> + + <_> + 0 4 5 6 -1. + <_> + 0 7 5 3 2. + <_> + + <_> + 4 12 12 5 -1. + <_> + 8 12 4 5 3. + <_> + + <_> + 2 16 16 4 -1. + <_> + 2 16 8 2 2. + <_> + 10 18 8 2 2. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 6 14 13 3 -1. + <_> + 6 15 13 1 3. + <_> + + <_> + 2 14 13 3 -1. + <_> + 2 15 13 1 3. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 0 4 6 7 -1. + <_> + 2 4 2 7 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 7 0 6 20 -1. + <_> + 9 0 2 20 3. + <_> + + <_> + 9 5 3 13 -1. + <_> + 10 5 1 13 3. + <_> + + <_> + 5 1 10 9 -1. + <_> + 5 4 10 3 3. + <_> + + <_> + 12 5 8 8 -1. + <_> + 16 5 4 4 2. + <_> + 12 9 4 4 2. + <_> + + <_> + 6 0 8 8 -1. + <_> + 6 4 8 4 2. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 10 6 10 6 -1. + <_> + 15 6 5 3 2. + <_> + 10 9 5 3 2. + <_> + + <_> + 0 6 10 6 -1. + <_> + 0 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 13 2 6 6 -1. + <_> + 13 2 3 6 2. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 7 6 10 14 -1. + <_> + 12 6 5 7 2. + <_> + 7 13 5 7 2. + <_> + + <_> + 1 1 18 3 -1. + <_> + 1 2 18 1 3. + <_> + + <_> + 0 9 20 3 -1. + <_> + 0 10 20 1 3. + <_> + + <_> + 2 12 7 6 -1. + <_> + 2 14 7 2 3. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 2 15 7 4 -1. + <_> + 2 17 7 2 2. + <_> + + <_> + 9 0 2 13 -1. + <_> + 9 0 1 13 2. + <_> + + <_> + 4 0 9 6 -1. + <_> + 7 0 3 6 3. + <_> + + <_> + 11 6 5 6 -1. + <_> + 11 9 5 3 2. + <_> + + <_> + 3 6 10 14 -1. + <_> + 3 6 5 7 2. + <_> + 8 13 5 7 2. + <_> + + <_> + 6 4 12 12 -1. + <_> + 12 4 6 6 2. + <_> + 6 10 6 6 2. + <_> + + <_> + 4 6 5 6 -1. + <_> + 4 9 5 3 2. + <_> + + <_> + 5 1 14 5 -1. + <_> + 5 1 7 5 2. + <_> + + <_> + 9 4 2 16 -1. + <_> + 9 12 2 8 2. + <_> + + <_> + 13 12 7 4 -1. + <_> + 13 14 7 2 2. + <_> + + <_> + 3 12 5 6 -1. + <_> + 3 15 5 3 2. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 5 2. + <_> + 14 15 3 5 2. + <_> + + <_> + 1 3 8 4 -1. + <_> + 5 3 4 4 2. + <_> + + <_> + 9 14 10 6 -1. + <_> + 14 14 5 3 2. + <_> + 9 17 5 3 2. + <_> + + <_> + 3 0 3 13 -1. + <_> + 4 0 1 13 3. + <_> + + <_> + 10 10 10 10 -1. + <_> + 15 10 5 5 2. + <_> + 10 15 5 5 2. + <_> + + <_> + 0 6 8 14 -1. + <_> + 4 6 4 14 2. + <_> + + <_> + 4 3 12 12 -1. + <_> + 10 3 6 6 2. + <_> + 4 9 6 6 2. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 9 6 3 13 -1. + <_> + 10 6 1 13 3. + <_> + + <_> + 4 1 10 5 -1. + <_> + 9 1 5 5 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 3 2 12 6 -1. + <_> + 3 2 6 3 2. + <_> + 9 5 6 3 2. + <_> + + <_> + 2 2 18 4 -1. + <_> + 11 2 9 2 2. + <_> + 2 4 9 2 2. + <_> + + <_> + 3 2 11 6 -1. + <_> + 3 4 11 2 3. + <_> + + <_> + 12 0 8 12 -1. + <_> + 16 0 4 6 2. + <_> + 12 6 4 6 2. + <_> + + <_> + 0 0 8 12 -1. + <_> + 0 0 4 6 2. + <_> + 4 6 4 6 2. + <_> + + <_> + 7 1 6 10 -1. + <_> + 10 1 3 5 2. + <_> + 7 6 3 5 2. + <_> + + <_> + 0 0 13 3 -1. + <_> + 0 1 13 1 3. + <_> + + <_> + 4 5 13 3 -1. + <_> + 4 6 13 1 3. + <_> + + <_> + 3 12 7 6 -1. + <_> + 3 14 7 2 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 8 1 7 6 -1. + <_> + 8 3 7 2 3. + <_> + + <_> + 0 8 12 7 -1. + <_> + 6 8 6 7 2. + <_> + + <_> + 0 1 20 4 -1. + <_> + 10 1 10 2 2. + <_> + 0 3 10 2 2. + <_> + + <_> + 0 10 20 3 -1. + <_> + 0 11 20 1 3. + <_> + + <_> + 12 1 2 14 -1. + <_> + 12 1 1 14 2. + <_> + + <_> + 1 7 18 10 -1. + <_> + 7 7 6 10 3. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 14 1 3 14 -1. + <_> + 15 1 1 14 3. + <_> + + <_> + 5 8 6 5 -1. + <_> + 8 8 3 5 2. + <_> + + <_> + 14 1 3 14 -1. + <_> + 15 1 1 14 3. + <_> + + <_> + 3 1 3 14 -1. + <_> + 4 1 1 14 3. + <_> + + <_> + 0 16 20 2 -1. + <_> + 0 17 20 1 2. + <_> + + <_> + 6 6 4 14 -1. + <_> + 8 6 2 14 2. + <_> + + <_> + 9 6 3 13 -1. + <_> + 10 6 1 13 3. + <_> + + <_> + 1 9 7 6 -1. + <_> + 1 11 7 2 3. + <_> + + <_> + 9 3 5 9 -1. + <_> + 9 6 5 3 3. + <_> + + <_> + 2 13 9 6 -1. + <_> + 5 13 3 6 3. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 9 14 10 6 -1. + <_> + 14 14 5 3 2. + <_> + 9 17 5 3 2. + <_> + + <_> + 1 14 10 6 -1. + <_> + 1 14 5 3 2. + <_> + 6 17 5 3 2. + <_> + + <_> + 11 13 7 6 -1. + <_> + 11 15 7 2 3. + <_> + + <_> + 1 8 8 12 -1. + <_> + 1 8 4 6 2. + <_> + 5 14 4 6 2. + <_> + + <_> + 5 7 15 5 -1. + <_> + 10 7 5 5 3. + <_> + + <_> + 0 7 15 5 -1. + <_> + 5 7 5 5 3. + <_> + + <_> + 12 13 8 6 -1. + <_> + 12 15 8 2 3. + <_> + + <_> + 8 10 4 10 -1. + <_> + 8 15 4 5 2. + <_> + + <_> + 1 6 19 3 -1. + <_> + 1 7 19 1 3. + <_> + + <_> + 7 8 6 9 -1. + <_> + 7 11 6 3 3. + <_> + + <_> + 11 2 8 8 -1. + <_> + 15 2 4 4 2. + <_> + 11 6 4 4 2. + <_> + + <_> + 8 6 3 14 -1. + <_> + 9 6 1 14 3. + <_> + + <_> + 9 2 3 13 -1. + <_> + 10 2 1 13 3. + <_> + + <_> + 8 2 3 13 -1. + <_> + 9 2 1 13 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 3 2 3 18 -1. + <_> + 3 8 3 6 3. + <_> + + <_> + 1 5 18 10 -1. + <_> + 10 5 9 5 2. + <_> + 1 10 9 5 2. + <_> + + <_> + 6 1 2 13 -1. + <_> + 7 1 1 13 2. + <_> + + <_> + 11 0 8 6 -1. + <_> + 11 2 8 2 3. + <_> + + <_> + 4 0 7 6 -1. + <_> + 4 2 7 2 3. + <_> + + <_> + 0 2 10 3 -1. + <_> + 5 2 5 3 2. + <_> + + <_> + 1 4 19 4 -1. + <_> + 1 6 19 2 2. + <_> + + <_> + 5 7 6 5 -1. + <_> + 8 7 3 5 2. + <_> + + <_> + 11 10 5 6 -1. + <_> + 11 13 5 3 2. + <_> + + <_> + 7 8 4 12 -1. + <_> + 7 12 4 4 3. + <_> + + <_> + 10 1 10 19 -1. + <_> + 10 1 5 19 2. + <_> + + <_> + 0 1 10 19 -1. + <_> + 5 1 5 19 2. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 2 7 7 6 -1. + <_> + 2 9 7 2 3. + <_> + + <_> + 10 5 10 12 -1. + <_> + 10 11 10 6 2. + <_> + + <_> + 5 10 4 8 -1. + <_> + 5 14 4 4 2. + <_> + + <_> + 7 5 8 12 -1. + <_> + 11 5 4 6 2. + <_> + 7 11 4 6 2. + <_> + + <_> + 5 5 8 12 -1. + <_> + 5 5 4 6 2. + <_> + 9 11 4 6 2. + <_> + + <_> + 14 1 6 8 -1. + <_> + 16 1 2 8 3. + <_> + + <_> + 0 1 6 9 -1. + <_> + 2 1 2 9 3. + <_> + + <_> + 1 6 18 4 -1. + <_> + 7 6 6 4 3. + <_> + + <_> + 3 12 13 2 -1. + <_> + 3 13 13 1 2. + <_> + + <_> + 3 3 14 2 -1. + <_> + 3 4 14 1 2. + <_> + + <_> + 2 0 13 6 -1. + <_> + 2 2 13 2 3. + <_> + + <_> + 12 11 7 6 -1. + <_> + 12 13 7 2 3. + <_> + + <_> + 3 8 13 2 -1. + <_> + 3 9 13 1 2. + <_> + + <_> + 12 0 4 14 -1. + <_> + 14 0 2 7 2. + <_> + 12 7 2 7 2. + <_> + + <_> + 1 14 13 3 -1. + <_> + 1 15 13 1 3. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 1 0 6 12 -1. + <_> + 4 0 3 12 2. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 0 0 6 5 -1. + <_> + 3 0 3 5 2. + <_> + + <_> + 5 1 15 3 -1. + <_> + 5 2 15 1 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 12 11 7 6 -1. + <_> + 12 13 7 2 3. + <_> + + <_> + 1 11 7 6 -1. + <_> + 1 13 7 2 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 2 14 13 3 -1. + <_> + 2 15 13 1 3. + <_> + + <_> + 0 5 20 10 -1. + <_> + 10 5 10 5 2. + <_> + 0 10 10 5 2. + <_> + + <_> + 4 6 4 7 -1. + <_> + 6 6 2 7 2. + <_> + + <_> + 4 6 14 6 -1. + <_> + 11 6 7 3 2. + <_> + 4 9 7 3 2. + <_> + + <_> + 5 6 6 8 -1. + <_> + 5 10 6 4 2. + <_> + + <_> + 14 10 6 10 -1. + <_> + 14 10 3 10 2. + <_> + + <_> + 2 18 13 2 -1. + <_> + 2 19 13 1 2. + <_> + + <_> + 2 12 16 4 -1. + <_> + 2 14 16 2 2. + <_> + + <_> + 1 6 10 6 -1. + <_> + 1 6 5 3 2. + <_> + 6 9 5 3 2. + <_> + + <_> + 14 10 6 10 -1. + <_> + 14 10 3 10 2. + <_> + + <_> + 0 10 6 10 -1. + <_> + 3 10 3 10 2. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 0 0 4 17 -1. + <_> + 2 0 2 17 2. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 2 4 6 16 -1. + <_> + 2 4 3 8 2. + <_> + 5 12 3 8 2. + <_> + + <_> + 5 6 10 8 -1. + <_> + 10 6 5 4 2. + <_> + 5 10 5 4 2. + <_> + + <_> + 4 6 8 8 -1. + <_> + 4 6 4 4 2. + <_> + 8 10 4 4 2. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 4 2 12 5 -1. + <_> + 8 2 4 5 3. + <_> + + <_> + 11 2 2 18 -1. + <_> + 11 2 1 18 2. + <_> + + <_> + 8 6 4 7 -1. + <_> + 10 6 2 7 2. + <_> + + <_> + 6 9 8 8 -1. + <_> + 10 9 4 4 2. + <_> + 6 13 4 4 2. + <_> + + <_> + 0 5 20 5 -1. + <_> + 10 5 10 5 2. + <_> + + <_> + 4 4 12 4 -1. + <_> + 4 6 12 2 2. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 3 15 16 4 -1. + <_> + 11 15 8 2 2. + <_> + 3 17 8 2 2. + <_> + + <_> + 1 15 16 4 -1. + <_> + 1 15 8 2 2. + <_> + 9 17 8 2 2. + <_> + + <_> + 4 14 13 3 -1. + <_> + 4 15 13 1 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 6 11 8 9 -1. + <_> + 6 14 8 3 3. + <_> + + <_> + 3 8 14 3 -1. + <_> + 3 9 14 1 3. + <_> + + <_> + 4 15 13 3 -1. + <_> + 4 16 13 1 3. + <_> + + <_> + 0 10 5 9 -1. + <_> + 0 13 5 3 3. + <_> + + <_> + 12 10 8 4 -1. + <_> + 12 12 8 2 2. + <_> + + <_> + 0 10 8 4 -1. + <_> + 0 12 8 2 2. + <_> + + <_> + 5 1 10 6 -1. + <_> + 5 3 10 2 3. + <_> + + <_> + 0 0 7 6 -1. + <_> + 0 2 7 2 3. + <_> + + <_> + 3 6 14 9 -1. + <_> + 3 9 14 3 3. + <_> + + <_> + 7 6 6 10 -1. + <_> + 9 6 2 10 3. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 3 0 6 9 -1. + <_> + 5 0 2 9 3. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 0 0 4 17 -1. + <_> + 2 0 2 17 2. + <_> + + <_> + 8 0 12 16 -1. + <_> + 12 0 4 16 3. + <_> + + <_> + 0 0 12 16 -1. + <_> + 4 0 4 16 3. + <_> + + <_> + 5 6 10 6 -1. + <_> + 5 9 10 3 2. + <_> + + <_> + 7 4 2 14 -1. + <_> + 8 4 1 14 2. + <_> + + <_> + 16 5 4 14 -1. + <_> + 18 5 2 7 2. + <_> + 16 12 2 7 2. + <_> + + <_> + 4 4 6 8 -1. + <_> + 6 4 2 8 3. + <_> + + <_> + 5 4 14 3 -1. + <_> + 5 5 14 1 3. + <_> + + <_> + 3 4 13 3 -1. + <_> + 3 5 13 1 3. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 0 13 9 6 -1. + <_> + 0 15 9 2 3. + <_> + + <_> + 8 10 10 6 -1. + <_> + 8 12 10 2 3. + <_> + + <_> + 8 5 4 7 -1. + <_> + 10 5 2 7 2. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 13 0 3 19 -1. + <_> + 14 0 1 19 3. + <_> + + <_> + 4 0 3 19 -1. + <_> + 5 0 1 19 3. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 7 7 6 9 -1. + <_> + 7 10 6 3 3. + <_> + + <_> + 6 4 4 15 -1. + <_> + 6 9 4 5 3. + <_> + + <_> + 14 0 6 7 -1. + <_> + 16 0 2 7 3. + <_> + + <_> + 2 4 14 12 -1. + <_> + 2 4 7 6 2. + <_> + 9 10 7 6 2. + <_> + + <_> + 4 15 12 5 -1. + <_> + 4 15 6 5 2. + <_> + + <_> + 4 6 10 3 -1. + <_> + 9 6 5 3 2. + <_> + + <_> + 16 6 4 14 -1. + <_> + 18 6 2 7 2. + <_> + 16 13 2 7 2. + <_> + + <_> + 0 6 4 14 -1. + <_> + 0 6 2 7 2. + <_> + 2 13 2 7 2. + <_> + + <_> + 11 14 8 6 -1. + <_> + 11 16 8 2 3. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 2 17 18 3 -1. + <_> + 8 17 6 3 3. + <_> + + <_> + 7 1 5 12 -1. + <_> + 7 7 5 6 2. + <_> + + <_> + 5 0 10 8 -1. + <_> + 5 4 10 4 2. + <_> + + <_> + 0 1 15 12 -1. + <_> + 0 5 15 4 3. + <_> + + <_> + 7 3 6 10 -1. + <_> + 7 8 6 5 2. + <_> + + <_> + 6 4 4 16 -1. + <_> + 6 4 2 8 2. + <_> + 8 12 2 8 2. + <_> + + <_> + 1 4 18 4 -1. + <_> + 7 4 6 4 3. + <_> + + <_> + 0 3 12 6 -1. + <_> + 0 3 6 3 2. + <_> + 6 6 6 3 2. + <_> + + <_> + 12 1 8 10 -1. + <_> + 16 1 4 5 2. + <_> + 12 6 4 5 2. + <_> + + <_> + 0 1 8 10 -1. + <_> + 0 1 4 5 2. + <_> + 4 6 4 5 2. + <_> + + <_> + 6 12 8 8 -1. + <_> + 10 12 4 4 2. + <_> + 6 16 4 4 2. + <_> + + <_> + 5 8 8 12 -1. + <_> + 5 8 4 6 2. + <_> + 9 14 4 6 2. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 3 11 14 6 -1. + <_> + 3 11 7 3 2. + <_> + 10 14 7 3 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 11 4 4 12 -1. + <_> + 11 4 2 12 2. + <_> + + <_> + 7 4 5 14 -1. + <_> + 7 11 5 7 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 5 4 4 12 -1. + <_> + 7 4 2 12 2. + <_> + + <_> + 4 11 12 7 -1. + <_> + 4 11 6 7 2. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 5 6 12 6 -1. + <_> + 11 6 6 3 2. + <_> + 5 9 6 3 2. + <_> + + <_> + 3 11 14 4 -1. + <_> + 3 11 7 2 2. + <_> + 10 13 7 2 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 4 0 12 10 -1. + <_> + 4 0 6 5 2. + <_> + 10 5 6 5 2. + <_> + + <_> + 8 5 12 15 -1. + <_> + 8 5 6 15 2. + <_> + + <_> + 1 12 14 3 -1. + <_> + 1 13 14 1 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 2 17 16 3 -1. + <_> + 10 17 8 3 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 7 8 4 9 -1. + <_> + 9 8 2 9 2. + <_> + + <_> + 4 3 12 12 -1. + <_> + 10 3 6 6 2. + <_> + 4 9 6 6 2. + <_> + + <_> + 0 0 6 20 -1. + <_> + 3 0 3 20 2. + <_> + + <_> + 11 12 7 6 -1. + <_> + 11 14 7 2 3. + <_> + + <_> + 3 13 14 2 -1. + <_> + 3 14 14 1 2. + <_> + + <_> + 13 11 7 4 -1. + <_> + 13 13 7 2 2. + <_> + + <_> + 0 0 3 13 -1. + <_> + 1 0 1 13 3. + <_> + + <_> + 13 1 6 12 -1. + <_> + 15 1 2 12 3. + <_> + + <_> + 1 1 6 12 -1. + <_> + 3 1 2 12 3. + <_> + + <_> + 4 8 14 12 -1. + <_> + 4 12 14 4 3. + <_> + + <_> + 0 6 6 12 -1. + <_> + 3 6 3 12 2. + <_> + + <_> + 13 1 3 13 -1. + <_> + 14 1 1 13 3. + <_> + + <_> + 4 1 3 13 -1. + <_> + 5 1 1 13 3. + <_> + + <_> + 16 2 3 14 -1. + <_> + 17 2 1 14 3. + <_> + + <_> + 1 2 3 14 -1. + <_> + 2 2 1 14 3. + <_> + + <_> + 6 9 14 3 -1. + <_> + 6 10 14 1 3. + <_> + + <_> + 0 9 14 3 -1. + <_> + 0 10 14 1 3. + <_> + + <_> + 4 6 14 6 -1. + <_> + 11 6 7 3 2. + <_> + 4 9 7 3 2. + <_> + + <_> + 2 6 14 6 -1. + <_> + 2 6 7 3 2. + <_> + 9 9 7 3 2. + <_> + + <_> + 10 9 6 5 -1. + <_> + 10 9 3 5 2. + <_> + + <_> + 3 1 10 16 -1. + <_> + 3 1 5 8 2. + <_> + 8 9 5 8 2. + <_> + + <_> + 3 7 14 12 -1. + <_> + 10 7 7 6 2. + <_> + 3 13 7 6 2. + <_> + + <_> + 2 2 13 6 -1. + <_> + 2 5 13 3 2. + <_> + + <_> + 14 1 6 6 -1. + <_> + 14 4 6 3 2. + <_> + + <_> + 0 1 6 6 -1. + <_> + 0 4 6 3 2. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 2 0 4 14 -1. + <_> + 4 0 2 14 2. + <_> + + <_> + 4 6 12 4 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 1 8 18 3 -1. + <_> + 7 8 6 3 3. + <_> + + <_> + 4 7 13 2 -1. + <_> + 4 8 13 1 2. + <_> + + <_> + 2 1 16 6 -1. + <_> + 2 1 8 3 2. + <_> + 10 4 8 3 2. + <_> + + <_> + 9 5 7 9 -1. + <_> + 9 8 7 3 3. + <_> + + <_> + 2 9 8 8 -1. + <_> + 2 9 4 4 2. + <_> + 6 13 4 4 2. + <_> + + <_> + 2 17 18 3 -1. + <_> + 8 17 6 3 3. + <_> + + <_> + 1 14 12 6 -1. + <_> + 1 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 13 10 7 6 -1. + <_> + 13 12 7 2 3. + <_> + + <_> + 0 10 7 6 -1. + <_> + 0 12 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 1 15 14 2 -1. + <_> + 1 16 14 1 2. + <_> + + <_> + 13 12 7 6 -1. + <_> + 13 14 7 2 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 7 13 7 6 -1. + <_> + 7 15 7 2 3. + <_> + + <_> + 5 5 6 10 -1. + <_> + 5 5 3 5 2. + <_> + 8 10 3 5 2. + <_> + + <_> + 5 4 10 4 -1. + <_> + 5 6 10 2 2. + <_> + + <_> + 1 0 18 20 -1. + <_> + 7 0 6 20 3. + <_> + + <_> + 7 15 7 4 -1. + <_> + 7 17 7 2 2. + <_> + + <_> + 0 5 9 7 -1. + <_> + 3 5 3 7 3. + <_> + + <_> + 11 9 4 8 -1. + <_> + 11 13 4 4 2. + <_> + + <_> + 0 3 20 10 -1. + <_> + 0 8 20 5 2. + <_> + + <_> + 7 0 6 12 -1. + <_> + 9 0 2 12 3. + <_> + + <_> + 3 16 14 4 -1. + <_> + 3 18 14 2 2. + <_> + + <_> + 11 9 4 8 -1. + <_> + 11 13 4 4 2. + <_> + + <_> + 5 9 4 8 -1. + <_> + 5 13 4 4 2. + <_> + + <_> + 6 11 13 3 -1. + <_> + 6 12 13 1 3. + <_> + + <_> + 0 0 19 6 -1. + <_> + 0 2 19 2 3. + <_> + + <_> + 2 3 16 2 -1. + <_> + 2 4 16 1 2. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 7 1 3 12 -1. + <_> + 7 7 3 6 2. + <_> + + <_> + 12 4 4 10 -1. + <_> + 12 9 4 5 2. + <_> + + <_> + 0 2 13 2 -1. + <_> + 0 3 13 1 2. + <_> + + <_> + 7 6 8 4 -1. + <_> + 7 6 4 4 2. + <_> + + <_> + 5 6 8 4 -1. + <_> + 9 6 4 4 2. + <_> + + <_> + 3 11 14 4 -1. + <_> + 10 11 7 2 2. + <_> + 3 13 7 2 2. + <_> + + <_> + 3 10 14 4 -1. + <_> + 3 10 7 2 2. + <_> + 10 12 7 2 2. + <_> + + <_> + 6 6 14 3 -1. + <_> + 6 7 14 1 3. + <_> + + <_> + 0 9 20 3 -1. + <_> + 0 10 20 1 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 9 3 2 13 -1. + <_> + 10 3 1 13 2. + <_> + + <_> + 9 0 3 13 -1. + <_> + 10 0 1 13 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 12 12 7 4 -1. + <_> + 12 14 7 2 2. + <_> + + <_> + 1 12 7 4 -1. + <_> + 1 14 7 2 2. + <_> + + <_> + 7 10 6 10 -1. + <_> + 10 10 3 5 2. + <_> + 7 15 3 5 2. + <_> + + <_> + 1 17 13 3 -1. + <_> + 1 18 13 1 3. + <_> + + <_> + 4 0 16 9 -1. + <_> + 4 0 8 9 2. + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 3 20 4 -1. + <_> + 0 3 10 2 2. + <_> + 10 5 10 2 2. + <_> + + <_> + 12 13 8 6 -1. + <_> + 12 15 8 2 3. + <_> + + <_> + 6 1 2 16 -1. + <_> + 7 1 1 16 2. + <_> + + <_> + 10 0 10 19 -1. + <_> + 10 0 5 19 2. + <_> + + <_> + 2 0 14 18 -1. + <_> + 9 0 7 18 2. + <_> + + <_> + 9 3 5 9 -1. + <_> + 9 6 5 3 3. + <_> + + <_> + 0 0 10 19 -1. + <_> + 5 0 5 19 2. + <_> + + <_> + 14 0 3 14 -1. + <_> + 15 0 1 14 3. + <_> + + <_> + 3 0 3 14 -1. + <_> + 4 0 1 14 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 3 13 13 3 -1. + <_> + 3 14 13 1 3. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 0 10 13 3 -1. + <_> + 0 11 13 1 3. + <_> + + <_> + 12 11 5 9 -1. + <_> + 12 14 5 3 3. + <_> + + <_> + 0 14 7 6 -1. + <_> + 0 16 7 2 3. + <_> + + <_> + 12 5 4 8 -1. + <_> + 12 9 4 4 2. + <_> + + <_> + 0 13 8 6 -1. + <_> + 0 15 8 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 2 5 16 8 -1. + <_> + 2 5 8 4 2. + <_> + 10 9 8 4 2. + <_> + + <_> + 14 3 6 8 -1. + <_> + 16 3 2 8 3. + <_> + + <_> + 8 4 3 10 -1. + <_> + 8 9 3 5 2. + <_> + + <_> + 9 6 4 8 -1. + <_> + 9 10 4 4 2. + <_> + + <_> + 0 4 6 7 -1. + <_> + 2 4 2 7 3. + <_> + + <_> + 5 1 10 6 -1. + <_> + 5 4 10 3 2. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 10 4 8 8 -1. + <_> + 14 4 4 4 2. + <_> + 10 8 4 4 2. + <_> + + <_> + 0 15 13 3 -1. + <_> + 0 16 13 1 3. + <_> + + <_> + 10 4 8 8 -1. + <_> + 14 4 4 4 2. + <_> + 10 8 4 4 2. + <_> + + <_> + 2 4 8 8 -1. + <_> + 2 4 4 4 2. + <_> + 6 8 4 4 2. + <_> + + <_> + 13 0 2 20 -1. + <_> + 13 0 1 20 2. + <_> + + <_> + 3 14 7 6 -1. + <_> + 3 16 7 2 3. + <_> + + <_> + 2 2 18 4 -1. + <_> + 8 2 6 4 3. + <_> + + <_> + 6 0 6 10 -1. + <_> + 6 0 3 5 2. + <_> + 9 5 3 5 2. + <_> + + <_> + 4 6 16 3 -1. + <_> + 4 6 8 3 2. + <_> + + <_> + 0 6 16 3 -1. + <_> + 8 6 8 3 2. + <_> + + <_> + 13 0 2 20 -1. + <_> + 13 0 1 20 2. + <_> + + <_> + 2 1 16 3 -1. + <_> + 2 2 16 1 3. + <_> + + <_> + 13 0 2 20 -1. + <_> + 13 0 1 20 2. + <_> + + <_> + 5 0 2 20 -1. + <_> + 6 0 1 20 2. + <_> + + <_> + 5 0 15 8 -1. + <_> + 10 0 5 8 3. + <_> + + <_> + 0 0 15 8 -1. + <_> + 5 0 5 8 3. + <_> + + <_> + 11 3 6 7 -1. + <_> + 13 3 2 7 3. + <_> + + <_> + 3 3 6 7 -1. + <_> + 5 3 2 7 3. + <_> + + <_> + 9 0 2 13 -1. + <_> + 9 0 1 13 2. + <_> + + <_> + 8 4 3 13 -1. + <_> + 9 4 1 13 3. + <_> + + <_> + 4 6 12 4 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 3 1 6 10 -1. + <_> + 3 1 3 5 2. + <_> + 6 6 3 5 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 4 6 9 12 -1. + <_> + 4 12 9 6 2. + <_> + + <_> + 4 4 13 3 -1. + <_> + 4 5 13 1 3. + <_> + + <_> + 1 7 18 3 -1. + <_> + 1 8 18 1 3. + <_> + + <_> + 6 7 13 2 -1. + <_> + 6 8 13 1 2. + <_> + + <_> + 6 3 7 16 -1. + <_> + 6 11 7 8 2. + <_> + + <_> + 8 11 6 9 -1. + <_> + 10 11 2 9 3. + <_> + + <_> + 6 11 6 9 -1. + <_> + 8 11 2 9 3. + <_> + + <_> + 10 5 3 13 -1. + <_> + 11 5 1 13 3. + <_> + + <_> + 7 4 3 13 -1. + <_> + 8 4 1 13 3. + <_> + + <_> + 7 13 6 7 -1. + <_> + 9 13 2 7 3. + <_> + + <_> + 0 14 12 6 -1. + <_> + 0 14 6 3 2. + <_> + 6 17 6 3 2. + <_> + + <_> + 14 13 5 6 -1. + <_> + 14 16 5 3 2. + <_> + + <_> + 1 13 5 6 -1. + <_> + 1 16 5 3 2. + <_> + + <_> + 4 5 13 2 -1. + <_> + 4 6 13 1 2. + <_> + + <_> + 0 10 20 6 -1. + <_> + 0 10 10 3 2. + <_> + 10 13 10 3 2. + <_> + + <_> + 8 5 4 14 -1. + <_> + 10 5 2 7 2. + <_> + 8 12 2 7 2. + <_> + + <_> + 6 8 8 8 -1. + <_> + 6 8 4 4 2. + <_> + 10 12 4 4 2. + <_> + + <_> + 13 10 5 9 -1. + <_> + 13 13 5 3 3. + <_> + + <_> + 5 0 10 12 -1. + <_> + 5 0 5 6 2. + <_> + 10 6 5 6 2. + <_> + + <_> + 10 10 6 7 -1. + <_> + 12 10 2 7 3. + <_> + + <_> + 2 10 5 9 -1. + <_> + 2 13 5 3 3. + <_> + + <_> + 0 0 20 2 -1. + <_> + 0 0 10 2 2. + <_> + + <_> + 1 0 4 18 -1. + <_> + 3 0 2 18 2. + <_> + + <_> + 15 2 5 6 -1. + <_> + 15 5 5 3 2. + <_> + + <_> + 2 4 14 6 -1. + <_> + 2 4 7 3 2. + <_> + 9 7 7 3 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 8 14 10 6 -1. + <_> + 13 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 3 3 5 12 -1. + <_> + 3 9 5 6 2. + <_> + + <_> + 2 4 17 15 -1. + <_> + 2 9 17 5 3. + <_> + + <_> + 3 0 13 12 -1. + <_> + 3 4 13 4 3. + <_> + + <_> + 2 17 18 3 -1. + <_> + 2 18 18 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 2 0 18 6 -1. + <_> + 8 0 6 6 3. + <_> + + <_> + 0 0 18 9 -1. + <_> + 6 0 6 9 3. + <_> + + <_> + 10 2 6 7 -1. + <_> + 12 2 2 7 3. + <_> + + <_> + 1 6 15 4 -1. + <_> + 6 6 5 4 3. + <_> + + <_> + 5 1 12 9 -1. + <_> + 5 4 12 3 3. + <_> + + <_> + 6 7 4 12 -1. + <_> + 6 13 4 6 2. + <_> + + <_> + 10 6 6 10 -1. + <_> + 12 6 2 10 3. + <_> + + <_> + 3 12 9 4 -1. + <_> + 3 14 9 2 2. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 4 3 5 9 -1. + <_> + 4 6 5 3 3. + <_> + + <_> + 1 7 18 5 -1. + <_> + 7 7 6 5 3. + <_> + + <_> + 6 4 6 8 -1. + <_> + 8 4 2 8 3. + <_> + + <_> + 10 1 6 8 -1. + <_> + 12 1 2 8 3. + <_> + + <_> + 4 2 6 7 -1. + <_> + 6 2 2 7 3. + <_> + + <_> + 7 0 13 2 -1. + <_> + 7 1 13 1 2. + <_> + + <_> + 0 4 18 5 -1. + <_> + 6 4 6 5 3. + <_> + + <_> + 10 5 6 11 -1. + <_> + 12 5 2 11 3. + <_> + + <_> + 3 5 4 11 -1. + <_> + 5 5 2 11 2. + <_> + + <_> + 9 9 9 10 -1. + <_> + 12 9 3 10 3. + <_> + + <_> + 2 9 9 10 -1. + <_> + 5 9 3 10 3. + <_> + + <_> + 7 7 6 9 -1. + <_> + 9 7 2 9 3. + <_> + + <_> + 5 0 6 15 -1. + <_> + 7 0 2 15 3. + <_> + + <_> + 6 12 10 6 -1. + <_> + 11 12 5 3 2. + <_> + 6 15 5 3 2. + <_> + + <_> + 0 17 15 3 -1. + <_> + 5 17 5 3 3. + <_> + + <_> + 11 10 6 10 -1. + <_> + 14 10 3 5 2. + <_> + 11 15 3 5 2. + <_> + + <_> + 4 12 10 6 -1. + <_> + 4 12 5 3 2. + <_> + 9 15 5 3 2. + <_> + + <_> + 0 0 18 5 -1. + <_> + 6 0 6 5 3. + <_> + + <_> + 2 1 18 6 -1. + <_> + 2 3 18 2 3. + <_> + + <_> + 2 10 9 6 -1. + <_> + 2 12 9 2 3. + <_> + + <_> + 9 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 5 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 7 12 6 7 -1. + <_> + 9 12 2 7 3. + <_> + + <_> + 4 10 5 6 -1. + <_> + 4 13 5 3 2. + <_> + + <_> + 12 2 6 10 -1. + <_> + 15 2 3 5 2. + <_> + 12 7 3 5 2. + <_> + + <_> + 2 10 14 4 -1. + <_> + 2 10 7 2 2. + <_> + 9 12 7 2 2. + <_> + + <_> + 4 6 12 8 -1. + <_> + 4 10 12 4 2. + <_> + + <_> + 2 2 6 10 -1. + <_> + 2 2 3 5 2. + <_> + 5 7 3 5 2. + <_> + + <_> + 6 15 14 2 -1. + <_> + 6 16 14 1 2. + <_> + + <_> + 0 0 6 5 -1. + <_> + 3 0 3 5 2. + <_> + + <_> + 6 2 9 5 -1. + <_> + 9 2 3 5 3. + <_> + + <_> + 1 14 8 6 -1. + <_> + 1 16 8 2 3. + <_> + + <_> + 15 4 4 16 -1. + <_> + 17 4 2 8 2. + <_> + 15 12 2 8 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 4 6 13 3 -1. + <_> + 4 7 13 1 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 2 8 18 2 -1. + <_> + 2 9 18 1 2. + <_> + + <_> + 2 0 14 2 -1. + <_> + 2 1 14 1 2. + <_> + + <_> + 11 10 4 7 -1. + <_> + 11 10 2 7 2. + <_> + + <_> + 4 14 12 6 -1. + <_> + 8 14 4 6 3. + <_> + + <_> + 11 10 4 7 -1. + <_> + 11 10 2 7 2. + <_> + + <_> + 5 10 4 7 -1. + <_> + 7 10 2 7 2. + <_> + + <_> + 9 6 2 14 -1. + <_> + 9 13 2 7 2. + <_> + + <_> + 2 17 15 3 -1. + <_> + 2 18 15 1 3. + <_> + + <_> + 16 1 4 7 -1. + <_> + 16 1 2 7 2. + <_> + + <_> + 5 13 4 7 -1. + <_> + 7 13 2 7 2. + <_> + + <_> + 14 1 6 7 -1. + <_> + 16 1 2 7 3. + <_> + + <_> + 0 1 6 7 -1. + <_> + 2 1 2 7 3. + <_> + + <_> + 4 3 13 2 -1. + <_> + 4 4 13 1 2. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 0 2 6 14 -1. + <_> + 2 2 2 14 3. + <_> + + <_> + 13 0 6 13 -1. + <_> + 15 0 2 13 3. + <_> + + <_> + 1 0 6 13 -1. + <_> + 3 0 2 13 3. + <_> + + <_> + 0 3 20 4 -1. + <_> + 10 3 10 2 2. + <_> + 0 5 10 2 2. + <_> + + <_> + 0 7 12 11 -1. + <_> + 6 7 6 11 2. + <_> + + <_> + 7 11 7 6 -1. + <_> + 7 13 7 2 3. + <_> + + <_> + 0 6 10 6 -1. + <_> + 0 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 10 7 4 12 -1. + <_> + 10 7 2 12 2. + <_> + + <_> + 4 7 11 4 -1. + <_> + 4 9 11 2 2. + <_> + + <_> + 5 7 10 6 -1. + <_> + 10 7 5 3 2. + <_> + 5 10 5 3 2. + <_> + + <_> + 0 5 18 10 -1. + <_> + 0 5 9 5 2. + <_> + 9 10 9 5 2. + <_> + + <_> + 0 0 20 4 -1. + <_> + 10 0 10 2 2. + <_> + 0 2 10 2 2. + <_> + + <_> + 2 4 13 3 -1. + <_> + 2 5 13 1 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 2 4 13 2 -1. + <_> + 2 5 13 1 2. + <_> + + <_> + 7 0 13 3 -1. + <_> + 7 1 13 1 3. + <_> + + <_> + 1 0 6 10 -1. + <_> + 1 0 3 5 2. + <_> + 4 5 3 5 2. + <_> + + <_> + 10 6 9 14 -1. + <_> + 13 6 3 14 3. + <_> + + <_> + 1 6 9 14 -1. + <_> + 4 6 3 14 3. + <_> + + <_> + 8 1 5 10 -1. + <_> + 8 6 5 5 2. + <_> + + <_> + 0 3 20 8 -1. + <_> + 0 7 20 4 2. + <_> + + <_> + 4 9 14 2 -1. + <_> + 4 10 14 1 2. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 3 13 14 6 -1. + <_> + 3 15 14 2 3. + <_> + + <_> + 6 11 13 9 -1. + <_> + 6 14 13 3 3. + <_> + + <_> + 1 11 13 9 -1. + <_> + 1 14 13 3 3. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 3 5 12 4 -1. + <_> + 7 5 4 4 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 0 0 18 4 -1. + <_> + 6 0 6 4 3. + <_> + + <_> + 9 1 4 10 -1. + <_> + 9 6 4 5 2. + <_> + + <_> + 0 2 13 2 -1. + <_> + 0 3 13 1 2. + <_> + + <_> + 7 1 8 8 -1. + <_> + 11 1 4 4 2. + <_> + 7 5 4 4 2. + <_> + + <_> + 5 7 6 12 -1. + <_> + 5 7 3 6 2. + <_> + 8 13 3 6 2. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 0 14 20 3 -1. + <_> + 0 15 20 1 3. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 3 0 9 5 -1. + <_> + 6 0 3 5 3. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 5 6 6 7 -1. + <_> + 7 6 2 7 3. + <_> + + <_> + 9 1 3 19 -1. + <_> + 10 1 1 19 3. + <_> + + <_> + 0 11 7 4 -1. + <_> + 0 13 7 2 2. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 0 11 5 6 -1. + <_> + 0 14 5 3 2. + <_> + + <_> + 9 2 10 18 -1. + <_> + 14 2 5 9 2. + <_> + 9 11 5 9 2. + <_> + + <_> + 2 16 8 4 -1. + <_> + 6 16 4 4 2. + <_> + + <_> + 7 4 6 8 -1. + <_> + 9 4 2 8 3. + <_> + + <_> + 7 0 2 19 -1. + <_> + 8 0 1 19 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 0 0 9 5 -1. + <_> + 3 0 3 5 3. + <_> + + <_> + 18 2 2 18 -1. + <_> + 18 2 1 18 2. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 18 2 2 18 -1. + <_> + 18 2 1 18 2. + <_> + + <_> + 0 2 2 18 -1. + <_> + 1 2 1 18 2. + <_> + + <_> + 7 4 7 15 -1. + <_> + 7 9 7 5 3. + <_> + + <_> + 7 13 6 6 -1. + <_> + 7 16 6 3 2. + <_> + + <_> + 8 14 10 6 -1. + <_> + 13 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 0 12 7 6 -1. + <_> + 0 14 7 2 3. + <_> + + <_> + 17 0 3 16 -1. + <_> + 18 0 1 16 3. + <_> + + <_> + 0 4 3 14 -1. + <_> + 1 4 1 14 3. + <_> + + <_> + 14 8 6 5 -1. + <_> + 14 8 3 5 2. + <_> + + <_> + 0 8 6 5 -1. + <_> + 3 8 3 5 2. + <_> + + <_> + 1 13 18 4 -1. + <_> + 10 13 9 2 2. + <_> + 1 15 9 2 2. + <_> + + <_> + 7 0 5 9 -1. + <_> + 7 3 5 3 3. + <_> + + <_> + 6 9 9 5 -1. + <_> + 9 9 3 5 3. + <_> + + <_> + 7 3 3 13 -1. + <_> + 8 3 1 13 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 10 -1. + <_> + 5 0 3 5 2. + <_> + 8 5 3 5 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 3 0 14 8 -1. + <_> + 3 4 14 4 2. + <_> + + <_> + 8 1 5 10 -1. + <_> + 8 6 5 5 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 2 18 15 2 -1. + <_> + 2 19 15 1 2. + <_> + + <_> + 8 7 6 7 -1. + <_> + 10 7 2 7 3. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 13 11 6 6 -1. + <_> + 13 11 3 6 2. + <_> + + <_> + 0 7 12 4 -1. + <_> + 0 9 12 2 2. + <_> + + <_> + 13 11 6 6 -1. + <_> + 13 11 3 6 2. + <_> + + <_> + 5 6 10 3 -1. + <_> + 10 6 5 3 2. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 3 16 14 4 -1. + <_> + 3 16 7 2 2. + <_> + 10 18 7 2 2. + <_> + + <_> + 13 11 6 6 -1. + <_> + 13 11 3 6 2. + <_> + + <_> + 0 17 18 3 -1. + <_> + 6 17 6 3 3. + <_> + + <_> + 9 6 6 12 -1. + <_> + 9 6 3 12 2. + <_> + + <_> + 0 8 18 4 -1. + <_> + 6 8 6 4 3. + <_> + + <_> + 14 1 6 10 -1. + <_> + 16 1 2 10 3. + <_> + + <_> + 6 9 8 10 -1. + <_> + 6 9 4 5 2. + <_> + 10 14 4 5 2. + <_> + + <_> + 14 1 6 10 -1. + <_> + 16 1 2 10 3. + <_> + + <_> + 0 12 8 6 -1. + <_> + 0 14 8 2 3. + <_> + + <_> + 5 13 13 3 -1. + <_> + 5 14 13 1 3. + <_> + + <_> + 1 14 5 6 -1. + <_> + 1 17 5 3 2. + <_> + + <_> + 13 11 6 6 -1. + <_> + 13 11 3 6 2. + <_> + + <_> + 1 11 6 6 -1. + <_> + 4 11 3 6 2. + <_> + + <_> + 4 7 15 7 -1. + <_> + 9 7 5 7 3. + <_> + + <_> + 3 6 12 11 -1. + <_> + 7 6 4 11 3. + <_> + + <_> + 8 4 6 7 -1. + <_> + 10 4 2 7 3. + <_> + + <_> + 6 4 6 7 -1. + <_> + 8 4 2 7 3. + <_> + + <_> + 11 2 2 15 -1. + <_> + 11 2 1 15 2. + <_> + + <_> + 0 1 6 10 -1. + <_> + 2 1 2 10 3. + <_> + + <_> + 10 0 10 6 -1. + <_> + 15 0 5 3 2. + <_> + 10 3 5 3 2. + <_> + + <_> + 1 0 15 3 -1. + <_> + 1 1 15 1 3. + <_> + + <_> + 7 0 13 3 -1. + <_> + 7 1 13 1 3. + <_> + + <_> + 0 0 10 6 -1. + <_> + 0 0 5 3 2. + <_> + 5 3 5 3 2. + <_> + + <_> + 9 6 4 12 -1. + <_> + 9 6 2 12 2. + <_> + + <_> + 7 6 4 12 -1. + <_> + 9 6 2 12 2. + <_> + + <_> + 9 0 6 18 -1. + <_> + 12 0 3 9 2. + <_> + 9 9 3 9 2. + <_> + + <_> + 3 9 14 2 -1. + <_> + 10 9 7 2 2. + <_> + + <_> + 13 10 7 6 -1. + <_> + 13 12 7 2 3. + <_> + + <_> + 6 2 4 12 -1. + <_> + 6 6 4 4 3. + <_> + + <_> + 3 1 14 6 -1. + <_> + 3 1 7 6 2. + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 9 4 7 4 -1. + <_> + 9 6 7 2 2. + <_> + + <_> + 0 9 15 3 -1. + <_> + 0 10 15 1 3. + <_> + + <_> + 7 0 8 8 -1. + <_> + 11 0 4 4 2. + <_> + 7 4 4 4 2. + <_> + + <_> + 0 3 20 4 -1. + <_> + 0 3 10 2 2. + <_> + 10 5 10 2 2. + <_> + + <_> + 10 2 10 3 -1. + <_> + 10 2 5 3 2. + <_> + + <_> + 4 4 7 4 -1. + <_> + 4 6 7 2 2. + <_> + + <_> + 10 2 10 3 -1. + <_> + 10 2 5 3 2. + <_> + + <_> + 2 11 12 6 -1. + <_> + 2 11 6 3 2. + <_> + 8 14 6 3 2. + <_> + + <_> + 0 0 20 10 -1. + <_> + 0 5 20 5 2. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 12 13 8 6 -1. + <_> + 12 15 8 2 3. + <_> + + <_> + 0 15 13 3 -1. + <_> + 0 16 13 1 3. + <_> + + <_> + 12 13 8 6 -1. + <_> + 12 15 8 2 3. + <_> + + <_> + 0 13 8 6 -1. + <_> + 0 15 8 2 3. + <_> + + <_> + 12 0 8 12 -1. + <_> + 16 0 4 6 2. + <_> + 12 6 4 6 2. + <_> + + <_> + 7 1 6 14 -1. + <_> + 7 8 6 7 2. + <_> + + <_> + 5 10 13 3 -1. + <_> + 5 11 13 1 3. + <_> + + <_> + 7 7 6 9 -1. + <_> + 7 10 6 3 3. + <_> + + <_> + 5 6 13 3 -1. + <_> + 5 7 13 1 3. + <_> + + <_> + 2 4 8 8 -1. + <_> + 2 4 4 4 2. + <_> + 6 8 4 4 2. + <_> + + <_> + 11 4 8 16 -1. + <_> + 15 4 4 8 2. + <_> + 11 12 4 8 2. + <_> + + <_> + 1 4 8 16 -1. + <_> + 1 4 4 8 2. + <_> + 5 12 4 8 2. + <_> + + <_> + 11 10 4 8 -1. + <_> + 11 14 4 4 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 10 4 4 2. + <_> + 10 14 4 4 2. + <_> + + <_> + 4 0 12 8 -1. + <_> + 4 4 12 4 2. + <_> + + <_> + 5 1 8 6 -1. + <_> + 5 4 8 3 2. + <_> + + <_> + 5 2 15 2 -1. + <_> + 5 3 15 1 2. + <_> + + <_> + 1 11 16 4 -1. + <_> + 1 11 8 2 2. + <_> + 9 13 8 2 2. + <_> + + <_> + 10 2 10 3 -1. + <_> + 10 2 5 3 2. + <_> + + <_> + 1 0 10 6 -1. + <_> + 1 0 5 3 2. + <_> + 6 3 5 3 2. + <_> + + <_> + 10 2 10 3 -1. + <_> + 10 2 5 3 2. + <_> + + <_> + 0 5 7 6 -1. + <_> + 0 7 7 2 3. + <_> + + <_> + 15 0 5 9 -1. + <_> + 15 3 5 3 3. + <_> + + <_> + 1 1 18 8 -1. + <_> + 1 1 9 4 2. + <_> + 10 5 9 4 2. + <_> + + <_> + 16 2 4 18 -1. + <_> + 18 2 2 9 2. + <_> + 16 11 2 9 2. + <_> + + <_> + 0 15 14 4 -1. + <_> + 0 15 7 2 2. + <_> + 7 17 7 2 2. + <_> + + <_> + 16 2 4 18 -1. + <_> + 18 2 2 9 2. + <_> + 16 11 2 9 2. + <_> + + <_> + 0 2 4 18 -1. + <_> + 0 2 2 9 2. + <_> + 2 11 2 9 2. + <_> + + <_> + 10 6 6 11 -1. + <_> + 10 6 3 11 2. + <_> + + <_> + 0 6 20 2 -1. + <_> + 10 6 10 2 2. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 1 14 12 6 -1. + <_> + 1 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 7 2 6 7 -1. + <_> + 9 2 2 7 3. + <_> + + <_> + 12 2 8 4 -1. + <_> + 12 2 4 4 2. + <_> + + <_> + 4 7 12 4 -1. + <_> + 4 9 12 2 2. + <_> + + <_> + 13 1 6 6 -1. + <_> + 13 1 3 6 2. + <_> + + <_> + 0 3 6 7 -1. + <_> + 3 3 3 7 2. + <_> + + <_> + 8 12 10 8 -1. + <_> + 13 12 5 4 2. + <_> + 8 16 5 4 2. + <_> + + <_> + 2 9 12 10 -1. + <_> + 2 9 6 5 2. + <_> + 8 14 6 5 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 14 8 4 2. + <_> + + <_> + 1 1 8 6 -1. + <_> + 1 3 8 2 3. + <_> + + <_> + 7 11 13 3 -1. + <_> + 7 12 13 1 3. + <_> + + <_> + 0 1 18 4 -1. + <_> + 0 1 9 2 2. + <_> + 9 3 9 2 2. + <_> + + <_> + 10 1 6 8 -1. + <_> + 12 1 2 8 3. + <_> + + <_> + 4 1 6 8 -1. + <_> + 6 1 2 8 3. + <_> + + <_> + 12 5 3 10 -1. + <_> + 12 10 3 5 2. + <_> + + <_> + 7 1 6 16 -1. + <_> + 7 9 6 8 2. + <_> + + <_> + 14 0 5 8 -1. + <_> + 14 4 5 4 2. + <_> + + <_> + 5 5 3 10 -1. + <_> + 5 10 3 5 2. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 3 14 14 4 -1. + <_> + 3 14 7 2 2. + <_> + 10 16 7 2 2. + <_> + + <_> + 9 6 3 13 -1. + <_> + 10 6 1 13 3. + <_> + + <_> + 8 6 3 13 -1. + <_> + 9 6 1 13 3. + <_> + + <_> + 14 0 5 8 -1. + <_> + 14 4 5 4 2. + <_> + + <_> + 1 0 5 8 -1. + <_> + 1 4 5 4 2. + <_> + + <_> + 14 13 6 6 -1. + <_> + 14 16 6 3 2. + <_> + + <_> + 0 0 19 3 -1. + <_> + 0 1 19 1 3. + <_> + + <_> + 10 12 8 8 -1. + <_> + 14 12 4 4 2. + <_> + 10 16 4 4 2. + <_> + + <_> + 2 12 8 8 -1. + <_> + 2 12 4 4 2. + <_> + 6 16 4 4 2. + <_> + + <_> + 3 8 15 3 -1. + <_> + 3 9 15 1 3. + <_> + + <_> + 5 2 4 13 -1. + <_> + 7 2 2 13 2. + <_> + + <_> + 3 9 17 3 -1. + <_> + 3 10 17 1 3. + <_> + + <_> + 2 4 13 3 -1. + <_> + 2 5 13 1 3. + <_> + + <_> + 12 0 6 13 -1. + <_> + 14 0 2 13 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 9 12 9 6 -1. + <_> + 12 12 3 6 3. + <_> + + <_> + 5 9 10 6 -1. + <_> + 5 9 5 3 2. + <_> + 10 12 5 3 2. + <_> + + <_> + 3 10 14 4 -1. + <_> + 10 10 7 2 2. + <_> + 3 12 7 2 2. + <_> + + <_> + 1 0 8 6 -1. + <_> + 1 2 8 2 3. + <_> + + <_> + 6 0 9 5 -1. + <_> + 9 0 3 5 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 11 13 9 6 -1. + <_> + 11 15 9 2 3. + <_> + + <_> + 0 13 9 6 -1. + <_> + 0 15 9 2 3. + <_> + + <_> + 4 1 13 6 -1. + <_> + 4 4 13 3 2. + <_> + + <_> + 0 2 20 6 -1. + <_> + 0 5 20 3 2. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 2 6 15 8 -1. + <_> + 7 6 5 8 3. + <_> + + <_> + 12 11 8 4 -1. + <_> + 12 13 8 2 2. + <_> + + <_> + 0 11 8 4 -1. + <_> + 0 13 8 2 2. + <_> + + <_> + 2 1 18 4 -1. + <_> + 8 1 6 4 3. + <_> + + <_> + 5 5 10 6 -1. + <_> + 5 7 10 2 3. + <_> + + <_> + 6 10 8 8 -1. + <_> + 10 10 4 4 2. + <_> + 6 14 4 4 2. + <_> + + <_> + 7 0 3 20 -1. + <_> + 8 0 1 20 3. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 0 0 20 2 -1. + <_> + 10 0 10 2 2. + <_> + + <_> + 3 4 14 2 -1. + <_> + 3 4 7 2 2. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 7 11 13 3 -1. + <_> + 7 12 13 1 3. + <_> + + <_> + 0 6 8 14 -1. + <_> + 4 6 4 14 2. + <_> + + <_> + 9 13 9 5 -1. + <_> + 12 13 3 5 3. + <_> + + <_> + 2 13 9 5 -1. + <_> + 5 13 3 5 3. + <_> + + <_> + 10 1 4 7 -1. + <_> + 10 1 2 7 2. + <_> + + <_> + 6 1 4 7 -1. + <_> + 8 1 2 7 2. + <_> + + <_> + 12 8 6 8 -1. + <_> + 12 8 3 8 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 11 12 8 8 -1. + <_> + 15 12 4 4 2. + <_> + 11 16 4 4 2. + <_> + + <_> + 1 12 8 8 -1. + <_> + 1 12 4 4 2. + <_> + 5 16 4 4 2. + <_> + + <_> + 12 8 6 5 -1. + <_> + 12 8 3 5 2. + <_> + + <_> + 2 8 6 5 -1. + <_> + 5 8 3 5 2. + <_> + + <_> + 4 5 12 6 -1. + <_> + 10 5 6 3 2. + <_> + 4 8 6 3 2. + <_> + + <_> + 2 9 10 3 -1. + <_> + 7 9 5 3 2. + <_> + + <_> + 10 3 8 8 -1. + <_> + 14 3 4 4 2. + <_> + 10 7 4 4 2. + <_> + + <_> + 2 3 8 8 -1. + <_> + 2 3 4 4 2. + <_> + 6 7 4 4 2. + <_> + + <_> + 2 2 18 3 -1. + <_> + 8 2 6 3 3. + <_> + + <_> + 4 1 8 8 -1. + <_> + 4 1 4 4 2. + <_> + 8 5 4 4 2. + <_> + + <_> + 10 11 4 9 -1. + <_> + 10 11 2 9 2. + <_> + + <_> + 0 13 15 7 -1. + <_> + 5 13 5 7 3. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 14 1 3 14 -1. + <_> + 15 1 1 14 3. + <_> + + <_> + 0 2 18 3 -1. + <_> + 6 2 6 3 3. + <_> + + <_> + 10 2 6 7 -1. + <_> + 12 2 2 7 3. + <_> + + <_> + 4 2 6 7 -1. + <_> + 6 2 2 7 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 0 4 16 10 -1. + <_> + 0 9 16 5 2. + <_> + + <_> + 6 15 13 3 -1. + <_> + 6 16 13 1 3. + <_> + + <_> + 2 3 13 2 -1. + <_> + 2 4 13 1 2. + <_> + + <_> + 5 0 11 8 -1. + <_> + 5 4 11 4 2. + <_> + + <_> + 1 6 3 10 -1. + <_> + 1 11 3 5 2. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 14 1 4 7 -1. + <_> + 14 1 2 7 2. + <_> + + <_> + 1 14 8 6 -1. + <_> + 1 16 8 2 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 14 1 4 7 -1. + <_> + 14 1 2 7 2. + <_> + + <_> + 2 1 4 7 -1. + <_> + 4 1 2 7 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 1 14 9 6 -1. + <_> + 1 16 9 2 3. + <_> + + <_> + 10 9 6 7 -1. + <_> + 12 9 2 7 3. + <_> + + <_> + 4 9 6 7 -1. + <_> + 6 9 2 7 3. + <_> + + <_> + 10 14 10 6 -1. + <_> + 15 14 5 3 2. + <_> + 10 17 5 3 2. + <_> + + <_> + 4 14 12 6 -1. + <_> + 4 17 12 3 2. + <_> + + <_> + 7 13 6 7 -1. + <_> + 9 13 2 7 3. + <_> + + <_> + 1 3 15 4 -1. + <_> + 6 3 5 4 3. + <_> + + <_> + 2 9 18 3 -1. + <_> + 8 9 6 3 3. + <_> + + <_> + 2 8 12 4 -1. + <_> + 6 8 4 4 3. + <_> + + <_> + 12 5 6 11 -1. + <_> + 12 5 3 11 2. + <_> + + <_> + 0 0 20 2 -1. + <_> + 10 0 10 2 2. + <_> + + <_> + 9 0 3 13 -1. + <_> + 10 0 1 13 3. + <_> + + <_> + 3 2 14 2 -1. + <_> + 3 3 14 1 2. + <_> + + <_> + 4 8 12 4 -1. + <_> + 4 10 12 2 2. + <_> + + <_> + 0 0 7 6 -1. + <_> + 0 2 7 2 3. + <_> + + <_> + 11 8 3 10 -1. + <_> + 11 13 3 5 2. + <_> + + <_> + 1 14 10 6 -1. + <_> + 1 14 5 3 2. + <_> + 6 17 5 3 2. + <_> + + <_> + 6 4 12 12 -1. + <_> + 12 4 6 6 2. + <_> + 6 10 6 6 2. + <_> + + <_> + 2 4 12 12 -1. + <_> + 2 4 6 6 2. + <_> + 8 10 6 6 2. + <_> + + <_> + 3 5 14 8 -1. + <_> + 10 5 7 4 2. + <_> + 3 9 7 4 2. + <_> + + <_> + 0 4 6 7 -1. + <_> + 2 4 2 7 3. + <_> + + <_> + 7 13 7 6 -1. + <_> + 7 15 7 2 3. + <_> + + <_> + 2 13 16 6 -1. + <_> + 2 15 16 2 3. + <_> + + <_> + 16 7 3 13 -1. + <_> + 17 7 1 13 3. + <_> + + <_> + 1 7 3 13 -1. + <_> + 2 7 1 13 3. + <_> + + <_> + 11 10 5 9 -1. + <_> + 11 13 5 3 3. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 7 2 13 3 -1. + <_> + 7 3 13 1 3. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 11 10 5 9 -1. + <_> + 11 13 5 3 3. + <_> + + <_> + 4 10 5 9 -1. + <_> + 4 13 5 3 3. + <_> + + <_> + 4 14 13 3 -1. + <_> + 4 15 13 1 3. + <_> + + <_> + 1 2 18 4 -1. + <_> + 1 2 9 2 2. + <_> + 10 4 9 2 2. + <_> + + <_> + 14 2 6 6 -1. + <_> + 14 5 6 3 2. + <_> + + <_> + 0 2 6 6 -1. + <_> + 0 5 6 3 2. + <_> + + <_> + 4 0 13 6 -1. + <_> + 4 3 13 3 2. + <_> + + <_> + 2 7 13 3 -1. + <_> + 2 8 13 1 3. + <_> + + <_> + 3 7 14 2 -1. + <_> + 3 8 14 1 2. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 11 10 6 8 -1. + <_> + 11 10 3 8 2. + <_> + + <_> + 4 0 8 7 -1. + <_> + 8 0 4 7 2. + <_> + + <_> + 11 10 6 7 -1. + <_> + 11 10 3 7 2. + <_> + + <_> + 6 2 2 18 -1. + <_> + 7 2 1 18 2. + <_> + + <_> + 12 6 3 13 -1. + <_> + 13 6 1 13 3. + <_> + + <_> + 2 18 14 2 -1. + <_> + 2 19 14 1 2. + <_> + + <_> + 11 10 6 7 -1. + <_> + 11 10 3 7 2. + <_> + + <_> + 8 6 3 13 -1. + <_> + 9 6 1 13 3. + <_> + + <_> + 12 4 2 14 -1. + <_> + 12 4 1 14 2. + <_> + + <_> + 6 4 2 14 -1. + <_> + 7 4 1 14 2. + <_> + + <_> + 1 12 18 3 -1. + <_> + 7 12 6 3 3. + <_> + + <_> + 2 8 6 9 -1. + <_> + 5 8 3 9 2. + <_> + + <_> + 11 5 8 8 -1. + <_> + 15 5 4 4 2. + <_> + 11 9 4 4 2. + <_> + + <_> + 5 5 8 8 -1. + <_> + 5 5 4 4 2. + <_> + 9 9 4 4 2. + <_> + + <_> + 9 0 3 20 -1. + <_> + 10 0 1 20 3. + <_> + + <_> + 7 5 3 13 -1. + <_> + 8 5 1 13 3. + <_> + + <_> + 0 3 10 6 -1. + <_> + 0 3 5 3 2. + <_> + 5 6 5 3 2. + <_> + + <_> + 5 7 12 4 -1. + <_> + 9 7 4 4 3. + <_> + + <_> + 5 4 6 10 -1. + <_> + 5 4 3 5 2. + <_> + 8 9 3 5 2. + <_> + + <_> + 10 9 4 8 -1. + <_> + 10 13 4 4 2. + <_> + + <_> + 3 7 12 5 -1. + <_> + 7 7 4 5 3. + <_> + + <_> + 7 2 6 12 -1. + <_> + 7 6 6 4 3. + <_> + + <_> + 0 4 6 8 -1. + <_> + 3 4 3 8 2. + <_> + + <_> + 4 11 13 3 -1. + <_> + 4 12 13 1 3. + <_> + + <_> + 0 9 18 5 -1. + <_> + 6 9 6 5 3. + <_> + + <_> + 5 7 15 2 -1. + <_> + 5 8 15 1 2. + <_> + + <_> + 2 11 14 4 -1. + <_> + 2 11 7 2 2. + <_> + 9 13 7 2 2. + <_> + + <_> + 12 10 5 6 -1. + <_> + 12 13 5 3 2. + <_> + + <_> + 4 10 12 6 -1. + <_> + 4 10 6 3 2. + <_> + 10 13 6 3 2. + <_> + + <_> + 14 8 6 10 -1. + <_> + 14 8 3 10 2. + <_> + + <_> + 0 2 18 2 -1. + <_> + 0 3 18 1 2. + <_> + + <_> + 14 1 6 5 -1. + <_> + 14 1 3 5 2. + <_> + + <_> + 3 8 13 2 -1. + <_> + 3 9 13 1 2. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 0 1 6 5 -1. + <_> + 3 1 3 5 2. + <_> + + <_> + 7 1 8 8 -1. + <_> + 11 1 4 4 2. + <_> + 7 5 4 4 2. + <_> + + <_> + 5 1 8 8 -1. + <_> + 5 1 4 4 2. + <_> + 9 5 4 4 2. + <_> + + <_> + 15 4 4 14 -1. + <_> + 17 4 2 7 2. + <_> + 15 11 2 7 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 15 4 4 14 -1. + <_> + 17 4 2 7 2. + <_> + 15 11 2 7 2. + <_> + + <_> + 1 2 4 18 -1. + <_> + 1 2 2 9 2. + <_> + 3 11 2 9 2. + <_> + + <_> + 3 11 16 9 -1. + <_> + 3 14 16 3 3. + <_> + + <_> + 0 0 17 3 -1. + <_> + 0 1 17 1 3. + <_> + + <_> + 9 5 9 15 -1. + <_> + 9 10 9 5 3. + <_> + + <_> + 0 7 7 9 -1. + <_> + 0 10 7 3 3. + <_> + + <_> + 13 0 6 10 -1. + <_> + 16 0 3 5 2. + <_> + 13 5 3 5 2. + <_> + + <_> + 0 3 14 4 -1. + <_> + 0 3 7 2 2. + <_> + 7 5 7 2 2. + <_> + + <_> + 13 0 6 10 -1. + <_> + 16 0 3 5 2. + <_> + 13 5 3 5 2. + <_> + + <_> + 1 0 6 10 -1. + <_> + 1 0 3 5 2. + <_> + 4 5 3 5 2. + <_> + + <_> + 10 1 6 7 -1. + <_> + 12 1 2 7 3. + <_> + + <_> + 7 4 5 16 -1. + <_> + 7 12 5 8 2. + <_> + + <_> + 8 5 6 8 -1. + <_> + 10 5 2 8 3. + <_> + + <_> + 4 3 6 17 -1. + <_> + 6 3 2 17 3. + <_> + + <_> + 2 0 18 20 -1. + <_> + 8 0 6 20 3. + <_> + + <_> + 5 12 6 6 -1. + <_> + 8 12 3 6 2. + <_> + + <_> + 9 4 5 16 -1. + <_> + 9 12 5 8 2. + <_> + + <_> + 0 7 6 9 -1. + <_> + 3 7 3 9 2. + <_> + + <_> + 15 7 5 9 -1. + <_> + 15 10 5 3 3. + <_> + + <_> + 5 14 10 6 -1. + <_> + 5 16 10 2 3. + <_> + + <_> + 2 14 17 6 -1. + <_> + 2 16 17 2 3. + <_> + + <_> + 3 2 14 6 -1. + <_> + 3 4 14 2 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 0 0 4 15 -1. + <_> + 2 0 2 15 2. + <_> + + <_> + 1 4 18 10 -1. + <_> + 10 4 9 5 2. + <_> + 1 9 9 5 2. + <_> + + <_> + 0 1 2 13 -1. + <_> + 1 1 1 13 2. + <_> + + <_> + 13 3 3 12 -1. + <_> + 13 9 3 6 2. + <_> + + <_> + 0 2 20 4 -1. + <_> + 0 2 10 2 2. + <_> + 10 4 10 2 2. + <_> + + <_> + 7 9 6 7 -1. + <_> + 9 9 2 7 3. + <_> + + <_> + 4 9 6 5 -1. + <_> + 7 9 3 5 2. + <_> + + <_> + 11 8 4 12 -1. + <_> + 11 8 2 12 2. + <_> + + <_> + 1 14 13 3 -1. + <_> + 1 15 13 1 3. + <_> + + <_> + 11 8 4 12 -1. + <_> + 11 8 2 12 2. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 11 8 4 12 -1. + <_> + 11 8 2 12 2. + <_> + + <_> + 5 8 4 12 -1. + <_> + 7 8 2 12 2. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 7 0 6 14 -1. + <_> + 10 0 3 7 2. + <_> + 7 7 3 7 2. + <_> + + <_> + 5 0 8 8 -1. + <_> + 5 4 8 4 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 3 0 14 8 -1. + <_> + 3 4 14 4 2. + <_> + + <_> + 9 1 5 10 -1. + <_> + 9 6 5 5 2. + <_> + + <_> + 7 0 2 14 -1. + <_> + 8 0 1 14 2. + <_> + + <_> + 2 15 18 5 -1. + <_> + 8 15 6 5 3. + <_> + + <_> + 1 9 10 6 -1. + <_> + 1 9 5 3 2. + <_> + 6 12 5 3 2. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 7 0 3 13 -1. + <_> + 8 0 1 13 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 0 1 6 11 -1. + <_> + 2 1 2 11 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 7 11 7 6 -1. + <_> + 7 13 7 2 3. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 8 4 4 8 -1. + <_> + 10 4 2 8 2. + <_> + + <_> + 15 0 5 9 -1. + <_> + 15 3 5 3 3. + <_> + + <_> + 1 9 7 6 -1. + <_> + 1 11 7 2 3. + <_> + + <_> + 11 9 3 10 -1. + <_> + 11 14 3 5 2. + <_> + + <_> + 6 9 3 10 -1. + <_> + 6 14 3 5 2. + <_> + + <_> + 2 2 18 9 -1. + <_> + 8 2 6 9 3. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 2 15 18 5 -1. + <_> + 8 15 6 5 3. + <_> + + <_> + 0 15 18 5 -1. + <_> + 6 15 6 5 3. + <_> + + <_> + 12 0 8 9 -1. + <_> + 12 3 8 3 3. + <_> + + <_> + 7 12 6 8 -1. + <_> + 9 12 2 8 3. + <_> + + <_> + 13 0 6 14 -1. + <_> + 15 0 2 14 3. + <_> + + <_> + 1 0 6 14 -1. + <_> + 3 0 2 14 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 10 7 9 13 -1. + <_> + 13 7 3 13 3. + <_> + + <_> + 1 7 9 13 -1. + <_> + 4 7 3 13 3. + <_> + + <_> + 8 15 12 5 -1. + <_> + 12 15 4 5 3. + <_> + + <_> + 3 14 14 6 -1. + <_> + 10 14 7 6 2. + <_> + + <_> + 5 2 15 3 -1. + <_> + 5 3 15 1 3. + <_> + + <_> + 5 3 10 6 -1. + <_> + 5 5 10 2 3. + <_> + + <_> + 7 4 7 8 -1. + <_> + 7 8 7 4 2. + <_> + + <_> + 0 0 8 9 -1. + <_> + 0 3 8 3 3. + <_> + + <_> + 15 0 5 9 -1. + <_> + 15 3 5 3 3. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 7 3 13 3 -1. + <_> + 7 4 13 1 3. + <_> + + <_> + 2 12 7 6 -1. + <_> + 2 14 7 2 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 4 1 6 7 -1. + <_> + 6 1 2 7 3. + <_> + + <_> + 8 6 5 9 -1. + <_> + 8 9 5 3 3. + <_> + + <_> + 0 8 12 12 -1. + <_> + 4 8 4 12 3. + <_> + + <_> + 9 0 9 5 -1. + <_> + 12 0 3 5 3. + <_> + + <_> + 2 0 9 5 -1. + <_> + 5 0 3 5 3. + <_> + + <_> + 6 4 10 14 -1. + <_> + 11 4 5 7 2. + <_> + 6 11 5 7 2. + <_> + + <_> + 4 4 10 14 -1. + <_> + 4 4 5 7 2. + <_> + 9 11 5 7 2. + <_> + + <_> + 13 9 6 5 -1. + <_> + 13 9 3 5 2. + <_> + + <_> + 3 8 13 3 -1. + <_> + 3 9 13 1 3. + <_> + + <_> + 5 16 14 4 -1. + <_> + 12 16 7 2 2. + <_> + 5 18 7 2 2. + <_> + + <_> + 1 0 6 10 -1. + <_> + 1 0 3 5 2. + <_> + 4 5 3 5 2. + <_> + + <_> + 11 1 5 12 -1. + <_> + 11 7 5 6 2. + <_> + + <_> + 4 1 5 12 -1. + <_> + 4 7 5 6 2. + <_> + + <_> + 8 6 4 8 -1. + <_> + 8 10 4 4 2. + <_> + + <_> + 1 16 14 4 -1. + <_> + 1 16 7 2 2. + <_> + 8 18 7 2 2. + <_> + + <_> + 5 14 13 2 -1. + <_> + 5 15 13 1 2. + <_> + + <_> + 0 9 5 9 -1. + <_> + 0 12 5 3 3. + <_> + + <_> + 13 10 6 5 -1. + <_> + 13 10 3 5 2. + <_> + + <_> + 1 10 6 5 -1. + <_> + 4 10 3 5 2. + <_> + + <_> + 15 7 4 13 -1. + <_> + 15 7 2 13 2. + <_> + + <_> + 1 7 4 13 -1. + <_> + 3 7 2 13 2. + <_> + + <_> + 5 10 10 4 -1. + <_> + 5 12 10 2 2. + <_> + + <_> + 0 2 15 3 -1. + <_> + 0 3 15 1 3. + <_> + + <_> + 7 0 11 6 -1. + <_> + 7 2 11 2 3. + <_> + + <_> + 0 4 7 6 -1. + <_> + 0 6 7 2 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 0 12 20 4 -1. + <_> + 0 12 10 2 2. + <_> + 10 14 10 2 2. + <_> + + <_> + 4 1 12 5 -1. + <_> + 8 1 4 5 3. + <_> + + <_> + 6 1 2 14 -1. + <_> + 7 1 1 14 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 6 4 6 8 -1. + <_> + 8 4 2 8 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 6 3 4 7 -1. + <_> + 8 3 2 7 2. + <_> + + <_> + 15 3 5 9 -1. + <_> + 15 6 5 3 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 6 9 9 5 -1. + <_> + 9 9 3 5 3. + <_> + + <_> + 0 4 5 6 -1. + <_> + 0 7 5 3 2. + <_> + + <_> + 15 4 4 16 -1. + <_> + 17 4 2 8 2. + <_> + 15 12 2 8 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 15 4 4 16 -1. + <_> + 17 4 2 8 2. + <_> + 15 12 2 8 2. + <_> + + <_> + 2 16 15 4 -1. + <_> + 2 18 15 2 2. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 2 8 15 5 -1. + <_> + 7 8 5 5 3. + <_> + + <_> + 15 4 4 16 -1. + <_> + 17 4 2 8 2. + <_> + 15 12 2 8 2. + <_> + + <_> + 1 4 4 16 -1. + <_> + 1 4 2 8 2. + <_> + 3 12 2 8 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 6 4 6 10 -1. + <_> + 6 4 3 5 2. + <_> + 9 9 3 5 2. + <_> + + <_> + 1 9 19 3 -1. + <_> + 1 10 19 1 3. + <_> + + <_> + 3 0 14 12 -1. + <_> + 3 4 14 4 3. + <_> + + <_> + 6 3 8 4 -1. + <_> + 6 5 8 2 2. + <_> + + <_> + 0 5 15 3 -1. + <_> + 0 6 15 1 3. + <_> + + <_> + 12 0 2 13 -1. + <_> + 12 0 1 13 2. + <_> + + <_> + 8 4 4 14 -1. + <_> + 10 4 2 14 2. + <_> + + <_> + 7 0 10 6 -1. + <_> + 12 0 5 3 2. + <_> + 7 3 5 3 2. + <_> + + <_> + 1 6 6 7 -1. + <_> + 3 6 2 7 3. + <_> + + <_> + 17 2 3 13 -1. + <_> + 18 2 1 13 3. + <_> + + <_> + 0 0 3 13 -1. + <_> + 1 0 1 13 3. + <_> + + <_> + 6 0 10 6 -1. + <_> + 11 0 5 3 2. + <_> + 6 3 5 3 2. + <_> + + <_> + 4 0 10 6 -1. + <_> + 4 0 5 3 2. + <_> + 9 3 5 3 2. + <_> + + <_> + 6 1 14 2 -1. + <_> + 6 2 14 1 2. + <_> + + <_> + 3 0 12 18 -1. + <_> + 3 9 12 9 2. + <_> + + <_> + 13 7 6 10 -1. + <_> + 13 12 6 5 2. + <_> + + <_> + 1 7 6 10 -1. + <_> + 1 12 6 5 2. + <_> + + <_> + 4 5 12 12 -1. + <_> + 10 5 6 6 2. + <_> + 4 11 6 6 2. + <_> + + <_> + 7 4 6 5 -1. + <_> + 10 4 3 5 2. + <_> + + <_> + 4 8 15 4 -1. + <_> + 9 8 5 4 3. + <_> + + <_> + 4 9 12 11 -1. + <_> + 10 9 6 11 2. + <_> + + <_> + 7 6 8 10 -1. + <_> + 11 6 4 5 2. + <_> + 7 11 4 5 2. + <_> + + <_> + 4 7 6 6 -1. + <_> + 4 10 6 3 2. + <_> + + <_> + 11 10 9 6 -1. + <_> + 11 12 9 2 3. + <_> + + <_> + 6 4 7 6 -1. + <_> + 6 6 7 2 3. + <_> + + <_> + 9 3 2 16 -1. + <_> + 9 11 2 8 2. + <_> + + <_> + 3 2 9 16 -1. + <_> + 3 10 9 8 2. + <_> + + <_> + 5 0 10 10 -1. + <_> + 5 5 10 5 2. + <_> + + <_> + 5 1 6 10 -1. + <_> + 5 6 6 5 2. + <_> + + <_> + 13 3 3 12 -1. + <_> + 13 9 3 6 2. + <_> + + <_> + 0 10 18 6 -1. + <_> + 0 12 18 2 3. + <_> + + <_> + 6 15 14 2 -1. + <_> + 6 16 14 1 2. + <_> + + <_> + 6 7 7 4 -1. + <_> + 6 9 7 2 2. + <_> + + <_> + 6 5 11 8 -1. + <_> + 6 9 11 4 2. + <_> + + <_> + 0 8 8 12 -1. + <_> + 0 8 4 6 2. + <_> + 4 14 4 6 2. + <_> + + <_> + 8 6 5 9 -1. + <_> + 8 9 5 3 3. + <_> + + <_> + 2 6 4 14 -1. + <_> + 2 6 2 7 2. + <_> + 4 13 2 7 2. + <_> + + <_> + 6 10 9 6 -1. + <_> + 9 10 3 6 3. + <_> + + <_> + 2 5 4 8 -1. + <_> + 2 9 4 4 2. + <_> + + <_> + 9 4 8 12 -1. + <_> + 13 4 4 6 2. + <_> + 9 10 4 6 2. + <_> + + <_> + 3 4 8 12 -1. + <_> + 3 4 4 6 2. + <_> + 7 10 4 6 2. + <_> + + <_> + 9 8 10 8 -1. + <_> + 14 8 5 4 2. + <_> + 9 12 5 4 2. + <_> + + <_> + 2 18 15 2 -1. + <_> + 2 19 15 1 2. + <_> + + <_> + 10 11 5 9 -1. + <_> + 10 14 5 3 3. + <_> + + <_> + 0 11 16 4 -1. + <_> + 8 11 8 4 2. + <_> + + <_> + 13 4 3 14 -1. + <_> + 14 4 1 14 3. + <_> + + <_> + 0 11 18 6 -1. + <_> + 9 11 9 6 2. + <_> + + <_> + 8 2 4 8 -1. + <_> + 8 2 2 8 2. + <_> + + <_> + 3 2 12 6 -1. + <_> + 3 2 6 3 2. + <_> + 9 5 6 3 2. + <_> + + <_> + 12 10 8 4 -1. + <_> + 12 12 8 2 2. + <_> + + <_> + 0 10 8 4 -1. + <_> + 0 12 8 2 2. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 9 0 3 15 -1. + <_> + 9 5 3 5 3. + <_> + + <_> + 2 3 7 4 -1. + <_> + 2 5 7 2 2. + <_> + + <_> + 14 13 4 7 -1. + <_> + 14 13 2 7 2. + <_> + + <_> + 3 3 3 15 -1. + <_> + 4 3 1 15 3. + <_> + + <_> + 2 0 18 7 -1. + <_> + 8 0 6 7 3. + <_> + + <_> + 3 6 5 6 -1. + <_> + 3 9 5 3 2. + <_> + + <_> + 10 2 10 3 -1. + <_> + 10 2 5 3 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 8 4 4 14 -1. + <_> + 8 11 4 7 2. + <_> + + <_> + 2 16 8 4 -1. + <_> + 6 16 4 4 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 10 3 10 3 -1. + <_> + 10 3 5 3 2. + <_> + + <_> + 5 6 5 8 -1. + <_> + 5 10 5 4 2. + <_> + + <_> + 13 1 6 6 -1. + <_> + 13 1 3 6 2. + <_> + + <_> + 1 1 6 6 -1. + <_> + 4 1 3 6 2. + <_> + + <_> + 8 5 8 4 -1. + <_> + 8 5 4 4 2. + <_> + + <_> + 4 5 8 4 -1. + <_> + 8 5 4 4 2. + <_> + + <_> + 12 10 7 4 -1. + <_> + 12 12 7 2 2. + <_> + + <_> + 3 14 7 6 -1. + <_> + 3 17 7 3 2. + <_> + + <_> + 2 1 16 3 -1. + <_> + 2 2 16 1 3. + <_> + + <_> + 3 2 14 2 -1. + <_> + 3 3 14 1 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 7 12 13 2 -1. + <_> + 7 13 13 1 2. + <_> + + <_> + 1 0 13 3 -1. + <_> + 1 1 13 1 3. + <_> + + <_> + 4 7 12 4 -1. + <_> + 4 9 12 2 2. + <_> + + <_> + 0 10 8 4 -1. + <_> + 0 12 8 2 2. + <_> + + <_> + 2 6 16 8 -1. + <_> + 10 6 8 4 2. + <_> + 2 10 8 4 2. + <_> + + <_> + 2 10 6 7 -1. + <_> + 4 10 2 7 3. + <_> + + <_> + 6 14 13 2 -1. + <_> + 6 15 13 1 2. + <_> + + <_> + 1 11 18 6 -1. + <_> + 1 11 9 3 2. + <_> + 10 14 9 3 2. + <_> + + <_> + 10 9 5 10 -1. + <_> + 10 14 5 5 2. + <_> + + <_> + 7 10 6 10 -1. + <_> + 7 10 3 5 2. + <_> + 10 15 3 5 2. + <_> + + <_> + 6 2 9 12 -1. + <_> + 6 6 9 4 3. + <_> + + <_> + 1 17 18 3 -1. + <_> + 7 17 6 3 3. + <_> + + <_> + 6 9 9 5 -1. + <_> + 9 9 3 5 3. + <_> + + <_> + 6 7 6 5 -1. + <_> + 9 7 3 5 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 3 3 13 2 -1. + <_> + 3 4 13 1 2. + <_> + + <_> + 14 3 6 13 -1. + <_> + 16 3 2 13 3. + <_> + + <_> + 0 3 6 13 -1. + <_> + 2 3 2 13 3. + <_> + + <_> + 9 9 6 10 -1. + <_> + 12 9 3 5 2. + <_> + 9 14 3 5 2. + <_> + + <_> + 1 11 5 9 -1. + <_> + 1 14 5 3 3. + <_> + + <_> + 12 8 8 12 -1. + <_> + 16 8 4 6 2. + <_> + 12 14 4 6 2. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 4 9 12 8 -1. + <_> + 10 9 6 4 2. + <_> + 4 13 6 4 2. + <_> + + <_> + 4 2 6 8 -1. + <_> + 6 2 2 8 3. + <_> + + <_> + 8 2 4 10 -1. + <_> + 8 2 2 10 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 15 2 4 18 -1. + <_> + 17 2 2 9 2. + <_> + 15 11 2 9 2. + <_> + + <_> + 0 0 20 20 -1. + <_> + 0 0 10 10 2. + <_> + 10 10 10 10 2. + <_> + + <_> + 5 6 14 3 -1. + <_> + 5 6 7 3 2. + <_> + + <_> + 3 7 12 4 -1. + <_> + 7 7 4 4 3. + <_> + + <_> + 11 6 6 5 -1. + <_> + 11 6 3 5 2. + <_> + + <_> + 3 6 6 5 -1. + <_> + 6 6 3 5 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 6 13 14 3 -1. + <_> + 6 14 14 1 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 11 12 8 8 -1. + <_> + 15 12 4 4 2. + <_> + 11 16 4 4 2. + <_> + + <_> + 1 12 8 8 -1. + <_> + 1 12 4 4 2. + <_> + 5 16 4 4 2. + <_> + + <_> + 10 0 6 8 -1. + <_> + 12 0 2 8 3. + <_> + + <_> + 1 6 14 3 -1. + <_> + 8 6 7 3 2. + <_> + + <_> + 10 1 10 19 -1. + <_> + 10 1 5 19 2. + <_> + + <_> + 0 1 10 19 -1. + <_> + 5 1 5 19 2. + <_> + + <_> + 10 0 6 8 -1. + <_> + 12 0 2 8 3. + <_> + + <_> + 4 0 6 8 -1. + <_> + 6 0 2 8 3. + <_> + + <_> + 1 11 18 6 -1. + <_> + 1 14 18 3 2. + <_> + + <_> + 5 11 5 6 -1. + <_> + 5 14 5 3 2. + <_> + + <_> + 9 12 4 8 -1. + <_> + 9 16 4 4 2. + <_> + + <_> + 0 11 13 3 -1. + <_> + 0 12 13 1 3. + <_> + + <_> + 1 11 18 3 -1. + <_> + 1 12 18 1 3. + <_> + + <_> + 2 1 16 2 -1. + <_> + 2 2 16 1 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 0 9 19 3 -1. + <_> + 0 10 19 1 3. + <_> + + <_> + 9 7 7 4 -1. + <_> + 9 9 7 2 2. + <_> + + <_> + 0 14 20 6 -1. + <_> + 0 16 20 2 3. + <_> + + <_> + 8 7 12 6 -1. + <_> + 8 7 6 6 2. + <_> + + <_> + 0 7 12 6 -1. + <_> + 6 7 6 6 2. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 0 0 7 12 -1. + <_> + 0 6 7 6 2. + <_> + + <_> + 13 7 3 13 -1. + <_> + 14 7 1 13 3. + <_> + + <_> + 3 1 13 6 -1. + <_> + 3 3 13 2 3. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 7 0 3 13 -1. + <_> + 8 0 1 13 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 5 0 4 8 -1. + <_> + 7 0 2 8 2. + <_> + + <_> + 9 2 6 10 -1. + <_> + 12 2 3 5 2. + <_> + 9 7 3 5 2. + <_> + + <_> + 5 1 3 14 -1. + <_> + 6 1 1 14 3. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 2 14 7 6 -1. + <_> + 2 16 7 2 3. + <_> + + <_> + 1 2 18 6 -1. + <_> + 7 2 6 6 3. + <_> + + <_> + 4 7 7 4 -1. + <_> + 4 9 7 2 2. + <_> + + <_> + 9 4 10 16 -1. + <_> + 9 12 10 8 2. + <_> + + <_> + 1 3 16 12 -1. + <_> + 1 3 8 6 2. + <_> + 9 9 8 6 2. + <_> + + <_> + 11 3 2 16 -1. + <_> + 11 11 2 8 2. + <_> + + <_> + 8 0 3 13 -1. + <_> + 9 0 1 13 3. + <_> + + <_> + 7 9 13 3 -1. + <_> + 7 10 13 1 3. + <_> + + <_> + 0 9 13 3 -1. + <_> + 0 10 13 1 3. + <_> + + <_> + 7 7 9 6 -1. + <_> + 7 9 9 2 3. + <_> + + <_> + 4 5 6 8 -1. + <_> + 6 5 2 8 3. + <_> + + <_> + 9 4 3 10 -1. + <_> + 9 9 3 5 2. + <_> + + <_> + 8 4 4 12 -1. + <_> + 8 8 4 4 3. + <_> + + <_> + 4 5 15 3 -1. + <_> + 4 6 15 1 3. + <_> + + <_> + 2 4 9 4 -1. + <_> + 2 6 9 2 2. + <_> + + <_> + 8 0 8 10 -1. + <_> + 8 5 8 5 2. + <_> + + <_> + 8 6 3 10 -1. + <_> + 8 11 3 5 2. + <_> + + <_> + 5 7 11 8 -1. + <_> + 5 11 11 4 2. + <_> + + <_> + 1 12 6 6 -1. + <_> + 1 15 6 3 2. + <_> + + <_> + 14 2 5 18 -1. + <_> + 14 8 5 6 3. + <_> + + <_> + 1 2 5 18 -1. + <_> + 1 8 5 6 3. + <_> + + <_> + 13 7 3 13 -1. + <_> + 14 7 1 13 3. + <_> + + <_> + 4 7 3 13 -1. + <_> + 5 7 1 13 3. + <_> + + <_> + 0 6 20 2 -1. + <_> + 0 7 20 1 2. + <_> + + <_> + 2 1 16 4 -1. + <_> + 2 1 8 2 2. + <_> + 10 3 8 2 2. + <_> + + <_> + 6 1 10 6 -1. + <_> + 11 1 5 3 2. + <_> + 6 4 5 3 2. + <_> + + <_> + 0 5 8 15 -1. + <_> + 4 5 4 15 2. + <_> + + <_> + 4 13 12 6 -1. + <_> + 4 13 6 6 2. + <_> + + <_> + 7 0 6 14 -1. + <_> + 7 0 3 7 2. + <_> + 10 7 3 7 2. + <_> + + <_> + 1 10 18 10 -1. + <_> + 7 10 6 10 3. + <_> + + <_> + 0 2 13 2 -1. + <_> + 0 3 13 1 2. + <_> + + <_> + 0 0 20 15 -1. + <_> + 0 5 20 5 3. + <_> + + <_> + 4 0 12 6 -1. + <_> + 4 3 12 3 2. + <_> + + <_> + 6 1 8 4 -1. + <_> + 6 3 8 2 2. + <_> + + <_> + 0 7 7 6 -1. + <_> + 0 9 7 2 3. + <_> + + <_> + 4 6 12 4 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 0 0 15 7 -1. + <_> + 5 0 5 7 3. + <_> + + <_> + 10 0 10 8 -1. + <_> + 10 0 5 8 2. + <_> + + <_> + 0 0 10 8 -1. + <_> + 5 0 5 8 2. + <_> + + <_> + 5 6 12 4 -1. + <_> + 5 6 6 4 2. + <_> + + <_> + 3 6 12 4 -1. + <_> + 9 6 6 4 2. + <_> + + <_> + 7 13 6 7 -1. + <_> + 9 13 2 7 3. + <_> + + <_> + 2 0 15 9 -1. + <_> + 7 0 5 9 3. + <_> + + <_> + 6 14 13 2 -1. + <_> + 6 15 13 1 2. + <_> + + <_> + 4 0 12 8 -1. + <_> + 8 0 4 8 3. + <_> + + <_> + 12 1 4 14 -1. + <_> + 14 1 2 7 2. + <_> + 12 8 2 7 2. + <_> + + <_> + 0 5 18 3 -1. + <_> + 6 5 6 3 3. + <_> + + <_> + 7 1 7 6 -1. + <_> + 7 4 7 3 2. + <_> + + <_> + 6 6 5 14 -1. + <_> + 6 13 5 7 2. + <_> + + <_> + 4 7 15 5 -1. + <_> + 9 7 5 5 3. + <_> + + <_> + 1 7 15 5 -1. + <_> + 6 7 5 5 3. + <_> + + <_> + 6 9 9 5 -1. + <_> + 9 9 3 5 3. + <_> + + <_> + 7 6 4 7 -1. + <_> + 9 6 2 7 2. + <_> + + <_> + 7 1 10 6 -1. + <_> + 12 1 5 3 2. + <_> + 7 4 5 3 2. + <_> + + <_> + 2 8 13 2 -1. + <_> + 2 9 13 1 2. + <_> + + <_> + 1 2 18 4 -1. + <_> + 10 2 9 2 2. + <_> + 1 4 9 2 2. + <_> + + <_> + 5 8 9 5 -1. + <_> + 8 8 3 5 3. + <_> + + <_> + 15 2 4 18 -1. + <_> + 17 2 2 9 2. + <_> + 15 11 2 9 2. + <_> + + <_> + 1 2 4 18 -1. + <_> + 1 2 2 9 2. + <_> + 3 11 2 9 2. + <_> + + <_> + 10 7 10 6 -1. + <_> + 15 7 5 3 2. + <_> + 10 10 5 3 2. + <_> + + <_> + 1 7 17 6 -1. + <_> + 1 9 17 2 3. + <_> + + <_> + 7 6 7 4 -1. + <_> + 7 8 7 2 2. + <_> + + <_> + 1 8 10 6 -1. + <_> + 1 8 5 3 2. + <_> + 6 11 5 3 2. + <_> + + <_> + 10 7 10 6 -1. + <_> + 15 7 5 3 2. + <_> + 10 10 5 3 2. + <_> + + <_> + 0 7 10 6 -1. + <_> + 0 7 5 3 2. + <_> + 5 10 5 3 2. + <_> + + <_> + 8 1 12 19 -1. + <_> + 8 1 6 19 2. + <_> + + <_> + 0 1 12 19 -1. + <_> + 6 1 6 19 2. + <_> + + <_> + 5 1 12 13 -1. + <_> + 5 1 6 13 2. + <_> + + <_> + 5 1 9 5 -1. + <_> + 8 1 3 5 3. + <_> + + <_> + 16 0 4 8 -1. + <_> + 16 0 2 8 2. + <_> + + <_> + 0 12 13 3 -1. + <_> + 0 13 13 1 3. + <_> + + <_> + 10 0 4 16 -1. + <_> + 10 0 2 16 2. + <_> + + <_> + 4 12 12 5 -1. + <_> + 8 12 4 5 3. + <_> + + <_> + 10 0 4 16 -1. + <_> + 10 0 2 16 2. + <_> + + <_> + 6 0 4 16 -1. + <_> + 8 0 2 16 2. + <_> + + <_> + 6 1 8 7 -1. + <_> + 6 1 4 7 2. + <_> + + <_> + 8 4 4 7 -1. + <_> + 10 4 2 7 2. + <_> + + <_> + 11 8 9 9 -1. + <_> + 14 8 3 9 3. + <_> + + <_> + 0 8 9 9 -1. + <_> + 3 8 3 9 3. + <_> + + <_> + 0 4 20 5 -1. + <_> + 0 4 10 5 2. + <_> + + <_> + 1 12 18 2 -1. + <_> + 1 13 18 1 2. + <_> + + <_> + 11 5 5 9 -1. + <_> + 11 8 5 3 3. + <_> + + <_> + 4 5 5 9 -1. + <_> + 4 8 5 3 3. + <_> + + <_> + 11 2 6 10 -1. + <_> + 14 2 3 5 2. + <_> + 11 7 3 5 2. + <_> + + <_> + 2 10 14 4 -1. + <_> + 2 10 7 2 2. + <_> + 9 12 7 2 2. + <_> + + <_> + 0 11 20 4 -1. + <_> + 10 11 10 2 2. + <_> + 0 13 10 2 2. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 14 0 3 15 -1. + <_> + 15 0 1 15 3. + <_> + + <_> + 3 0 3 15 -1. + <_> + 4 0 1 15 3. + <_> + + <_> + 9 12 7 4 -1. + <_> + 9 14 7 2 2. + <_> + + <_> + 5 1 6 5 -1. + <_> + 8 1 3 5 2. + <_> + + <_> + 14 0 4 9 -1. + <_> + 14 0 2 9 2. + <_> + + <_> + 2 0 4 9 -1. + <_> + 4 0 2 9 2. + <_> + + <_> + 9 1 8 8 -1. + <_> + 13 1 4 4 2. + <_> + 9 5 4 4 2. + <_> + + <_> + 7 0 3 13 -1. + <_> + 8 0 1 13 3. + <_> + + <_> + 3 15 14 4 -1. + <_> + 10 15 7 2 2. + <_> + 3 17 7 2 2. + <_> + + <_> + 4 12 7 4 -1. + <_> + 4 14 7 2 2. + <_> + + <_> + 9 12 4 8 -1. + <_> + 9 16 4 4 2. + <_> + + <_> + 1 14 13 3 -1. + <_> + 1 15 13 1 3. + <_> + + <_> + 5 7 10 10 -1. + <_> + 5 12 10 5 2. + <_> + + <_> + 5 7 6 8 -1. + <_> + 5 11 6 4 2. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 8 4 3 10 -1. + <_> + 8 9 3 5 2. + <_> + + <_> + 2 0 6 5 -1. + <_> + 5 0 3 5 2. + <_> + + <_> + 8 4 4 14 -1. + <_> + 8 11 4 7 2. + <_> + + <_> + 3 6 5 6 -1. + <_> + 3 9 5 3 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 1 2 17 6 -1. + <_> + 1 4 17 2 3. + <_> + + <_> + 9 5 6 10 -1. + <_> + 9 5 3 10 2. + <_> + + <_> + 5 4 6 6 -1. + <_> + 8 4 3 6 2. + <_> + + <_> + 5 6 14 6 -1. + <_> + 12 6 7 3 2. + <_> + 5 9 7 3 2. + <_> + + <_> + 1 6 14 6 -1. + <_> + 1 6 7 3 2. + <_> + 8 9 7 3 2. + <_> + + <_> + 4 9 12 5 -1. + <_> + 8 9 4 5 3. + <_> + + <_> + 0 5 20 15 -1. + <_> + 0 10 20 5 3. + <_> + + <_> + 12 5 4 14 -1. + <_> + 14 5 2 7 2. + <_> + 12 12 2 7 2. + <_> + + <_> + 0 0 6 9 -1. + <_> + 2 0 2 9 3. + <_> + + <_> + 16 0 4 8 -1. + <_> + 16 0 2 8 2. + <_> + + <_> + 6 0 3 13 -1. + <_> + 7 0 1 13 3. + <_> + + <_> + 16 0 4 8 -1. + <_> + 16 0 2 8 2. + <_> + + <_> + 0 0 4 8 -1. + <_> + 2 0 2 8 2. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 11 10 8 6 -1. + <_> + 11 12 8 2 3. + <_> + + <_> + 6 0 3 20 -1. + <_> + 7 0 1 20 3. + <_> + + <_> + 7 5 8 12 -1. + <_> + 11 5 4 6 2. + <_> + 7 11 4 6 2. + <_> + + <_> + 4 5 10 12 -1. + <_> + 4 5 5 6 2. + <_> + 9 11 5 6 2. + <_> + + <_> + 12 5 4 14 -1. + <_> + 14 5 2 7 2. + <_> + 12 12 2 7 2. + <_> + + <_> + 4 5 4 14 -1. + <_> + 4 5 2 7 2. + <_> + 6 12 2 7 2. + <_> + + <_> + 14 10 6 9 -1. + <_> + 14 10 3 9 2. + <_> + + <_> + 3 8 14 2 -1. + <_> + 3 9 14 1 2. + <_> + + <_> + 11 10 8 6 -1. + <_> + 11 12 8 2 3. + <_> + + <_> + 0 15 14 3 -1. + <_> + 0 16 14 1 3. + <_> + + <_> + 11 10 8 6 -1. + <_> + 11 12 8 2 3. + <_> + + <_> + 1 10 8 6 -1. + <_> + 1 12 8 2 3. + <_> + + <_> + 1 0 18 19 -1. + <_> + 7 0 6 19 3. + <_> + + <_> + 0 9 6 10 -1. + <_> + 3 9 3 10 2. + <_> + + <_> + 11 15 9 4 -1. + <_> + 11 17 9 2 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 4 3 12 10 -1. + <_> + 8 3 4 10 3. + <_> + + <_> + 7 10 3 10 -1. + <_> + 7 15 3 5 2. + <_> + + <_> + 4 14 13 3 -1. + <_> + 4 15 13 1 3. + <_> + + <_> + 0 15 9 4 -1. + <_> + 0 17 9 2 2. + <_> + + <_> + 6 12 14 3 -1. + <_> + 6 13 14 1 3. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 11 10 6 6 -1. + <_> + 11 10 3 6 2. + <_> + + <_> + 7 0 5 15 -1. + <_> + 7 5 5 5 3. + <_> + + <_> + 4 7 13 2 -1. + <_> + 4 8 13 1 2. + <_> + + <_> + 2 8 4 12 -1. + <_> + 2 12 4 4 3. + <_> + + <_> + 12 11 7 4 -1. + <_> + 12 13 7 2 2. + <_> + + <_> + 7 5 6 15 -1. + <_> + 9 5 2 15 3. + <_> + + <_> + 12 11 7 4 -1. + <_> + 12 13 7 2 2. + <_> + + <_> + 1 11 7 4 -1. + <_> + 1 13 7 2 2. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 3 2 14 2 -1. + <_> + 3 3 14 1 2. + <_> + + <_> + 8 1 4 14 -1. + <_> + 8 8 4 7 2. + <_> + + <_> + 2 6 17 6 -1. + <_> + 2 9 17 3 2. + <_> + + <_> + 0 7 5 9 -1. + <_> + 0 10 5 3 3. + <_> + + <_> + 4 5 13 2 -1. + <_> + 4 6 13 1 2. + <_> + + <_> + 2 9 14 2 -1. + <_> + 2 10 14 1 2. + <_> + + <_> + 5 15 13 3 -1. + <_> + 5 16 13 1 3. + <_> + + <_> + 5 0 3 14 -1. + <_> + 6 0 1 14 3. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 4 0 14 4 -1. + <_> + 11 0 7 2 2. + <_> + 4 2 7 2 2. + <_> + + <_> + 0 1 20 4 -1. + <_> + 0 1 10 2 2. + <_> + 10 3 10 2 2. + <_> + + <_> + 7 0 7 6 -1. + <_> + 7 3 7 3 2. + <_> + + <_> + 5 2 6 10 -1. + <_> + 7 2 2 10 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 1 8 13 3 -1. + <_> + 1 9 13 1 3. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 0 1 20 3 -1. + <_> + 0 2 20 1 3. + <_> + + <_> + 18 3 2 17 -1. + <_> + 18 3 1 17 2. + <_> + + <_> + 0 0 20 10 -1. + <_> + 0 0 10 5 2. + <_> + 10 5 10 5 2. + <_> + + <_> + 4 8 14 4 -1. + <_> + 11 8 7 2 2. + <_> + 4 10 7 2 2. + <_> + + <_> + 0 3 7 6 -1. + <_> + 0 5 7 2 3. + <_> + + <_> + 4 8 14 4 -1. + <_> + 11 8 7 2 2. + <_> + 4 10 7 2 2. + <_> + + <_> + 2 8 14 4 -1. + <_> + 2 8 7 2 2. + <_> + 9 10 7 2 2. + <_> + + <_> + 3 4 16 10 -1. + <_> + 11 4 8 5 2. + <_> + 3 9 8 5 2. + <_> + + <_> + 6 3 8 6 -1. + <_> + 6 5 8 2 3. + <_> + + <_> + 5 3 13 2 -1. + <_> + 5 4 13 1 2. + <_> + + <_> + 4 10 6 7 -1. + <_> + 7 10 3 7 2. + <_> + + <_> + 11 7 4 13 -1. + <_> + 11 7 2 13 2. + <_> + + <_> + 5 7 4 13 -1. + <_> + 7 7 2 13 2. + <_> + + <_> + 5 10 14 3 -1. + <_> + 5 11 14 1 3. + <_> + + <_> + 2 6 3 14 -1. + <_> + 2 13 3 7 2. + <_> + + <_> + 3 9 15 3 -1. + <_> + 8 9 5 3 3. + <_> + + <_> + 2 4 6 16 -1. + <_> + 2 4 3 8 2. + <_> + 5 12 3 8 2. + <_> + + <_> + 12 0 3 13 -1. + <_> + 13 0 1 13 3. + <_> + + <_> + 4 0 8 20 -1. + <_> + 4 10 8 10 2. + <_> + + <_> + 8 2 7 9 -1. + <_> + 8 5 7 3 3. + <_> + + <_> + 5 0 3 13 -1. + <_> + 6 0 1 13 3. + <_> + + <_> + 11 2 6 10 -1. + <_> + 14 2 3 5 2. + <_> + 11 7 3 5 2. + <_> + + <_> + 5 9 6 7 -1. + <_> + 7 9 2 7 3. + <_> + + <_> + 14 0 3 13 -1. + <_> + 15 0 1 13 3. + <_> + + <_> + 7 7 6 7 -1. + <_> + 9 7 2 7 3. + <_> + + <_> + 14 0 3 13 -1. + <_> + 15 0 1 13 3. + <_> + + <_> + 1 14 13 3 -1. + <_> + 1 15 13 1 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 12 9 4 -1. + <_> + 0 14 9 2 2. + <_> + + <_> + 7 7 8 10 -1. + <_> + 11 7 4 5 2. + <_> + 7 12 4 5 2. + <_> + + <_> + 5 7 8 10 -1. + <_> + 5 7 4 5 2. + <_> + 9 12 4 5 2. + <_> + + <_> + 14 15 6 5 -1. + <_> + 14 15 3 5 2. + <_> + + <_> + 3 14 13 6 -1. + <_> + 3 16 13 2 3. + <_> + + <_> + 3 12 14 4 -1. + <_> + 10 12 7 2 2. + <_> + 3 14 7 2 2. + <_> + + <_> + 0 15 6 5 -1. + <_> + 3 15 3 5 2. + <_> + + <_> + 14 0 3 13 -1. + <_> + 15 0 1 13 3. + <_> + + <_> + 3 0 3 13 -1. + <_> + 4 0 1 13 3. + <_> + + <_> + 2 11 18 8 -1. + <_> + 8 11 6 8 3. + <_> + + <_> + 2 3 3 15 -1. + <_> + 3 3 1 15 3. + <_> + + <_> + 16 0 3 13 -1. + <_> + 17 0 1 13 3. + <_> + + <_> + 3 3 6 7 -1. + <_> + 5 3 2 7 3. + <_> + + <_> + 16 0 3 13 -1. + <_> + 17 0 1 13 3. + <_> + + <_> + 1 0 3 13 -1. + <_> + 2 0 1 13 3. + <_> + + <_> + 8 1 4 16 -1. + <_> + 10 1 2 8 2. + <_> + 8 9 2 8 2. + <_> + + <_> + 7 6 5 9 -1. + <_> + 7 9 5 3 3. + <_> + + <_> + 6 5 8 8 -1. + <_> + 6 9 8 4 2. + <_> + + <_> + 0 1 6 5 -1. + <_> + 3 1 3 5 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 11 0 9 7 -1. + <_> + 14 0 3 7 3. + <_> + + <_> + 0 11 12 7 -1. + <_> + 6 11 6 7 2. + <_> + + <_> + 7 5 9 5 -1. + <_> + 10 5 3 5 3. + <_> + + <_> + 2 1 15 2 -1. + <_> + 2 2 15 1 2. + <_> + + <_> + 15 0 5 9 -1. + <_> + 15 3 5 3 3. + <_> + + <_> + 0 0 6 5 -1. + <_> + 3 0 3 5 2. + <_> + + <_> + 6 8 14 4 -1. + <_> + 13 8 7 2 2. + <_> + 6 10 7 2 2. + <_> + + <_> + 9 0 2 13 -1. + <_> + 10 0 1 13 2. + <_> + + <_> + 4 6 12 3 -1. + <_> + 4 6 6 3 2. + <_> + + <_> + 4 2 6 7 -1. + <_> + 7 2 3 7 2. + <_> + + <_> + 9 5 4 11 -1. + <_> + 9 5 2 11 2. + <_> + + <_> + 7 5 4 11 -1. + <_> + 9 5 2 11 2. + <_> + + <_> + 5 12 15 8 -1. + <_> + 10 12 5 8 3. + <_> + + <_> + 5 7 4 9 -1. + <_> + 7 7 2 9 2. + <_> + + <_> + 6 6 10 4 -1. + <_> + 6 8 10 2 2. + <_> + + <_> + 0 4 5 9 -1. + <_> + 0 7 5 3 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 7 8 10 12 -1. + <_> + 7 12 10 4 3. + <_> + + <_> + 2 8 9 12 -1. + <_> + 5 8 3 12 3. + <_> + + <_> + 11 0 9 9 -1. + <_> + 11 3 9 3 3. + <_> + + <_> + 5 9 9 5 -1. + <_> + 8 9 3 5 3. + <_> + + <_> + 9 2 6 10 -1. + <_> + 12 2 3 5 2. + <_> + 9 7 3 5 2. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 6 3 10 6 -1. + <_> + 11 3 5 3 2. + <_> + 6 6 5 3 2. + <_> + + <_> + 3 4 14 6 -1. + <_> + 3 4 7 3 2. + <_> + 10 7 7 3 2. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 5 3 12 6 -1. + <_> + 9 3 4 6 3. + <_> + + <_> + 3 3 12 6 -1. + <_> + 7 3 4 6 3. + <_> + + <_> + 8 4 6 9 -1. + <_> + 10 4 2 9 3. + <_> + + <_> + 2 12 13 2 -1. + <_> + 2 13 13 1 2. + <_> + + <_> + 3 11 14 4 -1. + <_> + 3 13 14 2 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 6 6 10 3 -1. + <_> + 6 6 5 3 2. + <_> + + <_> + 4 6 10 3 -1. + <_> + 9 6 5 3 2. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 0 0 7 6 -1. + <_> + 0 2 7 2 3. + <_> + + <_> + 3 1 15 12 -1. + <_> + 3 7 15 6 2. + <_> + + <_> + 0 0 10 10 -1. + <_> + 0 0 5 5 2. + <_> + 5 5 5 5 2. + <_> + + <_> + 16 1 4 8 -1. + <_> + 16 5 4 4 2. + <_> + + <_> + 0 14 12 5 -1. + <_> + 4 14 4 5 3. + <_> + + <_> + 11 5 2 15 -1. + <_> + 11 5 1 15 2. + <_> + + <_> + 6 2 7 6 -1. + <_> + 6 5 7 3 2. + <_> + + <_> + 10 2 6 9 -1. + <_> + 10 5 6 3 3. + <_> + + <_> + 7 5 2 15 -1. + <_> + 8 5 1 15 2. + <_> + + <_> + 18 0 2 18 -1. + <_> + 18 0 1 18 2. + <_> + + <_> + 0 8 4 8 -1. + <_> + 0 12 4 4 2. + <_> + + <_> + 8 6 4 7 -1. + <_> + 8 6 2 7 2. + <_> + + <_> + 6 7 8 4 -1. + <_> + 10 7 4 4 2. + <_> + + <_> + 5 9 10 6 -1. + <_> + 10 9 5 3 2. + <_> + 5 12 5 3 2. + <_> + + <_> + 4 7 5 8 -1. + <_> + 4 11 5 4 2. + <_> + + <_> + 13 8 7 6 -1. + <_> + 13 10 7 2 3. + <_> + + <_> + 0 8 7 6 -1. + <_> + 0 10 7 2 3. + <_> + + <_> + 4 0 12 19 -1. + <_> + 4 0 6 19 2. + <_> + + <_> + 0 12 15 8 -1. + <_> + 5 12 5 8 3. + <_> + + <_> + 6 8 14 4 -1. + <_> + 13 8 7 2 2. + <_> + 6 10 7 2 2. + <_> + + <_> + 1 9 13 3 -1. + <_> + 1 10 13 1 3. + <_> + + <_> + 18 0 2 18 -1. + <_> + 18 0 1 18 2. + <_> + + <_> + 0 0 2 18 -1. + <_> + 1 0 1 18 2. + <_> + + <_> + 16 6 4 14 -1. + <_> + 16 6 2 14 2. + <_> + + <_> + 4 0 8 8 -1. + <_> + 4 0 4 4 2. + <_> + 8 4 4 4 2. + <_> + + <_> + 2 0 16 10 -1. + <_> + 10 0 8 5 2. + <_> + 2 5 8 5 2. + <_> + + <_> + 3 10 6 7 -1. + <_> + 6 10 3 7 2. + <_> + + <_> + 1 9 18 5 -1. + <_> + 7 9 6 5 3. + <_> + + <_> + 0 7 4 9 -1. + <_> + 2 7 2 9 2. + <_> + + <_> + 14 0 6 16 -1. + <_> + 14 0 3 16 2. + <_> + + <_> + 0 3 5 9 -1. + <_> + 0 6 5 3 3. + <_> + + <_> + 11 2 9 12 -1. + <_> + 11 6 9 4 3. + <_> + + <_> + 0 2 9 12 -1. + <_> + 0 6 9 4 3. + <_> + + <_> + 8 2 5 12 -1. + <_> + 8 6 5 4 3. + <_> + + <_> + 5 6 9 9 -1. + <_> + 5 9 9 3 3. + <_> + + <_> + 0 17 20 2 -1. + <_> + 0 18 20 1 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 7 0 6 8 -1. + <_> + 9 0 2 8 3. + <_> + + <_> + 6 5 8 14 -1. + <_> + 6 12 8 7 2. + <_> + + <_> + 11 0 9 9 -1. + <_> + 11 3 9 3 3. + <_> + + <_> + 0 0 9 9 -1. + <_> + 0 3 9 3 3. + <_> + + <_> + 11 0 4 14 -1. + <_> + 13 0 2 7 2. + <_> + 11 7 2 7 2. + <_> + + <_> + 0 1 18 4 -1. + <_> + 6 1 6 4 3. + <_> + + <_> + 11 0 4 14 -1. + <_> + 13 0 2 7 2. + <_> + 11 7 2 7 2. + <_> + + <_> + 4 0 4 14 -1. + <_> + 4 0 2 7 2. + <_> + 6 7 2 7 2. + <_> + + <_> + 6 13 10 6 -1. + <_> + 11 13 5 3 2. + <_> + 6 16 5 3 2. + <_> + + <_> + 1 8 14 4 -1. + <_> + 1 8 7 2 2. + <_> + 8 10 7 2 2. + <_> + + <_> + 11 1 4 9 -1. + <_> + 11 1 2 9 2. + <_> + + <_> + 5 1 4 9 -1. + <_> + 7 1 2 9 2. + <_> + + <_> + 9 0 6 6 -1. + <_> + 9 0 3 6 2. + <_> + + <_> + 5 0 6 6 -1. + <_> + 8 0 3 6 2. + <_> + + <_> + 6 5 8 4 -1. + <_> + 6 5 4 4 2. + <_> + + <_> + 2 9 12 4 -1. + <_> + 6 9 4 4 3. + <_> + + <_> + 10 4 3 14 -1. + <_> + 11 4 1 14 3. + <_> + + <_> + 7 4 3 14 -1. + <_> + 8 4 1 14 3. + <_> + + <_> + 0 0 20 14 -1. + <_> + 0 0 10 14 2. + <_> + + <_> + 2 9 16 10 -1. + <_> + 10 9 8 10 2. + <_> + + <_> + 2 5 16 8 -1. + <_> + 10 5 8 4 2. + <_> + 2 9 8 4 2. + <_> + + <_> + 4 2 10 6 -1. + <_> + 4 4 10 2 3. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 9 18 3 -1. + <_> + 0 10 18 1 3. + <_> + + <_> + 3 11 14 9 -1. + <_> + 3 14 14 3 3. + <_> + + <_> + 1 14 12 6 -1. + <_> + 1 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 6 15 14 4 -1. + <_> + 13 15 7 2 2. + <_> + 6 17 7 2 2. + <_> + + <_> + 3 13 10 6 -1. + <_> + 3 13 5 3 2. + <_> + 8 16 5 3 2. + <_> + + <_> + 0 6 20 3 -1. + <_> + 0 7 20 1 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 0 15 16 3 -1. + <_> + 0 16 16 1 3. + <_> + + <_> + 2 16 16 4 -1. + <_> + 10 16 8 2 2. + <_> + 2 18 8 2 2. + <_> + + <_> + 1 15 13 3 -1. + <_> + 1 16 13 1 3. + <_> + + <_> + 5 10 12 6 -1. + <_> + 11 10 6 3 2. + <_> + 5 13 6 3 2. + <_> + + <_> + 3 10 12 6 -1. + <_> + 3 10 6 3 2. + <_> + 9 13 6 3 2. + <_> + + <_> + 7 14 10 6 -1. + <_> + 12 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 2 13 7 6 -1. + <_> + 2 15 7 2 3. + <_> + + <_> + 5 14 14 2 -1. + <_> + 5 15 14 1 2. + <_> + + <_> + 1 16 18 3 -1. + <_> + 1 17 18 1 3. + <_> + + <_> + 16 1 4 14 -1. + <_> + 18 1 2 7 2. + <_> + 16 8 2 7 2. + <_> + + <_> + 6 5 8 14 -1. + <_> + 6 12 8 7 2. + <_> + + <_> + 5 14 14 2 -1. + <_> + 5 15 14 1 2. + <_> + + <_> + 4 10 6 8 -1. + <_> + 6 10 2 8 3. + <_> + + <_> + 5 4 10 12 -1. + <_> + 10 4 5 6 2. + <_> + 5 10 5 6 2. + <_> + + <_> + 3 5 13 3 -1. + <_> + 3 6 13 1 3. + <_> + + <_> + 3 13 14 4 -1. + <_> + 10 13 7 2 2. + <_> + 3 15 7 2 2. + <_> + + <_> + 5 9 6 10 -1. + <_> + 5 9 3 5 2. + <_> + 8 14 3 5 2. + <_> + + <_> + 9 7 6 7 -1. + <_> + 9 7 3 7 2. + <_> + + <_> + 5 7 6 7 -1. + <_> + 8 7 3 7 2. + <_> + + <_> + 7 13 8 6 -1. + <_> + 7 15 8 2 3. + <_> + + <_> + 0 0 8 12 -1. + <_> + 0 0 4 6 2. + <_> + 4 6 4 6 2. + <_> + + <_> + 6 8 12 5 -1. + <_> + 10 8 4 5 3. + <_> + + <_> + 5 9 8 5 -1. + <_> + 9 9 4 5 2. + <_> + + <_> + 7 5 13 3 -1. + <_> + 7 6 13 1 3. + <_> + + <_> + 0 5 13 3 -1. + <_> + 0 6 13 1 3. + <_> + + <_> + 4 0 13 6 -1. + <_> + 4 2 13 2 3. + <_> + + <_> + 0 2 8 4 -1. + <_> + 4 2 4 4 2. + <_> + + <_> + 4 7 12 4 -1. + <_> + 4 9 12 2 2. + <_> + + <_> + 2 12 10 8 -1. + <_> + 2 12 5 4 2. + <_> + 7 16 5 4 2. + <_> + + <_> + 9 4 2 14 -1. + <_> + 9 11 2 7 2. + <_> + + <_> + 4 4 3 10 -1. + <_> + 4 9 3 5 2. + <_> + + <_> + 3 0 15 2 -1. + <_> + 3 1 15 1 2. + <_> + + <_> + 0 12 8 6 -1. + <_> + 0 14 8 2 3. + <_> + + <_> + 4 18 13 2 -1. + <_> + 4 19 13 1 2. + <_> + + <_> + 2 12 16 4 -1. + <_> + 2 12 8 2 2. + <_> + 10 14 8 2 2. + <_> + + <_> + 5 3 11 9 -1. + <_> + 5 6 11 3 3. + <_> + + <_> + 0 2 20 10 -1. + <_> + 0 7 20 5 2. + <_> + + <_> + 6 9 8 8 -1. + <_> + 10 9 4 4 2. + <_> + 6 13 4 4 2. + <_> + + <_> + 3 8 6 10 -1. + <_> + 3 8 3 5 2. + <_> + 6 13 3 5 2. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 1 0 18 6 -1. + <_> + 7 0 6 6 3. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 6 5 9 5 -1. + <_> + 9 5 3 5 3. + <_> + + <_> + 1 7 18 4 -1. + <_> + 1 7 9 2 2. + <_> + 10 9 9 2 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 7 6 5 8 -1. + <_> + 7 10 5 4 2. + <_> + + <_> + 4 9 12 4 -1. + <_> + 8 9 4 4 3. + <_> + + <_> + 4 4 12 8 -1. + <_> + 8 4 4 8 3. + <_> + + <_> + 12 10 7 4 -1. + <_> + 12 12 7 2 2. + <_> + + <_> + 4 0 8 8 -1. + <_> + 4 0 4 4 2. + <_> + 8 4 4 4 2. + <_> + + <_> + 13 8 7 6 -1. + <_> + 13 10 7 2 3. + <_> + + <_> + 1 5 12 4 -1. + <_> + 5 5 4 4 3. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 1 3 14 4 -1. + <_> + 1 3 7 2 2. + <_> + 8 5 7 2 2. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 0 0 8 8 -1. + <_> + 0 0 4 4 2. + <_> + 4 4 4 4 2. + <_> + + <_> + 7 12 10 8 -1. + <_> + 7 16 10 4 2. + <_> + + <_> + 0 11 13 3 -1. + <_> + 0 12 13 1 3. + <_> + + <_> + 10 12 7 8 -1. + <_> + 10 16 7 4 2. + <_> + + <_> + 1 2 13 2 -1. + <_> + 1 3 13 1 2. + <_> + + <_> + 6 15 13 3 -1. + <_> + 6 16 13 1 3. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 8 14 10 6 -1. + <_> + 13 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 0 15 20 4 -1. + <_> + 0 15 10 2 2. + <_> + 10 17 10 2 2. + <_> + + <_> + 4 4 16 4 -1. + <_> + 4 6 16 2 2. + <_> + + <_> + 7 5 6 11 -1. + <_> + 9 5 2 11 3. + <_> + + <_> + 11 10 8 10 -1. + <_> + 15 10 4 5 2. + <_> + 11 15 4 5 2. + <_> + + <_> + 1 4 10 6 -1. + <_> + 1 4 5 3 2. + <_> + 6 7 5 3 2. + <_> + + <_> + 7 7 13 2 -1. + <_> + 7 8 13 1 2. + <_> + + <_> + 8 6 3 13 -1. + <_> + 9 6 1 13 3. + <_> + + <_> + 5 4 13 3 -1. + <_> + 5 5 13 1 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 12 10 8 10 -1. + <_> + 16 10 4 5 2. + <_> + 12 15 4 5 2. + <_> + + <_> + 0 11 18 4 -1. + <_> + 0 11 9 2 2. + <_> + 9 13 9 2 2. + <_> + + <_> + 12 10 8 10 -1. + <_> + 16 10 4 5 2. + <_> + 12 15 4 5 2. + <_> + + <_> + 0 10 8 10 -1. + <_> + 0 10 4 5 2. + <_> + 4 15 4 5 2. + <_> + + <_> + 7 6 12 14 -1. + <_> + 13 6 6 7 2. + <_> + 7 13 6 7 2. + <_> + + <_> + 1 10 7 4 -1. + <_> + 1 12 7 2 2. + <_> + + <_> + 12 10 4 7 -1. + <_> + 12 10 2 7 2. + <_> + + <_> + 0 0 20 2 -1. + <_> + 10 0 10 2 2. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 12 10 4 7 -1. + <_> + 12 10 2 7 2. + <_> + + <_> + 4 10 4 7 -1. + <_> + 6 10 2 7 2. + <_> + + <_> + 12 0 2 14 -1. + <_> + 12 0 1 14 2. + <_> + + <_> + 4 2 12 17 -1. + <_> + 10 2 6 17 2. + <_> + + <_> + 12 12 6 7 -1. + <_> + 12 12 3 7 2. + <_> + + <_> + 1 9 10 10 -1. + <_> + 6 9 5 10 2. + <_> + + <_> + 4 6 13 3 -1. + <_> + 4 7 13 1 3. + <_> + + <_> + 7 6 5 9 -1. + <_> + 7 9 5 3 3. + <_> + + <_> + 9 5 4 14 -1. + <_> + 11 5 2 7 2. + <_> + 9 12 2 7 2. + <_> + + <_> + 8 5 4 14 -1. + <_> + 8 5 2 7 2. + <_> + 10 12 2 7 2. + <_> + + <_> + 9 3 6 12 -1. + <_> + 11 3 2 12 3. + <_> + + <_> + 5 3 6 12 -1. + <_> + 7 3 2 12 3. + <_> + + <_> + 4 10 14 4 -1. + <_> + 11 10 7 2 2. + <_> + 4 12 7 2 2. + <_> + + <_> + 2 10 14 4 -1. + <_> + 2 10 7 2 2. + <_> + 9 12 7 2 2. + <_> + + <_> + 7 4 6 7 -1. + <_> + 9 4 2 7 3. + <_> + + <_> + 1 14 13 2 -1. + <_> + 1 15 13 1 2. + <_> + + <_> + 7 14 13 2 -1. + <_> + 7 15 13 1 2. + <_> + + <_> + 4 13 12 4 -1. + <_> + 4 15 12 2 2. + <_> + + <_> + 12 13 7 4 -1. + <_> + 12 15 7 2 2. + <_> + + <_> + 1 13 7 4 -1. + <_> + 1 15 7 2 2. + <_> + + <_> + 10 6 3 14 -1. + <_> + 11 6 1 14 3. + <_> + + <_> + 7 6 3 14 -1. + <_> + 8 6 1 14 3. + <_> + + <_> + 8 13 6 7 -1. + <_> + 10 13 2 7 3. + <_> + + <_> + 2 5 6 10 -1. + <_> + 2 5 3 5 2. + <_> + 5 10 3 5 2. + <_> + + <_> + 15 3 3 16 -1. + <_> + 16 3 1 16 3. + <_> + + <_> + 2 3 3 16 -1. + <_> + 3 3 1 16 3. + <_> + + <_> + 14 0 6 13 -1. + <_> + 14 0 3 13 2. + <_> + + <_> + 0 0 6 13 -1. + <_> + 3 0 3 13 2. + <_> + + <_> + 17 6 3 14 -1. + <_> + 17 13 3 7 2. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 17 6 3 14 -1. + <_> + 17 13 3 7 2. + <_> + + <_> + 1 10 10 10 -1. + <_> + 1 10 5 5 2. + <_> + 6 15 5 5 2. + <_> + + <_> + 0 0 20 10 -1. + <_> + 0 5 20 5 2. + <_> + + <_> + 2 8 13 3 -1. + <_> + 2 9 13 1 3. + <_> + + <_> + 7 6 10 14 -1. + <_> + 7 13 10 7 2. + <_> + + <_> + 0 7 13 2 -1. + <_> + 0 8 13 1 2. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 10 5 2 7 2. + <_> + + <_> + 8 6 6 10 -1. + <_> + 10 6 2 10 3. + <_> + + <_> + 3 13 14 6 -1. + <_> + 3 13 7 3 2. + <_> + 10 16 7 3 2. + <_> + + <_> + 10 1 4 19 -1. + <_> + 10 1 2 19 2. + <_> + + <_> + 1 10 18 6 -1. + <_> + 1 12 18 2 3. + <_> + + <_> + 6 6 10 3 -1. + <_> + 6 6 5 3 2. + <_> + + <_> + 6 1 4 19 -1. + <_> + 8 1 2 19 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 0 5 20 2 -1. + <_> + 0 6 20 1 2. + <_> + + <_> + 6 14 13 3 -1. + <_> + 6 15 13 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 12 0 4 7 -1. + <_> + 12 0 2 7 2. + <_> + + <_> + 0 2 18 8 -1. + <_> + 6 2 6 8 3. + <_> + + <_> + 10 0 10 9 -1. + <_> + 10 0 5 9 2. + <_> + + <_> + 0 0 10 9 -1. + <_> + 5 0 5 9 2. + <_> + + <_> + 12 13 7 6 -1. + <_> + 12 15 7 2 3. + <_> + + <_> + 1 13 5 6 -1. + <_> + 1 16 5 3 2. + <_> + + <_> + 8 4 6 10 -1. + <_> + 11 4 3 5 2. + <_> + 8 9 3 5 2. + <_> + + <_> + 4 5 12 10 -1. + <_> + 4 5 6 5 2. + <_> + 10 10 6 5 2. + <_> + + <_> + 13 9 5 9 -1. + <_> + 13 12 5 3 3. + <_> + + <_> + 0 0 2 18 -1. + <_> + 1 0 1 18 2. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 1 12 18 8 -1. + <_> + 1 12 9 4 2. + <_> + 10 16 9 4 2. + <_> + + <_> + 7 10 6 10 -1. + <_> + 10 10 3 5 2. + <_> + 7 15 3 5 2. + <_> + + <_> + 4 3 10 4 -1. + <_> + 4 5 10 2 2. + <_> + + <_> + 6 1 9 6 -1. + <_> + 6 3 9 2 3. + <_> + + <_> + 5 4 10 10 -1. + <_> + 5 9 10 5 2. + <_> + + <_> + 8 10 5 8 -1. + <_> + 8 14 5 4 2. + <_> + + <_> + 3 8 13 10 -1. + <_> + 3 13 13 5 2. + <_> + + <_> + 12 8 5 12 -1. + <_> + 12 14 5 6 2. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 12 0 2 17 -1. + <_> + 12 0 1 17 2. + <_> + + <_> + 6 0 2 17 -1. + <_> + 7 0 1 17 2. + <_> + + <_> + 0 5 20 6 -1. + <_> + 0 7 20 2 3. + <_> + + <_> + 0 1 2 13 -1. + <_> + 1 1 1 13 2. + <_> + + <_> + 12 0 5 15 -1. + <_> + 12 5 5 5 3. + <_> + + <_> + 3 0 5 15 -1. + <_> + 3 5 5 5 3. + <_> + + <_> + 10 3 9 4 -1. + <_> + 10 5 9 2 2. + <_> + + <_> + 3 5 14 2 -1. + <_> + 3 6 14 1 2. + <_> + + <_> + 3 2 14 6 -1. + <_> + 10 2 7 3 2. + <_> + 3 5 7 3 2. + <_> + + <_> + 6 4 8 6 -1. + <_> + 6 6 8 2 3. + <_> + + <_> + 11 3 4 8 -1. + <_> + 11 3 2 8 2. + <_> + + <_> + 8 5 3 13 -1. + <_> + 9 5 1 13 3. + <_> + + <_> + 9 0 3 13 -1. + <_> + 10 0 1 13 3. + <_> + + <_> + 5 3 6 7 -1. + <_> + 7 3 2 7 3. + <_> + + <_> + 2 6 18 5 -1. + <_> + 8 6 6 5 3. + <_> + + <_> + 6 8 8 4 -1. + <_> + 10 8 4 4 2. + <_> + + <_> + 8 4 6 10 -1. + <_> + 11 4 3 5 2. + <_> + 8 9 3 5 2. + <_> + + <_> + 4 5 12 6 -1. + <_> + 4 5 6 3 2. + <_> + 10 8 6 3 2. + <_> + + <_> + 9 2 6 10 -1. + <_> + 12 2 3 5 2. + <_> + 9 7 3 5 2. + <_> + + <_> + 3 12 7 8 -1. + <_> + 3 16 7 4 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 6 13 6 7 -1. + <_> + 8 13 2 7 3. + <_> + + <_> + 2 6 18 9 -1. + <_> + 2 9 18 3 3. + <_> + + <_> + 1 8 16 2 -1. + <_> + 9 8 8 2 2. + <_> + + <_> + 5 2 11 4 -1. + <_> + 5 4 11 2 2. + <_> + + <_> + 0 12 10 8 -1. + <_> + 0 12 5 4 2. + <_> + 5 16 5 4 2. + <_> + + <_> + 3 1 15 8 -1. + <_> + 8 1 5 8 3. + <_> + + <_> + 2 1 15 8 -1. + <_> + 7 1 5 8 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 3 4 14 9 -1. + <_> + 3 7 14 3 3. + <_> + + <_> + 4 3 15 5 -1. + <_> + 9 3 5 5 3. + <_> + + <_> + 0 2 20 12 -1. + <_> + 0 8 20 6 2. + <_> + + <_> + 4 1 12 4 -1. + <_> + 8 1 4 4 3. + <_> + + <_> + 0 2 20 12 -1. + <_> + 0 8 20 6 2. + <_> + + <_> + 10 11 4 9 -1. + <_> + 10 11 2 9 2. + <_> + + <_> + 2 1 12 15 -1. + <_> + 6 1 4 15 3. + <_> + + <_> + 10 9 10 3 -1. + <_> + 10 9 5 3 2. + <_> + + <_> + 0 9 10 3 -1. + <_> + 5 9 5 3 2. + <_> + + <_> + 6 1 8 14 -1. + <_> + 6 8 8 7 2. + <_> + + <_> + 6 6 6 12 -1. + <_> + 6 6 3 6 2. + <_> + 9 12 3 6 2. + <_> + + <_> + 10 11 4 9 -1. + <_> + 10 11 2 9 2. + <_> + + <_> + 6 11 4 9 -1. + <_> + 8 11 2 9 2. + <_> + + <_> + 8 9 6 5 -1. + <_> + 8 9 3 5 2. + <_> + + <_> + 6 9 6 5 -1. + <_> + 9 9 3 5 2. + <_> + + <_> + 6 11 9 6 -1. + <_> + 9 11 3 6 3. + <_> + + <_> + 5 2 6 10 -1. + <_> + 5 2 3 5 2. + <_> + 8 7 3 5 2. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 0 1 9 18 -1. + <_> + 3 1 3 18 3. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 3 1 6 10 -1. + <_> + 3 1 3 5 2. + <_> + 6 6 3 5 2. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 1 3 18 12 -1. + <_> + 1 3 9 6 2. + <_> + 10 9 9 6 2. + <_> + + <_> + 7 15 13 3 -1. + <_> + 7 16 13 1 3. + <_> + + <_> + 1 15 13 3 -1. + <_> + 1 16 13 1 3. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 2 14 7 6 -1. + <_> + 2 16 7 2 3. + <_> + + <_> + 6 16 14 4 -1. + <_> + 13 16 7 2 2. + <_> + 6 18 7 2 2. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 10 4 6 8 -1. + <_> + 12 4 2 8 3. + <_> + + <_> + 6 0 3 13 -1. + <_> + 7 0 1 13 3. + <_> + + <_> + 11 9 3 10 -1. + <_> + 11 14 3 5 2. + <_> + + <_> + 1 8 14 3 -1. + <_> + 1 9 14 1 3. + <_> + + <_> + 4 7 12 6 -1. + <_> + 4 9 12 2 3. + <_> + + <_> + 6 8 8 9 -1. + <_> + 6 11 8 3 3. + <_> + + <_> + 4 13 12 4 -1. + <_> + 4 15 12 2 2. + <_> + + <_> + 1 12 18 2 -1. + <_> + 1 13 18 1 2. + <_> + + <_> + 11 9 4 8 -1. + <_> + 11 13 4 4 2. + <_> + + <_> + 5 9 4 8 -1. + <_> + 5 13 4 4 2. + <_> + + <_> + 7 6 10 6 -1. + <_> + 12 6 5 3 2. + <_> + 7 9 5 3 2. + <_> + + <_> + 5 11 9 6 -1. + <_> + 8 11 3 6 3. + <_> + + <_> + 4 3 14 2 -1. + <_> + 4 3 7 2 2. + <_> + + <_> + 2 12 9 6 -1. + <_> + 5 12 3 6 3. + <_> + + <_> + 14 1 6 12 -1. + <_> + 17 1 3 6 2. + <_> + 14 7 3 6 2. + <_> + + <_> + 0 1 6 12 -1. + <_> + 0 1 3 6 2. + <_> + 3 7 3 6 2. + <_> + + <_> + 12 0 8 6 -1. + <_> + 12 2 8 2 3. + <_> + + <_> + 0 16 18 2 -1. + <_> + 0 17 18 1 2. + <_> + + <_> + 5 16 11 4 -1. + <_> + 5 18 11 2 2. + <_> + + <_> + 2 16 13 3 -1. + <_> + 2 17 13 1 3. + <_> + + <_> + 14 9 6 11 -1. + <_> + 16 9 2 11 3. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 11 1 8 6 -1. + <_> + 11 3 8 2 3. + <_> + + <_> + 0 11 13 3 -1. + <_> + 0 12 13 1 3. + <_> + + <_> + 10 10 4 8 -1. + <_> + 10 14 4 4 2. + <_> + + <_> + 5 5 9 15 -1. + <_> + 8 5 3 15 3. + <_> + + <_> + 7 13 6 7 -1. + <_> + 9 13 2 7 3. + <_> + + <_> + 0 15 13 2 -1. + <_> + 0 16 13 1 2. + <_> + + <_> + 11 1 8 6 -1. + <_> + 11 3 8 2 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 9 6 6 7 -1. + <_> + 11 6 2 7 3. + <_> + + <_> + 5 6 6 7 -1. + <_> + 7 6 2 7 3. + <_> + + <_> + 6 11 10 6 -1. + <_> + 11 11 5 3 2. + <_> + 6 14 5 3 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 10 4 4 2. + <_> + 10 14 4 4 2. + <_> + + <_> + 11 1 8 6 -1. + <_> + 11 3 8 2 3. + <_> + + <_> + 4 4 11 10 -1. + <_> + 4 9 11 5 2. + <_> + + <_> + 11 1 8 6 -1. + <_> + 11 3 8 2 3. + <_> + + <_> + 1 1 8 6 -1. + <_> + 1 3 8 2 3. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 8 4 6 2. + <_> + + <_> + 2 2 16 3 -1. + <_> + 2 3 16 1 3. + <_> + + <_> + 18 1 2 13 -1. + <_> + 18 1 1 13 2. + <_> + + <_> + 0 4 5 6 -1. + <_> + 0 7 5 3 2. + <_> + + <_> + 5 6 13 3 -1. + <_> + 5 7 13 1 3. + <_> + + <_> + 4 1 6 7 -1. + <_> + 6 1 2 7 3. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 0 12 7 6 -1. + <_> + 0 14 7 2 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 7 2 8 8 -1. + <_> + 11 2 4 4 2. + <_> + 7 6 4 4 2. + <_> + + <_> + 5 2 8 8 -1. + <_> + 5 2 4 4 2. + <_> + 9 6 4 4 2. + <_> + + <_> + 15 3 4 16 -1. + <_> + 17 3 2 8 2. + <_> + 15 11 2 8 2. + <_> + + <_> + 1 12 7 6 -1. + <_> + 1 14 7 2 3. + <_> + + <_> + 5 13 13 3 -1. + <_> + 5 14 13 1 3. + <_> + + <_> + 4 10 4 8 -1. + <_> + 4 14 4 4 2. + <_> + + <_> + 4 14 13 6 -1. + <_> + 4 16 13 2 3. + <_> + + <_> + 1 14 14 3 -1. + <_> + 1 15 14 1 3. + <_> + + <_> + 18 1 2 13 -1. + <_> + 18 1 1 13 2. + <_> + + <_> + 1 1 18 4 -1. + <_> + 1 1 9 2 2. + <_> + 10 3 9 2 2. + <_> + + <_> + 18 1 2 13 -1. + <_> + 18 1 1 13 2. + <_> + + <_> + 0 1 2 13 -1. + <_> + 1 1 1 13 2. + <_> + + <_> + 2 0 18 2 -1. + <_> + 2 0 9 2 2. + <_> + + <_> + 0 0 6 12 -1. + <_> + 2 0 2 12 3. + <_> + + <_> + 16 0 4 7 -1. + <_> + 16 0 2 7 2. + <_> + + <_> + 0 2 5 6 -1. + <_> + 0 5 5 3 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 0 4 7 -1. + <_> + 2 0 2 7 2. + <_> + + <_> + 7 15 7 4 -1. + <_> + 7 17 7 2 2. + <_> + + <_> + 1 0 13 3 -1. + <_> + 1 1 13 1 3. + <_> + + <_> + 9 0 9 6 -1. + <_> + 9 2 9 2 3. + <_> + + <_> + 0 4 14 3 -1. + <_> + 0 5 14 1 3. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 5 4 13 3 -1. + <_> + 5 5 13 1 3. + <_> + + <_> + 5 0 8 8 -1. + <_> + 5 4 8 4 2. + <_> + + <_> + 9 0 9 6 -1. + <_> + 9 2 9 2 3. + <_> + + <_> + 2 0 9 6 -1. + <_> + 2 2 9 2 3. + <_> + + <_> + 6 6 14 4 -1. + <_> + 13 6 7 2 2. + <_> + 6 8 7 2 2. + <_> + + <_> + 1 7 16 4 -1. + <_> + 1 7 8 2 2. + <_> + 9 9 8 2 2. + <_> + + <_> + 8 7 4 7 -1. + <_> + 8 7 2 7 2. + <_> + + <_> + 5 9 9 5 -1. + <_> + 8 9 3 5 3. + <_> + + <_> + 4 5 12 4 -1. + <_> + 8 5 4 4 3. + <_> + + <_> + 1 0 6 13 -1. + <_> + 3 0 2 13 3. + <_> + + <_> + 16 7 4 11 -1. + <_> + 16 7 2 11 2. + <_> + + <_> + 0 7 4 11 -1. + <_> + 2 7 2 11 2. + <_> + + <_> + 8 6 4 8 -1. + <_> + 8 10 4 4 2. + <_> + + <_> + 0 10 20 3 -1. + <_> + 0 11 20 1 3. + <_> + + <_> + 11 13 8 6 -1. + <_> + 11 15 8 2 3. + <_> + + <_> + 8 0 3 13 -1. + <_> + 9 0 1 13 3. + <_> + + <_> + 9 6 3 13 -1. + <_> + 10 6 1 13 3. + <_> + + <_> + 7 10 6 10 -1. + <_> + 9 10 2 10 3. + <_> + + <_> + 16 0 4 18 -1. + <_> + 16 0 2 18 2. + <_> + + <_> + 3 8 14 3 -1. + <_> + 3 9 14 1 3. + <_> + + <_> + 4 9 13 3 -1. + <_> + 4 10 13 1 3. + <_> + + <_> + 0 0 4 19 -1. + <_> + 2 0 2 19 2. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 8 5 10 10 -1. + <_> + 13 5 5 5 2. + <_> + 8 10 5 5 2. + <_> + + <_> + 1 8 6 12 -1. + <_> + 1 8 3 6 2. + <_> + 4 14 3 6 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 4 1 3 13 -1. + <_> + 5 1 1 13 3. + <_> + + <_> + 4 4 13 3 -1. + <_> + 4 5 13 1 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 5 1 10 19 -1. + <_> + 5 1 5 19 2. + <_> + + <_> + 1 13 8 6 -1. + <_> + 1 15 8 2 3. + <_> + + <_> + 4 5 13 3 -1. + <_> + 4 6 13 1 3. + <_> + + <_> + 0 6 14 4 -1. + <_> + 0 6 7 2 2. + <_> + 7 8 7 2 2. + <_> + + <_> + 14 3 6 16 -1. + <_> + 17 3 3 8 2. + <_> + 14 11 3 8 2. + <_> + + <_> + 1 4 18 10 -1. + <_> + 1 4 9 5 2. + <_> + 10 9 9 5 2. + <_> + + <_> + 14 2 6 16 -1. + <_> + 17 2 3 8 2. + <_> + 14 10 3 8 2. + <_> + + <_> + 0 2 6 16 -1. + <_> + 0 2 3 8 2. + <_> + 3 10 3 8 2. + <_> + + <_> + 14 8 6 12 -1. + <_> + 14 8 3 12 2. + <_> + + <_> + 0 8 6 12 -1. + <_> + 3 8 3 12 2. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 0 0 6 5 -1. + <_> + 3 0 3 5 2. + <_> + + <_> + 8 2 4 8 -1. + <_> + 8 6 4 4 2. + <_> + + <_> + 0 12 8 8 -1. + <_> + 4 12 4 8 2. + <_> + + <_> + 2 4 18 16 -1. + <_> + 8 4 6 16 3. + <_> + + <_> + 5 7 4 7 -1. + <_> + 7 7 2 7 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 5 6 8 4 -1. + <_> + 9 6 4 4 2. + <_> + + <_> + 7 2 10 4 -1. + <_> + 7 2 5 4 2. + <_> + + <_> + 0 14 8 6 -1. + <_> + 0 16 8 2 3. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 1 14 18 6 -1. + <_> + 1 16 18 2 3. + <_> + + <_> + 9 0 2 13 -1. + <_> + 10 0 1 13 2. + <_> + + <_> + 1 1 19 3 -1. + <_> + 1 2 19 1 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 4 18 13 2 -1. + <_> + 4 19 13 1 2. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 13 10 7 6 -1. + <_> + 13 12 7 2 3. + <_> + + <_> + 0 10 7 6 -1. + <_> + 0 12 7 2 3. + <_> + + <_> + 4 14 13 3 -1. + <_> + 4 15 13 1 3. + <_> + + <_> + 3 14 13 3 -1. + <_> + 3 15 13 1 3. + <_> + + <_> + 1 15 18 4 -1. + <_> + 10 15 9 2 2. + <_> + 1 17 9 2 2. + <_> + + <_> + 2 10 6 10 -1. + <_> + 4 10 2 10 3. + <_> + + <_> + 11 14 9 6 -1. + <_> + 14 14 3 6 3. + <_> + + <_> + 4 10 12 10 -1. + <_> + 10 10 6 10 2. + <_> + + <_> + 6 6 8 7 -1. + <_> + 6 6 4 7 2. + <_> + + <_> + 8 4 4 7 -1. + <_> + 10 4 2 7 2. + <_> + + <_> + 9 0 3 15 -1. + <_> + 9 5 3 5 3. + <_> + + <_> + 2 7 12 12 -1. + <_> + 2 11 12 4 3. + <_> + + <_> + 4 0 12 6 -1. + <_> + 4 2 12 2 3. + <_> + + <_> + 5 10 9 9 -1. + <_> + 5 13 9 3 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 0 12 8 8 -1. + <_> + 0 12 4 4 2. + <_> + 4 16 4 4 2. + <_> + + <_> + 14 11 6 9 -1. + <_> + 14 14 6 3 3. + <_> + + <_> + 5 1 7 6 -1. + <_> + 5 3 7 2 3. + <_> + + <_> + 9 5 3 14 -1. + <_> + 9 12 3 7 2. + <_> + + <_> + 8 9 4 8 -1. + <_> + 8 13 4 4 2. + <_> + + <_> + 7 5 6 14 -1. + <_> + 7 12 6 7 2. + <_> + + <_> + 4 9 4 8 -1. + <_> + 6 9 2 8 2. + <_> + + <_> + 12 9 6 9 -1. + <_> + 14 9 2 9 3. + <_> + + <_> + 2 9 6 9 -1. + <_> + 4 9 2 9 3. + <_> + + <_> + 4 16 15 4 -1. + <_> + 9 16 5 4 3. + <_> + + <_> + 3 2 10 4 -1. + <_> + 8 2 5 4 2. + <_> + + <_> + 10 0 4 12 -1. + <_> + 10 0 2 12 2. + <_> + + <_> + 6 0 4 12 -1. + <_> + 8 0 2 12 2. + <_> + + <_> + 7 4 6 7 -1. + <_> + 9 4 2 7 3. + <_> + + <_> + 5 2 3 13 -1. + <_> + 6 2 1 13 3. + <_> + + <_> + 12 5 5 9 -1. + <_> + 12 8 5 3 3. + <_> + + <_> + 5 6 9 12 -1. + <_> + 5 10 9 4 3. + <_> + + <_> + 9 0 4 20 -1. + <_> + 11 0 2 10 2. + <_> + 9 10 2 10 2. + <_> + + <_> + 8 0 4 16 -1. + <_> + 8 0 2 8 2. + <_> + 10 8 2 8 2. + <_> + + <_> + 2 9 18 11 -1. + <_> + 8 9 6 11 3. + <_> + + <_> + 0 11 6 9 -1. + <_> + 0 14 6 3 3. + <_> + + <_> + 13 6 6 12 -1. + <_> + 13 6 3 12 2. + <_> + + <_> + 6 12 8 8 -1. + <_> + 6 12 4 4 2. + <_> + 10 16 4 4 2. + <_> + + <_> + 1 9 18 8 -1. + <_> + 10 9 9 4 2. + <_> + 1 13 9 4 2. + <_> + + <_> + 2 8 12 4 -1. + <_> + 6 8 4 4 3. + <_> + + <_> + 13 6 6 12 -1. + <_> + 13 6 3 12 2. + <_> + + <_> + 1 6 6 12 -1. + <_> + 4 6 3 12 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 3 15 13 3 -1. + <_> + 3 16 13 1 3. + <_> + + <_> + 7 15 13 3 -1. + <_> + 7 16 13 1 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 17 0 3 14 -1. + <_> + 18 0 1 14 3. + <_> + + <_> + 0 0 20 16 -1. + <_> + 0 8 20 8 2. + <_> + + <_> + 6 3 14 4 -1. + <_> + 13 3 7 2 2. + <_> + 6 5 7 2 2. + <_> + + <_> + 0 2 20 6 -1. + <_> + 0 2 10 3 2. + <_> + 10 5 10 3 2. + <_> + + <_> + 17 0 3 14 -1. + <_> + 18 0 1 14 3. + <_> + + <_> + 5 9 4 9 -1. + <_> + 7 9 2 9 2. + <_> + + <_> + 11 11 4 7 -1. + <_> + 11 11 2 7 2. + <_> + + <_> + 5 7 6 10 -1. + <_> + 7 7 2 10 3. + <_> + + <_> + 0 7 20 2 -1. + <_> + 0 7 10 2 2. + <_> + + <_> + 3 4 14 12 -1. + <_> + 3 4 7 6 2. + <_> + 10 10 7 6 2. + <_> + + <_> + 7 13 6 7 -1. + <_> + 9 13 2 7 3. + <_> + + <_> + 6 5 6 8 -1. + <_> + 8 5 2 8 3. + <_> + + <_> + 11 5 4 10 -1. + <_> + 11 5 2 10 2. + <_> + + <_> + 1 2 18 14 -1. + <_> + 7 2 6 14 3. + <_> + + <_> + 3 3 14 8 -1. + <_> + 10 3 7 4 2. + <_> + 3 7 7 4 2. + <_> + + <_> + 4 0 6 9 -1. + <_> + 6 0 2 9 3. + <_> + + <_> + 5 9 10 11 -1. + <_> + 5 9 5 11 2. + <_> + + <_> + 5 7 10 8 -1. + <_> + 5 7 5 4 2. + <_> + 10 11 5 4 2. + <_> + + <_> + 16 0 4 16 -1. + <_> + 16 8 4 8 2. + <_> + + <_> + 1 4 18 4 -1. + <_> + 10 4 9 4 2. + <_> + + <_> + 4 10 14 3 -1. + <_> + 4 11 14 1 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 17 0 3 14 -1. + <_> + 18 0 1 14 3. + <_> + + <_> + 2 12 7 6 -1. + <_> + 2 14 7 2 3. + <_> + + <_> + 13 1 6 10 -1. + <_> + 16 1 3 5 2. + <_> + 13 6 3 5 2. + <_> + + <_> + 1 1 6 10 -1. + <_> + 1 1 3 5 2. + <_> + 4 6 3 5 2. + <_> + + <_> + 3 2 14 3 -1. + <_> + 3 3 14 1 3. + <_> + + <_> + 3 12 13 3 -1. + <_> + 3 13 13 1 3. + <_> + + <_> + 11 4 8 8 -1. + <_> + 15 4 4 4 2. + <_> + 11 8 4 4 2. + <_> + + <_> + 2 13 13 3 -1. + <_> + 2 14 13 1 3. + <_> + + <_> + 11 11 7 4 -1. + <_> + 11 13 7 2 2. + <_> + + <_> + 0 14 14 2 -1. + <_> + 0 15 14 1 2. + <_> + + <_> + 11 4 8 8 -1. + <_> + 15 4 4 4 2. + <_> + 11 8 4 4 2. + <_> + + <_> + 0 9 5 9 -1. + <_> + 0 12 5 3 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 3 5 5 9 -1. + <_> + 3 8 5 3 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 10 0 10 8 -1. + <_> + 15 0 5 4 2. + <_> + 10 4 5 4 2. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 12 11 7 6 -1. + <_> + 12 13 7 2 3. + <_> + + <_> + 0 4 12 9 -1. + <_> + 0 7 12 3 3. + <_> + + <_> + 0 7 20 4 -1. + <_> + 0 9 20 2 2. + <_> + + <_> + 5 2 10 4 -1. + <_> + 10 2 5 4 2. + <_> + + <_> + 11 11 4 7 -1. + <_> + 11 11 2 7 2. + <_> + + <_> + 6 12 4 7 -1. + <_> + 8 12 2 7 2. + <_> + + <_> + 11 13 9 7 -1. + <_> + 14 13 3 7 3. + <_> + + <_> + 4 15 12 5 -1. + <_> + 10 15 6 5 2. + <_> + + <_> + 8 9 4 8 -1. + <_> + 8 9 2 8 2. + <_> + + <_> + 5 11 6 7 -1. + <_> + 7 11 2 7 3. + <_> + + <_> + 8 5 6 7 -1. + <_> + 8 5 3 7 2. + <_> + + <_> + 6 5 6 7 -1. + <_> + 9 5 3 7 2. + <_> + + <_> + 2 6 16 9 -1. + <_> + 2 9 16 3 3. + <_> + + <_> + 3 8 14 2 -1. + <_> + 3 9 14 1 2. + <_> + + <_> + 9 4 3 15 -1. + <_> + 9 9 3 5 3. + <_> + + <_> + 7 10 4 8 -1. + <_> + 7 14 4 4 2. + <_> + + <_> + 16 9 4 11 -1. + <_> + 16 9 2 11 2. + <_> + + <_> + 0 9 4 11 -1. + <_> + 2 9 2 11 2. + <_> + + <_> + 7 3 8 10 -1. + <_> + 7 8 8 5 2. + <_> + + <_> + 4 9 6 5 -1. + <_> + 7 9 3 5 2. + <_> + + <_> + 7 16 8 4 -1. + <_> + 7 16 4 4 2. + <_> + + <_> + 1 0 10 20 -1. + <_> + 1 0 5 10 2. + <_> + 6 10 5 10 2. + <_> + + <_> + 10 1 4 10 -1. + <_> + 10 6 4 5 2. + <_> + + <_> + 4 6 12 4 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 1 7 18 4 -1. + <_> + 10 7 9 2 2. + <_> + 1 9 9 2 2. + <_> + + <_> + 5 14 10 6 -1. + <_> + 5 16 10 2 3. + <_> + + <_> + 7 12 13 3 -1. + <_> + 7 13 13 1 3. + <_> + + <_> + 2 11 7 6 -1. + <_> + 2 13 7 2 3. + <_> + + <_> + 11 12 5 8 -1. + <_> + 11 16 5 4 2. + <_> + + <_> + 4 12 5 8 -1. + <_> + 4 16 5 4 2. + <_> + + <_> + 10 10 10 4 -1. + <_> + 10 12 10 2 2. + <_> + + <_> + 4 12 9 6 -1. + <_> + 4 15 9 3 2. + <_> + + <_> + 10 10 10 4 -1. + <_> + 10 12 10 2 2. + <_> + + <_> + 0 10 10 4 -1. + <_> + 0 12 10 2 2. + <_> + + <_> + 16 0 4 16 -1. + <_> + 16 8 4 8 2. + <_> + + <_> + 7 4 3 15 -1. + <_> + 7 9 3 5 3. + <_> + + <_> + 9 10 10 6 -1. + <_> + 14 10 5 3 2. + <_> + 9 13 5 3 2. + <_> + + <_> + 3 1 14 14 -1. + <_> + 3 1 7 7 2. + <_> + 10 8 7 7 2. + <_> + + <_> + 16 5 4 14 -1. + <_> + 18 5 2 7 2. + <_> + 16 12 2 7 2. + <_> + + <_> + 0 5 4 14 -1. + <_> + 0 5 2 7 2. + <_> + 2 12 2 7 2. + <_> + + <_> + 5 2 13 3 -1. + <_> + 5 3 13 1 3. + <_> + + <_> + 0 16 17 2 -1. + <_> + 0 17 17 1 2. + <_> + + <_> + 2 9 16 6 -1. + <_> + 2 12 16 3 2. + <_> + + <_> + 1 10 18 2 -1. + <_> + 1 11 18 1 2. + <_> + + <_> + 5 10 13 3 -1. + <_> + 5 11 13 1 3. + <_> + + <_> + 3 0 13 9 -1. + <_> + 3 3 13 3 3. + <_> + + <_> + 6 4 9 5 -1. + <_> + 9 4 3 5 3. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 10 1 10 4 -1. + <_> + 10 1 5 4 2. + <_> + + <_> + 1 3 18 15 -1. + <_> + 1 8 18 5 3. + <_> + + <_> + 14 2 6 12 -1. + <_> + 14 2 3 12 2. + <_> + + <_> + 1 2 6 5 -1. + <_> + 4 2 3 5 2. + <_> + + <_> + 12 5 8 8 -1. + <_> + 16 5 4 4 2. + <_> + 12 9 4 4 2. + <_> + + <_> + 0 11 13 3 -1. + <_> + 0 12 13 1 3. + <_> + + <_> + 12 11 7 4 -1. + <_> + 12 13 7 2 2. + <_> + + <_> + 0 0 17 3 -1. + <_> + 0 1 17 1 3. + <_> + + <_> + 6 5 9 8 -1. + <_> + 6 9 9 4 2. + <_> + + <_> + 1 11 7 4 -1. + <_> + 1 13 7 2 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 4 9 12 5 -1. + <_> + 8 9 4 5 3. + <_> + + <_> + 4 8 15 3 -1. + <_> + 9 8 5 3 3. + <_> + + <_> + 1 8 15 3 -1. + <_> + 6 8 5 3 3. + <_> + + <_> + 4 13 13 3 -1. + <_> + 4 14 13 1 3. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 10 1 7 4 -1. + <_> + 10 3 7 2 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 10 9 6 10 -1. + <_> + 13 9 3 5 2. + <_> + 10 14 3 5 2. + <_> + + <_> + 0 10 20 5 -1. + <_> + 10 10 10 5 2. + <_> + + <_> + 2 1 16 4 -1. + <_> + 10 1 8 2 2. + <_> + 2 3 8 2 2. + <_> + + <_> + 4 0 12 6 -1. + <_> + 4 3 12 3 2. + <_> + + <_> + 10 9 6 5 -1. + <_> + 10 9 3 5 2. + <_> + + <_> + 4 9 6 5 -1. + <_> + 7 9 3 5 2. + <_> + + <_> + 2 3 16 17 -1. + <_> + 2 3 8 17 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 12 5 8 8 -1. + <_> + 16 5 4 4 2. + <_> + 12 9 4 4 2. + <_> + + <_> + 0 5 8 8 -1. + <_> + 0 5 4 4 2. + <_> + 4 9 4 4 2. + <_> + + <_> + 18 4 2 16 -1. + <_> + 18 12 2 8 2. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 2 0 18 3 -1. + <_> + 8 0 6 3 3. + <_> + + <_> + 2 6 15 3 -1. + <_> + 2 7 15 1 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 2 12 16 6 -1. + <_> + 2 14 16 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 5 13 13 3 -1. + <_> + 5 14 13 1 3. + <_> + + <_> + 3 0 3 13 -1. + <_> + 4 0 1 13 3. + <_> + + <_> + 5 5 10 12 -1. + <_> + 10 5 5 6 2. + <_> + 5 11 5 6 2. + <_> + + <_> + 2 4 14 12 -1. + <_> + 2 4 7 6 2. + <_> + 9 10 7 6 2. + <_> + + <_> + 18 4 2 16 -1. + <_> + 18 12 2 8 2. + <_> + + <_> + 5 4 9 5 -1. + <_> + 8 4 3 5 3. + <_> + + <_> + 15 0 3 15 -1. + <_> + 16 0 1 15 3. + <_> + + <_> + 2 0 3 15 -1. + <_> + 3 0 1 15 3. + <_> + + <_> + 8 6 6 8 -1. + <_> + 8 10 6 4 2. + <_> + + <_> + 1 4 6 16 -1. + <_> + 1 4 3 8 2. + <_> + 4 12 3 8 2. + <_> + + <_> + 3 0 15 2 -1. + <_> + 3 1 15 1 2. + <_> + + <_> + 7 2 6 14 -1. + <_> + 7 2 3 7 2. + <_> + 10 9 3 7 2. + <_> + + <_> + 10 2 6 7 -1. + <_> + 12 2 2 7 3. + <_> + + <_> + 5 1 3 16 -1. + <_> + 6 1 1 16 3. + <_> + + <_> + 6 2 9 10 -1. + <_> + 6 7 9 5 2. + <_> + + <_> + 9 2 2 13 -1. + <_> + 10 2 1 13 2. + <_> + + <_> + 9 0 3 13 -1. + <_> + 10 0 1 13 3. + <_> + + <_> + 2 6 14 6 -1. + <_> + 2 6 7 3 2. + <_> + 9 9 7 3 2. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 0 9 20 3 -1. + <_> + 0 10 20 1 3. + <_> + + <_> + 9 5 7 9 -1. + <_> + 9 8 7 3 3. + <_> + + <_> + 3 12 13 2 -1. + <_> + 3 13 13 1 2. + <_> + + <_> + 9 13 8 6 -1. + <_> + 9 15 8 2 3. + <_> + + <_> + 2 12 7 4 -1. + <_> + 2 14 7 2 2. + <_> + + <_> + 6 17 13 3 -1. + <_> + 6 18 13 1 3. + <_> + + <_> + 3 10 7 6 -1. + <_> + 3 12 7 2 3. + <_> + + <_> + 9 5 7 9 -1. + <_> + 9 8 7 3 3. + <_> + + <_> + 4 5 7 9 -1. + <_> + 4 8 7 3 3. + <_> + + <_> + 5 5 13 3 -1. + <_> + 5 6 13 1 3. + <_> + + <_> + 1 2 18 12 -1. + <_> + 1 6 18 4 3. + <_> + + <_> + 4 4 13 3 -1. + <_> + 4 5 13 1 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 10 2 4 8 -1. + <_> + 10 2 2 8 2. + <_> + + <_> + 6 2 4 8 -1. + <_> + 8 2 2 8 2. + <_> + + <_> + 8 0 12 16 -1. + <_> + 14 0 6 8 2. + <_> + 8 8 6 8 2. + <_> + + <_> + 0 0 18 6 -1. + <_> + 6 0 6 6 3. + <_> + + <_> + 12 0 8 4 -1. + <_> + 12 0 4 4 2. + <_> + + <_> + 0 0 6 7 -1. + <_> + 3 0 3 7 2. + <_> + + <_> + 9 13 6 7 -1. + <_> + 11 13 2 7 3. + <_> + + <_> + 6 4 6 7 -1. + <_> + 8 4 2 7 3. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 1 14 17 6 -1. + <_> + 1 16 17 2 3. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 2 14 7 6 -1. + <_> + 2 16 7 2 3. + <_> + + <_> + 5 5 13 3 -1. + <_> + 5 6 13 1 3. + <_> + + <_> + 5 13 6 7 -1. + <_> + 7 13 2 7 3. + <_> + + <_> + 12 10 4 7 -1. + <_> + 12 10 2 7 2. + <_> + + <_> + 1 9 18 11 -1. + <_> + 7 9 6 11 3. + <_> + + <_> + 10 10 6 7 -1. + <_> + 12 10 2 7 3. + <_> + + <_> + 4 10 6 7 -1. + <_> + 6 10 2 7 3. + <_> + + <_> + 9 10 9 9 -1. + <_> + 12 10 3 9 3. + <_> + + <_> + 0 10 10 10 -1. + <_> + 0 10 5 5 2. + <_> + 5 15 5 5 2. + <_> + + <_> + 12 15 6 5 -1. + <_> + 12 15 3 5 2. + <_> + + <_> + 1 15 8 5 -1. + <_> + 5 15 4 5 2. + <_> + + <_> + 5 14 14 2 -1. + <_> + 5 14 7 2 2. + <_> + + <_> + 1 14 12 3 -1. + <_> + 7 14 6 3 2. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 5 2 8 8 -1. + <_> + 5 2 4 4 2. + <_> + 9 6 4 4 2. + <_> + + <_> + 6 16 14 4 -1. + <_> + 13 16 7 2 2. + <_> + 6 18 7 2 2. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 3 15 14 4 -1. + <_> + 10 15 7 2 2. + <_> + 3 17 7 2 2. + <_> + + <_> + 0 6 20 2 -1. + <_> + 10 6 10 2 2. + <_> + + <_> + 5 3 14 6 -1. + <_> + 12 3 7 3 2. + <_> + 5 6 7 3 2. + <_> + + <_> + 5 5 10 6 -1. + <_> + 5 7 10 2 3. + <_> + + <_> + 0 2 20 2 -1. + <_> + 0 3 20 1 2. + <_> + + <_> + 6 0 8 6 -1. + <_> + 6 3 8 3 2. + <_> + + <_> + 7 3 13 2 -1. + <_> + 7 4 13 1 2. + <_> + + <_> + 0 5 13 14 -1. + <_> + 0 12 13 7 2. + <_> + + <_> + 14 11 4 8 -1. + <_> + 14 15 4 4 2. + <_> + + <_> + 0 0 20 8 -1. + <_> + 0 0 10 4 2. + <_> + 10 4 10 4 2. + <_> + + <_> + 16 1 4 18 -1. + <_> + 18 1 2 9 2. + <_> + 16 10 2 9 2. + <_> + + <_> + 1 10 6 9 -1. + <_> + 3 10 2 9 3. + <_> + + <_> + 7 10 6 10 -1. + <_> + 10 10 3 5 2. + <_> + 7 15 3 5 2. + <_> + + <_> + 4 7 12 12 -1. + <_> + 4 7 6 6 2. + <_> + 10 13 6 6 2. + <_> + + <_> + 7 12 13 3 -1. + <_> + 7 13 13 1 3. + <_> + + <_> + 0 12 7 6 -1. + <_> + 0 14 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 0 16 6 -1. + <_> + 0 2 16 2 3. + <_> + + <_> + 6 1 8 6 -1. + <_> + 6 4 8 3 2. + <_> + + <_> + 0 0 5 8 -1. + <_> + 0 4 5 4 2. + <_> + + <_> + 9 3 9 5 -1. + <_> + 12 3 3 5 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 2 2 2 9 3. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 4 5 10 6 -1. + <_> + 4 5 5 3 2. + <_> + 9 8 5 3 2. + <_> + + <_> + 7 1 10 6 -1. + <_> + 12 1 5 3 2. + <_> + 7 4 5 3 2. + <_> + + <_> + 0 2 18 4 -1. + <_> + 0 2 9 2 2. + <_> + 9 4 9 2 2. + <_> + + <_> + 17 1 2 17 -1. + <_> + 17 1 1 17 2. + <_> + + <_> + 1 0 2 19 -1. + <_> + 2 0 1 19 2. + <_> + + <_> + 2 9 16 4 -1. + <_> + 10 9 8 2 2. + <_> + 2 11 8 2 2. + <_> + + <_> + 1 6 18 8 -1. + <_> + 1 6 9 4 2. + <_> + 10 10 9 4 2. + <_> + + <_> + 1 8 18 4 -1. + <_> + 7 8 6 4 3. + <_> + + <_> + 5 4 3 10 -1. + <_> + 5 9 3 5 2. + <_> + + <_> + 5 2 10 6 -1. + <_> + 5 4 10 2 3. + <_> + + <_> + 7 7 4 10 -1. + <_> + 7 12 4 5 2. + <_> + + <_> + 8 11 6 6 -1. + <_> + 8 14 6 3 2. + <_> + + <_> + 1 6 15 5 -1. + <_> + 6 6 5 5 3. + <_> + + <_> + 8 5 4 12 -1. + <_> + 8 9 4 4 3. + <_> + + <_> + 1 8 10 12 -1. + <_> + 1 8 5 6 2. + <_> + 6 14 5 6 2. + <_> + + <_> + 14 12 5 6 -1. + <_> + 14 15 5 3 2. + <_> + + <_> + 0 12 18 4 -1. + <_> + 0 12 9 2 2. + <_> + 9 14 9 2 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 1 3 18 12 -1. + <_> + 1 3 9 6 2. + <_> + 10 9 9 6 2. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 5 2 9 6 -1. + <_> + 5 4 9 2 3. + <_> + + <_> + 15 3 2 17 -1. + <_> + 15 3 1 17 2. + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 9 0 3 13 -1. + <_> + 10 0 1 13 3. + <_> + + <_> + 8 0 3 13 -1. + <_> + 9 0 1 13 3. + <_> + + <_> + 7 5 6 8 -1. + <_> + 9 5 2 8 3. + <_> + + <_> + 3 3 2 17 -1. + <_> + 4 3 1 17 2. + <_> + + <_> + 2 0 18 4 -1. + <_> + 11 0 9 2 2. + <_> + 2 2 9 2 2. + <_> + + <_> + 0 0 18 4 -1. + <_> + 0 0 9 2 2. + <_> + 9 2 9 2 2. + <_> + + <_> + 11 12 6 8 -1. + <_> + 13 12 2 8 3. + <_> + + <_> + 3 12 6 8 -1. + <_> + 5 12 2 8 3. + <_> + + <_> + 7 12 10 6 -1. + <_> + 12 12 5 3 2. + <_> + 7 15 5 3 2. + <_> + + <_> + 5 0 9 14 -1. + <_> + 8 0 3 14 3. + <_> + + <_> + 4 3 15 4 -1. + <_> + 9 3 5 4 3. + <_> + + <_> + 1 3 15 4 -1. + <_> + 6 3 5 4 3. + <_> + + <_> + 13 5 4 14 -1. + <_> + 15 5 2 7 2. + <_> + 13 12 2 7 2. + <_> + + <_> + 3 5 4 14 -1. + <_> + 3 5 2 7 2. + <_> + 5 12 2 7 2. + <_> + + <_> + 11 0 4 7 -1. + <_> + 11 0 2 7 2. + <_> + + <_> + 5 0 4 7 -1. + <_> + 7 0 2 7 2. + <_> + + <_> + 7 12 10 6 -1. + <_> + 12 12 5 3 2. + <_> + 7 15 5 3 2. + <_> + + <_> + 3 12 10 6 -1. + <_> + 3 12 5 3 2. + <_> + 8 15 5 3 2. + <_> + + <_> + 3 4 16 6 -1. + <_> + 11 4 8 3 2. + <_> + 3 7 8 3 2. + <_> + + <_> + 4 1 6 7 -1. + <_> + 6 1 2 7 3. + <_> + + <_> + 6 13 14 3 -1. + <_> + 6 14 14 1 3. + <_> + + <_> + 4 3 6 7 -1. + <_> + 6 3 2 7 3. + <_> + + <_> + 5 10 13 3 -1. + <_> + 5 11 13 1 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 8 11 6 7 -1. + <_> + 10 11 2 7 3. + <_> + + <_> + 2 4 6 12 -1. + <_> + 5 4 3 12 2. + <_> + + <_> + 10 0 10 18 -1. + <_> + 10 0 5 18 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 7 10 6 9 -1. + <_> + 7 10 3 9 2. + <_> + + <_> + 6 12 6 8 -1. + <_> + 8 12 2 8 3. + <_> + + <_> + 3 18 14 2 -1. + <_> + 3 19 14 1 2. + <_> + + <_> + 1 6 7 6 -1. + <_> + 1 8 7 2 3. + <_> + + <_> + 13 5 7 4 -1. + <_> + 13 7 7 2 2. + <_> + + <_> + 0 5 7 4 -1. + <_> + 0 7 7 2 2. + <_> + + <_> + 8 5 11 15 -1. + <_> + 8 10 11 5 3. + <_> + + <_> + 3 9 10 9 -1. + <_> + 8 9 5 9 2. + <_> + + <_> + 4 1 13 3 -1. + <_> + 4 2 13 1 3. + <_> + + <_> + 7 0 4 12 -1. + <_> + 7 6 4 6 2. + <_> + + <_> + 8 2 4 8 -1. + <_> + 8 6 4 4 2. + <_> + + <_> + 2 16 16 3 -1. + <_> + 10 16 8 3 2. + <_> + + <_> + 6 7 9 5 -1. + <_> + 9 7 3 5 3. + <_> + + <_> + 5 7 9 5 -1. + <_> + 8 7 3 5 3. + <_> + + <_> + 7 3 13 2 -1. + <_> + 7 4 13 1 2. + <_> + + <_> + 5 5 4 11 -1. + <_> + 7 5 2 11 2. + <_> + + <_> + 9 6 6 10 -1. + <_> + 12 6 3 5 2. + <_> + 9 11 3 5 2. + <_> + + <_> + 5 6 6 10 -1. + <_> + 5 6 3 5 2. + <_> + 8 11 3 5 2. + <_> + + <_> + 4 8 16 8 -1. + <_> + 12 8 8 4 2. + <_> + 4 12 8 4 2. + <_> + + <_> + 0 8 16 8 -1. + <_> + 0 8 8 4 2. + <_> + 8 12 8 4 2. + <_> + + <_> + 9 8 10 10 -1. + <_> + 14 8 5 5 2. + <_> + 9 13 5 5 2. + <_> + + <_> + 1 8 10 10 -1. + <_> + 1 8 5 5 2. + <_> + 6 13 5 5 2. + <_> + + <_> + 11 1 9 16 -1. + <_> + 14 1 3 16 3. + <_> + + <_> + 3 4 6 12 -1. + <_> + 6 4 3 12 2. + <_> + + <_> + 14 12 6 8 -1. + <_> + 16 12 2 8 3. + <_> + + <_> + 0 12 6 8 -1. + <_> + 2 12 2 8 3. + <_> + + <_> + 0 2 10 3 -1. + <_> + 5 2 5 3 2. + <_> + + <_> + 6 4 8 6 -1. + <_> + 6 6 8 2 3. + <_> + + <_> + 7 6 6 12 -1. + <_> + 7 12 6 6 2. + <_> + + <_> + 10 1 4 18 -1. + <_> + 12 1 2 9 2. + <_> + 10 10 2 9 2. + <_> + + <_> + 4 6 4 14 -1. + <_> + 4 6 2 7 2. + <_> + 6 13 2 7 2. + <_> + + <_> + 13 4 3 10 -1. + <_> + 13 9 3 5 2. + <_> + + <_> + 1 3 14 12 -1. + <_> + 1 3 7 6 2. + <_> + 8 9 7 6 2. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 0 11 13 3 -1. + <_> + 0 12 13 1 3. + <_> + + <_> + 12 10 5 9 -1. + <_> + 12 13 5 3 3. + <_> + + <_> + 1 14 18 4 -1. + <_> + 1 14 9 2 2. + <_> + 10 16 9 2 2. + <_> + + <_> + 7 6 6 14 -1. + <_> + 9 6 2 14 3. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 10 10 4 8 -1. + <_> + 10 14 4 4 2. + <_> + + <_> + 6 8 8 12 -1. + <_> + 6 8 4 6 2. + <_> + 10 14 4 6 2. + <_> + + <_> + 16 0 4 7 -1. + <_> + 16 0 2 7 2. + <_> + + <_> + 0 0 18 2 -1. + <_> + 9 0 9 2 2. + <_> + + <_> + 16 0 4 7 -1. + <_> + 16 0 2 7 2. + <_> + + <_> + 1 11 7 6 -1. + <_> + 1 13 7 2 3. + <_> + + <_> + 9 5 6 10 -1. + <_> + 12 5 3 5 2. + <_> + 9 10 3 5 2. + <_> + + <_> + 0 0 4 7 -1. + <_> + 2 0 2 7 2. + <_> + + <_> + 6 1 9 5 -1. + <_> + 9 1 3 5 3. + <_> + + <_> + 3 2 13 2 -1. + <_> + 3 3 13 1 2. + <_> + + <_> + 4 0 14 3 -1. + <_> + 4 1 14 1 3. + <_> + + <_> + 4 2 6 7 -1. + <_> + 6 2 2 7 3. + <_> + + <_> + 7 1 10 6 -1. + <_> + 12 1 5 3 2. + <_> + 7 4 5 3 2. + <_> + + <_> + 0 0 15 3 -1. + <_> + 5 0 5 3 3. + <_> + + <_> + 4 7 15 5 -1. + <_> + 9 7 5 5 3. + <_> + + <_> + 0 7 6 12 -1. + <_> + 0 11 6 4 3. + <_> + + <_> + 6 17 13 3 -1. + <_> + 6 18 13 1 3. + <_> + + <_> + 1 7 15 5 -1. + <_> + 6 7 5 5 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 1 8 18 3 -1. + <_> + 1 9 18 1 3. + <_> + + <_> + 14 0 6 11 -1. + <_> + 16 0 2 11 3. + <_> + + <_> + 3 1 12 6 -1. + <_> + 3 1 6 3 2. + <_> + 9 4 6 3 2. + <_> + + <_> + 6 5 8 6 -1. + <_> + 6 7 8 2 3. + <_> + + <_> + 0 0 6 11 -1. + <_> + 2 0 2 11 3. + <_> + + <_> + 8 5 5 12 -1. + <_> + 8 11 5 6 2. + <_> + + <_> + 1 4 6 16 -1. + <_> + 1 4 3 8 2. + <_> + 4 12 3 8 2. + <_> + + <_> + 13 5 6 10 -1. + <_> + 16 5 3 5 2. + <_> + 13 10 3 5 2. + <_> + + <_> + 1 5 6 10 -1. + <_> + 1 5 3 5 2. + <_> + 4 10 3 5 2. + <_> + + <_> + 16 2 4 8 -1. + <_> + 16 6 4 4 2. + <_> + + <_> + 0 17 18 3 -1. + <_> + 6 17 6 3 3. + <_> + + <_> + 6 1 8 16 -1. + <_> + 6 9 8 8 2. + <_> + + <_> + 6 12 6 7 -1. + <_> + 8 12 2 7 3. + <_> + + <_> + 7 1 6 13 -1. + <_> + 7 1 3 13 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 2 10 18 10 -1. + <_> + 8 10 6 10 3. + <_> + + <_> + 0 0 8 20 -1. + <_> + 4 0 4 20 2. + <_> + + <_> + 10 0 8 6 -1. + <_> + 10 0 4 6 2. + <_> + + <_> + 5 2 8 9 -1. + <_> + 5 5 8 3 3. + <_> + + <_> + 16 2 4 8 -1. + <_> + 16 6 4 4 2. + <_> + + <_> + 3 3 14 2 -1. + <_> + 10 3 7 2 2. + <_> + + <_> + 8 0 9 5 -1. + <_> + 11 0 3 5 3. + <_> + + <_> + 3 3 13 3 -1. + <_> + 3 4 13 1 3. + <_> + + <_> + 16 2 4 8 -1. + <_> + 16 6 4 4 2. + <_> + + <_> + 0 1 11 12 -1. + <_> + 0 7 11 6 2. + <_> + + <_> + 9 0 9 5 -1. + <_> + 12 0 3 5 3. + <_> + + <_> + 3 0 9 5 -1. + <_> + 6 0 3 5 3. + <_> + + <_> + 2 0 18 8 -1. + <_> + 8 0 6 8 3. + <_> + + <_> + 0 15 14 2 -1. + <_> + 0 16 14 1 2. + <_> + + <_> + 10 15 10 3 -1. + <_> + 10 15 5 3 2. + <_> + + <_> + 7 10 3 10 -1. + <_> + 7 15 3 5 2. + <_> + + <_> + 6 14 13 3 -1. + <_> + 6 15 13 1 3. + <_> + + <_> + 4 11 12 6 -1. + <_> + 4 11 6 3 2. + <_> + 10 14 6 3 2. + <_> + + <_> + 3 12 16 6 -1. + <_> + 11 12 8 3 2. + <_> + 3 15 8 3 2. + <_> + + <_> + 1 12 16 6 -1. + <_> + 1 12 8 3 2. + <_> + 9 15 8 3 2. + <_> + + <_> + 4 0 15 6 -1. + <_> + 9 0 5 6 3. + <_> + + <_> + 1 0 15 6 -1. + <_> + 6 0 5 6 3. + <_> + + <_> + 6 14 13 3 -1. + <_> + 6 15 13 1 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 5 0 10 6 -1. + <_> + 5 3 10 3 2. + <_> + + <_> + 7 0 2 17 -1. + <_> + 8 0 1 17 2. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 1 9 19 3 -1. + <_> + 1 10 19 1 3. + <_> + + <_> + 6 0 6 18 -1. + <_> + 8 0 2 18 3. + <_> + + <_> + 9 0 2 13 -1. + <_> + 9 0 1 13 2. + <_> + + <_> + 0 10 20 6 -1. + <_> + 0 13 20 3 2. + <_> + + <_> + 10 11 5 9 -1. + <_> + 10 14 5 3 3. + <_> + + <_> + 3 4 13 3 -1. + <_> + 3 5 13 1 3. + <_> + + <_> + 13 11 7 4 -1. + <_> + 13 13 7 2 2. + <_> + + <_> + 3 2 3 14 -1. + <_> + 4 2 1 14 3. + <_> + + <_> + 12 3 2 17 -1. + <_> + 12 3 1 17 2. + <_> + + <_> + 0 9 6 9 -1. + <_> + 3 9 3 9 2. + <_> + + <_> + 11 3 6 10 -1. + <_> + 14 3 3 5 2. + <_> + 11 8 3 5 2. + <_> + + <_> + 2 0 3 13 -1. + <_> + 3 0 1 13 3. + <_> + + <_> + 4 5 16 2 -1. + <_> + 4 5 8 2 2. + <_> + + <_> + 4 1 3 13 -1. + <_> + 5 1 1 13 3. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 5 2. + <_> + 14 15 3 5 2. + <_> + + <_> + 0 4 7 6 -1. + <_> + 0 6 7 2 3. + <_> + + <_> + 12 3 2 17 -1. + <_> + 12 3 1 17 2. + <_> + + <_> + 0 15 10 3 -1. + <_> + 5 15 5 3 2. + <_> + + <_> + 10 11 5 9 -1. + <_> + 10 14 5 3 3. + <_> + + <_> + 5 11 5 9 -1. + <_> + 5 14 5 3 3. + <_> + + <_> + 5 13 13 3 -1. + <_> + 5 14 13 1 3. + <_> + + <_> + 2 13 13 3 -1. + <_> + 2 14 13 1 3. + <_> + + <_> + 3 11 16 9 -1. + <_> + 3 14 16 3 3. + <_> + + <_> + 5 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 10 0 10 16 -1. + <_> + 10 8 10 8 2. + <_> + + <_> + 0 0 10 16 -1. + <_> + 0 8 10 8 2. + <_> + + <_> + 9 5 3 13 -1. + <_> + 10 5 1 13 3. + <_> + + <_> + 6 0 6 10 -1. + <_> + 6 0 3 5 2. + <_> + 9 5 3 5 2. + <_> + + <_> + 11 10 3 10 -1. + <_> + 11 15 3 5 2. + <_> + + <_> + 0 0 4 16 -1. + <_> + 0 0 2 8 2. + <_> + 2 8 2 8 2. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 7 0 3 13 -1. + <_> + 8 0 1 13 3. + <_> + + <_> + 6 6 12 6 -1. + <_> + 10 6 4 6 3. + <_> + + <_> + 0 4 4 16 -1. + <_> + 0 4 2 8 2. + <_> + 2 12 2 8 2. + <_> + + <_> + 0 1 20 3 -1. + <_> + 0 2 20 1 3. + <_> + + <_> + 5 0 7 6 -1. + <_> + 5 2 7 2 3. + <_> + + <_> + 11 3 6 10 -1. + <_> + 14 3 3 5 2. + <_> + 11 8 3 5 2. + <_> + + <_> + 3 3 6 10 -1. + <_> + 3 3 3 5 2. + <_> + 6 8 3 5 2. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 6 10 3 10 -1. + <_> + 6 15 3 5 2. + <_> + + <_> + 12 0 4 16 -1. + <_> + 14 0 2 8 2. + <_> + 12 8 2 8 2. + <_> + + <_> + 4 0 4 16 -1. + <_> + 4 0 2 8 2. + <_> + 6 8 2 8 2. + <_> + + <_> + 5 13 15 7 -1. + <_> + 10 13 5 7 3. + <_> + + <_> + 0 7 20 2 -1. + <_> + 0 8 20 1 2. + <_> + + <_> + 2 13 18 5 -1. + <_> + 8 13 6 5 3. + <_> + + <_> + 8 6 3 13 -1. + <_> + 9 6 1 13 3. + <_> + + <_> + 12 7 6 12 -1. + <_> + 15 7 3 6 2. + <_> + 12 13 3 6 2. + <_> + + <_> + 2 7 6 12 -1. + <_> + 2 7 3 6 2. + <_> + 5 13 3 6 2. + <_> + + <_> + 9 8 10 6 -1. + <_> + 14 8 5 3 2. + <_> + 9 11 5 3 2. + <_> + + <_> + 1 8 10 6 -1. + <_> + 1 8 5 3 2. + <_> + 6 11 5 3 2. + <_> + + <_> + 4 13 13 3 -1. + <_> + 4 14 13 1 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 0 8 20 10 -1. + <_> + 0 13 20 5 2. + <_> + + <_> + 0 13 15 7 -1. + <_> + 5 13 5 7 3. + <_> + + <_> + 7 11 6 9 -1. + <_> + 9 11 2 9 3. + <_> + + <_> + 1 11 9 8 -1. + <_> + 4 11 3 8 3. + <_> + + <_> + 2 13 17 6 -1. + <_> + 2 15 17 2 3. + <_> + + <_> + 0 13 7 6 -1. + <_> + 0 15 7 2 3. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 5 6 4 8 -1. + <_> + 5 10 4 4 2. + <_> + + <_> + 13 8 4 12 -1. + <_> + 13 12 4 4 3. + <_> + + <_> + 4 5 12 12 -1. + <_> + 4 5 6 6 2. + <_> + 10 11 6 6 2. + <_> + + <_> + 5 5 10 6 -1. + <_> + 10 5 5 3 2. + <_> + 5 8 5 3 2. + <_> + + <_> + 3 5 14 8 -1. + <_> + 3 5 7 4 2. + <_> + 10 9 7 4 2. + <_> + + <_> + 5 6 10 9 -1. + <_> + 5 9 10 3 3. + <_> + + <_> + 2 10 14 4 -1. + <_> + 2 10 7 2 2. + <_> + 9 12 7 2 2. + <_> + + <_> + 12 9 8 4 -1. + <_> + 12 11 8 2 2. + <_> + + <_> + 0 9 8 4 -1. + <_> + 0 11 8 2 2. + <_> + + <_> + 8 8 8 4 -1. + <_> + 8 10 8 2 2. + <_> + + <_> + 2 14 13 3 -1. + <_> + 2 15 13 1 3. + <_> + + <_> + 8 2 12 17 -1. + <_> + 12 2 4 17 3. + <_> + + <_> + 0 2 12 17 -1. + <_> + 4 2 4 17 3. + <_> + + <_> + 11 9 6 8 -1. + <_> + 11 9 3 8 2. + <_> + + <_> + 4 0 3 20 -1. + <_> + 5 0 1 20 3. + <_> + + <_> + 5 14 14 6 -1. + <_> + 12 14 7 3 2. + <_> + 5 17 7 3 2. + <_> + + <_> + 0 14 14 6 -1. + <_> + 0 14 7 3 2. + <_> + 7 17 7 3 2. + <_> + + <_> + 9 12 10 6 -1. + <_> + 9 14 10 2 3. + <_> + + <_> + 1 14 5 6 -1. + <_> + 1 17 5 3 2. + <_> + + <_> + 11 0 3 13 -1. + <_> + 12 0 1 13 3. + <_> + + <_> + 6 0 3 13 -1. + <_> + 7 0 1 13 3. + <_> + + <_> + 6 9 9 5 -1. + <_> + 9 9 3 5 3. + <_> + + <_> + 1 4 18 9 -1. + <_> + 7 4 6 9 3. + <_> + + <_> + 11 9 6 8 -1. + <_> + 11 9 3 8 2. + <_> + + <_> + 3 9 6 8 -1. + <_> + 6 9 3 8 2. + <_> + + <_> + 9 7 6 12 -1. + <_> + 9 7 3 12 2. + <_> + + <_> + 3 3 14 12 -1. + <_> + 10 3 7 12 2. + <_> + + <_> + 12 11 8 4 -1. + <_> + 12 13 8 2 2. + <_> + + <_> + 1 0 8 20 -1. + <_> + 1 0 4 10 2. + <_> + 5 10 4 10 2. + <_> + + <_> + 12 11 8 4 -1. + <_> + 12 13 8 2 2. + <_> + + <_> + 0 2 10 5 -1. + <_> + 5 2 5 5 2. + <_> + + <_> + 12 12 8 8 -1. + <_> + 12 12 4 8 2. + <_> + + <_> + 0 11 8 4 -1. + <_> + 0 13 8 2 2. + <_> + + <_> + 15 9 5 10 -1. + <_> + 15 14 5 5 2. + <_> + + <_> + 0 9 5 10 -1. + <_> + 0 14 5 5 2. + <_> + + <_> + 9 12 10 6 -1. + <_> + 9 14 10 2 3. + <_> + + <_> + 1 12 10 6 -1. + <_> + 1 14 10 2 3. + <_> + + <_> + 6 12 13 3 -1. + <_> + 6 13 13 1 3. + <_> + + <_> + 6 8 8 9 -1. + <_> + 6 11 8 3 3. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 7 8 9 12 -1. + <_> + 7 12 9 4 3. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 3 8 14 2 -1. + <_> + 3 9 14 1 2. + <_> + + <_> + 0 13 7 6 -1. + <_> + 0 15 7 2 3. + <_> + + <_> + 5 16 10 4 -1. + <_> + 5 18 10 2 2. + <_> + + <_> + 0 10 6 10 -1. + <_> + 0 10 3 5 2. + <_> + 3 15 3 5 2. + <_> + + <_> + 12 3 2 17 -1. + <_> + 12 3 1 17 2. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 7 12 13 2 -1. + <_> + 7 13 13 1 2. + <_> + + <_> + 3 9 10 6 -1. + <_> + 3 9 5 3 2. + <_> + 8 12 5 3 2. + <_> + + <_> + 9 9 6 10 -1. + <_> + 12 9 3 5 2. + <_> + 9 14 3 5 2. + <_> + + <_> + 2 6 16 12 -1. + <_> + 2 6 8 6 2. + <_> + 10 12 8 6 2. + <_> + + <_> + 13 2 7 6 -1. + <_> + 13 4 7 2 3. + <_> + + <_> + 3 4 14 4 -1. + <_> + 3 6 14 2 2. + <_> + + <_> + 7 1 13 2 -1. + <_> + 7 2 13 1 2. + <_> + + <_> + 3 5 13 3 -1. + <_> + 3 6 13 1 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 2 1 15 6 -1. + <_> + 7 1 5 6 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 0 10 14 3 -1. + <_> + 0 11 14 1 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 9 6 4 14 -1. + <_> + 11 6 2 7 2. + <_> + 9 13 2 7 2. + <_> + + <_> + 0 8 19 2 -1. + <_> + 0 9 19 1 2. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 6 11 6 8 -1. + <_> + 8 11 2 8 3. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 7 5 4 11 -1. + <_> + 9 5 2 11 2. + <_> + + <_> + 9 3 2 13 -1. + <_> + 9 3 1 13 2. + <_> + + <_> + 0 3 12 6 -1. + <_> + 0 3 6 3 2. + <_> + 6 6 6 3 2. + <_> + + <_> + 3 6 14 2 -1. + <_> + 3 6 7 2 2. + <_> + + <_> + 4 11 6 7 -1. + <_> + 6 11 2 7 3. + <_> + + <_> + 15 10 5 6 -1. + <_> + 15 13 5 3 2. + <_> + + <_> + 4 1 12 6 -1. + <_> + 8 1 4 6 3. + <_> + + <_> + 10 0 4 8 -1. + <_> + 10 0 2 8 2. + <_> + + <_> + 3 1 12 5 -1. + <_> + 9 1 6 5 2. + <_> + + <_> + 13 2 7 6 -1. + <_> + 13 4 7 2 3. + <_> + + <_> + 0 2 7 6 -1. + <_> + 0 4 7 2 3. + <_> + + <_> + 14 1 6 9 -1. + <_> + 14 4 6 3 3. + <_> + + <_> + 0 1 6 9 -1. + <_> + 0 4 6 3 3. + <_> + + <_> + 6 0 9 8 -1. + <_> + 6 4 9 4 2. + <_> + + <_> + 0 5 8 8 -1. + <_> + 0 5 4 4 2. + <_> + 4 9 4 4 2. + <_> + + <_> + 11 1 4 12 -1. + <_> + 11 7 4 6 2. + <_> + + <_> + 4 5 5 6 -1. + <_> + 4 8 5 3 2. + <_> + + <_> + 7 5 11 8 -1. + <_> + 7 9 11 4 2. + <_> + + <_> + 4 2 12 5 -1. + <_> + 8 2 4 5 3. + <_> + + <_> + 10 12 10 8 -1. + <_> + 10 12 5 8 2. + <_> + + <_> + 0 12 10 8 -1. + <_> + 5 12 5 8 2. + <_> + + <_> + 15 0 4 7 -1. + <_> + 15 0 2 7 2. + <_> + + <_> + 1 0 4 7 -1. + <_> + 3 0 2 7 2. + <_> + + <_> + 0 2 20 4 -1. + <_> + 10 2 10 2 2. + <_> + 0 4 10 2 2. + <_> + + <_> + 1 0 12 9 -1. + <_> + 1 3 12 3 3. + <_> + + <_> + 10 14 9 4 -1. + <_> + 10 16 9 2 2. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 1 6 11 4 -1. + <_> + 1 8 11 2 2. + <_> + + <_> + 4 8 12 4 -1. + <_> + 4 10 12 2 2. + <_> + + <_> + 4 4 3 10 -1. + <_> + 4 9 3 5 2. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 3 9 3 10 -1. + <_> + 3 14 3 5 2. + <_> + + <_> + 18 3 2 17 -1. + <_> + 18 3 1 17 2. + <_> + + <_> + 0 3 13 2 -1. + <_> + 0 4 13 1 2. + <_> + + <_> + 18 3 2 17 -1. + <_> + 18 3 1 17 2. + <_> + + <_> + 0 3 2 17 -1. + <_> + 1 3 1 17 2. + <_> + + <_> + 2 0 18 6 -1. + <_> + 2 2 18 2 3. + <_> + + <_> + 6 5 4 13 -1. + <_> + 8 5 2 13 2. + <_> + + <_> + 7 3 12 16 -1. + <_> + 7 3 6 16 2. + <_> + + <_> + 0 12 16 2 -1. + <_> + 8 12 8 2 2. + <_> + + <_> + 11 6 8 12 -1. + <_> + 11 10 8 4 3. + <_> + + <_> + 0 12 6 7 -1. + <_> + 3 12 3 7 2. + <_> + + <_> + 12 0 8 12 -1. + <_> + 16 0 4 6 2. + <_> + 12 6 4 6 2. + <_> + + <_> + 5 6 10 10 -1. + <_> + 5 6 5 5 2. + <_> + 10 11 5 5 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 10 2 2 18 -1. + <_> + 10 11 2 9 2. + <_> + + <_> + 4 9 12 8 -1. + <_> + 4 9 6 4 2. + <_> + 10 13 6 4 2. + <_> + + <_> + 18 0 2 13 -1. + <_> + 18 0 1 13 2. + <_> + + <_> + 2 8 12 4 -1. + <_> + 6 8 4 4 3. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 18 0 2 13 -1. + <_> + 18 0 1 13 2. + <_> + + <_> + 6 3 2 17 -1. + <_> + 7 3 1 17 2. + <_> + + <_> + 11 9 4 8 -1. + <_> + 11 9 2 8 2. + <_> + + <_> + 5 9 4 8 -1. + <_> + 7 9 2 8 2. + <_> + + <_> + 18 0 2 13 -1. + <_> + 18 0 1 13 2. + <_> + + <_> + 0 0 2 13 -1. + <_> + 1 0 1 13 2. + <_> + + <_> + 0 6 20 2 -1. + <_> + 0 6 10 2 2. + <_> + + <_> + 0 4 13 3 -1. + <_> + 0 5 13 1 3. + <_> + + <_> + 11 10 8 6 -1. + <_> + 11 12 8 2 3. + <_> + + <_> + 2 10 8 6 -1. + <_> + 2 12 8 2 3. + <_> + + <_> + 5 4 14 8 -1. + <_> + 12 4 7 4 2. + <_> + 5 8 7 4 2. + <_> + + <_> + 4 5 12 6 -1. + <_> + 4 5 6 3 2. + <_> + 10 8 6 3 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 10 10 4 4 2. + <_> + 6 14 4 4 2. + <_> + + <_> + 5 5 9 5 -1. + <_> + 8 5 3 5 3. + <_> + + <_> + 6 4 8 6 -1. + <_> + 6 6 8 2 3. + <_> + + <_> + 4 9 12 5 -1. + <_> + 8 9 4 5 3. + <_> + + <_> + 10 1 10 4 -1. + <_> + 10 1 5 4 2. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 15 0 3 18 -1. + <_> + 15 6 3 6 3. + <_> + + <_> + 1 2 9 15 -1. + <_> + 4 2 3 15 3. + <_> + + <_> + 7 6 8 4 -1. + <_> + 7 6 4 4 2. + <_> + + <_> + 5 5 8 5 -1. + <_> + 9 5 4 5 2. + <_> + + <_> + 4 2 15 2 -1. + <_> + 4 3 15 1 2. + <_> + + <_> + 1 17 13 3 -1. + <_> + 1 18 13 1 3. + <_> + + <_> + 6 6 8 8 -1. + <_> + 6 10 8 4 2. + <_> + + <_> + 4 9 5 9 -1. + <_> + 4 12 5 3 3. + <_> + + <_> + 13 9 4 10 -1. + <_> + 13 14 4 5 2. + <_> + + <_> + 2 9 12 10 -1. + <_> + 2 9 6 5 2. + <_> + 8 14 6 5 2. + <_> + + <_> + 3 7 15 3 -1. + <_> + 8 7 5 3 3. + <_> + + <_> + 1 0 8 12 -1. + <_> + 1 0 4 6 2. + <_> + 5 6 4 6 2. + <_> + + <_> + 13 13 7 6 -1. + <_> + 13 15 7 2 3. + <_> + + <_> + 5 9 5 10 -1. + <_> + 5 14 5 5 2. + <_> + + <_> + 13 13 7 6 -1. + <_> + 13 15 7 2 3. + <_> + + <_> + 0 13 7 6 -1. + <_> + 0 15 7 2 3. + <_> + + <_> + 9 0 3 13 -1. + <_> + 10 0 1 13 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 0 5 20 6 -1. + <_> + 0 7 20 2 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 9 3 10 12 -1. + <_> + 9 9 10 6 2. + <_> + + <_> + 1 0 7 6 -1. + <_> + 1 2 7 2 3. + <_> + + <_> + 7 3 13 2 -1. + <_> + 7 4 13 1 2. + <_> + + <_> + 5 9 10 8 -1. + <_> + 5 9 5 4 2. + <_> + 10 13 5 4 2. + <_> + + <_> + 11 5 5 9 -1. + <_> + 11 8 5 3 3. + <_> + + <_> + 6 3 8 8 -1. + <_> + 6 3 4 4 2. + <_> + 10 7 4 4 2. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 8 0 3 13 -1. + <_> + 9 0 1 13 3. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 11 15 9 4 -1. + <_> + 11 17 9 2 2. + <_> + + <_> + 4 9 12 5 -1. + <_> + 8 9 4 5 3. + <_> + + <_> + 12 15 8 4 -1. + <_> + 12 17 8 2 2. + <_> + + <_> + 0 15 8 4 -1. + <_> + 0 17 8 2 2. + <_> + + <_> + 0 11 20 3 -1. + <_> + 0 12 20 1 3. + <_> + + <_> + 0 0 3 16 -1. + <_> + 1 0 1 16 3. + <_> + + <_> + 3 2 14 11 -1. + <_> + 3 2 7 11 2. + <_> + + <_> + 4 2 8 6 -1. + <_> + 4 5 8 3 2. + <_> + + <_> + 3 0 15 6 -1. + <_> + 3 2 15 2 3. + <_> + + <_> + 1 6 13 3 -1. + <_> + 1 7 13 1 3. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 1 14 12 6 -1. + <_> + 1 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 15 14 5 6 -1. + <_> + 15 17 5 3 2. + <_> + + <_> + 3 4 13 3 -1. + <_> + 3 5 13 1 3. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 0 8 7 6 -1. + <_> + 0 10 7 2 3. + <_> + + <_> + 2 6 16 6 -1. + <_> + 10 6 8 3 2. + <_> + 2 9 8 3 2. + <_> + + <_> + 2 7 3 10 -1. + <_> + 2 12 3 5 2. + <_> + + <_> + 15 14 5 6 -1. + <_> + 15 17 5 3 2. + <_> + + <_> + 5 7 10 6 -1. + <_> + 5 7 5 3 2. + <_> + 10 10 5 3 2. + <_> + + <_> + 15 14 5 6 -1. + <_> + 15 17 5 3 2. + <_> + + <_> + 0 14 5 6 -1. + <_> + 0 17 5 3 2. + <_> + + <_> + 10 5 9 15 -1. + <_> + 10 10 9 5 3. + <_> + + <_> + 5 7 9 5 -1. + <_> + 8 7 3 5 3. + <_> + + <_> + 13 1 7 6 -1. + <_> + 13 3 7 2 3. + <_> + + <_> + 3 4 13 3 -1. + <_> + 3 5 13 1 3. + <_> + + <_> + 13 1 7 6 -1. + <_> + 13 3 7 2 3. + <_> + + <_> + 0 1 7 6 -1. + <_> + 0 3 7 2 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 10 1 10 18 -1. + <_> + 10 1 5 18 2. + <_> + + <_> + 0 1 10 18 -1. + <_> + 5 1 5 18 2. + <_> + + <_> + 2 1 18 5 -1. + <_> + 8 1 6 5 3. + <_> + + <_> + 4 5 4 8 -1. + <_> + 4 9 4 4 2. + <_> + + <_> + 9 3 3 10 -1. + <_> + 9 8 3 5 2. + <_> + + <_> + 2 10 14 4 -1. + <_> + 2 10 7 2 2. + <_> + 9 12 7 2 2. + <_> + + <_> + 9 11 9 5 -1. + <_> + 12 11 3 5 3. + <_> + + <_> + 3 11 14 4 -1. + <_> + 3 11 7 2 2. + <_> + 10 13 7 2 2. + <_> + + <_> + 10 5 8 4 -1. + <_> + 10 5 4 4 2. + <_> + + <_> + 8 3 3 13 -1. + <_> + 9 3 1 13 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 6 0 2 14 -1. + <_> + 7 0 1 14 2. + <_> + + <_> + 10 5 8 4 -1. + <_> + 10 5 4 4 2. + <_> + + <_> + 0 0 8 4 -1. + <_> + 4 0 4 4 2. + <_> + + <_> + 14 0 6 13 -1. + <_> + 14 0 3 13 2. + <_> + + <_> + 0 1 6 11 -1. + <_> + 3 1 3 11 2. + <_> + + <_> + 9 11 9 5 -1. + <_> + 12 11 3 5 3. + <_> + + <_> + 2 11 9 5 -1. + <_> + 5 11 3 5 3. + <_> + + <_> + 7 12 6 7 -1. + <_> + 9 12 2 7 3. + <_> + + <_> + 0 0 4 15 -1. + <_> + 2 0 2 15 2. + <_> + + <_> + 12 2 2 15 -1. + <_> + 12 2 1 15 2. + <_> + + <_> + 6 2 2 15 -1. + <_> + 7 2 1 15 2. + <_> + + <_> + 6 0 13 2 -1. + <_> + 6 1 13 1 2. + <_> + + <_> + 0 12 13 3 -1. + <_> + 0 13 13 1 3. + <_> + + <_> + 10 3 4 7 -1. + <_> + 10 3 2 7 2. + <_> + + <_> + 5 3 4 7 -1. + <_> + 7 3 2 7 2. + <_> + + <_> + 10 5 8 4 -1. + <_> + 10 5 4 4 2. + <_> + + <_> + 2 5 8 4 -1. + <_> + 6 5 4 4 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 7 3 13 2 -1. + <_> + 7 4 13 1 2. + <_> + + <_> + 8 0 4 15 -1. + <_> + 8 5 4 5 3. + <_> + + <_> + 5 0 11 8 -1. + <_> + 5 4 11 4 2. + <_> + + <_> + 2 3 8 14 -1. + <_> + 6 3 4 14 2. + <_> + + <_> + 15 1 5 6 -1. + <_> + 15 4 5 3 2. + <_> + + <_> + 0 1 5 6 -1. + <_> + 0 4 5 3 2. + <_> + + <_> + 8 4 4 7 -1. + <_> + 8 4 2 7 2. + <_> + + <_> + 5 6 10 3 -1. + <_> + 10 6 5 3 2. + <_> + + <_> + 14 0 2 19 -1. + <_> + 14 0 1 19 2. + <_> + + <_> + 4 0 2 19 -1. + <_> + 5 0 1 19 2. + <_> + + <_> + 11 13 6 7 -1. + <_> + 13 13 2 7 3. + <_> + + <_> + 1 8 18 3 -1. + <_> + 7 8 6 3 3. + <_> + + <_> + 8 7 5 8 -1. + <_> + 8 11 5 4 2. + <_> + + <_> + 6 2 8 16 -1. + <_> + 6 10 8 8 2. + <_> + + <_> + 8 3 6 9 -1. + <_> + 8 6 6 3 3. + <_> + + <_> + 2 16 7 4 -1. + <_> + 2 18 7 2 2. + <_> + + <_> + 8 7 7 4 -1. + <_> + 8 9 7 2 2. + <_> + + <_> + 7 4 5 12 -1. + <_> + 7 8 5 4 3. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 3 6 14 4 -1. + <_> + 3 6 7 2 2. + <_> + 10 8 7 2 2. + <_> + + <_> + 8 4 6 10 -1. + <_> + 11 4 3 5 2. + <_> + 8 9 3 5 2. + <_> + + <_> + 7 4 6 10 -1. + <_> + 7 4 3 5 2. + <_> + 10 9 3 5 2. + <_> + + <_> + 7 3 13 2 -1. + <_> + 7 4 13 1 2. + <_> + + <_> + 0 14 7 6 -1. + <_> + 0 16 7 2 3. + <_> + + <_> + 13 0 3 15 -1. + <_> + 14 0 1 15 3. + <_> + + <_> + 0 14 14 3 -1. + <_> + 0 15 14 1 3. + <_> + + <_> + 1 4 18 15 -1. + <_> + 1 9 18 5 3. + <_> + + <_> + 0 15 13 3 -1. + <_> + 0 16 13 1 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 4 0 3 14 -1. + <_> + 5 0 1 14 3. + <_> + + <_> + 12 10 5 6 -1. + <_> + 12 13 5 3 2. + <_> + + <_> + 1 15 18 4 -1. + <_> + 1 15 9 2 2. + <_> + 10 17 9 2 2. + <_> + + <_> + 10 13 8 6 -1. + <_> + 10 15 8 2 3. + <_> + + <_> + 7 0 3 13 -1. + <_> + 8 0 1 13 3. + <_> + + <_> + 12 13 7 6 -1. + <_> + 12 15 7 2 3. + <_> + + <_> + 1 13 7 6 -1. + <_> + 1 15 7 2 3. + <_> + + <_> + 8 0 10 18 -1. + <_> + 13 0 5 9 2. + <_> + 8 9 5 9 2. + <_> + + <_> + 0 3 18 3 -1. + <_> + 6 3 6 3 3. + <_> + + <_> + 10 4 10 6 -1. + <_> + 15 4 5 3 2. + <_> + 10 7 5 3 2. + <_> + + <_> + 2 8 16 4 -1. + <_> + 10 8 8 4 2. + <_> + + <_> + 4 4 12 12 -1. + <_> + 10 4 6 6 2. + <_> + 4 10 6 6 2. + <_> + + <_> + 1 0 18 3 -1. + <_> + 10 0 9 3 2. + <_> + + <_> + 11 4 4 10 -1. + <_> + 11 9 4 5 2. + <_> + + <_> + 2 4 5 15 -1. + <_> + 2 9 5 5 3. + <_> + + <_> + 17 6 2 14 -1. + <_> + 17 13 2 7 2. + <_> + + <_> + 1 6 2 14 -1. + <_> + 1 13 2 7 2. + <_> + + <_> + 10 6 10 6 -1. + <_> + 15 6 5 3 2. + <_> + 10 9 5 3 2. + <_> + + <_> + 0 6 10 6 -1. + <_> + 0 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 2 10 18 3 -1. + <_> + 2 11 18 1 3. + <_> + + <_> + 0 2 7 4 -1. + <_> + 0 4 7 2 2. + <_> + + <_> + 2 0 16 6 -1. + <_> + 2 2 16 2 3. + <_> + + <_> + 2 17 15 3 -1. + <_> + 7 17 5 3 3. + <_> + + <_> + 12 13 6 7 -1. + <_> + 12 13 3 7 2. + <_> + + <_> + 2 13 6 7 -1. + <_> + 5 13 3 7 2. + <_> + + <_> + 14 2 2 13 -1. + <_> + 14 2 1 13 2. + <_> + + <_> + 7 12 4 8 -1. + <_> + 7 16 4 4 2. + <_> + + <_> + 2 17 18 3 -1. + <_> + 8 17 6 3 3. + <_> + + <_> + 5 15 6 5 -1. + <_> + 8 15 3 5 2. + <_> + + <_> + 14 2 2 13 -1. + <_> + 14 2 1 13 2. + <_> + + <_> + 4 2 2 13 -1. + <_> + 5 2 1 13 2. + <_> + + <_> + 10 0 6 9 -1. + <_> + 12 0 2 9 3. + <_> + + <_> + 4 0 6 9 -1. + <_> + 6 0 2 9 3. + <_> + + <_> + 13 11 7 4 -1. + <_> + 13 13 7 2 2. + <_> + + <_> + 0 10 13 3 -1. + <_> + 0 11 13 1 3. + <_> + + <_> + 6 7 9 12 -1. + <_> + 6 11 9 4 3. + <_> + + <_> + 2 2 14 4 -1. + <_> + 2 2 7 2 2. + <_> + 9 4 7 2 2. + <_> + + <_> + 10 0 2 13 -1. + <_> + 10 0 1 13 2. + <_> + + <_> + 8 0 2 13 -1. + <_> + 9 0 1 13 2. + <_> + + <_> + 13 11 7 4 -1. + <_> + 13 13 7 2 2. + <_> + + <_> + 6 11 7 6 -1. + <_> + 6 13 7 2 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 0 11 7 4 -1. + <_> + 0 13 7 2 2. + <_> + + <_> + 4 12 12 6 -1. + <_> + 8 12 4 6 3. + <_> + + <_> + 5 6 6 10 -1. + <_> + 8 6 3 10 2. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 2 2 14 6 -1. + <_> + 2 2 7 3 2. + <_> + 9 5 7 3 2. + <_> + + <_> + 5 0 10 7 -1. + <_> + 5 0 5 7 2. + <_> + + <_> + 6 6 8 5 -1. + <_> + 10 6 4 5 2. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 8 0 10 18 -1. + <_> + 13 0 5 9 2. + <_> + 8 9 5 9 2. + <_> + + <_> + 2 5 14 6 -1. + <_> + 2 5 7 3 2. + <_> + 9 8 7 3 2. + <_> + + <_> + 7 1 6 10 -1. + <_> + 10 1 3 5 2. + <_> + 7 6 3 5 2. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 9 9 10 6 -1. + <_> + 14 9 5 3 2. + <_> + 9 12 5 3 2. + <_> + + <_> + 2 8 6 10 -1. + <_> + 2 13 6 5 2. + <_> + + <_> + 1 10 19 2 -1. + <_> + 1 11 19 1 2. + <_> + + <_> + 4 9 12 6 -1. + <_> + 4 12 12 3 2. + <_> + + <_> + 9 7 4 12 -1. + <_> + 9 11 4 4 3. + <_> + + <_> + 0 11 13 3 -1. + <_> + 0 12 13 1 3. + <_> + + <_> + 10 14 7 6 -1. + <_> + 10 16 7 2 3. + <_> + + <_> + 3 14 7 6 -1. + <_> + 3 16 7 2 3. + <_> + + <_> + 15 5 4 15 -1. + <_> + 15 5 2 15 2. + <_> + + <_> + 0 3 17 10 -1. + <_> + 0 8 17 5 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 0 0 20 4 -1. + <_> + 10 0 10 4 2. + <_> + + <_> + 6 1 10 6 -1. + <_> + 11 1 5 3 2. + <_> + 6 4 5 3 2. + <_> + + <_> + 0 9 18 11 -1. + <_> + 6 9 6 11 3. + <_> + + <_> + 4 14 13 3 -1. + <_> + 4 15 13 1 3. + <_> + + <_> + 0 10 20 6 -1. + <_> + 0 12 20 2 3. + <_> + + <_> + 10 9 6 10 -1. + <_> + 13 9 3 5 2. + <_> + 10 14 3 5 2. + <_> + + <_> + 7 10 6 10 -1. + <_> + 7 10 3 5 2. + <_> + 10 15 3 5 2. + <_> + + <_> + 6 1 8 15 -1. + <_> + 6 6 8 5 3. + <_> + + <_> + 0 8 18 3 -1. + <_> + 0 9 18 1 3. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 3 10 6 10 -1. + <_> + 3 10 3 5 2. + <_> + 6 15 3 5 2. + <_> + + <_> + 11 8 8 12 -1. + <_> + 15 8 4 6 2. + <_> + 11 14 4 6 2. + <_> + + <_> + 1 8 8 12 -1. + <_> + 1 8 4 6 2. + <_> + 5 14 4 6 2. + <_> + + <_> + 13 7 3 13 -1. + <_> + 14 7 1 13 3. + <_> + + <_> + 6 11 5 9 -1. + <_> + 6 14 5 3 3. + <_> + + <_> + 7 14 12 5 -1. + <_> + 7 14 6 5 2. + <_> + + <_> + 2 0 4 8 -1. + <_> + 2 4 4 4 2. + <_> + + <_> + 5 0 10 6 -1. + <_> + 5 3 10 3 2. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 6 9 8 8 -1. + <_> + 10 9 4 4 2. + <_> + 6 13 4 4 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 13 5 2 13 -1. + <_> + 13 5 1 13 2. + <_> + + <_> + 5 9 6 10 -1. + <_> + 5 9 3 5 2. + <_> + 8 14 3 5 2. + <_> + + <_> + 2 9 18 3 -1. + <_> + 8 9 6 3 3. + <_> + + <_> + 5 5 2 13 -1. + <_> + 6 5 1 13 2. + <_> + + <_> + 11 10 4 10 -1. + <_> + 11 10 2 10 2. + <_> + + <_> + 5 10 4 10 -1. + <_> + 7 10 2 10 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 4 2 15 14 -1. + <_> + 9 2 5 14 3. + <_> + + <_> + 1 2 15 14 -1. + <_> + 6 2 5 14 3. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 3 0 6 9 -1. + <_> + 5 0 2 9 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 1 3 10 8 -1. + <_> + 1 3 5 4 2. + <_> + 6 7 5 4 2. + <_> + + <_> + 5 13 14 6 -1. + <_> + 5 13 7 6 2. + <_> + + <_> + 1 13 14 6 -1. + <_> + 8 13 7 6 2. + <_> + + <_> + 7 2 13 3 -1. + <_> + 7 3 13 1 3. + <_> + + <_> + 0 7 20 2 -1. + <_> + 10 7 10 2 2. + <_> + + <_> + 5 0 15 6 -1. + <_> + 10 0 5 6 3. + <_> + + <_> + 0 0 15 6 -1. + <_> + 5 0 5 6 3. + <_> + + <_> + 12 1 8 13 -1. + <_> + 12 1 4 13 2. + <_> + + <_> + 0 1 8 13 -1. + <_> + 4 1 4 13 2. + <_> + + <_> + 15 0 4 18 -1. + <_> + 15 0 2 18 2. + <_> + + <_> + 4 0 12 4 -1. + <_> + 8 0 4 4 3. + <_> + + <_> + 15 0 4 18 -1. + <_> + 15 0 2 18 2. + <_> + + <_> + 1 0 4 18 -1. + <_> + 3 0 2 18 2. + <_> + + <_> + 4 12 12 6 -1. + <_> + 8 12 4 6 3. + <_> + + <_> + 2 0 6 5 -1. + <_> + 5 0 3 5 2. + <_> + + <_> + 12 5 4 12 -1. + <_> + 12 9 4 4 3. + <_> + + <_> + 4 4 11 6 -1. + <_> + 4 6 11 2 3. + <_> + + <_> + 11 6 5 6 -1. + <_> + 11 9 5 3 2. + <_> + + <_> + 5 6 8 8 -1. + <_> + 5 6 4 4 2. + <_> + 9 10 4 4 2. + <_> + + <_> + 10 9 4 8 -1. + <_> + 10 13 4 4 2. + <_> + + <_> + 6 14 8 4 -1. + <_> + 6 16 8 2 2. + <_> + + <_> + 10 2 4 7 -1. + <_> + 10 2 2 7 2. + <_> + + <_> + 1 9 13 2 -1. + <_> + 1 10 13 1 2. + <_> + + <_> + 10 2 4 7 -1. + <_> + 10 2 2 7 2. + <_> + + <_> + 6 2 4 7 -1. + <_> + 8 2 2 7 2. + <_> + + <_> + 9 5 7 14 -1. + <_> + 9 12 7 7 2. + <_> + + <_> + 0 0 17 2 -1. + <_> + 0 1 17 1 2. + <_> + + <_> + 5 9 10 8 -1. + <_> + 10 9 5 4 2. + <_> + 5 13 5 4 2. + <_> + + <_> + 3 10 8 6 -1. + <_> + 3 12 8 2 3. + <_> + + <_> + 7 11 7 6 -1. + <_> + 7 13 7 2 3. + <_> + + <_> + 3 3 13 2 -1. + <_> + 3 4 13 1 2. + <_> + + <_> + 10 2 5 6 -1. + <_> + 10 5 5 3 2. + <_> + + <_> + 6 5 2 14 -1. + <_> + 6 12 2 7 2. + <_> + + <_> + 12 9 4 8 -1. + <_> + 12 13 4 4 2. + <_> + + <_> + 4 9 4 8 -1. + <_> + 4 13 4 4 2. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 1 4 4 14 -1. + <_> + 1 4 2 7 2. + <_> + 3 11 2 7 2. + <_> + + <_> + 11 0 3 20 -1. + <_> + 12 0 1 20 3. + <_> + + <_> + 0 0 6 5 -1. + <_> + 3 0 3 5 2. + <_> + + <_> + 6 2 9 5 -1. + <_> + 9 2 3 5 3. + <_> + + <_> + 0 0 4 7 -1. + <_> + 2 0 2 7 2. + <_> + + <_> + 11 0 3 20 -1. + <_> + 12 0 1 20 3. + <_> + + <_> + 0 0 4 14 -1. + <_> + 2 0 2 14 2. + <_> + + <_> + 11 0 3 20 -1. + <_> + 12 0 1 20 3. + <_> + + <_> + 6 0 3 20 -1. + <_> + 7 0 1 20 3. + <_> + + <_> + 14 2 6 7 -1. + <_> + 16 2 2 7 3. + <_> + + <_> + 0 2 6 7 -1. + <_> + 2 2 2 7 3. + <_> + + <_> + 13 0 3 13 -1. + <_> + 14 0 1 13 3. + <_> + + <_> + 1 1 18 14 -1. + <_> + 7 1 6 14 3. + <_> + + <_> + 10 1 3 13 -1. + <_> + 11 1 1 13 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 4 10 16 4 -1. + <_> + 12 10 8 2 2. + <_> + 4 12 8 2 2. + <_> + + <_> + 0 10 18 4 -1. + <_> + 0 10 9 2 2. + <_> + 9 12 9 2 2. + <_> + + <_> + 8 14 10 6 -1. + <_> + 13 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 1 4 14 6 -1. + <_> + 1 4 7 3 2. + <_> + 8 7 7 3 2. + <_> + + <_> + 11 2 3 10 -1. + <_> + 11 7 3 5 2. + <_> + + <_> + 5 3 9 10 -1. + <_> + 5 8 9 5 2. + <_> + + <_> + 11 2 3 10 -1. + <_> + 11 7 3 5 2. + <_> + + <_> + 6 2 3 10 -1. + <_> + 6 7 3 5 2. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 5 0 3 20 -1. + <_> + 6 0 1 20 3. + <_> + + <_> + 11 10 4 8 -1. + <_> + 11 10 2 8 2. + <_> + + <_> + 5 10 4 8 -1. + <_> + 7 10 2 8 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 4 7 12 8 -1. + <_> + 8 7 4 8 3. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 0 11 8 4 -1. + <_> + 0 13 8 2 2. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 3 0 16 10 -1. + <_> + 11 0 8 5 2. + <_> + 3 5 8 5 2. + <_> + + <_> + 0 2 18 2 -1. + <_> + 0 3 18 1 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 8 0 2 13 -1. + <_> + 9 0 1 13 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 0 0 8 8 -1. + <_> + 0 0 4 4 2. + <_> + 4 4 4 4 2. + <_> + + <_> + 3 15 14 4 -1. + <_> + 10 15 7 2 2. + <_> + 3 17 7 2 2. + <_> + + <_> + 4 1 8 8 -1. + <_> + 4 1 4 4 2. + <_> + 8 5 4 4 2. + <_> + + <_> + 7 9 13 3 -1. + <_> + 7 10 13 1 3. + <_> + + <_> + 0 9 13 3 -1. + <_> + 0 10 13 1 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 0 14 8 6 -1. + <_> + 0 16 8 2 3. + <_> + + <_> + 6 7 13 2 -1. + <_> + 6 8 13 1 2. + <_> + + <_> + 4 11 5 9 -1. + <_> + 4 14 5 3 3. + <_> + + <_> + 7 11 7 6 -1. + <_> + 7 13 7 2 3. + <_> + + <_> + 0 1 6 7 -1. + <_> + 2 1 2 7 3. + <_> + + <_> + 5 8 13 2 -1. + <_> + 5 9 13 1 2. + <_> + + <_> + 0 7 14 4 -1. + <_> + 0 7 7 2 2. + <_> + 7 9 7 2 2. + <_> + + <_> + 15 4 4 16 -1. + <_> + 17 4 2 8 2. + <_> + 15 12 2 8 2. + <_> + + <_> + 0 12 7 6 -1. + <_> + 0 14 7 2 3. + <_> + + <_> + 14 7 6 12 -1. + <_> + 17 7 3 6 2. + <_> + 14 13 3 6 2. + <_> + + <_> + 3 16 12 4 -1. + <_> + 7 16 4 4 3. + <_> + + <_> + 2 17 18 3 -1. + <_> + 8 17 6 3 3. + <_> + + <_> + 2 7 15 5 -1. + <_> + 7 7 5 5 3. + <_> + + <_> + 10 2 4 15 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 7 0 6 12 -1. + <_> + 10 0 3 6 2. + <_> + 7 6 3 6 2. + <_> + + <_> + 4 3 12 10 -1. + <_> + 8 3 4 10 3. + <_> + + <_> + 8 1 4 10 -1. + <_> + 8 6 4 5 2. + <_> + + <_> + 0 3 20 8 -1. + <_> + 0 7 20 4 2. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 0 7 6 12 -1. + <_> + 0 7 3 6 2. + <_> + 3 13 3 6 2. + <_> + + <_> + 12 5 2 14 -1. + <_> + 12 12 2 7 2. + <_> + + <_> + 0 10 6 10 -1. + <_> + 0 10 3 5 2. + <_> + 3 15 3 5 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 2 0 16 8 -1. + <_> + 2 0 8 4 2. + <_> + 10 4 8 4 2. + <_> + + <_> + 9 5 7 9 -1. + <_> + 9 8 7 3 3. + <_> + + <_> + 0 12 8 8 -1. + <_> + 0 12 4 4 2. + <_> + 4 16 4 4 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 10 16 4 -1. + <_> + 0 10 8 2 2. + <_> + 8 12 8 2 2. + <_> + + <_> + 0 2 20 4 -1. + <_> + 10 2 10 2 2. + <_> + 0 4 10 2 2. + <_> + + <_> + 3 5 4 14 -1. + <_> + 3 5 2 7 2. + <_> + 5 12 2 7 2. + <_> + + <_> + 5 10 11 9 -1. + <_> + 5 13 11 3 3. + <_> + + <_> + 2 9 4 9 -1. + <_> + 4 9 2 9 2. + <_> + + <_> + 3 14 14 3 -1. + <_> + 3 15 14 1 3. + <_> + + <_> + 3 4 4 15 -1. + <_> + 3 9 4 5 3. + <_> + + <_> + 7 4 13 3 -1. + <_> + 7 5 13 1 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 11 0 9 7 -1. + <_> + 14 0 3 7 3. + <_> + + <_> + 1 10 6 7 -1. + <_> + 3 10 2 7 3. + <_> + + <_> + 13 0 3 17 -1. + <_> + 14 0 1 17 3. + <_> + + <_> + 9 4 2 13 -1. + <_> + 10 4 1 13 2. + <_> + + <_> + 6 6 12 9 -1. + <_> + 10 6 4 9 3. + <_> + + <_> + 2 6 12 9 -1. + <_> + 6 6 4 9 3. + <_> + + <_> + 3 14 14 4 -1. + <_> + 10 14 7 2 2. + <_> + 3 16 7 2 2. + <_> + + <_> + 3 3 13 4 -1. + <_> + 3 5 13 2 2. + <_> + + <_> + 10 14 10 6 -1. + <_> + 10 16 10 2 3. + <_> + + <_> + 0 14 11 6 -1. + <_> + 0 16 11 2 3. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 4 0 3 17 -1. + <_> + 5 0 1 17 3. + <_> + + <_> + 13 3 3 17 -1. + <_> + 14 3 1 17 3. + <_> + + <_> + 1 0 18 9 -1. + <_> + 7 0 6 9 3. + <_> + + <_> + 9 7 9 6 -1. + <_> + 12 7 3 6 3. + <_> + + <_> + 4 3 3 17 -1. + <_> + 5 3 1 17 3. + <_> + + <_> + 6 14 14 3 -1. + <_> + 6 15 14 1 3. + <_> + + <_> + 2 14 13 3 -1. + <_> + 2 15 13 1 3. + <_> + + <_> + 5 14 15 3 -1. + <_> + 5 15 15 1 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 7 7 9 6 -1. + <_> + 7 10 9 3 2. + <_> + + <_> + 8 5 3 10 -1. + <_> + 8 10 3 5 2. + <_> + + <_> + 5 8 14 2 -1. + <_> + 5 9 14 1 2. + <_> + + <_> + 0 6 13 3 -1. + <_> + 0 7 13 1 3. + <_> + + <_> + 3 13 17 6 -1. + <_> + 3 15 17 2 3. + <_> + + <_> + 6 15 8 4 -1. + <_> + 6 17 8 2 2. + <_> + + <_> + 6 7 14 2 -1. + <_> + 6 8 14 1 2. + <_> + + <_> + 6 7 6 8 -1. + <_> + 6 11 6 4 2. + <_> + + <_> + 5 4 13 3 -1. + <_> + 5 5 13 1 3. + <_> + + <_> + 0 0 6 10 -1. + <_> + 0 0 3 5 2. + <_> + 3 5 3 5 2. + <_> + + <_> + 8 5 12 4 -1. + <_> + 12 5 4 4 3. + <_> + + <_> + 6 5 2 14 -1. + <_> + 6 12 2 7 2. + <_> + + <_> + 11 0 9 7 -1. + <_> + 14 0 3 7 3. + <_> + + <_> + 0 5 12 4 -1. + <_> + 4 5 4 4 3. + <_> + + <_> + 11 0 9 7 -1. + <_> + 14 0 3 7 3. + <_> + + <_> + 0 0 9 7 -1. + <_> + 3 0 3 7 3. + <_> + + <_> + 2 13 16 4 -1. + <_> + 10 13 8 2 2. + <_> + 2 15 8 2 2. + <_> + + <_> + 0 10 7 6 -1. + <_> + 0 12 7 2 3. + <_> + + <_> + 5 0 10 8 -1. + <_> + 5 4 10 4 2. + <_> + + <_> + 5 2 10 14 -1. + <_> + 5 9 10 7 2. + <_> + + <_> + 7 7 13 2 -1. + <_> + 7 8 13 1 2. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 4 0 13 3 -1. + <_> + 4 1 13 1 3. + <_> + + <_> + 5 0 10 4 -1. + <_> + 5 2 10 2 2. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 0 0 18 3 -1. + <_> + 9 0 9 3 2. + <_> + + <_> + 2 17 18 3 -1. + <_> + 8 17 6 3 3. + <_> + + <_> + 0 17 18 3 -1. + <_> + 6 17 6 3 3. + <_> + + <_> + 11 16 8 4 -1. + <_> + 11 16 4 4 2. + <_> + + <_> + 0 3 18 15 -1. + <_> + 0 8 18 5 3. + <_> + + <_> + 2 9 16 8 -1. + <_> + 2 13 16 4 2. + <_> + + <_> + 0 10 7 4 -1. + <_> + 0 12 7 2 2. + <_> + + <_> + 4 5 12 12 -1. + <_> + 10 5 6 6 2. + <_> + 4 11 6 6 2. + <_> + + <_> + 5 12 9 5 -1. + <_> + 8 12 3 5 3. + <_> + + <_> + 18 0 2 16 -1. + <_> + 18 8 2 8 2. + <_> + + <_> + 0 0 2 16 -1. + <_> + 0 8 2 8 2. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 14 7 6 10 -1. + <_> + 17 7 3 5 2. + <_> + 14 12 3 5 2. + <_> + + <_> + 0 2 12 6 -1. + <_> + 0 2 6 3 2. + <_> + 6 5 6 3 2. + <_> + + <_> + 10 0 10 10 -1. + <_> + 15 0 5 5 2. + <_> + 10 5 5 5 2. + <_> + + <_> + 0 0 10 10 -1. + <_> + 0 0 5 5 2. + <_> + 5 5 5 5 2. + <_> + + <_> + 2 7 18 4 -1. + <_> + 11 7 9 2 2. + <_> + 2 9 9 2 2. + <_> + + <_> + 5 3 6 14 -1. + <_> + 5 3 3 7 2. + <_> + 8 10 3 7 2. + <_> + + <_> + 9 2 3 13 -1. + <_> + 10 2 1 13 3. + <_> + + <_> + 0 7 6 10 -1. + <_> + 0 7 3 5 2. + <_> + 3 12 3 5 2. + <_> + + <_> + 13 4 3 13 -1. + <_> + 14 4 1 13 3. + <_> + + <_> + 1 16 8 4 -1. + <_> + 5 16 4 4 2. + <_> + + <_> + 5 15 15 5 -1. + <_> + 10 15 5 5 3. + <_> + + <_> + 7 3 4 13 -1. + <_> + 9 3 2 13 2. + <_> + + <_> + 7 4 13 3 -1. + <_> + 7 5 13 1 3. + <_> + + <_> + 2 0 16 8 -1. + <_> + 2 0 8 4 2. + <_> + 10 4 8 4 2. + <_> + + <_> + 13 7 6 11 -1. + <_> + 15 7 2 11 3. + <_> + + <_> + 7 9 6 10 -1. + <_> + 7 9 3 5 2. + <_> + 10 14 3 5 2. + <_> + + <_> + 7 5 9 8 -1. + <_> + 10 5 3 8 3. + <_> + + <_> + 4 5 3 13 -1. + <_> + 5 5 1 13 3. + <_> + + <_> + 10 4 6 12 -1. + <_> + 10 8 6 4 3. + <_> + + <_> + 7 4 6 7 -1. + <_> + 9 4 2 7 3. + <_> + + <_> + 5 6 12 4 -1. + <_> + 9 6 4 4 3. + <_> + + <_> + 3 6 12 4 -1. + <_> + 7 6 4 4 3. + <_> + + <_> + 16 4 4 8 -1. + <_> + 16 8 4 4 2. + <_> + + <_> + 4 5 9 8 -1. + <_> + 7 5 3 8 3. + <_> + + <_> + 16 4 4 8 -1. + <_> + 16 8 4 4 2. + <_> + + <_> + 4 5 8 15 -1. + <_> + 4 10 8 5 3. + <_> + + <_> + 5 14 13 2 -1. + <_> + 5 15 13 1 2. + <_> + + <_> + 1 7 4 13 -1. + <_> + 3 7 2 13 2. + <_> + + <_> + 11 9 6 8 -1. + <_> + 11 9 3 8 2. + <_> + + <_> + 3 9 6 8 -1. + <_> + 6 9 3 8 2. + <_> + + <_> + 8 1 9 15 -1. + <_> + 11 1 3 15 3. + <_> + + <_> + 3 1 9 15 -1. + <_> + 6 1 3 15 3. + <_> + + <_> + 9 7 9 6 -1. + <_> + 12 7 3 6 3. + <_> + + <_> + 0 5 6 7 -1. + <_> + 2 5 2 7 3. + <_> + + <_> + 11 2 2 16 -1. + <_> + 11 2 1 16 2. + <_> + + <_> + 1 1 18 10 -1. + <_> + 7 1 6 10 3. + <_> + + <_> + 10 8 10 8 -1. + <_> + 15 8 5 4 2. + <_> + 10 12 5 4 2. + <_> + + <_> + 0 8 10 8 -1. + <_> + 0 8 5 4 2. + <_> + 5 12 5 4 2. + <_> + + <_> + 11 2 2 16 -1. + <_> + 11 2 1 16 2. + <_> + + <_> + 3 9 12 11 -1. + <_> + 9 9 6 11 2. + <_> + + <_> + 6 7 10 3 -1. + <_> + 6 7 5 3 2. + <_> + + <_> + 3 1 10 16 -1. + <_> + 3 1 5 8 2. + <_> + 8 9 5 8 2. + <_> + + <_> + 8 3 8 10 -1. + <_> + 12 3 4 5 2. + <_> + 8 8 4 5 2. + <_> + + <_> + 4 3 8 10 -1. + <_> + 4 3 4 5 2. + <_> + 8 8 4 5 2. + <_> + + <_> + 10 11 9 6 -1. + <_> + 10 14 9 3 2. + <_> + + <_> + 1 11 9 6 -1. + <_> + 1 14 9 3 2. + <_> + + <_> + 6 16 14 4 -1. + <_> + 13 16 7 2 2. + <_> + 6 18 7 2 2. + <_> + + <_> + 1 0 9 18 -1. + <_> + 1 6 9 6 3. + <_> + + <_> + 8 3 12 4 -1. + <_> + 8 5 12 2 2. + <_> + + <_> + 1 5 7 9 -1. + <_> + 1 8 7 3 3. + <_> + + <_> + 13 4 7 6 -1. + <_> + 13 6 7 2 3. + <_> + + <_> + 0 4 7 6 -1. + <_> + 0 6 7 2 3. + <_> + + <_> + 9 2 6 7 -1. + <_> + 11 2 2 7 3. + <_> + + <_> + 5 2 6 7 -1. + <_> + 7 2 2 7 3. + <_> + + <_> + 4 16 15 4 -1. + <_> + 9 16 5 4 3. + <_> + + <_> + 0 17 15 3 -1. + <_> + 5 17 5 3 3. + <_> + + <_> + 2 2 18 18 -1. + <_> + 8 2 6 18 3. + <_> + + <_> + 5 4 4 16 -1. + <_> + 7 4 2 16 2. + <_> + + <_> + 6 9 9 6 -1. + <_> + 9 9 3 6 3. + <_> + + <_> + 1 14 10 6 -1. + <_> + 1 14 5 3 2. + <_> + 6 17 5 3 2. + <_> + + <_> + 6 7 12 5 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 0 10 5 9 -1. + <_> + 0 13 5 3 3. + <_> + + <_> + 13 10 6 9 -1. + <_> + 13 13 6 3 3. + <_> + + <_> + 1 10 6 9 -1. + <_> + 1 13 6 3 3. + <_> + + <_> + 5 7 10 4 -1. + <_> + 5 9 10 2 2. + <_> + + <_> + 1 5 18 12 -1. + <_> + 1 9 18 4 3. + <_> + + <_> + 8 14 10 6 -1. + <_> + 13 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 2 4 13 14 -1. + <_> + 2 11 13 7 2. + <_> + + <_> + 10 8 6 6 -1. + <_> + 10 8 3 6 2. + <_> + + <_> + 2 1 16 8 -1. + <_> + 2 5 16 4 2. + <_> + + <_> + 10 8 6 6 -1. + <_> + 10 8 3 6 2. + <_> + + <_> + 4 0 11 6 -1. + <_> + 4 2 11 2 3. + <_> + + <_> + 2 2 16 2 -1. + <_> + 2 3 16 1 2. + <_> + + <_> + 4 15 12 5 -1. + <_> + 10 15 6 5 2. + <_> + + <_> + 10 8 6 6 -1. + <_> + 10 8 3 6 2. + <_> + + <_> + 0 14 12 4 -1. + <_> + 6 14 6 4 2. + <_> + + <_> + 12 7 6 6 -1. + <_> + 12 10 6 3 2. + <_> + + <_> + 1 5 6 14 -1. + <_> + 1 5 3 7 2. + <_> + 4 12 3 7 2. + <_> + + <_> + 10 2 9 13 -1. + <_> + 13 2 3 13 3. + <_> + + <_> + 4 8 6 6 -1. + <_> + 7 8 3 6 2. + <_> + + <_> + 12 5 6 9 -1. + <_> + 12 5 3 9 2. + <_> + + <_> + 2 5 6 9 -1. + <_> + 5 5 3 9 2. + <_> + + <_> + 5 8 15 2 -1. + <_> + 5 9 15 1 2. + <_> + + <_> + 2 9 16 3 -1. + <_> + 2 10 16 1 3. + <_> + + <_> + 12 7 5 6 -1. + <_> + 12 10 5 3 2. + <_> + + <_> + 3 7 5 6 -1. + <_> + 3 10 5 3 2. + <_> + + <_> + 15 9 5 9 -1. + <_> + 15 12 5 3 3. + <_> + + <_> + 0 13 20 4 -1. + <_> + 0 13 10 2 2. + <_> + 10 15 10 2 2. + <_> + + <_> + 5 10 13 3 -1. + <_> + 5 11 13 1 3. + <_> + + <_> + 2 12 10 6 -1. + <_> + 2 12 5 3 2. + <_> + 7 15 5 3 2. + <_> + + <_> + 9 10 3 10 -1. + <_> + 9 15 3 5 2. + <_> + + <_> + 8 2 3 13 -1. + <_> + 9 2 1 13 3. + <_> + + <_> + 15 9 5 9 -1. + <_> + 15 12 5 3 3. + <_> + + <_> + 8 2 3 13 -1. + <_> + 9 2 1 13 3. + <_> + + <_> + 15 9 5 9 -1. + <_> + 15 12 5 3 3. + <_> + + <_> + 1 6 3 13 -1. + <_> + 2 6 1 13 3. + <_> + + <_> + 10 4 6 16 -1. + <_> + 12 4 2 16 3. + <_> + + <_> + 4 4 6 16 -1. + <_> + 6 4 2 16 3. + <_> + + <_> + 7 15 9 5 -1. + <_> + 10 15 3 5 3. + <_> + + <_> + 4 16 12 4 -1. + <_> + 8 16 4 4 3. + <_> + + <_> + 5 3 10 6 -1. + <_> + 10 3 5 3 2. + <_> + 5 6 5 3 2. + <_> + + <_> + 3 5 13 3 -1. + <_> + 3 6 13 1 3. + <_> + + <_> + 6 2 14 2 -1. + <_> + 6 3 14 1 2. + <_> + + <_> + 3 11 8 4 -1. + <_> + 7 11 4 4 2. + <_> + + <_> + 4 2 12 4 -1. + <_> + 4 2 6 4 2. + <_> + + <_> + 0 2 6 15 -1. + <_> + 0 7 6 5 3. + <_> + + <_> + 3 0 17 6 -1. + <_> + 3 2 17 2 3. + <_> + + <_> + 0 4 7 4 -1. + <_> + 0 6 7 2 2. + <_> + + <_> + 3 9 14 2 -1. + <_> + 3 9 7 2 2. + <_> + + <_> + 4 7 10 3 -1. + <_> + 9 7 5 3 2. + <_> + + <_> + 4 4 13 3 -1. + <_> + 4 5 13 1 3. + <_> + + <_> + 4 6 10 3 -1. + <_> + 9 6 5 3 2. + <_> + + <_> + 4 12 16 8 -1. + <_> + 4 12 8 8 2. + <_> + + <_> + 0 12 16 8 -1. + <_> + 8 12 8 8 2. + <_> + + <_> + 14 9 6 10 -1. + <_> + 16 9 2 10 3. + <_> + + <_> + 2 7 11 12 -1. + <_> + 2 11 11 4 3. + <_> + + <_> + 9 3 3 12 -1. + <_> + 9 9 3 6 2. + <_> + + <_> + 2 1 6 15 -1. + <_> + 2 6 6 5 3. + <_> + + <_> + 17 7 2 13 -1. + <_> + 17 7 1 13 2. + <_> + + <_> + 1 7 2 13 -1. + <_> + 2 7 1 13 2. + <_> + + <_> + 0 1 20 4 -1. + <_> + 10 1 10 2 2. + <_> + 0 3 10 2 2. + <_> + + <_> + 6 1 7 6 -1. + <_> + 6 3 7 2 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 5 10 6 6 -1. + <_> + 8 10 3 6 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 12 0 4 20 3. + <_> + + <_> + 6 7 6 8 -1. + <_> + 8 7 2 8 3. + <_> + + <_> + 12 5 4 8 -1. + <_> + 12 9 4 4 2. + <_> + + <_> + 5 2 9 5 -1. + <_> + 8 2 3 5 3. + <_> + + <_> + 8 10 12 9 -1. + <_> + 12 10 4 9 3. + <_> + + <_> + 4 15 9 5 -1. + <_> + 7 15 3 5 3. + <_> + + <_> + 1 1 18 3 -1. + <_> + 7 1 6 3 3. + <_> + + <_> + 12 7 8 4 -1. + <_> + 12 9 8 2 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 3 4 15 16 -1. + <_> + 3 12 15 8 2. + <_> + + <_> + 0 7 8 4 -1. + <_> + 0 9 8 2 2. + <_> + + <_> + 7 6 6 9 -1. + <_> + 9 6 2 9 3. + <_> + + <_> + 4 11 8 9 -1. + <_> + 4 14 8 3 3. + <_> + + <_> + 11 3 9 8 -1. + <_> + 14 3 3 8 3. + <_> + + <_> + 0 4 9 8 -1. + <_> + 3 4 3 8 3. + <_> + + <_> + 9 4 6 10 -1. + <_> + 12 4 3 5 2. + <_> + 9 9 3 5 2. + <_> + + <_> + 0 4 20 4 -1. + <_> + 0 6 20 2 2. + <_> + + <_> + 2 9 18 3 -1. + <_> + 8 9 6 3 3. + <_> + + <_> + 3 14 13 3 -1. + <_> + 3 15 13 1 3. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 10 4 4 2. + <_> + 10 14 4 4 2. + <_> + + <_> + 6 9 8 8 -1. + <_> + 10 9 4 4 2. + <_> + 6 13 4 4 2. + <_> + + <_> + 0 7 10 6 -1. + <_> + 0 7 5 3 2. + <_> + 5 10 5 3 2. + <_> + + <_> + 7 1 8 8 -1. + <_> + 11 1 4 4 2. + <_> + 7 5 4 4 2. + <_> + + <_> + 5 1 8 8 -1. + <_> + 5 1 4 4 2. + <_> + 9 5 4 4 2. + <_> + + <_> + 10 0 8 4 -1. + <_> + 10 2 8 2 2. + <_> + + <_> + 0 13 7 6 -1. + <_> + 0 15 7 2 3. + <_> + + <_> + 15 11 5 6 -1. + <_> + 15 14 5 3 2. + <_> + + <_> + 1 6 18 8 -1. + <_> + 1 6 9 4 2. + <_> + 10 10 9 4 2. + <_> + + <_> + 4 3 13 3 -1. + <_> + 4 4 13 1 3. + <_> + + <_> + 1 9 13 2 -1. + <_> + 1 10 13 1 2. + <_> + + <_> + 9 12 8 8 -1. + <_> + 13 12 4 4 2. + <_> + 9 16 4 4 2. + <_> + + <_> + 0 11 5 6 -1. + <_> + 0 14 5 3 2. + <_> + + <_> + 15 3 5 9 -1. + <_> + 15 6 5 3 3. + <_> + + <_> + 0 4 2 16 -1. + <_> + 0 12 2 8 2. + <_> + + <_> + 15 3 5 9 -1. + <_> + 15 6 5 3 3. + <_> + + <_> + 2 5 16 10 -1. + <_> + 2 5 8 5 2. + <_> + 10 10 8 5 2. + <_> + + <_> + 6 7 14 2 -1. + <_> + 6 8 14 1 2. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 10 0 6 9 -1. + <_> + 12 0 2 9 3. + <_> + + <_> + 8 0 3 13 -1. + <_> + 9 0 1 13 3. + <_> + + <_> + 9 6 3 14 -1. + <_> + 10 6 1 14 3. + <_> + + <_> + 8 6 3 14 -1. + <_> + 9 6 1 14 3. + <_> + + <_> + 9 13 6 7 -1. + <_> + 11 13 2 7 3. + <_> + + <_> + 6 0 2 13 -1. + <_> + 7 0 1 13 2. + <_> + + <_> + 3 7 15 3 -1. + <_> + 8 7 5 3 3. + <_> + + <_> + 0 10 7 6 -1. + <_> + 0 12 7 2 3. + <_> + + <_> + 12 11 8 6 -1. + <_> + 12 13 8 2 3. + <_> + + <_> + 4 0 6 9 -1. + <_> + 6 0 2 9 3. + <_> + + <_> + 9 1 6 7 -1. + <_> + 11 1 2 7 3. + <_> + + <_> + 2 9 9 10 -1. + <_> + 5 9 3 10 3. + <_> + + <_> + 14 0 3 18 -1. + <_> + 15 0 1 18 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 9 1 6 7 -1. + <_> + 11 1 2 7 3. + <_> + + <_> + 8 2 4 8 -1. + <_> + 10 2 2 8 2. + <_> + + <_> + 14 0 3 18 -1. + <_> + 15 0 1 18 3. + <_> + + <_> + 0 5 12 4 -1. + <_> + 4 5 4 4 3. + <_> + + <_> + 6 0 13 3 -1. + <_> + 6 1 13 1 3. + <_> + + <_> + 0 6 20 3 -1. + <_> + 0 7 20 1 3. + <_> + + <_> + 10 8 8 8 -1. + <_> + 14 8 4 4 2. + <_> + 10 12 4 4 2. + <_> + + <_> + 1 1 5 9 -1. + <_> + 1 4 5 3 3. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 1 4 16 6 -1. + <_> + 1 4 8 3 2. + <_> + 9 7 8 3 2. + <_> + + <_> + 9 0 10 6 -1. + <_> + 9 2 10 2 3. + <_> + + <_> + 4 3 12 6 -1. + <_> + 4 5 12 2 3. + <_> + + <_> + 9 5 8 8 -1. + <_> + 9 9 8 4 2. + <_> + + <_> + 1 0 9 6 -1. + <_> + 1 2 9 2 3. + <_> + + <_> + 8 3 9 5 -1. + <_> + 11 3 3 5 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 5 4 13 3 -1. + <_> + 5 5 13 1 3. + <_> + + <_> + 3 3 3 16 -1. + <_> + 4 3 1 16 3. + <_> + + <_> + 14 0 3 17 -1. + <_> + 15 0 1 17 3. + <_> + + <_> + 0 10 9 7 -1. + <_> + 3 10 3 7 3. + <_> + + <_> + 8 0 7 12 -1. + <_> + 8 4 7 4 3. + <_> + + <_> + 0 3 5 9 -1. + <_> + 0 6 5 3 3. + <_> + + <_> + 9 9 10 5 -1. + <_> + 9 9 5 5 2. + <_> + + <_> + 1 9 10 5 -1. + <_> + 6 9 5 5 2. + <_> + + <_> + 4 8 15 3 -1. + <_> + 9 8 5 3 3. + <_> + + <_> + 1 8 15 3 -1. + <_> + 6 8 5 3 3. + <_> + + <_> + 5 5 10 6 -1. + <_> + 10 5 5 3 2. + <_> + 5 8 5 3 2. + <_> + + <_> + 3 5 8 8 -1. + <_> + 3 9 8 4 2. + <_> + + <_> + 0 1 20 2 -1. + <_> + 0 1 10 2 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 8 12 8 8 -1. + <_> + 12 12 4 4 2. + <_> + 8 16 4 4 2. + <_> + + <_> + 4 12 8 8 -1. + <_> + 4 12 4 4 2. + <_> + 8 16 4 4 2. + <_> + + <_> + 7 15 13 4 -1. + <_> + 7 17 13 2 2. + <_> + + <_> + 0 14 12 6 -1. + <_> + 0 14 6 3 2. + <_> + 6 17 6 3 2. + <_> + + <_> + 12 11 8 8 -1. + <_> + 16 11 4 4 2. + <_> + 12 15 4 4 2. + <_> + + <_> + 0 11 8 8 -1. + <_> + 0 11 4 4 2. + <_> + 4 15 4 4 2. + <_> + + <_> + 6 0 10 19 -1. + <_> + 6 0 5 19 2. + <_> + + <_> + 0 12 13 3 -1. + <_> + 0 13 13 1 3. + <_> + + <_> + 7 2 6 12 -1. + <_> + 7 8 6 6 2. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 11 14 9 4 -1. + <_> + 11 16 9 2 2. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 11 12 8 6 -1. + <_> + 11 14 8 2 3. + <_> + + <_> + 1 12 8 6 -1. + <_> + 1 14 8 2 3. + <_> + + <_> + 4 0 13 8 -1. + <_> + 4 4 13 4 2. + <_> + + <_> + 8 0 4 15 -1. + <_> + 8 5 4 5 3. + <_> + + <_> + 10 8 8 8 -1. + <_> + 14 8 4 4 2. + <_> + 10 12 4 4 2. + <_> + + <_> + 8 7 3 10 -1. + <_> + 8 12 3 5 2. + <_> + + <_> + 1 17 18 3 -1. + <_> + 7 17 6 3 3. + <_> + + <_> + 2 9 5 9 -1. + <_> + 2 12 5 3 3. + <_> + + <_> + 3 6 16 3 -1. + <_> + 3 6 8 3 2. + <_> + + <_> + 3 13 12 7 -1. + <_> + 9 13 6 7 2. + <_> + + <_> + 10 2 3 15 -1. + <_> + 11 2 1 15 3. + <_> + + <_> + 7 2 3 15 -1. + <_> + 8 2 1 15 3. + <_> + + <_> + 10 1 7 4 -1. + <_> + 10 3 7 2 2. + <_> + + <_> + 5 0 7 12 -1. + <_> + 5 4 7 4 3. + <_> + + <_> + 10 1 7 4 -1. + <_> + 10 3 7 2 2. + <_> + + <_> + 3 12 4 8 -1. + <_> + 3 16 4 4 2. + <_> + + <_> + 6 7 9 5 -1. + <_> + 9 7 3 5 3. + <_> + + <_> + 5 0 6 16 -1. + <_> + 7 0 2 16 3. + <_> + + <_> + 10 8 8 8 -1. + <_> + 14 8 4 4 2. + <_> + 10 12 4 4 2. + <_> + + <_> + 2 8 8 8 -1. + <_> + 2 8 4 4 2. + <_> + 6 12 4 4 2. + <_> + + <_> + 4 8 16 8 -1. + <_> + 12 8 8 4 2. + <_> + 4 12 8 4 2. + <_> + + <_> + 2 10 6 10 -1. + <_> + 2 10 3 5 2. + <_> + 5 15 3 5 2. + <_> + + <_> + 10 10 4 8 -1. + <_> + 10 14 4 4 2. + <_> + + <_> + 1 6 16 3 -1. + <_> + 9 6 8 3 2. + <_> + + <_> + 10 1 7 4 -1. + <_> + 10 3 7 2 2. + <_> + + <_> + 3 1 7 4 -1. + <_> + 3 3 7 2 2. + <_> + + <_> + 10 2 4 7 -1. + <_> + 10 2 2 7 2. + <_> + + <_> + 4 0 10 19 -1. + <_> + 9 0 5 19 2. + <_> + + <_> + 12 0 3 13 -1. + <_> + 13 0 1 13 3. + <_> + + <_> + 1 4 18 5 -1. + <_> + 7 4 6 5 3. + <_> + + <_> + 10 2 4 7 -1. + <_> + 10 2 2 7 2. + <_> + + <_> + 6 2 4 7 -1. + <_> + 8 2 2 7 2. + <_> + + <_> + 2 1 16 3 -1. + <_> + 2 1 8 3 2. + <_> + + <_> + 5 7 7 9 -1. + <_> + 5 10 7 3 3. + <_> + + <_> + 4 5 14 3 -1. + <_> + 4 6 14 1 3. + <_> + + <_> + 2 13 7 6 -1. + <_> + 2 15 7 2 3. + <_> + + <_> + 10 10 4 8 -1. + <_> + 10 14 4 4 2. + <_> + + <_> + 5 0 3 18 -1. + <_> + 5 6 3 6 3. + <_> + + <_> + 10 0 10 10 -1. + <_> + 15 0 5 5 2. + <_> + 10 5 5 5 2. + <_> + + <_> + 0 4 14 3 -1. + <_> + 0 5 14 1 3. + <_> + + <_> + 6 4 13 3 -1. + <_> + 6 5 13 1 3. + <_> + + <_> + 5 0 3 13 -1. + <_> + 6 0 1 13 3. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 4 9 6 7 -1. + <_> + 6 9 2 7 3. + <_> + + <_> + 2 9 18 3 -1. + <_> + 8 9 6 3 3. + <_> + + <_> + 0 9 18 3 -1. + <_> + 6 9 6 3 3. + <_> + + <_> + 2 17 17 3 -1. + <_> + 2 18 17 1 3. + <_> + + <_> + 8 1 3 19 -1. + <_> + 9 1 1 19 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 4 2 12 12 -1. + <_> + 4 6 12 4 3. + <_> + + <_> + 0 17 13 3 -1. + <_> + 0 18 13 1 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 4 8 11 12 -1. + <_> + 4 12 11 4 3. + <_> + + <_> + 12 8 5 6 -1. + <_> + 12 11 5 3 2. + <_> + + <_> + 3 8 5 6 -1. + <_> + 3 11 5 3 2. + <_> + + <_> + 13 3 7 6 -1. + <_> + 13 5 7 2 3. + <_> + + <_> + 3 0 3 17 -1. + <_> + 4 0 1 17 3. + <_> + + <_> + 5 10 13 3 -1. + <_> + 5 11 13 1 3. + <_> + + <_> + 5 9 4 8 -1. + <_> + 5 13 4 4 2. + <_> + + <_> + 13 3 7 6 -1. + <_> + 13 5 7 2 3. + <_> + + <_> + 0 0 2 13 -1. + <_> + 1 0 1 13 2. + <_> + + <_> + 7 1 7 14 -1. + <_> + 7 8 7 7 2. + <_> + + <_> + 2 0 15 8 -1. + <_> + 2 4 15 4 2. + <_> + + <_> + 1 4 18 3 -1. + <_> + 7 4 6 3 3. + <_> + + <_> + 0 2 10 16 -1. + <_> + 5 2 5 16 2. + <_> + + <_> + 5 2 15 12 -1. + <_> + 5 6 15 4 3. + <_> + + <_> + 7 0 6 8 -1. + <_> + 9 0 2 8 3. + <_> + + <_> + 5 1 15 5 -1. + <_> + 10 1 5 5 3. + <_> + + <_> + 0 8 12 9 -1. + <_> + 4 8 4 9 3. + <_> + + <_> + 6 5 10 6 -1. + <_> + 11 5 5 3 2. + <_> + 6 8 5 3 2. + <_> + + <_> + 3 4 4 12 -1. + <_> + 5 4 2 12 2. + <_> + + <_> + 13 0 7 4 -1. + <_> + 13 2 7 2 2. + <_> + + <_> + 0 2 10 12 -1. + <_> + 0 8 10 6 2. + <_> + + <_> + 4 8 16 3 -1. + <_> + 4 8 8 3 2. + <_> + + <_> + 4 8 11 12 -1. + <_> + 4 14 11 6 2. + <_> + + <_> + 2 1 16 3 -1. + <_> + 2 2 16 1 3. + <_> + + <_> + 4 2 11 6 -1. + <_> + 4 4 11 2 3. + <_> + + <_> + 11 9 8 6 -1. + <_> + 11 11 8 2 3. + <_> + + <_> + 0 0 13 3 -1. + <_> + 0 1 13 1 3. + <_> + + <_> + 2 4 16 3 -1. + <_> + 2 5 16 1 3. + <_> + + <_> + 0 0 10 10 -1. + <_> + 0 0 5 5 2. + <_> + 5 5 5 5 2. + <_> + + <_> + 6 2 13 3 -1. + <_> + 6 3 13 1 3. + <_> + + <_> + 4 6 10 3 -1. + <_> + 9 6 5 3 2. + <_> + + <_> + 2 7 16 7 -1. + <_> + 2 7 8 7 2. + <_> + + <_> + 6 13 6 7 -1. + <_> + 8 13 2 7 3. + <_> + + <_> + 6 6 10 6 -1. + <_> + 11 6 5 3 2. + <_> + 6 9 5 3 2. + <_> + + <_> + 0 15 13 3 -1. + <_> + 0 16 13 1 3. + <_> + + <_> + 4 10 12 4 -1. + <_> + 8 10 4 4 3. + <_> + + <_> + 7 6 6 9 -1. + <_> + 9 6 2 9 3. + <_> + + <_> + 9 1 3 13 -1. + <_> + 10 1 1 13 3. + <_> + + <_> + 8 1 3 13 -1. + <_> + 9 1 1 13 3. + <_> + + <_> + 6 1 8 12 -1. + <_> + 10 1 4 6 2. + <_> + 6 7 4 6 2. + <_> + + <_> + 4 5 10 6 -1. + <_> + 4 5 5 3 2. + <_> + 9 8 5 3 2. + <_> + + <_> + 9 3 6 10 -1. + <_> + 12 3 3 5 2. + <_> + 9 8 3 5 2. + <_> + + <_> + 2 1 15 6 -1. + <_> + 2 3 15 2 3. + <_> + + <_> + 2 1 18 16 -1. + <_> + 8 1 6 16 3. + <_> + + <_> + 2 1 14 6 -1. + <_> + 9 1 7 6 2. + <_> + + <_> + 7 9 13 3 -1. + <_> + 7 10 13 1 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 8 1 12 14 -1. + <_> + 8 1 6 14 2. + <_> + + <_> + 0 1 12 14 -1. + <_> + 6 1 6 14 2. + <_> + + <_> + 2 3 18 13 -1. + <_> + 8 3 6 13 3. + <_> + + <_> + 4 6 12 4 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 5 2. + <_> + 14 15 3 5 2. + <_> + + <_> + 0 10 6 10 -1. + <_> + 0 10 3 5 2. + <_> + 3 15 3 5 2. + <_> + + <_> + 7 7 13 2 -1. + <_> + 7 8 13 1 2. + <_> + + <_> + 5 13 10 6 -1. + <_> + 5 13 5 3 2. + <_> + 10 16 5 3 2. + <_> + + <_> + 16 2 4 18 -1. + <_> + 18 2 2 9 2. + <_> + 16 11 2 9 2. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 7 2 12 6 -1. + <_> + 13 2 6 3 2. + <_> + 7 5 6 3 2. + <_> + + <_> + 4 2 12 6 -1. + <_> + 4 2 6 3 2. + <_> + 10 5 6 3 2. + <_> + + <_> + 12 9 4 8 -1. + <_> + 12 13 4 4 2. + <_> + + <_> + 0 8 16 8 -1. + <_> + 0 8 8 4 2. + <_> + 8 12 8 4 2. + <_> + + <_> + 10 10 10 6 -1. + <_> + 15 10 5 3 2. + <_> + 10 13 5 3 2. + <_> + + <_> + 0 8 4 8 -1. + <_> + 0 12 4 4 2. + <_> + + <_> + 10 2 6 12 -1. + <_> + 13 2 3 6 2. + <_> + 10 8 3 6 2. + <_> + + <_> + 0 0 20 14 -1. + <_> + 0 7 20 7 2. + <_> + + <_> + 11 9 7 6 -1. + <_> + 11 11 7 2 3. + <_> + + <_> + 1 9 8 6 -1. + <_> + 1 11 8 2 3. + <_> + + <_> + 13 1 7 15 -1. + <_> + 13 6 7 5 3. + <_> + + <_> + 0 1 7 15 -1. + <_> + 0 6 7 5 3. + <_> + + <_> + 12 10 5 6 -1. + <_> + 12 13 5 3 2. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 4 6 10 6 -1. + <_> + 4 6 5 3 2. + <_> + 9 9 5 3 2. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 1 7 12 4 -1. + <_> + 5 7 4 4 3. + <_> + + <_> + 14 1 2 19 -1. + <_> + 14 1 1 19 2. + <_> + + <_> + 4 1 2 19 -1. + <_> + 5 1 1 19 2. + <_> + + <_> + 12 10 5 6 -1. + <_> + 12 13 5 3 2. + <_> + + <_> + 3 10 5 6 -1. + <_> + 3 13 5 3 2. + <_> + + <_> + 7 6 10 6 -1. + <_> + 12 6 5 3 2. + <_> + 7 9 5 3 2. + <_> + + <_> + 3 11 9 5 -1. + <_> + 6 11 3 5 3. + <_> + + <_> + 2 1 18 16 -1. + <_> + 8 1 6 16 3. + <_> + + <_> + 0 1 18 16 -1. + <_> + 6 1 6 16 3. + <_> + + <_> + 6 12 9 5 -1. + <_> + 9 12 3 5 3. + <_> + + <_> + 2 10 16 10 -1. + <_> + 2 10 8 5 2. + <_> + 10 15 8 5 2. + <_> + + <_> + 12 0 4 14 -1. + <_> + 14 0 2 7 2. + <_> + 12 7 2 7 2. + <_> + + <_> + 4 0 4 14 -1. + <_> + 4 0 2 7 2. + <_> + 6 7 2 7 2. + <_> + + <_> + 12 7 4 9 -1. + <_> + 12 7 2 9 2. + <_> + + <_> + 4 7 4 9 -1. + <_> + 6 7 2 9 2. + <_> + + <_> + 16 0 2 20 -1. + <_> + 16 0 1 20 2. + <_> + + <_> + 2 0 2 20 -1. + <_> + 3 0 1 20 2. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 5 1 2 14 -1. + <_> + 5 8 2 7 2. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 0 13 18 3 -1. + <_> + 6 13 6 3 3. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 0 6 20 2 -1. + <_> + 0 6 10 2 2. + <_> + + <_> + 3 14 9 6 -1. + <_> + 6 14 3 6 3. + <_> + + <_> + 5 2 9 6 -1. + <_> + 5 5 9 3 2. + <_> + + <_> + 10 3 10 3 -1. + <_> + 10 3 5 3 2. + <_> + + <_> + 0 3 8 4 -1. + <_> + 4 3 4 4 2. + <_> + + <_> + 10 10 7 4 -1. + <_> + 10 12 7 2 2. + <_> + + <_> + 6 2 4 7 -1. + <_> + 8 2 2 7 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 6 6 4 12 -1. + <_> + 6 10 4 4 3. + <_> + + <_> + 14 1 6 8 -1. + <_> + 16 1 2 8 3. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 9 0 3 18 -1. + <_> + 9 6 3 6 3. + <_> + + <_> + 0 1 6 8 -1. + <_> + 2 1 2 8 3. + <_> + + <_> + 9 5 10 6 -1. + <_> + 14 5 5 3 2. + <_> + 9 8 5 3 2. + <_> + + <_> + 0 14 14 3 -1. + <_> + 0 15 14 1 3. + <_> + + <_> + 10 10 7 6 -1. + <_> + 10 12 7 2 3. + <_> + + <_> + 3 10 14 4 -1. + <_> + 3 10 7 2 2. + <_> + 10 12 7 2 2. + <_> + + <_> + 3 8 17 2 -1. + <_> + 3 9 17 1 2. + <_> + + <_> + 0 5 14 12 -1. + <_> + 0 11 14 6 2. + <_> + + <_> + 3 7 14 6 -1. + <_> + 3 9 14 2 3. + <_> + + <_> + 7 1 6 7 -1. + <_> + 9 1 2 7 3. + <_> + + <_> + 4 18 13 2 -1. + <_> + 4 19 13 1 2. + <_> + + <_> + 1 6 14 2 -1. + <_> + 8 6 7 2 2. + <_> + + <_> + 2 5 18 15 -1. + <_> + 8 5 6 15 3. + <_> + + <_> + 5 6 6 14 -1. + <_> + 8 6 3 14 2. + <_> + + <_> + 8 5 8 8 -1. + <_> + 12 5 4 4 2. + <_> + 8 9 4 4 2. + <_> + + <_> + 5 1 6 5 -1. + <_> + 8 1 3 5 2. + <_> + + <_> + 6 5 10 12 -1. + <_> + 11 5 5 6 2. + <_> + 6 11 5 6 2. + <_> + + <_> + 3 5 12 14 -1. + <_> + 3 5 6 7 2. + <_> + 9 12 6 7 2. + <_> + + <_> + 7 0 13 3 -1. + <_> + 7 1 13 1 3. + <_> + + <_> + 5 7 9 12 -1. + <_> + 5 11 9 4 3. + <_> + + <_> + 11 6 4 14 -1. + <_> + 13 6 2 7 2. + <_> + 11 13 2 7 2. + <_> + + <_> + 5 6 4 14 -1. + <_> + 5 6 2 7 2. + <_> + 7 13 2 7 2. + <_> + + <_> + 3 1 17 2 -1. + <_> + 3 2 17 1 2. + <_> + + <_> + 7 4 6 16 -1. + <_> + 7 12 6 8 2. + <_> + + <_> + 8 6 4 7 -1. + <_> + 8 6 2 7 2. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 2 5 18 15 -1. + <_> + 8 5 6 15 3. + <_> + + <_> + 0 5 18 15 -1. + <_> + 6 5 6 15 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 2 0 12 19 -1. + <_> + 6 0 4 19 3. + <_> + + <_> + 9 12 11 4 -1. + <_> + 9 14 11 2 2. + <_> + + <_> + 0 4 20 6 -1. + <_> + 0 6 20 2 3. + <_> + + <_> + 5 3 10 4 -1. + <_> + 5 5 10 2 2. + <_> + + <_> + 1 6 12 4 -1. + <_> + 5 6 4 4 3. + <_> + + <_> + 6 8 14 3 -1. + <_> + 6 9 14 1 3. + <_> + + <_> + 0 8 14 3 -1. + <_> + 0 9 14 1 3. + <_> + + <_> + 5 3 13 6 -1. + <_> + 5 6 13 3 2. + <_> + + <_> + 0 12 11 4 -1. + <_> + 0 14 11 2 2. + <_> + + <_> + 5 12 13 3 -1. + <_> + 5 13 13 1 3. + <_> + + <_> + 0 2 20 4 -1. + <_> + 0 2 10 2 2. + <_> + 10 4 10 2 2. + <_> + + <_> + 14 1 6 5 -1. + <_> + 14 1 3 5 2. + <_> + + <_> + 4 11 5 6 -1. + <_> + 4 14 5 3 2. + <_> + + <_> + 6 1 10 18 -1. + <_> + 6 10 10 9 2. + <_> + + <_> + 0 8 6 12 -1. + <_> + 0 8 3 6 2. + <_> + 3 14 3 6 2. + <_> + + <_> + 9 9 10 6 -1. + <_> + 14 9 5 3 2. + <_> + 9 12 5 3 2. + <_> + + <_> + 1 9 10 6 -1. + <_> + 1 9 5 3 2. + <_> + 6 12 5 3 2. + <_> + + <_> + 15 0 3 13 -1. + <_> + 16 0 1 13 3. + <_> + + <_> + 2 0 3 13 -1. + <_> + 3 0 1 13 3. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 17 3 3 13 -1. + <_> + 18 3 1 13 3. + <_> + + <_> + 0 3 3 13 -1. + <_> + 1 3 1 13 3. + <_> + + <_> + 13 4 6 16 -1. + <_> + 16 4 3 8 2. + <_> + 13 12 3 8 2. + <_> + + <_> + 3 2 3 14 -1. + <_> + 4 2 1 14 3. + <_> + + <_> + 16 1 3 13 -1. + <_> + 17 1 1 13 3. + <_> + + <_> + 1 1 3 13 -1. + <_> + 2 1 1 13 3. + <_> + + <_> + 8 6 9 9 -1. + <_> + 8 9 9 3 3. + <_> + + <_> + 0 2 14 2 -1. + <_> + 0 3 14 1 2. + <_> + + <_> + 12 5 6 6 -1. + <_> + 12 5 3 6 2. + <_> + + <_> + 2 5 6 6 -1. + <_> + 5 5 3 6 2. + <_> + + <_> + 10 1 9 6 -1. + <_> + 10 3 9 2 3. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 7 10 6 10 -1. + <_> + 9 10 2 10 3. + <_> + + <_> + 0 0 2 20 -1. + <_> + 1 0 1 20 2. + <_> + + <_> + 16 5 4 14 -1. + <_> + 16 5 2 14 2. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 16 5 4 14 -1. + <_> + 16 5 2 14 2. + <_> + + <_> + 0 5 4 14 -1. + <_> + 2 5 2 14 2. + <_> + + <_> + 0 11 20 4 -1. + <_> + 10 11 10 2 2. + <_> + 0 13 10 2 2. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 6 9 9 5 -1. + <_> + 9 9 3 5 3. + <_> + + <_> + 9 0 2 13 -1. + <_> + 10 0 1 13 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 10 1 9 6 -1. + <_> + 10 3 9 2 3. + <_> + + <_> + 1 1 9 6 -1. + <_> + 1 3 9 2 3. + <_> + + <_> + 11 0 5 8 -1. + <_> + 11 4 5 4 2. + <_> + + <_> + 0 17 18 3 -1. + <_> + 0 18 18 1 3. + <_> + + <_> + 9 2 6 11 -1. + <_> + 11 2 2 11 3. + <_> + + <_> + 5 2 6 11 -1. + <_> + 7 2 2 11 3. + <_> + + <_> + 7 1 6 10 -1. + <_> + 10 1 3 5 2. + <_> + 7 6 3 5 2. + <_> + + <_> + 3 2 10 5 -1. + <_> + 8 2 5 5 2. + <_> + + <_> + 2 17 17 3 -1. + <_> + 2 18 17 1 3. + <_> + + <_> + 0 13 14 3 -1. + <_> + 0 14 14 1 3. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 7 10 4 10 -1. + <_> + 7 15 4 5 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 2 12 16 6 -1. + <_> + 2 14 16 2 3. + <_> + + <_> + 5 9 13 3 -1. + <_> + 5 10 13 1 3. + <_> + + <_> + 8 5 4 12 -1. + <_> + 8 9 4 4 3. + <_> + + <_> + 6 1 14 6 -1. + <_> + 13 1 7 3 2. + <_> + 6 4 7 3 2. + <_> + + <_> + 3 1 12 6 -1. + <_> + 3 3 12 2 3. + <_> + + <_> + 9 5 11 6 -1. + <_> + 9 7 11 2 3. + <_> + + <_> + 5 2 3 13 -1. + <_> + 6 2 1 13 3. + <_> + + <_> + 15 5 4 14 -1. + <_> + 17 5 2 7 2. + <_> + 15 12 2 7 2. + <_> + + <_> + 0 14 7 6 -1. + <_> + 0 16 7 2 3. + <_> + + <_> + 5 15 13 3 -1. + <_> + 5 16 13 1 3. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 10 4 4 2. + <_> + 10 14 4 4 2. + <_> + + <_> + 3 10 14 6 -1. + <_> + 10 10 7 3 2. + <_> + 3 13 7 3 2. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 5 14 15 3 -1. + <_> + 5 15 15 1 3. + <_> + + <_> + 0 1 14 6 -1. + <_> + 0 1 7 3 2. + <_> + 7 4 7 3 2. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 0 0 8 8 -1. + <_> + 0 0 4 4 2. + <_> + 4 4 4 4 2. + <_> + + <_> + 3 16 14 4 -1. + <_> + 10 16 7 2 2. + <_> + 3 18 7 2 2. + <_> + + <_> + 0 1 6 10 -1. + <_> + 0 1 3 5 2. + <_> + 3 6 3 5 2. + <_> + + <_> + 10 3 8 8 -1. + <_> + 14 3 4 4 2. + <_> + 10 7 4 4 2. + <_> + + <_> + 1 5 10 6 -1. + <_> + 1 5 5 3 2. + <_> + 6 8 5 3 2. + <_> + + <_> + 14 2 2 14 -1. + <_> + 14 9 2 7 2. + <_> + + <_> + 4 2 2 14 -1. + <_> + 4 9 2 7 2. + <_> + + <_> + 4 8 12 4 -1. + <_> + 4 10 12 2 2. + <_> + + <_> + 2 3 8 8 -1. + <_> + 2 3 4 4 2. + <_> + 6 7 4 4 2. + <_> + + <_> + 17 0 2 16 -1. + <_> + 17 8 2 8 2. + <_> + + <_> + 1 5 4 14 -1. + <_> + 1 5 2 7 2. + <_> + 3 12 2 7 2. + <_> + + <_> + 8 6 5 10 -1. + <_> + 8 11 5 5 2. + <_> + + <_> + 4 2 8 10 -1. + <_> + 4 2 4 5 2. + <_> + 8 7 4 5 2. + <_> + + <_> + 8 5 10 8 -1. + <_> + 13 5 5 4 2. + <_> + 8 9 5 4 2. + <_> + + <_> + 0 7 7 6 -1. + <_> + 0 9 7 2 3. + <_> + + <_> + 16 1 4 7 -1. + <_> + 16 1 2 7 2. + <_> + + <_> + 1 0 2 16 -1. + <_> + 1 8 2 8 2. + <_> + + <_> + 15 3 5 6 -1. + <_> + 15 6 5 3 2. + <_> + + <_> + 0 0 20 12 -1. + <_> + 0 6 20 6 2. + <_> + + <_> + 15 3 5 6 -1. + <_> + 15 6 5 3 2. + <_> + + <_> + 0 3 5 6 -1. + <_> + 0 6 5 3 2. + <_> + + <_> + 9 10 7 4 -1. + <_> + 9 12 7 2 2. + <_> + + <_> + 2 9 13 6 -1. + <_> + 2 12 13 3 2. + <_> + + <_> + 2 2 16 14 -1. + <_> + 2 9 16 7 2. + <_> + + <_> + 4 5 10 8 -1. + <_> + 4 9 10 4 2. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 8 0 3 15 -1. + <_> + 8 5 3 5 3. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 0 0 3 13 -1. + <_> + 1 0 1 13 3. + <_> + + <_> + 1 14 18 4 -1. + <_> + 10 14 9 2 2. + <_> + 1 16 9 2 2. + <_> + + <_> + 1 8 6 5 -1. + <_> + 4 8 3 5 2. + <_> + + <_> + 13 1 6 19 -1. + <_> + 13 1 3 19 2. + <_> + + <_> + 1 1 6 19 -1. + <_> + 4 1 3 19 2. + <_> + + <_> + 6 0 14 3 -1. + <_> + 6 1 14 1 3. + <_> + + <_> + 0 0 14 3 -1. + <_> + 0 1 14 1 3. + <_> + + <_> + 8 2 7 6 -1. + <_> + 8 5 7 3 2. + <_> + + <_> + 0 3 9 14 -1. + <_> + 3 3 3 14 3. + <_> + + <_> + 10 8 9 6 -1. + <_> + 10 10 9 2 3. + <_> + + <_> + 0 1 16 4 -1. + <_> + 0 1 8 2 2. + <_> + 8 3 8 2 2. + <_> + + <_> + 16 2 4 7 -1. + <_> + 16 2 2 7 2. + <_> + + <_> + 0 8 10 6 -1. + <_> + 0 10 10 2 3. + <_> + + <_> + 16 2 4 7 -1. + <_> + 16 2 2 7 2. + <_> + + <_> + 0 2 4 7 -1. + <_> + 2 2 2 7 2. + <_> + + <_> + 5 3 12 14 -1. + <_> + 11 3 6 7 2. + <_> + 5 10 6 7 2. + <_> + + <_> + 7 6 3 10 -1. + <_> + 7 11 3 5 2. + <_> + + <_> + 14 2 6 9 -1. + <_> + 16 2 2 9 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 2 2 2 9 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 4 5 12 6 -1. + <_> + 4 5 6 3 2. + <_> + 10 8 6 3 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 7 5 6 8 -1. + <_> + 9 5 2 8 3. + <_> + + <_> + 4 6 12 6 -1. + <_> + 8 6 4 6 3. + <_> + + <_> + 1 4 4 14 -1. + <_> + 1 4 2 7 2. + <_> + 3 11 2 7 2. + <_> + + <_> + 0 1 20 6 -1. + <_> + 10 1 10 3 2. + <_> + 0 4 10 3 2. + <_> + + <_> + 5 2 10 6 -1. + <_> + 5 4 10 2 3. + <_> + + <_> + 0 2 20 6 -1. + <_> + 0 5 20 3 2. + <_> + + <_> + 3 10 6 8 -1. + <_> + 5 10 2 8 3. + <_> + + <_> + 13 4 4 16 -1. + <_> + 15 4 2 8 2. + <_> + 13 12 2 8 2. + <_> + + <_> + 6 2 2 18 -1. + <_> + 6 11 2 9 2. + <_> + + <_> + 13 4 4 16 -1. + <_> + 15 4 2 8 2. + <_> + 13 12 2 8 2. + <_> + + <_> + 3 4 4 16 -1. + <_> + 3 4 2 8 2. + <_> + 5 12 2 8 2. + <_> + + <_> + 6 15 9 4 -1. + <_> + 6 17 9 2 2. + <_> + + <_> + 4 2 6 7 -1. + <_> + 6 2 2 7 3. + <_> + + <_> + 8 0 4 12 -1. + <_> + 8 0 2 12 2. + <_> + + <_> + 0 6 20 2 -1. + <_> + 10 6 10 2 2. + <_> + + <_> + 14 2 6 18 -1. + <_> + 17 2 3 9 2. + <_> + 14 11 3 9 2. + <_> + + <_> + 0 7 14 4 -1. + <_> + 0 7 7 2 2. + <_> + 7 9 7 2 2. + <_> + + <_> + 8 5 10 8 -1. + <_> + 13 5 5 4 2. + <_> + 8 9 5 4 2. + <_> + + <_> + 2 5 10 8 -1. + <_> + 2 5 5 4 2. + <_> + 7 9 5 4 2. + <_> + + <_> + 4 2 16 12 -1. + <_> + 4 2 8 12 2. + <_> + + <_> + 0 2 16 12 -1. + <_> + 8 2 8 12 2. + <_> + + <_> + 11 2 4 7 -1. + <_> + 11 2 2 7 2. + <_> + + <_> + 5 2 4 7 -1. + <_> + 7 2 2 7 2. + <_> + + <_> + 6 5 8 4 -1. + <_> + 6 5 4 4 2. + <_> + + <_> + 4 5 6 10 -1. + <_> + 6 5 2 10 3. + <_> + + <_> + 6 10 10 8 -1. + <_> + 11 10 5 4 2. + <_> + 6 14 5 4 2. + <_> + + <_> + 2 11 6 9 -1. + <_> + 4 11 2 9 3. + <_> + + <_> + 4 0 12 18 -1. + <_> + 4 0 6 18 2. + <_> + + <_> + 4 1 9 17 -1. + <_> + 7 1 3 17 3. + <_> + + <_> + 9 5 6 8 -1. + <_> + 11 5 2 8 3. + <_> + + <_> + 6 3 6 7 -1. + <_> + 8 3 2 7 3. + <_> + + <_> + 3 8 14 3 -1. + <_> + 3 9 14 1 3. + <_> + + <_> + 5 5 6 9 -1. + <_> + 5 8 6 3 3. + <_> + + <_> + 10 10 7 6 -1. + <_> + 10 12 7 2 3. + <_> + + <_> + 4 6 7 4 -1. + <_> + 4 8 7 2 2. + <_> + + <_> + 6 10 10 8 -1. + <_> + 11 10 5 4 2. + <_> + 6 14 5 4 2. + <_> + + <_> + 4 10 12 4 -1. + <_> + 8 10 4 4 3. + <_> + + <_> + 5 7 14 4 -1. + <_> + 12 7 7 2 2. + <_> + 5 9 7 2 2. + <_> + + <_> + 4 10 12 7 -1. + <_> + 8 10 4 7 3. + <_> + + <_> + 5 2 12 16 -1. + <_> + 11 2 6 8 2. + <_> + 5 10 6 8 2. + <_> + + <_> + 1 7 14 4 -1. + <_> + 1 7 7 2 2. + <_> + 8 9 7 2 2. + <_> + + <_> + 3 5 15 14 -1. + <_> + 3 12 15 7 2. + <_> + + <_> + 0 11 7 4 -1. + <_> + 0 13 7 2 2. + <_> + + <_> + 8 6 9 9 -1. + <_> + 8 9 9 3 3. + <_> + + <_> + 5 6 6 10 -1. + <_> + 7 6 2 10 3. + <_> + + <_> + 11 4 4 11 -1. + <_> + 11 4 2 11 2. + <_> + + <_> + 1 12 14 8 -1. + <_> + 8 12 7 8 2. + <_> + + <_> + 11 4 4 11 -1. + <_> + 11 4 2 11 2. + <_> + + <_> + 5 0 4 15 -1. + <_> + 7 0 2 15 2. + <_> + + <_> + 4 2 12 6 -1. + <_> + 8 2 4 6 3. + <_> + + <_> + 3 3 12 14 -1. + <_> + 3 3 6 7 2. + <_> + 9 10 6 7 2. + <_> + + <_> + 9 2 4 7 -1. + <_> + 9 2 2 7 2. + <_> + + <_> + 7 2 4 7 -1. + <_> + 9 2 2 7 2. + <_> + + <_> + 15 9 5 9 -1. + <_> + 15 12 5 3 3. + <_> + + <_> + 0 9 5 9 -1. + <_> + 0 12 5 3 3. + <_> + + <_> + 8 3 4 9 -1. + <_> + 8 3 2 9 2. + <_> + + <_> + 7 8 6 6 -1. + <_> + 10 8 3 6 2. + <_> + + <_> + 6 13 14 3 -1. + <_> + 6 14 14 1 3. + <_> + + <_> + 2 12 12 8 -1. + <_> + 6 12 4 8 3. + <_> + + <_> + 5 14 15 6 -1. + <_> + 10 14 5 6 3. + <_> + + <_> + 6 8 6 12 -1. + <_> + 6 8 3 6 2. + <_> + 9 14 3 6 2. + <_> + + <_> + 5 14 15 6 -1. + <_> + 10 14 5 6 3. + <_> + + <_> + 6 0 8 20 -1. + <_> + 6 10 8 10 2. + <_> + + <_> + 10 3 4 13 -1. + <_> + 10 3 2 13 2. + <_> + + <_> + 4 12 12 6 -1. + <_> + 8 12 4 6 3. + <_> + + <_> + 10 3 4 13 -1. + <_> + 10 3 2 13 2. + <_> + + <_> + 5 11 9 6 -1. + <_> + 8 11 3 6 3. + <_> + + <_> + 8 13 6 7 -1. + <_> + 10 13 2 7 3. + <_> + + <_> + 0 0 8 8 -1. + <_> + 0 0 4 4 2. + <_> + 4 4 4 4 2. + <_> + + <_> + 10 10 7 6 -1. + <_> + 10 12 7 2 3. + <_> + + <_> + 3 10 7 6 -1. + <_> + 3 12 7 2 3. + <_> + + <_> + 12 3 5 12 -1. + <_> + 12 7 5 4 3. + <_> + + <_> + 4 13 9 4 -1. + <_> + 4 15 9 2 2. + <_> + + <_> + 6 13 14 3 -1. + <_> + 6 14 14 1 3. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 12 0 3 19 -1. + <_> + 13 0 1 19 3. + <_> + + <_> + 6 3 4 13 -1. + <_> + 8 3 2 13 2. + <_> + + <_> + 10 0 9 5 -1. + <_> + 13 0 3 5 3. + <_> + + <_> + 1 0 9 5 -1. + <_> + 4 0 3 5 3. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 6 11 6 9 -1. + <_> + 8 11 2 9 3. + <_> + + <_> + 12 3 5 12 -1. + <_> + 12 7 5 4 3. + <_> + + <_> + 3 3 5 12 -1. + <_> + 3 7 5 4 3. + <_> + + <_> + 10 11 6 9 -1. + <_> + 10 14 6 3 3. + <_> + + <_> + 4 16 12 4 -1. + <_> + 4 18 12 2 2. + <_> + + <_> + 2 14 18 4 -1. + <_> + 11 14 9 2 2. + <_> + 2 16 9 2 2. + <_> + + <_> + 6 16 7 4 -1. + <_> + 6 18 7 2 2. + <_> + + <_> + 5 10 12 8 -1. + <_> + 5 14 12 4 2. + <_> + + <_> + 4 10 7 4 -1. + <_> + 4 12 7 2 2. + <_> + + <_> + 8 9 7 4 -1. + <_> + 8 11 7 2 2. + <_> + + <_> + 0 10 18 6 -1. + <_> + 9 10 9 6 2. + <_> + + <_> + 0 6 20 2 -1. + <_> + 0 6 10 2 2. + <_> + + <_> + 6 5 6 8 -1. + <_> + 8 5 2 8 3. + <_> + + <_> + 12 0 3 13 -1. + <_> + 13 0 1 13 3. + <_> + + <_> + 8 10 3 10 -1. + <_> + 8 15 3 5 2. + <_> + + <_> + 8 1 8 14 -1. + <_> + 12 1 4 7 2. + <_> + 8 8 4 7 2. + <_> + + <_> + 5 0 3 19 -1. + <_> + 6 0 1 19 3. + <_> + + <_> + 9 10 6 10 -1. + <_> + 12 10 3 5 2. + <_> + 9 15 3 5 2. + <_> + + <_> + 0 6 5 14 -1. + <_> + 0 13 5 7 2. + <_> + + <_> + 18 5 2 14 -1. + <_> + 18 12 2 7 2. + <_> + + <_> + 0 5 2 14 -1. + <_> + 0 12 2 7 2. + <_> + + <_> + 13 0 4 10 -1. + <_> + 13 5 4 5 2. + <_> + + <_> + 1 0 18 18 -1. + <_> + 1 9 18 9 2. + <_> + + <_> + 1 16 18 4 -1. + <_> + 10 16 9 2 2. + <_> + 1 18 9 2 2. + <_> + + <_> + 5 1 8 6 -1. + <_> + 5 3 8 2 3. + <_> + + <_> + 4 7 13 9 -1. + <_> + 4 10 13 3 3. + <_> + + <_> + 5 5 10 10 -1. + <_> + 5 5 5 5 2. + <_> + 10 10 5 5 2. + <_> + + <_> + 8 4 8 10 -1. + <_> + 12 4 4 5 2. + <_> + 8 9 4 5 2. + <_> + + <_> + 3 7 14 4 -1. + <_> + 3 7 7 2 2. + <_> + 10 9 7 2 2. + <_> + + <_> + 16 2 4 18 -1. + <_> + 18 2 2 9 2. + <_> + 16 11 2 9 2. + <_> + + <_> + 1 0 13 2 -1. + <_> + 1 1 13 1 2. + <_> + + <_> + 6 2 14 3 -1. + <_> + 6 3 14 1 3. + <_> + + <_> + 0 0 13 3 -1. + <_> + 0 1 13 1 3. + <_> + + <_> + 4 1 12 6 -1. + <_> + 4 4 12 3 2. + <_> + + <_> + 0 3 7 6 -1. + <_> + 0 5 7 2 3. + <_> + + <_> + 2 5 16 6 -1. + <_> + 10 5 8 3 2. + <_> + 2 8 8 3 2. + <_> + + <_> + 2 10 14 4 -1. + <_> + 2 10 7 2 2. + <_> + 9 12 7 2 2. + <_> + + <_> + 16 2 4 18 -1. + <_> + 18 2 2 9 2. + <_> + 16 11 2 9 2. + <_> + + <_> + 6 2 4 15 -1. + <_> + 6 7 4 5 3. + <_> + + <_> + 10 5 7 6 -1. + <_> + 10 7 7 2 3. + <_> + + <_> + 4 0 4 14 -1. + <_> + 4 0 2 7 2. + <_> + 6 7 2 7 2. + <_> + + <_> + 6 3 10 6 -1. + <_> + 11 3 5 3 2. + <_> + 6 6 5 3 2. + <_> + + <_> + 4 3 10 6 -1. + <_> + 4 3 5 3 2. + <_> + 9 6 5 3 2. + <_> + + <_> + 4 4 13 12 -1. + <_> + 4 8 13 4 3. + <_> + + <_> + 3 9 6 7 -1. + <_> + 5 9 2 7 3. + <_> + + <_> + 11 11 4 9 -1. + <_> + 11 11 2 9 2. + <_> + + <_> + 1 0 3 13 -1. + <_> + 2 0 1 13 3. + <_> + + <_> + 11 11 4 9 -1. + <_> + 11 11 2 9 2. + <_> + + <_> + 5 12 4 8 -1. + <_> + 7 12 2 8 2. + <_> + + <_> + 5 14 15 6 -1. + <_> + 10 14 5 6 3. + <_> + + <_> + 0 14 15 6 -1. + <_> + 5 14 5 6 3. + <_> + + <_> + 6 8 12 4 -1. + <_> + 10 8 4 4 3. + <_> + + <_> + 2 8 12 4 -1. + <_> + 6 8 4 4 3. + <_> + + <_> + 13 6 4 10 -1. + <_> + 13 6 2 10 2. + <_> + + <_> + 8 6 4 7 -1. + <_> + 10 6 2 7 2. + <_> + + <_> + 5 1 12 5 -1. + <_> + 9 1 4 5 3. + <_> + + <_> + 2 2 15 4 -1. + <_> + 7 2 5 4 3. + <_> + + <_> + 6 12 13 2 -1. + <_> + 6 13 13 1 2. + <_> + + <_> + 3 11 13 3 -1. + <_> + 3 12 13 1 3. + <_> + + <_> + 10 10 9 6 -1. + <_> + 10 12 9 2 3. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 0 2 20 2 -1. + <_> + 0 3 20 1 2. + <_> + + <_> + 3 5 4 11 -1. + <_> + 5 5 2 11 2. + <_> + + <_> + 13 1 3 17 -1. + <_> + 14 1 1 17 3. + <_> + + <_> + 0 0 18 9 -1. + <_> + 6 0 6 9 3. + <_> + + <_> + 6 9 9 6 -1. + <_> + 9 9 3 6 3. + <_> + + <_> + 2 9 7 6 -1. + <_> + 2 11 7 2 3. + <_> + + <_> + 13 1 3 17 -1. + <_> + 14 1 1 17 3. + <_> + + <_> + 4 1 3 17 -1. + <_> + 5 1 1 17 3. + <_> + + <_> + 2 0 18 6 -1. + <_> + 8 0 6 6 3. + <_> + + <_> + 7 2 4 12 -1. + <_> + 7 6 4 4 3. + <_> + + <_> + 10 2 5 9 -1. + <_> + 10 5 5 3 3. + <_> + + <_> + 5 2 5 9 -1. + <_> + 5 5 5 3 3. + <_> + + <_> + 9 0 3 18 -1. + <_> + 9 6 3 6 3. + <_> + + <_> + 6 12 7 4 -1. + <_> + 6 14 7 2 2. + <_> + + <_> + 16 10 4 9 -1. + <_> + 16 10 2 9 2. + <_> + + <_> + 0 10 4 9 -1. + <_> + 2 10 2 9 2. + <_> + + <_> + 13 2 6 18 -1. + <_> + 16 2 3 9 2. + <_> + 13 11 3 9 2. + <_> + + <_> + 0 0 7 6 -1. + <_> + 0 2 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 2 3 5 12 -1. + <_> + 2 7 5 4 3. + <_> + + <_> + 3 15 14 4 -1. + <_> + 3 17 14 2 2. + <_> + + <_> + 3 0 13 6 -1. + <_> + 3 3 13 3 2. + <_> + + <_> + 4 11 16 9 -1. + <_> + 4 11 8 9 2. + <_> + + <_> + 0 11 16 9 -1. + <_> + 8 11 8 9 2. + <_> + + <_> + 11 0 5 8 -1. + <_> + 11 4 5 4 2. + <_> + + <_> + 0 3 14 9 -1. + <_> + 0 6 14 3 3. + <_> + + <_> + 5 0 10 10 -1. + <_> + 10 0 5 5 2. + <_> + 5 5 5 5 2. + <_> + + <_> + 0 2 6 18 -1. + <_> + 0 2 3 9 2. + <_> + 3 11 3 9 2. + <_> + + <_> + 9 5 3 15 -1. + <_> + 9 10 3 5 3. + <_> + + <_> + 0 7 13 2 -1. + <_> + 0 8 13 1 2. + <_> + + <_> + 11 1 5 9 -1. + <_> + 11 4 5 3 3. + <_> + + <_> + 2 1 14 6 -1. + <_> + 2 1 7 3 2. + <_> + 9 4 7 3 2. + <_> + + <_> + 9 0 6 12 -1. + <_> + 12 0 3 6 2. + <_> + 9 6 3 6 2. + <_> + + <_> + 5 0 6 12 -1. + <_> + 5 0 3 6 2. + <_> + 8 6 3 6 2. + <_> + + <_> + 6 9 9 6 -1. + <_> + 9 9 3 6 3. + <_> + + <_> + 5 9 9 6 -1. + <_> + 8 9 3 6 3. + <_> + + <_> + 8 3 10 11 -1. + <_> + 8 3 5 11 2. + <_> + + <_> + 2 3 10 11 -1. + <_> + 7 3 5 11 2. + <_> + + <_> + 8 2 12 18 -1. + <_> + 8 2 6 18 2. + <_> + + <_> + 0 1 12 19 -1. + <_> + 6 1 6 19 2. + <_> + + <_> + 10 11 5 9 -1. + <_> + 10 14 5 3 3. + <_> + + <_> + 3 15 14 4 -1. + <_> + 3 15 7 2 2. + <_> + 10 17 7 2 2. + <_> + + <_> + 4 14 16 6 -1. + <_> + 4 14 8 6 2. + <_> + + <_> + 5 11 9 6 -1. + <_> + 8 11 3 6 3. + <_> + + <_> + 13 4 4 14 -1. + <_> + 15 4 2 7 2. + <_> + 13 11 2 7 2. + <_> + + <_> + 1 3 6 9 -1. + <_> + 3 3 2 9 3. + <_> + + <_> + 10 7 6 7 -1. + <_> + 12 7 2 7 3. + <_> + + <_> + 0 2 10 3 -1. + <_> + 5 2 5 3 2. + <_> + + <_> + 12 6 5 9 -1. + <_> + 12 9 5 3 3. + <_> + + <_> + 3 12 8 8 -1. + <_> + 3 12 4 4 2. + <_> + 7 16 4 4 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 2 0 16 2 -1. + <_> + 2 1 16 1 2. + <_> + + <_> + 13 7 7 6 -1. + <_> + 13 9 7 2 3. + <_> + + <_> + 0 7 7 6 -1. + <_> + 0 9 7 2 3. + <_> + + <_> + 9 6 5 8 -1. + <_> + 9 10 5 4 2. + <_> + + <_> + 7 5 6 12 -1. + <_> + 7 11 6 6 2. + <_> + + <_> + 13 4 4 14 -1. + <_> + 15 4 2 7 2. + <_> + 13 11 2 7 2. + <_> + + <_> + 3 4 4 14 -1. + <_> + 3 4 2 7 2. + <_> + 5 11 2 7 2. + <_> + + <_> + 3 3 14 2 -1. + <_> + 3 4 14 1 2. + <_> + + <_> + 7 1 6 10 -1. + <_> + 7 6 6 5 2. + <_> + + <_> + 10 4 10 12 -1. + <_> + 10 10 10 6 2. + <_> + + <_> + 4 2 9 5 -1. + <_> + 7 2 3 5 3. + <_> + + <_> + 4 4 16 10 -1. + <_> + 12 4 8 5 2. + <_> + 4 9 8 5 2. + <_> + + <_> + 0 4 16 10 -1. + <_> + 0 4 8 5 2. + <_> + 8 9 8 5 2. + <_> + + <_> + 11 8 4 12 -1. + <_> + 11 8 2 12 2. + <_> + + <_> + 5 8 4 12 -1. + <_> + 7 8 2 12 2. + <_> + + <_> + 5 10 13 3 -1. + <_> + 5 11 13 1 3. + <_> + + <_> + 0 7 10 13 -1. + <_> + 5 7 5 13 2. + <_> + + <_> + 13 13 7 4 -1. + <_> + 13 15 7 2 2. + <_> + + <_> + 0 9 9 8 -1. + <_> + 3 9 3 8 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 12 13 2 -1. + <_> + 0 13 13 1 2. + <_> + + <_> + 8 5 8 4 -1. + <_> + 8 5 4 4 2. + <_> + + <_> + 4 5 8 4 -1. + <_> + 8 5 4 4 2. + <_> + + <_> + 13 0 3 13 -1. + <_> + 14 0 1 13 3. + <_> + + <_> + 4 9 4 8 -1. + <_> + 4 13 4 4 2. + <_> + + <_> + 10 4 8 4 -1. + <_> + 10 6 8 2 2. + <_> + + <_> + 0 0 4 8 -1. + <_> + 2 0 2 8 2. + <_> + + <_> + 3 2 14 4 -1. + <_> + 3 2 7 4 2. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 10 0 9 9 -1. + <_> + 13 0 3 9 3. + <_> + + <_> + 1 0 9 9 -1. + <_> + 4 0 3 9 3. + <_> + + <_> + 16 6 4 14 -1. + <_> + 18 6 2 7 2. + <_> + 16 13 2 7 2. + <_> + + <_> + 0 9 18 3 -1. + <_> + 6 9 6 3 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 5 4 10 5 -1. + <_> + 10 4 5 5 2. + <_> + + <_> + 5 1 14 4 -1. + <_> + 12 1 7 2 2. + <_> + 5 3 7 2 2. + <_> + + <_> + 1 1 14 4 -1. + <_> + 1 1 7 2 2. + <_> + 8 3 7 2 2. + <_> + + <_> + 16 6 4 14 -1. + <_> + 18 6 2 7 2. + <_> + 16 13 2 7 2. + <_> + + <_> + 0 6 4 14 -1. + <_> + 0 6 2 7 2. + <_> + 2 13 2 7 2. + <_> + + <_> + 12 11 5 9 -1. + <_> + 12 14 5 3 3. + <_> + + <_> + 5 9 10 9 -1. + <_> + 5 12 10 3 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 4 0 8 9 -1. + <_> + 8 0 4 9 2. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 1 13 5 6 -1. + <_> + 1 16 5 3 2. + <_> + + <_> + 11 15 7 4 -1. + <_> + 11 17 7 2 2. + <_> + + <_> + 3 13 13 3 -1. + <_> + 3 14 13 1 3. + <_> + + <_> + 7 7 7 8 -1. + <_> + 7 11 7 4 2. + <_> + + <_> + 2 4 3 10 -1. + <_> + 2 9 3 5 2. + <_> + + <_> + 7 2 13 2 -1. + <_> + 7 3 13 1 2. + <_> + + <_> + 2 15 7 4 -1. + <_> + 2 17 7 2 2. + <_> + + <_> + 14 1 6 10 -1. + <_> + 17 1 3 5 2. + <_> + 14 6 3 5 2. + <_> + + <_> + 0 1 6 10 -1. + <_> + 0 1 3 5 2. + <_> + 3 6 3 5 2. + <_> + + <_> + 8 0 8 8 -1. + <_> + 12 0 4 4 2. + <_> + 8 4 4 4 2. + <_> + + <_> + 6 8 4 9 -1. + <_> + 8 8 2 9 2. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 7 1 4 12 -1. + <_> + 9 1 2 12 2. + <_> + + <_> + 10 0 6 8 -1. + <_> + 12 0 2 8 3. + <_> + + <_> + 4 0 6 8 -1. + <_> + 6 0 2 8 3. + <_> + + <_> + 10 0 4 18 -1. + <_> + 10 6 4 6 3. + <_> + + <_> + 0 5 7 12 -1. + <_> + 0 9 7 4 3. + <_> + + <_> + 11 5 5 9 -1. + <_> + 11 8 5 3 3. + <_> + + <_> + 3 9 14 4 -1. + <_> + 3 9 7 2 2. + <_> + 10 11 7 2 2. + <_> + + <_> + 3 7 17 3 -1. + <_> + 3 8 17 1 3. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 5 0 15 8 -1. + <_> + 10 0 5 8 3. + <_> + + <_> + 0 0 10 10 -1. + <_> + 0 0 5 5 2. + <_> + 5 5 5 5 2. + <_> + + <_> + 2 3 16 9 -1. + <_> + 2 6 16 3 3. + <_> + + <_> + 4 0 12 8 -1. + <_> + 4 4 12 4 2. + <_> + + <_> + 13 0 7 6 -1. + <_> + 13 2 7 2 3. + <_> + + <_> + 4 0 2 15 -1. + <_> + 5 0 1 15 2. + <_> + + <_> + 10 10 6 7 -1. + <_> + 12 10 2 7 3. + <_> + + <_> + 4 10 6 7 -1. + <_> + 6 10 2 7 3. + <_> + + <_> + 10 8 8 8 -1. + <_> + 14 8 4 4 2. + <_> + 10 12 4 4 2. + <_> + + <_> + 2 8 8 8 -1. + <_> + 2 8 4 4 2. + <_> + 6 12 4 4 2. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 5 2. + <_> + 14 15 3 5 2. + <_> + + <_> + 0 10 6 10 -1. + <_> + 0 10 3 5 2. + <_> + 3 15 3 5 2. + <_> + + <_> + 10 1 3 10 -1. + <_> + 10 6 3 5 2. + <_> + + <_> + 6 11 5 6 -1. + <_> + 6 14 5 3 2. + <_> + + <_> + 4 3 12 12 -1. + <_> + 4 7 12 4 3. + <_> + + <_> + 4 5 10 6 -1. + <_> + 4 5 5 3 2. + <_> + 9 8 5 3 2. + <_> + + <_> + 11 4 9 10 -1. + <_> + 11 9 9 5 2. + <_> + + <_> + 7 2 4 12 -1. + <_> + 7 6 4 4 3. + <_> + + <_> + 11 1 9 18 -1. + <_> + 11 7 9 6 3. + <_> + + <_> + 4 8 12 10 -1. + <_> + 4 8 6 5 2. + <_> + 10 13 6 5 2. + <_> + + <_> + 8 4 6 10 -1. + <_> + 11 4 3 5 2. + <_> + 8 9 3 5 2. + <_> + + <_> + 6 0 8 14 -1. + <_> + 6 0 4 7 2. + <_> + 10 7 4 7 2. + <_> + + <_> + 8 1 8 8 -1. + <_> + 12 1 4 4 2. + <_> + 8 5 4 4 2. + <_> + + <_> + 5 1 8 8 -1. + <_> + 5 1 4 4 2. + <_> + 9 5 4 4 2. + <_> + + <_> + 2 1 18 5 -1. + <_> + 8 1 6 5 3. + <_> + + <_> + 0 0 15 8 -1. + <_> + 5 0 5 8 3. + <_> + + <_> + 5 15 10 5 -1. + <_> + 5 15 5 5 2. + <_> + + <_> + 0 5 12 15 -1. + <_> + 6 5 6 15 2. + <_> + + <_> + 5 7 15 3 -1. + <_> + 10 7 5 3 3. + <_> + + <_> + 0 7 15 3 -1. + <_> + 5 7 5 3 3. + <_> + + <_> + 11 11 7 6 -1. + <_> + 11 13 7 2 3. + <_> + + <_> + 2 11 7 6 -1. + <_> + 2 13 7 2 3. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 15 0 5 8 -1. + <_> + 15 4 5 4 2. + <_> + + <_> + 0 0 20 4 -1. + <_> + 0 0 10 2 2. + <_> + 10 2 10 2 2. + <_> + + <_> + 7 5 6 14 -1. + <_> + 10 5 3 7 2. + <_> + 7 12 3 7 2. + <_> + + <_> + 6 6 7 4 -1. + <_> + 6 8 7 2 2. + <_> + + <_> + 11 5 5 9 -1. + <_> + 11 8 5 3 3. + <_> + + <_> + 4 5 5 9 -1. + <_> + 4 8 5 3 3. + <_> + + <_> + 5 5 10 6 -1. + <_> + 10 5 5 3 2. + <_> + 5 8 5 3 2. + <_> + + <_> + 0 0 5 8 -1. + <_> + 0 4 5 4 2. + <_> + + <_> + 12 12 8 6 -1. + <_> + 12 14 8 2 3. + <_> + + <_> + 2 11 4 8 -1. + <_> + 4 11 2 8 2. + <_> + + <_> + 14 5 4 14 -1. + <_> + 16 5 2 7 2. + <_> + 14 12 2 7 2. + <_> + + <_> + 2 5 4 14 -1. + <_> + 2 5 2 7 2. + <_> + 4 12 2 7 2. + <_> + + <_> + 12 12 8 6 -1. + <_> + 12 14 8 2 3. + <_> + + <_> + 1 12 7 6 -1. + <_> + 1 14 7 2 3. + <_> + + <_> + 8 12 10 6 -1. + <_> + 8 14 10 2 3. + <_> + + <_> + 7 2 4 14 -1. + <_> + 7 2 2 7 2. + <_> + 9 9 2 7 2. + <_> + + <_> + 5 7 14 4 -1. + <_> + 12 7 7 2 2. + <_> + 5 9 7 2 2. + <_> + + <_> + 1 7 14 4 -1. + <_> + 1 7 7 2 2. + <_> + 8 9 7 2 2. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 2 6 14 10 -1. + <_> + 2 6 7 5 2. + <_> + 9 11 7 5 2. + <_> + + <_> + 13 5 4 11 -1. + <_> + 13 5 2 11 2. + <_> + + <_> + 2 13 15 6 -1. + <_> + 7 13 5 6 3. + <_> + + <_> + 5 16 12 4 -1. + <_> + 9 16 4 4 3. + <_> + + <_> + 3 15 9 5 -1. + <_> + 6 15 3 5 3. + <_> + + <_> + 2 0 17 18 -1. + <_> + 2 9 17 9 2. + <_> + + <_> + 1 0 4 12 -1. + <_> + 1 4 4 4 3. + <_> + + <_> + 13 5 4 11 -1. + <_> + 13 5 2 11 2. + <_> + + <_> + 3 4 6 5 -1. + <_> + 6 4 3 5 2. + <_> + + <_> + 3 0 15 2 -1. + <_> + 3 1 15 1 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 4 7 15 3 -1. + <_> + 9 7 5 3 3. + <_> + + <_> + 1 7 15 3 -1. + <_> + 6 7 5 3 3. + <_> + + <_> + 11 2 3 14 -1. + <_> + 12 2 1 14 3. + <_> + + <_> + 7 6 3 13 -1. + <_> + 8 6 1 13 3. + <_> + + <_> + 13 14 7 4 -1. + <_> + 13 16 7 2 2. + <_> + + <_> + 2 7 16 2 -1. + <_> + 2 8 16 1 2. + <_> + + <_> + 7 6 7 4 -1. + <_> + 7 8 7 2 2. + <_> + + <_> + 8 4 3 10 -1. + <_> + 8 9 3 5 2. + <_> + + <_> + 9 6 4 8 -1. + <_> + 9 10 4 4 2. + <_> + + <_> + 0 4 11 12 -1. + <_> + 0 10 11 6 2. + <_> + + <_> + 13 6 4 14 -1. + <_> + 13 13 4 7 2. + <_> + + <_> + 3 6 4 14 -1. + <_> + 3 13 4 7 2. + <_> + + <_> + 10 2 6 10 -1. + <_> + 13 2 3 5 2. + <_> + 10 7 3 5 2. + <_> + + <_> + 4 7 12 6 -1. + <_> + 4 9 12 2 3. + <_> + + <_> + 0 5 20 6 -1. + <_> + 0 7 20 2 3. + <_> + + <_> + 4 2 6 10 -1. + <_> + 4 2 3 5 2. + <_> + 7 7 3 5 2. + <_> + + <_> + 2 1 18 5 -1. + <_> + 8 1 6 5 3. + <_> + + <_> + 6 1 4 8 -1. + <_> + 6 5 4 4 2. + <_> + + <_> + 12 9 6 9 -1. + <_> + 12 12 6 3 3. + <_> + + <_> + 8 3 3 13 -1. + <_> + 9 3 1 13 3. + <_> + + <_> + 11 0 2 15 -1. + <_> + 11 0 1 15 2. + <_> + + <_> + 7 0 2 15 -1. + <_> + 8 0 1 15 2. + <_> + + <_> + 4 9 12 4 -1. + <_> + 8 9 4 4 3. + <_> + + <_> + 0 1 10 19 -1. + <_> + 5 1 5 19 2. + <_> + + <_> + 8 7 12 13 -1. + <_> + 8 7 6 13 2. + <_> + + <_> + 0 8 14 2 -1. + <_> + 7 8 7 2 2. + <_> + + <_> + 5 17 15 3 -1. + <_> + 10 17 5 3 3. + <_> + + <_> + 0 17 15 3 -1. + <_> + 5 17 5 3 3. + <_> + + <_> + 11 8 8 5 -1. + <_> + 11 8 4 5 2. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 3 1 8 8 -1. + <_> + 3 1 4 4 2. + <_> + 7 5 4 4 2. + <_> + + <_> + 10 1 3 10 -1. + <_> + 10 6 3 5 2. + <_> + + <_> + 0 14 7 6 -1. + <_> + 0 16 7 2 3. + <_> + + <_> + 8 4 4 12 -1. + <_> + 8 8 4 4 3. + <_> + + <_> + 0 11 18 2 -1. + <_> + 0 12 18 1 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 2 9 6 9 -1. + <_> + 2 12 6 3 3. + <_> + + <_> + 2 1 18 5 -1. + <_> + 8 1 6 5 3. + <_> + + <_> + 0 1 18 5 -1. + <_> + 6 1 6 5 3. + <_> + + <_> + 11 5 2 14 -1. + <_> + 11 12 2 7 2. + <_> + + <_> + 7 8 6 12 -1. + <_> + 7 8 3 6 2. + <_> + 10 14 3 6 2. + <_> + + <_> + 2 15 16 4 -1. + <_> + 2 17 16 2 2. + <_> + + <_> + 5 1 2 19 -1. + <_> + 6 1 1 19 2. + <_> + + <_> + 7 4 6 10 -1. + <_> + 10 4 3 5 2. + <_> + 7 9 3 5 2. + <_> + + <_> + 2 16 15 4 -1. + <_> + 7 16 5 4 3. + <_> + + <_> + 10 1 6 15 -1. + <_> + 12 1 2 15 3. + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 5 8 10 4 -1. + <_> + 5 10 10 2 2. + <_> + + <_> + 6 6 5 8 -1. + <_> + 6 10 5 4 2. + <_> + + <_> + 4 5 12 8 -1. + <_> + 10 5 6 4 2. + <_> + 4 9 6 4 2. + <_> + + <_> + 4 1 6 15 -1. + <_> + 6 1 2 15 3. + <_> + + <_> + 8 8 6 12 -1. + <_> + 11 8 3 6 2. + <_> + 8 14 3 6 2. + <_> + + <_> + 2 6 6 8 -1. + <_> + 5 6 3 8 2. + <_> + + <_> + 17 0 2 14 -1. + <_> + 17 0 1 14 2. + <_> + + <_> + 1 0 2 14 -1. + <_> + 2 0 1 14 2. + <_> + + <_> + 11 2 3 13 -1. + <_> + 12 2 1 13 3. + <_> + + <_> + 6 2 3 13 -1. + <_> + 7 2 1 13 3. + <_> + + <_> + 16 0 4 13 -1. + <_> + 16 0 2 13 2. + <_> + + <_> + 0 0 4 13 -1. + <_> + 2 0 2 13 2. + <_> + + <_> + 5 6 14 3 -1. + <_> + 5 6 7 3 2. + <_> + + <_> + 1 6 14 3 -1. + <_> + 8 6 7 3 2. + <_> + + <_> + 7 8 6 12 -1. + <_> + 10 8 3 6 2. + <_> + 7 14 3 6 2. + <_> + + <_> + 5 7 4 7 -1. + <_> + 7 7 2 7 2. + <_> + + <_> + 12 1 4 12 -1. + <_> + 12 5 4 4 3. + <_> + + <_> + 4 1 4 12 -1. + <_> + 4 5 4 4 3. + <_> + + <_> + 3 0 14 12 -1. + <_> + 3 4 14 4 3. + <_> + + <_> + 6 6 7 4 -1. + <_> + 6 8 7 2 2. + <_> + + <_> + 12 0 4 7 -1. + <_> + 12 0 2 7 2. + <_> + + <_> + 2 9 12 3 -1. + <_> + 8 9 6 3 2. + <_> + + <_> + 0 9 20 3 -1. + <_> + 0 10 20 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 6 14 13 3 -1. + <_> + 6 15 13 1 3. + <_> + + <_> + 2 2 15 12 -1. + <_> + 2 8 15 6 2. + <_> + + <_> + 11 5 5 6 -1. + <_> + 11 8 5 3 2. + <_> + + <_> + 2 8 14 3 -1. + <_> + 2 9 14 1 3. + <_> + + <_> + 10 2 6 9 -1. + <_> + 10 5 6 3 3. + <_> + + <_> + 4 2 6 7 -1. + <_> + 6 2 2 7 3. + <_> + + <_> + 8 14 12 6 -1. + <_> + 14 14 6 3 2. + <_> + 8 17 6 3 2. + <_> + + <_> + 6 12 8 6 -1. + <_> + 6 14 8 2 3. + <_> + + <_> + 9 14 9 4 -1. + <_> + 9 16 9 2 2. + <_> + + <_> + 0 14 7 4 -1. + <_> + 0 16 7 2 2. + <_> + + <_> + 2 11 18 8 -1. + <_> + 2 15 18 4 2. + <_> + + <_> + 0 12 10 8 -1. + <_> + 0 12 5 4 2. + <_> + 5 16 5 4 2. + <_> + + <_> + 13 9 4 7 -1. + <_> + 13 9 2 7 2. + <_> + + <_> + 5 9 10 6 -1. + <_> + 5 9 5 3 2. + <_> + 10 12 5 3 2. + <_> + + <_> + 12 5 5 9 -1. + <_> + 12 8 5 3 3. + <_> + + <_> + 3 5 5 9 -1. + <_> + 3 8 5 3 3. + <_> + + <_> + 5 5 11 6 -1. + <_> + 5 8 11 3 2. + <_> + + <_> + 4 0 4 7 -1. + <_> + 6 0 2 7 2. + <_> + + <_> + 1 8 18 5 -1. + <_> + 7 8 6 5 3. + <_> + + <_> + 1 3 18 7 -1. + <_> + 7 3 6 7 3. + <_> + + <_> + 7 11 7 8 -1. + <_> + 7 15 7 4 2. + <_> + + <_> + 4 14 12 6 -1. + <_> + 10 14 6 6 2. + <_> + + <_> + 5 6 11 9 -1. + <_> + 5 9 11 3 3. + <_> + + <_> + 7 12 4 8 -1. + <_> + 7 16 4 4 2. + <_> + + <_> + 9 14 10 6 -1. + <_> + 14 14 5 3 2. + <_> + 9 17 5 3 2. + <_> + + <_> + 6 5 7 6 -1. + <_> + 6 8 7 3 2. + <_> + + <_> + 13 9 4 7 -1. + <_> + 13 9 2 7 2. + <_> + + <_> + 3 9 4 7 -1. + <_> + 5 9 2 7 2. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 2 10 8 10 -1. + <_> + 6 10 4 10 2. + <_> + + <_> + 8 4 12 16 -1. + <_> + 14 4 6 8 2. + <_> + 8 12 6 8 2. + <_> + + <_> + 0 4 12 16 -1. + <_> + 0 4 6 8 2. + <_> + 6 12 6 8 2. + <_> + + <_> + 8 4 6 7 -1. + <_> + 10 4 2 7 3. + <_> + + <_> + 8 6 4 14 -1. + <_> + 8 6 2 7 2. + <_> + 10 13 2 7 2. + <_> + + <_> + 5 2 10 18 -1. + <_> + 10 2 5 9 2. + <_> + 5 11 5 9 2. + <_> + + <_> + 6 11 7 6 -1. + <_> + 6 13 7 2 3. + <_> + + <_> + 9 4 5 12 -1. + <_> + 9 10 5 6 2. + <_> + + <_> + 0 11 7 4 -1. + <_> + 0 13 7 2 2. + <_> + + <_> + 1 5 19 15 -1. + <_> + 1 10 19 5 3. + <_> + + <_> + 0 15 7 4 -1. + <_> + 0 17 7 2 2. + <_> + + <_> + 6 0 10 6 -1. + <_> + 11 0 5 3 2. + <_> + 6 3 5 3 2. + <_> + + <_> + 4 0 10 6 -1. + <_> + 4 0 5 3 2. + <_> + 9 3 5 3 2. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 11 7 7 6 -1. + <_> + 11 9 7 2 3. + <_> + + <_> + 4 6 12 5 -1. + <_> + 8 6 4 5 3. + <_> + + <_> + 9 4 11 4 -1. + <_> + 9 6 11 2 2. + <_> + + <_> + 2 1 6 10 -1. + <_> + 2 1 3 5 2. + <_> + 5 6 3 5 2. + <_> + + <_> + 12 5 4 8 -1. + <_> + 12 9 4 4 2. + <_> + + <_> + 0 5 18 8 -1. + <_> + 0 5 9 4 2. + <_> + 9 9 9 4 2. + <_> + + <_> + 9 6 5 12 -1. + <_> + 9 12 5 6 2. + <_> + + <_> + 0 12 13 2 -1. + <_> + 0 13 13 1 2. + <_> + + <_> + 10 4 3 13 -1. + <_> + 11 4 1 13 3. + <_> + + <_> + 7 3 3 14 -1. + <_> + 8 3 1 14 3. + <_> + + <_> + 7 12 6 8 -1. + <_> + 9 12 2 8 3. + <_> + + <_> + 4 5 4 12 -1. + <_> + 4 9 4 4 3. + <_> + + <_> + 3 3 17 2 -1. + <_> + 3 4 17 1 2. + <_> + + <_> + 2 0 15 6 -1. + <_> + 2 2 15 2 3. + <_> + + <_> + 8 0 12 4 -1. + <_> + 8 0 6 4 2. + <_> + + <_> + 1 10 10 6 -1. + <_> + 1 12 10 2 3. + <_> + + <_> + 10 0 6 8 -1. + <_> + 12 0 2 8 3. + <_> + + <_> + 1 8 4 12 -1. + <_> + 3 8 2 12 2. + <_> + + <_> + 4 15 15 5 -1. + <_> + 9 15 5 5 3. + <_> + + <_> + 0 1 14 3 -1. + <_> + 0 2 14 1 3. + <_> + + <_> + 10 2 6 7 -1. + <_> + 12 2 2 7 3. + <_> + + <_> + 4 2 6 7 -1. + <_> + 6 2 2 7 3. + <_> + + <_> + 6 12 8 6 -1. + <_> + 6 14 8 2 3. + <_> + + <_> + 1 3 14 12 -1. + <_> + 1 7 14 4 3. + <_> + + <_> + 4 15 15 5 -1. + <_> + 9 15 5 5 3. + <_> + + <_> + 1 15 15 5 -1. + <_> + 6 15 5 5 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 11 10 4 7 -1. + <_> + 11 10 2 7 2. + <_> + + <_> + 5 10 4 7 -1. + <_> + 7 10 2 7 2. + <_> + + <_> + 4 10 12 5 -1. + <_> + 8 10 4 5 3. + <_> + + <_> + 0 0 8 12 -1. + <_> + 0 0 4 6 2. + <_> + 4 6 4 6 2. + <_> + + <_> + 7 1 13 2 -1. + <_> + 7 2 13 1 2. + <_> + + <_> + 2 5 14 2 -1. + <_> + 2 6 14 1 2. + <_> + + <_> + 14 0 3 14 -1. + <_> + 15 0 1 14 3. + <_> + + <_> + 3 0 3 14 -1. + <_> + 4 0 1 14 3. + <_> + + <_> + 14 0 6 13 -1. + <_> + 16 0 2 13 3. + <_> + + <_> + 0 0 6 13 -1. + <_> + 2 0 2 13 3. + <_> + + <_> + 15 0 5 9 -1. + <_> + 15 3 5 3 3. + <_> + + <_> + 0 3 4 7 -1. + <_> + 2 3 2 7 2. + <_> + + <_> + 13 0 3 13 -1. + <_> + 14 0 1 13 3. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 2 4 8 -1. + <_> + 0 6 4 4 2. + <_> + + <_> + 10 6 10 6 -1. + <_> + 15 6 5 3 2. + <_> + 10 9 5 3 2. + <_> + + <_> + 0 1 20 16 -1. + <_> + 0 1 10 8 2. + <_> + 10 9 10 8 2. + <_> + + <_> + 7 1 10 16 -1. + <_> + 12 1 5 8 2. + <_> + 7 9 5 8 2. + <_> + + <_> + 0 1 16 14 -1. + <_> + 0 1 8 7 2. + <_> + 8 8 8 7 2. + <_> + + <_> + 9 5 10 6 -1. + <_> + 14 5 5 3 2. + <_> + 9 8 5 3 2. + <_> + + <_> + 1 5 10 6 -1. + <_> + 1 5 5 3 2. + <_> + 6 8 5 3 2. + <_> + + <_> + 4 5 13 2 -1. + <_> + 4 6 13 1 2. + <_> + + <_> + 0 4 10 4 -1. + <_> + 0 6 10 2 2. + <_> + + <_> + 10 0 4 8 -1. + <_> + 10 4 4 4 2. + <_> + + <_> + 0 3 20 3 -1. + <_> + 0 4 20 1 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 1 6 9 -1. + <_> + 0 4 6 3 3. + <_> + + <_> + 6 14 13 3 -1. + <_> + 6 15 13 1 3. + <_> + + <_> + 3 15 14 4 -1. + <_> + 3 17 14 2 2. + <_> + + <_> + 12 12 7 6 -1. + <_> + 12 14 7 2 3. + <_> + + <_> + 0 14 18 4 -1. + <_> + 0 14 9 2 2. + <_> + 9 16 9 2 2. + <_> + + <_> + 14 4 4 9 -1. + <_> + 14 4 2 9 2. + <_> + + <_> + 0 4 6 8 -1. + <_> + 2 4 2 8 3. + <_> + + <_> + 16 6 4 14 -1. + <_> + 18 6 2 7 2. + <_> + 16 13 2 7 2. + <_> + + <_> + 1 10 5 9 -1. + <_> + 1 13 5 3 3. + <_> + + <_> + 16 6 4 14 -1. + <_> + 18 6 2 7 2. + <_> + 16 13 2 7 2. + <_> + + <_> + 5 0 9 5 -1. + <_> + 8 0 3 5 3. + <_> + + <_> + 16 6 4 14 -1. + <_> + 18 6 2 7 2. + <_> + 16 13 2 7 2. + <_> + + <_> + 3 1 10 16 -1. + <_> + 3 1 5 8 2. + <_> + 8 9 5 8 2. + <_> + + <_> + 2 12 18 4 -1. + <_> + 11 12 9 2 2. + <_> + 2 14 9 2 2. + <_> + + <_> + 8 4 4 7 -1. + <_> + 10 4 2 7 2. + <_> + + <_> + 12 0 3 20 -1. + <_> + 13 0 1 20 3. + <_> + + <_> + 5 0 3 20 -1. + <_> + 6 0 1 20 3. + <_> + + <_> + 11 13 9 7 -1. + <_> + 14 13 3 7 3. + <_> + + <_> + 8 5 4 14 -1. + <_> + 8 5 2 7 2. + <_> + 10 12 2 7 2. + <_> + + <_> + 2 12 18 4 -1. + <_> + 11 12 9 2 2. + <_> + 2 14 9 2 2. + <_> + + <_> + 0 12 18 4 -1. + <_> + 0 12 9 2 2. + <_> + 9 14 9 2 2. + <_> + + <_> + 8 14 12 5 -1. + <_> + 12 14 4 5 3. + <_> + + <_> + 0 14 12 5 -1. + <_> + 4 14 4 5 3. + <_> + + <_> + 6 8 14 3 -1. + <_> + 6 9 14 1 3. + <_> + + <_> + 1 11 16 4 -1. + <_> + 1 11 8 2 2. + <_> + 9 13 8 2 2. + <_> + + <_> + 13 10 6 10 -1. + <_> + 16 10 3 5 2. + <_> + 13 15 3 5 2. + <_> + + <_> + 0 5 20 12 -1. + <_> + 0 5 10 6 2. + <_> + 10 11 10 6 2. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 1 18 15 2 -1. + <_> + 1 19 15 1 2. + <_> + + <_> + 13 10 6 10 -1. + <_> + 16 10 3 5 2. + <_> + 13 15 3 5 2. + <_> + + <_> + 0 14 20 6 -1. + <_> + 0 16 20 2 3. + <_> + + <_> + 13 10 6 10 -1. + <_> + 16 10 3 5 2. + <_> + 13 15 3 5 2. + <_> + + <_> + 3 0 13 2 -1. + <_> + 3 1 13 1 2. + <_> + + <_> + 0 7 20 3 -1. + <_> + 0 8 20 1 3. + <_> + + <_> + 2 5 10 8 -1. + <_> + 2 9 10 4 2. + <_> + + <_> + 8 5 12 6 -1. + <_> + 8 8 12 3 2. + <_> + + <_> + 0 5 11 6 -1. + <_> + 0 8 11 3 2. + <_> + + <_> + 3 10 17 2 -1. + <_> + 3 11 17 1 2. + <_> + + <_> + 1 10 6 10 -1. + <_> + 1 10 3 5 2. + <_> + 4 15 3 5 2. + <_> + + <_> + 1 0 18 3 -1. + <_> + 7 0 6 3 3. + <_> + + <_> + 3 12 14 4 -1. + <_> + 3 14 14 2 2. + <_> + + <_> + 8 0 7 8 -1. + <_> + 8 4 7 4 2. + <_> + + <_> + 3 13 7 6 -1. + <_> + 3 15 7 2 3. + <_> + + <_> + 9 7 3 13 -1. + <_> + 10 7 1 13 3. + <_> + + <_> + 0 14 5 6 -1. + <_> + 0 17 5 3 2. + <_> + + <_> + 5 6 15 4 -1. + <_> + 10 6 5 4 3. + <_> + + <_> + 0 6 15 4 -1. + <_> + 5 6 5 4 3. + <_> + + <_> + 16 9 3 10 -1. + <_> + 16 14 3 5 2. + <_> + + <_> + 1 0 8 15 -1. + <_> + 1 5 8 5 3. + <_> + + <_> + 14 0 4 13 -1. + <_> + 14 0 2 13 2. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 4 0 15 2 -1. + <_> + 4 1 15 1 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 6 0 8 12 -1. + <_> + 10 0 4 6 2. + <_> + 6 6 4 6 2. + <_> + + <_> + 8 0 3 13 -1. + <_> + 9 0 1 13 3. + <_> + + <_> + 9 0 3 13 -1. + <_> + 10 0 1 13 3. + <_> + + <_> + 1 1 16 4 -1. + <_> + 1 1 8 2 2. + <_> + 9 3 8 2 2. + <_> + + <_> + 17 6 3 13 -1. + <_> + 18 6 1 13 3. + <_> + + <_> + 0 6 3 13 -1. + <_> + 1 6 1 13 3. + <_> + + <_> + 9 2 6 14 -1. + <_> + 12 2 3 7 2. + <_> + 9 9 3 7 2. + <_> + + <_> + 7 6 4 7 -1. + <_> + 9 6 2 7 2. + <_> + + <_> + 6 8 8 12 -1. + <_> + 10 8 4 6 2. + <_> + 6 14 4 6 2. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 2 13 16 3 -1. + <_> + 2 14 16 1 3. + <_> + + <_> + 6 8 8 10 -1. + <_> + 6 8 4 5 2. + <_> + 10 13 4 5 2. + <_> + + <_> + 5 3 12 3 -1. + <_> + 5 3 6 3 2. + <_> + + <_> + 8 0 4 18 -1. + <_> + 8 6 4 6 3. + <_> + + <_> + 9 8 3 12 -1. + <_> + 9 14 3 6 2. + <_> + + <_> + 7 7 3 10 -1. + <_> + 7 12 3 5 2. + <_> + + <_> + 10 5 7 6 -1. + <_> + 10 7 7 2 3. + <_> + + <_> + 0 6 4 14 -1. + <_> + 0 6 2 7 2. + <_> + 2 13 2 7 2. + <_> + + <_> + 13 10 6 5 -1. + <_> + 13 10 3 5 2. + <_> + + <_> + 1 10 6 5 -1. + <_> + 4 10 3 5 2. + <_> + + <_> + 14 10 4 7 -1. + <_> + 14 10 2 7 2. + <_> + + <_> + 1 12 6 5 -1. + <_> + 4 12 3 5 2. + <_> + + <_> + 6 6 8 12 -1. + <_> + 6 12 8 6 2. + <_> + + <_> + 0 8 14 3 -1. + <_> + 0 9 14 1 3. + <_> + + <_> + 8 11 6 6 -1. + <_> + 8 14 6 3 2. + <_> + + <_> + 6 1 8 12 -1. + <_> + 6 7 8 6 2. + <_> + + <_> + 2 0 16 8 -1. + <_> + 2 4 16 4 2. + <_> + + <_> + 1 0 17 3 -1. + <_> + 1 1 17 1 3. + <_> + + <_> + 5 13 13 2 -1. + <_> + 5 14 13 1 2. + <_> + + <_> + 1 12 7 6 -1. + <_> + 1 14 7 2 3. + <_> + + <_> + 13 12 7 6 -1. + <_> + 13 14 7 2 3. + <_> + + <_> + 8 0 3 13 -1. + <_> + 9 0 1 13 3. + <_> + + <_> + 13 12 7 6 -1. + <_> + 13 14 7 2 3. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 0 14 9 6 -1. + <_> + 3 14 3 6 3. + <_> + + <_> + 13 12 7 6 -1. + <_> + 13 14 7 2 3. + <_> + + <_> + 0 12 7 6 -1. + <_> + 0 14 7 2 3. + <_> + + <_> + 6 0 8 12 -1. + <_> + 6 4 8 4 3. + <_> + + <_> + 0 1 13 2 -1. + <_> + 0 2 13 1 2. + <_> + + <_> + 15 1 3 13 -1. + <_> + 16 1 1 13 3. + <_> + + <_> + 2 1 3 13 -1. + <_> + 3 1 1 13 3. + <_> + + <_> + 4 4 12 4 -1. + <_> + 8 4 4 4 3. + <_> + + <_> + 1 0 18 4 -1. + <_> + 7 0 6 4 3. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 1 14 13 3 -1. + <_> + 1 15 13 1 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 5 2 3 18 -1. + <_> + 6 2 1 18 3. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 0 10 20 3 -1. + <_> + 0 11 20 1 3. + <_> + + <_> + 7 10 13 3 -1. + <_> + 7 11 13 1 3. + <_> + + <_> + 0 15 13 2 -1. + <_> + 0 16 13 1 2. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 3 7 12 5 -1. + <_> + 7 7 4 5 3. + <_> + + <_> + 2 11 16 8 -1. + <_> + 10 11 8 4 2. + <_> + 2 15 8 4 2. + <_> + + <_> + 2 0 14 12 -1. + <_> + 2 6 14 6 2. + <_> + + <_> + 11 10 4 8 -1. + <_> + 11 14 4 4 2. + <_> + + <_> + 5 11 10 6 -1. + <_> + 5 11 5 3 2. + <_> + 10 14 5 3 2. + <_> + + <_> + 10 1 7 6 -1. + <_> + 10 3 7 2 3. + <_> + + <_> + 5 3 10 6 -1. + <_> + 5 5 10 2 3. + <_> + + <_> + 4 6 12 3 -1. + <_> + 4 6 6 3 2. + <_> + + <_> + 1 4 14 3 -1. + <_> + 1 5 14 1 3. + <_> + + <_> + 12 12 8 4 -1. + <_> + 12 12 4 4 2. + <_> + + <_> + 0 12 8 4 -1. + <_> + 4 12 4 4 2. + <_> + + <_> + 10 9 10 8 -1. + <_> + 10 9 5 8 2. + <_> + + <_> + 0 9 10 8 -1. + <_> + 5 9 5 8 2. + <_> + + <_> + 3 4 14 3 -1. + <_> + 3 5 14 1 3. + <_> + + <_> + 0 5 12 4 -1. + <_> + 0 7 12 2 2. + <_> + + <_> + 7 1 8 12 -1. + <_> + 7 7 8 6 2. + <_> + + <_> + 5 0 10 15 -1. + <_> + 10 0 5 15 2. + <_> + + <_> + 6 1 10 6 -1. + <_> + 11 1 5 3 2. + <_> + 6 4 5 3 2. + <_> + + <_> + 4 1 10 6 -1. + <_> + 4 1 5 3 2. + <_> + 9 4 5 3 2. + <_> + + <_> + 1 5 18 3 -1. + <_> + 7 5 6 3 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 11 8 4 12 -1. + <_> + 11 8 2 12 2. + <_> + + <_> + 5 8 4 12 -1. + <_> + 7 8 2 12 2. + <_> + + <_> + 8 4 4 16 -1. + <_> + 10 4 2 8 2. + <_> + 8 12 2 8 2. + <_> + + <_> + 8 6 4 14 -1. + <_> + 8 6 2 7 2. + <_> + 10 13 2 7 2. + <_> + + <_> + 3 2 14 2 -1. + <_> + 3 3 14 1 2. + <_> + + <_> + 3 0 13 9 -1. + <_> + 3 3 13 3 3. + <_> + + <_> + 3 5 17 6 -1. + <_> + 3 7 17 2 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 3 1 15 19 -1. + <_> + 8 1 5 19 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 3 2 14 3 -1. + <_> + 3 2 7 3 2. + <_> + + <_> + 3 6 10 3 -1. + <_> + 8 6 5 3 2. + <_> + + <_> + 6 7 14 2 -1. + <_> + 6 8 14 1 2. + <_> + + <_> + 2 4 15 3 -1. + <_> + 2 5 15 1 3. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 2 14 7 6 -1. + <_> + 2 16 7 2 3. + <_> + + <_> + 8 15 7 4 -1. + <_> + 8 17 7 2 2. + <_> + + <_> + 0 12 20 6 -1. + <_> + 0 15 20 3 2. + <_> + + <_> + 6 3 13 3 -1. + <_> + 6 4 13 1 3. + <_> + + <_> + 1 5 17 12 -1. + <_> + 1 9 17 4 3. + <_> + + <_> + 6 11 13 3 -1. + <_> + 6 12 13 1 3. + <_> + + <_> + 2 5 16 8 -1. + <_> + 2 9 16 4 2. + <_> + + <_> + 9 5 5 14 -1. + <_> + 9 12 5 7 2. + <_> + + <_> + 8 4 3 16 -1. + <_> + 9 4 1 16 3. + <_> + + <_> + 3 4 14 6 -1. + <_> + 10 4 7 3 2. + <_> + 3 7 7 3 2. + <_> + + <_> + 0 3 7 6 -1. + <_> + 0 5 7 2 3. + <_> + + <_> + 4 5 12 6 -1. + <_> + 10 5 6 3 2. + <_> + 4 8 6 3 2. + <_> + + <_> + 0 13 19 6 -1. + <_> + 0 15 19 2 3. + <_> + + <_> + 13 13 7 6 -1. + <_> + 13 15 7 2 3. + <_> + + <_> + 3 1 7 6 -1. + <_> + 3 3 7 2 3. + <_> + + <_> + 13 13 7 6 -1. + <_> + 13 15 7 2 3. + <_> + + <_> + 1 3 8 10 -1. + <_> + 1 3 4 5 2. + <_> + 5 8 4 5 2. + <_> + + <_> + 9 6 4 12 -1. + <_> + 9 12 4 6 2. + <_> + + <_> + 4 10 4 7 -1. + <_> + 6 10 2 7 2. + <_> + + <_> + 8 0 9 14 -1. + <_> + 11 0 3 14 3. + <_> + + <_> + 1 1 18 19 -1. + <_> + 7 1 6 19 3. + <_> + + <_> + 8 5 8 9 -1. + <_> + 8 8 8 3 3. + <_> + + <_> + 3 8 14 3 -1. + <_> + 3 9 14 1 3. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 2 10 6 8 -1. + <_> + 4 10 2 8 3. + <_> + + <_> + 12 13 7 6 -1. + <_> + 12 15 7 2 3. + <_> + + <_> + 6 10 4 8 -1. + <_> + 6 14 4 4 2. + <_> + + <_> + 10 9 6 10 -1. + <_> + 10 14 6 5 2. + <_> + + <_> + 4 9 6 10 -1. + <_> + 4 14 6 5 2. + <_> + + <_> + 13 13 7 6 -1. + <_> + 13 15 7 2 3. + <_> + + <_> + 1 13 7 6 -1. + <_> + 1 15 7 2 3. + <_> + + <_> + 13 1 6 13 -1. + <_> + 13 1 3 13 2. + <_> + + <_> + 3 3 13 3 -1. + <_> + 3 4 13 1 3. + <_> + + <_> + 7 3 13 2 -1. + <_> + 7 4 13 1 2. + <_> + + <_> + 4 14 10 6 -1. + <_> + 4 14 5 3 2. + <_> + 9 17 5 3 2. + <_> + + <_> + 11 1 4 14 -1. + <_> + 13 1 2 7 2. + <_> + 11 8 2 7 2. + <_> + + <_> + 0 3 14 2 -1. + <_> + 0 4 14 1 2. + <_> + + <_> + 7 0 6 6 -1. + <_> + 7 3 6 3 2. + <_> + + <_> + 0 0 16 18 -1. + <_> + 0 6 16 6 3. + <_> + + <_> + 14 2 5 9 -1. + <_> + 14 5 5 3 3. + <_> + + <_> + 1 10 4 10 -1. + <_> + 1 15 4 5 2. + <_> + + <_> + 16 6 2 14 -1. + <_> + 16 13 2 7 2. + <_> + + <_> + 2 6 2 14 -1. + <_> + 2 13 2 7 2. + <_> + + <_> + 14 2 5 9 -1. + <_> + 14 5 5 3 3. + <_> + + <_> + 1 2 5 9 -1. + <_> + 1 5 5 3 3. + <_> + + <_> + 8 4 9 9 -1. + <_> + 8 7 9 3 3. + <_> + + <_> + 4 5 12 6 -1. + <_> + 4 5 6 3 2. + <_> + 10 8 6 3 2. + <_> + + <_> + 13 4 3 16 -1. + <_> + 14 4 1 16 3. + <_> + + <_> + 4 4 3 16 -1. + <_> + 5 4 1 16 3. + <_> + + <_> + 12 2 4 12 -1. + <_> + 12 6 4 4 3. + <_> + + <_> + 6 0 2 14 -1. + <_> + 7 0 1 14 2. + <_> + + <_> + 15 0 4 16 -1. + <_> + 15 8 4 8 2. + <_> + + <_> + 1 0 4 16 -1. + <_> + 1 8 4 8 2. + <_> + + <_> + 12 9 8 6 -1. + <_> + 12 11 8 2 3. + <_> + + <_> + 0 6 14 2 -1. + <_> + 7 6 7 2 2. + <_> + + <_> + 0 0 20 5 -1. + <_> + 0 0 10 5 2. + <_> + + <_> + 4 0 12 6 -1. + <_> + 4 0 6 3 2. + <_> + 10 3 6 3 2. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 0 0 8 8 -1. + <_> + 0 0 4 4 2. + <_> + 4 4 4 4 2. + <_> + + <_> + 14 1 5 9 -1. + <_> + 14 4 5 3 3. + <_> + + <_> + 1 6 18 2 -1. + <_> + 1 7 18 1 2. + <_> + + <_> + 7 1 7 6 -1. + <_> + 7 3 7 2 3. + <_> + + <_> + 1 2 18 10 -1. + <_> + 1 2 9 5 2. + <_> + 10 7 9 5 2. + <_> + + <_> + 9 3 8 8 -1. + <_> + 13 3 4 4 2. + <_> + 9 7 4 4 2. + <_> + + <_> + 3 1 12 4 -1. + <_> + 9 1 6 4 2. + <_> + + <_> + 4 5 12 7 -1. + <_> + 8 5 4 7 3. + <_> + + <_> + 5 9 9 5 -1. + <_> + 8 9 3 5 3. + <_> + + <_> + 7 10 6 7 -1. + <_> + 9 10 2 7 3. + <_> + + <_> + 8 2 3 13 -1. + <_> + 9 2 1 13 3. + <_> + + <_> + 11 2 2 16 -1. + <_> + 11 2 1 16 2. + <_> + + <_> + 2 13 9 7 -1. + <_> + 5 13 3 7 3. + <_> + + <_> + 11 2 2 16 -1. + <_> + 11 2 1 16 2. + <_> + + <_> + 0 9 18 11 -1. + <_> + 6 9 6 11 3. + <_> + + <_> + 11 2 2 16 -1. + <_> + 11 2 1 16 2. + <_> + + <_> + 3 7 12 6 -1. + <_> + 7 7 4 6 3. + <_> + + <_> + 11 4 5 9 -1. + <_> + 11 7 5 3 3. + <_> + + <_> + 4 4 5 9 -1. + <_> + 4 7 5 3 3. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 14 1 5 9 -1. + <_> + 14 4 5 3 3. + <_> + + <_> + 7 2 2 16 -1. + <_> + 8 2 1 16 2. + <_> + + <_> + 3 15 14 3 -1. + <_> + 3 16 14 1 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 0 1 20 6 -1. + <_> + 10 1 10 3 2. + <_> + 0 4 10 3 2. + <_> + + <_> + 4 0 8 5 -1. + <_> + 8 0 4 5 2. + <_> + + <_> + 13 1 3 14 -1. + <_> + 14 1 1 14 3. + <_> + + <_> + 4 1 3 14 -1. + <_> + 5 1 1 14 3. + <_> + + <_> + 13 0 6 10 -1. + <_> + 16 0 3 5 2. + <_> + 13 5 3 5 2. + <_> + + <_> + 1 0 6 10 -1. + <_> + 1 0 3 5 2. + <_> + 4 5 3 5 2. + <_> + + <_> + 2 0 18 5 -1. + <_> + 8 0 6 5 3. + <_> + + <_> + 0 0 18 5 -1. + <_> + 6 0 6 5 3. + <_> + + <_> + 11 1 4 14 -1. + <_> + 13 1 2 7 2. + <_> + 11 8 2 7 2. + <_> + + <_> + 5 1 4 14 -1. + <_> + 5 1 2 7 2. + <_> + 7 8 2 7 2. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 0 7 13 3 -1. + <_> + 0 8 13 1 3. + <_> + + <_> + 16 1 3 13 -1. + <_> + 17 1 1 13 3. + <_> + + <_> + 1 1 3 13 -1. + <_> + 2 1 1 13 3. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 2 12 5 8 -1. + <_> + 2 16 5 4 2. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 6 9 9 4 -1. + <_> + 6 11 9 2 2. + <_> + + <_> + 0 7 10 6 -1. + <_> + 0 7 5 3 2. + <_> + 5 10 5 3 2. + <_> + + <_> + 15 4 5 16 -1. + <_> + 15 12 5 8 2. + <_> + + <_> + 4 0 9 9 -1. + <_> + 7 0 3 9 3. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 3 12 14 8 -1. + <_> + 3 12 7 8 2. + <_> + + <_> + 2 10 16 10 -1. + <_> + 2 10 8 5 2. + <_> + 10 15 8 5 2. + <_> + + <_> + 4 5 12 6 -1. + <_> + 10 5 6 3 2. + <_> + 4 8 6 3 2. + <_> + + <_> + 5 5 10 8 -1. + <_> + 5 5 5 4 2. + <_> + 10 9 5 4 2. + <_> + + <_> + 5 6 10 6 -1. + <_> + 10 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 1 15 12 5 -1. + <_> + 5 15 4 5 3. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 5 2. + <_> + 14 15 3 5 2. + <_> + + <_> + 5 9 10 8 -1. + <_> + 5 9 5 4 2. + <_> + 10 13 5 4 2. + <_> + + <_> + 2 7 18 13 -1. + <_> + 8 7 6 13 3. + <_> + + <_> + 4 6 10 5 -1. + <_> + 9 6 5 5 2. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 5 2. + <_> + 14 15 3 5 2. + <_> + + <_> + 3 0 6 8 -1. + <_> + 5 0 2 8 3. + <_> + + <_> + 3 14 16 6 -1. + <_> + 3 14 8 6 2. + <_> + + <_> + 6 2 4 7 -1. + <_> + 8 2 2 7 2. + <_> + + <_> + 4 9 14 3 -1. + <_> + 4 10 14 1 3. + <_> + + <_> + 3 6 13 9 -1. + <_> + 3 9 13 3 3. + <_> + + <_> + 7 0 6 18 -1. + <_> + 7 9 6 9 2. + <_> + + <_> + 8 5 3 10 -1. + <_> + 8 10 3 5 2. + <_> + + <_> + 3 3 16 4 -1. + <_> + 3 5 16 2 2. + <_> + + <_> + 5 6 5 6 -1. + <_> + 5 9 5 3 2. + <_> + + <_> + 4 6 12 6 -1. + <_> + 4 9 12 3 2. + <_> + + <_> + 4 7 12 4 -1. + <_> + 4 9 12 2 2. + <_> + + <_> + 8 9 9 4 -1. + <_> + 8 11 9 2 2. + <_> + + <_> + 1 5 16 3 -1. + <_> + 1 6 16 1 3. + <_> + + <_> + 5 5 13 3 -1. + <_> + 5 6 13 1 3. + <_> + + <_> + 0 1 18 3 -1. + <_> + 0 2 18 1 3. + <_> + + <_> + 9 2 6 10 -1. + <_> + 12 2 3 5 2. + <_> + 9 7 3 5 2. + <_> + + <_> + 3 1 12 4 -1. + <_> + 7 1 4 4 3. + <_> + + <_> + 9 2 6 10 -1. + <_> + 12 2 3 5 2. + <_> + 9 7 3 5 2. + <_> + + <_> + 8 2 2 18 -1. + <_> + 8 11 2 9 2. + <_> + + <_> + 9 2 6 10 -1. + <_> + 12 2 3 5 2. + <_> + 9 7 3 5 2. + <_> + + <_> + 5 2 6 10 -1. + <_> + 5 2 3 5 2. + <_> + 8 7 3 5 2. + <_> + + <_> + 4 9 12 4 -1. + <_> + 8 9 4 4 3. + <_> + + <_> + 4 9 9 8 -1. + <_> + 4 13 9 4 2. + <_> + + <_> + 1 15 19 4 -1. + <_> + 1 17 19 2 2. + <_> + + <_> + 5 15 7 4 -1. + <_> + 5 17 7 2 2. + <_> + + <_> + 7 6 6 10 -1. + <_> + 9 6 2 10 3. + <_> + + <_> + 0 7 20 6 -1. + <_> + 0 10 20 3 2. + <_> + + <_> + 7 0 12 10 -1. + <_> + 7 5 12 5 2. + <_> + + <_> + 0 14 10 6 -1. + <_> + 0 14 5 3 2. + <_> + 5 17 5 3 2. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 5 2. + <_> + 14 15 3 5 2. + <_> + + <_> + 0 8 5 9 -1. + <_> + 0 11 5 3 3. + <_> + + <_> + 15 11 5 9 -1. + <_> + 15 14 5 3 3. + <_> + + <_> + 1 11 13 3 -1. + <_> + 1 12 13 1 3. + <_> + + <_> + 15 11 5 9 -1. + <_> + 15 14 5 3 3. + <_> + + <_> + 0 12 20 2 -1. + <_> + 0 13 20 1 2. + <_> + + <_> + 15 11 5 9 -1. + <_> + 15 14 5 3 3. + <_> + + <_> + 0 11 5 9 -1. + <_> + 0 14 5 3 3. + <_> + + <_> + 13 0 3 10 -1. + <_> + 13 5 3 5 2. + <_> + + <_> + 3 0 13 18 -1. + <_> + 3 9 13 9 2. + <_> + + <_> + 12 5 3 14 -1. + <_> + 12 12 3 7 2. + <_> + + <_> + 5 5 3 14 -1. + <_> + 5 12 3 7 2. + <_> + + <_> + 2 8 16 10 -1. + <_> + 10 8 8 5 2. + <_> + 2 13 8 5 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 10 5 2 7 2. + <_> + + <_> + 6 3 12 9 -1. + <_> + 10 3 4 9 3. + <_> + + <_> + 4 5 6 5 -1. + <_> + 7 5 3 5 2. + <_> + + <_> + 5 1 12 8 -1. + <_> + 11 1 6 4 2. + <_> + 5 5 6 4 2. + <_> + + <_> + 5 6 6 10 -1. + <_> + 5 6 3 5 2. + <_> + 8 11 3 5 2. + <_> + + <_> + 2 10 18 9 -1. + <_> + 2 10 9 9 2. + <_> + + <_> + 5 0 10 4 -1. + <_> + 5 2 10 2 2. + <_> + + <_> + 7 13 6 7 -1. + <_> + 9 13 2 7 3. + <_> + + <_> + 0 12 18 3 -1. + <_> + 6 12 6 3 3. + <_> + + <_> + 4 1 14 3 -1. + <_> + 4 2 14 1 3. + <_> + + <_> + 4 5 8 8 -1. + <_> + 4 5 4 4 2. + <_> + 8 9 4 4 2. + <_> + + <_> + 4 5 12 6 -1. + <_> + 4 7 12 2 3. + <_> + + <_> + 0 1 10 4 -1. + <_> + 5 1 5 4 2. + <_> + + <_> + 4 18 13 2 -1. + <_> + 4 19 13 1 2. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 2 4 16 10 -1. + <_> + 10 4 8 5 2. + <_> + 2 9 8 5 2. + <_> + + <_> + 0 2 16 2 -1. + <_> + 0 3 16 1 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 3 11 6 7 -1. + <_> + 5 11 2 7 3. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 3 1 10 6 -1. + <_> + 3 1 5 3 2. + <_> + 8 4 5 3 2. + <_> + + <_> + 12 9 5 9 -1. + <_> + 12 12 5 3 3. + <_> + + <_> + 6 3 4 7 -1. + <_> + 8 3 2 7 2. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 1 4 4 12 -1. + <_> + 1 8 4 4 3. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 8 6 4 7 -1. + <_> + 10 6 2 7 2. + <_> + + <_> + 10 8 8 8 -1. + <_> + 14 8 4 4 2. + <_> + 10 12 4 4 2. + <_> + + <_> + 1 7 15 3 -1. + <_> + 6 7 5 3 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 14 8 4 2. + <_> + + <_> + 3 5 14 3 -1. + <_> + 3 6 14 1 3. + <_> + + <_> + 2 10 7 6 -1. + <_> + 2 12 7 2 3. + <_> + + <_> + 8 6 7 8 -1. + <_> + 8 10 7 4 2. + <_> + + <_> + 0 2 4 7 -1. + <_> + 2 2 2 7 2. + <_> + + <_> + 4 1 14 3 -1. + <_> + 4 2 14 1 3. + <_> + + <_> + 2 3 13 2 -1. + <_> + 2 4 13 1 2. + <_> + + <_> + 5 13 13 3 -1. + <_> + 5 14 13 1 3. + <_> + + <_> + 2 1 16 4 -1. + <_> + 2 1 8 2 2. + <_> + 10 3 8 2 2. + <_> + + <_> + 9 0 8 6 -1. + <_> + 9 2 8 2 3. + <_> + + <_> + 3 9 6 8 -1. + <_> + 6 9 3 8 2. + <_> + + <_> + 12 10 8 6 -1. + <_> + 12 12 8 2 3. + <_> + + <_> + 4 10 6 5 -1. + <_> + 7 10 3 5 2. + <_> + + <_> + 7 6 8 8 -1. + <_> + 11 6 4 4 2. + <_> + 7 10 4 4 2. + <_> + + <_> + 7 5 6 10 -1. + <_> + 7 5 3 5 2. + <_> + 10 10 3 5 2. + <_> + + <_> + 10 4 10 4 -1. + <_> + 10 6 10 2 2. + <_> + + <_> + 0 4 10 4 -1. + <_> + 0 6 10 2 2. + <_> + + <_> + 4 2 14 6 -1. + <_> + 4 5 14 3 2. + <_> + + <_> + 0 2 13 3 -1. + <_> + 0 3 13 1 3. + <_> + + <_> + 4 9 12 5 -1. + <_> + 8 9 4 5 3. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 12 9 7 6 -1. + <_> + 12 11 7 2 3. + <_> + + <_> + 1 9 7 6 -1. + <_> + 1 11 7 2 3. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 0 6 10 6 -1. + <_> + 0 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 4 15 12 5 -1. + <_> + 8 15 4 5 3. + <_> + + <_> + 12 12 7 6 -1. + <_> + 12 14 7 2 3. + <_> + + <_> + 0 6 17 3 -1. + <_> + 0 7 17 1 3. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 5 2. + <_> + 14 15 3 5 2. + <_> + + <_> + 0 12 18 4 -1. + <_> + 0 12 9 2 2. + <_> + 9 14 9 2 2. + <_> + + <_> + 11 0 4 7 -1. + <_> + 11 0 2 7 2. + <_> + + <_> + 0 12 14 2 -1. + <_> + 0 13 14 1 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 10 1 6 7 -1. + <_> + 12 1 2 7 3. + <_> + + <_> + 8 6 3 13 -1. + <_> + 9 6 1 13 3. + <_> + + <_> + 9 1 3 14 -1. + <_> + 10 1 1 14 3. + <_> + + <_> + 4 1 6 7 -1. + <_> + 6 1 2 7 3. + <_> + + <_> + 11 11 7 6 -1. + <_> + 11 13 7 2 3. + <_> + + <_> + 2 11 7 6 -1. + <_> + 2 13 7 2 3. + <_> + + <_> + 0 3 20 12 -1. + <_> + 0 9 20 6 2. + <_> + + <_> + 7 6 6 11 -1. + <_> + 9 6 2 11 3. + <_> + + <_> + 4 6 12 4 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 0 1 6 11 -1. + <_> + 3 1 3 11 2. + <_> + + <_> + 9 4 5 12 -1. + <_> + 9 10 5 6 2. + <_> + + <_> + 0 3 20 4 -1. + <_> + 0 3 10 2 2. + <_> + 10 5 10 2 2. + <_> + + <_> + 10 0 10 6 -1. + <_> + 15 0 5 3 2. + <_> + 10 3 5 3 2. + <_> + + <_> + 4 0 10 6 -1. + <_> + 4 0 5 3 2. + <_> + 9 3 5 3 2. + <_> + + <_> + 7 8 13 3 -1. + <_> + 7 9 13 1 3. + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 10 6 7 4 -1. + <_> + 10 8 7 2 2. + <_> + + <_> + 3 6 7 4 -1. + <_> + 3 8 7 2 2. + <_> + + <_> + 11 9 7 6 -1. + <_> + 11 11 7 2 3. + <_> + + <_> + 2 8 14 4 -1. + <_> + 2 8 7 2 2. + <_> + 9 10 7 2 2. + <_> + + <_> + 10 10 10 6 -1. + <_> + 15 10 5 3 2. + <_> + 10 13 5 3 2. + <_> + + <_> + 0 10 10 6 -1. + <_> + 0 10 5 3 2. + <_> + 5 13 5 3 2. + <_> + + <_> + 14 5 4 14 -1. + <_> + 16 5 2 7 2. + <_> + 14 12 2 7 2. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 14 5 4 14 -1. + <_> + 16 5 2 7 2. + <_> + 14 12 2 7 2. + <_> + + <_> + 2 5 4 14 -1. + <_> + 2 5 2 7 2. + <_> + 4 12 2 7 2. + <_> + + <_> + 2 5 18 12 -1. + <_> + 11 5 9 6 2. + <_> + 2 11 9 6 2. + <_> + + <_> + 3 0 6 5 -1. + <_> + 6 0 3 5 2. + <_> + + <_> + 9 0 3 20 -1. + <_> + 10 0 1 20 3. + <_> + + <_> + 1 0 6 16 -1. + <_> + 1 8 6 8 2. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 1 3 15 4 -1. + <_> + 6 3 5 4 3. + <_> + + <_> + 8 4 5 16 -1. + <_> + 8 12 5 8 2. + <_> + + <_> + 1 12 7 6 -1. + <_> + 1 14 7 2 3. + <_> + + <_> + 17 5 3 12 -1. + <_> + 17 11 3 6 2. + <_> + + <_> + 1 3 15 3 -1. + <_> + 1 4 15 1 3. + <_> + + <_> + 8 5 4 12 -1. + <_> + 8 9 4 4 3. + <_> + + <_> + 8 7 3 10 -1. + <_> + 8 12 3 5 2. + <_> + + <_> + 4 1 14 3 -1. + <_> + 4 2 14 1 3. + <_> + + <_> + 0 5 3 12 -1. + <_> + 0 11 3 6 2. + <_> + + <_> + 1 13 18 6 -1. + <_> + 7 13 6 6 3. + <_> + + <_> + 7 3 4 7 -1. + <_> + 9 3 2 7 2. + <_> + + <_> + 8 7 9 5 -1. + <_> + 11 7 3 5 3. + <_> + + <_> + 3 7 9 5 -1. + <_> + 6 7 3 5 3. + <_> + + <_> + 10 10 8 10 -1. + <_> + 14 10 4 5 2. + <_> + 10 15 4 5 2. + <_> + + <_> + 2 10 8 10 -1. + <_> + 2 10 4 5 2. + <_> + 6 15 4 5 2. + <_> + + <_> + 8 14 10 6 -1. + <_> + 13 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 3 12 7 6 -1. + <_> + 3 14 7 2 3. + <_> + + <_> + 8 3 5 8 -1. + <_> + 8 7 5 4 2. + <_> + + <_> + 7 0 6 8 -1. + <_> + 7 4 6 4 2. + <_> + + <_> + 10 0 7 6 -1. + <_> + 10 2 7 2 3. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 7 12 13 3 -1. + <_> + 7 13 13 1 3. + <_> + + <_> + 1 3 18 4 -1. + <_> + 1 3 9 2 2. + <_> + 10 5 9 2 2. + <_> + + <_> + 6 1 8 8 -1. + <_> + 10 1 4 4 2. + <_> + 6 5 4 4 2. + <_> + + <_> + 8 6 4 7 -1. + <_> + 10 6 2 7 2. + <_> + + <_> + 2 4 18 6 -1. + <_> + 11 4 9 3 2. + <_> + 2 7 9 3 2. + <_> + + <_> + 1 5 8 8 -1. + <_> + 1 5 4 4 2. + <_> + 5 9 4 4 2. + <_> + + <_> + 14 0 2 13 -1. + <_> + 14 0 1 13 2. + <_> + + <_> + 4 0 2 13 -1. + <_> + 5 0 1 13 2. + <_> + + <_> + 7 3 12 3 -1. + <_> + 7 3 6 3 2. + <_> + + <_> + 1 3 12 3 -1. + <_> + 7 3 6 3 2. + <_> + + <_> + 7 1 6 7 -1. + <_> + 9 1 2 7 3. + <_> + + <_> + 5 2 6 12 -1. + <_> + 7 2 2 12 3. + <_> + + <_> + 9 5 6 12 -1. + <_> + 12 5 3 6 2. + <_> + 9 11 3 6 2. + <_> + + <_> + 5 5 6 12 -1. + <_> + 5 5 3 6 2. + <_> + 8 11 3 6 2. + <_> + + <_> + 5 9 14 3 -1. + <_> + 5 10 14 1 3. + <_> + + <_> + 1 3 18 12 -1. + <_> + 1 3 9 6 2. + <_> + 10 9 9 6 2. + <_> + + <_> + 3 11 14 4 -1. + <_> + 10 11 7 2 2. + <_> + 3 13 7 2 2. + <_> + + <_> + 4 6 4 14 -1. + <_> + 4 6 2 7 2. + <_> + 6 13 2 7 2. + <_> + + <_> + 11 11 4 7 -1. + <_> + 11 11 2 7 2. + <_> + + <_> + 5 11 4 7 -1. + <_> + 7 11 2 7 2. + <_> + + <_> + 6 6 10 3 -1. + <_> + 6 6 5 3 2. + <_> + + <_> + 1 3 18 4 -1. + <_> + 7 3 6 4 3. + <_> + + <_> + 13 4 7 6 -1. + <_> + 13 6 7 2 3. + <_> + + <_> + 3 8 14 3 -1. + <_> + 10 8 7 3 2. + <_> + + <_> + 9 4 2 13 -1. + <_> + 9 4 1 13 2. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 10 0 7 6 -1. + <_> + 10 2 7 2 3. + <_> + + <_> + 3 0 7 6 -1. + <_> + 3 2 7 2 3. + <_> + + <_> + 2 0 16 3 -1. + <_> + 2 1 16 1 3. + <_> + + <_> + 2 9 7 4 -1. + <_> + 2 11 7 2 2. + <_> + + <_> + 4 7 16 8 -1. + <_> + 12 7 8 4 2. + <_> + 4 11 8 4 2. + <_> + + <_> + 0 7 16 8 -1. + <_> + 0 7 8 4 2. + <_> + 8 11 8 4 2. + <_> + + <_> + 7 12 10 6 -1. + <_> + 12 12 5 3 2. + <_> + 7 15 5 3 2. + <_> + + <_> + 3 12 10 6 -1. + <_> + 3 12 5 3 2. + <_> + 8 15 5 3 2. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 4 5 4 8 -1. + <_> + 4 9 4 4 2. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 2 4 14 3 -1. + <_> + 2 5 14 1 3. + <_> + + <_> + 2 3 18 4 -1. + <_> + 11 3 9 2 2. + <_> + 2 5 9 2 2. + <_> + + <_> + 5 0 10 18 -1. + <_> + 5 6 10 6 3. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 0 3 14 4 -1. + <_> + 0 3 7 2 2. + <_> + 7 5 7 2 2. + <_> + + <_> + 13 4 3 15 -1. + <_> + 14 4 1 15 3. + <_> + + <_> + 4 4 3 15 -1. + <_> + 5 4 1 15 3. + <_> + + <_> + 14 4 6 10 -1. + <_> + 16 4 2 10 3. + <_> + + <_> + 0 4 6 10 -1. + <_> + 2 4 2 10 3. + <_> + + <_> + 8 5 4 14 -1. + <_> + 10 5 2 7 2. + <_> + 8 12 2 7 2. + <_> + + <_> + 4 6 12 12 -1. + <_> + 4 6 6 6 2. + <_> + 10 12 6 6 2. + <_> + + <_> + 9 1 3 19 -1. + <_> + 10 1 1 19 3. + <_> + + <_> + 2 1 3 17 -1. + <_> + 3 1 1 17 3. + <_> + + <_> + 2 7 18 4 -1. + <_> + 8 7 6 4 3. + <_> + + <_> + 1 10 8 6 -1. + <_> + 1 12 8 2 3. + <_> + + <_> + 9 9 9 8 -1. + <_> + 12 9 3 8 3. + <_> + + <_> + 0 0 20 15 -1. + <_> + 0 5 20 5 3. + <_> + + <_> + 3 1 14 6 -1. + <_> + 3 4 14 3 2. + <_> + + <_> + 0 2 7 4 -1. + <_> + 0 4 7 2 2. + <_> + + <_> + 16 2 3 15 -1. + <_> + 17 2 1 15 3. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 2 16 14 4 -1. + <_> + 2 16 7 2 2. + <_> + 9 18 7 2 2. + <_> + + <_> + 16 2 3 15 -1. + <_> + 17 2 1 15 3. + <_> + + <_> + 3 0 8 8 -1. + <_> + 3 0 4 4 2. + <_> + 7 4 4 4 2. + <_> + + <_> + 5 10 14 3 -1. + <_> + 5 11 14 1 3. + <_> + + <_> + 1 9 16 4 -1. + <_> + 1 11 16 2 2. + <_> + + <_> + 8 7 5 8 -1. + <_> + 8 11 5 4 2. + <_> + + <_> + 1 2 3 15 -1. + <_> + 2 2 1 15 3. + <_> + + <_> + 14 11 6 8 -1. + <_> + 16 11 2 8 3. + <_> + + <_> + 0 11 6 8 -1. + <_> + 2 11 2 8 3. + <_> + + <_> + 14 8 6 12 -1. + <_> + 17 8 3 6 2. + <_> + 14 14 3 6 2. + <_> + + <_> + 0 8 6 12 -1. + <_> + 0 8 3 6 2. + <_> + 3 14 3 6 2. + <_> + + <_> + 15 0 3 20 -1. + <_> + 16 0 1 20 3. + <_> + + <_> + 2 0 3 20 -1. + <_> + 3 0 1 20 3. + <_> + + <_> + 8 9 8 4 -1. + <_> + 8 9 4 4 2. + <_> + + <_> + 6 9 6 10 -1. + <_> + 9 9 3 10 2. + <_> + + <_> + 9 9 9 8 -1. + <_> + 12 9 3 8 3. + <_> + + <_> + 2 9 9 8 -1. + <_> + 5 9 3 8 3. + <_> + + <_> + 12 5 6 15 -1. + <_> + 14 5 2 15 3. + <_> + + <_> + 1 2 9 5 -1. + <_> + 4 2 3 5 3. + <_> + + <_> + 9 1 3 19 -1. + <_> + 10 1 1 19 3. + <_> + + <_> + 8 1 3 19 -1. + <_> + 9 1 1 19 3. + <_> + + <_> + 6 6 10 3 -1. + <_> + 6 6 5 3 2. + <_> + + <_> + 4 6 10 3 -1. + <_> + 9 6 5 3 2. + <_> + + <_> + 6 3 10 10 -1. + <_> + 6 3 5 10 2. + <_> + + <_> + 3 0 12 5 -1. + <_> + 9 0 6 5 2. + <_> + + <_> + 8 1 10 16 -1. + <_> + 13 1 5 8 2. + <_> + 8 9 5 8 2. + <_> + + <_> + 4 8 8 4 -1. + <_> + 8 8 4 4 2. + <_> + + <_> + 9 16 9 4 -1. + <_> + 9 18 9 2 2. + <_> + + <_> + 0 14 8 6 -1. + <_> + 4 14 4 6 2. + <_> + + <_> + 12 5 6 15 -1. + <_> + 14 5 2 15 3. + <_> + + <_> + 2 5 6 15 -1. + <_> + 4 5 2 15 3. + <_> + + <_> + 11 0 9 17 -1. + <_> + 14 0 3 17 3. + <_> + + <_> + 0 0 9 17 -1. + <_> + 3 0 3 17 3. + <_> + + <_> + 3 8 17 2 -1. + <_> + 3 9 17 1 2. + <_> + + <_> + 6 1 7 4 -1. + <_> + 6 3 7 2 2. + <_> + + <_> + 4 2 12 4 -1. + <_> + 4 4 12 2 2. + <_> + + <_> + 1 8 14 3 -1. + <_> + 1 9 14 1 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 3 13 13 3 -1. + <_> + 3 14 13 1 3. + <_> + + <_> + 1 5 19 12 -1. + <_> + 1 9 19 4 3. + <_> + + <_> + 2 3 13 15 -1. + <_> + 2 8 13 5 3. + <_> + + <_> + 5 1 15 6 -1. + <_> + 10 1 5 6 3. + <_> + + <_> + 0 0 18 3 -1. + <_> + 6 0 6 3 3. + <_> + + <_> + 15 9 5 9 -1. + <_> + 15 12 5 3 3. + <_> + + <_> + 3 12 14 4 -1. + <_> + 3 14 14 2 2. + <_> + + <_> + 7 14 13 2 -1. + <_> + 7 15 13 1 2. + <_> + + <_> + 0 9 5 9 -1. + <_> + 0 12 5 3 3. + <_> + + <_> + 14 5 5 15 -1. + <_> + 14 10 5 5 3. + <_> + + <_> + 1 5 5 15 -1. + <_> + 1 10 5 5 3. + <_> + + <_> + 8 3 6 17 -1. + <_> + 10 3 2 17 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 4 7 12 8 -1. + <_> + 4 11 12 4 2. + <_> + + <_> + 5 3 2 14 -1. + <_> + 5 10 2 7 2. + <_> + + <_> + 9 3 4 8 -1. + <_> + 9 7 4 4 2. + <_> + + <_> + 3 5 9 15 -1. + <_> + 3 10 9 5 3. + <_> + + <_> + 9 5 3 12 -1. + <_> + 9 11 3 6 2. + <_> + + <_> + 4 3 6 14 -1. + <_> + 4 3 3 7 2. + <_> + 7 10 3 7 2. + <_> + + <_> + 9 8 3 10 -1. + <_> + 9 13 3 5 2. + <_> + + <_> + 0 4 20 8 -1. + <_> + 0 4 10 4 2. + <_> + 10 8 10 4 2. + <_> + + <_> + 6 11 10 6 -1. + <_> + 11 11 5 3 2. + <_> + 6 14 5 3 2. + <_> + + <_> + 2 9 8 8 -1. + <_> + 2 9 4 4 2. + <_> + 6 13 4 4 2. + <_> + + <_> + 6 9 14 2 -1. + <_> + 6 9 7 2 2. + <_> + + <_> + 0 9 14 2 -1. + <_> + 7 9 7 2 2. + <_> + + <_> + 2 4 18 12 -1. + <_> + 8 4 6 12 3. + <_> + + <_> + 7 4 6 8 -1. + <_> + 9 4 2 8 3. + <_> + + <_> + 9 3 6 12 -1. + <_> + 12 3 3 6 2. + <_> + 9 9 3 6 2. + <_> + + <_> + 6 9 5 9 -1. + <_> + 6 12 5 3 3. + <_> + + <_> + 0 1 20 8 -1. + <_> + 10 1 10 4 2. + <_> + 0 5 10 4 2. + <_> + + <_> + 6 3 6 17 -1. + <_> + 8 3 2 17 3. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 5 2. + <_> + 14 15 3 5 2. + <_> + + <_> + 0 10 6 10 -1. + <_> + 0 10 3 5 2. + <_> + 3 15 3 5 2. + <_> + + <_> + 16 12 4 8 -1. + <_> + 16 12 2 8 2. + <_> + + <_> + 0 12 4 8 -1. + <_> + 2 12 2 8 2. + <_> + + <_> + 9 3 6 7 -1. + <_> + 11 3 2 7 3. + <_> + + <_> + 6 6 6 11 -1. + <_> + 8 6 2 11 3. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 5 4 15 4 -1. + <_> + 5 6 15 2 2. + <_> + + <_> + 5 5 6 5 -1. + <_> + 8 5 3 5 2. + <_> + + <_> + 12 1 6 11 -1. + <_> + 14 1 2 11 3. + <_> + + <_> + 0 11 20 3 -1. + <_> + 0 12 20 1 3. + <_> + + <_> + 12 1 6 11 -1. + <_> + 14 1 2 11 3. + <_> + + <_> + 2 1 6 11 -1. + <_> + 4 1 2 11 3. + <_> + + <_> + 10 9 4 8 -1. + <_> + 10 13 4 4 2. + <_> + + <_> + 0 7 7 6 -1. + <_> + 0 9 7 2 3. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 7 0 3 13 -1. + <_> + 8 0 1 13 3. + <_> + + <_> + 15 7 5 6 -1. + <_> + 15 10 5 3 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 11 10 4 8 -1. + <_> + 11 14 4 4 2. + <_> + + <_> + 0 7 5 6 -1. + <_> + 0 10 5 3 2. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 2 0 14 3 -1. + <_> + 2 1 14 1 3. + <_> + + <_> + 4 4 13 2 -1. + <_> + 4 5 13 1 2. + <_> + + <_> + 0 18 20 2 -1. + <_> + 0 19 20 1 2. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 0 0 6 5 -1. + <_> + 3 0 3 5 2. + <_> + + <_> + 6 0 8 14 -1. + <_> + 10 0 4 7 2. + <_> + 6 7 4 7 2. + <_> + + <_> + 0 2 6 12 -1. + <_> + 2 2 2 12 3. + <_> + + <_> + 6 12 9 6 -1. + <_> + 9 12 3 6 3. + <_> + + <_> + 2 0 7 4 -1. + <_> + 2 2 7 2 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 5 0 6 10 -1. + <_> + 5 0 3 5 2. + <_> + 8 5 3 5 2. + <_> + + <_> + 18 7 2 13 -1. + <_> + 18 7 1 13 2. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 18 6 2 13 -1. + <_> + 18 6 1 13 2. + <_> + + <_> + 0 6 2 13 -1. + <_> + 1 6 1 13 2. + <_> + + <_> + 16 7 4 13 -1. + <_> + 16 7 2 13 2. + <_> + + <_> + 6 5 7 6 -1. + <_> + 6 7 7 2 3. + <_> + + <_> + 6 11 10 6 -1. + <_> + 11 11 5 3 2. + <_> + 6 14 5 3 2. + <_> + + <_> + 5 9 6 5 -1. + <_> + 8 9 3 5 2. + <_> + + <_> + 10 3 4 15 -1. + <_> + 10 3 2 15 2. + <_> + + <_> + 6 3 4 15 -1. + <_> + 8 3 2 15 2. + <_> + + <_> + 6 7 13 2 -1. + <_> + 6 8 13 1 2. + <_> + + <_> + 2 15 16 4 -1. + <_> + 2 15 8 2 2. + <_> + 10 17 8 2 2. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 0 7 4 13 -1. + <_> + 2 7 2 13 2. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 5 11 10 9 -1. + <_> + 5 14 10 3 3. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 0 0 3 13 -1. + <_> + 1 0 1 13 3. + <_> + + <_> + 9 6 4 12 -1. + <_> + 9 12 4 6 2. + <_> + + <_> + 0 3 2 16 -1. + <_> + 0 11 2 8 2. + <_> + + <_> + 0 15 20 4 -1. + <_> + 10 15 10 2 2. + <_> + 0 17 10 2 2. + <_> + + <_> + 0 15 9 4 -1. + <_> + 0 17 9 2 2. + <_> + + <_> + 9 14 10 6 -1. + <_> + 14 14 5 3 2. + <_> + 9 17 5 3 2. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 4 15 13 3 -1. + <_> + 4 16 13 1 3. + <_> + + <_> + 0 0 18 4 -1. + <_> + 0 0 9 2 2. + <_> + 9 2 9 2 2. + <_> + + <_> + 6 5 8 15 -1. + <_> + 6 10 8 5 3. + <_> + + <_> + 0 0 6 7 -1. + <_> + 2 0 2 7 3. + <_> + + <_> + 14 1 6 12 -1. + <_> + 16 1 2 12 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 18 1 2 13 -1. + <_> + 18 1 1 13 2. + <_> + + <_> + 0 1 10 19 -1. + <_> + 5 1 5 19 2. + <_> + + <_> + 14 2 4 10 -1. + <_> + 14 2 2 10 2. + <_> + + <_> + 0 3 4 16 -1. + <_> + 0 3 2 8 2. + <_> + 2 11 2 8 2. + <_> + + <_> + 6 0 10 6 -1. + <_> + 11 0 5 3 2. + <_> + 6 3 5 3 2. + <_> + + <_> + 1 14 10 6 -1. + <_> + 1 14 5 3 2. + <_> + 6 17 5 3 2. + <_> + + <_> + 8 7 5 9 -1. + <_> + 8 10 5 3 3. + <_> + + <_> + 2 2 4 10 -1. + <_> + 4 2 2 10 2. + <_> + + <_> + 11 11 7 4 -1. + <_> + 11 13 7 2 2. + <_> + + <_> + 5 6 10 12 -1. + <_> + 5 6 5 6 2. + <_> + 10 12 5 6 2. + <_> + + <_> + 9 2 4 12 -1. + <_> + 9 6 4 4 3. + <_> + + <_> + 2 0 15 6 -1. + <_> + 2 3 15 3 2. + <_> + + <_> + 6 0 13 8 -1. + <_> + 6 4 13 4 2. + <_> + + <_> + 1 0 13 8 -1. + <_> + 1 4 13 4 2. + <_> + + <_> + 11 4 2 14 -1. + <_> + 11 11 2 7 2. + <_> + + <_> + 0 1 20 3 -1. + <_> + 0 2 20 1 3. + <_> + + <_> + 8 5 6 10 -1. + <_> + 11 5 3 5 2. + <_> + 8 10 3 5 2. + <_> + + <_> + 4 8 10 12 -1. + <_> + 9 8 5 12 2. + <_> + + <_> + 8 5 6 5 -1. + <_> + 8 5 3 5 2. + <_> + + <_> + 6 5 6 5 -1. + <_> + 9 5 3 5 2. + <_> + + <_> + 13 0 6 7 -1. + <_> + 15 0 2 7 3. + <_> + + <_> + 1 0 6 7 -1. + <_> + 3 0 2 7 3. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 0 17 18 3 -1. + <_> + 6 17 6 3 3. + <_> + + <_> + 6 7 12 8 -1. + <_> + 10 7 4 8 3. + <_> + + <_> + 0 14 18 5 -1. + <_> + 6 14 6 5 3. + <_> + + <_> + 0 13 20 4 -1. + <_> + 10 13 10 2 2. + <_> + 0 15 10 2 2. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 11 11 7 4 -1. + <_> + 11 13 7 2 2. + <_> + + <_> + 2 12 7 6 -1. + <_> + 2 14 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 8 8 6 -1. + <_> + 0 10 8 2 3. + <_> + + <_> + 4 8 15 2 -1. + <_> + 4 9 15 1 2. + <_> + + <_> + 0 9 6 5 -1. + <_> + 3 9 3 5 2. + <_> + + <_> + 13 9 6 5 -1. + <_> + 13 9 3 5 2. + <_> + + <_> + 1 9 6 5 -1. + <_> + 4 9 3 5 2. + <_> + + <_> + 13 0 4 14 -1. + <_> + 15 0 2 7 2. + <_> + 13 7 2 7 2. + <_> + + <_> + 0 0 14 19 -1. + <_> + 7 0 7 19 2. + <_> + + <_> + 13 0 4 14 -1. + <_> + 15 0 2 7 2. + <_> + 13 7 2 7 2. + <_> + + <_> + 3 0 4 14 -1. + <_> + 3 0 2 7 2. + <_> + 5 7 2 7 2. + <_> + + <_> + 13 4 7 6 -1. + <_> + 13 6 7 2 3. + <_> + + <_> + 2 4 14 3 -1. + <_> + 2 5 14 1 3. + <_> + + <_> + 12 0 2 15 -1. + <_> + 12 0 1 15 2. + <_> + + <_> + 7 6 4 12 -1. + <_> + 7 12 4 6 2. + <_> + + <_> + 6 2 14 18 -1. + <_> + 13 2 7 9 2. + <_> + 6 11 7 9 2. + <_> + + <_> + 5 9 9 6 -1. + <_> + 5 12 9 3 2. + <_> + + <_> + 0 1 20 18 -1. + <_> + 10 1 10 9 2. + <_> + 0 10 10 9 2. + <_> + + <_> + 4 10 7 4 -1. + <_> + 4 12 7 2 2. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 1 0 14 12 -1. + <_> + 1 4 14 4 3. + <_> + + <_> + 9 0 6 8 -1. + <_> + 9 0 3 8 2. + <_> + + <_> + 4 2 12 5 -1. + <_> + 8 2 4 5 3. + <_> + + <_> + 12 0 2 15 -1. + <_> + 12 0 1 15 2. + <_> + + <_> + 4 0 8 10 -1. + <_> + 8 0 4 10 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 9 2 2 13 -1. + <_> + 9 2 1 13 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 0 4 18 10 -1. + <_> + 0 4 9 5 2. + <_> + 9 9 9 5 2. + <_> + + <_> + 12 9 7 6 -1. + <_> + 12 11 7 2 3. + <_> + + <_> + 1 9 7 6 -1. + <_> + 1 11 7 2 3. + <_> + + <_> + 4 3 16 6 -1. + <_> + 12 3 8 3 2. + <_> + 4 6 8 3 2. + <_> + + <_> + 3 4 5 9 -1. + <_> + 3 7 5 3 3. + <_> + + <_> + 8 4 12 5 -1. + <_> + 12 4 4 5 3. + <_> + + <_> + 3 9 8 4 -1. + <_> + 3 11 8 2 2. + <_> + + <_> + 11 0 2 15 -1. + <_> + 11 0 1 15 2. + <_> + + <_> + 7 0 2 15 -1. + <_> + 8 0 1 15 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 8 3 4 8 -1. + <_> + 10 3 2 8 2. + <_> + + <_> + 9 13 6 7 -1. + <_> + 11 13 2 7 3. + <_> + + <_> + 4 14 9 5 -1. + <_> + 7 14 3 5 3. + <_> + + <_> + 15 3 4 17 -1. + <_> + 15 3 2 17 2. + <_> + + <_> + 1 6 4 13 -1. + <_> + 3 6 2 13 2. + <_> + + <_> + 11 12 4 7 -1. + <_> + 11 12 2 7 2. + <_> + + <_> + 0 1 6 7 -1. + <_> + 2 1 2 7 3. + <_> + + <_> + 9 12 6 7 -1. + <_> + 11 12 2 7 3. + <_> + + <_> + 5 12 6 7 -1. + <_> + 7 12 2 7 3. + <_> + + <_> + 7 7 6 8 -1. + <_> + 9 7 2 8 3. + <_> + + <_> + 0 14 8 6 -1. + <_> + 0 16 8 2 3. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 5 13 13 3 -1. + <_> + 5 14 13 1 3. + <_> + + <_> + 2 9 14 3 -1. + <_> + 2 10 14 1 3. + <_> + + <_> + 8 7 7 4 -1. + <_> + 8 9 7 2 2. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 13 12 5 6 -1. + <_> + 13 15 5 3 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 4 5 16 3 -1. + <_> + 4 5 8 3 2. + <_> + + <_> + 5 3 4 14 -1. + <_> + 5 10 4 7 2. + <_> + + <_> + 4 13 15 5 -1. + <_> + 9 13 5 5 3. + <_> + + <_> + 0 3 14 2 -1. + <_> + 0 4 14 1 2. + <_> + + <_> + 4 13 15 5 -1. + <_> + 9 13 5 5 3. + <_> + + <_> + 1 13 15 5 -1. + <_> + 6 13 5 5 3. + <_> + + <_> + 12 0 8 6 -1. + <_> + 12 2 8 2 3. + <_> + + <_> + 3 10 6 5 -1. + <_> + 6 10 3 5 2. + <_> + + <_> + 4 7 14 8 -1. + <_> + 11 7 7 4 2. + <_> + 4 11 7 4 2. + <_> + + <_> + 2 7 14 8 -1. + <_> + 2 7 7 4 2. + <_> + 9 11 7 4 2. + <_> + + <_> + 11 0 2 20 -1. + <_> + 11 0 1 20 2. + <_> + + <_> + 7 0 2 20 -1. + <_> + 8 0 1 20 2. + <_> + + <_> + 10 5 6 8 -1. + <_> + 12 5 2 8 3. + <_> + + <_> + 8 2 3 13 -1. + <_> + 9 2 1 13 3. + <_> + + <_> + 3 2 14 4 -1. + <_> + 10 2 7 2 2. + <_> + 3 4 7 2 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 8 4 9 16 -1. + <_> + 11 4 3 16 3. + <_> + + <_> + 4 5 6 8 -1. + <_> + 6 5 2 8 3. + <_> + + <_> + 7 10 6 10 -1. + <_> + 10 10 3 5 2. + <_> + 7 15 3 5 2. + <_> + + <_> + 5 11 5 6 -1. + <_> + 5 14 5 3 2. + <_> + + <_> + 4 8 13 8 -1. + <_> + 4 12 13 4 2. + <_> + + <_> + 0 9 10 6 -1. + <_> + 0 9 5 3 2. + <_> + 5 12 5 3 2. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 4 0 5 8 -1. + <_> + 4 4 5 4 2. + <_> + + <_> + 8 1 4 10 -1. + <_> + 8 6 4 5 2. + <_> + + <_> + 6 3 7 10 -1. + <_> + 6 8 7 5 2. + <_> + + <_> + 6 12 13 3 -1. + <_> + 6 13 13 1 3. + <_> + + <_> + 2 13 13 3 -1. + <_> + 2 14 13 1 3. + <_> + + <_> + 12 11 7 4 -1. + <_> + 12 13 7 2 2. + <_> + + <_> + 1 11 7 4 -1. + <_> + 1 13 7 2 2. + <_> + + <_> + 9 12 9 4 -1. + <_> + 9 14 9 2 2. + <_> + + <_> + 2 12 16 4 -1. + <_> + 2 12 8 2 2. + <_> + 10 14 8 2 2. + <_> + + <_> + 10 14 10 6 -1. + <_> + 15 14 5 3 2. + <_> + 10 17 5 3 2. + <_> + + <_> + 4 1 8 8 -1. + <_> + 4 1 4 4 2. + <_> + 8 5 4 4 2. + <_> + + <_> + 2 12 18 7 -1. + <_> + 8 12 6 7 3. + <_> + + <_> + 3 13 12 6 -1. + <_> + 3 13 6 3 2. + <_> + 9 16 6 3 2. + <_> + + <_> + 4 12 13 4 -1. + <_> + 4 14 13 2 2. + <_> + + <_> + 6 0 2 15 -1. + <_> + 7 0 1 15 2. + <_> + + <_> + 4 2 16 18 -1. + <_> + 12 2 8 9 2. + <_> + 4 11 8 9 2. + <_> + + <_> + 1 16 18 4 -1. + <_> + 7 16 6 4 3. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 4 0 12 9 -1. + <_> + 8 0 4 9 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 4 9 6 6 -1. + <_> + 7 9 3 6 2. + <_> + + <_> + 7 12 12 8 -1. + <_> + 13 12 6 4 2. + <_> + 7 16 6 4 2. + <_> + + <_> + 1 12 12 8 -1. + <_> + 1 12 6 4 2. + <_> + 7 16 6 4 2. + <_> + + <_> + 0 10 20 9 -1. + <_> + 0 13 20 3 3. + <_> + + <_> + 4 5 10 6 -1. + <_> + 4 5 5 3 2. + <_> + 9 8 5 3 2. + <_> + + <_> + 13 3 7 6 -1. + <_> + 13 5 7 2 3. + <_> + + <_> + 8 1 4 14 -1. + <_> + 8 1 2 7 2. + <_> + 10 8 2 7 2. + <_> + + <_> + 12 8 5 6 -1. + <_> + 12 11 5 3 2. + <_> + + <_> + 3 8 5 6 -1. + <_> + 3 11 5 3 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 2 0 18 4 -1. + <_> + 8 0 6 4 3. + <_> + + <_> + 6 5 3 14 -1. + <_> + 6 12 3 7 2. + <_> + + <_> + 5 17 15 3 -1. + <_> + 10 17 5 3 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 6 0 3 7 2. + <_> + + <_> + 8 3 12 17 -1. + <_> + 8 3 6 17 2. + <_> + + <_> + 0 2 16 12 -1. + <_> + 8 2 8 12 2. + <_> + + <_> + 7 6 6 12 -1. + <_> + 7 12 6 6 2. + <_> + + <_> + 8 8 4 8 -1. + <_> + 8 12 4 4 2. + <_> + + <_> + 8 7 12 10 -1. + <_> + 14 7 6 5 2. + <_> + 8 12 6 5 2. + <_> + + <_> + 4 1 12 5 -1. + <_> + 10 1 6 5 2. + <_> + + <_> + 7 2 8 8 -1. + <_> + 11 2 4 4 2. + <_> + 7 6 4 4 2. + <_> + + <_> + 5 2 8 8 -1. + <_> + 5 2 4 4 2. + <_> + 9 6 4 4 2. + <_> + + <_> + 3 14 14 6 -1. + <_> + 3 17 14 3 2. + <_> + + <_> + 3 3 5 12 -1. + <_> + 3 7 5 4 3. + <_> + + <_> + 15 4 5 6 -1. + <_> + 15 7 5 3 2. + <_> + + <_> + 0 4 7 6 -1. + <_> + 0 6 7 2 3. + <_> + + <_> + 15 4 5 9 -1. + <_> + 15 7 5 3 3. + <_> + + <_> + 8 6 4 14 -1. + <_> + 8 6 2 7 2. + <_> + 10 13 2 7 2. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 5 0 8 10 -1. + <_> + 5 0 4 5 2. + <_> + 9 5 4 5 2. + <_> + + <_> + 9 12 6 7 -1. + <_> + 11 12 2 7 3. + <_> + + <_> + 5 12 6 7 -1. + <_> + 7 12 2 7 3. + <_> + + <_> + 13 9 7 6 -1. + <_> + 13 11 7 2 3. + <_> + + <_> + 1 1 16 6 -1. + <_> + 1 3 16 2 3. + <_> + + <_> + 2 1 17 6 -1. + <_> + 2 3 17 2 3. + <_> + + <_> + 4 4 2 16 -1. + <_> + 4 12 2 8 2. + <_> + + <_> + 7 6 10 14 -1. + <_> + 12 6 5 7 2. + <_> + 7 13 5 7 2. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 4 9 12 6 -1. + <_> + 10 9 6 3 2. + <_> + 4 12 6 3 2. + <_> + + <_> + 1 8 18 3 -1. + <_> + 7 8 6 3 3. + <_> + + <_> + 2 13 18 7 -1. + <_> + 8 13 6 7 3. + <_> + + <_> + 1 8 15 3 -1. + <_> + 6 8 5 3 3. + <_> + + <_> + 6 0 12 7 -1. + <_> + 10 0 4 7 3. + <_> + + <_> + 3 5 13 3 -1. + <_> + 3 6 13 1 3. + <_> + + <_> + 12 11 8 4 -1. + <_> + 12 13 8 2 2. + <_> + + <_> + 6 7 6 8 -1. + <_> + 6 11 6 4 2. + <_> + + <_> + 9 2 4 12 -1. + <_> + 9 6 4 4 3. + <_> + + <_> + 0 9 7 6 -1. + <_> + 0 11 7 2 3. + <_> + + <_> + 15 4 5 9 -1. + <_> + 15 7 5 3 3. + <_> + + <_> + 2 18 13 2 -1. + <_> + 2 19 13 1 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 6 6 8 12 -1. + <_> + 6 10 8 4 3. + <_> + + <_> + 7 9 6 9 -1. + <_> + 7 12 6 3 3. + <_> + + <_> + 0 7 11 4 -1. + <_> + 0 9 11 2 2. + <_> + + <_> + 8 12 10 6 -1. + <_> + 13 12 5 3 2. + <_> + 8 15 5 3 2. + <_> + + <_> + 2 12 10 6 -1. + <_> + 2 12 5 3 2. + <_> + 7 15 5 3 2. + <_> + + <_> + 12 14 8 6 -1. + <_> + 12 16 8 2 3. + <_> + + <_> + 0 14 8 6 -1. + <_> + 0 16 8 2 3. + <_> + + <_> + 18 2 2 13 -1. + <_> + 18 2 1 13 2. + <_> + + <_> + 4 5 8 8 -1. + <_> + 4 5 4 4 2. + <_> + 8 9 4 4 2. + <_> + + <_> + 18 2 2 13 -1. + <_> + 18 2 1 13 2. + <_> + + <_> + 7 6 4 8 -1. + <_> + 7 10 4 4 2. + <_> + + <_> + 9 8 11 4 -1. + <_> + 9 10 11 2 2. + <_> + + <_> + 6 6 5 10 -1. + <_> + 6 11 5 5 2. + <_> + + <_> + 4 7 14 6 -1. + <_> + 4 9 14 2 3. + <_> + + <_> + 4 4 12 8 -1. + <_> + 4 4 6 4 2. + <_> + 10 8 6 4 2. + <_> + + <_> + 5 5 12 5 -1. + <_> + 5 5 6 5 2. + <_> + + <_> + 1 3 15 12 -1. + <_> + 6 3 5 12 3. + <_> + + <_> + 13 3 6 17 -1. + <_> + 13 3 3 17 2. + <_> + + <_> + 1 3 6 17 -1. + <_> + 4 3 3 17 2. + <_> + + <_> + 14 1 6 9 -1. + <_> + 14 4 6 3 3. + <_> + + <_> + 4 0 8 6 -1. + <_> + 4 3 8 3 2. + <_> + + <_> + 5 4 15 3 -1. + <_> + 5 5 15 1 3. + <_> + + <_> + 0 5 8 4 -1. + <_> + 0 7 8 2 2. + <_> + + <_> + 18 2 2 13 -1. + <_> + 18 2 1 13 2. + <_> + + <_> + 0 2 2 13 -1. + <_> + 1 2 1 13 2. + <_> + + <_> + 18 7 2 13 -1. + <_> + 18 7 1 13 2. + <_> + + <_> + 0 7 2 13 -1. + <_> + 1 7 1 13 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 4 8 13 2 -1. + <_> + 4 9 13 1 2. + <_> + + <_> + 2 12 16 4 -1. + <_> + 2 14 16 2 2. + <_> + + <_> + 6 12 13 3 -1. + <_> + 6 13 13 1 3. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 6 6 10 3 -1. + <_> + 6 6 5 3 2. + <_> + + <_> + 4 6 10 3 -1. + <_> + 9 6 5 3 2. + <_> + + <_> + 6 2 8 6 -1. + <_> + 6 4 8 2 3. + <_> + + <_> + 6 5 7 4 -1. + <_> + 6 7 7 2 2. + <_> + + <_> + 9 5 10 9 -1. + <_> + 9 8 10 3 3. + <_> + + <_> + 0 10 18 4 -1. + <_> + 0 10 9 2 2. + <_> + 9 12 9 2 2. + <_> + + <_> + 8 7 6 9 -1. + <_> + 10 7 2 9 3. + <_> + + <_> + 6 4 4 7 -1. + <_> + 8 4 2 7 2. + <_> + + <_> + 9 6 9 10 -1. + <_> + 12 6 3 10 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 10 14 10 6 -1. + <_> + 15 14 5 3 2. + <_> + 10 17 5 3 2. + <_> + + <_> + 0 6 5 12 -1. + <_> + 0 10 5 4 3. + <_> + + <_> + 9 6 9 10 -1. + <_> + 12 6 3 10 3. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 6 13 10 7 -1. + <_> + 6 13 5 7 2. + <_> + + <_> + 0 2 6 17 -1. + <_> + 3 2 3 17 2. + <_> + + <_> + 10 14 9 5 -1. + <_> + 13 14 3 5 3. + <_> + + <_> + 1 14 9 5 -1. + <_> + 4 14 3 5 3. + <_> + + <_> + 7 13 7 6 -1. + <_> + 7 15 7 2 3. + <_> + + <_> + 1 14 7 6 -1. + <_> + 1 16 7 2 3. + <_> + + <_> + 12 10 8 6 -1. + <_> + 12 12 8 2 3. + <_> + + <_> + 2 6 9 9 -1. + <_> + 5 6 3 9 3. + <_> + + <_> + 12 10 7 6 -1. + <_> + 12 12 7 2 3. + <_> + + <_> + 3 2 4 12 -1. + <_> + 5 2 2 12 2. + <_> + + <_> + 9 1 7 15 -1. + <_> + 9 6 7 5 3. + <_> + + <_> + 6 10 4 7 -1. + <_> + 8 10 2 7 2. + <_> + + <_> + 5 0 10 20 -1. + <_> + 10 0 5 10 2. + <_> + 5 10 5 10 2. + <_> + + <_> + 7 10 6 10 -1. + <_> + 9 10 2 10 3. + <_> + + <_> + 12 7 7 4 -1. + <_> + 12 9 7 2 2. + <_> + + <_> + 2 7 16 4 -1. + <_> + 2 7 8 2 2. + <_> + 10 9 8 2 2. + <_> + + <_> + 5 10 12 10 -1. + <_> + 5 10 6 10 2. + <_> + + <_> + 6 1 2 16 -1. + <_> + 6 9 2 8 2. + <_> + + <_> + 6 2 12 10 -1. + <_> + 6 7 12 5 2. + <_> + + <_> + 2 4 14 6 -1. + <_> + 2 4 7 3 2. + <_> + 9 7 7 3 2. + <_> + + <_> + 5 0 11 12 -1. + <_> + 5 4 11 4 3. + <_> + + <_> + 7 1 6 12 -1. + <_> + 7 5 6 4 3. + <_> + + <_> + 9 8 11 4 -1. + <_> + 9 10 11 2 2. + <_> + + <_> + 0 8 11 4 -1. + <_> + 0 10 11 2 2. + <_> + + <_> + 1 8 19 6 -1. + <_> + 1 11 19 3 2. + <_> + + <_> + 7 0 6 8 -1. + <_> + 7 4 6 4 2. + <_> + + <_> + 5 3 15 2 -1. + <_> + 5 4 15 1 2. + <_> + + <_> + 2 7 14 6 -1. + <_> + 2 9 14 2 3. + <_> + + <_> + 3 0 17 6 -1. + <_> + 3 2 17 2 3. + <_> + + <_> + 0 0 17 6 -1. + <_> + 0 2 17 2 3. + <_> + + <_> + 13 2 7 4 -1. + <_> + 13 4 7 2 2. + <_> + + <_> + 0 2 7 4 -1. + <_> + 0 4 7 2 2. + <_> + + <_> + 8 1 12 10 -1. + <_> + 14 1 6 5 2. + <_> + 8 6 6 5 2. + <_> + + <_> + 2 1 4 8 -1. + <_> + 2 5 4 4 2. + <_> + + <_> + 5 1 11 10 -1. + <_> + 5 6 11 5 2. + <_> + + <_> + 3 9 10 6 -1. + <_> + 3 9 5 3 2. + <_> + 8 12 5 3 2. + <_> + + <_> + 12 7 7 4 -1. + <_> + 12 9 7 2 2. + <_> + + <_> + 2 7 12 8 -1. + <_> + 6 7 4 8 3. + <_> + + <_> + 10 10 8 4 -1. + <_> + 10 10 4 4 2. + <_> + + <_> + 2 10 8 4 -1. + <_> + 6 10 4 4 2. + <_> + + <_> + 3 10 16 3 -1. + <_> + 3 10 8 3 2. + <_> + + <_> + 1 11 6 5 -1. + <_> + 4 11 3 5 2. + <_> + + <_> + 10 7 9 9 -1. + <_> + 13 7 3 9 3. + <_> + + <_> + 1 7 9 9 -1. + <_> + 4 7 3 9 3. + <_> + + <_> + 5 5 12 5 -1. + <_> + 5 5 6 5 2. + <_> + + <_> + 3 5 12 5 -1. + <_> + 9 5 6 5 2. + <_> + + <_> + 2 3 16 2 -1. + <_> + 2 3 8 2 2. + <_> + + <_> + 2 8 7 6 -1. + <_> + 2 10 7 2 3. + <_> + + <_> + 7 8 9 6 -1. + <_> + 7 10 9 2 3. + <_> + + <_> + 3 0 3 15 -1. + <_> + 4 0 1 15 3. + <_> + + <_> + 3 10 16 3 -1. + <_> + 3 10 8 3 2. + <_> + + <_> + 1 10 16 3 -1. + <_> + 9 10 8 3 2. + <_> + + <_> + 12 0 8 19 -1. + <_> + 12 0 4 19 2. + <_> + + <_> + 0 0 8 19 -1. + <_> + 4 0 4 19 2. + <_> + + <_> + 6 14 14 3 -1. + <_> + 6 15 14 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 6 14 14 3 -1. + <_> + 6 15 14 1 3. + <_> + + <_> + 0 12 16 4 -1. + <_> + 0 12 8 2 2. + <_> + 8 14 8 2 2. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 1 14 12 6 -1. + <_> + 1 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 3 3 14 14 -1. + <_> + 10 3 7 7 2. + <_> + 3 10 7 7 2. + <_> + + <_> + 3 6 6 12 -1. + <_> + 5 6 2 12 3. + <_> + + <_> + 5 12 12 6 -1. + <_> + 9 12 4 6 3. + <_> + + <_> + 1 8 14 6 -1. + <_> + 1 8 7 3 2. + <_> + 8 11 7 3 2. + <_> + + <_> + 8 7 12 10 -1. + <_> + 14 7 6 5 2. + <_> + 8 12 6 5 2. + <_> + + <_> + 0 7 12 10 -1. + <_> + 0 7 6 5 2. + <_> + 6 12 6 5 2. + <_> + + <_> + 9 2 6 18 -1. + <_> + 12 2 3 9 2. + <_> + 9 11 3 9 2. + <_> + + <_> + 1 10 8 10 -1. + <_> + 1 10 4 5 2. + <_> + 5 15 4 5 2. + <_> + + <_> + 4 14 12 4 -1. + <_> + 4 16 12 2 2. + <_> + + <_> + 5 13 6 7 -1. + <_> + 7 13 2 7 3. + <_> + + <_> + 5 2 15 5 -1. + <_> + 10 2 5 5 3. + <_> + + <_> + 5 4 9 14 -1. + <_> + 5 11 9 7 2. + <_> + + <_> + 8 0 11 4 -1. + <_> + 8 2 11 2 2. + <_> + + <_> + 0 14 16 6 -1. + <_> + 0 16 16 2 3. + <_> + + <_> + 10 14 8 6 -1. + <_> + 10 16 8 2 3. + <_> + + <_> + 0 15 13 3 -1. + <_> + 0 16 13 1 3. + <_> + + <_> + 5 8 15 3 -1. + <_> + 5 9 15 1 3. + <_> + + <_> + 0 8 19 3 -1. + <_> + 0 9 19 1 3. + <_> + + <_> + 8 16 8 4 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 4 16 8 4 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 9 5 10 9 -1. + <_> + 9 8 10 3 3. + <_> + + <_> + 1 5 10 9 -1. + <_> + 1 8 10 3 3. + <_> + + <_> + 4 7 14 2 -1. + <_> + 4 7 7 2 2. + <_> + + <_> + 2 7 13 2 -1. + <_> + 2 8 13 1 2. + <_> + + <_> + 6 5 8 4 -1. + <_> + 6 7 8 2 2. + <_> + + <_> + 5 12 9 5 -1. + <_> + 8 12 3 5 3. + <_> + + <_> + 3 6 14 3 -1. + <_> + 3 7 14 1 3. + <_> + + <_> + 7 2 4 12 -1. + <_> + 7 6 4 4 3. + <_> + + <_> + 2 4 16 4 -1. + <_> + 2 6 16 2 2. + <_> + + <_> + 1 4 9 4 -1. + <_> + 1 6 9 2 2. + <_> + + <_> + 9 4 11 4 -1. + <_> + 9 6 11 2 2. + <_> + + <_> + 4 5 8 8 -1. + <_> + 4 5 4 4 2. + <_> + 8 9 4 4 2. + <_> + + <_> + 1 5 18 3 -1. + <_> + 7 5 6 3 3. + <_> + + <_> + 1 0 15 7 -1. + <_> + 6 0 5 7 3. + <_> + + <_> + 12 0 5 15 -1. + <_> + 12 5 5 5 3. + <_> + + <_> + 3 0 5 15 -1. + <_> + 3 5 5 5 3. + <_> + + <_> + 8 5 6 8 -1. + <_> + 10 5 2 8 3. + <_> + + <_> + 8 3 4 7 -1. + <_> + 10 3 2 7 2. + <_> + + <_> + 4 6 12 11 -1. + <_> + 8 6 4 11 3. + <_> + + <_> + 1 7 18 4 -1. + <_> + 1 9 18 2 2. + <_> + + <_> + 8 5 6 8 -1. + <_> + 10 5 2 8 3. + <_> + + <_> + 7 2 6 5 -1. + <_> + 10 2 3 5 2. + <_> + + <_> + 9 0 4 7 -1. + <_> + 9 0 2 7 2. + <_> + + <_> + 0 0 7 6 -1. + <_> + 0 2 7 2 3. + <_> + + <_> + 13 0 7 6 -1. + <_> + 13 2 7 2 3. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 5 4 15 4 -1. + <_> + 5 6 15 2 2. + <_> + + <_> + 5 5 6 5 -1. + <_> + 8 5 3 5 2. + <_> + + <_> + 12 1 6 11 -1. + <_> + 14 1 2 11 3. + <_> + + <_> + 0 11 20 3 -1. + <_> + 0 12 20 1 3. + <_> + + <_> + 12 1 6 11 -1. + <_> + 14 1 2 11 3. + <_> + + <_> + 2 1 6 11 -1. + <_> + 4 1 2 11 3. + <_> + + <_> + 10 9 4 8 -1. + <_> + 10 13 4 4 2. + <_> + + <_> + 0 7 7 6 -1. + <_> + 0 9 7 2 3. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 7 0 3 13 -1. + <_> + 8 0 1 13 3. + <_> + + <_> + 15 7 5 6 -1. + <_> + 15 10 5 3 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 11 10 4 8 -1. + <_> + 11 14 4 4 2. + <_> + + <_> + 0 7 5 6 -1. + <_> + 0 10 5 3 2. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 2 0 14 3 -1. + <_> + 2 1 14 1 3. + <_> + + <_> + 4 4 13 2 -1. + <_> + 4 5 13 1 2. + <_> + + <_> + 0 18 20 2 -1. + <_> + 0 19 20 1 2. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 0 0 6 5 -1. + <_> + 3 0 3 5 2. + <_> + + <_> + 6 0 8 14 -1. + <_> + 10 0 4 7 2. + <_> + 6 7 4 7 2. + <_> + + <_> + 0 2 6 12 -1. + <_> + 2 2 2 12 3. + <_> + + <_> + 6 12 9 6 -1. + <_> + 9 12 3 6 3. + <_> + + <_> + 2 0 7 4 -1. + <_> + 2 2 7 2 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 5 0 6 10 -1. + <_> + 5 0 3 5 2. + <_> + 8 5 3 5 2. + <_> + + <_> + 18 7 2 13 -1. + <_> + 18 7 1 13 2. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 18 6 2 13 -1. + <_> + 18 6 1 13 2. + <_> + + <_> + 0 6 2 13 -1. + <_> + 1 6 1 13 2. + <_> + + <_> + 16 7 4 13 -1. + <_> + 16 7 2 13 2. + <_> + + <_> + 6 5 7 6 -1. + <_> + 6 7 7 2 3. + <_> + + <_> + 6 11 10 6 -1. + <_> + 11 11 5 3 2. + <_> + 6 14 5 3 2. + <_> + + <_> + 5 9 6 5 -1. + <_> + 8 9 3 5 2. + <_> + + <_> + 10 3 4 15 -1. + <_> + 10 3 2 15 2. + <_> + + <_> + 6 3 4 15 -1. + <_> + 8 3 2 15 2. + <_> + + <_> + 6 7 13 2 -1. + <_> + 6 8 13 1 2. + <_> + + <_> + 2 15 16 4 -1. + <_> + 2 15 8 2 2. + <_> + 10 17 8 2 2. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 0 7 4 13 -1. + <_> + 2 7 2 13 2. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 5 11 10 9 -1. + <_> + 5 14 10 3 3. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 0 0 3 13 -1. + <_> + 1 0 1 13 3. + <_> + + <_> + 9 6 4 12 -1. + <_> + 9 12 4 6 2. + <_> + + <_> + 0 3 2 16 -1. + <_> + 0 11 2 8 2. + <_> + + <_> + 0 15 20 4 -1. + <_> + 10 15 10 2 2. + <_> + 0 17 10 2 2. + <_> + + <_> + 0 15 9 4 -1. + <_> + 0 17 9 2 2. + <_> + + <_> + 9 14 10 6 -1. + <_> + 14 14 5 3 2. + <_> + 9 17 5 3 2. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 4 15 13 3 -1. + <_> + 4 16 13 1 3. + <_> + + <_> + 0 0 18 4 -1. + <_> + 0 0 9 2 2. + <_> + 9 2 9 2 2. + <_> + + <_> + 6 5 8 15 -1. + <_> + 6 10 8 5 3. + <_> + + <_> + 0 0 6 7 -1. + <_> + 2 0 2 7 3. + <_> + + <_> + 14 1 6 12 -1. + <_> + 16 1 2 12 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 18 1 2 13 -1. + <_> + 18 1 1 13 2. + <_> + + <_> + 0 1 10 19 -1. + <_> + 5 1 5 19 2. + <_> + + <_> + 14 2 4 10 -1. + <_> + 14 2 2 10 2. + <_> + + <_> + 0 3 4 16 -1. + <_> + 0 3 2 8 2. + <_> + 2 11 2 8 2. + <_> + + <_> + 6 0 10 6 -1. + <_> + 11 0 5 3 2. + <_> + 6 3 5 3 2. + <_> + + <_> + 1 14 10 6 -1. + <_> + 1 14 5 3 2. + <_> + 6 17 5 3 2. + <_> + + <_> + 8 7 5 9 -1. + <_> + 8 10 5 3 3. + <_> + + <_> + 2 2 4 10 -1. + <_> + 4 2 2 10 2. + <_> + + <_> + 11 11 7 4 -1. + <_> + 11 13 7 2 2. + <_> + + <_> + 5 6 10 12 -1. + <_> + 5 6 5 6 2. + <_> + 10 12 5 6 2. + <_> + + <_> + 9 2 4 12 -1. + <_> + 9 6 4 4 3. + <_> + + <_> + 2 0 15 6 -1. + <_> + 2 3 15 3 2. + <_> + + <_> + 6 0 13 8 -1. + <_> + 6 4 13 4 2. + <_> + + <_> + 1 0 13 8 -1. + <_> + 1 4 13 4 2. + <_> + + <_> + 11 4 2 14 -1. + <_> + 11 11 2 7 2. + <_> + + <_> + 0 1 20 3 -1. + <_> + 0 2 20 1 3. + <_> + + <_> + 8 5 6 10 -1. + <_> + 11 5 3 5 2. + <_> + 8 10 3 5 2. + <_> + + <_> + 4 8 10 12 -1. + <_> + 9 8 5 12 2. + <_> + + <_> + 8 5 6 5 -1. + <_> + 8 5 3 5 2. + <_> + + <_> + 6 5 6 5 -1. + <_> + 9 5 3 5 2. + <_> + + <_> + 13 0 6 7 -1. + <_> + 15 0 2 7 3. + <_> + + <_> + 1 0 6 7 -1. + <_> + 3 0 2 7 3. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 0 17 18 3 -1. + <_> + 6 17 6 3 3. + <_> + + <_> + 6 7 12 8 -1. + <_> + 10 7 4 8 3. + <_> + + <_> + 0 14 18 5 -1. + <_> + 6 14 6 5 3. + <_> + + <_> + 0 13 20 4 -1. + <_> + 10 13 10 2 2. + <_> + 0 15 10 2 2. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 11 11 7 4 -1. + <_> + 11 13 7 2 2. + <_> + + <_> + 2 12 7 6 -1. + <_> + 2 14 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 8 8 6 -1. + <_> + 0 10 8 2 3. + <_> + + <_> + 4 8 15 2 -1. + <_> + 4 9 15 1 2. + <_> + + <_> + 0 9 6 5 -1. + <_> + 3 9 3 5 2. + <_> + + <_> + 13 9 6 5 -1. + <_> + 13 9 3 5 2. + <_> + + <_> + 1 9 6 5 -1. + <_> + 4 9 3 5 2. + <_> + + <_> + 13 0 4 14 -1. + <_> + 15 0 2 7 2. + <_> + 13 7 2 7 2. + <_> + + <_> + 0 0 14 19 -1. + <_> + 7 0 7 19 2. + <_> + + <_> + 13 0 4 14 -1. + <_> + 15 0 2 7 2. + <_> + 13 7 2 7 2. + <_> + + <_> + 3 0 4 14 -1. + <_> + 3 0 2 7 2. + <_> + 5 7 2 7 2. + <_> + + <_> + 13 4 7 6 -1. + <_> + 13 6 7 2 3. + <_> + + <_> + 2 4 14 3 -1. + <_> + 2 5 14 1 3. + <_> + + <_> + 12 0 2 15 -1. + <_> + 12 0 1 15 2. + <_> + + <_> + 7 6 4 12 -1. + <_> + 7 12 4 6 2. + <_> + + <_> + 6 2 14 18 -1. + <_> + 13 2 7 9 2. + <_> + 6 11 7 9 2. + <_> + + <_> + 5 9 9 6 -1. + <_> + 5 12 9 3 2. + <_> + + <_> + 0 1 20 18 -1. + <_> + 10 1 10 9 2. + <_> + 0 10 10 9 2. + <_> + + <_> + 4 10 7 4 -1. + <_> + 4 12 7 2 2. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 1 0 14 12 -1. + <_> + 1 4 14 4 3. + <_> + + <_> + 9 0 6 8 -1. + <_> + 9 0 3 8 2. + <_> + + <_> + 4 2 12 5 -1. + <_> + 8 2 4 5 3. + <_> + + <_> + 12 0 2 15 -1. + <_> + 12 0 1 15 2. + <_> + + <_> + 4 0 8 10 -1. + <_> + 8 0 4 10 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 9 2 2 13 -1. + <_> + 9 2 1 13 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 0 4 18 10 -1. + <_> + 0 4 9 5 2. + <_> + 9 9 9 5 2. + <_> + + <_> + 12 9 7 6 -1. + <_> + 12 11 7 2 3. + <_> + + <_> + 1 9 7 6 -1. + <_> + 1 11 7 2 3. + <_> + + <_> + 4 3 16 6 -1. + <_> + 12 3 8 3 2. + <_> + 4 6 8 3 2. + <_> + + <_> + 3 4 5 9 -1. + <_> + 3 7 5 3 3. + <_> + + <_> + 8 4 12 5 -1. + <_> + 12 4 4 5 3. + <_> + + <_> + 3 9 8 4 -1. + <_> + 3 11 8 2 2. + <_> + + <_> + 11 0 2 15 -1. + <_> + 11 0 1 15 2. + <_> + + <_> + 7 0 2 15 -1. + <_> + 8 0 1 15 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 8 3 4 8 -1. + <_> + 10 3 2 8 2. + <_> + + <_> + 9 13 6 7 -1. + <_> + 11 13 2 7 3. + <_> + + <_> + 4 14 9 5 -1. + <_> + 7 14 3 5 3. + <_> + + <_> + 15 3 4 17 -1. + <_> + 15 3 2 17 2. + <_> + + <_> + 1 6 4 13 -1. + <_> + 3 6 2 13 2. + <_> + + <_> + 11 12 4 7 -1. + <_> + 11 12 2 7 2. + <_> + + <_> + 0 1 6 7 -1. + <_> + 2 1 2 7 3. + <_> + + <_> + 9 12 6 7 -1. + <_> + 11 12 2 7 3. + <_> + + <_> + 5 12 6 7 -1. + <_> + 7 12 2 7 3. + <_> + + <_> + 7 7 6 8 -1. + <_> + 9 7 2 8 3. + <_> + + <_> + 0 14 8 6 -1. + <_> + 0 16 8 2 3. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 5 13 13 3 -1. + <_> + 5 14 13 1 3. + <_> + + <_> + 2 9 14 3 -1. + <_> + 2 10 14 1 3. + <_> + + <_> + 8 7 7 4 -1. + <_> + 8 9 7 2 2. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 13 12 5 6 -1. + <_> + 13 15 5 3 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 4 5 16 3 -1. + <_> + 4 5 8 3 2. + <_> + + <_> + 5 3 4 14 -1. + <_> + 5 10 4 7 2. + <_> + + <_> + 4 13 15 5 -1. + <_> + 9 13 5 5 3. + <_> + + <_> + 0 3 14 2 -1. + <_> + 0 4 14 1 2. + <_> + + <_> + 4 13 15 5 -1. + <_> + 9 13 5 5 3. + <_> + + <_> + 1 13 15 5 -1. + <_> + 6 13 5 5 3. + <_> + + <_> + 12 0 8 6 -1. + <_> + 12 2 8 2 3. + <_> + + <_> + 3 10 6 5 -1. + <_> + 6 10 3 5 2. + <_> + + <_> + 4 7 14 8 -1. + <_> + 11 7 7 4 2. + <_> + 4 11 7 4 2. + <_> + + <_> + 2 7 14 8 -1. + <_> + 2 7 7 4 2. + <_> + 9 11 7 4 2. + <_> + + <_> + 11 0 2 20 -1. + <_> + 11 0 1 20 2. + <_> + + <_> + 7 0 2 20 -1. + <_> + 8 0 1 20 2. + <_> + + <_> + 10 5 6 8 -1. + <_> + 12 5 2 8 3. + <_> + + <_> + 8 2 3 13 -1. + <_> + 9 2 1 13 3. + <_> + + <_> + 3 2 14 4 -1. + <_> + 10 2 7 2 2. + <_> + 3 4 7 2 2. + <_> + + <_> + 7 5 6 7 -1. + <_> + 9 5 2 7 3. + <_> + + <_> + 8 4 9 16 -1. + <_> + 11 4 3 16 3. + <_> + + <_> + 4 5 6 8 -1. + <_> + 6 5 2 8 3. + <_> + + <_> + 7 10 6 10 -1. + <_> + 10 10 3 5 2. + <_> + 7 15 3 5 2. + <_> + + <_> + 5 11 5 6 -1. + <_> + 5 14 5 3 2. + <_> + + <_> + 4 8 13 8 -1. + <_> + 4 12 13 4 2. + <_> + + <_> + 0 9 10 6 -1. + <_> + 0 9 5 3 2. + <_> + 5 12 5 3 2. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 4 0 5 8 -1. + <_> + 4 4 5 4 2. + <_> + + <_> + 8 1 4 10 -1. + <_> + 8 6 4 5 2. + <_> + + <_> + 6 3 7 10 -1. + <_> + 6 8 7 5 2. + <_> + + <_> + 6 12 13 3 -1. + <_> + 6 13 13 1 3. + <_> + + <_> + 2 13 13 3 -1. + <_> + 2 14 13 1 3. + <_> + + <_> + 12 11 7 4 -1. + <_> + 12 13 7 2 2. + <_> + + <_> + 1 11 7 4 -1. + <_> + 1 13 7 2 2. + <_> + + <_> + 9 12 9 4 -1. + <_> + 9 14 9 2 2. + <_> + + <_> + 2 12 16 4 -1. + <_> + 2 12 8 2 2. + <_> + 10 14 8 2 2. + <_> + + <_> + 10 14 10 6 -1. + <_> + 15 14 5 3 2. + <_> + 10 17 5 3 2. + <_> + + <_> + 4 1 8 8 -1. + <_> + 4 1 4 4 2. + <_> + 8 5 4 4 2. + <_> + + <_> + 2 12 18 7 -1. + <_> + 8 12 6 7 3. + <_> + + <_> + 3 13 12 6 -1. + <_> + 3 13 6 3 2. + <_> + 9 16 6 3 2. + <_> + + <_> + 4 12 13 4 -1. + <_> + 4 14 13 2 2. + <_> + + <_> + 6 0 2 15 -1. + <_> + 7 0 1 15 2. + <_> + + <_> + 4 2 16 18 -1. + <_> + 12 2 8 9 2. + <_> + 4 11 8 9 2. + <_> + + <_> + 1 16 18 4 -1. + <_> + 7 16 6 4 3. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 4 0 12 9 -1. + <_> + 8 0 4 9 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 4 9 6 6 -1. + <_> + 7 9 3 6 2. + <_> + + <_> + 7 12 12 8 -1. + <_> + 13 12 6 4 2. + <_> + 7 16 6 4 2. + <_> + + <_> + 1 12 12 8 -1. + <_> + 1 12 6 4 2. + <_> + 7 16 6 4 2. + <_> + + <_> + 0 10 20 9 -1. + <_> + 0 13 20 3 3. + <_> + + <_> + 4 5 10 6 -1. + <_> + 4 5 5 3 2. + <_> + 9 8 5 3 2. + <_> + + <_> + 13 3 7 6 -1. + <_> + 13 5 7 2 3. + <_> + + <_> + 8 1 4 14 -1. + <_> + 8 1 2 7 2. + <_> + 10 8 2 7 2. + <_> + + <_> + 12 8 5 6 -1. + <_> + 12 11 5 3 2. + <_> + + <_> + 3 8 5 6 -1. + <_> + 3 11 5 3 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 2 0 18 4 -1. + <_> + 8 0 6 4 3. + <_> + + <_> + 6 5 3 14 -1. + <_> + 6 12 3 7 2. + <_> + + <_> + 5 17 15 3 -1. + <_> + 10 17 5 3 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 6 0 3 7 2. + <_> + + <_> + 8 3 12 17 -1. + <_> + 8 3 6 17 2. + <_> + + <_> + 0 2 16 12 -1. + <_> + 8 2 8 12 2. + <_> + + <_> + 7 6 6 12 -1. + <_> + 7 12 6 6 2. + <_> + + <_> + 8 8 4 8 -1. + <_> + 8 12 4 4 2. + <_> + + <_> + 8 7 12 10 -1. + <_> + 14 7 6 5 2. + <_> + 8 12 6 5 2. + <_> + + <_> + 4 1 12 5 -1. + <_> + 10 1 6 5 2. + <_> + + <_> + 7 2 8 8 -1. + <_> + 11 2 4 4 2. + <_> + 7 6 4 4 2. + <_> + + <_> + 5 2 8 8 -1. + <_> + 5 2 4 4 2. + <_> + 9 6 4 4 2. + <_> + + <_> + 3 14 14 6 -1. + <_> + 3 17 14 3 2. + <_> + + <_> + 3 3 5 12 -1. + <_> + 3 7 5 4 3. + <_> + + <_> + 15 4 5 6 -1. + <_> + 15 7 5 3 2. + <_> + + <_> + 0 4 7 6 -1. + <_> + 0 6 7 2 3. + <_> + + <_> + 15 4 5 9 -1. + <_> + 15 7 5 3 3. + <_> + + <_> + 8 6 4 14 -1. + <_> + 8 6 2 7 2. + <_> + 10 13 2 7 2. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 5 0 8 10 -1. + <_> + 5 0 4 5 2. + <_> + 9 5 4 5 2. + <_> + + <_> + 9 12 6 7 -1. + <_> + 11 12 2 7 3. + <_> + + <_> + 5 12 6 7 -1. + <_> + 7 12 2 7 3. + <_> + + <_> + 13 9 7 6 -1. + <_> + 13 11 7 2 3. + <_> + + <_> + 1 1 16 6 -1. + <_> + 1 3 16 2 3. + <_> + + <_> + 2 1 17 6 -1. + <_> + 2 3 17 2 3. + <_> + + <_> + 4 4 2 16 -1. + <_> + 4 12 2 8 2. + <_> + + <_> + 7 6 10 14 -1. + <_> + 12 6 5 7 2. + <_> + 7 13 5 7 2. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 4 9 12 6 -1. + <_> + 10 9 6 3 2. + <_> + 4 12 6 3 2. + <_> + + <_> + 1 8 18 3 -1. + <_> + 7 8 6 3 3. + <_> + + <_> + 2 13 18 7 -1. + <_> + 8 13 6 7 3. + <_> + + <_> + 1 8 15 3 -1. + <_> + 6 8 5 3 3. + <_> + + <_> + 6 0 12 7 -1. + <_> + 10 0 4 7 3. + <_> + + <_> + 3 5 13 3 -1. + <_> + 3 6 13 1 3. + <_> + + <_> + 12 11 8 4 -1. + <_> + 12 13 8 2 2. + <_> + + <_> + 6 7 6 8 -1. + <_> + 6 11 6 4 2. + <_> + + <_> + 9 2 4 12 -1. + <_> + 9 6 4 4 3. + <_> + + <_> + 0 9 7 6 -1. + <_> + 0 11 7 2 3. + <_> + + <_> + 15 4 5 9 -1. + <_> + 15 7 5 3 3. + <_> + + <_> + 2 18 13 2 -1. + <_> + 2 19 13 1 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 6 6 8 12 -1. + <_> + 6 10 8 4 3. + <_> + + <_> + 7 9 6 9 -1. + <_> + 7 12 6 3 3. + <_> + + <_> + 0 7 11 4 -1. + <_> + 0 9 11 2 2. + <_> + + <_> + 8 12 10 6 -1. + <_> + 13 12 5 3 2. + <_> + 8 15 5 3 2. + <_> + + <_> + 2 12 10 6 -1. + <_> + 2 12 5 3 2. + <_> + 7 15 5 3 2. + <_> + + <_> + 12 14 8 6 -1. + <_> + 12 16 8 2 3. + <_> + + <_> + 0 14 8 6 -1. + <_> + 0 16 8 2 3. + <_> + + <_> + 18 2 2 13 -1. + <_> + 18 2 1 13 2. + <_> + + <_> + 4 5 8 8 -1. + <_> + 4 5 4 4 2. + <_> + 8 9 4 4 2. + <_> + + <_> + 18 2 2 13 -1. + <_> + 18 2 1 13 2. + <_> + + <_> + 7 6 4 8 -1. + <_> + 7 10 4 4 2. + <_> + + <_> + 9 8 11 4 -1. + <_> + 9 10 11 2 2. + <_> + + <_> + 6 6 5 10 -1. + <_> + 6 11 5 5 2. + <_> + + <_> + 4 7 14 6 -1. + <_> + 4 9 14 2 3. + <_> + + <_> + 4 4 12 8 -1. + <_> + 4 4 6 4 2. + <_> + 10 8 6 4 2. + <_> + + <_> + 5 5 12 5 -1. + <_> + 5 5 6 5 2. + <_> + + <_> + 1 3 15 12 -1. + <_> + 6 3 5 12 3. + <_> + + <_> + 13 3 6 17 -1. + <_> + 13 3 3 17 2. + <_> + + <_> + 1 3 6 17 -1. + <_> + 4 3 3 17 2. + <_> + + <_> + 14 1 6 9 -1. + <_> + 14 4 6 3 3. + <_> + + <_> + 4 0 8 6 -1. + <_> + 4 3 8 3 2. + <_> + + <_> + 5 4 15 3 -1. + <_> + 5 5 15 1 3. + <_> + + <_> + 0 5 8 4 -1. + <_> + 0 7 8 2 2. + <_> + + <_> + 18 2 2 13 -1. + <_> + 18 2 1 13 2. + <_> + + <_> + 0 2 2 13 -1. + <_> + 1 2 1 13 2. + <_> + + <_> + 18 7 2 13 -1. + <_> + 18 7 1 13 2. + <_> + + <_> + 0 7 2 13 -1. + <_> + 1 7 1 13 2. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 4 8 13 2 -1. + <_> + 4 9 13 1 2. + <_> + + <_> + 2 12 16 4 -1. + <_> + 2 14 16 2 2. + <_> + + <_> + 6 12 13 3 -1. + <_> + 6 13 13 1 3. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 6 6 10 3 -1. + <_> + 6 6 5 3 2. + <_> + + <_> + 4 6 10 3 -1. + <_> + 9 6 5 3 2. + <_> + + <_> + 6 2 8 6 -1. + <_> + 6 4 8 2 3. + <_> + + <_> + 6 5 7 4 -1. + <_> + 6 7 7 2 2. + <_> + + <_> + 9 5 10 9 -1. + <_> + 9 8 10 3 3. + <_> + + <_> + 0 10 18 4 -1. + <_> + 0 10 9 2 2. + <_> + 9 12 9 2 2. + <_> + + <_> + 8 7 6 9 -1. + <_> + 10 7 2 9 3. + <_> + + <_> + 6 4 4 7 -1. + <_> + 8 4 2 7 2. + <_> + + <_> + 9 6 9 10 -1. + <_> + 12 6 3 10 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 10 14 10 6 -1. + <_> + 15 14 5 3 2. + <_> + 10 17 5 3 2. + <_> + + <_> + 0 6 5 12 -1. + <_> + 0 10 5 4 3. + <_> + + <_> + 9 6 9 10 -1. + <_> + 12 6 3 10 3. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 6 13 10 7 -1. + <_> + 6 13 5 7 2. + <_> + + <_> + 0 2 6 17 -1. + <_> + 3 2 3 17 2. + <_> + + <_> + 10 14 9 5 -1. + <_> + 13 14 3 5 3. + <_> + + <_> + 1 14 9 5 -1. + <_> + 4 14 3 5 3. + <_> + + <_> + 7 13 7 6 -1. + <_> + 7 15 7 2 3. + <_> + + <_> + 1 14 7 6 -1. + <_> + 1 16 7 2 3. + <_> + + <_> + 12 10 8 6 -1. + <_> + 12 12 8 2 3. + <_> + + <_> + 2 6 9 9 -1. + <_> + 5 6 3 9 3. + <_> + + <_> + 12 10 7 6 -1. + <_> + 12 12 7 2 3. + <_> + + <_> + 3 2 4 12 -1. + <_> + 5 2 2 12 2. + <_> + + <_> + 9 1 7 15 -1. + <_> + 9 6 7 5 3. + <_> + + <_> + 6 10 4 7 -1. + <_> + 8 10 2 7 2. + <_> + + <_> + 5 0 10 20 -1. + <_> + 10 0 5 10 2. + <_> + 5 10 5 10 2. + <_> + + <_> + 7 10 6 10 -1. + <_> + 9 10 2 10 3. + <_> + + <_> + 12 7 7 4 -1. + <_> + 12 9 7 2 2. + <_> + + <_> + 2 7 16 4 -1. + <_> + 2 7 8 2 2. + <_> + 10 9 8 2 2. + <_> + + <_> + 5 10 12 10 -1. + <_> + 5 10 6 10 2. + <_> + + <_> + 6 1 2 16 -1. + <_> + 6 9 2 8 2. + <_> + + <_> + 6 2 12 10 -1. + <_> + 6 7 12 5 2. + <_> + + <_> + 2 4 14 6 -1. + <_> + 2 4 7 3 2. + <_> + 9 7 7 3 2. + <_> + + <_> + 5 0 11 12 -1. + <_> + 5 4 11 4 3. + <_> + + <_> + 7 1 6 12 -1. + <_> + 7 5 6 4 3. + <_> + + <_> + 9 8 11 4 -1. + <_> + 9 10 11 2 2. + <_> + + <_> + 0 8 11 4 -1. + <_> + 0 10 11 2 2. + <_> + + <_> + 1 8 19 6 -1. + <_> + 1 11 19 3 2. + <_> + + <_> + 7 0 6 8 -1. + <_> + 7 4 6 4 2. + <_> + + <_> + 5 3 15 2 -1. + <_> + 5 4 15 1 2. + <_> + + <_> + 2 7 14 6 -1. + <_> + 2 9 14 2 3. + <_> + + <_> + 3 0 17 6 -1. + <_> + 3 2 17 2 3. + <_> + + <_> + 0 0 17 6 -1. + <_> + 0 2 17 2 3. + <_> + + <_> + 13 2 7 4 -1. + <_> + 13 4 7 2 2. + <_> + + <_> + 0 2 7 4 -1. + <_> + 0 4 7 2 2. + <_> + + <_> + 8 1 12 10 -1. + <_> + 14 1 6 5 2. + <_> + 8 6 6 5 2. + <_> + + <_> + 2 1 4 8 -1. + <_> + 2 5 4 4 2. + <_> + + <_> + 5 1 11 10 -1. + <_> + 5 6 11 5 2. + <_> + + <_> + 3 9 10 6 -1. + <_> + 3 9 5 3 2. + <_> + 8 12 5 3 2. + <_> + + <_> + 12 7 7 4 -1. + <_> + 12 9 7 2 2. + <_> + + <_> + 2 7 12 8 -1. + <_> + 6 7 4 8 3. + <_> + + <_> + 10 10 8 4 -1. + <_> + 10 10 4 4 2. + <_> + + <_> + 2 10 8 4 -1. + <_> + 6 10 4 4 2. + <_> + + <_> + 3 10 16 3 -1. + <_> + 3 10 8 3 2. + <_> + + <_> + 1 11 6 5 -1. + <_> + 4 11 3 5 2. + <_> + + <_> + 10 7 9 9 -1. + <_> + 13 7 3 9 3. + <_> + + <_> + 1 7 9 9 -1. + <_> + 4 7 3 9 3. + <_> + + <_> + 5 5 12 5 -1. + <_> + 5 5 6 5 2. + <_> + + <_> + 3 5 12 5 -1. + <_> + 9 5 6 5 2. + <_> + + <_> + 2 3 16 2 -1. + <_> + 2 3 8 2 2. + <_> + + <_> + 2 8 7 6 -1. + <_> + 2 10 7 2 3. + <_> + + <_> + 7 8 9 6 -1. + <_> + 7 10 9 2 3. + <_> + + <_> + 3 0 3 15 -1. + <_> + 4 0 1 15 3. + <_> + + <_> + 3 10 16 3 -1. + <_> + 3 10 8 3 2. + <_> + + <_> + 1 10 16 3 -1. + <_> + 9 10 8 3 2. + <_> + + <_> + 12 0 8 19 -1. + <_> + 12 0 4 19 2. + <_> + + <_> + 0 0 8 19 -1. + <_> + 4 0 4 19 2. + <_> + + <_> + 6 14 14 3 -1. + <_> + 6 15 14 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 6 14 14 3 -1. + <_> + 6 15 14 1 3. + <_> + + <_> + 0 12 16 4 -1. + <_> + 0 12 8 2 2. + <_> + 8 14 8 2 2. + <_> + + <_> + 7 14 12 6 -1. + <_> + 13 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 1 14 12 6 -1. + <_> + 1 14 6 3 2. + <_> + 7 17 6 3 2. + <_> + + <_> + 3 3 14 14 -1. + <_> + 10 3 7 7 2. + <_> + 3 10 7 7 2. + <_> + + <_> + 3 6 6 12 -1. + <_> + 5 6 2 12 3. + <_> + + <_> + 5 12 12 6 -1. + <_> + 9 12 4 6 3. + <_> + + <_> + 1 8 14 6 -1. + <_> + 1 8 7 3 2. + <_> + 8 11 7 3 2. + <_> + + <_> + 8 7 12 10 -1. + <_> + 14 7 6 5 2. + <_> + 8 12 6 5 2. + <_> + + <_> + 0 7 12 10 -1. + <_> + 0 7 6 5 2. + <_> + 6 12 6 5 2. + <_> + + <_> + 9 2 6 18 -1. + <_> + 12 2 3 9 2. + <_> + 9 11 3 9 2. + <_> + + <_> + 1 10 8 10 -1. + <_> + 1 10 4 5 2. + <_> + 5 15 4 5 2. + <_> + + <_> + 4 14 12 4 -1. + <_> + 4 16 12 2 2. + <_> + + <_> + 5 13 6 7 -1. + <_> + 7 13 2 7 3. + <_> + + <_> + 5 2 15 5 -1. + <_> + 10 2 5 5 3. + <_> + + <_> + 5 4 9 14 -1. + <_> + 5 11 9 7 2. + <_> + + <_> + 8 0 11 4 -1. + <_> + 8 2 11 2 2. + <_> + + <_> + 0 14 16 6 -1. + <_> + 0 16 16 2 3. + <_> + + <_> + 10 14 8 6 -1. + <_> + 10 16 8 2 3. + <_> + + <_> + 0 15 13 3 -1. + <_> + 0 16 13 1 3. + <_> + + <_> + 5 8 15 3 -1. + <_> + 5 9 15 1 3. + <_> + + <_> + 0 8 19 3 -1. + <_> + 0 9 19 1 3. + <_> + + <_> + 8 16 8 4 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 4 16 8 4 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 9 5 10 9 -1. + <_> + 9 8 10 3 3. + <_> + + <_> + 1 5 10 9 -1. + <_> + 1 8 10 3 3. + <_> + + <_> + 4 7 14 2 -1. + <_> + 4 7 7 2 2. + <_> + + <_> + 2 7 13 2 -1. + <_> + 2 8 13 1 2. + <_> + + <_> + 6 5 8 4 -1. + <_> + 6 7 8 2 2. + <_> + + <_> + 5 12 9 5 -1. + <_> + 8 12 3 5 3. + <_> + + <_> + 3 6 14 3 -1. + <_> + 3 7 14 1 3. + <_> + + <_> + 7 2 4 12 -1. + <_> + 7 6 4 4 3. + <_> + + <_> + 2 4 16 4 -1. + <_> + 2 6 16 2 2. + <_> + + <_> + 1 4 9 4 -1. + <_> + 1 6 9 2 2. + <_> + + <_> + 9 4 11 4 -1. + <_> + 9 6 11 2 2. + <_> + + <_> + 4 5 8 8 -1. + <_> + 4 5 4 4 2. + <_> + 8 9 4 4 2. + <_> + + <_> + 1 5 18 3 -1. + <_> + 7 5 6 3 3. + <_> + + <_> + 1 0 15 7 -1. + <_> + 6 0 5 7 3. + <_> + + <_> + 12 0 5 15 -1. + <_> + 12 5 5 5 3. + <_> + + <_> + 3 0 5 15 -1. + <_> + 3 5 5 5 3. + <_> + + <_> + 8 5 6 8 -1. + <_> + 10 5 2 8 3. + <_> + + <_> + 8 3 4 7 -1. + <_> + 10 3 2 7 2. + <_> + + <_> + 4 6 12 11 -1. + <_> + 8 6 4 11 3. + <_> + + <_> + 1 7 18 4 -1. + <_> + 1 9 18 2 2. + <_> + + <_> + 8 5 6 8 -1. + <_> + 10 5 2 8 3. + <_> + + <_> + 7 2 6 5 -1. + <_> + 10 2 3 5 2. + <_> + + <_> + 9 0 4 7 -1. + <_> + 9 0 2 7 2. + <_> + + <_> + 0 0 7 6 -1. + <_> + 0 2 7 2 3. + <_> + + <_> + 13 0 7 6 -1. + <_> + 13 2 7 2 3. + <_> + + <_> + 1 1 8 4 -1. + <_> + 5 1 4 4 2. + <_> + + <_> + 7 4 7 6 -1. + <_> + 7 6 7 2 3. + <_> + + <_> + 4 5 10 12 -1. + <_> + 4 5 5 6 2. + <_> + 9 11 5 6 2. + <_> + + <_> + 8 12 11 8 -1. + <_> + 8 16 11 4 2. + <_> + + <_> + 5 5 9 5 -1. + <_> + 8 5 3 5 3. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 0 2 14 -1. + <_> + 1 0 1 14 2. + <_> + + <_> + 11 9 3 10 -1. + <_> + 11 14 3 5 2. + <_> + + <_> + 3 17 13 3 -1. + <_> + 3 18 13 1 3. + <_> + + <_> + 6 10 13 3 -1. + <_> + 6 11 13 1 3. + <_> + + <_> + 1 2 18 6 -1. + <_> + 1 2 9 3 2. + <_> + 10 5 9 3 2. + <_> + + <_> + 6 1 12 8 -1. + <_> + 12 1 6 4 2. + <_> + 6 5 6 4 2. + <_> + + <_> + 4 1 12 8 -1. + <_> + 4 1 6 4 2. + <_> + 10 5 6 4 2. + <_> + + <_> + 4 3 13 3 -1. + <_> + 4 4 13 1 3. + <_> + + <_> + 1 6 12 4 -1. + <_> + 5 6 4 4 3. + <_> + + <_> + 14 2 6 5 -1. + <_> + 14 2 3 5 2. + <_> + + <_> + 3 12 13 2 -1. + <_> + 3 13 13 1 2. + <_> + + <_> + 12 11 7 6 -1. + <_> + 12 13 7 2 3. + <_> + + <_> + 1 0 4 7 -1. + <_> + 3 0 2 7 2. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 11 0 9 6 -1. + <_> + 14 0 3 6 3. + <_> + + <_> + 6 9 3 10 -1. + <_> + 6 14 3 5 2. + <_> + + <_> + 10 9 6 5 -1. + <_> + 10 9 3 5 2. + <_> + + <_> + 6 7 3 12 -1. + <_> + 6 13 3 6 2. + <_> + + <_> + 11 0 9 6 -1. + <_> + 14 0 3 6 3. + <_> + + <_> + 0 0 9 6 -1. + <_> + 3 0 3 6 3. + <_> + + <_> + 4 6 12 3 -1. + <_> + 4 6 6 3 2. + <_> + + <_> + 6 4 6 8 -1. + <_> + 8 4 2 8 3. + <_> + + <_> + 11 0 3 13 -1. + <_> + 12 0 1 13 3. + <_> + + <_> + 6 0 3 13 -1. + <_> + 7 0 1 13 3. + <_> + + <_> + 4 14 13 2 -1. + <_> + 4 15 13 1 2. + <_> + + <_> + 1 11 7 6 -1. + <_> + 1 13 7 2 3. + <_> + + <_> + 13 5 4 8 -1. + <_> + 13 9 4 4 2. + <_> + + <_> + 4 16 12 4 -1. + <_> + 8 16 4 4 3. + <_> + + <_> + 11 9 6 8 -1. + <_> + 11 9 3 8 2. + <_> + + <_> + 3 9 6 8 -1. + <_> + 6 9 3 8 2. + <_> + + <_> + 10 6 10 6 -1. + <_> + 15 6 5 3 2. + <_> + 10 9 5 3 2. + <_> + + <_> + 3 5 13 3 -1. + <_> + 3 6 13 1 3. + <_> + + <_> + 10 6 10 6 -1. + <_> + 15 6 5 3 2. + <_> + 10 9 5 3 2. + <_> + + <_> + 2 0 14 9 -1. + <_> + 2 3 14 3 3. + <_> + + <_> + 10 6 10 6 -1. + <_> + 15 6 5 3 2. + <_> + 10 9 5 3 2. + <_> + + <_> + 0 6 10 6 -1. + <_> + 0 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 9 5 4 12 -1. + <_> + 9 11 4 6 2. + <_> + + <_> + 2 4 10 6 -1. + <_> + 2 4 5 3 2. + <_> + 7 7 5 3 2. + <_> + + <_> + 9 1 8 16 -1. + <_> + 13 1 4 8 2. + <_> + 9 9 4 8 2. + <_> + + <_> + 2 1 14 8 -1. + <_> + 2 5 14 4 2. + <_> + + <_> + 12 10 7 6 -1. + <_> + 12 12 7 2 3. + <_> + + <_> + 0 8 6 9 -1. + <_> + 3 8 3 9 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 0 0 16 2 -1. + <_> + 0 1 16 1 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 2 13 14 4 -1. + <_> + 2 13 7 2 2. + <_> + 9 15 7 2 2. + <_> + + <_> + 7 5 9 7 -1. + <_> + 10 5 3 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 13 5 4 8 -1. + <_> + 13 9 4 4 2. + <_> + + <_> + 6 1 6 10 -1. + <_> + 6 6 6 5 2. + <_> + + <_> + 0 3 20 8 -1. + <_> + 0 7 20 4 2. + <_> + + <_> + 4 0 12 8 -1. + <_> + 10 0 6 8 2. + <_> + + <_> + 2 1 18 19 -1. + <_> + 8 1 6 19 3. + <_> + + <_> + 0 1 18 19 -1. + <_> + 6 1 6 19 3. + <_> + + <_> + 8 1 12 19 -1. + <_> + 8 1 6 19 2. + <_> + + <_> + 0 1 12 19 -1. + <_> + 6 1 6 19 2. + <_> + + <_> + 0 0 20 10 -1. + <_> + 10 0 10 5 2. + <_> + 0 5 10 5 2. + <_> + + <_> + 0 4 13 3 -1. + <_> + 0 5 13 1 3. + <_> + + <_> + 3 2 14 2 -1. + <_> + 3 3 14 1 2. + <_> + + <_> + 1 4 13 3 -1. + <_> + 1 5 13 1 3. + <_> + + <_> + 13 12 7 4 -1. + <_> + 13 14 7 2 2. + <_> + + <_> + 2 1 4 19 -1. + <_> + 4 1 2 19 2. + <_> + + <_> + 12 10 7 6 -1. + <_> + 12 12 7 2 3. + <_> + + <_> + 3 9 13 3 -1. + <_> + 3 10 13 1 3. + <_> + + <_> + 4 8 14 3 -1. + <_> + 4 9 14 1 3. + <_> + + <_> + 4 5 12 9 -1. + <_> + 4 8 12 3 3. + <_> + + <_> + 6 15 13 3 -1. + <_> + 6 16 13 1 3. + <_> + + <_> + 0 12 7 4 -1. + <_> + 0 14 7 2 2. + <_> + + <_> + 5 2 14 18 -1. + <_> + 12 2 7 9 2. + <_> + 5 11 7 9 2. + <_> + + <_> + 7 5 4 12 -1. + <_> + 7 11 4 6 2. + <_> + + <_> + 5 2 14 18 -1. + <_> + 12 2 7 9 2. + <_> + 5 11 7 9 2. + <_> + + <_> + 1 2 14 18 -1. + <_> + 1 2 7 9 2. + <_> + 8 11 7 9 2. + <_> + + <_> + 6 10 8 10 -1. + <_> + 10 10 4 5 2. + <_> + 6 15 4 5 2. + <_> + + <_> + 3 5 4 8 -1. + <_> + 3 9 4 4 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 10 10 4 4 2. + <_> + 6 14 4 4 2. + <_> + + <_> + 1 10 7 6 -1. + <_> + 1 12 7 2 3. + <_> + + <_> + 4 14 13 3 -1. + <_> + 4 15 13 1 3. + <_> + + <_> + 6 11 6 9 -1. + <_> + 8 11 2 9 3. + <_> + + <_> + 7 5 9 7 -1. + <_> + 10 5 3 7 3. + <_> + + <_> + 0 10 19 6 -1. + <_> + 0 13 19 3 2. + <_> + + <_> + 4 1 12 10 -1. + <_> + 4 6 12 5 2. + <_> + + <_> + 0 12 8 6 -1. + <_> + 0 14 8 2 3. + <_> + + <_> + 5 10 13 3 -1. + <_> + 5 11 13 1 3. + <_> + + <_> + 0 5 20 2 -1. + <_> + 0 6 20 1 2. + <_> + + <_> + 2 0 17 6 -1. + <_> + 2 2 17 2 3. + <_> + + <_> + 3 14 10 6 -1. + <_> + 3 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 6 0 9 11 -1. + <_> + 9 0 3 11 3. + <_> + + <_> + 0 2 6 11 -1. + <_> + 2 2 2 11 3. + <_> + + <_> + 14 0 6 7 -1. + <_> + 16 0 2 7 3. + <_> + + <_> + 0 8 9 12 -1. + <_> + 3 8 3 12 3. + <_> + + <_> + 13 10 7 6 -1. + <_> + 13 12 7 2 3. + <_> + + <_> + 0 10 7 6 -1. + <_> + 0 12 7 2 3. + <_> + + <_> + 14 0 6 7 -1. + <_> + 16 0 2 7 3. + <_> + + <_> + 0 0 6 7 -1. + <_> + 2 0 2 7 3. + <_> + + <_> + 8 0 9 15 -1. + <_> + 11 0 3 15 3. + <_> + + <_> + 3 5 12 11 -1. + <_> + 7 5 4 11 3. + <_> + + <_> + 6 15 13 3 -1. + <_> + 6 16 13 1 3. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 7 5 9 7 -1. + <_> + 10 5 3 7 3. + <_> + + <_> + 7 6 3 14 -1. + <_> + 8 6 1 14 3. + <_> + + <_> + 5 1 13 3 -1. + <_> + 5 2 13 1 3. + <_> + + <_> + 8 1 3 13 -1. + <_> + 9 1 1 13 3. + <_> + + <_> + 9 6 4 14 -1. + <_> + 11 6 2 7 2. + <_> + 9 13 2 7 2. + <_> + + <_> + 6 9 8 10 -1. + <_> + 6 9 4 5 2. + <_> + 10 14 4 5 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 0 15 14 5 -1. + <_> + 7 15 7 5 2. + <_> + + <_> + 12 12 8 5 -1. + <_> + 12 12 4 5 2. + <_> + + <_> + 0 14 10 6 -1. + <_> + 0 16 10 2 3. + <_> + + <_> + 4 16 14 4 -1. + <_> + 4 18 14 2 2. + <_> + + <_> + 6 1 6 18 -1. + <_> + 8 1 2 18 3. + <_> + + <_> + 6 14 14 2 -1. + <_> + 6 15 14 1 2. + <_> + + <_> + 0 4 7 6 -1. + <_> + 0 6 7 2 3. + <_> + + <_> + 15 0 5 9 -1. + <_> + 15 3 5 3 3. + <_> + + <_> + 3 0 14 20 -1. + <_> + 10 0 7 20 2. + <_> + + <_> + 8 10 4 7 -1. + <_> + 8 10 2 7 2. + <_> + + <_> + 4 5 9 7 -1. + <_> + 7 5 3 7 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 5 3 6 13 -1. + <_> + 8 3 3 13 2. + <_> + + <_> + 7 12 6 8 -1. + <_> + 7 12 3 8 2. + <_> + + <_> + 4 9 6 5 -1. + <_> + 7 9 3 5 2. + <_> + + <_> + 11 4 4 10 -1. + <_> + 11 4 2 10 2. + <_> + + <_> + 0 11 12 6 -1. + <_> + 4 11 4 6 3. + <_> + + <_> + 11 4 4 10 -1. + <_> + 11 4 2 10 2. + <_> + + <_> + 5 4 4 10 -1. + <_> + 7 4 2 10 2. + <_> + + <_> + 6 14 14 2 -1. + <_> + 6 15 14 1 2. + <_> + + <_> + 0 14 14 2 -1. + <_> + 0 15 14 1 2. + <_> + + <_> + 15 2 5 12 -1. + <_> + 15 6 5 4 3. + <_> + + <_> + 0 2 5 12 -1. + <_> + 0 6 5 4 3. + <_> + + <_> + 16 5 4 14 -1. + <_> + 16 12 4 7 2. + <_> + + <_> + 0 14 12 6 -1. + <_> + 0 14 6 3 2. + <_> + 6 17 6 3 2. + <_> + + <_> + 16 5 4 14 -1. + <_> + 16 12 4 7 2. + <_> + + <_> + 0 5 4 14 -1. + <_> + 0 12 4 7 2. + <_> + + <_> + 12 12 8 5 -1. + <_> + 12 12 4 5 2. + <_> + + <_> + 0 12 8 5 -1. + <_> + 4 12 4 5 2. + <_> + + <_> + 12 0 3 14 -1. + <_> + 13 0 1 14 3. + <_> + + <_> + 5 12 5 8 -1. + <_> + 5 16 5 4 2. + <_> + + <_> + 18 2 2 14 -1. + <_> + 18 9 2 7 2. + <_> + + <_> + 6 0 8 6 -1. + <_> + 6 3 8 3 2. + <_> + + <_> + 14 1 6 9 -1. + <_> + 14 4 6 3 3. + <_> + + <_> + 3 4 14 6 -1. + <_> + 3 4 7 3 2. + <_> + 10 7 7 3 2. + <_> + + <_> + 10 5 9 6 -1. + <_> + 10 7 9 2 3. + <_> + + <_> + 0 13 8 5 -1. + <_> + 4 13 4 5 2. + <_> + + <_> + 12 0 6 18 -1. + <_> + 15 0 3 9 2. + <_> + 12 9 3 9 2. + <_> + + <_> + 2 0 6 18 -1. + <_> + 2 0 3 9 2. + <_> + 5 9 3 9 2. + <_> + + <_> + 2 0 16 14 -1. + <_> + 10 0 8 7 2. + <_> + 2 7 8 7 2. + <_> + + <_> + 2 0 4 16 -1. + <_> + 2 0 2 8 2. + <_> + 4 8 2 8 2. + <_> + + <_> + 12 0 8 4 -1. + <_> + 12 0 4 4 2. + <_> + + <_> + 0 0 8 4 -1. + <_> + 4 0 4 4 2. + <_> + + <_> + 6 12 14 5 -1. + <_> + 6 12 7 5 2. + <_> + + <_> + 0 12 14 5 -1. + <_> + 7 12 7 5 2. + <_> + + <_> + 8 1 12 5 -1. + <_> + 12 1 4 5 3. + <_> + + <_> + 0 1 12 5 -1. + <_> + 4 1 4 5 3. + <_> + + <_> + 3 10 14 4 -1. + <_> + 10 10 7 2 2. + <_> + 3 12 7 2 2. + <_> + + <_> + 0 14 20 4 -1. + <_> + 0 14 10 2 2. + <_> + 10 16 10 2 2. + <_> + + <_> + 10 9 9 5 -1. + <_> + 13 9 3 5 3. + <_> + + <_> + 1 9 9 5 -1. + <_> + 4 9 3 5 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 6 16 8 4 -1. + <_> + 10 16 4 4 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 4 5 12 6 -1. + <_> + 4 5 6 3 2. + <_> + 10 8 6 3 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 10 0 6 8 -1. + <_> + 12 0 2 8 3. + <_> + + <_> + 1 1 18 5 -1. + <_> + 7 1 6 5 3. + <_> + + <_> + 9 2 10 10 -1. + <_> + 14 2 5 5 2. + <_> + 9 7 5 5 2. + <_> + + <_> + 1 2 10 10 -1. + <_> + 1 2 5 5 2. + <_> + 6 7 5 5 2. + <_> + + <_> + 8 3 12 6 -1. + <_> + 14 3 6 3 2. + <_> + 8 6 6 3 2. + <_> + + <_> + 1 5 8 4 -1. + <_> + 5 5 4 4 2. + <_> + + <_> + 0 3 20 12 -1. + <_> + 10 3 10 6 2. + <_> + 0 9 10 6 2. + <_> + + <_> + 5 5 10 6 -1. + <_> + 5 5 5 3 2. + <_> + 10 8 5 3 2. + <_> + + <_> + 9 8 6 12 -1. + <_> + 12 8 3 6 2. + <_> + 9 14 3 6 2. + <_> + + <_> + 0 8 18 4 -1. + <_> + 0 8 9 2 2. + <_> + 9 10 9 2 2. + <_> + + <_> + 3 14 14 4 -1. + <_> + 10 14 7 2 2. + <_> + 3 16 7 2 2. + <_> + + <_> + 5 11 5 9 -1. + <_> + 5 14 5 3 3. + <_> + + <_> + 6 16 8 4 -1. + <_> + 6 18 8 2 2. + <_> + + <_> + 7 4 6 12 -1. + <_> + 7 10 6 6 2. + <_> + + <_> + 9 7 7 12 -1. + <_> + 9 11 7 4 3. + <_> + + <_> + 7 7 5 9 -1. + <_> + 7 10 5 3 3. + <_> + + <_> + 4 13 12 5 -1. + <_> + 8 13 4 5 3. + <_> + + <_> + 4 9 7 9 -1. + <_> + 4 12 7 3 3. + <_> + + <_> + 2 1 18 4 -1. + <_> + 8 1 6 4 3. + <_> + + <_> + 7 9 6 7 -1. + <_> + 9 9 2 7 3. + <_> + + <_> + 0 13 20 4 -1. + <_> + 0 15 20 2 2. + <_> + + <_> + 2 4 13 3 -1. + <_> + 2 5 13 1 3. + <_> + + <_> + 9 7 7 12 -1. + <_> + 9 11 7 4 3. + <_> + + <_> + 3 1 9 17 -1. + <_> + 6 1 3 17 3. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 6 9 4 8 -1. + <_> + 8 9 2 8 2. + <_> + + <_> + 5 4 14 12 -1. + <_> + 12 4 7 6 2. + <_> + 5 10 7 6 2. + <_> + + <_> + 0 16 18 2 -1. + <_> + 9 16 9 2 2. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 4 0 6 8 -1. + <_> + 6 0 2 8 3. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 7 5 6 12 -1. + <_> + 7 5 3 6 2. + <_> + 10 11 3 6 2. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 6 10 14 3 -1. + <_> + 6 11 14 1 3. + <_> + + <_> + 0 10 14 3 -1. + <_> + 0 11 14 1 3. + <_> + + <_> + 4 4 14 3 -1. + <_> + 4 5 14 1 3. + <_> + + <_> + 0 2 15 12 -1. + <_> + 5 2 5 12 3. + <_> + + <_> + 14 5 6 12 -1. + <_> + 14 5 3 12 2. + <_> + + <_> + 2 1 16 16 -1. + <_> + 2 9 16 8 2. + <_> + + <_> + 7 16 13 3 -1. + <_> + 7 17 13 1 3. + <_> + + <_> + 3 5 13 4 -1. + <_> + 3 7 13 2 2. + <_> + + <_> + 9 9 7 4 -1. + <_> + 9 11 7 2 2. + <_> + + <_> + 3 7 14 6 -1. + <_> + 3 9 14 2 3. + <_> + + <_> + 9 9 7 4 -1. + <_> + 9 11 7 2 2. + <_> + + <_> + 4 9 7 4 -1. + <_> + 4 11 7 2 2. + <_> + + <_> + 1 9 18 3 -1. + <_> + 1 10 18 1 3. + <_> + + <_> + 0 0 3 13 -1. + <_> + 1 0 1 13 3. + <_> + + <_> + 14 5 6 12 -1. + <_> + 14 5 3 12 2. + <_> + + <_> + 0 5 6 12 -1. + <_> + 3 5 3 12 2. + <_> + + <_> + 11 8 3 10 -1. + <_> + 11 13 3 5 2. + <_> + + <_> + 0 0 3 20 -1. + <_> + 1 0 1 20 3. + <_> + + <_> + 2 0 18 11 -1. + <_> + 8 0 6 11 3. + <_> + + <_> + 4 4 6 5 -1. + <_> + 7 4 3 5 2. + <_> + + <_> + 6 3 14 4 -1. + <_> + 13 3 7 2 2. + <_> + 6 5 7 2 2. + <_> + + <_> + 4 4 9 6 -1. + <_> + 7 4 3 6 3. + <_> + + <_> + 8 9 9 8 -1. + <_> + 11 9 3 8 3. + <_> + + <_> + 3 9 9 8 -1. + <_> + 6 9 3 8 3. + <_> + + <_> + 10 6 6 10 -1. + <_> + 12 6 2 10 3. + <_> + + <_> + 8 6 3 14 -1. + <_> + 9 6 1 14 3. + <_> + + <_> + 6 9 9 9 -1. + <_> + 9 9 3 9 3. + <_> + + <_> + 4 3 9 9 -1. + <_> + 7 3 3 9 3. + <_> + + <_> + 2 2 18 9 -1. + <_> + 8 2 6 9 3. + <_> + + <_> + 0 2 16 3 -1. + <_> + 0 3 16 1 3. + <_> + + <_> + 10 10 10 6 -1. + <_> + 10 10 5 6 2. + <_> + + <_> + 0 0 18 9 -1. + <_> + 6 0 6 9 3. + <_> + + <_> + 5 4 14 12 -1. + <_> + 12 4 7 6 2. + <_> + 5 10 7 6 2. + <_> + + <_> + 0 1 18 4 -1. + <_> + 6 1 6 4 3. + <_> + + <_> + 7 3 13 2 -1. + <_> + 7 4 13 1 2. + <_> + + <_> + 1 10 6 10 -1. + <_> + 1 10 3 5 2. + <_> + 4 15 3 5 2. + <_> + + <_> + 12 10 4 8 -1. + <_> + 12 14 4 4 2. + <_> + + <_> + 4 14 12 6 -1. + <_> + 4 14 6 3 2. + <_> + 10 17 6 3 2. + <_> + + <_> + 12 10 4 8 -1. + <_> + 12 14 4 4 2. + <_> + + <_> + 4 10 4 8 -1. + <_> + 4 14 4 4 2. + <_> + + <_> + 4 11 14 4 -1. + <_> + 11 11 7 2 2. + <_> + 4 13 7 2 2. + <_> + + <_> + 2 11 14 4 -1. + <_> + 2 11 7 2 2. + <_> + 9 13 7 2 2. + <_> + + <_> + 7 6 10 6 -1. + <_> + 12 6 5 3 2. + <_> + 7 9 5 3 2. + <_> + + <_> + 3 6 10 6 -1. + <_> + 3 6 5 3 2. + <_> + 8 9 5 3 2. + <_> + + <_> + 9 0 6 19 -1. + <_> + 11 0 2 19 3. + <_> + + <_> + 5 0 6 19 -1. + <_> + 7 0 2 19 3. + <_> + + <_> + 4 18 14 2 -1. + <_> + 4 18 7 2 2. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 13 1 7 9 -1. + <_> + 13 4 7 3 3. + <_> + + <_> + 0 1 7 9 -1. + <_> + 0 4 7 3 3. + <_> + + <_> + 9 11 11 6 -1. + <_> + 9 13 11 2 3. + <_> + + <_> + 0 11 11 6 -1. + <_> + 0 13 11 2 3. + <_> + + <_> + 2 5 16 10 -1. + <_> + 10 5 8 5 2. + <_> + 2 10 8 5 2. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 11 3 8 4 -1. + <_> + 11 5 8 2 2. + <_> + + <_> + 1 4 14 12 -1. + <_> + 1 4 7 6 2. + <_> + 8 10 7 6 2. + <_> + + <_> + 6 12 13 3 -1. + <_> + 6 13 13 1 3. + <_> + + <_> + 2 17 13 3 -1. + <_> + 2 18 13 1 3. + <_> + + <_> + 1 11 18 6 -1. + <_> + 1 13 18 2 3. + <_> + + <_> + 6 2 7 18 -1. + <_> + 6 11 7 9 2. + <_> + + <_> + 11 3 8 4 -1. + <_> + 11 5 8 2 2. + <_> + + <_> + 1 1 16 6 -1. + <_> + 1 1 8 3 2. + <_> + 9 4 8 3 2. + <_> + + <_> + 16 1 4 14 -1. + <_> + 18 1 2 7 2. + <_> + 16 8 2 7 2. + <_> + + <_> + 0 1 4 14 -1. + <_> + 0 1 2 7 2. + <_> + 2 8 2 7 2. + <_> + + <_> + 6 7 14 4 -1. + <_> + 13 7 7 2 2. + <_> + 6 9 7 2 2. + <_> + + <_> + 3 0 6 5 -1. + <_> + 6 0 3 5 2. + <_> + + <_> + 4 2 12 6 -1. + <_> + 4 4 12 2 3. + <_> + + <_> + 0 7 14 4 -1. + <_> + 0 7 7 2 2. + <_> + 7 9 7 2 2. + <_> + + <_> + 8 6 5 9 -1. + <_> + 8 9 5 3 3. + <_> + + <_> + 2 7 13 2 -1. + <_> + 2 8 13 1 2. + <_> + + <_> + 9 12 10 6 -1. + <_> + 14 12 5 3 2. + <_> + 9 15 5 3 2. + <_> + + <_> + 5 6 6 10 -1. + <_> + 7 6 2 10 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 2 2 15 5 -1. + <_> + 7 2 5 5 3. + <_> + + <_> + 7 3 13 2 -1. + <_> + 7 4 13 1 2. + <_> + + <_> + 0 0 2 13 -1. + <_> + 1 0 1 13 2. + <_> + + <_> + 14 1 3 17 -1. + <_> + 15 1 1 17 3. + <_> + + <_> + 3 1 3 17 -1. + <_> + 4 1 1 17 3. + <_> + + <_> + 12 1 7 6 -1. + <_> + 12 3 7 2 3. + <_> + + <_> + 3 2 3 17 -1. + <_> + 4 2 1 17 3. + <_> + + <_> + 14 0 6 18 -1. + <_> + 16 0 2 18 3. + <_> + + <_> + 3 5 7 6 -1. + <_> + 3 7 7 2 3. + <_> + + <_> + 8 4 6 12 -1. + <_> + 11 4 3 6 2. + <_> + 8 10 3 6 2. + <_> + + <_> + 4 4 12 10 -1. + <_> + 4 4 6 5 2. + <_> + 10 9 6 5 2. + <_> + + <_> + 14 0 6 18 -1. + <_> + 16 0 2 18 3. + <_> + + <_> + 0 0 6 18 -1. + <_> + 2 0 2 18 3. + <_> + + <_> + 9 0 3 18 -1. + <_> + 9 9 3 9 2. + <_> + + <_> + 3 2 12 6 -1. + <_> + 3 5 12 3 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 17 3 3 12 -1. + <_> + 17 9 3 6 2. + <_> + + <_> + 0 3 3 12 -1. + <_> + 0 9 3 6 2. + <_> + + <_> + 14 10 5 9 -1. + <_> + 14 13 5 3 3. + <_> + + <_> + 1 0 18 8 -1. + <_> + 1 4 18 4 2. + <_> + + <_> + 11 3 8 4 -1. + <_> + 11 5 8 2 2. + <_> + + <_> + 1 3 8 4 -1. + <_> + 1 5 8 2 2. + <_> + + <_> + 15 0 5 9 -1. + <_> + 15 3 5 3 3. + <_> + + <_> + 4 3 12 3 -1. + <_> + 10 3 6 3 2. + <_> + + <_> + 5 7 10 5 -1. + <_> + 5 7 5 5 2. + <_> + + <_> + 2 6 16 4 -1. + <_> + 2 6 8 2 2. + <_> + 10 8 8 2 2. + <_> + + <_> + 15 0 5 9 -1. + <_> + 15 3 5 3 3. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 11 0 3 12 -1. + <_> + 11 6 3 6 2. + <_> + + <_> + 0 1 6 6 -1. + <_> + 0 4 6 3 2. + <_> + + <_> + 7 1 7 18 -1. + <_> + 7 10 7 9 2. + <_> + + <_> + 0 2 18 6 -1. + <_> + 0 2 9 3 2. + <_> + 9 5 9 3 2. + <_> + + <_> + 5 8 13 2 -1. + <_> + 5 9 13 1 2. + <_> + + <_> + 6 8 3 10 -1. + <_> + 6 13 3 5 2. + <_> + + <_> + 6 11 13 2 -1. + <_> + 6 12 13 1 2. + <_> + + <_> + 1 17 18 3 -1. + <_> + 1 18 18 1 3. + <_> + + <_> + 1 3 18 2 -1. + <_> + 1 3 9 2 2. + <_> + + <_> + 3 17 10 3 -1. + <_> + 8 17 5 3 2. + <_> + + <_> + 1 15 18 4 -1. + <_> + 7 15 6 4 3. + <_> + + <_> + 5 5 6 9 -1. + <_> + 8 5 3 9 2. + <_> + + <_> + 4 6 12 11 -1. + <_> + 8 6 4 11 3. + <_> + + <_> + 0 0 8 10 -1. + <_> + 0 0 4 5 2. + <_> + 4 5 4 5 2. + <_> + + <_> + 2 0 18 3 -1. + <_> + 8 0 6 3 3. + <_> + + <_> + 5 9 9 9 -1. + <_> + 8 9 3 9 3. + <_> + + <_> + 11 3 2 17 -1. + <_> + 11 3 1 17 2. + <_> + + <_> + 7 0 2 20 -1. + <_> + 8 0 1 20 2. + <_> + + <_> + 10 1 8 18 -1. + <_> + 10 1 4 18 2. + <_> + + <_> + 4 5 8 8 -1. + <_> + 4 5 4 4 2. + <_> + 8 9 4 4 2. + <_> + + <_> + 6 1 12 14 -1. + <_> + 12 1 6 7 2. + <_> + 6 8 6 7 2. + <_> + + <_> + 2 1 8 18 -1. + <_> + 6 1 4 18 2. + <_> + + <_> + 1 5 18 7 -1. + <_> + 7 5 6 7 3. + <_> + + <_> + 3 4 6 16 -1. + <_> + 3 4 3 8 2. + <_> + 6 12 3 8 2. + <_> + + <_> + 12 3 4 14 -1. + <_> + 14 3 2 7 2. + <_> + 12 10 2 7 2. + <_> + + <_> + 4 3 4 14 -1. + <_> + 4 3 2 7 2. + <_> + 6 10 2 7 2. + <_> + + <_> + 8 12 6 6 -1. + <_> + 8 12 3 6 2. + <_> + + <_> + 6 12 6 6 -1. + <_> + 9 12 3 6 2. + <_> + + <_> + 4 1 14 3 -1. + <_> + 4 2 14 1 3. + <_> + + <_> + 3 5 10 6 -1. + <_> + 3 5 5 3 2. + <_> + 8 8 5 3 2. + <_> + + <_> + 6 6 14 4 -1. + <_> + 13 6 7 2 2. + <_> + 6 8 7 2 2. + <_> + + <_> + 0 4 20 8 -1. + <_> + 0 4 10 4 2. + <_> + 10 8 10 4 2. + <_> + + <_> + 12 5 8 8 -1. + <_> + 16 5 4 4 2. + <_> + 12 9 4 4 2. + <_> + + <_> + 1 1 15 6 -1. + <_> + 1 3 15 2 3. + <_> + + <_> + 3 6 16 3 -1. + <_> + 3 6 8 3 2. + <_> + + <_> + 7 3 6 5 -1. + <_> + 10 3 3 5 2. + <_> + + <_> + 7 4 9 5 -1. + <_> + 10 4 3 5 3. + <_> + + <_> + 1 6 16 3 -1. + <_> + 9 6 8 3 2. + <_> + + <_> + 9 0 3 15 -1. + <_> + 9 5 3 5 3. + <_> + + <_> + 0 1 2 14 -1. + <_> + 1 1 1 14 2. + <_> + + <_> + 12 5 3 13 -1. + <_> + 13 5 1 13 3. + <_> + + <_> + 5 5 3 13 -1. + <_> + 6 5 1 13 3. + <_> + + <_> + 4 6 16 8 -1. + <_> + 4 10 16 4 2. + <_> + + <_> + 3 7 7 6 -1. + <_> + 3 10 7 3 2. + <_> + + <_> + 0 3 20 10 -1. + <_> + 0 8 20 5 2. + <_> + + <_> + 0 3 7 6 -1. + <_> + 0 5 7 2 3. + <_> + + <_> + 11 1 8 4 -1. + <_> + 11 3 8 2 2. + <_> + + <_> + 1 1 8 4 -1. + <_> + 1 3 8 2 2. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 5 0 10 6 -1. + <_> + 5 2 10 2 3. + <_> + + <_> + 6 3 8 10 -1. + <_> + 6 8 8 5 2. + <_> + + <_> + 7 2 5 12 -1. + <_> + 7 8 5 6 2. + <_> + + <_> + 7 7 6 12 -1. + <_> + 9 7 2 12 3. + <_> + + <_> + 7 3 6 8 -1. + <_> + 9 3 2 8 3. + <_> + + <_> + 10 0 4 16 -1. + <_> + 10 8 4 8 2. + <_> + + <_> + 0 6 16 8 -1. + <_> + 0 10 16 4 2. + <_> + + <_> + 3 8 16 4 -1. + <_> + 3 10 16 2 2. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 10 8 9 4 -1. + <_> + 10 10 9 2 2. + <_> + + <_> + 7 5 6 10 -1. + <_> + 7 10 6 5 2. + <_> + + <_> + 9 6 4 12 -1. + <_> + 9 10 4 4 3. + <_> + + <_> + 0 7 13 9 -1. + <_> + 0 10 13 3 3. + <_> + + <_> + 6 11 8 8 -1. + <_> + 10 11 4 4 2. + <_> + 6 15 4 4 2. + <_> + + <_> + 0 15 10 4 -1. + <_> + 5 15 5 4 2. + <_> + + <_> + 4 18 16 2 -1. + <_> + 4 18 8 2 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 14 8 4 2. + <_> + + <_> + 8 13 7 6 -1. + <_> + 8 15 7 2 3. + <_> + + <_> + 7 7 5 8 -1. + <_> + 7 11 5 4 2. + <_> + + <_> + 6 7 10 12 -1. + <_> + 6 11 10 4 3. + <_> + + <_> + 6 13 6 7 -1. + <_> + 8 13 2 7 3. + <_> + + <_> + 14 11 4 7 -1. + <_> + 14 11 2 7 2. + <_> + + <_> + 4 6 6 10 -1. + <_> + 6 6 2 10 3. + <_> + + <_> + 13 4 2 16 -1. + <_> + 13 4 1 16 2. + <_> + + <_> + 5 4 2 16 -1. + <_> + 6 4 1 16 2. + <_> + + <_> + 8 3 4 16 -1. + <_> + 10 3 2 8 2. + <_> + 8 11 2 8 2. + <_> + + <_> + 8 0 3 18 -1. + <_> + 8 9 3 9 2. + <_> + + <_> + 4 4 13 2 -1. + <_> + 4 5 13 1 2. + <_> + + <_> + 0 2 14 2 -1. + <_> + 0 3 14 1 2. + <_> + + <_> + 14 11 4 7 -1. + <_> + 14 11 2 7 2. + <_> + + <_> + 0 2 13 2 -1. + <_> + 0 3 13 1 2. + <_> + + <_> + 14 11 4 7 -1. + <_> + 14 11 2 7 2. + <_> + + <_> + 2 11 4 7 -1. + <_> + 4 11 2 7 2. + <_> + + <_> + 13 0 3 13 -1. + <_> + 14 0 1 13 3. + <_> + + <_> + 2 10 5 6 -1. + <_> + 2 13 5 3 2. + <_> + + <_> + 14 10 5 9 -1. + <_> + 14 13 5 3 3. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 5 12 13 3 -1. + <_> + 5 13 13 1 3. + <_> + + <_> + 0 13 17 6 -1. + <_> + 0 15 17 2 3. + <_> + + <_> + 5 15 13 3 -1. + <_> + 5 16 13 1 3. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 9 4 2 14 -1. + <_> + 9 11 2 7 2. + <_> + + <_> + 1 15 13 3 -1. + <_> + 1 16 13 1 3. + <_> + + <_> + 13 5 4 8 -1. + <_> + 13 9 4 4 2. + <_> + + <_> + 4 5 4 14 -1. + <_> + 4 5 2 7 2. + <_> + 6 12 2 7 2. + <_> + + <_> + 13 5 4 8 -1. + <_> + 13 9 4 4 2. + <_> + + <_> + 2 8 8 8 -1. + <_> + 2 8 4 4 2. + <_> + 6 12 4 4 2. + <_> + + <_> + 13 6 6 9 -1. + <_> + 13 9 6 3 3. + <_> + + <_> + 4 0 5 9 -1. + <_> + 4 3 5 3 3. + <_> + + <_> + 13 4 3 10 -1. + <_> + 13 9 3 5 2. + <_> + + <_> + 3 5 4 8 -1. + <_> + 3 9 4 4 2. + <_> + + <_> + 10 10 8 6 -1. + <_> + 10 12 8 2 3. + <_> + + <_> + 1 17 13 3 -1. + <_> + 1 18 13 1 3. + <_> + + <_> + 10 6 10 6 -1. + <_> + 15 6 5 3 2. + <_> + 10 9 5 3 2. + <_> + + <_> + 7 5 6 11 -1. + <_> + 9 5 2 11 3. + <_> + + <_> + 6 1 9 6 -1. + <_> + 9 1 3 6 3. + <_> + + <_> + 1 11 13 3 -1. + <_> + 1 12 13 1 3. + <_> + + <_> + 4 0 13 3 -1. + <_> + 4 1 13 1 3. + <_> + + <_> + 1 2 14 12 -1. + <_> + 1 2 7 6 2. + <_> + 8 8 7 6 2. + <_> + + <_> + 13 4 4 14 -1. + <_> + 15 4 2 7 2. + <_> + 13 11 2 7 2. + <_> + + <_> + 3 4 4 14 -1. + <_> + 3 4 2 7 2. + <_> + 5 11 2 7 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 1 15 7 4 -1. + <_> + 1 17 7 2 2. + <_> + + <_> + 16 0 4 7 -1. + <_> + 16 0 2 7 2. + <_> + + <_> + 1 2 18 2 -1. + <_> + 1 3 18 1 2. + <_> + + <_> + 16 0 4 7 -1. + <_> + 16 0 2 7 2. + <_> + + <_> + 3 2 14 3 -1. + <_> + 3 3 14 1 3. + <_> + + <_> + 11 13 6 7 -1. + <_> + 13 13 2 7 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 1 7 19 12 -1. + <_> + 1 11 19 4 3. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 7 9 6 10 -1. + <_> + 7 9 3 5 2. + <_> + 10 14 3 5 2. + <_> + + <_> + 4 6 13 3 -1. + <_> + 4 7 13 1 3. + <_> + + <_> + 3 11 7 4 -1. + <_> + 3 13 7 2 2. + <_> + + <_> + 16 0 4 15 -1. + <_> + 16 0 2 15 2. + <_> + + <_> + 0 3 14 4 -1. + <_> + 0 3 7 2 2. + <_> + 7 5 7 2 2. + <_> + + <_> + 7 0 8 10 -1. + <_> + 11 0 4 5 2. + <_> + 7 5 4 5 2. + <_> + + <_> + 0 2 20 2 -1. + <_> + 10 2 10 2 2. + <_> + + <_> + 7 6 10 3 -1. + <_> + 7 6 5 3 2. + <_> + + <_> + 3 6 10 3 -1. + <_> + 8 6 5 3 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 0 4 18 16 -1. + <_> + 6 4 6 16 3. + <_> + + <_> + 15 0 4 19 -1. + <_> + 15 0 2 19 2. + <_> + + <_> + 0 6 10 6 -1. + <_> + 0 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 0 0 6 10 -1. + <_> + 0 0 3 5 2. + <_> + 3 5 3 5 2. + <_> + + <_> + 9 0 9 5 -1. + <_> + 12 0 3 5 3. + <_> + + <_> + 5 0 8 10 -1. + <_> + 5 0 4 5 2. + <_> + 9 5 4 5 2. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 0 0 14 3 -1. + <_> + 0 1 14 1 3. + <_> + + <_> + 16 0 4 12 -1. + <_> + 16 0 2 12 2. + <_> + + <_> + 1 0 4 19 -1. + <_> + 3 0 2 19 2. + <_> + + <_> + 14 10 6 7 -1. + <_> + 14 10 3 7 2. + <_> + + <_> + 1 6 9 14 -1. + <_> + 4 6 3 14 3. + <_> + + <_> + 9 2 6 9 -1. + <_> + 9 5 6 3 3. + <_> + + <_> + 0 10 6 10 -1. + <_> + 0 10 3 5 2. + <_> + 3 15 3 5 2. + <_> + + <_> + 4 8 12 6 -1. + <_> + 8 8 4 6 3. + <_> + + <_> + 2 5 12 9 -1. + <_> + 6 5 4 9 3. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 4 5 9 5 -1. + <_> + 7 5 3 5 3. + <_> + + <_> + 10 3 6 7 -1. + <_> + 12 3 2 7 3. + <_> + + <_> + 6 13 7 6 -1. + <_> + 6 15 7 2 3. + <_> + + <_> + 11 6 4 14 -1. + <_> + 13 6 2 7 2. + <_> + 11 13 2 7 2. + <_> + + <_> + 5 6 4 14 -1. + <_> + 5 6 2 7 2. + <_> + 7 13 2 7 2. + <_> + + <_> + 13 13 7 4 -1. + <_> + 13 15 7 2 2. + <_> + + <_> + 1 5 4 14 -1. + <_> + 1 5 2 7 2. + <_> + 3 12 2 7 2. + <_> + + <_> + 1 13 18 4 -1. + <_> + 10 13 9 2 2. + <_> + 1 15 9 2 2. + <_> + + <_> + 0 1 18 12 -1. + <_> + 0 7 18 6 2. + <_> + + <_> + 4 1 14 18 -1. + <_> + 4 10 14 9 2. + <_> + + <_> + 4 0 6 10 -1. + <_> + 6 0 2 10 3. + <_> + + <_> + 16 10 4 9 -1. + <_> + 16 10 2 9 2. + <_> + + <_> + 0 10 4 9 -1. + <_> + 2 10 2 9 2. + <_> + + <_> + 10 3 6 7 -1. + <_> + 12 3 2 7 3. + <_> + + <_> + 4 10 4 7 -1. + <_> + 6 10 2 7 2. + <_> + + <_> + 4 9 15 3 -1. + <_> + 9 9 5 3 3. + <_> + + <_> + 1 9 15 3 -1. + <_> + 6 9 5 3 3. + <_> + + <_> + 16 0 4 12 -1. + <_> + 16 0 2 12 2. + <_> + + <_> + 7 8 4 12 -1. + <_> + 7 12 4 4 3. + <_> + + <_> + 16 0 4 12 -1. + <_> + 16 0 2 12 2. + <_> + + <_> + 0 0 4 12 -1. + <_> + 2 0 2 12 2. + <_> + + <_> + 12 9 7 6 -1. + <_> + 12 11 7 2 3. + <_> + + <_> + 8 1 3 13 -1. + <_> + 9 1 1 13 3. + <_> + + <_> + 12 9 7 6 -1. + <_> + 12 11 7 2 3. + <_> + + <_> + 0 6 6 7 -1. + <_> + 2 6 2 7 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 1 9 18 4 -1. + <_> + 10 9 9 2 2. + <_> + 1 11 9 2 2. + <_> + + <_> + 3 9 13 2 -1. + <_> + 3 10 13 1 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 6 12 8 8 -1. + <_> + 6 12 4 4 2. + <_> + 10 16 4 4 2. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 3 14 7 6 -1. + <_> + 3 16 7 2 3. + <_> + + <_> + 5 10 15 6 -1. + <_> + 10 10 5 6 3. + <_> + + <_> + 8 2 4 7 -1. + <_> + 10 2 2 7 2. + <_> + + <_> + 7 1 9 7 -1. + <_> + 10 1 3 7 3. + <_> + + <_> + 1 14 9 6 -1. + <_> + 1 16 9 2 3. + <_> + + <_> + 7 0 8 6 -1. + <_> + 7 2 8 2 3. + <_> + + <_> + 0 0 8 10 -1. + <_> + 0 0 4 5 2. + <_> + 4 5 4 5 2. + <_> + + <_> + 11 8 6 7 -1. + <_> + 13 8 2 7 3. + <_> + + <_> + 6 0 2 13 -1. + <_> + 7 0 1 13 2. + <_> + + <_> + 10 10 6 8 -1. + <_> + 10 10 3 8 2. + <_> + + <_> + 2 9 8 9 -1. + <_> + 2 12 8 3 3. + <_> + + <_> + 14 4 4 14 -1. + <_> + 16 4 2 7 2. + <_> + 14 11 2 7 2. + <_> + + <_> + 4 9 7 8 -1. + <_> + 4 13 7 4 2. + <_> + + <_> + 7 1 6 8 -1. + <_> + 7 1 3 8 2. + <_> + + <_> + 1 11 7 6 -1. + <_> + 1 13 7 2 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 0 10 15 6 -1. + <_> + 5 10 5 6 3. + <_> + + <_> + 9 10 6 5 -1. + <_> + 9 10 3 5 2. + <_> + + <_> + 5 10 6 5 -1. + <_> + 8 10 3 5 2. + <_> + + <_> + 7 6 7 4 -1. + <_> + 7 8 7 2 2. + <_> + + <_> + 5 2 5 9 -1. + <_> + 5 5 5 3 3. + <_> + + <_> + 7 12 13 3 -1. + <_> + 7 13 13 1 3. + <_> + + <_> + 2 12 16 4 -1. + <_> + 2 14 16 2 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 0 20 4 -1. + <_> + 0 0 10 2 2. + <_> + 10 2 10 2 2. + <_> + + <_> + 6 14 13 2 -1. + <_> + 6 15 13 1 2. + <_> + + <_> + 1 10 13 3 -1. + <_> + 1 11 13 1 3. + <_> + + <_> + 12 0 6 10 -1. + <_> + 15 0 3 5 2. + <_> + 12 5 3 5 2. + <_> + + <_> + 3 16 13 2 -1. + <_> + 3 17 13 1 2. + <_> + + <_> + 10 6 10 6 -1. + <_> + 15 6 5 3 2. + <_> + 10 9 5 3 2. + <_> + + <_> + 1 16 13 3 -1. + <_> + 1 17 13 1 3. + <_> + + <_> + 15 1 5 9 -1. + <_> + 15 4 5 3 3. + <_> + + <_> + 0 1 18 4 -1. + <_> + 0 1 9 2 2. + <_> + 9 3 9 2 2. + <_> + + <_> + 5 0 10 4 -1. + <_> + 5 2 10 2 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 4 2 12 10 -1. + <_> + 4 2 6 10 2. + <_> + + <_> + 5 10 6 6 -1. + <_> + 8 10 3 6 2. + <_> + + <_> + 5 2 12 6 -1. + <_> + 5 4 12 2 3. + <_> + + <_> + 8 0 3 12 -1. + <_> + 8 6 3 6 2. + <_> + + <_> + 5 0 14 8 -1. + <_> + 5 4 14 4 2. + <_> + + <_> + 2 4 4 14 -1. + <_> + 2 4 2 7 2. + <_> + 4 11 2 7 2. + <_> + + <_> + 10 9 10 6 -1. + <_> + 15 9 5 3 2. + <_> + 10 12 5 3 2. + <_> + + <_> + 5 12 9 5 -1. + <_> + 8 12 3 5 3. + <_> + + <_> + 4 14 12 6 -1. + <_> + 8 14 4 6 3. + <_> + + <_> + 2 5 12 14 -1. + <_> + 2 5 6 7 2. + <_> + 8 12 6 7 2. + <_> + + <_> + 3 10 14 4 -1. + <_> + 10 10 7 2 2. + <_> + 3 12 7 2 2. + <_> + + <_> + 4 2 12 4 -1. + <_> + 8 2 4 4 3. + <_> + + <_> + 12 0 4 14 -1. + <_> + 14 0 2 7 2. + <_> + 12 7 2 7 2. + <_> + + <_> + 4 0 4 14 -1. + <_> + 4 0 2 7 2. + <_> + 6 7 2 7 2. + <_> + + <_> + 12 9 6 11 -1. + <_> + 14 9 2 11 3. + <_> + + <_> + 0 4 3 14 -1. + <_> + 1 4 1 14 3. + <_> + + <_> + 15 1 3 13 -1. + <_> + 16 1 1 13 3. + <_> + + <_> + 2 1 3 13 -1. + <_> + 3 1 1 13 3. + <_> + + <_> + 8 10 10 10 -1. + <_> + 13 10 5 5 2. + <_> + 8 15 5 5 2. + <_> + + <_> + 6 0 2 20 -1. + <_> + 7 0 1 20 2. + <_> + + <_> + 5 14 14 6 -1. + <_> + 12 14 7 3 2. + <_> + 5 17 7 3 2. + <_> + + <_> + 1 4 3 13 -1. + <_> + 2 4 1 13 3. + <_> + + <_> + 18 6 2 14 -1. + <_> + 18 6 1 14 2. + <_> + + <_> + 0 6 2 14 -1. + <_> + 1 6 1 14 2. + <_> + + <_> + 10 2 9 5 -1. + <_> + 13 2 3 5 3. + <_> + + <_> + 2 0 6 7 -1. + <_> + 4 0 2 7 3. + <_> + + <_> + 4 4 14 16 -1. + <_> + 11 4 7 8 2. + <_> + 4 12 7 8 2. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 12 8 7 6 -1. + <_> + 12 10 7 2 3. + <_> + + <_> + 0 17 20 3 -1. + <_> + 10 17 10 3 2. + <_> + + <_> + 6 10 10 4 -1. + <_> + 6 10 5 4 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 12 8 7 6 -1. + <_> + 12 10 7 2 3. + <_> + + <_> + 7 11 6 8 -1. + <_> + 9 11 2 8 3. + <_> + + <_> + 5 4 13 3 -1. + <_> + 5 5 13 1 3. + <_> + + <_> + 6 2 4 15 -1. + <_> + 6 7 4 5 3. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 3 6 14 9 -1. + <_> + 3 9 14 3 3. + <_> + + <_> + 4 5 12 8 -1. + <_> + 4 9 12 4 2. + <_> + + <_> + 2 4 14 16 -1. + <_> + 2 4 7 8 2. + <_> + 9 12 7 8 2. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 1 17 12 3 -1. + <_> + 7 17 6 3 2. + <_> + + <_> + 1 7 19 3 -1. + <_> + 1 8 19 1 3. + <_> + + <_> + 4 0 12 10 -1. + <_> + 10 0 6 10 2. + <_> + + <_> + 6 11 12 4 -1. + <_> + 6 11 6 4 2. + <_> + + <_> + 4 10 6 5 -1. + <_> + 7 10 3 5 2. + <_> + + <_> + 18 0 2 18 -1. + <_> + 18 0 1 18 2. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 6 12 13 3 -1. + <_> + 6 13 13 1 3. + <_> + + <_> + 3 13 14 3 -1. + <_> + 3 14 14 1 3. + <_> + + <_> + 12 8 7 6 -1. + <_> + 12 10 7 2 3. + <_> + + <_> + 3 13 13 3 -1. + <_> + 3 14 13 1 3. + <_> + + <_> + 12 8 7 6 -1. + <_> + 12 10 7 2 3. + <_> + + <_> + 1 8 7 6 -1. + <_> + 1 10 7 2 3. + <_> + + <_> + 5 7 12 12 -1. + <_> + 5 11 12 4 3. + <_> + + <_> + 4 5 10 10 -1. + <_> + 4 5 5 5 2. + <_> + 9 10 5 5 2. + <_> + + <_> + 12 13 8 7 -1. + <_> + 12 13 4 7 2. + <_> + + <_> + 4 0 9 6 -1. + <_> + 4 3 9 3 2. + <_> + + <_> + 4 3 13 2 -1. + <_> + 4 4 13 1 2. + <_> + + <_> + 0 0 2 18 -1. + <_> + 1 0 1 18 2. + <_> + + <_> + 0 13 20 2 -1. + <_> + 0 14 20 1 2. + <_> + + <_> + 4 10 10 4 -1. + <_> + 9 10 5 4 2. + <_> + + <_> + 8 4 12 16 -1. + <_> + 8 4 6 16 2. + <_> + + <_> + 0 4 12 16 -1. + <_> + 6 4 6 16 2. + <_> + + <_> + 12 5 6 9 -1. + <_> + 12 5 3 9 2. + <_> + + <_> + 0 13 8 7 -1. + <_> + 4 13 4 7 2. + <_> + + <_> + 12 0 3 16 -1. + <_> + 13 0 1 16 3. + <_> + + <_> + 0 7 18 12 -1. + <_> + 6 7 6 12 3. + <_> + + <_> + 4 9 12 4 -1. + <_> + 8 9 4 4 3. + <_> + + <_> + 0 7 16 4 -1. + <_> + 0 7 8 2 2. + <_> + 8 9 8 2 2. + <_> + + <_> + 7 4 9 5 -1. + <_> + 10 4 3 5 3. + <_> + + <_> + 5 0 3 16 -1. + <_> + 6 0 1 16 3. + <_> + + <_> + 6 11 13 2 -1. + <_> + 6 12 13 1 2. + <_> + + <_> + 1 11 13 2 -1. + <_> + 1 12 13 1 2. + <_> + + <_> + 8 6 5 9 -1. + <_> + 8 9 5 3 3. + <_> + + <_> + 6 4 4 8 -1. + <_> + 8 4 2 8 2. + <_> + + <_> + 14 3 4 8 -1. + <_> + 14 3 2 8 2. + <_> + + <_> + 2 3 4 8 -1. + <_> + 4 3 2 8 2. + <_> + + <_> + 10 3 6 7 -1. + <_> + 12 3 2 7 3. + <_> + + <_> + 4 6 8 8 -1. + <_> + 4 6 4 4 2. + <_> + 8 10 4 4 2. + <_> + + <_> + 10 9 6 7 -1. + <_> + 10 9 3 7 2. + <_> + + <_> + 4 9 6 7 -1. + <_> + 7 9 3 7 2. + <_> + + <_> + 4 10 12 5 -1. + <_> + 8 10 4 5 3. + <_> + + <_> + 6 1 7 6 -1. + <_> + 6 3 7 2 3. + <_> + + <_> + 4 0 13 3 -1. + <_> + 4 1 13 1 3. + <_> + + <_> + 4 3 4 14 -1. + <_> + 4 3 2 7 2. + <_> + 6 10 2 7 2. + <_> + + <_> + 6 6 10 3 -1. + <_> + 6 6 5 3 2. + <_> + + <_> + 2 8 16 2 -1. + <_> + 10 8 8 2 2. + <_> + + <_> + 11 6 8 14 -1. + <_> + 15 6 4 7 2. + <_> + 11 13 4 7 2. + <_> + + <_> + 1 0 6 19 -1. + <_> + 4 0 3 19 2. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 12 5 6 10 -1. + <_> + 15 5 3 5 2. + <_> + 12 10 3 5 2. + <_> + + <_> + 2 5 6 10 -1. + <_> + 2 5 3 5 2. + <_> + 5 10 3 5 2. + <_> + + <_> + 7 0 9 4 -1. + <_> + 7 2 9 2 2. + <_> + + <_> + 0 11 18 2 -1. + <_> + 9 11 9 2 2. + <_> + + <_> + 6 6 8 9 -1. + <_> + 6 6 4 9 2. + <_> + + <_> + 4 4 9 5 -1. + <_> + 7 4 3 5 3. + <_> + + <_> + 10 2 6 7 -1. + <_> + 10 2 3 7 2. + <_> + + <_> + 5 2 9 5 -1. + <_> + 8 2 3 5 3. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 4 1 14 4 -1. + <_> + 11 1 7 2 2. + <_> + 4 3 7 2 2. + <_> + + <_> + 9 1 2 13 -1. + <_> + 10 1 1 13 2. + <_> + + <_> + 10 6 10 6 -1. + <_> + 15 6 5 3 2. + <_> + 10 9 5 3 2. + <_> + + <_> + 0 6 10 6 -1. + <_> + 0 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 6 6 10 3 -1. + <_> + 6 6 5 3 2. + <_> + + <_> + 1 7 4 13 -1. + <_> + 3 7 2 13 2. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 0 0 6 5 -1. + <_> + 3 0 3 5 2. + <_> + + <_> + 15 6 5 12 -1. + <_> + 15 10 5 4 3. + <_> + + <_> + 0 1 6 16 -1. + <_> + 0 1 3 8 2. + <_> + 3 9 3 8 2. + <_> + + <_> + 0 0 20 2 -1. + <_> + 0 0 10 2 2. + <_> + + <_> + 0 6 5 12 -1. + <_> + 0 10 5 4 3. + <_> + + <_> + 1 0 18 6 -1. + <_> + 10 0 9 3 2. + <_> + 1 3 9 3 2. + <_> + + <_> + 3 0 12 5 -1. + <_> + 7 0 4 5 3. + <_> + + <_> + 7 0 9 5 -1. + <_> + 10 0 3 5 3. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 11 2 8 18 -1. + <_> + 11 2 4 18 2. + <_> + + <_> + 1 2 8 18 -1. + <_> + 5 2 4 18 2. + <_> + + <_> + 12 7 5 6 -1. + <_> + 12 10 5 3 2. + <_> + + <_> + 2 1 14 4 -1. + <_> + 2 1 7 2 2. + <_> + 9 3 7 2 2. + <_> + + <_> + 12 7 8 6 -1. + <_> + 12 9 8 2 3. + <_> + + <_> + 0 7 8 6 -1. + <_> + 0 9 8 2 3. + <_> + + <_> + 7 7 13 2 -1. + <_> + 7 8 13 1 2. + <_> + + <_> + 1 6 18 9 -1. + <_> + 1 9 18 3 3. + <_> + + <_> + 0 8 20 6 -1. + <_> + 0 10 20 2 3. + <_> + + <_> + 4 3 4 13 -1. + <_> + 6 3 2 13 2. + <_> + + <_> + 13 3 3 15 -1. + <_> + 14 3 1 15 3. + <_> + + <_> + 3 15 14 3 -1. + <_> + 3 16 14 1 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 16 17 3 -1. + <_> + 0 17 17 1 3. + <_> + + <_> + 5 11 11 6 -1. + <_> + 5 14 11 3 2. + <_> + + <_> + 4 3 3 15 -1. + <_> + 5 3 1 15 3. + <_> + + <_> + 3 1 14 9 -1. + <_> + 3 4 14 3 3. + <_> + + <_> + 0 0 20 8 -1. + <_> + 0 4 20 4 2. + <_> + + <_> + 7 6 7 4 -1. + <_> + 7 8 7 2 2. + <_> + + <_> + 2 13 13 2 -1. + <_> + 2 14 13 1 2. + <_> + + <_> + 2 12 16 3 -1. + <_> + 2 13 16 1 3. + <_> + + <_> + 1 11 13 3 -1. + <_> + 1 12 13 1 3. + <_> + + <_> + 7 1 13 3 -1. + <_> + 7 2 13 1 3. + <_> + + <_> + 5 13 7 6 -1. + <_> + 5 16 7 3 2. + <_> + + <_> + 4 3 14 3 -1. + <_> + 4 4 14 1 3. + <_> + + <_> + 3 2 14 2 -1. + <_> + 3 3 14 1 2. + <_> + + <_> + 3 0 15 14 -1. + <_> + 3 7 15 7 2. + <_> + + <_> + 4 1 12 14 -1. + <_> + 4 8 12 7 2. + <_> + + <_> + 9 13 6 7 -1. + <_> + 11 13 2 7 3. + <_> + + <_> + 6 14 8 4 -1. + <_> + 6 16 8 2 2. + <_> + + <_> + 8 14 8 6 -1. + <_> + 8 16 8 2 3. + <_> + + <_> + 5 13 6 7 -1. + <_> + 7 13 2 7 3. + <_> + + <_> + 11 10 8 5 -1. + <_> + 11 10 4 5 2. + <_> + + <_> + 1 0 8 16 -1. + <_> + 1 0 4 8 2. + <_> + 5 8 4 8 2. + <_> + + <_> + 8 2 6 18 -1. + <_> + 8 8 6 6 3. + <_> + + <_> + 6 2 6 18 -1. + <_> + 6 8 6 6 3. + <_> + + <_> + 7 6 9 4 -1. + <_> + 7 8 9 2 2. + <_> + + <_> + 1 10 5 9 -1. + <_> + 1 13 5 3 3. + <_> + + <_> + 12 12 8 6 -1. + <_> + 12 14 8 2 3. + <_> + + <_> + 0 14 10 6 -1. + <_> + 0 14 5 3 2. + <_> + 5 17 5 3 2. + <_> + + <_> + 9 11 5 9 -1. + <_> + 9 14 5 3 3. + <_> + + <_> + 0 16 12 4 -1. + <_> + 4 16 4 4 3. + <_> + + <_> + 14 6 3 14 -1. + <_> + 15 6 1 14 3. + <_> + + <_> + 6 9 8 8 -1. + <_> + 6 9 4 4 2. + <_> + 10 13 4 4 2. + <_> + + <_> + 8 5 4 7 -1. + <_> + 8 5 2 7 2. + <_> + + <_> + 6 11 6 9 -1. + <_> + 8 11 2 9 3. + <_> + + <_> + 7 2 6 16 -1. + <_> + 10 2 3 8 2. + <_> + 7 10 3 8 2. + <_> + + <_> + 0 15 18 5 -1. + <_> + 9 15 9 5 2. + <_> + + <_> + 4 12 14 4 -1. + <_> + 11 12 7 2 2. + <_> + 4 14 7 2 2. + <_> + + <_> + 2 12 14 4 -1. + <_> + 2 12 7 2 2. + <_> + 9 14 7 2 2. + <_> + + <_> + 4 3 14 3 -1. + <_> + 4 3 7 3 2. + <_> + + <_> + 0 2 10 3 -1. + <_> + 5 2 5 3 2. + <_> + + <_> + 3 0 15 8 -1. + <_> + 8 0 5 8 3. + <_> + + <_> + 2 5 16 2 -1. + <_> + 10 5 8 2 2. + <_> + + <_> + 6 0 8 9 -1. + <_> + 6 0 4 9 2. + <_> + + <_> + 3 2 10 6 -1. + <_> + 3 2 5 3 2. + <_> + 8 5 5 3 2. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 14 1 3 13 -1. + <_> + 15 1 1 13 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 11 10 8 6 -1. + <_> + 11 12 8 2 3. + <_> + + <_> + 1 10 8 6 -1. + <_> + 1 12 8 2 3. + <_> + + <_> + 3 3 14 3 -1. + <_> + 3 4 14 1 3. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 4 2 15 9 -1. + <_> + 4 5 15 3 3. + <_> + + <_> + 0 1 13 3 -1. + <_> + 0 2 13 1 3. + <_> + + <_> + 8 14 10 6 -1. + <_> + 13 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 12 12 8 6 -1. + <_> + 12 14 8 2 3. + <_> + + <_> + 0 12 8 6 -1. + <_> + 0 14 8 2 3. + <_> + + <_> + 6 16 14 4 -1. + <_> + 13 16 7 2 2. + <_> + 6 18 7 2 2. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 4 16 16 4 -1. + <_> + 12 16 8 2 2. + <_> + 4 18 8 2 2. + <_> + + <_> + 0 16 16 4 -1. + <_> + 0 16 8 2 2. + <_> + 8 18 8 2 2. + <_> + + <_> + 8 4 6 5 -1. + <_> + 8 4 3 5 2. + <_> + + <_> + 6 4 6 5 -1. + <_> + 9 4 3 5 2. + <_> + + <_> + 8 7 4 8 -1. + <_> + 8 11 4 4 2. + <_> + + <_> + 4 6 10 12 -1. + <_> + 4 12 10 6 2. + <_> + + <_> + 1 5 18 12 -1. + <_> + 1 9 18 4 3. + <_> + + <_> + 4 6 9 4 -1. + <_> + 4 8 9 2 2. + <_> + + <_> + 1 5 19 3 -1. + <_> + 1 6 19 1 3. + <_> + + <_> + 2 3 12 14 -1. + <_> + 2 3 6 7 2. + <_> + 8 10 6 7 2. + <_> + + <_> + 13 0 3 16 -1. + <_> + 13 8 3 8 2. + <_> + + <_> + 4 0 3 16 -1. + <_> + 4 8 3 8 2. + <_> + + <_> + 4 0 12 14 -1. + <_> + 8 0 4 14 3. + <_> + + <_> + 0 10 10 6 -1. + <_> + 0 10 5 3 2. + <_> + 5 13 5 3 2. + <_> + + <_> + 7 4 13 3 -1. + <_> + 7 5 13 1 3. + <_> + + <_> + 2 5 6 10 -1. + <_> + 5 5 3 10 2. + <_> + + <_> + 11 6 8 14 -1. + <_> + 15 6 4 7 2. + <_> + 11 13 4 7 2. + <_> + + <_> + 3 1 3 13 -1. + <_> + 4 1 1 13 3. + <_> + + <_> + 11 6 8 14 -1. + <_> + 15 6 4 7 2. + <_> + 11 13 4 7 2. + <_> + + <_> + 3 1 3 13 -1. + <_> + 4 1 1 13 3. + <_> + + <_> + 9 5 10 9 -1. + <_> + 9 5 5 9 2. + <_> + + <_> + 1 6 8 14 -1. + <_> + 1 6 4 7 2. + <_> + 5 13 4 7 2. + <_> + + <_> + 11 13 9 6 -1. + <_> + 11 15 9 2 3. + <_> + + <_> + 0 13 9 6 -1. + <_> + 0 15 9 2 3. + <_> + + <_> + 12 11 8 9 -1. + <_> + 12 14 8 3 3. + <_> + + <_> + 2 11 15 9 -1. + <_> + 2 14 15 3 3. + <_> + + <_> + 2 16 18 4 -1. + <_> + 8 16 6 4 3. + <_> + + <_> + 1 9 18 3 -1. + <_> + 7 9 6 3 3. + <_> + + <_> + 14 0 6 10 -1. + <_> + 14 0 3 10 2. + <_> + + <_> + 0 0 6 10 -1. + <_> + 3 0 3 10 2. + <_> + + <_> + 13 1 4 16 -1. + <_> + 15 1 2 8 2. + <_> + 13 9 2 8 2. + <_> + + <_> + 1 9 6 11 -1. + <_> + 3 9 2 11 3. + <_> + + <_> + 6 12 13 3 -1. + <_> + 6 13 13 1 3. + <_> + + <_> + 0 0 12 10 -1. + <_> + 0 0 6 5 2. + <_> + 6 5 6 5 2. + <_> + + <_> + 4 5 13 3 -1. + <_> + 4 6 13 1 3. + <_> + + <_> + 0 4 7 6 -1. + <_> + 0 6 7 2 3. + <_> + + <_> + 13 6 4 8 -1. + <_> + 13 10 4 4 2. + <_> + + <_> + 3 6 4 8 -1. + <_> + 3 10 4 4 2. + <_> + + <_> + 15 8 5 6 -1. + <_> + 15 11 5 3 2. + <_> + + <_> + 0 4 13 3 -1. + <_> + 0 5 13 1 3. + <_> + + <_> + 9 8 10 6 -1. + <_> + 14 8 5 3 2. + <_> + 9 11 5 3 2. + <_> + + <_> + 1 8 10 6 -1. + <_> + 1 8 5 3 2. + <_> + 6 11 5 3 2. + <_> + + <_> + 5 5 15 6 -1. + <_> + 5 8 15 3 2. + <_> + + <_> + 2 8 14 2 -1. + <_> + 9 8 7 2 2. + <_> + + <_> + 9 1 6 7 -1. + <_> + 9 1 3 7 2. + <_> + + <_> + 5 1 6 7 -1. + <_> + 8 1 3 7 2. + <_> + + <_> + 0 6 20 6 -1. + <_> + 0 9 20 3 2. + <_> + + <_> + 2 8 15 2 -1. + <_> + 2 9 15 1 2. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 0 2 15 6 -1. + <_> + 0 4 15 2 3. + <_> + + <_> + 5 2 15 2 -1. + <_> + 5 3 15 1 2. + <_> + + <_> + 5 9 7 4 -1. + <_> + 5 11 7 2 2. + <_> + + <_> + 13 9 4 8 -1. + <_> + 13 13 4 4 2. + <_> + + <_> + 1 9 7 6 -1. + <_> + 1 11 7 2 3. + <_> + + <_> + 12 11 5 6 -1. + <_> + 12 14 5 3 2. + <_> + + <_> + 3 3 14 9 -1. + <_> + 3 6 14 3 3. + <_> + + <_> + 12 11 5 6 -1. + <_> + 12 14 5 3 2. + <_> + + <_> + 3 11 5 6 -1. + <_> + 3 14 5 3 2. + <_> + + <_> + 2 9 17 8 -1. + <_> + 2 13 17 4 2. + <_> + + <_> + 6 8 7 12 -1. + <_> + 6 12 7 4 3. + <_> + + <_> + 11 0 4 9 -1. + <_> + 11 0 2 9 2. + <_> + + <_> + 6 2 4 16 -1. + <_> + 6 2 2 8 2. + <_> + 8 10 2 8 2. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 10 4 10 6 -1. + <_> + 15 4 5 3 2. + <_> + 10 7 5 3 2. + <_> + + <_> + 0 0 18 4 -1. + <_> + 6 0 6 4 3. + <_> + + <_> + 7 1 9 7 -1. + <_> + 10 1 3 7 3. + <_> + + <_> + 4 1 9 7 -1. + <_> + 7 1 3 7 3. + <_> + + <_> + 9 0 2 13 -1. + <_> + 9 0 1 13 2. + <_> + + <_> + 1 1 12 17 -1. + <_> + 5 1 4 17 3. + <_> + + <_> + 9 1 6 12 -1. + <_> + 12 1 3 6 2. + <_> + 9 7 3 6 2. + <_> + + <_> + 2 5 9 15 -1. + <_> + 5 5 3 15 3. + <_> + + <_> + 4 0 16 4 -1. + <_> + 12 0 8 2 2. + <_> + 4 2 8 2 2. + <_> + + <_> + 0 0 16 4 -1. + <_> + 0 0 8 2 2. + <_> + 8 2 8 2 2. + <_> + + <_> + 10 4 10 6 -1. + <_> + 15 4 5 3 2. + <_> + 10 7 5 3 2. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 5 13 13 2 -1. + <_> + 5 14 13 1 2. + <_> + + <_> + 0 4 10 6 -1. + <_> + 0 4 5 3 2. + <_> + 5 7 5 3 2. + <_> + + <_> + 8 11 12 5 -1. + <_> + 12 11 4 5 3. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 11 13 7 6 -1. + <_> + 11 15 7 2 3. + <_> + + <_> + 1 14 18 6 -1. + <_> + 1 17 18 3 2. + <_> + + <_> + 3 1 14 6 -1. + <_> + 3 3 14 2 3. + <_> + + <_> + 12 0 6 6 -1. + <_> + 12 0 3 6 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 5 7 12 5 -1. + <_> + 9 7 4 5 3. + <_> + + <_> + 5 10 4 8 -1. + <_> + 5 14 4 4 2. + <_> + + <_> + 13 0 4 14 -1. + <_> + 15 0 2 7 2. + <_> + 13 7 2 7 2. + <_> + + <_> + 2 0 9 5 -1. + <_> + 5 0 3 5 3. + <_> + + <_> + 9 2 6 16 -1. + <_> + 12 2 3 8 2. + <_> + 9 10 3 8 2. + <_> + + <_> + 6 5 2 14 -1. + <_> + 6 12 2 7 2. + <_> + + <_> + 15 4 4 16 -1. + <_> + 17 4 2 8 2. + <_> + 15 12 2 8 2. + <_> + + <_> + 5 1 10 8 -1. + <_> + 5 1 5 4 2. + <_> + 10 5 5 4 2. + <_> + + <_> + 11 7 7 6 -1. + <_> + 11 9 7 2 3. + <_> + + <_> + 1 2 14 3 -1. + <_> + 1 3 14 1 3. + <_> + + <_> + 13 5 4 8 -1. + <_> + 13 9 4 4 2. + <_> + + <_> + 2 10 7 6 -1. + <_> + 2 12 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 5 18 8 -1. + <_> + 0 5 9 4 2. + <_> + 9 9 9 4 2. + <_> + + <_> + 13 5 4 14 -1. + <_> + 15 5 2 7 2. + <_> + 13 12 2 7 2. + <_> + + <_> + 0 0 4 13 -1. + <_> + 2 0 2 13 2. + <_> + + <_> + 13 5 4 14 -1. + <_> + 15 5 2 7 2. + <_> + 13 12 2 7 2. + <_> + + <_> + 3 5 4 14 -1. + <_> + 3 5 2 7 2. + <_> + 5 12 2 7 2. + <_> + + <_> + 11 12 7 6 -1. + <_> + 11 14 7 2 3. + <_> + + <_> + 2 12 7 6 -1. + <_> + 2 14 7 2 3. + <_> + + <_> + 13 4 6 16 -1. + <_> + 16 4 3 8 2. + <_> + 13 12 3 8 2. + <_> + + <_> + 0 9 10 6 -1. + <_> + 0 9 5 3 2. + <_> + 5 12 5 3 2. + <_> + + <_> + 9 5 3 15 -1. + <_> + 9 10 3 5 3. + <_> + + <_> + 8 2 4 10 -1. + <_> + 10 2 2 10 2. + <_> + + <_> + 13 4 6 16 -1. + <_> + 16 4 3 8 2. + <_> + 13 12 3 8 2. + <_> + + <_> + 1 8 18 5 -1. + <_> + 7 8 6 5 3. + <_> + + <_> + 13 4 6 16 -1. + <_> + 16 4 3 8 2. + <_> + 13 12 3 8 2. + <_> + + <_> + 1 4 6 16 -1. + <_> + 1 4 3 8 2. + <_> + 4 12 3 8 2. + <_> + + <_> + 2 15 18 4 -1. + <_> + 11 15 9 2 2. + <_> + 2 17 9 2 2. + <_> + + <_> + 7 3 2 16 -1. + <_> + 7 11 2 8 2. + <_> + + <_> + 0 4 20 4 -1. + <_> + 0 6 20 2 2. + <_> + + <_> + 2 14 13 3 -1. + <_> + 2 15 13 1 3. + <_> + + <_> + 14 1 6 17 -1. + <_> + 14 1 3 17 2. + <_> + + <_> + 2 9 7 6 -1. + <_> + 2 11 7 2 3. + <_> + + <_> + 11 0 6 16 -1. + <_> + 14 0 3 8 2. + <_> + 11 8 3 8 2. + <_> + + <_> + 1 14 13 3 -1. + <_> + 1 15 13 1 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 3 0 6 16 -1. + <_> + 3 0 3 8 2. + <_> + 6 8 3 8 2. + <_> + + <_> + 10 12 10 3 -1. + <_> + 10 12 5 3 2. + <_> + + <_> + 3 7 12 5 -1. + <_> + 7 7 4 5 3. + <_> + + <_> + 1 0 18 6 -1. + <_> + 7 0 6 6 3. + <_> + + <_> + 0 12 10 3 -1. + <_> + 5 12 5 3 2. + <_> + + <_> + 4 10 12 4 -1. + <_> + 8 10 4 4 3. + <_> + + <_> + 5 5 6 8 -1. + <_> + 7 5 2 8 3. + <_> + + <_> + 11 9 9 6 -1. + <_> + 11 11 9 2 3. + <_> + + <_> + 4 7 7 9 -1. + <_> + 4 10 7 3 3. + <_> + + <_> + 5 14 10 6 -1. + <_> + 5 16 10 2 3. + <_> + + <_> + 0 14 19 4 -1. + <_> + 0 16 19 2 2. + <_> + + <_> + 6 9 12 8 -1. + <_> + 12 9 6 4 2. + <_> + 6 13 6 4 2. + <_> + + <_> + 1 1 3 14 -1. + <_> + 2 1 1 14 3. + <_> + + <_> + 6 9 12 8 -1. + <_> + 12 9 6 4 2. + <_> + 6 13 6 4 2. + <_> + + <_> + 2 9 12 8 -1. + <_> + 2 9 6 4 2. + <_> + 8 13 6 4 2. + <_> + + <_> + 18 2 2 18 -1. + <_> + 18 2 1 18 2. + <_> + + <_> + 6 5 6 8 -1. + <_> + 8 5 2 8 3. + <_> + + <_> + 10 3 4 12 -1. + <_> + 10 3 2 12 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 9 8 6 12 -1. + <_> + 12 8 3 6 2. + <_> + 9 14 3 6 2. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 18 2 2 18 -1. + <_> + 18 2 1 18 2. + <_> + + <_> + 1 5 17 6 -1. + <_> + 1 7 17 2 3. + <_> + + <_> + 15 3 5 6 -1. + <_> + 15 6 5 3 2. + <_> + + <_> + 4 0 12 6 -1. + <_> + 4 2 12 2 3. + <_> + + <_> + 15 3 5 6 -1. + <_> + 15 6 5 3 2. + <_> + + <_> + 3 0 14 6 -1. + <_> + 3 2 14 2 3. + <_> + + <_> + 15 3 5 6 -1. + <_> + 15 6 5 3 2. + <_> + + <_> + 0 3 5 6 -1. + <_> + 0 6 5 3 2. + <_> + + <_> + 4 1 14 10 -1. + <_> + 4 6 14 5 2. + <_> + + <_> + 0 1 7 4 -1. + <_> + 0 3 7 2 2. + <_> + + <_> + 13 1 7 4 -1. + <_> + 13 3 7 2 2. + <_> + + <_> + 1 4 10 9 -1. + <_> + 6 4 5 9 2. + <_> + + <_> + 10 1 10 19 -1. + <_> + 10 1 5 19 2. + <_> + + <_> + 0 1 10 19 -1. + <_> + 5 1 5 19 2. + <_> + + <_> + 13 5 4 12 -1. + <_> + 13 9 4 4 3. + <_> + + <_> + 3 5 4 12 -1. + <_> + 3 9 4 4 3. + <_> + + <_> + 2 0 18 4 -1. + <_> + 11 0 9 2 2. + <_> + 2 2 9 2 2. + <_> + + <_> + 6 8 6 5 -1. + <_> + 9 8 3 5 2. + <_> + + <_> + 6 5 12 8 -1. + <_> + 12 5 6 4 2. + <_> + 6 9 6 4 2. + <_> + + <_> + 2 5 12 8 -1. + <_> + 2 5 6 4 2. + <_> + 8 9 6 4 2. + <_> + + <_> + 5 4 13 3 -1. + <_> + 5 5 13 1 3. + <_> + + <_> + 2 4 13 3 -1. + <_> + 2 5 13 1 3. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 7 12 13 2 -1. + <_> + 7 13 13 1 2. + <_> + + <_> + 2 4 15 3 -1. + <_> + 2 5 15 1 3. + <_> + + <_> + 1 14 18 4 -1. + <_> + 10 14 9 2 2. + <_> + 1 16 9 2 2. + <_> + + <_> + 5 8 6 10 -1. + <_> + 5 8 3 5 2. + <_> + 8 13 3 5 2. + <_> + + <_> + 12 4 3 10 -1. + <_> + 12 9 3 5 2. + <_> + + <_> + 2 0 14 3 -1. + <_> + 2 1 14 1 3. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 0 1 15 3 -1. + <_> + 0 2 15 1 3. + <_> + + <_> + 2 1 16 4 -1. + <_> + 2 3 16 2 2. + <_> + + <_> + 0 1 5 9 -1. + <_> + 0 4 5 3 3. + <_> + + <_> + 3 5 15 3 -1. + <_> + 3 6 15 1 3. + <_> + + <_> + 1 5 10 6 -1. + <_> + 1 5 5 3 2. + <_> + 6 8 5 3 2. + <_> + + <_> + 9 2 3 12 -1. + <_> + 9 8 3 6 2. + <_> + + <_> + 0 2 19 2 -1. + <_> + 0 3 19 1 2. + <_> + + <_> + 16 0 4 10 -1. + <_> + 16 0 2 10 2. + <_> + + <_> + 1 8 13 3 -1. + <_> + 1 9 13 1 3. + <_> + + <_> + 7 0 13 4 -1. + <_> + 7 2 13 2 2. + <_> + + <_> + 4 4 3 10 -1. + <_> + 4 9 3 5 2. + <_> + + <_> + 7 9 6 7 -1. + <_> + 9 9 2 7 3. + <_> + + <_> + 4 3 3 13 -1. + <_> + 5 3 1 13 3. + <_> + + <_> + 14 10 6 6 -1. + <_> + 14 10 3 6 2. + <_> + + <_> + 8 0 3 15 -1. + <_> + 8 5 3 5 3. + <_> + + <_> + 12 0 8 8 -1. + <_> + 16 0 4 4 2. + <_> + 12 4 4 4 2. + <_> + + <_> + 7 4 6 9 -1. + <_> + 7 7 6 3 3. + <_> + + <_> + 11 9 9 6 -1. + <_> + 11 11 9 2 3. + <_> + + <_> + 5 13 9 5 -1. + <_> + 8 13 3 5 3. + <_> + + <_> + 9 9 6 10 -1. + <_> + 12 9 3 5 2. + <_> + 9 14 3 5 2. + <_> + + <_> + 5 9 6 10 -1. + <_> + 5 9 3 5 2. + <_> + 8 14 3 5 2. + <_> + + <_> + 13 10 6 10 -1. + <_> + 16 10 3 5 2. + <_> + 13 15 3 5 2. + <_> + + <_> + 1 10 6 10 -1. + <_> + 1 10 3 5 2. + <_> + 4 15 3 5 2. + <_> + + <_> + 10 3 4 12 -1. + <_> + 10 3 2 12 2. + <_> + + <_> + 6 3 4 12 -1. + <_> + 8 3 2 12 2. + <_> + + <_> + 11 1 9 5 -1. + <_> + 14 1 3 5 3. + <_> + + <_> + 2 9 16 3 -1. + <_> + 10 9 8 3 2. + <_> + + <_> + 6 2 8 10 -1. + <_> + 10 2 4 5 2. + <_> + 6 7 4 5 2. + <_> + + <_> + 0 0 8 8 -1. + <_> + 0 0 4 4 2. + <_> + 4 4 4 4 2. + <_> + + <_> + 12 10 6 10 -1. + <_> + 14 10 2 10 3. + <_> + + <_> + 0 1 9 5 -1. + <_> + 3 1 3 5 3. + <_> + + <_> + 16 0 4 17 -1. + <_> + 16 0 2 17 2. + <_> + + <_> + 2 0 6 20 -1. + <_> + 4 0 2 20 3. + <_> + + <_> + 16 0 4 17 -1. + <_> + 16 0 2 17 2. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 6 8 12 4 -1. + <_> + 10 8 4 4 3. + <_> + + <_> + 8 5 3 14 -1. + <_> + 8 12 3 7 2. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 1 3 14 15 -1. + <_> + 1 8 14 5 3. + <_> + + <_> + 16 0 4 16 -1. + <_> + 16 0 2 16 2. + <_> + + <_> + 4 6 10 9 -1. + <_> + 4 9 10 3 3. + <_> + + <_> + 16 0 4 16 -1. + <_> + 16 0 2 16 2. + <_> + + <_> + 0 0 4 16 -1. + <_> + 2 0 2 16 2. + <_> + + <_> + 15 9 4 7 -1. + <_> + 15 9 2 7 2. + <_> + + <_> + 0 0 9 6 -1. + <_> + 3 0 3 6 3. + <_> + + <_> + 12 11 8 4 -1. + <_> + 12 13 8 2 2. + <_> + + <_> + 1 9 4 7 -1. + <_> + 3 9 2 7 2. + <_> + + <_> + 14 10 6 6 -1. + <_> + 14 10 3 6 2. + <_> + + <_> + 1 7 2 13 -1. + <_> + 2 7 1 13 2. + <_> + + <_> + 1 2 18 11 -1. + <_> + 7 2 6 11 3. + <_> + + <_> + 6 2 4 7 -1. + <_> + 8 2 2 7 2. + <_> + + <_> + 0 6 20 14 -1. + <_> + 10 6 10 7 2. + <_> + 0 13 10 7 2. + <_> + + <_> + 0 5 18 15 -1. + <_> + 6 5 6 15 3. + <_> + + <_> + 16 5 4 15 -1. + <_> + 16 5 2 15 2. + <_> + + <_> + 5 6 6 7 -1. + <_> + 7 6 2 7 3. + <_> + + <_> + 6 8 12 4 -1. + <_> + 10 8 4 4 3. + <_> + + <_> + 5 10 10 6 -1. + <_> + 5 13 10 3 2. + <_> + + <_> + 3 7 17 12 -1. + <_> + 3 13 17 6 2. + <_> + + <_> + 0 7 17 12 -1. + <_> + 0 13 17 6 2. + <_> + + <_> + 2 0 18 19 -1. + <_> + 8 0 6 19 3. + <_> + + <_> + 7 2 4 7 -1. + <_> + 9 2 2 7 2. + <_> + + <_> + 9 7 7 8 -1. + <_> + 9 11 7 4 2. + <_> + + <_> + 0 10 19 2 -1. + <_> + 0 11 19 1 2. + <_> + + <_> + 11 9 9 6 -1. + <_> + 11 11 9 2 3. + <_> + + <_> + 0 0 15 3 -1. + <_> + 5 0 5 3 3. + <_> + + <_> + 18 7 2 13 -1. + <_> + 18 7 1 13 2. + <_> + + <_> + 0 9 9 6 -1. + <_> + 0 11 9 2 3. + <_> + + <_> + 9 7 7 8 -1. + <_> + 9 11 7 4 2. + <_> + + <_> + 4 7 7 8 -1. + <_> + 4 11 7 4 2. + <_> + + <_> + 3 3 16 2 -1. + <_> + 3 4 16 1 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 10 4 4 2. + <_> + 10 14 4 4 2. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 6 12 10 6 -1. + <_> + 6 14 10 2 3. + <_> + + <_> + 0 13 7 6 -1. + <_> + 0 15 7 2 3. + <_> + + <_> + 3 11 15 9 -1. + <_> + 3 14 15 3 3. + <_> + + <_> + 0 7 2 13 -1. + <_> + 1 7 1 13 2. + <_> + + <_> + 10 0 10 20 -1. + <_> + 10 0 5 20 2. + <_> + + <_> + 0 0 10 20 -1. + <_> + 5 0 5 20 2. + <_> + + <_> + 5 12 13 3 -1. + <_> + 5 13 13 1 3. + <_> + + <_> + 5 6 6 8 -1. + <_> + 5 10 6 4 2. + <_> + + <_> + 4 0 13 18 -1. + <_> + 4 9 13 9 2. + <_> + + <_> + 0 0 15 4 -1. + <_> + 5 0 5 4 3. + <_> + + <_> + 4 7 15 3 -1. + <_> + 9 7 5 3 3. + <_> + + <_> + 6 8 6 6 -1. + <_> + 9 8 3 6 2. + <_> + + <_> + 0 8 20 2 -1. + <_> + 0 8 10 2 2. + <_> + + <_> + 5 0 3 14 -1. + <_> + 6 0 1 14 3. + <_> + + <_> + 13 2 5 12 -1. + <_> + 13 6 5 4 3. + <_> + + <_> + 4 4 12 6 -1. + <_> + 4 4 6 3 2. + <_> + 10 7 6 3 2. + <_> + + <_> + 7 1 9 8 -1. + <_> + 10 1 3 8 3. + <_> + + <_> + 1 1 6 10 -1. + <_> + 1 1 3 5 2. + <_> + 4 6 3 5 2. + <_> + + <_> + 11 10 8 8 -1. + <_> + 11 14 8 4 2. + <_> + + <_> + 1 10 8 8 -1. + <_> + 1 14 8 4 2. + <_> + + <_> + 13 8 3 12 -1. + <_> + 13 14 3 6 2. + <_> + + <_> + 4 8 3 12 -1. + <_> + 4 14 3 6 2. + <_> + + <_> + 13 0 3 13 -1. + <_> + 14 0 1 13 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 7 1 9 8 -1. + <_> + 10 1 3 8 3. + <_> + + <_> + 4 1 9 8 -1. + <_> + 7 1 3 8 3. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 5 2 6 10 -1. + <_> + 5 2 3 5 2. + <_> + 8 7 3 5 2. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 14 0 6 10 -1. + <_> + 17 0 3 5 2. + <_> + 14 5 3 5 2. + <_> + + <_> + 0 0 6 10 -1. + <_> + 0 0 3 5 2. + <_> + 3 5 3 5 2. + <_> + + <_> + 8 5 6 7 -1. + <_> + 8 5 3 7 2. + <_> + + <_> + 5 3 4 8 -1. + <_> + 7 3 2 8 2. + <_> + + <_> + 15 2 5 9 -1. + <_> + 15 5 5 3 3. + <_> + + <_> + 1 4 4 16 -1. + <_> + 1 4 2 8 2. + <_> + 3 12 2 8 2. + <_> + + <_> + 3 14 16 4 -1. + <_> + 11 14 8 2 2. + <_> + 3 16 8 2 2. + <_> + + <_> + 5 2 9 6 -1. + <_> + 8 2 3 6 3. + <_> + + <_> + 6 1 14 2 -1. + <_> + 6 1 7 2 2. + <_> + + <_> + 0 1 14 2 -1. + <_> + 7 1 7 2 2. + <_> + + <_> + 8 0 8 8 -1. + <_> + 12 0 4 4 2. + <_> + 8 4 4 4 2. + <_> + + <_> + 5 4 10 14 -1. + <_> + 5 4 5 7 2. + <_> + 10 11 5 7 2. + <_> + + <_> + 2 0 18 4 -1. + <_> + 11 0 9 2 2. + <_> + 2 2 9 2 2. + <_> + + <_> + 6 5 6 7 -1. + <_> + 9 5 3 7 2. + <_> + + <_> + 4 10 14 4 -1. + <_> + 11 10 7 2 2. + <_> + 4 12 7 2 2. + <_> + + <_> + 2 10 14 4 -1. + <_> + 2 10 7 2 2. + <_> + 9 12 7 2 2. + <_> + + <_> + 7 1 9 6 -1. + <_> + 7 4 9 3 2. + <_> + + <_> + 6 0 7 8 -1. + <_> + 6 4 7 4 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 1 3 9 4 -1. + <_> + 1 5 9 2 2. + <_> + + <_> + 4 4 13 2 -1. + <_> + 4 5 13 1 2. + <_> + + <_> + 1 4 14 3 -1. + <_> + 1 5 14 1 3. + <_> + + <_> + 7 11 6 9 -1. + <_> + 9 11 2 9 3. + <_> + + <_> + 6 11 4 7 -1. + <_> + 8 11 2 7 2. + <_> + + <_> + 4 8 12 12 -1. + <_> + 4 8 6 12 2. + <_> + + <_> + 1 11 18 5 -1. + <_> + 10 11 9 5 2. + <_> + + <_> + 4 5 16 6 -1. + <_> + 4 7 16 2 3. + <_> + + <_> + 0 3 4 16 -1. + <_> + 0 3 2 8 2. + <_> + 2 11 2 8 2. + <_> + + <_> + 16 9 4 11 -1. + <_> + 16 9 2 11 2. + <_> + + <_> + 0 0 20 8 -1. + <_> + 0 4 20 4 2. + <_> + + <_> + 8 7 8 8 -1. + <_> + 12 7 4 4 2. + <_> + 8 11 4 4 2. + <_> + + <_> + 4 7 8 8 -1. + <_> + 4 7 4 4 2. + <_> + 8 11 4 4 2. + <_> + + <_> + 16 9 4 11 -1. + <_> + 16 9 2 11 2. + <_> + + <_> + 4 5 10 12 -1. + <_> + 4 5 5 6 2. + <_> + 9 11 5 6 2. + <_> + + <_> + 16 9 4 11 -1. + <_> + 16 9 2 11 2. + <_> + + <_> + 0 9 4 11 -1. + <_> + 2 9 2 11 2. + <_> + + <_> + 12 4 6 11 -1. + <_> + 12 4 3 11 2. + <_> + + <_> + 2 4 6 11 -1. + <_> + 5 4 3 11 2. + <_> + + <_> + 8 7 5 9 -1. + <_> + 8 10 5 3 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 0 3 20 4 -1. + <_> + 10 3 10 2 2. + <_> + 0 5 10 2 2. + <_> + + <_> + 0 15 18 4 -1. + <_> + 0 15 9 2 2. + <_> + 9 17 9 2 2. + <_> + + <_> + 6 14 13 3 -1. + <_> + 6 15 13 1 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 9 2 3 13 -1. + <_> + 10 2 1 13 3. + <_> + + <_> + 8 2 3 13 -1. + <_> + 9 2 1 13 3. + <_> + + <_> + 9 6 6 7 -1. + <_> + 9 6 3 7 2. + <_> + + <_> + 5 6 6 7 -1. + <_> + 8 6 3 7 2. + <_> + + <_> + 8 0 8 5 -1. + <_> + 8 0 4 5 2. + <_> + + <_> + 4 0 8 5 -1. + <_> + 8 0 4 5 2. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 5 1 6 19 -1. + <_> + 7 1 2 19 3. + <_> + + <_> + 3 0 15 20 -1. + <_> + 8 0 5 20 3. + <_> + + <_> + 0 4 14 3 -1. + <_> + 7 4 7 3 2. + <_> + + <_> + 4 4 14 6 -1. + <_> + 11 4 7 3 2. + <_> + 4 7 7 3 2. + <_> + + <_> + 0 5 10 6 -1. + <_> + 0 7 10 2 3. + <_> + + <_> + 6 7 14 3 -1. + <_> + 6 8 14 1 3. + <_> + + <_> + 2 2 5 12 -1. + <_> + 2 6 5 4 3. + <_> + + <_> + 9 9 7 4 -1. + <_> + 9 11 7 2 2. + <_> + + <_> + 4 9 7 4 -1. + <_> + 4 11 7 2 2. + <_> + + <_> + 3 8 14 3 -1. + <_> + 3 9 14 1 3. + <_> + + <_> + 3 13 13 3 -1. + <_> + 3 14 13 1 3. + <_> + + <_> + 9 1 4 10 -1. + <_> + 9 6 4 5 2. + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 3 10 17 2 -1. + <_> + 3 11 17 1 2. + <_> + + <_> + 0 0 6 17 -1. + <_> + 3 0 3 17 2. + <_> + + <_> + 14 0 6 12 -1. + <_> + 14 0 3 12 2. + <_> + + <_> + 2 0 4 16 -1. + <_> + 4 0 2 16 2. + <_> + + <_> + 14 1 6 7 -1. + <_> + 16 1 2 7 3. + <_> + + <_> + 0 1 6 7 -1. + <_> + 2 1 2 7 3. + <_> + + <_> + 9 1 9 12 -1. + <_> + 12 1 3 12 3. + <_> + + <_> + 2 1 9 12 -1. + <_> + 5 1 3 12 3. + <_> + + <_> + 13 5 4 12 -1. + <_> + 13 5 2 12 2. + <_> + + <_> + 3 5 4 12 -1. + <_> + 5 5 2 12 2. + <_> + + <_> + 6 8 12 4 -1. + <_> + 10 8 4 4 3. + <_> + + <_> + 2 8 12 4 -1. + <_> + 6 8 4 4 3. + <_> + + <_> + 2 9 18 11 -1. + <_> + 8 9 6 11 3. + <_> + + <_> + 6 11 6 6 -1. + <_> + 9 11 3 6 2. + <_> + + <_> + 1 12 19 2 -1. + <_> + 1 13 19 1 2. + <_> + + <_> + 0 12 13 3 -1. + <_> + 0 13 13 1 3. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 0 8 16 4 -1. + <_> + 0 8 8 2 2. + <_> + 8 10 8 2 2. + <_> + + <_> + 8 6 8 8 -1. + <_> + 12 6 4 4 2. + <_> + 8 10 4 4 2. + <_> + + <_> + 3 13 14 6 -1. + <_> + 3 15 14 2 3. + <_> + + <_> + 4 13 15 6 -1. + <_> + 4 15 15 2 3. + <_> + + <_> + 0 0 14 4 -1. + <_> + 7 0 7 4 2. + <_> + + <_> + 14 3 4 10 -1. + <_> + 14 8 4 5 2. + <_> + + <_> + 2 4 14 12 -1. + <_> + 2 4 7 6 2. + <_> + 9 10 7 6 2. + <_> + + <_> + 7 4 6 10 -1. + <_> + 10 4 3 5 2. + <_> + 7 9 3 5 2. + <_> + + <_> + 1 0 3 15 -1. + <_> + 1 5 3 5 3. + <_> + + <_> + 1 1 19 12 -1. + <_> + 1 5 19 4 3. + <_> + + <_> + 5 13 6 7 -1. + <_> + 7 13 2 7 3. + <_> + + <_> + 10 0 4 16 -1. + <_> + 12 0 2 8 2. + <_> + 10 8 2 8 2. + <_> + + <_> + 6 0 4 16 -1. + <_> + 6 0 2 8 2. + <_> + 8 8 2 8 2. + <_> + + <_> + 8 1 4 11 -1. + <_> + 8 1 2 11 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 0 11 20 3 -1. + <_> + 0 12 20 1 3. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 7 16 7 4 -1. + <_> + 7 18 7 2 2. + <_> + + <_> + 1 14 16 4 -1. + <_> + 1 14 8 2 2. + <_> + 9 16 8 2 2. + <_> + + <_> + 7 16 13 3 -1. + <_> + 7 17 13 1 3. + <_> + + <_> + 1 12 18 8 -1. + <_> + 1 12 9 4 2. + <_> + 10 16 9 4 2. + <_> + + <_> + 14 3 4 10 -1. + <_> + 14 8 4 5 2. + <_> + + <_> + 2 3 4 10 -1. + <_> + 2 8 4 5 2. + <_> + + <_> + 2 1 16 12 -1. + <_> + 2 7 16 6 2. + <_> + + <_> + 7 0 6 16 -1. + <_> + 7 8 6 8 2. + <_> + + <_> + 7 1 8 12 -1. + <_> + 7 7 8 6 2. + <_> + + <_> + 2 12 15 8 -1. + <_> + 7 12 5 8 3. + <_> + + <_> + 4 16 15 4 -1. + <_> + 9 16 5 4 3. + <_> + + <_> + 6 7 8 6 -1. + <_> + 10 7 4 6 2. + <_> + + <_> + 1 8 18 12 -1. + <_> + 1 8 9 12 2. + <_> + + <_> + 0 17 15 3 -1. + <_> + 5 17 5 3 3. + <_> + + <_> + 9 2 6 17 -1. + <_> + 11 2 2 17 3. + <_> + + <_> + 5 2 6 17 -1. + <_> + 7 2 2 17 3. + <_> + + <_> + 7 4 6 7 -1. + <_> + 9 4 2 7 3. + <_> + + <_> + 0 11 15 3 -1. + <_> + 0 12 15 1 3. + <_> + + <_> + 9 10 11 6 -1. + <_> + 9 12 11 2 3. + <_> + + <_> + 8 0 3 18 -1. + <_> + 9 0 1 18 3. + <_> + + <_> + 14 11 4 8 -1. + <_> + 14 15 4 4 2. + <_> + + <_> + 1 11 15 8 -1. + <_> + 1 15 15 4 2. + <_> + + <_> + 9 10 3 10 -1. + <_> + 9 15 3 5 2. + <_> + + <_> + 1 6 18 9 -1. + <_> + 1 9 18 3 3. + <_> + + <_> + 3 1 14 2 -1. + <_> + 3 2 14 1 2. + <_> + + <_> + 0 1 20 3 -1. + <_> + 0 2 20 1 3. + <_> + + <_> + 5 0 14 2 -1. + <_> + 5 1 14 1 2. + <_> + + <_> + 3 8 12 10 -1. + <_> + 7 8 4 10 3. + <_> + + <_> + 8 2 4 12 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 6 2 8 12 -1. + <_> + 6 6 8 4 3. + <_> + + <_> + 4 3 12 4 -1. + <_> + 4 5 12 2 2. + <_> + + <_> + 0 0 5 9 -1. + <_> + 0 3 5 3 3. + <_> + + <_> + 7 1 9 6 -1. + <_> + 7 4 9 3 2. + <_> + + <_> + 2 10 6 10 -1. + <_> + 4 10 2 10 3. + <_> + + <_> + 2 5 17 14 -1. + <_> + 2 12 17 7 2. + <_> + + <_> + 0 7 10 8 -1. + <_> + 0 11 10 4 2. + <_> + + <_> + 12 4 3 15 -1. + <_> + 13 4 1 15 3. + <_> + + <_> + 5 4 3 15 -1. + <_> + 6 4 1 15 3. + <_> + + <_> + 8 7 12 5 -1. + <_> + 12 7 4 5 3. + <_> + + <_> + 0 7 12 5 -1. + <_> + 4 7 4 5 3. + <_> + + <_> + 3 6 14 3 -1. + <_> + 3 7 14 1 3. + <_> + + <_> + 6 1 2 18 -1. + <_> + 7 1 1 18 2. + <_> + + <_> + 6 16 9 4 -1. + <_> + 6 18 9 2 2. + <_> + + <_> + 3 15 14 4 -1. + <_> + 3 17 14 2 2. + <_> + + <_> + 7 16 13 3 -1. + <_> + 7 17 13 1 3. + <_> + + <_> + 0 4 12 4 -1. + <_> + 4 4 4 4 3. + <_> + + <_> + 6 4 14 4 -1. + <_> + 13 4 7 2 2. + <_> + 6 6 7 2 2. + <_> + + <_> + 0 5 10 6 -1. + <_> + 0 7 10 2 3. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 3 12 10 8 -1. + <_> + 3 12 5 4 2. + <_> + 8 16 5 4 2. + <_> + + <_> + 12 10 5 9 -1. + <_> + 12 13 5 3 3. + <_> + + <_> + 0 13 14 4 -1. + <_> + 0 13 7 2 2. + <_> + 7 15 7 2 2. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 2 10 6 10 -1. + <_> + 2 10 3 5 2. + <_> + 5 15 3 5 2. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 0 14 7 6 -1. + <_> + 0 16 7 2 3. + <_> + + <_> + 0 12 20 6 -1. + <_> + 0 15 20 3 2. + <_> + + <_> + 1 16 16 4 -1. + <_> + 1 18 16 2 2. + <_> + + <_> + 12 10 5 9 -1. + <_> + 12 13 5 3 3. + <_> + + <_> + 3 10 5 9 -1. + <_> + 3 13 5 3 3. + <_> + + <_> + 5 8 13 12 -1. + <_> + 5 12 13 4 3. + <_> + + <_> + 5 5 10 6 -1. + <_> + 5 5 5 3 2. + <_> + 10 8 5 3 2. + <_> + + <_> + 5 5 10 6 -1. + <_> + 10 5 5 3 2. + <_> + 5 8 5 3 2. + <_> + + <_> + 0 3 13 2 -1. + <_> + 0 4 13 1 2. + <_> + + <_> + 8 2 12 4 -1. + <_> + 8 4 12 2 2. + <_> + + <_> + 5 0 8 6 -1. + <_> + 5 2 8 2 3. + <_> + + <_> + 5 2 14 4 -1. + <_> + 12 2 7 2 2. + <_> + 5 4 7 2 2. + <_> + + <_> + 5 0 10 8 -1. + <_> + 5 4 10 4 2. + <_> + + <_> + 12 0 8 4 -1. + <_> + 12 2 8 2 2. + <_> + + <_> + 8 9 4 8 -1. + <_> + 8 13 4 4 2. + <_> + + <_> + 9 10 5 8 -1. + <_> + 9 14 5 4 2. + <_> + + <_> + 0 14 12 4 -1. + <_> + 6 14 6 4 2. + <_> + + <_> + 4 6 14 4 -1. + <_> + 11 6 7 2 2. + <_> + 4 8 7 2 2. + <_> + + <_> + 4 4 11 10 -1. + <_> + 4 9 11 5 2. + <_> + + <_> + 7 1 9 12 -1. + <_> + 7 7 9 6 2. + <_> + + <_> + 8 5 3 15 -1. + <_> + 8 10 3 5 3. + <_> + + <_> + 7 13 13 3 -1. + <_> + 7 14 13 1 3. + <_> + + <_> + 0 4 20 6 -1. + <_> + 0 6 20 2 3. + <_> + + <_> + 5 3 12 4 -1. + <_> + 5 5 12 2 2. + <_> + + <_> + 6 11 8 8 -1. + <_> + 6 11 4 4 2. + <_> + 10 15 4 4 2. + <_> + + <_> + 5 15 13 3 -1. + <_> + 5 16 13 1 3. + <_> + + <_> + 0 13 18 4 -1. + <_> + 0 13 9 2 2. + <_> + 9 15 9 2 2. + <_> + + <_> + 10 0 3 13 -1. + <_> + 11 0 1 13 3. + <_> + + <_> + 7 0 3 13 -1. + <_> + 8 0 1 13 3. + <_> + + <_> + 2 0 18 18 -1. + <_> + 8 0 6 18 3. + <_> + + <_> + 2 2 12 15 -1. + <_> + 2 7 12 5 3. + <_> + + <_> + 7 1 11 18 -1. + <_> + 7 7 11 6 3. + <_> + + <_> + 8 5 4 14 -1. + <_> + 8 5 2 7 2. + <_> + 10 12 2 7 2. + <_> + + <_> + 10 5 3 14 -1. + <_> + 10 12 3 7 2. + <_> + + <_> + 7 5 3 14 -1. + <_> + 7 12 3 7 2. + <_> + + <_> + 3 4 14 4 -1. + <_> + 3 6 14 2 2. + <_> + + <_> + 0 5 20 4 -1. + <_> + 0 5 10 2 2. + <_> + 10 7 10 2 2. + <_> + + <_> + 8 4 4 14 -1. + <_> + 8 11 4 7 2. + <_> + + <_> + 15 3 4 16 -1. + <_> + 17 3 2 8 2. + <_> + 15 11 2 8 2. + <_> + + <_> + 2 0 4 7 -1. + <_> + 4 0 2 7 2. + <_> + + <_> + 12 6 5 9 -1. + <_> + 12 9 5 3 3. + <_> + + <_> + 2 1 8 6 -1. + <_> + 2 3 8 2 3. + <_> + + <_> + 10 1 4 8 -1. + <_> + 10 1 2 8 2. + <_> + + <_> + 6 1 4 8 -1. + <_> + 8 1 2 8 2. + <_> + + <_> + 10 10 7 6 -1. + <_> + 10 12 7 2 3. + <_> + + <_> + 4 6 5 6 -1. + <_> + 4 9 5 3 2. + <_> + + <_> + 7 15 7 4 -1. + <_> + 7 17 7 2 2. + <_> + + <_> + 8 6 4 8 -1. + <_> + 8 10 4 4 2. + <_> + + <_> + 10 10 7 6 -1. + <_> + 10 12 7 2 3. + <_> + + <_> + 3 10 7 6 -1. + <_> + 3 12 7 2 3. + <_> + + <_> + 8 6 6 12 -1. + <_> + 11 6 3 6 2. + <_> + 8 12 3 6 2. + <_> + + <_> + 5 6 4 14 -1. + <_> + 5 6 2 7 2. + <_> + 7 13 2 7 2. + <_> + + <_> + 0 15 20 2 -1. + <_> + 0 15 10 2 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 6 15 13 2 -1. + <_> + 6 16 13 1 2. + <_> + + <_> + 0 17 19 3 -1. + <_> + 0 18 19 1 3. + <_> + + <_> + 9 5 6 10 -1. + <_> + 12 5 3 5 2. + <_> + 9 10 3 5 2. + <_> + + <_> + 3 3 13 2 -1. + <_> + 3 4 13 1 2. + <_> + + <_> + 2 0 17 6 -1. + <_> + 2 2 17 2 3. + <_> + + <_> + 1 3 4 16 -1. + <_> + 1 3 2 8 2. + <_> + 3 11 2 8 2. + <_> + + <_> + 12 10 8 6 -1. + <_> + 12 12 8 2 3. + <_> + + <_> + 1 7 12 4 -1. + <_> + 5 7 4 4 3. + <_> + + <_> + 14 0 6 5 -1. + <_> + 14 0 3 5 2. + <_> + + <_> + 3 0 14 6 -1. + <_> + 10 0 7 6 2. + <_> + + <_> + 7 9 6 10 -1. + <_> + 10 9 3 5 2. + <_> + 7 14 3 5 2. + <_> + + <_> + 0 14 18 6 -1. + <_> + 6 14 6 6 3. + <_> + + <_> + 11 0 6 16 -1. + <_> + 14 0 3 8 2. + <_> + 11 8 3 8 2. + <_> + + <_> + 5 10 4 7 -1. + <_> + 7 10 2 7 2. + <_> + + <_> + 11 10 4 8 -1. + <_> + 11 10 2 8 2. + <_> + + <_> + 5 10 4 8 -1. + <_> + 7 10 2 8 2. + <_> + + <_> + 16 0 3 13 -1. + <_> + 17 0 1 13 3. + <_> + + <_> + 1 14 16 6 -1. + <_> + 9 14 8 6 2. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 5 0 10 6 -1. + <_> + 5 3 10 3 2. + <_> + + <_> + 6 4 14 15 -1. + <_> + 6 9 14 5 3. + <_> + + <_> + 3 1 14 4 -1. + <_> + 3 1 7 2 2. + <_> + 10 3 7 2 2. + <_> + + <_> + 8 3 6 10 -1. + <_> + 11 3 3 5 2. + <_> + 8 8 3 5 2. + <_> + + <_> + 6 3 6 10 -1. + <_> + 6 3 3 5 2. + <_> + 9 8 3 5 2. + <_> + + <_> + 12 4 3 10 -1. + <_> + 12 9 3 5 2. + <_> + + <_> + 5 4 3 10 -1. + <_> + 5 9 3 5 2. + <_> + + <_> + 11 0 6 5 -1. + <_> + 11 0 3 5 2. + <_> + + <_> + 5 7 10 6 -1. + <_> + 5 7 5 3 2. + <_> + 10 10 5 3 2. + <_> + + <_> + 1 10 19 3 -1. + <_> + 1 11 19 1 3. + <_> + + <_> + 1 0 3 13 -1. + <_> + 2 0 1 13 3. + <_> + + <_> + 14 1 6 16 -1. + <_> + 16 1 2 16 3. + <_> + + <_> + 3 5 14 12 -1. + <_> + 3 5 7 6 2. + <_> + 10 11 7 6 2. + <_> + + <_> + 14 1 6 16 -1. + <_> + 16 1 2 16 3. + <_> + + <_> + 0 1 6 16 -1. + <_> + 2 1 2 16 3. + <_> + + <_> + 4 2 12 4 -1. + <_> + 8 2 4 4 3. + <_> + + <_> + 3 9 12 6 -1. + <_> + 3 12 12 3 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 8 0 2 13 -1. + <_> + 9 0 1 13 2. + <_> + + <_> + 8 9 6 10 -1. + <_> + 11 9 3 5 2. + <_> + 8 14 3 5 2. + <_> + + <_> + 6 9 6 10 -1. + <_> + 6 9 3 5 2. + <_> + 9 14 3 5 2. + <_> + + <_> + 5 17 10 3 -1. + <_> + 5 17 5 3 2. + <_> + + <_> + 7 2 2 18 -1. + <_> + 8 2 1 18 2. + <_> + + <_> + 5 14 15 6 -1. + <_> + 10 14 5 6 3. + <_> + + <_> + 0 9 7 6 -1. + <_> + 0 11 7 2 3. + <_> + + <_> + 5 14 15 6 -1. + <_> + 10 14 5 6 3. + <_> + + <_> + 0 14 15 6 -1. + <_> + 5 14 5 6 3. + <_> + + <_> + 12 9 7 6 -1. + <_> + 12 11 7 2 3. + <_> + + <_> + 2 4 4 14 -1. + <_> + 2 4 2 7 2. + <_> + 4 11 2 7 2. + <_> + + <_> + 11 1 6 12 -1. + <_> + 14 1 3 6 2. + <_> + 11 7 3 6 2. + <_> + + <_> + 3 1 6 12 -1. + <_> + 3 1 3 6 2. + <_> + 6 7 3 6 2. + <_> + + <_> + 4 7 15 6 -1. + <_> + 9 7 5 6 3. + <_> + + <_> + 1 0 6 10 -1. + <_> + 1 0 3 5 2. + <_> + 4 5 3 5 2. + <_> + + <_> + 8 13 9 5 -1. + <_> + 11 13 3 5 3. + <_> + + <_> + 0 0 9 7 -1. + <_> + 3 0 3 7 3. + <_> + + <_> + 9 7 8 5 -1. + <_> + 9 7 4 5 2. + <_> + + <_> + 3 7 8 5 -1. + <_> + 7 7 4 5 2. + <_> + + <_> + 4 0 12 19 -1. + <_> + 8 0 4 19 3. + <_> + + <_> + 3 8 8 6 -1. + <_> + 7 8 4 6 2. + <_> + + <_> + 15 2 5 6 -1. + <_> + 15 5 5 3 2. + <_> + + <_> + 3 1 13 10 -1. + <_> + 3 6 13 5 2. + <_> + + <_> + 14 0 3 10 -1. + <_> + 14 5 3 5 2. + <_> + + <_> + 0 1 20 8 -1. + <_> + 0 1 10 4 2. + <_> + 10 5 10 4 2. + <_> + + <_> + 8 6 6 12 -1. + <_> + 11 6 3 6 2. + <_> + 8 12 3 6 2. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 8 10 6 10 -1. + <_> + 10 10 2 10 3. + <_> + + <_> + 9 3 2 14 -1. + <_> + 9 10 2 7 2. + <_> + + <_> + 11 1 4 18 -1. + <_> + 11 1 2 18 2. + <_> + + <_> + 5 1 4 18 -1. + <_> + 7 1 2 18 2. + <_> + + <_> + 7 1 8 5 -1. + <_> + 7 1 4 5 2. + <_> + + <_> + 5 5 6 8 -1. + <_> + 7 5 2 8 3. + <_> + + <_> + 12 9 7 6 -1. + <_> + 12 11 7 2 3. + <_> + + <_> + 1 9 7 6 -1. + <_> + 1 11 7 2 3. + <_> + + <_> + 9 10 7 4 -1. + <_> + 9 12 7 2 2. + <_> + + <_> + 0 2 5 9 -1. + <_> + 0 5 5 3 3. + <_> + + <_> + 10 2 6 9 -1. + <_> + 10 5 6 3 3. + <_> + + <_> + 0 1 18 6 -1. + <_> + 0 1 9 3 2. + <_> + 9 4 9 3 2. + <_> + + <_> + 5 6 14 3 -1. + <_> + 5 7 14 1 3. + <_> + + <_> + 0 12 6 5 -1. + <_> + 3 12 3 5 2. + <_> + + <_> + 10 10 9 6 -1. + <_> + 13 10 3 6 3. + <_> + + <_> + 0 9 5 9 -1. + <_> + 0 12 5 3 3. + <_> + + <_> + 8 0 8 19 -1. + <_> + 8 0 4 19 2. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 9 0 2 13 -1. + <_> + 9 0 1 13 2. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 12 12 8 6 -1. + <_> + 12 14 8 2 3. + <_> + + <_> + 3 9 9 6 -1. + <_> + 6 9 3 6 3. + <_> + + <_> + 6 4 12 14 -1. + <_> + 10 4 4 14 3. + <_> + + <_> + 2 4 12 14 -1. + <_> + 6 4 4 14 3. + <_> + + <_> + 7 1 8 5 -1. + <_> + 7 1 4 5 2. + <_> + + <_> + 4 0 8 19 -1. + <_> + 8 0 4 19 2. + <_> + + <_> + 8 13 9 5 -1. + <_> + 11 13 3 5 3. + <_> + + <_> + 3 13 9 5 -1. + <_> + 6 13 3 5 3. + <_> + + <_> + 4 1 12 4 -1. + <_> + 8 1 4 4 3. + <_> + + <_> + 1 2 8 18 -1. + <_> + 1 2 4 9 2. + <_> + 5 11 4 9 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 11 11 6 9 -1. + <_> + 11 14 6 3 3. + <_> + + <_> + 3 11 6 9 -1. + <_> + 3 14 6 3 3. + <_> + + <_> + 8 14 10 6 -1. + <_> + 13 14 5 3 2. + <_> + 8 17 5 3 2. + <_> + + <_> + 7 13 6 7 -1. + <_> + 9 13 2 7 3. + <_> + + <_> + 9 5 7 6 -1. + <_> + 9 7 7 2 3. + <_> + + <_> + 4 5 7 6 -1. + <_> + 4 7 7 2 3. + <_> + + <_> + 3 0 17 16 -1. + <_> + 3 8 17 8 2. + <_> + + <_> + 0 0 19 3 -1. + <_> + 0 1 19 1 3. + <_> + + <_> + 11 1 5 9 -1. + <_> + 11 4 5 3 3. + <_> + + <_> + 4 1 10 6 -1. + <_> + 4 4 10 3 2. + <_> + + <_> + 7 10 12 9 -1. + <_> + 7 13 12 3 3. + <_> + + <_> + 1 10 12 3 -1. + <_> + 7 10 6 3 2. + <_> + + <_> + 7 8 6 12 -1. + <_> + 10 8 3 6 2. + <_> + 7 14 3 6 2. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 14 5 3 2. + <_> + 7 17 5 3 2. + <_> + + <_> + 6 9 8 8 -1. + <_> + 10 9 4 4 2. + <_> + 6 13 4 4 2. + <_> + + <_> + 1 17 18 3 -1. + <_> + 7 17 6 3 3. + <_> + + <_> + 6 6 10 6 -1. + <_> + 11 6 5 3 2. + <_> + 6 9 5 3 2. + <_> + + <_> + 4 6 10 6 -1. + <_> + 4 6 5 3 2. + <_> + 9 9 5 3 2. + <_> + + <_> + 6 14 9 5 -1. + <_> + 9 14 3 5 3. + <_> + + <_> + 6 10 6 10 -1. + <_> + 8 10 2 10 3. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 8 8 4 7 -1. + <_> + 10 8 2 7 2. + <_> + + <_> + 8 10 8 4 -1. + <_> + 8 12 8 2 2. + <_> + + <_> + 0 0 10 9 -1. + <_> + 0 3 10 3 3. + <_> + + <_> + 9 1 8 4 -1. + <_> + 9 3 8 2 2. + <_> + + <_> + 4 5 5 6 -1. + <_> + 4 8 5 3 2. + <_> + + <_> + 8 6 9 4 -1. + <_> + 8 8 9 2 2. + <_> + + <_> + 0 0 3 13 -1. + <_> + 1 0 1 13 3. + <_> + + <_> + 13 1 6 11 -1. + <_> + 15 1 2 11 3. + <_> + + <_> + 1 1 6 11 -1. + <_> + 3 1 2 11 3. + <_> + + <_> + 11 0 6 5 -1. + <_> + 11 0 3 5 2. + <_> + + <_> + 4 2 6 17 -1. + <_> + 6 2 2 17 3. + <_> + + <_> + 8 12 8 8 -1. + <_> + 12 12 4 4 2. + <_> + 8 16 4 4 2. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 6 6 8 4 -1. + <_> + 6 8 8 2 2. + <_> + + <_> + 2 10 9 6 -1. + <_> + 2 13 9 3 2. + <_> + + <_> + 9 11 11 6 -1. + <_> + 9 14 11 3 2. + <_> + + <_> + 3 11 14 8 -1. + <_> + 3 11 7 4 2. + <_> + 10 15 7 4 2. + <_> + + <_> + 8 4 4 10 -1. + <_> + 8 9 4 5 2. + <_> + + <_> + 1 12 13 3 -1. + <_> + 1 13 13 1 3. + <_> + + <_> + 9 7 4 12 -1. + <_> + 9 11 4 4 3. + <_> + + <_> + 0 14 7 6 -1. + <_> + 0 17 7 3 2. + <_> + + <_> + 13 11 7 6 -1. + <_> + 13 13 7 2 3. + <_> + + <_> + 4 4 12 16 -1. + <_> + 4 12 12 8 2. + <_> + + <_> + 11 10 9 4 -1. + <_> + 11 12 9 2 2. + <_> + + <_> + 0 10 9 4 -1. + <_> + 0 12 9 2 2. + <_> + + <_> + 2 11 16 6 -1. + <_> + 2 14 16 3 2. + <_> + + <_> + 0 7 2 13 -1. + <_> + 1 7 1 13 2. + <_> + + <_> + 7 0 6 7 -1. + <_> + 9 0 2 7 3. + <_> + + <_> + 0 11 12 4 -1. + <_> + 4 11 4 4 3. + <_> + + <_> + 11 9 6 8 -1. + <_> + 13 9 2 8 3. + <_> + + <_> + 3 9 6 8 -1. + <_> + 5 9 2 8 3. + <_> + + <_> + 11 0 2 19 -1. + <_> + 11 0 1 19 2. + <_> + + <_> + 5 10 4 8 -1. + <_> + 7 10 2 8 2. + <_> + + <_> + 13 14 7 6 -1. + <_> + 13 16 7 2 3. + <_> + + <_> + 1 15 13 3 -1. + <_> + 1 16 13 1 3. + <_> + + <_> + 5 15 13 3 -1. + <_> + 5 16 13 1 3. + <_> + + <_> + 4 16 9 4 -1. + <_> + 4 18 9 2 2. + <_> + + <_> + 7 13 7 6 -1. + <_> + 7 15 7 2 3. + <_> + + <_> + 3 14 14 4 -1. + <_> + 3 14 7 2 2. + <_> + 10 16 7 2 2. + <_> + + <_> + 13 0 7 14 -1. + <_> + 13 7 7 7 2. + <_> + + <_> + 0 0 7 14 -1. + <_> + 0 7 7 7 2. + <_> + + <_> + 3 2 16 4 -1. + <_> + 3 2 8 4 2. + <_> + + <_> + 6 2 4 8 -1. + <_> + 6 6 4 4 2. + <_> + + <_> + 10 0 3 14 -1. + <_> + 10 7 3 7 2. + <_> + + <_> + 1 7 18 9 -1. + <_> + 1 10 18 3 3. + <_> + + <_> + 6 5 9 14 -1. + <_> + 9 5 3 14 3. + <_> + + <_> + 5 5 9 14 -1. + <_> + 8 5 3 14 3. + <_> + + <_> + 11 2 2 15 -1. + <_> + 11 2 1 15 2. + <_> + + <_> + 6 8 4 8 -1. + <_> + 8 8 2 8 2. + <_> + + <_> + 6 10 10 9 -1. + <_> + 6 13 10 3 3. + <_> + + <_> + 0 16 14 4 -1. + <_> + 0 16 7 2 2. + <_> + 7 18 7 2 2. + <_> + + <_> + 9 5 4 13 -1. + <_> + 9 5 2 13 2. + <_> + + <_> + 4 11 12 4 -1. + <_> + 8 11 4 4 3. + <_> + + <_> + 6 17 14 2 -1. + <_> + 6 17 7 2 2. + <_> + + <_> + 0 9 14 2 -1. + <_> + 7 9 7 2 2. + <_> + + <_> + 16 0 4 15 -1. + <_> + 16 0 2 15 2. + <_> + + <_> + 0 0 4 10 -1. + <_> + 2 0 2 10 2. + <_> + + <_> + 16 8 4 12 -1. + <_> + 16 12 4 4 3. + <_> + + <_> + 0 8 4 12 -1. + <_> + 0 12 4 4 3. + <_> + + <_> + 12 12 8 6 -1. + <_> + 12 14 8 2 3. + <_> + + <_> + 0 12 8 6 -1. + <_> + 0 14 8 2 3. + <_> + + <_> + 9 5 4 14 -1. + <_> + 11 5 2 7 2. + <_> + 9 12 2 7 2. + <_> + + <_> + 0 11 11 6 -1. + <_> + 0 14 11 3 2. + <_> + + <_> + 5 15 12 5 -1. + <_> + 9 15 4 5 3. + <_> + + <_> + 6 6 6 12 -1. + <_> + 6 6 3 6 2. + <_> + 9 12 3 6 2. + <_> + + <_> + 7 7 8 4 -1. + <_> + 7 7 4 4 2. + <_> + + <_> + 5 8 6 10 -1. + <_> + 5 8 3 5 2. + <_> + 8 13 3 5 2. + <_> + + <_> + 7 4 7 14 -1. + <_> + 7 11 7 7 2. + <_> + + <_> + 7 6 4 8 -1. + <_> + 7 10 4 4 2. + <_> + + <_> + 9 2 6 9 -1. + <_> + 9 5 6 3 3. + <_> + + <_> + 5 2 6 9 -1. + <_> + 5 5 6 3 3. + <_> + + <_> + 14 0 3 13 -1. + <_> + 15 0 1 13 3. + <_> + + <_> + 8 1 4 11 -1. + <_> + 10 1 2 11 2. + <_> + + <_> + 1 1 18 4 -1. + <_> + 10 1 9 2 2. + <_> + 1 3 9 2 2. + <_> + + <_> + 3 4 4 16 -1. + <_> + 3 4 2 8 2. + <_> + 5 12 2 8 2. + <_> + + <_> + 8 12 6 8 -1. + <_> + 10 12 2 8 3. + <_> + + <_> + 0 3 6 7 -1. + <_> + 2 3 2 7 3. + <_> + + <_> + 14 2 6 9 -1. + <_> + 14 5 6 3 3. + <_> + + <_> + 0 2 7 9 -1. + <_> + 0 5 7 3 3. + <_> + + <_> + 16 0 3 13 -1. + <_> + 17 0 1 13 3. + <_> + + <_> + 1 0 3 13 -1. + <_> + 2 0 1 13 3. + <_> + + <_> + 6 7 12 7 -1. + <_> + 6 7 6 7 2. + <_> + + <_> + 5 3 6 10 -1. + <_> + 5 3 3 5 2. + <_> + 8 8 3 5 2. + <_> + + <_> + 6 9 9 5 -1. + <_> + 9 9 3 5 3. + <_> + + <_> + 3 0 6 5 -1. + <_> + 6 0 3 5 2. + <_> + + <_> + 10 0 6 8 -1. + <_> + 12 0 2 8 3. + <_> + + <_> + 4 4 12 8 -1. + <_> + 4 4 6 4 2. + <_> + 10 8 6 4 2. + <_> + + <_> + 8 8 10 6 -1. + <_> + 13 8 5 3 2. + <_> + 8 11 5 3 2. + <_> + + <_> + 2 8 10 6 -1. + <_> + 2 8 5 3 2. + <_> + 7 11 5 3 2. + <_> + + <_> + 9 5 8 14 -1. + <_> + 13 5 4 7 2. + <_> + 9 12 4 7 2. + <_> + + <_> + 3 0 3 13 -1. + <_> + 4 0 1 13 3. + <_> + + <_> + 6 14 9 5 -1. + <_> + 9 14 3 5 3. + <_> + + <_> + 1 6 4 14 -1. + <_> + 1 6 2 7 2. + <_> + 3 13 2 7 2. + <_> + + <_> + 9 6 8 8 -1. + <_> + 13 6 4 4 2. + <_> + 9 10 4 4 2. + <_> + + <_> + 0 4 4 8 -1. + <_> + 2 4 2 8 2. + <_> + + <_> + 9 5 8 14 -1. + <_> + 13 5 4 7 2. + <_> + 9 12 4 7 2. + <_> + + <_> + 3 6 8 8 -1. + <_> + 3 6 4 4 2. + <_> + 7 10 4 4 2. + <_> + + <_> + 11 3 6 10 -1. + <_> + 14 3 3 5 2. + <_> + 11 8 3 5 2. + <_> + + <_> + 3 3 6 10 -1. + <_> + 3 3 3 5 2. + <_> + 6 8 3 5 2. + <_> + + <_> + 11 0 8 10 -1. + <_> + 15 0 4 5 2. + <_> + 11 5 4 5 2. + <_> + + <_> + 3 13 13 3 -1. + <_> + 3 14 13 1 3. + <_> + + <_> + 5 14 13 3 -1. + <_> + 5 15 13 1 3. + <_> + + <_> + 0 4 4 12 -1. + <_> + 0 8 4 4 3. + <_> + + <_> + 4 8 16 6 -1. + <_> + 12 8 8 3 2. + <_> + 4 11 8 3 2. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 12 11 7 6 -1. + <_> + 12 13 7 2 3. + <_> + + <_> + 2 9 9 7 -1. + <_> + 5 9 3 7 3. + <_> + + <_> + 5 6 15 9 -1. + <_> + 5 9 15 3 3. + <_> + + <_> + 0 6 15 9 -1. + <_> + 0 9 15 3 3. + <_> + + <_> + 6 8 14 2 -1. + <_> + 6 9 14 1 2. + <_> + + <_> + 3 8 10 3 -1. + <_> + 8 8 5 3 2. + <_> + + <_> + 11 0 9 5 -1. + <_> + 14 0 3 5 3. + <_> + + <_> + 2 6 16 2 -1. + <_> + 10 6 8 2 2. + <_> + + <_> + 5 12 12 8 -1. + <_> + 5 12 6 8 2. + <_> + + <_> + 0 3 18 3 -1. + <_> + 0 4 18 1 3. + <_> + + <_> + 3 15 14 4 -1. + <_> + 10 15 7 2 2. + <_> + 3 17 7 2 2. + <_> + + <_> + 2 7 16 2 -1. + <_> + 2 8 16 1 2. + <_> + + <_> + 10 2 7 6 -1. + <_> + 10 4 7 2 3. + <_> + + <_> + 0 10 19 2 -1. + <_> + 0 11 19 1 2. + <_> + + <_> + 13 0 7 18 -1. + <_> + 13 9 7 9 2. + <_> + + <_> + 1 9 9 5 -1. + <_> + 4 9 3 5 3. + <_> + + <_> + 18 0 2 17 -1. + <_> + 18 0 1 17 2. + <_> + + <_> + 0 0 2 16 -1. + <_> + 1 0 1 16 2. + <_> + + <_> + 7 1 6 10 -1. + <_> + 10 1 3 5 2. + <_> + 7 6 3 5 2. + <_> + + <_> + 0 9 12 11 -1. + <_> + 4 9 4 11 3. + <_> + + <_> + 10 2 4 16 -1. + <_> + 10 2 2 16 2. + <_> + + <_> + 6 2 4 16 -1. + <_> + 8 2 2 16 2. + <_> + + <_> + 9 0 3 13 -1. + <_> + 10 0 1 13 3. + <_> + + <_> + 7 4 4 12 -1. + <_> + 9 4 2 12 2. + <_> + + <_> + 7 9 10 9 -1. + <_> + 7 9 5 9 2. + <_> + + <_> + 0 6 13 3 -1. + <_> + 0 7 13 1 3. + <_> + + <_> + 10 2 7 6 -1. + <_> + 10 4 7 2 3. + <_> + + <_> + 4 2 11 6 -1. + <_> + 4 4 11 2 3. + <_> + + <_> + 9 1 8 4 -1. + <_> + 9 3 8 2 2. + <_> + + <_> + 5 5 6 10 -1. + <_> + 5 5 3 5 2. + <_> + 8 10 3 5 2. + <_> + + <_> + 15 3 3 13 -1. + <_> + 16 3 1 13 3. + <_> + + <_> + 2 3 3 13 -1. + <_> + 3 3 1 13 3. + <_> + + <_> + 13 1 3 13 -1. + <_> + 14 1 1 13 3. + <_> + + <_> + 4 1 10 6 -1. + <_> + 4 3 10 2 3. + <_> + + <_> + 0 2 20 8 -1. + <_> + 0 6 20 4 2. + <_> + + <_> + 2 1 13 18 -1. + <_> + 2 10 13 9 2. + <_> + + <_> + 9 5 3 10 -1. + <_> + 9 10 3 5 2. + <_> + + <_> + 3 6 12 14 -1. + <_> + 9 6 6 14 2. + <_> + + <_> + 8 12 6 6 -1. + <_> + 8 12 3 6 2. + <_> + + <_> + 1 9 18 3 -1. + <_> + 7 9 6 3 3. + <_> + + <_> + 2 14 18 2 -1. + <_> + 2 14 9 2 2. + <_> + + <_> + 4 1 3 13 -1. + <_> + 5 1 1 13 3. + <_> + + <_> + 11 6 6 7 -1. + <_> + 13 6 2 7 3. + <_> + + <_> + 3 6 6 7 -1. + <_> + 5 6 2 7 3. + <_> + + <_> + 12 0 3 13 -1. + <_> + 13 0 1 13 3. + <_> + + <_> + 8 6 3 13 -1. + <_> + 9 6 1 13 3. + <_> + + <_> + 8 8 5 12 -1. + <_> + 8 12 5 4 3. + <_> + + <_> + 2 4 8 5 -1. + <_> + 6 4 4 5 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 7 4 6 16 -1. + <_> + 7 4 3 8 2. + <_> + 10 12 3 8 2. + <_> + + <_> + 12 0 3 13 -1. + <_> + 13 0 1 13 3. + <_> + + <_> + 3 7 8 4 -1. + <_> + 3 9 8 2 2. + <_> + + <_> + 4 8 16 6 -1. + <_> + 12 8 8 3 2. + <_> + 4 11 8 3 2. + <_> + + <_> + 5 11 9 8 -1. + <_> + 5 15 9 4 2. + <_> + + <_> + 10 3 6 17 -1. + <_> + 12 3 2 17 3. + <_> + + <_> + 4 3 6 17 -1. + <_> + 6 3 2 17 3. + <_> + + <_> + 5 6 10 3 -1. + <_> + 5 6 5 3 2. + <_> + + <_> + 1 16 16 2 -1. + <_> + 9 16 8 2 2. + <_> + + <_> + 7 1 6 10 -1. + <_> + 9 1 2 10 3. + <_> + + <_> + 5 0 3 13 -1. + <_> + 6 0 1 13 3. + <_> + + <_> + 4 9 13 2 -1. + <_> + 4 10 13 1 2. + <_> + + <_> + 1 0 13 3 -1. + <_> + 1 1 13 1 3. + <_> + + <_> + 3 0 14 12 -1. + <_> + 3 4 14 4 3. + <_> + + <_> + 0 1 10 6 -1. + <_> + 0 4 10 3 2. + <_> + + <_> + 9 0 11 10 -1. + <_> + 9 5 11 5 2. + <_> + + <_> + 0 0 20 20 -1. + <_> + 0 10 20 10 2. + <_> + + <_> + 10 1 10 4 -1. + <_> + 10 1 5 4 2. + <_> + + <_> + 0 1 10 4 -1. + <_> + 5 1 5 4 2. + <_> + + <_> + 11 0 8 10 -1. + <_> + 15 0 4 5 2. + <_> + 11 5 4 5 2. + <_> + + <_> + 1 0 8 10 -1. + <_> + 1 0 4 5 2. + <_> + 5 5 4 5 2. + <_> + + <_> + 6 3 14 4 -1. + <_> + 13 3 7 2 2. + <_> + 6 5 7 2 2. + <_> + + <_> + 0 3 20 4 -1. + <_> + 0 3 10 2 2. + <_> + 10 5 10 2 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 11 5 2 7 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 6 6 8 7 -1. + <_> + 6 6 4 7 2. + <_> + + <_> + 8 6 4 7 -1. + <_> + 10 6 2 7 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 0 2 7 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 4 0 12 16 -1. + <_> + 8 0 4 16 3. + <_> + + <_> + 5 6 4 8 -1. + <_> + 7 6 2 8 2. + <_> + + <_> + 7 12 11 8 -1. + <_> + 7 16 11 4 2. + <_> + + <_> + 6 0 6 12 -1. + <_> + 6 0 3 6 2. + <_> + 9 6 3 6 2. + <_> + + <_> + 4 3 12 12 -1. + <_> + 10 3 6 6 2. + <_> + 4 9 6 6 2. + <_> + + <_> + 2 10 6 7 -1. + <_> + 4 10 2 7 3. + <_> + + <_> + 15 10 4 7 -1. + <_> + 15 10 2 7 2. + <_> + + <_> + 1 10 4 7 -1. + <_> + 3 10 2 7 2. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 3 2 13 2 -1. + <_> + 3 3 13 1 2. + <_> + + <_> + 4 3 14 3 -1. + <_> + 4 4 14 1 3. + <_> + + <_> + 1 0 7 6 -1. + <_> + 1 2 7 2 3. + <_> + + <_> + 6 5 13 9 -1. + <_> + 6 8 13 3 3. + <_> + + <_> + 0 8 16 6 -1. + <_> + 0 8 8 3 2. + <_> + 8 11 8 3 2. + <_> + + <_> + 15 1 5 12 -1. + <_> + 15 5 5 4 3. + <_> + + <_> + 0 1 5 12 -1. + <_> + 0 5 5 4 3. + <_> + + <_> + 5 14 14 3 -1. + <_> + 5 15 14 1 3. + <_> + + <_> + 2 10 6 9 -1. + <_> + 4 10 2 9 3. + <_> + + <_> + 11 13 9 7 -1. + <_> + 14 13 3 7 3. + <_> + + <_> + 0 15 9 5 -1. + <_> + 3 15 3 5 3. + <_> + + <_> + 16 9 4 11 -1. + <_> + 16 9 2 11 2. + <_> + + <_> + 0 11 19 3 -1. + <_> + 0 12 19 1 3. + <_> + + <_> + 6 15 14 4 -1. + <_> + 13 15 7 2 2. + <_> + 6 17 7 2 2. + <_> + + <_> + 0 5 12 6 -1. + <_> + 0 7 12 2 3. + <_> + + <_> + 16 9 4 11 -1. + <_> + 16 9 2 11 2. + <_> + + <_> + 0 9 4 11 -1. + <_> + 2 9 2 11 2. + <_> + + <_> + 2 11 18 5 -1. + <_> + 8 11 6 5 3. + <_> + + <_> + 1 15 14 4 -1. + <_> + 1 15 7 2 2. + <_> + 8 17 7 2 2. + <_> + + <_> + 12 10 7 9 -1. + <_> + 12 13 7 3 3. + <_> + + <_> + 1 10 7 9 -1. + <_> + 1 13 7 3 3. + <_> + + <_> + 11 7 8 8 -1. + <_> + 15 7 4 4 2. + <_> + 11 11 4 4 2. + <_> + + <_> + 6 14 8 4 -1. + <_> + 6 16 8 2 2. + <_> + + <_> + 11 1 2 19 -1. + <_> + 11 1 1 19 2. + <_> + + <_> + 6 10 3 10 -1. + <_> + 6 15 3 5 2. + <_> + + <_> + 11 9 6 5 -1. + <_> + 11 9 3 5 2. + <_> + + <_> + 3 9 6 5 -1. + <_> + 6 9 3 5 2. + <_> + + <_> + 4 12 15 4 -1. + <_> + 9 12 5 4 3. + <_> + + <_> + 0 5 16 2 -1. + <_> + 8 5 8 2 2. + <_> + + <_> + 6 6 14 4 -1. + <_> + 13 6 7 2 2. + <_> + 6 8 7 2 2. + <_> + + <_> + 3 5 8 14 -1. + <_> + 3 5 4 7 2. + <_> + 7 12 4 7 2. + <_> + + <_> + 12 2 7 15 -1. + <_> + 12 7 7 5 3. + <_> + + <_> + 1 2 7 15 -1. + <_> + 1 7 7 5 3. + <_> + + <_> + 13 0 6 12 -1. + <_> + 13 6 6 6 2. + <_> + + <_> + 6 0 8 10 -1. + <_> + 6 0 4 5 2. + <_> + 10 5 4 5 2. + <_> + + <_> + 11 0 2 19 -1. + <_> + 11 0 1 19 2. + <_> + + <_> + 4 12 8 8 -1. + <_> + 4 12 4 4 2. + <_> + 8 16 4 4 2. + <_> + + <_> + 4 12 15 4 -1. + <_> + 9 12 5 4 3. + <_> + + <_> + 7 0 2 19 -1. + <_> + 8 0 1 19 2. + <_> + + <_> + 8 4 6 9 -1. + <_> + 10 4 2 9 3. + <_> + + <_> + 5 5 8 4 -1. + <_> + 9 5 4 4 2. + <_> + + <_> + 4 12 15 4 -1. + <_> + 9 12 5 4 3. + <_> + + <_> + 2 6 4 12 -1. + <_> + 2 12 4 6 2. + <_> + + <_> + 6 7 12 6 -1. + <_> + 10 7 4 6 3. + <_> + + <_> + 3 5 12 4 -1. + <_> + 7 5 4 4 3. + <_> + + <_> + 8 14 12 4 -1. + <_> + 8 14 6 4 2. + <_> + + <_> + 0 14 12 4 -1. + <_> + 6 14 6 4 2. + <_> + + <_> + 4 12 15 4 -1. + <_> + 9 12 5 4 3. + <_> + + <_> + 1 12 15 4 -1. + <_> + 6 12 5 4 3. + <_> + + <_> + 6 0 12 18 -1. + <_> + 10 0 4 18 3. + <_> + + <_> + 0 6 14 4 -1. + <_> + 0 6 7 2 2. + <_> + 7 8 7 2 2. + <_> + + <_> + 13 13 7 6 -1. + <_> + 13 15 7 2 3. + <_> + + <_> + 0 0 6 18 -1. + <_> + 0 9 6 9 2. + <_> + + <_> + 6 8 14 4 -1. + <_> + 13 8 7 2 2. + <_> + 6 10 7 2 2. + <_> + + <_> + 0 8 14 4 -1. + <_> + 0 8 7 2 2. + <_> + 7 10 7 2 2. + <_> + + <_> + 3 2 14 10 -1. + <_> + 3 7 14 5 2. + <_> + + <_> + 3 5 6 7 -1. + <_> + 5 5 2 7 3. + <_> + + <_> + 4 4 14 6 -1. + <_> + 11 4 7 3 2. + <_> + 4 7 7 3 2. + <_> + + <_> + 6 2 4 10 -1. + <_> + 6 7 4 5 2. + <_> + + <_> + 11 1 3 18 -1. + <_> + 11 7 3 6 3. + <_> + + <_> + 3 1 3 15 -1. + <_> + 3 6 3 5 3. + <_> + + <_> + 7 0 8 6 -1. + <_> + 7 0 4 6 2. + <_> + + <_> + 2 0 9 15 -1. + <_> + 2 5 9 5 3. + <_> + + <_> + 2 0 18 3 -1. + <_> + 8 0 6 3 3. + <_> + + <_> + 2 8 12 8 -1. + <_> + 6 8 4 8 3. + <_> + + <_> + 5 8 15 12 -1. + <_> + 10 8 5 12 3. + <_> + + <_> + 0 1 18 3 -1. + <_> + 6 1 6 3 3. + <_> + + <_> + 9 5 2 14 -1. + <_> + 9 12 2 7 2. + <_> + + <_> + 5 4 10 6 -1. + <_> + 5 6 10 2 3. + <_> + + <_> + 9 10 7 6 -1. + <_> + 9 12 7 2 3. + <_> + + <_> + 3 7 12 4 -1. + <_> + 7 7 4 4 3. + <_> + + <_> + 4 10 12 4 -1. + <_> + 8 10 4 4 3. + <_> + + <_> + 0 3 14 4 -1. + <_> + 0 3 7 2 2. + <_> + 7 5 7 2 2. + <_> + + <_> + 5 17 15 3 -1. + <_> + 5 18 15 1 3. + <_> + + <_> + 5 11 10 6 -1. + <_> + 5 11 5 3 2. + <_> + 10 14 5 3 2. + <_> + + <_> + 4 4 13 3 -1. + <_> + 4 5 13 1 3. + <_> + + <_> + 5 11 5 9 -1. + <_> + 5 14 5 3 3. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 14 0 3 13 -1. + <_> + 15 0 1 13 3. + <_> + + <_> + 2 6 6 9 -1. + <_> + 2 9 6 3 3. + <_> + + <_> + 14 0 3 13 -1. + <_> + 15 0 1 13 3. + <_> + + <_> + 1 3 4 14 -1. + <_> + 1 3 2 7 2. + <_> + 3 10 2 7 2. + <_> + + <_> + 13 4 3 12 -1. + <_> + 13 10 3 6 2. + <_> + + <_> + 7 7 6 13 -1. + <_> + 9 7 2 13 3. + <_> + + <_> + 7 0 9 5 -1. + <_> + 10 0 3 5 3. + <_> + + <_> + 5 0 9 5 -1. + <_> + 8 0 3 5 3. + <_> + + <_> + 9 5 2 13 -1. + <_> + 9 5 1 13 2. + <_> + + <_> + 7 3 3 12 -1. + <_> + 7 9 3 6 2. + <_> + + <_> + 2 1 18 3 -1. + <_> + 8 1 6 3 3. + <_> + + <_> + 4 3 12 16 -1. + <_> + 4 3 6 8 2. + <_> + 10 11 6 8 2. + <_> + + <_> + 14 0 3 13 -1. + <_> + 15 0 1 13 3. + <_> + + <_> + 3 3 14 3 -1. + <_> + 3 4 14 1 3. + <_> + + <_> + 0 13 20 7 -1. + <_> + 0 13 10 7 2. + <_> + + <_> + 3 0 3 13 -1. + <_> + 4 0 1 13 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 6 2. + <_> + + <_> + 4 2 2 14 -1. + <_> + 4 9 2 7 2. + <_> + + <_> + 14 1 6 12 -1. + <_> + 16 1 2 12 3. + <_> + + <_> + 0 6 14 4 -1. + <_> + 0 6 7 2 2. + <_> + 7 8 7 2 2. + <_> + + <_> + 14 1 6 12 -1. + <_> + 16 1 2 12 3. + <_> + + <_> + 0 4 20 6 -1. + <_> + 0 6 20 2 3. + <_> + + <_> + 14 1 6 12 -1. + <_> + 16 1 2 12 3. + <_> + + <_> + 0 8 15 3 -1. + <_> + 0 9 15 1 3. + <_> + + <_> + 2 1 16 6 -1. + <_> + 10 1 8 3 2. + <_> + 2 4 8 3 2. + <_> + + <_> + 0 1 6 12 -1. + <_> + 2 1 2 12 3. + <_> + + <_> + 9 2 9 5 -1. + <_> + 12 2 3 5 3. + <_> + + <_> + 1 1 18 4 -1. + <_> + 7 1 6 4 3. + <_> + + <_> + 13 0 3 13 -1. + <_> + 14 0 1 13 3. + <_> + + <_> + 0 0 4 7 -1. + <_> + 2 0 2 7 2. + <_> + + <_> + 13 0 3 13 -1. + <_> + 14 0 1 13 3. + <_> + + <_> + 0 0 9 6 -1. + <_> + 3 0 3 6 3. + <_> + + <_> + 10 1 6 5 -1. + <_> + 10 1 3 5 2. + <_> + + <_> + 6 6 6 7 -1. + <_> + 8 6 2 7 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 5 2 4 7 -1. + <_> + 7 2 2 7 2. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 4 0 3 13 -1. + <_> + 5 0 1 13 3. + <_> + + <_> + 2 1 18 3 -1. + <_> + 8 1 6 3 3. + <_> + + <_> + 6 5 4 14 -1. + <_> + 6 5 2 7 2. + <_> + 8 12 2 7 2. + <_> + + <_> + 1 5 19 4 -1. + <_> + 1 7 19 2 2. + <_> + + <_> + 0 11 7 6 -1. + <_> + 0 13 7 2 3. + <_> + + <_> + 6 12 13 2 -1. + <_> + 6 13 13 1 2. + <_> + + <_> + 3 0 12 10 -1. + <_> + 3 0 6 5 2. + <_> + 9 5 6 5 2. + <_> + + <_> + 2 1 18 3 -1. + <_> + 8 1 6 3 3. + <_> + + <_> + 0 15 18 3 -1. + <_> + 9 15 9 3 2. + <_> + + <_> + 6 14 14 6 -1. + <_> + 6 14 7 6 2. + <_> + + <_> + 0 14 14 6 -1. + <_> + 7 14 7 6 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 11 0 6 7 -1. + <_> + 13 0 2 7 3. + <_> + + <_> + 1 8 15 4 -1. + <_> + 6 8 5 4 3. + <_> + + <_> + 13 12 7 6 -1. + <_> + 13 14 7 2 3. + <_> + + <_> + 0 12 7 6 -1. + <_> + 0 14 7 2 3. + <_> + + <_> + 12 12 7 4 -1. + <_> + 12 14 7 2 2. + <_> + + <_> + 1 2 8 8 -1. + <_> + 1 2 4 4 2. + <_> + 5 6 4 4 2. + <_> + + <_> + 2 1 18 3 -1. + <_> + 8 1 6 3 3. + <_> + + <_> + 0 1 18 3 -1. + <_> + 6 1 6 3 3. + <_> + + <_> + 8 0 12 6 -1. + <_> + 8 2 12 2 3. + <_> + + <_> + 5 3 4 7 -1. + <_> + 7 3 2 7 2. + <_> + + <_> + 3 16 16 2 -1. + <_> + 3 17 16 1 2. + <_> + + <_> + 3 0 13 6 -1. + <_> + 3 3 13 3 2. + <_> + + <_> + 4 0 13 3 -1. + <_> + 4 1 13 1 3. + <_> + + <_> + 1 1 5 12 -1. + <_> + 1 5 5 4 3. + <_> + + <_> + 6 10 13 3 -1. + <_> + 6 11 13 1 3. + <_> + + <_> + 1 11 7 4 -1. + <_> + 1 13 7 2 2. + <_> + + <_> + 7 0 6 8 -1. + <_> + 9 0 2 8 3. + <_> + + <_> + 7 5 6 8 -1. + <_> + 9 5 2 8 3. + <_> + + <_> + 14 12 6 8 -1. + <_> + 16 12 2 8 3. + <_> + + <_> + 3 5 13 3 -1. + <_> + 3 6 13 1 3. + <_> + + <_> + 9 2 9 5 -1. + <_> + 12 2 3 5 3. + <_> + + <_> + 5 15 7 4 -1. + <_> + 5 17 7 2 2. + <_> + + <_> + 11 14 7 6 -1. + <_> + 11 16 7 2 3. + <_> + + <_> + 2 14 7 6 -1. + <_> + 2 16 7 2 3. + <_> + + <_> + 10 13 9 4 -1. + <_> + 10 15 9 2 2. + <_> + + <_> + 2 14 13 3 -1. + <_> + 2 15 13 1 3. + <_> + + <_> + 10 13 10 6 -1. + <_> + 10 15 10 2 3. + <_> + + <_> + 0 13 10 6 -1. + <_> + 0 15 10 2 3. + <_> + + <_> + 2 8 16 8 -1. + <_> + 10 8 8 4 2. + <_> + 2 12 8 4 2. + <_> + + <_> + 2 0 9 7 -1. + <_> + 5 0 3 7 3. + <_> + + <_> + 7 6 6 7 -1. + <_> + 9 6 2 7 3. + <_> + + <_> + 1 7 10 9 -1. + <_> + 1 10 10 3 3. + <_> + + <_> + 5 3 11 6 -1. + <_> + 5 5 11 2 3. + <_> + + <_> + 0 7 2 13 -1. + <_> + 1 7 1 13 2. + <_> + + <_> + 14 1 6 11 -1. + <_> + 16 1 2 11 3. + <_> + + <_> + 0 6 6 14 -1. + <_> + 2 6 2 14 3. + <_> + + <_> + 7 8 8 12 -1. + <_> + 11 8 4 6 2. + <_> + 7 14 4 6 2. + <_> + + <_> + 2 10 16 8 -1. + <_> + 2 10 8 4 2. + <_> + 10 14 8 4 2. + <_> + + <_> + 11 6 7 8 -1. + <_> + 11 10 7 4 2. + <_> + + <_> + 2 6 7 8 -1. + <_> + 2 10 7 4 2. + <_> + + <_> + 15 6 4 14 -1. + <_> + 17 6 2 7 2. + <_> + 15 13 2 7 2. + <_> + + <_> + 1 6 4 14 -1. + <_> + 1 6 2 7 2. + <_> + 3 13 2 7 2. + <_> + + <_> + 15 7 4 8 -1. + <_> + 15 11 4 4 2. + <_> + + <_> + 4 0 8 8 -1. + <_> + 4 0 4 4 2. + <_> + 8 4 4 4 2. + <_> + + <_> + 7 0 7 6 -1. + <_> + 7 3 7 3 2. + <_> + + <_> + 3 2 14 3 -1. + <_> + 3 3 14 1 3. + <_> + + <_> + 10 0 10 6 -1. + <_> + 10 2 10 2 3. + <_> + + <_> + 0 0 10 6 -1. + <_> + 0 2 10 2 3. + <_> + + <_> + 0 3 20 14 -1. + <_> + 0 10 20 7 2. + <_> + + <_> + 0 0 4 12 -1. + <_> + 2 0 2 12 2. + <_> + + <_> + 8 3 12 6 -1. + <_> + 12 3 4 6 3. + <_> + + <_> + 0 3 12 6 -1. + <_> + 4 3 4 6 3. + <_> + + <_> + 14 3 4 8 -1. + <_> + 14 3 2 8 2. + <_> + + <_> + 2 3 4 8 -1. + <_> + 4 3 2 8 2. + <_> + + <_> + 13 6 6 10 -1. + <_> + 16 6 3 5 2. + <_> + 13 11 3 5 2. + <_> + + <_> + 1 6 6 10 -1. + <_> + 1 6 3 5 2. + <_> + 4 11 3 5 2. + <_> + + <_> + 7 13 13 2 -1. + <_> + 7 14 13 1 2. + <_> + + <_> + 3 12 11 4 -1. + <_> + 3 14 11 2 2. + <_> + + <_> + 13 12 6 8 -1. + <_> + 13 12 3 8 2. + <_> + + <_> + 1 12 6 8 -1. + <_> + 4 12 3 8 2. + <_> + + <_> + 12 6 8 8 -1. + <_> + 16 6 4 4 2. + <_> + 12 10 4 4 2. + <_> + + <_> + 0 6 8 8 -1. + <_> + 0 6 4 4 2. + <_> + 4 10 4 4 2. + <_> + + <_> + 3 8 16 2 -1. + <_> + 3 9 16 1 2. + <_> + + <_> + 0 7 16 3 -1. + <_> + 0 8 16 1 3. + <_> + + <_> + 5 11 14 3 -1. + <_> + 5 12 14 1 3. + <_> + + <_> + 8 0 3 20 -1. + <_> + 9 0 1 20 3. + <_> + + <_> + 8 10 9 7 -1. + <_> + 11 10 3 7 3. + <_> + + <_> + 0 6 20 3 -1. + <_> + 10 6 10 3 2. + <_> + + <_> + 4 7 15 3 -1. + <_> + 4 8 15 1 3. + <_> + + <_> + 0 5 14 5 -1. + <_> + 7 5 7 5 2. + <_> + + <_> + 8 10 9 7 -1. + <_> + 11 10 3 7 3. + <_> + + <_> + 3 10 9 7 -1. + <_> + 6 10 3 7 3. + <_> + + <_> + 11 7 3 10 -1. + <_> + 11 12 3 5 2. + <_> + + <_> + 1 7 18 6 -1. + <_> + 1 9 18 2 3. + <_> + + <_> + 8 0 4 15 -1. + <_> + 8 5 4 5 3. + <_> + + <_> + 6 1 7 15 -1. + <_> + 6 6 7 5 3. + <_> + + <_> + 6 9 14 3 -1. + <_> + 6 10 14 1 3. + <_> + + <_> + 1 10 6 10 -1. + <_> + 1 10 3 5 2. + <_> + 4 15 3 5 2. + <_> + + <_> + 9 3 6 13 -1. + <_> + 11 3 2 13 3. + <_> + + <_> + 8 1 4 9 -1. + <_> + 10 1 2 9 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 7 1 6 8 -1. + <_> + 10 1 3 8 2. + <_> + + <_> + 3 6 14 2 -1. + <_> + 3 6 7 2 2. + <_> + + <_> + 1 3 4 8 -1. + <_> + 3 3 2 8 2. + <_> + + <_> + 18 3 2 14 -1. + <_> + 18 10 2 7 2. + <_> + + <_> + 0 3 2 14 -1. + <_> + 0 10 2 7 2. + <_> + + <_> + 3 15 16 2 -1. + <_> + 3 15 8 2 2. + <_> + + <_> + 2 1 9 6 -1. + <_> + 2 3 9 2 3. + <_> + + <_> + 11 1 7 6 -1. + <_> + 11 3 7 2 3. + <_> + + <_> + 1 8 8 8 -1. + <_> + 1 8 4 4 2. + <_> + 5 12 4 4 2. + <_> + + <_> + 8 6 5 8 -1. + <_> + 8 10 5 4 2. + <_> + + <_> + 4 12 8 8 -1. + <_> + 4 12 4 4 2. + <_> + 8 16 4 4 2. + <_> + + <_> + 15 12 4 8 -1. + <_> + 15 16 4 4 2. + <_> + + <_> + 7 11 5 8 -1. + <_> + 7 15 5 4 2. + <_> + + <_> + 5 14 13 2 -1. + <_> + 5 15 13 1 2. + <_> + + <_> + 2 4 9 12 -1. + <_> + 2 8 9 4 3. + <_> + + <_> + 3 8 14 3 -1. + <_> + 3 9 14 1 3. + <_> + + <_> + 0 15 13 3 -1. + <_> + 0 16 13 1 3. + <_> + + <_> + 9 14 8 6 -1. + <_> + 9 16 8 2 3. + <_> + + <_> + 1 12 4 8 -1. + <_> + 1 16 4 4 2. + <_> + + <_> + 5 16 12 4 -1. + <_> + 9 16 4 4 3. + <_> + + <_> + 4 13 6 7 -1. + <_> + 6 13 2 7 3. + <_> + + <_> + 11 1 3 15 -1. + <_> + 12 1 1 15 3. + <_> + + <_> + 0 0 2 13 -1. + <_> + 1 0 1 13 2. + <_> + + <_> + 11 1 3 19 -1. + <_> + 12 1 1 19 3. + <_> + + <_> + 5 10 4 7 -1. + <_> + 7 10 2 7 2. + <_> + + <_> + 8 11 8 4 -1. + <_> + 8 11 4 4 2. + <_> + + <_> + 5 12 8 8 -1. + <_> + 9 12 4 8 2. + <_> + + <_> + 6 4 10 14 -1. + <_> + 11 4 5 7 2. + <_> + 6 11 5 7 2. + <_> + + <_> + 4 4 10 14 -1. + <_> + 4 4 5 7 2. + <_> + 9 11 5 7 2. + <_> + + <_> + 2 3 18 15 -1. + <_> + 2 8 18 5 3. + <_> + + <_> + 4 7 6 9 -1. + <_> + 6 7 2 9 3. + <_> + + <_> + 8 7 9 9 -1. + <_> + 8 10 9 3 3. + <_> + + <_> + 2 8 14 4 -1. + <_> + 2 8 7 2 2. + <_> + 9 10 7 2 2. + <_> + + <_> + 6 10 8 10 -1. + <_> + 6 10 4 10 2. + <_> + + <_> + 4 15 9 5 -1. + <_> + 7 15 3 5 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 5 6 8 4 -1. + <_> + 9 6 4 4 2. + <_> + + <_> + 10 7 6 7 -1. + <_> + 12 7 2 7 3. + <_> + + <_> + 4 7 6 12 -1. + <_> + 6 7 2 12 3. + <_> + + <_> + 7 6 6 8 -1. + <_> + 9 6 2 8 3. + <_> + + <_> + 5 3 6 16 -1. + <_> + 5 3 3 8 2. + <_> + 8 11 3 8 2. + <_> + + <_> + 12 10 6 6 -1. + <_> + 12 10 3 6 2. + <_> + + <_> + 2 10 6 6 -1. + <_> + 5 10 3 6 2. + <_> + + <_> + 10 0 4 9 -1. + <_> + 10 0 2 9 2. + <_> + + <_> + 5 0 6 7 -1. + <_> + 7 0 2 7 3. + <_> + + <_> + 10 0 6 8 -1. + <_> + 12 0 2 8 3. + <_> + + <_> + 4 0 6 8 -1. + <_> + 6 0 2 8 3. + <_> + + <_> + 6 6 8 6 -1. + <_> + 6 8 8 2 3. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 8 10 10 10 -1. + <_> + 13 10 5 5 2. + <_> + 8 15 5 5 2. + <_> + + <_> + 2 16 15 4 -1. + <_> + 7 16 5 4 3. + <_> + + <_> + 9 6 10 13 -1. + <_> + 9 6 5 13 2. + <_> + + <_> + 1 6 10 13 -1. + <_> + 6 6 5 13 2. + <_> + + <_> + 4 15 16 2 -1. + <_> + 4 15 8 2 2. + <_> + + <_> + 1 15 16 2 -1. + <_> + 9 15 8 2 2. + <_> + + <_> + 15 7 3 12 -1. + <_> + 15 13 3 6 2. + <_> + + <_> + 2 7 3 12 -1. + <_> + 2 13 3 6 2. + <_> + + <_> + 2 13 18 7 -1. + <_> + 8 13 6 7 3. + <_> + + <_> + 2 4 15 3 -1. + <_> + 2 5 15 1 3. + <_> + + <_> + 16 6 2 13 -1. + <_> + 16 6 1 13 2. + <_> + + <_> + 4 1 6 5 -1. + <_> + 7 1 3 5 2. + <_> + + <_> + 14 6 4 14 -1. + <_> + 16 6 2 7 2. + <_> + 14 13 2 7 2. + <_> + + <_> + 0 4 12 3 -1. + <_> + 6 4 6 3 2. + <_> + + <_> + 4 5 13 2 -1. + <_> + 4 6 13 1 2. + <_> + + <_> + 3 2 13 10 -1. + <_> + 3 7 13 5 2. + <_> + + <_> + 7 2 6 10 -1. + <_> + 7 7 6 5 2. + <_> + + <_> + 3 1 7 6 -1. + <_> + 3 3 7 2 3. + <_> + + <_> + 4 0 13 6 -1. + <_> + 4 2 13 2 3. + <_> + + <_> + 3 0 12 6 -1. + <_> + 3 2 12 2 3. + <_> + + <_> + 13 0 7 6 -1. + <_> + 13 2 7 2 3. + <_> + + <_> + 5 0 4 16 -1. + <_> + 5 0 2 8 2. + <_> + 7 8 2 8 2. + <_> + + <_> + 1 14 18 6 -1. + <_> + 10 14 9 3 2. + <_> + 1 17 9 3 2. + <_> + + <_> + 2 17 14 3 -1. + <_> + 9 17 7 3 2. + <_> + + <_> + 16 11 4 7 -1. + <_> + 16 11 2 7 2. + <_> + + <_> + 4 1 8 15 -1. + <_> + 8 1 4 15 2. + <_> + + <_> + 13 0 7 6 -1. + <_> + 13 2 7 2 3. + <_> + + <_> + 1 6 4 13 -1. + <_> + 3 6 2 13 2. + <_> + + <_> + 12 12 7 4 -1. + <_> + 12 14 7 2 2. + <_> + + <_> + 1 12 7 4 -1. + <_> + 1 14 7 2 2. + <_> + + <_> + 7 13 13 2 -1. + <_> + 7 14 13 1 2. + <_> + + <_> + 0 12 7 6 -1. + <_> + 0 14 7 2 3. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 6 11 6 8 -1. + <_> + 8 11 2 8 3. + <_> + + <_> + 8 10 10 10 -1. + <_> + 13 10 5 5 2. + <_> + 8 15 5 5 2. + <_> + + <_> + 2 10 10 10 -1. + <_> + 2 10 5 5 2. + <_> + 7 15 5 5 2. + <_> + + <_> + 6 13 10 6 -1. + <_> + 11 13 5 3 2. + <_> + 6 16 5 3 2. + <_> + + <_> + 4 13 10 6 -1. + <_> + 4 13 5 3 2. + <_> + 9 16 5 3 2. + <_> + + <_> + 7 6 9 12 -1. + <_> + 7 12 9 6 2. + <_> + + <_> + 1 14 14 4 -1. + <_> + 1 14 7 2 2. + <_> + 8 16 7 2 2. + <_> + + <_> + 11 15 7 4 -1. + <_> + 11 17 7 2 2. + <_> + + <_> + 1 15 16 4 -1. + <_> + 1 17 16 2 2. + <_> + + <_> + 2 0 18 8 -1. + <_> + 8 0 6 8 3. + <_> + + <_> + 0 8 18 12 -1. + <_> + 0 12 18 4 3. + <_> + + <_> + 7 11 13 2 -1. + <_> + 7 12 13 1 2. + <_> + + <_> + 0 11 13 2 -1. + <_> + 0 12 13 1 2. + <_> + + <_> + 1 12 19 3 -1. + <_> + 1 13 19 1 3. + <_> + + <_> + 0 3 13 3 -1. + <_> + 0 4 13 1 3. + <_> + + <_> + 9 11 6 9 -1. + <_> + 9 14 6 3 3. + <_> + + <_> + 5 11 6 9 -1. + <_> + 5 14 6 3 3. + <_> + + <_> + 4 3 13 3 -1. + <_> + 4 4 13 1 3. + <_> + + <_> + 5 14 9 4 -1. + <_> + 5 16 9 2 2. + <_> + + <_> + 8 12 4 8 -1. + <_> + 8 16 4 4 2. + <_> + + <_> + 3 8 14 4 -1. + <_> + 3 8 7 2 2. + <_> + 10 10 7 2 2. + <_> + + <_> + 4 5 12 6 -1. + <_> + 8 5 4 6 3. + <_> + + <_> + 3 5 8 9 -1. + <_> + 3 8 8 3 3. + <_> + + <_> + 10 5 4 12 -1. + <_> + 10 9 4 4 3. + <_> + + <_> + 0 6 18 6 -1. + <_> + 0 6 9 3 2. + <_> + 9 9 9 3 2. + <_> + + <_> + 3 6 16 4 -1. + <_> + 11 6 8 2 2. + <_> + 3 8 8 2 2. + <_> + + <_> + 4 6 7 4 -1. + <_> + 4 8 7 2 2. + <_> + + <_> + 12 4 7 6 -1. + <_> + 12 6 7 2 3. + <_> + + <_> + 1 4 7 6 -1. + <_> + 1 6 7 2 3. + <_> + + <_> + 6 0 10 6 -1. + <_> + 6 2 10 2 3. + <_> + + <_> + 0 0 7 6 -1. + <_> + 0 2 7 2 3. + <_> + + <_> + 17 2 3 13 -1. + <_> + 18 2 1 13 3. + <_> + + <_> + 0 2 3 13 -1. + <_> + 1 2 1 13 3. + <_> + + <_> + 6 8 13 3 -1. + <_> + 6 9 13 1 3. + <_> + + <_> + 0 13 10 6 -1. + <_> + 0 13 5 3 2. + <_> + 5 16 5 3 2. + <_> + + <_> + 10 12 8 8 -1. + <_> + 14 12 4 4 2. + <_> + 10 16 4 4 2. + <_> + + <_> + 6 10 8 8 -1. + <_> + 6 10 4 4 2. + <_> + 10 14 4 4 2. + <_> + + <_> + 10 10 6 7 -1. + <_> + 12 10 2 7 3. + <_> + + <_> + 5 9 9 5 -1. + <_> + 8 9 3 5 3. + <_> + + <_> + 7 5 7 6 -1. + <_> + 7 7 7 2 3. + <_> + + <_> + 0 13 18 7 -1. + <_> + 6 13 6 7 3. + <_> + + <_> + 7 7 12 9 -1. + <_> + 7 10 12 3 3. + <_> + + <_> + 1 12 18 3 -1. + <_> + 1 13 18 1 3. + <_> + + <_> + 7 13 13 2 -1. + <_> + 7 14 13 1 2. + <_> + + <_> + 7 12 6 7 -1. + <_> + 9 12 2 7 3. + <_> + + <_> + 8 10 12 10 -1. + <_> + 14 10 6 5 2. + <_> + 8 15 6 5 2. + <_> + + <_> + 0 10 12 10 -1. + <_> + 0 10 6 5 2. + <_> + 6 15 6 5 2. + <_> + + <_> + 7 7 12 9 -1. + <_> + 7 10 12 3 3. + <_> + + <_> + 3 16 12 4 -1. + <_> + 7 16 4 4 3. + <_> + + <_> + 7 16 9 4 -1. + <_> + 7 18 9 2 2. + <_> + + <_> + 4 16 9 4 -1. + <_> + 4 18 9 2 2. + <_> + + <_> + 11 1 3 19 -1. + <_> + 12 1 1 19 3. + <_> + + <_> + 6 14 7 6 -1. + <_> + 6 16 7 2 3. + <_> + + <_> + 11 1 3 15 -1. + <_> + 12 1 1 15 3. + <_> + + <_> + 6 1 3 19 -1. + <_> + 7 1 1 19 3. + <_> + + <_> + 4 0 14 10 -1. + <_> + 11 0 7 5 2. + <_> + 4 5 7 5 2. + <_> + + <_> + 2 0 14 10 -1. + <_> + 2 0 7 5 2. + <_> + 9 5 7 5 2. + <_> + + <_> + 10 1 3 13 -1. + <_> + 11 1 1 13 3. + <_> + + <_> + 6 7 6 8 -1. + <_> + 8 7 2 8 3. + <_> + + <_> + 11 5 4 10 -1. + <_> + 11 5 2 10 2. + <_> + + <_> + 3 18 13 2 -1. + <_> + 3 19 13 1 2. + <_> + + <_> + 11 8 4 8 -1. + <_> + 11 12 4 4 2. + <_> + + <_> + 5 8 4 8 -1. + <_> + 5 12 4 4 2. + <_> + + <_> + 4 8 16 6 -1. + <_> + 12 8 8 3 2. + <_> + 4 11 8 3 2. + <_> + + <_> + 5 5 4 10 -1. + <_> + 7 5 2 10 2. + <_> + + <_> + 10 1 3 13 -1. + <_> + 11 1 1 13 3. + <_> + + <_> + 7 1 3 13 -1. + <_> + 8 1 1 13 3. + <_> + + <_> + 6 6 8 7 -1. + <_> + 6 6 4 7 2. + <_> + + <_> + 8 0 4 9 -1. + <_> + 10 0 2 9 2. + <_> + + <_> + 9 7 4 12 -1. + <_> + 9 11 4 4 3. + <_> + + <_> + 4 2 12 4 -1. + <_> + 10 2 6 4 2. + <_> + + <_> + 8 1 10 6 -1. + <_> + 13 1 5 3 2. + <_> + 8 4 5 3 2. + <_> + + <_> + 0 2 9 10 -1. + <_> + 0 7 9 5 2. + <_> + + <_> + 10 1 10 14 -1. + <_> + 10 8 10 7 2. + <_> + + <_> + 0 1 10 14 -1. + <_> + 0 8 10 7 2. + <_> + + <_> + 9 0 3 15 -1. + <_> + 9 5 3 5 3. + <_> + + <_> + 0 2 4 18 -1. + <_> + 0 2 2 9 2. + <_> + 2 11 2 9 2. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 10 9 6 7 -1. + <_> + 12 9 2 7 3. + <_> + + <_> + 3 3 6 7 -1. + <_> + 5 3 2 7 3. + <_> + + <_> + 13 2 3 17 -1. + <_> + 14 2 1 17 3. + <_> + + <_> + 2 5 4 8 -1. + <_> + 2 9 4 4 2. + <_> + + <_> + 6 5 10 10 -1. + <_> + 6 10 10 5 2. + <_> + + <_> + 4 2 3 17 -1. + <_> + 5 2 1 17 3. + <_> + + <_> + 6 6 14 5 -1. + <_> + 6 6 7 5 2. + <_> + + <_> + 0 11 15 3 -1. + <_> + 5 11 5 3 3. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 3 0 10 6 -1. + <_> + 3 0 5 3 2. + <_> + 8 3 5 3 2. + <_> + + <_> + 9 6 4 12 -1. + <_> + 9 10 4 4 3. + <_> + + <_> + 0 13 13 2 -1. + <_> + 0 14 13 1 2. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 1 2 12 15 -1. + <_> + 5 2 4 15 3. + <_> + + <_> + 2 0 18 16 -1. + <_> + 8 0 6 16 3. + <_> + + <_> + 0 0 18 16 -1. + <_> + 6 0 6 16 3. + <_> + + <_> + 14 0 6 13 -1. + <_> + 14 0 3 13 2. + <_> + + <_> + 4 3 3 17 -1. + <_> + 5 3 1 17 3. + <_> + + <_> + 13 6 6 10 -1. + <_> + 13 6 3 10 2. + <_> + + <_> + 1 5 6 11 -1. + <_> + 4 5 3 11 2. + <_> + + <_> + 16 3 4 12 -1. + <_> + 16 7 4 4 3. + <_> + + <_> + 5 1 3 10 -1. + <_> + 5 6 3 5 2. + <_> + + <_> + 16 3 4 12 -1. + <_> + 16 7 4 4 3. + <_> + + <_> + 0 3 4 12 -1. + <_> + 0 7 4 4 3. + <_> + + <_> + 6 0 14 6 -1. + <_> + 13 0 7 3 2. + <_> + 6 3 7 3 2. + <_> + + <_> + 0 1 6 19 -1. + <_> + 3 1 3 19 2. + <_> + + <_> + 16 1 3 13 -1. + <_> + 17 1 1 13 3. + <_> + + <_> + 0 0 6 13 -1. + <_> + 3 0 3 13 2. + <_> + + <_> + 12 1 6 5 -1. + <_> + 12 1 3 5 2. + <_> + + <_> + 2 1 6 5 -1. + <_> + 5 1 3 5 2. + <_> + + <_> + 10 0 6 7 -1. + <_> + 12 0 2 7 3. + <_> + + <_> + 1 1 10 3 -1. + <_> + 6 1 5 3 2. + <_> + + <_> + 4 0 16 8 -1. + <_> + 12 0 8 4 2. + <_> + 4 4 8 4 2. + <_> + + <_> + 0 0 8 12 -1. + <_> + 0 0 4 6 2. + <_> + 4 6 4 6 2. + <_> + + <_> + 11 10 7 6 -1. + <_> + 11 12 7 2 3. + <_> + + <_> + 2 10 7 6 -1. + <_> + 2 12 7 2 3. + <_> + + <_> + 3 8 15 9 -1. + <_> + 3 11 15 3 3. + <_> + + <_> + 4 6 4 10 -1. + <_> + 6 6 2 10 2. + <_> + + <_> + 15 7 5 6 -1. + <_> + 15 10 5 3 2. + <_> + + <_> + 0 7 5 6 -1. + <_> + 0 10 5 3 2. + <_> + + <_> + 8 5 12 4 -1. + <_> + 12 5 4 4 3. + <_> + + <_> + 2 0 14 6 -1. + <_> + 2 3 14 3 2. + <_> + + <_> + 8 5 12 4 -1. + <_> + 12 5 4 4 3. + <_> + + <_> + 0 5 12 4 -1. + <_> + 4 5 4 4 3. + <_> + + <_> + 7 0 7 6 -1. + <_> + 7 3 7 3 2. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 13 9 3 10 -1. + <_> + 13 14 3 5 2. + <_> + + <_> + 2 12 7 6 -1. + <_> + 2 14 7 2 3. + <_> + + <_> + 7 14 13 3 -1. + <_> + 7 15 13 1 3. + <_> + + <_> + 0 14 13 3 -1. + <_> + 0 15 13 1 3. + <_> + + <_> + 9 2 6 12 -1. + <_> + 9 6 6 4 3. + <_> + + <_> + 5 2 6 12 -1. + <_> + 5 6 6 4 3. + <_> + + <_> + 9 6 4 12 -1. + <_> + 9 10 4 4 3. + <_> + + <_> + 7 6 4 12 -1. + <_> + 7 10 4 4 3. + <_> + + <_> + 9 2 8 18 -1. + <_> + 9 8 8 6 3. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 8 6 6 7 -1. + <_> + 10 6 2 7 3. + <_> + + <_> + 3 7 9 9 -1. + <_> + 3 10 9 3 3. + <_> + + <_> + 14 4 3 13 -1. + <_> + 15 4 1 13 3. + <_> + + <_> + 4 1 12 15 -1. + <_> + 4 6 12 5 3. + <_> + + <_> + 8 2 4 8 -1. + <_> + 8 6 4 4 2. + <_> + + <_> + 3 0 12 20 -1. + <_> + 3 10 12 10 2. + <_> + + <_> + 1 17 19 3 -1. + <_> + 1 18 19 1 3. + <_> + + <_> + 0 18 18 2 -1. + <_> + 9 18 9 2 2. + <_> + + <_> + 8 10 6 9 -1. + <_> + 10 10 2 9 3. + <_> + + <_> + 6 10 6 9 -1. + <_> + 8 10 2 9 3. + <_> + + <_> + 5 11 12 4 -1. + <_> + 5 13 12 2 2. + <_> + + <_> + 2 5 8 4 -1. + <_> + 2 7 8 2 2. + <_> + + <_> + 9 10 7 6 -1. + <_> + 9 12 7 2 3. + <_> + + <_> + 1 0 13 3 -1. + <_> + 1 1 13 1 3. + <_> + + <_> + 3 0 14 3 -1. + <_> + 3 1 14 1 3. + <_> + + <_> + 8 6 4 8 -1. + <_> + 10 6 2 8 2. + <_> + + <_> + 9 3 6 13 -1. + <_> + 11 3 2 13 3. + <_> + + <_> + 0 0 6 10 -1. + <_> + 0 0 3 5 2. + <_> + 3 5 3 5 2. + <_> + + <_> + 8 0 7 18 -1. + <_> + 8 6 7 6 3. + <_> + + <_> + 5 3 6 13 -1. + <_> + 7 3 2 13 3. + <_> + + <_> + 7 4 9 5 -1. + <_> + 10 4 3 5 3. + <_> + + <_> + 8 1 3 18 -1. + <_> + 9 1 1 18 3. + <_> + + <_> + 9 0 11 15 -1. + <_> + 9 5 11 5 3. + <_> + + <_> + 0 0 16 8 -1. + <_> + 0 0 8 4 2. + <_> + 8 4 8 4 2. + <_> + + <_> + 4 3 12 14 -1. + <_> + 10 3 6 7 2. + <_> + 4 10 6 7 2. + <_> + + <_> + 5 6 6 12 -1. + <_> + 5 6 3 6 2. + <_> + 8 12 3 6 2. + <_> + + <_> + 6 3 11 9 -1. + <_> + 6 6 11 3 3. + <_> + + <_> + 0 0 18 8 -1. + <_> + 0 0 9 4 2. + <_> + 9 4 9 4 2. + <_> + + <_> + 11 5 9 12 -1. + <_> + 11 11 9 6 2. + <_> + + <_> + 2 5 14 8 -1. + <_> + 2 9 14 4 2. + <_> + + <_> + 16 2 4 8 -1. + <_> + 16 6 4 4 2. + <_> + + <_> + 4 10 7 6 -1. + <_> + 4 12 7 2 3. + <_> + + <_> + 7 11 7 6 -1. + <_> + 7 13 7 2 3. + <_> + + <_> + 0 2 4 8 -1. + <_> + 0 6 4 4 2. + <_> + + <_> + 16 1 3 13 -1. + <_> + 17 1 1 13 3. + <_> + + <_> + 4 2 10 6 -1. + <_> + 4 2 5 3 2. + <_> + 9 5 5 3 2. + <_> + + <_> + 4 4 14 3 -1. + <_> + 4 5 14 1 3. + <_> + + <_> + 5 5 7 6 -1. + <_> + 5 7 7 2 3. + <_> + + <_> + 6 13 13 3 -1. + <_> + 6 14 13 1 3. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 10 13 7 4 -1. + <_> + 10 15 7 2 2. + <_> + + <_> + 1 13 13 3 -1. + <_> + 1 14 13 1 3. + <_> + + <_> + 6 3 11 9 -1. + <_> + 6 6 11 3 3. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_default.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_default.xml new file mode 100644 index 0000000000000000000000000000000000000000..cbd1aa89e927d8d54b49fe666bf17244c3c46a7b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_frontalface_default.xml @@ -0,0 +1,33314 @@ + + + +BOOST + HAAR + 24 + 24 + + 211 + + 0 + 25 + + <_> + 9 + -5.0425500869750977e+00 + + <_> + + 0 -1 0 -3.1511999666690826e-02 + + 2.0875380039215088e+00 -2.2172100543975830e+00 + <_> + + 0 -1 1 1.2396000325679779e-02 + + -1.8633940219879150e+00 1.3272049427032471e+00 + <_> + + 0 -1 2 2.1927999332547188e-02 + + -1.5105249881744385e+00 1.0625729560852051e+00 + <_> + + 0 -1 3 5.7529998011887074e-03 + + -8.7463897466659546e-01 1.1760339736938477e+00 + <_> + + 0 -1 4 1.5014000236988068e-02 + + -7.7945697307586670e-01 1.2608419656753540e+00 + <_> + + 0 -1 5 9.9371001124382019e-02 + + 5.5751299858093262e-01 -1.8743000030517578e+00 + <_> + + 0 -1 6 2.7340000960975885e-03 + + -1.6911929845809937e+00 4.4009700417518616e-01 + <_> + + 0 -1 7 -1.8859000876545906e-02 + + -1.4769539833068848e+00 4.4350099563598633e-01 + <_> + + 0 -1 8 5.9739998541772366e-03 + + -8.5909199714660645e-01 8.5255599021911621e-01 + <_> + 16 + -4.9842400550842285e+00 + + <_> + + 0 -1 9 -2.1110000088810921e-02 + + 1.2435649633407593e+00 -1.5713009834289551e+00 + <_> + + 0 -1 10 2.0355999469757080e-02 + + -1.6204780340194702e+00 1.1817760467529297e+00 + <_> + + 0 -1 11 2.1308999508619308e-02 + + -1.9415930509567261e+00 7.0069098472595215e-01 + <_> + + 0 -1 12 9.1660000383853912e-02 + + -5.5670100450515747e-01 1.7284419536590576e+00 + <_> + + 0 -1 13 3.6288000643253326e-02 + + 2.6763799786567688e-01 -2.1831810474395752e+00 + <_> + + 0 -1 14 -1.9109999760985374e-02 + + -2.6730210781097412e+00 4.5670801401138306e-01 + <_> + + 0 -1 15 8.2539999857544899e-03 + + -1.0852910280227661e+00 5.3564202785491943e-01 + <_> + + 0 -1 16 1.8355000764131546e-02 + + -3.5200199484825134e-01 9.3339198827743530e-01 + <_> + + 0 -1 17 -7.0569999516010284e-03 + + 9.2782098054885864e-01 -6.6349899768829346e-01 + <_> + + 0 -1 18 -9.8770000040531158e-03 + + 1.1577470302581787e+00 -2.9774799942970276e-01 + <_> + + 0 -1 19 1.5814000740647316e-02 + + -4.1960600018501282e-01 1.3576040267944336e+00 + <_> + + 0 -1 20 -2.0700000226497650e-02 + + 1.4590020179748535e+00 -1.9739399850368500e-01 + <_> + + 0 -1 21 -1.3760800659656525e-01 + + 1.1186759471893311e+00 -5.2915501594543457e-01 + <_> + + 0 -1 22 1.4318999834358692e-02 + + -3.5127198696136475e-01 1.1440860033035278e+00 + <_> + + 0 -1 23 1.0253000073134899e-02 + + -6.0850602388381958e-01 7.7098500728607178e-01 + <_> + + 0 -1 24 9.1508001089096069e-02 + + 3.8817799091339111e-01 -1.5122940540313721e+00 + <_> + 27 + -4.6551899909973145e+00 + + <_> + + 0 -1 25 6.9747000932693481e-02 + + -1.0130879878997803e+00 1.4687349796295166e+00 + <_> + + 0 -1 26 3.1502999365329742e-02 + + -1.6463639736175537e+00 1.0000629425048828e+00 + <_> + + 0 -1 27 1.4260999858379364e-02 + + 4.6480301022529602e-01 -1.5959889888763428e+00 + <_> + + 0 -1 28 1.4453000389039516e-02 + + -6.5511900186538696e-01 8.3021801710128784e-01 + <_> + + 0 -1 29 -3.0509999487549067e-03 + + -1.3982310295104980e+00 4.2550599575042725e-01 + <_> + + 0 -1 30 3.2722998410463333e-02 + + -5.0702601671218872e-01 1.0526109933853149e+00 + <_> + + 0 -1 31 -7.2960001416504383e-03 + + 3.6356899142265320e-01 -1.3464889526367188e+00 + <_> + + 0 -1 32 5.0425000488758087e-02 + + -3.0461400747299194e-01 1.4504129886627197e+00 + <_> + + 0 -1 33 4.6879000961780548e-02 + + -4.0286201238632202e-01 1.2145609855651855e+00 + <_> + + 0 -1 34 -6.9358997046947479e-02 + + 1.0539360046386719e+00 -4.5719701051712036e-01 + <_> + + 0 -1 35 -4.9033999443054199e-02 + + -1.6253089904785156e+00 1.5378999710083008e-01 + <_> + + 0 -1 36 8.4827996790409088e-02 + + 2.8402999043464661e-01 -1.5662059783935547e+00 + <_> + + 0 -1 37 -1.7229999648407102e-03 + + -1.0147459506988525e+00 2.3294800519943237e-01 + <_> + + 0 -1 38 1.1562199890613556e-01 + + -1.6732899844646454e-01 1.2804069519042969e+00 + <_> + + 0 -1 39 -5.1279999315738678e-02 + + 1.5162390470504761e+00 -3.0271100997924805e-01 + <_> + + 0 -1 40 -4.2706999927759171e-02 + + 1.7631920576095581e+00 -5.1832001656293869e-02 + <_> + + 0 -1 41 3.7178099155426025e-01 + + -3.1389200687408447e-01 1.5357979536056519e+00 + <_> + + 0 -1 42 1.9412999972701073e-02 + + -1.0017599910497665e-01 9.3655401468276978e-01 + <_> + + 0 -1 43 1.7439000308513641e-02 + + -4.0379899740219116e-01 9.6293002367019653e-01 + <_> + + 0 -1 44 3.9638999849557877e-02 + + 1.7039099335670471e-01 -2.9602990150451660e+00 + <_> + + 0 -1 45 -9.1469995677471161e-03 + + 8.8786798715591431e-01 -4.3818700313568115e-01 + <_> + + 0 -1 46 1.7219999572262168e-03 + + -3.7218600511550903e-01 4.0018901228904724e-01 + <_> + + 0 -1 47 3.0231000855565071e-02 + + 6.5924003720283508e-02 -2.6469180583953857e+00 + <_> + + 0 -1 48 -7.8795999288558960e-02 + + -1.7491459846496582e+00 2.8475299477577209e-01 + <_> + + 0 -1 49 2.1110000088810921e-03 + + -9.3908101320266724e-01 2.3205199837684631e-01 + <_> + + 0 -1 50 2.7091000229120255e-02 + + -5.2664000540971756e-02 1.0756820440292358e+00 + <_> + + 0 -1 51 -4.4964998960494995e-02 + + -1.8294479846954346e+00 9.9561996757984161e-02 + <_> + 32 + -4.4531588554382324e+00 + + <_> + + 0 -1 52 -6.5701000392436981e-02 + + 1.1558510065078735e+00 -1.0716359615325928e+00 + <_> + + 0 -1 53 1.5839999541640282e-02 + + -1.5634720325469971e+00 7.6877099275588989e-01 + <_> + + 0 -1 54 1.4570899307727814e-01 + + -5.7450097799301147e-01 1.3808720111846924e+00 + <_> + + 0 -1 55 6.1389999464154243e-03 + + -1.4570560455322266e+00 5.1610302925109863e-01 + <_> + + 0 -1 56 6.7179999314248562e-03 + + -8.3533602952957153e-01 5.8522200584411621e-01 + <_> + + 0 -1 57 1.8518000841140747e-02 + + -3.1312099099159241e-01 1.1696679592132568e+00 + <_> + + 0 -1 58 1.9958000630140305e-02 + + -4.3442600965499878e-01 9.5446902513504028e-01 + <_> + + 0 -1 59 -2.7755001187324524e-01 + + 1.4906179904937744e+00 -1.3815900683403015e-01 + <_> + + 0 -1 60 9.1859996318817139e-03 + + -9.6361500024795532e-01 2.7665498852729797e-01 + <_> + + 0 -1 61 -3.7737999111413956e-02 + + -2.4464108943939209e+00 2.3619599640369415e-01 + <_> + + 0 -1 62 1.8463000655174255e-02 + + 1.7539200186729431e-01 -1.3423130512237549e+00 + <_> + + 0 -1 63 -1.1114999651908875e-02 + + 4.8710799217224121e-01 -8.9851897954940796e-01 + <_> + + 0 -1 64 3.3927999436855316e-02 + + 1.7874200642108917e-01 -1.6342279911041260e+00 + <_> + + 0 -1 65 -3.5649001598358154e-02 + + -1.9607399702072144e+00 1.8102499842643738e-01 + <_> + + 0 -1 66 -1.1438000015914440e-02 + + 9.9010699987411499e-01 -3.8103199005126953e-01 + <_> + + 0 -1 67 -6.5236002206802368e-02 + + -2.5794160366058350e+00 2.4753600358963013e-01 + <_> + + 0 -1 68 -4.2272001504898071e-02 + + 1.4411840438842773e+00 -2.9508298635482788e-01 + <_> + + 0 -1 69 1.9219999667257071e-03 + + -4.9608600139617920e-01 6.3173598051071167e-01 + <_> + + 0 -1 70 -1.2921799719333649e-01 + + -2.3314270973205566e+00 5.4496999830007553e-02 + <_> + + 0 -1 71 2.2931000217795372e-02 + + -8.4447097778320312e-01 3.8738098740577698e-01 + <_> + + 0 -1 72 -3.4120000898838043e-02 + + -1.4431500434875488e+00 9.8422996699810028e-02 + <_> + + 0 -1 73 2.6223000138998032e-02 + + 1.8223099410533905e-01 -1.2586519718170166e+00 + <_> + + 0 -1 74 2.2236999124288559e-02 + + 6.9807998836040497e-02 -2.3820950984954834e+00 + <_> + + 0 -1 75 -5.8240001089870930e-03 + + 3.9332500100135803e-01 -2.7542799711227417e-01 + <_> + + 0 -1 76 4.3653000146150589e-02 + + 1.4832699298858643e-01 -1.1368780136108398e+00 + <_> + + 0 -1 77 5.7266999036073685e-02 + + 2.4628099799156189e-01 -1.2687400579452515e+00 + <_> + + 0 -1 78 2.3409998975694180e-03 + + -7.5448900461196899e-01 2.7163800597190857e-01 + <_> + + 0 -1 79 1.2996000237762928e-02 + + -3.6394900083541870e-01 7.0959198474884033e-01 + <_> + + 0 -1 80 -2.6517000049352646e-02 + + -2.3221859931945801e+00 3.5744000226259232e-02 + <_> + + 0 -1 81 -5.8400002308189869e-03 + + 4.2194300889968872e-01 -4.8184998333454132e-02 + <_> + + 0 -1 82 -1.6568999737501144e-02 + + 1.1099940538406372e+00 -3.4849700331687927e-01 + <_> + + 0 -1 83 -6.8157002329826355e-02 + + -3.3269989490509033e+00 2.1299000084400177e-01 + <_> + 52 + -4.3864588737487793e+00 + + <_> + + 0 -1 84 3.9974000304937363e-02 + + -1.2173449993133545e+00 1.0826710462570190e+00 + <_> + + 0 -1 85 1.8819500505924225e-01 + + -4.8289400339126587e-01 1.4045250415802002e+00 + <_> + + 0 -1 86 7.8027002513408661e-02 + + -1.0782150030136108e+00 7.4040299654006958e-01 + <_> + + 0 -1 87 1.1899999663000926e-04 + + -1.2019979953765869e+00 3.7749201059341431e-01 + <_> + + 0 -1 88 8.5056997835636139e-02 + + -4.3939098715782166e-01 1.2647340297698975e+00 + <_> + + 0 -1 89 8.9720003306865692e-03 + + -1.8440499901771545e-01 4.5726400613784790e-01 + <_> + + 0 -1 90 8.8120000436902046e-03 + + 3.0396699905395508e-01 -9.5991098880767822e-01 + <_> + + 0 -1 91 -2.3507999256253242e-02 + + 1.2487529516220093e+00 4.6227999031543732e-02 + <_> + + 0 -1 92 7.0039997808635235e-03 + + -5.9442102909088135e-01 5.3963297605514526e-01 + <_> + + 0 -1 93 3.3851999789476395e-02 + + 2.8496098518371582e-01 -1.4895249605178833e+00 + <_> + + 0 -1 94 -3.2530000898987055e-03 + + 4.8120799660682678e-01 -5.2712398767471313e-01 + <_> + + 0 -1 95 2.9097000136971474e-02 + + 2.6743900775909424e-01 -1.6007850170135498e+00 + <_> + + 0 -1 96 -8.4790000692009926e-03 + + -1.3107639551162720e+00 1.5243099629878998e-01 + <_> + + 0 -1 97 -1.0795000009238720e-02 + + 4.5613598823547363e-01 -7.2050899267196655e-01 + <_> + + 0 -1 98 -2.4620000272989273e-02 + + -1.7320619821548462e+00 6.8363003432750702e-02 + <_> + + 0 -1 99 3.7380000576376915e-03 + + -1.9303299486637115e-01 6.8243497610092163e-01 + <_> + + 0 -1 100 -1.2264000251889229e-02 + + -1.6095290184020996e+00 7.5268000364303589e-02 + <_> + + 0 -1 101 -4.8670000396668911e-03 + + 7.4286502599716187e-01 -2.1510200202465057e-01 + <_> + + 0 -1 102 7.6725997030735016e-02 + + -2.6835098862648010e-01 1.3094140291213989e+00 + <_> + + 0 -1 103 2.8578000143170357e-02 + + -5.8793000876903534e-02 1.2196329832077026e+00 + <_> + + 0 -1 104 1.9694000482559204e-02 + + -3.5142898559570312e-01 8.4926998615264893e-01 + <_> + + 0 -1 105 -2.9093999415636063e-02 + + -1.0507299900054932e+00 2.9806300997734070e-01 + <_> + + 0 -1 106 -2.9144000262022018e-02 + + 8.2547801733016968e-01 -3.2687199115753174e-01 + <_> + + 0 -1 107 1.9741000607609749e-02 + + 2.0452600717544556e-01 -8.3760201930999756e-01 + <_> + + 0 -1 108 4.3299999088048935e-03 + + 2.0577900111675262e-01 -6.6829800605773926e-01 + <_> + + 0 -1 109 -3.5500999540090561e-02 + + -1.2969900369644165e+00 1.3897499442100525e-01 + <_> + + 0 -1 110 -1.6172999516129494e-02 + + -1.3110569715499878e+00 7.5751997530460358e-02 + <_> + + 0 -1 111 -2.2151000797748566e-02 + + -1.0524389743804932e+00 1.9241100549697876e-01 + <_> + + 0 -1 112 -2.2707000374794006e-02 + + -1.3735309839248657e+00 6.6780999302864075e-02 + <_> + + 0 -1 113 1.6607999801635742e-02 + + -3.7135999649763107e-02 7.7846401929855347e-01 + <_> + + 0 -1 114 -1.3309000059962273e-02 + + -9.9850702285766602e-01 1.2248100340366364e-01 + <_> + + 0 -1 115 -3.3732000738382339e-02 + + 1.4461359977722168e+00 1.3151999562978745e-02 + <_> + + 0 -1 116 1.6935000196099281e-02 + + -3.7121298909187317e-01 5.2842199802398682e-01 + <_> + + 0 -1 117 3.3259999472647905e-03 + + -5.7568502426147461e-01 3.9261901378631592e-01 + <_> + + 0 -1 118 8.3644002676010132e-02 + + 1.6116000711917877e-02 -2.1173279285430908e+00 + <_> + + 0 -1 119 2.5785198807716370e-01 + + -8.1609003245830536e-02 9.8782497644424438e-01 + <_> + + 0 -1 120 -3.6566998809576035e-02 + + -1.1512110233306885e+00 9.6459001302719116e-02 + <_> + + 0 -1 121 -1.6445999965071678e-02 + + 3.7315499782562256e-01 -1.4585399627685547e-01 + <_> + + 0 -1 122 -3.7519999314099550e-03 + + 2.6179298758506775e-01 -5.8156698942184448e-01 + <_> + + 0 -1 123 -6.3660000450909138e-03 + + 7.5477397441864014e-01 -1.7055200040340424e-01 + <_> + + 0 -1 124 -3.8499999791383743e-03 + + 2.2653999924659729e-01 -6.3876402378082275e-01 + <_> + + 0 -1 125 -4.5494001358747482e-02 + + -1.2640299797058105e+00 2.5260698795318604e-01 + <_> + + 0 -1 126 -2.3941000923514366e-02 + + 8.7068402767181396e-01 -2.7104699611663818e-01 + <_> + + 0 -1 127 -7.7558003365993500e-02 + + -1.3901610374450684e+00 2.3612299561500549e-01 + <_> + + 0 -1 128 2.3614000529050827e-02 + + 6.6140003502368927e-02 -1.2645419836044312e+00 + <_> + + 0 -1 129 -2.5750000495463610e-03 + + -5.3841698169708252e-01 3.0379098653793335e-01 + <_> + + 0 -1 130 1.2010800093412399e-01 + + -3.5343000292778015e-01 5.2866202592849731e-01 + <_> + + 0 -1 131 2.2899999748915434e-03 + + -5.8701997995376587e-01 2.4061000347137451e-01 + <_> + + 0 -1 132 6.9716997444629669e-02 + + -3.3348900079727173e-01 5.1916301250457764e-01 + <_> + + 0 -1 133 -4.6670001000165939e-02 + + 6.9795399904251099e-01 -1.4895999804139137e-02 + <_> + + 0 -1 134 -5.0129000097513199e-02 + + 8.6146199703216553e-01 -2.5986000895500183e-01 + <_> + + 0 -1 135 3.0147999525070190e-02 + + 1.9332799315452576e-01 -5.9131097793579102e-01 + <_> + 53 + -4.1299300193786621e+00 + + <_> + + 0 -1 136 9.1085001826286316e-02 + + -8.9233100414276123e-01 1.0434230566024780e+00 + <_> + + 0 -1 137 1.2818999588489532e-02 + + -1.2597670555114746e+00 5.5317097902297974e-01 + <_> + + 0 -1 138 1.5931999310851097e-02 + + -8.6254400014877319e-01 6.3731801509857178e-01 + <_> + + 0 -1 139 2.2780001163482666e-03 + + -7.4639201164245605e-01 5.3155601024627686e-01 + <_> + + 0 -1 140 3.1840998679399490e-02 + + -1.2650489807128906e+00 3.6153900623321533e-01 + <_> + + 0 -1 141 2.6960000395774841e-03 + + -9.8290401697158813e-01 3.6013001203536987e-01 + <_> + + 0 -1 142 -1.2055000290274620e-02 + + 6.4068400859832764e-01 -5.0125002861022949e-01 + <_> + + 0 -1 143 2.1324999630451202e-02 + + -2.4034999310970306e-01 8.5448002815246582e-01 + <_> + + 0 -1 144 3.0486000701785088e-02 + + -3.4273600578308105e-01 1.1428849697113037e+00 + <_> + + 0 -1 145 -4.5079998672008514e-02 + + 1.0976949930191040e+00 -1.7974600195884705e-01 + <_> + + 0 -1 146 -7.1700997650623322e-02 + + 1.5735000371932983e+00 -3.1433498859405518e-01 + <_> + + 0 -1 147 5.9218000620603561e-02 + + -2.7582401037216187e-01 1.0448570251464844e+00 + <_> + + 0 -1 148 6.7010000348091125e-03 + + -1.0974019765853882e+00 1.9801199436187744e-01 + <_> + + 0 -1 149 4.1046999394893646e-02 + + 3.0547699332237244e-01 -1.3287999629974365e+00 + <_> + + 0 -1 150 -8.5499999113380909e-04 + + 2.5807100534439087e-01 -7.0052897930145264e-01 + <_> + + 0 -1 151 -3.0360000208020210e-02 + + -1.2306419610977173e+00 2.2609399259090424e-01 + <_> + + 0 -1 152 -1.2930000200867653e-02 + + 4.0758600831031799e-01 -5.1234501600265503e-01 + <_> + + 0 -1 153 3.7367999553680420e-02 + + -9.4755001366138458e-02 6.1765098571777344e-01 + <_> + + 0 -1 154 2.4434000253677368e-02 + + -4.1100600361824036e-01 4.7630500793457031e-01 + <_> + + 0 -1 155 5.7007998228073120e-02 + + 2.5249299407005310e-01 -6.8669801950454712e-01 + <_> + + 0 -1 156 -1.6313999891281128e-02 + + -9.3928402662277222e-01 1.1448100209236145e-01 + <_> + + 0 -1 157 -1.7648899555206299e-01 + + 1.2451089620590210e+00 -5.6519001722335815e-02 + <_> + + 0 -1 158 1.7614600062370300e-01 + + -3.2528200745582581e-01 8.2791501283645630e-01 + <_> + + 0 -1 159 -7.3910001665353775e-03 + + 3.4783700108528137e-01 -1.7929099500179291e-01 + <_> + + 0 -1 160 6.0890998691320419e-02 + + 5.5098000913858414e-02 -1.5480779409408569e+00 + <_> + + 0 -1 161 -2.9123000800609589e-02 + + -1.0255639553070068e+00 2.4106900393962860e-01 + <_> + + 0 -1 162 -4.5648999512195587e-02 + + 1.0301599502563477e+00 -3.1672099232673645e-01 + <_> + + 0 -1 163 3.7333000451326370e-02 + + 2.1620599925518036e-01 -8.2589900493621826e-01 + <_> + + 0 -1 164 -2.4411000311374664e-02 + + -1.5957959890365601e+00 5.1139000803232193e-02 + <_> + + 0 -1 165 -5.9806998819112778e-02 + + -1.0312290191650391e+00 1.3092300295829773e-01 + <_> + + 0 -1 166 -3.0106000602245331e-02 + + -1.4781630039215088e+00 3.7211999297142029e-02 + <_> + + 0 -1 167 7.4209999293088913e-03 + + -2.4024100601673126e-01 4.9333998560905457e-01 + <_> + + 0 -1 168 -2.1909999195486307e-03 + + 2.8941500186920166e-01 -5.7259601354598999e-01 + <_> + + 0 -1 169 2.0860999822616577e-02 + + -2.3148399591445923e-01 6.3765901327133179e-01 + <_> + + 0 -1 170 -6.6990000195801258e-03 + + -1.2107750177383423e+00 6.4018003642559052e-02 + <_> + + 0 -1 171 1.8758000805974007e-02 + + 2.4461300671100616e-01 -9.9786698818206787e-01 + <_> + + 0 -1 172 -4.4323001056909561e-02 + + -1.3699189424514771e+00 3.6051999777555466e-02 + <_> + + 0 -1 173 2.2859999909996986e-02 + + 2.1288399398326874e-01 -1.0397620201110840e+00 + <_> + + 0 -1 174 -9.8600005730986595e-04 + + 3.2443600893020630e-01 -5.4291802644729614e-01 + <_> + + 0 -1 175 1.7239000648260117e-02 + + -2.8323900699615479e-01 4.4468200206756592e-01 + <_> + + 0 -1 176 -3.4531001001596451e-02 + + -2.3107020854949951e+00 -3.1399999279528856e-03 + <_> + + 0 -1 177 6.7006997764110565e-02 + + 2.8715699911117554e-01 -6.4481002092361450e-01 + <_> + + 0 -1 178 2.3776899278163910e-01 + + -2.7174800634384155e-01 8.0219101905822754e-01 + <_> + + 0 -1 179 -1.2903000228106976e-02 + + -1.5317620038986206e+00 2.1423600614070892e-01 + <_> + + 0 -1 180 1.0514999739825726e-02 + + 7.7037997543811798e-02 -1.0581140518188477e+00 + <_> + + 0 -1 181 1.6969000920653343e-02 + + 1.4306700229644775e-01 -8.5828399658203125e-01 + <_> + + 0 -1 182 -7.2460002265870571e-03 + + -1.1020129919052124e+00 6.4906999468803406e-02 + <_> + + 0 -1 183 1.0556999593973160e-02 + + 1.3964000158011913e-02 6.3601499795913696e-01 + <_> + + 0 -1 184 6.1380001716315746e-03 + + -3.4545901417732239e-01 5.6296801567077637e-01 + <_> + + 0 -1 185 1.3158000074326992e-02 + + 1.9927300512790680e-01 -1.5040320158004761e+00 + <_> + + 0 -1 186 3.1310000922530890e-03 + + -4.0903699398040771e-01 3.7796398997306824e-01 + <_> + + 0 -1 187 -1.0920699685811996e-01 + + -2.2227079868316650e+00 1.2178199738264084e-01 + <_> + + 0 -1 188 8.1820003688335419e-03 + + -2.8652000427246094e-01 6.7890799045562744e-01 + <_> + 62 + -4.0218091011047363e+00 + + <_> + + 0 -1 189 3.1346999108791351e-02 + + -8.8884598016738892e-01 9.4936800003051758e-01 + <_> + + 0 -1 190 3.1918000429868698e-02 + + -1.1146880388259888e+00 4.8888999223709106e-01 + <_> + + 0 -1 191 6.5939999185502529e-03 + + -1.0097689628601074e+00 4.9723801016807556e-01 + <_> + + 0 -1 192 2.6148000732064247e-02 + + 2.5991299748420715e-01 -1.2537480592727661e+00 + <_> + + 0 -1 193 1.2845000252127647e-02 + + -5.7138597965240479e-01 5.9659498929977417e-01 + <_> + + 0 -1 194 2.6344999670982361e-02 + + -5.5203199386596680e-01 3.0217400193214417e-01 + <_> + + 0 -1 195 -1.5083000063896179e-02 + + -1.2871240377426147e+00 2.2354200482368469e-01 + <_> + + 0 -1 196 -3.8887001574039459e-02 + + 1.7425049543380737e+00 -9.9747002124786377e-02 + <_> + + 0 -1 197 -5.7029998861253262e-03 + + -1.0523240566253662e+00 1.8362599611282349e-01 + <_> + + 0 -1 198 -1.4860000228509307e-03 + + 5.6784200668334961e-01 -4.6742001175880432e-01 + <_> + + 0 -1 199 -2.8486000373959541e-02 + + 1.3082909584045410e+00 -2.6460900902748108e-01 + <_> + + 0 -1 200 6.6224999725818634e-02 + + -4.6210700273513794e-01 4.1749599575996399e-01 + <_> + + 0 -1 201 8.8569996878504753e-03 + + -4.1474899649620056e-01 5.9204798936843872e-01 + <_> + + 0 -1 202 1.1355999857187271e-02 + + 3.6103099584579468e-01 -4.5781201124191284e-01 + <_> + + 0 -1 203 -2.7679998893290758e-03 + + -8.9238899946212769e-01 1.4199000597000122e-01 + <_> + + 0 -1 204 1.1246999725699425e-02 + + 2.9353401064872742e-01 -9.7330600023269653e-01 + <_> + + 0 -1 205 7.1970000863075256e-03 + + -7.9334902763366699e-01 1.8313400447368622e-01 + <_> + + 0 -1 206 3.1768999993801117e-02 + + 1.5523099899291992e-01 -1.3245639801025391e+00 + <_> + + 0 -1 207 2.5173999369144440e-02 + + 3.4214999526739120e-02 -2.0948131084442139e+00 + <_> + + 0 -1 208 7.5360001064836979e-03 + + -3.9450600743293762e-01 5.1333999633789062e-01 + <_> + + 0 -1 209 3.2873000949621201e-02 + + 8.8372997939586639e-02 -1.2814120054244995e+00 + <_> + + 0 -1 210 -2.7379998937249184e-03 + + 5.5286502838134766e-01 -4.6384999155998230e-01 + <_> + + 0 -1 211 -3.8075000047683716e-02 + + -1.8497270345687866e+00 4.5944001525640488e-02 + <_> + + 0 -1 212 -3.8984000682830811e-02 + + -4.8223701119422913e-01 3.4760600328445435e-01 + <_> + + 0 -1 213 2.8029999230057001e-03 + + -4.5154699683189392e-01 4.2806300520896912e-01 + <_> + + 0 -1 214 -5.4145999252796173e-02 + + -8.4520798921585083e-01 1.6674900054931641e-01 + <_> + + 0 -1 215 -8.3280000835657120e-03 + + 3.5348299145698547e-01 -4.7163200378417969e-01 + <_> + + 0 -1 216 3.3778000622987747e-02 + + 1.8463100492954254e-01 -1.6686669588088989e+00 + <_> + + 0 -1 217 -1.1238099634647369e-01 + + -1.2521569728851318e+00 3.5992000252008438e-02 + <_> + + 0 -1 218 -1.0408000089228153e-02 + + -8.1620401144027710e-01 2.3428599536418915e-01 + <_> + + 0 -1 219 -4.9439999274909496e-03 + + -9.2584699392318726e-01 1.0034800320863724e-01 + <_> + + 0 -1 220 -9.3029998242855072e-03 + + 5.6499302387237549e-01 -1.8881900608539581e-01 + <_> + + 0 -1 221 -1.1749999597668648e-02 + + 8.0302399396896362e-01 -3.8277000188827515e-01 + <_> + + 0 -1 222 -2.3217000067234039e-02 + + -8.4926998615264893e-01 1.9671200215816498e-01 + <_> + + 0 -1 223 1.6866000369191170e-02 + + -4.0591898560523987e-01 5.0695300102233887e-01 + <_> + + 0 -1 224 -2.4031000211834908e-02 + + -1.5297520160675049e+00 2.3344999551773071e-01 + <_> + + 0 -1 225 -3.6945998668670654e-02 + + 6.3007700443267822e-01 -3.1780400872230530e-01 + <_> + + 0 -1 226 -6.1563998460769653e-02 + + 5.8627897500991821e-01 -1.2107999995350838e-02 + <_> + + 0 -1 227 2.1661000326275826e-02 + + -2.5623700022697449e-01 1.0409849882125854e+00 + <_> + + 0 -1 228 -3.6710000131279230e-03 + + 2.9171100258827209e-01 -8.3287298679351807e-01 + <_> + + 0 -1 229 4.4849000871181488e-02 + + -3.9633199572563171e-01 4.5662000775337219e-01 + <_> + + 0 -1 230 5.7195000350475311e-02 + + 2.1023899316787720e-01 -1.5004800558090210e+00 + <_> + + 0 -1 231 -1.1342000216245651e-02 + + 4.4071298837661743e-01 -3.8653799891471863e-01 + <_> + + 0 -1 232 -1.2004000134766102e-02 + + 9.3954598903656006e-01 -1.0589499771595001e-01 + <_> + + 0 -1 233 2.2515999153256416e-02 + + 9.4480002298951149e-03 -1.6799509525299072e+00 + <_> + + 0 -1 234 -1.9809000194072723e-02 + + -1.0133639574050903e+00 2.4146600067615509e-01 + <_> + + 0 -1 235 1.5891000628471375e-02 + + -3.7507599592208862e-01 4.6614098548889160e-01 + <_> + + 0 -1 236 -9.1420002281665802e-03 + + -8.0484098196029663e-01 1.7816999554634094e-01 + <_> + + 0 -1 237 -4.4740000739693642e-03 + + -1.0562069416046143e+00 7.3305003345012665e-02 + <_> + + 0 -1 238 1.2742500007152557e-01 + + 2.0165599882602692e-01 -1.5467929840087891e+00 + <_> + + 0 -1 239 4.7703001648187637e-02 + + -3.7937799096107483e-01 3.7885999679565430e-01 + <_> + + 0 -1 240 5.3608000278472900e-02 + + 2.1220499277114868e-01 -1.2399710416793823e+00 + <_> + + 0 -1 241 -3.9680998772382736e-02 + + -1.0257550477981567e+00 5.1282998174428940e-02 + <_> + + 0 -1 242 -6.7327000200748444e-02 + + -1.0304750204086304e+00 2.3005299270153046e-01 + <_> + + 0 -1 243 1.3337600231170654e-01 + + -2.0869000256061554e-01 1.2272510528564453e+00 + <_> + + 0 -1 244 -2.0919300615787506e-01 + + 8.7929898500442505e-01 -4.4254999607801437e-02 + <_> + + 0 -1 245 -6.5589003264904022e-02 + + 1.0443429946899414e+00 -2.1682099997997284e-01 + <_> + + 0 -1 246 6.1882998794317245e-02 + + 1.3798199594020844e-01 -1.9009059667587280e+00 + <_> + + 0 -1 247 -2.5578999891877174e-02 + + -1.6607600450515747e+00 5.8439997956156731e-03 + <_> + + 0 -1 248 -3.4827001392841339e-02 + + 7.9940402507781982e-01 -8.2406997680664062e-02 + <_> + + 0 -1 249 -1.8209999427199364e-02 + + -9.6073997020721436e-01 6.6320002079010010e-02 + <_> + + 0 -1 250 1.5070999972522259e-02 + + 1.9899399578571320e-01 -7.6433002948760986e-01 + <_> + 72 + -3.8832089900970459e+00 + + <_> + + 0 -1 251 4.6324998140335083e-02 + + -1.0362670421600342e+00 8.2201498746871948e-01 + <_> + + 0 -1 252 1.5406999737024307e-02 + + -1.2327589988708496e+00 2.9647698998451233e-01 + <_> + + 0 -1 253 1.2808999978005886e-02 + + -7.5852298736572266e-01 5.7985502481460571e-01 + <_> + + 0 -1 254 4.9150999635457993e-02 + + -3.8983899354934692e-01 8.9680302143096924e-01 + <_> + + 0 -1 255 1.2621000409126282e-02 + + -7.1799302101135254e-01 5.0440901517868042e-01 + <_> + + 0 -1 256 -1.8768999725580215e-02 + + 5.5147600173950195e-01 -7.0555400848388672e-01 + <_> + + 0 -1 257 4.1965000331401825e-02 + + -4.4782099127769470e-01 7.0985502004623413e-01 + <_> + + 0 -1 258 -5.1401998847723007e-02 + + -1.0932120084762573e+00 2.6701900362968445e-01 + <_> + + 0 -1 259 -7.0960998535156250e-02 + + 8.3618402481079102e-01 -3.8318100571632385e-01 + <_> + + 0 -1 260 1.6745999455451965e-02 + + -2.5733101367950439e-01 2.5966501235961914e-01 + <_> + + 0 -1 261 -6.2400000169873238e-03 + + 3.1631499528884888e-01 -5.8796900510787964e-01 + <_> + + 0 -1 262 -3.9397999644279480e-02 + + -1.0491210222244263e+00 1.6822400689125061e-01 + <_> + + 0 -1 263 0. + + 1.6144199669361115e-01 -8.7876898050308228e-01 + <_> + + 0 -1 264 -2.2307999432086945e-02 + + -6.9053500890731812e-01 2.3607000708580017e-01 + <_> + + 0 -1 265 1.8919999711215496e-03 + + 2.4989199638366699e-01 -5.6583297252655029e-01 + <_> + + 0 -1 266 1.0730000212788582e-03 + + -5.0415802001953125e-01 3.8374501466751099e-01 + <_> + + 0 -1 267 3.9230998605489731e-02 + + 4.2619001120328903e-02 -1.3875889778137207e+00 + <_> + + 0 -1 268 6.2238000333309174e-02 + + 1.4119400084018707e-01 -1.0688860416412354e+00 + <_> + + 0 -1 269 2.1399999968707561e-03 + + -8.9622402191162109e-01 1.9796399772167206e-01 + <_> + + 0 -1 270 9.1800000518560410e-04 + + -4.5337298512458801e-01 4.3532699346542358e-01 + <_> + + 0 -1 271 -6.9169998168945312e-03 + + 3.3822798728942871e-01 -4.4793000817298889e-01 + <_> + + 0 -1 272 -2.3866999894380569e-02 + + -7.8908598423004150e-01 2.2511799633502960e-01 + <_> + + 0 -1 273 -1.0262800008058548e-01 + + -2.2831439971923828e+00 -5.3960001096129417e-03 + <_> + + 0 -1 274 -9.5239998772740364e-03 + + 3.9346700906753540e-01 -5.2242201566696167e-01 + <_> + + 0 -1 275 3.9877001196146011e-02 + + 3.2799001783132553e-02 -1.5079489946365356e+00 + <_> + + 0 -1 276 -1.3144999742507935e-02 + + -1.0839990377426147e+00 1.8482400476932526e-01 + <_> + + 0 -1 277 -5.0590999424457550e-02 + + -1.8822289705276489e+00 -2.2199999075382948e-03 + <_> + + 0 -1 278 2.4917000904679298e-02 + + 1.4593400061130524e-01 -2.2196519374847412e+00 + <_> + + 0 -1 279 -7.6370001770555973e-03 + + -1.0164569616317749e+00 5.8797001838684082e-02 + <_> + + 0 -1 280 4.2911998927593231e-02 + + 1.5443000197410583e-01 -1.1843889951705933e+00 + <_> + + 0 -1 281 2.3000000510364771e-04 + + -7.7305799722671509e-01 1.2189900130033493e-01 + <_> + + 0 -1 282 9.0929996222257614e-03 + + -1.1450099945068359e-01 7.1091300249099731e-01 + <_> + + 0 -1 283 1.1145000346004963e-02 + + 7.0000998675823212e-02 -1.0534820556640625e+00 + <_> + + 0 -1 284 -5.2453000098466873e-02 + + -1.7594360113143921e+00 1.9523799419403076e-01 + <_> + + 0 -1 285 -2.3020699620246887e-01 + + 9.5840299129486084e-01 -2.5045698881149292e-01 + <_> + + 0 -1 286 -1.6365999355912209e-02 + + 4.6731901168823242e-01 -2.1108399331569672e-01 + <_> + + 0 -1 287 -1.7208000645041466e-02 + + 7.0835697650909424e-01 -2.8018298745155334e-01 + <_> + + 0 -1 288 -3.6648001521825790e-02 + + -1.1013339757919312e+00 2.4341100454330444e-01 + <_> + + 0 -1 289 -1.0304999537765980e-02 + + -1.0933129787445068e+00 5.6258998811244965e-02 + <_> + + 0 -1 290 -1.3713000342249870e-02 + + -2.6438099145889282e-01 1.9821000099182129e-01 + <_> + + 0 -1 291 2.9308000579476357e-02 + + -2.2142399847507477e-01 1.0525950193405151e+00 + <_> + + 0 -1 292 2.4077000096440315e-02 + + 1.8485699594020844e-01 -1.7203969955444336e+00 + <_> + + 0 -1 293 6.1280000954866409e-03 + + -9.2721498012542725e-01 5.8752998709678650e-02 + <_> + + 0 -1 294 -2.2377999499440193e-02 + + 1.9646559953689575e+00 2.7785999700427055e-02 + <_> + + 0 -1 295 -7.0440000854432583e-03 + + 2.1427600085735321e-01 -4.8407599329948425e-01 + <_> + + 0 -1 296 -4.0603000670671463e-02 + + -1.1754349470138550e+00 1.6061200201511383e-01 + <_> + + 0 -1 297 -2.4466000497341156e-02 + + -1.1239900588989258e+00 4.1110001504421234e-02 + <_> + + 0 -1 298 2.5309999473392963e-03 + + -1.7169700562953949e-01 3.2178801298141479e-01 + <_> + + 0 -1 299 -1.9588999450206757e-02 + + 8.2720202207565308e-01 -2.6376700401306152e-01 + <_> + + 0 -1 300 -2.9635999351739883e-02 + + -1.1524770259857178e+00 1.4999300241470337e-01 + <_> + + 0 -1 301 -1.5030000358819962e-02 + + -1.0491830110549927e+00 4.0160998702049255e-02 + <_> + + 0 -1 302 -6.0715001076459885e-02 + + -1.0903840065002441e+00 1.5330800414085388e-01 + <_> + + 0 -1 303 -1.2790000066161156e-02 + + 4.2248600721359253e-01 -4.2399200797080994e-01 + <_> + + 0 -1 304 -2.0247999578714371e-02 + + -9.1866999864578247e-01 1.8485699594020844e-01 + <_> + + 0 -1 305 -3.0683999881148338e-02 + + -1.5958670377731323e+00 2.5760000571608543e-03 + <_> + + 0 -1 306 -2.0718000829219818e-02 + + -6.6299998760223389e-01 3.1037199497222900e-01 + <_> + + 0 -1 307 -1.7290000105276704e-03 + + 1.9183400273323059e-01 -6.5084999799728394e-01 + <_> + + 0 -1 308 -3.1394001096487045e-02 + + -6.3643002510070801e-01 1.5408399701118469e-01 + <_> + + 0 -1 309 1.9003000110387802e-02 + + -1.8919399380683899e-01 1.5294510126113892e+00 + <_> + + 0 -1 310 6.1769997701048851e-03 + + -1.0597900301218033e-01 6.4859598875045776e-01 + <_> + + 0 -1 311 -1.0165999643504620e-02 + + -1.0802700519561768e+00 3.7176001816987991e-02 + <_> + + 0 -1 312 -1.4169999631121755e-03 + + 3.4157499670982361e-01 -9.7737997770309448e-02 + <_> + + 0 -1 313 -4.0799998678267002e-03 + + 4.7624599933624268e-01 -3.4366300702095032e-01 + <_> + + 0 -1 314 -4.4096998870372772e-02 + + 9.7634297609329224e-01 -1.9173000007867813e-02 + <_> + + 0 -1 315 -6.0669999569654465e-02 + + -2.1752851009368896e+00 -2.8925999999046326e-02 + <_> + + 0 -1 316 -3.2931998372077942e-02 + + -6.4383101463317871e-01 1.6494099795818329e-01 + <_> + + 0 -1 317 -1.4722800254821777e-01 + + -1.4745830297470093e+00 2.5839998852461576e-03 + <_> + + 0 -1 318 -1.1930000036954880e-02 + + 4.2441400885581970e-01 -1.7712600529193878e-01 + <_> + + 0 -1 319 1.4517900347709656e-01 + + 2.5444999337196350e-02 -1.2779400348663330e+00 + <_> + + 0 -1 320 5.1447998732328415e-02 + + 1.5678399801254272e-01 -1.5188430547714233e+00 + <_> + + 0 -1 321 3.1479999888688326e-03 + + -4.0424400568008423e-01 3.2429701089859009e-01 + <_> + + 0 -1 322 -4.3600000441074371e-02 + + -1.9932260513305664e+00 1.5018600225448608e-01 + <_> + 83 + -3.8424909114837646e+00 + + <_> + + 0 -1 323 1.2899599969387054e-01 + + -6.2161999940872192e-01 1.1116520166397095e+00 + <_> + + 0 -1 324 -9.1261997818946838e-02 + + 1.0143059492111206e+00 -6.1335200071334839e-01 + <_> + + 0 -1 325 1.4271999709308147e-02 + + -1.0261659622192383e+00 3.9779999852180481e-01 + <_> + + 0 -1 326 3.2889999449253082e-02 + + -1.1386079788208008e+00 2.8690800070762634e-01 + <_> + + 0 -1 327 1.2590000405907631e-02 + + -5.6645601987838745e-01 4.5172399282455444e-01 + <_> + + 0 -1 328 1.4661000110208988e-02 + + 3.0505999922752380e-01 -6.8129599094390869e-01 + <_> + + 0 -1 329 -3.3555999398231506e-02 + + -1.7208939790725708e+00 6.1439000070095062e-02 + <_> + + 0 -1 330 1.4252699911594391e-01 + + 2.3192200064659119e-01 -1.7297149896621704e+00 + <_> + + 0 -1 331 -6.2079997733235359e-03 + + -1.2163300514221191e+00 1.2160199880599976e-01 + <_> + + 0 -1 332 1.8178999423980713e-02 + + 3.2553699612617493e-01 -8.1003999710083008e-01 + <_> + + 0 -1 333 2.5036999955773354e-02 + + -3.1698799133300781e-01 6.7361402511596680e-01 + <_> + + 0 -1 334 4.6560999006032944e-02 + + -1.1089800298213959e-01 8.4082502126693726e-01 + <_> + + 0 -1 335 -8.9999996125698090e-03 + + 3.9574500918388367e-01 -4.7624599933624268e-01 + <_> + + 0 -1 336 4.0805999189615250e-02 + + -1.8000000272877514e-04 9.4570702314376831e-01 + <_> + + 0 -1 337 -3.4221999347209930e-02 + + 7.5206297636032104e-01 -3.1531500816345215e-01 + <_> + + 0 -1 338 -3.9716001600027084e-02 + + -8.3139598369598389e-01 1.7744399607181549e-01 + <_> + + 0 -1 339 2.5170000735670328e-03 + + -5.9377998113632202e-01 2.4657000601291656e-01 + <_> + + 0 -1 340 2.7428999543190002e-02 + + 1.5998399257659912e-01 -4.2781999707221985e-01 + <_> + + 0 -1 341 3.4986000508069992e-02 + + 3.5055998712778091e-02 -1.5988600254058838e+00 + <_> + + 0 -1 342 4.4970000162720680e-03 + + -5.2034300565719604e-01 3.7828299403190613e-01 + <_> + + 0 -1 343 2.7699999045580626e-03 + + -5.3182601928710938e-01 2.4951000511646271e-01 + <_> + + 0 -1 344 3.5174001008272171e-02 + + 1.9983400404453278e-01 -1.4446129798889160e+00 + <_> + + 0 -1 345 2.5970999151468277e-02 + + 4.4426999986171722e-02 -1.3622980117797852e+00 + <_> + + 0 -1 346 -1.5783999115228653e-02 + + -9.1020399332046509e-01 2.7190300822257996e-01 + <_> + + 0 -1 347 -7.5880000367760658e-03 + + 9.2064999043941498e-02 -8.1628900766372681e-01 + <_> + + 0 -1 348 2.0754000172019005e-02 + + 2.1185700595378876e-01 -7.4729001522064209e-01 + <_> + + 0 -1 349 5.9829000383615494e-02 + + -2.7301099896430969e-01 8.0923300981521606e-01 + <_> + + 0 -1 350 3.9039000868797302e-02 + + -1.0432299971580505e-01 8.6226201057434082e-01 + <_> + + 0 -1 351 2.1665999665856361e-02 + + 6.2709003686904907e-02 -9.8894298076629639e-01 + <_> + + 0 -1 352 -2.7496999129652977e-02 + + -9.2690998315811157e-01 1.5586300194263458e-01 + <_> + + 0 -1 353 1.0462000034749508e-02 + + 1.3418099284172058e-01 -7.0386397838592529e-01 + <_> + + 0 -1 354 2.4870999157428741e-02 + + 1.9706700742244720e-01 -4.0263301134109497e-01 + <_> + + 0 -1 355 -1.6036000102758408e-02 + + -1.1409829854965210e+00 7.3997996747493744e-02 + <_> + + 0 -1 356 4.8627000302076340e-02 + + 1.6990399360656738e-01 -7.2152197360992432e-01 + <_> + + 0 -1 357 1.2619999470189214e-03 + + -4.7389799356460571e-01 2.6254999637603760e-01 + <_> + + 0 -1 358 -8.8035002350807190e-02 + + -2.1606519222259521e+00 1.4554800093173981e-01 + <_> + + 0 -1 359 1.8356999382376671e-02 + + 4.4750999659299850e-02 -1.0766370296478271e+00 + <_> + + 0 -1 360 3.5275001078844070e-02 + + -3.2919000834226608e-02 1.2153890132904053e+00 + <_> + + 0 -1 361 -2.0392900705337524e-01 + + -1.3187999725341797e+00 1.5503999777138233e-02 + <_> + + 0 -1 362 -1.6619000583887100e-02 + + 3.6850199103355408e-01 -1.5283699333667755e-01 + <_> + + 0 -1 363 3.7739001214504242e-02 + + -2.5727799534797668e-01 7.0655298233032227e-01 + <_> + + 0 -1 364 2.2720000706613064e-03 + + -7.7602997422218323e-02 3.3367800712585449e-01 + <_> + + 0 -1 365 -1.4802999794483185e-02 + + -7.8524798154830933e-01 7.6934002339839935e-02 + <_> + + 0 -1 366 -4.8319000750780106e-02 + + 1.7022320032119751e+00 4.9722000956535339e-02 + <_> + + 0 -1 367 -2.9539000242948532e-02 + + 7.7670699357986450e-01 -2.4534299969673157e-01 + <_> + + 0 -1 368 -4.6169001609086990e-02 + + -1.4922779798507690e+00 1.2340000271797180e-01 + <_> + + 0 -1 369 -2.8064999729394913e-02 + + -2.1345369815826416e+00 -2.5797000154852867e-02 + <_> + + 0 -1 370 -5.7339998893439770e-03 + + 5.6982600688934326e-01 -1.2056600302457809e-01 + <_> + + 0 -1 371 -1.0111000388860703e-02 + + 6.7911398410797119e-01 -2.6638001203536987e-01 + <_> + + 0 -1 372 1.1359999887645245e-02 + + 2.4789799749851227e-01 -6.4493000507354736e-01 + <_> + + 0 -1 373 5.1809001713991165e-02 + + 1.4716000296175480e-02 -1.2395579814910889e+00 + <_> + + 0 -1 374 3.3291999250650406e-02 + + -8.2559995353221893e-03 1.0168470144271851e+00 + <_> + + 0 -1 375 -1.4494000002741814e-02 + + 4.5066800713539124e-01 -3.6250999569892883e-01 + <_> + + 0 -1 376 -3.4221999347209930e-02 + + -9.5292502641677856e-01 2.0684599876403809e-01 + <_> + + 0 -1 377 -8.0654002726078033e-02 + + -2.0139501094818115e+00 -2.3084999993443489e-02 + <_> + + 0 -1 378 -8.9399999706074595e-04 + + 3.9572000503540039e-01 -2.9351300001144409e-01 + <_> + + 0 -1 379 9.7162000834941864e-02 + + -2.4980300664901733e-01 1.0859220027923584e+00 + <_> + + 0 -1 380 3.6614000797271729e-02 + + -5.7844001799821854e-02 1.2162159681320190e+00 + <_> + + 0 -1 381 5.1693998277187347e-02 + + 4.3062999844551086e-02 -1.0636160373687744e+00 + <_> + + 0 -1 382 -2.4557000026106834e-02 + + -4.8946800827980042e-01 1.7182900011539459e-01 + <_> + + 0 -1 383 3.2736799120903015e-01 + + -2.9688599705696106e-01 5.1798301935195923e-01 + <_> + + 0 -1 384 7.6959999278187752e-03 + + -5.9805899858474731e-01 2.4803200364112854e-01 + <_> + + 0 -1 385 1.6172200441360474e-01 + + -2.9613999649882317e-02 -2.3162529468536377e+00 + <_> + + 0 -1 386 -4.7889999113976955e-03 + + 3.7457901239395142e-01 -3.2779198884963989e-01 + <_> + + 0 -1 387 -1.8402999266982079e-02 + + -9.9692702293395996e-01 7.2948001325130463e-02 + <_> + + 0 -1 388 7.7665001153945923e-02 + + 1.4175699651241302e-01 -1.7238730192184448e+00 + <_> + + 0 -1 389 1.8921000882983208e-02 + + -2.1273100376129150e-01 1.0165189504623413e+00 + <_> + + 0 -1 390 -7.9397998750209808e-02 + + -1.3164349794387817e+00 1.4981999993324280e-01 + <_> + + 0 -1 391 -6.8037003278732300e-02 + + 4.9421998858451843e-01 -2.9091000556945801e-01 + <_> + + 0 -1 392 -6.1010001227259636e-03 + + 4.2430499196052551e-01 -3.3899301290512085e-01 + <_> + + 0 -1 393 3.1927000731229782e-02 + + -3.1046999618411064e-02 -2.3459999561309814e+00 + <_> + + 0 -1 394 -2.9843999072909355e-02 + + -7.8989601135253906e-01 1.5417699515819550e-01 + <_> + + 0 -1 395 -8.0541998147964478e-02 + + -2.2509229183197021e+00 -3.0906999483704567e-02 + <_> + + 0 -1 396 3.8109999150037766e-03 + + -2.5577300786972046e-01 2.3785500228404999e-01 + <_> + + 0 -1 397 3.3647000789642334e-02 + + -2.2541399300098419e-01 9.2307400703430176e-01 + <_> + + 0 -1 398 8.2809999585151672e-03 + + -2.8896200656890869e-01 3.1046199798583984e-01 + <_> + + 0 -1 399 1.0104399919509888e-01 + + -3.4864000976085663e-02 -2.7102620601654053e+00 + <_> + + 0 -1 400 -1.0009000077843666e-02 + + 5.9715402126312256e-01 -3.3831000328063965e-02 + <_> + + 0 -1 401 7.1919998154044151e-03 + + -4.7738000750541687e-01 2.2686000168323517e-01 + <_> + + 0 -1 402 2.4969000369310379e-02 + + 2.2877700626850128e-01 -1.0435529947280884e+00 + <_> + + 0 -1 403 2.7908000349998474e-01 + + -2.5818100571632385e-01 7.6780498027801514e-01 + <_> + + 0 -1 404 -4.4213000684976578e-02 + + -5.9798002243041992e-01 2.8039899468421936e-01 + <_> + + 0 -1 405 -1.4136999845504761e-02 + + 7.0987302064895630e-01 -2.5645199418067932e-01 + <_> + 91 + -3.6478610038757324e+00 + + <_> + + 0 -1 406 1.3771200180053711e-01 + + -5.5870598554611206e-01 1.0953769683837891e+00 + <_> + + 0 -1 407 3.4460999071598053e-02 + + -7.1171897649765015e-01 5.2899599075317383e-01 + <_> + + 0 -1 408 1.8580000847578049e-02 + + -1.1157519817352295e+00 4.0593999624252319e-01 + <_> + + 0 -1 409 2.5041999295353889e-02 + + -4.0892499685287476e-01 7.4129998683929443e-01 + <_> + + 0 -1 410 5.7179000228643417e-02 + + -3.8054299354553223e-01 7.3647701740264893e-01 + <_> + + 0 -1 411 1.4932000078260899e-02 + + -6.9945502281188965e-01 3.7950998544692993e-01 + <_> + + 0 -1 412 8.8900001719594002e-03 + + -5.4558598995208740e-01 3.6332499980926514e-01 + <_> + + 0 -1 413 3.0435999855399132e-02 + + -1.0124599933624268e-01 7.9585897922515869e-01 + <_> + + 0 -1 414 -4.4160000979900360e-02 + + 8.4410899877548218e-01 -3.2976400852203369e-01 + <_> + + 0 -1 415 1.8461000174283981e-02 + + 2.6326599717140198e-01 -9.6736502647399902e-01 + <_> + + 0 -1 416 1.0614999569952488e-02 + + 1.5251900255680084e-01 -1.0589870214462280e+00 + <_> + + 0 -1 417 -4.5974001288414001e-02 + + -1.9918340444564819e+00 1.3629099726676941e-01 + <_> + + 0 -1 418 8.2900002598762512e-02 + + -3.2037198543548584e-01 6.0304200649261475e-01 + <_> + + 0 -1 419 -8.9130001142621040e-03 + + 5.9586602449417114e-01 -2.1139599382877350e-01 + <_> + + 0 -1 420 4.2814001441001892e-02 + + 2.2925000637769699e-02 -1.4679330587387085e+00 + <_> + + 0 -1 421 -8.7139997631311417e-03 + + -4.3989500403404236e-01 2.0439699292182922e-01 + <_> + + 0 -1 422 -4.3390002101659775e-03 + + -8.9066797494888306e-01 1.0469999909400940e-01 + <_> + + 0 -1 423 8.0749997869133949e-03 + + 2.1164199709892273e-01 -4.0231600403785706e-01 + <_> + + 0 -1 424 9.6739001572132111e-02 + + 1.3319999910891056e-02 -1.6085360050201416e+00 + <_> + + 0 -1 425 -3.0536999925971031e-02 + + 1.0063740015029907e+00 -1.3413299620151520e-01 + <_> + + 0 -1 426 -6.0855999588966370e-02 + + -1.4689979553222656e+00 9.4240000471472740e-03 + <_> + + 0 -1 427 -3.8162000477313995e-02 + + -8.1636399030685425e-01 2.6171201467514038e-01 + <_> + + 0 -1 428 -9.6960002556443214e-03 + + 1.1561699956655502e-01 -7.1693199872970581e-01 + <_> + + 0 -1 429 4.8902999609708786e-02 + + 1.3050499558448792e-01 -1.6448370218276978e+00 + <_> + + 0 -1 430 -4.1611999273300171e-02 + + -1.1795840263366699e+00 2.5017000734806061e-02 + <_> + + 0 -1 431 -2.0188000053167343e-02 + + 6.3188201189041138e-01 -1.0490400344133377e-01 + <_> + + 0 -1 432 -9.7900000400841236e-04 + + 1.8507799506187439e-01 -5.3565901517868042e-01 + <_> + + 0 -1 433 -3.3622000366449356e-02 + + -9.3127602338790894e-01 2.0071500539779663e-01 + <_> + + 0 -1 434 1.9455999135971069e-02 + + 3.8029000163078308e-02 -1.0112210512161255e+00 + <_> + + 0 -1 435 -3.1800000579096377e-04 + + 3.6457699537277222e-01 -2.7610900998115540e-01 + <_> + + 0 -1 436 -3.8899999344721437e-04 + + 1.9665899872779846e-01 -5.3410500288009644e-01 + <_> + + 0 -1 437 -9.3496002256870270e-02 + + -1.6772350072860718e+00 2.0727099478244781e-01 + <_> + + 0 -1 438 -7.7877998352050781e-02 + + -3.0760629177093506e+00 -3.5803999751806259e-02 + <_> + + 0 -1 439 1.6947999596595764e-02 + + 2.1447399258613586e-01 -7.1376299858093262e-01 + <_> + + 0 -1 440 -2.1459000185132027e-02 + + -1.1468060016632080e+00 1.5855999663472176e-02 + <_> + + 0 -1 441 -1.2865999713540077e-02 + + 8.3812397718429565e-01 -6.5944001078605652e-02 + <_> + + 0 -1 442 7.8220004215836525e-03 + + -2.8026801347732544e-01 7.9376900196075439e-01 + <_> + + 0 -1 443 1.0294400155544281e-01 + + 1.7832300066947937e-01 -6.8412202596664429e-01 + <_> + + 0 -1 444 -3.7487998604774475e-02 + + 9.6189999580383301e-01 -2.1735599637031555e-01 + <_> + + 0 -1 445 2.5505999103188515e-02 + + 1.0103999637067318e-02 1.2461110353469849e+00 + <_> + + 0 -1 446 6.6700001480057836e-04 + + -5.3488200902938843e-01 1.4746299386024475e-01 + <_> + + 0 -1 447 -2.8867900371551514e-01 + + 8.2172799110412598e-01 -1.4948000200092793e-02 + <_> + + 0 -1 448 9.1294996440410614e-02 + + -1.9605399668216705e-01 1.0803170204162598e+00 + <_> + + 0 -1 449 1.2056600302457809e-01 + + -2.3848999291658401e-02 1.1392610073089600e+00 + <_> + + 0 -1 450 -7.3775000870227814e-02 + + -1.3583840131759644e+00 -4.2039998807013035e-03 + <_> + + 0 -1 451 -3.3128000795841217e-02 + + -6.4483201503753662e-01 2.4142199754714966e-01 + <_> + + 0 -1 452 -4.3937001377344131e-02 + + 8.4285402297973633e-01 -2.0624800026416779e-01 + <_> + + 0 -1 453 1.8110199272632599e-01 + + 1.9212099909782410e-01 -1.2222139835357666e+00 + <_> + + 0 -1 454 -1.1850999668240547e-02 + + -7.2677397727966309e-01 5.2687998861074448e-02 + <_> + + 0 -1 455 4.5920000411570072e-03 + + -3.6305201053619385e-01 2.9223799705505371e-01 + <_> + + 0 -1 456 7.0620002225041389e-03 + + 5.8116000145673752e-02 -6.7161601781845093e-01 + <_> + + 0 -1 457 -2.3715000599622726e-02 + + 4.7142100334167480e-01 1.8580000847578049e-02 + <_> + + 0 -1 458 -6.7171998322010040e-02 + + -1.1331889629364014e+00 2.3780999705195427e-02 + <_> + + 0 -1 459 -6.5310001373291016e-02 + + 9.8253500461578369e-01 2.8362000361084938e-02 + <_> + + 0 -1 460 2.2791000083088875e-02 + + -2.8213700652122498e-01 5.8993399143218994e-01 + <_> + + 0 -1 461 -1.9037999212741852e-02 + + -6.3711500167846680e-01 2.6514598727226257e-01 + <_> + + 0 -1 462 -6.8689999170601368e-03 + + 3.7487301230430603e-01 -3.3232098817825317e-01 + <_> + + 0 -1 463 -4.0146000683307648e-02 + + -1.3048729896545410e+00 1.5724299848079681e-01 + <_> + + 0 -1 464 -4.0530998259782791e-02 + + -2.0458049774169922e+00 -2.6925999671220779e-02 + <_> + + 0 -1 465 -1.2253999710083008e-02 + + 7.7649402618408203e-01 -4.2971000075340271e-02 + <_> + + 0 -1 466 -2.7219999581575394e-02 + + 1.7424400150775909e-01 -4.4600901007652283e-01 + <_> + + 0 -1 467 -8.8366001844406128e-02 + + -1.5036419630050659e+00 1.4289900660514832e-01 + <_> + + 0 -1 468 -7.9159997403621674e-03 + + 2.8666698932647705e-01 -3.7923699617385864e-01 + <_> + + 0 -1 469 -4.1960000991821289e-02 + + 1.3846950531005859e+00 6.5026998519897461e-02 + <_> + + 0 -1 470 4.5662999153137207e-02 + + -2.2452299296855927e-01 7.9521000385284424e-01 + <_> + + 0 -1 471 -1.4090600609779358e-01 + + -1.5879319906234741e+00 1.1359000205993652e-01 + <_> + + 0 -1 472 -5.9216000139713287e-02 + + -1.1945960521697998e+00 -7.1640000678598881e-03 + <_> + + 0 -1 473 4.3390002101659775e-03 + + -1.5528699755668640e-01 4.0664499998092651e-01 + <_> + + 0 -1 474 -2.0369999110698700e-03 + + 2.5927901268005371e-01 -3.8368299603462219e-01 + <_> + + 0 -1 475 2.7516499161720276e-01 + + -8.8497996330261230e-02 7.6787501573562622e-01 + <_> + + 0 -1 476 -2.6601999998092651e-02 + + 7.5024497509002686e-01 -2.2621999680995941e-01 + <_> + + 0 -1 477 4.0906000882387161e-02 + + 1.2158600240945816e-01 -1.4566910266876221e+00 + <_> + + 0 -1 478 5.5320002138614655e-03 + + -3.6611500382423401e-01 2.5968599319458008e-01 + <_> + + 0 -1 479 3.1879000365734100e-02 + + -7.5019001960754395e-02 4.8484799265861511e-01 + <_> + + 0 -1 480 -4.1482001543045044e-02 + + 7.8220397233963013e-01 -2.1992200613021851e-01 + <_> + + 0 -1 481 -9.6130996942520142e-02 + + -8.9456301927566528e-01 1.4680700004100800e-01 + <_> + + 0 -1 482 -1.1568999849259853e-02 + + 8.2714098691940308e-01 -2.0275600254535675e-01 + <_> + + 0 -1 483 1.8312999978661537e-02 + + 1.6367999836802483e-02 2.7306801080703735e-01 + <_> + + 0 -1 484 -3.4166000783443451e-02 + + 1.1307320594787598e+00 -1.8810899555683136e-01 + <_> + + 0 -1 485 -2.4476999416947365e-02 + + -5.7791298627853394e-01 1.5812499821186066e-01 + <_> + + 0 -1 486 4.8957001417875290e-02 + + -2.2564999759197235e-02 -1.6373280286788940e+00 + <_> + + 0 -1 487 -2.0702999085187912e-02 + + -5.4512101411819458e-01 2.4086999893188477e-01 + <_> + + 0 -1 488 -2.3002000525593758e-02 + + -1.2236540317535400e+00 -7.3440000414848328e-03 + <_> + + 0 -1 489 6.4585000276565552e-02 + + 1.4695599675178528e-01 -4.4967499375343323e-01 + <_> + + 0 -1 490 1.2666000053286552e-02 + + -2.7873900532722473e-01 4.3876600265502930e-01 + <_> + + 0 -1 491 -1.2002999894320965e-02 + + -2.4289099872112274e-01 2.5350099802017212e-01 + <_> + + 0 -1 492 -2.6443999260663986e-02 + + -8.5864800214767456e-01 2.6025999337434769e-02 + <_> + + 0 -1 493 -2.5547999888658524e-02 + + 6.9287902116775513e-01 -2.1160000469535589e-03 + <_> + + 0 -1 494 3.9115000516176224e-02 + + -1.6589100658893585e-01 1.5209139585494995e+00 + <_> + + 0 -1 495 -6.0330000706017017e-03 + + 4.3856900930404663e-01 -2.1613700687885284e-01 + <_> + + 0 -1 496 -3.3936999738216400e-02 + + -9.7998398542404175e-01 2.2133000195026398e-02 + <_> + 99 + -3.8700489997863770e+00 + + <_> + + 0 -1 497 4.0672998875379562e-02 + + -9.0474700927734375e-01 6.4410597085952759e-01 + <_> + + 0 -1 498 2.5609999895095825e-02 + + -7.9216998815536499e-01 5.7489997148513794e-01 + <_> + + 0 -1 499 1.9959500432014465e-01 + + -3.0099600553512573e-01 1.3143850564956665e+00 + <_> + + 0 -1 500 1.2404999695718288e-02 + + -8.9882999658584595e-01 2.9205799102783203e-01 + <_> + + 0 -1 501 3.9207998663187027e-02 + + -4.1955199837684631e-01 5.3463298082351685e-01 + <_> + + 0 -1 502 -3.0843999236822128e-02 + + 4.5793399214744568e-01 -4.4629099965095520e-01 + <_> + + 0 -1 503 -3.5523001104593277e-02 + + 9.1310501098632812e-01 -2.7373200654983521e-01 + <_> + + 0 -1 504 -6.1650000512599945e-02 + + -1.4697799682617188e+00 2.0364099740982056e-01 + <_> + + 0 -1 505 -1.1739999987185001e-02 + + -1.0482879877090454e+00 6.7801997065544128e-02 + <_> + + 0 -1 506 6.6933996975421906e-02 + + 2.9274499416351318e-01 -5.2282899618148804e-01 + <_> + + 0 -1 507 -2.0631000399589539e-02 + + -1.2855139970779419e+00 4.4550999999046326e-02 + <_> + + 0 -1 508 -2.2357000038027763e-02 + + -8.5753798484802246e-01 1.8434000015258789e-01 + <_> + + 0 -1 509 1.1500000255182385e-03 + + 1.6405500471591949e-01 -6.9125002622604370e-01 + <_> + + 0 -1 510 3.5872999578714371e-02 + + 1.5756499767303467e-01 -8.4262597560882568e-01 + <_> + + 0 -1 511 3.0659999698400497e-02 + + 2.1637000143527985e-02 -1.3634690046310425e+00 + <_> + + 0 -1 512 5.5559999309480190e-03 + + -1.6737000644207001e-01 2.5888401269912720e-01 + <_> + + 0 -1 513 -6.1160000041127205e-03 + + -9.7271800041198730e-01 6.6100001335144043e-02 + <_> + + 0 -1 514 -3.0316999182105064e-02 + + 9.8474198579788208e-01 -1.6448000445961952e-02 + <_> + + 0 -1 515 -9.7200004383921623e-03 + + 4.7604700922966003e-01 -3.2516700029373169e-01 + <_> + + 0 -1 516 -5.7126998901367188e-02 + + -9.5920699834823608e-01 1.9938200712203979e-01 + <_> + + 0 -1 517 4.0059997700154781e-03 + + -5.2612501382827759e-01 2.2428700327873230e-01 + <_> + + 0 -1 518 3.3734001219272614e-02 + + 1.7070099711418152e-01 -1.0737580060958862e+00 + <_> + + 0 -1 519 -3.4641999751329422e-02 + + -1.1343129873275757e+00 3.6540001630783081e-02 + <_> + + 0 -1 520 4.6923000365495682e-02 + + 2.5832301378250122e-01 -7.1535801887512207e-01 + <_> + + 0 -1 521 -8.7660001590847969e-03 + + 1.9640900194644928e-01 -5.3355097770690918e-01 + <_> + + 0 -1 522 6.5627999603748322e-02 + + -5.1194999366998672e-02 9.7610700130462646e-01 + <_> + + 0 -1 523 -4.4165000319480896e-02 + + 1.0631920099258423e+00 -2.3462599515914917e-01 + <_> + + 0 -1 524 1.7304999753832817e-02 + + -1.8582899868488312e-01 4.5889899134635925e-01 + <_> + + 0 -1 525 3.3135998994112015e-02 + + -2.9381999745965004e-02 -2.6651329994201660e+00 + <_> + + 0 -1 526 -2.1029999479651451e-02 + + 9.9979901313781738e-01 2.4937000125646591e-02 + <_> + + 0 -1 527 2.9783999547362328e-02 + + -2.9605999588966370e-02 -2.1695868968963623e+00 + <_> + + 0 -1 528 5.5291999131441116e-02 + + -7.5599999399855733e-04 7.4651998281478882e-01 + <_> + + 0 -1 529 -3.3597998321056366e-02 + + -1.5274159908294678e+00 1.1060000397264957e-02 + <_> + + 0 -1 530 1.9602999091148376e-02 + + 3.3574998378753662e-02 9.9526202678680420e-01 + <_> + + 0 -1 531 -2.0787000656127930e-02 + + 7.6612901687622070e-01 -2.4670800566673279e-01 + <_> + + 0 -1 532 3.2536000013351440e-02 + + 1.6263400018215179e-01 -6.1134302616119385e-01 + <_> + + 0 -1 533 -1.0788000188767910e-02 + + -9.7839701175689697e-01 2.8969999402761459e-02 + <_> + + 0 -1 534 -9.9560003727674484e-03 + + 4.6145799756050110e-01 -1.3510499894618988e-01 + <_> + + 0 -1 535 -3.7489999085664749e-03 + + 2.5458198785781860e-01 -5.1955598592758179e-01 + <_> + + 0 -1 536 -4.1779998689889908e-02 + + -8.0565100908279419e-01 1.5208500623703003e-01 + <_> + + 0 -1 537 -3.4221000969409943e-02 + + -1.3137799501419067e+00 -3.5800000187009573e-03 + <_> + + 0 -1 538 1.0130000300705433e-02 + + 2.0175799727439880e-01 -6.1339598894119263e-01 + <_> + + 0 -1 539 -8.9849002659320831e-02 + + 9.7632801532745361e-01 -2.0884799957275391e-01 + <_> + + 0 -1 540 2.6097999885678291e-02 + + -1.8807999789714813e-01 4.7705799341201782e-01 + <_> + + 0 -1 541 -3.7539999466389418e-03 + + -6.7980402708053589e-01 1.1288800090551376e-01 + <_> + + 0 -1 542 3.1973000615835190e-02 + + 1.8951700627803802e-01 -1.4967479705810547e+00 + <_> + + 0 -1 543 1.9332999363541603e-02 + + -2.3609900474548340e-01 8.1320500373840332e-01 + <_> + + 0 -1 544 1.9490000559017062e-03 + + 2.4830399453639984e-01 -6.9211997091770172e-02 + <_> + + 0 -1 545 -4.4146999716758728e-02 + + -1.0418920516967773e+00 4.8053000122308731e-02 + <_> + + 0 -1 546 -4.4681999832391739e-02 + + 5.1346302032470703e-01 -7.3799998499453068e-03 + <_> + + 0 -1 547 -1.0757499933242798e-01 + + 1.6202019453048706e+00 -1.8667599558830261e-01 + <_> + + 0 -1 548 -1.2846800684928894e-01 + + 2.9869480133056641e+00 9.5427997410297394e-02 + <_> + + 0 -1 549 -4.4757999479770660e-02 + + 6.0405302047729492e-01 -2.7058699727058411e-01 + <_> + + 0 -1 550 -4.3990999460220337e-02 + + -6.1790502071380615e-01 1.5997199714183807e-01 + <_> + + 0 -1 551 -1.2268999963998795e-01 + + 6.6327202320098877e-01 -2.3636999726295471e-01 + <_> + + 0 -1 552 -1.9982999190688133e-02 + + -1.1228660345077515e+00 1.9616700708866119e-01 + <_> + + 0 -1 553 -1.5527999959886074e-02 + + -1.0770269632339478e+00 2.0693000406026840e-02 + <_> + + 0 -1 554 -4.8971001058816910e-02 + + 8.1168299913406372e-01 -1.7252000048756599e-02 + <_> + + 0 -1 555 5.5975999683141708e-02 + + -2.2529000416398048e-02 -1.7356760501861572e+00 + <_> + + 0 -1 556 -9.8580000922083855e-03 + + 6.7881399393081665e-01 -5.8180000633001328e-02 + <_> + + 0 -1 557 1.3481000438332558e-02 + + 5.7847999036312103e-02 -7.7255302667617798e-01 + <_> + + 0 -1 558 6.5609999001026154e-03 + + -1.3146899640560150e-01 6.7055797576904297e-01 + <_> + + 0 -1 559 7.1149999275803566e-03 + + -3.7880599498748779e-01 3.0978998541831970e-01 + <_> + + 0 -1 560 4.8159998841583729e-03 + + -5.8470398187637329e-01 2.5602099299430847e-01 + <_> + + 0 -1 561 9.5319999381899834e-03 + + -3.0217000842094421e-01 4.1253298521041870e-01 + <_> + + 0 -1 562 -2.7474999427795410e-02 + + 5.9154701232910156e-01 1.7963999882340431e-02 + <_> + + 0 -1 563 -3.9519999176263809e-02 + + 9.6913498640060425e-01 -2.1020300686359406e-01 + <_> + + 0 -1 564 -3.0658999457955360e-02 + + 9.1155898571014404e-01 4.0550000965595245e-02 + <_> + + 0 -1 565 -1.4680000022053719e-03 + + -6.0489797592163086e-01 1.6960899531841278e-01 + <_> + + 0 -1 566 1.9077600538730621e-01 + + 4.3515000492334366e-02 8.1892901659011841e-01 + <_> + + 0 -1 567 5.1790000870823860e-03 + + -9.3617302179336548e-01 2.4937000125646591e-02 + <_> + + 0 -1 568 2.4126000702381134e-02 + + 1.8175500631332397e-01 -3.4185901284217834e-01 + <_> + + 0 -1 569 -2.6383999735116959e-02 + + -1.2912579774856567e+00 -3.4280000254511833e-03 + <_> + + 0 -1 570 5.4139997810125351e-03 + + -4.6291999518871307e-02 2.5269600749015808e-01 + <_> + + 0 -1 571 5.4216001182794571e-02 + + -1.2848000042140484e-02 -1.4304540157318115e+00 + <_> + + 0 -1 572 2.3799999326001853e-04 + + -2.6676699519157410e-01 3.3588299155235291e-01 + <_> + + 0 -1 573 1.5216999687254429e-02 + + -5.1367300748825073e-01 1.3005100190639496e-01 + <_> + + 0 -1 574 1.7007999122142792e-02 + + 4.1575899720191956e-01 -3.1241199374198914e-01 + <_> + + 0 -1 575 3.0496999621391296e-02 + + -2.4820999801158905e-01 7.0828497409820557e-01 + <_> + + 0 -1 576 6.5430002287030220e-03 + + -2.2637000679969788e-01 1.9184599816799164e-01 + <_> + + 0 -1 577 1.4163999259471893e-01 + + 6.5227001905441284e-02 -8.8809502124786377e-01 + <_> + + 0 -1 578 1.9338000565767288e-02 + + 1.8891200423240662e-01 -2.7397701144218445e-01 + <_> + + 0 -1 579 -1.7324000597000122e-02 + + -9.4866698980331421e-01 2.4196999147534370e-02 + <_> + + 0 -1 580 -6.2069999985396862e-03 + + 3.6938399076461792e-01 -1.7494900524616241e-01 + <_> + + 0 -1 581 -1.6109000891447067e-02 + + 9.6159499883651733e-01 -2.0005300641059875e-01 + <_> + + 0 -1 582 -1.0122500360012054e-01 + + -3.0699110031127930e+00 1.1363799870014191e-01 + <_> + + 0 -1 583 -7.5509999878704548e-03 + + 2.2921000421047211e-01 -4.5645099878311157e-01 + <_> + + 0 -1 584 4.4247999787330627e-02 + + -3.1599999056197703e-04 3.9225301146507263e-01 + <_> + + 0 -1 585 -1.1636000126600266e-01 + + 9.5233702659606934e-01 -2.0201599597930908e-01 + <_> + + 0 -1 586 4.7360002063214779e-03 + + -9.9177002906799316e-02 2.0370499789714813e-01 + <_> + + 0 -1 587 2.2459000349044800e-02 + + 8.7280003353953362e-03 -1.0217070579528809e+00 + <_> + + 0 -1 588 -1.2109000235795975e-02 + + 6.4812600612640381e-01 -9.0149000287055969e-02 + <_> + + 0 -1 589 5.6120000779628754e-02 + + -3.6759998649358749e-02 -1.9275590181350708e+00 + <_> + + 0 -1 590 -8.7379999458789825e-03 + + 6.9261300563812256e-01 -6.8374998867511749e-02 + <_> + + 0 -1 591 6.6399998031556606e-03 + + -4.0569800138473511e-01 1.8625700473785400e-01 + <_> + + 0 -1 592 -1.8131999298930168e-02 + + -6.4518201351165771e-01 2.1976399421691895e-01 + <_> + + 0 -1 593 -2.2718999534845352e-02 + + 9.7776198387145996e-01 -1.8654300272464752e-01 + <_> + + 0 -1 594 1.2705000117421150e-02 + + -1.0546600073575974e-01 3.7404099106788635e-01 + <_> + + 0 -1 595 -1.3682999648153782e-02 + + 6.1064100265502930e-01 -2.6881098747253418e-01 + <_> + 115 + -3.7160909175872803e+00 + + <_> + + 0 -1 596 3.1357999891042709e-02 + + -1.0183910131454468e+00 5.7528597116470337e-01 + <_> + + 0 -1 597 9.3050003051757812e-02 + + -4.1297501325607300e-01 1.0091199874877930e+00 + <_> + + 0 -1 598 2.5949999690055847e-02 + + -5.8587902784347534e-01 5.6606197357177734e-01 + <_> + + 0 -1 599 1.6472000628709793e-02 + + -9.2857497930526733e-01 3.0924499034881592e-01 + <_> + + 0 -1 600 -1.8779999809339643e-03 + + 1.1951000243425369e-01 -1.1180130243301392e+00 + <_> + + 0 -1 601 -9.0129999443888664e-03 + + -5.7849502563476562e-01 3.3154401183128357e-01 + <_> + + 0 -1 602 2.2547999396920204e-02 + + -3.8325101137161255e-01 5.2462202310562134e-01 + <_> + + 0 -1 603 -3.7780001759529114e-02 + + 1.1790670156478882e+00 -3.4166999161243439e-02 + <_> + + 0 -1 604 -5.3799999877810478e-03 + + -8.6265897750854492e-01 1.1867900192737579e-01 + <_> + + 0 -1 605 -2.3893000558018684e-02 + + -7.4950599670410156e-01 2.1011400222778320e-01 + <_> + + 0 -1 606 -2.6521999388933182e-02 + + 9.2128598690032959e-01 -2.8252801299095154e-01 + <_> + + 0 -1 607 1.2280000373721123e-02 + + 2.6662799715995789e-01 -7.0013600587844849e-01 + <_> + + 0 -1 608 9.6594996750354767e-02 + + -2.8453999757766724e-01 7.3168998956680298e-01 + <_> + + 0 -1 609 -2.7414999902248383e-02 + + -6.1492699384689331e-01 1.5576200187206268e-01 + <_> + + 0 -1 610 -1.5767000615596771e-02 + + 5.7551199197769165e-01 -3.4362199902534485e-01 + <_> + + 0 -1 611 -2.1100000012665987e-03 + + 3.2599699497222900e-01 -1.3008299469947815e-01 + <_> + + 0 -1 612 1.2006999924778938e-02 + + 8.9322999119758606e-02 -9.6025598049163818e-01 + <_> + + 0 -1 613 -1.5421999618411064e-02 + + 3.4449499845504761e-01 -4.6711999177932739e-01 + <_> + + 0 -1 614 -4.1579999960958958e-03 + + 2.3696300387382507e-01 -5.2563297748565674e-01 + <_> + + 0 -1 615 -2.1185999736189842e-02 + + -7.4267697334289551e-01 2.1702000498771667e-01 + <_> + + 0 -1 616 -1.7077000811696053e-02 + + -9.0471798181533813e-01 6.6012002527713776e-02 + <_> + + 0 -1 617 -4.0849998593330383e-02 + + -3.4446600079536438e-01 2.1503700315952301e-01 + <_> + + 0 -1 618 -8.1930002197623253e-03 + + -9.3388599157333374e-01 5.0471000373363495e-02 + <_> + + 0 -1 619 -1.9238000735640526e-02 + + -5.3203701972961426e-01 1.7240600287914276e-01 + <_> + + 0 -1 620 -4.4192001223564148e-02 + + 9.2075002193450928e-01 -2.2148500382900238e-01 + <_> + + 0 -1 621 -6.2392000108957291e-02 + + -7.1053802967071533e-01 1.8323899805545807e-01 + <_> + + 0 -1 622 -1.0079999919980764e-03 + + -8.7063097953796387e-01 5.5330000817775726e-02 + <_> + + 0 -1 623 2.3870000615715981e-02 + + -2.2854200005531311e-01 5.2415597438812256e-01 + <_> + + 0 -1 624 2.1391000598669052e-02 + + -3.0325898528099060e-01 5.5860602855682373e-01 + <_> + + 0 -1 625 2.0254999399185181e-02 + + 2.6901501417160034e-01 -7.0261800289154053e-01 + <_> + + 0 -1 626 -2.8772000223398209e-02 + + -1.1835030317306519e+00 4.6512000262737274e-02 + <_> + + 0 -1 627 3.4199999645352364e-03 + + -5.4652100801467896e-01 2.5962498784065247e-01 + <_> + + 0 -1 628 5.6983001530170441e-02 + + -2.6982900500297546e-01 5.8170700073242188e-01 + <_> + + 0 -1 629 -9.3892000615596771e-02 + + -9.1046398878097534e-01 1.9677700102329254e-01 + <_> + + 0 -1 630 1.7699999734759331e-02 + + -4.4003298878669739e-01 2.1349500119686127e-01 + <_> + + 0 -1 631 2.2844199836254120e-01 + + 2.3605000227689743e-02 7.7171599864959717e-01 + <_> + + 0 -1 632 -1.8287500739097595e-01 + + 7.9228597879409790e-01 -2.4644799530506134e-01 + <_> + + 0 -1 633 -6.9891996681690216e-02 + + 8.0267798900604248e-01 -3.6072000861167908e-02 + <_> + + 0 -1 634 1.5297000296413898e-02 + + -2.0072300732135773e-01 1.1030600070953369e+00 + <_> + + 0 -1 635 6.7500001750886440e-03 + + -4.5967999845743179e-02 7.2094500064849854e-01 + <_> + + 0 -1 636 -1.5983000397682190e-02 + + -9.0357202291488647e-01 4.4987998902797699e-02 + <_> + + 0 -1 637 1.3088000006973743e-02 + + 3.5297098755836487e-01 -3.7710601091384888e-01 + <_> + + 0 -1 638 1.3061000034213066e-02 + + -1.9583599269390106e-01 1.1198940277099609e+00 + <_> + + 0 -1 639 -3.9907000958919525e-02 + + -1.3998429775238037e+00 1.9145099818706512e-01 + <_> + + 0 -1 640 1.5026999637484550e-02 + + 2.3600000422447920e-03 -1.1611249446868896e+00 + <_> + + 0 -1 641 -2.0517999306321144e-02 + + -4.8908099532127380e-01 1.6743400692939758e-01 + <_> + + 0 -1 642 -2.2359000518918037e-02 + + -1.2202980518341064e+00 -1.1975999921560287e-02 + <_> + + 0 -1 643 -7.9150004312396049e-03 + + 3.7228098511695862e-01 -8.5063003003597260e-02 + <_> + + 0 -1 644 1.5258000232279301e-02 + + -2.9412600398063660e-01 5.9406399726867676e-01 + <_> + + 0 -1 645 -3.1665999442338943e-02 + + -1.4395569562911987e+00 1.3578799366950989e-01 + <_> + + 0 -1 646 -3.0773999169468880e-02 + + -2.2545371055603027e+00 -3.3971000462770462e-02 + <_> + + 0 -1 647 -1.5483000315725803e-02 + + 3.7700700759887695e-01 1.5847999602556229e-02 + <_> + + 0 -1 648 3.5167001187801361e-02 + + -2.9446101188659668e-01 5.3159099817276001e-01 + <_> + + 0 -1 649 -1.7906000837683678e-02 + + -9.9788200855255127e-01 1.6235999763011932e-01 + <_> + + 0 -1 650 -3.1799999997019768e-03 + + 4.7657001763582230e-02 -7.5249898433685303e-01 + <_> + + 0 -1 651 1.5720000490546227e-02 + + 1.4873799681663513e-01 -6.5375399589538574e-01 + <_> + + 0 -1 652 2.9864000156521797e-02 + + -1.4952000230550766e-02 -1.2275190353393555e+00 + <_> + + 0 -1 653 2.9899999499320984e-03 + + -1.4263699948787689e-01 4.3272799253463745e-01 + <_> + + 0 -1 654 8.4749996662139893e-02 + + -1.9280999898910522e-02 -1.1946409940719604e+00 + <_> + + 0 -1 655 -5.8724999427795410e-02 + + -1.7328219413757324e+00 1.4374700188636780e-01 + <_> + + 0 -1 656 4.4755998998880386e-02 + + -2.4140599370002747e-01 5.4019999504089355e-01 + <_> + + 0 -1 657 4.0369000285863876e-02 + + 5.7680001482367516e-03 5.6578099727630615e-01 + <_> + + 0 -1 658 3.7735998630523682e-02 + + 3.8180999457836151e-02 -7.9370397329330444e-01 + <_> + + 0 -1 659 6.0752999037504196e-02 + + 7.6453000307083130e-02 1.4813209772109985e+00 + <_> + + 0 -1 660 -1.9832000136375427e-02 + + -1.6971720457077026e+00 -2.7370000258088112e-02 + <_> + + 0 -1 661 -1.6592699289321899e-01 + + 6.2976002693176270e-01 3.1762998551130295e-02 + <_> + + 0 -1 662 6.9014996290206909e-02 + + -3.3463200926780701e-01 3.0076700448989868e-01 + <_> + + 0 -1 663 1.1358000338077545e-02 + + 2.2741499543190002e-01 -3.8224700093269348e-01 + <_> + + 0 -1 664 1.7000000225380063e-03 + + 1.9223800301551819e-01 -5.2735102176666260e-01 + <_> + + 0 -1 665 7.9769000411033630e-02 + + 9.1491997241973877e-02 2.1049048900604248e+00 + <_> + + 0 -1 666 -5.7144001126289368e-02 + + -1.7452130317687988e+00 -4.0910001844167709e-02 + <_> + + 0 -1 667 7.3830001056194305e-03 + + -2.4214799702167511e-01 3.5577800869941711e-01 + <_> + + 0 -1 668 -1.8040999770164490e-02 + + 1.1779999732971191e+00 -1.7676700651645660e-01 + <_> + + 0 -1 669 9.4503000378608704e-02 + + 1.3936099410057068e-01 -1.2993700504302979e+00 + <_> + + 0 -1 670 5.4210000671446323e-03 + + -5.4608601331710815e-01 1.3916400074958801e-01 + <_> + + 0 -1 671 7.0290002040565014e-03 + + -2.1597200632095337e-01 3.9258098602294922e-01 + <_> + + 0 -1 672 3.4515999257564545e-02 + + 6.3188999891281128e-02 -7.2108101844787598e-01 + <_> + + 0 -1 673 -5.1924999803304672e-02 + + 6.8667602539062500e-01 6.3272997736930847e-02 + <_> + + 0 -1 674 -6.9162003695964813e-02 + + 1.7411810159683228e+00 -1.6619299352169037e-01 + <_> + + 0 -1 675 -5.5229999125003815e-03 + + 3.0694699287414551e-01 -1.6662900149822235e-01 + <_> + + 0 -1 676 6.8599998950958252e-02 + + -2.1405400335788727e-01 7.3185002803802490e-01 + <_> + + 0 -1 677 -6.7038998007774353e-02 + + -7.9360598325729370e-01 2.0525799691677094e-01 + <_> + + 0 -1 678 -2.1005000919103622e-02 + + 3.7344399094581604e-01 -2.9618600010871887e-01 + <_> + + 0 -1 679 2.0278999581933022e-02 + + -1.5200000256299973e-02 4.0555301308631897e-01 + <_> + + 0 -1 680 -4.7107998281717300e-02 + + 1.2116849422454834e+00 -1.7464299499988556e-01 + <_> + + 0 -1 681 1.8768499791622162e-01 + + -2.2909000515937805e-02 6.9645798206329346e-01 + <_> + + 0 -1 682 -4.3228998780250549e-02 + + -1.0602480173110962e+00 -5.5599998449906707e-04 + <_> + + 0 -1 683 2.0004000514745712e-02 + + -3.2751001417636871e-02 5.3805100917816162e-01 + <_> + + 0 -1 684 8.0880001187324524e-03 + + 3.7548001855611801e-02 -7.4768900871276855e-01 + <_> + + 0 -1 685 2.7101000770926476e-02 + + -8.1790000200271606e-02 3.3387100696563721e-01 + <_> + + 0 -1 686 -9.1746002435684204e-02 + + -1.9213509559631348e+00 -3.8952998816967010e-02 + <_> + + 0 -1 687 -1.2454999610781670e-02 + + 4.8360601067543030e-01 1.8168000504374504e-02 + <_> + + 0 -1 688 1.4649000018835068e-02 + + -1.9906699657440186e-01 7.2815400362014771e-01 + <_> + + 0 -1 689 2.9101999476552010e-02 + + 1.9871099293231964e-01 -4.9216800928115845e-01 + <_> + + 0 -1 690 8.7799998000264168e-03 + + -1.9499599933624268e-01 7.7317398786544800e-01 + <_> + + 0 -1 691 -5.4740000516176224e-02 + + 1.8087190389633179e+00 6.8323001265525818e-02 + <_> + + 0 -1 692 -1.4798000454902649e-02 + + 7.8064900636672974e-01 -1.8709599971771240e-01 + <_> + + 0 -1 693 2.5012999773025513e-02 + + 1.5285299718379974e-01 -1.6021020412445068e+00 + <_> + + 0 -1 694 4.6548001468181610e-02 + + -1.6738200187683105e-01 1.1902060508728027e+00 + <_> + + 0 -1 695 1.7624000087380409e-02 + + -1.0285499691963196e-01 3.9175900816917419e-01 + <_> + + 0 -1 696 1.6319599747657776e-01 + + -3.5624001175165176e-02 -1.6098170280456543e+00 + <_> + + 0 -1 697 1.3137999922037125e-02 + + -5.6359000504016876e-02 5.4158902168273926e-01 + <_> + + 0 -1 698 -1.5665000304579735e-02 + + 2.8063100576400757e-01 -3.1708601117134094e-01 + <_> + + 0 -1 699 8.0554001033306122e-02 + + 1.2640400230884552e-01 -1.0297529697418213e+00 + <_> + + 0 -1 700 3.5363998264074326e-02 + + 2.0752999931573868e-02 -7.9105597734451294e-01 + <_> + + 0 -1 701 3.2986998558044434e-02 + + 1.9057099521160126e-01 -8.3839899301528931e-01 + <_> + + 0 -1 702 1.2195000424981117e-02 + + 7.3729000985622406e-02 -6.2780702114105225e-01 + <_> + + 0 -1 703 4.3065998703241348e-02 + + 4.7384999692440033e-02 1.5712939500808716e+00 + <_> + + 0 -1 704 3.0326999723911285e-02 + + -2.7314600348472595e-01 3.8572001457214355e-01 + <_> + + 0 -1 705 3.5493001341819763e-02 + + 5.4593998938798904e-02 5.2583402395248413e-01 + <_> + + 0 -1 706 -1.4596999622881413e-02 + + 3.8152599334716797e-01 -2.8332400321960449e-01 + <_> + + 0 -1 707 1.2606999836862087e-02 + + 1.5455099940299988e-01 -3.0501499772071838e-01 + <_> + + 0 -1 708 1.0172000154852867e-02 + + 2.3637000471353531e-02 -8.7217897176742554e-01 + <_> + + 0 -1 709 2.8843000531196594e-02 + + 1.6090999543666840e-01 -2.0277599990367889e-01 + <_> + + 0 -1 710 5.5100000463426113e-04 + + -6.1545401811599731e-01 8.0935999751091003e-02 + <_> + 127 + -3.5645289421081543e+00 + + <_> + + 0 -1 711 4.8344001173973083e-02 + + -8.4904599189758301e-01 5.6974399089813232e-01 + <_> + + 0 -1 712 3.2460000365972519e-02 + + -8.1417298316955566e-01 4.4781699776649475e-01 + <_> + + 0 -1 713 3.3339999616146088e-02 + + -3.6423799395561218e-01 6.7937397956848145e-01 + <_> + + 0 -1 714 6.4019998535513878e-03 + + -1.1885459423065186e+00 1.9238699972629547e-01 + <_> + + 0 -1 715 -5.6889997795224190e-03 + + 3.3085298538208008e-01 -7.1334099769592285e-01 + <_> + + 0 -1 716 1.2698000296950340e-02 + + -5.0990802049636841e-01 1.1376299709081650e-01 + <_> + + 0 -1 717 6.0549997724592686e-03 + + -1.0470550060272217e+00 2.0222599804401398e-01 + <_> + + 0 -1 718 2.6420000940561295e-03 + + -5.0559401512145996e-01 3.6441200971603394e-01 + <_> + + 0 -1 719 -1.6925999894738197e-02 + + -9.9541902542114258e-01 1.2602199614048004e-01 + <_> + + 0 -1 720 2.8235999867320061e-02 + + -9.4137996435165405e-02 5.7780402898788452e-01 + <_> + + 0 -1 721 1.0428999550640583e-02 + + 2.3272900283336639e-01 -5.2569699287414551e-01 + <_> + + 0 -1 722 9.8860003054141998e-03 + + -1.0316299647092819e-01 4.7657600045204163e-01 + <_> + + 0 -1 723 2.6015000417828560e-02 + + -1.0920000495389104e-03 -1.5581729412078857e+00 + <_> + + 0 -1 724 -2.5537999346852303e-02 + + -6.5451401472091675e-01 1.8843199312686920e-01 + <_> + + 0 -1 725 -3.5310001112520695e-03 + + 2.8140598535537720e-01 -4.4575300812721252e-01 + <_> + + 0 -1 726 9.2449998483061790e-03 + + 1.5612000226974487e-01 -2.1370999515056610e-01 + <_> + + 0 -1 727 2.1030999720096588e-02 + + -2.9170298576354980e-01 5.2234101295471191e-01 + <_> + + 0 -1 728 -5.1063001155853271e-02 + + 1.3661290407180786e+00 3.0465999618172646e-02 + <_> + + 0 -1 729 -6.2330000102519989e-02 + + 1.2207020521163940e+00 -2.2434400022029877e-01 + <_> + + 0 -1 730 -3.2963000237941742e-02 + + -8.2016801834106445e-01 1.4531899988651276e-01 + <_> + + 0 -1 731 -3.7418000400066376e-02 + + -1.2218099832534790e+00 1.9448999315500259e-02 + <_> + + 0 -1 732 1.2402799725532532e-01 + + 1.2082300335168839e-01 -9.8729300498962402e-01 + <_> + + 0 -1 733 -8.9229997247457504e-03 + + -1.1688489913940430e+00 2.1105000749230385e-02 + <_> + + 0 -1 734 -5.9879999607801437e-02 + + -1.0689330101013184e+00 1.9860200583934784e-01 + <_> + + 0 -1 735 6.2620001845061779e-03 + + -3.6229598522186279e-01 3.8000801205635071e-01 + <_> + + 0 -1 736 -1.7673000693321228e-02 + + 4.9094098806381226e-01 -1.4606699347496033e-01 + <_> + + 0 -1 737 1.7579000443220139e-02 + + 5.8728098869323730e-01 -2.7774399518966675e-01 + <_> + + 0 -1 738 5.1560001447796822e-03 + + -7.5194999575614929e-02 6.0193097591400146e-01 + <_> + + 0 -1 739 -1.0599999688565731e-02 + + 2.7637401223182678e-01 -3.7794300913810730e-01 + <_> + + 0 -1 740 2.0884099602699280e-01 + + -5.3599998354911804e-03 1.0317809581756592e+00 + <_> + + 0 -1 741 -2.6412999257445335e-02 + + 8.2336401939392090e-01 -2.2480599582195282e-01 + <_> + + 0 -1 742 5.8892000466585159e-02 + + 1.3098299503326416e-01 -1.1853699684143066e+00 + <_> + + 0 -1 743 -1.1579000391066074e-02 + + -9.0667802095413208e-01 4.4126998633146286e-02 + <_> + + 0 -1 744 4.5988000929355621e-02 + + 1.0143999941647053e-02 1.0740900039672852e+00 + <_> + + 0 -1 745 -2.2838000208139420e-02 + + 1.7791990041732788e+00 -1.7315499484539032e-01 + <_> + + 0 -1 746 -8.1709995865821838e-03 + + 5.7386302947998047e-01 -7.4106000363826752e-02 + <_> + + 0 -1 747 3.5359999164938927e-03 + + -3.2072898745536804e-01 4.0182501077651978e-01 + <_> + + 0 -1 748 4.9444999545812607e-02 + + 1.9288000464439392e-01 -1.2166700363159180e+00 + <_> + + 0 -1 749 3.5139999818056822e-03 + + 6.9568000733852386e-02 -7.1323698759078979e-01 + <_> + + 0 -1 750 -3.0996000394225121e-02 + + -3.8862198591232300e-01 1.8098799884319305e-01 + <_> + + 0 -1 751 8.6452998220920563e-02 + + -2.5792999193072319e-02 -1.5453219413757324e+00 + <_> + + 0 -1 752 -1.3652600347995758e-01 + + -1.9199420213699341e+00 1.6613300144672394e-01 + <_> + + 0 -1 753 -5.7689999230206013e-03 + + -1.2822589874267578e+00 -1.5907999128103256e-02 + <_> + + 0 -1 754 -1.7899999395012856e-02 + + -4.0409898757934570e-01 2.3591600358486176e-01 + <_> + + 0 -1 755 -1.9969999790191650e-02 + + -7.2891902923583984e-01 5.6235000491142273e-02 + <_> + + 0 -1 756 -5.7493001222610474e-02 + + 5.7830798625946045e-01 -1.5796000137925148e-02 + <_> + + 0 -1 757 -8.3056002855300903e-02 + + 9.1511601209640503e-01 -2.1121400594711304e-01 + <_> + + 0 -1 758 -5.3771000355482101e-02 + + -5.1931297779083252e-01 1.8576000630855560e-01 + <_> + + 0 -1 759 -8.3670001477003098e-03 + + 2.4109700322151184e-01 -3.9648601412773132e-01 + <_> + + 0 -1 760 5.5406998842954636e-02 + + 1.6771200299263000e-01 -2.5664970874786377e+00 + <_> + + 0 -1 761 -6.7180998623371124e-02 + + -1.3658570051193237e+00 -1.4232000336050987e-02 + <_> + + 0 -1 762 -2.3900000378489494e-02 + + -1.7084569931030273e+00 1.6507799923419952e-01 + <_> + + 0 -1 763 5.5949999950826168e-03 + + -3.1373998522758484e-01 3.2837900519371033e-01 + <_> + + 0 -1 764 2.1294999867677689e-02 + + 1.4953400194644928e-01 -4.8579800128936768e-01 + <_> + + 0 -1 765 -2.4613000452518463e-02 + + 7.4346399307250977e-01 -2.2305199503898621e-01 + <_> + + 0 -1 766 -1.9626000896096230e-02 + + -4.0918299555778503e-01 1.8893200159072876e-01 + <_> + + 0 -1 767 -5.3266000002622604e-02 + + 8.1381601095199585e-01 -2.0853699743747711e-01 + <_> + + 0 -1 768 7.1290000341832638e-03 + + 3.2996100187301636e-01 -5.9937399625778198e-01 + <_> + + 0 -1 769 -2.2486999630928040e-02 + + -1.2551610469818115e+00 -2.0413000136613846e-02 + <_> + + 0 -1 770 -8.2310996949672699e-02 + + 1.3821430206298828e+00 5.9308998286724091e-02 + <_> + + 0 -1 771 1.3097000122070312e-01 + + -3.5843998193740845e-02 -1.5396369695663452e+00 + <_> + + 0 -1 772 1.4293000102043152e-02 + + -1.8475200235843658e-01 3.7455001473426819e-01 + <_> + + 0 -1 773 6.3479999080300331e-03 + + -4.4901099801063538e-01 1.3876999914646149e-01 + <_> + + 0 -1 774 -4.6055000275373459e-02 + + 6.7832601070404053e-01 -1.7071999609470367e-02 + <_> + + 0 -1 775 5.7693999260663986e-02 + + -1.1955999769270420e-02 -1.2261159420013428e+00 + <_> + + 0 -1 776 -6.0609998181462288e-03 + + 3.3958598971366882e-01 6.2800000887364149e-04 + <_> + + 0 -1 777 -5.2163001149892807e-02 + + -1.0621069669723511e+00 -1.3779999688267708e-02 + <_> + + 0 -1 778 4.6572998166084290e-02 + + 1.4538800716400146e-01 -1.2384550571441650e+00 + <_> + + 0 -1 779 7.5309998355805874e-03 + + -2.4467700719833374e-01 5.1377099752426147e-01 + <_> + + 0 -1 780 2.1615000441670418e-02 + + 1.3072599470615387e-01 -7.0996797084808350e-01 + <_> + + 0 -1 781 -1.7864000052213669e-02 + + -1.0474660396575928e+00 4.9599999329075217e-04 + <_> + + 0 -1 782 -3.7195000797510147e-02 + + -1.5126730203628540e+00 1.4801399409770966e-01 + <_> + + 0 -1 783 -3.1100001069717109e-04 + + 1.3971500098705292e-01 -4.6867498755455017e-01 + <_> + + 0 -1 784 2.5042999535799026e-02 + + 2.8632000088691711e-01 -4.1794699430465698e-01 + <_> + + 0 -1 785 9.3449996784329414e-03 + + -2.7336201071739197e-01 4.3444699048995972e-01 + <_> + + 0 -1 786 3.2363999634981155e-02 + + 1.8438899517059326e-01 -9.5019298791885376e-01 + <_> + + 0 -1 787 -6.2299999408423901e-03 + + 3.2581999897956848e-01 -3.0815601348876953e-01 + <_> + + 0 -1 788 5.1488999277353287e-02 + + 1.1416000127792358e-01 -1.9795479774475098e+00 + <_> + + 0 -1 789 -2.6449000462889671e-02 + + -1.1067299842834473e+00 -8.5519999265670776e-03 + <_> + + 0 -1 790 -1.5420000068843365e-02 + + 8.0138701200485229e-01 -3.2035000622272491e-02 + <_> + + 0 -1 791 1.9456999376416206e-02 + + -2.6449498534202576e-01 3.8753899931907654e-01 + <_> + + 0 -1 792 3.3620998263359070e-02 + + 1.6052000224590302e-02 5.8840900659561157e-01 + <_> + + 0 -1 793 2.8906000778079033e-02 + + 1.5216000378131866e-02 -9.4723600149154663e-01 + <_> + + 0 -1 794 2.0300000323913991e-04 + + -3.0766001343727112e-01 2.1235899627208710e-01 + <_> + + 0 -1 795 -4.9141999334096909e-02 + + -1.6058609485626221e+00 -3.1094999983906746e-02 + <_> + + 0 -1 796 7.6425999402999878e-02 + + 7.4758999049663544e-02 1.1639410257339478e+00 + <_> + + 0 -1 797 2.3897999897599220e-02 + + -6.4320000819861889e-03 -1.1150749921798706e+00 + <_> + + 0 -1 798 3.8970001041889191e-03 + + -2.4105699360370636e-01 2.0858900249004364e-01 + <_> + + 0 -1 799 -8.9445002377033234e-02 + + 1.9157789945602417e+00 -1.5721100568771362e-01 + <_> + + 0 -1 800 -1.5008999966084957e-02 + + -2.5174099206924438e-01 1.8179899454116821e-01 + <_> + + 0 -1 801 -1.1145999655127525e-02 + + -6.9349497556686401e-01 4.4927999377250671e-02 + <_> + + 0 -1 802 9.4578996300697327e-02 + + 1.8102100491523743e-01 -7.4978601932525635e-01 + <_> + + 0 -1 803 5.5038899183273315e-01 + + -3.0974000692367554e-02 -1.6746139526367188e+00 + <_> + + 0 -1 804 4.1381001472473145e-02 + + 6.3910000026226044e-02 7.6561200618743896e-01 + <_> + + 0 -1 805 2.4771999567747116e-02 + + 1.1380000039935112e-02 -8.8559401035308838e-01 + <_> + + 0 -1 806 5.0999000668525696e-02 + + 1.4890299737453461e-01 -2.4634211063385010e+00 + <_> + + 0 -1 807 -1.6893999651074409e-02 + + 3.8870999217033386e-01 -2.9880300164222717e-01 + <_> + + 0 -1 808 -1.2162300199270248e-01 + + -1.5542800426483154e+00 1.6300800442695618e-01 + <_> + + 0 -1 809 -3.6049999762326479e-03 + + 2.1842800080776215e-01 -3.7312099337577820e-01 + <_> + + 0 -1 810 1.1575400084257126e-01 + + -4.7061000019311905e-02 5.9403699636459351e-01 + <_> + + 0 -1 811 3.6903999745845795e-02 + + -2.5508600473403931e-01 5.5397301912307739e-01 + <_> + + 0 -1 812 1.1483999900519848e-02 + + -1.8129499256610870e-01 4.0682798624038696e-01 + <_> + + 0 -1 813 -2.0233999937772751e-02 + + 5.4311197996139526e-01 -2.3822399973869324e-01 + <_> + + 0 -1 814 -2.8765000402927399e-02 + + -6.9172298908233643e-01 1.5943300724029541e-01 + <_> + + 0 -1 815 -5.8320001699030399e-03 + + 2.9447799921035767e-01 -3.4005999565124512e-01 + <_> + + 0 -1 816 -5.5468998849391937e-02 + + 9.2200797796249390e-01 9.4093002378940582e-02 + <_> + + 0 -1 817 -1.4801000244915485e-02 + + -7.9539698362350464e-01 3.1521998345851898e-02 + <_> + + 0 -1 818 -7.0940000005066395e-03 + + 3.3096000552177429e-01 -5.0886999815702438e-02 + <_> + + 0 -1 819 -4.5124001801013947e-02 + + -1.3719749450683594e+00 -2.1408999338746071e-02 + <_> + + 0 -1 820 6.4377002418041229e-02 + + 6.3901998102664948e-02 9.1478300094604492e-01 + <_> + + 0 -1 821 -1.4727000147104263e-02 + + 3.6050599813461304e-01 -2.8614500164985657e-01 + <_> + + 0 -1 822 4.5007001608610153e-02 + + -1.5619699656963348e-01 5.3160297870635986e-01 + <_> + + 0 -1 823 -1.1330000124871731e-03 + + 1.3422900438308716e-01 -4.4358900189399719e-01 + <_> + + 0 -1 824 4.9451000988483429e-02 + + 1.0571800172328949e-01 -2.5589139461517334e+00 + <_> + + 0 -1 825 2.9102999716997147e-02 + + -1.0088000446557999e-02 -1.1073939800262451e+00 + <_> + + 0 -1 826 3.4786000847816467e-02 + + -2.7719999197870493e-03 5.6700998544692993e-01 + <_> + + 0 -1 827 -6.1309998854994774e-03 + + -4.6889400482177734e-01 1.2636399269104004e-01 + <_> + + 0 -1 828 1.5525000169873238e-02 + + -8.4279999136924744e-03 8.7469202280044556e-01 + <_> + + 0 -1 829 2.9249999206513166e-03 + + -3.4434300661087036e-01 2.0851600170135498e-01 + <_> + + 0 -1 830 -5.3571000695228577e-02 + + 1.4982949495315552e+00 5.7328000664710999e-02 + <_> + + 0 -1 831 -1.9217999652028084e-02 + + -9.9234098196029663e-01 -9.3919998034834862e-03 + <_> + + 0 -1 832 -5.5282998830080032e-02 + + -5.7682299613952637e-01 1.6860599815845490e-01 + <_> + + 0 -1 833 5.6336000561714172e-02 + + -3.3775001764297485e-02 -1.3889650106430054e+00 + <_> + + 0 -1 834 -2.3824000731110573e-02 + + 4.0182098746299744e-01 1.8360000103712082e-03 + <_> + + 0 -1 835 1.7810000572353601e-03 + + 1.8145999312400818e-01 -4.1743400692939758e-01 + <_> + + 0 -1 836 -3.7689000368118286e-02 + + 5.4683101177215576e-01 1.8219999969005585e-02 + <_> + + 0 -1 837 -2.4144999682903290e-02 + + 6.8352097272872925e-01 -1.9650200009346008e-01 + <_> + 135 + -3.7025990486145020e+00 + + <_> + + 0 -1 838 2.7444999665021896e-02 + + -8.9984202384948730e-01 5.1876497268676758e-01 + <_> + + 0 -1 839 1.1554100364446640e-01 + + -5.6524401903152466e-01 7.0551300048828125e-01 + <_> + + 0 -1 840 -2.2297000512480736e-02 + + 3.6079999804496765e-01 -6.6864597797393799e-01 + <_> + + 0 -1 841 1.3325000181794167e-02 + + -5.5573397874832153e-01 3.5789999365806580e-01 + <_> + + 0 -1 842 -3.8060001097619534e-03 + + -1.0713000297546387e+00 1.8850000202655792e-01 + <_> + + 0 -1 843 -2.6819999329745770e-03 + + -7.1584302186965942e-01 2.6344498991966248e-01 + <_> + + 0 -1 844 3.3819999080151320e-03 + + -4.6930798888206482e-01 2.6658400893211365e-01 + <_> + + 0 -1 845 3.7643000483512878e-02 + + 2.1098700165748596e-01 -1.0804339647293091e+00 + <_> + + 0 -1 846 -1.3861999846994877e-02 + + 6.6912001371383667e-01 -2.7942800521850586e-01 + <_> + + 0 -1 847 -2.7350001037120819e-03 + + -9.5332300662994385e-01 2.4051299691200256e-01 + <_> + + 0 -1 848 -3.8336999714374542e-02 + + 8.1432801485061646e-01 -2.4919399619102478e-01 + <_> + + 0 -1 849 -3.4697998315095901e-02 + + 1.2330100536346436e+00 6.8600000813603401e-03 + <_> + + 0 -1 850 2.3360999301075935e-02 + + -3.0794700980186462e-01 7.0714497566223145e-01 + <_> + + 0 -1 851 3.5057999193668365e-02 + + 2.1205900609493256e-01 -1.4399830102920532e+00 + <_> + + 0 -1 852 -1.3256999664008617e-02 + + -9.0260702371597290e-01 4.8610001802444458e-02 + <_> + + 0 -1 853 1.2740000151097775e-02 + + 2.2655199468135834e-01 -4.4643801450729370e-01 + <_> + + 0 -1 854 3.6400000099092722e-03 + + -3.9817899465560913e-01 3.4665399789810181e-01 + <_> + + 0 -1 855 1.0064700245857239e-01 + + 1.8383599817752838e-01 -1.3410769701004028e+00 + <_> + + 0 -1 856 0. + + 1.5536400675773621e-01 -5.1582497358322144e-01 + <_> + + 0 -1 857 1.1708999983966351e-02 + + 2.1651400625705719e-01 -7.2705197334289551e-01 + <_> + + 0 -1 858 -3.5964999347925186e-02 + + -1.4789500236511230e+00 -2.4317000061273575e-02 + <_> + + 0 -1 859 -2.1236000582575798e-02 + + -1.6844099760055542e-01 1.9526599347591400e-01 + <_> + + 0 -1 860 1.4874000102281570e-02 + + 3.7335999310016632e-02 -8.7557297945022583e-01 + <_> + + 0 -1 861 -5.1409997977316380e-03 + + 3.3466500043869019e-01 -2.4109700322151184e-01 + <_> + + 0 -1 862 2.3450000211596489e-02 + + 5.5320002138614655e-03 -1.2509720325469971e+00 + <_> + + 0 -1 863 -2.5062000378966331e-02 + + 4.5212399959564209e-01 -8.4469996392726898e-02 + <_> + + 0 -1 864 -7.7400001464411616e-04 + + 1.5249900519847870e-01 -4.8486500978469849e-01 + <_> + + 0 -1 865 -4.0483999997377396e-02 + + -1.3024920225143433e+00 1.7983500659465790e-01 + <_> + + 0 -1 866 2.8170999139547348e-02 + + -2.4410900473594666e-01 6.2271100282669067e-01 + <_> + + 0 -1 867 4.5692998915910721e-02 + + 2.8122000396251678e-02 9.2394399642944336e-01 + <_> + + 0 -1 868 3.9707001298666000e-02 + + -2.2332799434661865e-01 7.7674001455307007e-01 + <_> + + 0 -1 869 5.0517000257968903e-02 + + 2.0319999754428864e-01 -1.0895930528640747e+00 + <_> + + 0 -1 870 -1.7266999930143356e-02 + + 6.8598401546478271e-01 -2.3304499685764313e-01 + <_> + + 0 -1 871 8.0186001956462860e-02 + + -1.0292000137269497e-02 6.1881101131439209e-01 + <_> + + 0 -1 872 9.7676001489162445e-02 + + -2.0070299506187439e-01 1.0088349580764771e+00 + <_> + + 0 -1 873 -1.5572000294923782e-02 + + 4.7615298628807068e-01 4.5623999089002609e-02 + <_> + + 0 -1 874 -1.5305000357329845e-02 + + -1.1077369451522827e+00 4.5239999890327454e-03 + <_> + + 0 -1 875 -1.6485000029206276e-02 + + 1.0152939558029175e+00 1.6327999532222748e-02 + <_> + + 0 -1 876 -2.6141999289393425e-02 + + 4.1723299026489258e-01 -2.8645500540733337e-01 + <_> + + 0 -1 877 8.8679995387792587e-03 + + 2.1404999494552612e-01 -1.6772800683975220e-01 + <_> + + 0 -1 878 -2.6886999607086182e-02 + + -1.1564220190048218e+00 -1.0324000380933285e-02 + <_> + + 0 -1 879 7.7789998613297939e-03 + + 3.5359498858451843e-01 -2.9611301422119141e-01 + <_> + + 0 -1 880 -1.5974000096321106e-02 + + -1.5374109745025635e+00 -2.9958000406622887e-02 + <_> + + 0 -1 881 2.0866999402642250e-02 + + 2.0244100689888000e-01 -7.1270197629928589e-01 + <_> + + 0 -1 882 8.5482001304626465e-02 + + -2.5932999327778816e-02 -1.5156569480895996e+00 + <_> + + 0 -1 883 2.3872999474406242e-02 + + 1.6803400218486786e-01 -3.8806200027465820e-01 + <_> + + 0 -1 884 -3.9105001837015152e-02 + + -1.1958349943161011e+00 -2.0361000671982765e-02 + <_> + + 0 -1 885 -7.7946998178958893e-02 + + -1.0898950099945068e+00 1.4530299603939056e-01 + <_> + + 0 -1 886 -1.6876000910997391e-02 + + 2.8049701452255249e-01 -4.1336300969123840e-01 + <_> + + 0 -1 887 1.1875600367784500e-01 + + -4.3490998446941376e-02 4.1263699531555176e-01 + <_> + + 0 -1 888 1.5624199807643890e-01 + + -2.6429599523544312e-01 5.5127799510955811e-01 + <_> + + 0 -1 889 -4.5908000320196152e-02 + + 6.0189199447631836e-01 1.8921000882983208e-02 + <_> + + 0 -1 890 -1.0309999808669090e-02 + + 3.8152998685836792e-01 -2.9507899284362793e-01 + <_> + + 0 -1 891 9.5769003033638000e-02 + + 1.3246500492095947e-01 -4.6266800165176392e-01 + <_> + + 0 -1 892 1.3686999678611755e-02 + + 1.1738699674606323e-01 -5.1664102077484131e-01 + <_> + + 0 -1 893 2.3990001063793898e-03 + + -3.4007599949836731e-01 2.0953500270843506e-01 + <_> + + 0 -1 894 3.3264998346567154e-02 + + -1.7052799463272095e-01 1.4366799592971802e+00 + <_> + + 0 -1 895 -3.3206000924110413e-02 + + 6.1295700073242188e-01 -4.1549999266862869e-02 + <_> + + 0 -1 896 2.7979998849332333e-03 + + -4.8554301261901855e-01 1.3372699916362762e-01 + <_> + + 0 -1 897 -6.5792001783847809e-02 + + -4.0257668495178223e+00 1.0876700282096863e-01 + <_> + + 0 -1 898 2.1430000197142363e-03 + + -3.9179998636245728e-01 2.2427099943161011e-01 + <_> + + 0 -1 899 2.2363999858498573e-02 + + -8.6429998278617859e-02 3.7785199284553528e-01 + <_> + + 0 -1 900 -5.7410001754760742e-02 + + 1.1454069614410400e+00 -1.9736599922180176e-01 + <_> + + 0 -1 901 6.6550001502037048e-03 + + -2.1105000749230385e-02 5.8453398942947388e-01 + <_> + + 0 -1 902 1.2326999567449093e-02 + + 3.7817001342773438e-02 -6.6987001895904541e-01 + <_> + + 0 -1 903 -8.1869997084140778e-03 + + 5.6366002559661865e-01 -7.6877996325492859e-02 + <_> + + 0 -1 904 3.6681000143289566e-02 + + -1.7343300580978394e-01 1.1670149564743042e+00 + <_> + + 0 -1 905 -4.0220400691032410e-01 + + 1.2640819549560547e+00 4.3398998677730560e-02 + <_> + + 0 -1 906 -2.2126000374555588e-02 + + 6.6978102922439575e-01 -2.1605299413204193e-01 + <_> + + 0 -1 907 -1.3156999833881855e-02 + + -4.1198599338531494e-01 2.0215000212192535e-01 + <_> + + 0 -1 908 -1.2860000133514404e-02 + + -9.1582697629928589e-01 3.9232999086380005e-02 + <_> + + 0 -1 909 2.1627999842166901e-02 + + 3.8719999138265848e-03 3.5668200254440308e-01 + <_> + + 0 -1 910 1.1896000243723392e-02 + + -3.7303900718688965e-01 1.9235099852085114e-01 + <_> + + 0 -1 911 -1.9548999145627022e-02 + + -4.2374899983406067e-01 2.4429599940776825e-01 + <_> + + 0 -1 912 6.4444996416568756e-02 + + -1.6558900475502014e-01 1.2697030305862427e+00 + <_> + + 0 -1 913 1.0898499935865402e-01 + + 1.4894300699234009e-01 -2.1534640789031982e+00 + <_> + + 0 -1 914 -3.4077998250722885e-02 + + 1.3779460191726685e+00 -1.6198499500751495e-01 + <_> + + 0 -1 915 -3.7489999085664749e-03 + + -3.3828601241111755e-01 2.1152900159358978e-01 + <_> + + 0 -1 916 -1.0971999727189541e-02 + + 7.6517897844314575e-01 -1.9692599773406982e-01 + <_> + + 0 -1 917 -1.1485000140964985e-02 + + -6.9271200895309448e-01 2.1657100319862366e-01 + <_> + + 0 -1 918 2.5984000414609909e-02 + + -1.1983999982476234e-02 -9.9697297811508179e-01 + <_> + + 0 -1 919 4.2159999720752239e-03 + + -1.0205700248479843e-01 4.8884400725364685e-01 + <_> + + 0 -1 920 -4.7697000205516815e-02 + + 1.0666010379791260e+00 -1.7576299607753754e-01 + <_> + + 0 -1 921 4.0300001273863018e-04 + + 1.8524800240993500e-01 -7.4790000915527344e-01 + <_> + + 0 -1 922 1.1539600044488907e-01 + + -2.2019700706005096e-01 5.4509997367858887e-01 + <_> + + 0 -1 923 1.6021000221371651e-02 + + 2.5487500429153442e-01 -5.0740098953247070e-01 + <_> + + 0 -1 924 5.6632000952959061e-02 + + -1.1256000027060509e-02 -9.5968097448348999e-01 + <_> + + 0 -1 925 -1.0726000182330608e-02 + + -2.8544700145721436e-01 1.6994799673557281e-01 + <_> + + 0 -1 926 1.2420000135898590e-01 + + -3.6139998584985733e-02 -1.3132710456848145e+00 + <_> + + 0 -1 927 -5.3799999877810478e-03 + + 3.3092701435089111e-01 1.3307999819517136e-02 + <_> + + 0 -1 928 1.1908000335097313e-02 + + -3.4830299019813538e-01 2.4041900038719177e-01 + <_> + + 0 -1 929 -4.3007999658584595e-02 + + -1.4390469789505005e+00 1.5599599480628967e-01 + <_> + + 0 -1 930 -3.3149998635053635e-02 + + -1.1805850267410278e+00 -1.2347999960184097e-02 + <_> + + 0 -1 931 -2.1341999992728233e-02 + + 2.2119441032409668e+00 6.2737002968788147e-02 + <_> + + 0 -1 932 -1.2218999676406384e-02 + + -1.8709750175476074e+00 -4.5499999076128006e-02 + <_> + + 0 -1 933 -1.6860999166965485e-02 + + -7.6912701129913330e-01 1.5330000221729279e-01 + <_> + + 0 -1 934 -2.4999999441206455e-03 + + -6.2987399101257324e-01 5.1600001752376556e-02 + <_> + + 0 -1 935 -4.5037999749183655e-02 + + 8.5428899526596069e-01 6.2600001692771912e-03 + <_> + + 0 -1 936 3.9057999849319458e-02 + + -3.2458998262882233e-02 -1.3325669765472412e+00 + <_> + + 0 -1 937 6.6720000468194485e-03 + + -1.9423599541187286e-01 3.7328699231147766e-01 + <_> + + 0 -1 938 -1.6361000016331673e-02 + + 2.0605869293212891e+00 -1.5042699873447418e-01 + <_> + + 0 -1 939 6.1719999648630619e-03 + + -1.1610999703407288e-01 2.5455400347709656e-01 + <_> + + 0 -1 940 4.5722000300884247e-02 + + -1.6340000554919243e-02 -1.0449140071868896e+00 + <_> + + 0 -1 941 4.1209999471902847e-03 + + -4.1997998952865601e-02 3.9680999517440796e-01 + <_> + + 0 -1 942 -1.7800000205170363e-04 + + -6.6422599554061890e-01 3.3443000167608261e-02 + <_> + + 0 -1 943 7.1109998971223831e-03 + + -5.8231998234987259e-02 3.7857300043106079e-01 + <_> + + 0 -1 944 -4.9864001572132111e-02 + + 6.1019402742385864e-01 -2.1005700528621674e-01 + <_> + + 0 -1 945 -2.5011999532580376e-02 + + -5.7100099325180054e-01 1.7848399281501770e-01 + <_> + + 0 -1 946 3.0939999967813492e-02 + + 5.6363001465797424e-02 -6.4731001853942871e-01 + <_> + + 0 -1 947 4.6271000057458878e-02 + + 1.7482399940490723e-01 -9.8909401893615723e-01 + <_> + + 0 -1 948 -3.1870000530034304e-03 + + -6.6804802417755127e-01 3.2267000526189804e-02 + <_> + + 0 -1 949 -2.4351999163627625e-02 + + 2.9444900155067444e-01 -1.3599999947473407e-03 + <_> + + 0 -1 950 1.1974000371992588e-02 + + -2.8345099091529846e-01 4.7171199321746826e-01 + <_> + + 0 -1 951 1.3070000335574150e-02 + + -1.0834600031375885e-01 5.7193297147750854e-01 + <_> + + 0 -1 952 5.9163000434637070e-02 + + -5.0939001142978668e-02 -1.9059720039367676e+00 + <_> + + 0 -1 953 -4.1094999760389328e-02 + + 4.5104598999023438e-01 -9.7599998116493225e-03 + <_> + + 0 -1 954 -8.3989001810550690e-02 + + -2.0349199771881104e+00 -5.1019001752138138e-02 + <_> + + 0 -1 955 4.4619001448154449e-02 + + 1.7041100561618805e-01 -1.2278720140457153e+00 + <_> + + 0 -1 956 2.4419000372290611e-02 + + -2.1796999499201775e-02 -1.0822949409484863e+00 + <_> + + 0 -1 957 -4.3870001100003719e-03 + + 3.0466699600219727e-01 -3.7066599726676941e-01 + <_> + + 0 -1 958 2.4607999250292778e-02 + + -3.1169500946998596e-01 2.3657299578189850e-01 + <_> + + 0 -1 959 -8.5182003676891327e-02 + + -1.7982350587844849e+00 1.5254299342632294e-01 + <_> + + 0 -1 960 2.1844999864697456e-02 + + -5.1888000220060349e-02 -1.9017189741134644e+00 + <_> + + 0 -1 961 -1.6829000785946846e-02 + + 2.1025900542736053e-01 2.1656999364495277e-02 + <_> + + 0 -1 962 3.2547999173402786e-02 + + -2.0292599499225616e-01 6.0944002866744995e-01 + <_> + + 0 -1 963 2.4709999561309814e-03 + + -9.5371198654174805e-01 1.8568399548530579e-01 + <_> + + 0 -1 964 5.5415999144315720e-02 + + -1.4405299723148346e-01 2.1506340503692627e+00 + <_> + + 0 -1 965 -1.0635499656200409e-01 + + -1.0911970138549805e+00 1.3228000700473785e-01 + <_> + + 0 -1 966 -7.9889995977282524e-03 + + 1.0253400355577469e-01 -5.1744902133941650e-01 + <_> + + 0 -1 967 7.5567997992038727e-02 + + 5.8965001255273819e-02 1.2354209423065186e+00 + <_> + + 0 -1 968 -9.2805996537208557e-02 + + -1.3431650400161743e+00 -3.4462999552488327e-02 + <_> + + 0 -1 969 4.9431998282670975e-02 + + 4.9601998180150986e-02 1.6054730415344238e+00 + <_> + + 0 -1 970 -1.1772999539971352e-02 + + -1.0261050462722778e+00 -4.1559999808669090e-03 + <_> + + 0 -1 971 8.5886001586914062e-02 + + 8.4642998874187469e-02 9.5220798254013062e-01 + <_> + + 0 -1 972 8.1031002104282379e-02 + + -1.4687100052833557e-01 1.9359990358352661e+00 + <_> + 136 + -3.4265899658203125e+00 + + <_> + + 0 -1 973 -3.3840999007225037e-02 + + 6.5889501571655273e-01 -6.9755297899246216e-01 + <_> + + 0 -1 974 1.5410000458359718e-02 + + -9.0728402137756348e-01 3.0478599667549133e-01 + <_> + + 0 -1 975 5.4905999451875687e-02 + + -4.9774798750877380e-01 5.7132601737976074e-01 + <_> + + 0 -1 976 2.1390000358223915e-02 + + -4.2565199732780457e-01 5.8096802234649658e-01 + <_> + + 0 -1 977 7.8849997371435165e-03 + + -4.7905999422073364e-01 4.3016499280929565e-01 + <_> + + 0 -1 978 -3.7544999271631241e-02 + + 5.0861597061157227e-01 -1.9985899329185486e-01 + <_> + + 0 -1 979 1.5925799310207367e-01 + + -2.3263600468635559e-01 1.0993319749832153e+00 + <_> + + 0 -1 980 -6.8939998745918274e-02 + + 4.0569001436233521e-01 5.6855000555515289e-02 + <_> + + 0 -1 981 -3.3695001155138016e-02 + + 4.5132800936698914e-01 -3.3332800865173340e-01 + <_> + + 0 -1 982 -6.3314996659755707e-02 + + -8.5015702247619629e-01 2.2341699898242950e-01 + <_> + + 0 -1 983 7.3699997738003731e-03 + + -9.3082201480865479e-01 5.9216998517513275e-02 + <_> + + 0 -1 984 -9.5969997346401215e-03 + + -1.2794899940490723e+00 1.8447299301624298e-01 + <_> + + 0 -1 985 -1.3067999482154846e-01 + + 5.8426898717880249e-01 -2.6007199287414551e-01 + <_> + + 0 -1 986 5.7402998208999634e-02 + + -5.3789000958204269e-02 7.1175599098205566e-01 + <_> + + 0 -1 987 -7.2340001352131367e-03 + + -8.6962199211120605e-01 7.5214996933937073e-02 + <_> + + 0 -1 988 3.1098999083042145e-02 + + -7.5006999075412750e-02 9.0781599283218384e-01 + <_> + + 0 -1 989 3.5854000598192215e-02 + + -2.4795499444007874e-01 7.2272098064422607e-01 + <_> + + 0 -1 990 -3.1534999608993530e-02 + + -1.1238329410552979e+00 2.0988300442695618e-01 + <_> + + 0 -1 991 -1.9437000155448914e-02 + + -1.4499390125274658e+00 -1.5100000426173210e-02 + <_> + + 0 -1 992 -7.2420001961290836e-03 + + 5.3864902257919312e-01 -1.1375399678945541e-01 + <_> + + 0 -1 993 8.1639997661113739e-03 + + 6.6889002919197083e-02 -7.6872897148132324e-01 + <_> + + 0 -1 994 -4.3653000146150589e-02 + + 1.1413530111312866e+00 4.0217000991106033e-02 + <_> + + 0 -1 995 2.6569999754428864e-02 + + -2.4719099700450897e-01 5.9295099973678589e-01 + <_> + + 0 -1 996 3.2216999679803848e-02 + + -4.0024999529123306e-02 3.2688000798225403e-01 + <_> + + 0 -1 997 -7.2236001491546631e-02 + + 5.8729398250579834e-01 -2.5396001338958740e-01 + <_> + + 0 -1 998 3.1424999237060547e-02 + + 1.5315100550651550e-01 -5.6042098999023438e-01 + <_> + + 0 -1 999 -4.7699999413453043e-04 + + 1.6958899796009064e-01 -5.2626699209213257e-01 + <_> + + 0 -1 1000 2.7189999818801880e-03 + + -1.4944599568843842e-01 2.9658699035644531e-01 + <_> + + 0 -1 1001 3.2875001430511475e-02 + + -3.9943501353263855e-01 2.5156599283218384e-01 + <_> + + 0 -1 1002 -1.4553000219166279e-02 + + 2.7972599864006042e-01 -4.7203800082206726e-01 + <_> + + 0 -1 1003 3.8017999380826950e-02 + + -2.9200001154094934e-03 -1.1300059556961060e+00 + <_> + + 0 -1 1004 2.8659999370574951e-03 + + 4.1111800074577332e-01 -2.6220801472663879e-01 + <_> + + 0 -1 1005 -4.1606999933719635e-02 + + -1.4293819665908813e+00 -1.9132999703288078e-02 + <_> + + 0 -1 1006 -2.4802999570965767e-02 + + -2.5013598799705505e-01 1.5978699922561646e-01 + <_> + + 0 -1 1007 1.0098000057041645e-02 + + 4.3738998472690582e-02 -6.9986099004745483e-01 + <_> + + 0 -1 1008 -2.0947000011801720e-02 + + -9.4137799739837646e-01 2.3204000294208527e-01 + <_> + + 0 -1 1009 2.2458000108599663e-02 + + -2.7185800671577454e-01 4.5319199562072754e-01 + <_> + + 0 -1 1010 -3.7110999226570129e-02 + + -1.0314660072326660e+00 1.4421799778938293e-01 + <_> + + 0 -1 1011 -1.0648000054061413e-02 + + 6.3107001781463623e-01 -2.5520798563957214e-01 + <_> + + 0 -1 1012 5.5422998964786530e-02 + + 1.6206599771976471e-01 -1.7722640037536621e+00 + <_> + + 0 -1 1013 2.1601999178528786e-02 + + -2.5016099214553833e-01 5.4119801521301270e-01 + <_> + + 0 -1 1014 8.7000000348780304e-05 + + -2.9008901119232178e-01 3.3507999777793884e-01 + <_> + + 0 -1 1015 1.4406000263988972e-02 + + -7.8840004280209541e-03 -1.1677219867706299e+00 + <_> + + 0 -1 1016 1.0777399688959122e-01 + + 1.1292000114917755e-01 -2.4940319061279297e+00 + <_> + + 0 -1 1017 3.5943999886512756e-02 + + -1.9480599462985992e-01 9.5757502317428589e-01 + <_> + + 0 -1 1018 -3.9510000497102737e-03 + + 3.0927801132202148e-01 -2.5530201196670532e-01 + <_> + + 0 -1 1019 2.0942000672221184e-02 + + -7.6319999061524868e-03 -1.0086350440979004e+00 + <_> + + 0 -1 1020 -2.9877999797463417e-02 + + -4.6027699112892151e-01 1.9507199525833130e-01 + <_> + + 0 -1 1021 2.5971999391913414e-02 + + -1.2187999673187733e-02 -1.0035500526428223e+00 + <_> + + 0 -1 1022 1.0603000409901142e-02 + + -7.5969003140926361e-02 4.1669899225234985e-01 + <_> + + 0 -1 1023 8.5819996893405914e-03 + + -2.6648598909378052e-01 3.9111500978469849e-01 + <_> + + 0 -1 1024 2.1270999684929848e-02 + + 1.8273900449275970e-01 -3.6052298545837402e-01 + <_> + + 0 -1 1025 7.4518002569675446e-02 + + -1.8938399851322174e-01 9.2658001184463501e-01 + <_> + + 0 -1 1026 4.6569998376071453e-03 + + -1.4506199955940247e-01 3.3294600248336792e-01 + <_> + + 0 -1 1027 1.7119999974966049e-03 + + -5.2464002370834351e-01 8.9879997074604034e-02 + <_> + + 0 -1 1028 9.8500004969537258e-04 + + -3.8381999731063843e-01 2.4392999708652496e-01 + <_> + + 0 -1 1029 2.8233999386429787e-02 + + -5.7879998348653316e-03 -1.2617139816284180e+00 + <_> + + 0 -1 1030 -3.2678000628948212e-02 + + -5.7953298091888428e-01 1.6955299675464630e-01 + <_> + + 0 -1 1031 2.2536000236868858e-02 + + 2.2281000390648842e-02 -8.7869602441787720e-01 + <_> + + 0 -1 1032 -2.1657999604940414e-02 + + -6.5108501911163330e-01 1.2966899573802948e-01 + <_> + + 0 -1 1033 7.6799998059868813e-03 + + -3.3965200185775757e-01 2.2013300657272339e-01 + <_> + + 0 -1 1034 1.4592000283300877e-02 + + 1.5077300369739532e-01 -5.0452399253845215e-01 + <_> + + 0 -1 1035 2.7868000790476799e-02 + + -2.5045299530029297e-01 4.5741999149322510e-01 + <_> + + 0 -1 1036 5.6940000504255295e-03 + + -1.0948500037193298e-01 5.5757802724838257e-01 + <_> + + 0 -1 1037 -1.0002999566495419e-02 + + -9.7366297245025635e-01 1.8467999994754791e-02 + <_> + + 0 -1 1038 -4.0719998069107533e-03 + + 3.8222199678421021e-01 -1.6921100020408630e-01 + <_> + + 0 -1 1039 -2.2593999281525612e-02 + + -1.0391089916229248e+00 5.1839998923242092e-03 + <_> + + 0 -1 1040 -3.9579998701810837e-02 + + -5.5109229087829590e+00 1.1163999885320663e-01 + <_> + + 0 -1 1041 -1.7537999898195267e-02 + + 9.5485800504684448e-01 -1.8584500253200531e-01 + <_> + + 0 -1 1042 9.0300003066658974e-03 + + 1.0436000302433968e-02 8.2114797830581665e-01 + <_> + + 0 -1 1043 -7.9539995640516281e-03 + + 2.2632899880409241e-01 -3.4568199515342712e-01 + <_> + + 0 -1 1044 2.7091000229120255e-02 + + 1.6430099308490753e-01 -1.3926379680633545e+00 + <_> + + 0 -1 1045 -2.0625999197363853e-02 + + -8.6366099119186401e-01 2.3880000226199627e-03 + <_> + + 0 -1 1046 -7.1989998221397400e-02 + + -2.8192629814147949e+00 1.1570499837398529e-01 + <_> + + 0 -1 1047 -2.6964999735355377e-02 + + -1.2946130037307739e+00 -2.4661000818014145e-02 + <_> + + 0 -1 1048 -4.7377999871969223e-02 + + -8.1306397914886475e-01 1.1831399798393250e-01 + <_> + + 0 -1 1049 -1.0895600169897079e-01 + + 6.5937900543212891e-01 -2.0843900740146637e-01 + <_> + + 0 -1 1050 1.3574000447988510e-02 + + 7.4240001849830151e-03 5.3152197599411011e-01 + <_> + + 0 -1 1051 -6.6920001991093159e-03 + + 3.0655801296234131e-01 -3.1084299087524414e-01 + <_> + + 0 -1 1052 -3.9070001803338528e-03 + + 2.5576499104499817e-01 -5.2932001650333405e-02 + <_> + + 0 -1 1053 -3.7613000720739365e-02 + + -1.4350049495697021e+00 -1.5448000282049179e-02 + <_> + + 0 -1 1054 8.6329998448491096e-03 + + -1.6884399950504303e-01 4.2124900221824646e-01 + <_> + + 0 -1 1055 -3.2097000628709793e-02 + + -6.4979398250579834e-01 4.1110001504421234e-02 + <_> + + 0 -1 1056 5.8495998382568359e-02 + + -5.2963998168706894e-02 6.3368302583694458e-01 + <_> + + 0 -1 1057 -4.0901999920606613e-02 + + -9.2101097106933594e-01 9.0640000998973846e-03 + <_> + + 0 -1 1058 -1.9925000146031380e-02 + + 5.3759998083114624e-01 -6.2996998429298401e-02 + <_> + + 0 -1 1059 -4.6020001173019409e-03 + + -5.4333502054214478e-01 8.4104999899864197e-02 + <_> + + 0 -1 1060 1.6824999824166298e-02 + + 1.5563699603080750e-01 -4.0171200037002563e-01 + <_> + + 0 -1 1061 9.4790002331137657e-03 + + -2.4245299398899078e-01 5.1509499549865723e-01 + <_> + + 0 -1 1062 -1.9534999504685402e-02 + + -5.1118397712707520e-01 1.3831999897956848e-01 + <_> + + 0 -1 1063 1.0746000334620476e-02 + + -2.1854999661445618e-01 6.2828701734542847e-01 + <_> + + 0 -1 1064 3.7927001714706421e-02 + + 1.1640299856662750e-01 -2.7301959991455078e+00 + <_> + + 0 -1 1065 1.6390999779105186e-02 + + -1.4635999687016010e-02 -1.0797250270843506e+00 + <_> + + 0 -1 1066 -1.9785000011324883e-02 + + 1.2166420221328735e+00 3.3275000751018524e-02 + <_> + + 0 -1 1067 1.1067000217735767e-02 + + -2.5388300418853760e-01 4.4038599729537964e-01 + <_> + + 0 -1 1068 5.2479999139904976e-03 + + 2.2496800124645233e-01 -2.4216499924659729e-01 + <_> + + 0 -1 1069 -1.1141999624669552e-02 + + 2.5018098950386047e-01 -3.0811500549316406e-01 + <_> + + 0 -1 1070 -1.0666999965906143e-02 + + -3.2729101181030273e-01 2.6168298721313477e-01 + <_> + + 0 -1 1071 1.0545299947261810e-01 + + -5.5750001221895218e-02 -1.9605729579925537e+00 + <_> + + 0 -1 1072 5.4827999323606491e-02 + + -1.9519999623298645e-03 7.3866099119186401e-01 + <_> + + 0 -1 1073 1.7760999500751495e-02 + + -3.0647200345993042e-01 2.6346999406814575e-01 + <_> + + 0 -1 1074 -3.1185999512672424e-02 + + -2.4600900709629059e-01 1.7082199454307556e-01 + <_> + + 0 -1 1075 -5.7296000421047211e-02 + + 4.7033500671386719e-01 -2.6048299670219421e-01 + <_> + + 0 -1 1076 -1.1312000453472137e-02 + + 3.8628900051116943e-01 -2.8817000985145569e-01 + <_> + + 0 -1 1077 3.0592000111937523e-02 + + -4.8826001584529877e-02 -1.7638969421386719e+00 + <_> + + 0 -1 1078 1.8489999929443002e-03 + + 2.1099899709224701e-01 -2.5940999388694763e-02 + <_> + + 0 -1 1079 1.1419000104069710e-02 + + -1.6829599440097809e-01 1.0278660058975220e+00 + <_> + + 0 -1 1080 8.1403002142906189e-02 + + 1.1531999707221985e-01 -1.2482399940490723e+00 + <_> + + 0 -1 1081 5.3495999425649643e-02 + + -4.6303998678922653e-02 -1.7165969610214233e+00 + <_> + + 0 -1 1082 -2.3948000743985176e-02 + + -4.0246599912643433e-01 2.0562100410461426e-01 + <_> + + 0 -1 1083 6.7690000869333744e-03 + + -3.3152300119400024e-01 2.0683400332927704e-01 + <_> + + 0 -1 1084 -3.2343998551368713e-02 + + -7.2632801532745361e-01 2.0073500275611877e-01 + <_> + + 0 -1 1085 3.7863001227378845e-02 + + -1.5631000697612762e-01 1.6697460412979126e+00 + <_> + + 0 -1 1086 1.5440000221133232e-02 + + 1.9487400352954865e-01 -3.5384199023246765e-01 + <_> + + 0 -1 1087 -4.4376000761985779e-02 + + 8.2093602418899536e-01 -1.8193599581718445e-01 + <_> + + 0 -1 1088 -2.3102000355720520e-02 + + -4.3044099211692810e-01 1.2375400215387344e-01 + <_> + + 0 -1 1089 1.9400000572204590e-02 + + -2.9726000502705574e-02 -1.1597590446472168e+00 + <_> + + 0 -1 1090 1.0385700315237045e-01 + + 1.1149899661540985e-01 -4.6835222244262695e+00 + <_> + + 0 -1 1091 -1.8964000046253204e-02 + + 2.1773819923400879e+00 -1.4544400572776794e-01 + <_> + + 0 -1 1092 3.8750998675823212e-02 + + -4.9446001648902893e-02 3.4018298983573914e-01 + <_> + + 0 -1 1093 2.2766999900341034e-02 + + -3.2802999019622803e-01 3.0531400442123413e-01 + <_> + + 0 -1 1094 -3.1357001513242722e-02 + + 1.1520819664001465e+00 2.7305999770760536e-02 + <_> + + 0 -1 1095 9.6909999847412109e-03 + + -3.8799500465393066e-01 2.1512599289417267e-01 + <_> + + 0 -1 1096 -4.9284998327493668e-02 + + -1.6774909496307373e+00 1.5774199366569519e-01 + <_> + + 0 -1 1097 -3.9510998874902725e-02 + + -9.7647899389266968e-01 -1.0552000254392624e-02 + <_> + + 0 -1 1098 4.7997999936342239e-02 + + 2.0843900740146637e-01 -6.8992799520492554e-01 + <_> + + 0 -1 1099 5.1422998309135437e-02 + + -1.6665300726890564e-01 1.2149239778518677e+00 + <_> + + 0 -1 1100 1.4279999770224094e-02 + + 2.3627699911594391e-01 -4.1396799683570862e-01 + <_> + + 0 -1 1101 -9.1611996293067932e-02 + + -9.2830902338027954e-01 -1.8345000222325325e-02 + <_> + + 0 -1 1102 6.5080001950263977e-03 + + -7.3647201061248779e-01 1.9497099518775940e-01 + <_> + + 0 -1 1103 3.5723000764846802e-02 + + 1.4197799563407898e-01 -4.2089301347732544e-01 + <_> + + 0 -1 1104 5.0638001412153244e-02 + + 1.1644000187516212e-02 7.8486597537994385e-01 + <_> + + 0 -1 1105 -1.4613999985158443e-02 + + -1.1909500360488892e+00 -3.5128001123666763e-02 + <_> + + 0 -1 1106 -3.8662999868392944e-02 + + 2.4314730167388916e+00 6.5647996962070465e-02 + <_> + + 0 -1 1107 -4.0346998721361160e-02 + + 7.1755301952362061e-01 -1.9108299911022186e-01 + <_> + + 0 -1 1108 2.3902000859379768e-02 + + 1.5646199882030487e-01 -7.9294800758361816e-01 + <_> + 137 + -3.5125269889831543e+00 + + <_> + + 0 -1 1109 8.5640000179409981e-03 + + -8.1450700759887695e-01 5.8875298500061035e-01 + <_> + + 0 -1 1110 -1.3292600214481354e-01 + + 9.3213397264480591e-01 -2.9367300868034363e-01 + <_> + + 0 -1 1111 9.8400004208087921e-03 + + -5.6462901830673218e-01 4.1647699475288391e-01 + <_> + + 0 -1 1112 5.0889998674392700e-03 + + -7.9232800006866455e-01 1.6975000500679016e-01 + <_> + + 0 -1 1113 -6.1039000749588013e-02 + + -1.4169000387191772e+00 2.5020999833941460e-02 + <_> + + 0 -1 1114 -4.6599999768659472e-04 + + 3.7982499599456787e-01 -4.1567099094390869e-01 + <_> + + 0 -1 1115 3.3889999613165855e-03 + + -4.0768599510192871e-01 3.5548499226570129e-01 + <_> + + 0 -1 1116 2.1006999537348747e-02 + + -2.4080100655555725e-01 8.6112701892852783e-01 + <_> + + 0 -1 1117 7.5559997931122780e-03 + + -8.7467199563980103e-01 9.8572000861167908e-02 + <_> + + 0 -1 1118 2.4779999628663063e-02 + + 1.5566200017929077e-01 -6.9229799509048462e-01 + <_> + + 0 -1 1119 -3.5620000213384628e-02 + + -1.1472270488739014e+00 3.6359999328851700e-02 + <_> + + 0 -1 1120 1.9810000434517860e-02 + + 1.5516200661659241e-01 -6.9520097970962524e-01 + <_> + + 0 -1 1121 1.5019999817013741e-02 + + 4.1990000754594803e-02 -9.6622800827026367e-01 + <_> + + 0 -1 1122 -2.3137999698519707e-02 + + 4.3396899104118347e-01 2.4160000029951334e-03 + <_> + + 0 -1 1123 -1.8743000924587250e-02 + + 4.3481099605560303e-01 -3.2522499561309814e-01 + <_> + + 0 -1 1124 4.5080000162124634e-01 + + -9.4573996961116791e-02 7.2421300411224365e-01 + <_> + + 0 -1 1125 1.1854999698698521e-02 + + -3.8133099675178528e-01 3.0098399519920349e-01 + <_> + + 0 -1 1126 -2.4830000475049019e-02 + + 8.9300602674484253e-01 -1.0295899957418442e-01 + <_> + + 0 -1 1127 -4.4743001461029053e-02 + + 8.6280298233032227e-01 -2.1716499328613281e-01 + <_> + + 0 -1 1128 -1.4600000344216824e-02 + + 6.0069400072097778e-01 -1.5906299650669098e-01 + <_> + + 0 -1 1129 -2.4527000263333321e-02 + + -1.5872869491577148e+00 -2.1817000582814217e-02 + <_> + + 0 -1 1130 2.3024000227451324e-02 + + 1.6853399574756622e-01 -3.8106900453567505e-01 + <_> + + 0 -1 1131 -2.4917000904679298e-02 + + 5.0810897350311279e-01 -2.7279898524284363e-01 + <_> + + 0 -1 1132 1.0130000300705433e-03 + + -4.3138799071311951e-01 2.6438099145889282e-01 + <_> + + 0 -1 1133 1.5603000298142433e-02 + + -3.1624200940132141e-01 5.5715900659561157e-01 + <_> + + 0 -1 1134 -2.6685999706387520e-02 + + 1.0553920269012451e+00 2.9074000194668770e-02 + <_> + + 0 -1 1135 1.3940000208094716e-03 + + -7.1873801946640015e-01 6.5390996634960175e-02 + <_> + + 0 -1 1136 -6.4799998654052615e-04 + + 2.4884399771690369e-01 -2.0978200435638428e-01 + <_> + + 0 -1 1137 -3.1888000667095184e-02 + + -6.8844497203826904e-01 6.3589997589588165e-02 + <_> + + 0 -1 1138 -4.9290000461041927e-03 + + -5.9152501821517944e-01 2.7943599224090576e-01 + <_> + + 0 -1 1139 3.1168000772595406e-02 + + 4.5223999768495560e-02 -8.8639199733734131e-01 + <_> + + 0 -1 1140 -3.3663000911474228e-02 + + -6.1590200662612915e-01 1.5749299526214600e-01 + <_> + + 0 -1 1141 1.1966999620199203e-02 + + -3.0606698989868164e-01 4.2293301224708557e-01 + <_> + + 0 -1 1142 -3.4680001437664032e-02 + + -1.3734940290451050e+00 1.5908700227737427e-01 + <_> + + 0 -1 1143 9.9290004000067711e-03 + + -5.5860197544097900e-01 1.2119200080633163e-01 + <_> + + 0 -1 1144 5.9574998915195465e-02 + + 4.9720001406967640e-03 8.2055401802062988e-01 + <_> + + 0 -1 1145 -6.5428003668785095e-02 + + 1.5651429891586304e+00 -1.6817499697208405e-01 + <_> + + 0 -1 1146 -9.2895999550819397e-02 + + -1.5794529914855957e+00 1.4661799371242523e-01 + <_> + + 0 -1 1147 -4.1184000670909882e-02 + + -1.5518720149993896e+00 -2.9969999566674232e-02 + <_> + + 0 -1 1148 2.1447999402880669e-02 + + 1.7196300625801086e-01 -6.9343197345733643e-01 + <_> + + 0 -1 1149 -2.5569999590516090e-02 + + -1.3061310052871704e+00 -2.4336999282240868e-02 + <_> + + 0 -1 1150 -4.1200999170541763e-02 + + -1.3821059465408325e+00 1.4801800251007080e-01 + <_> + + 0 -1 1151 -1.7668999731540680e-02 + + -7.0889997482299805e-01 3.6524001508951187e-02 + <_> + + 0 -1 1152 9.0060001239180565e-03 + + -4.0913999080657959e-02 8.0373102426528931e-01 + <_> + + 0 -1 1153 -1.1652999557554722e-02 + + 5.7546800374984741e-01 -2.4991700053215027e-01 + <_> + + 0 -1 1154 -7.4780001305043697e-03 + + -4.9280899763107300e-01 1.9810900092124939e-01 + <_> + + 0 -1 1155 8.5499999113380909e-04 + + -4.8858100175857544e-01 1.3563099503517151e-01 + <_> + + 0 -1 1156 -3.0538000166416168e-02 + + -6.0278397798538208e-01 1.8522000312805176e-01 + <_> + + 0 -1 1157 -1.8846999853849411e-02 + + 2.3565599322319031e-01 -3.5136300325393677e-01 + <_> + + 0 -1 1158 -8.1129996106028557e-03 + + -8.1304997205734253e-02 2.1069599688053131e-01 + <_> + + 0 -1 1159 -3.4830000251531601e-02 + + -1.2065670490264893e+00 -1.4251999557018280e-02 + <_> + + 0 -1 1160 1.9021000713109970e-02 + + 2.3349900543689728e-01 -4.5664900541305542e-01 + <_> + + 0 -1 1161 -1.9004000350832939e-02 + + -8.1075799465179443e-01 1.3140000402927399e-02 + <_> + + 0 -1 1162 -8.9057996869087219e-02 + + 6.1542397737503052e-01 3.2983001321554184e-02 + <_> + + 0 -1 1163 6.8620000965893269e-03 + + -2.9583099484443665e-01 2.7003699541091919e-01 + <_> + + 0 -1 1164 -2.8240999206900597e-02 + + -6.1102700233459473e-01 1.7357499897480011e-01 + <_> + + 0 -1 1165 -3.2099999953061342e-04 + + -5.3322899341583252e-01 6.8539001047611237e-02 + <_> + + 0 -1 1166 -1.0829100012779236e-01 + + -1.2879559993743896e+00 1.1801700294017792e-01 + <_> + + 0 -1 1167 1.5878999605774879e-02 + + -1.7072600126266479e-01 1.1103910207748413e+00 + <_> + + 0 -1 1168 8.6859995499253273e-03 + + -1.0995099693536758e-01 4.6010500192642212e-01 + <_> + + 0 -1 1169 -2.5234999135136604e-02 + + 1.0220669507980347e+00 -1.8694299459457397e-01 + <_> + + 0 -1 1170 -1.3508999720215797e-02 + + -7.8316599130630493e-01 1.4202600717544556e-01 + <_> + + 0 -1 1171 -7.7149998396635056e-03 + + -8.8060700893402100e-01 1.1060000397264957e-02 + <_> + + 0 -1 1172 7.1580000221729279e-02 + + 1.1369399726390839e-01 -1.1032789945602417e+00 + <_> + + 0 -1 1173 -1.3554000295698643e-02 + + -8.1096500158309937e-01 3.4080001059919596e-03 + <_> + + 0 -1 1174 2.9450000729411840e-03 + + -7.2879999876022339e-02 3.4998100996017456e-01 + <_> + + 0 -1 1175 -5.0833001732826233e-02 + + -1.2868590354919434e+00 -2.8842000290751457e-02 + <_> + + 0 -1 1176 -8.7989997118711472e-03 + + 4.7613599896430969e-01 -1.4690400660037994e-01 + <_> + + 0 -1 1177 2.1424399316310883e-01 + + -5.9702001512050629e-02 -2.4802260398864746e+00 + <_> + + 0 -1 1178 1.3962999917566776e-02 + + 1.7420299351215363e-01 -4.3911001086235046e-01 + <_> + + 0 -1 1179 4.2502000927925110e-02 + + -1.9965299963951111e-01 7.0654797554016113e-01 + <_> + + 0 -1 1180 1.9827999174594879e-02 + + -6.9136001169681549e-02 6.1643397808074951e-01 + <_> + + 0 -1 1181 -3.3560000360012054e-02 + + -1.2740780115127563e+00 -2.5673000141978264e-02 + <_> + + 0 -1 1182 6.3542999327182770e-02 + + 1.2403500080108643e-01 -1.0776289701461792e+00 + <_> + + 0 -1 1183 2.1933000534772873e-02 + + 1.4952000230550766e-02 -7.1023499965667725e-01 + <_> + + 0 -1 1184 -7.8424997627735138e-02 + + 6.2033998966217041e-01 3.3610999584197998e-02 + <_> + + 0 -1 1185 1.4390000142157078e-02 + + -3.6324599385261536e-01 1.7308300733566284e-01 + <_> + + 0 -1 1186 -6.7309997975826263e-02 + + 5.2374100685119629e-01 1.2799999676644802e-02 + <_> + + 0 -1 1187 1.3047499954700470e-01 + + -1.7122499644756317e-01 1.1235200166702271e+00 + <_> + + 0 -1 1188 -4.6245999634265900e-02 + + -1.1908329725265503e+00 1.7425599694252014e-01 + <_> + + 0 -1 1189 -2.9842000454664230e-02 + + 8.3930599689483643e-01 -1.8064199388027191e-01 + <_> + + 0 -1 1190 -3.8099999073892832e-04 + + 3.5532799363136292e-01 -2.3842300474643707e-01 + <_> + + 0 -1 1191 -2.2378999739885330e-02 + + -8.7943899631500244e-01 -7.8399997437372804e-04 + <_> + + 0 -1 1192 -1.5569999814033508e-03 + + -1.4253300428390503e-01 2.5876200199127197e-01 + <_> + + 0 -1 1193 1.2013000436127186e-02 + + -2.9015499353408813e-01 2.6051101088523865e-01 + <_> + + 0 -1 1194 2.4384999647736549e-02 + + -3.1438998878002167e-02 5.8695900440216064e-01 + <_> + + 0 -1 1195 -4.7180999070405960e-02 + + 6.9430100917816162e-01 -2.1816100180149078e-01 + <_> + + 0 -1 1196 -2.4893999099731445e-02 + + -6.4599299430847168e-01 1.5611599385738373e-01 + <_> + + 0 -1 1197 2.1944999694824219e-02 + + -2.7742000296711922e-02 -1.1346880197525024e+00 + <_> + + 0 -1 1198 1.8809899687767029e-01 + + -1.0076000355184078e-02 1.2429029941558838e+00 + <_> + + 0 -1 1199 -7.7872000634670258e-02 + + 8.5008001327514648e-01 -1.9015499949455261e-01 + <_> + + 0 -1 1200 -4.8769000917673111e-02 + + -2.0763080120086670e+00 1.2179400026798248e-01 + <_> + + 0 -1 1201 -1.7115000635385513e-02 + + -8.5687297582626343e-01 7.8760003671050072e-03 + <_> + + 0 -1 1202 -2.7499999850988388e-03 + + 3.8645499944686890e-01 -1.1391499638557434e-01 + <_> + + 0 -1 1203 -9.8793998360633850e-02 + + -1.7233899831771851e+00 -5.6063000112771988e-02 + <_> + + 0 -1 1204 -2.1936999633908272e-02 + + 5.4749399423599243e-01 -4.2481999844312668e-02 + <_> + + 0 -1 1205 6.1096999794244766e-02 + + -3.8945000618696213e-02 -1.0807880163192749e+00 + <_> + + 0 -1 1206 -2.4563999846577644e-02 + + 5.8311098814010620e-01 -9.7599998116493225e-04 + <_> + + 0 -1 1207 3.3752001821994781e-02 + + -1.3795999810099602e-02 -8.4730297327041626e-01 + <_> + + 0 -1 1208 3.8199000060558319e-02 + + 1.5114299952983856e-01 -7.9473400115966797e-01 + <_> + + 0 -1 1209 -2.0117999985814095e-02 + + 5.1579099893569946e-01 -2.1445399522781372e-01 + <_> + + 0 -1 1210 2.4734999984502792e-02 + + -2.2105000913143158e-02 4.2917698621749878e-01 + <_> + + 0 -1 1211 -2.4357000365853310e-02 + + -8.6201298236846924e-01 -3.6760000512003899e-03 + <_> + + 0 -1 1212 -2.6442000642418861e-02 + + -4.5397499203681946e-01 2.2462800145149231e-01 + <_> + + 0 -1 1213 -3.4429999068379402e-03 + + 1.3073000311851501e-01 -3.8622701168060303e-01 + <_> + + 0 -1 1214 1.0701700299978256e-01 + + 1.3158600032329559e-01 -7.9306900501251221e-01 + <_> + + 0 -1 1215 4.5152999460697174e-02 + + -2.5296801328659058e-01 4.0672400593757629e-01 + <_> + + 0 -1 1216 4.4349998235702515e-02 + + 2.2613000124692917e-02 7.9618102312088013e-01 + <_> + + 0 -1 1217 1.0839999886229634e-03 + + -3.9158400893211365e-01 1.1639100313186646e-01 + <_> + + 0 -1 1218 7.1433000266551971e-02 + + 8.2466997206211090e-02 1.2530590295791626e+00 + <_> + + 0 -1 1219 3.5838000476360321e-02 + + -1.8203300237655640e-01 7.7078700065612793e-01 + <_> + + 0 -1 1220 -2.0839000120759010e-02 + + -6.1744397878646851e-01 1.5891399979591370e-01 + <_> + + 0 -1 1221 4.2525801062583923e-01 + + -4.8978000879287720e-02 -1.8422030210494995e+00 + <_> + + 0 -1 1222 1.1408000253140926e-02 + + 1.7918199300765991e-01 -1.5383499860763550e-01 + <_> + + 0 -1 1223 -1.5364999882876873e-02 + + -8.4016501903533936e-01 -1.0280000278726220e-03 + <_> + + 0 -1 1224 -1.5212000347673893e-02 + + -1.8995699286460876e-01 1.7130999267101288e-01 + <_> + + 0 -1 1225 -1.8972000107169151e-02 + + -7.9541999101638794e-01 6.6800001077353954e-03 + <_> + + 0 -1 1226 -3.3330000005662441e-03 + + -2.3530800640583038e-01 2.4730099737644196e-01 + <_> + + 0 -1 1227 9.3248002231121063e-02 + + -5.4758001118898392e-02 -1.8324300050735474e+00 + <_> + + 0 -1 1228 -1.2555000372231007e-02 + + 2.6385200023651123e-01 -3.8526400923728943e-01 + <_> + + 0 -1 1229 -2.7070000767707825e-02 + + -6.6929799318313599e-01 2.0340999588370323e-02 + <_> + + 0 -1 1230 -2.3677000775933266e-02 + + 6.7265301942825317e-01 -1.4344000257551670e-02 + <_> + + 0 -1 1231 -1.4275000430643559e-02 + + 3.0186399817466736e-01 -2.8514400124549866e-01 + <_> + + 0 -1 1232 2.8096999973058701e-02 + + 1.4766000211238861e-01 -1.4078520536422729e+00 + <_> + + 0 -1 1233 5.0840001553297043e-02 + + -1.8613600730895996e-01 7.9953002929687500e-01 + <_> + + 0 -1 1234 1.1505999602377415e-02 + + 1.9118399918079376e-01 -8.5035003721714020e-02 + <_> + + 0 -1 1235 -1.4661000110208988e-02 + + 4.5239299535751343e-01 -2.2205199301242828e-01 + <_> + + 0 -1 1236 2.2842499613761902e-01 + + 1.3488399982452393e-01 -1.2894610166549683e+00 + <_> + + 0 -1 1237 1.1106900125741959e-01 + + -2.0753799378871918e-01 5.4561597108840942e-01 + <_> + + 0 -1 1238 3.2450000289827585e-03 + + 3.2053700089454651e-01 -1.6403500735759735e-01 + <_> + + 0 -1 1239 8.5309997200965881e-02 + + -2.0210500061511993e-01 5.3296798467636108e-01 + <_> + + 0 -1 1240 2.2048000246286392e-02 + + 1.5698599815368652e-01 -1.7014099657535553e-01 + <_> + + 0 -1 1241 -1.5676999464631081e-02 + + -6.2863498926162720e-01 4.0761999785900116e-02 + <_> + + 0 -1 1242 3.3112901449203491e-01 + + 1.6609300673007965e-01 -1.0326379537582397e+00 + <_> + + 0 -1 1243 8.8470000773668289e-03 + + -2.5076198577880859e-01 3.1660598516464233e-01 + <_> + + 0 -1 1244 4.6080000698566437e-02 + + 1.5352100133895874e-01 -1.6333500146865845e+00 + <_> + + 0 -1 1245 -3.7703000009059906e-02 + + 5.6873798370361328e-01 -2.0102599263191223e-01 + <_> + 159 + -3.5939640998840332e+00 + + <_> + + 0 -1 1246 -8.1808999180793762e-02 + + 5.7124799489974976e-01 -6.7438799142837524e-01 + <_> + + 0 -1 1247 2.1761199831962585e-01 + + -3.8610199093818665e-01 9.0343999862670898e-01 + <_> + + 0 -1 1248 1.4878000132739544e-02 + + 2.2241599857807159e-01 -1.2779350280761719e+00 + <_> + + 0 -1 1249 5.2434999495744705e-02 + + -2.8690400719642639e-01 7.5742298364639282e-01 + <_> + + 0 -1 1250 9.1429995372891426e-03 + + -6.4880400896072388e-01 2.2268800437450409e-01 + <_> + + 0 -1 1251 7.9169999808073044e-03 + + -2.9253599047660828e-01 3.1030198931694031e-01 + <_> + + 0 -1 1252 -2.6084000244736671e-02 + + 4.5532700419425964e-01 -3.8500601053237915e-01 + <_> + + 0 -1 1253 -2.9400000348687172e-03 + + -5.1264399290084839e-01 2.7432298660278320e-01 + <_> + + 0 -1 1254 5.7130001485347748e-02 + + 1.5788000077009201e-02 -1.2133100032806396e+00 + <_> + + 0 -1 1255 -6.1309998854994774e-03 + + 3.9174601435661316e-01 -3.0866798758506775e-01 + <_> + + 0 -1 1256 -4.0405001491308212e-02 + + 1.1901949644088745e+00 -2.0347100496292114e-01 + <_> + + 0 -1 1257 -2.0297000184655190e-02 + + -6.8239498138427734e-01 2.0458699762821198e-01 + <_> + + 0 -1 1258 -1.7188999801874161e-02 + + -8.4939897060394287e-01 3.8433000445365906e-02 + <_> + + 0 -1 1259 -2.4215999990701675e-02 + + -1.1039420366287231e+00 1.5975099802017212e-01 + <_> + + 0 -1 1260 5.6869000196456909e-02 + + -1.9595299661159515e-01 1.1806850433349609e+00 + <_> + + 0 -1 1261 3.6199999158270657e-04 + + -4.0847799181938171e-01 3.2938599586486816e-01 + <_> + + 0 -1 1262 9.9790003150701523e-03 + + -2.9673001170158386e-01 4.1547900438308716e-01 + <_> + + 0 -1 1263 -5.2625000476837158e-02 + + -1.3069299459457397e+00 1.7862600088119507e-01 + <_> + + 0 -1 1264 -1.3748999685049057e-02 + + 2.3665800690650940e-01 -4.4536599516868591e-01 + <_> + + 0 -1 1265 -3.0517000705003738e-02 + + 2.9018300771713257e-01 -1.1210100352764130e-01 + <_> + + 0 -1 1266 -3.0037501454353333e-01 + + -2.4237680435180664e+00 -4.2830999940633774e-02 + <_> + + 0 -1 1267 -3.5990998148918152e-02 + + 8.8206499814987183e-01 -4.7012999653816223e-02 + <_> + + 0 -1 1268 -5.5112000554800034e-02 + + 8.0119001865386963e-01 -2.0490999519824982e-01 + <_> + + 0 -1 1269 3.3762000501155853e-02 + + 1.4617599546909332e-01 -1.1349489688873291e+00 + <_> + + 0 -1 1270 -8.2710003480315208e-03 + + -8.1604897975921631e-01 1.8988000229001045e-02 + <_> + + 0 -1 1271 -5.4399999789893627e-03 + + -7.0980900526046753e-01 2.2343699634075165e-01 + <_> + + 0 -1 1272 3.1059999018907547e-03 + + -7.2808599472045898e-01 4.0224999189376831e-02 + <_> + + 0 -1 1273 5.3651999682188034e-02 + + 1.7170900106430054e-01 -1.1163710355758667e+00 + <_> + + 0 -1 1274 -1.2541399896144867e-01 + + 2.7680370807647705e+00 -1.4611500501632690e-01 + <_> + + 0 -1 1275 9.2542000114917755e-02 + + 1.1609800159931183e-01 -3.9635529518127441e+00 + <_> + + 0 -1 1276 3.8513999432325363e-02 + + -7.6399999670684338e-03 -9.8780900239944458e-01 + <_> + + 0 -1 1277 -2.0200000144541264e-03 + + 2.3059999942779541e-01 -7.4970299005508423e-01 + <_> + + 0 -1 1278 9.7599998116493225e-03 + + -3.1137999892234802e-01 3.0287799239158630e-01 + <_> + + 0 -1 1279 2.4095000699162483e-02 + + -4.9529999494552612e-02 5.2690100669860840e-01 + <_> + + 0 -1 1280 -1.7982000485062599e-02 + + -1.1610640287399292e+00 -5.7000000961124897e-03 + <_> + + 0 -1 1281 -1.0555000044405460e-02 + + -2.7189099788665771e-01 2.3597699403762817e-01 + <_> + + 0 -1 1282 -7.2889998555183411e-03 + + -5.4219102859497070e-01 8.1914000213146210e-02 + <_> + + 0 -1 1283 2.3939000442624092e-02 + + 1.7975799739360809e-01 -6.7049497365951538e-01 + <_> + + 0 -1 1284 -1.8365999683737755e-02 + + 6.2664300203323364e-01 -2.0970100164413452e-01 + <_> + + 0 -1 1285 1.5715999528765678e-02 + + 2.4193699657917023e-01 -1.0444309711456299e+00 + <_> + + 0 -1 1286 -4.8804000020027161e-02 + + -9.4060599803924561e-01 -3.7519999314099550e-03 + <_> + + 0 -1 1287 6.7130001261830330e-03 + + -7.5432002544403076e-02 6.1575299501419067e-01 + <_> + + 0 -1 1288 9.7770001739263535e-03 + + 3.9285000413656235e-02 -8.4810298681259155e-01 + <_> + + 0 -1 1289 1.4744999818503857e-02 + + 1.6968999803066254e-01 -5.0906401872634888e-01 + <_> + + 0 -1 1290 9.7079001367092133e-02 + + -3.3103000372648239e-02 -1.2706379890441895e+00 + <_> + + 0 -1 1291 4.8285998404026031e-02 + + 9.4329997897148132e-02 2.7203190326690674e+00 + <_> + + 0 -1 1292 9.7810002043843269e-03 + + -3.9533400535583496e-01 1.5363800525665283e-01 + <_> + + 0 -1 1293 -3.9893999695777893e-02 + + -2.2767400741577148e-01 1.3913999497890472e-01 + <_> + + 0 -1 1294 2.2848000749945641e-02 + + -2.7391999959945679e-01 3.4199500083923340e-01 + <_> + + 0 -1 1295 6.7179999314248562e-03 + + -1.0874299705028534e-01 4.8125401139259338e-01 + <_> + + 0 -1 1296 5.9599999338388443e-02 + + -4.9522001296281815e-02 -2.0117089748382568e+00 + <_> + + 0 -1 1297 6.9340001791715622e-03 + + 1.5037499368190765e-01 -1.1271899938583374e-01 + <_> + + 0 -1 1298 1.5757000073790550e-02 + + -2.0885000005364418e-02 -1.1651979684829712e+00 + <_> + + 0 -1 1299 -4.9690000712871552e-02 + + -8.0213499069213867e-01 1.4372299611568451e-01 + <_> + + 0 -1 1300 5.2347000688314438e-02 + + -2.0836700499057770e-01 6.1677598953247070e-01 + <_> + + 0 -1 1301 2.2430999204516411e-02 + + 2.0305900275707245e-01 -7.5326198339462280e-01 + <_> + + 0 -1 1302 4.1142001748085022e-02 + + -1.8118199706077576e-01 1.0033359527587891e+00 + <_> + + 0 -1 1303 -2.1632000803947449e-02 + + 4.9998998641967773e-01 -3.4662999212741852e-02 + <_> + + 0 -1 1304 -8.2808002829551697e-02 + + 1.1711900234222412e+00 -1.8433600664138794e-01 + <_> + + 0 -1 1305 8.5060000419616699e-03 + + -6.3225001096725464e-02 2.9024899005889893e-01 + <_> + + 0 -1 1306 7.8905001282691956e-02 + + -2.3274500668048859e-01 5.9695798158645630e-01 + <_> + + 0 -1 1307 -9.0207003057003021e-02 + + -8.2211899757385254e-01 1.7772200703620911e-01 + <_> + + 0 -1 1308 -2.9269000515341759e-02 + + 6.0860699415206909e-01 -2.1468900144100189e-01 + <_> + + 0 -1 1309 6.9499998353421688e-03 + + -4.2665999382734299e-02 6.0512101650238037e-01 + <_> + + 0 -1 1310 -8.0629996955394745e-03 + + -1.1508270502090454e+00 -2.7286000549793243e-02 + <_> + + 0 -1 1311 1.9595999270677567e-02 + + -9.1880001127719879e-03 5.6857800483703613e-01 + <_> + + 0 -1 1312 -1.4884999953210354e-02 + + 3.7658798694610596e-01 -2.7149501442909241e-01 + <_> + + 0 -1 1313 2.5217000395059586e-02 + + -9.9991001188755035e-02 2.4664700031280518e-01 + <_> + + 0 -1 1314 -1.5855999663472176e-02 + + 6.6826701164245605e-01 -2.0614700019359589e-01 + <_> + + 0 -1 1315 2.9441000893712044e-02 + + 1.5832200646400452e-01 -7.6060897111892700e-01 + <_> + + 0 -1 1316 -8.5279997438192368e-03 + + 3.8212299346923828e-01 -2.5407800078392029e-01 + <_> + + 0 -1 1317 2.4421999230980873e-02 + + 1.5105099976062775e-01 -2.8752899169921875e-01 + <_> + + 0 -1 1318 -3.3886998891830444e-02 + + -6.8002802133560181e-01 3.4327000379562378e-02 + <_> + + 0 -1 1319 -2.0810000132769346e-03 + + 2.5413900613784790e-01 -2.6859098672866821e-01 + <_> + + 0 -1 1320 3.0358999967575073e-02 + + -3.0842000618577003e-02 -1.1476809978485107e+00 + <_> + + 0 -1 1321 4.0210001170635223e-03 + + -3.5253798961639404e-01 2.9868099093437195e-01 + <_> + + 0 -1 1322 2.7681000530719757e-02 + + -3.8148999214172363e-02 -1.3262039422988892e+00 + <_> + + 0 -1 1323 7.9039996489882469e-03 + + -2.3737000301480293e-02 7.0503002405166626e-01 + <_> + + 0 -1 1324 4.4031001627445221e-02 + + 1.0674899816513062e-01 -4.5261201262474060e-01 + <_> + + 0 -1 1325 -3.2370999455451965e-02 + + 4.6674901247024536e-01 -6.1546999961137772e-02 + <_> + + 0 -1 1326 2.0933000370860100e-02 + + -2.8447899222373962e-01 4.3845599889755249e-01 + <_> + + 0 -1 1327 2.5227999314665794e-02 + + -2.2537000477313995e-02 7.0389097929000854e-01 + <_> + + 0 -1 1328 6.5520000644028187e-03 + + -3.2554900646209717e-01 2.4023699760437012e-01 + <_> + + 0 -1 1329 -5.8557998389005661e-02 + + -1.2227720022201538e+00 1.1668799817562103e-01 + <_> + + 0 -1 1330 3.1899999827146530e-02 + + -1.9305000081658363e-02 -1.0973169803619385e+00 + <_> + + 0 -1 1331 -3.0445000156760216e-02 + + 6.5582501888275146e-01 7.5090996921062469e-02 + <_> + + 0 -1 1332 1.4933000318706036e-02 + + -5.2155798673629761e-01 1.1523099988698959e-01 + <_> + + 0 -1 1333 -4.9008000642061234e-02 + + -7.8303998708724976e-01 1.6657200455665588e-01 + <_> + + 0 -1 1334 8.3158999681472778e-02 + + -2.6879999786615372e-03 -8.5282301902770996e-01 + <_> + + 0 -1 1335 2.3902999237179756e-02 + + -5.1010999828577042e-02 4.1999098658561707e-01 + <_> + + 0 -1 1336 1.6428999602794647e-02 + + 1.9232999533414841e-02 -6.5049099922180176e-01 + <_> + + 0 -1 1337 -1.1838000267744064e-02 + + -6.2409800291061401e-01 1.5411199629306793e-01 + <_> + + 0 -1 1338 -1.6799999866634607e-04 + + 1.7589199542999268e-01 -3.4338700771331787e-01 + <_> + + 0 -1 1339 1.9193999469280243e-02 + + 4.3418999761343002e-02 7.9069197177886963e-01 + <_> + + 0 -1 1340 -1.0032000020146370e-02 + + 4.5648899674415588e-01 -2.2494800388813019e-01 + <_> + + 0 -1 1341 -1.4004000462591648e-02 + + 3.3570998907089233e-01 -4.8799999058246613e-03 + <_> + + 0 -1 1342 -1.0319899767637253e-01 + + -2.3378000259399414e+00 -5.8933001011610031e-02 + <_> + + 0 -1 1343 -9.5697000622749329e-02 + + -6.6153901815414429e-01 2.0098599791526794e-01 + <_> + + 0 -1 1344 -4.1480999439954758e-02 + + 4.5939201116561890e-01 -2.2314099967479706e-01 + <_> + + 0 -1 1345 2.4099999573081732e-03 + + -2.6898598670959473e-01 2.4922999739646912e-01 + <_> + + 0 -1 1346 1.0724999755620956e-01 + + -1.8640199303627014e-01 7.2769802808761597e-01 + <_> + + 0 -1 1347 3.1870000530034304e-03 + + -2.4608999490737915e-02 2.8643900156021118e-01 + <_> + + 0 -1 1348 2.9167000204324722e-02 + + -3.4683000296354294e-02 -1.1162580251693726e+00 + <_> + + 0 -1 1349 1.1287000030279160e-02 + + 6.3760001212358475e-03 6.6632097959518433e-01 + <_> + + 0 -1 1350 -1.2001000344753265e-02 + + 4.2420101165771484e-01 -2.6279801130294800e-01 + <_> + + 0 -1 1351 -1.2695999816060066e-02 + + -2.1957000717520714e-02 1.8936799466609955e-01 + <_> + + 0 -1 1352 2.4597000330686569e-02 + + -3.4963998943567276e-02 -1.0989320278167725e+00 + <_> + + 0 -1 1353 4.5953001827001572e-02 + + 1.1109799891710281e-01 -2.9306049346923828e+00 + <_> + + 0 -1 1354 -2.7241000905632973e-02 + + 2.9101699590682983e-01 -2.7407899498939514e-01 + <_> + + 0 -1 1355 4.0063999593257904e-02 + + 1.1877900362014771e-01 -6.2801802158355713e-01 + <_> + + 0 -1 1356 2.3055000230669975e-02 + + 1.4813800156116486e-01 -3.7007498741149902e-01 + <_> + + 0 -1 1357 -2.3737000301480293e-02 + + -5.3724801540374756e-01 1.9358199834823608e-01 + <_> + + 0 -1 1358 7.7522002160549164e-02 + + -6.0194000601768494e-02 -1.9489669799804688e+00 + <_> + + 0 -1 1359 -1.3345000334084034e-02 + + -4.5229598879814148e-01 1.8741500377655029e-01 + <_> + + 0 -1 1360 -2.1719999611377716e-02 + + 1.2144249677658081e+00 -1.5365800261497498e-01 + <_> + + 0 -1 1361 -7.1474999189376831e-02 + + -2.3047130107879639e+00 1.0999900102615356e-01 + <_> + + 0 -1 1362 -5.4999999701976776e-03 + + -7.1855199337005615e-01 2.0100999623537064e-02 + <_> + + 0 -1 1363 2.6740999892354012e-02 + + 7.3545001447200775e-02 9.8786002397537231e-01 + <_> + + 0 -1 1364 -3.9407998323440552e-02 + + -1.2227380275726318e+00 -4.3506998568773270e-02 + <_> + + 0 -1 1365 2.5888999924063683e-02 + + 1.3409300148487091e-01 -1.1770780086517334e+00 + <_> + + 0 -1 1366 4.8925001174211502e-02 + + -3.0810000374913216e-02 -9.3479502201080322e-01 + <_> + + 0 -1 1367 3.6892998963594437e-02 + + 1.3333700597286224e-01 -1.4998290538787842e+00 + <_> + + 0 -1 1368 7.8929997980594635e-02 + + -1.4538800716400146e-01 1.5631790161132812e+00 + <_> + + 0 -1 1369 2.9006000608205795e-02 + + 1.9383700191974640e-01 -6.7642802000045776e-01 + <_> + + 0 -1 1370 6.3089998438954353e-03 + + -3.7465399503707886e-01 1.0857500135898590e-01 + <_> + + 0 -1 1371 -6.5830998122692108e-02 + + 8.1059402227401733e-01 3.0201999470591545e-02 + <_> + + 0 -1 1372 -6.8965002894401550e-02 + + 8.3772599697113037e-01 -1.7140999436378479e-01 + <_> + + 0 -1 1373 -1.1669100075960159e-01 + + -9.4647198915481567e-01 1.3123199343681335e-01 + <_> + + 0 -1 1374 -1.3060000492259860e-03 + + 4.6007998287677765e-02 -5.2011597156524658e-01 + <_> + + 0 -1 1375 -4.4558998197317123e-02 + + -1.9423669576644897e+00 1.3200700283050537e-01 + <_> + + 0 -1 1376 5.1033001393079758e-02 + + -2.1480999886989594e-01 4.8673900961875916e-01 + <_> + + 0 -1 1377 -3.1578000634908676e-02 + + 5.9989798069000244e-01 7.9159997403621674e-03 + <_> + + 0 -1 1378 2.1020000800490379e-02 + + -2.2069500386714935e-01 5.4046201705932617e-01 + <_> + + 0 -1 1379 -1.3824200630187988e-01 + + 6.2957501411437988e-01 -2.1712999790906906e-02 + <_> + + 0 -1 1380 5.2228998392820358e-02 + + -2.3360900580883026e-01 4.9760800600051880e-01 + <_> + + 0 -1 1381 2.5884000584483147e-02 + + 1.8041999638080597e-01 -2.2039200365543365e-01 + <_> + + 0 -1 1382 -1.2138999998569489e-02 + + -6.9731897115707397e-01 1.5712000429630280e-02 + <_> + + 0 -1 1383 -2.4237999692559242e-02 + + 3.4593299031257629e-01 7.1469999849796295e-02 + <_> + + 0 -1 1384 -2.5272000581026077e-02 + + -8.7583297491073608e-01 -9.8240002989768982e-03 + <_> + + 0 -1 1385 1.2597000226378441e-02 + + 2.3649999499320984e-01 -2.8731200098991394e-01 + <_> + + 0 -1 1386 5.7330999523401260e-02 + + -6.1530999839305878e-02 -2.2326040267944336e+00 + <_> + + 0 -1 1387 1.6671000048518181e-02 + + -1.9850100576877594e-01 4.0810701251029968e-01 + <_> + + 0 -1 1388 -2.2818999364972115e-02 + + 9.6487599611282349e-01 -2.0245699584484100e-01 + <_> + + 0 -1 1389 3.7000001611886546e-05 + + -5.8908998966217041e-02 2.7055400609970093e-01 + <_> + + 0 -1 1390 -7.6700001955032349e-03 + + -4.5317101478576660e-01 8.9628003537654877e-02 + <_> + + 0 -1 1391 9.4085998833179474e-02 + + 1.1604599654674530e-01 -1.0951169729232788e+00 + <_> + + 0 -1 1392 -6.2267001718282700e-02 + + 1.8096530437469482e+00 -1.4773200452327728e-01 + <_> + + 0 -1 1393 1.7416000366210938e-02 + + 2.3068200051784515e-01 -4.2417600750923157e-01 + <_> + + 0 -1 1394 -2.2066000849008560e-02 + + 4.9270299077033997e-01 -2.0630900561809540e-01 + <_> + + 0 -1 1395 -1.0404000058770180e-02 + + 6.0924297571182251e-01 2.8130000457167625e-02 + <_> + + 0 -1 1396 -9.3670003116130829e-03 + + 4.0171200037002563e-01 -2.1681700646877289e-01 + <_> + + 0 -1 1397 -2.9039999470114708e-02 + + -8.4876501560211182e-01 1.4246800541877747e-01 + <_> + + 0 -1 1398 -2.1061999723315239e-02 + + -7.9198300838470459e-01 -1.2595999985933304e-02 + <_> + + 0 -1 1399 -3.7000998854637146e-02 + + -6.7488902807235718e-01 1.2830400466918945e-01 + <_> + + 0 -1 1400 1.0735999792814255e-02 + + 3.6779999732971191e-02 -6.3393002748489380e-01 + <_> + + 0 -1 1401 1.6367599368095398e-01 + + 1.3803899288177490e-01 -4.7189000248908997e-01 + <_> + + 0 -1 1402 9.4917997717857361e-02 + + -1.3855700194835663e-01 1.9492419958114624e+00 + <_> + + 0 -1 1403 3.5261999815702438e-02 + + 1.3721899688243866e-01 -2.1186530590057373e+00 + <_> + + 0 -1 1404 1.2811000458896160e-02 + + -2.0008100569248199e-01 4.9507799744606018e-01 + <_> + 155 + -3.3933560848236084e+00 + + <_> + + 0 -1 1405 1.3904400169849396e-01 + + -4.6581199765205383e-01 7.6431602239608765e-01 + <_> + + 0 -1 1406 1.1916999705135822e-02 + + -9.4398999214172363e-01 3.9726299047470093e-01 + <_> + + 0 -1 1407 -1.0006999596953392e-02 + + 3.2718798518180847e-01 -6.3367402553558350e-01 + <_> + + 0 -1 1408 -6.0479999519884586e-03 + + 2.7427899837493896e-01 -5.7446998357772827e-01 + <_> + + 0 -1 1409 -1.2489999644458294e-03 + + 2.3629300296306610e-01 -6.8593502044677734e-01 + <_> + + 0 -1 1410 3.2382000237703323e-02 + + -5.7630199193954468e-01 2.7492699027061462e-01 + <_> + + 0 -1 1411 -1.3957999646663666e-02 + + -6.1061501502990723e-01 2.4541600048542023e-01 + <_> + + 0 -1 1412 1.1159999994561076e-03 + + -5.6539100408554077e-01 2.7179300785064697e-01 + <_> + + 0 -1 1413 2.7000000045518391e-05 + + -8.0235999822616577e-01 1.1509100347757339e-01 + <_> + + 0 -1 1414 -2.5700000696815550e-04 + + -8.1205898523330688e-01 2.3844699561595917e-01 + <_> + + 0 -1 1415 4.0460000745952129e-03 + + 1.3909600675106049e-01 -6.6163200139999390e-01 + <_> + + 0 -1 1416 1.4356000348925591e-02 + + -1.6485199332237244e-01 4.1901698708534241e-01 + <_> + + 0 -1 1417 -5.5374998599290848e-02 + + 1.4425870180130005e+00 -1.8820199370384216e-01 + <_> + + 0 -1 1418 9.3594998121261597e-02 + + 1.3548299670219421e-01 -9.1636097431182861e-01 + <_> + + 0 -1 1419 2.6624999940395355e-02 + + -3.3748298883438110e-01 3.9233601093292236e-01 + <_> + + 0 -1 1420 3.7469998933374882e-03 + + -1.1615400016307831e-01 4.4399300217628479e-01 + <_> + + 0 -1 1421 -3.1886000186204910e-02 + + -9.9498301744461060e-01 1.6120000509545207e-03 + <_> + + 0 -1 1422 -2.2600000724196434e-02 + + -4.8067399859428406e-01 1.7007300257682800e-01 + <_> + + 0 -1 1423 2.5202000513672829e-02 + + 3.5580001771450043e-02 -8.0215400457382202e-01 + <_> + + 0 -1 1424 -3.1036999076604843e-02 + + -1.0895340442657471e+00 1.8081900477409363e-01 + <_> + + 0 -1 1425 -2.6475999504327774e-02 + + 9.5671200752258301e-01 -2.1049399673938751e-01 + <_> + + 0 -1 1426 -1.3853999786078930e-02 + + -1.0370320081710815e+00 2.2166700661182404e-01 + <_> + + 0 -1 1427 -6.2925003468990326e-02 + + 9.0199398994445801e-01 -1.9085299968719482e-01 + <_> + + 0 -1 1428 -4.4750999659299850e-02 + + -1.0119110345840454e+00 1.4691199362277985e-01 + <_> + + 0 -1 1429 -2.0428000018000603e-02 + + 6.1624497175216675e-01 -2.3552699387073517e-01 + <_> + + 0 -1 1430 -8.0329999327659607e-03 + + -8.3279997110366821e-02 2.1728700399398804e-01 + <_> + + 0 -1 1431 8.7280003353953362e-03 + + 6.5458998084068298e-02 -6.0318702459335327e-01 + <_> + + 0 -1 1432 -2.7202000841498375e-02 + + -9.3447399139404297e-01 1.5270000696182251e-01 + <_> + + 0 -1 1433 -1.6471000388264656e-02 + + -8.4177100658416748e-01 1.3332000002264977e-02 + <_> + + 0 -1 1434 -1.3744000345468521e-02 + + 6.0567200183868408e-01 -9.2021003365516663e-02 + <_> + + 0 -1 1435 2.9164999723434448e-02 + + -2.8114000335335732e-02 -1.4014569520950317e+00 + <_> + + 0 -1 1436 3.7457000464200974e-02 + + 1.3080599904060364e-01 -4.9382498860359192e-01 + <_> + + 0 -1 1437 -2.5070000439882278e-02 + + -1.1289390325546265e+00 -1.4600000344216824e-02 + <_> + + 0 -1 1438 -6.3812002539634705e-02 + + 7.5871598720550537e-01 -1.8200000049546361e-03 + <_> + + 0 -1 1439 -9.3900002539157867e-03 + + 2.9936400055885315e-01 -2.9487800598144531e-01 + <_> + + 0 -1 1440 -7.6000002445653081e-04 + + 1.9725000485777855e-02 1.9993899762630463e-01 + <_> + + 0 -1 1441 -2.1740999072790146e-02 + + -8.5247898101806641e-01 4.9169998615980148e-02 + <_> + + 0 -1 1442 -1.7869999632239342e-02 + + -5.9985999017953873e-02 1.5222500264644623e-01 + <_> + + 0 -1 1443 -2.4831000715494156e-02 + + 3.5603401064872742e-01 -2.6259899139404297e-01 + <_> + + 0 -1 1444 1.5715500712394714e-01 + + 1.5599999460391700e-04 1.0428730249404907e+00 + <_> + + 0 -1 1445 6.9026999175548553e-02 + + -3.3006999641656876e-02 -1.1796669960021973e+00 + <_> + + 0 -1 1446 -1.1021999642252922e-02 + + 5.8987700939178467e-01 -5.7647999376058578e-02 + <_> + + 0 -1 1447 -1.3834999874234200e-02 + + 5.9502798318862915e-01 -2.4418599903583527e-01 + <_> + + 0 -1 1448 -3.0941000208258629e-02 + + -1.1723799705505371e+00 1.6907000541687012e-01 + <_> + + 0 -1 1449 2.1258000284433365e-02 + + -1.8900999799370766e-02 -1.0684759616851807e+00 + <_> + + 0 -1 1450 9.3079999089241028e-02 + + 1.6305600106716156e-01 -1.3375270366668701e+00 + <_> + + 0 -1 1451 2.9635999351739883e-02 + + -2.2524799406528473e-01 4.5400100946426392e-01 + <_> + + 0 -1 1452 -1.2199999764561653e-04 + + 2.7409100532531738e-01 -3.7371399998664856e-01 + <_> + + 0 -1 1453 -4.2098000645637512e-02 + + -7.5828802585601807e-01 1.7137000337243080e-02 + <_> + + 0 -1 1454 -2.2505000233650208e-02 + + -2.2759300470352173e-01 2.3698699474334717e-01 + <_> + + 0 -1 1455 -1.2862999923527241e-02 + + 1.9252400100231171e-01 -3.2127100229263306e-01 + <_> + + 0 -1 1456 2.7860000729560852e-02 + + 1.6723699867725372e-01 -1.0209059715270996e+00 + <_> + + 0 -1 1457 -2.7807999402284622e-02 + + 1.2824759483337402e+00 -1.7225299775600433e-01 + <_> + + 0 -1 1458 -6.1630001291632652e-03 + + -5.4072898626327515e-01 2.3885700106620789e-01 + <_> + + 0 -1 1459 -2.0436000078916550e-02 + + 6.3355398178100586e-01 -2.1090599894523621e-01 + <_> + + 0 -1 1460 -1.2307999655604362e-02 + + -4.9778199195861816e-01 1.7402599751949310e-01 + <_> + + 0 -1 1461 -4.0493998676538467e-02 + + -1.1848740577697754e+00 -3.3890999853610992e-02 + <_> + + 0 -1 1462 2.9657000675797462e-02 + + 2.1740999072790146e-02 1.0069919824600220e+00 + <_> + + 0 -1 1463 6.8379999138414860e-03 + + 2.9217999428510666e-02 -5.9906297922134399e-01 + <_> + + 0 -1 1464 1.6164999455213547e-02 + + -2.1000799536705017e-01 3.7637299299240112e-01 + <_> + + 0 -1 1465 5.0193000584840775e-02 + + 2.5319999549537897e-03 -7.1668201684951782e-01 + <_> + + 0 -1 1466 1.9680000841617584e-03 + + -2.1921400725841522e-01 3.2298699021339417e-01 + <_> + + 0 -1 1467 2.4979999288916588e-02 + + -9.6840001642704010e-03 -7.7572900056838989e-01 + <_> + + 0 -1 1468 -1.5809999778866768e-02 + + 4.4637501239776611e-01 -6.1760000884532928e-02 + <_> + + 0 -1 1469 3.7206999957561493e-02 + + -2.0495399832725525e-01 5.7722198963165283e-01 + <_> + + 0 -1 1470 -7.9264998435974121e-02 + + -7.6745402812957764e-01 1.2550400197505951e-01 + <_> + + 0 -1 1471 -1.7152000218629837e-02 + + -1.4121830463409424e+00 -5.1704000681638718e-02 + <_> + + 0 -1 1472 3.2740000635385513e-02 + + 1.9334000349044800e-01 -6.3633698225021362e-01 + <_> + + 0 -1 1473 -1.1756999790668488e-01 + + 8.4325402975082397e-01 -1.8018600344657898e-01 + <_> + + 0 -1 1474 1.2057200074195862e-01 + + 1.2530000507831573e-01 -2.1213600635528564e+00 + <_> + + 0 -1 1475 4.2779999785125256e-03 + + -4.6604400873184204e-01 8.9643999934196472e-02 + <_> + + 0 -1 1476 -7.2544999420642853e-02 + + 5.1826500892639160e-01 1.6823999583721161e-02 + <_> + + 0 -1 1477 1.7710599303245544e-01 + + -3.0910000205039978e-02 -1.1046639680862427e+00 + <_> + + 0 -1 1478 8.4229996427893639e-03 + + 2.4445800483226776e-01 -3.8613098859786987e-01 + <_> + + 0 -1 1479 -1.3035000301897526e-02 + + 9.8004400730133057e-01 -1.7016500234603882e-01 + <_> + + 0 -1 1480 1.8912000581622124e-02 + + 2.0248499512672424e-01 -3.8545900583267212e-01 + <_> + + 0 -1 1481 2.1447999402880669e-02 + + -2.5717198848724365e-01 3.5181200504302979e-01 + <_> + + 0 -1 1482 6.3357003033161163e-02 + + 1.6994799673557281e-01 -9.1383802890777588e-01 + <_> + + 0 -1 1483 -3.2435998320579529e-02 + + -8.5681599378585815e-01 -2.1680999547243118e-02 + <_> + + 0 -1 1484 -2.3564999923110008e-02 + + 5.6115597486495972e-01 -2.2400000307243317e-04 + <_> + + 0 -1 1485 1.8789000809192657e-02 + + -2.5459799170494080e-01 3.4512901306152344e-01 + <_> + + 0 -1 1486 3.1042000278830528e-02 + + 7.5719999149441719e-03 3.4800198674201965e-01 + <_> + + 0 -1 1487 -1.1226999573409557e-02 + + -6.0219800472259521e-01 4.2814999818801880e-02 + <_> + + 0 -1 1488 -1.2845999561250210e-02 + + 4.2020401358604431e-01 -5.3801000118255615e-02 + <_> + + 0 -1 1489 -1.2791999615728855e-02 + + 2.2724500298500061e-01 -3.2398000359535217e-01 + <_> + + 0 -1 1490 6.8651996552944183e-02 + + 9.3532003462314606e-02 10. + <_> + + 0 -1 1491 5.2789999172091484e-03 + + -2.6926299929618835e-01 3.3303201198577881e-01 + <_> + + 0 -1 1492 -3.8779001682996750e-02 + + -7.2365301847457886e-01 1.7806500196456909e-01 + <_> + + 0 -1 1493 6.1820000410079956e-03 + + -3.5119399428367615e-01 1.6586300730705261e-01 + <_> + + 0 -1 1494 1.7515200376510620e-01 + + 1.1623100191354752e-01 -1.5419290065765381e+00 + <_> + + 0 -1 1495 1.1627999693155289e-01 + + -9.1479998081922531e-03 -9.9842602014541626e-01 + <_> + + 0 -1 1496 -2.2964000701904297e-02 + + 2.0565399527549744e-01 1.5432000160217285e-02 + <_> + + 0 -1 1497 -5.1410000771284103e-02 + + 5.8072400093078613e-01 -2.0118400454521179e-01 + <_> + + 0 -1 1498 2.2474199533462524e-01 + + 1.8728999421000481e-02 1.0829299688339233e+00 + <_> + + 0 -1 1499 9.4860000535845757e-03 + + -3.3171299099922180e-01 1.9902999699115753e-01 + <_> + + 0 -1 1500 -1.1846300214529037e-01 + + 1.3711010217666626e+00 6.8926997482776642e-02 + <_> + + 0 -1 1501 3.7810999900102615e-02 + + -9.3600002583116293e-04 -8.3996999263763428e-01 + <_> + + 0 -1 1502 2.2202000021934509e-02 + + -1.1963999830186367e-02 3.6673998832702637e-01 + <_> + + 0 -1 1503 -3.6366000771522522e-02 + + 3.7866500020027161e-01 -2.7714800834655762e-01 + <_> + + 0 -1 1504 -1.3184699416160583e-01 + + -2.7481179237365723e+00 1.0666900128126144e-01 + <_> + + 0 -1 1505 -4.1655998677015305e-02 + + 4.7524300217628479e-01 -2.3249800503253937e-01 + <_> + + 0 -1 1506 -3.3151999115943909e-02 + + -5.7929402589797974e-01 1.7434400320053101e-01 + <_> + + 0 -1 1507 1.5769999474287033e-02 + + -1.1284000240266323e-02 -8.3701401948928833e-01 + <_> + + 0 -1 1508 -3.9363000541925430e-02 + + 3.4821599721908569e-01 -1.7455400526523590e-01 + <_> + + 0 -1 1509 -6.7849002778530121e-02 + + 1.4225699901580811e+00 -1.4765599370002747e-01 + <_> + + 0 -1 1510 -2.6775000616908073e-02 + + 2.3947000503540039e-01 1.3271999545395374e-02 + <_> + + 0 -1 1511 3.9919000118970871e-02 + + -8.9999996125698090e-03 -7.5938898324966431e-01 + <_> + + 0 -1 1512 1.0065600275993347e-01 + + -1.8685000017285347e-02 7.6245301961898804e-01 + <_> + + 0 -1 1513 -8.1022001802921295e-02 + + -9.0439099073410034e-01 -8.5880002006888390e-03 + <_> + + 0 -1 1514 -2.1258000284433365e-02 + + -2.1319599449634552e-01 2.1919700503349304e-01 + <_> + + 0 -1 1515 -1.0630999691784382e-02 + + 1.9598099589347839e-01 -3.5768100619316101e-01 + <_> + + 0 -1 1516 8.1300002057105303e-04 + + -9.2794999480247498e-02 2.6145899295806885e-01 + <_> + + 0 -1 1517 3.4650000743567944e-03 + + -5.5336099863052368e-01 2.7386000379920006e-02 + <_> + + 0 -1 1518 1.8835999071598053e-02 + + 1.8446099758148193e-01 -6.6934299468994141e-01 + <_> + + 0 -1 1519 -2.5631999596953392e-02 + + 1.9382879734039307e+00 -1.4708900451660156e-01 + <_> + + 0 -1 1520 -4.0939999744296074e-03 + + -2.6451599597930908e-01 2.0733200013637543e-01 + <_> + + 0 -1 1521 -8.9199998183175921e-04 + + -5.5031597614288330e-01 5.0374999642372131e-02 + <_> + + 0 -1 1522 -4.9518000334501266e-02 + + -2.5615389347076416e+00 1.3141700625419617e-01 + <_> + + 0 -1 1523 1.1680999770760536e-02 + + -2.4819800257682800e-01 3.9982700347900391e-01 + <_> + + 0 -1 1524 3.4563999623060226e-02 + + 1.6178800165653229e-01 -7.1418899297714233e-01 + <_> + + 0 -1 1525 -8.2909995689988136e-03 + + 2.2180099785327911e-01 -2.9181700944900513e-01 + <_> + + 0 -1 1526 -2.2358000278472900e-02 + + 3.1044098734855652e-01 -2.7280000504106283e-03 + <_> + + 0 -1 1527 -3.0801000073552132e-02 + + -9.5672702789306641e-01 -8.3400001749396324e-03 + <_> + + 0 -1 1528 4.3779000639915466e-02 + + 1.2556900084018707e-01 -1.1759619712829590e+00 + <_> + + 0 -1 1529 4.3046001344919205e-02 + + -5.8876998722553253e-02 -1.8568470478057861e+00 + <_> + + 0 -1 1530 2.7188999578356743e-02 + + 4.2858000844717026e-02 3.9036700129508972e-01 + <_> + + 0 -1 1531 9.4149997457861900e-03 + + -4.3567001819610596e-02 -1.1094470024108887e+00 + <_> + + 0 -1 1532 9.4311997294425964e-02 + + 4.0256999433040619e-02 9.8442298173904419e-01 + <_> + + 0 -1 1533 1.7025099694728851e-01 + + 2.9510000720620155e-02 -6.9509297609329224e-01 + <_> + + 0 -1 1534 -4.7148000448942184e-02 + + 1.0338569879531860e+00 6.7602001130580902e-02 + <_> + + 0 -1 1535 1.1186300218105316e-01 + + -6.8682998418807983e-02 -2.4985830783843994e+00 + <_> + + 0 -1 1536 -1.4353999868035316e-02 + + -5.9481900930404663e-01 1.5001699328422546e-01 + <_> + + 0 -1 1537 3.4024000167846680e-02 + + -6.4823001623153687e-02 -2.1382639408111572e+00 + <_> + + 0 -1 1538 2.1601999178528786e-02 + + 5.5309999734163284e-02 7.8292900323867798e-01 + <_> + + 0 -1 1539 2.1771999076008797e-02 + + -7.1279997937381268e-03 -7.2148102521896362e-01 + <_> + + 0 -1 1540 8.2416996359825134e-02 + + 1.4609499275684357e-01 -1.3636670112609863e+00 + <_> + + 0 -1 1541 8.4671996533870697e-02 + + -1.7784699797630310e-01 7.2857701778411865e-01 + <_> + + 0 -1 1542 -5.5128000676631927e-02 + + -5.9402400255203247e-01 1.9357800483703613e-01 + <_> + + 0 -1 1543 -6.4823001623153687e-02 + + -1.0783840417861938e+00 -4.0734000504016876e-02 + <_> + + 0 -1 1544 -2.2769000381231308e-02 + + 7.7900201082229614e-01 3.4960000775754452e-03 + <_> + + 0 -1 1545 5.4756000638008118e-02 + + -6.5683998167514801e-02 -1.8188409805297852e+00 + <_> + + 0 -1 1546 -8.9000001025851816e-05 + + -1.7891999334096909e-02 2.0768299698829651e-01 + <_> + + 0 -1 1547 9.8361998796463013e-02 + + -5.5946998298168182e-02 -1.4153920412063599e+00 + <_> + + 0 -1 1548 -7.0930002257227898e-03 + + 3.4135299921035767e-01 -1.2089899927377701e-01 + <_> + + 0 -1 1549 5.0278000533580780e-02 + + -2.6286700367927551e-01 2.5797298550605774e-01 + <_> + + 0 -1 1550 -5.7870000600814819e-03 + + -1.3178600370883942e-01 1.7350199818611145e-01 + <_> + + 0 -1 1551 1.3973999768495560e-02 + + 2.8518000617623329e-02 -6.1152201890945435e-01 + <_> + + 0 -1 1552 2.1449999883770943e-02 + + 2.6181999593973160e-02 3.0306598544120789e-01 + <_> + + 0 -1 1553 -2.9214000329375267e-02 + + 4.4940599799156189e-01 -2.2803099453449249e-01 + <_> + + 0 -1 1554 4.8099999548867345e-04 + + -1.9879999756813049e-01 2.0744499564170837e-01 + <_> + + 0 -1 1555 1.7109999898821115e-03 + + -5.4037201404571533e-01 6.7865997552871704e-02 + <_> + + 0 -1 1556 8.6660003289580345e-03 + + -1.3128000311553478e-02 5.2297902107238770e-01 + <_> + + 0 -1 1557 6.3657999038696289e-02 + + 6.8299002945423126e-02 -4.9235099554061890e-01 + <_> + + 0 -1 1558 -2.7968000620603561e-02 + + 6.8183898925781250e-01 7.8781001269817352e-02 + <_> + + 0 -1 1559 4.8953998833894730e-02 + + -2.0622399449348450e-01 5.0388097763061523e-01 + <_> + 169 + -3.2396929264068604e+00 + + <_> + + 0 -1 1560 -2.9312999919056892e-02 + + 7.1284699440002441e-01 -5.8230698108673096e-01 + <_> + + 0 -1 1561 1.2415099889039993e-01 + + -3.6863499879837036e-01 6.0067200660705566e-01 + <_> + + 0 -1 1562 7.9349996522068977e-03 + + -8.6008298397064209e-01 2.1724699437618256e-01 + <_> + + 0 -1 1563 3.0365999788045883e-02 + + -2.7186998724937439e-01 6.1247897148132324e-01 + <_> + + 0 -1 1564 2.5218000635504723e-02 + + -3.4748300909996033e-01 5.0427699089050293e-01 + <_> + + 0 -1 1565 1.0014000348746777e-02 + + -3.1898999214172363e-01 4.1376799345016479e-01 + <_> + + 0 -1 1566 -1.6775000840425491e-02 + + -6.9048100709915161e-01 9.4830997288227081e-02 + <_> + + 0 -1 1567 -2.6950000319629908e-03 + + -2.0829799771308899e-01 2.3737199604511261e-01 + <_> + + 0 -1 1568 4.2257998138666153e-02 + + -4.9366700649261475e-01 1.8170599639415741e-01 + <_> + + 0 -1 1569 -4.8505000770092010e-02 + + 1.3429640531539917e+00 3.9769001305103302e-02 + <_> + + 0 -1 1570 2.8992999345064163e-02 + + 4.6496000140905380e-02 -8.1643497943878174e-01 + <_> + + 0 -1 1571 -4.0089000016450882e-02 + + -7.1197801828384399e-01 2.2553899884223938e-01 + <_> + + 0 -1 1572 -4.1021998971700668e-02 + + 1.0057929754257202e+00 -1.9690200686454773e-01 + <_> + + 0 -1 1573 1.1838000267744064e-02 + + -1.2600000016391277e-02 8.0767101049423218e-01 + <_> + + 0 -1 1574 -2.1328000351786613e-02 + + -8.2023900747299194e-01 2.0524999126791954e-02 + <_> + + 0 -1 1575 -2.3904999718070030e-02 + + 5.4210501909255981e-01 -7.4767000973224640e-02 + <_> + + 0 -1 1576 1.8008999526500702e-02 + + -3.3827701210975647e-01 4.2358601093292236e-01 + <_> + + 0 -1 1577 -4.3614000082015991e-02 + + -1.1983489990234375e+00 1.5566200017929077e-01 + <_> + + 0 -1 1578 -9.2449998483061790e-03 + + -8.9029997587203979e-01 1.1003999970853329e-02 + <_> + + 0 -1 1579 4.7485001385211945e-02 + + 1.6664099693298340e-01 -9.0764498710632324e-01 + <_> + + 0 -1 1580 -1.4233999885618687e-02 + + 6.2695199251174927e-01 -2.5791200995445251e-01 + <_> + + 0 -1 1581 3.8010000716894865e-03 + + -2.8229999542236328e-01 2.6624599099159241e-01 + <_> + + 0 -1 1582 3.4330000635236502e-03 + + -6.3771998882293701e-01 9.8422996699810028e-02 + <_> + + 0 -1 1583 -2.9221000149846077e-02 + + -7.6769900321960449e-01 2.2634500265121460e-01 + <_> + + 0 -1 1584 -6.4949998632073402e-03 + + 4.5600101351737976e-01 -2.6528900861740112e-01 + <_> + + 0 -1 1585 -3.0034000054001808e-02 + + -7.6551097631454468e-01 1.4009299874305725e-01 + <_> + + 0 -1 1586 7.8360000625252724e-03 + + 4.6755999326705933e-02 -7.2356200218200684e-01 + <_> + + 0 -1 1587 8.8550001382827759e-03 + + -4.9141999334096909e-02 5.1472699642181396e-01 + <_> + + 0 -1 1588 9.5973998308181763e-02 + + -2.0068999379873276e-02 -1.0850950479507446e+00 + <_> + + 0 -1 1589 -3.2876998186111450e-02 + + -9.5875298976898193e-01 1.4543600380420685e-01 + <_> + + 0 -1 1590 -1.3384000398218632e-02 + + -7.0013600587844849e-01 2.9157999902963638e-02 + <_> + + 0 -1 1591 1.5235999599099159e-02 + + -2.8235700726509094e-01 2.5367999076843262e-01 + <_> + + 0 -1 1592 1.2054000049829483e-02 + + -2.5303399562835693e-01 4.6526700258255005e-01 + <_> + + 0 -1 1593 -7.6295003294944763e-02 + + -6.9915801286697388e-01 1.3217200338840485e-01 + <_> + + 0 -1 1594 -1.2040000408887863e-02 + + 4.5894598960876465e-01 -2.3856499791145325e-01 + <_> + + 0 -1 1595 2.1916000172495842e-02 + + 1.8268600106239319e-01 -6.1629700660705566e-01 + <_> + + 0 -1 1596 -2.7330000884830952e-03 + + -6.3257902860641479e-01 3.4219000488519669e-02 + <_> + + 0 -1 1597 -4.8652000725269318e-02 + + -1.0297729969024658e+00 1.7386500537395477e-01 + <_> + + 0 -1 1598 -1.0463999584317207e-02 + + 3.4757301211357117e-01 -2.7464100718498230e-01 + <_> + + 0 -1 1599 -6.6550001502037048e-03 + + -2.8980299830436707e-01 2.4037900567054749e-01 + <_> + + 0 -1 1600 8.5469996556639671e-03 + + -4.4340500235557556e-01 1.4267399907112122e-01 + <_> + + 0 -1 1601 1.9913999363780022e-02 + + 1.7740400135517120e-01 -2.4096299707889557e-01 + <_> + + 0 -1 1602 2.2012999281287193e-02 + + -1.0812000371515751e-02 -9.4690799713134766e-01 + <_> + + 0 -1 1603 -5.2179001271724701e-02 + + 1.6547499895095825e+00 9.6487000584602356e-02 + <_> + + 0 -1 1604 1.9698999822139740e-02 + + -6.7560002207756042e-03 -8.6311501264572144e-01 + <_> + + 0 -1 1605 2.3040000349283218e-02 + + -2.3519999813288450e-03 3.8531300425529480e-01 + <_> + + 0 -1 1606 -1.5038000419735909e-02 + + -6.1905699968338013e-01 3.1077999621629715e-02 + <_> + + 0 -1 1607 -4.9956001341342926e-02 + + 7.0657497644424438e-01 4.7880999743938446e-02 + <_> + + 0 -1 1608 -6.9269999861717224e-02 + + 3.9212900400161743e-01 -2.3848000168800354e-01 + <_> + + 0 -1 1609 4.7399997711181641e-03 + + -2.4309000000357628e-02 2.5386300683021545e-01 + <_> + + 0 -1 1610 -3.3923998475074768e-02 + + 4.6930399537086487e-01 -2.3321899771690369e-01 + <_> + + 0 -1 1611 -1.6231000423431396e-02 + + 3.2319200038909912e-01 -2.0545600354671478e-01 + <_> + + 0 -1 1612 -5.0193000584840775e-02 + + -1.2277870178222656e+00 -4.0798000991344452e-02 + <_> + + 0 -1 1613 5.6944001466035843e-02 + + 4.5184001326560974e-02 6.0197502374649048e-01 + <_> + + 0 -1 1614 4.0936999022960663e-02 + + -1.6772800683975220e-01 8.9819300174713135e-01 + <_> + + 0 -1 1615 -3.0839999672025442e-03 + + 3.3716198801994324e-01 -2.7240800857543945e-01 + <_> + + 0 -1 1616 -3.2600000500679016e-02 + + -8.5446500778198242e-01 1.9664999097585678e-02 + <_> + + 0 -1 1617 9.8480999469757080e-02 + + 5.4742000997066498e-02 6.3827300071716309e-01 + <_> + + 0 -1 1618 -3.8185000419616699e-02 + + 5.2274698019027710e-01 -2.3384800553321838e-01 + <_> + + 0 -1 1619 -4.5917000621557236e-02 + + 6.2829202413558960e-01 3.2859001308679581e-02 + <_> + + 0 -1 1620 -1.1955499649047852e-01 + + -6.1572700738906860e-01 3.4680001437664032e-02 + <_> + + 0 -1 1621 -1.2044399976730347e-01 + + -8.4380000829696655e-01 1.6530700027942657e-01 + <_> + + 0 -1 1622 7.0619001984596252e-02 + + -6.3261002302169800e-02 -1.9863929748535156e+00 + <_> + + 0 -1 1623 8.4889996796846390e-03 + + -1.7663399875164032e-01 3.8011199235916138e-01 + <_> + + 0 -1 1624 2.2710999473929405e-02 + + -2.7605999261140823e-02 -9.1921401023864746e-01 + <_> + + 0 -1 1625 4.9700000090524554e-04 + + -2.4293200671672821e-01 2.2878900170326233e-01 + <_> + + 0 -1 1626 3.4651998430490494e-02 + + -2.3705999553203583e-01 5.4010999202728271e-01 + <_> + + 0 -1 1627 -4.4700000435113907e-03 + + 3.9078998565673828e-01 -1.2693800032138824e-01 + <_> + + 0 -1 1628 2.3643000051379204e-02 + + -2.6663699746131897e-01 3.2312598824501038e-01 + <_> + + 0 -1 1629 1.2813000008463860e-02 + + 1.7540800571441650e-01 -6.0787999629974365e-01 + <_> + + 0 -1 1630 -1.1250999756157398e-02 + + -1.0852589607238770e+00 -2.8046000748872757e-02 + <_> + + 0 -1 1631 -4.1535001248121262e-02 + + 7.1887397766113281e-01 2.7982000261545181e-02 + <_> + + 0 -1 1632 -9.3470998108386993e-02 + + -1.1906319856643677e+00 -4.4810999184846878e-02 + <_> + + 0 -1 1633 -2.7249999344348907e-02 + + 6.2942498922348022e-01 9.5039997249841690e-03 + <_> + + 0 -1 1634 -2.1759999915957451e-02 + + 1.3233649730682373e+00 -1.5027000010013580e-01 + <_> + + 0 -1 1635 -9.6890004351735115e-03 + + -3.3947101235389709e-01 1.7085799574851990e-01 + <_> + + 0 -1 1636 6.9395996630191803e-02 + + -2.5657799839973450e-01 4.7652098536491394e-01 + <_> + + 0 -1 1637 3.1208999454975128e-02 + + 1.4154000580310822e-01 -3.4942001104354858e-01 + <_> + + 0 -1 1638 -4.9727000296115875e-02 + + -1.1675560474395752e+00 -4.0757998824119568e-02 + <_> + + 0 -1 1639 -2.0301999524235725e-02 + + -3.9486399292945862e-01 1.5814900398254395e-01 + <_> + + 0 -1 1640 -1.5367000363767147e-02 + + 4.9300000071525574e-01 -2.0092099905014038e-01 + <_> + + 0 -1 1641 -5.0735000520944595e-02 + + 1.8736059665679932e+00 8.6730003356933594e-02 + <_> + + 0 -1 1642 -2.0726000890135765e-02 + + -8.8938397169113159e-01 -7.3199998587369919e-03 + <_> + + 0 -1 1643 -3.0993999913334846e-02 + + -1.1664899587631226e+00 1.4274600148200989e-01 + <_> + + 0 -1 1644 -4.4269999489188194e-03 + + -6.6815102100372314e-01 4.4120000675320625e-03 + <_> + + 0 -1 1645 -4.5743998140096664e-02 + + -4.7955200076103210e-01 1.5121999382972717e-01 + <_> + + 0 -1 1646 1.6698999330401421e-02 + + 1.2048599869012833e-01 -4.5235899090766907e-01 + <_> + + 0 -1 1647 3.2210000790655613e-03 + + -7.7615000307559967e-02 2.7846598625183105e-01 + <_> + + 0 -1 1648 2.4434000253677368e-02 + + -1.9987100362777710e-01 6.7253702878952026e-01 + <_> + + 0 -1 1649 -7.9677999019622803e-02 + + 9.2222398519515991e-01 9.2557996511459351e-02 + <_> + + 0 -1 1650 4.4530000537633896e-02 + + -2.6690500974655151e-01 3.3320501446723938e-01 + <_> + + 0 -1 1651 -1.2528300285339355e-01 + + -5.4253101348876953e-01 1.3976299762725830e-01 + <_> + + 0 -1 1652 1.7971999943256378e-02 + + 1.8219999969005585e-02 -6.8048501014709473e-01 + <_> + + 0 -1 1653 1.9184000790119171e-02 + + -1.2583999894559383e-02 5.4126697778701782e-01 + <_> + + 0 -1 1654 4.0024001151323318e-02 + + -1.7638799548149109e-01 7.8810399770736694e-01 + <_> + + 0 -1 1655 1.3558999635279179e-02 + + 2.0737600326538086e-01 -4.7744300961494446e-01 + <_> + + 0 -1 1656 1.6220999881625175e-02 + + 2.3076999932527542e-02 -6.1182099580764771e-01 + <_> + + 0 -1 1657 1.1229000054299831e-02 + + -1.7728000879287720e-02 4.1764199733734131e-01 + <_> + + 0 -1 1658 3.9193000644445419e-02 + + -1.8948499858379364e-01 7.4019300937652588e-01 + <_> + + 0 -1 1659 -9.5539996400475502e-03 + + 4.0947100520133972e-01 -1.3508899509906769e-01 + <_> + + 0 -1 1660 2.7878999710083008e-02 + + -2.0350700616836548e-01 6.1625397205352783e-01 + <_> + + 0 -1 1661 -2.3600999265909195e-02 + + -1.6967060565948486e+00 1.4633199572563171e-01 + <_> + + 0 -1 1662 2.6930000633001328e-02 + + -3.0401999130845070e-02 -1.0909470319747925e+00 + <_> + + 0 -1 1663 2.8999999631196260e-04 + + -2.0076000690460205e-01 2.2314099967479706e-01 + <_> + + 0 -1 1664 -4.1124999523162842e-02 + + -4.5242199301719666e-01 5.7392001152038574e-02 + <_> + + 0 -1 1665 6.6789998672902584e-03 + + 2.3824900388717651e-01 -2.1262100338935852e-01 + <_> + + 0 -1 1666 4.7864999622106552e-02 + + -1.8194800615310669e-01 6.1918401718139648e-01 + <_> + + 0 -1 1667 -3.1679999083280563e-03 + + -2.7393200993537903e-01 2.5017300248146057e-01 + <_> + + 0 -1 1668 -8.6230002343654633e-03 + + -4.6280300617218018e-01 4.2397998273372650e-02 + <_> + + 0 -1 1669 -7.4350000359117985e-03 + + 4.1796800494194031e-01 -1.7079999670386314e-03 + <_> + + 0 -1 1670 -1.8769999733194709e-03 + + 1.4602300524711609e-01 -3.3721101284027100e-01 + <_> + + 0 -1 1671 -8.6226001381874084e-02 + + 7.5143402814865112e-01 1.0711999610066414e-02 + <_> + + 0 -1 1672 4.6833999454975128e-02 + + -1.9119599461555481e-01 4.8414900898933411e-01 + <_> + + 0 -1 1673 -9.2000002041459084e-05 + + 3.5220399498939514e-01 -1.7333300411701202e-01 + <_> + + 0 -1 1674 -1.6343999654054642e-02 + + -6.4397698640823364e-01 9.0680001303553581e-03 + <_> + + 0 -1 1675 4.5703999698162079e-02 + + 1.8216000869870186e-02 3.1970798969268799e-01 + <_> + + 0 -1 1676 -2.7382999658584595e-02 + + 1.0564049482345581e+00 -1.7276400327682495e-01 + <_> + + 0 -1 1677 -2.7602000162005424e-02 + + 2.9715499281883240e-01 -9.4600003212690353e-03 + <_> + + 0 -1 1678 7.6939999125897884e-03 + + -2.1660299599170685e-01 4.7385200858116150e-01 + <_> + + 0 -1 1679 -7.0500001311302185e-04 + + 2.4048799276351929e-01 -2.6776000857353210e-01 + <_> + + 0 -1 1680 1.1054199934005737e-01 + + -3.3539000898599625e-02 -1.0233880281448364e+00 + <_> + + 0 -1 1681 6.8765997886657715e-02 + + -4.3239998631179333e-03 5.7153397798538208e-01 + <_> + + 0 -1 1682 1.7999999690800905e-03 + + 7.7574998140335083e-02 -4.2092698812484741e-01 + <_> + + 0 -1 1683 1.9232000410556793e-01 + + 8.2021996378898621e-02 2.8810169696807861e+00 + <_> + + 0 -1 1684 1.5742099285125732e-01 + + -1.3708199560642242e-01 2.0890059471130371e+00 + <_> + + 0 -1 1685 -4.9387000501155853e-02 + + -1.8610910177230835e+00 1.4332099258899689e-01 + <_> + + 0 -1 1686 5.1929000765085220e-02 + + -1.8737000226974487e-01 5.4231601953506470e-01 + <_> + + 0 -1 1687 4.9965001642704010e-02 + + 1.4175300300121307e-01 -1.5625779628753662e+00 + <_> + + 0 -1 1688 -4.2633000761270523e-02 + + 1.6059479713439941e+00 -1.4712899923324585e-01 + <_> + + 0 -1 1689 -3.7553999572992325e-02 + + -8.0974900722503662e-01 1.3256999850273132e-01 + <_> + + 0 -1 1690 -3.7174999713897705e-02 + + -1.3945020437240601e+00 -5.7055000215768814e-02 + <_> + + 0 -1 1691 1.3945999555289745e-02 + + 3.3427000045776367e-02 5.7474797964096069e-01 + <_> + + 0 -1 1692 -4.4800000614486635e-04 + + -5.5327498912811279e-01 2.1952999755740166e-02 + <_> + + 0 -1 1693 3.1993001699447632e-02 + + 2.0340999588370323e-02 3.7459200620651245e-01 + <_> + + 0 -1 1694 -4.2799999937415123e-03 + + 4.4428700208663940e-01 -2.2999699413776398e-01 + <_> + + 0 -1 1695 9.8550003021955490e-03 + + 1.8315799534320831e-01 -4.0964999794960022e-01 + <_> + + 0 -1 1696 9.3356996774673462e-02 + + -6.3661001622676849e-02 -1.6929290294647217e+00 + <_> + + 0 -1 1697 1.7209999263286591e-02 + + 2.0153899490833282e-01 -4.6061098575592041e-01 + <_> + + 0 -1 1698 8.4319999441504478e-03 + + -3.2003998756408691e-01 1.5312199294567108e-01 + <_> + + 0 -1 1699 -1.4054999686777592e-02 + + 8.6882400512695312e-01 3.2575000077486038e-02 + <_> + + 0 -1 1700 -7.7180000953376293e-03 + + 6.3686698675155640e-01 -1.8425500392913818e-01 + <_> + + 0 -1 1701 2.8005000203847885e-02 + + 1.7357499897480011e-01 -4.7883599996566772e-01 + <_> + + 0 -1 1702 -1.8884999677538872e-02 + + 2.4101600050926208e-01 -2.6547598838806152e-01 + <_> + + 0 -1 1703 -1.8585000187158585e-02 + + 5.4232501983642578e-01 5.3633000701665878e-02 + <_> + + 0 -1 1704 -3.6437001079320908e-02 + + 2.3908898830413818e+00 -1.3634699583053589e-01 + <_> + + 0 -1 1705 3.2455001026391983e-02 + + 1.5910699963569641e-01 -6.7581498622894287e-01 + <_> + + 0 -1 1706 5.9781998395919800e-02 + + -2.3479999508708715e-03 -7.3053699731826782e-01 + <_> + + 0 -1 1707 9.8209995776414871e-03 + + -1.1444099992513657e-01 3.0570301413536072e-01 + <_> + + 0 -1 1708 -3.5163998603820801e-02 + + -1.0511469841003418e+00 -3.3103000372648239e-02 + <_> + + 0 -1 1709 2.7429999317973852e-03 + + -2.0135399699211121e-01 3.2754099369049072e-01 + <_> + + 0 -1 1710 8.1059997901320457e-03 + + -2.1383500099182129e-01 4.3362098932266235e-01 + <_> + + 0 -1 1711 8.8942997157573700e-02 + + 1.0940899699926376e-01 -4.7609338760375977e+00 + <_> + + 0 -1 1712 -3.0054999515414238e-02 + + -1.7169300317764282e+00 -6.0919001698493958e-02 + <_> + + 0 -1 1713 -2.1734999492764473e-02 + + 6.4778900146484375e-01 -3.2830998301506042e-02 + <_> + + 0 -1 1714 3.7648998200893402e-02 + + -1.0060000233352184e-02 -7.6569098234176636e-01 + <_> + + 0 -1 1715 2.7189999818801880e-03 + + 1.9888900220394135e-01 -8.2479000091552734e-02 + <_> + + 0 -1 1716 -1.0548000223934650e-02 + + -8.6613601446151733e-01 -2.5986000895500183e-02 + <_> + + 0 -1 1717 1.2966300547122955e-01 + + 1.3911999762058258e-01 -2.2271950244903564e+00 + <_> + + 0 -1 1718 -1.7676999792456627e-02 + + 3.3967700600624084e-01 -2.3989599943161011e-01 + <_> + + 0 -1 1719 -7.7051997184753418e-02 + + -2.5017969608306885e+00 1.2841999530792236e-01 + <_> + + 0 -1 1720 -1.9230000674724579e-02 + + 5.0641202926635742e-01 -1.9751599431037903e-01 + <_> + + 0 -1 1721 -5.1222998648881912e-02 + + -2.9333369731903076e+00 1.3858500123023987e-01 + <_> + + 0 -1 1722 2.0830000285059214e-03 + + -6.0043597221374512e-01 2.9718000441789627e-02 + <_> + + 0 -1 1723 2.5418000295758247e-02 + + 3.3915799856185913e-01 -1.4392000436782837e-01 + <_> + + 0 -1 1724 -2.3905999958515167e-02 + + -1.1082680225372314e+00 -4.7377001494169235e-02 + <_> + + 0 -1 1725 -6.3740001060068607e-03 + + 4.4533699750900269e-01 -6.7052997648715973e-02 + <_> + + 0 -1 1726 -3.7698999047279358e-02 + + -1.0406579971313477e+00 -4.1790001094341278e-02 + <_> + + 0 -1 1727 2.1655100584030151e-01 + + 3.3863000571727753e-02 8.2017302513122559e-01 + <_> + + 0 -1 1728 -1.3400999829173088e-02 + + 5.2903497219085693e-01 -1.9133000075817108e-01 + <_> + 196 + -3.2103500366210938e+00 + + <_> + + 0 -1 1729 7.1268998086452484e-02 + + -5.3631198406219482e-01 6.0715299844741821e-01 + <_> + + 0 -1 1730 5.6111000478267670e-02 + + -5.0141602754592896e-01 4.3976101279258728e-01 + <_> + + 0 -1 1731 4.0463998913764954e-02 + + -3.2922199368476868e-01 5.4834699630737305e-01 + <_> + + 0 -1 1732 6.3155002892017365e-02 + + -3.1701698899269104e-01 4.6152999997138977e-01 + <_> + + 0 -1 1733 1.0320999659597874e-02 + + 1.0694999992847443e-01 -9.8243898153305054e-01 + <_> + + 0 -1 1734 6.2606997787952423e-02 + + -1.4329700171947479e-01 7.1095001697540283e-01 + <_> + + 0 -1 1735 -3.9416000247001648e-02 + + 9.4380199909210205e-01 -2.1572099626064301e-01 + <_> + + 0 -1 1736 -5.3960001096129417e-03 + + -5.4611998796463013e-01 2.5303798913955688e-01 + <_> + + 0 -1 1737 1.0773199796676636e-01 + + 1.2496000155806541e-02 -1.0809199810028076e+00 + <_> + + 0 -1 1738 1.6982000321149826e-02 + + -3.1536400318145752e-01 5.1239997148513794e-01 + <_> + + 0 -1 1739 3.1216999515891075e-02 + + -4.5199999585747719e-03 -1.2443480491638184e+00 + <_> + + 0 -1 1740 -2.3106999695301056e-02 + + -7.6492899656295776e-01 2.0640599727630615e-01 + <_> + + 0 -1 1741 -1.1203999631106853e-02 + + 2.4092699587345123e-01 -3.5142099857330322e-01 + <_> + + 0 -1 1742 -4.7479998320341110e-03 + + -9.7007997334003448e-02 2.0638099312782288e-01 + <_> + + 0 -1 1743 -1.7358999699354172e-02 + + -7.9020297527313232e-01 2.1852999925613403e-02 + <_> + + 0 -1 1744 1.8851999193429947e-02 + + -1.0394600033760071e-01 5.4844200611114502e-01 + <_> + + 0 -1 1745 7.2249998338520527e-03 + + -4.0409401059150696e-01 2.6763799786567688e-01 + <_> + + 0 -1 1746 1.8915999680757523e-02 + + 2.0508000254631042e-01 -1.0206340551376343e+00 + <_> + + 0 -1 1747 3.1156999990344048e-02 + + 1.2400000123307109e-03 -8.7293499708175659e-01 + <_> + + 0 -1 1748 2.0951999351382256e-02 + + -5.5559999309480190e-03 8.0356198549270630e-01 + <_> + + 0 -1 1749 1.1291000060737133e-02 + + -3.6478400230407715e-01 2.2767899930477142e-01 + <_> + + 0 -1 1750 -5.7011000812053680e-02 + + -1.4295619726181030e+00 1.4322000741958618e-01 + <_> + + 0 -1 1751 7.2194002568721771e-02 + + -4.1850000619888306e-02 -1.9111829996109009e+00 + <_> + + 0 -1 1752 -1.9874000921845436e-02 + + 2.6425498723983765e-01 -3.2617700099945068e-01 + <_> + + 0 -1 1753 -1.6692999750375748e-02 + + -8.3907800912857056e-01 4.0799999260343611e-04 + <_> + + 0 -1 1754 -3.9834998548030853e-02 + + -4.8858499526977539e-01 1.6436100006103516e-01 + <_> + + 0 -1 1755 2.7009999379515648e-02 + + -1.8862499296665192e-01 8.3419400453567505e-01 + <_> + + 0 -1 1756 -3.9420002140104771e-03 + + 2.3231500387191772e-01 -7.2360001504421234e-02 + <_> + + 0 -1 1757 2.2833000868558884e-02 + + -3.5884000360965729e-02 -1.1549400091171265e+00 + <_> + + 0 -1 1758 -6.8888001143932343e-02 + + -1.7837309837341309e+00 1.5159000456333160e-01 + <_> + + 0 -1 1759 4.3097000569105148e-02 + + -2.1608099341392517e-01 5.0624102354049683e-01 + <_> + + 0 -1 1760 8.6239995434880257e-03 + + -1.7795599997043610e-01 2.8957900404930115e-01 + <_> + + 0 -1 1761 1.4561000280082226e-02 + + -1.1408000253140926e-02 -8.9402002096176147e-01 + <_> + + 0 -1 1762 -1.1501000262796879e-02 + + 3.0171999335289001e-01 -4.3659001588821411e-02 + <_> + + 0 -1 1763 -1.0971499979496002e-01 + + -9.5147097110748291e-01 -1.9973000511527061e-02 + <_> + + 0 -1 1764 4.5228000730276108e-02 + + 3.3110998570919037e-02 9.6619802713394165e-01 + <_> + + 0 -1 1765 -2.7047999203205109e-02 + + 9.7963601350784302e-01 -1.7261900007724762e-01 + <_> + + 0 -1 1766 1.8030999228358269e-02 + + -2.0801000297069550e-02 2.7385899424552917e-01 + <_> + + 0 -1 1767 5.0524998456239700e-02 + + -5.6802999228239059e-02 -1.7775089740753174e+00 + <_> + + 0 -1 1768 -2.9923999682068825e-02 + + 6.5329200029373169e-01 -2.3537000641226768e-02 + <_> + + 0 -1 1769 3.8058001548051834e-02 + + 2.6317000389099121e-02 -7.0665699243545532e-01 + <_> + + 0 -1 1770 1.8563899397850037e-01 + + -5.6039998307824135e-03 3.2873699069023132e-01 + <_> + + 0 -1 1771 -4.0670000016689301e-03 + + 3.4204798936843872e-01 -3.0171599984169006e-01 + <_> + + 0 -1 1772 1.0108999907970428e-02 + + -7.3600001633167267e-03 5.7981598377227783e-01 + <_> + + 0 -1 1773 -1.1567000299692154e-02 + + -5.2722197771072388e-01 4.6447999775409698e-02 + <_> + + 0 -1 1774 -6.5649999305605888e-03 + + -5.8529102802276611e-01 1.9101899862289429e-01 + <_> + + 0 -1 1775 1.0582000017166138e-02 + + 2.1073000505566597e-02 -6.8892598152160645e-01 + <_> + + 0 -1 1776 -2.0304000005125999e-02 + + -3.6400699615478516e-01 1.5338799357414246e-01 + <_> + + 0 -1 1777 2.3529999889433384e-03 + + 3.6164000630378723e-02 -5.9825098514556885e-01 + <_> + + 0 -1 1778 -1.4690000098198652e-03 + + -1.4707699418067932e-01 3.7507998943328857e-01 + <_> + + 0 -1 1779 8.6449999362230301e-03 + + -2.1708500385284424e-01 5.1936799287796021e-01 + <_> + + 0 -1 1780 -2.4326000362634659e-02 + + -1.0846769809722900e+00 1.4084799587726593e-01 + <_> + + 0 -1 1781 7.4418999254703522e-02 + + -1.5513800084590912e-01 1.1822769641876221e+00 + <_> + + 0 -1 1782 1.7077999189496040e-02 + + 4.4231001287698746e-02 9.1561102867126465e-01 + <_> + + 0 -1 1783 -2.4577999487519264e-02 + + -1.5504100322723389e+00 -5.4745998233556747e-02 + <_> + + 0 -1 1784 3.0205000191926956e-02 + + 1.6662800312042236e-01 -1.0001239776611328e+00 + <_> + + 0 -1 1785 1.2136000208556652e-02 + + -7.7079099416732788e-01 -4.8639997839927673e-03 + <_> + + 0 -1 1786 8.6717002093791962e-02 + + 1.1061699688434601e-01 -1.6857999563217163e+00 + <_> + + 0 -1 1787 -4.2309001088142395e-02 + + 1.1075930595397949e+00 -1.5438599884510040e-01 + <_> + + 0 -1 1788 -2.6420000940561295e-03 + + 2.7451899647712708e-01 -1.8456199765205383e-01 + <_> + + 0 -1 1789 -5.6662000715732574e-02 + + -8.0625599622726440e-01 -1.6928000375628471e-02 + <_> + + 0 -1 1790 2.3475000634789467e-02 + + 1.4187699556350708e-01 -2.5500899553298950e-01 + <_> + + 0 -1 1791 -2.0803000777959824e-02 + + 1.9826300442218781e-01 -3.1171199679374695e-01 + <_> + + 0 -1 1792 7.2599998675286770e-03 + + -5.0590999424457550e-02 4.1923800110816956e-01 + <_> + + 0 -1 1793 3.4160000085830688e-01 + + -1.6674900054931641e-01 9.2748600244522095e-01 + <_> + + 0 -1 1794 6.2029999680817127e-03 + + -1.2625899910926819e-01 4.0445300936698914e-01 + <_> + + 0 -1 1795 3.2692000269889832e-02 + + -3.2634999603033066e-02 -9.8939800262451172e-01 + <_> + + 0 -1 1796 2.1100000594742596e-04 + + -6.4534001052379608e-02 2.5473698973655701e-01 + <_> + + 0 -1 1797 7.2100001852959394e-04 + + -3.6618599295616150e-01 1.1973100155591965e-01 + <_> + + 0 -1 1798 5.4490998387336731e-02 + + 1.2073499709367752e-01 -1.0291390419006348e+00 + <_> + + 0 -1 1799 -1.0141000151634216e-02 + + -5.2177202701568604e-01 3.3734999597072601e-02 + <_> + + 0 -1 1800 -1.8815999850630760e-02 + + 6.5181797742843628e-01 1.3399999588727951e-03 + <_> + + 0 -1 1801 -5.3480002097785473e-03 + + 1.7370699346065521e-01 -3.4132000803947449e-01 + <_> + + 0 -1 1802 -1.0847000405192375e-02 + + -1.9699899852275848e-01 1.5045499801635742e-01 + <_> + + 0 -1 1803 -4.9926001578569412e-02 + + -5.0888502597808838e-01 3.0762000009417534e-02 + <_> + + 0 -1 1804 1.2160000391304493e-02 + + -6.9251999258995056e-02 1.8745499849319458e-01 + <_> + + 0 -1 1805 -2.2189998999238014e-03 + + -4.0849098563194275e-01 7.9954996705055237e-02 + <_> + + 0 -1 1806 3.1580000650137663e-03 + + -2.1124599874019623e-01 2.2366400063037872e-01 + <_> + + 0 -1 1807 4.1439998894929886e-03 + + -4.9900299310684204e-01 6.2917001545429230e-02 + <_> + + 0 -1 1808 -7.3730000294744968e-03 + + -2.0553299784660339e-01 2.2096699476242065e-01 + <_> + + 0 -1 1809 5.1812000572681427e-02 + + 1.8096800148487091e-01 -4.3495801091194153e-01 + <_> + + 0 -1 1810 1.8340000882744789e-02 + + 1.5200000256299973e-02 3.7991699576377869e-01 + <_> + + 0 -1 1811 1.7490799725055695e-01 + + -2.0920799672603607e-01 4.0013000369071960e-01 + <_> + + 0 -1 1812 5.3993999958038330e-02 + + 2.4751600623130798e-01 -2.6712900400161743e-01 + <_> + + 0 -1 1813 -3.2033199071884155e-01 + + -1.9094380140304565e+00 -6.6960997879505157e-02 + <_> + + 0 -1 1814 -2.7060000225901604e-02 + + -7.1371299028396606e-01 1.5904599428176880e-01 + <_> + + 0 -1 1815 7.7463999390602112e-02 + + -1.6970199346542358e-01 7.7552998065948486e-01 + <_> + + 0 -1 1816 2.3771999403834343e-02 + + 1.9021899998188019e-01 -6.0162097215652466e-01 + <_> + + 0 -1 1817 1.1501000262796879e-02 + + 7.7039999887347221e-03 -6.1730301380157471e-01 + <_> + + 0 -1 1818 3.2616000622510910e-02 + + 1.7159199714660645e-01 -7.0978200435638428e-01 + <_> + + 0 -1 1819 -4.4383000582456589e-02 + + -2.2606229782104492e+00 -7.3276996612548828e-02 + <_> + + 0 -1 1820 -5.8476001024246216e-02 + + 2.4087750911712646e+00 8.3091996610164642e-02 + <_> + + 0 -1 1821 1.9303999841213226e-02 + + -2.7082300186157227e-01 2.7369999885559082e-01 + <_> + + 0 -1 1822 -4.4705998152494431e-02 + + 3.1355598568916321e-01 -6.2492001801729202e-02 + <_> + + 0 -1 1823 -6.0334999114274979e-02 + + -1.4515119791030884e+00 -5.8761000633239746e-02 + <_> + + 0 -1 1824 1.1667000129818916e-02 + + -1.8084999173879623e-02 5.0479698181152344e-01 + <_> + + 0 -1 1825 2.8009999543428421e-02 + + -2.3302899301052094e-01 3.0708700418472290e-01 + <_> + + 0 -1 1826 6.5397001802921295e-02 + + 1.4135900139808655e-01 -5.0010901689529419e-01 + <_> + + 0 -1 1827 9.6239997074007988e-03 + + -2.2054600715637207e-01 3.9191201329231262e-01 + <_> + + 0 -1 1828 2.5510000996291637e-03 + + -1.1381500214338303e-01 2.0032300055027008e-01 + <_> + + 0 -1 1829 3.1847000122070312e-02 + + 2.5476999580860138e-02 -5.3326398134231567e-01 + <_> + + 0 -1 1830 3.3055000007152557e-02 + + 1.7807699739933014e-01 -6.2793898582458496e-01 + <_> + + 0 -1 1831 4.7600999474525452e-02 + + -1.4747899770736694e-01 1.4204180240631104e+00 + <_> + + 0 -1 1832 -1.9571999087929726e-02 + + -5.2693498134613037e-01 1.5838600695133209e-01 + <_> + + 0 -1 1833 -5.4730001837015152e-02 + + 8.8231599330902100e-01 -1.6627800464630127e-01 + <_> + + 0 -1 1834 -2.2686000913381577e-02 + + -4.8386898636817932e-01 1.5000100433826447e-01 + <_> + + 0 -1 1835 1.0713200271129608e-01 + + -2.1336199343204498e-01 4.2333900928497314e-01 + <_> + + 0 -1 1836 -3.6380000412464142e-02 + + -7.4198000133037567e-02 1.4589400589466095e-01 + <_> + + 0 -1 1837 1.3935999944806099e-02 + + -2.4911600351333618e-01 2.6771199703216553e-01 + <_> + + 0 -1 1838 2.0991999655961990e-02 + + 8.7959999218583107e-03 4.3064999580383301e-01 + <_> + + 0 -1 1839 4.9118999391794205e-02 + + -1.7591999471187592e-01 6.9282901287078857e-01 + <_> + + 0 -1 1840 3.6315999925136566e-02 + + 1.3145299255847931e-01 -3.3597299456596375e-01 + <_> + + 0 -1 1841 4.1228000074625015e-02 + + -4.5692000538110733e-02 -1.3515930175781250e+00 + <_> + + 0 -1 1842 1.5672000125050545e-02 + + 1.7544099688529968e-01 -6.0550000518560410e-02 + <_> + + 0 -1 1843 -1.6286000609397888e-02 + + -1.1308189630508423e+00 -3.9533000439405441e-02 + <_> + + 0 -1 1844 -3.0229999683797359e-03 + + -2.2454300522804260e-01 2.3628099262714386e-01 + <_> + + 0 -1 1845 -1.3786299526691437e-01 + + 4.5376899838447571e-01 -2.1098700165748596e-01 + <_> + + 0 -1 1846 -9.6760001033544540e-03 + + -1.5105099976062775e-01 2.0781700313091278e-01 + <_> + + 0 -1 1847 -2.4839999154210091e-02 + + -6.8350297212600708e-01 -8.0040004104375839e-03 + <_> + + 0 -1 1848 -1.3964399695396423e-01 + + 6.5011298656463623e-01 4.6544000506401062e-02 + <_> + + 0 -1 1849 -8.2153998315334320e-02 + + 4.4887199997901917e-01 -2.3591999709606171e-01 + <_> + + 0 -1 1850 3.8449999410659075e-03 + + -8.8173002004623413e-02 2.7346798777580261e-01 + <_> + + 0 -1 1851 -6.6579999402165413e-03 + + -4.6866598725318909e-01 7.7001996338367462e-02 + <_> + + 0 -1 1852 -1.5898000448942184e-02 + + 2.9268398880958557e-01 -2.1941000595688820e-02 + <_> + + 0 -1 1853 -5.0946000963449478e-02 + + -1.2093789577484131e+00 -4.2109999805688858e-02 + <_> + + 0 -1 1854 1.6837999224662781e-02 + + -4.5595999807119370e-02 5.0180697441101074e-01 + <_> + + 0 -1 1855 1.5918999910354614e-02 + + -2.6904299855232239e-01 2.6516300439834595e-01 + <_> + + 0 -1 1856 3.6309999413788319e-03 + + -1.3046100735664368e-01 3.1807100772857666e-01 + <_> + + 0 -1 1857 -8.6144998669624329e-02 + + 1.9443659782409668e+00 -1.3978299498558044e-01 + <_> + + 0 -1 1858 3.3140998333692551e-02 + + 1.5266799926757812e-01 -3.0866000801324844e-02 + <_> + + 0 -1 1859 -3.9679999463260174e-03 + + -7.1202301979064941e-01 -1.3844000175595284e-02 + <_> + + 0 -1 1860 -2.4008000269532204e-02 + + 9.2007797956466675e-01 4.6723999083042145e-02 + <_> + + 0 -1 1861 8.7320003658533096e-03 + + -2.2567300498485565e-01 3.1931799650192261e-01 + <_> + + 0 -1 1862 -2.7786999940872192e-02 + + -7.2337102890014648e-01 1.7018599808216095e-01 + <_> + + 0 -1 1863 -1.9455300271511078e-01 + + 1.2461860179901123e+00 -1.4736199378967285e-01 + <_> + + 0 -1 1864 -1.0869699716567993e-01 + + -1.4465179443359375e+00 1.2145300209522247e-01 + <_> + + 0 -1 1865 -1.9494999200105667e-02 + + -7.8153097629547119e-01 -2.3732999339699745e-02 + <_> + + 0 -1 1866 3.0650000553578138e-03 + + -8.5471397638320923e-01 1.6686999797821045e-01 + <_> + + 0 -1 1867 5.9193998575210571e-02 + + -1.4853699505329132e-01 1.1273469924926758e+00 + <_> + + 0 -1 1868 -5.4207999259233475e-02 + + 5.4726999998092651e-01 3.5523999482393265e-02 + <_> + + 0 -1 1869 -3.9324998855590820e-02 + + 3.6642599105834961e-01 -2.0543999969959259e-01 + <_> + + 0 -1 1870 8.2278996706008911e-02 + + -3.5007998347282410e-02 5.3994202613830566e-01 + <_> + + 0 -1 1871 -7.4479999020695686e-03 + + -6.1537498235702515e-01 -3.5319998860359192e-03 + <_> + + 0 -1 1872 7.3770000599324703e-03 + + -6.5591000020503998e-02 4.1961398720741272e-01 + <_> + + 0 -1 1873 7.0779998786747456e-03 + + -3.4129500389099121e-01 1.2536799907684326e-01 + <_> + + 0 -1 1874 -1.5581999905407429e-02 + + -3.0240398645401001e-01 2.1511000394821167e-01 + <_> + + 0 -1 1875 -2.7399999089539051e-03 + + 7.6553001999855042e-02 -4.1060501337051392e-01 + <_> + + 0 -1 1876 -7.0600003004074097e-02 + + -9.7356200218200684e-01 1.1241800338029861e-01 + <_> + + 0 -1 1877 -1.1706000193953514e-02 + + 1.8560700118541718e-01 -2.9755198955535889e-01 + <_> + + 0 -1 1878 7.1499997284263372e-04 + + -5.9650000184774399e-02 2.4824699759483337e-01 + <_> + + 0 -1 1879 -3.6866001784801483e-02 + + 3.2751700282096863e-01 -2.3059600591659546e-01 + <_> + + 0 -1 1880 -3.2526999711990356e-02 + + -2.9320299625396729e-01 1.5427699685096741e-01 + <_> + + 0 -1 1881 -7.4813999235630035e-02 + + -1.2143570184707642e+00 -5.2244000136852264e-02 + <_> + + 0 -1 1882 4.1469998657703400e-02 + + 1.3062499463558197e-01 -2.3274369239807129e+00 + <_> + + 0 -1 1883 -2.8880000114440918e-02 + + -6.6074597835540771e-01 -9.0960003435611725e-03 + <_> + + 0 -1 1884 4.6381998807191849e-02 + + 1.6630199551582336e-01 -6.6949498653411865e-01 + <_> + + 0 -1 1885 2.5424998998641968e-01 + + -5.4641999304294586e-02 -1.2676080465316772e+00 + <_> + + 0 -1 1886 2.4000001139938831e-03 + + 2.0276799798011780e-01 1.4667999930679798e-02 + <_> + + 0 -1 1887 -8.2805998623371124e-02 + + -7.8713601827621460e-01 -2.4468999356031418e-02 + <_> + + 0 -1 1888 -1.1438000015914440e-02 + + 2.8623399138450623e-01 -3.0894000083208084e-02 + <_> + + 0 -1 1889 -1.2913399934768677e-01 + + 1.7292929887771606e+00 -1.4293900132179260e-01 + <_> + + 0 -1 1890 3.8552999496459961e-02 + + 1.9232999533414841e-02 3.7732601165771484e-01 + <_> + + 0 -1 1891 1.0191400349140167e-01 + + -7.4533998966217041e-02 -3.3868899345397949e+00 + <_> + + 0 -1 1892 -1.9068000838160515e-02 + + 3.1814101338386536e-01 1.9261000677943230e-02 + <_> + + 0 -1 1893 -6.0775000602006912e-02 + + 7.6936298608779907e-01 -1.7644000053405762e-01 + <_> + + 0 -1 1894 2.4679999798536301e-02 + + 1.8396499752998352e-01 -3.0868801474571228e-01 + <_> + + 0 -1 1895 2.6759000495076180e-02 + + -2.3454900085926056e-01 3.3056598901748657e-01 + <_> + + 0 -1 1896 1.4969999901950359e-02 + + 1.7213599383831024e-01 -1.8248899281024933e-01 + <_> + + 0 -1 1897 2.6142999529838562e-02 + + -4.6463999897241592e-02 -1.1318379640579224e+00 + <_> + + 0 -1 1898 -3.7512000650167465e-02 + + 8.0404001474380493e-01 6.9660000503063202e-02 + <_> + + 0 -1 1899 -5.3229997865855694e-03 + + -8.1884402036666870e-01 -1.8224999308586121e-02 + <_> + + 0 -1 1900 1.7813000828027725e-02 + + 1.4957800507545471e-01 -1.8667200207710266e-01 + <_> + + 0 -1 1901 -3.4010000526905060e-02 + + -7.2852301597595215e-01 -1.6615999862551689e-02 + <_> + + 0 -1 1902 -1.5953000634908676e-02 + + 5.6944000720977783e-01 1.3832000084221363e-02 + <_> + + 0 -1 1903 1.9743999466300011e-02 + + 4.0525000542402267e-02 -4.1773399710655212e-01 + <_> + + 0 -1 1904 -1.0374800115823746e-01 + + -1.9825149774551392e+00 1.1960200220346451e-01 + <_> + + 0 -1 1905 -1.9285000860691071e-02 + + 5.0230598449707031e-01 -1.9745899736881256e-01 + <_> + + 0 -1 1906 -1.2780000455677509e-02 + + 4.0195000171661377e-01 -2.6957999914884567e-02 + <_> + + 0 -1 1907 -1.6352999955415726e-02 + + -7.6608800888061523e-01 -2.4209000170230865e-02 + <_> + + 0 -1 1908 -1.2763699889183044e-01 + + 8.6578500270843506e-01 6.4205996692180634e-02 + <_> + + 0 -1 1909 1.9068999215960503e-02 + + -5.5929797887802124e-01 -1.6880000475794077e-03 + <_> + + 0 -1 1910 3.2480999827384949e-02 + + 4.0722001343965530e-02 4.8925098776817322e-01 + <_> + + 0 -1 1911 9.4849998131394386e-03 + + -1.9231900572776794e-01 5.1139700412750244e-01 + <_> + + 0 -1 1912 5.0470000132918358e-03 + + 1.8706800043582916e-01 -1.6113600134849548e-01 + <_> + + 0 -1 1913 4.1267998516559601e-02 + + -4.8817999660968781e-02 -1.1326299905776978e+00 + <_> + + 0 -1 1914 -7.6358996331691742e-02 + + 1.4169390201568604e+00 8.7319999933242798e-02 + <_> + + 0 -1 1915 -7.2834998369216919e-02 + + 1.3189860582351685e+00 -1.4819100499153137e-01 + <_> + + 0 -1 1916 5.9576999396085739e-02 + + 4.8376999795436859e-02 8.5611802339553833e-01 + <_> + + 0 -1 1917 2.0263999700546265e-02 + + -2.1044099330902100e-01 3.3858999609947205e-01 + <_> + + 0 -1 1918 -8.0301001667976379e-02 + + -1.2464400529861450e+00 1.1857099831104279e-01 + <_> + + 0 -1 1919 -1.7835000529885292e-02 + + 2.5782299041748047e-01 -2.4564799666404724e-01 + <_> + + 0 -1 1920 1.1431000195443630e-02 + + 2.2949799895286560e-01 -2.9497599601745605e-01 + <_> + + 0 -1 1921 -2.5541000068187714e-02 + + -8.6252999305725098e-01 -7.0400000549852848e-04 + <_> + + 0 -1 1922 -7.6899997657164931e-04 + + 3.1511399149894714e-01 -1.4349000155925751e-01 + <_> + + 0 -1 1923 -1.4453999698162079e-02 + + 2.5148499011993408e-01 -2.8232899308204651e-01 + <_> + + 0 -1 1924 8.6730001494288445e-03 + + 2.6601400971412659e-01 -2.8190800547599792e-01 + <_> + 197 + -3.2772979736328125e+00 + + <_> + + 0 -1 1925 5.4708998650312424e-02 + + -5.4144299030303955e-01 6.1043000221252441e-01 + <_> + + 0 -1 1926 -1.0838799923658371e-01 + + 7.1739900112152100e-01 -4.1196098923683167e-01 + <_> + + 0 -1 1927 2.2996999323368073e-02 + + -5.8269798755645752e-01 2.9645600914955139e-01 + <_> + + 0 -1 1928 2.7540000155568123e-03 + + -7.4243897199630737e-01 1.4183300733566284e-01 + <_> + + 0 -1 1929 -2.1520000882446766e-03 + + 1.7879900336265564e-01 -6.8548601865768433e-01 + <_> + + 0 -1 1930 -2.2559000179171562e-02 + + -1.0775549411773682e+00 1.2388999760150909e-01 + <_> + + 0 -1 1931 8.3025000989437103e-02 + + 2.4500999599695206e-02 -1.0251879692077637e+00 + <_> + + 0 -1 1932 -6.6740000620484352e-03 + + -4.5283100008964539e-01 2.1230199933052063e-01 + <_> + + 0 -1 1933 7.6485000550746918e-02 + + -2.6972699165344238e-01 4.8580199480056763e-01 + <_> + + 0 -1 1934 5.4910001344978809e-03 + + -4.8871201276779175e-01 3.1616398692131042e-01 + <_> + + 0 -1 1935 -1.0414999909698963e-02 + + 4.1512900590896606e-01 -3.0044800043106079e-01 + <_> + + 0 -1 1936 2.7607999742031097e-02 + + 1.6203799843788147e-01 -9.9868500232696533e-01 + <_> + + 0 -1 1937 -2.3272000253200531e-02 + + -1.1024399995803833e+00 2.1124999970197678e-02 + <_> + + 0 -1 1938 -5.5619999766349792e-02 + + 6.5033102035522461e-01 -2.7938000857830048e-02 + <_> + + 0 -1 1939 -4.0631998330354691e-02 + + 4.2117300629615784e-01 -2.6763799786567688e-01 + <_> + + 0 -1 1940 -7.3560001328587532e-03 + + 3.5277798771858215e-01 -3.7854000926017761e-01 + <_> + + 0 -1 1941 1.7007000744342804e-02 + + -2.9189500212669373e-01 4.1053798794746399e-01 + <_> + + 0 -1 1942 -3.7034001201391220e-02 + + -1.3216309547424316e+00 1.2966500222682953e-01 + <_> + + 0 -1 1943 -1.9633000716567039e-02 + + -8.7702298164367676e-01 1.0799999581649899e-03 + <_> + + 0 -1 1944 -2.3546999320387840e-02 + + 2.6106101274490356e-01 -2.1481400728225708e-01 + <_> + + 0 -1 1945 -4.3352998793125153e-02 + + -9.9089699983596802e-01 -9.9560003727674484e-03 + <_> + + 0 -1 1946 -2.2183999419212341e-02 + + 6.3454401493072510e-01 -5.6547001004219055e-02 + <_> + + 0 -1 1947 1.6530999913811684e-02 + + 2.4664999917149544e-02 -7.3326802253723145e-01 + <_> + + 0 -1 1948 -3.2744001597166061e-02 + + -5.6297200918197632e-01 1.6640299558639526e-01 + <_> + + 0 -1 1949 7.1415998041629791e-02 + + -3.0000001424923539e-04 -9.3286401033401489e-01 + <_> + + 0 -1 1950 8.0999999772757292e-04 + + -9.5380000770092010e-02 2.5184699892997742e-01 + <_> + + 0 -1 1951 -8.4090000018477440e-03 + + -6.5496802330017090e-01 6.7300997674465179e-02 + <_> + + 0 -1 1952 -1.7254000529646873e-02 + + -4.6492999792098999e-01 1.6070899367332458e-01 + <_> + + 0 -1 1953 -1.8641000613570213e-02 + + -1.0594010353088379e+00 -1.9617000594735146e-02 + <_> + + 0 -1 1954 -9.1979997232556343e-03 + + 5.0716197490692139e-01 -1.5339200198650360e-01 + <_> + + 0 -1 1955 1.8538000062108040e-02 + + -3.0498200654983521e-01 7.3506200313568115e-01 + <_> + + 0 -1 1956 -5.0335001200437546e-02 + + -1.1140480041503906e+00 1.8000100553035736e-01 + <_> + + 0 -1 1957 -2.3529000580310822e-02 + + -8.6907899379730225e-01 -1.2459999881684780e-02 + <_> + + 0 -1 1958 -2.7100000530481339e-02 + + 6.5942901372909546e-01 -3.5323999822139740e-02 + <_> + + 0 -1 1959 6.5879998728632927e-03 + + -2.2953400015830994e-01 4.2425099015235901e-01 + <_> + + 0 -1 1960 2.3360000923275948e-02 + + 1.8356199562549591e-01 -9.8587298393249512e-01 + <_> + + 0 -1 1961 1.2946999631822109e-02 + + -3.3147400617599487e-01 2.1323199570178986e-01 + <_> + + 0 -1 1962 -6.6559999249875546e-03 + + -1.1951400339603424e-01 2.9752799868583679e-01 + <_> + + 0 -1 1963 -2.2570999339222908e-02 + + 3.8499400019645691e-01 -2.4434499442577362e-01 + <_> + + 0 -1 1964 -6.3813999295234680e-02 + + -8.9383500814437866e-01 1.4217500388622284e-01 + <_> + + 0 -1 1965 -4.9945000559091568e-02 + + 5.3864401578903198e-01 -2.0485299825668335e-01 + <_> + + 0 -1 1966 6.8319998681545258e-03 + + -5.6678999215364456e-02 3.9970999956130981e-01 + <_> + + 0 -1 1967 -5.5835999548435211e-02 + + -1.5239470005035400e+00 -5.1183000206947327e-02 + <_> + + 0 -1 1968 3.1957000494003296e-01 + + 7.4574001133441925e-02 1.2447799444198608e+00 + <_> + + 0 -1 1969 8.0955997109413147e-02 + + -1.9665500521659851e-01 5.9889698028564453e-01 + <_> + + 0 -1 1970 -1.4911999925971031e-02 + + -6.4020597934722900e-01 1.5807600319385529e-01 + <_> + + 0 -1 1971 4.6709001064300537e-02 + + 8.5239000618457794e-02 -4.5487201213836670e-01 + <_> + + 0 -1 1972 6.0539999976754189e-03 + + -4.3184000253677368e-01 2.2452600300312042e-01 + <_> + + 0 -1 1973 -3.4375999122858047e-02 + + 4.0202501416206360e-01 -2.3903599381446838e-01 + <_> + + 0 -1 1974 -3.4924000501632690e-02 + + 5.2870100736618042e-01 3.9709001779556274e-02 + <_> + + 0 -1 1975 3.0030000489205122e-03 + + -3.8754299283027649e-01 1.4192600548267365e-01 + <_> + + 0 -1 1976 -1.4132999815046787e-02 + + 8.7528401613235474e-01 8.5507996380329132e-02 + <_> + + 0 -1 1977 -6.7940000444650650e-03 + + -1.1649219989776611e+00 -3.3943001180887222e-02 + <_> + + 0 -1 1978 -5.2886001765727997e-02 + + 1.0930680036544800e+00 5.1187001168727875e-02 + <_> + + 0 -1 1979 -2.1079999860376120e-03 + + 1.3696199655532837e-01 -3.3849999308586121e-01 + <_> + + 0 -1 1980 1.8353000283241272e-02 + + 1.3661600649356842e-01 -4.0777799487113953e-01 + <_> + + 0 -1 1981 1.2671999633312225e-02 + + -1.4936000108718872e-02 -8.1707501411437988e-01 + <_> + + 0 -1 1982 1.2924999929964542e-02 + + 1.7625099420547485e-01 -3.2491698861122131e-01 + <_> + + 0 -1 1983 -1.7921000719070435e-02 + + -5.2745401859283447e-01 4.4443000108003616e-02 + <_> + + 0 -1 1984 1.9160000374540687e-03 + + -1.0978599637746811e-01 2.2067500650882721e-01 + <_> + + 0 -1 1985 -1.4697999693453312e-02 + + 3.9067798852920532e-01 -2.2224999964237213e-01 + <_> + + 0 -1 1986 -1.4972999691963196e-02 + + -2.5450900197029114e-01 1.7790000140666962e-01 + <_> + + 0 -1 1987 1.4636999927461147e-02 + + -2.5125000625848770e-02 -8.7121301889419556e-01 + <_> + + 0 -1 1988 -1.0974000208079815e-02 + + 7.9082798957824707e-01 2.0121000707149506e-02 + <_> + + 0 -1 1989 -9.1599998995661736e-03 + + -4.7906899452209473e-01 5.2232000976800919e-02 + <_> + + 0 -1 1990 4.6179997734725475e-03 + + -1.7244599759578705e-01 3.4527799487113953e-01 + <_> + + 0 -1 1991 2.3476999253034592e-02 + + 3.7760001141577959e-03 -6.5333700180053711e-01 + <_> + + 0 -1 1992 3.1766999512910843e-02 + + 1.6364000737667084e-02 5.8723700046539307e-01 + <_> + + 0 -1 1993 -1.8419999629259109e-02 + + 1.9993899762630463e-01 -3.2056498527526855e-01 + <_> + + 0 -1 1994 1.9543999806046486e-02 + + 1.8450200557708740e-01 -2.3793600499629974e-01 + <_> + + 0 -1 1995 4.1159498691558838e-01 + + -6.0382001101970673e-02 -1.6072119474411011e+00 + <_> + + 0 -1 1996 -4.1595999151468277e-02 + + -3.2756200432777405e-01 1.5058000385761261e-01 + <_> + + 0 -1 1997 -1.0335999540984631e-02 + + -6.2394398450851440e-01 1.3112000189721584e-02 + <_> + + 0 -1 1998 1.2392999604344368e-02 + + -3.3114999532699585e-02 5.5579900741577148e-01 + <_> + + 0 -1 1999 -8.7270000949501991e-03 + + 1.9883200526237488e-01 -3.7635600566864014e-01 + <_> + + 0 -1 2000 1.6295000910758972e-02 + + 2.0373000204563141e-01 -4.2800799012184143e-01 + <_> + + 0 -1 2001 -1.0483999736607075e-02 + + -5.6847000122070312e-01 4.4199001044034958e-02 + <_> + + 0 -1 2002 -1.2431999668478966e-02 + + 7.4641901254653931e-01 4.3678998947143555e-02 + <_> + + 0 -1 2003 -5.0374999642372131e-02 + + 8.5090100765228271e-01 -1.7773799598217010e-01 + <_> + + 0 -1 2004 4.9548000097274780e-02 + + 1.6784900426864624e-01 -2.9877498745918274e-01 + <_> + + 0 -1 2005 -4.1085001081228256e-02 + + -1.3302919864654541e+00 -4.9182001501321793e-02 + <_> + + 0 -1 2006 1.0069999843835831e-03 + + -6.0538999736309052e-02 1.8483200669288635e-01 + <_> + + 0 -1 2007 -5.0142999738454819e-02 + + 7.6447701454162598e-01 -1.8356999754905701e-01 + <_> + + 0 -1 2008 -8.7879998609423637e-03 + + 2.2655999660491943e-01 -6.3156999647617340e-02 + <_> + + 0 -1 2009 -5.0170999020338058e-02 + + -1.5899070501327515e+00 -6.1255000531673431e-02 + <_> + + 0 -1 2010 1.0216099768877029e-01 + + 1.2071800231933594e-01 -1.4120110273361206e+00 + <_> + + 0 -1 2011 -1.4372999779880047e-02 + + -1.3116970062255859e+00 -5.1936000585556030e-02 + <_> + + 0 -1 2012 1.0281999595463276e-02 + + -2.1639999467879534e-03 4.4247201085090637e-01 + <_> + + 0 -1 2013 -1.1814000084996223e-02 + + 6.5378099679946899e-01 -1.8723699450492859e-01 + <_> + + 0 -1 2014 7.2114996612071991e-02 + + 7.1846999228000641e-02 8.1496298313140869e-01 + <_> + + 0 -1 2015 -1.9001999869942665e-02 + + -6.7427200078964233e-01 -4.3200000072829425e-04 + <_> + + 0 -1 2016 -4.6990001574158669e-03 + + 3.3311501145362854e-01 5.5794000625610352e-02 + <_> + + 0 -1 2017 -5.8157000690698624e-02 + + 4.5572298765182495e-01 -2.0305100083351135e-01 + <_> + + 0 -1 2018 1.1360000353306532e-03 + + -4.4686999171972275e-02 2.2681899368762970e-01 + <_> + + 0 -1 2019 -4.9414999783039093e-02 + + 2.6694598793983459e-01 -2.6116999983787537e-01 + <_> + + 0 -1 2020 -1.1913800239562988e-01 + + -8.3017998933792114e-01 1.3248500227928162e-01 + <_> + + 0 -1 2021 -1.8303999677300453e-02 + + -6.7499202489852905e-01 1.7092000693082809e-02 + <_> + + 0 -1 2022 -7.9199997708201408e-03 + + -7.2287000715732574e-02 1.4425800740718842e-01 + <_> + + 0 -1 2023 5.1925998181104660e-02 + + 3.0921999365091324e-02 -5.5860602855682373e-01 + <_> + + 0 -1 2024 6.6724002361297607e-02 + + 1.3666400313377380e-01 -2.9411000013351440e-01 + <_> + + 0 -1 2025 -1.3778000138700008e-02 + + -5.9443902969360352e-01 1.5300000086426735e-02 + <_> + + 0 -1 2026 -1.7760999500751495e-02 + + 4.0496501326560974e-01 -3.3559999428689480e-03 + <_> + + 0 -1 2027 -4.2234998196363449e-02 + + -1.0897940397262573e+00 -4.0224999189376831e-02 + <_> + + 0 -1 2028 -1.3524999842047691e-02 + + 2.8921899199485779e-01 -2.5194799900054932e-01 + <_> + + 0 -1 2029 -1.1106000281870365e-02 + + 6.5312802791595459e-01 -1.8053700029850006e-01 + <_> + + 0 -1 2030 -1.2284599989652634e-01 + + -1.9570649862289429e+00 1.4815400540828705e-01 + <_> + + 0 -1 2031 4.7715999186038971e-02 + + -2.2875599563121796e-01 3.4233701229095459e-01 + <_> + + 0 -1 2032 3.1817000359296799e-02 + + 1.5976299345493317e-01 -1.0091969966888428e+00 + <_> + + 0 -1 2033 4.2570000514388084e-03 + + -3.8881298899650574e-01 8.4210000932216644e-02 + <_> + + 0 -1 2034 -6.1372999101877213e-02 + + 1.7152810096740723e+00 5.9324998408555984e-02 + <_> + + 0 -1 2035 -2.7030000928789377e-03 + + -3.8161700963973999e-01 8.5127003490924835e-02 + <_> + + 0 -1 2036 -6.8544000387191772e-02 + + -3.0925889015197754e+00 1.1788000166416168e-01 + <_> + + 0 -1 2037 1.0372500121593475e-01 + + -1.3769300282001495e-01 1.9009410142898560e+00 + <_> + + 0 -1 2038 1.5799000859260559e-02 + + -6.2660001218318939e-02 2.5917699933052063e-01 + <_> + + 0 -1 2039 -9.8040001466870308e-03 + + -5.6291598081588745e-01 4.3923001736402512e-02 + <_> + + 0 -1 2040 -9.0229995548725128e-03 + + 2.5287100672721863e-01 -4.1225999593734741e-02 + <_> + + 0 -1 2041 -6.3754998147487640e-02 + + -2.6178569793701172e+00 -7.4005998671054840e-02 + <_> + + 0 -1 2042 3.8954999297857285e-02 + + 5.9032998979091644e-02 8.5945600271224976e-01 + <_> + + 0 -1 2043 -3.9802998304367065e-02 + + 9.3600499629974365e-01 -1.5639400482177734e-01 + <_> + + 0 -1 2044 5.0301998853683472e-02 + + 1.3725900650024414e-01 -2.5549728870391846e+00 + <_> + + 0 -1 2045 4.6250000596046448e-02 + + -1.3964000158011913e-02 -7.1026200056076050e-01 + <_> + + 0 -1 2046 6.2196001410484314e-02 + + 5.9526000171899796e-02 1.6509100198745728e+00 + <_> + + 0 -1 2047 -6.4776003360748291e-02 + + 7.1368998289108276e-01 -1.7270000278949738e-01 + <_> + + 0 -1 2048 2.7522999793291092e-02 + + 1.4631600677967072e-01 -8.1428997218608856e-02 + <_> + + 0 -1 2049 3.9900001138448715e-04 + + -3.7144500017166138e-01 1.0152699798345566e-01 + <_> + + 0 -1 2050 -4.3299999088048935e-03 + + -2.3756299912929535e-01 2.6798400282859802e-01 + <_> + + 0 -1 2051 4.7297000885009766e-02 + + -2.7682000771164894e-02 -8.4910297393798828e-01 + <_> + + 0 -1 2052 1.2508999556303024e-02 + + 1.8730199337005615e-01 -5.6001102924346924e-01 + <_> + + 0 -1 2053 4.5899000018835068e-02 + + -1.5601199865341187e-01 9.7073000669479370e-01 + <_> + + 0 -1 2054 1.9853399693965912e-01 + + 1.4895500242710114e-01 -1.1015529632568359e+00 + <_> + + 0 -1 2055 1.6674999147653580e-02 + + -1.6615299880504608e-01 8.2210999727249146e-01 + <_> + + 0 -1 2056 1.9829999655485153e-03 + + -7.1249999105930328e-02 2.8810900449752808e-01 + <_> + + 0 -1 2057 2.2447999566793442e-02 + + -2.0981000736355782e-02 -7.8416502475738525e-01 + <_> + + 0 -1 2058 -1.3913000002503395e-02 + + -1.8165799975395203e-01 2.0491799712181091e-01 + <_> + + 0 -1 2059 -7.7659999951720238e-03 + + -4.5595899224281311e-01 6.3576996326446533e-02 + <_> + + 0 -1 2060 -1.3209000229835510e-02 + + 2.6632300019264221e-01 -1.7795999348163605e-01 + <_> + + 0 -1 2061 4.9052998423576355e-02 + + -1.5476800501346588e-01 1.1069979667663574e+00 + <_> + + 0 -1 2062 2.0263999700546265e-02 + + 6.8915002048015594e-02 6.9867497682571411e-01 + <_> + + 0 -1 2063 -1.6828000545501709e-02 + + 2.7607199549674988e-01 -2.5139200687408447e-01 + <_> + + 0 -1 2064 -1.6939499974250793e-01 + + -3.0767529010772705e+00 1.1617500334978104e-01 + <_> + + 0 -1 2065 -1.1336100101470947e-01 + + -1.4639229774475098e+00 -5.1447000354528427e-02 + <_> + + 0 -1 2066 -7.7685996890068054e-02 + + 8.8430202007293701e-01 4.3306998908519745e-02 + <_> + + 0 -1 2067 -1.5568000264465809e-02 + + 1.3672499358654022e-01 -3.4505501389503479e-01 + <_> + + 0 -1 2068 -6.6018998622894287e-02 + + -1.0300110578536987e+00 1.1601399630308151e-01 + <_> + + 0 -1 2069 8.3699999377131462e-03 + + 7.6429001986980438e-02 -4.4002500176429749e-01 + <_> + + 0 -1 2070 3.5402998328208923e-02 + + 1.1979500204324722e-01 -7.2668302059173584e-01 + <_> + + 0 -1 2071 -3.9051000028848648e-02 + + 6.7375302314758301e-01 -1.8196000158786774e-01 + <_> + + 0 -1 2072 -9.7899995744228363e-03 + + 2.1264599263668060e-01 3.6756001412868500e-02 + <_> + + 0 -1 2073 -2.3047000169754028e-02 + + 4.4742199778556824e-01 -2.0986700057983398e-01 + <_> + + 0 -1 2074 3.1169999856501818e-03 + + 3.7544000893831253e-02 2.7808201313018799e-01 + <_> + + 0 -1 2075 1.3136000372469425e-02 + + -1.9842399656772614e-01 5.4335701465606689e-01 + <_> + + 0 -1 2076 1.4782000333070755e-02 + + 1.3530600070953369e-01 -1.1153600364923477e-01 + <_> + + 0 -1 2077 -6.0139000415802002e-02 + + 8.4039300680160522e-01 -1.6711600124835968e-01 + <_> + + 0 -1 2078 5.1998998969793320e-02 + + 1.7372000217437744e-01 -7.8547602891921997e-01 + <_> + + 0 -1 2079 2.4792000651359558e-02 + + -1.7739200592041016e-01 6.6752600669860840e-01 + <_> + + 0 -1 2080 -1.2014999985694885e-02 + + -1.4263699948787689e-01 1.6070500016212463e-01 + <_> + + 0 -1 2081 -9.8655998706817627e-02 + + 1.0429769754409790e+00 -1.5770199894905090e-01 + <_> + + 0 -1 2082 1.1758299916982651e-01 + + 1.0955700278282166e-01 -4.4920377731323242e+00 + <_> + + 0 -1 2083 -1.8922999501228333e-02 + + -7.8543400764465332e-01 1.2984000146389008e-02 + <_> + + 0 -1 2084 -2.8390999883413315e-02 + + -6.0569900274276733e-01 1.2903499603271484e-01 + <_> + + 0 -1 2085 1.3182999566197395e-02 + + -1.4415999874472618e-02 -7.3210501670837402e-01 + <_> + + 0 -1 2086 -1.1653000116348267e-01 + + -2.0442469120025635e+00 1.4053100347518921e-01 + <_> + + 0 -1 2087 -3.8880000356584787e-03 + + -4.1861599683761597e-01 7.8704997897148132e-02 + <_> + + 0 -1 2088 3.1229000538587570e-02 + + 2.4632999673485756e-02 4.1870400309562683e-01 + <_> + + 0 -1 2089 2.5198999792337418e-02 + + -1.7557799816131592e-01 6.4710599184036255e-01 + <_> + + 0 -1 2090 -2.8124000877141953e-02 + + -2.2005599737167358e-01 1.4121000468730927e-01 + <_> + + 0 -1 2091 3.6499001085758209e-02 + + -6.8426996469497681e-02 -2.3410849571228027e+00 + <_> + + 0 -1 2092 -7.2292998433113098e-02 + + 1.2898750305175781e+00 8.4875002503395081e-02 + <_> + + 0 -1 2093 -4.1671000421047211e-02 + + -1.1630970239639282e+00 -5.3752999752759933e-02 + <_> + + 0 -1 2094 4.7703001648187637e-02 + + 7.0101000368595123e-02 7.3676502704620361e-01 + <_> + + 0 -1 2095 6.5793000161647797e-02 + + -1.7755299806594849e-01 6.9780498743057251e-01 + <_> + + 0 -1 2096 1.3904999941587448e-02 + + 2.1936799585819244e-01 -2.0390799641609192e-01 + <_> + + 0 -1 2097 -2.7730999514460564e-02 + + 6.1867898702621460e-01 -1.7804099619388580e-01 + <_> + + 0 -1 2098 -1.5879999846220016e-02 + + -4.6484100818634033e-01 1.8828600645065308e-01 + <_> + + 0 -1 2099 7.4128001928329468e-02 + + -1.2858100235462189e-01 3.2792479991912842e+00 + <_> + + 0 -1 2100 -8.9000002481043339e-04 + + -3.0117601156234741e-01 2.3818799853324890e-01 + <_> + + 0 -1 2101 1.7965000122785568e-02 + + -2.2284999489784241e-01 2.9954001307487488e-01 + <_> + + 0 -1 2102 -2.5380000006407499e-03 + + 2.5064399838447571e-01 -1.3665600121021271e-01 + <_> + + 0 -1 2103 -9.0680001303553581e-03 + + 2.9017499089241028e-01 -2.8929701447486877e-01 + <_> + + 0 -1 2104 4.9169998615980148e-02 + + 1.9156399369239807e-01 -6.8328702449798584e-01 + <_> + + 0 -1 2105 -3.0680999159812927e-02 + + -7.5677001476287842e-01 -1.3279999606311321e-02 + <_> + + 0 -1 2106 1.0017400234937668e-01 + + 8.4453999996185303e-02 1.0888710021972656e+00 + <_> + + 0 -1 2107 3.1950001139193773e-03 + + -2.6919400691986084e-01 1.9537900388240814e-01 + <_> + + 0 -1 2108 3.5503000020980835e-02 + + 1.3632300496101379e-01 -5.6917202472686768e-01 + <_> + + 0 -1 2109 4.5900000259280205e-04 + + -4.0443998575210571e-01 1.4074799418449402e-01 + <_> + + 0 -1 2110 2.5258999317884445e-02 + + 1.6243200004100800e-01 -5.5741798877716064e-01 + <_> + + 0 -1 2111 -5.1549999043345451e-03 + + 3.1132599711418152e-01 -2.2756099700927734e-01 + <_> + + 0 -1 2112 1.5869999770075083e-03 + + -2.6867699623107910e-01 1.9565400481224060e-01 + <_> + + 0 -1 2113 -1.6204999759793282e-02 + + 1.5486499667167664e-01 -3.4057798981666565e-01 + <_> + + 0 -1 2114 -2.9624000191688538e-02 + + 1.1466799974441528e+00 9.0557999908924103e-02 + <_> + + 0 -1 2115 -1.5930000226944685e-03 + + -7.1257501840591431e-01 -7.0400000549852848e-04 + <_> + + 0 -1 2116 -5.4019000381231308e-02 + + 4.1537499427795410e-01 2.7246000245213509e-02 + <_> + + 0 -1 2117 -6.6211000084877014e-02 + + -1.3340090513229370e+00 -4.7352999448776245e-02 + <_> + + 0 -1 2118 2.7940999716520309e-02 + + 1.4446300268173218e-01 -5.1518398523330688e-01 + <_> + + 0 -1 2119 2.8957000002264977e-02 + + -4.9966000020503998e-02 -1.1929039955139160e+00 + <_> + + 0 -1 2120 -2.0424999296665192e-02 + + 6.3881301879882812e-01 3.8141001015901566e-02 + <_> + + 0 -1 2121 1.2416999787092209e-02 + + -2.1547000110149384e-01 4.9477699398994446e-01 + <_> + 181 + -3.3196411132812500e+00 + + <_> + + 0 -1 2122 4.3274000287055969e-02 + + -8.0494397878646851e-01 3.9897298812866211e-01 + <_> + + 0 -1 2123 1.8615500628948212e-01 + + -3.1655299663543701e-01 6.8877297639846802e-01 + <_> + + 0 -1 2124 3.1860999763011932e-02 + + -6.4266198873519897e-01 2.5550898909568787e-01 + <_> + + 0 -1 2125 1.4022000133991241e-02 + + -4.5926600694656372e-01 3.1171199679374695e-01 + <_> + + 0 -1 2126 -6.3029997982084751e-03 + + 4.6026900410652161e-01 -2.7438500523567200e-01 + <_> + + 0 -1 2127 -5.4310001432895660e-03 + + 3.6608600616455078e-01 -2.7205801010131836e-01 + <_> + + 0 -1 2128 1.6822999343276024e-02 + + 2.3476999253034592e-02 -8.8443797826766968e-01 + <_> + + 0 -1 2129 2.6039000600576401e-02 + + 1.7488799989223480e-01 -5.4564702510833740e-01 + <_> + + 0 -1 2130 -2.6720000430941582e-02 + + -9.6396499872207642e-01 2.3524999618530273e-02 + <_> + + 0 -1 2131 -1.7041999846696854e-02 + + -7.0848798751831055e-01 2.1468099951744080e-01 + <_> + + 0 -1 2132 5.9569999575614929e-03 + + 7.3601000010967255e-02 -6.8225598335266113e-01 + <_> + + 0 -1 2133 -2.8679999522864819e-03 + + -7.4935001134872437e-01 2.3803399503231049e-01 + <_> + + 0 -1 2134 -4.3774999678134918e-02 + + 6.8323302268981934e-01 -2.1380299329757690e-01 + <_> + + 0 -1 2135 5.1633000373840332e-02 + + -1.2566499412059784e-01 6.7523801326751709e-01 + <_> + + 0 -1 2136 8.1780003383755684e-03 + + 7.0689998567104340e-02 -8.0665898323059082e-01 + <_> + + 0 -1 2137 -5.2841998636722565e-02 + + 9.5433902740478516e-01 1.6548000276088715e-02 + <_> + + 0 -1 2138 5.2583999931812286e-02 + + -2.8414401412010193e-01 4.7129800915718079e-01 + <_> + + 0 -1 2139 -1.2659000232815742e-02 + + 3.8445401191711426e-01 -6.2288001179695129e-02 + <_> + + 0 -1 2140 1.1694000102579594e-02 + + 5.6000000768108293e-05 -1.0173139572143555e+00 + <_> + + 0 -1 2141 -2.3918999359011650e-02 + + 8.4921300411224365e-01 5.7399999350309372e-03 + <_> + + 0 -1 2142 -6.1673998832702637e-02 + + -9.2571401596069336e-01 -1.7679999582469463e-03 + <_> + + 0 -1 2143 -1.8279999494552612e-03 + + -5.4372298717498779e-01 2.4932399392127991e-01 + <_> + + 0 -1 2144 3.5257998853921890e-02 + + -7.3719997890293598e-03 -9.3963998556137085e-01 + <_> + + 0 -1 2145 -1.8438000231981277e-02 + + 7.2136700153350830e-01 1.0491999797523022e-02 + <_> + + 0 -1 2146 -3.8389001041650772e-02 + + 1.9272600114345551e-01 -3.5832101106643677e-01 + <_> + + 0 -1 2147 9.9720999598503113e-02 + + 1.1354199796915054e-01 -1.6304190158843994e+00 + <_> + + 0 -1 2148 8.4462001919746399e-02 + + -5.3420998156070709e-02 -1.6981120109558105e+00 + <_> + + 0 -1 2149 4.0270000696182251e-02 + + -1.0783199965953827e-01 5.1926600933074951e-01 + <_> + + 0 -1 2150 5.8935999870300293e-02 + + -1.8053700029850006e-01 9.5119798183441162e-01 + <_> + + 0 -1 2151 1.4957000315189362e-01 + + 1.6785299777984619e-01 -1.1591869592666626e+00 + <_> + + 0 -1 2152 6.9399998756125569e-04 + + 2.0491400361061096e-01 -3.3118200302124023e-01 + <_> + + 0 -1 2153 -3.3369001001119614e-02 + + 9.3468099832534790e-01 -2.9639999847859144e-03 + <_> + + 0 -1 2154 9.3759996816515923e-03 + + 3.7000000011175871e-03 -7.7549797296524048e-01 + <_> + + 0 -1 2155 4.3193999677896500e-02 + + -2.2040000185370445e-03 7.4589699506759644e-01 + <_> + + 0 -1 2156 -6.7555002868175507e-02 + + 7.2292101383209229e-01 -1.8404200673103333e-01 + <_> + + 0 -1 2157 -3.1168600916862488e-01 + + 1.0014270544052124e+00 3.4003000706434250e-02 + <_> + + 0 -1 2158 2.9743999242782593e-02 + + -4.6356000006198883e-02 -1.2781809568405151e+00 + <_> + + 0 -1 2159 1.0737000033259392e-02 + + 1.4812000095844269e-02 6.6649997234344482e-01 + <_> + + 0 -1 2160 -2.8841000050306320e-02 + + -9.4222599267959595e-01 -2.0796999335289001e-02 + <_> + + 0 -1 2161 -5.7649998925626278e-03 + + -4.3541899323463440e-01 2.3386000096797943e-01 + <_> + + 0 -1 2162 2.8410999104380608e-02 + + -1.7615799605846405e-01 8.5765302181243896e-01 + <_> + + 0 -1 2163 -2.9007999226450920e-02 + + 5.7978099584579468e-01 2.8565999120473862e-02 + <_> + + 0 -1 2164 2.4965999647974968e-02 + + -2.2729000076651573e-02 -9.6773099899291992e-01 + <_> + + 0 -1 2165 1.2036000378429890e-02 + + -1.4214700460433960e-01 5.1687997579574585e-01 + <_> + + 0 -1 2166 -4.2514000087976456e-02 + + 9.7273802757263184e-01 -1.8119800090789795e-01 + <_> + + 0 -1 2167 1.0276000015437603e-02 + + -8.3099998533725739e-02 3.1762799620628357e-01 + <_> + + 0 -1 2168 -6.9191999733448029e-02 + + -2.0668580532073975e+00 -6.0173999518156052e-02 + <_> + + 0 -1 2169 -4.6769999898970127e-03 + + 4.4131800532341003e-01 2.3209000006318092e-02 + <_> + + 0 -1 2170 -1.3923999853432178e-02 + + 2.8606700897216797e-01 -2.9152700304985046e-01 + <_> + + 0 -1 2171 -1.5333999879658222e-02 + + -5.7414501905441284e-01 2.3063300549983978e-01 + <_> + + 0 -1 2172 -1.0239000432193279e-02 + + 3.4479200839996338e-01 -2.6080399751663208e-01 + <_> + + 0 -1 2173 -5.0988998264074326e-02 + + 5.6154102087020874e-01 6.1218999326229095e-02 + <_> + + 0 -1 2174 3.0689999461174011e-02 + + -1.4772799611091614e-01 1.6378489732742310e+00 + <_> + + 0 -1 2175 -1.1223999783396721e-02 + + 2.4006199836730957e-01 -4.4864898920059204e-01 + <_> + + 0 -1 2176 -6.2899999320507050e-03 + + 4.3119499087333679e-01 -2.3808999359607697e-01 + <_> + + 0 -1 2177 7.8590996563434601e-02 + + 1.9865000620484352e-02 8.0853801965713501e-01 + <_> + + 0 -1 2178 -1.0178999975323677e-02 + + 1.8193200230598450e-01 -3.2877799868583679e-01 + <_> + + 0 -1 2179 3.1227000057697296e-02 + + 1.4973899722099304e-01 -1.4180339574813843e+00 + <_> + + 0 -1 2180 4.0196999907493591e-02 + + -1.9760499894618988e-01 5.8508199453353882e-01 + <_> + + 0 -1 2181 1.6138000413775444e-02 + + 5.0000002374872565e-04 3.9050000905990601e-01 + <_> + + 0 -1 2182 -4.5519001781940460e-02 + + 1.2646820545196533e+00 -1.5632599592208862e-01 + <_> + + 0 -1 2183 -1.8130000680685043e-02 + + 6.5148502588272095e-01 1.0235999710857868e-02 + <_> + + 0 -1 2184 -1.4001999981701374e-02 + + -1.0344820022583008e+00 -3.2182998955249786e-02 + <_> + + 0 -1 2185 -3.8816001266241074e-02 + + -4.7874298691749573e-01 1.6290700435638428e-01 + <_> + + 0 -1 2186 3.1656000763177872e-02 + + -2.0983399450778961e-01 5.4575902223587036e-01 + <_> + + 0 -1 2187 -1.0839999653398991e-02 + + 5.1898801326751709e-01 -1.5080000273883343e-02 + <_> + + 0 -1 2188 1.2032999657094479e-02 + + -2.1107600629329681e-01 7.5937002897262573e-01 + <_> + + 0 -1 2189 7.0772998034954071e-02 + + 1.8048800528049469e-01 -7.4048501253128052e-01 + <_> + + 0 -1 2190 5.3139799833297729e-01 + + -1.4491699635982513e-01 1.5360039472579956e+00 + <_> + + 0 -1 2191 -1.4774000272154808e-02 + + -2.8153699636459351e-01 2.0407299697399139e-01 + <_> + + 0 -1 2192 -2.2410000674426556e-03 + + -4.4876301288604736e-01 5.3989000618457794e-02 + <_> + + 0 -1 2193 4.9968000501394272e-02 + + 4.1514001786708832e-02 2.9417100548744202e-01 + <_> + + 0 -1 2194 -4.7701999545097351e-02 + + 3.9674299955368042e-01 -2.8301799297332764e-01 + <_> + + 0 -1 2195 -9.1311000287532806e-02 + + 2.1994259357452393e+00 8.7964996695518494e-02 + <_> + + 0 -1 2196 3.8070000708103180e-02 + + -2.8025600314140320e-01 2.5156199932098389e-01 + <_> + + 0 -1 2197 -1.5538999810814857e-02 + + 3.4157499670982361e-01 1.7924999818205833e-02 + <_> + + 0 -1 2198 -1.5445999801158905e-02 + + 2.8680199384689331e-01 -2.5135898590087891e-01 + <_> + + 0 -1 2199 -5.7388000190258026e-02 + + 6.3830000162124634e-01 8.8597998023033142e-02 + <_> + + 0 -1 2200 -5.9440000914037228e-03 + + 7.9016998410224915e-02 -4.0774899721145630e-01 + <_> + + 0 -1 2201 -6.9968998432159424e-02 + + -4.4644200801849365e-01 1.7219600081443787e-01 + <_> + + 0 -1 2202 -2.5064999237656593e-02 + + -9.8270201683044434e-01 -3.5388000309467316e-02 + <_> + + 0 -1 2203 1.7216000705957413e-02 + + 2.2705900669097900e-01 -8.0550098419189453e-01 + <_> + + 0 -1 2204 -4.4279001653194427e-02 + + 8.3951997756958008e-01 -1.7429600656032562e-01 + <_> + + 0 -1 2205 4.3988998979330063e-02 + + 1.1557199805974960e-01 -1.9666889905929565e+00 + <_> + + 0 -1 2206 1.5907000750303268e-02 + + -3.7576001137495041e-02 -1.0311100482940674e+00 + <_> + + 0 -1 2207 -9.2754997313022614e-02 + + -1.3530019521713257e+00 1.2141299992799759e-01 + <_> + + 0 -1 2208 7.1037001907825470e-02 + + -1.7684300243854523e-01 7.4485200643539429e-01 + <_> + + 0 -1 2209 5.7762000709772110e-02 + + 1.2835599482059479e-01 -4.4444200396537781e-01 + <_> + + 0 -1 2210 -1.6432000324130058e-02 + + 8.0152702331542969e-01 -1.7491699755191803e-01 + <_> + + 0 -1 2211 2.3939000442624092e-02 + + 1.6144999861717224e-01 -1.2364500015974045e-01 + <_> + + 0 -1 2212 1.2636000290513039e-02 + + 1.5411999821662903e-01 -3.3293798565864563e-01 + <_> + + 0 -1 2213 -5.4347999393939972e-02 + + -1.8400700092315674e+00 1.4835999906063080e-01 + <_> + + 0 -1 2214 -1.3261999934911728e-02 + + -8.0838799476623535e-01 -2.7726000174880028e-02 + <_> + + 0 -1 2215 6.1340001411736012e-03 + + -1.3785000145435333e-01 3.2858499884605408e-01 + <_> + + 0 -1 2216 2.8991000726819038e-02 + + -2.5516999885439873e-02 -8.3387202024459839e-01 + <_> + + 0 -1 2217 -2.1986000239849091e-02 + + -7.3739999532699585e-01 1.7887100577354431e-01 + <_> + + 0 -1 2218 5.3269998170435429e-03 + + -4.5449298620223999e-01 6.8791002035140991e-02 + <_> + + 0 -1 2219 8.6047999560832977e-02 + + 2.1008500456809998e-01 -3.7808901071548462e-01 + <_> + + 0 -1 2220 -8.5549997165799141e-03 + + 4.0134999155998230e-01 -2.1074099838733673e-01 + <_> + + 0 -1 2221 6.7790001630783081e-03 + + -2.1648999303579330e-02 4.5421499013900757e-01 + <_> + + 0 -1 2222 -6.3959998078644276e-03 + + -4.9818599224090576e-01 7.5907997786998749e-02 + <_> + + 0 -1 2223 8.9469999074935913e-03 + + 1.7857700586318970e-01 -2.8454899787902832e-01 + <_> + + 0 -1 2224 3.2589999027550220e-03 + + 4.6624999493360519e-02 -5.5206298828125000e-01 + <_> + + 0 -1 2225 4.1476998478174210e-02 + + 1.7550499737262726e-01 -2.0703999698162079e-01 + <_> + + 0 -1 2226 -6.7449999041855335e-03 + + -4.6392598748207092e-01 6.9303996860980988e-02 + <_> + + 0 -1 2227 3.0564999207854271e-02 + + 5.1734998822212219e-02 7.5550502538681030e-01 + <_> + + 0 -1 2228 -7.4780001305043697e-03 + + 1.4893899857997894e-01 -3.1906801462173462e-01 + <_> + + 0 -1 2229 8.9088998734951019e-02 + + 1.3738800585269928e-01 -1.1379710435867310e+00 + <_> + + 0 -1 2230 7.3230001144111156e-03 + + -2.8829199075698853e-01 1.9088600575923920e-01 + <_> + + 0 -1 2231 -1.8205000087618828e-02 + + -3.0178600549697876e-01 1.6795800626277924e-01 + <_> + + 0 -1 2232 -2.5828000158071518e-02 + + -9.8137998580932617e-01 -1.9860999658703804e-02 + <_> + + 0 -1 2233 1.0936199873685837e-01 + + 4.8790000379085541e-02 5.3118300437927246e-01 + <_> + + 0 -1 2234 -1.1424999684095383e-02 + + 2.3705999553203583e-01 -2.7925300598144531e-01 + <_> + + 0 -1 2235 -5.7565998286008835e-02 + + 4.7255399823188782e-01 6.5171003341674805e-02 + <_> + + 0 -1 2236 1.0278300195932388e-01 + + -2.0765100419521332e-01 5.0947701930999756e-01 + <_> + + 0 -1 2237 2.7041999623179436e-02 + + 1.6421200335025787e-01 -1.4508620500564575e+00 + <_> + + 0 -1 2238 -1.3635000213980675e-02 + + -5.6543898582458496e-01 2.3788999766111374e-02 + <_> + + 0 -1 2239 -3.2158198952674866e-01 + + -3.5602829456329346e+00 1.1801300197839737e-01 + <_> + + 0 -1 2240 2.0458100736141205e-01 + + -3.7016000598669052e-02 -1.0225499868392944e+00 + <_> + + 0 -1 2241 -7.0347003638744354e-02 + + -5.6491899490356445e-01 1.8525199592113495e-01 + <_> + + 0 -1 2242 3.7831000983715057e-02 + + -2.9901999980211258e-02 -8.2921499013900757e-01 + <_> + + 0 -1 2243 -7.0298001170158386e-02 + + -5.3172302246093750e-01 1.4430199563503265e-01 + <_> + + 0 -1 2244 6.3221000134944916e-02 + + -2.2041200101375580e-01 4.7952198982238770e-01 + <_> + + 0 -1 2245 3.6393001675605774e-02 + + 1.4222699403762817e-01 -6.1193901300430298e-01 + <_> + + 0 -1 2246 4.0099998004734516e-03 + + -3.4560799598693848e-01 1.1738699674606323e-01 + <_> + + 0 -1 2247 -4.9106001853942871e-02 + + 9.5984101295471191e-01 6.4934998750686646e-02 + <_> + + 0 -1 2248 -7.1583002805709839e-02 + + 1.7385669946670532e+00 -1.4252899587154388e-01 + <_> + + 0 -1 2249 -3.8008999079465866e-02 + + 1.3872820138931274e+00 6.6188000142574310e-02 + <_> + + 0 -1 2250 -3.1570000573992729e-03 + + 5.3677000105381012e-02 -5.4048001766204834e-01 + <_> + + 0 -1 2251 1.9458999857306480e-02 + + -9.3620002269744873e-02 3.9131000638008118e-01 + <_> + + 0 -1 2252 1.1293999850749969e-02 + + 3.7223998457193375e-02 -5.4251801967620850e-01 + <_> + + 0 -1 2253 -3.3495001494884491e-02 + + 9.5307898521423340e-01 3.7696998566389084e-02 + <_> + + 0 -1 2254 9.2035003006458282e-02 + + -1.3488399982452393e-01 2.2897069454193115e+00 + <_> + + 0 -1 2255 3.7529999390244484e-03 + + 2.2824199497699738e-01 -5.9983700513839722e-01 + <_> + + 0 -1 2256 1.2848000042140484e-02 + + -2.2005200386047363e-01 3.7221899628639221e-01 + <_> + + 0 -1 2257 -1.4316199719905853e-01 + + 1.2855789661407471e+00 4.7237001359462738e-02 + <_> + + 0 -1 2258 -9.6879996359348297e-02 + + -3.9550929069519043e+00 -7.2903998196125031e-02 + <_> + + 0 -1 2259 -8.8459998369216919e-03 + + 3.7674999237060547e-01 -4.6484000980854034e-02 + <_> + + 0 -1 2260 1.5900000929832458e-02 + + -2.4457000195980072e-02 -8.0034798383712769e-01 + <_> + + 0 -1 2261 7.0372000336647034e-02 + + 1.7019000649452209e-01 -6.3068997859954834e-01 + <_> + + 0 -1 2262 -3.7953998893499374e-02 + + -9.3667197227478027e-01 -4.1214000433683395e-02 + <_> + + 0 -1 2263 5.1597899198532104e-01 + + 1.3080599904060364e-01 -1.5802290439605713e+00 + <_> + + 0 -1 2264 -3.2843001186847687e-02 + + -1.1441620588302612e+00 -4.9173999577760696e-02 + <_> + + 0 -1 2265 -3.6357000470161438e-02 + + 4.9606400728225708e-01 -3.4458998590707779e-02 + <_> + + 0 -1 2266 6.8080001510679722e-03 + + -3.0997800827026367e-01 1.7054800689220428e-01 + <_> + + 0 -1 2267 -1.6114000231027603e-02 + + -3.7904599308967590e-01 1.6078999638557434e-01 + <_> + + 0 -1 2268 8.4530003368854523e-03 + + -1.8655499815940857e-01 5.6367701292037964e-01 + <_> + + 0 -1 2269 -1.3752399384975433e-01 + + -5.8989900350570679e-01 1.1749500036239624e-01 + <_> + + 0 -1 2270 1.7688000202178955e-01 + + -1.5424899756908417e-01 9.2911100387573242e-01 + <_> + + 0 -1 2271 7.9309996217489243e-03 + + 3.2190701365470886e-01 -1.6392600536346436e-01 + <_> + + 0 -1 2272 1.0971800237894058e-01 + + -1.5876500308513641e-01 1.0186259746551514e+00 + <_> + + 0 -1 2273 -3.0293000862002373e-02 + + 7.5587302446365356e-01 3.1794998794794083e-02 + <_> + + 0 -1 2274 -2.3118000477552414e-02 + + -8.8451498746871948e-01 -9.5039997249841690e-03 + <_> + + 0 -1 2275 -3.0900000128895044e-03 + + 2.3838299512863159e-01 -1.1606200039386749e-01 + <_> + + 0 -1 2276 -3.3392000943422318e-02 + + -1.8738139867782593e+00 -6.8502999842166901e-02 + <_> + + 0 -1 2277 1.3190000317990780e-02 + + 1.2919899821281433e-01 -6.7512202262878418e-01 + <_> + + 0 -1 2278 1.4661000110208988e-02 + + -2.4829000234603882e-02 -7.4396800994873047e-01 + <_> + + 0 -1 2279 -1.3248000293970108e-02 + + 4.6820199489593506e-01 -2.4165000766515732e-02 + <_> + + 0 -1 2280 -1.6218999400734901e-02 + + 4.0083798766136169e-01 -2.1255700290203094e-01 + <_> + + 0 -1 2281 -2.9052000492811203e-02 + + -1.5650019645690918e+00 1.4375899732112885e-01 + <_> + + 0 -1 2282 -1.0153199732303619e-01 + + -1.9220689535140991e+00 -6.9559998810291290e-02 + <_> + + 0 -1 2283 3.7753999233245850e-02 + + 1.3396799564361572e-01 -2.2639141082763672e+00 + <_> + + 0 -1 2284 -2.8555598855018616e-01 + + 1.0215270519256592e+00 -1.5232199430465698e-01 + <_> + + 0 -1 2285 1.5360699594020844e-01 + + -9.7409002482891083e-02 4.1662400960922241e-01 + <_> + + 0 -1 2286 -2.1199999901000410e-04 + + 1.1271899938583374e-01 -4.1653999686241150e-01 + <_> + + 0 -1 2287 -2.0597999915480614e-02 + + 6.0540497303009033e-01 6.2467999756336212e-02 + <_> + + 0 -1 2288 3.7353999912738800e-02 + + -1.8919000029563904e-01 4.6464699506759644e-01 + <_> + + 0 -1 2289 5.7275000959634781e-02 + + 1.1565300077199936e-01 -1.3213009834289551e+00 + <_> + + 0 -1 2290 5.1029999740421772e-03 + + -2.8061500191688538e-01 1.9313399493694305e-01 + <_> + + 0 -1 2291 -5.4644998162984848e-02 + + 7.2428500652313232e-01 7.5447998940944672e-02 + <_> + + 0 -1 2292 2.5349000468850136e-02 + + -1.9481800496578217e-01 4.6032801270484924e-01 + <_> + + 0 -1 2293 2.4311000481247902e-02 + + 1.5564100444316864e-01 -4.9913901090621948e-01 + <_> + + 0 -1 2294 3.5962000489234924e-02 + + -5.8573000133037567e-02 -1.5418399572372437e+00 + <_> + + 0 -1 2295 -1.0000699758529663e-01 + + -1.6100039482116699e+00 1.1450500041246414e-01 + <_> + + 0 -1 2296 8.4435999393463135e-02 + + -6.1406999826431274e-02 -1.4673349857330322e+00 + <_> + + 0 -1 2297 1.5947999432682991e-02 + + 1.6287900507450104e-01 -1.1026400327682495e-01 + <_> + + 0 -1 2298 3.3824000507593155e-02 + + -1.7932699620723724e-01 5.7218402624130249e-01 + <_> + + 0 -1 2299 -6.1996001750230789e-02 + + 4.6511812210083008e+00 9.4534002244472504e-02 + <_> + + 0 -1 2300 6.9876998662948608e-02 + + -1.6985900700092316e-01 8.7028998136520386e-01 + <_> + + 0 -1 2301 -2.7916999533772469e-02 + + 9.1042500734329224e-01 5.6827001273632050e-02 + <_> + + 0 -1 2302 -1.2764000333845615e-02 + + 2.2066700458526611e-01 -2.7769100666046143e-01 + <_> + 199 + -3.2573320865631104e+00 + + <_> + + 0 -1 2303 2.1662000566720963e-02 + + -8.9868897199630737e-01 2.9436299204826355e-01 + <_> + + 0 -1 2304 1.0044500231742859e-01 + + -3.7659201025962830e-01 6.0891002416610718e-01 + <_> + + 0 -1 2305 2.6003999635577202e-02 + + -3.8128501176834106e-01 3.9217400550842285e-01 + <_> + + 0 -1 2306 2.8441000729799271e-02 + + -1.8182300031185150e-01 5.8927202224731445e-01 + <_> + + 0 -1 2307 3.8612000644207001e-02 + + -2.2399599850177765e-01 6.3779997825622559e-01 + <_> + + 0 -1 2308 -4.6594999730587006e-02 + + 7.0812201499938965e-01 -1.4666199684143066e-01 + <_> + + 0 -1 2309 -4.2791999876499176e-02 + + 4.7680398821830750e-01 -2.9233199357986450e-01 + <_> + + 0 -1 2310 3.7960000336170197e-03 + + -1.8510299921035767e-01 5.2626699209213257e-01 + <_> + + 0 -1 2311 4.2348999530076981e-02 + + 3.9244998246431351e-02 -8.9197701215744019e-01 + <_> + + 0 -1 2312 1.9598999992012978e-02 + + -2.3358400166034698e-01 4.4146499037742615e-01 + <_> + + 0 -1 2313 8.7400001939386129e-04 + + -4.6063598990440369e-01 1.7689600586891174e-01 + <_> + + 0 -1 2314 -4.3629999272525311e-03 + + 3.3493199944496155e-01 -2.9893401265144348e-01 + <_> + + 0 -1 2315 1.6973000019788742e-02 + + -1.6408699750900269e-01 1.5993679761886597e+00 + <_> + + 0 -1 2316 3.6063998937606812e-02 + + 2.2601699829101562e-01 -5.3186100721359253e-01 + <_> + + 0 -1 2317 -7.0864997804164886e-02 + + 1.5220500528812408e-01 -4.1914600133895874e-01 + <_> + + 0 -1 2318 -6.3075996935367584e-02 + + -1.4874019622802734e+00 1.2953700125217438e-01 + <_> + + 0 -1 2319 2.9670000076293945e-02 + + -1.9145900011062622e-01 9.8184901475906372e-01 + <_> + + 0 -1 2320 3.7873998284339905e-02 + + 1.3459500670433044e-01 -5.6316298246383667e-01 + <_> + + 0 -1 2321 -3.3289000391960144e-02 + + -1.0828030109405518e+00 -1.1504000052809715e-02 + <_> + + 0 -1 2322 -3.1608998775482178e-02 + + -5.9224498271942139e-01 1.3394799828529358e-01 + <_> + + 0 -1 2323 1.0740000288933516e-03 + + -4.9185800552368164e-01 9.4446003437042236e-02 + <_> + + 0 -1 2324 -7.1556001901626587e-02 + + 5.9710198640823364e-01 -3.9553001523017883e-02 + <_> + + 0 -1 2325 -8.1170000135898590e-02 + + -1.1817820072174072e+00 -2.8254000470042229e-02 + <_> + + 0 -1 2326 4.4860001653432846e-03 + + -6.1028099060058594e-01 2.2619099915027618e-01 + <_> + + 0 -1 2327 -4.2176000773906708e-02 + + -1.1435619592666626e+00 -2.9001999646425247e-02 + <_> + + 0 -1 2328 -6.5640002489089966e-02 + + -1.6470279693603516e+00 1.2810300290584564e-01 + <_> + + 0 -1 2329 1.8188999965786934e-02 + + -3.1149399280548096e-01 2.5739601254463196e-01 + <_> + + 0 -1 2330 -5.1520001143217087e-02 + + -6.9206899404525757e-01 1.5270799398422241e-01 + <_> + + 0 -1 2331 -4.7150999307632446e-02 + + -7.1868300437927246e-01 2.6879999786615372e-03 + <_> + + 0 -1 2332 1.7488999292254448e-02 + + 2.2371199727058411e-01 -5.5381798744201660e-01 + <_> + + 0 -1 2333 -2.5264000520110130e-02 + + 1.0319819450378418e+00 -1.7496499419212341e-01 + <_> + + 0 -1 2334 -4.0745001286268234e-02 + + 4.4961598515510559e-01 3.9349000900983810e-02 + <_> + + 0 -1 2335 -3.7666998803615570e-02 + + -8.5475701093673706e-01 -1.2463999912142754e-02 + <_> + + 0 -1 2336 -1.3411000370979309e-02 + + 5.7845598459243774e-01 -1.7467999830842018e-02 + <_> + + 0 -1 2337 -7.8999997640494257e-05 + + -3.7749201059341431e-01 1.3961799442768097e-01 + <_> + + 0 -1 2338 -1.1415000073611736e-02 + + -2.6186600327491760e-01 2.3712499439716339e-01 + <_> + + 0 -1 2339 3.7200000137090683e-02 + + -2.8626000508666039e-02 -1.2945239543914795e+00 + <_> + + 0 -1 2340 3.4050000831484795e-03 + + 2.0531399548053741e-01 -1.8747499585151672e-01 + <_> + + 0 -1 2341 -2.2483000531792641e-02 + + 6.7027199268341064e-01 -1.9594000279903412e-01 + <_> + + 0 -1 2342 2.3274999111890793e-02 + + 1.7405399680137634e-01 -3.2746300101280212e-01 + <_> + + 0 -1 2343 -1.3917000032961369e-02 + + -8.3954298496246338e-01 -6.3760001212358475e-03 + <_> + + 0 -1 2344 7.5429999269545078e-03 + + -3.4194998443126678e-02 5.8998197317123413e-01 + <_> + + 0 -1 2345 -1.1539000086486340e-02 + + 4.2142799496650696e-01 -2.3510499298572540e-01 + <_> + + 0 -1 2346 5.2501998841762543e-02 + + 6.9303996860980988e-02 7.3226499557495117e-01 + <_> + + 0 -1 2347 5.2715998142957687e-02 + + -1.5688100457191467e-01 1.0907289981842041e+00 + <_> + + 0 -1 2348 -1.1726000346243382e-02 + + -7.0934301614761353e-01 1.6828800737857819e-01 + <_> + + 0 -1 2349 9.5945999026298523e-02 + + -1.6192899644374847e-01 1.0072519779205322e+00 + <_> + + 0 -1 2350 -1.5871999785304070e-02 + + 3.9008399844169617e-01 -5.3777001798152924e-02 + <_> + + 0 -1 2351 3.4818001091480255e-02 + + 1.7179999500513077e-02 -9.3941801786422729e-01 + <_> + + 0 -1 2352 3.4791998565196991e-02 + + 5.0462998449802399e-02 5.4465699195861816e-01 + <_> + + 0 -1 2353 1.6284000128507614e-02 + + -2.6981300115585327e-01 4.0365299582481384e-01 + <_> + + 0 -1 2354 -4.4319000095129013e-02 + + 8.4399998188018799e-01 3.2882999628782272e-02 + <_> + + 0 -1 2355 -5.5689997971057892e-03 + + 1.5309399366378784e-01 -3.4959799051284790e-01 + <_> + + 0 -1 2356 -6.5842002630233765e-02 + + -9.2711198329925537e-01 1.6800999641418457e-01 + <_> + + 0 -1 2357 -7.3337003588676453e-02 + + 5.1614499092102051e-01 -2.0236000418663025e-01 + <_> + + 0 -1 2358 1.6450000926852226e-02 + + 1.3950599730014801e-01 -4.9301299452781677e-01 + <_> + + 0 -1 2359 -9.2630004510283470e-03 + + -9.0101999044418335e-01 -1.6116000711917877e-02 + <_> + + 0 -1 2360 5.9139998629689217e-03 + + 1.9858199357986450e-01 -1.6731299459934235e-01 + <_> + + 0 -1 2361 -8.4699998842552304e-04 + + 9.4005003571510315e-02 -4.1570898890495300e-01 + <_> + + 0 -1 2362 2.0532900094985962e-01 + + -6.0022000223398209e-02 7.0993602275848389e-01 + <_> + + 0 -1 2363 -1.6883000731468201e-02 + + 2.4392199516296387e-01 -3.0551800131797791e-01 + <_> + + 0 -1 2364 -1.9111000001430511e-02 + + 6.1229902505874634e-01 2.4252999573945999e-02 + <_> + + 0 -1 2365 -2.5962999090552330e-02 + + 9.0764999389648438e-01 -1.6722099483013153e-01 + <_> + + 0 -1 2366 -2.1762000396847725e-02 + + -3.1384700536727905e-01 2.0134599506855011e-01 + <_> + + 0 -1 2367 -2.4119999259710312e-02 + + -6.6588401794433594e-01 7.4559999629855156e-03 + <_> + + 0 -1 2368 4.7129999846220016e-02 + + 5.9533998370170593e-02 8.7804502248764038e-01 + <_> + + 0 -1 2369 -4.5984998345375061e-02 + + 8.0067998170852661e-01 -1.7252300679683685e-01 + <_> + + 0 -1 2370 2.6507999747991562e-02 + + 1.8774099647998810e-01 -6.0850602388381958e-01 + <_> + + 0 -1 2371 -4.8615001142024994e-02 + + 5.8644098043441772e-01 -1.9427700340747833e-01 + <_> + + 0 -1 2372 -1.8562000244855881e-02 + + -2.5587901473045349e-01 1.6326199471950531e-01 + <_> + + 0 -1 2373 1.2678000144660473e-02 + + -1.4228000305593014e-02 -7.6738101243972778e-01 + <_> + + 0 -1 2374 -1.1919999960809946e-03 + + 2.0495000481605530e-01 -1.1404299736022949e-01 + <_> + + 0 -1 2375 -4.9088999629020691e-02 + + -1.0740849971771240e+00 -3.8940999656915665e-02 + <_> + + 0 -1 2376 -1.7436999827623367e-02 + + -5.7973802089691162e-01 1.8584500253200531e-01 + <_> + + 0 -1 2377 -1.4770000241696835e-02 + + -6.6150301694869995e-01 5.3119999356567860e-03 + <_> + + 0 -1 2378 -2.2905200719833374e-01 + + -4.8305100202560425e-01 1.2326399981975555e-01 + <_> + + 0 -1 2379 -1.2707099318504333e-01 + + 5.7452601194381714e-01 -1.9420400261878967e-01 + <_> + + 0 -1 2380 1.0339000262320042e-02 + + -5.4641999304294586e-02 2.4501800537109375e-01 + <_> + + 0 -1 2381 6.9010001607239246e-03 + + 1.2180600315332413e-01 -3.8797399401664734e-01 + <_> + + 0 -1 2382 2.9025399684906006e-01 + + 1.0966199636459351e-01 -30. + <_> + + 0 -1 2383 -2.3804999887943268e-01 + + -1.7352679967880249e+00 -6.3809998333454132e-02 + <_> + + 0 -1 2384 6.2481001019477844e-02 + + 1.3523000478744507e-01 -7.0301097631454468e-01 + <_> + + 0 -1 2385 4.7109997831285000e-03 + + -4.6984100341796875e-01 6.0341998934745789e-02 + <_> + + 0 -1 2386 -2.7815999463200569e-02 + + 6.9807600975036621e-01 1.3719999697059393e-03 + <_> + + 0 -1 2387 -1.7020000144839287e-02 + + 1.6870440244674683e+00 -1.4314800500869751e-01 + <_> + + 0 -1 2388 -4.9754999577999115e-02 + + 7.9497700929641724e-01 7.7199999941512942e-04 + <_> + + 0 -1 2389 -7.4732996523380280e-02 + + -1.0132360458374023e+00 -1.9388999789953232e-02 + <_> + + 0 -1 2390 3.2009001821279526e-02 + + 1.4412100613117218e-01 -4.2139101028442383e-01 + <_> + + 0 -1 2391 -9.4463996589183807e-02 + + 5.0682598352432251e-01 -2.0478899776935577e-01 + <_> + + 0 -1 2392 -1.5426999889314175e-02 + + -1.5811300277709961e-01 1.7806899547576904e-01 + <_> + + 0 -1 2393 -4.0540001355111599e-03 + + -5.4366701841354370e-01 3.1235000118613243e-02 + <_> + + 0 -1 2394 3.0080000869929790e-03 + + -1.7376799881458282e-01 3.0441701412200928e-01 + <_> + + 0 -1 2395 -1.0091999545693398e-02 + + 2.5103801488876343e-01 -2.6224100589752197e-01 + <_> + + 0 -1 2396 -3.8818001747131348e-02 + + 9.3226701021194458e-01 7.2659999132156372e-02 + <_> + + 0 -1 2397 3.4651998430490494e-02 + + -3.3934999257326126e-02 -8.5707902908325195e-01 + <_> + + 0 -1 2398 -4.6729999594390392e-03 + + 3.4969300031661987e-01 -4.8517998307943344e-02 + <_> + + 0 -1 2399 6.8499997723847628e-04 + + 6.6573001444339752e-02 -4.4973799586296082e-01 + <_> + + 0 -1 2400 3.5317000001668930e-02 + + 1.4275799691677094e-01 -4.6726399660110474e-01 + <_> + + 0 -1 2401 -2.3569999262690544e-02 + + -1.0286079645156860e+00 -4.5288000255823135e-02 + <_> + + 0 -1 2402 -1.9109999993816018e-03 + + -1.9652199745178223e-01 2.8661000728607178e-01 + <_> + + 0 -1 2403 -1.6659000888466835e-02 + + -7.7532202005386353e-01 -8.3280000835657120e-03 + <_> + + 0 -1 2404 6.6062200069427490e-01 + + 1.3232499361038208e-01 -3.5266680717468262e+00 + <_> + + 0 -1 2405 1.0970599949359894e-01 + + -1.5547199547290802e-01 1.4674140214920044e+00 + <_> + + 0 -1 2406 1.3500999659299850e-02 + + 1.5233400464057922e-01 -1.3020930290222168e+00 + <_> + + 0 -1 2407 -2.2871999070048332e-02 + + -7.1325999498367310e-01 -8.7040001526474953e-03 + <_> + + 0 -1 2408 -8.1821002066135406e-02 + + 1.1127580404281616e+00 8.3219997584819794e-02 + <_> + + 0 -1 2409 -5.2728001028299332e-02 + + 9.3165099620819092e-01 -1.7103999853134155e-01 + <_> + + 0 -1 2410 -2.5242000818252563e-02 + + -1.9733799993991852e-01 2.5359401106834412e-01 + <_> + + 0 -1 2411 -4.3818999081850052e-02 + + 4.1815200448036194e-01 -2.4585500359535217e-01 + <_> + + 0 -1 2412 -1.8188999965786934e-02 + + -5.1743197441101074e-01 2.0174199342727661e-01 + <_> + + 0 -1 2413 2.3466000333428383e-02 + + -4.3071001768112183e-02 -1.0636579990386963e+00 + <_> + + 0 -1 2414 3.4216001629829407e-02 + + 5.3780999034643173e-02 4.9707201123237610e-01 + <_> + + 0 -1 2415 2.5692999362945557e-02 + + -2.3800100386142731e-01 4.1651499271392822e-01 + <_> + + 0 -1 2416 -2.6565000414848328e-02 + + -8.8574802875518799e-01 1.3365900516510010e-01 + <_> + + 0 -1 2417 6.0942001640796661e-02 + + -2.0669700205326080e-01 5.8309000730514526e-01 + <_> + + 0 -1 2418 1.4474500715732574e-01 + + 1.3282300531864166e-01 -3.1449348926544189e+00 + <_> + + 0 -1 2419 5.3410999476909637e-02 + + -1.7325200140476227e-01 6.9190698862075806e-01 + <_> + + 0 -1 2420 1.1408000253140926e-02 + + 5.4822001606225967e-02 3.0240398645401001e-01 + <_> + + 0 -1 2421 -2.3179999552667141e-03 + + 1.5820899605751038e-01 -3.1973201036453247e-01 + <_> + + 0 -1 2422 -2.9695000499486923e-02 + + 7.1274799108505249e-01 5.8136001229286194e-02 + <_> + + 0 -1 2423 2.7249999344348907e-02 + + -1.5754100680351257e-01 9.2143797874450684e-01 + <_> + + 0 -1 2424 -3.6200000904500484e-03 + + -3.4548398852348328e-01 2.0220999419689178e-01 + <_> + + 0 -1 2425 -1.2578999623656273e-02 + + -5.5650299787521362e-01 2.0388999953866005e-02 + <_> + + 0 -1 2426 -8.8849000632762909e-02 + + -3.6100010871887207e+00 1.3164199888706207e-01 + <_> + + 0 -1 2427 -1.9256999716162682e-02 + + 5.1908999681472778e-01 -1.9284300506114960e-01 + <_> + + 0 -1 2428 -1.6666999086737633e-02 + + -8.7499998509883881e-02 1.5812499821186066e-01 + <_> + + 0 -1 2429 1.2931999750435352e-02 + + 2.7405999600887299e-02 -5.5123901367187500e-01 + <_> + + 0 -1 2430 -1.3431999832391739e-02 + + 2.3457799851894379e-01 -4.3235000222921371e-02 + <_> + + 0 -1 2431 1.8810000270605087e-02 + + -3.9680998772382736e-02 -9.4373297691345215e-01 + <_> + + 0 -1 2432 -6.4349998719990253e-03 + + 4.5703700184822083e-01 -4.0520001202821732e-03 + <_> + + 0 -1 2433 -2.4249000474810600e-02 + + -7.6248002052307129e-01 -1.9857000559568405e-02 + <_> + + 0 -1 2434 -2.9667999595403671e-02 + + -3.7412509918212891e+00 1.1250600218772888e-01 + <_> + + 0 -1 2435 5.1150000654160976e-03 + + -6.3781797885894775e-01 1.1223999783396721e-02 + <_> + + 0 -1 2436 -5.7819997891783714e-03 + + 1.9374400377273560e-01 -8.2042001187801361e-02 + <_> + + 0 -1 2437 1.6606999561190605e-02 + + -1.6192099452018738e-01 1.1334990262985229e+00 + <_> + + 0 -1 2438 3.8228001445531845e-02 + + 2.1105000749230385e-02 7.6264202594757080e-01 + <_> + + 0 -1 2439 -5.7094000279903412e-02 + + -1.6974929571151733e+00 -5.9762001037597656e-02 + <_> + + 0 -1 2440 -5.3883001208305359e-02 + + 1.1850190162658691e+00 9.0966999530792236e-02 + <_> + + 0 -1 2441 -2.6110000908374786e-03 + + -4.0941199660301208e-01 8.3820998668670654e-02 + <_> + + 0 -1 2442 2.9714399576187134e-01 + + 1.5529899299144745e-01 -1.0995409488677979e+00 + <_> + + 0 -1 2443 -8.9063003659248352e-02 + + 4.8947200179100037e-01 -2.0041200518608093e-01 + <_> + + 0 -1 2444 -5.6193001568317413e-02 + + -2.4581399559974670e-01 1.4365500211715698e-01 + <_> + + 0 -1 2445 3.7004999816417694e-02 + + -4.8168998211622238e-02 -1.2310709953308105e+00 + <_> + + 0 -1 2446 -8.4840003401041031e-03 + + 4.3372601270675659e-01 1.3779999688267708e-02 + <_> + + 0 -1 2447 -2.4379999376833439e-03 + + 1.8949699401855469e-01 -3.2294198870658875e-01 + <_> + + 0 -1 2448 -7.1639999747276306e-02 + + -4.3979001045227051e-01 2.2730199992656708e-01 + <_> + + 0 -1 2449 5.2260002121329308e-03 + + -2.0548400282859802e-01 5.0933301448822021e-01 + <_> + + 0 -1 2450 -6.1360001564025879e-03 + + 3.1157198548316956e-01 7.0680998265743256e-02 + <_> + + 0 -1 2451 1.5595000237226486e-02 + + -3.0934798717498779e-01 1.5627700090408325e-01 + <_> + + 0 -1 2452 2.5995999574661255e-02 + + 1.3821600377559662e-01 -1.7616599798202515e-01 + <_> + + 0 -1 2453 -1.2085000053048134e-02 + + -5.1070201396942139e-01 5.8440998196601868e-02 + <_> + + 0 -1 2454 -6.7836001515388489e-02 + + 4.7757101058959961e-01 -7.1446001529693604e-02 + <_> + + 0 -1 2455 -1.4715000055730343e-02 + + 4.5238900184631348e-01 -1.9861400127410889e-01 + <_> + + 0 -1 2456 2.5118999183177948e-02 + + 1.2954899668693542e-01 -8.6266398429870605e-01 + <_> + + 0 -1 2457 1.8826000392436981e-02 + + -4.1570000350475311e-02 -1.1354700326919556e+00 + <_> + + 0 -1 2458 -2.1263999864459038e-02 + + -3.4738001227378845e-01 1.5779499709606171e-01 + <_> + + 0 -1 2459 9.4609996303915977e-03 + + 4.8639997839927673e-03 -6.1654800176620483e-01 + <_> + + 0 -1 2460 2.2957700490951538e-01 + + 8.1372998654842377e-02 6.9841402769088745e-01 + <_> + + 0 -1 2461 -3.8061998784542084e-02 + + 1.1616369485855103e+00 -1.4976699650287628e-01 + <_> + + 0 -1 2462 -1.3484999537467957e-02 + + -3.2036399841308594e-01 1.7365099489688873e-01 + <_> + + 0 -1 2463 3.6238998174667358e-02 + + -1.8158499896526337e-01 6.1956697702407837e-01 + <_> + + 0 -1 2464 6.7210001870989799e-03 + + 7.9600000753998756e-04 4.2441400885581970e-01 + <_> + + 0 -1 2465 9.6525996923446655e-02 + + -1.4696800708770752e-01 1.2525680065155029e+00 + <_> + + 0 -1 2466 -3.5656999796628952e-02 + + -3.9781698584556580e-01 1.4191399514675140e-01 + <_> + + 0 -1 2467 1.0772000066936016e-02 + + -1.8194000422954559e-01 5.9762197732925415e-01 + <_> + + 0 -1 2468 7.9279996454715729e-02 + + 1.4642499387264252e-01 -7.8836899995803833e-01 + <_> + + 0 -1 2469 3.2841000705957413e-02 + + -6.2408000230789185e-02 -1.4227490425109863e+00 + <_> + + 0 -1 2470 -2.7781000360846519e-02 + + 3.4033098816871643e-01 3.0670000240206718e-02 + <_> + + 0 -1 2471 -4.0339999832212925e-03 + + 3.1084701418876648e-01 -2.2595700621604919e-01 + <_> + + 0 -1 2472 7.4260002002120018e-03 + + -3.8936998695135117e-02 3.1702101230621338e-01 + <_> + + 0 -1 2473 1.1213999986648560e-01 + + -1.7578299343585968e-01 6.5056598186492920e-01 + <_> + + 0 -1 2474 -1.1878100037574768e-01 + + -1.0092990398406982e+00 1.1069700121879578e-01 + <_> + + 0 -1 2475 -4.1584998369216919e-02 + + -5.3806400299072266e-01 1.9905000925064087e-02 + <_> + + 0 -1 2476 -2.7966000139713287e-02 + + 4.8143199086189270e-01 3.3590998500585556e-02 + <_> + + 0 -1 2477 -1.2506400048732758e-01 + + 2.6352199912071228e-01 -2.5737899541854858e-01 + <_> + + 0 -1 2478 2.3666900396347046e-01 + + 3.6508001387119293e-02 9.0655601024627686e-01 + <_> + + 0 -1 2479 -2.9475999996066093e-02 + + -6.0048800706863403e-01 9.5880003646016121e-03 + <_> + + 0 -1 2480 3.7792999297380447e-02 + + 1.5506200492382050e-01 -9.5733499526977539e-01 + <_> + + 0 -1 2481 7.2044000029563904e-02 + + -1.4525899291038513e-01 1.3676730394363403e+00 + <_> + + 0 -1 2482 9.7759999334812164e-03 + + 1.2915999628603458e-02 2.1640899777412415e-01 + <_> + + 0 -1 2483 5.2154000848531723e-02 + + -1.6359999775886536e-02 -8.8356298208236694e-01 + <_> + + 0 -1 2484 -4.3790999799966812e-02 + + 3.5829600691795349e-01 6.5131001174449921e-02 + <_> + + 0 -1 2485 -3.8378998637199402e-02 + + 1.1961040496826172e+00 -1.4971500635147095e-01 + <_> + + 0 -1 2486 -9.8838999867439270e-02 + + -6.1834001541137695e-01 1.2786200642585754e-01 + <_> + + 0 -1 2487 -1.2190700322389603e-01 + + -1.8276120424270630e+00 -6.4862996339797974e-02 + <_> + + 0 -1 2488 -1.1981700360774994e-01 + + -30. 1.1323300004005432e-01 + <_> + + 0 -1 2489 3.0910000205039978e-02 + + -2.3934000730514526e-01 3.6332899332046509e-01 + <_> + + 0 -1 2490 1.0800999589264393e-02 + + -3.5140000283718109e-02 2.7707898616790771e-01 + <_> + + 0 -1 2491 5.6844998151063919e-02 + + -1.5524299442768097e-01 1.0802700519561768e+00 + <_> + + 0 -1 2492 1.0280000278726220e-03 + + -6.1202999204397202e-02 2.0508000254631042e-01 + <_> + + 0 -1 2493 -2.8273999691009521e-02 + + -6.4778000116348267e-01 2.3917000740766525e-02 + <_> + + 0 -1 2494 -1.6013599932193756e-01 + + 1.0892050266265869e+00 5.8389000594615936e-02 + <_> + + 0 -1 2495 4.9629998393356800e-03 + + -2.5806298851966858e-01 2.0834599435329437e-01 + <_> + + 0 -1 2496 4.6937000006437302e-02 + + 1.3886299729347229e-01 -1.5662620067596436e+00 + <_> + + 0 -1 2497 2.4286000058054924e-02 + + -2.0728300511837006e-01 5.2430999279022217e-01 + <_> + + 0 -1 2498 7.0202000439167023e-02 + + 1.4796899259090424e-01 -1.3095090389251709e+00 + <_> + + 0 -1 2499 9.8120002076029778e-03 + + 2.7906000614166260e-02 -5.0864601135253906e-01 + <_> + + 0 -1 2500 -5.6200999766588211e-02 + + 1.2618130445480347e+00 6.3801996409893036e-02 + <_> + + 0 -1 2501 1.0982800275087357e-01 + + -1.2850099802017212e-01 3.0776169300079346e+00 + <_> + 211 + -3.3703000545501709e+00 + + <_> + + 0 -1 2502 2.0910000428557396e-02 + + -6.8559402227401733e-01 3.8984298706054688e-01 + <_> + + 0 -1 2503 3.5032000392675400e-02 + + -4.7724398970603943e-01 4.5027199387550354e-01 + <_> + + 0 -1 2504 3.9799001067876816e-02 + + -4.7011101245880127e-01 4.2702499032020569e-01 + <_> + + 0 -1 2505 -4.8409998416900635e-03 + + 2.5614300370216370e-01 -6.6556298732757568e-01 + <_> + + 0 -1 2506 2.3439999204128981e-03 + + -4.8083499073982239e-01 2.8013798594474792e-01 + <_> + + 0 -1 2507 2.5312999263405800e-02 + + -2.3948200047016144e-01 4.4191798567771912e-01 + <_> + + 0 -1 2508 -3.2193001359701157e-02 + + 7.6086699962615967e-01 -2.5059100985527039e-01 + <_> + + 0 -1 2509 7.5409002602100372e-02 + + -3.4974598884582520e-01 3.4380298852920532e-01 + <_> + + 0 -1 2510 -1.8469000235199928e-02 + + -7.9085600376129150e-01 3.4788001328706741e-02 + <_> + + 0 -1 2511 -1.2802000157535076e-02 + + 4.7107800841331482e-01 -6.0006000101566315e-02 + <_> + + 0 -1 2512 -2.6598000898957253e-02 + + 6.7116099596023560e-01 -2.4257500469684601e-01 + <_> + + 0 -1 2513 2.1988999098539352e-02 + + 2.4717499315738678e-01 -4.8301699757575989e-01 + <_> + + 0 -1 2514 1.4654099941253662e-01 + + -2.1504099667072296e-01 7.2055900096893311e-01 + <_> + + 0 -1 2515 3.5310001112520695e-03 + + 2.7930998802185059e-01 -3.4339898824691772e-01 + <_> + + 0 -1 2516 9.4010001048445702e-03 + + 5.5861998349428177e-02 -8.2143598794937134e-01 + <_> + + 0 -1 2517 -8.6390003561973572e-03 + + -9.9620598554611206e-01 1.8874999880790710e-01 + <_> + + 0 -1 2518 -3.9193000644445419e-02 + + -1.1945559978485107e+00 -2.9198000207543373e-02 + <_> + + 0 -1 2519 2.4855000898241997e-02 + + 1.4987599849700928e-01 -5.4137802124023438e-01 + <_> + + 0 -1 2520 -3.4995000809431076e-02 + + -1.4210180044174194e+00 -4.2314000427722931e-02 + <_> + + 0 -1 2521 -1.8378999084234238e-02 + + -2.8242599964141846e-01 1.5581800043582916e-01 + <_> + + 0 -1 2522 -1.3592000119388103e-02 + + 4.7317099571228027e-01 -2.1937200427055359e-01 + <_> + + 0 -1 2523 6.2629999592900276e-03 + + -5.9714000672101974e-02 6.0625898838043213e-01 + <_> + + 0 -1 2524 -1.8478000536561012e-02 + + -8.5647201538085938e-01 -1.3783999718725681e-02 + <_> + + 0 -1 2525 1.4236000366508961e-02 + + 1.6654799878597260e-01 -2.7713999152183533e-01 + <_> + + 0 -1 2526 -3.2547000795602798e-02 + + -1.1728240251541138e+00 -4.0185000747442245e-02 + <_> + + 0 -1 2527 -2.6410000864416361e-03 + + 2.6514300704002380e-01 -5.6343000382184982e-02 + <_> + + 0 -1 2528 -8.7799999164417386e-04 + + 3.6556001752614975e-02 -5.5075198411941528e-01 + <_> + + 0 -1 2529 4.7371998429298401e-02 + + -4.2614001780748367e-02 4.8194900155067444e-01 + <_> + + 0 -1 2530 -7.0790001191198826e-03 + + 2.8698998689651489e-01 -3.2923001050949097e-01 + <_> + + 0 -1 2531 -4.3145999312400818e-02 + + -1.4065419435501099e+00 1.2836399674415588e-01 + <_> + + 0 -1 2532 2.0592000335454941e-02 + + -2.1435299515724182e-01 5.3981798887252808e-01 + <_> + + 0 -1 2533 -2.2367000579833984e-02 + + 3.3718299865722656e-01 4.5212000608444214e-02 + <_> + + 0 -1 2534 5.0039999186992645e-02 + + -2.5121700763702393e-01 4.1750499606132507e-01 + <_> + + 0 -1 2535 6.1794999986886978e-02 + + 4.0084999054670334e-02 6.8779802322387695e-01 + <_> + + 0 -1 2536 -4.1861999779939651e-02 + + 5.3027397394180298e-01 -2.2901999950408936e-01 + <_> + + 0 -1 2537 -3.1959998887032270e-03 + + 2.5161498785018921e-01 -2.1514600515365601e-01 + <_> + + 0 -1 2538 2.4255000054836273e-02 + + 7.2320001199841499e-03 -7.2519099712371826e-01 + <_> + + 0 -1 2539 -1.7303999513387680e-02 + + -4.9958199262619019e-01 1.8394500017166138e-01 + <_> + + 0 -1 2540 -4.1470001451671124e-03 + + 8.5211999714374542e-02 -4.6364700794219971e-01 + <_> + + 0 -1 2541 -1.4369999989867210e-02 + + -5.2258902788162231e-01 2.3892599344253540e-01 + <_> + + 0 -1 2542 -9.0399999171495438e-03 + + -6.3250398635864258e-01 3.2551001757383347e-02 + <_> + + 0 -1 2543 -1.2373100221157074e-01 + + 1.2856210470199585e+00 7.6545000076293945e-02 + <_> + + 0 -1 2544 -8.2221999764442444e-02 + + 8.3208197355270386e-01 -1.8590599298477173e-01 + <_> + + 0 -1 2545 6.5659001469612122e-02 + + 1.1298800259828568e-01 -30. + <_> + + 0 -1 2546 -3.1582999974489212e-02 + + -1.3485900163650513e+00 -4.7097001224756241e-02 + <_> + + 0 -1 2547 -7.9636000096797943e-02 + + -1.3533639907836914e+00 1.5668800473213196e-01 + <_> + + 0 -1 2548 -1.8880000337958336e-02 + + 4.0300300717353821e-01 -2.5148901343345642e-01 + <_> + + 0 -1 2549 -5.0149997696280479e-03 + + -2.6287099719047546e-01 1.8582500517368317e-01 + <_> + + 0 -1 2550 -1.2218000367283821e-02 + + 5.8692401647567749e-01 -1.9427700340747833e-01 + <_> + + 0 -1 2551 1.2710000155493617e-03 + + -1.6688999533653259e-01 2.3006899654865265e-01 + <_> + + 0 -1 2552 2.9743999242782593e-02 + + 1.2520000338554382e-02 -6.6723597049713135e-01 + <_> + + 0 -1 2553 2.8175000101327896e-02 + + -1.7060000449419022e-02 6.4579397439956665e-01 + <_> + + 0 -1 2554 3.0345000326633453e-02 + + -2.4178700149059296e-01 3.4878900647163391e-01 + <_> + + 0 -1 2555 -1.7325999215245247e-02 + + -5.3599399328231812e-01 2.0995999872684479e-01 + <_> + + 0 -1 2556 -8.4178000688552856e-02 + + 7.5093299150466919e-01 -1.7593200504779816e-01 + <_> + + 0 -1 2557 7.4950000271201134e-03 + + -1.6188099980354309e-01 3.0657500028610229e-01 + <_> + + 0 -1 2558 5.6494999676942825e-02 + + -1.7318800091743469e-01 1.0016150474548340e+00 + <_> + + 0 -1 2559 -5.2939997985959053e-03 + + 2.3417599499225616e-01 -6.5347000956535339e-02 + <_> + + 0 -1 2560 -1.4945000410079956e-02 + + 2.5018900632858276e-01 -3.0591198801994324e-01 + <_> + + 0 -1 2561 5.4919000715017319e-02 + + 1.3121999800205231e-01 -9.3765097856521606e-01 + <_> + + 0 -1 2562 -1.9721999764442444e-02 + + -8.3978497982025146e-01 -2.3473000153899193e-02 + <_> + + 0 -1 2563 -6.7158997058868408e-02 + + 2.3586840629577637e+00 8.2970999181270599e-02 + <_> + + 0 -1 2564 -1.4325999654829502e-02 + + 1.8814499676227570e-01 -3.1221601366996765e-01 + <_> + + 0 -1 2565 2.9841000214219093e-02 + + 1.4825099706649780e-01 -8.4681701660156250e-01 + <_> + + 0 -1 2566 5.1883000880479813e-02 + + -4.3731000274419785e-02 -1.3366169929504395e+00 + <_> + + 0 -1 2567 4.1127000004053116e-02 + + 1.7660099267959595e-01 -6.0904097557067871e-01 + <_> + + 0 -1 2568 -1.2865099310874939e-01 + + -9.8701000213623047e-01 -3.7785001099109650e-02 + <_> + + 0 -1 2569 2.4170000106096268e-03 + + -1.6119599342346191e-01 3.2675701379776001e-01 + <_> + + 0 -1 2570 7.7030002139508724e-03 + + -2.3841500282287598e-01 2.9319399595260620e-01 + <_> + + 0 -1 2571 4.5520000159740448e-02 + + 1.4424599707126617e-01 -1.5010160207748413e+00 + <_> + + 0 -1 2572 -7.8700996935367584e-02 + + -1.0394560098648071e+00 -4.5375999063253403e-02 + <_> + + 0 -1 2573 7.8619997948408127e-03 + + 1.9633600115776062e-01 -1.4472399652004242e-01 + <_> + + 0 -1 2574 -1.3458999805152416e-02 + + -9.0634697675704956e-01 -3.8049001246690750e-02 + <_> + + 0 -1 2575 2.8827000409364700e-02 + + -2.9473999515175819e-02 6.0058397054672241e-01 + <_> + + 0 -1 2576 -2.7365999296307564e-02 + + -9.9804002046585083e-01 -3.8653001189231873e-02 + <_> + + 0 -1 2577 -7.2917997837066650e-02 + + 7.3361498117446899e-01 5.7440001517534256e-02 + <_> + + 0 -1 2578 -1.3988999649882317e-02 + + 2.7892601490020752e-01 -2.6516300439834595e-01 + <_> + + 0 -1 2579 4.3242998421192169e-02 + + 4.7760000452399254e-03 3.5925900936126709e-01 + <_> + + 0 -1 2580 2.9533000662922859e-02 + + -2.0083999633789062e-01 5.1202899217605591e-01 + <_> + + 0 -1 2581 -3.1897000968456268e-02 + + 6.4721697568893433e-01 -1.3760000001639128e-03 + <_> + + 0 -1 2582 3.7868998944759369e-02 + + -1.8363800644874573e-01 6.1343097686767578e-01 + <_> + + 0 -1 2583 -2.2417999804019928e-02 + + -2.9187899827957153e-01 1.8194800615310669e-01 + <_> + + 0 -1 2584 5.8958999812602997e-02 + + -6.6451996564865112e-02 -1.9290030002593994e+00 + <_> + + 0 -1 2585 3.1222999095916748e-02 + + -1.2732000090181828e-02 6.1560797691345215e-01 + <_> + + 0 -1 2586 3.7484999746084213e-02 + + -2.0856900513172150e-01 4.4363999366760254e-01 + <_> + + 0 -1 2587 -2.0966000854969025e-02 + + -3.5712799429893494e-01 2.4252200126647949e-01 + <_> + + 0 -1 2588 -2.5477999821305275e-02 + + 1.0846560001373291e+00 -1.5054400265216827e-01 + <_> + + 0 -1 2589 -7.2570000775158405e-03 + + 2.1302600204944611e-01 -1.8308199942111969e-01 + <_> + + 0 -1 2590 -5.0983000546693802e-02 + + 5.1736801862716675e-01 -1.8833099305629730e-01 + <_> + + 0 -1 2591 -2.0640000700950623e-02 + + -4.4030201435089111e-01 2.2745999693870544e-01 + <_> + + 0 -1 2592 1.0672999545931816e-02 + + 3.5059999674558640e-02 -5.1665002107620239e-01 + <_> + + 0 -1 2593 3.1895998865365982e-02 + + 1.3228000141680241e-02 3.4915199875831604e-01 + <_> + + 0 -1 2594 -2.3824999108910561e-02 + + 3.4118801355361938e-01 -2.1510200202465057e-01 + <_> + + 0 -1 2595 -6.0680001042783260e-03 + + 3.2937398552894592e-01 -2.8523799777030945e-01 + <_> + + 0 -1 2596 2.3881999775767326e-02 + + -2.5333800911903381e-01 2.6296100020408630e-01 + <_> + + 0 -1 2597 2.7966000139713287e-02 + + 1.4049099385738373e-01 -4.9887099862098694e-01 + <_> + + 0 -1 2598 1.4603000134229660e-02 + + -1.5395999886095524e-02 -7.6958000659942627e-01 + <_> + + 0 -1 2599 1.0872399806976318e-01 + + 1.9069600105285645e-01 -3.2393100857734680e-01 + <_> + + 0 -1 2600 -1.4038000255823135e-02 + + 3.4924700856208801e-01 -2.2358700633049011e-01 + <_> + + 0 -1 2601 4.0440000593662262e-03 + + -3.8329001516103745e-02 5.1177299022674561e-01 + <_> + + 0 -1 2602 -4.9769999459385872e-03 + + -4.2888298630714417e-01 4.9173999577760696e-02 + <_> + + 0 -1 2603 -8.5183002054691315e-02 + + 6.6624599695205688e-01 7.8079998493194580e-03 + <_> + + 0 -1 2604 2.1559998858720064e-03 + + -4.9135199189186096e-01 6.9555997848510742e-02 + <_> + + 0 -1 2605 3.6384499073028564e-01 + + 1.2997099757194519e-01 -1.8949509859085083e+00 + <_> + + 0 -1 2606 2.2082500159740448e-01 + + -5.7211998850107193e-02 -1.4281120300292969e+00 + <_> + + 0 -1 2607 -1.6140000894665718e-02 + + -5.7589399814605713e-01 1.8062500655651093e-01 + <_> + + 0 -1 2608 -4.8330001533031464e-02 + + 9.7308498620986938e-01 -1.6513000428676605e-01 + <_> + + 0 -1 2609 1.7529999837279320e-02 + + 1.7932699620723724e-01 -2.7948901057243347e-01 + <_> + + 0 -1 2610 -3.4309998154640198e-02 + + -8.1072497367858887e-01 -1.6596000641584396e-02 + <_> + + 0 -1 2611 -4.5830002054572105e-03 + + 2.7908998727798462e-01 -7.4519999325275421e-03 + <_> + + 0 -1 2612 1.2896400690078735e-01 + + -1.3508500158786774e-01 2.5411539077758789e+00 + <_> + + 0 -1 2613 3.0361000448465347e-02 + + -6.8419001996517181e-02 2.8734099864959717e-01 + <_> + + 0 -1 2614 4.4086001813411713e-02 + + -1.8135899305343628e-01 6.5413200855255127e-01 + <_> + + 0 -1 2615 3.0159999150782824e-03 + + -1.5690499544143677e-01 2.6963800191879272e-01 + <_> + + 0 -1 2616 -2.6336999610066414e-02 + + 2.9175600409507751e-01 -2.5274100899696350e-01 + <_> + + 0 -1 2617 -2.7866000309586525e-02 + + 4.4387501478195190e-01 5.5038001388311386e-02 + <_> + + 0 -1 2618 1.1725000105798244e-02 + + -1.9346499443054199e-01 4.6656700968742371e-01 + <_> + + 0 -1 2619 1.5689999563619494e-03 + + -8.2360003143548965e-03 2.5700899958610535e-01 + <_> + + 0 -1 2620 -3.5550000611692667e-03 + + -4.2430898547172546e-01 7.1174003183841705e-02 + <_> + + 0 -1 2621 -3.1695000827312469e-02 + + -8.5393500328063965e-01 1.6916200518608093e-01 + <_> + + 0 -1 2622 -3.2097000628709793e-02 + + 8.3784902095794678e-01 -1.7597299814224243e-01 + <_> + + 0 -1 2623 1.5544199943542480e-01 + + 9.9550001323223114e-02 2.3873300552368164e+00 + <_> + + 0 -1 2624 8.8045999407768250e-02 + + -1.8725299835205078e-01 6.2384301424026489e-01 + <_> + + 0 -1 2625 -1.6720000421628356e-03 + + 2.5008699297904968e-01 -6.5118998289108276e-02 + <_> + + 0 -1 2626 9.3409996479749680e-03 + + -3.5378900170326233e-01 1.0715000331401825e-01 + <_> + + 0 -1 2627 3.7138000130653381e-02 + + 1.6387000679969788e-01 -9.1718399524688721e-01 + <_> + + 0 -1 2628 8.0183997750282288e-02 + + -1.4812999963760376e-01 1.4895190000534058e+00 + <_> + + 0 -1 2629 -7.9100002767518163e-04 + + -2.1326899528503418e-01 1.9676400721073151e-01 + <_> + + 0 -1 2630 -5.0400001928210258e-03 + + -7.1318697929382324e-01 1.8240000354126096e-03 + <_> + + 0 -1 2631 1.1962399631738663e-01 + + 3.3098999410867691e-02 1.0441709756851196e+00 + <_> + + 0 -1 2632 -4.5280000194907188e-03 + + -2.7308499813079834e-01 2.7229800820350647e-01 + <_> + + 0 -1 2633 -2.9639000073075294e-02 + + 3.6225798726081848e-01 5.6795001029968262e-02 + <_> + + 0 -1 2634 2.6650000363588333e-02 + + -4.8041000962257385e-02 -9.6723502874374390e-01 + <_> + + 0 -1 2635 4.4422000646591187e-02 + + 1.3052900135517120e-01 -3.5077300667762756e-01 + <_> + + 0 -1 2636 -2.4359999224543571e-02 + + -1.0766899585723877e+00 -5.1222998648881912e-02 + <_> + + 0 -1 2637 1.9734999164938927e-02 + + 2.6238000020384789e-02 2.8070500493049622e-01 + <_> + + 0 -1 2638 5.4930001497268677e-03 + + -2.6111298799514771e-01 2.1011400222778320e-01 + <_> + + 0 -1 2639 -2.3200300335884094e-01 + + -1.7748440504074097e+00 1.1482600122690201e-01 + <_> + + 0 -1 2640 -2.5614000856876373e-02 + + 2.9900801181793213e-01 -2.2502499818801880e-01 + <_> + + 0 -1 2641 -6.4949998632073402e-03 + + 1.9563800096511841e-01 -9.9762998521327972e-02 + <_> + + 0 -1 2642 3.9840000681579113e-03 + + -4.3021500110626221e-01 8.1261001527309418e-02 + <_> + + 0 -1 2643 -3.5813000053167343e-02 + + -5.0987398624420166e-01 1.6345900297164917e-01 + <_> + + 0 -1 2644 -1.4169000089168549e-02 + + 7.7978098392486572e-01 -1.7476299405097961e-01 + <_> + + 0 -1 2645 -1.2642100453376770e-01 + + -6.3047897815704346e-01 1.2728300690650940e-01 + <_> + + 0 -1 2646 6.8677999079227448e-02 + + -4.6447999775409698e-02 -1.1128979921340942e+00 + <_> + + 0 -1 2647 8.5864998400211334e-02 + + 1.1835400015115738e-01 -4.8235158920288086e+00 + <_> + + 0 -1 2648 1.5511999838054180e-02 + + -1.7467999830842018e-02 -6.3693398237228394e-01 + <_> + + 0 -1 2649 8.1091001629829407e-02 + + 8.6133003234863281e-02 2.4559431076049805e+00 + <_> + + 0 -1 2650 1.8495000898838043e-02 + + 4.0229000151157379e-02 -5.0858199596405029e-01 + <_> + + 0 -1 2651 -8.6320996284484863e-02 + + -1.9006760120391846e+00 1.1019100248813629e-01 + <_> + + 0 -1 2652 7.2355002164840698e-02 + + -6.2111999839544296e-02 -1.4165179729461670e+00 + <_> + + 0 -1 2653 -7.8179001808166504e-02 + + 8.8849300146102905e-01 4.2369998991489410e-02 + <_> + + 0 -1 2654 9.6681997179985046e-02 + + -2.2094200551509857e-01 3.3575099706649780e-01 + <_> + + 0 -1 2655 -3.9875999093055725e-02 + + 5.7804799079895020e-01 4.5347999781370163e-02 + <_> + + 0 -1 2656 -9.5349997282028198e-03 + + -5.4175698757171631e-01 3.2399999909102917e-03 + <_> + + 0 -1 2657 4.0600000647827983e-04 + + -8.1549003720283508e-02 3.5837900638580322e-01 + <_> + + 0 -1 2658 1.2107999995350838e-02 + + -2.0280399918556213e-01 4.3768000602722168e-01 + <_> + + 0 -1 2659 -2.0873999223113060e-02 + + 4.1469898819923401e-01 -4.5568000525236130e-02 + <_> + + 0 -1 2660 5.7888001203536987e-02 + + -2.9009999707341194e-02 -9.1822302341461182e-01 + <_> + + 0 -1 2661 1.3200000103097409e-04 + + -1.1772400140762329e-01 2.0000000298023224e-01 + <_> + + 0 -1 2662 -1.7137000337243080e-02 + + 3.3004799485206604e-01 -2.3055200278759003e-01 + <_> + + 0 -1 2663 3.0655000358819962e-02 + + -2.1545000374317169e-02 2.6878198981285095e-01 + <_> + + 0 -1 2664 -7.8699999721720815e-04 + + -4.4100698828697205e-01 4.9157999455928802e-02 + <_> + + 0 -1 2665 8.8036999106407166e-02 + + 1.1782000213861465e-01 -2.8293309211730957e+00 + <_> + + 0 -1 2666 -3.9028998464345932e-02 + + 9.1777199506759644e-01 -1.5827399492263794e-01 + <_> + + 0 -1 2667 8.0105997622013092e-02 + + 1.1289200186729431e-01 -1.9937280416488647e+00 + <_> + + 0 -1 2668 3.9538998156785965e-02 + + -1.4357399940490723e-01 1.3085240125656128e+00 + <_> + + 0 -1 2669 2.0684000104665756e-02 + + 2.0048099756240845e-01 -4.4186998158693314e-02 + <_> + + 0 -1 2670 -6.7037999629974365e-02 + + 3.2618600130081177e-01 -2.0550400018692017e-01 + <_> + + 0 -1 2671 4.6815000474452972e-02 + + 1.5825299918651581e-01 -9.5535099506378174e-01 + <_> + + 0 -1 2672 7.8443996608257294e-02 + + -7.4651002883911133e-02 -2.1161499023437500e+00 + <_> + + 0 -1 2673 6.6380001604557037e-02 + + 1.1641900241374969e-01 -1.6113519668579102e+00 + <_> + + 0 -1 2674 3.0053999274969101e-02 + + -1.6562600433826447e-01 7.0025402307510376e-01 + <_> + + 0 -1 2675 1.7119999974966049e-02 + + 2.2627699375152588e-01 -4.0114998817443848e-01 + <_> + + 0 -1 2676 2.0073000341653824e-02 + + -1.9389699399471283e-01 4.4420298933982849e-01 + <_> + + 0 -1 2677 3.3101998269557953e-02 + + 1.1637499928474426e-01 -1.5771679878234863e+00 + <_> + + 0 -1 2678 -1.4882000163197517e-02 + + -8.9680302143096924e-01 -4.2010001838207245e-02 + <_> + + 0 -1 2679 -1.0281000286340714e-02 + + 3.5602998733520508e-01 -1.3124000281095505e-02 + <_> + + 0 -1 2680 -2.8695000335574150e-02 + + -4.6039599180221558e-01 2.6801999658346176e-02 + <_> + + 0 -1 2681 -4.7189998440444469e-03 + + 2.3788799345493317e-01 -6.5518997609615326e-02 + <_> + + 0 -1 2682 3.2201600074768066e-01 + + -2.8489999473094940e-02 -8.4234601259231567e-01 + <_> + + 0 -1 2683 -1.7045000568032265e-02 + + -5.0938802957534790e-01 1.6057600080966949e-01 + <_> + + 0 -1 2684 -7.3469998314976692e-03 + + -5.4154998064041138e-01 4.7320001758635044e-03 + <_> + + 0 -1 2685 -3.0001999810338020e-02 + + -8.8785797357559204e-01 1.3621799647808075e-01 + <_> + + 0 -1 2686 -1.1292999610304832e-02 + + 8.0615198612213135e-01 -1.6159500181674957e-01 + <_> + + 0 -1 2687 4.7749998047947884e-03 + + 1.2968000024557114e-02 5.5079901218414307e-01 + <_> + + 0 -1 2688 5.0710001960396767e-03 + + -4.5728001743555069e-02 -1.0766259431838989e+00 + <_> + + 0 -1 2689 1.9344100356101990e-01 + + 7.1262001991271973e-02 1.1694519519805908e+00 + <_> + + 0 -1 2690 5.3750001825392246e-03 + + -1.9736200571060181e-01 3.8206899166107178e-01 + <_> + + 0 -1 2691 -6.8276003003120422e-02 + + -5.4372339248657227e+00 1.1151900142431259e-01 + <_> + + 0 -1 2692 -3.4933000802993774e-02 + + 4.4793400168418884e-01 -1.8657900393009186e-01 + <_> + + 0 -1 2693 5.1219998858869076e-03 + + -1.4871999621391296e-02 1.8413899838924408e-01 + <_> + + 0 -1 2694 9.5311999320983887e-02 + + -1.5117099881172180e-01 9.4991499185562134e-01 + <_> + + 0 -1 2695 -6.2849000096321106e-02 + + 4.6473601460456848e-01 3.8405001163482666e-02 + <_> + + 0 -1 2696 -1.7040699720382690e-01 + + -1.6499999761581421e+00 -6.3236996531486511e-02 + <_> + + 0 -1 2697 1.0583999566733837e-02 + + -3.8348998874425888e-02 4.1913801431655884e-01 + <_> + + 0 -1 2698 -4.1579000651836395e-02 + + 3.4461900591850281e-01 -2.1187700331211090e-01 + <_> + + 0 -1 2699 1.2718600034713745e-01 + + 1.2398199737071991e-01 -2.1254889965057373e+00 + <_> + + 0 -1 2700 8.2557000219821930e-02 + + -6.2024001032114029e-02 -1.4875819683074951e+00 + <_> + + 0 -1 2701 8.5293002426624298e-02 + + 1.7087999731302261e-02 3.2076600193977356e-01 + <_> + + 0 -1 2702 5.5544000118970871e-02 + + -2.7414000034332275e-01 1.8976399302482605e-01 + <_> + + 0 -1 2703 4.5650000683963299e-03 + + -1.7920200526714325e-01 2.7967301011085510e-01 + <_> + + 0 -1 2704 1.2997999787330627e-02 + + -3.2297500967979431e-01 2.6941800117492676e-01 + <_> + + 0 -1 2705 5.7891998440027237e-02 + + 1.2644399702548981e-01 -6.0713499784469604e-01 + <_> + + 0 -1 2706 -2.2824000567197800e-02 + + -4.9682098627090454e-01 2.2376999258995056e-02 + <_> + + 0 -1 2707 4.8312000930309296e-02 + + 4.3607000261545181e-02 4.8537799715995789e-01 + <_> + + 0 -1 2708 2.5714000687003136e-02 + + -4.2950998991727829e-02 -9.3023502826690674e-01 + <_> + + 0 -1 2709 6.9269998930394650e-03 + + -2.9680000152438879e-03 3.4296301007270813e-01 + <_> + + 0 -1 2710 -3.4446999430656433e-02 + + -1.5299769639968872e+00 -6.1014998704195023e-02 + <_> + + 0 -1 2711 2.9387999325990677e-02 + + 3.7595998495817184e-02 6.4172399044036865e-01 + <_> + + 0 -1 2712 -2.4319998919963837e-03 + + 9.9088996648788452e-02 -3.9688101410865784e-01 + <_> + 200 + -2.9928278923034668e+00 + + <_> + + 0 -1 2713 -9.5944002270698547e-02 + + 6.2419098615646362e-01 -4.5875200629234314e-01 + <_> + + 0 -1 2714 1.6834000125527382e-02 + + -9.3072801828384399e-01 2.1563600003719330e-01 + <_> + + 0 -1 2715 2.6049999520182610e-02 + + -4.0532299876213074e-01 4.2256599664688110e-01 + <_> + + 0 -1 2716 3.6500001442618668e-04 + + 9.5288001000881195e-02 -6.3298100233078003e-01 + <_> + + 0 -1 2717 -6.6940002143383026e-03 + + 3.7243801355361938e-01 -3.0332401394844055e-01 + <_> + + 0 -1 2718 1.8874000757932663e-02 + + -2.3357200622558594e-01 4.0330699086189270e-01 + <_> + + 0 -1 2719 -1.6300000424962491e-04 + + 4.2886998504400253e-02 -7.7796798944473267e-01 + <_> + + 0 -1 2720 -7.6259002089500427e-02 + + -4.9628499150276184e-01 1.6335399448871613e-01 + <_> + + 0 -1 2721 5.0149001181125641e-02 + + 3.2747000455856323e-02 -8.0047899484634399e-01 + <_> + + 0 -1 2722 -2.9239999130368233e-03 + + -5.0002801418304443e-01 2.5480601191520691e-01 + <_> + + 0 -1 2723 1.6243999823927879e-02 + + 3.8913000375032425e-02 -7.0724898576736450e-01 + <_> + + 0 -1 2724 3.7811998277902603e-02 + + -6.6267997026443481e-02 7.3868799209594727e-01 + <_> + + 0 -1 2725 -1.2319999746978283e-02 + + 4.8696398735046387e-01 -2.4485599994659424e-01 + <_> + + 0 -1 2726 5.8003999292850494e-02 + + 1.3459099829196930e-01 -1.3232100009918213e-01 + <_> + + 0 -1 2727 4.8630000092089176e-03 + + -4.4172900915145874e-01 1.4005599915981293e-01 + <_> + + 0 -1 2728 4.5690998435020447e-02 + + 3.1217999756336212e-02 8.9818298816680908e-01 + <_> + + 0 -1 2729 2.1321000531315804e-02 + + 1.2008000165224075e-02 -8.6066198348999023e-01 + <_> + + 0 -1 2730 1.5679100155830383e-01 + + 1.4055999927222729e-02 8.5332900285720825e-01 + <_> + + 0 -1 2731 -1.0328999720513821e-02 + + 2.9022800922393799e-01 -2.9478800296783447e-01 + <_> + + 0 -1 2732 2.4290001019835472e-03 + + -4.0439900755882263e-01 1.9400200247764587e-01 + <_> + + 0 -1 2733 -2.3338999599218369e-02 + + 3.2945200800895691e-01 -2.5712698698043823e-01 + <_> + + 0 -1 2734 -6.8970001302659512e-03 + + -5.3352999687194824e-01 2.1635200083255768e-01 + <_> + + 0 -1 2735 -3.4403000026941299e-02 + + -1.4425489902496338e+00 -4.4682998210191727e-02 + <_> + + 0 -1 2736 -2.1235000342130661e-02 + + -7.9017502069473267e-01 1.9084100425243378e-01 + <_> + + 0 -1 2737 2.0620001014322042e-03 + + -2.6931199431419373e-01 3.1488001346588135e-01 + <_> + + 0 -1 2738 -4.2190002277493477e-03 + + -5.4464399814605713e-01 1.6574600338935852e-01 + <_> + + 0 -1 2739 -1.4334999956190586e-02 + + 2.2105000913143158e-02 -6.2342500686645508e-01 + <_> + + 0 -1 2740 -8.2120001316070557e-03 + + -4.9884998798370361e-01 1.9237099587917328e-01 + <_> + + 0 -1 2741 -9.3350000679492950e-03 + + -7.9131197929382324e-01 -1.4143999665975571e-02 + <_> + + 0 -1 2742 -3.7937998771667480e-02 + + 7.9841297864913940e-01 -3.3799000084400177e-02 + <_> + + 0 -1 2743 4.7059999778866768e-03 + + -3.3163401484489441e-01 2.0726299285888672e-01 + <_> + + 0 -1 2744 -4.4499998912215233e-03 + + -2.7256301045417786e-01 1.8402199447154999e-01 + <_> + + 0 -1 2745 5.2189999260008335e-03 + + -5.3096002340316772e-01 5.2607998251914978e-02 + <_> + + 0 -1 2746 -9.5399999991059303e-03 + + -5.6485402584075928e-01 1.9269399344921112e-01 + <_> + + 0 -1 2747 4.4969998300075531e-02 + + -1.7411500215530396e-01 9.5382601022720337e-01 + <_> + + 0 -1 2748 1.4209000393748283e-02 + + -9.1949000954627991e-02 2.4836100637912750e-01 + <_> + + 0 -1 2749 1.6380199790000916e-01 + + -5.8497000485658646e-02 -1.6404409408569336e+00 + <_> + + 0 -1 2750 2.5579999200999737e-03 + + 2.3447999358177185e-01 -9.2734001576900482e-02 + <_> + + 0 -1 2751 -3.8499999791383743e-03 + + 1.7880700528621674e-01 -3.5844099521636963e-01 + <_> + + 0 -1 2752 -2.5221999734640121e-02 + + -4.2903000116348267e-01 2.0244500041007996e-01 + <_> + + 0 -1 2753 -1.9415000453591347e-02 + + 5.8016300201416016e-01 -1.8806399405002594e-01 + <_> + + 0 -1 2754 1.4419999904930592e-02 + + 3.2846998423337936e-02 8.1980502605438232e-01 + <_> + + 0 -1 2755 5.1582999527454376e-02 + + 6.9176003336906433e-02 -4.5866298675537109e-01 + <_> + + 0 -1 2756 -3.7960000336170197e-02 + + -1.2553000450134277e+00 1.4332899451255798e-01 + <_> + + 0 -1 2757 -2.9560999944806099e-02 + + 5.3151798248291016e-01 -2.0596499741077423e-01 + <_> + + 0 -1 2758 -3.9110999554395676e-02 + + 1.1658719778060913e+00 5.3897000849246979e-02 + <_> + + 0 -1 2759 -2.9159000143408775e-02 + + 3.9307600259780884e-01 -2.2184500098228455e-01 + <_> + + 0 -1 2760 -8.3617001771926880e-02 + + -7.3744499683380127e-01 1.4268200099468231e-01 + <_> + + 0 -1 2761 4.2004001140594482e-01 + + -1.4277400076389313e-01 1.7894840240478516e+00 + <_> + + 0 -1 2762 6.0005001723766327e-02 + + 1.1976700276136398e-01 -1.8886189460754395e+00 + <_> + + 0 -1 2763 -1.8981000408530235e-02 + + -1.4148449897766113e+00 -5.6522998958826065e-02 + <_> + + 0 -1 2764 -6.0049998573958874e-03 + + 4.4170799851417542e-01 -1.0200800001621246e-01 + <_> + + 0 -1 2765 -5.8214001357555389e-02 + + -1.3918470144271851e+00 -4.8268999904394150e-02 + <_> + + 0 -1 2766 -1.2271000072360039e-02 + + 5.1317697763442993e-01 -9.3696996569633484e-02 + <_> + + 0 -1 2767 4.6585999429225922e-02 + + -5.7484000921249390e-02 -1.4283169507980347e+00 + <_> + + 0 -1 2768 1.2110000243410468e-03 + + -8.0891996622085571e-02 3.2333201169967651e-01 + <_> + + 0 -1 2769 -8.8642001152038574e-02 + + -8.6449098587036133e-01 -3.3146999776363373e-02 + <_> + + 0 -1 2770 -2.3184999823570251e-02 + + 5.2162200212478638e-01 -1.6168000176548958e-02 + <_> + + 0 -1 2771 4.3090000748634338e-02 + + -1.6153800487518311e-01 1.0915000438690186e+00 + <_> + + 0 -1 2772 2.0599999697878957e-04 + + -1.7091499269008636e-01 3.1236699223518372e-01 + <_> + + 0 -1 2773 8.9159999042749405e-03 + + -6.7039998248219490e-03 -6.8810397386550903e-01 + <_> + + 0 -1 2774 -1.7752999439835548e-02 + + 6.3292801380157471e-01 -4.2360001243650913e-03 + <_> + + 0 -1 2775 6.2299999408423901e-03 + + -3.3637198805809021e-01 1.2790599465370178e-01 + <_> + + 0 -1 2776 2.2770000621676445e-02 + + -3.4703999757766724e-02 3.9141800999641418e-01 + <_> + + 0 -1 2777 -2.1534999832510948e-02 + + 6.4765101671218872e-01 -2.0097799599170685e-01 + <_> + + 0 -1 2778 6.1758998781442642e-02 + + 5.4297000169754028e-02 9.0700101852416992e-01 + <_> + + 0 -1 2779 -7.8069999814033508e-02 + + 6.5523397922515869e-01 -1.9754399359226227e-01 + <_> + + 0 -1 2780 1.1315000243484974e-02 + + 1.9385300576686859e-01 -5.1707297563552856e-01 + <_> + + 0 -1 2781 -2.5590000674128532e-02 + + -9.3096500635147095e-01 -3.1546998769044876e-02 + <_> + + 0 -1 2782 -3.8058999925851822e-02 + + -6.8326902389526367e-01 1.2709100544452667e-01 + <_> + + 0 -1 2783 9.7970003262162209e-03 + + 1.5523999929428101e-02 -6.3347899913787842e-01 + <_> + + 0 -1 2784 -1.3841999694705009e-02 + + 1.0060529708862305e+00 6.2812998890876770e-02 + <_> + + 0 -1 2785 8.3459997549653053e-03 + + -2.3383200168609619e-01 3.0982699990272522e-01 + <_> + + 0 -1 2786 -7.1439996361732483e-02 + + -7.2505402565002441e-01 1.7148299515247345e-01 + <_> + + 0 -1 2787 1.0006000287830830e-02 + + -2.2071999311447144e-01 3.5266199707984924e-01 + <_> + + 0 -1 2788 1.1005300283432007e-01 + + 1.6662000119686127e-01 -7.4318999052047729e-01 + <_> + + 0 -1 2789 3.5310998558998108e-02 + + -2.3982700705528259e-01 4.1435998678207397e-01 + <_> + + 0 -1 2790 -1.1174699664115906e-01 + + 5.1045399904251099e-01 2.2319999989122152e-03 + <_> + + 0 -1 2791 -1.1367800086736679e-01 + + 9.0475201606750488e-01 -1.6615299880504608e-01 + <_> + + 0 -1 2792 1.6667999327182770e-02 + + 1.4024500548839569e-01 -5.2178502082824707e-01 + <_> + + 0 -1 2793 -8.0340001732110977e-03 + + -6.6178399324417114e-01 3.7640000227838755e-03 + <_> + + 0 -1 2794 -3.3096998929977417e-02 + + 8.0185902118682861e-01 5.9385001659393311e-02 + <_> + + 0 -1 2795 1.2547999620437622e-02 + + -3.3545500040054321e-01 1.4578600227832794e-01 + <_> + + 0 -1 2796 -4.2073998600244522e-02 + + -5.5509102344512939e-01 1.3266600668430328e-01 + <_> + + 0 -1 2797 2.5221999734640121e-02 + + -6.1631999909877777e-02 -1.3678770065307617e+00 + <_> + + 0 -1 2798 -2.4268999695777893e-02 + + 3.4185099601745605e-01 -7.4160001240670681e-03 + <_> + + 0 -1 2799 -1.2280000373721123e-02 + + 2.7745801210403442e-01 -3.1033900380134583e-01 + <_> + + 0 -1 2800 -1.1377099901437759e-01 + + 1.1719540357589722e+00 8.3681002259254456e-02 + <_> + + 0 -1 2801 -8.4771998226642609e-02 + + 8.1694799661636353e-01 -1.7837500572204590e-01 + <_> + + 0 -1 2802 -2.4552000686526299e-02 + + -1.8627299368381500e-01 1.4340099692344666e-01 + <_> + + 0 -1 2803 -9.0269995853304863e-03 + + 3.2659199833869934e-01 -2.3541299998760223e-01 + <_> + + 0 -1 2804 1.1177999898791313e-02 + + 1.9761200249195099e-01 -2.1701000630855560e-02 + <_> + + 0 -1 2805 -2.9366999864578247e-02 + + -9.3414801359176636e-01 -2.1704999729990959e-02 + <_> + + 0 -1 2806 6.3640000298619270e-03 + + 2.5573000311851501e-02 4.6412798762321472e-01 + <_> + + 0 -1 2807 1.4026000164449215e-02 + + -2.1228599548339844e-01 4.0078800916671753e-01 + <_> + + 0 -1 2808 -1.3341999612748623e-02 + + 7.4202698469161987e-01 2.9001999646425247e-02 + <_> + + 0 -1 2809 2.8422799706459045e-01 + + -1.9243599474430084e-01 4.3631199002265930e-01 + <_> + + 0 -1 2810 -2.3724000155925751e-01 + + 6.9736397266387939e-01 6.9307997822761536e-02 + <_> + + 0 -1 2811 -1.1169700324535370e-01 + + 3.9147201180458069e-01 -2.0922000706195831e-01 + <_> + + 0 -1 2812 1.2787500023841858e-01 + + -7.2555996477603912e-02 3.6088201403617859e-01 + <_> + + 0 -1 2813 -6.2900997698307037e-02 + + 9.5424997806549072e-01 -1.5402799844741821e-01 + <_> + + 0 -1 2814 1.7439000308513641e-02 + + -5.1134999841451645e-02 2.7750301361083984e-01 + <_> + + 0 -1 2815 1.2319999514147639e-03 + + 7.5627997517585754e-02 -3.6456099152565002e-01 + <_> + + 0 -1 2816 2.7495000511407852e-02 + + 5.1844000816345215e-02 4.1562598943710327e-01 + <_> + + 0 -1 2817 -4.3543998152017593e-02 + + 7.1969997882843018e-01 -1.7132200300693512e-01 + <_> + + 0 -1 2818 1.1025999672710896e-02 + + 1.4354600012302399e-01 -6.5403002500534058e-01 + <_> + + 0 -1 2819 2.0865999162197113e-02 + + 4.0089000016450882e-02 -4.5743298530578613e-01 + <_> + + 0 -1 2820 -2.2304000332951546e-02 + + 5.3855001926422119e-01 7.1662999689579010e-02 + <_> + + 0 -1 2821 3.2492000609636307e-02 + + -4.5991998165845871e-02 -1.0047069787979126e+00 + <_> + + 0 -1 2822 1.2269999831914902e-02 + + 3.4334998577833176e-02 4.2431798577308655e-01 + <_> + + 0 -1 2823 8.3820000290870667e-03 + + -2.5850600004196167e-01 2.6263499259948730e-01 + <_> + + 0 -1 2824 3.7353999912738800e-02 + + 1.5692499279975891e-01 -1.0429090261459351e+00 + <_> + + 0 -1 2825 -1.4111000113189220e-02 + + -7.3177701234817505e-01 -2.0276999101042747e-02 + <_> + + 0 -1 2826 5.7066999375820160e-02 + + 8.3360001444816589e-02 1.5661499500274658e+00 + <_> + + 0 -1 2827 4.9680001102387905e-03 + + -3.5318198800086975e-01 1.4698399603366852e-01 + <_> + + 0 -1 2828 -2.4492999538779259e-02 + + 2.8325900435447693e-01 -3.4640000667423010e-03 + <_> + + 0 -1 2829 -1.1254999786615372e-02 + + -8.4017497301101685e-01 -3.6251999437808990e-02 + <_> + + 0 -1 2830 3.4533001482486725e-02 + + 1.4998500049114227e-01 -8.7367099523544312e-01 + <_> + + 0 -1 2831 2.4303000420331955e-02 + + -1.8787500262260437e-01 5.9483999013900757e-01 + <_> + + 0 -1 2832 -7.8790001571178436e-03 + + 4.4315698742866516e-01 -5.6570999324321747e-02 + <_> + + 0 -1 2833 3.5142000764608383e-02 + + -5.6494999676942825e-02 -1.3617190122604370e+00 + <_> + + 0 -1 2834 4.6259998343884945e-03 + + -3.1161698698997498e-01 2.5447699427604675e-01 + <_> + + 0 -1 2835 -8.3131000399589539e-02 + + 1.6424349546432495e+00 -1.4429399371147156e-01 + <_> + + 0 -1 2836 -1.4015999622642994e-02 + + -7.7819502353668213e-01 1.7173300683498383e-01 + <_> + + 0 -1 2837 1.2450000504031777e-03 + + -2.3191399872303009e-01 2.8527900576591492e-01 + <_> + + 0 -1 2838 -1.6803000122308731e-02 + + -3.5965099930763245e-01 2.0412999391555786e-01 + <_> + + 0 -1 2839 -7.6747998595237732e-02 + + 7.8050500154495239e-01 -1.5612800419330597e-01 + <_> + + 0 -1 2840 -2.3671999573707581e-01 + + 1.1813700199127197e+00 7.8111998736858368e-02 + <_> + + 0 -1 2841 -1.0057400166988373e-01 + + -4.7104099392890930e-01 7.9172998666763306e-02 + <_> + + 0 -1 2842 1.3239999534562230e-03 + + 2.2262699902057648e-01 -3.7099799513816833e-01 + <_> + + 0 -1 2843 2.2152999415993690e-02 + + -3.8649000227451324e-02 -9.2274999618530273e-01 + <_> + + 0 -1 2844 -1.1246199905872345e-01 + + 4.1899600625038147e-01 8.0411002039909363e-02 + <_> + + 0 -1 2845 1.6481000930070877e-02 + + -1.6756699979305267e-01 7.1842402219772339e-01 + <_> + + 0 -1 2846 6.8113997578620911e-02 + + 1.5719899535179138e-01 -8.7681102752685547e-01 + <_> + + 0 -1 2847 1.6011999920010567e-02 + + -4.1600000113248825e-03 -5.9327799081802368e-01 + <_> + + 0 -1 2848 4.6640001237392426e-03 + + -3.0153999105095863e-02 4.8345300555229187e-01 + <_> + + 0 -1 2849 6.7579997703433037e-03 + + -2.2667400538921356e-01 3.3662301301956177e-01 + <_> + + 0 -1 2850 4.7289999201893806e-03 + + -6.0373999178409576e-02 3.1458100676536560e-01 + <_> + + 0 -1 2851 2.5869999080896378e-03 + + -2.9872599244117737e-01 1.7787499725818634e-01 + <_> + + 0 -1 2852 2.8989999555051327e-03 + + 2.1890200674533844e-01 -2.9567098617553711e-01 + <_> + + 0 -1 2853 -3.0053999274969101e-02 + + 1.2150429487228394e+00 -1.4354999363422394e-01 + <_> + + 0 -1 2854 1.4181000180542469e-02 + + 1.2451999820768833e-02 5.5490100383758545e-01 + <_> + + 0 -1 2855 -6.0527000576257706e-02 + + -1.4933999776840210e+00 -6.5227001905441284e-02 + <_> + + 0 -1 2856 -1.9882999360561371e-02 + + -3.8526400923728943e-01 1.9761200249195099e-01 + <_> + + 0 -1 2857 3.1218999996781349e-02 + + -2.1281200647354126e-01 2.9446500539779663e-01 + <_> + + 0 -1 2858 1.8271999433636665e-02 + + 9.7200000891461968e-04 6.6814202070236206e-01 + <_> + + 0 -1 2859 1.1089999461546540e-03 + + -6.2467902898788452e-01 -1.6599999507889152e-03 + <_> + + 0 -1 2860 -3.6713998764753342e-02 + + -4.2333900928497314e-01 1.2084700167179108e-01 + <_> + + 0 -1 2861 1.2044000439345837e-02 + + 2.5882000103592873e-02 -5.0732398033142090e-01 + <_> + + 0 -1 2862 7.4749000370502472e-02 + + 1.3184699416160583e-01 -2.1739600598812103e-01 + <_> + + 0 -1 2863 -2.3473200201988220e-01 + + 1.1775610446929932e+00 -1.5114699304103851e-01 + <_> + + 0 -1 2864 1.4096499979496002e-01 + + 3.3991001546382904e-02 3.9923098683357239e-01 + <_> + + 0 -1 2865 6.1789997853338718e-03 + + -3.1806701421737671e-01 1.1681699752807617e-01 + <_> + + 0 -1 2866 -5.7216998189687729e-02 + + 8.4399098157882690e-01 8.3889000117778778e-02 + <_> + + 0 -1 2867 -5.5227000266313553e-02 + + 3.6888301372528076e-01 -1.8913400173187256e-01 + <_> + + 0 -1 2868 -2.1583000198006630e-02 + + -5.2161800861358643e-01 1.5772600471973419e-01 + <_> + + 0 -1 2869 2.5747999548912048e-02 + + -5.9921998530626297e-02 -1.0674990415573120e+00 + <_> + + 0 -1 2870 -1.3098999857902527e-02 + + 7.8958398103713989e-01 5.2099999040365219e-02 + <_> + + 0 -1 2871 2.2799998987466097e-03 + + -1.1704430580139160e+00 -5.9356998652219772e-02 + <_> + + 0 -1 2872 8.8060004636645317e-03 + + 4.1717998683452606e-02 6.6352599859237671e-01 + <_> + + 0 -1 2873 -8.9699998497962952e-03 + + -3.5862699151039124e-01 6.0458000749349594e-02 + <_> + + 0 -1 2874 4.0230001322925091e-03 + + 2.0979399979114532e-01 -2.4806000292301178e-01 + <_> + + 0 -1 2875 2.5017000734806061e-02 + + -1.8795900046825409e-01 3.9547100663185120e-01 + <_> + + 0 -1 2876 -5.9009999968111515e-03 + + 2.5663900375366211e-01 -9.4919003546237946e-02 + <_> + + 0 -1 2877 4.3850000947713852e-03 + + 3.3139001578092575e-02 -4.6075400710105896e-01 + <_> + + 0 -1 2878 -3.3771999180316925e-02 + + -9.8881602287292480e-01 1.4636899530887604e-01 + <_> + + 0 -1 2879 4.4523000717163086e-02 + + -1.3286699354648590e-01 1.5796790122985840e+00 + <_> + + 0 -1 2880 -4.0929000824689865e-02 + + 3.3877098560333252e-01 7.4970997869968414e-02 + <_> + + 0 -1 2881 3.9351999759674072e-02 + + -1.8327899277210236e-01 4.6980699896812439e-01 + <_> + + 0 -1 2882 -7.0322997868061066e-02 + + -9.8322701454162598e-01 1.1808100342750549e-01 + <_> + + 0 -1 2883 3.5743001848459244e-02 + + -3.3050999045372009e-02 -8.3610898256301880e-01 + <_> + + 0 -1 2884 -4.2961999773979187e-02 + + 1.1670809984207153e+00 8.0692000687122345e-02 + <_> + + 0 -1 2885 -2.1007999777793884e-02 + + 6.3869798183441162e-01 -1.7626300454139709e-01 + <_> + + 0 -1 2886 -1.5742200613021851e-01 + + -2.3302499949932098e-01 1.2517499923706055e-01 + <_> + + 0 -1 2887 7.8659998252987862e-03 + + -2.2037999331951141e-01 2.7196800708770752e-01 + <_> + + 0 -1 2888 2.3622000589966774e-02 + + 1.6127300262451172e-01 -4.3329000473022461e-01 + <_> + + 0 -1 2889 7.4692003428936005e-02 + + -1.6991999745368958e-01 5.8884900808334351e-01 + <_> + + 0 -1 2890 -6.4799998654052615e-04 + + 2.5842899084091187e-01 -3.5911999642848969e-02 + <_> + + 0 -1 2891 -1.6290999948978424e-02 + + -7.6764398813247681e-01 -2.0472999662160873e-02 + <_> + + 0 -1 2892 -3.3133998513221741e-02 + + -2.7180099487304688e-01 1.4325700700283051e-01 + <_> + + 0 -1 2893 4.8797998577356339e-02 + + 7.6408997178077698e-02 -4.1445198655128479e-01 + <_> + + 0 -1 2894 2.2869999520480633e-03 + + -3.8628999143838882e-02 2.0753799378871918e-01 + <_> + + 0 -1 2895 4.5304000377655029e-02 + + -1.7777900397777557e-01 6.3461399078369141e-01 + <_> + + 0 -1 2896 1.0705800354480743e-01 + + 1.8972299993038177e-01 -5.1236200332641602e-01 + <_> + + 0 -1 2897 -4.0525000542402267e-02 + + 7.0614999532699585e-01 -1.7803299427032471e-01 + <_> + + 0 -1 2898 3.1968999654054642e-02 + + 6.8149998784065247e-02 6.8733102083206177e-01 + <_> + + 0 -1 2899 -5.7617001235485077e-02 + + 7.5170499086380005e-01 -1.5764999389648438e-01 + <_> + + 0 -1 2900 1.3593999668955803e-02 + + 1.9411900639533997e-01 -2.4561899900436401e-01 + <_> + + 0 -1 2901 7.1396000683307648e-02 + + -4.6881001442670822e-02 -8.8198298215866089e-01 + <_> + + 0 -1 2902 -1.4895999804139137e-02 + + -4.4532400369644165e-01 1.7679899930953979e-01 + <_> + + 0 -1 2903 -1.0026000440120697e-02 + + 6.5122699737548828e-01 -1.6709999740123749e-01 + <_> + + 0 -1 2904 3.7589999847114086e-03 + + -5.8301001787185669e-02 3.4483298659324646e-01 + <_> + + 0 -1 2905 1.6263000667095184e-02 + + -1.5581500530242920e-01 8.6432701349258423e-01 + <_> + + 0 -1 2906 -4.0176000446081161e-02 + + -6.1028599739074707e-01 1.1796399950981140e-01 + <_> + + 0 -1 2907 2.7080999687314034e-02 + + -4.9601998180150986e-02 -8.9990001916885376e-01 + <_> + + 0 -1 2908 5.2420001477003098e-02 + + 1.1297199875116348e-01 -1.0833640098571777e+00 + <_> + + 0 -1 2909 -1.9160000607371330e-02 + + -7.9880100488662720e-01 -3.4079000353813171e-02 + <_> + + 0 -1 2910 -3.7730000913143158e-03 + + -1.9124099612236023e-01 2.1535199880599976e-01 + <_> + + 0 -1 2911 7.5762003660202026e-02 + + -1.3421699404716492e-01 1.6807060241699219e+00 + <_> + + 0 -1 2912 -2.2173000499606133e-02 + + 4.8600998520851135e-01 3.6160000599920750e-03 + + <_> + + <_> + 6 4 12 9 -1. + <_> + 6 7 12 3 3. + <_> + + <_> + 6 4 12 7 -1. + <_> + 10 4 4 7 3. + <_> + + <_> + 3 9 18 9 -1. + <_> + 3 12 18 3 3. + <_> + + <_> + 8 18 9 6 -1. + <_> + 8 20 9 2 3. + <_> + + <_> + 3 5 4 19 -1. + <_> + 5 5 2 19 2. + <_> + + <_> + 6 5 12 16 -1. + <_> + 6 13 12 8 2. + <_> + + <_> + 5 8 12 6 -1. + <_> + 5 11 12 3 2. + <_> + + <_> + 11 14 4 10 -1. + <_> + 11 19 4 5 2. + <_> + + <_> + 4 0 7 6 -1. + <_> + 4 3 7 3 2. + <_> + + <_> + 6 6 12 6 -1. + <_> + 6 8 12 2 3. + <_> + + <_> + 6 4 12 7 -1. + <_> + 10 4 4 7 3. + <_> + + <_> + 1 8 19 12 -1. + <_> + 1 12 19 4 3. + <_> + + <_> + 0 2 24 3 -1. + <_> + 8 2 8 3 3. + <_> + + <_> + 9 9 6 15 -1. + <_> + 9 14 6 5 3. + <_> + + <_> + 5 6 14 10 -1. + <_> + 5 11 14 5 2. + <_> + + <_> + 5 0 14 9 -1. + <_> + 5 3 14 3 3. + <_> + + <_> + 13 11 9 6 -1. + <_> + 16 11 3 6 3. + <_> + + <_> + 7 5 6 10 -1. + <_> + 9 5 2 10 3. + <_> + + <_> + 10 8 6 10 -1. + <_> + 12 8 2 10 3. + <_> + + <_> + 2 5 4 9 -1. + <_> + 4 5 2 9 2. + <_> + + <_> + 18 0 6 11 -1. + <_> + 20 0 2 11 3. + <_> + + <_> + 0 6 24 13 -1. + <_> + 8 6 8 13 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 7 18 10 6 -1. + <_> + 7 20 10 2 3. + <_> + + <_> + 5 7 14 12 -1. + <_> + 5 13 14 6 2. + <_> + + <_> + 0 3 24 3 -1. + <_> + 8 3 8 3 3. + <_> + + <_> + 5 8 15 6 -1. + <_> + 5 11 15 3 2. + <_> + + <_> + 9 6 5 14 -1. + <_> + 9 13 5 7 2. + <_> + + <_> + 9 5 6 10 -1. + <_> + 11 5 2 10 3. + <_> + + <_> + 6 6 3 12 -1. + <_> + 6 12 3 6 2. + <_> + + <_> + 3 21 18 3 -1. + <_> + 9 21 6 3 3. + <_> + + <_> + 5 6 13 6 -1. + <_> + 5 8 13 2 3. + <_> + + <_> + 18 1 6 15 -1. + <_> + 18 1 3 15 2. + <_> + + <_> + 1 1 6 15 -1. + <_> + 4 1 3 15 2. + <_> + + <_> + 0 8 24 15 -1. + <_> + 8 8 8 15 3. + <_> + + <_> + 5 6 14 12 -1. + <_> + 5 6 7 6 2. + <_> + 12 12 7 6 2. + <_> + + <_> + 2 12 21 12 -1. + <_> + 2 16 21 4 3. + <_> + + <_> + 8 1 4 10 -1. + <_> + 10 1 2 10 2. + <_> + + <_> + 2 13 20 10 -1. + <_> + 2 13 10 10 2. + <_> + + <_> + 0 1 6 13 -1. + <_> + 2 1 2 13 3. + <_> + + <_> + 20 2 4 13 -1. + <_> + 20 2 2 13 2. + <_> + + <_> + 0 5 22 19 -1. + <_> + 11 5 11 19 2. + <_> + + <_> + 18 4 6 9 -1. + <_> + 20 4 2 9 3. + <_> + + <_> + 0 3 6 11 -1. + <_> + 2 3 2 11 3. + <_> + + <_> + 12 1 4 9 -1. + <_> + 12 1 2 9 2. + <_> + + <_> + 0 6 19 3 -1. + <_> + 0 7 19 1 3. + <_> + + <_> + 12 1 4 9 -1. + <_> + 12 1 2 9 2. + <_> + + <_> + 8 1 4 9 -1. + <_> + 10 1 2 9 2. + <_> + + <_> + 5 5 14 14 -1. + <_> + 12 5 7 7 2. + <_> + 5 12 7 7 2. + <_> + + <_> + 1 10 18 2 -1. + <_> + 1 11 18 1 2. + <_> + + <_> + 17 13 4 11 -1. + <_> + 17 13 2 11 2. + <_> + + <_> + 0 4 6 9 -1. + <_> + 0 7 6 3 3. + <_> + + <_> + 6 4 12 9 -1. + <_> + 6 7 12 3 3. + <_> + + <_> + 6 5 12 6 -1. + <_> + 10 5 4 6 3. + <_> + + <_> + 0 1 24 5 -1. + <_> + 8 1 8 5 3. + <_> + + <_> + 4 10 18 6 -1. + <_> + 4 12 18 2 3. + <_> + + <_> + 2 17 12 6 -1. + <_> + 2 17 6 3 2. + <_> + 8 20 6 3 2. + <_> + + <_> + 19 3 4 13 -1. + <_> + 19 3 2 13 2. + <_> + + <_> + 1 3 4 13 -1. + <_> + 3 3 2 13 2. + <_> + + <_> + 0 1 24 23 -1. + <_> + 8 1 8 23 3. + <_> + + <_> + 1 7 8 12 -1. + <_> + 1 11 8 4 3. + <_> + + <_> + 14 7 3 14 -1. + <_> + 14 14 3 7 2. + <_> + + <_> + 3 12 16 6 -1. + <_> + 3 12 8 3 2. + <_> + 11 15 8 3 2. + <_> + + <_> + 6 6 12 6 -1. + <_> + 6 8 12 2 3. + <_> + + <_> + 8 7 6 12 -1. + <_> + 8 13 6 6 2. + <_> + + <_> + 15 15 9 6 -1. + <_> + 15 17 9 2 3. + <_> + + <_> + 1 17 18 3 -1. + <_> + 1 18 18 1 3. + <_> + + <_> + 4 4 16 12 -1. + <_> + 4 10 16 6 2. + <_> + + <_> + 0 1 4 20 -1. + <_> + 2 1 2 20 2. + <_> + + <_> + 3 0 18 2 -1. + <_> + 3 1 18 1 2. + <_> + + <_> + 1 5 20 14 -1. + <_> + 1 5 10 7 2. + <_> + 11 12 10 7 2. + <_> + + <_> + 5 8 14 12 -1. + <_> + 5 12 14 4 3. + <_> + + <_> + 3 14 7 9 -1. + <_> + 3 17 7 3 3. + <_> + + <_> + 14 15 9 6 -1. + <_> + 14 17 9 2 3. + <_> + + <_> + 1 15 9 6 -1. + <_> + 1 17 9 2 3. + <_> + + <_> + 11 6 8 10 -1. + <_> + 15 6 4 5 2. + <_> + 11 11 4 5 2. + <_> + + <_> + 5 5 14 14 -1. + <_> + 5 5 7 7 2. + <_> + 12 12 7 7 2. + <_> + + <_> + 6 0 12 5 -1. + <_> + 10 0 4 5 3. + <_> + + <_> + 9 0 6 9 -1. + <_> + 9 3 6 3 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 10 6 6 9 -1. + <_> + 12 6 2 9 3. + <_> + + <_> + 8 6 6 9 -1. + <_> + 10 6 2 9 3. + <_> + + <_> + 3 8 18 4 -1. + <_> + 9 8 6 4 3. + <_> + + <_> + 6 0 12 9 -1. + <_> + 6 3 12 3 3. + <_> + + <_> + 0 0 24 6 -1. + <_> + 8 0 8 6 3. + <_> + + <_> + 4 7 16 12 -1. + <_> + 4 11 16 4 3. + <_> + + <_> + 11 6 6 6 -1. + <_> + 11 6 3 6 2. + <_> + + <_> + 0 20 24 3 -1. + <_> + 8 20 8 3 3. + <_> + + <_> + 11 6 4 9 -1. + <_> + 11 6 2 9 2. + <_> + + <_> + 4 13 15 4 -1. + <_> + 9 13 5 4 3. + <_> + + <_> + 11 6 4 9 -1. + <_> + 11 6 2 9 2. + <_> + + <_> + 9 6 4 9 -1. + <_> + 11 6 2 9 2. + <_> + + <_> + 9 12 6 12 -1. + <_> + 9 18 6 6 2. + <_> + + <_> + 1 22 18 2 -1. + <_> + 1 23 18 1 2. + <_> + + <_> + 10 7 4 10 -1. + <_> + 10 12 4 5 2. + <_> + + <_> + 6 7 8 10 -1. + <_> + 6 12 8 5 2. + <_> + + <_> + 7 6 10 6 -1. + <_> + 7 8 10 2 3. + <_> + + <_> + 0 14 10 4 -1. + <_> + 0 16 10 2 2. + <_> + + <_> + 6 18 18 2 -1. + <_> + 6 19 18 1 2. + <_> + + <_> + 1 1 22 3 -1. + <_> + 1 2 22 1 3. + <_> + + <_> + 6 16 18 3 -1. + <_> + 6 17 18 1 3. + <_> + + <_> + 2 4 6 15 -1. + <_> + 5 4 3 15 2. + <_> + + <_> + 20 4 4 10 -1. + <_> + 20 4 2 10 2. + <_> + + <_> + 0 4 4 10 -1. + <_> + 2 4 2 10 2. + <_> + + <_> + 2 16 20 6 -1. + <_> + 12 16 10 3 2. + <_> + 2 19 10 3 2. + <_> + + <_> + 0 12 8 9 -1. + <_> + 4 12 4 9 2. + <_> + + <_> + 12 0 6 9 -1. + <_> + 14 0 2 9 3. + <_> + + <_> + 5 10 6 6 -1. + <_> + 8 10 3 6 2. + <_> + + <_> + 11 8 12 6 -1. + <_> + 17 8 6 3 2. + <_> + 11 11 6 3 2. + <_> + + <_> + 0 8 12 6 -1. + <_> + 0 8 6 3 2. + <_> + 6 11 6 3 2. + <_> + + <_> + 12 0 6 9 -1. + <_> + 14 0 2 9 3. + <_> + + <_> + 6 0 6 9 -1. + <_> + 8 0 2 9 3. + <_> + + <_> + 8 14 9 6 -1. + <_> + 8 16 9 2 3. + <_> + + <_> + 0 16 9 6 -1. + <_> + 0 18 9 2 3. + <_> + + <_> + 10 8 6 10 -1. + <_> + 12 8 2 10 3. + <_> + + <_> + 3 19 12 3 -1. + <_> + 9 19 6 3 2. + <_> + + <_> + 2 10 20 2 -1. + <_> + 2 11 20 1 2. + <_> + + <_> + 2 9 18 12 -1. + <_> + 2 9 9 6 2. + <_> + 11 15 9 6 2. + <_> + + <_> + 3 0 18 24 -1. + <_> + 3 0 9 24 2. + <_> + + <_> + 5 6 14 10 -1. + <_> + 5 6 7 5 2. + <_> + 12 11 7 5 2. + <_> + + <_> + 9 5 10 12 -1. + <_> + 14 5 5 6 2. + <_> + 9 11 5 6 2. + <_> + + <_> + 4 5 12 12 -1. + <_> + 4 5 6 6 2. + <_> + 10 11 6 6 2. + <_> + + <_> + 4 14 18 3 -1. + <_> + 4 15 18 1 3. + <_> + + <_> + 6 13 8 8 -1. + <_> + 6 17 8 4 2. + <_> + + <_> + 3 16 18 6 -1. + <_> + 3 19 18 3 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 6 6 12 18 -1. + <_> + 10 6 4 18 3. + <_> + + <_> + 6 1 4 14 -1. + <_> + 8 1 2 14 2. + <_> + + <_> + 3 2 19 2 -1. + <_> + 3 3 19 1 2. + <_> + + <_> + 1 8 22 13 -1. + <_> + 12 8 11 13 2. + <_> + + <_> + 8 9 11 4 -1. + <_> + 8 11 11 2 2. + <_> + + <_> + 0 12 15 10 -1. + <_> + 5 12 5 10 3. + <_> + + <_> + 12 16 12 6 -1. + <_> + 16 16 4 6 3. + <_> + + <_> + 0 16 12 6 -1. + <_> + 4 16 4 6 3. + <_> + + <_> + 19 1 5 12 -1. + <_> + 19 5 5 4 3. + <_> + + <_> + 0 2 24 4 -1. + <_> + 8 2 8 4 3. + <_> + + <_> + 6 8 12 4 -1. + <_> + 6 10 12 2 2. + <_> + + <_> + 7 5 9 6 -1. + <_> + 10 5 3 6 3. + <_> + + <_> + 9 17 6 6 -1. + <_> + 9 20 6 3 2. + <_> + + <_> + 0 7 22 15 -1. + <_> + 0 12 22 5 3. + <_> + + <_> + 4 1 17 9 -1. + <_> + 4 4 17 3 3. + <_> + + <_> + 7 5 6 10 -1. + <_> + 9 5 2 10 3. + <_> + + <_> + 18 1 6 8 -1. + <_> + 18 1 3 8 2. + <_> + + <_> + 0 1 6 7 -1. + <_> + 3 1 3 7 2. + <_> + + <_> + 18 0 6 22 -1. + <_> + 18 0 3 22 2. + <_> + + <_> + 0 0 6 22 -1. + <_> + 3 0 3 22 2. + <_> + + <_> + 16 7 8 16 -1. + <_> + 16 7 4 16 2. + <_> + + <_> + 2 10 19 6 -1. + <_> + 2 12 19 2 3. + <_> + + <_> + 9 9 6 12 -1. + <_> + 9 13 6 4 3. + <_> + + <_> + 2 15 17 6 -1. + <_> + 2 17 17 2 3. + <_> + + <_> + 14 7 3 14 -1. + <_> + 14 14 3 7 2. + <_> + + <_> + 5 6 8 10 -1. + <_> + 5 6 4 5 2. + <_> + 9 11 4 5 2. + <_> + + <_> + 15 8 9 11 -1. + <_> + 18 8 3 11 3. + <_> + + <_> + 0 8 9 11 -1. + <_> + 3 8 3 11 3. + <_> + + <_> + 8 6 10 18 -1. + <_> + 8 15 10 9 2. + <_> + + <_> + 7 7 3 14 -1. + <_> + 7 14 3 7 2. + <_> + + <_> + 0 14 24 8 -1. + <_> + 8 14 8 8 3. + <_> + + <_> + 1 10 18 14 -1. + <_> + 10 10 9 14 2. + <_> + + <_> + 14 12 6 6 -1. + <_> + 14 15 6 3 2. + <_> + + <_> + 7 0 10 16 -1. + <_> + 7 0 5 8 2. + <_> + 12 8 5 8 2. + <_> + + <_> + 10 0 9 6 -1. + <_> + 13 0 3 6 3. + <_> + + <_> + 4 3 16 4 -1. + <_> + 12 3 8 4 2. + <_> + + <_> + 10 0 9 6 -1. + <_> + 13 0 3 6 3. + <_> + + <_> + 1 1 20 4 -1. + <_> + 1 1 10 2 2. + <_> + 11 3 10 2 2. + <_> + + <_> + 10 0 9 6 -1. + <_> + 13 0 3 6 3. + <_> + + <_> + 5 0 9 6 -1. + <_> + 8 0 3 6 3. + <_> + + <_> + 8 18 10 6 -1. + <_> + 8 20 10 2 3. + <_> + + <_> + 6 3 6 9 -1. + <_> + 8 3 2 9 3. + <_> + + <_> + 7 3 12 6 -1. + <_> + 7 5 12 2 3. + <_> + + <_> + 0 10 18 3 -1. + <_> + 0 11 18 1 3. + <_> + + <_> + 1 10 22 3 -1. + <_> + 1 11 22 1 3. + <_> + + <_> + 5 11 8 8 -1. + <_> + 9 11 4 8 2. + <_> + + <_> + 12 11 6 6 -1. + <_> + 12 11 3 6 2. + <_> + + <_> + 6 11 6 6 -1. + <_> + 9 11 3 6 2. + <_> + + <_> + 7 10 11 6 -1. + <_> + 7 12 11 2 3. + <_> + + <_> + 0 13 24 4 -1. + <_> + 0 13 12 2 2. + <_> + 12 15 12 2 2. + <_> + + <_> + 2 4 22 12 -1. + <_> + 13 4 11 6 2. + <_> + 2 10 11 6 2. + <_> + + <_> + 2 0 20 17 -1. + <_> + 12 0 10 17 2. + <_> + + <_> + 14 0 2 24 -1. + <_> + 14 0 1 24 2. + <_> + + <_> + 8 0 2 24 -1. + <_> + 9 0 1 24 2. + <_> + + <_> + 14 1 2 22 -1. + <_> + 14 1 1 22 2. + <_> + + <_> + 8 1 2 22 -1. + <_> + 9 1 1 22 2. + <_> + + <_> + 17 6 3 18 -1. + <_> + 18 6 1 18 3. + <_> + + <_> + 6 14 9 6 -1. + <_> + 6 16 9 2 3. + <_> + + <_> + 13 14 9 4 -1. + <_> + 13 16 9 2 2. + <_> + + <_> + 3 18 18 3 -1. + <_> + 3 19 18 1 3. + <_> + + <_> + 9 4 8 18 -1. + <_> + 13 4 4 9 2. + <_> + 9 13 4 9 2. + <_> + + <_> + 0 17 18 3 -1. + <_> + 0 18 18 1 3. + <_> + + <_> + 0 2 12 4 -1. + <_> + 6 2 6 4 2. + <_> + + <_> + 6 8 14 6 -1. + <_> + 6 11 14 3 2. + <_> + + <_> + 7 5 6 6 -1. + <_> + 10 5 3 6 2. + <_> + + <_> + 10 5 6 16 -1. + <_> + 10 13 6 8 2. + <_> + + <_> + 1 4 9 16 -1. + <_> + 4 4 3 16 3. + <_> + + <_> + 5 0 18 9 -1. + <_> + 5 3 18 3 3. + <_> + + <_> + 9 15 5 8 -1. + <_> + 9 19 5 4 2. + <_> + + <_> + 20 0 4 9 -1. + <_> + 20 0 2 9 2. + <_> + + <_> + 2 0 18 3 -1. + <_> + 2 1 18 1 3. + <_> + + <_> + 5 22 19 2 -1. + <_> + 5 23 19 1 2. + <_> + + <_> + 0 0 4 9 -1. + <_> + 2 0 2 9 2. + <_> + + <_> + 5 6 19 18 -1. + <_> + 5 12 19 6 3. + <_> + + <_> + 0 1 6 9 -1. + <_> + 2 1 2 9 3. + <_> + + <_> + 6 5 14 12 -1. + <_> + 13 5 7 6 2. + <_> + 6 11 7 6 2. + <_> + + <_> + 0 1 20 2 -1. + <_> + 0 2 20 1 2. + <_> + + <_> + 1 2 22 3 -1. + <_> + 1 3 22 1 3. + <_> + + <_> + 2 8 7 9 -1. + <_> + 2 11 7 3 3. + <_> + + <_> + 2 12 22 4 -1. + <_> + 13 12 11 2 2. + <_> + 2 14 11 2 2. + <_> + + <_> + 0 12 22 4 -1. + <_> + 0 12 11 2 2. + <_> + 11 14 11 2 2. + <_> + + <_> + 9 7 6 11 -1. + <_> + 11 7 2 11 3. + <_> + + <_> + 7 1 9 6 -1. + <_> + 10 1 3 6 3. + <_> + + <_> + 11 2 4 10 -1. + <_> + 11 7 4 5 2. + <_> + + <_> + 6 4 12 12 -1. + <_> + 6 10 12 6 2. + <_> + + <_> + 18 1 6 15 -1. + <_> + 18 6 6 5 3. + <_> + + <_> + 3 15 18 3 -1. + <_> + 3 16 18 1 3. + <_> + + <_> + 18 5 6 9 -1. + <_> + 18 8 6 3 3. + <_> + + <_> + 1 5 16 6 -1. + <_> + 1 5 8 3 2. + <_> + 9 8 8 3 2. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 0 4 24 14 -1. + <_> + 0 4 12 7 2. + <_> + 12 11 12 7 2. + <_> + + <_> + 13 0 4 13 -1. + <_> + 13 0 2 13 2. + <_> + + <_> + 7 0 4 13 -1. + <_> + 9 0 2 13 2. + <_> + + <_> + 11 6 6 9 -1. + <_> + 13 6 2 9 3. + <_> + + <_> + 8 7 6 9 -1. + <_> + 10 7 2 9 3. + <_> + + <_> + 13 17 9 6 -1. + <_> + 13 19 9 2 3. + <_> + + <_> + 2 18 14 6 -1. + <_> + 2 18 7 3 2. + <_> + 9 21 7 3 2. + <_> + + <_> + 3 18 18 4 -1. + <_> + 12 18 9 2 2. + <_> + 3 20 9 2 2. + <_> + + <_> + 0 20 15 4 -1. + <_> + 5 20 5 4 3. + <_> + + <_> + 9 15 15 9 -1. + <_> + 14 15 5 9 3. + <_> + + <_> + 4 4 16 4 -1. + <_> + 4 6 16 2 2. + <_> + + <_> + 7 6 10 6 -1. + <_> + 7 8 10 2 3. + <_> + + <_> + 0 14 15 10 -1. + <_> + 5 14 5 10 3. + <_> + + <_> + 7 9 10 14 -1. + <_> + 12 9 5 7 2. + <_> + 7 16 5 7 2. + <_> + + <_> + 7 6 6 9 -1. + <_> + 9 6 2 9 3. + <_> + + <_> + 3 6 18 3 -1. + <_> + 3 7 18 1 3. + <_> + + <_> + 0 10 18 3 -1. + <_> + 0 11 18 1 3. + <_> + + <_> + 3 16 18 4 -1. + <_> + 12 16 9 2 2. + <_> + 3 18 9 2 2. + <_> + + <_> + 4 6 14 6 -1. + <_> + 4 6 7 3 2. + <_> + 11 9 7 3 2. + <_> + + <_> + 13 0 2 18 -1. + <_> + 13 0 1 18 2. + <_> + + <_> + 9 0 2 18 -1. + <_> + 10 0 1 18 2. + <_> + + <_> + 5 7 15 10 -1. + <_> + 10 7 5 10 3. + <_> + + <_> + 1 20 21 4 -1. + <_> + 8 20 7 4 3. + <_> + + <_> + 10 5 5 18 -1. + <_> + 10 14 5 9 2. + <_> + + <_> + 0 2 24 6 -1. + <_> + 0 2 12 3 2. + <_> + 12 5 12 3 2. + <_> + + <_> + 1 1 22 8 -1. + <_> + 12 1 11 4 2. + <_> + 1 5 11 4 2. + <_> + + <_> + 4 0 15 9 -1. + <_> + 4 3 15 3 3. + <_> + + <_> + 0 0 24 19 -1. + <_> + 8 0 8 19 3. + <_> + + <_> + 2 21 18 3 -1. + <_> + 11 21 9 3 2. + <_> + + <_> + 9 7 10 4 -1. + <_> + 9 7 5 4 2. + <_> + + <_> + 5 7 10 4 -1. + <_> + 10 7 5 4 2. + <_> + + <_> + 17 8 6 16 -1. + <_> + 20 8 3 8 2. + <_> + 17 16 3 8 2. + <_> + + <_> + 1 15 20 4 -1. + <_> + 1 15 10 2 2. + <_> + 11 17 10 2 2. + <_> + + <_> + 14 15 10 6 -1. + <_> + 14 17 10 2 3. + <_> + + <_> + 3 0 16 9 -1. + <_> + 3 3 16 3 3. + <_> + + <_> + 15 6 7 15 -1. + <_> + 15 11 7 5 3. + <_> + + <_> + 9 1 6 13 -1. + <_> + 11 1 2 13 3. + <_> + + <_> + 17 2 6 14 -1. + <_> + 17 2 3 14 2. + <_> + + <_> + 3 14 12 10 -1. + <_> + 3 14 6 5 2. + <_> + 9 19 6 5 2. + <_> + + <_> + 7 6 10 6 -1. + <_> + 7 8 10 2 3. + <_> + + <_> + 1 2 6 14 -1. + <_> + 4 2 3 14 2. + <_> + + <_> + 10 4 5 12 -1. + <_> + 10 8 5 4 3. + <_> + + <_> + 0 17 24 5 -1. + <_> + 8 17 8 5 3. + <_> + + <_> + 15 7 5 12 -1. + <_> + 15 11 5 4 3. + <_> + + <_> + 3 1 6 12 -1. + <_> + 3 1 3 6 2. + <_> + 6 7 3 6 2. + <_> + + <_> + 12 13 6 6 -1. + <_> + 12 16 6 3 2. + <_> + + <_> + 6 13 6 6 -1. + <_> + 6 16 6 3 2. + <_> + + <_> + 14 6 3 16 -1. + <_> + 14 14 3 8 2. + <_> + + <_> + 1 12 13 6 -1. + <_> + 1 14 13 2 3. + <_> + + <_> + 13 1 4 9 -1. + <_> + 13 1 2 9 2. + <_> + + <_> + 7 0 9 6 -1. + <_> + 10 0 3 6 3. + <_> + + <_> + 12 2 6 9 -1. + <_> + 12 2 3 9 2. + <_> + + <_> + 6 2 6 9 -1. + <_> + 9 2 3 9 2. + <_> + + <_> + 6 18 12 6 -1. + <_> + 6 20 12 2 3. + <_> + + <_> + 7 6 6 9 -1. + <_> + 9 6 2 9 3. + <_> + + <_> + 7 7 12 3 -1. + <_> + 7 7 6 3 2. + <_> + + <_> + 8 3 8 21 -1. + <_> + 8 10 8 7 3. + <_> + + <_> + 7 4 10 12 -1. + <_> + 7 8 10 4 3. + <_> + + <_> + 0 1 6 9 -1. + <_> + 0 4 6 3 3. + <_> + + <_> + 15 2 2 20 -1. + <_> + 15 2 1 20 2. + <_> + + <_> + 0 3 6 9 -1. + <_> + 0 6 6 3 3. + <_> + + <_> + 15 3 2 21 -1. + <_> + 15 3 1 21 2. + <_> + + <_> + 7 0 2 23 -1. + <_> + 8 0 1 23 2. + <_> + + <_> + 15 8 9 4 -1. + <_> + 15 10 9 2 2. + <_> + + <_> + 0 8 9 4 -1. + <_> + 0 10 9 2 2. + <_> + + <_> + 8 14 9 6 -1. + <_> + 8 16 9 2 3. + <_> + + <_> + 0 14 9 6 -1. + <_> + 0 16 9 2 3. + <_> + + <_> + 3 10 18 4 -1. + <_> + 9 10 6 4 3. + <_> + + <_> + 0 0 24 19 -1. + <_> + 8 0 8 19 3. + <_> + + <_> + 9 1 8 12 -1. + <_> + 9 7 8 6 2. + <_> + + <_> + 10 6 4 10 -1. + <_> + 12 6 2 10 2. + <_> + + <_> + 7 9 10 12 -1. + <_> + 12 9 5 6 2. + <_> + 7 15 5 6 2. + <_> + + <_> + 5 0 3 19 -1. + <_> + 6 0 1 19 3. + <_> + + <_> + 14 0 6 10 -1. + <_> + 16 0 2 10 3. + <_> + + <_> + 2 0 6 12 -1. + <_> + 2 0 3 6 2. + <_> + 5 6 3 6 2. + <_> + + <_> + 0 11 24 2 -1. + <_> + 0 12 24 1 2. + <_> + + <_> + 4 9 13 4 -1. + <_> + 4 11 13 2 2. + <_> + + <_> + 9 8 6 9 -1. + <_> + 9 11 6 3 3. + <_> + + <_> + 0 12 16 4 -1. + <_> + 0 14 16 2 2. + <_> + + <_> + 18 12 6 9 -1. + <_> + 18 15 6 3 3. + <_> + + <_> + 0 12 6 9 -1. + <_> + 0 15 6 3 3. + <_> + + <_> + 8 7 10 4 -1. + <_> + 8 7 5 4 2. + <_> + + <_> + 8 7 6 9 -1. + <_> + 10 7 2 9 3. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 12 3 6 15 -1. + <_> + 14 3 2 15 3. + <_> + + <_> + 6 3 6 15 -1. + <_> + 8 3 2 15 3. + <_> + + <_> + 15 2 9 4 -1. + <_> + 15 4 9 2 2. + <_> + + <_> + 5 10 6 7 -1. + <_> + 8 10 3 7 2. + <_> + + <_> + 9 14 6 10 -1. + <_> + 9 19 6 5 2. + <_> + + <_> + 7 13 5 8 -1. + <_> + 7 17 5 4 2. + <_> + + <_> + 14 5 3 16 -1. + <_> + 14 13 3 8 2. + <_> + + <_> + 2 17 18 3 -1. + <_> + 2 18 18 1 3. + <_> + + <_> + 5 18 19 3 -1. + <_> + 5 19 19 1 3. + <_> + + <_> + 9 0 6 9 -1. + <_> + 11 0 2 9 3. + <_> + + <_> + 12 4 3 18 -1. + <_> + 13 4 1 18 3. + <_> + + <_> + 9 4 3 18 -1. + <_> + 10 4 1 18 3. + <_> + + <_> + 3 3 18 9 -1. + <_> + 9 3 6 9 3. + <_> + + <_> + 6 1 6 14 -1. + <_> + 8 1 2 14 3. + <_> + + <_> + 12 16 9 6 -1. + <_> + 12 19 9 3 2. + <_> + + <_> + 1 3 20 16 -1. + <_> + 1 3 10 8 2. + <_> + 11 11 10 8 2. + <_> + + <_> + 12 5 6 12 -1. + <_> + 15 5 3 6 2. + <_> + 12 11 3 6 2. + <_> + + <_> + 1 2 22 16 -1. + <_> + 1 2 11 8 2. + <_> + 12 10 11 8 2. + <_> + + <_> + 10 14 5 10 -1. + <_> + 10 19 5 5 2. + <_> + + <_> + 3 21 18 3 -1. + <_> + 3 22 18 1 3. + <_> + + <_> + 10 14 6 10 -1. + <_> + 12 14 2 10 3. + <_> + + <_> + 0 2 24 4 -1. + <_> + 8 2 8 4 3. + <_> + + <_> + 6 4 12 9 -1. + <_> + 6 7 12 3 3. + <_> + + <_> + 6 6 12 5 -1. + <_> + 10 6 4 5 3. + <_> + + <_> + 5 8 14 12 -1. + <_> + 5 12 14 4 3. + <_> + + <_> + 4 14 8 10 -1. + <_> + 4 14 4 5 2. + <_> + 8 19 4 5 2. + <_> + + <_> + 11 6 5 14 -1. + <_> + 11 13 5 7 2. + <_> + + <_> + 7 6 3 16 -1. + <_> + 7 14 3 8 2. + <_> + + <_> + 3 7 18 8 -1. + <_> + 9 7 6 8 3. + <_> + + <_> + 2 3 20 2 -1. + <_> + 2 4 20 1 2. + <_> + + <_> + 3 12 19 6 -1. + <_> + 3 14 19 2 3. + <_> + + <_> + 8 6 6 9 -1. + <_> + 10 6 2 9 3. + <_> + + <_> + 16 6 6 14 -1. + <_> + 16 6 3 14 2. + <_> + + <_> + 7 9 6 12 -1. + <_> + 9 9 2 12 3. + <_> + + <_> + 18 6 6 18 -1. + <_> + 21 6 3 9 2. + <_> + 18 15 3 9 2. + <_> + + <_> + 0 6 6 18 -1. + <_> + 0 6 3 9 2. + <_> + 3 15 3 9 2. + <_> + + <_> + 18 2 6 9 -1. + <_> + 18 5 6 3 3. + <_> + + <_> + 3 18 15 6 -1. + <_> + 3 20 15 2 3. + <_> + + <_> + 18 2 6 9 -1. + <_> + 18 5 6 3 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 5 10 18 2 -1. + <_> + 5 11 18 1 2. + <_> + + <_> + 6 0 12 6 -1. + <_> + 6 2 12 2 3. + <_> + + <_> + 10 0 6 9 -1. + <_> + 12 0 2 9 3. + <_> + + <_> + 8 0 6 9 -1. + <_> + 10 0 2 9 3. + <_> + + <_> + 15 12 9 6 -1. + <_> + 15 14 9 2 3. + <_> + + <_> + 3 6 13 6 -1. + <_> + 3 8 13 2 3. + <_> + + <_> + 15 12 9 6 -1. + <_> + 15 14 9 2 3. + <_> + + <_> + 2 5 6 15 -1. + <_> + 5 5 3 15 2. + <_> + + <_> + 8 8 9 6 -1. + <_> + 11 8 3 6 3. + <_> + + <_> + 8 6 3 14 -1. + <_> + 8 13 3 7 2. + <_> + + <_> + 15 12 9 6 -1. + <_> + 15 14 9 2 3. + <_> + + <_> + 4 12 10 4 -1. + <_> + 9 12 5 4 2. + <_> + + <_> + 13 1 4 19 -1. + <_> + 13 1 2 19 2. + <_> + + <_> + 7 1 4 19 -1. + <_> + 9 1 2 19 2. + <_> + + <_> + 18 9 6 9 -1. + <_> + 18 12 6 3 3. + <_> + + <_> + 1 21 18 3 -1. + <_> + 1 22 18 1 3. + <_> + + <_> + 14 13 10 9 -1. + <_> + 14 16 10 3 3. + <_> + + <_> + 1 13 22 4 -1. + <_> + 1 13 11 2 2. + <_> + 12 15 11 2 2. + <_> + + <_> + 4 6 16 6 -1. + <_> + 12 6 8 3 2. + <_> + 4 9 8 3 2. + <_> + + <_> + 1 0 18 22 -1. + <_> + 1 0 9 11 2. + <_> + 10 11 9 11 2. + <_> + + <_> + 10 7 8 14 -1. + <_> + 14 7 4 7 2. + <_> + 10 14 4 7 2. + <_> + + <_> + 0 4 6 20 -1. + <_> + 0 4 3 10 2. + <_> + 3 14 3 10 2. + <_> + + <_> + 15 0 6 9 -1. + <_> + 17 0 2 9 3. + <_> + + <_> + 3 0 6 9 -1. + <_> + 5 0 2 9 3. + <_> + + <_> + 15 12 6 12 -1. + <_> + 18 12 3 6 2. + <_> + 15 18 3 6 2. + <_> + + <_> + 3 12 6 12 -1. + <_> + 3 12 3 6 2. + <_> + 6 18 3 6 2. + <_> + + <_> + 15 12 9 6 -1. + <_> + 15 14 9 2 3. + <_> + + <_> + 0 12 9 6 -1. + <_> + 0 14 9 2 3. + <_> + + <_> + 4 14 19 3 -1. + <_> + 4 15 19 1 3. + <_> + + <_> + 2 13 19 3 -1. + <_> + 2 14 19 1 3. + <_> + + <_> + 14 15 10 6 -1. + <_> + 14 17 10 2 3. + <_> + + <_> + 6 0 10 12 -1. + <_> + 6 0 5 6 2. + <_> + 11 6 5 6 2. + <_> + + <_> + 17 1 6 12 -1. + <_> + 20 1 3 6 2. + <_> + 17 7 3 6 2. + <_> + + <_> + 1 1 6 12 -1. + <_> + 1 1 3 6 2. + <_> + 4 7 3 6 2. + <_> + + <_> + 16 14 6 9 -1. + <_> + 16 17 6 3 3. + <_> + + <_> + 7 3 9 12 -1. + <_> + 7 9 9 6 2. + <_> + + <_> + 12 1 4 12 -1. + <_> + 12 7 4 6 2. + <_> + + <_> + 4 0 14 8 -1. + <_> + 4 4 14 4 2. + <_> + + <_> + 10 6 6 9 -1. + <_> + 12 6 2 9 3. + <_> + + <_> + 2 10 18 3 -1. + <_> + 8 10 6 3 3. + <_> + + <_> + 15 15 9 6 -1. + <_> + 15 17 9 2 3. + <_> + + <_> + 0 1 21 23 -1. + <_> + 7 1 7 23 3. + <_> + + <_> + 6 9 17 4 -1. + <_> + 6 11 17 2 2. + <_> + + <_> + 1 0 11 18 -1. + <_> + 1 6 11 6 3. + <_> + + <_> + 6 15 13 6 -1. + <_> + 6 17 13 2 3. + <_> + + <_> + 0 15 9 6 -1. + <_> + 0 17 9 2 3. + <_> + + <_> + 8 7 15 4 -1. + <_> + 13 7 5 4 3. + <_> + + <_> + 9 12 6 9 -1. + <_> + 9 15 6 3 3. + <_> + + <_> + 6 8 18 3 -1. + <_> + 12 8 6 3 3. + <_> + + <_> + 0 14 24 4 -1. + <_> + 8 14 8 4 3. + <_> + + <_> + 16 10 3 12 -1. + <_> + 16 16 3 6 2. + <_> + + <_> + 0 3 24 3 -1. + <_> + 0 4 24 1 3. + <_> + + <_> + 14 17 10 6 -1. + <_> + 14 19 10 2 3. + <_> + + <_> + 1 13 18 3 -1. + <_> + 7 13 6 3 3. + <_> + + <_> + 5 0 18 9 -1. + <_> + 5 3 18 3 3. + <_> + + <_> + 4 3 16 9 -1. + <_> + 4 6 16 3 3. + <_> + + <_> + 16 5 3 12 -1. + <_> + 16 11 3 6 2. + <_> + + <_> + 0 7 18 4 -1. + <_> + 6 7 6 4 3. + <_> + + <_> + 10 6 6 9 -1. + <_> + 12 6 2 9 3. + <_> + + <_> + 9 8 6 10 -1. + <_> + 11 8 2 10 3. + <_> + + <_> + 9 15 6 9 -1. + <_> + 11 15 2 9 3. + <_> + + <_> + 3 1 18 21 -1. + <_> + 12 1 9 21 2. + <_> + + <_> + 6 8 12 7 -1. + <_> + 6 8 6 7 2. + <_> + + <_> + 8 5 6 9 -1. + <_> + 10 5 2 9 3. + <_> + + <_> + 0 2 24 4 -1. + <_> + 8 2 8 4 3. + <_> + + <_> + 14 7 5 12 -1. + <_> + 14 11 5 4 3. + <_> + + <_> + 5 7 5 12 -1. + <_> + 5 11 5 4 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 0 1 6 17 -1. + <_> + 3 1 3 17 2. + <_> + + <_> + 3 1 19 9 -1. + <_> + 3 4 19 3 3. + <_> + + <_> + 3 18 12 6 -1. + <_> + 3 18 6 3 2. + <_> + 9 21 6 3 2. + <_> + + <_> + 20 4 4 19 -1. + <_> + 20 4 2 19 2. + <_> + + <_> + 0 16 10 7 -1. + <_> + 5 16 5 7 2. + <_> + + <_> + 8 7 10 12 -1. + <_> + 13 7 5 6 2. + <_> + 8 13 5 6 2. + <_> + + <_> + 6 7 10 12 -1. + <_> + 6 7 5 6 2. + <_> + 11 13 5 6 2. + <_> + + <_> + 9 2 9 6 -1. + <_> + 12 2 3 6 3. + <_> + + <_> + 1 20 21 4 -1. + <_> + 8 20 7 4 3. + <_> + + <_> + 9 12 9 6 -1. + <_> + 9 14 9 2 3. + <_> + + <_> + 7 2 9 6 -1. + <_> + 10 2 3 6 3. + <_> + + <_> + 13 0 4 14 -1. + <_> + 13 0 2 14 2. + <_> + + <_> + 7 0 4 14 -1. + <_> + 9 0 2 14 2. + <_> + + <_> + 14 15 9 6 -1. + <_> + 14 17 9 2 3. + <_> + + <_> + 2 8 18 5 -1. + <_> + 8 8 6 5 3. + <_> + + <_> + 18 3 6 11 -1. + <_> + 20 3 2 11 3. + <_> + + <_> + 6 5 11 14 -1. + <_> + 6 12 11 7 2. + <_> + + <_> + 18 4 6 9 -1. + <_> + 18 7 6 3 3. + <_> + + <_> + 7 6 9 6 -1. + <_> + 7 8 9 2 3. + <_> + + <_> + 18 4 6 9 -1. + <_> + 18 7 6 3 3. + <_> + + <_> + 0 4 6 9 -1. + <_> + 0 7 6 3 3. + <_> + + <_> + 9 4 9 4 -1. + <_> + 9 6 9 2 2. + <_> + + <_> + 0 22 19 2 -1. + <_> + 0 23 19 1 2. + <_> + + <_> + 17 14 6 9 -1. + <_> + 17 17 6 3 3. + <_> + + <_> + 1 14 6 9 -1. + <_> + 1 17 6 3 3. + <_> + + <_> + 14 11 4 9 -1. + <_> + 14 11 2 9 2. + <_> + + <_> + 6 11 4 9 -1. + <_> + 8 11 2 9 2. + <_> + + <_> + 3 9 18 7 -1. + <_> + 9 9 6 7 3. + <_> + + <_> + 9 12 6 10 -1. + <_> + 9 17 6 5 2. + <_> + + <_> + 12 0 6 9 -1. + <_> + 14 0 2 9 3. + <_> + + <_> + 6 0 6 9 -1. + <_> + 8 0 2 9 3. + <_> + + <_> + 6 17 18 3 -1. + <_> + 6 18 18 1 3. + <_> + + <_> + 1 17 18 3 -1. + <_> + 1 18 18 1 3. + <_> + + <_> + 10 6 11 12 -1. + <_> + 10 12 11 6 2. + <_> + + <_> + 5 6 14 6 -1. + <_> + 5 6 7 3 2. + <_> + 12 9 7 3 2. + <_> + + <_> + 5 4 15 4 -1. + <_> + 5 6 15 2 2. + <_> + + <_> + 0 0 22 2 -1. + <_> + 0 1 22 1 2. + <_> + + <_> + 0 0 24 24 -1. + <_> + 8 0 8 24 3. + <_> + + <_> + 1 15 18 4 -1. + <_> + 10 15 9 4 2. + <_> + + <_> + 6 8 12 9 -1. + <_> + 6 11 12 3 3. + <_> + + <_> + 4 12 7 12 -1. + <_> + 4 16 7 4 3. + <_> + + <_> + 1 2 22 6 -1. + <_> + 12 2 11 3 2. + <_> + 1 5 11 3 2. + <_> + + <_> + 5 20 14 3 -1. + <_> + 12 20 7 3 2. + <_> + + <_> + 0 0 24 16 -1. + <_> + 12 0 12 8 2. + <_> + 0 8 12 8 2. + <_> + + <_> + 3 13 18 4 -1. + <_> + 3 13 9 2 2. + <_> + 12 15 9 2 2. + <_> + + <_> + 2 10 22 2 -1. + <_> + 2 11 22 1 2. + <_> + + <_> + 6 3 11 8 -1. + <_> + 6 7 11 4 2. + <_> + + <_> + 14 5 6 6 -1. + <_> + 14 8 6 3 2. + <_> + + <_> + 0 7 24 6 -1. + <_> + 0 9 24 2 3. + <_> + + <_> + 14 0 10 10 -1. + <_> + 19 0 5 5 2. + <_> + 14 5 5 5 2. + <_> + + <_> + 0 0 10 10 -1. + <_> + 0 0 5 5 2. + <_> + 5 5 5 5 2. + <_> + + <_> + 0 1 24 4 -1. + <_> + 12 1 12 2 2. + <_> + 0 3 12 2 2. + <_> + + <_> + 0 17 18 3 -1. + <_> + 0 18 18 1 3. + <_> + + <_> + 5 15 16 6 -1. + <_> + 13 15 8 3 2. + <_> + 5 18 8 3 2. + <_> + + <_> + 3 15 16 6 -1. + <_> + 3 15 8 3 2. + <_> + 11 18 8 3 2. + <_> + + <_> + 6 16 18 3 -1. + <_> + 6 17 18 1 3. + <_> + + <_> + 0 13 21 10 -1. + <_> + 0 18 21 5 2. + <_> + + <_> + 13 0 6 24 -1. + <_> + 15 0 2 24 3. + <_> + + <_> + 7 4 6 11 -1. + <_> + 9 4 2 11 3. + <_> + + <_> + 9 5 9 6 -1. + <_> + 12 5 3 6 3. + <_> + + <_> + 1 4 2 20 -1. + <_> + 1 14 2 10 2. + <_> + + <_> + 13 0 6 24 -1. + <_> + 15 0 2 24 3. + <_> + + <_> + 5 0 6 24 -1. + <_> + 7 0 2 24 3. + <_> + + <_> + 16 7 6 14 -1. + <_> + 19 7 3 7 2. + <_> + 16 14 3 7 2. + <_> + + <_> + 4 7 4 12 -1. + <_> + 6 7 2 12 2. + <_> + + <_> + 0 5 24 14 -1. + <_> + 8 5 8 14 3. + <_> + + <_> + 5 13 10 6 -1. + <_> + 5 15 10 2 3. + <_> + + <_> + 12 0 6 9 -1. + <_> + 14 0 2 9 3. + <_> + + <_> + 2 7 6 14 -1. + <_> + 2 7 3 7 2. + <_> + 5 14 3 7 2. + <_> + + <_> + 15 2 9 15 -1. + <_> + 18 2 3 15 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 2 2 2 9 3. + <_> + + <_> + 12 2 10 14 -1. + <_> + 17 2 5 7 2. + <_> + 12 9 5 7 2. + <_> + + <_> + 11 6 2 18 -1. + <_> + 12 6 1 18 2. + <_> + + <_> + 9 5 15 6 -1. + <_> + 14 5 5 6 3. + <_> + + <_> + 8 6 6 10 -1. + <_> + 10 6 2 10 3. + <_> + + <_> + 12 0 6 9 -1. + <_> + 14 0 2 9 3. + <_> + + <_> + 3 3 9 7 -1. + <_> + 6 3 3 7 3. + <_> + + <_> + 6 7 14 3 -1. + <_> + 6 7 7 3 2. + <_> + + <_> + 7 7 8 6 -1. + <_> + 11 7 4 6 2. + <_> + + <_> + 12 7 7 12 -1. + <_> + 12 13 7 6 2. + <_> + + <_> + 10 6 4 18 -1. + <_> + 10 6 2 9 2. + <_> + 12 15 2 9 2. + <_> + + <_> + 16 14 6 9 -1. + <_> + 16 17 6 3 3. + <_> + + <_> + 4 0 6 13 -1. + <_> + 6 0 2 13 3. + <_> + + <_> + 2 2 21 3 -1. + <_> + 9 2 7 3 3. + <_> + + <_> + 5 4 5 12 -1. + <_> + 5 8 5 4 3. + <_> + + <_> + 10 3 4 10 -1. + <_> + 10 8 4 5 2. + <_> + + <_> + 8 4 5 8 -1. + <_> + 8 8 5 4 2. + <_> + + <_> + 6 0 11 9 -1. + <_> + 6 3 11 3 3. + <_> + + <_> + 6 6 12 5 -1. + <_> + 10 6 4 5 3. + <_> + + <_> + 0 0 24 5 -1. + <_> + 8 0 8 5 3. + <_> + + <_> + 1 10 23 6 -1. + <_> + 1 12 23 2 3. + <_> + + <_> + 3 21 18 3 -1. + <_> + 9 21 6 3 3. + <_> + + <_> + 3 6 21 6 -1. + <_> + 3 8 21 2 3. + <_> + + <_> + 0 5 6 12 -1. + <_> + 2 5 2 12 3. + <_> + + <_> + 10 2 4 15 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 8 7 8 10 -1. + <_> + 8 12 8 5 2. + <_> + + <_> + 5 7 15 12 -1. + <_> + 10 7 5 12 3. + <_> + + <_> + 0 17 10 6 -1. + <_> + 0 19 10 2 3. + <_> + + <_> + 14 18 9 6 -1. + <_> + 14 20 9 2 3. + <_> + + <_> + 9 6 6 16 -1. + <_> + 9 14 6 8 2. + <_> + + <_> + 14 18 9 6 -1. + <_> + 14 20 9 2 3. + <_> + + <_> + 1 18 9 6 -1. + <_> + 1 20 9 2 3. + <_> + + <_> + 15 9 9 6 -1. + <_> + 15 11 9 2 3. + <_> + + <_> + 0 9 9 6 -1. + <_> + 0 11 9 2 3. + <_> + + <_> + 17 3 6 9 -1. + <_> + 19 3 2 9 3. + <_> + + <_> + 2 17 18 3 -1. + <_> + 2 18 18 1 3. + <_> + + <_> + 3 15 21 6 -1. + <_> + 3 17 21 2 3. + <_> + + <_> + 9 17 6 6 -1. + <_> + 9 20 6 3 2. + <_> + + <_> + 18 3 6 9 -1. + <_> + 18 6 6 3 3. + <_> + + <_> + 0 3 6 9 -1. + <_> + 0 6 6 3 3. + <_> + + <_> + 4 0 16 10 -1. + <_> + 12 0 8 5 2. + <_> + 4 5 8 5 2. + <_> + + <_> + 2 0 10 16 -1. + <_> + 2 0 5 8 2. + <_> + 7 8 5 8 2. + <_> + + <_> + 14 0 10 5 -1. + <_> + 14 0 5 5 2. + <_> + + <_> + 0 0 10 5 -1. + <_> + 5 0 5 5 2. + <_> + + <_> + 18 3 6 10 -1. + <_> + 18 3 3 10 2. + <_> + + <_> + 5 11 12 6 -1. + <_> + 5 11 6 3 2. + <_> + 11 14 6 3 2. + <_> + + <_> + 21 0 3 18 -1. + <_> + 22 0 1 18 3. + <_> + + <_> + 6 0 6 9 -1. + <_> + 8 0 2 9 3. + <_> + + <_> + 8 8 9 7 -1. + <_> + 11 8 3 7 3. + <_> + + <_> + 7 12 8 10 -1. + <_> + 7 12 4 5 2. + <_> + 11 17 4 5 2. + <_> + + <_> + 21 0 3 18 -1. + <_> + 22 0 1 18 3. + <_> + + <_> + 10 6 4 9 -1. + <_> + 12 6 2 9 2. + <_> + + <_> + 15 0 9 6 -1. + <_> + 15 2 9 2 3. + <_> + + <_> + 0 2 24 3 -1. + <_> + 0 3 24 1 3. + <_> + + <_> + 11 7 6 9 -1. + <_> + 13 7 2 9 3. + <_> + + <_> + 7 6 6 10 -1. + <_> + 9 6 2 10 3. + <_> + + <_> + 12 1 6 12 -1. + <_> + 14 1 2 12 3. + <_> + + <_> + 6 4 12 12 -1. + <_> + 6 10 12 6 2. + <_> + + <_> + 14 3 2 21 -1. + <_> + 14 3 1 21 2. + <_> + + <_> + 6 1 12 8 -1. + <_> + 6 5 12 4 2. + <_> + + <_> + 3 0 18 8 -1. + <_> + 3 4 18 4 2. + <_> + + <_> + 3 0 18 3 -1. + <_> + 3 1 18 1 3. + <_> + + <_> + 0 13 24 4 -1. + <_> + 12 13 12 2 2. + <_> + 0 15 12 2 2. + <_> + + <_> + 10 5 4 9 -1. + <_> + 12 5 2 9 2. + <_> + + <_> + 11 1 6 9 -1. + <_> + 13 1 2 9 3. + <_> + + <_> + 6 2 6 22 -1. + <_> + 8 2 2 22 3. + <_> + + <_> + 16 10 8 14 -1. + <_> + 20 10 4 7 2. + <_> + 16 17 4 7 2. + <_> + + <_> + 3 4 16 15 -1. + <_> + 3 9 16 5 3. + <_> + + <_> + 16 10 8 14 -1. + <_> + 20 10 4 7 2. + <_> + 16 17 4 7 2. + <_> + + <_> + 0 10 8 14 -1. + <_> + 0 10 4 7 2. + <_> + 4 17 4 7 2. + <_> + + <_> + 10 14 11 6 -1. + <_> + 10 17 11 3 2. + <_> + + <_> + 0 7 24 9 -1. + <_> + 8 7 8 9 3. + <_> + + <_> + 13 1 4 16 -1. + <_> + 13 1 2 16 2. + <_> + + <_> + 7 1 4 16 -1. + <_> + 9 1 2 16 2. + <_> + + <_> + 5 5 16 8 -1. + <_> + 13 5 8 4 2. + <_> + 5 9 8 4 2. + <_> + + <_> + 0 9 6 9 -1. + <_> + 0 12 6 3 3. + <_> + + <_> + 6 16 18 3 -1. + <_> + 6 17 18 1 3. + <_> + + <_> + 3 12 6 9 -1. + <_> + 3 15 6 3 3. + <_> + + <_> + 8 14 9 6 -1. + <_> + 8 16 9 2 3. + <_> + + <_> + 2 13 8 10 -1. + <_> + 2 13 4 5 2. + <_> + 6 18 4 5 2. + <_> + + <_> + 15 5 3 18 -1. + <_> + 15 11 3 6 3. + <_> + + <_> + 3 5 18 3 -1. + <_> + 3 6 18 1 3. + <_> + + <_> + 17 5 6 11 -1. + <_> + 19 5 2 11 3. + <_> + + <_> + 1 5 6 11 -1. + <_> + 3 5 2 11 3. + <_> + + <_> + 19 1 4 9 -1. + <_> + 19 1 2 9 2. + <_> + + <_> + 1 1 4 9 -1. + <_> + 3 1 2 9 2. + <_> + + <_> + 4 15 18 9 -1. + <_> + 4 15 9 9 2. + <_> + + <_> + 6 9 12 4 -1. + <_> + 6 11 12 2 2. + <_> + + <_> + 15 2 9 6 -1. + <_> + 15 4 9 2 3. + <_> + + <_> + 0 2 9 6 -1. + <_> + 0 4 9 2 3. + <_> + + <_> + 15 0 6 17 -1. + <_> + 17 0 2 17 3. + <_> + + <_> + 3 0 6 17 -1. + <_> + 5 0 2 17 3. + <_> + + <_> + 8 17 9 4 -1. + <_> + 8 19 9 2 2. + <_> + + <_> + 6 5 3 18 -1. + <_> + 6 11 3 6 3. + <_> + + <_> + 5 2 14 12 -1. + <_> + 5 8 14 6 2. + <_> + + <_> + 10 2 3 12 -1. + <_> + 10 8 3 6 2. + <_> + + <_> + 10 7 14 15 -1. + <_> + 10 12 14 5 3. + <_> + + <_> + 0 7 14 15 -1. + <_> + 0 12 14 5 3. + <_> + + <_> + 15 0 9 6 -1. + <_> + 15 2 9 2 3. + <_> + + <_> + 0 0 9 6 -1. + <_> + 0 2 9 2 3. + <_> + + <_> + 12 6 6 14 -1. + <_> + 14 6 2 14 3. + <_> + + <_> + 9 7 6 9 -1. + <_> + 11 7 2 9 3. + <_> + + <_> + 12 6 6 15 -1. + <_> + 14 6 2 15 3. + <_> + + <_> + 6 6 6 15 -1. + <_> + 8 6 2 15 3. + <_> + + <_> + 15 3 8 9 -1. + <_> + 15 3 4 9 2. + <_> + + <_> + 0 0 9 21 -1. + <_> + 3 0 3 21 3. + <_> + + <_> + 11 9 8 12 -1. + <_> + 11 13 8 4 3. + <_> + + <_> + 6 7 10 12 -1. + <_> + 6 7 5 6 2. + <_> + 11 13 5 6 2. + <_> + + <_> + 10 6 4 18 -1. + <_> + 12 6 2 9 2. + <_> + 10 15 2 9 2. + <_> + + <_> + 0 0 6 9 -1. + <_> + 0 3 6 3 3. + <_> + + <_> + 3 14 18 3 -1. + <_> + 3 15 18 1 3. + <_> + + <_> + 3 14 8 10 -1. + <_> + 3 14 4 5 2. + <_> + 7 19 4 5 2. + <_> + + <_> + 0 12 24 4 -1. + <_> + 12 12 12 2 2. + <_> + 0 14 12 2 2. + <_> + + <_> + 0 2 3 20 -1. + <_> + 1 2 1 20 3. + <_> + + <_> + 12 16 10 8 -1. + <_> + 17 16 5 4 2. + <_> + 12 20 5 4 2. + <_> + + <_> + 2 16 10 8 -1. + <_> + 2 16 5 4 2. + <_> + 7 20 5 4 2. + <_> + + <_> + 7 0 10 9 -1. + <_> + 7 3 10 3 3. + <_> + + <_> + 0 0 24 3 -1. + <_> + 8 0 8 3 3. + <_> + + <_> + 3 8 15 4 -1. + <_> + 3 10 15 2 2. + <_> + + <_> + 6 5 12 6 -1. + <_> + 10 5 4 6 3. + <_> + + <_> + 5 13 14 6 -1. + <_> + 5 16 14 3 2. + <_> + + <_> + 11 14 4 10 -1. + <_> + 11 19 4 5 2. + <_> + + <_> + 0 6 6 7 -1. + <_> + 3 6 3 7 2. + <_> + + <_> + 18 0 6 6 -1. + <_> + 18 0 3 6 2. + <_> + + <_> + 3 1 18 3 -1. + <_> + 3 2 18 1 3. + <_> + + <_> + 9 6 14 18 -1. + <_> + 9 12 14 6 3. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 13 11 6 6 -1. + <_> + 13 11 3 6 2. + <_> + + <_> + 0 20 24 3 -1. + <_> + 8 20 8 3 3. + <_> + + <_> + 13 11 6 7 -1. + <_> + 13 11 3 7 2. + <_> + + <_> + 4 12 10 6 -1. + <_> + 4 14 10 2 3. + <_> + + <_> + 13 11 6 6 -1. + <_> + 13 11 3 6 2. + <_> + + <_> + 5 11 6 7 -1. + <_> + 8 11 3 7 2. + <_> + + <_> + 7 4 11 12 -1. + <_> + 7 8 11 4 3. + <_> + + <_> + 6 15 10 4 -1. + <_> + 6 17 10 2 2. + <_> + + <_> + 14 0 6 9 -1. + <_> + 16 0 2 9 3. + <_> + + <_> + 4 0 6 9 -1. + <_> + 6 0 2 9 3. + <_> + + <_> + 11 2 4 15 -1. + <_> + 11 7 4 5 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 13 18 10 6 -1. + <_> + 13 20 10 2 3. + <_> + + <_> + 2 7 6 11 -1. + <_> + 5 7 3 11 2. + <_> + + <_> + 10 14 10 9 -1. + <_> + 10 17 10 3 3. + <_> + + <_> + 8 2 4 9 -1. + <_> + 10 2 2 9 2. + <_> + + <_> + 14 3 10 4 -1. + <_> + 14 3 5 4 2. + <_> + + <_> + 6 6 12 6 -1. + <_> + 6 6 6 3 2. + <_> + 12 9 6 3 2. + <_> + + <_> + 8 8 8 10 -1. + <_> + 12 8 4 5 2. + <_> + 8 13 4 5 2. + <_> + + <_> + 7 4 4 16 -1. + <_> + 7 12 4 8 2. + <_> + + <_> + 8 8 9 4 -1. + <_> + 8 10 9 2 2. + <_> + + <_> + 5 2 14 9 -1. + <_> + 5 5 14 3 3. + <_> + + <_> + 3 16 19 8 -1. + <_> + 3 20 19 4 2. + <_> + + <_> + 0 0 10 8 -1. + <_> + 5 0 5 8 2. + <_> + + <_> + 5 2 16 18 -1. + <_> + 5 2 8 18 2. + <_> + + <_> + 0 11 24 11 -1. + <_> + 8 11 8 11 3. + <_> + + <_> + 3 3 18 5 -1. + <_> + 3 3 9 5 2. + <_> + + <_> + 1 16 18 3 -1. + <_> + 1 17 18 1 3. + <_> + + <_> + 5 17 18 3 -1. + <_> + 5 18 18 1 3. + <_> + + <_> + 1 13 9 6 -1. + <_> + 1 15 9 2 3. + <_> + + <_> + 1 9 23 10 -1. + <_> + 1 14 23 5 2. + <_> + + <_> + 3 7 18 3 -1. + <_> + 3 8 18 1 3. + <_> + + <_> + 6 8 12 3 -1. + <_> + 6 8 6 3 2. + <_> + + <_> + 6 2 3 22 -1. + <_> + 7 2 1 22 3. + <_> + + <_> + 14 17 10 6 -1. + <_> + 14 19 10 2 3. + <_> + + <_> + 1 18 10 6 -1. + <_> + 1 20 10 2 3. + <_> + + <_> + 11 3 6 12 -1. + <_> + 13 3 2 12 3. + <_> + + <_> + 10 6 4 9 -1. + <_> + 12 6 2 9 2. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 12 10 9 6 -1. + <_> + 15 10 3 6 3. + <_> + + <_> + 2 11 6 9 -1. + <_> + 5 11 3 9 2. + <_> + + <_> + 14 5 3 19 -1. + <_> + 15 5 1 19 3. + <_> + + <_> + 6 6 9 6 -1. + <_> + 6 8 9 2 3. + <_> + + <_> + 14 5 3 19 -1. + <_> + 15 5 1 19 3. + <_> + + <_> + 0 3 6 9 -1. + <_> + 0 6 6 3 3. + <_> + + <_> + 5 21 18 3 -1. + <_> + 5 22 18 1 3. + <_> + + <_> + 1 10 18 4 -1. + <_> + 7 10 6 4 3. + <_> + + <_> + 13 4 8 10 -1. + <_> + 17 4 4 5 2. + <_> + 13 9 4 5 2. + <_> + + <_> + 7 8 9 6 -1. + <_> + 10 8 3 6 3. + <_> + + <_> + 12 9 9 8 -1. + <_> + 15 9 3 8 3. + <_> + + <_> + 0 6 5 12 -1. + <_> + 0 10 5 4 3. + <_> + + <_> + 7 6 14 6 -1. + <_> + 14 6 7 3 2. + <_> + 7 9 7 3 2. + <_> + + <_> + 7 5 3 19 -1. + <_> + 8 5 1 19 3. + <_> + + <_> + 8 4 15 20 -1. + <_> + 13 4 5 20 3. + <_> + + <_> + 1 4 15 20 -1. + <_> + 6 4 5 20 3. + <_> + + <_> + 13 10 6 6 -1. + <_> + 13 10 3 6 2. + <_> + + <_> + 5 10 6 6 -1. + <_> + 8 10 3 6 2. + <_> + + <_> + 14 2 6 14 -1. + <_> + 17 2 3 7 2. + <_> + 14 9 3 7 2. + <_> + + <_> + 4 2 6 14 -1. + <_> + 4 2 3 7 2. + <_> + 7 9 3 7 2. + <_> + + <_> + 12 4 6 7 -1. + <_> + 12 4 3 7 2. + <_> + + <_> + 9 4 6 9 -1. + <_> + 11 4 2 9 3. + <_> + + <_> + 11 4 8 10 -1. + <_> + 11 4 4 10 2. + <_> + + <_> + 5 4 8 10 -1. + <_> + 9 4 4 10 2. + <_> + + <_> + 8 18 10 6 -1. + <_> + 8 20 10 2 3. + <_> + + <_> + 1 18 21 6 -1. + <_> + 1 20 21 2 3. + <_> + + <_> + 9 2 12 6 -1. + <_> + 9 2 6 6 2. + <_> + + <_> + 3 2 12 6 -1. + <_> + 9 2 6 6 2. + <_> + + <_> + 12 5 12 6 -1. + <_> + 18 5 6 3 2. + <_> + 12 8 6 3 2. + <_> + + <_> + 8 8 6 9 -1. + <_> + 8 11 6 3 3. + <_> + + <_> + 2 7 20 6 -1. + <_> + 2 9 20 2 3. + <_> + + <_> + 0 5 12 6 -1. + <_> + 0 5 6 3 2. + <_> + 6 8 6 3 2. + <_> + + <_> + 14 14 8 10 -1. + <_> + 18 14 4 5 2. + <_> + 14 19 4 5 2. + <_> + + <_> + 2 14 8 10 -1. + <_> + 2 14 4 5 2. + <_> + 6 19 4 5 2. + <_> + + <_> + 2 11 20 13 -1. + <_> + 2 11 10 13 2. + <_> + + <_> + 6 9 12 5 -1. + <_> + 12 9 6 5 2. + <_> + + <_> + 5 6 16 6 -1. + <_> + 13 6 8 3 2. + <_> + 5 9 8 3 2. + <_> + + <_> + 1 19 9 4 -1. + <_> + 1 21 9 2 2. + <_> + + <_> + 7 5 12 5 -1. + <_> + 11 5 4 5 3. + <_> + + <_> + 3 5 14 12 -1. + <_> + 3 5 7 6 2. + <_> + 10 11 7 6 2. + <_> + + <_> + 9 4 9 6 -1. + <_> + 12 4 3 6 3. + <_> + + <_> + 2 6 19 3 -1. + <_> + 2 7 19 1 3. + <_> + + <_> + 18 10 6 9 -1. + <_> + 18 13 6 3 3. + <_> + + <_> + 3 7 18 2 -1. + <_> + 3 8 18 1 2. + <_> + + <_> + 20 2 4 18 -1. + <_> + 22 2 2 9 2. + <_> + 20 11 2 9 2. + <_> + + <_> + 2 18 20 3 -1. + <_> + 2 19 20 1 3. + <_> + + <_> + 1 9 22 3 -1. + <_> + 1 10 22 1 3. + <_> + + <_> + 0 2 4 18 -1. + <_> + 0 2 2 9 2. + <_> + 2 11 2 9 2. + <_> + + <_> + 19 0 4 23 -1. + <_> + 19 0 2 23 2. + <_> + + <_> + 0 3 6 19 -1. + <_> + 3 3 3 19 2. + <_> + + <_> + 18 2 6 9 -1. + <_> + 20 2 2 9 3. + <_> + + <_> + 0 5 10 6 -1. + <_> + 0 7 10 2 3. + <_> + + <_> + 7 0 12 12 -1. + <_> + 13 0 6 6 2. + <_> + 7 6 6 6 2. + <_> + + <_> + 0 3 24 6 -1. + <_> + 0 3 12 3 2. + <_> + 12 6 12 3 2. + <_> + + <_> + 10 14 4 10 -1. + <_> + 10 19 4 5 2. + <_> + + <_> + 8 9 4 15 -1. + <_> + 8 14 4 5 3. + <_> + + <_> + 4 11 17 6 -1. + <_> + 4 14 17 3 2. + <_> + + <_> + 2 5 18 8 -1. + <_> + 2 5 9 4 2. + <_> + 11 9 9 4 2. + <_> + + <_> + 7 6 14 6 -1. + <_> + 14 6 7 3 2. + <_> + 7 9 7 3 2. + <_> + + <_> + 3 6 14 6 -1. + <_> + 3 6 7 3 2. + <_> + 10 9 7 3 2. + <_> + + <_> + 16 5 3 18 -1. + <_> + 17 5 1 18 3. + <_> + + <_> + 5 5 3 18 -1. + <_> + 6 5 1 18 3. + <_> + + <_> + 10 10 14 4 -1. + <_> + 10 12 14 2 2. + <_> + + <_> + 4 10 9 4 -1. + <_> + 4 12 9 2 2. + <_> + + <_> + 2 0 18 9 -1. + <_> + 2 3 18 3 3. + <_> + + <_> + 6 3 12 8 -1. + <_> + 10 3 4 8 3. + <_> + + <_> + 1 1 8 5 -1. + <_> + 5 1 4 5 2. + <_> + + <_> + 12 7 7 8 -1. + <_> + 12 11 7 4 2. + <_> + + <_> + 0 12 22 4 -1. + <_> + 0 14 22 2 2. + <_> + + <_> + 15 6 4 15 -1. + <_> + 15 11 4 5 3. + <_> + + <_> + 5 7 7 8 -1. + <_> + 5 11 7 4 2. + <_> + + <_> + 8 18 9 4 -1. + <_> + 8 20 9 2 2. + <_> + + <_> + 1 2 22 4 -1. + <_> + 1 4 22 2 2. + <_> + + <_> + 17 3 6 17 -1. + <_> + 19 3 2 17 3. + <_> + + <_> + 8 2 8 18 -1. + <_> + 8 11 8 9 2. + <_> + + <_> + 17 0 6 12 -1. + <_> + 20 0 3 6 2. + <_> + 17 6 3 6 2. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 15 5 9 12 -1. + <_> + 15 11 9 6 2. + <_> + + <_> + 2 22 18 2 -1. + <_> + 2 23 18 1 2. + <_> + + <_> + 10 10 12 6 -1. + <_> + 16 10 6 3 2. + <_> + 10 13 6 3 2. + <_> + + <_> + 0 1 4 11 -1. + <_> + 2 1 2 11 2. + <_> + + <_> + 20 0 4 10 -1. + <_> + 20 0 2 10 2. + <_> + + <_> + 1 3 6 17 -1. + <_> + 3 3 2 17 3. + <_> + + <_> + 15 15 9 6 -1. + <_> + 15 17 9 2 3. + <_> + + <_> + 0 13 8 9 -1. + <_> + 0 16 8 3 3. + <_> + + <_> + 16 8 6 12 -1. + <_> + 16 12 6 4 3. + <_> + + <_> + 2 8 6 12 -1. + <_> + 2 12 6 4 3. + <_> + + <_> + 10 2 4 15 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 1 5 19 3 -1. + <_> + 1 6 19 1 3. + <_> + + <_> + 11 8 9 7 -1. + <_> + 14 8 3 7 3. + <_> + + <_> + 3 8 12 9 -1. + <_> + 3 11 12 3 3. + <_> + + <_> + 3 6 18 3 -1. + <_> + 3 7 18 1 3. + <_> + + <_> + 10 0 4 12 -1. + <_> + 10 6 4 6 2. + <_> + + <_> + 3 9 18 14 -1. + <_> + 3 9 9 14 2. + <_> + + <_> + 0 0 4 9 -1. + <_> + 2 0 2 9 2. + <_> + + <_> + 12 5 4 18 -1. + <_> + 12 5 2 18 2. + <_> + + <_> + 8 5 4 18 -1. + <_> + 10 5 2 18 2. + <_> + + <_> + 10 5 6 10 -1. + <_> + 12 5 2 10 3. + <_> + + <_> + 9 4 4 11 -1. + <_> + 11 4 2 11 2. + <_> + + <_> + 4 16 18 3 -1. + <_> + 4 17 18 1 3. + <_> + + <_> + 0 16 20 3 -1. + <_> + 0 17 20 1 3. + <_> + + <_> + 9 9 6 12 -1. + <_> + 9 13 6 4 3. + <_> + + <_> + 8 13 8 8 -1. + <_> + 8 17 8 4 2. + <_> + + <_> + 13 10 3 12 -1. + <_> + 13 16 3 6 2. + <_> + + <_> + 5 9 14 14 -1. + <_> + 5 9 7 7 2. + <_> + 12 16 7 7 2. + <_> + + <_> + 0 0 24 10 -1. + <_> + 12 0 12 5 2. + <_> + 0 5 12 5 2. + <_> + + <_> + 1 11 18 2 -1. + <_> + 1 12 18 1 2. + <_> + + <_> + 19 5 5 12 -1. + <_> + 19 9 5 4 3. + <_> + + <_> + 0 5 5 12 -1. + <_> + 0 9 5 4 3. + <_> + + <_> + 16 6 8 18 -1. + <_> + 20 6 4 9 2. + <_> + 16 15 4 9 2. + <_> + + <_> + 0 6 8 18 -1. + <_> + 0 6 4 9 2. + <_> + 4 15 4 9 2. + <_> + + <_> + 12 5 12 12 -1. + <_> + 18 5 6 6 2. + <_> + 12 11 6 6 2. + <_> + + <_> + 7 6 6 9 -1. + <_> + 9 6 2 9 3. + <_> + + <_> + 9 13 6 11 -1. + <_> + 11 13 2 11 3. + <_> + + <_> + 0 5 12 12 -1. + <_> + 0 5 6 6 2. + <_> + 6 11 6 6 2. + <_> + + <_> + 1 2 23 3 -1. + <_> + 1 3 23 1 3. + <_> + + <_> + 1 15 19 3 -1. + <_> + 1 16 19 1 3. + <_> + + <_> + 13 17 11 4 -1. + <_> + 13 19 11 2 2. + <_> + + <_> + 0 13 8 5 -1. + <_> + 4 13 4 5 2. + <_> + + <_> + 12 10 10 4 -1. + <_> + 12 10 5 4 2. + <_> + + <_> + 4 6 9 9 -1. + <_> + 4 9 9 3 3. + <_> + + <_> + 15 14 9 6 -1. + <_> + 15 16 9 2 3. + <_> + + <_> + 1 12 9 6 -1. + <_> + 1 14 9 2 3. + <_> + + <_> + 3 10 20 8 -1. + <_> + 13 10 10 4 2. + <_> + 3 14 10 4 2. + <_> + + <_> + 2 0 9 18 -1. + <_> + 5 0 3 18 3. + <_> + + <_> + 13 11 9 10 -1. + <_> + 16 11 3 10 3. + <_> + + <_> + 1 2 8 5 -1. + <_> + 5 2 4 5 2. + <_> + + <_> + 3 4 21 6 -1. + <_> + 10 4 7 6 3. + <_> + + <_> + 7 0 10 14 -1. + <_> + 7 0 5 7 2. + <_> + 12 7 5 7 2. + <_> + + <_> + 12 17 12 4 -1. + <_> + 12 19 12 2 2. + <_> + + <_> + 0 6 23 4 -1. + <_> + 0 8 23 2 2. + <_> + + <_> + 13 10 8 10 -1. + <_> + 17 10 4 5 2. + <_> + 13 15 4 5 2. + <_> + + <_> + 0 16 18 3 -1. + <_> + 0 17 18 1 3. + <_> + + <_> + 15 16 9 4 -1. + <_> + 15 18 9 2 2. + <_> + + <_> + 0 16 9 4 -1. + <_> + 0 18 9 2 2. + <_> + + <_> + 13 11 6 6 -1. + <_> + 13 11 3 6 2. + <_> + + <_> + 5 11 6 6 -1. + <_> + 8 11 3 6 2. + <_> + + <_> + 0 3 24 6 -1. + <_> + 12 3 12 3 2. + <_> + 0 6 12 3 2. + <_> + + <_> + 2 4 18 3 -1. + <_> + 2 5 18 1 3. + <_> + + <_> + 0 0 24 4 -1. + <_> + 12 0 12 2 2. + <_> + 0 2 12 2 2. + <_> + + <_> + 1 16 18 3 -1. + <_> + 1 17 18 1 3. + <_> + + <_> + 15 15 9 6 -1. + <_> + 15 17 9 2 3. + <_> + + <_> + 0 15 9 6 -1. + <_> + 0 17 9 2 3. + <_> + + <_> + 6 17 18 3 -1. + <_> + 6 18 18 1 3. + <_> + + <_> + 8 8 6 10 -1. + <_> + 10 8 2 10 3. + <_> + + <_> + 10 6 6 9 -1. + <_> + 12 6 2 9 3. + <_> + + <_> + 8 8 5 8 -1. + <_> + 8 12 5 4 2. + <_> + + <_> + 12 8 6 8 -1. + <_> + 12 12 6 4 2. + <_> + + <_> + 6 5 6 11 -1. + <_> + 8 5 2 11 3. + <_> + + <_> + 13 6 8 9 -1. + <_> + 13 9 8 3 3. + <_> + + <_> + 1 7 21 6 -1. + <_> + 1 9 21 2 3. + <_> + + <_> + 15 5 3 12 -1. + <_> + 15 11 3 6 2. + <_> + + <_> + 6 9 11 12 -1. + <_> + 6 13 11 4 3. + <_> + + <_> + 13 8 10 8 -1. + <_> + 18 8 5 4 2. + <_> + 13 12 5 4 2. + <_> + + <_> + 5 8 12 3 -1. + <_> + 11 8 6 3 2. + <_> + + <_> + 6 11 18 4 -1. + <_> + 12 11 6 4 3. + <_> + + <_> + 0 0 22 22 -1. + <_> + 0 11 22 11 2. + <_> + + <_> + 11 2 6 8 -1. + <_> + 11 6 6 4 2. + <_> + + <_> + 9 0 6 9 -1. + <_> + 11 0 2 9 3. + <_> + + <_> + 10 0 6 9 -1. + <_> + 12 0 2 9 3. + <_> + + <_> + 8 3 6 14 -1. + <_> + 8 3 3 7 2. + <_> + 11 10 3 7 2. + <_> + + <_> + 3 10 18 8 -1. + <_> + 9 10 6 8 3. + <_> + + <_> + 10 0 3 14 -1. + <_> + 10 7 3 7 2. + <_> + + <_> + 4 3 16 20 -1. + <_> + 4 13 16 10 2. + <_> + + <_> + 9 4 6 10 -1. + <_> + 11 4 2 10 3. + <_> + + <_> + 5 0 16 4 -1. + <_> + 5 2 16 2 2. + <_> + + <_> + 2 5 18 4 -1. + <_> + 8 5 6 4 3. + <_> + + <_> + 13 0 6 9 -1. + <_> + 15 0 2 9 3. + <_> + + <_> + 8 4 8 5 -1. + <_> + 12 4 4 5 2. + <_> + + <_> + 12 10 10 4 -1. + <_> + 12 10 5 4 2. + <_> + + <_> + 2 10 10 4 -1. + <_> + 7 10 5 4 2. + <_> + + <_> + 7 11 12 5 -1. + <_> + 11 11 4 5 3. + <_> + + <_> + 3 10 8 10 -1. + <_> + 3 10 4 5 2. + <_> + 7 15 4 5 2. + <_> + + <_> + 11 12 9 8 -1. + <_> + 14 12 3 8 3. + <_> + + <_> + 0 21 24 3 -1. + <_> + 8 21 8 3 3. + <_> + + <_> + 3 20 18 4 -1. + <_> + 9 20 6 4 3. + <_> + + <_> + 1 15 9 6 -1. + <_> + 1 17 9 2 3. + <_> + + <_> + 11 17 10 4 -1. + <_> + 11 19 10 2 2. + <_> + + <_> + 9 12 4 12 -1. + <_> + 9 18 4 6 2. + <_> + + <_> + 9 6 9 6 -1. + <_> + 12 6 3 6 3. + <_> + + <_> + 1 13 6 9 -1. + <_> + 1 16 6 3 3. + <_> + + <_> + 6 16 12 4 -1. + <_> + 6 18 12 2 2. + <_> + + <_> + 1 5 20 3 -1. + <_> + 1 6 20 1 3. + <_> + + <_> + 8 1 9 9 -1. + <_> + 8 4 9 3 3. + <_> + + <_> + 2 19 9 4 -1. + <_> + 2 21 9 2 2. + <_> + + <_> + 11 1 4 18 -1. + <_> + 11 7 4 6 3. + <_> + + <_> + 7 2 8 12 -1. + <_> + 7 2 4 6 2. + <_> + 11 8 4 6 2. + <_> + + <_> + 11 10 9 8 -1. + <_> + 14 10 3 8 3. + <_> + + <_> + 5 11 12 5 -1. + <_> + 9 11 4 5 3. + <_> + + <_> + 11 9 9 6 -1. + <_> + 14 9 3 6 3. + <_> + + <_> + 5 10 6 9 -1. + <_> + 7 10 2 9 3. + <_> + + <_> + 4 7 5 12 -1. + <_> + 4 11 5 4 3. + <_> + + <_> + 2 0 21 6 -1. + <_> + 9 0 7 6 3. + <_> + + <_> + 7 6 10 6 -1. + <_> + 7 8 10 2 3. + <_> + + <_> + 9 0 6 15 -1. + <_> + 11 0 2 15 3. + <_> + + <_> + 2 2 18 2 -1. + <_> + 2 3 18 1 2. + <_> + + <_> + 8 17 8 6 -1. + <_> + 8 20 8 3 2. + <_> + + <_> + 3 0 18 2 -1. + <_> + 3 1 18 1 2. + <_> + + <_> + 8 0 9 6 -1. + <_> + 11 0 3 6 3. + <_> + + <_> + 0 17 18 3 -1. + <_> + 0 18 18 1 3. + <_> + + <_> + 6 7 12 5 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 0 3 6 9 -1. + <_> + 2 3 2 9 3. + <_> + + <_> + 20 2 4 9 -1. + <_> + 20 2 2 9 2. + <_> + + <_> + 0 2 4 9 -1. + <_> + 2 2 2 9 2. + <_> + + <_> + 0 1 24 4 -1. + <_> + 12 1 12 2 2. + <_> + 0 3 12 2 2. + <_> + + <_> + 0 16 9 6 -1. + <_> + 0 18 9 2 3. + <_> + + <_> + 14 13 9 6 -1. + <_> + 14 15 9 2 3. + <_> + + <_> + 0 15 19 3 -1. + <_> + 0 16 19 1 3. + <_> + + <_> + 1 5 22 12 -1. + <_> + 12 5 11 6 2. + <_> + 1 11 11 6 2. + <_> + + <_> + 5 13 6 6 -1. + <_> + 8 13 3 6 2. + <_> + + <_> + 4 2 20 3 -1. + <_> + 4 3 20 1 3. + <_> + + <_> + 8 14 6 10 -1. + <_> + 10 14 2 10 3. + <_> + + <_> + 6 12 16 6 -1. + <_> + 14 12 8 3 2. + <_> + 6 15 8 3 2. + <_> + + <_> + 2 13 8 9 -1. + <_> + 2 16 8 3 3. + <_> + + <_> + 11 8 6 14 -1. + <_> + 14 8 3 7 2. + <_> + 11 15 3 7 2. + <_> + + <_> + 2 12 16 6 -1. + <_> + 2 12 8 3 2. + <_> + 10 15 8 3 2. + <_> + + <_> + 5 16 16 8 -1. + <_> + 5 20 16 4 2. + <_> + + <_> + 9 1 4 12 -1. + <_> + 9 7 4 6 2. + <_> + + <_> + 8 2 8 10 -1. + <_> + 12 2 4 5 2. + <_> + 8 7 4 5 2. + <_> + + <_> + 6 6 12 6 -1. + <_> + 6 6 6 3 2. + <_> + 12 9 6 3 2. + <_> + + <_> + 10 7 6 9 -1. + <_> + 12 7 2 9 3. + <_> + + <_> + 0 0 8 12 -1. + <_> + 0 0 4 6 2. + <_> + 4 6 4 6 2. + <_> + + <_> + 18 8 6 9 -1. + <_> + 18 11 6 3 3. + <_> + + <_> + 2 12 6 6 -1. + <_> + 5 12 3 6 2. + <_> + + <_> + 3 21 21 3 -1. + <_> + 10 21 7 3 3. + <_> + + <_> + 2 0 16 6 -1. + <_> + 2 3 16 3 2. + <_> + + <_> + 13 6 7 6 -1. + <_> + 13 9 7 3 2. + <_> + + <_> + 6 4 4 14 -1. + <_> + 6 11 4 7 2. + <_> + + <_> + 9 7 6 9 -1. + <_> + 11 7 2 9 3. + <_> + + <_> + 7 8 6 14 -1. + <_> + 7 8 3 7 2. + <_> + 10 15 3 7 2. + <_> + + <_> + 18 8 4 16 -1. + <_> + 18 16 4 8 2. + <_> + + <_> + 9 14 6 10 -1. + <_> + 11 14 2 10 3. + <_> + + <_> + 6 11 12 5 -1. + <_> + 10 11 4 5 3. + <_> + + <_> + 0 12 23 3 -1. + <_> + 0 13 23 1 3. + <_> + + <_> + 13 0 6 12 -1. + <_> + 15 0 2 12 3. + <_> + + <_> + 0 10 12 5 -1. + <_> + 4 10 4 5 3. + <_> + + <_> + 13 2 10 4 -1. + <_> + 13 4 10 2 2. + <_> + + <_> + 5 0 6 12 -1. + <_> + 7 0 2 12 3. + <_> + + <_> + 11 6 9 6 -1. + <_> + 14 6 3 6 3. + <_> + + <_> + 4 6 9 6 -1. + <_> + 7 6 3 6 3. + <_> + + <_> + 6 11 18 13 -1. + <_> + 12 11 6 13 3. + <_> + + <_> + 0 11 18 13 -1. + <_> + 6 11 6 13 3. + <_> + + <_> + 12 16 12 6 -1. + <_> + 16 16 4 6 3. + <_> + + <_> + 0 6 21 3 -1. + <_> + 0 7 21 1 3. + <_> + + <_> + 12 16 12 6 -1. + <_> + 16 16 4 6 3. + <_> + + <_> + 5 7 6 14 -1. + <_> + 5 14 6 7 2. + <_> + + <_> + 5 10 19 2 -1. + <_> + 5 11 19 1 2. + <_> + + <_> + 5 4 14 4 -1. + <_> + 5 6 14 2 2. + <_> + + <_> + 3 18 18 4 -1. + <_> + 9 18 6 4 3. + <_> + + <_> + 7 0 4 9 -1. + <_> + 9 0 2 9 2. + <_> + + <_> + 13 3 11 4 -1. + <_> + 13 5 11 2 2. + <_> + + <_> + 2 0 9 6 -1. + <_> + 5 0 3 6 3. + <_> + + <_> + 19 1 4 23 -1. + <_> + 19 1 2 23 2. + <_> + + <_> + 1 1 4 23 -1. + <_> + 3 1 2 23 2. + <_> + + <_> + 5 16 18 3 -1. + <_> + 5 17 18 1 3. + <_> + + <_> + 0 3 11 4 -1. + <_> + 0 5 11 2 2. + <_> + + <_> + 2 16 20 3 -1. + <_> + 2 17 20 1 3. + <_> + + <_> + 5 3 13 4 -1. + <_> + 5 5 13 2 2. + <_> + + <_> + 1 9 22 15 -1. + <_> + 1 9 11 15 2. + <_> + + <_> + 3 4 14 3 -1. + <_> + 10 4 7 3 2. + <_> + + <_> + 8 7 10 4 -1. + <_> + 8 7 5 4 2. + <_> + + <_> + 6 7 10 4 -1. + <_> + 11 7 5 4 2. + <_> + + <_> + 10 4 6 9 -1. + <_> + 12 4 2 9 3. + <_> + + <_> + 1 12 9 6 -1. + <_> + 4 12 3 6 3. + <_> + + <_> + 8 3 8 10 -1. + <_> + 12 3 4 5 2. + <_> + 8 8 4 5 2. + <_> + + <_> + 3 6 16 6 -1. + <_> + 3 6 8 3 2. + <_> + 11 9 8 3 2. + <_> + + <_> + 5 6 14 6 -1. + <_> + 5 9 14 3 2. + <_> + + <_> + 4 3 9 6 -1. + <_> + 4 5 9 2 3. + <_> + + <_> + 6 3 18 2 -1. + <_> + 6 4 18 1 2. + <_> + + <_> + 7 6 9 6 -1. + <_> + 10 6 3 6 3. + <_> + + <_> + 0 1 24 3 -1. + <_> + 0 2 24 1 3. + <_> + + <_> + 0 17 10 6 -1. + <_> + 0 19 10 2 3. + <_> + + <_> + 3 18 18 3 -1. + <_> + 3 19 18 1 3. + <_> + + <_> + 2 5 6 16 -1. + <_> + 2 5 3 8 2. + <_> + 5 13 3 8 2. + <_> + + <_> + 7 6 11 6 -1. + <_> + 7 8 11 2 3. + <_> + + <_> + 5 2 12 22 -1. + <_> + 5 13 12 11 2. + <_> + + <_> + 10 7 4 10 -1. + <_> + 10 12 4 5 2. + <_> + + <_> + 9 0 4 18 -1. + <_> + 9 6 4 6 3. + <_> + + <_> + 18 8 6 9 -1. + <_> + 18 11 6 3 3. + <_> + + <_> + 4 7 15 10 -1. + <_> + 9 7 5 10 3. + <_> + + <_> + 10 5 6 9 -1. + <_> + 12 5 2 9 3. + <_> + + <_> + 9 9 6 10 -1. + <_> + 11 9 2 10 3. + <_> + + <_> + 11 14 6 10 -1. + <_> + 13 14 2 10 3. + <_> + + <_> + 7 14 6 10 -1. + <_> + 9 14 2 10 3. + <_> + + <_> + 4 8 16 9 -1. + <_> + 4 11 16 3 3. + <_> + + <_> + 2 11 20 3 -1. + <_> + 2 12 20 1 3. + <_> + + <_> + 13 0 4 13 -1. + <_> + 13 0 2 13 2. + <_> + + <_> + 7 0 4 13 -1. + <_> + 9 0 2 13 2. + <_> + + <_> + 3 1 18 7 -1. + <_> + 9 1 6 7 3. + <_> + + <_> + 1 11 6 9 -1. + <_> + 1 14 6 3 3. + <_> + + <_> + 8 18 9 6 -1. + <_> + 8 20 9 2 3. + <_> + + <_> + 3 9 15 6 -1. + <_> + 3 11 15 2 3. + <_> + + <_> + 5 10 19 2 -1. + <_> + 5 11 19 1 2. + <_> + + <_> + 8 6 7 16 -1. + <_> + 8 14 7 8 2. + <_> + + <_> + 9 14 9 6 -1. + <_> + 9 16 9 2 3. + <_> + + <_> + 0 7 8 12 -1. + <_> + 0 11 8 4 3. + <_> + + <_> + 6 4 18 3 -1. + <_> + 6 5 18 1 3. + <_> + + <_> + 0 16 12 6 -1. + <_> + 4 16 4 6 3. + <_> + + <_> + 13 13 9 4 -1. + <_> + 13 15 9 2 2. + <_> + + <_> + 5 8 14 14 -1. + <_> + 5 8 7 7 2. + <_> + 12 15 7 7 2. + <_> + + <_> + 1 16 22 6 -1. + <_> + 12 16 11 3 2. + <_> + 1 19 11 3 2. + <_> + + <_> + 9 0 6 9 -1. + <_> + 11 0 2 9 3. + <_> + + <_> + 9 5 10 10 -1. + <_> + 14 5 5 5 2. + <_> + 9 10 5 5 2. + <_> + + <_> + 5 5 10 10 -1. + <_> + 5 5 5 5 2. + <_> + 10 10 5 5 2. + <_> + + <_> + 4 6 16 6 -1. + <_> + 12 6 8 3 2. + <_> + 4 9 8 3 2. + <_> + + <_> + 0 7 6 9 -1. + <_> + 0 10 6 3 3. + <_> + + <_> + 16 10 8 14 -1. + <_> + 20 10 4 7 2. + <_> + 16 17 4 7 2. + <_> + + <_> + 9 12 6 12 -1. + <_> + 9 18 6 6 2. + <_> + + <_> + 8 10 8 12 -1. + <_> + 12 10 4 6 2. + <_> + 8 16 4 6 2. + <_> + + <_> + 8 0 4 9 -1. + <_> + 10 0 2 9 2. + <_> + + <_> + 10 4 8 16 -1. + <_> + 14 4 4 8 2. + <_> + 10 12 4 8 2. + <_> + + <_> + 7 10 10 6 -1. + <_> + 7 12 10 2 3. + <_> + + <_> + 5 6 14 14 -1. + <_> + 12 6 7 7 2. + <_> + 5 13 7 7 2. + <_> + + <_> + 2 11 20 2 -1. + <_> + 2 12 20 1 2. + <_> + + <_> + 18 8 4 16 -1. + <_> + 18 16 4 8 2. + <_> + + <_> + 1 11 12 10 -1. + <_> + 1 11 6 5 2. + <_> + 7 16 6 5 2. + <_> + + <_> + 6 9 12 4 -1. + <_> + 6 11 12 2 2. + <_> + + <_> + 9 12 6 7 -1. + <_> + 12 12 3 7 2. + <_> + + <_> + 10 4 8 16 -1. + <_> + 14 4 4 8 2. + <_> + 10 12 4 8 2. + <_> + + <_> + 6 4 8 16 -1. + <_> + 6 4 4 8 2. + <_> + 10 12 4 8 2. + <_> + + <_> + 8 9 9 6 -1. + <_> + 11 9 3 6 3. + <_> + + <_> + 1 5 16 12 -1. + <_> + 1 5 8 6 2. + <_> + 9 11 8 6 2. + <_> + + <_> + 9 9 6 8 -1. + <_> + 9 9 3 8 2. + <_> + + <_> + 6 0 3 18 -1. + <_> + 7 0 1 18 3. + <_> + + <_> + 17 9 5 14 -1. + <_> + 17 16 5 7 2. + <_> + + <_> + 2 9 5 14 -1. + <_> + 2 16 5 7 2. + <_> + + <_> + 7 4 10 6 -1. + <_> + 7 7 10 3 2. + <_> + + <_> + 1 3 23 18 -1. + <_> + 1 9 23 6 3. + <_> + + <_> + 1 1 21 3 -1. + <_> + 8 1 7 3 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 3 18 12 6 -1. + <_> + 3 18 6 3 2. + <_> + 9 21 6 3 2. + <_> + + <_> + 16 8 8 16 -1. + <_> + 20 8 4 8 2. + <_> + 16 16 4 8 2. + <_> + + <_> + 0 19 24 4 -1. + <_> + 8 19 8 4 3. + <_> + + <_> + 16 8 8 16 -1. + <_> + 20 8 4 8 2. + <_> + 16 16 4 8 2. + <_> + + <_> + 0 8 8 16 -1. + <_> + 0 8 4 8 2. + <_> + 4 16 4 8 2. + <_> + + <_> + 8 12 8 10 -1. + <_> + 8 17 8 5 2. + <_> + + <_> + 5 7 5 8 -1. + <_> + 5 11 5 4 2. + <_> + + <_> + 4 1 19 2 -1. + <_> + 4 2 19 1 2. + <_> + + <_> + 0 12 24 9 -1. + <_> + 8 12 8 9 3. + <_> + + <_> + 6 0 13 8 -1. + <_> + 6 4 13 4 2. + <_> + + <_> + 0 0 24 3 -1. + <_> + 0 1 24 1 3. + <_> + + <_> + 20 3 4 11 -1. + <_> + 20 3 2 11 2. + <_> + + <_> + 8 6 6 9 -1. + <_> + 10 6 2 9 3. + <_> + + <_> + 6 11 12 8 -1. + <_> + 12 11 6 4 2. + <_> + 6 15 6 4 2. + <_> + + <_> + 0 8 12 6 -1. + <_> + 0 8 6 3 2. + <_> + 6 11 6 3 2. + <_> + + <_> + 6 17 18 3 -1. + <_> + 6 18 18 1 3. + <_> + + <_> + 0 14 9 6 -1. + <_> + 0 16 9 2 3. + <_> + + <_> + 20 3 4 9 -1. + <_> + 20 3 2 9 2. + <_> + + <_> + 0 3 4 9 -1. + <_> + 2 3 2 9 2. + <_> + + <_> + 15 0 9 19 -1. + <_> + 18 0 3 19 3. + <_> + + <_> + 0 0 9 19 -1. + <_> + 3 0 3 19 3. + <_> + + <_> + 13 11 6 8 -1. + <_> + 13 11 3 8 2. + <_> + + <_> + 5 11 6 8 -1. + <_> + 8 11 3 8 2. + <_> + + <_> + 5 11 19 3 -1. + <_> + 5 12 19 1 3. + <_> + + <_> + 3 20 18 4 -1. + <_> + 9 20 6 4 3. + <_> + + <_> + 6 6 16 6 -1. + <_> + 6 8 16 2 3. + <_> + + <_> + 6 0 9 6 -1. + <_> + 9 0 3 6 3. + <_> + + <_> + 10 3 4 14 -1. + <_> + 10 10 4 7 2. + <_> + + <_> + 1 5 15 12 -1. + <_> + 1 11 15 6 2. + <_> + + <_> + 11 12 8 5 -1. + <_> + 11 12 4 5 2. + <_> + + <_> + 5 0 6 9 -1. + <_> + 7 0 2 9 3. + <_> + + <_> + 12 0 6 9 -1. + <_> + 14 0 2 9 3. + <_> + + <_> + 5 5 12 8 -1. + <_> + 5 5 6 4 2. + <_> + 11 9 6 4 2. + <_> + + <_> + 13 12 11 6 -1. + <_> + 13 14 11 2 3. + <_> + + <_> + 0 13 21 3 -1. + <_> + 0 14 21 1 3. + <_> + + <_> + 8 1 8 12 -1. + <_> + 12 1 4 6 2. + <_> + 8 7 4 6 2. + <_> + + <_> + 1 0 6 12 -1. + <_> + 1 0 3 6 2. + <_> + 4 6 3 6 2. + <_> + + <_> + 2 2 21 2 -1. + <_> + 2 3 21 1 2. + <_> + + <_> + 2 2 19 3 -1. + <_> + 2 3 19 1 3. + <_> + + <_> + 17 10 6 14 -1. + <_> + 20 10 3 7 2. + <_> + 17 17 3 7 2. + <_> + + <_> + 1 10 6 14 -1. + <_> + 1 10 3 7 2. + <_> + 4 17 3 7 2. + <_> + + <_> + 7 6 14 14 -1. + <_> + 14 6 7 7 2. + <_> + 7 13 7 7 2. + <_> + + <_> + 0 12 9 6 -1. + <_> + 0 14 9 2 3. + <_> + + <_> + 15 14 8 9 -1. + <_> + 15 17 8 3 3. + <_> + + <_> + 1 1 22 4 -1. + <_> + 1 1 11 2 2. + <_> + 12 3 11 2 2. + <_> + + <_> + 9 11 9 6 -1. + <_> + 9 13 9 2 3. + <_> + + <_> + 0 15 18 3 -1. + <_> + 0 16 18 1 3. + <_> + + <_> + 16 14 7 9 -1. + <_> + 16 17 7 3 3. + <_> + + <_> + 4 3 16 4 -1. + <_> + 12 3 8 4 2. + <_> + + <_> + 7 6 12 5 -1. + <_> + 7 6 6 5 2. + <_> + + <_> + 9 6 4 9 -1. + <_> + 11 6 2 9 2. + <_> + + <_> + 12 1 4 10 -1. + <_> + 12 1 2 10 2. + <_> + + <_> + 8 1 4 10 -1. + <_> + 10 1 2 10 2. + <_> + + <_> + 15 15 6 9 -1. + <_> + 15 18 6 3 3. + <_> + + <_> + 3 15 6 9 -1. + <_> + 3 18 6 3 3. + <_> + + <_> + 15 1 3 19 -1. + <_> + 16 1 1 19 3. + <_> + + <_> + 1 3 6 9 -1. + <_> + 3 3 2 9 3. + <_> + + <_> + 15 0 3 19 -1. + <_> + 16 0 1 19 3. + <_> + + <_> + 6 3 12 4 -1. + <_> + 12 3 6 4 2. + <_> + + <_> + 10 5 4 9 -1. + <_> + 10 5 2 9 2. + <_> + + <_> + 6 0 3 19 -1. + <_> + 7 0 1 19 3. + <_> + + <_> + 11 1 3 12 -1. + <_> + 11 7 3 6 2. + <_> + + <_> + 6 7 10 5 -1. + <_> + 11 7 5 5 2. + <_> + + <_> + 11 3 3 18 -1. + <_> + 12 3 1 18 3. + <_> + + <_> + 9 3 6 12 -1. + <_> + 11 3 2 12 3. + <_> + + <_> + 3 7 19 3 -1. + <_> + 3 8 19 1 3. + <_> + + <_> + 2 7 18 3 -1. + <_> + 2 8 18 1 3. + <_> + + <_> + 3 13 18 4 -1. + <_> + 12 13 9 2 2. + <_> + 3 15 9 2 2. + <_> + + <_> + 3 5 6 9 -1. + <_> + 5 5 2 9 3. + <_> + + <_> + 4 1 20 4 -1. + <_> + 14 1 10 2 2. + <_> + 4 3 10 2 2. + <_> + + <_> + 0 1 20 4 -1. + <_> + 0 1 10 2 2. + <_> + 10 3 10 2 2. + <_> + + <_> + 10 15 6 6 -1. + <_> + 10 15 3 6 2. + <_> + + <_> + 0 2 24 8 -1. + <_> + 8 2 8 8 3. + <_> + + <_> + 5 5 18 3 -1. + <_> + 5 6 18 1 3. + <_> + + <_> + 8 15 6 6 -1. + <_> + 11 15 3 6 2. + <_> + + <_> + 11 12 8 5 -1. + <_> + 11 12 4 5 2. + <_> + + <_> + 5 12 8 5 -1. + <_> + 9 12 4 5 2. + <_> + + <_> + 5 0 14 6 -1. + <_> + 5 2 14 2 3. + <_> + + <_> + 10 2 4 15 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 10 7 5 12 -1. + <_> + 10 11 5 4 3. + <_> + + <_> + 7 9 8 14 -1. + <_> + 7 9 4 7 2. + <_> + 11 16 4 7 2. + <_> + + <_> + 1 5 22 6 -1. + <_> + 12 5 11 3 2. + <_> + 1 8 11 3 2. + <_> + + <_> + 0 5 6 6 -1. + <_> + 0 8 6 3 2. + <_> + + <_> + 12 17 9 4 -1. + <_> + 12 19 9 2 2. + <_> + + <_> + 2 18 19 3 -1. + <_> + 2 19 19 1 3. + <_> + + <_> + 12 17 9 4 -1. + <_> + 12 19 9 2 2. + <_> + + <_> + 1 17 18 3 -1. + <_> + 1 18 18 1 3. + <_> + + <_> + 12 17 9 4 -1. + <_> + 12 19 9 2 2. + <_> + + <_> + 0 0 24 3 -1. + <_> + 0 1 24 1 3. + <_> + + <_> + 5 0 14 4 -1. + <_> + 5 2 14 2 2. + <_> + + <_> + 6 14 9 6 -1. + <_> + 6 16 9 2 3. + <_> + + <_> + 14 13 6 9 -1. + <_> + 14 16 6 3 3. + <_> + + <_> + 5 20 13 4 -1. + <_> + 5 22 13 2 2. + <_> + + <_> + 9 9 6 12 -1. + <_> + 9 13 6 4 3. + <_> + + <_> + 1 10 21 3 -1. + <_> + 8 10 7 3 3. + <_> + + <_> + 8 8 9 6 -1. + <_> + 11 8 3 6 3. + <_> + + <_> + 3 10 9 7 -1. + <_> + 6 10 3 7 3. + <_> + + <_> + 12 10 10 8 -1. + <_> + 17 10 5 4 2. + <_> + 12 14 5 4 2. + <_> + + <_> + 0 15 24 3 -1. + <_> + 8 15 8 3 3. + <_> + + <_> + 8 5 9 6 -1. + <_> + 8 7 9 2 3. + <_> + + <_> + 4 13 6 9 -1. + <_> + 4 16 6 3 3. + <_> + + <_> + 12 17 9 4 -1. + <_> + 12 19 9 2 2. + <_> + + <_> + 9 12 6 6 -1. + <_> + 9 15 6 3 2. + <_> + + <_> + 9 9 14 10 -1. + <_> + 16 9 7 5 2. + <_> + 9 14 7 5 2. + <_> + + <_> + 1 9 14 10 -1. + <_> + 1 9 7 5 2. + <_> + 8 14 7 5 2. + <_> + + <_> + 8 7 9 17 -1. + <_> + 11 7 3 17 3. + <_> + + <_> + 3 4 6 20 -1. + <_> + 3 4 3 10 2. + <_> + 6 14 3 10 2. + <_> + + <_> + 7 8 10 4 -1. + <_> + 7 8 5 4 2. + <_> + + <_> + 10 7 4 9 -1. + <_> + 12 7 2 9 2. + <_> + + <_> + 10 15 6 9 -1. + <_> + 12 15 2 9 3. + <_> + + <_> + 3 8 6 16 -1. + <_> + 3 8 3 8 2. + <_> + 6 16 3 8 2. + <_> + + <_> + 12 17 9 4 -1. + <_> + 12 19 9 2 2. + <_> + + <_> + 3 17 9 4 -1. + <_> + 3 19 9 2 2. + <_> + + <_> + 10 1 9 6 -1. + <_> + 13 1 3 6 3. + <_> + + <_> + 5 7 4 10 -1. + <_> + 5 12 4 5 2. + <_> + + <_> + 7 5 12 6 -1. + <_> + 11 5 4 6 3. + <_> + + <_> + 6 4 9 8 -1. + <_> + 9 4 3 8 3. + <_> + + <_> + 12 16 10 8 -1. + <_> + 17 16 5 4 2. + <_> + 12 20 5 4 2. + <_> + + <_> + 2 16 10 8 -1. + <_> + 2 16 5 4 2. + <_> + 7 20 5 4 2. + <_> + + <_> + 0 0 24 4 -1. + <_> + 12 0 12 2 2. + <_> + 0 2 12 2 2. + <_> + + <_> + 0 6 9 6 -1. + <_> + 0 8 9 2 3. + <_> + + <_> + 0 4 24 6 -1. + <_> + 12 4 12 3 2. + <_> + 0 7 12 3 2. + <_> + + <_> + 5 0 11 4 -1. + <_> + 5 2 11 2 2. + <_> + + <_> + 1 1 22 4 -1. + <_> + 12 1 11 2 2. + <_> + 1 3 11 2 2. + <_> + + <_> + 9 6 6 18 -1. + <_> + 9 15 6 9 2. + <_> + + <_> + 2 9 20 4 -1. + <_> + 2 11 20 2 2. + <_> + + <_> + 5 2 14 14 -1. + <_> + 5 9 14 7 2. + <_> + + <_> + 4 2 16 6 -1. + <_> + 4 5 16 3 2. + <_> + + <_> + 2 3 19 3 -1. + <_> + 2 4 19 1 3. + <_> + + <_> + 7 1 10 4 -1. + <_> + 7 3 10 2 2. + <_> + + <_> + 0 9 4 15 -1. + <_> + 0 14 4 5 3. + <_> + + <_> + 2 10 21 3 -1. + <_> + 2 11 21 1 3. + <_> + + <_> + 3 0 6 6 -1. + <_> + 6 0 3 6 2. + <_> + + <_> + 6 4 14 9 -1. + <_> + 6 7 14 3 3. + <_> + + <_> + 9 1 6 9 -1. + <_> + 11 1 2 9 3. + <_> + + <_> + 15 8 9 9 -1. + <_> + 15 11 9 3 3. + <_> + + <_> + 8 0 4 21 -1. + <_> + 8 7 4 7 3. + <_> + + <_> + 3 22 19 2 -1. + <_> + 3 23 19 1 2. + <_> + + <_> + 2 15 20 3 -1. + <_> + 2 16 20 1 3. + <_> + + <_> + 19 0 4 13 -1. + <_> + 19 0 2 13 2. + <_> + + <_> + 1 7 8 8 -1. + <_> + 1 11 8 4 2. + <_> + + <_> + 14 14 6 9 -1. + <_> + 14 17 6 3 3. + <_> + + <_> + 4 14 6 9 -1. + <_> + 4 17 6 3 3. + <_> + + <_> + 14 5 4 10 -1. + <_> + 14 5 2 10 2. + <_> + + <_> + 6 5 4 10 -1. + <_> + 8 5 2 10 2. + <_> + + <_> + 14 5 6 6 -1. + <_> + 14 8 6 3 2. + <_> + + <_> + 4 5 6 6 -1. + <_> + 4 8 6 3 2. + <_> + + <_> + 0 2 24 21 -1. + <_> + 8 2 8 21 3. + <_> + + <_> + 1 2 6 13 -1. + <_> + 3 2 2 13 3. + <_> + + <_> + 20 0 4 21 -1. + <_> + 20 0 2 21 2. + <_> + + <_> + 0 4 4 20 -1. + <_> + 2 4 2 20 2. + <_> + + <_> + 8 16 9 6 -1. + <_> + 8 18 9 2 3. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 16 12 7 9 -1. + <_> + 16 15 7 3 3. + <_> + + <_> + 5 21 14 3 -1. + <_> + 12 21 7 3 2. + <_> + + <_> + 11 5 6 9 -1. + <_> + 11 5 3 9 2. + <_> + + <_> + 10 5 4 10 -1. + <_> + 12 5 2 10 2. + <_> + + <_> + 10 6 6 9 -1. + <_> + 12 6 2 9 3. + <_> + + <_> + 7 5 6 9 -1. + <_> + 10 5 3 9 2. + <_> + + <_> + 14 14 10 4 -1. + <_> + 14 16 10 2 2. + <_> + + <_> + 5 5 14 14 -1. + <_> + 5 5 7 7 2. + <_> + 12 12 7 7 2. + <_> + + <_> + 12 8 12 6 -1. + <_> + 18 8 6 3 2. + <_> + 12 11 6 3 2. + <_> + + <_> + 6 6 12 12 -1. + <_> + 6 6 6 6 2. + <_> + 12 12 6 6 2. + <_> + + <_> + 11 13 6 10 -1. + <_> + 13 13 2 10 3. + <_> + + <_> + 1 10 20 8 -1. + <_> + 1 10 10 4 2. + <_> + 11 14 10 4 2. + <_> + + <_> + 15 13 9 6 -1. + <_> + 15 15 9 2 3. + <_> + + <_> + 9 0 6 9 -1. + <_> + 9 3 6 3 3. + <_> + + <_> + 10 1 5 14 -1. + <_> + 10 8 5 7 2. + <_> + + <_> + 3 4 16 6 -1. + <_> + 3 6 16 2 3. + <_> + + <_> + 16 3 8 9 -1. + <_> + 16 6 8 3 3. + <_> + + <_> + 7 13 6 10 -1. + <_> + 9 13 2 10 3. + <_> + + <_> + 15 13 9 6 -1. + <_> + 15 15 9 2 3. + <_> + + <_> + 0 13 9 6 -1. + <_> + 0 15 9 2 3. + <_> + + <_> + 13 16 9 6 -1. + <_> + 13 18 9 2 3. + <_> + + <_> + 2 16 9 6 -1. + <_> + 2 18 9 2 3. + <_> + + <_> + 5 16 18 3 -1. + <_> + 5 17 18 1 3. + <_> + + <_> + 1 16 18 3 -1. + <_> + 1 17 18 1 3. + <_> + + <_> + 5 0 18 3 -1. + <_> + 5 1 18 1 3. + <_> + + <_> + 1 1 19 2 -1. + <_> + 1 2 19 1 2. + <_> + + <_> + 14 2 6 11 -1. + <_> + 16 2 2 11 3. + <_> + + <_> + 4 15 15 6 -1. + <_> + 9 15 5 6 3. + <_> + + <_> + 14 2 6 11 -1. + <_> + 16 2 2 11 3. + <_> + + <_> + 4 2 6 11 -1. + <_> + 6 2 2 11 3. + <_> + + <_> + 18 2 6 9 -1. + <_> + 18 5 6 3 3. + <_> + + <_> + 1 2 22 4 -1. + <_> + 1 2 11 2 2. + <_> + 12 4 11 2 2. + <_> + + <_> + 2 0 21 12 -1. + <_> + 9 0 7 12 3. + <_> + + <_> + 0 12 18 3 -1. + <_> + 0 13 18 1 3. + <_> + + <_> + 12 2 6 9 -1. + <_> + 14 2 2 9 3. + <_> + + <_> + 3 10 18 3 -1. + <_> + 3 11 18 1 3. + <_> + + <_> + 16 3 8 9 -1. + <_> + 16 6 8 3 3. + <_> + + <_> + 3 7 18 3 -1. + <_> + 3 8 18 1 3. + <_> + + <_> + 9 11 6 9 -1. + <_> + 11 11 2 9 3. + <_> + + <_> + 9 8 6 9 -1. + <_> + 11 8 2 9 3. + <_> + + <_> + 15 0 2 18 -1. + <_> + 15 0 1 18 2. + <_> + + <_> + 7 0 2 18 -1. + <_> + 8 0 1 18 2. + <_> + + <_> + 17 3 7 9 -1. + <_> + 17 6 7 3 3. + <_> + + <_> + 3 18 9 6 -1. + <_> + 3 20 9 2 3. + <_> + + <_> + 3 18 21 3 -1. + <_> + 3 19 21 1 3. + <_> + + <_> + 0 3 7 9 -1. + <_> + 0 6 7 3 3. + <_> + + <_> + 2 7 22 3 -1. + <_> + 2 8 22 1 3. + <_> + + <_> + 0 3 24 16 -1. + <_> + 0 3 12 8 2. + <_> + 12 11 12 8 2. + <_> + + <_> + 13 17 9 4 -1. + <_> + 13 19 9 2 2. + <_> + + <_> + 5 5 12 8 -1. + <_> + 5 5 6 4 2. + <_> + 11 9 6 4 2. + <_> + + <_> + 5 6 14 6 -1. + <_> + 12 6 7 3 2. + <_> + 5 9 7 3 2. + <_> + + <_> + 5 16 14 6 -1. + <_> + 5 16 7 3 2. + <_> + 12 19 7 3 2. + <_> + + <_> + 18 2 6 9 -1. + <_> + 18 5 6 3 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 3 4 20 10 -1. + <_> + 13 4 10 5 2. + <_> + 3 9 10 5 2. + <_> + + <_> + 2 13 9 8 -1. + <_> + 5 13 3 8 3. + <_> + + <_> + 2 1 21 15 -1. + <_> + 9 1 7 15 3. + <_> + + <_> + 5 12 14 8 -1. + <_> + 12 12 7 8 2. + <_> + + <_> + 6 7 12 4 -1. + <_> + 6 7 6 4 2. + <_> + + <_> + 6 5 9 6 -1. + <_> + 9 5 3 6 3. + <_> + + <_> + 13 11 6 6 -1. + <_> + 13 11 3 6 2. + <_> + + <_> + 5 11 6 6 -1. + <_> + 8 11 3 6 2. + <_> + + <_> + 6 4 18 2 -1. + <_> + 6 5 18 1 2. + <_> + + <_> + 0 2 6 11 -1. + <_> + 2 2 2 11 3. + <_> + + <_> + 18 0 6 15 -1. + <_> + 20 0 2 15 3. + <_> + + <_> + 0 0 6 13 -1. + <_> + 2 0 2 13 3. + <_> + + <_> + 12 0 6 9 -1. + <_> + 14 0 2 9 3. + <_> + + <_> + 6 0 6 9 -1. + <_> + 8 0 2 9 3. + <_> + + <_> + 0 2 24 4 -1. + <_> + 8 2 8 4 3. + <_> + + <_> + 3 13 18 4 -1. + <_> + 12 13 9 4 2. + <_> + + <_> + 9 7 10 4 -1. + <_> + 9 7 5 4 2. + <_> + + <_> + 5 8 12 3 -1. + <_> + 11 8 6 3 2. + <_> + + <_> + 4 14 19 3 -1. + <_> + 4 15 19 1 3. + <_> + + <_> + 10 0 4 20 -1. + <_> + 10 10 4 10 2. + <_> + + <_> + 8 15 9 6 -1. + <_> + 8 17 9 2 3. + <_> + + <_> + 2 9 15 4 -1. + <_> + 7 9 5 4 3. + <_> + + <_> + 8 4 12 7 -1. + <_> + 12 4 4 7 3. + <_> + + <_> + 0 10 6 9 -1. + <_> + 0 13 6 3 3. + <_> + + <_> + 18 5 6 9 -1. + <_> + 18 8 6 3 3. + <_> + + <_> + 0 18 16 6 -1. + <_> + 0 18 8 3 2. + <_> + 8 21 8 3 2. + <_> + + <_> + 9 18 14 6 -1. + <_> + 16 18 7 3 2. + <_> + 9 21 7 3 2. + <_> + + <_> + 1 20 20 4 -1. + <_> + 1 20 10 2 2. + <_> + 11 22 10 2 2. + <_> + + <_> + 2 8 20 6 -1. + <_> + 12 8 10 3 2. + <_> + 2 11 10 3 2. + <_> + + <_> + 7 8 6 9 -1. + <_> + 9 8 2 9 3. + <_> + + <_> + 8 5 12 8 -1. + <_> + 12 5 4 8 3. + <_> + + <_> + 4 5 12 8 -1. + <_> + 8 5 4 8 3. + <_> + + <_> + 10 6 6 9 -1. + <_> + 12 6 2 9 3. + <_> + + <_> + 2 0 6 16 -1. + <_> + 4 0 2 16 3. + <_> + + <_> + 15 4 6 12 -1. + <_> + 15 8 6 4 3. + <_> + + <_> + 3 4 6 12 -1. + <_> + 3 8 6 4 3. + <_> + + <_> + 15 12 9 6 -1. + <_> + 15 14 9 2 3. + <_> + + <_> + 4 0 15 22 -1. + <_> + 4 11 15 11 2. + <_> + + <_> + 15 12 9 6 -1. + <_> + 15 14 9 2 3. + <_> + + <_> + 0 12 9 6 -1. + <_> + 0 14 9 2 3. + <_> + + <_> + 15 15 9 6 -1. + <_> + 15 17 9 2 3. + <_> + + <_> + 0 15 9 6 -1. + <_> + 0 17 9 2 3. + <_> + + <_> + 10 0 8 10 -1. + <_> + 14 0 4 5 2. + <_> + 10 5 4 5 2. + <_> + + <_> + 1 0 4 16 -1. + <_> + 3 0 2 16 2. + <_> + + <_> + 7 6 10 6 -1. + <_> + 7 8 10 2 3. + <_> + + <_> + 10 12 4 10 -1. + <_> + 10 17 4 5 2. + <_> + + <_> + 8 4 10 6 -1. + <_> + 8 6 10 2 3. + <_> + + <_> + 3 22 18 2 -1. + <_> + 12 22 9 2 2. + <_> + + <_> + 7 7 11 6 -1. + <_> + 7 9 11 2 3. + <_> + + <_> + 0 0 12 10 -1. + <_> + 0 0 6 5 2. + <_> + 6 5 6 5 2. + <_> + + <_> + 10 1 12 6 -1. + <_> + 16 1 6 3 2. + <_> + 10 4 6 3 2. + <_> + + <_> + 7 16 9 4 -1. + <_> + 7 18 9 2 2. + <_> + + <_> + 5 7 15 16 -1. + <_> + 10 7 5 16 3. + <_> + + <_> + 5 10 12 13 -1. + <_> + 11 10 6 13 2. + <_> + + <_> + 6 2 12 6 -1. + <_> + 12 2 6 3 2. + <_> + 6 5 6 3 2. + <_> + + <_> + 3 9 12 9 -1. + <_> + 3 12 12 3 3. + <_> + + <_> + 16 2 8 6 -1. + <_> + 16 5 8 3 2. + <_> + + <_> + 0 2 8 6 -1. + <_> + 0 5 8 3 2. + <_> + + <_> + 0 3 24 11 -1. + <_> + 0 3 12 11 2. + <_> + + <_> + 0 13 8 10 -1. + <_> + 0 13 4 5 2. + <_> + 4 18 4 5 2. + <_> + + <_> + 10 14 4 10 -1. + <_> + 10 19 4 5 2. + <_> + + <_> + 10 2 4 21 -1. + <_> + 10 9 4 7 3. + <_> + + <_> + 4 4 15 9 -1. + <_> + 4 7 15 3 3. + <_> + + <_> + 0 1 24 6 -1. + <_> + 8 1 8 6 3. + <_> + + <_> + 9 6 5 16 -1. + <_> + 9 14 5 8 2. + <_> + + <_> + 3 21 18 3 -1. + <_> + 9 21 6 3 3. + <_> + + <_> + 6 5 3 12 -1. + <_> + 6 11 3 6 2. + <_> + + <_> + 11 6 4 9 -1. + <_> + 11 6 2 9 2. + <_> + + <_> + 5 6 9 8 -1. + <_> + 8 6 3 8 3. + <_> + + <_> + 4 3 20 2 -1. + <_> + 4 4 20 1 2. + <_> + + <_> + 2 10 18 3 -1. + <_> + 8 10 6 3 3. + <_> + + <_> + 7 15 10 6 -1. + <_> + 7 17 10 2 3. + <_> + + <_> + 1 4 4 18 -1. + <_> + 1 4 2 9 2. + <_> + 3 13 2 9 2. + <_> + + <_> + 13 0 6 9 -1. + <_> + 15 0 2 9 3. + <_> + + <_> + 5 0 6 9 -1. + <_> + 7 0 2 9 3. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 6 7 9 6 -1. + <_> + 9 7 3 6 3. + <_> + + <_> + 3 0 18 2 -1. + <_> + 3 1 18 1 2. + <_> + + <_> + 0 10 20 4 -1. + <_> + 0 10 10 2 2. + <_> + 10 12 10 2 2. + <_> + + <_> + 10 2 4 12 -1. + <_> + 10 8 4 6 2. + <_> + + <_> + 6 5 6 12 -1. + <_> + 6 5 3 6 2. + <_> + 9 11 3 6 2. + <_> + + <_> + 6 0 18 22 -1. + <_> + 15 0 9 11 2. + <_> + 6 11 9 11 2. + <_> + + <_> + 0 0 18 22 -1. + <_> + 0 0 9 11 2. + <_> + 9 11 9 11 2. + <_> + + <_> + 18 2 6 11 -1. + <_> + 20 2 2 11 3. + <_> + + <_> + 0 2 6 11 -1. + <_> + 2 2 2 11 3. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 0 1 20 1 3. + <_> + + <_> + 2 2 20 2 -1. + <_> + 2 3 20 1 2. + <_> + + <_> + 1 10 18 2 -1. + <_> + 1 11 18 1 2. + <_> + + <_> + 18 7 6 9 -1. + <_> + 18 10 6 3 3. + <_> + + <_> + 0 0 22 9 -1. + <_> + 0 3 22 3 3. + <_> + + <_> + 17 3 6 9 -1. + <_> + 17 6 6 3 3. + <_> + + <_> + 0 7 6 9 -1. + <_> + 0 10 6 3 3. + <_> + + <_> + 0 6 24 6 -1. + <_> + 0 8 24 2 3. + <_> + + <_> + 0 2 6 10 -1. + <_> + 2 2 2 10 3. + <_> + + <_> + 10 6 6 9 -1. + <_> + 12 6 2 9 3. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 15 0 6 9 -1. + <_> + 17 0 2 9 3. + <_> + + <_> + 3 0 6 9 -1. + <_> + 5 0 2 9 3. + <_> + + <_> + 15 17 9 6 -1. + <_> + 15 19 9 2 3. + <_> + + <_> + 0 17 18 3 -1. + <_> + 0 18 18 1 3. + <_> + + <_> + 15 14 9 6 -1. + <_> + 15 16 9 2 3. + <_> + + <_> + 0 15 23 6 -1. + <_> + 0 17 23 2 3. + <_> + + <_> + 5 15 18 3 -1. + <_> + 5 16 18 1 3. + <_> + + <_> + 0 14 9 6 -1. + <_> + 0 16 9 2 3. + <_> + + <_> + 9 8 8 10 -1. + <_> + 13 8 4 5 2. + <_> + 9 13 4 5 2. + <_> + + <_> + 3 7 15 6 -1. + <_> + 8 7 5 6 3. + <_> + + <_> + 9 8 8 10 -1. + <_> + 13 8 4 5 2. + <_> + 9 13 4 5 2. + <_> + + <_> + 5 0 6 12 -1. + <_> + 8 0 3 12 2. + <_> + + <_> + 9 8 8 10 -1. + <_> + 13 8 4 5 2. + <_> + 9 13 4 5 2. + <_> + + <_> + 8 5 6 9 -1. + <_> + 10 5 2 9 3. + <_> + + <_> + 10 6 4 18 -1. + <_> + 12 6 2 9 2. + <_> + 10 15 2 9 2. + <_> + + <_> + 5 7 12 4 -1. + <_> + 11 7 6 4 2. + <_> + + <_> + 9 8 8 10 -1. + <_> + 13 8 4 5 2. + <_> + 9 13 4 5 2. + <_> + + <_> + 7 8 8 10 -1. + <_> + 7 8 4 5 2. + <_> + 11 13 4 5 2. + <_> + + <_> + 11 10 6 14 -1. + <_> + 14 10 3 7 2. + <_> + 11 17 3 7 2. + <_> + + <_> + 9 5 6 19 -1. + <_> + 12 5 3 19 2. + <_> + + <_> + 6 12 12 6 -1. + <_> + 12 12 6 3 2. + <_> + 6 15 6 3 2. + <_> + + <_> + 1 9 18 6 -1. + <_> + 1 9 9 3 2. + <_> + 10 12 9 3 2. + <_> + + <_> + 16 14 8 10 -1. + <_> + 20 14 4 5 2. + <_> + 16 19 4 5 2. + <_> + + <_> + 0 9 22 8 -1. + <_> + 0 9 11 4 2. + <_> + 11 13 11 4 2. + <_> + + <_> + 8 18 12 6 -1. + <_> + 14 18 6 3 2. + <_> + 8 21 6 3 2. + <_> + + <_> + 0 6 20 18 -1. + <_> + 0 6 10 9 2. + <_> + 10 15 10 9 2. + <_> + + <_> + 3 6 20 12 -1. + <_> + 13 6 10 6 2. + <_> + 3 12 10 6 2. + <_> + + <_> + 0 16 10 8 -1. + <_> + 0 16 5 4 2. + <_> + 5 20 5 4 2. + <_> + + <_> + 6 16 18 3 -1. + <_> + 6 17 18 1 3. + <_> + + <_> + 0 11 19 3 -1. + <_> + 0 12 19 1 3. + <_> + + <_> + 14 6 6 9 -1. + <_> + 14 9 6 3 3. + <_> + + <_> + 1 7 22 4 -1. + <_> + 1 7 11 2 2. + <_> + 12 9 11 2 2. + <_> + + <_> + 13 6 7 12 -1. + <_> + 13 10 7 4 3. + <_> + + <_> + 4 7 11 9 -1. + <_> + 4 10 11 3 3. + <_> + + <_> + 12 10 10 8 -1. + <_> + 17 10 5 4 2. + <_> + 12 14 5 4 2. + <_> + + <_> + 2 12 9 7 -1. + <_> + 5 12 3 7 3. + <_> + + <_> + 16 14 6 9 -1. + <_> + 16 17 6 3 3. + <_> + + <_> + 3 12 6 12 -1. + <_> + 3 16 6 4 3. + <_> + + <_> + 14 13 6 6 -1. + <_> + 14 16 6 3 2. + <_> + + <_> + 8 0 6 9 -1. + <_> + 10 0 2 9 3. + <_> + + <_> + 9 1 6 23 -1. + <_> + 11 1 2 23 3. + <_> + + <_> + 0 16 9 6 -1. + <_> + 0 18 9 2 3. + <_> + + <_> + 4 17 18 3 -1. + <_> + 4 18 18 1 3. + <_> + + <_> + 5 2 13 14 -1. + <_> + 5 9 13 7 2. + <_> + + <_> + 15 0 8 12 -1. + <_> + 19 0 4 6 2. + <_> + 15 6 4 6 2. + <_> + + <_> + 0 0 8 12 -1. + <_> + 0 0 4 6 2. + <_> + 4 6 4 6 2. + <_> + + <_> + 8 2 8 7 -1. + <_> + 8 2 4 7 2. + <_> + + <_> + 1 1 6 9 -1. + <_> + 3 1 2 9 3. + <_> + + <_> + 14 8 6 12 -1. + <_> + 17 8 3 6 2. + <_> + 14 14 3 6 2. + <_> + + <_> + 4 8 6 12 -1. + <_> + 4 8 3 6 2. + <_> + 7 14 3 6 2. + <_> + + <_> + 16 5 5 15 -1. + <_> + 16 10 5 5 3. + <_> + + <_> + 3 5 5 15 -1. + <_> + 3 10 5 5 3. + <_> + + <_> + 18 4 6 9 -1. + <_> + 18 7 6 3 3. + <_> + + <_> + 1 7 6 15 -1. + <_> + 1 12 6 5 3. + <_> + + <_> + 11 15 12 8 -1. + <_> + 17 15 6 4 2. + <_> + 11 19 6 4 2. + <_> + + <_> + 0 2 24 4 -1. + <_> + 0 2 12 2 2. + <_> + 12 4 12 2 2. + <_> + + <_> + 15 1 2 19 -1. + <_> + 15 1 1 19 2. + <_> + + <_> + 7 1 2 19 -1. + <_> + 8 1 1 19 2. + <_> + + <_> + 22 1 2 20 -1. + <_> + 22 1 1 20 2. + <_> + + <_> + 0 1 2 20 -1. + <_> + 1 1 1 20 2. + <_> + + <_> + 18 11 6 12 -1. + <_> + 20 11 2 12 3. + <_> + + <_> + 0 11 6 12 -1. + <_> + 2 11 2 12 3. + <_> + + <_> + 3 6 18 14 -1. + <_> + 3 13 18 7 2. + <_> + + <_> + 6 10 7 8 -1. + <_> + 6 14 7 4 2. + <_> + + <_> + 7 9 12 12 -1. + <_> + 7 13 12 4 3. + <_> + + <_> + 2 18 18 5 -1. + <_> + 11 18 9 5 2. + <_> + + <_> + 4 21 20 3 -1. + <_> + 4 22 20 1 3. + <_> + + <_> + 9 12 6 12 -1. + <_> + 9 12 3 6 2. + <_> + 12 18 3 6 2. + <_> + + <_> + 4 6 18 3 -1. + <_> + 4 7 18 1 3. + <_> + + <_> + 3 6 18 3 -1. + <_> + 3 7 18 1 3. + <_> + + <_> + 18 4 6 9 -1. + <_> + 18 7 6 3 3. + <_> + + <_> + 2 12 9 6 -1. + <_> + 2 14 9 2 3. + <_> + + <_> + 4 14 18 4 -1. + <_> + 13 14 9 2 2. + <_> + 4 16 9 2 2. + <_> + + <_> + 7 7 6 14 -1. + <_> + 7 7 3 7 2. + <_> + 10 14 3 7 2. + <_> + + <_> + 7 13 12 6 -1. + <_> + 13 13 6 3 2. + <_> + 7 16 6 3 2. + <_> + + <_> + 6 7 12 9 -1. + <_> + 10 7 4 9 3. + <_> + + <_> + 12 12 6 6 -1. + <_> + 12 12 3 6 2. + <_> + + <_> + 0 2 4 10 -1. + <_> + 0 7 4 5 2. + <_> + + <_> + 8 0 9 6 -1. + <_> + 11 0 3 6 3. + <_> + + <_> + 2 9 12 6 -1. + <_> + 2 12 12 3 2. + <_> + + <_> + 13 10 6 9 -1. + <_> + 13 13 6 3 3. + <_> + + <_> + 5 10 6 9 -1. + <_> + 5 13 6 3 3. + <_> + + <_> + 9 15 9 6 -1. + <_> + 9 17 9 2 3. + <_> + + <_> + 5 16 12 6 -1. + <_> + 5 19 12 3 2. + <_> + + <_> + 3 2 20 3 -1. + <_> + 3 3 20 1 3. + <_> + + <_> + 2 5 12 6 -1. + <_> + 6 5 4 6 3. + <_> + + <_> + 11 0 3 24 -1. + <_> + 12 0 1 24 3. + <_> + + <_> + 3 16 15 4 -1. + <_> + 8 16 5 4 3. + <_> + + <_> + 9 12 6 12 -1. + <_> + 9 18 6 6 2. + <_> + + <_> + 1 15 12 8 -1. + <_> + 1 15 6 4 2. + <_> + 7 19 6 4 2. + <_> + + <_> + 15 10 8 14 -1. + <_> + 19 10 4 7 2. + <_> + 15 17 4 7 2. + <_> + + <_> + 1 9 8 14 -1. + <_> + 1 9 4 7 2. + <_> + 5 16 4 7 2. + <_> + + <_> + 9 11 9 10 -1. + <_> + 9 16 9 5 2. + <_> + + <_> + 6 7 12 6 -1. + <_> + 6 9 12 2 3. + <_> + + <_> + 10 15 6 9 -1. + <_> + 12 15 2 9 3. + <_> + + <_> + 7 8 9 7 -1. + <_> + 10 8 3 7 3. + <_> + + <_> + 10 4 8 10 -1. + <_> + 14 4 4 5 2. + <_> + 10 9 4 5 2. + <_> + + <_> + 4 6 6 9 -1. + <_> + 4 9 6 3 3. + <_> + + <_> + 0 6 24 12 -1. + <_> + 8 6 8 12 3. + <_> + + <_> + 3 7 6 14 -1. + <_> + 6 7 3 14 2. + <_> + + <_> + 19 8 5 8 -1. + <_> + 19 12 5 4 2. + <_> + + <_> + 0 8 5 8 -1. + <_> + 0 12 5 4 2. + <_> + + <_> + 17 3 6 6 -1. + <_> + 17 6 6 3 2. + <_> + + <_> + 1 3 6 6 -1. + <_> + 1 6 6 3 2. + <_> + + <_> + 18 2 6 9 -1. + <_> + 18 5 6 3 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 3 3 18 6 -1. + <_> + 3 5 18 2 3. + <_> + + <_> + 2 3 9 6 -1. + <_> + 2 5 9 2 3. + <_> + + <_> + 9 3 10 8 -1. + <_> + 14 3 5 4 2. + <_> + 9 7 5 4 2. + <_> + + <_> + 5 3 10 8 -1. + <_> + 5 3 5 4 2. + <_> + 10 7 5 4 2. + <_> + + <_> + 10 11 6 12 -1. + <_> + 10 11 3 12 2. + <_> + + <_> + 8 11 6 11 -1. + <_> + 11 11 3 11 2. + <_> + + <_> + 7 8 10 4 -1. + <_> + 7 8 5 4 2. + <_> + + <_> + 9 6 6 7 -1. + <_> + 12 6 3 7 2. + <_> + + <_> + 5 18 18 3 -1. + <_> + 5 19 18 1 3. + <_> + + <_> + 8 4 6 9 -1. + <_> + 10 4 2 9 3. + <_> + + <_> + 8 1 9 7 -1. + <_> + 11 1 3 7 3. + <_> + + <_> + 6 11 6 6 -1. + <_> + 9 11 3 6 2. + <_> + + <_> + 14 12 4 11 -1. + <_> + 14 12 2 11 2. + <_> + + <_> + 6 12 4 11 -1. + <_> + 8 12 2 11 2. + <_> + + <_> + 8 0 12 18 -1. + <_> + 12 0 4 18 3. + <_> + + <_> + 2 12 10 5 -1. + <_> + 7 12 5 5 2. + <_> + + <_> + 2 20 22 3 -1. + <_> + 2 21 22 1 3. + <_> + + <_> + 0 4 2 20 -1. + <_> + 1 4 1 20 2. + <_> + + <_> + 0 2 24 4 -1. + <_> + 8 2 8 4 3. + <_> + + <_> + 7 8 10 4 -1. + <_> + 7 10 10 2 2. + <_> + + <_> + 6 7 8 10 -1. + <_> + 6 7 4 5 2. + <_> + 10 12 4 5 2. + <_> + + <_> + 14 0 6 14 -1. + <_> + 17 0 3 7 2. + <_> + 14 7 3 7 2. + <_> + + <_> + 4 11 5 8 -1. + <_> + 4 15 5 4 2. + <_> + + <_> + 2 0 20 9 -1. + <_> + 2 3 20 3 3. + <_> + + <_> + 6 7 12 8 -1. + <_> + 6 7 6 4 2. + <_> + 12 11 6 4 2. + <_> + + <_> + 9 17 6 6 -1. + <_> + 9 20 6 3 2. + <_> + + <_> + 7 10 10 4 -1. + <_> + 7 12 10 2 2. + <_> + + <_> + 6 5 12 9 -1. + <_> + 10 5 4 9 3. + <_> + + <_> + 5 11 6 8 -1. + <_> + 8 11 3 8 2. + <_> + + <_> + 18 4 4 17 -1. + <_> + 18 4 2 17 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 18 4 4 17 -1. + <_> + 18 4 2 17 2. + <_> + + <_> + 2 4 4 17 -1. + <_> + 4 4 2 17 2. + <_> + + <_> + 5 18 19 3 -1. + <_> + 5 19 19 1 3. + <_> + + <_> + 11 0 2 18 -1. + <_> + 11 9 2 9 2. + <_> + + <_> + 15 4 2 18 -1. + <_> + 15 13 2 9 2. + <_> + + <_> + 7 4 2 18 -1. + <_> + 7 13 2 9 2. + <_> + + <_> + 7 11 10 8 -1. + <_> + 12 11 5 4 2. + <_> + 7 15 5 4 2. + <_> + + <_> + 10 6 4 9 -1. + <_> + 12 6 2 9 2. + <_> + + <_> + 10 0 6 9 -1. + <_> + 12 0 2 9 3. + <_> + + <_> + 2 9 16 8 -1. + <_> + 2 9 8 4 2. + <_> + 10 13 8 4 2. + <_> + + <_> + 14 15 6 9 -1. + <_> + 14 18 6 3 3. + <_> + + <_> + 8 7 6 9 -1. + <_> + 10 7 2 9 3. + <_> + + <_> + 14 15 6 9 -1. + <_> + 14 18 6 3 3. + <_> + + <_> + 3 12 12 6 -1. + <_> + 3 14 12 2 3. + <_> + + <_> + 14 12 9 6 -1. + <_> + 14 14 9 2 3. + <_> + + <_> + 1 12 9 6 -1. + <_> + 1 14 9 2 3. + <_> + + <_> + 3 7 18 3 -1. + <_> + 3 8 18 1 3. + <_> + + <_> + 1 7 22 6 -1. + <_> + 1 9 22 2 3. + <_> + + <_> + 18 4 6 6 -1. + <_> + 18 7 6 3 2. + <_> + + <_> + 0 4 6 6 -1. + <_> + 0 7 6 3 2. + <_> + + <_> + 5 11 16 6 -1. + <_> + 5 14 16 3 2. + <_> + + <_> + 6 16 9 4 -1. + <_> + 6 18 9 2 2. + <_> + + <_> + 14 15 6 9 -1. + <_> + 14 18 6 3 3. + <_> + + <_> + 4 15 6 9 -1. + <_> + 4 18 6 3 3. + <_> + + <_> + 15 1 6 23 -1. + <_> + 17 1 2 23 3. + <_> + + <_> + 0 21 24 3 -1. + <_> + 8 21 8 3 3. + <_> + + <_> + 0 20 24 4 -1. + <_> + 8 20 8 4 3. + <_> + + <_> + 3 1 6 23 -1. + <_> + 5 1 2 23 3. + <_> + + <_> + 3 17 18 3 -1. + <_> + 3 18 18 1 3. + <_> + + <_> + 0 16 18 3 -1. + <_> + 0 17 18 1 3. + <_> + + <_> + 1 16 22 4 -1. + <_> + 12 16 11 2 2. + <_> + 1 18 11 2 2. + <_> + + <_> + 0 16 9 6 -1. + <_> + 0 18 9 2 3. + <_> + + <_> + 2 10 21 3 -1. + <_> + 9 10 7 3 3. + <_> + + <_> + 2 18 12 6 -1. + <_> + 2 18 6 3 2. + <_> + 8 21 6 3 2. + <_> + + <_> + 0 5 24 4 -1. + <_> + 0 7 24 2 2. + <_> + + <_> + 10 2 4 15 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 10 7 6 12 -1. + <_> + 10 13 6 6 2. + <_> + + <_> + 6 6 6 9 -1. + <_> + 8 6 2 9 3. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 9 7 6 9 -1. + <_> + 11 7 2 9 3. + <_> + + <_> + 2 1 20 3 -1. + <_> + 2 2 20 1 3. + <_> + + <_> + 1 18 12 6 -1. + <_> + 1 18 6 3 2. + <_> + 7 21 6 3 2. + <_> + + <_> + 13 2 4 13 -1. + <_> + 13 2 2 13 2. + <_> + + <_> + 6 7 12 4 -1. + <_> + 12 7 6 4 2. + <_> + + <_> + 10 1 4 13 -1. + <_> + 10 1 2 13 2. + <_> + + <_> + 6 0 3 18 -1. + <_> + 7 0 1 18 3. + <_> + + <_> + 14 3 10 5 -1. + <_> + 14 3 5 5 2. + <_> + + <_> + 6 15 12 8 -1. + <_> + 10 15 4 8 3. + <_> + + <_> + 9 10 6 9 -1. + <_> + 11 10 2 9 3. + <_> + + <_> + 8 3 4 9 -1. + <_> + 10 3 2 9 2. + <_> + + <_> + 17 0 6 14 -1. + <_> + 20 0 3 7 2. + <_> + 17 7 3 7 2. + <_> + + <_> + 1 0 6 14 -1. + <_> + 1 0 3 7 2. + <_> + 4 7 3 7 2. + <_> + + <_> + 14 0 6 16 -1. + <_> + 17 0 3 8 2. + <_> + 14 8 3 8 2. + <_> + + <_> + 7 4 4 10 -1. + <_> + 9 4 2 10 2. + <_> + + <_> + 3 17 18 6 -1. + <_> + 12 17 9 3 2. + <_> + 3 20 9 3 2. + <_> + + <_> + 1 20 22 4 -1. + <_> + 12 20 11 4 2. + <_> + + <_> + 14 3 10 5 -1. + <_> + 14 3 5 5 2. + <_> + + <_> + 0 3 10 5 -1. + <_> + 5 3 5 5 2. + <_> + + <_> + 12 6 12 16 -1. + <_> + 16 6 4 16 3. + <_> + + <_> + 0 6 12 16 -1. + <_> + 4 6 4 16 3. + <_> + + <_> + 10 9 5 15 -1. + <_> + 10 14 5 5 3. + <_> + + <_> + 1 18 21 2 -1. + <_> + 1 19 21 1 2. + <_> + + <_> + 15 0 9 6 -1. + <_> + 15 2 9 2 3. + <_> + + <_> + 6 1 12 4 -1. + <_> + 12 1 6 4 2. + <_> + + <_> + 6 0 12 12 -1. + <_> + 12 0 6 6 2. + <_> + 6 6 6 6 2. + <_> + + <_> + 8 10 8 12 -1. + <_> + 8 10 4 6 2. + <_> + 12 16 4 6 2. + <_> + + <_> + 14 16 10 8 -1. + <_> + 19 16 5 4 2. + <_> + 14 20 5 4 2. + <_> + + <_> + 0 16 10 8 -1. + <_> + 0 16 5 4 2. + <_> + 5 20 5 4 2. + <_> + + <_> + 10 12 12 5 -1. + <_> + 14 12 4 5 3. + <_> + + <_> + 6 16 10 8 -1. + <_> + 6 16 5 4 2. + <_> + 11 20 5 4 2. + <_> + + <_> + 7 6 12 6 -1. + <_> + 13 6 6 3 2. + <_> + 7 9 6 3 2. + <_> + + <_> + 9 6 4 18 -1. + <_> + 9 6 2 9 2. + <_> + 11 15 2 9 2. + <_> + + <_> + 10 9 6 14 -1. + <_> + 13 9 3 7 2. + <_> + 10 16 3 7 2. + <_> + + <_> + 8 9 6 14 -1. + <_> + 8 9 3 7 2. + <_> + 11 16 3 7 2. + <_> + + <_> + 7 4 11 12 -1. + <_> + 7 10 11 6 2. + <_> + + <_> + 4 8 6 16 -1. + <_> + 4 8 3 8 2. + <_> + 7 16 3 8 2. + <_> + + <_> + 17 3 4 21 -1. + <_> + 17 10 4 7 3. + <_> + + <_> + 3 3 4 21 -1. + <_> + 3 10 4 7 3. + <_> + + <_> + 10 1 8 18 -1. + <_> + 14 1 4 9 2. + <_> + 10 10 4 9 2. + <_> + + <_> + 2 5 16 8 -1. + <_> + 2 5 8 4 2. + <_> + 10 9 8 4 2. + <_> + + <_> + 3 6 18 12 -1. + <_> + 3 10 18 4 3. + <_> + + <_> + 4 10 16 12 -1. + <_> + 4 14 16 4 3. + <_> + + <_> + 15 4 8 20 -1. + <_> + 19 4 4 10 2. + <_> + 15 14 4 10 2. + <_> + + <_> + 7 2 9 6 -1. + <_> + 10 2 3 6 3. + <_> + + <_> + 15 4 8 20 -1. + <_> + 19 4 4 10 2. + <_> + 15 14 4 10 2. + <_> + + <_> + 1 4 8 20 -1. + <_> + 1 4 4 10 2. + <_> + 5 14 4 10 2. + <_> + + <_> + 11 8 8 14 -1. + <_> + 15 8 4 7 2. + <_> + 11 15 4 7 2. + <_> + + <_> + 5 8 8 14 -1. + <_> + 5 8 4 7 2. + <_> + 9 15 4 7 2. + <_> + + <_> + 10 13 5 8 -1. + <_> + 10 17 5 4 2. + <_> + + <_> + 4 13 7 9 -1. + <_> + 4 16 7 3 3. + <_> + + <_> + 0 13 24 10 -1. + <_> + 0 18 24 5 2. + <_> + + <_> + 4 2 8 11 -1. + <_> + 8 2 4 11 2. + <_> + + <_> + 10 2 8 16 -1. + <_> + 14 2 4 8 2. + <_> + 10 10 4 8 2. + <_> + + <_> + 0 2 24 6 -1. + <_> + 0 2 12 3 2. + <_> + 12 5 12 3 2. + <_> + + <_> + 6 0 12 9 -1. + <_> + 6 3 12 3 3. + <_> + + <_> + 1 2 12 12 -1. + <_> + 1 2 6 6 2. + <_> + 7 8 6 6 2. + <_> + + <_> + 18 5 6 9 -1. + <_> + 18 8 6 3 3. + <_> + + <_> + 4 3 8 10 -1. + <_> + 4 3 4 5 2. + <_> + 8 8 4 5 2. + <_> + + <_> + 6 21 18 3 -1. + <_> + 6 22 18 1 3. + <_> + + <_> + 1 10 18 2 -1. + <_> + 1 11 18 1 2. + <_> + + <_> + 1 10 22 3 -1. + <_> + 1 11 22 1 3. + <_> + + <_> + 2 8 12 9 -1. + <_> + 2 11 12 3 3. + <_> + + <_> + 12 8 12 6 -1. + <_> + 18 8 6 3 2. + <_> + 12 11 6 3 2. + <_> + + <_> + 0 8 12 6 -1. + <_> + 0 8 6 3 2. + <_> + 6 11 6 3 2. + <_> + + <_> + 10 15 6 9 -1. + <_> + 12 15 2 9 3. + <_> + + <_> + 7 13 9 6 -1. + <_> + 7 15 9 2 3. + <_> + + <_> + 9 8 7 12 -1. + <_> + 9 14 7 6 2. + <_> + + <_> + 4 13 9 6 -1. + <_> + 7 13 3 6 3. + <_> + + <_> + 6 15 18 4 -1. + <_> + 12 15 6 4 3. + <_> + + <_> + 5 4 4 16 -1. + <_> + 7 4 2 16 2. + <_> + + <_> + 10 15 6 9 -1. + <_> + 12 15 2 9 3. + <_> + + <_> + 8 15 6 9 -1. + <_> + 10 15 2 9 3. + <_> + + <_> + 9 11 12 10 -1. + <_> + 15 11 6 5 2. + <_> + 9 16 6 5 2. + <_> + + <_> + 3 6 14 6 -1. + <_> + 3 8 14 2 3. + <_> + + <_> + 4 2 17 8 -1. + <_> + 4 6 17 4 2. + <_> + + <_> + 6 2 12 21 -1. + <_> + 6 9 12 7 3. + <_> + + <_> + 8 1 9 9 -1. + <_> + 8 4 9 3 3. + <_> + + <_> + 0 7 24 3 -1. + <_> + 12 7 12 3 2. + <_> + + <_> + 11 6 9 10 -1. + <_> + 11 11 9 5 2. + <_> + + <_> + 2 11 18 3 -1. + <_> + 2 12 18 1 3. + <_> + + <_> + 8 16 9 4 -1. + <_> + 8 18 9 2 2. + <_> + + <_> + 0 0 9 6 -1. + <_> + 0 2 9 2 3. + <_> + + <_> + 0 11 24 6 -1. + <_> + 0 13 24 2 3. + <_> + + <_> + 2 9 20 6 -1. + <_> + 2 12 20 3 2. + <_> + + <_> + 4 5 16 12 -1. + <_> + 12 5 8 6 2. + <_> + 4 11 8 6 2. + <_> + + <_> + 10 2 4 15 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 7 3 10 4 -1. + <_> + 7 5 10 2 2. + <_> + + <_> + 9 15 6 8 -1. + <_> + 9 19 6 4 2. + <_> + + <_> + 17 0 7 10 -1. + <_> + 17 5 7 5 2. + <_> + + <_> + 0 0 7 10 -1. + <_> + 0 5 7 5 2. + <_> + + <_> + 16 1 6 12 -1. + <_> + 19 1 3 6 2. + <_> + 16 7 3 6 2. + <_> + + <_> + 1 0 19 8 -1. + <_> + 1 4 19 4 2. + <_> + + <_> + 12 2 9 4 -1. + <_> + 12 4 9 2 2. + <_> + + <_> + 3 2 9 4 -1. + <_> + 3 4 9 2 2. + <_> + + <_> + 12 2 10 6 -1. + <_> + 12 4 10 2 3. + <_> + + <_> + 3 4 18 2 -1. + <_> + 12 4 9 2 2. + <_> + + <_> + 12 1 4 9 -1. + <_> + 12 1 2 9 2. + <_> + + <_> + 8 1 4 9 -1. + <_> + 10 1 2 9 2. + <_> + + <_> + 10 5 8 10 -1. + <_> + 14 5 4 5 2. + <_> + 10 10 4 5 2. + <_> + + <_> + 6 4 12 13 -1. + <_> + 10 4 4 13 3. + <_> + + <_> + 13 5 6 6 -1. + <_> + 13 5 3 6 2. + <_> + + <_> + 1 5 12 3 -1. + <_> + 7 5 6 3 2. + <_> + + <_> + 7 5 10 6 -1. + <_> + 7 7 10 2 3. + <_> + + <_> + 2 0 21 5 -1. + <_> + 9 0 7 5 3. + <_> + + <_> + 0 8 9 9 -1. + <_> + 0 11 9 3 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 0 3 6 7 -1. + <_> + 3 3 3 7 2. + <_> + + <_> + 9 18 12 6 -1. + <_> + 15 18 6 3 2. + <_> + 9 21 6 3 2. + <_> + + <_> + 2 8 20 6 -1. + <_> + 2 8 10 3 2. + <_> + 12 11 10 3 2. + <_> + + <_> + 13 2 10 4 -1. + <_> + 13 4 10 2 2. + <_> + + <_> + 4 5 5 18 -1. + <_> + 4 11 5 6 3. + <_> + + <_> + 20 4 4 9 -1. + <_> + 20 4 2 9 2. + <_> + + <_> + 8 6 8 14 -1. + <_> + 8 13 8 7 2. + <_> + + <_> + 0 1 24 6 -1. + <_> + 12 1 12 3 2. + <_> + 0 4 12 3 2. + <_> + + <_> + 0 4 4 9 -1. + <_> + 2 4 2 9 2. + <_> + + <_> + 3 6 18 3 -1. + <_> + 3 7 18 1 3. + <_> + + <_> + 3 17 16 6 -1. + <_> + 3 19 16 2 3. + <_> + + <_> + 13 6 6 9 -1. + <_> + 13 9 6 3 3. + <_> + + <_> + 5 6 14 6 -1. + <_> + 5 6 7 3 2. + <_> + 12 9 7 3 2. + <_> + + <_> + 13 5 8 10 -1. + <_> + 17 5 4 5 2. + <_> + 13 10 4 5 2. + <_> + + <_> + 2 2 20 3 -1. + <_> + 2 3 20 1 3. + <_> + + <_> + 9 2 9 6 -1. + <_> + 12 2 3 6 3. + <_> + + <_> + 8 6 6 9 -1. + <_> + 10 6 2 9 3. + <_> + + <_> + 12 3 4 11 -1. + <_> + 12 3 2 11 2. + <_> + + <_> + 8 3 4 11 -1. + <_> + 10 3 2 11 2. + <_> + + <_> + 8 3 8 10 -1. + <_> + 12 3 4 5 2. + <_> + 8 8 4 5 2. + <_> + + <_> + 11 1 2 18 -1. + <_> + 12 1 1 18 2. + <_> + + <_> + 9 2 9 6 -1. + <_> + 12 2 3 6 3. + <_> + + <_> + 0 2 19 3 -1. + <_> + 0 3 19 1 3. + <_> + + <_> + 9 14 9 6 -1. + <_> + 9 16 9 2 3. + <_> + + <_> + 1 8 18 5 -1. + <_> + 7 8 6 5 3. + <_> + + <_> + 12 0 6 9 -1. + <_> + 14 0 2 9 3. + <_> + + <_> + 6 0 6 9 -1. + <_> + 8 0 2 9 3. + <_> + + <_> + 13 6 4 15 -1. + <_> + 13 11 4 5 3. + <_> + + <_> + 1 5 18 3 -1. + <_> + 1 6 18 1 3. + <_> + + <_> + 9 7 14 6 -1. + <_> + 9 9 14 2 3. + <_> + + <_> + 2 16 18 3 -1. + <_> + 2 17 18 1 3. + <_> + + <_> + 15 17 9 6 -1. + <_> + 15 19 9 2 3. + <_> + + <_> + 0 8 12 6 -1. + <_> + 0 8 6 3 2. + <_> + 6 11 6 3 2. + <_> + + <_> + 9 13 7 8 -1. + <_> + 9 17 7 4 2. + <_> + + <_> + 2 17 20 3 -1. + <_> + 2 18 20 1 3. + <_> + + <_> + 15 17 9 6 -1. + <_> + 15 19 9 2 3. + <_> + + <_> + 4 0 15 4 -1. + <_> + 4 2 15 2 2. + <_> + + <_> + 17 2 6 6 -1. + <_> + 17 5 6 3 2. + <_> + + <_> + 0 3 6 9 -1. + <_> + 0 6 6 3 3. + <_> + + <_> + 15 17 9 6 -1. + <_> + 15 19 9 2 3. + <_> + + <_> + 0 17 9 6 -1. + <_> + 0 19 9 2 3. + <_> + + <_> + 9 18 12 6 -1. + <_> + 15 18 6 3 2. + <_> + 9 21 6 3 2. + <_> + + <_> + 3 15 6 9 -1. + <_> + 3 18 6 3 3. + <_> + + <_> + 16 13 8 10 -1. + <_> + 20 13 4 5 2. + <_> + 16 18 4 5 2. + <_> + + <_> + 0 14 24 4 -1. + <_> + 8 14 8 4 3. + <_> + + <_> + 13 18 6 6 -1. + <_> + 13 18 3 6 2. + <_> + + <_> + 0 13 8 10 -1. + <_> + 0 13 4 5 2. + <_> + 4 18 4 5 2. + <_> + + <_> + 0 14 24 6 -1. + <_> + 0 17 24 3 2. + <_> + + <_> + 5 2 12 8 -1. + <_> + 5 2 6 4 2. + <_> + 11 6 6 4 2. + <_> + + <_> + 8 9 9 6 -1. + <_> + 11 9 3 6 3. + <_> + + <_> + 4 3 16 4 -1. + <_> + 4 5 16 2 2. + <_> + + <_> + 10 2 4 10 -1. + <_> + 10 7 4 5 2. + <_> + + <_> + 8 4 5 8 -1. + <_> + 8 8 5 4 2. + <_> + + <_> + 11 5 9 12 -1. + <_> + 11 9 9 4 3. + <_> + + <_> + 4 5 9 12 -1. + <_> + 4 9 9 4 3. + <_> + + <_> + 14 6 6 9 -1. + <_> + 14 9 6 3 3. + <_> + + <_> + 2 4 20 12 -1. + <_> + 2 8 20 4 3. + <_> + + <_> + 4 4 17 16 -1. + <_> + 4 12 17 8 2. + <_> + + <_> + 8 7 7 6 -1. + <_> + 8 10 7 3 2. + <_> + + <_> + 1 9 23 2 -1. + <_> + 1 10 23 1 2. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 13 3 4 9 -1. + <_> + 13 3 2 9 2. + <_> + + <_> + 8 1 6 13 -1. + <_> + 10 1 2 13 3. + <_> + + <_> + 4 22 18 2 -1. + <_> + 4 23 18 1 2. + <_> + + <_> + 3 10 9 6 -1. + <_> + 6 10 3 6 3. + <_> + + <_> + 14 0 2 24 -1. + <_> + 14 0 1 24 2. + <_> + + <_> + 8 0 2 24 -1. + <_> + 9 0 1 24 2. + <_> + + <_> + 3 2 18 10 -1. + <_> + 9 2 6 10 3. + <_> + + <_> + 4 13 15 6 -1. + <_> + 9 13 5 6 3. + <_> + + <_> + 3 21 18 3 -1. + <_> + 9 21 6 3 3. + <_> + + <_> + 9 1 4 11 -1. + <_> + 11 1 2 11 2. + <_> + + <_> + 9 7 10 4 -1. + <_> + 9 7 5 4 2. + <_> + + <_> + 7 0 10 18 -1. + <_> + 12 0 5 18 2. + <_> + + <_> + 12 1 6 16 -1. + <_> + 14 1 2 16 3. + <_> + + <_> + 6 1 6 16 -1. + <_> + 8 1 2 16 3. + <_> + + <_> + 18 2 6 6 -1. + <_> + 18 5 6 3 2. + <_> + + <_> + 3 5 18 2 -1. + <_> + 3 6 18 1 2. + <_> + + <_> + 18 2 6 6 -1. + <_> + 18 5 6 3 2. + <_> + + <_> + 0 2 6 6 -1. + <_> + 0 5 6 3 2. + <_> + + <_> + 13 11 11 6 -1. + <_> + 13 13 11 2 3. + <_> + + <_> + 5 7 10 4 -1. + <_> + 10 7 5 4 2. + <_> + + <_> + 11 9 10 7 -1. + <_> + 11 9 5 7 2. + <_> + + <_> + 3 9 10 7 -1. + <_> + 8 9 5 7 2. + <_> + + <_> + 16 4 6 6 -1. + <_> + 16 4 3 6 2. + <_> + + <_> + 5 6 10 8 -1. + <_> + 5 6 5 4 2. + <_> + 10 10 5 4 2. + <_> + + <_> + 7 21 16 3 -1. + <_> + 7 21 8 3 2. + <_> + + <_> + 1 21 16 3 -1. + <_> + 9 21 8 3 2. + <_> + + <_> + 2 5 22 14 -1. + <_> + 13 5 11 7 2. + <_> + 2 12 11 7 2. + <_> + + <_> + 3 10 8 10 -1. + <_> + 3 10 4 5 2. + <_> + 7 15 4 5 2. + <_> + + <_> + 17 0 6 12 -1. + <_> + 20 0 3 6 2. + <_> + 17 6 3 6 2. + <_> + + <_> + 5 2 6 18 -1. + <_> + 7 2 2 18 3. + <_> + + <_> + 13 0 6 9 -1. + <_> + 15 0 2 9 3. + <_> + + <_> + 0 12 7 9 -1. + <_> + 0 15 7 3 3. + <_> + + <_> + 15 13 8 10 -1. + <_> + 19 13 4 5 2. + <_> + 15 18 4 5 2. + <_> + + <_> + 1 0 6 12 -1. + <_> + 1 0 3 6 2. + <_> + 4 6 3 6 2. + <_> + + <_> + 12 1 3 12 -1. + <_> + 12 7 3 6 2. + <_> + + <_> + 1 13 8 10 -1. + <_> + 1 13 4 5 2. + <_> + 5 18 4 5 2. + <_> + + <_> + 3 21 19 2 -1. + <_> + 3 22 19 1 2. + <_> + + <_> + 6 3 4 13 -1. + <_> + 8 3 2 13 2. + <_> + + <_> + 5 10 18 3 -1. + <_> + 5 11 18 1 3. + <_> + + <_> + 9 3 5 12 -1. + <_> + 9 7 5 4 3. + <_> + + <_> + 11 2 4 15 -1. + <_> + 11 7 4 5 3. + <_> + + <_> + 4 1 16 4 -1. + <_> + 4 3 16 2 2. + <_> + + <_> + 6 0 18 3 -1. + <_> + 6 1 18 1 3. + <_> + + <_> + 5 1 10 8 -1. + <_> + 5 1 5 4 2. + <_> + 10 5 5 4 2. + <_> + + <_> + 11 18 12 6 -1. + <_> + 17 18 6 3 2. + <_> + 11 21 6 3 2. + <_> + + <_> + 5 15 12 3 -1. + <_> + 11 15 6 3 2. + <_> + + <_> + 1 10 22 4 -1. + <_> + 1 10 11 4 2. + <_> + + <_> + 7 9 9 6 -1. + <_> + 10 9 3 6 3. + <_> + + <_> + 6 11 12 5 -1. + <_> + 10 11 4 5 3. + <_> + + <_> + 6 7 10 7 -1. + <_> + 11 7 5 7 2. + <_> + + <_> + 11 2 8 10 -1. + <_> + 11 2 4 10 2. + <_> + + <_> + 5 2 8 10 -1. + <_> + 9 2 4 10 2. + <_> + + <_> + 6 4 18 6 -1. + <_> + 15 4 9 3 2. + <_> + 6 7 9 3 2. + <_> + + <_> + 0 5 10 9 -1. + <_> + 0 8 10 3 3. + <_> + + <_> + 2 7 21 6 -1. + <_> + 2 9 21 2 3. + <_> + + <_> + 0 4 22 16 -1. + <_> + 0 4 11 8 2. + <_> + 11 12 11 8 2. + <_> + + <_> + 9 0 6 22 -1. + <_> + 9 11 6 11 2. + <_> + + <_> + 9 1 3 12 -1. + <_> + 9 7 3 6 2. + <_> + + <_> + 12 0 12 18 -1. + <_> + 18 0 6 9 2. + <_> + 12 9 6 9 2. + <_> + + <_> + 0 0 12 18 -1. + <_> + 0 0 6 9 2. + <_> + 6 9 6 9 2. + <_> + + <_> + 1 1 22 4 -1. + <_> + 12 1 11 2 2. + <_> + 1 3 11 2 2. + <_> + + <_> + 3 0 18 4 -1. + <_> + 3 2 18 2 2. + <_> + + <_> + 2 5 22 6 -1. + <_> + 2 7 22 2 3. + <_> + + <_> + 5 0 6 9 -1. + <_> + 5 3 6 3 3. + <_> + + <_> + 10 14 6 9 -1. + <_> + 12 14 2 9 3. + <_> + + <_> + 8 14 6 9 -1. + <_> + 10 14 2 9 3. + <_> + + <_> + 5 18 18 3 -1. + <_> + 5 19 18 1 3. + <_> + + <_> + 6 0 6 13 -1. + <_> + 9 0 3 13 2. + <_> + + <_> + 7 4 12 4 -1. + <_> + 7 4 6 4 2. + <_> + + <_> + 5 2 12 6 -1. + <_> + 9 2 4 6 3. + <_> + + <_> + 4 1 18 3 -1. + <_> + 4 2 18 1 3. + <_> + + <_> + 0 8 6 12 -1. + <_> + 0 12 6 4 3. + <_> + + <_> + 9 15 6 9 -1. + <_> + 11 15 2 9 3. + <_> + + <_> + 9 10 6 13 -1. + <_> + 11 10 2 13 3. + <_> + + <_> + 6 17 18 2 -1. + <_> + 6 18 18 1 2. + <_> + + <_> + 9 4 6 9 -1. + <_> + 11 4 2 9 3. + <_> + + <_> + 10 0 6 9 -1. + <_> + 12 0 2 9 3. + <_> + + <_> + 5 6 10 8 -1. + <_> + 5 6 5 4 2. + <_> + 10 10 5 4 2. + <_> + + <_> + 14 9 5 8 -1. + <_> + 14 13 5 4 2. + <_> + + <_> + 5 9 5 8 -1. + <_> + 5 13 5 4 2. + <_> + + <_> + 14 11 9 6 -1. + <_> + 14 13 9 2 3. + <_> + + <_> + 0 2 23 15 -1. + <_> + 0 7 23 5 3. + <_> + + <_> + 16 0 8 12 -1. + <_> + 16 6 8 6 2. + <_> + + <_> + 4 15 6 9 -1. + <_> + 4 18 6 3 3. + <_> + + <_> + 8 18 9 4 -1. + <_> + 8 20 9 2 2. + <_> + + <_> + 0 17 18 3 -1. + <_> + 0 18 18 1 3. + <_> + + <_> + 13 11 11 6 -1. + <_> + 13 13 11 2 3. + <_> + + <_> + 0 11 11 6 -1. + <_> + 0 13 11 2 3. + <_> + + <_> + 0 9 24 6 -1. + <_> + 12 9 12 3 2. + <_> + 0 12 12 3 2. + <_> + + <_> + 6 16 8 8 -1. + <_> + 6 20 8 4 2. + <_> + + <_> + 10 16 14 6 -1. + <_> + 10 18 14 2 3. + <_> + + <_> + 1 1 21 3 -1. + <_> + 1 2 21 1 3. + <_> + + <_> + 0 2 24 3 -1. + <_> + 0 2 12 3 2. + <_> + + <_> + 2 15 8 5 -1. + <_> + 6 15 4 5 2. + <_> + + <_> + 2 11 21 3 -1. + <_> + 9 11 7 3 3. + <_> + + <_> + 1 18 12 6 -1. + <_> + 1 18 6 3 2. + <_> + 7 21 6 3 2. + <_> + + <_> + 10 14 4 10 -1. + <_> + 10 19 4 5 2. + <_> + + <_> + 7 7 4 10 -1. + <_> + 7 12 4 5 2. + <_> + + <_> + 9 8 6 12 -1. + <_> + 9 12 6 4 3. + <_> + + <_> + 7 1 9 6 -1. + <_> + 10 1 3 6 3. + <_> + + <_> + 3 14 19 2 -1. + <_> + 3 15 19 1 2. + <_> + + <_> + 7 7 10 10 -1. + <_> + 7 7 5 5 2. + <_> + 12 12 5 5 2. + <_> + + <_> + 3 12 18 12 -1. + <_> + 3 12 9 12 2. + <_> + + <_> + 8 0 6 12 -1. + <_> + 10 0 2 12 3. + <_> + + <_> + 3 0 17 9 -1. + <_> + 3 3 17 3 3. + <_> + + <_> + 6 0 12 11 -1. + <_> + 10 0 4 11 3. + <_> + + <_> + 1 0 6 13 -1. + <_> + 4 0 3 13 2. + <_> + + <_> + 5 8 16 6 -1. + <_> + 5 11 16 3 2. + <_> + + <_> + 8 8 5 12 -1. + <_> + 8 14 5 6 2. + <_> + + <_> + 3 21 18 3 -1. + <_> + 9 21 6 3 3. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 2 0 20 3 -1. + <_> + 2 1 20 1 3. + <_> + + <_> + 4 6 15 10 -1. + <_> + 9 6 5 10 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 9 0 6 9 -1. + <_> + 11 0 2 9 3. + <_> + + <_> + 14 0 6 9 -1. + <_> + 16 0 2 9 3. + <_> + + <_> + 7 16 9 6 -1. + <_> + 7 18 9 2 3. + <_> + + <_> + 14 0 6 9 -1. + <_> + 16 0 2 9 3. + <_> + + <_> + 4 0 6 9 -1. + <_> + 6 0 2 9 3. + <_> + + <_> + 17 1 6 16 -1. + <_> + 19 1 2 16 3. + <_> + + <_> + 1 1 6 16 -1. + <_> + 3 1 2 16 3. + <_> + + <_> + 14 13 6 9 -1. + <_> + 14 16 6 3 3. + <_> + + <_> + 0 0 6 9 -1. + <_> + 0 3 6 3 3. + <_> + + <_> + 9 5 6 6 -1. + <_> + 9 5 3 6 2. + <_> + + <_> + 3 10 9 6 -1. + <_> + 6 10 3 6 3. + <_> + + <_> + 14 7 3 16 -1. + <_> + 14 15 3 8 2. + <_> + + <_> + 4 10 14 12 -1. + <_> + 4 10 7 6 2. + <_> + 11 16 7 6 2. + <_> + + <_> + 7 6 12 6 -1. + <_> + 7 8 12 2 3. + <_> + + <_> + 7 2 4 20 -1. + <_> + 9 2 2 20 2. + <_> + + <_> + 14 13 6 9 -1. + <_> + 14 16 6 3 3. + <_> + + <_> + 10 6 4 9 -1. + <_> + 12 6 2 9 2. + <_> + + <_> + 14 13 6 9 -1. + <_> + 14 16 6 3 3. + <_> + + <_> + 5 20 14 4 -1. + <_> + 5 22 14 2 2. + <_> + + <_> + 4 4 16 12 -1. + <_> + 4 10 16 6 2. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 3 0 21 4 -1. + <_> + 3 2 21 2 2. + <_> + + <_> + 4 13 6 9 -1. + <_> + 4 16 6 3 3. + <_> + + <_> + 16 16 5 8 -1. + <_> + 16 20 5 4 2. + <_> + + <_> + 4 0 16 16 -1. + <_> + 4 0 8 8 2. + <_> + 12 8 8 8 2. + <_> + + <_> + 6 6 14 6 -1. + <_> + 13 6 7 3 2. + <_> + 6 9 7 3 2. + <_> + + <_> + 10 5 4 15 -1. + <_> + 10 10 4 5 3. + <_> + + <_> + 9 15 12 8 -1. + <_> + 15 15 6 4 2. + <_> + 9 19 6 4 2. + <_> + + <_> + 6 7 12 4 -1. + <_> + 12 7 6 4 2. + <_> + + <_> + 5 6 14 6 -1. + <_> + 12 6 7 3 2. + <_> + 5 9 7 3 2. + <_> + + <_> + 3 6 18 10 -1. + <_> + 3 6 9 5 2. + <_> + 12 11 9 5 2. + <_> + + <_> + 6 0 18 21 -1. + <_> + 12 0 6 21 3. + <_> + + <_> + 0 0 24 21 -1. + <_> + 8 0 8 21 3. + <_> + + <_> + 6 18 18 3 -1. + <_> + 6 19 18 1 3. + <_> + + <_> + 0 15 9 6 -1. + <_> + 0 17 9 2 3. + <_> + + <_> + 4 3 19 2 -1. + <_> + 4 4 19 1 2. + <_> + + <_> + 0 3 24 2 -1. + <_> + 0 4 24 1 2. + <_> + + <_> + 15 14 9 4 -1. + <_> + 15 16 9 2 2. + <_> + + <_> + 0 14 9 4 -1. + <_> + 0 16 9 2 2. + <_> + + <_> + 6 15 18 2 -1. + <_> + 6 16 18 1 2. + <_> + + <_> + 3 17 18 3 -1. + <_> + 3 18 18 1 3. + <_> + + <_> + 12 0 3 23 -1. + <_> + 13 0 1 23 3. + <_> + + <_> + 6 0 8 6 -1. + <_> + 6 3 8 3 2. + <_> + + <_> + 6 16 18 3 -1. + <_> + 6 17 18 1 3. + <_> + + <_> + 9 0 3 23 -1. + <_> + 10 0 1 23 3. + <_> + + <_> + 10 7 4 10 -1. + <_> + 10 12 4 5 2. + <_> + + <_> + 7 8 10 12 -1. + <_> + 7 12 10 4 3. + <_> + + <_> + 14 9 6 14 -1. + <_> + 17 9 3 7 2. + <_> + 14 16 3 7 2. + <_> + + <_> + 2 0 10 9 -1. + <_> + 2 3 10 3 3. + <_> + + <_> + 11 1 5 12 -1. + <_> + 11 7 5 6 2. + <_> + + <_> + 1 4 12 10 -1. + <_> + 1 4 6 5 2. + <_> + 7 9 6 5 2. + <_> + + <_> + 15 1 9 4 -1. + <_> + 15 3 9 2 2. + <_> + + <_> + 1 2 8 10 -1. + <_> + 1 2 4 5 2. + <_> + 5 7 4 5 2. + <_> + + <_> + 10 1 5 12 -1. + <_> + 10 5 5 4 3. + <_> + + <_> + 4 0 14 24 -1. + <_> + 11 0 7 24 2. + <_> + + <_> + 7 17 10 4 -1. + <_> + 7 19 10 2 2. + <_> + + <_> + 10 14 4 10 -1. + <_> + 10 19 4 5 2. + <_> + + <_> + 13 15 6 9 -1. + <_> + 15 15 2 9 3. + <_> + + <_> + 3 21 18 3 -1. + <_> + 3 22 18 1 3. + <_> + + <_> + 13 15 6 9 -1. + <_> + 15 15 2 9 3. + <_> + + <_> + 5 15 6 9 -1. + <_> + 7 15 2 9 3. + <_> + + <_> + 10 6 4 18 -1. + <_> + 12 6 2 9 2. + <_> + 10 15 2 9 2. + <_> + + <_> + 7 3 6 11 -1. + <_> + 9 3 2 11 3. + <_> + + <_> + 15 1 9 4 -1. + <_> + 15 3 9 2 2. + <_> + + <_> + 5 4 14 8 -1. + <_> + 5 8 14 4 2. + <_> + + <_> + 8 1 15 9 -1. + <_> + 8 4 15 3 3. + <_> + + <_> + 7 2 8 10 -1. + <_> + 7 2 4 5 2. + <_> + 11 7 4 5 2. + <_> + + <_> + 12 2 6 12 -1. + <_> + 12 2 3 12 2. + <_> + + <_> + 6 2 6 12 -1. + <_> + 9 2 3 12 2. + <_> + + <_> + 7 7 12 4 -1. + <_> + 7 7 6 4 2. + <_> + + <_> + 6 3 12 10 -1. + <_> + 10 3 4 10 3. + <_> + + <_> + 5 6 16 6 -1. + <_> + 13 6 8 3 2. + <_> + 5 9 8 3 2. + <_> + + <_> + 3 1 18 9 -1. + <_> + 9 1 6 9 3. + <_> + + <_> + 3 8 18 5 -1. + <_> + 9 8 6 5 3. + <_> + + <_> + 0 0 24 22 -1. + <_> + 0 0 12 11 2. + <_> + 12 11 12 11 2. + <_> + + <_> + 14 16 9 6 -1. + <_> + 14 18 9 2 3. + <_> + + <_> + 0 16 24 8 -1. + <_> + 0 20 24 4 2. + <_> + + <_> + 1 19 22 4 -1. + <_> + 12 19 11 2 2. + <_> + 1 21 11 2 2. + <_> + + <_> + 1 16 9 6 -1. + <_> + 1 18 9 2 3. + <_> + + <_> + 7 8 10 4 -1. + <_> + 7 8 5 4 2. + <_> + + <_> + 9 15 6 9 -1. + <_> + 11 15 2 9 3. + <_> + + <_> + 10 18 12 6 -1. + <_> + 16 18 6 3 2. + <_> + 10 21 6 3 2. + <_> + + <_> + 2 18 12 6 -1. + <_> + 2 18 6 3 2. + <_> + 8 21 6 3 2. + <_> + + <_> + 8 3 16 9 -1. + <_> + 8 6 16 3 3. + <_> + + <_> + 0 5 10 6 -1. + <_> + 0 7 10 2 3. + <_> + + <_> + 5 5 18 3 -1. + <_> + 5 6 18 1 3. + <_> + + <_> + 2 6 9 6 -1. + <_> + 2 9 9 3 2. + <_> + + <_> + 14 2 10 9 -1. + <_> + 14 5 10 3 3. + <_> + + <_> + 3 6 18 3 -1. + <_> + 3 7 18 1 3. + <_> + + <_> + 9 2 15 6 -1. + <_> + 9 4 15 2 3. + <_> + + <_> + 4 8 15 6 -1. + <_> + 4 10 15 2 3. + <_> + + <_> + 0 5 24 4 -1. + <_> + 12 5 12 2 2. + <_> + 0 7 12 2 2. + <_> + + <_> + 7 8 6 12 -1. + <_> + 9 8 2 12 3. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 0 12 6 12 -1. + <_> + 0 12 3 6 2. + <_> + 3 18 3 6 2. + <_> + + <_> + 14 12 10 6 -1. + <_> + 14 14 10 2 3. + <_> + + <_> + 2 7 18 9 -1. + <_> + 2 10 18 3 3. + <_> + + <_> + 11 14 10 9 -1. + <_> + 11 17 10 3 3. + <_> + + <_> + 7 6 10 8 -1. + <_> + 7 6 5 4 2. + <_> + 12 10 5 4 2. + <_> + + <_> + 6 6 14 6 -1. + <_> + 13 6 7 3 2. + <_> + 6 9 7 3 2. + <_> + + <_> + 4 13 9 7 -1. + <_> + 7 13 3 7 3. + <_> + + <_> + 14 10 6 12 -1. + <_> + 17 10 3 6 2. + <_> + 14 16 3 6 2. + <_> + + <_> + 4 10 6 12 -1. + <_> + 4 10 3 6 2. + <_> + 7 16 3 6 2. + <_> + + <_> + 13 9 8 6 -1. + <_> + 13 9 4 6 2. + <_> + + <_> + 8 3 4 14 -1. + <_> + 10 3 2 14 2. + <_> + + <_> + 17 0 3 18 -1. + <_> + 18 0 1 18 3. + <_> + + <_> + 4 12 16 12 -1. + <_> + 12 12 8 12 2. + <_> + + <_> + 15 0 6 14 -1. + <_> + 17 0 2 14 3. + <_> + + <_> + 3 0 6 14 -1. + <_> + 5 0 2 14 3. + <_> + + <_> + 12 2 12 20 -1. + <_> + 16 2 4 20 3. + <_> + + <_> + 0 2 12 20 -1. + <_> + 4 2 4 20 3. + <_> + + <_> + 16 0 6 17 -1. + <_> + 18 0 2 17 3. + <_> + + <_> + 2 0 6 17 -1. + <_> + 4 0 2 17 3. + <_> + + <_> + 15 6 9 6 -1. + <_> + 15 8 9 2 3. + <_> + + <_> + 0 6 9 6 -1. + <_> + 0 8 9 2 3. + <_> + + <_> + 18 1 6 13 -1. + <_> + 20 1 2 13 3. + <_> + + <_> + 0 1 6 13 -1. + <_> + 2 1 2 13 3. + <_> + + <_> + 16 0 4 9 -1. + <_> + 16 0 2 9 2. + <_> + + <_> + 5 10 12 7 -1. + <_> + 9 10 4 7 3. + <_> + + <_> + 12 9 12 6 -1. + <_> + 12 11 12 2 3. + <_> + + <_> + 0 9 12 6 -1. + <_> + 0 11 12 2 3. + <_> + + <_> + 5 7 14 9 -1. + <_> + 5 10 14 3 3. + <_> + + <_> + 0 15 20 3 -1. + <_> + 0 16 20 1 3. + <_> + + <_> + 8 10 8 10 -1. + <_> + 12 10 4 5 2. + <_> + 8 15 4 5 2. + <_> + + <_> + 5 4 13 9 -1. + <_> + 5 7 13 3 3. + <_> + + <_> + 10 2 6 18 -1. + <_> + 10 8 6 6 3. + <_> + + <_> + 6 0 6 9 -1. + <_> + 8 0 2 9 3. + <_> + + <_> + 6 9 12 4 -1. + <_> + 6 11 12 2 2. + <_> + + <_> + 3 2 15 12 -1. + <_> + 3 6 15 4 3. + <_> + + <_> + 12 0 12 5 -1. + <_> + 16 0 4 5 3. + <_> + + <_> + 0 15 18 3 -1. + <_> + 6 15 6 3 3. + <_> + + <_> + 0 14 24 5 -1. + <_> + 8 14 8 5 3. + <_> + + <_> + 5 1 3 18 -1. + <_> + 6 1 1 18 3. + <_> + + <_> + 10 0 4 14 -1. + <_> + 10 0 2 14 2. + <_> + + <_> + 9 3 4 9 -1. + <_> + 11 3 2 9 2. + <_> + + <_> + 8 2 12 6 -1. + <_> + 14 2 6 3 2. + <_> + 8 5 6 3 2. + <_> + + <_> + 0 4 17 4 -1. + <_> + 0 6 17 2 2. + <_> + + <_> + 16 16 5 8 -1. + <_> + 16 20 5 4 2. + <_> + + <_> + 3 16 5 8 -1. + <_> + 3 20 5 4 2. + <_> + + <_> + 6 18 18 2 -1. + <_> + 6 19 18 1 2. + <_> + + <_> + 0 0 12 5 -1. + <_> + 4 0 4 5 3. + <_> + + <_> + 14 3 6 12 -1. + <_> + 17 3 3 6 2. + <_> + 14 9 3 6 2. + <_> + + <_> + 0 12 6 12 -1. + <_> + 2 12 2 12 3. + <_> + + <_> + 2 3 21 3 -1. + <_> + 2 4 21 1 3. + <_> + + <_> + 4 3 6 12 -1. + <_> + 4 3 3 6 2. + <_> + 7 9 3 6 2. + <_> + + <_> + 12 8 12 6 -1. + <_> + 18 8 6 3 2. + <_> + 12 11 6 3 2. + <_> + + <_> + 0 15 16 9 -1. + <_> + 8 15 8 9 2. + <_> + + <_> + 6 13 18 5 -1. + <_> + 6 13 9 5 2. + <_> + + <_> + 1 6 15 6 -1. + <_> + 6 6 5 6 3. + <_> + + <_> + 11 9 9 6 -1. + <_> + 14 9 3 6 3. + <_> + + <_> + 3 0 15 11 -1. + <_> + 8 0 5 11 3. + <_> + + <_> + 15 3 3 18 -1. + <_> + 15 9 3 6 3. + <_> + + <_> + 6 3 3 18 -1. + <_> + 6 9 3 6 3. + <_> + + <_> + 9 5 10 8 -1. + <_> + 14 5 5 4 2. + <_> + 9 9 5 4 2. + <_> + + <_> + 4 4 16 8 -1. + <_> + 4 4 8 4 2. + <_> + 12 8 8 4 2. + <_> + + <_> + 7 7 12 3 -1. + <_> + 7 7 6 3 2. + <_> + + <_> + 5 0 9 13 -1. + <_> + 8 0 3 13 3. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 8 1 10 9 -1. + <_> + 8 4 10 3 3. + <_> + + <_> + 0 2 18 2 -1. + <_> + 0 3 18 1 2. + <_> + + <_> + 10 13 14 6 -1. + <_> + 17 13 7 3 2. + <_> + 10 16 7 3 2. + <_> + + <_> + 0 13 14 6 -1. + <_> + 0 13 7 3 2. + <_> + 7 16 7 3 2. + <_> + + <_> + 20 2 3 21 -1. + <_> + 21 2 1 21 3. + <_> + + <_> + 0 9 5 12 -1. + <_> + 0 13 5 4 3. + <_> + + <_> + 12 6 12 6 -1. + <_> + 12 8 12 2 3. + <_> + + <_> + 1 8 20 3 -1. + <_> + 1 9 20 1 3. + <_> + + <_> + 5 7 19 3 -1. + <_> + 5 8 19 1 3. + <_> + + <_> + 1 12 9 6 -1. + <_> + 1 14 9 2 3. + <_> + + <_> + 6 10 14 12 -1. + <_> + 6 14 14 4 3. + <_> + + <_> + 5 6 14 18 -1. + <_> + 5 12 14 6 3. + <_> + + <_> + 11 12 9 7 -1. + <_> + 14 12 3 7 3. + <_> + + <_> + 1 15 18 4 -1. + <_> + 1 17 18 2 2. + <_> + + <_> + 11 14 6 9 -1. + <_> + 11 17 6 3 3. + <_> + + <_> + 0 8 18 4 -1. + <_> + 0 8 9 2 2. + <_> + 9 10 9 2 2. + <_> + + <_> + 3 10 20 6 -1. + <_> + 13 10 10 3 2. + <_> + 3 13 10 3 2. + <_> + + <_> + 1 10 20 6 -1. + <_> + 1 10 10 3 2. + <_> + 11 13 10 3 2. + <_> + + <_> + 0 9 24 2 -1. + <_> + 0 9 12 2 2. + <_> + + <_> + 1 12 20 8 -1. + <_> + 1 12 10 4 2. + <_> + 11 16 10 4 2. + <_> + + <_> + 11 12 9 7 -1. + <_> + 14 12 3 7 3. + <_> + + <_> + 4 12 9 7 -1. + <_> + 7 12 3 7 3. + <_> + + <_> + 12 12 8 5 -1. + <_> + 12 12 4 5 2. + <_> + + <_> + 4 12 8 5 -1. + <_> + 8 12 4 5 2. + <_> + + <_> + 13 10 4 10 -1. + <_> + 13 10 2 10 2. + <_> + + <_> + 1 15 20 2 -1. + <_> + 11 15 10 2 2. + <_> + + <_> + 9 10 6 6 -1. + <_> + 9 10 3 6 2. + <_> + + <_> + 0 1 21 3 -1. + <_> + 7 1 7 3 3. + <_> + + <_> + 6 4 13 9 -1. + <_> + 6 7 13 3 3. + <_> + + <_> + 6 5 12 5 -1. + <_> + 10 5 4 5 3. + <_> + + <_> + 10 10 10 6 -1. + <_> + 10 12 10 2 3. + <_> + + <_> + 6 12 5 8 -1. + <_> + 6 16 5 4 2. + <_> + + <_> + 13 0 6 9 -1. + <_> + 15 0 2 9 3. + <_> + + <_> + 2 10 18 6 -1. + <_> + 8 10 6 6 3. + <_> + + <_> + 11 2 9 4 -1. + <_> + 11 4 9 2 2. + <_> + + <_> + 1 20 21 3 -1. + <_> + 8 20 7 3 3. + <_> + + <_> + 1 10 22 2 -1. + <_> + 1 11 22 1 2. + <_> + + <_> + 0 17 18 3 -1. + <_> + 0 18 18 1 3. + <_> + + <_> + 13 0 6 9 -1. + <_> + 15 0 2 9 3. + <_> + + <_> + 5 0 6 9 -1. + <_> + 7 0 2 9 3. + <_> + + <_> + 18 2 6 20 -1. + <_> + 20 2 2 20 3. + <_> + + <_> + 0 2 6 20 -1. + <_> + 2 2 2 20 3. + <_> + + <_> + 11 7 6 14 -1. + <_> + 14 7 3 7 2. + <_> + 11 14 3 7 2. + <_> + + <_> + 0 1 4 9 -1. + <_> + 2 1 2 9 2. + <_> + + <_> + 12 14 9 4 -1. + <_> + 12 16 9 2 2. + <_> + + <_> + 1 13 9 4 -1. + <_> + 1 15 9 2 2. + <_> + + <_> + 7 6 15 6 -1. + <_> + 7 8 15 2 3. + <_> + + <_> + 8 2 3 18 -1. + <_> + 8 8 3 6 3. + <_> + + <_> + 6 6 12 6 -1. + <_> + 12 6 6 3 2. + <_> + 6 9 6 3 2. + <_> + + <_> + 2 19 20 4 -1. + <_> + 2 19 10 2 2. + <_> + 12 21 10 2 2. + <_> + + <_> + 14 15 6 9 -1. + <_> + 14 18 6 3 3. + <_> + + <_> + 3 5 18 14 -1. + <_> + 3 5 9 7 2. + <_> + 12 12 9 7 2. + <_> + + <_> + 15 6 4 18 -1. + <_> + 17 6 2 9 2. + <_> + 15 15 2 9 2. + <_> + + <_> + 5 6 4 18 -1. + <_> + 5 6 2 9 2. + <_> + 7 15 2 9 2. + <_> + + <_> + 11 0 6 9 -1. + <_> + 13 0 2 9 3. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 11 5 6 9 -1. + <_> + 13 5 2 9 3. + <_> + + <_> + 9 5 6 6 -1. + <_> + 12 5 3 6 2. + <_> + + <_> + 4 1 16 6 -1. + <_> + 12 1 8 3 2. + <_> + 4 4 8 3 2. + <_> + + <_> + 9 13 6 11 -1. + <_> + 11 13 2 11 3. + <_> + + <_> + 17 1 6 12 -1. + <_> + 20 1 3 6 2. + <_> + 17 7 3 6 2. + <_> + + <_> + 1 17 18 3 -1. + <_> + 1 18 18 1 3. + <_> + + <_> + 7 13 10 8 -1. + <_> + 7 17 10 4 2. + <_> + + <_> + 6 18 10 6 -1. + <_> + 6 20 10 2 3. + <_> + + <_> + 9 14 9 4 -1. + <_> + 9 16 9 2 2. + <_> + + <_> + 1 1 6 12 -1. + <_> + 1 1 3 6 2. + <_> + 4 7 3 6 2. + <_> + + <_> + 19 4 5 12 -1. + <_> + 19 8 5 4 3. + <_> + + <_> + 0 0 8 8 -1. + <_> + 4 0 4 8 2. + <_> + + <_> + 3 5 19 3 -1. + <_> + 3 6 19 1 3. + <_> + + <_> + 1 5 12 6 -1. + <_> + 1 5 6 3 2. + <_> + 7 8 6 3 2. + <_> + + <_> + 2 1 21 8 -1. + <_> + 9 1 7 8 3. + <_> + + <_> + 4 1 16 8 -1. + <_> + 4 5 16 4 2. + <_> + + <_> + 6 0 18 3 -1. + <_> + 6 1 18 1 3. + <_> + + <_> + 4 4 10 14 -1. + <_> + 4 11 10 7 2. + <_> + + <_> + 15 6 4 10 -1. + <_> + 15 11 4 5 2. + <_> + + <_> + 3 18 18 3 -1. + <_> + 9 18 6 3 3. + <_> + + <_> + 8 18 12 6 -1. + <_> + 12 18 4 6 3. + <_> + + <_> + 3 15 6 9 -1. + <_> + 6 15 3 9 2. + <_> + + <_> + 15 7 6 8 -1. + <_> + 15 11 6 4 2. + <_> + + <_> + 3 7 6 8 -1. + <_> + 3 11 6 4 2. + <_> + + <_> + 5 9 18 6 -1. + <_> + 14 9 9 3 2. + <_> + 5 12 9 3 2. + <_> + + <_> + 1 13 12 6 -1. + <_> + 1 15 12 2 3. + <_> + + <_> + 14 15 10 6 -1. + <_> + 14 17 10 2 3. + <_> + + <_> + 0 15 10 6 -1. + <_> + 0 17 10 2 3. + <_> + + <_> + 15 13 6 9 -1. + <_> + 15 16 6 3 3. + <_> + + <_> + 3 13 6 9 -1. + <_> + 3 16 6 3 3. + <_> + + <_> + 9 5 8 8 -1. + <_> + 9 5 4 8 2. + <_> + + <_> + 1 18 12 6 -1. + <_> + 1 18 6 3 2. + <_> + 7 21 6 3 2. + <_> + + <_> + 13 19 10 4 -1. + <_> + 13 21 10 2 2. + <_> + + <_> + 1 19 10 4 -1. + <_> + 1 21 10 2 2. + <_> + + <_> + 6 19 18 3 -1. + <_> + 6 20 18 1 3. + <_> + + <_> + 8 14 4 10 -1. + <_> + 8 19 4 5 2. + <_> + + <_> + 0 0 24 6 -1. + <_> + 0 2 24 2 3. + <_> + + <_> + 0 1 6 9 -1. + <_> + 0 4 6 3 3. + <_> + + <_> + 4 9 20 6 -1. + <_> + 14 9 10 3 2. + <_> + 4 12 10 3 2. + <_> + + <_> + 1 15 19 8 -1. + <_> + 1 19 19 4 2. + <_> + + <_> + 14 0 10 6 -1. + <_> + 14 2 10 2 3. + <_> + + <_> + 1 10 21 14 -1. + <_> + 8 10 7 14 3. + <_> + + <_> + 10 10 8 8 -1. + <_> + 10 10 4 8 2. + <_> + + <_> + 6 8 10 4 -1. + <_> + 11 8 5 4 2. + <_> + + <_> + 10 5 4 9 -1. + <_> + 10 5 2 9 2. + <_> + + <_> + 7 5 6 10 -1. + <_> + 9 5 2 10 3. + <_> + + <_> + 14 4 4 13 -1. + <_> + 14 4 2 13 2. + <_> + + <_> + 6 4 4 13 -1. + <_> + 8 4 2 13 2. + <_> + + <_> + 8 7 9 6 -1. + <_> + 11 7 3 6 3. + <_> + + <_> + 3 6 16 6 -1. + <_> + 3 6 8 3 2. + <_> + 11 9 8 3 2. + <_> + + <_> + 5 4 16 14 -1. + <_> + 13 4 8 7 2. + <_> + 5 11 8 7 2. + <_> + + <_> + 0 0 24 4 -1. + <_> + 0 0 12 2 2. + <_> + 12 2 12 2 2. + <_> + + <_> + 9 1 9 6 -1. + <_> + 12 1 3 6 3. + <_> + + <_> + 4 1 14 4 -1. + <_> + 11 1 7 4 2. + <_> + + <_> + 10 14 7 9 -1. + <_> + 10 17 7 3 3. + <_> + + <_> + 8 3 8 10 -1. + <_> + 8 3 4 5 2. + <_> + 12 8 4 5 2. + <_> + + <_> + 7 3 12 5 -1. + <_> + 11 3 4 5 3. + <_> + + <_> + 8 2 4 13 -1. + <_> + 10 2 2 13 2. + <_> + + <_> + 11 2 3 19 -1. + <_> + 12 2 1 19 3. + <_> + + <_> + 7 7 9 6 -1. + <_> + 10 7 3 6 3. + <_> + + <_> + 4 22 20 2 -1. + <_> + 4 22 10 2 2. + <_> + + <_> + 0 16 24 4 -1. + <_> + 0 16 12 2 2. + <_> + 12 18 12 2 2. + <_> + + <_> + 7 3 12 5 -1. + <_> + 11 3 4 5 3. + <_> + + <_> + 1 10 8 14 -1. + <_> + 1 10 4 7 2. + <_> + 5 17 4 7 2. + <_> + + <_> + 11 16 6 6 -1. + <_> + 11 19 6 3 2. + <_> + + <_> + 6 0 10 24 -1. + <_> + 6 0 5 12 2. + <_> + 11 12 5 12 2. + <_> + + <_> + 7 5 14 14 -1. + <_> + 14 5 7 7 2. + <_> + 7 12 7 7 2. + <_> + + <_> + 7 8 10 8 -1. + <_> + 7 8 5 4 2. + <_> + 12 12 5 4 2. + <_> + + <_> + 9 1 9 6 -1. + <_> + 12 1 3 6 3. + <_> + + <_> + 0 6 24 3 -1. + <_> + 12 6 12 3 2. + <_> + + <_> + 7 3 12 5 -1. + <_> + 11 3 4 5 3. + <_> + + <_> + 1 13 22 4 -1. + <_> + 1 13 11 2 2. + <_> + 12 15 11 2 2. + <_> + + <_> + 9 12 12 6 -1. + <_> + 9 14 12 2 3. + <_> + + <_> + 0 5 9 6 -1. + <_> + 0 7 9 2 3. + <_> + + <_> + 1 5 23 6 -1. + <_> + 1 7 23 2 3. + <_> + + <_> + 1 6 19 12 -1. + <_> + 1 10 19 4 3. + <_> + + <_> + 9 1 6 21 -1. + <_> + 9 8 6 7 3. + <_> + + <_> + 3 19 18 3 -1. + <_> + 9 19 6 3 3. + <_> + + <_> + 9 14 6 9 -1. + <_> + 11 14 2 9 3. + <_> + + <_> + 9 6 4 12 -1. + <_> + 11 6 2 12 2. + <_> + + <_> + 16 0 6 9 -1. + <_> + 18 0 2 9 3. + <_> + + <_> + 2 0 6 9 -1. + <_> + 4 0 2 9 3. + <_> + + <_> + 13 1 4 22 -1. + <_> + 15 1 2 11 2. + <_> + 13 12 2 11 2. + <_> + + <_> + 1 8 8 12 -1. + <_> + 1 14 8 6 2. + <_> + + <_> + 14 7 7 9 -1. + <_> + 14 10 7 3 3. + <_> + + <_> + 3 12 18 4 -1. + <_> + 3 12 9 2 2. + <_> + 12 14 9 2 2. + <_> + + <_> + 13 1 4 22 -1. + <_> + 15 1 2 11 2. + <_> + 13 12 2 11 2. + <_> + + <_> + 7 1 4 22 -1. + <_> + 7 1 2 11 2. + <_> + 9 12 2 11 2. + <_> + + <_> + 4 7 20 4 -1. + <_> + 14 7 10 2 2. + <_> + 4 9 10 2 2. + <_> + + <_> + 9 10 6 7 -1. + <_> + 12 10 3 7 2. + <_> + + <_> + 7 7 10 4 -1. + <_> + 7 7 5 4 2. + <_> + + <_> + 0 3 4 15 -1. + <_> + 0 8 4 5 3. + <_> + + <_> + 15 0 8 12 -1. + <_> + 19 0 4 6 2. + <_> + 15 6 4 6 2. + <_> + + <_> + 1 0 8 12 -1. + <_> + 1 0 4 6 2. + <_> + 5 6 4 6 2. + <_> + + <_> + 14 5 6 16 -1. + <_> + 16 5 2 16 3. + <_> + + <_> + 4 5 6 16 -1. + <_> + 6 5 2 16 3. + <_> + + <_> + 15 0 6 16 -1. + <_> + 17 0 2 16 3. + <_> + + <_> + 3 0 6 16 -1. + <_> + 5 0 2 16 3. + <_> + + <_> + 0 2 24 3 -1. + <_> + 0 3 24 1 3. + <_> + + <_> + 7 1 10 4 -1. + <_> + 7 3 10 2 2. + <_> + + <_> + 1 0 23 8 -1. + <_> + 1 4 23 4 2. + <_> + + <_> + 1 17 19 3 -1. + <_> + 1 18 19 1 3. + <_> + + <_> + 6 18 18 2 -1. + <_> + 6 19 18 1 2. + <_> + + <_> + 1 17 9 6 -1. + <_> + 1 19 9 2 3. + <_> + + <_> + 15 15 6 9 -1. + <_> + 15 18 6 3 3. + <_> + + <_> + 3 15 6 9 -1. + <_> + 3 18 6 3 3. + <_> + + <_> + 4 14 20 6 -1. + <_> + 4 17 20 3 2. + <_> + + <_> + 0 10 6 14 -1. + <_> + 0 10 3 7 2. + <_> + 3 17 3 7 2. + <_> + + <_> + 6 18 18 3 -1. + <_> + 6 19 18 1 3. + <_> + + <_> + 4 12 9 7 -1. + <_> + 7 12 3 7 3. + <_> + + <_> + 6 10 18 5 -1. + <_> + 12 10 6 5 3. + <_> + + <_> + 0 10 18 5 -1. + <_> + 6 10 6 5 3. + <_> + + <_> + 3 2 18 9 -1. + <_> + 9 2 6 9 3. + <_> + + <_> + 4 6 10 10 -1. + <_> + 4 6 5 5 2. + <_> + 9 11 5 5 2. + <_> + + <_> + 20 14 4 9 -1. + <_> + 20 14 2 9 2. + <_> + + <_> + 0 14 4 9 -1. + <_> + 2 14 2 9 2. + <_> + + <_> + 11 1 4 20 -1. + <_> + 13 1 2 10 2. + <_> + 11 11 2 10 2. + <_> + + <_> + 6 21 12 3 -1. + <_> + 12 21 6 3 2. + <_> + + <_> + 11 1 4 20 -1. + <_> + 13 1 2 10 2. + <_> + 11 11 2 10 2. + <_> + + <_> + 1 16 10 8 -1. + <_> + 1 16 5 4 2. + <_> + 6 20 5 4 2. + <_> + + <_> + 11 1 4 20 -1. + <_> + 13 1 2 10 2. + <_> + 11 11 2 10 2. + <_> + + <_> + 1 0 3 19 -1. + <_> + 2 0 1 19 3. + <_> + + <_> + 11 1 4 20 -1. + <_> + 13 1 2 10 2. + <_> + 11 11 2 10 2. + <_> + + <_> + 0 1 6 9 -1. + <_> + 2 1 2 9 3. + <_> + + <_> + 3 7 19 4 -1. + <_> + 3 9 19 2 2. + <_> + + <_> + 7 14 9 6 -1. + <_> + 7 16 9 2 3. + <_> + + <_> + 17 1 7 6 -1. + <_> + 17 4 7 3 2. + <_> + + <_> + 5 0 14 8 -1. + <_> + 5 4 14 4 2. + <_> + + <_> + 16 1 8 6 -1. + <_> + 16 4 8 3 2. + <_> + + <_> + 0 1 8 6 -1. + <_> + 0 4 8 3 2. + <_> + + <_> + 6 0 18 4 -1. + <_> + 15 0 9 2 2. + <_> + 6 2 9 2 2. + <_> + + <_> + 0 14 9 6 -1. + <_> + 0 16 9 2 3. + <_> + + <_> + 3 7 18 8 -1. + <_> + 9 7 6 8 3. + <_> + + <_> + 2 11 6 9 -1. + <_> + 4 11 2 9 3. + <_> + + <_> + 10 5 6 9 -1. + <_> + 12 5 2 9 3. + <_> + + <_> + 10 6 4 18 -1. + <_> + 10 6 2 9 2. + <_> + 12 15 2 9 2. + <_> + + <_> + 11 1 4 20 -1. + <_> + 13 1 2 10 2. + <_> + 11 11 2 10 2. + <_> + + <_> + 9 1 4 20 -1. + <_> + 9 1 2 10 2. + <_> + 11 11 2 10 2. + <_> + + <_> + 5 9 18 6 -1. + <_> + 14 9 9 3 2. + <_> + 5 12 9 3 2. + <_> + + <_> + 6 4 6 9 -1. + <_> + 8 4 2 9 3. + <_> + + <_> + 10 16 8 6 -1. + <_> + 10 16 4 6 2. + <_> + + <_> + 0 0 18 8 -1. + <_> + 0 0 9 4 2. + <_> + 9 4 9 4 2. + <_> + + <_> + 6 5 14 12 -1. + <_> + 13 5 7 6 2. + <_> + 6 11 7 6 2. + <_> + + <_> + 4 3 15 7 -1. + <_> + 9 3 5 7 3. + <_> + + <_> + 14 12 10 6 -1. + <_> + 14 14 10 2 3. + <_> + + <_> + 0 11 4 10 -1. + <_> + 0 16 4 5 2. + <_> + + <_> + 1 10 22 3 -1. + <_> + 1 11 22 1 3. + <_> + + <_> + 8 9 6 10 -1. + <_> + 10 9 2 10 3. + <_> + + <_> + 13 2 6 12 -1. + <_> + 16 2 3 6 2. + <_> + 13 8 3 6 2. + <_> + + <_> + 10 6 4 18 -1. + <_> + 10 6 2 9 2. + <_> + 12 15 2 9 2. + <_> + + <_> + 7 8 10 16 -1. + <_> + 12 8 5 8 2. + <_> + 7 16 5 8 2. + <_> + + <_> + 8 1 8 12 -1. + <_> + 8 1 4 6 2. + <_> + 12 7 4 6 2. + <_> + + <_> + 7 1 12 14 -1. + <_> + 13 1 6 7 2. + <_> + 7 8 6 7 2. + <_> + + <_> + 2 14 12 6 -1. + <_> + 2 16 12 2 3. + <_> + + <_> + 11 16 6 6 -1. + <_> + 11 19 6 3 2. + <_> + + <_> + 7 16 6 6 -1. + <_> + 7 19 6 3 2. + <_> + + <_> + 13 4 4 10 -1. + <_> + 13 4 2 10 2. + <_> + + <_> + 0 19 19 3 -1. + <_> + 0 20 19 1 3. + <_> + + <_> + 12 8 6 8 -1. + <_> + 12 12 6 4 2. + <_> + + <_> + 8 1 8 22 -1. + <_> + 8 12 8 11 2. + <_> + + <_> + 12 8 6 8 -1. + <_> + 12 12 6 4 2. + <_> + + <_> + 6 8 6 8 -1. + <_> + 6 12 6 4 2. + <_> + + <_> + 14 5 6 9 -1. + <_> + 14 8 6 3 3. + <_> + + <_> + 0 6 24 4 -1. + <_> + 0 8 24 2 2. + <_> + + <_> + 14 12 10 6 -1. + <_> + 14 14 10 2 3. + <_> + + <_> + 0 12 10 6 -1. + <_> + 0 14 10 2 3. + <_> + + <_> + 4 6 19 3 -1. + <_> + 4 7 19 1 3. + <_> + + <_> + 1 6 19 3 -1. + <_> + 1 7 19 1 3. + <_> + + <_> + 4 0 16 9 -1. + <_> + 4 3 16 3 3. + <_> + + <_> + 0 1 24 5 -1. + <_> + 8 1 8 5 3. + <_> + + <_> + 3 6 6 15 -1. + <_> + 3 11 6 5 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 0 17 18 3 -1. + <_> + 0 18 18 1 3. + <_> + + <_> + 6 22 18 2 -1. + <_> + 6 23 18 1 2. + <_> + + <_> + 2 12 6 9 -1. + <_> + 2 15 6 3 3. + <_> + + <_> + 18 12 6 9 -1. + <_> + 18 15 6 3 3. + <_> + + <_> + 0 12 6 9 -1. + <_> + 0 15 6 3 3. + <_> + + <_> + 11 14 4 10 -1. + <_> + 11 19 4 5 2. + <_> + + <_> + 9 6 6 16 -1. + <_> + 9 14 6 8 2. + <_> + + <_> + 7 7 10 10 -1. + <_> + 7 12 10 5 2. + <_> + + <_> + 1 3 6 13 -1. + <_> + 3 3 2 13 3. + <_> + + <_> + 18 1 6 13 -1. + <_> + 18 1 3 13 2. + <_> + + <_> + 5 1 6 9 -1. + <_> + 7 1 2 9 3. + <_> + + <_> + 18 2 6 11 -1. + <_> + 18 2 3 11 2. + <_> + + <_> + 0 2 6 11 -1. + <_> + 3 2 3 11 2. + <_> + + <_> + 9 12 15 6 -1. + <_> + 9 14 15 2 3. + <_> + + <_> + 2 2 20 3 -1. + <_> + 2 3 20 1 3. + <_> + + <_> + 10 6 4 9 -1. + <_> + 10 6 2 9 2. + <_> + + <_> + 5 6 12 14 -1. + <_> + 5 6 6 7 2. + <_> + 11 13 6 7 2. + <_> + + <_> + 9 0 6 9 -1. + <_> + 11 0 2 9 3. + <_> + + <_> + 7 0 9 6 -1. + <_> + 10 0 3 6 3. + <_> + + <_> + 10 6 6 9 -1. + <_> + 12 6 2 9 3. + <_> + + <_> + 4 1 12 20 -1. + <_> + 4 1 6 10 2. + <_> + 10 11 6 10 2. + <_> + + <_> + 6 7 18 3 -1. + <_> + 6 7 9 3 2. + <_> + + <_> + 0 7 18 3 -1. + <_> + 9 7 9 3 2. + <_> + + <_> + 3 20 18 3 -1. + <_> + 9 20 6 3 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 6 2 12 15 -1. + <_> + 10 2 4 15 3. + <_> + + <_> + 2 3 18 3 -1. + <_> + 2 4 18 1 3. + <_> + + <_> + 19 4 4 18 -1. + <_> + 21 4 2 9 2. + <_> + 19 13 2 9 2. + <_> + + <_> + 0 1 19 3 -1. + <_> + 0 2 19 1 3. + <_> + + <_> + 5 0 15 4 -1. + <_> + 5 2 15 2 2. + <_> + + <_> + 5 2 14 5 -1. + <_> + 12 2 7 5 2. + <_> + + <_> + 1 2 22 14 -1. + <_> + 1 2 11 14 2. + <_> + + <_> + 8 15 6 9 -1. + <_> + 10 15 2 9 3. + <_> + + <_> + 6 17 18 3 -1. + <_> + 6 18 18 1 3. + <_> + + <_> + 9 6 3 18 -1. + <_> + 9 12 3 6 3. + <_> + + <_> + 2 0 20 3 -1. + <_> + 2 1 20 1 3. + <_> + + <_> + 5 4 5 12 -1. + <_> + 5 8 5 4 3. + <_> + + <_> + 8 6 12 5 -1. + <_> + 12 6 4 5 3. + <_> + + <_> + 9 12 6 12 -1. + <_> + 9 12 3 6 2. + <_> + 12 18 3 6 2. + <_> + + <_> + 14 14 8 10 -1. + <_> + 18 14 4 5 2. + <_> + 14 19 4 5 2. + <_> + + <_> + 2 14 8 10 -1. + <_> + 2 14 4 5 2. + <_> + 6 19 4 5 2. + <_> + + <_> + 10 18 12 6 -1. + <_> + 16 18 6 3 2. + <_> + 10 21 6 3 2. + <_> + + <_> + 1 3 6 9 -1. + <_> + 1 6 6 3 3. + <_> + + <_> + 11 3 3 20 -1. + <_> + 12 3 1 20 3. + <_> + + <_> + 4 6 14 6 -1. + <_> + 4 6 7 3 2. + <_> + 11 9 7 3 2. + <_> + + <_> + 6 5 12 13 -1. + <_> + 10 5 4 13 3. + <_> + + <_> + 5 4 4 15 -1. + <_> + 5 9 4 5 3. + <_> + + <_> + 9 16 15 4 -1. + <_> + 14 16 5 4 3. + <_> + + <_> + 7 8 6 14 -1. + <_> + 7 8 3 7 2. + <_> + 10 15 3 7 2. + <_> + + <_> + 7 6 10 6 -1. + <_> + 7 8 10 2 3. + <_> + + <_> + 2 5 18 3 -1. + <_> + 2 6 18 1 3. + <_> + + <_> + 5 1 15 8 -1. + <_> + 5 5 15 4 2. + <_> + + <_> + 7 1 8 18 -1. + <_> + 7 10 8 9 2. + <_> + + <_> + 0 10 24 3 -1. + <_> + 0 11 24 1 3. + <_> + + <_> + 0 2 6 13 -1. + <_> + 2 2 2 13 3. + <_> + + <_> + 16 0 8 10 -1. + <_> + 20 0 4 5 2. + <_> + 16 5 4 5 2. + <_> + + <_> + 5 1 10 9 -1. + <_> + 5 4 10 3 3. + <_> + + <_> + 5 6 18 3 -1. + <_> + 5 7 18 1 3. + <_> + + <_> + 0 1 24 3 -1. + <_> + 0 2 24 1 3. + <_> + + <_> + 11 4 6 11 -1. + <_> + 13 4 2 11 3. + <_> + + <_> + 0 0 8 10 -1. + <_> + 0 0 4 5 2. + <_> + 4 5 4 5 2. + <_> + + <_> + 4 16 18 3 -1. + <_> + 4 17 18 1 3. + <_> + + <_> + 2 16 18 3 -1. + <_> + 2 17 18 1 3. + <_> + + <_> + 3 0 18 10 -1. + <_> + 12 0 9 5 2. + <_> + 3 5 9 5 2. + <_> + + <_> + 2 3 20 21 -1. + <_> + 12 3 10 21 2. + <_> + + <_> + 6 7 14 3 -1. + <_> + 6 7 7 3 2. + <_> + + <_> + 0 9 12 6 -1. + <_> + 0 9 6 3 2. + <_> + 6 12 6 3 2. + <_> + + <_> + 3 14 21 4 -1. + <_> + 10 14 7 4 3. + <_> + + <_> + 0 14 21 4 -1. + <_> + 7 14 7 4 3. + <_> + + <_> + 5 21 18 3 -1. + <_> + 11 21 6 3 3. + <_> + + <_> + 1 21 18 3 -1. + <_> + 7 21 6 3 3. + <_> + + <_> + 19 4 4 18 -1. + <_> + 21 4 2 9 2. + <_> + 19 13 2 9 2. + <_> + + <_> + 3 7 18 3 -1. + <_> + 3 8 18 1 3. + <_> + + <_> + 19 4 4 18 -1. + <_> + 21 4 2 9 2. + <_> + 19 13 2 9 2. + <_> + + <_> + 7 15 10 6 -1. + <_> + 7 17 10 2 3. + <_> + + <_> + 9 13 11 9 -1. + <_> + 9 16 11 3 3. + <_> + + <_> + 0 6 4 10 -1. + <_> + 0 11 4 5 2. + <_> + + <_> + 15 16 9 6 -1. + <_> + 15 18 9 2 3. + <_> + + <_> + 1 5 4 18 -1. + <_> + 1 5 2 9 2. + <_> + 3 14 2 9 2. + <_> + + <_> + 9 8 8 10 -1. + <_> + 13 8 4 5 2. + <_> + 9 13 4 5 2. + <_> + + <_> + 7 8 8 10 -1. + <_> + 7 8 4 5 2. + <_> + 11 13 4 5 2. + <_> + + <_> + 9 8 12 5 -1. + <_> + 13 8 4 5 3. + <_> + + <_> + 7 8 9 7 -1. + <_> + 10 8 3 7 3. + <_> + + <_> + 9 8 12 5 -1. + <_> + 13 8 4 5 3. + <_> + + <_> + 7 6 9 7 -1. + <_> + 10 6 3 7 3. + <_> + + <_> + 9 8 12 5 -1. + <_> + 13 8 4 5 3. + <_> + + <_> + 10 5 4 18 -1. + <_> + 10 11 4 6 3. + <_> + + <_> + 5 5 14 12 -1. + <_> + 5 11 14 6 2. + <_> + + <_> + 0 1 11 4 -1. + <_> + 0 3 11 2 2. + <_> + + <_> + 9 10 6 10 -1. + <_> + 11 10 2 10 3. + <_> + + <_> + 2 17 11 6 -1. + <_> + 2 19 11 2 3. + <_> + + <_> + 15 16 9 6 -1. + <_> + 15 18 9 2 3. + <_> + + <_> + 1 10 18 2 -1. + <_> + 1 11 18 1 2. + <_> + + <_> + 6 4 12 13 -1. + <_> + 10 4 4 13 3. + <_> + + <_> + 0 18 18 3 -1. + <_> + 0 19 18 1 3. + <_> + + <_> + 6 18 18 3 -1. + <_> + 6 19 18 1 3. + <_> + + <_> + 0 16 9 6 -1. + <_> + 0 18 9 2 3. + <_> + + <_> + 13 15 9 6 -1. + <_> + 13 17 9 2 3. + <_> + + <_> + 2 15 9 6 -1. + <_> + 2 17 9 2 3. + <_> + + <_> + 13 1 6 16 -1. + <_> + 13 1 3 16 2. + <_> + + <_> + 5 1 6 16 -1. + <_> + 8 1 3 16 2. + <_> + + <_> + 11 5 6 10 -1. + <_> + 13 5 2 10 3. + <_> + + <_> + 7 5 6 10 -1. + <_> + 9 5 2 10 3. + <_> + + <_> + 10 0 6 24 -1. + <_> + 12 0 2 24 3. + <_> + + <_> + 3 4 4 20 -1. + <_> + 3 4 2 10 2. + <_> + 5 14 2 10 2. + <_> + + <_> + 14 0 6 9 -1. + <_> + 16 0 2 9 3. + <_> + + <_> + 4 0 6 9 -1. + <_> + 6 0 2 9 3. + <_> + + <_> + 4 5 18 5 -1. + <_> + 10 5 6 5 3. + <_> + + <_> + 5 6 6 9 -1. + <_> + 7 6 2 9 3. + <_> + + <_> + 7 2 15 8 -1. + <_> + 12 2 5 8 3. + <_> + + <_> + 2 2 15 8 -1. + <_> + 7 2 5 8 3. + <_> + + <_> + 10 0 4 9 -1. + <_> + 10 0 2 9 2. + <_> + + <_> + 3 4 6 12 -1. + <_> + 3 4 3 6 2. + <_> + 6 10 3 6 2. + <_> + + <_> + 16 0 8 18 -1. + <_> + 16 0 4 18 2. + <_> + + <_> + 0 0 8 18 -1. + <_> + 4 0 4 18 2. + <_> + + <_> + 0 7 24 6 -1. + <_> + 0 9 24 2 3. + <_> + + <_> + 4 7 14 3 -1. + <_> + 11 7 7 3 2. + <_> + + <_> + 10 8 8 15 -1. + <_> + 10 8 4 15 2. + <_> + + <_> + 7 0 10 14 -1. + <_> + 12 0 5 14 2. + <_> + + <_> + 13 10 8 10 -1. + <_> + 17 10 4 5 2. + <_> + 13 15 4 5 2. + <_> + + <_> + 3 0 4 9 -1. + <_> + 5 0 2 9 2. + <_> + + <_> + 16 1 6 8 -1. + <_> + 16 1 3 8 2. + <_> + + <_> + 2 1 6 8 -1. + <_> + 5 1 3 8 2. + <_> + + <_> + 3 6 18 12 -1. + <_> + 3 10 18 4 3. + <_> + + <_> + 4 12 16 4 -1. + <_> + 4 14 16 2 2. + <_> + + <_> + 4 9 16 15 -1. + <_> + 4 14 16 5 3. + <_> + + <_> + 3 10 8 10 -1. + <_> + 3 10 4 5 2. + <_> + 7 15 4 5 2. + <_> + + <_> + 8 18 16 6 -1. + <_> + 16 18 8 3 2. + <_> + 8 21 8 3 2. + <_> + + <_> + 2 16 12 5 -1. + <_> + 6 16 4 5 3. + <_> + + <_> + 14 14 9 4 -1. + <_> + 14 16 9 2 2. + <_> + + <_> + 7 14 9 6 -1. + <_> + 7 16 9 2 3. + <_> + + <_> + 4 10 16 12 -1. + <_> + 4 14 16 4 3. + <_> + + <_> + 0 13 19 6 -1. + <_> + 0 15 19 2 3. + <_> + + <_> + 10 13 9 6 -1. + <_> + 10 15 9 2 3. + <_> + + <_> + 5 0 3 23 -1. + <_> + 6 0 1 23 3. + <_> + + <_> + 0 8 24 6 -1. + <_> + 0 10 24 2 3. + <_> + + <_> + 0 5 5 12 -1. + <_> + 0 9 5 4 3. + <_> + + <_> + 3 0 19 18 -1. + <_> + 3 9 19 9 2. + <_> + + <_> + 9 11 6 12 -1. + <_> + 9 11 3 6 2. + <_> + 12 17 3 6 2. + <_> + + <_> + 0 5 24 8 -1. + <_> + 12 5 12 4 2. + <_> + 0 9 12 4 2. + <_> + + <_> + 6 18 9 4 -1. + <_> + 6 20 9 2 2. + <_> + + <_> + 8 8 10 6 -1. + <_> + 8 10 10 2 3. + <_> + + <_> + 2 7 20 3 -1. + <_> + 2 8 20 1 3. + <_> + + <_> + 12 0 7 20 -1. + <_> + 12 10 7 10 2. + <_> + + <_> + 5 0 7 20 -1. + <_> + 5 10 7 10 2. + <_> + + <_> + 14 2 2 18 -1. + <_> + 14 11 2 9 2. + <_> + + <_> + 5 8 10 12 -1. + <_> + 10 8 5 12 2. + <_> + + <_> + 6 9 12 8 -1. + <_> + 12 9 6 4 2. + <_> + 6 13 6 4 2. + <_> + + <_> + 7 7 3 14 -1. + <_> + 7 14 3 7 2. + <_> + + <_> + 11 2 12 16 -1. + <_> + 17 2 6 8 2. + <_> + 11 10 6 8 2. + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 13 14 9 4 -1. + <_> + 13 16 9 2 2. + <_> + + <_> + 0 12 22 4 -1. + <_> + 0 12 11 2 2. + <_> + 11 14 11 2 2. + <_> + + <_> + 1 12 22 6 -1. + <_> + 12 12 11 3 2. + <_> + 1 15 11 3 2. + <_> + + <_> + 6 6 9 6 -1. + <_> + 9 6 3 6 3. + <_> + + <_> + 10 0 4 9 -1. + <_> + 10 0 2 9 2. + <_> + + <_> + 3 8 18 7 -1. + <_> + 9 8 6 7 3. + <_> + + <_> + 0 6 24 6 -1. + <_> + 0 8 24 2 3. + <_> + + <_> + 0 11 24 10 -1. + <_> + 8 11 8 10 3. + <_> + + <_> + 3 3 18 21 -1. + <_> + 9 3 6 21 3. + <_> + + <_> + 7 12 4 10 -1. + <_> + 9 12 2 10 2. + <_> + + <_> + 10 16 10 8 -1. + <_> + 15 16 5 4 2. + <_> + 10 20 5 4 2. + <_> + + <_> + 8 6 6 9 -1. + <_> + 10 6 2 9 3. + <_> + + <_> + 12 10 6 12 -1. + <_> + 15 10 3 6 2. + <_> + 12 16 3 6 2. + <_> + + <_> + 6 10 6 12 -1. + <_> + 6 10 3 6 2. + <_> + 9 16 3 6 2. + <_> + + <_> + 16 12 6 12 -1. + <_> + 19 12 3 6 2. + <_> + 16 18 3 6 2. + <_> + + <_> + 2 12 6 12 -1. + <_> + 2 12 3 6 2. + <_> + 5 18 3 6 2. + <_> + + <_> + 10 15 6 9 -1. + <_> + 12 15 2 9 3. + <_> + + <_> + 8 15 6 9 -1. + <_> + 10 15 2 9 3. + <_> + + <_> + 14 20 10 4 -1. + <_> + 14 20 5 4 2. + <_> + + <_> + 0 20 10 4 -1. + <_> + 5 20 5 4 2. + <_> + + <_> + 11 17 9 6 -1. + <_> + 11 19 9 2 3. + <_> + + <_> + 3 2 14 4 -1. + <_> + 3 4 14 2 2. + <_> + + <_> + 10 1 10 4 -1. + <_> + 10 3 10 2 2. + <_> + + <_> + 0 15 10 4 -1. + <_> + 5 15 5 4 2. + <_> + + <_> + 19 2 3 19 -1. + <_> + 20 2 1 19 3. + <_> + + <_> + 4 12 9 8 -1. + <_> + 7 12 3 8 3. + <_> + + <_> + 4 7 5 12 -1. + <_> + 4 11 5 4 3. + <_> + + <_> + 0 1 24 3 -1. + <_> + 8 1 8 3 3. + <_> + + <_> + 6 8 12 4 -1. + <_> + 6 10 12 2 2. + <_> + + <_> + 19 3 4 10 -1. + <_> + 19 3 2 10 2. + <_> + + <_> + 0 6 9 6 -1. + <_> + 3 6 3 6 3. + <_> + + <_> + 18 0 6 22 -1. + <_> + 20 0 2 22 3. + <_> + + <_> + 0 0 6 22 -1. + <_> + 2 0 2 22 3. + <_> + + <_> + 5 15 19 3 -1. + <_> + 5 16 19 1 3. + <_> + + <_> + 10 7 4 15 -1. + <_> + 10 12 4 5 3. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 0 21 18 3 -1. + <_> + 0 22 18 1 3. + <_> + + <_> + 7 3 10 15 -1. + <_> + 7 8 10 5 3. + <_> + + <_> + 1 7 18 3 -1. + <_> + 1 8 18 1 3. + <_> + + <_> + 8 2 9 6 -1. + <_> + 11 2 3 6 3. + <_> + + <_> + 0 10 24 14 -1. + <_> + 0 17 24 7 2. + <_> + + <_> + 13 9 8 10 -1. + <_> + 17 9 4 5 2. + <_> + 13 14 4 5 2. + <_> + + <_> + 10 5 4 9 -1. + <_> + 12 5 2 9 2. + <_> + + <_> + 13 9 8 10 -1. + <_> + 17 9 4 5 2. + <_> + 13 14 4 5 2. + <_> + + <_> + 7 11 10 10 -1. + <_> + 7 11 5 5 2. + <_> + 12 16 5 5 2. + <_> + + <_> + 4 13 18 4 -1. + <_> + 13 13 9 2 2. + <_> + 4 15 9 2 2. + <_> + + <_> + 0 0 19 2 -1. + <_> + 0 1 19 1 2. + <_> + + <_> + 0 18 24 6 -1. + <_> + 8 18 8 6 3. + <_> + + <_> + 6 4 8 16 -1. + <_> + 6 12 8 8 2. + <_> + + <_> + 7 8 10 4 -1. + <_> + 7 10 10 2 2. + <_> + + <_> + 0 3 6 9 -1. + <_> + 0 6 6 3 3. + <_> + + <_> + 13 15 7 9 -1. + <_> + 13 18 7 3 3. + <_> + + <_> + 3 18 12 6 -1. + <_> + 3 18 6 3 2. + <_> + 9 21 6 3 2. + <_> + + <_> + 12 14 6 9 -1. + <_> + 12 17 6 3 3. + <_> + + <_> + 2 15 15 8 -1. + <_> + 2 19 15 4 2. + <_> + + <_> + 9 6 6 16 -1. + <_> + 9 14 6 8 2. + <_> + + <_> + 6 6 7 12 -1. + <_> + 6 10 7 4 3. + <_> + + <_> + 14 6 6 9 -1. + <_> + 14 9 6 3 3. + <_> + + <_> + 5 14 6 9 -1. + <_> + 5 17 6 3 3. + <_> + + <_> + 10 8 6 9 -1. + <_> + 12 8 2 9 3. + <_> + + <_> + 6 6 4 18 -1. + <_> + 6 6 2 9 2. + <_> + 8 15 2 9 2. + <_> + + <_> + 14 9 6 12 -1. + <_> + 17 9 3 6 2. + <_> + 14 15 3 6 2. + <_> + + <_> + 4 9 6 12 -1. + <_> + 4 9 3 6 2. + <_> + 7 15 3 6 2. + <_> + + <_> + 14 15 9 6 -1. + <_> + 14 17 9 2 3. + <_> + + <_> + 0 20 18 4 -1. + <_> + 0 20 9 2 2. + <_> + 9 22 9 2 2. + <_> + + <_> + 13 18 9 6 -1. + <_> + 13 20 9 2 3. + <_> + + <_> + 2 18 9 6 -1. + <_> + 2 20 9 2 3. + <_> + + <_> + 6 16 18 3 -1. + <_> + 6 17 18 1 3. + <_> + + <_> + 0 16 18 3 -1. + <_> + 0 17 18 1 3. + <_> + + <_> + 19 2 4 22 -1. + <_> + 21 2 2 11 2. + <_> + 19 13 2 11 2. + <_> + + <_> + 1 2 4 22 -1. + <_> + 1 2 2 11 2. + <_> + 3 13 2 11 2. + <_> + + <_> + 15 0 2 24 -1. + <_> + 15 0 1 24 2. + <_> + + <_> + 3 20 16 4 -1. + <_> + 11 20 8 4 2. + <_> + + <_> + 11 6 4 18 -1. + <_> + 13 6 2 9 2. + <_> + 11 15 2 9 2. + <_> + + <_> + 7 9 10 14 -1. + <_> + 7 9 5 7 2. + <_> + 12 16 5 7 2. + <_> + + <_> + 14 6 6 9 -1. + <_> + 14 9 6 3 3. + <_> + + <_> + 3 6 7 9 -1. + <_> + 3 9 7 3 3. + <_> + + <_> + 20 4 4 20 -1. + <_> + 22 4 2 10 2. + <_> + 20 14 2 10 2. + <_> + + <_> + 7 6 6 9 -1. + <_> + 7 9 6 3 3. + <_> + + <_> + 7 0 10 14 -1. + <_> + 12 0 5 7 2. + <_> + 7 7 5 7 2. + <_> + + <_> + 2 1 18 6 -1. + <_> + 11 1 9 6 2. + <_> + + <_> + 15 0 2 24 -1. + <_> + 15 0 1 24 2. + <_> + + <_> + 7 0 2 24 -1. + <_> + 8 0 1 24 2. + <_> + + <_> + 13 12 6 7 -1. + <_> + 13 12 3 7 2. + <_> + + <_> + 5 12 6 7 -1. + <_> + 8 12 3 7 2. + <_> + + <_> + 3 5 18 19 -1. + <_> + 9 5 6 19 3. + <_> + + <_> + 5 6 9 6 -1. + <_> + 8 6 3 6 3. + <_> + + <_> + 9 5 9 6 -1. + <_> + 12 5 3 6 3. + <_> + + <_> + 3 16 10 8 -1. + <_> + 3 16 5 4 2. + <_> + 8 20 5 4 2. + <_> + + <_> + 19 8 5 15 -1. + <_> + 19 13 5 5 3. + <_> + + <_> + 0 8 5 15 -1. + <_> + 0 13 5 5 3. + <_> + + <_> + 20 4 4 20 -1. + <_> + 22 4 2 10 2. + <_> + 20 14 2 10 2. + <_> + + <_> + 0 4 4 20 -1. + <_> + 0 4 2 10 2. + <_> + 2 14 2 10 2. + <_> + + <_> + 7 7 10 4 -1. + <_> + 7 7 5 4 2. + <_> + + <_> + 4 19 14 4 -1. + <_> + 11 19 7 4 2. + <_> + + <_> + 10 11 12 3 -1. + <_> + 10 11 6 3 2. + <_> + + <_> + 0 1 24 3 -1. + <_> + 0 2 24 1 3. + <_> + + <_> + 7 2 14 20 -1. + <_> + 14 2 7 10 2. + <_> + 7 12 7 10 2. + <_> + + <_> + 0 13 6 9 -1. + <_> + 2 13 2 9 3. + <_> + + <_> + 13 0 4 19 -1. + <_> + 13 0 2 19 2. + <_> + + <_> + 1 11 14 3 -1. + <_> + 8 11 7 3 2. + <_> + + <_> + 7 1 16 20 -1. + <_> + 15 1 8 10 2. + <_> + 7 11 8 10 2. + <_> + + <_> + 0 10 21 9 -1. + <_> + 7 10 7 9 3. + <_> + + <_> + 6 19 15 5 -1. + <_> + 11 19 5 5 3. + <_> + + <_> + 8 10 6 6 -1. + <_> + 11 10 3 6 2. + <_> + + <_> + 7 1 16 20 -1. + <_> + 15 1 8 10 2. + <_> + 7 11 8 10 2. + <_> + + <_> + 1 1 16 20 -1. + <_> + 1 1 8 10 2. + <_> + 9 11 8 10 2. + <_> + + <_> + 16 4 3 12 -1. + <_> + 16 10 3 6 2. + <_> + + <_> + 5 4 3 12 -1. + <_> + 5 10 3 6 2. + <_> + + <_> + 7 6 10 8 -1. + <_> + 12 6 5 4 2. + <_> + 7 10 5 4 2. + <_> + + <_> + 4 9 6 6 -1. + <_> + 4 12 6 3 2. + <_> + + <_> + 6 5 12 4 -1. + <_> + 6 7 12 2 2. + <_> + + <_> + 9 2 5 15 -1. + <_> + 9 7 5 5 3. + <_> + + <_> + 15 0 9 6 -1. + <_> + 15 2 9 2 3. + <_> + + <_> + 6 0 11 10 -1. + <_> + 6 5 11 5 2. + <_> + + <_> + 12 7 4 12 -1. + <_> + 12 13 4 6 2. + <_> + + <_> + 7 2 9 4 -1. + <_> + 7 4 9 2 2. + <_> + + <_> + 6 0 13 6 -1. + <_> + 6 2 13 2 3. + <_> + + <_> + 10 6 4 18 -1. + <_> + 10 6 2 9 2. + <_> + 12 15 2 9 2. + <_> + + <_> + 10 8 6 9 -1. + <_> + 12 8 2 9 3. + <_> + + <_> + 3 18 10 6 -1. + <_> + 3 20 10 2 3. + <_> + + <_> + 4 14 20 3 -1. + <_> + 4 15 20 1 3. + <_> + + <_> + 2 15 9 6 -1. + <_> + 2 17 9 2 3. + <_> + + <_> + 13 0 4 19 -1. + <_> + 13 0 2 19 2. + <_> + + <_> + 7 0 4 19 -1. + <_> + 9 0 2 19 2. + <_> + + <_> + 1 4 22 2 -1. + <_> + 1 5 22 1 2. + <_> + + <_> + 0 0 9 6 -1. + <_> + 0 2 9 2 3. + <_> + + <_> + 0 0 24 18 -1. + <_> + 0 9 24 9 2. + <_> + + <_> + 3 2 16 8 -1. + <_> + 3 6 16 4 2. + <_> + + <_> + 3 6 18 6 -1. + <_> + 3 8 18 2 3. + <_> + + <_> + 3 1 6 10 -1. + <_> + 5 1 2 10 3. + <_> + + <_> + 13 0 9 6 -1. + <_> + 16 0 3 6 3. + <_> + + <_> + 2 0 9 6 -1. + <_> + 5 0 3 6 3. + <_> + + <_> + 10 2 4 15 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 6 0 7 10 -1. + <_> + 6 5 7 5 2. + <_> + + <_> + 2 2 20 4 -1. + <_> + 12 2 10 2 2. + <_> + 2 4 10 2 2. + <_> + + <_> + 2 11 19 3 -1. + <_> + 2 12 19 1 3. + <_> + + <_> + 10 8 6 9 -1. + <_> + 12 8 2 9 3. + <_> + + <_> + 8 8 6 9 -1. + <_> + 10 8 2 9 3. + <_> + + <_> + 13 8 4 9 -1. + <_> + 13 8 2 9 2. + <_> + + <_> + 3 11 9 9 -1. + <_> + 6 11 3 9 3. + <_> + + <_> + 3 9 18 5 -1. + <_> + 9 9 6 5 3. + <_> + + <_> + 2 4 2 20 -1. + <_> + 2 14 2 10 2. + <_> + + <_> + 14 17 8 6 -1. + <_> + 14 20 8 3 2. + <_> + + <_> + 3 21 18 2 -1. + <_> + 3 22 18 1 2. + <_> + + <_> + 5 4 15 6 -1. + <_> + 10 4 5 6 3. + <_> + + <_> + 2 15 12 6 -1. + <_> + 2 17 12 2 3. + <_> + + <_> + 17 8 6 9 -1. + <_> + 17 11 6 3 3. + <_> + + <_> + 2 12 20 4 -1. + <_> + 2 12 10 2 2. + <_> + 12 14 10 2 2. + <_> + + <_> + 0 17 24 6 -1. + <_> + 0 19 24 2 3. + <_> + + <_> + 7 16 9 4 -1. + <_> + 7 18 9 2 2. + <_> + + <_> + 15 1 4 22 -1. + <_> + 17 1 2 11 2. + <_> + 15 12 2 11 2. + <_> + + <_> + 5 1 4 22 -1. + <_> + 5 1 2 11 2. + <_> + 7 12 2 11 2. + <_> + + <_> + 11 13 8 9 -1. + <_> + 11 16 8 3 3. + <_> + + <_> + 6 1 6 9 -1. + <_> + 8 1 2 9 3. + <_> + + <_> + 11 4 3 18 -1. + <_> + 11 10 3 6 3. + <_> + + <_> + 5 8 12 6 -1. + <_> + 5 8 6 3 2. + <_> + 11 11 6 3 2. + <_> + + <_> + 15 7 5 8 -1. + <_> + 15 11 5 4 2. + <_> + + <_> + 4 7 5 8 -1. + <_> + 4 11 5 4 2. + <_> + + <_> + 12 6 6 12 -1. + <_> + 15 6 3 6 2. + <_> + 12 12 3 6 2. + <_> + + <_> + 6 6 6 12 -1. + <_> + 6 6 3 6 2. + <_> + 9 12 3 6 2. + <_> + + <_> + 5 9 14 8 -1. + <_> + 12 9 7 4 2. + <_> + 5 13 7 4 2. + <_> + + <_> + 9 1 3 14 -1. + <_> + 9 8 3 7 2. + <_> + + <_> + 12 6 6 12 -1. + <_> + 12 10 6 4 3. + <_> + + <_> + 4 5 4 18 -1. + <_> + 4 5 2 9 2. + <_> + 6 14 2 9 2. + <_> + + <_> + 4 6 16 18 -1. + <_> + 4 12 16 6 3. + <_> + + <_> + 5 4 7 20 -1. + <_> + 5 14 7 10 2. + <_> + + <_> + 14 8 8 12 -1. + <_> + 14 14 8 6 2. + <_> + + <_> + 9 10 6 14 -1. + <_> + 9 10 3 7 2. + <_> + 12 17 3 7 2. + <_> + + <_> + 9 5 9 6 -1. + <_> + 12 5 3 6 3. + <_> + + <_> + 9 4 3 18 -1. + <_> + 10 4 1 18 3. + <_> + + <_> + 1 4 22 14 -1. + <_> + 12 4 11 7 2. + <_> + 1 11 11 7 2. + <_> + + <_> + 2 7 18 2 -1. + <_> + 2 8 18 1 2. + <_> + + <_> + 12 6 6 12 -1. + <_> + 12 10 6 4 3. + <_> + + <_> + 6 5 9 7 -1. + <_> + 9 5 3 7 3. + <_> + + <_> + 12 7 4 12 -1. + <_> + 12 13 4 6 2. + <_> + + <_> + 8 7 4 12 -1. + <_> + 8 13 4 6 2. + <_> + + <_> + 7 2 10 22 -1. + <_> + 7 13 10 11 2. + <_> + + <_> + 0 1 3 20 -1. + <_> + 1 1 1 20 3. + <_> + + <_> + 4 13 18 4 -1. + <_> + 13 13 9 2 2. + <_> + 4 15 9 2 2. + <_> + + <_> + 2 13 18 4 -1. + <_> + 2 13 9 2 2. + <_> + 11 15 9 2 2. + <_> + + <_> + 15 15 9 6 -1. + <_> + 15 17 9 2 3. + <_> + + <_> + 0 15 9 6 -1. + <_> + 0 17 9 2 3. + <_> + + <_> + 6 0 18 24 -1. + <_> + 15 0 9 12 2. + <_> + 6 12 9 12 2. + <_> + + <_> + 6 6 6 12 -1. + <_> + 6 10 6 4 3. + <_> + + <_> + 8 7 10 4 -1. + <_> + 8 9 10 2 2. + <_> + + <_> + 1 9 18 6 -1. + <_> + 1 9 9 3 2. + <_> + 10 12 9 3 2. + <_> + + <_> + 6 6 18 3 -1. + <_> + 6 7 18 1 3. + <_> + + <_> + 7 7 9 8 -1. + <_> + 10 7 3 8 3. + <_> + + <_> + 10 12 6 12 -1. + <_> + 12 12 2 12 3. + <_> + + <_> + 3 14 18 3 -1. + <_> + 3 15 18 1 3. + <_> + + <_> + 15 17 9 7 -1. + <_> + 18 17 3 7 3. + <_> + + <_> + 1 12 10 6 -1. + <_> + 1 14 10 2 3. + <_> + + <_> + 15 17 9 7 -1. + <_> + 18 17 3 7 3. + <_> + + <_> + 10 3 3 19 -1. + <_> + 11 3 1 19 3. + <_> + + <_> + 15 17 9 7 -1. + <_> + 18 17 3 7 3. + <_> + + <_> + 6 1 11 9 -1. + <_> + 6 4 11 3 3. + <_> + + <_> + 15 17 9 7 -1. + <_> + 18 17 3 7 3. + <_> + + <_> + 6 5 11 6 -1. + <_> + 6 8 11 3 2. + <_> + + <_> + 16 7 8 5 -1. + <_> + 16 7 4 5 2. + <_> + + <_> + 2 4 20 19 -1. + <_> + 12 4 10 19 2. + <_> + + <_> + 2 1 21 6 -1. + <_> + 9 1 7 6 3. + <_> + + <_> + 6 5 12 14 -1. + <_> + 6 5 6 7 2. + <_> + 12 12 6 7 2. + <_> + + <_> + 9 0 6 9 -1. + <_> + 11 0 2 9 3. + <_> + + <_> + 2 11 8 5 -1. + <_> + 6 11 4 5 2. + <_> + + <_> + 16 7 8 5 -1. + <_> + 16 7 4 5 2. + <_> + + <_> + 0 7 8 5 -1. + <_> + 4 7 4 5 2. + <_> + + <_> + 15 17 9 7 -1. + <_> + 18 17 3 7 3. + <_> + + <_> + 8 6 8 10 -1. + <_> + 8 6 4 5 2. + <_> + 12 11 4 5 2. + <_> + + <_> + 15 15 9 9 -1. + <_> + 18 15 3 9 3. + <_> + + <_> + 0 15 9 9 -1. + <_> + 3 15 3 9 3. + <_> + + <_> + 12 10 9 7 -1. + <_> + 15 10 3 7 3. + <_> + + <_> + 3 10 9 7 -1. + <_> + 6 10 3 7 3. + <_> + + <_> + 13 15 10 8 -1. + <_> + 18 15 5 4 2. + <_> + 13 19 5 4 2. + <_> + + <_> + 0 1 6 12 -1. + <_> + 0 1 3 6 2. + <_> + 3 7 3 6 2. + <_> + + <_> + 10 0 6 12 -1. + <_> + 13 0 3 6 2. + <_> + 10 6 3 6 2. + <_> + + <_> + 7 0 10 12 -1. + <_> + 7 0 5 6 2. + <_> + 12 6 5 6 2. + <_> + + <_> + 4 1 16 8 -1. + <_> + 4 1 8 8 2. + <_> + + <_> + 0 21 19 3 -1. + <_> + 0 22 19 1 3. + <_> + + <_> + 6 9 18 4 -1. + <_> + 15 9 9 2 2. + <_> + 6 11 9 2 2. + <_> + + <_> + 3 4 9 6 -1. + <_> + 3 6 9 2 3. + <_> + + <_> + 9 1 6 15 -1. + <_> + 9 6 6 5 3. + <_> + + <_> + 5 9 6 6 -1. + <_> + 8 9 3 6 2. + <_> + + <_> + 5 1 14 9 -1. + <_> + 5 4 14 3 3. + <_> + + <_> + 3 0 8 20 -1. + <_> + 3 0 4 10 2. + <_> + 7 10 4 10 2. + <_> + + <_> + 5 0 7 9 -1. + <_> + 5 3 7 3 3. + <_> + + <_> + 6 6 12 5 -1. + <_> + 10 6 4 5 3. + <_> + + <_> + 0 1 8 14 -1. + <_> + 4 1 4 14 2. + <_> + + <_> + 2 12 22 4 -1. + <_> + 2 14 22 2 2. + <_> + + <_> + 8 17 6 6 -1. + <_> + 8 20 6 3 2. + <_> + + <_> + 18 1 6 7 -1. + <_> + 18 1 3 7 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 4 6 17 18 -1. + <_> + 4 12 17 6 3. + <_> + + <_> + 6 0 12 6 -1. + <_> + 6 0 6 3 2. + <_> + 12 3 6 3 2. + <_> + + <_> + 4 7 18 4 -1. + <_> + 13 7 9 2 2. + <_> + 4 9 9 2 2. + <_> + + <_> + 4 12 10 6 -1. + <_> + 4 14 10 2 3. + <_> + + <_> + 7 9 10 12 -1. + <_> + 12 9 5 6 2. + <_> + 7 15 5 6 2. + <_> + + <_> + 0 1 24 3 -1. + <_> + 8 1 8 3 3. + <_> + + <_> + 13 11 6 6 -1. + <_> + 13 11 3 6 2. + <_> + + <_> + 5 11 6 6 -1. + <_> + 8 11 3 6 2. + <_> + + <_> + 3 10 19 3 -1. + <_> + 3 11 19 1 3. + <_> + + <_> + 0 2 6 9 -1. + <_> + 0 5 6 3 3. + <_> + + <_> + 14 16 10 6 -1. + <_> + 14 18 10 2 3. + <_> + + <_> + 0 16 10 6 -1. + <_> + 0 18 10 2 3. + <_> + + <_> + 14 13 9 6 -1. + <_> + 14 15 9 2 3. + <_> + + <_> + 0 16 18 3 -1. + <_> + 0 17 18 1 3. + <_> + + <_> + 6 16 18 3 -1. + <_> + 6 17 18 1 3. + <_> + + <_> + 0 18 9 6 -1. + <_> + 0 20 9 2 3. + <_> + + <_> + 14 13 9 6 -1. + <_> + 14 15 9 2 3. + <_> + + <_> + 6 2 6 9 -1. + <_> + 8 2 2 9 3. + <_> + + <_> + 15 8 4 12 -1. + <_> + 15 8 2 12 2. + <_> + + <_> + 8 13 8 8 -1. + <_> + 8 17 8 4 2. + <_> + + <_> + 4 20 18 3 -1. + <_> + 10 20 6 3 3. + <_> + + <_> + 5 8 4 12 -1. + <_> + 7 8 2 12 2. + <_> + + <_> + 7 7 12 3 -1. + <_> + 7 7 6 3 2. + <_> + + <_> + 10 6 4 9 -1. + <_> + 12 6 2 9 2. + <_> + + <_> + 5 20 18 3 -1. + <_> + 11 20 6 3 3. + <_> + + <_> + 1 20 18 3 -1. + <_> + 7 20 6 3 3. + <_> + + <_> + 18 1 6 20 -1. + <_> + 21 1 3 10 2. + <_> + 18 11 3 10 2. + <_> + + <_> + 0 1 6 20 -1. + <_> + 0 1 3 10 2. + <_> + 3 11 3 10 2. + <_> + + <_> + 13 3 4 18 -1. + <_> + 15 3 2 9 2. + <_> + 13 12 2 9 2. + <_> + + <_> + 0 2 6 12 -1. + <_> + 0 6 6 4 3. + <_> + + <_> + 12 9 12 6 -1. + <_> + 18 9 6 3 2. + <_> + 12 12 6 3 2. + <_> + + <_> + 7 3 4 18 -1. + <_> + 7 3 2 9 2. + <_> + 9 12 2 9 2. + <_> + + <_> + 14 0 6 9 -1. + <_> + 16 0 2 9 3. + <_> + + <_> + 0 9 12 6 -1. + <_> + 0 9 6 3 2. + <_> + 6 12 6 3 2. + <_> + + <_> + 14 4 8 20 -1. + <_> + 18 4 4 10 2. + <_> + 14 14 4 10 2. + <_> + + <_> + 2 4 8 20 -1. + <_> + 2 4 4 10 2. + <_> + 6 14 4 10 2. + <_> + + <_> + 14 13 9 6 -1. + <_> + 14 15 9 2 3. + <_> + + <_> + 1 13 9 6 -1. + <_> + 1 15 9 2 3. + <_> + + <_> + 3 15 18 3 -1. + <_> + 9 15 6 3 3. + <_> + + <_> + 5 13 9 6 -1. + <_> + 5 15 9 2 3. + <_> + + <_> + 5 0 18 3 -1. + <_> + 5 1 18 1 3. + <_> + + <_> + 8 2 6 7 -1. + <_> + 11 2 3 7 2. + <_> + + <_> + 9 1 9 6 -1. + <_> + 12 1 3 6 3. + <_> + + <_> + 6 1 9 6 -1. + <_> + 9 1 3 6 3. + <_> + + <_> + 5 6 14 6 -1. + <_> + 12 6 7 3 2. + <_> + 5 9 7 3 2. + <_> + + <_> + 8 2 6 13 -1. + <_> + 10 2 2 13 3. + <_> + + <_> + 6 11 12 6 -1. + <_> + 12 11 6 3 2. + <_> + 6 14 6 3 2. + <_> + + <_> + 3 1 18 15 -1. + <_> + 9 1 6 15 3. + <_> + + <_> + 13 0 6 7 -1. + <_> + 13 0 3 7 2. + <_> + + <_> + 3 3 16 6 -1. + <_> + 3 6 16 3 2. + <_> + + <_> + 12 1 3 12 -1. + <_> + 12 7 3 6 2. + <_> + + <_> + 7 7 6 9 -1. + <_> + 9 7 2 9 3. + <_> + + <_> + 13 0 4 24 -1. + <_> + 13 0 2 24 2. + <_> + + <_> + 7 0 4 24 -1. + <_> + 9 0 2 24 2. + <_> + + <_> + 11 9 5 12 -1. + <_> + 11 13 5 4 3. + <_> + + <_> + 7 15 9 6 -1. + <_> + 7 17 9 2 3. + <_> + + <_> + 5 7 18 6 -1. + <_> + 5 9 18 2 3. + <_> + + <_> + 8 9 5 12 -1. + <_> + 8 13 5 4 3. + <_> + + <_> + 4 17 17 6 -1. + <_> + 4 19 17 2 3. + <_> + + <_> + 0 3 18 14 -1. + <_> + 0 3 9 7 2. + <_> + 9 10 9 7 2. + <_> + + <_> + 0 1 24 2 -1. + <_> + 0 2 24 1 2. + <_> + + <_> + 0 15 18 3 -1. + <_> + 0 16 18 1 3. + <_> + + <_> + 9 0 6 9 -1. + <_> + 11 0 2 9 3. + <_> + + <_> + 3 3 14 12 -1. + <_> + 3 9 14 6 2. + <_> + + <_> + 12 1 3 12 -1. + <_> + 12 7 3 6 2. + <_> + + <_> + 8 0 6 9 -1. + <_> + 10 0 2 9 3. + <_> + + <_> + 10 6 6 10 -1. + <_> + 12 6 2 10 3. + <_> + + <_> + 5 0 6 9 -1. + <_> + 7 0 2 9 3. + <_> + + <_> + 2 0 21 7 -1. + <_> + 9 0 7 7 3. + <_> + + <_> + 6 11 12 5 -1. + <_> + 10 11 4 5 3. + <_> + + <_> + 8 7 9 8 -1. + <_> + 11 7 3 8 3. + <_> + + <_> + 9 6 6 18 -1. + <_> + 9 6 3 9 2. + <_> + 12 15 3 9 2. + <_> + + <_> + 15 14 8 10 -1. + <_> + 19 14 4 5 2. + <_> + 15 19 4 5 2. + <_> + + <_> + 1 14 8 10 -1. + <_> + 1 14 4 5 2. + <_> + 5 19 4 5 2. + <_> + + <_> + 11 0 8 10 -1. + <_> + 15 0 4 5 2. + <_> + 11 5 4 5 2. + <_> + + <_> + 5 0 8 10 -1. + <_> + 5 0 4 5 2. + <_> + 9 5 4 5 2. + <_> + + <_> + 6 1 12 5 -1. + <_> + 6 1 6 5 2. + <_> + + <_> + 1 12 18 2 -1. + <_> + 10 12 9 2 2. + <_> + + <_> + 2 8 20 6 -1. + <_> + 12 8 10 3 2. + <_> + 2 11 10 3 2. + <_> + + <_> + 7 6 9 7 -1. + <_> + 10 6 3 7 3. + <_> + + <_> + 10 5 8 16 -1. + <_> + 14 5 4 8 2. + <_> + 10 13 4 8 2. + <_> + + <_> + 3 9 16 8 -1. + <_> + 3 9 8 4 2. + <_> + 11 13 8 4 2. + <_> + + <_> + 7 8 10 4 -1. + <_> + 7 8 5 4 2. + <_> + + <_> + 7 12 10 8 -1. + <_> + 7 12 5 4 2. + <_> + 12 16 5 4 2. + <_> + + <_> + 9 19 15 4 -1. + <_> + 14 19 5 4 3. + <_> + + <_> + 1 0 18 9 -1. + <_> + 7 0 6 9 3. + <_> + + <_> + 13 4 10 8 -1. + <_> + 18 4 5 4 2. + <_> + 13 8 5 4 2. + <_> + + <_> + 3 16 18 4 -1. + <_> + 9 16 6 4 3. + <_> + + <_> + 8 7 10 12 -1. + <_> + 13 7 5 6 2. + <_> + 8 13 5 6 2. + <_> + + <_> + 6 7 10 12 -1. + <_> + 6 7 5 6 2. + <_> + 11 13 5 6 2. + <_> + + <_> + 4 6 18 7 -1. + <_> + 10 6 6 7 3. + <_> + + <_> + 0 17 18 3 -1. + <_> + 0 18 18 1 3. + <_> + + <_> + 3 17 18 3 -1. + <_> + 3 18 18 1 3. + <_> + + <_> + 2 4 6 10 -1. + <_> + 4 4 2 10 3. + <_> + + <_> + 16 0 8 24 -1. + <_> + 16 0 4 24 2. + <_> + + <_> + 4 0 8 15 -1. + <_> + 8 0 4 15 2. + <_> + + <_> + 16 0 8 24 -1. + <_> + 16 0 4 24 2. + <_> + + <_> + 1 4 18 9 -1. + <_> + 7 4 6 9 3. + <_> + + <_> + 15 12 9 6 -1. + <_> + 15 14 9 2 3. + <_> + + <_> + 3 9 18 6 -1. + <_> + 3 9 9 3 2. + <_> + 12 12 9 3 2. + <_> + + <_> + 18 5 6 9 -1. + <_> + 18 8 6 3 3. + <_> + + <_> + 0 5 6 9 -1. + <_> + 0 8 6 3 3. + <_> + + <_> + 4 7 18 4 -1. + <_> + 13 7 9 2 2. + <_> + 4 9 9 2 2. + <_> + + <_> + 2 1 12 20 -1. + <_> + 2 1 6 10 2. + <_> + 8 11 6 10 2. + <_> + + <_> + 17 0 6 23 -1. + <_> + 17 0 3 23 2. + <_> + + <_> + 1 6 2 18 -1. + <_> + 1 15 2 9 2. + <_> + + <_> + 8 8 10 6 -1. + <_> + 8 10 10 2 3. + <_> + + <_> + 0 6 20 6 -1. + <_> + 0 6 10 3 2. + <_> + 10 9 10 3 2. + <_> + + <_> + 11 12 12 5 -1. + <_> + 15 12 4 5 3. + <_> + + <_> + 0 4 3 19 -1. + <_> + 1 4 1 19 3. + <_> + + <_> + 19 1 3 18 -1. + <_> + 20 1 1 18 3. + <_> + + <_> + 2 1 3 18 -1. + <_> + 3 1 1 18 3. + <_> + + <_> + 3 10 18 3 -1. + <_> + 9 10 6 3 3. + <_> + + <_> + 4 4 10 9 -1. + <_> + 9 4 5 9 2. + <_> + + <_> + 7 13 14 7 -1. + <_> + 7 13 7 7 2. + <_> + + <_> + 3 13 14 7 -1. + <_> + 10 13 7 7 2. + <_> + + <_> + 8 15 9 6 -1. + <_> + 11 15 3 6 3. + <_> + + <_> + 4 14 8 10 -1. + <_> + 4 14 4 5 2. + <_> + 8 19 4 5 2. + <_> + + <_> + 10 14 4 10 -1. + <_> + 10 19 4 5 2. + <_> + + <_> + 3 8 5 16 -1. + <_> + 3 16 5 8 2. + <_> + + <_> + 15 10 9 6 -1. + <_> + 15 12 9 2 3. + <_> + + <_> + 0 10 9 6 -1. + <_> + 0 12 9 2 3. + <_> + + <_> + 6 7 12 9 -1. + <_> + 6 10 12 3 3. + <_> + + <_> + 9 10 5 8 -1. + <_> + 9 14 5 4 2. + <_> + + <_> + 12 1 3 12 -1. + <_> + 12 7 3 6 2. + <_> + + <_> + 8 15 6 9 -1. + <_> + 10 15 2 9 3. + <_> + + <_> + 16 6 7 6 -1. + <_> + 16 9 7 3 2. + <_> + + <_> + 8 1 4 22 -1. + <_> + 10 1 2 22 2. + <_> + + <_> + 6 6 14 3 -1. + <_> + 6 6 7 3 2. + <_> + + <_> + 0 18 19 3 -1. + <_> + 0 19 19 1 3. + <_> + + <_> + 17 0 6 24 -1. + <_> + 17 0 3 24 2. + <_> + + <_> + 0 13 15 6 -1. + <_> + 5 13 5 6 3. + <_> + + <_> + 9 6 10 14 -1. + <_> + 14 6 5 7 2. + <_> + 9 13 5 7 2. + <_> + + <_> + 1 6 8 10 -1. + <_> + 1 6 4 5 2. + <_> + 5 11 4 5 2. + <_> + + <_> + 7 6 12 5 -1. + <_> + 7 6 6 5 2. + <_> + + <_> + 7 7 9 6 -1. + <_> + 10 7 3 6 3. + <_> + + <_> + 7 8 14 14 -1. + <_> + 14 8 7 7 2. + <_> + 7 15 7 7 2. + <_> + + <_> + 3 8 14 14 -1. + <_> + 3 8 7 7 2. + <_> + 10 15 7 7 2. + <_> + + <_> + 9 8 13 4 -1. + <_> + 9 10 13 2 2. + <_> + + <_> + 3 2 6 12 -1. + <_> + 3 2 3 6 2. + <_> + 6 8 3 6 2. + <_> + + <_> + 6 10 17 6 -1. + <_> + 6 13 17 3 2. + <_> + + <_> + 1 10 17 6 -1. + <_> + 1 13 17 3 2. + <_> + + <_> + 16 7 8 9 -1. + <_> + 16 10 8 3 3. + <_> + + <_> + 0 7 8 9 -1. + <_> + 0 10 8 3 3. + <_> + + <_> + 0 9 24 10 -1. + <_> + 12 9 12 5 2. + <_> + 0 14 12 5 2. + <_> + + <_> + 3 2 15 8 -1. + <_> + 8 2 5 8 3. + <_> + + <_> + 4 2 18 8 -1. + <_> + 10 2 6 8 3. + <_> + + <_> + 0 1 18 4 -1. + <_> + 0 1 9 2 2. + <_> + 9 3 9 2 2. + <_> + + <_> + 20 2 3 18 -1. + <_> + 21 2 1 18 3. + <_> + + <_> + 1 3 3 19 -1. + <_> + 2 3 1 19 3. + <_> + + <_> + 18 8 6 16 -1. + <_> + 20 8 2 16 3. + <_> + + <_> + 0 8 6 16 -1. + <_> + 2 8 2 16 3. + <_> + + <_> + 8 18 11 6 -1. + <_> + 8 20 11 2 3. + <_> + + <_> + 4 6 12 5 -1. + <_> + 8 6 4 5 3. + <_> + + <_> + 7 6 12 5 -1. + <_> + 11 6 4 5 3. + <_> + + <_> + 6 3 9 6 -1. + <_> + 9 3 3 6 3. + <_> + + <_> + 7 6 12 5 -1. + <_> + 7 6 6 5 2. + <_> + + <_> + 9 8 6 7 -1. + <_> + 12 8 3 7 2. + <_> + + <_> + 8 2 9 6 -1. + <_> + 11 2 3 6 3. + <_> + + <_> + 8 14 6 9 -1. + <_> + 8 17 6 3 3. + <_> + + <_> + 8 2 9 6 -1. + <_> + 11 2 3 6 3. + <_> + + <_> + 4 3 16 20 -1. + <_> + 4 3 8 10 2. + <_> + 12 13 8 10 2. + <_> + + <_> + 7 6 10 12 -1. + <_> + 12 6 5 6 2. + <_> + 7 12 5 6 2. + <_> + + <_> + 0 2 7 12 -1. + <_> + 0 6 7 4 3. + <_> + + <_> + 12 17 11 6 -1. + <_> + 12 19 11 2 3. + <_> + + <_> + 4 7 12 8 -1. + <_> + 4 7 6 4 2. + <_> + 10 11 6 4 2. + <_> + + <_> + 8 11 8 10 -1. + <_> + 12 11 4 5 2. + <_> + 8 16 4 5 2. + <_> + + <_> + 9 1 4 9 -1. + <_> + 11 1 2 9 2. + <_> + + <_> + 14 0 3 22 -1. + <_> + 15 0 1 22 3. + <_> + + <_> + 7 0 3 22 -1. + <_> + 8 0 1 22 3. + <_> + + <_> + 4 7 18 4 -1. + <_> + 13 7 9 2 2. + <_> + 4 9 9 2 2. + <_> + + <_> + 10 2 4 15 -1. + <_> + 10 7 4 5 3. + <_> + + <_> + 12 1 3 12 -1. + <_> + 12 7 3 6 2. + <_> + + <_> + 0 0 18 13 -1. + <_> + 9 0 9 13 2. + <_> + + <_> + 16 0 3 24 -1. + <_> + 17 0 1 24 3. + <_> + + <_> + 5 0 3 24 -1. + <_> + 6 0 1 24 3. + <_> + + <_> + 10 15 5 8 -1. + <_> + 10 19 5 4 2. + <_> + + <_> + 2 18 18 2 -1. + <_> + 2 19 18 1 2. + <_> + + <_> + 2 8 20 3 -1. + <_> + 2 9 20 1 3. + <_> + + <_> + 7 6 9 6 -1. + <_> + 7 8 9 2 3. + <_> + + <_> + 3 2 19 10 -1. + <_> + 3 7 19 5 2. + <_> + + <_> + 2 7 19 3 -1. + <_> + 2 8 19 1 3. + <_> + + <_> + 15 6 9 4 -1. + <_> + 15 8 9 2 2. + <_> + + <_> + 2 2 18 8 -1. + <_> + 8 2 6 8 3. + <_> + + <_> + 10 9 14 4 -1. + <_> + 10 9 7 4 2. + <_> + + <_> + 4 4 6 16 -1. + <_> + 7 4 3 16 2. + <_> + + <_> + 15 8 9 16 -1. + <_> + 18 8 3 16 3. + <_> + + <_> + 0 8 9 16 -1. + <_> + 3 8 3 16 3. + <_> + + <_> + 18 0 6 14 -1. + <_> + 20 0 2 14 3. + <_> + + <_> + 0 0 6 14 -1. + <_> + 2 0 2 14 3. + <_> + + <_> + 15 0 6 22 -1. + <_> + 17 0 2 22 3. + <_> + + <_> + 3 0 6 22 -1. + <_> + 5 0 2 22 3. + <_> + + <_> + 12 2 12 20 -1. + <_> + 16 2 4 20 3. + <_> + + <_> + 0 2 12 20 -1. + <_> + 4 2 4 20 3. + <_> + + <_> + 11 6 4 9 -1. + <_> + 11 6 2 9 2. + <_> + + <_> + 9 0 6 16 -1. + <_> + 12 0 3 16 2. + <_> + + <_> + 12 1 3 12 -1. + <_> + 12 7 3 6 2. + <_> + + <_> + 3 4 18 6 -1. + <_> + 3 4 9 3 2. + <_> + 12 7 9 3 2. + <_> + + <_> + 5 5 16 8 -1. + <_> + 13 5 8 4 2. + <_> + 5 9 8 4 2. + <_> + + <_> + 0 13 10 6 -1. + <_> + 0 15 10 2 3. + <_> + + <_> + 8 14 9 6 -1. + <_> + 8 16 9 2 3. + <_> + + <_> + 6 2 9 6 -1. + <_> + 9 2 3 6 3. + <_> + + <_> + 14 1 10 8 -1. + <_> + 19 1 5 4 2. + <_> + 14 5 5 4 2. + <_> + + <_> + 9 1 3 12 -1. + <_> + 9 7 3 6 2. + <_> + + <_> + 6 4 12 9 -1. + <_> + 6 7 12 3 3. + <_> + + <_> + 6 5 12 6 -1. + <_> + 10 5 4 6 3. + <_> + + <_> + 1 1 8 5 -1. + <_> + 5 1 4 5 2. + <_> + + <_> + 12 12 6 8 -1. + <_> + 12 16 6 4 2. + <_> + + <_> + 3 12 12 6 -1. + <_> + 3 14 12 2 3. + <_> + + <_> + 9 18 12 6 -1. + <_> + 15 18 6 3 2. + <_> + 9 21 6 3 2. + <_> + + <_> + 4 13 6 6 -1. + <_> + 4 16 6 3 2. + <_> + + <_> + 11 3 7 18 -1. + <_> + 11 12 7 9 2. + <_> + + <_> + 3 9 18 3 -1. + <_> + 9 9 6 3 3. + <_> + + <_> + 5 3 19 2 -1. + <_> + 5 4 19 1 2. + <_> + + <_> + 4 2 12 6 -1. + <_> + 4 2 6 3 2. + <_> + 10 5 6 3 2. + <_> + + <_> + 9 6 6 9 -1. + <_> + 11 6 2 9 3. + <_> + + <_> + 8 6 6 9 -1. + <_> + 10 6 2 9 3. + <_> + + <_> + 16 9 5 15 -1. + <_> + 16 14 5 5 3. + <_> + + <_> + 3 9 5 15 -1. + <_> + 3 14 5 5 3. + <_> + + <_> + 6 6 14 6 -1. + <_> + 13 6 7 3 2. + <_> + 6 9 7 3 2. + <_> + + <_> + 8 6 3 14 -1. + <_> + 8 13 3 7 2. + <_> + + <_> + 0 16 24 5 -1. + <_> + 8 16 8 5 3. + <_> + + <_> + 0 20 20 3 -1. + <_> + 10 20 10 3 2. + <_> + + <_> + 5 10 18 2 -1. + <_> + 5 11 18 1 2. + <_> + + <_> + 0 6 6 10 -1. + <_> + 2 6 2 10 3. + <_> + + <_> + 2 1 20 3 -1. + <_> + 2 2 20 1 3. + <_> + + <_> + 9 13 6 11 -1. + <_> + 11 13 2 11 3. + <_> + + <_> + 9 15 6 8 -1. + <_> + 9 19 6 4 2. + <_> + + <_> + 9 12 6 9 -1. + <_> + 9 15 6 3 3. + <_> + + <_> + 5 11 18 2 -1. + <_> + 5 12 18 1 2. + <_> + + <_> + 2 6 15 6 -1. + <_> + 2 8 15 2 3. + <_> + + <_> + 6 0 18 3 -1. + <_> + 6 1 18 1 3. + <_> + + <_> + 5 0 3 18 -1. + <_> + 6 0 1 18 3. + <_> + + <_> + 18 3 6 10 -1. + <_> + 20 3 2 10 3. + <_> + + <_> + 0 3 6 10 -1. + <_> + 2 3 2 10 3. + <_> + + <_> + 10 5 8 9 -1. + <_> + 10 5 4 9 2. + <_> + + <_> + 6 5 8 9 -1. + <_> + 10 5 4 9 2. + <_> + + <_> + 3 2 20 3 -1. + <_> + 3 3 20 1 3. + <_> + + <_> + 5 2 13 4 -1. + <_> + 5 4 13 2 2. + <_> + + <_> + 17 0 7 14 -1. + <_> + 17 7 7 7 2. + <_> + + <_> + 0 0 7 14 -1. + <_> + 0 7 7 7 2. + <_> + + <_> + 9 11 10 6 -1. + <_> + 9 11 5 6 2. + <_> + + <_> + 5 11 10 6 -1. + <_> + 10 11 5 6 2. + <_> + + <_> + 11 6 3 18 -1. + <_> + 11 12 3 6 3. + <_> + + <_> + 0 16 18 3 -1. + <_> + 0 17 18 1 3. + <_> + + <_> + 6 16 18 3 -1. + <_> + 6 17 18 1 3. + <_> + + <_> + 4 6 9 10 -1. + <_> + 4 11 9 5 2. + <_> + + <_> + 9 7 15 4 -1. + <_> + 9 9 15 2 2. + <_> + + <_> + 5 6 12 6 -1. + <_> + 5 6 6 3 2. + <_> + 11 9 6 3 2. + <_> + + <_> + 6 1 12 9 -1. + <_> + 6 4 12 3 3. + <_> + + <_> + 7 9 6 12 -1. + <_> + 7 9 3 6 2. + <_> + 10 15 3 6 2. + <_> + + <_> + 11 5 13 6 -1. + <_> + 11 7 13 2 3. + <_> + + <_> + 1 11 22 13 -1. + <_> + 12 11 11 13 2. + <_> + + <_> + 18 8 6 6 -1. + <_> + 18 11 6 3 2. + <_> + + <_> + 0 8 6 6 -1. + <_> + 0 11 6 3 2. + <_> + + <_> + 0 6 24 3 -1. + <_> + 0 7 24 1 3. + <_> + + <_> + 0 5 10 6 -1. + <_> + 0 7 10 2 3. + <_> + + <_> + 6 7 18 3 -1. + <_> + 6 8 18 1 3. + <_> + + <_> + 0 0 10 6 -1. + <_> + 0 2 10 2 3. + <_> + + <_> + 19 0 3 19 -1. + <_> + 20 0 1 19 3. + <_> + + <_> + 4 6 12 16 -1. + <_> + 4 6 6 8 2. + <_> + 10 14 6 8 2. + <_> + + <_> + 19 6 4 18 -1. + <_> + 21 6 2 9 2. + <_> + 19 15 2 9 2. + <_> + + <_> + 1 6 4 18 -1. + <_> + 1 6 2 9 2. + <_> + 3 15 2 9 2. + <_> + + <_> + 3 21 18 3 -1. + <_> + 3 22 18 1 3. + <_> + + <_> + 0 19 9 4 -1. + <_> + 0 21 9 2 2. + <_> + + <_> + 12 18 12 6 -1. + <_> + 18 18 6 3 2. + <_> + 12 21 6 3 2. + <_> + + <_> + 7 18 9 4 -1. + <_> + 7 20 9 2 2. + <_> + + <_> + 12 16 10 8 -1. + <_> + 17 16 5 4 2. + <_> + 12 20 5 4 2. + <_> + + <_> + 2 16 10 8 -1. + <_> + 2 16 5 4 2. + <_> + 7 20 5 4 2. + <_> + + <_> + 14 0 10 12 -1. + <_> + 19 0 5 6 2. + <_> + 14 6 5 6 2. + <_> + + <_> + 0 0 10 12 -1. + <_> + 0 0 5 6 2. + <_> + 5 6 5 6 2. + <_> + + <_> + 15 14 9 6 -1. + <_> + 15 16 9 2 3. + <_> + + <_> + 0 14 9 6 -1. + <_> + 0 16 9 2 3. + <_> + + <_> + 14 14 10 6 -1. + <_> + 14 16 10 2 3. + <_> + + <_> + 0 14 10 6 -1. + <_> + 0 16 10 2 3. + <_> + + <_> + 5 18 18 2 -1. + <_> + 5 19 18 1 2. + <_> + + <_> + 0 18 18 3 -1. + <_> + 0 19 18 1 3. + <_> + + <_> + 3 5 18 12 -1. + <_> + 12 5 9 6 2. + <_> + 3 11 9 6 2. + <_> + + <_> + 5 3 7 9 -1. + <_> + 5 6 7 3 3. + <_> + + <_> + 4 0 19 15 -1. + <_> + 4 5 19 5 3. + <_> + + <_> + 3 0 16 4 -1. + <_> + 3 2 16 2 2. + <_> + + <_> + 4 12 16 12 -1. + <_> + 4 12 8 12 2. + <_> + + <_> + 4 3 12 15 -1. + <_> + 10 3 6 15 2. + <_> + + <_> + 16 4 2 19 -1. + <_> + 16 4 1 19 2. + <_> + + <_> + 6 4 2 19 -1. + <_> + 7 4 1 19 2. + <_> + + <_> + 13 14 8 10 -1. + <_> + 17 14 4 5 2. + <_> + 13 19 4 5 2. + <_> + + <_> + 3 14 8 10 -1. + <_> + 3 14 4 5 2. + <_> + 7 19 4 5 2. + <_> + + <_> + 12 6 3 18 -1. + <_> + 12 12 3 6 3. + <_> + + <_> + 5 11 12 6 -1. + <_> + 5 11 6 3 2. + <_> + 11 14 6 3 2. + <_> + + <_> + 10 5 8 10 -1. + <_> + 14 5 4 5 2. + <_> + 10 10 4 5 2. + <_> + + <_> + 6 4 12 10 -1. + <_> + 6 4 6 5 2. + <_> + 12 9 6 5 2. + <_> + + <_> + 6 8 18 10 -1. + <_> + 15 8 9 5 2. + <_> + 6 13 9 5 2. + <_> + + <_> + 0 8 18 10 -1. + <_> + 0 8 9 5 2. + <_> + 9 13 9 5 2. + <_> + + <_> + 12 6 3 18 -1. + <_> + 12 12 3 6 3. + <_> + + <_> + 0 14 18 3 -1. + <_> + 0 15 18 1 3. + <_> + + <_> + 12 6 3 18 -1. + <_> + 12 12 3 6 3. + <_> + + <_> + 9 6 3 18 -1. + <_> + 9 12 3 6 3. + <_> + + <_> + 6 14 18 3 -1. + <_> + 6 15 18 1 3. + <_> + + <_> + 0 5 18 3 -1. + <_> + 0 6 18 1 3. + <_> + + <_> + 2 5 22 3 -1. + <_> + 2 6 22 1 3. + <_> + + <_> + 0 0 21 10 -1. + <_> + 7 0 7 10 3. + <_> + + <_> + 6 3 18 17 -1. + <_> + 12 3 6 17 3. + <_> + + <_> + 0 3 18 17 -1. + <_> + 6 3 6 17 3. + <_> + + <_> + 0 12 24 11 -1. + <_> + 8 12 8 11 3. + <_> + + <_> + 4 10 16 6 -1. + <_> + 4 13 16 3 2. + <_> + + <_> + 12 8 6 8 -1. + <_> + 12 12 6 4 2. + <_> + + <_> + 6 14 8 7 -1. + <_> + 10 14 4 7 2. + <_> + + <_> + 15 10 6 14 -1. + <_> + 18 10 3 7 2. + <_> + 15 17 3 7 2. + <_> + + <_> + 3 10 6 14 -1. + <_> + 3 10 3 7 2. + <_> + 6 17 3 7 2. + <_> + + <_> + 6 12 18 2 -1. + <_> + 6 13 18 1 2. + <_> + + <_> + 5 8 10 6 -1. + <_> + 5 10 10 2 3. + <_> + + <_> + 12 11 9 4 -1. + <_> + 12 13 9 2 2. + <_> + + <_> + 0 11 9 6 -1. + <_> + 0 13 9 2 3. + <_> + + <_> + 11 2 3 18 -1. + <_> + 12 2 1 18 3. + <_> + + <_> + 10 2 3 18 -1. + <_> + 11 2 1 18 3. + <_> + + <_> + 9 12 6 10 -1. + <_> + 11 12 2 10 3. + <_> + + <_> + 1 10 6 9 -1. + <_> + 1 13 6 3 3. + <_> + + <_> + 6 9 16 6 -1. + <_> + 14 9 8 3 2. + <_> + 6 12 8 3 2. + <_> + + <_> + 1 8 9 6 -1. + <_> + 1 10 9 2 3. + <_> + + <_> + 7 7 16 6 -1. + <_> + 7 9 16 2 3. + <_> + + <_> + 0 0 18 3 -1. + <_> + 0 1 18 1 3. + <_> + + <_> + 10 0 6 9 -1. + <_> + 12 0 2 9 3. + <_> + + <_> + 9 5 6 6 -1. + <_> + 12 5 3 6 2. + <_> + + <_> + 10 6 4 18 -1. + <_> + 12 6 2 9 2. + <_> + 10 15 2 9 2. + <_> + + <_> + 8 0 6 9 -1. + <_> + 10 0 2 9 3. + <_> + + <_> + 9 1 6 9 -1. + <_> + 9 4 6 3 3. + <_> + + <_> + 1 0 18 9 -1. + <_> + 1 3 18 3 3. + <_> + + <_> + 0 3 24 3 -1. + <_> + 0 4 24 1 3. + <_> + + <_> + 6 14 9 4 -1. + <_> + 6 16 9 2 2. + <_> + + <_> + 8 9 8 10 -1. + <_> + 12 9 4 5 2. + <_> + 8 14 4 5 2. + <_> + + <_> + 5 2 13 9 -1. + <_> + 5 5 13 3 3. + <_> + + <_> + 4 4 16 9 -1. + <_> + 4 7 16 3 3. + <_> + + <_> + 4 4 14 9 -1. + <_> + 4 7 14 3 3. + <_> + + <_> + 8 5 9 6 -1. + <_> + 8 7 9 2 3. + <_> + + <_> + 1 7 16 6 -1. + <_> + 1 9 16 2 3. + <_> + + <_> + 10 5 13 9 -1. + <_> + 10 8 13 3 3. + <_> + + <_> + 1 5 13 9 -1. + <_> + 1 8 13 3 3. + <_> + + <_> + 0 4 24 6 -1. + <_> + 12 4 12 3 2. + <_> + 0 7 12 3 2. + <_> + + <_> + 1 14 10 9 -1. + <_> + 1 17 10 3 3. + <_> + + <_> + 5 17 18 3 -1. + <_> + 5 18 18 1 3. + <_> + + <_> + 0 16 18 3 -1. + <_> + 0 17 18 1 3. + <_> + + <_> + 9 17 9 6 -1. + <_> + 9 19 9 2 3. + <_> + + <_> + 1 20 22 4 -1. + <_> + 1 20 11 2 2. + <_> + 12 22 11 2 2. + <_> + + <_> + 8 14 8 6 -1. + <_> + 8 17 8 3 2. + <_> + + <_> + 8 6 8 15 -1. + <_> + 8 11 8 5 3. + <_> + + <_> + 5 4 18 3 -1. + <_> + 5 5 18 1 3. + <_> + + <_> + 9 3 5 10 -1. + <_> + 9 8 5 5 2. + <_> + + <_> + 6 8 12 3 -1. + <_> + 6 8 6 3 2. + <_> + + <_> + 2 6 18 6 -1. + <_> + 2 6 9 3 2. + <_> + 11 9 9 3 2. + <_> + + <_> + 10 6 4 18 -1. + <_> + 12 6 2 9 2. + <_> + 10 15 2 9 2. + <_> + + <_> + 7 5 6 6 -1. + <_> + 10 5 3 6 2. + <_> + + <_> + 14 5 2 18 -1. + <_> + 14 14 2 9 2. + <_> + + <_> + 8 5 2 18 -1. + <_> + 8 14 2 9 2. + <_> + + <_> + 9 2 10 6 -1. + <_> + 9 2 5 6 2. + <_> + + <_> + 3 1 18 12 -1. + <_> + 12 1 9 12 2. + <_> + + <_> + 5 2 17 22 -1. + <_> + 5 13 17 11 2. + <_> + + <_> + 4 0 12 6 -1. + <_> + 4 2 12 2 3. + <_> + + <_> + 6 9 16 6 -1. + <_> + 14 9 8 3 2. + <_> + 6 12 8 3 2. + <_> + + <_> + 9 0 5 18 -1. + <_> + 9 9 5 9 2. + <_> + + <_> + 12 0 6 9 -1. + <_> + 14 0 2 9 3. + <_> + + <_> + 6 0 6 9 -1. + <_> + 8 0 2 9 3. + <_> + + <_> + 9 1 6 12 -1. + <_> + 11 1 2 12 3. + <_> + + <_> + 5 9 13 4 -1. + <_> + 5 11 13 2 2. + <_> + + <_> + 5 8 19 3 -1. + <_> + 5 9 19 1 3. + <_> + + <_> + 9 9 6 8 -1. + <_> + 9 13 6 4 2. + <_> + + <_> + 11 9 4 15 -1. + <_> + 11 14 4 5 3. + <_> + + <_> + 2 0 6 14 -1. + <_> + 2 0 3 7 2. + <_> + 5 7 3 7 2. + <_> + + <_> + 15 1 6 14 -1. + <_> + 18 1 3 7 2. + <_> + 15 8 3 7 2. + <_> + + <_> + 3 1 6 14 -1. + <_> + 3 1 3 7 2. + <_> + 6 8 3 7 2. + <_> + + <_> + 3 20 18 4 -1. + <_> + 12 20 9 2 2. + <_> + 3 22 9 2 2. + <_> + + <_> + 5 0 4 20 -1. + <_> + 5 0 2 10 2. + <_> + 7 10 2 10 2. + <_> + + <_> + 16 8 8 12 -1. + <_> + 20 8 4 6 2. + <_> + 16 14 4 6 2. + <_> + + <_> + 0 8 8 12 -1. + <_> + 0 8 4 6 2. + <_> + 4 14 4 6 2. + <_> + + <_> + 13 13 10 8 -1. + <_> + 18 13 5 4 2. + <_> + 13 17 5 4 2. + <_> + + <_> + 1 13 10 8 -1. + <_> + 1 13 5 4 2. + <_> + 6 17 5 4 2. + <_> + + <_> + 15 8 4 15 -1. + <_> + 15 13 4 5 3. + <_> + + <_> + 5 8 4 15 -1. + <_> + 5 13 4 5 3. + <_> + + <_> + 6 11 16 12 -1. + <_> + 6 15 16 4 3. + <_> + + <_> + 2 11 16 12 -1. + <_> + 2 15 16 4 3. + <_> + + <_> + 14 12 7 9 -1. + <_> + 14 15 7 3 3. + <_> + + <_> + 10 1 3 21 -1. + <_> + 10 8 3 7 3. + <_> + + <_> + 13 11 9 4 -1. + <_> + 13 13 9 2 2. + <_> + + <_> + 3 10 17 9 -1. + <_> + 3 13 17 3 3. + <_> + + <_> + 13 8 8 15 -1. + <_> + 13 13 8 5 3. + <_> + + <_> + 3 8 8 15 -1. + <_> + 3 13 8 5 3. + <_> + + <_> + 11 14 10 8 -1. + <_> + 16 14 5 4 2. + <_> + 11 18 5 4 2. + <_> + + <_> + 0 18 22 6 -1. + <_> + 0 18 11 3 2. + <_> + 11 21 11 3 2. + <_> + + <_> + 0 16 24 4 -1. + <_> + 0 16 12 4 2. + <_> + + <_> + 6 20 12 3 -1. + <_> + 12 20 6 3 2. + <_> + + <_> + 18 12 6 12 -1. + <_> + 21 12 3 6 2. + <_> + 18 18 3 6 2. + <_> + + <_> + 0 12 6 12 -1. + <_> + 0 12 3 6 2. + <_> + 3 18 3 6 2. + <_> + + <_> + 15 17 9 6 -1. + <_> + 15 19 9 2 3. + <_> + + <_> + 1 6 22 10 -1. + <_> + 1 6 11 5 2. + <_> + 12 11 11 5 2. + <_> + + <_> + 15 17 9 6 -1. + <_> + 15 19 9 2 3. + <_> + + <_> + 0 18 18 2 -1. + <_> + 0 19 18 1 2. + <_> + + <_> + 3 15 19 3 -1. + <_> + 3 16 19 1 3. + <_> + + <_> + 0 13 18 3 -1. + <_> + 0 14 18 1 3. + <_> + + <_> + 15 17 9 6 -1. + <_> + 15 19 9 2 3. + <_> + + <_> + 0 17 9 6 -1. + <_> + 0 19 9 2 3. + <_> + + <_> + 12 17 9 6 -1. + <_> + 12 19 9 2 3. + <_> + + <_> + 3 17 9 6 -1. + <_> + 3 19 9 2 3. + <_> + + <_> + 16 2 3 20 -1. + <_> + 17 2 1 20 3. + <_> + + <_> + 0 13 24 8 -1. + <_> + 0 17 24 4 2. + <_> + + <_> + 9 1 6 22 -1. + <_> + 12 1 3 11 2. + <_> + 9 12 3 11 2. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_fullbody.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_fullbody.xml new file mode 100644 index 0000000000000000000000000000000000000000..3ef752cb6c1f4fcc5cc37c5777f412d01e04edbc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_fullbody.xml @@ -0,0 +1,17030 @@ + + + +BOOST + HAAR + 28 + 14 + + 107 + + 0 + 30 + + <_> + 9 + -1.2288980484008789e+00 + + <_> + + 0 -1 0 -5.5820569396018982e-02 + + 5.8697921037673950e-01 -6.2811422348022461e-01 + <_> + + 0 -1 1 -3.8861181586980820e-02 + + -7.0916819572448730e-01 2.6821210980415344e-01 + <_> + + 0 -1 2 -2.6740878820419312e-01 + + 8.3082962036132812e-01 -2.2599589824676514e-01 + <_> + + 0 -1 3 9.6419736742973328e-02 + + -1.1697849631309509e-01 8.7254559993743896e-01 + <_> + + 0 -1 4 -1.0798710398375988e-02 + + -5.7219749689102173e-01 2.5325658917427063e-01 + <_> + + 0 -1 5 1.1365639977157116e-02 + + 1.9650830328464508e-01 -7.2744637727737427e-01 + <_> + + 0 -1 6 -5.0216919044032693e-04 + + 2.4435159564018250e-01 -5.1973581314086914e-01 + <_> + + 0 -1 7 -2.8462480753660202e-02 + + -8.3607292175292969e-01 1.1158040165901184e-01 + <_> + + 0 -1 8 1.3473170110955834e-03 + + -3.8406538963317871e-01 2.6767989993095398e-01 + <_> + 15 + -1.0969949960708618e+00 + + <_> + + 0 -1 9 -1.0743220336735249e-02 + + 4.7747328877449036e-01 -6.2392932176589966e-01 + <_> + + 0 -1 10 -1.3188569573685527e-03 + + 2.1242660284042358e-01 -2.4162709712982178e-01 + <_> + + 0 -1 11 -5.5571161210536957e-03 + + 3.6147859692573547e-01 -3.7251719832420349e-01 + <_> + + 0 -1 12 -1.3893410563468933e-01 + + -6.7900502681732178e-01 1.1280310153961182e-01 + <_> + + 0 -1 13 2.6465829461812973e-02 + + 1.2474969774484634e-01 -8.2852339744567871e-01 + <_> + + 0 -1 14 -8.9386843144893646e-02 + + 7.4271762371063232e-01 -1.7019319534301758e-01 + <_> + + 0 -1 15 -2.1335419267416000e-02 + + -7.1750187873840332e-01 1.5566180646419525e-01 + <_> + + 0 -1 16 5.5709101259708405e-02 + + -1.5310040116310120e-01 7.1804767847061157e-01 + <_> + + 0 -1 17 -6.9709950685501099e-01 + + 8.1154191493988037e-01 -1.0886389762163162e-01 + <_> + + 0 -1 18 2.0205999910831451e-01 + + 7.6398417353630066e-02 -7.3011511564254761e-01 + <_> + + 0 -1 19 -7.1882657706737518e-02 + + -7.1488589048385620e-01 1.6517649590969086e-01 + <_> + + 0 -1 20 -1.9228760153055191e-02 + + -3.9868369698524475e-01 4.0557239204645157e-02 + <_> + + 0 -1 21 1.1500229593366385e-03 + + -3.8260778784751892e-01 3.1855079531669617e-01 + <_> + + 0 -1 22 2.3252779617905617e-02 + + 5.4390400648117065e-02 -7.0669990777969360e-01 + <_> + + 0 -1 23 -3.2618120894767344e-04 + + 2.2610600292682648e-01 -4.0709879994392395e-01 + <_> + 14 + -1.2285970449447632e+00 + + <_> + + 0 -1 24 -1.2910200655460358e-01 + + 7.6003128290176392e-01 -2.3405790328979492e-01 + <_> + + 0 -1 25 6.7449256777763367e-02 + + 1.7179529368877411e-01 -8.4364777803421021e-01 + <_> + + 0 -1 26 1.2663270346820354e-02 + + 2.2913210093975067e-01 -7.3072457313537598e-01 + <_> + + 0 -1 27 -4.2741331271827221e-03 + + 6.2420479953289032e-02 -4.0985938906669617e-01 + <_> + + 0 -1 28 -2.3143950849771500e-02 + + -8.3971828222274780e-01 2.0115749537944794e-01 + <_> + + 0 -1 29 -5.5371038615703583e-04 + + 1.5369419753551483e-01 -4.4038110971450806e-01 + <_> + + 0 -1 30 -9.5239803194999695e-03 + + -6.3186800479888916e-01 1.6250230371952057e-01 + <_> + + 0 -1 31 2.8307670727372169e-02 + + -7.2599969804286957e-02 3.7919989228248596e-01 + <_> + + 0 -1 32 -4.5148018747568130e-02 + + 7.4493628740310669e-01 -1.5581710636615753e-01 + <_> + + 0 -1 33 1.0014739632606506e-01 + + 1.7949639260768890e-01 -6.4644080400466919e-01 + <_> + + 0 -1 34 7.3245721869170666e-03 + + 1.7763899266719818e-01 -5.7654058933258057e-01 + <_> + + 0 -1 35 1.1875670403242111e-02 + + -3.1129720807075500e-01 1.6321399807929993e-01 + <_> + + 0 -1 36 -2.5479039177298546e-02 + + 6.2692481279373169e-01 -1.1333750188350677e-01 + <_> + + 0 -1 37 -7.9196523874998093e-03 + + -7.7624428272247314e-01 1.5427610278129578e-01 + <_> + 22 + -1.1200269460678101e+00 + + <_> + + 0 -1 38 -8.5809278488159180e-01 + + 7.8796839714050293e-01 -2.2135549783706665e-01 + <_> + + 0 -1 39 -1.6491119749844074e-03 + + 2.5673401355743408e-01 -4.3194240331649780e-01 + <_> + + 0 -1 40 -2.5882309302687645e-02 + + -8.7551230192184448e-01 8.8385626673698425e-02 + <_> + + 0 -1 41 -4.7666151076555252e-03 + + -4.7022369503974915e-01 2.2800800204277039e-01 + <_> + + 0 -1 42 -8.3729699254035950e-02 + + 6.3385730981826782e-01 -1.4888319373130798e-01 + <_> + + 0 -1 43 -4.0685739368200302e-02 + + -9.3931788206100464e-01 1.0598939843475819e-02 + <_> + + 0 -1 44 -5.0759920850396156e-03 + + -4.5554420351982117e-01 1.7864370346069336e-01 + <_> + + 0 -1 45 2.3427829146385193e-03 + + -2.1434280276298523e-01 1.5531420707702637e-01 + <_> + + 0 -1 46 2.7649151161313057e-04 + + -3.3348160982131958e-01 2.2780239582061768e-01 + <_> + + 0 -1 47 1.6941839829087257e-02 + + 7.4140816926956177e-02 -5.6262052059173584e-01 + <_> + + 0 -1 48 4.7558981180191040e-01 + + -1.0861130058765411e-01 8.2985258102416992e-01 + <_> + + 0 -1 49 5.8000627905130386e-03 + + 1.3249030709266663e-01 -5.1620399951934814e-01 + <_> + + 0 -1 50 -7.4477560818195343e-02 + + -5.5545568466186523e-01 1.2344320118427277e-01 + <_> + + 0 -1 51 -3.5143009154126048e-04 + + 6.8190753459930420e-02 -1.3616859912872314e-01 + <_> + + 0 -1 52 7.3454021476209164e-03 + + 1.3678510487079620e-01 -5.3645122051239014e-01 + <_> + + 0 -1 53 -1.5471279621124268e-02 + + 2.6180639863014221e-01 -1.0545810312032700e-01 + <_> + + 0 -1 54 5.6055500172078609e-03 + + -2.5746351480484009e-01 2.8795930743217468e-01 + <_> + + 0 -1 55 -2.4552858667448163e-04 + + 1.0099930316209793e-01 -2.6119679212570190e-01 + <_> + + 0 -1 56 -3.3138900995254517e-02 + + -8.3779567480087280e-01 1.1327689886093140e-01 + <_> + + 0 -1 57 3.5591889172792435e-02 + + 8.2336090505123138e-02 -6.2505662441253662e-01 + <_> + + 0 -1 58 2.0834030210971832e-01 + + 6.9524437189102173e-02 -8.6881148815155029e-01 + <_> + + 0 -1 59 -2.8165400028228760e-02 + + -5.9799849987030029e-01 8.0329902470111847e-02 + <_> + 25 + -1.0664960145950317e+00 + + <_> + + 0 -1 60 -2.6740709319710732e-02 + + 3.8912421464920044e-01 -4.9827679991722107e-01 + <_> + + 0 -1 61 -1.2516999850049615e-03 + + 1.3123430311679840e-01 -3.6368998885154724e-01 + <_> + + 0 -1 62 -4.1634511202573776e-02 + + 5.7444751262664795e-01 -1.3932879269123077e-01 + <_> + + 0 -1 63 1.0096579790115356e-02 + + 9.9073797464370728e-02 -2.2956989705562592e-01 + <_> + + 0 -1 64 -1.9090399146080017e-02 + + -5.5153107643127441e-01 1.5110069513320923e-01 + <_> + + 0 -1 65 -3.1481068581342697e-02 + + -4.5884269475936890e-01 1.7579549551010132e-01 + <_> + + 0 -1 66 -1.7687549814581871e-02 + + 4.4711831212043762e-01 -1.5292930603027344e-01 + <_> + + 0 -1 67 -4.3685659766197205e-03 + + 1.2185490131378174e-01 -1.6688570380210876e-01 + <_> + + 0 -1 68 8.9326845481991768e-03 + + -1.3333690166473389e-01 6.3753342628479004e-01 + <_> + + 0 -1 69 -5.0706309266388416e-03 + + -1.1220289766788483e-01 6.9824352860450745e-02 + <_> + + 0 -1 70 -5.9803090989589691e-03 + + -5.1842898130416870e-01 1.6099199652671814e-01 + <_> + + 0 -1 71 2.9967839363962412e-03 + + 4.1065338999032974e-02 -1.9455850124359131e-01 + <_> + + 0 -1 72 3.8641549181193113e-03 + + 1.6673240065574646e-01 -4.3569779396057129e-01 + <_> + + 0 -1 73 6.8349428474903107e-03 + + -1.7162640392780304e-01 1.4818060398101807e-01 + <_> + + 0 -1 74 4.3158490210771561e-02 + + 8.3203509449958801e-02 -7.7821850776672363e-01 + <_> + + 0 -1 75 7.6560080051422119e-03 + + 8.4740802645683289e-02 -4.9738150835037231e-01 + <_> + + 0 -1 76 -3.1110988929867744e-03 + + 2.5827148556709290e-01 -2.5552031397819519e-01 + <_> + + 0 -1 77 1.1870309710502625e-01 + + -9.0944238007068634e-02 7.2286212444305420e-01 + <_> + + 0 -1 78 1.6875969246029854e-02 + + 1.2629170715808868e-01 -5.5205297470092773e-01 + <_> + + 0 -1 79 -1.0887029930017889e-04 + + 8.1648796796798706e-02 -1.6937020421028137e-01 + <_> + + 0 -1 80 2.8222990222275257e-03 + + 1.6411300003528595e-01 -3.5218268632888794e-01 + <_> + + 0 -1 81 -5.2425849437713623e-01 + + 4.8906171321868896e-01 -1.2674759328365326e-01 + <_> + + 0 -1 82 3.6927509307861328e-01 + + 8.6115993559360504e-02 -6.7184638977050781e-01 + <_> + + 0 -1 83 -1.6883780062198639e-01 + + -8.4915691614151001e-01 5.4833348840475082e-02 + <_> + + 0 -1 84 -1.9279260188341141e-02 + + -7.8011512756347656e-01 6.2202680855989456e-02 + <_> + 22 + -1.2319500446319580e+00 + + <_> + + 0 -1 85 -2.0901350677013397e-01 + + 6.9808167219161987e-01 -3.4573590755462646e-01 + <_> + + 0 -1 86 -4.8061009147204459e-04 + + 2.0923900604248047e-01 -2.4147640168666840e-01 + <_> + + 0 -1 87 -2.4844119325280190e-03 + + 2.7636009454727173e-01 -4.1990399360656738e-01 + <_> + + 0 -1 88 -2.1536289714276791e-03 + + 2.4710460007190704e-01 -3.0677899718284607e-01 + <_> + + 0 -1 89 5.8911990374326706e-02 + + -7.0834763348102570e-02 7.1133142709732056e-01 + <_> + + 0 -1 90 -2.3095219512470067e-04 + + 1.7148600518703461e-01 -3.6168378591537476e-01 + <_> + + 0 -1 91 -3.1396400183439255e-02 + + -8.0131882429122925e-01 1.0042560100555420e-01 + <_> + + 0 -1 92 -3.5601970739662647e-03 + + 9.9432766437530518e-02 -1.4848260581493378e-01 + <_> + + 0 -1 93 -4.3389322236180305e-03 + + -5.6621241569519043e-01 1.4096799492835999e-01 + <_> + + 0 -1 94 2.1326710283756256e-01 + + 4.8158209770917892e-02 -7.4858909845352173e-01 + <_> + + 0 -1 95 1.0042529553174973e-02 + + 1.0428400337696075e-01 -5.5387377738952637e-01 + <_> + + 0 -1 96 -2.6825280860066414e-02 + + 5.7281607389450073e-01 -8.2537978887557983e-02 + <_> + + 0 -1 97 8.3760882262140512e-04 + + -2.5626900792121887e-01 2.5898420810699463e-01 + <_> + + 0 -1 98 -7.6051978394389153e-03 + + -5.8677357435226440e-01 5.1210779696702957e-02 + <_> + + 0 -1 99 -1.1935640126466751e-01 + + -4.5530828833580017e-01 1.2570330500602722e-01 + <_> + + 0 -1 100 6.6083478741347790e-03 + + -1.6316379606723785e-01 4.6659541130065918e-01 + <_> + + 0 -1 101 1.7303509637713432e-02 + + -1.2391400337219238e-01 5.9755408763885498e-01 + <_> + + 0 -1 102 5.4382272064685822e-03 + + 1.3838729262351990e-01 -5.5069202184677124e-01 + <_> + + 0 -1 103 2.4591449182480574e-03 + + -3.9927339553833008e-01 1.5387089550495148e-01 + <_> + + 0 -1 104 3.5056238994002342e-03 + + -1.6146700084209442e-01 1.6086600720882416e-01 + <_> + + 0 -1 105 -2.3172689543571323e-04 + + 1.7059360444545746e-01 -3.5409420728683472e-01 + <_> + + 0 -1 106 1.1914529837667942e-02 + + 1.6265639662742615e-01 -4.1463181376457214e-01 + <_> + 18 + -1.1912549734115601e+00 + + <_> + + 0 -1 107 -4.5429700985550880e-03 + + 4.2964971065521240e-01 -5.6915849447250366e-01 + <_> + + 0 -1 108 4.6804840676486492e-03 + + -1.0380080342292786e-01 2.5453719496726990e-01 + <_> + + 0 -1 109 3.5870380233973265e-03 + + -3.6577078700065613e-01 3.9343339204788208e-01 + <_> + + 0 -1 110 -3.4428331255912781e-01 + + 7.3125761747360229e-01 -1.5060240030288696e-01 + <_> + + 0 -1 111 3.3054459840059280e-02 + + 1.7657589912414551e-01 -5.1060509681701660e-01 + <_> + + 0 -1 112 -2.1190310362726450e-03 + + 8.6859323084354401e-02 -1.7733760178089142e-01 + <_> + + 0 -1 113 1.3780740089714527e-02 + + -1.2247169762849808e-01 6.6472941637039185e-01 + <_> + + 0 -1 114 2.4847950786352158e-02 + + 2.3976799845695496e-01 -3.2456618547439575e-01 + <_> + + 0 -1 115 -1.3126630336046219e-02 + + 4.9461808800697327e-01 -2.0954379439353943e-01 + <_> + + 0 -1 116 -1.6886189579963684e-02 + + -1.3973990082740784e-01 7.5013160705566406e-02 + <_> + + 0 -1 117 -5.2776751108467579e-03 + + -3.8919359445571899e-01 1.8921519815921783e-01 + <_> + + 0 -1 118 -2.0325549412518740e-03 + + 2.4965450167655945e-01 -1.7960360646247864e-01 + <_> + + 0 -1 119 -1.8056800588965416e-02 + + -5.3683072328567505e-01 1.0615479946136475e-01 + <_> + + 0 -1 120 -2.8815109282732010e-02 + + 5.3303200006484985e-01 -7.8712686896324158e-02 + <_> + + 0 -1 121 -6.0971658676862717e-02 + + -8.5663092136383057e-01 8.1721447408199310e-02 + <_> + + 0 -1 122 -6.2022160738706589e-02 + + -6.7228960990905762e-01 8.2316987216472626e-02 + <_> + + 0 -1 123 -6.2961759977042675e-03 + + 2.7192309498786926e-01 -2.3713490366935730e-01 + <_> + + 0 -1 124 4.9608140252530575e-03 + + -1.4295519888401031e-01 2.9380369186401367e-01 + <_> + 30 + -1.1750839948654175e+00 + + <_> + + 0 -1 125 -8.7001353502273560e-02 + + 6.3087427616119385e-01 -2.6264131069183350e-01 + <_> + + 0 -1 126 -4.5627020299434662e-03 + + 1.4641839265823364e-01 -5.2321881055831909e-02 + <_> + + 0 -1 127 -4.1381991468369961e-03 + + 2.1747599542140961e-01 -3.2107940316200256e-01 + <_> + + 0 -1 128 -1.9443330529611558e-04 + + 1.4305000007152557e-01 -4.4748461246490479e-01 + <_> + + 0 -1 129 -2.6125069707632065e-03 + + -3.5936230421066284e-01 2.0934499800205231e-01 + <_> + + 0 -1 130 -3.5238351672887802e-02 + + -5.5879557132720947e-01 1.1818339675664902e-01 + <_> + + 0 -1 131 2.3880550637841225e-02 + + -1.2345419824123383e-01 6.4505738019943237e-01 + <_> + + 0 -1 132 -3.5878319758921862e-03 + + 2.3340910673141479e-01 -2.9905730485916138e-01 + <_> + + 0 -1 133 -3.4388148784637451e-01 + + 6.3334107398986816e-01 -8.6101479828357697e-02 + <_> + + 0 -1 134 -2.5634190533310175e-03 + + -3.0992001295089722e-01 8.8213436305522919e-02 + <_> + + 0 -1 135 4.7002349048852921e-02 + + 7.3533393442630768e-02 -7.5965261459350586e-01 + <_> + + 0 -1 136 7.1428148075938225e-03 + + -1.6981430351734161e-01 4.1982281208038330e-01 + <_> + + 0 -1 137 -3.7736629601567984e-03 + + -5.5664837360382080e-01 1.0060050338506699e-01 + <_> + + 0 -1 138 2.2179849445819855e-02 + + -7.6009899377822876e-02 6.3711041212081909e-01 + <_> + + 0 -1 139 2.9807379178237170e-05 + + -2.7143061161041260e-01 2.1503789722919464e-01 + <_> + + 0 -1 140 -1.4308329809864517e-05 + + 1.3090610504150391e-01 -2.8089499473571777e-01 + <_> + + 0 -1 141 -1.1500260233879089e-01 + + -7.1986222267150879e-01 7.6884172856807709e-02 + <_> + + 0 -1 142 -2.5318590924143791e-02 + + 4.5250499248504639e-01 -9.0481691062450409e-02 + <_> + + 0 -1 143 -4.8698320984840393e-02 + + -7.4177128076553345e-01 6.7692406475543976e-02 + <_> + + 0 -1 144 -5.0045289099216461e-03 + + 1.3680170476436615e-01 -1.1860919743776321e-01 + <_> + + 0 -1 145 7.5120502151548862e-03 + + 9.1260991990566254e-02 -5.6960678100585938e-01 + <_> + + 0 -1 146 -5.4631778039038181e-03 + + 1.1702360212802887e-01 -1.4761230349540710e-01 + <_> + + 0 -1 147 1.5256009995937347e-02 + + -1.0768359899520874e-01 6.4716261625289917e-01 + <_> + + 0 -1 148 -2.1900620311498642e-02 + + -6.0776418447494507e-01 6.4449213445186615e-02 + <_> + + 0 -1 149 2.1267218980938196e-03 + + -2.3115469515323639e-01 2.1813300251960754e-01 + <_> + + 0 -1 150 -3.1501919031143188e-02 + + -1.3678109645843506e-01 6.6003270447254181e-02 + <_> + + 0 -1 151 1.8107969313859940e-02 + + 1.0865720361471176e-01 -4.4673460721969604e-01 + <_> + + 0 -1 152 -1.1059570312500000e-01 + + 4.6954178810119629e-01 -1.1268380284309387e-01 + <_> + + 0 -1 153 2.2349569480866194e-03 + + -2.9884970188140869e-01 1.8147529661655426e-01 + <_> + + 0 -1 154 4.6504188328981400e-02 + + 1.2846769392490387e-01 -2.6609849929809570e-01 + <_> + 27 + -1.1861419677734375e+00 + + <_> + + 0 -1 155 -4.8820599913597107e-02 + + 4.2807990312576294e-01 -5.5154949426651001e-01 + <_> + + 0 -1 156 1.4779040357097983e-03 + + -1.8688060343265533e-01 1.9038289785385132e-01 + <_> + + 0 -1 157 -1.0012290440499783e-02 + + 3.8451421260833740e-01 -2.1723049879074097e-01 + <_> + + 0 -1 158 -5.1000278443098068e-02 + + -7.6136952638626099e-01 1.3625900261104107e-02 + <_> + + 0 -1 159 5.2959132008254528e-03 + + -2.3021429777145386e-01 2.8536239266395569e-01 + <_> + + 0 -1 160 -4.8654139041900635e-02 + + 7.0992070436477661e-01 -4.9203149974346161e-02 + <_> + + 0 -1 161 8.8448636233806610e-03 + + -3.1505361199378967e-01 2.0899020135402679e-01 + <_> + + 0 -1 162 1.0062800347805023e-01 + + 6.6908989101648331e-03 6.7013871669769287e-01 + <_> + + 0 -1 163 -7.0256260223686695e-03 + + -3.9408329129219055e-01 1.7433549463748932e-01 + <_> + + 0 -1 164 -2.1224319934844971e-03 + + 1.6996310651302338e-01 -3.0237409472465515e-01 + <_> + + 0 -1 165 9.9532064050436020e-03 + + -1.4202840626239777e-01 4.5167461037635803e-01 + <_> + + 0 -1 166 1.2565069831907749e-02 + + 7.3175877332687378e-02 -6.1700421571731567e-01 + <_> + + 0 -1 167 -1.7854310572147369e-03 + + 1.4909860491752625e-01 -3.2865241169929504e-01 + <_> + + 0 -1 168 -4.0306518785655499e-03 + + -4.5713710784912109e-01 1.0815720260143280e-01 + <_> + + 0 -1 169 -7.3099560104310513e-03 + + -6.5592771768569946e-01 6.5615788102149963e-02 + <_> + + 0 -1 170 -3.3843431621789932e-02 + + 5.0412368774414062e-01 -6.1626069247722626e-02 + <_> + + 0 -1 171 3.8319290615618229e-04 + + -2.5153478980064392e-01 2.0271340012550354e-01 + <_> + + 0 -1 172 -2.6169361080974340e-03 + + 2.2497959434986115e-01 -2.1958619356155396e-01 + <_> + + 0 -1 173 -4.5606079511344433e-03 + + -4.6598041057586670e-01 1.2348009645938873e-01 + <_> + + 0 -1 174 1.0822789743542671e-02 + + -9.6618972718715668e-02 4.6412429213523865e-01 + <_> + + 0 -1 175 -5.3171347826719284e-03 + + -5.5634248256683350e-01 9.4623282551765442e-02 + <_> + + 0 -1 176 -9.3140971148386598e-04 + + 1.0143929719924927e-01 -1.0564240068197250e-01 + <_> + + 0 -1 177 8.4296840941533446e-04 + + -1.3243100047111511e-01 3.5351079702377319e-01 + <_> + + 0 -1 178 -2.7806960046291351e-02 + + -6.5050601959228516e-01 3.3153589814901352e-02 + <_> + + 0 -1 179 6.9245469057932496e-04 + + -2.6702880859375000e-01 2.1129630506038666e-01 + <_> + + 0 -1 180 -1.2787230312824249e-02 + + 2.1593640744686127e-01 -8.6767077445983887e-02 + <_> + + 0 -1 181 -6.1678601196035743e-04 + + 1.6959980130195618e-01 -2.9248940944671631e-01 + <_> + 21 + -1.0550270080566406e+00 + + <_> + + 0 -1 182 -5.1706928759813309e-02 + + 4.6942698955535889e-01 -5.1280671358108521e-01 + <_> + + 0 -1 183 5.5232150480151176e-03 + + -2.4982389807701111e-01 6.3005810976028442e-01 + <_> + + 0 -1 184 -9.2110745608806610e-03 + + 3.7530669569969177e-01 -2.2910380363464355e-01 + <_> + + 0 -1 185 4.1729960590600967e-02 + + -1.1262010037899017e-01 6.7508697509765625e-01 + <_> + + 0 -1 186 4.5255841687321663e-03 + + -2.6939728856086731e-01 2.4889509379863739e-01 + <_> + + 0 -1 187 -8.5208792006596923e-04 + + 2.0098550617694855e-01 -2.3001730442047119e-01 + <_> + + 0 -1 188 -3.4569639246910810e-03 + + -3.6372348666191101e-01 2.7142500877380371e-01 + <_> + + 0 -1 189 -8.8200360536575317e-02 + + -7.5951957702636719e-01 -7.2166309691965580e-03 + <_> + + 0 -1 190 -2.3253160179592669e-04 + + 1.4738219976425171e-01 -4.2548701167106628e-01 + <_> + + 0 -1 191 1.9258400425314903e-02 + + -8.4830872714519501e-02 5.9487771987915039e-01 + <_> + + 0 -1 192 -3.1915740109980106e-03 + + -4.2638280987739563e-01 1.3357159495353699e-01 + <_> + + 0 -1 193 -2.2229040041565895e-02 + + -4.2298269271850586e-01 3.6127958446741104e-02 + <_> + + 0 -1 194 -5.3123440593481064e-03 + + 2.9349780082702637e-01 -2.2197869420051575e-01 + <_> + + 0 -1 195 5.6796981953084469e-03 + + 8.0412790179252625e-02 -1.9725289940834045e-01 + <_> + + 0 -1 196 3.2511178869754076e-03 + + -1.6628390550613403e-01 3.3107280731201172e-01 + <_> + + 0 -1 197 2.5559039786458015e-03 + + 6.7350171506404877e-02 -2.4642370641231537e-01 + <_> + + 0 -1 198 3.1239999458193779e-02 + + -6.7393511533737183e-02 8.2851767539978027e-01 + <_> + + 0 -1 199 -4.4333371333777905e-03 + + -3.8048321008682251e-01 1.4248619973659515e-01 + <_> + + 0 -1 200 -3.9497618563473225e-03 + + -3.5660448670387268e-01 1.8685440719127655e-01 + <_> + + 0 -1 201 -1.4043290168046951e-02 + + 5.3222888708114624e-01 -7.8980803489685059e-02 + <_> + + 0 -1 202 4.2212791740894318e-03 + + -1.9841830432415009e-01 3.1367298960685730e-01 + <_> + 43 + -1.1214250326156616e+00 + + <_> + + 0 -1 203 -1.5278789401054382e-01 + + 5.4140037298202515e-01 -1.8756979703903198e-01 + <_> + + 0 -1 204 -7.0655636489391327e-02 + + 3.4003350138664246e-01 -1.4459669589996338e-01 + <_> + + 0 -1 205 -2.1033229306340218e-02 + + -5.5878472328186035e-01 1.1598149687051773e-01 + <_> + + 0 -1 206 -9.5666358247399330e-03 + + 1.0890080034732819e-01 -2.0365689694881439e-01 + <_> + + 0 -1 207 -4.2720541357994080e-02 + + -9.4030022621154785e-01 6.3606321811676025e-02 + <_> + + 0 -1 208 -4.5477859675884247e-03 + + 3.4227019548416138e-01 -1.7053720355033875e-01 + <_> + + 0 -1 209 3.7029080558568239e-03 + + 8.3720892667770386e-02 -4.6139541268348694e-01 + <_> + + 0 -1 210 -1.1458870023488998e-01 + + 6.0027849674224854e-01 -1.7764480784535408e-02 + <_> + + 0 -1 211 5.7319342158734798e-03 + + -2.5590109825134277e-01 2.0062319934368134e-01 + <_> + + 0 -1 212 -7.0237793028354645e-02 + + 2.5359788537025452e-01 -2.9503619298338890e-02 + <_> + + 0 -1 213 1.3983179815113544e-02 + + 1.1456400156021118e-01 -3.9683538675308228e-01 + <_> + + 0 -1 214 1.8175759911537170e-01 + + 5.0749950110912323e-02 -8.3061927556991577e-01 + <_> + + 0 -1 215 3.0185490846633911e-02 + + -2.6683610677719116e-01 1.4070799946784973e-01 + <_> + + 0 -1 216 7.5633287429809570e-01 + + -4.1416618973016739e-02 9.0957278013229370e-01 + <_> + + 0 -1 217 -8.5228988900780678e-03 + + 1.6142499446868896e-01 -2.7549099922180176e-01 + <_> + + 0 -1 218 -4.9996669404208660e-03 + + -1.1666730046272278e-01 6.0298819094896317e-02 + <_> + + 0 -1 219 -5.9932802105322480e-04 + + 1.3015550374984741e-01 -3.1072840094566345e-01 + <_> + + 0 -1 220 -9.6063673496246338e-02 + + -8.5259348154067993e-01 1.5970790758728981e-02 + <_> + + 0 -1 221 -7.0154820568859577e-03 + + -4.5490509271621704e-01 7.7178090810775757e-02 + <_> + + 0 -1 222 -8.7620541453361511e-03 + + 4.8034501075744629e-01 -8.1306837499141693e-02 + <_> + + 0 -1 223 -3.9868508465588093e-03 + + 2.2495600581169128e-01 -2.0447289943695068e-01 + <_> + + 0 -1 224 -5.7335309684276581e-02 + + -5.6859737634658813e-01 5.2798101678490639e-03 + <_> + + 0 -1 225 1.9260890549048781e-03 + + 1.4920340478420258e-01 -3.1059908866882324e-01 + <_> + + 0 -1 226 2.1118070930242538e-02 + + 4.1174301877617836e-03 -5.2401381731033325e-01 + <_> + + 0 -1 227 -1.1973599903285503e-03 + + 2.3353399336338043e-01 -2.0193660259246826e-01 + <_> + + 0 -1 228 4.5973812229931355e-03 + + 5.9917010366916656e-02 -1.1878310143947601e-01 + <_> + + 0 -1 229 2.8869660571217537e-02 + + -9.4110779464244843e-02 4.5966941118240356e-01 + <_> + + 0 -1 230 -3.7549799308180809e-03 + + 1.2161179631948471e-01 -1.4811019599437714e-01 + <_> + + 0 -1 231 4.2033549398183823e-03 + + 1.0903070122003555e-01 -3.8700520992279053e-01 + <_> + + 0 -1 232 7.2994068264961243e-02 + + -3.4046798944473267e-02 3.0610039830207825e-01 + <_> + + 0 -1 233 1.6667179763317108e-02 + + 1.3168589770793915e-01 -3.8485860824584961e-01 + <_> + + 0 -1 234 -2.8268690221011639e-03 + + 6.4782157540321350e-02 -2.2371709346771240e-01 + <_> + + 0 -1 235 3.7736070808023214e-03 + + -1.5592969954013824e-01 2.5413069128990173e-01 + <_> + + 0 -1 236 -3.6936940159648657e-03 + + 2.5576528906822205e-01 -1.5768060088157654e-01 + <_> + + 0 -1 237 -6.6801063716411591e-02 + + -7.4346089363098145e-01 5.4915640503168106e-02 + <_> + + 0 -1 238 1.5752790495753288e-02 + + -9.8638102412223816e-02 4.3119820952415466e-01 + <_> + + 0 -1 239 9.0647127944976091e-04 + + 1.1339239776134491e-01 -4.1574460268020630e-01 + <_> + + 0 -1 240 -2.1695699542760849e-02 + + 4.6949240565299988e-01 -5.5732611566781998e-02 + <_> + + 0 -1 241 -1.4639029977843165e-03 + + -3.0617880821228027e-01 1.4398169517517090e-01 + <_> + + 0 -1 242 -1.7810560762882233e-02 + + 3.0411729216575623e-01 -4.6758800745010376e-02 + <_> + + 0 -1 243 -5.6027648970484734e-03 + + -5.2942901849746704e-01 7.8287117183208466e-02 + <_> + + 0 -1 244 1.9500569906085730e-03 + + -9.5949448645114899e-02 1.9031670689582825e-01 + <_> + + 0 -1 245 1.0641569644212723e-01 + + 4.7288440167903900e-02 -8.6525350809097290e-01 + <_> + 21 + -1.1566660404205322e+00 + + <_> + + 0 -1 246 1.8256990239024162e-02 + + -5.5564939975738525e-01 4.3546560406684875e-01 + <_> + + 0 -1 247 -1.1249440163373947e-01 + + 6.1800277233123779e-01 -2.1641810238361359e-01 + <_> + + 0 -1 248 2.0443440880626440e-03 + + -3.1379559636116028e-01 2.6424890756607056e-01 + <_> + + 0 -1 249 6.2505697133019567e-04 + + -2.3659600317478180e-01 2.1169990301132202e-01 + <_> + + 0 -1 250 1.3297300320118666e-03 + + -3.1339448690414429e-01 3.0449068546295166e-01 + <_> + + 0 -1 251 -4.6840369701385498e-02 + + 5.3759092092514038e-01 -1.8081139773130417e-02 + <_> + + 0 -1 252 -6.4874291419982910e-01 + + 6.6768437623977661e-01 -9.1247849166393280e-02 + <_> + + 0 -1 253 9.6183530986309052e-03 + + 1.4733779430389404e-01 -3.2193028926849365e-01 + <_> + + 0 -1 254 2.2117879707366228e-03 + + 1.5755419433116913e-01 -3.6799180507659912e-01 + <_> + + 0 -1 255 4.9280291423201561e-03 + + -8.3405740559101105e-02 6.8260177969932556e-02 + <_> + + 0 -1 256 1.3977079652249813e-02 + + -1.0702060163021088e-01 4.8326531052589417e-01 + <_> + + 0 -1 257 -1.0333389946026728e-04 + + 1.3645449280738831e-01 -3.1777021288871765e-01 + <_> + + 0 -1 258 -2.2287340834736824e-03 + + 2.1791179478168488e-01 -1.9923299551010132e-01 + <_> + + 0 -1 259 -3.2301511615514755e-02 + + 3.3135131001472473e-01 -2.0617039874196053e-02 + <_> + + 0 -1 260 2.3240039125084877e-02 + + 5.9672571718692780e-02 -6.4993959665298462e-01 + <_> + + 0 -1 261 3.5599120892584324e-03 + + -1.4818920195102692e-01 2.9893338680267334e-01 + <_> + + 0 -1 262 1.5469759702682495e-02 + + -7.5569599866867065e-02 5.2314680814743042e-01 + <_> + + 0 -1 263 -1.6372289974242449e-04 + + 1.0446730256080627e-01 -2.0943340659141541e-01 + <_> + + 0 -1 264 -2.9369019903242588e-03 + + -4.3197739124298096e-01 1.0765810310840607e-01 + <_> + + 0 -1 265 -7.8579207183793187e-04 + + -2.4614779651165009e-01 2.1554739773273468e-01 + <_> + + 0 -1 266 1.1156699620187283e-02 + + -8.1820882856845856e-02 6.7338067293167114e-01 + <_> + 49 + -1.0953630208969116e+00 + + <_> + + 0 -1 267 -1.8473519384860992e-01 + + 5.4758828878402710e-01 -2.2319069504737854e-01 + <_> + + 0 -1 268 -2.8615030460059643e-03 + + 1.9264279305934906e-01 -2.2989100217819214e-01 + <_> + + 0 -1 269 1.7970189452171326e-01 + + -6.4573682844638824e-02 8.0322009325027466e-01 + <_> + + 0 -1 270 -5.2812729030847549e-02 + + 2.8784981369972229e-01 -8.8289387524127960e-02 + <_> + + 0 -1 271 6.9000339135527611e-03 + + 1.0979209840297699e-01 -4.8886889219284058e-01 + <_> + + 0 -1 272 4.0469530969858170e-02 + + 6.1697468161582947e-02 -7.2907817363739014e-01 + <_> + + 0 -1 273 4.5191249810159206e-03 + + -2.7972379326820374e-01 1.7065159976482391e-01 + <_> + + 0 -1 274 -3.8400939665734768e-03 + + -2.8329300880432129e-01 1.1611709743738174e-01 + <_> + + 0 -1 275 -7.1505218511447310e-04 + + 1.5870480239391327e-01 -2.8253421187400818e-01 + <_> + + 0 -1 276 3.0127899721264839e-02 + + -3.6236338317394257e-02 5.3369390964508057e-01 + <_> + + 0 -1 277 -1.9907640293240547e-02 + + -3.2229989767074585e-01 1.4933170378208160e-01 + <_> + + 0 -1 278 -3.1435668468475342e-02 + + 2.0812889933586121e-01 -9.6762210130691528e-02 + <_> + + 0 -1 279 -1.9912680611014366e-02 + + -3.2928928732872009e-01 1.2732729315757751e-01 + <_> + + 0 -1 280 4.0626749396324158e-02 + + 1.6985720023512840e-02 -5.2226179838180542e-01 + <_> + + 0 -1 281 1.6589110018685460e-03 + + -2.3795670270919800e-01 2.0775599777698517e-01 + <_> + + 0 -1 282 1.9869199022650719e-03 + + -1.3493759930133820e-01 1.2050859630107880e-01 + <_> + + 0 -1 283 -4.1985820978879929e-02 + + 4.4601130485534668e-01 -7.6145969331264496e-02 + <_> + + 0 -1 284 7.0260182023048401e-02 + + 1.5833569690585136e-02 -3.8182300329208374e-01 + <_> + + 0 -1 285 -1.7992800101637840e-02 + + -3.6973980069160461e-01 1.0451599955558777e-01 + <_> + + 0 -1 286 -1.0420969873666763e-01 + + 5.1836878061294556e-01 -2.2372400388121605e-02 + <_> + + 0 -1 287 5.3277369588613510e-02 + + 7.4715927243232727e-02 -5.8489412069320679e-01 + <_> + + 0 -1 288 9.6819162368774414e-02 + + -7.8130746260285378e-03 -9.0531897544860840e-01 + <_> + + 0 -1 289 -2.2317610681056976e-01 + + 4.7848999500274658e-01 -8.9570246636867523e-02 + <_> + + 0 -1 290 1.3523760251700878e-02 + + 6.5158583223819733e-02 -1.4030559360980988e-01 + <_> + + 0 -1 291 -7.1465343236923218e-02 + + -8.8997572660446167e-01 3.8111008703708649e-02 + <_> + + 0 -1 292 2.4734560400247574e-02 + + -3.2858259975910187e-02 3.5368600487709045e-01 + <_> + + 0 -1 293 -4.2641810141503811e-03 + + 1.2885729968547821e-01 -2.7788180112838745e-01 + <_> + + 0 -1 294 4.3246541172266006e-02 + + -2.6344619691371918e-02 3.3333760499954224e-01 + <_> + + 0 -1 295 5.2720978856086731e-03 + + 9.6122108399868011e-02 -3.8203689455986023e-01 + <_> + + 0 -1 296 -6.4102048054337502e-03 + + 1.6924449801445007e-01 -7.5236052274703979e-02 + <_> + + 0 -1 297 1.7747100442647934e-02 + + -6.5126739442348480e-02 5.3720867633819580e-01 + <_> + + 0 -1 298 1.6466729342937469e-01 + + 2.6764029636979103e-02 -6.9506132602691650e-01 + <_> + + 0 -1 299 -7.6354909688234329e-03 + + 1.7261630296707153e-01 -2.0242890715599060e-01 + <_> + + 0 -1 300 -7.6648168265819550e-02 + + 2.2567149996757507e-01 -3.5044141113758087e-02 + <_> + + 0 -1 301 2.9634330421686172e-03 + + 1.0679820179939270e-01 -3.0704519152641296e-01 + <_> + + 0 -1 302 -1.8968040123581886e-02 + + -6.5349531173706055e-01 4.5328449457883835e-02 + <_> + + 0 -1 303 6.2272930145263672e-01 + + 2.9418470337986946e-02 -7.7416032552719116e-01 + <_> + + 0 -1 304 3.1170540023595095e-03 + + -1.9263580441474915e-01 1.0082499682903290e-01 + <_> + + 0 -1 305 -1.0179740190505981e-01 + + 5.0667291879653931e-01 -7.5845532119274139e-02 + <_> + + 0 -1 306 -8.7539367377758026e-02 + + -8.0127829313278198e-01 3.9741981774568558e-02 + <_> + + 0 -1 307 -4.0089199319481850e-03 + + 1.5867359936237335e-01 -2.0390710234642029e-01 + <_> + + 0 -1 308 -1.7252740263938904e-01 + + -4.8556509613990784e-01 6.6162437200546265e-02 + <_> + + 0 -1 309 2.2747491020709276e-03 + + 1.0839290171861649e-01 -2.6120510697364807e-01 + <_> + + 0 -1 310 8.7025731801986694e-02 + + -4.5612849295139313e-02 3.0642318725585938e-01 + <_> + + 0 -1 311 3.3302091062068939e-02 + + 9.8511956632137299e-02 -4.0321010351181030e-01 + <_> + + 0 -1 312 -5.5495370179414749e-03 + + 6.7809469997882843e-02 -1.9448509812355042e-01 + <_> + + 0 -1 313 -7.5916801579296589e-03 + + -3.3229979872703552e-01 1.0552299767732620e-01 + <_> + + 0 -1 314 -5.4776940494775772e-02 + + 3.1344750523567200e-01 -9.2561431229114532e-02 + <_> + + 0 -1 315 1.7293309792876244e-02 + + -1.0366520285606384e-01 4.5732820034027100e-01 + <_> + 40 + -1.0216970443725586e+00 + + <_> + + 0 -1 316 -2.2501630708575249e-02 + + 5.2293592691421509e-01 -1.7968380451202393e-01 + <_> + + 0 -1 317 -1.8166720867156982e-02 + + 1.4281089603900909e-01 -3.0268448591232300e-01 + <_> + + 0 -1 318 3.1680259853601456e-02 + + 1.5708820521831512e-01 -3.2303369045257568e-01 + <_> + + 0 -1 319 -2.3476250469684601e-02 + + -4.5576000213623047e-01 1.0300090163946152e-01 + <_> + + 0 -1 320 4.5688278973102570e-02 + + 6.7873537540435791e-02 -7.4623328447341919e-01 + <_> + + 0 -1 321 -7.4609883129596710e-02 + + 2.0548540353775024e-01 -1.0097859799861908e-01 + <_> + + 0 -1 322 -4.5903101563453674e-02 + + 6.6662758588790894e-01 -6.9071657955646515e-02 + <_> + + 0 -1 323 -5.7763070799410343e-04 + + 1.1386449635028839e-01 -1.2278319895267487e-01 + <_> + + 0 -1 324 -4.1800830513238907e-04 + + 1.9999989867210388e-01 -2.2372670471668243e-01 + <_> + + 0 -1 325 2.4581039324402809e-03 + + 1.0073749721050262e-01 -3.6323159933090210e-01 + <_> + + 0 -1 326 6.7467048764228821e-02 + + 5.4200690239667892e-02 -6.0347068309783936e-01 + <_> + + 0 -1 327 -3.8971859961748123e-02 + + 4.0277591347694397e-01 -1.1299470067024231e-01 + <_> + + 0 -1 328 1.6628159582614899e-01 + + 4.8290308564901352e-02 -8.1269222497940063e-01 + <_> + + 0 -1 329 5.5140322074294090e-03 + + 6.0484610497951508e-02 -5.4575890302658081e-01 + <_> + + 0 -1 330 1.2837080284953117e-03 + + -2.8150710463523865e-01 1.2785549461841583e-01 + <_> + + 0 -1 331 3.3840160816907883e-02 + + -6.1925090849399567e-02 5.4461580514907837e-01 + <_> + + 0 -1 332 1.4224560000002384e-02 + + -8.3702072501182556e-02 5.5404889583587646e-01 + <_> + + 0 -1 333 -1.4315280714072287e-04 + + 1.5318620204925537e-01 -2.8312870860099792e-01 + <_> + + 0 -1 334 -1.3604390434920788e-02 + + -6.3229328393936157e-01 5.6792028248310089e-02 + <_> + + 0 -1 335 -1.7952319979667664e-01 + + -7.7471101284027100e-01 -1.2696949997916818e-03 + <_> + + 0 -1 336 -6.3834888860583305e-03 + + 1.2864939868450165e-01 -3.1159159541130066e-01 + <_> + + 0 -1 337 -1.8140509724617004e-01 + + -7.0704931020736694e-01 3.0992519110441208e-02 + <_> + + 0 -1 338 3.4940429031848907e-03 + + 1.0192289948463440e-01 -3.3393231034278870e-01 + <_> + + 0 -1 339 4.0861740708351135e-02 + + 3.1267888844013214e-02 -4.3739050626754761e-01 + <_> + + 0 -1 340 3.6993999034166336e-02 + + -6.2453608959913254e-02 5.7605278491973877e-01 + <_> + + 0 -1 341 -7.7690118923783302e-03 + + -6.0737371444702148e-01 6.9758452475070953e-02 + <_> + + 0 -1 342 7.1885702200233936e-03 + + -1.4034010469913483e-01 2.4509570002555847e-01 + <_> + + 0 -1 343 -3.0558679252862930e-02 + + -2.6109099388122559e-01 2.0893760025501251e-02 + <_> + + 0 -1 344 -1.3949500396847725e-02 + + -4.5984518527984619e-01 7.2996988892555237e-02 + <_> + + 0 -1 345 -1.7439149320125580e-01 + + 2.7917501330375671e-01 -7.0309691131114960e-02 + <_> + + 0 -1 346 -5.6514460593461990e-03 + + -5.8335387706756592e-01 4.8543170094490051e-02 + <_> + + 0 -1 347 -5.6718150153756142e-03 + + -2.0645590126514435e-01 5.9949990361928940e-02 + <_> + + 0 -1 348 -2.9772339985356666e-05 + + 1.6627080738544464e-01 -1.8144470453262329e-01 + <_> + + 0 -1 349 -6.2705092132091522e-03 + + 2.5829210877418518e-01 -1.3548080623149872e-01 + <_> + + 0 -1 350 -5.2028051577508450e-03 + + -2.9585519433021545e-01 1.0223600268363953e-01 + <_> + + 0 -1 351 -3.6721840500831604e-02 + + 1.1443459987640381e-01 -1.5670689940452576e-01 + <_> + + 0 -1 352 7.8717432916164398e-02 + + 2.9407389461994171e-02 -8.9653927087783813e-01 + <_> + + 0 -1 353 9.0856212377548218e-01 + + -5.6400269269943237e-02 6.9543528556823730e-01 + <_> + + 0 -1 354 -5.2952598780393600e-03 + + 1.8282440304756165e-01 -2.0518480241298676e-01 + <_> + + 0 -1 355 -5.2672341465950012e-02 + + -6.8133538961410522e-01 3.6046069115400314e-02 + <_> + 51 + -1.0450960397720337e+00 + + <_> + + 0 -1 356 -2.1731309592723846e-01 + + 5.9716808795928955e-01 -2.2432699799537659e-01 + <_> + + 0 -1 357 -3.4627959132194519e-01 + + 5.3741937875747681e-01 -8.7782189249992371e-02 + <_> + + 0 -1 358 1.0713579831644893e-03 + + -3.5920229554176331e-01 1.5685929358005524e-01 + <_> + + 0 -1 359 -6.1267141252756119e-02 + + -7.1003252267837524e-01 2.0527899265289307e-02 + <_> + + 0 -1 360 3.1281840056180954e-02 + + -7.4646763503551483e-02 5.9689122438430786e-01 + <_> + + 0 -1 361 -1.2337400112301111e-03 + + 1.5949830412864685e-01 -2.7181199193000793e-01 + <_> + + 0 -1 362 -3.4508139360696077e-03 + + 2.0255160331726074e-01 -1.9399139285087585e-01 + <_> + + 0 -1 363 -7.0481761358678341e-03 + + -5.5100089311599731e-01 7.0738323032855988e-02 + <_> + + 0 -1 364 2.2950200736522675e-01 + + -8.7573416531085968e-02 6.0446268320083618e-01 + <_> + + 0 -1 365 -2.2578560747206211e-03 + + -8.5306502878665924e-02 1.0997729748487473e-01 + <_> + + 0 -1 366 -9.7562908194959164e-04 + + 9.7412303090095520e-02 -3.6251759529113770e-01 + <_> + + 0 -1 367 5.3088109940290451e-02 + + -3.5328660160303116e-03 -6.0694789886474609e-01 + <_> + + 0 -1 368 1.5448880149051547e-03 + + -2.2419139742851257e-01 1.7832720279693604e-01 + <_> + + 0 -1 369 1.2375700287520885e-02 + + -3.5778950899839401e-02 2.9557931423187256e-01 + <_> + + 0 -1 370 5.9611927717924118e-03 + + -7.3603026568889618e-02 4.8699569702148438e-01 + <_> + + 0 -1 371 8.3732418715953827e-03 + + 9.5786556601524353e-02 -3.9222580194473267e-01 + <_> + + 0 -1 372 -7.9954452812671661e-03 + + -2.9597011208534241e-01 1.3246519863605499e-01 + <_> + + 0 -1 373 1.7624149098992348e-02 + + 1.1629760265350342e-02 -3.7594190239906311e-01 + <_> + + 0 -1 374 -8.1538967788219452e-04 + + 1.8403179943561554e-01 -2.1106949448585510e-01 + <_> + + 0 -1 375 6.5910838544368744e-02 + + 3.8050938397645950e-02 -8.7356221675872803e-01 + <_> + + 0 -1 376 -8.1749828532338142e-03 + + -3.0115619301795959e-01 8.1345446407794952e-02 + <_> + + 0 -1 377 -3.8275010883808136e-02 + + 3.8238960504531860e-01 -5.5969979614019394e-02 + <_> + + 0 -1 378 3.2501420937478542e-03 + + -2.1520890295505524e-01 1.3417840003967285e-01 + <_> + + 0 -1 379 5.6356219574809074e-03 + + -9.1598346829414368e-02 2.6930230855941772e-01 + <_> + + 0 -1 380 -5.1177428103983402e-03 + + -3.0092298984527588e-01 1.0440470278263092e-01 + <_> + + 0 -1 381 -6.0195129364728928e-02 + + 1.8512830138206482e-01 -6.3004150986671448e-02 + <_> + + 0 -1 382 4.6473558992147446e-02 + + 3.7559378892183304e-02 -8.1117790937423706e-01 + <_> + + 0 -1 383 2.2262150887399912e-03 + + -1.2262800335884094e-01 8.3288192749023438e-02 + <_> + + 0 -1 384 1.6670780256390572e-02 + + -5.2774429321289062e-02 5.4887998104095459e-01 + <_> + + 0 -1 385 -6.3093528151512146e-02 + + -7.4702072143554688e-01 2.7049509808421135e-02 + <_> + + 0 -1 386 -7.7139958739280701e-04 + + 9.2177063226699829e-02 -2.9994431138038635e-01 + <_> + + 0 -1 387 -8.9107893407344818e-02 + + -3.8937440514564514e-01 2.9831759631633759e-02 + <_> + + 0 -1 388 -1.7469590238761157e-04 + + 1.6117650270462036e-01 -2.0639100670814514e-01 + <_> + + 0 -1 389 -2.1986931096762419e-03 + + 1.4286069571971893e-01 -1.2366549670696259e-01 + <_> + + 0 -1 390 2.1864708978682756e-03 + + -1.7435190081596375e-01 1.6586010158061981e-01 + <_> + + 0 -1 391 1.2738450430333614e-02 + + 4.8340078443288803e-02 -8.1297926604747772e-02 + <_> + + 0 -1 392 -1.2383400462567806e-02 + + -3.7464460730552673e-01 8.1205978989601135e-02 + <_> + + 0 -1 393 -1.2094350159168243e-01 + + -9.1908979415893555e-01 1.7007840797305107e-02 + <_> + + 0 -1 394 4.8902980983257294e-02 + + -7.0619069039821625e-02 5.1363438367843628e-01 + <_> + + 0 -1 395 -1.9585320260375738e-03 + + 9.9808372557163239e-02 -1.0681519657373428e-01 + <_> + + 0 -1 396 -2.9645320773124695e-01 + + -9.1213762760162354e-01 3.2292358577251434e-02 + <_> + + 0 -1 397 1.0741979628801346e-01 + + -2.3814958985894918e-03 -7.1836417913436890e-01 + <_> + + 0 -1 398 -4.2040441185235977e-02 + + 3.0848339200019836e-01 -9.9647372961044312e-02 + <_> + + 0 -1 399 6.8270778283476830e-03 + + 8.3302132785320282e-02 -3.6433839797973633e-01 + <_> + + 0 -1 400 -1.1072089895606041e-02 + + -2.5886499881744385e-01 1.2579409778118134e-01 + <_> + + 0 -1 401 -1.6399029642343521e-02 + + 3.0191990733146667e-01 -4.9352090805768967e-02 + <_> + + 0 -1 402 -2.0852450688835233e-04 + + 1.2508730590343475e-01 -2.1993610262870789e-01 + <_> + + 0 -1 403 -3.0174860730767250e-02 + + -6.5353047847747803e-01 1.0185699909925461e-02 + <_> + + 0 -1 404 -3.9148568175733089e-03 + + -2.0781719684600830e-01 1.2460950016975403e-01 + <_> + + 0 -1 405 -2.7260989882051945e-03 + + 1.2443950027227402e-01 -1.5540640056133270e-01 + <_> + + 0 -1 406 1.7432900145649910e-02 + + -5.9761889278888702e-02 4.9430638551712036e-01 + <_> + 45 + -9.2809242010116577e-01 + + <_> + + 0 -1 407 -2.1454410254955292e-01 + + 5.1646298170089722e-01 -2.2012180089950562e-01 + <_> + + 0 -1 408 1.3796210289001465e-02 + + 5.0541419535875320e-02 -2.3305070400238037e-01 + <_> + + 0 -1 409 9.6883601509034634e-04 + + -2.4793210625648499e-01 2.0536769926548004e-01 + <_> + + 0 -1 410 -6.6670728847384453e-03 + + -2.2546489536762238e-01 6.4493361860513687e-03 + <_> + + 0 -1 411 2.1733778994530439e-03 + + -2.1164029836654663e-01 2.1819859743118286e-01 + <_> + + 0 -1 412 -1.2321940157562494e-03 + + 6.7792296409606934e-02 -1.1661940068006516e-01 + <_> + + 0 -1 413 -5.9950752183794975e-03 + + -4.2384910583496094e-01 1.3204540312290192e-01 + <_> + + 0 -1 414 2.6942830532789230e-02 + + -1.0161910206079483e-01 4.8092079162597656e-01 + <_> + + 0 -1 415 6.6907003521919250e-02 + + -8.4552347660064697e-02 4.9274548888206482e-01 + <_> + + 0 -1 416 -1.6729519702494144e-03 + + 9.2197872698307037e-02 -2.2954310476779938e-01 + <_> + + 0 -1 417 1.3808730058372021e-02 + + -6.0905098915100098e-02 5.8490061759948730e-01 + <_> + + 0 -1 418 -2.3627160117030144e-02 + + -8.8347977399826050e-01 9.7397705540060997e-03 + <_> + + 0 -1 419 -1.3927640393376350e-02 + + -6.5309441089630127e-01 5.2886508405208588e-02 + <_> + + 0 -1 420 3.6122989840805531e-03 + + -2.6369398832321167e-01 1.0595279932022095e-01 + <_> + + 0 -1 421 -5.2949450910091400e-02 + + -7.3409342765808105e-01 4.7014039009809494e-02 + <_> + + 0 -1 422 1.7414819449186325e-02 + + 1.7683740705251694e-02 -5.8782297372817993e-01 + <_> + + 0 -1 423 -3.2427799305878580e-04 + + 1.3886380195617676e-01 -3.0609750747680664e-01 + <_> + + 0 -1 424 -4.3613791465759277e-02 + + 5.4857110977172852e-01 -6.7348852753639221e-02 + <_> + + 0 -1 425 -9.3427510000765324e-04 + + 1.8392640352249146e-01 -1.7492470145225525e-01 + <_> + + 0 -1 426 7.9606421291828156e-02 + + 4.5652151107788086e-02 -6.3910657167434692e-01 + <_> + + 0 -1 427 -2.5120750069618225e-02 + + 1.0046990215778351e-01 -2.7824568748474121e-01 + <_> + + 0 -1 428 3.2976910471916199e-02 + + -5.9311199933290482e-02 6.5328377485275269e-01 + <_> + + 0 -1 429 -3.7845480255782604e-03 + + -2.4190320074558258e-01 1.3097280263900757e-01 + <_> + + 0 -1 430 9.4495685771107674e-03 + + -9.3100033700466156e-02 2.3785820603370667e-01 + <_> + + 0 -1 431 2.5168890133500099e-03 + + 1.3604310154914856e-01 -2.8159540891647339e-01 + <_> + + 0 -1 432 2.6242460589855909e-03 + + 8.9834272861480713e-02 -3.7729039788246155e-01 + <_> + + 0 -1 433 -4.4626198709011078e-02 + + 3.8320839405059814e-01 -9.6285469830036163e-02 + <_> + + 0 -1 434 1.4027470024302602e-04 + + -1.7261759936809540e-01 1.6574309766292572e-01 + <_> + + 0 -1 435 3.9115909487009048e-02 + + 7.8652113676071167e-02 -3.5689839720726013e-01 + <_> + + 0 -1 436 -6.6682003438472748e-02 + + -8.8001507520675659e-01 9.0465601533651352e-03 + <_> + + 0 -1 437 6.3860351219773293e-03 + + -7.5936213135719299e-02 3.8622769713401794e-01 + <_> + + 0 -1 438 4.3549899011850357e-02 + + -2.5680009275674820e-02 7.4085921049118042e-01 + <_> + + 0 -1 439 1.8360930262133479e-03 + + 1.1183869838714600e-01 -3.3362200856208801e-01 + <_> + + 0 -1 440 1.6189280431717634e-03 + + 1.8969060853123665e-02 -1.5130129456520081e-01 + <_> + + 0 -1 441 2.8807038906961679e-03 + + 9.4285592436790466e-02 -3.1100749969482422e-01 + <_> + + 0 -1 442 -3.2489649951457977e-02 + + -2.1908520162105560e-01 1.1370900273323059e-01 + <_> + + 0 -1 443 -3.8253709673881531e-02 + + 3.7908008694648743e-01 -6.8298138678073883e-02 + <_> + + 0 -1 444 -1.8478769809007645e-02 + + 2.9623249173164368e-01 -6.0682911425828934e-02 + <_> + + 0 -1 445 1.5569750219583511e-02 + + 8.5731290280818939e-02 -3.3175340294837952e-01 + <_> + + 0 -1 446 -1.7486449796706438e-03 + + 1.2554299831390381e-01 -1.9797539710998535e-01 + <_> + + 0 -1 447 9.0995557606220245e-02 + + -6.7590013146400452e-02 5.2676147222518921e-01 + <_> + + 0 -1 448 -6.0815969482064247e-03 + + 2.1883159875869751e-01 -1.5794619917869568e-01 + <_> + + 0 -1 449 1.3633850030601025e-02 + + 1.2463530153036118e-01 -2.3396529257297516e-01 + <_> + + 0 -1 450 -3.2046619057655334e-01 + + 4.5808508992195129e-01 -2.7573259547352791e-02 + <_> + + 0 -1 451 -3.6630940157920122e-03 + + -2.4003350734710693e-01 1.2256260216236115e-01 + <_> + 46 + -8.5974782705307007e-01 + + <_> + + 0 -1 452 -1.5901359915733337e-01 + + 4.3535038828849792e-01 -1.7064349353313446e-01 + <_> + + 0 -1 453 -8.1815905869007111e-03 + + -4.6280708909034729e-01 8.8514603674411774e-02 + <_> + + 0 -1 454 -7.1978997766564135e-06 + + 1.6246670484542847e-01 -3.1899040937423706e-01 + <_> + + 0 -1 455 1.4128180220723152e-02 + + 4.3259881436824799e-02 -5.9328877925872803e-01 + <_> + + 0 -1 456 -9.5496661961078644e-03 + + -6.3987672328948975e-01 4.6203929930925369e-02 + <_> + + 0 -1 457 -2.4156800936907530e-03 + + 2.6009899377822876e-01 -1.7099030315876007e-01 + <_> + + 0 -1 458 4.4057718478143215e-03 + + -2.2679199278354645e-01 1.6393969953060150e-01 + <_> + + 0 -1 459 -3.3825438469648361e-02 + + -7.2834062576293945e-01 5.1699958741664886e-02 + <_> + + 0 -1 460 2.9628010466694832e-02 + + 3.4399930387735367e-02 -6.9400608539581299e-01 + <_> + + 0 -1 461 1.2294690310955048e-01 + + 3.3281920477747917e-03 -7.6602149009704590e-01 + <_> + + 0 -1 462 -9.8816171288490295e-02 + + 3.1439980864524841e-01 -1.0131180286407471e-01 + <_> + + 0 -1 463 -3.3952430821955204e-03 + + 3.3362209796905518e-02 -1.3168929517269135e-01 + <_> + + 0 -1 464 2.4586699903011322e-02 + + -6.5227553248405457e-02 6.8169701099395752e-01 + <_> + + 0 -1 465 7.8804800286889076e-03 + + 1.2926100194454193e-01 -4.3783390522003174e-01 + <_> + + 0 -1 466 -9.1016880469396710e-04 + + 1.3692790269851685e-01 -1.9827769696712494e-01 + <_> + + 0 -1 467 1.6178259626030922e-02 + + 9.9287502467632294e-02 -3.4090539813041687e-01 + <_> + + 0 -1 468 -1.0527680069208145e-01 + + -9.1738772392272949e-01 3.2674968242645264e-02 + <_> + + 0 -1 469 -3.7090498954057693e-02 + + 4.2047971487045288e-01 -7.1002766489982605e-02 + <_> + + 0 -1 470 3.8721140474081039e-02 + + -7.3284432291984558e-02 4.8204809427261353e-01 + <_> + + 0 -1 471 -3.4923329949378967e-03 + + -2.8713211417198181e-01 1.0397130250930786e-01 + <_> + + 0 -1 472 -1.1214460246264935e-02 + + -5.1632231473922729e-01 5.4384410381317139e-02 + <_> + + 0 -1 473 -2.2951549908611923e-04 + + -1.6355240345001221e-01 7.7216558158397675e-02 + <_> + + 0 -1 474 2.5744609534740448e-02 + + -5.7303100824356079e-02 4.9525278806686401e-01 + <_> + + 0 -1 475 3.7998620420694351e-02 + + 2.7654580771923065e-02 -4.8470789194107056e-01 + <_> + + 0 -1 476 2.3906941059976816e-03 + + -2.0106680691242218e-01 1.6209079325199127e-01 + <_> + + 0 -1 477 -1.2891319394111633e-01 + + -6.9726997613906860e-01 1.7226759344339371e-02 + <_> + + 0 -1 478 9.4630720559507608e-04 + + -2.7104228734970093e-01 1.0894539952278137e-01 + <_> + + 0 -1 479 3.2807278912514448e-03 + + -4.1949510574340820e-02 8.2179002463817596e-02 + <_> + + 0 -1 480 5.1204498857259750e-02 + + 4.8180408775806427e-02 -6.6344922780990601e-01 + <_> + + 0 -1 481 -4.5751508325338364e-02 + + 1.9350789487361908e-01 -3.7223301827907562e-02 + <_> + + 0 -1 482 1.4391579665243626e-02 + + 1.0828830301761627e-01 -2.3524640500545502e-01 + <_> + + 0 -1 483 -7.6694227755069733e-03 + + 7.7429883182048798e-02 -4.6658441424369812e-02 + <_> + + 0 -1 484 -4.9375209957361221e-02 + + 3.5604238510131836e-01 -8.1731930375099182e-02 + <_> + + 0 -1 485 4.9358978867530823e-02 + + 5.0106838345527649e-02 -5.9273171424865723e-01 + <_> + + 0 -1 486 5.3014289587736130e-02 + + 3.3155430108308792e-02 -7.0783668756484985e-01 + <_> + + 0 -1 487 -1.2086739763617516e-02 + + 1.4943680167198181e-01 -1.8973240256309509e-01 + <_> + + 0 -1 488 -1.3579580187797546e-01 + + 4.5863440632820129e-01 -7.1998342871665955e-02 + <_> + + 0 -1 489 1.9633909687399864e-03 + + -1.0420600324869156e-01 1.8465609848499298e-01 + <_> + + 0 -1 490 9.3589266762137413e-03 + + 5.3957458585500717e-02 -4.7337940335273743e-01 + <_> + + 0 -1 491 4.3361759744584560e-03 + + -5.7173401117324829e-02 5.0958871841430664e-01 + <_> + + 0 -1 492 8.5009206086397171e-03 + + 9.4076819717884064e-02 -2.9265969991683960e-01 + <_> + + 0 -1 493 -1.9089920446276665e-02 + + 3.5426521301269531e-01 -5.5876109749078751e-02 + <_> + + 0 -1 494 -1.6061830101534724e-03 + + 1.6634060442447662e-01 -1.5939429402351379e-01 + <_> + + 0 -1 495 -7.8830653801560402e-03 + + -2.6064670085906982e-01 5.5236898362636566e-02 + <_> + + 0 -1 496 -3.2838371116667986e-03 + + -2.4924349784851074e-01 1.4288279414176941e-01 + <_> + + 0 -1 497 1.9204219803214073e-02 + + -2.6132659986615181e-02 3.2939550280570984e-01 + <_> + 55 + -8.6706262826919556e-01 + + <_> + + 0 -1 498 -1.0141430050134659e-01 + + 4.7197818756103516e-01 -1.8123960494995117e-01 + <_> + + 0 -1 499 -7.6708722114562988e-01 + + 4.3214419484138489e-01 -1.0705640166997910e-01 + <_> + + 0 -1 500 8.0198869109153748e-03 + + 8.4858916699886322e-02 -5.0163632631301880e-01 + <_> + + 0 -1 501 4.2173888534307480e-02 + + 4.3612729758024216e-02 -6.5135252475738525e-01 + <_> + + 0 -1 502 4.0101539343595505e-03 + + -2.4151140451431274e-01 1.7029179632663727e-01 + <_> + + 0 -1 503 -1.3389269588515162e-03 + + -1.8421310186386108e-01 9.2217013239860535e-02 + <_> + + 0 -1 504 3.3321550581604242e-03 + + -1.6709089279174805e-01 1.9239999353885651e-01 + <_> + + 0 -1 505 1.5524900518357754e-03 + + 1.1113339662551880e-01 -3.1200349330902100e-01 + <_> + + 0 -1 506 2.3809259757399559e-02 + + -6.4096599817276001e-02 5.6162089109420776e-01 + <_> + + 0 -1 507 2.8085429221391678e-02 + + -2.2390459477901459e-01 1.6832110285758972e-01 + <_> + + 0 -1 508 -4.7726151533424854e-03 + + -4.6150028705596924e-01 4.9433000385761261e-02 + <_> + + 0 -1 509 1.0531850159168243e-01 + + 3.4683290868997574e-02 -6.4283651113510132e-01 + <_> + + 0 -1 510 -7.2594000957906246e-03 + + -4.0418758988380432e-01 6.0901068150997162e-02 + <_> + + 0 -1 511 8.7005542591214180e-03 + + -7.5832478702068329e-02 8.9484892785549164e-02 + <_> + + 0 -1 512 -5.3671520203351974e-02 + + 7.3710972070693970e-01 -4.0993150323629379e-02 + <_> + + 0 -1 513 3.4521210938692093e-02 + + -1.3731540180742741e-02 2.7299648523330688e-01 + <_> + + 0 -1 514 -7.2156880050897598e-03 + + 1.2723149359226227e-01 -2.3329609632492065e-01 + <_> + + 0 -1 515 1.7666360363364220e-03 + + 5.7977691292762756e-02 -2.0036549866199493e-01 + <_> + + 0 -1 516 3.8101759273558855e-03 + + 7.3866911232471466e-02 -3.0780071020126343e-01 + <_> + + 0 -1 517 -2.5019630789756775e-02 + + 4.3502670526504517e-01 -4.8294428735971451e-02 + <_> + + 0 -1 518 9.7328815609216690e-03 + + -8.3063952624797821e-02 3.0008700489997864e-01 + <_> + + 0 -1 519 -3.3074519596993923e-03 + + 1.3591299951076508e-01 -2.2476670145988464e-01 + <_> + + 0 -1 520 -1.9178609549999237e-01 + + -8.7936902046203613e-01 2.7915079146623611e-02 + <_> + + 0 -1 521 6.0892169130966067e-04 + + -2.2891379892826080e-01 1.0236170142889023e-01 + <_> + + 0 -1 522 -7.7072591520845890e-03 + + -2.4917750060558319e-01 9.4315156340599060e-02 + <_> + + 0 -1 523 -1.0916110128164291e-01 + + 5.5664068460464478e-01 -4.7419041395187378e-02 + <_> + + 0 -1 524 -6.3703782856464386e-02 + + -2.1503069996833801e-01 1.0655879974365234e-01 + <_> + + 0 -1 525 -2.6704160496592522e-02 + + 3.3017820119857788e-01 -9.3569032847881317e-02 + <_> + + 0 -1 526 -2.7289129793643951e-03 + + 8.6531341075897217e-02 -2.6623091101646423e-01 + <_> + + 0 -1 527 -1.0575050115585327e-01 + + -1. 5.9039499610662460e-03 + <_> + + 0 -1 528 1.8904829397797585e-02 + + -6.2077309936285019e-02 4.7796338796615601e-01 + <_> + + 0 -1 529 -1.6396720707416534e-01 + + -1. 1.0493510402739048e-02 + <_> + + 0 -1 530 1.0453710332512856e-02 + + 1.2688960134983063e-01 -2.0351530611515045e-01 + <_> + + 0 -1 531 1.3724270462989807e-01 + + 9.6491426229476929e-03 -3.7908729910850525e-01 + <_> + + 0 -1 532 -5.0359591841697693e-03 + + -2.5936231017112732e-01 1.1745890229940414e-01 + <_> + + 0 -1 533 6.5677291713654995e-03 + + -6.0465291142463684e-02 1.5637819468975067e-01 + <_> + + 0 -1 534 -3.0346989631652832e-02 + + 3.8403400778770447e-01 -6.1477359384298325e-02 + <_> + + 0 -1 535 1.7546329647302628e-02 + + 2.8643229976296425e-02 -4.7679468989372253e-01 + <_> + + 0 -1 536 -4.5566740445792675e-03 + + -3.1261089444160461e-01 1.0885629802942276e-01 + <_> + + 0 -1 537 -6.9851092994213104e-02 + + -7.0994102954864502e-01 1.8536770716309547e-02 + <_> + + 0 -1 538 -1.4962710338295437e-05 + + 1.0287140309810638e-01 -2.2921159863471985e-01 + <_> + + 0 -1 539 -7.2705000638961792e-02 + + 4.2520120739936829e-01 -2.8236340731382370e-02 + <_> + + 0 -1 540 3.7338290363550186e-02 + + -7.6630033552646637e-02 3.2374149560928345e-01 + <_> + + 0 -1 541 2.8690960258245468e-02 + + 3.0029499903321266e-02 -8.4007978439331055e-01 + <_> + + 0 -1 542 1.0019769892096519e-02 + + -7.9071857035160065e-02 3.4019070863723755e-01 + <_> + + 0 -1 543 -3.9540659636259079e-03 + + -2.4449679255485535e-01 1.1845660209655762e-01 + <_> + + 0 -1 544 -8.2879550755023956e-03 + + 1.0628750175237656e-01 -2.2044150531291962e-01 + <_> + + 0 -1 545 -3.4582480788230896e-02 + + -7.1333628892898560e-01 2.9727920889854431e-02 + <_> + + 0 -1 546 -1.4701869804412127e-03 + + 1.2630669772624969e-01 -1.8260860443115234e-01 + <_> + + 0 -1 547 -1.8792560324072838e-02 + + 4.4159510731697083e-01 -6.2980100512504578e-02 + <_> + + 0 -1 548 -1.9830280914902687e-02 + + -2.8308698534965515e-01 9.2180028557777405e-02 + <_> + + 0 -1 549 -1.6321459412574768e-01 + + -4.1355830430984497e-01 1.1562050320208073e-02 + <_> + + 0 -1 550 7.5624987483024597e-02 + + 2.2105440497398376e-02 -9.1430252790451050e-01 + <_> + + 0 -1 551 -2.2491789422929287e-03 + + 9.1926686465740204e-02 -1.0633769631385803e-01 + <_> + + 0 -1 552 -6.3310638070106506e-02 + + -7.7100628614425659e-01 2.7047479525208473e-02 + <_> + 60 + -8.9544051885604858e-01 + + <_> + + 0 -1 553 -1.7043270170688629e-01 + + 4.7425061464309692e-01 -1.8581479787826538e-01 + <_> + + 0 -1 554 2.7967130765318871e-02 + + -8.6291179060935974e-02 5.3257989883422852e-01 + <_> + + 0 -1 555 2.0941249385941774e-04 + + -2.7199700474739075e-01 1.3615070283412933e-01 + <_> + + 0 -1 556 -3.3637240529060364e-02 + + 2.8299760818481445e-01 -2.2356469184160233e-02 + <_> + + 0 -1 557 -4.5356429181993008e-03 + + 1.6135759651660919e-01 -2.0162500441074371e-01 + <_> + + 0 -1 558 3.3124668989330530e-03 + + -7.9677619040012360e-02 1.4375239610671997e-01 + <_> + + 0 -1 559 -5.4888740181922913e-02 + + 6.6563862562179565e-01 -5.3526669740676880e-02 + <_> + + 0 -1 560 5.3796600550413132e-03 + + -9.6400886774063110e-02 9.3223050236701965e-02 + <_> + + 0 -1 561 -6.0283239930868149e-02 + + -5.4325622320175171e-01 5.4515969008207321e-02 + <_> + + 0 -1 562 8.4590855985879898e-03 + + 5.0189521163702011e-02 -3.7638399004936218e-01 + <_> + + 0 -1 563 2.8549430426210165e-03 + + 1.3105809688568115e-01 -2.4903079867362976e-01 + <_> + + 0 -1 564 -2.0608250051736832e-02 + + -4.3393260240554810e-01 6.0918930917978287e-02 + <_> + + 0 -1 565 -1.0088419541716576e-02 + + 2.9433688521385193e-01 -1.0092660039663315e-01 + <_> + + 0 -1 566 -5.9431340545415878e-02 + + -9.0102052688598633e-01 2.7330689132213593e-02 + <_> + + 0 -1 567 -2.4024050217121840e-03 + + 1.2758029997348785e-01 -1.9134059548377991e-01 + <_> + + 0 -1 568 -2.7372820302844048e-02 + + -2.8051578998565674e-01 1.0892979800701141e-01 + <_> + + 0 -1 569 -7.3817551136016846e-02 + + 3.6636620759963989e-01 -7.1261473000049591e-02 + <_> + + 0 -1 570 -6.9365866482257843e-02 + + 4.4759741425514221e-01 -3.5112198442220688e-02 + <_> + + 0 -1 571 -1.2530760141089559e-03 + + 1.0481069982051849e-01 -2.5331568717956543e-01 + <_> + + 0 -1 572 -3.2429681159555912e-03 + + -2.1083809435367584e-01 8.9755013585090637e-02 + <_> + + 0 -1 573 1.6115259379148483e-02 + + -5.8019161224365234e-02 5.5759441852569580e-01 + <_> + + 0 -1 574 6.2562932725995779e-04 + + -2.1611200273036957e-01 1.2215120345354080e-01 + <_> + + 0 -1 575 -7.6641827821731567e-01 + + -6.3647639751434326e-01 3.3915121108293533e-02 + <_> + + 0 -1 576 -7.4419458542251959e-06 + + 9.5346711575984955e-02 -2.3950740694999695e-01 + <_> + + 0 -1 577 -3.7739300751127303e-04 + + 1.4481280744075775e-01 -1.8476490676403046e-01 + <_> + + 0 -1 578 7.6729603111743927e-02 + + 1.1742720380425453e-02 -9.6213918924331665e-01 + <_> + + 0 -1 579 -4.4697099365293980e-03 + + -2.3385390639305115e-01 1.0464339703321457e-01 + <_> + + 0 -1 580 7.5911812484264374e-02 + + 6.7219119518995285e-03 -4.2311188578605652e-01 + <_> + + 0 -1 581 -8.3202589303255081e-03 + + 3.2122060656547546e-01 -8.3661839365959167e-02 + <_> + + 0 -1 582 -3.7233818322420120e-02 + + 1.1662390083074570e-01 -2.3976010084152222e-01 + <_> + + 0 -1 583 -2.1381198894232512e-03 + + 8.4755808115005493e-02 -2.5149530172348022e-01 + <_> + + 0 -1 584 -4.4315438717603683e-03 + + -1.0990399867296219e-01 6.6713362932205200e-02 + <_> + + 0 -1 585 -1.0959600098431110e-02 + + 2.8818470239639282e-01 -7.7696867287158966e-02 + <_> + + 0 -1 586 3.4907169640064240e-02 + + -1.1712339706718922e-02 3.9965820312500000e-01 + <_> + + 0 -1 587 -1.3335079886019230e-02 + + -4.9896249175071716e-01 5.3193040192127228e-02 + <_> + + 0 -1 588 -3.7070110440254211e-02 + + -5.9346628189086914e-01 1.2502389959990978e-02 + <_> + + 0 -1 589 -9.1118857264518738e-02 + + -6.0664188861846924e-01 3.0223639681935310e-02 + <_> + + 0 -1 590 -6.7527957260608673e-02 + + 3.2593071460723877e-01 -3.2810360193252563e-02 + <_> + + 0 -1 591 -2.6317719370126724e-02 + + -7.6599878072738647e-01 2.5263689458370209e-02 + <_> + + 0 -1 592 3.7877839058637619e-02 + + 1.7415969632565975e-03 -9.1090667247772217e-01 + <_> + + 0 -1 593 1.6833839472383261e-03 + + -6.4769007265567780e-02 3.5946249961853027e-01 + <_> + + 0 -1 594 -4.2451170884305611e-05 + + 6.2228899449110031e-02 -8.5069350898265839e-02 + <_> + + 0 -1 595 2.7713281451724470e-04 + + -1.7252549529075623e-01 1.2511169910430908e-01 + <_> + + 0 -1 596 -3.0400960240513086e-03 + + 1.5032739937305450e-01 -1.4423249661922455e-01 + <_> + + 0 -1 597 -5.4823148995637894e-02 + + 3.4711471199989319e-01 -6.3294216990470886e-02 + <_> + + 0 -1 598 1.4232549583539367e-03 + + 7.3755688965320587e-02 -2.7084198594093323e-01 + <_> + + 0 -1 599 -3.3660030458122492e-03 + + -2.3144030570983887e-01 8.8216871023178101e-02 + <_> + + 0 -1 600 -1.1405759723857045e-03 + + 1.5687429904937744e-01 -1.3379560410976410e-01 + <_> + + 0 -1 601 3.7445020861923695e-03 + + -1.2132400274276733e-01 2.2723269462585449e-01 + <_> + + 0 -1 602 1.6585510224103928e-02 + + 5.4631579667329788e-02 -1.0117000341415405e-01 + <_> + + 0 -1 603 -2.9970710165798664e-03 + + 1.7258630692958832e-01 -1.4288370311260223e-01 + <_> + + 0 -1 604 -3.0509869102388620e-03 + + 1.0889530181884766e-01 -1.2865459918975830e-01 + <_> + + 0 -1 605 -2.7037179097533226e-02 + + -2.1809040009975433e-01 1.0335580259561539e-01 + <_> + + 0 -1 606 -1.4020490460097790e-02 + + 1.7013829946517944e-01 -4.6483799815177917e-02 + <_> + + 0 -1 607 4.0001110173761845e-03 + + 6.1452940106391907e-02 -3.5107728838920593e-01 + <_> + + 0 -1 608 1.1888570152223110e-02 + + -6.5659493207931519e-02 3.4128171205520630e-01 + <_> + + 0 -1 609 1.0041910223662853e-02 + + 1.0645069926977158e-01 -2.3905399441719055e-01 + <_> + + 0 -1 610 -8.3469128003343940e-04 + + 1.1359920352697372e-01 -1.2456230074167252e-01 + <_> + + 0 -1 611 -8.4286198019981384e-02 + + 4.4472348690032959e-01 -4.6677689999341965e-02 + <_> + + 0 -1 612 -1.2084700167179108e-02 + + -3.1389999389648438e-01 8.1864818930625916e-02 + <_> + 69 + -8.5815817117691040e-01 + + <_> + + 0 -1 613 -6.6878342628479004e-01 + + 4.1411510109901428e-01 -1.8810300529003143e-01 + <_> + + 0 -1 614 3.4350738860666752e-04 + + -1.5680180490016937e-01 1.0782240331172943e-01 + <_> + + 0 -1 615 2.6565280277282000e-03 + + -2.2030730545520782e-01 2.1439610421657562e-01 + <_> + + 0 -1 616 -1.9296359270811081e-02 + + 4.2026680707931519e-01 -6.8671546876430511e-02 + <_> + + 0 -1 617 -6.6540208645164967e-03 + + -2.3488819599151611e-01 1.6749989986419678e-01 + <_> + + 0 -1 618 1.5521990135312080e-02 + + 1.9785670563578606e-02 -3.9180341362953186e-01 + <_> + + 0 -1 619 8.0317907035350800e-02 + + -1.9278699532151222e-02 5.8520817756652832e-01 + <_> + + 0 -1 620 -1.0220059752464294e-01 + + -8.1461167335510254e-01 8.9545976370573044e-03 + <_> + + 0 -1 621 -1.0618870146572590e-02 + + 1.8044769763946533e-01 -2.1122869849205017e-01 + <_> + + 0 -1 622 9.8658069968223572e-02 + + -4.9179349094629288e-02 2.1871259808540344e-01 + <_> + + 0 -1 623 -6.6758222877979279e-02 + + -2.6649540662765503e-01 1.0707940161228180e-01 + <_> + + 0 -1 624 -2.9256459325551987e-02 + + -7.8809207677841187e-01 5.6176739744842052e-03 + <_> + + 0 -1 625 -1.2126189656555653e-02 + + 1.0218500345945358e-01 -2.2899429500102997e-01 + <_> + + 0 -1 626 -5.4919619113206863e-02 + + -5.3647202253341675e-01 1.4213330112397671e-02 + <_> + + 0 -1 627 -4.0985811501741409e-03 + + -3.1650361418724060e-01 7.6794192194938660e-02 + <_> + + 0 -1 628 -6.2581077218055725e-02 + + -4.8726239800453186e-01 9.1610476374626160e-03 + <_> + + 0 -1 629 4.9834471195936203e-02 + + -7.5687482953071594e-02 2.9998108744621277e-01 + <_> + + 0 -1 630 1.0333029925823212e-01 + + 3.3387999981641769e-02 -5.6652718782424927e-01 + <_> + + 0 -1 631 -2.6153959333896637e-02 + + 4.4663658738136292e-01 -5.7146150618791580e-02 + <_> + + 0 -1 632 6.8949297070503235e-02 + + 6.6676470451056957e-03 -9.9968850612640381e-01 + <_> + + 0 -1 633 2.1299200598150492e-03 + + -1.8253549933433533e-01 1.2543450295925140e-01 + <_> + + 0 -1 634 -4.4991839677095413e-02 + + -5.6401151418685913e-01 3.7286750972270966e-02 + <_> + + 0 -1 635 2.2533860057592392e-02 + + -4.2648501694202423e-02 5.9839051961898804e-01 + <_> + + 0 -1 636 1.9274459779262543e-01 + + 3.0479490756988525e-02 -8.4564548730850220e-01 + <_> + + 0 -1 637 -9.2559499898925424e-04 + + -2.0614519715309143e-01 1.1016649752855301e-01 + <_> + + 0 -1 638 -3.6584408953785896e-03 + + 9.1432936489582062e-02 -8.2888223230838776e-02 + <_> + + 0 -1 639 3.3741090446710587e-03 + + 8.0734901130199432e-02 -3.0495160818099976e-01 + <_> + + 0 -1 640 -5.1757801324129105e-02 + + -8.0067127943038940e-01 2.8978339396417141e-03 + <_> + + 0 -1 641 1.0498389601707458e-03 + + -1.8396970629692078e-01 1.3429929316043854e-01 + <_> + + 0 -1 642 7.5232777744531631e-03 + + -3.1206240877509117e-02 1.2124940007925034e-01 + <_> + + 0 -1 643 -7.1075286541599780e-05 + + 8.4017656743526459e-02 -2.5043961405754089e-01 + <_> + + 0 -1 644 1.1362830176949501e-02 + + -7.6280519366264343e-02 2.0559790730476379e-01 + <_> + + 0 -1 645 -2.4097480345517397e-03 + + -1.5042850375175476e-01 1.6493639349937439e-01 + <_> + + 0 -1 646 2.4056989699602127e-02 + + 1.4566550031304359e-02 -9.0886771678924561e-01 + <_> + + 0 -1 647 -2.3983620107173920e-02 + + 3.9107671380043030e-01 -5.4178200662136078e-02 + <_> + + 0 -1 648 -2.1438319236040115e-02 + + -4.8545840382575989e-01 4.0402751415967941e-02 + <_> + + 0 -1 649 1.5210740268230438e-02 + + 3.4481588751077652e-02 -5.4406332969665527e-01 + <_> + + 0 -1 650 1.1712989769876003e-02 + + -6.5206751227378845e-02 4.1007021069526672e-01 + <_> + + 0 -1 651 6.3996820244938135e-04 + + -1.4772899448871613e-01 1.5154249966144562e-01 + <_> + + 0 -1 652 -3.4567480906844139e-03 + + 6.3351117074489594e-02 -1.4297829568386078e-01 + <_> + + 0 -1 653 -1.2475489638745785e-03 + + -1.8521060049533844e-01 1.3410830497741699e-01 + <_> + + 0 -1 654 6.6904430277645588e-03 + + 1.4112530648708344e-01 -1.8778939545154572e-01 + <_> + + 0 -1 655 -6.9181032478809357e-02 + + 3.4451478719711304e-01 -8.4655232727527618e-02 + <_> + + 0 -1 656 -6.7893281579017639e-02 + + -7.0076942443847656e-01 2.3327259346842766e-02 + <_> + + 0 -1 657 -8.5538747953251004e-04 + + 9.2393256723880768e-02 -2.1416470408439636e-01 + <_> + + 0 -1 658 1.7967769503593445e-01 + + 2.9103670269250870e-02 -7.8690862655639648e-01 + <_> + + 0 -1 659 -2.9843579977750778e-03 + + 1.6117380559444427e-01 -1.2868699431419373e-01 + <_> + + 0 -1 660 1.9973449409008026e-02 + + 3.6350231617689133e-02 -5.9400641918182373e-01 + <_> + + 0 -1 661 -8.3998020272701979e-04 + + 1.1332140117883682e-01 -1.9175720214843750e-01 + <_> + + 0 -1 662 5.0804121419787407e-03 + + 5.3663559257984161e-02 -2.7940011024475098e-01 + <_> + + 0 -1 663 7.3341121897101402e-03 + + -1.6792379319667816e-01 1.2119220197200775e-01 + <_> + + 0 -1 664 7.6924441382288933e-03 + + -6.9076187908649445e-02 1.8550349771976471e-01 + <_> + + 0 -1 665 2.0062309340573847e-04 + + -2.0654049515724182e-01 9.7337253391742706e-02 + <_> + + 0 -1 666 2.6919560506939888e-02 + + -2.3648599162697792e-02 6.4873528480529785e-01 + <_> + + 0 -1 667 -2.7951570227742195e-03 + + -2.0725600421428680e-01 1.0188090056180954e-01 + <_> + + 0 -1 668 7.8026622533798218e-02 + + 8.9439805597066879e-03 -3.9990609884262085e-01 + <_> + + 0 -1 669 -1.0000459849834442e-01 + + 3.7361750006675720e-01 -5.5814821273088455e-02 + <_> + + 0 -1 670 -1.4978240430355072e-01 + + 3.8677608966827393e-01 -5.5641401559114456e-02 + <_> + + 0 -1 671 3.3566348254680634e-02 + + 7.5311936438083649e-02 -3.2007390260696411e-01 + <_> + + 0 -1 672 -2.1213890612125397e-01 + + -5.9270721673965454e-01 4.9450621008872986e-03 + <_> + + 0 -1 673 -1.4402889646589756e-02 + + 3.2471069693565369e-01 -5.8492168784141541e-02 + <_> + + 0 -1 674 -1.8413169309496880e-02 + + -9.6801750361919403e-02 1.0343659669160843e-01 + <_> + + 0 -1 675 1.6228349879384041e-02 + + -6.0577668249607086e-02 3.1738010048866272e-01 + <_> + + 0 -1 676 -6.7683439701795578e-03 + + -1.9742150604724884e-01 2.7996420860290527e-02 + <_> + + 0 -1 677 -1.9165309146046638e-02 + + -2.5684070587158203e-01 8.3432748913764954e-02 + <_> + + 0 -1 678 2.8667549486272037e-04 + + -1.5241080522537231e-01 1.4404779672622681e-01 + <_> + + 0 -1 679 9.4157401472330093e-03 + + -7.3207639157772064e-02 3.3655610680580139e-01 + <_> + + 0 -1 680 2.3321900516748428e-02 + + -6.1898268759250641e-02 8.3489909768104553e-02 + <_> + + 0 -1 681 -1.1910670436918736e-02 + + -1.9628530740737915e-01 9.6807330846786499e-02 + <_> + 63 + -7.2787708044052124e-01 + + <_> + + 0 -1 682 -9.4191312789916992e-02 + + 4.7028279304504395e-01 -1.4449509978294373e-01 + <_> + + 0 -1 683 -6.9314462598413229e-04 + + 1.7749489843845367e-01 -1.8127989768981934e-01 + <_> + + 0 -1 684 -1.2782390415668488e-01 + + 2.9733940958976746e-01 -1.0098580271005630e-01 + <_> + + 0 -1 685 -2.5297680404037237e-03 + + 1.0854879766702652e-01 -1.3471469283103943e-01 + <_> + + 0 -1 686 -2.5406670756638050e-03 + + -2.7025818824768066e-01 1.0289029777050018e-01 + <_> + + 0 -1 687 -1.5717690112069249e-03 + + 1.7058460414409637e-01 -1.0923519730567932e-01 + <_> + + 0 -1 688 1.4790190383791924e-02 + + 2.3690680041909218e-02 -5.1412177085876465e-01 + <_> + + 0 -1 689 -1.1837840080261230e-02 + + 1.5754750370979309e-01 -2.7252310886979103e-02 + <_> + + 0 -1 690 -3.8180808769538999e-04 + + 1.0274309664964676e-01 -2.1815380454063416e-01 + <_> + + 0 -1 691 5.0768889486789703e-02 + + 7.3335068300366402e-03 -8.5053902864456177e-01 + <_> + + 0 -1 692 2.2738629952073097e-02 + + -4.3974649161100388e-02 5.0167572498321533e-01 + <_> + + 0 -1 693 7.3323072865605354e-04 + + -9.8431721329689026e-02 1.1515360325574875e-01 + <_> + + 0 -1 694 1.1889509623870254e-03 + + -2.2443179786205292e-01 1.0813289880752563e-01 + <_> + + 0 -1 695 -3.2934029586613178e-03 + + 7.1840867400169373e-02 -8.0868020653724670e-02 + <_> + + 0 -1 696 -3.0113169923424721e-03 + + -2.9698678851127625e-01 7.9700268805027008e-02 + <_> + + 0 -1 697 -1.5521480236202478e-03 + + 1.8694180250167847e-01 -1.1467470228672028e-01 + <_> + + 0 -1 698 -1.0300680063664913e-02 + + -2.9109370708465576e-01 6.7836336791515350e-02 + <_> + + 0 -1 699 -2.6368349790573120e-03 + + 1.1284109950065613e-01 -7.3468528687953949e-02 + <_> + + 0 -1 700 -3.2815459417179227e-04 + + 8.1921890377998352e-02 -2.4893359839916229e-01 + <_> + + 0 -1 701 -3.4514568746089935e-02 + + 4.2230990529060364e-01 -3.4608390182256699e-02 + <_> + + 0 -1 702 2.1102999744471163e-04 + + -1.9479750096797943e-01 1.1572039872407913e-01 + <_> + + 0 -1 703 -4.4254157692193985e-03 + + -1.9316120445728302e-01 5.8137431740760803e-02 + <_> + + 0 -1 704 -1.7686230130493641e-03 + + -1.7518809437751770e-01 1.4515039324760437e-01 + <_> + + 0 -1 705 -3.3355921041220427e-03 + + 2.2621470689773560e-01 -1.0195499658584595e-01 + <_> + + 0 -1 706 4.5241121202707291e-02 + + 3.3572640269994736e-02 -6.6535997390747070e-01 + <_> + + 0 -1 707 -2.7708040550351143e-02 + + -4.7514501214027405e-01 1.6605619341135025e-02 + <_> + + 0 -1 708 -6.0042630881071091e-02 + + 2.7002659440040588e-01 -7.5283601880073547e-02 + <_> + + 0 -1 709 9.3657420948147774e-03 + + -5.2090760320425034e-02 3.4359771013259888e-01 + <_> + + 0 -1 710 2.2545119747519493e-02 + + 4.5823760330677032e-02 -5.3111177682876587e-01 + <_> + + 0 -1 711 -6.6756099462509155e-02 + + 5.1867592334747314e-01 -1.0766089893877506e-02 + <_> + + 0 -1 712 4.3578571639955044e-03 + + -1.6680300235748291e-01 1.3410590589046478e-01 + <_> + + 0 -1 713 -3.6338180303573608e-02 + + -5.4825192689895630e-01 1.8291600048542023e-02 + <_> + + 0 -1 714 -4.5509558171033859e-02 + + 3.9119181036949158e-01 -5.4338268935680389e-02 + <_> + + 0 -1 715 6.2883161008358002e-03 + + 9.5495186746120453e-02 -2.4893720448017120e-01 + <_> + + 0 -1 716 1.5809159958735108e-03 + + -1.6792270541191101e-01 1.1553759872913361e-01 + <_> + + 0 -1 717 -1.5780210494995117e-01 + + -6.9598740339279175e-01 3.1015299260616302e-02 + <_> + + 0 -1 718 -5.0400748848915100e-02 + + -6.1013418436050415e-01 2.5600189343094826e-02 + <_> + + 0 -1 719 -8.3708087913691998e-04 + + 6.3689701259136200e-02 -3.2572910189628601e-01 + <_> + + 0 -1 720 5.2259840071201324e-02 + + -5.2639529109001160e-02 4.3018800020217896e-01 + <_> + + 0 -1 721 6.6796218743547797e-04 + + 8.0761440098285675e-02 -2.5092118978500366e-01 + <_> + + 0 -1 722 -3.6306399852037430e-02 + + 7.2837859392166138e-01 -2.8703549876809120e-02 + <_> + + 0 -1 723 -7.5823411345481873e-02 + + -7.6045262813568115e-01 1.3166300021111965e-02 + <_> + + 0 -1 724 -5.5567082017660141e-03 + + 1.1258409917354584e-01 -1.9850979745388031e-01 + <_> + + 0 -1 725 3.1275521032512188e-03 + + -1.0436189919710159e-01 1.0283000022172928e-01 + <_> + + 0 -1 726 2.7931319549679756e-02 + + 4.7023560851812363e-02 -4.7727531194686890e-01 + <_> + + 0 -1 727 1.5156970359385014e-02 + + -4.9909379333257675e-02 2.1705010533332825e-01 + <_> + + 0 -1 728 6.8009081296622753e-03 + + 1.1713290214538574e-01 -2.2082920372486115e-01 + <_> + + 0 -1 729 -4.3796948157250881e-03 + + 1.7191199958324432e-01 -8.9668810367584229e-02 + <_> + + 0 -1 730 -6.9269728846848011e-03 + + 8.8258482515811920e-02 -2.6454809308052063e-01 + <_> + + 0 -1 731 -2.0586250722408295e-01 + + -5.0262999534606934e-01 4.0832251310348511e-02 + <_> + + 0 -1 732 -1.1398729839129373e-04 + + 1.0535170137882233e-01 -1.9488720595836639e-01 + <_> + + 0 -1 733 3.6993779242038727e-02 + + -5.4779630154371262e-02 2.2932989895343781e-01 + <_> + + 0 -1 734 4.7788480296730995e-03 + + 9.1294333338737488e-02 -2.4968950450420380e-01 + <_> + + 0 -1 735 1.1999059934169054e-03 + + -9.2685289680957794e-02 1.1050710082054138e-01 + <_> + + 0 -1 736 2.0830740686506033e-03 + + -1.0583080351352692e-01 1.7405270040035248e-01 + <_> + + 0 -1 737 2.7166489511728287e-02 + + 1.1538780294358730e-02 -1.0000569820404053e+00 + <_> + + 0 -1 738 -4.3531907722353935e-03 + + -2.6105979084968567e-01 7.8109443187713623e-02 + <_> + + 0 -1 739 -1.6676170751452446e-02 + + -6.3766658306121826e-01 1.2807319872081280e-02 + <_> + + 0 -1 740 -1.7588710179552436e-03 + + 1.5328720211982727e-01 -1.4830219745635986e-01 + <_> + + 0 -1 741 -1.3470610138028860e-03 + + 1.1022730171680450e-01 -1.1166580021381378e-01 + <_> + + 0 -1 742 -7.7226730063557625e-03 + + 2.6749759912490845e-01 -8.4375701844692230e-02 + <_> + + 0 -1 743 2.4557989090681076e-02 + + 1.1705229990184307e-02 -6.9936311244964600e-01 + <_> + + 0 -1 744 -4.1882451623678207e-03 + + -2.0845660567283630e-01 1.1073870211839676e-01 + <_> + 67 + -7.7944219112396240e-01 + + <_> + + 0 -1 745 -3.0925211310386658e-01 + + 3.1520840525627136e-01 -1.6629250347614288e-01 + <_> + + 0 -1 746 3.8660250604152679e-02 + + -5.7934600859880447e-02 4.5278790593147278e-01 + <_> + + 0 -1 747 -1.8853870034217834e-01 + + -8.2013928890228271e-01 3.0941359698772430e-02 + <_> + + 0 -1 748 7.1423681220039725e-04 + + 1.0280930250883102e-01 -2.4902869760990143e-01 + <_> + + 0 -1 749 -7.2074443101882935e-02 + + 3.3171579241752625e-01 -7.3685511946678162e-02 + <_> + + 0 -1 750 9.4616664573550224e-03 + + 3.2647788524627686e-02 -3.6112511157989502e-01 + <_> + + 0 -1 751 -4.6513080596923828e-02 + + -4.7550851106643677e-01 5.6877400726079941e-02 + <_> + + 0 -1 752 -3.4777458757162094e-02 + + -6.3515567779541016e-01 3.1314119696617126e-02 + <_> + + 0 -1 753 -1.4840300427749753e-03 + + 9.2628233134746552e-02 -2.5283080339431763e-01 + <_> + + 0 -1 754 8.3039281889796257e-03 + + 3.3991388976573944e-02 -1.8357479572296143e-01 + <_> + + 0 -1 755 2.7342209592461586e-02 + + -5.1393941044807434e-02 5.5958998203277588e-01 + <_> + + 0 -1 756 5.8637421578168869e-02 + + -5.7350661605596542e-02 1.4842259883880615e-01 + <_> + + 0 -1 757 -3.7032511085271835e-02 + + -4.0602868795394897e-01 6.6790133714675903e-02 + <_> + + 0 -1 758 8.9913606643676758e-03 + + -1.9094319641590118e-01 5.9438090771436691e-02 + <_> + + 0 -1 759 -5.9351198375225067e-02 + + -8.7097257375717163e-01 2.1483449265360832e-02 + <_> + + 0 -1 760 3.7055540084838867e-01 + + -4.0396090596914291e-02 6.0631322860717773e-01 + <_> + + 0 -1 761 -8.4517069626599550e-04 + + 1.3660719990730286e-01 -1.5541790425777435e-01 + <_> + + 0 -1 762 1.0664479807019234e-02 + + 3.4129761159420013e-02 -2.3508089780807495e-01 + <_> + + 0 -1 763 3.7040449678897858e-03 + + 1.1293920129537582e-01 -1.5596470236778259e-01 + <_> + + 0 -1 764 2.3328550159931183e-02 + + 3.6770980805158615e-02 -1.6631129384040833e-01 + <_> + + 0 -1 765 2.0906640216708183e-02 + + -7.3391966521739960e-02 3.2708668708801270e-01 + <_> + + 0 -1 766 2.0865180995315313e-03 + + 9.6375763416290283e-02 -2.1638840436935425e-01 + <_> + + 0 -1 767 1.2039430439472198e-03 + + -1.7018699645996094e-01 1.0815030336380005e-01 + <_> + + 0 -1 768 3.3848760649561882e-03 + + -1.0820890218019485e-01 9.0751953423023224e-02 + <_> + + 0 -1 769 -1.5309279784560204e-02 + + -6.2071442604064941e-01 3.1353730708360672e-02 + <_> + + 0 -1 770 2.1820720285177231e-02 + + -5.7232249528169632e-02 2.9141768813133240e-01 + <_> + + 0 -1 771 5.8554150164127350e-03 + + 5.5810708552598953e-02 -3.4557789564132690e-01 + <_> + + 0 -1 772 -8.8380590081214905e-02 + + -5.8971607685089111e-01 3.2257869839668274e-02 + <_> + + 0 -1 773 -3.6303598433732986e-02 + + 6.7906290292739868e-01 -3.1298439949750900e-02 + <_> + + 0 -1 774 6.7714422941207886e-02 + + 2.8151830658316612e-02 -7.5963890552520752e-01 + <_> + + 0 -1 775 -1.7487880541011691e-03 + + 1.3521270453929901e-01 -1.4939880371093750e-01 + <_> + + 0 -1 776 5.7627420872449875e-02 + + 1.4716790057718754e-02 -6.4088898897171021e-01 + <_> + + 0 -1 777 4.8004398122429848e-03 + + 5.7510860264301300e-02 -3.0728340148925781e-01 + <_> + + 0 -1 778 1.5568589791655540e-02 + + -2.6860829442739487e-02 3.9390829205513000e-01 + <_> + + 0 -1 779 -9.9650640040636063e-03 + + 3.2090151309967041e-01 -5.8974441140890121e-02 + <_> + + 0 -1 780 -9.1902203857898712e-03 + + -3.8006910681724548e-01 3.5807169973850250e-02 + <_> + + 0 -1 781 3.0834939330816269e-02 + + 4.0354121476411819e-02 -5.0782901048660278e-01 + <_> + + 0 -1 782 -6.4900278812274337e-04 + + 9.5597133040428162e-02 -1.8812850117683411e-01 + <_> + + 0 -1 783 -3.9334357716143131e-03 + + -2.0279949903488159e-01 1.0514850169420242e-01 + <_> + + 0 -1 784 -2.1477680653333664e-02 + + -3.2985571026802063e-01 3.5263378173112869e-02 + <_> + + 0 -1 785 -2.7516249567270279e-02 + + 3.4558650851249695e-01 -7.2544910013675690e-02 + <_> + + 0 -1 786 -7.2914459742605686e-03 + + 1.0051680356264114e-01 -1.3560770452022552e-01 + <_> + + 0 -1 787 -5.6135728955268860e-02 + + 4.0078470110893250e-01 -5.1991838961839676e-02 + <_> + + 0 -1 788 1.3679620623588562e-01 + + -1.6432780772447586e-02 5.6100088357925415e-01 + <_> + + 0 -1 789 -2.4549920111894608e-02 + + -1.8187479674816132e-01 1.4125369489192963e-01 + <_> + + 0 -1 790 4.6405121684074402e-03 + + -1.6500659286975861e-01 1.4912450313568115e-01 + <_> + + 0 -1 791 -2.1023359149694443e-02 + + -1.9611929357051849e-01 9.9226936697959900e-02 + <_> + + 0 -1 792 -4.8856949433684349e-03 + + 1.1330509930849075e-01 -8.0172486603260040e-02 + <_> + + 0 -1 793 -1.7337809503078461e-01 + + -8.3458930253982544e-01 2.3691669106483459e-02 + <_> + + 0 -1 794 -9.2903972836211324e-04 + + 8.5904203355312347e-02 -1.0580120235681534e-01 + <_> + + 0 -1 795 -1.0562090203166008e-02 + + 2.6989871263504028e-01 -6.7542143166065216e-02 + <_> + + 0 -1 796 1.5071259811520576e-02 + + 5.8657489717006683e-02 -3.2436290383338928e-01 + <_> + + 0 -1 797 -1.8616430461406708e-02 + + 3.5660719871520996e-01 -5.3099378943443298e-02 + <_> + + 0 -1 798 8.4412463009357452e-02 + + 1.7715929076075554e-02 -4.5803558826446533e-01 + <_> + + 0 -1 799 5.1138769835233688e-02 + + 1.7407679930329323e-02 -9.4110202789306641e-01 + <_> + + 0 -1 800 -1.0613460093736649e-02 + + -6.0632371902465820e-01 3.0793670564889908e-02 + <_> + + 0 -1 801 1.8357619643211365e-02 + + -7.7268190681934357e-02 2.9780578613281250e-01 + <_> + + 0 -1 802 -8.4444461390376091e-04 + + 7.8023009002208710e-02 -2.5017648935317993e-01 + <_> + + 0 -1 803 -6.2388968653976917e-03 + + -4.8017698526382446e-01 3.9185639470815659e-02 + <_> + + 0 -1 804 -3.5363171249628067e-02 + + -1. 9.3268742784857750e-03 + <_> + + 0 -1 805 -7.3558121919631958e-02 + + -7.7895337343215942e-01 1.8441500142216682e-02 + <_> + + 0 -1 806 -8.7034203112125397e-02 + + 4.3624061346054077e-01 -1.7716599628329277e-02 + <_> + + 0 -1 807 -8.0721646547317505e-02 + + 2.7296718955039978e-01 -6.6346958279609680e-02 + <_> + + 0 -1 808 1.0344590246677399e-01 + + 9.0693607926368713e-03 -6.6438651084899902e-01 + <_> + + 0 -1 809 9.3807540833950043e-03 + + 7.1242772042751312e-02 -2.7381658554077148e-01 + <_> + + 0 -1 810 -7.1806147694587708e-02 + + -9.1222041845321655e-01 8.0809993669390678e-03 + <_> + + 0 -1 811 -1.9418599549680948e-03 + + 1.8472340703010559e-01 -1.1344549804925919e-01 + <_> + 68 + -7.3019427061080933e-01 + + <_> + + 0 -1 812 3.0328959226608276e-02 + + -1.7539510130882263e-01 3.6945340037345886e-01 + <_> + + 0 -1 813 -8.2631781697273254e-02 + + 2.2216479480266571e-01 -8.7577551603317261e-02 + <_> + + 0 -1 814 2.5548380799591541e-03 + + -1.5091089904308319e-01 1.4608770608901978e-01 + <_> + + 0 -1 815 -1.4431839808821678e-03 + + 6.2405250966548920e-02 -1.8302099406719208e-01 + <_> + + 0 -1 816 4.3006289750337601e-02 + + 8.5711486637592316e-02 -4.4278779625892639e-01 + <_> + + 0 -1 817 -1.7748139798641205e-01 + + -6.7308551073074341e-01 2.1622380241751671e-02 + <_> + + 0 -1 818 9.9723696708679199e-02 + + -4.2775660753250122e-02 6.9088941812515259e-01 + <_> + + 0 -1 819 -1.7957199364900589e-02 + + 8.8784933090209961e-02 -2.9352998733520508e-01 + <_> + + 0 -1 820 5.8914110995829105e-03 + + 2.6884179562330246e-02 -3.9257821440696716e-01 + <_> + + 0 -1 821 -1.2439199490472674e-03 + + 8.3695329725742340e-02 -1.3524650037288666e-01 + <_> + + 0 -1 822 -6.3109956681728363e-02 + + 6.8365001678466797e-01 -1.1174580082297325e-02 + <_> + + 0 -1 823 5.3107268176972866e-03 + + 7.3095791041851044e-02 -3.3228519558906555e-01 + <_> + + 0 -1 824 -9.6346868667751551e-04 + + 9.3923456966876984e-02 -2.6014220714569092e-01 + <_> + + 0 -1 825 -2.0377680659294128e-02 + + 2.3682409524917603e-01 -5.1811341196298599e-02 + <_> + + 0 -1 826 -1.5610749833285809e-02 + + -4.8465269804000854e-01 4.2128730565309525e-02 + <_> + + 0 -1 827 4.5497290790081024e-02 + + 5.7874252088367939e-03 -5.2637368440628052e-01 + <_> + + 0 -1 828 -1.2244869954884052e-02 + + 3.0523040890693665e-01 -7.9311266541481018e-02 + <_> + + 0 -1 829 -5.5875871330499649e-03 + + 7.2504900395870209e-02 -1.0300940275192261e-01 + <_> + + 0 -1 830 -1.3237710110843182e-02 + + -2.1259979903697968e-01 1.4112070202827454e-01 + <_> + + 0 -1 831 -1.6236070543527603e-02 + + -3.6822131276130676e-01 1.6904499381780624e-02 + <_> + + 0 -1 832 8.7341741891577840e-04 + + -1.7513209581375122e-01 1.1717790365219116e-01 + <_> + + 0 -1 833 7.8164516016840935e-03 + + -4.0935669094324112e-02 3.8136309385299683e-01 + <_> + + 0 -1 834 1.4803799786022864e-05 + + -1.1581300199031830e-01 1.8054120242595673e-01 + <_> + + 0 -1 835 3.6272540688514709e-02 + + 1.5196749940514565e-02 -4.6037960052490234e-01 + <_> + + 0 -1 836 -3.8026720285415649e-03 + + 1.3440360128879547e-01 -1.6124980151653290e-01 + <_> + + 0 -1 837 -1.4585750177502632e-02 + + -2.8331491351127625e-01 7.4682116508483887e-02 + <_> + + 0 -1 838 1.4677370199933648e-03 + + -1.3493220508098602e-01 1.4244909584522247e-01 + <_> + + 0 -1 839 -1.3981569558382034e-02 + + 2.1735540032386780e-01 -5.2886679768562317e-02 + <_> + + 0 -1 840 -6.3076039077714086e-04 + + 1.4901949465274811e-01 -1.3620099425315857e-01 + <_> + + 0 -1 841 -1.4475540257990360e-02 + + -1.9180099666118622e-01 1.0607130080461502e-01 + <_> + + 0 -1 842 -3.2217580825090408e-02 + + 2.8091669082641602e-01 -8.5046291351318359e-02 + <_> + + 0 -1 843 3.4460560418665409e-03 + + 7.4571870267391205e-02 -2.7108609676361084e-01 + <_> + + 0 -1 844 -4.3949890881776810e-02 + + 4.4002100825309753e-01 -4.5509129762649536e-02 + <_> + + 0 -1 845 -1.1966270394623280e-02 + + 6.3286870718002319e-02 -1.9805380702018738e-01 + <_> + + 0 -1 846 -4.3486028909683228e-01 + + -7.6205497980117798e-01 2.1508129313588142e-02 + <_> + + 0 -1 847 3.9887550473213196e-01 + + 8.0703729763627052e-03 -8.4284877777099609e-01 + <_> + + 0 -1 848 -4.4802378863096237e-02 + + -6.8417382240295410e-01 2.2474979981780052e-02 + <_> + + 0 -1 849 -1.0935150086879730e-01 + + 2.1119509637355804e-01 -3.9731640368700027e-02 + <_> + + 0 -1 850 3.0923409387469292e-02 + + 4.4779401272535324e-02 -3.5875031352043152e-01 + <_> + + 0 -1 851 1.3285979628562927e-02 + + -4.8151660710573196e-02 3.7119218707084656e-01 + <_> + + 0 -1 852 -3.9830091409385204e-03 + + 1.2781530618667603e-01 -1.9959120452404022e-01 + <_> + + 0 -1 853 1.4184620231389999e-02 + + -3.9896048605442047e-02 2.4085929989814758e-01 + <_> + + 0 -1 854 1.6680279513821006e-03 + + -1.8107059597969055e-01 9.3981906771659851e-02 + <_> + + 0 -1 855 -2.2055890411138535e-02 + + -2.8798168897628784e-01 3.0038369819521904e-02 + <_> + + 0 -1 856 -6.0371801257133484e-02 + + 2.9529640078544617e-01 -6.4714096486568451e-02 + <_> + + 0 -1 857 5.9291448444128036e-02 + + 8.4209917113184929e-03 -5.8830922842025757e-01 + <_> + + 0 -1 858 3.2637149095535278e-02 + + 3.2118339091539383e-02 -5.1192921400070190e-01 + <_> + + 0 -1 859 -9.8897633142769337e-04 + + 1.3382619619369507e-01 -1.1545710265636444e-01 + <_> + + 0 -1 860 -3.5560440272092819e-02 + + -1.5159629285335541e-01 1.0519140213727951e-01 + <_> + + 0 -1 861 9.8722549155354500e-03 + + 9.3462042510509491e-02 -2.5988951325416565e-01 + <_> + + 0 -1 862 7.1953269653022289e-03 + + -8.6937829852104187e-02 2.8372770547866821e-01 + <_> + + 0 -1 863 2.4437099695205688e-02 + + -3.9930108934640884e-02 3.9243239164352417e-01 + <_> + + 0 -1 864 5.2195340394973755e-03 + + 4.9804110080003738e-02 -3.1846821308135986e-01 + <_> + + 0 -1 865 2.3442960809916258e-03 + + -5.4469950497150421e-02 3.3718121051788330e-01 + <_> + + 0 -1 866 4.7694300301373005e-03 + + 7.1476787328720093e-02 -3.1018280982971191e-01 + <_> + + 0 -1 867 -1.4517470262944698e-02 + + 7.8642480075359344e-02 -1.4538839459419250e-01 + <_> + + 0 -1 868 4.4710729271173477e-02 + + -2.5051780045032501e-02 6.4730519056320190e-01 + <_> + + 0 -1 869 1.6867399215698242e-02 + + 2.9088959097862244e-02 -3.9030238986015320e-01 + <_> + + 0 -1 870 -9.0343318879604340e-04 + + 8.7722577154636383e-02 -1.6588549315929413e-01 + <_> + + 0 -1 871 -8.2187339663505554e-02 + + -8.4238857030868530e-01 9.8376423120498657e-03 + <_> + + 0 -1 872 1.8525390187278390e-03 + + -1.2251490354537964e-01 1.2000189721584320e-01 + <_> + + 0 -1 873 -9.3228723853826523e-03 + + 7.8422851860523224e-02 -1.3231949508190155e-01 + <_> + + 0 -1 874 2.2730689495801926e-02 + + -3.3696789294481277e-02 4.4383940100669861e-01 + <_> + + 0 -1 875 1.0286659747362137e-01 + + 1.7917430028319359e-02 -5.8341610431671143e-01 + <_> + + 0 -1 876 -9.9547371268272400e-02 + + -9.5365560054779053e-01 1.2582040391862392e-02 + <_> + + 0 -1 877 1.6412759199738503e-02 + + 1.6067119315266609e-02 -4.1402378678321838e-01 + <_> + + 0 -1 878 -2.5932409334927797e-03 + + 5.2763499319553375e-02 -3.0404600501060486e-01 + <_> + + 0 -1 879 9.5953093841671944e-03 + + 8.3528086543083191e-02 -1.1780069768428802e-01 + <_> + 66 + -6.8558442592620850e-01 + + <_> + + 0 -1 880 -3.5430109500885010e-01 + + 3.1792920827865601e-01 -1.8512800335884094e-01 + <_> + + 0 -1 881 -1.4761329628527164e-02 + + 3.4065079689025879e-01 -8.6621738970279694e-02 + <_> + + 0 -1 882 -1.1580450087785721e-01 + + -7.2353202104568481e-01 3.4404840320348740e-02 + <_> + + 0 -1 883 -4.4705160689773038e-05 + + 8.2497082650661469e-02 -2.1311110258102417e-01 + <_> + + 0 -1 884 -5.8883379097096622e-05 + + 1.0809300094842911e-01 -1.8269860744476318e-01 + <_> + + 0 -1 885 3.7944849580526352e-02 + + -2.4756550788879395e-02 4.5866918563842773e-01 + <_> + + 0 -1 886 -2.1807940211147070e-03 + + 1.5783859789371490e-01 -1.7752459645271301e-01 + <_> + + 0 -1 887 -4.5430101454257965e-02 + + -3.7249541282653809e-01 5.7393261231482029e-03 + <_> + + 0 -1 888 1.9972559530287981e-03 + + -1.9175310432910919e-01 1.1995170265436172e-01 + <_> + + 0 -1 889 -2.2458820239990018e-05 + + 9.1529168188571930e-02 -1.3080990314483643e-01 + <_> + + 0 -1 890 -3.7994279991835356e-03 + + -2.0454970002174377e-01 1.4146579802036285e-01 + <_> + + 0 -1 891 -2.7970419614575803e-04 + + 1.1078160256147385e-01 -1.8713960051536560e-01 + <_> + + 0 -1 892 -3.9631421677768230e-03 + + -3.7749990820884705e-01 5.6935790926218033e-02 + <_> + + 0 -1 893 -1.4290240360423923e-03 + + -1.9449859857559204e-01 9.8834916949272156e-02 + <_> + + 0 -1 894 2.1182179450988770e-02 + + -8.7030410766601562e-02 2.8888610005378723e-01 + <_> + + 0 -1 895 8.7332521798089147e-04 + + -1.1729159951210022e-01 1.2506540119647980e-01 + <_> + + 0 -1 896 2.6135759428143501e-02 + + -3.9572428911924362e-02 6.2252640724182129e-01 + <_> + + 0 -1 897 4.3046330101788044e-03 + + 1.1582309752702713e-01 -1.9618239998817444e-01 + <_> + + 0 -1 898 1.5224959934130311e-03 + + -1.8586060404777527e-01 1.1688389629125595e-01 + <_> + + 0 -1 899 -7.4201932875439525e-04 + + 9.8724737763404846e-02 -2.5791341066360474e-01 + <_> + + 0 -1 900 -2.5593061000108719e-03 + + 1.7307940125465393e-01 -1.2067069858312607e-01 + <_> + + 0 -1 901 -9.5563217997550964e-02 + + 3.4646418690681458e-01 -1.3142139650881290e-02 + <_> + + 0 -1 902 1.3280790299177170e-02 + + 1.2056879699230194e-01 -2.0627740025520325e-01 + <_> + + 0 -1 903 1.8245529383420944e-02 + + -6.7242950201034546e-02 4.6858128160238266e-02 + <_> + + 0 -1 904 -6.1288971453905106e-02 + + -6.6364967823028564e-01 2.9319150373339653e-02 + <_> + + 0 -1 905 -2.6133419945836067e-02 + + 2.0848380029201508e-01 -2.7202930301427841e-02 + <_> + + 0 -1 906 -3.2300818711519241e-02 + + -6.2726408243179321e-01 3.0091879889369011e-02 + <_> + + 0 -1 907 5.0284489989280701e-02 + + 1.5047290362417698e-03 -5.9630411863327026e-01 + <_> + + 0 -1 908 -1.8137119710445404e-02 + + 2.9262909293174744e-01 -6.9213449954986572e-02 + <_> + + 0 -1 909 1.0980300139635801e-03 + + 1.0316859930753708e-01 -1.6558070480823517e-01 + <_> + + 0 -1 910 3.9596110582351685e-03 + + -5.7063579559326172e-02 3.3744910359382629e-01 + <_> + + 0 -1 911 3.1622028909623623e-03 + + 8.8302358984947205e-02 -2.7917590737342834e-01 + <_> + + 0 -1 912 8.4337368607521057e-03 + + 8.6311057209968567e-02 -2.5153660774230957e-01 + <_> + + 0 -1 913 2.3408479988574982e-02 + + -3.7011519074440002e-02 2.5571560859680176e-01 + <_> + + 0 -1 914 -1.9710899796336889e-03 + + 1.4960870146751404e-01 -1.3213759660720825e-01 + <_> + + 0 -1 915 -3.1434781849384308e-02 + + 2.7072909474372864e-01 -2.4784140288829803e-02 + <_> + + 0 -1 916 -2.0984669681638479e-03 + + -2.2842940688133240e-01 9.2392489314079285e-02 + <_> + + 0 -1 917 -1.0477580130100250e-01 + + 1.3740949332714081e-01 -5.8604940772056580e-02 + <_> + + 0 -1 918 1.2558500282466412e-02 + + 9.4428263604640961e-02 -2.3187640309333801e-01 + <_> + + 0 -1 919 2.6465631090104580e-03 + + -2.0493589341640472e-01 9.2889577150344849e-02 + <_> + + 0 -1 920 2.8069379925727844e-01 + + 4.0848400443792343e-02 -4.6177521347999573e-01 + <_> + + 0 -1 921 -4.5882318168878555e-02 + + -7.1715551614761353e-01 9.1696027666330338e-03 + <_> + + 0 -1 922 -1.3070689747110009e-03 + + 1.6250529885292053e-01 -1.1437030136585236e-01 + <_> + + 0 -1 923 6.8374760448932648e-03 + + -6.7564792931079865e-02 2.1927219629287720e-01 + <_> + + 0 -1 924 -5.8329561725258827e-03 + + -3.5843908786773682e-01 5.7467628270387650e-02 + <_> + + 0 -1 925 -4.0936999022960663e-02 + + -5.5129498243331909e-01 1.3819620013237000e-02 + <_> + + 0 -1 926 1.8727440387010574e-02 + + -5.2844639867544174e-02 3.4427130222320557e-01 + <_> + + 0 -1 927 1.0303989984095097e-03 + + -9.4872146844863892e-02 1.1235869675874710e-01 + <_> + + 0 -1 928 -2.6228028582409024e-04 + + 6.3875511288642883e-02 -3.0397358536720276e-01 + <_> + + 0 -1 929 -2.6861110702157021e-02 + + 1.7592920362949371e-01 -6.2506988644599915e-02 + <_> + + 0 -1 930 3.1061280518770218e-02 + + -7.2171129286289215e-02 3.1532520055770874e-01 + <_> + + 0 -1 931 -7.1269841864705086e-03 + + -1.2540310621261597e-01 1.0068179666996002e-01 + <_> + + 0 -1 932 -2.7709340676665306e-02 + + -8.0085551738739014e-01 2.5742180645465851e-02 + <_> + + 0 -1 933 4.2209450155496597e-02 + + 2.7846070006489754e-02 -5.6140202283859253e-01 + <_> + + 0 -1 934 6.2995860353112221e-03 + + 1.0806919634342194e-01 -2.0114520192146301e-01 + <_> + + 0 -1 935 2.0048789680004120e-02 + + -5.8164618909358978e-02 1.8885469436645508e-01 + <_> + + 0 -1 936 -7.8481709351763129e-05 + + 8.2995712757110596e-02 -2.1331989765167236e-01 + <_> + + 0 -1 937 -8.9945547282695770e-02 + + -7.9307717084884644e-01 7.8350491821765900e-03 + <_> + + 0 -1 938 7.7181761153042316e-03 + + 4.1435040533542633e-02 -3.7721860408782959e-01 + <_> + + 0 -1 939 5.3638177923858166e-03 + + -9.3567937612533569e-02 1.4666350185871124e-01 + <_> + + 0 -1 940 1.4555330388247967e-02 + + -5.6989211589097977e-02 3.4367969632148743e-01 + <_> + + 0 -1 941 1.0583730041980743e-01 + + 3.0579300597310066e-02 -5.8684998750686646e-01 + <_> + + 0 -1 942 2.7123570907860994e-04 + + 8.5480518639087677e-02 -2.2808749973773956e-01 + <_> + + 0 -1 943 -7.3196433484554291e-02 + + -5.1212561130523682e-01 9.6583841368556023e-03 + <_> + + 0 -1 944 8.3729642210528255e-04 + + -1.7978319525718689e-01 1.4117470383644104e-01 + <_> + + 0 -1 945 1.9459549803286791e-03 + + 8.7605938315391541e-02 -2.0442050695419312e-01 + <_> + 78 + -3.0717300415039062e+01 + + <_> + + 0 -1 946 -8.5505366325378418e-02 + + 2.6714649796485901e-01 -1.8152849376201630e-01 + <_> + + 0 -1 947 -3.7014279514551163e-02 + + 3.7405461072921753e-01 -7.0312701165676117e-02 + <_> + + 0 -1 948 1.6834780573844910e-02 + + 8.9160107076168060e-02 -2.4566100537776947e-01 + <_> + + 0 -1 949 9.7268886747770011e-05 + + -1.9830940663814545e-01 1.4981469511985779e-01 + <_> + + 0 -1 950 5.2984068170189857e-03 + + -1.5779909491539001e-01 1.7095419764518738e-01 + <_> + + 0 -1 951 -2.3770859465003014e-02 + + -2.5096279382705688e-01 3.2790731638669968e-02 + <_> + + 0 -1 952 -1.4852959662675858e-02 + + 2.7263158559799194e-01 -7.2188302874565125e-02 + <_> + + 0 -1 953 -8.2722969353199005e-02 + + -6.6801771521568298e-02 1.3384120166301727e-01 + <_> + + 0 -1 954 6.4472708618268371e-04 + + -1.9309680163860321e-01 1.3628469407558441e-01 + <_> + + 0 -1 955 -4.3215509504079819e-04 + + 5.7426910847425461e-02 -7.2983436286449432e-02 + <_> + + 0 -1 956 -7.5133621066925116e-06 + + 1.2174469977617264e-01 -1.8166640400886536e-01 + <_> + + 0 -1 957 2.0493609830737114e-02 + + -6.1657600104808807e-02 3.8570550084114075e-01 + <_> + + 0 -1 958 -5.9959441423416138e-03 + + -1.8091249465942383e-01 1.1791180074214935e-01 + <_> + + 0 -1 959 -9.3910521268844604e-01 + + 3.1374409794807434e-01 -5.9216298162937164e-02 + <_> + + 0 -1 960 -2.4341490119695663e-02 + + -3.7053358554840088e-01 5.5251110345125198e-02 + <_> + + 0 -1 961 -7.6796777546405792e-02 + + 1.3754889369010925e-01 -5.8201938867568970e-02 + <_> + + 0 -1 962 -8.2179326564073563e-03 + + -2.5679248571395874e-01 9.9195696413516998e-02 + <_> + + 0 -1 963 -5.1702618598937988e-02 + + -5.2937638759613037e-01 2.7275180444121361e-02 + <_> + + 0 -1 964 6.3065597787499428e-03 + + -1.0400679707527161e-01 2.0388899743556976e-01 + <_> + + 0 -1 965 3.6337040364742279e-02 + + 1.3178840279579163e-02 -3.8717061281204224e-01 + <_> + + 0 -1 966 -2.7929339557886124e-03 + + 1.2351000308990479e-01 -2.0460779964923859e-01 + <_> + + 0 -1 967 -1.4435379765927792e-02 + + -5.0111377239227295e-01 3.7262540310621262e-02 + <_> + + 0 -1 968 6.4411992207169533e-03 + + -6.0557190328836441e-02 3.0578470230102539e-01 + <_> + + 0 -1 969 -1.2598140165209770e-03 + + 5.3200751543045044e-02 -1.6916200518608093e-01 + <_> + + 0 -1 970 -6.9105648435652256e-03 + + -3.6398649215698242e-01 4.2843151837587357e-02 + <_> + + 0 -1 971 -5.2663110196590424e-02 + + 4.4169178605079651e-01 -3.2096829265356064e-02 + <_> + + 0 -1 972 -4.0925059467554092e-02 + + -5.5673360824584961e-01 2.9191689565777779e-02 + <_> + + 0 -1 973 -2.1683140657842159e-03 + + 6.6585853695869446e-02 -1.1715179681777954e-01 + <_> + + 0 -1 974 1.7480919137597084e-02 + + -6.7747853696346283e-02 3.4224361181259155e-01 + <_> + + 0 -1 975 1.3032980263233185e-01 + + 1.0853439569473267e-02 -5.9894740581512451e-01 + <_> + + 0 -1 976 5.1362451631575823e-04 + + -1.8810969591140747e-01 1.0938909649848938e-01 + <_> + + 0 -1 977 -3.8764420896768570e-02 + + -2.6928341388702393e-01 2.0156569778919220e-02 + <_> + + 0 -1 978 -4.8952922224998474e-03 + + -2.3670850694179535e-01 7.0693537592887878e-02 + <_> + + 0 -1 979 8.4380611777305603e-02 + + -6.1777111142873764e-02 1.5130819380283356e-01 + <_> + + 0 -1 980 -5.4832860827445984e-02 + + -4.9945160746574402e-01 3.5915810614824295e-02 + <_> + + 0 -1 981 -5.4148300550878048e-03 + + 8.2116909325122833e-02 -1.3672749698162079e-01 + <_> + + 0 -1 982 1.2813720107078552e-01 + + -3.9755281060934067e-02 6.0340911149978638e-01 + <_> + + 0 -1 983 -4.4217561371624470e-03 + + -7.4642613530158997e-02 1.0235700011253357e-01 + <_> + + 0 -1 984 -7.1978997766564135e-06 + + 7.4595592916011810e-02 -2.9046559333801270e-01 + <_> + + 0 -1 985 7.3321886360645294e-02 + + -2.1364469081163406e-02 6.9809699058532715e-01 + <_> + + 0 -1 986 -2.2566469386219978e-02 + + -5.3714770078659058e-01 3.6509968340396881e-02 + <_> + + 0 -1 987 -2.9338080435991287e-02 + + 1.0626199841499329e-01 -3.1652290374040604e-02 + <_> + + 0 -1 988 1.3684090226888657e-02 + + -5.7709541171789169e-02 3.0355650186538696e-01 + <_> + + 0 -1 989 -8.2646618830040097e-04 + + 1.2958580255508423e-01 -1.3603089749813080e-01 + <_> + + 0 -1 990 3.9828647859394550e-03 + + 5.0734668970108032e-02 -3.3896729350090027e-01 + <_> + + 0 -1 991 -2.0535979419946671e-02 + + 2.6028490066528320e-01 -7.2259396314620972e-02 + <_> + + 0 -1 992 -1.4932189881801605e-01 + + -5.4172599315643311e-01 4.4534388929605484e-02 + <_> + + 0 -1 993 -1.7894789576530457e-02 + + 4.7149929404258728e-01 -3.0801070854067802e-02 + <_> + + 0 -1 994 4.7443818766623735e-04 + + -1.9686989486217499e-01 1.2433020025491714e-01 + <_> + + 0 -1 995 -4.0598851628601551e-03 + + 1.4028669893741608e-01 -4.7751329839229584e-02 + <_> + + 0 -1 996 -1.1755799874663353e-02 + + -2.6237910985946655e-01 5.9933070093393326e-02 + <_> + + 0 -1 997 -1.8559649586677551e-02 + + 1.0493250191211700e-01 -3.2159261405467987e-02 + <_> + + 0 -1 998 3.4838409628719091e-03 + + 7.9499892890453339e-02 -2.0486010611057281e-01 + <_> + + 0 -1 999 -6.2133308500051498e-02 + + -3.5091090202331543e-01 1.2265560217201710e-02 + <_> + + 0 -1 1000 -4.4008668512105942e-02 + + 2.6838389039039612e-01 -8.8284887373447418e-02 + <_> + + 0 -1 1001 3.0750890728086233e-03 + + -4.5581929385662079e-02 1.9343300163745880e-01 + <_> + + 0 -1 1002 -8.9865371584892273e-02 + + -4.8605358600616455e-01 4.5101881027221680e-02 + <_> + + 0 -1 1003 -1.6210540197789669e-03 + + 8.7722256779670715e-02 -1.6689349710941315e-01 + <_> + + 0 -1 1004 -2.9370939359068871e-02 + + -4.2794701457023621e-01 4.5566789805889130e-02 + <_> + + 0 -1 1005 -8.5921816527843475e-02 + + -6.9077378511428833e-01 1.5122929587960243e-02 + <_> + + 0 -1 1006 6.7258282797411084e-04 + + -1.1166089773178101e-01 1.5630759298801422e-01 + <_> + + 0 -1 1007 1.7752440180629492e-03 + + -4.5409418642520905e-02 7.7933087944984436e-02 + <_> + + 0 -1 1008 1.5036190234241076e-05 + + -1.6349479556083679e-01 1.0864420235157013e-01 + <_> + + 0 -1 1009 1.8150300020352006e-03 + + 9.6329912543296814e-02 -1.1818060278892517e-01 + <_> + + 0 -1 1010 -6.7588366568088531e-02 + + 2.2657020390033722e-01 -9.0492926537990570e-02 + <_> + + 0 -1 1011 1.8347490578889847e-02 + + 1.6350140795111656e-02 -4.4877880811691284e-01 + <_> + + 0 -1 1012 -1.0822510346770287e-02 + + -4.9622350931167603e-01 4.0703330188989639e-02 + <_> + + 0 -1 1013 1.7427999526262283e-02 + + -3.5475689917802811e-02 3.0856430530548096e-01 + <_> + + 0 -1 1014 -7.8753121197223663e-02 + + -6.7144078016281128e-01 2.6170469820499420e-02 + <_> + + 0 -1 1015 7.3261657962575555e-04 + + -1.0309589654207230e-01 6.4503982663154602e-02 + <_> + + 0 -1 1016 2.8185009956359863e-02 + + -5.5124811828136444e-02 3.1133919954299927e-01 + <_> + + 0 -1 1017 -1.5536470338702202e-02 + + -8.5527300834655762e-02 4.9024209380149841e-02 + <_> + + 0 -1 1018 -2.6290729641914368e-02 + + -6.5267199277877808e-01 2.4495759978890419e-02 + <_> + + 0 -1 1019 -6.8586082197725773e-03 + + -5.8548830449581146e-02 2.8735989332199097e-01 + <_> + + 0 -1 1020 -3.0750960577279329e-03 + + 8.6425736546516418e-02 -2.2627249360084534e-01 + <_> + + 0 -1 1021 5.6799430400133133e-02 + + 2.9048459604382515e-02 -3.6798200011253357e-01 + <_> + + 0 -1 1022 3.7182599306106567e-02 + + -3.5062279552221298e-02 4.5094621181488037e-01 + <_> + + 0 -1 1023 -3.5590359475463629e-03 + + -1.7892469465732574e-01 6.8459518253803253e-02 + <_> + 77 + -3.0740200042724609e+01 + + <_> + + 0 -1 1024 -5.8595160953700542e-03 + + 2.0132589340209961e-01 -2.6587140560150146e-01 + <_> + + 0 -1 1025 -5.9507137537002563e-01 + + 3.6134061217308044e-01 -1.2203159928321838e-01 + <_> + + 0 -1 1026 4.1726600378751755e-02 + + -5.2889000624418259e-02 3.9082470536231995e-01 + <_> + + 0 -1 1027 4.7253750264644623e-02 + + 1.4923909679055214e-02 -5.0544148683547974e-01 + <_> + + 0 -1 1028 9.8612194415181875e-04 + + -2.0337739586830139e-01 1.1030670255422592e-01 + <_> + + 0 -1 1029 -7.2683179751038551e-03 + + -2.0899240672588348e-01 1.4733150601387024e-01 + <_> + + 0 -1 1030 -2.9695410281419754e-02 + + 6.6190290451049805e-01 -6.7257620394229889e-02 + <_> + + 0 -1 1031 -1.3097229599952698e-01 + + 1.7485789954662323e-01 -8.1029571592807770e-02 + <_> + + 0 -1 1032 1.7316760495305061e-02 + + -4.8908680677413940e-02 4.6843668818473816e-01 + <_> + + 0 -1 1033 -1.0221409797668457e-01 + + -2.2275149822235107e-01 7.7479638159275055e-02 + <_> + + 0 -1 1034 2.9453460592776537e-03 + + 3.9738278836011887e-02 -2.8107449412345886e-01 + <_> + + 0 -1 1035 -4.5425590127706528e-02 + + 2.4193780124187469e-01 1.3621949590742588e-02 + <_> + + 0 -1 1036 2.2699350956827402e-03 + + -1.6247589886188507e-01 1.6063609719276428e-01 + <_> + + 0 -1 1037 1.1421869695186615e-01 + + 1.5750480815768242e-02 -5.7382887601852417e-01 + <_> + + 0 -1 1038 -4.1054069995880127e-02 + + 3.0522629618644714e-01 -5.5898960679769516e-02 + <_> + + 0 -1 1039 1.1980540119111538e-02 + + 1.7477169632911682e-02 -4.0707069635391235e-01 + <_> + + 0 -1 1040 1.2105259811505675e-03 + + -1.7840960621833801e-01 1.0353209823369980e-01 + <_> + + 0 -1 1041 -2.2351980209350586e-02 + + -4.7567600011825562e-01 3.7311390042304993e-02 + <_> + + 0 -1 1042 2.2135479375720024e-02 + + -5.4137628525495529e-02 4.2861071228981018e-01 + <_> + + 0 -1 1043 -1.5875579789280891e-02 + + 6.6373616456985474e-02 -1.6455489397048950e-01 + <_> + + 0 -1 1044 6.0371369123458862e-02 + + 3.8663931190967560e-02 -4.6496200561523438e-01 + <_> + + 0 -1 1045 -5.1881238818168640e-02 + + -5.6141299009323120e-01 5.4471958428621292e-03 + <_> + + 0 -1 1046 1.9330360228195786e-03 + + -1.3475979864597321e-01 1.3747330009937286e-01 + <_> + + 0 -1 1047 -4.3940469622612000e-03 + + -9.3405917286872864e-02 3.5123821347951889e-02 + <_> + + 0 -1 1048 -5.2314151078462601e-02 + + 7.5311762094497681e-01 -2.9210770502686501e-02 + <_> + + 0 -1 1049 -5.6897811591625214e-02 + + -9.1858989000320435e-01 2.8862420469522476e-02 + <_> + + 0 -1 1050 -2.1614639461040497e-01 + + -1. 6.9490820169448853e-03 + <_> + + 0 -1 1051 1.8479259312152863e-01 + + -8.8357992470264435e-02 1.9002689421176910e-01 + <_> + + 0 -1 1052 -5.6834658607840538e-03 + + -1.7791560292243958e-01 9.8286077380180359e-02 + <_> + + 0 -1 1053 -8.2448042929172516e-02 + + -3.4058651328086853e-01 1.5612719580531120e-02 + <_> + + 0 -1 1054 -7.5926659628748894e-03 + + 2.5929468870162964e-01 -6.9370441138744354e-02 + <_> + + 0 -1 1055 -2.9748380184173584e-03 + + 5.4534178227186203e-02 -1.2630839645862579e-01 + <_> + + 0 -1 1056 -1.6377970576286316e-01 + + -8.3725690841674805e-01 2.2446790710091591e-02 + <_> + + 0 -1 1057 -3.8845320232212543e-03 + + -2.1008059382438660e-01 9.1814376413822174e-02 + <_> + + 0 -1 1058 -5.5496331304311752e-02 + + 5.2739220857620239e-01 -3.8561638444662094e-02 + <_> + + 0 -1 1059 4.5041809789836407e-03 + + 3.8907989859580994e-02 -2.1077489852905273e-01 + <_> + + 0 -1 1060 5.7516310364007950e-02 + + -5.4442461580038071e-02 3.4977319836616516e-01 + <_> + + 0 -1 1061 -5.4960879497230053e-03 + + 1.0459329932928085e-01 -2.2956989705562592e-01 + <_> + + 0 -1 1062 5.8753142366185784e-04 + + 7.4045538902282715e-02 -2.3731130361557007e-01 + <_> + + 0 -1 1063 1.1216119676828384e-01 + + -2.5916000828146935e-02 1.1389470100402832e-01 + <_> + + 0 -1 1064 2.1753750741481781e-01 + + 1.9727870821952820e-02 -9.6220922470092773e-01 + <_> + + 0 -1 1065 -1.4632700476795435e-03 + + -9.4052821397781372e-02 6.4389176666736603e-02 + <_> + + 0 -1 1066 -8.6313979700207710e-03 + + 2.5036060810089111e-01 -7.2234652936458588e-02 + <_> + + 0 -1 1067 -1.9858509302139282e-02 + + -1.2698090076446533e-01 7.9051487147808075e-02 + <_> + + 0 -1 1068 -1.3804109767079353e-04 + + 1.4466640353202820e-01 -1.1444070190191269e-01 + <_> + + 0 -1 1069 2.6781240478157997e-02 + + 1.7647750675678253e-02 -8.3157891035079956e-01 + <_> + + 0 -1 1070 1.9331119954586029e-02 + + -4.5500081032514572e-02 5.0110948085784912e-01 + <_> + + 0 -1 1071 4.1692070662975311e-02 + + 2.2502349689602852e-02 -3.8992220163345337e-01 + <_> + + 0 -1 1072 1.1296980082988739e-01 + + -3.2494839280843735e-02 5.3929620981216431e-01 + <_> + + 0 -1 1073 3.1683610286563635e-03 + + -1.7195589840412140e-01 9.3619801104068756e-02 + <_> + + 0 -1 1074 5.3966748528182507e-03 + + 5.7677630335092545e-02 -3.0436149239540100e-01 + <_> + + 0 -1 1075 -1.3829180598258972e-01 + + -5.2158790826797485e-01 1.8444910645484924e-02 + <_> + + 0 -1 1076 -1.2594119645655155e-02 + + 2.2748909890651703e-01 -6.9325000047683716e-02 + <_> + + 0 -1 1077 -1.6514480113983154e-02 + + 1.6279229521751404e-01 -3.4446150064468384e-02 + <_> + + 0 -1 1078 -1.6392849385738373e-02 + + -1.4277680218219757e-01 1.6290099918842316e-01 + <_> + + 0 -1 1079 -3.4606490284204483e-02 + + -4.0356379747390747e-01 8.3033805713057518e-03 + <_> + + 0 -1 1080 -6.8894061259925365e-03 + + 2.6890090107917786e-01 -6.9450862705707550e-02 + <_> + + 0 -1 1081 -1.1879400350153446e-02 + + 2.1395209431648254e-01 -2.0930450409650803e-02 + <_> + + 0 -1 1082 -1.9165100529789925e-03 + + 6.8464219570159912e-02 -3.1453219056129456e-01 + <_> + + 0 -1 1083 1.3729350175708532e-03 + + -6.0340028256177902e-02 2.7572840452194214e-01 + <_> + + 0 -1 1084 2.4278028868138790e-03 + + -2.3944500088691711e-01 8.4658838808536530e-02 + <_> + + 0 -1 1085 2.1290169097483158e-03 + + 8.6938478052616119e-02 -2.8218480944633484e-01 + <_> + + 0 -1 1086 -5.2569470426533371e-05 + + 1.3682359457015991e-01 -1.1980649828910828e-01 + <_> + + 0 -1 1087 1.5957899391651154e-02 + + -3.9610300213098526e-02 2.4825170636177063e-01 + <_> + + 0 -1 1088 8.9294081553816795e-03 + + 8.1123508512973785e-02 -2.6561570167541504e-01 + <_> + + 0 -1 1089 4.9925308674573898e-02 + + 1.5018629841506481e-02 -3.6647871136665344e-01 + <_> + + 0 -1 1090 -1.7374839633703232e-02 + + 3.3971020579338074e-01 -5.4494149982929230e-02 + <_> + + 0 -1 1091 -7.8357063233852386e-02 + + -4.9435839056968689e-01 8.4990533068776131e-03 + <_> + + 0 -1 1092 -8.9894477277994156e-03 + + -2.3209859430789948e-01 7.1379087865352631e-02 + <_> + + 0 -1 1093 -1.5932919923216105e-03 + + 8.2504719495773315e-02 -9.3123182654380798e-02 + <_> + + 0 -1 1094 2.6272730901837349e-03 + + -1.3213430345058441e-01 1.3099829852581024e-01 + <_> + + 0 -1 1095 -5.9108160436153412e-02 + + -3.7229761481285095e-01 4.5574661344289780e-02 + <_> + + 0 -1 1096 3.5086690913885832e-03 + + 8.9478462934494019e-02 -1.8543410301208496e-01 + <_> + + 0 -1 1097 1.5465220436453819e-02 + + -3.0604820698499680e-02 2.0754580199718475e-01 + <_> + + 0 -1 1098 -1.1749019846320152e-02 + + 3.9200168848037720e-01 -4.1100859642028809e-02 + <_> + + 0 -1 1099 4.8413608223199844e-02 + + 3.7391050718724728e-03 -8.5701841115951538e-01 + <_> + + 0 -1 1100 -1.1499889660626650e-03 + + -2.2441549599170685e-01 7.1305088698863983e-02 + <_> + 89 + -3.0760700225830078e+01 + + <_> + + 0 -1 1101 -3.2420051097869873e-01 + + 4.1447758674621582e-01 -1.0684230178594589e-01 + <_> + + 0 -1 1102 -2.1065689623355865e-01 + + 2.3302809894084930e-01 -9.4695799052715302e-02 + <_> + + 0 -1 1103 -2.1540550515055656e-02 + + -2.8891721367835999e-01 7.0666067302227020e-02 + <_> + + 0 -1 1104 5.9726871550083160e-03 + + -9.0559490025043488e-02 2.2989599406719208e-01 + <_> + + 0 -1 1105 2.6468100026249886e-02 + + -5.0254050642251968e-02 3.9346438646316528e-01 + <_> + + 0 -1 1106 -7.2531126439571381e-02 + + -3.9421468973159790e-01 7.5547359883785248e-03 + <_> + + 0 -1 1107 -4.3684918433427811e-02 + + -5.7553547620773315e-01 5.1893319934606552e-02 + <_> + + 0 -1 1108 1.1670660227537155e-01 + + -2.5791339576244354e-03 -8.2597649097442627e-01 + <_> + + 0 -1 1109 -8.2381166517734528e-02 + + 7.5818961858749390e-01 -2.6576930657029152e-02 + <_> + + 0 -1 1110 -2.3157079704105854e-03 + + 6.6858686506748199e-02 -3.0407869815826416e-01 + <_> + + 0 -1 1111 -1.6678189858794212e-02 + + 3.8525319099426270e-01 -4.8842679709196091e-02 + <_> + + 0 -1 1112 -3.0678999610245228e-03 + + -2.7150988578796387e-01 6.4561262726783752e-02 + <_> + + 0 -1 1113 -8.3884904161095619e-03 + + -2.8267300128936768e-01 7.0778891444206238e-02 + <_> + + 0 -1 1114 2.1357910707592964e-02 + + -6.6106483340263367e-02 3.1867539882659912e-01 + <_> + + 0 -1 1115 -4.0636979974806309e-03 + + 1.1739840358495712e-01 -1.5105929970741272e-01 + <_> + + 0 -1 1116 -1.1475679930299520e-03 + + 6.4262896776199341e-02 -7.4472077190876007e-02 + <_> + + 0 -1 1117 1.8145689740777016e-02 + + -5.6946009397506714e-02 4.2107149958610535e-01 + <_> + + 0 -1 1118 5.0288350321352482e-03 + + 8.3866670727729797e-02 -3.3929398655891418e-01 + <_> + + 0 -1 1119 -5.7916361838579178e-02 + + 4.5170179009437561e-01 -4.3198868632316589e-02 + <_> + + 0 -1 1120 3.1025299802422523e-02 + + 2.8000740334391594e-02 -1.6818940639495850e-01 + <_> + + 0 -1 1121 8.2134291529655457e-02 + + 1.9999530166387558e-02 -7.6910507678985596e-01 + <_> + + 0 -1 1122 7.3666572570800781e-02 + + -1.2391459895297885e-03 -1.0004559755325317e+00 + <_> + + 0 -1 1123 1.5681830700486898e-04 + + -1.2154590338468552e-01 1.3561969995498657e-01 + <_> + + 0 -1 1124 4.5130930840969086e-02 + + 4.7123869881033897e-03 -2.9671049118041992e-01 + <_> + + 0 -1 1125 -5.1468348829075694e-04 + + 1.4606890082359314e-01 -1.3600480556488037e-01 + <_> + + 0 -1 1126 -1.4981119893491268e-02 + + -1.7933659255504608e-01 5.3928699344396591e-02 + <_> + + 0 -1 1127 -2.7151789516210556e-02 + + -6.7529010772705078e-01 2.3046780377626419e-02 + <_> + + 0 -1 1128 -6.6578023135662079e-02 + + -6.5586429834365845e-01 4.7667929902672768e-03 + <_> + + 0 -1 1129 -3.3119178842753172e-03 + + 1.2255000323057175e-01 -1.6333930194377899e-01 + <_> + + 0 -1 1130 -1.5811180695891380e-02 + + -4.4731178879737854e-01 8.9029967784881592e-03 + <_> + + 0 -1 1131 -5.6757620768621564e-05 + + 1.4944350719451904e-01 -1.0686829686164856e-01 + <_> + + 0 -1 1132 1.0602490045130253e-02 + + 2.1685829386115074e-02 -3.2208129763603210e-01 + <_> + + 0 -1 1133 2.1245649550110102e-03 + + -2.0425739884376526e-01 8.2330957055091858e-02 + <_> + + 0 -1 1134 4.7638580203056335e-02 + + -3.2728441059589386e-02 4.4726258516311646e-01 + <_> + + 0 -1 1135 -1.1300199665129185e-02 + + 2.5546020269393921e-01 -6.9969899952411652e-02 + <_> + + 0 -1 1136 -1.1472209589555860e-03 + + 4.7467790544033051e-02 -2.2220790386199951e-01 + <_> + + 0 -1 1137 1.8008640035986900e-02 + + -6.0860209167003632e-02 2.9082441329956055e-01 + <_> + + 0 -1 1138 -1.1634260416030884e-02 + + -3.1474921107292175e-01 8.3630897104740143e-02 + <_> + + 0 -1 1139 6.5580541267991066e-03 + + -1.2121830135583878e-01 1.3124500215053558e-01 + <_> + + 0 -1 1140 -2.3253620602190495e-03 + + -8.7138622999191284e-02 7.0476517081260681e-02 + <_> + + 0 -1 1141 2.1486220881342888e-02 + + -3.5936549305915833e-02 4.3737021088600159e-01 + <_> + + 0 -1 1142 1.2589399516582489e-01 + + 1.2443150393664837e-02 -9.2822617292404175e-01 + <_> + + 0 -1 1143 -2.2191529569681734e-04 + + 6.9798342883586884e-02 -3.2106238603591919e-01 + <_> + + 0 -1 1144 -5.8175198733806610e-02 + + -7.7025629580020905e-02 9.6747986972332001e-02 + <_> + + 0 -1 1145 -4.5887380838394165e-04 + + 1.1412449926137924e-01 -1.4719170331954956e-01 + <_> + + 0 -1 1146 -4.0837019681930542e-02 + + 4.7654581069946289e-01 -4.9737568944692612e-02 + <_> + + 0 -1 1147 -9.7786840051412582e-03 + + -2.0513780415058136e-01 8.4468983113765717e-02 + <_> + + 0 -1 1148 2.7964261174201965e-01 + + -3.0034869909286499e-02 6.9526249170303345e-01 + <_> + + 0 -1 1149 -8.8869117200374603e-02 + + 2.4081839621067047e-01 -7.0576377213001251e-02 + <_> + + 0 -1 1150 -1.4095460064709187e-02 + + -1.0456439852714539e-01 4.6604979783296585e-02 + <_> + + 0 -1 1151 2.6836670003831387e-03 + + 6.0495968908071518e-02 -2.5784969329833984e-01 + <_> + + 0 -1 1152 8.7051279842853546e-02 + + -2.4173669517040253e-02 2.4043059349060059e-01 + <_> + + 0 -1 1153 -1.0178039781749249e-02 + + 2.5469788908958435e-01 -9.2890508472919464e-02 + <_> + + 0 -1 1154 -9.0314531698822975e-03 + + -2.6343479752540588e-01 7.0848807692527771e-02 + <_> + + 0 -1 1155 -6.7082298919558525e-03 + + 2.3313470184803009e-01 -7.6271809637546539e-02 + <_> + + 0 -1 1156 -6.7614473402500153e-02 + + -5.2013260126113892e-01 1.3785160146653652e-02 + <_> + + 0 -1 1157 -3.9636880159378052e-01 + + -7.6267188787460327e-01 2.0686520263552666e-02 + <_> + + 0 -1 1158 1.2813470093533397e-03 + + -1.4046239852905273e-01 1.2711919844150543e-01 + <_> + + 0 -1 1159 8.4416065365076065e-03 + + 7.4712827801704407e-02 -2.5663131475448608e-01 + <_> + + 0 -1 1160 1.4749030015082099e-05 + + -1.4015120267868042e-01 1.5210489928722382e-01 + <_> + + 0 -1 1161 -4.5073211193084717e-02 + + -6.4262861013412476e-01 2.5925450026988983e-02 + <_> + + 0 -1 1162 7.7068619430065155e-03 + + 3.2485689967870712e-02 -2.0377029478549957e-01 + <_> + + 0 -1 1163 5.9383822372183204e-04 + + -1.2950329482555389e-01 1.6219380497932434e-01 + <_> + + 0 -1 1164 -1.3042639475315809e-03 + + 8.6318843066692352e-02 -1.9224709272384644e-01 + <_> + + 0 -1 1165 6.4417850226163864e-03 + + -7.1506053209304810e-02 3.0627349019050598e-01 + <_> + + 0 -1 1166 -1.5630330890417099e-02 + + 4.9515549093484879e-02 -1.4840349555015564e-01 + <_> + + 0 -1 1167 1.1395620182156563e-02 + + 6.3355296850204468e-02 -2.5576409697532654e-01 + <_> + + 0 -1 1168 4.7544430941343307e-02 + + 4.8167328350245953e-03 -7.8987777233123779e-01 + <_> + + 0 -1 1169 8.3856023848056793e-03 + + -4.3012011796236038e-02 4.1108319163322449e-01 + <_> + + 0 -1 1170 -1.6369849909096956e-03 + + 8.2473292946815491e-02 -7.8956812620162964e-02 + <_> + + 0 -1 1171 -1.6513109207153320e-02 + + -5.0692492723464966e-01 3.9071910083293915e-02 + <_> + + 0 -1 1172 1.0358359664678574e-01 + + 2.0772270858287811e-02 -6.9371747970581055e-01 + <_> + + 0 -1 1173 3.3361840993165970e-02 + + -4.4479008764028549e-02 4.6392819285392761e-01 + <_> + + 0 -1 1174 -2.8664430603384972e-02 + + -4.5883670449256897e-01 3.5676170140504837e-02 + <_> + + 0 -1 1175 -1.1209170043002814e-04 + + 8.4344513714313507e-02 -2.1555650234222412e-01 + <_> + + 0 -1 1176 1.7690200358629227e-02 + + 9.7461966797709465e-03 -8.5261541604995728e-01 + <_> + + 0 -1 1177 -2.1878469735383987e-02 + + 2.6345950365066528e-01 -7.0220641791820526e-02 + <_> + + 0 -1 1178 -1.2424430251121521e-01 + + -2.8659409284591675e-01 2.1816140040755272e-02 + <_> + + 0 -1 1179 6.5736092627048492e-02 + + 2.3600580170750618e-02 -7.0263791084289551e-01 + <_> + + 0 -1 1180 -4.4633701443672180e-02 + + -9.5776432752609253e-01 3.5877549089491367e-03 + <_> + + 0 -1 1181 -6.4271576702594757e-02 + + 6.0099518299102783e-01 -2.8557619079947472e-02 + <_> + + 0 -1 1182 5.6516240874771029e-05 + + -1.3485489785671234e-01 1.1080929636955261e-01 + <_> + + 0 -1 1183 1.3419260503724217e-03 + + 9.8325006663799286e-02 -1.6883499920368195e-01 + <_> + + 0 -1 1184 -2.1889729425311089e-02 + + -2.1880550682544708e-01 2.9620679095387459e-02 + <_> + + 0 -1 1185 -1.9670790061354637e-03 + + 9.7642809152603149e-02 -1.8062870204448700e-01 + <_> + + 0 -1 1186 -7.6196521520614624e-02 + + -8.6387622356414795e-01 7.3730680160224438e-03 + <_> + + 0 -1 1187 -7.9841358819976449e-04 + + 1.5353679656982422e-01 -1.2105809897184372e-01 + <_> + + 0 -1 1188 -8.2246732199564576e-04 + + 4.0794339030981064e-02 -1.3737790286540985e-01 + <_> + + 0 -1 1189 -3.0324649997055531e-03 + + 1.2088210135698318e-01 -1.4088730514049530e-01 + <_> + 107 + -3.0838300704956055e+01 + + <_> + + 0 -1 1190 -5.2718650549650192e-02 + + 2.5985679030418396e-01 -1.5721979737281799e-01 + <_> + + 0 -1 1191 5.1614670082926750e-03 + + -1.0271859914064407e-01 5.9346981346607208e-02 + <_> + + 0 -1 1192 6.7699067294597626e-02 + + -7.7311262488365173e-02 2.8602010011672974e-01 + <_> + + 0 -1 1193 -3.3822011202573776e-02 + + -5.6999057531356812e-01 4.0684528648853302e-02 + <_> + + 0 -1 1194 -5.3746398538351059e-02 + + -4.7421398758888245e-01 6.2751591205596924e-02 + <_> + + 0 -1 1195 -3.0559560284018517e-02 + + 7.1638780832290649e-01 -1.7423950135707855e-02 + <_> + + 0 -1 1196 -3.3822011202573776e-02 + + -6.7283177375793457e-01 -1.2177439639344811e-03 + <_> + + 0 -1 1197 2.7876009698957205e-04 + + -7.0205226540565491e-02 1.1648730188608170e-01 + <_> + + 0 -1 1198 -2.5016230065375566e-03 + + 1.2915210425853729e-01 -1.3576079905033112e-01 + <_> + + 0 -1 1199 9.0835839509963989e-02 + + 4.1303969919681549e-03 4.0111660957336426e-01 + <_> + + 0 -1 1200 -2.5603260844945908e-02 + + -1.0059480369091034e-01 1.8819159269332886e-01 + <_> + + 0 -1 1201 -5.2134461700916290e-02 + + 2.5282728672027588e-01 -1.1447659879922867e-01 + <_> + + 0 -1 1202 3.8462068885564804e-02 + + 5.5828869342803955e-02 -5.7635480165481567e-01 + <_> + + 0 -1 1203 -1.4195869443938136e-03 + + 4.5769099146127701e-02 -1.6001120209693909e-01 + <_> + + 0 -1 1204 -7.6488167047500610e-02 + + -5.2531337738037109e-01 5.2011650055646896e-02 + <_> + + 0 -1 1205 1.2786199804395437e-03 + + 7.6051406562328339e-02 -2.5104090571403503e-01 + <_> + + 0 -1 1206 -1.2661969522014260e-03 + + -1.2411650270223618e-01 1.6375949978828430e-01 + <_> + + 0 -1 1207 -9.0841390192508698e-03 + + 2.2613930702209473e-01 -5.4559618234634399e-02 + <_> + + 0 -1 1208 7.4418167059775442e-05 + + -1.6488799452781677e-01 1.0864400118589401e-01 + <_> + + 0 -1 1209 -2.5643699336796999e-03 + + -1.8933239579200745e-01 1.0298830270767212e-01 + <_> + + 0 -1 1210 -3.4997228533029556e-02 + + 2.3746269941329956e-01 -8.2390688359737396e-02 + <_> + + 0 -1 1211 -1.9422829151153564e-02 + + -9.9691540002822876e-02 4.0376558899879456e-02 + <_> + + 0 -1 1212 -5.9601478278636932e-02 + + -9.1162431240081787e-01 1.8367420881986618e-02 + <_> + + 0 -1 1213 3.4046408534049988e-01 + + 6.0519641265273094e-03 -4.4584161043167114e-01 + <_> + + 0 -1 1214 6.5878271125257015e-03 + + -9.5767751336097717e-02 1.8087559938430786e-01 + <_> + + 0 -1 1215 5.3841830231249332e-03 + + 5.2658561617136002e-02 -4.5202389359474182e-01 + <_> + + 0 -1 1216 7.9094972461462021e-03 + + 3.8064301013946533e-02 -4.5984381437301636e-01 + <_> + + 0 -1 1217 -1.7566539347171783e-02 + + 1.1139140278100967e-01 -2.9564509168267250e-02 + <_> + + 0 -1 1218 -1.1352599831297994e-03 + + 1.0825510323047638e-01 -1.8355409801006317e-01 + <_> + + 0 -1 1219 1.4237280189990997e-01 + + -3.1995229423046112e-02 3.8099318742752075e-01 + <_> + + 0 -1 1220 -1.0024409741163254e-01 + + -7.7461862564086914e-01 2.3992599919438362e-02 + <_> + + 0 -1 1221 -1.2453799694776535e-01 + + 2.1255059540271759e-01 -9.1748759150505066e-02 + <_> + + 0 -1 1222 1.9641380012035370e-01 + + 3.3028271049261093e-02 -6.0223150253295898e-01 + <_> + + 0 -1 1223 -4.1467338800430298e-02 + + -8.8264447450637817e-01 1.3399540446698666e-02 + <_> + + 0 -1 1224 -3.0020199716091156e-02 + + 5.8158951997756958e-01 -3.9801310747861862e-02 + <_> + + 0 -1 1225 1.9002150744199753e-02 + + -2.4508230388164520e-02 3.2259100675582886e-01 + <_> + + 0 -1 1226 -1.0837280191481113e-02 + + -2.5428688526153564e-01 7.3384523391723633e-02 + <_> + + 0 -1 1227 -2.4493860080838203e-02 + + 1.4883559942245483e-01 -3.6729950457811356e-02 + <_> + + 0 -1 1228 4.7652618959546089e-03 + + 1.2693640589714050e-01 -1.9157619774341583e-01 + <_> + + 0 -1 1229 -1.2438010424375534e-02 + + 7.1727007627487183e-02 -2.5421911478042603e-01 + <_> + + 0 -1 1230 2.1275319159030914e-02 + + -4.9392588436603546e-02 5.2715432643890381e-01 + <_> + + 0 -1 1231 -6.7369833588600159e-02 + + -4.6891281008720398e-01 4.2881548404693604e-02 + <_> + + 0 -1 1232 -1.0925510432571173e-03 + + 1.1250150203704834e-01 -1.3688379526138306e-01 + <_> + + 0 -1 1233 -9.7863428294658661e-02 + + -8.5167092084884644e-01 7.9745445400476456e-03 + <_> + + 0 -1 1234 -2.0980979315936565e-03 + + 7.2556197643280029e-02 -2.1253560483455658e-01 + <_> + + 0 -1 1235 4.4975668191909790e-02 + + -6.4254011958837509e-03 6.7334640026092529e-01 + <_> + + 0 -1 1236 -2.0970530807971954e-02 + + -1.5341369807720184e-01 1.1229439824819565e-01 + <_> + + 0 -1 1237 7.1862142067402601e-04 + + -1.3690039515495300e-01 1.2323109805583954e-01 + <_> + + 0 -1 1238 1.1921999976038933e-02 + + -5.2036911249160767e-02 3.5095539689064026e-01 + <_> + + 0 -1 1239 -1.2956890277564526e-02 + + 8.7813578546047211e-02 -2.8173919767141342e-02 + <_> + + 0 -1 1240 -2.7972649782896042e-02 + + -5.9018450975418091e-01 2.4770129472017288e-02 + <_> + + 0 -1 1241 -6.0088839381933212e-03 + + -6.5963357686996460e-02 3.6277290433645248e-02 + <_> + + 0 -1 1242 -4.0854439139366150e-03 + + 1.8211939930915833e-01 -8.9567668735980988e-02 + <_> + + 0 -1 1243 6.3200960867106915e-03 + + 2.3888850584626198e-02 -1.0606460273265839e-01 + <_> + + 0 -1 1244 2.0633619278669357e-02 + + -3.8176801055669785e-02 5.2134162187576294e-01 + <_> + + 0 -1 1245 -2.5221719406545162e-03 + + 4.6510368585586548e-02 -9.3957871198654175e-02 + <_> + + 0 -1 1246 -4.6648699790239334e-03 + + -2.3734979331493378e-01 8.0608420073986053e-02 + <_> + + 0 -1 1247 2.5844529736787081e-03 + + -2.4275559931993484e-02 2.2888250648975372e-01 + <_> + + 0 -1 1248 -1.4966880371503066e-05 + + 9.9380202591419220e-02 -1.9830170273780823e-01 + <_> + + 0 -1 1249 6.2676537781953812e-03 + + -7.4367232620716095e-02 2.2790339589118958e-01 + <_> + + 0 -1 1250 2.6347549632191658e-02 + + 1.9285459071397781e-02 -8.8683319091796875e-01 + <_> + + 0 -1 1251 -6.0268949717283249e-02 + + 1.2562690675258636e-01 -3.3716868609189987e-02 + <_> + + 0 -1 1252 -3.8371770642697811e-03 + + -1.7735309898853302e-01 8.8588736951351166e-02 + <_> + + 0 -1 1253 -3.5063549876213074e-03 + + -8.7100908160209656e-02 5.6650858372449875e-02 + <_> + + 0 -1 1254 -8.1536881625652313e-03 + + 2.5863811373710632e-01 -5.9690609574317932e-02 + <_> + + 0 -1 1255 3.8574129343032837e-02 + + 8.4148198366165161e-03 -4.3409061431884766e-01 + <_> + + 0 -1 1256 -3.9269659668207169e-02 + + 3.5469511151313782e-01 -4.3248169124126434e-02 + <_> + + 0 -1 1257 -1.7512469785287976e-03 + + 8.6816087365150452e-02 -9.6924632787704468e-02 + <_> + + 0 -1 1258 -8.4061250090599060e-02 + + -6.5256571769714355e-01 2.4765320122241974e-02 + <_> + + 0 -1 1259 -4.3417539447546005e-02 + + -5.6205427646636963e-01 9.8713487386703491e-03 + <_> + + 0 -1 1260 -1.3643169775605202e-02 + + 2.4562139809131622e-01 -6.0552708804607391e-02 + <_> + + 0 -1 1261 1.6490360721945763e-02 + + 3.8866888731718063e-02 -2.7715849876403809e-01 + <_> + + 0 -1 1262 -1.4422900043427944e-02 + + -2.2820469737052917e-01 5.9026841074228287e-02 + <_> + + 0 -1 1263 2.7178740128874779e-03 + + -1.1887180060148239e-01 1.2192229926586151e-01 + <_> + + 0 -1 1264 6.3701239414513111e-03 + + -1.7167779803276062e-01 9.9555417895317078e-02 + <_> + + 0 -1 1265 8.1290200352668762e-02 + + -2.2509740665555000e-02 2.4472869932651520e-01 + <_> + + 0 -1 1266 -1.4793650188948959e-04 + + 8.0845691263675690e-02 -2.1680369973182678e-01 + <_> + + 0 -1 1267 -6.9097941741347313e-04 + + 6.2281239777803421e-02 -1.4082409441471100e-01 + <_> + + 0 -1 1268 -1.1455359868705273e-02 + + -1.1722529679536819e-01 1.5948510169982910e-01 + <_> + + 0 -1 1269 -1.6334399580955505e-01 + + -3.4727150201797485e-01 1.1003250256180763e-02 + <_> + + 0 -1 1270 -6.8652302026748657e-02 + + 2.5441581010818481e-01 -7.8778758645057678e-02 + <_> + + 0 -1 1271 6.9226641207933426e-03 + + -2.9800569638609886e-02 2.0455279946327209e-01 + <_> + + 0 -1 1272 -1.0851600021123886e-01 + + -4.7375029325485229e-01 4.0704440325498581e-02 + <_> + + 0 -1 1273 5.8868151158094406e-02 + + 1.3014429714530706e-03 -1.0001180171966553e+00 + <_> + + 0 -1 1274 1.5332780312746763e-03 + + -1.6441990435123444e-01 9.9495269358158112e-02 + <_> + + 0 -1 1275 -2.5576220359653234e-03 + + 8.1458933651447296e-02 -9.0945683419704437e-02 + <_> + + 0 -1 1276 3.6009950563311577e-03 + + 8.6760893464088440e-02 -1.9872209429740906e-01 + <_> + + 0 -1 1277 1.0986080393195152e-02 + + -4.8230320215225220e-02 1.9264499843120575e-01 + <_> + + 0 -1 1278 -4.4403300853446126e-04 + + 2.0115670561790466e-01 -8.3059810101985931e-02 + <_> + + 0 -1 1279 2.9464240651577711e-04 + + -1.2808699905872345e-01 6.6652536392211914e-02 + <_> + + 0 -1 1280 -4.1320081800222397e-02 + + -5.3510922193527222e-01 2.9578590765595436e-02 + <_> + + 0 -1 1281 8.1929996609687805e-02 + + -1.6939610242843628e-02 7.6524221897125244e-01 + <_> + + 0 -1 1282 1.4758399687707424e-02 + + 2.7206780388951302e-02 -6.2607800960540771e-01 + <_> + + 0 -1 1283 -1.7577099800109863e-01 + + 1.0328330099582672e-01 -5.1863618195056915e-02 + <_> + + 0 -1 1284 -1.0492449626326561e-02 + + -1.9424819946289062e-01 8.5835307836532593e-02 + <_> + + 0 -1 1285 -5.6793028488755226e-03 + + 1.6252349317073822e-01 -1.1607410013675690e-01 + <_> + + 0 -1 1286 -7.7026091516017914e-02 + + -1.6585369408130646e-01 1.0487639904022217e-01 + <_> + + 0 -1 1287 8.8255241513252258e-02 + + -4.2857029475271702e-03 1.0002230405807495e+00 + <_> + + 0 -1 1288 -2.5600788649171591e-04 + + 1.3218410313129425e-01 -1.4754749834537506e-01 + <_> + + 0 -1 1289 3.4532468765974045e-02 + + -4.7874059528112411e-02 2.7708581089973450e-01 + <_> + + 0 -1 1290 1.0978250205516815e-01 + + -2.1606300026178360e-02 8.5059100389480591e-01 + <_> + + 0 -1 1291 3.6717768758535385e-02 + + 1.6276430338621140e-02 -8.9000707864761353e-01 + <_> + + 0 -1 1292 -6.1206728219985962e-02 + + 5.4838019609451294e-01 -3.1625121831893921e-02 + <_> + + 0 -1 1293 2.9046889394521713e-03 + + 4.1483800858259201e-02 -8.6054533720016479e-02 + <_> + + 0 -1 1294 6.9003179669380188e-02 + + -2.6552880182862282e-02 6.0647368431091309e-01 + <_> + + 0 -1 1295 7.0049421628937125e-04 + + -1.9934299588203430e-01 7.5443200767040253e-02 + <_> + + 0 -1 1296 3.4873239696025848e-02 + + 3.9036870002746582e-02 -4.2251279950141907e-01 + <_> + 71 + -3.0640199661254883e+01 + + <_> + + 0 -1 1297 5.4466608911752701e-02 + + -1.3182820379734039e-01 2.7660441398620605e-01 + <_> + + 0 -1 1298 -2.1856650710105896e-02 + + 2.5475510954856873e-01 -8.4045611321926117e-02 + <_> + + 0 -1 1299 6.6198781132698059e-03 + + 7.1489393711090088e-02 -2.6304081082344055e-01 + <_> + + 0 -1 1300 8.8211596012115479e-03 + + -1.3396710157394409e-01 1.4222930371761322e-01 + <_> + + 0 -1 1301 -2.3251229524612427e-01 + + -3.4628748893737793e-01 5.6767478585243225e-02 + <_> + + 0 -1 1302 2.8472349047660828e-01 + + 8.6089121177792549e-03 -1.0012650489807129e+00 + <_> + + 0 -1 1303 4.2303521186113358e-02 + + -9.1637752950191498e-02 1.9090470671653748e-01 + <_> + + 0 -1 1304 4.9781981855630875e-02 + + 2.9709989205002785e-02 -3.5961869359016418e-01 + <_> + + 0 -1 1305 -4.8924300819635391e-02 + + -3.8387179374694824e-01 5.5182989686727524e-02 + <_> + + 0 -1 1306 -7.7399803558364511e-05 + + -1.2758800387382507e-01 9.4793520867824554e-02 + <_> + + 0 -1 1307 -2.4455290287733078e-02 + + 4.6911829710006714e-01 -5.1782071590423584e-02 + <_> + + 0 -1 1308 2.5210820138454437e-02 + + 4.4035088270902634e-02 -1.7653049528598785e-01 + <_> + + 0 -1 1309 -4.7570910304784775e-02 + + -5.3332722187042236e-01 4.6693909913301468e-02 + <_> + + 0 -1 1310 -1.4046980440616608e-01 + + 3.2798460125923157e-01 -6.5607719123363495e-02 + <_> + + 0 -1 1311 -1.0932429879903793e-01 + + -5.9276747703552246e-01 3.0543249100446701e-02 + <_> + + 0 -1 1312 -9.8567470908164978e-02 + + 3.6753898859024048e-01 -6.6568426787853241e-02 + <_> + + 0 -1 1313 -7.6861098408699036e-02 + + -1.3722559809684753e-01 1.7806069552898407e-01 + <_> + + 0 -1 1314 -2.1035360172390938e-02 + + 4.3632039427757263e-01 -2.9524799436330795e-02 + <_> + + 0 -1 1315 1.3428479433059692e-03 + + -2.4420669674873352e-01 1.1969459801912308e-01 + <_> + + 0 -1 1316 -3.4433171153068542e-02 + + 2.7110278606414795e-01 -7.5950436294078827e-02 + <_> + + 0 -1 1317 1.7944410210475326e-03 + + -1.7997020483016968e-01 1.3508750498294830e-01 + <_> + + 0 -1 1318 -9.6644267439842224e-02 + + -7.6689988374710083e-01 1.5435869805514812e-02 + <_> + + 0 -1 1319 2.5092919822782278e-03 + + -1.2506179511547089e-01 1.8814159929752350e-01 + <_> + + 0 -1 1320 -2.2511319257318974e-03 + + 7.8268818557262421e-02 -7.2636753320693970e-02 + <_> + + 0 -1 1321 -7.4670952017186210e-06 + + 7.6933227479457855e-02 -2.6148709654808044e-01 + <_> + + 0 -1 1322 2.6573959738016129e-02 + + 2.2534679621458054e-02 -1.6299429535865784e-01 + <_> + + 0 -1 1323 1.7086470499634743e-02 + + -5.8232828974723816e-02 3.6095941066741943e-01 + <_> + + 0 -1 1324 3.0147018842399120e-03 + + 1.2817589938640594e-01 -1.8230159580707550e-01 + <_> + + 0 -1 1325 9.4206426292657852e-03 + + 8.9825786650180817e-02 -2.6877298951148987e-01 + <_> + + 0 -1 1326 7.5143040157854557e-04 + + 8.8295407593250275e-02 -2.3304849863052368e-01 + <_> + + 0 -1 1327 -1.0687969624996185e-02 + + 3.0612778663635254e-01 -6.5760366618633270e-02 + <_> + + 0 -1 1328 7.5001686811447144e-02 + + 4.3955240398645401e-03 -7.5094991922378540e-01 + <_> + + 0 -1 1329 5.0849020481109619e-02 + + 2.0524559542536736e-02 -8.3406442403793335e-01 + <_> + + 0 -1 1330 2.3555630818009377e-02 + + 3.6320169456303120e-03 -8.8322782516479492e-01 + <_> + + 0 -1 1331 -1.6827480867505074e-02 + + -6.5697771310806274e-01 2.3138659074902534e-02 + <_> + + 0 -1 1332 1.9977349787950516e-02 + + -2.3847330361604691e-02 3.2636478543281555e-01 + <_> + + 0 -1 1333 3.1397528946399689e-02 + + -3.6343611776828766e-02 4.4792640209197998e-01 + <_> + + 0 -1 1334 -9.3282759189605713e-02 + + -5.2942079305648804e-01 6.3824458047747612e-03 + <_> + + 0 -1 1335 -7.7012612018734217e-04 + + 1.5420450270175934e-01 -1.5751419961452484e-01 + <_> + + 0 -1 1336 4.6891491860151291e-02 + + 1.1802299879491329e-02 -7.3092728853225708e-01 + <_> + + 0 -1 1337 -3.4607138950377703e-03 + + 1.1565960198640823e-01 -1.7568419873714447e-01 + <_> + + 0 -1 1338 -3.3493418246507645e-02 + + -6.8049472570419312e-01 5.1433579064905643e-03 + <_> + + 0 -1 1339 -5.5793918669223785e-02 + + -5.3908890485763550e-01 3.2008830457925797e-02 + <_> + + 0 -1 1340 5.1339478231966496e-03 + + -6.6114626824855804e-02 3.1760030984878540e-01 + <_> + + 0 -1 1341 3.0386429280042648e-03 + + 8.1462718546390533e-02 -2.4291920661926270e-01 + <_> + + 0 -1 1342 -3.1149981077760458e-04 + + 4.6723391860723495e-02 -8.4542676806449890e-02 + <_> + + 0 -1 1343 1.8326110439375043e-03 + + -1.2830300629138947e-01 1.5127150714397430e-01 + <_> + + 0 -1 1344 -2.5878880172967911e-02 + + -2.1160699427127838e-01 2.9811259359121323e-02 + <_> + + 0 -1 1345 -1.3985199620947242e-03 + + 1.9801080226898193e-01 -1.0368689894676208e-01 + <_> + + 0 -1 1346 2.4663188960403204e-03 + + 2.4554869160056114e-02 -1.0830429941415787e-01 + <_> + + 0 -1 1347 -1.3155230553820729e-03 + + -2.1984469890594482e-01 9.3965977430343628e-02 + <_> + + 0 -1 1348 -1.0562440007925034e-01 + + -7.9747790098190308e-01 8.9689819142222404e-03 + <_> + + 0 -1 1349 -3.0508160125464201e-03 + + 1.3266490399837494e-01 -1.3734680414199829e-01 + <_> + + 0 -1 1350 2.9857279732823372e-02 + + 9.6069881692528725e-03 -3.0116540193557739e-01 + <_> + + 0 -1 1351 3.0972119420766830e-02 + + 3.0091350898146629e-02 -5.7279831171035767e-01 + <_> + + 0 -1 1352 1.0772749781608582e-01 + + -1.1804240057244897e-03 -9.9987578392028809e-01 + <_> + + 0 -1 1353 -5.1501881331205368e-02 + + 2.7181380987167358e-01 -6.8161502480506897e-02 + <_> + + 0 -1 1354 -2.5288289412856102e-02 + + 4.5067310333251953e-01 -1.6520980745553970e-02 + <_> + + 0 -1 1355 -4.2859618552029133e-03 + + 3.7213888764381409e-01 -4.9761738628149033e-02 + <_> + + 0 -1 1356 -2.3194460198283195e-02 + + -2.0697650313377380e-01 4.1071210056543350e-02 + <_> + + 0 -1 1357 1.6878530383110046e-02 + + 5.6408129632472992e-02 -3.7614488601684570e-01 + <_> + + 0 -1 1358 -2.9601169750094414e-02 + + 2.7207991480827332e-01 -7.3090076446533203e-02 + <_> + + 0 -1 1359 -1.0797269642353058e-01 + + -4.9193540215492249e-01 3.6118570715188980e-02 + <_> + + 0 -1 1360 2.5317850708961487e-01 + + 8.8794529438018799e-03 -3.4746390581130981e-01 + <_> + + 0 -1 1361 -7.5927868485450745e-02 + + -5.2568101882934570e-01 3.0029149726033211e-02 + <_> + + 0 -1 1362 3.5496079362928867e-03 + + 6.1817318201065063e-02 -2.3450049757957458e-01 + <_> + + 0 -1 1363 -1.0419470258057117e-02 + + 9.5470182597637177e-02 -1.9764930009841919e-01 + <_> + + 0 -1 1364 -1.6242120414972305e-02 + + 3.5856780409812927e-01 -5.2510499954223633e-02 + <_> + + 0 -1 1365 -1.4503370039165020e-03 + + -1.8003490567207336e-01 9.5208331942558289e-02 + <_> + + 0 -1 1366 1.9696209579706192e-02 + + 3.7537660449743271e-02 -4.8065909743309021e-01 + <_> + + 0 -1 1367 3.4964820370078087e-03 + + -9.7187377512454987e-02 1.7569050192832947e-01 + <_> + 96 + -3.0804899215698242e+01 + + <_> + + 0 -1 1368 -1.4011229574680328e-01 + + 3.5787770152091980e-01 -1.2125530093908310e-01 + <_> + + 0 -1 1369 -1.0008949786424637e-02 + + 2.6330929994583130e-01 -8.9008018374443054e-02 + <_> + + 0 -1 1370 -1.1394180357456207e-02 + + 4.3228828907012939e-01 -5.0159178674221039e-02 + <_> + + 0 -1 1371 2.3134359717369080e-01 + + 6.3841762021183968e-03 -7.0292097330093384e-01 + <_> + + 0 -1 1372 1.2646619975566864e-01 + + 4.2768001556396484e-02 -4.3919000029563904e-01 + <_> + + 0 -1 1373 4.6616248786449432e-02 + + 1.9250590354204178e-02 5.4499799013137817e-01 + <_> + + 0 -1 1374 2.2037800401449203e-02 + + -8.5108749568462372e-02 3.3848780393600464e-01 + <_> + + 0 -1 1375 3.1345561146736145e-02 + + 2.2690940648317337e-02 -5.1671189069747925e-01 + <_> + + 0 -1 1376 -2.1140639483928680e-01 + + 2.9412490129470825e-01 -4.6479560434818268e-02 + <_> + + 0 -1 1377 -6.6334113478660583e-02 + + -1.3444049656391144e-01 1.2842020392417908e-01 + <_> + + 0 -1 1378 4.0738668292760849e-02 + + 2.3405810818076134e-02 -8.0233561992645264e-01 + <_> + + 0 -1 1379 -4.1470870375633240e-02 + + 1.4620569348335266e-01 -1.9590210169553757e-02 + <_> + + 0 -1 1380 1.8456790596246719e-02 + + -3.6185469478368759e-02 5.1238268613815308e-01 + <_> + + 0 -1 1381 3.7538509350270033e-03 + + -1.5587760508060455e-01 1.0312390327453613e-01 + <_> + + 0 -1 1382 -2.8798980638384819e-03 + + -1.2225770205259323e-01 1.7551769316196442e-01 + <_> + + 0 -1 1383 -3.2762341201305389e-02 + + -4.7169759869575500e-01 3.0380319803953171e-02 + <_> + + 0 -1 1384 -3.9022210985422134e-02 + + 3.5106760263442993e-01 -6.6119261085987091e-02 + <_> + + 0 -1 1385 -4.4674798846244812e-02 + + -3.9958310127258301e-01 2.1066389977931976e-02 + <_> + + 0 -1 1386 5.3343027830123901e-03 + + 7.9137377440929413e-02 -2.1176779270172119e-01 + <_> + + 0 -1 1387 1.5521169640123844e-02 + + 3.4438930451869965e-02 -5.7202047109603882e-01 + <_> + + 0 -1 1388 -8.0842437455430627e-04 + + 1.1951749771833420e-01 -1.4325830340385437e-01 + <_> + + 0 -1 1389 2.7754740789532661e-02 + + -3.2436888664960861e-02 3.0749228596687317e-01 + <_> + + 0 -1 1390 -3.4786630421876907e-03 + + 1.5688750147819519e-01 -1.5649950504302979e-01 + <_> + + 0 -1 1391 -2.7840979397296906e-02 + + -1.2932580709457397e-01 1.5408019721508026e-01 + <_> + + 0 -1 1392 -2.0033390319440514e-04 + + 1.0591139644384384e-01 -2.3829479515552521e-01 + <_> + + 0 -1 1393 6.3352532684803009e-02 + + -3.5057701170444489e-02 1.1119090020656586e-01 + <_> + + 0 -1 1394 -1.0634259879589081e-01 + + -6.7938178777694702e-01 2.7465900406241417e-02 + <_> + + 0 -1 1395 1.9035820150747895e-04 + + -1.1908160150051117e-01 1.1334689706563950e-01 + <_> + + 0 -1 1396 -1.3564240187406540e-02 + + 2.7505800127983093e-01 -6.8315982818603516e-02 + <_> + + 0 -1 1397 2.1096229553222656e-02 + + -1.0987949557602406e-02 3.9935430884361267e-01 + <_> + + 0 -1 1398 -2.4880920536816120e-03 + + -2.1849539875984192e-01 8.9293807744979858e-02 + <_> + + 0 -1 1399 1.2370670214295387e-02 + + -9.5645450055599213e-02 5.6633960455656052e-02 + <_> + + 0 -1 1400 -1.2036350369453430e-01 + + -5.3174102306365967e-01 3.5775080323219299e-02 + <_> + + 0 -1 1401 -6.7138060927391052e-02 + + 2.1456840634346008e-01 -8.7389126420021057e-02 + <_> + + 0 -1 1402 -1.2161920219659805e-01 + + -1.8160809576511383e-01 1.4573550224304199e-01 + <_> + + 0 -1 1403 2.0479459315538406e-02 + + -5.5715341120958328e-02 6.1189219355583191e-02 + <_> + + 0 -1 1404 2.1847079042345285e-03 + + -9.5258213579654694e-02 2.0591090619564056e-01 + <_> + + 0 -1 1405 4.0952740237116814e-03 + + -1.1867360025644302e-01 4.6696461737155914e-02 + <_> + + 0 -1 1406 -3.5035728942602873e-03 + + 2.3321969807147980e-01 -7.5537599623203278e-02 + <_> + + 0 -1 1407 -1.0467019863426685e-02 + + -1.2448009848594666e-01 5.0595261156558990e-02 + <_> + + 0 -1 1408 -1.5020829625427723e-02 + + 9.1991908848285675e-02 -2.2077399492263794e-01 + <_> + + 0 -1 1409 4.4499050825834274e-02 + + 3.4101899713277817e-02 -5.3422772884368896e-01 + <_> + + 0 -1 1410 8.1879837671294808e-04 + + -1.9193440675735474e-01 1.0177730023860931e-01 + <_> + + 0 -1 1411 -2.9793549329042435e-02 + + 4.1442748904228210e-01 -2.0298149436712265e-02 + <_> + + 0 -1 1412 1.6614329069852829e-02 + + 1.0457099974155426e-01 -1.8352369964122772e-01 + <_> + + 0 -1 1413 -2.2510789334774017e-02 + + 1.8911230564117432e-01 -3.3867038786411285e-02 + <_> + + 0 -1 1414 2.0407250151038170e-02 + + -5.8524370193481445e-02 3.5967621207237244e-01 + <_> + + 0 -1 1415 3.0294319149106741e-03 + + -1.4031639695167542e-01 5.4849781095981598e-02 + <_> + + 0 -1 1416 5.8518280275166035e-04 + + 9.5523588359355927e-02 -1.9650359451770782e-01 + <_> + + 0 -1 1417 1.7756339162588120e-02 + + 1.6195869073271751e-02 -5.8534300327301025e-01 + <_> + + 0 -1 1418 -3.2687620259821415e-03 + + -3.0802598595619202e-01 6.5568111836910248e-02 + <_> + + 0 -1 1419 3.4140530042350292e-03 + + -8.2502417266368866e-02 9.9890269339084625e-02 + <_> + + 0 -1 1420 6.3527207821607590e-03 + + -3.5163778811693192e-02 5.4237622022628784e-01 + <_> + + 0 -1 1421 2.0045090932399035e-03 + + -1.0081720352172852e-01 9.6935041248798370e-02 + <_> + + 0 -1 1422 6.9825910031795502e-03 + + -1.6012389957904816e-01 1.1348509788513184e-01 + <_> + + 0 -1 1423 4.5963011682033539e-02 + + 6.1929170042276382e-03 -8.8551759719848633e-01 + <_> + + 0 -1 1424 3.7062391638755798e-02 + + 2.0128250122070312e-02 -8.0933511257171631e-01 + <_> + + 0 -1 1425 -4.1522808372974396e-02 + + 2.0597919821739197e-01 -3.1927939504384995e-02 + <_> + + 0 -1 1426 1.6521860659122467e-01 + + 2.5524839758872986e-02 -6.2951612472534180e-01 + <_> + + 0 -1 1427 -2.3188880085945129e-01 + + 1.3953979313373566e-01 -6.1611790210008621e-02 + <_> + + 0 -1 1428 -2.8150070458650589e-02 + + -1.3676370680332184e-01 1.1677569895982742e-01 + <_> + + 0 -1 1429 2.0499450620263815e-03 + + -1.5855039656162262e-01 1.3511709868907928e-01 + <_> + + 0 -1 1430 1.2636490282602608e-04 + + -1.5024340152740479e-01 1.3739089667797089e-01 + <_> + + 0 -1 1431 2.4286638945341110e-03 + + 7.9247459769248962e-02 -2.5959441065788269e-01 + <_> + + 0 -1 1432 -2.1873589605093002e-02 + + 3.5590508580207825e-01 -6.1835918575525284e-02 + <_> + + 0 -1 1433 -5.8419788256287575e-03 + + -1.0219120234251022e-01 3.9997130632400513e-02 + <_> + + 0 -1 1434 -2.6236099656671286e-03 + + 1.2129990011453629e-01 -1.4861150085926056e-01 + <_> + + 0 -1 1435 1.4590419828891754e-01 + + -3.6884650588035583e-02 4.1484919190406799e-01 + <_> + + 0 -1 1436 -8.6298510432243347e-03 + + 2.5522458553314209e-01 -6.9871626794338226e-02 + <_> + + 0 -1 1437 -3.9153471589088440e-02 + + -8.5533118247985840e-01 1.4639239758253098e-02 + <_> + + 0 -1 1438 3.8482698798179626e-01 + + 1.7361119389533997e-02 -7.9790550470352173e-01 + <_> + + 0 -1 1439 -6.3598138513043523e-04 + + 1.1518269777297974e-01 -1.4216409623622894e-01 + <_> + + 0 -1 1440 5.9026381932199001e-03 + + 7.0523656904697418e-02 -2.3031190037727356e-01 + <_> + + 0 -1 1441 -1.1841119703603908e-04 + + 1.0401789844036102e-01 -1.7126679420471191e-01 + <_> + + 0 -1 1442 8.1962659955024719e-02 + + 2.7799099683761597e-02 -5.8331722021102905e-01 + <_> + + 0 -1 1443 -7.9551688395440578e-04 + + 1.2568520009517670e-01 -1.0317719727754593e-01 + <_> + + 0 -1 1444 -1.5588940680027008e-01 + + 6.2890201807022095e-01 -2.5191979482769966e-02 + <_> + + 0 -1 1445 -1.3456310145556927e-02 + + -3.2471698522567749e-01 5.5486921221017838e-02 + <_> + + 0 -1 1446 -2.1507199853658676e-02 + + 2.8819179534912109e-01 -6.1176139861345291e-02 + <_> + + 0 -1 1447 -1.9042069092392921e-02 + + -6.0552909970283508e-02 8.9629061520099640e-02 + <_> + + 0 -1 1448 -9.1205362696200609e-04 + + 1.2385459989309311e-01 -1.3584870100021362e-01 + <_> + + 0 -1 1449 3.8202628493309021e-02 + + 1.9218420609831810e-02 -8.4488832950592041e-01 + <_> + + 0 -1 1450 5.1787391304969788e-02 + + -5.4830659180879593e-02 3.3352980017662048e-01 + <_> + + 0 -1 1451 -1.3860349357128143e-01 + + -2.7164599299430847e-01 1.0680199600756168e-02 + <_> + + 0 -1 1452 -3.9325959980487823e-02 + + -7.6043432950973511e-01 1.9320670515298843e-02 + <_> + + 0 -1 1453 -1.1157010449096560e-03 + + 6.9478519260883331e-02 -2.0327170193195343e-01 + <_> + + 0 -1 1454 -4.2068599723279476e-03 + + 1.6007219254970551e-01 -1.0982350260019302e-01 + <_> + + 0 -1 1455 3.7919029127806425e-03 + + -8.3800643682479858e-02 2.5154781341552734e-01 + <_> + + 0 -1 1456 -3.1430590897798538e-02 + + -5.0590312480926514e-01 3.7667378783226013e-02 + <_> + + 0 -1 1457 -4.3412651866674423e-03 + + 5.8591969311237335e-02 -1.7271269857883453e-01 + <_> + + 0 -1 1458 -5.6401407346129417e-04 + + 1.0131839662790298e-01 -1.6737550497055054e-01 + <_> + + 0 -1 1459 -1.7139960080385208e-02 + + 4.9619451165199280e-02 -1.1812750250101089e-01 + <_> + + 0 -1 1460 -2.3868490010499954e-02 + + -9.5875509083271027e-02 1.8404319882392883e-01 + <_> + + 0 -1 1461 -8.7408810853958130e-02 + + 1.4144630730152130e-01 -5.7713828980922699e-02 + <_> + + 0 -1 1462 -3.9170090109109879e-02 + + -6.1036241054534912e-01 2.2308109328150749e-02 + <_> + + 0 -1 1463 5.3361579775810242e-02 + + 1.5027640387415886e-02 -6.5409141778945923e-01 + + <_> + + <_> + 1 5 12 21 -1. + <_> + 5 5 4 21 3. + <_> + + <_> + 9 2 3 26 -1. + <_> + 9 15 3 13 2. + <_> + + <_> + 1 4 12 23 -1. + <_> + 5 4 4 23 3. + <_> + + <_> + 1 7 12 9 -1. + <_> + 4 7 6 9 2. + <_> + + <_> + 3 12 3 16 -1. + <_> + 3 20 3 8 2. + <_> + + <_> + 4 8 6 6 -1. + <_> + 4 11 6 3 2. + <_> + + <_> + 1 25 12 3 -1. + <_> + 5 25 4 3 3. + <_> + + <_> + 6 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 4 2 4 12 -1. + <_> + 4 2 2 6 2. + <_> + 6 8 2 6 2. + <_> + + <_> + 3 15 8 11 -1. + <_> + 5 15 4 11 2. + <_> + + <_> + 6 9 6 6 -1. + <_> + 8 9 2 6 3. + <_> + + <_> + 2 9 6 6 -1. + <_> + 4 9 2 6 3. + <_> + + <_> + 8 0 5 28 -1. + <_> + 8 14 5 14 2. + <_> + + <_> + 2 24 10 4 -1. + <_> + 7 24 5 4 2. + <_> + + <_> + 3 15 8 11 -1. + <_> + 5 15 4 11 2. + <_> + + <_> + 0 25 14 3 -1. + <_> + 7 25 7 3 2. + <_> + + <_> + 1 11 12 13 -1. + <_> + 5 11 4 13 3. + <_> + + <_> + 1 2 12 21 -1. + <_> + 5 9 4 7 9. + <_> + + <_> + 10 0 3 28 -1. + <_> + 10 14 3 14 2. + <_> + + <_> + 1 0 3 28 -1. + <_> + 1 14 3 14 2. + <_> + + <_> + 5 5 6 8 -1. + <_> + 8 5 3 4 2. + <_> + 5 9 3 4 2. + <_> + + <_> + 3 5 6 8 -1. + <_> + 3 5 3 4 2. + <_> + 6 9 3 4 2. + <_> + + <_> + 10 16 4 12 -1. + <_> + 12 16 2 6 2. + <_> + 10 22 2 6 2. + <_> + + <_> + 4 8 6 4 -1. + <_> + 4 10 6 2 2. + <_> + + <_> + 3 5 8 21 -1. + <_> + 5 5 4 21 2. + <_> + + <_> + 1 15 12 12 -1. + <_> + 7 15 6 6 2. + <_> + 1 21 6 6 2. + <_> + + <_> + 0 25 12 3 -1. + <_> + 6 25 6 3 2. + <_> + + <_> + 8 14 3 8 -1. + <_> + 8 14 3 4 2. + 1 + <_> + + <_> + 0 25 8 3 -1. + <_> + 4 25 4 3 2. + <_> + + <_> + 2 24 12 4 -1. + <_> + 5 24 6 4 2. + <_> + + <_> + 1 18 4 6 -1. + <_> + 3 18 2 6 2. + <_> + + <_> + 8 8 4 7 -1. + <_> + 8 8 2 7 2. + <_> + + <_> + 2 8 4 7 -1. + <_> + 4 8 2 7 2. + <_> + + <_> + 1 3 12 18 -1. + <_> + 1 3 6 18 2. + <_> + + <_> + 1 20 4 8 -1. + <_> + 3 20 2 8 2. + <_> + + <_> + 6 10 7 18 -1. + <_> + 6 19 7 9 2. + <_> + + <_> + 4 8 3 13 -1. + <_> + 5 8 1 13 3. + <_> + + <_> + 10 22 4 6 -1. + <_> + 10 22 2 6 2. + <_> + + <_> + 1 0 12 27 -1. + <_> + 5 9 4 9 9. + <_> + + <_> + 2 20 12 7 -1. + <_> + 5 20 6 7 2. + <_> + + <_> + 2 25 10 3 -1. + <_> + 7 25 5 3 2. + <_> + + <_> + 0 26 14 2 -1. + <_> + 0 26 7 2 2. + <_> + + <_> + 3 15 8 9 -1. + <_> + 5 15 4 9 2. + <_> + + <_> + 8 23 6 5 -1. + <_> + 8 23 3 5 2. + <_> + + <_> + 0 26 14 2 -1. + <_> + 7 26 7 2 2. + <_> + + <_> + 8 10 2 18 -1. + <_> + 8 19 2 9 2. + <_> + + <_> + 4 4 4 12 -1. + <_> + 4 4 2 6 2. + <_> + 6 10 2 6 2. + <_> + + <_> + 4 24 9 4 -1. + <_> + 7 24 3 4 3. + <_> + + <_> + 1 3 12 15 -1. + <_> + 5 8 4 5 9. + <_> + + <_> + 11 16 2 12 -1. + <_> + 11 16 1 12 2. + <_> + + <_> + 2 4 7 16 -1. + <_> + 2 12 7 8 2. + <_> + + <_> + 8 8 4 6 -1. + <_> + 8 8 2 6 2. + <_> + + <_> + 3 8 8 6 -1. + <_> + 3 11 8 3 2. + <_> + + <_> + 8 8 6 8 -1. + <_> + 10 8 2 8 3. + <_> + + <_> + 0 8 6 7 -1. + <_> + 2 8 2 7 3. + <_> + + <_> + 2 25 12 3 -1. + <_> + 6 25 4 3 3. + <_> + + <_> + 0 25 12 3 -1. + <_> + 4 25 4 3 3. + <_> + + <_> + 1 7 12 4 -1. + <_> + 1 7 6 4 2. + <_> + + <_> + 0 2 14 12 -1. + <_> + 7 2 7 12 2. + <_> + + <_> + 0 19 14 6 -1. + <_> + 7 19 7 3 2. + <_> + 0 22 7 3 2. + <_> + + <_> + 1 14 12 6 -1. + <_> + 5 14 4 6 3. + <_> + + <_> + 2 24 12 4 -1. + <_> + 5 24 6 4 2. + <_> + + <_> + 2 1 4 14 -1. + <_> + 2 1 2 7 2. + <_> + 4 8 2 7 2. + <_> + + <_> + 10 3 4 6 -1. + <_> + 10 3 2 6 2. + 1 + <_> + + <_> + 4 3 6 4 -1. + <_> + 4 3 6 2 2. + 1 + <_> + + <_> + 0 16 14 8 -1. + <_> + 0 16 7 8 2. + <_> + + <_> + 5 16 3 12 -1. + <_> + 6 16 1 12 3. + <_> + + <_> + 7 15 4 7 -1. + <_> + 7 15 2 7 2. + <_> + + <_> + 3 15 4 8 -1. + <_> + 5 15 2 8 2. + <_> + + <_> + 9 17 4 8 -1. + <_> + 9 17 2 8 2. + <_> + + <_> + 1 17 4 8 -1. + <_> + 3 17 2 8 2. + <_> + + <_> + 9 18 4 7 -1. + <_> + 9 18 2 7 2. + <_> + + <_> + 1 18 4 7 -1. + <_> + 3 18 2 7 2. + <_> + + <_> + 7 5 4 6 -1. + <_> + 7 5 2 6 2. + 1 + <_> + + <_> + 7 5 6 4 -1. + <_> + 7 5 6 2 2. + 1 + <_> + + <_> + 2 26 12 2 -1. + <_> + 2 26 6 2 2. + <_> + + <_> + 4 7 3 12 -1. + <_> + 5 7 1 12 3. + <_> + + <_> + 1 7 12 11 -1. + <_> + 4 7 6 11 2. + <_> + + <_> + 6 13 8 4 -1. + <_> + 6 13 4 4 2. + 1 + <_> + + <_> + 5 22 6 4 -1. + <_> + 5 22 3 4 2. + <_> + + <_> + 0 26 14 2 -1. + <_> + 7 26 7 2 2. + <_> + + <_> + 1 3 12 18 -1. + <_> + 5 9 4 6 9. + <_> + + <_> + 0 6 9 22 -1. + <_> + 0 17 9 11 2. + <_> + + <_> + 1 1 12 24 -1. + <_> + 7 1 6 12 2. + <_> + 1 13 6 12 2. + <_> + + <_> + 0 26 12 2 -1. + <_> + 6 26 6 2 2. + <_> + + <_> + 1 4 12 23 -1. + <_> + 5 4 4 23 3. + <_> + + <_> + 5 22 6 5 -1. + <_> + 5 22 3 5 2. + <_> + + <_> + 3 22 6 5 -1. + <_> + 6 22 3 5 2. + <_> + + <_> + 5 1 4 6 -1. + <_> + 5 4 4 3 2. + <_> + + <_> + 1 8 12 8 -1. + <_> + 4 8 6 8 2. + <_> + + <_> + 6 8 5 12 -1. + <_> + 6 11 5 6 2. + <_> + + <_> + 0 20 14 6 -1. + <_> + 0 20 7 3 2. + <_> + 7 23 7 3 2. + <_> + + <_> + 6 9 6 6 -1. + <_> + 8 9 2 6 3. + <_> + + <_> + 5 8 4 6 -1. + <_> + 7 8 2 6 2. + <_> + + <_> + 2 13 12 15 -1. + <_> + 2 18 12 5 3. + <_> + + <_> + 0 16 4 12 -1. + <_> + 0 16 2 6 2. + <_> + 2 22 2 6 2. + <_> + + <_> + 9 2 2 26 -1. + <_> + 10 2 1 13 2. + <_> + 9 15 1 13 2. + <_> + + <_> + 3 2 2 26 -1. + <_> + 3 2 1 13 2. + <_> + 4 15 1 13 2. + <_> + + <_> + 10 22 4 6 -1. + <_> + 10 22 2 6 2. + <_> + + <_> + 0 1 12 12 -1. + <_> + 4 5 4 4 9. + <_> + + <_> + 6 15 3 12 -1. + <_> + 7 15 1 12 3. + <_> + + <_> + 5 10 3 15 -1. + <_> + 6 10 1 15 3. + <_> + + <_> + 10 22 4 6 -1. + <_> + 10 22 2 6 2. + <_> + + <_> + 0 10 8 18 -1. + <_> + 0 19 8 9 2. + <_> + + <_> + 5 16 8 12 -1. + <_> + 9 16 4 6 2. + <_> + 5 22 4 6 2. + <_> + + <_> + 0 25 8 3 -1. + <_> + 4 25 4 3 2. + <_> + + <_> + 0 17 14 8 -1. + <_> + 7 17 7 4 2. + <_> + 0 21 7 4 2. + <_> + + <_> + 2 15 6 4 -1. + <_> + 5 15 3 4 2. + <_> + + <_> + 5 23 9 4 -1. + <_> + 8 23 3 4 3. + <_> + + <_> + 0 23 9 5 -1. + <_> + 3 23 3 5 3. + <_> + + <_> + 1 4 12 22 -1. + <_> + 5 4 4 22 3. + <_> + + <_> + 1 4 5 24 -1. + <_> + 1 10 5 12 2. + <_> + + <_> + 2 23 12 4 -1. + <_> + 5 23 6 4 2. + <_> + + <_> + 3 16 4 12 -1. + <_> + 5 16 2 12 2. + <_> + + <_> + 1 17 12 11 -1. + <_> + 1 17 6 11 2. + <_> + + <_> + 5 16 3 12 -1. + <_> + 6 16 1 12 3. + <_> + + <_> + 8 17 4 6 -1. + <_> + 8 17 4 3 2. + 1 + <_> + + <_> + 7 16 4 6 -1. + <_> + 7 16 2 6 2. + 1 + <_> + + <_> + 6 2 4 6 -1. + <_> + 6 2 2 6 2. + <_> + + <_> + 2 12 5 16 -1. + <_> + 2 20 5 8 2. + <_> + + <_> + 6 13 3 14 -1. + <_> + 7 13 1 14 3. + <_> + + <_> + 6 6 8 3 -1. + <_> + 6 6 4 3 2. + 1 + <_> + + <_> + 0 8 14 6 -1. + <_> + 0 11 14 3 2. + <_> + + <_> + 2 7 4 7 -1. + <_> + 4 7 2 7 2. + <_> + + <_> + 8 8 4 6 -1. + <_> + 8 8 2 6 2. + <_> + + <_> + 3 13 8 13 -1. + <_> + 5 13 4 13 2. + <_> + + <_> + 8 2 4 12 -1. + <_> + 10 2 2 6 2. + <_> + 8 8 2 6 2. + <_> + + <_> + 2 2 4 12 -1. + <_> + 2 2 2 6 2. + <_> + 4 8 2 6 2. + <_> + + <_> + 6 24 8 3 -1. + <_> + 6 24 4 3 2. + <_> + + <_> + 3 16 2 12 -1. + <_> + 4 16 1 12 2. + <_> + + <_> + 0 21 14 6 -1. + <_> + 0 21 7 6 2. + <_> + + <_> + 0 11 8 4 -1. + <_> + 4 11 4 4 2. + <_> + + <_> + 1 2 12 5 -1. + <_> + 5 2 4 5 3. + <_> + + <_> + 2 1 6 21 -1. + <_> + 4 8 2 7 9. + <_> + + <_> + 11 16 2 12 -1. + <_> + 11 16 1 12 2. + <_> + + <_> + 7 17 6 5 -1. + <_> + 7 17 3 5 2. + 1 + <_> + + <_> + 6 16 3 12 -1. + <_> + 7 16 1 12 3. + <_> + + <_> + 1 16 2 12 -1. + <_> + 2 16 1 12 2. + <_> + + <_> + 7 13 3 12 -1. + <_> + 8 13 1 12 3. + <_> + + <_> + 6 17 4 6 -1. + <_> + 6 17 2 6 2. + 1 + <_> + + <_> + 6 8 4 6 -1. + <_> + 6 11 4 3 2. + <_> + + <_> + 1 5 8 12 -1. + <_> + 1 11 8 6 2. + <_> + + <_> + 7 13 3 12 -1. + <_> + 8 13 1 12 3. + <_> + + <_> + 6 6 8 3 -1. + <_> + 6 6 4 3 2. + 1 + <_> + + <_> + 7 14 3 12 -1. + <_> + 8 14 1 12 3. + <_> + + <_> + 0 25 12 3 -1. + <_> + 4 25 4 3 3. + <_> + + <_> + 7 17 4 8 -1. + <_> + 7 17 2 8 2. + <_> + + <_> + 3 17 4 8 -1. + <_> + 5 17 2 8 2. + <_> + + <_> + 8 24 6 4 -1. + <_> + 8 24 3 4 2. + <_> + + <_> + 2 22 6 6 -1. + <_> + 4 22 2 6 3. + <_> + + <_> + 8 15 5 8 -1. + <_> + 8 15 5 4 2. + 1 + <_> + + <_> + 6 15 8 5 -1. + <_> + 6 15 4 5 2. + 1 + <_> + + <_> + 1 8 12 7 -1. + <_> + 4 8 6 7 2. + <_> + + <_> + 0 10 6 10 -1. + <_> + 0 15 6 5 2. + <_> + + <_> + 7 4 4 22 -1. + <_> + 7 15 4 11 2. + <_> + + <_> + 1 4 12 22 -1. + <_> + 4 4 6 22 2. + <_> + + <_> + 6 3 4 12 -1. + <_> + 8 3 2 6 2. + <_> + 6 9 2 6 2. + <_> + + <_> + 5 16 3 12 -1. + <_> + 6 16 1 12 3. + <_> + + <_> + 5 5 6 8 -1. + <_> + 8 5 3 4 2. + <_> + 5 9 3 4 2. + <_> + + <_> + 3 5 6 8 -1. + <_> + 3 5 3 4 2. + <_> + 6 9 3 4 2. + <_> + + <_> + 8 4 6 4 -1. + <_> + 8 4 6 2 2. + 1 + <_> + + <_> + 5 10 3 18 -1. + <_> + 5 19 3 9 2. + <_> + + <_> + 7 6 4 6 -1. + <_> + 7 6 4 3 2. + 1 + <_> + + <_> + 7 6 6 4 -1. + <_> + 7 6 3 4 2. + 1 + <_> + + <_> + 6 24 8 3 -1. + <_> + 6 24 4 3 2. + <_> + + <_> + 1 11 12 5 -1. + <_> + 4 11 6 5 2. + <_> + + <_> + 10 22 4 6 -1. + <_> + 10 22 2 6 2. + <_> + + <_> + 2 3 4 12 -1. + <_> + 2 3 2 6 2. + <_> + 4 9 2 6 2. + <_> + + <_> + 10 22 4 6 -1. + <_> + 10 22 2 6 2. + <_> + + <_> + 0 22 4 6 -1. + <_> + 2 22 2 6 2. + <_> + + <_> + 6 15 3 12 -1. + <_> + 7 15 1 12 3. + <_> + + <_> + 7 16 4 6 -1. + <_> + 7 16 2 6 2. + 1 + <_> + + <_> + 4 2 6 6 -1. + <_> + 4 4 6 2 3. + <_> + + <_> + 3 16 2 12 -1. + <_> + 4 16 1 12 2. + <_> + + <_> + 7 16 2 12 -1. + <_> + 7 16 1 12 2. + <_> + + <_> + 5 9 4 6 -1. + <_> + 7 9 2 6 2. + <_> + + <_> + 7 15 2 12 -1. + <_> + 7 15 1 12 2. + <_> + + <_> + 5 15 2 12 -1. + <_> + 6 15 1 12 2. + <_> + + <_> + 2 25 12 2 -1. + <_> + 2 25 6 2 2. + <_> + + <_> + 3 16 4 12 -1. + <_> + 3 16 2 6 2. + <_> + 5 22 2 6 2. + <_> + + <_> + 6 24 8 3 -1. + <_> + 6 24 4 3 2. + <_> + + <_> + 0 25 12 2 -1. + <_> + 6 25 6 2 2. + <_> + + <_> + 4 1 6 27 -1. + <_> + 4 10 6 9 3. + <_> + + <_> + 6 16 3 12 -1. + <_> + 7 16 1 12 3. + <_> + + <_> + 3 21 6 4 -1. + <_> + 6 21 3 4 2. + <_> + + <_> + 4 2 6 12 -1. + <_> + 4 8 6 6 2. + <_> + + <_> + 6 0 6 4 -1. + <_> + 6 0 3 4 2. + 1 + <_> + + <_> + 6 4 3 14 -1. + <_> + 7 4 1 14 3. + <_> + + <_> + 4 8 6 6 -1. + <_> + 6 8 2 6 3. + <_> + + <_> + 2 24 12 4 -1. + <_> + 6 24 4 4 3. + <_> + + <_> + 0 24 12 4 -1. + <_> + 4 24 4 4 3. + <_> + + <_> + 8 13 3 12 -1. + <_> + 9 13 1 12 3. + <_> + + <_> + 1 22 4 6 -1. + <_> + 3 22 2 6 2. + <_> + + <_> + 7 7 3 12 -1. + <_> + 8 7 1 12 3. + <_> + + <_> + 4 7 3 12 -1. + <_> + 5 7 1 12 3. + <_> + + <_> + 4 1 8 3 -1. + <_> + 4 1 4 3 2. + <_> + + <_> + 4 4 3 23 -1. + <_> + 5 4 1 23 3. + <_> + + <_> + 9 21 4 7 -1. + <_> + 9 21 2 7 2. + <_> + + <_> + 5 14 3 12 -1. + <_> + 6 14 1 12 3. + <_> + + <_> + 2 26 12 2 -1. + <_> + 2 26 6 2 2. + <_> + + <_> + 0 26 12 2 -1. + <_> + 6 26 6 2 2. + <_> + + <_> + 8 13 3 12 -1. + <_> + 9 13 1 12 3. + <_> + + <_> + 3 13 3 12 -1. + <_> + 4 13 1 12 3. + <_> + + <_> + 3 2 8 20 -1. + <_> + 3 7 8 10 2. + <_> + + <_> + 2 18 12 8 -1. + <_> + 5 18 6 8 2. + <_> + + <_> + 4 9 6 6 -1. + <_> + 6 9 2 6 3. + <_> + + <_> + 2 18 12 8 -1. + <_> + 5 18 6 8 2. + <_> + + <_> + 0 24 8 4 -1. + <_> + 4 24 4 4 2. + <_> + + <_> + 6 2 2 24 -1. + <_> + 7 2 1 12 2. + <_> + 6 14 1 12 2. + <_> + + <_> + 5 8 4 12 -1. + <_> + 5 8 2 6 2. + <_> + 7 14 2 6 2. + <_> + + <_> + 7 3 6 6 -1. + <_> + 7 3 3 6 2. + 1 + <_> + + <_> + 0 8 6 7 -1. + <_> + 2 8 2 7 3. + <_> + + <_> + 7 3 6 6 -1. + <_> + 7 3 3 6 2. + 1 + <_> + + <_> + 4 8 6 4 -1. + <_> + 7 8 3 4 2. + <_> + + <_> + 2 7 10 19 -1. + <_> + 2 7 5 19 2. + <_> + + <_> + 0 4 11 24 -1. + <_> + 0 16 11 12 2. + <_> + + <_> + 1 1 12 21 -1. + <_> + 5 8 4 7 9. + <_> + + <_> + 0 18 12 8 -1. + <_> + 3 18 6 8 2. + <_> + + <_> + 9 17 4 8 -1. + <_> + 9 17 2 8 2. + <_> + + <_> + 4 7 4 6 -1. + <_> + 4 10 4 3 2. + <_> + + <_> + 7 7 5 9 -1. + <_> + 7 10 5 3 3. + <_> + + <_> + 1 17 4 8 -1. + <_> + 3 17 2 8 2. + <_> + + <_> + 9 15 3 13 -1. + <_> + 10 15 1 13 3. + <_> + + <_> + 3 0 6 8 -1. + <_> + 3 0 3 4 2. + <_> + 6 4 3 4 2. + <_> + + <_> + 9 18 4 10 -1. + <_> + 9 18 2 10 2. + <_> + + <_> + 1 18 4 10 -1. + <_> + 3 18 2 10 2. + <_> + + <_> + 7 22 2 4 -1. + <_> + 7 22 1 4 2. + 1 + <_> + + <_> + 7 22 4 2 -1. + <_> + 7 22 4 1 2. + 1 + <_> + + <_> + 7 7 5 9 -1. + <_> + 7 10 5 3 3. + <_> + + <_> + 1 7 12 11 -1. + <_> + 4 7 6 11 2. + <_> + + <_> + 8 6 3 8 -1. + <_> + 8 6 3 4 2. + 1 + <_> + + <_> + 5 8 3 16 -1. + <_> + 5 12 3 8 2. + <_> + + <_> + 8 6 3 8 -1. + <_> + 8 6 3 4 2. + 1 + <_> + + <_> + 6 6 8 3 -1. + <_> + 6 6 4 3 2. + 1 + <_> + + <_> + 2 24 12 3 -1. + <_> + 6 24 4 3 3. + <_> + + <_> + 3 5 6 4 -1. + <_> + 3 7 6 2 2. + <_> + + <_> + 4 5 6 4 -1. + <_> + 4 7 6 2 2. + <_> + + <_> + 4 14 6 6 -1. + <_> + 6 14 2 6 3. + <_> + + <_> + 6 11 3 13 -1. + <_> + 7 11 1 13 3. + <_> + + <_> + 0 24 12 3 -1. + <_> + 4 24 4 3 3. + <_> + + <_> + 9 16 2 12 -1. + <_> + 9 16 1 12 2. + <_> + + <_> + 3 16 2 12 -1. + <_> + 4 16 1 12 2. + <_> + + <_> + 7 16 2 12 -1. + <_> + 7 16 1 12 2. + <_> + + <_> + 0 21 4 6 -1. + <_> + 2 21 2 6 2. + <_> + + <_> + 7 16 2 12 -1. + <_> + 7 16 1 12 2. + <_> + + <_> + 2 3 10 16 -1. + <_> + 2 3 5 8 2. + <_> + 7 11 5 8 2. + <_> + + <_> + 4 12 6 16 -1. + <_> + 4 20 6 8 2. + <_> + + <_> + 1 15 12 11 -1. + <_> + 4 15 6 11 2. + <_> + + <_> + 3 4 6 10 -1. + <_> + 3 4 3 5 2. + <_> + 6 9 3 5 2. + <_> + + <_> + 2 24 12 4 -1. + <_> + 8 24 6 2 2. + <_> + 2 26 6 2 2. + <_> + + <_> + 0 24 12 4 -1. + <_> + 0 24 6 2 2. + <_> + 6 26 6 2 2. + <_> + + <_> + 8 4 6 4 -1. + <_> + 8 4 6 2 2. + 1 + <_> + + <_> + 1 2 12 18 -1. + <_> + 5 8 4 6 9. + <_> + + <_> + 2 22 10 6 -1. + <_> + 2 22 5 6 2. + <_> + + <_> + 1 26 12 2 -1. + <_> + 7 26 6 2 2. + <_> + + <_> + 8 4 6 4 -1. + <_> + 8 4 6 2 2. + 1 + <_> + + <_> + 0 12 10 4 -1. + <_> + 5 12 5 4 2. + <_> + + <_> + 4 8 6 4 -1. + <_> + 4 10 6 2 2. + <_> + + <_> + 5 1 4 12 -1. + <_> + 5 4 4 6 2. + <_> + + <_> + 7 4 6 8 -1. + <_> + 10 4 3 4 2. + <_> + 7 8 3 4 2. + <_> + + <_> + 0 18 14 4 -1. + <_> + 0 18 7 2 2. + <_> + 7 20 7 2 2. + <_> + + <_> + 7 16 2 12 -1. + <_> + 7 16 1 12 2. + <_> + + <_> + 4 15 3 12 -1. + <_> + 5 15 1 12 3. + <_> + + <_> + 8 9 2 13 -1. + <_> + 8 9 1 13 2. + <_> + + <_> + 5 10 4 6 -1. + <_> + 7 10 2 6 2. + <_> + + <_> + 3 11 8 5 -1. + <_> + 3 11 4 5 2. + <_> + + <_> + 5 16 2 12 -1. + <_> + 6 16 1 12 2. + <_> + + <_> + 0 7 10 17 -1. + <_> + 5 7 5 17 2. + <_> + + <_> + 3 7 8 4 -1. + <_> + 3 9 8 2 2. + <_> + + <_> + 5 0 4 24 -1. + <_> + 5 8 4 8 3. + <_> + + <_> + 3 16 9 4 -1. + <_> + 6 16 3 4 3. + <_> + + <_> + 7 14 6 4 -1. + <_> + 7 14 3 4 2. + 1 + <_> + + <_> + 5 23 9 4 -1. + <_> + 8 23 3 4 3. + <_> + + <_> + 0 22 9 4 -1. + <_> + 3 22 3 4 3. + <_> + + <_> + 9 22 4 6 -1. + <_> + 9 22 2 6 2. + <_> + + <_> + 1 24 6 4 -1. + <_> + 4 24 3 4 2. + <_> + + <_> + 4 19 8 9 -1. + <_> + 6 19 4 9 2. + <_> + + <_> + 2 19 8 9 -1. + <_> + 4 19 4 9 2. + <_> + + <_> + 2 22 12 4 -1. + <_> + 5 22 6 4 2. + <_> + + <_> + 0 19 14 7 -1. + <_> + 7 19 7 7 2. + <_> + + <_> + 5 20 6 8 -1. + <_> + 8 20 3 4 2. + <_> + 5 24 3 4 2. + <_> + + <_> + 3 20 6 8 -1. + <_> + 3 20 3 4 2. + <_> + 6 24 3 4 2. + <_> + + <_> + 6 1 4 14 -1. + <_> + 8 1 2 7 2. + <_> + 6 8 2 7 2. + <_> + + <_> + 2 2 4 12 -1. + <_> + 2 2 2 6 2. + <_> + 4 8 2 6 2. + <_> + + <_> + 7 4 6 4 -1. + <_> + 7 4 3 4 2. + 1 + <_> + + <_> + 7 4 4 6 -1. + <_> + 7 4 4 3 2. + 1 + <_> + + <_> + 7 3 6 5 -1. + <_> + 7 3 3 5 2. + 1 + <_> + + <_> + 7 3 5 6 -1. + <_> + 7 3 5 3 2. + 1 + <_> + + <_> + 7 3 6 4 -1. + <_> + 7 3 6 2 2. + 1 + <_> + + <_> + 3 2 8 18 -1. + <_> + 3 8 8 6 3. + <_> + + <_> + 4 15 9 12 -1. + <_> + 7 19 3 4 9. + <_> + + <_> + 1 21 12 6 -1. + <_> + 7 21 6 6 2. + <_> + + <_> + 9 18 4 8 -1. + <_> + 9 18 2 8 2. + <_> + + <_> + 2 16 9 4 -1. + <_> + 5 16 3 4 3. + <_> + + <_> + 4 17 10 6 -1. + <_> + 4 17 5 6 2. + <_> + + <_> + 1 18 4 8 -1. + <_> + 3 18 2 8 2. + <_> + + <_> + 9 3 5 6 -1. + <_> + 9 3 5 3 2. + 1 + <_> + + <_> + 1 17 8 6 -1. + <_> + 5 17 4 6 2. + <_> + + <_> + 2 19 12 9 -1. + <_> + 6 22 4 3 9. + <_> + + <_> + 2 0 4 14 -1. + <_> + 2 0 2 7 2. + <_> + 4 7 2 7 2. + <_> + + <_> + 4 9 10 14 -1. + <_> + 9 9 5 7 2. + <_> + 4 16 5 7 2. + <_> + + <_> + 0 16 4 12 -1. + <_> + 0 16 2 6 2. + <_> + 2 22 2 6 2. + <_> + + <_> + 3 24 8 4 -1. + <_> + 3 24 4 4 2. + <_> + + <_> + 0 5 14 22 -1. + <_> + 0 16 14 11 2. + <_> + + <_> + 6 13 6 8 -1. + <_> + 6 17 6 4 2. + <_> + + <_> + 0 9 10 14 -1. + <_> + 0 9 5 7 2. + <_> + 5 16 5 7 2. + <_> + + <_> + 3 3 9 9 -1. + <_> + 3 6 9 3 3. + <_> + + <_> + 5 1 4 6 -1. + <_> + 5 4 4 3 2. + <_> + + <_> + 1 0 12 9 -1. + <_> + 5 3 4 3 9. + <_> + + <_> + 4 7 6 12 -1. + <_> + 4 7 3 6 2. + <_> + 7 13 3 6 2. + <_> + + <_> + 6 7 6 18 -1. + <_> + 8 13 2 6 9. + <_> + + <_> + 2 7 6 18 -1. + <_> + 4 13 2 6 9. + <_> + + <_> + 2 22 12 4 -1. + <_> + 6 22 4 4 3. + <_> + + <_> + 3 16 8 8 -1. + <_> + 3 16 4 4 2. + <_> + 7 20 4 4 2. + <_> + + <_> + 7 7 6 10 -1. + <_> + 7 7 3 10 2. + <_> + + <_> + 1 8 12 10 -1. + <_> + 4 8 6 10 2. + <_> + + <_> + 5 16 3 12 -1. + <_> + 6 16 1 12 3. + <_> + + <_> + 4 5 10 17 -1. + <_> + 4 5 5 17 2. + <_> + + <_> + 0 4 14 24 -1. + <_> + 7 4 7 24 2. + <_> + + <_> + 4 9 6 7 -1. + <_> + 6 9 2 7 3. + <_> + + <_> + 2 20 10 8 -1. + <_> + 2 20 5 4 2. + <_> + 7 24 5 4 2. + <_> + + <_> + 8 5 6 8 -1. + <_> + 6 7 6 4 2. + 1 + <_> + + <_> + 6 4 4 6 -1. + <_> + 6 4 2 6 2. + 1 + <_> + + <_> + 6 3 4 6 -1. + <_> + 6 3 2 6 2. + <_> + + <_> + 5 4 4 6 -1. + <_> + 7 4 2 6 2. + <_> + + <_> + 5 8 4 6 -1. + <_> + 5 8 2 6 2. + <_> + + <_> + 7 3 6 6 -1. + <_> + 7 3 6 3 2. + 1 + <_> + + <_> + 4 5 6 6 -1. + <_> + 4 8 6 3 2. + <_> + + <_> + 3 12 6 14 -1. + <_> + 3 19 6 7 2. + <_> + + <_> + 11 16 2 12 -1. + <_> + 11 16 1 12 2. + <_> + + <_> + 1 22 6 6 -1. + <_> + 3 22 2 6 3. + <_> + + <_> + 6 16 3 12 -1. + <_> + 7 16 1 12 3. + <_> + + <_> + 5 16 3 12 -1. + <_> + 6 16 1 12 3. + <_> + + <_> + 3 9 8 4 -1. + <_> + 3 11 8 2 2. + <_> + + <_> + 3 16 2 12 -1. + <_> + 4 16 1 12 2. + <_> + + <_> + 2 20 12 8 -1. + <_> + 5 20 6 8 2. + <_> + + <_> + 0 20 12 8 -1. + <_> + 3 20 6 8 2. + <_> + + <_> + 5 4 9 12 -1. + <_> + 5 10 9 6 2. + <_> + + <_> + 4 12 10 4 -1. + <_> + 4 12 10 2 2. + 1 + <_> + + <_> + 4 2 10 4 -1. + <_> + 4 2 5 4 2. + <_> + + <_> + 1 15 12 13 -1. + <_> + 4 15 6 13 2. + <_> + + <_> + 11 16 2 12 -1. + <_> + 11 16 1 12 2. + <_> + + <_> + 2 3 3 12 -1. + <_> + 3 3 1 12 3. + <_> + + <_> + 8 2 4 6 -1. + <_> + 8 2 2 6 2. + <_> + + <_> + 2 2 4 6 -1. + <_> + 4 2 2 6 2. + <_> + + <_> + 2 13 12 14 -1. + <_> + 5 13 6 14 2. + <_> + + <_> + 1 16 2 12 -1. + <_> + 2 16 1 12 2. + <_> + + <_> + 9 21 4 6 -1. + <_> + 9 21 2 6 2. + <_> + + <_> + 1 21 4 6 -1. + <_> + 3 21 2 6 2. + <_> + + <_> + 9 0 3 15 -1. + <_> + 10 0 1 15 3. + <_> + + <_> + 2 22 4 6 -1. + <_> + 4 22 2 6 2. + <_> + + <_> + 2 13 12 14 -1. + <_> + 5 13 6 14 2. + <_> + + <_> + 6 3 4 6 -1. + <_> + 6 3 4 3 2. + 1 + <_> + + <_> + 1 0 12 24 -1. + <_> + 5 8 4 8 9. + <_> + + <_> + 4 2 6 8 -1. + <_> + 4 6 6 4 2. + <_> + + <_> + 2 4 12 8 -1. + <_> + 2 6 12 4 2. + <_> + + <_> + 1 8 12 18 -1. + <_> + 4 8 6 18 2. + <_> + + <_> + 3 0 8 24 -1. + <_> + 3 8 8 8 3. + <_> + + <_> + 1 21 6 6 -1. + <_> + 3 21 2 6 3. + <_> + + <_> + 5 7 8 3 -1. + <_> + 5 7 4 3 2. + <_> + + <_> + 1 7 8 3 -1. + <_> + 5 7 4 3 2. + <_> + + <_> + 5 1 4 6 -1. + <_> + 5 4 4 3 2. + <_> + + <_> + 4 6 4 6 -1. + <_> + 4 9 4 3 2. + <_> + + <_> + 10 20 4 6 -1. + <_> + 10 20 2 6 2. + <_> + + <_> + 3 1 8 21 -1. + <_> + 3 8 8 7 3. + <_> + + <_> + 7 16 4 12 -1. + <_> + 9 16 2 6 2. + <_> + 7 22 2 6 2. + <_> + + <_> + 1 25 12 3 -1. + <_> + 5 25 4 3 3. + <_> + + <_> + 7 16 4 12 -1. + <_> + 9 16 2 6 2. + <_> + 7 22 2 6 2. + <_> + + <_> + 3 16 4 12 -1. + <_> + 3 16 2 6 2. + <_> + 5 22 2 6 2. + <_> + + <_> + 7 17 4 7 -1. + <_> + 7 17 2 7 2. + <_> + + <_> + 3 17 4 7 -1. + <_> + 5 17 2 7 2. + <_> + + <_> + 4 12 6 6 -1. + <_> + 6 12 2 6 3. + <_> + + <_> + 5 8 4 15 -1. + <_> + 6 8 2 15 2. + <_> + + <_> + 7 22 2 4 -1. + <_> + 7 22 1 4 2. + 1 + <_> + + <_> + 7 22 4 2 -1. + <_> + 7 22 4 1 2. + 1 + <_> + + <_> + 1 15 12 3 -1. + <_> + 1 15 6 3 2. + <_> + + <_> + 4 15 6 12 -1. + <_> + 4 15 3 6 2. + <_> + 7 21 3 6 2. + <_> + + <_> + 7 16 3 12 -1. + <_> + 8 16 1 12 3. + <_> + + <_> + 2 9 4 18 -1. + <_> + 2 9 2 9 2. + <_> + 4 18 2 9 2. + <_> + + <_> + 8 10 4 6 -1. + <_> + 8 10 2 6 2. + <_> + + <_> + 0 16 4 12 -1. + <_> + 0 16 2 6 2. + <_> + 2 22 2 6 2. + <_> + + <_> + 2 22 12 4 -1. + <_> + 6 22 4 4 3. + <_> + + <_> + 0 24 9 4 -1. + <_> + 3 24 3 4 3. + <_> + + <_> + 9 13 4 12 -1. + <_> + 9 17 4 4 3. + <_> + + <_> + 2 10 4 6 -1. + <_> + 4 10 2 6 2. + <_> + + <_> + 4 8 8 6 -1. + <_> + 4 10 8 2 3. + <_> + + <_> + 0 22 12 4 -1. + <_> + 4 22 4 4 3. + <_> + + <_> + 4 21 9 7 -1. + <_> + 7 21 3 7 3. + <_> + + <_> + 5 22 4 6 -1. + <_> + 7 22 2 6 2. + <_> + + <_> + 9 2 3 12 -1. + <_> + 10 2 1 12 3. + <_> + + <_> + 2 3 3 12 -1. + <_> + 3 3 1 12 3. + <_> + + <_> + 8 4 4 6 -1. + <_> + 8 4 2 6 2. + 1 + <_> + + <_> + 6 4 6 4 -1. + <_> + 6 4 6 2 2. + 1 + <_> + + <_> + 4 6 8 16 -1. + <_> + 8 6 4 8 2. + <_> + 4 14 4 8 2. + <_> + + <_> + 2 6 8 16 -1. + <_> + 2 6 4 8 2. + <_> + 6 14 4 8 2. + <_> + + <_> + 4 8 8 8 -1. + <_> + 6 8 4 8 2. + <_> + + <_> + 0 6 12 10 -1. + <_> + 4 6 4 10 3. + <_> + + <_> + 8 10 6 7 -1. + <_> + 10 12 2 7 3. + 1 + <_> + + <_> + 6 10 7 6 -1. + <_> + 4 12 7 2 3. + 1 + <_> + + <_> + 5 11 4 7 -1. + <_> + 5 11 2 7 2. + <_> + + <_> + 1 11 12 16 -1. + <_> + 1 11 6 8 2. + <_> + 7 19 6 8 2. + <_> + + <_> + 6 9 3 13 -1. + <_> + 7 9 1 13 3. + <_> + + <_> + 3 9 6 4 -1. + <_> + 3 11 6 2 2. + <_> + + <_> + 9 22 4 6 -1. + <_> + 9 22 2 6 2. + <_> + + <_> + 2 9 7 4 -1. + <_> + 2 11 7 2 2. + <_> + + <_> + 7 15 3 12 -1. + <_> + 8 15 1 12 3. + <_> + + <_> + 2 15 8 3 -1. + <_> + 6 15 4 3 2. + <_> + + <_> + 1 7 12 19 -1. + <_> + 4 7 6 19 2. + <_> + + <_> + 6 9 4 12 -1. + <_> + 8 9 2 6 2. + <_> + 6 15 2 6 2. + <_> + + <_> + 1 12 4 6 -1. + <_> + 1 15 4 3 2. + <_> + + <_> + 4 22 8 6 -1. + <_> + 8 22 4 3 2. + <_> + 4 25 4 3 2. + <_> + + <_> + 2 22 8 6 -1. + <_> + 2 22 4 3 2. + <_> + 6 25 4 3 2. + <_> + + <_> + 9 17 4 6 -1. + <_> + 9 17 2 6 2. + <_> + + <_> + 1 17 4 6 -1. + <_> + 3 17 2 6 2. + <_> + + <_> + 4 5 6 4 -1. + <_> + 4 7 6 2 2. + <_> + + <_> + 7 3 4 6 -1. + <_> + 7 3 2 6 2. + 1 + <_> + + <_> + 6 24 6 4 -1. + <_> + 6 24 3 4 2. + <_> + + <_> + 1 21 12 3 -1. + <_> + 5 21 4 3 3. + <_> + + <_> + 7 17 2 7 -1. + <_> + 7 17 1 7 2. + 1 + <_> + + <_> + 7 17 7 2 -1. + <_> + 7 17 7 1 2. + 1 + <_> + + <_> + 6 12 3 16 -1. + <_> + 6 20 3 8 2. + <_> + + <_> + 2 24 9 4 -1. + <_> + 5 24 3 4 3. + <_> + + <_> + 2 25 12 2 -1. + <_> + 2 25 6 2 2. + <_> + + <_> + 0 25 12 2 -1. + <_> + 6 25 6 2 2. + <_> + + <_> + 4 11 6 8 -1. + <_> + 4 15 6 4 2. + <_> + + <_> + 5 0 4 6 -1. + <_> + 7 0 2 6 2. + <_> + + <_> + 2 2 10 7 -1. + <_> + 2 2 5 7 2. + <_> + + <_> + 0 1 12 25 -1. + <_> + 3 1 6 25 2. + <_> + + <_> + 1 14 12 6 -1. + <_> + 4 14 6 6 2. + <_> + + <_> + 0 26 12 2 -1. + <_> + 6 26 6 2 2. + <_> + + <_> + 6 15 3 12 -1. + <_> + 7 15 1 12 3. + <_> + + <_> + 6 7 2 12 -1. + <_> + 7 7 1 12 2. + <_> + + <_> + 5 9 4 6 -1. + <_> + 5 9 2 6 2. + <_> + + <_> + 3 20 6 6 -1. + <_> + 6 20 3 6 2. + <_> + + <_> + 3 10 8 4 -1. + <_> + 3 10 4 4 2. + <_> + + <_> + 0 5 9 18 -1. + <_> + 3 11 3 6 9. + <_> + + <_> + 8 8 4 6 -1. + <_> + 8 8 2 6 2. + <_> + + <_> + 2 8 4 6 -1. + <_> + 4 8 2 6 2. + <_> + + <_> + 8 8 4 12 -1. + <_> + 10 8 2 6 2. + <_> + 8 14 2 6 2. + <_> + + <_> + 4 10 6 8 -1. + <_> + 4 10 3 4 2. + <_> + 7 14 3 4 2. + <_> + + <_> + 7 15 4 6 -1. + <_> + 7 15 4 3 2. + 1 + <_> + + <_> + 7 15 6 4 -1. + <_> + 7 15 3 4 2. + 1 + <_> + + <_> + 1 9 13 15 -1. + <_> + 1 14 13 5 3. + <_> + + <_> + 5 1 3 25 -1. + <_> + 6 1 1 25 3. + <_> + + <_> + 6 15 3 12 -1. + <_> + 7 15 1 12 3. + <_> + + <_> + 0 7 4 16 -1. + <_> + 0 7 2 8 2. + <_> + 2 15 2 8 2. + <_> + + <_> + 4 2 6 4 -1. + <_> + 4 4 6 2 2. + <_> + + <_> + 0 0 10 10 -1. + <_> + 0 5 10 5 2. + <_> + + <_> + 8 5 6 8 -1. + <_> + 11 5 3 4 2. + <_> + 8 9 3 4 2. + <_> + + <_> + 1 14 12 14 -1. + <_> + 1 14 6 7 2. + <_> + 7 21 6 7 2. + <_> + + <_> + 7 1 6 18 -1. + <_> + 9 7 2 6 9. + <_> + + <_> + 0 18 14 8 -1. + <_> + 0 18 7 4 2. + <_> + 7 22 7 4 2. + <_> + + <_> + 2 3 8 23 -1. + <_> + 6 3 4 23 2. + <_> + + <_> + 10 18 4 9 -1. + <_> + 10 18 2 9 2. + <_> + + <_> + 0 25 8 3 -1. + <_> + 4 25 4 3 2. + <_> + + <_> + 2 26 12 2 -1. + <_> + 2 26 6 2 2. + <_> + + <_> + 1 22 4 6 -1. + <_> + 3 22 2 6 2. + <_> + + <_> + 6 16 2 12 -1. + <_> + 6 16 1 12 2. + <_> + + <_> + 2 14 6 14 -1. + <_> + 2 14 3 7 2. + <_> + 5 21 3 7 2. + <_> + + <_> + 4 8 6 6 -1. + <_> + 6 8 2 6 3. + <_> + + <_> + 0 18 8 6 -1. + <_> + 0 18 4 3 2. + <_> + 4 21 4 3 2. + <_> + + <_> + 7 13 6 11 -1. + <_> + 9 13 2 11 3. + <_> + + <_> + 1 16 12 7 -1. + <_> + 4 16 6 7 2. + <_> + + <_> + 7 15 4 9 -1. + <_> + 7 15 2 9 2. + <_> + + <_> + 3 15 4 9 -1. + <_> + 5 15 2 9 2. + <_> + + <_> + 10 18 4 8 -1. + <_> + 10 18 2 8 2. + <_> + + <_> + 2 7 9 6 -1. + <_> + 2 9 9 2 3. + <_> + + <_> + 1 9 12 6 -1. + <_> + 1 12 12 3 2. + <_> + + <_> + 3 5 5 12 -1. + <_> + 3 11 5 6 2. + <_> + + <_> + 3 6 8 4 -1. + <_> + 3 8 8 2 2. + <_> + + <_> + 4 6 6 6 -1. + <_> + 4 8 6 2 3. + <_> + + <_> + 1 26 12 2 -1. + <_> + 1 26 6 2 2. + <_> + + <_> + 5 7 4 6 -1. + <_> + 7 7 2 6 2. + <_> + + <_> + 7 5 6 5 -1. + <_> + 7 5 3 5 2. + 1 + <_> + + <_> + 5 9 3 13 -1. + <_> + 6 9 1 13 3. + <_> + + <_> + 5 18 6 10 -1. + <_> + 8 18 3 5 2. + <_> + 5 23 3 5 2. + <_> + + <_> + 3 18 6 10 -1. + <_> + 3 18 3 5 2. + <_> + 6 23 3 5 2. + <_> + + <_> + 7 15 7 6 -1. + <_> + 7 15 7 3 2. + 1 + <_> + + <_> + 0 23 9 5 -1. + <_> + 3 23 3 5 3. + <_> + + <_> + 7 15 7 6 -1. + <_> + 7 15 7 3 2. + 1 + <_> + + <_> + 7 15 6 7 -1. + <_> + 7 15 3 7 2. + 1 + <_> + + <_> + 7 2 6 12 -1. + <_> + 10 2 3 6 2. + <_> + 7 8 3 6 2. + <_> + + <_> + 7 5 6 4 -1. + <_> + 7 5 6 2 2. + 1 + <_> + + <_> + 7 3 6 10 -1. + <_> + 10 3 3 5 2. + <_> + 7 8 3 5 2. + <_> + + <_> + 1 3 6 10 -1. + <_> + 1 3 3 5 2. + <_> + 4 8 3 5 2. + <_> + + <_> + 1 7 12 4 -1. + <_> + 1 7 6 4 2. + <_> + + <_> + 5 1 6 4 -1. + <_> + 5 1 6 2 2. + 1 + <_> + + <_> + 0 0 14 10 -1. + <_> + 0 5 14 5 2. + <_> + + <_> + 0 8 10 18 -1. + <_> + 0 8 5 9 2. + <_> + 5 17 5 9 2. + <_> + + <_> + 7 16 2 12 -1. + <_> + 7 16 1 12 2. + <_> + + <_> + 2 21 8 7 -1. + <_> + 4 21 4 7 2. + <_> + + <_> + 3 21 8 6 -1. + <_> + 5 21 4 6 2. + <_> + + <_> + 4 10 6 8 -1. + <_> + 6 10 2 8 3. + <_> + + <_> + 8 2 3 12 -1. + <_> + 9 2 1 12 3. + <_> + + <_> + 3 2 3 12 -1. + <_> + 4 2 1 12 3. + <_> + + <_> + 2 26 12 2 -1. + <_> + 2 26 6 2 2. + <_> + + <_> + 1 25 12 3 -1. + <_> + 7 25 6 3 2. + <_> + + <_> + 7 20 3 5 -1. + <_> + 8 21 1 5 3. + 1 + <_> + + <_> + 3 15 8 11 -1. + <_> + 5 15 4 11 2. + <_> + + <_> + 1 1 12 21 -1. + <_> + 5 8 4 7 9. + <_> + + <_> + 0 22 4 6 -1. + <_> + 2 22 2 6 2. + <_> + + <_> + 5 23 9 4 -1. + <_> + 8 23 3 4 3. + <_> + + <_> + 0 23 9 4 -1. + <_> + 3 23 3 4 3. + <_> + + <_> + 6 3 4 12 -1. + <_> + 8 3 2 6 2. + <_> + 6 9 2 6 2. + <_> + + <_> + 6 4 2 24 -1. + <_> + 6 4 1 12 2. + <_> + 7 16 1 12 2. + <_> + + <_> + 5 9 4 6 -1. + <_> + 5 9 2 6 2. + <_> + + <_> + 2 7 4 6 -1. + <_> + 4 7 2 6 2. + <_> + + <_> + 4 8 6 20 -1. + <_> + 4 18 6 10 2. + <_> + + <_> + 1 16 3 12 -1. + <_> + 2 16 1 12 3. + <_> + + <_> + 8 12 6 16 -1. + <_> + 8 16 6 8 2. + <_> + + <_> + 1 17 4 6 -1. + <_> + 3 17 2 6 2. + <_> + + <_> + 7 14 6 9 -1. + <_> + 9 14 2 9 3. + <_> + + <_> + 1 14 6 9 -1. + <_> + 3 14 2 9 3. + <_> + + <_> + 8 0 4 18 -1. + <_> + 10 0 2 9 2. + <_> + 8 9 2 9 2. + <_> + + <_> + 2 0 4 18 -1. + <_> + 2 0 2 9 2. + <_> + 4 9 2 9 2. + <_> + + <_> + 11 14 2 12 -1. + <_> + 11 14 1 12 2. + <_> + + <_> + 1 14 2 12 -1. + <_> + 2 14 1 12 2. + <_> + + <_> + 8 11 3 12 -1. + <_> + 9 11 1 12 3. + <_> + + <_> + 1 7 12 6 -1. + <_> + 4 7 6 6 2. + <_> + + <_> + 1 1 12 9 -1. + <_> + 4 1 6 9 2. + <_> + + <_> + 1 3 12 20 -1. + <_> + 1 3 6 10 2. + <_> + 7 13 6 10 2. + <_> + + <_> + 4 8 6 10 -1. + <_> + 7 8 3 5 2. + <_> + 4 13 3 5 2. + <_> + + <_> + 6 5 8 3 -1. + <_> + 6 5 4 3 2. + 1 + <_> + + <_> + 3 15 8 7 -1. + <_> + 5 15 4 7 2. + <_> + + <_> + 0 14 12 12 -1. + <_> + 4 18 4 4 9. + <_> + + <_> + 5 12 4 16 -1. + <_> + 5 16 4 8 2. + <_> + + <_> + 0 21 12 6 -1. + <_> + 4 21 4 6 3. + <_> + + <_> + 4 17 8 7 -1. + <_> + 4 17 4 7 2. + <_> + + <_> + 2 17 8 7 -1. + <_> + 6 17 4 7 2. + <_> + + <_> + 7 4 6 5 -1. + <_> + 7 4 3 5 2. + 1 + <_> + + <_> + 7 4 5 6 -1. + <_> + 7 4 5 3 2. + 1 + <_> + + <_> + 8 3 6 7 -1. + <_> + 8 3 3 7 2. + 1 + <_> + + <_> + 6 3 7 6 -1. + <_> + 6 3 7 3 2. + 1 + <_> + + <_> + 7 4 2 22 -1. + <_> + 7 4 1 22 2. + <_> + + <_> + 5 4 2 22 -1. + <_> + 6 4 1 22 2. + <_> + + <_> + 7 8 2 12 -1. + <_> + 7 8 1 12 2. + <_> + + <_> + 5 8 2 12 -1. + <_> + 6 8 1 12 2. + <_> + + <_> + 3 8 10 5 -1. + <_> + 3 8 5 5 2. + <_> + + <_> + 4 12 6 6 -1. + <_> + 6 12 2 6 3. + <_> + + <_> + 8 8 4 16 -1. + <_> + 10 8 2 8 2. + <_> + 8 16 2 8 2. + <_> + + <_> + 2 8 4 16 -1. + <_> + 2 8 2 8 2. + <_> + 4 16 2 8 2. + <_> + + <_> + 1 21 12 4 -1. + <_> + 7 21 6 2 2. + <_> + 1 23 6 2 2. + <_> + + <_> + 4 2 2 12 -1. + <_> + 4 8 2 6 2. + <_> + + <_> + 4 10 6 4 -1. + <_> + 4 12 6 2 2. + <_> + + <_> + 2 8 10 12 -1. + <_> + 2 12 10 4 3. + <_> + + <_> + 4 17 6 8 -1. + <_> + 7 17 3 4 2. + <_> + 4 21 3 4 2. + <_> + + <_> + 7 15 4 3 -1. + <_> + 6 16 4 1 3. + 1 + <_> + + <_> + 9 20 3 5 -1. + <_> + 10 21 1 5 3. + 1 + <_> + + <_> + 0 18 14 6 -1. + <_> + 7 18 7 6 2. + <_> + + <_> + 9 0 3 24 -1. + <_> + 9 6 3 12 2. + <_> + + <_> + 2 0 3 24 -1. + <_> + 2 6 3 12 2. + <_> + + <_> + 6 2 4 6 -1. + <_> + 6 2 2 6 2. + <_> + + <_> + 1 25 12 3 -1. + <_> + 5 25 4 3 3. + <_> + + <_> + 1 4 12 14 -1. + <_> + 4 4 6 14 2. + <_> + + <_> + 6 16 3 12 -1. + <_> + 7 16 1 12 3. + <_> + + <_> + 7 18 4 6 -1. + <_> + 7 18 2 6 2. + 1 + <_> + + <_> + 6 16 3 12 -1. + <_> + 7 16 1 12 3. + <_> + + <_> + 5 16 3 12 -1. + <_> + 6 16 1 12 3. + <_> + + <_> + 7 4 6 4 -1. + <_> + 7 4 3 4 2. + 1 + <_> + + <_> + 7 1 7 4 -1. + <_> + 7 1 7 2 2. + 1 + <_> + + <_> + 7 2 6 4 -1. + <_> + 7 2 3 4 2. + 1 + <_> + + <_> + 3 10 8 6 -1. + <_> + 5 10 4 6 2. + <_> + + <_> + 5 20 8 8 -1. + <_> + 7 20 4 8 2. + <_> + + <_> + 6 15 8 5 -1. + <_> + 6 15 4 5 2. + 1 + <_> + + <_> + 2 7 10 6 -1. + <_> + 7 7 5 3 2. + <_> + 2 10 5 3 2. + <_> + + <_> + 7 20 4 4 -1. + <_> + 6 21 4 2 2. + 1 + <_> + + <_> + 1 24 12 4 -1. + <_> + 4 24 6 4 2. + <_> + + <_> + 4 4 6 6 -1. + <_> + 6 4 2 6 3. + <_> + + <_> + 1 4 12 24 -1. + <_> + 7 4 6 12 2. + <_> + 1 16 6 12 2. + <_> + + <_> + 4 4 3 15 -1. + <_> + 4 9 3 5 3. + <_> + + <_> + 11 3 3 8 -1. + <_> + 11 3 3 4 2. + 1 + <_> + + <_> + 4 9 2 13 -1. + <_> + 5 9 1 13 2. + <_> + + <_> + 6 9 4 6 -1. + <_> + 6 9 2 6 2. + <_> + + <_> + 2 17 8 3 -1. + <_> + 6 17 4 3 2. + <_> + + <_> + 4 11 6 8 -1. + <_> + 7 11 3 4 2. + <_> + 4 15 3 4 2. + <_> + + <_> + 0 0 14 27 -1. + <_> + 0 9 14 9 3. + <_> + + <_> + 5 8 4 6 -1. + <_> + 5 11 4 3 2. + <_> + + <_> + 5 2 4 12 -1. + <_> + 5 5 4 6 2. + <_> + + <_> + 6 3 4 9 -1. + <_> + 6 6 4 3 3. + <_> + + <_> + 4 3 4 9 -1. + <_> + 4 6 4 3 3. + <_> + + <_> + 9 5 4 6 -1. + <_> + 9 5 4 3 2. + 1 + <_> + + <_> + 5 5 6 4 -1. + <_> + 5 5 3 4 2. + 1 + <_> + + <_> + 1 1 12 21 -1. + <_> + 4 1 6 21 2. + <_> + + <_> + 1 25 12 3 -1. + <_> + 5 25 4 3 3. + <_> + + <_> + 9 18 4 10 -1. + <_> + 9 18 2 10 2. + <_> + + <_> + 4 16 9 3 -1. + <_> + 3 17 9 1 3. + 1 + <_> + + <_> + 9 18 4 10 -1. + <_> + 9 18 2 10 2. + <_> + + <_> + 1 18 4 10 -1. + <_> + 3 18 2 10 2. + <_> + + <_> + 4 10 9 4 -1. + <_> + 4 12 9 2 2. + <_> + + <_> + 1 0 12 5 -1. + <_> + 5 0 4 5 3. + <_> + + <_> + 7 9 2 18 -1. + <_> + 7 15 2 6 3. + <_> + + <_> + 0 22 6 6 -1. + <_> + 2 22 2 6 3. + <_> + + <_> + 5 21 6 5 -1. + <_> + 5 21 3 5 2. + <_> + + <_> + 3 21 6 5 -1. + <_> + 6 21 3 5 2. + <_> + + <_> + 9 21 2 5 -1. + <_> + 9 21 1 5 2. + 1 + <_> + + <_> + 0 17 6 8 -1. + <_> + 0 17 3 4 2. + <_> + 3 21 3 4 2. + <_> + + <_> + 4 0 6 6 -1. + <_> + 6 0 2 6 3. + <_> + + <_> + 2 1 6 14 -1. + <_> + 2 1 3 7 2. + <_> + 5 8 3 7 2. + <_> + + <_> + 6 8 5 6 -1. + <_> + 6 11 5 3 2. + <_> + + <_> + 4 8 4 6 -1. + <_> + 6 8 2 6 2. + <_> + + <_> + 4 6 6 6 -1. + <_> + 4 8 6 2 3. + <_> + + <_> + 3 5 6 4 -1. + <_> + 3 7 6 2 2. + <_> + + <_> + 7 6 4 6 -1. + <_> + 7 6 2 6 2. + 1 + <_> + + <_> + 4 5 6 4 -1. + <_> + 4 7 6 2 2. + <_> + + <_> + 7 1 4 21 -1. + <_> + 8 1 2 21 2. + <_> + + <_> + 2 2 6 20 -1. + <_> + 4 2 2 20 3. + <_> + + <_> + 9 20 3 5 -1. + <_> + 10 21 1 5 3. + 1 + <_> + + <_> + 0 24 6 4 -1. + <_> + 3 24 3 4 2. + <_> + + <_> + 4 2 6 6 -1. + <_> + 6 2 2 6 3. + <_> + + <_> + 6 2 4 6 -1. + <_> + 6 2 4 3 2. + 1 + <_> + + <_> + 1 4 13 2 -1. + <_> + 1 5 13 1 2. + <_> + + <_> + 7 11 6 7 -1. + <_> + 7 11 3 7 2. + 1 + <_> + + <_> + 8 16 6 4 -1. + <_> + 8 16 6 2 2. + 1 + <_> + + <_> + 1 3 12 24 -1. + <_> + 5 11 4 8 9. + <_> + + <_> + 2 24 12 4 -1. + <_> + 8 24 6 2 2. + <_> + 2 26 6 2 2. + <_> + + <_> + 0 24 12 4 -1. + <_> + 0 24 6 2 2. + <_> + 6 26 6 2 2. + <_> + + <_> + 6 4 2 24 -1. + <_> + 7 4 1 12 2. + <_> + 6 16 1 12 2. + <_> + + <_> + 4 8 6 6 -1. + <_> + 6 8 2 6 3. + <_> + + <_> + 6 6 4 9 -1. + <_> + 6 6 2 9 2. + <_> + + <_> + 2 8 8 7 -1. + <_> + 6 8 4 7 2. + <_> + + <_> + 3 7 10 7 -1. + <_> + 3 7 5 7 2. + <_> + + <_> + 1 7 10 7 -1. + <_> + 6 7 5 7 2. + <_> + + <_> + 4 1 9 12 -1. + <_> + 7 5 3 4 9. + <_> + + <_> + 1 1 9 12 -1. + <_> + 4 5 3 4 9. + <_> + + <_> + 4 25 8 3 -1. + <_> + 4 25 4 3 2. + <_> + + <_> + 0 16 12 7 -1. + <_> + 3 16 6 7 2. + <_> + + <_> + 9 17 4 7 -1. + <_> + 9 17 2 7 2. + <_> + + <_> + 1 17 4 7 -1. + <_> + 3 17 2 7 2. + <_> + + <_> + 7 0 4 7 -1. + <_> + 7 0 2 7 2. + 1 + <_> + + <_> + 7 0 7 4 -1. + <_> + 7 0 7 2 2. + 1 + <_> + + <_> + 9 3 5 6 -1. + <_> + 9 3 5 3 2. + 1 + <_> + + <_> + 0 10 6 12 -1. + <_> + 0 10 3 6 2. + <_> + 3 16 3 6 2. + <_> + + <_> + 9 3 4 12 -1. + <_> + 10 3 2 12 2. + <_> + + <_> + 1 3 4 12 -1. + <_> + 2 3 2 12 2. + <_> + + <_> + 2 7 10 10 -1. + <_> + 7 7 5 5 2. + <_> + 2 12 5 5 2. + <_> + + <_> + 3 16 4 9 -1. + <_> + 5 16 2 9 2. + <_> + + <_> + 0 11 14 11 -1. + <_> + 0 11 7 11 2. + <_> + + <_> + 6 16 5 6 -1. + <_> + 4 18 5 2 3. + 1 + <_> + + <_> + 11 20 2 6 -1. + <_> + 11 20 1 6 2. + 1 + <_> + + <_> + 1 18 4 6 -1. + <_> + 3 18 2 6 2. + <_> + + <_> + 10 14 3 6 -1. + <_> + 11 15 1 6 3. + 1 + <_> + + <_> + 4 14 6 3 -1. + <_> + 3 15 6 1 3. + 1 + <_> + + <_> + 7 20 3 5 -1. + <_> + 8 21 1 5 3. + 1 + <_> + + <_> + 2 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 9 15 3 12 -1. + <_> + 10 15 1 12 3. + <_> + + <_> + 5 15 6 2 -1. + <_> + 5 15 6 1 2. + 1 + <_> + + <_> + 7 18 2 7 -1. + <_> + 7 18 1 7 2. + 1 + <_> + + <_> + 7 20 5 3 -1. + <_> + 6 21 5 1 3. + 1 + <_> + + <_> + 10 16 2 10 -1. + <_> + 10 16 1 10 2. + 1 + <_> + + <_> + 4 16 10 2 -1. + <_> + 4 16 10 1 2. + 1 + <_> + + <_> + 1 17 12 6 -1. + <_> + 4 17 6 6 2. + <_> + + <_> + 4 15 6 8 -1. + <_> + 4 15 3 4 2. + <_> + 7 19 3 4 2. + <_> + + <_> + 7 17 6 4 -1. + <_> + 9 19 2 4 3. + 1 + <_> + + <_> + 7 17 4 6 -1. + <_> + 5 19 4 2 3. + 1 + <_> + + <_> + 1 13 12 4 -1. + <_> + 1 13 6 4 2. + <_> + + <_> + 0 2 8 12 -1. + <_> + 0 2 4 6 2. + <_> + 4 8 4 6 2. + <_> + + <_> + 6 2 2 16 -1. + <_> + 6 10 2 8 2. + <_> + + <_> + 2 8 8 4 -1. + <_> + 2 10 8 2 2. + <_> + + <_> + 5 10 4 18 -1. + <_> + 5 19 4 9 2. + <_> + + <_> + 0 3 3 12 -1. + <_> + 0 7 3 4 3. + <_> + + <_> + 1 22 12 4 -1. + <_> + 7 22 6 2 2. + <_> + 1 24 6 2 2. + <_> + + <_> + 2 19 7 2 -1. + <_> + 2 19 7 1 2. + 1 + <_> + + <_> + 2 26 12 2 -1. + <_> + 2 26 6 2 2. + <_> + + <_> + 0 11 6 14 -1. + <_> + 0 11 3 7 2. + <_> + 3 18 3 7 2. + <_> + + <_> + 7 3 3 10 -1. + <_> + 7 8 3 5 2. + <_> + + <_> + 0 17 6 6 -1. + <_> + 2 17 2 6 3. + <_> + + <_> + 9 16 2 12 -1. + <_> + 9 16 1 12 2. + <_> + + <_> + 6 16 6 3 -1. + <_> + 5 17 6 1 3. + 1 + <_> + + <_> + 8 0 6 8 -1. + <_> + 10 2 2 8 3. + 1 + <_> + + <_> + 6 4 8 6 -1. + <_> + 8 6 4 6 2. + 1 + <_> + + <_> + 4 7 6 21 -1. + <_> + 4 14 6 7 3. + <_> + + <_> + 3 0 8 18 -1. + <_> + 3 0 4 9 2. + <_> + 7 9 4 9 2. + <_> + + <_> + 3 6 9 10 -1. + <_> + 6 6 3 10 3. + <_> + + <_> + 7 21 4 3 -1. + <_> + 6 22 4 1 3. + 1 + <_> + + <_> + 2 23 12 5 -1. + <_> + 6 23 4 5 3. + <_> + + <_> + 4 16 3 12 -1. + <_> + 5 16 1 12 3. + <_> + + <_> + 7 17 2 7 -1. + <_> + 7 17 1 7 2. + 1 + <_> + + <_> + 0 5 14 10 -1. + <_> + 0 5 7 5 2. + <_> + 7 10 7 5 2. + <_> + + <_> + 3 10 8 4 -1. + <_> + 3 10 4 4 2. + <_> + + <_> + 0 12 10 4 -1. + <_> + 5 12 5 4 2. + <_> + + <_> + 7 0 6 6 -1. + <_> + 7 0 3 6 2. + 1 + <_> + + <_> + 2 3 10 7 -1. + <_> + 7 3 5 7 2. + <_> + + <_> + 3 7 4 21 -1. + <_> + 5 7 2 21 2. + <_> + + <_> + 6 2 2 24 -1. + <_> + 7 2 1 12 2. + <_> + 6 14 1 12 2. + <_> + + <_> + 3 4 8 16 -1. + <_> + 3 8 8 8 2. + <_> + + <_> + 9 16 2 12 -1. + <_> + 9 16 1 12 2. + <_> + + <_> + 3 16 2 12 -1. + <_> + 4 16 1 12 2. + <_> + + <_> + 5 2 6 6 -1. + <_> + 5 4 6 2 3. + <_> + + <_> + 1 19 4 9 -1. + <_> + 3 19 2 9 2. + <_> + + <_> + 9 10 4 16 -1. + <_> + 10 10 2 16 2. + <_> + + <_> + 5 18 5 2 -1. + <_> + 5 18 5 1 2. + 1 + <_> + + <_> + 5 4 6 4 -1. + <_> + 5 4 3 4 2. + <_> + + <_> + 3 4 6 4 -1. + <_> + 6 4 3 4 2. + <_> + + <_> + 5 5 6 8 -1. + <_> + 8 5 3 4 2. + <_> + 5 9 3 4 2. + <_> + + <_> + 3 5 6 8 -1. + <_> + 3 5 3 4 2. + <_> + 6 9 3 4 2. + <_> + + <_> + 6 3 8 12 -1. + <_> + 10 3 4 6 2. + <_> + 6 9 4 6 2. + <_> + + <_> + 1 10 2 12 -1. + <_> + 2 10 1 12 2. + <_> + + <_> + 1 0 13 3 -1. + <_> + 1 1 13 1 3. + <_> + + <_> + 2 1 4 7 -1. + <_> + 4 1 2 7 2. + <_> + + <_> + 9 21 2 5 -1. + <_> + 9 21 1 5 2. + 1 + <_> + + <_> + 2 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 6 16 3 12 -1. + <_> + 7 16 1 12 3. + <_> + + <_> + 0 15 8 6 -1. + <_> + 0 15 4 3 2. + <_> + 4 18 4 3 2. + <_> + + <_> + 2 26 12 2 -1. + <_> + 2 26 6 2 2. + <_> + + <_> + 0 26 12 2 -1. + <_> + 6 26 6 2 2. + <_> + + <_> + 1 1 13 3 -1. + <_> + 1 2 13 1 3. + <_> + + <_> + 0 3 14 2 -1. + <_> + 7 3 7 2 2. + <_> + + <_> + 2 16 12 4 -1. + <_> + 8 16 6 2 2. + <_> + 2 18 6 2 2. + <_> + + <_> + 0 20 12 6 -1. + <_> + 3 20 6 6 2. + <_> + + <_> + 4 15 8 7 -1. + <_> + 6 15 4 7 2. + <_> + + <_> + 4 10 6 12 -1. + <_> + 4 10 3 6 2. + <_> + 7 16 3 6 2. + <_> + + <_> + 7 0 4 6 -1. + <_> + 7 0 2 6 2. + 1 + <_> + + <_> + 7 0 6 4 -1. + <_> + 7 0 6 2 2. + 1 + <_> + + <_> + 6 18 8 6 -1. + <_> + 10 18 4 3 2. + <_> + 6 21 4 3 2. + <_> + + <_> + 6 0 8 4 -1. + <_> + 6 0 8 2 2. + 1 + <_> + + <_> + 2 15 10 6 -1. + <_> + 7 15 5 3 2. + <_> + 2 18 5 3 2. + <_> + + <_> + 0 13 4 8 -1. + <_> + 0 17 4 4 2. + <_> + + <_> + 0 9 14 9 -1. + <_> + 0 12 14 3 3. + <_> + + <_> + 2 24 9 4 -1. + <_> + 5 24 3 4 3. + <_> + + <_> + 1 24 12 4 -1. + <_> + 4 24 6 4 2. + <_> + + <_> + 0 11 10 8 -1. + <_> + 0 11 5 4 2. + <_> + 5 15 5 4 2. + <_> + + <_> + 5 9 6 4 -1. + <_> + 5 11 6 2 2. + <_> + + <_> + 1 8 4 17 -1. + <_> + 2 8 2 17 2. + <_> + + <_> + 8 2 4 12 -1. + <_> + 10 2 2 6 2. + <_> + 8 8 2 6 2. + <_> + + <_> + 2 2 4 12 -1. + <_> + 2 2 2 6 2. + <_> + 4 8 2 6 2. + <_> + + <_> + 10 7 4 14 -1. + <_> + 12 7 2 7 2. + <_> + 10 14 2 7 2. + <_> + + <_> + 0 7 4 14 -1. + <_> + 0 7 2 7 2. + <_> + 2 14 2 7 2. + <_> + + <_> + 4 8 10 6 -1. + <_> + 4 8 5 6 2. + <_> + + <_> + 6 6 8 3 -1. + <_> + 6 6 4 3 2. + 1 + <_> + + <_> + 2 5 12 3 -1. + <_> + 2 6 12 1 3. + <_> + + <_> + 2 15 9 5 -1. + <_> + 5 15 3 5 3. + <_> + + <_> + 0 1 14 15 -1. + <_> + 0 6 14 5 3. + <_> + + <_> + 1 1 6 18 -1. + <_> + 3 7 2 6 9. + <_> + + <_> + 4 2 9 10 -1. + <_> + 4 7 9 5 2. + <_> + + <_> + 5 12 4 6 -1. + <_> + 7 12 2 6 2. + <_> + + <_> + 6 4 3 21 -1. + <_> + 7 4 1 21 3. + <_> + + <_> + 6 17 6 3 -1. + <_> + 5 18 6 1 3. + 1 + <_> + + <_> + 7 16 2 4 -1. + <_> + 7 16 1 4 2. + 1 + <_> + + <_> + 7 16 4 2 -1. + <_> + 7 16 4 1 2. + 1 + <_> + + <_> + 8 20 2 6 -1. + <_> + 8 20 1 6 2. + 1 + <_> + + <_> + 6 20 6 2 -1. + <_> + 6 20 6 1 2. + 1 + <_> + + <_> + 6 4 6 6 -1. + <_> + 8 4 2 6 3. + <_> + + <_> + 1 1 3 16 -1. + <_> + 2 1 1 16 3. + <_> + + <_> + 12 14 2 10 -1. + <_> + 12 14 1 10 2. + 1 + <_> + + <_> + 2 14 10 2 -1. + <_> + 2 14 10 1 2. + 1 + <_> + + <_> + 3 1 6 27 -1. + <_> + 5 10 2 9 9. + <_> + + <_> + 6 16 3 12 -1. + <_> + 7 16 1 12 3. + <_> + + <_> + 2 6 8 22 -1. + <_> + 4 6 4 22 2. + <_> + + <_> + 4 6 6 13 -1. + <_> + 6 6 2 13 3. + <_> + + <_> + 7 11 6 6 -1. + <_> + 5 13 6 2 3. + 1 + <_> + + <_> + 2 26 12 2 -1. + <_> + 2 26 6 2 2. + <_> + + <_> + 4 8 6 9 -1. + <_> + 6 8 2 9 3. + <_> + + <_> + 6 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 3 24 6 4 -1. + <_> + 6 24 3 4 2. + <_> + + <_> + 4 16 8 9 -1. + <_> + 4 16 4 9 2. + <_> + + <_> + 2 16 8 9 -1. + <_> + 6 16 4 9 2. + <_> + + <_> + 7 5 6 6 -1. + <_> + 7 5 3 6 2. + 1 + <_> + + <_> + 7 15 6 6 -1. + <_> + 7 15 3 6 2. + 1 + <_> + + <_> + 3 13 10 12 -1. + <_> + 3 19 10 6 2. + <_> + + <_> + 2 6 10 3 -1. + <_> + 7 6 5 3 2. + <_> + + <_> + 3 1 8 21 -1. + <_> + 3 8 8 7 3. + <_> + + <_> + 4 7 6 6 -1. + <_> + 4 9 6 2 3. + <_> + + <_> + 4 10 8 4 -1. + <_> + 4 12 8 2 2. + <_> + + <_> + 7 5 6 6 -1. + <_> + 7 5 6 3 2. + 1 + <_> + + <_> + 2 8 12 10 -1. + <_> + 2 8 6 10 2. + <_> + + <_> + 1 4 8 10 -1. + <_> + 5 4 4 10 2. + <_> + + <_> + 3 16 8 6 -1. + <_> + 7 16 4 3 2. + <_> + 3 19 4 3 2. + <_> + + <_> + 3 3 2 24 -1. + <_> + 3 3 1 12 2. + <_> + 4 15 1 12 2. + <_> + + <_> + 9 16 4 12 -1. + <_> + 10 16 2 12 2. + <_> + + <_> + 1 16 4 12 -1. + <_> + 2 16 2 12 2. + <_> + + <_> + 8 12 3 12 -1. + <_> + 9 12 1 12 3. + <_> + + <_> + 3 8 5 6 -1. + <_> + 3 11 5 3 2. + <_> + + <_> + 2 7 10 8 -1. + <_> + 2 11 10 4 2. + <_> + + <_> + 3 12 3 12 -1. + <_> + 4 12 1 12 3. + <_> + + <_> + 5 16 4 12 -1. + <_> + 5 16 2 12 2. + <_> + + <_> + 7 22 4 2 -1. + <_> + 7 22 4 1 2. + 1 + <_> + + <_> + 6 22 8 6 -1. + <_> + 10 22 4 3 2. + <_> + 6 25 4 3 2. + <_> + + <_> + 1 14 2 14 -1. + <_> + 2 14 1 14 2. + <_> + + <_> + 9 20 3 5 -1. + <_> + 10 21 1 5 3. + 1 + <_> + + <_> + 5 20 5 3 -1. + <_> + 4 21 5 1 3. + 1 + <_> + + <_> + 7 15 2 5 -1. + <_> + 7 15 1 5 2. + 1 + <_> + + <_> + 1 17 10 6 -1. + <_> + 1 17 5 3 2. + <_> + 6 20 5 3 2. + <_> + + <_> + 1 3 12 3 -1. + <_> + 5 3 4 3 3. + <_> + + <_> + 7 3 5 6 -1. + <_> + 7 3 5 3 2. + 1 + <_> + + <_> + 7 7 3 12 -1. + <_> + 8 7 1 12 3. + <_> + + <_> + 4 7 3 12 -1. + <_> + 5 7 1 12 3. + <_> + + <_> + 5 11 9 13 -1. + <_> + 8 11 3 13 3. + <_> + + <_> + 5 5 3 21 -1. + <_> + 6 5 1 21 3. + <_> + + <_> + 4 13 9 11 -1. + <_> + 7 13 3 11 3. + <_> + + <_> + 1 13 9 11 -1. + <_> + 4 13 3 11 3. + <_> + + <_> + 5 18 8 10 -1. + <_> + 9 18 4 5 2. + <_> + 5 23 4 5 2. + <_> + + <_> + 0 5 14 14 -1. + <_> + 0 5 7 7 2. + <_> + 7 12 7 7 2. + <_> + + <_> + 9 0 3 15 -1. + <_> + 10 0 1 15 3. + <_> + + <_> + 3 0 6 20 -1. + <_> + 5 0 2 20 3. + <_> + + <_> + 2 4 12 2 -1. + <_> + 2 5 12 1 2. + <_> + + <_> + 0 3 12 3 -1. + <_> + 0 4 12 1 3. + <_> + + <_> + 0 18 14 6 -1. + <_> + 7 18 7 3 2. + <_> + 0 21 7 3 2. + <_> + + <_> + 2 0 3 15 -1. + <_> + 3 0 1 15 3. + <_> + + <_> + 8 1 6 4 -1. + <_> + 8 1 3 4 2. + 1 + <_> + + <_> + 2 7 6 6 -1. + <_> + 2 9 6 2 3. + <_> + + <_> + 10 22 4 6 -1. + <_> + 10 22 2 6 2. + <_> + + <_> + 2 7 3 12 -1. + <_> + 3 7 1 12 3. + <_> + + <_> + 6 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 0 22 4 6 -1. + <_> + 2 22 2 6 2. + <_> + + <_> + 8 24 6 4 -1. + <_> + 8 24 3 4 2. + <_> + + <_> + 4 0 4 9 -1. + <_> + 4 3 4 3 3. + <_> + + <_> + 8 3 6 4 -1. + <_> + 8 3 6 2 2. + 1 + <_> + + <_> + 2 0 6 22 -1. + <_> + 2 0 3 11 2. + <_> + 5 11 3 11 2. + <_> + + <_> + 6 18 8 10 -1. + <_> + 10 18 4 5 2. + <_> + 6 23 4 5 2. + <_> + + <_> + 0 22 6 6 -1. + <_> + 2 22 2 6 3. + <_> + + <_> + 8 13 6 6 -1. + <_> + 8 15 6 2 3. + <_> + + <_> + 0 13 6 6 -1. + <_> + 0 15 6 2 3. + <_> + + <_> + 1 16 6 6 -1. + <_> + 3 16 2 6 3. + <_> + + <_> + 7 2 3 21 -1. + <_> + 7 9 3 7 3. + <_> + + <_> + 4 14 6 3 -1. + <_> + 3 15 6 1 3. + 1 + <_> + + <_> + 6 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 7 3 4 6 -1. + <_> + 7 3 4 3 2. + 1 + <_> + + <_> + 4 9 8 16 -1. + <_> + 4 9 4 16 2. + <_> + + <_> + 2 9 8 16 -1. + <_> + 6 9 4 16 2. + <_> + + <_> + 4 3 7 24 -1. + <_> + 4 9 7 12 2. + <_> + + <_> + 1 17 4 6 -1. + <_> + 3 17 2 6 2. + <_> + + <_> + 5 2 6 4 -1. + <_> + 5 4 6 2 2. + <_> + + <_> + 7 2 4 6 -1. + <_> + 7 2 2 6 2. + 1 + <_> + + <_> + 4 9 6 4 -1. + <_> + 4 9 3 4 2. + <_> + + <_> + 1 24 6 4 -1. + <_> + 4 24 3 4 2. + <_> + + <_> + 5 0 6 8 -1. + <_> + 8 0 3 4 2. + <_> + 5 4 3 4 2. + <_> + + <_> + 0 26 12 2 -1. + <_> + 6 26 6 2 2. + <_> + + <_> + 5 0 6 8 -1. + <_> + 8 0 3 4 2. + <_> + 5 4 3 4 2. + <_> + + <_> + 5 4 4 6 -1. + <_> + 7 4 2 6 2. + <_> + + <_> + 8 0 6 8 -1. + <_> + 6 2 6 4 2. + 1 + <_> + + <_> + 6 0 8 6 -1. + <_> + 8 2 4 6 2. + 1 + <_> + + <_> + 7 17 3 4 -1. + <_> + 8 18 1 4 3. + 1 + <_> + + <_> + 1 20 6 8 -1. + <_> + 1 20 3 4 2. + <_> + 4 24 3 4 2. + <_> + + <_> + 9 15 2 12 -1. + <_> + 9 15 1 12 2. + <_> + + <_> + 3 15 2 12 -1. + <_> + 4 15 1 12 2. + <_> + + <_> + 5 2 6 4 -1. + <_> + 5 2 3 4 2. + <_> + + <_> + 3 3 6 4 -1. + <_> + 6 3 3 4 2. + <_> + + <_> + 4 4 6 24 -1. + <_> + 7 4 3 12 2. + <_> + 4 16 3 12 2. + <_> + + <_> + 6 13 2 12 -1. + <_> + 7 13 1 12 2. + <_> + + <_> + 6 16 3 12 -1. + <_> + 7 16 1 12 3. + <_> + + <_> + 6 4 2 14 -1. + <_> + 7 4 1 14 2. + <_> + + <_> + 5 3 4 25 -1. + <_> + 6 3 2 25 2. + <_> + + <_> + 5 4 3 21 -1. + <_> + 6 4 1 21 3. + <_> + + <_> + 7 6 2 12 -1. + <_> + 7 6 1 12 2. + <_> + + <_> + 5 4 4 20 -1. + <_> + 5 4 2 10 2. + <_> + 7 14 2 10 2. + <_> + + <_> + 6 4 6 24 -1. + <_> + 8 12 2 8 9. + <_> + + <_> + 0 1 12 24 -1. + <_> + 6 1 6 24 2. + <_> + + <_> + 7 6 7 22 -1. + <_> + 7 17 7 11 2. + <_> + + <_> + 4 3 4 9 -1. + <_> + 4 6 4 3 3. + <_> + + <_> + 8 4 6 8 -1. + <_> + 6 6 6 4 2. + 1 + <_> + + <_> + 7 5 6 4 -1. + <_> + 7 5 6 2 2. + 1 + <_> + + <_> + 5 1 4 6 -1. + <_> + 5 4 4 3 2. + <_> + + <_> + 0 0 7 10 -1. + <_> + 0 5 7 5 2. + <_> + + <_> + 7 2 3 24 -1. + <_> + 7 8 3 12 2. + <_> + + <_> + 1 8 4 15 -1. + <_> + 2 8 2 15 2. + <_> + + <_> + 6 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 1 23 12 3 -1. + <_> + 5 23 4 3 3. + <_> + + <_> + 6 22 8 6 -1. + <_> + 10 22 4 3 2. + <_> + 6 25 4 3 2. + <_> + + <_> + 0 22 14 6 -1. + <_> + 0 22 7 3 2. + <_> + 7 25 7 3 2. + <_> + + <_> + 2 3 12 3 -1. + <_> + 2 4 12 1 3. + <_> + + <_> + 0 2 12 9 -1. + <_> + 4 5 4 3 9. + <_> + + <_> + 1 0 12 12 -1. + <_> + 5 4 4 4 9. + <_> + + <_> + 1 3 12 3 -1. + <_> + 1 4 12 1 3. + <_> + + <_> + 1 4 12 3 -1. + <_> + 5 4 4 3 3. + <_> + + <_> + 1 15 2 12 -1. + <_> + 2 15 1 12 2. + <_> + + <_> + 1 20 12 5 -1. + <_> + 5 20 4 5 3. + <_> + + <_> + 7 15 5 4 -1. + <_> + 6 16 5 2 2. + 1 + <_> + + <_> + 7 2 3 21 -1. + <_> + 7 9 3 7 3. + <_> + + <_> + 2 2 4 12 -1. + <_> + 2 2 2 6 2. + <_> + 4 8 2 6 2. + <_> + + <_> + 5 22 8 6 -1. + <_> + 7 22 4 6 2. + <_> + + <_> + 0 1 10 6 -1. + <_> + 0 1 5 3 2. + <_> + 5 4 5 3 2. + <_> + + <_> + 3 11 9 6 -1. + <_> + 3 13 9 2 3. + <_> + + <_> + 6 7 2 19 -1. + <_> + 7 7 1 19 2. + <_> + + <_> + 5 10 8 16 -1. + <_> + 7 10 4 16 2. + <_> + + <_> + 5 16 3 12 -1. + <_> + 6 16 1 12 3. + <_> + + <_> + 10 13 4 15 -1. + <_> + 10 18 4 5 3. + <_> + + <_> + 2 1 10 10 -1. + <_> + 2 1 5 5 2. + <_> + 7 6 5 5 2. + <_> + + <_> + 7 19 2 7 -1. + <_> + 7 19 1 7 2. + 1 + <_> + + <_> + 2 14 9 6 -1. + <_> + 5 14 3 6 3. + <_> + + <_> + 4 13 10 14 -1. + <_> + 9 13 5 7 2. + <_> + 4 20 5 7 2. + <_> + + <_> + 1 7 12 15 -1. + <_> + 5 12 4 5 9. + <_> + + <_> + 6 2 2 24 -1. + <_> + 7 2 1 12 2. + <_> + 6 14 1 12 2. + <_> + + <_> + 5 3 4 12 -1. + <_> + 5 9 4 6 2. + <_> + + <_> + 8 24 6 4 -1. + <_> + 8 24 3 4 2. + <_> + + <_> + 0 24 6 4 -1. + <_> + 3 24 3 4 2. + <_> + + <_> + 1 8 12 4 -1. + <_> + 4 8 6 4 2. + <_> + + <_> + 5 5 4 9 -1. + <_> + 5 8 4 3 3. + <_> + + <_> + 9 18 4 6 -1. + <_> + 9 18 2 6 2. + <_> + + <_> + 2 20 8 8 -1. + <_> + 2 20 4 4 2. + <_> + 6 24 4 4 2. + <_> + + <_> + 11 15 2 8 -1. + <_> + 11 15 1 8 2. + 1 + <_> + + <_> + 3 15 8 2 -1. + <_> + 3 15 8 1 2. + 1 + <_> + + <_> + 5 9 4 6 -1. + <_> + 5 9 2 6 2. + <_> + + <_> + 0 22 4 6 -1. + <_> + 2 22 2 6 2. + <_> + + <_> + 0 26 14 2 -1. + <_> + 0 26 7 2 2. + <_> + + <_> + 3 20 6 8 -1. + <_> + 3 20 3 4 2. + <_> + 6 24 3 4 2. + <_> + + <_> + 7 16 2 12 -1. + <_> + 7 16 1 12 2. + <_> + + <_> + 4 13 4 12 -1. + <_> + 5 13 2 12 2. + <_> + + <_> + 1 22 12 2 -1. + <_> + 1 22 6 2 2. + <_> + + <_> + 0 24 12 4 -1. + <_> + 0 24 6 2 2. + <_> + 6 26 6 2 2. + <_> + + <_> + 5 8 6 4 -1. + <_> + 5 10 6 2 2. + <_> + + <_> + 0 3 12 3 -1. + <_> + 0 4 12 1 3. + <_> + + <_> + 7 4 6 6 -1. + <_> + 7 4 3 6 2. + 1 + <_> + + <_> + 7 4 6 6 -1. + <_> + 7 4 6 3 2. + 1 + <_> + + <_> + 8 3 6 8 -1. + <_> + 8 3 3 8 2. + 1 + <_> + + <_> + 0 6 6 5 -1. + <_> + 3 6 3 5 2. + <_> + + <_> + 8 3 3 12 -1. + <_> + 9 3 1 12 3. + <_> + + <_> + 6 0 2 22 -1. + <_> + 7 0 1 22 2. + <_> + + <_> + 8 3 3 12 -1. + <_> + 9 3 1 12 3. + <_> + + <_> + 3 3 3 12 -1. + <_> + 4 3 1 12 3. + <_> + + <_> + 6 6 3 12 -1. + <_> + 7 6 1 12 3. + <_> + + <_> + 5 15 2 12 -1. + <_> + 6 15 1 12 2. + <_> + + <_> + 5 8 6 10 -1. + <_> + 8 8 3 5 2. + <_> + 5 13 3 5 2. + <_> + + <_> + 2 8 10 10 -1. + <_> + 2 8 5 5 2. + <_> + 7 13 5 5 2. + <_> + + <_> + 7 9 6 10 -1. + <_> + 10 9 3 5 2. + <_> + 7 14 3 5 2. + <_> + + <_> + 0 4 12 3 -1. + <_> + 0 5 12 1 3. + <_> + + <_> + 9 16 2 12 -1. + <_> + 9 16 1 12 2. + <_> + + <_> + 3 16 2 12 -1. + <_> + 4 16 1 12 2. + <_> + + <_> + 2 20 12 6 -1. + <_> + 6 20 4 6 3. + <_> + + <_> + 0 10 8 8 -1. + <_> + 2 10 4 8 2. + <_> + + <_> + 0 12 14 6 -1. + <_> + 0 15 14 3 2. + <_> + + <_> + 1 6 12 16 -1. + <_> + 1 14 12 8 2. + <_> + + <_> + 7 7 3 12 -1. + <_> + 8 7 1 12 3. + <_> + + <_> + 0 0 14 3 -1. + <_> + 0 1 14 1 3. + <_> + + <_> + 1 0 13 3 -1. + <_> + 1 1 13 1 3. + <_> + + <_> + 0 17 6 7 -1. + <_> + 2 17 2 7 3. + <_> + + <_> + 6 24 6 4 -1. + <_> + 6 24 3 4 2. + <_> + + <_> + 0 9 6 7 -1. + <_> + 3 9 3 7 2. + <_> + + <_> + 7 9 6 18 -1. + <_> + 10 9 3 9 2. + <_> + 7 18 3 9 2. + <_> + + <_> + 0 22 12 5 -1. + <_> + 4 22 4 5 3. + <_> + + <_> + 7 9 6 10 -1. + <_> + 10 9 3 5 2. + <_> + 7 14 3 5 2. + <_> + + <_> + 1 9 6 10 -1. + <_> + 1 9 3 5 2. + <_> + 4 14 3 5 2. + <_> + + <_> + 8 22 4 6 -1. + <_> + 8 22 2 6 2. + <_> + + <_> + 0 16 6 8 -1. + <_> + 0 16 3 4 2. + <_> + 3 20 3 4 2. + <_> + + <_> + 4 0 6 8 -1. + <_> + 4 2 6 4 2. + <_> + + <_> + 5 3 4 9 -1. + <_> + 5 6 4 3 3. + <_> + + <_> + 9 8 4 19 -1. + <_> + 10 8 2 19 2. + <_> + + <_> + 5 8 4 6 -1. + <_> + 5 11 4 3 2. + <_> + + <_> + 7 2 7 6 -1. + <_> + 7 4 7 2 3. + <_> + + <_> + 0 16 2 12 -1. + <_> + 1 16 1 12 2. + <_> + + <_> + 11 0 3 17 -1. + <_> + 12 0 1 17 3. + <_> + + <_> + 0 0 3 17 -1. + <_> + 1 0 1 17 3. + <_> + + <_> + 5 13 4 14 -1. + <_> + 5 20 4 7 2. + <_> + + <_> + 6 15 8 4 -1. + <_> + 6 15 4 4 2. + 1 + <_> + + <_> + 5 17 8 6 -1. + <_> + 7 17 4 6 2. + <_> + + <_> + 1 17 8 6 -1. + <_> + 3 17 4 6 2. + <_> + + <_> + 5 11 4 6 -1. + <_> + 5 11 2 6 2. + <_> + + <_> + 3 13 8 13 -1. + <_> + 5 13 4 13 2. + <_> + + <_> + 3 6 8 4 -1. + <_> + 3 8 8 2 2. + <_> + + <_> + 7 5 6 4 -1. + <_> + 7 5 6 2 2. + 1 + <_> + + <_> + 4 9 6 8 -1. + <_> + 7 9 3 4 2. + <_> + 4 13 3 4 2. + <_> + + <_> + 6 4 2 24 -1. + <_> + 6 4 1 12 2. + <_> + 7 16 1 12 2. + <_> + + <_> + 7 24 6 4 -1. + <_> + 7 24 3 4 2. + <_> + + <_> + 7 20 5 3 -1. + <_> + 6 21 5 1 3. + 1 + <_> + + <_> + 3 15 9 12 -1. + <_> + 6 19 3 4 9. + <_> + + <_> + 1 20 8 7 -1. + <_> + 3 20 4 7 2. + <_> + + <_> + 10 12 2 14 -1. + <_> + 10 12 1 14 2. + <_> + + <_> + 2 12 2 14 -1. + <_> + 3 12 1 14 2. + <_> + + <_> + 3 6 8 4 -1. + <_> + 3 8 8 2 2. + <_> + + <_> + 3 9 8 8 -1. + <_> + 3 9 4 4 2. + <_> + 7 13 4 4 2. + <_> + + <_> + 1 2 12 24 -1. + <_> + 5 10 4 8 9. + <_> + + <_> + 2 8 10 3 -1. + <_> + 7 8 5 3 2. + <_> + + <_> + 4 15 8 8 -1. + <_> + 6 15 4 8 2. + <_> + + <_> + 7 15 4 4 -1. + <_> + 6 16 4 2 2. + 1 + <_> + + <_> + 4 12 6 6 -1. + <_> + 6 12 2 6 3. + <_> + + <_> + 4 16 3 12 -1. + <_> + 5 16 1 12 3. + <_> + + <_> + 7 8 3 12 -1. + <_> + 8 8 1 12 3. + <_> + + <_> + 4 8 3 12 -1. + <_> + 5 8 1 12 3. + <_> + + <_> + 10 17 4 6 -1. + <_> + 10 17 2 6 2. + <_> + + <_> + 5 4 2 24 -1. + <_> + 5 4 1 12 2. + <_> + 6 16 1 12 2. + <_> + + <_> + 6 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 0 17 4 6 -1. + <_> + 2 17 2 6 2. + <_> + + <_> + 8 11 6 12 -1. + <_> + 11 11 3 6 2. + <_> + 8 17 3 6 2. + <_> + + <_> + 3 7 3 10 -1. + <_> + 3 12 3 5 2. + <_> + + <_> + 7 6 4 6 -1. + <_> + 7 6 4 3 2. + 1 + <_> + + <_> + 1 7 10 3 -1. + <_> + 6 7 5 3 2. + <_> + + <_> + 7 6 4 6 -1. + <_> + 7 6 4 3 2. + 1 + <_> + + <_> + 7 6 6 4 -1. + <_> + 7 6 3 4 2. + 1 + <_> + + <_> + 7 0 4 6 -1. + <_> + 7 3 4 3 2. + <_> + + <_> + 4 6 6 8 -1. + <_> + 4 6 3 4 2. + <_> + 7 10 3 4 2. + <_> + + <_> + 8 12 6 16 -1. + <_> + 8 20 6 8 2. + <_> + + <_> + 0 4 10 3 -1. + <_> + 5 4 5 3 2. + <_> + + <_> + 8 2 4 13 -1. + <_> + 8 2 2 13 2. + <_> + + <_> + 1 1 10 14 -1. + <_> + 1 1 5 7 2. + <_> + 6 8 5 7 2. + <_> + + <_> + 6 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 0 25 8 3 -1. + <_> + 4 25 4 3 2. + <_> + + <_> + 6 13 3 13 -1. + <_> + 7 13 1 13 3. + <_> + + <_> + 1 24 6 4 -1. + <_> + 4 24 3 4 2. + <_> + + <_> + 8 8 4 7 -1. + <_> + 8 8 2 7 2. + <_> + + <_> + 0 7 12 3 -1. + <_> + 0 8 12 1 3. + <_> + + <_> + 4 6 6 6 -1. + <_> + 4 8 6 2 3. + <_> + + <_> + 3 9 7 4 -1. + <_> + 3 11 7 2 2. + <_> + + <_> + 5 7 4 18 -1. + <_> + 5 16 4 9 2. + <_> + + <_> + 4 1 5 26 -1. + <_> + 4 14 5 13 2. + <_> + + <_> + 6 22 8 6 -1. + <_> + 10 22 4 3 2. + <_> + 6 25 4 3 2. + <_> + + <_> + 0 22 8 6 -1. + <_> + 0 22 4 3 2. + <_> + 4 25 4 3 2. + <_> + + <_> + 5 21 8 6 -1. + <_> + 9 21 4 3 2. + <_> + 5 24 4 3 2. + <_> + + <_> + 3 0 6 4 -1. + <_> + 6 0 3 4 2. + <_> + + <_> + 6 1 6 5 -1. + <_> + 6 1 3 5 2. + <_> + + <_> + 5 6 4 12 -1. + <_> + 6 6 2 12 2. + <_> + + <_> + 8 8 4 7 -1. + <_> + 8 8 2 7 2. + <_> + + <_> + 2 8 4 7 -1. + <_> + 4 8 2 7 2. + <_> + + <_> + 6 12 8 3 -1. + <_> + 6 12 4 3 2. + <_> + + <_> + 1 11 9 5 -1. + <_> + 4 11 3 5 3. + <_> + + <_> + 10 3 4 14 -1. + <_> + 12 3 2 7 2. + <_> + 10 10 2 7 2. + <_> + + <_> + 0 2 4 14 -1. + <_> + 0 2 2 7 2. + <_> + 2 9 2 7 2. + <_> + + <_> + 1 9 13 6 -1. + <_> + 1 11 13 2 3. + <_> + + <_> + 7 17 4 2 -1. + <_> + 7 17 4 1 2. + 1 + <_> + + <_> + 10 15 3 6 -1. + <_> + 11 16 1 6 3. + 1 + <_> + + <_> + 4 15 6 3 -1. + <_> + 3 16 6 1 3. + 1 + <_> + + <_> + 7 19 2 7 -1. + <_> + 7 19 1 7 2. + 1 + <_> + + <_> + 0 18 12 9 -1. + <_> + 3 18 6 9 2. + <_> + + <_> + 7 19 2 7 -1. + <_> + 7 19 1 7 2. + 1 + <_> + + <_> + 7 19 7 2 -1. + <_> + 7 19 7 1 2. + 1 + <_> + + <_> + 7 15 3 13 -1. + <_> + 8 15 1 13 3. + <_> + + <_> + 2 16 8 7 -1. + <_> + 4 16 4 7 2. + <_> + + <_> + 4 21 10 6 -1. + <_> + 9 21 5 3 2. + <_> + 4 24 5 3 2. + <_> + + <_> + 0 21 10 6 -1. + <_> + 0 21 5 3 2. + <_> + 5 24 5 3 2. + <_> + + <_> + 8 14 6 7 -1. + <_> + 10 16 2 7 3. + 1 + <_> + + <_> + 0 20 12 4 -1. + <_> + 0 20 6 2 2. + <_> + 6 22 6 2 2. + <_> + + <_> + 1 14 12 10 -1. + <_> + 4 14 6 10 2. + <_> + + <_> + 3 18 6 4 -1. + <_> + 6 18 3 4 2. + <_> + + <_> + 11 11 2 16 -1. + <_> + 11 19 2 8 2. + <_> + + <_> + 3 10 6 14 -1. + <_> + 3 10 3 7 2. + <_> + 6 17 3 7 2. + <_> + + <_> + 6 9 4 6 -1. + <_> + 6 9 2 6 2. + <_> + + <_> + 5 16 3 12 -1. + <_> + 6 16 1 12 3. + <_> + + <_> + 2 3 12 18 -1. + <_> + 6 9 4 6 9. + <_> + + <_> + 3 4 6 10 -1. + <_> + 3 4 3 5 2. + <_> + 6 9 3 5 2. + <_> + + <_> + 7 18 6 4 -1. + <_> + 7 18 6 2 2. + 1 + <_> + + <_> + 7 18 4 6 -1. + <_> + 7 18 2 6 2. + 1 + <_> + + <_> + 5 8 4 13 -1. + <_> + 6 8 2 13 2. + <_> + + <_> + 2 6 3 12 -1. + <_> + 3 6 1 12 3. + <_> + + <_> + 2 15 12 12 -1. + <_> + 5 15 6 12 2. + <_> + + <_> + 4 15 4 12 -1. + <_> + 5 15 2 12 2. + <_> + + <_> + 4 19 9 9 -1. + <_> + 7 19 3 9 3. + <_> + + <_> + 7 16 5 4 -1. + <_> + 6 17 5 2 2. + 1 + <_> + + <_> + 6 14 6 8 -1. + <_> + 9 14 3 4 2. + <_> + 6 18 3 4 2. + <_> + + <_> + 2 14 6 8 -1. + <_> + 2 14 3 4 2. + <_> + 5 18 3 4 2. + <_> + + <_> + 3 2 10 16 -1. + <_> + 8 2 5 8 2. + <_> + 3 10 5 8 2. + <_> + + <_> + 5 15 3 12 -1. + <_> + 6 15 1 12 3. + <_> + + <_> + 8 23 6 4 -1. + <_> + 8 23 3 4 2. + <_> + + <_> + 4 2 4 14 -1. + <_> + 4 2 2 7 2. + <_> + 6 9 2 7 2. + <_> + + <_> + 3 7 8 6 -1. + <_> + 7 7 4 3 2. + <_> + 3 10 4 3 2. + <_> + + <_> + 2 4 4 6 -1. + <_> + 2 7 4 3 2. + <_> + + <_> + 7 0 6 24 -1. + <_> + 7 6 6 12 2. + <_> + + <_> + 0 13 6 14 -1. + <_> + 0 13 3 7 2. + <_> + 3 20 3 7 2. + <_> + + <_> + 4 19 10 6 -1. + <_> + 9 19 5 3 2. + <_> + 4 22 5 3 2. + <_> + + <_> + 0 19 10 6 -1. + <_> + 0 19 5 3 2. + <_> + 5 22 5 3 2. + <_> + + <_> + 4 18 8 10 -1. + <_> + 8 18 4 5 2. + <_> + 4 23 4 5 2. + <_> + + <_> + 2 18 8 10 -1. + <_> + 2 18 4 5 2. + <_> + 6 23 4 5 2. + <_> + + <_> + 5 14 4 14 -1. + <_> + 5 14 2 14 2. + <_> + + <_> + 1 2 10 16 -1. + <_> + 1 2 5 8 2. + <_> + 6 10 5 8 2. + <_> + + <_> + 0 12 14 16 -1. + <_> + 0 20 14 8 2. + <_> + + <_> + 2 3 10 6 -1. + <_> + 2 3 5 3 2. + <_> + 7 6 5 3 2. + <_> + + <_> + 10 1 3 26 -1. + <_> + 10 14 3 13 2. + <_> + + <_> + 0 9 4 18 -1. + <_> + 0 18 4 9 2. + <_> + + <_> + 8 21 4 6 -1. + <_> + 8 21 2 6 2. + <_> + + <_> + 2 6 9 8 -1. + <_> + 5 6 3 8 3. + <_> + + <_> + 9 21 4 6 -1. + <_> + 9 21 2 6 2. + <_> + + <_> + 3 0 6 8 -1. + <_> + 3 0 3 4 2. + <_> + 6 4 3 4 2. + <_> + + <_> + 9 20 4 7 -1. + <_> + 9 20 2 7 2. + <_> + + <_> + 1 4 10 12 -1. + <_> + 6 4 5 12 2. + <_> + + <_> + 6 1 2 24 -1. + <_> + 6 9 2 8 3. + <_> + + <_> + 2 21 4 6 -1. + <_> + 4 21 2 6 2. + <_> + + <_> + 10 1 3 26 -1. + <_> + 10 14 3 13 2. + <_> + + <_> + 1 1 3 26 -1. + <_> + 1 14 3 13 2. + <_> + + <_> + 2 9 12 14 -1. + <_> + 8 9 6 7 2. + <_> + 2 16 6 7 2. + <_> + + <_> + 4 11 6 8 -1. + <_> + 4 15 6 4 2. + <_> + + <_> + 5 9 9 18 -1. + <_> + 5 15 9 6 3. + <_> + + <_> + 1 0 9 4 -1. + <_> + 4 0 3 4 3. + <_> + + <_> + 5 7 4 6 -1. + <_> + 5 10 4 3 2. + <_> + + <_> + 3 7 8 4 -1. + <_> + 3 9 8 2 2. + <_> + + <_> + 2 16 12 6 -1. + <_> + 8 16 6 3 2. + <_> + 2 19 6 3 2. + <_> + + <_> + 1 2 8 22 -1. + <_> + 1 2 4 11 2. + <_> + 5 13 4 11 2. + <_> + + <_> + 7 19 6 7 -1. + <_> + 9 19 2 7 3. + <_> + + <_> + 6 7 2 18 -1. + <_> + 6 13 2 6 3. + <_> + + <_> + 5 8 8 16 -1. + <_> + 5 12 8 8 2. + <_> + + <_> + 5 20 6 2 -1. + <_> + 5 20 6 1 2. + 1 + <_> + + <_> + 10 19 3 6 -1. + <_> + 11 20 1 6 3. + 1 + <_> + + <_> + 1 22 12 6 -1. + <_> + 4 22 6 6 2. + <_> + + <_> + 2 25 12 3 -1. + <_> + 2 25 6 3 2. + <_> + + <_> + 4 19 6 3 -1. + <_> + 3 20 6 1 3. + 1 + <_> + + <_> + 7 20 6 7 -1. + <_> + 9 20 2 7 3. + <_> + + <_> + 0 17 12 10 -1. + <_> + 4 17 4 10 3. + <_> + + <_> + 1 18 12 4 -1. + <_> + 4 18 6 4 2. + <_> + + <_> + 1 19 6 7 -1. + <_> + 3 19 2 7 3. + <_> + + <_> + 10 22 4 6 -1. + <_> + 10 22 2 6 2. + <_> + + <_> + 1 4 2 24 -1. + <_> + 1 4 1 12 2. + <_> + 2 16 1 12 2. + <_> + + <_> + 10 5 4 10 -1. + <_> + 10 5 2 10 2. + <_> + + <_> + 0 5 4 10 -1. + <_> + 2 5 2 10 2. + <_> + + <_> + 8 10 3 15 -1. + <_> + 9 10 1 15 3. + <_> + + <_> + 3 10 3 15 -1. + <_> + 4 10 1 15 3. + <_> + + <_> + 8 7 3 17 -1. + <_> + 9 7 1 17 3. + <_> + + <_> + 3 7 3 17 -1. + <_> + 4 7 1 17 3. + <_> + + <_> + 9 0 3 13 -1. + <_> + 10 0 1 13 3. + <_> + + <_> + 2 0 3 13 -1. + <_> + 3 0 1 13 3. + <_> + + <_> + 1 3 12 5 -1. + <_> + 4 3 6 5 2. + <_> + + <_> + 6 0 7 6 -1. + <_> + 4 2 7 2 3. + 1 + <_> + + <_> + 7 2 4 8 -1. + <_> + 7 2 2 8 2. + <_> + + <_> + 6 4 2 12 -1. + <_> + 7 4 1 12 2. + <_> + + <_> + 9 16 3 6 -1. + <_> + 10 17 1 6 3. + 1 + <_> + + <_> + 5 8 4 6 -1. + <_> + 7 8 2 6 2. + <_> + + <_> + 1 5 12 21 -1. + <_> + 4 5 6 21 2. + <_> + + <_> + 2 3 12 18 -1. + <_> + 2 9 12 6 3. + <_> + + <_> + 1 1 12 4 -1. + <_> + 4 1 6 4 2. + <_> + + <_> + 6 13 3 13 -1. + <_> + 7 13 1 13 3. + <_> + + <_> + 1 1 6 12 -1. + <_> + 1 1 3 6 2. + <_> + 4 7 3 6 2. + <_> + + <_> + 7 6 6 6 -1. + <_> + 9 6 2 6 3. + <_> + + <_> + 1 6 6 6 -1. + <_> + 3 6 2 6 3. + <_> + + <_> + 7 2 6 13 -1. + <_> + 9 2 2 13 3. + <_> + + <_> + 1 2 6 13 -1. + <_> + 3 2 2 13 3. + <_> + + <_> + 4 0 6 28 -1. + <_> + 6 0 2 28 3. + <_> + + <_> + 0 13 14 3 -1. + <_> + 0 14 14 1 3. + <_> + + <_> + 10 20 4 7 -1. + <_> + 10 20 2 7 2. + <_> + + <_> + 5 8 2 12 -1. + <_> + 6 8 1 12 2. + <_> + + <_> + 5 16 4 8 -1. + <_> + 5 16 2 8 2. + <_> + + <_> + 3 0 6 8 -1. + <_> + 3 0 3 4 2. + <_> + 6 4 3 4 2. + <_> + + <_> + 5 0 6 8 -1. + <_> + 8 0 3 4 2. + <_> + 5 4 3 4 2. + <_> + + <_> + 3 0 6 8 -1. + <_> + 3 0 3 4 2. + <_> + 6 4 3 4 2. + <_> + + <_> + 10 20 4 7 -1. + <_> + 10 20 2 7 2. + <_> + + <_> + 4 15 4 12 -1. + <_> + 5 15 2 12 2. + <_> + + <_> + 7 16 4 6 -1. + <_> + 7 16 2 6 2. + 1 + <_> + + <_> + 3 2 6 9 -1. + <_> + 6 2 3 9 2. + <_> + + <_> + 2 2 12 2 -1. + <_> + 2 2 6 2 2. + <_> + + <_> + 0 2 12 2 -1. + <_> + 6 2 6 2 2. + <_> + + <_> + 6 1 6 4 -1. + <_> + 6 1 3 4 2. + <_> + + <_> + 0 2 4 6 -1. + <_> + 0 5 4 3 2. + <_> + + <_> + 5 4 8 4 -1. + <_> + 5 6 8 2 2. + <_> + + <_> + 1 8 12 2 -1. + <_> + 1 9 12 1 2. + <_> + + <_> + 8 7 6 8 -1. + <_> + 8 9 6 4 2. + <_> + + <_> + 0 7 6 8 -1. + <_> + 0 9 6 4 2. + <_> + + <_> + 11 15 2 12 -1. + <_> + 11 15 1 12 2. + <_> + + <_> + 2 15 3 12 -1. + <_> + 3 15 1 12 3. + <_> + + <_> + 11 15 2 12 -1. + <_> + 11 15 1 12 2. + <_> + + <_> + 1 12 6 16 -1. + <_> + 1 12 3 8 2. + <_> + 4 20 3 8 2. + <_> + + <_> + 4 10 10 5 -1. + <_> + 4 10 5 5 2. + <_> + + <_> + 4 16 8 3 -1. + <_> + 3 17 8 1 3. + 1 + <_> + + <_> + 2 25 12 3 -1. + <_> + 6 25 4 3 3. + <_> + + <_> + 1 10 10 8 -1. + <_> + 1 10 5 4 2. + <_> + 6 14 5 4 2. + <_> + + <_> + 0 12 14 6 -1. + <_> + 7 12 7 3 2. + <_> + 0 15 7 3 2. + <_> + + <_> + 2 20 8 8 -1. + <_> + 2 20 4 4 2. + <_> + 6 24 4 4 2. + <_> + + <_> + 12 16 2 7 -1. + <_> + 12 16 1 7 2. + 1 + <_> + + <_> + 1 17 12 4 -1. + <_> + 4 17 6 4 2. + <_> + + <_> + 5 9 6 14 -1. + <_> + 7 9 2 14 3. + <_> + + <_> + 3 9 6 14 -1. + <_> + 5 9 2 14 3. + <_> + + <_> + 3 8 9 12 -1. + <_> + 6 12 3 4 9. + <_> + + <_> + 5 4 4 19 -1. + <_> + 7 4 2 19 2. + <_> + + <_> + 5 5 4 19 -1. + <_> + 5 5 2 19 2. + <_> + + <_> + 2 10 10 18 -1. + <_> + 2 10 5 9 2. + <_> + 7 19 5 9 2. + <_> + + <_> + 3 3 9 15 -1. + <_> + 3 8 9 5 3. + <_> + + <_> + 3 7 8 12 -1. + <_> + 3 11 8 4 3. + <_> + + <_> + 6 9 6 8 -1. + <_> + 6 11 6 4 2. + <_> + + <_> + 1 16 2 12 -1. + <_> + 2 16 1 12 2. + <_> + + <_> + 11 3 3 18 -1. + <_> + 11 12 3 9 2. + <_> + + <_> + 0 3 3 18 -1. + <_> + 0 12 3 9 2. + <_> + + <_> + 2 8 10 6 -1. + <_> + 7 8 5 3 2. + <_> + 2 11 5 3 2. + <_> + + <_> + 0 3 3 23 -1. + <_> + 1 3 1 23 3. + <_> + + <_> + 7 3 6 5 -1. + <_> + 7 3 3 5 2. + <_> + + <_> + 2 0 10 28 -1. + <_> + 2 14 10 14 2. + <_> + + <_> + 6 17 8 6 -1. + <_> + 10 17 4 3 2. + <_> + 6 20 4 3 2. + <_> + + <_> + 4 13 4 14 -1. + <_> + 4 13 2 7 2. + <_> + 6 20 2 7 2. + <_> + + <_> + 12 7 2 12 -1. + <_> + 12 7 1 12 2. + <_> + + <_> + 1 3 6 5 -1. + <_> + 4 3 3 5 2. + <_> + + <_> + 12 7 2 12 -1. + <_> + 12 7 1 12 2. + <_> + + <_> + 0 7 2 12 -1. + <_> + 1 7 1 12 2. + <_> + + <_> + 4 12 6 6 -1. + <_> + 6 12 2 6 3. + <_> + + <_> + 0 10 10 5 -1. + <_> + 5 10 5 5 2. + <_> + + <_> + 2 9 12 8 -1. + <_> + 5 9 6 8 2. + <_> + + <_> + 0 7 4 12 -1. + <_> + 2 7 2 12 2. + <_> + + <_> + 11 16 3 6 -1. + <_> + 12 17 1 6 3. + 1 + <_> + + <_> + 5 16 2 12 -1. + <_> + 6 16 1 12 2. + <_> + + <_> + 11 16 3 6 -1. + <_> + 12 17 1 6 3. + 1 + <_> + + <_> + 6 6 2 14 -1. + <_> + 7 6 1 14 2. + <_> + + <_> + 3 2 8 11 -1. + <_> + 5 2 4 11 2. + <_> + + <_> + 5 3 3 22 -1. + <_> + 6 3 1 22 3. + <_> + + <_> + 5 7 4 6 -1. + <_> + 5 10 4 3 2. + <_> + + <_> + 4 9 6 4 -1. + <_> + 4 11 6 2 2. + <_> + + <_> + 5 25 8 3 -1. + <_> + 5 25 4 3 2. + <_> + + <_> + 4 6 6 4 -1. + <_> + 4 8 6 2 2. + <_> + + <_> + 4 5 10 8 -1. + <_> + 4 9 10 4 2. + <_> + + <_> + 0 12 6 6 -1. + <_> + 0 15 6 3 2. + <_> + + <_> + 5 25 8 3 -1. + <_> + 5 25 4 3 2. + <_> + + <_> + 0 13 10 6 -1. + <_> + 0 13 5 3 2. + <_> + 5 16 5 3 2. + <_> + + <_> + 6 7 3 15 -1. + <_> + 7 7 1 15 3. + <_> + + <_> + 0 1 14 15 -1. + <_> + 0 6 14 5 3. + <_> + + <_> + 6 4 8 8 -1. + <_> + 6 6 8 4 2. + <_> + + <_> + 0 10 12 8 -1. + <_> + 0 12 12 4 2. + <_> + + <_> + 8 1 6 6 -1. + <_> + 8 3 6 2 3. + <_> + + <_> + 0 1 6 6 -1. + <_> + 0 3 6 2 3. + <_> + + <_> + 5 25 8 3 -1. + <_> + 5 25 4 3 2. + <_> + + <_> + 4 0 6 6 -1. + <_> + 6 0 2 6 3. + <_> + + <_> + 1 16 12 4 -1. + <_> + 4 16 6 4 2. + <_> + + <_> + 8 4 6 4 -1. + <_> + 8 4 6 2 2. + 1 + <_> + + <_> + 6 4 4 6 -1. + <_> + 6 4 2 6 2. + 1 + <_> + + <_> + 4 4 6 4 -1. + <_> + 4 6 6 2 2. + <_> + + <_> + 6 15 7 4 -1. + <_> + 6 15 7 2 2. + 1 + <_> + + <_> + 4 4 6 4 -1. + <_> + 4 6 6 2 2. + <_> + + <_> + 4 4 6 4 -1. + <_> + 4 6 6 2 2. + <_> + + <_> + 8 2 3 12 -1. + <_> + 9 2 1 12 3. + <_> + + <_> + 3 2 3 12 -1. + <_> + 4 2 1 12 3. + <_> + + <_> + 4 0 8 28 -1. + <_> + 6 0 4 28 2. + <_> + + <_> + 2 0 8 28 -1. + <_> + 4 0 4 28 2. + <_> + + <_> + 8 15 4 8 -1. + <_> + 8 15 2 8 2. + <_> + + <_> + 0 22 8 6 -1. + <_> + 0 22 4 3 2. + <_> + 4 25 4 3 2. + <_> + + <_> + 7 20 4 4 -1. + <_> + 8 21 2 4 2. + 1 + <_> + + <_> + 4 15 6 6 -1. + <_> + 6 15 2 6 3. + <_> + + <_> + 4 10 6 9 -1. + <_> + 6 10 2 9 3. + <_> + + <_> + 5 8 4 17 -1. + <_> + 6 8 2 17 2. + <_> + + <_> + 7 16 2 12 -1. + <_> + 7 16 1 12 2. + <_> + + <_> + 6 11 2 12 -1. + <_> + 7 11 1 12 2. + <_> + + <_> + 0 12 14 12 -1. + <_> + 0 12 7 12 2. + <_> + + <_> + 0 4 4 24 -1. + <_> + 0 10 4 12 2. + <_> + + <_> + 8 0 4 8 -1. + <_> + 8 4 4 4 2. + <_> + + <_> + 1 24 12 4 -1. + <_> + 4 24 6 4 2. + <_> + + <_> + 5 9 8 18 -1. + <_> + 5 18 8 9 2. + <_> + + <_> + 1 4 3 22 -1. + <_> + 2 4 1 22 3. + <_> + + <_> + 11 16 2 12 -1. + <_> + 11 16 1 12 2. + <_> + + <_> + 1 16 2 12 -1. + <_> + 2 16 1 12 2. + <_> + + <_> + 4 1 8 6 -1. + <_> + 8 1 4 3 2. + <_> + 4 4 4 3 2. + <_> + + <_> + 2 1 8 6 -1. + <_> + 2 1 4 3 2. + <_> + 6 4 4 3 2. + <_> + + <_> + 4 0 8 20 -1. + <_> + 4 10 8 10 2. + <_> + + <_> + 0 5 9 6 -1. + <_> + 0 8 9 3 2. + <_> + + <_> + 3 4 8 16 -1. + <_> + 3 8 8 8 2. + <_> + + <_> + 3 11 6 16 -1. + <_> + 3 19 6 8 2. + <_> + + <_> + 4 9 6 12 -1. + <_> + 7 9 3 6 2. + <_> + 4 15 3 6 2. + <_> + + <_> + 7 20 4 3 -1. + <_> + 6 21 4 1 3. + 1 + <_> + + <_> + 2 6 12 2 -1. + <_> + 2 7 12 1 2. + <_> + + <_> + 4 2 6 4 -1. + <_> + 4 2 6 2 2. + 1 + <_> + + <_> + 8 1 6 5 -1. + <_> + 8 1 3 5 2. + 1 + <_> + + <_> + 7 4 4 6 -1. + <_> + 7 4 4 3 2. + 1 + <_> + + <_> + 4 5 6 20 -1. + <_> + 4 10 6 10 2. + <_> + + <_> + 2 8 4 13 -1. + <_> + 4 8 2 13 2. + <_> + + <_> + 0 0 14 8 -1. + <_> + 7 0 7 4 2. + <_> + 0 4 7 4 2. + <_> + + <_> + 5 0 4 6 -1. + <_> + 7 0 2 6 2. + <_> + + <_> + 6 2 4 12 -1. + <_> + 6 6 4 4 3. + <_> + + <_> + 2 14 4 7 -1. + <_> + 4 14 2 7 2. + <_> + + <_> + 5 4 6 4 -1. + <_> + 5 4 3 4 2. + <_> + + <_> + 3 0 8 19 -1. + <_> + 7 0 4 19 2. + <_> + + <_> + 5 5 4 15 -1. + <_> + 5 5 2 15 2. + <_> + + <_> + 1 11 12 3 -1. + <_> + 1 12 12 1 3. + <_> + + <_> + 5 4 6 4 -1. + <_> + 5 4 3 4 2. + <_> + + <_> + 1 10 5 6 -1. + <_> + 1 13 5 3 2. + <_> + + <_> + 5 4 6 4 -1. + <_> + 5 4 3 4 2. + <_> + + <_> + 0 13 13 3 -1. + <_> + 0 14 13 1 3. + <_> + + <_> + 5 4 6 4 -1. + <_> + 5 4 3 4 2. + <_> + + <_> + 3 4 6 4 -1. + <_> + 6 4 3 4 2. + <_> + + <_> + 8 22 4 6 -1. + <_> + 8 22 2 6 2. + <_> + + <_> + 2 22 4 6 -1. + <_> + 4 22 2 6 2. + <_> + + <_> + 8 22 4 6 -1. + <_> + 8 22 2 6 2. + <_> + + <_> + 2 22 4 6 -1. + <_> + 4 22 2 6 2. + <_> + + <_> + 0 13 14 3 -1. + <_> + 0 14 14 1 3. + <_> + + <_> + 7 19 7 2 -1. + <_> + 7 19 7 1 2. + 1 + <_> + + <_> + 6 9 6 12 -1. + <_> + 6 13 6 4 3. + <_> + + <_> + 0 26 12 2 -1. + <_> + 6 26 6 2 2. + <_> + + <_> + 2 25 12 3 -1. + <_> + 2 25 6 3 2. + <_> + + <_> + 0 24 14 4 -1. + <_> + 0 24 7 2 2. + <_> + 7 26 7 2 2. + <_> + + <_> + 12 3 2 12 -1. + <_> + 12 3 1 12 2. + 1 + <_> + + <_> + 3 2 4 12 -1. + <_> + 3 2 2 6 2. + <_> + 5 8 2 6 2. + <_> + + <_> + 6 1 3 17 -1. + <_> + 7 1 1 17 3. + <_> + + <_> + 3 6 8 7 -1. + <_> + 5 6 4 7 2. + <_> + + <_> + 6 0 3 12 -1. + <_> + 7 0 1 12 3. + <_> + + <_> + 5 0 3 12 -1. + <_> + 6 0 1 12 3. + <_> + + <_> + 6 1 3 17 -1. + <_> + 7 1 1 17 3. + <_> + + <_> + 3 8 8 8 -1. + <_> + 3 8 4 4 2. + <_> + 7 12 4 4 2. + <_> + + <_> + 8 15 3 12 -1. + <_> + 9 15 1 12 3. + <_> + + <_> + 0 16 10 12 -1. + <_> + 0 16 5 6 2. + <_> + 5 22 5 6 2. + <_> + + <_> + 6 2 8 22 -1. + <_> + 10 2 4 11 2. + <_> + 6 13 4 11 2. + <_> + + <_> + 0 25 12 3 -1. + <_> + 6 25 6 3 2. + <_> + + <_> + 2 14 12 14 -1. + <_> + 2 14 6 14 2. + <_> + + <_> + 2 14 8 10 -1. + <_> + 4 14 4 10 2. + <_> + + <_> + 5 13 6 14 -1. + <_> + 7 13 2 14 3. + <_> + + <_> + 3 13 6 14 -1. + <_> + 5 13 2 14 3. + <_> + + <_> + 4 12 8 13 -1. + <_> + 6 12 4 13 2. + <_> + + <_> + 2 12 8 13 -1. + <_> + 4 12 4 13 2. + <_> + + <_> + 3 22 10 6 -1. + <_> + 8 22 5 3 2. + <_> + 3 25 5 3 2. + <_> + + <_> + 1 22 10 6 -1. + <_> + 1 22 5 3 2. + <_> + 6 25 5 3 2. + <_> + + <_> + 8 5 6 9 -1. + <_> + 8 8 6 3 3. + <_> + + <_> + 0 8 12 6 -1. + <_> + 0 8 6 3 2. + <_> + 6 11 6 3 2. + <_> + + <_> + 9 6 3 13 -1. + <_> + 10 6 1 13 3. + <_> + + <_> + 0 2 5 24 -1. + <_> + 0 14 5 12 2. + <_> + + <_> + 11 11 3 8 -1. + <_> + 11 15 3 4 2. + <_> + + <_> + 5 1 3 17 -1. + <_> + 6 1 1 17 3. + <_> + + <_> + 5 5 8 8 -1. + <_> + 7 5 4 8 2. + <_> + + <_> + 3 16 2 12 -1. + <_> + 4 16 1 12 2. + <_> + + <_> + 6 3 6 18 -1. + <_> + 8 9 2 6 9. + <_> + + <_> + 4 2 4 12 -1. + <_> + 4 6 4 4 3. + <_> + + <_> + 5 1 4 12 -1. + <_> + 5 4 4 6 2. + <_> + + <_> + 1 0 12 12 -1. + <_> + 5 4 4 4 9. + <_> + + <_> + 6 0 6 5 -1. + <_> + 6 0 3 5 2. + <_> + + <_> + 2 0 6 5 -1. + <_> + 5 0 3 5 2. + <_> + + <_> + 6 5 3 21 -1. + <_> + 7 5 1 21 3. + <_> + + <_> + 1 0 6 24 -1. + <_> + 1 0 3 12 2. + <_> + 4 12 3 12 2. + <_> + + <_> + 8 18 4 6 -1. + <_> + 9 19 2 6 2. + 1 + <_> + + <_> + 3 0 6 8 -1. + <_> + 3 0 3 4 2. + <_> + 6 4 3 4 2. + <_> + + <_> + 5 24 9 4 -1. + <_> + 8 24 3 4 3. + <_> + + <_> + 0 20 8 6 -1. + <_> + 2 20 4 6 2. + <_> + + <_> + 7 22 6 6 -1. + <_> + 9 22 2 6 3. + <_> + + <_> + 1 22 6 6 -1. + <_> + 3 22 2 6 3. + <_> + + <_> + 1 15 6 11 -1. + <_> + 3 15 2 11 3. + <_> + + <_> + 4 6 6 4 -1. + <_> + 4 8 6 2 2. + <_> + + <_> + 0 16 4 11 -1. + <_> + 2 16 2 11 2. + <_> + + <_> + 8 16 6 6 -1. + <_> + 10 16 2 6 3. + <_> + + <_> + 0 16 12 12 -1. + <_> + 4 20 4 4 9. + <_> + + <_> + 8 10 6 18 -1. + <_> + 8 16 6 6 3. + <_> + + <_> + 0 12 5 16 -1. + <_> + 0 20 5 8 2. + <_> + + <_> + 11 12 3 16 -1. + <_> + 11 16 3 8 2. + <_> + + <_> + 0 13 14 12 -1. + <_> + 0 13 7 6 2. + <_> + 7 19 7 6 2. + <_> + + <_> + 3 12 10 16 -1. + <_> + 8 12 5 8 2. + <_> + 3 20 5 8 2. + <_> + + <_> + 3 11 5 12 -1. + <_> + 3 17 5 6 2. + <_> + + <_> + 6 0 6 18 -1. + <_> + 8 6 2 6 9. + <_> + + <_> + 6 4 2 14 -1. + <_> + 6 11 2 7 2. + <_> + + <_> + 3 15 8 11 -1. + <_> + 5 15 4 11 2. + <_> + + <_> + 3 2 8 11 -1. + <_> + 5 2 4 11 2. + <_> + + <_> + 1 4 12 5 -1. + <_> + 5 4 4 5 3. + <_> + + <_> + 1 3 8 25 -1. + <_> + 5 3 4 25 2. + <_> + + <_> + 8 16 6 6 -1. + <_> + 10 16 2 6 3. + <_> + + <_> + 0 16 6 6 -1. + <_> + 2 16 2 6 3. + <_> + + <_> + 7 13 3 14 -1. + <_> + 8 13 1 14 3. + <_> + + <_> + 2 8 4 12 -1. + <_> + 2 8 2 6 2. + <_> + 4 14 2 6 2. + <_> + + <_> + 7 13 3 14 -1. + <_> + 8 13 1 14 3. + <_> + + <_> + 4 13 3 14 -1. + <_> + 5 13 1 14 3. + <_> + + <_> + 5 3 9 6 -1. + <_> + 5 5 9 2 3. + <_> + + <_> + 3 8 6 4 -1. + <_> + 3 10 6 2 2. + <_> + + <_> + 11 3 3 12 -1. + <_> + 11 7 3 4 3. + <_> + + <_> + 0 8 8 3 -1. + <_> + 4 8 4 3 2. + <_> + + <_> + 1 13 12 8 -1. + <_> + 7 13 6 4 2. + <_> + 1 17 6 4 2. + <_> + + <_> + 2 18 10 10 -1. + <_> + 7 18 5 10 2. + <_> + + <_> + 5 8 4 6 -1. + <_> + 5 8 2 6 2. + <_> + + <_> + 0 0 13 3 -1. + <_> + 0 1 13 1 3. + <_> + + <_> + 8 1 6 8 -1. + <_> + 11 1 3 4 2. + <_> + 8 5 3 4 2. + <_> + + <_> + 0 1 6 8 -1. + <_> + 0 1 3 4 2. + <_> + 3 5 3 4 2. + <_> + + <_> + 7 18 2 7 -1. + <_> + 7 18 1 7 2. + 1 + <_> + + <_> + 7 18 7 2 -1. + <_> + 7 18 7 1 2. + 1 + <_> + + <_> + 4 22 9 4 -1. + <_> + 7 22 3 4 3. + <_> + + <_> + 0 4 5 6 -1. + <_> + 0 7 5 3 2. + <_> + + <_> + 11 3 3 12 -1. + <_> + 11 7 3 4 3. + <_> + + <_> + 0 3 3 12 -1. + <_> + 0 7 3 4 3. + <_> + + <_> + 5 0 6 8 -1. + <_> + 8 0 3 4 2. + <_> + 5 4 3 4 2. + <_> + + <_> + 3 0 6 8 -1. + <_> + 3 0 3 4 2. + <_> + 6 4 3 4 2. + <_> + + <_> + 8 3 2 12 -1. + <_> + 8 3 1 12 2. + <_> + + <_> + 0 6 9 8 -1. + <_> + 0 8 9 4 2. + <_> + + <_> + 4 2 6 4 -1. + <_> + 4 4 6 2 2. + <_> + + <_> + 1 18 4 10 -1. + <_> + 3 18 2 10 2. + <_> + + <_> + 9 18 4 6 -1. + <_> + 9 18 2 6 2. + <_> + + <_> + 1 2 12 3 -1. + <_> + 1 3 12 1 3. + <_> + + <_> + 9 18 4 6 -1. + <_> + 9 18 2 6 2. + <_> + + <_> + 0 2 14 3 -1. + <_> + 0 3 14 1 3. + <_> + + <_> + 9 19 4 6 -1. + <_> + 9 19 2 6 2. + <_> + + <_> + 1 19 4 6 -1. + <_> + 3 19 2 6 2. + <_> + + <_> + 8 7 3 15 -1. + <_> + 8 12 3 5 3. + <_> + + <_> + 7 20 4 4 -1. + <_> + 6 21 4 2 2. + 1 + <_> + + <_> + 9 3 4 6 -1. + <_> + 9 3 2 6 2. + <_> + + <_> + 1 3 4 6 -1. + <_> + 3 3 2 6 2. + <_> + + <_> + 8 7 3 15 -1. + <_> + 8 12 3 5 3. + <_> + + <_> + 3 7 3 15 -1. + <_> + 3 12 3 5 3. + <_> + + <_> + 9 12 2 12 -1. + <_> + 9 18 2 6 2. + <_> + + <_> + 3 12 2 12 -1. + <_> + 3 18 2 6 2. + <_> + + <_> + 8 0 5 6 -1. + <_> + 8 3 5 3 2. + <_> + + <_> + 1 0 5 6 -1. + <_> + 1 3 5 3 2. + <_> + + <_> + 3 6 8 8 -1. + <_> + 3 8 8 4 2. + <_> + + <_> + 2 4 6 14 -1. + <_> + 4 4 2 14 3. + <_> + + <_> + 5 10 7 16 -1. + <_> + 5 18 7 8 2. + <_> + + <_> + 4 10 6 10 -1. + <_> + 6 10 2 10 3. + <_> + + <_> + 5 10 4 12 -1. + <_> + 5 13 4 6 2. + <_> + + <_> + 2 0 6 18 -1. + <_> + 4 6 2 6 9. + <_> + + <_> + 1 11 12 4 -1. + <_> + 1 12 12 2 2. + <_> + + <_> + 7 15 5 2 -1. + <_> + 7 15 5 1 2. + 1 + <_> + + <_> + 4 24 6 4 -1. + <_> + 4 24 3 4 2. + <_> + + <_> + 5 18 5 4 -1. + <_> + 4 19 5 2 2. + 1 + <_> + + <_> + 3 1 6 25 -1. + <_> + 6 1 3 25 2. + <_> + + <_> + 6 13 2 12 -1. + <_> + 6 13 1 12 2. + <_> + + <_> + 6 4 2 13 -1. + <_> + 7 4 1 13 2. + <_> + + <_> + 8 2 6 19 -1. + <_> + 10 2 2 19 3. + <_> + + <_> + 0 2 6 19 -1. + <_> + 2 2 2 19 3. + <_> + + <_> + 9 1 4 13 -1. + <_> + 10 1 2 13 2. + <_> + + <_> + 1 1 4 13 -1. + <_> + 2 1 2 13 2. + <_> + + <_> + 3 3 8 3 -1. + <_> + 3 3 4 3 2. + <_> + + <_> + 2 5 10 18 -1. + <_> + 2 11 10 6 3. + <_> + + <_> + 3 8 9 12 -1. + <_> + 6 12 3 4 9. + <_> + + <_> + 4 4 6 4 -1. + <_> + 4 6 6 2 2. + <_> + + <_> + 4 8 10 8 -1. + <_> + 9 8 5 4 2. + <_> + 4 12 5 4 2. + <_> + + <_> + 2 8 6 6 -1. + <_> + 4 8 2 6 3. + <_> + + <_> + 4 10 6 10 -1. + <_> + 7 10 3 5 2. + <_> + 4 15 3 5 2. + <_> + + <_> + 3 9 8 14 -1. + <_> + 3 9 4 7 2. + <_> + 7 16 4 7 2. + <_> + + <_> + 4 7 6 20 -1. + <_> + 7 7 3 10 2. + <_> + 4 17 3 10 2. + <_> + + <_> + 3 0 6 8 -1. + <_> + 3 0 3 4 2. + <_> + 6 4 3 4 2. + <_> + + <_> + 7 5 4 6 -1. + <_> + 7 5 2 6 2. + <_> + + <_> + 3 7 8 8 -1. + <_> + 3 7 4 4 2. + <_> + 7 11 4 4 2. + <_> + + <_> + 5 9 6 4 -1. + <_> + 5 11 6 2 2. + <_> + + <_> + 0 9 4 9 -1. + <_> + 0 12 4 3 3. + <_> + + <_> + 8 6 4 12 -1. + <_> + 8 10 4 4 3. + <_> + + <_> + 1 7 10 6 -1. + <_> + 1 9 10 2 3. + <_> + + <_> + 0 7 14 12 -1. + <_> + 0 10 14 6 2. + <_> + + <_> + 3 9 6 4 -1. + <_> + 3 11 6 2 2. + <_> + + <_> + 8 1 4 8 -1. + <_> + 8 1 2 8 2. + 1 + <_> + + <_> + 2 6 4 12 -1. + <_> + 2 10 4 4 3. + <_> + + <_> + 2 16 12 4 -1. + <_> + 8 16 6 2 2. + <_> + 2 18 6 2 2. + <_> + + <_> + 7 20 4 4 -1. + <_> + 6 21 4 2 2. + 1 + <_> + + <_> + 9 16 2 12 -1. + <_> + 9 16 1 12 2. + <_> + + <_> + 5 18 5 4 -1. + <_> + 4 19 5 2 2. + 1 + <_> + + <_> + 8 1 4 8 -1. + <_> + 8 1 2 8 2. + 1 + <_> + + <_> + 2 6 9 7 -1. + <_> + 5 6 3 7 3. + <_> + + <_> + 3 6 8 12 -1. + <_> + 3 9 8 6 2. + <_> + + <_> + 0 0 9 21 -1. + <_> + 3 7 3 7 9. + <_> + + <_> + 8 1 4 8 -1. + <_> + 8 1 2 8 2. + 1 + <_> + + <_> + 2 1 5 18 -1. + <_> + 2 10 5 9 2. + <_> + + <_> + 8 1 6 7 -1. + <_> + 8 1 3 7 2. + 1 + <_> + + <_> + 0 3 2 16 -1. + <_> + 1 3 1 16 2. + <_> + + <_> + 9 18 4 8 -1. + <_> + 9 18 2 8 2. + <_> + + <_> + 0 18 12 9 -1. + <_> + 3 18 6 9 2. + <_> + + <_> + 1 2 12 3 -1. + <_> + 5 2 4 3 3. + <_> + + <_> + 6 1 7 6 -1. + <_> + 6 1 7 3 2. + 1 + <_> + + <_> + 6 9 3 13 -1. + <_> + 7 9 1 13 3. + <_> + + <_> + 6 1 6 6 -1. + <_> + 6 1 6 3 2. + 1 + <_> + + <_> + 6 4 4 11 -1. + <_> + 6 4 2 11 2. + <_> + + <_> + 4 4 4 11 -1. + <_> + 6 4 2 11 2. + <_> + + <_> + 8 1 4 8 -1. + <_> + 8 1 2 8 2. + 1 + <_> + + <_> + 1 20 4 8 -1. + <_> + 3 20 2 8 2. + <_> + + <_> + 9 22 4 6 -1. + <_> + 9 22 2 6 2. + <_> + + <_> + 1 22 4 6 -1. + <_> + 3 22 2 6 2. + <_> + + <_> + 9 0 3 22 -1. + <_> + 10 0 1 22 3. + <_> + + <_> + 3 21 8 6 -1. + <_> + 5 21 4 6 2. + <_> + + <_> + 6 11 3 15 -1. + <_> + 7 11 1 15 3. + <_> + + <_> + 6 1 8 4 -1. + <_> + 6 1 8 2 2. + 1 + <_> + + <_> + 2 16 12 4 -1. + <_> + 8 16 6 2 2. + <_> + 2 18 6 2 2. + <_> + + <_> + 0 16 12 4 -1. + <_> + 0 16 6 2 2. + <_> + 6 18 6 2 2. + <_> + + <_> + 6 10 3 12 -1. + <_> + 6 14 3 4 3. + <_> + + <_> + 4 13 6 14 -1. + <_> + 4 20 6 7 2. + <_> + + <_> + 3 9 9 15 -1. + <_> + 6 14 3 5 9. + <_> + + <_> + 4 10 9 4 -1. + <_> + 7 13 3 4 3. + 1 + <_> + + <_> + 3 7 8 7 -1. + <_> + 3 7 4 7 2. + <_> + + <_> + 4 9 4 6 -1. + <_> + 6 9 2 6 2. + <_> + + <_> + 4 9 6 11 -1. + <_> + 6 9 2 11 3. + <_> + + <_> + 1 11 4 12 -1. + <_> + 1 15 4 4 3. + <_> + + <_> + 9 0 2 12 -1. + <_> + 9 0 1 12 2. + <_> + + <_> + 2 4 4 16 -1. + <_> + 2 4 2 8 2. + <_> + 4 12 2 8 2. + <_> + + <_> + 5 8 5 14 -1. + <_> + 5 15 5 7 2. + <_> + + <_> + 2 0 3 22 -1. + <_> + 3 0 1 22 3. + <_> + + <_> + 6 25 8 3 -1. + <_> + 6 25 4 3 2. + <_> + + <_> + 1 6 8 22 -1. + <_> + 1 17 8 11 2. + <_> + + <_> + 4 15 6 8 -1. + <_> + 7 15 3 4 2. + <_> + 4 19 3 4 2. + <_> + + <_> + 5 13 4 14 -1. + <_> + 5 13 2 7 2. + <_> + 7 20 2 7 2. + <_> + + <_> + 2 16 10 12 -1. + <_> + 7 16 5 6 2. + <_> + 2 22 5 6 2. + <_> + + <_> + 4 15 8 3 -1. + <_> + 4 15 4 3 2. + 1 + <_> + + <_> + 2 0 12 3 -1. + <_> + 2 1 12 1 3. + <_> + + <_> + 0 5 9 22 -1. + <_> + 3 5 3 22 3. + <_> + + <_> + 4 9 6 4 -1. + <_> + 4 11 6 2 2. + <_> + + <_> + 4 14 6 2 -1. + <_> + 4 14 6 1 2. + 1 + <_> + + <_> + 8 12 6 4 -1. + <_> + 8 12 3 4 2. + 1 + <_> + + <_> + 5 16 8 4 -1. + <_> + 4 17 8 2 2. + 1 + <_> + + <_> + 5 15 4 6 -1. + <_> + 5 15 2 6 2. + <_> + + <_> + 5 9 2 14 -1. + <_> + 5 16 2 7 2. + <_> + + <_> + 6 6 6 12 -1. + <_> + 6 10 6 4 3. + <_> + + <_> + 1 20 12 6 -1. + <_> + 1 20 6 3 2. + <_> + 7 23 6 3 2. + <_> + + <_> + 4 8 6 4 -1. + <_> + 4 10 6 2 2. + <_> + + <_> + 1 6 9 6 -1. + <_> + 1 8 9 2 3. + <_> + + <_> + 5 6 6 4 -1. + <_> + 5 8 6 2 2. + <_> + + <_> + 3 3 8 6 -1. + <_> + 3 3 4 3 2. + <_> + 7 6 4 3 2. + <_> + + <_> + 6 23 6 5 -1. + <_> + 6 23 3 5 2. + <_> + + <_> + 0 3 12 4 -1. + <_> + 0 3 6 2 2. + <_> + 6 5 6 2 2. + <_> + + <_> + 7 4 6 18 -1. + <_> + 7 10 6 6 3. + <_> + + <_> + 6 12 4 6 -1. + <_> + 6 12 4 3 2. + 1 + <_> + + <_> + 2 15 12 6 -1. + <_> + 5 15 6 6 2. + <_> + + <_> + 0 5 4 12 -1. + <_> + 0 5 2 6 2. + <_> + 2 11 2 6 2. + <_> + + <_> + 10 4 4 16 -1. + <_> + 12 4 2 8 2. + <_> + 10 12 2 8 2. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_lefteye_2splits.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_lefteye_2splits.xml new file mode 100644 index 0000000000000000000000000000000000000000..9a9ef58fb7438c324c373442189a9bc1cadb947b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_lefteye_2splits.xml @@ -0,0 +1,7390 @@ + + + +BOOST + HAAR + 20 + 20 + + 33 + + 0 + 20 + + <_> + 5 + -2.3924100399017334e+00 + + <_> + + 0 1 0 2.7325989678502083e-02 -1 -2 1 -7.0568458177149296e-03 + + -9.0600621700286865e-01 9.3385708332061768e-01 + -4.5859959721565247e-01 + <_> + + 0 1 2 -1.2538699805736542e-01 -1 -2 3 + -1.1487299948930740e-01 + + 7.2463721036911011e-01 5.3034168481826782e-01 + -8.3221220970153809e-01 + <_> + + 0 1 4 -5.8309938758611679e-02 -1 -2 5 + -1.7684370279312134e-02 + + 6.5408891439437866e-01 2.9482871294021606e-01 + -7.4809581041336060e-01 + <_> + + 0 1 6 3.5937170032411814e-03 -1 -2 7 -1.3436110457405448e-03 + + -5.0303918123245239e-01 6.5995341539382935e-01 + -5.5740857124328613e-01 + <_> + + 1 0 8 -2.1795940119773149e-03 -1 -2 9 1.1514870449900627e-02 + + -4.2016351222991943e-01 5.9694331884384155e-01 + -8.0508047342300415e-01 + <_> + 7 + -2.6498730182647705e+00 + + <_> + + 1 0 10 -2.2485560178756714e-01 -1 -2 11 + -9.6008004620671272e-03 + + -8.1363201141357422e-01 9.0863138437271118e-01 + -3.2208970189094543e-01 + <_> + + 0 1 12 7.4219167232513428e-02 -1 -2 13 + -5.3165741264820099e-03 + + -7.5329452753067017e-01 8.6339497566223145e-01 + -3.3463571220636368e-02 + <_> + + 1 0 14 -2.1913449745625257e-03 -1 -2 15 + 1.1800959706306458e-02 + + -5.5720347166061401e-01 -3.2359680533409119e-01 + 6.4163821935653687e-01 + <_> + + 1 0 16 -7.6179709285497665e-03 -1 -2 17 + -9.0587511658668518e-03 + + -5.3167867660522461e-01 -7.3611450195312500e-01 + 5.5660772323608398e-01 + <_> + + 1 0 18 -4.9959779717028141e-03 -1 -2 19 + 8.0803930759429932e-03 + + -4.1476911306381226e-01 5.9278357028961182e-01 + -6.7384922504425049e-01 + <_> + + 0 1 20 1.9909010734409094e-03 -1 -2 21 + 1.6845749923959374e-03 + + -4.2145928740501404e-01 5.4679220914840698e-01 + -7.5099450349807739e-01 + <_> + + 1 0 22 -5.0781872123479843e-03 -1 -2 23 + 2.6645609177649021e-03 + + -3.9899548888206482e-01 5.8940601348876953e-01 + -4.6778041124343872e-01 + <_> + 8 + -2.3828399181365967e+00 + + <_> + + 1 0 24 -2.5301438570022583e-01 -1 -2 25 + 2.9663778841495514e-03 + + -7.5402587652206421e-01 -3.5279649496078491e-01 + 8.7992298603057861e-01 + <_> + + 1 0 26 -4.7127649188041687e-02 -1 -2 27 + 1.9500750349834561e-03 + + -5.2234899997711182e-01 -3.0379909276962280e-01 + 7.5204378366470337e-01 + <_> + + 0 1 28 -7.1481026709079742e-02 -1 -2 29 + 2.2189730405807495e-01 + + 6.5841901302337646e-01 -6.0907202959060669e-01 + 5.6842160224914551e-01 + <_> + + 0 1 30 3.3842820674180984e-02 -1 -2 31 + -5.1714561413973570e-04 + + -6.4311647415161133e-01 5.4620361328125000e-01 + -3.9984148740768433e-01 + <_> + + 1 0 32 -3.4458211157470942e-03 -1 -2 33 + 2.4395729415118694e-03 + + -4.5636838674545288e-01 4.7798189520835876e-01 + -9.1247087717056274e-01 + <_> + + 1 0 34 2.1385070867836475e-03 -1 -2 35 + 1.8324409611523151e-03 + + -8.3617758750915527e-01 3.3462798595428467e-01 + -7.5008547306060791e-01 + <_> + + 1 0 36 1.1167610064148903e-03 -1 -2 37 + 9.9106997367925942e-05 + + -6.9083797931671143e-01 -3.4561330080032349e-01 + 4.1183179616928101e-01 + <_> + + 1 0 38 1.5447770245373249e-02 -1 -2 39 + -3.2244939357042313e-02 + + 3.6980190873146057e-01 6.1112838983535767e-01 + -5.5685341358184814e-01 + <_> + 9 + -2.1312201023101807e+00 + + <_> + + 1 0 40 -1.2251129746437073e-01 -1 -2 41 + -1.4230609871447086e-02 + + -6.7026627063751221e-01 8.7802392244338989e-01 + -1.8784180283546448e-01 + <_> + + 1 0 42 -5.9833219274878502e-03 -1 -2 43 + 7.7085137367248535e-02 + + -5.8122849464416504e-01 -5.0395351648330688e-01 + 6.7387360334396362e-01 + <_> + + 0 1 44 -1.1086189746856689e-01 -1 -2 45 + 9.4604760408401489e-02 + + 6.3432037830352783e-01 -4.9726390838623047e-01 + 3.8787439465522766e-01 + <_> + + 0 1 46 1.7696130089461803e-04 -1 -2 47 + 2.0120320841670036e-03 + + -6.3938802480697632e-01 -3.5313910245895386e-01 + 5.1538437604904175e-01 + <_> + + 1 0 48 -1.6102839726954699e-03 -1 -2 49 + 1.6666069859638810e-03 + + -5.1915901899337769e-01 4.0478190779685974e-01 + -6.9496357440948486e-01 + <_> + + 1 0 50 -7.1480998303741217e-04 -1 -2 51 + -4.7647571191191673e-03 + + -4.8945188522338867e-01 -5.0037759542465210e-01 + 4.0796059370040894e-01 + <_> + + 0 1 52 7.8659597784280777e-03 -1 -2 53 + -1.2938310392200947e-03 + + -3.3636429905891418e-01 -6.7621380090713501e-01 + 4.7010248899459839e-01 + <_> + + 1 0 54 -3.6533139063976705e-04 -1 -2 55 + 2.0565679296851158e-03 + + -4.7071608901023865e-01 4.1323411464691162e-01 + -5.5526417493820190e-01 + <_> + + 0 1 56 7.8385717642959207e-05 -1 -2 57 + 1.7511800397187471e-03 + + -5.1521158218383789e-01 3.3417248725891113e-01 + -7.9558157920837402e-01 + <_> + 9 + -2.0176210403442383e+00 + + <_> + + 1 0 58 -6.4695239067077637e-02 -1 -2 59 + 9.5212170854210854e-03 + + -6.1326402425765991e-01 -5.4831558465957642e-01 + 7.8652447462081909e-01 + <_> + + 0 1 60 -9.8109766840934753e-02 -1 -2 61 + -8.5938459634780884e-01 + + 6.9113308191299438e-01 4.5364680886268616e-01 + -5.0026148557662964e-01 + <_> + + 1 0 62 -8.9836172759532928e-02 -1 -2 63 + 2.6945930439978838e-03 + + -5.2928781509399414e-01 -3.8199779391288757e-01 + 5.7821297645568848e-01 + <_> + + 1 0 64 2.5973599404096603e-03 -1 -2 65 + -3.0058110132813454e-03 + + -9.1928368806838989e-01 -8.0213797092437744e-01 + 2.9259279370307922e-01 + <_> + + 1 0 66 -4.5496290549635887e-03 -1 -2 67 + 4.7376728616654873e-03 + + -4.3678951263427734e-01 4.1010880470275879e-01 + -7.2692811489105225e-01 + <_> + + 1 0 68 4.6190437860786915e-03 -1 -2 69 + 4.5377281494438648e-03 + + -8.4895151853561401e-01 3.0124679207801819e-01 + -7.0301771163940430e-01 + <_> + + 1 0 70 -2.4952790699899197e-03 -1 -2 71 + -5.1753767766058445e-03 + + -4.6784749627113342e-01 -7.4530351161956787e-01 + 4.0011820197105408e-01 + <_> + + 0 1 72 -5.2049742080271244e-03 -1 -2 73 + -8.7892003357410431e-02 + + 4.8669269680976868e-01 8.3493947982788086e-01 + -3.3827719092369080e-01 + <_> + + 0 1 74 6.9997250102460384e-03 -1 -2 75 + -9.0990252792835236e-03 + + -2.9039889574050903e-01 6.2315821647644043e-01 + -3.5424730181694031e-01 + <_> + 11 + -2.2212049961090088e+00 + + <_> + + 1 0 76 -5.5702101439237595e-02 -1 -2 77 + 3.4033291041851044e-02 + + -6.9841581583023071e-01 -3.9509189128875732e-01 + 8.0313128232955933e-01 + <_> + + 1 0 78 -4.6199060976505280e-02 -1 -2 79 + -4.8061669804155827e-03 + + -4.8860380053520203e-01 8.0775612592697144e-01 + -7.4490822851657867e-02 + <_> + + 0 1 80 1.8170489929616451e-03 -1 -2 81 + -3.6162370815873146e-03 + + -3.8043528795242310e-01 6.0451722145080566e-01 + -2.2582240402698517e-01 + <_> + + 1 0 82 -1.5706950798630714e-02 -1 -2 83 + 4.3929950334131718e-03 + + -3.7577998638153076e-01 5.4214221239089966e-01 + -3.7388241291046143e-01 + <_> + + 1 0 84 -1.0047219984699041e-04 -1 -2 85 + -8.6475118994712830e-02 + + -4.7433409094810486e-01 5.0186318159103394e-01 + -2.1136230230331421e-01 + <_> + + 0 1 86 -7.7960766851902008e-02 -1 -2 87 + 9.8561286926269531e-02 + + 5.7337349653244019e-01 -3.2515558600425720e-01 + 5.3035980463027954e-01 + <_> + + 0 1 88 -5.4359167814254761e-01 -1 -2 89 + -4.4177699834108353e-02 + + 5.9464299678802490e-01 2.9671078920364380e-01 + -3.8474830985069275e-01 + <_> + + 1 0 90 -8.8016409426927567e-04 -1 -2 91 + 2.6359390467405319e-03 + + -3.2000589370727539e-01 -1.7586140334606171e-01 + 4.8360350728034973e-01 + <_> + + 0 1 92 -1.4203689992427826e-02 -1 -2 93 + -7.3902818257920444e-05 + + -7.7882087230682373e-01 3.0619418621063232e-01 + -3.3196049928665161e-01 + <_> + + 1 0 94 4.6157240867614746e-03 -1 -2 95 + 1.1152310296893120e-02 + + 4.9689778685569763e-01 -5.3435891866683960e-01 + 9.7229443490505219e-02 + <_> + + 0 1 96 -6.0547702014446259e-03 -1 -2 97 + -2.1118740551173687e-03 + + -8.3811217546463013e-01 6.3617032766342163e-01 + -4.8299189656972885e-02 + <_> + 13 + -2.1328830718994141e+00 + + <_> + + 1 0 98 -1.2956829741597176e-02 -1 -2 99 + -2.7141019701957703e-02 + + -6.4874732494354248e-01 7.6293057203292847e-01 + -3.3947870135307312e-01 + <_> + + 0 1 100 4.5119998976588249e-03 -1 -2 101 + 1.2516690418124199e-02 + + -5.0059837102890015e-01 -3.6873328685760498e-01 + 5.9888631105422974e-01 + <_> + + 1 0 102 -6.0557941906154156e-03 -1 -2 103 + -4.6923749148845673e-02 + + -3.8940930366516113e-01 6.3268911838531494e-01 + -2.6270028948783875e-01 + <_> + + 1 0 104 -2.4018269032239914e-03 -1 -2 105 + -1.5936089679598808e-02 + + -5.0517928600311279e-01 6.5526002645492554e-01 + -1.7308109998703003e-01 + <_> + + 0 1 106 1.4000290073454380e-02 -1 -2 107 + 1.3202779926359653e-02 + + -4.1653230786323547e-01 -4.9121969938278198e-01 + 3.7397938966751099e-01 + <_> + + 1 0 108 -2.7658580802381039e-04 -1 -2 109 + -4.8634149134159088e-03 + + -4.5382869243621826e-01 -5.9796881675720215e-01 + 3.1217721104621887e-01 + <_> + + 1 0 110 2.7654920704662800e-03 -1 -2 111 + 2.5534769892692566e-01 + + -7.6476567983627319e-01 -3.4267220646142960e-02 + 7.0786577463150024e-01 + <_> + + 1 0 112 4.6812961809337139e-03 -1 -2 113 + 6.5162130631506443e-03 + + -7.8790861368179321e-01 1.8877579271793365e-01 + -7.9132258892059326e-01 + <_> + + 1 0 114 5.7325329631567001e-02 -1 -2 115 + -1.2718330137431622e-02 + + 6.2349188327789307e-01 3.0860608816146851e-01 + -3.2784330844879150e-01 + <_> + + 1 0 116 -6.7374261561781168e-04 -1 -2 117 + 5.6564649567008018e-03 + + -4.5451548695564270e-01 2.7431339025497437e-01 + -7.8447937965393066e-01 + <_> + + 1 0 118 3.1134090386331081e-03 -1 -2 119 + 2.4249779526144266e-03 + + 3.9738771319389343e-01 -3.5198271274566650e-01 + 3.0490091443061829e-01 + <_> + + 0 1 120 -5.5641461163759232e-02 -1 -2 121 + 4.3548129498958588e-02 + + 4.5575490593910217e-01 -3.3370929956436157e-01 + 2.9501429200172424e-01 + <_> + + 1 0 122 8.0783379962667823e-04 -1 -2 123 + 1.8713270546868443e-03 + + 2.2460040450096130e-01 -6.6048407554626465e-01 + 1.5031670033931732e-01 + <_> + 13 + -1.9884539842605591e+00 + + <_> + + 1 0 124 -4.3516629934310913e-01 -1 -2 125 + 6.2595037743449211e-03 + + -4.9959290027618408e-01 -2.3639589548110962e-01 + 7.9975378513336182e-01 + <_> + + 1 0 126 -6.6518150269985199e-03 -1 -2 127 + -5.7092090137302876e-03 + + -5.4752808809280396e-01 6.4273327589035034e-01 + -2.1511809527873993e-01 + <_> + + 0 1 128 1.9450180232524872e-02 -1 -2 129 + -5.4476498626172543e-03 + + -5.3605002164840698e-01 5.5794501304626465e-01 + -2.1474960446357727e-01 + <_> + + 1 0 130 -1.6347589553333819e-04 -1 -2 131 + 7.1614650078117847e-03 + + -5.5962842702865601e-01 -1.6604369878768921e-01 + 4.6805259585380554e-01 + <_> + + 1 0 132 -1.3145170174539089e-02 -1 -2 133 + -1.1436809785664082e-02 + + -4.1279909014701843e-01 3.7901800870895386e-01 + -4.1791579127311707e-01 + <_> + + 0 1 134 -7.2912001051008701e-03 -1 -2 135 + -5.2170921117067337e-04 + + -7.6089668273925781e-01 3.2527619600296021e-01 + -3.0110970139503479e-01 + <_> + + 1 0 136 3.3754010219126940e-03 -1 -2 137 + 2.5100160855799913e-03 + + -7.8373962640762329e-01 1.8525449931621552e-01 + -5.8084958791732788e-01 + <_> + + 0 1 138 -1.2884209863841534e-03 -1 -2 139 + -1.8726480193436146e-03 + + 2.7339500188827515e-01 1.6819879412651062e-01 + -5.1986902952194214e-01 + <_> + + 1 0 140 2.4010189808905125e-03 -1 -2 141 + 4.8938081599771976e-03 + + -8.2964670658111572e-01 1.6796599328517914e-01 + -6.5530872344970703e-01 + <_> + + 0 1 142 3.1223020050674677e-03 -1 -2 143 + 5.0366491079330444e-02 + + -4.3521308898925781e-01 -5.8327801525592804e-03 + 7.0878309011459351e-01 + <_> + + 1 0 144 3.6151800304651260e-02 -1 -2 145 + -1.3426589965820312e-01 + + 4.4979161024093628e-01 3.9472430944442749e-01 + -3.7588629126548767e-01 + <_> + + 1 0 146 -2.7791369706392288e-02 -1 -2 147 + -1.2712170369923115e-02 + + -2.9488721489906311e-01 -7.2011739015579224e-01 + 3.6595028638839722e-01 + <_> + + 1 0 148 -3.8276749546639621e-04 -1 -2 149 + -6.1330529861152172e-03 + + -4.0581339597702026e-01 -5.2725958824157715e-01 + 3.6040499806404114e-01 + <_> + 16 + -2.0902318954467773e+00 + + <_> + + 1 0 150 -4.7748669981956482e-02 -1 -2 151 + 4.6201851218938828e-03 + + -5.9902387857437134e-01 -2.4887490272521973e-01 + 6.9201582670211792e-01 + <_> + + 1 0 152 -8.5353456437587738e-02 -1 -2 153 + -7.0110969245433807e-03 + + -5.1715832948684692e-01 5.6950652599334717e-01 + -2.4749420583248138e-01 + <_> + + 1 0 154 -7.6567470096051693e-03 -1 -2 155 + -3.5919491201639175e-02 + + -3.7316519021987915e-01 4.9438580870628357e-01 + -3.9586681127548218e-01 + <_> + + 0 1 156 -7.4326626956462860e-02 -1 -2 157 + 9.0118587017059326e-02 + + 5.6755977869033813e-01 -3.8921171426773071e-01 + 3.1079098582267761e-01 + <_> + + 0 1 158 1.6736460849642754e-02 -1 -2 159 + 1.8592580454424024e-03 + + -3.6674138903617859e-01 3.4875720739364624e-01 + -5.7483112812042236e-01 + <_> + + 1 0 160 7.5264140032231808e-03 -1 -2 161 + -3.5309391096234322e-03 + + 6.7878991365432739e-01 4.8617920279502869e-01 + -2.5660640001296997e-01 + <_> + + 1 0 162 -4.9510748795000836e-05 -1 -2 163 + -6.8923248909413815e-03 + + -4.5661240816116333e-01 -5.7134729623794556e-01 + 3.2921048998832703e-01 + <_> + + 1 0 164 6.1156069859862328e-03 -1 -2 165 + -5.5014882236719131e-03 + + -7.1315360069274902e-01 -5.9139078855514526e-01 + 1.9805949926376343e-01 + <_> + + 1 0 166 -4.2378060519695282e-02 -1 -2 167 + 2.2011259570717812e-03 + + -3.8239300251007080e-01 3.3457010984420776e-01 + -4.3032339215278625e-01 + <_> + + 1 0 168 2.1217379253357649e-03 -1 -2 169 + 6.4385468140244484e-03 + + -6.8310022354125977e-01 2.0478610694408417e-01 + -6.1793941259384155e-01 + <_> + + 1 0 170 3.1177410855889320e-03 -1 -2 171 + 4.2230269173160195e-04 + + 5.1137161254882812e-01 -3.6440208554267883e-01 + 2.1073049306869507e-01 + <_> + + 0 1 172 -6.5657291561365128e-03 -1 -2 173 + 2.5686610024422407e-03 + + -6.4581501483917236e-01 2.7643561363220215e-01 + -3.4198498725891113e-01 + <_> + + 1 0 174 -6.2437567976303399e-05 -1 -2 175 + -3.6269261036068201e-03 + + -3.1758078932762146e-01 -8.1051957607269287e-01 + 2.7218630909919739e-01 + <_> + + 1 0 176 -3.4638389479368925e-03 -1 -2 177 + -7.4930191040039062e-02 + + -3.9515769481658936e-01 -5.4353868961334229e-01 + 2.6106119155883789e-01 + <_> + + 0 1 178 -9.7247250378131866e-03 -1 -2 179 + 4.5450199395418167e-03 + + 4.1124871373176575e-01 -3.1576550006866455e-01 + 3.9046970009803772e-01 + <_> + + 0 1 180 -2.7354240883141756e-03 -1 -2 181 + -1.6969470307230949e-02 + + -7.4906748533248901e-01 -6.2437218427658081e-01 + 1.8387380242347717e-01 + <_> + 15 + -1.9407310485839844e+00 + + <_> + + 1 0 182 -2.4978699162602425e-02 -1 -2 183 + -5.8007869869470596e-02 + + -6.0697889328002930e-01 7.1478021144866943e-01 + -2.9943239688873291e-01 + <_> + + 1 0 184 -5.1753749139606953e-03 -1 -2 185 + -8.9618662605062127e-04 + + -3.5297989845275879e-01 5.4417461156845093e-01 + -3.9789950847625732e-01 + <_> + + 1 0 186 -2.8718139219563454e-05 -1 -2 187 + 4.7620530240237713e-03 + + -4.8898181319236755e-01 -3.1144559383392334e-01 + 4.6786791086196899e-01 + <_> + + 0 1 188 1.9751280546188354e-02 -1 -2 189 + -1.2683609966188669e-03 + + -4.3020489811897278e-01 -5.4090851545333862e-01 + 3.9797520637512207e-01 + <_> + + 1 0 190 -4.5749718992738053e-05 -1 -2 191 + 2.4090509396046400e-03 + + -4.4518938660621643e-01 2.8822308778762817e-01 + -5.4514312744140625e-01 + <_> + + 0 1 192 -4.5728669501841068e-03 -1 -2 193 + 8.9018214493989944e-03 + + 5.5039870738983154e-01 -4.1598889231681824e-01 + 1.7468899488449097e-01 + <_> + + 0 1 194 -1.2056449800729752e-01 -1 -2 195 + 4.6919930726289749e-02 + + 6.8890577554702759e-01 -4.2266309261322021e-01 + 1.7010940611362457e-01 + <_> + + 0 1 196 -4.2390259914100170e-03 -1 -2 197 + 3.2174249645322561e-03 + + -6.3045340776443481e-01 -3.6097949743270874e-01 + 2.4933730065822601e-01 + <_> + + 0 1 198 -8.5738790221512318e-04 -1 -2 199 + -1.8432449549436569e-02 + + 3.0993479490280151e-01 9.7758449614048004e-02 + -5.0742352008819580e-01 + <_> + + 1 0 200 5.8692828752100468e-03 -1 -2 201 + -6.8751699291169643e-03 + + -7.4556058645248413e-01 -6.7458391189575195e-01 + 1.5918810665607452e-01 + <_> + + 1 0 202 -6.8542227381840348e-05 -1 -2 203 + -1.0658579878509045e-02 + + -4.1279420256614685e-01 3.7002709507942200e-01 + -2.1731729805469513e-01 + <_> + + 0 1 204 -1.8811509944498539e-03 -1 -2 205 + -2.2309130057692528e-02 + + 5.7902830839157104e-01 1.9725680351257324e-01 + -3.2475191354751587e-01 + <_> + + 1 0 206 6.5826578065752983e-04 -1 -2 207 + -5.0781588070094585e-03 + + -6.0630238056182861e-01 -7.7123302221298218e-01 + 1.8186129629611969e-01 + <_> + + 1 0 208 5.6215081363916397e-02 -1 -2 209 + -3.7720590829849243e-02 + + 5.0561398267745972e-01 3.6052110791206360e-01 + -3.2743760943412781e-01 + <_> + + 1 0 210 3.9480631239712238e-03 -1 -2 211 + -2.4269670248031616e-03 + + -7.5788182020187378e-01 5.2076101303100586e-01 + -6.1021361500024796e-02 + <_> + 19 + -2.1061589717864990e+00 + + <_> + + 1 0 212 -1.6906699165701866e-02 -1 -2 213 + 2.5327840819954872e-02 + + -4.7501268982887268e-01 -4.4016760587692261e-01 + 6.0885351896286011e-01 + <_> + + 0 1 214 -1.5663320198655128e-02 -1 -2 215 + -1.6101899743080139e-01 + + 5.7100051641464233e-01 4.0989148616790771e-01 + -3.8142371177673340e-01 + <_> + + 0 1 216 1.6885380318854004e-04 -1 -2 217 + -3.0552360694855452e-03 + + -4.7958490252494812e-01 4.2852300405502319e-01 + -2.8252631425857544e-01 + <_> + + 1 0 218 4.8042940907180309e-03 -1 -2 219 + -5.0092511810362339e-03 + + -6.8659138679504395e-01 -5.9033542871475220e-01 + 1.9732500612735748e-01 + <_> + + 1 0 220 -3.7119518965482712e-02 -1 -2 221 + 3.7857799325138330e-03 + + -4.3130961060523987e-01 3.3596190810203552e-01 + -3.7401720881462097e-01 + <_> + + 0 1 222 -1.0869850404560566e-02 -1 -2 223 + 4.0577541221864522e-04 + + 5.4841208457946777e-01 -5.0022697448730469e-01 + 5.1423858851194382e-02 + <_> + + 1 0 224 5.0201490521430969e-03 -1 -2 225 + 2.5601210072636604e-03 + + -5.9016227722167969e-01 1.9469800591468811e-01 + -6.4648360013961792e-01 + <_> + + 1 0 226 -1.2395749799907207e-03 -1 -2 227 + -5.1075750961899757e-03 + + -2.7762159705162048e-01 -6.1149162054061890e-01 + 3.5250389575958252e-01 + <_> + + 1 0 228 -6.4853738876990974e-05 -1 -2 229 + 2.3282810579985380e-03 + + -3.4008860588073730e-01 2.7134749293327332e-01 + -6.6915398836135864e-01 + <_> + + 1 0 230 -1.5571110416203737e-03 -1 -2 231 + 2.3992219939827919e-03 + + -4.1144248843193054e-01 2.5939700007438660e-01 + -4.0380299091339111e-01 + <_> + + 1 0 232 7.7784422319382429e-04 -1 -2 233 + 3.2334199640899897e-03 + + 2.9523921012878418e-01 -5.8436852693557739e-01 + -1.7936639487743378e-02 + <_> + + 1 0 234 -5.6113858590833843e-05 -1 -2 235 + 1.9111000001430511e-03 + + -3.5021650791168213e-01 2.6312610507011414e-01 + -6.1549347639083862e-01 + <_> + + 0 1 236 -3.4321150742471218e-03 -1 -2 237 + -1.4541969634592533e-02 + + 3.7493300437927246e-01 4.3788930773735046e-01 + -3.0131611227989197e-01 + <_> + + 0 1 238 -2.5027070194482803e-02 -1 -2 239 + -3.1183639075607061e-03 + + -5.2829748392105103e-01 -8.1336849927902222e-01 + 1.7928420007228851e-01 + <_> + + 1 0 240 2.9415208846330643e-03 -1 -2 241 + -2.4807679001241922e-03 + + -4.7243058681488037e-01 -6.0058331489562988e-01 + 2.1497109532356262e-01 + <_> + + 1 0 242 -4.2498838156461716e-03 -1 -2 243 + 7.6959328725934029e-03 + + -3.3230608701705933e-01 2.1247069537639618e-01 + -8.1967252492904663e-01 + <_> + + 0 1 244 -6.1426039785146713e-02 -1 -2 245 + 5.3176790475845337e-02 + + 5.2200448513031006e-01 -2.9851761460304260e-01 + 2.8654190897941589e-01 + <_> + + 0 1 246 2.5695779186207801e-05 -1 -2 247 + 2.4311970919370651e-03 + + -3.4719291329383850e-01 -1.2133490294218063e-01 + 3.8965350389480591e-01 + <_> + + 1 0 248 5.6956289336085320e-03 -1 -2 249 + -6.6630227956920862e-04 + + -6.6364032030105591e-01 2.7921909093856812e-01 + -2.1624849736690521e-01 + <_> + 20 + -2.0051579475402832e+00 + + <_> + + 1 0 250 -2.8509549796581268e-02 -1 -2 251 + -1.6429109498858452e-02 + + -5.5133241415023804e-01 6.0328769683837891e-01 + -3.0009600520133972e-01 + <_> + + 1 0 252 -5.8078952133655548e-03 -1 -2 253 + -1.4670349657535553e-02 + + -4.8640519380569458e-01 4.4786658883094788e-01 + -3.5448360443115234e-01 + <_> + + 1 0 254 -1.0694459779188037e-03 -1 -2 255 + -5.0697539001703262e-02 + + -3.8593119382858276e-01 4.3865600228309631e-01 + -3.1134051084518433e-01 + <_> + + 0 1 256 -7.2318017482757568e-02 -1 -2 257 + -1.6740759834647179e-02 + + 5.5695492029190063e-01 3.4036931395530701e-01 + -3.7713068723678589e-01 + <_> + + 1 0 258 1.2923260219395161e-02 -1 -2 259 + -2.0832989830523729e-03 + + 2.6987180113792419e-01 7.2217263281345367e-02 + -5.0617259740829468e-01 + <_> + + 0 1 260 2.9217539122328162e-04 -1 -2 261 + 4.6477448195219040e-03 + + -4.7199469804763794e-01 -2.0233640074729919e-01 + 3.6684620380401611e-01 + <_> + + 0 1 262 1.6355320112779737e-03 -1 -2 263 + 6.0143060982227325e-03 + + -3.3369150757789612e-01 2.6335370540618896e-01 + -7.5315129756927490e-01 + <_> + + 0 1 264 -1.9768040627241135e-02 -1 -2 265 + 5.0995801575481892e-03 + + -7.3396641016006470e-01 -1.0626330226659775e-01 + 3.7877479195594788e-01 + <_> + + 1 0 266 2.1737320348620415e-03 -1 -2 267 + 2.3621059954166412e-02 + + -4.5873621106147766e-01 -3.7341989576816559e-02 + 5.0312960147857666e-01 + <_> + + 1 0 268 4.7070439904928207e-02 -1 -2 269 + 4.8429161310195923e-02 + + 3.9159670472145081e-01 -2.7507638931274414e-01 + 3.6923450231552124e-01 + <_> + + 0 1 270 7.1763257437851280e-05 -1 -2 271 + -4.0031517855823040e-03 + + -2.6133701205253601e-01 -4.6118479967117310e-01 + 3.4101578593254089e-01 + <_> + + 1 0 272 2.5536299217492342e-03 -1 -2 273 + -2.5720898993313313e-03 + + 4.4237849116325378e-01 4.3066531419754028e-01 + -2.8360688686370850e-01 + <_> + + 1 0 274 8.7512210011482239e-03 -1 -2 275 + 5.7346918620169163e-03 + + -7.7647632360458374e-01 1.4551159739494324e-01 + -7.5074160099029541e-01 + <_> + + 0 1 276 -6.6438838839530945e-03 -1 -2 277 + -3.4590701106935740e-03 + + 4.0350550413131714e-01 2.8769719600677490e-01 + -2.8021600842475891e-01 + <_> + + 1 0 278 9.9742468446493149e-03 -1 -2 279 + 1.3233659788966179e-02 + + -6.0677021741867065e-01 1.5478080511093140e-01 + -7.0759147405624390e-01 + <_> + + 0 1 280 -5.0271311774849892e-03 -1 -2 281 + -1.2092100223526359e-04 + + -7.3897778987884521e-01 2.3473000526428223e-01 + -2.4400579929351807e-01 + <_> + + 1 0 282 -1.2881499715149403e-03 -1 -2 283 + 6.2854858115315437e-03 + + -2.8901669383049011e-01 2.8100869059562683e-01 + -5.6933850049972534e-01 + <_> + + 1 0 284 5.6929360143840313e-03 -1 -2 285 + -5.3880861960351467e-03 + + -7.8456932306289673e-01 2.6201328635215759e-01 + -2.2232030332088470e-01 + <_> + + 1 0 286 4.8205819912254810e-03 -1 -2 287 + 3.4279188513755798e-01 + + 5.6795972585678101e-01 -1.8314230442047119e-01 + 5.4108071327209473e-01 + <_> + + 0 1 288 5.1370919682085514e-03 -1 -2 289 + -9.1285221278667450e-03 + + -3.9116761088371277e-01 5.3076338768005371e-01 + -3.0019309371709824e-02 + <_> + 21 + -2.1121981143951416e+00 + + <_> + + 1 0 290 -5.1386129111051559e-02 -1 -2 291 + 5.1850839518010616e-03 + + -5.3148782253265381e-01 -2.4744540452957153e-01 + 6.1181622743606567e-01 + <_> + + 1 0 292 -1.5259400010108948e-02 -1 -2 293 + 2.5995150208473206e-02 + + -4.3303629755973816e-01 4.3979901820421219e-02 + 7.3829138278961182e-01 + <_> + + 1 0 294 -3.2312370836734772e-02 -1 -2 295 + 1.3700700365006924e-02 + + -3.9609751105308533e-01 -2.7643880248069763e-01 + 4.2535358667373657e-01 + <_> + + 1 0 296 -2.2647869773209095e-03 -1 -2 297 + -6.8290620110929012e-03 + + -3.2005569338798523e-01 -5.1682972908020020e-01 + 3.6975708603858948e-01 + <_> + + 1 0 298 -2.2481549531221390e-03 -1 -2 299 + 4.5944549143314362e-02 + + -3.6244350671768188e-01 -1.3187309959903359e-03 + 6.3217681646347046e-01 + <_> + + 1 0 300 1.8755620112642646e-03 -1 -2 301 + -1.9700559787452221e-03 + + -7.1403390169143677e-01 -5.8730661869049072e-01 + 1.7592810094356537e-01 + <_> + + 1 0 302 -6.5721389837563038e-03 -1 -2 303 + -1.1746180243790150e-02 + + -3.6347511410713196e-01 3.1440791487693787e-01 + -4.0111118555068970e-01 + <_> + + 1 0 304 -1.6494120063725859e-04 -1 -2 305 + -7.2169408667832613e-05 + + -3.7792590260505676e-01 5.2791112661361694e-01 + -1.0790319740772247e-01 + <_> + + 0 1 306 1.9697639800142497e-04 -1 -2 307 + -1.1423509567975998e-02 + + -4.7097641229629517e-01 -8.5209292173385620e-01 + 1.7662869393825531e-01 + <_> + + 0 1 308 -4.5562228187918663e-03 -1 -2 309 + -4.4720191508531570e-03 + + -8.0601161718368530e-01 -6.1500209569931030e-01 + 1.2908309698104858e-01 + <_> + + 0 1 310 -1.7765410011634231e-03 -1 -2 311 + -7.8799277544021606e-03 + + 3.1382599472999573e-01 3.0394628643989563e-01 + -3.7204921245574951e-01 + <_> + + 0 1 312 -1.4284689677879214e-03 -1 -2 313 + -1.8939910223707557e-03 + + 5.0413030385971069e-01 3.4823760390281677e-01 + -2.3673820495605469e-01 + <_> + + 0 1 314 -3.1496640294790268e-03 -1 -2 315 + -1.0716119781136513e-02 + + -6.6812378168106079e-01 -4.8515519499778748e-01 + 1.9036419689655304e-01 + <_> + + 0 1 316 -6.8033537827432156e-03 -1 -2 317 + 1.4902319759130478e-02 + + -5.6979268789291382e-01 1.3098250329494476e-01 + -7.1448272466659546e-01 + <_> + + 0 1 318 -3.4170228987932205e-02 -1 -2 319 + -1.4779250323772430e-01 + + 5.0575131177902222e-01 2.8233268857002258e-01 + -2.7205321192741394e-01 + <_> + + 1 0 320 -5.5842810979811475e-05 -1 -2 321 + 3.9885081350803375e-02 + + -2.6936730742454529e-01 5.6696129031479359e-03 + 6.3975161314010620e-01 + <_> + + 1 0 322 1.2483130209147930e-02 -1 -2 323 + -3.2864511013031006e-04 + + -7.4533742666244507e-01 3.6449620127677917e-01 + -9.6498817205429077e-02 + <_> + + 0 1 324 -1.4710469986312091e-04 -1 -2 325 + -2.7814340591430664e-01 + + 1.4060440659523010e-01 5.7002830505371094e-01 + -4.8755478858947754e-01 + <_> + + 0 1 326 -1.3452640268951654e-03 -1 -2 327 + 9.1500842245295644e-04 + + 3.9255830645561218e-01 -3.0215170979499817e-01 + 3.6698031425476074e-01 + <_> + + 0 1 328 -3.4133149310946465e-03 -1 -2 329 + 5.1169008947908878e-03 + + -6.4085817337036133e-01 -2.3052580654621124e-01 + 2.4285919964313507e-01 + <_> + + 1 0 330 8.8846698403358459e-02 -1 -2 331 + 6.1080828309059143e-03 + + 4.5381888747215271e-01 -3.5880088806152344e-01 + 1.3209380209445953e-01 + <_> + 23 + -1.8701590299606323e+00 + + <_> + + 1 0 332 -1.5930000692605972e-02 -1 -2 333 + 2.7407450601458549e-02 + + -3.5245341062545776e-01 -6.0236789286136627e-02 + 7.2715848684310913e-01 + <_> + + 1 0 334 -8.5037678480148315e-02 -1 -2 335 + -1.1508919997140765e-03 + + -4.3576711416244507e-01 4.6471679210662842e-01 + -3.5896891355514526e-01 + <_> + + 1 0 336 -6.4599298639222980e-04 -1 -2 337 + 5.5495807901024818e-03 + + -3.1371060013771057e-01 4.1225919127464294e-01 + -4.9400448799133301e-01 + <_> + + 1 0 338 -1.1472150217741728e-03 -1 -2 339 + -6.4546810463070869e-03 + + -3.9192581176757812e-01 -6.9197827577590942e-01 + 2.6103940606117249e-01 + <_> + + 0 1 340 -1.1414250358939171e-02 -1 -2 341 + 1.1582579463720322e-03 + + 3.2361420989036560e-01 -3.8304999470710754e-01 + 2.8015980124473572e-01 + <_> + + 1 0 342 -6.1077292775735259e-04 -1 -2 343 + 1.1812780285254121e-03 + + -3.7471079826354980e-01 -1.7685219645500183e-01 + 3.5498109459877014e-01 + <_> + + 1 0 344 7.9117231070995331e-03 -1 -2 345 + -9.0904926764778793e-05 + + -6.9681918621063232e-01 2.0756739377975464e-01 + -4.4282090663909912e-01 + <_> + + 0 1 346 2.8638960793614388e-03 -1 -2 347 + 1.2769990134984255e-03 + + -4.1364789009094238e-01 -2.1157020330429077e-01 + 3.1919568777084351e-01 + <_> + + 0 1 348 -7.5440858490765095e-03 -1 -2 349 + 5.4467269219458103e-03 + + -7.5495690107345581e-01 1.3229879736900330e-01 + -6.7695891857147217e-01 + <_> + + 1 0 350 1.3641830300912261e-03 -1 -2 351 + 1.3810779899358749e-02 + + -4.2168149352073669e-01 1.5719360113143921e-01 + -6.7965167760848999e-01 + <_> + + 1 0 352 5.0265640020370483e-02 -1 -2 353 + 4.7765119234099984e-05 + + 7.4369138479232788e-01 -3.8102349638938904e-01 + 1.0605350136756897e-01 + <_> + + 1 0 354 1.4666689932346344e-01 -1 -2 355 + -3.0426830053329468e-01 + + 5.3409832715988159e-01 3.7783610820770264e-01 + -2.1534620225429535e-01 + <_> + + 0 1 356 -3.2244708854705095e-03 -1 -2 357 + -1.7187190242111683e-03 + + 2.8274241089820862e-01 1.0677109658718109e-01 + -4.4204118847846985e-01 + <_> + + 0 1 358 -8.4115704521536827e-03 -1 -2 359 + -2.3220919072628021e-02 + + -8.3557051420211792e-01 -5.1933908462524414e-01 + 1.3181640207767487e-01 + <_> + + 0 1 360 -6.3912221230566502e-03 -1 -2 361 + -3.0661540222354233e-04 + + -6.8552321195602417e-01 2.2192850708961487e-01 + -2.3945030570030212e-01 + <_> + + 1 0 362 1.8742750398814678e-03 -1 -2 363 + -2.8299540281295776e-02 + + -4.7218438982963562e-01 -6.8186718225479126e-01 + 1.5923790633678436e-01 + <_> + + 1 0 364 7.9352483153343201e-03 -1 -2 365 + -8.7599940598011017e-03 + + -7.3135781288146973e-01 -6.0014718770980835e-01 + 1.0350330173969269e-01 + <_> + + 0 1 366 -5.5426149629056454e-03 -1 -2 367 + -1.8066290067508817e-03 + + -5.9360408782958984e-01 2.5533521175384521e-01 + -1.7036439478397369e-01 + <_> + + 1 0 368 -8.3993803709745407e-03 -1 -2 369 + -1.9515500171110034e-03 + + -2.3953610658645630e-01 3.7252411246299744e-01 + -1.2982900440692902e-01 + <_> + + 0 1 370 -2.2850139066576958e-03 -1 -2 371 + -6.1910818330943584e-03 + + 5.0227212905883789e-01 4.4551658630371094e-01 + -1.6307780146598816e-01 + <_> + + 1 0 372 1.1659320443868637e-03 -1 -2 373 + -2.1016779355704784e-03 + + 3.4809079766273499e-01 3.1531378626823425e-01 + -3.4710261225700378e-01 + <_> + + 0 1 374 -9.1615924611687660e-03 -1 -2 375 + -2.0036540925502777e-02 + + -6.8623197078704834e-01 -6.8991881608963013e-01 + 1.2962220609188080e-01 + <_> + + 1 0 376 2.7148448862135410e-03 -1 -2 377 + 2.2834159899502993e-03 + + 4.7745740413665771e-01 -1.3344570063054562e-02 + -6.1795878410339355e-01 + <_> + 26 + -1.9807859659194946e+00 + + <_> + + 1 0 378 -3.2838471233844757e-02 -1 -2 379 + -7.5696408748626709e-03 + + -5.1984071731567383e-01 6.3690251111984253e-01 + -1.1562170088291168e-01 + <_> + + 1 0 380 5.4125871509313583e-02 -1 -2 381 + 2.7004599571228027e-01 + + 5.0340247154235840e-01 -3.4640678763389587e-01 + 3.7651509046554565e-01 + <_> + + 0 1 382 7.0261410437524319e-03 -1 -2 383 + 3.1245660502463579e-03 + + -4.1046440601348877e-01 -4.1382190585136414e-01 + 3.7550741434097290e-01 + <_> + + 1 0 384 -1.8708549905568361e-03 -1 -2 385 + -1.4969009906053543e-02 + + -3.7827330827713013e-01 3.9941680431365967e-01 + -2.2254510223865509e-01 + <_> + + 1 0 386 3.4136420581489801e-03 -1 -2 387 + 2.3454260081052780e-03 + + -5.4667568206787109e-01 1.6618840396404266e-01 + -6.3203942775726318e-01 + <_> + + 1 0 388 -1.1689099483191967e-03 -1 -2 389 + -7.8206984326243401e-03 + + -4.4972181320190430e-01 -5.7166117429733276e-01 + 1.8599990010261536e-01 + <_> + + 0 1 390 -2.6324259117245674e-02 -1 -2 391 + -9.1647548833861947e-04 + + -7.8041112422943115e-01 2.3100090026855469e-01 + -2.1224120259284973e-01 + <_> + + 0 1 392 -2.3702960461378098e-03 -1 -2 393 + -9.2874821275472641e-03 + + 2.7304211258888245e-01 2.3200799524784088e-01 + -3.4602558612823486e-01 + <_> + + 1 0 394 2.9221060685813427e-03 -1 -2 395 + -1.4097889652475715e-03 + + -6.9972628355026245e-01 4.8019358515739441e-01 + -4.2650200426578522e-02 + <_> + + 1 0 396 9.3326548812910914e-04 -1 -2 397 + -5.6837309151887894e-02 + + 3.7708479166030884e-01 4.6375161409378052e-01 + -2.0441579818725586e-01 + <_> + + 1 0 398 -9.1405760031193495e-05 -1 -2 399 + -1.1147770099341869e-02 + + -2.9447770118713379e-01 3.6579200625419617e-01 + -1.6106230020523071e-01 + <_> + + 1 0 400 8.0759642878547311e-04 -1 -2 401 + 1.7215589759871364e-03 + + -3.8769969344139099e-01 1.7790059745311737e-01 + -5.9673792123794556e-01 + <_> + + 0 1 402 1.4305640012025833e-02 -1 -2 403 + -3.8885008543729782e-02 + + -2.8887918591499329e-01 3.6497229337692261e-01 + -1.3762719929218292e-01 + <_> + + 0 1 404 -3.4479280002415180e-03 -1 -2 405 + 3.0168178677558899e-01 + + 1.8110840022563934e-01 -3.5425490140914917e-01 + 4.2958360910415649e-01 + <_> + + 1 0 406 2.8582389932125807e-03 -1 -2 407 + 1.4091320335865021e-03 + + 5.2957808971405029e-01 -2.1234430372714996e-01 + 3.1428509950637817e-01 + <_> + + 0 1 408 -1.6597079811617732e-03 -1 -2 409 + 8.7804382201284170e-04 + + -6.3348418474197388e-01 -5.5315300822257996e-02 + 3.9389958977699280e-01 + <_> + + 1 0 410 2.0211800001561642e-03 -1 -2 411 + -6.8409871309995651e-03 + + -4.7127309441566467e-01 -6.4065527915954590e-01 + 1.4861440658569336e-01 + <_> + + 1 0 412 4.7200761735439301e-02 -1 -2 413 + 4.9684080295264721e-03 + + 4.1216409206390381e-01 -3.2404300570487976e-01 + 1.5755960345268250e-01 + <_> + + 1 0 414 3.7529911845922470e-02 -1 -2 415 + -1.1665089987218380e-02 + + 4.1328459978103638e-01 2.5467500090599060e-01 + -3.1303560733795166e-01 + <_> + + 1 0 416 -6.8298257247079164e-05 -1 -2 417 + 1.5325429849326611e-02 + + -2.7212071418762207e-01 2.2946609556674957e-01 + -6.7345708608627319e-01 + <_> + + 1 0 418 8.5185896605253220e-03 -1 -2 419 + -2.6828479021787643e-03 + + -7.1114671230316162e-01 1.5511700510978699e-01 + -3.5444891452789307e-01 + <_> + + 1 0 420 1.3791749952360988e-03 -1 -2 421 + -3.3968368370551616e-05 + + 3.6916270852088928e-01 5.9150930494070053e-02 + -4.6007719635963440e-01 + <_> + + 1 0 422 5.8259358629584312e-03 -1 -2 423 + -8.1688696518540382e-03 + + -5.4986697435379028e-01 -5.0567412376403809e-01 + 1.5189670026302338e-01 + <_> + + 0 1 424 -2.3251199163496494e-03 -1 -2 425 + -4.8669208772480488e-03 + + 3.4904810786247253e-01 5.3138560056686401e-01 + -2.1413469314575195e-01 + <_> + + 1 0 426 4.3380381539463997e-03 -1 -2 427 + 3.4176679328083992e-03 + + -7.8248262405395508e-01 1.2460789829492569e-01 + -5.5297750234603882e-01 + <_> + + 1 0 428 5.5309730768203735e-01 -1 -2 429 + 2.3636389523744583e-03 + + 4.6573078632354736e-01 -3.3309051394462585e-01 + 9.4380050897598267e-02 + <_> + 26 + -1.9697020053863525e+00 + + <_> + + 1 0 430 -2.2934280335903168e-02 -1 -2 431 + -4.2665850371122360e-02 + + -4.4716298580169678e-01 5.4085898399353027e-01 + -3.3589279651641846e-01 + <_> + + 0 1 432 -9.8418388515710831e-03 -1 -2 433 + -1.1932349763810635e-02 + + 3.9958000183105469e-01 3.4219118952751160e-01 + -4.2416951060295105e-01 + <_> + + 1 0 434 -2.4437010288238525e-02 -1 -2 435 + -4.9987169913947582e-03 + + -3.7337359786033630e-01 4.0358328819274902e-01 + -3.5199370980262756e-01 + <_> + + 0 1 436 1.8582950579002500e-03 -1 -2 437 + 2.7540219016373158e-03 + + -4.4158118963241577e-01 -2.8722938895225525e-01 + 3.3857241272926331e-01 + <_> + + 1 0 438 -3.4452530089765787e-03 -1 -2 439 + -5.9277489781379700e-03 + + -3.1821981072425842e-01 -6.5073519945144653e-01 + 2.7109220623970032e-01 + <_> + + 1 0 440 -1.2391789641696960e-04 -1 -2 441 + -7.3327139019966125e-02 + + -3.3467200398445129e-01 -5.9646248817443848e-01 + 2.2861810028553009e-01 + <_> + + 1 0 442 -8.3964750170707703e-02 -1 -2 443 + -8.1644707825034857e-04 + + -2.2525189816951752e-01 3.8213649392127991e-01 + -3.3410450816154480e-01 + <_> + + 0 1 444 -1.5207779593765736e-02 -1 -2 445 + 4.6894788742065430e-02 + + 3.0742698907852173e-01 -3.8833889365196228e-01 + 2.3177519440650940e-01 + <_> + + 0 1 446 -1.0398440062999725e-01 -1 -2 447 + 3.9815339259803295e-03 + + 7.1321141719818115e-01 -2.3310199379920959e-01 + 2.9247841238975525e-01 + <_> + + 1 0 448 2.5737080723047256e-03 -1 -2 449 + 9.1035291552543640e-04 + + -5.5017340183258057e-01 -1.8228930234909058e-01 + 2.8370320796966553e-01 + <_> + + 1 0 450 6.4211348071694374e-03 -1 -2 451 + -5.8243819512426853e-03 + + -4.8581978678703308e-01 2.4608190357685089e-01 + -2.1565020084381104e-01 + <_> + + 0 1 452 -4.0043629705905914e-02 -1 -2 453 + 8.4683427121490240e-04 + + -6.3880550861358643e-01 -6.0435589402914047e-02 + 4.3711128830909729e-01 + <_> + + 1 0 454 1.2964580208063126e-02 -1 -2 455 + -2.2524749510921538e-04 + + 5.9495061635971069e-01 8.6831472814083099e-02 + -3.6362320184707642e-01 + <_> + + 0 1 456 -1.7258729785680771e-03 -1 -2 457 + -7.2289421223104000e-03 + + -6.4707720279693604e-01 -6.8775367736816406e-01 + 1.3838720321655273e-01 + <_> + + 1 0 458 2.5079259648919106e-03 -1 -2 459 + -1.9473560387268662e-03 + + 3.0659309029579163e-01 2.2967760264873505e-01 + -3.4737649559974670e-01 + <_> + + 1 0 460 7.4747111648321152e-03 -1 -2 461 + 1.0328400094294921e-04 + + -6.5191787481307983e-01 -2.0725889503955841e-01 + 2.2402130067348480e-01 + <_> + + 0 1 462 -7.8996885567903519e-03 -1 -2 463 + 4.2833909392356873e-03 + + -7.2479170560836792e-01 1.3954970240592957e-01 + -4.3086060881614685e-01 + <_> + + 1 0 464 6.3452741596847773e-04 -1 -2 465 + -5.4966621100902557e-03 + + 2.9792639613151550e-01 -5.6205391883850098e-01 + -2.9608119279146194e-02 + <_> + + 1 0 466 3.1408690847456455e-03 -1 -2 467 + -5.0443639047443867e-03 + + -6.1322140693664551e-01 -5.3060102462768555e-01 + 1.2507459521293640e-01 + <_> + + 1 0 468 4.5964870601892471e-02 -1 -2 469 + -5.3749699145555496e-03 + + 3.8188719749450684e-01 1.4089010655879974e-01 + -3.5535690188407898e-01 + <_> + + 1 0 470 2.9262059833854437e-03 -1 -2 471 + 5.2230368601158261e-04 + + -6.0886657238006592e-01 -7.1441568434238434e-02 + 3.6275258660316467e-01 + <_> + + 0 1 472 -4.4181118719279766e-03 -1 -2 473 + 4.3349149636924267e-03 + + -7.6458007097244263e-01 1.1246410012245178e-01 + -5.4553848505020142e-01 + <_> + + 1 0 474 2.6483018882572651e-03 -1 -2 475 + -1.0814110282808542e-03 + + 2.3542310297489166e-01 1.4422300457954407e-01 + -3.4401959180831909e-01 + <_> + + 1 0 476 -5.4296739108394831e-05 -1 -2 477 + 5.5393581278622150e-03 + + -2.8607460856437683e-01 1.9345289468765259e-01 + -5.0549429655075073e-01 + <_> + + 1 0 478 3.3703099936246872e-02 -1 -2 479 + -1.2178930046502501e-04 + + 3.8302558660507202e-01 6.6414177417755127e-02 + -4.8530051112174988e-01 + <_> + + 0 1 480 -1.7803770024329424e-03 -1 -2 481 + -5.6019638577708974e-05 + + 4.4113549590110779e-01 1.2396749854087830e-01 + -2.6292270421981812e-01 + <_> + 30 + -2.0330519676208496e+00 + + <_> + + 1 0 482 3.1982790678739548e-03 -1 -2 483 + -1.5240450156852603e-03 + + 5.4208421707153320e-01 8.2784838974475861e-02 + -5.0164830684661865e-01 + <_> + + 0 1 484 -1.2284429743885994e-02 -1 -2 485 + -8.3555448800325394e-03 + + 4.4174939393997192e-01 3.5863399505615234e-01 + -3.6254858970642090e-01 + <_> + + 1 0 486 4.1357800364494324e-02 -1 -2 487 + 2.2308749612420797e-03 + + 4.7858810424804688e-01 -6.0390347242355347e-01 + -8.7199418339878321e-04 + <_> + + 1 0 488 -5.4160541296005249e-01 -1 -2 489 + 7.9009458422660828e-03 + + -3.2536658644676208e-01 -3.6415100097656250e-01 + 4.0501600503921509e-01 + <_> + + 1 0 490 -2.7236728928983212e-03 -1 -2 491 + 2.1041880827397108e-03 + + -2.7644181251525879e-01 3.4068119525909424e-01 + -4.1922488808631897e-01 + <_> + + 1 0 492 1.2688159476965666e-03 -1 -2 493 + -4.2881062254309654e-03 + + -5.4520767927169800e-01 3.0060088634490967e-01 + -1.5233190357685089e-01 + <_> + + 1 0 494 -4.8890449106693268e-03 -1 -2 495 + 5.0922110676765442e-03 + + -3.7665820121765137e-01 2.1803319454193115e-01 + -5.7126522064208984e-01 + <_> + + 0 1 496 -7.0944731123745441e-03 -1 -2 497 + 2.5431890040636063e-02 + + 5.1921921968460083e-01 -2.1260249614715576e-01 + 3.0566200613975525e-01 + <_> + + 1 0 498 -6.7461907747201622e-05 -1 -2 499 + -8.5350889712572098e-03 + + -3.3406749367713928e-01 3.5043460130691528e-01 + -9.0384833514690399e-02 + <_> + + 0 1 500 -4.1117807850241661e-03 -1 -2 501 + 6.3964081928133965e-03 + + -6.9683700799942017e-01 1.1542639881372452e-01 + -6.6645371913909912e-01 + <_> + + 1 0 502 9.8322751000523567e-04 -1 -2 503 + -5.5737968068569899e-04 + + 3.5695379972457886e-01 2.3081110417842865e-01 + -2.8862631320953369e-01 + <_> + + 1 0 504 2.8798289131373167e-03 -1 -2 505 + -7.7164517715573311e-03 + + -5.9923267364501953e-01 3.6074900627136230e-01 + -8.1827618181705475e-02 + <_> + + 0 1 506 3.7285129074007273e-03 -1 -2 507 + -1.3161109760403633e-02 + + -3.7732011079788208e-01 6.7023038864135742e-01 + 1.5114549547433853e-02 + <_> + + 1 0 508 -3.8966130465269089e-02 -1 -2 509 + -5.7413699105381966e-03 + + -3.1252211332321167e-01 3.3947479724884033e-01 + -1.6011409461498260e-01 + <_> + + 1 0 510 1.2538330256938934e-01 -1 -2 511 + -9.7243122756481171e-02 + + 7.3721152544021606e-01 5.0288981199264526e-01 + -1.3284370303153992e-01 + <_> + + 0 1 512 -2.0128490868955851e-03 -1 -2 513 + 3.5349070094525814e-03 + + 4.1367891430854797e-01 -1.5923270583152771e-01 + 4.4056579470634460e-01 + <_> + + 1 0 514 4.4846540689468384e-01 -1 -2 515 + -1.0387780144810677e-02 + + 5.9423661231994629e-01 3.0399119853973389e-01 + -1.8287350237369537e-01 + <_> + + 0 1 516 -1.4210389927029610e-03 -1 -2 517 + 3.6446070298552513e-03 + + -4.5361068844795227e-01 1.5766820311546326e-01 + -6.2608838081359863e-01 + <_> + + 1 0 518 3.2253630924969912e-03 -1 -2 519 + 9.8893349058926105e-04 + + -4.1410240530967712e-01 -1.0757800191640854e-01 + 3.1156888604164124e-01 + <_> + + 0 1 520 -2.7107829228043556e-03 -1 -2 521 + -6.9264871999621391e-03 + + -7.5352817773818970e-01 2.7464428544044495e-01 + -1.1728949844837189e-01 + <_> + + 0 1 522 -3.7942770868539810e-02 -1 -2 523 + 1.3486459851264954e-02 + + 2.6936548948287964e-01 -3.1532868742942810e-01 + 2.5785440206527710e-01 + <_> + + 1 0 524 2.7866458985954523e-03 -1 -2 525 + 3.2895719632506371e-03 + + -6.8431657552719116e-01 1.2949100136756897e-01 + -4.4475141167640686e-01 + <_> + + 1 0 526 1.7910100286826491e-03 -1 -2 527 + 3.3694170415401459e-03 + + -5.6237429380416870e-01 -6.1936769634485245e-02 + 3.6794289946556091e-01 + <_> + + 0 1 528 6.5897632157430053e-04 -1 -2 529 + -3.2603838917566463e-05 + + -2.7705720067024231e-01 2.7426779270172119e-01 + -2.2369539737701416e-01 + <_> + + 0 1 530 -6.0175720602273941e-02 -1 -2 531 + -2.1217610687017441e-02 + + -7.4174910783767700e-01 -4.5034751296043396e-01 + 1.1426000297069550e-01 + <_> + + 1 0 532 -2.2632910404354334e-03 -1 -2 533 + 6.0313078574836254e-03 + + -3.0538588762283325e-01 2.0562660694122314e-01 + -4.0689799189567566e-01 + <_> + + 1 0 534 5.7578482665121555e-04 -1 -2 535 + -9.3677162658423185e-04 + + 3.5098749399185181e-01 2.1616159379482269e-01 + -2.4415770173072815e-01 + <_> + + 0 1 536 -3.7626568228006363e-02 -1 -2 537 + 4.4729812070727348e-03 + + -5.9113681316375732e-01 1.5792270004749298e-01 + -3.2226279377937317e-01 + <_> + + 0 1 538 -7.1853301487863064e-03 -1 -2 539 + 4.0520228445529938e-02 + + -5.9519052505493164e-01 -6.6688463091850281e-02 + 3.4030249714851379e-01 + <_> + + 0 1 540 -6.1968388035893440e-03 -1 -2 541 + 1.0311529971659184e-02 + + -6.7287462949752808e-01 1.0683239996433258e-01 + -5.4825967550277710e-01 + <_> + 33 + -1.9516259431838989e+00 + + <_> + + 1 0 542 -1.9320519641041756e-02 -1 -2 543 + -1.5126460231840611e-02 + + -3.8712570071220398e-01 6.4468181133270264e-01 + -1.2727110087871552e-01 + <_> + + 1 0 544 -6.0182690620422363e-02 -1 -2 545 + -1.3576049823313951e-03 + + -3.0819109082221985e-01 4.8021888732910156e-01 + -3.3428680896759033e-01 + <_> + + 1 0 546 -5.6930771097540855e-03 -1 -2 547 + -8.0942036584019661e-03 + + -3.3166080713272095e-01 4.7517481446266174e-01 + -7.4761562049388885e-02 + <_> + + 0 1 548 6.8413332337513566e-04 -1 -2 549 + -1.1520589888095856e-01 + + -3.5741969943046570e-01 2.6105090975761414e-01 + -3.1773808598518372e-01 + <_> + + 0 1 550 -9.1124046593904495e-03 -1 -2 551 + 5.4891068430151790e-05 + + -5.8540707826614380e-01 -2.2981899976730347e-01 + 2.3482909798622131e-01 + <_> + + 0 1 552 -9.5622539520263672e-03 -1 -2 553 + -8.2032606005668640e-03 + + 3.9155280590057373e-01 4.3179950118064880e-01 + -2.3173290491104126e-01 + <_> + + 0 1 554 -4.0035760030150414e-03 -1 -2 555 + 2.5406230706721544e-03 + + -5.8700478076934814e-01 1.7990030348300934e-01 + -4.1681569814682007e-01 + <_> + + 1 0 556 1.9435470458120108e-03 -1 -2 557 + 8.4362342022359371e-04 + + 3.0340009927749634e-01 -3.0661040544509888e-01 + 2.3646999895572662e-01 + <_> + + 0 1 558 -5.3103519603610039e-03 -1 -2 559 + -3.5526719875633717e-03 + + -5.6304818391799927e-01 -5.5695772171020508e-01 + 1.5022790431976318e-01 + <_> + + 1 0 560 7.1414401754736900e-03 -1 -2 561 + -1.1435860069468617e-03 + + -6.7626637220382690e-01 3.7873879075050354e-01 + -7.4442893266677856e-02 + <_> + + 0 1 562 -3.1177429482340813e-03 -1 -2 563 + -7.7415622770786285e-02 + + -6.2568587064743042e-01 3.9839410781860352e-01 + -5.5262319743633270e-02 + <_> + + 0 1 564 -3.9252988994121552e-02 -1 -2 565 + 2.2049970924854279e-02 + + 3.4094831347465515e-01 -2.4413719773292542e-01 + 4.3050870299339294e-01 + <_> + + 0 1 566 -2.2205871064215899e-03 -1 -2 567 + 2.8649640735238791e-03 + + 2.8309720754623413e-01 -3.5401880741119385e-01 + 2.1054570376873016e-01 + <_> + + 0 1 568 5.8806730521610007e-05 -1 -2 569 + -6.6595021635293961e-03 + + -2.7014040946960449e-01 -5.9313482046127319e-01 + 2.1892869472503662e-01 + <_> + + 0 1 570 1.6931600868701935e-02 -1 -2 571 + 4.7026639804244041e-03 + + -1.1279620230197906e-01 4.9212211370468140e-01 + -3.9702880382537842e-01 + <_> + + 0 1 572 1.7478819936513901e-03 -1 -2 573 + -2.0893230102956295e-03 + + -2.2339369356632233e-01 -4.3157818913459778e-01 + 2.5373139977455139e-01 + <_> + + 1 0 574 1.1534850113093853e-02 -1 -2 575 + 8.7350117973983288e-04 + + -7.0668542385101318e-01 -7.2509132325649261e-02 + 3.9975029230117798e-01 + <_> + + 1 0 576 -7.2836421895772219e-04 -1 -2 577 + 1.2666890397667885e-03 + + -2.3567649722099304e-01 2.2582389414310455e-01 + -4.2317348718643188e-01 + <_> + + 1 0 578 -8.4794021677225828e-04 -1 -2 579 + 3.6212441325187683e-01 + + -2.8307029604911804e-01 1.6724239289760590e-01 + -7.6826947927474976e-01 + <_> + + 1 0 580 -1.9437649752944708e-03 -1 -2 581 + -4.1159680113196373e-03 + + -2.7229419350624084e-01 -6.4211308956146240e-01 + 1.8810230493545532e-01 + <_> + + 1 0 582 2.3254039697349072e-03 -1 -2 583 + -1.4815620379522443e-03 + + 2.8516888618469238e-01 4.2574208974838257e-01 + -2.1113610267639160e-01 + <_> + + 1 0 584 -6.6233296820428222e-05 -1 -2 585 + -3.3756431192159653e-02 + + -2.8205850720405579e-01 -8.1803041696548462e-01 + 1.7053669691085815e-01 + <_> + + 0 1 586 -9.4350927975028753e-04 -1 -2 587 + 1.0650219628587365e-03 + + 1.5273140370845795e-01 -4.2650490999221802e-01 + 1.5235939621925354e-01 + <_> + + 0 1 588 -1.2905279872938991e-03 -1 -2 589 + 9.6549028530716896e-03 + + 1.7365390062332153e-01 -3.9721599221229553e-01 + 1.7953179776668549e-01 + <_> + + 1 0 590 1.3434770517051220e-03 -1 -2 591 + 5.5220007197931409e-04 + + -6.9609320163726807e-01 -7.2258770465850830e-02 + 3.4493291378021240e-01 + <_> + + 1 0 592 3.5795350559055805e-03 -1 -2 593 + -1.0585499927401543e-02 + + -4.8070669174194336e-01 -3.2975581288337708e-01 + 1.4686919748783112e-01 + <_> + + 1 0 594 3.5636040847748518e-03 -1 -2 595 + -1.0298290103673935e-01 + + -6.1415022611618042e-01 -7.2366482019424438e-01 + 8.4447070956230164e-02 + <_> + + 0 1 596 -2.9605759307742119e-02 -1 -2 597 + -3.4580599516630173e-02 + + 4.7113609313964844e-01 -4.3128991127014160e-01 + 2.4623470380902290e-02 + <_> + + 1 0 598 4.7923368401825428e-03 -1 -2 599 + 1.7058040248230100e-03 + + -4.6270799636840820e-01 1.4738570153713226e-01 + -3.7818890810012817e-01 + <_> + + 0 1 600 -3.3174119889736176e-03 -1 -2 601 + -1.7022279789671302e-03 + + 2.7929860353469849e-01 2.6326990127563477e-01 + -2.5129210948944092e-01 + <_> + + 1 0 602 -8.1695342669263482e-04 -1 -2 603 + -1.4184829778969288e-03 + + -1.2859649956226349e-01 5.8855402469635010e-01 + -5.0085168331861496e-02 + <_> + + 0 1 604 -1.0478599928319454e-02 -1 -2 605 + 3.1981911510229111e-02 + + 1.4732900261878967e-01 -4.1299548745155334e-01 + 3.4442049264907837e-01 + <_> + + 1 0 606 4.5543849468231201e-02 -1 -2 607 + 2.3574009537696838e-02 + + 4.8842081427574158e-01 -4.6383219957351685e-01 + 3.7443768233060837e-02 + <_> + 29 + -1.7628519535064697e+00 + + <_> + + 1 0 608 -3.2347131520509720e-02 -1 -2 609 + -7.4855431914329529e-02 + + -4.1153168678283691e-01 5.4409480094909668e-01 + -2.1043080091476440e-01 + <_> + + 0 1 610 -5.9164799749851227e-02 -1 -2 611 + -5.0734709948301315e-03 + + 4.6945521235466003e-01 8.0933347344398499e-02 + -4.0436869859695435e-01 + <_> + + 0 1 612 6.6304411739110947e-03 -1 -2 613 + 2.2804280743002892e-02 + + -3.1943950057029724e-01 -3.5277611017227173e-01 + 3.6358159780502319e-01 + <_> + + 1 0 614 3.4148059785366058e-03 -1 -2 615 + -6.0696629807353020e-03 + + -4.2139899730682373e-01 2.8190940618515015e-01 + -2.5727981328964233e-01 + <_> + + 1 0 616 -3.3271780703216791e-03 -1 -2 617 + 1.2381239794194698e-02 + + -3.3380180597305298e-01 2.5831120088696480e-02 + 5.8200639486312866e-01 + <_> + + 0 1 618 -7.8561902046203613e-02 -1 -2 619 + -7.6863910071551800e-03 + + 5.7080817222595215e-01 1.9097380340099335e-01 + -2.4749469757080078e-01 + <_> + + 1 0 620 3.9404830895364285e-03 -1 -2 621 + -7.0624810177832842e-05 + + -3.5295888781547546e-01 2.8438061475753784e-01 + -1.6469420492649078e-01 + <_> + + 0 1 622 -2.2568539716303349e-03 -1 -2 623 + -3.5595949739217758e-03 + + -4.6189218759536743e-01 2.4525940418243408e-01 + -1.8984979391098022e-01 + <_> + + 0 1 624 -3.0113100074231625e-03 -1 -2 625 + -6.2748990021646023e-03 + + 3.0594390630722046e-01 1.4716149866580963e-01 + -3.3265221118927002e-01 + <_> + + 1 0 626 2.5835279375314713e-03 -1 -2 627 + 3.2576550729572773e-03 + + -7.4853891134262085e-01 -1.4949619770050049e-01 + 2.6293671131134033e-01 + <_> + + 1 0 628 -2.6957978843711317e-04 -1 -2 629 + -4.4593680649995804e-03 + + -2.9468360543251038e-01 -4.5905289053916931e-01 + 2.2235380113124847e-01 + <_> + + 1 0 630 2.2841650061309338e-03 -1 -2 631 + -6.7595718428492546e-04 + + -6.3815939426422119e-01 -3.1756940484046936e-01 + 1.4903070032596588e-01 + <_> + + 1 0 632 6.1428439803421497e-03 -1 -2 633 + 2.7392068877816200e-03 + + 2.4187029898166656e-01 -3.1487539410591125e-01 + 2.3589129745960236e-01 + <_> + + 0 1 634 -2.0209311041980982e-03 -1 -2 635 + 2.6892140507698059e-02 + + 2.5389561057090759e-01 -3.4391039609909058e-01 + 2.3010760545730591e-01 + <_> + + 1 0 636 1.4671060256659985e-02 -1 -2 637 + -1.2444119900465012e-02 + + 5.9517538547515869e-01 3.7335929274559021e-01 + -1.4540639519691467e-01 + <_> + + 0 1 638 2.0527220331132412e-03 -1 -2 639 + -1.7088990658521652e-02 + + -2.1135020256042480e-01 -7.2516232728958130e-01 + 2.3358739912509918e-01 + <_> + + 0 1 640 -9.8585523664951324e-03 -1 -2 641 + -1.0541190393269062e-02 + + 4.5390421152114868e-01 3.5500058531761169e-01 + -1.7118500173091888e-01 + <_> + + 1 0 642 4.0034228004515171e-03 -1 -2 643 + -1.1889140121638775e-02 + + -7.0433962345123291e-01 4.0436559915542603e-01 + -4.6263620257377625e-02 + <_> + + 0 1 644 -2.0685700699687004e-02 -1 -2 645 + -7.9243928194046021e-03 + + -6.4347600936889648e-01 -5.3632920980453491e-01 + 1.1002989858388901e-01 + <_> + + 1 0 646 1.2431150535121560e-03 -1 -2 647 + -4.2312019504606724e-03 + + 4.1220021247863770e-01 7.9887658357620239e-02 + -3.0926740169525146e-01 + <_> + + 1 0 648 9.8197339102625847e-03 -1 -2 649 + 4.5455411076545715e-02 + + -6.0976761579513550e-01 1.0621140152215958e-01 + -6.4687371253967285e-01 + <_> + + 1 0 650 2.6892758905887604e-03 -1 -2 651 + -1.5172710409387946e-03 + + -4.9122989177703857e-01 1.7578749358654022e-01 + -2.6818940043449402e-01 + <_> + + 1 0 652 6.2014168361201882e-04 -1 -2 653 + -2.0233519899193197e-04 + + 2.5500729680061340e-01 7.2745857760310173e-03 + -5.0815272331237793e-01 + <_> + + 1 0 654 3.1760020647197962e-03 -1 -2 655 + -1.2668699491769075e-03 + + 4.3849268555641174e-01 1.6349400579929352e-01 + -2.9128161072731018e-01 + <_> + + 1 0 656 5.1056100055575371e-03 -1 -2 657 + -1.5026510227471590e-03 + + -7.5001358985900879e-01 2.7198830246925354e-01 + -9.9486798048019409e-02 + <_> + + 0 1 658 -3.6238620523363352e-03 -1 -2 659 + 7.6577658765017986e-03 + + -6.0396248102188110e-01 1.0938379913568497e-01 + -5.3007638454437256e-01 + <_> + + 0 1 660 -3.1830249354243279e-03 -1 -2 661 + 1.0931329801678658e-02 + + -4.7724890708923340e-01 -4.3065819889307022e-02 + 3.8945859670639038e-01 + <_> + + 0 1 662 -1.0047679534181952e-03 -1 -2 663 + -4.6660430729389191e-02 + + 4.1553598642349243e-01 3.0159878730773926e-01 + -1.6184380650520325e-01 + <_> + + 1 0 664 3.2002381049096584e-03 -1 -2 665 + -1.7367519903928041e-03 + + -5.4621779918670654e-01 -2.1987779438495636e-01 + 1.9606420397758484e-01 + <_> + 33 + -1.8088439702987671e+00 + + <_> + + 0 1 666 1.7160519957542419e-02 -1 -2 667 + 1.4503560028970242e-02 + + -3.2273009419441223e-01 -3.9438620209693909e-01 + 5.7922977209091187e-01 + <_> + + 1 0 668 -9.0323518961668015e-03 -1 -2 669 + -6.9836131297051907e-03 + + -4.1536870598793030e-01 3.5515859723091125e-01 + -3.8177150487899780e-01 + <_> + + 0 1 670 -1.9220909103751183e-02 -1 -2 671 + -4.0087159723043442e-02 + + 4.5315900444984436e-01 1.7228379845619202e-01 + -3.1110560894012451e-01 + <_> + + 0 1 672 5.6549701839685440e-03 -1 -2 673 + -1.1611269786953926e-02 + + -4.0461608767509460e-01 2.9034239053726196e-01 + -2.2078509628772736e-01 + <_> + + 0 1 674 -1.0576159693300724e-03 -1 -2 675 + -1.3360800221562386e-03 + + 3.5851669311523438e-01 1.5968900173902512e-02 + -4.1990101337432861e-01 + <_> + + 1 0 676 5.2302791737020016e-03 -1 -2 677 + -2.7848479803651571e-03 + + -4.9663281440734863e-01 -5.2960211038589478e-01 + 1.5535449981689453e-01 + <_> + + 0 1 678 -2.5654129683971405e-02 -1 -2 679 + -6.8942131474614143e-03 + + -5.9309178590774536e-01 2.4318109452724457e-01 + -1.8231940269470215e-01 + <_> + + 1 0 680 -6.9622750743292272e-05 -1 -2 681 + -6.4154611900448799e-03 + + -3.2716289162635803e-01 -5.0821667909622192e-01 + 1.9543349742889404e-01 + <_> + + 0 1 682 -6.7164386564400047e-05 -1 -2 683 + 2.2416690364480019e-02 + + 1.8602199852466583e-01 -3.9281991124153137e-01 + 1.3279129564762115e-01 + <_> + + 1 0 684 8.4287580102682114e-03 -1 -2 685 + -8.7357551092281938e-04 + + -5.5447560548782349e-01 4.7158730030059814e-01 + -3.8492478430271149e-02 + <_> + + 1 0 686 -4.7496971092186868e-05 -1 -2 687 + 4.5816078782081604e-03 + + -2.5197029113769531e-01 2.0250399410724640e-01 + -6.1638081073760986e-01 + <_> + + 1 0 688 -1.1175150051712990e-02 -1 -2 689 + -7.4238609522581100e-03 + + -2.7771198749542236e-01 -5.0103437900543213e-01 + 1.9318529963493347e-01 + <_> + + 0 1 690 -3.0201480258256197e-03 -1 -2 691 + -3.0343679245561361e-03 + + -6.5904247760772705e-01 3.1962481141090393e-01 + -1.0512910038232803e-01 + <_> + + 0 1 692 -1.0971290059387684e-02 -1 -2 693 + 1.2000739661743864e-04 + + 3.2707008719444275e-01 -4.1679269075393677e-01 + 1.1645200103521347e-01 + <_> + + 1 0 694 2.1552699618041515e-03 -1 -2 695 + 1.5970800304785371e-03 + + 1.5389390289783478e-01 -4.2979270219802856e-01 + 1.9192950427532196e-01 + <_> + + 0 1 696 -4.3590939603745937e-03 -1 -2 697 + -6.5752048976719379e-03 + + -8.6613738536834717e-01 3.5298541188240051e-01 + -7.2624720633029938e-02 + <_> + + 1 0 698 3.5486191045492887e-03 -1 -2 699 + 1.7437560018151999e-03 + + -3.6141040921211243e-01 -4.0250919759273529e-02 + 4.1119590401649475e-01 + <_> + + 1 0 700 6.5892767452169210e-05 -1 -2 701 + 1.2217169627547264e-02 + + 1.5523989498615265e-01 -3.6567229032516479e-01 + 2.5159689784049988e-01 + <_> + + 1 0 702 6.0199309140443802e-02 -1 -2 703 + -9.1684371232986450e-02 + + -6.8959599733352661e-01 -6.6311872005462646e-01 + 9.4827361404895782e-02 + <_> + + 1 0 704 8.9392811059951782e-04 -1 -2 705 + -1.1146500473842025e-03 + + 2.8731009364128113e-01 3.6127060651779175e-01 + -2.4054229259490967e-01 + <_> + + 0 1 706 -1.1042780242860317e-02 -1 -2 707 + 3.7769351154565811e-02 + + -7.1686691045761108e-01 1.1125349998474121e-01 + -5.6320947408676147e-01 + <_> + + 1 0 708 5.5979429744184017e-03 -1 -2 709 + -2.5462140329182148e-03 + + -5.6998908519744873e-01 2.6734578609466553e-01 + -1.0527700185775757e-01 + <_> + + 0 1 710 -1.7929819878190756e-03 -1 -2 711 + -8.9686378487385809e-05 + + 1.7712120711803436e-01 1.6762410104274750e-01 + -4.1336658596992493e-01 + <_> + + 1 0 712 -6.8254990037530661e-04 -1 -2 713 + 4.0599349886178970e-03 + + -3.1327050924301147e-01 2.0312629640102386e-01 + -4.6360948681831360e-01 + <_> + + 1 0 714 1.5843180008232594e-03 -1 -2 715 + -4.6101640909910202e-02 + + 2.6413089036941528e-01 2.4587640166282654e-01 + -3.1151199340820312e-01 + <_> + + 1 0 716 1.5759950038045645e-03 -1 -2 717 + 3.5904631018638611e-02 + + -3.6593970656394958e-01 -1.3352620415389538e-02 + 4.9500739574432373e-01 + <_> + + 1 0 718 1.9230529665946960e-02 -1 -2 719 + 1.3461830094456673e-02 + + 1.8603560328483582e-01 -4.2704311013221741e-01 + 1.4756950736045837e-01 + <_> + + 1 0 720 6.3534970395267010e-03 -1 -2 721 + 4.7998740337789059e-03 + + -5.8824592828750610e-01 1.3966129720211029e-01 + -3.6948320269584656e-01 + <_> + + 0 1 722 -9.7894563805311918e-04 -1 -2 723 + 1.8534340197220445e-03 + + 4.3156591057777405e-01 -1.9053110480308533e-01 + 2.6868799328804016e-01 + <_> + + 1 0 724 5.5962381884455681e-04 -1 -2 725 + -8.1787789240479469e-03 + + -3.0545750260353088e-01 -7.2353351116180420e-01 + 1.6197769343852997e-01 + <_> + + 1 0 726 -6.4591833506710827e-05 -1 -2 727 + -4.2282380163669586e-03 + + -1.6121749579906464e-01 4.2441681027412415e-01 + -1.1488209664821625e-01 + <_> + + 0 1 728 -3.2379399053752422e-03 -1 -2 729 + -4.7763898037374020e-03 + + -8.2811427116394043e-01 3.9157009124755859e-01 + -3.7677429616451263e-02 + <_> + + 0 1 730 -6.1182728968560696e-03 -1 -2 731 + 3.1565790995955467e-03 + + 3.0208829045295715e-01 -1.9045789539813995e-01 + 3.0219689011573792e-01 + + <_> + + <_> + 8 12 3 8 -1. + <_> + 8 16 3 4 2. + <_> + + <_> + 5 11 8 9 -1. + <_> + 7 11 4 9 2. + <_> + + <_> + 8 7 11 12 -1. + <_> + 8 11 11 4 3. + <_> + + <_> + 1 0 7 8 -1. + <_> + 1 4 7 4 2. + <_> + + <_> + 9 7 6 6 -1. + <_> + 7 9 6 2 3. + 1 + <_> + + <_> + 0 0 7 4 -1. + <_> + 0 2 7 2 2. + <_> + + <_> + 16 13 4 4 -1. + <_> + 18 13 2 4 2. + <_> + + <_> + 17 15 2 3 -1. + <_> + 17 15 1 3 2. + 1 + <_> + + <_> + 0 13 6 2 -1. + <_> + 2 13 2 2 3. + <_> + + <_> + 5 0 6 6 -1. + <_> + 7 0 2 6 3. + <_> + + <_> + 5 7 9 12 -1. + <_> + 8 11 3 4 9. + <_> + + <_> + 5 6 4 10 -1. + <_> + 5 6 2 5 2. + <_> + 7 11 2 5 2. + <_> + + <_> + 8 12 11 8 -1. + <_> + 8 16 11 4 2. + <_> + + <_> + 0 0 1 8 -1. + <_> + 0 4 1 4 2. + <_> + + <_> + 0 0 6 6 -1. + <_> + 3 0 3 6 2. + <_> + + <_> + 14 14 6 6 -1. + <_> + 14 17 6 3 2. + <_> + + <_> + 5 13 9 7 -1. + <_> + 8 13 3 7 3. + <_> + + <_> + 6 17 6 3 -1. + <_> + 8 17 2 3 3. + <_> + + <_> + 0 0 4 4 -1. + <_> + 0 2 4 2 2. + <_> + + <_> + 1 0 3 3 -1. + <_> + 2 1 1 1 9. + <_> + + <_> + 3 18 6 2 -1. + <_> + 3 19 6 1 2. + <_> + + <_> + 7 18 4 2 -1. + <_> + 8 18 2 2 2. + <_> + + <_> + 6 10 12 2 -1. + <_> + 6 11 12 1 2. + <_> + + <_> + 15 8 3 1 -1. + <_> + 16 9 1 1 3. + 1 + <_> + + <_> + 5 7 9 12 -1. + <_> + 8 11 3 4 9. + <_> + + <_> + 16 13 1 6 -1. + <_> + 16 16 1 3 2. + <_> + + <_> + 9 7 5 6 -1. + <_> + 7 9 5 2 3. + 1 + <_> + + <_> + 16 12 4 6 -1. + <_> + 18 12 2 6 2. + <_> + + <_> + 0 0 6 8 -1. + <_> + 0 4 6 4 2. + <_> + + <_> + 3 1 15 12 -1. + <_> + 3 5 15 4 3. + <_> + + <_> + 11 12 9 8 -1. + <_> + 11 16 9 4 2. + <_> + + <_> + 0 0 12 9 -1. + <_> + 4 0 4 9 3. + <_> + + <_> + 0 12 6 4 -1. + <_> + 2 12 2 4 3. + <_> + + <_> + 10 18 4 2 -1. + <_> + 11 18 2 2 2. + <_> + + <_> + 5 2 3 3 -1. + <_> + 6 2 1 3 3. + <_> + + <_> + 12 18 3 2 -1. + <_> + 13 18 1 2 3. + <_> + + <_> + 0 0 2 8 -1. + <_> + 1 0 1 8 2. + <_> + + <_> + 5 18 4 2 -1. + <_> + 5 19 4 1 2. + <_> + + <_> + 14 11 6 6 -1. + <_> + 17 11 3 6 2. + <_> + + <_> + 6 12 8 4 -1. + <_> + 8 12 4 4 2. + <_> + + <_> + 12 6 4 9 -1. + <_> + 9 9 4 3 3. + 1 + <_> + + <_> + 11 9 4 7 -1. + <_> + 12 10 2 7 2. + 1 + <_> + + <_> + 5 8 4 8 -1. + <_> + 5 8 2 4 2. + <_> + 7 12 2 4 2. + <_> + + <_> + 8 12 11 8 -1. + <_> + 8 16 11 4 2. + <_> + + <_> + 3 0 14 6 -1. + <_> + 3 3 14 3 2. + <_> + + <_> + 7 1 6 12 -1. + <_> + 7 4 6 6 2. + <_> + + <_> + 0 18 7 2 -1. + <_> + 0 19 7 1 2. + <_> + + <_> + 16 12 4 3 -1. + <_> + 18 12 2 3 2. + <_> + + <_> + 0 0 4 8 -1. + <_> + 2 0 2 8 2. + <_> + + <_> + 3 0 4 1 -1. + <_> + 5 0 2 1 2. + <_> + + <_> + 3 13 2 2 -1. + <_> + 3 13 2 1 2. + 1 + <_> + + <_> + 0 16 19 4 -1. + <_> + 0 18 19 2 2. + <_> + + <_> + 7 13 8 2 -1. + <_> + 11 13 4 2 2. + <_> + + <_> + 8 8 4 1 -1. + <_> + 9 8 2 1 2. + <_> + + <_> + 0 1 1 4 -1. + <_> + 0 3 1 2 2. + <_> + + <_> + 0 0 1 4 -1. + <_> + 0 1 1 2 2. + <_> + + <_> + 15 15 5 2 -1. + <_> + 15 16 5 1 2. + <_> + + <_> + 7 18 3 2 -1. + <_> + 8 18 1 2 3. + <_> + + <_> + 13 7 3 8 -1. + <_> + 11 9 3 4 2. + 1 + <_> + + <_> + 15 12 2 8 -1. + <_> + 15 16 2 4 2. + <_> + + <_> + 2 0 10 6 -1. + <_> + 2 3 10 3 2. + <_> + + <_> + 0 5 18 15 -1. + <_> + 6 10 6 5 9. + <_> + + <_> + 3 11 12 6 -1. + <_> + 7 13 4 2 9. + <_> + + <_> + 16 12 4 7 -1. + <_> + 18 12 2 7 2. + <_> + + <_> + 8 18 4 2 -1. + <_> + 9 18 2 2 2. + <_> + + <_> + 8 17 4 3 -1. + <_> + 9 17 2 3 2. + <_> + + <_> + 0 12 6 6 -1. + <_> + 2 12 2 6 3. + <_> + + <_> + 4 16 4 4 -1. + <_> + 5 16 2 4 2. + <_> + + <_> + 3 0 4 6 -1. + <_> + 4 0 2 6 2. + <_> + + <_> + 1 0 4 7 -1. + <_> + 2 0 2 7 2. + <_> + + <_> + 2 0 8 3 -1. + <_> + 6 0 4 3 2. + <_> + + <_> + 8 3 4 6 -1. + <_> + 9 3 2 6 2. + <_> + + <_> + 10 10 3 2 -1. + <_> + 10 11 3 1 2. + <_> + + <_> + 4 3 7 6 -1. + <_> + 4 6 7 3 2. + <_> + + <_> + 10 18 10 2 -1. + <_> + 15 18 5 2 2. + <_> + + <_> + 9 13 6 1 -1. + <_> + 9 13 3 1 2. + 1 + <_> + + <_> + 10 8 4 6 -1. + <_> + 8 10 4 2 3. + 1 + <_> + + <_> + 14 12 6 8 -1. + <_> + 14 16 6 4 2. + <_> + + <_> + 10 8 6 4 -1. + <_> + 12 10 2 4 3. + 1 + <_> + + <_> + 0 12 6 3 -1. + <_> + 2 12 2 3 3. + <_> + + <_> + 18 11 2 6 -1. + <_> + 19 11 1 6 2. + <_> + + <_> + 0 0 1 10 -1. + <_> + 0 5 1 5 2. + <_> + + <_> + 5 4 8 12 -1. + <_> + 7 4 4 12 2. + <_> + + <_> + 1 3 9 8 -1. + <_> + 4 3 3 8 3. + <_> + + <_> + 0 0 2 2 -1. + <_> + 0 1 2 1 2. + <_> + + <_> + 12 8 6 12 -1. + <_> + 14 12 2 4 9. + <_> + + <_> + 4 2 14 6 -1. + <_> + 4 4 14 2 3. + <_> + + <_> + 3 0 12 8 -1. + <_> + 3 4 12 4 2. + <_> + + <_> + 0 0 17 20 -1. + <_> + 0 5 17 10 2. + <_> + + <_> + 4 0 13 6 -1. + <_> + 4 2 13 2 3. + <_> + + <_> + 2 10 3 6 -1. + <_> + 3 10 1 6 3. + <_> + + <_> + 4 14 6 4 -1. + <_> + 4 14 3 2 2. + <_> + 7 16 3 2 2. + <_> + + <_> + 8 1 6 8 -1. + <_> + 10 1 2 8 3. + <_> + + <_> + 0 1 2 6 -1. + <_> + 1 1 1 6 2. + <_> + + <_> + 8 12 1 3 -1. + <_> + 7 13 1 1 3. + 1 + <_> + + <_> + 5 4 8 4 -1. + <_> + 5 4 8 2 2. + 1 + <_> + + <_> + 0 2 4 5 -1. + <_> + 1 2 2 5 2. + <_> + + <_> + 5 12 3 2 -1. + <_> + 6 12 1 2 3. + <_> + + <_> + 5 13 8 2 -1. + <_> + 7 13 4 2 2. + <_> + + <_> + 11 9 9 8 -1. + <_> + 11 11 9 4 2. + <_> + + <_> + 16 12 4 3 -1. + <_> + 18 12 2 3 2. + <_> + + <_> + 16 14 4 6 -1. + <_> + 16 17 4 3 2. + <_> + + <_> + 0 12 6 3 -1. + <_> + 2 12 2 3 3. + <_> + + <_> + 8 6 7 6 -1. + <_> + 6 8 7 2 3. + 1 + <_> + + <_> + 0 0 1 6 -1. + <_> + 0 3 1 3 2. + <_> + + <_> + 0 2 15 5 -1. + <_> + 5 2 5 5 3. + <_> + + <_> + 8 11 10 3 -1. + <_> + 13 11 5 3 2. + <_> + + <_> + 8 11 2 8 -1. + <_> + 8 15 2 4 2. + <_> + + <_> + 0 1 2 6 -1. + <_> + 1 1 1 6 2. + <_> + + <_> + 0 1 4 4 -1. + <_> + 1 1 2 4 2. + <_> + + <_> + 5 16 3 1 -1. + <_> + 6 17 1 1 3. + 1 + <_> + + <_> + 5 0 7 15 -1. + <_> + 5 5 7 5 3. + <_> + + <_> + 17 0 3 2 -1. + <_> + 18 1 1 2 3. + 1 + <_> + + <_> + 4 18 6 2 -1. + <_> + 6 18 2 2 3. + <_> + + <_> + 7 1 4 5 -1. + <_> + 7 1 2 5 2. + 1 + <_> + + <_> + 14 0 6 8 -1. + <_> + 14 0 3 4 2. + <_> + 17 4 3 4 2. + <_> + + <_> + 5 2 4 18 -1. + <_> + 5 2 2 9 2. + <_> + 7 11 2 9 2. + <_> + + <_> + 7 18 6 2 -1. + <_> + 9 18 2 2 3. + <_> + + <_> + 10 8 2 3 -1. + <_> + 10 9 2 1 3. + <_> + + <_> + 10 10 4 2 -1. + <_> + 10 10 2 1 2. + <_> + 12 11 2 1 2. + <_> + + <_> + 4 2 12 6 -1. + <_> + 4 4 12 2 3. + <_> + + <_> + 5 1 12 8 -1. + <_> + 5 3 12 4 2. + <_> + + <_> + 2 18 4 2 -1. + <_> + 2 19 4 1 2. + <_> + + <_> + 0 18 8 1 -1. + <_> + 4 18 4 1 2. + <_> + + <_> + 4 7 12 12 -1. + <_> + 8 11 4 4 9. + <_> + + <_> + 16 11 4 6 -1. + <_> + 18 11 2 6 2. + <_> + + <_> + 6 13 6 7 -1. + <_> + 8 13 2 7 3. + <_> + + <_> + 0 0 1 8 -1. + <_> + 0 4 1 4 2. + <_> + + <_> + 15 14 5 6 -1. + <_> + 15 17 5 3 2. + <_> + + <_> + 0 7 6 9 -1. + <_> + 2 7 2 9 3. + <_> + + <_> + 15 11 4 1 -1. + <_> + 16 12 2 1 2. + 1 + <_> + + <_> + 11 11 8 2 -1. + <_> + 15 11 4 2 2. + <_> + + <_> + 0 1 12 11 -1. + <_> + 3 1 6 11 2. + <_> + + <_> + 8 8 6 4 -1. + <_> + 7 9 6 2 2. + 1 + <_> + + <_> + 6 17 6 3 -1. + <_> + 8 17 2 3 3. + <_> + + <_> + 0 0 1 4 -1. + <_> + 0 2 1 2 2. + <_> + + <_> + 3 1 1 3 -1. + <_> + 2 2 1 1 3. + 1 + <_> + + <_> + 18 11 2 3 -1. + <_> + 18 12 2 1 3. + <_> + + <_> + 3 12 2 8 -1. + <_> + 3 12 1 4 2. + <_> + 4 16 1 4 2. + <_> + + <_> + 3 12 3 3 -1. + <_> + 4 12 1 3 3. + <_> + + <_> + 11 18 4 2 -1. + <_> + 12 18 2 2 2. + <_> + + <_> + 17 10 3 3 -1. + <_> + 17 11 3 1 3. + <_> + + <_> + 7 14 5 2 -1. + <_> + 7 15 5 1 2. + <_> + + <_> + 6 0 4 5 -1. + <_> + 6 0 2 5 2. + 1 + <_> + + <_> + 6 1 5 8 -1. + <_> + 6 5 5 4 2. + <_> + + <_> + 3 1 9 8 -1. + <_> + 3 5 9 4 2. + <_> + + <_> + 2 14 15 6 -1. + <_> + 7 14 5 6 3. + <_> + + <_> + 12 3 6 5 -1. + <_> + 14 3 2 5 3. + <_> + + <_> + 5 16 2 2 -1. + <_> + 5 16 1 2 2. + 1 + <_> + + <_> + 5 16 2 2 -1. + <_> + 5 16 1 2 2. + 1 + <_> + + <_> + 9 8 6 4 -1. + <_> + 11 10 2 4 3. + 1 + <_> + + <_> + 4 11 3 4 -1. + <_> + 4 13 3 2 2. + <_> + + <_> + 13 8 6 12 -1. + <_> + 15 12 2 4 9. + <_> + + <_> + 0 0 1 10 -1. + <_> + 0 5 1 5 2. + <_> + + <_> + 0 12 6 4 -1. + <_> + 2 12 2 4 3. + <_> + + <_> + 7 5 8 6 -1. + <_> + 5 7 8 2 3. + 1 + <_> + + <_> + 3 1 16 4 -1. + <_> + 3 3 16 2 2. + <_> + + <_> + 6 2 10 9 -1. + <_> + 6 5 10 3 3. + <_> + + <_> + 14 10 6 10 -1. + <_> + 17 10 3 10 2. + <_> + + <_> + 5 17 4 3 -1. + <_> + 6 17 2 3 2. + <_> + + <_> + 5 12 3 2 -1. + <_> + 6 12 1 2 3. + <_> + + <_> + 5 12 3 2 -1. + <_> + 6 12 1 2 3. + <_> + + <_> + 0 0 2 9 -1. + <_> + 1 0 1 9 2. + <_> + + <_> + 2 6 3 2 -1. + <_> + 2 6 3 1 2. + 1 + <_> + + <_> + 7 16 6 3 -1. + <_> + 9 16 2 3 3. + <_> + + <_> + 7 17 6 2 -1. + <_> + 9 17 2 2 3. + <_> + + <_> + 6 3 9 6 -1. + <_> + 4 5 9 2 3. + 1 + <_> + + <_> + 6 15 3 2 -1. + <_> + 7 16 1 2 3. + 1 + <_> + + <_> + 6 2 3 3 -1. + <_> + 7 2 1 3 3. + <_> + + <_> + 2 1 6 4 -1. + <_> + 4 1 2 4 3. + <_> + + <_> + 13 11 4 2 -1. + <_> + 13 11 2 1 2. + <_> + 15 12 2 1 2. + <_> + + <_> + 14 10 2 2 -1. + <_> + 14 10 1 1 2. + <_> + 15 11 1 1 2. + <_> + + <_> + 17 7 3 3 -1. + <_> + 18 8 1 3 3. + 1 + <_> + + <_> + 17 7 3 2 -1. + <_> + 18 8 1 2 3. + 1 + <_> + + <_> + 0 3 1 2 -1. + <_> + 0 4 1 1 2. + <_> + + <_> + 10 1 2 5 -1. + <_> + 11 1 1 5 2. + <_> + + <_> + 1 8 3 12 -1. + <_> + 1 11 3 6 2. + <_> + + <_> + 2 10 8 2 -1. + <_> + 2 10 4 2 2. + 1 + <_> + + <_> + 6 12 3 3 -1. + <_> + 7 13 1 1 9. + <_> + + <_> + 6 11 3 4 -1. + <_> + 7 11 1 4 3. + <_> + + <_> + 5 17 4 2 -1. + <_> + 6 17 2 2 2. + <_> + + <_> + 0 19 20 1 -1. + <_> + 10 19 10 1 2. + <_> + + <_> + 5 11 8 5 -1. + <_> + 7 11 4 5 2. + <_> + + <_> + 10 8 8 9 -1. + <_> + 10 11 8 3 3. + <_> + + <_> + 0 13 6 2 -1. + <_> + 2 13 2 2 3. + <_> + + <_> + 18 14 2 1 -1. + <_> + 18 14 1 1 2. + 1 + <_> + + <_> + 1 2 2 4 -1. + <_> + 2 2 1 4 2. + <_> + + <_> + 5 5 8 5 -1. + <_> + 9 5 4 5 2. + <_> + + <_> + 7 13 5 4 -1. + <_> + 7 15 5 2 2. + <_> + + <_> + 17 18 3 2 -1. + <_> + 17 19 3 1 2. + <_> + + <_> + 0 2 1 2 -1. + <_> + 0 3 1 1 2. + <_> + + <_> + 3 0 1 3 -1. + <_> + 2 1 1 1 3. + 1 + <_> + + <_> + 10 11 3 4 -1. + <_> + 11 11 1 4 3. + <_> + + <_> + 14 11 4 8 -1. + <_> + 16 11 2 8 2. + <_> + + <_> + 2 2 9 6 -1. + <_> + 2 5 9 3 2. + <_> + + <_> + 0 4 17 8 -1. + <_> + 0 6 17 4 2. + <_> + + <_> + 15 17 5 3 -1. + <_> + 15 18 5 1 3. + <_> + + <_> + 2 11 2 8 -1. + <_> + 2 15 2 4 2. + <_> + + <_> + 3 12 3 3 -1. + <_> + 4 12 1 3 3. + <_> + + <_> + 3 12 9 7 -1. + <_> + 6 12 3 7 3. + <_> + + <_> + 13 1 4 7 -1. + <_> + 14 1 2 7 2. + <_> + + <_> + 3 16 2 2 -1. + <_> + 3 16 1 2 2. + 1 + <_> + + <_> + 3 17 2 1 -1. + <_> + 3 17 1 1 2. + 1 + <_> + + <_> + 4 9 6 6 -1. + <_> + 4 9 3 3 2. + <_> + 7 12 3 3 2. + <_> + + <_> + 11 13 3 1 -1. + <_> + 12 13 1 1 3. + <_> + + <_> + 0 0 20 3 -1. + <_> + 5 0 10 3 2. + <_> + + <_> + 0 0 1 2 -1. + <_> + 0 1 1 1 2. + <_> + + <_> + 17 0 3 1 -1. + <_> + 18 1 1 1 3. + 1 + <_> + + <_> + 4 0 8 9 -1. + <_> + 4 3 8 3 3. + <_> + + <_> + 6 0 6 4 -1. + <_> + 6 2 6 2 2. + <_> + + <_> + 18 0 2 1 -1. + <_> + 18 0 1 1 2. + 1 + <_> + + <_> + 14 2 6 1 -1. + <_> + 17 2 3 1 2. + <_> + + <_> + 5 13 8 2 -1. + <_> + 7 13 4 2 2. + <_> + + <_> + 15 12 3 8 -1. + <_> + 15 16 3 4 2. + <_> + + <_> + 5 10 8 3 -1. + <_> + 5 11 8 1 3. + <_> + + <_> + 5 0 11 9 -1. + <_> + 5 3 11 3 3. + <_> + + <_> + 18 14 2 2 -1. + <_> + 19 14 1 2 2. + <_> + + <_> + 1 3 9 8 -1. + <_> + 4 3 3 8 3. + <_> + + <_> + 3 6 2 3 -1. + <_> + 2 7 2 1 3. + 1 + <_> + + <_> + 3 6 2 3 -1. + <_> + 2 7 2 1 3. + 1 + <_> + + <_> + 17 7 1 12 -1. + <_> + 13 11 1 4 3. + 1 + <_> + + <_> + 0 0 1 15 -1. + <_> + 0 5 1 5 3. + <_> + + <_> + 6 9 6 3 -1. + <_> + 6 10 6 1 3. + <_> + + <_> + 3 18 3 2 -1. + <_> + 3 19 3 1 2. + <_> + + <_> + 16 17 4 3 -1. + <_> + 16 18 4 1 3. + <_> + + <_> + 10 17 4 3 -1. + <_> + 11 17 2 3 2. + <_> + + <_> + 13 13 4 3 -1. + <_> + 14 13 2 3 2. + <_> + + <_> + 4 15 3 2 -1. + <_> + 5 16 1 2 3. + 1 + <_> + + <_> + 0 4 2 2 -1. + <_> + 1 4 1 2 2. + <_> + + <_> + 4 0 2 5 -1. + <_> + 5 0 1 5 2. + <_> + + <_> + 1 9 3 8 -1. + <_> + 1 11 3 4 2. + <_> + + <_> + 5 8 1 3 -1. + <_> + 4 9 1 1 3. + 1 + <_> + + <_> + 4 13 2 1 -1. + <_> + 5 13 1 1 2. + <_> + + <_> + 9 11 4 9 -1. + <_> + 11 11 2 9 2. + <_> + + <_> + 0 1 1 2 -1. + <_> + 0 2 1 1 2. + <_> + + <_> + 0 0 1 3 -1. + <_> + 0 1 1 1 3. + <_> + + <_> + 12 11 1 4 -1. + <_> + 12 12 1 2 2. + <_> + + <_> + 16 10 3 3 -1. + <_> + 15 11 3 1 3. + 1 + <_> + + <_> + 18 12 1 6 -1. + <_> + 18 12 1 3 2. + 1 + <_> + + <_> + 4 17 3 2 -1. + <_> + 5 17 1 2 3. + <_> + + <_> + 17 7 3 2 -1. + <_> + 18 8 1 2 3. + 1 + <_> + + <_> + 18 9 2 1 -1. + <_> + 18 9 1 1 2. + 1 + <_> + + <_> + 8 11 4 5 -1. + <_> + 9 12 2 5 2. + 1 + <_> + + <_> + 7 1 2 7 -1. + <_> + 8 1 1 7 2. + <_> + + <_> + 4 4 14 6 -1. + <_> + 4 6 14 2 3. + <_> + + <_> + 2 2 11 6 -1. + <_> + 2 5 11 3 2. + <_> + + <_> + 18 16 2 2 -1. + <_> + 18 17 2 1 2. + <_> + + <_> + 17 11 2 6 -1. + <_> + 18 11 1 6 2. + <_> + + <_> + 17 0 3 3 -1. + <_> + 18 1 1 3 3. + 1 + <_> + + <_> + 18 0 2 6 -1. + <_> + 18 3 2 3 2. + <_> + + <_> + 4 7 6 8 -1. + <_> + 4 7 3 4 2. + <_> + 7 11 3 4 2. + <_> + + <_> + 11 11 4 2 -1. + <_> + 11 11 2 2 2. + 1 + <_> + + <_> + 0 0 6 7 -1. + <_> + 3 0 3 7 2. + <_> + + <_> + 15 10 5 8 -1. + <_> + 15 12 5 4 2. + <_> + + <_> + 2 10 3 8 -1. + <_> + 3 10 1 8 3. + <_> + + <_> + 9 7 6 6 -1. + <_> + 7 9 6 2 3. + 1 + <_> + + <_> + 4 1 6 6 -1. + <_> + 4 4 6 3 2. + <_> + + <_> + 4 0 16 2 -1. + <_> + 4 1 16 1 2. + <_> + + <_> + 14 8 6 6 -1. + <_> + 14 8 3 3 2. + <_> + 17 11 3 3 2. + <_> + + <_> + 4 12 2 8 -1. + <_> + 4 12 1 4 2. + <_> + 5 16 1 4 2. + <_> + + <_> + 0 18 7 2 -1. + <_> + 0 19 7 1 2. + <_> + + <_> + 9 13 1 4 -1. + <_> + 9 15 1 2 2. + <_> + + <_> + 18 10 2 8 -1. + <_> + 19 10 1 8 2. + <_> + + <_> + 6 0 4 8 -1. + <_> + 7 0 2 8 2. + <_> + + <_> + 1 2 6 6 -1. + <_> + 3 2 2 6 3. + <_> + + <_> + 10 10 8 2 -1. + <_> + 10 10 4 1 2. + <_> + 14 11 4 1 2. + <_> + + <_> + 3 9 2 3 -1. + <_> + 2 10 2 1 3. + 1 + <_> + + <_> + 5 1 13 6 -1. + <_> + 5 3 13 2 3. + <_> + + <_> + 4 4 13 6 -1. + <_> + 4 6 13 2 3. + <_> + + <_> + 8 1 4 5 -1. + <_> + 8 1 2 5 2. + 1 + <_> + + <_> + 7 7 2 1 -1. + <_> + 8 7 1 1 2. + <_> + + <_> + 5 5 4 4 -1. + <_> + 6 5 2 4 2. + <_> + + <_> + 14 12 4 2 -1. + <_> + 14 12 2 1 2. + <_> + 16 13 2 1 2. + <_> + + <_> + 13 11 4 2 -1. + <_> + 13 11 2 1 2. + <_> + 15 12 2 1 2. + <_> + + <_> + 16 10 4 3 -1. + <_> + 16 11 4 1 3. + <_> + + <_> + 10 0 4 5 -1. + <_> + 11 0 2 5 2. + <_> + + <_> + 8 11 1 3 -1. + <_> + 7 12 1 1 3. + 1 + <_> + + <_> + 6 12 3 2 -1. + <_> + 7 12 1 2 3. + <_> + + <_> + 17 8 2 3 -1. + <_> + 17 8 1 3 2. + 1 + <_> + + <_> + 11 0 6 5 -1. + <_> + 13 0 2 5 3. + <_> + + <_> + 0 0 3 3 -1. + <_> + 0 1 3 1 3. + <_> + + <_> + 2 0 1 2 -1. + <_> + 2 1 1 1 2. + <_> + + <_> + 13 11 7 2 -1. + <_> + 13 12 7 1 2. + <_> + + <_> + 17 8 3 3 -1. + <_> + 18 9 1 3 3. + 1 + <_> + + <_> + 15 15 1 3 -1. + <_> + 14 16 1 1 3. + 1 + <_> + + <_> + 6 13 6 2 -1. + <_> + 8 13 2 2 3. + <_> + + <_> + 8 10 3 4 -1. + <_> + 9 10 1 4 3. + <_> + + <_> + 7 0 12 19 -1. + <_> + 13 0 6 19 2. + <_> + + <_> + 12 16 8 4 -1. + <_> + 12 18 8 2 2. + <_> + + <_> + 8 5 12 2 -1. + <_> + 14 5 6 2 2. + <_> + + <_> + 10 8 6 4 -1. + <_> + 12 10 2 4 3. + 1 + <_> + + <_> + 4 11 3 4 -1. + <_> + 4 13 3 2 2. + <_> + + <_> + 0 2 12 7 -1. + <_> + 3 2 6 7 2. + <_> + + <_> + 8 0 4 2 -1. + <_> + 8 0 2 2 2. + 1 + <_> + + <_> + 13 11 6 6 -1. + <_> + 15 13 2 2 9. + <_> + + <_> + 7 11 10 4 -1. + <_> + 12 11 5 4 2. + <_> + + <_> + 1 11 4 5 -1. + <_> + 2 11 2 5 2. + <_> + + <_> + 2 14 4 2 -1. + <_> + 3 15 2 2 2. + 1 + <_> + + <_> + 0 0 1 6 -1. + <_> + 0 3 1 3 2. + <_> + + <_> + 6 2 6 6 -1. + <_> + 6 5 6 3 2. + <_> + + <_> + 6 18 4 2 -1. + <_> + 7 18 2 2 2. + <_> + + <_> + 6 18 4 2 -1. + <_> + 7 18 2 2 2. + <_> + + <_> + 4 4 7 4 -1. + <_> + 3 5 7 2 2. + 1 + <_> + + <_> + 5 8 8 12 -1. + <_> + 7 8 4 12 2. + <_> + + <_> + 5 17 2 1 -1. + <_> + 5 17 1 1 2. + 1 + <_> + + <_> + 4 18 2 1 -1. + <_> + 5 18 1 1 2. + <_> + + <_> + 13 16 7 2 -1. + <_> + 13 17 7 1 2. + <_> + + <_> + 7 15 2 3 -1. + <_> + 7 15 1 3 2. + 1 + <_> + + <_> + 9 2 4 5 -1. + <_> + 10 2 2 5 2. + <_> + + <_> + 7 2 4 6 -1. + <_> + 8 2 2 6 2. + <_> + + <_> + 3 12 3 3 -1. + <_> + 4 12 1 3 3. + <_> + + <_> + 5 12 3 3 -1. + <_> + 6 13 1 1 9. + <_> + + <_> + 4 12 3 2 -1. + <_> + 5 12 1 2 3. + <_> + + <_> + 10 13 3 1 -1. + <_> + 11 13 1 1 3. + <_> + + <_> + 11 5 4 3 -1. + <_> + 12 5 2 3 2. + <_> + + <_> + 19 7 1 10 -1. + <_> + 19 12 1 5 2. + <_> + + <_> + 4 8 2 3 -1. + <_> + 3 9 2 1 3. + 1 + <_> + + <_> + 7 0 6 5 -1. + <_> + 9 0 2 5 3. + <_> + + <_> + 5 0 6 2 -1. + <_> + 5 0 3 2 2. + 1 + <_> + + <_> + 5 0 13 9 -1. + <_> + 5 3 13 3 3. + <_> + + <_> + 0 6 1 2 -1. + <_> + 0 7 1 1 2. + <_> + + <_> + 1 0 16 6 -1. + <_> + 1 2 16 2 3. + <_> + + <_> + 18 0 2 4 -1. + <_> + 18 0 1 4 2. + 1 + <_> + + <_> + 4 13 2 2 -1. + <_> + 4 13 1 1 2. + <_> + 5 14 1 1 2. + <_> + + <_> + 0 3 4 1 -1. + <_> + 2 3 2 1 2. + <_> + + <_> + 3 0 8 12 -1. + <_> + 3 6 8 6 2. + <_> + + <_> + 12 13 4 1 -1. + <_> + 13 13 2 1 2. + <_> + + <_> + 12 12 2 2 -1. + <_> + 12 12 1 1 2. + <_> + 13 13 1 1 2. + <_> + + <_> + 5 16 3 1 -1. + <_> + 6 17 1 1 3. + 1 + <_> + + <_> + 3 13 8 4 -1. + <_> + 3 13 4 2 2. + <_> + 7 15 4 2 2. + <_> + + <_> + 0 8 18 3 -1. + <_> + 6 9 6 1 9. + <_> + + <_> + 8 4 6 5 -1. + <_> + 11 4 3 5 2. + <_> + + <_> + 5 14 9 1 -1. + <_> + 8 14 3 1 3. + <_> + + <_> + 4 0 4 4 -1. + <_> + 4 0 2 4 2. + 1 + <_> + + <_> + 7 9 12 8 -1. + <_> + 7 11 12 4 2. + <_> + + <_> + 18 15 2 1 -1. + <_> + 18 15 1 1 2. + 1 + <_> + + <_> + 3 13 2 4 -1. + <_> + 3 13 1 2 2. + <_> + 4 15 1 2 2. + <_> + + <_> + 4 7 3 3 -1. + <_> + 3 8 3 1 3. + 1 + <_> + + <_> + 0 1 2 7 -1. + <_> + 1 1 1 7 2. + <_> + + <_> + 4 0 3 9 -1. + <_> + 5 0 1 9 3. + <_> + + <_> + 15 10 3 3 -1. + <_> + 14 11 3 1 3. + 1 + <_> + + <_> + 12 11 2 2 -1. + <_> + 12 11 1 1 2. + <_> + 13 12 1 1 2. + <_> + + <_> + 0 0 1 4 -1. + <_> + 0 2 1 2 2. + <_> + + <_> + 12 18 8 2 -1. + <_> + 12 19 8 1 2. + <_> + + <_> + 17 9 2 2 -1. + <_> + 17 9 1 2 2. + 1 + <_> + + <_> + 16 10 4 2 -1. + <_> + 17 11 2 2 2. + 1 + <_> + + <_> + 7 13 10 1 -1. + <_> + 12 13 5 1 2. + <_> + + <_> + 7 7 4 3 -1. + <_> + 9 7 2 3 2. + <_> + + <_> + 9 18 6 2 -1. + <_> + 11 18 2 2 3. + <_> + + <_> + 8 18 6 2 -1. + <_> + 10 18 2 2 3. + <_> + + <_> + 17 9 3 1 -1. + <_> + 18 10 1 1 3. + 1 + <_> + + <_> + 17 7 2 11 -1. + <_> + 18 7 1 11 2. + <_> + + <_> + 8 2 4 4 -1. + <_> + 8 2 2 4 2. + 1 + <_> + + <_> + 6 6 2 3 -1. + <_> + 7 6 1 3 2. + <_> + + <_> + 7 0 9 5 -1. + <_> + 10 3 3 5 3. + 1 + <_> + + <_> + 1 0 15 9 -1. + <_> + 6 3 5 3 9. + <_> + + <_> + 2 12 4 3 -1. + <_> + 3 12 2 3 2. + <_> + + <_> + 0 12 4 5 -1. + <_> + 1 12 2 5 2. + <_> + + <_> + 3 2 2 3 -1. + <_> + 2 3 2 1 3. + 1 + <_> + + <_> + 4 13 6 1 -1. + <_> + 4 13 3 1 2. + 1 + <_> + + <_> + 5 0 4 6 -1. + <_> + 6 0 2 6 2. + <_> + + <_> + 2 17 2 1 -1. + <_> + 2 17 1 1 2. + 1 + <_> + + <_> + 4 9 1 3 -1. + <_> + 3 10 1 1 3. + 1 + <_> + + <_> + 0 2 6 9 -1. + <_> + 2 2 2 9 3. + <_> + + <_> + 16 7 2 2 -1. + <_> + 16 7 1 2 2. + 1 + <_> + + <_> + 7 2 6 4 -1. + <_> + 9 2 2 4 3. + <_> + + <_> + 7 18 6 2 -1. + <_> + 9 18 2 2 3. + <_> + + <_> + 1 14 6 4 -1. + <_> + 3 14 2 4 3. + <_> + + <_> + 6 8 7 3 -1. + <_> + 5 9 7 1 3. + 1 + <_> + + <_> + 14 12 4 1 -1. + <_> + 15 13 2 1 2. + 1 + <_> + + <_> + 4 12 3 2 -1. + <_> + 5 12 1 2 3. + <_> + + <_> + 5 12 3 3 -1. + <_> + 6 12 1 3 3. + <_> + + <_> + 18 2 2 2 -1. + <_> + 19 2 1 2 2. + <_> + + <_> + 14 0 6 1 -1. + <_> + 17 0 3 1 2. + <_> + + <_> + 17 0 3 3 -1. + <_> + 18 1 1 3 3. + 1 + <_> + + <_> + 11 4 6 8 -1. + <_> + 13 4 2 8 3. + <_> + + <_> + 7 12 3 2 -1. + <_> + 8 12 1 2 3. + <_> + + <_> + 16 0 3 2 -1. + <_> + 16 1 3 1 2. + <_> + + <_> + 5 11 9 4 -1. + <_> + 8 11 3 4 3. + <_> + + <_> + 12 9 1 6 -1. + <_> + 12 11 1 2 3. + <_> + + <_> + 4 0 4 4 -1. + <_> + 4 0 2 4 2. + 1 + <_> + + <_> + 5 1 11 12 -1. + <_> + 5 5 11 4 3. + <_> + + <_> + 16 12 4 8 -1. + <_> + 18 12 2 8 2. + <_> + + <_> + 18 14 2 6 -1. + <_> + 18 17 2 3 2. + <_> + + <_> + 1 12 4 4 -1. + <_> + 2 12 2 4 2. + <_> + + <_> + 6 7 6 4 -1. + <_> + 5 8 6 2 2. + 1 + <_> + + <_> + 5 15 3 2 -1. + <_> + 6 16 1 2 3. + 1 + <_> + + <_> + 6 16 3 1 -1. + <_> + 7 17 1 1 3. + 1 + <_> + + <_> + 10 14 1 2 -1. + <_> + 10 14 1 1 2. + 1 + <_> + + <_> + 4 7 3 3 -1. + <_> + 3 8 3 1 3. + 1 + <_> + + <_> + 2 0 6 8 -1. + <_> + 4 0 2 8 3. + <_> + + <_> + 2 5 6 3 -1. + <_> + 4 5 2 3 3. + <_> + + <_> + 3 11 3 6 -1. + <_> + 4 11 1 6 3. + <_> + + <_> + 15 11 2 3 -1. + <_> + 14 12 2 1 3. + 1 + <_> + + <_> + 11 17 4 3 -1. + <_> + 12 17 2 3 2. + <_> + + <_> + 13 11 2 2 -1. + <_> + 13 11 1 1 2. + <_> + 14 12 1 1 2. + <_> + + <_> + 13 11 2 2 -1. + <_> + 13 11 1 1 2. + <_> + 14 12 1 1 2. + <_> + + <_> + 8 2 5 6 -1. + <_> + 8 5 5 3 2. + <_> + + <_> + 0 0 1 2 -1. + <_> + 0 1 1 1 2. + <_> + + <_> + 0 8 10 4 -1. + <_> + 0 10 10 2 2. + <_> + + <_> + 17 11 3 1 -1. + <_> + 18 12 1 1 3. + 1 + <_> + + <_> + 7 18 2 2 -1. + <_> + 8 18 1 2 2. + <_> + + <_> + 0 6 18 4 -1. + <_> + 9 6 9 4 2. + <_> + + <_> + 2 12 12 8 -1. + <_> + 6 12 4 8 3. + <_> + + <_> + 1 0 14 1 -1. + <_> + 8 0 7 1 2. + <_> + + <_> + 8 0 12 19 -1. + <_> + 14 0 6 19 2. + <_> + + <_> + 7 12 3 2 -1. + <_> + 8 12 1 2 3. + <_> + + <_> + 8 11 3 5 -1. + <_> + 9 11 1 5 3. + <_> + + <_> + 7 18 3 2 -1. + <_> + 8 18 1 2 3. + <_> + + <_> + 5 13 2 2 -1. + <_> + 5 13 1 1 2. + <_> + 6 14 1 1 2. + <_> + + <_> + 16 9 3 1 -1. + <_> + 17 10 1 1 3. + 1 + <_> + + <_> + 18 0 2 3 -1. + <_> + 18 0 1 3 2. + 1 + <_> + + <_> + 4 2 15 6 -1. + <_> + 4 4 15 2 3. + <_> + + <_> + 10 0 10 4 -1. + <_> + 10 0 5 2 2. + <_> + 15 2 5 2 2. + <_> + + <_> + 5 0 12 6 -1. + <_> + 5 2 12 2 3. + <_> + + <_> + 12 1 8 6 -1. + <_> + 12 1 4 3 2. + <_> + 16 4 4 3 2. + <_> + + <_> + 0 3 2 1 -1. + <_> + 1 3 1 1 2. + <_> + + <_> + 16 7 2 4 -1. + <_> + 16 7 1 4 2. + 1 + <_> + + <_> + 15 17 5 3 -1. + <_> + 15 18 5 1 3. + <_> + + <_> + 6 12 6 8 -1. + <_> + 8 12 2 8 3. + <_> + + <_> + 5 12 2 2 -1. + <_> + 6 12 1 2 2. + <_> + + <_> + 13 12 4 6 -1. + <_> + 14 12 2 6 2. + <_> + + <_> + 17 0 3 4 -1. + <_> + 18 1 1 4 3. + 1 + <_> + + <_> + 4 0 4 10 -1. + <_> + 5 0 2 10 2. + <_> + + <_> + 5 12 3 3 -1. + <_> + 6 12 1 3 3. + <_> + + <_> + 11 12 3 3 -1. + <_> + 12 12 1 3 3. + <_> + + <_> + 3 2 1 3 -1. + <_> + 2 3 1 1 3. + 1 + <_> + + <_> + 2 1 8 1 -1. + <_> + 4 1 4 1 2. + <_> + + <_> + 0 3 18 12 -1. + <_> + 6 7 6 4 9. + <_> + + <_> + 12 18 6 2 -1. + <_> + 15 18 3 2 2. + <_> + + <_> + 11 9 4 7 -1. + <_> + 12 10 2 7 2. + 1 + <_> + + <_> + 15 8 3 12 -1. + <_> + 16 12 1 4 9. + <_> + + <_> + 6 10 7 3 -1. + <_> + 6 11 7 1 3. + <_> + + <_> + 4 9 10 3 -1. + <_> + 4 10 10 1 3. + <_> + + <_> + 0 1 15 7 -1. + <_> + 5 1 5 7 3. + <_> + + <_> + 0 0 1 18 -1. + <_> + 0 6 1 6 3. + <_> + + <_> + 9 13 2 4 -1. + <_> + 8 14 2 2 2. + 1 + <_> + + <_> + 16 16 4 4 -1. + <_> + 16 18 4 2 2. + <_> + + <_> + 1 10 4 8 -1. + <_> + 2 10 2 8 2. + <_> + + <_> + 2 15 3 2 -1. + <_> + 3 16 1 2 3. + 1 + <_> + + <_> + 2 17 2 1 -1. + <_> + 2 17 1 1 2. + 1 + <_> + + <_> + 18 10 2 8 -1. + <_> + 18 10 2 4 2. + 1 + <_> + + <_> + 0 11 18 3 -1. + <_> + 6 12 6 1 9. + <_> + + <_> + 15 10 4 2 -1. + <_> + 16 11 2 2 2. + 1 + <_> + + <_> + 9 1 5 4 -1. + <_> + 9 3 5 2 2. + <_> + + <_> + 6 1 7 6 -1. + <_> + 6 4 7 3 2. + <_> + + <_> + 3 3 8 6 -1. + <_> + 3 6 8 3 2. + <_> + + <_> + 16 1 4 2 -1. + <_> + 18 1 2 2 2. + <_> + + <_> + 18 12 2 3 -1. + <_> + 18 13 2 1 3. + <_> + + <_> + 17 6 2 8 -1. + <_> + 17 6 1 4 2. + <_> + 18 10 1 4 2. + <_> + + <_> + 17 5 3 4 -1. + <_> + 18 6 1 4 3. + 1 + <_> + + <_> + 0 9 4 8 -1. + <_> + 0 11 4 4 2. + <_> + + <_> + 0 6 3 8 -1. + <_> + 0 10 3 4 2. + <_> + + <_> + 14 11 2 2 -1. + <_> + 14 11 1 1 2. + <_> + 15 12 1 1 2. + <_> + + <_> + 15 11 3 3 -1. + <_> + 14 12 3 1 3. + 1 + <_> + + <_> + 14 12 5 2 -1. + <_> + 14 13 5 1 2. + <_> + + <_> + 19 12 1 2 -1. + <_> + 19 13 1 1 2. + <_> + + <_> + 6 0 4 7 -1. + <_> + 7 0 2 7 2. + <_> + + <_> + 12 12 3 2 -1. + <_> + 12 13 3 1 2. + <_> + + <_> + 12 13 4 2 -1. + <_> + 12 13 2 1 2. + <_> + 14 14 2 1 2. + <_> + + <_> + 16 18 4 2 -1. + <_> + 16 19 4 1 2. + <_> + + <_> + 14 18 1 2 -1. + <_> + 14 19 1 1 2. + <_> + + <_> + 16 0 3 2 -1. + <_> + 17 1 1 2 3. + 1 + <_> + + <_> + 16 0 4 2 -1. + <_> + 17 1 2 2 2. + 1 + <_> + + <_> + 12 13 2 2 -1. + <_> + 12 13 1 1 2. + <_> + 13 14 1 1 2. + <_> + + <_> + 7 10 4 2 -1. + <_> + 7 10 2 2 2. + 1 + <_> + + <_> + 3 3 1 3 -1. + <_> + 2 4 1 1 3. + 1 + <_> + + <_> + 3 4 2 3 -1. + <_> + 2 5 2 1 3. + 1 + <_> + + <_> + 3 0 16 6 -1. + <_> + 3 2 16 2 3. + <_> + + <_> + 12 2 2 5 -1. + <_> + 12 2 1 5 2. + 1 + <_> + + <_> + 4 0 1 3 -1. + <_> + 3 1 1 1 3. + 1 + <_> + + <_> + 13 12 2 2 -1. + <_> + 13 12 1 1 2. + <_> + 14 13 1 1 2. + <_> + + <_> + 5 17 4 3 -1. + <_> + 6 17 2 3 2. + <_> + + <_> + 17 13 3 3 -1. + <_> + 17 14 3 1 3. + <_> + + <_> + 0 12 2 8 -1. + <_> + 0 12 1 4 2. + <_> + 1 16 1 4 2. + <_> + + <_> + 4 16 1 3 -1. + <_> + 3 17 1 1 3. + 1 + <_> + + <_> + 0 2 1 2 -1. + <_> + 0 3 1 1 2. + <_> + + <_> + 10 2 4 7 -1. + <_> + 11 2 2 7 2. + <_> + + <_> + 2 1 6 9 -1. + <_> + 2 4 6 3 3. + <_> + + <_> + 1 4 2 2 -1. + <_> + 2 4 1 2 2. + <_> + + <_> + 13 12 2 2 -1. + <_> + 13 12 1 1 2. + <_> + 14 13 1 1 2. + <_> + + <_> + 18 0 2 1 -1. + <_> + 19 0 1 1 2. + <_> + + <_> + 4 13 3 1 -1. + <_> + 5 13 1 1 3. + <_> + + <_> + 6 13 4 1 -1. + <_> + 7 13 2 1 2. + <_> + + <_> + 6 10 6 3 -1. + <_> + 6 11 6 1 3. + <_> + + <_> + 7 9 4 3 -1. + <_> + 7 10 4 1 3. + <_> + + <_> + 6 0 4 3 -1. + <_> + 6 0 2 3 2. + 1 + <_> + + <_> + 15 15 5 2 -1. + <_> + 15 16 5 1 2. + <_> + + <_> + 0 8 18 12 -1. + <_> + 6 12 6 4 9. + <_> + + <_> + 1 6 14 4 -1. + <_> + 8 6 7 4 2. + <_> + + <_> + 3 11 6 3 -1. + <_> + 2 12 6 1 3. + 1 + <_> + + <_> + 5 9 1 3 -1. + <_> + 4 10 1 1 3. + 1 + <_> + + <_> + 17 10 3 3 -1. + <_> + 18 11 1 3 3. + 1 + <_> + + <_> + 17 11 1 4 -1. + <_> + 16 12 1 2 2. + 1 + <_> + + <_> + 1 0 12 9 -1. + <_> + 4 0 6 9 2. + <_> + + <_> + 9 3 4 5 -1. + <_> + 10 3 2 5 2. + <_> + + <_> + 7 8 6 3 -1. + <_> + 7 9 6 1 3. + <_> + + <_> + 7 1 9 6 -1. + <_> + 7 3 9 2 3. + <_> + + <_> + 0 1 2 2 -1. + <_> + 0 2 2 1 2. + <_> + + <_> + 13 8 3 5 -1. + <_> + 14 9 1 5 3. + 1 + <_> + + <_> + 3 16 3 1 -1. + <_> + 4 17 1 1 3. + 1 + <_> + + <_> + 11 1 4 7 -1. + <_> + 12 1 2 7 2. + <_> + + <_> + 11 13 2 2 -1. + <_> + 11 13 1 1 2. + <_> + 12 14 1 1 2. + <_> + + <_> + 12 14 3 1 -1. + <_> + 13 14 1 1 3. + <_> + + <_> + 17 2 3 1 -1. + <_> + 18 3 1 1 3. + 1 + <_> + + <_> + 14 2 6 6 -1. + <_> + 14 2 3 3 2. + <_> + 17 5 3 3 2. + <_> + + <_> + 12 16 8 4 -1. + <_> + 12 18 8 2 2. + <_> + + <_> + 7 11 3 3 -1. + <_> + 6 12 3 1 3. + 1 + <_> + + <_> + 6 3 8 6 -1. + <_> + 4 5 8 2 3. + 1 + <_> + + <_> + 1 8 3 8 -1. + <_> + 1 10 3 4 2. + <_> + + <_> + 7 0 8 6 -1. + <_> + 9 2 4 6 2. + 1 + <_> + + <_> + 5 2 7 6 -1. + <_> + 5 5 7 3 2. + <_> + + <_> + 10 13 3 1 -1. + <_> + 11 13 1 1 3. + <_> + + <_> + 12 12 4 2 -1. + <_> + 12 12 2 1 2. + <_> + 14 13 2 1 2. + <_> + + <_> + 6 1 14 19 -1. + <_> + 13 1 7 19 2. + <_> + + <_> + 6 9 14 1 -1. + <_> + 13 9 7 1 2. + <_> + + <_> + 18 0 2 1 -1. + <_> + 18 0 1 1 2. + 1 + <_> + + <_> + 15 0 3 1 -1. + <_> + 16 1 1 1 3. + 1 + <_> + + <_> + 5 7 2 3 -1. + <_> + 4 8 2 1 3. + 1 + <_> + + <_> + 15 12 3 3 -1. + <_> + 14 13 3 1 3. + 1 + <_> + + <_> + 10 17 4 2 -1. + <_> + 11 17 2 2 2. + <_> + + <_> + 8 12 3 3 -1. + <_> + 9 13 1 1 9. + <_> + + <_> + 4 1 7 6 -1. + <_> + 4 3 7 2 3. + <_> + + <_> + 11 0 6 6 -1. + <_> + 11 2 6 2 3. + <_> + + <_> + 0 1 1 4 -1. + <_> + 0 2 1 2 2. + <_> + + <_> + 7 5 4 4 -1. + <_> + 8 5 2 4 2. + <_> + + <_> + 1 0 1 3 -1. + <_> + 1 1 1 1 3. + <_> + + <_> + 9 3 4 2 -1. + <_> + 9 4 4 1 2. + <_> + + <_> + 18 13 2 5 -1. + <_> + 19 13 1 5 2. + <_> + + <_> + 2 11 3 6 -1. + <_> + 3 11 1 6 3. + <_> + + <_> + 0 5 2 12 -1. + <_> + 0 9 2 4 3. + <_> + + <_> + 11 10 8 5 -1. + <_> + 15 10 4 5 2. + <_> + + <_> + 15 11 4 2 -1. + <_> + 16 12 2 2 2. + 1 + <_> + + <_> + 15 8 4 2 -1. + <_> + 16 9 2 2 2. + 1 + <_> + + <_> + 5 13 2 1 -1. + <_> + 6 13 1 1 2. + <_> + + <_> + 12 13 2 2 -1. + <_> + 13 13 1 2 2. + <_> + + <_> + 11 12 8 8 -1. + <_> + 13 12 4 8 2. + <_> + + <_> + 3 0 6 10 -1. + <_> + 5 0 2 10 3. + <_> + + <_> + 6 14 2 2 -1. + <_> + 6 14 1 2 2. + 1 + <_> + + <_> + 0 5 19 4 -1. + <_> + 0 7 19 2 2. + <_> + + <_> + 17 4 3 2 -1. + <_> + 18 5 1 2 3. + 1 + <_> + + <_> + 17 3 3 4 -1. + <_> + 18 4 1 4 3. + 1 + <_> + + <_> + 5 13 8 2 -1. + <_> + 7 13 4 2 2. + <_> + + <_> + 0 0 2 8 -1. + <_> + 0 4 2 4 2. + <_> + + <_> + 0 9 15 6 -1. + <_> + 0 11 15 2 3. + <_> + + <_> + 18 14 2 1 -1. + <_> + 18 14 1 1 2. + 1 + <_> + + <_> + 0 0 4 8 -1. + <_> + 2 0 2 8 2. + <_> + + <_> + 0 13 6 2 -1. + <_> + 2 13 2 2 3. + <_> + + <_> + 3 18 3 2 -1. + <_> + 3 19 3 1 2. + <_> + + <_> + 2 11 15 6 -1. + <_> + 7 13 5 2 9. + <_> + + <_> + 7 14 3 3 -1. + <_> + 8 15 1 3 3. + 1 + <_> + + <_> + 7 8 2 2 -1. + <_> + 8 8 1 2 2. + <_> + + <_> + 6 9 6 3 -1. + <_> + 6 10 6 1 3. + <_> + + <_> + 5 8 7 3 -1. + <_> + 5 9 7 1 3. + <_> + + <_> + 17 9 3 1 -1. + <_> + 18 10 1 1 3. + 1 + <_> + + <_> + 17 9 3 2 -1. + <_> + 18 10 1 2 3. + 1 + <_> + + <_> + 11 9 1 3 -1. + <_> + 11 10 1 1 3. + <_> + + <_> + 12 11 2 2 -1. + <_> + 12 11 1 1 2. + <_> + 13 12 1 1 2. + <_> + + <_> + 3 6 4 5 -1. + <_> + 4 6 2 5 2. + <_> + + <_> + 5 6 4 3 -1. + <_> + 6 6 2 3 2. + <_> + + <_> + 0 3 1 6 -1. + <_> + 0 5 1 2 3. + <_> + + <_> + 14 12 2 2 -1. + <_> + 14 12 1 1 2. + <_> + 15 13 1 1 2. + <_> + + <_> + 3 16 3 3 -1. + <_> + 4 16 1 3 3. + <_> + + <_> + 3 1 14 4 -1. + <_> + 3 3 14 2 2. + <_> + + <_> + 6 0 14 8 -1. + <_> + 6 0 7 4 2. + <_> + 13 4 7 4 2. + <_> + + <_> + 4 0 4 8 -1. + <_> + 4 2 4 4 2. + <_> + + <_> + 9 0 8 1 -1. + <_> + 13 0 4 1 2. + <_> + + <_> + 14 1 6 1 -1. + <_> + 17 1 3 1 2. + <_> + + <_> + 18 18 2 2 -1. + <_> + 18 19 2 1 2. + <_> + + <_> + 5 16 2 2 -1. + <_> + 5 16 1 2 2. + 1 + <_> + + <_> + 2 8 11 3 -1. + <_> + 2 9 11 1 3. + <_> + + <_> + 1 8 2 3 -1. + <_> + 1 9 2 1 3. + <_> + + <_> + 18 12 2 5 -1. + <_> + 19 12 1 5 2. + <_> + + <_> + 19 16 1 3 -1. + <_> + 18 17 1 1 3. + 1 + <_> + + <_> + 14 9 2 2 -1. + <_> + 14 9 1 2 2. + 1 + <_> + + <_> + 13 11 2 2 -1. + <_> + 13 11 1 1 2. + <_> + 14 12 1 1 2. + <_> + + <_> + 13 12 4 4 -1. + <_> + 14 12 2 4 2. + <_> + + <_> + 19 11 1 3 -1. + <_> + 19 12 1 1 3. + <_> + + <_> + 0 1 1 4 -1. + <_> + 0 3 1 2 2. + <_> + + <_> + 0 0 20 20 -1. + <_> + 0 0 10 10 2. + <_> + 10 10 10 10 2. + <_> + + <_> + 11 12 3 3 -1. + <_> + 10 13 3 1 3. + 1 + <_> + + <_> + 16 17 1 2 -1. + <_> + 16 17 1 1 2. + 1 + <_> + + <_> + 13 10 4 2 -1. + <_> + 13 10 2 1 2. + <_> + 15 11 2 1 2. + <_> + + <_> + 15 11 2 2 -1. + <_> + 15 11 1 1 2. + <_> + 16 12 1 1 2. + <_> + + <_> + 2 10 3 6 -1. + <_> + 3 10 1 6 3. + <_> + + <_> + 0 0 6 9 -1. + <_> + 2 0 2 9 3. + <_> + + <_> + 8 17 2 1 -1. + <_> + 8 17 1 1 2. + 1 + <_> + + <_> + 4 18 8 1 -1. + <_> + 8 18 4 1 2. + <_> + + <_> + 4 11 1 4 -1. + <_> + 3 12 1 2 2. + 1 + <_> + + <_> + 7 11 3 3 -1. + <_> + 6 12 3 1 3. + 1 + <_> + + <_> + 9 18 4 1 -1. + <_> + 10 18 2 1 2. + <_> + + <_> + 0 19 2 1 -1. + <_> + 1 19 1 1 2. + <_> + + <_> + 11 6 3 5 -1. + <_> + 12 6 1 5 3. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 0 6 10 2. + <_> + 14 10 6 10 2. + <_> + + <_> + 4 0 1 4 -1. + <_> + 3 1 1 2 2. + 1 + <_> + + <_> + 4 14 16 4 -1. + <_> + 8 14 8 4 2. + <_> + + <_> + 7 9 5 4 -1. + <_> + 6 10 5 2 2. + 1 + <_> + + <_> + 5 12 6 2 -1. + <_> + 5 12 3 2 2. + 1 + <_> + + <_> + 1 14 4 1 -1. + <_> + 1 14 2 1 2. + 1 + <_> + + <_> + 4 10 1 3 -1. + <_> + 3 11 1 1 3. + 1 + <_> + + <_> + 3 10 3 9 -1. + <_> + 4 10 1 9 3. + <_> + + <_> + 4 11 3 4 -1. + <_> + 5 11 1 4 3. + <_> + + <_> + 5 12 3 2 -1. + <_> + 6 12 1 2 3. + <_> + + <_> + 7 12 3 2 -1. + <_> + 8 12 1 2 3. + <_> + + <_> + 1 2 12 6 -1. + <_> + 5 2 4 6 3. + <_> + + <_> + 9 0 8 3 -1. + <_> + 11 2 4 3 2. + 1 + <_> + + <_> + 8 1 6 2 -1. + <_> + 8 1 3 2 2. + 1 + <_> + + <_> + 4 4 15 9 -1. + <_> + 4 7 15 3 3. + <_> + + <_> + 5 10 8 6 -1. + <_> + 7 10 4 6 2. + <_> + + <_> + 11 8 9 9 -1. + <_> + 11 11 9 3 3. + <_> + + <_> + 7 0 6 4 -1. + <_> + 9 2 2 4 3. + 1 + <_> + + <_> + 3 11 6 3 -1. + <_> + 2 12 6 1 3. + 1 + <_> + + <_> + 16 12 4 3 -1. + <_> + 18 12 2 3 2. + <_> + + <_> + 10 10 2 10 -1. + <_> + 10 15 2 5 2. + <_> + + <_> + 5 7 3 4 -1. + <_> + 4 8 3 2 2. + 1 + <_> + + <_> + 1 9 6 1 -1. + <_> + 3 11 2 1 3. + 1 + <_> + + <_> + 0 0 1 6 -1. + <_> + 0 3 1 3 2. + <_> + + <_> + 8 10 10 2 -1. + <_> + 8 10 5 1 2. + <_> + 13 11 5 1 2. + <_> + + <_> + 5 2 5 6 -1. + <_> + 5 5 5 3 2. + <_> + + <_> + 6 1 6 1 -1. + <_> + 6 1 3 1 2. + 1 + <_> + + <_> + 0 3 1 12 -1. + <_> + 0 7 1 4 3. + <_> + + <_> + 0 7 2 1 -1. + <_> + 1 7 1 1 2. + <_> + + <_> + 3 5 1 3 -1. + <_> + 2 6 1 1 3. + 1 + <_> + + <_> + 11 12 2 3 -1. + <_> + 10 13 2 1 3. + 1 + <_> + + <_> + 10 12 3 3 -1. + <_> + 11 12 1 3 3. + <_> + + <_> + 9 11 3 3 -1. + <_> + 10 12 1 1 9. + <_> + + <_> + 6 17 4 2 -1. + <_> + 7 17 2 2 2. + <_> + + <_> + 12 18 6 2 -1. + <_> + 15 18 3 2 2. + <_> + + <_> + 3 17 2 1 -1. + <_> + 3 17 1 1 2. + 1 + <_> + + <_> + 1 15 4 1 -1. + <_> + 2 16 2 1 2. + 1 + <_> + + <_> + 18 0 2 2 -1. + <_> + 18 1 2 1 2. + <_> + + <_> + 19 0 1 3 -1. + <_> + 19 1 1 1 3. + <_> + + <_> + 16 11 3 2 -1. + <_> + 16 11 3 1 2. + 1 + <_> + + <_> + 16 12 2 3 -1. + <_> + 15 13 2 1 3. + 1 + <_> + + <_> + 12 0 8 1 -1. + <_> + 16 0 4 1 2. + <_> + + <_> + 2 1 9 6 -1. + <_> + 2 4 9 3 2. + <_> + + <_> + 17 1 3 2 -1. + <_> + 17 1 3 1 2. + 1 + <_> + + <_> + 7 5 6 4 -1. + <_> + 7 6 6 2 2. + <_> + + <_> + 4 6 6 2 -1. + <_> + 7 6 3 2 2. + <_> + + <_> + 11 4 6 6 -1. + <_> + 13 4 2 6 3. + <_> + + <_> + 5 7 9 3 -1. + <_> + 5 8 9 1 3. + <_> + + <_> + 5 8 9 3 -1. + <_> + 5 9 9 1 3. + <_> + + <_> + 1 0 4 3 -1. + <_> + 2 0 2 3 2. + <_> + + <_> + 9 9 5 4 -1. + <_> + 9 10 5 2 2. + <_> + + <_> + 1 0 6 7 -1. + <_> + 3 0 2 7 3. + <_> + + <_> + 16 9 3 2 -1. + <_> + 17 10 1 2 3. + 1 + <_> + + <_> + 14 12 2 2 -1. + <_> + 14 12 1 1 2. + <_> + 15 13 1 1 2. + <_> + + <_> + 0 0 14 1 -1. + <_> + 7 0 7 1 2. + <_> + + <_> + 15 11 2 2 -1. + <_> + 15 11 1 2 2. + 1 + <_> + + <_> + 3 14 12 4 -1. + <_> + 3 14 6 2 2. + <_> + 9 16 6 2 2. + <_> + + <_> + 5 2 1 3 -1. + <_> + 4 3 1 1 3. + 1 + <_> + + <_> + 8 12 3 2 -1. + <_> + 9 13 1 2 3. + 1 + <_> + + <_> + 14 11 2 2 -1. + <_> + 14 11 1 1 2. + <_> + 15 12 1 1 2. + <_> + + <_> + 13 10 7 2 -1. + <_> + 13 11 7 1 2. + <_> + + <_> + 7 13 1 2 -1. + <_> + 7 13 1 1 2. + 1 + <_> + + <_> + 5 12 4 3 -1. + <_> + 6 12 2 3 2. + <_> + + <_> + 8 2 2 5 -1. + <_> + 9 2 1 5 2. + <_> + + <_> + 1 17 4 2 -1. + <_> + 3 17 2 2 2. + <_> + + <_> + 12 17 4 3 -1. + <_> + 13 17 2 3 2. + <_> + + <_> + 15 16 5 3 -1. + <_> + 15 17 5 1 3. + <_> + + <_> + 15 16 4 3 -1. + <_> + 15 17 4 1 3. + <_> + + <_> + 0 17 16 3 -1. + <_> + 4 17 8 3 2. + <_> + + <_> + 0 14 2 2 -1. + <_> + 0 14 1 1 2. + <_> + 1 15 1 1 2. + <_> + + <_> + 7 2 6 6 -1. + <_> + 7 4 6 2 3. + <_> + + <_> + 3 5 1 3 -1. + <_> + 2 6 1 1 3. + 1 + <_> + + <_> + 2 7 2 2 -1. + <_> + 2 7 2 1 2. + 1 + <_> + + <_> + 6 11 5 3 -1. + <_> + 5 12 5 1 3. + 1 + <_> + + <_> + 16 14 4 6 -1. + <_> + 16 17 4 3 2. + <_> + + <_> + 6 13 6 7 -1. + <_> + 8 13 2 7 3. + <_> + + <_> + 0 1 12 11 -1. + <_> + 3 1 6 11 2. + <_> + + <_> + 6 10 7 3 -1. + <_> + 6 11 7 1 3. + <_> + + <_> + 8 0 9 4 -1. + <_> + 8 2 9 2 2. + <_> + + <_> + 10 14 10 2 -1. + <_> + 10 15 10 1 2. + <_> + + <_> + 0 0 1 18 -1. + <_> + 0 6 1 6 3. + <_> + + <_> + 4 13 2 2 -1. + <_> + 4 13 1 1 2. + <_> + 5 14 1 1 2. + <_> + + <_> + 8 11 3 6 -1. + <_> + 9 12 1 6 3. + 1 + <_> + + <_> + 6 7 2 3 -1. + <_> + 5 8 2 1 3. + 1 + <_> + + <_> + 4 8 3 3 -1. + <_> + 5 8 1 3 3. + <_> + + <_> + 1 4 14 1 -1. + <_> + 1 4 7 1 2. + 1 + <_> + + <_> + 12 13 8 3 -1. + <_> + 14 13 4 3 2. + <_> + + <_> + 4 17 2 1 -1. + <_> + 4 17 1 1 2. + 1 + <_> + + <_> + 6 16 2 2 -1. + <_> + 6 16 1 2 2. + 1 + <_> + + <_> + 3 17 4 2 -1. + <_> + 4 17 2 2 2. + <_> + + <_> + 0 7 20 2 -1. + <_> + 5 7 10 2 2. + <_> + + <_> + 15 9 2 2 -1. + <_> + 15 9 1 2 2. + 1 + <_> + + <_> + 3 12 2 2 -1. + <_> + 3 12 1 1 2. + <_> + 4 13 1 1 2. + <_> + + <_> + 0 5 2 1 -1. + <_> + 1 5 1 1 2. + <_> + + <_> + 17 0 3 2 -1. + <_> + 18 1 1 2 3. + 1 + <_> + + <_> + 2 8 3 9 -1. + <_> + 3 11 1 3 9. + <_> + + <_> + 15 7 4 2 -1. + <_> + 16 8 2 2 2. + 1 + <_> + + <_> + 4 16 3 3 -1. + <_> + 5 16 1 3 3. + <_> + + <_> + 8 14 6 1 -1. + <_> + 10 14 2 1 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 3 2. + <_> + 17 3 3 3 2. + <_> + + <_> + 17 2 2 1 -1. + <_> + 17 2 1 1 2. + 1 + <_> + + <_> + 0 19 20 1 -1. + <_> + 10 19 10 1 2. + <_> + + <_> + 0 19 6 1 -1. + <_> + 3 19 3 1 2. + <_> + + <_> + 9 17 4 3 -1. + <_> + 10 17 2 3 2. + <_> + + <_> + 4 11 3 3 -1. + <_> + 5 12 1 1 9. + <_> + + <_> + 17 7 3 3 -1. + <_> + 18 8 1 3 3. + 1 + <_> + + <_> + 19 1 1 4 -1. + <_> + 18 2 1 2 2. + 1 + <_> + + <_> + 6 8 2 1 -1. + <_> + 7 8 1 1 2. + <_> + + <_> + 5 4 4 4 -1. + <_> + 6 5 2 4 2. + 1 + <_> + + <_> + 5 0 8 7 -1. + <_> + 9 0 4 7 2. + <_> + + <_> + 0 7 5 9 -1. + <_> + 0 10 5 3 3. + <_> + + <_> + 14 10 2 2 -1. + <_> + 14 10 1 1 2. + <_> + 15 11 1 1 2. + <_> + + <_> + 15 11 2 2 -1. + <_> + 15 11 1 1 2. + <_> + 16 12 1 1 2. + <_> + + <_> + 9 2 6 4 -1. + <_> + 11 2 2 4 3. + <_> + + <_> + 0 12 12 8 -1. + <_> + 6 12 6 8 2. + <_> + + <_> + 1 0 6 2 -1. + <_> + 3 0 2 2 3. + <_> + + <_> + 0 12 4 5 -1. + <_> + 1 12 2 5 2. + <_> + + <_> + 2 12 4 4 -1. + <_> + 3 12 2 4 2. + <_> + + <_> + 12 11 2 4 -1. + <_> + 13 11 1 4 2. + <_> + + <_> + 2 0 1 4 -1. + <_> + 2 2 1 2 2. + <_> + + <_> + 6 1 4 9 -1. + <_> + 7 1 2 9 2. + <_> + + <_> + 13 10 2 3 -1. + <_> + 13 11 2 1 3. + <_> + + <_> + 3 9 15 3 -1. + <_> + 8 10 5 1 9. + <_> + + <_> + 15 10 3 1 -1. + <_> + 16 11 1 1 3. + 1 + <_> + + <_> + 1 0 15 8 -1. + <_> + 1 2 15 4 2. + <_> + + <_> + 2 3 15 6 -1. + <_> + 2 6 15 3 2. + <_> + + <_> + 6 0 6 6 -1. + <_> + 6 2 6 2 3. + <_> + + <_> + 16 9 4 3 -1. + <_> + 16 10 4 1 3. + <_> + + <_> + 16 7 4 3 -1. + <_> + 16 8 4 1 3. + <_> + + <_> + 15 10 2 2 -1. + <_> + 15 10 1 1 2. + <_> + 16 11 1 1 2. + <_> + + <_> + 13 11 2 3 -1. + <_> + 13 12 2 1 3. + <_> + + <_> + 2 16 2 2 -1. + <_> + 2 16 1 2 2. + 1 + <_> + + <_> + 3 0 4 7 -1. + <_> + 4 0 2 7 2. + <_> + + <_> + 0 16 2 2 -1. + <_> + 0 16 1 1 2. + <_> + 1 17 1 1 2. + <_> + + <_> + 2 0 18 3 -1. + <_> + 8 0 6 3 3. + <_> + + <_> + 0 1 1 3 -1. + <_> + 0 2 1 1 3. + <_> + + <_> + 10 6 4 4 -1. + <_> + 10 7 4 2 2. + <_> + + <_> + 16 4 4 6 -1. + <_> + 16 4 2 3 2. + <_> + 18 7 2 3 2. + <_> + + <_> + 11 12 4 2 -1. + <_> + 11 12 2 1 2. + <_> + 13 13 2 1 2. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_license_plate_rus_16stages.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_license_plate_rus_16stages.xml new file mode 100644 index 0000000000000000000000000000000000000000..576c9e8202ab8bcef89a406921b96226a522e888 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_license_plate_rus_16stages.xml @@ -0,0 +1,1404 @@ + + + + + + 64 16 + + <_> + + + <_> + + <_> + + + + <_> + 32 2 8 6 -1. + <_> + 32 4 8 2 3. + 0 + 1.6915600746870041e-002 + -9.5547717809677124e-001 + 8.9129137992858887e-001 + <_> + + <_> + + + + <_> + 0 4 6 10 -1. + <_> + 3 4 3 10 2. + 0 + 2.4228349328041077e-002 + -9.2089319229125977e-001 + 8.8723921775817871e-001 + <_> + + <_> + + + + <_> + 55 0 8 6 -1. + <_> + 55 0 4 3 2. + <_> + 59 3 4 3 2. + 0 + -1.0168660432100296e-002 + 8.8940089941024780e-001 + -7.7847331762313843e-001 + <_> + + <_> + + + + <_> + 44 7 4 9 -1. + <_> + 44 10 4 3 3. + 0 + 2.0863260142505169e-003 + -8.7998157739639282e-001 + 5.8651781082153320e-001 + -2.0683259963989258e+000 + -1 + -1 + <_> + + + <_> + + <_> + + + + <_> + 29 1 16 4 -1. + <_> + 29 3 16 2 2. + 0 + 2.9062159359455109e-002 + -8.7765061855316162e-001 + 8.5373121500015259e-001 + <_> + + <_> + + + + <_> + 0 5 9 8 -1. + <_> + 3 5 3 8 3. + 0 + 2.3903399705886841e-002 + -9.2079448699951172e-001 + 7.5155001878738403e-001 + <_> + + <_> + + + + <_> + 44 0 20 14 -1. + <_> + 44 0 10 7 2. + <_> + 54 7 10 7 2. + 0 + -3.5404648631811142e-002 + 6.7834627628326416e-001 + -9.0937072038650513e-001 + <_> + + <_> + + + + <_> + 41 7 6 9 -1. + <_> + 43 7 2 9 3. + 0 + 6.2988721765577793e-003 + -8.1054258346557617e-001 + 5.8985030651092529e-001 + <_> + + <_> + + + + <_> + 0 4 21 4 -1. + <_> + 7 4 7 4 3. + 0 + 3.4959490876644850e-003 + -9.7632282972335815e-001 + 4.5473039150238037e-001 + -1.6632349491119385e+000 + 0 + -1 + <_> + + + <_> + + <_> + + + + <_> + 31 2 11 6 -1. + <_> + 31 4 11 2 3. + 0 + 2.3864099755883217e-002 + -9.3137168884277344e-001 + 8.2478952407836914e-001 + <_> + + <_> + + + + <_> + 56 3 6 11 -1. + <_> + 59 3 3 11 2. + 0 + -2.5775209069252014e-002 + 8.5526448488235474e-001 + -8.7574672698974609e-001 + <_> + + <_> + + + + <_> + 32 14 32 2 -1. + <_> + 32 15 32 1 2. + 0 + -1.0646049864590168e-002 + 8.5167151689529419e-001 + -6.7789041996002197e-001 + <_> + + <_> + + + + <_> + 0 2 8 14 -1. + <_> + 4 2 4 14 2. + 0 + 2.7000989764928818e-002 + -8.0041092634201050e-001 + 6.4893317222595215e-001 + <_> + + <_> + + + + <_> + 19 0 22 6 -1. + <_> + 19 0 11 3 2. + <_> + 30 3 11 3 2. + 0 + 5.2989721298217773e-003 + -9.5342522859573364e-001 + 5.0140267610549927e-001 + -1.3346730470657349e+000 + 1 + -1 + <_> + + + <_> + + <_> + + + + <_> + 56 0 6 6 -1. + <_> + 56 0 3 3 2. + <_> + 59 3 3 3 2. + 0 + -6.9233630783855915e-003 + 8.2654470205307007e-001 + -8.5396027565002441e-001 + <_> + + <_> + + + + <_> + 32 0 14 12 -1. + <_> + 32 0 7 6 2. + <_> + 39 6 7 6 2. + 0 + 1.2539249658584595e-001 + -1.2996139936149120e-002 + -3.2377028808593750e+003 + <_> + + <_> + + + + <_> + 2 1 43 4 -1. + <_> + 2 3 43 2 2. + 0 + 6.3474893569946289e-002 + -6.4648061990737915e-001 + 8.2302427291870117e-001 + <_> + + <_> + + + + <_> + 34 10 30 5 -1. + <_> + 44 10 10 5 3. + 0 + 4.2217150330543518e-002 + -7.5190877914428711e-001 + 6.3705182075500488e-001 + <_> + + <_> + + + + <_> + 0 9 9 5 -1. + <_> + 3 9 3 5 3. + 0 + 2.0000640302896500e-002 + -6.2077498435974121e-001 + 6.1317932605743408e-001 + -1.6521669626235962e+000 + 2 + -1 + <_> + + + <_> + + <_> + + + + <_> + 2 1 43 6 -1. + <_> + 2 3 43 2 3. + 0 + 9.2297486960887909e-002 + -7.2764229774475098e-001 + 8.0554759502410889e-001 + <_> + + <_> + + + + <_> + 53 4 9 8 -1. + <_> + 56 4 3 8 3. + 0 + 2.7613969519734383e-002 + -7.0769268274307251e-001 + 7.3315787315368652e-001 + <_> + + <_> + + + + <_> + 36 4 14 8 -1. + <_> + 36 4 7 4 2. + <_> + 43 8 7 4 2. + 0 + 1.2465449981391430e-002 + -8.4359270334243774e-001 + 5.7046437263488770e-001 + <_> + + <_> + + + + <_> + 14 14 49 2 -1. + <_> + 14 15 49 1 2. + 0 + -2.3886829614639282e-002 + 8.2656508684158325e-001 + -5.2783298492431641e-001 + -1.4523630142211914e+000 + 3 + -1 + <_> + + + <_> + + <_> + + + + <_> + 0 5 4 9 -1. + <_> + 2 5 2 9 2. + 0 + 1.8821349367499352e-002 + -8.1122857332229614e-001 + 6.9127470254898071e-001 + <_> + + <_> + + + + <_> + 21 1 38 4 -1. + <_> + 21 3 38 2 2. + 0 + 6.1703320592641830e-002 + -7.6482647657394409e-001 + 6.4212161302566528e-001 + <_> + + <_> + + + + <_> + 44 12 18 3 -1. + <_> + 53 12 9 3 2. + 0 + -1.6298670321702957e-002 + 5.0207728147506714e-001 + -8.4020161628723145e-001 + <_> + + <_> + + + + <_> + 10 4 9 3 -1. + <_> + 13 4 3 3 3. + 0 + -4.9458951689302921e-003 + 6.1991941928863525e-001 + -6.1633539199829102e-001 + <_> + + <_> + + + + <_> + 40 4 10 4 -1. + <_> + 45 4 5 4 2. + 0 + -5.1894597709178925e-003 + 4.4975179433822632e-001 + -8.0651968717575073e-001 + <_> + + <_> + + + + <_> + 17 14 47 2 -1. + <_> + 17 15 47 1 2. + 0 + -1.8824130296707153e-002 + 6.1992841958999634e-001 + -5.5643159151077271e-001 + <_> + + <_> + + + + <_> + 8 5 4 7 -1. + <_> + 10 5 2 7 2. + 0 + 5.6571601890027523e-003 + -4.8346561193466187e-001 + 6.8647360801696777e-001 + -2.2358059883117676e+000 + 4 + -1 + <_> + + + <_> + + <_> + + + + <_> + 56 0 6 6 -1. + <_> + 56 0 3 3 2. + <_> + 59 3 3 3 2. + 0 + -9.1503243893384933e-003 + 6.8174481391906738e-001 + -7.7866071462631226e-001 + <_> + + <_> + + + + <_> + 0 0 6 6 -1. + <_> + 0 0 3 3 2. + <_> + 3 3 3 3 2. + 0 + 7.4933180585503578e-003 + -6.8696027994155884e-001 + 6.6913938522338867e-001 + <_> + + <_> + + + + <_> + 13 4 48 2 -1. + <_> + 29 4 16 2 3. + 0 + 4.5296419411897659e-002 + -7.3576509952545166e-001 + 5.9453499317169189e-001 + <_> + + <_> + + + + <_> + 42 1 6 15 -1. + <_> + 42 6 6 5 3. + 0 + 1.1669679544866085e-002 + -8.4733831882476807e-001 + 4.5461329817771912e-001 + <_> + + <_> + + + + <_> + 30 8 3 5 -1. + <_> + 31 8 1 5 3. + 0 + 2.5769430212676525e-003 + -5.8270388841629028e-001 + 7.7900522947311401e-001 + <_> + + <_> + + + + <_> + 55 10 8 6 -1. + <_> + 55 13 8 3 2. + 0 + -1.4139170525595546e-003 + 4.5126929879188538e-001 + -9.0696328878402710e-001 + -1.8782069683074951e+000 + 5 + -1 + <_> + + + <_> + + <_> + + + + <_> + 4 6 4 7 -1. + <_> + 6 6 2 7 2. + 0 + -5.3149578161537647e-003 + 6.5218788385391235e-001 + -7.9464268684387207e-001 + <_> + + <_> + + + + <_> + 56 3 6 8 -1. + <_> + 59 3 3 8 2. + 0 + -2.2906960919499397e-002 + 6.6433382034301758e-001 + -7.3633247613906860e-001 + <_> + + <_> + + + + <_> + 37 2 4 6 -1. + <_> + 37 4 4 2 3. + 0 + 9.4887977465987206e-003 + -8.2612031698226929e-001 + 4.9333500862121582e-001 + <_> + + <_> + + + + <_> + 0 10 30 6 -1. + <_> + 0 12 30 2 3. + 0 + 4.5138411223888397e-002 + -5.4704028367996216e-001 + 7.6927912235260010e-001 + <_> + + <_> + + + + <_> + 0 4 21 12 -1. + <_> + 7 4 7 12 3. + 0 + 2.5049019604921341e-002 + -8.6739641427993774e-001 + 5.2807968854904175e-001 + -1.0597369670867920e+000 + 6 + -1 + <_> + + + <_> + + <_> + + + + <_> + 44 0 1 14 -1. + <_> + 44 7 1 7 2. + 0 + 6.6414438188076019e-003 + -7.7290147542953491e-001 + 6.9723731279373169e-001 + <_> + + <_> + + + + <_> + 54 3 4 3 -1. + <_> + 56 3 2 3 2. + 0 + 2.4703629314899445e-003 + -7.4289917945861816e-001 + 6.6825848817825317e-001 + <_> + + <_> + + + + <_> + 32 0 30 6 -1. + <_> + 32 0 15 3 2. + <_> + 47 3 15 3 2. + 0 + -2.2910499945282936e-002 + 4.3986389040946960e-001 + -9.0588808059692383e-001 + <_> + + <_> + + + + <_> + 0 8 9 7 -1. + <_> + 3 8 3 7 3. + 0 + 3.4193221479654312e-002 + -6.9507479667663574e-001 + 6.2501090764999390e-001 + <_> + + <_> + + + + <_> + 30 10 3 3 -1. + <_> + 31 10 1 3 3. + 0 + 1.5060020377859473e-003 + -6.8670761585235596e-001 + 8.2241541147232056e-001 + <_> + + <_> + + + + <_> + 21 3 24 4 -1. + <_> + 29 3 8 4 3. + 0 + 1.9838380467263050e-005 + -9.2727631330490112e-001 + 6.4723730087280273e-001 + <_> + + <_> + + + + <_> + 42 3 12 6 -1. + <_> + 46 3 4 6 3. + 0 + -2.2170299416757189e-005 + 5.6555831432342529e-001 + -9.6788132190704346e-001 + -1.4993519783020020e+000 + 7 + -1 + <_> + + + <_> + + <_> + + + + <_> + 56 9 6 6 -1. + <_> + 59 9 3 6 2. + 0 + -1.1395259760320187e-002 + 7.1383631229400635e-001 + -8.7429678440093994e-001 + <_> + + <_> + + + + <_> + 6 4 1 6 -1. + <_> + 6 7 1 3 2. + 0 + -2.1864590235054493e-003 + 8.5311782360076904e-001 + -6.4777731895446777e-001 + <_> + + <_> + + + + <_> + 0 0 12 4 -1. + <_> + 0 0 6 2 2. + <_> + 6 2 6 2 2. + 0 + 2.3193720262497663e-003 + -7.6411879062652588e-001 + 7.1867972612380981e-001 + <_> + + <_> + + + + <_> + 43 12 18 2 -1. + <_> + 52 12 9 2 2. + 0 + -7.9916073009371758e-003 + 6.6442942619323730e-001 + -7.9540950059890747e-001 + <_> + + <_> + + + + <_> + 9 5 2 8 -1. + <_> + 10 5 1 8 2. + 0 + 1.4212740352377295e-003 + -6.3904231786727905e-001 + 7.5050598382949829e-001 + -8.4829801321029663e-001 + 8 + -1 + <_> + + + <_> + + <_> + + + + <_> + 1 9 6 3 -1. + <_> + 3 9 2 3 3. + 0 + 6.4091659151017666e-003 + -8.8425230979919434e-001 + 9.9953681230545044e-001 + <_> + + <_> + + + + <_> + 56 8 2 8 -1. + <_> + 56 12 2 4 2. + 0 + -6.3316390151157975e-004 + 8.3822172880172729e-001 + -9.8322170972824097e-001 + <_> + + <_> + + + + <_> + 24 2 6 13 -1. + <_> + 26 2 2 13 3. + 0 + -6.4947169448714703e-005 + 1. + -9.1822808980941772e-001 + <_> + + <_> + + + + <_> + 33 7 24 4 -1. + <_> + 41 7 8 4 3. + 0 + 5.3404141217470169e-003 + -9.4317251443862915e-001 + 9.0425151586532593e-001 + -6.0007210820913315e-002 + 9 + -1 + <_> + + + <_> + + <_> + + + + <_> + 1 1 57 4 -1. + <_> + 1 3 57 2 2. + 0 + 1.0755469650030136e-001 + -7.1647202968597412e-001 + 8.7827038764953613e-001 + <_> + + <_> + + + + <_> + 0 2 6 14 -1. + <_> + 3 2 3 14 2. + 0 + 3.1668949872255325e-002 + -8.7051069736480713e-001 + 5.8807212114334106e-001 + <_> + + <_> + + + + <_> + 52 3 6 10 -1. + <_> + 54 3 2 10 3. + 0 + -1.0572380386292934e-002 + 6.2438100576400757e-001 + -7.4027371406555176e-001 + <_> + + <_> + + + + <_> + 1 14 61 2 -1. + <_> + 1 15 61 1 2. + 0 + -2.7396259829401970e-002 + 8.9776748418807983e-001 + -5.2986758947372437e-001 + <_> + + <_> + + + + <_> + 28 0 11 12 -1. + <_> + 28 4 11 4 3. + 0 + 2.5918649509549141e-002 + -8.6482518911361694e-001 + 5.3121817111968994e-001 + -9.6125108003616333e-001 + 10 + -1 + <_> + + + <_> + + <_> + + + + <_> + 22 1 41 4 -1. + <_> + 22 3 41 2 2. + 0 + 7.1039132773876190e-002 + -7.5719678401947021e-001 + 7.5645631551742554e-001 + <_> + + <_> + + + + <_> + 41 6 6 8 -1. + <_> + 43 6 2 8 3. + 0 + 7.6241148635745049e-003 + -7.9783838987350464e-001 + 7.1733069419860840e-001 + <_> + + <_> + + + + <_> + 50 9 14 5 -1. + <_> + 57 9 7 5 2. + 0 + -2.7092639356851578e-002 + 6.0071170330047607e-001 + -8.4794402122497559e-001 + <_> + + <_> + + + + <_> + 4 1 12 5 -1. + <_> + 10 1 6 5 2. + 0 + -8.1267888890579343e-004 + 5.9364068508148193e-001 + -8.9295238256454468e-001 + <_> + + <_> + + + + <_> + 37 9 3 3 -1. + <_> + 38 9 1 3 3. + 0 + 8.3705072756856680e-004 + -6.4887362718582153e-001 + 7.8537952899932861e-001 + -1.0618970394134521e+000 + 11 + -1 + <_> + + + <_> + + <_> + + + + <_> + 54 0 10 6 -1. + <_> + 54 0 5 3 2. + <_> + 59 3 5 3 2. + 0 + -9.7556859254837036e-003 + 7.6982218027114868e-001 + -8.5293501615524292e-001 + <_> + + <_> + + + + <_> + 47 0 6 11 -1. + <_> + 49 0 2 11 3. + 0 + -8.6617246270179749e-003 + 8.4029090404510498e-001 + -7.1949690580368042e-001 + <_> + + <_> + + + + <_> + 19 2 20 2 -1. + <_> + 19 3 20 1 2. + 0 + 1.6897840425372124e-002 + -5.3601992130279541e-001 + 9.5484441518783569e-001 + <_> + + <_> + + + + <_> + 14 4 6 11 -1. + <_> + 17 4 3 11 2. + 0 + 4.7526158596156165e-005 + -7.6412862539291382e-001 + 7.5398761034011841e-001 + <_> + + <_> + + + + <_> + 31 9 33 2 -1. + <_> + 42 9 11 2 3. + 0 + 6.5607670694589615e-003 + -9.9346441030502319e-001 + 6.4864277839660645e-001 + -7.3307347297668457e-001 + 12 + -1 + <_> + + + <_> + + <_> + + + + <_> + 6 1 53 6 -1. + <_> + 6 3 53 2 3. + 0 + 1.0103269666433334e-001 + -7.3275578022003174e-001 + 8.4619927406311035e-001 + <_> + + <_> + + + + <_> + 49 9 4 6 -1. + <_> + 49 9 2 3 2. + <_> + 51 12 2 3 2. + 0 + -2.8920811018906534e-004 + 7.1564781665802002e-001 + -8.8221758604049683e-001 + <_> + + <_> + + + + <_> + 0 9 30 7 -1. + <_> + 10 9 10 7 3. + 0 + 1.0838840156793594e-002 + -8.7420248985290527e-001 + 6.0648679733276367e-001 + <_> + + <_> + + + + <_> + 40 4 6 2 -1. + <_> + 42 4 2 2 3. + 0 + 5.0803890917450190e-004 + -9.0554022789001465e-001 + 6.4213967323303223e-001 + <_> + + <_> + + + + <_> + 1 9 6 1 -1. + <_> + 3 9 2 1 3. + 0 + 2.3357039317488670e-003 + -9.2574918270111084e-001 + 8.6384928226470947e-001 + <_> + + <_> + + + + <_> + 47 3 4 10 -1. + <_> + 47 8 4 5 2. + 0 + 8.0239427916239947e-005 + -9.9618428945541382e-001 + 9.5355111360549927e-001 + <_> + + <_> + + + + <_> + 31 5 30 11 -1. + <_> + 41 5 10 11 3. + 0 + 3.2030208967626095e-003 + -1. + 1.0001050233840942e+000 + <_> + + <_> + + + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + 0 + 0. + 0. + -1. + <_> + + <_> + + + + <_> + 21 3 42 5 -1. + <_> + 35 3 14 5 3. + 0 + 2.6143440045416355e-003 + -1. + 1.0002139806747437e+000 + <_> + + <_> + + + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + 0 + 0. + 0. + -1. + <_> + + <_> + + + + <_> + 8 5 30 9 -1. + <_> + 8 8 30 3 3. + 0 + -7.0475979009643197e-004 + 1. + -9.9976968765258789e-001 + <_> + + <_> + + + + <_> + 3 12 33 3 -1. + <_> + 14 12 11 3 3. + 0 + 2.1271279547363520e-003 + -9.9694627523422241e-001 + 1.0002720355987549e+000 + <_> + + <_> + + + + <_> + 0 0 3 2 -1. + <_> + 1 0 1 2 3. + 0 + -2.4224430671893060e-004 + 1. + -1. + <_> + + <_> + + + + <_> + 46 4 3 8 -1. + <_> + 47 4 1 8 3. + 0 + 7.4700301047414541e-004 + -9.9108231067657471e-001 + 9.9941182136535645e-001 + -1.0991690158843994e+000 + 13 + -1 + <_> + + + <_> + + <_> + + + + <_> + 1 2 6 5 -1. + <_> + 3 2 2 5 3. + 0 + 1.7227890202775598e-003 + -9.3608891963958740e-001 + 8.7251222133636475e-001 + <_> + + <_> + + + + <_> + 0 3 18 5 -1. + <_> + 6 3 6 5 3. + 0 + 2.7599320746958256e-003 + -9.9757021665573120e-001 + 1.0000289678573608e+000 + <_> + + <_> + + + + <_> + 3 1 6 14 -1. + <_> + 6 1 3 14 2. + 0 + -8.9444358309265226e-005 + 1. + -9.9264812469482422e-001 + <_> + + <_> + + + + <_> + 3 6 2 10 -1. + <_> + 3 11 2 5 2. + 0 + -2.7962020249105990e-004 + 8.2833290100097656e-001 + -9.8444151878356934e-001 + <_> + + <_> + + + + <_> + 42 0 4 6 -1. + <_> + 42 0 2 3 2. + <_> + 44 3 2 3 2. + 0 + -2.7560539820115082e-005 + 1. + -9.9543339014053345e-001 + -9.1314977407455444e-001 + 14 + -1 + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_lowerbody.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_lowerbody.xml new file mode 100644 index 0000000000000000000000000000000000000000..7fa27c7e2a082ad035c9f64c815eeb0dd104d544 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_lowerbody.xml @@ -0,0 +1,14056 @@ + + + +BOOST + HAAR + 23 + 19 + + 89 + + 0 + 27 + + <_> + 17 + -1.4308550357818604e+00 + + <_> + + 0 -1 0 -1.6869869083166122e-02 + + 5.4657417535781860e-01 -6.3678038120269775e-01 + <_> + + 0 -1 1 2.5349899660795927e-03 + + -3.7605491280555725e-01 3.2378101348876953e-01 + <_> + + 0 -1 2 -2.4709459394216537e-02 + + -6.7979127168655396e-01 2.0501059293746948e-01 + <_> + + 0 -1 3 8.2436859607696533e-02 + + 2.0588639378547668e-01 -8.4938430786132812e-01 + <_> + + 0 -1 4 -8.2128931535407901e-04 + + 3.1891921162605286e-01 -4.6469458937644958e-01 + <_> + + 0 -1 5 2.3016959428787231e-02 + + 1.8670299649238586e-01 -7.0330899953842163e-01 + <_> + + 0 -1 6 6.6386149264872074e-03 + + 1.6370490193367004e-01 -8.4604722261428833e-01 + <_> + + 0 -1 7 7.6682120561599731e-04 + + -3.9852690696716309e-01 2.3113329708576202e-01 + <_> + + 0 -1 8 1.1731679737567902e-01 + + 1.0445039719343185e-01 -8.8510942459106445e-01 + <_> + + 0 -1 9 1.5421230345964432e-02 + + -2.7859508991241455e-01 2.8921920061111450e-01 + <_> + + 0 -1 10 3.4018948674201965e-02 + + -1.4287669956684113e-01 7.7801531553268433e-01 + <_> + + 0 -1 11 3.4638870507478714e-02 + + 1.8644079566001892e-01 -6.0324841737747192e-01 + <_> + + 0 -1 12 -3.7503659725189209e-01 + + 9.2781841754913330e-01 -1.5421600639820099e-01 + <_> + + 0 -1 13 -5.6011971086263657e-02 + + -5.8591067790985107e-01 1.9547510147094727e-01 + <_> + + 0 -1 14 -1.4878909569233656e-03 + + 2.8139349818229675e-01 -4.1853010654449463e-01 + <_> + + 0 -1 15 -1.4495699666440487e-02 + + -7.2273969650268555e-01 9.4288460910320282e-02 + <_> + + 0 -1 16 -5.6178281083703041e-03 + + -5.9551960229873657e-01 1.5202650427818298e-01 + <_> + 13 + -1.1907930374145508e+00 + + <_> + + 0 -1 17 -3.1839120201766491e-03 + + 4.0025138854980469e-01 -6.8473160266876221e-01 + <_> + + 0 -1 18 3.5989920143038034e-03 + + -5.1895952224731445e-01 3.0101141333580017e-01 + <_> + + 0 -1 19 1.8804630264639854e-02 + + 1.5554919838905334e-01 -8.0477172136306763e-01 + <_> + + 0 -1 20 5.2497140131890774e-03 + + 1.3780809938907623e-01 -6.0767507553100586e-01 + <_> + + 0 -1 21 -1.4204799663275480e-03 + + 3.2319429516792297e-01 -4.3407461047172546e-01 + <_> + + 0 -1 22 -2.5174349546432495e-02 + + -7.0780879259109497e-01 9.3106329441070557e-02 + <_> + + 0 -1 23 3.2285219058394432e-03 + + -3.2510471343994141e-01 3.3571699261665344e-01 + <_> + + 0 -1 24 9.4993412494659424e-02 + + 8.2439087331295013e-02 -8.7549537420272827e-01 + <_> + + 0 -1 25 -6.5919090993702412e-03 + + -7.3804199695587158e-01 1.3853749632835388e-01 + <_> + + 0 -1 26 -1.1146620381623507e-03 + + 1.7917269468307495e-01 -2.7955859899520874e-01 + <_> + + 0 -1 27 1.3349019922316074e-02 + + 1.3057829439640045e-01 -6.9802671670913696e-01 + <_> + + 0 -1 28 -3.5181451588869095e-02 + + 4.6535360813140869e-01 -1.0698779672384262e-01 + <_> + + 0 -1 29 3.1874589622020721e-02 + + -1.3565389811992645e-01 7.9047888517379761e-01 + <_> + 19 + -1.3129220008850098e+00 + + <_> + + 0 -1 30 -1.0647430084645748e-02 + + 3.8079029321670532e-01 -5.8672338724136353e-01 + <_> + + 0 -1 31 -7.3214493691921234e-02 + + -7.9550951719284058e-01 1.7223259806632996e-01 + <_> + + 0 -1 32 6.0464427806437016e-03 + + 1.6532160341739655e-01 -6.9376647472381592e-01 + <_> + + 0 -1 33 7.3225022060796618e-04 + + -3.3247160911560059e-01 2.3669970035552979e-01 + <_> + + 0 -1 34 -1.0990080423653126e-02 + + -6.9136887788772583e-01 2.1058270335197449e-01 + <_> + + 0 -1 35 -1.5282750246115029e-04 + + 2.0305849611759186e-01 -4.6551659703254700e-01 + <_> + + 0 -1 36 2.4822261184453964e-04 + + -4.2122921347618103e-01 2.7335309982299805e-01 + <_> + + 0 -1 37 -8.4205856546759605e-03 + + -4.3744468688964844e-01 5.8831848204135895e-02 + <_> + + 0 -1 38 -3.6992791295051575e-01 + + 9.1070818901062012e-01 -8.7207540869712830e-02 + <_> + + 0 -1 39 6.1259930953383446e-03 + + 1.1886730045080185e-01 -1.8520170450210571e-01 + <_> + + 0 -1 40 -6.0144090093672276e-03 + + -6.3057059049606323e-01 1.4577180147171021e-01 + <_> + + 0 -1 41 8.5623031482100487e-03 + + -2.9369381070137024e-01 3.2411348819732666e-01 + <_> + + 0 -1 42 -1.3966850005090237e-02 + + -8.0650371313095093e-01 1.1267790198326111e-01 + <_> + + 0 -1 43 -4.1734468191862106e-02 + + 7.7495330572128296e-01 -7.8866302967071533e-02 + <_> + + 0 -1 44 -2.7996799326501787e-04 + + 2.7783310413360596e-01 -3.5196089744567871e-01 + <_> + + 0 -1 45 1.9588569179177284e-02 + + -6.5759636461734772e-02 5.2414137125015259e-01 + <_> + + 0 -1 46 9.2163113877177238e-03 + + -1.5525479614734650e-01 5.4835391044616699e-01 + <_> + + 0 -1 47 -2.1458569914102554e-02 + + -5.2255308628082275e-01 8.2208268344402313e-02 + <_> + + 0 -1 48 3.6805770359933376e-03 + + -2.4434129893779755e-01 3.6122488975524902e-01 + <_> + 23 + -1.3777279853820801e+00 + + <_> + + 0 -1 49 -8.3544738590717316e-03 + + 2.8173181414604187e-01 -4.9728131294250488e-01 + <_> + + 0 -1 50 -5.5724289268255234e-03 + + -6.5505301952362061e-01 1.9406059384346008e-01 + <_> + + 0 -1 51 -5.7714767754077911e-03 + + -6.2230938673019409e-01 2.7622398734092712e-01 + <_> + + 0 -1 52 2.2995889186859131e-02 + + 1.9798569381237030e-02 -7.8324538469314575e-01 + <_> + + 0 -1 53 -1.1443760013207793e-03 + + 2.8108718991279602e-01 -4.8214849829673767e-01 + <_> + + 0 -1 54 -2.5917509198188782e-01 + + -6.8214958906173706e-01 -3.3729869755916297e-04 + <_> + + 0 -1 55 -3.0133039690554142e-03 + + -6.5704411268234253e-01 1.3693599402904510e-01 + <_> + + 0 -1 56 5.4540671408176422e-03 + + 8.6931817233562469e-02 -7.0567971467971802e-01 + <_> + + 0 -1 57 6.6230311058461666e-03 + + 1.6634289920330048e-01 -5.1772958040237427e-01 + <_> + + 0 -1 58 -1.2561669573187828e-02 + + 9.0290471911430359e-02 -1.6850970685482025e-01 + <_> + + 0 -1 59 4.2890738695859909e-02 + + 1.2977810204029083e-01 -5.8218061923980713e-01 + <_> + + 0 -1 60 -1.3341030571609735e-03 + + 1.3694329559803009e-01 -1.9437809288501740e-01 + <_> + + 0 -1 61 -4.1247460991144180e-02 + + 6.8543851375579834e-01 -1.3039450347423553e-01 + <_> + + 0 -1 62 -9.1503392904996872e-03 + + -1.1895430088043213e-01 6.7576698958873749e-02 + <_> + + 0 -1 63 -1.7151240026578307e-03 + + 2.6475539803504944e-01 -3.0487450957298279e-01 + <_> + + 0 -1 64 2.0843200385570526e-01 + + 1.2401489913463593e-01 -4.7014111280441284e-01 + <_> + + 0 -1 65 7.2393968701362610e-02 + + 9.6924379467964172e-02 -7.7347749471664429e-01 + <_> + + 0 -1 66 -1.5335980569943786e-03 + + 1.7991219460964203e-01 -2.5788331031799316e-01 + <_> + + 0 -1 67 4.8640500754117966e-03 + + 1.1392980068922043e-01 -5.5173867940902710e-01 + <_> + + 0 -1 68 -1.6523050144314766e-03 + + 1.5154689550399780e-01 -2.2901679575443268e-01 + <_> + + 0 -1 69 7.5348757207393646e-02 + + -1.4630889892578125e-01 6.8105882406234741e-01 + <_> + + 0 -1 70 -8.2630068063735962e-03 + + -7.2783601284027100e-01 1.0281019657850266e-01 + <_> + + 0 -1 71 -5.5124741047620773e-03 + + -6.3059347867965698e-01 9.3257799744606018e-02 + <_> + 15 + -1.0618749856948853e+00 + + <_> + + 0 -1 72 -9.3849105760455132e-03 + + 5.2500581741333008e-01 -4.3231061100959778e-01 + <_> + + 0 -1 73 -1.3772470410913229e-03 + + 2.0698480308055878e-01 -4.2718759179115295e-01 + <_> + + 0 -1 74 2.6320109143853188e-02 + + 1.5825170278549194e-01 -6.5509521961212158e-01 + <_> + + 0 -1 75 -4.5488759875297546e-02 + + -4.9510109424591064e-01 1.7998820543289185e-01 + <_> + + 0 -1 76 -4.7006201930344105e-03 + + 3.3971160650253296e-01 -3.6917701363563538e-01 + <_> + + 0 -1 77 -1.3270860072225332e-03 + + 3.0907860398292542e-01 -1.9771750271320343e-01 + <_> + + 0 -1 78 9.3802614137530327e-03 + + 9.4488449394702911e-02 -7.3198097944259644e-01 + <_> + + 0 -1 79 4.3565612286329269e-03 + + 1.1520200222730637e-01 -5.4008102416992188e-01 + <_> + + 0 -1 80 8.1178937107324600e-03 + + -1.5956309437751770e-01 5.3777867555618286e-01 + <_> + + 0 -1 81 -8.7829083204269409e-03 + + 5.6634718179702759e-01 -1.3279379904270172e-01 + <_> + + 0 -1 82 2.1944850683212280e-02 + + 1.5901289880275726e-01 -5.1751822233200073e-01 + <_> + + 0 -1 83 4.9510098993778229e-02 + + 1.1067640036344528e-02 -4.9972468614578247e-01 + <_> + + 0 -1 84 -2.1175360307097435e-03 + + 2.6490759849548340e-01 -2.4565629661083221e-01 + <_> + + 0 -1 85 1.0379469953477383e-02 + + 1.2624099850654602e-01 -4.0877240896224976e-01 + <_> + + 0 -1 86 2.4977258872240782e-03 + + -1.9723020493984222e-01 3.8866749405860901e-01 + <_> + 18 + -9.5461457967758179e-01 + + <_> + + 0 -1 87 -6.1489548534154892e-03 + + 4.0187481045722961e-01 -5.2397370338439941e-01 + <_> + + 0 -1 88 5.0464540719985962e-02 + + 1.3049679994583130e-01 -5.8651441335678101e-01 + <_> + + 0 -1 89 -5.5906269699335098e-02 + + -5.1229542493820190e-01 2.4392889440059662e-01 + <_> + + 0 -1 90 1.4281509816646576e-01 + + -1.5180160291492939e-02 -6.9593918323516846e-01 + <_> + + 0 -1 91 4.1162770241498947e-02 + + 1.3673730194568634e-01 -6.4158838987350464e-01 + <_> + + 0 -1 92 -1.6468750312924385e-02 + + 2.6339039206504822e-01 -2.2083680331707001e-01 + <_> + + 0 -1 93 2.4763140827417374e-02 + + 1.0897739976644516e-01 -6.5213900804519653e-01 + <_> + + 0 -1 94 4.3008858337998390e-03 + + -1.8299630284309387e-01 4.3614229559898376e-01 + <_> + + 0 -1 95 3.4035290591418743e-03 + + -2.4363580346107483e-01 2.8224369883537292e-01 + <_> + + 0 -1 96 -2.2210620343685150e-02 + + -5.4645758867263794e-01 1.3542969524860382e-01 + <_> + + 0 -1 97 -2.6968019083142281e-02 + + 6.5300947427749634e-01 -1.4297309517860413e-01 + <_> + + 0 -1 98 -3.4927908331155777e-02 + + -5.2346628904342651e-01 1.0084570199251175e-01 + <_> + + 0 -1 99 3.6263581365346909e-02 + + 1.5110149979591370e-01 -5.4185849428176880e-01 + <_> + + 0 -1 100 -3.8526788353919983e-02 + + -8.6942279338836670e-01 3.7176769226789474e-02 + <_> + + 0 -1 101 2.5399168953299522e-03 + + -2.6125881075859070e-01 2.7278441190719604e-01 + <_> + + 0 -1 102 -1.2931150384247303e-02 + + -4.9501579999923706e-01 9.1383516788482666e-02 + <_> + + 0 -1 103 1.1981350369751453e-02 + + -1.2059610337018967e-01 6.3848638534545898e-01 + <_> + + 0 -1 104 -7.4320413172245026e-02 + + 4.6591779589653015e-01 -4.0265668183565140e-02 + <_> + 14 + -1.1777880191802979e+00 + + <_> + + 0 -1 105 -6.9070039317011833e-03 + + 4.3197679519653320e-01 -5.1717847585678101e-01 + <_> + + 0 -1 106 -8.1628039479255676e-03 + + 2.7116540074348450e-01 -3.2803410291671753e-01 + <_> + + 0 -1 107 1.8852509558200836e-02 + + 1.5548799932003021e-01 -5.5243927240371704e-01 + <_> + + 0 -1 108 3.4079391509294510e-02 + + 1.5272259712219238e-01 -6.5318012237548828e-01 + <_> + + 0 -1 109 -3.2038250938057899e-03 + + 3.4725460410118103e-01 -2.7734228968620300e-01 + <_> + + 0 -1 110 2.1410689223557711e-03 + + -6.8888276815414429e-02 2.4079489707946777e-01 + <_> + + 0 -1 111 1.4620450139045715e-01 + + 1.5766879916191101e-01 -5.4515862464904785e-01 + <_> + + 0 -1 112 -6.2386798672378063e-03 + + 3.2899579405784607e-01 -1.6970640420913696e-01 + <_> + + 0 -1 113 7.7623138204216957e-03 + + 1.6352510452270508e-01 -5.1879328489303589e-01 + <_> + + 0 -1 114 3.7800080608576536e-03 + + -1.8464370071887970e-01 4.8660078644752502e-01 + <_> + + 0 -1 115 2.2303969599306583e-03 + + -1.7057199776172638e-01 4.7744798660278320e-01 + <_> + + 0 -1 116 2.4544890038669109e-03 + + -3.3550649881362915e-01 2.5369268655776978e-01 + <_> + + 0 -1 117 -2.1707419306039810e-02 + + -4.8321890830993652e-01 1.6075029969215393e-01 + <_> + + 0 -1 118 1.7421970143914223e-02 + + 7.9877912998199463e-02 -7.5137257575988770e-01 + <_> + 34 + -1.2834340333938599e+00 + + <_> + + 0 -1 119 8.8802073150873184e-03 + + -4.4682410359382629e-01 2.6062530279159546e-01 + <_> + + 0 -1 120 -3.0198058811947703e-04 + + 1.5258400142192841e-01 -3.5206508636474609e-01 + <_> + + 0 -1 121 6.7998501472175121e-03 + + 1.2259320169687271e-01 -6.8427437543869019e-01 + <_> + + 0 -1 122 2.7802670374512672e-03 + + -3.3681631088256836e-01 1.8518559634685516e-01 + <_> + + 0 -1 123 -1.1553820222616196e-02 + + -6.9871348142623901e-01 1.3079600036144257e-01 + <_> + + 0 -1 124 -2.6563290506601334e-02 + + -7.0277881622314453e-01 1.7791330814361572e-02 + <_> + + 0 -1 125 -2.5158381322398782e-04 + + 2.4779480695724487e-01 -3.9787930250167847e-01 + <_> + + 0 -1 126 3.5748310387134552e-02 + + -3.8043439388275146e-02 4.7976261377334595e-01 + <_> + + 0 -1 127 -1.9973930902779102e-03 + + 2.5774869322776794e-01 -3.1990098953247070e-01 + <_> + + 0 -1 128 -1.1007110029459000e-01 + + -4.9102869629859924e-01 2.3104630410671234e-02 + <_> + + 0 -1 129 -2.2225650027394295e-03 + + 2.3825299739837646e-01 -2.8415530920028687e-01 + <_> + + 0 -1 130 -7.7874241396784782e-03 + + -3.8951370120048523e-01 5.5762890726327896e-02 + <_> + + 0 -1 131 5.6415859609842300e-02 + + -9.3521721661090851e-02 7.2561162710189819e-01 + <_> + + 0 -1 132 -3.5978010855615139e-03 + + 1.9452190399169922e-01 -1.9651280343532562e-01 + <_> + + 0 -1 133 -7.2716898284852505e-03 + + 3.4169870615005493e-01 -2.2851559519767761e-01 + <_> + + 0 -1 134 7.1941758506000042e-03 + + 7.2148866951465607e-02 -4.5313501358032227e-01 + <_> + + 0 -1 135 -4.1034761816263199e-03 + + -5.1336747407913208e-01 1.3323569297790527e-01 + <_> + + 0 -1 136 -3.4210970625281334e-03 + + -4.2383781075477600e-01 8.4852807223796844e-02 + <_> + + 0 -1 137 4.1890922002494335e-03 + + -1.3398550450801849e-01 4.3749558925628662e-01 + <_> + + 0 -1 138 1.1827970156446099e-03 + + -2.9739010334014893e-01 2.2126840054988861e-01 + <_> + + 0 -1 139 -4.1196551173925400e-02 + + -5.0735759735107422e-01 1.3243959844112396e-01 + <_> + + 0 -1 140 2.9593890067189932e-03 + + -1.4052620530128479e-01 6.1360880732536316e-02 + <_> + + 0 -1 141 -5.0226859748363495e-03 + + -4.7495970129966736e-01 1.2069150060415268e-01 + <_> + + 0 -1 142 -1.5097860246896744e-02 + + 2.7555391192436218e-01 -5.3780451416969299e-02 + <_> + + 0 -1 143 -2.7190970256924629e-02 + + 7.5995457172393799e-01 -7.4793189764022827e-02 + <_> + + 0 -1 144 1.9893879070878029e-02 + + -6.7238640040159225e-03 7.3972767591476440e-01 + <_> + + 0 -1 145 7.7208830043673515e-03 + + 9.3071162700653076e-02 -6.5780252218246460e-01 + <_> + + 0 -1 146 -1.1565990280359983e-03 + + 9.4645917415618896e-02 -1.6407909989356995e-01 + <_> + + 0 -1 147 2.6069190353155136e-03 + + -1.3877980411052704e-01 4.7349870204925537e-01 + <_> + + 0 -1 148 -5.3586110472679138e-02 + + -3.7349641323089600e-01 2.5728559121489525e-02 + <_> + + 0 -1 149 1.5184599906206131e-03 + + -2.2478710114955902e-01 2.3574599623680115e-01 + <_> + + 0 -1 150 -3.7061560899019241e-02 + + -6.1827117204666138e-01 8.2348063588142395e-02 + <_> + + 0 -1 151 -2.6311799883842468e-02 + + -6.0057657957077026e-01 7.7768869698047638e-02 + <_> + + 0 -1 152 -8.7947428226470947e-02 + + 3.8841038942337036e-01 -8.1545598804950714e-02 + <_> + 20 + -1.2891789674758911e+00 + + <_> + + 0 -1 153 -2.9038030654191971e-02 + + 5.0635957717895508e-01 -4.3462699651718140e-01 + <_> + + 0 -1 154 3.9044669829308987e-03 + + -1.9009789824485779e-01 5.1840317249298096e-01 + <_> + + 0 -1 155 2.9162769205868244e-03 + + -3.4351310133934021e-01 2.4016310274600983e-01 + <_> + + 0 -1 156 -8.9670084416866302e-03 + + -4.2667150497436523e-01 1.2316550314426422e-01 + <_> + + 0 -1 157 -2.4935540277510881e-03 + + 3.6086550354957581e-01 -1.8381460011005402e-01 + <_> + + 0 -1 158 -4.8912568017840385e-03 + + -6.4749848842620850e-01 1.0856709629297256e-01 + <_> + + 0 -1 159 -4.0970719419419765e-03 + + 2.2143830358982086e-01 -3.1505578756332397e-01 + <_> + + 0 -1 160 4.3956499546766281e-02 + + -1.0780169814825058e-01 7.1893501281738281e-01 + <_> + + 0 -1 161 1.9277370302006602e-03 + + 2.0247739553451538e-01 -4.0381088852882385e-01 + <_> + + 0 -1 162 9.4976946711540222e-03 + + 4.3494019657373428e-02 -2.9908061027526855e-01 + <_> + + 0 -1 163 3.5389279946684837e-03 + + -1.5109489858150482e-01 5.1864242553710938e-01 + <_> + + 0 -1 164 -2.2064079530537128e-03 + + 2.3006440699100494e-01 -3.3191001415252686e-01 + <_> + + 0 -1 165 3.9085410535335541e-03 + + -3.4253311157226562e-01 2.2951880097389221e-01 + <_> + + 0 -1 166 2.6973709464073181e-03 + + 1.1976680159568787e-01 -3.5321989655494690e-01 + <_> + + 0 -1 167 -2.1321459207683802e-03 + + 1.8206289410591125e-01 -2.8434100747108459e-01 + <_> + + 0 -1 168 2.6955150533467531e-03 + + 7.4593842029571533e-02 -3.0896648764610291e-01 + <_> + + 0 -1 169 -6.0222679749131203e-03 + + 1.8041500449180603e-01 -2.7531668543815613e-01 + <_> + + 0 -1 170 -8.9143458753824234e-03 + + 2.4166099727153778e-01 -1.4506129920482635e-01 + <_> + + 0 -1 171 2.3474939167499542e-02 + + -1.2354619801044464e-01 6.5625041723251343e-01 + <_> + + 0 -1 172 -5.6602950207889080e-03 + + -3.3785250782966614e-01 1.1194559931755066e-01 + <_> + 20 + -1.0202569961547852e+00 + + <_> + + 0 -1 173 -6.9699093699455261e-02 + + 5.0786459445953369e-01 -4.7562688589096069e-01 + <_> + + 0 -1 174 2.1672779694199562e-02 + + -2.9134199023246765e-01 3.4561529755592346e-01 + <_> + + 0 -1 175 -4.7600260004401207e-03 + + 3.6477440595626831e-01 -1.9551509618759155e-01 + <_> + + 0 -1 176 -4.6418169513344765e-03 + + -5.6445592641830444e-01 9.8486669361591339e-02 + <_> + + 0 -1 177 -6.0006938874721527e-03 + + -6.3645982742309570e-01 1.4379170536994934e-01 + <_> + + 0 -1 178 1.9073469564318657e-02 + + -3.4218288958072662e-02 5.5043292045593262e-01 + <_> + + 0 -1 179 4.7993380576372147e-02 + + -8.5889510810375214e-02 7.6790231466293335e-01 + <_> + + 0 -1 180 -3.6511209327727556e-03 + + 2.0186069607734680e-01 -2.9832679033279419e-01 + <_> + + 0 -1 181 -1.4485770370811224e-03 + + -5.1293247938156128e-01 1.3695690035820007e-01 + <_> + + 0 -1 182 -3.3748829737305641e-03 + + -4.0975129604339600e-01 1.1581440269947052e-01 + <_> + + 0 -1 183 2.3586750030517578e-03 + + 1.7582429945468903e-01 -4.5439630746841431e-01 + <_> + + 0 -1 184 -2.2074829787015915e-02 + + 4.6775639057159424e-01 -4.6358831226825714e-02 + <_> + + 0 -1 185 7.0953248068690300e-03 + + -3.2100531458854675e-01 2.2119350731372833e-01 + <_> + + 0 -1 186 -2.0119780674576759e-03 + + 5.4601740092039108e-02 -9.7853101789951324e-02 + <_> + + 0 -1 187 4.9847508780658245e-03 + + -1.3063269853591919e-01 5.2815079689025879e-01 + <_> + + 0 -1 188 -5.3485459648072720e-03 + + -4.2115539312362671e-01 1.1927159875631332e-01 + <_> + + 0 -1 189 2.5243330746889114e-03 + + 1.2105660140514374e-01 -4.5177119970321655e-01 + <_> + + 0 -1 190 -2.4893151130527258e-03 + + 1.2249600142240524e-01 -1.1200980097055435e-01 + <_> + + 0 -1 191 4.3740491382777691e-03 + + -1.0549320280551910e-01 6.0806149244308472e-01 + <_> + + 0 -1 192 -7.3214988224208355e-03 + + 4.7615110874176025e-01 -6.8390920758247375e-02 + <_> + 24 + -1.0336159467697144e+00 + + <_> + + 0 -1 193 -4.2286239564418793e-02 + + 3.6749860644340515e-01 -4.3680980801582336e-01 + <_> + + 0 -1 194 3.8884699344635010e-02 + + -3.5438889265060425e-01 2.7009218931198120e-01 + <_> + + 0 -1 195 1.5983959892764688e-03 + + -3.2200628519058228e-01 2.5404900312423706e-01 + <_> + + 0 -1 196 3.9249849505722523e-03 + + 1.6477300226688385e-01 -4.2043879628181458e-01 + <_> + + 0 -1 197 1.5850430354475975e-03 + + -2.5503370165824890e-01 3.1559389829635620e-01 + <_> + + 0 -1 198 -3.4282119013369083e-03 + + -4.0074288845062256e-01 1.1993350088596344e-01 + <_> + + 0 -1 199 -3.3538821153342724e-03 + + 3.0459630489349365e-01 -2.2311030328273773e-01 + <_> + + 0 -1 200 -6.7664748057723045e-03 + + 3.2396519184112549e-01 -9.2932380735874176e-02 + <_> + + 0 -1 201 -6.7180307814851403e-04 + + -3.2457518577575684e-01 2.1808999776840210e-01 + <_> + + 0 -1 202 2.8931829147040844e-03 + + 1.2530609965324402e-01 -4.8582470417022705e-01 + <_> + + 0 -1 203 -3.3115309197455645e-03 + + 4.0534108877182007e-01 -2.2432869672775269e-01 + <_> + + 0 -1 204 8.8509041815996170e-03 + + 1.2155570089817047e-01 -6.0243481397628784e-01 + <_> + + 0 -1 205 5.4662628099322319e-03 + + -1.6978119313716888e-01 4.0752619504928589e-01 + <_> + + 0 -1 206 4.7559391707181931e-02 + + -8.1737041473388672e-02 6.9865119457244873e-01 + <_> + + 0 -1 207 3.1745019368827343e-03 + + 1.7419810593128204e-01 -3.7237030267715454e-01 + <_> + + 0 -1 208 -5.1520839333534241e-03 + + 2.7799358963966370e-01 -2.5311779975891113e-01 + <_> + + 0 -1 209 -4.8141111619770527e-03 + + -5.8466029167175293e-01 1.5894299745559692e-01 + <_> + + 0 -1 210 2.1967150270938873e-02 + + -1.0052759945392609e-01 4.7374871373176575e-01 + <_> + + 0 -1 211 -6.0128211043775082e-03 + + 1.9820199906826019e-01 -4.2172819375991821e-01 + <_> + + 0 -1 212 4.5052049681544304e-03 + + 1.7064809799194336e-02 -4.8947790265083313e-01 + <_> + + 0 -1 213 -1.3302109437063336e-03 + + 1.8670339882373810e-01 -2.9437661170959473e-01 + <_> + + 0 -1 214 -7.3667510878294706e-04 + + -1.4788800477981567e-01 1.0121300071477890e-01 + <_> + + 0 -1 215 -1.4602739829570055e-03 + + -4.3107959628105164e-01 1.2479860335588455e-01 + <_> + + 0 -1 216 3.4185629338026047e-02 + + -5.7933650910854340e-02 5.4917758703231812e-01 + <_> + 33 + -1.0450899600982666e+00 + + <_> + + 0 -1 217 3.0665110796689987e-02 + + -3.9953279495239258e-01 3.3617529273033142e-01 + <_> + + 0 -1 218 2.8893710114061832e-03 + + -3.8745269179344177e-01 3.0567520856857300e-01 + <_> + + 0 -1 219 -1.1876110220327973e-03 + + 2.2150239348411560e-01 -2.9632321000099182e-01 + <_> + + 0 -1 220 4.0173018351197243e-03 + + 1.3102529942989349e-01 -4.8803418874740601e-01 + <_> + + 0 -1 221 4.4870697893202305e-03 + + -3.3282509446144104e-01 1.6376070678234100e-01 + <_> + + 0 -1 222 3.2539520412683487e-02 + + -5.9164509177207947e-02 6.9953370094299316e-01 + <_> + + 0 -1 223 -8.9682880789041519e-03 + + -5.6289541721343994e-01 1.1756320297718048e-01 + <_> + + 0 -1 224 -6.1743397964164615e-04 + + 1.5408250689506531e-01 -2.7350011467933655e-01 + <_> + + 0 -1 225 -3.1031211256049573e-04 + + 1.8013550341129303e-01 -3.7572589516639709e-01 + <_> + + 0 -1 226 2.8775030747056007e-02 + + -3.4200929105281830e-02 2.7645361423492432e-01 + <_> + + 0 -1 227 -6.1647972324863076e-04 + + 1.7953120172023773e-01 -3.5178318619728088e-01 + <_> + + 0 -1 228 2.1818219684064388e-03 + + -1.4532999694347382e-01 1.4900140464305878e-01 + <_> + + 0 -1 229 -2.4263889063149691e-03 + + -4.6981298923492432e-01 9.5262229442596436e-02 + <_> + + 0 -1 230 2.5438209995627403e-02 + + -2.1531460806727409e-02 3.3266928791999817e-01 + <_> + + 0 -1 231 7.9593079863116145e-04 + + 1.2254969775676727e-01 -3.5679769515991211e-01 + <_> + + 0 -1 232 5.6763447355479002e-04 + + -1.3694189488887787e-01 1.0818839818239212e-01 + <_> + + 0 -1 233 8.7481308728456497e-03 + + -9.0849868953227997e-02 5.0112378597259521e-01 + <_> + + 0 -1 234 -4.7468831762671471e-03 + + 1.1629249900579453e-01 -1.4651729725301266e-02 + <_> + + 0 -1 235 3.0644210055470467e-03 + + -2.2739639878273010e-01 2.7780678868293762e-01 + <_> + + 0 -1 236 3.1514191068708897e-03 + + 3.5710681229829788e-02 -3.2296779751777649e-01 + <_> + + 0 -1 237 -3.8335900753736496e-03 + + -4.8395419120788574e-01 9.2689603567123413e-02 + <_> + + 0 -1 238 -3.6972409579902887e-03 + + 1.6351610422134399e-01 -1.4657320082187653e-01 + <_> + + 0 -1 239 6.7644561640918255e-03 + + 8.0342940986156464e-02 -5.0272989273071289e-01 + <_> + + 0 -1 240 5.7455507339909673e-04 + + -1.9531010091304779e-01 1.2394949793815613e-01 + <_> + + 0 -1 241 1.0008309967815876e-02 + + -1.5030139684677124e-01 2.7990019321441650e-01 + <_> + + 0 -1 242 -7.2150952182710171e-03 + + 1.6882060468196869e-01 -1.2279219925403595e-01 + <_> + + 0 -1 243 1.1310850270092487e-02 + + -9.6786908805370331e-02 6.4601618051528931e-01 + <_> + + 0 -1 244 1.0049899667501450e-01 + + 2.0610159263014793e-02 -9.9988579750061035e-01 + <_> + + 0 -1 245 1.3250860385596752e-02 + + 9.3147717416286469e-02 -4.8156800866127014e-01 + <_> + + 0 -1 246 -3.9085310697555542e-01 + + 7.1057820320129395e-01 -1.6548840329051018e-02 + <_> + + 0 -1 247 2.4332199245691299e-02 + + 1.4528210461139679e-01 -2.8366720676422119e-01 + <_> + + 0 -1 248 1.0354409459978342e-03 + + -2.0017370581626892e-01 1.8794250488281250e-01 + <_> + + 0 -1 249 -7.1747899055480957e-01 + + 6.6637128591537476e-01 -5.2656259387731552e-02 + <_> + 42 + -1.0599969625473022e+00 + + <_> + + 0 -1 250 1.9620559178292751e-03 + + -4.1077700257301331e-01 1.8896859884262085e-01 + <_> + + 0 -1 251 2.1331369876861572e-02 + + 9.2599019408226013e-02 -3.9660450816154480e-01 + <_> + + 0 -1 252 -2.3037450388073921e-02 + + -7.2293937206268311e-01 9.6411719918251038e-02 + <_> + + 0 -1 253 -5.0521228462457657e-02 + + 1.8302009999752045e-01 -1.9482779502868652e-01 + <_> + + 0 -1 254 2.5330919772386551e-02 + + 1.0334759950637817e-01 -5.8018290996551514e-01 + <_> + + 0 -1 255 -4.3120220652781427e-04 + + 1.3374519348144531e-01 -2.1300980448722839e-01 + <_> + + 0 -1 256 -1.4295669643615838e-05 + + 1.8420490622520447e-01 -3.0300238728523254e-01 + <_> + + 0 -1 257 -2.8645719867199659e-03 + + 1.7371790111064911e-01 -2.1612820029258728e-01 + <_> + + 0 -1 258 1.0322510264813900e-02 + + 1.1071330308914185e-01 -4.2402949929237366e-01 + <_> + + 0 -1 259 1.3879509642720222e-02 + + -1.0993299633264542e-01 5.5458897352218628e-01 + <_> + + 0 -1 260 -1.7010340234264731e-03 + + -3.1409528851509094e-01 1.5474779903888702e-01 + <_> + + 0 -1 261 -2.7375848731026053e-04 + + 1.4674690365791321e-01 -1.2817619740962982e-01 + <_> + + 0 -1 262 3.9977379143238068e-02 + + -6.3540339469909668e-02 6.0685801506042480e-01 + <_> + + 0 -1 263 -1.2663399800658226e-02 + + 1.0982260107994080e-01 -1.2707209587097168e-01 + <_> + + 0 -1 264 1.0186760127544403e-01 + + 8.8505871593952179e-02 -5.7165622711181641e-01 + <_> + + 0 -1 265 -1.0695089586079121e-03 + + 3.4594889730215073e-02 -9.9618308246135712e-02 + <_> + + 0 -1 266 -3.4467370714992285e-03 + + 2.2871519625186920e-01 -1.9664469361305237e-01 + <_> + + 0 -1 267 -1.2329400330781937e-01 + + -1.0825649648904800e-01 2.4728389456868172e-02 + <_> + + 0 -1 268 -5.8832589536905289e-02 + + 5.5791580677032471e-01 -7.7630676329135895e-02 + <_> + + 0 -1 269 9.7795920446515083e-03 + + 9.4951488077640533e-02 -5.3767371177673340e-01 + <_> + + 0 -1 270 1.1116569861769676e-02 + + -8.9288607239723206e-02 4.6695429086685181e-01 + <_> + + 0 -1 271 -1.5398260205984116e-02 + + 9.0432487428188324e-02 -1.2233799695968628e-01 + <_> + + 0 -1 272 5.8570769615471363e-03 + + 1.0859709978103638e-01 -4.0961760282516479e-01 + <_> + + 0 -1 273 6.6174753010272980e-02 + + -4.4282642193138599e-03 -8.8055539131164551e-01 + <_> + + 0 -1 274 -1.0636489838361740e-02 + + -4.4541570544242859e-01 1.0953740030527115e-01 + <_> + + 0 -1 275 -3.1363599002361298e-02 + + 8.0546891689300537e-01 -4.9883890897035599e-02 + <_> + + 0 -1 276 9.8021561279892921e-04 + + -2.3428329825401306e-01 1.6934409737586975e-01 + <_> + + 0 -1 277 5.3463829681277275e-03 + + -1.0729180276393890e-01 2.5447541475296021e-01 + <_> + + 0 -1 278 -5.1919990219175816e-03 + + -5.1496618986129761e-01 8.5118137300014496e-02 + <_> + + 0 -1 279 1.8721649423241615e-02 + + -8.4052212536334991e-02 4.7836899757385254e-01 + <_> + + 0 -1 280 3.7875440903007984e-03 + + -2.3145659267902374e-01 1.6052989661693573e-01 + <_> + + 0 -1 281 6.8765478208661079e-03 + + 9.6559382975101471e-02 -2.3832960426807404e-01 + <_> + + 0 -1 282 -5.4661519825458527e-03 + + -3.7871730327606201e-01 8.7851487100124359e-02 + <_> + + 0 -1 283 -1.5829449519515038e-02 + + 5.2159512042999268e-01 -7.3916867375373840e-02 + <_> + + 0 -1 284 1.2771990150213242e-02 + + 1.0658729821443558e-01 -3.2850459218025208e-01 + <_> + + 0 -1 285 4.7000780701637268e-02 + + -2.9548000544309616e-02 4.8469349741935730e-01 + <_> + + 0 -1 286 1.1224800255149603e-03 + + -2.1395659446716309e-01 1.5407760441303253e-01 + <_> + + 0 -1 287 -1.0136750061064959e-03 + + 2.3574739694595337e-01 -1.4536799490451813e-01 + <_> + + 0 -1 288 5.2841319702565670e-03 + + 8.0536216497421265e-02 -3.6417248845100403e-01 + <_> + + 0 -1 289 -1.7608689144253731e-02 + + 5.3858822584152222e-01 -3.5741850733757019e-02 + <_> + + 0 -1 290 3.4710608422756195e-02 + + -4.3261460959911346e-02 7.7817600965499878e-01 + <_> + + 0 -1 291 1.6450349241495132e-02 + + 4.1815090924501419e-02 -3.4912678599357605e-01 + <_> + 45 + -1.0216469764709473e+00 + + <_> + + 0 -1 292 -1.7846419941633940e-03 + + 2.2014810144901276e-01 -3.6912658810615540e-01 + <_> + + 0 -1 293 -6.1350408941507339e-04 + + -3.0695998668670654e-01 9.7717791795730591e-02 + <_> + + 0 -1 294 -2.5726810563355684e-03 + + -3.7789058685302734e-01 1.7042149603366852e-01 + <_> + + 0 -1 295 8.8661757763475180e-04 + + -3.7929078936576843e-01 9.3289971351623535e-02 + <_> + + 0 -1 296 3.5716239362955093e-02 + + 7.3169313371181488e-02 -6.1792898178100586e-01 + <_> + + 0 -1 297 3.5162840038537979e-02 + + -1.2328250333666801e-02 4.4894638657569885e-01 + <_> + + 0 -1 298 -5.8216741308569908e-03 + + -4.9501991271972656e-01 8.8005952537059784e-02 + <_> + + 0 -1 299 -7.7909301035106182e-04 + + 1.1154119670391083e-01 -2.8316551446914673e-01 + <_> + + 0 -1 300 -6.8164491094648838e-03 + + 1.8434180319309235e-01 -2.3727069795131683e-01 + <_> + + 0 -1 301 9.0218139812350273e-03 + + -5.3773559629917145e-02 2.6174989342689514e-01 + <_> + + 0 -1 302 -6.7481878213584423e-03 + + -5.0475108623504639e-01 7.6614417135715485e-02 + <_> + + 0 -1 303 7.5771231204271317e-03 + + -1.1926110088825226e-01 3.4210419654846191e-01 + <_> + + 0 -1 304 -4.6335519291460514e-03 + + -4.9088281393051147e-01 6.9542020559310913e-02 + <_> + + 0 -1 305 4.1346959769725800e-03 + + -8.1591427326202393e-02 4.7879660129547119e-01 + <_> + + 0 -1 306 -9.8444558680057526e-03 + + 2.0124210417270660e-01 -2.3769280314445496e-01 + <_> + + 0 -1 307 -3.4897070378065109e-02 + + -9.1024678945541382e-01 1.8579540774226189e-02 + <_> + + 0 -1 308 -3.5042490344494581e-04 + + 1.2479469925165176e-01 -3.0717149376869202e-01 + <_> + + 0 -1 309 -9.4668623059988022e-03 + + 1.1332949995994568e-01 -1.6115890443325043e-01 + <_> + + 0 -1 310 2.2053409367799759e-02 + + -7.9784400761127472e-02 6.0739010572433472e-01 + <_> + + 0 -1 311 -7.2947797889355570e-05 + + 1.4449119567871094e-01 -1.3706150650978088e-01 + <_> + + 0 -1 312 -7.5134839862585068e-03 + + -3.0744421482086182e-01 1.0279080271720886e-01 + <_> + + 0 -1 313 1.0311939753592014e-02 + + -7.0246197283267975e-02 4.8307010531425476e-01 + <_> + + 0 -1 314 9.4670448452234268e-03 + + 7.0281803607940674e-02 -4.7069519758224487e-01 + <_> + + 0 -1 315 -3.0116239562630653e-02 + + 5.2378559112548828e-01 -3.7109669297933578e-02 + <_> + + 0 -1 316 -1.2667849659919739e-02 + + -6.0825890302658081e-01 5.0444670021533966e-02 + <_> + + 0 -1 317 2.2987429983913898e-03 + + -1.1808679997920990e-01 1.7393890023231506e-01 + <_> + + 0 -1 318 2.5533209554851055e-03 + + -1.6625979542732239e-01 1.9768959283828735e-01 + <_> + + 0 -1 319 -3.3218199014663696e-01 + + -9.5407789945602417e-01 4.1291080415248871e-03 + <_> + + 0 -1 320 5.4485369473695755e-03 + + -9.1220542788505554e-02 3.9834749698638916e-01 + <_> + + 0 -1 321 4.7633191570639610e-03 + + -1.2069889903068542e-01 1.6169339418411255e-01 + <_> + + 0 -1 322 4.4371229596436024e-03 + + 8.5928186774253845e-02 -4.4427189230918884e-01 + <_> + + 0 -1 323 2.7019889093935490e-03 + + -1.9511219859123230e-01 7.1141660213470459e-02 + <_> + + 0 -1 324 -1.4219670556485653e-03 + + 1.9089500606060028e-01 -1.8880489468574524e-01 + <_> + + 0 -1 325 -6.9531630724668503e-03 + + -2.6191520690917969e-01 7.7488146722316742e-02 + <_> + + 0 -1 326 -2.6554360985755920e-01 + + 4.7893580794334412e-01 -7.8830257058143616e-02 + <_> + + 0 -1 327 5.4960828274488449e-03 + + 6.4748808741569519e-02 -4.0898790955543518e-01 + <_> + + 0 -1 328 1.6060929745435715e-02 + + 9.4868503510951996e-02 -3.5040768980979919e-01 + <_> + + 0 -1 329 -3.5279421135783195e-03 + + 2.2704540193080902e-01 -1.5011039376258850e-01 + <_> + + 0 -1 330 1.5189720317721367e-02 + + -8.6033642292022705e-02 5.0375241041183472e-01 + <_> + + 0 -1 331 9.8117031157016754e-03 + + 9.1945856809616089e-02 -2.7134710550308228e-01 + <_> + + 0 -1 332 -8.9835934340953827e-03 + + -3.5721930861473083e-01 1.1564330011606216e-01 + <_> + + 0 -1 333 2.5472430512309074e-02 + + -3.8861878216266632e-02 5.0707322359085083e-01 + <_> + + 0 -1 334 1.3594819465652108e-03 + + -1.5127420425415039e-01 2.3332439363002777e-01 + <_> + + 0 -1 335 1.4673129655420780e-02 + + 7.6386481523513794e-02 -4.3126261234283447e-01 + <_> + + 0 -1 336 -2.1757239475846291e-02 + + 6.0306608676910400e-01 -5.7926669716835022e-02 + <_> + 49 + -1.0149190425872803e+00 + + <_> + + 0 -1 337 -1.9122850149869919e-02 + + 2.1423059701919556e-01 -4.0178310871124268e-01 + <_> + + 0 -1 338 -4.0749661275185645e-04 + + 1.0837800055742264e-01 -9.7847007215023041e-02 + <_> + + 0 -1 339 1.8419560045003891e-02 + + 9.4817012548446655e-02 -4.4825899600982666e-01 + <_> + + 0 -1 340 -3.0946850893087685e-04 + + 1.1567220091819763e-01 -6.9291338324546814e-02 + <_> + + 0 -1 341 2.4416830390691757e-02 + + -2.6403778791427612e-01 1.4588509500026703e-01 + <_> + + 0 -1 342 3.9483308792114258e-03 + + 7.8703567385673523e-02 -3.9770650863647461e-01 + <_> + + 0 -1 343 1.5498059801757336e-02 + + -6.8623371422290802e-02 6.3598757982254028e-01 + <_> + + 0 -1 344 1.0397369973361492e-02 + + 5.3116258233785629e-02 -2.4757599830627441e-01 + <_> + + 0 -1 345 1.0350650409236550e-03 + + -2.2953610122203827e-01 2.1623679995536804e-01 + <_> + + 0 -1 346 -6.9717521546408534e-04 + + 1.6330949962139130e-01 -2.7930000424385071e-01 + <_> + + 0 -1 347 1.1055100476369262e-03 + + -2.6721170544624329e-01 1.3809490203857422e-01 + <_> + + 0 -1 348 1.8128760159015656e-02 + + 7.8602522611618042e-02 -3.3748328685760498e-01 + <_> + + 0 -1 349 -1.4303029747679830e-03 + + 1.5668049454689026e-01 -2.5422498583793640e-01 + <_> + + 0 -1 350 1.0650220327079296e-02 + + -4.1638601571321487e-02 3.2634070515632629e-01 + <_> + + 0 -1 351 -1.0680139530450106e-03 + + 1.7996980249881744e-01 -2.0673060417175293e-01 + <_> + + 0 -1 352 -8.0095082521438599e-03 + + -2.8778979182243347e-01 7.5492449104785919e-02 + <_> + + 0 -1 353 -1.1857559904456139e-02 + + -5.5485212802886963e-01 4.7465000301599503e-02 + <_> + + 0 -1 354 -1.9440150260925293e-01 + + 4.9564599990844727e-01 -6.8522267043590546e-02 + <_> + + 0 -1 355 1.2786169536411762e-02 + + -5.8201011270284653e-02 5.1194858551025391e-01 + <_> + + 0 -1 356 1.1360739590600133e-03 + + -2.1216529607772827e-01 1.4639540016651154e-01 + <_> + + 0 -1 357 -3.7541511119343340e-04 + + 1.1406060308218002e-01 -2.7936661243438721e-01 + <_> + + 0 -1 358 6.2142009846866131e-03 + + 2.8568789362907410e-02 -3.2485058903694153e-01 + <_> + + 0 -1 359 4.5166439376771450e-03 + + -9.5556378364562988e-02 3.6032339930534363e-01 + <_> + + 0 -1 360 -1.7354219453409314e-03 + + -8.0804876983165741e-02 5.3851570934057236e-02 + <_> + + 0 -1 361 -6.9608418270945549e-03 + + -6.0131508111953735e-01 4.5509491115808487e-02 + <_> + + 0 -1 362 8.7833311408758163e-03 + + -9.4497971236705780e-02 3.1924161314964294e-01 + <_> + + 0 -1 363 -2.0243569742888212e-03 + + 2.6737558841705322e-01 -1.1679279804229736e-01 + <_> + + 0 -1 364 5.6362948380410671e-03 + + 4.6491090208292007e-02 -2.3982259631156921e-01 + <_> + + 0 -1 365 -2.1751220338046551e-03 + + -3.1831741333007812e-01 1.1634550243616104e-01 + <_> + + 0 -1 366 2.5424890220165253e-02 + + 7.5600057840347290e-02 -3.7359631061553955e-01 + <_> + + 0 -1 367 3.9950129576027393e-04 + + -2.6206868886947632e-01 1.4345559477806091e-01 + <_> + + 0 -1 368 -3.9724060334265232e-03 + + 2.0395089685916901e-01 -1.1896310001611710e-01 + <_> + + 0 -1 369 2.4637179449200630e-03 + + -1.3687339425086975e-01 3.4098258614540100e-01 + <_> + + 0 -1 370 1.4397709630429745e-02 + + 2.4846889078617096e-02 -6.5415948629379272e-01 + <_> + + 0 -1 371 -1.4848919818177819e-05 + + 1.3884930312633514e-01 -2.1077479422092438e-01 + <_> + + 0 -1 372 -3.8339510560035706e-02 + + 5.8668392896652222e-01 -3.6245860159397125e-02 + <_> + + 0 -1 373 -5.4605712648481131e-04 + + 2.1259330213069916e-01 -1.3791069388389587e-01 + <_> + + 0 -1 374 1.3036499731242657e-02 + + 5.0619971007108688e-02 -2.3150099813938141e-01 + <_> + + 0 -1 375 -2.4273560848087072e-03 + + 2.4302999675273895e-01 -1.1315950006246567e-01 + <_> + + 0 -1 376 -6.3351681455969810e-03 + + -3.5549488663673401e-01 9.4948403537273407e-02 + <_> + + 0 -1 377 -5.7510860264301300e-02 + + 4.9378138780593872e-01 -6.0664121061563492e-02 + <_> + + 0 -1 378 6.8376341369003057e-04 + + -1.9417250156402588e-01 1.4234590530395508e-01 + <_> + + 0 -1 379 8.8113872334361076e-03 + + 4.7562059015035629e-02 -5.8416491746902466e-01 + <_> + + 0 -1 380 1.0788169689476490e-02 + + -4.6855889260768890e-02 1.6548010706901550e-01 + <_> + + 0 -1 381 -1.3571690069511533e-03 + + -3.2510679960250854e-01 9.4090476632118225e-02 + <_> + + 0 -1 382 -1.0195979848504066e-02 + + -1.4696849882602692e-01 2.6246059685945511e-02 + <_> + + 0 -1 383 -1.2560819741338491e-03 + + 2.2853380441665649e-01 -1.6265660524368286e-01 + <_> + + 0 -1 384 6.6750420955941081e-04 + + -1.3430669903755188e-01 1.3987569510936737e-01 + <_> + + 0 -1 385 2.0975170191377401e-03 + + -1.2987610697746277e-01 1.9978469610214233e-01 + <_> + 53 + -9.3152678012847900e-01 + + <_> + + 0 -1 386 -3.6917610559612513e-03 + + 2.2682790458202362e-01 -4.1167381405830383e-01 + <_> + + 0 -1 387 -9.4609148800373077e-03 + + 1.6305020451545715e-01 -2.2949010133743286e-01 + <_> + + 0 -1 388 3.3874800428748131e-03 + + 7.7644690871238708e-02 -4.7465118765830994e-01 + <_> + + 0 -1 389 3.3596849534660578e-03 + + -1.4722810685634613e-01 1.3755659759044647e-01 + <_> + + 0 -1 390 -2.2649099119007587e-03 + + -2.9027861356735229e-01 1.2261869758367538e-01 + <_> + + 0 -1 391 -5.5420072749257088e-04 + + 1.1591990292072296e-01 -2.3066529631614685e-01 + <_> + + 0 -1 392 1.9706019666045904e-03 + + 1.1808300018310547e-01 -3.7879431247711182e-01 + <_> + + 0 -1 393 1.7503080889582634e-02 + + -9.4161599874496460e-02 4.7933238744735718e-01 + <_> + + 0 -1 394 -2.9575270600616932e-03 + + 1.7336699366569519e-01 -3.1673321127891541e-01 + <_> + + 0 -1 395 -2.6238700747489929e-01 + + -7.4405288696289062e-01 8.9512793347239494e-03 + <_> + + 0 -1 396 5.5493800900876522e-03 + + -2.4088740348815918e-01 1.4212040603160858e-01 + <_> + + 0 -1 397 -1.4842569828033447e-02 + + 5.5166311562061310e-02 -8.5363000631332397e-02 + <_> + + 0 -1 398 -1.8193490803241730e-02 + + -7.5389099121093750e-01 4.4062498956918716e-02 + <_> + + 0 -1 399 -1.9381130114197731e-03 + + 1.4762139320373535e-01 -1.4214770495891571e-01 + <_> + + 0 -1 400 -6.1375028453767300e-03 + + -5.4175209999084473e-01 5.2872691303491592e-02 + <_> + + 0 -1 401 1.6630079597234726e-02 + + -6.0005810111761093e-02 5.2294141054153442e-01 + <_> + + 0 -1 402 -9.7470665350556374e-03 + + -3.1776770949363708e-01 9.4077728688716888e-02 + <_> + + 0 -1 403 -3.9159679412841797e-01 + + 5.1550501585006714e-01 -8.6178213357925415e-02 + <_> + + 0 -1 404 1.0457860305905342e-02 + + -5.4442230612039566e-02 5.5086338520050049e-01 + <_> + + 0 -1 405 9.2479586601257324e-02 + + 9.5865959301590919e-03 -7.5205242633819580e-01 + <_> + + 0 -1 406 -1.3383329845964909e-02 + + -2.5909280776977539e-01 1.2255199998617172e-01 + <_> + + 0 -1 407 -1.9297929480671883e-02 + + -1.8686549365520477e-01 4.2670380324125290e-02 + <_> + + 0 -1 408 -1.1118740076199174e-03 + + 1.4586099982261658e-01 -2.2742809355258942e-01 + <_> + + 0 -1 409 2.3209059610962868e-02 + + 2.1769199520349503e-02 -2.4001930654048920e-01 + <_> + + 0 -1 410 6.9435071200132370e-03 + + -8.4814570844173431e-02 3.8388100266456604e-01 + <_> + + 0 -1 411 -1.0249669849872589e-01 + + -7.0618611574172974e-01 1.2580949813127518e-02 + <_> + + 0 -1 412 -1.4036430045962334e-02 + + -3.8427880406379700e-01 8.7678723037242889e-02 + <_> + + 0 -1 413 6.8071340210735798e-03 + + -7.5941346585750580e-02 7.6014332473278046e-02 + <_> + + 0 -1 414 4.8163239844143391e-03 + + -1.6402910649776459e-01 2.0124110579490662e-01 + <_> + + 0 -1 415 -3.0274710152298212e-03 + + -2.8118729591369629e-01 6.8671241402626038e-02 + <_> + + 0 -1 416 -1.6530510038137436e-03 + + 2.1427379548549652e-01 -1.3038359582424164e-01 + <_> + + 0 -1 417 -3.9757499471306801e-03 + + -2.3737999796867371e-01 5.1290549337863922e-02 + <_> + + 0 -1 418 6.9589749909937382e-03 + + -1.3246279954910278e-01 2.3703409731388092e-01 + <_> + + 0 -1 419 7.2270620148628950e-04 + + 5.0478070974349976e-02 -1.3544809818267822e-01 + <_> + + 0 -1 420 1.5057729557156563e-02 + + -6.6954463720321655e-02 4.5368999242782593e-01 + <_> + + 0 -1 421 6.5838429145514965e-03 + + 3.9054669439792633e-02 -1.9516509771347046e-01 + <_> + + 0 -1 422 -2.9128929600119591e-03 + + 1.7604969441890717e-01 -1.5639689564704895e-01 + <_> + + 0 -1 423 6.4386397600173950e-01 + + -1.1777699925005436e-02 1.0000569820404053e+00 + <_> + + 0 -1 424 5.1160277798771858e-03 + + 9.5464669167995453e-02 -3.7832370400428772e-01 + <_> + + 0 -1 425 6.8325497210025787e-02 + + -3.9297499461099505e-04 -9.9986249208450317e-01 + <_> + + 0 -1 426 4.4071719050407410e-02 + + 2.8716549277305603e-02 -9.0306490659713745e-01 + <_> + + 0 -1 427 -1.5712520107626915e-02 + + 2.4888029694557190e-01 -5.3066261112689972e-02 + <_> + + 0 -1 428 -3.9486829191446304e-03 + + -5.0214129686355591e-01 5.2089609205722809e-02 + <_> + + 0 -1 429 1.1841469677165151e-03 + + 6.2122888863086700e-02 -1.6479890048503876e-01 + <_> + + 0 -1 430 -1.1385709792375565e-01 + + 5.6728571653366089e-01 -3.8864318281412125e-02 + <_> + + 0 -1 431 6.2493737787008286e-03 + + 8.7858140468597412e-02 -2.8675949573516846e-01 + <_> + + 0 -1 432 -2.3781529162079096e-03 + + 2.6684141159057617e-01 -9.3291386961936951e-02 + <_> + + 0 -1 433 -6.3620522618293762e-02 + + 1.5153369307518005e-01 -1.5354029834270477e-02 + <_> + + 0 -1 434 7.9275481402873993e-03 + + 8.8268518447875977e-02 -3.1872791051864624e-01 + <_> + + 0 -1 435 1.0556660126894712e-03 + + -1.0226110368967056e-01 6.0546699911355972e-02 + <_> + + 0 -1 436 9.1879200190305710e-03 + + 8.0963402986526489e-02 -3.5031539201736450e-01 + <_> + + 0 -1 437 3.9727380499243736e-03 + + -1.0334850102663040e-01 2.7450188994407654e-01 + <_> + + 0 -1 438 1.7149309860542417e-03 + + -1.2329679727554321e-01 2.1561819314956665e-01 + <_> + 55 + -9.3984860181808472e-01 + + <_> + + 0 -1 439 -1.4547890052199364e-02 + + -5.7042872905731201e-01 1.0164090245962143e-01 + <_> + + 0 -1 440 -1.2570459512062371e-04 + + 7.7566891908645630e-02 -2.9524150490760803e-01 + <_> + + 0 -1 441 9.4022490084171295e-03 + + -3.2618519663810730e-01 1.3688039779663086e-01 + <_> + + 0 -1 442 -5.1469001919031143e-03 + + -2.2486360371112823e-01 1.4886389672756195e-01 + <_> + + 0 -1 443 -3.1212199246510863e-04 + + 1.1287149786949158e-01 -3.2888731360435486e-01 + <_> + + 0 -1 444 1.8742609769105911e-02 + + -1.8080070614814758e-02 3.0115321278572083e-01 + <_> + + 0 -1 445 2.9675778932869434e-03 + + -2.5948849320411682e-01 1.3308060169219971e-01 + <_> + + 0 -1 446 -3.0295079573988914e-02 + + -6.0041320323944092e-01 3.3516548573970795e-02 + <_> + + 0 -1 447 6.4835487864911556e-03 + + -7.7768087387084961e-02 4.6268320083618164e-01 + <_> + + 0 -1 448 2.2889559622853994e-03 + + 6.0411829501390457e-02 -1.7498730123043060e-01 + <_> + + 0 -1 449 -1.6078320331871510e-03 + + -2.9557180404663086e-01 1.5449790656566620e-01 + <_> + + 0 -1 450 -2.3348669707775116e-01 + + -6.3751947879791260e-01 1.3748309575021267e-02 + <_> + + 0 -1 451 5.8999718166887760e-03 + + 1.2713789939880371e-01 -3.2689490914344788e-01 + <_> + + 0 -1 452 1.2073719874024391e-02 + + 1.6614260151982307e-02 -2.2707170248031616e-01 + <_> + + 0 -1 453 -5.6356011191383004e-04 + + 1.6879190504550934e-01 -1.9605310261249542e-01 + <_> + + 0 -1 454 1.7435080371797085e-03 + + -1.3831000030040741e-01 2.2103509306907654e-01 + <_> + + 0 -1 455 6.6066621802747250e-03 + + 4.4354528188705444e-02 -6.7365241050720215e-01 + <_> + + 0 -1 456 -5.9419698081910610e-03 + + 1.7569009959697723e-01 -1.3697220385074615e-01 + <_> + + 0 -1 457 4.9261527601629496e-04 + + -2.1035130321979523e-01 1.3241830468177795e-01 + <_> + + 0 -1 458 -3.6582869943231344e-03 + + 1.5420369803905487e-01 -1.0563220083713531e-01 + <_> + + 0 -1 459 -1.4477679505944252e-03 + + -2.8920960426330566e-01 1.4950390160083771e-01 + <_> + + 0 -1 460 -1.0310580255463719e-03 + + 8.8572971522808075e-02 -9.0375833213329315e-02 + <_> + + 0 -1 461 3.2927519641816616e-03 + + -1.1087729781866074e-01 3.0003741383552551e-01 + <_> + + 0 -1 462 -1.6668019816279411e-03 + + -6.2054108828306198e-02 2.2652259469032288e-01 + <_> + + 0 -1 463 1.3452100101858377e-03 + + 9.2012971639633179e-02 -3.5944160819053650e-01 + <_> + + 0 -1 464 -1.4981569722294807e-02 + + 3.6636090278625488e-01 -6.4556807279586792e-02 + <_> + + 0 -1 465 6.2536462210118771e-03 + + 6.9381363689899445e-02 -4.1023838520050049e-01 + <_> + + 0 -1 466 5.0937399268150330e-02 + + 1.7869930714368820e-02 -6.0524070262908936e-01 + <_> + + 0 -1 467 1.0756580159068108e-03 + + -2.3777949810028076e-01 1.4223319292068481e-01 + <_> + + 0 -1 468 -4.1086040437221527e-03 + + 1.4915379881858826e-01 -1.9213069975376129e-01 + <_> + + 0 -1 469 -1.3338520191609859e-02 + + -4.9711030721664429e-01 6.5755158662796021e-02 + <_> + + 0 -1 470 3.1997971236705780e-02 + + -6.4927592873573303e-02 6.6577041149139404e-01 + <_> + + 0 -1 471 -4.9686059355735779e-02 + + 5.0676888227462769e-01 -6.4676910638809204e-02 + <_> + + 0 -1 472 6.0286428779363632e-03 + + 8.8214896619319916e-02 -2.7923619747161865e-01 + <_> + + 0 -1 473 -6.9053061306476593e-03 + + -6.1452347040176392e-01 3.5631489008665085e-02 + <_> + + 0 -1 474 5.8130919933319092e-03 + + -9.3653626739978790e-02 9.9817357957363129e-02 + <_> + + 0 -1 475 -1.1030419729650021e-02 + + 4.5798170566558838e-01 -6.5124973654747009e-02 + <_> + + 0 -1 476 -1.5703570097684860e-03 + + 4.7113660722970963e-02 -1.3347460329532623e-01 + <_> + + 0 -1 477 4.6482901088893414e-03 + + 7.3932677507400513e-02 -4.2145860195159912e-01 + <_> + + 0 -1 478 5.0479872152209282e-04 + + -2.0517270267009735e-01 9.5128253102302551e-02 + <_> + + 0 -1 479 2.6125760748982430e-02 + + -6.8816967308521271e-02 4.2644789814949036e-01 + <_> + + 0 -1 480 6.4811189658939838e-03 + + 1.1302389949560165e-01 -4.7021061182022095e-01 + <_> + + 0 -1 481 -4.5484181493520737e-02 + + 5.4101467132568359e-01 -5.6804839521646500e-02 + <_> + + 0 -1 482 6.8956136703491211e-02 + + 3.4444119781255722e-02 -1.7411549389362335e-01 + <_> + + 0 -1 483 -2.0358948968350887e-03 + + 1.3366940617561340e-01 -2.0985920727252960e-01 + <_> + + 0 -1 484 1.4390050200745463e-03 + + -1.6449619829654694e-01 9.8886348307132721e-02 + <_> + + 0 -1 485 3.0180480331182480e-02 + + 8.7635383009910583e-02 -3.9464119076728821e-01 + <_> + + 0 -1 486 -3.8663588929921389e-03 + + 1.5964619815349579e-01 -1.1840829998254776e-01 + <_> + + 0 -1 487 1.0753490030765533e-02 + + -5.7142060250043869e-02 5.0125277042388916e-01 + <_> + + 0 -1 488 1.0978150181472301e-02 + + 3.5985160619020462e-02 -3.8646480441093445e-01 + <_> + + 0 -1 489 -7.8152219066396356e-04 + + 1.8248090147972107e-01 -1.6435949504375458e-01 + <_> + + 0 -1 490 -6.9936108775436878e-03 + + -2.6556238532066345e-01 9.4436101615428925e-02 + <_> + + 0 -1 491 2.3125730454921722e-02 + + -5.9101939201354980e-02 5.7359057664871216e-01 + <_> + + 0 -1 492 -1.7055520787835121e-02 + + -5.4567247629165649e-01 2.7153130620718002e-02 + <_> + + 0 -1 493 1.5192289836704731e-02 + + 9.2580981552600861e-02 -2.9735139012336731e-01 + <_> + 53 + -8.2538652420043945e-01 + + <_> + + 0 -1 494 -2.1589139476418495e-02 + + 3.3779260516166687e-01 -2.6725459098815918e-01 + <_> + + 0 -1 495 6.3885431736707687e-03 + + -2.6759129762649536e-01 2.1438689529895782e-01 + <_> + + 0 -1 496 -2.4394609499722719e-03 + + 1.8841089308261871e-01 -2.3495130240917206e-01 + <_> + + 0 -1 497 3.9824391715228558e-03 + + 4.6689908951520920e-02 -1.7984829843044281e-01 + <_> + + 0 -1 498 -3.1252959161065519e-04 + + 1.7267709970474243e-01 -1.8782779574394226e-01 + <_> + + 0 -1 499 3.3181109465658665e-03 + + 1.2081120163202286e-01 -3.2373869419097900e-01 + <_> + + 0 -1 500 -7.0711369626224041e-03 + + -2.7498379349708557e-01 1.3868269324302673e-01 + <_> + + 0 -1 501 4.4392608106136322e-03 + + -2.2279019653797150e-01 1.7155140638351440e-01 + <_> + + 0 -1 502 2.1352670155465603e-03 + + -1.1322859674692154e-01 2.8428959846496582e-01 + <_> + + 0 -1 503 -4.0205409750342369e-03 + + -2.4542550742626190e-01 9.4957500696182251e-02 + <_> + + 0 -1 504 -6.5228617750108242e-03 + + 3.2106789946556091e-01 -9.7372367978096008e-02 + <_> + + 0 -1 505 4.4146090658614412e-05 + + -1.5269330143928528e-01 8.5128836333751678e-02 + <_> + + 0 -1 506 4.7606039792299271e-02 + + 7.9339757561683655e-02 -2.9599419236183167e-01 + <_> + + 0 -1 507 4.0928661823272705e-02 + + -3.5142261534929276e-02 3.7593579292297363e-01 + <_> + + 0 -1 508 -1.1161889880895615e-02 + + -2.6747810840606689e-01 8.9181788265705109e-02 + <_> + + 0 -1 509 -2.9888451099395752e-01 + + 4.8014399409294128e-01 -7.2485052049160004e-02 + <_> + + 0 -1 510 1.1514360085129738e-02 + + -5.9218250215053558e-02 4.0962639451026917e-01 + <_> + + 0 -1 511 -2.6182739529758692e-03 + + -1.8478739261627197e-01 3.9801560342311859e-02 + <_> + + 0 -1 512 -1.2829460320062935e-04 + + 1.0710919648408890e-01 -2.4155279994010925e-01 + <_> + + 0 -1 513 -6.9328160025179386e-03 + + -2.9845720529556274e-01 4.5657958835363388e-02 + <_> + + 0 -1 514 -6.3937888480722904e-03 + + 1.8363510072231293e-01 -1.4049419760704041e-01 + <_> + + 0 -1 515 4.1702711023390293e-03 + + -5.1890019327402115e-02 1.0211580246686935e-01 + <_> + + 0 -1 516 1.0390999726951122e-02 + + -1.3426989316940308e-01 1.9137309491634369e-01 + <_> + + 0 -1 517 1.3004739768803120e-02 + + -4.5922718942165375e-02 3.0526930093765259e-01 + <_> + + 0 -1 518 -4.0645021945238113e-03 + + -4.8477160930633545e-01 6.9338463246822357e-02 + <_> + + 0 -1 519 -3.7050418904982507e-04 + + 1.0090719908475876e-01 -6.8911276757717133e-02 + <_> + + 0 -1 520 8.8882551062852144e-04 + + -1.6742789745330811e-01 1.8965889513492584e-01 + <_> + + 0 -1 521 -4.8583559691905975e-03 + + -4.0789389610290527e-01 5.1483351737260818e-02 + <_> + + 0 -1 522 4.4327960349619389e-03 + + -1.4262509346008301e-01 1.8987190723419189e-01 + <_> + + 0 -1 523 2.0999709144234657e-02 + + 9.2153772711753845e-02 -3.0773550271987915e-01 + <_> + + 0 -1 524 -2.2740170825272799e-03 + + 1.5176279842853546e-01 -1.6528700292110443e-01 + <_> + + 0 -1 525 -1.5075540170073509e-02 + + -3.1039240956306458e-01 6.5696939826011658e-02 + <_> + + 0 -1 526 9.5290662720799446e-03 + + -6.7693017423152924e-02 4.0692031383514404e-01 + <_> + + 0 -1 527 1.2057139538228512e-03 + + 4.3188188225030899e-02 -1.8454369902610779e-01 + <_> + + 0 -1 528 -2.4757070466876030e-02 + + 6.6890978813171387e-01 -3.4418709576129913e-02 + <_> + + 0 -1 529 3.0408669263124466e-03 + + -1.3256159424781799e-01 9.5131039619445801e-02 + <_> + + 0 -1 530 -1.5181970084086061e-03 + + 1.2939499318599701e-01 -1.8558539450168610e-01 + <_> + + 0 -1 531 -2.4845359846949577e-02 + + -7.3013377189636230e-01 9.4545418396592140e-03 + <_> + + 0 -1 532 -8.1413304433226585e-03 + + 1.1521799862384796e-01 -1.9038149714469910e-01 + <_> + + 0 -1 533 -4.2350329458713531e-03 + + 7.2733633220195770e-02 -1.0841889679431915e-01 + <_> + + 0 -1 534 9.9135711789131165e-03 + + -8.4218956530094147e-02 4.7613239288330078e-01 + <_> + + 0 -1 535 -2.7879870031028986e-03 + + -1.2846939265727997e-01 6.5720662474632263e-02 + <_> + + 0 -1 536 2.6451589073985815e-03 + + 8.9269757270812988e-02 -2.6216679811477661e-01 + <_> + + 0 -1 537 -2.6683490723371506e-02 + + 8.9870773255825043e-02 -9.6914090216159821e-02 + <_> + + 0 -1 538 3.1197380740195513e-03 + + -1.1731740087270737e-01 2.2004860639572144e-01 + <_> + + 0 -1 539 -2.3388290405273438e-01 + + -9.0905857086181641e-01 5.6871720589697361e-03 + <_> + + 0 -1 540 1.0922820307314396e-02 + + 8.5061840713024139e-02 -3.0725648999214172e-01 + <_> + + 0 -1 541 9.4858808442950249e-03 + + -2.2317569702863693e-02 3.3745709061622620e-01 + <_> + + 0 -1 542 -5.1413412438705564e-04 + + 1.4860659837722778e-01 -1.5598359704017639e-01 + <_> + + 0 -1 543 6.5561588853597641e-03 + + 6.6693432629108429e-02 -2.9945740103721619e-01 + <_> + + 0 -1 544 9.8293996416032314e-04 + + -1.9923539459705353e-01 1.4816479384899139e-01 + <_> + + 0 -1 545 -1.8866109894588590e-03 + + 8.6462371051311493e-02 -1.6101740300655365e-01 + <_> + + 0 -1 546 2.7264489326626062e-03 + + -8.2049086689949036e-02 3.8679501414299011e-01 + <_> + 60 + -8.3464938402175903e-01 + + <_> + + 0 -1 547 -1.2602520175278187e-02 + + 2.2423070669174194e-01 -3.3462178707122803e-01 + <_> + + 0 -1 548 2.5659699458628893e-03 + + 8.5756540298461914e-02 -3.2376360893249512e-01 + <_> + + 0 -1 549 -1.2003120500594378e-03 + + 1.4650370180606842e-01 -3.0306750535964966e-01 + <_> + + 0 -1 550 4.7978968359529972e-03 + + -2.4725909531116486e-01 5.2705809473991394e-02 + <_> + + 0 -1 551 -5.9380318270996213e-04 + + -1.8883049488067627e-01 1.5490350127220154e-01 + <_> + + 0 -1 552 8.1017091870307922e-03 + + 1.0764879733324051e-01 -2.4738930165767670e-01 + <_> + + 0 -1 553 -6.8427261430770159e-04 + + 1.8282850086688995e-01 -1.6550099849700928e-01 + <_> + + 0 -1 554 4.5279348269104958e-03 + + -5.5668760091066360e-02 4.1382691264152527e-01 + <_> + + 0 -1 555 3.8289420772343874e-03 + + -2.2222219407558441e-01 1.5282329916954041e-01 + <_> + + 0 -1 556 -6.2229200266301632e-03 + + -3.2351690530776978e-01 6.8372547626495361e-02 + <_> + + 0 -1 557 -6.1763478443026543e-03 + + -3.9912268519401550e-01 7.7707469463348389e-02 + <_> + + 0 -1 558 -8.7820261716842651e-02 + + 5.8577078580856323e-01 -5.3584650158882141e-02 + <_> + + 0 -1 559 -6.8017458543181419e-03 + + -4.3307110667228699e-01 6.2693849205970764e-02 + <_> + + 0 -1 560 1.0741569567471743e-03 + + -1.1966490000486374e-01 5.5397849529981613e-02 + <_> + + 0 -1 561 -3.0490919947624207e-02 + + -2.3663240671157837e-01 1.0002999752759933e-01 + <_> + + 0 -1 562 5.1879119127988815e-02 + + -3.6418840289115906e-02 7.3392897844314575e-01 + <_> + + 0 -1 563 8.6805049795657396e-04 + + -1.7705479264259338e-01 1.4985239505767822e-01 + <_> + + 0 -1 564 4.8424140550196171e-03 + + -4.6208251267671585e-02 1.3162529468536377e-01 + <_> + + 0 -1 565 9.1674225404858589e-03 + + 9.9181063473224640e-02 -2.0292450487613678e-01 + <_> + + 0 -1 566 -5.6356228888034821e-03 + + 8.7860167026519775e-02 -3.7438090890645981e-02 + <_> + + 0 -1 567 -3.8375150412321091e-02 + + 4.9721479415893555e-01 -4.3815169483423233e-02 + <_> + + 0 -1 568 8.9894384145736694e-03 + + 9.4126552343368530e-02 -3.0227750539779663e-01 + <_> + + 0 -1 569 -1.1650560190901160e-04 + + 1.3361050188541412e-01 -1.8932069838047028e-01 + <_> + + 0 -1 570 -6.6462112590670586e-04 + + 7.7972702682018280e-02 -1.3508260250091553e-01 + <_> + + 0 -1 571 -1.2656490318477154e-02 + + -3.6913019418716431e-01 6.4613893628120422e-02 + <_> + + 0 -1 572 -4.3929531238973141e-03 + + 2.6696819067001343e-01 -8.8650099933147430e-02 + <_> + + 0 -1 573 -1.2583639472723007e-03 + + 2.0614829659461975e-01 -1.0952439904212952e-01 + <_> + + 0 -1 574 -1.1131940409541130e-02 + + -4.1352048516273499e-01 6.2840126454830170e-02 + <_> + + 0 -1 575 3.0703889206051826e-03 + + -1.5591779351234436e-01 1.5018209815025330e-01 + <_> + + 0 -1 576 3.5361549817025661e-03 + + 6.2573492527008057e-02 -2.1869969367980957e-01 + <_> + + 0 -1 577 2.8864629566669464e-02 + + -6.9561749696731567e-02 4.4892778992652893e-01 + <_> + + 0 -1 578 -7.1035906672477722e-02 + + 2.0991979539394379e-01 -3.6562878638505936e-02 + <_> + + 0 -1 579 -1.1107679456472397e-03 + + -3.3020168542861938e-01 7.9758942127227783e-02 + <_> + + 0 -1 580 7.9184047877788544e-02 + + -1.3226009905338287e-02 3.8603660464286804e-01 + <_> + + 0 -1 581 1.3353509828448296e-02 + + 5.8410558849573135e-02 -3.9250770211219788e-01 + <_> + + 0 -1 582 5.0049051642417908e-02 + + -2.3318229243159294e-02 7.4593770503997803e-01 + <_> + + 0 -1 583 -2.1859000623226166e-01 + + -8.4585267305374146e-01 2.5940530002117157e-02 + <_> + + 0 -1 584 1.0064110159873962e-02 + + -1.0959850251674652e-01 2.1068529784679413e-01 + <_> + + 0 -1 585 7.5430879369378090e-03 + + 5.3567539900541306e-02 -3.3617278933525085e-01 + <_> + + 0 -1 586 1.5817210078239441e-02 + + -1.9042259082198143e-02 2.2196899354457855e-01 + <_> + + 0 -1 587 -1.7135319649241865e-04 + + 1.7667369544506073e-01 -1.2068530172109604e-01 + <_> + + 0 -1 588 6.6670849919319153e-03 + + 7.0071838796138763e-02 -2.2137600183486938e-01 + <_> + + 0 -1 589 2.7946738991886377e-03 + + -1.0509230196475983e-01 1.9277399778366089e-01 + <_> + + 0 -1 590 -1.5057970304042101e-03 + + 6.0012888163328171e-02 -1.2378510087728500e-01 + <_> + + 0 -1 591 8.5329543799161911e-03 + + -4.7611240297555923e-02 3.9985141158103943e-01 + <_> + + 0 -1 592 4.2939469218254089e-02 + + 3.1611390411853790e-02 -1.9731660187244415e-01 + <_> + + 0 -1 593 2.0308220759034157e-02 + + 3.5055190324783325e-02 -5.1969397068023682e-01 + <_> + + 0 -1 594 -7.7673741616308689e-03 + + -1.8817919492721558e-01 5.6889228522777557e-02 + <_> + + 0 -1 595 2.1762759424746037e-03 + + -9.0948157012462616e-02 2.4575869739055634e-01 + <_> + + 0 -1 596 -1.9813690334558487e-02 + + 5.2904421091079712e-01 -3.8754951208829880e-02 + <_> + + 0 -1 597 1.3035159558057785e-02 + + 6.7918822169303894e-02 -3.0413469672203064e-01 + <_> + + 0 -1 598 -1.9664920400828123e-03 + + -2.0626169443130493e-01 9.6140593290328979e-02 + <_> + + 0 -1 599 -2.6359891053289175e-03 + + 2.5085249543190002e-01 -8.3200961351394653e-02 + <_> + + 0 -1 600 -2.2968810517340899e-03 + + 2.9634681344032288e-01 -5.8743689209222794e-02 + <_> + + 0 -1 601 -3.8644939195364714e-03 + + 1.9411550462245941e-01 -1.0827559977769852e-01 + <_> + + 0 -1 602 4.4517841160995886e-05 + + -2.4451869726181030e-01 1.0293029993772507e-01 + <_> + + 0 -1 603 1.9567341078072786e-03 + + -1.0519249737262726e-01 2.2499999403953552e-01 + <_> + + 0 -1 604 1.4188109897077084e-02 + + 3.2100718468427658e-02 -5.9142422676086426e-01 + <_> + + 0 -1 605 -1.3274629600346088e-04 + + 7.4577853083610535e-02 -2.7654591202735901e-01 + <_> + + 0 -1 606 2.0996380597352982e-02 + + -4.5735489577054977e-02 3.2947731018066406e-01 + <_> + 68 + -7.0352667570114136e-01 + + <_> + + 0 -1 607 -3.9841078221797943e-02 + + 1.5186519920825958e-01 -2.9055249691009521e-01 + <_> + + 0 -1 608 1.1327869724482298e-03 + + -1.1921630054712296e-01 1.2098889797925949e-01 + <_> + + 0 -1 609 1.0022070491686463e-03 + + 1.2088630348443985e-01 -2.5621330738067627e-01 + <_> + + 0 -1 610 6.3866227865219116e-02 + + 4.7628100961446762e-02 -8.6150348186492920e-01 + <_> + + 0 -1 611 -3.0986019410192966e-03 + + -3.1975808739662170e-01 9.1434687376022339e-02 + <_> + + 0 -1 612 6.5784230828285217e-03 + + -8.0473050475120544e-02 3.6123031377792358e-01 + <_> + + 0 -1 613 4.5082601718604565e-03 + + -1.8215750157833099e-01 1.4672499895095825e-01 + <_> + + 0 -1 614 -1.6526240855455399e-02 + + -1.2954659759998322e-01 6.6522419452667236e-02 + <_> + + 0 -1 615 -4.1868099942803383e-03 + + -2.6552608609199524e-01 1.1237680166959763e-01 + <_> + + 0 -1 616 5.6613027118146420e-04 + + 1.1822649836540222e-01 -1.6119679808616638e-01 + <_> + + 0 -1 617 2.0279800519347191e-03 + + -2.2618439793586731e-01 1.1263699829578400e-01 + <_> + + 0 -1 618 -1.1969150044023991e-02 + + -2.7523440122604370e-01 8.3603866398334503e-02 + <_> + + 0 -1 619 -2.8411731123924255e-01 + + 4.0216109156608582e-01 -7.7971749007701874e-02 + <_> + + 0 -1 620 -3.6587871145457029e-03 + + -2.9723858833312988e-01 6.3484713435173035e-02 + <_> + + 0 -1 621 9.2046172358095646e-04 + + 7.7872820198535919e-02 -2.9539081454277039e-01 + <_> + + 0 -1 622 1.3571759685873985e-02 + + -7.2430767118930817e-02 3.4849750995635986e-01 + <_> + + 0 -1 623 -3.1399999279528856e-03 + + -2.2088779509067535e-01 1.0072159767150879e-01 + <_> + + 0 -1 624 6.9894008338451385e-03 + + 5.9188209474086761e-02 -1.4137220382690430e-01 + <_> + + 0 -1 625 -5.9609091840684414e-04 + + 1.3563929498195648e-01 -1.5081329643726349e-01 + <_> + + 0 -1 626 1.6805849736556411e-03 + + -7.8348256647586823e-02 7.7357366681098938e-02 + <_> + + 0 -1 627 -5.7250040117651224e-04 + + 2.3572799563407898e-01 -1.1594360321760178e-01 + <_> + + 0 -1 628 4.3474160134792328e-02 + + 8.2836961373686790e-03 -3.7428310513496399e-01 + <_> + + 0 -1 629 6.0316640883684158e-04 + + -1.7846900224685669e-01 1.6185760498046875e-01 + <_> + + 0 -1 630 2.6881720870733261e-02 + + 7.2419442236423492e-02 -1.7971959710121155e-01 + <_> + + 0 -1 631 -4.9273878335952759e-02 + + 4.6386399865150452e-01 -5.0276938825845718e-02 + <_> + + 0 -1 632 -6.7225202918052673e-02 + + -1. 1.3532400131225586e-02 + <_> + + 0 -1 633 2.0203770697116852e-01 + + -3.8748100399971008e-02 5.7211977243423462e-01 + <_> + + 0 -1 634 3.1489748507738113e-02 + + 4.5488908886909485e-02 -1.2539370357990265e-01 + <_> + + 0 -1 635 -5.7097017997875810e-04 + + 1.9619710743427277e-01 -1.0944739729166031e-01 + <_> + + 0 -1 636 -7.8234989196062088e-03 + + 6.7954361438751221e-02 -7.2075963020324707e-02 + <_> + + 0 -1 637 -2.1555390208959579e-02 + + -2.8890660405158997e-01 9.9806018173694611e-02 + <_> + + 0 -1 638 -8.3767198026180267e-02 + + -4.3685078620910645e-01 1.0792650282382965e-02 + <_> + + 0 -1 639 -3.5752300173044205e-03 + + 1.1191669851541519e-01 -1.9461460411548615e-01 + <_> + + 0 -1 640 1.2265419587492943e-02 + + -6.5728217363357544e-02 3.2739359140396118e-01 + <_> + + 0 -1 641 2.8762801084667444e-03 + + -1.8723809719085693e-01 1.1246989667415619e-01 + <_> + + 0 -1 642 7.4190571904182434e-03 + + 5.1525920629501343e-02 -2.6615419983863831e-01 + <_> + + 0 -1 643 -4.9716630019247532e-03 + + 1.5384270250797272e-01 -1.5141449868679047e-01 + <_> + + 0 -1 644 2.0294899120926857e-02 + + -1.9532799720764160e-02 3.0571049451828003e-01 + <_> + + 0 -1 645 1.3469019904732704e-02 + + 6.2345318496227264e-02 -3.6343741416931152e-01 + <_> + + 0 -1 646 6.8610929884016514e-03 + + -6.2487348914146423e-02 2.8820911049842834e-01 + <_> + + 0 -1 647 -5.9594889171421528e-04 + + 8.5537739098072052e-02 -2.4081380665302277e-01 + <_> + + 0 -1 648 -4.0149871259927750e-02 + + -1. 1.5480610309168696e-03 + <_> + + 0 -1 649 -2.7885669842362404e-03 + + -2.2338689863681793e-01 1.1001159995794296e-01 + <_> + + 0 -1 650 -7.9318676143884659e-03 + + 1.3043269515037537e-01 -2.8859179466962814e-02 + <_> + + 0 -1 651 -2.9607459509861656e-05 + + 1.1876039952039719e-01 -1.7018820345401764e-01 + <_> + + 0 -1 652 2.6092668995261192e-03 + + -6.9877780973911285e-02 1.5036509931087494e-01 + <_> + + 0 -1 653 -4.5970208942890167e-02 + + 5.6322151422500610e-01 -3.6318130791187286e-02 + <_> + + 0 -1 654 9.0047682169824839e-04 + + 3.2461058348417282e-02 -1.8973889946937561e-01 + <_> + + 0 -1 655 -5.1712408661842346e-02 + + -8.5045510530471802e-01 2.0679740235209465e-02 + <_> + + 0 -1 656 -1.4172409474849701e-01 + + -9.1004508733749390e-01 3.8531969767063856e-03 + <_> + + 0 -1 657 -6.9771192967891693e-02 + + 4.2144781351089478e-01 -5.5162269622087479e-02 + <_> + + 0 -1 658 -7.5836889445781708e-03 + + -4.2189291119575500e-01 6.1964530497789383e-02 + <_> + + 0 -1 659 -1.2404819717630744e-03 + + 1.7558629810810089e-01 -1.3540640473365784e-01 + <_> + + 0 -1 660 1.0614699684083462e-02 + + 4.5083239674568176e-02 -2.5765570998191833e-01 + <_> + + 0 -1 661 1.7647630302235484e-03 + + -1.1009249836206436e-01 2.4041210114955902e-01 + <_> + + 0 -1 662 3.7170480936765671e-03 + + -7.6920822262763977e-02 2.0119519531726837e-01 + <_> + + 0 -1 663 1.5280679799616337e-02 + + 5.8605119585990906e-02 -3.6220121383666992e-01 + <_> + + 0 -1 664 -8.1635616719722748e-02 + + 5.2819788455963135e-01 -4.3608970940113068e-02 + <_> + + 0 -1 665 -2.4431939236819744e-03 + + -2.4369360506534576e-01 8.4384277462959290e-02 + <_> + + 0 -1 666 -1.2289900332689285e-03 + + 1.0332729667425156e-01 -9.7442328929901123e-02 + <_> + + 0 -1 667 6.9271848769858479e-04 + + -1.1367750167846680e-01 1.6121849417686462e-01 + <_> + + 0 -1 668 9.9380649626255035e-03 + + 5.2774678915739059e-02 -1.5222820639610291e-01 + <_> + + 0 -1 669 -1.8377749249339104e-02 + + 4.6800789237022400e-01 -4.2411230504512787e-02 + <_> + + 0 -1 670 -3.0569550581276417e-03 + + 1.2866629660129547e-01 -9.8308563232421875e-02 + <_> + + 0 -1 671 -1.8440110143274069e-03 + + -2.7592489123344421e-01 1.0050299763679504e-01 + <_> + + 0 -1 672 5.6205368600785732e-03 + + -7.0716217160224915e-02 1.6734069585800171e-01 + <_> + + 0 -1 673 3.4157470799982548e-03 + + 5.2378088235855103e-02 -5.0982749462127686e-01 + <_> + + 0 -1 674 -3.0376210343092680e-03 + + 1.4243629574775696e-01 -6.3037060201168060e-02 + <_> + 67 + -7.4644768238067627e-01 + + <_> + + 0 -1 675 1.0126640088856220e-02 + + -2.1863789856433868e-01 1.7513489723205566e-01 + <_> + + 0 -1 676 -2.6893198955804110e-03 + + -3.2822969555854797e-01 9.9838256835937500e-02 + <_> + + 0 -1 677 -1.5573530457913876e-02 + + 1.9594019651412964e-01 -2.2535979747772217e-01 + <_> + + 0 -1 678 4.9326270818710327e-03 + + 4.9988470971584320e-02 -5.3175377845764160e-01 + <_> + + 0 -1 679 -7.6638202881440520e-04 + + -2.6926669478416443e-01 1.1751429736614227e-01 + <_> + + 0 -1 680 -1.2552300177048892e-04 + + 6.9110788404941559e-02 -8.1727392971515656e-02 + <_> + + 0 -1 681 -1.4519299838866573e-05 + + 1.1483950167894363e-01 -2.3017129302024841e-01 + <_> + + 0 -1 682 -1.6113840043544769e-02 + + 5.0956588983535767e-01 -3.7494029849767685e-02 + <_> + + 0 -1 683 5.5138790048658848e-03 + + -7.8787550330162048e-02 2.3771439492702484e-01 + <_> + + 0 -1 684 8.7763823568820953e-02 + + 1.3863979838788509e-02 -8.9777380228042603e-01 + <_> + + 0 -1 685 -1.2825570069253445e-02 + + -3.9504998922348022e-01 5.5546328425407410e-02 + <_> + + 0 -1 686 8.2099979044869542e-04 + + -1.2663979828357697e-01 1.9081629812717438e-01 + <_> + + 0 -1 687 -1.2775770155712962e-03 + + 1.1065080016851425e-01 -1.9801099598407745e-01 + <_> + + 0 -1 688 -2.5229719281196594e-01 + + -8.1039828062057495e-01 8.3870543166995049e-03 + <_> + + 0 -1 689 7.0347747532650828e-04 + + -2.1380549669265747e-01 9.8673596978187561e-02 + <_> + + 0 -1 690 1.0717480443418026e-02 + + 8.4470443427562714e-02 -2.6063749194145203e-01 + <_> + + 0 -1 691 5.1081487908959389e-03 + + -5.5732220411300659e-02 4.1447860002517700e-01 + <_> + + 0 -1 692 -1.9006159156560898e-02 + + -3.7475249171257019e-01 7.9524833709001541e-03 + <_> + + 0 -1 693 1.1136929970234632e-03 + + -2.2650149464607239e-01 1.0789389908313751e-01 + <_> + + 0 -1 694 1.1141769587993622e-02 + + -4.2054798454046249e-02 1.3697710633277893e-01 + <_> + + 0 -1 695 1.2054879916831851e-03 + + 9.2105977237224579e-02 -2.3083679378032684e-01 + <_> + + 0 -1 696 -2.0797130127903074e-04 + + 8.4210596978664398e-02 -6.6967681050300598e-02 + <_> + + 0 -1 697 -1.6412649303674698e-02 + + 4.2269191145896912e-01 -4.9638699740171432e-02 + <_> + + 0 -1 698 7.0363390259444714e-03 + + 9.0550661087036133e-02 -2.7322870492935181e-01 + <_> + + 0 -1 699 -8.4774550050497055e-03 + + -1.9004869461059570e-01 1.0416539758443832e-01 + <_> + + 0 -1 700 -8.7799631059169769e-02 + + -1. 4.5551471412181854e-03 + <_> + + 0 -1 701 -4.6731110662221909e-02 + + 4.1607761383056641e-01 -6.7924611270427704e-02 + <_> + + 0 -1 702 7.4915830045938492e-03 + + 4.7516189515590668e-02 -4.4306200742721558e-01 + <_> + + 0 -1 703 8.6966790258884430e-03 + + -3.9423149079084396e-02 5.2188277244567871e-01 + <_> + + 0 -1 704 -6.4137862063944340e-03 + + -2.4749429523944855e-01 1.1350250244140625e-01 + <_> + + 0 -1 705 6.4909840002655983e-03 + + -2.0237590372562408e-01 1.1887309700250626e-01 + <_> + + 0 -1 706 1.1677639558911324e-03 + + -9.8187439143657684e-02 1.4470459520816803e-01 + <_> + + 0 -1 707 8.0650653690099716e-03 + + 3.0806429684162140e-02 -5.7410538196563721e-01 + <_> + + 0 -1 708 -6.1450549401342869e-03 + + 1.4213280379772186e-01 -1.2155479937791824e-01 + <_> + + 0 -1 709 3.3926900941878557e-03 + + -6.9425463676452637e-02 3.7945500016212463e-01 + <_> + + 0 -1 710 2.5861251354217529e-01 + + -8.0964984372258186e-03 5.7324391603469849e-01 + <_> + + 0 -1 711 4.6327650547027588e-02 + + 9.3428269028663635e-02 -2.9274320602416992e-01 + <_> + + 0 -1 712 -1.4053919585421681e-05 + + 5.9584300965070724e-02 -1.2193849682807922e-01 + <_> + + 0 -1 713 -5.5521689355373383e-03 + + -3.0268138647079468e-01 7.9481996595859528e-02 + <_> + + 0 -1 714 -7.1974180638790131e-02 + + 5.9862488508224487e-01 -3.2414238899946213e-02 + <_> + + 0 -1 715 -1.1097419774159789e-03 + + -2.2289000451564789e-01 9.4809576869010925e-02 + <_> + + 0 -1 716 1.1012280359864235e-02 + + -5.0954710692167282e-02 2.1996709704399109e-01 + <_> + + 0 -1 717 -1.0663530230522156e-01 + + -7.8257107734680176e-01 2.3075709119439125e-02 + <_> + + 0 -1 718 2.6826610788702965e-02 + + -3.3334378153085709e-02 3.2825571298599243e-01 + <_> + + 0 -1 719 1.6480779275298119e-02 + + 2.4793079122900963e-02 -7.9102367162704468e-01 + <_> + + 0 -1 720 1.4533529756590724e-03 + + -4.7377821058034897e-02 1.8299889564514160e-01 + <_> + + 0 -1 721 4.6536721289157867e-02 + + -4.2217779904603958e-02 4.7201961278915405e-01 + <_> + + 0 -1 722 1.3604049570858479e-02 + + 7.1543172001838684e-02 -2.8175559639930725e-01 + <_> + + 0 -1 723 2.9868748970329762e-03 + + -1.2019319832324982e-01 1.5165250003337860e-01 + <_> + + 0 -1 724 7.5455583631992340e-02 + + 7.6729329302906990e-03 -3.7560600042343140e-01 + <_> + + 0 -1 725 -2.1207109093666077e-03 + + 1.1624389886856079e-01 -1.5187309682369232e-01 + <_> + + 0 -1 726 4.6092201955616474e-03 + + 5.2315160632133484e-02 -2.3050600290298462e-01 + <_> + + 0 -1 727 1.0207670275121927e-03 + + -1.1380010098218918e-01 1.7626440525054932e-01 + <_> + + 0 -1 728 6.2532532028853893e-03 + + 6.1674360185861588e-02 -3.4915238618850708e-01 + <_> + + 0 -1 729 2.8322400525212288e-02 + + -3.9958149194717407e-02 5.2392977476119995e-01 + <_> + + 0 -1 730 -1.6342360526323318e-02 + + -1.2563559412956238e-01 4.0041740983724594e-02 + <_> + + 0 -1 731 -1.8282469827681780e-03 + + 9.1135032474994659e-02 -1.9224719703197479e-01 + <_> + + 0 -1 732 4.4616919010877609e-02 + + -1.7582910135388374e-02 3.0281931161880493e-01 + <_> + + 0 -1 733 3.5677649429999292e-04 + + -8.7897412478923798e-02 2.2339150309562683e-01 + <_> + + 0 -1 734 -4.5413200859911740e-04 + + 6.5522827208042145e-02 -9.9679380655288696e-02 + <_> + + 0 -1 735 1.5353029593825340e-03 + + 6.8590000271797180e-02 -2.9728370904922485e-01 + <_> + + 0 -1 736 2.1600390318781137e-03 + + -8.9736528694629669e-02 8.0284543335437775e-02 + <_> + + 0 -1 737 -5.9745612088590860e-04 + + 2.1873860061168671e-01 -1.1398520320653915e-01 + <_> + + 0 -1 738 -1.2356050312519073e-02 + + -2.9350760579109192e-01 6.4420320093631744e-02 + <_> + + 0 -1 739 -3.2670930027961731e-01 + + 3.8920149207115173e-01 -4.9165409058332443e-02 + <_> + + 0 -1 740 8.7828626856207848e-03 + + 8.6186192929744720e-02 -2.2631849348545074e-01 + <_> + + 0 -1 741 3.3569689840078354e-03 + + -9.1194286942481995e-02 2.1264100074768066e-01 + <_> + 75 + -7.8030252456665039e-01 + + <_> + + 0 -1 742 -1.5290499664843082e-02 + + 1.6011320054531097e-01 -2.1511940658092499e-01 + <_> + + 0 -1 743 -5.9956451877951622e-03 + + -1.8299789726734161e-01 3.7886500358581543e-02 + <_> + + 0 -1 744 6.2301359139382839e-04 + + -1.2199199944734573e-01 2.1163250505924225e-01 + <_> + + 0 -1 745 5.8087380602955818e-04 + + -2.2747389972209930e-01 7.6958037912845612e-02 + <_> + + 0 -1 746 -2.8277048841118813e-03 + + 2.7597460150718689e-01 -7.8942306339740753e-02 + <_> + + 0 -1 747 2.1096320822834969e-02 + + 4.1295919567346573e-02 -3.2933080196380615e-01 + <_> + + 0 -1 748 -2.2117430344223976e-03 + + 2.4672569334506989e-01 -7.3121666908264160e-02 + <_> + + 0 -1 749 -2.3275949060916901e-03 + + -2.2825109958648682e-01 7.9285196959972382e-02 + <_> + + 0 -1 750 -4.4754869304597378e-03 + + 1.1744049936532974e-01 -1.9801409542560577e-01 + <_> + + 0 -1 751 -2.5716619566082954e-03 + + 3.7658710032701492e-02 -1.2148059904575348e-01 + <_> + + 0 -1 752 1.5387970488518476e-03 + + -5.5973250418901443e-02 3.6923429369926453e-01 + <_> + + 0 -1 753 -3.3066518604755402e-02 + + 3.9160001277923584e-01 -7.7862940728664398e-02 + <_> + + 0 -1 754 -8.5727721452713013e-02 + + -2.5174748897552490e-01 1.3543550670146942e-01 + <_> + + 0 -1 755 -7.0333289913833141e-03 + + 1.3328710198402405e-01 -1.5664640069007874e-01 + <_> + + 0 -1 756 -6.8310517235659063e-05 + + 9.9454201757907867e-02 -2.3412980139255524e-01 + <_> + + 0 -1 757 -6.0546118766069412e-04 + + -1.7742669582366943e-01 1.0017810016870499e-01 + <_> + + 0 -1 758 -2.2480569314211607e-03 + + -3.6424639821052551e-01 5.3501259535551071e-02 + <_> + + 0 -1 759 -1.5090550296008587e-03 + + 7.7575050294399261e-02 -9.4920717179775238e-02 + <_> + + 0 -1 760 -5.8666180848376825e-05 + + 1.2585939466953278e-01 -1.4529819786548615e-01 + <_> + + 0 -1 761 3.5532109905034304e-03 + + -9.8626613616943359e-02 7.4326246976852417e-02 + <_> + + 0 -1 762 -1.4601859729737043e-03 + + -3.3026841282844543e-01 6.3813462853431702e-02 + <_> + + 0 -1 763 -2.3586049792356789e-04 + + 1.0846760123968124e-01 -1.0571049898862839e-01 + <_> + + 0 -1 764 1.4756060205399990e-02 + + -5.9472840279340744e-02 3.7792891263961792e-01 + <_> + + 0 -1 765 -1.6795310378074646e-01 + + -6.6773468255996704e-01 1.7404930666089058e-02 + <_> + + 0 -1 766 3.2017670571804047e-02 + + -2.3720450699329376e-01 9.6205927431583405e-02 + <_> + + 0 -1 767 -6.1111792456358671e-04 + + 1.3566890358924866e-01 -6.8121932446956635e-02 + <_> + + 0 -1 768 -1.1586040258407593e-02 + + -2.9761460423469543e-01 6.4853250980377197e-02 + <_> + + 0 -1 769 -1.1290679685771465e-03 + + 1.3520470261573792e-01 -9.0693503618240356e-02 + <_> + + 0 -1 770 1.8352170009166002e-03 + + -9.6694603562355042e-02 1.8725989758968353e-01 + <_> + + 0 -1 771 -2.7584248781204224e-01 + + 2.7460220456123352e-01 -1.6176709905266762e-02 + <_> + + 0 -1 772 -5.2487280219793320e-02 + + -2.6295030117034912e-01 8.4279276430606842e-02 + <_> + + 0 -1 773 -2.8409080579876900e-02 + + 4.4033178687095642e-01 -4.6736340969800949e-02 + <_> + + 0 -1 774 1.2234229594469070e-02 + + 7.1391902863979340e-02 -2.9463478922843933e-01 + <_> + + 0 -1 775 3.7752088159322739e-02 + + -3.2507140189409256e-02 6.2293910980224609e-01 + <_> + + 0 -1 776 -1.3006339780986309e-02 + + -3.5619509220123291e-01 5.7085920125246048e-02 + <_> + + 0 -1 777 -3.7061918992549181e-03 + + 1.7485049366950989e-01 -1.0506869852542877e-01 + <_> + + 0 -1 778 -4.8177209682762623e-03 + + 1.4761090278625488e-01 -1.3700130581855774e-01 + <_> + + 0 -1 779 -3.0726719647645950e-02 + + -2.1432609856128693e-01 3.4535329788923264e-02 + <_> + + 0 -1 780 1.0044399648904800e-02 + + 8.2472868263721466e-02 -2.1329440176486969e-01 + <_> + + 0 -1 781 3.3808979787863791e-04 + + -5.6368399411439896e-02 8.4050692617893219e-02 + <_> + + 0 -1 782 -3.4935539588332176e-04 + + 1.5510140359401703e-01 -1.5465189516544342e-01 + <_> + + 0 -1 783 8.5416442016139627e-04 + + 7.4811212718486786e-02 -2.0761939883232117e-01 + <_> + + 0 -1 784 -7.4278831016272306e-04 + + 2.0695370435714722e-01 -1.1315040290355682e-01 + <_> + + 0 -1 785 -4.1803911328315735e-02 + + 7.7375417947769165e-01 -2.7391599491238594e-02 + <_> + + 0 -1 786 -8.9303712593391538e-04 + + -2.8926849365234375e-01 8.3425313234329224e-02 + <_> + + 0 -1 787 2.0034189801663160e-03 + + 5.7899519801139832e-02 -2.1817860007286072e-01 + <_> + + 0 -1 788 7.4933562427759171e-04 + + -1.3606220483779907e-01 1.6150030493736267e-01 + <_> + + 0 -1 789 -8.9645422995090485e-02 + + -9.5717740058898926e-01 5.8882208541035652e-03 + <_> + + 0 -1 790 -6.5244808793067932e-03 + + 1.4521969854831696e-01 -1.6119849681854248e-01 + <_> + + 0 -1 791 -2.8723690193146467e-03 + + 1.0670810192823410e-01 -3.0505739152431488e-02 + <_> + + 0 -1 792 2.2762219887226820e-03 + + -1.4573380351066589e-01 1.5590649843215942e-01 + <_> + + 0 -1 793 4.3706637807190418e-03 + + -2.4369299411773682e-02 2.0724129676818848e-01 + <_> + + 0 -1 794 1.1989739723503590e-03 + + 8.8461942970752716e-02 -2.2536410391330719e-01 + <_> + + 0 -1 795 -6.1923090834170580e-04 + + 1.5108090639114380e-01 -9.9106341600418091e-02 + <_> + + 0 -1 796 -1.0555429616943002e-03 + + 1.5399299561977386e-01 -1.4410500228404999e-01 + <_> + + 0 -1 797 2.3101890459656715e-02 + + -2.6107529178261757e-02 2.5875169038772583e-01 + <_> + + 0 -1 798 6.7337458021938801e-03 + + 6.4629636704921722e-02 -3.2299819588661194e-01 + <_> + + 0 -1 799 1.4084229478612542e-03 + + 8.5755072534084320e-02 -1.4947549998760223e-01 + <_> + + 0 -1 800 -2.3923629487399012e-04 + + 1.8700890243053436e-01 -1.0941530019044876e-01 + <_> + + 0 -1 801 2.2198690567165613e-04 + + -1.9517560303211212e-01 5.9587858617305756e-02 + <_> + + 0 -1 802 2.8156230691820383e-03 + + -8.9527882635593414e-02 2.2894319891929626e-01 + <_> + + 0 -1 803 7.8730508685112000e-03 + + 6.4139701426029205e-02 -1.7174859344959259e-01 + <_> + + 0 -1 804 1.0448540560901165e-03 + + -2.0927239954471588e-01 1.1022809892892838e-01 + <_> + + 0 -1 805 -1.8041099607944489e-01 + + 2.5460541248321533e-01 -3.1580239534378052e-02 + <_> + + 0 -1 806 -1.8916819989681244e-01 + + -8.1439048051834106e-01 3.0212750658392906e-02 + <_> + + 0 -1 807 -4.8934340476989746e-02 + + 4.8329269886016846e-01 -3.1813390552997589e-02 + <_> + + 0 -1 808 -6.2278551049530506e-03 + + -2.2463080286979675e-01 9.3202292919158936e-02 + <_> + + 0 -1 809 -3.6263489164412022e-03 + + 9.7239963710308075e-02 -2.2094939649105072e-01 + <_> + + 0 -1 810 2.0688530057668686e-02 + + -3.9044689387083054e-02 6.9668918848037720e-01 + <_> + + 0 -1 811 -6.5703191794455051e-03 + + -1.5919350087642670e-01 3.7697389721870422e-02 + <_> + + 0 -1 812 -2.7691440191119909e-03 + + -2.1777799725532532e-01 1.1075550317764282e-01 + <_> + + 0 -1 813 -2.5391899980604649e-03 + + 7.6753303408622742e-02 -1.2121020257472992e-01 + <_> + + 0 -1 814 1.4522899873554707e-02 + + -4.6935468912124634e-02 4.4322049617767334e-01 + <_> + + 0 -1 815 -4.8549640923738480e-03 + + -4.1040301322937012e-01 4.7296289354562759e-02 + <_> + + 0 -1 816 -3.6202149931341410e-03 + + 3.6707898974418640e-01 -5.0583109259605408e-02 + <_> + 79 + -8.1366151571273804e-01 + + <_> + + 0 -1 817 9.7794737666845322e-03 + + -1.9873769581317902e-01 1.8754990398883820e-01 + <_> + + 0 -1 818 2.5764610618352890e-03 + + -1.6544049978256226e-01 1.1968299746513367e-01 + <_> + + 0 -1 819 6.6844018874689937e-04 + + 8.1187427043914795e-02 -2.6954218745231628e-01 + <_> + + 0 -1 820 1.8919180147349834e-03 + + 8.2398690283298492e-02 -1.9564670324325562e-01 + <_> + + 0 -1 821 -8.2977651618421078e-04 + + -2.1381169557571411e-01 1.0152959823608398e-01 + <_> + + 0 -1 822 -2.5124829262495041e-03 + + 2.6497021317481995e-01 -8.1728130578994751e-02 + <_> + + 0 -1 823 4.9220919609069824e-03 + + -1.3837899267673492e-01 1.7047420144081116e-01 + <_> + + 0 -1 824 1.5432259533554316e-03 + + -2.3483499884605408e-01 1.2624679505825043e-01 + <_> + + 0 -1 825 -7.5272549875080585e-03 + + -2.1902580559253693e-01 7.8214943408966064e-02 + <_> + + 0 -1 826 -3.2087319414131343e-04 + + 9.9803313612937927e-02 -1.0052630305290222e-01 + <_> + + 0 -1 827 -5.6291592773050070e-04 + + 1.4587800204753876e-01 -1.3194470107555389e-01 + <_> + + 0 -1 828 -3.4248359501361847e-02 + + 7.3179531097412109e-01 -2.5754369795322418e-02 + <_> + + 0 -1 829 5.5207060649991035e-03 + + 7.3829427361488342e-02 -2.4615940451622009e-01 + <_> + + 0 -1 830 3.3663161098957062e-02 + + -5.0750829279422760e-02 5.1054477691650391e-01 + <_> + + 0 -1 831 1.0605139657855034e-02 + + -1.9593380391597748e-01 9.6162728965282440e-02 + <_> + + 0 -1 832 3.6454470828175545e-03 + + -1.0274770110845566e-01 1.8021290004253387e-01 + <_> + + 0 -1 833 3.1658720225095749e-02 + + 7.7415347099304199e-02 -2.3498320579528809e-01 + <_> + + 0 -1 834 6.0496449470520020e-02 + + 7.9810861498117447e-03 -5.8126330375671387e-01 + <_> + + 0 -1 835 -2.1451190696097910e-04 + + -2.7141410112380981e-01 7.2448231279850006e-02 + <_> + + 0 -1 836 -8.9069753885269165e-03 + + 1.0864660143852234e-01 -3.7890978157520294e-02 + <_> + + 0 -1 837 -3.1367139890789986e-03 + + 2.3194080591201782e-01 -8.3242997527122498e-02 + <_> + + 0 -1 838 -8.2477089017629623e-04 + + 1.3757370412349701e-01 -4.0709521621465683e-02 + <_> + + 0 -1 839 -3.8041090010665357e-04 + + 9.9655948579311371e-02 -2.0115250349044800e-01 + <_> + + 0 -1 840 3.0412159394472837e-03 + + 4.8606388270854950e-02 -2.9261159896850586e-01 + <_> + + 0 -1 841 -2.7135149575769901e-03 + + -2.0402909815311432e-01 8.7270192801952362e-02 + <_> + + 0 -1 842 -1.1454220116138458e-01 + + 2.6342248916625977e-01 -2.8976829722523689e-02 + <_> + + 0 -1 843 -7.9219061881303787e-03 + + -2.3954220116138458e-01 7.8425459563732147e-02 + <_> + + 0 -1 844 -6.4272403717041016e-02 + + 3.8651049137115479e-01 -3.4981280565261841e-02 + <_> + + 0 -1 845 2.0820159465074539e-02 + + 3.6676738411188126e-02 -5.0909721851348877e-01 + <_> + + 0 -1 846 4.7503421083092690e-03 + + -4.9171518534421921e-02 1.8542270362377167e-01 + <_> + + 0 -1 847 -9.3589037656784058e-02 + + 6.2822377681732178e-01 -2.5140469893813133e-02 + <_> + + 0 -1 848 -6.8223377456888556e-04 + + 4.0090799331665039e-02 -1.0250650346279144e-01 + <_> + + 0 -1 849 -8.3058718591928482e-03 + + -2.1625949442386627e-01 8.5505023598670959e-02 + <_> + + 0 -1 850 5.5919620208442211e-03 + + -6.5724261105060577e-02 6.1939451843500137e-02 + <_> + + 0 -1 851 1.8336649518460035e-03 + + -1.0324809700250626e-01 2.5134149193763733e-01 + <_> + + 0 -1 852 -4.4351099058985710e-03 + + -1.5100279450416565e-01 3.7323009222745895e-02 + <_> + + 0 -1 853 -4.7271270304918289e-03 + + 1.3500709831714630e-01 -1.5250219404697418e-01 + <_> + + 0 -1 854 5.3573452169075608e-04 + + -6.0964770615100861e-02 7.1996733546257019e-02 + <_> + + 0 -1 855 -1.3135100016370416e-04 + + 1.2902179360389709e-01 -1.3107609748840332e-01 + <_> + + 0 -1 856 4.0799290873110294e-03 + + 4.9433309584856033e-02 -1.9467090070247650e-01 + <_> + + 0 -1 857 -3.1066180672496557e-03 + + 2.3984549939632416e-01 -7.1281567215919495e-02 + <_> + + 0 -1 858 1.0999400168657303e-02 + + 2.9017930850386620e-02 -3.8504680991172791e-01 + <_> + + 0 -1 859 1.5001590363681316e-03 + + -8.3652436733245850e-02 1.8141129612922668e-01 + <_> + + 0 -1 860 1.3700149953365326e-02 + + 3.6753259599208832e-02 -4.5086589455604553e-01 + <_> + + 0 -1 861 3.9507630281150341e-03 + + -6.9417111575603485e-02 2.1540710330009460e-01 + <_> + + 0 -1 862 -8.5161393508315086e-03 + + 1.0704089701175690e-01 -1.4857380092144012e-01 + <_> + + 0 -1 863 1.7032850300893188e-03 + + -8.1896521151065826e-02 3.2398068904876709e-01 + <_> + + 0 -1 864 -1.0852930136024952e-02 + + -1.3142329454421997e-01 9.9990189075469971e-02 + <_> + + 0 -1 865 -3.7832378875464201e-03 + + 9.7596637904644012e-02 -1.6081459820270538e-01 + <_> + + 0 -1 866 1.3263260014355183e-02 + + 6.8189077079296112e-02 -1.4820660650730133e-01 + <_> + + 0 -1 867 -4.4276300817728043e-02 + + 5.3883999586105347e-01 -3.4769881516695023e-02 + <_> + + 0 -1 868 -1.6476439312100410e-02 + + -6.9341838359832764e-01 3.0285930261015892e-02 + <_> + + 0 -1 869 1.5063960105180740e-02 + + 5.0365351140499115e-02 -3.2215261459350586e-01 + <_> + + 0 -1 870 5.3230069577693939e-02 + + 4.0058908052742481e-03 -1.0000929832458496e+00 + <_> + + 0 -1 871 -1.2282089889049530e-01 + + 4.0438568592071533e-01 -5.4661169648170471e-02 + <_> + + 0 -1 872 -8.0205321311950684e-02 + + -1.8915909528732300e-01 3.5704288631677628e-02 + <_> + + 0 -1 873 -1.1679669842123985e-03 + + -2.7641400694847107e-01 5.9974398463964462e-02 + <_> + + 0 -1 874 -3.1197320204228163e-03 + + 1.1307190358638763e-01 -7.2880730032920837e-02 + <_> + + 0 -1 875 3.6612390540540218e-03 + + -4.7828570008277893e-02 3.9067369699478149e-01 + <_> + + 0 -1 876 4.6034730039536953e-03 + + -4.7448419034481049e-02 3.6146968603134155e-01 + <_> + + 0 -1 877 -1.0733479866757989e-03 + + 1.1264870315790176e-01 -2.9074960947036743e-01 + <_> + + 0 -1 878 -1.8310690298676491e-02 + + 9.6729353070259094e-02 -1.0150820016860962e-01 + <_> + + 0 -1 879 -6.8194739520549774e-02 + + -2.2048689424991608e-01 1.0977990180253983e-01 + <_> + + 0 -1 880 8.9977607131004333e-03 + + -2.9652440920472145e-02 1.5059219300746918e-01 + <_> + + 0 -1 881 2.6954131317324936e-04 + + -1.9917850196361542e-01 9.4677992165088654e-02 + <_> + + 0 -1 882 5.9090729337185621e-04 + + -1.3240300118923187e-01 6.3088178634643555e-02 + <_> + + 0 -1 883 5.5691739544272423e-03 + + 1.0318289697170258e-01 -1.9276739656925201e-01 + <_> + + 0 -1 884 -9.9434129893779755e-02 + + 2.5911080837249756e-01 -4.3947871774435043e-02 + <_> + + 0 -1 885 -9.6295922994613647e-03 + + -3.6871969699859619e-01 4.6506170183420181e-02 + <_> + + 0 -1 886 -1.7397940391674638e-03 + + 1.3736039400100708e-01 -6.9822482764720917e-02 + <_> + + 0 -1 887 -1.3269430026412010e-02 + + 4.5216149091720581e-01 -3.8461238145828247e-02 + <_> + + 0 -1 888 2.5604839902371168e-03 + + 5.4858781397342682e-02 -2.4963529407978058e-01 + <_> + + 0 -1 889 -1.9173050532117486e-03 + + -2.5733208656311035e-01 6.7481383681297302e-02 + <_> + + 0 -1 890 -3.7461649626493454e-02 + + 5.9668248891830444e-01 -1.8121080473065376e-02 + <_> + + 0 -1 891 -1.9658938981592655e-03 + + 1.9501520693302155e-01 -9.0026341378688812e-02 + <_> + + 0 -1 892 -3.2596408855170012e-03 + + -3.5647168755531311e-01 4.6495281159877777e-02 + <_> + + 0 -1 893 -1.2043650262057781e-02 + + 3.7508749961853027e-01 -5.3072199225425720e-02 + <_> + + 0 -1 894 4.1690650396049023e-03 + + -4.1845761239528656e-02 1.1177790164947510e-01 + <_> + + 0 -1 895 1.4214499853551388e-02 + + 7.1965761482715607e-02 -2.6777520775794983e-01 + <_> + 81 + -3.0813199996948242e+01 + + <_> + + 0 -1 896 -1.2230969965457916e-02 + + 1.4567610621452332e-01 -2.4045179784297943e-01 + <_> + + 0 -1 897 -5.5717672221362591e-03 + + -1.8789610266685486e-01 4.0596708655357361e-02 + <_> + + 0 -1 898 -5.5606552632525563e-04 + + 1.6649569571018219e-01 -1.1817839741706848e-01 + <_> + + 0 -1 899 8.3173572784289718e-04 + + -1.4224030077457428e-01 4.1616160422563553e-02 + <_> + + 0 -1 900 -8.7869318667799234e-04 + + -1.6430449485778809e-01 1.5523290634155273e-01 + <_> + + 0 -1 901 -1.3641480356454849e-02 + + 3.0867528915405273e-01 -2.7172269299626350e-02 + <_> + + 0 -1 902 1.4917860426066909e-05 + + -1.5592050552368164e-01 1.0176579654216766e-01 + <_> + + 0 -1 903 8.7703643366694450e-03 + + 6.1582878232002258e-02 -3.0546051263809204e-01 + <_> + + 0 -1 904 7.5755198486149311e-03 + + -6.8759873509407043e-02 2.9675748944282532e-01 + <_> + + 0 -1 905 4.9841161817312241e-02 + + 1.0127910412847996e-02 -7.9213422536849976e-01 + <_> + + 0 -1 906 -1.1090819723904133e-02 + + 1.8339020013809204e-01 -1.0113699734210968e-01 + <_> + + 0 -1 907 -8.5937082767486572e-02 + + -4.1994568705558777e-01 1.5568479895591736e-02 + <_> + + 0 -1 908 -1.0151329915970564e-03 + + 1.1474460363388062e-01 -1.6091680526733398e-01 + <_> + + 0 -1 909 -1.3470250181853771e-02 + + -3.0626448988914490e-01 5.3186140954494476e-02 + <_> + + 0 -1 910 1.6635110601782799e-02 + + -4.3458938598632812e-02 4.4043311476707458e-01 + <_> + + 0 -1 911 -2.2650870960205793e-03 + + 1.5985119342803955e-01 -1.2725980579853058e-01 + <_> + + 0 -1 912 7.0288166403770447e-02 + + 6.4891628921031952e-02 -2.3496179282665253e-01 + <_> + + 0 -1 913 2.9186379164457321e-02 + + -2.0920279622077942e-01 8.9257873594760895e-02 + <_> + + 0 -1 914 -5.0624469295144081e-03 + + 3.4374091029167175e-01 -6.2093049287796021e-02 + <_> + + 0 -1 915 2.9356318991631269e-03 + + -1.4249369502067566e-01 4.5412261039018631e-02 + <_> + + 0 -1 916 -6.7740739323198795e-03 + + 3.1641799211502075e-01 -4.9601629376411438e-02 + <_> + + 0 -1 917 -1.4607170305680484e-04 + + 1.0752049833536148e-01 -1.1540039628744125e-01 + <_> + + 0 -1 918 -3.5684450995177031e-03 + + -4.1672629117965698e-01 4.2202819138765335e-02 + <_> + + 0 -1 919 -2.0149808842688799e-03 + + 1.0860130190849304e-01 -1.6349700093269348e-01 + <_> + + 0 -1 920 -8.7240645661950111e-03 + + -2.2000640630722046e-01 9.0927027165889740e-02 + <_> + + 0 -1 921 7.3565947823226452e-03 + + -1.0335700213909149e-01 1.6051970422267914e-01 + <_> + + 0 -1 922 3.4252731129527092e-03 + + -6.9635637104511261e-02 3.1490880250930786e-01 + <_> + + 0 -1 923 -5.7803248055279255e-03 + + -4.3639171123504639e-01 3.6127548664808273e-02 + <_> + + 0 -1 924 -2.9641189612448215e-03 + + 2.1797280013561249e-01 -7.7875941991806030e-02 + <_> + + 0 -1 925 2.4028679355978966e-02 + + 2.5940960273146629e-02 -5.7640588283538818e-01 + <_> + + 0 -1 926 8.1514477729797363e-02 + + -3.4380380064249039e-02 5.7957500219345093e-01 + <_> + + 0 -1 927 6.7858170950785279e-04 + + 1.0398740321397781e-01 -2.3831090331077576e-01 + <_> + + 0 -1 928 4.2639520019292831e-02 + + -4.1167970746755600e-02 4.0556749701499939e-01 + <_> + + 0 -1 929 -4.0414459072053432e-03 + + -3.8652890920639038e-01 5.3053580224514008e-02 + <_> + + 0 -1 930 4.2280308902263641e-02 + + 1.5058529563248158e-02 -9.6623957157135010e-01 + <_> + + 0 -1 931 -7.3401766712777317e-05 + + 8.4438636898994446e-02 -1.0468550026416779e-01 + <_> + + 0 -1 932 4.7503020614385605e-03 + + -3.8135491311550140e-02 4.3066629767417908e-01 + <_> + + 0 -1 933 1.7291309777647257e-03 + + 7.5733587145805359e-02 -1.5384200215339661e-01 + <_> + + 0 -1 934 -4.8985757166519761e-04 + + 1.3722479343414307e-01 -1.2631259858608246e-01 + <_> + + 0 -1 935 -2.2209450253285468e-04 + + 5.1139138638973236e-02 -6.6661313176155090e-02 + <_> + + 0 -1 936 1.1202819878235459e-03 + + -1.0968499630689621e-01 1.5611450374126434e-01 + <_> + + 0 -1 937 -2.0596029236912727e-02 + + -4.5425260066986084e-01 5.6112911552190781e-03 + <_> + + 0 -1 938 -5.1287859678268433e-03 + + -3.9422529935836792e-01 4.4144820421934128e-02 + <_> + + 0 -1 939 -4.3597300536930561e-03 + + 1.9391660392284393e-01 -6.5949328243732452e-02 + <_> + + 0 -1 940 4.7703061136417091e-04 + + -1.1900710314512253e-01 1.6375440359115601e-01 + <_> + + 0 -1 941 -1.0993770323693752e-02 + + -2.9915741086006165e-01 2.8793500736355782e-02 + <_> + + 0 -1 942 8.1108389422297478e-03 + + -4.8145949840545654e-02 3.8399958610534668e-01 + <_> + + 0 -1 943 -3.6698309704661369e-03 + + 8.8712036609649658e-02 -3.0650860071182251e-01 + <_> + + 0 -1 944 1.3895990559831262e-03 + + -5.5156201124191284e-02 3.5109901428222656e-01 + <_> + + 0 -1 945 1.2493750546127558e-03 + + -1.8023060262203217e-01 1.3490100204944611e-01 + <_> + + 0 -1 946 5.5981278419494629e-03 + + 7.9764246940612793e-02 -2.7847459912300110e-01 + <_> + + 0 -1 947 -3.8133479654788971e-02 + + 3.5153418779373169e-01 -1.7089430242776871e-02 + <_> + + 0 -1 948 -4.6064890921115875e-03 + + -2.2194199264049530e-01 1.0675799846649170e-01 + <_> + + 0 -1 949 -2.3793010413646698e-01 + + 4.0079510211944580e-01 -6.2151808291673660e-02 + <_> + + 0 -1 950 1.2010410428047180e-02 + + 5.8646921068429947e-02 -3.5234829783439636e-01 + <_> + + 0 -1 951 8.4618777036666870e-03 + + -4.1455499827861786e-02 3.9362218976020813e-01 + <_> + + 0 -1 952 -1.4482599683105946e-02 + + -2.7049958705902100e-01 6.9400496780872345e-02 + <_> + + 0 -1 953 2.5672810152173042e-03 + + -8.2357987761497498e-02 2.2959560155868530e-01 + <_> + + 0 -1 954 6.8167857825756073e-03 + + 8.5212066769599915e-02 -2.2813120484352112e-01 + <_> + + 0 -1 955 -6.4145028591156006e-04 + + 1.3260249793529510e-01 -8.1091962754726410e-02 + <_> + + 0 -1 956 3.8798429886810482e-04 + + -2.1800529956817627e-01 8.2977667450904846e-02 + <_> + + 0 -1 957 2.6308000087738037e-02 + + -2.5558909401297569e-02 5.8989650011062622e-01 + <_> + + 0 -1 958 2.0907879807054996e-03 + + 5.7611741125583649e-02 -3.0286490917205811e-01 + <_> + + 0 -1 959 -1.1132369749248028e-02 + + -1.3822869956493378e-01 4.2258080095052719e-02 + <_> + + 0 -1 960 -1.5296150231733918e-03 + + 9.1749697923660278e-02 -2.2181099653244019e-01 + <_> + + 0 -1 961 6.7247601691633463e-04 + + -6.7084349691867828e-02 7.9762071371078491e-02 + <_> + + 0 -1 962 1.0386659763753414e-02 + + -7.4621170759201050e-02 2.2916689515113831e-01 + <_> + + 0 -1 963 6.2723900191485882e-04 + + -8.6500599980354309e-02 9.7814910113811493e-02 + <_> + + 0 -1 964 1.5324779786169529e-02 + + 8.0094330012798309e-02 -2.2011950612068176e-01 + <_> + + 0 -1 965 -8.7603963911533356e-03 + + 3.1290820240974426e-01 -5.9373341500759125e-02 + <_> + + 0 -1 966 -2.3745700309518725e-04 + + 1.1855959892272949e-01 -1.4514200389385223e-01 + <_> + + 0 -1 967 -1.0718279518187046e-03 + + 1.2567649781703949e-01 -5.3101938217878342e-02 + <_> + + 0 -1 968 5.3873867727816105e-04 + + -1.0715659707784653e-01 1.6037760674953461e-01 + <_> + + 0 -1 969 -6.9268636405467987e-02 + + -7.9294067621231079e-01 8.2057341933250427e-03 + <_> + + 0 -1 970 1.0430130176246166e-02 + + 5.1620200276374817e-02 -3.3472689986228943e-01 + <_> + + 0 -1 971 7.1888908743858337e-02 + + 1.5941270394250751e-03 -8.5840928554534912e-01 + <_> + + 0 -1 972 2.0217420533299446e-02 + + -3.9817400276660919e-02 4.6351060271263123e-01 + <_> + + 0 -1 973 5.8006029576063156e-03 + + -2.1701389923691750e-02 9.9040143191814423e-02 + <_> + + 0 -1 974 3.5261210054159164e-02 + + 1.7082870006561279e-02 -1.0000469684600830e+00 + <_> + + 0 -1 975 -4.5255878567695618e-01 + + -9.1292119026184082e-01 5.2670161239802837e-03 + <_> + + 0 -1 976 -7.5286221690475941e-03 + + -5.2581560611724854e-01 2.2044740617275238e-02 + <_> + 89 + -3.0780099868774414e+01 + + <_> + + 0 -1 977 2.9085609130561352e-03 + + -2.0195980370044708e-01 1.6118539869785309e-01 + <_> + + 0 -1 978 -6.4552230760455132e-03 + + -1.8676100671291351e-01 3.5359650850296021e-02 + <_> + + 0 -1 979 2.7815890498459339e-03 + + -1.2228749692440033e-01 2.0362569391727448e-01 + <_> + + 0 -1 980 -7.6125850901007652e-03 + + -3.6965709924697876e-01 3.9566628634929657e-02 + <_> + + 0 -1 981 -2.5900858640670776e-01 + + 6.4312630891799927e-01 3.1312569626607001e-04 + <_> + + 0 -1 982 4.6097189188003540e-03 + + -2.7262160554528236e-02 2.1891650557518005e-01 + <_> + + 0 -1 983 -1.4135500416159630e-02 + + 7.6006792485713959e-02 -2.6031088829040527e-01 + <_> + + 0 -1 984 -5.9708990156650543e-03 + + -1.9146460294723511e-01 1.1078900098800659e-01 + <_> + + 0 -1 985 -1.0699110571295023e-03 + + 9.0127058327198029e-02 -1.9876359403133392e-01 + <_> + + 0 -1 986 1.5315730124711990e-02 + + 5.1883369684219360e-02 -3.1069299578666687e-01 + <_> + + 0 -1 987 -7.3937349952757359e-05 + + 1.0555309802293777e-01 -1.6768750548362732e-01 + <_> + + 0 -1 988 -8.1876888871192932e-02 + + 4.6053099632263184e-01 -3.8276348263025284e-02 + <_> + + 0 -1 989 -8.8246334344148636e-03 + + -3.3107680082321167e-01 6.9674566388130188e-02 + <_> + + 0 -1 990 -3.7569031119346619e-03 + + -2.7566310763359070e-01 6.9375626742839813e-02 + <_> + + 0 -1 991 -3.6343189422041178e-03 + + 1.6658850014209747e-01 -1.2031579762697220e-01 + <_> + + 0 -1 992 2.1979490295052528e-02 + + -2.2316349670290947e-02 3.4402579069137573e-01 + <_> + + 0 -1 993 6.1386551707983017e-02 + + 1.7906000837683678e-02 -8.8129872083663940e-01 + <_> + + 0 -1 994 2.7061739936470985e-02 + + -3.2444350421428680e-02 2.8866448998451233e-01 + <_> + + 0 -1 995 -9.5964036881923676e-03 + + -3.0743318796157837e-01 5.2499480545520782e-02 + <_> + + 0 -1 996 -1.7550870543345809e-03 + + 1.0434249788522720e-01 -1.1126209795475006e-01 + <_> + + 0 -1 997 1.6808100044727325e-03 + + -1.1712419986724854e-01 1.5606869757175446e-01 + <_> + + 0 -1 998 -1.3623350532725453e-03 + + 2.2637459635734558e-01 -8.6454801261425018e-02 + <_> + + 0 -1 999 -3.6580429878085852e-03 + + -3.9829111099243164e-01 4.7143589705228806e-02 + <_> + + 0 -1 1000 5.2668720483779907e-02 + + -1.9696790724992752e-02 4.2998239398002625e-01 + <_> + + 0 -1 1001 -3.4802549635060132e-04 + + 9.1115236282348633e-02 -2.0480670034885406e-01 + <_> + + 0 -1 1002 1.2204200029373169e-03 + + 3.3061511814594269e-02 -1.7324869334697723e-01 + <_> + + 0 -1 1003 -9.4577670097351074e-03 + + 2.9774200916290283e-01 -5.8979131281375885e-02 + <_> + + 0 -1 1004 -1.7641530139371753e-03 + + -9.6304766833782196e-02 6.5304636955261230e-02 + <_> + + 0 -1 1005 8.1057827919721603e-03 + + 5.7158369570970535e-02 -3.1123921275138855e-01 + <_> + + 0 -1 1006 1.3963400386273861e-02 + + -3.5234641283750534e-02 3.5719850659370422e-01 + <_> + + 0 -1 1007 -3.1854680273681879e-03 + + -2.1528400480747223e-01 7.6040878891944885e-02 + <_> + + 0 -1 1008 -4.3546650558710098e-03 + + -8.3892293274402618e-02 2.8290690854191780e-02 + <_> + + 0 -1 1009 -1.6740639694035053e-03 + + 1.5145839750766754e-01 -1.1756320297718048e-01 + <_> + + 0 -1 1010 -2.7018489781767130e-03 + + 1.3833570480346680e-01 -5.0832830369472504e-02 + <_> + + 0 -1 1011 2.2117499611340463e-04 + + -2.3960849642753601e-01 7.5004346668720245e-02 + <_> + + 0 -1 1012 2.2773200646042824e-02 + + -2.2433629259467125e-02 3.7049260735511780e-01 + <_> + + 0 -1 1013 9.5928199589252472e-03 + + 9.7205437719821930e-02 -1.7737109959125519e-01 + <_> + + 0 -1 1014 3.3168029040098190e-03 + + -5.6414358317852020e-02 9.1938421130180359e-02 + <_> + + 0 -1 1015 -2.3929888848215342e-03 + + 2.1076680719852448e-01 -9.2880353331565857e-02 + <_> + + 0 -1 1016 -1.0766570456326008e-02 + + -1.2974379956722260e-01 5.9958908706903458e-02 + <_> + + 0 -1 1017 9.9714798852801323e-04 + + -1.4279229938983917e-01 1.4279709756374359e-01 + <_> + + 0 -1 1018 -6.6825798712670803e-03 + + -2.3819839954376221e-01 4.8119660466909409e-02 + <_> + + 0 -1 1019 -3.7201410159468651e-03 + + 1.9953179359436035e-01 -9.0783573687076569e-02 + <_> + + 0 -1 1020 -1.8553409725427628e-02 + + -2.6621541380882263e-01 2.2872749716043472e-02 + <_> + + 0 -1 1021 3.0256200116127729e-03 + + -9.1106131672859192e-02 2.4559549987316132e-01 + <_> + + 0 -1 1022 -6.2146309763193130e-02 + + -1. 5.2797337993979454e-03 + <_> + + 0 -1 1023 1.7690609674900770e-03 + + -1.9379650056362152e-01 9.5696106553077698e-02 + <_> + + 0 -1 1024 -4.3277359509374946e-05 + + 1.1374049633741379e-01 -1.3504849374294281e-01 + <_> + + 0 -1 1025 1.2779419776052237e-03 + + 7.9606160521507263e-02 -2.3597019910812378e-01 + <_> + + 0 -1 1026 -4.4742479920387268e-02 + + 1.8557150661945343e-01 -3.4167829900979996e-02 + <_> + + 0 -1 1027 2.7726130792871118e-04 + + -5.7937718927860260e-02 2.8903219103813171e-01 + <_> + + 0 -1 1028 5.6225471198558807e-02 + + 1.3840789906680584e-02 -7.7199739217758179e-01 + <_> + + 0 -1 1029 8.6825769394636154e-03 + + -1.8263089656829834e-01 1.1423269659280777e-01 + <_> + + 0 -1 1030 -2.4038869887590408e-03 + + -1.9004139304161072e-01 6.5928563475608826e-02 + <_> + + 0 -1 1031 1.2840219773352146e-02 + + -3.6279100924730301e-02 4.5519340038299561e-01 + <_> + + 0 -1 1032 1.1061480036005378e-03 + + -6.3054688274860382e-02 8.1609472632408142e-02 + <_> + + 0 -1 1033 -4.6486179344356060e-03 + + -2.7108541131019592e-01 8.0167703330516815e-02 + <_> + + 0 -1 1034 6.4021991565823555e-03 + + -6.6946588456630707e-02 1.0634910315275192e-01 + <_> + + 0 -1 1035 -8.2370378077030182e-02 + + 3.4517300128936768e-01 -4.8468429595232010e-02 + <_> + + 0 -1 1036 -3.7429828196763992e-02 + + -6.9630950689315796e-01 1.3054380193352699e-02 + <_> + + 0 -1 1037 1.0500400327146053e-02 + + 9.6028283238410950e-02 -2.6362740993499756e-01 + <_> + + 0 -1 1038 6.8851239979267120e-02 + + 3.7341150455176830e-03 -9.9989157915115356e-01 + <_> + + 0 -1 1039 1.0171310277655721e-03 + + -2.3500110208988190e-01 9.1097183525562286e-02 + <_> + + 0 -1 1040 -2.9057949781417847e-02 + + 5.9977847337722778e-01 -3.6899000406265259e-02 + <_> + + 0 -1 1041 2.2022729739546776e-02 + + 5.8034650981426239e-02 -3.2748758792877197e-01 + <_> + + 0 -1 1042 -4.3123541399836540e-03 + + 2.2153949737548828e-01 -6.1332020908594131e-02 + <_> + + 0 -1 1043 1.0949710384011269e-02 + + 2.1837379783391953e-02 -7.4662190675735474e-01 + <_> + + 0 -1 1044 4.3610740453004837e-02 + + -4.5098949223756790e-02 2.8109139204025269e-01 + <_> + + 0 -1 1045 7.7252179384231567e-02 + + 2.0801780745387077e-02 -8.6648237705230713e-01 + <_> + + 0 -1 1046 -2.4023890495300293e-02 + + 3.9884421229362488e-01 -3.5227119922637939e-02 + <_> + + 0 -1 1047 1.9559780135750771e-02 + + 3.5944730043411255e-02 -5.1469117403030396e-01 + <_> + + 0 -1 1048 2.5917299091815948e-02 + + -1.2942669913172722e-02 4.1695970296859741e-01 + <_> + + 0 -1 1049 -4.6949301031418145e-04 + + 1.6665999591350555e-01 -9.0680040419101715e-02 + <_> + + 0 -1 1050 -8.4590032696723938e-02 + + -5.9283781051635742e-01 7.2113061323761940e-03 + <_> + + 0 -1 1051 -8.9234940242022276e-04 + + 1.7458200454711914e-01 -1.0072509944438934e-01 + <_> + + 0 -1 1052 -2.4009350687265396e-02 + + -3.9131438732147217e-01 2.2361040115356445e-02 + <_> + + 0 -1 1053 -4.7586968867108226e-04 + + 1.8306100368499756e-01 -1.2541130185127258e-01 + <_> + + 0 -1 1054 2.9483099933713675e-03 + + 6.5301053225994110e-02 -2.0387080311775208e-01 + <_> + + 0 -1 1055 3.6947780754417181e-03 + + -6.0878321528434753e-02 3.0403020977973938e-01 + <_> + + 0 -1 1056 -2.9413169249892235e-03 + + -3.0284491181373596e-01 4.7550499439239502e-02 + <_> + + 0 -1 1057 -7.1274640504270792e-04 + + 1.6200789809226990e-01 -1.1822160333395004e-01 + <_> + + 0 -1 1058 2.4309750646352768e-02 + + -1.1442789807915688e-02 2.0453959703445435e-01 + <_> + + 0 -1 1059 -9.1473112115636468e-04 + + -2.0707829296588898e-01 7.5701341032981873e-02 + <_> + + 0 -1 1060 -3.6473390646278858e-03 + + 2.4093860387802124e-01 -8.3565562963485718e-02 + <_> + + 0 -1 1061 1.2513220310211182e-02 + + 4.1536040604114532e-02 -3.7487721443176270e-01 + <_> + + 0 -1 1062 6.2148571014404297e-03 + + 2.0434129983186722e-02 -9.0057849884033203e-02 + <_> + + 0 -1 1063 -2.0954229403287172e-03 + + 1.1625260114669800e-01 -1.8561770021915436e-01 + <_> + + 0 -1 1064 -2.1173250675201416e-01 + + -1. 2.4372090119868517e-03 + <_> + + 0 -1 1065 1.0188589803874493e-03 + + -7.5683966279029846e-02 2.9555431008338928e-01 + <_> + 77 + -3.0694400787353516e+01 + + <_> + + 0 -1 1066 -2.4422600865364075e-02 + + 2.0446979999542236e-01 -2.2299669682979584e-01 + <_> + + 0 -1 1067 1.0574000189080834e-03 + + -1.4355170726776123e-01 8.5603542625904083e-02 + <_> + + 0 -1 1068 2.5123930536210537e-03 + + 1.0997679829597473e-01 -2.3044809699058533e-01 + <_> + + 0 -1 1069 1.2112739682197571e-01 + + 3.3267501741647720e-02 -9.9910151958465576e-01 + <_> + + 0 -1 1070 2.9103590641170740e-03 + + -1.0391929745674133e-01 1.9292880594730377e-01 + <_> + + 0 -1 1071 -8.6717177182435989e-03 + + -2.7087220549583435e-01 9.9762901663780212e-02 + <_> + + 0 -1 1072 6.1140959151089191e-03 + + -1.1517100036144257e-01 2.0429219305515289e-01 + <_> + + 0 -1 1073 2.0590990781784058e-02 + + -3.3107578754425049e-02 4.6375459432601929e-01 + <_> + + 0 -1 1074 1.1507490416988730e-03 + + 7.6014623045921326e-02 -2.7485209703445435e-01 + <_> + + 0 -1 1075 6.5449788235127926e-03 + + -1.1266589909791946e-01 5.0031568855047226e-02 + <_> + + 0 -1 1076 1.6102850204333663e-03 + + -1.8794959783554077e-01 1.1234410107135773e-01 + <_> + + 0 -1 1077 2.8527909889817238e-03 + + 4.0457468479871750e-02 -8.4716461598873138e-02 + <_> + + 0 -1 1078 -4.0883300825953484e-03 + + 1.2509189546108246e-01 -1.4850109815597534e-01 + <_> + + 0 -1 1079 1.6648479504510760e-03 + + -1.0346720367670059e-01 5.3585231304168701e-02 + <_> + + 0 -1 1080 -3.1635090708732605e-03 + + -3.3729389309883118e-01 6.1192918568849564e-02 + <_> + + 0 -1 1081 -1.0922599583864212e-02 + + 4.5238488912582397e-01 -5.7903379201889038e-02 + <_> + + 0 -1 1082 -3.3356929197907448e-03 + + 3.3880978822708130e-01 -6.4470112323760986e-02 + <_> + + 0 -1 1083 -3.0014500021934509e-02 + + -8.2835501432418823e-01 2.4696119129657745e-02 + <_> + + 0 -1 1084 -3.0110439658164978e-01 + + -8.3429050445556641e-01 1.4369309879839420e-02 + <_> + + 0 -1 1085 -4.2447918094694614e-03 + + -1.2281739711761475e-01 2.8134100139141083e-02 + <_> + + 0 -1 1086 7.7825621701776981e-03 + + -6.9222308695316315e-02 2.5814509391784668e-01 + <_> + + 0 -1 1087 -1.2726710177958012e-02 + + 1.0745859891176224e-01 -7.6575823128223419e-02 + <_> + + 0 -1 1088 4.7346940264105797e-03 + + 4.4127859175205231e-02 -3.8045680522918701e-01 + <_> + + 0 -1 1089 3.4512639977037907e-03 + + -4.2947210371494293e-02 4.6074831485748291e-01 + <_> + + 0 -1 1090 5.6996050989255309e-04 + + 6.6926121711730957e-02 -2.9685848951339722e-01 + <_> + + 0 -1 1091 -5.3889099508523941e-02 + + -1. 3.9760880172252655e-03 + <_> + + 0 -1 1092 1.0263220174238086e-03 + + -1.1138930171728134e-01 1.7764210700988770e-01 + <_> + + 0 -1 1093 3.9374440908432007e-02 + + 1.2977429665625095e-02 -6.3669937849044800e-01 + <_> + + 0 -1 1094 1.8777979537844658e-02 + + -3.9334569126367569e-02 4.5990169048309326e-01 + <_> + + 0 -1 1095 1.5851920470595360e-03 + + -1.0917869955301285e-01 5.6247789412736893e-02 + <_> + + 0 -1 1096 -1.0857740417122841e-02 + + -2.0176340639591217e-01 9.0685456991195679e-02 + <_> + + 0 -1 1097 4.4399261474609375e-02 + + 1.9891490228474140e-03 -9.9981158971786499e-01 + <_> + + 0 -1 1098 -1.7311190022155643e-03 + + 1.4699029922485352e-01 -1.4069539308547974e-01 + <_> + + 0 -1 1099 -1.6609770245850086e-03 + + 1.6190530359745026e-01 -5.5535599589347839e-02 + <_> + + 0 -1 1100 -4.3332851491868496e-03 + + -3.3971568942070007e-01 4.3209198862314224e-02 + <_> + + 0 -1 1101 -4.4786658691009507e-05 + + 1.0217490047216415e-01 -1.0289809852838516e-01 + <_> + + 0 -1 1102 -1.2255939655005932e-02 + + 4.6331259608268738e-01 -3.8829129189252853e-02 + <_> + + 0 -1 1103 3.1728390604257584e-02 + + -1.0918959975242615e-02 1.9252130389213562e-01 + <_> + + 0 -1 1104 8.6054168641567230e-03 + + 5.3962308913469315e-02 -3.3835870027542114e-01 + <_> + + 0 -1 1105 2.4249579291790724e-03 + + -4.3876059353351593e-02 2.4977789819240570e-01 + <_> + + 0 -1 1106 -1.9957860931754112e-03 + + 1.1398400366306305e-01 -1.7925310134887695e-01 + <_> + + 0 -1 1107 4.6042509377002716e-02 + + 2.0680939778685570e-03 -8.7673932313919067e-01 + <_> + + 0 -1 1108 2.4898271076381207e-03 + + -6.9595612585544586e-02 2.6142540574073792e-01 + <_> + + 0 -1 1109 1.0052820434793830e-03 + + 4.5501660555601120e-02 -1.2399580329656601e-01 + <_> + + 0 -1 1110 9.0297553688287735e-03 + + -7.1272410452365875e-02 2.2919359803199768e-01 + <_> + + 0 -1 1111 1.2028490193188190e-02 + + 2.0230330526828766e-02 -3.4052988886833191e-01 + <_> + + 0 -1 1112 2.3313730489462614e-03 + + 8.7259337306022644e-02 -2.3195190727710724e-01 + <_> + + 0 -1 1113 9.5184362726286054e-04 + + -2.3168809711933136e-01 5.5022191256284714e-02 + <_> + + 0 -1 1114 9.6378661692142487e-03 + + -4.1655559092760086e-02 4.2928260564804077e-01 + <_> + + 0 -1 1115 1.3566980138421059e-02 + + 4.5669659972190857e-02 -2.2501240670681000e-01 + <_> + + 0 -1 1116 3.3653501421213150e-02 + + -6.7861579358577728e-02 3.6967611312866211e-01 + <_> + + 0 -1 1117 -6.0395020991563797e-02 + + -9.0887361764907837e-01 3.8193699438124895e-03 + <_> + + 0 -1 1118 1.3169209705665708e-03 + + -1.5941339731216431e-01 1.4766550064086914e-01 + <_> + + 0 -1 1119 -9.7704064100980759e-03 + + -1.2848410010337830e-01 4.7832399606704712e-02 + <_> + + 0 -1 1120 -4.5100511051714420e-03 + + 1.2574909627437592e-01 -2.1964469552040100e-01 + <_> + + 0 -1 1121 -2.0346629898995161e-03 + + -1.8574400246143341e-01 4.9177091568708420e-02 + <_> + + 0 -1 1122 1.3294390402734280e-02 + + 9.1497242450714111e-02 -2.1343930065631866e-01 + <_> + + 0 -1 1123 -4.0054250508546829e-02 + + 3.1770059466362000e-01 -3.1080769374966621e-02 + <_> + + 0 -1 1124 2.5492990389466286e-02 + + 3.8877040147781372e-02 -4.5658990740776062e-01 + <_> + + 0 -1 1125 -3.8089688867330551e-02 + + 6.6615498065948486e-01 -1.9895339384675026e-02 + <_> + + 0 -1 1126 -2.1308319270610809e-01 + + -8.6534178256988525e-01 2.0898429676890373e-02 + <_> + + 0 -1 1127 -8.9727543294429779e-02 + + 2.5725919008255005e-01 -4.6261668205261230e-02 + <_> + + 0 -1 1128 2.5075700134038925e-02 + + 4.1259508579969406e-02 -3.7666648626327515e-01 + <_> + + 0 -1 1129 2.3366149514913559e-02 + + -7.2202831506729126e-02 2.4737030267715454e-01 + <_> + + 0 -1 1130 2.8038409072905779e-04 + + -7.9473547637462616e-02 2.2478230297565460e-01 + <_> + + 0 -1 1131 8.2364194095134735e-03 + + 5.1211010664701462e-02 -1.3328659534454346e-01 + <_> + + 0 -1 1132 5.3922779858112335e-02 + + 1.7108399420976639e-02 -8.9256042242050171e-01 + <_> + + 0 -1 1133 2.7015779633074999e-03 + + -1.8405599892139435e-01 1.2830390036106110e-01 + <_> + + 0 -1 1134 -1.6505690291523933e-02 + + 6.2239181995391846e-01 -2.6413690298795700e-02 + <_> + + 0 -1 1135 -1.8418730469420552e-03 + + -1.2646800279617310e-01 4.8690851777791977e-02 + <_> + + 0 -1 1136 5.1953629590570927e-03 + + 4.5653700828552246e-02 -3.2519981265068054e-01 + <_> + + 0 -1 1137 5.0785308703780174e-03 + + 4.0703259408473969e-02 -2.0620769262313843e-01 + <_> + + 0 -1 1138 5.0687040202319622e-03 + + -7.6456248760223389e-02 2.5867408514022827e-01 + <_> + + 0 -1 1139 -1.1892319656908512e-02 + + -2.2366219758987427e-01 3.0855409801006317e-02 + <_> + + 0 -1 1140 2.4257500190287828e-03 + + -7.1597889065742493e-02 2.6108819246292114e-01 + <_> + + 0 -1 1141 -1.1990379542112350e-02 + + 2.2678479552268982e-01 -1.0305509716272354e-01 + <_> + + 0 -1 1142 -2.2772200405597687e-02 + + -2.3770140111446381e-01 7.6630853116512299e-02 + <_> + 78 + -3.0664699554443359e+01 + + <_> + + 0 -1 1143 3.3625920768827200e-03 + + -1.8268440663814545e-01 1.5935519337654114e-01 + <_> + + 0 -1 1144 4.4937757775187492e-03 + + -8.9438192546367645e-02 2.8422310948371887e-01 + <_> + + 0 -1 1145 -8.8971032528206706e-04 + + 9.5665588974952698e-02 -1.9407069683074951e-01 + <_> + + 0 -1 1146 2.6789100375026464e-03 + + -1.0152669996023178e-01 1.7864160239696503e-01 + <_> + + 0 -1 1147 -4.0554129518568516e-03 + + -2.3337660729885101e-01 1.2279739975929260e-01 + <_> + + 0 -1 1148 -1.7742250114679337e-02 + + 1.9190870225429535e-01 -3.1710729002952576e-02 + <_> + + 0 -1 1149 3.0996970599517226e-04 + + -1.9344709813594818e-01 9.9541679024696350e-02 + <_> + + 0 -1 1150 -3.7737619131803513e-03 + + -2.0298850536346436e-01 7.9316012561321259e-02 + <_> + + 0 -1 1151 1.4448439469560981e-03 + + -5.9811491519212723e-02 4.1375398635864258e-01 + <_> + + 0 -1 1152 4.1589159518480301e-03 + + -9.2934109270572662e-02 7.7575348317623138e-02 + <_> + + 0 -1 1153 9.7764004021883011e-03 + + 5.3027391433715820e-02 -3.6435180902481079e-01 + <_> + + 0 -1 1154 -2.8739850968122482e-03 + + 1.2728120386600494e-01 -3.2182350754737854e-02 + <_> + + 0 -1 1155 4.3552028946578503e-03 + + -1.4472070336341858e-01 1.4171679317951202e-01 + <_> + + 0 -1 1156 -1.2132039666175842e-01 + + 1.5284240245819092e-01 -2.6948520913720131e-02 + <_> + + 0 -1 1157 7.5531532056629658e-03 + + 1.0153439640998840e-01 -1.8715800344944000e-01 + <_> + + 0 -1 1158 4.8978552222251892e-03 + + 2.8034990653395653e-02 -1.4224380254745483e-01 + <_> + + 0 -1 1159 -1.8711129669100046e-03 + + 1.5129889547824860e-01 -1.3912929594516754e-01 + <_> + + 0 -1 1160 4.1867699474096298e-02 + + 1.8230549991130829e-02 -5.6771957874298096e-01 + <_> + + 0 -1 1161 -8.4031058941036463e-04 + + 1.5392039716243744e-01 -1.2112110108137131e-01 + <_> + + 0 -1 1162 3.6289851414039731e-04 + + -7.9913586378097534e-02 7.0097483694553375e-02 + <_> + + 0 -1 1163 -4.4498889474198222e-04 + + 1.6784679889678955e-01 -1.3805930316448212e-01 + <_> + + 0 -1 1164 2.2194290068000555e-03 + + 5.8453138917684555e-02 -1.2374790012836456e-01 + <_> + + 0 -1 1165 -2.5759059935808182e-03 + + 2.2619499266147614e-01 -8.6251437664031982e-02 + <_> + + 0 -1 1166 5.8989811688661575e-02 + + 6.9204131141304970e-03 -7.3367577791213989e-01 + <_> + + 0 -1 1167 -2.7889141440391541e-01 + + 4.6728101372718811e-01 -3.8612861186265945e-02 + <_> + + 0 -1 1168 -5.3824000060558319e-03 + + -1.6939850151538849e-01 6.1394538730382919e-02 + <_> + + 0 -1 1169 -8.9165568351745605e-04 + + -2.4867910146713257e-01 7.6590277254581451e-02 + <_> + + 0 -1 1170 1.2071889825165272e-02 + + 8.9360373094677925e-03 -2.7028709650039673e-01 + <_> + + 0 -1 1171 3.8453561137430370e-04 + + 9.9488303065299988e-02 -2.1522629261016846e-01 + <_> + + 0 -1 1172 -2.2118990309536457e-03 + + 4.0786389261484146e-02 -1.1563809961080551e-01 + <_> + + 0 -1 1173 2.0960820838809013e-02 + + -3.1355928629636765e-02 7.1006178855895996e-01 + <_> + + 0 -1 1174 -3.9021030534058809e-03 + + -1.7460019886493683e-01 4.0775351226329803e-02 + <_> + + 0 -1 1175 -4.5169141230871901e-05 + + 1.2105180323123932e-01 -1.6618220508098602e-01 + <_> + + 0 -1 1176 6.9195672869682312e-02 + + 7.6447450555860996e-03 -5.9211570024490356e-01 + <_> + + 0 -1 1177 -1.1615910334512591e-03 + + 2.2584970295429230e-01 -9.1772772371768951e-02 + <_> + + 0 -1 1178 4.5347518607741222e-05 + + -2.0863719284534454e-01 9.0364061295986176e-02 + <_> + + 0 -1 1179 -1.9045149907469749e-02 + + 4.2344009876251221e-01 -4.6018179506063461e-02 + <_> + + 0 -1 1180 4.1966438293457031e-03 + + -2.8369670733809471e-02 3.0800709128379822e-01 + <_> + + 0 -1 1181 2.5357000413350761e-04 + + -2.8971961140632629e-01 7.5374223291873932e-02 + <_> + + 0 -1 1182 1.0817909985780716e-01 + + -1.4286429621279240e-02 7.2823339700698853e-01 + <_> + + 0 -1 1183 -5.5140778422355652e-03 + + -1.8854649364948273e-01 1.1378549784421921e-01 + <_> + + 0 -1 1184 5.5264509283006191e-03 + + 7.0834018290042877e-02 -1.8397599458694458e-01 + <_> + + 0 -1 1185 6.4198831096291542e-03 + + -1.1449480056762695e-01 1.9120390713214874e-01 + <_> + + 0 -1 1186 1.9314220547676086e-01 + + 1.4066229574382305e-02 -6.9772118330001831e-01 + <_> + + 0 -1 1187 4.0670208632946014e-02 + + -2.4279089644551277e-02 7.8828179836273193e-01 + <_> + + 0 -1 1188 -2.1965131163597107e-03 + + -2.0105579495429993e-01 5.1050510257482529e-02 + <_> + + 0 -1 1189 -4.7381771728396416e-03 + + 2.5222310423851013e-01 -7.3429226875305176e-02 + <_> + + 0 -1 1190 7.1773640811443329e-02 + + -9.0609909966588020e-03 9.2946898937225342e-01 + <_> + + 0 -1 1191 6.9466611603274941e-04 + + 1.0625690221786499e-01 -1.9162459671497345e-01 + <_> + + 0 -1 1192 2.6388010010123253e-03 + + 6.3330717384815216e-02 -2.0404089987277985e-01 + <_> + + 0 -1 1193 -3.1406691414304078e-04 + + 1.7990510165691376e-01 -9.8495960235595703e-02 + <_> + + 0 -1 1194 -5.8691151207312942e-04 + + 8.5071258246898651e-02 -7.6974540948867798e-02 + <_> + + 0 -1 1195 1.0376359568908811e-03 + + -1.1096309870481491e-01 1.5985070168972015e-01 + <_> + + 0 -1 1196 1.6373570542782545e-03 + + 1.1128730326890945e-01 -1.2352730333805084e-01 + <_> + + 0 -1 1197 -7.3773309122771025e-04 + + 1.2890860438346863e-01 -1.4294579625129700e-01 + <_> + + 0 -1 1198 -1.6841450706124306e-02 + + -2.4231070280075073e-01 2.0597470924258232e-02 + <_> + + 0 -1 1199 -3.0590690672397614e-02 + + 3.3513951301574707e-01 -4.7183569520711899e-02 + <_> + + 0 -1 1200 1.0214540176093578e-02 + + 5.5497199296951294e-02 -2.3405939340591431e-01 + <_> + + 0 -1 1201 -1.1853770120069385e-03 + + 9.2074163258075714e-02 -1.7347140610218048e-01 + <_> + + 0 -1 1202 1.1729650432243943e-03 + + -8.4075942635536194e-02 2.0689530670642853e-01 + <_> + + 0 -1 1203 1.0894170030951500e-02 + + 5.6475941091775894e-02 -3.1677180528640747e-01 + <_> + + 0 -1 1204 -2.0437049679458141e-03 + + 1.8796369433403015e-01 -9.8889023065567017e-02 + <_> + + 0 -1 1205 -5.7676038704812527e-03 + + -2.5189259648323059e-01 7.5108267366886139e-02 + <_> + + 0 -1 1206 6.9624483585357666e-02 + + -1.7661379650235176e-02 4.3390399217605591e-01 + <_> + + 0 -1 1207 -3.1853429391048849e-04 + + -2.9378080368041992e-01 5.8162420988082886e-02 + <_> + + 0 -1 1208 1.7543470021337271e-03 + + 2.6858489960432053e-02 -1.5225639939308167e-01 + <_> + + 0 -1 1209 1.2951970566064119e-03 + + -7.1769118309020996e-02 3.8101229071617126e-01 + <_> + + 0 -1 1210 2.0549140870571136e-02 + + -2.3171430453658104e-02 2.7228319644927979e-01 + <_> + + 0 -1 1211 2.7475480455905199e-03 + + 6.7207306623458862e-02 -2.7162951231002808e-01 + <_> + + 0 -1 1212 5.2633951418101788e-03 + + -1.3931609690189362e-01 1.1821229755878448e-01 + <_> + + 0 -1 1213 -5.2199261263012886e-03 + + -3.3213511109352112e-01 4.7329191118478775e-02 + <_> + + 0 -1 1214 9.9096707999706268e-03 + + -6.9706782698631287e-02 1.9954280555248260e-01 + <_> + + 0 -1 1215 -1.0334379971027374e-01 + + 4.2418560385704041e-01 -3.9896268397569656e-02 + <_> + + 0 -1 1216 -1.3322319835424423e-02 + + -2.5508868694305420e-01 4.1351031512022018e-02 + <_> + + 0 -1 1217 1.7832260346040130e-03 + + -1.7664439976215363e-01 1.0336239635944366e-01 + <_> + + 0 -1 1218 6.3282333314418793e-02 + + 1.2395679950714111e-02 -4.6355250477790833e-01 + <_> + + 0 -1 1219 -5.1022358238697052e-03 + + 4.0670639276504517e-01 -5.0193451344966888e-02 + <_> + + 0 -1 1220 3.9891529828310013e-02 + + 3.7219129502773285e-02 -5.5696451663970947e-01 + + <_> + + <_> + 3 4 12 16 -1. + <_> + 7 4 4 16 3. + <_> + + <_> + 11 0 2 20 -1. + <_> + 11 10 2 10 2. + <_> + + <_> + 4 1 4 22 -1. + <_> + 4 12 4 11 2. + <_> + + <_> + 9 8 7 12 -1. + <_> + 9 14 7 6 2. + <_> + + <_> + 6 0 6 10 -1. + <_> + 6 0 3 5 2. + <_> + 9 5 3 5 2. + <_> + + <_> + 1 18 18 5 -1. + <_> + 1 18 9 5 2. + <_> + + <_> + 4 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 6 17 10 6 -1. + <_> + 6 20 10 3 2. + <_> + + <_> + 0 0 4 20 -1. + <_> + 0 10 4 10 2. + <_> + + <_> + 3 0 16 14 -1. + <_> + 3 7 16 7 2. + <_> + + <_> + 5 1 4 13 -1. + <_> + 7 1 2 13 2. + <_> + + <_> + 1 8 18 12 -1. + <_> + 10 8 9 6 2. + <_> + 1 14 9 6 2. + <_> + + <_> + 2 0 15 21 -1. + <_> + 7 0 5 21 3. + <_> + + <_> + 1 5 18 18 -1. + <_> + 10 5 9 9 2. + <_> + 1 14 9 9 2. + <_> + + <_> + 2 19 15 3 -1. + <_> + 7 19 5 3 3. + <_> + + <_> + 7 20 12 3 -1. + <_> + 7 20 6 3 2. + <_> + + <_> + 1 21 14 2 -1. + <_> + 8 21 7 2 2. + <_> + + <_> + 0 16 18 6 -1. + <_> + 6 16 6 6 3. + <_> + + <_> + 8 3 4 20 -1. + <_> + 8 13 4 10 2. + <_> + + <_> + 0 19 18 3 -1. + <_> + 9 19 9 3 2. + <_> + + <_> + 5 21 14 2 -1. + <_> + 5 21 7 2 2. + <_> + + <_> + 2 0 9 5 -1. + <_> + 5 0 3 5 3. + <_> + + <_> + 3 20 15 3 -1. + <_> + 8 20 5 3 3. + <_> + + <_> + 3 9 6 14 -1. + <_> + 5 9 2 14 3. + <_> + + <_> + 12 3 3 18 -1. + <_> + 12 12 3 9 2. + <_> + + <_> + 1 14 4 9 -1. + <_> + 3 14 2 9 2. + <_> + + <_> + 7 15 11 8 -1. + <_> + 7 17 11 4 2. + <_> + + <_> + 0 7 6 10 -1. + <_> + 0 7 3 5 2. + <_> + 3 12 3 5 2. + <_> + + <_> + 10 6 4 13 -1. + <_> + 10 6 2 13 2. + <_> + + <_> + 5 6 4 13 -1. + <_> + 7 6 2 13 2. + <_> + + <_> + 8 2 6 8 -1. + <_> + 8 2 6 4 2. + 1 + <_> + + <_> + 0 11 19 12 -1. + <_> + 0 17 19 6 2. + <_> + + <_> + 0 18 6 5 -1. + <_> + 3 18 3 5 2. + <_> + + <_> + 9 17 9 6 -1. + <_> + 12 17 3 6 3. + <_> + + <_> + 0 20 15 3 -1. + <_> + 5 20 5 3 3. + <_> + + <_> + 9 19 8 4 -1. + <_> + 9 19 4 4 2. + <_> + + <_> + 0 17 9 6 -1. + <_> + 3 17 3 6 3. + <_> + + <_> + 14 17 5 6 -1. + <_> + 14 20 5 3 2. + <_> + + <_> + 2 2 15 14 -1. + <_> + 7 2 5 14 3. + <_> + + <_> + 14 17 5 6 -1. + <_> + 14 20 5 3 2. + <_> + + <_> + 0 17 5 6 -1. + <_> + 0 20 5 3 2. + <_> + + <_> + 3 0 13 8 -1. + <_> + 3 4 13 4 2. + <_> + + <_> + 0 21 14 2 -1. + <_> + 7 21 7 2 2. + <_> + + <_> + 8 4 4 15 -1. + <_> + 9 4 2 15 2. + <_> + + <_> + 1 18 8 5 -1. + <_> + 5 18 4 5 2. + <_> + + <_> + 8 4 4 15 -1. + <_> + 9 4 2 15 2. + <_> + + <_> + 7 4 4 15 -1. + <_> + 8 4 2 15 2. + <_> + + <_> + 11 11 8 8 -1. + <_> + 15 11 4 4 2. + <_> + 11 15 4 4 2. + <_> + + <_> + 4 13 6 7 -1. + <_> + 6 13 2 7 3. + <_> + + <_> + 3 1 8 13 -1. + <_> + 7 1 4 13 2. + <_> + + <_> + 5 21 14 2 -1. + <_> + 5 21 7 2 2. + <_> + + <_> + 0 21 18 2 -1. + <_> + 9 21 9 2 2. + <_> + + <_> + 7 18 8 5 -1. + <_> + 7 18 4 5 2. + <_> + + <_> + 4 17 8 6 -1. + <_> + 8 17 4 6 2. + <_> + + <_> + 10 2 7 10 -1. + <_> + 10 2 7 5 2. + 1 + <_> + + <_> + 2 9 2 14 -1. + <_> + 3 9 1 14 2. + <_> + + <_> + 15 7 2 16 -1. + <_> + 15 7 1 16 2. + <_> + + <_> + 1 8 4 15 -1. + <_> + 3 8 2 15 2. + <_> + + <_> + 14 0 3 14 -1. + <_> + 14 0 3 7 2. + 1 + <_> + + <_> + 9 6 8 9 -1. + <_> + 9 6 4 9 2. + 1 + <_> + + <_> + 8 15 11 8 -1. + <_> + 8 17 11 4 2. + <_> + + <_> + 5 7 4 10 -1. + <_> + 7 7 2 10 2. + <_> + + <_> + 10 15 9 8 -1. + <_> + 10 17 9 4 2. + <_> + + <_> + 0 15 9 8 -1. + <_> + 0 17 9 4 2. + <_> + + <_> + 2 1 17 18 -1. + <_> + 2 10 17 9 2. + <_> + + <_> + 2 0 16 2 -1. + <_> + 2 0 8 2 2. + 1 + <_> + + <_> + 8 0 9 5 -1. + <_> + 11 0 3 5 3. + <_> + + <_> + 6 0 6 10 -1. + <_> + 6 0 3 5 2. + <_> + 9 5 3 5 2. + <_> + + <_> + 10 6 4 7 -1. + <_> + 10 6 2 7 2. + <_> + + <_> + 2 4 15 11 -1. + <_> + 7 4 5 11 3. + <_> + + <_> + 15 15 4 8 -1. + <_> + 15 15 2 8 2. + <_> + + <_> + 0 15 4 8 -1. + <_> + 2 15 2 8 2. + <_> + + <_> + 5 6 4 11 -1. + <_> + 7 6 2 11 2. + <_> + + <_> + 3 17 16 4 -1. + <_> + 7 17 8 4 2. + <_> + + <_> + 9 3 10 8 -1. + <_> + 9 3 5 8 2. + 1 + <_> + + <_> + 12 6 7 10 -1. + <_> + 12 6 7 5 2. + 1 + <_> + + <_> + 2 0 6 5 -1. + <_> + 5 0 3 5 2. + <_> + + <_> + 4 18 14 3 -1. + <_> + 4 19 14 1 3. + <_> + + <_> + 2 20 14 3 -1. + <_> + 9 20 7 3 2. + <_> + + <_> + 4 21 14 2 -1. + <_> + 4 21 7 2 2. + <_> + + <_> + 8 8 3 14 -1. + <_> + 9 8 1 14 3. + <_> + + <_> + 8 9 3 14 -1. + <_> + 9 9 1 14 3. + <_> + + <_> + 5 7 9 16 -1. + <_> + 5 11 9 8 2. + <_> + + <_> + 11 13 6 8 -1. + <_> + 11 17 6 4 2. + <_> + + <_> + 4 17 7 6 -1. + <_> + 4 19 7 2 3. + <_> + + <_> + 2 13 16 8 -1. + <_> + 10 13 8 4 2. + <_> + 2 17 8 4 2. + <_> + + <_> + 2 18 15 3 -1. + <_> + 2 19 15 1 3. + <_> + + <_> + 2 13 15 3 -1. + <_> + 7 13 5 3 3. + <_> + + <_> + 8 0 11 16 -1. + <_> + 8 4 11 8 2. + <_> + + <_> + 0 0 19 18 -1. + <_> + 0 6 19 6 3. + <_> + + <_> + 8 0 11 16 -1. + <_> + 8 4 11 8 2. + <_> + + <_> + 0 1 4 20 -1. + <_> + 0 6 4 10 2. + <_> + + <_> + 3 6 15 4 -1. + <_> + 8 6 5 4 3. + <_> + + <_> + 0 9 18 6 -1. + <_> + 0 9 9 3 2. + <_> + 9 12 9 3 2. + <_> + + <_> + 8 5 3 14 -1. + <_> + 9 5 1 14 3. + <_> + + <_> + 1 0 6 8 -1. + <_> + 3 0 2 8 3. + <_> + + <_> + 1 6 18 6 -1. + <_> + 10 6 9 3 2. + <_> + 1 9 9 3 2. + <_> + + <_> + 7 7 4 15 -1. + <_> + 8 7 2 15 2. + <_> + + <_> + 11 5 8 10 -1. + <_> + 11 10 8 5 2. + <_> + + <_> + 0 5 8 10 -1. + <_> + 0 10 8 5 2. + <_> + + <_> + 3 20 15 3 -1. + <_> + 8 20 5 3 3. + <_> + + <_> + 2 16 9 5 -1. + <_> + 5 16 3 5 3. + <_> + + <_> + 13 11 6 11 -1. + <_> + 13 11 3 11 2. + <_> + + <_> + 5 8 4 11 -1. + <_> + 7 8 2 11 2. + <_> + + <_> + 5 7 12 5 -1. + <_> + 8 7 6 5 2. + <_> + + <_> + 2 11 15 3 -1. + <_> + 7 11 5 3 3. + <_> + + <_> + 1 1 18 3 -1. + <_> + 7 1 6 3 3. + <_> + + <_> + 5 1 14 4 -1. + <_> + 5 1 7 4 2. + 1 + <_> + + <_> + 1 9 18 10 -1. + <_> + 10 9 9 5 2. + <_> + 1 14 9 5 2. + <_> + + <_> + 7 9 3 14 -1. + <_> + 8 9 1 14 3. + <_> + + <_> + 8 7 4 14 -1. + <_> + 9 7 2 14 2. + <_> + + <_> + 0 1 19 16 -1. + <_> + 0 9 19 8 2. + <_> + + <_> + 9 7 3 14 -1. + <_> + 10 7 1 14 3. + <_> + + <_> + 2 11 14 6 -1. + <_> + 2 11 7 3 2. + <_> + 9 14 7 3 2. + <_> + + <_> + 9 7 3 14 -1. + <_> + 10 7 1 14 3. + <_> + + <_> + 7 7 3 14 -1. + <_> + 8 7 1 14 3. + <_> + + <_> + 7 17 5 6 -1. + <_> + 7 20 5 3 2. + <_> + + <_> + 2 6 9 15 -1. + <_> + 5 11 3 5 9. + <_> + + <_> + 8 0 6 10 -1. + <_> + 11 0 3 5 2. + <_> + 8 5 3 5 2. + <_> + + <_> + 3 2 6 21 -1. + <_> + 5 9 2 7 9. + <_> + + <_> + 9 19 10 4 -1. + <_> + 9 19 5 4 2. + <_> + + <_> + 2 8 4 8 -1. + <_> + 4 8 2 8 2. + <_> + + <_> + 11 1 2 22 -1. + <_> + 11 12 2 11 2. + <_> + + <_> + 0 20 15 3 -1. + <_> + 5 20 5 3 3. + <_> + + <_> + 10 19 8 4 -1. + <_> + 10 19 4 4 2. + <_> + + <_> + 1 19 8 4 -1. + <_> + 5 19 4 4 2. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 13 2 3 10 -1. + <_> + 13 2 3 5 2. + 1 + <_> + + <_> + 6 4 6 9 -1. + <_> + 9 4 3 9 2. + <_> + + <_> + 10 7 2 10 -1. + <_> + 10 7 1 10 2. + 1 + <_> + + <_> + 2 1 15 9 -1. + <_> + 7 1 5 9 3. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 5 5 6 7 -1. + <_> + 7 5 2 7 3. + <_> + + <_> + 10 7 2 10 -1. + <_> + 10 7 1 10 2. + 1 + <_> + + <_> + 9 7 10 2 -1. + <_> + 9 7 10 1 2. + 1 + <_> + + <_> + 13 16 4 7 -1. + <_> + 13 16 2 7 2. + <_> + + <_> + 6 9 4 10 -1. + <_> + 8 9 2 10 2. + <_> + + <_> + 5 18 14 4 -1. + <_> + 12 18 7 2 2. + <_> + 5 20 7 2 2. + <_> + + <_> + 5 1 12 3 -1. + <_> + 5 1 6 3 2. + 1 + <_> + + <_> + 11 0 2 22 -1. + <_> + 11 11 2 11 2. + <_> + + <_> + 3 15 4 8 -1. + <_> + 5 15 2 8 2. + <_> + + <_> + 11 0 2 14 -1. + <_> + 11 0 1 14 2. + <_> + + <_> + 6 0 2 14 -1. + <_> + 7 0 1 14 2. + <_> + + <_> + 11 0 2 20 -1. + <_> + 11 0 1 20 2. + <_> + + <_> + 1 19 16 4 -1. + <_> + 5 19 8 4 2. + <_> + + <_> + 11 0 2 20 -1. + <_> + 11 0 1 20 2. + <_> + + <_> + 6 0 2 20 -1. + <_> + 7 0 1 20 2. + <_> + + <_> + 11 0 2 22 -1. + <_> + 11 11 2 11 2. + <_> + + <_> + 0 18 14 4 -1. + <_> + 0 18 7 2 2. + <_> + 7 20 7 2 2. + <_> + + <_> + 1 1 18 8 -1. + <_> + 10 1 9 4 2. + <_> + 1 5 9 4 2. + <_> + + <_> + 9 8 10 4 -1. + <_> + 9 8 10 2 2. + 1 + <_> + + <_> + 3 7 15 3 -1. + <_> + 8 7 5 3 3. + <_> + + <_> + 8 1 6 8 -1. + <_> + 8 1 6 4 2. + 1 + <_> + + <_> + 8 3 3 15 -1. + <_> + 9 3 1 15 3. + <_> + + <_> + 1 14 9 6 -1. + <_> + 4 14 3 6 3. + <_> + + <_> + 3 20 15 3 -1. + <_> + 8 20 5 3 3. + <_> + + <_> + 0 18 14 3 -1. + <_> + 0 19 14 1 3. + <_> + + <_> + 5 20 10 3 -1. + <_> + 5 20 5 3 2. + <_> + + <_> + 9 5 10 6 -1. + <_> + 9 5 5 6 2. + 1 + <_> + + <_> + 2 4 15 14 -1. + <_> + 7 4 5 14 3. + <_> + + <_> + 0 16 6 7 -1. + <_> + 3 16 3 7 2. + <_> + + <_> + 7 18 12 5 -1. + <_> + 11 18 4 5 3. + <_> + + <_> + 1 18 15 3 -1. + <_> + 1 19 15 1 3. + <_> + + <_> + 4 19 12 4 -1. + <_> + 8 19 4 4 3. + <_> + + <_> + 5 0 3 12 -1. + <_> + 5 6 3 6 2. + <_> + + <_> + 3 20 16 3 -1. + <_> + 3 20 8 3 2. + <_> + + <_> + 0 15 15 8 -1. + <_> + 0 17 15 4 2. + <_> + + <_> + 12 14 4 7 -1. + <_> + 12 14 2 7 2. + <_> + + <_> + 1 7 15 3 -1. + <_> + 6 7 5 3 3. + <_> + + <_> + 10 0 8 4 -1. + <_> + 10 0 4 4 2. + <_> + + <_> + 0 0 18 4 -1. + <_> + 6 0 6 4 3. + <_> + + <_> + 9 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 2 4 15 16 -1. + <_> + 7 4 5 16 3. + <_> + + <_> + 4 0 11 12 -1. + <_> + 4 6 11 6 2. + <_> + + <_> + 7 9 3 14 -1. + <_> + 8 9 1 14 3. + <_> + + <_> + 4 21 14 2 -1. + <_> + 4 21 7 2 2. + <_> + + <_> + 0 21 16 2 -1. + <_> + 8 21 8 2 2. + <_> + + <_> + 8 7 4 14 -1. + <_> + 9 7 2 14 2. + <_> + + <_> + 1 0 16 12 -1. + <_> + 5 0 8 12 2. + <_> + + <_> + 3 17 16 5 -1. + <_> + 7 17 8 5 2. + <_> + + <_> + 0 13 6 5 -1. + <_> + 3 13 3 5 2. + <_> + + <_> + 13 12 6 6 -1. + <_> + 13 12 3 6 2. + <_> + + <_> + 0 12 6 6 -1. + <_> + 3 12 3 6 2. + <_> + + <_> + 8 7 4 14 -1. + <_> + 9 7 2 14 2. + <_> + + <_> + 7 3 4 20 -1. + <_> + 7 13 4 10 2. + <_> + + <_> + 8 6 4 15 -1. + <_> + 9 6 2 15 2. + <_> + + <_> + 7 6 4 15 -1. + <_> + 8 6 2 15 2. + <_> + + <_> + 13 11 6 12 -1. + <_> + 16 11 3 6 2. + <_> + 13 17 3 6 2. + <_> + + <_> + 0 11 6 12 -1. + <_> + 0 11 3 6 2. + <_> + 3 17 3 6 2. + <_> + + <_> + 11 2 2 14 -1. + <_> + 11 2 1 14 2. + <_> + + <_> + 6 2 2 14 -1. + <_> + 7 2 1 14 2. + <_> + + <_> + 11 5 3 14 -1. + <_> + 12 5 1 14 3. + <_> + + <_> + 2 4 15 10 -1. + <_> + 7 4 5 10 3. + <_> + + <_> + 4 0 11 22 -1. + <_> + 4 11 11 11 2. + <_> + + <_> + 0 19 14 4 -1. + <_> + 0 19 7 2 2. + <_> + 7 21 7 2 2. + <_> + + <_> + 8 0 4 7 -1. + <_> + 8 0 2 7 2. + <_> + + <_> + 7 0 4 15 -1. + <_> + 8 0 2 15 2. + <_> + + <_> + 5 21 14 2 -1. + <_> + 5 21 7 2 2. + <_> + + <_> + 7 9 3 14 -1. + <_> + 8 9 1 14 3. + <_> + + <_> + 12 9 2 14 -1. + <_> + 12 9 1 14 2. + <_> + + <_> + 5 9 2 14 -1. + <_> + 6 9 1 14 2. + <_> + + <_> + 3 20 15 3 -1. + <_> + 8 20 5 3 3. + <_> + + <_> + 5 0 3 17 -1. + <_> + 6 0 1 17 3. + <_> + + <_> + 4 20 12 3 -1. + <_> + 4 20 6 3 2. + <_> + + <_> + 5 2 3 14 -1. + <_> + 6 2 1 14 3. + <_> + + <_> + 2 3 15 18 -1. + <_> + 7 3 5 18 3. + <_> + + <_> + 7 1 4 7 -1. + <_> + 9 1 2 7 2. + <_> + + <_> + 8 0 9 5 -1. + <_> + 11 0 3 5 3. + <_> + + <_> + 7 0 4 7 -1. + <_> + 9 0 2 7 2. + <_> + + <_> + 5 3 12 19 -1. + <_> + 8 3 6 19 2. + <_> + + <_> + 2 3 12 19 -1. + <_> + 5 3 6 19 2. + <_> + + <_> + 13 8 2 14 -1. + <_> + 13 8 1 14 2. + <_> + + <_> + 1 16 12 6 -1. + <_> + 1 18 12 2 3. + <_> + + <_> + 13 8 2 14 -1. + <_> + 13 8 1 14 2. + <_> + + <_> + 4 8 2 14 -1. + <_> + 5 8 1 14 2. + <_> + + <_> + 9 0 10 4 -1. + <_> + 9 0 5 4 2. + <_> + + <_> + 6 1 7 22 -1. + <_> + 6 12 7 11 2. + <_> + + <_> + 7 17 10 6 -1. + <_> + 12 17 5 3 2. + <_> + 7 20 5 3 2. + <_> + + <_> + 6 6 6 5 -1. + <_> + 9 6 3 5 2. + <_> + + <_> + 3 20 15 3 -1. + <_> + 8 20 5 3 3. + <_> + + <_> + 1 0 15 8 -1. + <_> + 1 4 15 4 2. + <_> + + <_> + 2 0 16 6 -1. + <_> + 6 0 8 6 2. + <_> + + <_> + 2 20 10 3 -1. + <_> + 7 20 5 3 2. + <_> + + <_> + 9 19 10 3 -1. + <_> + 9 19 5 3 2. + <_> + + <_> + 3 18 6 5 -1. + <_> + 6 18 3 5 2. + <_> + + <_> + 9 0 6 9 -1. + <_> + 11 0 2 9 3. + <_> + + <_> + 4 0 6 9 -1. + <_> + 6 0 2 9 3. + <_> + + <_> + 10 9 4 14 -1. + <_> + 12 9 2 7 2. + <_> + 10 16 2 7 2. + <_> + + <_> + 2 11 4 7 -1. + <_> + 4 11 2 7 2. + <_> + + <_> + 12 13 4 9 -1. + <_> + 12 13 2 9 2. + <_> + + <_> + 3 13 4 9 -1. + <_> + 5 13 2 9 2. + <_> + + <_> + 9 13 10 6 -1. + <_> + 14 13 5 3 2. + <_> + 9 16 5 3 2. + <_> + + <_> + 2 10 15 10 -1. + <_> + 7 10 5 10 3. + <_> + + <_> + 10 9 4 14 -1. + <_> + 12 9 2 7 2. + <_> + 10 16 2 7 2. + <_> + + <_> + 5 9 4 14 -1. + <_> + 5 9 2 7 2. + <_> + 7 16 2 7 2. + <_> + + <_> + 12 16 4 7 -1. + <_> + 12 16 2 7 2. + <_> + + <_> + 3 16 4 7 -1. + <_> + 5 16 2 7 2. + <_> + + <_> + 8 17 7 6 -1. + <_> + 8 19 7 2 3. + <_> + + <_> + 0 20 15 3 -1. + <_> + 5 20 5 3 3. + <_> + + <_> + 9 15 6 8 -1. + <_> + 9 19 6 4 2. + <_> + + <_> + 0 0 10 10 -1. + <_> + 0 0 5 5 2. + <_> + 5 5 5 5 2. + <_> + + <_> + 9 0 10 3 -1. + <_> + 9 0 5 3 2. + <_> + + <_> + 0 0 10 3 -1. + <_> + 5 0 5 3 2. + <_> + + <_> + 10 4 4 10 -1. + <_> + 10 4 2 10 2. + 1 + <_> + + <_> + 9 4 10 4 -1. + <_> + 9 4 10 2 2. + 1 + <_> + + <_> + 6 4 12 12 -1. + <_> + 10 8 4 4 9. + <_> + + <_> + 1 4 12 12 -1. + <_> + 5 8 4 4 9. + <_> + + <_> + 5 6 9 8 -1. + <_> + 5 8 9 4 2. + <_> + + <_> + 2 1 15 21 -1. + <_> + 7 8 5 7 9. + <_> + + <_> + 1 16 9 7 -1. + <_> + 4 16 3 7 3. + <_> + + <_> + 4 5 12 18 -1. + <_> + 10 5 6 9 2. + <_> + 4 14 6 9 2. + <_> + + <_> + 1 20 15 3 -1. + <_> + 6 20 5 3 3. + <_> + + <_> + 3 4 16 13 -1. + <_> + 7 4 8 13 2. + <_> + + <_> + 9 3 10 8 -1. + <_> + 9 3 5 8 2. + 1 + <_> + + <_> + 11 19 8 4 -1. + <_> + 11 19 4 4 2. + <_> + + <_> + 0 19 8 4 -1. + <_> + 4 19 4 4 2. + <_> + + <_> + 8 0 9 5 -1. + <_> + 11 0 3 5 3. + <_> + + <_> + 6 0 6 22 -1. + <_> + 6 0 3 11 2. + <_> + 9 11 3 11 2. + <_> + + <_> + 8 7 3 14 -1. + <_> + 9 7 1 14 3. + <_> + + <_> + 5 8 2 14 -1. + <_> + 6 8 1 14 2. + <_> + + <_> + 13 11 3 10 -1. + <_> + 13 16 3 5 2. + <_> + + <_> + 1 0 16 5 -1. + <_> + 5 0 8 5 2. + <_> + + <_> + 9 0 10 7 -1. + <_> + 9 0 5 7 2. + <_> + + <_> + 0 0 18 23 -1. + <_> + 9 0 9 23 2. + <_> + + <_> + 5 8 12 15 -1. + <_> + 9 13 4 5 9. + <_> + + <_> + 3 0 6 7 -1. + <_> + 5 0 2 7 3. + <_> + + <_> + 5 8 12 15 -1. + <_> + 9 13 4 5 9. + <_> + + <_> + 5 2 4 13 -1. + <_> + 7 2 2 13 2. + <_> + + <_> + 3 11 14 2 -1. + <_> + 3 11 7 2 2. + <_> + + <_> + 2 12 15 7 -1. + <_> + 7 12 5 7 3. + <_> + + <_> + 5 8 12 15 -1. + <_> + 9 13 4 5 9. + <_> + + <_> + 0 14 15 9 -1. + <_> + 5 14 5 9 3. + <_> + + <_> + 6 15 12 8 -1. + <_> + 9 15 6 8 2. + <_> + + <_> + 1 15 12 8 -1. + <_> + 4 15 6 8 2. + <_> + + <_> + 8 6 3 14 -1. + <_> + 9 6 1 14 3. + <_> + + <_> + 4 5 4 14 -1. + <_> + 5 5 2 14 2. + <_> + + <_> + 11 5 3 14 -1. + <_> + 12 5 1 14 3. + <_> + + <_> + 1 10 6 9 -1. + <_> + 3 10 2 9 3. + <_> + + <_> + 2 8 16 10 -1. + <_> + 6 8 8 10 2. + <_> + + <_> + 6 17 6 6 -1. + <_> + 6 20 6 3 2. + <_> + + <_> + 1 10 18 10 -1. + <_> + 10 10 9 5 2. + <_> + 1 15 9 5 2. + <_> + + <_> + 6 0 7 4 -1. + <_> + 6 2 7 2 2. + <_> + + <_> + 0 6 19 3 -1. + <_> + 0 7 19 1 3. + <_> + + <_> + 9 11 6 6 -1. + <_> + 9 11 3 6 2. + 1 + <_> + + <_> + 7 0 9 5 -1. + <_> + 10 0 3 5 3. + <_> + + <_> + 0 3 9 4 -1. + <_> + 0 5 9 2 2. + <_> + + <_> + 1 18 17 2 -1. + <_> + 1 19 17 1 2. + <_> + + <_> + 7 3 4 8 -1. + <_> + 9 3 2 8 2. + <_> + + <_> + 9 9 2 14 -1. + <_> + 9 9 1 14 2. + <_> + + <_> + 8 8 3 14 -1. + <_> + 9 8 1 14 3. + <_> + + <_> + 10 1 9 4 -1. + <_> + 10 3 9 2 2. + <_> + + <_> + 0 12 10 3 -1. + <_> + 5 12 5 3 2. + <_> + + <_> + 8 6 4 12 -1. + <_> + 8 12 4 6 2. + <_> + + <_> + 3 12 4 7 -1. + <_> + 5 12 2 7 2. + <_> + + <_> + 6 17 12 6 -1. + <_> + 12 17 6 3 2. + <_> + 6 20 6 3 2. + <_> + + <_> + 0 16 18 6 -1. + <_> + 9 16 9 6 2. + <_> + + <_> + 12 0 4 14 -1. + <_> + 14 0 2 7 2. + <_> + 12 7 2 7 2. + <_> + + <_> + 1 21 14 2 -1. + <_> + 8 21 7 2 2. + <_> + + <_> + 9 19 8 4 -1. + <_> + 9 19 4 4 2. + <_> + + <_> + 1 0 12 4 -1. + <_> + 5 0 4 4 3. + <_> + + <_> + 10 1 8 5 -1. + <_> + 10 1 4 5 2. + <_> + + <_> + 0 13 6 10 -1. + <_> + 2 13 2 10 3. + <_> + + <_> + 8 9 3 14 -1. + <_> + 9 9 1 14 3. + <_> + + <_> + 9 7 10 2 -1. + <_> + 9 7 10 1 2. + 1 + <_> + + <_> + 2 16 15 3 -1. + <_> + 7 16 5 3 3. + <_> + + <_> + 5 1 8 17 -1. + <_> + 9 1 4 17 2. + <_> + + <_> + 9 19 8 4 -1. + <_> + 9 19 4 4 2. + <_> + + <_> + 2 19 8 4 -1. + <_> + 6 19 4 4 2. + <_> + + <_> + 10 0 8 7 -1. + <_> + 10 0 4 7 2. + <_> + + <_> + 1 0 8 7 -1. + <_> + 5 0 4 7 2. + <_> + + <_> + 12 16 7 4 -1. + <_> + 12 18 7 2 2. + <_> + + <_> + 7 0 4 14 -1. + <_> + 9 0 2 14 2. + <_> + + <_> + 2 18 15 3 -1. + <_> + 2 19 15 1 3. + <_> + + <_> + 7 1 4 7 -1. + <_> + 9 1 2 7 2. + <_> + + <_> + 11 5 3 15 -1. + <_> + 12 5 1 15 3. + <_> + + <_> + 0 10 6 10 -1. + <_> + 0 10 3 5 2. + <_> + 3 15 3 5 2. + <_> + + <_> + 11 5 3 15 -1. + <_> + 12 5 1 15 3. + <_> + + <_> + 5 5 3 15 -1. + <_> + 6 5 1 15 3. + <_> + + <_> + 6 5 12 12 -1. + <_> + 6 5 6 12 2. + <_> + + <_> + 1 4 12 16 -1. + <_> + 7 4 6 16 2. + <_> + + <_> + 11 4 6 7 -1. + <_> + 13 4 2 7 3. + <_> + + <_> + 1 7 4 16 -1. + <_> + 1 7 2 8 2. + <_> + 3 15 2 8 2. + <_> + + <_> + 11 1 2 22 -1. + <_> + 11 12 2 11 2. + <_> + + <_> + 1 18 14 3 -1. + <_> + 1 19 14 1 3. + <_> + + <_> + 7 18 12 5 -1. + <_> + 11 18 4 5 3. + <_> + + <_> + 1 0 16 19 -1. + <_> + 5 0 8 19 2. + <_> + + <_> + 6 17 12 6 -1. + <_> + 9 17 6 6 2. + <_> + + <_> + 7 11 8 4 -1. + <_> + 7 11 4 4 2. + 1 + <_> + + <_> + 10 9 3 14 -1. + <_> + 11 9 1 14 3. + <_> + + <_> + 2 11 15 8 -1. + <_> + 7 11 5 8 3. + <_> + + <_> + 11 6 7 8 -1. + <_> + 11 6 7 4 2. + 1 + <_> + + <_> + 8 6 8 7 -1. + <_> + 8 6 4 7 2. + 1 + <_> + + <_> + 10 9 3 14 -1. + <_> + 11 9 1 14 3. + <_> + + <_> + 6 9 3 14 -1. + <_> + 7 9 1 14 3. + <_> + + <_> + 7 0 6 12 -1. + <_> + 7 0 3 12 2. + <_> + + <_> + 5 2 3 16 -1. + <_> + 6 2 1 16 3. + <_> + + <_> + 1 4 15 7 -1. + <_> + 6 4 5 7 3. + <_> + + <_> + 12 13 4 8 -1. + <_> + 12 17 4 4 2. + <_> + + <_> + 2 11 12 12 -1. + <_> + 6 15 4 4 9. + <_> + + <_> + 12 15 5 6 -1. + <_> + 12 18 5 3 2. + <_> + + <_> + 0 0 19 16 -1. + <_> + 0 8 19 8 2. + <_> + + <_> + 4 20 15 3 -1. + <_> + 9 20 5 3 3. + <_> + + <_> + 9 0 4 8 -1. + <_> + 9 0 4 4 2. + 1 + <_> + + <_> + 5 15 12 6 -1. + <_> + 11 15 6 3 2. + <_> + 5 18 6 3 2. + <_> + + <_> + 2 15 12 6 -1. + <_> + 2 15 6 3 2. + <_> + 8 18 6 3 2. + <_> + + <_> + 8 0 9 5 -1. + <_> + 11 0 3 5 3. + <_> + + <_> + 0 19 14 4 -1. + <_> + 0 19 7 2 2. + <_> + 7 21 7 2 2. + <_> + + <_> + 1 14 18 7 -1. + <_> + 1 14 9 7 2. + <_> + + <_> + 5 1 8 8 -1. + <_> + 5 1 4 4 2. + <_> + 9 5 4 4 2. + <_> + + <_> + 9 6 6 12 -1. + <_> + 9 6 3 12 2. + <_> + + <_> + 2 0 14 4 -1. + <_> + 9 0 7 4 2. + <_> + + <_> + 4 20 15 3 -1. + <_> + 9 20 5 3 3. + <_> + + <_> + 0 20 15 3 -1. + <_> + 5 20 5 3 3. + <_> + + <_> + 2 6 16 9 -1. + <_> + 6 6 8 9 2. + <_> + + <_> + 4 6 6 12 -1. + <_> + 7 6 3 12 2. + <_> + + <_> + 9 17 9 6 -1. + <_> + 12 17 3 6 3. + <_> + + <_> + 4 7 4 9 -1. + <_> + 6 7 2 9 2. + <_> + + <_> + 13 6 2 16 -1. + <_> + 13 6 1 16 2. + <_> + + <_> + 1 5 12 9 -1. + <_> + 7 5 6 9 2. + <_> + + <_> + 13 6 2 16 -1. + <_> + 13 6 1 16 2. + <_> + + <_> + 4 6 2 16 -1. + <_> + 5 6 1 16 2. + <_> + + <_> + 12 0 3 15 -1. + <_> + 13 0 1 15 3. + <_> + + <_> + 4 0 3 15 -1. + <_> + 5 0 1 15 3. + <_> + + <_> + 6 2 8 8 -1. + <_> + 8 2 4 8 2. + <_> + + <_> + 6 0 6 5 -1. + <_> + 9 0 3 5 2. + <_> + + <_> + 4 7 11 16 -1. + <_> + 4 11 11 8 2. + <_> + + <_> + 7 8 5 8 -1. + <_> + 7 12 5 4 2. + <_> + + <_> + 4 18 14 3 -1. + <_> + 4 19 14 1 3. + <_> + + <_> + 1 18 17 3 -1. + <_> + 1 19 17 1 3. + <_> + + <_> + 9 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 1 21 14 2 -1. + <_> + 8 21 7 2 2. + <_> + + <_> + 4 18 14 3 -1. + <_> + 4 19 14 1 3. + <_> + + <_> + 2 16 5 6 -1. + <_> + 2 19 5 3 2. + <_> + + <_> + 13 11 5 12 -1. + <_> + 13 15 5 4 3. + <_> + + <_> + 1 9 16 3 -1. + <_> + 1 10 16 1 3. + <_> + + <_> + 7 6 5 9 -1. + <_> + 7 9 5 3 3. + <_> + + <_> + 6 0 7 14 -1. + <_> + 6 7 7 7 2. + <_> + + <_> + 11 16 6 7 -1. + <_> + 13 16 2 7 3. + <_> + + <_> + 1 4 3 15 -1. + <_> + 2 4 1 15 3. + <_> + + <_> + 10 0 8 8 -1. + <_> + 14 0 4 4 2. + <_> + 10 4 4 4 2. + <_> + + <_> + 1 9 3 14 -1. + <_> + 2 9 1 14 3. + <_> + + <_> + 13 13 5 9 -1. + <_> + 13 16 5 3 3. + <_> + + <_> + 1 13 5 9 -1. + <_> + 1 16 5 3 3. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 4 14 9 6 -1. + <_> + 4 17 9 3 2. + <_> + + <_> + 2 13 10 3 -1. + <_> + 7 13 5 3 2. + <_> + + <_> + 9 0 10 5 -1. + <_> + 9 0 5 5 2. + <_> + + <_> + 1 8 2 15 -1. + <_> + 2 8 1 15 2. + <_> + + <_> + 13 0 6 18 -1. + <_> + 15 0 2 18 3. + <_> + + <_> + 0 21 14 2 -1. + <_> + 7 21 7 2 2. + <_> + + <_> + 9 19 8 4 -1. + <_> + 9 19 4 4 2. + <_> + + <_> + 1 21 16 2 -1. + <_> + 9 21 8 2 2. + <_> + + <_> + 2 0 16 4 -1. + <_> + 6 0 8 4 2. + <_> + + <_> + 3 0 9 5 -1. + <_> + 6 0 3 5 3. + <_> + + <_> + 10 5 8 10 -1. + <_> + 10 5 8 5 2. + 1 + <_> + + <_> + 0 1 18 8 -1. + <_> + 0 5 18 4 2. + <_> + + <_> + 10 5 8 10 -1. + <_> + 10 5 8 5 2. + 1 + <_> + + <_> + 4 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 4 18 14 3 -1. + <_> + 4 19 14 1 3. + <_> + + <_> + 2 16 6 7 -1. + <_> + 4 16 2 7 3. + <_> + + <_> + 4 18 14 3 -1. + <_> + 4 19 14 1 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 2 2 15 12 -1. + <_> + 7 6 5 4 9. + <_> + + <_> + 5 10 4 9 -1. + <_> + 7 10 2 9 2. + <_> + + <_> + 10 7 8 7 -1. + <_> + 12 9 4 7 2. + 1 + <_> + + <_> + 0 1 18 18 -1. + <_> + 0 1 9 9 2. + <_> + 9 10 9 9 2. + <_> + + <_> + 11 7 8 6 -1. + <_> + 9 9 8 2 3. + 1 + <_> + + <_> + 7 9 3 14 -1. + <_> + 8 9 1 14 3. + <_> + + <_> + 11 7 8 6 -1. + <_> + 9 9 8 2 3. + 1 + <_> + + <_> + 1 0 8 4 -1. + <_> + 5 0 4 4 2. + <_> + + <_> + 11 7 8 6 -1. + <_> + 9 9 8 2 3. + 1 + <_> + + <_> + 8 7 6 8 -1. + <_> + 10 9 2 8 3. + 1 + <_> + + <_> + 13 0 6 19 -1. + <_> + 15 0 2 19 3. + <_> + + <_> + 0 0 6 19 -1. + <_> + 2 0 2 19 3. + <_> + + <_> + 13 8 2 14 -1. + <_> + 13 8 1 14 2. + <_> + + <_> + 0 4 16 3 -1. + <_> + 0 5 16 1 3. + <_> + + <_> + 8 8 4 10 -1. + <_> + 8 13 4 5 2. + <_> + + <_> + 3 17 10 6 -1. + <_> + 3 17 5 3 2. + <_> + 8 20 5 3 2. + <_> + + <_> + 13 8 2 14 -1. + <_> + 13 8 1 14 2. + <_> + + <_> + 1 7 16 5 -1. + <_> + 5 7 8 5 2. + <_> + + <_> + 15 5 4 9 -1. + <_> + 15 5 2 9 2. + 1 + <_> + + <_> + 6 0 3 14 -1. + <_> + 7 0 1 14 3. + <_> + + <_> + 6 4 12 12 -1. + <_> + 10 8 4 4 9. + <_> + + <_> + 7 3 4 9 -1. + <_> + 9 3 2 9 2. + <_> + + <_> + 10 4 7 8 -1. + <_> + 10 6 7 4 2. + <_> + + <_> + 2 4 7 8 -1. + <_> + 2 6 7 4 2. + <_> + + <_> + 4 18 14 3 -1. + <_> + 4 19 14 1 3. + <_> + + <_> + 4 9 2 14 -1. + <_> + 5 9 1 14 2. + <_> + + <_> + 12 15 7 8 -1. + <_> + 12 17 7 4 2. + <_> + + <_> + 6 0 7 20 -1. + <_> + 6 5 7 10 2. + <_> + + <_> + 2 1 16 4 -1. + <_> + 10 1 8 2 2. + <_> + 2 3 8 2 2. + <_> + + <_> + 4 7 3 10 -1. + <_> + 4 12 3 5 2. + <_> + + <_> + 10 6 8 8 -1. + <_> + 12 8 4 8 2. + 1 + <_> + + <_> + 3 10 12 8 -1. + <_> + 3 10 6 4 2. + <_> + 9 14 6 4 2. + <_> + + <_> + 8 4 4 10 -1. + <_> + 8 9 4 5 2. + <_> + + <_> + 7 7 5 9 -1. + <_> + 7 10 5 3 3. + <_> + + <_> + 1 4 17 3 -1. + <_> + 1 5 17 1 3. + <_> + + <_> + 2 3 14 3 -1. + <_> + 2 4 14 1 3. + <_> + + <_> + 2 7 14 2 -1. + <_> + 2 7 7 2 2. + 1 + <_> + + <_> + 10 19 8 4 -1. + <_> + 10 19 4 4 2. + <_> + + <_> + 5 0 5 22 -1. + <_> + 5 11 5 11 2. + <_> + + <_> + 10 19 8 4 -1. + <_> + 10 19 4 4 2. + <_> + + <_> + 1 19 8 4 -1. + <_> + 5 19 4 4 2. + <_> + + <_> + 8 12 4 9 -1. + <_> + 8 12 2 9 2. + <_> + + <_> + 1 16 9 5 -1. + <_> + 4 16 3 5 3. + <_> + + <_> + 3 20 15 3 -1. + <_> + 8 20 5 3 3. + <_> + + <_> + 3 8 10 14 -1. + <_> + 8 8 5 14 2. + <_> + + <_> + 10 5 7 6 -1. + <_> + 10 5 7 3 2. + 1 + <_> + + <_> + 9 5 6 7 -1. + <_> + 9 5 3 7 2. + 1 + <_> + + <_> + 10 4 9 10 -1. + <_> + 10 4 9 5 2. + 1 + <_> + + <_> + 9 4 10 9 -1. + <_> + 9 4 5 9 2. + 1 + <_> + + <_> + 12 15 7 8 -1. + <_> + 12 17 7 4 2. + <_> + + <_> + 0 15 7 8 -1. + <_> + 0 17 7 4 2. + <_> + + <_> + 0 16 19 4 -1. + <_> + 0 17 19 2 2. + <_> + + <_> + 4 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 9 8 4 15 -1. + <_> + 10 8 2 15 2. + <_> + + <_> + 4 7 4 14 -1. + <_> + 4 7 2 7 2. + <_> + 6 14 2 7 2. + <_> + + <_> + 12 8 2 15 -1. + <_> + 12 8 1 15 2. + <_> + + <_> + 5 8 2 15 -1. + <_> + 6 8 1 15 2. + <_> + + <_> + 8 12 4 11 -1. + <_> + 8 12 2 11 2. + <_> + + <_> + 7 12 4 11 -1. + <_> + 9 12 2 11 2. + <_> + + <_> + 10 4 3 10 -1. + <_> + 10 4 3 5 2. + 1 + <_> + + <_> + 3 16 4 7 -1. + <_> + 5 16 2 7 2. + <_> + + <_> + 3 17 16 3 -1. + <_> + 3 18 16 1 3. + <_> + + <_> + 0 12 4 10 -1. + <_> + 2 12 2 10 2. + <_> + + <_> + 7 14 12 6 -1. + <_> + 10 14 6 6 2. + <_> + + <_> + 0 14 12 6 -1. + <_> + 3 14 6 6 2. + <_> + + <_> + 7 0 12 4 -1. + <_> + 11 0 4 4 3. + <_> + + <_> + 7 0 4 10 -1. + <_> + 9 0 2 10 2. + <_> + + <_> + 9 0 10 3 -1. + <_> + 9 0 5 3 2. + <_> + + <_> + 0 0 10 3 -1. + <_> + 5 0 5 3 2. + <_> + + <_> + 6 5 8 8 -1. + <_> + 10 5 4 4 2. + <_> + 6 9 4 4 2. + <_> + + <_> + 4 6 2 14 -1. + <_> + 5 6 1 14 2. + <_> + + <_> + 10 8 6 10 -1. + <_> + 12 8 2 10 3. + <_> + + <_> + 3 8 6 10 -1. + <_> + 5 8 2 10 3. + <_> + + <_> + 5 15 12 6 -1. + <_> + 9 15 4 6 3. + <_> + + <_> + 2 15 12 6 -1. + <_> + 6 15 4 6 3. + <_> + + <_> + 8 5 5 8 -1. + <_> + 8 9 5 4 2. + <_> + + <_> + 0 2 14 4 -1. + <_> + 7 2 7 4 2. + <_> + + <_> + 7 1 6 7 -1. + <_> + 9 1 2 7 3. + <_> + + <_> + 6 2 4 17 -1. + <_> + 7 2 2 17 2. + <_> + + <_> + 8 1 9 15 -1. + <_> + 11 6 3 5 9. + <_> + + <_> + 0 0 12 4 -1. + <_> + 4 0 4 4 3. + <_> + + <_> + 11 1 8 8 -1. + <_> + 11 5 8 4 2. + <_> + + <_> + 0 1 8 8 -1. + <_> + 0 5 8 4 2. + <_> + + <_> + 10 8 3 14 -1. + <_> + 11 8 1 14 3. + <_> + + <_> + 9 4 10 3 -1. + <_> + 9 4 5 3 2. + 1 + <_> + + <_> + 11 8 2 11 -1. + <_> + 11 8 1 11 2. + 1 + <_> + + <_> + 3 13 4 8 -1. + <_> + 3 17 4 4 2. + <_> + + <_> + 10 11 8 12 -1. + <_> + 10 17 8 6 2. + <_> + + <_> + 6 8 3 14 -1. + <_> + 7 8 1 14 3. + <_> + + <_> + 10 9 2 10 -1. + <_> + 10 9 1 10 2. + 1 + <_> + + <_> + 8 11 6 6 -1. + <_> + 8 11 3 6 2. + 1 + <_> + + <_> + 1 6 16 4 -1. + <_> + 5 6 8 4 2. + <_> + + <_> + 12 0 2 14 -1. + <_> + 12 7 2 7 2. + <_> + + <_> + 7 9 3 14 -1. + <_> + 8 9 1 14 3. + <_> + + <_> + 11 7 2 11 -1. + <_> + 11 7 1 11 2. + 1 + <_> + + <_> + 8 7 11 2 -1. + <_> + 8 7 11 1 2. + 1 + <_> + + <_> + 7 0 6 5 -1. + <_> + 7 0 3 5 2. + <_> + + <_> + 5 0 9 5 -1. + <_> + 8 0 3 5 3. + <_> + + <_> + 7 17 10 6 -1. + <_> + 12 17 5 3 2. + <_> + 7 20 5 3 2. + <_> + + <_> + 7 6 4 15 -1. + <_> + 8 6 2 15 2. + <_> + + <_> + 5 11 10 3 -1. + <_> + 5 11 5 3 2. + <_> + + <_> + 8 7 3 14 -1. + <_> + 9 7 1 14 3. + <_> + + <_> + 10 8 2 10 -1. + <_> + 10 8 1 10 2. + 1 + <_> + + <_> + 3 3 9 18 -1. + <_> + 6 9 3 6 9. + <_> + + <_> + 8 0 10 12 -1. + <_> + 13 0 5 6 2. + <_> + 8 6 5 6 2. + <_> + + <_> + 1 12 12 11 -1. + <_> + 4 12 6 11 2. + <_> + + <_> + 2 4 15 9 -1. + <_> + 7 7 5 3 9. + <_> + + <_> + 3 7 10 10 -1. + <_> + 8 7 5 10 2. + <_> + + <_> + 10 8 2 10 -1. + <_> + 10 8 1 10 2. + 1 + <_> + + <_> + 2 18 6 5 -1. + <_> + 5 18 3 5 2. + <_> + + <_> + 9 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 5 0 4 14 -1. + <_> + 5 0 2 7 2. + <_> + 7 7 2 7 2. + <_> + + <_> + 8 0 10 12 -1. + <_> + 13 0 5 6 2. + <_> + 8 6 5 6 2. + <_> + + <_> + 2 0 8 18 -1. + <_> + 2 0 4 9 2. + <_> + 6 9 4 9 2. + <_> + + <_> + 10 0 8 4 -1. + <_> + 10 0 4 4 2. + <_> + + <_> + 9 9 9 2 -1. + <_> + 9 9 9 1 2. + 1 + <_> + + <_> + 15 7 3 10 -1. + <_> + 15 12 3 5 2. + <_> + + <_> + 1 7 3 10 -1. + <_> + 1 12 3 5 2. + <_> + + <_> + 15 6 4 7 -1. + <_> + 15 6 2 7 2. + <_> + + <_> + 4 15 6 7 -1. + <_> + 6 15 2 7 3. + <_> + + <_> + 2 2 16 20 -1. + <_> + 10 2 8 10 2. + <_> + 2 12 8 10 2. + <_> + + <_> + 4 17 7 6 -1. + <_> + 4 19 7 2 3. + <_> + + <_> + 3 15 15 6 -1. + <_> + 3 18 15 3 2. + <_> + + <_> + 0 18 14 3 -1. + <_> + 0 19 14 1 3. + <_> + + <_> + 9 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 2 0 4 18 -1. + <_> + 2 0 2 9 2. + <_> + 4 9 2 9 2. + <_> + + <_> + 10 2 6 8 -1. + <_> + 10 6 6 4 2. + <_> + + <_> + 5 2 8 8 -1. + <_> + 5 2 4 4 2. + <_> + 9 6 4 4 2. + <_> + + <_> + 9 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 0 0 18 3 -1. + <_> + 6 0 6 3 3. + <_> + + <_> + 10 0 8 4 -1. + <_> + 10 0 4 4 2. + <_> + + <_> + 1 0 8 4 -1. + <_> + 5 0 4 4 2. + <_> + + <_> + 9 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 9 9 8 2 -1. + <_> + 9 9 8 1 2. + 1 + <_> + + <_> + 4 7 15 9 -1. + <_> + 9 7 5 9 3. + <_> + + <_> + 8 8 3 14 -1. + <_> + 9 8 1 14 3. + <_> + + <_> + 6 6 12 16 -1. + <_> + 9 6 6 16 2. + <_> + + <_> + 1 6 12 16 -1. + <_> + 4 6 6 16 2. + <_> + + <_> + 10 6 4 7 -1. + <_> + 10 6 2 7 2. + <_> + + <_> + 2 15 5 6 -1. + <_> + 2 18 5 3 2. + <_> + + <_> + 7 19 12 4 -1. + <_> + 11 19 4 4 3. + <_> + + <_> + 0 19 12 4 -1. + <_> + 4 19 4 4 3. + <_> + + <_> + 10 9 4 7 -1. + <_> + 10 9 2 7 2. + <_> + + <_> + 5 9 4 9 -1. + <_> + 7 9 2 9 2. + <_> + + <_> + 5 3 4 17 -1. + <_> + 7 3 2 17 2. + <_> + + <_> + 3 21 14 2 -1. + <_> + 3 21 7 2 2. + <_> + + <_> + 0 19 12 3 -1. + <_> + 6 19 6 3 2. + <_> + + <_> + 9 0 3 22 -1. + <_> + 9 11 3 11 2. + <_> + + <_> + 5 9 2 14 -1. + <_> + 6 9 1 14 2. + <_> + + <_> + 7 7 6 16 -1. + <_> + 7 11 6 8 2. + <_> + + <_> + 1 12 4 8 -1. + <_> + 1 16 4 4 2. + <_> + + <_> + 2 12 15 3 -1. + <_> + 7 12 5 3 3. + <_> + + <_> + 1 17 12 6 -1. + <_> + 1 17 6 3 2. + <_> + 7 20 6 3 2. + <_> + + <_> + 8 0 4 9 -1. + <_> + 8 0 2 9 2. + <_> + + <_> + 7 0 4 9 -1. + <_> + 9 0 2 9 2. + <_> + + <_> + 7 1 5 20 -1. + <_> + 7 6 5 10 2. + <_> + + <_> + 1 7 6 16 -1. + <_> + 3 7 2 16 3. + <_> + + <_> + 8 7 4 10 -1. + <_> + 8 12 4 5 2. + <_> + + <_> + 1 3 12 12 -1. + <_> + 5 7 4 4 9. + <_> + + <_> + 8 6 3 14 -1. + <_> + 9 6 1 14 3. + <_> + + <_> + 2 6 6 10 -1. + <_> + 2 6 3 5 2. + <_> + 5 11 3 5 2. + <_> + + <_> + 8 6 4 14 -1. + <_> + 9 6 2 14 2. + <_> + + <_> + 0 10 18 12 -1. + <_> + 0 10 9 6 2. + <_> + 9 16 9 6 2. + <_> + + <_> + 8 6 4 14 -1. + <_> + 9 6 2 14 2. + <_> + + <_> + 7 6 4 14 -1. + <_> + 8 6 2 14 2. + <_> + + <_> + 1 15 18 6 -1. + <_> + 1 15 9 6 2. + <_> + + <_> + 1 17 6 5 -1. + <_> + 4 17 3 5 2. + <_> + + <_> + 6 17 12 6 -1. + <_> + 9 17 6 6 2. + <_> + + <_> + 1 15 12 8 -1. + <_> + 4 15 6 8 2. + <_> + + <_> + 0 7 19 3 -1. + <_> + 0 8 19 1 3. + <_> + + <_> + 1 8 16 3 -1. + <_> + 1 9 16 1 3. + <_> + + <_> + 6 6 7 6 -1. + <_> + 6 8 7 2 3. + <_> + + <_> + 4 7 10 14 -1. + <_> + 4 7 5 7 2. + <_> + 9 14 5 7 2. + <_> + + <_> + 5 0 12 10 -1. + <_> + 5 0 6 10 2. + <_> + + <_> + 2 0 15 13 -1. + <_> + 7 0 5 13 3. + <_> + + <_> + 5 6 12 6 -1. + <_> + 8 6 6 6 2. + <_> + + <_> + 2 16 6 7 -1. + <_> + 4 16 2 7 3. + <_> + + <_> + 10 4 8 8 -1. + <_> + 12 6 4 8 2. + 1 + <_> + + <_> + 9 5 7 6 -1. + <_> + 7 7 7 2 3. + 1 + <_> + + <_> + 1 7 18 3 -1. + <_> + 1 8 18 1 3. + <_> + + <_> + 5 4 9 11 -1. + <_> + 8 4 3 11 3. + <_> + + <_> + 13 0 6 7 -1. + <_> + 15 0 2 7 3. + <_> + + <_> + 3 11 12 6 -1. + <_> + 3 11 6 3 2. + <_> + 9 14 6 3 2. + <_> + + <_> + 13 4 3 16 -1. + <_> + 14 4 1 16 3. + <_> + + <_> + 3 4 3 16 -1. + <_> + 4 4 1 16 3. + <_> + + <_> + 2 9 16 8 -1. + <_> + 10 9 8 4 2. + <_> + 2 13 8 4 2. + <_> + + <_> + 3 0 3 19 -1. + <_> + 4 0 1 19 3. + <_> + + <_> + 6 1 8 10 -1. + <_> + 8 1 4 10 2. + <_> + + <_> + 0 14 18 6 -1. + <_> + 6 14 6 6 3. + <_> + + <_> + 4 6 15 9 -1. + <_> + 9 9 5 3 9. + <_> + + <_> + 0 14 15 8 -1. + <_> + 5 14 5 8 3. + <_> + + <_> + 3 20 15 3 -1. + <_> + 8 20 5 3 3. + <_> + + <_> + 0 15 18 2 -1. + <_> + 0 16 18 1 2. + <_> + + <_> + 2 15 17 3 -1. + <_> + 2 16 17 1 3. + <_> + + <_> + 0 0 19 4 -1. + <_> + 0 2 19 2 2. + <_> + + <_> + 4 0 12 4 -1. + <_> + 4 2 12 2 2. + <_> + + <_> + 3 0 3 21 -1. + <_> + 4 0 1 21 3. + <_> + + <_> + 6 18 8 4 -1. + <_> + 6 20 8 2 2. + <_> + + <_> + 1 18 14 3 -1. + <_> + 1 19 14 1 3. + <_> + + <_> + 9 18 9 5 -1. + <_> + 12 18 3 5 3. + <_> + + <_> + 0 18 19 3 -1. + <_> + 0 19 19 1 3. + <_> + + <_> + 13 8 3 14 -1. + <_> + 14 8 1 14 3. + <_> + + <_> + 2 6 12 7 -1. + <_> + 5 6 6 7 2. + <_> + + <_> + 2 6 16 16 -1. + <_> + 6 6 8 16 2. + <_> + + <_> + 0 1 16 20 -1. + <_> + 4 1 8 20 2. + <_> + + <_> + 12 9 4 14 -1. + <_> + 14 9 2 7 2. + <_> + 12 16 2 7 2. + <_> + + <_> + 3 9 4 14 -1. + <_> + 3 9 2 7 2. + <_> + 5 16 2 7 2. + <_> + + <_> + 11 11 6 10 -1. + <_> + 14 11 3 5 2. + <_> + 11 16 3 5 2. + <_> + + <_> + 2 11 6 10 -1. + <_> + 2 11 3 5 2. + <_> + 5 16 3 5 2. + <_> + + <_> + 2 8 16 9 -1. + <_> + 6 8 8 9 2. + <_> + + <_> + 2 17 10 6 -1. + <_> + 2 17 5 3 2. + <_> + 7 20 5 3 2. + <_> + + <_> + 11 7 8 7 -1. + <_> + 13 9 4 7 2. + 1 + <_> + + <_> + 8 7 7 8 -1. + <_> + 6 9 7 4 2. + 1 + <_> + + <_> + 7 7 6 16 -1. + <_> + 7 11 6 8 2. + <_> + + <_> + 7 4 4 10 -1. + <_> + 7 9 4 5 2. + <_> + + <_> + 5 0 9 5 -1. + <_> + 8 0 3 5 3. + <_> + + <_> + 1 1 16 18 -1. + <_> + 5 1 8 18 2. + <_> + + <_> + 5 21 14 2 -1. + <_> + 5 21 7 2 2. + <_> + + <_> + 0 20 18 3 -1. + <_> + 6 20 6 3 3. + <_> + + <_> + 8 9 3 14 -1. + <_> + 9 9 1 14 3. + <_> + + <_> + 2 4 13 2 -1. + <_> + 2 4 13 1 2. + 1 + <_> + + <_> + 6 0 10 16 -1. + <_> + 11 0 5 8 2. + <_> + 6 8 5 8 2. + <_> + + <_> + 2 14 5 6 -1. + <_> + 2 17 5 3 2. + <_> + + <_> + 12 8 4 8 -1. + <_> + 12 12 4 4 2. + <_> + + <_> + 3 8 4 8 -1. + <_> + 3 12 4 4 2. + <_> + + <_> + 14 6 3 10 -1. + <_> + 14 11 3 5 2. + <_> + + <_> + 2 6 3 10 -1. + <_> + 2 11 3 5 2. + <_> + + <_> + 7 5 12 16 -1. + <_> + 7 9 12 8 2. + <_> + + <_> + 6 11 4 9 -1. + <_> + 8 11 2 9 2. + <_> + + <_> + 7 18 10 5 -1. + <_> + 7 18 5 5 2. + <_> + + <_> + 4 0 11 14 -1. + <_> + 4 7 11 7 2. + <_> + + <_> + 8 1 9 15 -1. + <_> + 11 6 3 5 9. + <_> + + <_> + 0 6 5 8 -1. + <_> + 0 10 5 4 2. + <_> + + <_> + 15 0 4 13 -1. + <_> + 15 0 2 13 2. + 1 + <_> + + <_> + 4 0 13 4 -1. + <_> + 4 0 13 2 2. + 1 + <_> + + <_> + 6 3 9 5 -1. + <_> + 9 3 3 5 3. + <_> + + <_> + 4 3 9 5 -1. + <_> + 7 3 3 5 3. + <_> + + <_> + 7 1 12 4 -1. + <_> + 7 1 6 4 2. + <_> + + <_> + 0 2 6 12 -1. + <_> + 0 8 6 6 2. + <_> + + <_> + 5 0 12 5 -1. + <_> + 5 0 6 5 2. + <_> + + <_> + 2 0 14 5 -1. + <_> + 9 0 7 5 2. + <_> + + <_> + 9 1 4 14 -1. + <_> + 10 1 2 14 2. + <_> + + <_> + 3 5 9 8 -1. + <_> + 3 7 9 4 2. + <_> + + <_> + 2 7 16 9 -1. + <_> + 6 7 8 9 2. + <_> + + <_> + 0 19 14 2 -1. + <_> + 7 19 7 2 2. + <_> + + <_> + 8 20 10 3 -1. + <_> + 8 20 5 3 2. + <_> + + <_> + 1 20 10 3 -1. + <_> + 6 20 5 3 2. + <_> + + <_> + 15 8 3 10 -1. + <_> + 16 9 1 10 3. + 1 + <_> + + <_> + 0 21 16 2 -1. + <_> + 8 21 8 2 2. + <_> + + <_> + 4 6 15 3 -1. + <_> + 4 7 15 1 3. + <_> + + <_> + 6 4 3 14 -1. + <_> + 7 4 1 14 3. + <_> + + <_> + 7 18 10 5 -1. + <_> + 7 18 5 5 2. + <_> + + <_> + 2 18 10 5 -1. + <_> + 7 18 5 5 2. + <_> + + <_> + 6 0 10 16 -1. + <_> + 11 0 5 8 2. + <_> + 6 8 5 8 2. + <_> + + <_> + 3 0 10 16 -1. + <_> + 3 0 5 8 2. + <_> + 8 8 5 8 2. + <_> + + <_> + 6 0 7 4 -1. + <_> + 6 2 7 2 2. + <_> + + <_> + 0 2 19 3 -1. + <_> + 0 3 19 1 3. + <_> + + <_> + 7 0 12 4 -1. + <_> + 7 2 12 2 2. + <_> + + <_> + 0 2 15 3 -1. + <_> + 0 3 15 1 3. + <_> + + <_> + 1 5 18 3 -1. + <_> + 1 6 18 1 3. + <_> + + <_> + 3 0 12 6 -1. + <_> + 3 2 12 2 3. + <_> + + <_> + 5 0 10 10 -1. + <_> + 5 5 10 5 2. + <_> + + <_> + 5 1 9 4 -1. + <_> + 5 3 9 2 2. + <_> + + <_> + 5 2 12 6 -1. + <_> + 5 4 12 2 3. + <_> + + <_> + 1 15 9 6 -1. + <_> + 1 17 9 2 3. + <_> + + <_> + 5 13 14 9 -1. + <_> + 5 16 14 3 3. + <_> + + <_> + 8 12 8 3 -1. + <_> + 7 13 8 1 3. + 1 + <_> + + <_> + 12 8 2 15 -1. + <_> + 12 8 1 15 2. + <_> + + <_> + 5 8 2 15 -1. + <_> + 6 8 1 15 2. + <_> + + <_> + 11 5 3 14 -1. + <_> + 12 5 1 14 3. + <_> + + <_> + 5 8 2 14 -1. + <_> + 6 8 1 14 2. + <_> + + <_> + 11 6 3 14 -1. + <_> + 12 6 1 14 3. + <_> + + <_> + 0 0 8 22 -1. + <_> + 0 0 4 11 2. + <_> + 4 11 4 11 2. + <_> + + <_> + 13 10 4 8 -1. + <_> + 13 10 2 8 2. + <_> + + <_> + 1 13 16 7 -1. + <_> + 5 13 8 7 2. + <_> + + <_> + 13 10 4 8 -1. + <_> + 13 10 2 8 2. + <_> + + <_> + 2 10 4 8 -1. + <_> + 4 10 2 8 2. + <_> + + <_> + 5 7 10 6 -1. + <_> + 10 7 5 3 2. + <_> + 5 10 5 3 2. + <_> + + <_> + 0 19 8 4 -1. + <_> + 4 19 4 4 2. + <_> + + <_> + 3 15 15 3 -1. + <_> + 3 16 15 1 3. + <_> + + <_> + 7 2 4 16 -1. + <_> + 7 2 2 8 2. + <_> + 9 10 2 8 2. + <_> + + <_> + 8 6 4 12 -1. + <_> + 8 10 4 4 3. + <_> + + <_> + 7 6 4 12 -1. + <_> + 7 10 4 4 3. + <_> + + <_> + 3 15 14 2 -1. + <_> + 3 16 14 1 2. + <_> + + <_> + 0 15 17 8 -1. + <_> + 0 17 17 4 2. + <_> + + <_> + 10 3 9 10 -1. + <_> + 10 3 9 5 2. + 1 + <_> + + <_> + 7 8 4 10 -1. + <_> + 7 13 4 5 2. + <_> + + <_> + 7 8 7 15 -1. + <_> + 7 13 7 5 3. + <_> + + <_> + 1 0 16 20 -1. + <_> + 5 0 8 20 2. + <_> + + <_> + 9 18 9 5 -1. + <_> + 12 18 3 5 3. + <_> + + <_> + 1 18 9 5 -1. + <_> + 4 18 3 5 3. + <_> + + <_> + 8 7 8 12 -1. + <_> + 12 7 4 6 2. + <_> + 8 13 4 6 2. + <_> + + <_> + 2 9 4 13 -1. + <_> + 4 9 2 13 2. + <_> + + <_> + 12 14 7 4 -1. + <_> + 12 16 7 2 2. + <_> + + <_> + 0 6 18 3 -1. + <_> + 0 7 18 1 3. + <_> + + <_> + 1 16 18 7 -1. + <_> + 1 16 9 7 2. + <_> + + <_> + 0 18 15 5 -1. + <_> + 5 18 5 5 3. + <_> + + <_> + 10 5 4 8 -1. + <_> + 10 5 2 8 2. + <_> + + <_> + 5 5 4 8 -1. + <_> + 7 5 2 8 2. + <_> + + <_> + 7 0 6 5 -1. + <_> + 7 0 3 5 2. + <_> + + <_> + 6 2 2 15 -1. + <_> + 7 2 1 15 2. + <_> + + <_> + 4 0 12 4 -1. + <_> + 4 0 6 4 2. + <_> + + <_> + 5 0 2 14 -1. + <_> + 5 7 2 7 2. + <_> + + <_> + 5 16 14 4 -1. + <_> + 5 17 14 2 2. + <_> + + <_> + 2 9 2 14 -1. + <_> + 3 9 1 14 2. + <_> + + <_> + 12 0 4 7 -1. + <_> + 12 0 2 7 2. + <_> + + <_> + 3 0 4 7 -1. + <_> + 5 0 2 7 2. + <_> + + <_> + 8 0 9 15 -1. + <_> + 11 5 3 5 9. + <_> + + <_> + 2 0 9 15 -1. + <_> + 5 5 3 5 9. + <_> + + <_> + 16 5 2 16 -1. + <_> + 16 5 1 16 2. + 1 + <_> + + <_> + 3 5 16 2 -1. + <_> + 3 5 16 1 2. + 1 + <_> + + <_> + 9 11 6 9 -1. + <_> + 11 11 2 9 3. + <_> + + <_> + 7 6 8 4 -1. + <_> + 7 6 4 4 2. + 1 + <_> + + <_> + 10 0 8 8 -1. + <_> + 14 0 4 4 2. + <_> + 10 4 4 4 2. + <_> + + <_> + 3 0 12 4 -1. + <_> + 7 0 4 4 3. + <_> + + <_> + 9 11 6 9 -1. + <_> + 11 11 2 9 3. + <_> + + <_> + 3 10 4 10 -1. + <_> + 5 10 2 10 2. + <_> + + <_> + 11 12 6 5 -1. + <_> + 11 12 3 5 2. + <_> + + <_> + 4 11 6 9 -1. + <_> + 6 11 2 9 3. + <_> + + <_> + 12 12 7 4 -1. + <_> + 12 12 7 2 2. + 1 + <_> + + <_> + 1 0 8 8 -1. + <_> + 1 0 4 4 2. + <_> + 5 4 4 4 2. + <_> + + <_> + 10 4 9 10 -1. + <_> + 10 4 9 5 2. + 1 + <_> + + <_> + 1 1 12 8 -1. + <_> + 1 1 6 4 2. + <_> + 7 5 6 4 2. + <_> + + <_> + 2 14 16 2 -1. + <_> + 2 14 8 2 2. + <_> + + <_> + 7 3 4 14 -1. + <_> + 8 3 2 14 2. + <_> + + <_> + 7 1 6 7 -1. + <_> + 9 1 2 7 3. + <_> + + <_> + 3 10 4 12 -1. + <_> + 3 14 4 4 3. + <_> + + <_> + 8 4 6 7 -1. + <_> + 10 4 2 7 3. + <_> + + <_> + 5 4 6 7 -1. + <_> + 7 4 2 7 3. + <_> + + <_> + 5 7 14 8 -1. + <_> + 5 7 7 8 2. + <_> + + <_> + 2 12 6 5 -1. + <_> + 5 12 3 5 2. + <_> + + <_> + 12 9 4 7 -1. + <_> + 12 9 2 7 2. + <_> + + <_> + 3 9 4 7 -1. + <_> + 5 9 2 7 2. + <_> + + <_> + 13 2 4 12 -1. + <_> + 13 6 4 4 3. + <_> + + <_> + 2 2 4 12 -1. + <_> + 2 6 4 4 3. + <_> + + <_> + 2 2 16 8 -1. + <_> + 10 2 8 4 2. + <_> + 2 6 8 4 2. + <_> + + <_> + 2 2 15 9 -1. + <_> + 7 5 5 3 9. + <_> + + <_> + 8 7 3 12 -1. + <_> + 8 13 3 6 2. + <_> + + <_> + 2 0 3 15 -1. + <_> + 3 0 1 15 3. + <_> + + <_> + 1 8 16 4 -1. + <_> + 5 8 8 4 2. + <_> + + <_> + 6 0 8 8 -1. + <_> + 10 0 4 4 2. + <_> + 6 4 4 4 2. + <_> + + <_> + 8 9 2 14 -1. + <_> + 9 9 1 14 2. + <_> + + <_> + 8 5 3 10 -1. + <_> + 8 10 3 5 2. + <_> + + <_> + 8 9 3 14 -1. + <_> + 9 9 1 14 3. + <_> + + <_> + 6 7 12 16 -1. + <_> + 6 11 12 8 2. + <_> + + <_> + 4 0 3 16 -1. + <_> + 5 0 1 16 3. + <_> + + <_> + 13 9 4 11 -1. + <_> + 13 9 2 11 2. + <_> + + <_> + 0 18 14 3 -1. + <_> + 7 18 7 3 2. + <_> + + <_> + 6 9 12 11 -1. + <_> + 9 9 6 11 2. + <_> + + <_> + 1 7 16 9 -1. + <_> + 5 7 8 9 2. + <_> + + <_> + 11 6 4 7 -1. + <_> + 11 6 2 7 2. + <_> + + <_> + 3 11 12 12 -1. + <_> + 7 15 4 4 9. + <_> + + <_> + 11 6 4 7 -1. + <_> + 11 6 2 7 2. + <_> + + <_> + 4 0 6 10 -1. + <_> + 6 0 2 10 3. + <_> + + <_> + 13 9 2 14 -1. + <_> + 13 9 1 14 2. + <_> + + <_> + 4 9 2 14 -1. + <_> + 5 9 1 14 2. + <_> + + <_> + 7 7 6 16 -1. + <_> + 7 11 6 8 2. + <_> + + <_> + 2 16 4 7 -1. + <_> + 4 16 2 7 2. + <_> + + <_> + 9 17 9 6 -1. + <_> + 12 17 3 6 3. + <_> + + <_> + 2 16 6 7 -1. + <_> + 4 16 2 7 3. + <_> + + <_> + 14 13 5 6 -1. + <_> + 14 16 5 3 2. + <_> + + <_> + 0 0 12 6 -1. + <_> + 6 0 6 6 2. + <_> + + <_> + 4 0 14 7 -1. + <_> + 4 0 7 7 2. + <_> + + <_> + 5 0 9 22 -1. + <_> + 5 11 9 11 2. + <_> + + <_> + 11 8 8 4 -1. + <_> + 11 10 8 2 2. + <_> + + <_> + 9 0 4 8 -1. + <_> + 9 0 2 8 2. + 1 + <_> + + <_> + 5 17 14 2 -1. + <_> + 5 18 14 1 2. + <_> + + <_> + 1 17 14 3 -1. + <_> + 1 18 14 1 3. + <_> + + <_> + 6 1 12 12 -1. + <_> + 10 5 4 4 9. + <_> + + <_> + 1 1 12 12 -1. + <_> + 5 5 4 4 9. + <_> + + <_> + 6 0 7 18 -1. + <_> + 6 9 7 9 2. + <_> + + <_> + 0 0 12 9 -1. + <_> + 3 0 6 9 2. + <_> + + <_> + 9 9 3 14 -1. + <_> + 10 9 1 14 3. + <_> + + <_> + 7 5 5 9 -1. + <_> + 7 8 5 3 3. + <_> + + <_> + 9 9 3 14 -1. + <_> + 10 9 1 14 3. + <_> + + <_> + 7 9 3 14 -1. + <_> + 8 9 1 14 3. + <_> + + <_> + 12 10 5 8 -1. + <_> + 12 10 5 4 2. + 1 + <_> + + <_> + 8 6 10 7 -1. + <_> + 8 6 5 7 2. + 1 + <_> + + <_> + 12 15 7 4 -1. + <_> + 12 17 7 2 2. + <_> + + <_> + 0 15 7 4 -1. + <_> + 0 17 7 2 2. + <_> + + <_> + 15 6 2 16 -1. + <_> + 15 6 1 16 2. + <_> + + <_> + 3 9 4 8 -1. + <_> + 3 13 4 4 2. + <_> + + <_> + 0 14 19 3 -1. + <_> + 0 15 19 1 3. + <_> + + <_> + 1 12 4 7 -1. + <_> + 3 12 2 7 2. + <_> + + <_> + 14 12 4 11 -1. + <_> + 14 12 2 11 2. + <_> + + <_> + 0 8 5 6 -1. + <_> + 0 11 5 3 2. + <_> + + <_> + 4 0 14 3 -1. + <_> + 4 0 7 3 2. + <_> + + <_> + 1 0 14 3 -1. + <_> + 8 0 7 3 2. + <_> + + <_> + 12 3 7 4 -1. + <_> + 12 5 7 2 2. + <_> + + <_> + 0 3 7 4 -1. + <_> + 0 5 7 2 2. + <_> + + <_> + 10 8 4 7 -1. + <_> + 10 8 2 7 2. + <_> + + <_> + 1 12 4 11 -1. + <_> + 3 12 2 11 2. + <_> + + <_> + 2 10 16 4 -1. + <_> + 2 11 16 2 2. + <_> + + <_> + 7 11 9 3 -1. + <_> + 6 12 9 1 3. + 1 + <_> + + <_> + 5 6 12 16 -1. + <_> + 8 6 6 16 2. + <_> + + <_> + 2 6 14 4 -1. + <_> + 2 6 7 2 2. + <_> + 9 8 7 2 2. + <_> + + <_> + 5 6 10 6 -1. + <_> + 10 6 5 3 2. + <_> + 5 9 5 3 2. + <_> + + <_> + 0 9 2 14 -1. + <_> + 1 9 1 14 2. + <_> + + <_> + 10 18 9 5 -1. + <_> + 13 18 3 5 3. + <_> + + <_> + 4 9 10 3 -1. + <_> + 3 10 10 1 3. + 1 + <_> + + <_> + 10 18 9 5 -1. + <_> + 13 18 3 5 3. + <_> + + <_> + 0 18 9 5 -1. + <_> + 3 18 3 5 3. + <_> + + <_> + 5 8 12 9 -1. + <_> + 9 8 4 9 3. + <_> + + <_> + 2 8 12 9 -1. + <_> + 6 8 4 9 3. + <_> + + <_> + 9 6 4 14 -1. + <_> + 10 6 2 14 2. + <_> + + <_> + 2 20 15 3 -1. + <_> + 7 20 5 3 3. + <_> + + <_> + 5 4 9 5 -1. + <_> + 8 4 3 5 3. + <_> + + <_> + 6 6 4 14 -1. + <_> + 7 6 2 14 2. + <_> + + <_> + 10 0 2 14 -1. + <_> + 10 0 1 14 2. + <_> + + <_> + 7 0 2 14 -1. + <_> + 8 0 1 14 2. + <_> + + <_> + 12 0 4 8 -1. + <_> + 12 0 2 8 2. + <_> + + <_> + 0 3 14 3 -1. + <_> + 0 4 14 1 3. + <_> + + <_> + 5 20 10 3 -1. + <_> + 5 20 5 3 2. + <_> + + <_> + 6 18 7 4 -1. + <_> + 6 20 7 2 2. + <_> + + <_> + 3 6 6 9 -1. + <_> + 5 6 2 9 3. + <_> + + <_> + 13 0 6 7 -1. + <_> + 15 0 2 7 3. + <_> + + <_> + 3 13 4 10 -1. + <_> + 5 13 2 10 2. + <_> + + <_> + 12 12 4 10 -1. + <_> + 12 12 2 10 2. + <_> + + <_> + 3 12 4 7 -1. + <_> + 5 12 2 7 2. + <_> + + <_> + 13 0 6 14 -1. + <_> + 15 0 2 14 3. + <_> + + <_> + 0 0 6 12 -1. + <_> + 2 0 2 12 3. + <_> + + <_> + 5 19 14 4 -1. + <_> + 12 19 7 2 2. + <_> + 5 21 7 2 2. + <_> + + <_> + 0 12 9 10 -1. + <_> + 0 17 9 5 2. + <_> + + <_> + 14 13 5 6 -1. + <_> + 14 16 5 3 2. + <_> + + <_> + 0 16 8 4 -1. + <_> + 0 18 8 2 2. + <_> + + <_> + 3 16 16 3 -1. + <_> + 3 17 16 1 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 2 0 16 5 -1. + <_> + 6 0 8 5 2. + <_> + + <_> + 0 0 17 10 -1. + <_> + 0 5 17 5 2. + <_> + + <_> + 8 1 3 15 -1. + <_> + 9 1 1 15 3. + <_> + + <_> + 0 2 8 20 -1. + <_> + 0 7 8 10 2. + <_> + + <_> + 8 7 4 10 -1. + <_> + 8 12 4 5 2. + <_> + + <_> + 7 7 4 10 -1. + <_> + 7 12 4 5 2. + <_> + + <_> + 11 0 3 17 -1. + <_> + 12 0 1 17 3. + <_> + + <_> + 5 0 3 17 -1. + <_> + 6 0 1 17 3. + <_> + + <_> + 12 9 3 14 -1. + <_> + 13 9 1 14 3. + <_> + + <_> + 6 2 6 10 -1. + <_> + 9 2 3 10 2. + <_> + + <_> + 4 21 14 2 -1. + <_> + 4 21 7 2 2. + <_> + + <_> + 5 0 8 4 -1. + <_> + 9 0 4 4 2. + <_> + + <_> + 10 0 4 8 -1. + <_> + 10 0 4 4 2. + 1 + <_> + + <_> + 3 0 12 6 -1. + <_> + 3 0 6 3 2. + <_> + 9 3 6 3 2. + <_> + + <_> + 8 8 6 8 -1. + <_> + 10 8 2 8 3. + <_> + + <_> + 1 13 12 8 -1. + <_> + 4 13 6 8 2. + <_> + + <_> + 8 8 6 8 -1. + <_> + 10 8 2 8 3. + <_> + + <_> + 5 8 6 8 -1. + <_> + 7 8 2 8 3. + <_> + + <_> + 7 13 8 10 -1. + <_> + 9 13 4 10 2. + <_> + + <_> + 4 14 8 9 -1. + <_> + 6 14 4 9 2. + <_> + + <_> + 9 15 9 5 -1. + <_> + 12 15 3 5 3. + <_> + + <_> + 7 15 4 7 -1. + <_> + 9 15 2 7 2. + <_> + + <_> + 4 19 12 4 -1. + <_> + 4 19 6 4 2. + <_> + + <_> + 6 15 6 8 -1. + <_> + 8 15 2 8 3. + <_> + + <_> + 8 5 8 8 -1. + <_> + 12 5 4 4 2. + <_> + 8 9 4 4 2. + <_> + + <_> + 0 14 7 4 -1. + <_> + 0 16 7 2 2. + <_> + + <_> + 10 2 4 8 -1. + <_> + 11 3 2 8 2. + 1 + <_> + + <_> + 1 12 17 3 -1. + <_> + 1 13 17 1 3. + <_> + + <_> + 13 8 4 15 -1. + <_> + 14 8 2 15 2. + <_> + + <_> + 2 12 14 3 -1. + <_> + 2 13 14 1 3. + <_> + + <_> + 6 12 7 6 -1. + <_> + 6 14 7 2 3. + <_> + + <_> + 2 2 12 6 -1. + <_> + 2 2 6 3 2. + <_> + 8 5 6 3 2. + <_> + + <_> + 11 0 8 5 -1. + <_> + 11 0 4 5 2. + <_> + + <_> + 0 0 8 5 -1. + <_> + 4 0 4 5 2. + <_> + + <_> + 1 2 18 20 -1. + <_> + 1 2 9 20 2. + <_> + + <_> + 9 5 10 8 -1. + <_> + 9 5 5 8 2. + 1 + <_> + + <_> + 7 8 7 10 -1. + <_> + 7 13 7 5 2. + <_> + + <_> + 7 7 4 14 -1. + <_> + 8 7 2 14 2. + <_> + + <_> + 15 7 4 16 -1. + <_> + 15 7 2 16 2. + <_> + + <_> + 0 0 12 7 -1. + <_> + 4 0 4 7 3. + <_> + + <_> + 11 7 4 7 -1. + <_> + 11 7 2 7 2. + 1 + <_> + + <_> + 4 4 6 15 -1. + <_> + 7 4 3 15 2. + <_> + + <_> + 6 10 9 13 -1. + <_> + 9 10 3 13 3. + <_> + + <_> + 1 14 4 7 -1. + <_> + 3 14 2 7 2. + <_> + + <_> + 11 1 3 14 -1. + <_> + 12 1 1 14 3. + <_> + + <_> + 5 11 4 8 -1. + <_> + 7 11 2 8 2. + <_> + + <_> + 11 6 4 7 -1. + <_> + 11 6 2 7 2. + <_> + + <_> + 4 6 4 7 -1. + <_> + 6 6 2 7 2. + <_> + + <_> + 7 5 9 9 -1. + <_> + 10 5 3 9 3. + <_> + + <_> + 2 1 12 12 -1. + <_> + 6 5 4 4 9. + <_> + + <_> + 4 19 14 4 -1. + <_> + 11 19 7 2 2. + <_> + 4 21 7 2 2. + <_> + + <_> + 1 19 14 4 -1. + <_> + 1 19 7 2 2. + <_> + 8 21 7 2 2. + <_> + + <_> + 9 18 9 5 -1. + <_> + 12 18 3 5 3. + <_> + + <_> + 1 18 9 5 -1. + <_> + 4 18 3 5 3. + <_> + + <_> + 11 4 8 6 -1. + <_> + 11 4 4 6 2. + 1 + <_> + + <_> + 6 8 7 6 -1. + <_> + 6 10 7 2 3. + <_> + + <_> + 5 17 14 2 -1. + <_> + 5 18 14 1 2. + <_> + + <_> + 6 6 9 3 -1. + <_> + 5 7 9 1 3. + 1 + <_> + + <_> + 13 9 4 11 -1. + <_> + 13 9 2 11 2. + <_> + + <_> + 2 9 4 11 -1. + <_> + 4 9 2 11 2. + <_> + + <_> + 12 0 3 14 -1. + <_> + 13 0 1 14 3. + <_> + + <_> + 4 0 3 14 -1. + <_> + 5 0 1 14 3. + <_> + + <_> + 7 10 5 6 -1. + <_> + 7 13 5 3 2. + <_> + + <_> + 0 12 17 4 -1. + <_> + 0 14 17 2 2. + <_> + + <_> + 10 5 6 10 -1. + <_> + 12 7 2 10 3. + 1 + <_> + + <_> + 2 9 12 12 -1. + <_> + 6 13 4 4 9. + <_> + + <_> + 1 15 12 8 -1. + <_> + 7 15 6 8 2. + <_> + + <_> + 6 0 8 8 -1. + <_> + 10 0 4 4 2. + <_> + 6 4 4 4 2. + <_> + + <_> + 0 15 7 8 -1. + <_> + 0 17 7 4 2. + <_> + + <_> + 8 7 4 8 -1. + <_> + 8 11 4 4 2. + <_> + + <_> + 5 8 2 14 -1. + <_> + 6 8 1 14 2. + <_> + + <_> + 12 8 7 4 -1. + <_> + 12 10 7 2 2. + <_> + + <_> + 0 13 14 4 -1. + <_> + 0 13 7 2 2. + <_> + 7 15 7 2 2. + <_> + + <_> + 6 13 7 8 -1. + <_> + 6 15 7 4 2. + <_> + + <_> + 7 7 4 15 -1. + <_> + 8 7 2 15 2. + <_> + + <_> + 11 16 5 6 -1. + <_> + 11 19 5 3 2. + <_> + + <_> + 4 0 6 10 -1. + <_> + 4 0 3 5 2. + <_> + 7 5 3 5 2. + <_> + + <_> + 11 10 7 6 -1. + <_> + 9 12 7 2 3. + 1 + <_> + + <_> + 2 0 14 2 -1. + <_> + 9 0 7 2 2. + <_> + + <_> + 1 10 18 8 -1. + <_> + 10 10 9 4 2. + <_> + 1 14 9 4 2. + <_> + + <_> + 1 18 15 3 -1. + <_> + 1 19 15 1 3. + <_> + + <_> + 4 18 14 3 -1. + <_> + 4 19 14 1 3. + <_> + + <_> + 0 3 19 18 -1. + <_> + 0 9 19 6 3. + <_> + + <_> + 4 0 11 20 -1. + <_> + 4 10 11 10 2. + <_> + + <_> + 5 0 9 18 -1. + <_> + 5 9 9 9 2. + <_> + + <_> + 9 0 4 20 -1. + <_> + 9 10 4 10 2. + <_> + + <_> + 1 11 6 6 -1. + <_> + 1 14 6 3 2. + <_> + + <_> + 12 16 6 6 -1. + <_> + 12 19 6 3 2. + <_> + + <_> + 3 8 2 14 -1. + <_> + 4 8 1 14 2. + <_> + + <_> + 7 11 5 12 -1. + <_> + 7 15 5 4 3. + <_> + + <_> + 5 11 5 12 -1. + <_> + 5 14 5 6 2. + <_> + + <_> + 13 0 4 16 -1. + <_> + 15 0 2 8 2. + <_> + 13 8 2 8 2. + <_> + + <_> + 1 0 12 8 -1. + <_> + 7 0 6 8 2. + <_> + + <_> + 13 11 6 7 -1. + <_> + 15 11 2 7 3. + <_> + + <_> + 0 8 7 8 -1. + <_> + 0 10 7 4 2. + <_> + + <_> + 6 6 7 6 -1. + <_> + 6 8 7 2 3. + <_> + + <_> + 7 1 4 14 -1. + <_> + 7 8 4 7 2. + <_> + + <_> + 13 17 6 6 -1. + <_> + 13 17 3 6 2. + <_> + + <_> + 5 11 4 12 -1. + <_> + 5 17 4 6 2. + <_> + + <_> + 13 17 6 6 -1. + <_> + 13 17 3 6 2. + <_> + + <_> + 0 8 2 14 -1. + <_> + 0 15 2 7 2. + <_> + + <_> + 13 18 6 5 -1. + <_> + 13 18 3 5 2. + <_> + + <_> + 4 0 2 14 -1. + <_> + 5 0 1 14 2. + <_> + + <_> + 13 11 6 8 -1. + <_> + 15 11 2 8 3. + <_> + + <_> + 1 11 3 12 -1. + <_> + 1 17 3 6 2. + <_> + + <_> + 12 18 6 5 -1. + <_> + 12 18 3 5 2. + <_> + + <_> + 0 15 4 8 -1. + <_> + 0 19 4 4 2. + <_> + + <_> + 13 11 6 8 -1. + <_> + 15 11 2 8 3. + <_> + + <_> + 0 11 6 8 -1. + <_> + 2 11 2 8 3. + <_> + + <_> + 5 17 14 3 -1. + <_> + 5 18 14 1 3. + <_> + + <_> + 0 15 7 6 -1. + <_> + 0 17 7 2 3. + <_> + + <_> + 10 8 4 10 -1. + <_> + 10 8 2 10 2. + 1 + <_> + + <_> + 1 11 16 7 -1. + <_> + 5 11 8 7 2. + <_> + + <_> + 5 0 9 16 -1. + <_> + 8 0 3 16 3. + <_> + + <_> + 6 6 2 14 -1. + <_> + 7 6 1 14 2. + <_> + + <_> + 11 5 4 15 -1. + <_> + 12 5 2 15 2. + <_> + + <_> + 9 8 10 4 -1. + <_> + 9 8 10 2 2. + 1 + <_> + + <_> + 8 1 4 14 -1. + <_> + 8 1 2 14 2. + <_> + + <_> + 7 1 4 14 -1. + <_> + 9 1 2 14 2. + <_> + + <_> + 1 14 18 9 -1. + <_> + 7 17 6 3 9. + <_> + + <_> + 6 9 7 9 -1. + <_> + 6 12 7 3 3. + <_> + + <_> + 1 11 18 2 -1. + <_> + 1 12 18 1 2. + <_> + + <_> + 7 7 4 16 -1. + <_> + 7 11 4 8 2. + <_> + + <_> + 2 10 15 3 -1. + <_> + 2 11 15 1 3. + <_> + + <_> + 6 12 7 9 -1. + <_> + 6 15 7 3 3. + <_> + + <_> + 4 10 15 3 -1. + <_> + 4 11 15 1 3. + <_> + + <_> + 0 19 14 4 -1. + <_> + 0 19 7 2 2. + <_> + 7 21 7 2 2. + <_> + + <_> + 5 17 14 3 -1. + <_> + 5 18 14 1 3. + <_> + + <_> + 1 7 3 14 -1. + <_> + 2 7 1 14 3. + <_> + + <_> + 9 0 6 7 -1. + <_> + 11 0 2 7 3. + <_> + + <_> + 4 0 6 7 -1. + <_> + 6 0 2 7 3. + <_> + + <_> + 6 5 8 6 -1. + <_> + 6 5 4 6 2. + <_> + + <_> + 5 2 3 16 -1. + <_> + 6 2 1 16 3. + <_> + + <_> + 15 4 4 15 -1. + <_> + 16 4 2 15 2. + <_> + + <_> + 6 12 6 5 -1. + <_> + 6 12 3 5 2. + 1 + <_> + + <_> + 8 9 3 14 -1. + <_> + 9 9 1 14 3. + <_> + + <_> + 0 16 7 4 -1. + <_> + 0 18 7 2 2. + <_> + + <_> + 5 16 14 3 -1. + <_> + 5 17 14 1 3. + <_> + + <_> + 0 4 4 15 -1. + <_> + 1 4 2 15 2. + <_> + + <_> + 10 2 8 6 -1. + <_> + 10 4 8 2 3. + <_> + + <_> + 1 2 8 6 -1. + <_> + 1 4 8 2 3. + <_> + + <_> + 10 6 4 16 -1. + <_> + 12 6 2 8 2. + <_> + 10 14 2 8 2. + <_> + + <_> + 7 1 4 18 -1. + <_> + 7 1 2 9 2. + <_> + 9 10 2 9 2. + <_> + + <_> + 8 4 4 7 -1. + <_> + 8 4 2 7 2. + <_> + + <_> + 7 4 4 7 -1. + <_> + 9 4 2 7 2. + <_> + + <_> + 7 0 12 14 -1. + <_> + 7 0 6 14 2. + <_> + + <_> + 2 1 2 14 -1. + <_> + 3 1 1 14 2. + <_> + + <_> + 0 18 14 4 -1. + <_> + 0 18 7 2 2. + <_> + 7 20 7 2 2. + <_> + + <_> + 6 0 8 8 -1. + <_> + 10 0 4 4 2. + <_> + 6 4 4 4 2. + <_> + + <_> + 4 9 6 10 -1. + <_> + 4 9 3 5 2. + <_> + 7 14 3 5 2. + <_> + + <_> + 1 17 18 6 -1. + <_> + 10 17 9 3 2. + <_> + 1 20 9 3 2. + <_> + + <_> + 5 0 6 21 -1. + <_> + 7 7 2 7 9. + <_> + + <_> + 6 7 12 7 -1. + <_> + 6 7 6 7 2. + <_> + + <_> + 7 0 12 3 -1. + <_> + 7 0 6 3 2. + 1 + <_> + + <_> + 5 0 9 5 -1. + <_> + 8 0 3 5 3. + <_> + + <_> + 7 9 3 14 -1. + <_> + 8 9 1 14 3. + <_> + + <_> + 3 14 16 9 -1. + <_> + 3 17 16 3 3. + <_> + + <_> + 1 17 6 6 -1. + <_> + 4 17 3 6 2. + <_> + + <_> + 5 1 10 20 -1. + <_> + 5 6 10 10 2. + <_> + + <_> + 1 16 12 7 -1. + <_> + 4 16 6 7 2. + <_> + + <_> + 5 0 9 4 -1. + <_> + 5 2 9 2 2. + <_> + + <_> + 3 0 13 6 -1. + <_> + 3 2 13 2 3. + <_> + + <_> + 11 13 7 8 -1. + <_> + 11 15 7 4 2. + <_> + + <_> + 3 0 4 8 -1. + <_> + 3 4 4 4 2. + <_> + + <_> + 9 17 9 6 -1. + <_> + 12 17 3 6 3. + <_> + + <_> + 6 5 7 6 -1. + <_> + 6 7 7 2 3. + <_> + + <_> + 8 17 7 6 -1. + <_> + 8 19 7 2 3. + <_> + + <_> + 5 12 5 8 -1. + <_> + 5 16 5 4 2. + <_> + + <_> + 0 15 19 2 -1. + <_> + 0 16 19 1 2. + <_> + + <_> + 6 7 7 4 -1. + <_> + 6 9 7 2 2. + <_> + + <_> + 9 0 2 21 -1. + <_> + 9 7 2 7 3. + <_> + + <_> + 0 19 15 4 -1. + <_> + 5 19 5 4 3. + <_> + + <_> + 9 20 10 3 -1. + <_> + 9 20 5 3 2. + <_> + + <_> + 0 17 15 3 -1. + <_> + 0 18 15 1 3. + <_> + + <_> + 12 13 6 5 -1. + <_> + 12 13 3 5 2. + <_> + + <_> + 6 7 7 6 -1. + <_> + 6 9 7 2 3. + <_> + + <_> + 3 15 14 3 -1. + <_> + 3 16 14 1 3. + <_> + + <_> + 0 20 10 3 -1. + <_> + 5 20 5 3 2. + <_> + + <_> + 6 7 8 4 -1. + <_> + 6 7 4 4 2. + <_> + + <_> + 1 17 7 6 -1. + <_> + 1 19 7 2 3. + <_> + + <_> + 7 17 12 4 -1. + <_> + 11 17 4 4 3. + <_> + + <_> + 3 15 6 7 -1. + <_> + 5 15 2 7 3. + <_> + + <_> + 6 7 12 7 -1. + <_> + 6 7 6 7 2. + <_> + + <_> + 1 9 12 12 -1. + <_> + 1 13 12 4 3. + <_> + + <_> + 12 6 5 9 -1. + <_> + 12 9 5 3 3. + <_> + + <_> + 2 6 5 9 -1. + <_> + 2 9 5 3 3. + <_> + + <_> + 12 6 6 7 -1. + <_> + 14 8 2 7 3. + 1 + <_> + + <_> + 5 9 8 10 -1. + <_> + 5 9 4 5 2. + <_> + 9 14 4 5 2. + <_> + + <_> + 2 11 16 6 -1. + <_> + 10 11 8 3 2. + <_> + 2 14 8 3 2. + <_> + + <_> + 8 4 3 16 -1. + <_> + 9 4 1 16 3. + <_> + + <_> + 8 9 4 14 -1. + <_> + 9 9 2 14 2. + <_> + + <_> + 7 9 4 14 -1. + <_> + 8 9 2 14 2. + <_> + + <_> + 7 17 12 4 -1. + <_> + 11 17 4 4 3. + <_> + + <_> + 0 17 12 4 -1. + <_> + 4 17 4 4 3. + <_> + + <_> + 13 12 6 10 -1. + <_> + 16 12 3 5 2. + <_> + 13 17 3 5 2. + <_> + + <_> + 0 17 6 6 -1. + <_> + 3 17 3 6 2. + <_> + + <_> + 12 4 6 8 -1. + <_> + 12 4 3 8 2. + 1 + <_> + + <_> + 3 6 10 15 -1. + <_> + 8 6 5 15 2. + <_> + + <_> + 10 10 7 4 -1. + <_> + 10 10 7 2 2. + 1 + <_> + + <_> + 1 9 9 7 -1. + <_> + 4 9 3 7 3. + <_> + + <_> + 1 17 18 6 -1. + <_> + 10 17 9 3 2. + <_> + 1 20 9 3 2. + <_> + + <_> + 6 0 13 3 -1. + <_> + 5 1 13 1 3. + 1 + <_> + + <_> + 10 0 3 9 -1. + <_> + 11 1 1 9 3. + 1 + <_> + + <_> + 9 0 9 3 -1. + <_> + 8 1 9 1 3. + 1 + <_> + + <_> + 7 1 12 12 -1. + <_> + 13 1 6 6 2. + <_> + 7 7 6 6 2. + <_> + + <_> + 7 4 8 6 -1. + <_> + 7 4 8 3 2. + 1 + <_> + + <_> + 11 11 8 4 -1. + <_> + 11 11 8 2 2. + 1 + <_> + + <_> + 8 11 4 8 -1. + <_> + 8 11 2 8 2. + 1 + <_> + + <_> + 10 10 7 4 -1. + <_> + 10 10 7 2 2. + 1 + <_> + + <_> + 9 10 4 7 -1. + <_> + 9 10 2 7 2. + 1 + <_> + + <_> + 8 7 3 14 -1. + <_> + 9 7 1 14 3. + <_> + + <_> + 8 6 10 7 -1. + <_> + 8 6 5 7 2. + 1 + <_> + + <_> + 3 6 16 3 -1. + <_> + 3 7 16 1 3. + <_> + + <_> + 4 5 2 17 -1. + <_> + 5 5 1 17 2. + <_> + + <_> + 12 0 6 18 -1. + <_> + 15 0 3 9 2. + <_> + 12 9 3 9 2. + <_> + + <_> + 3 4 6 16 -1. + <_> + 3 4 3 8 2. + <_> + 6 12 3 8 2. + <_> + + <_> + 12 0 6 18 -1. + <_> + 15 0 3 9 2. + <_> + 12 9 3 9 2. + <_> + + <_> + 0 1 16 4 -1. + <_> + 0 1 8 2 2. + <_> + 8 3 8 2 2. + <_> + + <_> + 6 12 12 5 -1. + <_> + 6 12 6 5 2. + <_> + + <_> + 3 7 3 10 -1. + <_> + 3 12 3 5 2. + <_> + + <_> + 11 3 7 12 -1. + <_> + 11 7 7 4 3. + <_> + + <_> + 0 6 8 6 -1. + <_> + 0 8 8 2 3. + <_> + + <_> + 12 3 7 6 -1. + <_> + 12 5 7 2 3. + <_> + + <_> + 0 3 7 6 -1. + <_> + 0 5 7 2 3. + <_> + + <_> + 13 10 6 8 -1. + <_> + 15 10 2 8 3. + <_> + + <_> + 0 17 14 2 -1. + <_> + 0 18 14 1 2. + <_> + + <_> + 13 10 6 8 -1. + <_> + 15 10 2 8 3. + <_> + + <_> + 0 17 14 2 -1. + <_> + 0 18 14 1 2. + <_> + + <_> + 6 0 8 8 -1. + <_> + 10 0 4 4 2. + <_> + 6 4 4 4 2. + <_> + + <_> + 0 10 6 8 -1. + <_> + 2 10 2 8 3. + <_> + + <_> + 13 0 3 14 -1. + <_> + 14 0 1 14 3. + <_> + + <_> + 6 0 6 7 -1. + <_> + 8 0 2 7 3. + <_> + + <_> + 6 0 8 8 -1. + <_> + 10 0 4 4 2. + <_> + 6 4 4 4 2. + <_> + + <_> + 5 0 8 8 -1. + <_> + 5 0 4 4 2. + <_> + 9 4 4 4 2. + <_> + + <_> + 3 7 16 7 -1. + <_> + 3 7 8 7 2. + <_> + + <_> + 0 7 16 7 -1. + <_> + 8 7 8 7 2. + <_> + + <_> + 2 11 10 8 -1. + <_> + 7 11 5 8 2. + <_> + + <_> + 12 8 6 9 -1. + <_> + 14 8 2 9 3. + <_> + + <_> + 1 8 6 9 -1. + <_> + 3 8 2 9 3. + <_> + + <_> + 4 3 14 11 -1. + <_> + 4 3 7 11 2. + <_> + + <_> + 5 5 13 3 -1. + <_> + 4 6 13 1 3. + 1 + <_> + + <_> + 7 0 6 9 -1. + <_> + 9 0 2 9 3. + <_> + + <_> + 1 0 14 12 -1. + <_> + 1 0 7 6 2. + <_> + 8 6 7 6 2. + <_> + + <_> + 10 0 8 4 -1. + <_> + 10 0 4 4 2. + <_> + + <_> + 3 10 4 12 -1. + <_> + 5 10 2 12 2. + <_> + + <_> + 11 0 2 22 -1. + <_> + 11 11 2 11 2. + <_> + + <_> + 0 19 14 4 -1. + <_> + 0 19 7 2 2. + <_> + 7 21 7 2 2. + <_> + + <_> + 10 8 2 8 -1. + <_> + 10 8 1 8 2. + 1 + <_> + + <_> + 5 0 4 14 -1. + <_> + 5 0 2 7 2. + <_> + 7 7 2 7 2. + <_> + + <_> + 8 4 4 10 -1. + <_> + 8 9 4 5 2. + <_> + + <_> + 9 8 8 2 -1. + <_> + 9 8 8 1 2. + 1 + <_> + + <_> + 0 7 19 3 -1. + <_> + 0 8 19 1 3. + <_> + + <_> + 0 8 19 2 -1. + <_> + 0 9 19 1 2. + <_> + + <_> + 1 6 18 4 -1. + <_> + 10 6 9 2 2. + <_> + 1 8 9 2 2. + <_> + + <_> + 2 1 8 18 -1. + <_> + 6 1 4 18 2. + <_> + + <_> + 6 11 10 12 -1. + <_> + 11 11 5 6 2. + <_> + 6 17 5 6 2. + <_> + + <_> + 3 7 9 11 -1. + <_> + 6 7 3 11 3. + <_> + + <_> + 9 0 6 14 -1. + <_> + 11 0 2 14 3. + <_> + + <_> + 2 16 12 7 -1. + <_> + 6 16 4 7 3. + <_> + + <_> + 2 15 15 6 -1. + <_> + 7 15 5 6 3. + <_> + + <_> + 5 2 8 7 -1. + <_> + 7 2 4 7 2. + <_> + + <_> + 8 0 4 14 -1. + <_> + 9 0 2 14 2. + <_> + + <_> + 7 0 4 14 -1. + <_> + 8 0 2 14 2. + <_> + + <_> + 7 18 12 5 -1. + <_> + 11 18 4 5 3. + <_> + + <_> + 1 18 15 3 -1. + <_> + 1 19 15 1 3. + <_> + + <_> + 9 17 9 6 -1. + <_> + 12 17 3 6 3. + <_> + + <_> + 7 8 9 6 -1. + <_> + 5 10 9 2 3. + 1 + <_> + + <_> + 11 10 4 9 -1. + <_> + 12 11 2 9 2. + 1 + <_> + + <_> + 8 10 9 4 -1. + <_> + 7 11 9 2 2. + 1 + <_> + + <_> + 15 3 2 16 -1. + <_> + 15 11 2 8 2. + <_> + + <_> + 1 17 5 6 -1. + <_> + 1 20 5 3 2. + <_> + + <_> + 12 16 5 6 -1. + <_> + 12 19 5 3 2. + <_> + + <_> + 5 2 3 14 -1. + <_> + 6 2 1 14 3. + <_> + + <_> + 9 17 9 6 -1. + <_> + 12 17 3 6 3. + <_> + + <_> + 6 1 6 9 -1. + <_> + 8 1 2 9 3. + <_> + + <_> + 7 7 10 5 -1. + <_> + 7 7 5 5 2. + <_> + + <_> + 6 0 4 20 -1. + <_> + 6 0 2 10 2. + <_> + 8 10 2 10 2. + <_> + + <_> + 13 10 3 9 -1. + <_> + 14 11 1 9 3. + 1 + <_> + + <_> + 6 10 9 3 -1. + <_> + 5 11 9 1 3. + 1 + <_> + + <_> + 5 21 14 2 -1. + <_> + 5 21 7 2 2. + <_> + + <_> + 8 6 3 14 -1. + <_> + 9 6 1 14 3. + <_> + + <_> + 8 1 4 9 -1. + <_> + 8 1 2 9 2. + <_> + + <_> + 7 1 4 9 -1. + <_> + 9 1 2 9 2. + <_> + + <_> + 7 17 12 6 -1. + <_> + 13 17 6 3 2. + <_> + 7 20 6 3 2. + <_> + + <_> + 3 4 10 6 -1. + <_> + 8 4 5 6 2. + <_> + + <_> + 15 0 4 8 -1. + <_> + 15 4 4 4 2. + <_> + + <_> + 3 5 6 8 -1. + <_> + 5 5 2 8 3. + <_> + + <_> + 15 0 4 8 -1. + <_> + 15 4 4 4 2. + <_> + + <_> + 0 0 4 8 -1. + <_> + 0 4 4 4 2. + <_> + + <_> + 7 0 9 5 -1. + <_> + 10 0 3 5 3. + <_> + + <_> + 3 0 6 5 -1. + <_> + 6 0 3 5 2. + <_> + + <_> + 5 21 14 2 -1. + <_> + 5 21 7 2 2. + <_> + + <_> + 9 3 8 9 -1. + <_> + 9 3 4 9 2. + 1 + <_> + + <_> + 6 1 12 8 -1. + <_> + 12 1 6 4 2. + <_> + 6 5 6 4 2. + <_> + + <_> + 4 10 10 11 -1. + <_> + 9 10 5 11 2. + <_> + + <_> + 12 1 3 15 -1. + <_> + 13 1 1 15 3. + <_> + + <_> + 4 3 8 12 -1. + <_> + 8 3 4 12 2. + <_> + + <_> + 8 2 10 8 -1. + <_> + 8 2 5 8 2. + <_> + + <_> + 0 4 19 6 -1. + <_> + 0 6 19 2 3. + <_> + + <_> + 4 0 11 16 -1. + <_> + 4 4 11 8 2. + <_> + + <_> + 4 1 6 5 -1. + <_> + 7 1 3 5 2. + <_> + + <_> + 3 5 14 18 -1. + <_> + 10 5 7 9 2. + <_> + 3 14 7 9 2. + <_> + + <_> + 1 17 5 6 -1. + <_> + 1 20 5 3 2. + <_> + + <_> + 13 0 4 14 -1. + <_> + 15 0 2 7 2. + <_> + 13 7 2 7 2. + <_> + + <_> + 2 0 4 14 -1. + <_> + 2 0 2 7 2. + <_> + 4 7 2 7 2. + <_> + + <_> + 10 2 2 10 -1. + <_> + 10 2 1 10 2. + 1 + <_> + + <_> + 9 1 9 3 -1. + <_> + 8 2 9 1 3. + 1 + <_> + + <_> + 6 2 10 6 -1. + <_> + 11 2 5 3 2. + <_> + 6 5 5 3 2. + <_> + + <_> + 1 12 9 6 -1. + <_> + 1 14 9 2 3. + <_> + + <_> + 6 2 10 6 -1. + <_> + 11 2 5 3 2. + <_> + 6 5 5 3 2. + <_> + + <_> + 3 2 10 6 -1. + <_> + 3 2 5 3 2. + <_> + 8 5 5 3 2. + <_> + + <_> + 7 0 5 20 -1. + <_> + 7 5 5 10 2. + <_> + + <_> + 2 10 12 7 -1. + <_> + 5 10 6 7 2. + <_> + + <_> + 0 18 14 4 -1. + <_> + 0 18 7 2 2. + <_> + 7 20 7 2 2. + <_> + + <_> + 9 7 3 15 -1. + <_> + 10 7 1 15 3. + <_> + + <_> + 6 8 6 5 -1. + <_> + 9 8 3 5 2. + <_> + + <_> + 9 4 2 17 -1. + <_> + 9 4 1 17 2. + <_> + + <_> + 8 4 2 17 -1. + <_> + 9 4 1 17 2. + <_> + + <_> + 8 18 9 5 -1. + <_> + 11 18 3 5 3. + <_> + + <_> + 2 18 9 5 -1. + <_> + 5 18 3 5 3. + <_> + + <_> + 12 18 6 5 -1. + <_> + 12 18 3 5 2. + <_> + + <_> + 5 15 6 5 -1. + <_> + 8 15 3 5 2. + <_> + + <_> + 13 0 6 10 -1. + <_> + 15 0 2 10 3. + <_> + + <_> + 2 14 10 9 -1. + <_> + 2 17 10 3 3. + <_> + + <_> + 13 0 6 10 -1. + <_> + 15 0 2 10 3. + <_> + + <_> + 0 0 6 10 -1. + <_> + 2 0 2 10 3. + <_> + + <_> + 12 5 3 12 -1. + <_> + 12 5 3 6 2. + 1 + <_> + + <_> + 6 18 7 4 -1. + <_> + 6 20 7 2 2. + <_> + + <_> + 14 7 4 12 -1. + <_> + 15 8 2 12 2. + 1 + <_> + + <_> + 5 7 12 4 -1. + <_> + 4 8 12 2 2. + 1 + <_> + + <_> + 14 13 5 9 -1. + <_> + 14 16 5 3 3. + <_> + + <_> + 0 13 5 9 -1. + <_> + 0 16 5 3 3. + <_> + + <_> + 12 14 7 6 -1. + <_> + 12 16 7 2 3. + <_> + + <_> + 1 16 6 6 -1. + <_> + 1 19 6 3 2. + <_> + + <_> + 7 0 9 4 -1. + <_> + 7 2 9 2 2. + <_> + + <_> + 0 9 18 3 -1. + <_> + 0 10 18 1 3. + <_> + + <_> + 9 17 9 6 -1. + <_> + 12 17 3 6 3. + <_> + + <_> + 2 14 15 9 -1. + <_> + 7 17 5 3 9. + <_> + + <_> + 9 13 8 8 -1. + <_> + 9 17 8 4 2. + <_> + + <_> + 4 9 2 14 -1. + <_> + 5 9 1 14 2. + <_> + + <_> + 12 10 4 13 -1. + <_> + 12 10 2 13 2. + <_> + + <_> + 3 10 4 13 -1. + <_> + 5 10 2 13 2. + <_> + + <_> + 5 5 14 2 -1. + <_> + 5 5 7 2 2. + <_> + + <_> + 0 5 14 2 -1. + <_> + 7 5 7 2 2. + <_> + + <_> + 13 12 6 10 -1. + <_> + 16 12 3 5 2. + <_> + 13 17 3 5 2. + <_> + + <_> + 0 12 6 10 -1. + <_> + 0 12 3 5 2. + <_> + 3 17 3 5 2. + <_> + + <_> + 12 8 5 12 -1. + <_> + 12 11 5 6 2. + <_> + + <_> + 2 8 5 12 -1. + <_> + 2 11 5 6 2. + <_> + + <_> + 6 8 7 4 -1. + <_> + 6 10 7 2 2. + <_> + + <_> + 0 17 14 3 -1. + <_> + 0 18 14 1 3. + <_> + + <_> + 12 7 2 15 -1. + <_> + 12 7 1 15 2. + <_> + + <_> + 1 17 9 6 -1. + <_> + 4 17 3 6 3. + <_> + + <_> + 10 6 9 7 -1. + <_> + 13 9 3 7 3. + 1 + <_> + + <_> + 9 6 7 9 -1. + <_> + 6 9 7 3 3. + 1 + <_> + + <_> + 5 8 10 4 -1. + <_> + 5 10 10 2 2. + <_> + + <_> + 0 6 6 14 -1. + <_> + 0 13 6 7 2. + <_> + + <_> + 1 1 18 22 -1. + <_> + 10 1 9 11 2. + <_> + 1 12 9 11 2. + <_> + + <_> + 1 5 17 3 -1. + <_> + 1 6 17 1 3. + <_> + + <_> + 13 12 6 5 -1. + <_> + 13 12 3 5 2. + <_> + + <_> + 0 5 16 3 -1. + <_> + 0 6 16 1 3. + <_> + + <_> + 12 6 6 17 -1. + <_> + 12 6 3 17 2. + <_> + + <_> + 1 6 6 17 -1. + <_> + 4 6 3 17 2. + <_> + + <_> + 1 15 18 2 -1. + <_> + 1 15 9 2 2. + <_> + + <_> + 0 5 2 16 -1. + <_> + 1 5 1 16 2. + <_> + + <_> + 15 12 4 10 -1. + <_> + 15 17 4 5 2. + <_> + + <_> + 1 5 16 3 -1. + <_> + 1 6 16 1 3. + <_> + + <_> + 6 9 9 12 -1. + <_> + 6 12 9 6 2. + <_> + + <_> + 3 13 4 8 -1. + <_> + 3 17 4 4 2. + <_> + + <_> + 9 13 8 8 -1. + <_> + 9 17 8 4 2. + <_> + + <_> + 5 0 8 10 -1. + <_> + 5 0 4 5 2. + <_> + 9 5 4 5 2. + <_> + + <_> + 1 4 18 6 -1. + <_> + 10 4 9 3 2. + <_> + 1 7 9 3 2. + <_> + + <_> + 3 16 9 6 -1. + <_> + 3 18 9 2 3. + <_> + + <_> + 3 17 14 4 -1. + <_> + 3 18 14 2 2. + <_> + + <_> + 2 3 9 6 -1. + <_> + 2 5 9 2 3. + <_> + + <_> + 0 3 19 3 -1. + <_> + 0 4 19 1 3. + <_> + + <_> + 1 3 16 4 -1. + <_> + 1 4 16 2 2. + <_> + + <_> + 11 0 6 14 -1. + <_> + 14 0 3 7 2. + <_> + 11 7 3 7 2. + <_> + + <_> + 0 17 9 6 -1. + <_> + 3 17 3 6 3. + <_> + + <_> + 7 16 8 7 -1. + <_> + 9 16 4 7 2. + <_> + + <_> + 3 14 10 5 -1. + <_> + 8 14 5 5 2. + <_> + + <_> + 12 9 3 14 -1. + <_> + 13 9 1 14 3. + <_> + + <_> + 4 9 3 14 -1. + <_> + 5 9 1 14 3. + <_> + + <_> + 10 9 6 14 -1. + <_> + 13 9 3 7 2. + <_> + 10 16 3 7 2. + <_> + + <_> + 6 0 6 5 -1. + <_> + 9 0 3 5 2. + <_> + + <_> + 7 0 6 8 -1. + <_> + 7 4 6 4 2. + <_> + + <_> + 2 0 11 21 -1. + <_> + 2 7 11 7 3. + <_> + + <_> + 8 8 4 12 -1. + <_> + 8 12 4 4 3. + <_> + + <_> + 3 9 6 14 -1. + <_> + 3 9 3 7 2. + <_> + 6 16 3 7 2. + <_> + + <_> + 10 7 8 7 -1. + <_> + 12 7 4 7 2. + <_> + + <_> + 1 7 8 7 -1. + <_> + 3 7 4 7 2. + <_> + + <_> + 5 2 9 20 -1. + <_> + 8 2 3 20 3. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_profileface.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_profileface.xml new file mode 100644 index 0000000000000000000000000000000000000000..486d8e3d83075578c446be96b75a2414efe75ecb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_profileface.xml @@ -0,0 +1,29690 @@ + + + +BOOST + HAAR + 20 + 20 + + 195 + + 0 + 26 + + <_> + 3 + -1.1856809854507446e+00 + + <_> + + 0 -1 0 1.1384399840608239e-03 + + -8.3771979808807373e-01 7.3413830995559692e-01 + <_> + + 0 -1 1 -1.1342350393533707e-02 + + 6.2702018022537231e-01 -7.2396302223205566e-01 + <_> + + 0 -1 2 -1.1023089755326509e-03 + + 3.7600189447402954e-01 -6.6088408231735229e-01 + <_> + 12 + -1.4913179874420166e+00 + + <_> + + 0 -1 3 -1.9553869962692261e-02 + + 4.9245831370353699e-01 -6.3396167755126953e-01 + <_> + + 0 -1 4 2.2794529795646667e-03 + + -6.4604967832565308e-01 3.5818460583686829e-01 + <_> + + 0 -1 5 2.4270440917462111e-03 + + -4.7253230214118958e-01 2.8494310379028320e-01 + <_> + + 0 -1 6 1.9644061103463173e-03 + + 1.6999539732933044e-01 -7.7868157625198364e-01 + <_> + + 0 -1 7 2.2895270958542824e-03 + + 1.5551710128784180e-01 -6.6725099086761475e-01 + <_> + + 0 -1 8 -3.0143910553306341e-03 + + -6.8721300363540649e-01 1.4604569971561432e-01 + <_> + + 0 -1 9 -1.7399009317159653e-02 + + 7.2524380683898926e-01 -1.6572900116443634e-01 + <_> + + 0 -1 10 9.0722442837432027e-04 + + -4.6388080716133118e-01 2.3604999482631683e-01 + <_> + + 0 -1 11 -1.5043979510664940e-03 + + -7.5959628820419312e-01 1.1436919867992401e-01 + <_> + + 0 -1 12 1.0804689675569534e-01 + + -1.2865519523620605e-01 7.9092341661453247e-01 + <_> + + 0 -1 13 -1.1923050042241812e-03 + + -6.2403547763824463e-01 1.4847490191459656e-01 + <_> + + 0 -1 14 -2.0571390166878700e-02 + + 4.0808489918708801e-01 -2.1287000179290771e-01 + <_> + 27 + -1.9596290588378906e+00 + + <_> + + 0 -1 15 -3.6899209022521973e-02 + + 5.3308618068695068e-01 -4.0872651338577271e-01 + <_> + + 0 -1 16 2.4960909504443407e-03 + + -6.9489312171936035e-01 2.7125179767608643e-01 + <_> + + 0 -1 17 2.4068039783742279e-04 + + -5.6208252906799316e-01 2.1930350363254547e-01 + <_> + + 0 -1 18 -5.8021828532218933e-02 + + 6.9060617685317993e-01 -1.5082140266895294e-01 + <_> + + 0 -1 19 1.1526979506015778e-03 + + 1.3925389945507050e-01 -6.6311657428741455e-01 + <_> + + 0 -1 20 7.4388440698385239e-03 + + -3.3333170413970947e-01 3.1699380278587341e-01 + <_> + + 0 -1 21 -1.4158539706841111e-03 + + -6.8007302284240723e-01 1.3243320584297180e-01 + <_> + + 0 -1 22 8.8562711607664824e-04 + + -3.8672161102294922e-01 1.9732959568500519e-01 + <_> + + 0 -1 23 2.5714060757309198e-03 + + 1.2035659700632095e-01 -7.3177069425582886e-01 + <_> + + 0 -1 24 1.8255549948662519e-03 + + 7.7979840338230133e-02 -7.7196091413497925e-01 + <_> + + 0 -1 25 -1.1993020307272673e-03 + + 1.6821229457855225e-01 -4.1479128599166870e-01 + <_> + + 0 -1 26 2.3179080337285995e-02 + + 7.5337320566177368e-02 -7.1047067642211914e-01 + <_> + + 0 -1 27 4.6539418399333954e-02 + + -1.0464839637279510e-01 6.6270697116851807e-01 + <_> + + 0 -1 28 -1.7157640540972352e-03 + + -4.9618211388587952e-01 1.6275240480899811e-01 + <_> + + 0 -1 29 -1.2778829783201218e-02 + + 4.6254539489746094e-01 -1.6027900576591492e-01 + <_> + + 0 -1 30 -1.5214820206165314e-01 + + -7.0592701435089111e-01 1.0022509843111038e-01 + <_> + + 0 -1 31 3.1789899803698063e-03 + + 1.2345749884843826e-01 -3.9093419909477234e-01 + <_> + + 0 -1 32 -2.2882770281285048e-03 + + 3.7081500887870789e-01 -1.6210420429706573e-01 + <_> + + 0 -1 33 -2.9806189704686403e-03 + + 1.8087059259414673e-01 -3.3239859342575073e-01 + <_> + + 0 -1 34 -1.5072739915922284e-03 + + -4.9472311139106750e-01 9.8288856446743011e-02 + <_> + + 0 -1 35 1.9225040450692177e-03 + + -1.7791110277175903e-01 3.0773329734802246e-01 + <_> + + 0 -1 36 1.9025449873879552e-03 + + 8.4794998168945312e-02 -5.9020972251892090e-01 + <_> + + 0 -1 37 -3.5421559587121010e-03 + + 3.1175771355628967e-01 -1.4392930269241333e-01 + <_> + + 0 -1 38 -2.9751660767942667e-03 + + -6.3649141788482666e-01 8.2639887928962708e-02 + <_> + + 0 -1 39 1.0003290139138699e-02 + + -1.1699260026216507e-01 4.2387530207633972e-01 + <_> + + 0 -1 40 -1.9193530315533280e-03 + + -4.7115838527679443e-01 1.1038240045309067e-01 + <_> + + 0 -1 41 2.5070620700716972e-02 + + 4.8775929957628250e-02 -8.0351328849792480e-01 + <_> + 28 + -1.9849590063095093e+00 + + <_> + + 0 -1 42 1.4214799739420414e-02 + + -6.3577878475189209e-01 3.3461728692054749e-01 + <_> + + 0 -1 43 -1.2525909580290318e-02 + + 3.2766130566596985e-01 -4.1331529617309570e-01 + <_> + + 0 -1 44 -2.2514370357384905e-05 + + 2.3102630674839020e-01 -5.4282051324844360e-01 + <_> + + 0 -1 45 1.8600060138851404e-03 + + 1.7933349311351776e-01 -6.9131940603256226e-01 + <_> + + 0 -1 46 7.8344792127609253e-03 + + 9.1071300208568573e-02 -7.8126847743988037e-01 + <_> + + 0 -1 47 -4.2322301305830479e-03 + + 2.0658409595489502e-01 -4.2906031012535095e-01 + <_> + + 0 -1 48 -7.5860600918531418e-04 + + 2.0730710029602051e-01 -4.2070311307907104e-01 + <_> + + 0 -1 49 -3.5626380704343319e-03 + + -6.3227087259292603e-01 1.3118620216846466e-01 + <_> + + 0 -1 50 -4.9960161559283733e-03 + + -7.5112378597259521e-01 7.8203327953815460e-02 + <_> + + 0 -1 51 7.3098740540444851e-03 + + 9.3428641557693481e-02 -6.6310107707977295e-01 + <_> + + 0 -1 52 2.2772040392737836e-04 + + -3.4148821234703064e-01 2.0008200407028198e-01 + <_> + + 0 -1 53 8.3124160300940275e-04 + + -2.5448161363601685e-01 2.5857710838317871e-01 + <_> + + 0 -1 54 -7.5492179021239281e-03 + + -6.6138988733291626e-01 8.3004422485828400e-02 + <_> + + 0 -1 55 -3.8039948791265488e-02 + + -8.2163572311401367e-01 5.9231590479612350e-02 + <_> + + 0 -1 56 2.8484580107033253e-03 + + 8.9729957282543182e-02 -5.8333742618560791e-01 + <_> + + 0 -1 57 4.8181698657572269e-03 + + 9.3960560858249664e-02 -5.7619768381118774e-01 + <_> + + 0 -1 58 -1.1190489865839481e-02 + + -6.2544298171997070e-01 7.3608897626399994e-02 + <_> + + 0 -1 59 -6.4537129364907742e-03 + + 5.5123388767242432e-01 -1.0020790249109268e-01 + <_> + + 0 -1 60 3.3225629013031721e-03 + + -1.0797890275716782e-01 5.3664940595626831e-01 + <_> + + 0 -1 61 4.6705761924386024e-03 + + 8.8321126997470856e-02 -6.7683601379394531e-01 + <_> + + 0 -1 62 -1.1613310314714909e-02 + + -5.0711882114410400e-01 7.6556630432605743e-02 + <_> + + 0 -1 63 -3.7515610456466675e-02 + + -7.2936272621154785e-01 5.9448610991239548e-02 + <_> + + 0 -1 64 2.3086030036211014e-02 + + 5.0718959420919418e-02 -7.8459781408309937e-01 + <_> + + 0 -1 65 -7.1651988946541678e-06 + + 1.6686220467090607e-01 -2.5713220238685608e-01 + <_> + + 0 -1 66 7.1611627936363220e-04 + + 1.0636030137538910e-01 -4.2793640494346619e-01 + <_> + + 0 -1 67 4.1476460173726082e-03 + + -1.2069659680128098e-01 4.1993188858032227e-01 + <_> + + 0 -1 68 -2.5815099943429232e-03 + + 4.8718088865280151e-01 -1.0045810043811798e-01 + <_> + + 0 -1 69 -1.7147070029750466e-03 + + -4.6096310019493103e-01 1.0375110059976578e-01 + <_> + 28 + -1.8260079622268677e+00 + + <_> + + 0 -1 70 -6.1202719807624817e-02 + + 3.9079108834266663e-01 -3.9401251077651978e-01 + <_> + + 0 -1 71 -1.4643670292571187e-03 + + -7.3697841167449951e-01 1.5660220384597778e-01 + <_> + + 0 -1 72 7.2080420795828104e-04 + + 2.1675530076026917e-01 -5.8012658357620239e-01 + <_> + + 0 -1 73 6.4895692048594356e-04 + + -7.2308099269866943e-01 1.2785249948501587e-01 + <_> + + 0 -1 74 -1.7158190021291375e-03 + + -7.7100431919097900e-01 1.0210309922695160e-01 + <_> + + 0 -1 75 -2.2490581031888723e-03 + + -6.0623127222061157e-01 1.2427269667387009e-01 + <_> + + 0 -1 76 5.3841978311538696e-02 + + -1.7169749736785889e-01 5.3350567817687988e-01 + <_> + + 0 -1 77 -1.3288970291614532e-01 + + 5.5924367904663086e-01 -1.8954899907112122e-01 + <_> + + 0 -1 78 9.0965389972552657e-04 + + -4.7166430950164795e-01 1.6924260556697845e-01 + <_> + + 0 -1 79 6.0799147468060255e-04 + + 1.1347220093011856e-01 -5.9846878051757812e-01 + <_> + + 0 -1 80 1.6072629392147064e-01 + + -1.0295519977807999e-01 6.6487199068069458e-01 + <_> + + 0 -1 81 -1.7097239615395665e-03 + + -4.7276279330253601e-01 1.3392050564289093e-01 + <_> + + 0 -1 82 1.1734620202332735e-03 + + -2.2795589268207550e-01 2.6135650277137756e-01 + <_> + + 0 -1 83 -1.5138329472392797e-03 + + -5.5395001173019409e-01 1.1028339713811874e-01 + <_> + + 0 -1 84 -2.1774161141365767e-03 + + -6.2228900194168091e-01 7.8486673533916473e-02 + <_> + + 0 -1 85 -2.7727920096367598e-03 + + 4.6141120791435242e-01 -1.3496559858322144e-01 + <_> + + 0 -1 86 9.3199027469381690e-04 + + 1.0162770003080368e-01 -5.1631838083267212e-01 + <_> + + 0 -1 87 2.9746659565716982e-03 + + -1.2999209761619568e-01 4.2117300629615784e-01 + <_> + + 0 -1 88 -5.0399480387568474e-03 + + -6.3706171512603760e-01 7.7624127268791199e-02 + <_> + + 0 -1 89 2.3414850234985352e-02 + + 7.2182796895503998e-02 -5.9831130504608154e-01 + <_> + + 0 -1 90 -1.0927390540018678e-03 + + -4.1664880514144897e-01 1.1829990148544312e-01 + <_> + + 0 -1 91 -1.6441360348835588e-03 + + 1.8583069741725922e-01 -2.7551019191741943e-01 + <_> + + 0 -1 92 -2.5736279785633087e-02 + + -7.5146478414535522e-01 6.3907749950885773e-02 + <_> + + 0 -1 93 -2.8924590442329645e-03 + + -5.6780880689620972e-01 7.3297739028930664e-02 + <_> + + 0 -1 94 -5.2889231592416763e-03 + + -6.3738888502120972e-01 6.8686947226524353e-02 + <_> + + 0 -1 95 3.2964269630610943e-03 + + -2.5062951445579529e-01 1.5989780426025391e-01 + <_> + + 0 -1 96 2.4914439767599106e-02 + + 5.5260978639125824e-02 -7.6208770275115967e-01 + <_> + + 0 -1 97 -1.5088500455021858e-02 + + 3.7033379077911377e-01 -1.2003959715366364e-01 + <_> + 53 + -1.9446740150451660e+00 + + <_> + + 0 -1 98 -1.1857179924845695e-02 + + 2.9421558976173401e-01 -5.1703310012817383e-01 + <_> + + 0 -1 99 2.0991980563849211e-03 + + -6.1471748352050781e-01 2.0648500323295593e-01 + <_> + + 0 -1 100 -1.5772449842188507e-04 + + 2.2870740294456482e-01 -5.5258047580718994e-01 + <_> + + 0 -1 101 -2.0669099467340857e-04 + + 1.2070009857416153e-01 -5.4926127195358276e-01 + <_> + + 0 -1 102 2.2675560321658850e-03 + + 1.5354810655117035e-01 -4.6074301004409790e-01 + <_> + + 0 -1 103 1.4469499699771404e-02 + + -1.8976309895515442e-01 4.2071411013603210e-01 + <_> + + 0 -1 104 -1.2127560330554843e-03 + + -4.5139861106872559e-01 9.9425867199897766e-02 + <_> + + 0 -1 105 2.1505509503185749e-03 + + 1.0200879722833633e-01 -6.2064242362976074e-01 + <_> + + 0 -1 106 -1.6638869419693947e-03 + + -7.0367491245269775e-01 7.7214680612087250e-02 + <_> + + 0 -1 107 1.0530210565775633e-03 + + -3.2453960180282593e-01 1.7616109549999237e-01 + <_> + + 0 -1 108 1.1836409568786621e-02 + + -1.3507820665836334e-01 4.2641130089759827e-01 + <_> + + 0 -1 109 9.6512871095910668e-04 + + 9.4502769410610199e-02 -4.8544931411743164e-01 + <_> + + 0 -1 110 7.5651629595085979e-04 + + -2.9959529638290405e-01 1.6867619752883911e-01 + <_> + + 0 -1 111 1.0839150287210941e-02 + + -1.1121030151844025e-01 4.6914410591125488e-01 + <_> + + 0 -1 112 -5.1439419388771057e-02 + + 4.1726920008659363e-01 -1.1776400357484818e-01 + <_> + + 0 -1 113 3.4927250817418098e-03 + + 9.2512279748916626e-02 -5.2599352598190308e-01 + <_> + + 0 -1 114 -1.3926399871706963e-02 + + -6.6633498668670654e-01 5.2386458963155746e-02 + <_> + + 0 -1 115 4.5590959489345551e-03 + + -9.3383841216564178e-02 4.3774750828742981e-01 + <_> + + 0 -1 116 -3.7318699061870575e-02 + + -5.9583687782287598e-01 7.2627849876880646e-02 + <_> + + 0 -1 117 1.2496879789978266e-03 + + 6.9537237286567688e-02 -4.8772460222244263e-01 + <_> + + 0 -1 118 -3.7307639140635729e-03 + + 3.2699251174926758e-01 -1.1739090085029602e-01 + <_> + + 0 -1 119 2.1144179627299309e-03 + + 9.2889092862606049e-02 -4.1788020730018616e-01 + <_> + + 0 -1 120 -6.4239342464134097e-04 + + -2.9332190752029419e-01 1.3107809424400330e-01 + <_> + + 0 -1 121 -3.1379980500787497e-03 + + 3.2445520162582397e-01 -1.1506850272417068e-01 + <_> + + 0 -1 122 -3.9186969399452209e-02 + + -7.9360449314117432e-01 5.0053481012582779e-02 + <_> + + 0 -1 123 4.4646807946264744e-03 + + 5.4776020348072052e-02 -5.6535738706588745e-01 + <_> + + 0 -1 124 8.6451368406414986e-04 + + -1.7471200227737427e-01 1.9758160412311554e-01 + <_> + + 0 -1 125 2.4237011093646288e-03 + + -9.5296189188957214e-02 4.0760260820388794e-01 + <_> + + 0 -1 126 -2.5377490092068911e-03 + + -6.2454742193222046e-01 6.9920547306537628e-02 + <_> + + 0 -1 127 -7.3309220169903710e-06 + + 1.2249249964952469e-01 -2.8157269954681396e-01 + <_> + + 0 -1 128 -1.8882560543715954e-03 + + -6.2670397758483887e-01 6.5820932388305664e-02 + <_> + + 0 -1 129 6.0609861975535750e-04 + + -2.5481408834457397e-01 1.2902240455150604e-01 + <_> + + 0 -1 130 2.3213759995996952e-03 + + -9.7430117428302765e-02 3.2456091046333313e-01 + <_> + + 0 -1 131 -1.8534410046413541e-03 + + -4.4065341353416443e-01 8.2968853414058685e-02 + <_> + + 0 -1 132 2.3999500554054976e-03 + + -1.2041269987821579e-01 2.8288060426712036e-01 + <_> + + 0 -1 133 -8.1356197595596313e-02 + + -7.3972231149673462e-01 4.6568300575017929e-02 + <_> + + 0 -1 134 -2.9865680262446404e-03 + + 1.6334620118141174e-01 -1.9834910333156586e-01 + <_> + + 0 -1 135 2.8128880076110363e-03 + + 1.1837379634380341e-01 -2.9398199915885925e-01 + <_> + + 0 -1 136 -1.0060790181159973e-01 + + -7.3717647790908813e-01 4.2510021477937698e-02 + <_> + + 0 -1 137 1.1854549666168168e-04 + + 1.0471060127019882e-01 -2.9139861464500427e-01 + <_> + + 0 -1 138 2.2375308908522129e-03 + + -9.6042059361934662e-02 3.4045928716659546e-01 + <_> + + 0 -1 139 -4.4986992143094540e-03 + + -5.8234661817550659e-01 5.6236840784549713e-02 + <_> + + 0 -1 140 -3.6484538577497005e-04 + + -2.7956131100654602e-01 1.0113990306854248e-01 + <_> + + 0 -1 141 -7.9940296709537506e-03 + + 2.7775949239730835e-01 -1.1941230297088623e-01 + <_> + + 0 -1 142 -5.1547219045460224e-03 + + -6.0229510068893433e-01 4.8917140811681747e-02 + <_> + + 0 -1 143 -8.1772619159892201e-04 + + 1.7660500109195709e-01 -1.6407689452171326e-01 + <_> + + 0 -1 144 6.7434698343276978e-02 + + 4.0761459618806839e-02 -7.1865761280059814e-01 + <_> + + 0 -1 145 -2.4103289470076561e-03 + + 1.7671680450439453e-01 -1.6081850230693817e-01 + <_> + + 0 -1 146 -3.5183799918740988e-03 + + -4.3078601360321045e-01 7.0671632885932922e-02 + <_> + + 0 -1 147 -1.4561560419679154e-05 + + 1.2714700400829315e-01 -2.3387859761714935e-01 + <_> + + 0 -1 148 -4.7951821237802505e-02 + + -7.9085767269134521e-01 3.6803081631660461e-02 + <_> + + 0 -1 149 2.1735159680247307e-03 + + -1.3089279830455780e-01 2.5330349802970886e-01 + <_> + + 0 -1 150 -3.4542270004749298e-03 + + 5.1025247573852539e-01 -7.5337253510951996e-02 + <_> + 54 + -1.8389279842376709e+00 + + <_> + + 0 -1 151 4.5243161730468273e-03 + + -3.0485519766807556e-01 5.1908642053604126e-01 + <_> + + 0 -1 152 2.3372350260615349e-03 + + -4.2904540896415710e-01 2.9052159190177917e-01 + <_> + + 0 -1 153 -4.4243237935006618e-03 + + 2.1068570017814636e-01 -4.5954981446266174e-01 + <_> + + 0 -1 154 -1.2887439690530300e-02 + + 1.9138230383396149e-01 -4.5879068970680237e-01 + <_> + + 0 -1 155 -5.2370920457178727e-05 + + 1.4141489565372467e-01 -5.0267368555068970e-01 + <_> + + 0 -1 156 -4.7738491557538509e-03 + + -4.8760831356048584e-01 1.2341009825468063e-01 + <_> + + 0 -1 157 9.6315861446782947e-04 + + 1.3367399573326111e-01 -4.4793748855590820e-01 + <_> + + 0 -1 158 -8.9140303432941437e-02 + + 5.0387668609619141e-01 -1.5923009812831879e-01 + <_> + + 0 -1 159 1.7201449954882264e-03 + + -2.0535360276699066e-01 2.4340680241584778e-01 + <_> + + 0 -1 160 -2.6712119579315186e-03 + + -6.3319712877273560e-01 5.3035650402307510e-02 + <_> + + 0 -1 161 3.7353280931711197e-02 + + -1.1360249668359756e-01 4.6645331382751465e-01 + <_> + + 0 -1 162 -3.1510960310697556e-02 + + -6.8820482492446899e-01 6.9371856749057770e-02 + <_> + + 0 -1 163 1.5293819829821587e-02 + + -1.0043840110301971e-01 4.6267789602279663e-01 + <_> + + 0 -1 164 5.4966909810900688e-03 + + -9.3514643609523773e-02 4.5127061009407043e-01 + <_> + + 0 -1 165 -4.6311439946293831e-03 + + -6.4314597845077515e-01 8.5003547370433807e-02 + <_> + + 0 -1 166 8.0943357897922397e-04 + + 7.9738967120647430e-02 -4.9320799112319946e-01 + <_> + + 0 -1 167 2.9745940119028091e-02 + + 7.8420467674732208e-02 -5.0482439994812012e-01 + <_> + + 0 -1 168 9.7070122137665749e-04 + + 5.8135438710451126e-02 -5.7035177946090698e-01 + <_> + + 0 -1 169 2.4534659460186958e-03 + + -1.1259060353040695e-01 3.6852970719337463e-01 + <_> + + 0 -1 170 1.9709810148924589e-03 + + 7.7185310423374176e-02 -5.2683860063552856e-01 + <_> + + 0 -1 171 4.8643019981682301e-03 + + -1.0479539632797241e-01 4.1474440693855286e-01 + <_> + + 0 -1 172 1.0143260005861521e-03 + + -1.4731560647487640e-01 2.8671079874038696e-01 + <_> + + 0 -1 173 -9.5099088503047824e-04 + + -3.8070049881935120e-01 8.8108353316783905e-02 + <_> + + 0 -1 174 -5.6730289943516254e-03 + + 2.4818900227546692e-01 -1.3696339726448059e-01 + <_> + + 0 -1 175 1.6987899318337440e-02 + + -8.0896042287349701e-02 5.2781671285629272e-01 + <_> + + 0 -1 176 -7.5278789736330509e-03 + + -4.6880009770393372e-01 8.9389666914939880e-02 + <_> + + 0 -1 177 3.3948529511690140e-02 + + 5.0594791769981384e-02 -6.7399561405181885e-01 + <_> + + 0 -1 178 8.3328841719776392e-04 + + -1.8931360542774200e-01 1.9607099890708923e-01 + <_> + + 0 -1 179 -5.9632491320371628e-04 + + -3.6229288578033447e-01 1.0544770210981369e-01 + <_> + + 0 -1 180 3.0905720777809620e-03 + + 5.7209629565477371e-02 -5.5316972732543945e-01 + <_> + + 0 -1 181 3.5152619238942862e-03 + + -1.2211070209741592e-01 2.9369899630546570e-01 + <_> + + 0 -1 182 7.9333729809150100e-04 + + 7.5977906584739685e-02 -4.4539821147918701e-01 + <_> + + 0 -1 183 -1.1189360171556473e-02 + + -5.0596517324447632e-01 5.7438369840383530e-02 + <_> + + 0 -1 184 -1.1787790572270751e-03 + + 3.0799698829650879e-01 -1.0762230306863785e-01 + <_> + + 0 -1 185 5.4418851505033672e-05 + + -2.5997561216354370e-01 1.3138440251350403e-01 + <_> + + 0 -1 186 -7.2562302193546202e-06 + + 1.5439839661121368e-01 -2.1094700694084167e-01 + <_> + + 0 -1 187 -8.3436258137226105e-04 + + 1.3689869642257690e-01 -2.4367660284042358e-01 + <_> + + 0 -1 188 -3.3380609005689621e-02 + + -6.7477357387542725e-01 5.0986740738153458e-02 + <_> + + 0 -1 189 7.4093497823923826e-04 + + 9.1248527169227600e-02 -3.5220760107040405e-01 + <_> + + 0 -1 190 -2.0966369193047285e-03 + + 1.9110049307346344e-01 -1.6380029916763306e-01 + <_> + + 0 -1 191 -6.9339506328105927e-02 + + -8.7700867652893066e-01 3.5726629197597504e-02 + <_> + + 0 -1 192 -5.7089990004897118e-03 + + -6.8067228794097900e-01 3.5545960068702698e-02 + <_> + + 0 -1 193 6.8668760359287262e-03 + + -6.4886868000030518e-02 5.2265900373458862e-01 + <_> + + 0 -1 194 5.4602831369265914e-04 + + 1.0924419760704041e-01 -3.0285251140594482e-01 + <_> + + 0 -1 195 6.4349039457738400e-03 + + -1.6561950743198395e-01 1.9022129476070404e-01 + <_> + + 0 -1 196 -1.0112419724464417e-02 + + 7.4523001909255981e-01 -3.8347329944372177e-02 + <_> + + 0 -1 197 -7.5152877252548933e-04 + + -2.8147280216217041e-01 1.1321689933538437e-01 + <_> + + 0 -1 198 2.8225290589034557e-03 + + -1.2364400178194046e-01 2.5608530640602112e-01 + <_> + + 0 -1 199 2.2058798931539059e-03 + + 5.7334281504154205e-02 -5.6152081489562988e-01 + <_> + + 0 -1 200 2.8164181113243103e-01 + + 4.2092379182577133e-02 -6.4923799037933350e-01 + <_> + + 0 -1 201 -4.2593148536980152e-03 + + -6.4854997396469116e-01 4.3502658605575562e-02 + <_> + + 0 -1 202 2.6586679741740227e-03 + + -9.3526139855384827e-02 3.4158730506896973e-01 + <_> + + 0 -1 203 2.0971989724785089e-03 + + -1.1068929731845856e-01 3.1760269403457642e-01 + <_> + + 0 -1 204 -1.0267860488966107e-03 + + -3.7612101435661316e-01 9.8973110318183899e-02 + <_> + 56 + -1.8807189464569092e+00 + + <_> + + 0 -1 205 2.6354179717600346e-03 + + -5.2496808767318726e-01 2.7711030840873718e-01 + <_> + + 0 -1 206 2.6279650628566742e-03 + + -3.2195448875427246e-01 3.7013629078865051e-01 + <_> + + 0 -1 207 -5.8889109641313553e-03 + + 2.3777529597282410e-01 -4.1800329089164734e-01 + <_> + + 0 -1 208 1.9291159696877003e-03 + + -4.7122061252593994e-01 1.3692170381546021e-01 + <_> + + 0 -1 209 -1.5205480158329010e-02 + + -3.9618429541587830e-01 1.7402400076389313e-01 + <_> + + 0 -1 210 2.3393579758703709e-03 + + -3.8508901000022888e-01 1.5659110248088837e-01 + <_> + + 0 -1 211 4.2395621538162231e-02 + + 1.0478709638118744e-01 -6.2164002656936646e-01 + <_> + + 0 -1 212 -5.6959640234708786e-02 + + 5.1225858926773071e-01 -1.2684780359268188e-01 + <_> + + 0 -1 213 -7.2845568865886889e-06 + + 1.5136890113353729e-01 -3.1185621023178101e-01 + <_> + + 0 -1 214 -7.9633750021457672e-02 + + -8.4324747323989868e-01 4.4978428632020950e-02 + <_> + + 0 -1 215 5.9168688021600246e-03 + + -1.0745979845523834e-01 4.7434100508689880e-01 + <_> + + 0 -1 216 -1.4736950397491455e-03 + + 3.6067450046539307e-01 -1.4760640263557434e-01 + <_> + + 0 -1 217 -3.9630971848964691e-02 + + -6.5838980674743652e-01 7.4866786599159241e-02 + <_> + + 0 -1 218 6.2401412287726998e-04 + + -2.6195651292800903e-01 1.5652139484882355e-01 + <_> + + 0 -1 219 -2.3399210476782173e-05 + + 1.2157510221004486e-01 -3.0320811271667480e-01 + <_> + + 0 -1 220 3.0802030116319656e-02 + + 4.4408731162548065e-02 -6.6609877347946167e-01 + <_> + + 0 -1 221 1.4787449617870152e-04 + + -2.4449509382247925e-01 1.4723050594329834e-01 + <_> + + 0 -1 222 4.8630568198859692e-03 + + -1.1267810314893723e-01 3.2596799731254578e-01 + <_> + + 0 -1 223 6.2191881239414215e-02 + + 5.7439960539340973e-02 -6.4031070470809937e-01 + <_> + + 0 -1 224 1.4668420189991593e-03 + + 9.5356643199920654e-02 -3.3727881312370300e-01 + <_> + + 0 -1 225 -1.4742349776497576e-05 + + 1.9759610295295715e-01 -1.7083899676799774e-01 + <_> + + 0 -1 226 -3.2495670020580292e-02 + + -3.6848729848861694e-01 9.0363331139087677e-02 + <_> + + 0 -1 227 -1.5333830378949642e-03 + + 3.2256379723548889e-01 -1.0416819900274277e-01 + <_> + + 0 -1 228 -2.7998909354209900e-02 + + -4.9097910523414612e-01 8.2653783261775970e-02 + <_> + + 0 -1 229 4.9783890135586262e-03 + + 7.3238030076026917e-02 -4.4057780504226685e-01 + <_> + + 0 -1 230 6.8226028233766556e-03 + + 7.6766029000282288e-02 -4.1460910439491272e-01 + <_> + + 0 -1 231 1.1497880332171917e-02 + + -9.1440111398696899e-02 4.0099748969078064e-01 + <_> + + 0 -1 232 -1.1003069579601288e-02 + + -5.7417541742324829e-01 7.2776727378368378e-02 + <_> + + 0 -1 233 4.9345887964591384e-04 + + -1.3353590667247772e-01 2.4575209617614746e-01 + <_> + + 0 -1 234 2.2130589932203293e-03 + + -1.0753840208053589e-01 3.1632119417190552e-01 + <_> + + 0 -1 235 5.1011620089411736e-03 + + 7.8985318541526794e-02 -4.2948201298713684e-01 + <_> + + 0 -1 236 -3.7305638194084167e-02 + + -6.7921191453933716e-01 4.5049939304590225e-02 + <_> + + 0 -1 237 -6.1271698214113712e-03 + + 2.3062059283256531e-01 -1.4559289813041687e-01 + <_> + + 0 -1 238 7.6517700217664242e-03 + + -9.0355172753334045e-02 4.3072968721389771e-01 + <_> + + 0 -1 239 -1.1280870065093040e-02 + + -4.7850719094276428e-01 7.4674449861049652e-02 + <_> + + 0 -1 240 -1.4724049833603203e-05 + + 1.4459890127182007e-01 -2.2535640001296997e-01 + <_> + + 0 -1 241 -1.9895960576832294e-03 + + -6.1527568101882935e-01 5.4905921220779419e-02 + <_> + + 0 -1 242 1.6876959707587957e-03 + + -9.7619786858558655e-02 3.3004701137542725e-01 + <_> + + 0 -1 243 9.8390737548470497e-03 + + 4.0972411632537842e-02 -7.5515109300613403e-01 + <_> + + 0 -1 244 1.3243829598650336e-03 + + -1.0046280175447464e-01 3.0665108561515808e-01 + <_> + + 0 -1 245 3.1150300055742264e-03 + + 8.9804470539093018e-02 -3.3524599671363831e-01 + <_> + + 0 -1 246 7.3907422120100819e-06 + + -2.2410400211811066e-01 1.3288240134716034e-01 + <_> + + 0 -1 247 3.2559569925069809e-02 + + 5.0113398581743240e-02 -5.4240328073501587e-01 + <_> + + 0 -1 248 -2.9865119140595198e-03 + + 2.8385341167449951e-01 -1.1164219677448273e-01 + <_> + + 0 -1 249 1.6058710170909762e-03 + + -1.2024080008268356e-01 2.9032671451568604e-01 + <_> + + 0 -1 250 2.2018649615347385e-03 + + 7.8110128641128540e-02 -4.3846049904823303e-01 + <_> + + 0 -1 251 -5.7107508182525635e-03 + + -3.2608801126480103e-01 9.2941299080848694e-02 + <_> + + 0 -1 252 8.9503038907423615e-04 + + -1.3504159450531006e-01 2.2331899404525757e-01 + <_> + + 0 -1 253 7.7259249985218048e-02 + + 7.3221340775489807e-02 -4.1714018583297729e-01 + <_> + + 0 -1 254 -1.0145610198378563e-02 + + -2.7330970764160156e-01 1.4099189639091492e-01 + <_> + + 0 -1 255 -7.0878718361200299e-06 + + 1.2602959573268890e-01 -2.3253719508647919e-01 + <_> + + 0 -1 256 -8.0232005566358566e-03 + + -6.2682849168777466e-01 4.4199578464031219e-02 + <_> + + 0 -1 257 -1.5409339684993029e-03 + + 3.2154878973960876e-01 -9.5819726586341858e-02 + <_> + + 0 -1 258 -1.3815560378134251e-03 + + 2.3909060657024384e-01 -1.0845059901475906e-01 + <_> + + 0 -1 259 -8.5559524595737457e-03 + + -6.2880992889404297e-01 4.6904459595680237e-02 + <_> + + 0 -1 260 1.4967939932830632e-05 + + -1.7331050336360931e-01 1.6265609860420227e-01 + <_> + 68 + -1.7268099784851074e+00 + + <_> + + 0 -1 261 -9.2911375686526299e-03 + + 2.6676508784294128e-01 -4.8681628704071045e-01 + <_> + + 0 -1 262 -1.0201609693467617e-03 + + 2.1469169855117798e-01 -4.2971470952033997e-01 + <_> + + 0 -1 263 1.8099240260198712e-03 + + -4.7085261344909668e-01 1.7293150722980499e-01 + <_> + + 0 -1 264 -6.3195452094078064e-02 + + 5.5868512392044067e-01 -1.1922080069780350e-01 + <_> + + 0 -1 265 1.5157799934968352e-03 + + -3.3087429404258728e-01 1.4256539940834045e-01 + <_> + + 0 -1 266 -3.1134260352700949e-03 + + 3.1897360086441040e-01 -1.5563400089740753e-01 + <_> + + 0 -1 267 6.7187240347266197e-03 + + 1.1308009922504425e-01 -4.6142110228538513e-01 + <_> + + 0 -1 268 -1.4929190001566894e-05 + + 1.1303120106458664e-01 -3.8268089294433594e-01 + <_> + + 0 -1 269 -1.9974811002612114e-03 + + -6.7833811044692993e-01 5.5562671273946762e-02 + <_> + + 0 -1 270 4.4361899199429899e-05 + + -2.1478720009326935e-01 1.7524589598178864e-01 + <_> + + 0 -1 271 -9.4379335641860962e-03 + + -2.9008820652961731e-01 1.0494410246610641e-01 + <_> + + 0 -1 272 1.0263459989801049e-04 + + -3.6809450387954712e-01 1.1580110341310501e-01 + <_> + + 0 -1 273 -4.3512079864740372e-02 + + -5.7967478036880493e-01 4.5160628855228424e-02 + <_> + + 0 -1 274 2.3894330952316523e-03 + + -1.2443830072879791e-01 2.5726899504661560e-01 + <_> + + 0 -1 275 3.6203579511493444e-03 + + 4.8385269939899445e-02 -6.4456540346145630e-01 + <_> + + 0 -1 276 -4.2086638859473169e-04 + + -2.9963639378547668e-01 9.7508132457733154e-02 + <_> + + 0 -1 277 -3.6320161074399948e-02 + + 3.2499030232429504e-01 -1.0373180359601974e-01 + <_> + + 0 -1 278 5.5678240023553371e-03 + + -1.2865519523620605e-01 2.7721390128135681e-01 + <_> + + 0 -1 279 1.4324679505079985e-03 + + 6.3044667243957520e-02 -5.0411659479141235e-01 + <_> + + 0 -1 280 1.2268769787624478e-03 + + -1.7073589563369751e-01 1.7944329977035522e-01 + <_> + + 0 -1 281 4.0125530213117599e-03 + + 7.2100132703781128e-02 -4.1321611404418945e-01 + <_> + + 0 -1 282 4.7377590090036392e-03 + + -9.0100876986980438e-02 3.4303799271583557e-01 + <_> + + 0 -1 283 4.3965759687125683e-03 + + 5.4753091186285019e-02 -5.9175938367843628e-01 + <_> + + 0 -1 284 1.8952810205519199e-03 + + 4.0120709687471390e-02 -6.4907258749008179e-01 + <_> + + 0 -1 285 -1.3425230281427503e-03 + + 3.0321699380874634e-01 -1.1009240150451660e-01 + <_> + + 0 -1 286 -4.6405740082263947e-02 + + -4.6026471257209778e-01 7.0307031273841858e-02 + <_> + + 0 -1 287 2.5875549763441086e-02 + + 3.8987319916486740e-02 -6.4847522974014282e-01 + <_> + + 0 -1 288 1.0986380511894822e-03 + + -1.6458760201931000e-01 1.8133540451526642e-01 + <_> + + 0 -1 289 -3.9583959733135998e-04 + + 9.7805656492710114e-02 -2.7554351091384888e-01 + <_> + + 0 -1 290 -4.5633990317583084e-02 + + -5.4276019334793091e-01 5.4855771362781525e-02 + <_> + + 0 -1 291 -4.7068470157682896e-03 + + 4.0961420536041260e-01 -6.9687090814113617e-02 + <_> + + 0 -1 292 2.0004810357932001e-04 + + 1.2908969819545746e-01 -2.1091359853744507e-01 + <_> + + 0 -1 293 1.1126570170745254e-03 + + -2.2213070094585419e-01 1.2458589673042297e-01 + <_> + + 0 -1 294 -1.4747029636055231e-03 + + 2.9185178875923157e-01 -9.0756237506866455e-02 + <_> + + 0 -1 295 4.3162931688129902e-03 + + 6.1542909592390060e-02 -5.1068651676177979e-01 + <_> + + 0 -1 296 2.0302709890529513e-04 + + -1.5639910101890564e-01 1.6466440260410309e-01 + <_> + + 0 -1 297 3.4639390651136637e-04 + + 1.0773540288209915e-01 -2.5532799959182739e-01 + <_> + + 0 -1 298 1.5631220303475857e-03 + + -9.5428019762039185e-02 2.5450360774993896e-01 + <_> + + 0 -1 299 5.5476918350905180e-04 + + 7.9774253070354462e-02 -3.0791428685188293e-01 + <_> + + 0 -1 300 2.7690480928868055e-03 + + -9.1900892555713654e-02 3.0198639631271362e-01 + <_> + + 0 -1 301 1.1085179867222905e-03 + + 6.2624886631965637e-02 -4.1680490970611572e-01 + <_> + + 0 -1 302 3.4288389142602682e-03 + + -5.7473558932542801e-02 4.7293519973754883e-01 + <_> + + 0 -1 303 -2.0233790855854750e-03 + + -2.4128660559654236e-01 1.0806660354137421e-01 + <_> + + 0 -1 304 -9.1446418082341552e-04 + + 1.7990960180759430e-01 -1.6031919419765472e-01 + <_> + + 0 -1 305 3.8880690932273865e-02 + + 3.9132621139287949e-02 -6.4085322618484497e-01 + <_> + + 0 -1 306 1.2836069799959660e-03 + + 5.2912048995494843e-02 -4.3914559483528137e-01 + <_> + + 0 -1 307 3.5828219261020422e-03 + + -9.7462162375450134e-02 3.0772930383682251e-01 + <_> + + 0 -1 308 2.3203529417514801e-03 + + -1.0929799824953079e-01 2.6735728979110718e-01 + <_> + + 0 -1 309 1.1978139809798449e-04 + + 1.1623129993677139e-01 -2.3586340248584747e-01 + <_> + + 0 -1 310 -2.8259279206395149e-03 + + -4.1935729980468750e-01 5.7008400559425354e-02 + <_> + + 0 -1 311 2.4410230107605457e-03 + + 4.2706880718469620e-02 -5.3362858295440674e-01 + <_> + + 0 -1 312 2.6899650692939758e-03 + + -1.1351829767227173e-01 2.4779020249843597e-01 + <_> + + 0 -1 313 -3.1081750057637691e-03 + + -2.9488921165466309e-01 8.2543209195137024e-02 + <_> + + 0 -1 314 -6.6210748627781868e-03 + + 2.2958689928054810e-01 -1.1443620175123215e-01 + <_> + + 0 -1 315 4.6786409802734852e-03 + + -1.2875209748744965e-01 2.6777699589729309e-01 + <_> + + 0 -1 316 -1.2973829871043563e-03 + + -2.7280429005622864e-01 9.6471726894378662e-02 + <_> + + 0 -1 317 2.9523740522563457e-03 + + -8.7040692567825317e-02 2.9207450151443481e-01 + <_> + + 0 -1 318 -1.6173559706658125e-03 + + -4.0207850933074951e-01 6.5386466681957245e-02 + <_> + + 0 -1 319 -7.5417757034301758e-02 + + -8.9723330736160278e-01 2.4602690711617470e-02 + <_> + + 0 -1 320 -2.5402200408279896e-03 + + 1.5258650481700897e-01 -1.5025460720062256e-01 + <_> + + 0 -1 321 3.7864660844206810e-03 + + 7.6477207243442535e-02 -3.3881941437721252e-01 + <_> + + 0 -1 322 -1.4005510136485100e-02 + + 4.4426390528678894e-01 -5.9003930538892746e-02 + <_> + + 0 -1 323 5.5956508731469512e-04 + + 7.4007123708724976e-02 -3.5604709386825562e-01 + <_> + + 0 -1 324 2.5946850655600429e-04 + + -2.8126189112663269e-01 8.7399207055568695e-02 + <_> + + 0 -1 325 4.4409232214093208e-03 + + 2.8623659163713455e-02 -7.7284187078475952e-01 + <_> + + 0 -1 326 -2.3343560751527548e-03 + + 3.5460600256919861e-01 -7.1207538247108459e-02 + <_> + + 0 -1 327 9.7654951969161630e-04 + + -1.0138420015573502e-01 2.2545370459556580e-01 + <_> + + 0 -1 328 -4.3227209243923426e-04 + + -2.1095879375934601e-01 1.2273149937391281e-01 + <_> + 70 + -1.6056820154190063e+00 + + <_> + + 0 -1 329 -1.2480209581553936e-02 + + 2.6112109422683716e-01 -4.7001519799232483e-01 + <_> + + 0 -1 330 3.5450961440801620e-02 + + -2.0008459687232971e-01 4.7718611359596252e-01 + <_> + + 0 -1 331 2.0369330886751413e-03 + + -4.7703158855438232e-01 1.5132640302181244e-01 + <_> + + 0 -1 332 -4.3946420191787183e-05 + + 1.2288480252027512e-01 -5.1796287298202515e-01 + <_> + + 0 -1 333 -3.8480788934975863e-03 + + 4.1113680601119995e-01 -1.4595329761505127e-01 + <_> + + 0 -1 334 -2.8316550888121128e-03 + + 2.8710970282554626e-01 -1.7629599571228027e-01 + <_> + + 0 -1 335 2.5026081129908562e-03 + + 7.9668842256069183e-02 -5.7808011770248413e-01 + <_> + + 0 -1 336 3.0812958721071482e-04 + + 8.2838706672191620e-02 -4.2540180683135986e-01 + <_> + + 0 -1 337 6.1186961829662323e-04 + + 1.3641810417175293e-01 -3.0591419339179993e-01 + <_> + + 0 -1 338 -1.4354350241774227e-05 + + 1.4197489619255066e-01 -2.5681999325752258e-01 + <_> + + 0 -1 339 1.6148330178111792e-03 + + -2.6239329576492310e-01 1.3288390636444092e-01 + <_> + + 0 -1 340 2.0318101160228252e-03 + + 7.5749568641185760e-02 -4.3141460418701172e-01 + <_> + + 0 -1 341 9.5563679933547974e-03 + + -9.1424480080604553e-02 4.0004569292068481e-01 + <_> + + 0 -1 342 -7.8439561184495687e-04 + + -3.6619931459426880e-01 9.1777816414833069e-02 + <_> + + 0 -1 343 -3.9661130867898464e-03 + + 2.3698210716247559e-01 -1.4281649887561798e-01 + <_> + + 0 -1 344 -2.3194469977170229e-03 + + -4.2245340347290039e-01 7.8684106469154358e-02 + <_> + + 0 -1 345 -7.3490202426910400e-02 + + -6.2218552827835083e-01 4.0496870875358582e-02 + <_> + + 0 -1 346 -3.6803178954869509e-03 + + 1.2612029910087585e-01 -2.0990429818630219e-01 + <_> + + 0 -1 347 -4.1019290685653687e-02 + + -8.0316942930221558e-01 2.7993949130177498e-02 + <_> + + 0 -1 348 -4.8213129048235714e-04 + + 1.4825980365276337e-01 -1.7869630455970764e-01 + <_> + + 0 -1 349 -1.6598250716924667e-02 + + 4.1442281007766724e-01 -6.4051687717437744e-02 + <_> + + 0 -1 350 -1.0631670011207461e-03 + + -3.3466520905494690e-01 8.2425996661186218e-02 + <_> + + 0 -1 351 1.8658409826457500e-03 + + -1.3119789958000183e-01 2.3183380067348480e-01 + <_> + + 0 -1 352 -2.5827190838754177e-03 + + 3.8415950536727905e-01 -8.4121666848659515e-02 + <_> + + 0 -1 353 1.7159619601443410e-03 + + 7.6971538364887238e-02 -4.1098991036415100e-01 + <_> + + 0 -1 354 -3.9140181615948677e-03 + + -6.2508618831634521e-01 3.8418460637331009e-02 + <_> + + 0 -1 355 4.2724498780444264e-04 + + 8.6016573011875153e-02 -2.6975229382514954e-01 + <_> + + 0 -1 356 3.3992920070886612e-03 + + -1.0176510363817215e-01 2.7030828595161438e-01 + <_> + + 0 -1 357 -3.6457281559705734e-02 + + -4.9261981248855591e-01 5.5854249745607376e-02 + <_> + + 0 -1 358 1.6230379696935415e-03 + + 5.7567078620195389e-02 -4.2053499817848206e-01 + <_> + + 0 -1 359 4.6655549667775631e-03 + + -9.1158397495746613e-02 3.2095280289649963e-01 + <_> + + 0 -1 360 3.1331549398601055e-03 + + -9.6932657063007355e-02 3.4073451161384583e-01 + <_> + + 0 -1 361 -1.6835830174386501e-03 + + -3.6766248941421509e-01 8.2226082682609558e-02 + <_> + + 0 -1 362 2.7728650718927383e-02 + + 4.0117498487234116e-02 -6.5198391675949097e-01 + <_> + + 0 -1 363 9.5015309751033783e-02 + + 2.3065119981765747e-02 -8.8881981372833252e-01 + <_> + + 0 -1 364 7.4755616486072540e-02 + + -6.3946872949600220e-02 4.7399708628654480e-01 + <_> + + 0 -1 365 1.6693340614438057e-02 + + 4.6477258205413818e-02 -7.1152418851852417e-01 + <_> + + 0 -1 366 1.2088769581168890e-03 + + -1.1359269917011261e-01 2.2424149513244629e-01 + <_> + + 0 -1 367 -6.1751517932862043e-04 + + -3.1268230080604553e-01 8.5018932819366455e-02 + <_> + + 0 -1 368 8.5786692798137665e-03 + + -1.5559460222721100e-01 1.5640939772129059e-01 + <_> + + 0 -1 369 6.1184767400845885e-04 + + 9.4403937458992004e-02 -2.6520138978958130e-01 + <_> + + 0 -1 370 -3.4570440184324980e-03 + + 1.5146060287952423e-01 -1.6220529377460480e-01 + <_> + + 0 -1 371 1.3953070156276226e-03 + + -9.9996216595172882e-02 2.4998310208320618e-01 + <_> + + 0 -1 372 3.5910680890083313e-03 + + 8.1011682748794556e-02 -3.0081549286842346e-01 + <_> + + 0 -1 373 5.4192831739783287e-03 + + 6.7650042474269867e-02 -3.2355660200119019e-01 + <_> + + 0 -1 374 -1.1379310162737966e-03 + + 1.8887449800968170e-01 -1.2729729712009430e-01 + <_> + + 0 -1 375 9.1047259047627449e-03 + + 1.0160540044307709e-01 -2.2280150651931763e-01 + <_> + + 0 -1 376 6.5050171688199043e-03 + + -7.2986416518688202e-02 3.5770270228385925e-01 + <_> + + 0 -1 377 -1.4676549653813709e-05 + + 1.4693109691143036e-01 -1.7403540015220642e-01 + <_> + + 0 -1 378 -9.4403158873319626e-03 + + -2.6536750793457031e-01 9.6619546413421631e-02 + <_> + + 0 -1 379 -4.2933300137519836e-03 + + 2.5656831264495850e-01 -1.0550209879875183e-01 + <_> + + 0 -1 380 4.3133171275258064e-03 + + 6.5936572849750519e-02 -4.5719939470291138e-01 + <_> + + 0 -1 381 5.8854468166828156e-02 + + 6.7918263375759125e-02 -3.3078071475028992e-01 + <_> + + 0 -1 382 -2.8407620266079903e-03 + + 2.3953500390052795e-01 -9.2092156410217285e-02 + <_> + + 0 -1 383 9.6359942108392715e-04 + + -1.0982380062341690e-01 2.6462998986244202e-01 + <_> + + 0 -1 384 -1.4724590073456056e-05 + + 1.1111160367727280e-01 -2.2704580426216125e-01 + <_> + + 0 -1 385 -8.0675468780100346e-04 + + -3.6335140466690063e-01 7.8122653067111969e-02 + <_> + + 0 -1 386 7.3296198388561606e-04 + + -1.5605129301548004e-01 1.5184900164604187e-01 + <_> + + 0 -1 387 6.3753738068044186e-03 + + -7.1957953274250031e-02 2.9723879694938660e-01 + <_> + + 0 -1 388 4.6390579082071781e-03 + + 3.5969600081443787e-02 -6.1132347583770752e-01 + <_> + + 0 -1 389 -7.1079272311180830e-04 + + -2.8806841373443604e-01 6.9314628839492798e-02 + <_> + + 0 -1 390 2.9162289574742317e-03 + + -7.5968459248542786e-02 3.2681688666343689e-01 + <_> + + 0 -1 391 -1.7853140830993652e-02 + + 4.4206309318542480e-01 -4.8174031078815460e-02 + <_> + + 0 -1 392 8.3874985575675964e-03 + + 4.8913899809122086e-02 -5.4415327310562134e-01 + <_> + + 0 -1 393 2.9458320568664931e-05 + + -2.1131239831447601e-01 1.0629370063543320e-01 + <_> + + 0 -1 394 -9.8192706704139709e-02 + + 3.5318240523338318e-01 -6.9296866655349731e-02 + <_> + + 0 -1 395 4.6140368795022368e-04 + + 9.6270777285099030e-02 -2.5811928510665894e-01 + <_> + + 0 -1 396 -2.4016610404942185e-04 + + -2.2976429760456085e-01 9.9984891712665558e-02 + <_> + + 0 -1 397 3.7882480770349503e-02 + + -1.0365439951419830e-01 2.3164770007133484e-01 + <_> + + 0 -1 398 3.2621581340208650e-04 + + 9.7933940589427948e-02 -2.3689700663089752e-01 + <_> + 85 + -1.5173089504241943e+00 + + <_> + + 0 -1 399 -3.6744121462106705e-02 + + 3.4079340100288391e-01 -3.1779891252517700e-01 + <_> + + 0 -1 400 2.1955010015517473e-03 + + -2.8729590773582458e-01 2.5869798660278320e-01 + <_> + + 0 -1 401 8.3034839481115341e-03 + + -2.1800449490547180e-01 2.6759269833564758e-01 + <_> + + 0 -1 402 2.6289420202374458e-03 + + -3.6006081104278564e-01 1.4639839529991150e-01 + <_> + + 0 -1 403 1.9458869937807322e-03 + + 1.3677720725536346e-01 -4.2058759927749634e-01 + <_> + + 0 -1 404 -2.1704390645027161e-02 + + 4.8903319239616394e-01 -9.8091572523117065e-02 + <_> + + 0 -1 405 4.2956420220434666e-03 + + -2.7825561165809631e-01 1.5712629258632660e-01 + <_> + + 0 -1 406 4.9894629046320915e-04 + + 1.1003810167312622e-01 -3.3779421448707581e-01 + <_> + + 0 -1 407 2.4652799591422081e-02 + + 4.5820660889148712e-02 -5.4710537195205688e-01 + <_> + + 0 -1 408 -2.3075740784406662e-02 + + -4.9801421165466309e-01 6.7044779658317566e-02 + <_> + + 0 -1 409 1.1991280131042004e-02 + + -7.0877023041248322e-02 4.8294249176979065e-01 + <_> + + 0 -1 410 1.5430679544806480e-02 + + -6.5949738025665283e-02 4.5236849784851074e-01 + <_> + + 0 -1 411 -4.5555769465863705e-03 + + -4.4665691256523132e-01 6.7877657711505890e-02 + <_> + + 0 -1 412 -4.4582979753613472e-03 + + 3.3656919002532959e-01 -9.4792358577251434e-02 + <_> + + 0 -1 413 1.3494009908754379e-04 + + -3.0288851261138916e-01 1.0293830186128616e-01 + <_> + + 0 -1 414 -4.2500188574194908e-03 + + 4.2550128698348999e-01 -7.2956383228302002e-02 + <_> + + 0 -1 415 -1.4293759595602751e-03 + + -3.0116760730743408e-01 9.0039253234863281e-02 + <_> + + 0 -1 416 -6.3978550024330616e-03 + + 4.1943550109863281e-01 -7.9320870339870453e-02 + <_> + + 0 -1 417 2.6083870325237513e-03 + + 8.3598926663398743e-02 -4.1897168755531311e-01 + <_> + + 0 -1 418 8.6870808154344559e-03 + + -6.3015699386596680e-02 5.2644741535186768e-01 + <_> + + 0 -1 419 -1.0380990570411086e-03 + + -3.6220151185989380e-01 8.0301038920879364e-02 + <_> + + 0 -1 420 4.4070050120353699e-01 + + 3.4913059324026108e-02 -7.2764492034912109e-01 + <_> + + 0 -1 421 3.3689520787447691e-03 + + 5.7332780212163925e-02 -4.8633271455764771e-01 + <_> + + 0 -1 422 1.7443710239604115e-03 + + -1.0994660109281540e-01 2.7023580670356750e-01 + <_> + + 0 -1 423 5.3788698278367519e-04 + + -2.7439421415328979e-01 1.0063380002975464e-01 + <_> + + 0 -1 424 1.0072899749502540e-03 + + 1.0756769776344299e-01 -2.3221600055694580e-01 + <_> + + 0 -1 425 -8.2518812268972397e-03 + + -6.5216302871704102e-01 3.5704229027032852e-02 + <_> + + 0 -1 426 3.5490558948367834e-03 + + -8.4254868328571320e-02 3.1767430901527405e-01 + <_> + + 0 -1 427 -1.1033359915018082e-02 + + 4.1271620988845825e-01 -6.2587052583694458e-02 + <_> + + 0 -1 428 3.2278439030051231e-03 + + 7.1266986429691315e-02 -4.1172251105308533e-01 + <_> + + 0 -1 429 1.7540389299392700e-01 + + 3.4958980977535248e-02 -6.3775068521499634e-01 + <_> + + 0 -1 430 -4.8067080206237733e-04 + + -2.4503110349178314e-01 9.8930649459362030e-02 + <_> + + 0 -1 431 -1.8284550169482827e-03 + + 1.3486519455909729e-01 -1.9799900054931641e-01 + <_> + + 0 -1 432 1.7096720403060317e-03 + + -1.0525950044393539e-01 2.1005709469318390e-01 + <_> + + 0 -1 433 3.9468301110900939e-04 + + 8.0952547490596771e-02 -2.7405399084091187e-01 + <_> + + 0 -1 434 2.3097719531506300e-03 + + 1.2338220328092575e-01 -1.9958800077438354e-01 + <_> + + 0 -1 435 3.1529190018773079e-03 + + -1.0612549632787704e-01 2.2089600563049316e-01 + <_> + + 0 -1 436 -1.9097010372206569e-03 + + -2.5094708800315857e-01 8.7022580206394196e-02 + <_> + + 0 -1 437 -1.2370609911158681e-03 + + 3.0760520696640015e-01 -7.5937293469905853e-02 + <_> + + 0 -1 438 3.7081091431900859e-04 + + -1.6065080463886261e-01 1.3480199873447418e-01 + <_> + + 0 -1 439 3.4268848598003387e-02 + + 3.5260949283838272e-02 -6.3547158241271973e-01 + <_> + + 0 -1 440 4.6664681285619736e-03 + + -5.2494861185550690e-02 4.3242320418357849e-01 + <_> + + 0 -1 441 1.0423569940030575e-02 + + 5.1612429320812225e-02 -5.0745230913162231e-01 + <_> + + 0 -1 442 1.1215180158615112e-02 + + -3.8614250719547272e-02 5.7645928859710693e-01 + <_> + + 0 -1 443 -7.3029109444178175e-06 + + 1.2052319943904877e-01 -1.7274369299411774e-01 + <_> + + 0 -1 444 -4.9072802066802979e-03 + + -3.4818550944328308e-01 5.9116441756486893e-02 + <_> + + 0 -1 445 1.9488829420879483e-03 + + -8.8861227035522461e-02 2.4020899832248688e-01 + <_> + + 0 -1 446 1.3313010276760906e-04 + + -1.4657719433307648e-01 1.9929920136928558e-01 + <_> + + 0 -1 447 -1.4298240421339869e-03 + + -3.9005228877067566e-01 5.9909418225288391e-02 + <_> + + 0 -1 448 -6.4831459894776344e-03 + + 1.8141369521617889e-01 -1.1655449867248535e-01 + <_> + + 0 -1 449 7.2958500823006034e-06 + + -1.8219240009784698e-01 1.1812780052423477e-01 + <_> + + 0 -1 450 4.1690681246109307e-04 + + 1.0591679811477661e-01 -2.0353710651397705e-01 + <_> + + 0 -1 451 5.1982058212161064e-03 + + -3.5962641239166260e-02 6.0264211893081665e-01 + <_> + + 0 -1 452 -4.0649957954883575e-03 + + 2.0696419477462769e-01 -9.8599843680858612e-02 + <_> + + 0 -1 453 -4.7734950203448534e-04 + + -2.4629549682140350e-01 9.3174271285533905e-02 + <_> + + 0 -1 454 5.2415160462260246e-03 + + 3.6528520286083221e-02 -5.4934787750244141e-01 + <_> + + 0 -1 455 3.7873629480600357e-03 + + -5.7597089558839798e-02 3.8733980059623718e-01 + <_> + + 0 -1 456 -1.4434250260819681e-05 + + 1.1292859911918640e-01 -1.7447079718112946e-01 + <_> + + 0 -1 457 4.2011599987745285e-02 + + -4.6556860208511353e-02 4.5454800128936768e-01 + <_> + + 0 -1 458 7.9663433134555817e-03 + + 4.2258739471435547e-02 -5.3702521324157715e-01 + <_> + + 0 -1 459 5.3092982852831483e-04 + + -9.7918719053268433e-02 2.1795919537544250e-01 + <_> + + 0 -1 460 5.2906107157468796e-04 + + 7.7961057424545288e-02 -2.8867539763450623e-01 + <_> + + 0 -1 461 -1.9556249678134918e-01 + + -7.6475739479064941e-01 2.7276000007987022e-02 + <_> + + 0 -1 462 -1.1559950187802315e-02 + + 3.3526000380516052e-01 -6.3614986836910248e-02 + <_> + + 0 -1 463 -1.4005659520626068e-01 + + -7.6232051849365234e-01 2.8024470433592796e-02 + <_> + + 0 -1 464 4.4643289584200829e-05 + + -2.0320929586887360e-01 9.9391698837280273e-02 + <_> + + 0 -1 465 3.9411801844835281e-03 + + 4.9936279654502869e-02 -3.7584540247917175e-01 + <_> + + 0 -1 466 -4.5965691097080708e-03 + + 3.3031210303306580e-01 -6.3809931278228760e-02 + <_> + + 0 -1 467 -6.9790292764082551e-04 + + 1.6093710064888000e-01 -1.3192920386791229e-01 + <_> + + 0 -1 468 6.1886821640655398e-04 + + 7.4621193110942841e-02 -3.3021458983421326e-01 + <_> + + 0 -1 469 -3.2755140215158463e-02 + + -4.0643560886383057e-01 4.9308661371469498e-02 + <_> + + 0 -1 470 3.3697509206831455e-03 + + 4.0627099573612213e-02 -4.9757328629493713e-01 + <_> + + 0 -1 471 3.7391821388155222e-04 + + -1.4931799471378326e-01 1.6517969965934753e-01 + <_> + + 0 -1 472 -4.0217190980911255e-03 + + 2.9531970620155334e-01 -7.6642103493213654e-02 + <_> + + 0 -1 473 -7.2943832492455840e-04 + + -2.7355810999870300e-01 7.9243987798690796e-02 + <_> + + 0 -1 474 -5.7726111263036728e-03 + + 3.4741240739822388e-01 -7.6087206602096558e-02 + <_> + + 0 -1 475 -2.1122458856552839e-03 + + 1.7290510237216949e-01 -1.2444470077753067e-01 + <_> + + 0 -1 476 4.4956691563129425e-03 + + 3.0218729749321938e-02 -7.4003338813781738e-01 + <_> + + 0 -1 477 -1.1419389629736543e-03 + + -2.3494489490985870e-01 7.6911546289920807e-02 + <_> + + 0 -1 478 2.7658098842948675e-03 + + -9.1666661202907562e-02 2.1009710431098938e-01 + <_> + + 0 -1 479 -7.2281848406419158e-04 + + -2.5587469339370728e-01 7.5378142297267914e-02 + <_> + + 0 -1 480 1.8604539800435305e-03 + + -9.4511069357395172e-02 1.9726920127868652e-01 + <_> + + 0 -1 481 -2.8568008565343916e-04 + + -2.1073310077190399e-01 9.7290039062500000e-02 + <_> + + 0 -1 482 -3.8796100765466690e-02 + + -7.8724592924118042e-01 2.4410309270024300e-02 + <_> + + 0 -1 483 -1.2119869701564312e-02 + + 3.6466810107231140e-01 -5.7907499372959137e-02 + <_> + 93 + -1.6563049554824829e+00 + + <_> + + 0 -1 484 5.6008538231253624e-03 + + -3.8491588830947876e-01 3.3817461133003235e-01 + <_> + + 0 -1 485 -3.7205789703875780e-03 + + 2.4614119529724121e-01 -3.0673781037330627e-01 + <_> + + 0 -1 486 -2.5333440862596035e-03 + + 1.2531200051307678e-01 -4.2720189690589905e-01 + <_> + + 0 -1 487 -7.3425087612122297e-04 + + 1.3314330577850342e-01 -3.5111570358276367e-01 + <_> + + 0 -1 488 -1.4792960428167135e-04 + + 1.2545309960842133e-01 -3.8591191172599792e-01 + <_> + + 0 -1 489 -4.8976339399814606e-02 + + 3.6456748843193054e-01 -1.1494780331850052e-01 + <_> + + 0 -1 490 1.0917349718511105e-03 + + 7.9005338251590729e-02 -4.1399830579757690e-01 + <_> + + 0 -1 491 5.4457997903227806e-03 + + -1.1921840161085129e-01 3.3085560798645020e-01 + <_> + + 0 -1 492 1.5979419695213437e-03 + + 4.1181199252605438e-02 -5.5028229951858521e-01 + <_> + + 0 -1 493 -1.3023250503465533e-03 + + 8.2839436829090118e-02 -3.5719320178031921e-01 + <_> + + 0 -1 494 4.8810569569468498e-04 + + -2.0928630232810974e-01 1.4972810447216034e-01 + <_> + + 0 -1 495 2.1033850498497486e-03 + + 5.1839418709278107e-02 -6.1099958419799805e-01 + <_> + + 0 -1 496 1.1984360404312611e-02 + + 4.1022349148988724e-02 -5.8985722064971924e-01 + <_> + + 0 -1 497 -1.1898590251803398e-02 + + 4.5844998955726624e-01 -6.4714707434177399e-02 + <_> + + 0 -1 498 5.3713661618530750e-03 + + -6.1560470610857010e-02 4.1204369068145752e-01 + <_> + + 0 -1 499 4.3421140871942043e-03 + + 6.0501661151647568e-02 -4.8703390359878540e-01 + <_> + + 0 -1 500 6.6142519935965538e-03 + + 4.6873189508914948e-02 -5.0346171855926514e-01 + <_> + + 0 -1 501 1.2339729582890868e-03 + + -8.1538438796997070e-02 3.0428299307823181e-01 + <_> + + 0 -1 502 -1.2975660152733326e-02 + + -4.7834330797195435e-01 4.8681490123271942e-02 + <_> + + 0 -1 503 -1.7806360265240073e-03 + + 3.7698730826377869e-01 -6.8126037716865540e-02 + <_> + + 0 -1 504 7.8339744359254837e-03 + + 5.4501280188560486e-02 -4.6738588809967041e-01 + <_> + + 0 -1 505 -6.0113701038062572e-03 + + 5.4870051145553589e-01 -4.4434640556573868e-02 + <_> + + 0 -1 506 -2.0694560371339321e-03 + + -3.7755548954010010e-01 6.4383402466773987e-02 + <_> + + 0 -1 507 4.7843591310083866e-03 + + 4.6252150088548660e-02 -5.2633982896804810e-01 + <_> + + 0 -1 508 -6.2808818183839321e-03 + + 3.9451861381530762e-01 -6.9051302969455719e-02 + <_> + + 0 -1 509 1.6099009662866592e-03 + + -1.0316190123558044e-01 2.7321669459342957e-01 + <_> + + 0 -1 510 -8.2392559852451086e-04 + + -2.8039410710334778e-01 8.4601573646068573e-02 + <_> + + 0 -1 511 -1.0123319923877716e-02 + + 3.3635950088500977e-01 -6.1322949826717377e-02 + <_> + + 0 -1 512 1.0525720193982124e-02 + + 4.6165600419044495e-02 -5.1672130823135376e-01 + <_> + + 0 -1 513 -2.6774499565362930e-02 + + -5.0325971841812134e-01 3.9857819676399231e-02 + <_> + + 0 -1 514 4.0248301811516285e-03 + + -6.1501380056142807e-02 3.6659809947013855e-01 + <_> + + 0 -1 515 -4.6271650353446603e-04 + + -2.6439830660820007e-01 8.1311263144016266e-02 + <_> + + 0 -1 516 -5.1834900659741834e-05 + + 1.1154399812221527e-01 -2.0269370079040527e-01 + <_> + + 0 -1 517 4.8874281346797943e-03 + + -6.9644987583160400e-02 3.3612030744552612e-01 + <_> + + 0 -1 518 1.2638230621814728e-01 + + 3.6813639104366302e-02 -6.5849918127059937e-01 + <_> + + 0 -1 519 -8.0248164013028145e-03 + + 4.6601921319961548e-01 -4.8885859549045563e-02 + <_> + + 0 -1 520 -1.1518909595906734e-03 + + -4.0466758608818054e-01 5.8572851121425629e-02 + <_> + + 0 -1 521 9.8190037533640862e-04 + + -1.3197229802608490e-01 1.7744350433349609e-01 + <_> + + 0 -1 522 -1.9447980448603630e-02 + + -6.8489527702331543e-01 3.3834591507911682e-02 + <_> + + 0 -1 523 -7.2442039709130768e-06 + + 1.1553110182285309e-01 -1.8726129829883575e-01 + <_> + + 0 -1 524 -1.7039060592651367e-02 + + -3.5105291008949280e-01 6.7737713456153870e-02 + <_> + + 0 -1 525 1.1186580173671246e-02 + + -9.3420043587684631e-02 2.1077099442481995e-01 + <_> + + 0 -1 526 7.6585268834605813e-04 + + 6.5965756773948669e-02 -3.2127881050109863e-01 + <_> + + 0 -1 527 1.4231950626708567e-04 + + -1.5460130572319031e-01 1.3757640123367310e-01 + <_> + + 0 -1 528 -5.5553209967911243e-03 + + 3.1319350004196167e-01 -6.4753532409667969e-02 + <_> + + 0 -1 529 1.2308239820413291e-04 + + 9.7666621208190918e-02 -2.2251069545745850e-01 + <_> + + 0 -1 530 -1.6092039877548814e-03 + + -3.6215591430664062e-01 6.4452558755874634e-02 + <_> + + 0 -1 531 -1.5626100357621908e-03 + + 2.2588780522346497e-01 -9.5551103353500366e-02 + <_> + + 0 -1 532 -5.0116342026740313e-04 + + -2.2289219498634338e-01 8.9174531400203705e-02 + <_> + + 0 -1 533 3.7322030402719975e-04 + + 9.1969013214111328e-02 -2.1129919588565826e-01 + <_> + + 0 -1 534 -2.2882660850882530e-03 + + 3.8989049196243286e-01 -5.3455859422683716e-02 + <_> + + 0 -1 535 -4.6884030103683472e-02 + + -6.2357091903686523e-01 3.2194521278142929e-02 + <_> + + 0 -1 536 1.8901260336861014e-03 + + -7.2615146636962891e-02 2.7420088648796082e-01 + <_> + + 0 -1 537 1.5805330127477646e-02 + + 2.8601830825209618e-02 -6.9608169794082642e-01 + <_> + + 0 -1 538 3.2644178718328476e-02 + + -4.0772251784801483e-02 5.0873398780822754e-01 + <_> + + 0 -1 539 6.5482832724228501e-04 + + 8.5724912583827972e-02 -2.7580630779266357e-01 + <_> + + 0 -1 540 -1.1142930015921593e-02 + + 8.7326012551784515e-02 -2.0914819836616516e-01 + <_> + + 0 -1 541 -5.8072229148820043e-04 + + -2.9471421241760254e-01 6.6337890923023224e-02 + <_> + + 0 -1 542 -7.4414577102288604e-04 + + 1.8017959594726562e-01 -1.0654629766941071e-01 + <_> + + 0 -1 543 7.6460661366581917e-03 + + -6.3608147203922272e-02 3.1582340598106384e-01 + <_> + + 0 -1 544 3.2617211341857910e-02 + + 3.2606441527605057e-02 -6.0541188716888428e-01 + <_> + + 0 -1 545 -3.4527231007814407e-02 + + -5.9770858287811279e-01 2.7888769283890724e-02 + <_> + + 0 -1 546 3.2211719080805779e-03 + + -4.9183920025825500e-02 4.0305620431900024e-01 + <_> + + 0 -1 547 -4.1549839079380035e-04 + + 1.3533140718936920e-01 -1.5845330059528351e-01 + <_> + + 0 -1 548 2.5140501093119383e-03 + + 6.3218571245670319e-02 -3.0768528580665588e-01 + <_> + + 0 -1 549 -2.0818209648132324e-01 + + -7.5750261545181274e-01 2.2695960476994514e-02 + <_> + + 0 -1 550 -2.6067279279232025e-02 + + -7.4959957599639893e-01 1.9375480711460114e-02 + <_> + + 0 -1 551 -5.8264029212296009e-04 + + 9.4658233225345612e-02 -1.9919820129871368e-01 + <_> + + 0 -1 552 -3.2769259996712208e-03 + + 1.6214330494403839e-01 -1.2322030216455460e-01 + <_> + + 0 -1 553 1.3998829526826739e-03 + + -1.0849200189113617e-01 2.3151659965515137e-01 + <_> + + 0 -1 554 -1.2055980041623116e-02 + + -2.4002850055694580e-01 9.3272961676120758e-02 + <_> + + 0 -1 555 3.1805539038032293e-03 + + 7.6264120638370514e-02 -2.5435069203376770e-01 + <_> + + 0 -1 556 -1.0693799704313278e-03 + + 2.2258889675140381e-01 -9.0730242431163788e-02 + <_> + + 0 -1 557 -2.9467688873410225e-03 + + -3.4242698550224304e-01 6.0581039637327194e-02 + <_> + + 0 -1 558 8.8108901400119066e-04 + + -7.8326202929019928e-02 2.6911988854408264e-01 + <_> + + 0 -1 559 2.8118939371779561e-04 + + 9.8370827734470367e-02 -2.1947909891605377e-01 + <_> + + 0 -1 560 -1.8574869260191917e-02 + + 2.6729720830917358e-01 -7.1240752935409546e-02 + <_> + + 0 -1 561 -2.4810349568724632e-02 + + -6.8322032690048218e-01 2.9446309432387352e-02 + <_> + + 0 -1 562 2.8904930222779512e-03 + + 7.6161012053489685e-02 -2.4025200307369232e-01 + <_> + + 0 -1 563 3.5410430282354355e-03 + + -1.0742089897394180e-01 1.8509419262409210e-01 + <_> + + 0 -1 564 -8.4244477329775691e-04 + + 1.8727229535579681e-01 -1.1407770216464996e-01 + <_> + + 0 -1 565 -2.5338360574096441e-03 + + -3.5870191454887390e-01 5.1251661032438278e-02 + <_> + + 0 -1 566 1.9654980860650539e-03 + + -1.4064720273017883e-01 1.3041019439697266e-01 + <_> + + 0 -1 567 3.1574100255966187e-01 + + 2.9550969600677490e-02 -6.3157892227172852e-01 + <_> + + 0 -1 568 -2.9846638790331781e-04 + + -2.2911080718040466e-01 7.8875422477722168e-02 + <_> + + 0 -1 569 -1.1545480042695999e-01 + + -8.1895941495895386e-01 2.2261450067162514e-02 + <_> + + 0 -1 570 -3.5817299038171768e-02 + + -3.0612939596176147e-01 6.0644190758466721e-02 + <_> + + 0 -1 571 1.7071690410375595e-02 + + -6.1134841293096542e-02 3.2152679562568665e-01 + <_> + + 0 -1 572 -2.1385080181062222e-03 + + -5.4798161983489990e-01 3.8667369633913040e-02 + <_> + + 0 -1 573 6.5424457192420959e-02 + + 1.7884260043501854e-02 -8.5628831386566162e-01 + <_> + + 0 -1 574 -1.3419929891824722e-02 + + 3.0995100736618042e-01 -6.7559666931629181e-02 + <_> + + 0 -1 575 1.8939709290862083e-02 + + 2.8729729354381561e-02 -7.5338190793991089e-01 + <_> + + 0 -1 576 -2.9120460152626038e-02 + + -7.3594617843627930e-01 2.0359549671411514e-02 + <_> + 79 + -1.5920439958572388e+00 + + <_> + + 0 -1 577 -1.3419030234217644e-02 + + 3.0538010597229004e-01 -4.1782331466674805e-01 + <_> + + 0 -1 578 1.7404999816790223e-03 + + -2.7101579308509827e-01 3.5409560799598694e-01 + <_> + + 0 -1 579 7.7174860052764416e-03 + + -3.1271371245384216e-01 2.1189980208873749e-01 + <_> + + 0 -1 580 -1.4514879694615956e-05 + + 1.6157090663909912e-01 -3.3522731065750122e-01 + <_> + + 0 -1 581 -1.4871519852022175e-05 + + 1.4571620523929596e-01 -2.9369521141052246e-01 + <_> + + 0 -1 582 1.5004149463493377e-04 + + -4.0149879455566406e-01 1.0407949984073639e-01 + <_> + + 0 -1 583 1.8634879961609840e-03 + + 4.9062840640544891e-02 -6.5208268165588379e-01 + <_> + + 0 -1 584 -2.9590800404548645e-03 + + 2.8804430365562439e-01 -1.3293409347534180e-01 + <_> + + 0 -1 585 3.3067780896089971e-04 + + 3.9615370333194733e-02 -4.1540861129760742e-01 + <_> + + 0 -1 586 -1.6816710121929646e-03 + + 1.3032579421997070e-01 -2.3237510025501251e-01 + <_> + + 0 -1 587 3.4896740689873695e-03 + + 6.8852916359901428e-02 -4.7176009416580200e-01 + <_> + + 0 -1 588 1.6204500570893288e-03 + + -1.0996960103511810e-01 3.4887188673019409e-01 + <_> + + 0 -1 589 1.9125849939882755e-04 + + -2.0317320525646210e-01 1.4775620400905609e-01 + <_> + + 0 -1 590 2.2485259920358658e-02 + + 5.1929730921983719e-02 -5.4815691709518433e-01 + <_> + + 0 -1 591 1.0035949759185314e-02 + + -1.0943319648504257e-01 2.6000571250915527e-01 + <_> + + 0 -1 592 4.0091630071401596e-02 + + 3.8657050579786301e-02 -7.4724602699279785e-01 + <_> + + 0 -1 593 1.5319019556045532e-02 + + 2.8579369187355042e-02 -7.7717798948287964e-01 + <_> + + 0 -1 594 9.0913427993655205e-04 + + -1.5049549937248230e-01 1.7363379895687103e-01 + <_> + + 0 -1 595 -6.0226190835237503e-03 + + -4.7704491019248962e-01 5.8185670524835587e-02 + <_> + + 0 -1 596 7.8066787682473660e-04 + + -1.6349339485168457e-01 1.6236920654773712e-01 + <_> + + 0 -1 597 -1.1492020450532436e-02 + + -5.6185477972030640e-01 4.6009611338376999e-02 + <_> + + 0 -1 598 8.9691327884793282e-03 + + 6.6570483148097992e-02 -3.3824840188026428e-01 + <_> + + 0 -1 599 7.2241941234096885e-04 + + -1.2882669270038605e-01 1.9002969563007355e-01 + <_> + + 0 -1 600 1.4879239643050823e-05 + + -2.1765929460525513e-01 1.3151009380817413e-01 + <_> + + 0 -1 601 8.7159732356667519e-03 + + 4.8188239336013794e-02 -5.2367717027664185e-01 + <_> + + 0 -1 602 -1.3809900265187025e-03 + + -3.1734630465507507e-01 6.7012362182140350e-02 + <_> + + 0 -1 603 1.4004110358655453e-02 + + -7.2155177593231201e-02 3.4900391101837158e-01 + <_> + + 0 -1 604 -1.2883460149168968e-02 + + -5.9674298763275146e-01 3.9219990372657776e-02 + <_> + + 0 -1 605 9.9220760166645050e-03 + + -7.3617048561573029e-02 3.5491651296615601e-01 + <_> + + 0 -1 606 -1.0360360145568848e-02 + + -4.9655780196189880e-01 5.4516721516847610e-02 + <_> + + 0 -1 607 5.9103948296979070e-04 + + -9.1649092733860016e-02 2.3738409578800201e-01 + <_> + + 0 -1 608 1.4986419955675956e-05 + + -1.5624360740184784e-01 1.4216689765453339e-01 + <_> + + 0 -1 609 6.2526292167603970e-03 + + 4.6570941805839539e-02 -4.3861261010169983e-01 + <_> + + 0 -1 610 9.0722978115081787e-02 + + 2.3544119670987129e-02 -7.5557678937911987e-01 + <_> + + 0 -1 611 1.2880839640274644e-03 + + -1.0999819636344910e-01 1.9954189658164978e-01 + <_> + + 0 -1 612 -5.3202832350507379e-04 + + -2.3681020736694336e-01 9.4349831342697144e-02 + <_> + + 0 -1 613 1.4669039519503713e-03 + + -6.0417938977479935e-02 3.5437929630279541e-01 + <_> + + 0 -1 614 2.5929270312190056e-02 + + 3.0205380171537399e-02 -7.1175122261047363e-01 + <_> + + 0 -1 615 -7.2257839143276215e-02 + + -7.6830059289932251e-01 2.2078540176153183e-02 + <_> + + 0 -1 616 -2.5999830104410648e-03 + + 2.2878250479698181e-01 -9.2575646936893463e-02 + <_> + + 0 -1 617 4.2036110162734985e-01 + + 3.4129150211811066e-02 -6.3944667577743530e-01 + <_> + + 0 -1 618 -2.1722039673477411e-03 + + -2.0458799600601196e-01 9.6727348864078522e-02 + <_> + + 0 -1 619 -1.8573250621557236e-02 + + -7.2321742773056030e-01 2.6587400585412979e-02 + <_> + + 0 -1 620 2.1321140229701996e-03 + + -7.9263173043727875e-02 2.9004418849945068e-01 + <_> + + 0 -1 621 1.4585970347980037e-05 + + -1.5812200307846069e-01 1.2857919931411743e-01 + <_> + + 0 -1 622 -2.5919941067695618e-01 + + -8.3206391334533691e-01 2.1327629685401917e-02 + <_> + + 0 -1 623 -1.2713880278170109e-02 + + -4.8670661449432373e-01 3.5282909870147705e-02 + <_> + + 0 -1 624 2.1182969212532043e-03 + + -4.8141859471797943e-02 4.3498820066452026e-01 + <_> + + 0 -1 625 4.9225408583879471e-03 + + 5.9389010071754456e-02 -3.5719910264015198e-01 + <_> + + 0 -1 626 7.1720690466463566e-03 + + -7.2721220552921295e-02 3.1716778874397278e-01 + <_> + + 0 -1 627 1.5319329686462879e-03 + + 7.6105281710624695e-02 -2.9826408624649048e-01 + <_> + + 0 -1 628 -2.6141680777072906e-02 + + -4.8129829764366150e-01 4.1991200298070908e-02 + <_> + + 0 -1 629 -7.1861818469187710e-06 + + 1.0385909676551819e-01 -2.5540891289710999e-01 + <_> + + 0 -1 630 -5.8513309340924025e-04 + + 2.1552430093288422e-01 -1.0446780174970627e-01 + <_> + + 0 -1 631 7.3564669582992792e-04 + + 8.2850307226181030e-02 -2.3229689896106720e-01 + <_> + + 0 -1 632 -4.4216000242158771e-04 + + 1.9849689304828644e-01 -1.1084359884262085e-01 + <_> + + 0 -1 633 6.6545000299811363e-03 + + 2.9844839125871658e-02 -6.3819402456283569e-01 + <_> + + 0 -1 634 -1.4856060261081439e-05 + + 1.0647810250520706e-01 -1.6304740309715271e-01 + <_> + + 0 -1 635 4.4933347962796688e-03 + + -5.8312181383371353e-02 3.2200211286544800e-01 + <_> + + 0 -1 636 3.8110970053821802e-03 + + 7.1237437427043915e-02 -2.7149480581283569e-01 + <_> + + 0 -1 637 -3.8309019058942795e-02 + + -6.2387478351593018e-01 2.9790399596095085e-02 + <_> + + 0 -1 638 -2.5534629821777344e-03 + + 2.0947620272636414e-01 -9.3472570180892944e-02 + <_> + + 0 -1 639 -2.9908109354437329e-05 + + 1.4771899580955505e-01 -1.2858720123767853e-01 + <_> + + 0 -1 640 2.0549520850181580e-03 + + -9.3603983521461487e-02 2.1911169588565826e-01 + <_> + + 0 -1 641 3.3064800663851202e-04 + + -1.4430660009384155e-01 1.6905060410499573e-01 + <_> + + 0 -1 642 4.0969369001686573e-04 + + 8.9844956994056702e-02 -2.1793210506439209e-01 + <_> + + 0 -1 643 -5.1680381875485182e-04 + + -2.7330860495567322e-01 7.2490707039833069e-02 + <_> + + 0 -1 644 -1.2285299599170685e-02 + + -5.7899951934814453e-01 2.8828129172325134e-02 + <_> + + 0 -1 645 1.4923219569027424e-03 + + -8.9748427271842957e-02 2.1315790712833405e-01 + <_> + + 0 -1 646 3.7809570785611868e-03 + + 5.6869130581617355e-02 -3.2580479979515076e-01 + <_> + + 0 -1 647 -1.3630799949169159e-01 + + -5.1958292722702026e-01 3.4014869481325150e-02 + <_> + + 0 -1 648 2.1192250773310661e-02 + + -5.9815749526023865e-02 4.3134000897407532e-01 + <_> + + 0 -1 649 -2.2501780185848475e-03 + + -3.2725110650062561e-01 6.9494038820266724e-02 + <_> + + 0 -1 650 -1.3309439644217491e-02 + + 5.5684721469879150e-01 -3.8055110722780228e-02 + <_> + + 0 -1 651 -4.8674400895833969e-02 + + 3.7503889203071594e-01 -4.8045299947261810e-02 + <_> + + 0 -1 652 -1.4651560377387796e-05 + + 9.3043543398380280e-02 -2.2984559834003448e-01 + <_> + + 0 -1 653 -7.7605661936104298e-03 + + 3.8858211040496826e-01 -5.4669309407472610e-02 + <_> + + 0 -1 654 2.4429330602288246e-02 + + 4.5898649841547012e-02 -5.1061111688613892e-01 + <_> + + 0 -1 655 -2.1317049686331302e-04 + + -2.0513610541820526e-01 1.0507310181856155e-01 + <_> + 105 + -1.6632529497146606e+00 + + <_> + + 0 -1 656 -5.7014292106032372e-03 + + 2.7576211094856262e-01 -3.3123719692230225e-01 + <_> + + 0 -1 657 -4.4359369203448296e-03 + + 1.5587480366230011e-01 -5.0288617610931396e-01 + <_> + + 0 -1 658 -5.0388257950544357e-03 + + 1.6109010577201843e-01 -3.5196068882942200e-01 + <_> + + 0 -1 659 8.0847437493503094e-04 + + -3.3315700292587280e-01 1.4446459710597992e-01 + <_> + + 0 -1 660 2.1605329588055611e-02 + + -8.6723573505878448e-02 5.9101939201354980e-01 + <_> + + 0 -1 661 -1.8266839906573296e-02 + + 5.0261861085891724e-01 -8.4620863199234009e-02 + <_> + + 0 -1 662 -8.3384668687358499e-04 + + -3.0832511186599731e-01 1.1352760344743729e-01 + <_> + + 0 -1 663 -1.5336600132286549e-02 + + -6.8610608577728271e-01 3.3057838678359985e-02 + <_> + + 0 -1 664 -5.0607877783477306e-03 + + 3.4399279952049255e-01 -9.2118233442306519e-02 + <_> + + 0 -1 665 -1.4741700397280511e-05 + + 1.1778169870376587e-01 -2.5235179066658020e-01 + <_> + + 0 -1 666 -1.1485730065032840e-03 + + -2.9050019383430481e-01 8.3533048629760742e-02 + <_> + + 0 -1 667 2.8824089094996452e-03 + + -9.0674236416816711e-02 3.1274148821830750e-01 + <_> + + 0 -1 668 -2.9224360361695290e-02 + + -6.9156378507614136e-01 3.3279780298471451e-02 + <_> + + 0 -1 669 2.1423520520329475e-03 + + -1.0087729990482330e-01 2.4603089690208435e-01 + <_> + + 0 -1 670 -3.3471059054136276e-02 + + -5.0953942537307739e-01 5.5052071809768677e-02 + <_> + + 0 -1 671 1.4763450053578708e-05 + + -1.7823149263858795e-01 1.2816399335861206e-01 + <_> + + 0 -1 672 1.6341559588909149e-02 + + -1.3254739344120026e-01 1.9663499295711517e-01 + <_> + + 0 -1 673 2.2475779987871647e-03 + + 7.9048447310924530e-02 -2.9476320743560791e-01 + <_> + + 0 -1 674 4.6113221906125546e-03 + + -7.6338447630405426e-02 3.2394409179687500e-01 + <_> + + 0 -1 675 2.8979079797863960e-03 + + -1.0839050263166428e-01 2.6353389024734497e-01 + <_> + + 0 -1 676 1.3482819776982069e-03 + + 7.9134561121463776e-02 -3.4839859604835510e-01 + <_> + + 0 -1 677 4.6576592139899731e-03 + + 7.6356090605258942e-02 -3.1110540032386780e-01 + <_> + + 0 -1 678 -3.9915097877383232e-03 + + -3.4151628613471985e-01 8.2623466849327087e-02 + <_> + + 0 -1 679 6.0268798843026161e-03 + + -9.6277832984924316e-02 2.6347661018371582e-01 + <_> + + 0 -1 680 -4.1388701647520065e-03 + + 2.3571729660034180e-01 -9.4335287809371948e-02 + <_> + + 0 -1 681 -1.0371750220656395e-02 + + -7.2972798347473145e-01 3.3645220100879669e-02 + <_> + + 0 -1 682 1.0373629629611969e-01 + + 3.1347069889307022e-02 -5.8245128393173218e-01 + <_> + + 0 -1 683 -1.8832299974747002e-04 + + 1.6663299500942230e-01 -1.3723160326480865e-01 + <_> + + 0 -1 684 -6.0749921249225736e-04 + + -2.7257540822029114e-01 8.1483371555805206e-02 + <_> + + 0 -1 685 2.3499270901083946e-03 + + -1.0285440087318420e-01 2.1854889392852783e-01 + <_> + + 0 -1 686 -3.1354159582406282e-03 + + -4.9246039986610413e-01 4.4747360050678253e-02 + <_> + + 0 -1 687 1.5564589994028211e-03 + + 5.3096260875463486e-02 -4.0526211261749268e-01 + <_> + + 0 -1 688 6.3236099667847157e-03 + + -7.9116806387901306e-02 2.8413718938827515e-01 + <_> + + 0 -1 689 -4.8074051737785339e-03 + + 2.9990258812904358e-01 -8.2824081182479858e-02 + <_> + + 0 -1 690 7.6432302594184875e-02 + + 3.9146371185779572e-02 -5.7314342260360718e-01 + <_> + + 0 -1 691 7.0249952841550112e-04 + + 5.2832871675491333e-02 -3.3245471119880676e-01 + <_> + + 0 -1 692 -8.2157138967886567e-04 + + -2.1230019629001617e-01 8.8145829737186432e-02 + <_> + + 0 -1 693 -1.0148280300199986e-02 + + -2.2071610391139984e-01 9.6597403287887573e-02 + <_> + + 0 -1 694 -1.7348809540271759e-01 + + -5.9822201728820801e-01 3.2547060400247574e-02 + <_> + + 0 -1 695 4.3031540699303150e-03 + + -6.8253546953201294e-02 2.8981029987335205e-01 + <_> + + 0 -1 696 -7.3378678280278109e-06 + + 7.5155563652515411e-02 -2.5863590836524963e-01 + <_> + + 0 -1 697 1.9277239916846156e-03 + + 1.0856460034847260e-01 -1.6595140099525452e-01 + <_> + + 0 -1 698 -4.2054480873048306e-03 + + 1.9811309874057770e-01 -9.1941706836223602e-02 + <_> + + 0 -1 699 1.1466189753264189e-03 + + 4.2078729718923569e-02 -4.3991029262542725e-01 + <_> + + 0 -1 700 -6.7244949750602245e-03 + + 3.4456861019134521e-01 -5.7096958160400391e-02 + <_> + + 0 -1 701 -1.4554189874615986e-05 + + 1.1632560193538666e-01 -1.6252210736274719e-01 + <_> + + 0 -1 702 -2.6114559732377529e-03 + + 2.8084969520568848e-01 -6.8243041634559631e-02 + <_> + + 0 -1 703 -1.9477460591588169e-04 + + -1.9368860125541687e-01 9.3413226306438446e-02 + <_> + + 0 -1 704 2.6438338682055473e-04 + + 9.9354371428489685e-02 -2.1586629748344421e-01 + <_> + + 0 -1 705 2.0134719088673592e-03 + + -6.1209201812744141e-02 2.9120978713035583e-01 + <_> + + 0 -1 706 -2.6024359464645386e-01 + + -8.3802181482315063e-01 2.1150760352611542e-02 + <_> + + 0 -1 707 -1.5944700688123703e-02 + + -6.3974797725677490e-01 2.2144839167594910e-02 + <_> + + 0 -1 708 6.7249889252707362e-04 + + -1.4014090597629547e-01 1.2326350063085556e-01 + <_> + + 0 -1 709 1.3042770326137543e-02 + + 2.4306889623403549e-02 -6.6303068399429321e-01 + <_> + + 0 -1 710 -1.4540290067088790e-05 + + 9.0137362480163574e-02 -1.7409169673919678e-01 + <_> + + 0 -1 711 1.7920829355716705e-02 + + 2.5644620880484581e-02 -6.5067142248153687e-01 + <_> + + 0 -1 712 1.6542300581932068e-03 + + -1.0385700315237045e-01 1.6688160598278046e-01 + <_> + + 0 -1 713 3.5362090915441513e-02 + + 2.3093009367585182e-02 -6.9009417295455933e-01 + <_> + + 0 -1 714 3.3049840567400679e-05 + + -1.7408940196037292e-01 9.3873098492622375e-02 + <_> + + 0 -1 715 3.3775588963180780e-03 + + -5.8522459119558334e-02 3.0490559339523315e-01 + <_> + + 0 -1 716 7.3239738121628761e-03 + + 4.0999408811330795e-02 -4.6160981059074402e-01 + <_> + + 0 -1 717 -2.9797051101922989e-03 + + 5.1136761903762817e-01 -3.6246869713068008e-02 + <_> + + 0 -1 718 2.0306499209254980e-03 + + 6.5309353172779083e-02 -2.6698499917984009e-01 + <_> + + 0 -1 719 -6.8856950383633375e-04 + + -1.7604120075702667e-01 9.9361896514892578e-02 + <_> + + 0 -1 720 1.5746579738333821e-03 + + -1.0312269628047943e-01 1.6940550506114960e-01 + <_> + + 0 -1 721 1.5011089853942394e-03 + + -8.8128447532653809e-02 1.8899090588092804e-01 + <_> + + 0 -1 722 1.3503979425877333e-04 + + 9.4145476818084717e-02 -1.8483440577983856e-01 + <_> + + 0 -1 723 5.5570588447153568e-03 + + 2.9959060251712799e-02 -5.5482620000839233e-01 + <_> + + 0 -1 724 9.4529995694756508e-03 + + -5.3136389702558517e-02 4.0138289332389832e-01 + <_> + + 0 -1 725 -6.1030662618577480e-04 + + -2.7060449123382568e-01 6.6881351172924042e-02 + <_> + + 0 -1 726 -1.1329240351915359e-01 + + -6.5178507566452026e-01 2.5042990222573280e-02 + <_> + + 0 -1 727 -2.0354389562271535e-04 + + 1.0892420262098312e-01 -1.5174369513988495e-01 + <_> + + 0 -1 728 -1.4983189757913351e-03 + + 2.7388730645179749e-01 -5.8467049151659012e-02 + <_> + + 0 -1 729 7.5277159921824932e-03 + + 4.0991529822349548e-02 -4.2739889025688171e-01 + <_> + + 0 -1 730 3.6209179088473320e-03 + + -6.7309238016605377e-02 2.6064750552177429e-01 + <_> + + 0 -1 731 1.2153049930930138e-02 + + 5.0768271088600159e-02 -3.8319081068038940e-01 + <_> + + 0 -1 732 4.6126339584589005e-02 + + 2.4232989177107811e-02 -6.5039527416229248e-01 + <_> + + 0 -1 733 7.1408541407436132e-04 + + -1.3476370275020599e-01 1.2208549678325653e-01 + <_> + + 0 -1 734 -4.4331620447337627e-03 + + 1.9939610362052917e-01 -1.0218709707260132e-01 + <_> + + 0 -1 735 1.3099729549139738e-03 + + 7.4517026543617249e-02 -2.4503719806671143e-01 + <_> + + 0 -1 736 2.6161450659856200e-04 + + -8.4287956357002258e-02 1.9924600422382355e-01 + <_> + + 0 -1 737 -2.7577539440244436e-03 + + -6.8734467029571533e-01 2.4851109832525253e-02 + <_> + + 0 -1 738 6.9469690322875977e-02 + + 3.8438729941844940e-02 -3.9717179536819458e-01 + <_> + + 0 -1 739 -1.3031469425186515e-03 + + 2.0089949667453766e-01 -9.1723307967185974e-02 + <_> + + 0 -1 740 1.3012000126764178e-03 + + -9.5305852591991425e-02 1.9248190522193909e-01 + <_> + + 0 -1 741 -3.9377259090542793e-03 + + -3.9224091172218323e-01 4.3738011270761490e-02 + <_> + + 0 -1 742 9.6125707030296326e-02 + + -4.3269440531730652e-02 3.7441849708557129e-01 + <_> + + 0 -1 743 -1.9181859493255615e-01 + + -6.1320561170578003e-01 2.8775539249181747e-02 + <_> + + 0 -1 744 -3.2945619896054268e-03 + + -2.2446820139884949e-01 7.7655017375946045e-02 + <_> + + 0 -1 745 -8.5190916433930397e-03 + + 4.4720551371574402e-01 -4.1310388594865799e-02 + <_> + + 0 -1 746 -4.9431469291448593e-02 + + -5.1819682121276855e-01 3.6863740533590317e-02 + <_> + + 0 -1 747 2.3110879585146904e-02 + + -3.3078420907258987e-02 5.9146630764007568e-01 + <_> + + 0 -1 748 -4.3400399590609595e-05 + + 1.1395029723644257e-01 -1.9526299834251404e-01 + <_> + + 0 -1 749 5.4926839657127857e-03 + + 6.1616070568561554e-02 -2.5591990351676941e-01 + <_> + + 0 -1 750 1.1886029969900846e-03 + + -6.8509116768836975e-02 2.4291250109672546e-01 + <_> + + 0 -1 751 8.8473428040742874e-03 + + 7.6467283070087433e-02 -2.3176389932632446e-01 + <_> + + 0 -1 752 2.3952820338308811e-03 + + -4.4620860368013382e-02 4.5811769366264343e-01 + <_> + + 0 -1 753 -1.5011220239102840e-04 + + -1.6560749709606171e-01 1.0622239857912064e-01 + <_> + + 0 -1 754 -2.3465899750590324e-02 + + -2.4931310117244720e-01 6.6179357469081879e-02 + <_> + + 0 -1 755 -6.6368370316922665e-03 + + 1.4358420670032501e-01 -1.1510509997606277e-01 + <_> + + 0 -1 756 1.1986029567196965e-03 + + -9.8347522318363190e-02 1.7605540156364441e-01 + <_> + + 0 -1 757 7.9502072185277939e-03 + + 3.5481378436088562e-02 -5.0176638364791870e-01 + <_> + + 0 -1 758 -4.5950649655424058e-04 + + -1.6928760707378387e-01 9.3400083482265472e-02 + <_> + + 0 -1 759 -1.9301069900393486e-02 + + 4.1836661100387573e-01 -5.1140110939741135e-02 + <_> + + 0 -1 760 4.0163499116897583e-01 + + 2.9358919709920883e-02 -6.4768058061599731e-01 + <_> + 114 + -1.5384509563446045e+00 + + <_> + + 0 -1 761 -3.6284290254116058e-02 + + 4.2841899394989014e-01 -2.5840431451797485e-01 + <_> + + 0 -1 762 3.0520830303430557e-02 + + -2.9715040326118469e-01 2.1756610274314880e-01 + <_> + + 0 -1 763 3.3444820437580347e-03 + + -2.1734359860420227e-01 1.9754439592361450e-01 + <_> + + 0 -1 764 -1.3315919786691666e-03 + + 1.5535929799079895e-01 -2.3133680224418640e-01 + <_> + + 0 -1 765 -1.9773480016738176e-03 + + -4.2001301050186157e-01 8.8554427027702332e-02 + <_> + + 0 -1 766 -3.7038238951936364e-04 + + 1.2769789993762970e-01 -2.3879130184650421e-01 + <_> + + 0 -1 767 -7.3736459016799927e-03 + + -4.0720060467720032e-01 2.9765319079160690e-02 + <_> + + 0 -1 768 -2.1873020159546286e-05 + + 1.2338209897279739e-01 -2.2237089276313782e-01 + <_> + + 0 -1 769 4.5575048716273159e-05 + + -2.3092910647392273e-01 1.2953619658946991e-01 + <_> + + 0 -1 770 -1.1247170157730579e-02 + + -5.4762738943099976e-01 4.1907660663127899e-02 + <_> + + 0 -1 771 -8.9430268853902817e-03 + + 2.7945289015769958e-01 -9.0801216661930084e-02 + <_> + + 0 -1 772 1.4646670024376363e-05 + + -1.6777880489826202e-01 1.4968040585517883e-01 + <_> + + 0 -1 773 -6.5398351289331913e-03 + + 3.3654621243476868e-01 -7.1987256407737732e-02 + <_> + + 0 -1 774 3.3825531136244535e-03 + + 4.9931880086660385e-02 -4.5806300640106201e-01 + <_> + + 0 -1 775 2.7450500056147575e-03 + + 3.6119509488344193e-02 -5.7113862037658691e-01 + <_> + + 0 -1 776 1.0356379672884941e-02 + + -5.3049158304929733e-02 4.2121198773384094e-01 + <_> + + 0 -1 777 3.1687319278717041e-03 + + 6.2849938869476318e-02 -3.4674918651580811e-01 + <_> + + 0 -1 778 1.3616570504382253e-03 + + -9.0661056339740753e-02 2.5257480144500732e-01 + <_> + + 0 -1 779 -2.2238260135054588e-03 + + 2.6595190167427063e-01 -9.6649080514907837e-02 + <_> + + 0 -1 780 1.1090899817645550e-02 + + 8.6638063192367554e-02 -3.0103358626365662e-01 + <_> + + 0 -1 781 -6.7766150459647179e-04 + + 9.4277828931808472e-02 -2.1464149653911591e-01 + <_> + + 0 -1 782 -3.3104580361396074e-03 + + -5.9162640571594238e-01 3.2738488167524338e-02 + <_> + + 0 -1 783 2.3221869487315416e-03 + + -9.5557250082492828e-02 2.0546199381351471e-01 + <_> + + 0 -1 784 3.0947118648327887e-04 + + -1.2992270290851593e-01 1.7704719305038452e-01 + <_> + + 0 -1 785 -3.2214168459177017e-02 + + -6.4662492275238037e-01 3.1749259680509567e-02 + <_> + + 0 -1 786 -8.3192758029326797e-04 + + -3.0666750669479370e-01 6.1040591448545456e-02 + <_> + + 0 -1 787 3.9188290247693658e-04 + + -1.5795469284057617e-01 1.1830350011587143e-01 + <_> + + 0 -1 788 -3.6203738301992416e-02 + + -2.2731229662895203e-01 8.3183012902736664e-02 + <_> + + 0 -1 789 2.6437509804964066e-03 + + -7.6691061258316040e-02 2.3545509576797485e-01 + <_> + + 0 -1 790 -3.4368310589343309e-03 + + 3.6057031154632568e-01 -7.3672987520694733e-02 + <_> + + 0 -1 791 -5.5921601597219706e-04 + + -2.5343179702758789e-01 7.8275643289089203e-02 + <_> + + 0 -1 792 4.3010139052057639e-05 + + -1.8223099410533905e-01 9.7539380192756653e-02 + <_> + + 0 -1 793 5.3192679770290852e-03 + + -7.6901949942111969e-02 2.4221810698509216e-01 + <_> + + 0 -1 794 -6.9484501145780087e-03 + + -5.8275872468948364e-01 3.4601949155330658e-02 + <_> + + 0 -1 795 1.2447779998183250e-02 + + 2.3883659392595291e-02 -6.1712497472763062e-01 + <_> + + 0 -1 796 1.0083100060001016e-03 + + -7.5152181088924408e-02 2.4744270741939545e-01 + <_> + + 0 -1 797 -2.3544009309262037e-03 + + 3.1459400057792664e-01 -6.5026231110095978e-02 + <_> + + 0 -1 798 4.5676861191168427e-04 + + 7.9758197069168091e-02 -2.3777219653129578e-01 + <_> + + 0 -1 799 6.6723190248012543e-03 + + 3.8779199123382568e-02 -4.6045419573783875e-01 + <_> + + 0 -1 800 7.1861818469187710e-06 + + -1.3110539317131042e-01 1.2532530725002289e-01 + <_> + + 0 -1 801 3.0392590910196304e-02 + + 2.9670530930161476e-02 -5.3870928287506104e-01 + <_> + + 0 -1 802 1.4835850379313342e-05 + + -1.5778580307960510e-01 1.0566859692335129e-01 + <_> + + 0 -1 803 1.4415860176086426e-02 + + -7.6271347701549530e-02 3.0597710609436035e-01 + <_> + + 0 -1 804 3.2787520904093981e-03 + + 4.4464308768510818e-02 -3.8928028941154480e-01 + <_> + + 0 -1 805 1.0770520195364952e-02 + + -3.9324011653661728e-02 4.1493979096412659e-01 + <_> + + 0 -1 806 5.4678268497809768e-04 + + 5.8721691370010376e-02 -2.7546930313110352e-01 + <_> + + 0 -1 807 -1.8106499919667840e-03 + + 1.8281750380992889e-01 -9.3675427138805389e-02 + <_> + + 0 -1 808 1.1771249771118164e-01 + + 2.3175759240984917e-02 -7.0696681737899780e-01 + <_> + + 0 -1 809 -3.1166549888439476e-04 + + -2.0585930347442627e-01 7.6573841273784637e-02 + <_> + + 0 -1 810 -9.7939418628811836e-03 + + 4.8732680082321167e-01 -3.4746028482913971e-02 + <_> + + 0 -1 811 1.0002780472859740e-03 + + -1.1003620177507401e-01 1.5490560233592987e-01 + <_> + + 0 -1 812 6.9929230958223343e-03 + + 3.2923609018325806e-02 -5.4326117038726807e-01 + <_> + + 0 -1 813 3.4163020551204681e-02 + + 1.8062820658087730e-02 -7.0809149742126465e-01 + <_> + + 0 -1 814 -2.0808410644531250e-01 + + -6.7879611253738403e-01 2.0255820825695992e-02 + <_> + + 0 -1 815 2.4889659835025668e-04 + + -1.7719520628452301e-01 8.8152356445789337e-02 + <_> + + 0 -1 816 -9.3355607241392136e-03 + + 1.7948059737682343e-01 -9.4474621117115021e-02 + <_> + + 0 -1 817 2.9192469082772732e-04 + + -1.3786169886589050e-01 1.3819259405136108e-01 + <_> + + 0 -1 818 9.1989226639270782e-03 + + -1.0269109904766083e-01 1.7618100345134735e-01 + <_> + + 0 -1 819 6.8165437551215291e-04 + + 7.4821308255195618e-02 -2.3621830344200134e-01 + <_> + + 0 -1 820 -1.4507620107906405e-05 + + 9.5861770212650299e-02 -1.7785739898681641e-01 + <_> + + 0 -1 821 1.7662490427028388e-04 + + -1.3805359601974487e-01 1.3394320011138916e-01 + <_> + + 0 -1 822 -1.7513500060886145e-03 + + 7.7623583376407623e-02 -2.3174029588699341e-01 + <_> + + 0 -1 823 5.1342020742595196e-03 + + 3.0363969504833221e-02 -5.2420848608016968e-01 + <_> + + 0 -1 824 9.4114318490028381e-03 + + -5.8994568884372711e-02 3.0291381478309631e-01 + <_> + + 0 -1 825 -1.0448819957673550e-03 + + -1.7124690115451813e-01 1.0156030207872391e-01 + <_> + + 0 -1 826 -6.3579198904335499e-03 + + 3.1986710429191589e-01 -5.0694450736045837e-02 + <_> + + 0 -1 827 -6.3502117991447449e-03 + + -5.2413272857666016e-01 3.1800068914890289e-02 + <_> + + 0 -1 828 1.2251759879291058e-02 + + 1.6559680923819542e-02 -7.9422187805175781e-01 + <_> + + 0 -1 829 -1.4000720344483852e-02 + + -5.4444402456283569e-01 2.4652559310197830e-02 + <_> + + 0 -1 830 1.9229920580983162e-03 + + -7.6944977045059204e-02 2.1888209879398346e-01 + <_> + + 0 -1 831 -3.4030789975076914e-03 + + 3.0143401026725769e-01 -5.8023329824209213e-02 + <_> + + 0 -1 832 -2.7728609740734100e-02 + + -5.6704998016357422e-01 3.0071720480918884e-02 + <_> + + 0 -1 833 1.4990579802542925e-04 + + 9.1404616832733154e-02 -1.6989429295063019e-01 + <_> + + 0 -1 834 -1.4532960449287202e-05 + + 1.0442660003900528e-01 -1.3983349502086639e-01 + <_> + + 0 -1 835 2.8315950185060501e-02 + + 1.7812129110097885e-02 -8.1201279163360596e-01 + <_> + + 0 -1 836 -1.7363600200042129e-03 + + 1.9688630104064941e-01 -7.6398819684982300e-02 + <_> + + 0 -1 837 -2.2081490606069565e-02 + + 4.4497510790824890e-01 -3.3445868641138077e-02 + <_> + + 0 -1 838 1.2189210392534733e-03 + + 4.9154780805110931e-02 -3.7790310382843018e-01 + <_> + + 0 -1 839 -5.4838892538100481e-04 + + -2.2823029756546021e-01 8.0446496605873108e-02 + <_> + + 0 -1 840 -9.3702552840113640e-04 + + 2.5258961319923401e-01 -6.5389201045036316e-02 + <_> + + 0 -1 841 1.2496720068156719e-02 + + 3.8215879350900650e-02 -4.0465530753135681e-01 + <_> + + 0 -1 842 -1.6764370724558830e-02 + + -1.4508719742298126e-01 1.2119810283184052e-01 + <_> + + 0 -1 843 5.6504327803850174e-03 + + -8.7139137089252472e-02 2.2194419801235199e-01 + <_> + + 0 -1 844 5.2610319107770920e-04 + + 8.7222076952457428e-02 -2.0502470433712006e-01 + <_> + + 0 -1 845 1.5574200078845024e-03 + + -1.7036689817905426e-01 9.4435282051563263e-02 + <_> + + 0 -1 846 2.5609090924263000e-01 + + 1.7790110781788826e-02 -7.4050921201705933e-01 + <_> + + 0 -1 847 3.3561999443918467e-03 + + -4.2667269706726074e-02 3.7573391199111938e-01 + <_> + + 0 -1 848 4.7072928398847580e-02 + + 3.2015219330787659e-02 -6.4522278308868408e-01 + <_> + + 0 -1 849 -2.2168930154293776e-03 + + 2.0757040381431580e-01 -7.7372692525386810e-02 + <_> + + 0 -1 850 5.0796428695321083e-03 + + 4.1829328984022141e-02 -3.7722969055175781e-01 + <_> + + 0 -1 851 7.0120906457304955e-05 + + 8.1031888723373413e-02 -1.8506260216236115e-01 + <_> + + 0 -1 852 -5.2204862004145980e-04 + + 1.2528459727764130e-01 -1.3090319931507111e-01 + <_> + + 0 -1 853 -6.1609707772731781e-03 + + 3.1177788972854614e-01 -5.1252178847789764e-02 + <_> + + 0 -1 854 -2.8424879908561707e-01 + + -7.0340508222579956e-01 2.2811079397797585e-02 + <_> + + 0 -1 855 -4.1746720671653748e-02 + + -7.8914260864257812e-01 1.6686350107192993e-02 + <_> + + 0 -1 856 -1.0051350109279156e-03 + + -2.2181299328804016e-01 6.1887398362159729e-02 + <_> + + 0 -1 857 -1.3900640187785029e-03 + + 1.8797479569911957e-01 -7.6582401990890503e-02 + <_> + + 0 -1 858 -4.0118378819897771e-04 + + -1.7291170358657837e-01 8.6806759238243103e-02 + <_> + + 0 -1 859 -2.9202610676293261e-05 + + 9.2319779098033905e-02 -1.7136460542678833e-01 + <_> + + 0 -1 860 -2.6532830670475960e-03 + + 3.9422848820686340e-01 -3.9826449006795883e-02 + <_> + + 0 -1 861 -7.8933471813797951e-03 + + -4.3326890468597412e-01 3.6603361368179321e-02 + <_> + + 0 -1 862 8.7933447211980820e-03 + + -3.3205948770046234e-02 4.8740789294242859e-01 + <_> + + 0 -1 863 1.2014759704470634e-02 + + 2.2244220599532127e-02 -8.1597268581390381e-01 + <_> + + 0 -1 864 2.1147020161151886e-03 + + 6.4942933619022369e-02 -2.0959229767322540e-01 + <_> + + 0 -1 865 -9.9916034378111362e-04 + + 1.5402349829673767e-01 -1.0149469971656799e-01 + <_> + + 0 -1 866 -7.6499581336975098e-04 + + 2.0236450433731079e-01 -7.1199662983417511e-02 + <_> + + 0 -1 867 -4.2193511035293341e-04 + + 1.1521430313587189e-01 -1.2845459580421448e-01 + <_> + + 0 -1 868 -4.1548791341483593e-04 + + -2.1168529987335205e-01 7.0376142859458923e-02 + <_> + + 0 -1 869 1.5300279483199120e-03 + + 6.1263758689165115e-02 -2.2269320487976074e-01 + <_> + + 0 -1 870 -2.6573969516903162e-03 + + 3.8462328910827637e-01 -3.8276020437479019e-02 + <_> + + 0 -1 871 -2.1988600492477417e-01 + + -5.1546782255172729e-01 2.8099389746785164e-02 + <_> + + 0 -1 872 -8.7377207819372416e-04 + + 1.0149329900741577e-01 -1.3990689814090729e-01 + <_> + + 0 -1 873 7.5169820338487625e-03 + + -6.1671640723943710e-02 2.5486430525779724e-01 + <_> + + 0 -1 874 -1.3438290625344962e-04 + + -1.6618040204048157e-01 8.8938876986503601e-02 + <_> + 117 + -1.5079799890518188e+00 + + <_> + + 0 -1 875 3.5007519181817770e-03 + + -2.8256690502166748e-01 3.3628109097480774e-01 + <_> + + 0 -1 876 4.1042729280889034e-03 + + -1.5877629816532135e-01 3.4091961383819580e-01 + <_> + + 0 -1 877 9.8724407143890858e-04 + + -4.6094760298728943e-01 1.1771719902753830e-01 + <_> + + 0 -1 878 -4.0168981067836285e-03 + + 1.3994920253753662e-01 -3.8476601243019104e-01 + <_> + + 0 -1 879 -4.2784500867128372e-02 + + 3.1519949436187744e-01 -1.1673810333013535e-01 + <_> + + 0 -1 880 -5.6273501832038164e-04 + + 8.2315109670162201e-02 -3.3594700694084167e-01 + <_> + + 0 -1 881 -4.3416650441940874e-05 + + 1.0691779851913452e-01 -2.5068029761314392e-01 + <_> + + 0 -1 882 1.5347570180892944e-02 + + 9.7383828833699226e-03 -6.4612430334091187e-01 + <_> + + 0 -1 883 1.8295480404049158e-03 + + 8.9164443314075470e-02 -2.9637640714645386e-01 + <_> + + 0 -1 884 3.2098879455588758e-04 + + -2.3136790096759796e-01 1.1478479951620102e-01 + <_> + + 0 -1 885 1.0728760389611125e-03 + + -1.2982189655303955e-01 1.9653689861297607e-01 + <_> + + 0 -1 886 -4.9566011875867844e-03 + + 3.5313999652862549e-01 -7.6989777386188507e-02 + <_> + + 0 -1 887 -1.6319400165230036e-03 + + -2.3701989650726318e-01 1.0319659858942032e-01 + <_> + + 0 -1 888 1.9862050190567970e-02 + + 5.9187598526477814e-02 -4.0955111384391785e-01 + <_> + + 0 -1 889 -9.5205483958125114e-03 + + 3.9061769843101501e-01 -5.7647578418254852e-02 + <_> + + 0 -1 890 -1.0885810479521751e-03 + + -5.2902680635452271e-01 4.4961001724004745e-02 + <_> + + 0 -1 891 3.5348529927432537e-03 + + -9.2707537114620209e-02 2.4449980258941650e-01 + <_> + + 0 -1 892 5.7174800895154476e-03 + + 5.7306189090013504e-02 -3.9878991246223450e-01 + <_> + + 0 -1 893 -1.4010589802637696e-03 + + 1.0757780075073242e-01 -1.9520820677280426e-01 + <_> + + 0 -1 894 -2.2306239698082209e-03 + + -6.1328327655792236e-01 2.7875339612364769e-02 + <_> + + 0 -1 895 -5.0583072006702423e-03 + + -5.4739731550216675e-01 3.0482530593872070e-02 + <_> + + 0 -1 896 1.3725720345973969e-01 + + 2.8162300586700439e-02 -6.0817748308181763e-01 + <_> + + 0 -1 897 3.7828299682587385e-03 + + -1.2640979886054993e-01 1.3382309675216675e-01 + <_> + + 0 -1 898 -1.0629029944539070e-02 + + -1.7343379557132721e-01 9.9954582750797272e-02 + <_> + + 0 -1 899 5.6623672135174274e-03 + + -5.2419230341911316e-02 3.2940819859504700e-01 + <_> + + 0 -1 900 -4.5901038683950901e-03 + + 1.8784660100936890e-01 -9.2681042850017548e-02 + <_> + + 0 -1 901 7.1088741533458233e-03 + + 3.2605409622192383e-02 -5.7968139648437500e-01 + <_> + + 0 -1 902 -1.9310249481350183e-03 + + -2.8707239031791687e-01 5.8658700436353683e-02 + <_> + + 0 -1 903 3.5559700336307287e-03 + + -6.2841393053531647e-02 3.0232760310173035e-01 + <_> + + 0 -1 904 2.1007249597460032e-04 + + -1.2029449641704559e-01 2.0722889900207520e-01 + <_> + + 0 -1 905 3.0181880574673414e-03 + + 4.2764421552419662e-02 -4.5567208528518677e-01 + <_> + + 0 -1 906 -2.0919379312545061e-03 + + -5.8067041635513306e-01 2.4772390723228455e-02 + <_> + + 0 -1 907 4.9380292184650898e-03 + + -6.7825779318809509e-02 2.6715460419654846e-01 + <_> + + 0 -1 908 1.0227119782939553e-03 + + -1.1050579696893692e-01 1.7136010527610779e-01 + <_> + + 0 -1 909 -9.1216713190078735e-02 + + -5.5617409944534302e-01 3.1176509335637093e-02 + <_> + + 0 -1 910 1.9377609714865685e-03 + + 5.2470069378614426e-02 -3.3402100205421448e-01 + <_> + + 0 -1 911 -4.5235231518745422e-03 + + -3.8628038763999939e-01 4.4883530586957932e-02 + <_> + + 0 -1 912 1.1070469627156854e-03 + + -9.4648011028766632e-02 1.7694370448589325e-01 + <_> + + 0 -1 913 -1.4522889629006386e-02 + + -4.4854640960693359e-01 4.0654070675373077e-02 + <_> + + 0 -1 914 2.0895639434456825e-02 + + 3.5988390445709229e-02 -4.4317048788070679e-01 + <_> + + 0 -1 915 7.3273790803796146e-06 + + -1.9736979901790619e-01 8.8131763041019440e-02 + <_> + + 0 -1 916 -1.4750339687452652e-05 + + 8.8203012943267822e-02 -1.9387699663639069e-01 + <_> + + 0 -1 917 1.0160019621253014e-02 + + -7.3683522641658783e-02 2.7725589275360107e-01 + <_> + + 0 -1 918 1.4658429790870287e-05 + + -1.3514040410518646e-01 1.1165390163660049e-01 + <_> + + 0 -1 919 2.9789519030600786e-03 + + -5.6356389075517654e-02 2.9033899307250977e-01 + <_> + + 0 -1 920 6.7907930351793766e-03 + + -5.5468060076236725e-02 2.9650750756263733e-01 + <_> + + 0 -1 921 3.5746619105339050e-02 + + 4.4232271611690521e-02 -3.7943100929260254e-01 + <_> + + 0 -1 922 -8.6023868061602116e-04 + + -2.5524240732192993e-01 6.3983328640460968e-02 + <_> + + 0 -1 923 -3.2749359961599112e-03 + + 5.1642370223999023e-01 -3.0802410095930099e-02 + <_> + + 0 -1 924 -1.4287419617176056e-04 + + -1.7014829814434052e-01 9.0200550854206085e-02 + <_> + + 0 -1 925 -5.9252060949802399e-02 + + 4.4787400960922241e-01 -3.4802999347448349e-02 + <_> + + 0 -1 926 4.9169741570949554e-02 + + 4.3797228485345840e-02 -3.9337700605392456e-01 + <_> + + 0 -1 927 2.4047859478741884e-03 + + -8.5982158780097961e-02 1.7597770690917969e-01 + <_> + + 0 -1 928 -8.8569998741149902e-02 + + -2.9694429039955139e-01 5.6752521544694901e-02 + <_> + + 0 -1 929 3.5266599152237177e-03 + + -5.4160539060831070e-02 3.2359990477561951e-01 + <_> + + 0 -1 930 -1.4674359590571839e-05 + + 1.0095299780368805e-01 -1.7195940017700195e-01 + <_> + + 0 -1 931 -1.0672880336642265e-02 + + -3.9103358983993530e-01 3.9687499403953552e-02 + <_> + + 0 -1 932 -1.3177569955587387e-02 + + 2.7460250258445740e-01 -5.5524408817291260e-02 + <_> + + 0 -1 933 -2.0427990239113569e-03 + + -3.2616940140724182e-01 5.1151938736438751e-02 + <_> + + 0 -1 934 2.5430709123611450e-02 + + 3.4412149339914322e-02 -3.9120680093765259e-01 + <_> + + 0 -1 935 6.6575622186064720e-03 + + -6.2124639749526978e-02 2.5493910908699036e-01 + <_> + + 0 -1 936 -2.4922629818320274e-02 + + -7.5617647171020508e-01 2.0520050078630447e-02 + <_> + + 0 -1 937 6.4869478344917297e-02 + + 1.3535760343074799e-02 -8.5182607173919678e-01 + <_> + + 0 -1 938 -1.9129139836877584e-03 + + -2.0609579980373383e-01 6.8809613585472107e-02 + <_> + + 0 -1 939 -2.7280850335955620e-03 + + 1.3853220641613007e-01 -1.1308959871530533e-01 + <_> + + 0 -1 940 3.9647668600082397e-03 + + -8.5980050265789032e-02 1.8867929279804230e-01 + <_> + + 0 -1 941 8.6866566562093794e-05 + + -1.3409359753131866e-01 1.1543890088796616e-01 + <_> + + 0 -1 942 -1.0680439881980419e-03 + + 2.4043959379196167e-01 -5.9584230184555054e-02 + <_> + + 0 -1 943 6.4973197877407074e-03 + + 3.5721741616725922e-02 -4.3827891349792480e-01 + <_> + + 0 -1 944 3.3825050923041999e-04 + + 7.5188770890235901e-02 -1.9240869581699371e-01 + <_> + + 0 -1 945 2.4638089817017317e-03 + + -3.8108248263597488e-02 4.1398531198501587e-01 + <_> + + 0 -1 946 7.1629788726568222e-04 + + 6.7675560712814331e-02 -2.3129940032958984e-01 + <_> + + 0 -1 947 -1.1354340240359306e-03 + + 1.6413919627666473e-01 -9.8224140703678131e-02 + <_> + + 0 -1 948 -4.6024488983675838e-04 + + 7.8879103064537048e-02 -1.8191289901733398e-01 + <_> + + 0 -1 949 -8.1474315375089645e-03 + + -1.8627829849720001e-01 7.7696673572063446e-02 + <_> + + 0 -1 950 -3.3882331103086472e-02 + + 4.1818460822105408e-01 -4.0109351277351379e-02 + <_> + + 0 -1 951 -4.3395790271461010e-03 + + 1.8961839377880096e-01 -8.3509556949138641e-02 + <_> + + 0 -1 952 2.4691419675946236e-03 + + 4.3756991624832153e-02 -3.8284140825271606e-01 + <_> + + 0 -1 953 8.7688177824020386e-02 + + 2.3466430604457855e-02 -5.9991317987442017e-01 + <_> + + 0 -1 954 7.1277258939517196e-06 + + -1.4574949443340302e-01 9.4181038439273834e-02 + <_> + + 0 -1 955 -2.2863550111651421e-03 + + 2.2176849842071533e-01 -6.2630541622638702e-02 + <_> + + 0 -1 956 -1.4718780221301131e-05 + + 1.1210440099239349e-01 -1.3407769799232483e-01 + <_> + + 0 -1 957 2.9124629218131304e-03 + + -6.1113931238651276e-02 2.6921069622039795e-01 + <_> + + 0 -1 958 -7.2532321792095900e-04 + + -1.8317590653896332e-01 9.0204723179340363e-02 + <_> + + 0 -1 959 -1.7109309555962682e-03 + + -2.9150980710983276e-01 5.6865800172090530e-02 + <_> + + 0 -1 960 3.5050138831138611e-02 + + 2.4259999394416809e-02 -5.9926068782806396e-01 + <_> + + 0 -1 961 2.5119259953498840e-02 + + -4.6499390155076981e-02 3.3078059554100037e-01 + <_> + + 0 -1 962 1.3924979604780674e-02 + + 5.4394099861383438e-02 -3.2431459426879883e-01 + <_> + + 0 -1 963 1.2507860083132982e-03 + + -8.6275100708007812e-02 1.6083979606628418e-01 + <_> + + 0 -1 964 3.2347340602427721e-03 + + 4.0214668959379196e-02 -3.3414369821548462e-01 + <_> + + 0 -1 965 2.3993090726435184e-03 + + -3.6099448800086975e-02 4.0332961082458496e-01 + <_> + + 0 -1 966 -6.4468860626220703e-02 + + -9.2355471849441528e-01 1.7104439437389374e-02 + <_> + + 0 -1 967 2.6983879506587982e-02 + + -4.1323971003293991e-02 3.8095420598983765e-01 + <_> + + 0 -1 968 -1.4244250451156404e-05 + + 9.8453678190708160e-02 -1.3854749500751495e-01 + <_> + + 0 -1 969 3.6304299719631672e-03 + + 2.2532820701599121e-02 -5.7740187644958496e-01 + <_> + + 0 -1 970 -2.7509450446814299e-03 + + 2.8656649589538574e-01 -4.9012679606676102e-02 + <_> + + 0 -1 971 3.4084690269082785e-03 + + 3.8566160947084427e-02 -3.5187271237373352e-01 + <_> + + 0 -1 972 -2.0442469976842403e-03 + + 1.5499830245971680e-01 -8.1280998885631561e-02 + <_> + + 0 -1 973 -3.3763761166483164e-04 + + -1.8969820439815521e-01 7.3497541248798370e-02 + <_> + + 0 -1 974 -1.9649739842861891e-03 + + 2.4030299484729767e-01 -5.3698450326919556e-02 + <_> + + 0 -1 975 2.6115038781426847e-04 + + -1.0585899651050568e-01 1.4551800489425659e-01 + <_> + + 0 -1 976 -2.4496200494468212e-03 + + -3.3511948585510254e-01 4.3949641287326813e-02 + <_> + + 0 -1 977 2.5791170075535774e-02 + + 1.9443970173597336e-02 -6.3135677576065063e-01 + <_> + + 0 -1 978 -1.7996380338445306e-03 + + 1.5620160102844238e-01 -8.9669622480869293e-02 + <_> + + 0 -1 979 -5.5190739221870899e-03 + + 3.8429600000381470e-01 -3.9308220148086548e-02 + <_> + + 0 -1 980 9.3076081248000264e-04 + + 5.3146060556173325e-02 -2.7482900023460388e-01 + <_> + + 0 -1 981 2.7754770126193762e-03 + + -5.3488280624151230e-02 2.4878840148448944e-01 + <_> + + 0 -1 982 1.9387940410524607e-03 + + 7.5177863240242004e-02 -1.9432419538497925e-01 + <_> + + 0 -1 983 -4.0069930255413055e-03 + + -2.7330648899078369e-01 6.2000360339879990e-02 + <_> + + 0 -1 984 7.4540930800139904e-03 + + -5.0977949053049088e-02 2.7055469155311584e-01 + <_> + + 0 -1 985 -1.6338729765266180e-03 + + 1.0920850187540054e-01 -1.4821110665798187e-01 + <_> + + 0 -1 986 -1.1626870185136795e-01 + + -9.4307368993759155e-01 1.4511439949274063e-02 + <_> + + 0 -1 987 -1.2051310390233994e-02 + + -3.0964991450309753e-01 3.7726309150457382e-02 + <_> + + 0 -1 988 1.5592000447213650e-02 + + -3.8526348769664764e-02 3.6706140637397766e-01 + <_> + + 0 -1 989 -1.1198739521205425e-03 + + -1.4644260704517365e-01 9.6057042479515076e-02 + <_> + + 0 -1 990 -1.4623399692936800e-05 + + 1.0641819983720779e-01 -1.3394460082054138e-01 + <_> + + 0 -1 991 -1.0319639742374420e-01 + + -7.0196557044982910e-01 1.8891770392656326e-02 + <_> + 121 + -1.4499469995498657e+00 + + <_> + + 0 -1 992 -3.7469431757926941e-02 + + 2.9079249501228333e-01 -3.5205191373825073e-01 + <_> + + 0 -1 993 4.0861819870769978e-03 + + -2.9098600149154663e-01 1.8445029854774475e-01 + <_> + + 0 -1 994 -9.2446897178888321e-04 + + 1.1087530106306076e-01 -4.1064518690109253e-01 + <_> + + 0 -1 995 8.5803697584196925e-04 + + -2.2129820287227631e-01 1.5465059876441956e-01 + <_> + + 0 -1 996 2.3659599537495524e-04 + + -3.2185178995132446e-01 1.1183690279722214e-01 + <_> + + 0 -1 997 -3.5021029412746429e-02 + + 2.2721460461616516e-01 -1.4156529307365417e-01 + <_> + + 0 -1 998 -3.4688229206949472e-03 + + -4.0247380733489990e-01 4.3791528791189194e-02 + <_> + + 0 -1 999 5.0372090190649033e-03 + + -1.2387280166149139e-01 2.2701320052146912e-01 + <_> + + 0 -1 1000 -1.1929610045626760e-03 + + -4.8692488670349121e-01 5.2568510174751282e-02 + <_> + + 0 -1 1001 9.5561221241950989e-03 + + -4.6204000711441040e-02 5.1149028539657593e-01 + <_> + + 0 -1 1002 1.1109219631180167e-03 + + 4.5496881008148193e-02 -4.5278310775756836e-01 + <_> + + 0 -1 1003 5.7835641200654209e-05 + + -1.5641710162162781e-01 1.3276909291744232e-01 + <_> + + 0 -1 1004 -9.4595848349854350e-04 + + -2.8471308946609497e-01 6.4549557864665985e-02 + <_> + + 0 -1 1005 8.8587577920407057e-04 + + 6.5990276634693146e-02 -3.2505878806114197e-01 + <_> + + 0 -1 1006 2.1180589683353901e-03 + + -7.1820907294750214e-02 3.3132740855216980e-01 + <_> + + 0 -1 1007 -1.6004469245672226e-02 + + -4.9266660213470459e-01 3.5758759826421738e-02 + <_> + + 0 -1 1008 1.4956319937482476e-03 + + -8.3095543086528778e-02 2.7613210678100586e-01 + <_> + + 0 -1 1009 7.5204619206488132e-03 + + 2.6987679302692413e-02 -6.5507948398590088e-01 + <_> + + 0 -1 1010 -1.4567610378435347e-05 + + 1.1181929707527161e-01 -1.8279710412025452e-01 + <_> + + 0 -1 1011 1.5564640052616596e-03 + + -1.5681059658527374e-01 1.1271400004625320e-01 + <_> + + 0 -1 1012 -3.6522798240184784e-02 + + -1.4254869520664215e-01 1.3022269308567047e-01 + <_> + + 0 -1 1013 9.4677843153476715e-03 + + -4.3431900441646576e-02 3.6521318554878235e-01 + <_> + + 0 -1 1014 -1.4508370441035368e-05 + + 8.4056511521339417e-02 -2.0373860001564026e-01 + <_> + + 0 -1 1015 9.7979931160807610e-04 + + -9.2570282518863678e-02 1.9765810668468475e-01 + <_> + + 0 -1 1016 1.4909260244166944e-05 + + -1.4167930185794830e-01 1.2542089819908142e-01 + <_> + + 0 -1 1017 -2.1510709484573454e-04 + + 2.0154480636119843e-01 -8.0978751182556152e-02 + <_> + + 0 -1 1018 -1.3552160235121846e-03 + + -3.9648211002349854e-01 4.5137099921703339e-02 + <_> + + 0 -1 1019 8.4163509309291840e-03 + + -7.5962640345096588e-02 2.2327689826488495e-01 + <_> + + 0 -1 1020 -3.0116800917312503e-04 + + -1.9837650656700134e-01 8.5917882621288300e-02 + <_> + + 0 -1 1021 9.7665376961231232e-04 + + 6.1060719192028046e-02 -3.1315010786056519e-01 + <_> + + 0 -1 1022 1.9718110561370850e-03 + + -5.4124880582094193e-02 3.2931008934974670e-01 + <_> + + 0 -1 1023 6.4220376312732697e-02 + + 3.1034920364618301e-02 -5.8339309692382812e-01 + <_> + + 0 -1 1024 -4.8852190375328064e-03 + + 1.8666909635066986e-01 -8.5492432117462158e-02 + <_> + + 0 -1 1025 -2.5309080956503749e-04 + + -1.6574999690055847e-01 9.2472381889820099e-02 + <_> + + 0 -1 1026 2.9818940674886107e-05 + + -1.4195050299167633e-01 1.0154379904270172e-01 + <_> + + 0 -1 1027 -1.0288760066032410e-02 + + 2.5133699178695679e-01 -5.9286661446094513e-02 + <_> + + 0 -1 1028 -2.9165179512347095e-05 + + 1.2957669794559479e-01 -1.1733850091695786e-01 + <_> + + 0 -1 1029 -2.0741471089422703e-03 + + -2.2633939981460571e-01 6.6792942583560944e-02 + <_> + + 0 -1 1030 1.1343799997121096e-03 + + -6.3913702964782715e-02 2.7956250309944153e-01 + <_> + + 0 -1 1031 -1.5007710317149758e-05 + + 1.3454750180244446e-01 -1.1705060303211212e-01 + <_> + + 0 -1 1032 4.9826782196760178e-03 + + 2.6505010202527046e-02 -6.0010671615600586e-01 + <_> + + 0 -1 1033 -3.4576859325170517e-03 + + 3.1286209821701050e-01 -5.4155170917510986e-02 + <_> + + 0 -1 1034 5.4344828240573406e-03 + + 2.8702750802040100e-02 -5.6824082136154175e-01 + <_> + + 0 -1 1035 -1.4558049770130310e-05 + + 1.0756780207157135e-01 -1.3127699494361877e-01 + <_> + + 0 -1 1036 1.5321969985961914e-03 + + -1.1911620199680328e-01 1.4021439850330353e-01 + <_> + + 0 -1 1037 -2.2449430078268051e-02 + + -3.3376368880271912e-01 4.9373220652341843e-02 + <_> + + 0 -1 1038 1.1923030018806458e-02 + + 6.3558742403984070e-02 -2.4746930599212646e-01 + <_> + + 0 -1 1039 2.0685950294137001e-02 + + -6.1905119568109512e-02 2.6367300748825073e-01 + <_> + + 0 -1 1040 5.0756777636706829e-04 + + -1.2528319656848907e-01 1.4505800604820251e-01 + <_> + + 0 -1 1041 9.2508539091795683e-04 + + 5.9009589254856110e-02 -2.6204380393028259e-01 + <_> + + 0 -1 1042 8.6694798665121198e-04 + + -8.8942721486091614e-02 1.7795750498771667e-01 + <_> + + 0 -1 1043 4.7340960009023547e-04 + + 6.8137630820274353e-02 -2.1880300343036652e-01 + <_> + + 0 -1 1044 9.0366601943969727e-02 + + 1.8516469746828079e-02 -6.5736871957778931e-01 + <_> + + 0 -1 1045 2.0585930906236172e-03 + + -4.5568998903036118e-02 3.2879421114921570e-01 + <_> + + 0 -1 1046 -4.0761628188192844e-03 + + -3.5896709561347961e-01 4.0903490036725998e-02 + <_> + + 0 -1 1047 3.2309619709849358e-03 + + -5.8772470802068710e-02 2.5518509745597839e-01 + <_> + + 0 -1 1048 2.0424150861799717e-03 + + 4.3209441006183624e-02 -3.3393308520317078e-01 + <_> + + 0 -1 1049 -2.8341729193925858e-04 + + -1.6685059666633606e-01 8.1555336713790894e-02 + <_> + + 0 -1 1050 -1.0859699686989188e-03 + + 1.7807449400424957e-01 -9.2171236872673035e-02 + <_> + + 0 -1 1051 -2.0089520141482353e-02 + + -3.5236391425132751e-01 4.4607751071453094e-02 + <_> + + 0 -1 1052 -1.8073120154440403e-03 + + 3.0220940709114075e-01 -5.2047580480575562e-02 + <_> + + 0 -1 1053 1.0337149724364281e-02 + + 2.4787139147520065e-02 -6.8838161230087280e-01 + <_> + + 0 -1 1054 -2.4023749865591526e-03 + + 3.3173340559005737e-01 -4.6199489384889603e-02 + <_> + + 0 -1 1055 -5.8347097365185618e-04 + + -1.8856820464134216e-01 7.7347792685031891e-02 + <_> + + 0 -1 1056 -2.1759211085736752e-03 + + 3.3067348599433899e-01 -4.0855869650840759e-02 + <_> + + 0 -1 1057 -1.1984390439465642e-03 + + -2.1580339968204498e-01 6.8534582853317261e-02 + <_> + + 0 -1 1058 1.4474330237135291e-03 + + -5.8074928820133209e-02 2.3362369835376740e-01 + <_> + + 0 -1 1059 5.1625841297209263e-04 + + 7.5655579566955566e-02 -2.0956470072269440e-01 + <_> + + 0 -1 1060 -1.4388939598575234e-03 + + -3.0948141217231750e-01 5.8159999549388885e-02 + <_> + + 0 -1 1061 -1.7495449865236878e-03 + + 1.0236290097236633e-01 -1.5715239942073822e-01 + <_> + + 0 -1 1062 1.6774939373135567e-02 + + 2.3711699992418289e-02 -5.8594572544097900e-01 + <_> + + 0 -1 1063 -8.3265192806720734e-03 + + 3.0943349003791809e-01 -4.8807561397552490e-02 + <_> + + 0 -1 1064 -4.4853150029666722e-05 + + 1.0615509748458862e-01 -1.3089710474014282e-01 + <_> + + 0 -1 1065 5.9908269904553890e-03 + + 8.0168873071670532e-02 -1.6817809641361237e-01 + <_> + + 0 -1 1066 1.4110070187598467e-03 + + -6.9941587746143341e-02 2.2045080363750458e-01 + <_> + + 0 -1 1067 4.1205998510122299e-02 + + 3.1721431761980057e-02 -4.4176858663558960e-01 + <_> + + 0 -1 1068 1.5044870087876916e-04 + + -1.2152300029993057e-01 1.1241420358419418e-01 + <_> + + 0 -1 1069 -4.8399530351161957e-03 + + 2.8244999051094055e-01 -5.1606610417366028e-02 + <_> + + 0 -1 1070 -1.0831269901245832e-03 + + -1.6978019475936890e-01 8.3731047809123993e-02 + <_> + + 0 -1 1071 -1.3483200222253799e-02 + + 2.8269320726394653e-01 -5.2228599786758423e-02 + <_> + + 0 -1 1072 5.9854640858247876e-04 + + -1.3749149441719055e-01 1.2280890345573425e-01 + <_> + + 0 -1 1073 -6.4943352481350303e-04 + + -1.6931599378585815e-01 8.8171690702438354e-02 + <_> + + 0 -1 1074 -6.3191158697009087e-03 + + 1.6245460510253906e-01 -8.6300060153007507e-02 + <_> + + 0 -1 1075 -2.5179239455610514e-03 + + -3.1853398680686951e-01 5.2688188850879669e-02 + <_> + + 0 -1 1076 -4.6924971044063568e-02 + + -6.5773141384124756e-01 2.0505079999566078e-02 + <_> + + 0 -1 1077 -9.6446421230211854e-04 + + -2.7256599068641663e-01 4.5441299676895142e-02 + <_> + + 0 -1 1078 1.5073099639266729e-03 + + -5.0479460507631302e-02 2.8486481308937073e-01 + <_> + + 0 -1 1079 1.6149930655956268e-02 + + 3.8769058883190155e-02 -3.6149570345878601e-01 + <_> + + 0 -1 1080 1.9126510247588158e-02 + + -3.6233641207218170e-02 4.7573548555374146e-01 + <_> + + 0 -1 1081 -1.2546279467642307e-03 + + 1.1009909957647324e-01 -1.5554140508174896e-01 + <_> + + 0 -1 1082 -1.4754529729543719e-05 + + 9.6549153327941895e-02 -1.3947430253028870e-01 + <_> + + 0 -1 1083 1.5680169686675072e-02 + + 2.3214520886540413e-02 -5.7713180780410767e-01 + <_> + + 0 -1 1084 1.2293360196053982e-02 + + -5.7809889316558838e-02 2.3951390385627747e-01 + <_> + + 0 -1 1085 -9.6596255898475647e-03 + + 2.4098740518093109e-01 -6.5823532640933990e-02 + <_> + + 0 -1 1086 4.4940081425011158e-03 + + 5.4532490670681000e-02 -3.1474688649177551e-01 + <_> + + 0 -1 1087 1.1480580084025860e-02 + + 1.7419299110770226e-02 -7.4722832441329956e-01 + <_> + + 0 -1 1088 -6.5499639511108398e-01 + + -4.5483970642089844e-01 2.6187120005488396e-02 + <_> + + 0 -1 1089 -1.5746919962111861e-04 + + 8.4341458976268768e-02 -1.8240310251712799e-01 + <_> + + 0 -1 1090 -1.0111900046467781e-03 + + -2.0862899720668793e-01 6.7676216363906860e-02 + <_> + + 0 -1 1091 1.8488839268684387e-02 + + -3.5499621182680130e-02 4.1342151165008545e-01 + <_> + + 0 -1 1092 -3.8888910785317421e-04 + + 1.5692460536956787e-01 -8.6299479007720947e-02 + <_> + + 0 -1 1093 -4.5315301977097988e-03 + + -4.3912211060523987e-01 3.4103620797395706e-02 + <_> + + 0 -1 1094 3.3536020666360855e-02 + + -3.2231528311967850e-02 4.7096571326255798e-01 + <_> + + 0 -1 1095 2.0854349713772535e-03 + + -7.6001010835170746e-02 1.7373880743980408e-01 + <_> + + 0 -1 1096 -1.4060589819564484e-05 + + 8.5960999131202698e-02 -1.6348780691623688e-01 + <_> + + 0 -1 1097 4.2995680123567581e-02 + + 2.2033119574189186e-02 -5.9274291992187500e-01 + <_> + + 0 -1 1098 2.4928380735218525e-03 + + -6.3020773231983185e-02 2.1398860216140747e-01 + <_> + + 0 -1 1099 1.4520809600071516e-05 + + -1.1218129843473434e-01 1.1997319757938385e-01 + <_> + + 0 -1 1100 2.1152360364794731e-02 + + 3.0270710587501526e-02 -4.4600808620452881e-01 + <_> + + 0 -1 1101 2.1028789342381060e-04 + + 8.0384418368339539e-02 -1.7209020256996155e-01 + <_> + + 0 -1 1102 1.0620340472087264e-03 + + -6.4051970839500427e-02 2.1304920315742493e-01 + <_> + + 0 -1 1103 -2.5768030900508165e-03 + + -5.2309602499008179e-01 2.6146469637751579e-02 + <_> + + 0 -1 1104 4.7555579803884029e-03 + + 3.6213729530572891e-02 -3.4408730268478394e-01 + <_> + + 0 -1 1105 -5.9062540531158447e-01 + + -9.1701269149780273e-01 1.3416379690170288e-02 + <_> + + 0 -1 1106 -9.7031831741333008e-02 + + 4.8288398981094360e-01 -3.2344181090593338e-02 + <_> + + 0 -1 1107 1.4890159945935011e-03 + + 4.0591750293970108e-02 -3.8898488879203796e-01 + <_> + + 0 -1 1108 2.4702500086277723e-03 + + -6.3159219920635223e-02 2.1322609484195709e-01 + <_> + + 0 -1 1109 -2.9705299530178308e-03 + + 1.4960889518260956e-01 -1.0181649774312973e-01 + <_> + + 0 -1 1110 1.5555499494075775e-01 + + 3.6674879491329193e-02 -3.5983988642692566e-01 + <_> + + 0 -1 1111 1.4113659970462322e-02 + + 1.3834640383720398e-02 -8.7112957239151001e-01 + <_> + + 0 -1 1112 -9.5594127196818590e-04 + + -2.2359329462051392e-01 5.5646751075983047e-02 + <_> + 137 + -1.4971179962158203e+00 + + <_> + + 0 -1 1113 2.3068320006132126e-02 + + -3.0734539031982422e-01 2.5758111476898193e-01 + <_> + + 0 -1 1114 -1.1603030376136303e-02 + + 1.7347939312458038e-01 -2.9917559027671814e-01 + <_> + + 0 -1 1115 -1.0232869535684586e-03 + + 1.9289019703865051e-01 -2.4926829338073730e-01 + <_> + + 0 -1 1116 1.2194960378110409e-02 + + 8.7591417133808136e-02 -4.0853890776634216e-01 + <_> + + 0 -1 1117 -1.2484550243243575e-03 + + 1.6345569491386414e-01 -1.8811899423599243e-01 + <_> + + 0 -1 1118 3.2145460136234760e-04 + + 7.9135909676551819e-02 -3.7722501158714294e-01 + <_> + + 0 -1 1119 -7.9707789700478315e-04 + + -2.6377388834953308e-01 9.6936263144016266e-02 + <_> + + 0 -1 1120 7.0924922823905945e-02 + + -1.2538060545921326e-01 2.5267291069030762e-01 + <_> + + 0 -1 1121 2.5408361107110977e-03 + + -1.3923250138759613e-01 1.4974319934844971e-01 + <_> + + 0 -1 1122 -6.9253891706466675e-04 + + -3.1363919377326965e-01 3.9419740438461304e-02 + <_> + + 0 -1 1123 2.5845640338957310e-03 + + -7.0067122578620911e-02 2.8096580505371094e-01 + <_> + + 0 -1 1124 -1.6803950071334839e-02 + + -4.6254080533981323e-01 3.6509469151496887e-02 + <_> + + 0 -1 1125 -2.1332600153982639e-03 + + 2.2691309452056885e-01 -8.4447480738162994e-02 + <_> + + 0 -1 1126 -5.5397138930857182e-04 + + -2.0728160440921783e-01 1.0041700303554535e-01 + <_> + + 0 -1 1127 -1.4573110092896968e-05 + + 8.8534340262413025e-02 -2.0813420414924622e-01 + <_> + + 0 -1 1128 8.0281507689505816e-04 + + -8.8521443307399750e-02 1.9553969800472260e-01 + <_> + + 0 -1 1129 3.6762449890375137e-03 + + -8.3966277539730072e-02 2.4232700467109680e-01 + <_> + + 0 -1 1130 -1.6549570136703551e-04 + + -1.9402000308036804e-01 1.0044509917497635e-01 + <_> + + 0 -1 1131 5.5225789546966553e-03 + + 4.6014141291379929e-02 -4.1095688939094543e-01 + <_> + + 0 -1 1132 1.1023939587175846e-03 + + -2.1053719520568848e-01 8.4169827401638031e-02 + <_> + + 0 -1 1133 -2.1610360592603683e-02 + + -3.4724879264831543e-01 5.1196940243244171e-02 + <_> + + 0 -1 1134 -1.4869699953123927e-05 + + 1.1187150329351425e-01 -1.6249230504035950e-01 + <_> + + 0 -1 1135 3.1727060675621033e-02 + + 3.7546031177043915e-02 -4.5357111096382141e-01 + <_> + + 0 -1 1136 -6.5588178113102913e-03 + + 2.9756790399551392e-01 -6.1539310961961746e-02 + <_> + + 0 -1 1137 3.7398359272629023e-03 + + -6.9362841546535492e-02 2.2881920635700226e-01 + <_> + + 0 -1 1138 -2.1445790771394968e-03 + + -3.0691981315612793e-01 5.7085540145635605e-02 + <_> + + 0 -1 1139 1.4241340104490519e-03 + + 4.7747720032930374e-02 -3.5141488909721375e-01 + <_> + + 0 -1 1140 1.8902820302173495e-03 + + 1.1250650137662888e-01 -1.5074999630451202e-01 + <_> + + 0 -1 1141 -6.4917900599539280e-03 + + 2.8712779283523560e-01 -6.2573678791522980e-02 + <_> + + 0 -1 1142 -8.7750004604458809e-03 + + -5.4141241312026978e-01 2.9559530317783356e-02 + <_> + + 0 -1 1143 9.3647688627243042e-02 + + -5.6943789124488831e-02 2.9638379812240601e-01 + <_> + + 0 -1 1144 -4.4028809497831389e-05 + + 1.0726290196180344e-01 -1.5169329941272736e-01 + <_> + + 0 -1 1145 7.9690842540003359e-05 + + 8.7704338133335114e-02 -1.8157640099525452e-01 + <_> + + 0 -1 1146 -6.6510448232293129e-03 + + 2.1250769495964050e-01 -7.8765399754047394e-02 + <_> + + 0 -1 1147 2.1358320116996765e-01 + + 3.2704930752515793e-02 -4.9895349144935608e-01 + <_> + + 0 -1 1148 -9.8035410046577454e-02 + + -6.3620072603225708e-01 2.4300750344991684e-02 + <_> + + 0 -1 1149 -3.6894609220325947e-03 + + -5.7873171567916870e-01 2.5343220680952072e-02 + <_> + + 0 -1 1150 4.7867568209767342e-03 + + -6.9719798862934113e-02 2.4641029536724091e-01 + <_> + + 0 -1 1151 4.0250780875794590e-04 + + -1.1852599680423737e-01 1.7163689434528351e-01 + <_> + + 0 -1 1152 -3.8258030544966459e-03 + + -3.1708711385726929e-01 5.2796650677919388e-02 + <_> + + 0 -1 1153 2.9255099434521981e-05 + + -1.2157870084047318e-01 1.2443509697914124e-01 + <_> + + 0 -1 1154 -5.5969221284613013e-04 + + -2.3942449688911438e-01 6.1564020812511444e-02 + <_> + + 0 -1 1155 1.6149280127137899e-03 + + -8.9536681771278381e-02 1.9396179914474487e-01 + <_> + + 0 -1 1156 -5.9165759012103081e-03 + + -6.0741347074508667e-01 2.4107500910758972e-02 + <_> + + 0 -1 1157 4.5592039823532104e-03 + + -5.4090119898319244e-02 2.8721129894256592e-01 + <_> + + 0 -1 1158 -5.1767788827419281e-02 + + -6.4853471517562866e-01 2.4329099804162979e-02 + <_> + + 0 -1 1159 -1.0635569691658020e-02 + + 3.2359760999679565e-01 -5.0231788307428360e-02 + <_> + + 0 -1 1160 2.5121110957115889e-04 + + 9.5274448394775391e-02 -1.4859940111637115e-01 + <_> + + 0 -1 1161 1.3107099803164601e-03 + + -1.1612690240144730e-01 1.2647250294685364e-01 + <_> + + 0 -1 1162 -7.3629721999168396e-02 + + -6.2977832555770874e-01 2.4197410792112350e-02 + <_> + + 0 -1 1163 5.1864539273083210e-04 + + 8.0843970179557800e-02 -1.8038350343704224e-01 + <_> + + 0 -1 1164 -2.0541099365800619e-03 + + 2.0690770447254181e-01 -7.1559637784957886e-02 + <_> + + 0 -1 1165 -7.2738518938422203e-03 + + -1.8049220740795135e-01 8.4618158638477325e-02 + <_> + + 0 -1 1166 -7.0418710820376873e-03 + + -5.5255848169326782e-01 2.4243000894784927e-02 + <_> + + 0 -1 1167 2.3678881116211414e-03 + + -7.4315063655376434e-02 2.2013199329376221e-01 + <_> + + 0 -1 1168 -4.1341409087181091e-03 + + -3.1461110711097717e-01 5.7645540684461594e-02 + <_> + + 0 -1 1169 5.9597631916403770e-03 + + 2.1551210433244705e-02 -6.6399222612380981e-01 + <_> + + 0 -1 1170 -1.4643320355389733e-05 + + 1.0325399786233902e-01 -1.4378640055656433e-01 + <_> + + 0 -1 1171 -8.0324069131165743e-04 + + -2.8026849031448364e-01 5.2175540477037430e-02 + <_> + + 0 -1 1172 -1.7860220745205879e-02 + + 3.1547638773918152e-01 -4.7295480966567993e-02 + <_> + + 0 -1 1173 8.5229711839929223e-04 + + -1.0860790312290192e-01 1.6905729472637177e-01 + <_> + + 0 -1 1174 8.8618341833353043e-03 + + 2.0629420876502991e-02 -7.1686798334121704e-01 + <_> + + 0 -1 1175 4.1418620385229588e-03 + + 3.1313210725784302e-02 -3.9753648638725281e-01 + <_> + + 0 -1 1176 -9.6616581082344055e-02 + + 4.2378899455070496e-01 -3.2291099429130554e-02 + <_> + + 0 -1 1177 -8.4853649139404297e-02 + + -4.8360210657119751e-01 3.4420508891344070e-02 + <_> + + 0 -1 1178 -2.7399489656090736e-02 + + -2.8981518745422363e-01 4.6805508434772491e-02 + <_> + + 0 -1 1179 1.9653420895338058e-03 + + -7.6221130788326263e-02 1.8894240260124207e-01 + <_> + + 0 -1 1180 -9.0222749859094620e-03 + + -5.8255058526992798e-01 2.6038780808448792e-02 + <_> + + 0 -1 1181 1.7859010398387909e-01 + + 1.4113079756498337e-02 -7.5876772403717041e-01 + <_> + + 0 -1 1182 2.6170860510319471e-03 + + -4.2011409997940063e-02 3.4582638740539551e-01 + <_> + + 0 -1 1183 -1.8247140105813742e-03 + + -2.5125750899314880e-01 5.4113451391458511e-02 + <_> + + 0 -1 1184 1.0635840008035302e-03 + + -6.9988057017326355e-02 2.1111090481281281e-01 + <_> + + 0 -1 1185 -8.5794121026992798e-02 + + -5.2950221300125122e-01 2.4234309792518616e-02 + <_> + + 0 -1 1186 -2.4844249710440636e-03 + + 2.2798889875411987e-01 -5.7894941419363022e-02 + <_> + + 0 -1 1187 2.4517390411347151e-03 + + 4.7758270055055618e-02 -2.9931840300559998e-01 + <_> + + 0 -1 1188 7.2088139131665230e-03 + + 8.9190460741519928e-02 -1.4663650095462799e-01 + <_> + + 0 -1 1189 -6.0728411190211773e-03 + + 2.9773110151290894e-01 -4.4187791645526886e-02 + <_> + + 0 -1 1190 2.9379719868302345e-02 + + 1.8384920433163643e-02 -7.2799599170684814e-01 + <_> + + 0 -1 1191 3.5265460610389709e-02 + + -4.0345128625631332e-02 3.4369349479675293e-01 + <_> + + 0 -1 1192 8.0668088048696518e-04 + + -1.0171490162611008e-01 1.3324069976806641e-01 + <_> + + 0 -1 1193 -1.4964640140533447e-03 + + -2.3296439647674561e-01 5.9193279594182968e-02 + <_> + + 0 -1 1194 2.6136979460716248e-02 + + 1.7993519082665443e-02 -7.3094600439071655e-01 + <_> + + 0 -1 1195 1.8663259223103523e-02 + + 1.4693800359964371e-02 -7.2105181217193604e-01 + <_> + + 0 -1 1196 -5.0944439863087609e-05 + + 9.8113812506198883e-02 -1.3487009704113007e-01 + <_> + + 0 -1 1197 -5.5268028518185019e-04 + + -1.1313900351524353e-01 1.1931320279836655e-01 + <_> + + 0 -1 1198 5.4916120134294033e-03 + + -6.8996928632259369e-02 2.2312630712985992e-01 + <_> + + 0 -1 1199 3.1243199482560158e-02 + + -3.2394438982009888e-02 3.9250150322914124e-01 + <_> + + 0 -1 1200 2.7375440113246441e-03 + + 3.6713510751724243e-02 -4.0632349252700806e-01 + <_> + + 0 -1 1201 9.0960890054702759e-02 + + 2.7709199115633965e-02 -4.1612899303436279e-01 + <_> + + 0 -1 1202 -4.2210621177218854e-04 + + -1.5993569791316986e-01 7.8440353274345398e-02 + <_> + + 0 -1 1203 -2.3689800873398781e-03 + + 1.4372199773788452e-01 -9.0417243540287018e-02 + <_> + + 0 -1 1204 4.5116269029676914e-03 + + -6.8068206310272217e-02 2.1011069416999817e-01 + <_> + + 0 -1 1205 -1.4441140228882432e-03 + + -1.3376539945602417e-01 1.1816109716892242e-01 + <_> + + 0 -1 1206 2.1477979607880116e-03 + + -9.8067082464694977e-02 1.7571650445461273e-01 + <_> + + 0 -1 1207 2.2534599527716637e-02 + + 5.3246740251779556e-02 -2.8085210919380188e-01 + <_> + + 0 -1 1208 -1.6165290027856827e-02 + + 2.6058629155158997e-01 -5.6349318474531174e-02 + <_> + + 0 -1 1209 1.3157909736037254e-02 + + 4.4960599392652512e-02 -3.1084328889846802e-01 + <_> + + 0 -1 1210 -2.5218630209565163e-02 + + -1.2245389819145203e-01 1.1707650125026703e-01 + <_> + + 0 -1 1211 -1.0043029760709032e-04 + + 6.2668606638908386e-02 -2.3665410280227661e-01 + <_> + + 0 -1 1212 2.2884309291839600e-02 + + -5.6393388658761978e-02 2.6951891183853149e-01 + <_> + + 0 -1 1213 -3.7653960753232241e-03 + + 2.4265049397945404e-01 -6.0327839106321335e-02 + <_> + + 0 -1 1214 -1.2131360126659274e-03 + + -2.2581340372562408e-01 6.3866272568702698e-02 + <_> + + 0 -1 1215 3.6897920072078705e-03 + + -7.5056307017803192e-02 1.7121140658855438e-01 + <_> + + 0 -1 1216 3.9484380977228284e-04 + + 7.2925560176372528e-02 -1.8006080389022827e-01 + <_> + + 0 -1 1217 -2.8756330721080303e-03 + + 2.3332679271697998e-01 -5.8312799781560898e-02 + <_> + + 0 -1 1218 -1.2939549982547760e-02 + + -5.9966820478439331e-01 2.4746209383010864e-02 + <_> + + 0 -1 1219 4.8920139670372009e-03 + + -5.0808548927307129e-02 2.7142828702926636e-01 + <_> + + 0 -1 1220 -6.3685458153486252e-03 + + -1.7759549617767334e-01 7.8720703721046448e-02 + <_> + + 0 -1 1221 9.1700062155723572e-02 + + -2.4316219612956047e-02 5.6610620021820068e-01 + <_> + + 0 -1 1222 -2.9075080528855324e-03 + + -5.3473442792892456e-01 2.6738349348306656e-02 + <_> + + 0 -1 1223 -3.9782752282917500e-03 + + 1.7898949980735779e-01 -7.3634162545204163e-02 + <_> + + 0 -1 1224 3.8189089391380548e-03 + + 9.6640147268772125e-02 -1.2615419924259186e-01 + <_> + + 0 -1 1225 -6.1400169506669044e-03 + + -2.8025910258293152e-01 4.8952069133520126e-02 + <_> + + 0 -1 1226 4.6048378571867943e-03 + + -3.5297919064760208e-02 3.6271721124649048e-01 + <_> + + 0 -1 1227 6.9598153233528137e-02 + + 2.8236450627446175e-02 -4.7523179650306702e-01 + <_> + + 0 -1 1228 8.2954921526834369e-04 + + 6.5010666847229004e-02 -1.9608500599861145e-01 + <_> + + 0 -1 1229 1.0073450393974781e-02 + + 2.4091430008411407e-02 -5.2702528238296509e-01 + <_> + + 0 -1 1230 -4.9964170902967453e-02 + + 2.7060431241989136e-01 -5.2939768880605698e-02 + <_> + + 0 -1 1231 -2.3425720632076263e-02 + + -6.5538042783737183e-01 2.0399950444698334e-02 + <_> + + 0 -1 1232 4.5370758743956685e-04 + + -1.0145729780197144e-01 1.2575489282608032e-01 + <_> + + 0 -1 1233 -9.4329239800572395e-04 + + -2.3677830398082733e-01 5.2147369831800461e-02 + <_> + + 0 -1 1234 -2.5503130163997412e-03 + + 1.8695800006389618e-01 -6.4383536577224731e-02 + <_> + + 0 -1 1235 -2.1031149663031101e-03 + + -4.0381109714508057e-01 2.8763780370354652e-02 + <_> + + 0 -1 1236 2.3942890111356974e-03 + + -5.8961909264326096e-02 2.0151209831237793e-01 + <_> + + 0 -1 1237 3.4859919105656445e-04 + + -1.1594740301370621e-01 1.1559849977493286e-01 + <_> + + 0 -1 1238 6.5279641421511769e-04 + + -9.6583247184753418e-02 1.4546130597591400e-01 + <_> + + 0 -1 1239 6.6208152566105127e-04 + + 5.5666640400886536e-02 -2.3408170044422150e-01 + <_> + + 0 -1 1240 -1.1246719956398010e-01 + + -7.2129100561141968e-01 1.6700809821486473e-02 + <_> + + 0 -1 1241 2.4760260712355375e-03 + + -7.0752441883087158e-02 1.6832010447978973e-01 + <_> + + 0 -1 1242 -8.7723489850759506e-03 + + -4.8666760325431824e-01 2.6006119325757027e-02 + <_> + + 0 -1 1243 2.8840279206633568e-02 + + 3.3308699727058411e-02 -3.4549170732498169e-01 + <_> + + 0 -1 1244 4.7115320921875536e-04 + + 5.8610469102859497e-02 -2.1334120631217957e-01 + <_> + + 0 -1 1245 -7.5157210230827332e-03 + + 3.7866720557212830e-01 -3.6307640373706818e-02 + <_> + + 0 -1 1246 -1.7479779489804059e-04 + + -1.8687920272350311e-01 7.0380441844463348e-02 + <_> + + 0 -1 1247 6.9826189428567886e-03 + + -7.5376212596893311e-02 1.8541449308395386e-01 + <_> + + 0 -1 1248 -2.5053499266505241e-03 + + -4.7345471382141113e-01 2.6765290647745132e-02 + <_> + + 0 -1 1249 6.5240712137892842e-04 + + -1.1398679763078690e-01 1.1460109800100327e-01 + <_> + 153 + -1.5120370388031006e+00 + + <_> + + 0 -1 1250 2.7968829497694969e-02 + + -2.4054290354251862e-01 3.3976718783378601e-01 + <_> + + 0 -1 1251 4.7484100796282291e-03 + + -1.8598410487174988e-01 2.6523759961128235e-01 + <_> + + 0 -1 1252 -9.6774380654096603e-03 + + 1.3574579358100891e-01 -3.1734740734100342e-01 + <_> + + 0 -1 1253 1.0649940231814981e-03 + + -5.0356131792068481e-01 7.0383183658123016e-02 + <_> + + 0 -1 1254 3.0151519458740950e-03 + + -1.7585769295692444e-01 1.6750140488147736e-01 + <_> + + 0 -1 1255 7.6821137918159366e-04 + + -2.3158560693264008e-01 1.2748460471630096e-01 + <_> + + 0 -1 1256 -5.6622780859470367e-02 + + 3.0103230476379395e-01 -1.1525429785251617e-01 + <_> + + 0 -1 1257 4.7889677807688713e-03 + + -6.8797349929809570e-02 3.5774651169776917e-01 + <_> + + 0 -1 1258 3.7908130325376987e-03 + + 1.1250580102205276e-01 -2.3389840126037598e-01 + <_> + + 0 -1 1259 -3.6302749067544937e-03 + + -2.7425950765609741e-01 6.0180071741342545e-02 + <_> + + 0 -1 1260 1.4986160211265087e-02 + + 5.8370150625705719e-02 -3.5088211297988892e-01 + <_> + + 0 -1 1261 6.1338639352470636e-04 + + -1.0045500099658966e-01 1.8004140257835388e-01 + <_> + + 0 -1 1262 1.7827099654823542e-03 + + -5.8504570275545120e-02 2.8165730834007263e-01 + <_> + + 0 -1 1263 1.0279649868607521e-03 + + 4.6049151569604874e-02 -4.1633561253547668e-01 + <_> + + 0 -1 1264 -1.4470520000031684e-05 + + 9.7594477236270905e-02 -1.7005239427089691e-01 + <_> + + 0 -1 1265 7.2919862577691674e-04 + + -8.9277692139148712e-02 1.9683800637722015e-01 + <_> + + 0 -1 1266 -1.2752750189974904e-03 + + -2.1324349939823151e-01 7.7781319618225098e-02 + <_> + + 0 -1 1267 2.7510570362210274e-02 + + 9.8059087991714478e-02 -1.8463979661464691e-01 + <_> + + 0 -1 1268 3.9082998409867287e-03 + + -9.8240077495574951e-02 1.7902830243110657e-01 + <_> + + 0 -1 1269 2.8285238659009337e-04 + + 6.4882382750511169e-02 -2.5903809070587158e-01 + <_> + + 0 -1 1270 5.8698928914964199e-03 + + -4.8436500132083893e-02 3.5584059357643127e-01 + <_> + + 0 -1 1271 5.2106438670307398e-04 + + 6.4200893044471741e-02 -2.4268729984760284e-01 + <_> + + 0 -1 1272 -3.8013618905097246e-03 + + 3.1349530816078186e-01 -4.9372490495443344e-02 + <_> + + 0 -1 1273 -3.5830549895763397e-03 + + -1.9015640020370483e-01 8.5928887128829956e-02 + <_> + + 0 -1 1274 7.3326388373970985e-03 + + -8.7244078516960144e-02 1.8596029281616211e-01 + <_> + + 0 -1 1275 6.8118958733975887e-04 + + 9.0353183448314667e-02 -1.7380879819393158e-01 + <_> + + 0 -1 1276 -2.4127468932420015e-03 + + 2.6583871245384216e-01 -6.2018260359764099e-02 + <_> + + 0 -1 1277 4.4389287941157818e-03 + + 3.8672439754009247e-02 -4.4039198756217957e-01 + <_> + + 0 -1 1278 2.9394390367087908e-05 + + -1.3116660714149475e-01 1.2389960139989853e-01 + <_> + + 0 -1 1279 5.2613918669521809e-03 + + -5.4326139390468597e-02 3.1434679031372070e-01 + <_> + + 0 -1 1280 2.3712380789220333e-03 + + 3.5234931856393814e-02 -4.5936021208763123e-01 + <_> + + 0 -1 1281 -2.4774149060249329e-03 + + -3.2579651474952698e-01 4.1676308959722519e-02 + <_> + + 0 -1 1282 5.1308068213984370e-04 + + -9.8032839596271515e-02 1.5209600329399109e-01 + <_> + + 0 -1 1283 -7.6761870877817273e-04 + + -2.0944289863109589e-01 6.9563657045364380e-02 + <_> + + 0 -1 1284 4.1551832109689713e-03 + + -5.9142418205738068e-02 2.4788859486579895e-01 + <_> + + 0 -1 1285 1.4315149746835232e-02 + + 2.4713350459933281e-02 -6.2663692235946655e-01 + <_> + + 0 -1 1286 8.9347898028790951e-04 + + -1.3387380540370941e-01 1.0626660287380219e-01 + <_> + + 0 -1 1287 -5.8425782481208444e-04 + + -2.1583810448646545e-01 6.7552872002124786e-02 + <_> + + 0 -1 1288 8.9712149929255247e-04 + + -1.5998089313507080e-01 9.6859596669673920e-02 + <_> + + 0 -1 1289 -4.4576660729944706e-03 + + -4.6839779615402222e-01 3.4481108188629150e-02 + <_> + + 0 -1 1290 1.6316650435328484e-02 + + 1.6176480799913406e-02 -7.6990699768066406e-01 + <_> + + 0 -1 1291 -1.9581869710236788e-03 + + 2.3423190414905548e-01 -6.3605003058910370e-02 + <_> + + 0 -1 1292 2.9628631472587585e-01 + + 3.8007281720638275e-02 -3.8991358876228333e-01 + <_> + + 0 -1 1293 -9.1676972806453705e-04 + + 1.2086489796638489e-01 -1.0912480205297470e-01 + <_> + + 0 -1 1294 -2.5543299852870405e-04 + + -1.8755780160427094e-01 7.1104221045970917e-02 + <_> + + 0 -1 1295 8.2945115864276886e-03 + + -3.9912570267915726e-02 3.3551681041717529e-01 + <_> + + 0 -1 1296 -5.8387689292430878e-02 + + -3.3475118875503540e-01 4.1011139750480652e-02 + <_> + + 0 -1 1297 1.0927469702437520e-03 + + -8.3243489265441895e-02 1.6046769917011261e-01 + <_> + + 0 -1 1298 1.0653319768607616e-03 + + -1.1920040100812912e-01 1.0561779886484146e-01 + <_> + + 0 -1 1299 -3.5323720425367355e-02 + + 2.8399449586868286e-01 -4.7650910913944244e-02 + <_> + + 0 -1 1300 6.7976478021591902e-04 + + 5.9223521500825882e-02 -2.2741270065307617e-01 + <_> + + 0 -1 1301 -2.4810519069433212e-02 + + -6.5788549184799194e-01 1.8828939646482468e-02 + <_> + + 0 -1 1302 4.5880349352955818e-03 + + -5.0799869000911713e-02 2.6886260509490967e-01 + <_> + + 0 -1 1303 3.9034360088407993e-03 + + -5.9183020144701004e-02 2.2644530236721039e-01 + <_> + + 0 -1 1304 1.2360659986734390e-01 + + 2.2052299231290817e-02 -6.7844098806381226e-01 + <_> + + 0 -1 1305 -3.7856408744119108e-04 + + -2.1715499460697174e-01 5.7522300630807877e-02 + <_> + + 0 -1 1306 2.8562229126691818e-02 + + -3.4095268696546555e-02 4.2474791407585144e-01 + <_> + + 0 -1 1307 2.2348840720951557e-03 + + -3.5655528306961060e-02 3.5050040483474731e-01 + <_> + + 0 -1 1308 1.9211059436202049e-02 + + 2.5078350678086281e-02 -5.9314918518066406e-01 + <_> + + 0 -1 1309 1.5611639618873596e-01 + + 2.3612640798091888e-02 -4.8740550875663757e-01 + <_> + + 0 -1 1310 -1.2261980446055532e-03 + + -3.0421718955039978e-01 3.9526391774415970e-02 + <_> + + 0 -1 1311 3.6561759188771248e-03 + + -7.7627539634704590e-02 2.0262609422206879e-01 + <_> + + 0 -1 1312 1.1567790061235428e-03 + + 5.5682398378849030e-02 -2.4368490278720856e-01 + <_> + + 0 -1 1313 6.2764538452029228e-03 + + -6.4452603459358215e-02 2.1183019876480103e-01 + <_> + + 0 -1 1314 1.2091239914298058e-02 + + 2.0667979493737221e-02 -6.2231677770614624e-01 + <_> + + 0 -1 1315 3.7568950210697949e-04 + + 7.3670476675033569e-02 -1.7809109389781952e-01 + <_> + + 0 -1 1316 3.8157668896019459e-03 + + 3.3845711499452591e-02 -3.6262959241867065e-01 + <_> + + 0 -1 1317 -1.3252210337668657e-03 + + 1.4732490479946136e-01 -8.1727422773838043e-02 + <_> + + 0 -1 1318 2.1575710270553827e-03 + + -6.8624198436737061e-02 1.7562319338321686e-01 + <_> + + 0 -1 1319 -6.4548188820481300e-03 + + -5.8159267902374268e-01 2.3020049557089806e-02 + <_> + + 0 -1 1320 -8.1042833626270294e-03 + + -3.5549208521842957e-01 3.5372331738471985e-02 + <_> + + 0 -1 1321 1.6489460540469736e-04 + + 7.4472688138484955e-02 -1.5718360245227814e-01 + <_> + + 0 -1 1322 -1.9494029693305492e-03 + + 3.5157081484794617e-01 -3.6213818937540054e-02 + <_> + + 0 -1 1323 -1.5267659910023212e-04 + + -1.4115719497203827e-01 8.4802761673927307e-02 + <_> + + 0 -1 1324 2.3890420794487000e-02 + + 1.9317669793963432e-02 -6.3186031579971313e-01 + <_> + + 0 -1 1325 -4.4950367882847786e-03 + + 2.1254129707813263e-01 -5.9143088757991791e-02 + <_> + + 0 -1 1326 2.8725271113216877e-03 + + 3.2794039696455002e-02 -3.9505231380462646e-01 + <_> + + 0 -1 1327 2.0885460544377565e-03 + + -8.5443787276744843e-02 1.4347669482231140e-01 + <_> + + 0 -1 1328 -4.4343829154968262e-01 + + -4.0052318572998047e-01 2.9428049921989441e-02 + <_> + + 0 -1 1329 2.0199170336127281e-02 + + 4.0000550448894501e-02 -3.1763339042663574e-01 + <_> + + 0 -1 1330 1.4570879749953747e-02 + + 1.3662800192832947e-02 -8.6441951990127563e-01 + <_> + + 0 -1 1331 -3.8080150261521339e-03 + + 4.0930721163749695e-01 -3.3838968724012375e-02 + <_> + + 0 -1 1332 1.0009920224547386e-03 + + -8.2600250840187073e-02 1.3928790390491486e-01 + <_> + + 0 -1 1333 1.1500980472192168e-03 + + 6.9677546620368958e-02 -1.7433060705661774e-01 + <_> + + 0 -1 1334 3.4720861003734171e-04 + + 6.6659383475780487e-02 -1.7403809726238251e-01 + <_> + + 0 -1 1335 2.7565560303628445e-03 + + -2.9285680502653122e-02 4.0243569016456604e-01 + <_> + + 0 -1 1336 -2.4124220013618469e-02 + + -3.2424208521842957e-01 3.7330508232116699e-02 + <_> + + 0 -1 1337 -1.3989120721817017e-01 + + -6.5967488288879395e-01 1.7929619178175926e-02 + <_> + + 0 -1 1338 3.0997680500149727e-02 + + 1.4100589789450169e-02 -6.9532638788223267e-01 + <_> + + 0 -1 1339 4.6191760338842869e-04 + + -6.7944146692752838e-02 1.8066139519214630e-01 + <_> + + 0 -1 1340 3.4264490008354187e-02 + + 2.2298639640212059e-02 -5.8638918399810791e-01 + <_> + + 0 -1 1341 3.9756381884217262e-03 + + -4.1803721338510513e-02 3.1669101119041443e-01 + <_> + + 0 -1 1342 -3.4192908788099885e-04 + + -1.5810790657997131e-01 7.7484056353569031e-02 + <_> + + 0 -1 1343 7.1672953665256500e-02 + + -2.3302769288420677e-02 5.2465027570724487e-01 + <_> + + 0 -1 1344 7.1812322130426764e-04 + + 4.8268780112266541e-02 -2.7771729230880737e-01 + <_> + + 0 -1 1345 -1.8881190335378051e-03 + + 8.3184987306594849e-02 -1.4802010357379913e-01 + <_> + + 0 -1 1346 -1.2498029973357916e-03 + + 2.5329118967056274e-01 -4.9769390374422073e-02 + <_> + + 0 -1 1347 -1.2756100296974182e-01 + + -6.7970567941665649e-01 2.0871700718998909e-02 + <_> + + 0 -1 1348 -1.4621549780713394e-05 + + 7.9338513314723969e-02 -1.5043739974498749e-01 + <_> + + 0 -1 1349 3.5788679961115122e-03 + + -5.5469110608100891e-02 2.4075509607791901e-01 + <_> + + 0 -1 1350 9.4902152195572853e-03 + + 2.8637239709496498e-02 -5.3680288791656494e-01 + <_> + + 0 -1 1351 1.0283050127327442e-02 + + 1.1550529859960079e-02 -7.7501267194747925e-01 + <_> + + 0 -1 1352 -4.2507290840148926e-02 + + -8.8770490884780884e-01 9.7261751070618629e-03 + <_> + + 0 -1 1353 3.6155930138193071e-04 + + 6.4407013356685638e-02 -1.7109510302543640e-01 + <_> + + 0 -1 1354 -3.4245628863573074e-02 + + 2.4231609702110291e-01 -4.7188870608806610e-02 + <_> + + 0 -1 1355 -1.2806710600852966e-01 + + -5.4869401454925537e-01 2.1854300051927567e-02 + <_> + + 0 -1 1356 5.3918339312076569e-02 + + -2.5415059179067612e-02 4.8263218998908997e-01 + <_> + + 0 -1 1357 -3.7711810320615768e-02 + + 1.4176939427852631e-01 -8.8871710002422333e-02 + <_> + + 0 -1 1358 -2.8310909867286682e-01 + + -6.4925712347030640e-01 2.0563820376992226e-02 + <_> + + 0 -1 1359 -1.1926019564270973e-02 + + -2.1756759285926819e-01 5.1851660013198853e-02 + <_> + + 0 -1 1360 3.7750680348835886e-04 + + 7.2340622544288635e-02 -1.6360169649124146e-01 + <_> + + 0 -1 1361 1.5865910798311234e-02 + + -7.9940237104892731e-02 1.6453659534454346e-01 + <_> + + 0 -1 1362 7.1175709366798401e-02 + + 3.1589020043611526e-02 -4.1988191008567810e-01 + <_> + + 0 -1 1363 5.8520520105957985e-03 + + 2.3279080167412758e-02 -4.8604270815849304e-01 + <_> + + 0 -1 1364 -1.3924130471423268e-03 + + 1.6908380389213562e-01 -7.3783926665782928e-02 + <_> + + 0 -1 1365 -1.8412459758110344e-04 + + 1.2232059985399246e-01 -1.0313989967107773e-01 + <_> + + 0 -1 1366 2.2130980505608022e-04 + + -8.1976376473903656e-02 1.6332870721817017e-01 + <_> + + 0 -1 1367 2.0723740453831851e-04 + + 9.2730201780796051e-02 -1.3733580708503723e-01 + <_> + + 0 -1 1368 -3.8736319402232766e-04 + + -2.0004619657993317e-01 8.4838382899761200e-02 + <_> + + 0 -1 1369 3.2468559220433235e-03 + + -5.6439258158206940e-02 2.2364979982376099e-01 + <_> + + 0 -1 1370 9.3086768174543977e-04 + + 3.1926579773426056e-02 -3.9701279997825623e-01 + <_> + + 0 -1 1371 1.0306099429726601e-03 + + -6.0154888778924942e-02 2.0189760625362396e-01 + <_> + + 0 -1 1372 -7.6027261093258858e-04 + + 1.4901119470596313e-01 -9.9665373563766479e-02 + <_> + + 0 -1 1373 -4.0442569297738373e-04 + + -1.9113409519195557e-01 7.4125148355960846e-02 + <_> + + 0 -1 1374 -4.7783120535314083e-03 + + -3.5730269551277161e-01 3.6531679332256317e-02 + <_> + + 0 -1 1375 -7.7672587940469384e-04 + + 1.0242869704961777e-01 -1.2974999845027924e-01 + <_> + + 0 -1 1376 -5.7417969219386578e-03 + + -1.6698950529098511e-01 7.0111282169818878e-02 + <_> + + 0 -1 1377 -1.0879320092499256e-02 + + 4.4120571017265320e-01 -2.9255589470267296e-02 + <_> + + 0 -1 1378 6.4163492061197758e-04 + + -1.1195279657840729e-01 1.0681179910898209e-01 + <_> + + 0 -1 1379 1.8341830000281334e-02 + + 1.6387680172920227e-01 -8.0189116299152374e-02 + <_> + + 0 -1 1380 -1.5051739756017923e-03 + + -2.2313259541988373e-01 6.1541710048913956e-02 + <_> + + 0 -1 1381 4.4345208443701267e-03 + + -6.6646136343479156e-02 2.2299060225486755e-01 + <_> + + 0 -1 1382 -1.4749550246051513e-05 + + 1.1597889661788940e-01 -1.0377810150384903e-01 + <_> + + 0 -1 1383 -2.6539659593254328e-03 + + 1.3116030395030975e-01 -8.6488783359527588e-02 + <_> + + 0 -1 1384 2.7743550017476082e-03 + + 4.1064068675041199e-02 -3.1225061416625977e-01 + <_> + + 0 -1 1385 1.1590829817578197e-03 + + 6.4309477806091309e-02 -1.7413079738616943e-01 + <_> + + 0 -1 1386 9.2315068468451500e-04 + + -8.2974001765251160e-02 1.4439080655574799e-01 + <_> + + 0 -1 1387 -8.2323597744107246e-03 + + 3.0380389094352722e-01 -4.1229110211133957e-02 + <_> + + 0 -1 1388 3.5314110573381186e-03 + + 3.9511259645223618e-02 -3.3097168803215027e-01 + <_> + + 0 -1 1389 5.7490761391818523e-03 + + 1.9821660593152046e-02 -5.8780592679977417e-01 + <_> + + 0 -1 1390 7.8584970906376839e-03 + + -4.9952238798141479e-02 2.7249589562416077e-01 + <_> + + 0 -1 1391 -1.4245980310079176e-05 + + 8.8010340929031372e-02 -1.3228349387645721e-01 + <_> + + 0 -1 1392 6.9364177761599422e-04 + + -6.7391887307167053e-02 1.7463630437850952e-01 + <_> + + 0 -1 1393 -2.9837749898433685e-02 + + -5.1709812879562378e-01 2.4871410802006721e-02 + <_> + + 0 -1 1394 7.1383598260581493e-03 + + 6.7430503666400909e-02 -1.9037249684333801e-01 + <_> + + 0 -1 1395 1.7582569271326065e-02 + + -3.6622371524572372e-02 3.5335469245910645e-01 + <_> + + 0 -1 1396 -1.2527840444818139e-03 + + -2.1730649471282959e-01 6.1200018972158432e-02 + <_> + + 0 -1 1397 7.4575009057298303e-04 + + -6.4467661082744598e-02 1.9775040447711945e-01 + <_> + + 0 -1 1398 -7.2683871258050203e-04 + + -1.7233370244503021e-01 7.1719951927661896e-02 + <_> + + 0 -1 1399 2.6301289908587933e-03 + + -3.9274338632822037e-02 3.3066290616989136e-01 + <_> + + 0 -1 1400 -1.4553769688063767e-05 + + 7.9698577523231506e-02 -1.7852419614791870e-01 + <_> + + 0 -1 1401 -4.5518940896727145e-04 + + -1.6662250459194183e-01 7.5660362839698792e-02 + <_> + + 0 -1 1402 -4.0261688991449773e-04 + + -1.4214369654655457e-01 8.1017293035984039e-02 + <_> + 161 + -1.4741109609603882e+00 + + <_> + + 0 -1 1403 -8.3439666777849197e-03 + + 3.1942158937454224e-01 -2.6766449213027954e-01 + <_> + + 0 -1 1404 7.8073277836665511e-04 + + -3.4852638840675354e-01 1.3628880679607391e-01 + <_> + + 0 -1 1405 8.6505862418562174e-04 + + -2.5323680043220520e-01 1.7417639493942261e-01 + <_> + + 0 -1 1406 -2.0879819930996746e-04 + + 8.8503703474998474e-02 -3.6038509011268616e-01 + <_> + + 0 -1 1407 -7.4667241424322128e-03 + + 1.6120630502700806e-01 -1.7366449534893036e-01 + <_> + + 0 -1 1408 -6.9383758818730712e-04 + + 9.6873007714748383e-02 -2.6793479919433594e-01 + <_> + + 0 -1 1409 -4.7926991101121530e-05 + + 9.1756246984004974e-02 -2.6212221384048462e-01 + <_> + + 0 -1 1410 -1.5861799474805593e-03 + + -6.1400872468948364e-01 -7.4168378487229347e-03 + <_> + + 0 -1 1411 4.4573731429409236e-05 + + -1.4841860532760620e-01 1.3855740427970886e-01 + <_> + + 0 -1 1412 5.0104141701012850e-04 + + 5.9088941663503647e-02 -2.9596069455146790e-01 + <_> + + 0 -1 1413 -4.7243628650903702e-03 + + 1.7092029750347137e-01 -1.0624700039625168e-01 + <_> + + 0 -1 1414 3.9171050302684307e-03 + + 8.8605202734470367e-02 -2.2775200009346008e-01 + <_> + + 0 -1 1415 8.8675727602094412e-04 + + -1.6839639842510223e-01 1.1958680301904678e-01 + <_> + + 0 -1 1416 -4.2634559795260429e-03 + + -3.3663240075111389e-01 4.7266270965337753e-02 + <_> + + 0 -1 1417 6.8006501533091068e-03 + + -5.9237081557512283e-02 3.1675300002098083e-01 + <_> + + 0 -1 1418 -1.3168989680707455e-02 + + 3.7162569165229797e-01 -4.2714890092611313e-02 + <_> + + 0 -1 1419 7.3881301796063781e-04 + + 5.9158101677894592e-02 -3.0953711271286011e-01 + <_> + + 0 -1 1420 1.7939460230991244e-03 + + -8.4615282714366913e-02 2.0452530682086945e-01 + <_> + + 0 -1 1421 1.6819390002638102e-03 + + -8.6703762412071228e-02 2.0580549538135529e-01 + <_> + + 0 -1 1422 -2.5033599231392145e-03 + + -4.3473190069198608e-01 3.8707830011844635e-02 + <_> + + 0 -1 1423 3.3658559550531209e-04 + + -1.0717310011386871e-01 1.5238380432128906e-01 + <_> + + 0 -1 1424 1.3037879951298237e-02 + + 4.4682659208774567e-02 -4.0395650267601013e-01 + <_> + + 0 -1 1425 1.3743729505222291e-04 + + -2.1432510018348694e-01 6.8643413484096527e-02 + <_> + + 0 -1 1426 3.7178888916969299e-01 + + 3.4502930939197540e-02 -4.5998379588127136e-01 + <_> + + 0 -1 1427 -7.1649150922894478e-03 + + 2.6640880107879639e-01 -5.4557949304580688e-02 + <_> + + 0 -1 1428 -7.1985478280112147e-04 + + -1.4415690302848816e-01 9.8254486918449402e-02 + <_> + + 0 -1 1429 1.6854539513587952e-02 + + 2.8428679332137108e-02 -4.5227599143981934e-01 + <_> + + 0 -1 1430 1.3624729588627815e-02 + + -6.0474298894405365e-02 2.2715990245342255e-01 + <_> + + 0 -1 1431 1.3620140030980110e-02 + + 7.9177603125572205e-02 -1.8104650080204010e-01 + <_> + + 0 -1 1432 -4.4976719655096531e-03 + + 2.1300099790096283e-01 -7.1392573416233063e-02 + <_> + + 0 -1 1433 7.1611418388783932e-04 + + -9.4237379729747772e-02 1.5830449759960175e-01 + <_> + + 0 -1 1434 7.0651061832904816e-04 + + 4.8840671777725220e-02 -2.9152449965476990e-01 + <_> + + 0 -1 1435 -3.1002271175384521e-01 + + -3.8511890172958374e-01 3.4369651228189468e-02 + <_> + + 0 -1 1436 4.3721711263060570e-03 + + -4.6880301088094711e-02 2.9952910542488098e-01 + <_> + + 0 -1 1437 -1.4383009634912014e-02 + + -4.5463728904724121e-01 3.4184519201517105e-02 + <_> + + 0 -1 1438 -3.7763800937682390e-03 + + -5.6709027290344238e-01 2.1684719249606133e-02 + <_> + + 0 -1 1439 -3.4393940586596727e-03 + + 2.8183689713478088e-01 -5.2640009671449661e-02 + <_> + + 0 -1 1440 -3.5846829414367676e-03 + + -2.9227399826049805e-01 5.2231520414352417e-02 + <_> + + 0 -1 1441 3.6200750619173050e-03 + + -5.3378768265247345e-02 2.6364138722419739e-01 + <_> + + 0 -1 1442 7.6435408554971218e-03 + + 3.6897629499435425e-02 -3.9242339134216309e-01 + <_> + + 0 -1 1443 3.5417820326983929e-03 + + 3.5689998418092728e-02 -3.5601079463958740e-01 + <_> + + 0 -1 1444 -2.4041049182415009e-03 + + 1.6313059628009796e-01 -8.9239962399005890e-02 + <_> + + 0 -1 1445 6.5479031763970852e-03 + + 3.6708708852529526e-02 -3.4187689423561096e-01 + <_> + + 0 -1 1446 -1.2350000441074371e-02 + + 2.6157799363136292e-01 -5.2475821226835251e-02 + <_> + + 0 -1 1447 1.4726500012329780e-05 + + -1.7869140207767487e-01 7.7807463705539703e-02 + <_> + + 0 -1 1448 -2.1563619375228882e-02 + + -6.3926118612289429e-01 1.9050199538469315e-02 + <_> + + 0 -1 1449 5.0762481987476349e-03 + + -5.1665481179952621e-02 2.9126250743865967e-01 + <_> + + 0 -1 1450 -5.9531949460506439e-02 + + -7.5291550159454346e-01 2.0238230004906654e-02 + <_> + + 0 -1 1451 -1.6808489337563515e-02 + + -4.2833268642425537e-01 2.5997729972004890e-02 + <_> + + 0 -1 1452 3.4431689418852329e-03 + + -5.4912570863962173e-02 2.4233500659465790e-01 + <_> + + 0 -1 1453 -1.0451589478179812e-03 + + -2.6243540644645691e-01 4.5748569071292877e-02 + <_> + + 0 -1 1454 -4.8333409358747303e-04 + + 8.9791953563690186e-02 -1.2892110645771027e-01 + <_> + + 0 -1 1455 -4.7575961798429489e-03 + + -3.1868740916252136e-01 3.6020528525114059e-02 + <_> + + 0 -1 1456 -1.0407149791717529e-01 + + 5.1398742198944092e-01 -2.3598119616508484e-02 + <_> + + 0 -1 1457 9.6292654052376747e-03 + + -4.7965578734874725e-02 2.1790429949760437e-01 + <_> + + 0 -1 1458 5.9226430021226406e-03 + + 6.4275130629539490e-02 -1.8210859596729279e-01 + <_> + + 0 -1 1459 1.6943799331784248e-02 + + -3.7509348243474960e-02 3.1458830833435059e-01 + <_> + + 0 -1 1460 -6.5468349494040012e-03 + + -1.5812429785728455e-01 9.0520747005939484e-02 + <_> + + 0 -1 1461 9.4754863530397415e-03 + + 4.8995878547430038e-02 -2.7853849530220032e-01 + <_> + + 0 -1 1462 -4.9254479818046093e-03 + + 3.1902191042900085e-01 -4.5609470456838608e-02 + <_> + + 0 -1 1463 -9.4199541490525007e-04 + + -1.6472989320755005e-01 7.3966227471828461e-02 + <_> + + 0 -1 1464 7.0046652108430862e-03 + + -3.6342341452836990e-02 3.3846628665924072e-01 + <_> + + 0 -1 1465 -9.1483298456296325e-04 + + 1.0460989922285080e-01 -1.1206439882516861e-01 + <_> + + 0 -1 1466 -1.8404760339763016e-04 + + 1.4215709269046783e-01 -8.7627373635768890e-02 + <_> + + 0 -1 1467 -3.1692520133219659e-04 + + -1.6067850589752197e-01 7.0096842944622040e-02 + <_> + + 0 -1 1468 2.3108009248971939e-02 + + -5.3784500807523727e-02 2.0780019462108612e-01 + <_> + + 0 -1 1469 6.3212551176548004e-03 + + 2.9342239722609520e-02 -3.8378500938415527e-01 + <_> + + 0 -1 1470 7.3698158375918865e-03 + + -4.1625689715147018e-02 2.6526549458503723e-01 + <_> + + 0 -1 1471 3.3730969298630953e-03 + + 3.7753321230411530e-02 -3.0138298869132996e-01 + <_> + + 0 -1 1472 -6.4016957767307758e-03 + + 2.1839860081672668e-01 -5.4551340639591217e-02 + <_> + + 0 -1 1473 1.3553920201957226e-02 + + 2.8121260926127434e-02 -4.3601170182228088e-01 + <_> + + 0 -1 1474 -6.7636291496455669e-03 + + -1.6322250664234161e-01 6.7339658737182617e-02 + <_> + + 0 -1 1475 -1.3078070478513837e-03 + + 1.2315399944782257e-01 -1.0096319764852524e-01 + <_> + + 0 -1 1476 -7.6282368972897530e-03 + + 2.5165349245071411e-01 -5.0460711121559143e-02 + <_> + + 0 -1 1477 7.9994397237896919e-03 + + 7.3020651936531067e-02 -1.8877799808979034e-01 + <_> + + 0 -1 1478 -3.1321209389716387e-03 + + 2.7653199434280396e-01 -4.3276838958263397e-02 + <_> + + 0 -1 1479 -4.0931310504674911e-02 + + -6.5518248081207275e-01 1.8600920215249062e-02 + <_> + + 0 -1 1480 7.0344978012144566e-03 + + 2.1914770826697350e-02 -4.8595818877220154e-01 + <_> + + 0 -1 1481 -2.5299859698861837e-03 + + 1.4030769467353821e-01 -8.0566473305225372e-02 + <_> + + 0 -1 1482 3.8867890834808350e-03 + + -8.9075699448585510e-02 1.6832409799098969e-01 + <_> + + 0 -1 1483 3.8210590719245374e-04 + + 6.5200872719287872e-02 -1.8599529564380646e-01 + <_> + + 0 -1 1484 1.0954789817333221e-01 + + 1.5036020427942276e-02 -8.6908358335494995e-01 + <_> + + 0 -1 1485 -1.4177490083966404e-04 + + -1.4669269323348999e-01 7.9050153493881226e-02 + <_> + + 0 -1 1486 2.0990408957004547e-03 + + -4.6489678323268890e-02 2.3045249283313751e-01 + <_> + + 0 -1 1487 -2.3089480237103999e-04 + + -1.6784009337425232e-01 6.9773100316524506e-02 + <_> + + 0 -1 1488 -4.3103471398353577e-04 + + 8.1758759915828705e-02 -1.2939240038394928e-01 + <_> + + 0 -1 1489 -2.9572288622148335e-04 + + -1.9068230688571930e-01 5.8420080691576004e-02 + <_> + + 0 -1 1490 -4.0046018548309803e-03 + + 1.2948529422283173e-01 -8.1599622964859009e-02 + <_> + + 0 -1 1491 1.4935520084691234e-05 + + -1.3364720344543457e-01 9.8664022982120514e-02 + <_> + + 0 -1 1492 5.7824450777843595e-04 + + 5.9095639735460281e-02 -1.8318089842796326e-01 + <_> + + 0 -1 1493 1.3251320458948612e-02 + + -7.1488671004772186e-02 1.5635989606380463e-01 + <_> + + 0 -1 1494 7.1273561843554489e-06 + + -1.2283089756965637e-01 9.7752511501312256e-02 + <_> + + 0 -1 1495 1.4193489914759994e-03 + + -8.1696748733520508e-02 1.3701570034027100e-01 + <_> + + 0 -1 1496 -8.0165416002273560e-03 + + 2.4697229266166687e-01 -5.6527040898799896e-02 + <_> + + 0 -1 1497 -2.3803471121937037e-03 + + -3.7901589274406433e-01 3.4532550722360611e-02 + <_> + + 0 -1 1498 -4.8633730039000511e-03 + + 6.5441012382507324e-01 -1.9296199083328247e-02 + <_> + + 0 -1 1499 -1.4388219824468251e-05 + + 7.5101882219314575e-02 -1.4394460618495941e-01 + <_> + + 0 -1 1500 1.4798780284763779e-05 + + -1.0807389765977859e-01 9.6213810145854950e-02 + <_> + + 0 -1 1501 2.4176139384508133e-02 + + 2.6983680203557014e-02 -4.0708479285240173e-01 + <_> + + 0 -1 1502 -3.9851912297308445e-03 + + 2.1786700189113617e-01 -5.4170310497283936e-02 + <_> + + 0 -1 1503 -2.5377580896019936e-03 + + -1.5314599871635437e-01 8.8059239089488983e-02 + <_> + + 0 -1 1504 2.1663319785147905e-03 + + 1.0252720117568970e-01 -1.2039250135421753e-01 + <_> + + 0 -1 1505 3.5593929351307452e-04 + + -8.2267768681049347e-02 1.3228890299797058e-01 + <_> + + 0 -1 1506 1.1394560569897294e-03 + + -8.6393490433692932e-02 1.5693899989128113e-01 + <_> + + 0 -1 1507 5.5563818663358688e-02 + + 1.7108110710978508e-02 -7.0473742485046387e-01 + <_> + + 0 -1 1508 5.5514591932296753e-01 + + 1.3345389626920223e-02 -6.9916892051696777e-01 + <_> + + 0 -1 1509 -4.6235490590333939e-03 + + -2.3983679711818695e-01 3.9515350013971329e-02 + <_> + + 0 -1 1510 -4.5803869143128395e-03 + + 4.2900869250297546e-01 -2.6430539786815643e-02 + <_> + + 0 -1 1511 7.0851319469511509e-03 + + 1.1231079697608948e-01 -1.0711509734392166e-01 + <_> + + 0 -1 1512 -4.0524810901843011e-04 + + -2.5740951299667358e-01 4.6670019626617432e-02 + <_> + + 0 -1 1513 -4.9121538177132607e-03 + + 2.7129280567169189e-01 -4.3966241180896759e-02 + <_> + + 0 -1 1514 -1.9348099827766418e-02 + + -4.0643858909606934e-01 2.9176769778132439e-02 + <_> + + 0 -1 1515 -1.3842330081388354e-03 + + 2.3537209630012512e-01 -5.0227548927068710e-02 + <_> + + 0 -1 1516 6.2752598896622658e-03 + + 2.8113570064306259e-02 -3.9913201332092285e-01 + <_> + + 0 -1 1517 1.4853129869152326e-05 + + -1.0750629752874374e-01 1.0206390172243118e-01 + <_> + + 0 -1 1518 -1.1780710192397237e-03 + + 1.8112790584564209e-01 -5.8998040854930878e-02 + <_> + + 0 -1 1519 -3.2166391611099243e-02 + + -9.8135101795196533e-01 1.1817139573395252e-02 + <_> + + 0 -1 1520 2.8749080374836922e-03 + + 5.0774369388818741e-02 -2.0650039613246918e-01 + <_> + + 0 -1 1521 -3.5098160151392221e-03 + + 1.4354039728641510e-01 -7.8006736934185028e-02 + <_> + + 0 -1 1522 -7.2203627787530422e-03 + + 2.3853950202465057e-01 -4.6176180243492126e-02 + <_> + + 0 -1 1523 2.0837699994444847e-03 + + 2.2801460698246956e-02 -5.0945621728897095e-01 + <_> + + 0 -1 1524 3.6175400018692017e-02 + + 1.4734740369021893e-02 -6.1349362134933472e-01 + <_> + + 0 -1 1525 7.5545758008956909e-03 + + 1.6166130080819130e-02 -5.8863008022308350e-01 + <_> + + 0 -1 1526 -2.6058950461447239e-03 + + 3.6436009407043457e-01 -3.4624300897121429e-02 + <_> + + 0 -1 1527 6.4669351559132338e-04 + + 6.3444733619689941e-02 -1.8953520059585571e-01 + <_> + + 0 -1 1528 -3.1747641041874886e-03 + + 4.2877858877182007e-01 -2.6968790218234062e-02 + <_> + + 0 -1 1529 -2.3839730769395828e-02 + + -3.6871370673179626e-01 3.3688500523567200e-02 + <_> + + 0 -1 1530 1.1973649961873889e-03 + + -6.2898509204387665e-02 1.9179169833660126e-01 + <_> + + 0 -1 1531 4.4593929487746209e-05 + + -1.1022660136222839e-01 1.2159959971904755e-01 + <_> + + 0 -1 1532 9.1575905680656433e-03 + + 2.5353889912366867e-02 -4.9928730726242065e-01 + <_> + + 0 -1 1533 2.3933469783514738e-03 + + 4.8282090574502945e-02 -2.2685450315475464e-01 + <_> + + 0 -1 1534 -1.1994830565527081e-03 + + 1.0886570066213608e-01 -1.0669539868831635e-01 + <_> + + 0 -1 1535 2.1603968925774097e-03 + + -7.6076626777648926e-02 1.6507959365844727e-01 + <_> + + 0 -1 1536 -1.6556339338421822e-02 + + -5.4167211055755615e-01 2.0711649209260941e-02 + <_> + + 0 -1 1537 -8.8350269943475723e-03 + + -3.6710909008979797e-01 2.8870400041341782e-02 + <_> + + 0 -1 1538 -1.4592399566026870e-05 + + 7.8724071383476257e-02 -1.3622610270977020e-01 + <_> + + 0 -1 1539 -1.4897900400683284e-03 + + 1.1436119675636292e-01 -1.0104899853467941e-01 + <_> + + 0 -1 1540 -3.9764028042554855e-03 + + -1.0250560194253922e-01 1.0466060042381287e-01 + <_> + + 0 -1 1541 -7.2657042182981968e-03 + + 2.2982269525527954e-01 -4.5155581086874008e-02 + <_> + + 0 -1 1542 8.9115025475621223e-03 + + 2.9681159183382988e-02 -4.4235008955001831e-01 + <_> + + 0 -1 1543 -1.8145949579775333e-03 + + 2.3911419510841370e-01 -4.6856120228767395e-02 + <_> + + 0 -1 1544 -3.7546321749687195e-02 + + -1.8569689989089966e-01 6.1533749103546143e-02 + <_> + + 0 -1 1545 -1.0010029654949903e-03 + + 1.4361350238323212e-01 -8.6990483105182648e-02 + <_> + + 0 -1 1546 -3.7357229739427567e-03 + + 2.0245459675788879e-01 -6.1167530715465546e-02 + <_> + + 0 -1 1547 -1.4672010365757160e-05 + + 8.8180869817733765e-02 -1.3037009537220001e-01 + <_> + + 0 -1 1548 9.4379713118541986e-05 + + 5.5626530200242996e-02 -2.0025369524955750e-01 + <_> + + 0 -1 1549 1.5706509293522686e-04 + + -9.8335877060890198e-02 1.1518850177526474e-01 + <_> + + 0 -1 1550 -8.1810058327391744e-04 + + -2.1701550483703613e-01 5.2880410104990005e-02 + <_> + + 0 -1 1551 -5.1689259707927704e-02 + + 5.7715278863906860e-01 -1.8761100247502327e-02 + <_> + + 0 -1 1552 -9.0719409286975861e-02 + + -3.6278849840164185e-01 3.6741130053997040e-02 + <_> + + 0 -1 1553 -1.0959040373563766e-02 + + 1.6787180304527283e-01 -6.9725647568702698e-02 + <_> + + 0 -1 1554 3.7122920621186495e-03 + + 6.0360308736562729e-02 -2.0567069947719574e-01 + <_> + + 0 -1 1555 -1.9315730780363083e-02 + + -5.7397401332855225e-01 1.9705319777131081e-02 + <_> + + 0 -1 1556 -2.7051189914345741e-02 + + 3.4983208775520325e-01 -3.6084290593862534e-02 + <_> + + 0 -1 1557 2.1742910146713257e-02 + + 2.2767079994082451e-02 -6.5319198369979858e-01 + <_> + + 0 -1 1558 9.9608592689037323e-02 + + -3.1259559094905853e-02 3.8271111249923706e-01 + <_> + + 0 -1 1559 4.6517839655280113e-03 + + 1.0088030248880386e-01 -1.2396019697189331e-01 + <_> + + 0 -1 1560 -1.4784580343984999e-05 + + 7.9683482646942139e-02 -1.5573020279407501e-01 + <_> + + 0 -1 1561 -1.6718909610062838e-03 + + 1.7077329754829407e-01 -6.7733809351921082e-02 + <_> + + 0 -1 1562 1.4456630196946207e-05 + + -1.0106030106544495e-01 1.1116830259561539e-01 + <_> + + 0 -1 1563 -2.7084909379482269e-03 + + 1.1312720179557800e-01 -1.0880629718303680e-01 + <_> + 159 + -1.3943890333175659e+00 + + <_> + + 0 -1 1564 -2.2686859592795372e-02 + + 2.7316910028457642e-01 -2.7358779311180115e-01 + <_> + + 0 -1 1565 4.2952829971909523e-04 + + -2.5107958912849426e-01 1.5740729868412018e-01 + <_> + + 0 -1 1566 2.5115790776908398e-03 + + -2.2002549469470978e-01 1.5660229325294495e-01 + <_> + + 0 -1 1567 -6.3958892133086920e-04 + + 7.2609938681125641e-02 -3.8278979063034058e-01 + <_> + + 0 -1 1568 2.6575280353426933e-03 + + -1.1523439735174179e-01 2.3414239287376404e-01 + <_> + + 0 -1 1569 -7.5916409492492676e-02 + + 3.2517579197883606e-01 -8.2622267305850983e-02 + <_> + + 0 -1 1570 1.4966350136091933e-05 + + -3.5640290379524231e-01 5.2353590726852417e-02 + <_> + + 0 -1 1571 -1.4678399566037115e-05 + + 1.0198219865560532e-01 -2.2452689707279205e-01 + <_> + + 0 -1 1572 5.2314779168227687e-05 + + -1.7757849395275116e-01 1.0107079893350601e-01 + <_> + + 0 -1 1573 1.4088390162214637e-04 + + -1.5139770507812500e-01 1.3872760534286499e-01 + <_> + + 0 -1 1574 -2.3411789909005165e-02 + + -1.6435989737510681e-01 1.0702139884233475e-01 + <_> + + 0 -1 1575 2.3284659255295992e-03 + + -8.0950729548931122e-02 2.2333970665931702e-01 + <_> + + 0 -1 1576 -3.3611140679568052e-03 + + -4.4329941272735596e-01 3.4489039331674576e-02 + <_> + + 0 -1 1577 5.8458978310227394e-04 + + -1.1083470284938812e-01 1.7215029895305634e-01 + <_> + + 0 -1 1578 -3.3180968603119254e-04 + + 6.9152593612670898e-02 -2.6321241259574890e-01 + <_> + + 0 -1 1579 -8.8515877723693848e-04 + + -3.4764730930328369e-01 4.3258201330900192e-02 + <_> + + 0 -1 1580 1.4169749920256436e-04 + + -1.4600689709186554e-01 1.0149820148944855e-01 + <_> + + 0 -1 1581 1.4851680025458336e-03 + + 2.9983170330524445e-02 -4.1786131262779236e-01 + <_> + + 0 -1 1582 -7.5329327955842018e-04 + + -2.1557639539241791e-01 6.4534209668636322e-02 + <_> + + 0 -1 1583 1.4260539785027504e-02 + + -8.0013327300548553e-02 1.9511990249156952e-01 + <_> + + 0 -1 1584 -1.4687920156575274e-05 + + 9.7121663391590118e-02 -1.3502350449562073e-01 + <_> + + 0 -1 1585 -9.8925074562430382e-03 + + -5.1035261154174805e-01 2.9335800558328629e-02 + <_> + + 0 -1 1586 -1.8316040514037013e-03 + + 3.2676079869270325e-01 -4.5014020055532455e-02 + <_> + + 0 -1 1587 8.6495577124878764e-04 + + -7.7836513519287109e-02 1.8764939904212952e-01 + <_> + + 0 -1 1588 1.4902660250663757e-01 + + 1.9568990916013718e-02 -6.2450677156448364e-01 + <_> + + 0 -1 1589 -1.7126720398664474e-02 + + -1.8141449987888336e-01 7.3048681020736694e-02 + <_> + + 0 -1 1590 -1.7061959952116013e-03 + + 3.1236839294433594e-01 -4.4152028858661652e-02 + <_> + + 0 -1 1591 3.8261809386312962e-03 + + 5.1518529653549194e-02 -2.9330030083656311e-01 + <_> + + 0 -1 1592 3.8093670736998320e-03 + + -7.6707206666469574e-02 1.7574439942836761e-01 + <_> + + 0 -1 1593 -3.4228331060148776e-04 + + -2.3458020389080048e-01 6.1726640909910202e-02 + <_> + + 0 -1 1594 -4.1697870939970016e-02 + + 4.3929129838943481e-01 -3.6892820149660110e-02 + <_> + + 0 -1 1595 1.9080520723946393e-04 + + -1.3488939404487610e-01 9.7168661653995514e-02 + <_> + + 0 -1 1596 2.6400710339657962e-04 + + -1.6539520025253296e-01 7.3270231485366821e-02 + <_> + + 0 -1 1597 7.9839164391160011e-03 + + -3.3527340739965439e-02 3.6535859107971191e-01 + <_> + + 0 -1 1598 -1.4267410151660442e-02 + + 4.6739241480827332e-01 -2.7154419571161270e-02 + <_> + + 0 -1 1599 -9.4726070528849959e-05 + + -1.5017749369144440e-01 8.7657302618026733e-02 + <_> + + 0 -1 1600 -2.9629279742948711e-04 + + -1.6194540262222290e-01 7.3863230645656586e-02 + <_> + + 0 -1 1601 2.3301010951399803e-03 + + -7.9925157129764557e-02 1.5778550505638123e-01 + <_> + + 0 -1 1602 3.6623800406232476e-04 + + -8.7019346654415131e-02 2.0495669543743134e-01 + <_> + + 0 -1 1603 -4.4499669224023819e-02 + + -2.9891410470008850e-01 4.5648001134395599e-02 + <_> + + 0 -1 1604 -6.0768700204789639e-03 + + 2.3746150732040405e-01 -5.3580708801746368e-02 + <_> + + 0 -1 1605 6.6064862767234445e-04 + + 5.9221439063549042e-02 -2.3569910228252411e-01 + <_> + + 0 -1 1606 7.4699260294437408e-03 + + 5.1304049789905548e-02 -2.3386649787425995e-01 + <_> + + 0 -1 1607 -6.7128022201359272e-03 + + 2.7061641216278076e-01 -5.0031121820211411e-02 + <_> + + 0 -1 1608 4.6589970588684082e-03 + + 4.4932201504707336e-02 -3.0730488896369934e-01 + <_> + + 0 -1 1609 4.9815201200544834e-03 + + -4.8255410045385361e-02 2.6853010058403015e-01 + <_> + + 0 -1 1610 9.9244136363267899e-03 + + 1.9446769729256630e-02 -7.0352387428283691e-01 + <_> + + 0 -1 1611 6.1988402158021927e-03 + + -3.5107269883155823e-02 3.5460400581359863e-01 + <_> + + 0 -1 1612 8.8433362543582916e-03 + + 4.5328389853239059e-02 -2.7485930919647217e-01 + <_> + + 0 -1 1613 1.1110560037195683e-02 + + 2.2391419857740402e-02 -5.0172042846679688e-01 + <_> + + 0 -1 1614 -6.9408811395987868e-04 + + 1.7079490423202515e-01 -6.3849426805973053e-02 + <_> + + 0 -1 1615 8.0377031117677689e-03 + + 8.8937461376190186e-02 -1.6416129469871521e-01 + <_> + + 0 -1 1616 1.4750069567526225e-05 + + -1.3713030517101288e-01 9.6981123089790344e-02 + <_> + + 0 -1 1617 1.2381490087136626e-03 + + -6.9491222500801086e-02 1.6551379859447479e-01 + <_> + + 0 -1 1618 2.6584148872643709e-04 + + -9.6803613007068634e-02 1.2020370364189148e-01 + <_> + + 0 -1 1619 -5.4076651576906443e-04 + + -2.3185379803180695e-01 4.8987850546836853e-02 + <_> + + 0 -1 1620 -5.1092808134853840e-03 + + 3.0391758680343628e-01 -4.0800470858812332e-02 + <_> + + 0 -1 1621 1.5575919533148408e-03 + + -1.0150980204343796e-01 1.4465929567813873e-01 + <_> + + 0 -1 1622 2.8396019712090492e-02 + + 1.5098540484905243e-01 -8.8314309716224670e-02 + <_> + + 0 -1 1623 1.5096530551090837e-03 + + 5.1589738577604294e-02 -2.6199528574943542e-01 + <_> + + 0 -1 1624 1.4308419777080417e-03 + + -4.5497849583625793e-02 2.7584540843963623e-01 + <_> + + 0 -1 1625 1.3030369579792023e-01 + + 2.0329989492893219e-02 -5.7491821050643921e-01 + <_> + + 0 -1 1626 -3.3548770006746054e-03 + + 1.2289950251579285e-01 -8.9937411248683929e-02 + <_> + + 0 -1 1627 2.7094839140772820e-02 + + 1.4342390000820160e-02 -7.8952521085739136e-01 + <_> + + 0 -1 1628 -3.6210110783576965e-01 + + -6.2560427188873291e-01 1.4021329581737518e-02 + <_> + + 0 -1 1629 -6.6879601217806339e-04 + + 2.1966129541397095e-01 -5.2415199577808380e-02 + <_> + + 0 -1 1630 -3.7389241158962250e-02 + + -4.7313681244850159e-01 2.5704499334096909e-02 + <_> + + 0 -1 1631 -7.4386061169207096e-03 + + -5.2914857864379883e-01 2.0038880407810211e-02 + <_> + + 0 -1 1632 1.0443119704723358e-01 + + -2.2909460589289665e-02 5.1592028141021729e-01 + <_> + + 0 -1 1633 -6.1161867051851004e-05 + + 7.7016606926918030e-02 -1.4625400304794312e-01 + <_> + + 0 -1 1634 6.5830379026010633e-04 + + 7.0015281438827515e-02 -1.5569929778575897e-01 + <_> + + 0 -1 1635 9.7367232665419579e-03 + + -3.1582240015268326e-02 3.2754561305046082e-01 + <_> + + 0 -1 1636 -2.9574360232800245e-03 + + -3.4247711300849915e-01 3.2184720039367676e-02 + <_> + + 0 -1 1637 1.6319820424541831e-03 + + -4.9400478601455688e-02 2.2656440734863281e-01 + <_> + + 0 -1 1638 1.3844939880073071e-02 + + 2.0476659759879112e-02 -5.4600667953491211e-01 + <_> + + 0 -1 1639 3.1580299139022827e-02 + + -4.2422048747539520e-02 2.9091480374336243e-01 + <_> + + 0 -1 1640 8.6624026298522949e-03 + + 5.4432898759841919e-02 -2.1892189979553223e-01 + <_> + + 0 -1 1641 -4.6714721247553825e-04 + + -1.8205730617046356e-01 7.1491912007331848e-02 + <_> + + 0 -1 1642 4.1834521107375622e-03 + + -6.7491203546524048e-02 1.7285770177841187e-01 + <_> + + 0 -1 1643 -5.3335628472268581e-03 + + -8.4681749343872070e-01 1.3804829679429531e-02 + <_> + + 0 -1 1644 7.8782793134450912e-03 + + -4.8166718333959579e-02 2.4242730438709259e-01 + <_> + + 0 -1 1645 3.8775329012423754e-03 + + 2.4311149492859840e-02 -4.9763259291648865e-01 + <_> + + 0 -1 1646 -1.6564880206715316e-04 + + 5.5546380579471588e-02 -1.9554230570793152e-01 + <_> + + 0 -1 1647 1.8993400037288666e-02 + + -3.6479089409112930e-02 2.8472718596458435e-01 + <_> + + 0 -1 1648 -3.4308759495615959e-03 + + -3.2813000679016113e-01 3.6524198949337006e-02 + <_> + + 0 -1 1649 1.4614370229537599e-05 + + -1.0106439888477325e-01 1.0622490197420120e-01 + <_> + + 0 -1 1650 1.5978919342160225e-02 + + 3.0059399083256721e-02 -3.9310181140899658e-01 + <_> + + 0 -1 1651 -2.2245719446800649e-04 + + 1.8586489558219910e-01 -7.2151653468608856e-02 + <_> + + 0 -1 1652 2.0615909248590469e-02 + + 1.5250990167260170e-02 -7.8391200304031372e-01 + <_> + + 0 -1 1653 2.8645060956478119e-04 + + 6.8745598196983337e-02 -1.5308310091495514e-01 + <_> + + 0 -1 1654 -5.9233439969830215e-05 + + -1.2545019388198853e-01 9.8448492586612701e-02 + <_> + + 0 -1 1655 -7.6257862383499742e-04 + + 2.1546240150928497e-01 -5.3760219365358353e-02 + <_> + + 0 -1 1656 -1.4181639999151230e-03 + + -1.9876889884471893e-01 5.1982138305902481e-02 + <_> + + 0 -1 1657 -4.4716868549585342e-02 + + -7.5508397817611694e-01 1.2906449846923351e-02 + <_> + + 0 -1 1658 -1.3735699467360973e-03 + + 2.2003139555454254e-01 -5.1394689828157425e-02 + <_> + + 0 -1 1659 -1.5352779999375343e-02 + + -2.1422849595546722e-01 5.3781170397996902e-02 + <_> + + 0 -1 1660 1.3817439787089825e-02 + + -3.5158120095729828e-02 2.9399091005325317e-01 + <_> + + 0 -1 1661 8.7981626391410828e-02 + + 1.6688749194145203e-02 -7.2053599357604980e-01 + <_> + + 0 -1 1662 4.0486121177673340e-01 + + 9.4695771113038063e-03 -8.2725608348846436e-01 + <_> + + 0 -1 1663 1.9231239566579461e-03 + + -5.8016318827867508e-02 1.7696020007133484e-01 + <_> + + 0 -1 1664 -4.0756969247013330e-04 + + 8.7600946426391602e-02 -1.2633720040321350e-01 + <_> + + 0 -1 1665 -2.3862780071794987e-03 + + -4.0085569024085999e-01 2.7183029800653458e-02 + <_> + + 0 -1 1666 5.6235089898109436e-02 + + -1.7541319131851196e-02 7.3818737268447876e-01 + <_> + + 0 -1 1667 4.9810402560979128e-04 + + -7.6487071812152863e-02 1.2697990238666534e-01 + <_> + + 0 -1 1668 5.3285917965695262e-04 + + 5.9596300125122070e-02 -1.7600339651107788e-01 + <_> + + 0 -1 1669 5.9949647402390838e-04 + + -8.2509063184261322e-02 1.3002809882164001e-01 + <_> + + 0 -1 1670 -2.0725550712086260e-04 + + 9.3374222517013550e-02 -1.1726769804954529e-01 + <_> + + 0 -1 1671 8.1314949784427881e-04 + + -8.0063126981258392e-02 1.4701730012893677e-01 + <_> + + 0 -1 1672 -3.4973450237885118e-04 + + 1.1057929694652557e-01 -1.0881700366735458e-01 + <_> + + 0 -1 1673 -2.1448899805545807e-01 + + -3.1701159477233887e-01 4.1711531579494476e-02 + <_> + + 0 -1 1674 5.9010740369558334e-04 + + 4.6280328184366226e-02 -2.3512250185012817e-01 + <_> + + 0 -1 1675 -1.2093999981880188e-01 + + -6.8957090377807617e-01 1.4982040040194988e-02 + <_> + + 0 -1 1676 1.0181350260972977e-01 + + 1.1298139579594135e-02 -7.1199649572372437e-01 + <_> + + 0 -1 1677 3.5208329558372498e-01 + + 1.2944510206580162e-02 -6.7572408914566040e-01 + <_> + + 0 -1 1678 -1.4602140254282858e-05 + + 6.9550313055515289e-02 -1.4288060367107391e-01 + <_> + + 0 -1 1679 -2.3212860524654388e-01 + + -7.5287401676177979e-01 1.1394330300390720e-02 + <_> + + 0 -1 1680 -1.4764709630981088e-03 + + 1.3547790050506592e-01 -8.5470907390117645e-02 + <_> + + 0 -1 1681 9.9324379116296768e-03 + + -4.8758801072835922e-02 2.4582690000534058e-01 + <_> + + 0 -1 1682 -2.6857290416955948e-02 + + -4.3975710868835449e-01 2.5082239881157875e-02 + <_> + + 0 -1 1683 -7.3618912138044834e-03 + + 1.2384700030088425e-01 -9.7226209938526154e-02 + <_> + + 0 -1 1684 -1.9785730168223381e-02 + + -5.0932317972183228e-01 2.3481979966163635e-02 + <_> + + 0 -1 1685 -1.4635100342275109e-05 + + 9.4043917953968048e-02 -1.2145669758319855e-01 + <_> + + 0 -1 1686 -5.4067030549049377e-02 + + -5.4586207866668701e-01 1.9500140100717545e-02 + <_> + + 0 -1 1687 1.1532169766724110e-02 + + -7.6409153640270233e-02 1.3763970136642456e-01 + <_> + + 0 -1 1688 -4.4358540326356888e-03 + + 1.2359759956598282e-01 -9.1719299554824829e-02 + <_> + + 0 -1 1689 8.3216017810627818e-04 + + 6.3659071922302246e-02 -2.0440760254859924e-01 + <_> + + 0 -1 1690 -1.2503969669342041e-01 + + -4.1524758934974670e-01 2.7199100703001022e-02 + <_> + + 0 -1 1691 4.9618318676948547e-02 + + 1.5955109149217606e-02 -6.1666852235794067e-01 + <_> + + 0 -1 1692 -3.0613599810749292e-03 + + 3.6662209033966064e-01 -3.3449448645114899e-02 + <_> + + 0 -1 1693 3.5273379180580378e-03 + + 3.1757980585098267e-02 -3.8478809595108032e-01 + <_> + + 0 -1 1694 -6.6726570948958397e-03 + + 3.2095840573310852e-01 -3.4408681094646454e-02 + <_> + + 0 -1 1695 -2.5795500259846449e-03 + + -3.7870529294013977e-01 2.8562130406498909e-02 + <_> + + 0 -1 1696 7.8417789191007614e-03 + + -2.0479770377278328e-02 5.1704108715057373e-01 + <_> + + 0 -1 1697 3.1101319473236799e-04 + + -1.0809139907360077e-01 9.7204521298408508e-02 + <_> + + 0 -1 1698 2.6113479398190975e-03 + + -8.1770427525043488e-02 1.4691209793090820e-01 + <_> + + 0 -1 1699 7.3472261428833008e-03 + + 2.5131259113550186e-02 -4.3025061488151550e-01 + <_> + + 0 -1 1700 1.3528259296435863e-04 + + -1.4751060307025909e-01 6.7584678530693054e-02 + <_> + + 0 -1 1701 -5.1026898290729150e-05 + + -1.2161359935998917e-01 8.4333047270774841e-02 + <_> + + 0 -1 1702 1.1552199721336365e-03 + + -5.4663829505443573e-02 1.9773660600185394e-01 + <_> + + 0 -1 1703 -8.2931712269783020e-02 + + -5.1923328638076782e-01 2.0582359284162521e-02 + <_> + + 0 -1 1704 -4.6260739327408373e-04 + + 8.5588268935680389e-02 -1.1725299805402756e-01 + <_> + + 0 -1 1705 6.7906372714787722e-04 + + 4.5980118215084076e-02 -2.2628420591354370e-01 + <_> + + 0 -1 1706 1.4090019976720214e-03 + + -4.7628920525312424e-02 2.2722719609737396e-01 + <_> + + 0 -1 1707 2.8954911231994629e-01 + + 1.6701240092515945e-02 -6.3967019319534302e-01 + <_> + + 0 -1 1708 1.9376130774617195e-02 + + -2.2569410502910614e-02 5.0590497255325317e-01 + <_> + + 0 -1 1709 4.2641081381589174e-04 + + 6.6041722893714905e-02 -1.6666300594806671e-01 + <_> + + 0 -1 1710 1.7502580303698778e-03 + + -5.8077909052371979e-02 1.9512599706649780e-01 + <_> + + 0 -1 1711 -3.2605750020593405e-03 + + -2.9101881384849548e-01 3.8328718394041061e-02 + <_> + + 0 -1 1712 1.9519040361046791e-03 + + 5.9565968811511993e-02 -1.6910600662231445e-01 + <_> + + 0 -1 1713 -3.2053990289568901e-03 + + 1.9927769899368286e-01 -5.6053258478641510e-02 + <_> + + 0 -1 1714 1.7617279663681984e-03 + + 5.0697531551122665e-02 -2.1276649832725525e-01 + <_> + + 0 -1 1715 -6.0043102130293846e-03 + + -1.3699269294738770e-01 8.2275278866291046e-02 + <_> + + 0 -1 1716 2.4830829352140427e-03 + + -5.1561661064624786e-02 2.1684220433235168e-01 + <_> + + 0 -1 1717 -1.0821930319070816e-01 + + -7.8375291824340820e-01 1.4433650299906731e-02 + <_> + + 0 -1 1718 -7.5229378417134285e-03 + + 1.3453729450702667e-01 -9.0582698583602905e-02 + <_> + + 0 -1 1719 3.0750989913940430e-02 + + 1.1081690341234207e-01 -9.9475599825382233e-02 + <_> + + 0 -1 1720 -2.8948320541530848e-03 + + 1.9005739688873291e-01 -5.2639260888099670e-02 + <_> + + 0 -1 1721 2.7011099737137556e-03 + + 5.8573558926582336e-02 -1.9851949810981750e-01 + <_> + + 0 -1 1722 1.2562989722937346e-03 + + -7.3565311729907990e-02 1.5436840057373047e-01 + <_> + 173 + -1.4785599708557129e+00 + + <_> + + 0 -1 1723 -2.1460579708218575e-02 + + 3.2505050301551819e-01 -2.0890380442142487e-01 + <_> + + 0 -1 1724 7.6785432174801826e-03 + + -1.3231310248374939e-01 3.0525839328765869e-01 + <_> + + 0 -1 1725 3.4118059556931257e-03 + + -3.0793079733848572e-01 1.1010979861021042e-01 + <_> + + 0 -1 1726 -1.4710490177094471e-05 + + 9.5858857035636902e-02 -2.9641860723495483e-01 + <_> + + 0 -1 1727 1.0538049973547459e-02 + + -7.9252541065216064e-02 3.7234848737716675e-01 + <_> + + 0 -1 1728 -2.5260078837163746e-04 + + 6.7121110856533051e-02 -3.0784338712692261e-01 + <_> + + 0 -1 1729 -3.5665810573846102e-03 + + 1.4667609333992004e-01 -1.7083789408206940e-01 + <_> + + 0 -1 1730 -1.2677359627559781e-03 + + -4.9063721299171448e-01 2.0374119281768799e-02 + <_> + + 0 -1 1731 -6.7669381387531757e-03 + + 2.5767329335212708e-01 -7.4175901710987091e-02 + <_> + + 0 -1 1732 -6.0447258874773979e-04 + + -1.9196410477161407e-01 9.1349847614765167e-02 + <_> + + 0 -1 1733 -2.5375590194016695e-03 + + -3.5663878917694092e-01 5.1547251641750336e-02 + <_> + + 0 -1 1734 -7.0200557820498943e-03 + + 3.9719080924987793e-01 -4.3967988342046738e-02 + <_> + + 0 -1 1735 -5.7049379684031010e-03 + + -5.0015491247177124e-01 2.9825929552316666e-02 + <_> + + 0 -1 1736 1.4744909713044763e-03 + + 5.8546211570501328e-02 -2.6139810681343079e-01 + <_> + + 0 -1 1737 9.2834811657667160e-03 + + -4.2836759239435196e-02 3.3443170785903931e-01 + <_> + + 0 -1 1738 9.9660153500735760e-04 + + -1.0425110161304474e-01 1.6191780567169189e-01 + <_> + + 0 -1 1739 -7.5932733714580536e-02 + + -3.7356320023536682e-01 4.3075688183307648e-02 + <_> + + 0 -1 1740 5.5370710470015183e-05 + + -1.4570540189743042e-01 1.1560150235891342e-01 + <_> + + 0 -1 1741 1.4746849956281949e-05 + + -1.2972679734230042e-01 1.1747740209102631e-01 + <_> + + 0 -1 1742 -1.4875919441692531e-04 + + -1.8002930283546448e-01 7.8782692551612854e-02 + <_> + + 0 -1 1743 3.3751460723578930e-03 + + -7.7242009341716766e-02 1.8596859276294708e-01 + <_> + + 0 -1 1744 3.4271259210072458e-04 + + -1.5393340587615967e-01 1.0472580045461655e-01 + <_> + + 0 -1 1745 -4.5711229904554784e-04 + + -2.2300529479980469e-01 6.1818670481443405e-02 + <_> + + 0 -1 1746 3.2788628595881164e-04 + + 7.9448707401752472e-02 -1.8889829516410828e-01 + <_> + + 0 -1 1747 -9.6754019614309072e-04 + + 1.3137130439281464e-01 -1.0801070183515549e-01 + <_> + + 0 -1 1748 1.0537009686231613e-02 + + 2.2138269618153572e-02 -5.7479751110076904e-01 + <_> + + 0 -1 1749 5.6796409189701080e-03 + + -5.6034579873085022e-02 2.4849580228328705e-01 + <_> + + 0 -1 1750 -8.8083967566490173e-03 + + -3.7167680263519287e-01 4.2726948857307434e-02 + <_> + + 0 -1 1751 -2.8319710865616798e-02 + + -6.2387847900390625e-01 2.0844049751758575e-02 + <_> + + 0 -1 1752 1.3637860305607319e-02 + + 1.4434239827096462e-02 -7.1537137031555176e-01 + <_> + + 0 -1 1753 1.1822770349681377e-02 + + -4.3181091547012329e-02 3.0682548880577087e-01 + <_> + + 0 -1 1754 -6.1035697581246495e-04 + + -2.0418339967727661e-01 6.2115620821714401e-02 + <_> + + 0 -1 1755 -5.6125568225979805e-03 + + 3.6485010385513306e-01 -3.5448960959911346e-02 + <_> + + 0 -1 1756 1.4603640011046082e-05 + + -9.6096910536289215e-02 1.2142290174961090e-01 + <_> + + 0 -1 1757 1.9061230123043060e-03 + + 5.3135868161916733e-02 -2.2978909313678741e-01 + <_> + + 0 -1 1758 -3.6644220817834139e-03 + + 1.9614529609680176e-01 -6.8556912243366241e-02 + <_> + + 0 -1 1759 1.2336249928921461e-03 + + -8.7000347673892975e-02 1.3920229673385620e-01 + <_> + + 0 -1 1760 5.4660569876432419e-03 + + 2.2660890594124794e-02 -4.8329529166221619e-01 + <_> + + 0 -1 1761 -6.1730947345495224e-04 + + -2.1959540247917175e-01 5.5258519947528839e-02 + <_> + + 0 -1 1762 2.9604700393974781e-03 + + -5.0548229366540909e-02 2.7476710081100464e-01 + <_> + + 0 -1 1763 2.8015000745654106e-02 + + 1.8874650821089745e-02 -6.0498368740081787e-01 + <_> + + 0 -1 1764 -7.1651988946541678e-06 + + 1.0836219787597656e-01 -1.0606969892978668e-01 + <_> + + 0 -1 1765 -1.6367150470614433e-02 + + 2.8645038604736328e-01 -3.7137690931558609e-02 + <_> + + 0 -1 1766 1.0280719725415111e-03 + + 5.6318141520023346e-02 -2.1795029938220978e-01 + <_> + + 0 -1 1767 1.3662660494446754e-03 + + -4.6803500503301620e-02 2.3804000020027161e-01 + <_> + + 0 -1 1768 7.6626739464700222e-03 + + 2.1595260128378868e-02 -5.6847488880157471e-01 + <_> + + 0 -1 1769 -4.5117521658539772e-03 + + -3.5794979333877563e-01 3.0485490337014198e-02 + <_> + + 0 -1 1770 -4.3773967772722244e-03 + + 2.3192660510540009e-01 -5.3999818861484528e-02 + <_> + + 0 -1 1771 -7.2474628686904907e-03 + + -4.3440380692481995e-01 2.6374189183115959e-02 + <_> + + 0 -1 1772 7.9146260395646095e-04 + + -9.9924586713314056e-02 1.1088500171899796e-01 + <_> + + 0 -1 1773 6.4166806638240814e-02 + + 1.8938669934868813e-02 -5.7849419116973877e-01 + <_> + + 0 -1 1774 -1.1797840124927461e-04 + + -1.4889569580554962e-01 6.8777203559875488e-02 + <_> + + 0 -1 1775 1.2801289558410645e-02 + + 5.6179329752922058e-02 -2.0865969359874725e-01 + <_> + + 0 -1 1776 -2.7018740773200989e-02 + + 4.5356890559196472e-01 -2.5054579600691795e-02 + <_> + + 0 -1 1777 -6.9431727752089500e-03 + + -5.2916550636291504e-01 2.1800139918923378e-02 + <_> + + 0 -1 1778 3.3396780490875244e-03 + + -3.7295959889888763e-02 3.1198439002037048e-01 + <_> + + 0 -1 1779 -3.8888349081389606e-04 + + -1.5630130469799042e-01 7.0981830358505249e-02 + <_> + + 0 -1 1780 -7.1400677552446723e-04 + + 2.1799430251121521e-01 -5.4069280624389648e-02 + <_> + + 0 -1 1781 1.2549630366265774e-02 + + 1.7357179895043373e-02 -7.8320449590682983e-01 + <_> + + 0 -1 1782 -1.4623020433646161e-05 + + 7.8640103340148926e-02 -1.4212970435619354e-01 + <_> + + 0 -1 1783 -1.2133170384913683e-03 + + -3.1371229887008667e-01 3.4287638962268829e-02 + <_> + + 0 -1 1784 3.6882720887660980e-03 + + -3.8382381200790405e-02 3.0124679207801819e-01 + <_> + + 0 -1 1785 -1.4818239833402913e-05 + + 1.2561169266700745e-01 -9.1703377664089203e-02 + <_> + + 0 -1 1786 3.0302109662443399e-03 + + -2.9543070122599602e-02 3.7889540195465088e-01 + <_> + + 0 -1 1787 5.9340851294109598e-05 + + -1.7745719850063324e-01 7.0102430880069733e-02 + <_> + + 0 -1 1788 -2.9449560315697454e-05 + + 1.2052319943904877e-01 -1.1128979921340942e-01 + <_> + + 0 -1 1789 -1.7771139740943909e-02 + + -4.7108310461044312e-01 2.5600789114832878e-02 + <_> + + 0 -1 1790 7.6775359921157360e-03 + + -4.0757879614830017e-02 2.7021768689155579e-01 + <_> + + 0 -1 1791 -1.8513019382953644e-01 + + -3.0238750576972961e-01 3.8790911436080933e-02 + <_> + + 0 -1 1792 2.7697190642356873e-02 + + 2.6712810620665550e-02 -4.4166600704193115e-01 + <_> + + 0 -1 1793 -2.0427649840712547e-02 + + 2.5086608529090881e-01 -5.5672701448202133e-02 + <_> + + 0 -1 1794 9.0200370177626610e-03 + + 4.7344069927930832e-02 -2.7445980906486511e-01 + <_> + + 0 -1 1795 -1.2504979968070984e-03 + + -1.4971190690994263e-01 7.9667650163173676e-02 + <_> + + 0 -1 1796 -1.0021160356700420e-02 + + 2.4248859286308289e-01 -4.9217909574508667e-02 + <_> + + 0 -1 1797 2.6042328681796789e-04 + + 6.3192427158355713e-02 -1.8544280529022217e-01 + <_> + + 0 -1 1798 1.1920549441128969e-03 + + -8.6547911167144775e-02 1.3552339375019073e-01 + <_> + + 0 -1 1799 3.0391330365091562e-03 + + -7.2965219616889954e-02 1.6479800641536713e-01 + <_> + + 0 -1 1800 -2.9615699531859718e-05 + + 8.2047976553440094e-02 -1.4502969384193420e-01 + <_> + + 0 -1 1801 -1.2226340360939503e-02 + + -5.3014177083969116e-01 2.0405799150466919e-02 + <_> + + 0 -1 1802 -2.8124889358878136e-02 + + -5.5148762464523315e-01 1.7688119783997536e-02 + <_> + + 0 -1 1803 -4.8307109624147415e-02 + + -8.2579791545867920e-01 1.1020540259778500e-02 + <_> + + 0 -1 1804 4.6184109523892403e-03 + + 3.2069969922304153e-02 -3.0115368962287903e-01 + <_> + + 0 -1 1805 -8.4275740664452314e-04 + + 1.7034439742565155e-01 -6.3009433448314667e-02 + <_> + + 0 -1 1806 6.3863280229270458e-03 + + 1.6307299956679344e-02 -7.1346491575241089e-01 + <_> + + 0 -1 1807 -7.7203067485243082e-04 + + 1.6715280711650848e-01 -6.6192783415317535e-02 + <_> + + 0 -1 1808 -2.2645338904112577e-03 + + -3.5107091069221497e-01 2.8168670833110809e-02 + <_> + + 0 -1 1809 -3.7738790269941092e-03 + + 5.2762818336486816e-01 -2.0222609862685204e-02 + <_> + + 0 -1 1810 5.8204168453812599e-03 + + 7.0864066481590271e-02 -1.4675390720367432e-01 + <_> + + 0 -1 1811 -1.2069250456988811e-02 + + 2.3928099870681763e-01 -4.4312968850135803e-02 + <_> + + 0 -1 1812 3.3203759230673313e-03 + + -6.5749533474445343e-02 2.0277680456638336e-01 + <_> + + 0 -1 1813 2.1621929481625557e-03 + + 6.7407980561256409e-02 -1.8125349283218384e-01 + <_> + + 0 -1 1814 1.2229150161147118e-02 + + 2.2559309378266335e-02 -4.9180999398231506e-01 + <_> + + 0 -1 1815 -6.7253508605062962e-03 + + -1.5290050208568573e-01 6.9786652922630310e-02 + <_> + + 0 -1 1816 2.3579499684274197e-03 + + 4.9212101846933365e-02 -2.0838280022144318e-01 + <_> + + 0 -1 1817 -2.2950689308345318e-03 + + 1.2400440126657486e-01 -9.6624918282032013e-02 + <_> + + 0 -1 1818 1.0958530474454165e-03 + + -7.3270753026008606e-02 1.5208619832992554e-01 + <_> + + 0 -1 1819 -1.3427219819277525e-03 + + 1.2233039736747742e-01 -9.5689877867698669e-02 + <_> + + 0 -1 1820 5.4691417608410120e-04 + + -1.3924160599708557e-01 8.4381736814975739e-02 + <_> + + 0 -1 1821 8.4598818793892860e-03 + + 8.9689873158931732e-02 -1.3318899273872375e-01 + <_> + + 0 -1 1822 -9.1597117483615875e-02 + + -6.1854732036590576e-01 2.2867869585752487e-02 + <_> + + 0 -1 1823 -1.1090439511463046e-03 + + 5.8513749390840530e-02 -1.8806450068950653e-01 + <_> + + 0 -1 1824 2.2256910597207025e-05 + + -8.4488280117511749e-02 1.2780910730361938e-01 + <_> + + 0 -1 1825 -1.5437819820363075e-04 + + -1.2228029966354370e-01 8.6046978831291199e-02 + <_> + + 0 -1 1826 -2.6862788945436478e-03 + + -2.4487000703811646e-01 4.4255960732698441e-02 + <_> + + 0 -1 1827 -4.0478641167283058e-03 + + 2.7030688524246216e-01 -4.2200870811939240e-02 + <_> + + 0 -1 1828 -5.3340241312980652e-02 + + -7.6232349872589111e-01 1.4388039708137512e-02 + <_> + + 0 -1 1829 2.8256059158593416e-03 + + -2.9877070337533951e-02 3.9692971110343933e-01 + <_> + + 0 -1 1830 1.4443730004131794e-02 + + 3.0186710879206657e-02 -3.6606648564338684e-01 + <_> + + 0 -1 1831 1.3111650478094816e-03 + + -4.8140369355678558e-02 2.2434459626674652e-01 + <_> + + 0 -1 1832 1.6730680363252759e-03 + + -5.9983398765325546e-02 1.6394190490245819e-01 + <_> + + 0 -1 1833 2.3517120629549026e-02 + + 2.4109700694680214e-02 -4.0492439270019531e-01 + <_> + + 0 -1 1834 -3.5689130891114473e-03 + + 3.1903558969497681e-01 -3.4295879304409027e-02 + <_> + + 0 -1 1835 -2.8193008620291948e-04 + + -1.4874160289764404e-01 7.0669896900653839e-02 + <_> + + 0 -1 1836 1.0215859860181808e-01 + + 1.2840500101447105e-02 -7.7848541736602783e-01 + <_> + + 0 -1 1837 -1.9175480306148529e-01 + + -7.5706577301025391e-01 1.0587760247290134e-02 + <_> + + 0 -1 1838 5.3162658587098122e-03 + + -4.0066570043563843e-02 2.6050180196762085e-01 + <_> + + 0 -1 1839 -1.1487120063975453e-03 + + -1.8017220497131348e-01 6.1610430479049683e-02 + <_> + + 0 -1 1840 -2.8316730260848999e-01 + + -8.4913408756256104e-01 1.1647139675915241e-02 + <_> + + 0 -1 1841 3.3731758594512939e-02 + + 1.2357609719038010e-01 -7.7482230961322784e-02 + <_> + + 0 -1 1842 9.8635945469141006e-03 + + 4.3958030641078949e-02 -2.5541779398918152e-01 + <_> + + 0 -1 1843 -3.1564768869429827e-03 + + 1.8942989408969879e-01 -5.8221038430929184e-02 + <_> + + 0 -1 1844 1.5572150005027652e-03 + + -1.0376139730215073e-01 1.4107349514961243e-01 + <_> + + 0 -1 1845 6.2360420823097229e-02 + + 9.6462322399020195e-03 -8.5804969072341919e-01 + <_> + + 0 -1 1846 1.1480550165288150e-04 + + -8.4419928491115570e-02 1.1312700062990189e-01 + <_> + + 0 -1 1847 -5.9252730570733547e-03 + + -3.1650778651237488e-01 3.2079849392175674e-02 + <_> + + 0 -1 1848 -2.4660851340740919e-04 + + 8.8697679340839386e-02 -1.1085110157728195e-01 + <_> + + 0 -1 1849 1.6946049872785807e-03 + + -5.9657149016857147e-02 2.0904210209846497e-01 + <_> + + 0 -1 1850 9.0623252617660910e-05 + + 7.7441960573196411e-02 -1.2806339561939240e-01 + <_> + + 0 -1 1851 1.1666920036077499e-03 + + -6.1748579144477844e-02 1.5702450275421143e-01 + <_> + + 0 -1 1852 1.2541549513116479e-03 + + 4.4608380645513535e-02 -2.3140360414981842e-01 + <_> + + 0 -1 1853 -6.0275900177657604e-03 + + 9.5281846821308136e-02 -1.0283090174198151e-01 + <_> + + 0 -1 1854 -2.0472849905490875e-01 + + -4.1114759445190430e-01 2.3537550121545792e-02 + <_> + + 0 -1 1855 1.7691280692815781e-02 + + -3.9257150143384933e-02 2.8564441204071045e-01 + <_> + + 0 -1 1856 -1.2875649333000183e-01 + + -8.2030779123306274e-01 1.1735290288925171e-02 + <_> + + 0 -1 1857 1.2868089834228158e-03 + + 5.0858870148658752e-02 -1.7848010361194611e-01 + <_> + + 0 -1 1858 -4.5859832316637039e-03 + + 1.6802109777927399e-01 -6.1582598835229874e-02 + <_> + + 0 -1 1859 4.6391240903176367e-04 + + 6.6747047007083893e-02 -1.4237800240516663e-01 + <_> + + 0 -1 1860 -4.4439961202442646e-03 + + 4.5714980363845825e-01 -2.1746810525655746e-02 + <_> + + 0 -1 1861 3.8220020942389965e-03 + + 1.8094329163432121e-02 -6.0244542360305786e-01 + <_> + + 0 -1 1862 1.3894500443711877e-03 + + 3.4007851034402847e-02 -2.7153480052947998e-01 + <_> + + 0 -1 1863 -7.2111929766833782e-03 + + 2.7312570810317993e-01 -3.6855131387710571e-02 + <_> + + 0 -1 1864 1.6509749693796039e-03 + + -8.4407016634941101e-02 1.3134449720382690e-01 + <_> + + 0 -1 1865 -5.0506892148405313e-04 + + -1.4193339645862579e-01 7.3628053069114685e-02 + <_> + + 0 -1 1866 -1.1205329559743404e-02 + + 3.0093750357627869e-01 -3.4171391278505325e-02 + <_> + + 0 -1 1867 -3.4860160667449236e-04 + + -2.4538309872150421e-01 5.9823978692293167e-02 + <_> + + 0 -1 1868 7.3347258148714900e-04 + + -6.1770260334014893e-02 1.6367949545383453e-01 + <_> + + 0 -1 1869 -9.2969406396150589e-03 + + -3.0236640572547913e-01 3.9257898926734924e-02 + <_> + + 0 -1 1870 2.3957120254635811e-02 + + -2.3900719359517097e-02 4.8340830206871033e-01 + <_> + + 0 -1 1871 3.6422210541786626e-05 + + -1.2283039838075638e-01 9.1258950531482697e-02 + <_> + + 0 -1 1872 5.0458200275897980e-02 + + 1.3529149815440178e-02 -7.7827727794647217e-01 + <_> + + 0 -1 1873 -9.8683983087539673e-03 + + -4.4060459733009338e-01 2.0404359325766563e-02 + <_> + + 0 -1 1874 -1.0851239785552025e-02 + + 2.0165500044822693e-01 -5.2248589694499969e-02 + <_> + + 0 -1 1875 1.7670930537860841e-04 + + -1.3691440224647522e-01 8.3170592784881592e-02 + <_> + + 0 -1 1876 1.2582179624587297e-04 + + 6.1275351792573929e-02 -1.6542710363864899e-01 + <_> + + 0 -1 1877 -7.0588971721008420e-04 + + 1.5219129621982574e-01 -6.6164620220661163e-02 + <_> + + 0 -1 1878 1.1355109745636582e-03 + + -5.4115369915962219e-02 2.1311099827289581e-01 + <_> + + 0 -1 1879 -3.7436310667544603e-03 + + -2.3469850420951843e-01 4.9591001123189926e-02 + <_> + + 0 -1 1880 1.2309269513934851e-03 + + -7.5196012854576111e-02 1.4646540582180023e-01 + <_> + + 0 -1 1881 3.6228948738425970e-04 + + -9.7789406776428223e-02 1.2091729789972305e-01 + <_> + + 0 -1 1882 7.5996189843863249e-04 + + 6.9713920354843140e-02 -1.6278789937496185e-01 + <_> + + 0 -1 1883 -1.8509250367060304e-03 + + -1.8382890522480011e-01 5.7501520961523056e-02 + <_> + + 0 -1 1884 7.9539678990840912e-03 + + -5.8848708868026733e-02 1.8846440315246582e-01 + <_> + + 0 -1 1885 -3.1013600528240204e-04 + + -1.4575460553169250e-01 7.2403199970722198e-02 + <_> + + 0 -1 1886 1.6956350300461054e-03 + + 7.0550262928009033e-02 -1.6740930080413818e-01 + <_> + + 0 -1 1887 2.9058079235255718e-05 + + -1.0341589897871017e-01 9.5376282930374146e-02 + <_> + + 0 -1 1888 1.4466919936239719e-02 + + -1.7532069236040115e-02 5.4767167568206787e-01 + <_> + + 0 -1 1889 -5.7156499475240707e-02 + + -7.4789309501647949e-01 1.6394419595599174e-02 + <_> + + 0 -1 1890 3.0681469943374395e-03 + + 3.8702819496393204e-02 -2.4164369702339172e-01 + <_> + + 0 -1 1891 3.7490210961550474e-03 + + -5.6555431336164474e-02 2.0308320224285126e-01 + <_> + + 0 -1 1892 -1.0643450077623129e-03 + + -2.8211921453475952e-01 3.5207509994506836e-02 + <_> + + 0 -1 1893 -8.9807435870170593e-03 + + 2.1754769980907440e-01 -5.0628181546926498e-02 + <_> + + 0 -1 1894 2.4643479264341295e-04 + + 7.2727531194686890e-02 -1.4768819510936737e-01 + <_> + + 0 -1 1895 2.2197801154106855e-03 + + -3.6754861474037170e-02 2.6939278841018677e-01 + <_> + 169 + -1.3372850418090820e+00 + + <_> + + 0 -1 1896 -3.5328421741724014e-02 + + 2.4123990535736084e-01 -2.7961900830268860e-01 + <_> + + 0 -1 1897 2.6829841081053019e-03 + + -1.6362559795379639e-01 2.3433500528335571e-01 + <_> + + 0 -1 1898 2.1330378949642181e-03 + + -2.0100639760494232e-01 1.5679529309272766e-01 + <_> + + 0 -1 1899 4.2972870869562030e-04 + + -3.7790980935096741e-01 7.4083693325519562e-02 + <_> + + 0 -1 1900 -3.4645918756723404e-02 + + 3.0556240677833557e-01 -8.3546526730060577e-02 + <_> + + 0 -1 1901 -1.4237920368032064e-05 + + 8.2699142396450043e-02 -2.3583950102329254e-01 + <_> + + 0 -1 1902 4.9165110103785992e-03 + + -1.9556050002574921e-01 9.6965387463569641e-02 + <_> + + 0 -1 1903 6.0989488847553730e-03 + + 7.8470550477504730e-02 -2.3209640383720398e-01 + <_> + + 0 -1 1904 7.4874181300401688e-03 + + 7.1725919842720032e-03 -5.1566261053085327e-01 + <_> + + 0 -1 1905 4.2871991172432899e-03 + + 4.0530510246753693e-02 -4.1086289286613464e-01 + <_> + + 0 -1 1906 1.6856180503964424e-02 + + -7.7506266534328461e-02 2.3657779395580292e-01 + <_> + + 0 -1 1907 -1.0347689967602491e-03 + + -4.6704441308975220e-01 3.4468568861484528e-02 + <_> + + 0 -1 1908 1.6820980235934258e-03 + + -6.7206740379333496e-02 2.3671430349349976e-01 + <_> + + 0 -1 1909 -1.2018240056931973e-02 + + -2.2372600436210632e-01 7.4281953275203705e-02 + <_> + + 0 -1 1910 1.3802549801766872e-03 + + -9.9990189075469971e-02 1.5270860493183136e-01 + <_> + + 0 -1 1911 -1.4281070232391357e-01 + + -2.8344118595123291e-01 6.2299348413944244e-02 + <_> + + 0 -1 1912 -1.5463490039110184e-02 + + 2.9084190726280212e-01 -5.3395688533782959e-02 + <_> + + 0 -1 1913 -9.9617196246981621e-04 + + -3.6011821031570435e-01 4.1922971606254578e-02 + <_> + + 0 -1 1914 -2.6956679299473763e-02 + + -4.3736729025840759e-01 3.1731128692626953e-02 + <_> + + 0 -1 1915 -8.7780617177486420e-03 + + -5.0374472141265869e-01 2.5146849453449249e-02 + <_> + + 0 -1 1916 4.2969950300175697e-05 + + -1.5406499803066254e-01 8.8478356599807739e-02 + <_> + + 0 -1 1917 -6.2619051896035671e-03 + + 2.2435919940471649e-01 -5.9849821031093597e-02 + <_> + + 0 -1 1918 -6.4296770142391324e-04 + + -2.4377089738845825e-01 5.9389740228652954e-02 + <_> + + 0 -1 1919 -1.5573870041407645e-04 + + -1.6867999732494354e-01 7.8476317226886749e-02 + <_> + + 0 -1 1920 4.1139780660159886e-04 + + -8.9017570018768311e-02 1.4019380509853363e-01 + <_> + + 0 -1 1921 1.8635790329426527e-03 + + 3.8603689521551132e-02 -3.2118970155715942e-01 + <_> + + 0 -1 1922 1.6059159534052014e-03 + + -7.8801520168781281e-02 1.5801469981670380e-01 + <_> + + 0 -1 1923 8.6740078404545784e-04 + + 5.4134480655193329e-02 -2.3538430035114288e-01 + <_> + + 0 -1 1924 -7.9801032552495599e-04 + + 1.3330009579658508e-01 -9.5731817185878754e-02 + <_> + + 0 -1 1925 -4.8548211343586445e-03 + + -2.0736059546470642e-01 6.1038620769977570e-02 + <_> + + 0 -1 1926 -1.1426740325987339e-02 + + 1.7201809585094452e-01 -7.1152277290821075e-02 + <_> + + 0 -1 1927 8.7062492966651917e-03 + + -7.2185672819614410e-02 1.9082969427108765e-01 + <_> + + 0 -1 1928 -1.1634400580078363e-03 + + -1.3751690089702606e-01 9.1818131506443024e-02 + <_> + + 0 -1 1929 6.8914610892534256e-03 + + 9.6225969493389130e-02 -1.3246159255504608e-01 + <_> + + 0 -1 1930 -2.2426620125770569e-03 + + 3.5683241486549377e-01 -3.6280050873756409e-02 + <_> + + 0 -1 1931 1.2301520444452763e-02 + + 4.6940989792346954e-02 -3.0623328685760498e-01 + <_> + + 0 -1 1932 3.9963610470294952e-03 + + -8.2999393343925476e-02 1.5486459434032440e-01 + <_> + + 0 -1 1933 -2.2026189981261268e-05 + + 1.1778099834918976e-01 -1.1899650096893311e-01 + <_> + + 0 -1 1934 5.8708270080387592e-04 + + 5.6864660233259201e-02 -2.2509899735450745e-01 + <_> + + 0 -1 1935 -5.8760121464729309e-03 + + 2.6625269651412964e-01 -4.4570129364728928e-02 + <_> + + 0 -1 1936 4.3262130930088460e-04 + + 5.8049838989973068e-02 -2.1173800528049469e-01 + <_> + + 0 -1 1937 4.7852578572928905e-03 + + -4.0710568428039551e-02 2.9509121179580688e-01 + <_> + + 0 -1 1938 4.5480159315047786e-05 + + -1.8201610445976257e-01 6.0179539024829865e-02 + <_> + + 0 -1 1939 2.5633929762989283e-03 + + -8.7039761245250702e-02 1.2692840397357941e-01 + <_> + + 0 -1 1940 -4.7383471392095089e-03 + + 2.3961830139160156e-01 -4.9914900213479996e-02 + <_> + + 0 -1 1941 4.4647231698036194e-03 + + 4.0540020912885666e-02 -3.2467570900917053e-01 + <_> + + 0 -1 1942 -6.7061209119856358e-03 + + -3.2789680361747742e-01 3.2299648970365524e-02 + <_> + + 0 -1 1943 7.1761049330234528e-02 + + -2.3713670670986176e-02 4.7772058844566345e-01 + <_> + + 0 -1 1944 3.0584860593080521e-02 + + 1.6793910413980484e-02 -7.8061228990554810e-01 + <_> + + 0 -1 1945 3.8672669325023890e-03 + + -2.4876890704035759e-02 5.1260662078857422e-01 + <_> + + 0 -1 1946 -5.2802208811044693e-02 + + -5.0759661197662354e-01 2.3873040452599525e-02 + <_> + + 0 -1 1947 -6.5651582553982735e-04 + + -2.0122329890727997e-01 4.9672801047563553e-02 + <_> + + 0 -1 1948 8.5785267874598503e-03 + + -4.5007020235061646e-02 2.3518909513950348e-01 + <_> + + 0 -1 1949 -1.2620680499821901e-03 + + -1.9962050020694733e-01 5.5564209818840027e-02 + <_> + + 0 -1 1950 1.4215289615094662e-02 + + -4.6983979642391205e-02 2.0781150460243225e-01 + <_> + + 0 -1 1951 1.6393810510635376e-01 + + 1.4973269775509834e-02 -6.5025687217712402e-01 + <_> + + 0 -1 1952 1.4837640523910522e-01 + + 8.1885885447263718e-03 -9.4296187162399292e-01 + <_> + + 0 -1 1953 1.4631190424552187e-05 + + -1.2383759766817093e-01 8.2489579916000366e-02 + <_> + + 0 -1 1954 -3.3909391611814499e-02 + + -2.2818760573863983e-01 4.3302498757839203e-02 + <_> + + 0 -1 1955 3.8288589566946030e-03 + + -3.7276919931173325e-02 2.7613049745559692e-01 + <_> + + 0 -1 1956 8.0947913229465485e-03 + + 2.8445359319448471e-02 -3.9388808608055115e-01 + <_> + + 0 -1 1957 -7.0019601844251156e-04 + + 1.2199380248785019e-01 -9.2714257538318634e-02 + <_> + + 0 -1 1958 3.4412490203976631e-03 + + -4.8972681164741516e-02 2.0617230236530304e-01 + <_> + + 0 -1 1959 -1.6337490081787109e-01 + + -6.1850237846374512e-01 1.6467820852994919e-02 + <_> + + 0 -1 1960 6.5640709362924099e-03 + + 1.1007189750671387e-01 -9.2340007424354553e-02 + <_> + + 0 -1 1961 4.4708838686347008e-04 + + -1.3933309912681580e-01 7.7039696276187897e-02 + <_> + + 0 -1 1962 1.7568700015544891e-02 + + 9.7569692879915237e-03 -8.0032902956008911e-01 + <_> + + 0 -1 1963 -1.9571769516915083e-03 + + 2.8000330924987793e-01 -3.6428239196538925e-02 + <_> + + 0 -1 1964 5.1913037896156311e-04 + + 5.3515341132879257e-02 -1.9425579905509949e-01 + <_> + + 0 -1 1965 9.6273031085729599e-03 + + 3.1317751854658127e-02 -3.1802541017532349e-01 + <_> + + 0 -1 1966 -5.0332810729742050e-02 + + 5.6659060716629028e-01 -1.8494980409741402e-02 + <_> + + 0 -1 1967 -6.4624901860952377e-03 + + -4.1894671320915222e-01 2.7350850403308868e-02 + <_> + + 0 -1 1968 -5.2857249975204468e-03 + + 1.7756509780883789e-01 -5.8377739042043686e-02 + <_> + + 0 -1 1969 9.9454462528228760e-02 + + 1.6487719491124153e-02 -5.8526170253753662e-01 + <_> + + 0 -1 1970 2.1917840058449656e-04 + + -1.0714250057935715e-01 9.1884173452854156e-02 + <_> + + 0 -1 1971 -4.3873358663404360e-05 + + 7.8036926686763763e-02 -1.2723919749259949e-01 + <_> + + 0 -1 1972 -6.7227642284706235e-04 + + -2.5709420442581177e-01 3.8843378424644470e-02 + <_> + + 0 -1 1973 1.1754270235542208e-04 + + -7.9695962369441986e-02 1.2093970179557800e-01 + <_> + + 0 -1 1974 4.6061190962791443e-01 + + 1.3886069878935814e-02 -6.5241271257400513e-01 + <_> + + 0 -1 1975 1.1115600354969501e-02 + + 1.3871660456061363e-02 -6.0222518444061279e-01 + <_> + + 0 -1 1976 9.0776477009057999e-03 + + -3.6118660122156143e-02 2.5702419877052307e-01 + <_> + + 0 -1 1977 -4.9597548786550760e-04 + + 1.1017049849033356e-01 -8.9249506592750549e-02 + <_> + + 0 -1 1978 1.5807070303708315e-03 + + 4.8131279647350311e-02 -2.0215910673141479e-01 + <_> + + 0 -1 1979 -6.9012932479381561e-02 + + -8.1536060571670532e-01 1.0660010389983654e-02 + <_> + + 0 -1 1980 1.9330780196469277e-04 + + -1.1231829971075058e-01 8.5046432912349701e-02 + <_> + + 0 -1 1981 7.8813207801431417e-04 + + -5.5200818926095963e-02 1.7654439806938171e-01 + <_> + + 0 -1 1982 9.5367128960788250e-04 + + 5.4411198943853378e-02 -1.8674199283123016e-01 + <_> + + 0 -1 1983 -2.3191540967673063e-03 + + -2.7544409036636353e-01 3.8513321429491043e-02 + <_> + + 0 -1 1984 9.5087959198281169e-04 + + -6.8218901753425598e-02 1.6082139313220978e-01 + <_> + + 0 -1 1985 9.5385108143091202e-03 + + -3.8826879113912582e-02 3.0370831489562988e-01 + <_> + + 0 -1 1986 -1.4489189721643925e-02 + + -4.6989730000495911e-01 2.3550020530819893e-02 + <_> + + 0 -1 1987 1.0756050236523151e-02 + + 2.0565100014209747e-02 -4.7243130207061768e-01 + <_> + + 0 -1 1988 -2.0074830390512943e-03 + + -2.7946698665618896e-01 3.6021549254655838e-02 + <_> + + 0 -1 1989 -1.7316909506917000e-03 + + 2.0902790129184723e-01 -4.6300981193780899e-02 + <_> + + 0 -1 1990 1.5234799683094025e-01 + + 1.4934250153601170e-02 -6.0461127758026123e-01 + <_> + + 0 -1 1991 6.3340878114104271e-04 + + 5.0307150930166245e-02 -1.8277199566364288e-01 + <_> + + 0 -1 1992 -8.2793915644288063e-03 + + 3.6463031172752380e-01 -2.6474289596080780e-02 + <_> + + 0 -1 1993 1.3667670078575611e-02 + + 1.2511620298027992e-02 -8.9023828506469727e-01 + <_> + + 0 -1 1994 2.0979309920221567e-03 + + -8.0247193574905396e-02 1.2989950180053711e-01 + <_> + + 0 -1 1995 -8.9776562526822090e-03 + + 1.7411080002784729e-01 -6.1771109700202942e-02 + <_> + + 0 -1 1996 1.2094390112906694e-03 + + 6.8711720407009125e-02 -1.6561290621757507e-01 + <_> + + 0 -1 1997 6.8200258538126945e-03 + + 5.7795759290456772e-02 -1.8231619894504547e-01 + <_> + + 0 -1 1998 -1.8268059939146042e-03 + + 1.3340330123901367e-01 -7.5343966484069824e-02 + <_> + + 0 -1 1999 7.9908408224582672e-03 + + -4.5094471424818039e-02 2.4594159424304962e-01 + <_> + + 0 -1 2000 -2.5262041017413139e-03 + + -2.0763960480690002e-01 5.2334129810333252e-02 + <_> + + 0 -1 2001 -7.4825510382652283e-02 + + -5.4688757658004761e-01 1.7803389579057693e-02 + <_> + + 0 -1 2002 -3.3099399879574776e-03 + + 3.3455818891525269e-01 -2.8966419398784637e-02 + <_> + + 0 -1 2003 8.2276277244091034e-03 + + 4.1579861193895340e-02 -2.6652270555496216e-01 + <_> + + 0 -1 2004 3.1686299480497837e-03 + + -4.1817110031843185e-02 2.9769781231880188e-01 + <_> + + 0 -1 2005 1.5170290134847164e-02 + + 4.3392360210418701e-02 -2.4617969989776611e-01 + <_> + + 0 -1 2006 -1.5946379862725735e-03 + + 1.5057189762592316e-01 -7.3017738759517670e-02 + <_> + + 0 -1 2007 -8.5226353257894516e-03 + + -1.5050080418586731e-01 6.9656036794185638e-02 + <_> + + 0 -1 2008 -1.1418120004236698e-02 + + 1.2974749505519867e-01 -9.5122329890727997e-02 + <_> + + 0 -1 2009 -2.8856399655342102e-01 + + -2.1124540269374847e-01 4.7410819679498672e-02 + <_> + + 0 -1 2010 -3.9014229550957680e-03 + + -2.6843780279159546e-01 3.8698658347129822e-02 + <_> + + 0 -1 2011 -3.5567739978432655e-03 + + 2.3385030031204224e-01 -4.5723881572484970e-02 + <_> + + 0 -1 2012 -6.4394129440188408e-03 + + -6.0463881492614746e-01 1.6156049445271492e-02 + <_> + + 0 -1 2013 -7.4861319735646248e-03 + + 1.6867969930171967e-01 -5.5975880473852158e-02 + <_> + + 0 -1 2014 2.3621210129931569e-04 + + 5.3596749901771545e-02 -2.1872919797897339e-01 + <_> + + 0 -1 2015 2.6099249720573425e-02 + + -5.3937491029500961e-02 2.2728930413722992e-01 + <_> + + 0 -1 2016 -1.7809759592637420e-03 + + 8.6759522557258606e-02 -1.2009979784488678e-01 + <_> + + 0 -1 2017 -1.1987469770247117e-04 + + -1.5347549319267273e-01 7.0707783102989197e-02 + <_> + + 0 -1 2018 -6.8248361349105835e-03 + + -3.7341019511222839e-01 2.6779960840940475e-02 + <_> + + 0 -1 2019 -1.3119089999236166e-04 + + -1.1640869826078415e-01 8.7211161851882935e-02 + <_> + + 0 -1 2020 -1.8228540429845452e-03 + + 1.5664499998092651e-01 -6.8006090819835663e-02 + <_> + + 0 -1 2021 2.6267999783158302e-03 + + -3.6987219005823135e-02 2.6393121480941772e-01 + <_> + + 0 -1 2022 -7.0677183568477631e-02 + + -2.8295999765396118e-01 3.5035520792007446e-02 + <_> + + 0 -1 2023 1.8061319366097450e-02 + + -2.8041649609804153e-02 3.5313779115676880e-01 + <_> + + 0 -1 2024 9.2649407451972365e-04 + + 4.4600278139114380e-02 -2.2788539528846741e-01 + <_> + + 0 -1 2025 -5.3023721557110548e-04 + + -2.0866680145263672e-01 6.2718503177165985e-02 + <_> + + 0 -1 2026 3.6058931145817041e-03 + + -6.7796908318996429e-02 1.4900009334087372e-01 + <_> + + 0 -1 2027 8.5915643721818924e-03 + + -4.5626759529113770e-02 2.3078480362892151e-01 + <_> + + 0 -1 2028 -8.8329352438449860e-03 + + -4.1117089986801147e-01 2.8230689465999603e-02 + <_> + + 0 -1 2029 4.0959479520097375e-04 + + 5.3656630218029022e-02 -1.8243549764156342e-01 + <_> + + 0 -1 2030 -2.5011589750647545e-03 + + 1.6313549876213074e-01 -6.0954701155424118e-02 + <_> + + 0 -1 2031 -1.4622169546782970e-02 + + -4.9988400936126709e-01 1.8572760745882988e-02 + <_> + + 0 -1 2032 -6.3790678977966309e-02 + + -4.8329600691795349e-01 1.7903389409184456e-02 + <_> + + 0 -1 2033 -1.6671139746904373e-02 + + -2.6661589741706848e-01 3.4886009991168976e-02 + <_> + + 0 -1 2034 -1.2526069767773151e-02 + + 3.4061339497566223e-01 -2.8094800189137459e-02 + <_> + + 0 -1 2035 4.8325158655643463e-02 + + -3.3176191151142120e-02 2.9025658965110779e-01 + <_> + + 0 -1 2036 1.3246550224721432e-03 + + 3.7181440740823746e-02 -2.6850658655166626e-01 + <_> + + 0 -1 2037 -2.2221319377422333e-01 + + -8.9892768859863281e-01 1.0064439848065376e-02 + <_> + + 0 -1 2038 1.2954319827258587e-03 + + -1.0161759704351425e-01 9.0588621795177460e-02 + <_> + + 0 -1 2039 1.3794669881463051e-02 + + -7.4244648218154907e-02 1.4314259588718414e-01 + <_> + + 0 -1 2040 8.5643801139667630e-04 + + 5.9753969311714172e-02 -1.8660190701484680e-01 + <_> + + 0 -1 2041 -2.3317540064454079e-02 + + -6.9259917736053467e-01 1.3667319901287556e-02 + <_> + + 0 -1 2042 1.6281680436804891e-03 + + -6.1060748994350433e-02 1.5505290031433105e-01 + <_> + + 0 -1 2043 -1.2380329892039299e-02 + + -1.5146850049495697e-01 6.1767600476741791e-02 + <_> + + 0 -1 2044 1.8393599893897772e-03 + + -3.7167988717556000e-02 2.4822179973125458e-01 + <_> + + 0 -1 2045 3.5529870074242353e-03 + + -2.9200790449976921e-02 3.3592289686203003e-01 + <_> + + 0 -1 2046 1.0305979521945119e-03 + + 3.7694081664085388e-02 -2.9085698723793030e-01 + <_> + + 0 -1 2047 2.9916960556874983e-05 + + -8.8014192879199982e-02 1.0515210032463074e-01 + <_> + + 0 -1 2048 -4.1505339322611690e-04 + + 6.5726242959499359e-02 -1.5021100640296936e-01 + <_> + + 0 -1 2049 -1.4631619706051424e-05 + + 7.8170351684093475e-02 -1.1962439864873886e-01 + <_> + + 0 -1 2050 -4.3779090046882629e-03 + + 2.0752459764480591e-01 -5.2089329808950424e-02 + <_> + + 0 -1 2051 4.7036199248395860e-04 + + 6.3348479568958282e-02 -1.8767729401588440e-01 + <_> + + 0 -1 2052 1.4788640328333713e-05 + + -9.5828853547573090e-02 1.1213099956512451e-01 + <_> + + 0 -1 2053 3.7048431113362312e-04 + + -9.8723009228706360e-02 9.8647676408290863e-02 + <_> + + 0 -1 2054 -1.8590339459478855e-03 + + -2.6873630285263062e-01 3.8352578878402710e-02 + <_> + + 0 -1 2055 -7.0764529518783092e-03 + + -1.5984000265598297e-01 5.7841330766677856e-02 + <_> + + 0 -1 2056 1.4920010231435299e-02 + + -5.1178149878978729e-02 1.9242909550666809e-01 + <_> + + 0 -1 2057 -5.0713191740214825e-03 + + 1.3863259553909302e-01 -1.1121229827404022e-01 + <_> + + 0 -1 2058 -1.5005500055849552e-02 + + 4.8583930730819702e-01 -1.8811760470271111e-02 + <_> + + 0 -1 2059 -2.0439480431377888e-03 + + -3.2754859328269958e-01 2.7816310524940491e-02 + <_> + + 0 -1 2060 -1.3060690253041685e-04 + + 9.8868042230606079e-02 -8.4957577288150787e-02 + <_> + + 0 -1 2061 8.8742617517709732e-03 + + -2.5235600769519806e-02 3.2389879226684570e-01 + <_> + + 0 -1 2062 7.0397509261965752e-04 + + 5.6327521800994873e-02 -1.7392079532146454e-01 + <_> + + 0 -1 2063 -2.5402469560503960e-02 + + 1.9675390422344208e-01 -4.7362301498651505e-02 + <_> + + 0 -1 2064 -9.3743661418557167e-03 + + -1.5204219520092010e-01 5.9932630509138107e-02 + <_> + 178 + -1.3418790102005005e+00 + + <_> + + 0 -1 2065 4.0453020483255386e-02 + + -2.3637829720973969e-01 2.8865531086921692e-01 + <_> + + 0 -1 2066 -1.1056049726903439e-02 + + 1.6062900424003601e-01 -2.6259741187095642e-01 + <_> + + 0 -1 2067 -3.9778949576430023e-04 + + 1.1591099947690964e-01 -2.7081018686294556e-01 + <_> + + 0 -1 2068 1.0191530454903841e-03 + + -2.0969370007514954e-01 1.3642899692058563e-01 + <_> + + 0 -1 2069 3.6101979203522205e-03 + + -2.1725459396839142e-01 1.2617790699005127e-01 + <_> + + 0 -1 2070 4.4545531272888184e-04 + + -1.5974539518356323e-01 1.2596489489078522e-01 + <_> + + 0 -1 2071 5.8226222172379494e-03 + + -1.5484449267387390e-01 9.7783811390399933e-02 + <_> + + 0 -1 2072 -2.1416260860860348e-03 + + -3.6377671360969543e-01 4.0103349834680557e-02 + <_> + + 0 -1 2073 -2.6691620587371290e-04 + + 8.4470756351947784e-02 -1.7496100068092346e-01 + <_> + + 0 -1 2074 -5.4352330043911934e-03 + + -3.1830930709838867e-01 4.9786038696765900e-02 + <_> + + 0 -1 2075 -1.5426309546455741e-03 + + -2.1333709359169006e-01 6.4884513616561890e-02 + <_> + + 0 -1 2076 -2.7932289522141218e-03 + + 2.5483250617980957e-01 -6.5170928835868835e-02 + <_> + + 0 -1 2077 1.3845940120518208e-03 + + 3.9304580539464951e-02 -3.7404829263687134e-01 + <_> + + 0 -1 2078 -3.2193479128181934e-03 + + 2.6290428638458252e-01 -5.6396361440420151e-02 + <_> + + 0 -1 2079 -9.7977351397275925e-03 + + 3.2044389843940735e-01 -4.6382289379835129e-02 + <_> + + 0 -1 2080 -1.7625789623707533e-03 + + 1.5050819516181946e-01 -8.8892437517642975e-02 + <_> + + 0 -1 2081 -3.6096889525651932e-02 + + -4.3137839436531067e-01 3.1785801053047180e-02 + <_> + + 0 -1 2082 2.0813369192183018e-03 + + -6.5957918763160706e-02 1.9275289773941040e-01 + <_> + + 0 -1 2083 -6.0533690266311169e-03 + + -3.1374609470367432e-01 5.1007431000471115e-02 + <_> + + 0 -1 2084 3.7253410555422306e-03 + + -6.1402589082717896e-02 2.5631371140480042e-01 + <_> + + 0 -1 2085 5.0668260082602501e-03 + + 5.7962730526924133e-02 -2.4340160191059113e-01 + <_> + + 0 -1 2086 2.8038739692419767e-03 + + -7.0329703390598297e-02 2.1375860273838043e-01 + <_> + + 0 -1 2087 1.5925259795039892e-03 + + 2.6637760922312737e-02 -5.1129138469696045e-01 + <_> + + 0 -1 2088 2.9422679290291853e-05 + + -2.1710200607776642e-01 6.4985051751136780e-02 + <_> + + 0 -1 2089 -2.2399190129362978e-05 + + 8.1582568585872650e-02 -1.5135610103607178e-01 + <_> + + 0 -1 2090 6.7072827368974686e-04 + + 1.0502190142869949e-01 -1.1787360161542892e-01 + <_> + + 0 -1 2091 -1.5262300148606300e-03 + + -3.4620371460914612e-01 3.9244089275598526e-02 + <_> + + 0 -1 2092 1.8151829717680812e-03 + + -7.4669457972049713e-02 1.6847759485244751e-01 + <_> + + 0 -1 2093 5.8078771689906716e-04 + + -9.7952410578727722e-02 1.4192749559879303e-01 + <_> + + 0 -1 2094 -8.9623313397169113e-03 + + -1.9601620733737946e-01 6.6268041729927063e-02 + <_> + + 0 -1 2095 1.1146809905767441e-01 + + 1.7000140622258186e-02 -6.4917707443237305e-01 + <_> + + 0 -1 2096 -1.7872039461508393e-04 + + -1.4053599536418915e-01 8.0108702182769775e-02 + <_> + + 0 -1 2097 -4.6587768010795116e-03 + + 1.9530229270458221e-01 -5.8602340519428253e-02 + <_> + + 0 -1 2098 3.4576000180095434e-03 + + 5.9805799275636673e-02 -2.1990789473056793e-01 + <_> + + 0 -1 2099 -1.9979270291514695e-04 + + -1.3726149499416351e-01 8.3430230617523193e-02 + <_> + + 0 -1 2100 -4.8079751431941986e-03 + + 5.5041921138763428e-01 -2.0715299993753433e-02 + <_> + + 0 -1 2101 -7.3389292083447799e-06 + + 7.5302027165889740e-02 -1.4486590027809143e-01 + <_> + + 0 -1 2102 -3.5799799952656031e-03 + + 2.6277220249176025e-01 -4.2550459504127502e-02 + <_> + + 0 -1 2103 1.1689850362017751e-03 + + -1.0984169691801071e-01 1.2971849739551544e-01 + <_> + + 0 -1 2104 3.2639548182487488e-02 + + 3.1038379296660423e-02 -3.9474260807037354e-01 + <_> + + 0 -1 2105 1.1596709955483675e-03 + + 5.2021898329257965e-02 -2.2035829722881317e-01 + <_> + + 0 -1 2106 -1.4262240147218108e-03 + + 1.0745699703693390e-01 -1.0067079961299896e-01 + <_> + + 0 -1 2107 -2.3668329417705536e-01 + + -7.3174351453781128e-01 1.6999609768390656e-02 + <_> + + 0 -1 2108 1.9279429398011416e-04 + + -1.3248440623283386e-01 7.8186027705669403e-02 + <_> + + 0 -1 2109 -1.7292149364948273e-02 + + -9.7199842333793640e-02 1.1069560050964355e-01 + <_> + + 0 -1 2110 -1.2431619688868523e-03 + + 1.7741470038890839e-01 -7.2548337280750275e-02 + <_> + + 0 -1 2111 2.1754560293629766e-05 + + -9.6952050924301147e-02 1.0899409651756287e-01 + <_> + + 0 -1 2112 3.0975879053585231e-04 + + 6.2249891459941864e-02 -1.7384719848632812e-01 + <_> + + 0 -1 2113 -1.1590570211410522e-02 + + 2.6162809133529663e-01 -4.1994079947471619e-02 + <_> + + 0 -1 2114 1.8150920048356056e-02 + + 2.6353549212217331e-02 -4.4685411453247070e-01 + <_> + + 0 -1 2115 8.0223509576171637e-04 + + -1.2143869698047638e-01 8.7092787027359009e-02 + <_> + + 0 -1 2116 -1.4258639421314001e-03 + + 1.9236080348491669e-01 -5.2987430244684219e-02 + <_> + + 0 -1 2117 -2.4536260752938688e-04 + + -1.6683700680732727e-01 6.5604820847511292e-02 + <_> + + 0 -1 2118 2.2050029656384140e-05 + + -9.3477472662925720e-02 1.0711719840764999e-01 + <_> + + 0 -1 2119 4.7658861149102449e-04 + + -8.0596633255481720e-02 1.2512689828872681e-01 + <_> + + 0 -1 2120 4.0533850551582873e-04 + + 6.8990617990493774e-02 -1.5740759670734406e-01 + <_> + + 0 -1 2121 -1.6471749171614647e-02 + + -5.9667861461639404e-01 1.8876109272241592e-02 + <_> + + 0 -1 2122 2.2267159074544907e-03 + + -4.5803830027580261e-02 2.3071089386940002e-01 + <_> + + 0 -1 2123 4.9383189529180527e-02 + + 1.9837729632854462e-02 -5.9306108951568604e-01 + <_> + + 0 -1 2124 8.6411498486995697e-03 + + 2.8697369620203972e-02 -3.5161119699478149e-01 + <_> + + 0 -1 2125 -4.8241391777992249e-03 + + 2.2474339604377747e-01 -4.8463210463523865e-02 + <_> + + 0 -1 2126 -8.6174849420785904e-03 + + -5.7088959217071533e-01 1.9183190539479256e-02 + <_> + + 0 -1 2127 -5.7220697635784745e-04 + + 1.1697269976139069e-01 -8.8938057422637939e-02 + <_> + + 0 -1 2128 1.1997730471193790e-03 + + 8.4181122481822968e-02 -1.2565499544143677e-01 + <_> + + 0 -1 2129 2.6049909647554159e-03 + + 5.9500031173229218e-02 -2.0638149976730347e-01 + <_> + + 0 -1 2130 -1.4789920533075929e-03 + + 2.5114980340003967e-01 -4.7535050660371780e-02 + <_> + + 0 -1 2131 -2.5746721029281616e-01 + + -7.3038768768310547e-01 1.5440680086612701e-02 + <_> + + 0 -1 2132 -1.2104290071874857e-03 + + 1.8646970391273499e-01 -5.5789809674024582e-02 + <_> + + 0 -1 2133 3.4140399657189846e-04 + + 6.7707672715187073e-02 -1.5597160160541534e-01 + <_> + + 0 -1 2134 3.1749058980494738e-03 + + 3.5003460943698883e-02 -2.9529309272766113e-01 + <_> + + 0 -1 2135 4.4338819384574890e-01 + + 1.4550019986927509e-02 -6.1034661531448364e-01 + <_> + + 0 -1 2136 3.9458259940147400e-02 + + -4.5779328793287277e-02 2.2927519679069519e-01 + <_> + + 0 -1 2137 3.0410829931497574e-03 + + 1.6304129734635353e-02 -5.7491117715835571e-01 + <_> + + 0 -1 2138 -1.4853020012378693e-01 + + -5.6220901012420654e-01 1.5771050006151199e-02 + <_> + + 0 -1 2139 4.4339009036775678e-05 + + -9.1284371912479401e-02 1.0920979827642441e-01 + <_> + + 0 -1 2140 2.2139810025691986e-03 + + -4.7668289393186569e-02 2.2291789948940277e-01 + <_> + + 0 -1 2141 8.7831966578960419e-02 + + 2.6718059554696083e-02 -4.0396329760551453e-01 + <_> + + 0 -1 2142 -2.2798930294811726e-03 + + -1.6160930693149567e-01 6.6071107983589172e-02 + <_> + + 0 -1 2143 -1.4653969628852792e-05 + + 8.5298359394073486e-02 -1.2724019587039948e-01 + <_> + + 0 -1 2144 1.2313240440562367e-03 + + -6.5917477011680603e-02 1.6606420278549194e-01 + <_> + + 0 -1 2145 4.5110988616943359e-01 + + 1.3457960449159145e-02 -7.1525502204895020e-01 + <_> + + 0 -1 2146 -2.4518640711903572e-02 + + -4.3282639980316162e-01 2.0400719717144966e-02 + <_> + + 0 -1 2147 -1.1901959805982187e-04 + + 8.9420333504676819e-02 -1.1834760010242462e-01 + <_> + + 0 -1 2148 -1.3584910193458200e-03 + + 2.4722290039062500e-01 -4.3907400220632553e-02 + <_> + + 0 -1 2149 6.9289728999137878e-03 + + -5.6832619011402130e-02 1.6665740311145782e-01 + <_> + + 0 -1 2150 -6.9041848182678223e-03 + + -1.2742209434509277e-01 7.9310603439807892e-02 + <_> + + 0 -1 2151 1.2964820489287376e-03 + + 7.2462439537048340e-02 -1.6863870620727539e-01 + <_> + + 0 -1 2152 2.3060059174895287e-02 + + -5.0913080573081970e-02 2.1664789319038391e-01 + <_> + + 0 -1 2153 -4.0960568934679031e-02 + + -5.6479138135910034e-01 1.9609550014138222e-02 + <_> + + 0 -1 2154 7.4867479270324111e-05 + + -6.9450333714485168e-02 1.4615139365196228e-01 + <_> + + 0 -1 2155 -6.8458272144198418e-03 + + 6.6049978137016296e-02 -2.0840729773044586e-01 + <_> + + 0 -1 2156 1.9395649433135986e-02 + + 1.6168899834156036e-02 -5.6396162509918213e-01 + <_> + + 0 -1 2157 -1.6121419321279973e-04 + + -1.3194569945335388e-01 7.4094116687774658e-02 + <_> + + 0 -1 2158 6.6511691547930241e-03 + + -5.5261820554733276e-02 1.9894389808177948e-01 + <_> + + 0 -1 2159 4.5172171667218208e-03 + + 3.2863661646842957e-02 -3.0980890989303589e-01 + <_> + + 0 -1 2160 -4.0247041732072830e-02 + + -6.8980348110198975e-01 1.2438739649951458e-02 + <_> + + 0 -1 2161 7.2544030444987584e-06 + + -9.5949873328208923e-02 9.7919799387454987e-02 + <_> + + 0 -1 2162 -1.6025650501251221e-01 + + 4.9472638964653015e-01 -1.8643429502844810e-02 + <_> + + 0 -1 2163 5.0598900998011231e-04 + + -1.2216579914093018e-01 8.6699098348617554e-02 + <_> + + 0 -1 2164 -1.0506899654865265e-01 + + -8.5855627059936523e-01 8.2870386540889740e-03 + <_> + + 0 -1 2165 -1.8218380212783813e-01 + + -5.8477312326431274e-01 1.3160600326955318e-02 + <_> + + 0 -1 2166 1.6435410827398300e-02 + + 1.6296360641717911e-02 -5.5137562751770020e-01 + <_> + + 0 -1 2167 1.9282519817352295e-02 + + -2.5027479976415634e-02 4.3645161390304565e-01 + <_> + + 0 -1 2168 3.4772949293255806e-03 + + 3.1632781028747559e-02 -2.9246759414672852e-01 + <_> + + 0 -1 2169 2.2620869800448418e-02 + + -2.3985739797353745e-02 4.3105301260948181e-01 + <_> + + 0 -1 2170 -1.8172320723533630e-01 + + -1.8037860095500946e-01 5.1903489977121353e-02 + <_> + + 0 -1 2171 -4.3819830752909184e-03 + + -2.8302851319313049e-01 3.3024039119482040e-02 + <_> + + 0 -1 2172 -1.5246120281517506e-02 + + 2.3519919812679291e-01 -4.1242249310016632e-02 + <_> + + 0 -1 2173 3.9043289422988892e-01 + + 2.8530629351735115e-02 -3.5845771431922913e-01 + <_> + + 0 -1 2174 3.9103450253605843e-03 + + -5.1523748785257339e-02 1.7829769849777222e-01 + <_> + + 0 -1 2175 -1.0847560130059719e-02 + + -4.8355281352996826e-01 1.8765790387988091e-02 + <_> + + 0 -1 2176 5.7015339843928814e-03 + + 1.2250830419361591e-02 -7.0457488298416138e-01 + <_> + + 0 -1 2177 -1.1917110532522202e-03 + + 1.8404430150985718e-01 -5.0144620239734650e-02 + <_> + + 0 -1 2178 4.0988530963659286e-04 + + -9.7399666905403137e-02 1.0874579846858978e-01 + <_> + + 0 -1 2179 4.5295488089323044e-03 + + 4.5356839895248413e-02 -2.1069140732288361e-01 + <_> + + 0 -1 2180 -5.4893731139600277e-03 + + 2.9642790555953979e-01 -3.5870831459760666e-02 + <_> + + 0 -1 2181 1.9906361121684313e-03 + + 3.4332871437072754e-02 -3.1506469845771790e-01 + <_> + + 0 -1 2182 8.3358466625213623e-02 + + 1.9684519618749619e-02 -4.4279980659484863e-01 + <_> + + 0 -1 2183 3.0363420955836773e-03 + + -3.3693831413984299e-02 2.6669681072235107e-01 + <_> + + 0 -1 2184 5.7799968868494034e-02 + + 8.5875885561108589e-03 -9.8965817689895630e-01 + <_> + + 0 -1 2185 -7.8585641458630562e-03 + + 2.0088459551334381e-01 -4.6583641320466995e-02 + <_> + + 0 -1 2186 1.9253200152888894e-03 + + 4.7922369092702866e-02 -2.2640110552310944e-01 + <_> + + 0 -1 2187 1.0996909812092781e-02 + + 1.6258660703897476e-02 -5.4048168659210205e-01 + <_> + + 0 -1 2188 1.6405170026700944e-04 + + -1.1542510241270065e-01 7.6001413166522980e-02 + <_> + + 0 -1 2189 5.3780381567776203e-03 + + 1.1179029941558838e-01 -8.4179848432540894e-02 + <_> + + 0 -1 2190 2.2905960213392973e-03 + + -5.7969480752944946e-02 1.6899429261684418e-01 + <_> + + 0 -1 2191 6.3102580606937408e-03 + + 4.1471399366855621e-02 -2.0478209853172302e-01 + <_> + + 0 -1 2192 -1.4342570304870605e-01 + + -7.8573477268218994e-01 1.1634309776127338e-02 + <_> + + 0 -1 2193 1.2364640133455396e-03 + + -5.1800731569528580e-02 1.7734350264072418e-01 + <_> + + 0 -1 2194 -2.0046550780534744e-02 + + -3.1420910358428955e-01 2.8849070891737938e-02 + <_> + + 0 -1 2195 1.0868109762668610e-01 + + 1.6183530911803246e-02 -5.1956307888031006e-01 + <_> + + 0 -1 2196 5.1173489540815353e-02 + + -3.2460309565067291e-02 3.1230181455612183e-01 + <_> + + 0 -1 2197 1.3251069933176041e-02 + + 2.3655060678720474e-02 -4.4210249185562134e-01 + <_> + + 0 -1 2198 -2.0110961049795151e-03 + + 1.0359399765729904e-01 -9.3961462378501892e-02 + <_> + + 0 -1 2199 -3.2843051012605429e-03 + + 3.3196929097175598e-01 -2.9921280220150948e-02 + <_> + + 0 -1 2200 8.8341237278655171e-04 + + 5.9891819953918457e-02 -1.6192750632762909e-01 + <_> + + 0 -1 2201 8.4265992045402527e-03 + + -3.6928750574588776e-02 2.3691199719905853e-01 + <_> + + 0 -1 2202 -1.4503750207950361e-05 + + 7.7373847365379333e-02 -1.3290609419345856e-01 + <_> + + 0 -1 2203 8.0891689285635948e-03 + + 2.8817569836974144e-02 -3.0961230397224426e-01 + <_> + + 0 -1 2204 1.0339939966797829e-02 + + -2.4850569665431976e-02 3.7060049176216125e-01 + <_> + + 0 -1 2205 -2.2790539078414440e-03 + + -2.2051370143890381e-01 4.1877530515193939e-02 + <_> + + 0 -1 2206 -1.7716860165819526e-03 + + 1.4205080270767212e-01 -6.5252363681793213e-02 + <_> + + 0 -1 2207 -6.9317207671701908e-03 + + -3.3556079864501953e-01 2.7605969458818436e-02 + <_> + + 0 -1 2208 -4.2506060563027859e-03 + + 2.3591980338096619e-01 -3.7345319986343384e-02 + <_> + + 0 -1 2209 1.5317599754780531e-03 + + 3.9657011628150940e-02 -2.3438200354576111e-01 + <_> + + 0 -1 2210 1.4941049739718437e-03 + + -6.0311999171972275e-02 1.4468440413475037e-01 + <_> + + 0 -1 2211 -5.2249869331717491e-03 + + -4.0660250186920166e-01 2.3257270455360413e-02 + <_> + + 0 -1 2212 6.4759532688185573e-04 + + 6.4828239381313324e-02 -1.2987309694290161e-01 + <_> + + 0 -1 2213 3.2836120226420462e-04 + + 6.1917629092931747e-02 -1.4835810661315918e-01 + <_> + + 0 -1 2214 -3.4691279288381338e-03 + + 1.5662840008735657e-01 -5.7200349867343903e-02 + <_> + + 0 -1 2215 4.5903379213996232e-04 + + 5.2517898380756378e-02 -1.9093179702758789e-01 + <_> + + 0 -1 2216 -2.6641879230737686e-03 + + 1.5235909819602966e-01 -6.8154700100421906e-02 + <_> + + 0 -1 2217 -8.2513149827718735e-03 + + 3.6680310964584351e-01 -2.8480609878897667e-02 + <_> + + 0 -1 2218 7.1076201274991035e-03 + + 1.5445350110530853e-01 -6.7992970347404480e-02 + <_> + + 0 -1 2219 -4.3808001279830933e-01 + + -2.8871530294418335e-01 3.6639489233493805e-02 + <_> + + 0 -1 2220 6.3719082390889525e-04 + + -1.5995030105113983e-01 5.9860341250896454e-02 + <_> + + 0 -1 2221 -1.9303169392514974e-04 + + 8.6703971028327942e-02 -1.0924819856882095e-01 + <_> + + 0 -1 2222 3.0723758973181248e-03 + + 4.8543959856033325e-02 -1.7700059711933136e-01 + <_> + + 0 -1 2223 1.8341860268265009e-03 + + -5.1901239901781082e-02 1.8232129514217377e-01 + <_> + + 0 -1 2224 6.3172310590744019e-02 + + 2.3308899253606796e-02 -4.2870610952377319e-01 + <_> + + 0 -1 2225 2.4458649568259716e-03 + + -8.6425289511680603e-02 1.1974500119686127e-01 + <_> + + 0 -1 2226 1.1953969951719046e-03 + + 1.1685889959335327e-01 -1.0430490225553513e-01 + <_> + + 0 -1 2227 3.1024610507301986e-04 + + 6.2281988561153412e-02 -1.9196020066738129e-01 + <_> + + 0 -1 2228 -3.1970158219337463e-02 + + -6.4184898138046265e-01 1.3087569735944271e-02 + <_> + + 0 -1 2229 -1.0163170518353581e-03 + + -2.5210660696029663e-01 3.4096211194992065e-02 + <_> + + 0 -1 2230 -5.1776540931314230e-04 + + 1.1874090135097504e-01 -8.2813777029514313e-02 + <_> + + 0 -1 2231 -4.0794219821691513e-03 + + -1.6135309636592865e-01 6.5708972513675690e-02 + <_> + + 0 -1 2232 9.9409874528646469e-03 + + -3.0160220339894295e-02 3.5104531049728394e-01 + <_> + + 0 -1 2233 1.9788760691881180e-03 + + -4.4945359230041504e-02 2.3295649886131287e-01 + <_> + + 0 -1 2234 1.0975249856710434e-01 + + 1.6620220616459846e-02 -6.0423362255096436e-01 + <_> + + 0 -1 2235 -9.2024728655815125e-03 + + -5.6000357866287231e-01 1.4122909866273403e-02 + <_> + + 0 -1 2236 5.8626191457733512e-04 + + -1.0622119903564453e-01 8.4198087453842163e-02 + <_> + + 0 -1 2237 3.3601750619709492e-03 + + -2.1583529189229012e-02 4.1820129752159119e-01 + <_> + + 0 -1 2238 -4.8143669962882996e-02 + + -7.2092157602310181e-01 1.4954459853470325e-02 + <_> + + 0 -1 2239 1.2209859676659107e-02 + + 2.1544290706515312e-02 -3.5482150316238403e-01 + <_> + + 0 -1 2240 -3.9961449801921844e-02 + + -8.8848268985748291e-01 9.4328429549932480e-03 + <_> + + 0 -1 2241 1.5312479808926582e-03 + + -6.4070880413055420e-02 1.3569630682468414e-01 + <_> + + 0 -1 2242 8.9791123173199594e-05 + + 5.0932768732309341e-02 -1.8393670022487640e-01 + <_> + 195 + -1.3934370279312134e+00 + + <_> + + 0 -1 2243 -3.8741368800401688e-02 + + 2.8778830170631409e-01 -2.3312190175056458e-01 + <_> + + 0 -1 2244 -2.5511500425636768e-03 + + 2.5108599662780762e-01 -2.1116070449352264e-01 + <_> + + 0 -1 2245 -2.7973129181191325e-04 + + 8.9916922152042389e-02 -3.4069269895553589e-01 + <_> + + 0 -1 2246 1.1981100542470813e-03 + + -2.2542229294776917e-01 1.3602660596370697e-01 + <_> + + 0 -1 2247 -5.6686070747673512e-03 + + 8.2847259938716888e-02 -2.8080710768699646e-01 + <_> + + 0 -1 2248 -2.7642669738270342e-04 + + 1.0485479980707169e-01 -1.8848650157451630e-01 + <_> + + 0 -1 2249 2.0516710355877876e-03 + + 3.4714280627667904e-03 -4.8608478903770447e-01 + <_> + + 0 -1 2250 -1.4435249795496929e-05 + + 8.4275819361209869e-02 -1.9356100261211395e-01 + <_> + + 0 -1 2251 7.4418791336938739e-04 + + -1.2526750564575195e-01 1.1769519746303558e-01 + <_> + + 0 -1 2252 -4.9923241138458252e-02 + + -4.0080299973487854e-01 2.7910390868782997e-02 + <_> + + 0 -1 2253 9.2694535851478577e-03 + + -9.1088913381099701e-02 1.7550450563430786e-01 + <_> + + 0 -1 2254 -7.4646030552685261e-03 + + 1.6380469501018524e-01 -1.0385499894618988e-01 + <_> + + 0 -1 2255 -8.1985909491777420e-03 + + -1.9168980419635773e-01 8.5415020585060120e-02 + <_> + + 0 -1 2256 -8.1690691877156496e-04 + + -3.0793309211730957e-01 4.0833581238985062e-02 + <_> + + 0 -1 2257 2.8902110643684864e-03 + + -5.0324201583862305e-02 2.9259419441223145e-01 + <_> + + 0 -1 2258 8.0008199438452721e-03 + + -4.6863578259944916e-02 3.1964871287345886e-01 + <_> + + 0 -1 2259 -5.8349180035293102e-03 + + -1.5489180386066437e-01 8.8137261569499969e-02 + <_> + + 0 -1 2260 -1.2492289533838630e-03 + + -3.6294621229171753e-01 3.6120988428592682e-02 + <_> + + 0 -1 2261 2.2950479760766029e-02 + + -4.7119770199060440e-02 2.8532719612121582e-01 + <_> + + 0 -1 2262 -6.9193239323794842e-03 + + 1.7873649299144745e-01 -7.3547556996345520e-02 + <_> + + 0 -1 2263 -1.9392240210436285e-04 + + 1.3911420106887817e-01 -9.2489100992679596e-02 + <_> + + 0 -1 2264 1.9811228848993778e-03 + + 4.3448008596897125e-02 -3.0942690372467041e-01 + <_> + + 0 -1 2265 1.6018489375710487e-02 + + -3.9718918502330780e-02 3.4248939156532288e-01 + <_> + + 0 -1 2266 9.3541406095027924e-03 + + 3.2482650130987167e-02 -4.4502100348472595e-01 + <_> + + 0 -1 2267 -1.3822780456393957e-03 + + 2.1627070009708405e-01 -5.6410200893878937e-02 + <_> + + 0 -1 2268 2.5065820664167404e-02 + + 2.3123230785131454e-02 -5.3954011201858521e-01 + <_> + + 0 -1 2269 5.9798579663038254e-02 + + 2.8747579082846642e-02 -3.6572590470314026e-01 + <_> + + 0 -1 2270 -2.7519159484654665e-03 + + 1.7491349577903748e-01 -6.3990972936153412e-02 + <_> + + 0 -1 2271 -3.2093640416860580e-02 + + -2.5695550441741943e-01 4.0945108979940414e-02 + <_> + + 0 -1 2272 -2.3349749390035868e-03 + + 1.5433880686759949e-01 -7.2836689651012421e-02 + <_> + + 0 -1 2273 2.6897678617388010e-04 + + 7.2721242904663086e-02 -1.5513220429420471e-01 + <_> + + 0 -1 2274 -8.9813407976180315e-04 + + -2.0699620246887207e-01 5.3738221526145935e-02 + <_> + + 0 -1 2275 3.8521869573742151e-03 + + 3.6562010645866394e-02 -2.8075969219207764e-01 + <_> + + 0 -1 2276 1.3440090231597424e-02 + + -3.6046478897333145e-02 3.1876960396766663e-01 + <_> + + 0 -1 2277 7.7129118144512177e-03 + + 9.5960013568401337e-02 -1.1787489801645279e-01 + <_> + + 0 -1 2278 2.1991880203131586e-04 + + -1.3249869644641876e-01 8.4939576685428619e-02 + <_> + + 0 -1 2279 -7.4781170114874840e-03 + + -2.3073039948940277e-01 5.0310928374528885e-02 + <_> + + 0 -1 2280 8.9175272732973099e-03 + + -5.3924769163131714e-02 2.0320640504360199e-01 + <_> + + 0 -1 2281 2.2819850128144026e-03 + + 3.5264909267425537e-02 -3.0841338634490967e-01 + <_> + + 0 -1 2282 2.6413009036332369e-03 + + -3.2939229160547256e-02 3.1721460819244385e-01 + <_> + + 0 -1 2283 -1.4605689793825150e-03 + + -1.7154279351234436e-01 6.3374556601047516e-02 + <_> + + 0 -1 2284 -3.1993410084396601e-03 + + 3.4501680731773376e-01 -3.0717490240931511e-02 + <_> + + 0 -1 2285 2.3919229861348867e-03 + + 2.0887520164251328e-02 -4.8564168810844421e-01 + <_> + + 0 -1 2286 -3.5997610539197922e-03 + + 2.8900530934333801e-01 -3.5605821758508682e-02 + <_> + + 0 -1 2287 -1.4754279618500732e-05 + + 7.2744622826576233e-02 -1.4580619335174561e-01 + <_> + + 0 -1 2288 1.5968360006809235e-02 + + 1.2548550032079220e-02 -6.7445451021194458e-01 + <_> + + 0 -1 2289 -4.0752082131803036e-03 + + 3.1447470188140869e-01 -3.2155450433492661e-02 + <_> + + 0 -1 2290 7.5432872108649462e-05 + + -9.9738657474517822e-02 8.9665092527866364e-02 + <_> + + 0 -1 2291 -3.9632249623537064e-02 + + 2.7617400884628296e-01 -3.4800730645656586e-02 + <_> + + 0 -1 2292 2.9354610887821764e-05 + + -1.4023000001907349e-01 8.8519610464572906e-02 + <_> + + 0 -1 2293 3.1818989664316177e-02 + + 2.9925649985671043e-02 -3.3958339691162109e-01 + <_> + + 0 -1 2294 1.2690100073814392e-01 + + 1.1263390071690083e-02 -8.9932328462600708e-01 + <_> + + 0 -1 2295 -3.5952320322394371e-03 + + 1.7751759290695190e-01 -5.8113489300012589e-02 + <_> + + 0 -1 2296 -1.9231259822845459e-02 + + -3.3173981308937073e-01 4.0587101131677628e-02 + <_> + + 0 -1 2297 2.2836721036583185e-03 + + 3.7206009030342102e-02 -2.8370648622512817e-01 + <_> + + 0 -1 2298 -1.6381660243496299e-03 + + 1.4629170298576355e-01 -6.7781522870063782e-02 + <_> + + 0 -1 2299 2.1173330023884773e-03 + + 2.0773969590663910e-02 -4.3928679823875427e-01 + <_> + + 0 -1 2300 6.4710620790719986e-03 + + -7.2133928537368774e-02 1.3981610536575317e-01 + <_> + + 0 -1 2301 -3.1431620009243488e-03 + + -1.9903449714183807e-01 4.7544669359922409e-02 + <_> + + 0 -1 2302 1.6056640306487679e-03 + + -3.9751898497343063e-02 2.5931739807128906e-01 + <_> + + 0 -1 2303 4.8740832135081291e-03 + + 3.4082379192113876e-02 -2.7611988782882690e-01 + <_> + + 0 -1 2304 -9.6354109700769186e-05 + + -1.0709609836339951e-01 8.3503186702728271e-02 + <_> + + 0 -1 2305 7.7706458978354931e-03 + + -3.0095349997282028e-02 2.9493871331214905e-01 + <_> + + 0 -1 2306 1.3028859393671155e-04 + + -1.1232890188694000e-01 9.4578683376312256e-02 + <_> + + 0 -1 2307 1.2239719508215785e-03 + + 5.1999621093273163e-02 -1.8106269836425781e-01 + <_> + + 0 -1 2308 -8.7549741147086024e-04 + + 1.4276699721813202e-01 -7.5098946690559387e-02 + <_> + + 0 -1 2309 -8.8081993162631989e-02 + + -7.0848828554153442e-01 1.4353640377521515e-02 + <_> + + 0 -1 2310 -3.2854160666465759e-01 + + -4.9687421321868896e-01 1.6604600474238396e-02 + <_> + + 0 -1 2311 9.8696127533912659e-03 + + 1.9364370033144951e-02 -4.9978300929069519e-01 + <_> + + 0 -1 2312 -2.7273639570921659e-03 + + 2.9612520337104797e-01 -3.2831400632858276e-02 + <_> + + 0 -1 2313 9.9100142717361450e-02 + + 1.9799079746007919e-02 -4.7344958782196045e-01 + <_> + + 0 -1 2314 -6.3501899130642414e-03 + + -5.1504719257354736e-01 1.6986010596156120e-02 + <_> + + 0 -1 2315 2.9596920285257511e-05 + + -1.0923019796609879e-01 8.9656107127666473e-02 + <_> + + 0 -1 2316 2.1247670054435730e-02 + + -4.1462190449237823e-02 2.2684270143508911e-01 + <_> + + 0 -1 2317 -7.2977989912033081e-02 + + -6.3227838277816772e-01 1.6678869724273682e-02 + <_> + + 0 -1 2318 1.6230919957160950e-01 + + -2.5661909952759743e-02 3.7533140182495117e-01 + <_> + + 0 -1 2319 -1.4590819773729891e-05 + + 8.5613600909709930e-02 -1.1900989711284637e-01 + <_> + + 0 -1 2320 2.7719149366021156e-03 + + -5.4649248719215393e-02 2.0311379432678223e-01 + <_> + + 0 -1 2321 -8.7484354153275490e-03 + + -7.3674517869949341e-01 1.5571890398859978e-02 + <_> + + 0 -1 2322 1.3679199852049351e-02 + + 7.8902930021286011e-02 -1.1590500175952911e-01 + <_> + + 0 -1 2323 -1.1001150123775005e-02 + + 3.1690821051597595e-01 -3.2384991645812988e-02 + <_> + + 0 -1 2324 3.2964799902401865e-04 + + 5.0016529858112335e-02 -2.0451450347900391e-01 + <_> + + 0 -1 2325 2.7753270696848631e-03 + + -6.7407429218292236e-02 1.5935909748077393e-01 + <_> + + 0 -1 2326 -2.8740249108523130e-03 + + 2.2455960512161255e-01 -5.1031488925218582e-02 + <_> + + 0 -1 2327 8.1631669308990240e-04 + + 6.9849550724029541e-02 -1.4791619777679443e-01 + <_> + + 0 -1 2328 3.7573580630123615e-03 + + 3.1594600528478622e-02 -3.1387978792190552e-01 + <_> + + 0 -1 2329 -3.4902389161288738e-03 + + 1.1638429760932922e-01 -8.5947930812835693e-02 + <_> + + 0 -1 2330 -2.9415320605039597e-02 + + 6.8403428792953491e-01 -1.6140609979629517e-02 + <_> + + 0 -1 2331 -8.8095385581254959e-03 + + -2.0775319635868073e-01 4.9950890243053436e-02 + <_> + + 0 -1 2332 -1.5459939837455750e-02 + + -4.8748460412025452e-01 2.0065559074282646e-02 + <_> + + 0 -1 2333 -3.6481369286775589e-02 + + -5.2395141124725342e-01 1.5850989148020744e-02 + <_> + + 0 -1 2334 -8.8937362306751311e-05 + + -1.3299320638179779e-01 6.6926807165145874e-02 + <_> + + 0 -1 2335 1.4536709932144731e-04 + + 8.7170369923114777e-02 -1.0435820370912552e-01 + <_> + + 0 -1 2336 1.5216879546642303e-01 + + 1.6140580177307129e-02 -6.4970171451568604e-01 + <_> + + 0 -1 2337 -4.2344830580987036e-04 + + 1.8045839667320251e-01 -5.2974540740251541e-02 + <_> + + 0 -1 2338 1.0672640055418015e-03 + + 2.0548380911350250e-02 -4.8242041468620300e-01 + <_> + + 0 -1 2339 1.5491680242121220e-02 + + -5.1540851593017578e-02 1.8363960087299347e-01 + <_> + + 0 -1 2340 6.1393307987600565e-04 + + 2.9983729124069214e-02 -3.1031700968742371e-01 + <_> + + 0 -1 2341 -1.4619939975091256e-05 + + 1.0368499904870987e-01 -9.1634131968021393e-02 + <_> + + 0 -1 2342 6.9900648668408394e-03 + + 1.4683909714221954e-02 -5.9485381841659546e-01 + <_> + + 0 -1 2343 -5.3000110201537609e-03 + + -1.2457770109176636e-01 7.0542782545089722e-02 + <_> + + 0 -1 2344 5.0289987120777369e-04 + + -7.7135689556598663e-02 1.2228710204362869e-01 + <_> + + 0 -1 2345 1.1190979741513729e-02 + + 5.0308059900999069e-02 -1.8091809749603271e-01 + <_> + + 0 -1 2346 1.7019819468259811e-02 + + -3.8816768676042557e-02 3.0851981043815613e-01 + <_> + + 0 -1 2347 -5.8241572696715593e-04 + + 1.2537799775600433e-01 -7.6115481555461884e-02 + <_> + + 0 -1 2348 2.0036669448018074e-02 + + 4.9899481236934662e-02 -1.8082989752292633e-01 + <_> + + 0 -1 2349 -5.4328818805515766e-03 + + 2.3409770429134369e-01 -4.2385410517454147e-02 + <_> + + 0 -1 2350 -2.9535360226873308e-05 + + 5.7630240917205811e-02 -1.5753529965877533e-01 + <_> + + 0 -1 2351 -1.0352370142936707e-01 + + 7.1587741374969482e-01 -1.2989929877221584e-02 + <_> + + 0 -1 2352 -1.2122269719839096e-02 + + -1.4788970351219177e-01 6.6566437482833862e-02 + <_> + + 0 -1 2353 3.0254870653152466e-03 + + -5.4378628730773926e-02 1.7140829563140869e-01 + <_> + + 0 -1 2354 -5.8111078105866909e-03 + + 2.4422149360179901e-01 -5.7652641087770462e-02 + <_> + + 0 -1 2355 8.2830740138888359e-03 + + 2.2720400243997574e-02 -4.2961999773979187e-01 + <_> + + 0 -1 2356 1.2375120073556900e-02 + + 2.2810289636254311e-02 -3.7505629658699036e-01 + <_> + + 0 -1 2357 1.9211210310459137e-02 + + 1.1791059747338295e-02 -6.5529459714889526e-01 + <_> + + 0 -1 2358 3.1843129545450211e-04 + + 6.4130060374736786e-02 -1.3995569944381714e-01 + <_> + + 0 -1 2359 8.4224628517404199e-04 + + -5.4134279489517212e-02 1.7525580525398254e-01 + <_> + + 0 -1 2360 -1.6085049510002136e-01 + + -9.4571417570114136e-01 7.8549478203058243e-03 + <_> + + 0 -1 2361 -1.6774870455265045e-03 + + -1.9166129827499390e-01 4.5787028968334198e-02 + <_> + + 0 -1 2362 -1.8989649834111333e-03 + + 1.5783150494098663e-01 -6.5896913409233093e-02 + <_> + + 0 -1 2363 4.0205760160461068e-04 + + -7.3599092662334442e-02 1.3118380308151245e-01 + <_> + + 0 -1 2364 2.4369959719479084e-03 + + 2.3522870615124702e-02 -4.2745968699455261e-01 + <_> + + 0 -1 2365 -2.8488409952842630e-05 + + 6.3280619680881500e-02 -1.3599009811878204e-01 + <_> + + 0 -1 2366 1.9538639113306999e-02 + + -2.1458270028233528e-02 4.7534748911857605e-01 + <_> + + 0 -1 2367 -1.6530340071767569e-03 + + -1.5323260426521301e-01 5.9455979615449905e-02 + <_> + + 0 -1 2368 -2.1052840165793896e-03 + + 1.1017639935016632e-01 -8.3118103444576263e-02 + <_> + + 0 -1 2369 -4.5266482047736645e-03 + + 2.5815379619598389e-01 -3.5743940621614456e-02 + <_> + + 0 -1 2370 -1.6275560483336449e-04 + + -1.3548290729522705e-01 6.9295726716518402e-02 + <_> + + 0 -1 2371 -3.3048219047486782e-03 + + 1.7806029319763184e-01 -5.2156440913677216e-02 + <_> + + 0 -1 2372 -5.1905210129916668e-03 + + -3.4897321462631226e-01 2.5990990921854973e-02 + <_> + + 0 -1 2373 1.1190810054540634e-01 + + 2.9962029308080673e-02 -2.9597550630569458e-01 + <_> + + 0 -1 2374 -5.2873138338327408e-03 + + 1.8564499914646149e-01 -5.0216298550367355e-02 + <_> + + 0 -1 2375 2.6098049711436033e-03 + + -7.3559276759624481e-02 1.4365130662918091e-01 + <_> + + 0 -1 2376 -2.8581928927451372e-03 + + -1.2605139613151550e-01 7.5433082878589630e-02 + <_> + + 0 -1 2377 -2.9555680157500319e-05 + + 1.0733310133218765e-01 -1.0386200249195099e-01 + <_> + + 0 -1 2378 5.9023561334470287e-05 + + -1.3029119372367859e-01 7.6478391885757446e-02 + <_> + + 0 -1 2379 -4.3344721198081970e-02 + + -6.9299221038818359e-01 1.4173300005495548e-02 + <_> + + 0 -1 2380 -4.6946998685598373e-02 + + -5.5803751945495605e-01 1.2422920204699039e-02 + <_> + + 0 -1 2381 -1.5189060010015965e-02 + + 3.7049770355224609e-01 -2.5564119219779968e-02 + <_> + + 0 -1 2382 1.6361879184842110e-02 + + 2.7049979194998741e-02 -3.4278920292854309e-01 + <_> + + 0 -1 2383 4.0752839297056198e-02 + + 9.3995258212089539e-03 -8.8683712482452393e-01 + <_> + + 0 -1 2384 -1.0879869572818279e-02 + + 5.3260582685470581e-01 -1.9450860098004341e-02 + <_> + + 0 -1 2385 -7.7538257755804807e-05 + + -1.1696249991655350e-01 7.7288232743740082e-02 + <_> + + 0 -1 2386 -4.0953079587779939e-04 + + 1.6214360296726227e-01 -5.3711488842964172e-02 + <_> + + 0 -1 2387 -1.8464239314198494e-02 + + -5.0844788551330566e-01 1.9838189706206322e-02 + <_> + + 0 -1 2388 -5.6788129732012749e-03 + + 3.0203920602798462e-01 -3.0203990638256073e-02 + <_> + + 0 -1 2389 3.8324110209941864e-04 + + -1.6841089725494385e-01 5.4902028292417526e-02 + <_> + + 0 -1 2390 6.4761550165712833e-03 + + 9.5140263438224792e-02 -1.0746160149574280e-01 + <_> + + 0 -1 2391 -2.4377859663218260e-03 + + -1.5647719800472260e-01 6.3407607376575470e-02 + <_> + + 0 -1 2392 5.4156291298568249e-04 + + -6.5962299704551697e-02 1.8441629409790039e-01 + <_> + + 0 -1 2393 2.7917029336094856e-02 + + -2.7590230107307434e-02 3.5032740235328674e-01 + <_> + + 0 -1 2394 4.6622849185951054e-04 + + 4.9628820270299911e-02 -2.2624179720878601e-01 + <_> + + 0 -1 2395 -3.7316799163818359e-02 + + -4.2978170514106750e-01 2.1337680518627167e-02 + <_> + + 0 -1 2396 -2.6047111023217440e-03 + + 3.6650991439819336e-01 -2.5405049324035645e-02 + <_> + + 0 -1 2397 5.1927138119935989e-03 + + 2.6877930387854576e-02 -3.3478578925132751e-01 + <_> + + 0 -1 2398 3.0462879221886396e-03 + + -3.0848290771245956e-02 2.9788359999656677e-01 + <_> + + 0 -1 2399 -4.1325599886476994e-04 + + 7.2986789047718048e-02 -1.2147530168294907e-01 + <_> + + 0 -1 2400 -1.1456120014190674e-01 + + 3.1955468654632568e-01 -3.3379800617694855e-02 + <_> + + 0 -1 2401 -1.3044059742242098e-03 + + -2.0625290274620056e-01 5.4634369909763336e-02 + <_> + + 0 -1 2402 4.5045089791528881e-05 + + -1.1376550048589706e-01 7.8123383224010468e-02 + <_> + + 0 -1 2403 1.8890319624915719e-03 + + -6.5578728914260864e-02 1.7001299560070038e-01 + <_> + + 0 -1 2404 -5.4107961477711797e-04 + + -1.8184140324592590e-01 5.1611810922622681e-02 + <_> + + 0 -1 2405 4.4150161556899548e-03 + + -3.6324780434370041e-02 2.4938449263572693e-01 + <_> + + 0 -1 2406 -2.1878050640225410e-02 + + -1.7643679678440094e-01 5.4811108857393265e-02 + <_> + + 0 -1 2407 -2.0328219980001450e-03 + + 9.4266183674335480e-02 -9.7129411995410919e-02 + <_> + + 0 -1 2408 2.6754371356219053e-04 + + 5.7487931102514267e-02 -1.5442019701004028e-01 + <_> + + 0 -1 2409 1.4061420224606991e-03 + + -5.0268959254026413e-02 1.8814170360565186e-01 + <_> + + 0 -1 2410 2.0725419744849205e-04 + + 7.7659189701080322e-02 -1.2538130581378937e-01 + <_> + + 0 -1 2411 1.8001600401476026e-03 + + -4.2675640434026718e-02 2.2430649399757385e-01 + <_> + + 0 -1 2412 -4.6744230203330517e-03 + + -3.3480471372604370e-01 2.9364420101046562e-02 + <_> + + 0 -1 2413 7.2110369801521301e-03 + + -5.2441328763961792e-02 1.8891569972038269e-01 + <_> + + 0 -1 2414 2.3627521004527807e-03 + + 3.4400060772895813e-02 -2.7200448513031006e-01 + <_> + + 0 -1 2415 -1.3181479880586267e-03 + + 1.7767719924449921e-01 -5.6363631039857864e-02 + <_> + + 0 -1 2416 -1.7586319881957024e-04 + + 9.1534242033958435e-02 -1.0412310063838959e-01 + <_> + + 0 -1 2417 -2.5801590527407825e-04 + + -1.1226779967546463e-01 8.1381812691688538e-02 + <_> + + 0 -1 2418 9.6790950919967145e-05 + + -1.1881929636001587e-01 7.1883186697959900e-02 + <_> + + 0 -1 2419 8.2001117989420891e-03 + + -4.0254529565572739e-02 2.2790899872779846e-01 + <_> + + 0 -1 2420 -6.7277951166033745e-04 + + -7.0979103446006775e-02 1.2775769829750061e-01 + <_> + + 0 -1 2421 3.7424470065161586e-04 + + 6.7096449434757233e-02 -1.3645760715007782e-01 + <_> + + 0 -1 2422 2.5741120334714651e-03 + + -5.4319828748703003e-02 1.6720260679721832e-01 + <_> + + 0 -1 2423 4.3884690967388451e-04 + + 8.2114033401012421e-02 -1.1024679988622665e-01 + <_> + + 0 -1 2424 -4.8180628567934036e-02 + + -7.2217732667922974e-01 1.2223210185766220e-02 + <_> + + 0 -1 2425 9.9836904555559158e-03 + + 1.2195640243589878e-02 -6.7448061704635620e-01 + <_> + + 0 -1 2426 -1.2344559654593468e-03 + + 1.7145380377769470e-01 -5.5381339043378830e-02 + <_> + + 0 -1 2427 -2.7302911039441824e-03 + + -1.3044339418411255e-01 7.4266709387302399e-02 + <_> + + 0 -1 2428 5.5562541820108891e-04 + + -1.0187319666147232e-01 1.0454159975051880e-01 + <_> + + 0 -1 2429 1.5140359755605459e-03 + + 8.2843840122222900e-02 -1.1898560076951981e-01 + <_> + + 0 -1 2430 -7.2555973019916564e-05 + + -1.2512299418449402e-01 7.1132406592369080e-02 + <_> + + 0 -1 2431 -2.4981278693303466e-04 + + -1.3125610351562500e-01 6.8963102996349335e-02 + <_> + + 0 -1 2432 -6.0206428170204163e-03 + + 2.1284450590610504e-01 -4.7603111714124680e-02 + <_> + + 0 -1 2433 -7.2469102451577783e-04 + + 1.0499659925699234e-01 -8.5549630224704742e-02 + <_> + + 0 -1 2434 6.3740357290953398e-04 + + 5.4655481129884720e-02 -1.7353290319442749e-01 + <_> + + 0 -1 2435 1.0901190340518951e-02 + + -5.2832279354333878e-02 1.8752649426460266e-01 + <_> + + 0 -1 2436 7.0734010078012943e-03 + + 6.2958806753158569e-02 -1.6468439996242523e-01 + <_> + + 0 -1 2437 1.3333789538592100e-03 + + -1.2590870261192322e-01 9.4716809689998627e-02 + <_> + 171 + -1.2739679813385010e+00 + + <_> + + 0 -1 2438 6.2053989619016647e-02 + + -2.5427028536796570e-01 2.3591099679470062e-01 + <_> + + 0 -1 2439 5.9534627944231033e-03 + + -2.2544360160827637e-01 1.7751939594745636e-01 + <_> + + 0 -1 2440 7.2477371431887150e-03 + + -1.1398050189018250e-01 2.7556711435317993e-01 + <_> + + 0 -1 2441 -2.2824530024081469e-03 + + 8.6277678608894348e-02 -3.1412398815155029e-01 + <_> + + 0 -1 2442 1.1776019819080830e-02 + + -6.2360338866710663e-02 3.4443479776382446e-01 + <_> + + 0 -1 2443 4.3855342082679272e-03 + + 1.8105769529938698e-02 -5.0128728151321411e-01 + <_> + + 0 -1 2444 1.5859069302678108e-02 + + -7.8765146434307098e-02 2.6402598619461060e-01 + <_> + + 0 -1 2445 3.0654110014438629e-03 + + 3.3250238746404648e-02 -4.3427819013595581e-01 + <_> + + 0 -1 2446 2.5912460405379534e-03 + + 4.0578570216894150e-02 -4.9658200144767761e-01 + <_> + + 0 -1 2447 3.0834769131615758e-04 + + -1.4615769684314728e-01 1.2339019775390625e-01 + <_> + + 0 -1 2448 -2.4314899928867817e-03 + + 7.2739332914352417e-02 -1.9999310374259949e-01 + <_> + + 0 -1 2449 -1.8934230320155621e-03 + + -2.3373599350452423e-01 5.6464370340108871e-02 + <_> + + 0 -1 2450 4.4724289327859879e-03 + + 4.7042880207300186e-02 -3.1258741021156311e-01 + <_> + + 0 -1 2451 1.5810050535947084e-04 + + -1.3098309934139252e-01 1.0137090086936951e-01 + <_> + + 0 -1 2452 1.8755989149212837e-02 + + -3.8183789700269699e-02 3.7149110436439514e-01 + <_> + + 0 -1 2453 -7.4876967119053006e-04 + + 1.9981959462165833e-01 -6.0278389602899551e-02 + <_> + + 0 -1 2454 -9.3861011555418372e-04 + + 8.7467707693576813e-02 -1.6001270711421967e-01 + <_> + + 0 -1 2455 -1.3442989438772202e-03 + + -3.3072051405906677e-01 3.6564111709594727e-02 + <_> + + 0 -1 2456 -1.1384190293028951e-03 + + -2.0630060136318207e-01 5.6614480912685394e-02 + <_> + + 0 -1 2457 2.5966269895434380e-03 + + -6.2676019966602325e-02 1.9195850193500519e-01 + <_> + + 0 -1 2458 1.2499650474637747e-03 + + 5.7390280067920685e-02 -1.9605259597301483e-01 + <_> + + 0 -1 2459 1.1832700110971928e-03 + + -8.5788756608963013e-02 1.3682979345321655e-01 + <_> + + 0 -1 2460 -5.1836138591170311e-03 + + 3.1635698676109314e-01 -4.6736460179090500e-02 + <_> + + 0 -1 2461 -1.3185790181159973e-01 + + -6.2279629707336426e-01 1.8798090517520905e-02 + <_> + + 0 -1 2462 1.8653980223461986e-03 + + 3.8837268948554993e-02 -3.0104321241378784e-01 + <_> + + 0 -1 2463 7.3482480365782976e-04 + + -7.6612047851085663e-02 1.5002079308032990e-01 + <_> + + 0 -1 2464 -1.5738410002086312e-04 + + -1.6588360071182251e-01 7.0020452141761780e-02 + <_> + + 0 -1 2465 5.1779212662950158e-04 + + 7.4801079928874969e-02 -1.6358199715614319e-01 + <_> + + 0 -1 2466 7.5904270634055138e-03 + + -5.1050990819931030e-02 2.4487720429897308e-01 + <_> + + 0 -1 2467 -1.1010250076651573e-02 + + -5.8380401134490967e-01 2.0622009411454201e-02 + <_> + + 0 -1 2468 1.1621849983930588e-01 + + 2.5175059214234352e-02 -4.1262671351432800e-01 + <_> + + 0 -1 2469 -7.4468040838837624e-04 + + 1.2729789316654205e-01 -8.9675500988960266e-02 + <_> + + 0 -1 2470 1.1765309609472752e-02 + + 2.0906679332256317e-02 -5.3172761201858521e-01 + <_> + + 0 -1 2471 -4.4441698119044304e-03 + + 1.4282639324665070e-01 -7.8762412071228027e-02 + <_> + + 0 -1 2472 -4.3369788909330964e-04 + + -2.2131459414958954e-01 5.4554950445890427e-02 + <_> + + 0 -1 2473 -1.9204010022804141e-03 + + -2.5610721111297607e-01 4.0600918233394623e-02 + <_> + + 0 -1 2474 -2.9081690590828657e-03 + + 2.0206320285797119e-01 -5.6222829967737198e-02 + <_> + + 0 -1 2475 -1.4549949810316321e-05 + + 9.0000502765178680e-02 -1.1770520359277725e-01 + <_> + + 0 -1 2476 -5.3217669483274221e-04 + + -1.5299430489540100e-01 6.8925492465496063e-02 + <_> + + 0 -1 2477 -1.4590179547667503e-02 + + 2.1776519715785980e-01 -5.1850430667400360e-02 + <_> + + 0 -1 2478 -4.0213059401139617e-04 + + 9.4017893075942993e-02 -1.1027640104293823e-01 + <_> + + 0 -1 2479 -2.3089889436960220e-03 + + 2.4792349338531494e-01 -5.7857040315866470e-02 + <_> + + 0 -1 2480 3.1196139752864838e-04 + + -1.4021940529346466e-01 7.7247492969036102e-02 + <_> + + 0 -1 2481 -9.1317007318139076e-03 + + 4.0242809057235718e-01 -2.8953509405255318e-02 + <_> + + 0 -1 2482 4.2655199649743736e-04 + + 5.3114388138055801e-02 -2.1355339884757996e-01 + <_> + + 0 -1 2483 3.9956220425665379e-03 + + 4.4066920876502991e-02 -2.2994419932365417e-01 + <_> + + 0 -1 2484 -1.4012040337547660e-03 + + 2.7106899023056030e-01 -4.5171830803155899e-02 + <_> + + 0 -1 2485 3.6064770072698593e-02 + + 3.3628080040216446e-02 -3.2830131053924561e-01 + <_> + + 0 -1 2486 -1.3408949598670006e-04 + + -1.3888040184974670e-01 8.0078050494194031e-02 + <_> + + 0 -1 2487 -6.9480319507420063e-03 + + -3.9315450191497803e-01 2.7302930131554604e-02 + <_> + + 0 -1 2488 -1.4855440240353346e-03 + + 1.9761669635772705e-01 -5.1562070846557617e-02 + <_> + + 0 -1 2489 -1.3757539913058281e-02 + + -5.5620980262756348e-01 1.8301570788025856e-02 + <_> + + 0 -1 2490 8.4021147340536118e-03 + + 1.3690480031073093e-02 -6.3171321153640747e-01 + <_> + + 0 -1 2491 -1.7845979891717434e-04 + + -1.4535990357398987e-01 6.3921131193637848e-02 + <_> + + 0 -1 2492 -1.1326850391924381e-02 + + 6.5870612859725952e-01 -1.6460629180073738e-02 + <_> + + 0 -1 2493 1.5268150018528104e-03 + + -6.0389541089534760e-02 1.5454010665416718e-01 + <_> + + 0 -1 2494 -6.0069989413022995e-03 + + 2.5859731435775757e-01 -4.9466971307992935e-02 + <_> + + 0 -1 2495 -7.4241221882402897e-03 + + -3.8806110620498657e-01 2.9393190518021584e-02 + <_> + + 0 -1 2496 -3.9992430247366428e-03 + + -1.3788199424743652e-01 7.7991880476474762e-02 + <_> + + 0 -1 2497 1.0202969860984012e-04 + + 7.2710737586021423e-02 -1.7032580077648163e-01 + <_> + + 0 -1 2498 4.0135599556379020e-04 + + -9.2788018286228180e-02 1.2305440008640289e-01 + <_> + + 0 -1 2499 -9.7611807286739349e-03 + + -3.6630520224571228e-01 2.9748899862170219e-02 + <_> + + 0 -1 2500 -3.0745539069175720e-01 + + -7.8651821613311768e-01 1.3058690354228020e-02 + <_> + + 0 -1 2501 -6.0231718234717846e-03 + + -5.0900238752365112e-01 1.8171619623899460e-02 + <_> + + 0 -1 2502 -2.3784159566275775e-04 + + -9.9822521209716797e-02 1.0530869662761688e-01 + <_> + + 0 -1 2503 1.3516229810193181e-03 + + -6.6444016993045807e-02 1.5425109863281250e-01 + <_> + + 0 -1 2504 -1.6924949595704675e-03 + + -4.4133850932121277e-01 2.5100700557231903e-02 + <_> + + 0 -1 2505 1.0610929457470775e-03 + + -6.0577899217605591e-02 1.7217910289764404e-01 + <_> + + 0 -1 2506 5.6644581491127610e-04 + + -7.8687779605388641e-02 1.6784669458866119e-01 + <_> + + 0 -1 2507 -1.3955390080809593e-02 + + -5.7841098308563232e-01 1.9087139517068863e-02 + <_> + + 0 -1 2508 -1.8862909637391567e-03 + + 6.2118150293827057e-02 -1.6523399949073792e-01 + <_> + + 0 -1 2509 1.6784170642495155e-02 + + -3.0380919575691223e-02 3.6105319857597351e-01 + <_> + + 0 -1 2510 -1.4158519661577884e-05 + + 7.2182632982730865e-02 -1.4407490193843842e-01 + <_> + + 0 -1 2511 7.3750452138483524e-03 + + 2.9791580513119698e-02 -2.9277870059013367e-01 + <_> + + 0 -1 2512 8.0517530441284180e-03 + + -4.4681299477815628e-02 2.1760399639606476e-01 + <_> + + 0 -1 2513 -7.9519696533679962e-02 + + -6.5208691358566284e-01 1.4618909917771816e-02 + <_> + + 0 -1 2514 1.2065700255334377e-02 + + 2.9202880337834358e-02 -2.9454120993614197e-01 + <_> + + 0 -1 2515 -1.0122699663043022e-02 + + 2.7746239304542542e-01 -4.3713569641113281e-02 + <_> + + 0 -1 2516 -1.8515810370445251e-01 + + -4.6136859059333801e-01 2.4093240499496460e-02 + <_> + + 0 -1 2517 -8.0726131796836853e-02 + + -4.4673430919647217e-01 2.0845459774136543e-02 + <_> + + 0 -1 2518 1.5173270367085934e-03 + + -5.1575969904661179e-02 1.8063379824161530e-01 + <_> + + 0 -1 2519 -1.1184819974005222e-02 + + -3.5373958945274353e-01 2.7059540152549744e-02 + <_> + + 0 -1 2520 -3.5008399281650782e-03 + + 2.0548710227012634e-01 -4.6032059937715530e-02 + <_> + + 0 -1 2521 1.4720410108566284e-03 + + -6.3871711492538452e-02 1.8168300390243530e-01 + <_> + + 0 -1 2522 -4.5021830010227859e-04 + + -1.6353920102119446e-01 5.9327740222215652e-02 + <_> + + 0 -1 2523 6.1653478769585490e-04 + + 6.9089323282241821e-02 -1.9156040251255035e-01 + <_> + + 0 -1 2524 1.4797239564359188e-03 + + -5.2241999655961990e-02 1.8631340563297272e-01 + <_> + + 0 -1 2525 -1.4754989933862817e-05 + + 7.3586143553256989e-02 -1.5092320740222931e-01 + <_> + + 0 -1 2526 8.6423632455989718e-04 + + 6.6930077970027924e-02 -1.3976100087165833e-01 + <_> + + 0 -1 2527 -4.1005611419677734e-03 + + 2.0946699380874634e-01 -4.7175008803606033e-02 + <_> + + 0 -1 2528 -2.1505339536815882e-03 + + -5.2753841876983643e-01 1.7665250226855278e-02 + <_> + + 0 -1 2529 7.8334724530577660e-03 + + -4.5125011354684830e-02 2.0374919474124908e-01 + <_> + + 0 -1 2530 -3.2690390944480896e-03 + + -1.3836699724197388e-01 7.0653162896633148e-02 + <_> + + 0 -1 2531 3.9274748414754868e-03 + + 6.8428598344326019e-02 -1.6210170090198517e-01 + <_> + + 0 -1 2532 7.6534547843039036e-03 + + -9.3162156641483307e-02 9.9912680685520172e-02 + <_> + + 0 -1 2533 -3.2620150595903397e-02 + + 3.5453549027442932e-01 -3.0765339732170105e-02 + <_> + + 0 -1 2534 -1.8247209489345551e-02 + + -3.8171181082725525e-01 2.7764180675148964e-02 + <_> + + 0 -1 2535 -8.0104079097509384e-04 + + -1.4329099655151367e-01 6.4936630427837372e-02 + <_> + + 0 -1 2536 -1.0993109643459320e-01 + + 8.7319427728652954e-01 -1.1242670007050037e-02 + <_> + + 0 -1 2537 -3.0508199706673622e-02 + + -6.1269849538803101e-01 1.9372699782252312e-02 + <_> + + 0 -1 2538 -1.9187819212675095e-02 + + 2.8533020615577698e-01 -3.6832328885793686e-02 + <_> + + 0 -1 2539 2.3266570642590523e-03 + + 4.7289360314607620e-02 -2.1252959966659546e-01 + <_> + + 0 -1 2540 -1.4535760274156928e-03 + + 1.3778920471668243e-01 -7.4501492083072662e-02 + <_> + + 0 -1 2541 -1.0573640465736389e-03 + + -2.2186830639839172e-01 4.2039170861244202e-02 + <_> + + 0 -1 2542 1.7203199677169323e-03 + + -6.9299750030040741e-02 1.3794890046119690e-01 + <_> + + 0 -1 2543 -1.4716150471940637e-03 + + 2.4296709895133972e-01 -4.0795009583234787e-02 + <_> + + 0 -1 2544 -5.2822660654783249e-03 + + -3.1959480047225952e-01 3.4215260297060013e-02 + <_> + + 0 -1 2545 -4.7165742143988609e-03 + + 3.0581191182136536e-01 -3.1772918999195099e-02 + <_> + + 0 -1 2546 7.3668370023369789e-03 + + 6.1085078865289688e-02 -1.6390019655227661e-01 + <_> + + 0 -1 2547 -7.6594999991357327e-03 + + -4.6472349762916565e-01 1.8869750201702118e-02 + <_> + + 0 -1 2548 7.6969028450548649e-03 + + -1.8191590905189514e-02 5.5395811796188354e-01 + <_> + + 0 -1 2549 -5.6195858633145690e-04 + + 9.7618483006954193e-02 -1.0844089835882187e-01 + <_> + + 0 -1 2550 -1.4587530131393578e-05 + + 7.4585132300853729e-02 -1.2353610247373581e-01 + <_> + + 0 -1 2551 -9.5779378898441792e-04 + + 1.6370140016078949e-01 -5.8610081672668457e-02 + <_> + + 0 -1 2552 8.0253500491380692e-03 + + 2.6857670396566391e-02 -4.1507768630981445e-01 + <_> + + 0 -1 2553 1.6938529442995787e-03 + + 4.8536270856857300e-02 -1.7888469994068146e-01 + <_> + + 0 -1 2554 -4.3334178626537323e-03 + + 1.9798220694065094e-01 -4.8085059970617294e-02 + <_> + + 0 -1 2555 -2.2440029715653509e-04 + + -1.5113249421119690e-01 6.0428649187088013e-02 + <_> + + 0 -1 2556 -1.1392509564757347e-02 + + 3.2737928628921509e-01 -2.9751259833574295e-02 + <_> + + 0 -1 2557 -9.3984175473451614e-03 + + -1.2912990152835846e-01 7.6302282512187958e-02 + <_> + + 0 -1 2558 8.7430170970037580e-04 + + -9.7556166350841522e-02 9.7808010876178741e-02 + <_> + + 0 -1 2559 7.5171617791056633e-03 + + 6.5084353089332581e-02 -1.5419410169124603e-01 + <_> + + 0 -1 2560 -2.7937069535255432e-03 + + 1.5009529888629913e-01 -6.3355393707752228e-02 + <_> + + 0 -1 2561 -3.4385098842903972e-04 + + 1.2404289841651917e-01 -7.5780630111694336e-02 + <_> + + 0 -1 2562 8.7557926774024963e-02 + + -1.5905940905213356e-02 5.6607347726821899e-01 + <_> + + 0 -1 2563 -9.3594435602426529e-03 + + -3.3039200305938721e-01 3.0874710530042648e-02 + <_> + + 0 -1 2564 -6.7703737877309322e-03 + + 1.7960870265960693e-01 -5.1310319453477859e-02 + <_> + + 0 -1 2565 -6.2513751909136772e-03 + + -5.7952338457107544e-01 1.5425769612193108e-02 + <_> + + 0 -1 2566 -2.5206409394741058e-02 + + -6.3777071237564087e-01 1.3051119633018970e-02 + <_> + + 0 -1 2567 -1.1819769861176610e-03 + + -2.0478110015392303e-01 4.0494531393051147e-02 + <_> + + 0 -1 2568 -1.0458839824423194e-03 + + 1.4812879264354706e-01 -6.2631592154502869e-02 + <_> + + 0 -1 2569 -2.5445020291954279e-03 + + 1.3021010160446167e-01 -6.9430023431777954e-02 + <_> + + 0 -1 2570 -8.0673627555370331e-02 + + -2.8054219484329224e-01 3.8956280797719955e-02 + <_> + + 0 -1 2571 -1.4390920114237815e-04 + + 1.0780519992113113e-01 -9.6550762653350830e-02 + <_> + + 0 -1 2572 7.6481432188302279e-04 + + 6.0667239129543304e-02 -1.5742610394954681e-01 + <_> + + 0 -1 2573 -3.4516688901931047e-04 + + 1.1415769904851913e-01 -8.8832370936870575e-02 + <_> + + 0 -1 2574 -2.2118249908089638e-03 + + 2.2988039255142212e-01 -5.0498738884925842e-02 + <_> + + 0 -1 2575 9.4616543501615524e-03 + + 1.9827060401439667e-02 -5.0633531808853149e-01 + <_> + + 0 -1 2576 1.0567939607426524e-03 + + 3.8744639605283737e-02 -2.3509359359741211e-01 + <_> + + 0 -1 2577 2.9194469098001719e-03 + + -6.1895478516817093e-02 1.5313319861888885e-01 + <_> + + 0 -1 2578 -1.0768010281026363e-02 + + -5.5298101902008057e-01 1.7847239971160889e-02 + <_> + + 0 -1 2579 -1.0197740048170090e-03 + + 1.1559300124645233e-01 -8.0185852944850922e-02 + <_> + + 0 -1 2580 1.8127029761672020e-04 + + 5.6652870029211044e-02 -1.6549369692802429e-01 + <_> + + 0 -1 2581 7.1620188464294188e-06 + + -9.1480091214179993e-02 9.7915090620517731e-02 + <_> + + 0 -1 2582 5.2910070866346359e-02 + + -1.3591200113296509e-02 6.6090220212936401e-01 + <_> + + 0 -1 2583 4.0185371041297913e-01 + + 1.9574489444494247e-02 -4.9015858769416809e-01 + <_> + + 0 -1 2584 -1.7914770171046257e-02 + + -8.8317036628723145e-02 1.0532960295677185e-01 + <_> + + 0 -1 2585 -1.4578569789591711e-05 + + 7.8513152897357941e-02 -1.2300349771976471e-01 + <_> + + 0 -1 2586 6.4994548447430134e-03 + + -4.0843468159437180e-02 2.9337158799171448e-01 + <_> + + 0 -1 2587 9.5762982964515686e-02 + + 1.9332479685544968e-02 -5.3444057703018188e-01 + <_> + + 0 -1 2588 1.4263469893194269e-05 + + -8.8897533714771271e-02 1.0632789880037308e-01 + <_> + + 0 -1 2589 2.2215039934962988e-03 + + -4.0777951478958130e-02 2.6405128836631775e-01 + <_> + + 0 -1 2590 3.1875250861048698e-03 + + 5.9725038707256317e-02 -1.6202959418296814e-01 + <_> + + 0 -1 2591 9.6069589257240295e-02 + + 1.1318460106849670e-02 -7.9110687971115112e-01 + <_> + + 0 -1 2592 1.9584870897233486e-03 + + -3.9252020418643951e-02 2.3639929294586182e-01 + <_> + + 0 -1 2593 -1.8468469381332397e-01 + + -5.8974397182464600e-01 1.5758410096168518e-02 + <_> + + 0 -1 2594 2.1685050160158426e-04 + + 4.6320449560880661e-02 -1.8274679780006409e-01 + <_> + + 0 -1 2595 1.8809709697961807e-02 + + -4.3357118964195251e-02 2.7832600474357605e-01 + <_> + + 0 -1 2596 -6.2639699317514896e-03 + + -1.3891190290451050e-01 7.7115900814533234e-02 + <_> + + 0 -1 2597 3.2622940489090979e-04 + + -9.1803021728992462e-02 1.0588289797306061e-01 + <_> + + 0 -1 2598 5.3745559416711330e-03 + + 1.0803489945828915e-02 -7.6716458797454834e-01 + <_> + + 0 -1 2599 2.8126770630478859e-03 + + -5.9618860483169556e-02 1.6133050620555878e-01 + <_> + + 0 -1 2600 -6.5314618404954672e-04 + + -8.5690811276435852e-02 1.1540769785642624e-01 + <_> + + 0 -1 2601 -1.7845110269263387e-03 + + 8.1831991672515869e-02 -1.2700800597667694e-01 + <_> + + 0 -1 2602 3.0969830695539713e-03 + + 6.8366639316082001e-02 -1.4475439488887787e-01 + <_> + + 0 -1 2603 -4.1442047804594040e-03 + + 1.8632030487060547e-01 -5.4030310362577438e-02 + <_> + + 0 -1 2604 -4.9972519278526306e-02 + + -1.2800359725952148e-01 8.5049159824848175e-02 + <_> + + 0 -1 2605 -1.0743910446763039e-02 + + 1.3701729476451874e-01 -7.7366456389427185e-02 + <_> + + 0 -1 2606 -3.0474149389192462e-04 + + -1.6938340663909912e-01 5.7971168309450150e-02 + <_> + + 0 -1 2607 3.6023318767547607e-02 + + 1.3561300002038479e-02 -6.3279747962951660e-01 + <_> + + 0 -1 2608 2.5479190517216921e-03 + + -4.3824359774589539e-02 2.2150419652462006e-01 + + <_> + + <_> + 8 7 2 6 -1. + <_> + 8 10 2 3 2. + <_> + + <_> + 8 3 10 7 -1. + <_> + 13 3 5 7 2. + <_> + + <_> + 10 11 3 6 -1. + <_> + 10 14 3 3 2. + <_> + + <_> + 10 4 8 8 -1. + <_> + 14 4 4 8 2. + <_> + + <_> + 5 7 5 4 -1. + <_> + 5 9 5 2 2. + <_> + + <_> + 8 4 6 6 -1. + <_> + 8 4 3 3 2. + <_> + 11 7 3 3 2. + <_> + + <_> + 10 14 5 2 -1. + <_> + 10 15 5 1 2. + <_> + + <_> + 7 11 8 4 -1. + <_> + 7 13 8 2 2. + <_> + + <_> + 11 14 3 3 -1. + <_> + 11 15 3 1 3. + <_> + + <_> + 3 5 3 11 -1. + <_> + 4 5 1 11 3. + <_> + + <_> + 8 7 9 6 -1. + <_> + 8 10 9 3 2. + <_> + + <_> + 13 12 1 2 -1. + <_> + 13 13 1 1 2. + <_> + + <_> + 1 3 6 17 -1. + <_> + 4 3 3 17 2. + <_> + + <_> + 11 12 1 3 -1. + <_> + 11 13 1 1 3. + <_> + + <_> + 1 9 6 9 -1. + <_> + 4 9 3 9 2. + <_> + + <_> + 10 5 8 6 -1. + <_> + 14 5 4 6 2. + <_> + + <_> + 7 8 9 6 -1. + <_> + 7 10 9 2 3. + <_> + + <_> + 5 8 6 6 -1. + <_> + 5 8 3 3 2. + <_> + 8 11 3 3 2. + <_> + + <_> + 2 0 4 18 -1. + <_> + 4 0 2 18 2. + <_> + + <_> + 10 12 3 4 -1. + <_> + 10 14 3 2 2. + <_> + + <_> + 7 0 3 9 -1. + <_> + 7 3 3 3 3. + <_> + + <_> + 11 13 1 3 -1. + <_> + 11 14 1 1 3. + <_> + + <_> + 4 8 5 2 -1. + <_> + 4 9 5 1 2. + <_> + + <_> + 11 13 2 3 -1. + <_> + 11 14 2 1 3. + <_> + + <_> + 12 12 1 3 -1. + <_> + 12 13 1 1 3. + <_> + + <_> + 9 12 2 8 -1. + <_> + 9 16 2 4 2. + <_> + + <_> + 6 3 4 13 -1. + <_> + 8 3 2 13 2. + <_> + + <_> + 2 6 4 12 -1. + <_> + 4 6 2 12 2. + <_> + + <_> + 11 13 3 2 -1. + <_> + 12 13 1 2 3. + <_> + + <_> + 3 5 3 11 -1. + <_> + 4 5 1 11 3. + <_> + + <_> + 3 6 13 12 -1. + <_> + 3 12 13 6 2. + <_> + + <_> + 7 7 6 6 -1. + <_> + 7 7 3 3 2. + <_> + 10 10 3 3 2. + <_> + + <_> + 4 7 3 2 -1. + <_> + 5 7 1 2 3. + <_> + + <_> + 5 4 14 3 -1. + <_> + 12 4 7 3 2. + <_> + + <_> + 10 12 3 2 -1. + <_> + 11 12 1 2 3. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 12 14 1 3 -1. + <_> + 12 15 1 1 3. + <_> + + <_> + 3 6 3 3 -1. + <_> + 4 6 1 3 3. + <_> + + <_> + 8 4 3 2 -1. + <_> + 9 4 1 2 3. + <_> + + <_> + 3 3 3 13 -1. + <_> + 4 3 1 13 3. + <_> + + <_> + 15 4 2 3 -1. + <_> + 15 5 2 1 3. + <_> + + <_> + 12 8 4 4 -1. + <_> + 12 10 4 2 2. + <_> + + <_> + 8 7 8 9 -1. + <_> + 8 10 8 3 3. + <_> + + <_> + 8 0 12 6 -1. + <_> + 8 0 6 3 2. + <_> + 14 3 6 3 2. + <_> + + <_> + 5 9 3 6 -1. + <_> + 5 12 3 3 2. + <_> + + <_> + 11 12 2 4 -1. + <_> + 12 12 1 4 2. + <_> + + <_> + 10 11 3 8 -1. + <_> + 11 11 1 8 3. + <_> + + <_> + 5 5 5 6 -1. + <_> + 5 7 5 2 3. + <_> + + <_> + 10 13 2 6 -1. + <_> + 10 16 2 3 2. + <_> + + <_> + 10 15 3 4 -1. + <_> + 11 15 1 4 3. + <_> + + <_> + 7 3 3 3 -1. + <_> + 8 3 1 3 3. + <_> + + <_> + 5 8 6 2 -1. + <_> + 8 8 3 2 2. + <_> + + <_> + 8 7 4 2 -1. + <_> + 10 7 2 2 2. + <_> + + <_> + 5 6 2 3 -1. + <_> + 6 6 1 3 2. + <_> + + <_> + 8 0 3 8 -1. + <_> + 9 0 1 8 3. + <_> + + <_> + 5 10 3 8 -1. + <_> + 5 14 3 4 2. + <_> + + <_> + 12 3 3 2 -1. + <_> + 13 3 1 2 3. + <_> + + <_> + 8 2 3 4 -1. + <_> + 9 2 1 4 3. + <_> + + <_> + 14 10 1 8 -1. + <_> + 14 14 1 4 2. + <_> + + <_> + 6 12 2 3 -1. + <_> + 6 13 2 1 3. + <_> + + <_> + 6 12 2 3 -1. + <_> + 6 13 2 1 3. + <_> + + <_> + 9 12 3 2 -1. + <_> + 10 12 1 2 3. + <_> + + <_> + 12 2 1 12 -1. + <_> + 12 6 1 4 3. + <_> + + <_> + 2 8 14 6 -1. + <_> + 2 8 7 3 2. + <_> + 9 11 7 3 2. + <_> + + <_> + 11 3 3 17 -1. + <_> + 12 3 1 17 3. + <_> + + <_> + 12 12 1 2 -1. + <_> + 12 13 1 1 2. + <_> + + <_> + 13 1 2 1 -1. + <_> + 14 1 1 1 2. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 12 12 2 3 -1. + <_> + 12 13 2 1 3. + <_> + + <_> + 8 2 10 10 -1. + <_> + 13 2 5 10 2. + <_> + + <_> + 11 13 3 1 -1. + <_> + 12 13 1 1 3. + <_> + + <_> + 12 10 1 4 -1. + <_> + 12 12 1 2 2. + <_> + + <_> + 8 7 2 6 -1. + <_> + 8 10 2 3 2. + <_> + + <_> + 12 11 1 3 -1. + <_> + 12 12 1 1 3. + <_> + + <_> + 9 12 3 3 -1. + <_> + 10 12 1 3 3. + <_> + + <_> + 6 0 8 6 -1. + <_> + 6 3 8 3 2. + <_> + + <_> + 0 0 8 19 -1. + <_> + 4 0 4 19 2. + <_> + + <_> + 5 6 4 9 -1. + <_> + 5 9 4 3 3. + <_> + + <_> + 13 14 1 2 -1. + <_> + 13 15 1 1 2. + <_> + + <_> + 1 3 8 15 -1. + <_> + 5 3 4 15 2. + <_> + + <_> + 13 14 2 3 -1. + <_> + 13 15 2 1 3. + <_> + + <_> + 5 7 3 2 -1. + <_> + 6 7 1 2 3. + <_> + + <_> + 8 5 3 1 -1. + <_> + 9 5 1 1 3. + <_> + + <_> + 9 5 3 1 -1. + <_> + 10 5 1 1 3. + <_> + + <_> + 6 11 1 3 -1. + <_> + 6 12 1 1 3. + <_> + + <_> + 18 4 1 2 -1. + <_> + 18 5 1 1 2. + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + <_> + + <_> + 10 10 3 4 -1. + <_> + 11 10 1 4 3. + <_> + + <_> + 6 5 2 14 -1. + <_> + 6 12 2 7 2. + <_> + + <_> + 14 8 3 4 -1. + <_> + 14 10 3 2 2. + <_> + + <_> + 4 5 3 6 -1. + <_> + 4 7 3 2 3. + <_> + + <_> + 5 10 2 8 -1. + <_> + 5 14 2 4 2. + <_> + + <_> + 9 1 3 2 -1. + <_> + 10 1 1 2 3. + <_> + + <_> + 10 1 3 3 -1. + <_> + 11 1 1 3 3. + <_> + + <_> + 9 12 8 8 -1. + <_> + 9 12 4 4 2. + <_> + 13 16 4 4 2. + <_> + + <_> + 8 13 6 4 -1. + <_> + 10 13 2 4 3. + <_> + + <_> + 3 6 3 12 -1. + <_> + 4 6 1 12 3. + <_> + + <_> + 9 3 8 5 -1. + <_> + 13 3 4 5 2. + <_> + + <_> + 7 7 3 6 -1. + <_> + 7 10 3 3 2. + <_> + + <_> + 5 10 10 4 -1. + <_> + 5 12 10 2 2. + <_> + + <_> + 11 12 1 6 -1. + <_> + 11 15 1 3 2. + <_> + + <_> + 5 8 6 2 -1. + <_> + 8 8 3 2 2. + <_> + + <_> + 2 0 8 4 -1. + <_> + 2 0 4 2 2. + <_> + 6 2 4 2 2. + <_> + + <_> + 11 7 3 5 -1. + <_> + 12 7 1 5 3. + <_> + + <_> + 12 13 2 3 -1. + <_> + 12 14 2 1 3. + <_> + + <_> + 12 12 1 2 -1. + <_> + 12 13 1 1 2. + <_> + + <_> + 5 11 6 3 -1. + <_> + 8 11 3 3 2. + <_> + + <_> + 2 6 3 9 -1. + <_> + 3 6 1 9 3. + <_> + + <_> + 12 12 1 3 -1. + <_> + 12 13 1 1 3. + <_> + + <_> + 5 8 4 2 -1. + <_> + 5 9 4 1 2. + <_> + + <_> + 3 8 3 7 -1. + <_> + 4 8 1 7 3. + <_> + + <_> + 1 3 6 15 -1. + <_> + 3 3 2 15 3. + <_> + + <_> + 12 14 4 3 -1. + <_> + 12 15 4 1 3. + <_> + + <_> + 9 0 2 20 -1. + <_> + 9 0 1 10 2. + <_> + 10 10 1 10 2. + <_> + + <_> + 6 12 3 3 -1. + <_> + 6 13 3 1 3. + <_> + + <_> + 5 7 3 10 -1. + <_> + 5 12 3 5 2. + <_> + + <_> + 8 5 2 1 -1. + <_> + 9 5 1 1 2. + <_> + + <_> + 5 12 3 3 -1. + <_> + 5 13 3 1 3. + <_> + + <_> + 15 5 4 2 -1. + <_> + 15 6 4 1 2. + <_> + + <_> + 15 5 3 2 -1. + <_> + 15 6 3 1 2. + <_> + + <_> + 5 11 2 3 -1. + <_> + 5 12 2 1 3. + <_> + + <_> + 6 5 4 12 -1. + <_> + 8 5 2 12 2. + <_> + + <_> + 7 4 3 3 -1. + <_> + 8 4 1 3 3. + <_> + + <_> + 5 6 2 3 -1. + <_> + 6 6 1 3 2. + <_> + + <_> + 4 8 3 1 -1. + <_> + 5 8 1 1 3. + <_> + + <_> + 12 10 2 1 -1. + <_> + 13 10 1 1 2. + <_> + + <_> + 10 13 5 2 -1. + <_> + 10 14 5 1 2. + <_> + + <_> + 11 13 1 3 -1. + <_> + 11 14 1 1 3. + <_> + + <_> + 7 2 3 6 -1. + <_> + 7 4 3 2 3. + <_> + + <_> + 5 11 2 3 -1. + <_> + 5 12 2 1 3. + <_> + + <_> + 12 14 2 3 -1. + <_> + 12 15 2 1 3. + <_> + + <_> + 8 5 3 3 -1. + <_> + 8 6 3 1 3. + <_> + + <_> + 7 6 9 10 -1. + <_> + 7 11 9 5 2. + <_> + + <_> + 0 18 18 2 -1. + <_> + 6 18 6 2 3. + <_> + + <_> + 0 5 1 8 -1. + <_> + 0 9 1 4 2. + <_> + + <_> + 1 3 8 10 -1. + <_> + 1 8 8 5 2. + <_> + + <_> + 9 12 6 2 -1. + <_> + 9 13 6 1 2. + <_> + + <_> + 9 6 2 3 -1. + <_> + 9 7 2 1 3. + <_> + + <_> + 9 4 3 3 -1. + <_> + 10 4 1 3 3. + <_> + + <_> + 13 13 1 3 -1. + <_> + 13 14 1 1 3. + <_> + + <_> + 2 6 13 3 -1. + <_> + 2 7 13 1 3. + <_> + + <_> + 10 15 2 4 -1. + <_> + 11 15 1 4 2. + <_> + + <_> + 7 7 2 3 -1. + <_> + 8 7 1 3 2. + <_> + + <_> + 3 6 12 8 -1. + <_> + 3 6 6 4 2. + <_> + 9 10 6 4 2. + <_> + + <_> + 12 0 8 4 -1. + <_> + 12 0 4 2 2. + <_> + 16 2 4 2 2. + <_> + + <_> + 9 15 3 3 -1. + <_> + 10 15 1 3 3. + <_> + + <_> + 10 14 1 2 -1. + <_> + 10 15 1 1 2. + <_> + + <_> + 6 11 5 6 -1. + <_> + 6 14 5 3 2. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 5 6 3 4 -1. + <_> + 6 6 1 4 3. + <_> + + <_> + 9 6 6 4 -1. + <_> + 11 6 2 4 3. + <_> + + <_> + 6 5 12 6 -1. + <_> + 6 7 12 2 3. + <_> + + <_> + 3 1 16 7 -1. + <_> + 11 1 8 7 2. + <_> + + <_> + 12 11 1 6 -1. + <_> + 12 14 1 3 2. + <_> + + <_> + 6 6 9 8 -1. + <_> + 6 10 9 4 2. + <_> + + <_> + 5 9 4 6 -1. + <_> + 5 12 4 3 2. + <_> + + <_> + 1 0 6 14 -1. + <_> + 4 0 3 14 2. + <_> + + <_> + 8 1 1 9 -1. + <_> + 8 4 1 3 3. + <_> + + <_> + 11 13 2 2 -1. + <_> + 11 14 2 1 2. + <_> + + <_> + 2 7 4 13 -1. + <_> + 4 7 2 13 2. + <_> + + <_> + 5 8 6 6 -1. + <_> + 8 8 3 6 2. + <_> + + <_> + 18 0 2 20 -1. + <_> + 19 0 1 20 2. + <_> + + <_> + 6 7 3 3 -1. + <_> + 7 7 1 3 3. + <_> + + <_> + 13 10 1 4 -1. + <_> + 13 12 1 2 2. + <_> + + <_> + 12 11 2 2 -1. + <_> + 12 12 2 1 2. + <_> + + <_> + 3 6 12 6 -1. + <_> + 3 6 6 3 2. + <_> + 9 9 6 3 2. + <_> + + <_> + 10 13 2 2 -1. + <_> + 10 14 2 1 2. + <_> + + <_> + 6 13 2 3 -1. + <_> + 6 14 2 1 3. + <_> + + <_> + 13 5 1 3 -1. + <_> + 13 6 1 1 3. + <_> + + <_> + 6 14 3 3 -1. + <_> + 6 15 3 1 3. + <_> + + <_> + 5 15 3 3 -1. + <_> + 5 16 3 1 3. + <_> + + <_> + 15 3 1 3 -1. + <_> + 15 4 1 1 3. + <_> + + <_> + 3 8 3 12 -1. + <_> + 4 8 1 12 3. + <_> + + <_> + 3 4 3 14 -1. + <_> + 4 4 1 14 3. + <_> + + <_> + 6 11 6 2 -1. + <_> + 9 11 3 2 2. + <_> + + <_> + 4 8 8 4 -1. + <_> + 8 8 4 4 2. + <_> + + <_> + 4 5 2 4 -1. + <_> + 5 5 1 4 2. + <_> + + <_> + 7 3 2 1 -1. + <_> + 8 3 1 1 2. + <_> + + <_> + 12 16 2 3 -1. + <_> + 12 17 2 1 3. + <_> + + <_> + 3 16 6 3 -1. + <_> + 3 17 6 1 3. + <_> + + <_> + 13 4 2 1 -1. + <_> + 14 4 1 1 2. + <_> + + <_> + 9 16 4 4 -1. + <_> + 11 16 2 4 2. + <_> + + <_> + 5 9 3 1 -1. + <_> + 6 9 1 1 3. + <_> + + <_> + 6 8 2 2 -1. + <_> + 6 9 2 1 2. + <_> + + <_> + 12 13 2 1 -1. + <_> + 13 13 1 1 2. + <_> + + <_> + 6 7 6 3 -1. + <_> + 8 7 2 3 3. + <_> + + <_> + 5 8 2 10 -1. + <_> + 5 13 2 5 2. + <_> + + <_> + 0 8 1 2 -1. + <_> + 0 9 1 1 2. + <_> + + <_> + 2 11 4 4 -1. + <_> + 4 11 2 4 2. + <_> + + <_> + 1 9 12 3 -1. + <_> + 5 9 4 3 3. + <_> + + <_> + 8 15 2 3 -1. + <_> + 9 15 1 3 2. + <_> + + <_> + 8 6 3 3 -1. + <_> + 8 7 3 1 3. + <_> + + <_> + 1 2 1 2 -1. + <_> + 1 3 1 1 2. + <_> + + <_> + 5 1 7 6 -1. + <_> + 5 3 7 2 3. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 13 7 3 4 -1. + <_> + 13 9 3 2 2. + <_> + + <_> + 5 10 3 3 -1. + <_> + 5 11 3 1 3. + <_> + + <_> + 7 5 3 1 -1. + <_> + 8 5 1 1 3. + <_> + + <_> + 0 0 11 16 -1. + <_> + 0 8 11 8 2. + <_> + + <_> + 7 4 3 2 -1. + <_> + 8 4 1 2 3. + <_> + + <_> + 6 12 2 3 -1. + <_> + 6 13 2 1 3. + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + <_> + + <_> + 13 5 2 2 -1. + <_> + 13 6 2 1 2. + <_> + + <_> + 8 8 2 6 -1. + <_> + 8 10 2 2 3. + <_> + + <_> + 5 6 3 4 -1. + <_> + 6 6 1 4 3. + <_> + + <_> + 10 0 10 8 -1. + <_> + 10 0 5 4 2. + <_> + 15 4 5 4 2. + <_> + + <_> + 9 7 2 12 -1. + <_> + 9 11 2 4 3. + <_> + + <_> + 6 3 12 12 -1. + <_> + 6 3 6 6 2. + <_> + 12 9 6 6 2. + <_> + + <_> + 5 7 4 6 -1. + <_> + 5 9 4 2 3. + <_> + + <_> + 5 7 10 10 -1. + <_> + 5 7 5 5 2. + <_> + 10 12 5 5 2. + <_> + + <_> + 2 1 4 15 -1. + <_> + 4 1 2 15 2. + <_> + + <_> + 12 11 2 2 -1. + <_> + 13 11 1 2 2. + <_> + + <_> + 6 11 10 6 -1. + <_> + 6 14 10 3 2. + <_> + + <_> + 5 12 4 3 -1. + <_> + 5 13 4 1 3. + <_> + + <_> + 6 12 1 3 -1. + <_> + 6 13 1 1 3. + <_> + + <_> + 3 7 12 8 -1. + <_> + 3 7 6 4 2. + <_> + 9 11 6 4 2. + <_> + + <_> + 6 2 2 6 -1. + <_> + 6 4 2 2 3. + <_> + + <_> + 11 11 5 4 -1. + <_> + 11 13 5 2 2. + <_> + + <_> + 5 8 6 6 -1. + <_> + 8 8 3 6 2. + <_> + + <_> + 5 12 4 2 -1. + <_> + 7 12 2 2 2. + <_> + + <_> + 3 13 3 7 -1. + <_> + 4 13 1 7 3. + <_> + + <_> + 11 7 5 9 -1. + <_> + 11 10 5 3 3. + <_> + + <_> + 4 3 15 9 -1. + <_> + 4 6 15 3 3. + <_> + + <_> + 15 13 2 2 -1. + <_> + 15 13 1 1 2. + <_> + 16 14 1 1 2. + <_> + + <_> + 6 5 6 13 -1. + <_> + 9 5 3 13 2. + <_> + + <_> + 5 9 3 1 -1. + <_> + 6 9 1 1 3. + <_> + + <_> + 6 1 2 15 -1. + <_> + 6 6 2 5 3. + <_> + + <_> + 11 0 4 3 -1. + <_> + 13 0 2 3 2. + <_> + + <_> + 0 0 2 4 -1. + <_> + 0 2 2 2 2. + <_> + + <_> + 4 8 9 3 -1. + <_> + 4 9 9 1 3. + <_> + + <_> + 6 5 6 2 -1. + <_> + 8 5 2 2 3. + <_> + + <_> + 4 15 2 2 -1. + <_> + 4 15 1 1 2. + <_> + 5 16 1 1 2. + <_> + + <_> + 6 14 2 3 -1. + <_> + 6 15 2 1 3. + <_> + + <_> + 6 12 1 6 -1. + <_> + 6 15 1 3 2. + <_> + + <_> + 5 9 2 10 -1. + <_> + 5 14 2 5 2. + <_> + + <_> + 3 6 3 10 -1. + <_> + 4 6 1 10 3. + <_> + + <_> + 3 7 3 5 -1. + <_> + 4 7 1 5 3. + <_> + + <_> + 11 0 6 2 -1. + <_> + 13 0 2 2 3. + <_> + + <_> + 11 12 2 1 -1. + <_> + 12 12 1 1 2. + <_> + + <_> + 11 12 2 1 -1. + <_> + 12 12 1 1 2. + <_> + + <_> + 6 16 1 3 -1. + <_> + 6 17 1 1 3. + <_> + + <_> + 10 16 5 3 -1. + <_> + 10 17 5 1 3. + <_> + + <_> + 7 13 1 3 -1. + <_> + 7 14 1 1 3. + <_> + + <_> + 12 4 8 2 -1. + <_> + 12 5 8 1 2. + <_> + + <_> + 8 7 4 3 -1. + <_> + 10 7 2 3 2. + <_> + + <_> + 12 10 5 9 -1. + <_> + 12 13 5 3 3. + <_> + + <_> + 5 11 2 3 -1. + <_> + 5 12 2 1 3. + <_> + + <_> + 5 11 3 3 -1. + <_> + 5 12 3 1 3. + <_> + + <_> + 11 0 2 4 -1. + <_> + 12 0 1 4 2. + <_> + + <_> + 5 9 10 6 -1. + <_> + 5 9 5 3 2. + <_> + 10 12 5 3 2. + <_> + + <_> + 6 12 3 3 -1. + <_> + 6 13 3 1 3. + <_> + + <_> + 1 3 6 12 -1. + <_> + 1 9 6 6 2. + <_> + + <_> + 1 5 5 10 -1. + <_> + 1 10 5 5 2. + <_> + + <_> + 10 14 1 2 -1. + <_> + 10 15 1 1 2. + <_> + + <_> + 9 5 2 8 -1. + <_> + 9 5 1 4 2. + <_> + 10 9 1 4 2. + <_> + + <_> + 17 12 3 1 -1. + <_> + 18 12 1 1 3. + <_> + + <_> + 5 16 2 3 -1. + <_> + 5 17 2 1 3. + <_> + + <_> + 11 18 7 2 -1. + <_> + 11 19 7 1 2. + <_> + + <_> + 12 6 3 8 -1. + <_> + 13 6 1 8 3. + <_> + + <_> + 11 6 6 5 -1. + <_> + 14 6 3 5 2. + <_> + + <_> + 9 7 4 6 -1. + <_> + 9 7 2 3 2. + <_> + 11 10 2 3 2. + <_> + + <_> + 10 8 6 6 -1. + <_> + 10 10 6 2 3. + <_> + + <_> + 2 1 4 17 -1. + <_> + 4 1 2 17 2. + <_> + + <_> + 7 1 9 4 -1. + <_> + 7 3 9 2 2. + <_> + + <_> + 7 6 3 4 -1. + <_> + 8 6 1 4 3. + <_> + + <_> + 5 9 8 2 -1. + <_> + 9 9 4 2 2. + <_> + + <_> + 11 12 1 4 -1. + <_> + 11 14 1 2 2. + <_> + + <_> + 13 11 1 3 -1. + <_> + 13 12 1 1 3. + <_> + + <_> + 10 19 4 1 -1. + <_> + 12 19 2 1 2. + <_> + + <_> + 5 4 10 12 -1. + <_> + 5 4 5 6 2. + <_> + 10 10 5 6 2. + <_> + + <_> + 4 6 5 6 -1. + <_> + 4 9 5 3 2. + <_> + + <_> + 5 10 4 8 -1. + <_> + 5 14 4 4 2. + <_> + + <_> + 7 5 3 3 -1. + <_> + 7 6 3 1 3. + <_> + + <_> + 7 4 2 2 -1. + <_> + 8 4 1 2 2. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 0 3 6 16 -1. + <_> + 2 3 2 16 3. + <_> + + <_> + 2 6 3 12 -1. + <_> + 3 6 1 12 3. + <_> + + <_> + 12 11 2 2 -1. + <_> + 12 12 2 1 2. + <_> + + <_> + 18 0 2 13 -1. + <_> + 19 0 1 13 2. + <_> + + <_> + 9 14 5 4 -1. + <_> + 9 16 5 2 2. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 10 14 4 3 -1. + <_> + 10 15 4 1 3. + <_> + + <_> + 12 13 1 3 -1. + <_> + 12 14 1 1 3. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 6 6 6 14 -1. + <_> + 9 6 3 14 2. + <_> + + <_> + 5 11 6 3 -1. + <_> + 8 11 3 3 2. + <_> + + <_> + 5 7 2 4 -1. + <_> + 6 7 1 4 2. + <_> + + <_> + 7 3 11 9 -1. + <_> + 7 6 11 3 3. + <_> + + <_> + 10 4 9 6 -1. + <_> + 10 6 9 2 3. + <_> + + <_> + 8 5 2 3 -1. + <_> + 8 6 2 1 3. + <_> + + <_> + 0 0 3 1 -1. + <_> + 1 0 1 1 3. + <_> + + <_> + 9 4 4 6 -1. + <_> + 9 4 2 3 2. + <_> + 11 7 2 3 2. + <_> + + <_> + 5 9 3 1 -1. + <_> + 6 9 1 1 3. + <_> + + <_> + 6 4 3 2 -1. + <_> + 7 4 1 2 3. + <_> + + <_> + 7 14 1 3 -1. + <_> + 7 15 1 1 3. + <_> + + <_> + 1 3 1 2 -1. + <_> + 1 4 1 1 2. + <_> + + <_> + 7 16 2 3 -1. + <_> + 7 17 2 1 3. + <_> + + <_> + 19 6 1 2 -1. + <_> + 19 7 1 1 2. + <_> + + <_> + 6 15 2 3 -1. + <_> + 6 16 2 1 3. + <_> + + <_> + 11 13 1 3 -1. + <_> + 11 14 1 1 3. + <_> + + <_> + 17 10 3 1 -1. + <_> + 18 10 1 1 3. + <_> + + <_> + 10 0 6 1 -1. + <_> + 13 0 3 1 2. + <_> + + <_> + 14 0 6 4 -1. + <_> + 14 0 3 2 2. + <_> + 17 2 3 2 2. + <_> + + <_> + 12 7 4 6 -1. + <_> + 12 10 4 3 2. + <_> + + <_> + 14 5 1 2 -1. + <_> + 14 6 1 1 2. + <_> + + <_> + 6 13 4 3 -1. + <_> + 6 14 4 1 3. + <_> + + <_> + 5 12 4 3 -1. + <_> + 5 13 4 1 3. + <_> + + <_> + 9 3 2 1 -1. + <_> + 10 3 1 1 2. + <_> + + <_> + 9 3 3 3 -1. + <_> + 10 3 1 3 3. + <_> + + <_> + 9 5 3 1 -1. + <_> + 10 5 1 1 3. + <_> + + <_> + 7 8 4 3 -1. + <_> + 7 9 4 1 3. + <_> + + <_> + 1 4 1 6 -1. + <_> + 1 6 1 2 3. + <_> + + <_> + 3 2 3 11 -1. + <_> + 4 2 1 11 3. + <_> + + <_> + 3 2 3 18 -1. + <_> + 4 2 1 18 3. + <_> + + <_> + 5 12 6 2 -1. + <_> + 8 12 3 2 2. + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + <_> + + <_> + 7 17 3 1 -1. + <_> + 8 17 1 1 3. + <_> + + <_> + 3 10 8 6 -1. + <_> + 3 13 8 3 2. + <_> + + <_> + 3 2 3 17 -1. + <_> + 4 2 1 17 3. + <_> + + <_> + 4 9 8 1 -1. + <_> + 8 9 4 1 2. + <_> + + <_> + 2 7 3 6 -1. + <_> + 3 7 1 6 3. + <_> + + <_> + 18 4 1 2 -1. + <_> + 18 5 1 1 2. + <_> + + <_> + 7 8 2 6 -1. + <_> + 7 10 2 2 3. + <_> + + <_> + 11 12 2 3 -1. + <_> + 11 13 2 1 3. + <_> + + <_> + 16 11 3 1 -1. + <_> + 17 11 1 1 3. + <_> + + <_> + 16 11 3 2 -1. + <_> + 17 11 1 2 3. + <_> + + <_> + 15 3 1 4 -1. + <_> + 15 5 1 2 2. + <_> + + <_> + 11 0 9 11 -1. + <_> + 14 0 3 11 3. + <_> + + <_> + 7 0 5 6 -1. + <_> + 7 3 5 3 2. + <_> + + <_> + 8 7 2 6 -1. + <_> + 8 10 2 3 2. + <_> + + <_> + 11 11 4 6 -1. + <_> + 11 14 4 3 2. + <_> + + <_> + 4 7 3 2 -1. + <_> + 5 7 1 2 3. + <_> + + <_> + 3 7 3 2 -1. + <_> + 4 7 1 2 3. + <_> + + <_> + 11 11 2 3 -1. + <_> + 11 12 2 1 3. + <_> + + <_> + 5 9 4 6 -1. + <_> + 5 12 4 3 2. + <_> + + <_> + 16 4 2 3 -1. + <_> + 17 4 1 3 2. + <_> + + <_> + 12 12 2 1 -1. + <_> + 13 12 1 1 2. + <_> + + <_> + 8 5 6 4 -1. + <_> + 8 5 3 2 2. + <_> + 11 7 3 2 2. + <_> + + <_> + 10 15 3 3 -1. + <_> + 11 15 1 3 3. + <_> + + <_> + 3 7 3 7 -1. + <_> + 4 7 1 7 3. + <_> + + <_> + 11 4 1 2 -1. + <_> + 11 5 1 1 2. + <_> + + <_> + 3 9 3 5 -1. + <_> + 4 9 1 5 3. + <_> + + <_> + 10 15 3 3 -1. + <_> + 11 15 1 3 3. + <_> + + <_> + 3 3 6 12 -1. + <_> + 3 9 6 6 2. + <_> + + <_> + 3 5 5 6 -1. + <_> + 3 7 5 2 3. + <_> + + <_> + 6 6 4 11 -1. + <_> + 8 6 2 11 2. + <_> + + <_> + 6 5 2 6 -1. + <_> + 7 5 1 6 2. + <_> + + <_> + 2 6 3 8 -1. + <_> + 3 6 1 8 3. + <_> + + <_> + 6 4 3 1 -1. + <_> + 7 4 1 1 3. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 13 14 2 3 -1. + <_> + 13 15 2 1 3. + <_> + + <_> + 10 11 2 3 -1. + <_> + 10 12 2 1 3. + <_> + + <_> + 19 5 1 3 -1. + <_> + 19 6 1 1 3. + <_> + + <_> + 5 14 5 3 -1. + <_> + 5 15 5 1 3. + <_> + + <_> + 4 10 10 4 -1. + <_> + 9 10 5 4 2. + <_> + + <_> + 12 12 2 3 -1. + <_> + 12 13 2 1 3. + <_> + + <_> + 5 13 4 3 -1. + <_> + 5 14 4 1 3. + <_> + + <_> + 6 12 3 3 -1. + <_> + 6 13 3 1 3. + <_> + + <_> + 6 15 3 2 -1. + <_> + 7 15 1 2 3. + <_> + + <_> + 4 11 8 2 -1. + <_> + 8 11 4 2 2. + <_> + + <_> + 14 3 6 8 -1. + <_> + 14 7 6 4 2. + <_> + + <_> + 8 5 12 5 -1. + <_> + 12 5 4 5 3. + <_> + + <_> + 5 14 6 2 -1. + <_> + 7 14 2 2 3. + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + <_> + + <_> + 13 12 1 3 -1. + <_> + 13 13 1 1 3. + <_> + + <_> + 6 3 14 12 -1. + <_> + 6 3 7 6 2. + <_> + 13 9 7 6 2. + <_> + + <_> + 18 6 2 2 -1. + <_> + 18 7 2 1 2. + <_> + + <_> + 14 7 6 10 -1. + <_> + 16 7 2 10 3. + <_> + + <_> + 9 8 2 3 -1. + <_> + 9 9 2 1 3. + <_> + + <_> + 0 6 2 4 -1. + <_> + 0 8 2 2 2. + <_> + + <_> + 9 0 6 2 -1. + <_> + 11 0 2 2 3. + <_> + + <_> + 12 0 8 2 -1. + <_> + 12 0 4 1 2. + <_> + 16 1 4 1 2. + <_> + + <_> + 3 10 14 6 -1. + <_> + 3 12 14 2 3. + <_> + + <_> + 6 7 3 4 -1. + <_> + 7 7 1 4 3. + <_> + + <_> + 10 13 2 1 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 11 6 5 10 -1. + <_> + 11 11 5 5 2. + <_> + + <_> + 3 16 4 4 -1. + <_> + 3 16 2 2 2. + <_> + 5 18 2 2 2. + <_> + + <_> + 6 2 3 3 -1. + <_> + 7 2 1 3 3. + <_> + + <_> + 4 0 8 20 -1. + <_> + 4 0 4 10 2. + <_> + 8 10 4 10 2. + <_> + + <_> + 3 16 3 4 -1. + <_> + 4 16 1 4 3. + <_> + + <_> + 3 16 3 1 -1. + <_> + 4 16 1 1 3. + <_> + + <_> + 11 13 1 2 -1. + <_> + 11 14 1 1 2. + <_> + + <_> + 11 13 1 3 -1. + <_> + 11 14 1 1 3. + <_> + + <_> + 6 19 14 1 -1. + <_> + 13 19 7 1 2. + <_> + + <_> + 5 7 3 3 -1. + <_> + 6 7 1 3 3. + <_> + + <_> + 7 4 3 2 -1. + <_> + 8 4 1 2 3. + <_> + + <_> + 9 18 2 1 -1. + <_> + 10 18 1 1 2. + <_> + + <_> + 6 17 2 3 -1. + <_> + 6 18 2 1 3. + <_> + + <_> + 9 7 3 6 -1. + <_> + 9 9 3 2 3. + <_> + + <_> + 9 12 3 7 -1. + <_> + 10 12 1 7 3. + <_> + + <_> + 8 9 1 3 -1. + <_> + 8 10 1 1 3. + <_> + + <_> + 8 5 12 11 -1. + <_> + 12 5 4 11 3. + <_> + + <_> + 2 0 1 2 -1. + <_> + 2 1 1 1 2. + <_> + + <_> + 0 0 1 2 -1. + <_> + 0 1 1 1 2. + <_> + + <_> + 8 0 12 16 -1. + <_> + 12 0 4 16 3. + <_> + + <_> + 0 0 1 2 -1. + <_> + 0 1 1 1 2. + <_> + + <_> + 11 0 9 11 -1. + <_> + 14 0 3 11 3. + <_> + + <_> + 5 5 3 6 -1. + <_> + 6 5 1 6 3. + <_> + + <_> + 8 8 3 4 -1. + <_> + 8 10 3 2 2. + <_> + + <_> + 13 2 6 12 -1. + <_> + 13 8 6 6 2. + <_> + + <_> + 10 6 4 14 -1. + <_> + 10 13 4 7 2. + <_> + + <_> + 1 1 10 1 -1. + <_> + 6 1 5 1 2. + <_> + + <_> + 4 2 13 6 -1. + <_> + 4 4 13 2 3. + <_> + + <_> + 11 13 2 3 -1. + <_> + 12 13 1 3 2. + <_> + + <_> + 6 9 4 9 -1. + <_> + 6 12 4 3 3. + <_> + + <_> + 6 6 3 10 -1. + <_> + 6 11 3 5 2. + <_> + + <_> + 2 10 3 4 -1. + <_> + 3 10 1 4 3. + <_> + + <_> + 3 8 3 6 -1. + <_> + 4 8 1 6 3. + <_> + + <_> + 11 12 3 6 -1. + <_> + 12 12 1 6 3. + <_> + + <_> + 8 6 2 3 -1. + <_> + 8 7 2 1 3. + <_> + + <_> + 5 8 6 6 -1. + <_> + 5 8 3 3 2. + <_> + 8 11 3 3 2. + <_> + + <_> + 3 7 3 1 -1. + <_> + 4 7 1 1 3. + <_> + + <_> + 10 12 3 3 -1. + <_> + 10 13 3 1 3. + <_> + + <_> + 5 11 2 3 -1. + <_> + 5 12 2 1 3. + <_> + + <_> + 10 12 4 3 -1. + <_> + 10 13 4 1 3. + <_> + + <_> + 5 11 3 3 -1. + <_> + 5 12 3 1 3. + <_> + + <_> + 9 2 3 1 -1. + <_> + 10 2 1 1 3. + <_> + + <_> + 2 0 18 14 -1. + <_> + 2 7 18 7 2. + <_> + + <_> + 9 2 3 2 -1. + <_> + 10 2 1 2 3. + <_> + + <_> + 8 6 4 3 -1. + <_> + 8 7 4 1 3. + <_> + + <_> + 4 8 5 2 -1. + <_> + 4 9 5 1 2. + <_> + + <_> + 0 3 1 6 -1. + <_> + 0 5 1 2 3. + <_> + + <_> + 13 9 1 6 -1. + <_> + 13 12 1 3 2. + <_> + + <_> + 6 16 3 3 -1. + <_> + 6 17 3 1 3. + <_> + + <_> + 3 16 7 3 -1. + <_> + 3 17 7 1 3. + <_> + + <_> + 10 15 5 3 -1. + <_> + 10 16 5 1 3. + <_> + + <_> + 4 0 5 20 -1. + <_> + 4 10 5 10 2. + <_> + + <_> + 6 2 2 2 -1. + <_> + 7 2 1 2 2. + <_> + + <_> + 18 0 2 15 -1. + <_> + 18 5 2 5 3. + <_> + + <_> + 6 15 7 3 -1. + <_> + 6 16 7 1 3. + <_> + + <_> + 10 13 6 2 -1. + <_> + 10 14 6 1 2. + <_> + + <_> + 13 8 1 9 -1. + <_> + 13 11 1 3 3. + <_> + + <_> + 3 0 4 4 -1. + <_> + 3 0 2 2 2. + <_> + 5 2 2 2 2. + <_> + + <_> + 0 3 1 6 -1. + <_> + 0 5 1 2 3. + <_> + + <_> + 5 8 3 1 -1. + <_> + 6 8 1 1 3. + <_> + + <_> + 5 6 2 3 -1. + <_> + 6 6 1 3 2. + <_> + + <_> + 6 11 6 7 -1. + <_> + 8 11 2 7 3. + <_> + + <_> + 8 7 4 3 -1. + <_> + 8 8 4 1 3. + <_> + + <_> + 3 8 8 1 -1. + <_> + 7 8 4 1 2. + <_> + + <_> + 5 12 3 3 -1. + <_> + 5 13 3 1 3. + <_> + + <_> + 9 7 2 8 -1. + <_> + 9 7 1 4 2. + <_> + 10 11 1 4 2. + <_> + + <_> + 14 2 3 5 -1. + <_> + 15 2 1 5 3. + <_> + + <_> + 6 13 2 3 -1. + <_> + 6 14 2 1 3. + <_> + + <_> + 6 14 1 2 -1. + <_> + 6 15 1 1 2. + <_> + + <_> + 12 10 2 3 -1. + <_> + 12 11 2 1 3. + <_> + + <_> + 1 14 12 3 -1. + <_> + 5 14 4 3 3. + <_> + + <_> + 11 8 3 1 -1. + <_> + 12 8 1 1 3. + <_> + + <_> + 14 4 2 3 -1. + <_> + 14 5 2 1 3. + <_> + + <_> + 7 8 3 2 -1. + <_> + 8 8 1 2 3. + <_> + + <_> + 2 7 3 11 -1. + <_> + 3 7 1 11 3. + <_> + + <_> + 0 14 2 1 -1. + <_> + 1 14 1 1 2. + <_> + + <_> + 6 15 3 2 -1. + <_> + 7 15 1 2 3. + <_> + + <_> + 18 10 2 4 -1. + <_> + 18 10 1 2 2. + <_> + 19 12 1 2 2. + <_> + + <_> + 13 12 2 2 -1. + <_> + 14 12 1 2 2. + <_> + + <_> + 9 5 8 12 -1. + <_> + 13 5 4 12 2. + <_> + + <_> + 11 5 3 3 -1. + <_> + 12 5 1 3 3. + <_> + + <_> + 16 11 2 2 -1. + <_> + 16 11 1 1 2. + <_> + 17 12 1 1 2. + <_> + + <_> + 14 5 1 2 -1. + <_> + 14 6 1 1 2. + <_> + + <_> + 3 0 8 16 -1. + <_> + 3 8 8 8 2. + <_> + + <_> + 3 11 3 5 -1. + <_> + 4 11 1 5 3. + <_> + + <_> + 0 8 12 6 -1. + <_> + 4 8 4 6 3. + <_> + + <_> + 6 9 4 2 -1. + <_> + 6 9 2 1 2. + <_> + 8 10 2 1 2. + <_> + + <_> + 11 15 3 5 -1. + <_> + 12 15 1 5 3. + <_> + + <_> + 18 10 2 6 -1. + <_> + 18 10 1 3 2. + <_> + 19 13 1 3 2. + <_> + + <_> + 13 15 6 1 -1. + <_> + 16 15 3 1 2. + <_> + + <_> + 5 10 7 6 -1. + <_> + 5 13 7 3 2. + <_> + + <_> + 2 11 6 6 -1. + <_> + 2 14 6 3 2. + <_> + + <_> + 11 14 3 3 -1. + <_> + 11 15 3 1 3. + <_> + + <_> + 7 14 6 3 -1. + <_> + 7 15 6 1 3. + <_> + + <_> + 5 14 5 3 -1. + <_> + 5 15 5 1 3. + <_> + + <_> + 6 16 3 1 -1. + <_> + 7 16 1 1 3. + <_> + + <_> + 4 15 4 3 -1. + <_> + 4 16 4 1 3. + <_> + + <_> + 2 2 4 8 -1. + <_> + 2 2 2 4 2. + <_> + 4 6 2 4 2. + <_> + + <_> + 12 13 2 3 -1. + <_> + 12 14 2 1 3. + <_> + + <_> + 9 13 4 3 -1. + <_> + 9 14 4 1 3. + <_> + + <_> + 8 8 5 3 -1. + <_> + 8 9 5 1 3. + <_> + + <_> + 9 12 3 2 -1. + <_> + 10 12 1 2 3. + <_> + + <_> + 4 0 8 2 -1. + <_> + 4 0 4 1 2. + <_> + 8 1 4 1 2. + <_> + + <_> + 0 12 1 2 -1. + <_> + 0 13 1 1 2. + <_> + + <_> + 8 14 8 4 -1. + <_> + 8 16 8 2 2. + <_> + + <_> + 4 17 9 3 -1. + <_> + 4 18 9 1 3. + <_> + + <_> + 10 0 2 8 -1. + <_> + 10 4 2 4 2. + <_> + + <_> + 10 13 2 6 -1. + <_> + 10 16 2 3 2. + <_> + + <_> + 7 2 10 5 -1. + <_> + 12 2 5 5 2. + <_> + + <_> + 9 7 4 6 -1. + <_> + 9 7 2 3 2. + <_> + 11 10 2 3 2. + <_> + + <_> + 12 10 1 6 -1. + <_> + 12 13 1 3 2. + <_> + + <_> + 1 2 6 8 -1. + <_> + 4 2 3 8 2. + <_> + + <_> + 10 12 1 3 -1. + <_> + 10 13 1 1 3. + <_> + + <_> + 5 7 3 2 -1. + <_> + 6 7 1 2 3. + <_> + + <_> + 10 13 1 3 -1. + <_> + 10 14 1 1 3. + <_> + + <_> + 4 3 16 9 -1. + <_> + 4 6 16 3 3. + <_> + + <_> + 5 12 4 3 -1. + <_> + 7 12 2 3 2. + <_> + + <_> + 10 14 1 3 -1. + <_> + 10 15 1 1 3. + <_> + + <_> + 10 6 3 8 -1. + <_> + 11 6 1 8 3. + <_> + + <_> + 1 8 3 5 -1. + <_> + 2 8 1 5 3. + <_> + + <_> + 6 7 3 2 -1. + <_> + 7 7 1 2 3. + <_> + + <_> + 9 10 3 3 -1. + <_> + 10 10 1 3 3. + <_> + + <_> + 11 4 4 3 -1. + <_> + 11 5 4 1 3. + <_> + + <_> + 16 11 3 1 -1. + <_> + 17 11 1 1 3. + <_> + + <_> + 8 0 6 3 -1. + <_> + 10 0 2 3 3. + <_> + + <_> + 17 11 2 2 -1. + <_> + 17 11 1 1 2. + <_> + 18 12 1 1 2. + <_> + + <_> + 11 3 7 3 -1. + <_> + 11 4 7 1 3. + <_> + + <_> + 6 11 1 3 -1. + <_> + 6 12 1 1 3. + <_> + + <_> + 7 4 3 2 -1. + <_> + 8 4 1 2 3. + <_> + + <_> + 7 3 3 3 -1. + <_> + 8 3 1 3 3. + <_> + + <_> + 6 12 2 3 -1. + <_> + 6 13 2 1 3. + <_> + + <_> + 6 12 2 3 -1. + <_> + 6 13 2 1 3. + <_> + + <_> + 10 12 2 3 -1. + <_> + 10 13 2 1 3. + <_> + + <_> + 5 0 12 2 -1. + <_> + 5 1 12 1 2. + <_> + + <_> + 4 11 8 4 -1. + <_> + 4 13 8 2 2. + <_> + + <_> + 6 12 8 4 -1. + <_> + 6 14 8 2 2. + <_> + + <_> + 4 0 4 2 -1. + <_> + 4 0 2 1 2. + <_> + 6 1 2 1 2. + <_> + + <_> + 13 9 4 2 -1. + <_> + 13 10 4 1 2. + <_> + + <_> + 12 10 2 2 -1. + <_> + 13 10 1 2 2. + <_> + + <_> + 9 9 6 1 -1. + <_> + 12 9 3 1 2. + <_> + + <_> + 6 6 14 6 -1. + <_> + 6 9 14 3 2. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 11 11 1 3 -1. + <_> + 11 12 1 1 3. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 12 11 6 2 -1. + <_> + 14 11 2 2 3. + <_> + + <_> + 11 11 2 1 -1. + <_> + 12 11 1 1 2. + <_> + + <_> + 3 11 14 1 -1. + <_> + 10 11 7 1 2. + <_> + + <_> + 1 13 6 5 -1. + <_> + 3 13 2 5 3. + <_> + + <_> + 14 0 2 1 -1. + <_> + 15 0 1 1 2. + <_> + + <_> + 10 0 10 1 -1. + <_> + 15 0 5 1 2. + <_> + + <_> + 5 15 3 3 -1. + <_> + 5 16 3 1 3. + <_> + + <_> + 12 14 2 2 -1. + <_> + 12 15 2 1 2. + <_> + + <_> + 12 14 2 3 -1. + <_> + 12 15 2 1 3. + <_> + + <_> + 8 6 1 3 -1. + <_> + 8 7 1 1 3. + <_> + + <_> + 0 2 1 3 -1. + <_> + 0 3 1 1 3. + <_> + + <_> + 0 2 1 3 -1. + <_> + 0 3 1 1 3. + <_> + + <_> + 4 8 2 2 -1. + <_> + 4 8 1 1 2. + <_> + 5 9 1 1 2. + <_> + + <_> + 3 6 8 10 -1. + <_> + 3 6 4 5 2. + <_> + 7 11 4 5 2. + <_> + + <_> + 6 15 1 3 -1. + <_> + 6 16 1 1 3. + <_> + + <_> + 12 0 3 8 -1. + <_> + 13 0 1 8 3. + <_> + + <_> + 10 0 10 6 -1. + <_> + 10 0 5 3 2. + <_> + 15 3 5 3 2. + <_> + + <_> + 17 2 2 2 -1. + <_> + 17 3 2 1 2. + <_> + + <_> + 8 0 12 14 -1. + <_> + 14 0 6 14 2. + <_> + + <_> + 10 18 2 1 -1. + <_> + 11 18 1 1 2. + <_> + + <_> + 18 9 2 6 -1. + <_> + 18 9 1 3 2. + <_> + 19 12 1 3 2. + <_> + + <_> + 18 4 2 16 -1. + <_> + 18 4 1 8 2. + <_> + 19 12 1 8 2. + <_> + + <_> + 5 8 6 6 -1. + <_> + 8 8 3 6 2. + <_> + + <_> + 6 5 4 11 -1. + <_> + 8 5 2 11 2. + <_> + + <_> + 6 8 2 2 -1. + <_> + 7 8 1 2 2. + <_> + + <_> + 6 5 2 5 -1. + <_> + 7 5 1 5 2. + <_> + + <_> + 10 16 3 4 -1. + <_> + 11 16 1 4 3. + <_> + + <_> + 3 0 8 18 -1. + <_> + 3 9 8 9 2. + <_> + + <_> + 1 7 7 3 -1. + <_> + 1 8 7 1 3. + <_> + + <_> + 5 5 2 6 -1. + <_> + 5 7 2 2 3. + <_> + + <_> + 3 8 3 10 -1. + <_> + 4 8 1 10 3. + <_> + + <_> + 3 12 3 2 -1. + <_> + 4 12 1 2 3. + <_> + + <_> + 3 9 10 3 -1. + <_> + 8 9 5 3 2. + <_> + + <_> + 6 15 6 2 -1. + <_> + 8 15 2 2 3. + <_> + + <_> + 5 9 3 2 -1. + <_> + 6 9 1 2 3. + <_> + + <_> + 17 5 3 3 -1. + <_> + 17 6 3 1 3. + <_> + + <_> + 8 6 1 3 -1. + <_> + 8 7 1 1 3. + <_> + + <_> + 18 5 1 3 -1. + <_> + 18 6 1 1 3. + <_> + + <_> + 5 2 5 6 -1. + <_> + 5 5 5 3 2. + <_> + + <_> + 11 1 6 3 -1. + <_> + 13 1 2 3 3. + <_> + + <_> + 6 7 2 10 -1. + <_> + 6 12 2 5 2. + <_> + + <_> + 3 14 4 4 -1. + <_> + 5 14 2 4 2. + <_> + + <_> + 2 11 4 1 -1. + <_> + 4 11 2 1 2. + <_> + + <_> + 6 4 3 2 -1. + <_> + 7 4 1 2 3. + <_> + + <_> + 8 3 2 6 -1. + <_> + 8 5 2 2 3. + <_> + + <_> + 0 10 20 10 -1. + <_> + 10 10 10 10 2. + <_> + + <_> + 13 7 2 2 -1. + <_> + 13 8 2 1 2. + <_> + + <_> + 10 8 10 4 -1. + <_> + 15 8 5 4 2. + <_> + + <_> + 0 10 16 2 -1. + <_> + 8 10 8 2 2. + <_> + + <_> + 10 14 6 6 -1. + <_> + 10 14 3 3 2. + <_> + 13 17 3 3 2. + <_> + + <_> + 13 10 1 3 -1. + <_> + 13 11 1 1 3. + <_> + + <_> + 4 4 10 8 -1. + <_> + 4 4 5 4 2. + <_> + 9 8 5 4 2. + <_> + + <_> + 5 1 6 6 -1. + <_> + 5 1 3 3 2. + <_> + 8 4 3 3 2. + <_> + + <_> + 11 10 8 3 -1. + <_> + 11 11 8 1 3. + <_> + + <_> + 3 11 3 6 -1. + <_> + 3 13 3 2 3. + <_> + + <_> + 8 0 12 6 -1. + <_> + 8 0 6 3 2. + <_> + 14 3 6 3 2. + <_> + + <_> + 7 8 2 4 -1. + <_> + 7 8 1 2 2. + <_> + 8 10 1 2 2. + <_> + + <_> + 11 1 7 10 -1. + <_> + 11 6 7 5 2. + <_> + + <_> + 10 15 3 2 -1. + <_> + 10 16 3 1 2. + <_> + + <_> + 11 11 2 3 -1. + <_> + 12 11 1 3 2. + <_> + + <_> + 6 8 3 2 -1. + <_> + 6 9 3 1 2. + <_> + + <_> + 11 14 1 3 -1. + <_> + 11 15 1 1 3. + <_> + + <_> + 5 11 2 3 -1. + <_> + 5 12 2 1 3. + <_> + + <_> + 12 12 2 2 -1. + <_> + 12 13 2 1 2. + <_> + + <_> + 11 3 8 9 -1. + <_> + 11 6 8 3 3. + <_> + + <_> + 10 11 3 3 -1. + <_> + 11 11 1 3 3. + <_> + + <_> + 6 11 1 3 -1. + <_> + 6 12 1 1 3. + <_> + + <_> + 9 6 2 3 -1. + <_> + 10 6 1 3 2. + <_> + + <_> + 7 8 2 6 -1. + <_> + 7 10 2 2 3. + <_> + + <_> + 3 0 4 6 -1. + <_> + 3 0 2 3 2. + <_> + 5 3 2 3 2. + <_> + + <_> + 5 0 3 17 -1. + <_> + 6 0 1 17 3. + <_> + + <_> + 12 9 6 3 -1. + <_> + 12 10 6 1 3. + <_> + + <_> + 10 19 8 1 -1. + <_> + 14 19 4 1 2. + <_> + + <_> + 13 3 5 3 -1. + <_> + 13 4 5 1 3. + <_> + + <_> + 5 7 2 2 -1. + <_> + 6 7 1 2 2. + <_> + + <_> + 12 10 3 10 -1. + <_> + 13 10 1 10 3. + <_> + + <_> + 4 7 6 3 -1. + <_> + 7 7 3 3 2. + <_> + + <_> + 6 10 1 3 -1. + <_> + 6 11 1 1 3. + <_> + + <_> + 6 9 2 3 -1. + <_> + 6 10 2 1 3. + <_> + + <_> + 11 3 6 3 -1. + <_> + 11 4 6 1 3. + <_> + + <_> + 13 14 2 3 -1. + <_> + 13 15 2 1 3. + <_> + + <_> + 6 16 8 4 -1. + <_> + 6 16 4 2 2. + <_> + 10 18 4 2 2. + <_> + + <_> + 10 5 3 15 -1. + <_> + 11 5 1 15 3. + <_> + + <_> + 10 0 10 6 -1. + <_> + 10 0 5 3 2. + <_> + 15 3 5 3 2. + <_> + + <_> + 11 2 3 16 -1. + <_> + 12 2 1 16 3. + <_> + + <_> + 7 12 2 2 -1. + <_> + 7 12 1 1 2. + <_> + 8 13 1 1 2. + <_> + + <_> + 6 4 2 1 -1. + <_> + 7 4 1 1 2. + <_> + + <_> + 6 3 3 4 -1. + <_> + 7 3 1 4 3. + <_> + + <_> + 0 13 16 6 -1. + <_> + 0 15 16 2 3. + <_> + + <_> + 7 14 2 3 -1. + <_> + 7 15 2 1 3. + <_> + + <_> + 15 17 2 2 -1. + <_> + 15 18 2 1 2. + <_> + + <_> + 17 12 2 2 -1. + <_> + 17 12 1 1 2. + <_> + 18 13 1 1 2. + <_> + + <_> + 11 1 3 19 -1. + <_> + 12 1 1 19 3. + <_> + + <_> + 1 11 19 4 -1. + <_> + 1 13 19 2 2. + <_> + + <_> + 17 8 2 10 -1. + <_> + 17 8 1 5 2. + <_> + 18 13 1 5 2. + <_> + + <_> + 9 0 11 20 -1. + <_> + 9 10 11 10 2. + <_> + + <_> + 4 1 12 12 -1. + <_> + 4 1 6 6 2. + <_> + 10 7 6 6 2. + <_> + + <_> + 5 11 3 6 -1. + <_> + 6 11 1 6 3. + <_> + + <_> + 4 8 3 1 -1. + <_> + 5 8 1 1 3. + <_> + + <_> + 18 1 2 4 -1. + <_> + 19 1 1 4 2. + <_> + + <_> + 11 0 8 15 -1. + <_> + 15 0 4 15 2. + <_> + + <_> + 5 5 6 2 -1. + <_> + 7 5 2 2 3. + <_> + + <_> + 17 11 2 2 -1. + <_> + 17 11 1 1 2. + <_> + 18 12 1 1 2. + <_> + + <_> + 6 8 2 8 -1. + <_> + 6 12 2 4 2. + <_> + + <_> + 9 9 2 4 -1. + <_> + 9 11 2 2 2. + <_> + + <_> + 0 8 2 2 -1. + <_> + 0 9 2 1 2. + <_> + + <_> + 7 12 8 4 -1. + <_> + 7 14 8 2 2. + <_> + + <_> + 11 13 3 2 -1. + <_> + 11 14 3 1 2. + <_> + + <_> + 5 8 2 2 -1. + <_> + 5 8 1 1 2. + <_> + 6 9 1 1 2. + <_> + + <_> + 12 11 2 3 -1. + <_> + 12 12 2 1 3. + <_> + + <_> + 10 8 2 2 -1. + <_> + 10 8 1 1 2. + <_> + 11 9 1 1 2. + <_> + + <_> + 6 16 3 2 -1. + <_> + 7 16 1 2 3. + <_> + + <_> + 13 12 2 1 -1. + <_> + 14 12 1 1 2. + <_> + + <_> + 16 9 2 6 -1. + <_> + 16 9 1 3 2. + <_> + 17 12 1 3 2. + <_> + + <_> + 17 2 2 6 -1. + <_> + 17 4 2 2 3. + <_> + + <_> + 13 2 7 6 -1. + <_> + 13 4 7 2 3. + <_> + + <_> + 16 10 4 4 -1. + <_> + 16 10 2 2 2. + <_> + 18 12 2 2 2. + <_> + + <_> + 11 10 2 2 -1. + <_> + 11 11 2 1 2. + <_> + + <_> + 6 13 3 3 -1. + <_> + 6 14 3 1 3. + <_> + + <_> + 4 14 4 2 -1. + <_> + 4 15 4 1 2. + <_> + + <_> + 0 9 2 1 -1. + <_> + 1 9 1 1 2. + <_> + + <_> + 7 6 4 8 -1. + <_> + 7 10 4 4 2. + <_> + + <_> + 9 17 7 3 -1. + <_> + 9 18 7 1 3. + <_> + + <_> + 7 12 2 3 -1. + <_> + 7 13 2 1 3. + <_> + + <_> + 12 17 4 3 -1. + <_> + 12 18 4 1 3. + <_> + + <_> + 11 7 9 11 -1. + <_> + 14 7 3 11 3. + <_> + + <_> + 16 14 4 5 -1. + <_> + 18 14 2 5 2. + <_> + + <_> + 9 2 3 4 -1. + <_> + 10 2 1 4 3. + <_> + + <_> + 3 11 2 8 -1. + <_> + 3 11 1 4 2. + <_> + 4 15 1 4 2. + <_> + + <_> + 13 2 6 18 -1. + <_> + 13 2 3 9 2. + <_> + 16 11 3 9 2. + <_> + + <_> + 9 12 5 2 -1. + <_> + 9 13 5 1 2. + <_> + + <_> + 11 8 4 10 -1. + <_> + 11 8 2 5 2. + <_> + 13 13 2 5 2. + <_> + + <_> + 0 11 20 1 -1. + <_> + 10 11 10 1 2. + <_> + + <_> + 1 12 1 2 -1. + <_> + 1 13 1 1 2. + <_> + + <_> + 6 7 6 3 -1. + <_> + 8 7 2 3 3. + <_> + + <_> + 8 5 10 3 -1. + <_> + 13 5 5 3 2. + <_> + + <_> + 5 5 4 6 -1. + <_> + 5 7 4 2 3. + <_> + + <_> + 5 11 6 3 -1. + <_> + 8 11 3 3 2. + <_> + + <_> + 2 8 3 7 -1. + <_> + 3 8 1 7 3. + <_> + + <_> + 2 10 3 6 -1. + <_> + 3 10 1 6 3. + <_> + + <_> + 14 0 2 2 -1. + <_> + 15 0 1 2 2. + <_> + + <_> + 8 7 4 4 -1. + <_> + 8 7 2 2 2. + <_> + 10 9 2 2 2. + <_> + + <_> + 4 13 4 3 -1. + <_> + 4 14 4 1 3. + <_> + + <_> + 8 11 6 2 -1. + <_> + 8 12 6 1 2. + <_> + + <_> + 17 3 1 4 -1. + <_> + 17 5 1 2 2. + <_> + + <_> + 6 13 2 3 -1. + <_> + 6 14 2 1 3. + <_> + + <_> + 7 9 6 8 -1. + <_> + 7 9 3 4 2. + <_> + 10 13 3 4 2. + <_> + + <_> + 5 15 2 3 -1. + <_> + 5 16 2 1 3. + <_> + + <_> + 7 10 4 9 -1. + <_> + 7 13 4 3 3. + <_> + + <_> + 5 4 2 1 -1. + <_> + 6 4 1 1 2. + <_> + + <_> + 0 1 6 19 -1. + <_> + 2 1 2 19 3. + <_> + + <_> + 5 8 6 2 -1. + <_> + 8 8 3 2 2. + <_> + + <_> + 5 11 3 3 -1. + <_> + 5 12 3 1 3. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 9 12 2 4 -1. + <_> + 9 12 1 2 2. + <_> + 10 14 1 2 2. + <_> + + <_> + 12 7 2 10 -1. + <_> + 12 12 2 5 2. + <_> + + <_> + 10 6 6 8 -1. + <_> + 10 10 6 4 2. + <_> + + <_> + 4 3 2 6 -1. + <_> + 5 3 1 6 2. + <_> + + <_> + 4 6 3 3 -1. + <_> + 5 6 1 3 3. + <_> + + <_> + 10 7 2 8 -1. + <_> + 10 7 1 4 2. + <_> + 11 11 1 4 2. + <_> + + <_> + 2 0 6 10 -1. + <_> + 2 5 6 5 2. + <_> + + <_> + 8 10 6 2 -1. + <_> + 8 11 6 1 2. + <_> + + <_> + 10 0 2 1 -1. + <_> + 11 0 1 1 2. + <_> + + <_> + 4 16 4 3 -1. + <_> + 4 17 4 1 3. + <_> + + <_> + 7 4 3 2 -1. + <_> + 8 4 1 2 3. + <_> + + <_> + 7 5 3 1 -1. + <_> + 8 5 1 1 3. + <_> + + <_> + 5 5 6 3 -1. + <_> + 5 6 6 1 3. + <_> + + <_> + 5 5 5 3 -1. + <_> + 5 6 5 1 3. + <_> + + <_> + 10 7 6 9 -1. + <_> + 10 10 6 3 3. + <_> + + <_> + 17 4 1 2 -1. + <_> + 17 5 1 1 2. + <_> + + <_> + 4 9 10 4 -1. + <_> + 4 9 5 2 2. + <_> + 9 11 5 2 2. + <_> + + <_> + 5 6 3 10 -1. + <_> + 5 11 3 5 2. + <_> + + <_> + 2 13 18 5 -1. + <_> + 11 13 9 5 2. + <_> + + <_> + 5 12 3 3 -1. + <_> + 5 13 3 1 3. + <_> + + <_> + 9 12 2 4 -1. + <_> + 9 14 2 2 2. + <_> + + <_> + 5 11 15 6 -1. + <_> + 5 13 15 2 3. + <_> + + <_> + 16 0 4 6 -1. + <_> + 16 0 2 3 2. + <_> + 18 3 2 3 2. + <_> + + <_> + 11 12 2 2 -1. + <_> + 11 12 1 1 2. + <_> + 12 13 1 1 2. + <_> + + <_> + 6 6 3 5 -1. + <_> + 7 6 1 5 3. + <_> + + <_> + 13 13 2 1 -1. + <_> + 14 13 1 1 2. + <_> + + <_> + 5 8 3 2 -1. + <_> + 6 8 1 2 3. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 16 12 3 1 -1. + <_> + 17 12 1 1 3. + <_> + + <_> + 8 5 12 8 -1. + <_> + 14 5 6 8 2. + <_> + + <_> + 5 13 4 4 -1. + <_> + 5 13 2 2 2. + <_> + 7 15 2 2 2. + <_> + + <_> + 5 7 2 3 -1. + <_> + 6 7 1 3 2. + <_> + + <_> + 9 2 2 10 -1. + <_> + 9 2 1 5 2. + <_> + 10 7 1 5 2. + <_> + + <_> + 9 14 1 2 -1. + <_> + 9 15 1 1 2. + <_> + + <_> + 15 7 2 4 -1. + <_> + 15 9 2 2 2. + <_> + + <_> + 7 5 4 3 -1. + <_> + 7 6 4 1 3. + <_> + + <_> + 3 10 8 2 -1. + <_> + 7 10 4 2 2. + <_> + + <_> + 13 8 2 2 -1. + <_> + 13 9 2 1 2. + <_> + + <_> + 9 6 2 3 -1. + <_> + 9 7 2 1 3. + <_> + + <_> + 13 10 5 2 -1. + <_> + 13 11 5 1 2. + <_> + + <_> + 16 11 2 2 -1. + <_> + 16 11 1 1 2. + <_> + 17 12 1 1 2. + <_> + + <_> + 0 10 2 4 -1. + <_> + 0 10 1 2 2. + <_> + 1 12 1 2 2. + <_> + + <_> + 0 8 2 8 -1. + <_> + 0 8 1 4 2. + <_> + 1 12 1 4 2. + <_> + + <_> + 6 14 5 3 -1. + <_> + 6 15 5 1 3. + <_> + + <_> + 18 8 2 4 -1. + <_> + 19 8 1 4 2. + <_> + + <_> + 14 2 3 1 -1. + <_> + 15 2 1 1 3. + <_> + + <_> + 9 13 3 3 -1. + <_> + 9 14 3 1 3. + <_> + + <_> + 5 13 6 3 -1. + <_> + 5 14 6 1 3. + <_> + + <_> + 12 12 1 3 -1. + <_> + 12 13 1 1 3. + <_> + + <_> + 2 14 14 6 -1. + <_> + 2 17 14 3 2. + <_> + + <_> + 7 5 2 4 -1. + <_> + 7 5 1 2 2. + <_> + 8 7 1 2 2. + <_> + + <_> + 5 17 2 2 -1. + <_> + 5 17 1 1 2. + <_> + 6 18 1 1 2. + <_> + + <_> + 9 3 3 5 -1. + <_> + 10 3 1 5 3. + <_> + + <_> + 6 17 4 3 -1. + <_> + 6 18 4 1 3. + <_> + + <_> + 10 0 6 4 -1. + <_> + 12 0 2 4 3. + <_> + + <_> + 4 8 6 10 -1. + <_> + 4 8 3 5 2. + <_> + 7 13 3 5 2. + <_> + + <_> + 4 3 2 6 -1. + <_> + 5 3 1 6 2. + <_> + + <_> + 3 4 6 6 -1. + <_> + 5 4 2 6 3. + <_> + + <_> + 5 8 2 8 -1. + <_> + 5 12 2 4 2. + <_> + + <_> + 5 11 2 2 -1. + <_> + 5 12 2 1 2. + <_> + + <_> + 12 13 1 3 -1. + <_> + 12 14 1 1 3. + <_> + + <_> + 5 1 4 15 -1. + <_> + 5 6 4 5 3. + <_> + + <_> + 6 11 1 3 -1. + <_> + 6 12 1 1 3. + <_> + + <_> + 6 11 3 3 -1. + <_> + 6 12 3 1 3. + <_> + + <_> + 11 0 3 3 -1. + <_> + 12 0 1 3 3. + <_> + + <_> + 2 2 15 3 -1. + <_> + 7 2 5 3 3. + <_> + + <_> + 4 0 16 5 -1. + <_> + 12 0 8 5 2. + <_> + + <_> + 13 7 6 8 -1. + <_> + 13 11 6 4 2. + <_> + + <_> + 9 9 3 4 -1. + <_> + 9 11 3 2 2. + <_> + + <_> + 5 2 6 16 -1. + <_> + 5 2 3 8 2. + <_> + 8 10 3 8 2. + <_> + + <_> + 10 7 6 3 -1. + <_> + 13 7 3 3 2. + <_> + + <_> + 12 11 2 1 -1. + <_> + 13 11 1 1 2. + <_> + + <_> + 0 0 1 8 -1. + <_> + 0 4 1 4 2. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 6 5 4 15 -1. + <_> + 8 5 2 15 2. + <_> + + <_> + 7 7 2 2 -1. + <_> + 8 7 1 2 2. + <_> + + <_> + 1 3 1 2 -1. + <_> + 1 4 1 1 2. + <_> + + <_> + 6 2 6 11 -1. + <_> + 9 2 3 11 2. + <_> + + <_> + 9 6 9 6 -1. + <_> + 9 8 9 2 3. + <_> + + <_> + 9 8 3 3 -1. + <_> + 9 9 3 1 3. + <_> + + <_> + 6 8 2 3 -1. + <_> + 6 9 2 1 3. + <_> + + <_> + 13 1 2 8 -1. + <_> + 13 5 2 4 2. + <_> + + <_> + 6 0 6 4 -1. + <_> + 6 2 6 2 2. + <_> + + <_> + 0 6 20 14 -1. + <_> + 10 6 10 14 2. + <_> + + <_> + 8 0 12 6 -1. + <_> + 8 0 6 3 2. + <_> + 14 3 6 3 2. + <_> + + <_> + 8 7 9 9 -1. + <_> + 8 10 9 3 3. + <_> + + <_> + 10 14 6 6 -1. + <_> + 10 14 3 3 2. + <_> + 13 17 3 3 2. + <_> + + <_> + 8 7 4 10 -1. + <_> + 8 7 2 5 2. + <_> + 10 12 2 5 2. + <_> + + <_> + 15 4 3 3 -1. + <_> + 15 5 3 1 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 16 0 2 6 3. + <_> + + <_> + 5 9 10 6 -1. + <_> + 5 9 5 3 2. + <_> + 10 12 5 3 2. + <_> + + <_> + 11 12 2 1 -1. + <_> + 12 12 1 1 2. + <_> + + <_> + 11 7 3 7 -1. + <_> + 12 7 1 7 3. + <_> + + <_> + 9 0 2 18 -1. + <_> + 9 0 1 9 2. + <_> + 10 9 1 9 2. + <_> + + <_> + 3 6 3 4 -1. + <_> + 4 6 1 4 3. + <_> + + <_> + 14 10 2 2 -1. + <_> + 14 10 1 1 2. + <_> + 15 11 1 1 2. + <_> + + <_> + 4 7 3 2 -1. + <_> + 5 7 1 2 3. + <_> + + <_> + 10 14 4 3 -1. + <_> + 10 15 4 1 3. + <_> + + <_> + 12 12 2 3 -1. + <_> + 12 13 2 1 3. + <_> + + <_> + 3 0 2 8 -1. + <_> + 3 0 1 4 2. + <_> + 4 4 1 4 2. + <_> + + <_> + 14 4 5 3 -1. + <_> + 14 5 5 1 3. + <_> + + <_> + 6 16 1 3 -1. + <_> + 6 17 1 1 3. + <_> + + <_> + 5 16 2 3 -1. + <_> + 5 17 2 1 3. + <_> + + <_> + 4 6 10 6 -1. + <_> + 4 6 5 3 2. + <_> + 9 9 5 3 2. + <_> + + <_> + 9 14 7 4 -1. + <_> + 9 16 7 2 2. + <_> + + <_> + 10 11 2 4 -1. + <_> + 10 11 1 2 2. + <_> + 11 13 1 2 2. + <_> + + <_> + 5 12 4 3 -1. + <_> + 5 13 4 1 3. + <_> + + <_> + 5 13 3 2 -1. + <_> + 5 14 3 1 2. + <_> + + <_> + 7 13 8 4 -1. + <_> + 7 15 8 2 2. + <_> + + <_> + 8 4 3 1 -1. + <_> + 9 4 1 1 3. + <_> + + <_> + 6 1 1 4 -1. + <_> + 6 3 1 2 2. + <_> + + <_> + 8 0 12 6 -1. + <_> + 8 0 6 3 2. + <_> + 14 3 6 3 2. + <_> + + <_> + 8 5 2 3 -1. + <_> + 8 6 2 1 3. + <_> + + <_> + 8 5 2 3 -1. + <_> + 8 6 2 1 3. + <_> + + <_> + 7 4 3 1 -1. + <_> + 8 4 1 1 3. + <_> + + <_> + 7 9 2 2 -1. + <_> + 7 9 1 1 2. + <_> + 8 10 1 1 2. + <_> + + <_> + 15 14 4 6 -1. + <_> + 15 14 2 3 2. + <_> + 17 17 2 3 2. + <_> + + <_> + 7 9 1 4 -1. + <_> + 7 11 1 2 2. + <_> + + <_> + 10 11 3 9 -1. + <_> + 11 11 1 9 3. + <_> + + <_> + 17 11 3 1 -1. + <_> + 18 11 1 1 3. + <_> + + <_> + 17 11 3 1 -1. + <_> + 18 11 1 1 3. + <_> + + <_> + 0 1 1 2 -1. + <_> + 0 2 1 1 2. + <_> + + <_> + 9 15 7 3 -1. + <_> + 9 16 7 1 3. + <_> + + <_> + 15 0 2 2 -1. + <_> + 16 0 1 2 2. + <_> + + <_> + 5 0 1 14 -1. + <_> + 5 7 1 7 2. + <_> + + <_> + 7 3 1 2 -1. + <_> + 7 4 1 1 2. + <_> + + <_> + 7 0 4 6 -1. + <_> + 7 2 4 2 3. + <_> + + <_> + 7 2 3 2 -1. + <_> + 8 2 1 2 3. + <_> + + <_> + 5 12 4 3 -1. + <_> + 5 13 4 1 3. + <_> + + <_> + 18 5 1 2 -1. + <_> + 18 6 1 1 2. + <_> + + <_> + 18 0 2 10 -1. + <_> + 18 0 1 5 2. + <_> + 19 5 1 5 2. + <_> + + <_> + 0 2 13 6 -1. + <_> + 0 4 13 2 3. + <_> + + <_> + 0 0 2 2 -1. + <_> + 0 0 1 1 2. + <_> + 1 1 1 1 2. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 6 12 2 4 -1. + <_> + 7 12 1 4 2. + <_> + + <_> + 7 9 4 10 -1. + <_> + 9 9 2 10 2. + <_> + + <_> + 2 0 9 16 -1. + <_> + 2 8 9 8 2. + <_> + + <_> + 10 3 2 8 -1. + <_> + 10 3 1 4 2. + <_> + 11 7 1 4 2. + <_> + + <_> + 1 2 12 3 -1. + <_> + 5 2 4 3 3. + <_> + + <_> + 4 6 2 3 -1. + <_> + 5 6 1 3 2. + <_> + + <_> + 1 7 6 10 -1. + <_> + 3 7 2 10 3. + <_> + + <_> + 1 14 2 1 -1. + <_> + 2 14 1 1 2. + <_> + + <_> + 11 12 1 2 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 12 8 3 5 -1. + <_> + 13 8 1 5 3. + <_> + + <_> + 6 5 9 6 -1. + <_> + 6 7 9 2 3. + <_> + + <_> + 13 8 2 3 -1. + <_> + 13 9 2 1 3. + <_> + + <_> + 7 15 6 4 -1. + <_> + 7 15 3 2 2. + <_> + 10 17 3 2 2. + <_> + + <_> + 10 15 6 3 -1. + <_> + 10 16 6 1 3. + <_> + + <_> + 3 2 2 6 -1. + <_> + 3 2 1 3 2. + <_> + 4 5 1 3 2. + <_> + + <_> + 10 15 3 5 -1. + <_> + 11 15 1 5 3. + <_> + + <_> + 12 9 5 2 -1. + <_> + 12 10 5 1 2. + <_> + + <_> + 4 11 10 1 -1. + <_> + 9 11 5 1 2. + <_> + + <_> + 6 12 6 2 -1. + <_> + 6 12 3 1 2. + <_> + 9 13 3 1 2. + <_> + + <_> + 6 11 1 3 -1. + <_> + 6 12 1 1 3. + <_> + + <_> + 3 12 8 4 -1. + <_> + 3 12 4 2 2. + <_> + 7 14 4 2 2. + <_> + + <_> + 0 3 1 3 -1. + <_> + 0 4 1 1 3. + <_> + + <_> + 10 12 2 1 -1. + <_> + 11 12 1 1 2. + <_> + + <_> + 3 10 3 6 -1. + <_> + 3 12 3 2 3. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 8 7 4 6 -1. + <_> + 8 9 4 2 3. + <_> + + <_> + 12 11 1 3 -1. + <_> + 12 12 1 1 3. + <_> + + <_> + 12 11 2 3 -1. + <_> + 12 12 2 1 3. + <_> + + <_> + 6 10 2 2 -1. + <_> + 6 10 1 1 2. + <_> + 7 11 1 1 2. + <_> + + <_> + 3 10 9 6 -1. + <_> + 3 13 9 3 2. + <_> + + <_> + 4 8 7 10 -1. + <_> + 4 13 7 5 2. + <_> + + <_> + 6 8 11 3 -1. + <_> + 6 9 11 1 3. + <_> + + <_> + 6 5 1 14 -1. + <_> + 6 12 1 7 2. + <_> + + <_> + 13 6 5 10 -1. + <_> + 13 11 5 5 2. + <_> + + <_> + 2 0 13 15 -1. + <_> + 2 5 13 5 3. + <_> + + <_> + 6 7 2 2 -1. + <_> + 7 7 1 2 2. + <_> + + <_> + 4 5 9 4 -1. + <_> + 7 5 3 4 3. + <_> + + <_> + 6 7 3 3 -1. + <_> + 7 7 1 3 3. + <_> + + <_> + 8 1 3 4 -1. + <_> + 9 1 1 4 3. + <_> + + <_> + 8 11 7 2 -1. + <_> + 8 12 7 1 2. + <_> + + <_> + 4 7 3 2 -1. + <_> + 5 7 1 2 3. + <_> + + <_> + 4 14 2 6 -1. + <_> + 4 14 1 3 2. + <_> + 5 17 1 3 2. + <_> + + <_> + 0 7 8 13 -1. + <_> + 4 7 4 13 2. + <_> + + <_> + 6 3 4 9 -1. + <_> + 8 3 2 9 2. + <_> + + <_> + 9 12 2 3 -1. + <_> + 9 13 2 1 3. + <_> + + <_> + 16 14 2 6 -1. + <_> + 16 14 1 3 2. + <_> + 17 17 1 3 2. + <_> + + <_> + 11 14 2 3 -1. + <_> + 11 15 2 1 3. + <_> + + <_> + 11 14 1 2 -1. + <_> + 11 15 1 1 2. + <_> + + <_> + 8 8 3 2 -1. + <_> + 8 9 3 1 2. + <_> + + <_> + 13 1 3 5 -1. + <_> + 14 1 1 5 3. + <_> + + <_> + 6 15 8 2 -1. + <_> + 6 15 4 1 2. + <_> + 10 16 4 1 2. + <_> + + <_> + 13 2 3 4 -1. + <_> + 14 2 1 4 3. + <_> + + <_> + 1 8 1 6 -1. + <_> + 1 10 1 2 3. + <_> + + <_> + 12 0 8 2 -1. + <_> + 12 0 4 1 2. + <_> + 16 1 4 1 2. + <_> + + <_> + 5 8 3 1 -1. + <_> + 6 8 1 1 3. + <_> + + <_> + 7 5 2 4 -1. + <_> + 8 5 1 4 2. + <_> + + <_> + 7 2 2 1 -1. + <_> + 8 2 1 1 2. + <_> + + <_> + 0 4 2 3 -1. + <_> + 0 5 2 1 3. + <_> + + <_> + 3 17 2 2 -1. + <_> + 3 17 1 1 2. + <_> + 4 18 1 1 2. + <_> + + <_> + 6 0 12 9 -1. + <_> + 12 0 6 9 2. + <_> + + <_> + 7 0 12 3 -1. + <_> + 11 0 4 3 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 3 2. + <_> + 17 3 3 3 2. + <_> + + <_> + 15 2 1 2 -1. + <_> + 15 3 1 1 2. + <_> + + <_> + 8 2 1 6 -1. + <_> + 8 4 1 2 3. + <_> + + <_> + 5 7 3 2 -1. + <_> + 6 7 1 2 3. + <_> + + <_> + 6 7 4 6 -1. + <_> + 6 10 4 3 2. + <_> + + <_> + 8 6 10 2 -1. + <_> + 13 6 5 2 2. + <_> + + <_> + 2 1 4 15 -1. + <_> + 4 1 2 15 2. + <_> + + <_> + 5 9 3 6 -1. + <_> + 5 12 3 3 2. + <_> + + <_> + 12 11 2 1 -1. + <_> + 13 11 1 1 2. + <_> + + <_> + 6 4 6 2 -1. + <_> + 8 4 2 2 3. + <_> + + <_> + 12 9 4 8 -1. + <_> + 12 13 4 4 2. + <_> + + <_> + 15 8 2 4 -1. + <_> + 15 10 2 2 2. + <_> + + <_> + 6 12 3 3 -1. + <_> + 6 13 3 1 3. + <_> + + <_> + 6 12 2 3 -1. + <_> + 6 13 2 1 3. + <_> + + <_> + 5 10 4 6 -1. + <_> + 7 10 2 6 2. + <_> + + <_> + 7 8 2 9 -1. + <_> + 7 11 2 3 3. + <_> + + <_> + 5 13 4 3 -1. + <_> + 5 14 4 1 3. + <_> + + <_> + 11 12 2 2 -1. + <_> + 11 12 1 1 2. + <_> + 12 13 1 1 2. + <_> + + <_> + 5 13 5 3 -1. + <_> + 5 14 5 1 3. + <_> + + <_> + 4 9 8 1 -1. + <_> + 8 9 4 1 2. + <_> + + <_> + 12 0 8 6 -1. + <_> + 12 0 4 3 2. + <_> + 16 3 4 3 2. + <_> + + <_> + 11 12 1 2 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 8 4 3 3 -1. + <_> + 9 4 1 3 3. + <_> + + <_> + 8 0 7 15 -1. + <_> + 8 5 7 5 3. + <_> + + <_> + 3 0 8 4 -1. + <_> + 3 0 4 2 2. + <_> + 7 2 4 2 2. + <_> + + <_> + 0 11 20 1 -1. + <_> + 10 11 10 1 2. + <_> + + <_> + 3 14 3 2 -1. + <_> + 4 14 1 2 3. + <_> + + <_> + 3 11 3 8 -1. + <_> + 4 11 1 8 3. + <_> + + <_> + 7 13 2 5 -1. + <_> + 8 13 1 5 2. + <_> + + <_> + 14 4 3 3 -1. + <_> + 14 5 3 1 3. + <_> + + <_> + 5 11 2 3 -1. + <_> + 5 12 2 1 3. + <_> + + <_> + 6 12 1 2 -1. + <_> + 6 13 1 1 2. + <_> + + <_> + 5 13 3 1 -1. + <_> + 6 13 1 1 3. + <_> + + <_> + 12 11 1 3 -1. + <_> + 12 12 1 1 3. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 5 9 1 3 -1. + <_> + 5 10 1 1 3. + <_> + + <_> + 1 9 12 9 -1. + <_> + 1 12 12 3 3. + <_> + + <_> + 12 14 3 3 -1. + <_> + 12 15 3 1 3. + <_> + + <_> + 10 14 5 3 -1. + <_> + 10 15 5 1 3. + <_> + + <_> + 5 11 3 3 -1. + <_> + 5 12 3 1 3. + <_> + + <_> + 5 11 2 6 -1. + <_> + 5 14 2 3 2. + <_> + + <_> + 6 5 2 14 -1. + <_> + 6 12 2 7 2. + <_> + + <_> + 2 8 5 2 -1. + <_> + 2 9 5 1 2. + <_> + + <_> + 10 14 1 2 -1. + <_> + 10 15 1 1 2. + <_> + + <_> + 7 14 4 6 -1. + <_> + 7 16 4 2 3. + <_> + + <_> + 8 12 3 1 -1. + <_> + 9 12 1 1 3. + <_> + + <_> + 4 8 3 1 -1. + <_> + 5 8 1 1 3. + <_> + + <_> + 3 6 3 4 -1. + <_> + 4 6 1 4 3. + <_> + + <_> + 4 4 3 8 -1. + <_> + 4 8 3 4 2. + <_> + + <_> + 12 5 2 2 -1. + <_> + 12 6 2 1 2. + <_> + + <_> + 16 10 2 2 -1. + <_> + 16 10 1 1 2. + <_> + 17 11 1 1 2. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 7 0 5 8 -1. + <_> + 7 4 5 4 2. + <_> + + <_> + 4 5 8 10 -1. + <_> + 4 5 4 5 2. + <_> + 8 10 4 5 2. + <_> + + <_> + 7 5 3 3 -1. + <_> + 7 6 3 1 3. + <_> + + <_> + 10 6 10 14 -1. + <_> + 10 13 10 7 2. + <_> + + <_> + 8 6 2 3 -1. + <_> + 8 7 2 1 3. + <_> + + <_> + 13 10 1 4 -1. + <_> + 13 12 1 2 2. + <_> + + <_> + 3 9 12 4 -1. + <_> + 3 9 6 2 2. + <_> + 9 11 6 2 2. + <_> + + <_> + 7 14 3 6 -1. + <_> + 7 16 3 2 3. + <_> + + <_> + 10 10 3 2 -1. + <_> + 11 10 1 2 3. + <_> + + <_> + 3 4 10 4 -1. + <_> + 3 4 5 2 2. + <_> + 8 6 5 2 2. + <_> + + <_> + 4 10 4 3 -1. + <_> + 4 11 4 1 3. + <_> + + <_> + 5 3 6 4 -1. + <_> + 5 3 3 2 2. + <_> + 8 5 3 2 2. + <_> + + <_> + 6 8 6 10 -1. + <_> + 9 8 3 10 2. + <_> + + <_> + 10 15 6 3 -1. + <_> + 10 16 6 1 3. + <_> + + <_> + 3 4 3 7 -1. + <_> + 4 4 1 7 3. + <_> + + <_> + 3 3 3 11 -1. + <_> + 4 3 1 11 3. + <_> + + <_> + 7 14 5 3 -1. + <_> + 7 15 5 1 3. + <_> + + <_> + 17 11 2 2 -1. + <_> + 17 11 1 1 2. + <_> + 18 12 1 1 2. + <_> + + <_> + 9 0 3 4 -1. + <_> + 10 0 1 4 3. + <_> + + <_> + 11 1 3 1 -1. + <_> + 12 1 1 1 3. + <_> + + <_> + 17 11 2 2 -1. + <_> + 17 11 1 1 2. + <_> + 18 12 1 1 2. + <_> + + <_> + 0 10 2 1 -1. + <_> + 1 10 1 1 2. + <_> + + <_> + 17 0 2 8 -1. + <_> + 17 0 1 4 2. + <_> + 18 4 1 4 2. + <_> + + <_> + 6 7 6 2 -1. + <_> + 8 7 2 2 3. + <_> + + <_> + 5 7 6 9 -1. + <_> + 8 7 3 9 2. + <_> + + <_> + 6 8 9 3 -1. + <_> + 9 8 3 3 3. + <_> + + <_> + 11 7 6 4 -1. + <_> + 13 7 2 4 3. + <_> + + <_> + 8 5 2 2 -1. + <_> + 9 5 1 2 2. + <_> + + <_> + 15 3 4 10 -1. + <_> + 15 8 4 5 2. + <_> + + <_> + 9 2 1 2 -1. + <_> + 9 3 1 1 2. + <_> + + <_> + 7 15 8 2 -1. + <_> + 7 15 4 1 2. + <_> + 11 16 4 1 2. + <_> + + <_> + 6 5 2 9 -1. + <_> + 7 5 1 9 2. + <_> + + <_> + 6 6 2 4 -1. + <_> + 7 6 1 4 2. + <_> + + <_> + 10 15 2 4 -1. + <_> + 11 15 1 4 2. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 12 9 7 4 -1. + <_> + 12 11 7 2 2. + <_> + + <_> + 5 9 9 3 -1. + <_> + 8 9 3 3 3. + <_> + + <_> + 5 8 6 5 -1. + <_> + 8 8 3 5 2. + <_> + + <_> + 7 16 4 3 -1. + <_> + 7 17 4 1 3. + <_> + + <_> + 15 4 4 3 -1. + <_> + 15 5 4 1 3. + <_> + + <_> + 16 10 2 2 -1. + <_> + 16 10 1 1 2. + <_> + 17 11 1 1 2. + <_> + + <_> + 5 6 6 9 -1. + <_> + 8 6 3 9 2. + <_> + + <_> + 10 0 10 6 -1. + <_> + 10 0 5 3 2. + <_> + 15 3 5 3 2. + <_> + + <_> + 13 14 1 2 -1. + <_> + 13 15 1 1 2. + <_> + + <_> + 10 4 3 1 -1. + <_> + 11 4 1 1 3. + <_> + + <_> + 6 16 1 3 -1. + <_> + 6 17 1 1 3. + <_> + + <_> + 11 13 4 3 -1. + <_> + 11 14 4 1 3. + <_> + + <_> + 14 10 6 6 -1. + <_> + 14 10 3 3 2. + <_> + 17 13 3 3 2. + <_> + + <_> + 1 1 1 2 -1. + <_> + 1 2 1 1 2. + <_> + + <_> + 6 15 1 3 -1. + <_> + 6 16 1 1 3. + <_> + + <_> + 7 15 1 3 -1. + <_> + 7 16 1 1 3. + <_> + + <_> + 8 16 3 2 -1. + <_> + 9 16 1 2 3. + <_> + + <_> + 5 8 3 9 -1. + <_> + 6 8 1 9 3. + <_> + + <_> + 3 3 2 10 -1. + <_> + 3 3 1 5 2. + <_> + 4 8 1 5 2. + <_> + + <_> + 3 6 3 1 -1. + <_> + 4 6 1 1 3. + <_> + + <_> + 2 0 2 1 -1. + <_> + 3 0 1 1 2. + <_> + + <_> + 7 13 2 3 -1. + <_> + 7 14 2 1 3. + <_> + + <_> + 7 9 1 9 -1. + <_> + 7 12 1 3 3. + <_> + + <_> + 7 8 1 9 -1. + <_> + 7 11 1 3 3. + <_> + + <_> + 15 7 3 10 -1. + <_> + 16 7 1 10 3. + <_> + + <_> + 14 7 6 10 -1. + <_> + 16 7 2 10 3. + <_> + + <_> + 2 12 18 6 -1. + <_> + 2 14 18 2 3. + <_> + + <_> + 0 9 12 1 -1. + <_> + 4 9 4 1 3. + <_> + + <_> + 1 7 3 6 -1. + <_> + 2 7 1 6 3. + <_> + + <_> + 5 6 8 1 -1. + <_> + 9 6 4 1 2. + <_> + + <_> + 10 14 2 1 -1. + <_> + 11 14 1 1 2. + <_> + + <_> + 14 8 6 10 -1. + <_> + 16 8 2 10 3. + <_> + + <_> + 10 5 8 7 -1. + <_> + 14 5 4 7 2. + <_> + + <_> + 8 5 8 4 -1. + <_> + 8 5 4 2 2. + <_> + 12 7 4 2 2. + <_> + + <_> + 11 11 1 8 -1. + <_> + 11 15 1 4 2. + <_> + + <_> + 5 6 2 4 -1. + <_> + 6 6 1 4 2. + <_> + + <_> + 7 8 2 2 -1. + <_> + 7 9 2 1 2. + <_> + + <_> + 0 2 8 11 -1. + <_> + 4 2 4 11 2. + <_> + + <_> + 8 6 8 8 -1. + <_> + 8 10 8 4 2. + <_> + + <_> + 4 4 2 6 -1. + <_> + 5 4 1 6 2. + <_> + + <_> + 13 12 1 2 -1. + <_> + 13 13 1 1 2. + <_> + + <_> + 3 8 3 2 -1. + <_> + 4 8 1 2 3. + <_> + + <_> + 13 12 1 3 -1. + <_> + 13 13 1 1 3. + <_> + + <_> + 9 19 4 1 -1. + <_> + 11 19 2 1 2. + <_> + + <_> + 15 4 2 3 -1. + <_> + 15 5 2 1 3. + <_> + + <_> + 5 11 11 4 -1. + <_> + 5 13 11 2 2. + <_> + + <_> + 7 12 1 3 -1. + <_> + 7 13 1 1 3. + <_> + + <_> + 6 12 4 4 -1. + <_> + 6 14 4 2 2. + <_> + + <_> + 7 11 1 3 -1. + <_> + 7 12 1 1 3. + <_> + + <_> + 9 10 3 3 -1. + <_> + 10 10 1 3 3. + <_> + + <_> + 10 12 2 1 -1. + <_> + 11 12 1 1 2. + <_> + + <_> + 7 1 12 16 -1. + <_> + 7 1 6 8 2. + <_> + 13 9 6 8 2. + <_> + + <_> + 10 5 8 7 -1. + <_> + 14 5 4 7 2. + <_> + + <_> + 18 8 2 10 -1. + <_> + 18 8 1 5 2. + <_> + 19 13 1 5 2. + <_> + + <_> + 12 11 2 2 -1. + <_> + 13 11 1 2 2. + <_> + + <_> + 3 15 3 1 -1. + <_> + 4 15 1 1 3. + <_> + + <_> + 5 14 2 1 -1. + <_> + 6 14 1 1 2. + <_> + + <_> + 11 9 1 2 -1. + <_> + 11 10 1 1 2. + <_> + + <_> + 10 12 3 1 -1. + <_> + 11 12 1 1 3. + <_> + + <_> + 5 9 7 2 -1. + <_> + 5 10 7 1 2. + <_> + + <_> + 11 0 2 1 -1. + <_> + 12 0 1 1 2. + <_> + + <_> + 11 0 2 2 -1. + <_> + 12 0 1 2 2. + <_> + + <_> + 5 0 2 2 -1. + <_> + 5 0 1 1 2. + <_> + 6 1 1 1 2. + <_> + + <_> + 8 3 12 6 -1. + <_> + 8 5 12 2 3. + <_> + + <_> + 17 0 3 12 -1. + <_> + 18 0 1 12 3. + <_> + + <_> + 11 1 2 1 -1. + <_> + 12 1 1 1 2. + <_> + + <_> + 5 5 2 1 -1. + <_> + 6 5 1 1 2. + <_> + + <_> + 7 14 6 6 -1. + <_> + 7 14 3 3 2. + <_> + 10 17 3 3 2. + <_> + + <_> + 11 10 1 2 -1. + <_> + 11 11 1 1 2. + <_> + + <_> + 3 9 12 4 -1. + <_> + 3 9 6 2 2. + <_> + 9 11 6 2 2. + <_> + + <_> + 5 10 1 2 -1. + <_> + 5 11 1 1 2. + <_> + + <_> + 6 10 2 1 -1. + <_> + 7 10 1 1 2. + <_> + + <_> + 8 16 3 2 -1. + <_> + 9 16 1 2 3. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 7 15 3 2 -1. + <_> + 8 15 1 2 3. + <_> + + <_> + 8 15 2 1 -1. + <_> + 9 15 1 1 2. + <_> + + <_> + 5 10 4 3 -1. + <_> + 5 11 4 1 3. + <_> + + <_> + 6 7 4 12 -1. + <_> + 8 7 2 12 2. + <_> + + <_> + 5 6 6 7 -1. + <_> + 8 6 3 7 2. + <_> + + <_> + 8 4 6 11 -1. + <_> + 11 4 3 11 2. + <_> + + <_> + 7 9 6 3 -1. + <_> + 9 9 2 3 3. + <_> + + <_> + 0 5 1 2 -1. + <_> + 0 6 1 1 2. + <_> + + <_> + 6 8 3 1 -1. + <_> + 7 8 1 1 3. + <_> + + <_> + 12 1 2 2 -1. + <_> + 13 1 1 2 2. + <_> + + <_> + 4 4 10 12 -1. + <_> + 4 4 5 6 2. + <_> + 9 10 5 6 2. + <_> + + <_> + 5 18 2 2 -1. + <_> + 5 18 1 1 2. + <_> + 6 19 1 1 2. + <_> + + <_> + 6 3 3 3 -1. + <_> + 7 3 1 3 3. + <_> + + <_> + 5 12 2 3 -1. + <_> + 5 13 2 1 3. + <_> + + <_> + 11 15 2 3 -1. + <_> + 11 16 2 1 3. + <_> + + <_> + 11 15 1 3 -1. + <_> + 11 16 1 1 3. + <_> + + <_> + 6 7 3 2 -1. + <_> + 7 7 1 2 3. + <_> + + <_> + 3 11 14 1 -1. + <_> + 10 11 7 1 2. + <_> + + <_> + 5 7 3 1 -1. + <_> + 6 7 1 1 3. + <_> + + <_> + 14 9 3 3 -1. + <_> + 14 10 3 1 3. + <_> + + <_> + 4 17 2 2 -1. + <_> + 4 17 1 1 2. + <_> + 5 18 1 1 2. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 17 2 1 2. + <_> + + <_> + 18 12 2 2 -1. + <_> + 18 12 1 1 2. + <_> + 19 13 1 1 2. + <_> + + <_> + 5 11 4 3 -1. + <_> + 7 11 2 3 2. + <_> + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + <_> + + <_> + 18 6 2 2 -1. + <_> + 18 7 2 1 2. + <_> + + <_> + 18 6 2 2 -1. + <_> + 18 7 2 1 2. + <_> + + <_> + 4 5 2 6 -1. + <_> + 4 7 2 2 3. + <_> + + <_> + 3 11 6 4 -1. + <_> + 3 11 3 2 2. + <_> + 6 13 3 2 2. + <_> + + <_> + 1 10 3 3 -1. + <_> + 2 10 1 3 3. + <_> + + <_> + 15 0 4 4 -1. + <_> + 15 0 2 2 2. + <_> + 17 2 2 2 2. + <_> + + <_> + 5 6 4 10 -1. + <_> + 5 11 4 5 2. + <_> + + <_> + 7 13 1 3 -1. + <_> + 7 14 1 1 3. + <_> + + <_> + 3 10 16 4 -1. + <_> + 3 10 8 2 2. + <_> + 11 12 8 2 2. + <_> + + <_> + 7 14 1 3 -1. + <_> + 7 15 1 1 3. + <_> + + <_> + 5 14 3 3 -1. + <_> + 5 15 3 1 3. + <_> + + <_> + 9 9 3 8 -1. + <_> + 10 9 1 8 3. + <_> + + <_> + 6 0 7 4 -1. + <_> + 6 2 7 2 2. + <_> + + <_> + 8 0 1 4 -1. + <_> + 8 2 1 2 2. + <_> + + <_> + 1 4 1 6 -1. + <_> + 1 6 1 2 3. + <_> + + <_> + 0 2 15 3 -1. + <_> + 5 2 5 3 3. + <_> + + <_> + 0 8 2 2 -1. + <_> + 0 9 2 1 2. + <_> + + <_> + 3 10 6 4 -1. + <_> + 5 10 2 4 3. + <_> + + <_> + 8 5 3 1 -1. + <_> + 9 5 1 1 3. + <_> + + <_> + 15 11 2 2 -1. + <_> + 15 11 1 1 2. + <_> + 16 12 1 1 2. + <_> + + <_> + 4 11 6 2 -1. + <_> + 7 11 3 2 2. + <_> + + <_> + 6 8 6 4 -1. + <_> + 8 8 2 4 3. + <_> + + <_> + 6 5 6 6 -1. + <_> + 8 5 2 6 3. + <_> + + <_> + 14 12 2 3 -1. + <_> + 15 12 1 3 2. + <_> + + <_> + 11 5 3 7 -1. + <_> + 12 5 1 7 3. + <_> + + <_> + 7 16 8 4 -1. + <_> + 7 16 4 2 2. + <_> + 11 18 4 2 2. + <_> + + <_> + 5 16 12 4 -1. + <_> + 5 16 6 2 2. + <_> + 11 18 6 2 2. + <_> + + <_> + 10 17 6 3 -1. + <_> + 10 18 6 1 3. + <_> + + <_> + 6 8 2 3 -1. + <_> + 6 9 2 1 3. + <_> + + <_> + 0 0 20 18 -1. + <_> + 10 0 10 18 2. + <_> + + <_> + 8 0 6 5 -1. + <_> + 11 0 3 5 2. + <_> + + <_> + 13 5 4 2 -1. + <_> + 13 5 2 1 2. + <_> + 15 6 2 1 2. + <_> + + <_> + 10 4 4 11 -1. + <_> + 12 4 2 11 2. + <_> + + <_> + 5 10 3 1 -1. + <_> + 6 10 1 1 3. + <_> + + <_> + 17 4 2 3 -1. + <_> + 17 5 2 1 3. + <_> + + <_> + 6 13 8 6 -1. + <_> + 6 13 4 3 2. + <_> + 10 16 4 3 2. + <_> + + <_> + 17 5 3 10 -1. + <_> + 18 5 1 10 3. + <_> + + <_> + 13 11 2 2 -1. + <_> + 14 11 1 2 2. + <_> + + <_> + 5 9 4 9 -1. + <_> + 5 12 4 3 3. + <_> + + <_> + 5 11 2 3 -1. + <_> + 5 12 2 1 3. + <_> + + <_> + 15 15 2 2 -1. + <_> + 15 15 1 1 2. + <_> + 16 16 1 1 2. + <_> + + <_> + 6 13 6 5 -1. + <_> + 8 13 2 5 3. + <_> + + <_> + 9 7 2 8 -1. + <_> + 9 7 1 4 2. + <_> + 10 11 1 4 2. + <_> + + <_> + 4 12 2 2 -1. + <_> + 4 12 1 1 2. + <_> + 5 13 1 1 2. + <_> + + <_> + 7 4 3 1 -1. + <_> + 8 4 1 1 3. + <_> + + <_> + 12 3 3 4 -1. + <_> + 13 3 1 4 3. + <_> + + <_> + 2 0 18 20 -1. + <_> + 2 10 18 10 2. + <_> + + <_> + 11 2 7 12 -1. + <_> + 11 8 7 6 2. + <_> + + <_> + 13 5 2 2 -1. + <_> + 14 5 1 2 2. + <_> + + <_> + 4 17 4 1 -1. + <_> + 6 17 2 1 2. + <_> + + <_> + 3 14 4 4 -1. + <_> + 5 14 2 4 2. + <_> + + <_> + 0 2 8 18 -1. + <_> + 0 11 8 9 2. + <_> + + <_> + 5 7 3 3 -1. + <_> + 5 8 3 1 3. + <_> + + <_> + 8 2 3 2 -1. + <_> + 9 2 1 2 3. + <_> + + <_> + 5 7 15 4 -1. + <_> + 5 9 15 2 2. + <_> + + <_> + 10 0 10 8 -1. + <_> + 10 0 5 4 2. + <_> + 15 4 5 4 2. + <_> + + <_> + 10 8 4 4 -1. + <_> + 10 8 2 2 2. + <_> + 12 10 2 2 2. + <_> + + <_> + 5 6 3 10 -1. + <_> + 5 11 3 5 2. + <_> + + <_> + 7 6 3 4 -1. + <_> + 8 6 1 4 3. + <_> + + <_> + 12 13 2 2 -1. + <_> + 12 14 2 1 2. + <_> + + <_> + 7 8 4 12 -1. + <_> + 7 12 4 4 3. + <_> + + <_> + 0 0 6 18 -1. + <_> + 2 0 2 18 3. + <_> + + <_> + 6 1 10 6 -1. + <_> + 6 3 10 2 3. + <_> + + <_> + 13 9 3 2 -1. + <_> + 13 10 3 1 2. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 6 10 1 10 -1. + <_> + 6 15 1 5 2. + <_> + + <_> + 9 9 3 4 -1. + <_> + 9 11 3 2 2. + <_> + + <_> + 7 4 2 2 -1. + <_> + 7 5 2 1 2. + <_> + + <_> + 12 12 2 1 -1. + <_> + 13 12 1 1 2. + <_> + + <_> + 7 12 1 3 -1. + <_> + 7 13 1 1 3. + <_> + + <_> + 5 11 3 3 -1. + <_> + 5 12 3 1 3. + <_> + + <_> + 1 0 1 2 -1. + <_> + 1 1 1 1 2. + <_> + + <_> + 10 16 6 3 -1. + <_> + 10 17 6 1 3. + <_> + + <_> + 9 4 4 6 -1. + <_> + 9 4 2 3 2. + <_> + 11 7 2 3 2. + <_> + + <_> + 10 9 10 1 -1. + <_> + 15 9 5 1 2. + <_> + + <_> + 9 11 1 2 -1. + <_> + 9 12 1 1 2. + <_> + + <_> + 7 8 3 6 -1. + <_> + 7 10 3 2 3. + <_> + + <_> + 1 18 8 2 -1. + <_> + 1 18 4 1 2. + <_> + 5 19 4 1 2. + <_> + + <_> + 5 13 3 3 -1. + <_> + 5 14 3 1 3. + <_> + + <_> + 4 6 5 6 -1. + <_> + 4 9 5 3 2. + <_> + + <_> + 6 5 2 1 -1. + <_> + 7 5 1 1 2. + <_> + + <_> + 11 6 1 6 -1. + <_> + 11 9 1 3 2. + <_> + + <_> + 6 17 4 3 -1. + <_> + 6 18 4 1 3. + <_> + + <_> + 10 4 2 10 -1. + <_> + 10 4 1 5 2. + <_> + 11 9 1 5 2. + <_> + + <_> + 8 4 9 13 -1. + <_> + 11 4 3 13 3. + <_> + + <_> + 10 11 2 2 -1. + <_> + 11 11 1 2 2. + <_> + + <_> + 13 15 1 2 -1. + <_> + 13 16 1 1 2. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 0 0 14 10 -1. + <_> + 0 5 14 5 2. + <_> + + <_> + 12 5 6 15 -1. + <_> + 14 5 2 15 3. + <_> + + <_> + 11 10 2 3 -1. + <_> + 11 11 2 1 3. + <_> + + <_> + 5 14 3 3 -1. + <_> + 5 15 3 1 3. + <_> + + <_> + 5 15 3 2 -1. + <_> + 5 16 3 1 2. + <_> + + <_> + 11 14 3 6 -1. + <_> + 12 14 1 6 3. + <_> + + <_> + 12 18 2 1 -1. + <_> + 13 18 1 1 2. + <_> + + <_> + 16 5 1 2 -1. + <_> + 16 6 1 1 2. + <_> + + <_> + 17 8 3 4 -1. + <_> + 18 8 1 4 3. + <_> + + <_> + 8 15 2 3 -1. + <_> + 9 15 1 3 2. + <_> + + <_> + 6 7 2 4 -1. + <_> + 6 7 1 2 2. + <_> + 7 9 1 2 2. + <_> + + <_> + 3 7 12 2 -1. + <_> + 7 7 4 2 3. + <_> + + <_> + 4 7 3 3 -1. + <_> + 5 7 1 3 3. + <_> + + <_> + 1 10 2 1 -1. + <_> + 2 10 1 1 2. + <_> + + <_> + 4 4 2 5 -1. + <_> + 5 4 1 5 2. + <_> + + <_> + 6 7 14 2 -1. + <_> + 13 7 7 2 2. + <_> + + <_> + 14 17 2 3 -1. + <_> + 14 18 2 1 3. + <_> + + <_> + 6 11 1 3 -1. + <_> + 6 12 1 1 3. + <_> + + <_> + 11 3 8 16 -1. + <_> + 11 11 8 8 2. + <_> + + <_> + 9 12 5 3 -1. + <_> + 9 13 5 1 3. + <_> + + <_> + 5 9 1 3 -1. + <_> + 5 10 1 1 3. + <_> + + <_> + 3 8 8 4 -1. + <_> + 3 8 4 2 2. + <_> + 7 10 4 2 2. + <_> + + <_> + 10 15 2 3 -1. + <_> + 10 16 2 1 3. + <_> + + <_> + 14 9 1 6 -1. + <_> + 14 12 1 3 2. + <_> + + <_> + 13 11 1 3 -1. + <_> + 13 12 1 1 3. + <_> + + <_> + 8 7 6 6 -1. + <_> + 8 9 6 2 3. + <_> + + <_> + 9 8 4 3 -1. + <_> + 9 9 4 1 3. + <_> + + <_> + 8 2 2 5 -1. + <_> + 9 2 1 5 2. + <_> + + <_> + 13 6 3 3 -1. + <_> + 13 7 3 1 3. + <_> + + <_> + 12 0 5 14 -1. + <_> + 12 7 5 7 2. + <_> + + <_> + 2 2 7 10 -1. + <_> + 2 7 7 5 2. + <_> + + <_> + 5 5 6 11 -1. + <_> + 8 5 3 11 2. + <_> + + <_> + 6 17 3 3 -1. + <_> + 6 18 3 1 3. + <_> + + <_> + 9 5 2 8 -1. + <_> + 9 5 1 4 2. + <_> + 10 9 1 4 2. + <_> + + <_> + 14 0 4 16 -1. + <_> + 14 8 4 8 2. + <_> + + <_> + 10 7 1 3 -1. + <_> + 10 8 1 1 3. + <_> + + <_> + 7 16 3 2 -1. + <_> + 8 16 1 2 3. + <_> + + <_> + 10 6 1 3 -1. + <_> + 10 7 1 1 3. + <_> + + <_> + 5 11 14 6 -1. + <_> + 5 14 14 3 2. + <_> + + <_> + 9 6 1 3 -1. + <_> + 9 7 1 1 3. + <_> + + <_> + 6 11 5 4 -1. + <_> + 6 13 5 2 2. + <_> + + <_> + 6 9 10 8 -1. + <_> + 6 9 5 4 2. + <_> + 11 13 5 4 2. + <_> + + <_> + 18 9 2 6 -1. + <_> + 18 9 1 3 2. + <_> + 19 12 1 3 2. + <_> + + <_> + 5 12 8 2 -1. + <_> + 9 12 4 2 2. + <_> + + <_> + 8 8 6 12 -1. + <_> + 8 8 3 6 2. + <_> + 11 14 3 6 2. + <_> + + <_> + 12 7 3 5 -1. + <_> + 13 7 1 5 3. + <_> + + <_> + 10 13 4 3 -1. + <_> + 10 14 4 1 3. + <_> + + <_> + 12 4 3 15 -1. + <_> + 13 4 1 15 3. + <_> + + <_> + 4 12 4 2 -1. + <_> + 6 12 2 2 2. + <_> + + <_> + 14 1 6 1 -1. + <_> + 16 1 2 1 3. + <_> + + <_> + 15 3 2 8 -1. + <_> + 16 3 1 8 2. + <_> + + <_> + 13 16 6 4 -1. + <_> + 13 16 3 2 2. + <_> + 16 18 3 2 2. + <_> + + <_> + 9 5 6 7 -1. + <_> + 12 5 3 7 2. + <_> + + <_> + 18 3 2 2 -1. + <_> + 18 4 2 1 2. + <_> + + <_> + 2 0 18 4 -1. + <_> + 11 0 9 4 2. + <_> + + <_> + 0 8 2 2 -1. + <_> + 1 8 1 2 2. + <_> + + <_> + 4 12 3 6 -1. + <_> + 5 12 1 6 3. + <_> + + <_> + 3 13 4 2 -1. + <_> + 5 13 2 2 2. + <_> + + <_> + 4 14 11 2 -1. + <_> + 4 15 11 1 2. + <_> + + <_> + 4 13 8 3 -1. + <_> + 4 14 8 1 3. + <_> + + <_> + 3 7 6 10 -1. + <_> + 3 7 3 5 2. + <_> + 6 12 3 5 2. + <_> + + <_> + 5 7 6 4 -1. + <_> + 7 7 2 4 3. + <_> + + <_> + 2 11 10 6 -1. + <_> + 2 14 10 3 2. + <_> + + <_> + 5 7 9 12 -1. + <_> + 5 13 9 6 2. + <_> + + <_> + 9 12 7 4 -1. + <_> + 9 14 7 2 2. + <_> + + <_> + 2 0 8 4 -1. + <_> + 2 0 4 2 2. + <_> + 6 2 4 2 2. + <_> + + <_> + 4 0 4 4 -1. + <_> + 4 0 2 2 2. + <_> + 6 2 2 2 2. + <_> + + <_> + 6 2 3 2 -1. + <_> + 7 2 1 2 3. + <_> + + <_> + 2 11 3 4 -1. + <_> + 3 11 1 4 3. + <_> + + <_> + 1 17 2 1 -1. + <_> + 2 17 1 1 2. + <_> + + <_> + 15 12 4 3 -1. + <_> + 15 13 4 1 3. + <_> + + <_> + 9 15 7 3 -1. + <_> + 9 16 7 1 3. + <_> + + <_> + 6 7 3 2 -1. + <_> + 7 7 1 2 3. + <_> + + <_> + 3 5 12 10 -1. + <_> + 3 5 6 5 2. + <_> + 9 10 6 5 2. + <_> + + <_> + 4 2 12 5 -1. + <_> + 10 2 6 5 2. + <_> + + <_> + 9 5 3 1 -1. + <_> + 10 5 1 1 3. + <_> + + <_> + 2 10 3 4 -1. + <_> + 3 10 1 4 3. + <_> + + <_> + 11 5 2 10 -1. + <_> + 11 10 2 5 2. + <_> + + <_> + 8 6 7 8 -1. + <_> + 8 10 7 4 2. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 2 8 8 4 -1. + <_> + 6 8 4 4 2. + <_> + + <_> + 0 9 2 2 -1. + <_> + 1 9 1 2 2. + <_> + + <_> + 13 11 4 2 -1. + <_> + 15 11 2 2 2. + <_> + + <_> + 8 6 12 5 -1. + <_> + 12 6 4 5 3. + <_> + + <_> + 11 11 9 1 -1. + <_> + 14 11 3 1 3. + <_> + + <_> + 15 10 2 4 -1. + <_> + 15 10 1 2 2. + <_> + 16 12 1 2 2. + <_> + + <_> + 18 5 1 3 -1. + <_> + 18 6 1 1 3. + <_> + + <_> + 4 10 7 3 -1. + <_> + 4 11 7 1 3. + <_> + + <_> + 8 5 3 1 -1. + <_> + 9 5 1 1 3. + <_> + + <_> + 7 13 2 3 -1. + <_> + 7 14 2 1 3. + <_> + + <_> + 7 14 3 3 -1. + <_> + 7 15 3 1 3. + <_> + + <_> + 7 15 3 3 -1. + <_> + 7 16 3 1 3. + <_> + + <_> + 14 15 1 3 -1. + <_> + 14 16 1 1 3. + <_> + + <_> + 2 14 10 6 -1. + <_> + 2 17 10 3 2. + <_> + + <_> + 5 12 5 3 -1. + <_> + 5 13 5 1 3. + <_> + + <_> + 7 9 1 6 -1. + <_> + 7 11 1 2 3. + <_> + + <_> + 0 6 5 6 -1. + <_> + 0 8 5 2 3. + <_> + + <_> + 6 10 3 4 -1. + <_> + 6 12 3 2 2. + <_> + + <_> + 4 9 9 2 -1. + <_> + 4 10 9 1 2. + <_> + + <_> + 7 3 1 2 -1. + <_> + 7 4 1 1 2. + <_> + + <_> + 8 9 4 4 -1. + <_> + 8 11 4 2 2. + <_> + + <_> + 11 10 3 1 -1. + <_> + 12 10 1 1 3. + <_> + + <_> + 5 7 3 2 -1. + <_> + 5 8 3 1 2. + <_> + + <_> + 7 0 6 6 -1. + <_> + 7 3 6 3 2. + <_> + + <_> + 5 6 3 4 -1. + <_> + 6 6 1 4 3. + <_> + + <_> + 11 1 9 12 -1. + <_> + 14 1 3 12 3. + <_> + + <_> + 6 7 4 9 -1. + <_> + 6 10 4 3 3. + <_> + + <_> + 11 7 8 6 -1. + <_> + 11 7 4 3 2. + <_> + 15 10 4 3 2. + <_> + + <_> + 8 9 7 3 -1. + <_> + 8 10 7 1 3. + <_> + + <_> + 3 2 4 18 -1. + <_> + 5 2 2 18 2. + <_> + + <_> + 6 12 2 3 -1. + <_> + 6 13 2 1 3. + <_> + + <_> + 6 11 8 6 -1. + <_> + 6 11 4 3 2. + <_> + 10 14 4 3 2. + <_> + + <_> + 5 9 4 7 -1. + <_> + 7 9 2 7 2. + <_> + + <_> + 5 8 6 5 -1. + <_> + 8 8 3 5 2. + <_> + + <_> + 7 11 1 3 -1. + <_> + 7 12 1 1 3. + <_> + + <_> + 15 10 3 1 -1. + <_> + 16 10 1 1 3. + <_> + + <_> + 10 12 2 2 -1. + <_> + 10 13 2 1 2. + <_> + + <_> + 11 13 2 1 -1. + <_> + 12 13 1 1 2. + <_> + + <_> + 6 12 2 2 -1. + <_> + 6 13 2 1 2. + <_> + + <_> + 11 2 2 12 -1. + <_> + 11 2 1 6 2. + <_> + 12 8 1 6 2. + <_> + + <_> + 7 0 6 6 -1. + <_> + 7 3 6 3 2. + <_> + + <_> + 4 8 4 2 -1. + <_> + 4 9 4 1 2. + <_> + + <_> + 14 12 1 2 -1. + <_> + 14 13 1 1 2. + <_> + + <_> + 4 0 2 4 -1. + <_> + 4 0 1 2 2. + <_> + 5 2 1 2 2. + <_> + + <_> + 15 2 2 1 -1. + <_> + 16 2 1 1 2. + <_> + + <_> + 3 14 3 1 -1. + <_> + 4 14 1 1 3. + <_> + + <_> + 5 11 10 4 -1. + <_> + 5 11 5 2 2. + <_> + 10 13 5 2 2. + <_> + + <_> + 4 10 12 3 -1. + <_> + 4 11 12 1 3. + <_> + + <_> + 15 2 4 6 -1. + <_> + 15 2 2 3 2. + <_> + 17 5 2 3 2. + <_> + + <_> + 5 8 1 4 -1. + <_> + 5 10 1 2 2. + <_> + + <_> + 6 15 3 2 -1. + <_> + 7 15 1 2 3. + <_> + + <_> + 11 19 2 1 -1. + <_> + 12 19 1 1 2. + <_> + + <_> + 6 7 3 2 -1. + <_> + 7 7 1 2 3. + <_> + + <_> + 6 4 2 1 -1. + <_> + 7 4 1 1 2. + <_> + + <_> + 6 4 3 2 -1. + <_> + 7 4 1 2 3. + <_> + + <_> + 6 8 2 2 -1. + <_> + 6 8 1 1 2. + <_> + 7 9 1 1 2. + <_> + + <_> + 6 15 3 2 -1. + <_> + 7 15 1 2 3. + <_> + + <_> + 4 8 2 4 -1. + <_> + 4 8 1 2 2. + <_> + 5 10 1 2 2. + <_> + + <_> + 10 4 7 3 -1. + <_> + 10 5 7 1 3. + <_> + + <_> + 4 5 2 6 -1. + <_> + 5 5 1 6 2. + <_> + + <_> + 10 13 1 3 -1. + <_> + 10 14 1 1 3. + <_> + + <_> + 6 11 6 3 -1. + <_> + 9 11 3 3 2. + <_> + + <_> + 10 14 3 2 -1. + <_> + 10 15 3 1 2. + <_> + + <_> + 8 8 4 2 -1. + <_> + 10 8 2 2 2. + <_> + + <_> + 17 12 3 1 -1. + <_> + 18 12 1 1 3. + <_> + + <_> + 9 0 11 16 -1. + <_> + 9 8 11 8 2. + <_> + + <_> + 17 0 3 6 -1. + <_> + 17 2 3 2 3. + <_> + + <_> + 0 0 1 2 -1. + <_> + 0 1 1 1 2. + <_> + + <_> + 5 11 3 3 -1. + <_> + 5 12 3 1 3. + <_> + + <_> + 4 10 10 9 -1. + <_> + 4 13 10 3 3. + <_> + + <_> + 3 3 3 5 -1. + <_> + 4 3 1 5 3. + <_> + + <_> + 6 1 2 6 -1. + <_> + 6 3 2 2 3. + <_> + + <_> + 5 0 8 6 -1. + <_> + 5 2 8 2 3. + <_> + + <_> + 0 0 1 2 -1. + <_> + 0 1 1 1 2. + <_> + + <_> + 6 3 6 4 -1. + <_> + 8 3 2 4 3. + <_> + + <_> + 8 6 3 3 -1. + <_> + 8 7 3 1 3. + <_> + + <_> + 9 6 3 6 -1. + <_> + 9 8 3 2 3. + <_> + + <_> + 4 3 12 12 -1. + <_> + 4 3 6 6 2. + <_> + 10 9 6 6 2. + <_> + + <_> + 13 8 3 2 -1. + <_> + 13 9 3 1 2. + <_> + + <_> + 4 3 10 2 -1. + <_> + 9 3 5 2 2. + <_> + + <_> + 18 14 2 2 -1. + <_> + 18 14 1 1 2. + <_> + 19 15 1 1 2. + <_> + + <_> + 5 6 6 2 -1. + <_> + 8 6 3 2 2. + <_> + + <_> + 0 14 20 5 -1. + <_> + 10 14 10 5 2. + <_> + + <_> + 9 17 2 1 -1. + <_> + 10 17 1 1 2. + <_> + + <_> + 5 16 5 3 -1. + <_> + 5 17 5 1 3. + <_> + + <_> + 9 16 3 2 -1. + <_> + 10 16 1 2 3. + <_> + + <_> + 6 5 5 3 -1. + <_> + 6 6 5 1 3. + <_> + + <_> + 11 12 3 8 -1. + <_> + 12 12 1 8 3. + <_> + + <_> + 4 3 3 9 -1. + <_> + 4 6 3 3 3. + <_> + + <_> + 11 0 3 3 -1. + <_> + 12 0 1 3 3. + <_> + + <_> + 5 17 10 2 -1. + <_> + 5 17 5 1 2. + <_> + 10 18 5 1 2. + <_> + + <_> + 5 15 2 3 -1. + <_> + 5 16 2 1 3. + <_> + + <_> + 6 14 2 4 -1. + <_> + 6 14 1 2 2. + <_> + 7 16 1 2 2. + <_> + + <_> + 10 17 6 3 -1. + <_> + 10 18 6 1 3. + <_> + + <_> + 19 5 1 3 -1. + <_> + 19 6 1 1 3. + <_> + + <_> + 16 13 2 2 -1. + <_> + 16 13 1 1 2. + <_> + 17 14 1 1 2. + <_> + + <_> + 0 11 2 1 -1. + <_> + 1 11 1 1 2. + <_> + + <_> + 4 12 6 6 -1. + <_> + 4 12 3 3 2. + <_> + 7 15 3 3 2. + <_> + + <_> + 5 15 4 3 -1. + <_> + 5 16 4 1 3. + <_> + + <_> + 10 16 3 2 -1. + <_> + 11 16 1 2 3. + <_> + + <_> + 1 0 10 2 -1. + <_> + 1 0 5 1 2. + <_> + 6 1 5 1 2. + <_> + + <_> + 2 0 18 14 -1. + <_> + 11 0 9 14 2. + <_> + + <_> + 15 7 4 7 -1. + <_> + 17 7 2 7 2. + <_> + + <_> + 5 10 2 4 -1. + <_> + 6 10 1 4 2. + <_> + + <_> + 15 16 3 1 -1. + <_> + 16 16 1 1 3. + <_> + + <_> + 7 15 5 3 -1. + <_> + 7 16 5 1 3. + <_> + + <_> + 12 1 6 3 -1. + <_> + 14 1 2 3 3. + <_> + + <_> + 16 2 2 1 -1. + <_> + 17 2 1 1 2. + <_> + + <_> + 17 0 2 2 -1. + <_> + 17 0 1 1 2. + <_> + 18 1 1 1 2. + <_> + + <_> + 1 0 4 6 -1. + <_> + 1 2 4 2 3. + <_> + + <_> + 3 1 6 18 -1. + <_> + 3 7 6 6 3. + <_> + + <_> + 5 1 1 12 -1. + <_> + 5 7 1 6 2. + <_> + + <_> + 16 9 2 2 -1. + <_> + 16 9 1 1 2. + <_> + 17 10 1 1 2. + <_> + + <_> + 4 2 2 11 -1. + <_> + 5 2 1 11 2. + <_> + + <_> + 4 8 3 1 -1. + <_> + 5 8 1 1 3. + <_> + + <_> + 14 18 2 2 -1. + <_> + 14 19 2 1 2. + <_> + + <_> + 10 0 10 10 -1. + <_> + 10 0 5 5 2. + <_> + 15 5 5 5 2. + <_> + + <_> + 19 6 1 2 -1. + <_> + 19 7 1 1 2. + <_> + + <_> + 11 0 6 8 -1. + <_> + 11 0 3 4 2. + <_> + 14 4 3 4 2. + <_> + + <_> + 5 0 2 2 -1. + <_> + 5 0 1 1 2. + <_> + 6 1 1 1 2. + <_> + + <_> + 3 1 9 11 -1. + <_> + 6 1 3 11 3. + <_> + + <_> + 10 11 3 2 -1. + <_> + 10 12 3 1 2. + <_> + + <_> + 10 9 4 2 -1. + <_> + 12 9 2 2 2. + <_> + + <_> + 13 7 1 6 -1. + <_> + 13 9 1 2 3. + <_> + + <_> + 8 10 6 2 -1. + <_> + 8 10 3 1 2. + <_> + 11 11 3 1 2. + <_> + + <_> + 4 11 4 6 -1. + <_> + 4 14 4 3 2. + <_> + + <_> + 17 4 2 3 -1. + <_> + 17 5 2 1 3. + <_> + + <_> + 10 2 8 14 -1. + <_> + 10 2 4 7 2. + <_> + 14 9 4 7 2. + <_> + + <_> + 12 8 8 7 -1. + <_> + 16 8 4 7 2. + <_> + + <_> + 1 2 18 1 -1. + <_> + 7 2 6 1 3. + <_> + + <_> + 0 1 8 19 -1. + <_> + 4 1 4 19 2. + <_> + + <_> + 0 0 8 12 -1. + <_> + 4 0 4 12 2. + <_> + + <_> + 13 5 5 12 -1. + <_> + 13 11 5 6 2. + <_> + + <_> + 7 9 1 4 -1. + <_> + 7 11 1 2 2. + <_> + + <_> + 0 13 10 3 -1. + <_> + 5 13 5 3 2. + <_> + + <_> + 2 7 12 4 -1. + <_> + 6 7 4 4 3. + <_> + + <_> + 9 1 2 6 -1. + <_> + 9 1 1 3 2. + <_> + 10 4 1 3 2. + <_> + + <_> + 6 8 3 3 -1. + <_> + 7 8 1 3 3. + <_> + + <_> + 4 11 3 1 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 5 10 1 2 -1. + <_> + 5 11 1 1 2. + <_> + + <_> + 0 17 4 1 -1. + <_> + 2 17 2 1 2. + <_> + + <_> + 1 16 2 1 -1. + <_> + 2 16 1 1 2. + <_> + + <_> + 7 14 2 3 -1. + <_> + 7 15 2 1 3. + <_> + + <_> + 10 13 2 2 -1. + <_> + 10 14 2 1 2. + <_> + + <_> + 16 11 3 1 -1. + <_> + 17 11 1 1 3. + <_> + + <_> + 16 10 3 2 -1. + <_> + 17 10 1 2 3. + <_> + + <_> + 7 2 3 1 -1. + <_> + 8 2 1 1 3. + <_> + + <_> + 14 4 5 3 -1. + <_> + 14 5 5 1 3. + <_> + + <_> + 7 7 2 3 -1. + <_> + 8 7 1 3 2. + <_> + + <_> + 5 7 6 7 -1. + <_> + 8 7 3 7 2. + <_> + + <_> + 4 2 2 6 -1. + <_> + 4 2 1 3 2. + <_> + 5 5 1 3 2. + <_> + + <_> + 4 9 2 3 -1. + <_> + 4 10 2 1 3. + <_> + + <_> + 8 6 7 12 -1. + <_> + 8 10 7 4 3. + <_> + + <_> + 8 5 2 10 -1. + <_> + 8 10 2 5 2. + <_> + + <_> + 4 3 3 5 -1. + <_> + 5 3 1 5 3. + <_> + + <_> + 9 12 2 1 -1. + <_> + 10 12 1 1 2. + <_> + + <_> + 3 8 3 4 -1. + <_> + 4 8 1 4 3. + <_> + + <_> + 13 14 3 3 -1. + <_> + 13 15 3 1 3. + <_> + + <_> + 1 14 2 3 -1. + <_> + 2 14 1 3 2. + <_> + + <_> + 5 0 2 4 -1. + <_> + 5 0 1 2 2. + <_> + 6 2 1 2 2. + <_> + + <_> + 5 14 4 3 -1. + <_> + 5 15 4 1 3. + <_> + + <_> + 6 12 2 6 -1. + <_> + 6 12 1 3 2. + <_> + 7 15 1 3 2. + <_> + + <_> + 6 13 2 2 -1. + <_> + 7 13 1 2 2. + <_> + + <_> + 9 10 4 5 -1. + <_> + 11 10 2 5 2. + <_> + + <_> + 11 3 2 1 -1. + <_> + 12 3 1 1 2. + <_> + + <_> + 6 7 2 2 -1. + <_> + 6 7 1 1 2. + <_> + 7 8 1 1 2. + <_> + + <_> + 5 3 6 5 -1. + <_> + 7 3 2 5 3. + <_> + + <_> + 5 6 4 8 -1. + <_> + 7 6 2 8 2. + <_> + + <_> + 5 7 6 3 -1. + <_> + 7 7 2 3 3. + <_> + + <_> + 9 12 3 4 -1. + <_> + 10 12 1 4 3. + <_> + + <_> + 16 9 3 1 -1. + <_> + 17 9 1 1 3. + <_> + + <_> + 13 14 3 3 -1. + <_> + 13 15 3 1 3. + <_> + + <_> + 7 13 4 2 -1. + <_> + 7 13 2 1 2. + <_> + 9 14 2 1 2. + <_> + + <_> + 10 13 1 2 -1. + <_> + 10 14 1 1 2. + <_> + + <_> + 9 13 2 3 -1. + <_> + 9 14 2 1 3. + <_> + + <_> + 9 14 2 3 -1. + <_> + 9 15 2 1 3. + <_> + + <_> + 9 6 8 1 -1. + <_> + 13 6 4 1 2. + <_> + + <_> + 6 8 3 2 -1. + <_> + 6 9 3 1 2. + <_> + + <_> + 5 6 2 3 -1. + <_> + 6 6 1 3 2. + <_> + + <_> + 12 10 2 6 -1. + <_> + 12 13 2 3 2. + <_> + + <_> + 1 0 18 2 -1. + <_> + 7 0 6 2 3. + <_> + + <_> + 9 7 4 6 -1. + <_> + 9 7 2 3 2. + <_> + 11 10 2 3 2. + <_> + + <_> + 12 10 2 4 -1. + <_> + 13 10 1 4 2. + <_> + + <_> + 13 12 1 2 -1. + <_> + 13 13 1 1 2. + <_> + + <_> + 13 18 2 2 -1. + <_> + 14 18 1 2 2. + <_> + + <_> + 15 4 2 1 -1. + <_> + 16 4 1 1 2. + <_> + + <_> + 5 7 6 3 -1. + <_> + 7 7 2 3 3. + <_> + + <_> + 5 8 8 3 -1. + <_> + 9 8 4 3 2. + <_> + + <_> + 6 12 6 3 -1. + <_> + 9 12 3 3 2. + <_> + + <_> + 12 14 3 6 -1. + <_> + 13 14 1 6 3. + <_> + + <_> + 18 9 2 8 -1. + <_> + 18 9 1 4 2. + <_> + 19 13 1 4 2. + <_> + + <_> + 5 5 7 3 -1. + <_> + 5 6 7 1 3. + <_> + + <_> + 10 13 2 2 -1. + <_> + 10 13 1 1 2. + <_> + 11 14 1 1 2. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + <_> + + <_> + 9 13 4 2 -1. + <_> + 9 13 2 1 2. + <_> + 11 14 2 1 2. + <_> + + <_> + 7 12 1 3 -1. + <_> + 7 13 1 1 3. + <_> + + <_> + 7 10 3 6 -1. + <_> + 7 12 3 2 3. + <_> + + <_> + 13 8 4 4 -1. + <_> + 13 10 4 2 2. + <_> + + <_> + 8 0 12 18 -1. + <_> + 8 9 12 9 2. + <_> + + <_> + 18 9 2 10 -1. + <_> + 18 9 1 5 2. + <_> + 19 14 1 5 2. + <_> + + <_> + 14 2 3 6 -1. + <_> + 14 5 3 3 2. + <_> + + <_> + 10 0 3 14 -1. + <_> + 11 0 1 14 3. + <_> + + <_> + 6 16 8 4 -1. + <_> + 6 16 4 2 2. + <_> + 10 18 4 2 2. + <_> + + <_> + 5 3 5 12 -1. + <_> + 5 7 5 4 3. + <_> + + <_> + 4 15 6 3 -1. + <_> + 4 16 6 1 3. + <_> + + <_> + 6 15 1 3 -1. + <_> + 6 16 1 1 3. + <_> + + <_> + 13 1 2 1 -1. + <_> + 14 1 1 1 2. + <_> + + <_> + 2 2 18 9 -1. + <_> + 11 2 9 9 2. + <_> + + <_> + 4 16 2 4 -1. + <_> + 4 16 1 2 2. + <_> + 5 18 1 2 2. + <_> + + <_> + 15 1 3 8 -1. + <_> + 16 1 1 8 3. + <_> + + <_> + 11 11 2 3 -1. + <_> + 11 12 2 1 3. + <_> + + <_> + 9 9 2 4 -1. + <_> + 9 11 2 2 2. + <_> + + <_> + 5 9 8 4 -1. + <_> + 5 9 4 2 2. + <_> + 9 11 4 2 2. + <_> + + <_> + 9 6 2 3 -1. + <_> + 9 7 2 1 3. + <_> + + <_> + 7 9 2 3 -1. + <_> + 7 10 2 1 3. + <_> + + <_> + 11 15 4 3 -1. + <_> + 11 16 4 1 3. + <_> + + <_> + 8 6 2 3 -1. + <_> + 8 7 2 1 3. + <_> + + <_> + 6 8 2 3 -1. + <_> + 6 9 2 1 3. + <_> + + <_> + 6 9 6 3 -1. + <_> + 8 9 2 3 3. + <_> + + <_> + 6 9 4 2 -1. + <_> + 6 9 2 1 2. + <_> + 8 10 2 1 2. + <_> + + <_> + 4 7 9 1 -1. + <_> + 7 7 3 1 3. + <_> + + <_> + 5 7 2 6 -1. + <_> + 5 7 1 3 2. + <_> + 6 10 1 3 2. + <_> + + <_> + 4 8 4 8 -1. + <_> + 4 12 4 4 2. + <_> + + <_> + 7 0 2 19 -1. + <_> + 8 0 1 19 2. + <_> + + <_> + 5 9 1 3 -1. + <_> + 5 10 1 1 3. + <_> + + <_> + 9 5 3 1 -1. + <_> + 10 5 1 1 3. + <_> + + <_> + 16 4 3 6 -1. + <_> + 16 6 3 2 3. + <_> + + <_> + 10 15 5 3 -1. + <_> + 10 16 5 1 3. + <_> + + <_> + 13 1 5 14 -1. + <_> + 13 8 5 7 2. + <_> + + <_> + 3 0 4 4 -1. + <_> + 3 0 2 2 2. + <_> + 5 2 2 2 2. + <_> + + <_> + 6 5 4 13 -1. + <_> + 8 5 2 13 2. + <_> + + <_> + 4 2 2 16 -1. + <_> + 4 2 1 8 2. + <_> + 5 10 1 8 2. + <_> + + <_> + 4 8 8 3 -1. + <_> + 8 8 4 3 2. + <_> + + <_> + 5 6 2 12 -1. + <_> + 5 12 2 6 2. + <_> + + <_> + 8 7 2 4 -1. + <_> + 9 7 1 4 2. + <_> + + <_> + 13 9 5 4 -1. + <_> + 13 11 5 2 2. + <_> + + <_> + 12 0 8 2 -1. + <_> + 12 0 4 1 2. + <_> + 16 1 4 1 2. + <_> + + <_> + 14 0 6 4 -1. + <_> + 14 0 3 2 2. + <_> + 17 2 3 2 2. + <_> + + <_> + 4 9 6 2 -1. + <_> + 6 9 2 2 3. + <_> + + <_> + 13 1 2 1 -1. + <_> + 14 1 1 1 2. + <_> + + <_> + 0 0 12 3 -1. + <_> + 6 0 6 3 2. + <_> + + <_> + 5 12 3 3 -1. + <_> + 6 12 1 3 3. + <_> + + <_> + 5 11 4 3 -1. + <_> + 5 12 4 1 3. + <_> + + <_> + 5 13 2 4 -1. + <_> + 5 13 1 2 2. + <_> + 6 15 1 2 2. + <_> + + <_> + 4 11 3 3 -1. + <_> + 4 12 3 1 3. + <_> + + <_> + 1 8 6 2 -1. + <_> + 1 9 6 1 2. + <_> + + <_> + 6 8 4 12 -1. + <_> + 6 12 4 4 3. + <_> + + <_> + 7 14 6 4 -1. + <_> + 7 14 3 2 2. + <_> + 10 16 3 2 2. + <_> + + <_> + 8 16 8 4 -1. + <_> + 8 16 4 2 2. + <_> + 12 18 4 2 2. + <_> + + <_> + 5 10 10 6 -1. + <_> + 5 12 10 2 3. + <_> + + <_> + 6 13 1 3 -1. + <_> + 6 14 1 1 3. + <_> + + <_> + 3 11 4 6 -1. + <_> + 3 13 4 2 3. + <_> + + <_> + 10 14 6 3 -1. + <_> + 10 15 6 1 3. + <_> + + <_> + 3 15 4 2 -1. + <_> + 5 15 2 2 2. + <_> + + <_> + 3 14 4 3 -1. + <_> + 5 14 2 3 2. + <_> + + <_> + 1 2 1 2 -1. + <_> + 1 3 1 1 2. + <_> + + <_> + 0 12 8 4 -1. + <_> + 4 12 4 4 2. + <_> + + <_> + 1 2 1 2 -1. + <_> + 1 3 1 1 2. + <_> + + <_> + 5 11 1 3 -1. + <_> + 5 12 1 1 3. + <_> + + <_> + 10 19 2 1 -1. + <_> + 11 19 1 1 2. + <_> + + <_> + 6 6 4 4 -1. + <_> + 6 6 2 2 2. + <_> + 8 8 2 2 2. + <_> + + <_> + 6 3 1 2 -1. + <_> + 6 4 1 1 2. + <_> + + <_> + 0 4 10 2 -1. + <_> + 5 4 5 2 2. + <_> + + <_> + 4 5 2 1 -1. + <_> + 5 5 1 1 2. + <_> + + <_> + 0 12 2 1 -1. + <_> + 1 12 1 1 2. + <_> + + <_> + 1 4 6 11 -1. + <_> + 3 4 2 11 3. + <_> + + <_> + 6 4 2 1 -1. + <_> + 7 4 1 1 2. + <_> + + <_> + 7 0 1 6 -1. + <_> + 7 2 1 2 3. + <_> + + <_> + 7 0 8 4 -1. + <_> + 7 2 8 2 2. + <_> + + <_> + 13 6 2 2 -1. + <_> + 13 7 2 1 2. + <_> + + <_> + 16 15 2 2 -1. + <_> + 16 15 1 1 2. + <_> + 17 16 1 1 2. + <_> + + <_> + 11 12 1 2 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 4 4 5 2 -1. + <_> + 4 5 5 1 2. + <_> + + <_> + 4 3 3 9 -1. + <_> + 4 6 3 3 3. + <_> + + <_> + 6 7 2 3 -1. + <_> + 7 7 1 3 2. + <_> + + <_> + 4 8 6 1 -1. + <_> + 7 8 3 1 2. + <_> + + <_> + 3 8 12 5 -1. + <_> + 9 8 6 5 2. + <_> + + <_> + 9 8 1 3 -1. + <_> + 9 9 1 1 3. + <_> + + <_> + 9 9 6 1 -1. + <_> + 12 9 3 1 2. + <_> + + <_> + 13 7 7 6 -1. + <_> + 13 9 7 2 3. + <_> + + <_> + 0 2 20 18 -1. + <_> + 10 2 10 18 2. + <_> + + <_> + 12 5 6 3 -1. + <_> + 12 6 6 1 3. + <_> + + <_> + 8 8 3 2 -1. + <_> + 8 9 3 1 2. + <_> + + <_> + 4 9 11 6 -1. + <_> + 4 11 11 2 3. + <_> + + <_> + 7 7 7 6 -1. + <_> + 7 10 7 3 2. + <_> + + <_> + 15 7 2 8 -1. + <_> + 15 7 1 4 2. + <_> + 16 11 1 4 2. + <_> + + <_> + 4 10 2 6 -1. + <_> + 4 12 2 2 3. + <_> + + <_> + 7 13 2 2 -1. + <_> + 7 13 1 1 2. + <_> + 8 14 1 1 2. + <_> + + <_> + 7 2 3 4 -1. + <_> + 8 2 1 4 3. + <_> + + <_> + 7 3 2 3 -1. + <_> + 8 3 1 3 2. + <_> + + <_> + 5 9 3 1 -1. + <_> + 6 9 1 1 3. + <_> + + <_> + 14 6 3 8 -1. + <_> + 15 6 1 8 3. + <_> + + <_> + 4 10 2 6 -1. + <_> + 4 13 2 3 2. + <_> + + <_> + 0 17 10 3 -1. + <_> + 0 18 10 1 3. + <_> + + <_> + 5 18 7 2 -1. + <_> + 5 19 7 1 2. + <_> + + <_> + 13 12 1 3 -1. + <_> + 13 13 1 1 3. + <_> + + <_> + 9 2 4 16 -1. + <_> + 9 2 2 8 2. + <_> + 11 10 2 8 2. + <_> + + <_> + 6 7 2 3 -1. + <_> + 6 8 2 1 3. + <_> + + <_> + 9 8 2 4 -1. + <_> + 9 10 2 2 2. + <_> + + <_> + 18 4 2 3 -1. + <_> + 18 5 2 1 3. + <_> + + <_> + 16 10 2 2 -1. + <_> + 16 10 1 1 2. + <_> + 17 11 1 1 2. + <_> + + <_> + 14 2 6 6 -1. + <_> + 14 4 6 2 3. + <_> + + <_> + 16 11 3 1 -1. + <_> + 17 11 1 1 3. + <_> + + <_> + 17 10 2 1 -1. + <_> + 18 10 1 1 2. + <_> + + <_> + 16 8 2 4 -1. + <_> + 17 8 1 4 2. + <_> + + <_> + 11 15 6 3 -1. + <_> + 11 16 6 1 3. + <_> + + <_> + 3 7 3 4 -1. + <_> + 4 7 1 4 3. + <_> + + <_> + 3 5 3 5 -1. + <_> + 4 5 1 5 3. + <_> + + <_> + 2 10 6 1 -1. + <_> + 5 10 3 1 2. + <_> + + <_> + 12 0 4 2 -1. + <_> + 14 0 2 2 2. + <_> + + <_> + 9 14 1 2 -1. + <_> + 9 15 1 1 2. + <_> + + <_> + 15 12 5 6 -1. + <_> + 15 14 5 2 3. + <_> + + <_> + 4 13 10 4 -1. + <_> + 4 15 10 2 2. + <_> + + <_> + 7 16 6 4 -1. + <_> + 7 16 3 2 2. + <_> + 10 18 3 2 2. + <_> + + <_> + 9 16 7 3 -1. + <_> + 9 17 7 1 3. + <_> + + <_> + 4 8 2 2 -1. + <_> + 4 8 1 1 2. + <_> + 5 9 1 1 2. + <_> + + <_> + 0 17 20 2 -1. + <_> + 10 17 10 2 2. + <_> + + <_> + 4 8 3 1 -1. + <_> + 5 8 1 1 3. + <_> + + <_> + 4 7 2 6 -1. + <_> + 4 7 1 3 2. + <_> + 5 10 1 3 2. + <_> + + <_> + 11 11 1 2 -1. + <_> + 11 12 1 1 2. + <_> + + <_> + 10 13 5 2 -1. + <_> + 10 14 5 1 2. + <_> + + <_> + 8 16 3 3 -1. + <_> + 8 17 3 1 3. + <_> + + <_> + 9 18 3 1 -1. + <_> + 10 18 1 1 3. + <_> + + <_> + 8 6 11 12 -1. + <_> + 8 10 11 4 3. + <_> + + <_> + 2 4 13 12 -1. + <_> + 2 10 13 6 2. + <_> + + <_> + 0 15 10 4 -1. + <_> + 0 15 5 2 2. + <_> + 5 17 5 2 2. + <_> + + <_> + 4 8 6 2 -1. + <_> + 7 8 3 2 2. + <_> + + <_> + 10 1 6 2 -1. + <_> + 12 1 2 2 3. + <_> + + <_> + 7 8 6 7 -1. + <_> + 9 8 2 7 3. + <_> + + <_> + 9 9 6 2 -1. + <_> + 11 9 2 2 3. + <_> + + <_> + 3 14 15 4 -1. + <_> + 8 14 5 4 3. + <_> + + <_> + 7 3 2 14 -1. + <_> + 7 10 2 7 2. + <_> + + <_> + 11 14 1 2 -1. + <_> + 11 15 1 1 2. + <_> + + <_> + 5 11 1 3 -1. + <_> + 5 12 1 1 3. + <_> + + <_> + 11 14 3 3 -1. + <_> + 11 15 3 1 3. + <_> + + <_> + 10 7 9 4 -1. + <_> + 13 7 3 4 3. + <_> + + <_> + 11 6 6 5 -1. + <_> + 14 6 3 5 2. + <_> + + <_> + 8 9 1 2 -1. + <_> + 8 10 1 1 2. + <_> + + <_> + 16 3 1 10 -1. + <_> + 16 8 1 5 2. + <_> + + <_> + 6 11 10 4 -1. + <_> + 6 13 10 2 2. + <_> + + <_> + 5 7 2 2 -1. + <_> + 6 7 1 2 2. + <_> + + <_> + 1 6 6 11 -1. + <_> + 4 6 3 11 2. + <_> + + <_> + 6 8 3 2 -1. + <_> + 6 9 3 1 2. + <_> + + <_> + 10 15 1 2 -1. + <_> + 10 16 1 1 2. + <_> + + <_> + 8 0 12 1 -1. + <_> + 14 0 6 1 2. + <_> + + <_> + 5 3 2 2 -1. + <_> + 6 3 1 2 2. + <_> + + <_> + 11 6 6 5 -1. + <_> + 14 6 3 5 2. + <_> + + <_> + 6 12 3 3 -1. + <_> + 6 13 3 1 3. + <_> + + <_> + 10 10 3 3 -1. + <_> + 11 10 1 3 3. + <_> + + <_> + 6 13 2 2 -1. + <_> + 6 14 2 1 2. + <_> + + <_> + 4 2 16 8 -1. + <_> + 12 2 8 8 2. + <_> + + <_> + 10 12 2 2 -1. + <_> + 10 12 1 1 2. + <_> + 11 13 1 1 2. + <_> + + <_> + 10 7 2 2 -1. + <_> + 11 7 1 2 2. + <_> + + <_> + 13 13 1 3 -1. + <_> + 13 14 1 1 3. + <_> + + <_> + 13 13 2 3 -1. + <_> + 13 14 2 1 3. + <_> + + <_> + 1 13 6 4 -1. + <_> + 4 13 3 4 2. + <_> + + <_> + 10 13 2 1 -1. + <_> + 11 13 1 1 2. + <_> + + <_> + 10 6 2 10 -1. + <_> + 10 6 1 5 2. + <_> + 11 11 1 5 2. + <_> + + <_> + 16 11 2 2 -1. + <_> + 16 11 1 1 2. + <_> + 17 12 1 1 2. + <_> + + <_> + 16 12 3 1 -1. + <_> + 17 12 1 1 3. + <_> + + <_> + 9 5 7 12 -1. + <_> + 9 9 7 4 3. + <_> + + <_> + 4 1 10 18 -1. + <_> + 4 1 5 9 2. + <_> + 9 10 5 9 2. + <_> + + <_> + 17 12 2 2 -1. + <_> + 17 12 1 1 2. + <_> + 18 13 1 1 2. + <_> + + <_> + 12 5 6 2 -1. + <_> + 12 6 6 1 2. + <_> + + <_> + 4 7 5 2 -1. + <_> + 4 8 5 1 2. + <_> + + <_> + 7 3 1 2 -1. + <_> + 7 4 1 1 2. + <_> + + <_> + 6 0 7 6 -1. + <_> + 6 3 7 3 2. + <_> + + <_> + 13 11 2 8 -1. + <_> + 13 11 1 4 2. + <_> + 14 15 1 4 2. + <_> + + <_> + 8 7 4 2 -1. + <_> + 10 7 2 2 2. + <_> + + <_> + 4 1 2 4 -1. + <_> + 4 1 1 2 2. + <_> + 5 3 1 2 2. + <_> + + <_> + 4 0 2 8 -1. + <_> + 4 0 1 4 2. + <_> + 5 4 1 4 2. + <_> + + <_> + 6 3 2 1 -1. + <_> + 7 3 1 1 2. + <_> + + <_> + 14 12 1 3 -1. + <_> + 14 13 1 1 3. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 5 11 2 2 -1. + <_> + 5 12 2 1 2. + <_> + + <_> + 5 1 4 15 -1. + <_> + 5 6 4 5 3. + <_> + + <_> + 11 5 4 14 -1. + <_> + 11 5 2 7 2. + <_> + 13 12 2 7 2. + <_> + + <_> + 9 18 3 1 -1. + <_> + 10 18 1 1 3. + <_> + + <_> + 4 10 5 6 -1. + <_> + 4 12 5 2 3. + <_> + + <_> + 5 13 3 3 -1. + <_> + 5 14 3 1 3. + <_> + + <_> + 8 1 3 5 -1. + <_> + 9 1 1 5 3. + <_> + + <_> + 4 7 3 2 -1. + <_> + 5 7 1 2 3. + <_> + + <_> + 6 14 3 3 -1. + <_> + 7 14 1 3 3. + <_> + + <_> + 7 13 2 3 -1. + <_> + 7 14 2 1 3. + <_> + + <_> + 4 3 2 9 -1. + <_> + 4 6 2 3 3. + <_> + + <_> + 4 8 3 2 -1. + <_> + 4 9 3 1 2. + <_> + + <_> + 10 10 2 2 -1. + <_> + 10 11 2 1 2. + <_> + + <_> + 7 8 12 6 -1. + <_> + 7 8 6 3 2. + <_> + 13 11 6 3 2. + <_> + + <_> + 14 10 3 2 -1. + <_> + 14 11 3 1 2. + <_> + + <_> + 5 16 6 2 -1. + <_> + 5 17 6 1 2. + <_> + + <_> + 8 15 4 3 -1. + <_> + 8 16 4 1 3. + <_> + + <_> + 14 9 2 2 -1. + <_> + 14 10 2 1 2. + <_> + + <_> + 8 5 2 3 -1. + <_> + 8 6 2 1 3. + <_> + + <_> + 8 5 3 3 -1. + <_> + 8 6 3 1 3. + <_> + + <_> + 1 7 17 9 -1. + <_> + 1 10 17 3 3. + <_> + + <_> + 5 10 6 8 -1. + <_> + 5 14 6 4 2. + <_> + + <_> + 18 1 2 2 -1. + <_> + 18 1 1 1 2. + <_> + 19 2 1 1 2. + <_> + + <_> + 0 0 11 6 -1. + <_> + 0 3 11 3 2. + <_> + + <_> + 3 0 16 3 -1. + <_> + 3 1 16 1 3. + <_> + + <_> + 10 10 10 3 -1. + <_> + 10 11 10 1 3. + <_> + + <_> + 0 0 15 18 -1. + <_> + 0 9 15 9 2. + <_> + + <_> + 15 11 2 2 -1. + <_> + 15 11 1 1 2. + <_> + 16 12 1 1 2. + <_> + + <_> + 14 12 6 3 -1. + <_> + 17 12 3 3 2. + <_> + + <_> + 8 4 3 4 -1. + <_> + 9 4 1 4 3. + <_> + + <_> + 8 6 12 4 -1. + <_> + 12 6 4 4 3. + <_> + + <_> + 9 12 2 2 -1. + <_> + 9 13 2 1 2. + <_> + + <_> + 6 3 1 2 -1. + <_> + 6 4 1 1 2. + <_> + + <_> + 4 7 2 8 -1. + <_> + 4 7 1 4 2. + <_> + 5 11 1 4 2. + <_> + + <_> + 9 17 3 2 -1. + <_> + 10 17 1 2 3. + <_> + + <_> + 9 6 1 3 -1. + <_> + 9 7 1 1 3. + <_> + + <_> + 6 4 1 6 -1. + <_> + 6 7 1 3 2. + <_> + + <_> + 5 6 13 6 -1. + <_> + 5 8 13 2 3. + <_> + + <_> + 6 7 4 12 -1. + <_> + 8 7 2 12 2. + <_> + + <_> + 6 12 2 4 -1. + <_> + 7 12 1 4 2. + <_> + + <_> + 5 14 4 3 -1. + <_> + 5 15 4 1 3. + <_> + + <_> + 10 5 3 1 -1. + <_> + 11 5 1 1 3. + <_> + + <_> + 4 15 4 3 -1. + <_> + 4 16 4 1 3. + <_> + + <_> + 11 12 3 2 -1. + <_> + 12 12 1 2 3. + <_> + + <_> + 11 10 8 2 -1. + <_> + 15 10 4 2 2. + <_> + + <_> + 14 18 6 2 -1. + <_> + 17 18 3 2 2. + <_> + + <_> + 7 5 3 2 -1. + <_> + 8 5 1 2 3. + <_> + + <_> + 11 8 2 1 -1. + <_> + 12 8 1 1 2. + <_> + + <_> + 12 6 3 6 -1. + <_> + 12 8 3 2 3. + <_> + + <_> + 11 9 1 2 -1. + <_> + 11 10 1 1 2. + <_> + + <_> + 12 9 3 9 -1. + <_> + 13 9 1 9 3. + <_> + + <_> + 0 8 1 3 -1. + <_> + 0 9 1 1 3. + <_> + + <_> + 0 8 1 3 -1. + <_> + 0 9 1 1 3. + <_> + + <_> + 3 8 2 2 -1. + <_> + 3 8 1 1 2. + <_> + 4 9 1 1 2. + <_> + + <_> + 4 6 2 6 -1. + <_> + 4 9 2 3 2. + <_> + + <_> + 4 9 2 9 -1. + <_> + 4 12 2 3 3. + <_> + + <_> + 7 13 2 2 -1. + <_> + 7 13 1 1 2. + <_> + 8 14 1 1 2. + <_> + + <_> + 3 6 10 6 -1. + <_> + 3 6 5 3 2. + <_> + 8 9 5 3 2. + <_> + + <_> + 9 9 4 6 -1. + <_> + 11 9 2 6 2. + <_> + + <_> + 2 12 14 3 -1. + <_> + 9 12 7 3 2. + <_> + + <_> + 0 0 11 18 -1. + <_> + 0 9 11 9 2. + <_> + + <_> + 4 18 4 2 -1. + <_> + 4 18 2 1 2. + <_> + 6 19 2 1 2. + <_> + + <_> + 7 13 4 6 -1. + <_> + 7 13 2 3 2. + <_> + 9 16 2 3 2. + <_> + + <_> + 8 17 3 1 -1. + <_> + 9 17 1 1 3. + <_> + + <_> + 5 14 8 6 -1. + <_> + 5 14 4 3 2. + <_> + 9 17 4 3 2. + <_> + + <_> + 7 12 2 3 -1. + <_> + 7 13 2 1 3. + <_> + + <_> + 14 4 4 2 -1. + <_> + 14 4 2 1 2. + <_> + 16 5 2 1 2. + <_> + + <_> + 7 13 2 3 -1. + <_> + 7 14 2 1 3. + <_> + + <_> + 7 14 4 2 -1. + <_> + 7 14 2 1 2. + <_> + 9 15 2 1 2. + <_> + + <_> + 10 14 2 6 -1. + <_> + 10 16 2 2 3. + <_> + + <_> + 9 6 9 1 -1. + <_> + 12 6 3 1 3. + <_> + + <_> + 2 5 18 7 -1. + <_> + 11 5 9 7 2. + <_> + + <_> + 18 6 1 2 -1. + <_> + 18 7 1 1 2. + <_> + + <_> + 4 14 14 6 -1. + <_> + 4 17 14 3 2. + <_> + + <_> + 8 0 6 20 -1. + <_> + 10 0 2 20 3. + <_> + + <_> + 12 0 8 18 -1. + <_> + 12 9 8 9 2. + <_> + + <_> + 12 5 2 1 -1. + <_> + 13 5 1 1 2. + <_> + + <_> + 0 6 6 13 -1. + <_> + 3 6 3 13 2. + <_> + + <_> + 3 15 3 4 -1. + <_> + 4 15 1 4 3. + <_> + + <_> + 3 13 3 6 -1. + <_> + 4 13 1 6 3. + <_> + + <_> + 3 11 9 2 -1. + <_> + 6 11 3 2 3. + <_> + + <_> + 0 11 6 8 -1. + <_> + 3 11 3 8 2. + <_> + + <_> + 16 0 3 7 -1. + <_> + 17 0 1 7 3. + <_> + + <_> + 16 1 2 6 -1. + <_> + 16 1 1 3 2. + <_> + 17 4 1 3 2. + <_> + + <_> + 3 7 6 10 -1. + <_> + 3 7 3 5 2. + <_> + 6 12 3 5 2. + <_> + + <_> + 2 0 6 7 -1. + <_> + 5 0 3 7 2. + <_> + + <_> + 1 2 12 2 -1. + <_> + 5 2 4 2 3. + <_> + + <_> + 6 4 1 2 -1. + <_> + 6 5 1 1 2. + <_> + + <_> + 0 14 8 6 -1. + <_> + 4 14 4 6 2. + <_> + + <_> + 3 11 9 3 -1. + <_> + 6 11 3 3 3. + <_> + + <_> + 4 14 2 2 -1. + <_> + 4 14 1 1 2. + <_> + 5 15 1 1 2. + <_> + + <_> + 11 2 3 2 -1. + <_> + 12 2 1 2 3. + <_> + + <_> + 18 5 2 6 -1. + <_> + 18 5 1 3 2. + <_> + 19 8 1 3 2. + <_> + + <_> + 0 5 1 2 -1. + <_> + 0 6 1 1 2. + <_> + + <_> + 8 4 6 1 -1. + <_> + 11 4 3 1 2. + <_> + + <_> + 4 5 2 3 -1. + <_> + 5 5 1 3 2. + <_> + + <_> + 1 3 6 4 -1. + <_> + 3 3 2 4 3. + <_> + + <_> + 12 5 6 1 -1. + <_> + 14 5 2 1 3. + <_> + + <_> + 6 9 3 3 -1. + <_> + 6 10 3 1 3. + <_> + + <_> + 4 3 2 2 -1. + <_> + 4 4 2 1 2. + <_> + + <_> + 8 7 3 3 -1. + <_> + 8 8 3 1 3. + <_> + + <_> + 5 5 10 14 -1. + <_> + 5 5 5 7 2. + <_> + 10 12 5 7 2. + <_> + + <_> + 16 5 2 6 -1. + <_> + 16 7 2 2 3. + <_> + + <_> + 19 5 1 3 -1. + <_> + 19 6 1 1 3. + <_> + + <_> + 3 6 2 2 -1. + <_> + 3 6 1 1 2. + <_> + 4 7 1 1 2. + <_> + + <_> + 0 1 10 10 -1. + <_> + 5 1 5 10 2. + <_> + + <_> + 3 0 8 1 -1. + <_> + 7 0 4 1 2. + <_> + + <_> + 14 5 6 1 -1. + <_> + 16 5 2 1 3. + <_> + + <_> + 6 16 1 3 -1. + <_> + 6 17 1 1 3. + <_> + + <_> + 6 14 2 4 -1. + <_> + 6 14 1 2 2. + <_> + 7 16 1 2 2. + <_> + + <_> + 0 7 2 5 -1. + <_> + 1 7 1 5 2. + <_> + + <_> + 18 0 2 8 -1. + <_> + 18 0 1 4 2. + <_> + 19 4 1 4 2. + <_> + + <_> + 5 8 6 2 -1. + <_> + 8 8 3 2 2. + <_> + + <_> + 4 8 8 3 -1. + <_> + 8 8 4 3 2. + <_> + + <_> + 8 0 2 2 -1. + <_> + 8 1 2 1 2. + <_> + + <_> + 13 8 6 11 -1. + <_> + 15 8 2 11 3. + <_> + + <_> + 11 15 9 5 -1. + <_> + 14 15 3 5 3. + <_> + + <_> + 5 4 12 15 -1. + <_> + 9 4 4 15 3. + <_> + + <_> + 16 12 2 8 -1. + <_> + 16 12 1 4 2. + <_> + 17 16 1 4 2. + <_> + + <_> + 7 13 10 6 -1. + <_> + 7 16 10 3 2. + <_> + + <_> + 6 15 3 4 -1. + <_> + 6 17 3 2 2. + <_> + + <_> + 9 5 8 2 -1. + <_> + 13 5 4 2 2. + <_> + + <_> + 5 6 3 4 -1. + <_> + 6 6 1 4 3. + <_> + + <_> + 10 8 7 6 -1. + <_> + 10 10 7 2 3. + <_> + + <_> + 12 13 1 4 -1. + <_> + 12 15 1 2 2. + <_> + + <_> + 2 10 3 4 -1. + <_> + 3 10 1 4 3. + <_> + + <_> + 8 7 6 6 -1. + <_> + 8 7 3 3 2. + <_> + 11 10 3 3 2. + <_> + + <_> + 2 0 15 2 -1. + <_> + 7 0 5 2 3. + <_> + + <_> + 13 10 1 3 -1. + <_> + 13 11 1 1 3. + <_> + + <_> + 2 9 3 4 -1. + <_> + 3 9 1 4 3. + <_> + + <_> + 6 4 3 2 -1. + <_> + 6 5 3 1 2. + <_> + + <_> + 10 16 2 3 -1. + <_> + 11 16 1 3 2. + <_> + + <_> + 7 13 2 3 -1. + <_> + 7 14 2 1 3. + <_> + + <_> + 6 12 2 4 -1. + <_> + 6 12 1 2 2. + <_> + 7 14 1 2 2. + <_> + + <_> + 9 1 6 1 -1. + <_> + 12 1 3 1 2. + <_> + + <_> + 6 6 3 4 -1. + <_> + 7 6 1 4 3. + <_> + + <_> + 9 8 3 3 -1. + <_> + 9 9 3 1 3. + <_> + + <_> + 8 7 12 3 -1. + <_> + 14 7 6 3 2. + <_> + + <_> + 12 10 4 2 -1. + <_> + 12 10 2 1 2. + <_> + 14 11 2 1 2. + <_> + + <_> + 16 11 1 2 -1. + <_> + 16 12 1 1 2. + <_> + + <_> + 6 2 1 2 -1. + <_> + 6 3 1 1 2. + <_> + + <_> + 5 10 2 3 -1. + <_> + 5 11 2 1 3. + <_> + + <_> + 5 9 2 3 -1. + <_> + 5 10 2 1 3. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 12 0 8 2 -1. + <_> + 12 0 4 1 2. + <_> + 16 1 4 1 2. + <_> + + <_> + 10 11 3 8 -1. + <_> + 11 11 1 8 3. + <_> + + <_> + 5 11 3 3 -1. + <_> + 5 12 3 1 3. + <_> + + <_> + 5 10 1 6 -1. + <_> + 5 13 1 3 2. + <_> + + <_> + 6 2 6 6 -1. + <_> + 6 2 3 3 2. + <_> + 9 5 3 3 2. + <_> + + <_> + 11 4 1 6 -1. + <_> + 11 6 1 2 3. + <_> + + <_> + 18 3 2 16 -1. + <_> + 18 3 1 8 2. + <_> + 19 11 1 8 2. + <_> + + <_> + 10 12 3 2 -1. + <_> + 11 12 1 2 3. + <_> + + <_> + 7 14 2 3 -1. + <_> + 7 15 2 1 3. + <_> + + <_> + 16 12 2 1 -1. + <_> + 17 12 1 1 2. + <_> + + <_> + 15 6 4 2 -1. + <_> + 15 7 4 1 2. + <_> + + <_> + 4 6 2 3 -1. + <_> + 4 7 2 1 3. + <_> + + <_> + 8 19 6 1 -1. + <_> + 11 19 3 1 2. + <_> + + <_> + 9 12 3 3 -1. + <_> + 9 13 3 1 3. + <_> + + <_> + 10 12 1 3 -1. + <_> + 10 13 1 1 3. + <_> + + <_> + 8 6 2 3 -1. + <_> + 8 7 2 1 3. + <_> + + <_> + 5 7 6 5 -1. + <_> + 8 7 3 5 2. + <_> + + <_> + 14 10 1 2 -1. + <_> + 14 11 1 1 2. + <_> + + <_> + 11 7 6 3 -1. + <_> + 13 7 2 3 3. + <_> + + <_> + 14 6 6 1 -1. + <_> + 16 6 2 1 3. + <_> + + <_> + 9 7 1 3 -1. + <_> + 9 8 1 1 3. + <_> + + <_> + 9 5 2 8 -1. + <_> + 9 5 1 4 2. + <_> + 10 9 1 4 2. + <_> + + <_> + 6 12 1 4 -1. + <_> + 6 14 1 2 2. + <_> + + <_> + 5 13 4 2 -1. + <_> + 5 14 4 1 2. + <_> + + <_> + 12 9 2 4 -1. + <_> + 12 11 2 2 2. + <_> + + <_> + 12 7 3 6 -1. + <_> + 13 7 1 6 3. + <_> + + <_> + 5 0 2 14 -1. + <_> + 5 7 2 7 2. + <_> + + <_> + 9 3 1 2 -1. + <_> + 9 4 1 1 2. + <_> + + <_> + 6 1 14 12 -1. + <_> + 6 5 14 4 3. + <_> + + <_> + 13 6 7 6 -1. + <_> + 13 9 7 3 2. + <_> + + <_> + 14 9 3 3 -1. + <_> + 14 10 3 1 3. + <_> + + <_> + 17 12 3 1 -1. + <_> + 18 12 1 1 3. + <_> + + <_> + 8 2 3 2 -1. + <_> + 9 2 1 2 3. + <_> + + <_> + 7 11 2 1 -1. + <_> + 8 11 1 1 2. + <_> + + <_> + 5 7 3 2 -1. + <_> + 5 8 3 1 2. + <_> + + <_> + 11 11 2 1 -1. + <_> + 12 11 1 1 2. + <_> + + <_> + 11 11 3 1 -1. + <_> + 12 11 1 1 3. + <_> + + <_> + 9 5 1 3 -1. + <_> + 9 6 1 1 3. + <_> + + <_> + 12 9 1 2 -1. + <_> + 12 10 1 1 2. + <_> + + <_> + 12 7 2 3 -1. + <_> + 13 7 1 3 2. + <_> + + <_> + 5 11 6 3 -1. + <_> + 8 11 3 3 2. + <_> + + <_> + 6 10 2 2 -1. + <_> + 6 10 1 1 2. + <_> + 7 11 1 1 2. + <_> + + <_> + 17 2 1 9 -1. + <_> + 17 5 1 3 3. + <_> + + <_> + 4 7 2 6 -1. + <_> + 4 7 1 3 2. + <_> + 5 10 1 3 2. + <_> + + <_> + 0 1 11 18 -1. + <_> + 0 10 11 9 2. + <_> + + <_> + 7 6 2 8 -1. + <_> + 7 10 2 4 2. + <_> + + <_> + 6 2 4 6 -1. + <_> + 6 5 4 3 2. + <_> + + <_> + 2 12 12 4 -1. + <_> + 2 14 12 2 2. + <_> + + <_> + 9 0 6 1 -1. + <_> + 12 0 3 1 2. + <_> + + <_> + 5 0 12 2 -1. + <_> + 5 1 12 1 2. + <_> + + <_> + 10 0 2 1 -1. + <_> + 11 0 1 1 2. + <_> + + <_> + 7 14 3 3 -1. + <_> + 7 15 3 1 3. + <_> + + <_> + 4 13 5 3 -1. + <_> + 4 14 5 1 3. + <_> + + <_> + 9 16 6 2 -1. + <_> + 9 17 6 1 2. + <_> + + <_> + 11 16 5 3 -1. + <_> + 11 17 5 1 3. + <_> + + <_> + 5 0 3 15 -1. + <_> + 6 0 1 15 3. + <_> + + <_> + 9 16 8 4 -1. + <_> + 9 18 8 2 2. + <_> + + <_> + 0 6 3 2 -1. + <_> + 0 7 3 1 2. + <_> + + <_> + 5 9 3 1 -1. + <_> + 6 9 1 1 3. + <_> + + <_> + 9 11 4 2 -1. + <_> + 9 11 2 1 2. + <_> + 11 12 2 1 2. + <_> + + <_> + 4 13 2 2 -1. + <_> + 4 13 1 1 2. + <_> + 5 14 1 1 2. + <_> + + <_> + 6 4 1 2 -1. + <_> + 6 5 1 1 2. + <_> + + <_> + 14 18 2 2 -1. + <_> + 14 18 1 1 2. + <_> + 15 19 1 1 2. + <_> + + <_> + 7 10 5 6 -1. + <_> + 7 12 5 2 3. + <_> + + <_> + 8 7 4 6 -1. + <_> + 8 9 4 2 3. + <_> + + <_> + 7 9 6 2 -1. + <_> + 9 9 2 2 3. + <_> + + <_> + 6 6 6 4 -1. + <_> + 6 6 3 2 2. + <_> + 9 8 3 2 2. + <_> + + <_> + 10 3 1 6 -1. + <_> + 10 5 1 2 3. + <_> + + <_> + 5 2 12 14 -1. + <_> + 5 2 6 7 2. + <_> + 11 9 6 7 2. + <_> + + <_> + 13 5 6 2 -1. + <_> + 13 6 6 1 2. + <_> + + <_> + 16 0 4 8 -1. + <_> + 16 0 2 4 2. + <_> + 18 4 2 4 2. + <_> + + <_> + 3 12 3 1 -1. + <_> + 4 12 1 1 3. + <_> + + <_> + 3 10 3 4 -1. + <_> + 4 10 1 4 3. + <_> + + <_> + 4 6 1 6 -1. + <_> + 4 9 1 3 2. + <_> + + <_> + 3 7 15 1 -1. + <_> + 8 7 5 1 3. + <_> + + <_> + 1 15 6 5 -1. + <_> + 4 15 3 5 2. + <_> + + <_> + 11 9 8 4 -1. + <_> + 15 9 4 4 2. + <_> + + <_> + 15 7 2 4 -1. + <_> + 16 7 1 4 2. + <_> + + <_> + 19 1 1 2 -1. + <_> + 19 2 1 1 2. + <_> + + <_> + 6 15 3 3 -1. + <_> + 7 15 1 3 3. + <_> + + <_> + 3 16 3 1 -1. + <_> + 4 16 1 1 3. + <_> + + <_> + 3 10 3 10 -1. + <_> + 4 10 1 10 3. + <_> + + <_> + 18 17 2 2 -1. + <_> + 18 17 1 1 2. + <_> + 19 18 1 1 2. + <_> + + <_> + 3 12 6 4 -1. + <_> + 3 12 3 2 2. + <_> + 6 14 3 2 2. + <_> + + <_> + 5 17 2 2 -1. + <_> + 5 17 1 1 2. + <_> + 6 18 1 1 2. + <_> + + <_> + 7 16 2 3 -1. + <_> + 7 17 2 1 3. + <_> + + <_> + 5 11 6 3 -1. + <_> + 8 11 3 3 2. + <_> + + <_> + 7 16 1 3 -1. + <_> + 7 17 1 1 3. + <_> + + <_> + 0 16 2 1 -1. + <_> + 1 16 1 1 2. + <_> + + <_> + 11 7 9 6 -1. + <_> + 11 10 9 3 2. + <_> + + <_> + 9 4 9 16 -1. + <_> + 12 4 3 16 3. + <_> + + <_> + 14 12 5 3 -1. + <_> + 14 13 5 1 3. + <_> + + <_> + 8 18 3 2 -1. + <_> + 9 18 1 2 3. + <_> + + <_> + 4 0 11 16 -1. + <_> + 4 8 11 8 2. + <_> + + <_> + 2 4 12 15 -1. + <_> + 2 9 12 5 3. + <_> + + <_> + 3 13 11 4 -1. + <_> + 3 15 11 2 2. + <_> + + <_> + 7 5 4 3 -1. + <_> + 7 6 4 1 3. + <_> + + <_> + 6 5 4 3 -1. + <_> + 6 6 4 1 3. + <_> + + <_> + 5 0 2 9 -1. + <_> + 5 3 2 3 3. + <_> + + <_> + 16 8 2 2 -1. + <_> + 16 8 1 1 2. + <_> + 17 9 1 1 2. + <_> + + <_> + 12 10 8 2 -1. + <_> + 12 10 4 1 2. + <_> + 16 11 4 1 2. + <_> + + <_> + 6 2 2 8 -1. + <_> + 7 2 1 8 2. + <_> + + <_> + 6 6 2 3 -1. + <_> + 7 6 1 3 2. + <_> + + <_> + 17 4 1 3 -1. + <_> + 17 5 1 1 3. + <_> + + <_> + 15 13 3 2 -1. + <_> + 16 13 1 2 3. + <_> + + <_> + 11 13 2 3 -1. + <_> + 11 14 2 1 3. + <_> + + <_> + 14 5 6 11 -1. + <_> + 16 5 2 11 3. + <_> + + <_> + 6 0 12 8 -1. + <_> + 12 0 6 8 2. + <_> + + <_> + 7 15 8 4 -1. + <_> + 7 15 4 2 2. + <_> + 11 17 4 2 2. + <_> + + <_> + 4 14 16 6 -1. + <_> + 4 16 16 2 3. + <_> + + <_> + 6 12 2 6 -1. + <_> + 6 12 1 3 2. + <_> + 7 15 1 3 2. + <_> + + <_> + 7 14 6 4 -1. + <_> + 7 14 3 2 2. + <_> + 10 16 3 2 2. + <_> + + <_> + 0 0 2 4 -1. + <_> + 0 0 1 2 2. + <_> + 1 2 1 2 2. + <_> + + <_> + 15 12 1 3 -1. + <_> + 15 13 1 1 3. + <_> + + <_> + 7 16 3 1 -1. + <_> + 8 16 1 1 3. + <_> + + <_> + 1 8 1 2 -1. + <_> + 1 9 1 1 2. + <_> + + <_> + 3 14 3 2 -1. + <_> + 4 14 1 2 3. + <_> + + <_> + 3 13 3 5 -1. + <_> + 4 13 1 5 3. + <_> + + <_> + 7 2 3 4 -1. + <_> + 8 2 1 4 3. + <_> + + <_> + 10 1 4 4 -1. + <_> + 10 3 4 2 2. + <_> + + <_> + 9 2 1 2 -1. + <_> + 9 3 1 1 2. + <_> + + <_> + 7 12 2 2 -1. + <_> + 7 12 1 1 2. + <_> + 8 13 1 1 2. + <_> + + <_> + 4 11 4 4 -1. + <_> + 4 11 2 2 2. + <_> + 6 13 2 2 2. + <_> + + <_> + 9 10 6 4 -1. + <_> + 12 10 3 4 2. + <_> + + <_> + 8 12 3 2 -1. + <_> + 9 12 1 2 3. + <_> + + <_> + 13 9 6 6 -1. + <_> + 13 9 3 3 2. + <_> + 16 12 3 3 2. + <_> + + <_> + 14 0 3 5 -1. + <_> + 15 0 1 5 3. + <_> + + <_> + 9 8 6 4 -1. + <_> + 9 8 3 2 2. + <_> + 12 10 3 2 2. + <_> + + <_> + 10 6 3 3 -1. + <_> + 11 6 1 3 3. + <_> + + <_> + 13 3 2 1 -1. + <_> + 14 3 1 1 2. + <_> + + <_> + 4 5 2 2 -1. + <_> + 4 5 1 1 2. + <_> + 5 6 1 1 2. + <_> + + <_> + 4 5 2 2 -1. + <_> + 4 5 1 1 2. + <_> + 5 6 1 1 2. + <_> + + <_> + 7 9 2 6 -1. + <_> + 7 11 2 2 3. + <_> + + <_> + 6 12 2 3 -1. + <_> + 6 13 2 1 3. + <_> + + <_> + 6 13 2 3 -1. + <_> + 6 14 2 1 3. + <_> + + <_> + 7 4 3 2 -1. + <_> + 8 4 1 2 3. + <_> + + <_> + 13 1 3 4 -1. + <_> + 14 1 1 4 3. + <_> + + <_> + 6 8 11 3 -1. + <_> + 6 9 11 1 3. + <_> + + <_> + 13 10 5 2 -1. + <_> + 13 11 5 1 2. + <_> + + <_> + 13 9 3 6 -1. + <_> + 13 12 3 3 2. + <_> + + <_> + 3 14 5 2 -1. + <_> + 3 15 5 1 2. + <_> + + <_> + 11 0 8 2 -1. + <_> + 11 0 4 1 2. + <_> + 15 1 4 1 2. + <_> + + <_> + 13 1 7 6 -1. + <_> + 13 3 7 2 3. + <_> + + <_> + 11 0 6 1 -1. + <_> + 13 0 2 1 3. + <_> + + <_> + 8 1 5 3 -1. + <_> + 8 2 5 1 3. + <_> + + <_> + 12 11 1 3 -1. + <_> + 12 12 1 1 3. + <_> + + <_> + 17 13 3 6 -1. + <_> + 17 15 3 2 3. + <_> + + <_> + 12 11 1 3 -1. + <_> + 12 12 1 1 3. + <_> + + <_> + 15 9 3 1 -1. + <_> + 16 9 1 1 3. + <_> + + <_> + 10 4 6 11 -1. + <_> + 13 4 3 11 2. + <_> + + <_> + 13 9 4 4 -1. + <_> + 13 9 2 2 2. + <_> + 15 11 2 2 2. + <_> + + <_> + 8 2 1 6 -1. + <_> + 8 4 1 2 3. + <_> + + <_> + 5 6 4 6 -1. + <_> + 5 9 4 3 2. + <_> + + <_> + 2 6 4 8 -1. + <_> + 4 6 2 8 2. + <_> + + <_> + 11 15 1 2 -1. + <_> + 11 16 1 1 2. + <_> + + <_> + 11 1 7 10 -1. + <_> + 11 6 7 5 2. + <_> + + <_> + 7 11 9 6 -1. + <_> + 7 13 9 2 3. + <_> + + <_> + 4 9 8 1 -1. + <_> + 8 9 4 1 2. + <_> + + <_> + 10 10 3 3 -1. + <_> + 11 10 1 3 3. + <_> + + <_> + 8 0 7 6 -1. + <_> + 8 2 7 2 3. + <_> + + <_> + 11 13 2 2 -1. + <_> + 11 13 1 1 2. + <_> + 12 14 1 1 2. + <_> + + <_> + 7 12 1 3 -1. + <_> + 7 13 1 1 3. + <_> + + <_> + 7 10 3 9 -1. + <_> + 7 13 3 3 3. + <_> + + <_> + 5 9 1 3 -1. + <_> + 5 10 1 1 3. + <_> + + <_> + 2 8 18 6 -1. + <_> + 11 8 9 6 2. + <_> + + <_> + 11 7 6 4 -1. + <_> + 13 7 2 4 3. + <_> + + <_> + 7 8 4 6 -1. + <_> + 7 10 4 2 3. + <_> + + <_> + 10 4 4 6 -1. + <_> + 10 6 4 2 3. + <_> + + <_> + 11 12 6 1 -1. + <_> + 13 12 2 1 3. + <_> + + <_> + 5 7 2 1 -1. + <_> + 6 7 1 1 2. + <_> + + <_> + 5 12 3 3 -1. + <_> + 5 13 3 1 3. + <_> + + <_> + 16 17 1 2 -1. + <_> + 16 18 1 1 2. + <_> + + <_> + 1 0 2 1 -1. + <_> + 2 0 1 1 2. + <_> + + <_> + 5 12 2 2 -1. + <_> + 5 13 2 1 2. + <_> + + <_> + 12 13 2 3 -1. + <_> + 12 14 2 1 3. + <_> + + <_> + 5 11 3 3 -1. + <_> + 5 12 3 1 3. + <_> + + <_> + 1 0 2 1 -1. + <_> + 2 0 1 1 2. + <_> + + <_> + 16 0 4 4 -1. + <_> + 16 0 2 2 2. + <_> + 18 2 2 2 2. + <_> + + <_> + 4 5 8 10 -1. + <_> + 4 5 4 5 2. + <_> + 8 10 4 5 2. + <_> + + <_> + 3 14 4 5 -1. + <_> + 5 14 2 5 2. + <_> + + <_> + 2 16 6 2 -1. + <_> + 5 16 3 2 2. + <_> + + <_> + 8 0 8 1 -1. + <_> + 12 0 4 1 2. + <_> + + <_> + 0 4 15 6 -1. + <_> + 0 7 15 3 2. + <_> + + <_> + 9 9 3 2 -1. + <_> + 9 10 3 1 2. + <_> + + <_> + 7 9 2 6 -1. + <_> + 7 11 2 2 3. + <_> + + <_> + 5 10 4 3 -1. + <_> + 5 11 4 1 3. + <_> + + <_> + 12 10 1 2 -1. + <_> + 12 11 1 1 2. + <_> + + <_> + 17 3 1 3 -1. + <_> + 17 4 1 1 3. + <_> + + <_> + 11 9 4 4 -1. + <_> + 11 9 2 2 2. + <_> + 13 11 2 2 2. + <_> + + <_> + 10 14 6 2 -1. + <_> + 10 15 6 1 2. + <_> + + <_> + 11 12 2 8 -1. + <_> + 11 16 2 4 2. + <_> + + <_> + 11 7 5 6 -1. + <_> + 11 10 5 3 2. + <_> + + <_> + 4 2 2 6 -1. + <_> + 5 2 1 6 2. + <_> + + <_> + 6 0 5 2 -1. + <_> + 6 1 5 1 2. + <_> + + <_> + 10 17 4 3 -1. + <_> + 10 18 4 1 3. + <_> + + <_> + 12 3 7 3 -1. + <_> + 12 4 7 1 3. + <_> + + <_> + 8 1 12 8 -1. + <_> + 8 1 6 4 2. + <_> + 14 5 6 4 2. + <_> + + <_> + 11 0 3 20 -1. + <_> + 12 0 1 20 3. + <_> + + <_> + 17 1 2 2 -1. + <_> + 17 1 1 1 2. + <_> + 18 2 1 1 2. + <_> + + <_> + 2 10 7 6 -1. + <_> + 2 12 7 2 3. + <_> + + <_> + 7 3 3 1 -1. + <_> + 8 3 1 1 3. + <_> + + <_> + 4 17 11 3 -1. + <_> + 4 18 11 1 3. + <_> + + <_> + 7 15 3 2 -1. + <_> + 8 15 1 2 3. + <_> + + <_> + 3 4 3 13 -1. + <_> + 4 4 1 13 3. + <_> + + <_> + 5 2 12 14 -1. + <_> + 5 2 6 7 2. + <_> + 11 9 6 7 2. + <_> + + <_> + 0 0 10 6 -1. + <_> + 0 3 10 3 2. + <_> + + <_> + 5 4 2 1 -1. + <_> + 6 4 1 1 2. + <_> + + <_> + 7 7 6 13 -1. + <_> + 10 7 3 13 2. + <_> + + <_> + 7 2 2 8 -1. + <_> + 7 2 1 4 2. + <_> + 8 6 1 4 2. + <_> + + <_> + 6 1 3 4 -1. + <_> + 7 1 1 4 3. + <_> + + <_> + 7 8 2 1 -1. + <_> + 8 8 1 1 2. + <_> + + <_> + 4 0 4 2 -1. + <_> + 4 0 2 1 2. + <_> + 6 1 2 1 2. + <_> + + <_> + 3 10 16 8 -1. + <_> + 3 14 16 4 2. + <_> + + <_> + 10 5 5 10 -1. + <_> + 10 10 5 5 2. + <_> + + <_> + 13 6 3 4 -1. + <_> + 13 8 3 2 2. + <_> + + <_> + 13 10 5 3 -1. + <_> + 13 11 5 1 3. + <_> + + <_> + 16 12 2 2 -1. + <_> + 16 12 1 1 2. + <_> + 17 13 1 1 2. + <_> + + <_> + 16 3 2 1 -1. + <_> + 17 3 1 1 2. + <_> + + <_> + 5 1 3 5 -1. + <_> + 6 1 1 5 3. + <_> + + <_> + 5 7 8 6 -1. + <_> + 5 9 8 2 3. + <_> + + <_> + 6 10 8 2 -1. + <_> + 6 10 4 1 2. + <_> + 10 11 4 1 2. + <_> + + <_> + 6 9 4 8 -1. + <_> + 6 9 2 4 2. + <_> + 8 13 2 4 2. + <_> + + <_> + 0 7 8 4 -1. + <_> + 4 7 4 4 2. + <_> + + <_> + 14 13 2 6 -1. + <_> + 14 13 1 3 2. + <_> + 15 16 1 3 2. + <_> + + <_> + 12 13 2 1 -1. + <_> + 13 13 1 1 2. + <_> + + <_> + 6 8 2 2 -1. + <_> + 6 9 2 1 2. + <_> + + <_> + 15 12 2 1 -1. + <_> + 16 12 1 1 2. + <_> + + <_> + 0 0 18 14 -1. + <_> + 0 7 18 7 2. + <_> + + <_> + 11 5 3 3 -1. + <_> + 12 5 1 3 3. + <_> + + <_> + 4 7 3 3 -1. + <_> + 5 7 1 3 3. + <_> + + <_> + 4 8 3 1 -1. + <_> + 5 8 1 1 3. + <_> + + <_> + 5 9 1 8 -1. + <_> + 5 13 1 4 2. + <_> + + <_> + 4 2 3 15 -1. + <_> + 5 2 1 15 3. + <_> + + <_> + 15 0 4 4 -1. + <_> + 17 0 2 4 2. + <_> + + <_> + 10 7 1 3 -1. + <_> + 10 8 1 1 3. + <_> + + <_> + 8 17 3 2 -1. + <_> + 9 17 1 2 3. + <_> + + <_> + 8 17 3 2 -1. + <_> + 9 17 1 2 3. + <_> + + <_> + 10 6 1 3 -1. + <_> + 10 7 1 1 3. + <_> + + <_> + 6 7 4 4 -1. + <_> + 6 7 2 2 2. + <_> + 8 9 2 2 2. + <_> + + <_> + 8 7 4 4 -1. + <_> + 8 7 2 2 2. + <_> + 10 9 2 2 2. + <_> + + <_> + 15 8 2 7 -1. + <_> + 16 8 1 7 2. + <_> + + <_> + 8 3 3 2 -1. + <_> + 9 3 1 2 3. + <_> + + <_> + 16 17 3 1 -1. + <_> + 17 17 1 1 3. + <_> + + <_> + 3 2 12 14 -1. + <_> + 3 2 6 7 2. + <_> + 9 9 6 7 2. + <_> + + <_> + 16 16 1 2 -1. + <_> + 16 17 1 1 2. + <_> + + <_> + 7 12 2 3 -1. + <_> + 7 13 2 1 3. + <_> + + <_> + 7 13 2 6 -1. + <_> + 8 13 1 6 2. + <_> + + <_> + 8 14 2 6 -1. + <_> + 8 16 2 2 3. + <_> + + <_> + 6 14 4 6 -1. + <_> + 6 16 4 2 3. + <_> + + <_> + 11 12 3 6 -1. + <_> + 12 12 1 6 3. + <_> + + <_> + 0 6 1 12 -1. + <_> + 0 10 1 4 3. + <_> + + <_> + 3 3 2 10 -1. + <_> + 3 3 1 5 2. + <_> + 4 8 1 5 2. + <_> + + <_> + 3 3 2 8 -1. + <_> + 3 3 1 4 2. + <_> + 4 7 1 4 2. + <_> + + <_> + 9 4 1 12 -1. + <_> + 9 10 1 6 2. + <_> + + <_> + 0 5 6 4 -1. + <_> + 3 5 3 4 2. + <_> + + <_> + 9 9 1 4 -1. + <_> + 9 11 1 2 2. + <_> + + <_> + 4 6 6 4 -1. + <_> + 4 6 3 2 2. + <_> + 7 8 3 2 2. + <_> + + <_> + 6 8 2 2 -1. + <_> + 7 8 1 2 2. + <_> + + <_> + 6 4 4 14 -1. + <_> + 8 4 2 14 2. + <_> + + <_> + 6 7 3 3 -1. + <_> + 7 7 1 3 3. + <_> + + <_> + 4 7 6 5 -1. + <_> + 7 7 3 5 2. + <_> + + <_> + 0 4 8 10 -1. + <_> + 4 4 4 10 2. + <_> + + <_> + 0 6 18 14 -1. + <_> + 9 6 9 14 2. + <_> + + <_> + 11 15 3 5 -1. + <_> + 12 15 1 5 3. + <_> + + <_> + 3 18 4 2 -1. + <_> + 3 18 2 1 2. + <_> + 5 19 2 1 2. + <_> + + <_> + 7 10 2 2 -1. + <_> + 7 11 2 1 2. + <_> + + <_> + 10 1 3 10 -1. + <_> + 10 6 3 5 2. + <_> + + <_> + 9 0 8 10 -1. + <_> + 13 0 4 10 2. + <_> + + <_> + 7 2 8 13 -1. + <_> + 11 2 4 13 2. + <_> + + <_> + 3 3 12 7 -1. + <_> + 9 3 6 7 2. + <_> + + <_> + 11 8 3 2 -1. + <_> + 12 8 1 2 3. + <_> + + <_> + 11 7 2 8 -1. + <_> + 11 7 1 4 2. + <_> + 12 11 1 4 2. + <_> + + <_> + 0 6 3 2 -1. + <_> + 0 7 3 1 2. + <_> + + <_> + 6 17 2 3 -1. + <_> + 6 18 2 1 3. + <_> + + <_> + 4 7 2 2 -1. + <_> + 4 7 1 1 2. + <_> + 5 8 1 1 2. + <_> + + <_> + 9 2 10 9 -1. + <_> + 9 5 10 3 3. + <_> + + <_> + 9 0 10 4 -1. + <_> + 9 0 5 2 2. + <_> + 14 2 5 2 2. + <_> + + <_> + 7 5 2 1 -1. + <_> + 8 5 1 1 2. + <_> + + <_> + 7 5 2 1 -1. + <_> + 8 5 1 1 2. + <_> + + <_> + 4 9 3 3 -1. + <_> + 4 10 3 1 3. + <_> + + <_> + 4 10 4 3 -1. + <_> + 4 11 4 1 3. + <_> + + <_> + 6 7 2 3 -1. + <_> + 6 8 2 1 3. + <_> + + <_> + 18 4 1 3 -1. + <_> + 18 5 1 1 3. + <_> + + <_> + 17 0 3 5 -1. + <_> + 18 0 1 5 3. + <_> + + <_> + 11 2 8 3 -1. + <_> + 11 3 8 1 3. + <_> + + <_> + 14 9 6 5 -1. + <_> + 17 9 3 5 2. + <_> + + <_> + 0 7 4 6 -1. + <_> + 0 9 4 2 3. + <_> + + <_> + 12 7 4 12 -1. + <_> + 12 7 2 6 2. + <_> + 14 13 2 6 2. + <_> + + <_> + 8 7 9 3 -1. + <_> + 11 7 3 3 3. + <_> + + <_> + 12 12 2 3 -1. + <_> + 12 13 2 1 3. + <_> + + <_> + 11 0 6 20 -1. + <_> + 14 0 3 20 2. + <_> + + <_> + 4 5 2 6 -1. + <_> + 5 5 1 6 2. + <_> + + <_> + 1 7 6 11 -1. + <_> + 3 7 2 11 3. + <_> + + <_> + 2 15 2 1 -1. + <_> + 3 15 1 1 2. + <_> + + <_> + 5 11 2 6 -1. + <_> + 5 14 2 3 2. + <_> + + <_> + 6 17 2 3 -1. + <_> + 6 18 2 1 3. + <_> + + <_> + 5 8 11 12 -1. + <_> + 5 12 11 4 3. + <_> + + <_> + 16 10 2 2 -1. + <_> + 16 10 1 1 2. + <_> + 17 11 1 1 2. + <_> + + <_> + 15 11 3 1 -1. + <_> + 16 11 1 1 3. + <_> + + <_> + 13 14 1 3 -1. + <_> + 13 15 1 1 3. + <_> + + <_> + 6 14 3 4 -1. + <_> + 6 16 3 2 2. + <_> + + <_> + 6 6 2 14 -1. + <_> + 6 13 2 7 2. + <_> + + <_> + 11 14 2 1 -1. + <_> + 12 14 1 1 2. + <_> + + <_> + 9 13 6 6 -1. + <_> + 9 13 3 3 2. + <_> + 12 16 3 3 2. + <_> + + <_> + 10 17 3 1 -1. + <_> + 11 17 1 1 3. + <_> + + <_> + 9 13 2 6 -1. + <_> + 9 13 1 3 2. + <_> + 10 16 1 3 2. + <_> + + <_> + 11 18 4 2 -1. + <_> + 13 18 2 2 2. + <_> + + <_> + 9 12 3 3 -1. + <_> + 10 12 1 3 3. + <_> + + <_> + 5 6 1 12 -1. + <_> + 5 12 1 6 2. + <_> + + <_> + 2 4 6 6 -1. + <_> + 4 4 2 6 3. + <_> + + <_> + 1 4 9 3 -1. + <_> + 4 4 3 3 3. + <_> + + <_> + 5 10 3 3 -1. + <_> + 5 11 3 1 3. + <_> + + <_> + 8 9 1 3 -1. + <_> + 8 10 1 1 3. + <_> + + <_> + 11 19 6 1 -1. + <_> + 13 19 2 1 3. + <_> + + <_> + 18 4 2 8 -1. + <_> + 18 4 1 4 2. + <_> + 19 8 1 4 2. + <_> + + <_> + 17 5 2 3 -1. + <_> + 17 6 2 1 3. + <_> + + <_> + 12 15 8 4 -1. + <_> + 16 15 4 4 2. + <_> + + <_> + 14 8 4 10 -1. + <_> + 14 13 4 5 2. + <_> + + <_> + 11 0 3 18 -1. + <_> + 11 6 3 6 3. + <_> + + <_> + 8 5 12 6 -1. + <_> + 8 7 12 2 3. + <_> + + <_> + 10 11 4 2 -1. + <_> + 12 11 2 2 2. + <_> + + <_> + 5 7 2 8 -1. + <_> + 6 7 1 8 2. + <_> + + <_> + 6 3 12 12 -1. + <_> + 6 3 6 6 2. + <_> + 12 9 6 6 2. + <_> + + <_> + 6 10 4 2 -1. + <_> + 6 10 2 1 2. + <_> + 8 11 2 1 2. + <_> + + <_> + 0 2 6 10 -1. + <_> + 2 2 2 10 3. + <_> + + <_> + 10 15 3 2 -1. + <_> + 11 15 1 2 3. + <_> + + <_> + 6 8 10 2 -1. + <_> + 6 8 5 1 2. + <_> + 11 9 5 1 2. + <_> + + <_> + 6 12 1 6 -1. + <_> + 6 15 1 3 2. + <_> + + <_> + 9 0 4 1 -1. + <_> + 11 0 2 1 2. + <_> + + <_> + 8 5 2 3 -1. + <_> + 8 6 2 1 3. + <_> + + <_> + 7 4 2 1 -1. + <_> + 8 4 1 1 2. + <_> + + <_> + 2 11 3 1 -1. + <_> + 3 11 1 1 3. + <_> + + <_> + 1 10 3 3 -1. + <_> + 2 10 1 3 3. + <_> + + <_> + 12 0 8 2 -1. + <_> + 12 0 4 1 2. + <_> + 16 1 4 1 2. + <_> + + <_> + 6 6 6 8 -1. + <_> + 9 6 3 8 2. + <_> + + <_> + 6 10 1 3 -1. + <_> + 6 11 1 1 3. + <_> + + <_> + 8 12 7 2 -1. + <_> + 8 13 7 1 2. + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + <_> + + <_> + 6 6 2 12 -1. + <_> + 6 12 2 6 2. + <_> + + <_> + 6 12 2 3 -1. + <_> + 6 13 2 1 3. + <_> + + <_> + 12 12 1 3 -1. + <_> + 12 13 1 1 3. + <_> + + <_> + 8 9 1 2 -1. + <_> + 8 10 1 1 2. + <_> + + <_> + 7 11 4 6 -1. + <_> + 7 11 2 3 2. + <_> + 9 14 2 3 2. + <_> + + <_> + 10 10 4 3 -1. + <_> + 10 11 4 1 3. + <_> + + <_> + 12 10 2 3 -1. + <_> + 12 11 2 1 3. + <_> + + <_> + 6 13 2 3 -1. + <_> + 6 14 2 1 3. + <_> + + <_> + 7 14 1 3 -1. + <_> + 7 15 1 1 3. + <_> + + <_> + 6 10 8 6 -1. + <_> + 6 12 8 2 3. + <_> + + <_> + 5 8 6 12 -1. + <_> + 5 12 6 4 3. + <_> + + <_> + 1 14 2 1 -1. + <_> + 2 14 1 1 2. + <_> + + <_> + 8 6 2 3 -1. + <_> + 8 7 2 1 3. + <_> + + <_> + 4 6 8 4 -1. + <_> + 4 6 4 2 2. + <_> + 8 8 4 2 2. + <_> + + <_> + 0 14 3 1 -1. + <_> + 1 14 1 1 3. + <_> + + <_> + 4 1 2 2 -1. + <_> + 4 1 1 1 2. + <_> + 5 2 1 1 2. + <_> + + <_> + 14 10 1 6 -1. + <_> + 14 13 1 3 2. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 5 10 3 3 -1. + <_> + 5 11 3 1 3. + <_> + + <_> + 2 3 12 4 -1. + <_> + 2 3 6 2 2. + <_> + 8 5 6 2 2. + <_> + + <_> + 10 15 3 2 -1. + <_> + 11 15 1 2 3. + <_> + + <_> + 12 14 8 1 -1. + <_> + 16 14 4 1 2. + <_> + + <_> + 11 0 8 13 -1. + <_> + 15 0 4 13 2. + <_> + + <_> + 12 12 2 8 -1. + <_> + 12 12 1 4 2. + <_> + 13 16 1 4 2. + <_> + + <_> + 4 7 8 12 -1. + <_> + 4 13 8 6 2. + <_> + + <_> + 10 9 2 4 -1. + <_> + 10 11 2 2 2. + <_> + + <_> + 4 4 3 1 -1. + <_> + 5 4 1 1 3. + <_> + + <_> + 18 5 1 3 -1. + <_> + 18 6 1 1 3. + <_> + + <_> + 6 9 9 1 -1. + <_> + 9 9 3 1 3. + <_> + + <_> + 12 5 4 6 -1. + <_> + 12 7 4 2 3. + <_> + + <_> + 16 0 4 4 -1. + <_> + 18 0 2 4 2. + <_> + + <_> + 3 10 2 2 -1. + <_> + 3 10 1 1 2. + <_> + 4 11 1 1 2. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 17 4 2 8 -1. + <_> + 17 4 1 4 2. + <_> + 18 8 1 4 2. + <_> + + <_> + 7 15 1 3 -1. + <_> + 7 16 1 1 3. + <_> + + <_> + 0 15 2 1 -1. + <_> + 1 15 1 1 2. + <_> + + <_> + 7 10 2 4 -1. + <_> + 7 12 2 2 2. + <_> + + <_> + 4 19 3 1 -1. + <_> + 5 19 1 1 3. + <_> + + <_> + 2 14 4 5 -1. + <_> + 4 14 2 5 2. + <_> + + <_> + 4 11 4 4 -1. + <_> + 4 11 2 2 2. + <_> + 6 13 2 2 2. + <_> + + <_> + 4 13 2 6 -1. + <_> + 4 13 1 3 2. + <_> + 5 16 1 3 2. + <_> + + <_> + 7 3 3 4 -1. + <_> + 8 3 1 4 3. + <_> + + <_> + 17 11 3 2 -1. + <_> + 18 11 1 2 3. + <_> + + <_> + 10 4 6 2 -1. + <_> + 10 5 6 1 2. + <_> + + <_> + 12 3 6 3 -1. + <_> + 12 4 6 1 3. + <_> + + <_> + 17 12 2 2 -1. + <_> + 17 12 1 1 2. + <_> + 18 13 1 1 2. + <_> + + <_> + 5 12 15 8 -1. + <_> + 10 12 5 8 3. + <_> + + <_> + 4 18 2 2 -1. + <_> + 4 18 1 1 2. + <_> + 5 19 1 1 2. + <_> + + <_> + 0 15 2 2 -1. + <_> + 0 15 1 1 2. + <_> + 1 16 1 1 2. + <_> + + <_> + 5 9 1 6 -1. + <_> + 5 12 1 3 2. + <_> + + <_> + 1 0 18 14 -1. + <_> + 1 7 18 7 2. + <_> + + <_> + 6 2 7 6 -1. + <_> + 6 5 7 3 2. + <_> + + <_> + 6 16 2 1 -1. + <_> + 7 16 1 1 2. + <_> + + <_> + 4 11 16 9 -1. + <_> + 4 14 16 3 3. + <_> + + <_> + 16 9 2 2 -1. + <_> + 17 9 1 2 2. + <_> + + <_> + 6 8 2 2 -1. + <_> + 7 8 1 2 2. + <_> + + <_> + 0 14 12 3 -1. + <_> + 6 14 6 3 2. + <_> + + <_> + 7 6 3 10 -1. + <_> + 7 11 3 5 2. + <_> + + <_> + 10 11 1 2 -1. + <_> + 10 12 1 1 2. + <_> + + <_> + 5 17 2 2 -1. + <_> + 6 17 1 2 2. + <_> + + <_> + 2 0 18 18 -1. + <_> + 11 0 9 18 2. + <_> + + <_> + 12 11 6 3 -1. + <_> + 14 11 2 3 3. + <_> + + <_> + 12 12 6 1 -1. + <_> + 14 12 2 1 3. + <_> + + <_> + 15 10 2 2 -1. + <_> + 15 10 1 1 2. + <_> + 16 11 1 1 2. + <_> + + <_> + 3 11 3 8 -1. + <_> + 4 11 1 8 3. + <_> + + <_> + 6 1 4 12 -1. + <_> + 8 1 2 12 2. + <_> + + <_> + 6 3 4 8 -1. + <_> + 8 3 2 8 2. + <_> + + <_> + 8 4 6 12 -1. + <_> + 11 4 3 12 2. + <_> + + <_> + 16 12 4 5 -1. + <_> + 18 12 2 5 2. + <_> + + <_> + 14 9 2 3 -1. + <_> + 15 9 1 3 2. + <_> + + <_> + 9 7 10 6 -1. + <_> + 14 7 5 6 2. + <_> + + <_> + 12 7 3 11 -1. + <_> + 13 7 1 11 3. + <_> + + <_> + 19 16 1 2 -1. + <_> + 19 17 1 1 2. + <_> + + <_> + 8 15 12 1 -1. + <_> + 14 15 6 1 2. + <_> + + <_> + 10 15 6 3 -1. + <_> + 10 16 6 1 3. + <_> + + <_> + 6 8 10 4 -1. + <_> + 6 8 5 2 2. + <_> + 11 10 5 2 2. + <_> + + <_> + 10 15 1 3 -1. + <_> + 10 16 1 1 3. + <_> + + <_> + 10 1 9 12 -1. + <_> + 10 7 9 6 2. + <_> + + <_> + 10 1 1 4 -1. + <_> + 10 3 1 2 2. + <_> + + <_> + 1 5 18 4 -1. + <_> + 1 7 18 2 2. + <_> + + <_> + 6 4 12 6 -1. + <_> + 12 4 6 6 2. + <_> + + <_> + 13 1 7 3 -1. + <_> + 13 2 7 1 3. + <_> + + <_> + 14 0 6 4 -1. + <_> + 14 0 3 2 2. + <_> + 17 2 3 2 2. + <_> + + <_> + 9 12 3 3 -1. + <_> + 9 13 3 1 3. + <_> + + <_> + 5 14 8 4 -1. + <_> + 5 14 4 2 2. + <_> + 9 16 4 2 2. + <_> + + <_> + 1 6 14 14 -1. + <_> + 8 6 7 14 2. + <_> + + <_> + 13 4 6 2 -1. + <_> + 13 4 3 1 2. + <_> + 16 5 3 1 2. + <_> + + <_> + 8 7 6 6 -1. + <_> + 8 9 6 2 3. + <_> + + <_> + 8 0 12 20 -1. + <_> + 8 10 12 10 2. + <_> + + <_> + 9 8 4 3 -1. + <_> + 9 9 4 1 3. + <_> + + <_> + 10 18 8 2 -1. + <_> + 10 19 8 1 2. + <_> + + <_> + 9 12 4 2 -1. + <_> + 9 12 2 1 2. + <_> + 11 13 2 1 2. + <_> + + <_> + 4 14 2 2 -1. + <_> + 4 14 1 1 2. + <_> + 5 15 1 1 2. + <_> + + <_> + 5 14 3 2 -1. + <_> + 5 15 3 1 2. + <_> + + <_> + 11 1 6 3 -1. + <_> + 13 1 2 3 3. + <_> + + <_> + 6 14 2 3 -1. + <_> + 6 15 2 1 3. + <_> + + <_> + 14 1 2 2 -1. + <_> + 15 1 1 2 2. + <_> + + <_> + 0 13 6 7 -1. + <_> + 3 13 3 7 2. + <_> + + <_> + 17 11 3 1 -1. + <_> + 18 11 1 1 3. + <_> + + <_> + 5 10 8 4 -1. + <_> + 9 10 4 4 2. + <_> + + <_> + 7 16 8 4 -1. + <_> + 7 16 4 2 2. + <_> + 11 18 4 2 2. + <_> + + <_> + 11 16 4 3 -1. + <_> + 11 17 4 1 3. + <_> + + <_> + 3 10 6 2 -1. + <_> + 3 10 3 1 2. + <_> + 6 11 3 1 2. + <_> + + <_> + 11 7 3 2 -1. + <_> + 12 7 1 2 3. + <_> + + <_> + 8 7 9 2 -1. + <_> + 11 7 3 2 3. + <_> + + <_> + 13 6 3 10 -1. + <_> + 14 6 1 10 3. + <_> + + <_> + 15 10 4 3 -1. + <_> + 17 10 2 3 2. + <_> + + <_> + 1 10 6 10 -1. + <_> + 3 10 2 10 3. + <_> + + <_> + 5 0 2 2 -1. + <_> + 5 0 1 1 2. + <_> + 6 1 1 1 2. + <_> + + <_> + 3 11 3 6 -1. + <_> + 3 13 3 2 3. + <_> + + <_> + 4 6 9 10 -1. + <_> + 7 6 3 10 3. + <_> + + <_> + 6 10 9 5 -1. + <_> + 9 10 3 5 3. + <_> + + <_> + 10 5 3 9 -1. + <_> + 11 5 1 9 3. + <_> + + <_> + 3 7 3 4 -1. + <_> + 4 7 1 4 3. + <_> + + <_> + 4 6 2 2 -1. + <_> + 4 6 1 1 2. + <_> + 5 7 1 1 2. + <_> + + <_> + 0 2 2 3 -1. + <_> + 0 3 2 1 3. + <_> + + <_> + 12 0 8 4 -1. + <_> + 12 0 4 2 2. + <_> + 16 2 4 2 2. + <_> + + <_> + 11 1 8 2 -1. + <_> + 11 1 4 1 2. + <_> + 15 2 4 1 2. + <_> + + <_> + 12 2 7 3 -1. + <_> + 12 3 7 1 3. + <_> + + <_> + 3 6 3 2 -1. + <_> + 4 6 1 2 3. + <_> + + <_> + 4 6 4 6 -1. + <_> + 4 9 4 3 2. + <_> + + <_> + 13 12 6 4 -1. + <_> + 13 12 3 2 2. + <_> + 16 14 3 2 2. + <_> + + <_> + 13 10 2 4 -1. + <_> + 13 12 2 2 2. + <_> + + <_> + 15 12 3 3 -1. + <_> + 15 13 3 1 3. + <_> + + <_> + 14 14 2 3 -1. + <_> + 14 15 2 1 3. + <_> + + <_> + 18 4 2 8 -1. + <_> + 18 4 1 4 2. + <_> + 19 8 1 4 2. + <_> + + <_> + 7 14 2 4 -1. + <_> + 7 14 1 2 2. + <_> + 8 16 1 2 2. + <_> + + <_> + 14 3 6 6 -1. + <_> + 14 5 6 2 3. + <_> + + <_> + 19 7 1 2 -1. + <_> + 19 8 1 1 2. + <_> + + <_> + 8 8 6 2 -1. + <_> + 8 8 3 1 2. + <_> + 11 9 3 1 2. + <_> + + <_> + 19 6 1 3 -1. + <_> + 19 7 1 1 3. + <_> + + <_> + 7 8 7 3 -1. + <_> + 7 9 7 1 3. + <_> + + <_> + 18 6 2 6 -1. + <_> + 18 6 1 3 2. + <_> + 19 9 1 3 2. + <_> + + <_> + 5 8 8 6 -1. + <_> + 5 10 8 2 3. + <_> + + <_> + 1 1 18 15 -1. + <_> + 10 1 9 15 2. + <_> + + <_> + 11 7 5 4 -1. + <_> + 11 9 5 2 2. + <_> + + <_> + 10 12 2 3 -1. + <_> + 11 12 1 3 2. + <_> + + <_> + 0 7 2 4 -1. + <_> + 0 9 2 2 2. + <_> + + <_> + 6 12 4 2 -1. + <_> + 6 12 2 1 2. + <_> + 8 13 2 1 2. + <_> + + <_> + 7 7 6 8 -1. + <_> + 7 11 6 4 2. + <_> + + <_> + 9 9 2 4 -1. + <_> + 9 11 2 2 2. + <_> + + <_> + 9 10 6 6 -1. + <_> + 9 12 6 2 3. + <_> + + <_> + 12 13 4 2 -1. + <_> + 12 14 4 1 2. + <_> + + <_> + 0 4 8 1 -1. + <_> + 4 4 4 1 2. + <_> + + <_> + 14 13 1 2 -1. + <_> + 14 14 1 1 2. + <_> + + <_> + 8 7 2 6 -1. + <_> + 8 7 1 3 2. + <_> + 9 10 1 3 2. + <_> + + <_> + 5 8 10 6 -1. + <_> + 5 8 5 3 2. + <_> + 10 11 5 3 2. + <_> + + <_> + 5 12 3 3 -1. + <_> + 5 13 3 1 3. + <_> + + <_> + 5 10 2 2 -1. + <_> + 5 11 2 1 2. + <_> + + <_> + 6 2 4 15 -1. + <_> + 6 7 4 5 3. + <_> + + <_> + 7 6 2 4 -1. + <_> + 7 6 1 2 2. + <_> + 8 8 1 2 2. + <_> + + <_> + 5 9 2 3 -1. + <_> + 5 10 2 1 3. + <_> + + <_> + 15 16 2 2 -1. + <_> + 15 16 1 1 2. + <_> + 16 17 1 1 2. + <_> + + <_> + 4 11 4 6 -1. + <_> + 4 13 4 2 3. + <_> + + <_> + 5 0 3 6 -1. + <_> + 6 0 1 6 3. + <_> + + <_> + 4 11 12 4 -1. + <_> + 4 11 6 2 2. + <_> + 10 13 6 2 2. + <_> + + <_> + 7 13 3 3 -1. + <_> + 7 14 3 1 3. + <_> + + <_> + 9 12 6 2 -1. + <_> + 9 13 6 1 2. + <_> + + <_> + 8 0 12 8 -1. + <_> + 8 0 6 4 2. + <_> + 14 4 6 4 2. + <_> + + <_> + 10 8 4 4 -1. + <_> + 10 8 2 2 2. + <_> + 12 10 2 2 2. + <_> + + <_> + 12 10 1 6 -1. + <_> + 12 13 1 3 2. + <_> + + <_> + 5 5 3 10 -1. + <_> + 6 5 1 10 3. + <_> + + <_> + 4 0 14 6 -1. + <_> + 11 0 7 6 2. + <_> + + <_> + 9 7 2 6 -1. + <_> + 9 7 1 3 2. + <_> + 10 10 1 3 2. + <_> + + <_> + 8 4 3 1 -1. + <_> + 9 4 1 1 3. + <_> + + <_> + 11 14 2 2 -1. + <_> + 11 15 2 1 2. + <_> + + <_> + 9 18 6 2 -1. + <_> + 12 18 3 2 2. + <_> + + <_> + 8 12 8 6 -1. + <_> + 8 15 8 3 2. + <_> + + <_> + 7 0 8 6 -1. + <_> + 7 2 8 2 3. + <_> + + <_> + 1 2 12 3 -1. + <_> + 5 2 4 3 3. + <_> + + <_> + 5 4 10 12 -1. + <_> + 5 4 5 6 2. + <_> + 10 10 5 6 2. + <_> + + <_> + 5 8 3 2 -1. + <_> + 5 9 3 1 2. + <_> + + <_> + 7 12 1 3 -1. + <_> + 7 13 1 1 3. + <_> + + <_> + 5 11 3 3 -1. + <_> + 5 12 3 1 3. + <_> + + <_> + 8 10 6 9 -1. + <_> + 8 13 6 3 3. + <_> + + <_> + 7 8 3 6 -1. + <_> + 7 10 3 2 3. + <_> + + <_> + 3 4 3 14 -1. + <_> + 4 4 1 14 3. + <_> + + <_> + 3 10 3 6 -1. + <_> + 4 10 1 6 3. + <_> + + <_> + 4 8 2 2 -1. + <_> + 4 8 1 1 2. + <_> + 5 9 1 1 2. + <_> + + <_> + 10 13 2 3 -1. + <_> + 10 14 2 1 3. + <_> + + <_> + 6 14 8 4 -1. + <_> + 6 14 4 2 2. + <_> + 10 16 4 2 2. + <_> + + <_> + 5 12 3 4 -1. + <_> + 6 12 1 4 3. + <_> + + <_> + 17 11 2 2 -1. + <_> + 17 11 1 1 2. + <_> + 18 12 1 1 2. + <_> + + <_> + 15 6 1 10 -1. + <_> + 15 11 1 5 2. + <_> + + <_> + 7 1 12 6 -1. + <_> + 7 3 12 2 3. + <_> + + <_> + 4 9 2 4 -1. + <_> + 4 9 1 2 2. + <_> + 5 11 1 2 2. + <_> + + <_> + 6 7 6 12 -1. + <_> + 9 7 3 12 2. + <_> + + <_> + 7 6 2 3 -1. + <_> + 8 6 1 3 2. + <_> + + <_> + 0 1 1 3 -1. + <_> + 0 2 1 1 3. + <_> + + <_> + 0 1 1 3 -1. + <_> + 0 2 1 1 3. + <_> + + <_> + 11 15 3 5 -1. + <_> + 12 15 1 5 3. + <_> + + <_> + 8 6 4 6 -1. + <_> + 8 8 4 2 3. + <_> + + <_> + 5 3 3 12 -1. + <_> + 5 7 3 4 3. + <_> + + <_> + 7 9 2 2 -1. + <_> + 7 9 1 1 2. + <_> + 8 10 1 1 2. + <_> + + <_> + 4 4 2 12 -1. + <_> + 4 8 2 4 3. + <_> + + <_> + 4 5 7 3 -1. + <_> + 4 6 7 1 3. + <_> + + <_> + 13 5 2 3 -1. + <_> + 13 6 2 1 3. + <_> + + <_> + 4 0 2 2 -1. + <_> + 4 0 1 1 2. + <_> + 5 1 1 1 2. + <_> + + <_> + 11 8 3 11 -1. + <_> + 12 8 1 11 3. + <_> + + <_> + 4 0 2 2 -1. + <_> + 4 0 1 1 2. + <_> + 5 1 1 1 2. + <_> + + <_> + 9 3 2 2 -1. + <_> + 9 3 1 1 2. + <_> + 10 4 1 1 2. + <_> + + <_> + 7 11 3 2 -1. + <_> + 8 11 1 2 3. + <_> + + <_> + 11 12 2 1 -1. + <_> + 12 12 1 1 2. + <_> + + <_> + 8 8 4 2 -1. + <_> + 10 8 2 2 2. + <_> + + <_> + 17 15 3 1 -1. + <_> + 18 15 1 1 3. + <_> + + <_> + 12 6 2 4 -1. + <_> + 12 6 1 2 2. + <_> + 13 8 1 2 2. + <_> + + <_> + 8 3 9 11 -1. + <_> + 11 3 3 11 3. + <_> + + <_> + 10 8 2 2 -1. + <_> + 11 8 1 2 2. + <_> + + <_> + 12 5 3 9 -1. + <_> + 12 8 3 3 3. + <_> + + <_> + 13 0 6 17 -1. + <_> + 15 0 2 17 3. + <_> + + <_> + 6 6 3 4 -1. + <_> + 7 6 1 4 3. + <_> + + <_> + 5 6 4 7 -1. + <_> + 7 6 2 7 2. + <_> + + <_> + 7 5 3 2 -1. + <_> + 8 5 1 2 3. + <_> + + <_> + 7 15 6 2 -1. + <_> + 7 15 3 1 2. + <_> + 10 16 3 1 2. + <_> + + <_> + 11 14 1 3 -1. + <_> + 11 15 1 1 3. + <_> + + <_> + 2 12 6 7 -1. + <_> + 4 12 2 7 3. + <_> + + <_> + 11 17 5 3 -1. + <_> + 11 18 5 1 3. + <_> + + <_> + 17 11 2 2 -1. + <_> + 17 11 1 1 2. + <_> + 18 12 1 1 2. + <_> + + <_> + 10 17 6 3 -1. + <_> + 10 18 6 1 3. + <_> + + <_> + 2 15 1 2 -1. + <_> + 2 16 1 1 2. + <_> + + <_> + 8 6 3 3 -1. + <_> + 8 7 3 1 3. + <_> + + <_> + 7 7 1 2 -1. + <_> + 7 8 1 1 2. + <_> + + <_> + 2 15 2 2 -1. + <_> + 2 16 2 1 2. + <_> + + <_> + 3 16 3 1 -1. + <_> + 4 16 1 1 3. + <_> + + <_> + 3 0 3 20 -1. + <_> + 4 0 1 20 3. + <_> + + <_> + 8 2 12 12 -1. + <_> + 14 2 6 12 2. + <_> + + <_> + 5 3 2 3 -1. + <_> + 5 4 2 1 3. + <_> + + <_> + 3 4 2 2 -1. + <_> + 3 4 1 1 2. + <_> + 4 5 1 1 2. + <_> + + <_> + 0 15 20 3 -1. + <_> + 10 15 10 3 2. + <_> + + <_> + 6 13 2 4 -1. + <_> + 6 13 1 2 2. + <_> + 7 15 1 2 2. + <_> + + <_> + 12 8 3 7 -1. + <_> + 13 8 1 7 3. + <_> + + <_> + 8 9 6 10 -1. + <_> + 8 9 3 5 2. + <_> + 11 14 3 5 2. + <_> + + <_> + 2 10 16 2 -1. + <_> + 10 10 8 2 2. + <_> + + <_> + 5 3 15 6 -1. + <_> + 10 3 5 6 3. + <_> + + <_> + 10 14 2 1 -1. + <_> + 11 14 1 1 2. + <_> + + <_> + 9 11 4 4 -1. + <_> + 11 11 2 4 2. + <_> + + <_> + 12 8 2 4 -1. + <_> + 12 10 2 2 2. + <_> + + <_> + 1 3 10 14 -1. + <_> + 1 3 5 7 2. + <_> + 6 10 5 7 2. + <_> + + <_> + 8 0 3 4 -1. + <_> + 8 2 3 2 2. + <_> + + <_> + 10 2 2 1 -1. + <_> + 11 2 1 1 2. + <_> + + <_> + 5 12 5 3 -1. + <_> + 5 13 5 1 3. + <_> + + <_> + 7 12 1 3 -1. + <_> + 7 13 1 1 3. + <_> + + <_> + 10 12 6 3 -1. + <_> + 10 13 6 1 3. + <_> + + <_> + 6 4 1 3 -1. + <_> + 6 5 1 1 3. + <_> + + <_> + 2 0 18 3 -1. + <_> + 2 1 18 1 3. + <_> + + <_> + 8 8 11 6 -1. + <_> + 8 10 11 2 3. + <_> + + <_> + 2 6 10 8 -1. + <_> + 2 6 5 4 2. + <_> + 7 10 5 4 2. + <_> + + <_> + 9 2 6 2 -1. + <_> + 11 2 2 2 3. + <_> + + <_> + 13 9 6 3 -1. + <_> + 15 9 2 3 3. + <_> + + <_> + 5 3 1 2 -1. + <_> + 5 4 1 1 2. + <_> + + <_> + 1 7 3 1 -1. + <_> + 2 7 1 1 3. + <_> + + <_> + 0 6 8 6 -1. + <_> + 4 6 4 6 2. + <_> + + <_> + 11 9 1 2 -1. + <_> + 11 10 1 1 2. + <_> + + <_> + 12 13 1 2 -1. + <_> + 12 14 1 1 2. + <_> + + <_> + 10 15 10 4 -1. + <_> + 10 15 5 2 2. + <_> + 15 17 5 2 2. + <_> + + <_> + 12 11 1 2 -1. + <_> + 12 12 1 1 2. + <_> + + <_> + 6 11 2 1 -1. + <_> + 7 11 1 1 2. + <_> + + <_> + 11 3 3 2 -1. + <_> + 12 3 1 2 3. + <_> + + <_> + 4 7 6 5 -1. + <_> + 7 7 3 5 2. + <_> + + <_> + 3 16 3 1 -1. + <_> + 4 16 1 1 3. + <_> + + <_> + 4 7 6 5 -1. + <_> + 7 7 3 5 2. + <_> + + <_> + 5 7 6 3 -1. + <_> + 7 7 2 3 3. + <_> + + <_> + 7 8 4 8 -1. + <_> + 7 8 2 4 2. + <_> + 9 12 2 4 2. + <_> + + <_> + 4 2 14 12 -1. + <_> + 4 6 14 4 3. + <_> + + <_> + 4 14 2 6 -1. + <_> + 4 14 1 3 2. + <_> + 5 17 1 3 2. + <_> + + <_> + 7 11 2 4 -1. + <_> + 7 13 2 2 2. + <_> + + <_> + 6 4 10 15 -1. + <_> + 6 9 10 5 3. + <_> + + <_> + 6 11 12 6 -1. + <_> + 6 13 12 2 3. + <_> + + <_> + 6 17 4 3 -1. + <_> + 6 18 4 1 3. + <_> + + <_> + 6 17 4 3 -1. + <_> + 6 18 4 1 3. + <_> + + <_> + 9 13 3 7 -1. + <_> + 10 13 1 7 3. + <_> + + <_> + 2 8 5 2 -1. + <_> + 2 9 5 1 2. + <_> + + <_> + 14 1 3 8 -1. + <_> + 15 1 1 8 3. + <_> + + <_> + 2 12 1 2 -1. + <_> + 2 13 1 1 2. + <_> + + <_> + 8 6 2 2 -1. + <_> + 8 6 1 1 2. + <_> + 9 7 1 1 2. + <_> + + <_> + 4 3 10 12 -1. + <_> + 4 9 10 6 2. + <_> + + <_> + 5 9 8 4 -1. + <_> + 5 9 4 2 2. + <_> + 9 11 4 2 2. + <_> + + <_> + 9 9 4 4 -1. + <_> + 9 11 4 2 2. + <_> + + <_> + 5 10 4 2 -1. + <_> + 5 11 4 1 2. + <_> + + <_> + 6 17 2 1 -1. + <_> + 7 17 1 1 2. + <_> + + <_> + 12 12 2 1 -1. + <_> + 13 12 1 1 2. + <_> + + <_> + 11 6 4 8 -1. + <_> + 13 6 2 8 2. + <_> + + <_> + 9 4 3 10 -1. + <_> + 10 4 1 10 3. + <_> + + <_> + 0 18 9 2 -1. + <_> + 3 18 3 2 3. + <_> + + <_> + 15 13 3 3 -1. + <_> + 15 14 3 1 3. + <_> + + <_> + 9 12 2 2 -1. + <_> + 9 12 1 1 2. + <_> + 10 13 1 1 2. + <_> + + <_> + 13 12 7 3 -1. + <_> + 13 13 7 1 3. + <_> + + <_> + 14 10 6 2 -1. + <_> + 14 11 6 1 2. + <_> + + <_> + 14 5 5 14 -1. + <_> + 14 12 5 7 2. + <_> + + <_> + 4 16 5 3 -1. + <_> + 4 17 5 1 3. + <_> + + <_> + 5 16 5 3 -1. + <_> + 5 17 5 1 3. + <_> + + <_> + 8 14 4 5 -1. + <_> + 10 14 2 5 2. + <_> + + <_> + 9 14 2 1 -1. + <_> + 10 14 1 1 2. + <_> + + <_> + 6 10 6 2 -1. + <_> + 6 10 3 1 2. + <_> + 9 11 3 1 2. + <_> + + <_> + 5 8 6 6 -1. + <_> + 8 8 3 6 2. + <_> + + <_> + 10 13 7 6 -1. + <_> + 10 15 7 2 3. + <_> + + <_> + 4 1 2 8 -1. + <_> + 4 1 1 4 2. + <_> + 5 5 1 4 2. + <_> + + <_> + 3 6 6 4 -1. + <_> + 3 6 3 2 2. + <_> + 6 8 3 2 2. + <_> + + <_> + 15 2 3 13 -1. + <_> + 16 2 1 13 3. + <_> + + <_> + 16 10 2 6 -1. + <_> + 16 10 1 3 2. + <_> + 17 13 1 3 2. + <_> + + <_> + 13 19 2 1 -1. + <_> + 14 19 1 1 2. + <_> + + <_> + 7 11 2 1 -1. + <_> + 8 11 1 1 2. + <_> + + <_> + 4 10 3 4 -1. + <_> + 5 10 1 4 3. + <_> + + <_> + 4 7 2 4 -1. + <_> + 4 7 1 2 2. + <_> + 5 9 1 2 2. + <_> + + <_> + 10 7 5 4 -1. + <_> + 10 9 5 2 2. + <_> + + <_> + 7 4 8 16 -1. + <_> + 7 4 4 8 2. + <_> + 11 12 4 8 2. + <_> + + <_> + 5 9 10 6 -1. + <_> + 5 9 5 3 2. + <_> + 10 12 5 3 2. + <_> + + <_> + 5 11 3 2 -1. + <_> + 5 12 3 1 2. + <_> + + <_> + 12 12 4 8 -1. + <_> + 12 16 4 4 2. + <_> + + <_> + 8 13 6 2 -1. + <_> + 8 14 6 1 2. + <_> + + <_> + 3 12 5 6 -1. + <_> + 3 14 5 2 3. + <_> + + <_> + 16 0 2 2 -1. + <_> + 16 0 1 1 2. + <_> + 17 1 1 1 2. + <_> + + <_> + 13 3 3 4 -1. + <_> + 14 3 1 4 3. + <_> + + <_> + 15 11 3 1 -1. + <_> + 16 11 1 1 3. + <_> + + <_> + 14 0 6 5 -1. + <_> + 16 0 2 5 3. + <_> + + <_> + 10 1 8 18 -1. + <_> + 10 10 8 9 2. + <_> + + <_> + 11 5 3 2 -1. + <_> + 11 6 3 1 2. + <_> + + <_> + 5 5 2 1 -1. + <_> + 6 5 1 1 2. + <_> + + <_> + 3 4 3 3 -1. + <_> + 4 4 1 3 3. + <_> + + <_> + 11 14 1 3 -1. + <_> + 11 15 1 1 3. + <_> + + <_> + 16 13 3 3 -1. + <_> + 16 14 3 1 3. + <_> + + <_> + 15 8 5 12 -1. + <_> + 15 14 5 6 2. + <_> + + <_> + 3 0 3 10 -1. + <_> + 4 0 1 10 3. + <_> + + <_> + 15 15 1 2 -1. + <_> + 15 16 1 1 2. + <_> + + <_> + 15 0 4 2 -1. + <_> + 15 0 2 1 2. + <_> + 17 1 2 1 2. + <_> + + <_> + 17 2 2 1 -1. + <_> + 18 2 1 1 2. + <_> + + <_> + 8 13 1 3 -1. + <_> + 8 14 1 1 3. + <_> + + <_> + 9 1 2 6 -1. + <_> + 9 1 1 3 2. + <_> + 10 4 1 3 2. + <_> + + <_> + 1 12 9 3 -1. + <_> + 1 13 9 1 3. + <_> + + <_> + 12 14 3 3 -1. + <_> + 12 15 3 1 3. + <_> + + <_> + 15 10 3 1 -1. + <_> + 16 10 1 1 3. + <_> + + <_> + 9 6 9 1 -1. + <_> + 12 6 3 1 3. + <_> + + <_> + 12 5 3 7 -1. + <_> + 13 5 1 7 3. + <_> + + <_> + 8 2 2 2 -1. + <_> + 8 3 2 1 2. + <_> + + <_> + 7 0 9 2 -1. + <_> + 7 1 9 1 2. + <_> + + <_> + 13 5 2 5 -1. + <_> + 14 5 1 5 2. + <_> + + <_> + 14 2 3 6 -1. + <_> + 15 2 1 6 3. + <_> + + <_> + 8 6 4 3 -1. + <_> + 8 7 4 1 3. + <_> + + <_> + 6 8 1 9 -1. + <_> + 6 11 1 3 3. + <_> + + <_> + 3 9 7 6 -1. + <_> + 3 11 7 2 3. + <_> + + <_> + 6 6 2 3 -1. + <_> + 6 7 2 1 3. + <_> + + <_> + 5 9 3 1 -1. + <_> + 6 9 1 1 3. + <_> + + <_> + 4 5 4 4 -1. + <_> + 4 5 2 2 2. + <_> + 6 7 2 2 2. + <_> + + <_> + 8 5 2 3 -1. + <_> + 8 6 2 1 3. + <_> + + <_> + 5 6 4 7 -1. + <_> + 7 6 2 7 2. + <_> + + <_> + 10 8 3 5 -1. + <_> + 11 8 1 5 3. + <_> + + <_> + 11 4 3 13 -1. + <_> + 12 4 1 13 3. + <_> + + <_> + 2 13 3 3 -1. + <_> + 3 13 1 3 3. + <_> + + <_> + 4 8 3 2 -1. + <_> + 5 8 1 2 3. + <_> + + <_> + 0 4 1 3 -1. + <_> + 0 5 1 1 3. + <_> + + <_> + 7 6 6 6 -1. + <_> + 9 6 2 6 3. + <_> + + <_> + 7 7 4 12 -1. + <_> + 9 7 2 12 2. + <_> + + <_> + 6 12 6 3 -1. + <_> + 9 12 3 3 2. + <_> + + <_> + 8 6 9 12 -1. + <_> + 8 10 9 4 3. + <_> + + <_> + 11 0 3 15 -1. + <_> + 11 5 3 5 3. + <_> + + <_> + 8 16 6 4 -1. + <_> + 8 16 3 2 2. + <_> + 11 18 3 2 2. + <_> + + <_> + 6 5 10 6 -1. + <_> + 6 7 10 2 3. + <_> + + <_> + 2 12 3 4 -1. + <_> + 3 12 1 4 3. + <_> + + <_> + 9 13 4 3 -1. + <_> + 9 14 4 1 3. + <_> + + <_> + 3 0 4 6 -1. + <_> + 3 0 2 3 2. + <_> + 5 3 2 3 2. + <_> + + <_> + 5 9 6 1 -1. + <_> + 8 9 3 1 2. + <_> + + <_> + 11 14 2 3 -1. + <_> + 11 15 2 1 3. + <_> + + <_> + 5 8 2 1 -1. + <_> + 6 8 1 1 2. + <_> + + <_> + 17 0 3 12 -1. + <_> + 17 4 3 4 3. + <_> + + <_> + 10 13 3 6 -1. + <_> + 11 13 1 6 3. + <_> + + <_> + 10 13 3 7 -1. + <_> + 11 13 1 7 3. + <_> + + <_> + 6 5 6 1 -1. + <_> + 8 5 2 1 3. + <_> + + <_> + 18 2 2 8 -1. + <_> + 19 2 1 8 2. + <_> + + <_> + 5 8 3 1 -1. + <_> + 6 8 1 1 3. + <_> + + <_> + 8 7 4 6 -1. + <_> + 8 7 2 3 2. + <_> + 10 10 2 3 2. + <_> + + <_> + 8 3 2 2 -1. + <_> + 8 3 1 1 2. + <_> + 9 4 1 1 2. + <_> + + <_> + 18 5 2 3 -1. + <_> + 18 6 2 1 3. + <_> + + <_> + 17 7 3 4 -1. + <_> + 18 7 1 4 3. + <_> + + <_> + 8 2 2 4 -1. + <_> + 8 2 1 2 2. + <_> + 9 4 1 2 2. + <_> + + <_> + 4 6 2 2 -1. + <_> + 5 6 1 2 2. + <_> + + <_> + 4 8 3 1 -1. + <_> + 5 8 1 1 3. + <_> + + <_> + 10 9 9 10 -1. + <_> + 10 14 9 5 2. + <_> + + <_> + 6 4 3 1 -1. + <_> + 7 4 1 1 3. + <_> + + <_> + 8 14 1 3 -1. + <_> + 8 15 1 1 3. + <_> + + <_> + 6 4 2 1 -1. + <_> + 7 4 1 1 2. + <_> + + <_> + 5 9 3 9 -1. + <_> + 5 12 3 3 3. + <_> + + <_> + 5 13 7 3 -1. + <_> + 5 14 7 1 3. + <_> + + <_> + 9 6 2 10 -1. + <_> + 9 6 1 5 2. + <_> + 10 11 1 5 2. + <_> + + <_> + 13 1 3 18 -1. + <_> + 13 10 3 9 2. + <_> + + <_> + 5 13 2 3 -1. + <_> + 5 14 2 1 3. + <_> + + <_> + 9 10 3 7 -1. + <_> + 10 10 1 7 3. + <_> + + <_> + 17 0 3 13 -1. + <_> + 18 0 1 13 3. + <_> + + <_> + 13 6 1 2 -1. + <_> + 13 7 1 1 2. + <_> + + <_> + 6 15 3 2 -1. + <_> + 7 15 1 2 3. + <_> + + <_> + 5 14 2 3 -1. + <_> + 5 15 2 1 3. + <_> + + <_> + 16 6 1 6 -1. + <_> + 16 8 1 2 3. + <_> + + <_> + 0 6 2 2 -1. + <_> + 1 6 1 2 2. + <_> + + <_> + 3 12 4 8 -1. + <_> + 3 12 2 4 2. + <_> + 5 16 2 4 2. + <_> + + <_> + 6 2 2 8 -1. + <_> + 7 2 1 8 2. + <_> + + <_> + 6 7 2 6 -1. + <_> + 6 7 1 3 2. + <_> + 7 10 1 3 2. + <_> + + <_> + 5 12 4 2 -1. + <_> + 7 12 2 2 2. + <_> + + <_> + 4 9 13 2 -1. + <_> + 4 10 13 1 2. + <_> + + <_> + 19 5 1 2 -1. + <_> + 19 6 1 1 2. + <_> + + <_> + 4 8 9 1 -1. + <_> + 7 8 3 1 3. + <_> + + <_> + 8 8 2 1 -1. + <_> + 9 8 1 1 2. + <_> + + <_> + 3 0 2 10 -1. + <_> + 3 5 2 5 2. + <_> + + <_> + 6 2 2 1 -1. + <_> + 7 2 1 1 2. + <_> + + <_> + 14 5 3 3 -1. + <_> + 15 5 1 3 3. + <_> + + <_> + 4 8 2 2 -1. + <_> + 4 8 1 1 2. + <_> + 5 9 1 1 2. + <_> + + <_> + 8 16 9 2 -1. + <_> + 8 17 9 1 2. + <_> + + <_> + 6 7 2 3 -1. + <_> + 6 8 2 1 3. + <_> + + <_> + 12 11 2 2 -1. + <_> + 12 11 1 1 2. + <_> + 13 12 1 1 2. + <_> + + <_> + 15 9 2 4 -1. + <_> + 15 11 2 2 2. + <_> + + <_> + 5 11 2 3 -1. + <_> + 5 12 2 1 3. + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + <_> + + <_> + 6 12 1 6 -1. + <_> + 6 15 1 3 2. + <_> + + <_> + 6 9 5 9 -1. + <_> + 6 12 5 3 3. + <_> + + <_> + 8 11 2 2 -1. + <_> + 8 12 2 1 2. + <_> + + <_> + 8 10 4 2 -1. + <_> + 10 10 2 2 2. + <_> + + <_> + 8 10 4 6 -1. + <_> + 8 10 2 3 2. + <_> + 10 13 2 3 2. + <_> + + <_> + 2 0 9 20 -1. + <_> + 5 0 3 20 3. + <_> + + <_> + 12 3 2 4 -1. + <_> + 12 3 1 2 2. + <_> + 13 5 1 2 2. + <_> + + <_> + 15 0 2 10 -1. + <_> + 16 0 1 10 2. + <_> + + <_> + 13 7 3 4 -1. + <_> + 14 7 1 4 3. + <_> + + <_> + 14 10 1 2 -1. + <_> + 14 11 1 1 2. + <_> + + <_> + 16 11 3 1 -1. + <_> + 17 11 1 1 3. + <_> + + <_> + 16 11 2 2 -1. + <_> + 16 11 1 1 2. + <_> + 17 12 1 1 2. + <_> + + <_> + 13 12 6 1 -1. + <_> + 15 12 2 1 3. + <_> + + <_> + 3 2 14 9 -1. + <_> + 10 2 7 9 2. + <_> + + <_> + 5 4 12 2 -1. + <_> + 11 4 6 2 2. + <_> + + <_> + 13 6 2 1 -1. + <_> + 14 6 1 1 2. + <_> + + <_> + 7 10 3 3 -1. + <_> + 7 11 3 1 3. + <_> + + <_> + 16 17 4 2 -1. + <_> + 18 17 2 2 2. + <_> + + <_> + 4 12 8 8 -1. + <_> + 4 12 4 4 2. + <_> + 8 16 4 4 2. + <_> + + <_> + 14 8 4 5 -1. + <_> + 16 8 2 5 2. + <_> + + <_> + 11 8 6 2 -1. + <_> + 13 8 2 2 3. + <_> + + <_> + 4 5 16 5 -1. + <_> + 12 5 8 5 2. + <_> + + <_> + 14 9 6 10 -1. + <_> + 16 9 2 10 3. + <_> + + <_> + 4 18 3 1 -1. + <_> + 5 18 1 1 3. + <_> + + <_> + 4 13 4 4 -1. + <_> + 4 13 2 2 2. + <_> + 6 15 2 2 2. + <_> + + <_> + 6 15 2 3 -1. + <_> + 6 16 2 1 3. + <_> + + <_> + 6 15 1 3 -1. + <_> + 6 16 1 1 3. + <_> + + <_> + 7 17 3 1 -1. + <_> + 8 17 1 1 3. + <_> + + <_> + 7 17 3 1 -1. + <_> + 8 17 1 1 3. + <_> + + <_> + 9 10 4 1 -1. + <_> + 11 10 2 1 2. + <_> + + <_> + 11 12 2 1 -1. + <_> + 12 12 1 1 2. + <_> + + <_> + 7 8 1 6 -1. + <_> + 7 11 1 3 2. + <_> + + <_> + 6 7 3 3 -1. + <_> + 7 7 1 3 3. + <_> + + <_> + 13 10 1 3 -1. + <_> + 13 11 1 1 3. + <_> + + <_> + 5 8 2 4 -1. + <_> + 5 10 2 2 2. + <_> + + <_> + 5 8 6 6 -1. + <_> + 8 8 3 6 2. + <_> + + <_> + 6 5 4 13 -1. + <_> + 8 5 2 13 2. + <_> + + <_> + 8 4 10 8 -1. + <_> + 8 4 5 4 2. + <_> + 13 8 5 4 2. + <_> + + <_> + 8 3 9 6 -1. + <_> + 11 3 3 6 3. + <_> + + <_> + 11 0 6 3 -1. + <_> + 13 0 2 3 3. + <_> + + <_> + 11 1 3 15 -1. + <_> + 12 1 1 15 3. + <_> + + <_> + 4 8 14 9 -1. + <_> + 4 11 14 3 3. + <_> + + <_> + 11 2 1 16 -1. + <_> + 11 10 1 8 2. + <_> + + <_> + 12 1 2 14 -1. + <_> + 12 8 2 7 2. + <_> + + <_> + 11 1 3 4 -1. + <_> + 12 1 1 4 3. + <_> + + <_> + 9 8 4 2 -1. + <_> + 9 8 2 1 2. + <_> + 11 9 2 1 2. + <_> + + <_> + 17 3 2 2 -1. + <_> + 18 3 1 2 2. + <_> + + <_> + 2 6 3 2 -1. + <_> + 3 6 1 2 3. + <_> + + <_> + 9 8 2 2 -1. + <_> + 9 9 2 1 2. + <_> + + <_> + 6 15 6 1 -1. + <_> + 8 15 2 1 3. + <_> + + <_> + 16 10 2 4 -1. + <_> + 16 10 1 2 2. + <_> + 17 12 1 2 2. + <_> + + <_> + 6 6 10 6 -1. + <_> + 6 6 5 3 2. + <_> + 11 9 5 3 2. + <_> + + <_> + 13 8 3 3 -1. + <_> + 13 9 3 1 3. + <_> + + <_> + 13 0 4 2 -1. + <_> + 13 0 2 1 2. + <_> + 15 1 2 1 2. + <_> + + <_> + 10 0 10 2 -1. + <_> + 10 0 5 1 2. + <_> + 15 1 5 1 2. + <_> + + <_> + 13 13 2 1 -1. + <_> + 14 13 1 1 2. + <_> + + <_> + 4 9 2 2 -1. + <_> + 4 9 1 1 2. + <_> + 5 10 1 1 2. + <_> + + <_> + 6 8 2 3 -1. + <_> + 6 9 2 1 3. + <_> + + <_> + 2 12 2 3 -1. + <_> + 2 13 2 1 3. + <_> + + <_> + 2 0 10 2 -1. + <_> + 2 0 5 1 2. + <_> + 7 1 5 1 2. + <_> + + <_> + 6 2 2 2 -1. + <_> + 6 3 2 1 2. + <_> + + <_> + 5 10 8 2 -1. + <_> + 5 11 8 1 2. + <_> + + <_> + 11 7 5 10 -1. + <_> + 11 12 5 5 2. + <_> + + <_> + 5 10 4 3 -1. + <_> + 5 11 4 1 3. + <_> + + <_> + 9 6 6 12 -1. + <_> + 9 12 6 6 2. + <_> + + <_> + 16 10 3 5 -1. + <_> + 17 10 1 5 3. + <_> + + <_> + 15 12 2 4 -1. + <_> + 15 12 1 2 2. + <_> + 16 14 1 2 2. + <_> + + <_> + 8 0 12 8 -1. + <_> + 8 0 6 4 2. + <_> + 14 4 6 4 2. + <_> + + <_> + 14 1 5 3 -1. + <_> + 14 2 5 1 3. + <_> + + <_> + 2 2 3 6 -1. + <_> + 3 2 1 6 3. + <_> + + <_> + 6 5 2 2 -1. + <_> + 7 5 1 2 2. + <_> + + <_> + 7 12 12 1 -1. + <_> + 11 12 4 1 3. + <_> + + <_> + 13 9 7 2 -1. + <_> + 13 10 7 1 2. + <_> + + <_> + 5 10 1 3 -1. + <_> + 5 11 1 1 3. + <_> + + <_> + 0 4 15 2 -1. + <_> + 5 4 5 2 3. + <_> + + <_> + 3 0 9 13 -1. + <_> + 6 0 3 13 3. + <_> + + <_> + 5 10 6 2 -1. + <_> + 7 10 2 2 3. + <_> + + <_> + 8 3 4 2 -1. + <_> + 8 3 2 1 2. + <_> + 10 4 2 1 2. + <_> + + <_> + 8 7 2 6 -1. + <_> + 8 7 1 3 2. + <_> + 9 10 1 3 2. + <_> + + <_> + 8 7 2 3 -1. + <_> + 9 7 1 3 2. + <_> + + <_> + 5 11 3 3 -1. + <_> + 6 11 1 3 3. + <_> + + <_> + 0 1 1 2 -1. + <_> + 0 2 1 1 2. + <_> + + <_> + 7 0 1 6 -1. + <_> + 7 2 1 2 3. + <_> + + <_> + 14 0 2 5 -1. + <_> + 15 0 1 5 2. + <_> + + <_> + 3 2 12 1 -1. + <_> + 7 2 4 1 3. + <_> + + <_> + 11 13 5 2 -1. + <_> + 11 14 5 1 2. + <_> + + <_> + 13 14 1 3 -1. + <_> + 13 15 1 1 3. + <_> + + <_> + 7 17 12 2 -1. + <_> + 11 17 4 2 3. + <_> + + <_> + 0 0 13 20 -1. + <_> + 0 10 13 10 2. + <_> + + <_> + 4 7 10 12 -1. + <_> + 4 13 10 6 2. + <_> + + <_> + 10 12 2 2 -1. + <_> + 11 12 1 2 2. + <_> + + <_> + 9 11 4 4 -1. + <_> + 11 11 2 4 2. + <_> + + <_> + 4 9 16 5 -1. + <_> + 12 9 8 5 2. + <_> + + <_> + 16 9 2 4 -1. + <_> + 17 9 1 4 2. + <_> + + <_> + 15 9 3 1 -1. + <_> + 16 9 1 1 3. + <_> + + <_> + 14 3 4 11 -1. + <_> + 16 3 2 11 2. + <_> + + <_> + 4 3 10 10 -1. + <_> + 4 3 5 5 2. + <_> + 9 8 5 5 2. + <_> + + <_> + 16 9 3 1 -1. + <_> + 17 9 1 1 3. + <_> + + <_> + 6 4 14 9 -1. + <_> + 6 7 14 3 3. + <_> + + <_> + 8 11 2 4 -1. + <_> + 8 13 2 2 2. + <_> + + <_> + 5 9 6 8 -1. + <_> + 5 9 3 4 2. + <_> + 8 13 3 4 2. + <_> + + <_> + 5 11 4 4 -1. + <_> + 5 13 4 2 2. + <_> + + <_> + 7 14 1 3 -1. + <_> + 7 15 1 1 3. + <_> + + <_> + 9 10 3 1 -1. + <_> + 10 10 1 1 3. + <_> + + <_> + 4 8 2 4 -1. + <_> + 4 8 1 2 2. + <_> + 5 10 1 2 2. + <_> + + <_> + 14 6 2 5 -1. + <_> + 15 6 1 5 2. + <_> + + <_> + 13 7 6 7 -1. + <_> + 15 7 2 7 3. + <_> + + <_> + 15 6 4 7 -1. + <_> + 17 6 2 7 2. + <_> + + <_> + 9 11 6 5 -1. + <_> + 11 11 2 5 3. + <_> + + <_> + 0 8 20 4 -1. + <_> + 10 8 10 4 2. + <_> + + <_> + 1 2 8 14 -1. + <_> + 1 2 4 7 2. + <_> + 5 9 4 7 2. + <_> + + <_> + 10 13 3 1 -1. + <_> + 11 13 1 1 3. + <_> + + <_> + 7 0 6 4 -1. + <_> + 9 0 2 4 3. + <_> + + <_> + 7 14 6 2 -1. + <_> + 7 14 3 1 2. + <_> + 10 15 3 1 2. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_righteye_2splits.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_righteye_2splits.xml new file mode 100644 index 0000000000000000000000000000000000000000..db4571cde604f8089dc563a5d5652b79e246483d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_righteye_2splits.xml @@ -0,0 +1,7407 @@ + + + +BOOST + HAAR + 20 + 20 + + 34 + + 0 + 20 + + <_> + 5 + -2.2325520515441895e+00 + + <_> + + 1 0 0 -4.8210550099611282e-02 -1 -2 1 + -4.1576199233531952e-02 + + -8.6140447854995728e-01 9.1769057512283325e-01 + -2.1284009516239166e-01 + <_> + + 0 1 2 9.3528684228658676e-03 -1 -2 3 -2.2144919785205275e-04 + + -6.9785767793655396e-01 7.9523372650146484e-01 + -4.8948091268539429e-01 + <_> + + 0 1 4 -2.1853350102901459e-02 -1 -2 5 9.9672928452491760e-02 + + 7.0574641227722168e-01 -7.0666241645812988e-01 + 7.9210978746414185e-01 + <_> + + 1 0 6 -2.1664820611476898e-02 -1 -2 7 + -7.5680727604776621e-04 + + -6.0898607969284058e-01 7.1685701608657837e-01 + -3.0464568734169006e-01 + <_> + + 1 0 8 -1.3333049602806568e-02 -1 -2 9 9.2925298959016800e-03 + + -4.6844691038131714e-01 6.4235931634902954e-01 + -5.1180428266525269e-01 + <_> + 5 + -2.1598019599914551e+00 + + <_> + + 0 1 10 -3.3948719501495361e-01 -1 -2 11 + -1.3672479987144470e-01 + + 7.7913260459899902e-01 2.6421278715133667e-01 + -8.7910091876983643e-01 + <_> + + 0 1 12 3.1394500285387039e-02 -1 -2 13 + -1.0828140191733837e-02 + + -6.9956701993942261e-01 7.6504492759704590e-01 + -4.3719211220741272e-01 + <_> + + 1 0 14 -4.2506768368184566e-03 -1 -2 15 + -2.2675469517707825e-02 + + -5.7561582326889038e-01 7.4080592393875122e-01 + -3.6677250266075134e-01 + <_> + + 1 0 16 3.9161480963230133e-02 -1 -2 17 + -3.1934089493006468e-03 + + 6.4045161008834839e-01 1.6047589480876923e-01 + -7.1010977029800415e-01 + <_> + + 1 0 18 2.5321990251541138e-02 -1 -2 19 + 7.7583367237821221e-04 + + 4.9574860930442810e-01 -7.1737897396087646e-01 + -1.8581770360469818e-02 + <_> + 8 + -2.3451159000396729e+00 + + <_> + + 1 0 20 -2.6554059982299805e-01 -1 -2 21 + -2.2532779723405838e-02 + + -8.4712451696395874e-01 8.7977188825607300e-01 + -3.3394691348075867e-01 + <_> + + 0 1 22 8.5310067515820265e-04 -1 -2 23 + 1.5820249973330647e-04 + + -8.2032448053359985e-01 -7.5176358222961426e-01 + 6.7769712209701538e-01 + <_> + + 1 0 24 -1.0837490117410198e-04 -1 -2 25 + 2.6810260023921728e-03 + + -8.3314001560211182e-01 5.3844749927520752e-01 + -7.6534157991409302e-01 + <_> + + 0 1 26 8.5202371701598167e-04 -1 -2 27 + -1.2241739779710770e-02 + + -7.7514898777008057e-01 6.3240152597427368e-01 + -6.3395208120346069e-01 + <_> + + 1 0 28 6.2314196838997304e-05 -1 -2 29 + -7.1911108493804932e-01 + + 4.4290411472320557e-01 8.0135929584503174e-01 + -5.3431099653244019e-01 + <_> + + 1 0 30 -2.4280339479446411e-02 -1 -2 31 + 3.4558640327304602e-03 + + -6.7797917127609253e-01 4.9030610918998718e-01 + -8.8447982072830200e-01 + <_> + + 1 0 32 -6.2993327446747571e-05 -1 -2 33 + -4.6443562023341656e-03 + + -5.7883417606353760e-01 -8.5878807306289673e-01 + 5.2454602718353271e-01 + <_> + + 1 0 34 -4.0299328247783706e-05 -1 -2 35 + -3.7485519424080849e-03 + + -5.2713459730148315e-01 -8.5626190900802612e-01 + 4.8944610357284546e-01 + <_> + 10 + -2.3431489467620850e+00 + + <_> + + 0 1 36 -3.8377079367637634e-01 -1 -2 37 + -1.3837030529975891e-01 + + 7.1715021133422852e-01 3.4392359852790833e-01 + -7.9931277036666870e-01 + <_> + + 0 1 38 3.3107071067206562e-04 -1 -2 39 + -5.1273438148200512e-03 + + -6.8352431058883667e-01 5.8250617980957031e-01 + -4.0955001115798950e-01 + <_> + + 1 0 40 -2.6100680232048035e-02 -1 -2 41 + -1.0628979653120041e-03 + + -4.3713301420211792e-01 7.0680737495422363e-01 + -2.6817938685417175e-01 + <_> + + 0 1 42 -9.7854852676391602e-02 -1 -2 43 + -1.1829820275306702e-01 + + 7.3940038681030273e-01 6.3814181089401245e-01 + -3.8721871376037598e-01 + <_> + + 1 0 44 -7.5409049168229103e-03 -1 -2 45 + 2.6851659640669823e-03 + + -4.8803019523620605e-01 3.9083468914031982e-01 + -6.5561538934707642e-01 + <_> + + 0 1 46 1.6870240215212107e-03 -1 -2 47 + -3.8136160001158714e-03 + + -4.9891749024391174e-01 -6.6405588388442993e-01 + 4.0650749206542969e-01 + <_> + + 1 0 48 2.0289309322834015e-03 -1 -2 49 + -7.6308869756758213e-03 + + -6.9989210367202759e-01 4.3206840753555298e-01 + -2.9664969444274902e-01 + <_> + + 1 0 50 -3.3815231290645897e-04 -1 -2 51 + 7.5163291767239571e-03 + + -4.6808540821075439e-01 3.6521491408348083e-01 + -7.6014542579650879e-01 + <_> + + 1 0 52 6.1479508876800537e-02 -1 -2 53 + -4.6286579221487045e-02 + + 5.6990629434585571e-01 2.2625060379505157e-01 + -4.5330780744552612e-01 + <_> + + 1 0 54 4.6903551556169987e-03 -1 -2 55 + 1.8803169950842857e-03 + + -7.7286708354949951e-01 2.7349120378494263e-01 + -6.6667830944061279e-01 + <_> + 8 + -2.1268370151519775e+00 + + <_> + + 1 0 56 -5.5420672893524170e-01 -1 -2 57 + -6.9329799152910709e-03 + + -6.0620260238647461e-01 7.8542029857635498e-01 + -3.5522121191024780e-01 + <_> + + 0 1 58 -2.1169960498809814e-02 -1 -2 59 + -6.7428398132324219e-01 + + 5.2947688102722168e-01 4.6065220236778259e-01 + -7.0058208703994751e-01 + <_> + + 1 0 60 -4.2725078761577606e-02 -1 -2 61 + -1.0109329596161842e-02 + + -5.9904807806015015e-01 6.8109220266342163e-01 + -2.0731879770755768e-01 + <_> + + 0 1 62 6.5861130133271217e-03 -1 -2 63 + -7.6380418613553047e-03 + + -5.2420848608016968e-01 -7.0169782638549805e-01 + 4.4100138545036316e-01 + <_> + + 0 1 64 -9.7681581974029541e-02 -1 -2 65 + 1.0197360068559647e-02 + + 5.7708740234375000e-01 -9.8518550395965576e-02 + -8.8111698627471924e-01 + <_> + + 0 1 66 -2.5724549777805805e-03 -1 -2 67 + 2.6594230439513922e-03 + + -8.3233338594436646e-01 3.0995351076126099e-01 + -8.1609177589416504e-01 + <_> + + 1 0 68 -1.0042720241472125e-03 -1 -2 69 + 2.6080000679939985e-03 + + -4.3558520078659058e-01 3.3566600084304810e-01 + -8.1889331340789795e-01 + <_> + + 1 0 70 4.9724509008228779e-03 -1 -2 71 + 1.2243240140378475e-02 + + -7.7048182487487793e-01 2.2534200549125671e-01 + -6.8695551156997681e-01 + <_> + 10 + -2.0604379177093506e+00 + + <_> + + 1 0 72 -5.7784929871559143e-02 -1 -2 73 + -1.7517809756100178e-03 + + -7.0516008138656616e-01 8.5655921697616577e-01 + -9.2403419315814972e-02 + <_> + + 1 0 74 -1.1522379703819752e-02 -1 -2 75 + -3.8323760963976383e-03 + + -4.2749640345573425e-01 7.5913530588150024e-01 + -1.0894049704074860e-01 + <_> + + 1 0 76 -8.0922387540340424e-02 -1 -2 77 + -6.2537011690437794e-03 + + -3.1364768743515015e-01 6.9995921850204468e-01 + -1.1805690079927444e-01 + <_> + + 0 1 78 -1.2227860093116760e-01 -1 -2 79 + -6.4168110489845276e-02 + + 5.2072501182556152e-01 3.9272749423980713e-01 + -4.2194411158561707e-01 + <_> + + 1 0 80 -5.3712888620793819e-04 -1 -2 81 + -2.8175620827823877e-03 + + -4.9524548649787903e-01 4.1350141167640686e-01 + -3.8919278979301453e-01 + <_> + + 0 1 82 -3.6368549335747957e-03 -1 -2 83 + -1.3223909772932529e-03 + + 6.7615020275115967e-01 4.3426999449729919e-01 + -3.7642130255699158e-01 + <_> + + 0 1 84 3.7143539520911872e-04 -1 -2 85 + -5.0255712121725082e-03 + + -5.5630880594253540e-01 -5.2328592538833618e-01 + 3.4646821022033691e-01 + <_> + + 1 0 86 -9.2711612523999065e-05 -1 -2 87 + 1.9847028888761997e-03 + + -4.9652668833732605e-01 3.3401641249656677e-01 + -6.2446892261505127e-01 + <_> + + 1 0 88 4.7203440219163895e-02 -1 -2 89 + -6.8562600063160062e-05 + + 5.7562619447708130e-01 2.6172660291194916e-02 + -6.0849070549011230e-01 + <_> + + 1 0 90 7.5034219771623611e-03 -1 -2 91 + 6.3834791071712971e-03 + + -6.8576759099960327e-01 -1.7312510311603546e-01 + 3.8560429215431213e-01 + <_> + 12 + -2.3187489509582520e+00 + + <_> + + 1 0 92 -1.5584450215101242e-02 -1 -2 93 + 1.4557019807398319e-02 + + -6.6648960113525391e-01 -4.3745130300521851e-01 + 7.2227817773818970e-01 + <_> + + 1 0 94 -5.7889888994395733e-03 -1 -2 95 + -8.1936769187450409e-02 + + -4.3183240294456482e-01 6.8467652797698975e-01 + -2.2546729445457458e-01 + <_> + + 1 0 96 -4.2995368130505085e-03 -1 -2 97 + -1.3736640103161335e-02 + + -5.2409631013870239e-01 6.1626207828521729e-01 + -3.5893160104751587e-01 + <_> + + 1 0 98 -4.8069912008941174e-03 -1 -2 99 + -7.7131099998950958e-02 + + -4.2382389307022095e-01 6.0599362850189209e-01 + -3.1555330753326416e-01 + <_> + + 0 1 100 4.4640208943746984e-04 -1 -2 101 + 3.4841578453779221e-02 + + -4.9206110835075378e-01 -4.1017889976501465e-02 + 6.1330878734588623e-01 + <_> + + 0 1 102 8.2969048526138067e-04 -1 -2 103 + -7.8510129242204130e-05 + + -4.5479419827461243e-01 4.0007328987121582e-01 + -2.0888769626617432e-01 + <_> + + 1 0 104 4.6054688282310963e-03 -1 -2 105 + -7.1904482319951057e-03 + + -6.7931377887725830e-01 4.7060671448707581e-01 + -1.4138610661029816e-01 + <_> + + 0 1 106 -5.5724480189383030e-03 -1 -2 107 + -7.0458237314596772e-04 + + -7.0525509119033813e-01 3.6097851395606995e-01 + -1.8361540138721466e-01 + <_> + + 1 0 108 1.8595060333609581e-02 -1 -2 109 + 5.0072550773620605e-02 + + 4.1765761375427246e-01 -4.1869449615478516e-01 + 2.8186509013175964e-01 + <_> + + 1 0 110 -2.0355919376015663e-02 -1 -2 111 + -2.8686519712209702e-02 + + -3.6494150757789612e-01 -5.3867787122726440e-01 + 3.4767881035804749e-01 + <_> + + 1 0 112 -7.1101690991781652e-05 -1 -2 113 + 2.0686469506472349e-03 + + -4.0156790614128113e-01 3.2963660359382629e-01 + -7.0951050519943237e-01 + <_> + + 1 0 114 1.1430920567363501e-03 -1 -2 115 + -8.8636036962270737e-03 + + 4.4172981381416321e-01 1.8426130712032318e-01 + -4.1275170445442200e-01 + <_> + 15 + -2.2203750610351562e+00 + + <_> + + 1 0 116 -7.7637642621994019e-02 -1 -2 117 + -8.4830820560455322e-03 + + -4.9321529269218445e-01 7.8138542175292969e-01 + -3.6062291264533997e-01 + <_> + + 1 0 118 -1.7180460272356868e-03 -1 -2 119 + 2.4740949273109436e-02 + + -4.7690048813819885e-01 -3.2420080900192261e-01 + 5.9280002117156982e-01 + <_> + + 0 1 120 3.3028100151568651e-03 -1 -2 121 + -3.4622039645910263e-02 + + -5.3991597890853882e-01 5.2076727151870728e-01 + -3.3530798554420471e-01 + <_> + + 1 0 122 -7.1505777304992080e-04 -1 -2 123 + -9.0145105496048927e-03 + + -4.8981699347496033e-01 -7.7969801425933838e-01 + 3.6586359143257141e-01 + <_> + + 1 0 124 -1.0250939521938562e-03 -1 -2 125 + -5.5693178437650204e-03 + + -4.6970510482788086e-01 -6.9695621728897095e-01 + 3.5025438666343689e-01 + <_> + + 0 1 126 1.3235070509836078e-03 -1 -2 127 + -3.3737940248101950e-03 + + -4.4707980751991272e-01 -5.6195151805877686e-01 + 3.1833809614181519e-01 + <_> + + 1 0 128 -6.4095242123585194e-05 -1 -2 129 + -2.7294119354337454e-03 + + -3.5473638772964478e-01 4.1285240650177002e-01 + -3.1416821479797363e-01 + <_> + + 0 1 130 6.3087652961257845e-05 -1 -2 131 + -1.5436099842190742e-02 + + -3.5946568846702576e-01 -6.1329078674316406e-01 + 3.4301999211311340e-01 + <_> + + 0 1 132 -2.1025019232183695e-03 -1 -2 133 + -1.6849569976329803e-02 + + -7.6962250471115112e-01 3.6569809913635254e-01 + -2.1210379898548126e-01 + <_> + + 0 1 134 5.6847798987291753e-05 -1 -2 135 + 5.9984489344060421e-03 + + -4.0466558933258057e-01 2.8503778576850891e-01 + -5.8756178617477417e-01 + <_> + + 1 0 136 6.1389962211251259e-03 -1 -2 137 + -2.8117469628341496e-04 + + -8.7189829349517822e-01 2.5182509422302246e-01 + -3.1868219375610352e-01 + <_> + + 1 0 138 -4.5429798774421215e-03 -1 -2 139 + -3.2167110592126846e-02 + + -3.6724218726158142e-01 -7.9481202363967896e-01 + 2.8887200355529785e-01 + <_> + + 1 0 140 5.0912089645862579e-03 -1 -2 141 + -1.5173070132732391e-03 + + -7.1477490663528442e-01 4.4514629244804382e-01 + -9.5207341015338898e-02 + <_> + + 1 0 142 -6.0079508693888783e-04 -1 -2 143 + 4.4868541881442070e-03 + + -3.6021450161933899e-01 2.8276360034942627e-01 + -7.2084128856658936e-01 + <_> + + 1 0 144 -3.7957848981022835e-03 -1 -2 145 + -9.1829998418688774e-03 + + -2.8717440366744995e-01 5.0479042530059814e-01 + -7.0781037211418152e-02 + <_> + 17 + -2.1757249832153320e+00 + + <_> + + 1 0 146 -5.5760249495506287e-02 -1 -2 147 + -5.9436690062284470e-02 + + -5.5854648351669312e-01 6.8943697214126587e-01 + -3.7195080518722534e-01 + <_> + + 0 1 148 -5.4637178778648376e-02 -1 -2 149 + 2.3608359694480896e-01 + + 5.3040331602096558e-01 -4.7355309128761292e-01 + 4.6322488784790039e-01 + <_> + + 1 0 150 -9.4560505822300911e-03 -1 -2 151 + -5.3182709962129593e-02 + + -3.2544779777526855e-01 6.3468569517135620e-01 + -2.8268361091613770e-01 + <_> + + 1 0 152 -1.0638199746608734e-02 -1 -2 153 + -2.1207019686698914e-02 + + -5.5776351690292358e-01 3.9049190282821655e-01 + -4.2111930251121521e-01 + <_> + + 1 0 154 -5.6731878430582583e-05 -1 -2 155 + -4.4976451317779720e-04 + + -4.1803309321403503e-01 3.7355789542198181e-01 + -3.9199641346931458e-01 + <_> + + 1 0 156 2.7574670966714621e-03 -1 -2 157 + 2.5649419985711575e-03 + + -7.9104632139205933e-01 1.9258180260658264e-01 + -7.5344461202621460e-01 + <_> + + 0 1 158 -9.4359368085861206e-03 -1 -2 159 + 1.4136210083961487e-03 + + 4.4834750890731812e-01 -3.3878430724143982e-01 + 4.4291919469833374e-01 + <_> + + 1 0 160 3.9976350963115692e-03 -1 -2 161 + -1.5278969658538699e-03 + + -6.6637581586837769e-01 3.1292399764060974e-01 + -2.8027990460395813e-01 + <_> + + 1 0 162 -3.2376639865105972e-05 -1 -2 163 + 1.6323389718309045e-03 + + -4.6672090888023376e-01 2.7995559573173523e-01 + -6.1321508884429932e-01 + <_> + + 1 0 164 7.7096219174563885e-03 -1 -2 165 + -7.8599318861961365e-02 + + 2.0352549850940704e-01 7.2726912796497345e-02 + -6.8677097558975220e-01 + <_> + + 0 1 166 -3.6581400781869888e-03 -1 -2 167 + -4.2612198740243912e-02 + + -6.8079459667205811e-01 -8.4551781415939331e-01 + 1.5990570187568665e-01 + <_> + + 1 0 168 -4.8822778626345098e-04 -1 -2 169 + -4.6951142139732838e-03 + + -4.7945699095726013e-01 -8.2234281301498413e-01 + 2.0431579649448395e-01 + <_> + + 0 1 170 6.1706348787993193e-05 -1 -2 171 + 1.3809910044074059e-02 + + -3.1742820143699646e-01 3.0769300460815430e-01 + -4.3544968962669373e-01 + <_> + + 0 1 172 -4.2187729850411415e-03 -1 -2 173 + -3.9540808647871017e-03 + + 6.2499982118606567e-01 1.3225209712982178e-01 + -3.9745101332664490e-01 + <_> + + 1 0 174 2.2203531116247177e-03 -1 -2 175 + 6.2806582718621939e-05 + + -6.0045331716537476e-01 -2.2429980337619781e-01 + 2.9768520593643188e-01 + <_> + + 1 0 176 2.3292789701372385e-03 -1 -2 177 + -5.3711822256445885e-03 + + -7.5982081890106201e-01 2.6484918594360352e-01 + -2.6005539298057556e-01 + <_> + + 0 1 178 6.4782587287481874e-05 -1 -2 179 + 7.6606678776443005e-03 + + -3.2119300961494446e-01 2.4176409840583801e-01 + -8.3822727203369141e-01 + <_> + 19 + -2.2618789672851562e+00 + + <_> + + 1 0 180 -1.4848279766738415e-02 -1 -2 181 + -1.6066679963842034e-03 + + -5.3391128778457642e-01 7.6002711057662964e-01 + -2.1091739833354950e-01 + <_> + + 1 0 182 -1.5651920437812805e-01 -1 -2 183 + -5.5439779534935951e-03 + + -4.2818549275398254e-01 6.5620750188827515e-01 + -2.2949840128421783e-01 + <_> + + 1 0 184 -1.9448339939117432e-02 -1 -2 185 + 7.6653067953884602e-03 + + -4.4212520122528076e-01 -3.3950591087341309e-01 + 4.6587219834327698e-01 + <_> + + 0 1 186 -2.1142010390758514e-01 -1 -2 187 + -1.0628429800271988e-01 + + 5.5007970333099365e-01 6.8280947208404541e-01 + -3.0987739562988281e-01 + <_> + + 1 0 188 -5.2653599530458450e-02 -1 -2 189 + -5.3522300731856376e-05 + + -3.4818819165229797e-01 5.0566762685775757e-01 + -2.5229519605636597e-01 + <_> + + 0 1 190 -5.7972650974988937e-03 -1 -2 191 + -3.7428899668157101e-03 + + 3.0238011479377747e-01 2.2873230278491974e-01 + -4.8366579413414001e-01 + <_> + + 1 0 192 -5.2694038458866999e-05 -1 -2 193 + -1.1983739677816629e-03 + + -3.7988960742950439e-01 -6.7442452907562256e-01 + 2.8611260652542114e-01 + <_> + + 1 0 194 2.2544799372553825e-02 -1 -2 195 + 3.1783939339220524e-03 + + 4.7565719485282898e-01 -2.8893348574638367e-01 + 5.5509638786315918e-01 + <_> + + 1 0 196 3.4742769785225391e-03 -1 -2 197 + -8.1408787518739700e-03 + + -5.9826552867889404e-01 -5.5933791399002075e-01 + 2.2349210083484650e-01 + <_> + + 0 1 198 -3.0238809995353222e-03 -1 -2 199 + -5.9159598313271999e-03 + + 4.5917978882789612e-01 6.2234902381896973e-01 + -2.4468150734901428e-01 + <_> + + 1 0 200 2.3184430319815874e-03 -1 -2 201 + 7.7198208309710026e-03 + + -6.0478079319000244e-01 2.1004509925842285e-01 + -6.4331281185150146e-01 + <_> + + 0 1 202 -5.5973320268094540e-03 -1 -2 203 + 2.0320380281191319e-04 + + -7.1625810861587524e-01 -3.8018029928207397e-01 + 2.1336899697780609e-01 + <_> + + 1 0 204 -3.8205389864742756e-03 -1 -2 205 + 4.8883338458836079e-03 + + -3.5957258939743042e-01 2.6471930742263794e-01 + -5.8996689319610596e-01 + <_> + + 0 1 206 -1.3334590476006269e-03 -1 -2 207 + -1.5447080368176103e-03 + + 3.2258489727973938e-01 3.6971050500869751e-01 + -3.1308570504188538e-01 + <_> + + 0 1 208 7.5150746852159500e-05 -1 -2 209 + -1.1108840117231011e-03 + + -3.4674531221389771e-01 -5.7477539777755737e-01 + 2.9201140999794006e-01 + <_> + + 1 0 210 -1.6881119518075138e-04 -1 -2 211 + -1.2814450019504875e-04 + + -3.6041781306266785e-01 3.5043209791183472e-01 + -2.2014050185680389e-01 + <_> + + 1 0 212 1.9546970725059509e-02 -1 -2 213 + -1.1061180382966995e-02 + + 4.1295918822288513e-01 2.5962719321250916e-01 + -3.4875950217247009e-01 + <_> + + 1 0 214 1.8147419905290008e-03 -1 -2 215 + -7.1724010631442070e-03 + + -5.2019888162612915e-01 2.7452668547630310e-01 + -2.6828849315643311e-01 + <_> + + 1 0 216 2.2158189676702023e-03 -1 -2 217 + -9.6856858581304550e-03 + + -5.7340908050537109e-01 -5.8028572797775269e-01 + 1.8564410507678986e-01 + <_> + 19 + -2.0994780063629150e+00 + + <_> + + 0 1 218 -1.2065219692885876e-02 -1 -2 219 + -4.9067771434783936e-01 + + 6.1679571866989136e-01 1.4063939452171326e-01 + -5.5357742309570312e-01 + <_> + + 1 0 220 -6.6585717722773552e-03 -1 -2 221 + 1.5827560797333717e-02 + + -5.1332288980484009e-01 -3.6301520466804504e-01 + 4.3343341350555420e-01 + <_> + + 0 1 222 -1.4081180095672607e-02 -1 -2 223 + -1.2139449827373028e-02 + + 5.4223722219467163e-01 4.4281288981437683e-01 + -3.4171119332313538e-01 + <_> + + 0 1 224 7.8055798076093197e-03 -1 -2 225 + -7.0759910158813000e-05 + + -4.8659759759902954e-01 3.4818679094314575e-01 + -3.2806739211082458e-01 + <_> + + 0 1 226 -1.8199630081653595e-02 -1 -2 227 + -2.5289389304816723e-03 + + 5.6594151258468628e-01 1.1310060322284698e-01 + -4.0772381424903870e-01 + <_> + + 1 0 228 1.0156990028917789e-03 -1 -2 229 + 2.9432660085149109e-04 + + -5.9842979907989502e-01 2.8439450263977051e-01 + -3.2190230488777161e-01 + <_> + + 1 0 230 2.0865290425717831e-03 -1 -2 231 + -1.7371569992974401e-03 + + -7.8285712003707886e-01 3.3585301041603088e-01 + -2.0582370460033417e-01 + <_> + + 1 0 232 -7.0026202592998743e-05 -1 -2 233 + -1.4891549944877625e-03 + + -3.9109349250793457e-01 -4.6953418850898743e-01 + 2.7609241008758545e-01 + <_> + + 1 0 234 -1.1788429692387581e-02 -1 -2 235 + -1.5155089786276221e-03 + + -4.0114149451255798e-01 -7.4290478229522705e-01 + 2.7695629000663757e-01 + <_> + + 1 0 236 6.8396717309951782e-02 -1 -2 237 + -7.6441407203674316e-02 + + 4.5235648751258850e-01 4.2848169803619385e-01 + -3.1636309623718262e-01 + <_> + + 1 0 238 6.8310201168060303e-02 -1 -2 239 + -6.4508013427257538e-02 + + 5.1404279470443726e-01 1.8081870675086975e-01 + -3.4217950701713562e-01 + <_> + + 0 1 240 -2.8335719835013151e-03 -1 -2 241 + -9.9732237868010998e-04 + + -6.9509768486022949e-01 -4.3724590539932251e-01 + 2.0226080715656281e-01 + <_> + + 0 1 242 -2.2869910299777985e-01 -1 -2 243 + 2.9855249449610710e-03 + + 6.4662200212478638e-01 8.1149758771061897e-03 + -6.0210299491882324e-01 + <_> + + 0 1 244 -2.9535989742726088e-03 -1 -2 245 + -2.1225619129836559e-03 + + -7.2013127803802490e-01 5.0875622034072876e-01 + -5.9366609901189804e-02 + <_> + + 0 1 246 -2.9382819775491953e-03 -1 -2 247 + -5.8961478061974049e-03 + + 3.9287531375885010e-01 4.1866040229797363e-01 + -2.5405511260032654e-01 + <_> + + 1 0 248 2.5730929337441921e-03 -1 -2 249 + 1.6647739335894585e-02 + + -5.8707278966903687e-01 1.9208480417728424e-01 + -6.0388940572738647e-01 + <_> + + 1 0 250 2.4041840806603432e-03 -1 -2 251 + -9.0452830772846937e-04 + + -5.7192337512969971e-01 3.4860768914222717e-01 + -1.3049240410327911e-01 + <_> + + 1 0 252 4.0814210660755634e-03 -1 -2 253 + 3.3811479806900024e-03 + + 5.1778018474578857e-01 -6.3828541897237301e-03 + -6.1447817087173462e-01 + <_> + + 0 1 254 -2.7499340940266848e-03 -1 -2 255 + -4.8207710497081280e-03 + + -6.5407788753509521e-01 -6.0029619932174683e-01 + 1.4374589920043945e-01 + <_> + 21 + -2.1254189014434814e+00 + + <_> + + 0 1 256 7.9710120335221291e-03 -1 -2 257 + -9.7160867881029844e-04 + + -6.1992239952087402e-01 5.4877161979675293e-01 + -4.0606960654258728e-01 + <_> + + 0 1 258 -1.0945869609713554e-02 -1 -2 259 + -6.1174821108579636e-02 + + 4.6936869621276855e-01 3.0570849776268005e-01 + -4.4459891319274902e-01 + <_> + + 1 0 260 -2.3100150283426046e-03 -1 -2 261 + -4.7585051506757736e-02 + + -3.7816441059112549e-01 4.8865839838981628e-01 + -2.9728868603706360e-01 + <_> + + 1 0 262 -2.5944279041141272e-03 -1 -2 263 + -3.9469371549785137e-03 + + -5.4405367374420166e-01 3.6382490396499634e-01 + -3.0469849705696106e-01 + <_> + + 0 1 264 3.1871569808572531e-04 -1 -2 265 + -2.6655721012502909e-03 + + -4.6822971105575562e-01 3.3131968975067139e-01 + -2.9918238520622253e-01 + <_> + + 1 0 266 -3.9534650743007660e-02 -1 -2 267 + -9.4085611635819077e-04 + + -3.5316830873489380e-01 4.4447100162506104e-01 + -1.1088660359382629e-01 + <_> + + 0 1 268 6.9526307925116271e-05 -1 -2 269 + -9.6976682543754578e-03 + + -3.9403268694877625e-01 5.7181888818740845e-01 + -1.6370950266718864e-02 + <_> + + 1 0 270 3.9469040930271149e-02 -1 -2 271 + -8.2811042666435242e-03 + + 6.9152122735977173e-01 1.3349990546703339e-01 + -4.7064480185508728e-01 + <_> + + 0 1 272 -4.3219728395342827e-03 -1 -2 273 + -5.5436040274798870e-03 + + 3.8239258527755737e-01 1.5645879507064819e-01 + -4.1088208556175232e-01 + <_> + + 1 0 274 -5.9953341406071559e-05 -1 -2 275 + -5.9089371934533119e-03 + + -3.9221799373626709e-01 -5.9083867073059082e-01 + 2.7924481034278870e-01 + <_> + + 0 1 276 -4.4721391052007675e-02 -1 -2 277 + 4.1267018765211105e-02 + + 4.1454491019248962e-01 -3.2242009043693542e-01 + 3.7849879264831543e-01 + <_> + + 0 1 278 5.6728709751041606e-05 -1 -2 279 + -6.2427870929241180e-02 + + -3.2228040695190430e-01 -5.9666448831558228e-01 + 2.8915780782699585e-01 + <_> + + 0 1 280 -5.6994128972291946e-03 -1 -2 281 + 7.5202910229563713e-03 + + 3.7499341368675232e-01 -2.8132459521293640e-01 + 5.0988858938217163e-01 + <_> + + 0 1 282 -3.3640549518167973e-03 -1 -2 283 + -6.8076648749411106e-03 + + -6.3978207111358643e-01 -7.3105818033218384e-01 + 1.4475250244140625e-01 + <_> + + 1 0 284 1.2633459642529488e-02 -1 -2 285 + -2.9199919663369656e-03 + + -7.7725297212600708e-01 2.3258599638938904e-01 + -2.0490600168704987e-01 + <_> + + 0 1 286 -3.0582249164581299e-02 -1 -2 287 + -2.7796169742941856e-03 + + -6.5738821029663086e-01 -5.4888349771499634e-01 + 1.3837890326976776e-01 + <_> + + 0 1 288 -7.6163080520927906e-03 -1 -2 289 + -1.8409560434520245e-03 + + -3.5912349820137024e-01 2.2404469549655914e-01 + -3.7881860136985779e-01 + <_> + + 0 1 290 -3.9200261235237122e-02 -1 -2 291 + -2.2543789818882942e-03 + + 5.0090551376342773e-01 3.1364008784294128e-01 + -2.2131860256195068e-01 + <_> + + 1 0 292 2.3894659243524075e-03 -1 -2 293 + -1.0725490283221006e-03 + + -5.8699512481689453e-01 4.7141209244728088e-01 + -3.2570488750934601e-02 + <_> + + 0 1 294 8.9095337898470461e-05 -1 -2 295 + 1.6920049674808979e-03 + + -3.0444309115409851e-01 3.0280891060829163e-01 + -3.8902729749679565e-01 + <_> + + 1 0 296 1.1784000322222710e-02 -1 -2 297 + 3.9335917681455612e-03 + + -6.8993437290191650e-01 -6.7763939499855042e-02 + 4.6499788761138916e-01 + <_> + 22 + -2.0614759922027588e+00 + + <_> + + 0 1 298 1.1430840007960796e-02 -1 -2 299 + -3.2242920249700546e-02 + + -3.9274570345878601e-01 6.5568798780441284e-01 + -3.1068810820579529e-01 + <_> + + 1 0 300 -1.8382760463282466e-03 -1 -2 301 + -1.0764399915933609e-01 + + -4.0825068950653076e-01 4.3280079960823059e-01 + -4.2263451218605042e-01 + <_> + + 1 0 302 -2.3866090923547745e-03 -1 -2 303 + 8.6586214601993561e-03 + + -4.6435201168060303e-01 -4.0673071146011353e-01 + 4.1267868876457214e-01 + <_> + + 1 0 304 -1.6437229933217168e-03 -1 -2 305 + -9.8511137068271637e-02 + + -2.1344049274921417e-01 6.8432319164276123e-01 + -9.7035013139247894e-02 + <_> + + 0 1 306 4.4292360544204712e-03 -1 -2 307 + 4.6966210938990116e-03 + + -3.9498910307884216e-01 -1.1345980316400528e-01 + 4.9681991338729858e-01 + <_> + + 1 0 308 -8.8480701670050621e-03 -1 -2 309 + -6.7258379422128201e-03 + + -3.1293100118637085e-01 -6.1635792255401611e-01 + 3.1764769554138184e-01 + <_> + + 1 0 310 2.0052040927112103e-03 -1 -2 311 + -1.3407340273261070e-02 + + 3.1724271178245544e-01 1.9735060632228851e-01 + -3.7199181318283081e-01 + <_> + + 0 1 312 -4.4199679978191853e-03 -1 -2 313 + -3.2800938934087753e-02 + + -5.7164478302001953e-01 3.0599930882453918e-01 + -1.7397969961166382e-01 + <_> + + 0 1 314 4.9407979531679302e-05 -1 -2 315 + 4.1550169698894024e-03 + + -2.8270530700683594e-01 2.9686808586120605e-01 + -4.8494309186935425e-01 + <_> + + 1 0 316 -7.5589967309497297e-05 -1 -2 317 + -3.2147730235010386e-03 + + -3.8531139492988586e-01 -6.3306808471679688e-01 + 2.3434750735759735e-01 + <_> + + 0 1 318 1.6021779738366604e-03 -1 -2 319 + -1.9478019326925278e-02 + + -2.9579049348831177e-01 -4.9625208973884583e-01 + 2.6092579960823059e-01 + <_> + + 0 1 320 -2.5193750858306885e-02 -1 -2 321 + -4.6487729996442795e-02 + + 3.9384880661964417e-01 2.2168830037117004e-01 + -2.9691740870475769e-01 + <_> + + 1 0 322 4.3414267711341381e-03 -1 -2 323 + -2.4886759929358959e-03 + + -6.7661178112030029e-01 2.0509929955005646e-01 + -2.9771140217781067e-01 + <_> + + 0 1 324 -5.8827269822359085e-03 -1 -2 325 + 9.0498890494927764e-04 + + -6.1301797628402710e-01 -3.4023219347000122e-01 + 1.8168209493160248e-01 + <_> + + 0 1 326 -9.8338901996612549e-02 -1 -2 327 + 5.6141808629035950e-02 + + 4.7729569673538208e-01 -2.2904439270496368e-01 + 3.4410089254379272e-01 + <_> + + 1 0 328 -5.5787130258977413e-03 -1 -2 329 + 1.5108759980648756e-03 + + -3.5910171270370483e-01 2.4900430440902710e-01 + -4.3798071146011353e-01 + <_> + + 0 1 330 -6.0129738412797451e-03 -1 -2 331 + -7.9341192031279206e-04 + + 3.1164181232452393e-01 2.6759660243988037e-01 + -3.6802908778190613e-01 + <_> + + 1 0 332 6.1855330131947994e-03 -1 -2 333 + -7.3785060085356236e-03 + + -7.2153317928314209e-01 -5.3714382648468018e-01 + 1.3824890553951263e-01 + <_> + + 0 1 334 -6.7488732747733593e-04 -1 -2 335 + -1.3102099765092134e-03 + + 3.7406051158905029e-01 1.9003790616989136e-01 + -3.1632271409034729e-01 + <_> + + 0 1 336 4.9453211249783635e-04 -1 -2 337 + 1.2824690202251077e-03 + + -2.3283170163631439e-01 3.0463808774948120e-01 + -4.8092108964920044e-01 + <_> + + 0 1 338 -2.2624820470809937e-02 -1 -2 339 + 4.3685249984264374e-03 + + -6.8783479928970337e-01 1.2403090298175812e-01 + -7.9220730066299438e-01 + <_> + + 1 0 340 5.6756488047540188e-03 -1 -2 341 + -8.1769213080406189e-02 + + 1.7611420154571533e-01 3.8942161202430725e-01 + -4.5094010233879089e-01 + <_> + 24 + -1.9795049428939819e+00 + + <_> + + 1 0 342 -2.0003549754619598e-02 -1 -2 343 + -3.2621208578348160e-02 + + -5.6650751829147339e-01 5.0807082653045654e-01 + -4.5345708727836609e-01 + <_> + + 0 1 344 1.0668139904737473e-02 -1 -2 345 + -1.6276689246296883e-02 + + -3.2316839694976807e-01 6.0189497470855713e-01 + -2.4059510231018066e-01 + <_> + + 1 0 346 -2.8211208991706371e-03 -1 -2 347 + -1.4291180297732353e-02 + + -4.7181150317192078e-01 5.1280087232589722e-01 + -1.0744000226259232e-01 + <_> + + 0 1 348 1.0120410006493330e-03 -1 -2 349 + -5.9822672046720982e-03 + + -3.8844698667526245e-01 4.6928858757019043e-01 + -9.1355919837951660e-02 + <_> + + 1 0 350 -2.4705699179321527e-03 -1 -2 351 + 2.4079859722405672e-03 + + -4.5964410901069641e-01 2.1830670535564423e-01 + -5.9373402595520020e-01 + <_> + + 1 0 352 -1.4312269631773233e-03 -1 -2 353 + 2.9141810955479741e-04 + + -2.4731670320034027e-01 -2.5972241163253784e-01 + 3.8206368684768677e-01 + <_> + + 0 1 354 -3.2818811014294624e-03 -1 -2 355 + -1.0365940397605300e-03 + + -7.7180129289627075e-01 2.3569859564304352e-01 + -2.2067700326442719e-01 + <_> + + 0 1 356 -2.2078400943428278e-03 -1 -2 357 + 3.5239339340478182e-03 + + 3.0886119604110718e-01 -2.8496000170707703e-01 + 4.7544300556182861e-01 + <_> + + 0 1 358 -6.1774807982146740e-03 -1 -2 359 + -3.2023619860410690e-03 + + -7.0318382978439331e-01 -5.1361310482025146e-01 + 1.5656259655952454e-01 + <_> + + 1 0 360 -8.7003601947799325e-04 -1 -2 361 + -3.8079950027167797e-03 + + -2.9925128817558289e-01 5.5215638875961304e-01 + -8.0608041025698185e-04 + <_> + + 1 0 362 4.9994210712611675e-03 -1 -2 363 + -1.0323170572519302e-03 + + -4.3541741371154785e-01 5.4992151260375977e-01 + -5.0770761445164680e-03 + <_> + + 1 0 364 6.9215619005262852e-03 -1 -2 365 + -8.1578325480222702e-03 + + 3.3900010585784912e-01 3.4354889392852783e-01 + -2.4483889341354370e-01 + <_> + + 0 1 366 -1.6159559600055218e-03 -1 -2 367 + 4.7165839932858944e-03 + + -7.4653702974319458e-01 1.1855059862136841e-01 + -7.1803867816925049e-01 + <_> + + 1 0 368 -1.6093119978904724e-02 -1 -2 369 + -5.9861610643565655e-03 + + -3.2987210154533386e-01 3.1263980269432068e-01 + -2.3194029927253723e-01 + <_> + + 1 0 370 6.4122617244720459e-02 -1 -2 371 + 2.1518159657716751e-02 + + 4.6239149570465088e-01 -2.4277320504188538e-01 + 4.0963909029960632e-01 + <_> + + 0 1 372 -2.8541380167007446e-01 -1 -2 373 + 2.7372559998184443e-04 + + 4.4521799683570862e-01 -4.7307610511779785e-01 + 7.6739721000194550e-02 + <_> + + 0 1 374 -6.4039281569421291e-03 -1 -2 375 + 1.4279670082032681e-02 + + -5.6167787313461304e-01 -6.7311890423297882e-02 + 4.3806758522987366e-01 + <_> + + 0 1 376 -1.3179860077798367e-02 -1 -2 377 + 6.6828072071075439e-02 + + -6.7672669887542725e-01 -3.2182909548282623e-02 + 5.1308721303939819e-01 + <_> + + 0 1 378 6.3021448440849781e-03 -1 -2 379 + -1.6806010389700532e-03 + + -2.0082660019397736e-01 -5.1767241954803467e-01 + 3.8576510548591614e-01 + <_> + + 0 1 380 -1.5057720011100173e-03 -1 -2 381 + 1.1699240421876311e-03 + + 3.9358091354370117e-01 -2.5579568743705750e-01 + 3.1927299499511719e-01 + <_> + + 1 0 382 7.2735180146992207e-03 -1 -2 383 + 7.8693883551750332e-05 + + -7.1667242050170898e-01 -1.8908829987049103e-01 + 2.3849080502986908e-01 + <_> + + 1 0 384 1.9624589476734400e-03 -1 -2 385 + -3.1472831033170223e-03 + + -5.1583772897720337e-01 4.8033049702644348e-01 + -3.6237910389900208e-02 + <_> + + 1 0 386 5.0133569166064262e-03 -1 -2 387 + -6.5994369797408581e-03 + + -5.2729338407516479e-01 -6.9400531053543091e-01 + 1.2275890260934830e-01 + <_> + + 0 1 388 -4.2700361460447311e-02 -1 -2 389 + -3.5096149076707661e-05 + + -6.8218547105789185e-01 1.2160310149192810e-01 + -4.2142289876937866e-01 + <_> + 24 + -1.9048260450363159e+00 + + <_> + + 0 1 390 8.7128365412354469e-03 -1 -2 391 + -4.0675927884876728e-03 + + -4.4048839807510376e-01 6.0030102729797363e-01 + -2.6042649149894714e-01 + <_> + + 1 0 392 -8.3933398127555847e-02 -1 -2 393 + -2.2626180201768875e-02 + + -3.7943989038467407e-01 5.2529489994049072e-01 + -3.2733321189880371e-01 + <_> + + 1 0 394 -3.5725389607250690e-03 -1 -2 395 + -1.6297569964081049e-03 + + -2.6030939817428589e-01 4.8434230685234070e-01 + -3.8363268971443176e-01 + <_> + + 0 1 396 -8.0011576414108276e-02 -1 -2 397 + -9.6061453223228455e-02 + + 3.9579561352729797e-01 4.2874181270599365e-01 + -2.9096639156341553e-01 + <_> + + 1 0 398 -9.3183852732181549e-03 -1 -2 399 + 9.2205153778195381e-03 + + -3.9325499534606934e-01 -2.9857379198074341e-01 + 3.1733301281929016e-01 + <_> + + 1 0 400 2.3208750411868095e-02 -1 -2 401 + 1.6389730153605342e-03 + + 3.9295229315757751e-01 -5.4035997390747070e-01 + -2.1836880594491959e-02 + <_> + + 1 0 402 2.8872499242424965e-03 -1 -2 403 + 4.7465260140597820e-03 + + -7.8172737360000610e-01 1.4474189281463623e-01 + -6.4237701892852783e-01 + <_> + + 0 1 404 -5.7432148605585098e-03 -1 -2 405 + -8.5324952378869057e-03 + + -6.5556287765502930e-01 2.2090309858322144e-01 + -2.5790300965309143e-01 + <_> + + 0 1 406 -8.8752172887325287e-03 -1 -2 407 + -7.7129527926445007e-03 + + 4.6596860885620117e-01 2.5279781222343445e-01 + -2.6170450448989868e-01 + <_> + + 1 0 408 7.6909800991415977e-03 -1 -2 409 + 2.6657560374587774e-03 + + -5.9350818395614624e-01 1.6969729959964752e-01 + -5.4123950004577637e-01 + <_> + + 1 0 410 -4.4685939792543650e-04 -1 -2 411 + -1.5998890157788992e-03 + + -3.0383870005607605e-01 -5.4817748069763184e-01 + 2.4971559643745422e-01 + <_> + + 1 0 412 1.9368670182302594e-03 -1 -2 413 + -2.4878541007637978e-03 + + -6.3200348615646362e-01 4.7051379084587097e-01 + -4.5187219977378845e-02 + <_> + + 0 1 414 -2.8134910389780998e-03 -1 -2 415 + -1.4107710449025035e-03 + + 3.9270851016044617e-01 1.8017080426216125e-01 + -2.5714579224586487e-01 + <_> + + 0 1 416 -6.9013070315122604e-03 -1 -2 417 + -1.1458620429039001e-03 + + -5.3386241197586060e-01 2.8174358606338501e-01 + -1.6080249845981598e-01 + <_> + + 0 1 418 9.2800445854663849e-03 -1 -2 419 + -4.1281301528215408e-02 + + -3.0028960108757019e-01 -6.2409067153930664e-01 + 2.0549909770488739e-01 + <_> + + 0 1 420 -3.5625360906124115e-02 -1 -2 421 + -4.1647539474070072e-03 + + -5.2529340982437134e-01 -6.3538008928298950e-01 + 1.2846650183200836e-01 + <_> + + 0 1 422 -9.5598259940743446e-04 -1 -2 423 + -8.9347851462662220e-04 + + 2.6505509018898010e-01 1.8266810476779938e-01 + -3.7531790137290955e-01 + <_> + + 1 0 424 2.5431478861719370e-03 -1 -2 425 + -1.5853889286518097e-02 + + -6.1057221889495850e-01 3.0754768848419189e-01 + -9.8143920302391052e-02 + <_> + + 0 1 426 -4.1315760463476181e-02 -1 -2 427 + -6.8226549774408340e-04 + + 4.9247589707374573e-01 6.2975943088531494e-02 + -4.2634299397468567e-01 + <_> + + 1 0 428 6.3098431564867496e-04 -1 -2 429 + -2.8946860693395138e-03 + + 3.1397339701652527e-01 2.8590971231460571e-01 + -2.5623229146003723e-01 + <_> + + 0 1 430 -1.0244140401482582e-02 -1 -2 431 + -1.6979850828647614e-02 + + -6.9737482070922852e-01 -7.3125731945037842e-01 + 1.0389179736375809e-01 + <_> + + 1 0 432 -7.0198569446802139e-03 -1 -2 433 + -6.0688778758049011e-03 + + -3.5070639848709106e-01 -5.3395807743072510e-01 + 1.7334850132465363e-01 + <_> + + 0 1 434 -9.6911415457725525e-03 -1 -2 435 + 8.5460003465414047e-03 + + 5.6399798393249512e-01 -2.4716490507125854e-01 + 1.8216520547866821e-01 + <_> + + 1 0 436 -4.9479231238365173e-03 -1 -2 437 + 1.9269150216132402e-03 + + -2.8333988785743713e-01 -6.8196073174476624e-02 + 3.7787199020385742e-01 + <_> + 28 + -1.9407349824905396e+00 + + <_> + + 1 0 438 -2.8639819473028183e-02 -1 -2 439 + -4.2176660150289536e-02 + + -3.7718260288238525e-01 7.2298699617385864e-01 + -7.6141163706779480e-02 + <_> + + 1 0 440 -2.2537210024893284e-03 -1 -2 441 + -3.0683329328894615e-02 + + -3.2727459073066711e-01 5.1505237817764282e-01 + -2.2235199809074402e-01 + <_> + + 0 1 442 -1.2341269850730896e-01 -1 -2 443 + -2.3674150928854942e-02 + + 4.4699010252952576e-01 3.4708538651466370e-01 + -3.1773900985717773e-01 + <_> + + 0 1 444 3.1951239798218012e-03 -1 -2 445 + -1.4915530337020755e-03 + + -4.9775049090385437e-01 2.6384419202804565e-01 + -3.8912549614906311e-01 + <_> + + 0 1 446 8.8097527623176575e-04 -1 -2 447 + -5.8355771005153656e-02 + + -4.0939790010452271e-01 3.2287618517875671e-01 + -2.3045599460601807e-01 + <_> + + 1 0 448 5.1132370717823505e-03 -1 -2 449 + -4.5418320223689079e-03 + + -5.1353681087493896e-01 5.3011757135391235e-01 + -3.0649330466985703e-02 + <_> + + 1 0 450 1.6811339883133769e-03 -1 -2 451 + 2.8129699639976025e-03 + + -5.3161472082138062e-01 -6.7524053156375885e-02 + 3.8542249798774719e-01 + <_> + + 1 0 452 2.1835418883711100e-03 -1 -2 453 + -2.4335379712283611e-03 + + -6.4298832416534424e-01 -6.6313308477401733e-01 + 1.3882370293140411e-01 + <_> + + 1 0 454 3.0736608896404505e-03 -1 -2 455 + -9.6425544470548630e-03 + + -6.3433158397674561e-01 3.8696160912513733e-01 + -6.8737797439098358e-02 + <_> + + 0 1 456 -7.2082108817994595e-03 -1 -2 457 + -8.0191977322101593e-03 + + 1.6121250391006470e-01 3.8011130690574646e-01 + -4.1397979855537415e-01 + <_> + + 0 1 458 -7.2479159571230412e-03 -1 -2 459 + -2.2631640732288361e-01 + + 2.4351879954338074e-01 6.0667949914932251e-01 + -2.2521880269050598e-01 + <_> + + 0 1 460 -7.0091613451950252e-05 -1 -2 461 + -1.8161399662494659e-01 + + 1.7115320265293121e-01 5.2725982666015625e-01 + -3.5247540473937988e-01 + <_> + + 0 1 462 -9.4038434326648712e-03 -1 -2 463 + -2.1289030555635691e-03 + + 3.4970518946647644e-01 5.5878698825836182e-02 + -4.9816590547561646e-01 + <_> + + 0 1 464 -5.1798550412058830e-03 -1 -2 465 + -6.5030192490667105e-04 + + -6.3095641136169434e-01 3.5856458544731140e-01 + -7.8281052410602570e-02 + <_> + + 0 1 466 -1.0555930435657501e-02 -1 -2 467 + -5.1852981559932232e-03 + + -5.5502831935882568e-01 3.5548681020736694e-01 + -6.8892292678356171e-02 + <_> + + 0 1 468 -7.8725479543209076e-03 -1 -2 469 + -6.5342970192432404e-03 + + -4.8596179485321045e-01 2.1178959310054779e-01 + -2.3174080252647400e-01 + <_> + + 0 1 470 -1.3909920118749142e-02 -1 -2 471 + 1.5418450348079205e-03 + + 5.9936982393264771e-01 -9.5086917281150818e-03 + -6.4796131849288940e-01 + <_> + + 1 0 472 -1.1549900518730283e-03 -1 -2 473 + -3.2687030732631683e-02 + + -2.7501720190048218e-01 -6.7336207628250122e-01 + 1.9520400464534760e-01 + <_> + + 0 1 474 -2.6422590017318726e-01 -1 -2 475 + 6.9438670761883259e-03 + + 3.6986869573593140e-01 -3.0029740929603577e-01 + 1.4998969435691833e-01 + <_> + + 0 1 476 -1.2077920138835907e-02 -1 -2 477 + -1.3986700214445591e-03 + + 4.1644129157066345e-01 4.1248729825019836e-01 + -1.9533659517765045e-01 + <_> + + 1 0 478 1.3138339854776859e-02 -1 -2 479 + 7.2417110204696655e-03 + + -6.4204931259155273e-01 1.1359360069036484e-01 + -7.3838871717453003e-01 + <_> + + 0 1 480 -7.4837901629507542e-03 -1 -2 481 + 6.8022231571376324e-03 + + -6.9246298074722290e-01 9.2873439192771912e-02 + -6.0047471523284912e-01 + <_> + + 1 0 482 4.5322909951210022e-01 -1 -2 483 + -5.5721630342304707e-03 + + 5.6260532140731812e-01 7.7820159494876862e-02 + -3.3990600705146790e-01 + <_> + + 1 0 484 3.1583961099386215e-02 -1 -2 485 + -5.7926177978515625e-03 + + 3.2292670011520386e-01 1.5534450113773346e-01 + -3.5717839002609253e-01 + <_> + + 0 1 486 -7.6025379821658134e-03 -1 -2 487 + 9.5151038840413094e-04 + + -5.1859498023986816e-01 -2.9570670798420906e-02 + 4.6027511358261108e-01 + <_> + + 1 0 488 1.9723300356417894e-03 -1 -2 489 + 2.3158260155469179e-03 + + 3.6926651000976562e-01 -2.1299740672111511e-01 + 2.6948541402816772e-01 + <_> + + 1 0 490 2.1179600153118372e-03 -1 -2 491 + -2.6946600992232561e-03 + + -4.8369500041007996e-01 1.8545660376548767e-01 + -2.9411968588829041e-01 + <_> + + 1 0 492 5.8865409344434738e-02 -1 -2 493 + -6.8408921360969543e-03 + + -4.6770378947257996e-01 -6.6371321678161621e-01 + 1.2721349298954010e-01 + <_> + 26 + -1.8931059837341309e+00 + + <_> + + 1 0 494 -1.2766489759087563e-02 -1 -2 495 + 3.7821640726178885e-03 + + -3.7968099117279053e-01 -1.6001829504966736e-01 + 6.1953288316726685e-01 + <_> + + 1 0 496 -3.3049881458282471e-02 -1 -2 497 + 4.5050241053104401e-02 + + -3.6825481057167053e-01 9.3770343810319901e-03 + 7.1570581197738647e-01 + <_> + + 1 0 498 -3.5275409463793039e-03 -1 -2 499 + 2.2250709589570761e-03 + + -3.7336608767509460e-01 -6.6712491214275360e-02 + 4.9906119704246521e-01 + <_> + + 1 0 500 1.3609490124508739e-03 -1 -2 501 + -2.9087859392166138e-01 + + 1.7162929475307465e-01 3.6158901453018188e-01 + -5.0871372222900391e-01 + <_> + + 1 0 502 3.3148950897157192e-03 -1 -2 503 + -8.8641437469050288e-04 + + -7.1788138151168823e-01 2.5713619589805603e-01 + -1.7978949844837189e-01 + <_> + + 1 0 504 1.1313590221107006e-03 -1 -2 505 + -3.0621800106018782e-03 + + 3.5387420654296875e-01 3.0790808796882629e-01 + -3.1217241287231445e-01 + <_> + + 1 0 506 2.5443620979785919e-03 -1 -2 507 + -6.7088878713548183e-03 + + -5.6788551807403564e-01 2.1222899854183197e-01 + -2.6821109652519226e-01 + <_> + + 0 1 508 -1.6446809470653534e-01 -1 -2 509 + 4.0828108787536621e-02 + + 4.9016961455345154e-01 -3.1217470765113831e-01 + 2.4748149514198303e-01 + <_> + + 0 1 510 -3.6051510833203793e-03 -1 -2 511 + -2.3608640767633915e-03 + + 3.4355860948562622e-01 2.6566460728645325e-01 + -2.8644719719886780e-01 + <_> + + 0 1 512 1.2965350179001689e-03 -1 -2 513 + 6.0111000202596188e-03 + + -2.9317760467529297e-01 2.1941700577735901e-01 + -6.0014218091964722e-01 + <_> + + 1 0 514 -6.1628420371562243e-04 -1 -2 515 + 2.0573718938976526e-03 + + -3.1292331218719482e-01 2.8763169050216675e-01 + -3.7320709228515625e-01 + <_> + + 0 1 516 -7.7166007831692696e-03 -1 -2 517 + -2.8222459368407726e-03 + + -7.1683251857757568e-01 4.2501831054687500e-01 + -5.3294889628887177e-02 + <_> + + 0 1 518 -7.3861207056324929e-05 -1 -2 519 + 5.8680498041212559e-03 + + 1.4903450012207031e-01 -5.8436650037765503e-01 + 1.0724759846925735e-01 + <_> + + 1 0 520 -7.9013723880052567e-03 -1 -2 521 + 2.7825690340250731e-03 + + -3.4319949150085449e-01 1.7655360698699951e-01 + -6.1473757028579712e-01 + <_> + + 0 1 522 3.2751538674347103e-04 -1 -2 523 + 3.0700899660587311e-02 + + -3.3837568759918213e-01 1.8566130101680756e-01 + -5.3450268507003784e-01 + <_> + + 1 0 524 5.6932470761239529e-03 -1 -2 525 + 2.1375140547752380e-01 + + -5.1750451326370239e-01 1.2332399934530258e-01 + -6.4288139343261719e-01 + <_> + + 0 1 526 -4.4024959206581116e-03 -1 -2 527 + -4.5719969784840941e-04 + + 5.8535677194595337e-01 2.3368820548057556e-01 + -1.9039009511470795e-01 + <_> + + 0 1 528 -4.2587839998304844e-03 -1 -2 529 + -2.3462621029466391e-03 + + -5.1190847158432007e-01 -4.7164770960807800e-01 + 1.4783400297164917e-01 + <_> + + 1 0 530 -6.5065571106970310e-05 -1 -2 531 + -5.5082160979509354e-03 + + -2.9886341094970703e-01 -4.8508960008621216e-01 + 2.0014910399913788e-01 + <_> + + 1 0 532 1.8942790105938911e-02 -1 -2 533 + 6.9123771972954273e-03 + + 3.1028950214385986e-01 -2.8701239824295044e-01 + 2.0534069836139679e-01 + <_> + + 1 0 534 8.1696882843971252e-03 -1 -2 535 + 1.0069769807159901e-02 + + 4.5810830593109131e-01 -2.4175919592380524e-01 + 1.7593820393085480e-01 + <_> + + 1 0 536 2.1663580555468798e-03 -1 -2 537 + 1.0505730286240578e-02 + + -4.9877908825874329e-01 1.6231280565261841e-01 + -4.2988869547843933e-01 + <_> + + 1 0 538 5.7576788822188973e-04 -1 -2 539 + -3.0608899891376495e-02 + + -3.1012570858001709e-01 -7.4064302444458008e-01 + 1.6217179596424103e-01 + <_> + + 0 1 540 -1.3430659659206867e-02 -1 -2 541 + 1.1859040241688490e-03 + + 4.5505639910697937e-01 -2.7227258682250977e-01 + 2.2475010156631470e-01 + <_> + + 0 1 542 -4.9311347538605332e-04 -1 -2 543 + -2.4509918875992298e-03 + + -3.9598318934440613e-01 2.5004211068153381e-01 + -1.6140510141849518e-01 + <_> + + 1 0 544 1.3641949743032455e-02 -1 -2 545 + -3.6733329296112061e-02 + + -6.4525490999221802e-01 3.4197059273719788e-01 + -6.5968327224254608e-02 + <_> + 29 + -1.9677840471267700e+00 + + <_> + + 0 1 546 1.3613830087706447e-03 -1 -2 547 + 1.2211060151457787e-02 + + -3.4383928775787354e-01 -4.0358600020408630e-01 + 5.7873630523681641e-01 + <_> + + 0 1 548 3.2929528970271349e-03 -1 -2 549 + -2.4831980466842651e-02 + + -2.2164349257946014e-01 5.4256910085678101e-01 + -4.7585600614547729e-01 + <_> + + 0 1 550 -3.4081530570983887e-01 -1 -2 551 + 6.0929641127586365e-02 + + 5.3438740968704224e-01 -2.6015359163284302e-01 + 3.7626558542251587e-01 + <_> + + 1 0 552 -1.4399300562217832e-03 -1 -2 553 + -7.5711178779602051e-01 + + -4.1635149717330933e-01 4.7764539718627930e-01 + -1.2374229729175568e-01 + <_> + + 0 1 554 -5.9891431592404842e-03 -1 -2 555 + -8.9398561976850033e-04 + + 2.1848620474338531e-01 1.7726029455661774e-01 + -5.4815018177032471e-01 + <_> + + 1 0 556 2.9013510793447495e-03 -1 -2 557 + 4.4361278414726257e-03 + + -5.6709182262420654e-01 1.4183780550956726e-01 + -5.8784419298171997e-01 + <_> + + 1 0 558 -5.3319290600484237e-05 -1 -2 559 + 2.5481029879301786e-03 + + -3.4821888804435730e-01 1.9745320081710815e-01 + -5.5979222059249878e-01 + <_> + + 1 0 560 7.4882939457893372e-02 -1 -2 561 + 4.8816308379173279e-02 + + 4.6647951006889343e-01 -2.2575210034847260e-01 + 3.2325819134712219e-01 + <_> + + 0 1 562 -3.9128339849412441e-03 -1 -2 563 + -1.3820629566907883e-02 + + -5.9772872924804688e-01 2.6031211018562317e-01 + -2.0211410522460938e-01 + <_> + + 0 1 564 9.4047200400382280e-04 -1 -2 565 + -4.6419431455433369e-03 + + -3.4005248546600342e-01 -4.5187801122665405e-01 + 2.1054859459400177e-01 + <_> + + 1 0 566 -3.1960941851139069e-02 -1 -2 567 + -1.2651160068344325e-04 + + -2.0826019346714020e-01 3.8553190231323242e-01 + -2.3116420209407806e-01 + <_> + + 0 1 568 -5.0413709133863449e-02 -1 -2 569 + -2.0950778853148222e-03 + + 2.2846159338951111e-01 3.2639551162719727e-01 + -3.4385430812835693e-01 + <_> + + 0 1 570 -1.1017880402505398e-02 -1 -2 571 + -9.7415763884782791e-03 + + -7.7388781309127808e-01 3.6731991171836853e-01 + -6.5746001899242401e-02 + <_> + + 0 1 572 5.3386680519906804e-05 -1 -2 573 + 5.9820311143994331e-03 + + -3.5571750998497009e-01 1.7653119564056396e-01 + -4.6110078692436218e-01 + <_> + + 1 0 574 -1.9558269996196032e-03 -1 -2 575 + 7.6739699579775333e-03 + + -3.6172690987586975e-01 1.8038579821586609e-01 + -4.0452030301094055e-01 + <_> + + 1 0 576 4.2935381643474102e-03 -1 -2 577 + 1.4181300066411495e-03 + + 5.2086359262466431e-01 -2.2085809707641602e-01 + 2.7357560396194458e-01 + <_> + + 0 1 578 -2.8263099491596222e-02 -1 -2 579 + 6.3434068579226732e-04 + + -6.3833731412887573e-01 1.5636380016803741e-01 + -3.2148900628089905e-01 + <_> + + 0 1 580 -7.2387307882308960e-03 -1 -2 581 + -9.9928081035614014e-03 + + 2.3126259446144104e-01 3.0397319793701172e-01 + -2.4478439986705780e-01 + <_> + + 1 0 582 6.4995248976629227e-05 -1 -2 583 + -5.3049270063638687e-03 + + 1.5132980048656464e-01 2.0417870581150055e-01 + -4.6260431408882141e-01 + <_> + + 0 1 584 -1.6613099724054337e-02 -1 -2 585 + -1.1630290187895298e-02 + + 3.3399769663810730e-01 3.7053430080413818e-01 + -1.9361549615859985e-01 + <_> + + 1 0 586 1.9068180117756128e-03 -1 -2 587 + -5.6926468387246132e-03 + + -3.8105058670043945e-01 5.0645208358764648e-01 + 6.5170922316610813e-03 + <_> + + 1 0 588 -2.2453670680988580e-04 -1 -2 589 + 9.5565039664506912e-03 + + -3.1526011228561401e-01 -5.3035598993301392e-01 + 2.0532760024070740e-01 + <_> + + 1 0 590 3.1540619675070047e-03 -1 -2 591 + -3.0681329965591431e-01 + + -4.5928329229354858e-01 5.0717717409133911e-01 + -1.4439250342547894e-02 + <_> + + 0 1 592 2.8239809907972813e-03 -1 -2 593 + -3.3063529990613461e-03 + + -1.5437939763069153e-01 -4.3571388721466064e-01 + 3.9342719316482544e-01 + <_> + + 1 0 594 3.7848789361305535e-04 -1 -2 595 + -3.0488630291074514e-03 + + 2.5212600827217102e-01 4.6662339568138123e-01 + -2.2792230546474457e-01 + <_> + + 0 1 596 -1.4724380336701870e-02 -1 -2 597 + 3.6062300205230713e-02 + + -7.8602111339569092e-01 -6.8571321666240692e-02 + 3.6698839068412781e-01 + <_> + + 0 1 598 -2.2327410988509655e-03 -1 -2 599 + -7.8541820403188467e-04 + + -5.9740197658538818e-01 2.0273469388484955e-01 + -1.7221680283546448e-01 + <_> + + 1 0 600 7.8553898492828012e-04 -1 -2 601 + 1.0078109800815582e-02 + + -4.3407449126243591e-01 1.2464140355587006e-01 + -4.8391419649124146e-01 + <_> + + 1 0 602 2.0928790792822838e-02 -1 -2 603 + 1.3340089935809374e-03 + + 5.6864207983016968e-01 1.4524639584124088e-02 + -4.6003210544586182e-01 + <_> + 34 + -1.9657919406890869e+00 + + <_> + + 1 0 604 -1.5313959680497646e-02 -1 -2 605 + -1.4265860430896282e-02 + + -3.4347689151763916e-01 5.8209532499313354e-01 + -3.5527399182319641e-01 + <_> + + 0 1 606 1.2652979930862784e-03 -1 -2 607 + -7.3807648732326925e-05 + + -3.1498318910598755e-01 4.7249591350555420e-01 + -2.6380801200866699e-01 + <_> + + 0 1 608 -3.8527030497789383e-02 -1 -2 609 + -1.4758770354092121e-02 + + 4.1556850075721741e-01 1.5677249431610107e-01 + -3.7650239467620850e-01 + <_> + + 1 0 610 -1.5448270132765174e-03 -1 -2 611 + 6.4564580097794533e-03 + + -3.5932019352912903e-01 2.1276639401912689e-01 + -7.2287178039550781e-01 + <_> + + 0 1 612 1.0267349891364574e-02 -1 -2 613 + -8.6422899039462209e-04 + + -4.6045809984207153e-01 2.4920259416103363e-01 + -2.6721361279487610e-01 + <_> + + 0 1 614 3.2311889808624983e-03 -1 -2 615 + 1.3676529750227928e-02 + + -4.0939199924468994e-01 -2.7391690760850906e-02 + 4.5259070396423340e-01 + <_> + + 1 0 616 3.2787120435386896e-03 -1 -2 617 + -1.4256529975682497e-03 + + -7.0025652647018433e-01 2.5787800550460815e-01 + -1.5093439817428589e-01 + <_> + + 0 1 618 -2.2095029707998037e-03 -1 -2 619 + -8.7701372802257538e-02 + + 3.5148110985755920e-01 4.1978740692138672e-01 + -2.3600180447101593e-01 + <_> + + 0 1 620 -2.8805620968341827e-03 -1 -2 621 + -2.5028509553521872e-03 + + 3.0479869246482849e-01 1.3316699862480164e-01 + -3.1691300868988037e-01 + <_> + + 1 0 622 -5.1710562547668815e-04 -1 -2 623 + 6.7088729701936245e-03 + + -3.5199090838432312e-01 2.0163150131702423e-01 + -6.0948008298873901e-01 + <_> + + 0 1 624 -7.6058752834796906e-02 -1 -2 625 + -3.0889140907675028e-03 + + -6.3694208860397339e-01 -7.9025340080261230e-01 + 1.0366079956293106e-01 + <_> + + 1 0 626 2.5740528944879770e-03 -1 -2 627 + -5.4877097718417645e-03 + + -4.5424199104309082e-01 2.1481299400329590e-01 + -1.9329510629177094e-01 + <_> + + 1 0 628 -1.2507289648056030e-03 -1 -2 629 + -4.3231048621237278e-03 + + -2.1651449799537659e-01 -6.2799078226089478e-01 + 2.4270740151405334e-01 + <_> + + 1 0 630 4.3724630959331989e-03 -1 -2 631 + 7.4632692849263549e-04 + + -5.1889377832412720e-01 -1.1378680169582367e-01 + 2.8224378824234009e-01 + <_> + + 0 1 632 -1.3375070411711931e-03 -1 -2 633 + -2.9367550741881132e-03 + + 2.4589119851589203e-01 2.4335819482803345e-01 + -2.9112818837165833e-01 + <_> + + 0 1 634 6.3193867390509695e-05 -1 -2 635 + -5.1338938064873219e-03 + + -2.5806590914726257e-01 -4.6110409498214722e-01 + 2.4333980679512024e-01 + <_> + + 1 0 636 4.9400608986616135e-03 -1 -2 637 + -5.6112580932676792e-03 + + -3.9632990956306458e-01 2.4502380192279816e-01 + -1.5639010071754456e-01 + <_> + + 1 0 638 4.2950599454343319e-03 -1 -2 639 + 4.5142881572246552e-03 + + -4.7671678662300110e-01 1.0698430240154266e-01 + -9.0471321344375610e-01 + <_> + + 1 0 640 7.5297639705240726e-03 -1 -2 641 + -1.2225280515849590e-03 + + 4.1239809989929199e-01 2.8488171100616455e-01 + -1.9815699756145477e-01 + <_> + + 0 1 642 -3.4703810233622789e-03 -1 -2 643 + 8.3724651485681534e-03 + + -4.4967961311340332e-01 1.5324249863624573e-01 + -3.8666850328445435e-01 + <_> + + 1 0 644 -3.3934618841158226e-05 -1 -2 645 + -2.7241709828376770e-01 + + -3.1429070234298706e-01 -5.5842101573944092e-01 + 1.6627819836139679e-01 + <_> + + 0 1 646 -2.7582740876823664e-03 -1 -2 647 + 2.5530489161610603e-02 + + 2.7189570665359497e-01 -1.9172009825706482e-01 + 4.3780499696731567e-01 + <_> + + 1 0 648 4.2080380953848362e-03 -1 -2 649 + -8.2151442766189575e-03 + + -4.4684138894081116e-01 2.2786709666252136e-01 + -1.7441789805889130e-01 + <_> + + 0 1 650 -2.9405429959297180e-03 -1 -2 651 + -9.4840265810489655e-03 + + -7.2643548250198364e-01 2.0794290304183960e-01 + -1.5239919722080231e-01 + <_> + + 1 0 652 4.2596450075507164e-03 -1 -2 653 + -1.7117479583248496e-03 + + 6.1772680282592773e-01 -7.1106612682342529e-01 + -6.1875251121819019e-03 + <_> + + 0 1 654 -1.3266160385683179e-03 -1 -2 655 + 9.1314306482672691e-03 + + 1.7181269824504852e-01 -4.1138759255409241e-01 + 1.8124279379844666e-01 + <_> + + 1 0 656 6.8382360041141510e-03 -1 -2 657 + 7.5181988067924976e-03 + + -5.7601082324981689e-01 -1.0819079726934433e-01 + 2.9561421275138855e-01 + <_> + + 0 1 658 -7.2788819670677185e-03 -1 -2 659 + -1.8039470538496971e-02 + + -5.8113521337509155e-01 4.5183068513870239e-01 + -2.7083089575171471e-02 + <_> + + 0 1 660 -1.0126599809154868e-03 -1 -2 661 + -6.7263199016451836e-03 + + 2.4344119429588318e-01 1.6870440542697906e-01 + -2.7007728815078735e-01 + <_> + + 0 1 662 -3.2334970310330391e-03 -1 -2 663 + -7.7852200774941593e-05 + + -6.0048222541809082e-01 2.4241769313812256e-01 + -1.2413249909877777e-01 + <_> + + 0 1 664 -6.7774722992908210e-05 -1 -2 665 + 7.1789676439948380e-05 + + 1.5729150176048279e-01 -5.2893507480621338e-01 + -3.1665571033954620e-02 + <_> + + 1 0 666 1.0024299845099449e-02 -1 -2 667 + 9.4298496842384338e-03 + + -4.8646959662437439e-01 1.1240869760513306e-01 + -4.2570489645004272e-01 + <_> + + 0 1 668 -7.4433721601963043e-04 -1 -2 669 + 1.1660560034215450e-02 + + 2.7540761232376099e-01 -2.3117260634899139e-01 + 2.2442330420017242e-01 + <_> + + 1 0 670 3.9079408161342144e-03 -1 -2 671 + 1.6550149768590927e-02 + + -6.3519638776779175e-01 1.0619100183248520e-01 + -4.7654989361763000e-01 + <_> + 32 + -1.7649420499801636e+00 + + <_> + + 1 0 672 -1.8439030274748802e-02 -1 -2 673 + -5.3364519029855728e-02 + + -4.8745709657669067e-01 5.1037812232971191e-01 + -2.2670130431652069e-01 + <_> + + 0 1 674 -7.5706318020820618e-02 -1 -2 675 + -1.5329009620472789e-03 + + 4.1487750411033630e-01 8.5764937102794647e-02 + -4.3470910191535950e-01 + <_> + + 1 0 676 -2.4494890123605728e-02 -1 -2 677 + -3.8144161226227880e-04 + + -2.7532699704170227e-01 3.8043969869613647e-01 + -4.3967849016189575e-01 + <_> + + 1 0 678 -8.8816778734326363e-03 -1 -2 679 + -3.9625130593776703e-02 + + -4.3258818984031677e-01 2.4481220543384552e-01 + -2.6193639636039734e-01 + <_> + + 1 0 680 -3.5907390993088484e-03 -1 -2 681 + 3.7008870393037796e-02 + + -3.6199480295181274e-01 2.2637460380792618e-02 + 5.5778437852859497e-01 + <_> + + 0 1 682 7.8503930126316845e-05 -1 -2 683 + -4.7969701699912548e-03 + + -3.3861130475997925e-01 3.1856098771095276e-01 + -1.6600249707698822e-01 + <_> + + 0 1 684 -1.1298010125756264e-02 -1 -2 685 + -4.4886539690196514e-03 + + 3.7305471301078796e-01 2.9692959785461426e-01 + -2.5235760211944580e-01 + <_> + + 0 1 686 -2.2497780155390501e-03 -1 -2 687 + 2.9247230850160122e-03 + + 3.4263029694557190e-01 -5.6593239307403564e-02 + -7.0626032352447510e-01 + <_> + + 1 0 688 1.7976630479097366e-03 -1 -2 689 + 1.9808609504252672e-03 + + -5.4180228710174561e-01 -2.5643008947372437e-01 + 1.8446870148181915e-01 + <_> + + 0 1 690 -4.7688339836895466e-03 -1 -2 691 + -1.5755610540509224e-02 + + -2.9698228836059570e-01 2.8959378600120544e-01 + -1.6480749845504761e-01 + <_> + + 0 1 692 -1.1919640004634857e-02 -1 -2 693 + 4.2308131232857704e-03 + + -5.8567219972610474e-01 1.3601270318031311e-01 + -4.8162451386451721e-01 + <_> + + 1 0 694 2.0548550412058830e-02 -1 -2 695 + -7.3943338356912136e-03 + + 3.0143499374389648e-01 4.6367760747671127e-02 + -4.2379519343376160e-01 + <_> + + 0 1 696 -6.2137800268828869e-03 -1 -2 697 + 1.4182809973135591e-03 + + 4.5724278688430786e-01 -3.0143639445304871e-01 + 1.8204510211944580e-01 + <_> + + 1 0 698 4.1609420441091061e-03 -1 -2 699 + -3.7915320135653019e-03 + + -5.2654838562011719e-01 -5.8677071332931519e-01 + 1.1703660339117050e-01 + <_> + + 1 0 700 2.0879150833934546e-03 -1 -2 701 + 1.5018540434539318e-03 + + -3.5307729244232178e-01 1.8624800443649292e-01 + -3.2729730010032654e-01 + <_> + + 1 0 702 2.1248809993267059e-02 -1 -2 703 + -5.5249751312658191e-04 + + -3.1979259848594666e-01 2.3370230197906494e-01 + -1.7386199533939362e-01 + <_> + + 0 1 704 -3.0085169710218906e-03 -1 -2 705 + -1.1611919617280364e-03 + + 1.7596049606800079e-01 1.6033430397510529e-01 + -3.9680978655815125e-01 + <_> + + 0 1 706 -3.9655580185353756e-03 -1 -2 707 + -6.5836100839078426e-03 + + 3.6691769957542419e-01 -6.2966358661651611e-01 + -2.4926450103521347e-02 + <_> + + 0 1 708 -9.0950471349060535e-04 -1 -2 709 + -5.7984529994428158e-03 + + 3.9574980735778809e-01 1.7492240667343140e-01 + -2.6837408542633057e-01 + <_> + + 0 1 710 -5.7758802175521851e-01 -1 -2 711 + -1.5161310322582722e-02 + + 5.9611392021179199e-01 -6.6131639480590820e-01 + 3.3608361263759434e-04 + <_> + + 1 0 712 7.6604672358371317e-05 -1 -2 713 + 2.7769979089498520e-02 + + 2.0401589572429657e-01 -3.2097330689430237e-01 + 2.2317400574684143e-01 + <_> + + 0 1 714 -2.6336179580539465e-03 -1 -2 715 + 8.3722146227955818e-03 + + -3.9656499028205872e-01 1.3883970677852631e-01 + -5.8006221055984497e-01 + <_> + + 0 1 716 -7.0203031646087766e-04 -1 -2 717 + -4.8448870074935257e-04 + + 2.7777281403541565e-01 2.1628519892692566e-01 + -2.9692250490188599e-01 + <_> + + 0 1 718 -3.3638171851634979e-02 -1 -2 719 + 4.4241230934858322e-03 + + 3.5791969299316406e-01 -8.6632027523592114e-04 + -5.5872720479965210e-01 + <_> + + 1 0 720 1.1545260436832905e-02 -1 -2 721 + -1.5816639643162489e-03 + + 3.3837619423866272e-01 2.8660699725151062e-02 + -3.5041970014572144e-01 + <_> + + 1 0 722 1.3838140293955803e-02 -1 -2 723 + 2.8327409178018570e-02 + + -7.7886807918548584e-01 -1.8604910001158714e-02 + 6.2147867679595947e-01 + <_> + + 0 1 724 -8.8482163846492767e-03 -1 -2 725 + -1.1661020107567310e-03 + + 2.6369819045066833e-01 1.0302580147981644e-01 + -3.2680010795593262e-01 + <_> + + 0 1 726 -3.2252211123704910e-02 -1 -2 727 + -9.4921119511127472e-02 + + -5.0046241283416748e-01 -7.2761011123657227e-01 + 1.0330100357532501e-01 + <_> + + 1 0 728 2.5177269708365202e-03 -1 -2 729 + -4.0892168879508972e-02 + + -6.3938027620315552e-01 -5.7345229387283325e-01 + 8.1502526998519897e-02 + <_> + + 0 1 730 -1.9293189980089664e-03 -1 -2 731 + -1.4116390375420451e-03 + + 2.4177229404449463e-01 8.0363817512989044e-02 + -3.6146539449691772e-01 + <_> + + 0 1 732 -3.8812779821455479e-03 -1 -2 733 + 4.4630360789597034e-03 + + -5.7638782262802124e-01 9.1835789382457733e-02 + -6.8039101362228394e-01 + <_> + + 0 1 734 2.9870839789509773e-03 -1 -2 735 + 9.4975335523486137e-03 + + -1.0236640274524689e-01 4.9150609970092773e-01 + -3.8011389970779419e-01 + + <_> + + <_> + 8 7 3 12 -1. + <_> + 8 11 3 4 3. + <_> + + <_> + 8 7 8 3 -1. + <_> + 10 9 4 3 2. + 1 + <_> + + <_> + 9 13 2 6 -1. + <_> + 9 16 2 3 2. + <_> + + <_> + 8 2 12 8 -1. + <_> + 11 2 6 8 2. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 3 6 3 2. + <_> + + <_> + 8 1 5 12 -1. + <_> + 8 4 5 6 2. + <_> + + <_> + 1 8 3 12 -1. + <_> + 1 12 3 4 3. + <_> + + <_> + 0 11 2 7 -1. + <_> + 1 11 1 7 2. + <_> + + <_> + 6 12 9 7 -1. + <_> + 9 12 3 7 3. + <_> + + <_> + 13 4 6 9 -1. + <_> + 15 4 2 9 3. + <_> + + <_> + 4 7 12 12 -1. + <_> + 8 11 4 4 9. + <_> + + <_> + 15 0 4 20 -1. + <_> + 15 5 4 10 2. + <_> + + <_> + 0 12 5 8 -1. + <_> + 0 16 5 4 2. + <_> + + <_> + 8 2 12 8 -1. + <_> + 12 2 4 8 3. + <_> + + <_> + 19 0 1 8 -1. + <_> + 19 4 1 4 2. + <_> + + <_> + 9 7 3 12 -1. + <_> + 9 11 3 4 3. + <_> + + <_> + 1 2 8 8 -1. + <_> + 1 6 8 4 2. + <_> + + <_> + 0 12 4 4 -1. + <_> + 2 12 2 4 2. + <_> + + <_> + 9 7 6 8 -1. + <_> + 9 7 3 4 2. + <_> + 12 11 3 4 2. + <_> + + <_> + 13 18 7 2 -1. + <_> + 13 19 7 1 2. + <_> + + <_> + 4 7 12 12 -1. + <_> + 8 11 4 4 9. + <_> + + <_> + 0 8 5 12 -1. + <_> + 0 12 5 4 3. + <_> + + <_> + 16 0 4 8 -1. + <_> + 18 0 2 8 2. + <_> + + <_> + 16 12 1 8 -1. + <_> + 16 16 1 4 2. + <_> + + <_> + 9 1 9 9 -1. + <_> + 12 1 3 9 3. + <_> + + <_> + 16 16 1 3 -1. + <_> + 15 17 1 1 3. + 1 + <_> + + <_> + 2 14 2 4 -1. + <_> + 2 16 2 2 2. + <_> + + <_> + 6 12 9 3 -1. + <_> + 9 12 3 3 3. + <_> + + <_> + 0 18 5 2 -1. + <_> + 0 19 5 1 2. + <_> + + <_> + 1 7 18 12 -1. + <_> + 7 11 6 4 9. + <_> + + <_> + 4 0 16 12 -1. + <_> + 4 0 8 6 2. + <_> + 12 6 8 6 2. + <_> + + <_> + 8 3 2 5 -1. + <_> + 9 3 1 5 2. + <_> + + <_> + 17 17 1 2 -1. + <_> + 17 17 1 1 2. + 1 + <_> + + <_> + 18 16 1 3 -1. + <_> + 17 17 1 1 3. + 1 + <_> + + <_> + 0 9 2 6 -1. + <_> + 1 9 1 6 2. + <_> + + <_> + 3 3 3 4 -1. + <_> + 4 3 1 4 3. + <_> + + <_> + 4 7 12 12 -1. + <_> + 8 11 4 4 9. + <_> + + <_> + 10 0 7 8 -1. + <_> + 10 4 7 4 2. + <_> + + <_> + 18 0 2 9 -1. + <_> + 19 0 1 9 2. + <_> + + <_> + 4 13 1 4 -1. + <_> + 4 13 1 2 2. + 1 + <_> + + <_> + 10 8 6 2 -1. + <_> + 12 10 2 2 3. + 1 + <_> + + <_> + 14 11 4 7 -1. + <_> + 15 11 2 7 2. + <_> + + <_> + 4 0 13 8 -1. + <_> + 4 2 13 4 2. + <_> + + <_> + 9 1 7 8 -1. + <_> + 9 5 7 4 2. + <_> + + <_> + 7 0 12 9 -1. + <_> + 10 0 6 9 2. + <_> + + <_> + 14 3 4 4 -1. + <_> + 15 3 2 4 2. + <_> + + <_> + 0 16 4 4 -1. + <_> + 0 18 4 2 2. + <_> + + <_> + 3 17 2 1 -1. + <_> + 3 17 1 1 2. + 1 + <_> + + <_> + 17 16 1 3 -1. + <_> + 16 17 1 1 3. + 1 + <_> + + <_> + 11 10 6 4 -1. + <_> + 10 11 6 2 2. + 1 + <_> + + <_> + 19 0 1 4 -1. + <_> + 19 2 1 2 2. + <_> + + <_> + 17 0 3 3 -1. + <_> + 18 1 1 1 9. + <_> + + <_> + 2 1 12 6 -1. + <_> + 2 4 12 3 2. + <_> + + <_> + 19 2 1 16 -1. + <_> + 15 6 1 8 2. + 1 + <_> + + <_> + 12 2 4 6 -1. + <_> + 13 2 2 6 2. + <_> + + <_> + 11 3 3 3 -1. + <_> + 12 3 1 3 3. + <_> + + <_> + 1 7 18 12 -1. + <_> + 7 11 6 4 9. + <_> + + <_> + 8 1 12 9 -1. + <_> + 12 1 4 9 3. + <_> + + <_> + 18 0 2 10 -1. + <_> + 18 5 2 5 2. + <_> + + <_> + 4 5 12 15 -1. + <_> + 8 10 4 5 9. + <_> + + <_> + 1 8 4 12 -1. + <_> + 1 12 4 4 3. + <_> + + <_> + 6 13 8 2 -1. + <_> + 8 13 4 2 2. + <_> + + <_> + 16 0 4 15 -1. + <_> + 18 0 2 15 2. + <_> + + <_> + 14 0 4 8 -1. + <_> + 15 0 2 8 2. + <_> + + <_> + 5 0 8 9 -1. + <_> + 5 3 8 3 3. + <_> + + <_> + 8 0 6 6 -1. + <_> + 10 0 2 6 3. + <_> + + <_> + 10 17 3 3 -1. + <_> + 11 17 1 3 3. + <_> + + <_> + 10 17 4 3 -1. + <_> + 11 17 2 3 2. + <_> + + <_> + 14 12 4 4 -1. + <_> + 15 12 2 4 2. + <_> + + <_> + 8 18 4 2 -1. + <_> + 9 18 2 2 2. + <_> + + <_> + 6 1 4 5 -1. + <_> + 7 1 2 5 2. + <_> + + <_> + 2 0 6 5 -1. + <_> + 4 0 2 5 3. + <_> + + <_> + 8 7 8 3 -1. + <_> + 10 9 4 3 2. + 1 + <_> + + <_> + 14 12 4 3 -1. + <_> + 15 12 2 3 2. + <_> + + <_> + 10 10 3 4 -1. + <_> + 9 11 3 2 2. + 1 + <_> + + <_> + 17 0 2 6 -1. + <_> + 17 3 2 3 2. + <_> + + <_> + 1 9 6 9 -1. + <_> + 3 12 2 3 9. + <_> + + <_> + 5 11 8 4 -1. + <_> + 9 11 4 4 2. + <_> + + <_> + 1 0 16 6 -1. + <_> + 1 3 16 3 2. + <_> + + <_> + 2 0 14 6 -1. + <_> + 2 2 14 2 3. + <_> + + <_> + 0 11 2 9 -1. + <_> + 1 11 1 9 2. + <_> + + <_> + 18 11 1 8 -1. + <_> + 18 11 1 4 2. + 1 + <_> + + <_> + 10 12 3 2 -1. + <_> + 11 12 1 2 3. + <_> + + <_> + 11 13 3 1 -1. + <_> + 12 13 1 1 3. + <_> + + <_> + 15 0 4 8 -1. + <_> + 17 0 2 8 2. + <_> + + <_> + 12 17 4 3 -1. + <_> + 14 17 2 3 2. + <_> + + <_> + 15 17 1 2 -1. + <_> + 15 17 1 1 2. + 1 + <_> + + <_> + 15 16 1 3 -1. + <_> + 14 17 1 1 3. + 1 + <_> + + <_> + 3 0 14 8 -1. + <_> + 3 2 14 4 2. + <_> + + <_> + 18 1 1 2 -1. + <_> + 18 2 1 1 2. + <_> + + <_> + 6 0 8 3 -1. + <_> + 8 0 4 3 2. + <_> + + <_> + 9 4 1 9 -1. + <_> + 9 7 1 3 3. + <_> + + <_> + 6 13 9 2 -1. + <_> + 9 13 3 2 3. + <_> + + <_> + 0 13 5 6 -1. + <_> + 0 16 5 3 2. + <_> + + <_> + 13 12 6 4 -1. + <_> + 15 12 2 4 3. + <_> + + <_> + 4 6 12 2 -1. + <_> + 8 10 4 2 3. + 1 + <_> + + <_> + 19 0 1 8 -1. + <_> + 19 4 1 4 2. + <_> + + <_> + 8 2 12 8 -1. + <_> + 11 2 6 8 2. + <_> + + <_> + 0 12 4 4 -1. + <_> + 2 12 2 4 2. + <_> + + <_> + 7 8 13 9 -1. + <_> + 7 11 13 3 3. + <_> + + <_> + 18 1 2 6 -1. + <_> + 19 1 1 6 2. + <_> + + <_> + 7 4 5 8 -1. + <_> + 7 6 5 4 2. + <_> + + <_> + 11 18 9 2 -1. + <_> + 11 19 9 1 2. + <_> + + <_> + 10 7 2 3 -1. + <_> + 11 7 1 3 2. + <_> + + <_> + 4 18 6 2 -1. + <_> + 6 18 2 2 3. + <_> + + <_> + 6 13 6 7 -1. + <_> + 8 13 2 7 3. + <_> + + <_> + 5 18 6 2 -1. + <_> + 7 18 2 2 3. + <_> + + <_> + 18 5 2 2 -1. + <_> + 18 6 2 1 2. + <_> + + <_> + 6 2 9 4 -1. + <_> + 6 4 9 2 2. + <_> + + <_> + 13 0 7 4 -1. + <_> + 13 0 7 2 2. + 1 + <_> + + <_> + 13 9 3 6 -1. + <_> + 11 11 3 2 3. + 1 + <_> + + <_> + 16 8 4 6 -1. + <_> + 16 11 4 3 2. + <_> + + <_> + 19 2 1 2 -1. + <_> + 19 3 1 1 2. + <_> + + <_> + 19 1 1 3 -1. + <_> + 19 2 1 1 3. + <_> + + <_> + 13 12 2 4 -1. + <_> + 13 12 1 2 2. + <_> + 14 14 1 2 2. + <_> + + <_> + 14 9 3 5 -1. + <_> + 15 10 1 5 3. + 1 + <_> + + <_> + 8 7 8 3 -1. + <_> + 10 9 4 3 2. + 1 + <_> + + <_> + 7 7 9 4 -1. + <_> + 6 8 9 2 2. + 1 + <_> + + <_> + 0 11 2 6 -1. + <_> + 1 11 1 6 2. + <_> + + <_> + 0 13 5 6 -1. + <_> + 0 16 5 3 2. + <_> + + <_> + 16 2 4 6 -1. + <_> + 18 2 2 6 2. + <_> + + <_> + 13 5 6 7 -1. + <_> + 15 7 2 7 3. + 1 + <_> + + <_> + 19 2 1 4 -1. + <_> + 19 4 1 2 2. + <_> + + <_> + 14 1 6 2 -1. + <_> + 16 1 2 2 3. + <_> + + <_> + 14 12 4 5 -1. + <_> + 15 12 2 5 2. + <_> + + <_> + 18 15 2 3 -1. + <_> + 17 16 2 1 3. + 1 + <_> + + <_> + 14 16 3 4 -1. + <_> + 14 18 3 2 2. + <_> + + <_> + 16 16 1 2 -1. + <_> + 16 16 1 1 2. + 1 + <_> + + <_> + 18 0 1 2 -1. + <_> + 18 1 1 1 2. + <_> + + <_> + 9 8 1 6 -1. + <_> + 9 11 1 3 2. + <_> + + <_> + 18 5 2 1 -1. + <_> + 19 5 1 1 2. + <_> + + <_> + 14 3 6 4 -1. + <_> + 16 3 2 4 3. + <_> + + <_> + 8 18 4 2 -1. + <_> + 9 18 2 2 2. + <_> + + <_> + 6 13 9 7 -1. + <_> + 9 13 3 7 3. + <_> + + <_> + 1 16 2 2 -1. + <_> + 1 17 2 1 2. + <_> + + <_> + 0 16 3 4 -1. + <_> + 0 17 3 2 2. + <_> + + <_> + 8 1 4 5 -1. + <_> + 9 1 2 5 2. + <_> + + <_> + 10 1 6 9 -1. + <_> + 12 1 2 9 3. + <_> + + <_> + 10 8 10 4 -1. + <_> + 10 10 10 2 2. + <_> + + <_> + 15 8 5 4 -1. + <_> + 15 10 5 2 2. + <_> + + <_> + 17 1 3 2 -1. + <_> + 18 2 1 2 3. + 1 + <_> + + <_> + 13 11 3 5 -1. + <_> + 14 11 1 5 3. + <_> + + <_> + 8 7 4 3 -1. + <_> + 10 7 2 3 2. + <_> + + <_> + 3 0 8 1 -1. + <_> + 5 0 4 1 2. + <_> + + <_> + 1 13 6 5 -1. + <_> + 3 13 2 5 3. + <_> + + <_> + 13 9 3 5 -1. + <_> + 14 10 1 5 3. + 1 + <_> + + <_> + 11 8 4 6 -1. + <_> + 9 10 4 2 3. + 1 + <_> + + <_> + 11 7 6 6 -1. + <_> + 13 9 2 6 3. + 1 + <_> + + <_> + 7 0 7 6 -1. + <_> + 7 3 7 3 2. + <_> + + <_> + 3 1 10 12 -1. + <_> + 3 5 10 4 3. + <_> + + <_> + 13 12 6 4 -1. + <_> + 15 12 2 4 3. + <_> + + <_> + 0 9 6 9 -1. + <_> + 2 12 2 3 9. + <_> + + <_> + 8 0 12 11 -1. + <_> + 12 0 4 11 3. + <_> + + <_> + 13 11 1 8 -1. + <_> + 13 11 1 4 2. + 1 + <_> + + <_> + 19 4 1 2 -1. + <_> + 19 5 1 1 2. + <_> + + <_> + 2 15 1 2 -1. + <_> + 2 15 1 1 2. + 1 + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 2 1 2. + 1 + <_> + + <_> + 16 16 1 3 -1. + <_> + 15 17 1 1 3. + 1 + <_> + + <_> + 5 11 3 2 -1. + <_> + 6 12 1 2 3. + 1 + <_> + + <_> + 4 11 2 2 -1. + <_> + 4 11 1 1 2. + <_> + 5 12 1 1 2. + <_> + + <_> + 17 7 3 2 -1. + <_> + 18 8 1 2 3. + 1 + <_> + + <_> + 16 9 3 8 -1. + <_> + 16 11 3 4 2. + <_> + + <_> + 19 0 1 4 -1. + <_> + 19 2 1 2 2. + <_> + + <_> + 19 0 1 3 -1. + <_> + 19 1 1 1 3. + <_> + + <_> + 9 0 10 3 -1. + <_> + 14 0 5 3 2. + <_> + + <_> + 3 3 15 17 -1. + <_> + 8 3 5 17 3. + <_> + + <_> + 8 0 4 4 -1. + <_> + 9 0 2 4 2. + <_> + + <_> + 1 11 8 1 -1. + <_> + 1 11 4 1 2. + 1 + <_> + + <_> + 4 10 2 4 -1. + <_> + 3 11 2 2 2. + 1 + <_> + + <_> + 4 17 4 3 -1. + <_> + 5 17 2 3 2. + <_> + + <_> + 18 7 2 1 -1. + <_> + 19 7 1 1 2. + <_> + + <_> + 2 7 18 3 -1. + <_> + 11 7 9 3 2. + <_> + + <_> + 4 11 4 2 -1. + <_> + 4 11 2 1 2. + <_> + 6 12 2 1 2. + <_> + + <_> + 4 9 2 4 -1. + <_> + 4 11 2 2 2. + <_> + + <_> + 16 1 3 1 -1. + <_> + 17 2 1 1 3. + 1 + <_> + + <_> + 4 18 1 2 -1. + <_> + 4 19 1 1 2. + <_> + + <_> + 9 18 4 2 -1. + <_> + 10 18 2 2 2. + <_> + + <_> + 12 11 5 4 -1. + <_> + 11 12 5 2 2. + 1 + <_> + + <_> + 18 2 2 1 -1. + <_> + 19 2 1 1 2. + <_> + + <_> + 7 0 6 2 -1. + <_> + 9 0 2 2 3. + <_> + + <_> + 6 13 8 2 -1. + <_> + 8 13 4 2 2. + <_> + + <_> + 14 12 4 4 -1. + <_> + 15 12 2 4 2. + <_> + + <_> + 3 8 17 9 -1. + <_> + 3 11 17 3 3. + <_> + + <_> + 0 12 4 3 -1. + <_> + 2 12 2 3 2. + <_> + + <_> + 8 3 12 6 -1. + <_> + 12 3 4 6 3. + <_> + + <_> + 0 14 3 6 -1. + <_> + 0 17 3 3 2. + <_> + + <_> + 3 0 13 9 -1. + <_> + 3 3 13 3 3. + <_> + + <_> + 8 2 8 6 -1. + <_> + 8 5 8 3 2. + <_> + + <_> + 1 11 18 3 -1. + <_> + 7 11 6 3 3. + <_> + + <_> + 16 17 1 2 -1. + <_> + 16 17 1 1 2. + 1 + <_> + + <_> + 14 12 6 4 -1. + <_> + 16 12 2 4 3. + <_> + + <_> + 13 11 4 5 -1. + <_> + 14 11 2 5 2. + <_> + + <_> + 19 3 1 2 -1. + <_> + 19 4 1 1 2. + <_> + + <_> + 19 0 1 3 -1. + <_> + 19 1 1 1 3. + <_> + + <_> + 7 2 8 4 -1. + <_> + 7 4 8 2 2. + <_> + + <_> + 9 12 3 2 -1. + <_> + 10 12 1 2 3. + <_> + + <_> + 15 8 3 2 -1. + <_> + 16 9 1 2 3. + 1 + <_> + + <_> + 16 15 3 2 -1. + <_> + 16 15 3 1 2. + 1 + <_> + + <_> + 6 12 3 3 -1. + <_> + 7 12 1 3 3. + <_> + + <_> + 13 12 3 1 -1. + <_> + 14 13 1 1 3. + 1 + <_> + + <_> + 4 0 1 3 -1. + <_> + 3 1 1 1 3. + 1 + <_> + + <_> + 8 2 6 4 -1. + <_> + 10 2 2 4 3. + <_> + + <_> + 15 15 2 3 -1. + <_> + 14 16 2 1 3. + 1 + <_> + + <_> + 12 18 8 2 -1. + <_> + 12 19 8 1 2. + <_> + + <_> + 7 12 6 7 -1. + <_> + 9 12 2 7 3. + <_> + + <_> + 4 18 6 2 -1. + <_> + 6 18 2 2 3. + <_> + + <_> + 11 12 3 3 -1. + <_> + 12 12 1 3 3. + <_> + + <_> + 12 12 2 2 -1. + <_> + 13 12 1 2 2. + <_> + + <_> + 18 5 2 1 -1. + <_> + 19 5 1 1 2. + <_> + + <_> + 5 19 4 1 -1. + <_> + 6 19 2 1 2. + <_> + + <_> + 0 11 5 2 -1. + <_> + 0 12 5 1 2. + <_> + + <_> + 18 0 2 2 -1. + <_> + 18 1 2 1 2. + <_> + + <_> + 1 0 12 6 -1. + <_> + 1 2 12 2 3. + <_> + + <_> + 1 1 6 1 -1. + <_> + 3 3 2 1 3. + 1 + <_> + + <_> + 16 9 3 1 -1. + <_> + 17 10 1 1 3. + 1 + <_> + + <_> + 14 10 1 6 -1. + <_> + 12 12 1 2 3. + 1 + <_> + + <_> + 3 1 1 3 -1. + <_> + 2 2 1 1 3. + 1 + <_> + + <_> + 3 0 4 3 -1. + <_> + 2 1 4 1 3. + 1 + <_> + + <_> + 6 14 8 1 -1. + <_> + 8 14 4 1 2. + <_> + + <_> + 1 8 18 9 -1. + <_> + 7 11 6 3 9. + <_> + + <_> + 19 0 1 18 -1. + <_> + 19 6 1 6 3. + <_> + + <_> + 1 13 3 6 -1. + <_> + 1 16 3 3 2. + <_> + + <_> + 6 10 7 3 -1. + <_> + 6 11 7 1 3. + <_> + + <_> + 6 9 7 3 -1. + <_> + 6 10 7 1 3. + <_> + + <_> + 14 1 6 8 -1. + <_> + 17 1 3 8 2. + <_> + + <_> + 9 6 2 4 -1. + <_> + 10 6 1 4 2. + <_> + + <_> + 6 11 7 2 -1. + <_> + 6 12 7 1 2. + <_> + + <_> + 17 11 3 6 -1. + <_> + 18 12 1 6 3. + 1 + <_> + + <_> + 19 17 1 2 -1. + <_> + 19 17 1 1 2. + 1 + <_> + + <_> + 16 9 4 2 -1. + <_> + 17 10 2 2 2. + 1 + <_> + + <_> + 6 18 4 2 -1. + <_> + 7 18 2 2 2. + <_> + + <_> + 2 12 4 4 -1. + <_> + 3 12 2 4 2. + <_> + + <_> + 19 2 1 2 -1. + <_> + 19 3 1 1 2. + <_> + + <_> + 19 2 1 3 -1. + <_> + 19 3 1 1 3. + <_> + + <_> + 1 12 12 3 -1. + <_> + 7 12 6 3 2. + <_> + + <_> + 6 18 4 1 -1. + <_> + 7 18 2 1 2. + <_> + + <_> + 5 2 12 6 -1. + <_> + 5 5 12 3 2. + <_> + + <_> + 9 1 6 6 -1. + <_> + 9 4 6 3 2. + <_> + + <_> + 7 0 11 9 -1. + <_> + 7 3 11 3 3. + <_> + + <_> + 2 0 8 9 -1. + <_> + 2 3 8 3 3. + <_> + + <_> + 5 3 4 3 -1. + <_> + 6 3 2 3 2. + <_> + + <_> + 0 18 3 2 -1. + <_> + 0 19 3 1 2. + <_> + + <_> + 1 0 10 19 -1. + <_> + 6 0 5 19 2. + <_> + + <_> + 3 8 2 3 -1. + <_> + 2 9 2 1 3. + 1 + <_> + + <_> + 10 17 4 3 -1. + <_> + 11 17 2 3 2. + <_> + + <_> + 11 13 3 2 -1. + <_> + 12 13 1 2 3. + <_> + + <_> + 10 12 3 2 -1. + <_> + 11 12 1 2 3. + <_> + + <_> + 9 11 3 3 -1. + <_> + 10 11 1 3 3. + <_> + + <_> + 17 2 3 1 -1. + <_> + 18 3 1 1 3. + 1 + <_> + + <_> + 12 0 6 13 -1. + <_> + 14 0 2 13 3. + <_> + + <_> + 16 0 3 1 -1. + <_> + 17 1 1 1 3. + 1 + <_> + + <_> + 5 11 1 2 -1. + <_> + 5 12 1 1 2. + <_> + + <_> + 2 11 4 2 -1. + <_> + 2 11 2 1 2. + <_> + 4 12 2 1 2. + <_> + + <_> + 16 15 2 3 -1. + <_> + 15 16 2 1 3. + 1 + <_> + + <_> + 8 17 4 2 -1. + <_> + 9 17 2 2 2. + <_> + + <_> + 0 16 4 3 -1. + <_> + 0 17 4 1 3. + <_> + + <_> + 9 13 6 2 -1. + <_> + 12 13 3 2 2. + <_> + + <_> + 2 14 1 2 -1. + <_> + 2 14 1 1 2. + 1 + <_> + + <_> + 5 10 8 3 -1. + <_> + 5 11 8 1 3. + <_> + + <_> + 15 0 3 8 -1. + <_> + 13 2 3 4 2. + 1 + <_> + + <_> + 14 11 4 7 -1. + <_> + 15 11 2 7 2. + <_> + + <_> + 3 11 15 4 -1. + <_> + 8 11 5 4 3. + <_> + + <_> + 9 1 9 9 -1. + <_> + 12 1 3 9 3. + <_> + + <_> + 0 11 4 7 -1. + <_> + 2 11 2 7 2. + <_> + + <_> + 0 16 1 4 -1. + <_> + 0 18 1 2 2. + <_> + + <_> + 19 0 1 6 -1. + <_> + 19 3 1 3 2. + <_> + + <_> + 11 8 9 9 -1. + <_> + 11 11 9 3 3. + <_> + + <_> + 9 17 8 3 -1. + <_> + 11 17 4 3 2. + <_> + + <_> + 18 4 2 2 -1. + <_> + 19 4 1 2 2. + <_> + + <_> + 8 11 3 3 -1. + <_> + 9 12 1 1 9. + <_> + + <_> + 13 2 3 4 -1. + <_> + 13 2 3 2 2. + 1 + <_> + + <_> + 4 6 16 3 -1. + <_> + 12 6 8 3 2. + <_> + + <_> + 10 12 1 3 -1. + <_> + 9 13 1 1 3. + 1 + <_> + + <_> + 8 12 3 3 -1. + <_> + 9 13 1 1 9. + <_> + + <_> + 17 17 1 2 -1. + <_> + 17 17 1 1 2. + 1 + <_> + + <_> + 16 16 2 2 -1. + <_> + 16 16 2 1 2. + 1 + <_> + + <_> + 6 0 9 6 -1. + <_> + 6 2 9 2 3. + <_> + + <_> + 5 0 10 8 -1. + <_> + 5 2 10 4 2. + <_> + + <_> + 17 5 2 1 -1. + <_> + 18 5 1 1 2. + <_> + + <_> + 11 0 9 9 -1. + <_> + 14 0 3 9 3. + <_> + + <_> + 6 9 7 3 -1. + <_> + 6 10 7 1 3. + <_> + + <_> + 3 12 6 2 -1. + <_> + 3 12 3 1 2. + <_> + 6 13 3 1 2. + <_> + + <_> + 2 10 1 2 -1. + <_> + 2 10 1 1 2. + 1 + <_> + + <_> + 13 15 2 3 -1. + <_> + 12 16 2 1 3. + 1 + <_> + + <_> + 7 2 6 5 -1. + <_> + 9 2 2 5 3. + <_> + + <_> + 13 13 6 3 -1. + <_> + 15 13 2 3 3. + <_> + + <_> + 17 9 3 8 -1. + <_> + 17 11 3 4 2. + <_> + + <_> + 8 3 4 3 -1. + <_> + 9 3 2 3 2. + <_> + + <_> + 15 6 2 12 -1. + <_> + 15 6 1 12 2. + 1 + <_> + + <_> + 11 14 4 2 -1. + <_> + 11 14 4 1 2. + 1 + <_> + + <_> + 9 2 5 4 -1. + <_> + 9 4 5 2 2. + <_> + + <_> + 13 12 3 3 -1. + <_> + 14 12 1 3 3. + <_> + + <_> + 18 1 2 3 -1. + <_> + 18 2 2 1 3. + <_> + + <_> + 5 13 4 1 -1. + <_> + 6 13 2 1 2. + <_> + + <_> + 5 10 2 2 -1. + <_> + 5 10 2 1 2. + 1 + <_> + + <_> + 2 11 1 2 -1. + <_> + 2 11 1 1 2. + 1 + <_> + + <_> + 18 3 2 6 -1. + <_> + 18 5 2 2 3. + <_> + + <_> + 10 4 6 2 -1. + <_> + 10 5 6 1 2. + <_> + + <_> + 11 13 6 2 -1. + <_> + 13 13 2 2 3. + <_> + + <_> + 9 11 3 4 -1. + <_> + 9 11 3 2 2. + 1 + <_> + + <_> + 0 11 2 5 -1. + <_> + 1 11 1 5 2. + <_> + + <_> + 0 8 20 9 -1. + <_> + 0 11 20 3 3. + <_> + + <_> + 18 0 1 6 -1. + <_> + 18 3 1 3 2. + <_> + + <_> + 14 1 6 7 -1. + <_> + 17 1 3 7 2. + <_> + + <_> + 4 13 2 4 -1. + <_> + 4 13 1 2 2. + <_> + 5 15 1 2 2. + <_> + + <_> + 1 9 18 6 -1. + <_> + 7 9 6 6 3. + <_> + + <_> + 0 16 5 4 -1. + <_> + 0 18 5 2 2. + <_> + + <_> + 8 14 3 4 -1. + <_> + 8 15 3 2 2. + <_> + + <_> + 7 7 8 3 -1. + <_> + 11 7 4 3 2. + <_> + + <_> + 12 3 4 7 -1. + <_> + 13 3 2 7 2. + <_> + + <_> + 13 12 2 8 -1. + <_> + 13 12 1 4 2. + <_> + 14 16 1 4 2. + <_> + + <_> + 13 10 3 5 -1. + <_> + 14 11 1 5 3. + 1 + <_> + + <_> + 10 5 4 5 -1. + <_> + 11 5 2 5 2. + <_> + + <_> + 2 11 18 2 -1. + <_> + 8 11 6 2 3. + <_> + + <_> + 2 0 1 2 -1. + <_> + 2 0 1 1 2. + 1 + <_> + + <_> + 2 0 1 2 -1. + <_> + 2 0 1 1 2. + 1 + <_> + + <_> + 15 17 1 2 -1. + <_> + 15 17 1 1 2. + 1 + <_> + + <_> + 17 16 1 3 -1. + <_> + 16 17 1 1 3. + 1 + <_> + + <_> + 18 0 2 10 -1. + <_> + 19 0 1 10 2. + <_> + + <_> + 14 2 6 7 -1. + <_> + 16 2 2 7 3. + <_> + + <_> + 12 0 4 4 -1. + <_> + 12 0 4 2 2. + 1 + <_> + + <_> + 0 3 15 6 -1. + <_> + 0 5 15 2 3. + <_> + + <_> + 5 1 4 4 -1. + <_> + 6 1 2 4 2. + <_> + + <_> + 7 13 6 7 -1. + <_> + 9 13 2 7 3. + <_> + + <_> + 6 18 6 2 -1. + <_> + 8 18 2 2 3. + <_> + + <_> + 0 15 5 2 -1. + <_> + 0 16 5 1 2. + <_> + + <_> + 4 1 12 6 -1. + <_> + 4 3 12 2 3. + <_> + + <_> + 5 0 13 8 -1. + <_> + 5 2 13 4 2. + <_> + + <_> + 13 10 6 6 -1. + <_> + 15 12 2 2 9. + <_> + + <_> + 15 9 3 1 -1. + <_> + 16 10 1 1 3. + 1 + <_> + + <_> + 5 11 3 3 -1. + <_> + 6 12 1 1 9. + <_> + + <_> + 6 11 2 2 -1. + <_> + 6 11 1 1 2. + <_> + 7 12 1 1 2. + <_> + + <_> + 17 3 3 2 -1. + <_> + 18 4 1 2 3. + 1 + <_> + + <_> + 16 3 3 3 -1. + <_> + 17 4 1 3 3. + 1 + <_> + + <_> + 12 13 3 1 -1. + <_> + 13 13 1 1 3. + <_> + + <_> + 11 12 3 2 -1. + <_> + 12 12 1 2 3. + <_> + + <_> + 10 0 1 2 -1. + <_> + 10 0 1 1 2. + 1 + <_> + + <_> + 17 13 1 6 -1. + <_> + 17 13 1 3 2. + 1 + <_> + + <_> + 16 14 2 4 -1. + <_> + 16 14 2 2 2. + 1 + <_> + + <_> + 3 0 4 3 -1. + <_> + 4 0 2 3 2. + <_> + + <_> + 6 0 14 1 -1. + <_> + 13 0 7 1 2. + <_> + + <_> + 2 15 18 5 -1. + <_> + 8 15 6 5 3. + <_> + + <_> + 6 11 8 5 -1. + <_> + 8 11 4 5 2. + <_> + + <_> + 0 8 5 12 -1. + <_> + 0 11 5 6 2. + <_> + + <_> + 14 0 6 2 -1. + <_> + 14 0 6 1 2. + 1 + <_> + + <_> + 13 8 4 5 -1. + <_> + 14 9 2 5 2. + 1 + <_> + + <_> + 0 11 4 9 -1. + <_> + 2 11 2 9 2. + <_> + + <_> + 6 9 2 6 -1. + <_> + 6 11 2 2 3. + <_> + + <_> + 12 18 4 2 -1. + <_> + 12 19 4 1 2. + <_> + + <_> + 14 13 6 2 -1. + <_> + 16 13 2 2 3. + <_> + + <_> + 19 9 1 10 -1. + <_> + 19 9 1 5 2. + 1 + <_> + + <_> + 11 5 4 4 -1. + <_> + 12 5 2 4 2. + <_> + + <_> + 14 12 3 5 -1. + <_> + 15 12 1 5 3. + <_> + + <_> + 17 0 2 6 -1. + <_> + 18 0 1 6 2. + <_> + + <_> + 13 16 3 3 -1. + <_> + 14 16 1 3 3. + <_> + + <_> + 19 0 1 4 -1. + <_> + 19 2 1 2 2. + <_> + + <_> + 6 13 4 2 -1. + <_> + 7 13 2 2 2. + <_> + + <_> + 9 11 3 3 -1. + <_> + 10 11 1 3 3. + <_> + + <_> + 14 15 2 3 -1. + <_> + 13 16 2 1 3. + 1 + <_> + + <_> + 11 7 3 4 -1. + <_> + 12 7 1 4 3. + <_> + + <_> + 5 12 1 3 -1. + <_> + 4 13 1 1 3. + 1 + <_> + + <_> + 1 11 6 2 -1. + <_> + 1 11 3 1 2. + <_> + 4 12 3 1 2. + <_> + + <_> + 5 7 2 3 -1. + <_> + 4 8 2 1 3. + 1 + <_> + + <_> + 5 12 2 2 -1. + <_> + 5 12 1 1 2. + <_> + 6 13 1 1 2. + <_> + + <_> + 8 8 4 3 -1. + <_> + 8 9 4 1 3. + <_> + + <_> + 7 8 5 3 -1. + <_> + 7 9 5 1 3. + <_> + + <_> + 6 19 4 1 -1. + <_> + 7 19 2 1 2. + <_> + + <_> + 5 0 4 4 -1. + <_> + 6 0 2 4 2. + <_> + + <_> + 4 0 16 8 -1. + <_> + 8 0 8 8 2. + <_> + + <_> + 12 11 3 4 -1. + <_> + 11 12 3 2 2. + 1 + <_> + + <_> + 0 4 20 6 -1. + <_> + 5 4 10 6 2. + <_> + + <_> + 13 2 2 4 -1. + <_> + 13 2 2 2 2. + 1 + <_> + + <_> + 0 5 14 15 -1. + <_> + 7 5 7 15 2. + <_> + + <_> + 1 18 3 2 -1. + <_> + 1 19 3 1 2. + <_> + + <_> + 3 6 3 3 -1. + <_> + 2 7 3 1 3. + 1 + <_> + + <_> + 0 1 6 8 -1. + <_> + 0 1 3 4 2. + <_> + 3 5 3 4 2. + <_> + + <_> + 5 0 6 6 -1. + <_> + 7 0 2 6 3. + <_> + + <_> + 1 1 15 8 -1. + <_> + 1 3 15 4 2. + <_> + + <_> + 0 0 16 1 -1. + <_> + 8 0 8 1 2. + <_> + + <_> + 3 0 1 2 -1. + <_> + 3 0 1 1 2. + 1 + <_> + + <_> + 3 13 4 1 -1. + <_> + 4 13 2 1 2. + <_> + + <_> + 4 11 2 2 -1. + <_> + 4 11 1 1 2. + <_> + 5 12 1 1 2. + <_> + + <_> + 17 2 3 3 -1. + <_> + 18 3 1 1 9. + <_> + + <_> + 16 3 2 1 -1. + <_> + 17 3 1 1 2. + <_> + + <_> + 0 11 3 2 -1. + <_> + 0 12 3 1 2. + <_> + + <_> + 4 11 4 2 -1. + <_> + 4 11 2 1 2. + <_> + 6 12 2 1 2. + <_> + + <_> + 10 0 4 11 -1. + <_> + 11 0 2 11 2. + <_> + + <_> + 18 15 2 3 -1. + <_> + 17 16 2 1 3. + 1 + <_> + + <_> + 2 11 8 1 -1. + <_> + 2 11 4 1 2. + 1 + <_> + + <_> + 17 13 1 6 -1. + <_> + 17 13 1 3 2. + 1 + <_> + + <_> + 11 13 6 2 -1. + <_> + 13 13 2 2 3. + <_> + + <_> + 19 0 1 10 -1. + <_> + 19 5 1 5 2. + <_> + + <_> + 2 8 7 9 -1. + <_> + 2 11 7 3 3. + <_> + + <_> + 0 11 20 2 -1. + <_> + 5 11 10 2 2. + <_> + + <_> + 6 14 6 1 -1. + <_> + 8 14 2 1 3. + <_> + + <_> + 10 3 8 7 -1. + <_> + 12 3 4 7 2. + <_> + + <_> + 7 0 5 9 -1. + <_> + 7 3 5 3 3. + <_> + + <_> + 0 0 16 6 -1. + <_> + 0 2 16 2 3. + <_> + + <_> + 6 10 2 6 -1. + <_> + 4 12 2 2 3. + 1 + <_> + + <_> + 16 0 4 14 -1. + <_> + 18 0 2 14 2. + <_> + + <_> + 6 0 9 6 -1. + <_> + 6 2 9 2 3. + <_> + + <_> + 8 18 12 2 -1. + <_> + 8 19 12 1 2. + <_> + + <_> + 10 17 4 3 -1. + <_> + 11 17 2 3 2. + <_> + + <_> + 5 0 1 4 -1. + <_> + 4 1 1 2 2. + 1 + <_> + + <_> + 18 6 2 2 -1. + <_> + 18 6 1 2 2. + 1 + <_> + + <_> + 12 10 3 4 -1. + <_> + 11 11 3 2 2. + 1 + <_> + + <_> + 9 9 4 3 -1. + <_> + 9 10 4 1 3. + <_> + + <_> + 9 10 4 3 -1. + <_> + 9 11 4 1 3. + <_> + + <_> + 17 4 3 4 -1. + <_> + 18 5 1 4 3. + 1 + <_> + + <_> + 18 0 2 3 -1. + <_> + 18 1 2 1 3. + <_> + + <_> + 18 1 2 2 -1. + <_> + 18 2 2 1 2. + <_> + + <_> + 19 1 1 3 -1. + <_> + 19 2 1 1 3. + <_> + + <_> + 8 18 4 2 -1. + <_> + 9 18 2 2 2. + <_> + + <_> + 2 13 4 2 -1. + <_> + 2 13 2 1 2. + <_> + 4 14 2 1 2. + <_> + + <_> + 3 11 4 2 -1. + <_> + 3 11 2 1 2. + <_> + 5 12 2 1 2. + <_> + + <_> + 2 10 4 2 -1. + <_> + 2 10 2 1 2. + <_> + 4 11 2 1 2. + <_> + + <_> + 5 9 2 3 -1. + <_> + 4 10 2 1 3. + 1 + <_> + + <_> + 2 10 4 6 -1. + <_> + 3 10 2 6 2. + <_> + + <_> + 13 0 6 8 -1. + <_> + 16 0 3 8 2. + <_> + + <_> + 10 0 8 9 -1. + <_> + 12 0 4 9 2. + <_> + + <_> + 1 11 8 1 -1. + <_> + 1 11 4 1 2. + 1 + <_> + + <_> + 3 0 1 3 -1. + <_> + 2 1 1 1 3. + 1 + <_> + + <_> + 13 13 2 2 -1. + <_> + 14 13 1 2 2. + <_> + + <_> + 4 12 3 4 -1. + <_> + 5 12 1 4 3. + <_> + + <_> + 6 17 4 3 -1. + <_> + 7 17 2 3 2. + <_> + + <_> + 14 1 2 6 -1. + <_> + 14 1 2 3 2. + 1 + <_> + + <_> + 8 4 8 4 -1. + <_> + 8 6 8 2 2. + <_> + + <_> + 8 3 4 5 -1. + <_> + 10 3 2 5 2. + <_> + + <_> + 13 12 2 2 -1. + <_> + 13 12 1 1 2. + <_> + 14 13 1 1 2. + <_> + + <_> + 6 12 3 3 -1. + <_> + 7 12 1 3 3. + <_> + + <_> + 5 7 3 3 -1. + <_> + 4 8 3 1 3. + 1 + <_> + + <_> + 15 10 5 4 -1. + <_> + 15 11 5 2 2. + <_> + + <_> + 14 8 4 9 -1. + <_> + 14 11 4 3 3. + <_> + + <_> + 16 9 4 3 -1. + <_> + 16 10 4 1 3. + <_> + + <_> + 18 7 2 13 -1. + <_> + 19 7 1 13 2. + <_> + + <_> + 0 0 16 1 -1. + <_> + 8 0 8 1 2. + <_> + + <_> + 12 11 5 4 -1. + <_> + 11 12 5 2 2. + 1 + <_> + + <_> + 17 13 2 4 -1. + <_> + 18 13 1 4 2. + <_> + + <_> + 6 13 9 2 -1. + <_> + 9 13 3 2 3. + <_> + + <_> + 3 8 6 8 -1. + <_> + 3 10 6 4 2. + <_> + + <_> + 14 12 4 3 -1. + <_> + 15 12 2 3 2. + <_> + + <_> + 12 6 6 4 -1. + <_> + 14 8 2 4 3. + 1 + <_> + + <_> + 4 0 12 6 -1. + <_> + 4 3 12 3 2. + <_> + + <_> + 0 0 17 2 -1. + <_> + 0 1 17 1 2. + <_> + + <_> + 2 14 1 6 -1. + <_> + 2 17 1 3 2. + <_> + + <_> + 3 10 3 3 -1. + <_> + 2 11 3 1 3. + 1 + <_> + + <_> + 18 2 2 9 -1. + <_> + 19 2 1 9 2. + <_> + + <_> + 7 9 13 8 -1. + <_> + 7 11 13 4 2. + <_> + + <_> + 17 6 3 4 -1. + <_> + 18 7 1 4 3. + 1 + <_> + + <_> + 6 13 2 2 -1. + <_> + 7 13 1 2 2. + <_> + + <_> + 15 16 1 3 -1. + <_> + 14 17 1 1 3. + 1 + <_> + + <_> + 11 16 6 4 -1. + <_> + 11 16 3 2 2. + <_> + 14 18 3 2 2. + <_> + + <_> + 19 0 1 4 -1. + <_> + 19 1 1 2 2. + <_> + + <_> + 19 0 1 2 -1. + <_> + 19 1 1 1 2. + <_> + + <_> + 12 3 3 6 -1. + <_> + 13 3 1 6 3. + <_> + + <_> + 8 10 4 3 -1. + <_> + 8 11 4 1 3. + <_> + + <_> + 19 0 1 8 -1. + <_> + 19 4 1 4 2. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 0 3 3 2. + <_> + 17 3 3 3 2. + <_> + + <_> + 8 11 3 3 -1. + <_> + 9 12 1 1 9. + <_> + + <_> + 1 6 10 12 -1. + <_> + 6 6 5 12 2. + <_> + + <_> + 10 6 2 1 -1. + <_> + 11 6 1 1 2. + <_> + + <_> + 8 1 7 10 -1. + <_> + 8 6 7 5 2. + <_> + + <_> + 13 11 3 3 -1. + <_> + 14 12 1 3 3. + 1 + <_> + + <_> + 10 13 4 4 -1. + <_> + 10 13 2 2 2. + <_> + 12 15 2 2 2. + <_> + + <_> + 15 15 2 3 -1. + <_> + 14 16 2 1 3. + 1 + <_> + + <_> + 13 13 3 1 -1. + <_> + 14 13 1 1 3. + <_> + + <_> + 10 4 6 3 -1. + <_> + 12 4 2 3 3. + <_> + + <_> + 1 7 6 4 -1. + <_> + 1 7 3 2 2. + <_> + 4 9 3 2 2. + <_> + + <_> + 15 7 4 2 -1. + <_> + 16 8 2 2 2. + 1 + <_> + + <_> + 10 4 9 6 -1. + <_> + 13 4 3 6 3. + <_> + + <_> + 14 2 6 2 -1. + <_> + 14 2 6 1 2. + 1 + <_> + + <_> + 5 18 4 2 -1. + <_> + 6 18 2 2 2. + <_> + + <_> + 0 12 2 8 -1. + <_> + 1 12 1 8 2. + <_> + + <_> + 1 19 18 1 -1. + <_> + 10 19 9 1 2. + <_> + + <_> + 2 0 12 20 -1. + <_> + 8 0 6 20 2. + <_> + + <_> + 2 0 14 1 -1. + <_> + 9 0 7 1 2. + <_> + + <_> + 7 9 8 3 -1. + <_> + 7 10 8 1 3. + <_> + + <_> + 3 11 2 2 -1. + <_> + 3 11 1 1 2. + <_> + 4 12 1 1 2. + <_> + + <_> + 11 0 9 2 -1. + <_> + 14 0 3 2 3. + <_> + + <_> + 6 0 9 1 -1. + <_> + 9 0 3 1 3. + <_> + + <_> + 4 8 1 4 -1. + <_> + 3 9 1 2 2. + 1 + <_> + + <_> + 0 9 3 3 -1. + <_> + 0 10 3 1 3. + <_> + + <_> + 3 4 15 12 -1. + <_> + 8 8 5 4 9. + <_> + + <_> + 7 13 6 6 -1. + <_> + 9 13 2 6 3. + <_> + + <_> + 2 1 12 6 -1. + <_> + 2 3 12 2 3. + <_> + + <_> + 1 1 6 1 -1. + <_> + 3 3 2 1 3. + 1 + <_> + + <_> + 3 4 5 3 -1. + <_> + 2 5 5 1 3. + 1 + <_> + + <_> + 2 12 2 2 -1. + <_> + 2 12 1 1 2. + <_> + 3 13 1 1 2. + <_> + + <_> + 8 11 3 3 -1. + <_> + 9 11 1 3 3. + <_> + + <_> + 9 11 3 4 -1. + <_> + 10 11 1 4 3. + <_> + + <_> + 17 2 3 1 -1. + <_> + 18 3 1 1 3. + 1 + <_> + + <_> + 5 11 6 3 -1. + <_> + 8 11 3 3 2. + <_> + + <_> + 2 12 12 8 -1. + <_> + 2 12 6 4 2. + <_> + 8 16 6 4 2. + <_> + + <_> + 13 15 2 3 -1. + <_> + 12 16 2 1 3. + 1 + <_> + + <_> + 5 14 9 1 -1. + <_> + 8 14 3 1 3. + <_> + + <_> + 13 13 4 6 -1. + <_> + 13 13 2 3 2. + <_> + 15 16 2 3 2. + <_> + + <_> + 8 7 9 1 -1. + <_> + 11 10 3 1 3. + 1 + <_> + + <_> + 16 0 4 4 -1. + <_> + 16 0 4 2 2. + 1 + <_> + + <_> + 2 13 2 2 -1. + <_> + 2 13 2 1 2. + 1 + <_> + + <_> + 5 12 2 2 -1. + <_> + 5 13 2 1 2. + <_> + + <_> + 0 16 2 4 -1. + <_> + 0 18 2 2 2. + <_> + + <_> + 0 8 14 11 -1. + <_> + 7 8 7 11 2. + <_> + + <_> + 4 17 4 3 -1. + <_> + 5 17 2 3 2. + <_> + + <_> + 3 12 3 5 -1. + <_> + 4 12 1 5 3. + <_> + + <_> + 5 11 1 3 -1. + <_> + 5 12 1 1 3. + <_> + + <_> + 4 10 4 2 -1. + <_> + 4 10 2 1 2. + <_> + 6 11 2 1 2. + <_> + + <_> + 15 9 3 1 -1. + <_> + 16 10 1 1 3. + 1 + <_> + + <_> + 3 0 16 7 -1. + <_> + 7 0 8 7 2. + <_> + + <_> + 2 2 17 6 -1. + <_> + 2 5 17 3 2. + <_> + + <_> + 2 4 14 6 -1. + <_> + 2 6 14 2 3. + <_> + + <_> + 2 9 6 2 -1. + <_> + 2 9 3 1 2. + <_> + 5 10 3 1 2. + <_> + + <_> + 3 11 4 2 -1. + <_> + 3 11 2 1 2. + <_> + 5 12 2 1 2. + <_> + + <_> + 16 13 4 2 -1. + <_> + 18 13 2 2 2. + <_> + + <_> + 15 7 3 2 -1. + <_> + 16 8 1 2 3. + 1 + <_> + + <_> + 0 11 4 2 -1. + <_> + 0 12 4 1 2. + <_> + + <_> + 4 9 2 3 -1. + <_> + 3 10 2 1 3. + 1 + <_> + + <_> + 3 18 6 2 -1. + <_> + 5 18 2 2 3. + <_> + + <_> + 11 12 3 2 -1. + <_> + 12 12 1 2 3. + <_> + + <_> + 19 0 1 2 -1. + <_> + 19 1 1 1 2. + <_> + + <_> + 0 0 14 1 -1. + <_> + 7 0 7 1 2. + <_> + + <_> + 11 10 3 4 -1. + <_> + 10 11 3 2 2. + 1 + <_> + + <_> + 14 16 1 3 -1. + <_> + 13 17 1 1 3. + 1 + <_> + + <_> + 18 1 2 4 -1. + <_> + 19 1 1 4 2. + <_> + + <_> + 15 13 5 6 -1. + <_> + 15 15 5 2 3. + <_> + + <_> + 16 4 3 3 -1. + <_> + 17 5 1 3 3. + 1 + <_> + + <_> + 4 6 16 14 -1. + <_> + 12 6 8 14 2. + <_> + + <_> + 10 12 3 1 -1. + <_> + 11 12 1 1 3. + <_> + + <_> + 5 12 2 2 -1. + <_> + 5 12 1 1 2. + <_> + 6 13 1 1 2. + <_> + + <_> + 9 3 4 5 -1. + <_> + 10 3 2 5 2. + <_> + + <_> + 18 1 2 3 -1. + <_> + 18 2 2 1 3. + <_> + + <_> + 19 17 1 2 -1. + <_> + 19 17 1 1 2. + 1 + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 2 1 2. + 1 + <_> + + <_> + 10 2 7 6 -1. + <_> + 10 4 7 2 3. + <_> + + <_> + 2 0 13 4 -1. + <_> + 2 1 13 2 2. + <_> + + <_> + 2 0 2 2 -1. + <_> + 2 0 1 2 2. + 1 + <_> + + <_> + 0 3 6 8 -1. + <_> + 3 3 3 8 2. + <_> + + <_> + 3 0 1 3 -1. + <_> + 2 1 1 1 3. + 1 + <_> + + <_> + 8 0 6 9 -1. + <_> + 10 0 2 9 3. + <_> + + <_> + 17 9 3 2 -1. + <_> + 18 10 1 2 3. + 1 + <_> + + <_> + 16 8 4 6 -1. + <_> + 16 10 4 2 3. + <_> + + <_> + 6 9 7 3 -1. + <_> + 6 10 7 1 3. + <_> + + <_> + 2 10 3 4 -1. + <_> + 2 11 3 2 2. + <_> + + <_> + 15 8 1 6 -1. + <_> + 15 8 1 3 2. + 1 + <_> + + <_> + 19 3 1 12 -1. + <_> + 19 7 1 4 3. + <_> + + <_> + 2 0 5 2 -1. + <_> + 2 0 5 1 2. + 1 + <_> + + <_> + 1 3 11 6 -1. + <_> + 1 5 11 2 3. + <_> + + <_> + 14 13 2 4 -1. + <_> + 14 13 1 2 2. + <_> + 15 15 1 2 2. + <_> + + <_> + 8 11 10 3 -1. + <_> + 13 11 5 3 2. + <_> + + <_> + 6 11 1 4 -1. + <_> + 6 13 1 2 2. + <_> + + <_> + 2 9 3 9 -1. + <_> + 3 12 1 3 9. + <_> + + <_> + 4 0 15 9 -1. + <_> + 9 3 5 3 9. + <_> + + <_> + 12 0 6 4 -1. + <_> + 12 0 6 2 2. + 1 + <_> + + <_> + 10 5 4 5 -1. + <_> + 12 5 2 5 2. + <_> + + <_> + 1 7 18 12 -1. + <_> + 7 11 6 4 9. + <_> + + <_> + 14 12 6 4 -1. + <_> + 16 12 2 4 3. + <_> + + <_> + 13 12 3 3 -1. + <_> + 14 12 1 3 3. + <_> + + <_> + 14 9 4 1 -1. + <_> + 15 10 2 1 2. + 1 + <_> + + <_> + 17 7 3 2 -1. + <_> + 18 8 1 2 3. + 1 + <_> + + <_> + 19 3 1 2 -1. + <_> + 19 4 1 1 2. + <_> + + <_> + 19 1 1 4 -1. + <_> + 19 2 1 2 2. + <_> + + <_> + 3 2 12 8 -1. + <_> + 3 4 12 4 2. + <_> + + <_> + 1 0 16 6 -1. + <_> + 1 2 16 2 3. + <_> + + <_> + 16 8 3 1 -1. + <_> + 17 9 1 1 3. + 1 + <_> + + <_> + 7 13 6 3 -1. + <_> + 9 14 2 1 9. + <_> + + <_> + 11 18 6 2 -1. + <_> + 11 19 6 1 2. + <_> + + <_> + 15 17 5 3 -1. + <_> + 15 18 5 1 3. + <_> + + <_> + 2 1 18 4 -1. + <_> + 8 1 6 4 3. + <_> + + <_> + 5 0 1 2 -1. + <_> + 5 1 1 1 2. + <_> + + <_> + 1 11 6 6 -1. + <_> + 3 13 2 2 9. + <_> + + <_> + 3 12 4 2 -1. + <_> + 3 12 2 1 2. + <_> + 5 13 2 1 2. + <_> + + <_> + 3 0 3 3 -1. + <_> + 2 1 3 1 3. + 1 + <_> + + <_> + 8 10 3 3 -1. + <_> + 9 11 1 1 9. + <_> + + <_> + 0 16 2 2 -1. + <_> + 0 17 2 1 2. + <_> + + <_> + 0 16 4 3 -1. + <_> + 0 17 4 1 3. + <_> + + <_> + 0 13 12 1 -1. + <_> + 6 13 6 1 2. + <_> + + <_> + 13 2 6 9 -1. + <_> + 15 2 2 9 3. + <_> + + <_> + 8 11 3 3 -1. + <_> + 9 11 1 3 3. + <_> + + <_> + 9 11 3 4 -1. + <_> + 10 11 1 4 3. + <_> + + <_> + 13 0 6 10 -1. + <_> + 15 0 2 10 3. + <_> + + <_> + 4 10 1 4 -1. + <_> + 3 11 1 2 2. + 1 + <_> + + <_> + 9 11 3 3 -1. + <_> + 10 12 1 1 9. + <_> + + <_> + 6 12 3 3 -1. + <_> + 5 13 3 1 3. + 1 + <_> + + <_> + 17 6 2 1 -1. + <_> + 18 6 1 1 2. + <_> + + <_> + 16 2 1 4 -1. + <_> + 16 2 1 2 2. + 1 + <_> + + <_> + 2 5 13 4 -1. + <_> + 2 6 13 2 2. + <_> + + <_> + 14 4 6 2 -1. + <_> + 14 4 6 1 2. + 1 + <_> + + <_> + 3 8 1 3 -1. + <_> + 2 9 1 1 3. + 1 + <_> + + <_> + 7 7 8 3 -1. + <_> + 7 8 8 1 3. + <_> + + <_> + 8 8 4 3 -1. + <_> + 10 8 2 3 2. + <_> + + <_> + 10 11 3 8 -1. + <_> + 10 15 3 4 2. + <_> + + <_> + 13 15 2 3 -1. + <_> + 12 16 2 1 3. + 1 + <_> + + <_> + 0 0 12 20 -1. + <_> + 6 0 6 20 2. + <_> + + <_> + 0 0 10 1 -1. + <_> + 5 0 5 1 2. + <_> + + <_> + 0 0 6 3 -1. + <_> + 0 1 6 1 3. + <_> + + <_> + 14 13 2 2 -1. + <_> + 14 13 1 1 2. + <_> + 15 14 1 1 2. + <_> + + <_> + 12 10 4 2 -1. + <_> + 12 10 2 1 2. + <_> + 14 11 2 1 2. + <_> + + <_> + 7 0 6 4 -1. + <_> + 9 0 2 4 3. + <_> + + <_> + 0 0 10 10 -1. + <_> + 0 0 5 5 2. + <_> + 5 5 5 5 2. + <_> + + <_> + 6 3 4 2 -1. + <_> + 7 3 2 2 2. + <_> + + <_> + 1 5 4 11 -1. + <_> + 2 5 2 11 2. + <_> + + <_> + 12 8 3 1 -1. + <_> + 13 8 1 1 3. + <_> + + <_> + 2 2 6 2 -1. + <_> + 2 2 6 1 2. + 1 + <_> + + <_> + 13 5 7 3 -1. + <_> + 12 6 7 1 3. + 1 + <_> + + <_> + 13 7 3 4 -1. + <_> + 14 7 1 4 3. + <_> + + <_> + 8 12 3 2 -1. + <_> + 8 12 3 1 2. + 1 + <_> + + <_> + 0 10 4 8 -1. + <_> + 0 12 4 4 2. + <_> + + <_> + 14 13 2 6 -1. + <_> + 14 13 1 3 2. + <_> + 15 16 1 3 2. + <_> + + <_> + 16 17 1 2 -1. + <_> + 16 17 1 1 2. + 1 + <_> + + <_> + 12 0 3 6 -1. + <_> + 10 2 3 2 3. + 1 + <_> + + <_> + 4 10 14 3 -1. + <_> + 4 11 14 1 3. + <_> + + <_> + 19 4 1 12 -1. + <_> + 19 8 1 4 3. + <_> + + <_> + 19 2 1 6 -1. + <_> + 19 4 1 2 3. + <_> + + <_> + 8 12 12 3 -1. + <_> + 14 12 6 3 2. + <_> + + <_> + 0 13 2 3 -1. + <_> + 1 13 1 3 2. + <_> + + <_> + 16 0 4 9 -1. + <_> + 18 0 2 9 2. + <_> + + <_> + 9 2 6 4 -1. + <_> + 9 4 6 2 2. + <_> + + <_> + 16 2 3 1 -1. + <_> + 17 3 1 1 3. + 1 + <_> + + <_> + 15 12 3 6 -1. + <_> + 16 12 1 6 3. + <_> + + <_> + 13 12 3 3 -1. + <_> + 14 12 1 3 3. + <_> + + <_> + 3 3 15 4 -1. + <_> + 3 5 15 2 2. + <_> + + <_> + 11 11 3 4 -1. + <_> + 12 11 1 4 3. + <_> + + <_> + 10 11 3 3 -1. + <_> + 11 11 1 3 3. + <_> + + <_> + 19 0 1 4 -1. + <_> + 19 2 1 2 2. + <_> + + <_> + 14 0 3 3 -1. + <_> + 15 1 1 3 3. + 1 + <_> + + <_> + 2 10 8 2 -1. + <_> + 2 10 4 2 2. + 1 + <_> + + <_> + 9 18 4 2 -1. + <_> + 10 18 2 2 2. + <_> + + <_> + 10 0 4 9 -1. + <_> + 11 0 2 9 2. + <_> + + <_> + 15 10 5 6 -1. + <_> + 15 12 5 2 3. + <_> + + <_> + 2 13 4 2 -1. + <_> + 3 13 2 2 2. + <_> + + <_> + 2 15 4 1 -1. + <_> + 3 16 2 1 2. + 1 + <_> + + <_> + 15 8 3 2 -1. + <_> + 16 9 1 2 3. + 1 + <_> + + <_> + 0 6 4 2 -1. + <_> + 2 6 2 2 2. + <_> + + <_> + 9 17 6 1 -1. + <_> + 12 17 3 1 2. + <_> + + <_> + 14 19 6 1 -1. + <_> + 17 19 3 1 2. + <_> + + <_> + 17 18 1 2 -1. + <_> + 17 19 1 1 2. + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 2 1 2. + 1 + <_> + + <_> + 19 3 1 9 -1. + <_> + 19 6 1 3 3. + <_> + + <_> + 10 10 3 3 -1. + <_> + 9 11 3 1 3. + 1 + <_> + + <_> + 3 0 3 3 -1. + <_> + 2 1 3 1 3. + 1 + <_> + + <_> + 17 16 2 2 -1. + <_> + 17 16 2 1 2. + 1 + <_> + + <_> + 5 11 3 3 -1. + <_> + 6 12 1 3 3. + 1 + <_> + + <_> + 3 11 2 2 -1. + <_> + 3 11 1 1 2. + <_> + 4 12 1 1 2. + <_> + + <_> + 16 9 2 2 -1. + <_> + 16 9 1 2 2. + 1 + <_> + + <_> + 4 9 2 2 -1. + <_> + 4 9 2 1 2. + 1 + <_> + + <_> + 3 10 2 3 -1. + <_> + 2 11 2 1 3. + 1 + <_> + + <_> + 0 0 20 20 -1. + <_> + 0 0 10 10 2. + <_> + 10 10 10 10 2. + <_> + + <_> + 7 16 5 3 -1. + <_> + 7 17 5 1 3. + <_> + + <_> + 14 1 3 6 -1. + <_> + 12 3 3 2 3. + 1 + <_> + + <_> + 6 0 4 7 -1. + <_> + 7 0 2 7 2. + <_> + + <_> + 9 5 9 6 -1. + <_> + 12 5 3 6 3. + <_> + + <_> + 5 18 4 2 -1. + <_> + 6 18 2 2 2. + <_> + + <_> + 7 7 6 8 -1. + <_> + 9 7 2 8 3. + <_> + + <_> + 18 16 2 4 -1. + <_> + 18 16 1 2 2. + <_> + 19 18 1 2 2. + <_> + + <_> + 11 18 2 2 -1. + <_> + 12 18 1 2 2. + <_> + + <_> + 3 2 5 2 -1. + <_> + 3 3 5 1 2. + <_> + + <_> + 7 1 6 4 -1. + <_> + 7 3 6 2 2. + <_> + + <_> + 2 0 2 2 -1. + <_> + 2 0 2 1 2. + 1 + <_> + + <_> + 0 1 16 1 -1. + <_> + 8 1 8 1 2. + <_> + + <_> + 11 1 3 10 -1. + <_> + 12 1 1 10 3. + <_> + + <_> + 4 0 4 4 -1. + <_> + 5 1 2 4 2. + 1 + <_> + + <_> + 4 13 3 2 -1. + <_> + 5 13 1 2 3. + <_> + + <_> + 8 11 4 3 -1. + <_> + 7 12 4 1 3. + 1 + <_> + + <_> + 7 17 4 3 -1. + <_> + 8 17 2 3 2. + <_> + + <_> + 5 19 2 1 -1. + <_> + 6 19 1 1 2. + <_> + + <_> + 0 9 2 2 -1. + <_> + 0 9 1 1 2. + <_> + 1 10 1 1 2. + <_> + + <_> + 0 9 2 2 -1. + <_> + 0 9 1 1 2. + <_> + 1 10 1 1 2. + <_> + + <_> + 6 9 2 2 -1. + <_> + 6 9 2 1 2. + 1 + <_> + + <_> + 0 10 5 3 -1. + <_> + 0 11 5 1 3. + <_> + + <_> + 3 10 2 2 -1. + <_> + 3 10 1 1 2. + <_> + 4 11 1 1 2. + <_> + + <_> + 0 10 18 1 -1. + <_> + 6 10 6 1 3. + <_> + + <_> + 17 4 3 1 -1. + <_> + 18 5 1 1 3. + 1 + <_> + + <_> + 17 1 2 7 -1. + <_> + 17 1 1 7 2. + 1 + <_> + + <_> + 6 13 9 2 -1. + <_> + 9 13 3 2 3. + <_> + + <_> + 4 9 16 6 -1. + <_> + 4 11 16 2 3. + <_> + + <_> + 1 1 16 4 -1. + <_> + 1 3 16 2 2. + <_> + + <_> + 14 12 3 3 -1. + <_> + 15 12 1 3 3. + <_> + + <_> + 2 9 6 2 -1. + <_> + 4 11 2 2 3. + 1 + <_> + + <_> + 10 0 8 10 -1. + <_> + 12 0 4 10 2. + <_> + + <_> + 1 12 16 4 -1. + <_> + 5 12 8 4 2. + <_> + + <_> + 13 8 6 9 -1. + <_> + 15 11 2 3 9. + <_> + + <_> + 19 0 1 8 -1. + <_> + 19 4 1 4 2. + <_> + + <_> + 8 2 10 6 -1. + <_> + 8 5 10 3 2. + <_> + + <_> + 18 7 2 1 -1. + <_> + 19 7 1 1 2. + <_> + + <_> + 19 4 1 12 -1. + <_> + 19 7 1 6 2. + <_> + + <_> + 8 11 3 3 -1. + <_> + 9 12 1 1 9. + <_> + + <_> + 7 12 3 3 -1. + <_> + 8 12 1 3 3. + <_> + + <_> + 6 13 3 2 -1. + <_> + 7 13 1 2 3. + <_> + + <_> + 17 15 3 2 -1. + <_> + 17 15 3 1 2. + 1 + <_> + + <_> + 11 6 3 3 -1. + <_> + 12 6 1 3 3. + <_> + + <_> + 0 15 2 4 -1. + <_> + 0 17 2 2 2. + <_> + + <_> + 12 9 7 2 -1. + <_> + 12 9 7 1 2. + 1 + <_> + + <_> + 6 5 8 7 -1. + <_> + 10 5 4 7 2. + <_> + + <_> + 6 17 8 3 -1. + <_> + 8 17 4 3 2. + <_> + + <_> + 0 17 4 3 -1. + <_> + 0 18 4 1 3. + <_> + + <_> + 5 1 10 6 -1. + <_> + 5 3 10 2 3. + <_> + + <_> + 0 2 18 2 -1. + <_> + 6 2 6 2 3. + <_> + + <_> + 7 8 6 3 -1. + <_> + 7 9 6 1 3. + <_> + + <_> + 10 8 1 3 -1. + <_> + 10 9 1 1 3. + <_> + + <_> + 16 1 3 2 -1. + <_> + 17 2 1 2 3. + 1 + <_> + + <_> + 2 10 1 2 -1. + <_> + 2 10 1 1 2. + 1 + <_> + + <_> + 2 9 1 2 -1. + <_> + 2 9 1 1 2. + 1 + <_> + + <_> + 3 9 2 3 -1. + <_> + 2 10 2 1 3. + 1 + <_> + + <_> + 2 14 12 6 -1. + <_> + 2 14 6 3 2. + <_> + 8 17 6 3 2. + <_> + + <_> + 15 17 1 2 -1. + <_> + 15 17 1 1 2. + 1 + <_> + + <_> + 17 11 3 3 -1. + <_> + 18 12 1 3 3. + 1 + <_> + + <_> + 13 12 3 2 -1. + <_> + 14 12 1 2 3. + <_> + + <_> + 16 18 4 2 -1. + <_> + 18 18 2 2 2. + <_> + + <_> + 18 14 2 4 -1. + <_> + 17 15 2 2 2. + 1 + <_> + + <_> + 12 13 3 1 -1. + <_> + 13 13 1 1 3. + <_> + + <_> + 11 12 3 3 -1. + <_> + 12 13 1 1 9. + <_> + + <_> + 0 0 16 20 -1. + <_> + 8 0 8 20 2. + <_> + + <_> + 3 0 8 5 -1. + <_> + 5 0 4 5 2. + <_> + + <_> + 0 0 2 1 -1. + <_> + 1 0 1 1 2. + <_> + + <_> + 1 2 19 4 -1. + <_> + 1 4 19 2 2. + <_> + + <_> + 12 7 3 4 -1. + <_> + 13 7 1 4 3. + <_> + + <_> + 15 6 3 3 -1. + <_> + 16 7 1 3 3. + 1 + <_> + + <_> + 3 13 2 2 -1. + <_> + 3 13 1 1 2. + <_> + 4 14 1 1 2. + <_> + + <_> + 2 12 2 2 -1. + <_> + 2 12 1 1 2. + <_> + 3 13 1 1 2. + <_> + + <_> + 0 3 19 4 -1. + <_> + 0 4 19 2 2. + <_> + + <_> + 17 7 3 4 -1. + <_> + 18 8 1 4 3. + 1 + <_> + + <_> + 4 8 3 4 -1. + <_> + 5 9 1 4 3. + 1 + <_> + + <_> + 14 11 4 6 -1. + <_> + 15 11 2 6 2. + <_> + + <_> + 18 3 2 6 -1. + <_> + 18 5 2 2 3. + <_> + + <_> + 14 3 2 4 -1. + <_> + 14 3 2 2 2. + 1 + <_> + + <_> + 7 9 5 4 -1. + <_> + 7 10 5 2 2. + <_> + + <_> + 12 11 8 2 -1. + <_> + 12 12 8 1 2. + <_> + + <_> + 16 13 3 4 -1. + <_> + 16 13 3 2 2. + 1 + <_> + + <_> + 14 7 5 9 -1. + <_> + 14 10 5 3 3. + <_> + + <_> + 0 12 1 3 -1. + <_> + 0 13 1 1 3. + <_> + + <_> + 6 6 3 6 -1. + <_> + 4 8 3 2 3. + 1 + <_> + + <_> + 0 9 9 1 -1. + <_> + 3 9 3 1 3. + <_> + + <_> + 0 9 6 2 -1. + <_> + 0 9 3 1 2. + <_> + 3 10 3 1 2. + <_> + + <_> + 3 2 4 4 -1. + <_> + 4 2 2 4 2. + <_> + + <_> + 18 3 2 3 -1. + <_> + 18 4 2 1 3. + <_> + + <_> + 6 16 3 3 -1. + <_> + 6 17 3 1 3. + <_> + + <_> + 1 16 6 3 -1. + <_> + 1 17 6 1 3. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_russian_plate_number.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_russian_plate_number.xml new file mode 100644 index 0000000000000000000000000000000000000000..39f5fcdd8b0de656af7d21ca20dc9cefa3906af1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_russian_plate_number.xml @@ -0,0 +1,2656 @@ + + + + BOOST + HAAR + 20 + 60 + + GAB + 9.9500000476837158e-001 + 5.0000000000000000e-001 + 9.4999999999999996e-001 + 1 + 100 + + 0 + 1 + ALL + 20 + + + <_> + 6 + -1.3110191822052002e+000 + + <_> + + 0 -1 193 1.0079263709485531e-002 + + -8.1339186429977417e-001 5.0277775526046753e-001 + <_> + + 0 -1 94 -2.2060684859752655e-002 + + 7.9418992996215820e-001 -5.0896102190017700e-001 + <_> + + 0 -1 18 -4.8777908086776733e-002 + + 7.1656656265258789e-001 -4.1640335321426392e-001 + <_> + + 0 -1 35 1.0387318208813667e-002 + + 3.7618312239646912e-001 -8.5504144430160522e-001 + <_> + + 0 -1 191 -9.4083719886839390e-004 + + 4.2658549547195435e-001 -5.7729166746139526e-001 + <_> + + 0 -1 48 -8.2391249015927315e-003 + + 8.2346975803375244e-001 -3.7503159046173096e-001 + + <_> + 6 + -1.1759783029556274e+000 + + <_> + + 0 -1 21 1.7386786639690399e-001 + + -6.8139964342117310e-001 6.0767590999603271e-001 + <_> + + 0 -1 28 -1.9797295331954956e-002 + + 7.8072130680084229e-001 -4.4399836659431458e-001 + <_> + + 0 -1 46 -1.0154811898246408e-003 + + 3.3383268117904663e-001 -7.6357340812683105e-001 + <_> + + 0 -1 138 2.4954911321401596e-002 + + -3.9979115128517151e-001 6.8620890378952026e-001 + <_> + + 0 -1 25 2.8837744612246752e-003 + + -2.7928480505943298e-001 7.9980146884918213e-001 + <_> + + 0 -1 26 -3.8839362561702728e-002 + + -7.8442335128784180e-001 3.4929576516151428e-001 + + <_> + 6 + -1.7856997251510620e+000 + + <_> + + 0 -1 34 2.7977079153060913e-002 + + -5.8424139022827148e-001 6.6850829124450684e-001 + <_> + + 0 -1 171 1.9148588180541992e-002 + + -6.5457659959793091e-001 4.0804430842399597e-001 + <_> + + 0 -1 7 1.1955041438341141e-002 + + -4.2002618312835693e-001 5.6217432022094727e-001 + <_> + + 0 -1 45 -2.1218564361333847e-002 + + 7.1812576055526733e-001 -3.0354043841362000e-001 + <_> + + 0 -1 108 2.0117280655540526e-004 + + -6.1749500036239624e-001 3.5549193620681763e-001 + <_> + + 0 -1 122 3.9725980604998767e-004 + + -2.6844096183776855e-001 7.6771658658981323e-001 + + <_> + 9 + -1.1837021112442017e+000 + + <_> + + 0 -1 202 -1.3291766867041588e-002 + + 4.5248869061470032e-001 -5.8849954605102539e-001 + <_> + + 0 -1 79 -4.8353265970945358e-002 + + 7.0951640605926514e-001 -3.2546108961105347e-001 + <_> + + 0 -1 22 2.6532993651926517e-003 + + -2.5343564152717590e-001 7.6588714122772217e-001 + <_> + + 0 -1 66 -3.8548894226551056e-002 + + 5.8126109838485718e-001 -3.0813106894493103e-001 + <_> + + 0 -1 41 -6.8602780811488628e-004 + + 2.6361095905303955e-001 -7.2226840257644653e-001 + <_> + + 0 -1 69 -2.5726919993758202e-002 + + -8.7153857946395874e-001 1.9438524544239044e-001 + <_> + + 0 -1 24 8.4192806389182806e-004 + + -3.6150649189949036e-001 5.2065432071685791e-001 + <_> + + 0 -1 62 -2.6956878136843443e-003 + + 5.9945529699325562e-001 -2.8344830870628357e-001 + <_> + + 0 -1 112 3.0572075396776199e-002 + + -3.0688971281051636e-001 5.7261526584625244e-001 + + <_> + 8 + -1.4687808752059937e+000 + + <_> + + 0 -1 5 3.1486168503761292e-002 + + -5.7836848497390747e-001 3.7931033968925476e-001 + <_> + + 0 -1 150 2.8311354108154774e-003 + + -5.7888329029083252e-001 3.2841828465461731e-001 + <_> + + 0 -1 76 -4.2060948908329010e-002 + + 5.5578106641769409e-001 -3.2662427425384521e-001 + <_> + + 0 -1 115 6.2936875037848949e-003 + + -2.1032968163490295e-001 7.8646916151046753e-001 + <_> + + 0 -1 51 7.0570126175880432e-002 + + -4.3683132529258728e-001 4.0298295021057129e-001 + <_> + + 0 -1 135 2.5173835456371307e-003 + + -2.0461565256118774e-001 8.2858163118362427e-001 + <_> + + 0 -1 102 1.5648975968360901e-003 + + -2.4848082661628723e-001 6.0209411382675171e-001 + <_> + + 0 -1 177 -3.5970686003565788e-003 + + 2.3294737935066223e-001 -6.5612471103668213e-001 + + <_> + 9 + -1.1029583215713501e+000 + + <_> + + 0 -1 27 -1.1257569491863251e-001 + + 3.3181819319725037e-001 -5.3901344537734985e-001 + <_> + + 0 -1 142 3.8014666642993689e-003 + + -3.6430206894874573e-001 4.5984184741973877e-001 + <_> + + 0 -1 57 9.8789634648710489e-004 + + -2.6661416888237000e-001 5.6971323490142822e-001 + <_> + + 0 -1 55 2.1719809621572495e-002 + + 1.8432702124118805e-001 -8.2999354600906372e-001 + <_> + + 0 -1 111 5.1051773130893707e-002 + + 1.4391148090362549e-001 -9.4541704654693604e-001 + <_> + + 0 -1 164 1.8956036074087024e-003 + + -6.0830104351043701e-001 2.6091885566711426e-001 + <_> + + 0 -1 81 -5.8700828813016415e-003 + + 6.9104760885238647e-001 -2.6916843652725220e-001 + <_> + + 0 -1 116 -1.1522199492901564e-003 + + -6.9503885507583618e-001 2.4749211966991425e-001 + <_> + + 0 -1 90 -5.1933946087956429e-003 + + 5.8551025390625000e-001 -3.0389472842216492e-001 + + <_> + 9 + -9.0274518728256226e-001 + + <_> + + 0 -1 205 -1.4383997768163681e-002 + + 4.5400592684745789e-001 -4.9917897582054138e-001 + <_> + + 0 -1 114 -3.3369414508342743e-002 + + -9.3247985839843750e-001 1.4586758613586426e-001 + <_> + + 0 -1 128 5.2380945999175310e-004 + + -2.8349643945693970e-001 6.4983856678009033e-001 + <_> + + 0 -1 143 6.1231426661834121e-004 + + -1.8502233922481537e-001 6.5052211284637451e-001 + <_> + + 0 -1 49 1.7017847858369350e-003 + + 2.2008989751338959e-001 -7.2277534008026123e-001 + <_> + + 0 -1 133 2.6139442343264818e-003 + + 1.8238025903701782e-001 -7.6262325048446655e-001 + <_> + + 0 -1 43 -2.0020073279738426e-003 + + 5.6799399852752686e-001 -2.8219676017761230e-001 + <_> + + 0 -1 119 1.9273828947916627e-003 + + -2.0913636684417725e-001 7.9203850030899048e-001 + <_> + + 0 -1 134 -9.4476283993571997e-004 + + -8.2361942529678345e-001 2.4256958067417145e-001 + + <_> + 10 + -1.4518526792526245e+000 + + <_> + + 0 -1 162 1.6756314784288406e-002 + + -6.9359332323074341e-001 5.1373954862356186e-002 + <_> + + 0 -1 16 2.4082964286208153e-002 + + -3.3989402651786804e-001 4.5332714915275574e-001 + <_> + + 0 -1 186 1.2284796684980392e-003 + + -2.2297365963459015e-001 6.1439812183380127e-001 + <_> + + 0 -1 59 -1.4379122294485569e-003 + + -6.9444245100021362e-001 2.0446482300758362e-001 + <_> + + 0 -1 185 -1.8713285680860281e-003 + + 6.7942184209823608e-001 -2.7580419182777405e-001 + <_> + + 0 -1 190 -4.7389674000442028e-003 + + -7.0437240600585938e-001 2.6915156841278076e-001 + <_> + + 0 -1 156 7.4071279959753156e-004 + + -2.9220902919769287e-001 5.3538239002227783e-001 + <_> + + 0 -1 11 -2.2739455103874207e-001 + + 6.6916191577911377e-001 -2.1987228095531464e-001 + <_> + + 0 -1 155 -1.0255509987473488e-003 + + 6.3346290588378906e-001 -2.2717863321304321e-001 + <_> + + 0 -1 167 2.4775355122983456e-003 + + -5.4297816753387451e-001 3.1877547502517700e-001 + + <_> + 11 + -1.3153649568557739e+000 + + <_> + + 0 -1 6 1.9131936132907867e-002 + + -6.0168600082397461e-001 1.9141913950443268e-001 + <_> + + 0 -1 42 -4.5855185016989708e-003 + + 2.1901632845401764e-001 -5.7136750221252441e-001 + <_> + + 0 -1 53 -1.9026801455765963e-003 + + -8.0075079202651978e-001 1.6502076387405396e-001 + <_> + + 0 -1 19 -3.2767035067081451e-002 + + 5.1496404409408569e-001 -2.5474679470062256e-001 + <_> + + 0 -1 129 6.3941581174731255e-004 + + -1.9851709902286530e-001 6.7218667268753052e-001 + <_> + + 0 -1 201 1.5573646873235703e-002 + + -1.7564551532268524e-001 7.0536541938781738e-001 + <_> + + 0 -1 200 9.5508026424795389e-004 + + -1.9691802561283112e-001 6.1125624179840088e-001 + <_> + + 0 -1 67 9.0427603572607040e-003 + + 1.6518253087997437e-001 -8.7012130022048950e-001 + <_> + + 0 -1 77 8.1576988101005554e-002 + + 1.4075902104377747e-001 -8.4871828556060791e-001 + <_> + + 0 -1 166 -5.1994959358125925e-004 + + 2.1803210675716400e-001 -5.4628211259841919e-001 + <_> + + 0 -1 70 -2.3009868338704109e-002 + + -7.9586231708526611e-001 1.5989699959754944e-001 + + <_> + 13 + -1.4625015258789063e+000 + + <_> + + 0 -1 1 2.6759501546621323e-002 + + -6.0482984781265259e-001 1.4906832575798035e-001 + <_> + + 0 -1 165 3.0343931168317795e-002 + + -4.7357541322708130e-001 2.6279065012931824e-001 + <_> + + 0 -1 161 1.2678599450737238e-003 + + -1.9493983685970306e-001 6.9734728336334229e-001 + <_> + + 0 -1 30 1.8607920501381159e-003 + + 1.5611934661865234e-001 -9.0542370080947876e-001 + <_> + + 0 -1 157 -1.3872641138732433e-003 + + 5.3263407945632935e-001 -3.0192303657531738e-001 + <_> + + 0 -1 180 -6.9969398900866508e-003 + + -9.4549953937530518e-001 1.5575224161148071e-001 + <_> + + 0 -1 158 1.1245720088481903e-003 + + -2.6688691973686218e-001 5.5608308315277100e-001 + <_> + + 0 -1 160 -2.8279949910938740e-003 + + -9.1861122846603394e-001 1.3309663534164429e-001 + <_> + + 0 -1 58 7.1019242750480771e-004 + + -3.0977895855903625e-001 4.3846300244331360e-001 + <_> + + 0 -1 8 -4.1933014988899231e-002 + + -8.9102542400360107e-001 1.5866196155548096e-001 + <_> + + 0 -1 87 1.6568358987569809e-002 + + 1.2731756269931793e-001 -8.5553413629531860e-001 + <_> + + 0 -1 64 2.0309074316173792e-003 + + -2.3260365426540375e-001 6.7330485582351685e-001 + <_> + + 0 -1 159 -1.7069760942831635e-003 + + -7.1925789117813110e-001 1.9108834862709045e-001 + + <_> + 14 + -1.4959813356399536e+000 + + <_> + + 0 -1 4 1.4695923775434494e-002 + + -6.2167906761169434e-001 2.1172638237476349e-001 + <_> + + 0 -1 50 -1.6501215286552906e-003 + + 1.9353884458541870e-001 -5.7780367136001587e-001 + <_> + + 0 -1 123 7.0121872704476118e-004 + + -2.2979106009006500e-001 5.3033334016799927e-001 + <_> + + 0 -1 52 9.4158272258937359e-004 + + 1.6849038004875183e-001 -7.4897718429565430e-001 + <_> + + 0 -1 124 -2.0684124901890755e-003 + + 6.7936712503433228e-001 -1.9317412376403809e-001 + <_> + + 0 -1 23 -1.8305826233699918e-004 + + -7.0275229215621948e-001 1.7971208691596985e-001 + <_> + + 0 -1 198 5.5587477982044220e-004 + + -2.4448128044605255e-001 5.0703984498977661e-001 + <_> + + 0 -1 152 4.3448276119306684e-004 + + 1.3497908413410187e-001 -8.5621362924575806e-001 + <_> + + 0 -1 197 -1.2359691318124533e-003 + + 6.1710417270660400e-001 -2.2301279008388519e-001 + <_> + + 0 -1 153 -6.9627340417355299e-004 + + -6.4706987142562866e-001 2.3951497673988342e-001 + <_> + + 0 -1 175 1.0683680884540081e-003 + + -2.8343605995178223e-001 4.9318629503250122e-001 + <_> + + 0 -1 168 1.7104238213505596e-004 + + -2.7171039581298828e-001 4.2520308494567871e-001 + <_> + + 0 -1 144 8.2368971779942513e-003 + + 1.6359315812587738e-001 -7.3864609003067017e-001 + <_> + + 0 -1 131 -5.9884190559387207e-003 + + 3.8030940294265747e-001 -3.0763563513755798e-001 + + <_> + 9 + -1.1183819770812988e+000 + + <_> + + 0 -1 187 -1.4863962307572365e-002 + + 1.1989101022481918e-001 -6.6138857603073120e-001 + <_> + + 0 -1 117 2.4736612103879452e-003 + + -5.2778661251068115e-001 2.3012125492095947e-001 + <_> + + 0 -1 71 -4.8899287357926369e-003 + + 6.0186779499053955e-001 -2.0681641995906830e-001 + <_> + + 0 -1 174 1.5796069055795670e-002 + + 1.4610521495342255e-001 -8.2099527120590210e-001 + <_> + + 0 -1 104 5.9720675926655531e-004 + + -2.3587301373481750e-001 4.8323699831962585e-001 + <_> + + 0 -1 103 -1.9448818638920784e-003 + + 6.4417767524719238e-001 -2.0953170955181122e-001 + <_> + + 0 -1 154 1.9433414854574949e-004 + + 2.0600238442420959e-001 -7.2418999671936035e-001 + <_> + + 0 -1 163 -1.5097535215318203e-002 + + -8.7151485681533813e-001 1.2594890594482422e-001 + <_> + + 0 -1 82 -3.9843879640102386e-003 + + 4.3801131844520569e-001 -2.9676589369773865e-001 + + <_> + 12 + -1.5434337854385376e+000 + + <_> + + 0 -1 105 1.1273270938545465e-003 + + -4.7976878285408020e-001 3.6627906560897827e-001 + <_> + + 0 -1 95 9.7806821577250957e-004 + + -2.7689707279205322e-001 5.1295894384384155e-001 + <_> + + 0 -1 15 1.6528377309441566e-002 + + -4.5259797573089600e-001 2.4290211498737335e-001 + <_> + + 0 -1 137 1.1040373938158154e-003 + + -3.2714816927909851e-001 3.4566244482994080e-001 + <_> + + 0 -1 109 -1.7780361231416464e-003 + + -6.9511681795120239e-001 1.8829824030399323e-001 + <_> + + 0 -1 92 4.6280334936454892e-004 + + -2.3864887654781342e-001 5.3136289119720459e-001 + <_> + + 0 -1 100 -1.4975425438024104e-004 + + -6.6509884595870972e-001 2.1483559906482697e-001 + <_> + + 0 -1 83 -1.4625370968133211e-003 + + 2.6556470990180969e-001 -4.9002227187156677e-001 + <_> + + 0 -1 14 -2.6019819779321551e-004 + + -7.0160359144210815e-001 1.6359129548072815e-001 + <_> + + 0 -1 14 2.2371641534846276e-004 + + 1.2919521331787109e-001 -6.9767206907272339e-001 + <_> + + 0 -1 194 -1.0447315871715546e-002 + + 2.1837629377841949e-001 -4.6482038497924805e-001 + <_> + + 0 -1 20 -9.2897024005651474e-003 + + 6.4918082952499390e-001 -2.0495061576366425e-001 + + <_> + 12 + -1.4440233707427979e+000 + + <_> + + 0 -1 9 8.5356216877698898e-003 + + -5.3151458501815796e-001 2.2357723116874695e-001 + <_> + + 0 -1 182 1.5294685726985335e-003 + + -6.0895460844039917e-001 1.7429886758327484e-001 + <_> + + 0 -1 40 1.8610086990520358e-003 + + -2.5480428338050842e-001 4.2150071263313293e-001 + <_> + + 0 -1 176 1.5735558699816465e-003 + + -1.6832062602043152e-001 4.8567819595336914e-001 + <_> + + 0 -1 179 -6.7992787808179855e-004 + + 3.9894598722457886e-001 -3.0744269490242004e-001 + <_> + + 0 -1 151 4.9857296049594879e-002 + + -1.5370152890682220e-001 6.7523348331451416e-001 + <_> + + 0 -1 139 -2.8339058160781860e-002 + + 5.0540882349014282e-001 -2.9473617672920227e-001 + <_> + + 0 -1 72 -7.7956825494766235e-002 + + 4.0387043356895447e-001 -3.0287107825279236e-001 + <_> + + 0 -1 89 -3.6115488037467003e-003 + + 6.3856112957000732e-001 -1.6917882859706879e-001 + <_> + + 0 -1 207 3.3940275898203254e-004 + + 1.3713537156581879e-001 -7.8120291233062744e-001 + <_> + + 0 -1 39 4.0043061599135399e-003 + + 1.5233094990253448e-001 -6.3939732313156128e-001 + <_> + + 0 -1 65 -4.4601649278774858e-004 + + 2.1333815157413483e-001 -4.7728902101516724e-001 + + <_> + 13 + -1.2532578706741333e+000 + + <_> + + 0 -1 204 -2.0341124385595322e-002 + + 2.4170616269111633e-001 -4.9161517620086670e-001 + <_> + + 0 -1 169 8.9040049351751804e-004 + + -2.8570893406867981e-001 4.2666998505592346e-001 + <_> + + 0 -1 60 -3.3259526826441288e-003 + + 4.2626520991325378e-001 -2.3811897635459900e-001 + <_> + + 0 -1 38 -3.1714607030153275e-002 + + -8.5494768619537354e-001 1.1712870001792908e-001 + <_> + + 0 -1 31 -1.1553820222616196e-002 + + 2.2675493359565735e-001 -4.9640509486198425e-001 + <_> + + 0 -1 80 -6.7727260291576385e-002 + + -8.6705064773559570e-001 9.8765812814235687e-002 + <_> + + 0 -1 63 -3.1611192971467972e-003 + + 3.9449846744537354e-001 -2.8210711479187012e-001 + <_> + + 0 -1 149 4.3221906526014209e-004 + + 1.1805476248264313e-001 -9.0178310871124268e-001 + <_> + + 0 -1 188 -2.2296360111795366e-004 + + 1.7324598133563995e-001 -5.2877873182296753e-001 + <_> + + 0 -1 120 -2.1440195851027966e-003 + + 5.5513423681259155e-001 -1.9791823625564575e-001 + <_> + + 0 -1 113 -4.5122690498828888e-003 + + 5.5083745718002319e-001 -1.8810540437698364e-001 + <_> + + 0 -1 130 -3.5149464383721352e-003 + + 5.5467557907104492e-001 -2.2856147587299347e-001 + <_> + + 0 -1 121 -4.4786706566810608e-003 + + -7.9106998443603516e-001 1.7836479842662811e-001 + + <_> + 15 + -1.1898330450057983e+000 + + <_> + + 0 -1 0 1.5206767246127129e-002 + + -4.9173194169998169e-001 2.7093595266342163e-001 + <_> + + 0 -1 125 6.9564773002639413e-004 + + -2.3066598176956177e-001 5.4028344154357910e-001 + <_> + + 0 -1 125 -8.3668017759919167e-004 + + 4.4658055901527405e-001 -2.7778497338294983e-001 + <_> + + 0 -1 91 -3.8321319967508316e-002 + + -7.9069298505783081e-001 1.8700349330902100e-001 + <_> + + 0 -1 207 -2.1063965687062591e-004 + + -6.3163763284683228e-001 1.8656146526336670e-001 + <_> + + 0 -1 61 3.6907330155372620e-002 + + 9.9319733679294586e-002 -7.6762360334396362e-001 + <_> + + 0 -1 85 8.1071127206087112e-003 + + -2.8561261296272278e-001 3.4748569130897522e-001 + <_> + + 0 -1 189 6.2815943965688348e-004 + + 1.6656193137168884e-001 -5.4635977745056152e-001 + <_> + + 0 -1 86 2.8582263621501625e-004 + + -2.4100163578987122e-001 4.5410770177841187e-001 + <_> + + 0 -1 173 -1.9862279295921326e-002 + + -9.4317340850830078e-001 1.2513674795627594e-001 + <_> + + 0 -1 96 1.1506280861794949e-003 + + -2.4514634907245636e-001 4.6452957391738892e-001 + <_> + + 0 -1 29 2.3451185552403331e-004 + + 1.2489952147006989e-001 -8.0278074741363525e-001 + <_> + + 0 -1 101 6.7837134702131152e-004 + + -2.5017899274826050e-001 4.3841627240180969e-001 + <_> + + 0 -1 17 3.1583159579895437e-004 + + 1.5951988101005554e-001 -7.4524724483489990e-001 + <_> + + 0 -1 110 7.2623658925294876e-003 + + 1.2511830031871796e-001 -6.5659755468368530e-001 + + <_> + 15 + -1.2416906356811523e+000 + + <_> + + 0 -1 2 7.5144092552363873e-003 + + -5.9518074989318848e-001 5.3793102502822876e-002 + <_> + + 0 -1 98 -6.4494344405829906e-004 + + 2.0429474115371704e-001 -4.3661779165267944e-001 + <_> + + 0 -1 196 3.3831471228040755e-004 + + -2.1566553413867950e-001 4.7118204832077026e-001 + <_> + + 0 -1 73 2.8320802375674248e-003 + + 1.3322307169437408e-001 -8.3729231357574463e-001 + <_> + + 0 -1 199 1.6218879027292132e-003 + + -2.0889574289321899e-001 4.7114694118499756e-001 + <_> + + 0 -1 10 2.7122153551317751e-004 + + 1.1475630849599838e-001 -7.8029519319534302e-001 + <_> + + 0 -1 170 8.8358242064714432e-003 + + 1.2460929155349731e-001 -7.6791721582412720e-001 + <_> + + 0 -1 106 9.7634072881191969e-004 + + -2.0806105434894562e-001 5.1318311691284180e-001 + <_> + + 0 -1 107 -2.1239042282104492e-002 + + -8.7171542644500732e-001 1.2721680104732513e-001 + <_> + + 0 -1 97 7.1797124110162258e-004 + + -3.0763280391693115e-001 3.7504923343658447e-001 + <_> + + 0 -1 32 2.7504155412316322e-002 + + 1.5651945769786835e-001 -7.9516488313674927e-001 + <_> + + 0 -1 178 1.0624636197462678e-003 + + 1.3473348319530487e-001 -6.9174814224243164e-001 + <_> + + 0 -1 33 -8.1248432397842407e-002 + + -8.5117286443710327e-001 1.0601779073476791e-001 + <_> + + 0 -1 140 -2.2936165332794189e-002 + + 3.9202499389648438e-001 -2.9867398738861084e-001 + <_> + + 0 -1 146 -1.3326616026461124e-003 + + 4.7240665555000305e-001 -2.6287403702735901e-001 + + <_> + 13 + -1.3383979797363281e+000 + + <_> + + 0 -1 3 3.2254494726657867e-002 + + -6.5151512622833252e-001 7.9947575926780701e-002 + <_> + + 0 -1 172 -1.1810796568170190e-003 + + 2.5173431634902954e-001 -4.5536977052688599e-001 + <_> + + 0 -1 88 8.0361258005723357e-004 + + -2.1178695559501648e-001 4.9318632483482361e-001 + <_> + + 0 -1 93 6.6201295703649521e-004 + + -1.9441033899784088e-001 4.6225026249885559e-001 + <_> + + 0 -1 84 3.4565184614621103e-004 + + -2.1175089478492737e-001 4.6985754370689392e-001 + <_> + + 0 -1 132 -5.6433549616485834e-004 + + -7.9713624715805054e-001 1.8714086711406708e-001 + <_> + + 0 -1 56 5.8492692187428474e-004 + + -3.9330720901489258e-001 2.4242231249809265e-001 + <_> + + 0 -1 13 2.5043603032827377e-002 + + 1.3490234315395355e-001 -7.5923883914947510e-001 + <_> + + 0 -1 37 -1.8510785885155201e-003 + + 4.1279399394989014e-001 -2.7271771430969238e-001 + <_> + + 0 -1 68 -2.5741360150277615e-004 + + -6.3662034273147583e-001 1.8135882914066315e-001 + <_> + + 0 -1 184 -1.5121832489967346e-002 + + 2.5249326229095459e-001 -3.8438034057617188e-001 + <_> + + 0 -1 203 -1.5006031841039658e-002 + + -8.4878319501876831e-001 1.1718367785215378e-001 + <_> + + 0 -1 74 4.9880752339959145e-004 + + -2.6755046844482422e-001 4.5769825577735901e-001 + + <_> + 12 + -1.2097512483596802e+000 + + <_> + + 0 -1 195 -1.1614991351962090e-002 + + 1.4465409517288208e-001 -5.9521216154098511e-001 + <_> + + 0 -1 75 3.9767110138200223e-004 + + -4.2697989940643311e-001 2.4382311105728149e-001 + <_> + + 0 -1 47 -4.6969857066869736e-002 + + -9.3969690799713135e-001 1.2196484953165054e-001 + <_> + + 0 -1 136 5.5550434626638889e-004 + + -1.8246935307979584e-001 6.5156191587448120e-001 + <_> + + 0 -1 99 2.9468833236023784e-004 + + 1.5099152922630310e-001 -7.8840750455856323e-001 + <_> + + 0 -1 44 1.2439775280654430e-002 + + 1.4981375634670258e-001 -7.5917595624923706e-001 + <_> + + 0 -1 147 6.6337559837847948e-004 + + -2.5185841321945190e-001 5.9387433528900146e-001 + <_> + + 0 -1 148 -6.8454549182206392e-004 + + 5.1199448108673096e-001 -2.5247576832771301e-001 + <_> + + 0 -1 141 1.4808592386543751e-003 + + 2.2439701855182648e-001 -5.8184891939163208e-001 + <_> + + 0 -1 12 6.0307271778583527e-003 + + -4.3553912639617920e-001 2.8183382749557495e-001 + <_> + + 0 -1 78 -1.9170897081494331e-002 + + -8.5707378387451172e-001 1.4850790798664093e-001 + <_> + + 0 -1 122 3.0278289341367781e-004 + + -3.1547480821609497e-001 4.1798374056816101e-001 + + <_> + 10 + -1.2253109216690063e+000 + + <_> + + 0 -1 181 4.6847470104694366e-002 + + -4.9239391088485718e-001 5.2287584543228149e-001 + <_> + + 0 -1 118 2.2181579843163490e-003 + + -4.2569425702095032e-001 3.6892616748809814e-001 + <_> + + 0 -1 145 6.1082182219251990e-004 + + 1.7654621601104736e-001 -8.2656937837600708e-001 + <_> + + 0 -1 127 1.7401995137333870e-002 + + 2.7770876884460449e-001 -5.6393522024154663e-001 + <_> + + 0 -1 54 5.2314018830657005e-004 + + -3.6257097125053406e-001 4.6126455068588257e-001 + <_> + + 0 -1 206 2.1581796463578939e-003 + + 1.9110183417797089e-001 -6.8012320995330811e-001 + <_> + + 0 -1 192 -1.3209994649514556e-003 + + 6.7618584632873535e-001 -2.6087108254432678e-001 + <_> + + 0 -1 126 -1.2237254530191422e-002 + + -5.7184767723083496e-001 3.0778104066848755e-001 + <_> + + 0 -1 36 8.7829465046525002e-003 + + 1.6890920698642731e-001 -7.8835797309875488e-001 + <_> + + 0 -1 183 7.5588272884488106e-003 + + 1.5143942832946777e-001 -8.2572847604751587e-001 + + <_> + + <_> + 0 0 10 10 -1. + <_> + 0 0 5 5 2. + <_> + 5 5 5 5 2. + 0 + <_> + + <_> + 0 0 12 16 -1. + <_> + 6 0 6 16 2. + 0 + <_> + + <_> + 0 3 10 6 -1. + <_> + 5 3 5 6 2. + 0 + <_> + + <_> + 0 3 21 16 -1. + <_> + 7 3 7 16 3. + 0 + <_> + + <_> + 0 4 16 9 -1. + <_> + 4 4 8 9 2. + 0 + <_> + + <_> + 0 4 10 12 -1. + <_> + 5 4 5 12 2. + 0 + <_> + + <_> + 0 7 14 7 -1. + <_> + 7 7 7 7 2. + 0 + <_> + + <_> + 0 9 12 7 -1. + <_> + 6 9 6 7 2. + 0 + <_> + + <_> + 0 9 60 3 -1. + <_> + 30 9 30 3 2. + 0 + <_> + + <_> + 0 10 8 3 -1. + <_> + 4 10 4 3 2. + 0 + <_> + + <_> + 0 11 1 2 -1. + <_> + 0 12 1 1 2. + 0 + <_> + + <_> + 1 0 51 12 -1. + <_> + 1 4 51 4 3. + 0 + <_> + + <_> + 1 3 15 7 -1. + <_> + 6 3 5 7 3. + 0 + <_> + + <_> + 1 7 30 6 -1. + <_> + 1 7 15 3 2. + <_> + 16 10 15 3 2. + 0 + <_> + + <_> + 1 12 1 2 -1. + <_> + 1 13 1 1 2. + 0 + <_> + + <_> + 2 2 18 16 -1. + <_> + 2 6 18 8 2. + 0 + <_> + + <_> + 2 3 29 4 -1. + <_> + 2 5 29 2 2. + 0 + <_> + + <_> + 2 9 1 2 -1. + <_> + 2 10 1 1 2. + 0 + <_> + + <_> + 2 14 40 6 -1. + <_> + 2 17 40 3 2. + 0 + <_> + + <_> + 3 0 22 6 -1. + <_> + 3 2 22 2 3. + 0 + <_> + + <_> + 3 2 38 2 -1. + <_> + 3 2 19 1 2. + <_> + 22 3 19 1 2. + 0 + <_> + + <_> + 3 4 51 16 -1. + <_> + 3 8 51 8 2. + 0 + <_> + + <_> + 3 7 3 8 -1. + <_> + 4 7 1 8 3. + 0 + <_> + + <_> + 3 9 1 3 -1. + <_> + 3 10 1 1 3. + 0 + <_> + + <_> + 4 8 3 5 -1. + <_> + 5 8 1 5 3. + 0 + <_> + + <_> + 4 8 4 9 -1. + <_> + 5 8 2 9 2. + 0 + <_> + + <_> + 4 11 36 9 -1. + <_> + 16 11 12 9 3. + 0 + <_> + + <_> + 4 14 49 6 -1. + <_> + 4 17 49 3 2. + 0 + <_> + + <_> + 5 0 17 6 -1. + <_> + 5 2 17 2 3. + 0 + <_> + + <_> + 5 1 3 1 -1. + <_> + 6 1 1 1 3. + 0 + <_> + + <_> + 5 1 8 2 -1. + <_> + 7 1 4 2 2. + 0 + <_> + + <_> + 5 2 36 9 -1. + <_> + 17 2 12 9 3. + 0 + <_> + + <_> + 5 3 33 17 -1. + <_> + 16 3 11 17 3. + 0 + <_> + + <_> + 6 0 30 19 -1. + <_> + 16 0 10 19 3. + 0 + <_> + + <_> + 6 3 29 4 -1. + <_> + 6 5 29 2 2. + 0 + <_> + + <_> + 6 4 16 16 -1. + <_> + 14 4 8 16 2. + 0 + <_> + + <_> + 6 9 54 1 -1. + <_> + 33 9 27 1 2. + 0 + <_> + + <_> + 7 0 4 18 -1. + <_> + 8 0 2 18 2. + 0 + <_> + + <_> + 7 3 12 15 -1. + <_> + 13 3 6 15 2. + 0 + <_> + + <_> + 7 4 20 5 -1. + <_> + 12 4 10 5 2. + 0 + <_> + + <_> + 7 4 6 3 -1. + <_> + 7 5 6 1 3. + 0 + <_> + + <_> + 7 4 36 6 -1. + <_> + 19 4 12 6 3. + 0 + <_> + + <_> + 7 5 28 4 -1. + <_> + 14 5 14 4 2. + 0 + <_> + + <_> + 7 7 4 11 -1. + <_> + 8 7 2 11 2. + 0 + <_> + + <_> + 7 9 12 7 -1. + <_> + 13 9 6 7 2. + 0 + <_> + + <_> + 8 1 21 4 -1. + <_> + 8 3 21 2 2. + 0 + <_> + + <_> + 8 4 28 6 -1. + <_> + 15 4 14 6 2. + 0 + <_> + + <_> + 8 8 38 6 -1. + <_> + 8 10 38 2 3. + 0 + <_> + + <_> + 8 14 25 4 -1. + <_> + 8 15 25 2 2. + 0 + <_> + + <_> + 9 2 12 4 -1. + <_> + 12 2 6 4 2. + 0 + <_> + + <_> + 9 5 24 3 -1. + <_> + 15 5 12 3 2. + 0 + <_> + + <_> + 9 8 40 12 -1. + <_> + 9 12 40 4 3. + 0 + <_> + + <_> + 10 2 8 2 -1. + <_> + 12 2 4 2 2. + 0 + <_> + + <_> + 10 2 9 2 -1. + <_> + 13 2 3 2 3. + 0 + <_> + + <_> + 10 5 3 3 -1. + <_> + 11 6 1 1 9. + 0 + <_> + + <_> + 11 0 32 20 -1. + <_> + 19 0 16 20 2. + 0 + <_> + + <_> + 11 3 1 4 -1. + <_> + 11 5 1 2 2. + 0 + <_> + + <_> + 11 9 4 3 -1. + <_> + 12 9 2 3 2. + 0 + <_> + + <_> + 11 9 3 7 -1. + <_> + 12 9 1 7 3. + 0 + <_> + + <_> + 12 3 9 2 -1. + <_> + 15 3 3 2 3. + 0 + <_> + + <_> + 12 6 6 6 -1. + <_> + 14 6 2 6 3. + 0 + <_> + + <_> + 12 10 42 10 -1. + <_> + 26 10 14 10 3. + 0 + <_> + + <_> + 12 14 11 3 -1. + <_> + 12 15 11 1 3. + 0 + <_> + + <_> + 13 4 6 14 -1. + <_> + 15 4 2 14 3. + 0 + <_> + + <_> + 13 8 3 6 -1. + <_> + 14 8 1 6 3. + 0 + <_> + + <_> + 13 11 32 2 -1. + <_> + 21 11 16 2 2. + 0 + <_> + + <_> + 13 13 25 6 -1. + <_> + 13 16 25 3 2. + 0 + <_> + + <_> + 13 16 21 3 -1. + <_> + 20 16 7 3 3. + 0 + <_> + + <_> + 14 2 3 2 -1. + <_> + 15 2 1 2 3. + 0 + <_> + + <_> + 14 2 24 8 -1. + <_> + 20 2 12 8 2. + 0 + <_> + + <_> + 14 13 36 6 -1. + <_> + 23 13 18 6 2. + 0 + <_> + + <_> + 14 14 8 3 -1. + <_> + 14 15 8 1 3. + 0 + <_> + + <_> + 14 14 45 6 -1. + <_> + 14 17 45 3 2. + 0 + <_> + + <_> + 14 18 9 2 -1. + <_> + 17 18 3 2 3. + 0 + <_> + + <_> + 15 9 4 1 -1. + <_> + 16 9 2 1 2. + 0 + <_> + + <_> + 15 10 19 4 -1. + <_> + 15 12 19 2 2. + 0 + <_> + + <_> + 16 0 28 8 -1. + <_> + 16 2 28 4 2. + 0 + <_> + + <_> + 16 2 36 18 -1. + <_> + 28 2 12 18 3. + 0 + <_> + + <_> + 16 6 24 6 -1. + <_> + 22 6 12 6 2. + 0 + <_> + + <_> + 17 1 24 6 -1. + <_> + 17 3 24 2 3. + 0 + <_> + + <_> + 17 3 15 12 -1. + <_> + 22 7 5 4 9. + 0 + <_> + + <_> + 17 15 11 3 -1. + <_> + 17 16 11 1 3. + 0 + <_> + + <_> + 18 5 6 10 -1. + <_> + 20 5 2 10 3. + 0 + <_> + + <_> + 18 6 18 3 -1. + <_> + 24 6 6 3 3. + 0 + <_> + + <_> + 18 11 3 1 -1. + <_> + 19 11 1 1 3. + 0 + <_> + + <_> + 19 6 32 2 -1. + <_> + 27 6 16 2 2. + 0 + <_> + + <_> + 19 8 3 1 -1. + <_> + 20 8 1 1 3. + 0 + <_> + + <_> + 19 9 14 11 -1. + <_> + 26 9 7 11 2. + 0 + <_> + + <_> + 19 10 3 3 -1. + <_> + 20 10 1 3 3. + 0 + <_> + + <_> + 19 13 7 3 -1. + <_> + 19 14 7 1 3. + 0 + <_> + + <_> + 19 14 13 3 -1. + <_> + 19 15 13 1 3. + 0 + <_> + + <_> + 20 0 15 20 -1. + <_> + 25 0 5 20 3. + 0 + <_> + + <_> + 20 9 3 1 -1. + <_> + 21 9 1 1 3. + 0 + <_> + + <_> + 20 10 3 2 -1. + <_> + 21 10 1 2 3. + 0 + <_> + + <_> + 21 1 21 6 -1. + <_> + 21 3 21 2 3. + 0 + <_> + + <_> + 21 8 4 3 -1. + <_> + 22 8 2 3 2. + 0 + <_> + + <_> + 21 9 3 4 -1. + <_> + 22 9 1 4 3. + 0 + <_> + + <_> + 21 10 4 2 -1. + <_> + 22 10 2 2 2. + 0 + <_> + + <_> + 21 11 24 2 -1. + <_> + 27 11 12 2 2. + 0 + <_> + + <_> + 21 18 4 1 -1. + <_> + 22 18 2 1 2. + 0 + <_> + + <_> + 22 3 4 1 -1. + <_> + 23 3 2 1 2. + 0 + <_> + + <_> + 22 6 2 6 -1. + <_> + 22 6 1 3 2. + <_> + 23 9 1 3 2. + 0 + <_> + + <_> + 22 7 3 3 -1. + <_> + 23 8 1 1 9. + 0 + <_> + + <_> + 22 8 3 5 -1. + <_> + 23 8 1 5 3. + 0 + <_> + + <_> + 22 9 3 2 -1. + <_> + 23 9 1 2 3. + 0 + <_> + + <_> + 23 8 3 3 -1. + <_> + 24 8 1 3 3. + 0 + <_> + + <_> + 23 10 3 2 -1. + <_> + 24 10 1 2 3. + 0 + <_> + + <_> + 24 3 20 17 -1. + <_> + 29 3 10 17 2. + 0 + <_> + + <_> + 24 4 14 6 -1. + <_> + 31 4 7 6 2. + 0 + <_> + + <_> + 24 18 9 2 -1. + <_> + 27 18 3 2 3. + 0 + <_> + + <_> + 25 5 8 4 -1. + <_> + 25 5 4 4 2. + 1 + <_> + + <_> + 25 6 22 14 -1. + <_> + 36 6 11 14 2. + 0 + <_> + + <_> + 25 12 28 8 -1. + <_> + 25 14 28 4 2. + 0 + <_> + + <_> + 25 14 9 3 -1. + <_> + 25 15 9 1 3. + 0 + <_> + + <_> + 26 2 27 18 -1. + <_> + 35 2 9 18 3. + 0 + <_> + + <_> + 26 3 22 3 -1. + <_> + 26 4 22 1 3. + 0 + <_> + + <_> + 26 4 8 4 -1. + <_> + 30 4 4 4 2. + 0 + <_> + + <_> + 26 4 20 6 -1. + <_> + 31 4 10 6 2. + 0 + <_> + + <_> + 26 7 1 12 -1. + <_> + 22 11 1 4 3. + 1 + <_> + + <_> + 26 9 3 3 -1. + <_> + 27 9 1 3 3. + 0 + <_> + + <_> + 26 13 9 3 -1. + <_> + 26 14 9 1 3. + 0 + <_> + + <_> + 27 3 15 6 -1. + <_> + 32 3 5 6 3. + 0 + <_> + + <_> + 27 9 3 1 -1. + <_> + 28 9 1 1 3. + 0 + <_> + + <_> + 27 9 3 2 -1. + <_> + 28 9 1 2 3. + 0 + <_> + + <_> + 27 10 3 3 -1. + <_> + 28 10 1 3 3. + 0 + <_> + + <_> + 27 11 3 2 -1. + <_> + 28 11 1 2 3. + 0 + <_> + + <_> + 28 2 10 4 -1. + <_> + 28 2 10 2 2. + 1 + <_> + + <_> + 28 8 32 6 -1. + <_> + 28 10 32 2 3. + 0 + <_> + + <_> + 28 10 3 1 -1. + <_> + 29 10 1 1 3. + 0 + <_> + + <_> + 28 11 3 1 -1. + <_> + 29 11 1 1 3. + 0 + <_> + + <_> + 28 15 5 4 -1. + <_> + 28 16 5 2 2. + 0 + <_> + + <_> + 28 16 23 4 -1. + <_> + 28 17 23 2 2. + 0 + <_> + + <_> + 28 19 6 1 -1. + <_> + 30 19 2 1 3. + 0 + <_> + + <_> + 29 3 9 4 -1. + <_> + 32 3 3 4 3. + 0 + <_> + + <_> + 29 5 9 1 -1. + <_> + 32 5 3 1 3. + 0 + <_> + + <_> + 29 8 3 6 -1. + <_> + 30 8 1 6 3. + 0 + <_> + + <_> + 29 9 3 1 -1. + <_> + 30 9 1 1 3. + 0 + <_> + + <_> + 29 11 10 4 -1. + <_> + 29 13 10 2 2. + 0 + <_> + + <_> + 29 11 26 8 -1. + <_> + 29 13 26 4 2. + 0 + <_> + + <_> + 30 0 16 6 -1. + <_> + 30 3 16 3 2. + 0 + <_> + + <_> + 30 2 30 6 -1. + <_> + 30 2 15 3 2. + <_> + 45 5 15 3 2. + 0 + <_> + + <_> + 30 3 9 4 -1. + <_> + 33 3 3 4 3. + 0 + <_> + + <_> + 30 5 9 4 -1. + <_> + 30 6 9 2 2. + 0 + <_> + + <_> + 30 10 3 2 -1. + <_> + 31 10 1 2 3. + 0 + <_> + + <_> + 30 14 18 6 -1. + <_> + 36 14 6 6 3. + 0 + <_> + + <_> + 31 3 4 3 -1. + <_> + 32 3 2 3 2. + 0 + <_> + + <_> + 31 7 4 9 -1. + <_> + 32 7 2 9 2. + 0 + <_> + + <_> + 31 11 3 2 -1. + <_> + 32 11 1 2 3. + 0 + <_> + + <_> + 31 11 3 3 -1. + <_> + 32 11 1 3 3. + 0 + <_> + + <_> + 32 4 3 2 -1. + <_> + 33 4 1 2 3. + 0 + <_> + + <_> + 32 6 18 6 -1. + <_> + 32 6 9 3 2. + <_> + 41 9 9 3 2. + 0 + <_> + + <_> + 33 1 22 6 -1. + <_> + 33 4 22 3 2. + 0 + <_> + + <_> + 33 3 4 2 -1. + <_> + 34 3 2 2 2. + 0 + <_> + + <_> + 33 3 4 4 -1. + <_> + 34 3 2 4 2. + 0 + <_> + + <_> + 33 5 4 1 -1. + <_> + 34 5 2 1 2. + 0 + <_> + + <_> + 33 9 3 6 -1. + <_> + 34 9 1 6 3. + 0 + <_> + + <_> + 33 10 3 3 -1. + <_> + 34 10 1 3 3. + 0 + <_> + + <_> + 34 8 4 7 -1. + <_> + 35 8 2 7 2. + 0 + <_> + + <_> + 34 9 3 5 -1. + <_> + 35 9 1 5 3. + 0 + <_> + + <_> + 34 18 9 2 -1. + <_> + 37 18 3 2 3. + 0 + <_> + + <_> + 35 0 8 6 -1. + <_> + 37 0 4 6 2. + 0 + <_> + + <_> + 35 9 3 2 -1. + <_> + 36 9 1 2 3. + 0 + <_> + + <_> + 36 9 24 9 -1. + <_> + 42 9 12 9 2. + 0 + <_> + + <_> + 37 1 16 18 -1. + <_> + 41 1 8 18 2. + 0 + <_> + + <_> + 37 11 20 8 -1. + <_> + 42 11 10 8 2. + 0 + <_> + + <_> + 38 8 15 12 -1. + <_> + 38 12 15 4 3. + 0 + <_> + + <_> + 39 6 12 8 -1. + <_> + 45 6 6 8 2. + 0 + <_> + + <_> + 40 8 8 4 -1. + <_> + 40 8 8 2 2. + 1 + <_> + + <_> + 40 10 3 1 -1. + <_> + 41 10 1 1 3. + 0 + <_> + + <_> + 40 10 3 5 -1. + <_> + 41 10 1 5 3. + 0 + <_> + + <_> + 40 13 12 6 -1. + <_> + 43 13 6 6 2. + 0 + <_> + + <_> + 41 5 7 15 -1. + <_> + 41 10 7 5 3. + 0 + <_> + + <_> + 41 6 12 6 -1. + <_> + 45 6 4 6 3. + 0 + <_> + + <_> + 41 7 12 7 -1. + <_> + 45 7 4 7 3. + 0 + <_> + + <_> + 41 8 12 12 -1. + <_> + 45 8 4 12 3. + 0 + <_> + + <_> + 41 9 3 6 -1. + <_> + 42 9 1 6 3. + 0 + <_> + + <_> + 42 2 3 13 -1. + <_> + 43 2 1 13 3. + 0 + <_> + + <_> + 42 4 18 10 -1. + <_> + 42 4 9 5 2. + <_> + 51 9 9 5 2. + 0 + <_> + + <_> + 42 5 18 8 -1. + <_> + 42 5 9 4 2. + <_> + 51 9 9 4 2. + 0 + <_> + + <_> + 42 7 2 7 -1. + <_> + 43 7 1 7 2. + 0 + <_> + + <_> + 42 14 12 5 -1. + <_> + 46 14 4 5 3. + 0 + <_> + + <_> + 43 1 10 9 -1. + <_> + 40 4 10 3 3. + 1 + <_> + + <_> + 43 6 6 6 -1. + <_> + 43 9 6 3 2. + 0 + <_> + + <_> + 44 0 8 20 -1. + <_> + 46 0 4 20 2. + 0 + <_> + + <_> + 44 2 16 12 -1. + <_> + 44 2 8 6 2. + <_> + 52 8 8 6 2. + 0 + <_> + + <_> + 44 5 3 8 -1. + <_> + 45 5 1 8 3. + 0 + <_> + + <_> + 44 8 3 4 -1. + <_> + 45 8 1 4 3. + 0 + <_> + + <_> + 44 12 16 4 -1. + <_> + 52 12 8 4 2. + 0 + <_> + + <_> + 44 13 10 3 -1. + <_> + 49 13 5 3 2. + 0 + <_> + + <_> + 45 19 9 1 -1. + <_> + 48 19 3 1 3. + 0 + <_> + + <_> + 46 3 8 8 -1. + <_> + 50 3 4 8 2. + 0 + <_> + + <_> + 47 12 10 6 -1. + <_> + 52 12 5 6 2. + 0 + <_> + + <_> + 48 0 4 13 -1. + <_> + 49 0 2 13 2. + 0 + <_> + + <_> + 48 5 3 12 -1. + <_> + 45 8 3 6 2. + 1 + <_> + + <_> + 48 9 12 8 -1. + <_> + 54 9 6 8 2. + 0 + <_> + + <_> + 48 13 12 4 -1. + <_> + 54 13 6 4 2. + 0 + <_> + + <_> + 49 8 3 1 -1. + <_> + 50 8 1 1 3. + 0 + <_> + + <_> + 49 8 3 2 -1. + <_> + 50 8 1 2 3. + 0 + <_> + + <_> + 49 8 3 3 -1. + <_> + 50 8 1 3 3. + 0 + <_> + + <_> + 50 9 3 3 -1. + <_> + 51 10 1 1 9. + 0 + <_> + + <_> + 51 8 3 3 -1. + <_> + 52 8 1 3 3. + 0 + <_> + + <_> + 52 6 6 10 -1. + <_> + 54 6 2 10 3. + 0 + <_> + + <_> + 52 7 8 7 -1. + <_> + 56 7 4 7 2. + 0 + <_> + + <_> + 52 8 8 4 -1. + <_> + 52 8 8 2 2. + 1 + <_> + + <_> + 54 3 6 15 -1. + <_> + 57 3 3 15 2. + 0 + <_> + + <_> + 54 8 6 7 -1. + <_> + 57 8 3 7 2. + 0 + <_> + + <_> + 57 11 3 6 -1. + <_> + 57 13 3 2 3. + 0 + <_> + + <_> + 59 8 1 3 -1. + <_> + 59 9 1 1 3. + 0 + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_smile.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_smile.xml new file mode 100644 index 0000000000000000000000000000000000000000..bbdd896add956536207a3183311a6b6ba1d0ba29 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_smile.xml @@ -0,0 +1,6729 @@ + + + +BOOST + HAAR + 18 + 36 + + 53 + + 0 + 20 + + <_> + 11 + -1.2678639888763428e+00 + + <_> + + 0 -1 0 -4.8783610691316426e-04 + + 5.9219348430633545e-01 -4.4163608551025391e-01 + <_> + + 0 -1 1 -4.2209611274302006e-04 + + 3.0318650603294373e-01 -3.2912918925285339e-01 + <_> + + 0 -1 2 -4.9940118333324790e-04 + + 4.8563310503959656e-01 -4.2923060059547424e-01 + <_> + + 0 -1 3 3.7289198487997055e-02 + + -2.8667300939559937e-01 5.9979999065399170e-01 + <_> + + 0 -1 4 1.4334049774333835e-03 + + -3.4893131256103516e-01 4.0482750535011292e-01 + <_> + + 0 -1 5 -7.7213020995259285e-03 + + 7.5714188814163208e-01 -1.2225949764251709e-01 + <_> + + 0 -1 6 8.1067271530628204e-03 + + -1.6657720506191254e-01 7.5096148252487183e-01 + <_> + + 0 -1 7 -7.7238711528480053e-03 + + 6.2662792205810547e-01 -1.9127459824085236e-01 + <_> + + 0 -1 8 4.4225031160749495e-04 + + -2.3944470286369324e-01 4.4840618968009949e-01 + <_> + + 0 -1 9 -1.6867710510268807e-03 + + -1.8439069390296936e-01 9.1782413423061371e-02 + <_> + + 0 -1 10 1.4625620096921921e-02 + + 1.6168059408664703e-01 -8.1501179933547974e-01 + <_> + 11 + -1.5844069719314575e+00 + + <_> + + 0 -1 11 3.8141138851642609e-02 + + -3.3275881409645081e-01 7.7833342552185059e-01 + <_> + + 0 -1 12 -1.3136120105627924e-04 + + 3.6353090405464172e-01 -3.2043468952178955e-01 + <_> + + 0 -1 13 -3.8757019210606813e-03 + + 7.1352392435073853e-01 -3.5185989737510681e-01 + <_> + + 0 -1 14 1.4266290236264467e-03 + + 6.8100847303867340e-02 -6.1727327108383179e-01 + <_> + + 0 -1 15 -2.4605958606116474e-04 + + 5.7271498441696167e-01 -3.7860998511314392e-01 + <_> + + 0 -1 16 -3.1822640448808670e-02 + + -6.3484561443328857e-01 1.1641839891672134e-01 + <_> + + 0 -1 17 -1.7130950465798378e-02 + + -6.2793147563934326e-01 3.2479470968246460e-01 + <_> + + 0 -1 18 -9.3903783708810806e-03 + + -2.7578958868980408e-01 2.2330729663372040e-01 + <_> + + 0 -1 19 2.2802520543336868e-03 + + 1.8977640569210052e-01 -6.8817621469497681e-01 + <_> + + 0 -1 20 2.6840099599212408e-03 + + -2.2350500524044037e-01 1.3725799322128296e-01 + <_> + + 0 -1 21 1.0604639537632465e-02 + + -2.1426230669021606e-01 5.6207871437072754e-01 + <_> + 17 + -1.3820559978485107e+00 + + <_> + + 0 -1 22 -3.1677199876867235e-04 + + 4.6595481038093567e-01 -3.7425819039344788e-01 + <_> + + 0 -1 23 -5.5120628327131271e-02 + + 5.4179787635803223e-01 -2.2657650709152222e-01 + <_> + + 0 -1 24 -6.4742640824988484e-04 + + 3.7703070044517517e-01 -3.3486440777778625e-01 + <_> + + 0 -1 25 3.9507839083671570e-01 + + -1.8144419789314270e-01 8.1325918436050415e-01 + <_> + + 0 -1 26 4.0509410202503204e-02 + + -9.5369413495063782e-02 8.0595618486404419e-01 + <_> + + 0 -1 27 4.8735421150922775e-03 + + -1.4023660123348236e-01 6.1643028259277344e-01 + <_> + + 0 -1 28 1.0578040033578873e-02 + + 1.2932670116424561e-01 -7.4823349714279175e-01 + <_> + + 0 -1 29 9.2986393719911575e-03 + + 5.8940600603818893e-02 -4.4107300043106079e-01 + <_> + + 0 -1 30 -5.0301607698202133e-03 + + -6.6309732198715210e-01 1.8104769289493561e-01 + <_> + + 0 -1 31 -1.0947990085696802e-04 + + 2.2112590074539185e-01 -2.7309039235115051e-01 + <_> + + 0 -1 32 -1.1685509979724884e-01 + + -7.7205967903137207e-01 1.2481659650802612e-01 + <_> + + 0 -1 33 -4.3603649828583002e-05 + + 1.3670609891414642e-01 -1.6127939522266388e-01 + <_> + + 0 -1 34 -1.5056360280141234e-04 + + 4.4860461354255676e-01 -2.1711289882659912e-01 + <_> + + 0 -1 35 -1.6394609585404396e-02 + + -6.5827351808547974e-01 1.6745500266551971e-01 + <_> + + 0 -1 36 -1.4482860453426838e-02 + + -6.8345147371292114e-01 1.3456159830093384e-01 + <_> + + 0 -1 37 3.9269471017178148e-05 + + -1.4998139441013336e-01 1.6017720103263855e-01 + <_> + + 0 -1 38 7.4323131702840328e-03 + + -1.6848459839820862e-01 5.3963989019393921e-01 + <_> + 18 + -1.3879380226135254e+00 + + <_> + + 0 -1 39 -4.3472499237395823e-04 + + 4.3949240446090698e-01 -4.2248758673667908e-01 + <_> + + 0 -1 40 3.2995320856571198e-02 + + -1.9798250496387482e-01 5.9534871578216553e-01 + <_> + + 0 -1 41 -4.1011828579939902e-04 + + 4.4403061270713806e-01 -3.0748468637466431e-01 + <_> + + 0 -1 42 -8.1969738006591797e-02 + + -5.3334367275238037e-01 1.6718100011348724e-01 + <_> + + 0 -1 43 1.7778700217604637e-02 + + -2.0450179278850555e-01 5.1444131135940552e-01 + <_> + + 0 -1 44 2.2834699600934982e-02 + + -1.4846070110797882e-01 5.6242787837982178e-01 + <_> + + 0 -1 45 3.8604341447353363e-02 + + -1.2731470167636871e-01 8.1494480371475220e-01 + <_> + + 0 -1 46 -7.3286908445879817e-04 + + -3.7193441390991211e-01 6.7616499960422516e-02 + <_> + + 0 -1 47 -2.3229040205478668e-02 + + 7.1232062578201294e-01 -1.1589390039443970e-01 + <_> + + 0 -1 48 -1.9575359299778938e-02 + + -6.8990731239318848e-01 1.3999509811401367e-01 + <_> + + 0 -1 49 4.1991271427832544e-04 + + -1.8354649841785431e-01 4.9435558915138245e-01 + <_> + + 0 -1 50 -5.7089749723672867e-02 + + 6.2607848644256592e-01 -7.8576847910881042e-02 + <_> + + 0 -1 51 2.5699699297547340e-02 + + 1.1557140201330185e-01 -8.1935191154479980e-01 + <_> + + 0 -1 52 3.2579619437456131e-02 + + -1.1767739802598953e-01 4.2776221036911011e-01 + <_> + + 0 -1 53 -2.0592249929904938e-02 + + 4.8685240745544434e-01 -2.1318539977073669e-01 + <_> + + 0 -1 54 -1.7485279589891434e-02 + + -5.2287340164184570e-01 1.3397049903869629e-01 + <_> + + 0 -1 55 8.9153228327631950e-04 + + 9.6304491162300110e-02 -6.8863070011138916e-01 + <_> + + 0 -1 56 5.7533901184797287e-02 + + -8.7080523371696472e-02 4.0480649471282959e-01 + <_> + 25 + -1.3538850545883179e+00 + + <_> + + 0 -1 57 -4.6606198884546757e-04 + + 4.2773741483688354e-01 -3.5420769453048706e-01 + <_> + + 0 -1 58 3.0554559826850891e-01 + + -1.6392810642719269e-01 8.6065232753753662e-01 + <_> + + 0 -1 59 -1.1449400335550308e-02 + + 5.9727329015731812e-01 -2.3234340548515320e-01 + <_> + + 0 -1 60 6.3891541212797165e-03 + + -1.2915410101413727e-01 6.1052042245864868e-01 + <_> + + 0 -1 61 -8.4334248676896095e-03 + + 4.7928538918495178e-01 -1.9002729654312134e-01 + <_> + + 0 -1 62 5.3808931261301041e-02 + + -1.1493770033121109e-01 5.3394538164138794e-01 + <_> + + 0 -1 63 -4.7580219688825309e-04 + + -3.4598541259765625e-01 2.5488048791885376e-01 + <_> + + 0 -1 64 -1.3450840197037905e-04 + + 2.2414590418338776e-01 -1.9550070166587830e-01 + <_> + + 0 -1 65 5.0016911700367928e-04 + + -1.9720549881458282e-01 4.9677640199661255e-01 + <_> + + 0 -1 66 1.5063269995152950e-02 + + 1.0630770027637482e-01 -4.1138210892677307e-01 + <_> + + 0 -1 67 7.7588870190083981e-03 + + -1.5373119711875916e-01 4.8931619524955750e-01 + <_> + + 0 -1 68 4.5410118997097015e-02 + + -7.3559306561946869e-02 2.7737921476364136e-01 + <_> + + 0 -1 69 -1.4599669724702835e-02 + + -7.0966827869415283e-01 9.7515560686588287e-02 + <_> + + 0 -1 70 1.7236070707440376e-02 + + 1.6869539394974709e-02 -5.7388329505920410e-01 + <_> + + 0 -1 71 1.4230710454285145e-02 + + 9.4714500010013580e-02 -7.8395259380340576e-01 + <_> + + 0 -1 72 -4.3706860393285751e-02 + + 6.0979652404785156e-01 -1.5601889789104462e-01 + <_> + + 0 -1 73 -6.2343222089111805e-04 + + 3.4851190447807312e-01 -2.1704910695552826e-01 + <_> + + 0 -1 74 1.9245050847530365e-02 + + -1.1710979789495468e-01 3.0701160430908203e-01 + <_> + + 0 -1 75 2.7035778760910034e-01 + + -9.0096436440944672e-02 7.6656961441040039e-01 + <_> + + 0 -1 76 -3.5394480801187456e-04 + + -2.0024789869785309e-01 1.2493360042572021e-01 + <_> + + 0 -1 77 -3.6013960838317871e-02 + + 6.7028558254241943e-01 -1.0571879893541336e-01 + <_> + + 0 -1 78 9.2952791601419449e-03 + + -1.0574710369110107e-01 4.5093879103660583e-01 + <_> + + 0 -1 79 -3.3304709359072149e-04 + + 2.7933821082115173e-01 -2.4576769769191742e-01 + <_> + + 0 -1 80 -2.9147620807634667e-05 + + 8.5813812911510468e-02 -9.5469586551189423e-02 + <_> + + 0 -1 81 4.4382669148035347e-04 + + -2.0220080018043518e-01 5.4543578624725342e-01 + <_> + 23 + -1.3707510232925415e+00 + + <_> + + 0 -1 82 7.9610757529735565e-03 + + -3.6722078919410706e-01 4.3154349923133850e-01 + <_> + + 0 -1 83 6.3394829630851746e-02 + + -2.0739710330963135e-01 5.7426017522811890e-01 + <_> + + 0 -1 84 -5.3193349391222000e-02 + + 7.2550922632217407e-01 -1.4342020452022552e-01 + <_> + + 0 -1 85 1.5460769645869732e-02 + + -9.6053816378116608e-02 7.5785237550735474e-01 + <_> + + 0 -1 86 -1.7643140628933907e-02 + + 6.6815620660781860e-01 -1.4176729321479797e-01 + <_> + + 0 -1 87 9.5065636560320854e-03 + + -9.6259742975234985e-02 4.6996331214904785e-01 + <_> + + 0 -1 88 4.0446049533784389e-03 + + -1.9732519984245300e-01 4.2838010191917419e-01 + <_> + + 0 -1 89 3.2312041148543358e-03 + + 1.1861690133810043e-01 -6.1039632558822632e-01 + <_> + + 0 -1 90 -4.0159050375223160e-02 + + -4.1664341092109680e-01 2.1672329306602478e-01 + <_> + + 0 -1 91 2.8524258732795715e-01 + + -1.0435750335454941e-01 8.5733968019485474e-01 + <_> + + 0 -1 92 -4.9264221452176571e-03 + + 4.7060468792915344e-01 -1.3997459411621094e-01 + <_> + + 0 -1 93 1.3781700283288956e-02 + + -1.2713569402694702e-01 4.4618919491767883e-01 + <_> + + 0 -1 94 -4.9873598618432879e-04 + + 4.7026631236076355e-01 -1.5483739972114563e-01 + <_> + + 0 -1 95 -1.5621389320585877e-04 + + 1.8854810297489166e-01 -7.7839776873588562e-02 + <_> + + 0 -1 96 -3.7597760092467070e-04 + + 5.7697701454162598e-01 -1.3356220722198486e-01 + <_> + + 0 -1 97 -1.0665910318493843e-02 + + -4.1065299510955811e-01 1.5562120079994202e-01 + <_> + + 0 -1 98 -3.4135230816900730e-03 + + -7.6363432407379150e-01 1.0209649801254272e-01 + <_> + + 0 -1 99 5.6471868447260931e-05 + + -1.6443930566310883e-01 2.2908419370651245e-01 + <_> + + 0 -1 100 2.1611599368043244e-04 + + -1.6290329396724701e-01 4.5756360888481140e-01 + <_> + + 0 -1 101 -1.0822719894349575e-02 + + -2.4462530016899109e-01 1.3888940215110779e-01 + <_> + + 0 -1 102 -1.5084910206496716e-02 + + -5.7813477516174316e-01 1.1564119905233383e-01 + <_> + + 0 -1 103 2.5715960189700127e-02 + + 3.9631199091672897e-02 -6.5270012617111206e-01 + <_> + + 0 -1 104 2.6093570049852133e-03 + + 1.1421889811754227e-01 -5.6801080703735352e-01 + <_> + 26 + -1.3303329944610596e+00 + + <_> + + 0 -1 105 -5.1861900836229324e-02 + + 7.0431172847747803e-01 -2.2143700718879700e-01 + <_> + + 0 -1 106 -5.0341628491878510e-02 + + -4.6397829055786133e-01 2.8047460317611694e-01 + <_> + + 0 -1 107 2.5709730386734009e-01 + + -1.3124279677867889e-01 8.2395941019058228e-01 + <_> + + 0 -1 108 1.1031899601221085e-02 + + -1.4258140325546265e-01 6.3823902606964111e-01 + <_> + + 0 -1 109 1.8565090373158455e-02 + + -1.5123879909515381e-01 5.9881192445755005e-01 + <_> + + 0 -1 110 1.7502350732684135e-02 + + -1.2619799375534058e-01 3.8178038597106934e-01 + <_> + + 0 -1 111 7.2723729535937309e-03 + + -1.5103289484977722e-01 5.8128422498703003e-01 + <_> + + 0 -1 112 8.1504750996828079e-03 + + -6.5464757382869720e-02 5.6397551298141479e-01 + <_> + + 0 -1 113 -1.8552739173173904e-02 + + 5.3157097101211548e-01 -1.2526570260524750e-01 + <_> + + 0 -1 114 -2.3101480677723885e-02 + + -6.7949390411376953e-01 1.1046259850263596e-01 + <_> + + 0 -1 115 -1.8539339362177998e-04 + + 3.0100038647651672e-01 -2.1206699311733246e-01 + <_> + + 0 -1 116 1.7319120466709137e-02 + + -9.3738131225109100e-02 2.1008560061454773e-01 + <_> + + 0 -1 117 1.4305620454251766e-02 + + 1.8005949258804321e-01 -3.9776718616485596e-01 + <_> + + 0 -1 118 2.5763340294361115e-02 + + 8.7056998163461685e-03 -6.2894952297210693e-01 + <_> + + 0 -1 119 -1.5383340418338776e-02 + + -5.3415471315383911e-01 1.0380730032920837e-01 + <_> + + 0 -1 120 1.0605469578877091e-03 + + -9.0128518640995026e-02 1.6792120039463043e-01 + <_> + + 0 -1 121 3.5230729263275862e-03 + + -1.7110690474510193e-01 3.2596540451049805e-01 + <_> + + 0 -1 122 -1.0789279825985432e-02 + + 3.6109921336174011e-01 -6.6339150071144104e-02 + <_> + + 0 -1 123 2.7950939536094666e-01 + + -7.4605897068977356e-02 7.3369878530502319e-01 + <_> + + 0 -1 124 3.8369540125131607e-03 + + 4.4873539358377457e-02 -1.8602700531482697e-01 + <_> + + 0 -1 125 1.6195949865505099e-03 + + -1.3922490179538727e-01 4.3437001109123230e-01 + <_> + + 0 -1 126 1.1647949926555157e-02 + + -7.4357591569423676e-02 5.4201442003250122e-01 + <_> + + 0 -1 127 -5.9066400863230228e-03 + + -7.0557588338851929e-01 8.6433619260787964e-02 + <_> + + 0 -1 128 3.9686840772628784e-01 + + -7.4898369610309601e-02 9.4062858819961548e-01 + <_> + + 0 -1 129 5.7663779705762863e-02 + + -9.6558406949043274e-02 5.4182428121566772e-01 + <_> + + 0 -1 130 6.0319568961858749e-02 + + -6.6501073539257050e-02 6.4023548364639282e-01 + <_> + 37 + -1.5300060510635376e+00 + + <_> + + 0 -1 131 1.9050249829888344e-02 + + -4.4433408975601196e-01 4.3948569893836975e-01 + <_> + + 0 -1 132 -2.0198300480842590e-02 + + -3.1706219911575317e-01 1.0432930290699005e-01 + <_> + + 0 -1 133 2.1478030830621719e-02 + + -3.5024839639663696e-01 2.6355370879173279e-01 + <_> + + 0 -1 134 -1.0187759995460510e-01 + + -5.9889578819274902e-01 1.7685799300670624e-01 + <_> + + 0 -1 135 1.0974160395562649e-02 + + -1.4895239472389221e-01 6.0115218162536621e-01 + <_> + + 0 -1 136 -1.1476710438728333e-02 + + 4.0665709972381592e-01 -1.2404689937829971e-01 + <_> + + 0 -1 137 -2.3431150242686272e-02 + + -7.1487832069396973e-01 1.4278119802474976e-01 + <_> + + 0 -1 138 1.4963559806346893e-03 + + -1.7045859992504120e-01 1.7193080484867096e-01 + <_> + + 0 -1 139 -5.4855772759765387e-04 + + 3.1553238630294800e-01 -2.1444450318813324e-01 + <_> + + 0 -1 140 7.4912630021572113e-02 + + 9.1240562498569489e-02 -6.3951212167739868e-01 + <_> + + 0 -1 141 6.8816398270428181e-03 + + -1.4904409646987915e-01 4.7952368855476379e-01 + <_> + + 0 -1 142 -3.8212578743696213e-02 + + 5.2887737751007080e-01 -6.1894729733467102e-02 + <_> + + 0 -1 143 4.4051730073988438e-03 + + -1.1934129893779755e-01 5.0613421201705933e-01 + <_> + + 0 -1 144 2.3966899141669273e-02 + + -8.9720509946346283e-02 3.3152779936790466e-01 + <_> + + 0 -1 145 -3.4162990748882294e-02 + + 5.3134781122207642e-01 -1.4666500687599182e-01 + <_> + + 0 -1 146 1.9642219413071871e-03 + + 9.0783588588237762e-02 -4.3032559752464294e-01 + <_> + + 0 -1 147 9.6757910796441138e-05 + + 2.2552539408206940e-01 -2.8220710158348083e-01 + <_> + + 0 -1 148 -3.2862399239093065e-03 + + 4.0515020489692688e-01 -1.1776199936866760e-01 + <_> + + 0 -1 149 1.1688309721648693e-02 + + -9.1857127845287323e-02 6.2834888696670532e-01 + <_> + + 0 -1 150 -6.0287420637905598e-03 + + 3.9261808991432190e-01 -1.2287150323390961e-01 + <_> + + 0 -1 151 -1.3721340335905552e-02 + + -5.5298799276351929e-01 9.1041281819343567e-02 + <_> + + 0 -1 152 7.5626641511917114e-02 + + -4.4929590076208115e-02 1.7442759871482849e-01 + <_> + + 0 -1 153 9.3434482812881470e-02 + + -8.4593951702117920e-02 6.0131162405014038e-01 + <_> + + 0 -1 154 5.8748829178512096e-03 + + -4.4131498783826828e-02 3.9565709233283997e-01 + <_> + + 0 -1 155 4.0064537897706032e-03 + + -1.1414399743080139e-01 3.7925380468368530e-01 + <_> + + 0 -1 156 2.2945459932088852e-02 + + 2.4673189967870712e-02 -4.1521999239921570e-01 + <_> + + 0 -1 157 -1.2810460291802883e-02 + + -5.1557427644729614e-01 9.1319613158702850e-02 + <_> + + 0 -1 158 2.0425529778003693e-01 + + -6.5927542746067047e-02 7.5942492485046387e-01 + <_> + + 0 -1 159 4.9796327948570251e-03 + + 1.0806279629468918e-01 -5.0016272068023682e-01 + <_> + + 0 -1 160 2.8397630900144577e-02 + + -3.7152960896492004e-02 5.4010647535324097e-01 + <_> + + 0 -1 161 6.0867150314152241e-03 + + -1.1978609859943390e-01 3.5692268610000610e-01 + <_> + + 0 -1 162 -2.1456899412441999e-04 + + 1.8740150332450867e-01 -8.8417202234268188e-02 + <_> + + 0 -1 163 2.8941858909092844e-04 + + -1.2597979605197906e-01 3.9982271194458008e-01 + <_> + + 0 -1 164 -1.3047619722783566e-03 + + 1.5499970316886902e-01 -7.5386047363281250e-02 + <_> + + 0 -1 165 -1.2975010089576244e-02 + + -5.5344110727310181e-01 8.2354247570037842e-02 + <_> + + 0 -1 166 7.7442410401999950e-03 + + 2.7699800208210945e-02 -3.4835991263389587e-01 + <_> + + 0 -1 167 2.4850629270076752e-03 + + -1.2976129353046417e-01 3.7908831238746643e-01 + <_> + 21 + -1.4114329814910889e+00 + + <_> + + 0 -1 168 -4.0386881679296494e-02 + + 5.9603548049926758e-01 -3.5741761326789856e-01 + <_> + + 0 -1 169 -6.6068649175576866e-05 + + 4.4628980755805969e-01 -3.5959470272064209e-01 + <_> + + 0 -1 170 3.7622239906340837e-03 + + 1.7947019636631012e-01 -7.5631511211395264e-01 + <_> + + 0 -1 171 -3.0967719852924347e-02 + + -2.8847050666809082e-01 7.6870530843734741e-02 + <_> + + 0 -1 172 3.0566560104489326e-02 + + 1.4003600180149078e-01 -7.1755367517471313e-01 + <_> + + 0 -1 173 9.9054910242557526e-04 + + 8.2915589213371277e-02 -2.9197171330451965e-01 + <_> + + 0 -1 174 1.2577700428664684e-02 + + 1.5380719304084778e-01 -4.6882930397987366e-01 + <_> + + 0 -1 175 1.2392920255661011e-01 + + -9.0823858976364136e-02 7.3837572336196899e-01 + <_> + + 0 -1 176 3.7737488746643066e-01 + + -5.4232951253652573e-02 9.2291218042373657e-01 + <_> + + 0 -1 177 1.0996370017528534e-01 + + 9.1596268117427826e-02 -6.5977168083190918e-01 + <_> + + 0 -1 178 -1.2721329694613814e-03 + + 3.3475750684738159e-01 -1.8290689587593079e-01 + <_> + + 0 -1 179 4.6906251460313797e-02 + + -8.3971053361892700e-02 6.9847589731216431e-01 + <_> + + 0 -1 180 3.2869930146262050e-04 + + 1.8794630467891693e-01 -2.9290059208869934e-01 + <_> + + 0 -1 181 1.7333080177195370e-04 + + -2.6964160799980164e-01 3.4947571158409119e-01 + <_> + + 0 -1 182 1.9800959154963493e-02 + + -1.4679229259490967e-01 4.3995618820190430e-01 + <_> + + 0 -1 183 2.0056760695297271e-04 + + -1.3727410137653351e-01 2.2213310003280640e-01 + <_> + + 0 -1 184 -1.4923149719834328e-03 + + 3.4735259413719177e-01 -1.5948210656642914e-01 + <_> + + 0 -1 185 -4.2736999603221193e-05 + + 3.1527870893478394e-01 -2.3066949844360352e-01 + <_> + + 0 -1 186 6.6625140607357025e-04 + + -2.0131100714206696e-01 2.8691890835762024e-01 + <_> + + 0 -1 187 1.3850460163666867e-05 + + -2.0219239592552185e-01 2.3073309659957886e-01 + <_> + + 0 -1 188 4.0972631424665451e-02 + + 7.9543180763721466e-02 -8.0795639753341675e-01 + <_> + 23 + -1.3777890205383301e+00 + + <_> + + 0 -1 189 -4.6982929110527039e-02 + + 7.0822530984878540e-01 -3.7034240365028381e-01 + <_> + + 0 -1 190 -7.5753079727292061e-04 + + -1.2550309300422668e-01 1.3944420218467712e-01 + <_> + + 0 -1 191 1.5327299945056438e-02 + + 2.1613539755344391e-01 -5.6293952465057373e-01 + <_> + + 0 -1 192 1.8147040158510208e-02 + + -3.2079648226499557e-02 3.2347559928894043e-01 + <_> + + 0 -1 193 4.7347191721200943e-02 + + -1.7381580173969269e-01 5.7580447196960449e-01 + <_> + + 0 -1 194 -5.9837941080331802e-02 + + 4.7797870635986328e-01 -1.0260280221700668e-01 + <_> + + 0 -1 195 -5.2796799689531326e-02 + + -4.7988489270210266e-01 1.8787759542465210e-01 + <_> + + 0 -1 196 -2.4385429918766022e-02 + + -3.0841669440269470e-01 8.7605630978941917e-03 + <_> + + 0 -1 197 2.5288300588726997e-02 + + 1.3914039731025696e-01 -7.1094942092895508e-01 + <_> + + 0 -1 198 -2.1612450480461121e-02 + + -2.3282539844512939e-01 8.0994680523872375e-02 + <_> + + 0 -1 199 3.4023479092866182e-03 + + -2.2989900410175323e-01 3.7889510393142700e-01 + <_> + + 0 -1 200 1.1274600028991699e-01 + + -1.5474709682166576e-02 5.7030540704727173e-01 + <_> + + 0 -1 201 3.4516870975494385e-02 + + -1.2300080060958862e-01 5.6775367259979248e-01 + <_> + + 0 -1 202 7.8984811902046204e-02 + + -1.4242169260978699e-01 4.6941858530044556e-01 + <_> + + 0 -1 203 -1.5377859584987164e-02 + + 6.3946861028671265e-01 -1.1236190050840378e-01 + <_> + + 0 -1 204 -2.2373620595317334e-04 + + 5.5583298206329346e-01 -2.7247580885887146e-01 + <_> + + 0 -1 205 -2.4762390181422234e-02 + + -5.0404858589172363e-01 1.4077790081501007e-01 + <_> + + 0 -1 206 -9.4061157142277807e-05 + + 3.7195280194282532e-01 -2.2502990067005157e-01 + <_> + + 0 -1 207 -2.0256359130144119e-02 + + 5.1051008701324463e-01 -1.4298759400844574e-01 + <_> + + 0 -1 208 4.8122879117727280e-02 + + -6.6979512572288513e-02 3.6622309684753418e-01 + <_> + + 0 -1 209 -2.3787800222635269e-02 + + 5.0813251733779907e-01 -1.2908150255680084e-01 + <_> + + 0 -1 210 -1.0520319920033216e-03 + + -1.5604670345783234e-01 6.6213317215442657e-02 + <_> + + 0 -1 211 -2.6640200521796942e-03 + + -7.2545582056045532e-01 8.2365453243255615e-02 + <_> + 25 + -1.3266400098800659e+00 + + <_> + + 0 -1 212 -5.0224620848894119e-02 + + 7.0845657587051392e-01 -2.5585499405860901e-01 + <_> + + 0 -1 213 1.4072869904339314e-02 + + 6.3033178448677063e-02 -5.9838529676198959e-02 + <_> + + 0 -1 214 1.7804009839892387e-02 + + 1.9414719939231873e-01 -5.8444267511367798e-01 + <_> + + 0 -1 215 1.3046739995479584e-01 + + -1.1516980081796646e-01 8.5040301084518433e-01 + <_> + + 0 -1 216 1.7506800591945648e-02 + + -2.0718969404697418e-01 4.6438288688659668e-01 + <_> + + 0 -1 217 -7.4240020476281643e-03 + + -6.6565167903900146e-01 1.4034989476203918e-01 + <_> + + 0 -1 218 -3.4571118652820587e-02 + + 6.5112978219985962e-01 -1.4901919662952423e-01 + <_> + + 0 -1 219 4.2270249687135220e-03 + + -1.6027219826355577e-03 3.8956061005592346e-01 + <_> + + 0 -1 220 -5.0662040710449219e-02 + + 5.8035767078399658e-01 -1.5141439437866211e-01 + <_> + + 0 -1 221 -7.0715770125389099e-03 + + 5.3008967638015747e-01 -1.4498309791088104e-01 + <_> + + 0 -1 222 -1.1863510124385357e-02 + + 6.7297422885894775e-01 -1.1063549667596817e-01 + <_> + + 0 -1 223 -6.0520030558109283e-02 + + -3.3164489269256592e-01 2.1195560693740845e-01 + <_> + + 0 -1 224 -7.7340779826045036e-03 + + -6.9414401054382324e-01 7.2705313563346863e-02 + <_> + + 0 -1 225 -3.2486140727996826e-02 + + -5.1850819587707520e-01 5.9212621301412582e-02 + <_> + + 0 -1 226 8.3279706537723541e-02 + + 1.2067940086126328e-01 -5.3095632791519165e-01 + <_> + + 0 -1 227 7.8782817581668496e-04 + + -2.7376559376716614e-01 2.7162519097328186e-01 + <_> + + 0 -1 228 -1.7539180815219879e-02 + + -5.6902301311492920e-01 1.2287370115518570e-01 + <_> + + 0 -1 229 -5.8226347900927067e-03 + + 4.3865859508514404e-01 -1.4937420189380646e-01 + <_> + + 0 -1 230 -1.0057560168206692e-02 + + -6.6168862581253052e-01 1.1445429921150208e-01 + <_> + + 0 -1 231 9.0345427393913269e-02 + + -6.6665247082710266e-02 2.8706479072570801e-01 + <_> + + 0 -1 232 -6.7587293684482574e-02 + + -5.3637611865997314e-01 1.1237519979476929e-01 + <_> + + 0 -1 233 -8.1747528165578842e-03 + + 4.4342419505119324e-01 -1.2977659702301025e-01 + <_> + + 0 -1 234 -1.1550550349056721e-02 + + 3.2731580734252930e-01 -1.7007610201835632e-01 + <_> + + 0 -1 235 -1.7406829283572733e-04 + + 1.3278679549694061e-01 -1.0812939703464508e-01 + <_> + + 0 -1 236 4.6040047891438007e-03 + + -1.2265820056200027e-01 4.4125801324844360e-01 + <_> + 17 + -1.4497200250625610e+00 + + <_> + + 0 -1 237 -4.6943280845880508e-02 + + 6.0943442583084106e-01 -2.6378008723258972e-01 + <_> + + 0 -1 238 -1.6899159527383745e-04 + + 1.6658750176429749e-01 -1.2541960179805756e-01 + <_> + + 0 -1 239 2.7983370237052441e-03 + + 1.9057449698448181e-01 -6.5680772066116333e-01 + <_> + + 0 -1 240 4.0413960814476013e-03 + + -1.7317469418048859e-01 6.3620752096176147e-01 + <_> + + 0 -1 241 -8.6033362895250320e-03 + + 6.0258418321609497e-01 -2.3169369995594025e-01 + <_> + + 0 -1 242 8.8247945532202721e-03 + + -1.7565830051898956e-01 7.1041667461395264e-01 + <_> + + 0 -1 243 -9.2786159366369247e-03 + + -6.8908572196960449e-01 1.7896500229835510e-01 + <_> + + 0 -1 244 6.0826768167316914e-03 + + -1.7063720524311066e-01 5.3757482767105103e-01 + <_> + + 0 -1 245 -3.9007369428873062e-02 + + -6.8346357345581055e-01 1.4417080581188202e-01 + <_> + + 0 -1 246 -7.0337951183319092e-02 + + -6.5085667371749878e-01 1.0085479915142059e-01 + <_> + + 0 -1 247 3.3166699111461639e-02 + + -1.9325719773769379e-01 4.7798651456832886e-01 + <_> + + 0 -1 248 7.5288906693458557e-02 + + -6.9567732512950897e-02 4.1250649094581604e-01 + <_> + + 0 -1 249 -7.0501729846000671e-02 + + 7.1573007106781006e-01 -1.0222700238227844e-01 + <_> + + 0 -1 250 1.2249490246176720e-02 + + -1.0612429678440094e-01 6.2959581613540649e-01 + <_> + + 0 -1 251 7.0644676685333252e-02 + + -9.7374632954597473e-02 6.7622041702270508e-01 + <_> + + 0 -1 252 1.6248880326747894e-01 + + 5.2713360637426376e-02 -8.4946572780609131e-01 + <_> + + 0 -1 253 1.3808250427246094e-01 + + 1.4064790308475494e-01 -4.7647210955619812e-01 + <_> + 20 + -1.4622910022735596e+00 + + <_> + + 0 -1 254 -4.1882339864969254e-02 + + -8.0774527788162231e-01 2.6409670710563660e-01 + <_> + + 0 -1 255 -5.3622990846633911e-02 + + 5.5807042121887207e-01 -2.4989689886569977e-01 + <_> + + 0 -1 256 9.3709938228130341e-03 + + 2.6501700282096863e-01 -5.9906947612762451e-01 + <_> + + 0 -1 257 1.3909730128943920e-02 + + -1.4709180593490601e-01 7.3546671867370605e-01 + <_> + + 0 -1 258 1.9003570079803467e-02 + + -1.8875110149383545e-01 7.4874222278594971e-01 + <_> + + 0 -1 259 5.9199850074946880e-03 + + -1.5995639562606812e-01 5.6735777854919434e-01 + <_> + + 0 -1 260 -2.4705139920115471e-02 + + 7.5569921731948853e-01 -1.2350880354642868e-01 + <_> + + 0 -1 261 1.6058359295129776e-02 + + -1.2824609875679016e-01 5.1294547319412231e-01 + <_> + + 0 -1 262 8.8288700208067894e-03 + + -1.6866639256477356e-01 6.1521852016448975e-01 + <_> + + 0 -1 263 1.7556339502334595e-02 + + -1.0901699960231781e-01 5.8031761646270752e-01 + <_> + + 0 -1 264 4.2188119143247604e-02 + + 1.4866240322589874e-01 -6.9222331047058105e-01 + <_> + + 0 -1 265 5.0687207840383053e-04 + + 3.1580869108438492e-02 -3.7009951472282410e-01 + <_> + + 0 -1 266 2.7651190757751465e-03 + + -2.1337540447711945e-01 4.7043010592460632e-01 + <_> + + 0 -1 267 -1.2231520377099514e-03 + + -7.8189671039581299e-01 2.0954260602593422e-02 + <_> + + 0 -1 268 8.5432287305593491e-03 + + -1.4553520083427429e-01 6.7895042896270752e-01 + <_> + + 0 -1 269 -2.0657219283748418e-04 + + 2.4376240372657776e-01 -6.7558802664279938e-02 + <_> + + 0 -1 270 -4.6798270195722580e-03 + + 6.6841697692871094e-01 -1.3887880742549896e-01 + <_> + + 0 -1 271 1.2201759964227676e-01 + + 1.1028160154819489e-01 -7.5307422876358032e-01 + <_> + + 0 -1 272 2.0404340699315071e-02 + + 1.6453839838504791e-01 -5.2231621742248535e-01 + <_> + + 0 -1 273 8.0343370791524649e-04 + + -1.3012850284576416e-01 2.6358529925346375e-01 + <_> + 28 + -1.3885619640350342e+00 + + <_> + + 0 -1 274 7.2791710495948792e-02 + + -1.3727900385856628e-01 8.2915747165679932e-01 + <_> + + 0 -1 275 7.5939209200441837e-03 + + -1.6780120134353638e-01 5.6839722394943237e-01 + <_> + + 0 -1 276 -2.3562390357255936e-02 + + 6.5005600452423096e-01 -1.4245350658893585e-01 + <_> + + 0 -1 277 1.7392950132489204e-02 + + -1.5291449427604675e-01 3.4253540635108948e-01 + <_> + + 0 -1 278 7.1825802326202393e-02 + + -9.9131137132644653e-02 8.2796788215637207e-01 + <_> + + 0 -1 279 1.3673800043761730e-02 + + -4.1787270456552505e-02 5.0781482458114624e-01 + <_> + + 0 -1 280 -2.8585959225893021e-02 + + 7.0115321874618530e-01 -1.3144710659980774e-01 + <_> + + 0 -1 281 -4.1845720261335373e-04 + + 2.8454670310020447e-01 -3.1232029199600220e-01 + <_> + + 0 -1 282 -5.2095681428909302e-02 + + 4.1812941431999207e-01 -1.6993130743503571e-01 + <_> + + 0 -1 283 3.2256329432129860e-03 + + -9.0466208755970001e-02 3.0086231231689453e-01 + <_> + + 0 -1 284 3.4771639853715897e-02 + + -8.4216788411140442e-02 7.8016638755798340e-01 + <_> + + 0 -1 285 -1.3356630224734545e-03 + + 3.3164530992507935e-01 -1.6960920393466949e-01 + <_> + + 0 -1 286 2.5101980566978455e-01 + + -1.3920469582080841e-01 6.6338932514190674e-01 + <_> + + 0 -1 287 -9.9689997732639313e-03 + + -3.7138170003890991e-01 1.2900120019912720e-01 + <_> + + 0 -1 288 1.4303729869425297e-02 + + 1.5729199349880219e-01 -5.0938212871551514e-01 + <_> + + 0 -1 289 -7.0856059901416302e-03 + + 4.6567910909652710e-01 -6.6270820796489716e-02 + <_> + + 0 -1 290 -4.6260809176601470e-04 + + 2.9337310791015625e-01 -2.3339860141277313e-01 + <_> + + 0 -1 291 -3.4435480833053589e-02 + + 7.0024740695953369e-01 -1.0133510082960129e-01 + <_> + + 0 -1 292 -7.2570890188217163e-03 + + -5.6286412477493286e-01 1.3148620724678040e-01 + <_> + + 0 -1 293 4.8352940939366817e-04 + + 2.6227489113807678e-02 -2.6050800085067749e-01 + <_> + + 0 -1 294 -1.2999939732253551e-02 + + 5.3117001056671143e-01 -1.2023050338029861e-01 + <_> + + 0 -1 295 -1.0009329998865724e-03 + + 3.9641299843788147e-01 -1.5995159745216370e-01 + <_> + + 0 -1 296 4.1314200498163700e-03 + + -1.4929920434951782e-01 4.2959120869636536e-01 + <_> + + 0 -1 297 8.7364455685019493e-03 + + -1.1271020025014877e-01 4.9456471204757690e-01 + <_> + + 0 -1 298 2.6352869463153183e-04 + + -1.2124919891357422e-01 4.9439379572868347e-01 + <_> + + 0 -1 299 -5.3885959088802338e-02 + + 7.0355987548828125e-01 -1.3230550102889538e-02 + <_> + + 0 -1 300 4.2885672301054001e-03 + + -1.7540550231933594e-01 3.5679468512535095e-01 + <_> + + 0 -1 301 7.9539399594068527e-03 + + -9.9884003400802612e-02 3.1371670961380005e-01 + <_> + 53 + -1.2766569852828979e+00 + + <_> + + 0 -1 302 5.6752368807792664e-02 + + -3.2576480507850647e-01 3.7375938892364502e-01 + <_> + + 0 -1 303 7.0906039327383041e-03 + + -1.3918629288673401e-01 1.5039840340614319e-01 + <_> + + 0 -1 304 -4.1298821568489075e-02 + + 4.7026079893112183e-01 -1.6179360449314117e-01 + <_> + + 0 -1 305 4.7750189900398254e-01 + + -1.0061579942703247e-01 7.6350742578506470e-01 + <_> + + 0 -1 306 4.2266491055488586e-01 + + -3.5190910100936890e-02 8.3031260967254639e-01 + <_> + + 0 -1 307 -3.3031899482011795e-02 + + -3.7505549192428589e-01 4.8902619630098343e-02 + <_> + + 0 -1 308 1.1923770216526464e-04 + + -2.6614668965339661e-01 2.2346520423889160e-01 + <_> + + 0 -1 309 4.2101400904357433e-03 + + 8.7575968354940414e-03 -5.9383517503738403e-01 + <_> + + 0 -1 310 3.3337279455736279e-04 + + -2.1227659285068512e-01 2.4735039472579956e-01 + <_> + + 0 -1 311 1.1793890036642551e-02 + + -6.8997949361801147e-02 5.8980828523635864e-01 + <_> + + 0 -1 312 -1.1432079970836639e-01 + + -7.7333682775497437e-01 6.2862291932106018e-02 + <_> + + 0 -1 313 8.2401007413864136e-02 + + 1.6825279220938683e-02 -6.1700117588043213e-01 + <_> + + 0 -1 314 1.8126150593161583e-02 + + 9.9533468484878540e-02 -3.8309159874916077e-01 + <_> + + 0 -1 315 8.9282449334859848e-03 + + -1.0109739750623703e-01 2.9483050107955933e-01 + <_> + + 0 -1 316 -1.7437100410461426e-02 + + 4.6149870753288269e-01 -1.0506360232830048e-01 + <_> + + 0 -1 317 -1.1280310340225697e-02 + + 4.5611649751663208e-01 -1.0131160169839859e-01 + <_> + + 0 -1 318 7.0190089754760265e-03 + + -1.3686269521713257e-01 4.1732659935951233e-01 + <_> + + 0 -1 319 -3.2439709175378084e-03 + + 2.3216480016708374e-01 -1.7915369570255280e-01 + <_> + + 0 -1 320 3.5615891218185425e-01 + + -4.8626810312271118e-02 9.5373457670211792e-01 + <_> + + 0 -1 321 3.8440749049186707e-03 + + -1.0288280248641968e-01 3.6717781424522400e-01 + <_> + + 0 -1 322 6.0950029641389847e-02 + + 5.6141741573810577e-02 -6.4585697650909424e-01 + <_> + + 0 -1 323 1.8149229884147644e-01 + + 3.0806390568614006e-02 -4.6048960089683533e-01 + <_> + + 0 -1 324 -9.2359259724617004e-02 + + -4.5248210430145264e-01 8.8152237236499786e-02 + <_> + + 0 -1 325 7.6072998344898224e-03 + + -9.7122326493263245e-02 2.1552249789237976e-01 + <_> + + 0 -1 326 -4.6946710790507495e-04 + + -4.0893718600273132e-01 8.0042190849781036e-02 + <_> + + 0 -1 327 1.0301820293534547e-04 + + -1.1530359834432602e-01 2.7955350279808044e-01 + <_> + + 0 -1 328 2.7936851256527007e-04 + + -1.1396100372076035e-01 2.9316601157188416e-01 + <_> + + 0 -1 329 2.4675959348678589e-01 + + -3.8595631718635559e-02 8.2649981975555420e-01 + <_> + + 0 -1 330 -8.4232958033680916e-03 + + 3.2995969057083130e-01 -1.1645369976758957e-01 + <_> + + 0 -1 331 -4.2311567813158035e-03 + + 2.7142119407653809e-01 -1.0811480134725571e-01 + <_> + + 0 -1 332 1.5653009759262204e-03 + + 7.8253783285617828e-02 -5.2097660303115845e-01 + <_> + + 0 -1 333 -5.0341398455202579e-03 + + 2.9488059878349304e-01 -4.6960510313510895e-02 + <_> + + 0 -1 334 1.4283140189945698e-03 + + -1.3794599473476410e-01 2.4323709309101105e-01 + <_> + + 0 -1 335 1.9031369686126709e-01 + + -5.2093509584665298e-02 6.8708032369613647e-01 + <_> + + 0 -1 336 8.1368777900934219e-03 + + -5.3311519324779510e-02 5.8272719383239746e-01 + <_> + + 0 -1 337 -4.6728368848562241e-02 + + 3.5525360703468323e-01 -1.7806259915232658e-02 + <_> + + 0 -1 338 1.4317169785499573e-02 + + -1.2626640498638153e-01 2.6961010694503784e-01 + <_> + + 0 -1 339 -9.6109732985496521e-02 + + 3.4117481112480164e-01 -3.9217609912157059e-02 + <_> + + 0 -1 340 7.4878811836242676e-02 + + -6.4819902181625366e-02 5.6711381673812866e-01 + <_> + + 0 -1 341 -5.1972299843328074e-05 + + 2.8742098808288574e-01 -1.6428899765014648e-01 + <_> + + 0 -1 342 -2.0099039829801768e-04 + + 2.6590210199356079e-01 -1.2990359961986542e-01 + <_> + + 0 -1 343 1.5583490021526814e-02 + + 3.6322619765996933e-02 -8.8743317127227783e-01 + <_> + + 0 -1 344 6.7313341423869133e-03 + + 1.6281859576702118e-01 -1.9716200232505798e-01 + <_> + + 0 -1 345 -4.5251410454511642e-02 + + -2.0315009355545044e-01 1.5734089910984039e-01 + <_> + + 0 -1 346 2.8729529003612697e-04 + + -1.2449590116739273e-01 2.5658228993415833e-01 + <_> + + 0 -1 347 -2.1028579212725163e-03 + + -5.0887292623519897e-01 3.4083180129528046e-02 + <_> + + 0 -1 348 -3.9328099228441715e-03 + + -3.3933758735656738e-01 9.3055568635463715e-02 + <_> + + 0 -1 349 3.1205590348690748e-03 + + -2.2794060409069061e-02 2.3793530464172363e-01 + <_> + + 0 -1 350 7.8028678894042969e-02 + + -4.4503621757030487e-02 6.7763942480087280e-01 + <_> + + 0 -1 351 4.2476978152990341e-02 + + 9.2582106590270996e-02 -3.5363018512725830e-01 + <_> + + 0 -1 352 -2.5768300518393517e-02 + + -9.0919911861419678e-01 2.6692839339375496e-02 + <_> + + 0 -1 353 6.1444669961929321e-02 + + -2.4954399093985558e-02 7.2120499610900879e-01 + <_> + + 0 -1 354 3.5776318982243538e-03 + + 1.7728990316390991e-01 -1.9723449647426605e-01 + <_> + 38 + -1.4061349630355835e+00 + + <_> + + 0 -1 355 2.8585961461067200e-01 + + -1.5396049618721008e-01 6.6246771812438965e-01 + <_> + + 0 -1 356 9.2271259054541588e-03 + + -1.0746339708566666e-01 4.3118068575859070e-01 + <_> + + 0 -1 357 2.2924109362065792e-03 + + -1.9830130040645599e-01 3.8422289490699768e-01 + <_> + + 0 -1 358 1.4004509896039963e-02 + + -1.9249489903450012e-01 3.4424918889999390e-01 + <_> + + 0 -1 359 9.6023201942443848e-02 + + 1.2990599870681763e-01 -6.0653048753738403e-01 + <_> + + 0 -1 360 6.1803720891475677e-03 + + -1.9046460092067719e-01 1.8918620049953461e-01 + <_> + + 0 -1 361 8.2172285765409470e-03 + + -2.5182679295539856e-01 2.6644590497016907e-01 + <_> + + 0 -1 362 -1.4542760327458382e-03 + + 2.7102690935134888e-01 -1.2041489779949188e-01 + <_> + + 0 -1 363 3.0185449868440628e-03 + + -1.3538609445095062e-01 4.7336030006408691e-01 + <_> + + 0 -1 364 -3.4214779734611511e-03 + + -5.0499719381332397e-01 1.0424809902906418e-01 + <_> + + 0 -1 365 9.5980763435363770e-03 + + -1.0347290337085724e-01 5.8372837305068970e-01 + <_> + + 0 -1 366 4.1849957779049873e-03 + + 5.8896709233522415e-02 -4.6232289075851440e-01 + <_> + + 0 -1 367 -4.6107750385999680e-03 + + 3.7835618853569031e-01 -1.2590229511260986e-01 + <_> + + 0 -1 368 2.8978679329156876e-03 + + -1.3699549436569214e-01 2.5951480865478516e-01 + <_> + + 0 -1 369 4.2606070637702942e-03 + + 8.8233962655067444e-02 -6.3902848958969116e-01 + <_> + + 0 -1 370 -4.2996238917112350e-03 + + -7.9539728164672852e-01 1.7093559727072716e-02 + <_> + + 0 -1 371 3.5423618555068970e-01 + + -5.9345040470361710e-02 8.5579198598861694e-01 + <_> + + 0 -1 372 -3.0245838570408523e-04 + + 3.1470650434494019e-01 -1.4486099779605865e-01 + <_> + + 0 -1 373 2.7169490233063698e-02 + + -1.2492950260639191e-01 4.2809039354324341e-01 + <_> + + 0 -1 374 3.4571529831737280e-03 + + 3.9709329605102539e-02 -7.0891571044921875e-01 + <_> + + 0 -1 375 2.1742798853665590e-03 + + 6.5872453153133392e-02 -6.9496941566467285e-01 + <_> + + 0 -1 376 2.5263810530304909e-02 + + -1.1693959683179855e-01 1.9049769639968872e-01 + <_> + + 0 -1 377 -2.4720989167690277e-02 + + -4.9657958745956421e-01 1.0175380110740662e-01 + <_> + + 0 -1 378 1.0384880006313324e-02 + + -1.1486739665269852e-01 3.3741530776023865e-01 + <_> + + 0 -1 379 5.0045028328895569e-03 + + -1.0963550209999084e-01 3.9255198836326599e-01 + <_> + + 0 -1 380 7.1279620751738548e-03 + + -6.4908191561698914e-02 4.0420401096343994e-01 + <_> + + 0 -1 381 1.9700419157743454e-02 + + -7.9375877976417542e-02 5.3082340955734253e-01 + <_> + + 0 -1 382 4.2097331024706364e-03 + + 4.0797021239995956e-02 -6.0440987348556519e-01 + <_> + + 0 -1 383 4.4459570199251175e-03 + + -1.0386230051517487e-01 4.0935981273651123e-01 + <_> + + 0 -1 384 -5.9610428288578987e-03 + + -5.2914947271347046e-01 8.0539450049400330e-02 + <_> + + 0 -1 385 5.7519221445545554e-04 + + 6.3804402947425842e-02 -5.8636617660522461e-01 + <_> + + 0 -1 386 6.0524851083755493e-02 + + -3.3712800592184067e-02 2.6311159133911133e-01 + <_> + + 0 -1 387 -1.0353810153901577e-02 + + -4.7920021414756775e-01 8.0043956637382507e-02 + <_> + + 0 -1 388 -2.2777510806918144e-02 + + -3.1162750720977783e-01 1.1899980157613754e-01 + <_> + + 0 -1 389 -2.2468879818916321e-02 + + -6.6083461046218872e-01 5.2234489470720291e-02 + <_> + + 0 -1 390 5.8432162040844560e-04 + + 5.4630339145660400e-02 -4.6395659446716309e-01 + <_> + + 0 -1 391 -3.6177870351821184e-03 + + 6.7447042465209961e-01 -5.8789528906345367e-02 + <_> + + 0 -1 392 3.0088860541582108e-02 + + 3.3133521676063538e-02 -4.6461370587348938e-01 + <_> + 40 + -1.3384460210800171e+00 + + <_> + + 0 -1 393 -7.2600990533828735e-02 + + 6.3907092809677124e-01 -1.5124550461769104e-01 + <_> + + 0 -1 394 3.4712558984756470e-01 + + -7.9024657607078552e-02 7.9550421237945557e-01 + <_> + + 0 -1 395 3.4297230839729309e-01 + + -1.2300959974527359e-01 6.5728098154067993e-01 + <_> + + 0 -1 396 3.5616940259933472e-01 + + -5.3733438253402710e-02 8.2851082086563110e-01 + <_> + + 0 -1 397 6.0840700753033161e-03 + + -1.2847210466861725e-01 3.3822679519653320e-01 + <_> + + 0 -1 398 -1.6281309945043176e-04 + + 3.0356609821319580e-01 -2.5182029604911804e-01 + <_> + + 0 -1 399 1.1281900107860565e-02 + + -8.3914346992969513e-02 4.3475928902626038e-01 + <_> + + 0 -1 400 7.4357059784233570e-03 + + -6.7088037729263306e-02 3.7227979302406311e-01 + <_> + + 0 -1 401 -9.0576216578483582e-02 + + -5.8319610357284546e-01 8.0146759748458862e-02 + <_> + + 0 -1 402 8.8247694075107574e-03 + + 1.2901930510997772e-01 -4.7603130340576172e-01 + <_> + + 0 -1 403 -2.6147770695388317e-03 + + -4.0002208948135376e-01 1.1246310174465179e-01 + <_> + + 0 -1 404 -2.5541300419718027e-04 + + 3.2386159896850586e-01 -2.3331870138645172e-01 + <_> + + 0 -1 405 2.6547629386186600e-02 + + 7.2333872318267822e-02 -5.8378398418426514e-01 + <_> + + 0 -1 406 -5.1383141428232193e-02 + + -2.2446189820766449e-01 4.0949739515781403e-02 + <_> + + 0 -1 407 3.3701129723340273e-03 + + -1.6717089712619781e-01 2.5526970624923706e-01 + <_> + + 0 -1 408 -2.2581920493394136e-03 + + -9.2079228162765503e-01 3.4371060319244862e-03 + <_> + + 0 -1 409 -1.3282749569043517e-04 + + 1.8573220074176788e-01 -2.2498969733715057e-01 + <_> + + 0 -1 410 -2.8032590635120869e-03 + + -8.5897541046142578e-01 4.6384520828723907e-02 + <_> + + 0 -1 411 1.3141379458829761e-03 + + 7.9627066850662231e-02 -4.6105968952178955e-01 + <_> + + 0 -1 412 6.3884541392326355e-02 + + -5.3440149873495102e-02 8.1045001745223999e-01 + <_> + + 0 -1 413 -1.9811019301414490e-03 + + -6.3825148344039917e-01 7.6643556356430054e-02 + <_> + + 0 -1 414 1.3359859585762024e-02 + + -9.5037549734115601e-02 6.2533348798751831e-02 + <_> + + 0 -1 415 -1.0935300088021904e-04 + + 1.7479540407657623e-01 -2.2876030206680298e-01 + <_> + + 0 -1 416 1.1910630390048027e-02 + + -7.7041983604431152e-02 5.0458377599716187e-01 + <_> + + 0 -1 417 2.3951700329780579e-01 + + -6.5122887492179871e-02 5.0420749187469482e-01 + <_> + + 0 -1 418 3.9831408858299255e-01 + + -2.9999820515513420e-02 7.9685479402542114e-01 + <_> + + 0 -1 419 6.1875800602138042e-03 + + -8.5339173674583435e-02 3.9451768994331360e-01 + <_> + + 0 -1 420 -9.4047123566269875e-03 + + -4.3441331386566162e-01 8.2619100809097290e-02 + <_> + + 0 -1 421 1.1736630462110043e-02 + + 6.9483160972595215e-02 -4.8706498742103577e-01 + <_> + + 0 -1 422 -1.5176770277321339e-02 + + -5.8541208505630493e-01 3.2879561185836792e-02 + <_> + + 0 -1 423 3.0744259711354971e-03 + + -1.3146080076694489e-01 2.5466740131378174e-01 + <_> + + 0 -1 424 2.9391339048743248e-03 + + -1.0860230028629303e-01 2.7834960818290710e-01 + <_> + + 0 -1 425 2.1510310471057892e-03 + + -1.5750579535961151e-01 2.0877860486507416e-01 + <_> + + 0 -1 426 5.3775361739099026e-03 + + -1.3207030296325684e-01 3.7672939896583557e-01 + <_> + + 0 -1 427 2.2174179553985596e-02 + + -9.0180292725563049e-02 4.1575270891189575e-01 + <_> + + 0 -1 428 -1.9948610570281744e-03 + + 2.5608581304550171e-01 -9.9084928631782532e-02 + <_> + + 0 -1 429 3.1557559967041016e-02 + + 7.4188999831676483e-02 -5.4940229654312134e-01 + <_> + + 0 -1 430 -4.3111158447572961e-05 + + 3.0324628949165344e-01 -1.7781810462474823e-01 + <_> + + 0 -1 431 -3.2675920519977808e-03 + + -6.7212432622909546e-01 5.9188328683376312e-02 + <_> + + 0 -1 432 4.2293380829505622e-04 + + -1.1034099757671356e-01 1.2573179602622986e-01 + <_> + 45 + -1.2722699642181396e+00 + + <_> + + 0 -1 433 -4.2562019079923630e-02 + + 3.3346658945083618e-01 -2.9861980676651001e-01 + <_> + + 0 -1 434 4.1827198863029480e-01 + + -9.5138698816299438e-02 7.5709921121597290e-01 + <_> + + 0 -1 435 -2.0256379619240761e-02 + + 4.7783890366554260e-01 -1.4592100679874420e-01 + <_> + + 0 -1 436 -1.8948309123516083e-02 + + -3.8727501034736633e-01 5.2479889243841171e-02 + <_> + + 0 -1 437 -4.0550589561462402e-02 + + 5.4646247625350952e-01 -8.1399857997894287e-02 + <_> + + 0 -1 438 5.1872748136520386e-01 + + -2.7930539101362228e-02 8.4580981731414795e-01 + <_> + + 0 -1 439 2.0713619887828827e-01 + + -5.8850869536399841e-02 7.9601562023162842e-01 + <_> + + 0 -1 440 8.1972572952508926e-03 + + -9.9966369569301605e-02 4.9831560254096985e-01 + <_> + + 0 -1 441 1.7445389181375504e-02 + + 6.8040959537029266e-02 -5.6699818372726440e-01 + <_> + + 0 -1 442 -5.6310281157493591e-02 + + -6.8628042936325073e-01 7.4222557246685028e-02 + <_> + + 0 -1 443 1.8095560371875763e-01 + + -5.2808128297328949e-02 8.4483182430267334e-01 + <_> + + 0 -1 444 -2.3450690787285566e-03 + + 2.8396940231323242e-01 -1.1123369634151459e-01 + <_> + + 0 -1 445 3.8937770295888186e-03 + + 6.5499313175678253e-02 -5.7920962572097778e-01 + <_> + + 0 -1 446 3.9383721741614863e-05 + + -3.0930471420288086e-01 4.2237108945846558e-01 + <_> + + 0 -1 447 3.3899158239364624e-02 + + 3.0707539990544319e-02 -7.2299808263778687e-01 + <_> + + 0 -1 448 -3.3644389361143112e-02 + + 4.2664441466331482e-01 -7.2005778551101685e-02 + <_> + + 0 -1 449 3.8807760924100876e-02 + + -4.1713520884513855e-02 6.5995568037033081e-01 + <_> + + 0 -1 450 -3.9149548683781177e-05 + + 4.9335500597953796e-01 -2.4260109663009644e-01 + <_> + + 0 -1 451 -2.7580570895224810e-04 + + 1.7910109460353851e-01 -2.1925190091133118e-01 + <_> + + 0 -1 452 1.2636659666895866e-02 + + -7.1233622729778290e-02 2.5342619419097900e-01 + <_> + + 0 -1 453 -3.3681739587336779e-03 + + 3.3100861310958862e-01 -1.0207779705524445e-01 + <_> + + 0 -1 454 -4.1184529662132263e-02 + + -4.7871989011764526e-01 2.7444809675216675e-02 + <_> + + 0 -1 455 1.7285279929637909e-02 + + -2.3733820021152496e-01 1.5414300560951233e-01 + <_> + + 0 -1 456 -5.8373320847749710e-02 + + 3.6355251073837280e-01 -6.2911927700042725e-02 + <_> + + 0 -1 457 2.5229319930076599e-02 + + -9.4345822930335999e-02 4.3224421143531799e-01 + <_> + + 0 -1 458 4.7925519756972790e-03 + + 4.8664271831512451e-02 -4.7046890854835510e-01 + <_> + + 0 -1 459 -1.3549529830925167e-04 + + 1.9361880421638489e-01 -1.9338470697402954e-01 + <_> + + 0 -1 460 -1.7969410866498947e-02 + + 2.9000860452651978e-01 -5.4545279592275620e-02 + <_> + + 0 -1 461 1.1141040362417698e-02 + + -1.0802250355482101e-01 3.3327960968017578e-01 + <_> + + 0 -1 462 3.9759509265422821e-02 + + 1.9240869209170341e-02 -4.8899960517883301e-01 + <_> + + 0 -1 463 -2.2652709856629372e-02 + + -5.0369280576705933e-01 8.0773733556270599e-02 + <_> + + 0 -1 464 1.0915650054812431e-03 + + 6.5554052591323853e-02 -2.4443879723548889e-01 + <_> + + 0 -1 465 6.8754747509956360e-02 + + 8.9196808636188507e-02 -3.5653901100158691e-01 + <_> + + 0 -1 466 -3.3071058988571167e-01 + + 4.6495699882507324e-01 -5.8183699846267700e-02 + <_> + + 0 -1 467 -1.9307229667901993e-02 + + -4.4157180190086365e-01 8.3050116896629333e-02 + <_> + + 0 -1 468 3.4808758646249771e-02 + + 5.3480580449104309e-02 -5.0377398729324341e-01 + <_> + + 0 -1 469 -3.8908151327632368e-04 + + 3.4271261096000671e-01 -8.9923180639743805e-02 + <_> + + 0 -1 470 -2.1421869751065969e-03 + + -6.0642802715301514e-01 5.5589240044355392e-02 + <_> + + 0 -1 471 1.1015810072422028e-01 + + -5.4774720221757889e-02 6.8780910968780518e-01 + <_> + + 0 -1 472 3.0875208904035389e-04 + + -5.5834218859672546e-02 9.3168236315250397e-02 + <_> + + 0 -1 473 2.1960400044918060e-03 + + 5.3955748677253723e-02 -6.0503059625625610e-01 + <_> + + 0 -1 474 -1.2606250122189522e-02 + + -4.6864029765129089e-01 5.9943869709968567e-02 + <_> + + 0 -1 475 -2.7497899718582630e-03 + + 2.8942531347274780e-01 -1.1297850310802460e-01 + <_> + + 0 -1 476 6.0962641239166260e-01 + + -4.7885991632938385e-02 5.9465491771697998e-01 + <_> + + 0 -1 477 4.5023251324892044e-02 + + 6.3831068575382233e-02 -5.2956801652908325e-01 + <_> + 44 + -1.3022350072860718e+00 + + <_> + + 0 -1 478 1.5907280147075653e-02 + + -3.8192328810691833e-01 2.9411768913269043e-01 + <_> + + 0 -1 479 -3.0483009293675423e-02 + + 6.4014548063278198e-01 -1.1338239908218384e-01 + <_> + + 0 -1 480 2.5841239839792252e-02 + + -1.7654690146446228e-01 2.5563400983810425e-01 + <_> + + 0 -1 481 1.2160619720816612e-02 + + -4.9461990594863892e-02 3.4733989834785461e-01 + <_> + + 0 -1 482 -1.5910159796476364e-02 + + 4.7966769337654114e-01 -1.3009509444236755e-01 + <_> + + 0 -1 483 3.5282061435282230e-04 + + -3.4184929728507996e-01 2.3091129958629608e-01 + <_> + + 0 -1 484 6.7633582511916757e-04 + + -1.5432509779930115e-01 2.6687300205230713e-01 + <_> + + 0 -1 485 -5.9936139732599258e-02 + + -4.8802581429481506e-01 9.3327447772026062e-02 + <_> + + 0 -1 486 -1.1342409998178482e-01 + + -6.5771442651748657e-01 5.9166818857192993e-02 + <_> + + 0 -1 487 -4.3361280113458633e-03 + + -1.5936520695686340e-01 5.0237040966749191e-02 + <_> + + 0 -1 488 -1.8627740209922194e-03 + + 3.0730259418487549e-01 -1.2540669739246368e-01 + <_> + + 0 -1 489 1.2653009966015816e-02 + + -1.0044930130243301e-01 3.7496179342269897e-01 + <_> + + 0 -1 490 6.9118577241897583e-01 + + -4.7146409749984741e-02 8.3212441205978394e-01 + <_> + + 0 -1 491 -2.6093868655152619e-04 + + 3.1987738609313965e-01 -2.7183309197425842e-01 + <_> + + 0 -1 492 -7.6345056295394897e-02 + + 4.3091300129890442e-01 -9.0888269245624542e-02 + <_> + + 0 -1 493 2.8098300099372864e-03 + + 5.8731120079755783e-02 -6.1996752023696899e-01 + <_> + + 0 -1 494 -1.3322039740160108e-04 + + 2.0000059902667999e-01 -2.0120109617710114e-01 + <_> + + 0 -1 495 -1.3717629946768284e-02 + + -7.3095452785491943e-01 2.7178529649972916e-02 + <_> + + 0 -1 496 -6.2303808517754078e-03 + + -5.4780989885330200e-01 6.8749949336051941e-02 + <_> + + 0 -1 497 4.9922719597816467e-02 + + -4.7304309904575348e-02 8.2423102855682373e-01 + <_> + + 0 -1 498 -1.9126719562336802e-03 + + -5.3940171003341675e-01 7.7447593212127686e-02 + <_> + + 0 -1 499 1.1384560493752360e-03 + + -9.6537686884403229e-02 1.5485690534114838e-01 + <_> + + 0 -1 500 -2.4732090532779694e-03 + + 3.5590788722038269e-01 -9.3169830739498138e-02 + <_> + + 0 -1 501 -7.1464257780462503e-04 + + 1.4520190656185150e-01 -7.4194207787513733e-02 + <_> + + 0 -1 502 -2.0437149330973625e-02 + + 4.4163769483566284e-01 -8.0942437052726746e-02 + <_> + + 0 -1 503 -4.0483791381120682e-03 + + -5.9992778301239014e-01 3.3025380223989487e-02 + <_> + + 0 -1 504 1.1148050427436829e-02 + + -1.1358329653739929e-01 3.2644999027252197e-01 + <_> + + 0 -1 505 9.8842009902000427e-03 + + 5.5404480546712875e-02 -3.2730978727340698e-01 + <_> + + 0 -1 506 3.1296359375119209e-03 + + 7.7408656477928162e-02 -4.5953071117401123e-01 + <_> + + 0 -1 507 2.9721839819103479e-03 + + -1.2917269766330719e-01 1.5523110330104828e-01 + <_> + + 0 -1 508 2.0554479211568832e-02 + + 8.7600469589233398e-02 -4.5774188637733459e-01 + <_> + + 0 -1 509 -2.3027280345559120e-02 + + 3.5488089919090271e-01 -2.0566919818520546e-02 + <_> + + 0 -1 510 -8.3903772756457329e-03 + + -4.3240728974342346e-01 9.2067979276180267e-02 + <_> + + 0 -1 511 -1.1431539896875620e-03 + + 3.9591339230537415e-01 -2.3192889988422394e-02 + <_> + + 0 -1 512 -4.9133709399029613e-04 + + 4.2749640345573425e-01 -8.5524216294288635e-02 + <_> + + 0 -1 513 5.1292928401380777e-04 + + -1.6196739673614502e-01 1.9614970684051514e-01 + <_> + + 0 -1 514 -5.8478871360421181e-03 + + -5.9116369485855103e-01 6.2448240816593170e-02 + <_> + + 0 -1 515 -9.4133049249649048e-02 + + 4.7701609134674072e-01 -5.6710161268711090e-02 + <_> + + 0 -1 516 1.0079269850393757e-04 + + -1.6257099807262421e-01 2.1402290463447571e-01 + <_> + + 0 -1 517 3.2930231100181118e-05 + + -1.8596050143241882e-01 1.9647690653800964e-01 + <_> + + 0 -1 518 -1.1743210052372888e-04 + + 3.1821349263191223e-01 -1.3287380337715149e-01 + <_> + + 0 -1 519 1.2751810252666473e-01 + + 3.0140079557895660e-02 -7.4110358953475952e-01 + <_> + + 0 -1 520 8.0326296389102936e-02 + + 4.1555039584636688e-02 -8.2636839151382446e-01 + <_> + + 0 -1 521 1.6904190415516496e-03 + + -1.0290619730949402e-01 2.9724180698394775e-01 + <_> + 47 + -1.1933319568634033e+00 + + <_> + + 0 -1 522 -4.6122789382934570e-02 + + 4.4252589344978333e-01 -2.9913198947906494e-01 + <_> + + 0 -1 523 3.6723318696022034e-01 + + -6.3011750578880310e-02 7.7125382423400879e-01 + <_> + + 0 -1 524 -3.0962929595261812e-03 + + 3.5142418742179871e-01 -1.7306439578533173e-01 + <_> + + 0 -1 525 9.2647131532430649e-03 + + -1.6072809696197510e-01 1.8532909452915192e-01 + <_> + + 0 -1 526 3.1748649198561907e-03 + + -1.9688999652862549e-01 2.4097280204296112e-01 + <_> + + 0 -1 527 8.0439839512109756e-03 + + 8.9862972497940063e-02 -3.6552259325981140e-01 + <_> + + 0 -1 528 3.2752490043640137e-01 + + -5.6879680603742599e-02 7.7493369579315186e-01 + <_> + + 0 -1 529 -1.9074430689215660e-02 + + -2.8953808546066284e-01 6.2291670590639114e-02 + <_> + + 0 -1 530 -2.0501749590039253e-02 + + -6.2625300884246826e-01 6.8276971578598022e-02 + <_> + + 0 -1 531 5.3187010053079575e-05 + + -2.5149559974670410e-01 2.6131960749626160e-01 + <_> + + 0 -1 532 3.3275580499321222e-03 + + -1.1990779638290405e-01 3.6519300937652588e-01 + <_> + + 0 -1 533 5.8408430777490139e-03 + + -8.2748517394065857e-02 2.3650820553302765e-01 + <_> + + 0 -1 534 -4.6462330967187881e-02 + + -6.9285649061203003e-01 7.8197672963142395e-02 + <_> + + 0 -1 535 -3.7785700988024473e-03 + + 3.4372571110725403e-01 -1.0275450348854065e-01 + <_> + + 0 -1 536 1.6655459767207503e-03 + + -1.1605279892683029e-01 3.7162029743194580e-01 + <_> + + 0 -1 537 -5.7107670727418736e-05 + + 4.5893669128417969e-01 -2.1236430108547211e-01 + <_> + + 0 -1 538 -9.0066380798816681e-03 + + -5.9533411264419556e-01 8.0876402556896210e-02 + <_> + + 0 -1 539 -1.3789710402488708e-01 + + 3.9570671319961548e-01 -8.9885376393795013e-02 + <_> + + 0 -1 540 5.7599872350692749e-01 + + -5.3810819983482361e-02 8.1703948974609375e-01 + <_> + + 0 -1 541 -2.3918158840388060e-03 + + 1.3933740556240082e-01 -4.2155928909778595e-02 + <_> + + 0 -1 542 2.4896071408875287e-04 + + -1.4858660101890564e-01 2.6263329386711121e-01 + <_> + + 0 -1 543 3.3062491565942764e-02 + + 3.0659910291433334e-02 -3.2318601012229919e-01 + <_> + + 0 -1 544 4.4321879744529724e-02 + + 4.7853820025920868e-02 -7.8135901689529419e-01 + <_> + + 0 -1 545 -1.8718190491199493e-02 + + 1.2012620270252228e-01 -1.1211469769477844e-01 + <_> + + 0 -1 546 9.2309370636940002e-02 + + 4.2463079094886780e-02 -8.0097001791000366e-01 + <_> + + 0 -1 547 9.0665437281131744e-02 + + -2.2304529324173927e-02 1.2847979366779327e-01 + <_> + + 0 -1 548 -5.8294929563999176e-02 + + -3.9368540048599243e-01 9.5482140779495239e-02 + <_> + + 0 -1 549 4.6649780124425888e-03 + + -6.5641947090625763e-02 3.6407178640365601e-01 + <_> + + 0 -1 550 5.2480432204902172e-03 + + 6.8765781819820404e-02 -5.0508302450180054e-01 + <_> + + 0 -1 551 2.5315659586340189e-03 + + -9.3347169458866119e-02 1.6496129333972931e-01 + <_> + + 0 -1 552 2.4391160695813596e-04 + + -1.8885439634323120e-01 1.6956700384616852e-01 + <_> + + 0 -1 553 -6.3037211075425148e-03 + + 3.8263529539108276e-01 -5.9042099863290787e-02 + <_> + + 0 -1 554 2.2754059173166752e-03 + + -1.2248820066452026e-01 2.8283658623695374e-01 + <_> + + 0 -1 555 -2.7694869041442871e-01 + + 4.8514971137046814e-01 -4.0482539683580399e-02 + <_> + + 0 -1 556 5.8051547966897488e-03 + + -8.3558417856693268e-02 4.2151498794555664e-01 + <_> + + 0 -1 557 2.4654529988765717e-03 + + -1.2816859781742096e-01 2.0776629447937012e-01 + <_> + + 0 -1 558 7.8863510861992836e-03 + + -1.7197540402412415e-01 2.0790819823741913e-01 + <_> + + 0 -1 559 -1.1817130260169506e-02 + + -5.7880669832229614e-01 5.8959141373634338e-02 + <_> + + 0 -1 560 -6.4139917492866516e-02 + + -6.3689261674880981e-01 4.1797500103712082e-02 + <_> + + 0 -1 561 -1.2179970508441329e-03 + + 2.3568700253963470e-01 -8.0515258014202118e-02 + <_> + + 0 -1 562 2.8652620967477560e-03 + + -9.3137197196483612e-02 3.9025950431823730e-01 + <_> + + 0 -1 563 -5.7746102102100849e-03 + + -5.7539868354797363e-01 5.9677690267562866e-02 + <_> + + 0 -1 564 6.5377086400985718e-02 + + 3.4166071563959122e-02 -7.4253422021865845e-01 + <_> + + 0 -1 565 1.6265710815787315e-02 + + 5.3654260933399200e-02 -2.3658609390258789e-01 + <_> + + 0 -1 566 2.2717609535902739e-03 + + 5.3359109908342361e-02 -5.4940742254257202e-01 + <_> + + 0 -1 567 2.2626020014286041e-01 + + -4.2046058923006058e-02 7.7912521362304688e-01 + <_> + + 0 -1 568 -2.9377460479736328e-02 + + -5.9470587968826294e-01 5.4817870259284973e-02 + + <_> + + <_> + 0 0 2 4 -1. + <_> + 0 2 2 2 2. + <_> + + <_> + 34 10 2 8 -1. + <_> + 34 14 2 4 2. + <_> + + <_> + 0 10 2 8 -1. + <_> + 0 14 2 4 2. + <_> + + <_> + 15 0 18 10 -1. + <_> + 24 0 9 5 2. + <_> + 15 5 9 5 2. + <_> + + <_> + 7 0 4 4 -1. + <_> + 7 0 2 4 2. + 1 + <_> + + <_> + 15 5 6 4 -1. + <_> + 15 6 6 2 2. + <_> + + <_> + 13 6 8 3 -1. + <_> + 13 7 8 1 3. + <_> + + <_> + 14 6 8 4 -1. + <_> + 14 7 8 2 2. + <_> + + <_> + 0 10 2 8 -1. + <_> + 0 14 2 4 2. + <_> + + <_> + 34 0 2 16 -1. + <_> + 35 0 1 8 2. + <_> + 34 8 1 8 2. + <_> + + <_> + 1 0 4 7 -1. + <_> + 3 0 2 7 2. + <_> + + <_> + 4 7 28 3 -1. + <_> + 11 7 14 3 2. + <_> + + <_> + 34 0 2 2 -1. + <_> + 34 1 2 1 2. + <_> + + <_> + 0 12 4 6 -1. + <_> + 0 15 4 3 2. + <_> + + <_> + 34 0 2 2 -1. + <_> + 34 1 2 1 2. + <_> + + <_> + 0 0 2 2 -1. + <_> + 0 1 2 1 2. + <_> + + <_> + 17 5 9 12 -1. + <_> + 20 5 3 12 3. + <_> + + <_> + 10 5 9 12 -1. + <_> + 13 5 3 12 3. + <_> + + <_> + 4 0 32 1 -1. + <_> + 4 0 16 1 2. + <_> + + <_> + 0 0 3 3 -1. + <_> + 1 0 1 3 3. + <_> + + <_> + 32 7 4 7 -1. + <_> + 33 8 2 7 2. + 1 + <_> + + <_> + 7 0 8 6 -1. + <_> + 7 0 4 3 2. + <_> + 11 3 4 3 2. + <_> + + <_> + 0 0 2 2 -1. + <_> + 0 1 2 1 2. + <_> + + <_> + 27 1 8 9 -1. + <_> + 29 3 4 9 2. + 1 + <_> + + <_> + 1 10 1 8 -1. + <_> + 1 14 1 4 2. + <_> + + <_> + 3 6 30 9 -1. + <_> + 13 9 10 3 9. + <_> + + <_> + 12 5 8 6 -1. + <_> + 12 7 8 2 3. + <_> + + <_> + 16 4 6 3 -1. + <_> + 16 5 6 1 3. + <_> + + <_> + 0 0 2 18 -1. + <_> + 0 0 1 9 2. + <_> + 1 9 1 9 2. + <_> + + <_> + 34 2 2 14 -1. + <_> + 35 2 1 7 2. + <_> + 34 9 1 7 2. + <_> + + <_> + 0 2 2 14 -1. + <_> + 0 2 1 7 2. + <_> + 1 9 1 7 2. + <_> + + <_> + 35 0 1 4 -1. + <_> + 35 2 1 2 2. + <_> + + <_> + 5 0 24 18 -1. + <_> + 5 0 12 9 2. + <_> + 17 9 12 9 2. + <_> + + <_> + 35 16 1 2 -1. + <_> + 35 17 1 1 2. + <_> + + <_> + 0 16 1 2 -1. + <_> + 0 17 1 1 2. + <_> + + <_> + 17 6 8 12 -1. + <_> + 19 6 4 12 2. + <_> + + <_> + 11 5 8 13 -1. + <_> + 13 5 4 13 2. + <_> + + <_> + 35 16 1 2 -1. + <_> + 35 17 1 1 2. + <_> + + <_> + 10 9 12 3 -1. + <_> + 10 10 12 1 3. + <_> + + <_> + 0 10 1 8 -1. + <_> + 0 14 1 4 2. + <_> + + <_> + 20 0 10 10 -1. + <_> + 25 0 5 5 2. + <_> + 20 5 5 5 2. + <_> + + <_> + 0 0 1 4 -1. + <_> + 0 2 1 2 2. + <_> + + <_> + 19 0 13 18 -1. + <_> + 19 9 13 9 2. + <_> + + <_> + 4 0 14 6 -1. + <_> + 4 0 7 3 2. + <_> + 11 3 7 3 2. + <_> + + <_> + 16 5 6 6 -1. + <_> + 16 7 6 2 3. + <_> + + <_> + 13 7 7 8 -1. + <_> + 13 9 7 4 2. + <_> + + <_> + 33 0 3 1 -1. + <_> + 34 0 1 1 3. + <_> + + <_> + 7 1 10 4 -1. + <_> + 6 2 10 2 2. + 1 + <_> + + <_> + 15 2 6 16 -1. + <_> + 18 2 3 8 2. + <_> + 15 10 3 8 2. + <_> + + <_> + 0 10 1 8 -1. + <_> + 0 14 1 4 2. + <_> + + <_> + 27 4 6 6 -1. + <_> + 29 6 2 6 3. + 1 + <_> + + <_> + 14 5 8 8 -1. + <_> + 16 5 4 8 2. + <_> + + <_> + 27 5 6 6 -1. + <_> + 29 7 2 6 3. + 1 + <_> + + <_> + 9 5 6 6 -1. + <_> + 7 7 6 2 3. + 1 + <_> + + <_> + 12 5 12 9 -1. + <_> + 15 5 6 9 2. + <_> + + <_> + 0 0 3 1 -1. + <_> + 1 0 1 1 3. + <_> + + <_> + 15 4 18 6 -1. + <_> + 15 6 18 2 3. + <_> + + <_> + 0 10 1 6 -1. + <_> + 0 13 1 3 2. + <_> + + <_> + 3 6 30 6 -1. + <_> + 13 8 10 2 9. + <_> + + <_> + 11 7 12 4 -1. + <_> + 11 8 12 2 2. + <_> + + <_> + 14 8 9 3 -1. + <_> + 14 9 9 1 3. + <_> + + <_> + 14 8 7 4 -1. + <_> + 14 9 7 2 2. + <_> + + <_> + 12 7 18 6 -1. + <_> + 12 9 18 2 3. + <_> + + <_> + 7 8 3 10 -1. + <_> + 7 13 3 5 2. + <_> + + <_> + 35 10 1 6 -1. + <_> + 35 13 1 3 2. + <_> + + <_> + 0 10 1 6 -1. + <_> + 0 13 1 3 2. + <_> + + <_> + 18 13 9 5 -1. + <_> + 21 13 3 5 3. + <_> + + <_> + 15 9 6 4 -1. + <_> + 15 10 6 2 2. + <_> + + <_> + 16 4 18 8 -1. + <_> + 16 6 18 4 2. + <_> + + <_> + 9 14 9 3 -1. + <_> + 12 14 3 3 3. + <_> + + <_> + 32 0 4 6 -1. + <_> + 32 0 2 6 2. + <_> + + <_> + 0 0 4 6 -1. + <_> + 2 0 2 6 2. + <_> + + <_> + 27 0 6 7 -1. + <_> + 29 2 2 7 3. + 1 + <_> + + <_> + 0 0 1 4 -1. + <_> + 0 2 1 2 2. + <_> + + <_> + 27 8 6 4 -1. + <_> + 29 10 2 4 3. + 1 + <_> + + <_> + 4 9 27 6 -1. + <_> + 13 11 9 2 9. + <_> + + <_> + 31 14 2 3 -1. + <_> + 31 14 1 3 2. + <_> + + <_> + 10 0 5 6 -1. + <_> + 8 2 5 2 3. + 1 + <_> + + <_> + 14 7 11 3 -1. + <_> + 14 8 11 1 3. + <_> + + <_> + 0 12 2 6 -1. + <_> + 0 15 2 3 2. + <_> + + <_> + 34 13 2 4 -1. + <_> + 34 15 2 2 2. + <_> + + <_> + 0 13 2 4 -1. + <_> + 0 15 2 2 2. + <_> + + <_> + 3 6 4 12 -1. + <_> + 3 10 4 4 3. + <_> + + <_> + 14 0 22 12 -1. + <_> + 25 0 11 6 2. + <_> + 14 6 11 6 2. + <_> + + <_> + 8 1 7 6 -1. + <_> + 6 3 7 2 3. + 1 + <_> + + <_> + 12 5 14 3 -1. + <_> + 12 6 14 1 3. + <_> + + <_> + 7 6 7 4 -1. + <_> + 6 7 7 2 2. + 1 + <_> + + <_> + 18 3 6 4 -1. + <_> + 18 4 6 2 2. + <_> + + <_> + 4 5 5 6 -1. + <_> + 4 7 5 2 3. + <_> + + <_> + 33 0 3 4 -1. + <_> + 34 0 1 4 3. + <_> + + <_> + 9 0 6 18 -1. + <_> + 9 9 6 9 2. + <_> + + <_> + 6 6 24 6 -1. + <_> + 14 8 8 2 9. + <_> + + <_> + 16 8 4 4 -1. + <_> + 16 9 4 2 2. + <_> + + <_> + 13 8 13 4 -1. + <_> + 13 9 13 2 2. + <_> + + <_> + 0 16 2 2 -1. + <_> + 0 17 2 1 2. + <_> + + <_> + 35 14 1 4 -1. + <_> + 35 15 1 2 2. + <_> + + <_> + 0 14 1 4 -1. + <_> + 0 15 1 2 2. + <_> + + <_> + 15 6 9 7 -1. + <_> + 18 6 3 7 3. + <_> + + <_> + 0 0 3 4 -1. + <_> + 1 0 1 4 3. + <_> + + <_> + 34 16 2 2 -1. + <_> + 35 16 1 1 2. + <_> + 34 17 1 1 2. + <_> + + <_> + 0 16 2 2 -1. + <_> + 0 16 1 1 2. + <_> + 1 17 1 1 2. + <_> + + <_> + 22 0 10 4 -1. + <_> + 22 0 5 4 2. + 1 + <_> + + <_> + 15 4 6 14 -1. + <_> + 15 4 3 7 2. + <_> + 18 11 3 7 2. + <_> + + <_> + 15 3 8 10 -1. + <_> + 17 3 4 10 2. + <_> + + <_> + 0 0 2 5 -1. + <_> + 1 0 1 5 2. + <_> + + <_> + 7 1 8 6 -1. + <_> + 5 3 8 2 3. + 1 + <_> + + <_> + 19 0 11 18 -1. + <_> + 19 9 11 9 2. + <_> + + <_> + 6 8 24 6 -1. + <_> + 14 10 8 2 9. + <_> + + <_> + 14 6 10 3 -1. + <_> + 14 7 10 1 3. + <_> + + <_> + 12 7 11 4 -1. + <_> + 12 8 11 2 2. + <_> + + <_> + 18 0 16 6 -1. + <_> + 26 0 8 3 2. + <_> + 18 3 8 3 2. + <_> + + <_> + 5 3 7 3 -1. + <_> + 4 4 7 1 3. + 1 + <_> + + <_> + 18 4 4 4 -1. + <_> + 18 5 4 2 2. + <_> + + <_> + 5 3 10 4 -1. + <_> + 4 4 10 2 2. + 1 + <_> + + <_> + 14 8 8 10 -1. + <_> + 18 8 4 5 2. + <_> + 14 13 4 5 2. + <_> + + <_> + 3 0 4 1 -1. + <_> + 5 0 2 1 2. + <_> + + <_> + 20 0 10 8 -1. + <_> + 25 0 5 4 2. + <_> + 20 4 5 4 2. + <_> + + <_> + 13 0 10 8 -1. + <_> + 13 0 5 4 2. + <_> + 18 4 5 4 2. + <_> + + <_> + 21 5 6 13 -1. + <_> + 23 5 2 13 3. + <_> + + <_> + 9 5 6 13 -1. + <_> + 11 5 2 13 3. + <_> + + <_> + 27 5 5 3 -1. + <_> + 27 6 5 1 3. + <_> + + <_> + 10 0 3 6 -1. + <_> + 10 2 3 2 3. + <_> + + <_> + 26 6 3 6 -1. + <_> + 26 8 3 2 3. + <_> + + <_> + 0 11 36 7 -1. + <_> + 18 11 18 7 2. + <_> + + <_> + 27 5 5 3 -1. + <_> + 27 6 5 1 3. + <_> + + <_> + 4 5 5 3 -1. + <_> + 4 6 5 1 3. + <_> + + <_> + 28 6 4 4 -1. + <_> + 29 7 2 4 2. + 1 + <_> + + <_> + 14 15 8 2 -1. + <_> + 16 15 4 2 2. + <_> + + <_> + 3 5 30 6 -1. + <_> + 13 7 10 2 9. + <_> + + <_> + 6 7 16 6 -1. + <_> + 6 9 16 2 3. + <_> + + <_> + 14 10 12 6 -1. + <_> + 14 12 12 2 3. + <_> + + <_> + 6 0 12 10 -1. + <_> + 6 0 6 5 2. + <_> + 12 5 6 5 2. + <_> + + <_> + 25 2 7 16 -1. + <_> + 25 10 7 8 2. + <_> + + <_> + 9 6 18 7 -1. + <_> + 15 6 6 7 3. + <_> + + <_> + 5 0 26 18 -1. + <_> + 18 0 13 9 2. + <_> + 5 9 13 9 2. + <_> + + <_> + 10 6 10 3 -1. + <_> + 10 7 10 1 3. + <_> + + <_> + 17 6 6 4 -1. + <_> + 17 7 6 2 2. + <_> + + <_> + 15 6 6 7 -1. + <_> + 18 6 3 7 2. + <_> + + <_> + 26 6 5 4 -1. + <_> + 26 7 5 2 2. + <_> + + <_> + 0 12 1 6 -1. + <_> + 0 15 1 3 2. + <_> + + <_> + 9 4 18 14 -1. + <_> + 18 4 9 7 2. + <_> + 9 11 9 7 2. + <_> + + <_> + 7 5 6 3 -1. + <_> + 6 6 6 1 3. + 1 + <_> + + <_> + 27 5 6 3 -1. + <_> + 29 7 2 3 3. + 1 + <_> + + <_> + 7 8 3 3 -1. + <_> + 6 9 3 1 3. + 1 + <_> + + <_> + 28 5 6 5 -1. + <_> + 30 7 2 5 3. + 1 + <_> + + <_> + 8 5 5 6 -1. + <_> + 6 7 5 2 3. + 1 + <_> + + <_> + 31 0 4 1 -1. + <_> + 31 0 2 1 2. + <_> + + <_> + 1 0 4 1 -1. + <_> + 3 0 2 1 2. + <_> + + <_> + 17 11 4 3 -1. + <_> + 17 12 4 1 3. + <_> + + <_> + 12 3 7 4 -1. + <_> + 12 4 7 2 2. + <_> + + <_> + 14 9 9 3 -1. + <_> + 14 10 9 1 3. + <_> + + <_> + 1 17 21 1 -1. + <_> + 8 17 7 1 3. + <_> + + <_> + 12 9 20 4 -1. + <_> + 12 9 10 4 2. + <_> + + <_> + 3 9 22 4 -1. + <_> + 14 9 11 4 2. + <_> + + <_> + 25 0 3 3 -1. + <_> + 26 1 1 3 3. + 1 + <_> + + <_> + 14 9 4 3 -1. + <_> + 14 10 4 1 3. + <_> + + <_> + 19 4 9 3 -1. + <_> + 22 4 3 3 3. + <_> + + <_> + 8 4 9 3 -1. + <_> + 11 4 3 3 3. + <_> + + <_> + 0 15 36 3 -1. + <_> + 12 16 12 1 9. + <_> + + <_> + 2 0 4 2 -1. + <_> + 2 0 4 1 2. + 1 + <_> + + <_> + 19 9 2 9 -1. + <_> + 19 12 2 3 3. + <_> + + <_> + 13 7 8 3 -1. + <_> + 13 8 8 1 3. + <_> + + <_> + 30 4 2 2 -1. + <_> + 31 4 1 1 2. + <_> + 30 5 1 1 2. + <_> + + <_> + 4 4 2 2 -1. + <_> + 4 4 1 1 2. + <_> + 5 5 1 1 2. + <_> + + <_> + 18 7 4 3 -1. + <_> + 18 8 4 1 3. + <_> + + <_> + 9 0 1 8 -1. + <_> + 9 0 1 4 2. + 1 + <_> + + <_> + 25 6 10 3 -1. + <_> + 25 7 10 1 3. + <_> + + <_> + 1 6 10 3 -1. + <_> + 1 7 10 1 3. + <_> + + <_> + 6 6 14 12 -1. + <_> + 6 6 7 6 2. + <_> + 13 12 7 6 2. + <_> + + <_> + 31 14 3 4 -1. + <_> + 31 16 3 2 2. + <_> + + <_> + 1 12 2 4 -1. + <_> + 1 14 2 2 2. + <_> + + <_> + 15 0 12 5 -1. + <_> + 19 0 4 5 3. + <_> + + <_> + 10 0 8 14 -1. + <_> + 12 0 4 14 2. + <_> + + <_> + 28 1 8 7 -1. + <_> + 30 3 4 7 2. + 1 + <_> + + <_> + 8 14 20 4 -1. + <_> + 8 14 10 2 2. + <_> + 18 16 10 2 2. + <_> + + <_> + 6 11 24 3 -1. + <_> + 14 12 8 1 9. + <_> + + <_> + 4 5 27 6 -1. + <_> + 13 7 9 2 9. + <_> + + <_> + 7 0 22 18 -1. + <_> + 18 0 11 9 2. + <_> + 7 9 11 9 2. + <_> + + <_> + 16 0 3 2 -1. + <_> + 16 1 3 1 2. + <_> + + <_> + 0 17 36 1 -1. + <_> + 9 17 18 1 2. + <_> + + <_> + 5 5 12 1 -1. + <_> + 5 5 6 1 2. + 1 + <_> + + <_> + 34 15 2 1 -1. + <_> + 34 15 1 1 2. + 1 + <_> + + <_> + 7 8 16 4 -1. + <_> + 7 9 16 2 2. + <_> + + <_> + 35 10 1 6 -1. + <_> + 35 12 1 2 3. + <_> + + <_> + 13 8 3 4 -1. + <_> + 13 9 3 2 2. + <_> + + <_> + 35 10 1 6 -1. + <_> + 35 12 1 2 3. + <_> + + <_> + 12 0 1 4 -1. + <_> + 11 1 1 2 2. + 1 + <_> + + <_> + 35 10 1 6 -1. + <_> + 35 12 1 2 3. + <_> + + <_> + 18 0 1 14 -1. + <_> + 18 0 1 7 2. + 1 + <_> + + <_> + 5 6 16 12 -1. + <_> + 5 6 8 6 2. + <_> + 13 12 8 6 2. + <_> + + <_> + 18 1 7 8 -1. + <_> + 16 3 7 4 2. + 1 + <_> + + <_> + 14 4 8 10 -1. + <_> + 14 4 4 5 2. + <_> + 18 9 4 5 2. + <_> + + <_> + 22 0 9 3 -1. + <_> + 25 0 3 3 3. + <_> + + <_> + 0 10 26 8 -1. + <_> + 0 10 13 4 2. + <_> + 13 14 13 4 2. + <_> + + <_> + 15 10 16 8 -1. + <_> + 23 10 8 4 2. + <_> + 15 14 8 4 2. + <_> + + <_> + 6 0 24 18 -1. + <_> + 6 0 12 9 2. + <_> + 18 9 12 9 2. + <_> + + <_> + 18 0 9 6 -1. + <_> + 21 0 3 6 3. + <_> + + <_> + 9 0 9 6 -1. + <_> + 12 0 3 6 3. + <_> + + <_> + 30 1 5 14 -1. + <_> + 30 8 5 7 2. + <_> + + <_> + 1 1 5 14 -1. + <_> + 1 8 5 7 2. + <_> + + <_> + 10 8 26 6 -1. + <_> + 23 8 13 3 2. + <_> + 10 11 13 3 2. + <_> + + <_> + 0 8 28 6 -1. + <_> + 0 8 14 3 2. + <_> + 14 11 14 3 2. + <_> + + <_> + 12 0 24 12 -1. + <_> + 24 0 12 6 2. + <_> + 12 6 12 6 2. + <_> + + <_> + 3 1 14 2 -1. + <_> + 3 1 14 1 2. + 1 + <_> + + <_> + 33 16 3 2 -1. + <_> + 33 17 3 1 2. + <_> + + <_> + 12 0 9 14 -1. + <_> + 15 0 3 14 3. + <_> + + <_> + 28 16 8 2 -1. + <_> + 32 16 4 1 2. + <_> + 28 17 4 1 2. + <_> + + <_> + 15 8 6 6 -1. + <_> + 15 10 6 2 3. + <_> + + <_> + 13 6 22 6 -1. + <_> + 24 6 11 3 2. + <_> + 13 9 11 3 2. + <_> + + <_> + 0 10 26 4 -1. + <_> + 0 10 13 2 2. + <_> + 13 12 13 2 2. + <_> + + <_> + 24 16 4 2 -1. + <_> + 24 17 4 1 2. + <_> + + <_> + 9 16 3 2 -1. + <_> + 9 17 3 1 2. + <_> + + <_> + 3 7 18 8 -1. + <_> + 3 7 9 4 2. + <_> + 12 11 9 4 2. + <_> + + <_> + 23 0 8 4 -1. + <_> + 23 0 4 4 2. + <_> + + <_> + 5 0 8 4 -1. + <_> + 9 0 4 4 2. + <_> + + <_> + 6 10 24 3 -1. + <_> + 14 11 8 1 9. + <_> + + <_> + 7 5 5 6 -1. + <_> + 5 7 5 2 3. + 1 + <_> + + <_> + 5 16 26 2 -1. + <_> + 18 16 13 1 2. + <_> + 5 17 13 1 2. + <_> + + <_> + 0 7 24 4 -1. + <_> + 0 7 12 2 2. + <_> + 12 9 12 2 2. + <_> + + <_> + 23 14 13 4 -1. + <_> + 23 15 13 2 2. + <_> + + <_> + 2 10 18 8 -1. + <_> + 2 10 9 4 2. + <_> + 11 14 9 4 2. + <_> + + <_> + 15 10 6 4 -1. + <_> + 15 11 6 2 2. + <_> + + <_> + 0 6 24 2 -1. + <_> + 0 6 12 1 2. + <_> + 12 7 12 1 2. + <_> + + <_> + 17 0 18 18 -1. + <_> + 17 9 18 9 2. + <_> + + <_> + 1 0 11 2 -1. + <_> + 1 1 11 1 2. + <_> + + <_> + 15 6 8 12 -1. + <_> + 19 6 4 6 2. + <_> + 15 12 4 6 2. + <_> + + <_> + 2 1 32 12 -1. + <_> + 2 1 16 6 2. + <_> + 18 7 16 6 2. + <_> + + <_> + 29 10 7 8 -1. + <_> + 29 12 7 4 2. + <_> + + <_> + 12 2 8 10 -1. + <_> + 12 2 4 5 2. + <_> + 16 7 4 5 2. + <_> + + <_> + 15 12 6 4 -1. + <_> + 15 13 6 2 2. + <_> + + <_> + 0 12 8 6 -1. + <_> + 0 14 8 2 3. + <_> + + <_> + 10 9 26 8 -1. + <_> + 23 9 13 4 2. + <_> + 10 13 13 4 2. + <_> + + <_> + 7 8 22 10 -1. + <_> + 7 8 11 5 2. + <_> + 18 13 11 5 2. + <_> + + <_> + 14 9 8 3 -1. + <_> + 14 10 8 1 3. + <_> + + <_> + 11 3 4 9 -1. + <_> + 11 6 4 3 3. + <_> + + <_> + 29 14 2 2 -1. + <_> + 29 14 2 1 2. + 1 + <_> + + <_> + 14 13 8 3 -1. + <_> + 14 14 8 1 3. + <_> + + <_> + 11 3 7 8 -1. + <_> + 9 5 7 4 2. + 1 + <_> + + <_> + 28 13 1 4 -1. + <_> + 28 13 1 2 2. + 1 + <_> + + <_> + 8 13 4 1 -1. + <_> + 8 13 2 1 2. + 1 + <_> + + <_> + 16 9 4 3 -1. + <_> + 16 10 4 1 3. + <_> + + <_> + 13 8 10 4 -1. + <_> + 13 9 10 2 2. + <_> + + <_> + 14 8 8 3 -1. + <_> + 14 9 8 1 3. + <_> + + <_> + 2 10 6 2 -1. + <_> + 4 12 2 2 3. + 1 + <_> + + <_> + 16 10 6 3 -1. + <_> + 16 11 6 1 3. + <_> + + <_> + 8 5 8 13 -1. + <_> + 12 5 4 13 2. + <_> + + <_> + 0 0 36 8 -1. + <_> + 18 0 18 4 2. + <_> + 0 4 18 4 2. + <_> + + <_> + 1 5 8 12 -1. + <_> + 1 5 4 6 2. + <_> + 5 11 4 6 2. + <_> + + <_> + 18 8 18 10 -1. + <_> + 27 8 9 5 2. + <_> + 18 13 9 5 2. + <_> + + <_> + 0 8 18 10 -1. + <_> + 0 8 9 5 2. + <_> + 9 13 9 5 2. + <_> + + <_> + 11 5 14 3 -1. + <_> + 11 6 14 1 3. + <_> + + <_> + 10 6 16 6 -1. + <_> + 10 8 16 2 3. + <_> + + <_> + 7 2 24 16 -1. + <_> + 19 2 12 8 2. + <_> + 7 10 12 8 2. + <_> + + <_> + 0 1 18 15 -1. + <_> + 6 6 6 5 9. + <_> + + <_> + 4 5 16 6 -1. + <_> + 12 5 8 6 2. + <_> + + <_> + 29 0 6 11 -1. + <_> + 31 2 2 11 3. + 1 + <_> + + <_> + 2 8 9 1 -1. + <_> + 5 11 3 1 3. + 1 + <_> + + <_> + 10 6 17 3 -1. + <_> + 10 7 17 1 3. + <_> + + <_> + 18 6 6 2 -1. + <_> + 20 8 2 2 3. + 1 + <_> + + <_> + 13 11 12 3 -1. + <_> + 13 12 12 1 3. + <_> + + <_> + 2 3 8 8 -1. + <_> + 2 3 4 4 2. + <_> + 6 7 4 4 2. + <_> + + <_> + 18 12 18 4 -1. + <_> + 27 12 9 2 2. + <_> + 18 14 9 2 2. + <_> + + <_> + 11 5 11 3 -1. + <_> + 11 6 11 1 3. + <_> + + <_> + 14 7 14 4 -1. + <_> + 14 8 14 2 2. + <_> + + <_> + 9 8 16 10 -1. + <_> + 9 8 8 5 2. + <_> + 17 13 8 5 2. + <_> + + <_> + 18 17 2 1 -1. + <_> + 18 17 1 1 2. + <_> + + <_> + 13 10 5 3 -1. + <_> + 13 11 5 1 3. + <_> + + <_> + 18 17 2 1 -1. + <_> + 18 17 1 1 2. + <_> + + <_> + 7 5 8 3 -1. + <_> + 6 6 8 1 3. + 1 + <_> + + <_> + 18 17 2 1 -1. + <_> + 18 17 1 1 2. + <_> + + <_> + 10 5 5 3 -1. + <_> + 10 6 5 1 3. + <_> + + <_> + 2 5 34 10 -1. + <_> + 19 5 17 5 2. + <_> + 2 10 17 5 2. + <_> + + <_> + 3 2 12 3 -1. + <_> + 6 5 6 3 2. + 1 + <_> + + <_> + 35 6 1 6 -1. + <_> + 35 8 1 2 3. + <_> + + <_> + 10 6 13 6 -1. + <_> + 10 8 13 2 3. + <_> + + <_> + 15 5 6 4 -1. + <_> + 15 6 6 2 2. + <_> + + <_> + 5 2 11 4 -1. + <_> + 4 3 11 2 2. + 1 + <_> + + <_> + 26 6 10 6 -1. + <_> + 31 6 5 3 2. + <_> + 26 9 5 3 2. + <_> + + <_> + 10 7 11 8 -1. + <_> + 10 9 11 4 2. + <_> + + <_> + 28 2 4 9 -1. + <_> + 29 3 2 9 2. + 1 + <_> + + <_> + 8 2 10 4 -1. + <_> + 7 3 10 2 2. + 1 + <_> + + <_> + 31 0 5 2 -1. + <_> + 31 1 5 1 2. + <_> + + <_> + 10 6 16 12 -1. + <_> + 10 10 16 4 3. + <_> + + <_> + 18 4 4 3 -1. + <_> + 18 5 4 1 3. + <_> + + <_> + 11 10 6 6 -1. + <_> + 11 12 6 2 3. + <_> + + <_> + 35 8 1 10 -1. + <_> + 35 13 1 5 2. + <_> + + <_> + 0 10 36 8 -1. + <_> + 18 10 18 8 2. + <_> + + <_> + 16 7 6 8 -1. + <_> + 19 7 3 4 2. + <_> + 16 11 3 4 2. + <_> + + <_> + 7 6 8 4 -1. + <_> + 7 6 4 4 2. + 1 + <_> + + <_> + 21 11 4 3 -1. + <_> + 21 12 4 1 3. + <_> + + <_> + 0 9 1 8 -1. + <_> + 0 13 1 4 2. + <_> + + <_> + 27 7 6 4 -1. + <_> + 29 9 2 4 3. + 1 + <_> + + <_> + 10 14 8 4 -1. + <_> + 12 14 4 4 2. + <_> + + <_> + 18 17 2 1 -1. + <_> + 18 17 1 1 2. + <_> + + <_> + 10 4 11 4 -1. + <_> + 10 5 11 2 2. + <_> + + <_> + 17 12 2 4 -1. + <_> + 17 13 2 2 2. + <_> + + <_> + 13 4 5 3 -1. + <_> + 13 5 5 1 3. + <_> + + <_> + 13 12 11 2 -1. + <_> + 13 13 11 1 2. + <_> + + <_> + 1 16 2 2 -1. + <_> + 1 16 1 1 2. + <_> + 2 17 1 1 2. + <_> + + <_> + 27 7 6 4 -1. + <_> + 29 9 2 4 3. + 1 + <_> + + <_> + 4 7 6 6 -1. + <_> + 4 9 6 2 3. + <_> + + <_> + 30 6 4 5 -1. + <_> + 31 7 2 5 2. + 1 + <_> + + <_> + 8 5 20 7 -1. + <_> + 13 5 10 7 2. + <_> + + <_> + 30 2 3 12 -1. + <_> + 30 8 3 6 2. + <_> + + <_> + 4 2 12 4 -1. + <_> + 4 2 12 2 2. + 1 + <_> + + <_> + 0 8 36 6 -1. + <_> + 12 10 12 2 9. + <_> + + <_> + 3 5 30 6 -1. + <_> + 13 7 10 2 9. + <_> + + <_> + 14 4 12 9 -1. + <_> + 18 4 4 9 3. + <_> + + <_> + 0 17 6 1 -1. + <_> + 3 17 3 1 2. + <_> + + <_> + 34 0 1 2 -1. + <_> + 34 0 1 1 2. + 1 + <_> + + <_> + 2 0 2 1 -1. + <_> + 2 0 1 1 2. + 1 + <_> + + <_> + 31 3 3 8 -1. + <_> + 32 4 1 8 3. + 1 + <_> + + <_> + 5 6 26 12 -1. + <_> + 5 6 13 6 2. + <_> + 18 12 13 6 2. + <_> + + <_> + 14 4 12 9 -1. + <_> + 18 4 4 9 3. + <_> + + <_> + 13 7 10 10 -1. + <_> + 13 7 5 5 2. + <_> + 18 12 5 5 2. + <_> + + <_> + 30 5 4 6 -1. + <_> + 31 6 2 6 2. + 1 + <_> + + <_> + 6 5 6 4 -1. + <_> + 5 6 6 2 2. + 1 + <_> + + <_> + 29 5 4 5 -1. + <_> + 30 6 2 5 2. + 1 + <_> + + <_> + 7 5 5 4 -1. + <_> + 6 6 5 2 2. + 1 + <_> + + <_> + 0 0 36 1 -1. + <_> + 12 0 12 1 3. + <_> + + <_> + 6 3 24 6 -1. + <_> + 14 5 8 2 9. + <_> + + <_> + 15 12 6 3 -1. + <_> + 15 13 6 1 3. + <_> + + <_> + 11 1 9 17 -1. + <_> + 14 1 3 17 3. + <_> + + <_> + 18 1 18 10 -1. + <_> + 18 1 9 10 2. + <_> + + <_> + 0 1 18 10 -1. + <_> + 9 1 9 10 2. + <_> + + <_> + 30 7 4 5 -1. + <_> + 31 8 2 5 2. + 1 + <_> + + <_> + 0 10 1 3 -1. + <_> + 0 11 1 1 3. + <_> + + <_> + 33 16 2 2 -1. + <_> + 34 16 1 1 2. + <_> + 33 17 1 1 2. + <_> + + <_> + 1 16 2 2 -1. + <_> + 1 16 1 1 2. + <_> + 2 17 1 1 2. + <_> + + <_> + 0 8 36 3 -1. + <_> + 12 9 12 1 9. + <_> + + <_> + 14 7 8 4 -1. + <_> + 14 8 8 2 2. + <_> + + <_> + 17 9 5 3 -1. + <_> + 17 10 5 1 3. + <_> + + <_> + 4 0 1 2 -1. + <_> + 4 0 1 1 2. + 1 + <_> + + <_> + 31 0 3 2 -1. + <_> + 31 0 3 1 2. + 1 + <_> + + <_> + 5 0 2 3 -1. + <_> + 5 0 1 3 2. + 1 + <_> + + <_> + 0 13 36 5 -1. + <_> + 0 13 18 5 2. + <_> + + <_> + 6 3 4 3 -1. + <_> + 5 4 4 1 3. + 1 + <_> + + <_> + 28 7 6 3 -1. + <_> + 30 9 2 3 3. + 1 + <_> + + <_> + 8 7 3 6 -1. + <_> + 6 9 3 2 3. + 1 + <_> + + <_> + 14 5 18 10 -1. + <_> + 23 5 9 5 2. + <_> + 14 10 9 5 2. + <_> + + <_> + 4 5 18 10 -1. + <_> + 4 5 9 5 2. + <_> + 13 10 9 5 2. + <_> + + <_> + 32 17 3 1 -1. + <_> + 33 17 1 1 3. + <_> + + <_> + 1 17 3 1 -1. + <_> + 2 17 1 1 3. + <_> + + <_> + 5 0 26 2 -1. + <_> + 18 0 13 1 2. + <_> + 5 1 13 1 2. + <_> + + <_> + 0 3 27 9 -1. + <_> + 9 6 9 3 9. + <_> + + <_> + 13 0 18 12 -1. + <_> + 13 6 18 6 2. + <_> + + <_> + 0 17 4 1 -1. + <_> + 1 17 2 1 2. + <_> + + <_> + 29 13 1 3 -1. + <_> + 28 14 1 1 3. + 1 + <_> + + <_> + 0 12 8 6 -1. + <_> + 0 14 8 2 3. + <_> + + <_> + 23 7 3 3 -1. + <_> + 24 7 1 3 3. + <_> + + <_> + 11 1 12 6 -1. + <_> + 11 3 12 2 3. + <_> + + <_> + 5 10 26 8 -1. + <_> + 18 10 13 4 2. + <_> + 5 14 13 4 2. + <_> + + <_> + 11 12 9 6 -1. + <_> + 14 12 3 6 3. + <_> + + <_> + 14 12 12 3 -1. + <_> + 18 13 4 1 9. + <_> + + <_> + 10 12 12 3 -1. + <_> + 14 13 4 1 9. + <_> + + <_> + 4 6 27 6 -1. + <_> + 13 8 9 2 9. + <_> + + <_> + 17 9 5 4 -1. + <_> + 17 10 5 2 2. + <_> + + <_> + 0 0 16 2 -1. + <_> + 0 0 8 1 2. + <_> + 8 1 8 1 2. + <_> + + <_> + 22 0 8 8 -1. + <_> + 26 0 4 4 2. + <_> + 22 4 4 4 2. + <_> + + <_> + 1 0 32 12 -1. + <_> + 1 0 16 6 2. + <_> + 17 6 16 6 2. + <_> + + <_> + 28 7 6 10 -1. + <_> + 31 7 3 5 2. + <_> + 28 12 3 5 2. + <_> + + <_> + 2 7 6 10 -1. + <_> + 2 7 3 5 2. + <_> + 5 12 3 5 2. + <_> + + <_> + 20 10 3 3 -1. + <_> + 20 11 3 1 3. + <_> + + <_> + 13 10 3 3 -1. + <_> + 13 11 3 1 3. + <_> + + <_> + 17 16 6 2 -1. + <_> + 19 16 2 2 3. + <_> + + <_> + 13 11 7 3 -1. + <_> + 13 12 7 1 3. + <_> + + <_> + 25 13 3 2 -1. + <_> + 25 13 3 1 2. + 1 + <_> + + <_> + 13 10 4 4 -1. + <_> + 13 11 4 2 2. + <_> + + <_> + 17 16 18 2 -1. + <_> + 26 16 9 1 2. + <_> + 17 17 9 1 2. + <_> + + <_> + 9 13 4 1 -1. + <_> + 9 13 2 1 2. + 1 + <_> + + <_> + 34 1 2 1 -1. + <_> + 34 1 1 1 2. + 1 + <_> + + <_> + 5 4 24 6 -1. + <_> + 13 6 8 2 9. + <_> + + <_> + 33 16 3 2 -1. + <_> + 33 17 3 1 2. + <_> + + <_> + 0 17 36 1 -1. + <_> + 18 17 18 1 2. + <_> + + <_> + 34 1 2 1 -1. + <_> + 34 1 1 1 2. + 1 + <_> + + <_> + 2 1 1 2 -1. + <_> + 2 1 1 1 2. + 1 + <_> + + <_> + 22 0 8 10 -1. + <_> + 24 2 4 10 2. + 1 + <_> + + <_> + 12 4 8 12 -1. + <_> + 12 4 4 6 2. + <_> + 16 10 4 6 2. + <_> + + <_> + 26 6 6 6 -1. + <_> + 29 6 3 3 2. + <_> + 26 9 3 3 2. + <_> + + <_> + 5 6 4 6 -1. + <_> + 5 6 2 3 2. + <_> + 7 9 2 3 2. + <_> + + <_> + 29 5 2 4 -1. + <_> + 29 5 1 4 2. + 1 + <_> + + <_> + 7 4 18 3 -1. + <_> + 7 5 18 1 3. + <_> + + <_> + 29 13 2 3 -1. + <_> + 28 14 2 1 3. + 1 + <_> + + <_> + 9 5 3 3 -1. + <_> + 8 6 3 1 3. + 1 + <_> + + <_> + 7 16 22 2 -1. + <_> + 18 16 11 1 2. + <_> + 7 17 11 1 2. + <_> + + <_> + 0 2 1 3 -1. + <_> + 0 3 1 1 3. + <_> + + <_> + 16 3 20 6 -1. + <_> + 26 3 10 3 2. + <_> + 16 6 10 3 2. + <_> + + <_> + 10 5 8 6 -1. + <_> + 12 5 4 6 2. + <_> + + <_> + 1 8 34 8 -1. + <_> + 18 8 17 4 2. + <_> + 1 12 17 4 2. + <_> + + <_> + 14 9 8 8 -1. + <_> + 14 9 4 4 2. + <_> + 18 13 4 4 2. + <_> + + <_> + 35 0 1 3 -1. + <_> + 35 1 1 1 3. + <_> + + <_> + 15 8 3 5 -1. + <_> + 16 8 1 5 3. + <_> + + <_> + 19 0 10 1 -1. + <_> + 19 0 5 1 2. + 1 + <_> + + <_> + 9 3 9 6 -1. + <_> + 7 5 9 2 3. + 1 + <_> + + <_> + 6 6 24 6 -1. + <_> + 14 8 8 2 9. + <_> + + <_> + 4 8 27 6 -1. + <_> + 13 10 9 2 9. + <_> + + <_> + 5 4 27 6 -1. + <_> + 14 6 9 2 9. + <_> + + <_> + 5 6 5 6 -1. + <_> + 5 8 5 2 3. + <_> + + <_> + 35 0 1 2 -1. + <_> + 35 1 1 1 2. + <_> + + <_> + 4 3 10 3 -1. + <_> + 3 4 10 1 3. + 1 + <_> + + <_> + 29 5 2 4 -1. + <_> + 29 5 1 4 2. + 1 + <_> + + <_> + 3 0 28 16 -1. + <_> + 3 0 14 8 2. + <_> + 17 8 14 8 2. + <_> + + <_> + 31 0 4 2 -1. + <_> + 31 0 2 2 2. + 1 + <_> + + <_> + 4 9 3 9 -1. + <_> + 4 12 3 3 3. + <_> + + <_> + 32 16 4 2 -1. + <_> + 32 17 4 1 2. + <_> + + <_> + 17 0 1 10 -1. + <_> + 17 0 1 5 2. + 1 + <_> + + <_> + 17 4 14 8 -1. + <_> + 17 4 7 8 2. + <_> + + <_> + 6 0 11 4 -1. + <_> + 6 2 11 2 2. + <_> + + <_> + 35 0 1 2 -1. + <_> + 35 1 1 1 2. + <_> + + <_> + 0 0 1 2 -1. + <_> + 0 1 1 1 2. + <_> + + <_> + 33 0 2 1 -1. + <_> + 33 0 1 1 2. + 1 + <_> + + <_> + 3 0 1 2 -1. + <_> + 3 0 1 1 2. + 1 + <_> + + <_> + 0 17 36 1 -1. + <_> + 9 17 18 1 2. + <_> + + <_> + 7 13 3 1 -1. + <_> + 8 14 1 1 3. + 1 + <_> + + <_> + 17 4 14 8 -1. + <_> + 17 4 7 8 2. + <_> + + <_> + 0 16 4 2 -1. + <_> + 0 17 4 1 2. + <_> + + <_> + 13 12 10 3 -1. + <_> + 13 13 10 1 3. + <_> + + <_> + 0 12 36 6 -1. + <_> + 18 12 18 6 2. + <_> + + <_> + 5 3 27 6 -1. + <_> + 14 5 9 2 9. + <_> + + <_> + 9 5 5 3 -1. + <_> + 8 6 5 1 3. + 1 + <_> + + <_> + 12 7 12 4 -1. + <_> + 15 7 6 4 2. + <_> + + <_> + 13 5 8 4 -1. + <_> + 15 5 4 4 2. + <_> + + <_> + 16 14 6 4 -1. + <_> + 16 14 3 4 2. + <_> + + <_> + 14 10 5 3 -1. + <_> + 14 11 5 1 3. + <_> + + <_> + 25 3 6 4 -1. + <_> + 25 4 6 2 2. + <_> + + <_> + 3 6 6 8 -1. + <_> + 3 8 6 4 2. + <_> + + <_> + 27 4 5 6 -1. + <_> + 27 6 5 2 3. + <_> + + <_> + 4 1 6 9 -1. + <_> + 4 4 6 3 3. + <_> + + <_> + 21 9 2 4 -1. + <_> + 21 10 2 2 2. + <_> + + <_> + 1 10 34 4 -1. + <_> + 1 10 17 2 2. + <_> + 18 12 17 2 2. + <_> + + <_> + 34 15 2 3 -1. + <_> + 34 16 2 1 3. + <_> + + <_> + 3 0 2 2 -1. + <_> + 3 0 2 1 2. + 1 + <_> + + <_> + 33 0 1 2 -1. + <_> + 33 0 1 1 2. + 1 + <_> + + <_> + 8 0 10 8 -1. + <_> + 6 2 10 4 2. + 1 + <_> + + <_> + 3 6 30 6 -1. + <_> + 13 8 10 2 9. + <_> + + <_> + 13 7 10 4 -1. + <_> + 13 8 10 2 2. + <_> + + <_> + 16 5 6 12 -1. + <_> + 19 5 3 6 2. + <_> + 16 11 3 6 2. + <_> + + <_> + 10 1 4 6 -1. + <_> + 8 3 4 2 3. + 1 + <_> + + <_> + 2 7 33 6 -1. + <_> + 13 9 11 2 9. + <_> + + <_> + 3 6 30 3 -1. + <_> + 13 7 10 1 9. + <_> + + <_> + 15 11 6 3 -1. + <_> + 15 12 6 1 3. + <_> + + <_> + 14 5 6 12 -1. + <_> + 14 5 3 6 2. + <_> + 17 11 3 6 2. + <_> + + <_> + 5 12 26 6 -1. + <_> + 18 12 13 3 2. + <_> + 5 15 13 3 2. + <_> + + <_> + 4 12 27 3 -1. + <_> + 13 13 9 1 9. + <_> + + <_> + 16 11 4 3 -1. + <_> + 16 12 4 1 3. + <_> + + <_> + 5 12 4 2 -1. + <_> + 6 13 2 2 2. + 1 + <_> + + <_> + 34 17 2 1 -1. + <_> + 34 17 1 1 2. + <_> + + <_> + 16 0 1 12 -1. + <_> + 16 0 1 6 2. + 1 + <_> + + <_> + 2 17 34 1 -1. + <_> + 2 17 17 1 2. + <_> + + <_> + 5 3 18 4 -1. + <_> + 5 4 18 2 2. + <_> + + <_> + 34 17 2 1 -1. + <_> + 34 17 1 1 2. + <_> + + <_> + 0 0 2 2 -1. + <_> + 0 1 2 1 2. + <_> + + <_> + 15 5 16 3 -1. + <_> + 15 6 16 1 3. + <_> + + <_> + 13 9 3 3 -1. + <_> + 13 10 3 1 3. + <_> + + <_> + 20 4 8 14 -1. + <_> + 22 4 4 14 2. + <_> + + <_> + 7 5 20 6 -1. + <_> + 12 5 10 6 2. + <_> + + <_> + 26 3 6 6 -1. + <_> + 28 5 2 6 3. + 1 + <_> + + <_> + 10 3 6 6 -1. + <_> + 8 5 6 2 3. + 1 + <_> + + <_> + 34 0 2 3 -1. + <_> + 34 0 1 3 2. + 1 + <_> + + <_> + 0 16 2 2 -1. + <_> + 0 17 2 1 2. + <_> + + <_> + 30 6 4 8 -1. + <_> + 31 7 2 8 2. + 1 + <_> + + <_> + 6 6 7 4 -1. + <_> + 5 7 7 2 2. + 1 + <_> + + <_> + 20 4 8 14 -1. + <_> + 22 4 4 14 2. + <_> + + <_> + 8 4 8 14 -1. + <_> + 10 4 4 14 2. + <_> + + <_> + 17 17 6 1 -1. + <_> + 19 17 2 1 3. + <_> + + <_> + 0 0 20 6 -1. + <_> + 10 0 10 6 2. + <_> + + <_> + 8 0 22 18 -1. + <_> + 8 0 11 18 2. + <_> + + <_> + 13 2 8 12 -1. + <_> + 13 2 4 6 2. + <_> + 17 8 4 6 2. + <_> + + <_> + 11 10 14 8 -1. + <_> + 18 10 7 4 2. + <_> + 11 14 7 4 2. + <_> + + <_> + 1 16 2 2 -1. + <_> + 1 16 1 1 2. + <_> + 2 17 1 1 2. + <_> + + <_> + 34 0 2 1 -1. + <_> + 34 0 1 1 2. + 1 + <_> + + <_> + 6 3 24 4 -1. + <_> + 12 3 12 4 2. + <_> + + <_> + 19 1 2 3 -1. + <_> + 19 2 2 1 3. + <_> + + <_> + 2 0 1 2 -1. + <_> + 2 0 1 1 2. + 1 + <_> + + <_> + 15 3 6 8 -1. + <_> + 18 3 3 4 2. + <_> + 15 7 3 4 2. + <_> + + <_> + 14 5 4 2 -1. + <_> + 14 6 4 1 2. + <_> + + <_> + 3 7 30 9 -1. + <_> + 13 10 10 3 9. + <_> + + <_> + 9 8 12 9 -1. + <_> + 12 8 6 9 2. + <_> + + <_> + 10 8 16 5 -1. + <_> + 14 8 8 5 2. + <_> + + <_> + 30 1 4 10 -1. + <_> + 31 2 2 10 2. + 1 + <_> + + <_> + 13 0 10 8 -1. + <_> + 11 2 10 4 2. + 1 + <_> + + <_> + 32 2 2 14 -1. + <_> + 32 2 1 14 2. + 1 + <_> + + <_> + 4 2 14 2 -1. + <_> + 4 2 14 1 2. + 1 + <_> + + <_> + 30 14 6 4 -1. + <_> + 30 14 3 4 2. + <_> + + <_> + 11 13 1 4 -1. + <_> + 11 15 1 2 2. + <_> + + <_> + 11 0 14 18 -1. + <_> + 18 0 7 9 2. + <_> + 11 9 7 9 2. + <_> + + <_> + 0 1 20 9 -1. + <_> + 10 1 10 9 2. + <_> + + <_> + 21 3 8 3 -1. + <_> + 23 3 4 3 2. + <_> + + <_> + 13 9 2 4 -1. + <_> + 13 10 2 2 2. + <_> + + <_> + 14 9 11 2 -1. + <_> + 14 10 11 1 2. + <_> + + <_> + 0 2 36 9 -1. + <_> + 12 5 12 3 9. + <_> + + <_> + 34 12 2 6 -1. + <_> + 34 15 2 3 2. + <_> + + <_> + 11 4 14 6 -1. + <_> + 11 6 14 2 3. + <_> + + <_> + 31 0 4 1 -1. + <_> + 31 0 2 1 2. + <_> + + <_> + 1 0 4 1 -1. + <_> + 3 0 2 1 2. + <_> + + <_> + 19 14 6 4 -1. + <_> + 21 14 2 4 3. + <_> + + <_> + 11 14 6 4 -1. + <_> + 13 14 2 4 3. + <_> + + <_> + 0 14 36 1 -1. + <_> + 9 14 18 1 2. + <_> + + <_> + 5 0 2 2 -1. + <_> + 5 0 2 1 2. + 1 + <_> + + <_> + 26 3 5 3 -1. + <_> + 26 4 5 1 3. + <_> + + <_> + 16 8 1 3 -1. + <_> + 15 9 1 1 3. + 1 + <_> + + <_> + 21 11 2 3 -1. + <_> + 21 12 2 1 3. + <_> + + <_> + 9 5 6 4 -1. + <_> + 8 6 6 2 2. + 1 + <_> + + <_> + 31 0 2 2 -1. + <_> + 31 0 1 2 2. + 1 + <_> + + <_> + 6 4 3 9 -1. + <_> + 6 7 3 3 3. + <_> + + <_> + 19 0 11 2 -1. + <_> + 19 0 11 1 2. + 1 + <_> + + <_> + 5 0 2 2 -1. + <_> + 5 0 2 1 2. + 1 + <_> + + <_> + 22 0 14 4 -1. + <_> + 29 0 7 2 2. + <_> + 22 2 7 2 2. + <_> + + <_> + 15 1 4 13 -1. + <_> + 15 1 2 13 2. + 1 + <_> + + <_> + 21 3 8 4 -1. + <_> + 23 3 4 4 2. + <_> + + <_> + 7 3 8 4 -1. + <_> + 9 3 4 4 2. + <_> + + <_> + 32 14 2 2 -1. + <_> + 33 14 1 1 2. + <_> + 32 15 1 1 2. + <_> + + <_> + 2 14 2 2 -1. + <_> + 2 14 1 1 2. + <_> + 3 15 1 1 2. + <_> + + <_> + 35 5 1 12 -1. + <_> + 35 9 1 4 3. + <_> + + <_> + 0 7 1 9 -1. + <_> + 0 10 1 3 3. + <_> + + <_> + 12 2 15 6 -1. + <_> + 12 4 15 2 3. + <_> + + <_> + 0 17 2 1 -1. + <_> + 1 17 1 1 2. + <_> + + <_> + 34 17 2 1 -1. + <_> + 34 17 1 1 2. + <_> + + <_> + 0 17 2 1 -1. + <_> + 1 17 1 1 2. + <_> + + <_> + 11 0 16 10 -1. + <_> + 15 0 8 10 2. + <_> + + <_> + 5 10 24 8 -1. + <_> + 5 10 12 4 2. + <_> + 17 14 12 4 2. + <_> + + <_> + 27 4 3 3 -1. + <_> + 27 5 3 1 3. + <_> + + <_> + 6 6 14 12 -1. + <_> + 6 6 7 6 2. + <_> + 13 12 7 6 2. + <_> + + <_> + 6 5 24 6 -1. + <_> + 14 7 8 2 9. + <_> + + <_> + 12 6 3 4 -1. + <_> + 12 7 3 2 2. + <_> + + <_> + 30 7 6 10 -1. + <_> + 33 7 3 5 2. + <_> + 30 12 3 5 2. + <_> + + <_> + 3 12 6 6 -1. + <_> + 3 12 3 3 2. + <_> + 6 15 3 3 2. + <_> + + <_> + 20 0 13 2 -1. + <_> + 20 0 13 1 2. + 1 + <_> + + <_> + 6 10 24 6 -1. + <_> + 14 12 8 2 9. + <_> + + <_> + 15 4 8 8 -1. + <_> + 19 4 4 4 2. + <_> + 15 8 4 4 2. + <_> + + <_> + 13 4 8 8 -1. + <_> + 13 4 4 4 2. + <_> + 17 8 4 4 2. + <_> + + <_> + 34 16 2 2 -1. + <_> + 34 16 1 2 2. + <_> + + <_> + 12 6 3 3 -1. + <_> + 12 7 3 1 3. + <_> + + <_> + 21 7 4 4 -1. + <_> + 21 8 4 2 2. + <_> + + <_> + 2 8 30 4 -1. + <_> + 2 8 15 2 2. + <_> + 17 10 15 2 2. + <_> + + <_> + 27 4 3 4 -1. + <_> + 27 5 3 2 2. + <_> + + <_> + 5 4 3 4 -1. + <_> + 5 5 3 2 2. + <_> + + <_> + 34 16 2 2 -1. + <_> + 34 16 1 2 2. + <_> + + <_> + 0 16 34 2 -1. + <_> + 0 16 17 1 2. + <_> + 17 17 17 1 2. + <_> + + <_> + 12 5 15 12 -1. + <_> + 12 9 15 4 3. + <_> + + <_> + 0 8 36 6 -1. + <_> + 12 10 12 2 9. + <_> + + <_> + 25 4 6 2 -1. + <_> + 25 5 6 1 2. + <_> + + <_> + 0 17 2 1 -1. + <_> + 1 17 1 1 2. + <_> + + <_> + 16 0 9 9 -1. + <_> + 19 0 3 9 3. + <_> + + <_> + 11 0 9 9 -1. + <_> + 14 0 3 9 3. + <_> + + <_> + 20 5 16 5 -1. + <_> + 24 5 8 5 2. + <_> + + <_> + 0 3 16 9 -1. + <_> + 4 3 8 9 2. + <_> + + <_> + 7 6 26 12 -1. + <_> + 20 6 13 6 2. + <_> + 7 12 13 6 2. + <_> + + <_> + 5 6 24 12 -1. + <_> + 5 6 12 6 2. + <_> + 17 12 12 6 2. + <_> + + <_> + 17 4 3 12 -1. + <_> + 18 4 1 12 3. + <_> + + <_> + 1 11 6 1 -1. + <_> + 3 13 2 1 3. + 1 + <_> + + <_> + 21 12 14 2 -1. + <_> + 28 12 7 1 2. + <_> + 21 13 7 1 2. + <_> + + <_> + 1 13 2 3 -1. + <_> + 2 13 1 3 2. + <_> + + <_> + 26 8 3 2 -1. + <_> + 27 9 1 2 3. + 1 + <_> + + <_> + 10 8 2 3 -1. + <_> + 9 9 2 1 3. + 1 + <_> + + <_> + 12 0 18 18 -1. + <_> + 12 0 9 18 2. + <_> + + <_> + 8 9 3 3 -1. + <_> + 7 10 3 1 3. + 1 + <_> + + <_> + 28 5 5 6 -1. + <_> + 28 7 5 2 3. + <_> + + <_> + 9 1 9 8 -1. + <_> + 9 1 9 4 2. + 1 + <_> + + <_> + 0 0 36 2 -1. + <_> + 18 0 18 1 2. + <_> + 0 1 18 1 2. + <_> + + <_> + 5 0 26 6 -1. + <_> + 5 0 13 3 2. + <_> + 18 3 13 3 2. + <_> + + <_> + 28 3 3 3 -1. + <_> + 28 4 3 1 3. + <_> + + <_> + 5 3 5 3 -1. + <_> + 5 4 5 1 3. + <_> + + <_> + 14 12 8 2 -1. + <_> + 16 12 4 2 2. + <_> + + <_> + 13 0 9 14 -1. + <_> + 16 0 3 14 3. + <_> + + <_> + 23 0 10 1 -1. + <_> + 23 0 5 1 2. + 1 + <_> + + <_> + 8 14 2 2 -1. + <_> + 8 14 1 2 2. + 1 + <_> + + <_> + 0 12 36 3 -1. + <_> + 12 13 12 1 9. + <_> + + <_> + 0 13 34 4 -1. + <_> + 0 13 17 2 2. + <_> + 17 15 17 2 2. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_upperbody.xml b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_upperbody.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c75aa6927762b1a54a104c9926cd0a8d4891e17 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/data/haarcascade_upperbody.xml @@ -0,0 +1,28134 @@ + + + +BOOST + HAAR + 18 + 22 + + 152 + + 0 + 30 + + <_> + 20 + -1.1264339685440063e+00 + + <_> + + 0 -1 0 -1.3696029782295227e-02 + + 4.5076468586921692e-01 -4.2179030179977417e-01 + <_> + + 0 -1 1 1.2441449798643589e-02 + + 1.6493250429630280e-01 -7.4793487787246704e-01 + <_> + + 0 -1 2 -2.7094660326838493e-03 + + 3.1004700064659119e-01 -3.7617141008377075e-01 + <_> + + 0 -1 3 -1.0008010268211365e-01 + + 7.6182198524475098e-01 -7.4556976556777954e-02 + <_> + + 0 -1 4 -2.5114119052886963e-01 + + -6.4154028892517090e-01 1.5139220654964447e-01 + <_> + + 0 -1 5 -1.0510650277137756e-01 + + 7.1459370851516724e-01 -1.4498579502105713e-01 + <_> + + 0 -1 6 -8.8448017835617065e-02 + + 7.5773179531097412e-01 -6.8586893379688263e-02 + <_> + + 0 -1 7 1.0874910280108452e-02 + + 1.4610609412193298e-01 -5.4263710975646973e-01 + <_> + + 0 -1 8 1.2690570205450058e-02 + + 1.1674589663743973e-01 -4.9649459123611450e-01 + <_> + + 0 -1 9 -3.2198399305343628e-02 + + -3.8529390096664429e-01 9.8437972366809845e-02 + <_> + + 0 -1 10 -3.4077179152518511e-03 + + 2.5200870633125305e-01 -2.2382549941539764e-01 + <_> + + 0 -1 11 3.0324390158057213e-02 + + -1.0534449666738510e-01 6.5735417604446411e-01 + <_> + + 0 -1 12 4.1930507868528366e-03 + + 1.2872399389743805e-01 -5.3160661458969116e-01 + <_> + + 0 -1 13 8.0501407384872437e-02 + + 4.1696660220623016e-02 -7.2123032808303833e-01 + <_> + + 0 -1 14 -3.4822080284357071e-02 + + -4.9751108884811401e-01 1.3959939777851105e-01 + <_> + + 0 -1 15 7.5519368983805180e-03 + + -9.2147678136825562e-02 1.1294340342283249e-01 + <_> + + 0 -1 16 -1.7572140321135521e-02 + + -5.6784427165985107e-01 9.3572810292243958e-02 + <_> + + 0 -1 17 5.2012042142450809e-03 + + -7.9238079488277435e-02 6.1878960579633713e-02 + <_> + + 0 -1 18 -3.0798919498920441e-02 + + -5.6658512353897095e-01 9.5271490514278412e-02 + <_> + + 0 -1 19 -1.3465429656207561e-03 + + 2.4011470377445221e-01 -2.6026639342308044e-01 + <_> + 33 + -1.1226719617843628e+00 + + <_> + + 0 -1 20 1.9108939450234175e-03 + + -4.6240958571434021e-01 3.0612170696258545e-01 + <_> + + 0 -1 21 9.5464065670967102e-03 + + 9.1956138610839844e-02 -5.3501170873641968e-01 + <_> + + 0 -1 22 -4.3402809649705887e-02 + + 5.6817841529846191e-01 -1.1284930258989334e-01 + <_> + + 0 -1 23 5.0386030226945877e-02 + + -8.0316931009292603e-02 7.3521858453750610e-01 + <_> + + 0 -1 24 -6.8480317713692784e-04 + + 2.5798648595809937e-01 -2.8049409389495850e-01 + <_> + + 0 -1 25 1.1548049747943878e-01 + + 9.2065572738647461e-02 -7.5556892156600952e-01 + <_> + + 0 -1 26 -1.9348369678482413e-03 + + 2.9440790414810181e-01 -2.4102710187435150e-01 + <_> + + 0 -1 27 -4.3528810143470764e-02 + + 4.9202969670295715e-01 -3.9650101214647293e-02 + <_> + + 0 -1 28 -3.0218150466680527e-02 + + 7.7227920293807983e-01 -8.6786523461341858e-02 + <_> + + 0 -1 29 2.4536589160561562e-02 + + 9.5944821834564209e-02 -4.8642969131469727e-01 + <_> + + 0 -1 30 2.3958990350365639e-02 + + 1.0437840223312378e-01 -5.1219838857650757e-01 + <_> + + 0 -1 31 -2.5370830669999123e-02 + + -3.1981548666954041e-01 9.1486573219299316e-02 + <_> + + 0 -1 32 -1.8606419907882810e-03 + + 2.2783969342708588e-01 -2.4307970702648163e-01 + <_> + + 0 -1 33 2.2550800815224648e-02 + + 6.9207556545734406e-02 -3.0054280161857605e-01 + <_> + + 0 -1 34 -4.9752090126276016e-02 + + -6.1078047752380371e-01 9.4472773373126984e-02 + <_> + + 0 -1 35 -2.6602389290928841e-02 + + 5.9581768512725830e-01 -9.2046052217483521e-02 + <_> + + 0 -1 36 1.0760000348091125e-01 + + 1.0278519988059998e-01 -5.4303371906280518e-01 + <_> + + 0 -1 37 1.7690699547529221e-02 + + 6.6057138144969940e-02 -6.3213908672332764e-01 + <_> + + 0 -1 38 -6.2409918755292892e-02 + + 6.8724197149276733e-01 -6.7070558667182922e-02 + <_> + + 0 -1 39 -1.9801619928330183e-03 + + 9.4411551952362061e-02 -8.7819486856460571e-02 + <_> + + 0 -1 40 6.3668429851531982e-02 + + 1.1531739681959152e-01 -4.8129761219024658e-01 + <_> + + 0 -1 41 -3.0797829851508141e-02 + + 3.5854768753051758e-01 -1.2593799829483032e-01 + <_> + + 0 -1 42 -1.8353419727645814e-04 + + 1.4788399636745453e-01 -2.8546810150146484e-01 + <_> + + 0 -1 43 1.7074620118364692e-03 + + 7.9929657280445099e-02 -2.5233370065689087e-01 + <_> + + 0 -1 44 -1.5325199812650681e-02 + + -5.7711857557296753e-01 9.8908327519893646e-02 + <_> + + 0 -1 45 4.1389189660549164e-02 + + -6.5550796687602997e-02 5.7363802194595337e-01 + <_> + + 0 -1 46 -4.5577771379612386e-04 + + 2.2593089938163757e-01 -1.9105580449104309e-01 + <_> + + 0 -1 47 -1.3455689884722233e-02 + + -4.0233930945396423e-01 8.6477622389793396e-02 + <_> + + 0 -1 48 -3.7978399544954300e-02 + + 5.5257588624954224e-01 -8.1541016697883606e-02 + <_> + + 0 -1 49 -1.7197500914335251e-02 + + -1.8363009393215179e-01 5.1999870687723160e-02 + <_> + + 0 -1 50 -1.2581580085679889e-03 + + 1.8830040097236633e-01 -2.5726661086082458e-01 + <_> + + 0 -1 51 6.7725107073783875e-02 + + -8.0956451594829559e-02 7.1803241968154907e-01 + <_> + + 0 -1 52 3.5489428788423538e-02 + + 1.0068070143461227e-01 -5.3774142265319824e-01 + <_> + 29 + -1.0127470493316650e+00 + + <_> + + 0 -1 53 -5.3695798851549625e-03 + + 2.7479499578475952e-01 -3.4178960323333740e-01 + <_> + + 0 -1 54 6.2695867381989956e-04 + + -9.8646633327007294e-02 1.0728420317173004e-01 + <_> + + 0 -1 55 -1.6484269872307777e-02 + + -6.4972907304763794e-01 9.6037752926349640e-02 + <_> + + 0 -1 56 -2.2104099392890930e-02 + + -4.5984488725662231e-01 1.6304630041122437e-01 + <_> + + 0 -1 57 1.1904139816761017e-01 + + -9.9600397050380707e-02 7.3729759454727173e-01 + <_> + + 0 -1 58 -2.0222070161253214e-03 + + 2.1029269695281982e-01 -2.4577130377292633e-01 + <_> + + 0 -1 59 6.7500352859497070e-02 + + -1.2467789649963379e-01 5.7654231786727905e-01 + <_> + + 0 -1 60 -1.9655939936637878e-01 + + -6.0891747474670410e-01 9.9672056734561920e-02 + <_> + + 0 -1 61 4.9431171268224716e-02 + + 1.3752749562263489e-01 -4.5580869913101196e-01 + <_> + + 0 -1 62 2.3380089551210403e-02 + + 4.7141890972852707e-02 -3.5027709603309631e-01 + <_> + + 0 -1 63 1.3998650247231126e-03 + + -2.0643049478530884e-01 2.4322299659252167e-01 + <_> + + 0 -1 64 1.1432689614593983e-02 + + 5.5187370628118515e-02 -3.2619899511337280e-01 + <_> + + 0 -1 65 4.8775069415569305e-02 + + -6.8992510437965393e-02 7.1171808242797852e-01 + <_> + + 0 -1 66 6.5284021198749542e-02 + + 3.7155740428715944e-03 5.9318971633911133e-01 + <_> + + 0 -1 67 6.1603228095918894e-04 + + -2.3272520303726196e-01 2.0441530644893646e-01 + <_> + + 0 -1 68 -1.0527499951422215e-02 + + -3.1773790717124939e-01 1.0171309858560562e-01 + <_> + + 0 -1 69 1.6231339424848557e-02 + + 9.1734193265438080e-02 -4.7143009305000305e-01 + <_> + + 0 -1 70 3.8958500954322517e-04 + + -1.2997549772262573e-01 1.3475489616394043e-01 + <_> + + 0 -1 71 -4.4165689498186111e-02 + + -6.0331028699874878e-01 6.4766876399517059e-02 + <_> + + 0 -1 72 -1.3663209974765778e-02 + + -5.2762842178344727e-01 6.3485741615295410e-02 + <_> + + 0 -1 73 -8.8231859263032675e-04 + + 1.4510250091552734e-01 -2.7845200896263123e-01 + <_> + + 0 -1 74 -2.7819190174341202e-02 + + 4.3640869855880737e-01 -8.5191860795021057e-02 + <_> + + 0 -1 75 6.2560990452766418e-02 + + 1.0027889907360077e-01 -4.2235919833183289e-01 + <_> + + 0 -1 76 -4.4808178790844977e-04 + + 1.4851489663124084e-01 -1.7731289565563202e-01 + <_> + + 0 -1 77 -2.1363180130720139e-02 + + -6.1334460973739624e-01 6.0539398342370987e-02 + <_> + + 0 -1 78 -6.9122329354286194e-02 + + -8.6845761537551880e-01 3.9347749203443527e-02 + <_> + + 0 -1 79 -3.0542839318513870e-02 + + -6.4021718502044678e-01 4.9593821167945862e-02 + <_> + + 0 -1 80 -1.0101160034537315e-02 + + -1.6199150681495667e-01 5.7256899774074554e-02 + <_> + + 0 -1 81 -2.2010109387338161e-04 + + 2.1350930631160736e-01 -2.0198999345302582e-01 + <_> + 42 + -1.0684469938278198e+00 + + <_> + + 0 -1 82 5.7967850007116795e-03 + + -3.3844178915023804e-01 2.5066271424293518e-01 + <_> + + 0 -1 83 6.3795179128646851e-02 + + -4.2111620306968689e-02 3.5746571421623230e-01 + <_> + + 0 -1 84 -6.4332038164138794e-02 + + -5.0660789012908936e-01 1.1717739701271057e-01 + <_> + + 0 -1 85 -1.1574289947748184e-01 + + -5.6678497791290283e-01 9.5880903303623199e-02 + <_> + + 0 -1 86 -3.9005130529403687e-03 + + -4.1498228907585144e-01 1.4858320355415344e-01 + <_> + + 0 -1 87 1.2512929737567902e-02 + + 5.3696669638156891e-02 -1.4163960516452789e-01 + <_> + + 0 -1 88 1.5871099894866347e-03 + + -2.5962340831756592e-01 1.9418330490589142e-01 + <_> + + 0 -1 89 1.6291120648384094e-01 + + -6.1243768781423569e-02 7.8567212820053101e-01 + <_> + + 0 -1 90 -3.3258220553398132e-01 + + 7.8020131587982178e-01 -4.4036459177732468e-02 + <_> + + 0 -1 91 -1.0288899764418602e-02 + + -1.5289680659770966e-01 6.2096230685710907e-02 + <_> + + 0 -1 92 2.8956029564142227e-02 + + 8.4707796573638916e-02 -4.7820711135864258e-01 + <_> + + 0 -1 93 -3.2221511355601251e-04 + + 1.3951259851455688e-01 -1.8819390237331390e-01 + <_> + + 0 -1 94 1.5835289657115936e-01 + + 6.6667810082435608e-02 -5.4572361707687378e-01 + <_> + + 0 -1 95 -4.2584311217069626e-02 + + 2.7040338516235352e-01 -5.6654509156942368e-02 + <_> + + 0 -1 96 2.7505140751600266e-02 + + 4.9271158874034882e-02 -7.3157638311386108e-01 + <_> + + 0 -1 97 8.6879700422286987e-02 + + -1.7532400786876678e-02 8.6782652139663696e-01 + <_> + + 0 -1 98 -2.0130439661443233e-03 + + 1.6593940556049347e-01 -2.5266230106353760e-01 + <_> + + 0 -1 99 4.2330170981585979e-04 + + 9.4223551452159882e-02 -2.4629700183868408e-01 + <_> + + 0 -1 100 1.5194499865174294e-02 + + 7.3695637285709381e-02 -5.0068622827529907e-01 + <_> + + 0 -1 101 -6.1203669756650925e-03 + + 2.1381899714469910e-01 -1.6738100349903107e-01 + <_> + + 0 -1 102 2.0660240203142166e-02 + + -8.0636158585548401e-02 5.7828348875045776e-01 + <_> + + 0 -1 103 -6.0398250818252563e-02 + + -6.3411772251129150e-01 5.0899010151624680e-02 + <_> + + 0 -1 104 3.5386480391025543e-02 + + 7.3191151022911072e-02 -5.6426662206649780e-01 + <_> + + 0 -1 105 -6.5997838973999023e-02 + + 3.2833808660507202e-01 -2.6310259476304054e-02 + <_> + + 0 -1 106 1.1004590196534991e-03 + + -2.3114609718322754e-01 2.0206519961357117e-01 + <_> + + 0 -1 107 8.4488153457641602e-02 + + 7.4589841067790985e-02 -4.3710339069366455e-01 + <_> + + 0 -1 108 -2.9235990718007088e-02 + + 6.5064769983291626e-01 -5.4531838744878769e-02 + <_> + + 0 -1 109 -3.3916950225830078e-02 + + -2.8804349899291992e-01 3.2172881066799164e-02 + <_> + + 0 -1 110 -7.9108700156211853e-03 + + -3.3660379052162170e-01 1.0100690275430679e-01 + <_> + + 0 -1 111 5.1930431276559830e-02 + + 3.2920960336923599e-02 -1.3176530599594116e-01 + <_> + + 0 -1 112 -6.8586103618144989e-02 + + 5.2153557538986206e-01 -6.6718578338623047e-02 + <_> + + 0 -1 113 -1.9451669650152326e-03 + + 1.5396790206432343e-01 -1.9895760715007782e-01 + <_> + + 0 -1 114 7.1366228163242340e-02 + + -8.2927159965038300e-02 4.5292338728904724e-01 + <_> + + 0 -1 115 -2.6624239981174469e-02 + + -4.4009739160537720e-01 1.0267119854688644e-01 + <_> + + 0 -1 116 2.5266060605645180e-02 + + 5.5799201130867004e-02 -5.5569338798522949e-01 + <_> + + 0 -1 117 5.5255689658224583e-03 + + -1.3640299439430237e-01 2.8255200386047363e-01 + <_> + + 0 -1 118 -2.9929999727755785e-03 + + -3.2421571016311646e-01 1.2122060358524323e-01 + <_> + + 0 -1 119 2.2192109376192093e-02 + + -6.0741018503904343e-02 4.3473160266876221e-01 + <_> + + 0 -1 120 -9.4268741086125374e-03 + + -3.3458408713340759e-01 1.0029699653387070e-01 + <_> + + 0 -1 121 3.4395330585539341e-03 + + -8.3829909563064575e-02 1.7925940454006195e-01 + <_> + + 0 -1 122 -3.2996390946209431e-03 + + 1.9990429282188416e-01 -2.1068470180034637e-01 + <_> + + 0 -1 123 2.6152150705456734e-02 + + -8.0667406320571899e-02 3.5581269860267639e-01 + <_> + 45 + -1.1520069837570190e+00 + + <_> + + 0 -1 124 -2.2792650386691093e-02 + + 4.0725260972976685e-01 -3.3609920740127563e-01 + <_> + + 0 -1 125 -5.7334620505571365e-03 + + 2.6882189512252808e-01 -2.2775350511074066e-01 + <_> + + 0 -1 126 9.6941202878952026e-02 + + -8.0905012786388397e-02 7.4328738451004028e-01 + <_> + + 0 -1 127 -2.8288999572396278e-02 + + 4.5610108971595764e-01 -6.1096340417861938e-02 + <_> + + 0 -1 128 3.8522849790751934e-03 + + -2.5241801142692566e-01 2.0907109975814819e-01 + <_> + + 0 -1 129 2.3100129328668118e-03 + + -1.4713400602340698e-01 1.5460389852523804e-01 + <_> + + 0 -1 130 1.1361920041963458e-03 + + 1.7680479586124420e-01 -3.0537289381027222e-01 + <_> + + 0 -1 131 2.4962890893220901e-02 + + -1.2652909755706787e-01 3.7442651391029358e-01 + <_> + + 0 -1 132 -5.8984099887311459e-03 + + 2.6738989353179932e-01 -1.7762570083141327e-01 + <_> + + 0 -1 133 1.1804900132119656e-02 + + 6.6077977418899536e-02 -3.3482131361961365e-01 + <_> + + 0 -1 134 6.4400159753859043e-03 + + 1.0994800180196762e-01 -3.6303481459617615e-01 + <_> + + 0 -1 135 -8.9407369494438171e-02 + + -4.3580460548400879e-01 1.4944310300052166e-02 + <_> + + 0 -1 136 -3.1404230743646622e-02 + + 6.9523447751998901e-01 -5.4854288697242737e-02 + <_> + + 0 -1 137 -1.4607949554920197e-01 + + -2.5650060176849365e-01 5.6956540793180466e-02 + <_> + + 0 -1 138 2.1142649929970503e-03 + + -2.4987550079822540e-01 1.6792559623718262e-01 + <_> + + 0 -1 139 -1.5119359828531742e-02 + + -3.0179870128631592e-01 1.0393589735031128e-01 + <_> + + 0 -1 140 2.5620959699153900e-02 + + -7.4821300804615021e-02 5.3600782155990601e-01 + <_> + + 0 -1 141 -1.4417800307273865e-01 + + -2.0490899682044983e-01 7.4457786977291107e-02 + <_> + + 0 -1 142 2.5954779237508774e-02 + + -9.0574868023395538e-02 4.8442208766937256e-01 + <_> + + 0 -1 143 -2.1130720153450966e-02 + + -2.2689810395240784e-01 6.4876057207584381e-02 + <_> + + 0 -1 144 1.6474459320306778e-02 + + 1.0768000036478043e-01 -3.6570599675178528e-01 + <_> + + 0 -1 145 1.0922150313854218e-01 + + 5.6827351450920105e-02 -3.4728559851646423e-01 + <_> + + 0 -1 146 -7.4581061198841780e-05 + + 1.3904270529747009e-01 -2.5942608714103699e-01 + <_> + + 0 -1 147 -2.7753600850701332e-02 + + 3.8111299276351929e-01 -4.2896129190921783e-02 + <_> + + 0 -1 148 3.2721430063247681e-02 + + -9.0872153639793396e-02 3.9289179444313049e-01 + <_> + + 0 -1 149 5.5606258101761341e-03 + + 8.4002248942852020e-02 -1.9396039843559265e-01 + <_> + + 0 -1 150 -1.0710290074348450e-01 + + -5.8981472253799438e-01 5.6862760335206985e-02 + <_> + + 0 -1 151 -8.0517623573541641e-03 + + 1.1790599673986435e-01 -1.1595659703016281e-01 + <_> + + 0 -1 152 -1.3850019872188568e-01 + + -9.0805321931838989e-01 4.1411358863115311e-02 + <_> + + 0 -1 153 2.8620919212698936e-02 + + 1.9928589463233948e-02 -7.3697662353515625e-01 + <_> + + 0 -1 154 2.6208970695734024e-02 + + -6.1577551066875458e-02 6.0899931192398071e-01 + <_> + + 0 -1 155 2.6527039706707001e-02 + + 5.7193860411643982e-02 -6.2992326915264130e-02 + <_> + + 0 -1 156 -4.4622488319873810e-02 + + -3.3318150043487549e-01 9.3214571475982666e-02 + <_> + + 0 -1 157 -1.4283119700849056e-02 + + 1.9125230610370636e-01 -1.1530569940805435e-01 + <_> + + 0 -1 158 -1.9681209232658148e-03 + + -3.1295120716094971e-01 9.9682807922363281e-02 + <_> + + 0 -1 159 5.2851080894470215e-02 + + -5.8919548988342285e-02 5.7887911796569824e-01 + <_> + + 0 -1 160 -6.3711861148476601e-03 + + 1.9182190299034119e-01 -1.9094540178775787e-01 + <_> + + 0 -1 161 -6.4727910794317722e-03 + + -2.4721039831638336e-01 1.2252929806709290e-01 + <_> + + 0 -1 162 -1.6690989956259727e-02 + + -4.9174660444259644e-01 5.0315100699663162e-02 + <_> + + 0 -1 163 -1.4882409945130348e-02 + + 1.9646610319614410e-01 -5.8250389993190765e-02 + <_> + + 0 -1 164 1.7529709264636040e-02 + + 7.6357498764991760e-02 -3.6559268832206726e-01 + <_> + + 0 -1 165 4.2221389710903168e-02 + + -3.1560491770505905e-02 3.6011269688606262e-01 + <_> + + 0 -1 166 -6.5581746399402618e-02 + + 3.4334710240364075e-01 -8.8556960225105286e-02 + <_> + + 0 -1 167 1.6703210771083832e-02 + + 4.8210039734840393e-02 -1.5273620188236237e-01 + <_> + + 0 -1 168 -6.9328742101788521e-03 + + -3.0573639273643494e-01 1.1821140348911285e-01 + <_> + 46 + -1.0648390054702759e+00 + + <_> + + 0 -1 169 -6.3434438779950142e-03 + + 3.3840280771255493e-01 -3.3474850654602051e-01 + <_> + + 0 -1 170 5.2472548559308052e-03 + + -9.3596532940864563e-02 1.6791179776191711e-01 + <_> + + 0 -1 171 -3.6585088819265366e-02 + + 5.3676098585128784e-01 -8.5433527827262878e-02 + <_> + + 0 -1 172 5.3153699263930321e-03 + + -1.2804119288921356e-01 1.4443910121917725e-01 + <_> + + 0 -1 173 -3.9569609798491001e-03 + + 1.8605449795722961e-01 -2.2311410307884216e-01 + <_> + + 0 -1 174 3.3965419977903366e-02 + + 2.7835709974169731e-02 -5.1203387975692749e-01 + <_> + + 0 -1 175 -1.4852879568934441e-02 + + -4.6814951300621033e-01 1.1351560056209564e-01 + <_> + + 0 -1 176 -2.9641329310834408e-03 + + 2.6591798663139343e-01 -2.8183770179748535e-01 + <_> + + 0 -1 177 -1.0795590281486511e-01 + + -5.7527697086334229e-01 1.0991639643907547e-01 + <_> + + 0 -1 178 2.1237600594758987e-02 + + -1.0451590269804001e-01 4.6613770723342896e-01 + <_> + + 0 -1 179 -2.6189640164375305e-02 + + 4.2544820904731750e-01 -9.2278912663459778e-02 + <_> + + 0 -1 180 -3.5010561347007751e-02 + + -7.1801197528839111e-01 7.2877250611782074e-02 + <_> + + 0 -1 181 1.5026619621494319e-05 + + -2.7199760079383850e-01 1.0682159662246704e-01 + <_> + + 0 -1 182 -2.7760250493884087e-02 + + -5.0185692310333252e-01 1.0118210315704346e-01 + <_> + + 0 -1 183 -3.7439178675413132e-02 + + -3.7141519784927368e-01 8.3709038794040680e-02 + <_> + + 0 -1 184 -1.4152259565889835e-02 + + 3.0982801318168640e-01 -7.3767662048339844e-02 + <_> + + 0 -1 185 -1.2331079691648483e-02 + + -3.9507681131362915e-01 8.3215177059173584e-02 + <_> + + 0 -1 186 2.6666349731385708e-03 + + -1.3776129484176636e-01 2.4245689809322357e-01 + <_> + + 0 -1 187 -2.9443199746310711e-03 + + 2.4460780620574951e-01 -1.3937890529632568e-01 + <_> + + 0 -1 188 -1.5788920223712921e-01 + + -5.6832242012023926e-01 3.6140721291303635e-02 + <_> + + 0 -1 189 2.1553030237555504e-03 + + 8.3660557866096497e-02 -4.1380259394645691e-01 + <_> + + 0 -1 190 -8.5367091000080109e-02 + + -5.7053291797637939e-01 5.2995659410953522e-02 + <_> + + 0 -1 191 3.4761740826070309e-03 + + -1.2189819663763046e-01 2.6553291082382202e-01 + <_> + + 0 -1 192 -2.4104220792651176e-02 + + -5.2315437793731689e-01 2.5505660101771355e-02 + <_> + + 0 -1 193 -3.0729150399565697e-02 + + -4.6735408902168274e-01 7.0844426751136780e-02 + <_> + + 0 -1 194 -1.1937420349568129e-03 + + 1.4596860110759735e-01 -2.3086270689964294e-01 + <_> + + 0 -1 195 3.2304100692272186e-02 + + -6.5350927412509918e-02 5.5091381072998047e-01 + <_> + + 0 -1 196 1.4955499768257141e-01 + + 1.5002089552581310e-02 -8.9400452375411987e-01 + <_> + + 0 -1 197 -4.7254669480025768e-03 + + 1.4857460558414459e-01 -2.1019940078258514e-01 + <_> + + 0 -1 198 3.6360718309879303e-02 + + 2.8547950088977814e-02 -6.3668930530548096e-01 + <_> + + 0 -1 199 -2.7109999209642410e-02 + + 4.9661910533905029e-01 -7.3661573231220245e-02 + <_> + + 0 -1 200 -9.5398407429456711e-03 + + -1.9384680688381195e-01 5.8507081121206284e-02 + <_> + + 0 -1 201 1.0541989654302597e-01 + + -7.4785731732845306e-02 4.3781110644340515e-01 + <_> + + 0 -1 202 6.3801761716604233e-03 + + 5.3971529006958008e-02 -3.3829790353775024e-01 + <_> + + 0 -1 203 -2.2759849205613136e-02 + + -5.9374898672103882e-01 4.8046529293060303e-02 + <_> + + 0 -1 204 -1.7323749139904976e-02 + + -1.6034699976444244e-01 1.5187160111963749e-02 + <_> + + 0 -1 205 2.9854409396648407e-02 + + -6.5698243677616119e-02 4.5057341456413269e-01 + <_> + + 0 -1 206 2.3269839584827423e-02 + + 3.8805499672889709e-02 -3.5354879498481750e-01 + <_> + + 0 -1 207 4.0833871811628342e-02 + + 4.9404840916395187e-02 -5.6222450733184814e-01 + <_> + + 0 -1 208 -1.2498889863491058e-01 + + 6.7763668298721313e-01 -1.5484940260648727e-02 + <_> + + 0 -1 209 -6.5579377114772797e-02 + + 6.7363232374191284e-01 -4.5269690454006195e-02 + <_> + + 0 -1 210 -3.7901759147644043e-01 + + -4.9853721261024475e-01 2.3955229669809341e-02 + <_> + + 0 -1 211 2.9792459681630135e-03 + + -1.8436419963836670e-01 1.6265830397605896e-01 + <_> + + 0 -1 212 1.3803659938275814e-02 + + 6.3698217272758484e-02 -4.3389800190925598e-01 + <_> + + 0 -1 213 3.5606899764388800e-03 + + -1.1455070227384567e-01 2.3618610203266144e-01 + <_> + + 0 -1 214 8.8772783055901527e-03 + + 8.6416840553283691e-02 -1.7590980231761932e-01 + <_> + 45 + -9.5069932937622070e-01 + + <_> + + 0 -1 215 -6.7344820126891136e-03 + + 3.0758589506149292e-01 -2.9761791229248047e-01 + <_> + + 0 -1 216 -1.3902880251407623e-02 + + 2.0400699973106384e-01 -2.2967250645160675e-01 + <_> + + 0 -1 217 -4.1963551193475723e-02 + + -5.6575411558151245e-01 8.6745493113994598e-02 + <_> + + 0 -1 218 -5.9794791013700888e-05 + + 1.5832610428333282e-01 -2.3109050095081329e-01 + <_> + + 0 -1 219 8.4739532321691513e-03 + + -1.1501230299472809e-01 3.9758589863777161e-01 + <_> + + 0 -1 220 -6.5317057073116302e-02 + + -2.3887279629707336e-01 1.1391709744930267e-01 + <_> + + 0 -1 221 -4.2358501814305782e-03 + + 2.2337220609188080e-01 -2.4218839406967163e-01 + <_> + + 0 -1 222 4.6229299157857895e-02 + + 9.6837401390075684e-02 -5.3427702188491821e-01 + <_> + + 0 -1 223 5.2246701670810580e-05 + + -2.4189360439777374e-01 1.5932360291481018e-01 + <_> + + 0 -1 224 -4.1420090943574905e-02 + + -3.4044981002807617e-01 4.3712481856346130e-02 + <_> + + 0 -1 225 -1.0224279947578907e-02 + + -2.4752390384674072e-01 1.5512530505657196e-01 + <_> + + 0 -1 226 6.8581208586692810e-02 + + 9.7173796966671944e-03 -6.1821222305297852e-01 + <_> + + 0 -1 227 -4.0700301527976990e-02 + + -6.0284787416458130e-01 7.0963069796562195e-02 + <_> + + 0 -1 228 -8.9998699724674225e-02 + + 4.6664720773696899e-01 -4.8549890518188477e-02 + <_> + + 0 -1 229 1.5307360328733921e-02 + + 1.4783670008182526e-01 -2.7114608883857727e-01 + <_> + + 0 -1 230 3.7016849964857101e-03 + + -1.5153409540653229e-01 2.0931409299373627e-01 + <_> + + 0 -1 231 -3.1937099993228912e-02 + + -7.2332257032394409e-01 3.7420161068439484e-02 + <_> + + 0 -1 232 4.7493908554315567e-02 + + 4.9000091850757599e-02 -4.8303189873695374e-01 + <_> + + 0 -1 233 4.4620381668210030e-03 + + -1.7698319256305695e-01 1.9820910692214966e-01 + <_> + + 0 -1 234 -8.1284176558256149e-03 + + 1.1222189664840698e-01 -5.0805520266294479e-02 + <_> + + 0 -1 235 -1.2596019543707371e-02 + + 4.3889060616493225e-01 -8.2898952066898346e-02 + <_> + + 0 -1 236 -1.0689930059015751e-03 + + 6.8766087293624878e-02 -8.2667008042335510e-02 + <_> + + 0 -1 237 -4.8213090747594833e-02 + + -4.6671348810195923e-01 7.4310712516307831e-02 + <_> + + 0 -1 238 -2.3418650380335748e-04 + + 8.8725142180919647e-02 -1.0919640213251114e-01 + <_> + + 0 -1 239 1.0095000267028809e-01 + + 5.5444270372390747e-02 -5.5205368995666504e-01 + <_> + + 0 -1 240 3.2340411096811295e-02 + + 4.9762740731239319e-02 -3.6636400222778320e-01 + <_> + + 0 -1 241 1.7699210345745087e-01 + + -7.3765642940998077e-02 5.4300791025161743e-01 + <_> + + 0 -1 242 -1.8634319712873548e-04 + + 9.5718666911125183e-02 -1.8214109539985657e-01 + <_> + + 0 -1 243 6.6473139449954033e-03 + + -1.2173130363225937e-01 3.0331039428710938e-01 + <_> + + 0 -1 244 -9.9276658147573471e-03 + + 3.2638520002365112e-01 -8.8533706963062286e-02 + <_> + + 0 -1 245 5.2587099373340607e-02 + + 1.1303950101137161e-01 -3.3436870574951172e-01 + <_> + + 0 -1 246 4.9553681164979935e-03 + + -1.3183289766311646e-01 9.7614809870719910e-02 + <_> + + 0 -1 247 -2.3817660287022591e-02 + + -4.1027650237083435e-01 8.4849812090396881e-02 + <_> + + 0 -1 248 -1.1363780125975609e-02 + + 1.8874420225620270e-01 -8.3536416292190552e-02 + <_> + + 0 -1 249 -1.9515539752319455e-03 + + 1.8985089659690857e-01 -1.7776779830455780e-01 + <_> + + 0 -1 250 -1.3576669618487358e-02 + + 2.0975759625434875e-01 -3.7115450948476791e-02 + <_> + + 0 -1 251 1.6466820612549782e-02 + + -8.2349412143230438e-02 3.8047221302986145e-01 + <_> + + 0 -1 252 -1.0136260092258453e-01 + + -1.1633230000734329e-01 6.7804910242557526e-02 + <_> + + 0 -1 253 -1.0248430073261261e-01 + + -2.8850209712982178e-01 1.2139680236577988e-01 + <_> + + 0 -1 254 -2.8717568516731262e-01 + + 4.6935141086578369e-01 -8.2954309880733490e-02 + <_> + + 0 -1 255 5.0812978297472000e-02 + + 5.5393878370523453e-02 -6.2383282184600830e-01 + <_> + + 0 -1 256 9.1063417494297028e-02 + + -2.3379560559988022e-02 4.7155299782752991e-01 + <_> + + 0 -1 257 -5.1845338195562363e-02 + + -6.9031542539596558e-01 4.5454118400812149e-02 + <_> + + 0 -1 258 1.5031239390373230e-01 + + 4.5906711369752884e-02 -5.2067738771438599e-01 + <_> + + 0 -1 259 4.1596319526433945e-02 + + 5.3706299513578415e-02 -4.8782169818878174e-01 + <_> + 43 + -8.5045951604843140e-01 + + <_> + + 0 -1 260 -5.9847710654139519e-03 + + 2.7858960628509521e-01 -3.0923390388488770e-01 + <_> + + 0 -1 261 -3.9032639469951391e-03 + + 2.2257049381732941e-01 -2.8928229212760925e-01 + <_> + + 0 -1 262 -2.2362179151969030e-05 + + 1.4084370434284210e-01 -3.0143168568611145e-01 + <_> + + 0 -1 263 -9.1167002916336060e-02 + + -6.7608010768890381e-01 5.6040819734334946e-02 + <_> + + 0 -1 264 5.2755638957023621e-02 + + 7.4688747525215149e-02 -6.3256257772445679e-01 + <_> + + 0 -1 265 6.9458536803722382e-02 + + -1.1754920333623886e-01 6.3863641023635864e-01 + <_> + + 0 -1 266 -4.8209438100457191e-03 + + 2.9225930571556091e-01 -1.3872410356998444e-01 + <_> + + 0 -1 267 3.2156750559806824e-02 + + 7.5575239956378937e-02 -5.7927912473678589e-01 + <_> + + 0 -1 268 -4.4298470020294189e-02 + + 4.0226811170578003e-01 -1.0264609754085541e-01 + <_> + + 0 -1 269 -7.0452108047902584e-03 + + 1.5128499269485474e-01 -5.6725870817899704e-02 + <_> + + 0 -1 270 5.1606830675154924e-04 + + -2.3022100329399109e-01 1.6343879699707031e-01 + <_> + + 0 -1 271 -6.1528358608484268e-02 + + 2.5559040904045105e-01 -4.6751510351896286e-02 + <_> + + 0 -1 272 -5.1367811858654022e-02 + + -2.4755829572677612e-01 1.4305450022220612e-01 + <_> + + 0 -1 273 9.0107098221778870e-03 + + -1.0648769885301590e-01 3.1271860003471375e-01 + <_> + + 0 -1 274 2.2352259606122971e-02 + + 1.5494219958782196e-01 -3.1736290454864502e-01 + <_> + + 0 -1 275 3.1493891030550003e-02 + + 7.2037532925605774e-02 -2.8946670889854431e-01 + <_> + + 0 -1 276 -5.2064459770917892e-02 + + -2.7082020044326782e-01 1.2260189652442932e-01 + <_> + + 0 -1 277 -6.1549381352961063e-03 + + 1.6442950069904327e-01 -1.0657779872417450e-01 + <_> + + 0 -1 278 3.0305041000247002e-03 + + -1.5234139561653137e-01 2.0446379482746124e-01 + <_> + + 0 -1 279 -6.8027540110051632e-03 + + 7.1448147296905518e-02 -4.1458301246166229e-02 + <_> + + 0 -1 280 6.8647533655166626e-02 + + -5.2833538502454758e-02 5.7638901472091675e-01 + <_> + + 0 -1 281 -9.2883080244064331e-02 + + -2.6236709952354431e-01 8.2425810396671295e-02 + <_> + + 0 -1 282 -5.2907038480043411e-03 + + 1.4090450108051300e-01 -2.2050650417804718e-01 + <_> + + 0 -1 283 1.5640209894627333e-03 + + -1.0143549740314484e-01 1.3026970624923706e-01 + <_> + + 0 -1 284 1.0752620175480843e-02 + + 9.1515362262725830e-02 -3.2133978605270386e-01 + <_> + + 0 -1 285 -2.1106360480189323e-02 + + -2.7410230040550232e-01 9.1773197054862976e-03 + <_> + + 0 -1 286 4.8663117922842503e-03 + + -1.5258720517158508e-01 1.9711069762706757e-01 + <_> + + 0 -1 287 6.5396472811698914e-02 + + 6.5921088680624962e-03 -6.4343088865280151e-01 + <_> + + 0 -1 288 4.4902609661221504e-03 + + -1.0377249866724014e-01 2.8005209565162659e-01 + <_> + + 0 -1 289 4.6614840626716614e-02 + + 5.4715849459171295e-02 -5.2179151773452759e-01 + <_> + + 0 -1 290 1.1597450077533722e-01 + + 3.9613999426364899e-02 -6.4784902334213257e-01 + <_> + + 0 -1 291 5.7222661562263966e-03 + + -5.4838169366121292e-02 1.2828019261360168e-01 + <_> + + 0 -1 292 -4.1633259505033493e-02 + + -8.0665838718414307e-01 3.5942289978265762e-02 + <_> + + 0 -1 293 -4.7252390533685684e-02 + + -7.9193192720413208e-01 1.2737370096147060e-02 + <_> + + 0 -1 294 -1.6451090341433883e-03 + + 2.0376729965209961e-01 -1.3230639696121216e-01 + <_> + + 0 -1 295 2.5758889969438314e-03 + + -6.3503406941890717e-02 1.3530080020427704e-01 + <_> + + 0 -1 296 2.0758589729666710e-02 + + 4.7286979854106903e-02 -5.8212000131607056e-01 + <_> + + 0 -1 297 -2.8601480647921562e-02 + + -4.1221970319747925e-01 2.4210980162024498e-02 + <_> + + 0 -1 298 -2.8691580519080162e-02 + + -5.5404680967330933e-01 4.5068629086017609e-02 + <_> + + 0 -1 299 -2.6637869887053967e-03 + + 1.2570230662822723e-01 -1.6319499909877777e-01 + <_> + + 0 -1 300 -4.4750720262527466e-03 + + -2.7138069272041321e-01 1.0293100029230118e-01 + <_> + + 0 -1 301 4.0937099605798721e-02 + + -3.2065469771623611e-02 1.3092640042304993e-01 + <_> + + 0 -1 302 7.5827181339263916e-02 + + -5.1221519708633423e-02 5.6596297025680542e-01 + <_> + 58 + -9.1252201795578003e-01 + + <_> + + 0 -1 303 -4.2669968679547310e-03 + + 1.7704419791698456e-01 -2.8265419602394104e-01 + <_> + + 0 -1 304 -2.2577939555048943e-02 + + 2.3657959699630737e-01 -4.2326368391513824e-02 + <_> + + 0 -1 305 -9.8107997328042984e-03 + + -3.8568308949470520e-01 9.0982303023338318e-02 + <_> + + 0 -1 306 3.8510379381477833e-03 + + -1.0270400345325470e-01 1.9267590343952179e-01 + <_> + + 0 -1 307 -2.0688450895249844e-03 + + 1.6656570136547089e-01 -2.1394389867782593e-01 + <_> + + 0 -1 308 -5.8368500322103500e-02 + + 3.4833571314811707e-01 -8.0605462193489075e-02 + <_> + + 0 -1 309 5.6290920823812485e-02 + + -6.1617989093065262e-02 6.9421827793121338e-01 + <_> + + 0 -1 310 5.5776340886950493e-03 + + 7.8374862670898438e-02 -4.0764930844306946e-01 + <_> + + 0 -1 311 5.0974669866263866e-03 + + 1.5001790225505829e-01 -2.7620849013328552e-01 + <_> + + 0 -1 312 2.4134019389748573e-02 + + -3.7685971707105637e-02 4.0111309289932251e-01 + <_> + + 0 -1 313 2.6251180097460747e-03 + + -1.8986889719963074e-01 1.6666570305824280e-01 + <_> + + 0 -1 314 -2.3179719224572182e-02 + + -6.0807460546493530e-01 3.3016931265592575e-02 + <_> + + 0 -1 315 -1.7960369586944580e-03 + + 1.8328389525413513e-01 -1.6300560534000397e-01 + <_> + + 0 -1 316 1.1327250301837921e-01 + + 1.6392359510064125e-02 -3.8521450757980347e-01 + <_> + + 0 -1 317 -1.1120930314064026e-02 + + -2.6789391040802002e-01 1.2030880153179169e-01 + <_> + + 0 -1 318 8.9298561215400696e-03 + + -6.4766243100166321e-02 5.2446700632572174e-02 + <_> + + 0 -1 319 3.0264519155025482e-02 + + -5.3343709558248520e-02 4.9170601367950439e-01 + <_> + + 0 -1 320 1.3036240637302399e-01 + + 9.9123492836952209e-03 -8.0775249004364014e-01 + <_> + + 0 -1 321 -4.8941900022327900e-03 + + 1.4153289794921875e-01 -2.4222679436206818e-01 + <_> + + 0 -1 322 -1.8009349703788757e-02 + + -1.8352709710597992e-01 5.3784269839525223e-02 + <_> + + 0 -1 323 6.3028637669049203e-05 + + -2.0836220681667328e-01 1.3861179351806641e-01 + <_> + + 0 -1 324 -3.8127291202545166e-01 + + -7.6527822017669678e-01 3.4578099846839905e-02 + <_> + + 0 -1 325 1.6168570145964622e-02 + + -7.8577049076557159e-02 3.6086350679397583e-01 + <_> + + 0 -1 326 -2.0725380629301071e-02 + + -3.2905191183090210e-01 8.1693336367607117e-02 + <_> + + 0 -1 327 -1.4763489889446646e-04 + + 1.0449170321226120e-01 -2.7624139189720154e-01 + <_> + + 0 -1 328 -1.6959169879555702e-02 + + -2.4150790274143219e-01 5.4569680243730545e-02 + <_> + + 0 -1 329 -1.5221100300550461e-02 + + 4.1033148765563965e-01 -6.8333253264427185e-02 + <_> + + 0 -1 330 -9.6041243523359299e-03 + + -3.3569648861885071e-01 8.6250491440296173e-02 + <_> + + 0 -1 331 -1.6476860037073493e-03 + + 1.6236330568790436e-01 -1.9044490158557892e-01 + <_> + + 0 -1 332 -1.0705839842557907e-01 + + -8.6767107248306274e-01 7.3941340669989586e-03 + <_> + + 0 -1 333 -1.8818160519003868e-02 + + -3.6879110336303711e-01 6.8846642971038818e-02 + <_> + + 0 -1 334 -5.6142187677323818e-03 + + 1.7322039604187012e-01 -1.2514470517635345e-01 + <_> + + 0 -1 335 7.3969298973679543e-03 + + -8.5467368364334106e-02 3.2027161121368408e-01 + <_> + + 0 -1 336 9.4870915636420250e-03 + + 6.3168406486511230e-02 -2.0918910205364227e-01 + <_> + + 0 -1 337 1.8458140548318624e-03 + + -1.5436279773712158e-01 1.8517020344734192e-01 + <_> + + 0 -1 338 -1.9747359678149223e-02 + + 3.3071118593215942e-01 -7.6775848865509033e-02 + <_> + + 0 -1 339 3.2421160489320755e-02 + + 8.2021132111549377e-02 -4.0147501230239868e-01 + <_> + + 0 -1 340 2.9075390193611383e-03 + + -7.7174037694931030e-02 1.0620699822902679e-01 + <_> + + 0 -1 341 1.5189359895884991e-02 + + 6.0363899916410446e-02 -4.1365239024162292e-01 + <_> + + 0 -1 342 -3.0683739110827446e-02 + + 4.3470621109008789e-01 -5.9381321072578430e-02 + <_> + + 0 -1 343 -1.0973449796438217e-02 + + -2.9535230994224548e-01 8.5516467690467834e-02 + <_> + + 0 -1 344 -3.9540361613035202e-02 + + -2.8765881061553955e-01 3.4472968429327011e-02 + <_> + + 0 -1 345 -3.7935871630907059e-02 + + 3.8199868798255920e-01 -8.5364766418933868e-02 + <_> + + 0 -1 346 3.0669810250401497e-02 + + 4.4738098978996277e-02 -1.7703640460968018e-01 + <_> + + 0 -1 347 1.7194509506225586e-01 + + -5.9214178472757339e-02 4.9291038513183594e-01 + <_> + + 0 -1 348 -6.7055500112473965e-03 + + 1.6410259902477264e-01 -2.1826469898223877e-01 + <_> + + 0 -1 349 -3.8577869534492493e-01 + + -6.7176771163940430e-01 4.2349591851234436e-02 + <_> + + 0 -1 350 2.7213040739297867e-02 + + 1.2266149744391441e-02 -2.2954210638999939e-01 + <_> + + 0 -1 351 -1.9294980913400650e-02 + + -5.8373439311981201e-01 3.8380999118089676e-02 + <_> + + 0 -1 352 7.6792249456048012e-03 + + -4.7490350902080536e-02 1.5964460372924805e-01 + <_> + + 0 -1 353 6.0242269682930782e-05 + + -1.1734239757061005e-01 1.8236650526523590e-01 + <_> + + 0 -1 354 -6.6498141677584499e-05 + + 7.4745140969753265e-02 -1.6989439725875854e-01 + <_> + + 0 -1 355 4.3275849893689156e-03 + + 7.3789797723293304e-02 -2.8444349765777588e-01 + <_> + + 0 -1 356 -3.3140469342470169e-02 + + -4.0606608986854553e-01 1.0028730146586895e-02 + <_> + + 0 -1 357 9.9181402474641800e-03 + + -7.9339787364006042e-02 2.8190010786056519e-01 + <_> + + 0 -1 358 -2.3577339015901089e-03 + + 1.5301220118999481e-01 -1.0475979745388031e-01 + <_> + + 0 -1 359 -2.6200819760560989e-02 + + -5.4185032844543457e-01 4.4369250535964966e-02 + <_> + + 0 -1 360 4.7328658401966095e-02 + + 1.8897749483585358e-02 -8.2665932178497314e-01 + <_> + 44 + -1.1653599739074707e+00 + + <_> + + 0 -1 361 2.9921719804406166e-02 + + -3.2315000891685486e-01 5.1092821359634399e-01 + <_> + + 0 -1 362 5.6147608906030655e-02 + + -1.2574400007724762e-01 6.6749179363250732e-01 + <_> + + 0 -1 363 -1.3759849593043327e-02 + + 4.0691190958023071e-01 -2.1075299382209778e-01 + <_> + + 0 -1 364 -4.3788701295852661e-03 + + 2.7940139174461365e-01 -2.0955459773540497e-01 + <_> + + 0 -1 365 1.9208889454603195e-02 + + -8.9800693094730377e-02 5.0936561822891235e-01 + <_> + + 0 -1 366 -8.9393591042608023e-04 + + 1.0703620314598083e-01 -1.2294200062751770e-01 + <_> + + 0 -1 367 -6.2918022740632296e-04 + + -3.7847930192947388e-01 1.3008819520473480e-01 + <_> + + 0 -1 368 -1.6248769825324416e-03 + + 1.7750020325183868e-01 -2.7811211347579956e-01 + <_> + + 0 -1 369 -4.6151960268616676e-03 + + 2.4071510136127472e-01 -1.4269010722637177e-01 + <_> + + 0 -1 370 5.7162828743457794e-02 + + -1.8474869430065155e-02 4.5086058974266052e-01 + <_> + + 0 -1 371 -3.8265369366854429e-03 + + 2.5951761007308960e-01 -1.1455159634351730e-01 + <_> + + 0 -1 372 -4.5235190540552139e-02 + + -3.3849009871482849e-01 3.4538950771093369e-02 + <_> + + 0 -1 373 3.8135750219225883e-03 + + 1.1333999782800674e-01 -2.7620390057563782e-01 + <_> + + 0 -1 374 4.5108258724212646e-02 + + 2.8602050617337227e-02 -1.5837669372558594e-01 + <_> + + 0 -1 375 -2.7794970665127039e-03 + + 2.8897428512573242e-01 -1.0822720080614090e-01 + <_> + + 0 -1 376 5.6366869248449802e-03 + + -1.0184790194034576e-01 7.8787103295326233e-02 + <_> + + 0 -1 377 -5.2986819297075272e-02 + + 5.2964997291564941e-01 -6.5543353557586670e-02 + <_> + + 0 -1 378 7.4737891554832458e-02 + + 2.6320660486817360e-02 -3.0487209558486938e-01 + <_> + + 0 -1 379 4.1559520177543163e-03 + + -2.2977170348167419e-01 1.5662179887294769e-01 + <_> + + 0 -1 380 -2.9388200491666794e-03 + + -1.6916410624980927e-01 9.6996672451496124e-02 + <_> + + 0 -1 381 -1.3065510429441929e-02 + + 4.0258568525314331e-01 -7.1614369750022888e-02 + <_> + + 0 -1 382 -3.4928251057863235e-02 + + -4.9449989199638367e-01 2.2547820582985878e-02 + <_> + + 0 -1 383 2.1728971041738987e-03 + + -1.5552569925785065e-01 2.0136219263076782e-01 + <_> + + 0 -1 384 1.4387349598109722e-02 + + 3.6348100751638412e-02 -2.9468619823455811e-01 + <_> + + 0 -1 385 6.7830132320523262e-03 + + -8.2248352468013763e-02 3.3857500553131104e-01 + <_> + + 0 -1 386 -7.2883836925029755e-02 + + -3.4577670693397522e-01 1.9601320847868919e-02 + <_> + + 0 -1 387 -4.5158518478274345e-03 + + 1.7059490084648132e-01 -1.9742819666862488e-01 + <_> + + 0 -1 388 -1.3742079958319664e-02 + + -2.1214349567890167e-01 3.3953689038753510e-02 + <_> + + 0 -1 389 7.8056701458990574e-03 + + 7.1426697075366974e-02 -3.4223988652229309e-01 + <_> + + 0 -1 390 2.1649990230798721e-02 + + -6.1925049871206284e-02 3.7267661094665527e-01 + <_> + + 0 -1 391 -6.7706637084484100e-02 + + -3.0304160714149475e-01 9.4357587397098541e-02 + <_> + + 0 -1 392 -2.1855749655514956e-03 + + 1.0831770300865173e-01 -1.5530540049076080e-01 + <_> + + 0 -1 393 -2.5483060162514448e-03 + + -2.4103440344333649e-01 9.2916287481784821e-02 + <_> + + 0 -1 394 -6.7207813262939453e-02 + + -6.6259348392486572e-01 1.6074649989604950e-02 + <_> + + 0 -1 395 4.7799371182918549e-02 + + -4.4412638992071152e-02 6.0569787025451660e-01 + <_> + + 0 -1 396 -9.1178417205810547e-02 + + 2.4761490523815155e-01 -3.4762401133775711e-02 + <_> + + 0 -1 397 -3.8592480123043060e-03 + + -2.5366741418838501e-01 1.0194999724626541e-01 + <_> + + 0 -1 398 2.4100970476865768e-03 + + -1.2133970111608505e-01 1.9767910242080688e-01 + <_> + + 0 -1 399 -5.3831469267606735e-03 + + 1.7103940248489380e-01 -1.6189830005168915e-01 + <_> + + 0 -1 400 9.1004222631454468e-03 + + -6.0921549797058105e-02 1.7695249617099762e-01 + <_> + + 0 -1 401 2.2724110167473555e-03 + + -9.0476967394351959e-02 2.7440631389617920e-01 + <_> + + 0 -1 402 -8.0621562898159027e-02 + + -8.8045567274093628e-01 1.7193239182233810e-02 + <_> + + 0 -1 403 3.8965709973126650e-03 + + -1.7037920653820038e-01 1.7979580163955688e-01 + <_> + + 0 -1 404 -4.3093641288578510e-03 + + -2.9382050037384033e-01 8.6317472159862518e-02 + <_> + 44 + -9.4284927845001221e-01 + + <_> + + 0 -1 405 -6.3116192817687988e-02 + + 5.5512517690658569e-01 -3.5997709631919861e-01 + <_> + + 0 -1 406 8.4350287914276123e-02 + + -1.2531270086765289e-01 5.3567689657211304e-01 + <_> + + 0 -1 407 -2.1390730142593384e-01 + + 7.5156861543655396e-01 -8.8270872831344604e-02 + <_> + + 0 -1 408 -2.9744980856776237e-02 + + 2.0106209814548492e-01 -1.2106689810752869e-01 + <_> + + 0 -1 409 -1.1987680196762085e-01 + + 6.4692199230194092e-01 -7.7747613191604614e-02 + <_> + + 0 -1 410 3.0843529384583235e-03 + + -6.3067637383937836e-02 7.7889077365398407e-02 + <_> + + 0 -1 411 -4.5560211874544621e-03 + + 1.8972270190715790e-01 -1.9929079711437225e-01 + <_> + + 0 -1 412 4.4629329931922257e-04 + + 1.4051589369773865e-01 -3.0292418599128723e-01 + <_> + + 0 -1 413 -6.4954371191561222e-03 + + 3.1942290067672729e-01 -1.1072000116109848e-01 + <_> + + 0 -1 414 -2.1751760505139828e-03 + + 1.6477259993553162e-01 -8.0424778163433075e-02 + <_> + + 0 -1 415 6.5875840373337269e-03 + + 1.4716550707817078e-01 -3.0198150873184204e-01 + <_> + + 0 -1 416 2.0701209083199501e-02 + + -4.2996689677238464e-02 4.0123820304870605e-01 + <_> + + 0 -1 417 2.5877119041979313e-03 + + 1.2630540132522583e-01 -2.7518120408058167e-01 + <_> + + 0 -1 418 -1.0545079596340656e-02 + + 1.9637629389762878e-01 -3.9772778749465942e-02 + <_> + + 0 -1 419 6.2396968714892864e-03 + + -8.3563409745693207e-02 3.6655488610267639e-01 + <_> + + 0 -1 420 1.4458670280873775e-02 + + 6.3301697373390198e-02 -5.8498907089233398e-01 + <_> + + 0 -1 421 3.1263440847396851e-02 + + -1.0675270110368729e-01 3.4852859377861023e-01 + <_> + + 0 -1 422 1.4865349512547255e-03 + + 1.3709670305252075e-01 -1.3731659948825836e-01 + <_> + + 0 -1 423 -1.7898039368446916e-04 + + 1.7839649319648743e-01 -2.5751718878746033e-01 + <_> + + 0 -1 424 7.7714473009109497e-02 + + 5.7081848382949829e-02 -2.4273400008678436e-01 + <_> + + 0 -1 425 2.2228270769119263e-02 + + 1.4593790471553802e-01 -2.0994609594345093e-01 + <_> + + 0 -1 426 1.6969949938356876e-03 + + -1.4418889582157135e-01 2.7375409007072449e-01 + <_> + + 0 -1 427 -2.0023470744490623e-02 + + -3.7556248903274536e-01 8.1627696752548218e-02 + <_> + + 0 -1 428 3.8644319865852594e-03 + + -6.4490430057048798e-02 1.5921689569950104e-01 + <_> + + 0 -1 429 -3.0527650378644466e-03 + + 2.6751521229743958e-01 -1.0531850159168243e-01 + <_> + + 0 -1 430 5.6112320162355900e-03 + + -6.8567730486392975e-02 2.1234990656375885e-01 + <_> + + 0 -1 431 4.6622268855571747e-03 + + 1.4254149794578552e-01 -2.0892719924449921e-01 + <_> + + 0 -1 432 2.4710448924452066e-03 + + 7.2614386677742004e-02 -1.8833909928798676e-01 + <_> + + 0 -1 433 1.2655000202357769e-02 + + -8.3605259656906128e-02 4.3262240290641785e-01 + <_> + + 0 -1 434 -1.7724519595503807e-02 + + 1.7432230710983276e-01 -2.8479820117354393e-02 + <_> + + 0 -1 435 -7.2321272455155849e-04 + + 1.5343970060348511e-01 -2.4012179672718048e-01 + <_> + + 0 -1 436 -6.2155709601938725e-03 + + 2.5166681408882141e-01 -8.5519887506961823e-02 + <_> + + 0 -1 437 4.1632771492004395e-02 + + 5.0593800842761993e-02 -6.0965442657470703e-01 + <_> + + 0 -1 438 2.3918300867080688e-02 + + -3.6809660494327545e-02 3.9055478572845459e-01 + <_> + + 0 -1 439 -7.4353138916194439e-03 + + 1.5018579363822937e-01 -1.8627819418907166e-01 + <_> + + 0 -1 440 -2.0571449771523476e-02 + + -2.8574559092521667e-01 4.8302378505468369e-02 + <_> + + 0 -1 441 -7.3831980116665363e-03 + + 3.6680561304092407e-01 -9.6067756414413452e-02 + <_> + + 0 -1 442 9.7222924232482910e-03 + + 6.3898019492626190e-02 -1.7262579500675201e-01 + <_> + + 0 -1 443 -2.1807629615068436e-02 + + 1.8027269840240479e-01 -1.9109119474887848e-01 + <_> + + 0 -1 444 5.8147668838500977e-02 + + 8.5709961131215096e-03 -4.6250829100608826e-01 + <_> + + 0 -1 445 -9.4539504498243332e-03 + + -2.8908729553222656e-01 1.1421570181846619e-01 + <_> + + 0 -1 446 -2.1080709993839264e-02 + + 3.7570050358772278e-01 -2.5591030716896057e-02 + <_> + + 0 -1 447 -4.0629571303725243e-03 + + 2.7146670222282410e-01 -1.0845380276441574e-01 + <_> + + 0 -1 448 -1.2826620042324066e-01 + + 1. -1.0962430387735367e-03 + <_> + 61 + -9.5620310306549072e-01 + + <_> + + 0 -1 449 -1.2662290036678314e-01 + + 6.2268221378326416e-01 -1.4810459315776825e-01 + <_> + + 0 -1 450 -7.0846290327608585e-03 + + 2.0133779942989349e-01 -1.7728950083255768e-01 + <_> + + 0 -1 451 1.1459200084209442e-01 + + -8.8975846767425537e-02 5.7395541667938232e-01 + <_> + + 0 -1 452 3.3472150098532438e-03 + + 7.5708203017711639e-02 -2.8222179412841797e-01 + <_> + + 0 -1 453 5.1924228668212891e-02 + + -1.3948489725589752e-01 2.5681090354919434e-01 + <_> + + 0 -1 454 -4.1343908756971359e-02 + + 2.2414180636405945e-01 -4.3653670698404312e-02 + <_> + + 0 -1 455 -3.2056469470262527e-02 + + -5.9409761428833008e-01 5.1891159266233444e-02 + <_> + + 0 -1 456 -4.0590870194137096e-03 + + 1.6402080655097961e-01 -1.5528389811515808e-01 + <_> + + 0 -1 457 -9.1876718215644360e-05 + + 1.0587870329618454e-01 -2.8261598944664001e-01 + <_> + + 0 -1 458 2.8358219191431999e-02 + + 5.7384029030799866e-02 -6.7094147205352783e-02 + <_> + + 0 -1 459 -7.4662521481513977e-02 + + 5.6916707754135132e-01 -4.8785641789436340e-02 + <_> + + 0 -1 460 -3.6556490231305361e-03 + + 2.2369490563869476e-01 -1.2202149629592896e-01 + <_> + + 0 -1 461 3.1778779812157154e-03 + + 1.2240319699048996e-01 -2.7681729197502136e-01 + <_> + + 0 -1 462 3.8044340908527374e-02 + + 2.3216400295495987e-02 -5.3732901811599731e-01 + <_> + + 0 -1 463 8.7831392884254456e-03 + + -7.4337556958198547e-02 3.2851231098175049e-01 + <_> + + 0 -1 464 -5.9818099252879620e-03 + + -1.9504779577255249e-01 6.6976852715015411e-02 + <_> + + 0 -1 465 -1.6369449440389872e-03 + + 1.4674800634384155e-01 -1.8024149537086487e-01 + <_> + + 0 -1 466 -9.9193133413791656e-02 + + 6.8363517522811890e-01 -2.9652720317244530e-02 + <_> + + 0 -1 467 -1.0352009907364845e-02 + + 3.4225308895111084e-01 -8.1141538918018341e-02 + <_> + + 0 -1 468 2.5637909770011902e-02 + + 5.1416900008916855e-02 -1.6697999835014343e-01 + <_> + + 0 -1 469 -1.2416959507390857e-03 + + 1.2488900125026703e-01 -2.1346220374107361e-01 + <_> + + 0 -1 470 1.5018839621916413e-03 + + 9.7934387624263763e-02 -2.6385021209716797e-01 + <_> + + 0 -1 471 -3.2703679054975510e-02 + + 5.7504880428314209e-01 -4.5875400304794312e-02 + <_> + + 0 -1 472 2.1297169849276543e-02 + + 6.1069380491971970e-02 -2.2480219602584839e-01 + <_> + + 0 -1 473 -8.8358018547296524e-04 + + 9.5625787973403931e-02 -2.7564591169357300e-01 + <_> + + 0 -1 474 -3.6556860432028770e-03 + + 2.4107089638710022e-01 -1.0359519720077515e-01 + <_> + + 0 -1 475 3.4300461411476135e-02 + + 3.9062701165676117e-02 -6.2445348501205444e-01 + <_> + + 0 -1 476 1.1492350138723850e-02 + + -6.9246053695678711e-02 3.8258171081542969e-01 + <_> + + 0 -1 477 -3.1294790096580982e-03 + + 1.1273369938135147e-01 -2.3122510313987732e-01 + <_> + + 0 -1 478 -4.0945871733129025e-03 + + -1.7195980250835419e-01 1.3112659752368927e-01 + <_> + + 0 -1 479 -3.0921408906579018e-03 + + -2.5460389256477356e-01 9.6659161150455475e-02 + <_> + + 0 -1 480 -4.1672129184007645e-02 + + 2.7327769994735718e-01 -6.3094623386859894e-02 + <_> + + 0 -1 481 1.1384460143744946e-02 + + -7.1872517466545105e-02 4.1160398721694946e-01 + <_> + + 0 -1 482 -2.3934150114655495e-02 + + 1.3192340731620789e-01 -1.7954839766025543e-01 + <_> + + 0 -1 483 -3.1554169952869415e-02 + + -5.8792132139205933e-01 4.1782889515161514e-02 + <_> + + 0 -1 484 -2.4033859372138977e-02 + + -1.5534760057926178e-01 2.7700260281562805e-02 + <_> + + 0 -1 485 3.1589470803737640e-02 + + -3.9150279015302658e-02 6.0951721668243408e-01 + <_> + + 0 -1 486 -2.4214860051870346e-02 + + -2.4587619304656982e-01 9.1133296489715576e-02 + <_> + + 0 -1 487 1.9322870066389441e-03 + + -1.1647839844226837e-01 1.8819290399551392e-01 + <_> + + 0 -1 488 -3.6017759703099728e-03 + + 9.7600512206554413e-02 -4.8918090760707855e-02 + <_> + + 0 -1 489 3.1516118906438351e-03 + + 6.5808869898319244e-02 -3.1577658653259277e-01 + <_> + + 0 -1 490 -6.3677072525024414e-02 + + -8.6415481567382812e-01 -9.9097320344299078e-04 + <_> + + 0 -1 491 -3.9085028693079948e-03 + + 2.0826210081577301e-01 -1.0560230165719986e-01 + <_> + + 0 -1 492 -2.6837719604372978e-02 + + -1.8375129997730255e-01 2.9545329511165619e-02 + <_> + + 0 -1 493 3.1312298960983753e-03 + + -1.2626689672470093e-01 1.6888590157032013e-01 + <_> + + 0 -1 494 -7.3491871356964111e-02 + + -1. 5.6774187833070755e-03 + <_> + + 0 -1 495 1.8034819513559341e-02 + + -6.8617410957813263e-02 3.3438131213188171e-01 + <_> + + 0 -1 496 6.8655997514724731e-02 + + 4.6462309546768665e-03 -8.0664628744125366e-01 + <_> + + 0 -1 497 -4.6970890834927559e-03 + + -2.0121769607067108e-01 1.1580040305852890e-01 + <_> + + 0 -1 498 4.6783890575170517e-02 + + -3.5802699625492096e-02 4.1625639796257019e-01 + <_> + + 0 -1 499 4.5946058817207813e-03 + + 8.8457576930522919e-02 -2.6894488930702209e-01 + <_> + + 0 -1 500 -1.3852829579263926e-03 + + 8.1391222774982452e-02 -1.4880420267581940e-01 + <_> + + 0 -1 501 2.1788759157061577e-02 + + -9.1640457510948181e-02 2.1261249482631683e-01 + <_> + + 0 -1 502 -1.3380090240389109e-04 + + 9.6424743533134460e-02 -1.4717370271682739e-01 + <_> + + 0 -1 503 -4.7990411520004272e-02 + + -6.1987131834030151e-01 3.8760710507631302e-02 + <_> + + 0 -1 504 2.0026009529829025e-02 + + -3.5972420126199722e-02 1.9393420219421387e-01 + <_> + + 0 -1 505 1.0723130544647574e-03 + + -1.9447499513626099e-01 1.2064950168132782e-01 + <_> + + 0 -1 506 2.2665090858936310e-02 + + 4.8719439655542374e-02 -2.3640799522399902e-01 + <_> + + 0 -1 507 -1.1042109690606594e-02 + + -2.6107341051101685e-01 1.0075490176677704e-01 + <_> + + 0 -1 508 -1.2811049818992615e-02 + + 1.5199629962444305e-01 -8.8552959263324738e-02 + <_> + + 0 -1 509 -3.6628648638725281e-02 + + 3.8858860731124878e-01 -7.7304549515247345e-02 + <_> + 72 + -8.7708407640457153e-01 + + <_> + + 0 -1 510 -5.4606638848781586e-02 + + 5.5801349878311157e-01 -1.4168889820575714e-01 + <_> + + 0 -1 511 3.3533740788698196e-02 + + -2.7386279776692390e-02 4.4381770491600037e-01 + <_> + + 0 -1 512 -9.9635301157832146e-03 + + 2.5193908810615540e-01 -1.4647540450096130e-01 + <_> + + 0 -1 513 1.8188880058005452e-03 + + -1.1264120042324066e-01 1.1523260176181793e-01 + <_> + + 0 -1 514 -4.8793829977512360e-02 + + 5.1317107677459717e-01 -7.8665018081665039e-02 + <_> + + 0 -1 515 -1.3357769697904587e-02 + + -1.4197979867458344e-01 1.1862599849700928e-01 + <_> + + 0 -1 516 1.1562240542843938e-03 + + -2.0949220657348633e-01 1.5693040192127228e-01 + <_> + + 0 -1 517 -6.2384512275457382e-03 + + -1.4336450397968292e-01 1.1303550004959106e-01 + <_> + + 0 -1 518 4.4234818778932095e-03 + + -1.0358580201864243e-01 2.4589489400386810e-01 + <_> + + 0 -1 519 5.2964448928833008e-02 + + 1.2561550363898277e-02 -6.2551808357238770e-01 + <_> + + 0 -1 520 5.5844681337475777e-03 + + 8.3967886865139008e-02 -2.4653799831867218e-01 + <_> + + 0 -1 521 -4.1809541289694607e-04 + + 6.9588072597980499e-02 -1.3558819890022278e-01 + <_> + + 0 -1 522 -8.9637134224176407e-03 + + -3.0442738533020020e-01 6.9894723594188690e-02 + <_> + + 0 -1 523 2.4479050189256668e-02 + + -3.1651828438043594e-02 2.0308789610862732e-01 + <_> + + 0 -1 524 -2.5842329487204552e-02 + + 5.0401061773300171e-01 -6.3922062516212463e-02 + <_> + + 0 -1 525 -2.0785620436072350e-03 + + 1.0980220139026642e-01 -1.1839559674263000e-01 + <_> + + 0 -1 526 6.8030342459678650e-02 + + 4.2290739715099335e-02 -5.1855510473251343e-01 + <_> + + 0 -1 527 -7.0639760233461857e-03 + + -2.0031100511550903e-01 2.4955609813332558e-02 + <_> + + 0 -1 528 -3.4848200157284737e-03 + + 2.3135329782962799e-01 -9.6989557147026062e-02 + <_> + + 0 -1 529 1.3147160410881042e-02 + + -3.7450950592756271e-02 2.5842788815498352e-01 + <_> + + 0 -1 530 -1.4271659776568413e-02 + + -3.0110171437263489e-01 7.9672336578369141e-02 + <_> + + 0 -1 531 1.2653480283915997e-02 + + 4.9039140343666077e-02 -1.4988109469413757e-01 + <_> + + 0 -1 532 -4.4893440790474415e-03 + + 1.7208859324455261e-01 -1.5355649590492249e-01 + <_> + + 0 -1 533 3.2365400344133377e-02 + + -9.0493112802505493e-02 3.5779160261154175e-01 + <_> + + 0 -1 534 4.6125808730721474e-03 + + 1.1445190012454987e-01 -2.6519489288330078e-01 + <_> + + 0 -1 535 2.8645930811762810e-02 + + -3.5988539457321167e-02 3.0025520920753479e-01 + <_> + + 0 -1 536 -2.3571979254484177e-02 + + -2.4872820079326630e-01 9.1967120766639709e-02 + <_> + + 0 -1 537 -1.0739799588918686e-02 + + -2.1367760002613068e-01 9.6477411687374115e-02 + <_> + + 0 -1 538 2.3728659376502037e-02 + + -7.0916198194026947e-02 4.3828758597373962e-01 + <_> + + 0 -1 539 -3.2800701260566711e-01 + + 5.8840030431747437e-01 -3.1756788492202759e-02 + <_> + + 0 -1 540 7.5008560997957829e-06 + + -1.8288560211658478e-01 1.2022940069437027e-01 + <_> + + 0 -1 541 3.0071409419178963e-02 + + 2.7802020311355591e-02 -4.3224281072616577e-01 + <_> + + 0 -1 542 -2.1936609409749508e-03 + + 1.3592420518398285e-01 -1.4038629829883575e-01 + <_> + + 0 -1 543 2.0174339413642883e-02 + + -6.1628919094800949e-02 3.1579768657684326e-01 + <_> + + 0 -1 544 9.7460206598043442e-03 + + 8.8958032429218292e-02 -2.2594009339809418e-01 + <_> + + 0 -1 545 -1.2958340346813202e-02 + + -1.2200850248336792e-01 8.6518086493015289e-02 + <_> + + 0 -1 546 1.1445499956607819e-02 + + -6.4182333648204803e-02 3.0279749631881714e-01 + <_> + + 0 -1 547 -3.3802569378167391e-03 + + 1.1177670210599899e-01 -1.2922379374504089e-01 + <_> + + 0 -1 548 2.0366210490465164e-02 + + 1.0104539990425110e-01 -2.5991159677505493e-01 + <_> + + 0 -1 549 3.8058649748563766e-02 + + 1.3168349862098694e-02 -7.5580632686614990e-01 + <_> + + 0 -1 550 2.3050000891089439e-03 + + -1.0766649991273880e-01 1.8757669627666473e-01 + <_> + + 0 -1 551 5.1847118884325027e-02 + + -2.2320529446005821e-02 1.8795830011367798e-01 + <_> + + 0 -1 552 1.1383029632270336e-02 + + 6.0226161032915115e-02 -3.5961788892745972e-01 + <_> + + 0 -1 553 8.2553178071975708e-03 + + -8.5131391882896423e-02 2.3493440449237823e-01 + <_> + + 0 -1 554 -2.6984339579939842e-02 + + -2.1479399502277374e-01 9.3656733632087708e-02 + <_> + + 0 -1 555 -1.0289980098605156e-02 + + 5.8254890143871307e-02 -8.3950929343700409e-02 + <_> + + 0 -1 556 -1.4419780200114474e-05 + + 1.0392870008945465e-01 -1.7317299544811249e-01 + <_> + + 0 -1 557 1.0065140202641487e-02 + + -4.1311118751764297e-02 1.7616020143032074e-01 + <_> + + 0 -1 558 -1.4870229642838240e-04 + + 1.5657539665699005e-01 -1.2030059844255447e-01 + <_> + + 0 -1 559 -3.1059589236974716e-03 + + 1.1674880236387253e-01 -9.1372460126876831e-02 + <_> + + 0 -1 560 1.0708030313253403e-02 + + -7.7608227729797363e-02 2.7916100621223450e-01 + <_> + + 0 -1 561 -9.7792129963636398e-03 + + -2.9060921072959900e-01 7.1562640368938446e-02 + <_> + + 0 -1 562 2.0121980458498001e-02 + + 4.3994959443807602e-02 -4.2539501190185547e-01 + <_> + + 0 -1 563 -6.3295163214206696e-02 + + 3.7034231424331665e-01 -5.2549809217453003e-02 + <_> + + 0 -1 564 -8.7289556860923767e-02 + + -6.4299279451370239e-01 3.1952869147062302e-02 + <_> + + 0 -1 565 2.0398540422320366e-02 + + -4.5955598354339600e-02 4.6266159415245056e-01 + <_> + + 0 -1 566 -4.0313000790774822e-03 + + 1.3840849697589874e-01 -1.7980839312076569e-01 + <_> + + 0 -1 567 -1.5734519809484482e-02 + + -1.8477180600166321e-01 6.9983080029487610e-02 + <_> + + 0 -1 568 3.3332880120724440e-03 + + 1.1277650296688080e-01 -1.9513790309429169e-01 + <_> + + 0 -1 569 4.3689161539077759e-02 + + 5.9510939754545689e-03 -5.5423438549041748e-01 + <_> + + 0 -1 570 -2.0920610986649990e-03 + + 1.9163469970226288e-01 -9.7136110067367554e-02 + <_> + + 0 -1 571 2.0574270747601986e-03 + + -1.0197430104017258e-01 1.4083810150623322e-01 + <_> + + 0 -1 572 8.8018123060464859e-03 + + 1.1987809836864471e-01 -1.5638549625873566e-01 + <_> + + 0 -1 573 -1.6882529482245445e-02 + + -1.8438099324703217e-01 1.9492870196700096e-02 + <_> + + 0 -1 574 -6.1647890834137797e-04 + + 1.0665109753608704e-01 -2.2164009511470795e-01 + <_> + + 0 -1 575 1.0317339911125600e-04 + + -1.1228899657726288e-01 1.3858650624752045e-01 + <_> + + 0 -1 576 1.5316329896450043e-02 + + -5.0639409571886063e-02 4.1119828820228577e-01 + <_> + + 0 -1 577 1.0660690255463123e-02 + + 5.8820810168981552e-02 -1.6454669833183289e-01 + <_> + + 0 -1 578 -1.9296869635581970e-02 + + 3.9260959625244141e-01 -5.2761189639568329e-02 + <_> + + 0 -1 579 1.0018110275268555e-02 + + 1.0068470239639282e-01 -1.9756269454956055e-01 + <_> + + 0 -1 580 -2.7263790369033813e-02 + + 3.5332089662551880e-01 -5.5305551737546921e-02 + <_> + + 0 -1 581 5.4494310170412064e-03 + + 6.7253768444061279e-02 -1.8384470045566559e-01 + <_> + 75 + -8.5267168283462524e-01 + + <_> + + 0 -1 582 -5.7434860616922379e-02 + + 5.0582551956176758e-01 -1.2274570018053055e-01 + <_> + + 0 -1 583 -1.2750659883022308e-01 + + 5.7605969905853271e-01 -4.3710928410291672e-02 + <_> + + 0 -1 584 -6.3675642013549805e-02 + + 5.7122522592544556e-01 -4.9968320876359940e-02 + <_> + + 0 -1 585 -1.1928480118513107e-02 + + 2.1641939878463745e-01 -1.8480269610881805e-01 + <_> + + 0 -1 586 1.3247699826024473e-04 + + -2.2685679793357849e-01 1.0648279637098312e-01 + <_> + + 0 -1 587 6.4140267204493284e-04 + + 9.4751678407192230e-02 -2.6892009377479553e-01 + <_> + + 0 -1 588 -2.9463530518114567e-03 + + 1.3910910487174988e-01 -1.7091070115566254e-01 + <_> + + 0 -1 589 5.3384741768240929e-03 + + 8.3969242870807648e-02 -9.5441989600658417e-02 + <_> + + 0 -1 590 5.8703150600194931e-02 + + -6.9647520780563354e-02 3.3629441261291504e-01 + <_> + + 0 -1 591 -2.5406300555914640e-03 + + 9.6176013350486755e-02 -1.5758140385150909e-01 + <_> + + 0 -1 592 -3.1899519264698029e-02 + + -2.7956488728523254e-01 7.0359513163566589e-02 + <_> + + 0 -1 593 -3.2022708654403687e-01 + + -9.0805047750473022e-01 7.5922380201518536e-03 + <_> + + 0 -1 594 3.5796251147985458e-02 + + -5.0070770084857941e-02 4.2101579904556274e-01 + <_> + + 0 -1 595 -1.9079160690307617e-01 + + -2.2061030566692352e-01 6.5184786915779114e-02 + <_> + + 0 -1 596 -1.2181829661130905e-02 + + 1.3479439914226532e-01 -1.6667750477790833e-01 + <_> + + 0 -1 597 -3.2165799289941788e-02 + + -2.5105410814285278e-01 1.9344560801982880e-02 + <_> + + 0 -1 598 3.6299630999565125e-02 + + -5.9490781277418137e-02 4.0007731318473816e-01 + <_> + + 0 -1 599 2.0224580541253090e-02 + + 5.6489799171686172e-02 -1.3418239355087280e-01 + <_> + + 0 -1 600 -2.5393130257725716e-02 + + 3.6507838964462280e-01 -6.6002182662487030e-02 + <_> + + 0 -1 601 -1.2022369541227818e-02 + + -1.7655059695243835e-01 7.3997639119625092e-02 + <_> + + 0 -1 602 4.7965139150619507e-02 + + 4.4668558984994888e-02 -4.4584980607032776e-01 + <_> + + 0 -1 603 -2.0564019680023193e-01 + + -7.3254501819610596e-01 1.9955230876803398e-02 + <_> + + 0 -1 604 -1.6601709648966789e-03 + + 1.1633270233869553e-01 -1.5488509833812714e-01 + <_> + + 0 -1 605 8.6899623274803162e-02 + + -5.4107550531625748e-02 2.6952400803565979e-01 + <_> + + 0 -1 606 -1.1374129680916667e-03 + + -1.4314429461956024e-01 1.2444330006837845e-01 + <_> + + 0 -1 607 3.0976340174674988e-02 + + 2.9864860698580742e-02 -3.2607930898666382e-01 + <_> + + 0 -1 608 2.6978010311722755e-02 + + -4.5098248869180679e-02 3.6128848791122437e-01 + <_> + + 0 -1 609 1.9421820342540741e-01 + + 3.2255191355943680e-02 -6.8981701135635376e-01 + <_> + + 0 -1 610 -2.0443359389901161e-02 + + 2.9300108551979065e-01 -6.4483217895030975e-02 + <_> + + 0 -1 611 -4.0420450270175934e-02 + + -7.6823359727859497e-01 1.2281980365514755e-02 + <_> + + 0 -1 612 -1.2641429901123047e-02 + + -2.7573791146278381e-01 6.1901118606328964e-02 + <_> + + 0 -1 613 -3.9670299738645554e-02 + + 3.2828390598297119e-01 -2.0364999771118164e-02 + <_> + + 0 -1 614 2.0246729254722595e-02 + + -5.8393601328134537e-02 3.3060538768768311e-01 + <_> + + 0 -1 615 8.9611168950796127e-03 + + 9.0096317231655121e-02 -2.2343009710311890e-01 + <_> + + 0 -1 616 -8.3055719733238220e-03 + + 1.4175349473953247e-01 -1.2607260048389435e-01 + <_> + + 0 -1 617 -2.8248139642528258e-05 + + 9.4516962766647339e-02 -2.1810370683670044e-01 + <_> + + 0 -1 618 -5.1939398981630802e-03 + + 1.3304319977760315e-01 -1.3341580331325531e-01 + <_> + + 0 -1 619 1.1773110181093216e-01 + + 2.9586199671030045e-02 -2.4020829796791077e-01 + <_> + + 0 -1 620 6.7896701395511627e-02 + + 8.0913707613945007e-02 -2.3454460501670837e-01 + <_> + + 0 -1 621 -2.6683699339628220e-02 + + 3.0590981245040894e-01 -6.4152047038078308e-02 + <_> + + 0 -1 622 3.5058211069554090e-03 + + 8.9341968297958374e-02 -2.2773680090904236e-01 + <_> + + 0 -1 623 -6.5844372147694230e-04 + + 1.2458139657974243e-01 -9.1352440416812897e-02 + <_> + + 0 -1 624 7.2530400939285755e-03 + + -6.9285176694393158e-02 2.5482881069183350e-01 + <_> + + 0 -1 625 -2.8056129813194275e-02 + + -2.0867039263248444e-01 3.3539578318595886e-02 + <_> + + 0 -1 626 -5.1205180585384369e-02 + + -2.4107429385185242e-01 6.4439408481121063e-02 + <_> + + 0 -1 627 2.9234649613499641e-02 + + -5.0803840160369873e-02 3.6485049128532410e-01 + <_> + + 0 -1 628 -1.0219520330429077e-01 + + 4.0123480558395386e-01 -4.2902119457721710e-02 + <_> + + 0 -1 629 1.5104969963431358e-02 + + 1.0481490194797516e-01 -1.8472430109977722e-01 + <_> + + 0 -1 630 -1.2570650316774845e-02 + + -2.0540939271450043e-01 9.3013197183609009e-02 + <_> + + 0 -1 631 1.2253070250153542e-02 + + -5.9285100549459457e-02 2.3927310109138489e-01 + <_> + + 0 -1 632 -2.6166990399360657e-02 + + -6.9966787099838257e-01 2.4906709790229797e-02 + <_> + + 0 -1 633 7.0817661471664906e-03 + + 2.4173120036721230e-02 -5.5144792795181274e-01 + <_> + + 0 -1 634 2.1426850929856300e-02 + + 6.4168840646743774e-02 -2.5997900962829590e-01 + <_> + + 0 -1 635 1.8189709633588791e-02 + + 3.5838250070810318e-02 -1.8020580708980560e-01 + <_> + + 0 -1 636 1.7415799200534821e-02 + + -8.3862036466598511e-02 3.3338528871536255e-01 + <_> + + 0 -1 637 -1.4878029469400644e-03 + + 1.2078859657049179e-01 -1.2769320607185364e-01 + <_> + + 0 -1 638 7.5296638533473015e-03 + + -7.0014707744121552e-02 3.2181090116500854e-01 + <_> + + 0 -1 639 -6.1499018222093582e-02 + + 4.6469798684120178e-01 -1.0073710232973099e-02 + <_> + + 0 -1 640 -1.9133290334139019e-04 + + -1.4094290137290955e-01 1.3830110430717468e-01 + <_> + + 0 -1 641 -2.4422289803624153e-02 + + -2.5292310118675232e-01 6.7684173583984375e-02 + <_> + + 0 -1 642 -2.6136320829391479e-01 + + 3.4003540873527527e-01 -5.8462549000978470e-02 + <_> + + 0 -1 643 -7.6046779751777649e-02 + + -7.8514158725738525e-01 5.2708541043102741e-03 + <_> + + 0 -1 644 -3.0279329512268305e-03 + + 1.8527059257030487e-01 -9.0691961348056793e-02 + <_> + + 0 -1 645 -8.0219199880957603e-03 + + -1.2540580332279205e-01 3.0594889074563980e-02 + <_> + + 0 -1 646 -2.0705960690975189e-01 + + -7.5411921739578247e-01 2.1201130002737045e-02 + <_> + + 0 -1 647 -9.5322817564010620e-02 + + -2.9623070359230042e-01 1.3138709589838982e-02 + <_> + + 0 -1 648 9.5921624451875687e-03 + + 8.4324322640895844e-02 -2.1746580302715302e-01 + <_> + + 0 -1 649 -1.3089469633996487e-02 + + 9.3607500195503235e-02 -6.5754130482673645e-02 + <_> + + 0 -1 650 1.1732880026102066e-02 + + -8.0039046704769135e-02 2.3291939496994019e-01 + <_> + + 0 -1 651 1.5239049494266510e-01 + + 9.9299130961298943e-03 -6.5196067094802856e-01 + <_> + + 0 -1 652 -6.4591512084007263e-02 + + 2.8372219204902649e-01 -6.0058828443288803e-02 + <_> + + 0 -1 653 -5.5493030697107315e-02 + + 2.6659101247787476e-01 -1.0336419567465782e-02 + <_> + + 0 -1 654 -5.0287410616874695e-02 + + -6.9501471519470215e-01 2.7849879115819931e-02 + <_> + + 0 -1 655 -4.7794249653816223e-01 + + -9.2871952056884766e-01 5.9050112031400204e-03 + <_> + + 0 -1 656 -1.4398519881069660e-02 + + -4.5541068911552429e-01 3.6409981548786163e-02 + <_> + 67 + -7.4186658859252930e-01 + + <_> + + 0 -1 657 1.9511899445205927e-03 + + -2.4936990439891815e-01 1.4111639559268951e-01 + <_> + + 0 -1 658 -4.6634670346975327e-02 + + 3.7840589880943298e-01 -7.8401736915111542e-02 + <_> + + 0 -1 659 1.6193749383091927e-02 + + 7.5213313102722168e-02 -4.1991469264030457e-01 + <_> + + 0 -1 660 -1.2459639401640743e-04 + + 6.8576186895370483e-02 -1.7935420572757721e-01 + <_> + + 0 -1 661 7.3257791809737682e-03 + + 1.0322099924087524e-01 -2.6099279522895813e-01 + <_> + + 0 -1 662 -1.5020779756014235e-05 + + 7.3122598230838776e-02 -1.6718889772891998e-01 + <_> + + 0 -1 663 -3.4522008150815964e-02 + + -3.9326989650726318e-01 7.6727166771888733e-02 + <_> + + 0 -1 664 -8.2679510116577148e-02 + + -7.4677819013595581e-01 1.5530600212514400e-02 + <_> + + 0 -1 665 8.2162402570247650e-02 + + -6.9249503314495087e-02 3.7914600968360901e-01 + <_> + + 0 -1 666 3.4187830984592438e-02 + + 4.2608659714460373e-02 -1.5429890155792236e-01 + <_> + + 0 -1 667 -1.7891369760036469e-02 + + -3.0639570951461792e-01 7.8118398785591125e-02 + <_> + + 0 -1 668 3.3130999654531479e-02 + + -5.6183800101280212e-02 3.7405240535736084e-01 + <_> + + 0 -1 669 -5.7486710138618946e-03 + + 1.2490350008010864e-01 -2.0527860522270203e-01 + <_> + + 0 -1 670 3.3536829054355621e-02 + + -4.8344220966100693e-02 2.6724401116371155e-01 + <_> + + 0 -1 671 2.4723829701542854e-02 + + 8.3678968250751495e-02 -3.3730649948120117e-01 + <_> + + 0 -1 672 2.2355809342116117e-03 + + 1.0374590009450912e-01 -1.3071919977664948e-01 + <_> + + 0 -1 673 -2.4322168901562691e-03 + + 1.5645089745521545e-01 -1.3284459710121155e-01 + <_> + + 0 -1 674 2.5999119505286217e-02 + + -8.0343127250671387e-02 2.1610119938850403e-01 + <_> + + 0 -1 675 3.6965688195778057e-05 + + -1.7871010303497314e-01 1.0563120245933533e-01 + <_> + + 0 -1 676 -1.6291500627994537e-01 + + -6.9141697883605957e-01 2.2374730557203293e-02 + <_> + + 0 -1 677 1.3008140027523041e-01 + + -4.2769040912389755e-02 4.6373569965362549e-01 + <_> + + 0 -1 678 2.7658540755510330e-02 + + -3.7108600139617920e-02 3.8386580348014832e-01 + <_> + + 0 -1 679 -1.0020419955253601e-02 + + -2.6328051090240479e-01 7.4858680367469788e-02 + <_> + + 0 -1 680 -3.0459940433502197e-02 + + 3.2300901412963867e-01 -2.5858370587229729e-02 + <_> + + 0 -1 681 1.3251040363684297e-03 + + 1.4447669684886932e-01 -2.1082170307636261e-01 + <_> + + 0 -1 682 -2.7931010350584984e-02 + + 1.4374519884586334e-01 -1.6162300109863281e-01 + <_> + + 0 -1 683 -8.8642723858356476e-03 + + 2.3000620305538177e-01 -9.5095098018646240e-02 + <_> + + 0 -1 684 -1.2213969603180885e-02 + + -2.4646399915218353e-01 6.5522022545337677e-02 + <_> + + 0 -1 685 -4.8737529665231705e-02 + + -7.9127711057662964e-01 2.5416409596800804e-02 + <_> + + 0 -1 686 6.1185289174318314e-02 + + -1.2226430408190936e-04 -9.0545868873596191e-01 + <_> + + 0 -1 687 2.6453679427504539e-02 + + 2.6562800630927086e-02 -6.3954341411590576e-01 + <_> + + 0 -1 688 8.8589917868375778e-03 + + 5.4145850241184235e-02 -2.1601280570030212e-01 + <_> + + 0 -1 689 3.4847941249608994e-02 + + -4.5749358832836151e-02 4.3935400247573853e-01 + <_> + + 0 -1 690 -1.4598210155963898e-01 + + -5.5561769008636475e-01 9.5249973237514496e-03 + <_> + + 0 -1 691 -5.0456568598747253e-02 + + -7.5287848711013794e-01 2.0214710384607315e-02 + <_> + + 0 -1 692 -8.5443779826164246e-02 + + -1. -1.3681349810212851e-03 + <_> + + 0 -1 693 1.3248980045318604e-02 + + 6.3400700688362122e-02 -2.5411811470985413e-01 + <_> + + 0 -1 694 -6.5935611724853516e-01 + + -1. 7.7378489077091217e-03 + <_> + + 0 -1 695 5.0879311747848988e-03 + + -8.3207741379737854e-02 1.8876290321350098e-01 + <_> + + 0 -1 696 -3.4071630798280239e-03 + + 1.4578290283679962e-01 -9.1960333287715912e-02 + <_> + + 0 -1 697 -2.1656269207596779e-02 + + -6.5364891290664673e-01 2.7129750698804855e-02 + <_> + + 0 -1 698 9.4357347115874290e-03 + + 6.4360111951828003e-02 -2.3885479569435120e-01 + <_> + + 0 -1 699 -7.5177568942308426e-03 + + 2.4519060552120209e-01 -6.8221837282180786e-02 + <_> + + 0 -1 700 1.6067629680037498e-02 + + 7.6069780625402927e-03 -3.1668719649314880e-01 + <_> + + 0 -1 701 -1.8057749839499593e-03 + + 1.2710370123386383e-01 -1.2145719677209854e-01 + <_> + + 0 -1 702 -4.4154901057481766e-02 + + -4.8579609394073486e-01 2.3444859310984612e-02 + <_> + + 0 -1 703 7.5462698005139828e-03 + + 6.8430766463279724e-02 -2.3316520452499390e-01 + <_> + + 0 -1 704 1.0868260264396667e-01 + + -4.1663911193609238e-02 3.9452219009399414e-01 + <_> + + 0 -1 705 6.1248701810836792e-01 + + 2.0702170208096504e-02 -9.8494791984558105e-01 + <_> + + 0 -1 706 4.9828290939331055e-02 + + 2.7304550167173147e-03 -4.0181699395179749e-01 + <_> + + 0 -1 707 -7.2768718004226685e-02 + + 3.2676479220390320e-01 -4.9144338816404343e-02 + <_> + + 0 -1 708 2.4314310401678085e-02 + + -7.8135710209608078e-03 5.8223301172256470e-01 + <_> + + 0 -1 709 -1.7177179688587785e-04 + + 8.1669911742210388e-02 -2.0376220345497131e-01 + <_> + + 0 -1 710 -4.0095269680023193e-02 + + 5.4681521654129028e-01 -1.7179539427161217e-02 + <_> + + 0 -1 711 -8.9634567499160767e-02 + + -8.1614011526107788e-01 2.1283889189362526e-02 + <_> + + 0 -1 712 1.8692140281200409e-01 + + 8.3980746567249298e-03 -6.0185301303863525e-01 + <_> + + 0 -1 713 -4.3038379400968552e-02 + + -8.7898987531661987e-01 1.4930729754269123e-02 + <_> + + 0 -1 714 -1.8602630007080734e-04 + + 4.0156241506338120e-02 -8.2604438066482544e-02 + <_> + + 0 -1 715 -1.4392189914360642e-03 + + -1.7102399468421936e-01 9.1203540563583374e-02 + <_> + + 0 -1 716 4.2160619050264359e-02 + + -3.5861019045114517e-02 1.5174309909343719e-01 + <_> + + 0 -1 717 7.5991409830749035e-03 + + 1.0874529927968979e-01 -1.6147160530090332e-01 + <_> + + 0 -1 718 -5.7539329864084721e-03 + + -2.5677061080932617e-01 5.8457151055335999e-02 + <_> + + 0 -1 719 -2.7736749500036240e-02 + + 2.2325170040130615e-01 -7.4071511626243591e-02 + <_> + + 0 -1 720 -2.5676110759377480e-02 + + 1.8831080198287964e-01 -5.3860381245613098e-02 + <_> + + 0 -1 721 1.5890730544924736e-02 + + 5.1709540188312531e-02 -3.8476571440696716e-01 + <_> + + 0 -1 722 -8.6374267935752869e-02 + + -5.5680698156356812e-01 9.4922119751572609e-03 + <_> + + 0 -1 723 1.9480630289763212e-03 + + -1.0807219892740250e-01 1.4771680533885956e-01 + <_> + 88 + -8.3640968799591064e-01 + + <_> + + 0 -1 724 -6.8531660363078117e-03 + + 2.8935509920120239e-01 -2.7689141035079956e-01 + <_> + + 0 -1 725 -6.9217637181282043e-02 + + 3.4909790754318237e-01 -4.9741089344024658e-02 + <_> + + 0 -1 726 -1.3092979788780212e-01 + + 4.2791560292243958e-01 -9.6156008541584015e-02 + <_> + + 0 -1 727 -2.9759139579255134e-05 + + 1.1675780266523361e-01 -2.4678389728069305e-01 + <_> + + 0 -1 728 -4.7100789844989777e-02 + + 3.7259110808372498e-01 -5.9072919189929962e-02 + <_> + + 0 -1 729 4.4124510139226913e-02 + + 7.8904099762439728e-02 -2.5528541207313538e-01 + <_> + + 0 -1 730 4.2540309950709343e-03 + + -2.3612380027770996e-01 1.2856779992580414e-01 + <_> + + 0 -1 731 -1.0833570268005133e-03 + + 1.4347310364246368e-01 -1.4203630387783051e-01 + <_> + + 0 -1 732 5.9925230743829161e-05 + + -1.9927270710468292e-01 8.8502913713455200e-02 + <_> + + 0 -1 733 -7.3021486401557922e-02 + + -8.0666261911392212e-01 3.2041858881711960e-02 + <_> + + 0 -1 734 7.9495050013065338e-03 + + -6.5878443419933319e-02 2.7071261405944824e-01 + <_> + + 0 -1 735 -3.3911041100509465e-04 + + 1.3490739464759827e-01 -1.3354760408401489e-01 + <_> + + 0 -1 736 -2.6010179892182350e-02 + + -2.8074580430984497e-01 7.7902659773826599e-02 + <_> + + 0 -1 737 -3.1153090298175812e-02 + + 2.7022659778594971e-01 -2.6994340121746063e-02 + <_> + + 0 -1 738 1.0946249589323997e-02 + + -1.5993720293045044e-01 1.0350699722766876e-01 + <_> + + 0 -1 739 7.3101207613945007e-02 + + -4.1365791112184525e-03 5.2339828014373779e-01 + <_> + + 0 -1 740 3.0207149684429169e-02 + + -4.9229420721530914e-02 4.2848989367485046e-01 + <_> + + 0 -1 741 6.4985260367393494e-02 + + 3.9118612185120583e-03 -1.0003379583358765e+00 + <_> + + 0 -1 742 -2.9119249433279037e-02 + + -7.7025991678237915e-01 2.3930810391902924e-02 + <_> + + 0 -1 743 5.0458308309316635e-02 + + 6.9283558987081051e-03 -5.1854777336120605e-01 + <_> + + 0 -1 744 -3.8890179246664047e-02 + + -4.8176848888397217e-01 3.0270289629697800e-02 + <_> + + 0 -1 745 5.8319371193647385e-02 + + -2.2101389244198799e-02 2.8393501043319702e-01 + <_> + + 0 -1 746 -1.0803690180182457e-02 + + 1.2842060625553131e-01 -1.3849779963493347e-01 + <_> + + 0 -1 747 9.4525264576077461e-03 + + -5.7194419205188751e-02 1.7759050428867340e-01 + <_> + + 0 -1 748 1.5229170210659504e-02 + + 1.0501170158386230e-01 -2.0518389344215393e-01 + <_> + + 0 -1 749 -8.9435698464512825e-04 + + 6.8668253719806671e-02 -1.4666010439395905e-01 + <_> + + 0 -1 750 -1.8322499468922615e-02 + + -2.3613719642162323e-01 8.3538331091403961e-02 + <_> + + 0 -1 751 2.5474189314991236e-03 + + -8.4731526672840118e-02 1.7211520671844482e-01 + <_> + + 0 -1 752 -1.4951790217310190e-03 + + 1.8642990291118622e-01 -1.2753330171108246e-01 + <_> + + 0 -1 753 2.4796150624752045e-02 + + 3.2923560589551926e-02 -4.0954729914665222e-01 + <_> + + 0 -1 754 -2.8976860921829939e-03 + + 1.4480039477348328e-01 -1.0404679924249649e-01 + <_> + + 0 -1 755 7.0361169055104256e-03 + + -6.7916557192802429e-02 2.1544350683689117e-01 + <_> + + 0 -1 756 -1.1870389804244041e-02 + + -2.5537449121475220e-01 7.4443407356739044e-02 + <_> + + 0 -1 757 2.4765899870544672e-03 + + 6.8313367664813995e-02 -1.6111320257186890e-01 + <_> + + 0 -1 758 2.1284550428390503e-02 + + 3.7090871483087540e-02 -4.6916520595550537e-01 + <_> + + 0 -1 759 -1.0369479656219482e-02 + + 1.0807839781045914e-01 -6.0489870607852936e-02 + <_> + + 0 -1 760 1.0732480324804783e-02 + + -5.8582380414009094e-02 3.1958609819412231e-01 + <_> + + 0 -1 761 -2.3235160112380981e-01 + + -1. 8.2511743530631065e-03 + <_> + + 0 -1 762 -6.0572529037017375e-05 + + 8.0201767385005951e-02 -2.3583050072193146e-01 + <_> + + 0 -1 763 -2.7367009315639734e-03 + + 1.5369090437889099e-01 -7.8800879418849945e-02 + <_> + + 0 -1 764 3.1168010085821152e-02 + + -4.1852951049804688e-02 3.7374469637870789e-01 + <_> + + 0 -1 765 4.5415129512548447e-02 + + 6.6594500094652176e-03 -9.9975287914276123e-01 + <_> + + 0 -1 766 -1.3742819428443909e-03 + + 1.0587850213050842e-01 -1.9234779477119446e-01 + <_> + + 0 -1 767 3.0089360661804676e-03 + + 9.4038642942905426e-02 -1.5442730486392975e-01 + <_> + + 0 -1 768 -7.1071386337280273e-02 + + -5.4955267906188965e-01 2.5523129850625992e-02 + <_> + + 0 -1 769 1.0958979837596416e-03 + + -6.1327658593654633e-02 5.7677619159221649e-02 + <_> + + 0 -1 770 -2.3706799373030663e-02 + + 2.9486098885536194e-01 -6.6553473472595215e-02 + <_> + + 0 -1 771 6.8882037885487080e-03 + + 7.3861703276634216e-02 -2.5727730989456177e-01 + <_> + + 0 -1 772 -4.9158040434122086e-02 + + 3.2406309247016907e-01 -5.2785839885473251e-02 + <_> + + 0 -1 773 7.1369417011737823e-02 + + 1.3209920376539230e-02 -7.4821132421493530e-01 + <_> + + 0 -1 774 -8.4517486393451691e-03 + + -2.0652799308300018e-01 9.3139596283435822e-02 + <_> + + 0 -1 775 -1.5554410219192505e-01 + + -5.0736141204833984e-01 1.1575420387089252e-02 + <_> + + 0 -1 776 -4.5976821333169937e-02 + + 3.3433321118354797e-01 -5.6558281183242798e-02 + <_> + + 0 -1 777 1.7900219187140465e-02 + + 3.4091990441083908e-02 -2.8565031290054321e-01 + <_> + + 0 -1 778 6.7351139150559902e-03 + + -6.6538818180561066e-02 2.3322120308876038e-01 + <_> + + 0 -1 779 6.4544100314378738e-03 + + 4.7224499285221100e-02 -1.4422370493412018e-01 + <_> + + 0 -1 780 -1.1029049754142761e-02 + + -2.6442399621009827e-01 6.2542691826820374e-02 + <_> + + 0 -1 781 -3.3727919217199087e-03 + + 1.2575919926166534e-01 -6.8357646465301514e-02 + <_> + + 0 -1 782 -2.2960419300943613e-03 + + -1.5573309361934662e-01 9.4681970775127411e-02 + <_> + + 0 -1 783 -7.9503163695335388e-02 + + -3.8246139883995056e-01 1.7201259732246399e-02 + <_> + + 0 -1 784 -2.5240880250930786e-01 + + 3.0139809846878052e-01 -5.8942809700965881e-02 + <_> + + 0 -1 785 3.6313079297542572e-02 + + 2.1105870604515076e-02 -2.0811690390110016e-01 + <_> + + 0 -1 786 6.8737521767616272e-02 + + -3.2400298863649368e-02 5.1345300674438477e-01 + <_> + + 0 -1 787 -2.1814550459384918e-01 + + -7.0093291997909546e-01 1.6260979697108269e-02 + <_> + + 0 -1 788 -1.9770899415016174e-01 + + -6.7817360162734985e-01 1.7937550321221352e-02 + <_> + + 0 -1 789 -1.0131119936704636e-01 + + 3.6470630764961243e-01 -4.9969438463449478e-02 + <_> + + 0 -1 790 5.4146698676049709e-03 + + 6.6086590290069580e-02 -2.3327399790287018e-01 + <_> + + 0 -1 791 -4.0590178221464157e-02 + + 2.1464720368385315e-01 -4.3033309280872345e-02 + <_> + + 0 -1 792 -1.3324919855222106e-03 + + 1.2975679337978363e-01 -1.2794280052185059e-01 + <_> + + 0 -1 793 5.7570589706301689e-03 + + 4.3469998985528946e-02 -1.1977300047874451e-01 + <_> + + 0 -1 794 -4.0872758254408836e-03 + + -2.0180100202560425e-01 9.2624872922897339e-02 + <_> + + 0 -1 795 2.1345280110836029e-02 + + -2.6310870423913002e-02 2.9142528772354126e-01 + <_> + + 0 -1 796 -2.4241849314421415e-03 + + 1.7131569981575012e-01 -1.1723010241985321e-01 + <_> + + 0 -1 797 6.0677550733089447e-02 + + -4.8347217962145805e-03 5.6577122211456299e-01 + <_> + + 0 -1 798 3.1573011074215174e-04 + + -1.1499550193548203e-01 1.3094860315322876e-01 + <_> + + 0 -1 799 -1.4639530563727021e-03 + + 1.0708429664373398e-01 -8.2188747823238373e-02 + <_> + + 0 -1 800 -8.1629276275634766e-02 + + -7.0090162754058838e-01 2.1318640559911728e-02 + <_> + + 0 -1 801 -2.2923630604054779e-04 + + 5.2449010312557220e-02 -5.7273399084806442e-02 + <_> + + 0 -1 802 8.6732655763626099e-03 + + -1.0944409668445587e-01 1.4530800282955170e-01 + <_> + + 0 -1 803 -9.5603411318734288e-04 + + 5.4728660732507706e-02 -7.6677009463310242e-02 + <_> + + 0 -1 804 -5.6814689189195633e-02 + + -7.2493737936019897e-01 1.7791330814361572e-02 + <_> + + 0 -1 805 6.4268838614225388e-03 + + -3.7768699228763580e-02 8.3454750478267670e-02 + <_> + + 0 -1 806 5.2451258525252342e-03 + + -7.5806751847267151e-02 2.1549069881439209e-01 + <_> + + 0 -1 807 6.7577441222965717e-03 + + 7.7163867652416229e-02 -2.4957199394702911e-01 + <_> + + 0 -1 808 -5.7494179345667362e-03 + + 1.4245559275150299e-01 -1.2740920484066010e-01 + <_> + + 0 -1 809 -6.7760650999844074e-03 + + -2.3316009342670441e-01 3.9975211024284363e-02 + <_> + + 0 -1 810 3.5247279447503388e-04 + + -1.3083159923553467e-01 1.1577410250902176e-01 + <_> + + 0 -1 811 1.4523849822580814e-03 + + -9.2724457383155823e-02 6.5486960113048553e-02 + <_> + 80 + -7.2322398424148560e-01 + + <_> + + 0 -1 812 -3.1163799762725830e-01 + + 3.8062000274658203e-01 -1.1115840077400208e-01 + <_> + + 0 -1 813 -3.0338248610496521e-01 + + 5.1236808300018311e-01 -5.0459731370210648e-02 + <_> + + 0 -1 814 -1.0945170186460018e-02 + + -2.2292029857635498e-01 1.0548099875450134e-01 + <_> + + 0 -1 815 -2.8011079877614975e-02 + + 7.0687793195247650e-02 -8.6478509008884430e-02 + <_> + + 0 -1 816 -5.2256159484386444e-02 + + 5.7856267690658569e-01 -8.7944902479648590e-03 + <_> + + 0 -1 817 -5.9455442242324352e-03 + + -2.5641980767250061e-01 9.4584532082080841e-02 + <_> + + 0 -1 818 2.5594399776309729e-03 + + -2.5718480348587036e-01 1.2882429361343384e-01 + <_> + + 0 -1 819 -1.2099260091781616e-01 + + -1.2293220311403275e-01 2.5829430669546127e-02 + <_> + + 0 -1 820 -4.4208219647407532e-01 + + -7.4546551704406738e-01 4.2586710304021835e-02 + <_> + + 0 -1 821 -6.6842641681432724e-03 + + 1.3515649735927582e-01 -1.6409300267696381e-01 + <_> + + 0 -1 822 9.8270708695054054e-03 + + -8.0305352807044983e-02 2.9853299260139465e-01 + <_> + + 0 -1 823 5.8638598769903183e-02 + + 2.7556419372558594e-02 -8.2242500782012939e-01 + <_> + + 0 -1 824 -3.0546959023922682e-03 + + -1.9292749464511871e-01 1.1082729697227478e-01 + <_> + + 0 -1 825 -7.3340102098882198e-03 + + -2.4307939410209656e-01 6.6744603216648102e-02 + <_> + + 0 -1 826 -1.0526229627430439e-02 + + -3.1136021018028259e-01 6.2850847840309143e-02 + <_> + + 0 -1 827 1.0481160134077072e-01 + + 1.2621720321476460e-02 -6.7376089096069336e-01 + <_> + + 0 -1 828 9.4269379042088985e-04 + + -1.7071670293807983e-01 1.0280650109052658e-01 + <_> + + 0 -1 829 8.4397383034229279e-03 + + -5.3014568984508514e-02 8.8599078357219696e-02 + <_> + + 0 -1 830 -3.0551670119166374e-02 + + 3.5264891386032104e-01 -6.9148473441600800e-02 + <_> + + 0 -1 831 -4.9112379550933838e-02 + + -5.8219379186630249e-01 1.4043220318853855e-02 + <_> + + 0 -1 832 5.8098030276596546e-03 + + 7.0872433483600616e-02 -2.5362819433212280e-01 + <_> + + 0 -1 833 2.5541070848703384e-02 + + -4.5136939734220505e-02 4.0674450993537903e-01 + <_> + + 0 -1 834 -4.8711288720369339e-02 + + -7.0240157842636108e-01 2.4317869916558266e-02 + <_> + + 0 -1 835 -3.2624390721321106e-01 + + -5.0619047880172729e-01 5.5445302277803421e-03 + <_> + + 0 -1 836 -1.8120040476787835e-04 + + 1.3132590055465698e-01 -1.2139549851417542e-01 + <_> + + 0 -1 837 -1.2980769574642181e-01 + + -6.8208992481231689e-01 1.6414549201726913e-02 + <_> + + 0 -1 838 8.3528067916631699e-03 + + 3.0040390789508820e-02 -5.0909137725830078e-01 + <_> + + 0 -1 839 5.4547088220715523e-03 + + -8.2402072846889496e-02 1.8007980287075043e-01 + <_> + + 0 -1 840 -3.1699541211128235e-01 + + -8.6613011360168457e-01 1.8229139968752861e-02 + <_> + + 0 -1 841 5.8424862800166011e-04 + + 4.2409729212522507e-02 -1.3118089735507965e-01 + <_> + + 0 -1 842 -9.7046848386526108e-03 + + -2.7432689070701599e-01 5.5920429527759552e-02 + <_> + + 0 -1 843 1.6834320500493050e-02 + + -8.3306416869163513e-02 6.7792758345603943e-02 + <_> + + 0 -1 844 -3.0685380101203918e-02 + + 4.2126908898353577e-01 -4.5339331030845642e-02 + <_> + + 0 -1 845 4.1394919157028198e-02 + + 1.9971750676631927e-02 -1.9722190499305725e-01 + <_> + + 0 -1 846 3.4910149872303009e-02 + + -5.3826879709959030e-02 3.5040271282196045e-01 + <_> + + 0 -1 847 -5.2495039999485016e-03 + + -1.1363890022039413e-01 5.5080570280551910e-02 + <_> + + 0 -1 848 1.2045619636774063e-01 + + 1.7451599240303040e-02 -9.3958032131195068e-01 + <_> + + 0 -1 849 4.2130421847105026e-02 + + -1.4343280345201492e-02 6.0059851408004761e-01 + <_> + + 0 -1 850 1.9120849668979645e-02 + + 8.5864506661891937e-02 -1.8586499989032745e-01 + <_> + + 0 -1 851 8.4470612928271294e-03 + + -6.9452181458473206e-02 7.3461420834064484e-02 + <_> + + 0 -1 852 1.7696130089461803e-03 + + -7.9996660351753235e-02 1.9479809701442719e-01 + <_> + + 0 -1 853 5.7995948940515518e-02 + + 2.7633000165224075e-02 -5.4097008705139160e-01 + <_> + + 0 -1 854 -7.9884022474288940e-02 + + -5.4307681322097778e-01 2.3219829425215721e-02 + <_> + + 0 -1 855 6.6576242446899414e-02 + + 6.8416809663176537e-03 -8.1224560737609863e-01 + <_> + + 0 -1 856 6.4169943332672119e-02 + + -2.4846689775586128e-02 6.0798132419586182e-01 + <_> + + 0 -1 857 -2.9404780268669128e-01 + + -1. 4.6440181322395802e-03 + <_> + + 0 -1 858 -9.5727723091840744e-03 + + -1.4157359302043915e-01 1.0121650248765945e-01 + <_> + + 0 -1 859 -2.3574449121952057e-02 + + 1.1715450137853622e-01 -1.3184690475463867e-01 + <_> + + 0 -1 860 -5.1256217993795872e-03 + + -1.7623250186443329e-01 1.0177359730005264e-01 + <_> + + 0 -1 861 9.7663059830665588e-02 + + 4.4896239414811134e-03 -8.0415552854537964e-01 + <_> + + 0 -1 862 3.2088689506053925e-02 + + -5.8048430830240250e-02 3.0194890499114990e-01 + <_> + + 0 -1 863 -8.6517207324504852e-02 + + -7.5529891252517700e-01 2.8089359402656555e-03 + <_> + + 0 -1 864 -2.8540970757603645e-02 + + -3.5085019469261169e-01 4.4081591069698334e-02 + <_> + + 0 -1 865 -5.3844689391553402e-03 + + 9.2348903417587280e-02 -7.0033848285675049e-02 + <_> + + 0 -1 866 -2.2280439734458923e-02 + + 2.4949419498443604e-01 -7.0658676326274872e-02 + <_> + + 0 -1 867 5.1025422289967537e-03 + + 6.0899689793586731e-02 -1.5473949909210205e-01 + <_> + + 0 -1 868 3.7133800797164440e-03 + + -8.7124302983283997e-02 1.7195260524749756e-01 + <_> + + 0 -1 869 -4.0405280888080597e-03 + + 1.5054519474506378e-01 -9.9685050547122955e-02 + <_> + + 0 -1 870 4.8944901674985886e-02 + + 2.0637780427932739e-02 -7.1113997697830200e-01 + <_> + + 0 -1 871 -4.0832208469510078e-03 + + -1.6104909777641296e-01 8.8675007224082947e-02 + <_> + + 0 -1 872 -2.2145630791783333e-03 + + -2.1901540458202362e-01 1.0045240074396133e-01 + <_> + + 0 -1 873 -6.4257450401782990e-02 + + -5.7694709300994873e-01 1.0253880172967911e-02 + <_> + + 0 -1 874 1.1895420029759407e-02 + + -7.0560596883296967e-02 2.6147291064262390e-01 + <_> + + 0 -1 875 -4.4988259673118591e-02 + + -6.8440282344818115e-01 9.9674779921770096e-03 + <_> + + 0 -1 876 6.3484339043498039e-03 + + 8.4738656878471375e-02 -1.6299989819526672e-01 + <_> + + 0 -1 877 -5.6587439030408859e-02 + + 4.8960050940513611e-01 -1.9641140475869179e-02 + <_> + + 0 -1 878 3.5853400826454163e-02 + + 1.9695440307259560e-02 -6.8108338117599487e-01 + <_> + + 0 -1 879 -4.5450981706380844e-03 + + 6.9072656333446503e-02 -9.1276638209819794e-02 + <_> + + 0 -1 880 1.0608570277690887e-01 + + -4.9993991851806641e-02 3.2139471173286438e-01 + <_> + + 0 -1 881 -4.5924410223960876e-02 + + -8.2744181156158447e-01 1.2149419635534286e-02 + <_> + + 0 -1 882 -1.2273239903151989e-02 + + -3.0669289827346802e-01 5.1693398505449295e-02 + <_> + + 0 -1 883 8.0667391419410706e-02 + + 2.1730009466409683e-03 -1.0002529621124268e+00 + <_> + + 0 -1 884 -2.3044859990477562e-02 + + 4.5085349678993225e-01 -3.6273978650569916e-02 + <_> + + 0 -1 885 1.8702909350395203e-02 + + 4.6945460140705109e-02 -2.1796269714832306e-01 + <_> + + 0 -1 886 -9.6820026636123657e-02 + + 4.0398910641670227e-01 -3.7819091230630875e-02 + <_> + + 0 -1 887 6.0525789856910706e-02 + + 1.5727160498499870e-02 -4.5661678910255432e-01 + <_> + + 0 -1 888 1.0418569669127464e-02 + + 6.2726646661758423e-02 -2.4441179633140564e-01 + <_> + + 0 -1 889 1.0726209729909897e-02 + + -7.1968853473663330e-02 2.2099970281124115e-01 + <_> + + 0 -1 890 -2.7160700410604477e-03 + + 1.2882749736309052e-01 -1.4629630744457245e-01 + <_> + + 0 -1 891 8.5867568850517273e-03 + + -6.8645663559436798e-02 2.5840589404106140e-01 + <_> + 103 + -7.6886308193206787e-01 + + <_> + + 0 -1 892 -2.5851670652627945e-02 + + 1.8011799454689026e-01 -2.4745930731296539e-01 + <_> + + 0 -1 893 1.4054620265960693e-01 + + -5.1319289952516556e-02 4.0766909718513489e-01 + <_> + + 0 -1 894 -2.7255079150199890e-01 + + 4.9941259622573853e-01 -4.5033931732177734e-02 + <_> + + 0 -1 895 1.3978329952806234e-03 + + 5.3600508719682693e-02 -2.1793389320373535e-01 + <_> + + 0 -1 896 -3.5059880465269089e-02 + + -2.9943290352821350e-01 8.9991323649883270e-02 + <_> + + 0 -1 897 -3.2894399482756853e-03 + + 1.0264199972152710e-01 -9.4711251556873322e-02 + <_> + + 0 -1 898 1.8242290616035461e-01 + + 2.5626670569181442e-02 -6.8765729665756226e-01 + <_> + + 0 -1 899 -7.8741081058979034e-02 + + 1.0810419917106628e-01 -1.4497520029544830e-01 + <_> + + 0 -1 900 1.3945129700005054e-02 + + -7.1371912956237793e-02 3.1315749883651733e-01 + <_> + + 0 -1 901 4.4680278748273849e-02 + + -3.0446149408817291e-02 3.9263629913330078e-01 + <_> + + 0 -1 902 -2.6441770605742931e-03 + + 1.1596699804067612e-01 -1.7800450325012207e-01 + <_> + + 0 -1 903 -5.1071979105472565e-03 + + -1.1739940196275711e-01 6.7823447287082672e-02 + <_> + + 0 -1 904 -3.2582178711891174e-02 + + -5.9129017591476440e-01 3.3352021127939224e-02 + <_> + + 0 -1 905 -2.7755839750170708e-02 + + -7.0649361610412598e-01 1.6761489212512970e-02 + <_> + + 0 -1 906 -6.0038521041860804e-05 + + 7.3832668364048004e-02 -2.2933359444141388e-01 + <_> + + 0 -1 907 3.0506180599331856e-02 + + -3.8056060671806335e-02 4.4115358591079712e-01 + <_> + + 0 -1 908 -6.2056961469352245e-03 + + -1.7757239937782288e-01 9.3707472085952759e-02 + <_> + + 0 -1 909 -8.0766230821609497e-03 + + -2.0256699621677399e-01 7.4059642851352692e-02 + <_> + + 0 -1 910 -3.3209908753633499e-02 + + 4.6372228860855103e-01 -3.4903008490800858e-02 + <_> + + 0 -1 911 3.5530608147382736e-02 + + -3.1679518520832062e-02 4.5202499628067017e-01 + <_> + + 0 -1 912 1.6297640278935432e-02 + + 4.4189039617776871e-02 -3.4845370054244995e-01 + <_> + + 0 -1 913 9.9985357373952866e-03 + + -4.8255320638418198e-02 1.6078050434589386e-01 + <_> + + 0 -1 914 -5.2390778437256813e-03 + + 2.3236599564552307e-01 -7.6032742857933044e-02 + <_> + + 0 -1 915 -3.2508899457752705e-03 + + 5.4369390010833740e-02 -9.1040253639221191e-02 + <_> + + 0 -1 916 5.5640790611505508e-02 + + -3.8811128586530685e-02 4.2034021019935608e-01 + <_> + + 0 -1 917 3.3998981118202209e-02 + + 2.2251330316066742e-02 -3.5615360736846924e-01 + <_> + + 0 -1 918 -4.3103890493512154e-03 + + 1.1287429928779602e-01 -1.7630730569362640e-01 + <_> + + 0 -1 919 -7.9246461391448975e-03 + + -1.0992339998483658e-01 3.5099629312753677e-02 + <_> + + 0 -1 920 4.4273380190134048e-02 + + 2.8094569221138954e-02 -6.0921418666839600e-01 + <_> + + 0 -1 921 5.9907328337430954e-02 + + 9.7544339951127768e-04 -9.0523207187652588e-01 + <_> + + 0 -1 922 3.3378869295120239e-02 + + 1.7723279073834419e-02 -8.5254609584808350e-01 + <_> + + 0 -1 923 1.4694170095026493e-02 + + -4.9031510949134827e-02 2.7998331189155579e-01 + <_> + + 0 -1 924 -5.3877499885857105e-03 + + 1.8219049274921417e-01 -8.2382522523403168e-02 + <_> + + 0 -1 925 -1.7976889386773109e-02 + + -1.9384689629077911e-01 8.4984757006168365e-02 + <_> + + 0 -1 926 -4.4651641510426998e-03 + + 1.7632910609245300e-01 -9.5075771212577820e-02 + <_> + + 0 -1 927 6.9372296333312988e-02 + + 3.1770321074873209e-03 -6.7554402351379395e-01 + <_> + + 0 -1 928 -1.7002269625663757e-02 + + -3.3827948570251465e-01 4.4731728732585907e-02 + <_> + + 0 -1 929 1.7274240031838417e-02 + + -2.4769710376858711e-02 1.1852029711008072e-01 + <_> + + 0 -1 930 4.0388729423284531e-02 + + -3.2967679202556610e-02 4.7323140501976013e-01 + <_> + + 0 -1 931 1.4215400442481041e-02 + + 2.9846860095858574e-02 -4.4157060980796814e-01 + <_> + + 0 -1 932 4.1627719998359680e-02 + + -4.5953918248414993e-02 3.2978388667106628e-01 + <_> + + 0 -1 933 -1.7416840419173241e-03 + + 8.7286308407783508e-02 -8.8862203061580658e-02 + <_> + + 0 -1 934 -9.8077040165662766e-03 + + -2.1026679873466492e-01 7.7401876449584961e-02 + <_> + + 0 -1 935 2.1836649626493454e-02 + + 4.3211769312620163e-02 -1.5330420434474945e-01 + <_> + + 0 -1 936 -7.0743098855018616e-02 + + 3.3019039034843445e-01 -5.2747949957847595e-02 + <_> + + 0 -1 937 -1.1181020177900791e-02 + + -1.1493939906358719e-01 2.7858460322022438e-02 + <_> + + 0 -1 938 -1.4623560011386871e-02 + + 3.2327070832252502e-01 -4.4166058301925659e-02 + <_> + + 0 -1 939 -9.6702557057142258e-03 + + -1.8157319724559784e-01 3.6154530942440033e-02 + <_> + + 0 -1 940 8.3439601585268974e-03 + + -5.2473910152912140e-02 2.7444839477539062e-01 + <_> + + 0 -1 941 2.2970559075474739e-02 + + 3.4930050373077393e-02 -1.5773670375347137e-01 + <_> + + 0 -1 942 -8.2734245806932449e-03 + + 1.1612790077924728e-01 -1.1965770274400711e-01 + <_> + + 0 -1 943 8.7074404582381248e-03 + + -4.0829788893461227e-02 1.0481330007314682e-01 + <_> + + 0 -1 944 -1.8825819715857506e-02 + + -3.8794550299644470e-01 4.7350700944662094e-02 + <_> + + 0 -1 945 -7.2092940099537373e-03 + + -1.9886960089206696e-01 7.5952850282192230e-02 + <_> + + 0 -1 946 1.6543369565624744e-04 + + -1.0674829781055450e-01 1.5510599315166473e-01 + <_> + + 0 -1 947 8.9294537901878357e-03 + + -6.7059643566608429e-02 9.0206786990165710e-02 + <_> + + 0 -1 948 3.1991640571504831e-03 + + 7.4445746839046478e-02 -1.9682839512825012e-01 + <_> + + 0 -1 949 -1.1280879698460922e-04 + + 7.9703390598297119e-02 -1.3661189377307892e-01 + <_> + + 0 -1 950 -6.9613799452781677e-02 + + -2.1010529994964600e-01 6.5771616995334625e-02 + <_> + + 0 -1 951 -2.6066679507493973e-02 + + 2.8696510195732117e-01 -5.7495791465044022e-02 + <_> + + 0 -1 952 1.2050740420818329e-02 + + -4.6820510178804398e-02 2.7994769811630249e-01 + <_> + + 0 -1 953 -3.9625849574804306e-02 + + -3.7054508924484253e-01 1.1476139537990093e-02 + <_> + + 0 -1 954 -2.7379901148378849e-03 + + 9.4371132552623749e-02 -1.6203230619430542e-01 + <_> + + 0 -1 955 -6.5262563526630402e-02 + + -6.7808389663696289e-01 1.9430469721555710e-02 + <_> + + 0 -1 956 2.3191619664430618e-02 + + 2.6134310290217400e-02 -4.6664249897003174e-01 + <_> + + 0 -1 957 4.7741930931806564e-02 + + -2.5291189551353455e-02 2.9092490673065186e-01 + <_> + + 0 -1 958 -1.2830020487308502e-01 + + -8.7187117338180542e-01 1.3883540406823158e-02 + <_> + + 0 -1 959 -4.2689260095357895e-02 + + -6.7644822597503662e-01 6.8771280348300934e-03 + <_> + + 0 -1 960 6.2811248935759068e-03 + + -6.4803749322891235e-02 2.0994420349597931e-01 + <_> + + 0 -1 961 2.7532080188393593e-02 + + 1.5366540290415287e-02 -2.1457369625568390e-01 + <_> + + 0 -1 962 -3.4494648571126163e-04 + + 1.1829499900341034e-01 -1.0641119629144669e-01 + <_> + + 0 -1 963 -3.2187011092901230e-02 + + 2.0676319301128387e-01 -2.7804749086499214e-02 + <_> + + 0 -1 964 -2.4451729841530323e-03 + + -1.8970219790935516e-01 7.6612837612628937e-02 + <_> + + 0 -1 965 3.9631120860576630e-02 + + 1.1457280255854130e-02 -4.4112280011177063e-01 + <_> + + 0 -1 966 -9.0082110837101936e-03 + + -2.0329099893569946e-01 7.1997888386249542e-02 + <_> + + 0 -1 967 -6.0594908893108368e-02 + + 2.5831830501556396e-01 -3.2274000346660614e-02 + <_> + + 0 -1 968 3.3678639680147171e-02 + + 3.6565639078617096e-02 -3.3233150839805603e-01 + <_> + + 0 -1 969 1.4565410092473030e-02 + + -4.9269210547208786e-02 1.8280670046806335e-01 + <_> + + 0 -1 970 4.0103439241647720e-03 + + -1.2435600161552429e-01 1.1247640103101730e-01 + <_> + + 0 -1 971 1.7989509506151080e-03 + + -5.4675988852977753e-02 1.0701840370893478e-01 + <_> + + 0 -1 972 -1.6359580331481993e-04 + + 8.1755228340625763e-02 -1.6235500574111938e-01 + <_> + + 0 -1 973 -3.1993899494409561e-02 + + 1.8631230294704437e-01 -1.7350630834698677e-02 + <_> + + 0 -1 974 -8.1737667322158813e-02 + + -7.5961482524871826e-01 1.4419900253415108e-02 + <_> + + 0 -1 975 -8.8262550532817841e-02 + + -1. 5.3146481513977051e-04 + <_> + + 0 -1 976 -5.7997900992631912e-02 + + -8.9391511678695679e-01 1.2495099566876888e-02 + <_> + + 0 -1 977 2.0691409707069397e-02 + + -3.7167508155107498e-02 9.7208552062511444e-02 + <_> + + 0 -1 978 -6.0336058959364891e-03 + + 1.7547790706157684e-01 -8.6916856467723846e-02 + <_> + + 0 -1 979 1.5789760649204254e-01 + + 3.0604960396885872e-02 -2.2199299931526184e-01 + <_> + + 0 -1 980 3.3271119464188814e-03 + + 1.1201520264148712e-01 -1.6384710371494293e-01 + <_> + + 0 -1 981 1.1383239924907684e-01 + + 1.8078039865940809e-03 -9.9981439113616943e-01 + <_> + + 0 -1 982 3.9188969880342484e-02 + + -3.9494428783655167e-02 3.4139481186866760e-01 + <_> + + 0 -1 983 -4.7382968477904797e-03 + + -8.1601403653621674e-02 3.5498451441526413e-02 + <_> + + 0 -1 984 2.3458160459995270e-02 + + -4.0767479687929153e-02 3.4792768955230713e-01 + <_> + + 0 -1 985 1.6505220904946327e-02 + + 2.0170280709862709e-02 -1.5532009303569794e-01 + <_> + + 0 -1 986 2.0262949168682098e-02 + + 2.1292379125952721e-02 -6.2611502408981323e-01 + <_> + + 0 -1 987 -9.1393236070871353e-03 + + -1.3637480139732361e-01 6.3891842961311340e-02 + <_> + + 0 -1 988 -5.6207980960607529e-02 + + 4.0671119093894958e-01 -3.3258218318223953e-02 + <_> + + 0 -1 989 6.6868839785456657e-03 + + 6.4174309372901917e-02 -9.3966238200664520e-02 + <_> + + 0 -1 990 5.8862278237938881e-03 + + -6.5789960324764252e-02 2.0181339979171753e-01 + <_> + + 0 -1 991 -1.1517380177974701e-01 + + -1. 2.5347759947180748e-03 + <_> + + 0 -1 992 5.5793710052967072e-03 + + 7.0642203092575073e-02 -1.9637429714202881e-01 + <_> + + 0 -1 993 3.2180000096559525e-02 + + -1.4737719669938087e-02 2.2420160472393036e-01 + <_> + + 0 -1 994 -9.1598782455548644e-04 + + 1.1478749662637711e-01 -1.1767079681158066e-01 + <_> + 83 + -7.7573090791702271e-01 + + <_> + + 0 -1 995 9.1346232220530510e-03 + + 8.8698662817478180e-02 -3.8595649600028992e-01 + <_> + + 0 -1 996 -2.4696369655430317e-03 + + 1.6772060096263885e-01 -1.4649170637130737e-01 + <_> + + 0 -1 997 5.8935020118951797e-02 + + -1.3394000008702278e-02 6.1832672357559204e-01 + <_> + + 0 -1 998 -8.9100059121847153e-03 + + -2.6950231194496155e-01 7.2939813137054443e-02 + <_> + + 0 -1 999 1.7743879929184914e-02 + + -5.0217188894748688e-02 4.3166020512580872e-01 + <_> + + 0 -1 1000 1.1056650429964066e-02 + + 3.9155859500169754e-02 -5.2860772609710693e-01 + <_> + + 0 -1 1001 1.6161320731043816e-02 + + 6.9581039249897003e-02 -3.7610140442848206e-01 + <_> + + 0 -1 1002 -2.7879089117050171e-02 + + 2.3220659792423248e-01 -5.5979579687118530e-02 + <_> + + 0 -1 1003 -1.1556839570403099e-02 + + -3.1231081485748291e-01 7.4339963495731354e-02 + <_> + + 0 -1 1004 -6.9651477038860321e-02 + + -4.1905689239501953e-01 6.9694789126515388e-03 + <_> + + 0 -1 1005 -5.0344727933406830e-03 + + 1.3183620572090149e-01 -1.9702030718326569e-01 + <_> + + 0 -1 1006 -8.6098119616508484e-02 + + 6.5727752447128296e-01 -9.5664570108056068e-03 + <_> + + 0 -1 1007 2.5546319782733917e-02 + + -4.0136341005563736e-02 5.4847037792205811e-01 + <_> + + 0 -1 1008 -2.6870880275964737e-02 + + -2.5306650996208191e-01 4.4181719422340393e-02 + <_> + + 0 -1 1009 9.5859682187438011e-03 + + -8.1882461905479431e-02 2.6894670724868774e-01 + <_> + + 0 -1 1010 2.6683809235692024e-02 + + 2.6593349874019623e-02 -4.4127041101455688e-01 + <_> + + 0 -1 1011 -1.4490840025246143e-02 + + -3.5697469115257263e-01 7.0072941482067108e-02 + <_> + + 0 -1 1012 -2.2448399104177952e-03 + + 2.0088230073451996e-01 -1.2228170037269592e-01 + <_> + + 0 -1 1013 4.8795710317790508e-03 + + 4.5820981264114380e-02 -3.9498189091682434e-01 + <_> + + 0 -1 1014 -6.1262990348041058e-03 + + -1.8826089799404144e-01 7.8812077641487122e-02 + <_> + + 0 -1 1015 1.6952969133853912e-02 + + -6.1684221029281616e-02 3.3603700995445251e-01 + <_> + + 0 -1 1016 -4.5547191984951496e-03 + + -1.9471390545368195e-01 5.3147189319133759e-02 + <_> + + 0 -1 1017 -1.2753040064126253e-03 + + 1.4800879359245300e-01 -1.4244349300861359e-01 + <_> + + 0 -1 1018 2.2060280665755272e-02 + + -3.5406738519668579e-02 3.3775308728218079e-01 + <_> + + 0 -1 1019 2.1050389856100082e-02 + + 4.2289130389690399e-02 -4.5886451005935669e-01 + <_> + + 0 -1 1020 9.5637209713459015e-02 + + -1.3171649537980556e-02 5.5534982681274414e-01 + <_> + + 0 -1 1021 -3.6728319246321917e-03 + + -1.8842899799346924e-01 9.5458142459392548e-02 + <_> + + 0 -1 1022 1.6345079347956926e-04 + + -6.0444809496402740e-02 1.0536730289459229e-01 + <_> + + 0 -1 1023 2.5338289141654968e-01 + + 1.6026260331273079e-02 -9.9994468688964844e-01 + <_> + + 0 -1 1024 -4.6113330870866776e-02 + + 5.4247987270355225e-01 -2.7890209108591080e-02 + <_> + + 0 -1 1025 5.2588270045816898e-03 + + 7.9867303371429443e-02 -2.0700709521770477e-01 + <_> + + 0 -1 1026 -1.3449570536613464e-01 + + -4.1270101070404053e-01 8.1500215455889702e-03 + <_> + + 0 -1 1027 1.6953679732978344e-03 + + 1.1035349965095520e-01 -1.6802120208740234e-01 + <_> + + 0 -1 1028 3.9492141455411911e-02 + + -1.3410010375082493e-02 3.8447639346122742e-01 + <_> + + 0 -1 1029 -9.3634781660512090e-04 + + 1.0986819863319397e-01 -1.7310489714145660e-01 + <_> + + 0 -1 1030 -4.4495709240436554e-02 + + 1.9471199810504913e-01 -4.0768899023532867e-02 + <_> + + 0 -1 1031 6.0630109161138535e-02 + + -4.2252369225025177e-02 5.1412987709045410e-01 + <_> + + 0 -1 1032 7.5067640282213688e-03 + + 4.2086970061063766e-02 -1.6080400347709656e-01 + <_> + + 0 -1 1033 9.9260415881872177e-03 + + 6.4119532704353333e-02 -2.6215308904647827e-01 + <_> + + 0 -1 1034 6.0528520494699478e-02 + + 2.4189969524741173e-02 -3.6608389019966125e-01 + <_> + + 0 -1 1035 -6.8054231815040112e-03 + + 1.2508389353752136e-01 -1.3889710605144501e-01 + <_> + + 0 -1 1036 -2.0940289832651615e-03 + + 1.3996599614620209e-01 -8.2706399261951447e-02 + <_> + + 0 -1 1037 -9.6904346719384193e-03 + + 2.6681360602378845e-01 -7.1576990187168121e-02 + <_> + + 0 -1 1038 1.8320349976420403e-02 + + 3.1321980059146881e-02 -2.3460610210895538e-01 + <_> + + 0 -1 1039 5.0429959082975984e-04 + + -1.1669719964265823e-01 1.6514649987220764e-01 + <_> + + 0 -1 1040 -4.7016288153827190e-03 + + -1.2006150186061859e-01 5.9200428426265717e-02 + <_> + + 0 -1 1041 -1.9926870241761208e-02 + + -3.9485099911689758e-01 4.1143018752336502e-02 + <_> + + 0 -1 1042 7.4013080447912216e-03 + + -7.6331257820129395e-02 2.1065360307693481e-01 + <_> + + 0 -1 1043 1.4879629947245121e-02 + + 4.7979071736335754e-02 -3.4014761447906494e-01 + <_> + + 0 -1 1044 1.5527559816837311e-01 + + 3.2225880771875381e-02 -4.6938079595565796e-01 + <_> + + 0 -1 1045 -7.0786331780254841e-03 + + 1.2199480086565018e-01 -1.2004940211772919e-01 + <_> + + 0 -1 1046 2.9872169718146324e-02 + + -4.3677508831024170e-02 2.3529820144176483e-01 + <_> + + 0 -1 1047 3.0555170029401779e-02 + + 3.1775880604982376e-02 -5.7825452089309692e-01 + <_> + + 0 -1 1048 1.0284570045769215e-02 + + 4.7202810645103455e-02 -2.9566499590873718e-01 + <_> + + 0 -1 1049 1.9808709621429443e-02 + + -4.5775938779115677e-02 3.3231019973754883e-01 + <_> + + 0 -1 1050 2.7218880131840706e-02 + + 2.5577219203114510e-02 -3.3180880546569824e-01 + <_> + + 0 -1 1051 1.4097680337727070e-02 + + 5.2157420665025711e-02 -2.9358381032943726e-01 + <_> + + 0 -1 1052 2.4286569654941559e-01 + + 1.4692460186779499e-02 -6.9854879379272461e-01 + <_> + + 0 -1 1053 1.2419570237398148e-02 + + -4.7105878591537476e-02 3.6695051193237305e-01 + <_> + + 0 -1 1054 1.3503880472853780e-03 + + 5.3791359066963196e-02 -2.0953659713268280e-01 + <_> + + 0 -1 1055 -1.5626290813088417e-02 + + 2.7888458967208862e-01 -6.0053750872612000e-02 + <_> + + 0 -1 1056 1.5850139781832695e-02 + + -3.0324909836053848e-02 1.0287520289421082e-01 + <_> + + 0 -1 1057 -4.0868919342756271e-02 + + -8.0402207374572754e-01 1.7601499333977699e-02 + <_> + + 0 -1 1058 6.4108639955520630e-02 + + 2.5845379568636417e-03 -5.3854942321777344e-01 + <_> + + 0 -1 1059 4.9927100539207458e-02 + + 2.1863300353288651e-02 -6.1780720949172974e-01 + <_> + + 0 -1 1060 1.4655419625341892e-02 + + 1.9663369283080101e-02 -2.0426170527935028e-01 + <_> + + 0 -1 1061 -2.4094810709357262e-02 + + 3.7609130144119263e-01 -4.0954101830720901e-02 + <_> + + 0 -1 1062 2.9417769983410835e-02 + + -8.6903842166066170e-03 4.0447419881820679e-01 + <_> + + 0 -1 1063 -1.4158640056848526e-02 + + 3.7811711430549622e-01 -4.0321640670299530e-02 + <_> + + 0 -1 1064 -4.6754989773035049e-02 + + 2.2104309499263763e-01 -2.8996109962463379e-02 + <_> + + 0 -1 1065 -1.1437949724495411e-02 + + -2.5033089518547058e-01 5.8214288204908371e-02 + <_> + + 0 -1 1066 -4.2598780244588852e-02 + + 3.7562200427055359e-01 -1.6349090263247490e-02 + <_> + + 0 -1 1067 -1.5201159752905369e-02 + + -3.5637819766998291e-01 3.8690369576215744e-02 + <_> + + 0 -1 1068 4.3378848582506180e-02 + + 3.3045639283955097e-03 -4.6729469299316406e-01 + <_> + + 0 -1 1069 5.5153011344373226e-03 + + -8.3583608269691467e-02 1.8793170154094696e-01 + <_> + + 0 -1 1070 -7.8126927837729454e-03 + + -1.6586859524250031e-01 4.3801128864288330e-02 + <_> + + 0 -1 1071 4.1652601212263107e-02 + + -3.1804520636796951e-02 4.3517521023750305e-01 + <_> + + 0 -1 1072 3.4417589195072651e-03 + + 4.2282279580831528e-02 -1.3088959455490112e-01 + <_> + + 0 -1 1073 1.3004569336771965e-04 + + -1.1260010302066803e-01 1.3964599370956421e-01 + <_> + + 0 -1 1074 -7.7347733080387115e-02 + + 7.0750647783279419e-01 -5.4134069941937923e-03 + <_> + + 0 -1 1075 -1.6143550164997578e-03 + + 1.1920420080423355e-01 -1.1884269863367081e-01 + <_> + + 0 -1 1076 -9.8279246594756842e-04 + + 6.3156276941299438e-02 -5.2781101316213608e-02 + <_> + + 0 -1 1077 -4.5667469501495361e-02 + + -3.4500870108604431e-01 4.4600728899240494e-02 + <_> + 101 + -6.9763368368148804e-01 + + <_> + + 0 -1 1078 7.3315978050231934e-02 + + -1.1410109698772430e-01 4.0035811066627502e-01 + <_> + + 0 -1 1079 2.5275669991970062e-02 + + -7.2013877332210541e-02 3.6095780134201050e-01 + <_> + + 0 -1 1080 1.8873859196901321e-02 + + -1.7234370112419128e-01 1.8223220109939575e-01 + <_> + + 0 -1 1081 7.4607720307540148e-05 + + -8.1627286970615387e-02 8.8888503611087799e-02 + <_> + + 0 -1 1082 4.2250280966982245e-04 + + -1.2840239703655243e-01 1.1791419982910156e-01 + <_> + + 0 -1 1083 1.4402460306882858e-02 + + 2.0960340276360512e-02 1.9024699926376343e-01 + <_> + + 0 -1 1084 -2.0460959058254957e-03 + + 9.5712497830390930e-02 -2.1517060697078705e-01 + <_> + + 0 -1 1085 7.1128448471426964e-03 + + -5.6100480258464813e-02 2.0984320342540741e-01 + <_> + + 0 -1 1086 -6.5832170657813549e-03 + + -2.1138189733028412e-01 7.6094150543212891e-02 + <_> + + 0 -1 1087 -4.1252959636040032e-04 + + 1.3107340037822723e-01 -1.5670859813690186e-01 + <_> + + 0 -1 1088 -4.4330831617116928e-02 + + 5.4048037528991699e-01 -1.9059479236602783e-02 + <_> + + 0 -1 1089 1.1700130067765713e-02 + + 5.1712401211261749e-02 -1.7216169834136963e-01 + <_> + + 0 -1 1090 3.5091140307486057e-03 + + -7.6767951250076294e-02 1.7776259779930115e-01 + <_> + + 0 -1 1091 1.5597569756209850e-02 + + 3.8307890295982361e-02 -1.4730019867420197e-01 + <_> + + 0 -1 1092 -3.6285370588302612e-02 + + 3.5347661375999451e-01 -4.5018490403890610e-02 + <_> + + 0 -1 1093 -4.5118298381567001e-02 + + -5.7074141502380371e-01 1.0646710172295570e-02 + <_> + + 0 -1 1094 1.3734580017626286e-02 + + 6.6018357872962952e-02 -2.0480890572071075e-01 + <_> + + 0 -1 1095 -2.7120979502797127e-02 + + 4.8094209283590317e-02 -5.1394961774349213e-02 + <_> + + 0 -1 1096 -1.5354059869423509e-03 + + -2.3548009991645813e-01 5.3074609488248825e-02 + <_> + + 0 -1 1097 3.6000818945467472e-03 + + -5.8944340795278549e-02 1.1825410276651382e-01 + <_> + + 0 -1 1098 6.8916529417037964e-03 + + -5.0014488399028778e-02 2.6909399032592773e-01 + <_> + + 0 -1 1099 3.5373449791222811e-03 + + -1.2947039306163788e-01 8.8697038590908051e-02 + <_> + + 0 -1 1100 -4.1431561112403870e-03 + + -1.7883630096912384e-01 6.9098107516765594e-02 + <_> + + 0 -1 1101 -1.0762579739093781e-01 + + -1. 4.7263409942388535e-03 + <_> + + 0 -1 1102 9.7946207970380783e-03 + + -5.4038770496845245e-02 2.4115470051765442e-01 + <_> + + 0 -1 1103 1.0054280050098896e-02 + + -8.0624893307685852e-02 1.1627560108900070e-01 + <_> + + 0 -1 1104 -8.7350717512890697e-04 + + -1.8193979561328888e-01 7.7468506991863251e-02 + <_> + + 0 -1 1105 9.4283261569216847e-04 + + 4.6265050768852234e-02 -2.2732029855251312e-01 + <_> + + 0 -1 1106 3.5424059024080634e-04 + + -1.1824289709329605e-01 1.1095699667930603e-01 + <_> + + 0 -1 1107 -3.8587789982557297e-02 + + -3.0286869406700134e-01 3.1856179703027010e-03 + <_> + + 0 -1 1108 -4.9504679627716541e-03 + + 1.3758100569248199e-01 -9.1690346598625183e-02 + <_> + + 0 -1 1109 -2.5453630834817886e-02 + + -2.3013520240783691e-01 1.9747929647564888e-02 + <_> + + 0 -1 1110 1.5836700797080994e-02 + + -4.5252159237861633e-02 2.9337081313133240e-01 + <_> + + 0 -1 1111 1.0379879735410213e-02 + + 5.9706691652536392e-02 -1.6415530443191528e-01 + <_> + + 0 -1 1112 4.3178450316190720e-02 + + 6.3460536301136017e-02 -2.1360489726066589e-01 + <_> + + 0 -1 1113 -2.2508678957819939e-03 + + 1.0645110160112381e-01 -5.9539180248975754e-02 + <_> + + 0 -1 1114 5.0743711180984974e-03 + + -9.4377033412456512e-02 2.2999720275402069e-01 + <_> + + 0 -1 1115 -3.0670650303363800e-02 + + 2.5975760817527771e-01 -2.3188209161162376e-02 + <_> + + 0 -1 1116 2.4162670597434044e-03 + + 8.7919056415557861e-02 -1.9287380576133728e-01 + <_> + + 0 -1 1117 -9.3405842781066895e-03 + + -1.0935559868812561e-01 2.9358500614762306e-02 + <_> + + 0 -1 1118 2.0513730123639107e-02 + + -5.2511349320411682e-02 3.0545449256896973e-01 + <_> + + 0 -1 1119 -4.3630380183458328e-02 + + -4.5310449600219727e-01 1.8261570483446121e-02 + <_> + + 0 -1 1120 3.4857920836657286e-03 + + -9.7093120217323303e-02 1.4877100288867950e-01 + <_> + + 0 -1 1121 1.0411609895527363e-02 + + 4.2915731668472290e-02 -2.4849639832973480e-01 + <_> + + 0 -1 1122 -7.5155291706323624e-03 + + -2.6623341441154480e-01 5.1602318882942200e-02 + <_> + + 0 -1 1123 7.2157550603151321e-03 + + -6.1878159642219543e-02 1.8314969539642334e-01 + <_> + + 0 -1 1124 9.1090862406417727e-04 + + -9.7420282661914825e-02 1.2223699688911438e-01 + <_> + + 0 -1 1125 -4.0069910883903503e-01 + + -8.1831091642379761e-01 4.7453590668737888e-03 + <_> + + 0 -1 1126 -4.8033627681434155e-03 + + 9.4193987548351288e-02 -1.4436510205268860e-01 + <_> + + 0 -1 1127 -2.1147429943084717e-02 + + 2.9532408714294434e-01 -4.4751271605491638e-02 + <_> + + 0 -1 1128 1.8602259457111359e-02 + + -4.2993780225515366e-02 2.9706719517707825e-01 + <_> + + 0 -1 1129 -8.1051718443632126e-03 + + 1.2369229644536972e-01 -1.3246449828147888e-01 + <_> + + 0 -1 1130 -8.3215925842523575e-03 + + -1.9022589921951294e-01 8.9151017367839813e-02 + <_> + + 0 -1 1131 3.1376329716295004e-03 + + 4.1584819555282593e-02 -7.9552896320819855e-02 + <_> + + 0 -1 1132 1.6556069254875183e-02 + + 4.4908858835697174e-02 -3.6947301030158997e-01 + <_> + + 0 -1 1133 2.9919730499386787e-02 + + -3.7720259279012680e-02 2.4280619621276855e-01 + <_> + + 0 -1 1134 -5.1988288760185242e-02 + + -6.9372260570526123e-01 1.8926780670881271e-02 + <_> + + 0 -1 1135 7.5528107583522797e-02 + + -1.2611350044608116e-02 2.5732690095901489e-01 + <_> + + 0 -1 1136 -2.5031189434230328e-03 + + 1.3807280361652374e-01 -9.1662466526031494e-02 + <_> + + 0 -1 1137 -5.9646938461810350e-04 + + -6.3654616475105286e-02 2.5937270373106003e-02 + <_> + + 0 -1 1138 1.0319340042769909e-02 + + 8.3791837096214294e-02 -1.7408309876918793e-01 + <_> + + 0 -1 1139 9.3816686421632767e-03 + + 2.7871530503034592e-02 -1.1141580343246460e-01 + <_> + + 0 -1 1140 1.0023410432040691e-02 + + -6.9966249167919159e-02 2.1900640428066254e-01 + <_> + + 0 -1 1141 -8.3700200775638223e-04 + + 1.0097689926624298e-01 -1.4261360466480255e-01 + <_> + + 0 -1 1142 2.2468710318207741e-02 + + 9.4028212130069733e-02 -1.3807420432567596e-01 + <_> + + 0 -1 1143 3.9115209132432938e-02 + + -5.3969398140907288e-03 6.5187507867813110e-01 + <_> + + 0 -1 1144 -1.5670569846406579e-03 + + 7.0886030793190002e-02 -2.0010609924793243e-01 + <_> + + 0 -1 1145 6.0749892145395279e-03 + + 3.5395938903093338e-02 -4.3918590992689133e-02 + <_> + + 0 -1 1146 -4.3166890740394592e-02 + + 5.9881848096847534e-01 -2.3480180650949478e-02 + <_> + + 0 -1 1147 2.3302088957279921e-03 + + -7.2818689048290253e-02 4.3940208852291107e-02 + <_> + + 0 -1 1148 5.5236589163541794e-02 + + -3.5117920488119125e-02 3.6355149745941162e-01 + <_> + + 0 -1 1149 2.7774399146437645e-02 + + 3.0074290931224823e-02 -1.0026770085096359e-01 + <_> + + 0 -1 1150 8.4784086793661118e-03 + + -5.6243300437927246e-02 2.1711349487304688e-01 + <_> + + 0 -1 1151 1.3269360177218914e-02 + + 4.3138369917869568e-02 -1.6429780423641205e-01 + <_> + + 0 -1 1152 -3.4072279930114746e-02 + + 3.9418798685073853e-01 -3.2914638519287109e-02 + <_> + + 0 -1 1153 -5.9365970082581043e-03 + + 6.4854122698307037e-02 -8.6971588432788849e-02 + <_> + + 0 -1 1154 -5.1997308619320393e-03 + + -2.1710740029811859e-01 6.5441012382507324e-02 + <_> + + 0 -1 1155 3.0441130511462688e-03 + + -4.7171641141176224e-02 9.4662867486476898e-02 + <_> + + 0 -1 1156 -2.2375459957402200e-04 + + 1.1739899963140488e-01 -1.0451590269804001e-01 + <_> + + 0 -1 1157 4.9494139850139618e-02 + + 9.9552040919661522e-03 -8.8205021619796753e-01 + <_> + + 0 -1 1158 7.7127031981945038e-02 + + -3.6638759076595306e-02 3.7156999111175537e-01 + <_> + + 0 -1 1159 -3.7054829299449921e-03 + + 4.6213079243898392e-02 -7.9498499631881714e-02 + <_> + + 0 -1 1160 1.3655430078506470e-01 + + 2.0802579820156097e-02 -6.4692282676696777e-01 + <_> + + 0 -1 1161 -1.6919399797916412e-01 + + -9.0144991874694824e-01 4.3158119660802186e-04 + <_> + + 0 -1 1162 5.2525149658322334e-03 + + 8.6686216294765472e-02 -1.5751640498638153e-01 + <_> + + 0 -1 1163 5.7952258735895157e-02 + + 1.3485850067809224e-03 -1.0001620054244995e+00 + <_> + + 0 -1 1164 -3.0681459233164787e-02 + + -6.7346888780593872e-01 1.7730809748172760e-02 + <_> + + 0 -1 1165 -2.8556400910019875e-02 + + 2.4913530051708221e-01 -2.1807359531521797e-02 + <_> + + 0 -1 1166 5.8311191387474537e-03 + + 1.0109650343656540e-01 -1.2586539983749390e-01 + <_> + + 0 -1 1167 2.8870739042758942e-03 + + -4.5462280511856079e-02 1.4794190227985382e-01 + <_> + + 0 -1 1168 -5.3575891070067883e-03 + + 1.0845459997653961e-01 -2.0636059343814850e-01 + <_> + + 0 -1 1169 2.0851830020546913e-02 + + -2.5641430169343948e-02 1.2000799924135208e-01 + <_> + + 0 -1 1170 2.9372319113463163e-03 + + -5.8832980692386627e-02 2.3967139422893524e-01 + <_> + + 0 -1 1171 1.0109069757163525e-02 + + 4.4724740087985992e-02 -2.5024959444999695e-01 + <_> + + 0 -1 1172 6.2002640217542648e-02 + + 3.1236680224537849e-02 -3.8775479793548584e-01 + <_> + + 0 -1 1173 1.7331680282950401e-03 + + -7.6642520725727081e-02 5.8738309890031815e-02 + <_> + + 0 -1 1174 -4.6648900955915451e-02 + + 4.7800371050834656e-01 -2.8223259374499321e-02 + <_> + + 0 -1 1175 -4.0585011243820190e-02 + + 1.9591329991817474e-01 -2.9608549550175667e-02 + <_> + + 0 -1 1176 1.4297359623014927e-02 + + 8.0422781407833099e-02 -2.0024399459362030e-01 + <_> + + 0 -1 1177 -1.4215649571269751e-03 + + 9.7693942487239838e-02 -1.3090120255947113e-01 + <_> + + 0 -1 1178 5.2683628164231777e-03 + + -5.8376371860504150e-02 2.4378040432929993e-01 + <_> + 104 + -6.8976742029190063e-01 + + <_> + + 0 -1 1179 -2.6198190171271563e-03 + + 1.8673700094223022e-01 -1.9126529991626740e-01 + <_> + + 0 -1 1180 -2.8629099950194359e-02 + + 1.2887109816074371e-01 -2.6186849921941757e-02 + <_> + + 0 -1 1181 7.1718869730830193e-03 + + 8.8158592581748962e-02 -2.0327340066432953e-01 + <_> + + 0 -1 1182 1.1641040444374084e-02 + + -2.1058250218629837e-02 1.7591789364814758e-01 + <_> + + 0 -1 1183 5.6764329783618450e-03 + + 4.9941159784793854e-02 -2.7329298853874207e-01 + <_> + + 0 -1 1184 -4.4392690062522888e-02 + + 5.6766128540039062e-01 -1.8674779683351517e-02 + <_> + + 0 -1 1185 1.3367610517889261e-04 + + -1.2990309298038483e-01 1.3542290031909943e-01 + <_> + + 0 -1 1186 -4.4111948460340500e-02 + + 2.2684830427169800e-01 -1.3318399898707867e-02 + <_> + + 0 -1 1187 2.9443150851875544e-03 + + 4.3161459267139435e-02 -2.9311171174049377e-01 + <_> + + 0 -1 1188 3.5300010349601507e-03 + + 7.7193722128868103e-02 -2.6324981451034546e-01 + <_> + + 0 -1 1189 1.0119210183620453e-01 + + -5.4924260824918747e-02 3.2430219650268555e-01 + <_> + + 0 -1 1190 -2.2348569706082344e-02 + + 3.0803111195564270e-01 -2.2518489509820938e-02 + <_> + + 0 -1 1191 6.4755380153656006e-03 + + -1.2045770138502121e-01 1.3186110556125641e-01 + <_> + + 0 -1 1192 1.0904319584369659e-02 + + 1.0217989981174469e-01 -1.8308849632740021e-01 + <_> + + 0 -1 1193 -1.1256629601120949e-02 + + -2.9186639189720154e-01 5.5491220206022263e-02 + <_> + + 0 -1 1194 3.6791800521314144e-03 + + -5.0614688545465469e-02 8.2663312554359436e-02 + <_> + + 0 -1 1195 -9.1721288859844208e-02 + + -7.7127552032470703e-01 1.9312959164381027e-02 + <_> + + 0 -1 1196 4.0099889039993286e-02 + + 7.8663527965545654e-03 -8.1302827596664429e-01 + <_> + + 0 -1 1197 -5.4956428706645966e-02 + + 2.9059520363807678e-01 -5.9825580567121506e-02 + <_> + + 0 -1 1198 2.4804650247097015e-01 + + 1.1665189638733864e-02 -6.9121950864791870e-01 + <_> + + 0 -1 1199 -3.4284800291061401e-02 + + 4.5358398556709290e-01 -3.2071251422166824e-02 + <_> + + 0 -1 1200 2.5439230725169182e-02 + + 1.9467150792479515e-02 -3.7927991151809692e-01 + <_> + + 0 -1 1201 -1.2720660306513309e-02 + + -2.1211430430412292e-01 6.1533831059932709e-02 + <_> + + 0 -1 1202 1.0831000283360481e-02 + + -5.1443681120872498e-02 1.6947689652442932e-01 + <_> + + 0 -1 1203 -2.1931570023298264e-02 + + 2.4839389324188232e-01 -5.6636359542608261e-02 + <_> + + 0 -1 1204 2.9397898912429810e-01 + + 1.1411529965698719e-02 -9.3696069717407227e-01 + <_> + + 0 -1 1205 -1.6342259943485260e-02 + + -3.1589549779891968e-01 4.4371981173753738e-02 + <_> + + 0 -1 1206 -4.4280499219894409e-02 + + 2.0337340235710144e-01 -2.1462319418787956e-02 + <_> + + 0 -1 1207 2.6503309607505798e-01 + + 1.1633150279521942e-02 -9.1220170259475708e-01 + <_> + + 0 -1 1208 -7.6378479599952698e-02 + + 1.8688270449638367e-01 -1.9672080874443054e-02 + <_> + + 0 -1 1209 -1.0061570443212986e-02 + + -2.6462039351463318e-01 4.6620260924100876e-02 + <_> + + 0 -1 1210 2.4921730160713196e-02 + + -1.9131390377879143e-02 2.0154500007629395e-01 + <_> + + 0 -1 1211 1.5098409676284064e-05 + + -1.6241690516471863e-01 7.6183967292308807e-02 + <_> + + 0 -1 1212 -1.0081910341978073e-01 + + -1. 7.4751500505954027e-04 + <_> + + 0 -1 1213 6.5058596432209015e-02 + + -4.0468640625476837e-02 3.5160079598426819e-01 + <_> + + 0 -1 1214 -1.2190239876508713e-01 + + -5.3624558448791504e-01 1.8637020140886307e-02 + <_> + + 0 -1 1215 -9.8520738538354635e-04 + + 1.1398199945688248e-01 -1.1298830062150955e-01 + <_> + + 0 -1 1216 -2.5300619006156921e-01 + + -4.3375909328460693e-01 1.2367400340735912e-02 + <_> + + 0 -1 1217 7.5246659107506275e-03 + + 6.7355476319789886e-02 -1.8583969771862030e-01 + <_> + + 0 -1 1218 4.8102210275828838e-03 + + -6.5870061516761780e-02 1.2848910689353943e-01 + <_> + + 0 -1 1219 -1.4562129508703947e-03 + + 1.8110689520835876e-01 -1.1248459666967392e-01 + <_> + + 0 -1 1220 -5.6546321138739586e-03 + + 1.0369840264320374e-01 -1.4115570485591888e-01 + <_> + + 0 -1 1221 -3.1951289623975754e-02 + + -3.2971608638763428e-01 4.8281811177730560e-02 + <_> + + 0 -1 1222 4.2190380394458771e-02 + + -1.1644810438156128e-02 1.3701300323009491e-01 + <_> + + 0 -1 1223 1.2606659904122353e-02 + + -6.0395881533622742e-02 2.4210059642791748e-01 + <_> + + 0 -1 1224 -6.0083861462771893e-03 + + 9.5677606761455536e-02 -2.0248259603977203e-01 + <_> + + 0 -1 1225 4.0676388889551163e-02 + + -3.8506429642438889e-02 3.9824029803276062e-01 + <_> + + 0 -1 1226 -1.3010219670832157e-02 + + -7.7870443463325500e-02 3.2533310353755951e-02 + <_> + + 0 -1 1227 -5.6646969169378281e-02 + + -9.5293551683425903e-01 1.7375659197568893e-02 + <_> + + 0 -1 1228 3.7307970225811005e-02 + + -3.3261440694332123e-02 4.6856319904327393e-01 + <_> + + 0 -1 1229 -2.7986379340291023e-02 + + -4.6356698870658875e-01 2.8524029999971390e-02 + <_> + + 0 -1 1230 -7.5014896690845490e-02 + + 2.4519899487495422e-01 -1.5830159187316895e-02 + <_> + + 0 -1 1231 2.7673080563545227e-02 + + -3.6458358168601990e-02 3.7215578556060791e-01 + <_> + + 0 -1 1232 -1.7312960699200630e-02 + + -2.2117659449577332e-01 4.3232619762420654e-02 + <_> + + 0 -1 1233 -5.8893948793411255e-02 + + 3.9726749062538147e-01 -3.7632528692483902e-02 + <_> + + 0 -1 1234 1.3193679973483086e-02 + + 2.4857729673385620e-02 -1.7514359951019287e-01 + <_> + + 0 -1 1235 3.8230679929256439e-02 + + 2.9635110870003700e-02 -4.3452748656272888e-01 + <_> + + 0 -1 1236 1.6845399513840675e-02 + + 3.9338748902082443e-02 -2.3765720427036285e-01 + <_> + + 0 -1 1237 -1.1559460312128067e-01 + + -4.0006878972053528e-01 3.2390538603067398e-02 + <_> + + 0 -1 1238 -1.7385910032317042e-03 + + 4.8545818775892258e-02 -6.1474680900573730e-02 + <_> + + 0 -1 1239 -3.3697668462991714e-02 + + 2.4345000088214874e-01 -6.5504603087902069e-02 + <_> + + 0 -1 1240 -3.4722799062728882e-01 + + -3.3612060546875000e-01 1.5501200221478939e-02 + <_> + + 0 -1 1241 5.8668039739131927e-02 + + 6.8068057298660278e-02 -2.2104929387569427e-01 + <_> + + 0 -1 1242 2.3718189448118210e-02 + + -1.4779569581151009e-02 4.7328341007232666e-01 + <_> + + 0 -1 1243 2.8812700882554054e-02 + + 3.3309880644083023e-02 -4.6797698736190796e-01 + <_> + + 0 -1 1244 4.1023749858140945e-02 + + -2.8293000534176826e-02 4.9427551031112671e-01 + <_> + + 0 -1 1245 -1.2017590051982552e-04 + + 1.0363650321960449e-01 -1.2107490003108978e-01 + <_> + + 0 -1 1246 -1.0908070206642151e-01 + + -1. 3.2971999607980251e-03 + <_> + + 0 -1 1247 -4.5967359095811844e-02 + + 6.4819461107254028e-01 -1.9233519211411476e-02 + <_> + + 0 -1 1248 -1.9345719367265701e-02 + + -3.3145549893379211e-01 3.9008539170026779e-02 + <_> + + 0 -1 1249 1.2312790378928185e-02 + + 4.1029628366231918e-02 -2.7943921089172363e-01 + <_> + + 0 -1 1250 2.1535221021622419e-03 + + -6.7545056343078613e-02 1.1647740006446838e-01 + <_> + + 0 -1 1251 -3.2158788293600082e-02 + + 5.4741638898849487e-01 -2.3730229586362839e-02 + <_> + + 0 -1 1252 -2.7592359110713005e-02 + + -7.5319421291351318e-01 8.4066214039921761e-03 + <_> + + 0 -1 1253 2.2264510393142700e-02 + + 1.2146740220487118e-02 -9.0291297435760498e-01 + <_> + + 0 -1 1254 1.5361379832029343e-02 + + -3.1641189008951187e-02 3.2132801413536072e-01 + <_> + + 0 -1 1255 -1.2360660359263420e-02 + + 2.9248631000518799e-01 -4.5303758233785629e-02 + <_> + + 0 -1 1256 2.2978749126195908e-02 + + -1.2054479680955410e-02 1.9060949981212616e-01 + <_> + + 0 -1 1257 2.3296380415558815e-02 + + 3.1409051269292831e-02 -5.1856082677841187e-01 + <_> + + 0 -1 1258 5.7384249521419406e-04 + + -1.0293489694595337e-01 8.1548452377319336e-02 + <_> + + 0 -1 1259 -3.3020470291376114e-02 + + 4.2470559477806091e-01 -4.4794678688049316e-02 + <_> + + 0 -1 1260 -2.1713029593229294e-02 + + -1.4825260639190674e-01 1.2959879823029041e-02 + <_> + + 0 -1 1261 -9.7430922323837876e-05 + + 1.1899639666080475e-01 -1.4753970503807068e-01 + <_> + + 0 -1 1262 -9.2907734215259552e-03 + + -1.1635430157184601e-01 5.4104641079902649e-02 + <_> + + 0 -1 1263 3.7244848906993866e-02 + + -3.4421201795339584e-02 3.7943929433822632e-01 + <_> + + 0 -1 1264 1.5277029573917389e-01 + + 7.2725401259958744e-03 -3.4155088663101196e-01 + <_> + + 0 -1 1265 -1.2663450092077255e-02 + + -3.0596670508384705e-01 3.8231261074542999e-02 + <_> + + 0 -1 1266 -7.4888423085212708e-02 + + -3.4658950567245483e-01 1.5501650050282478e-02 + <_> + + 0 -1 1267 -4.0114589035511017e-02 + + 3.2629820704460144e-01 -4.1313670575618744e-02 + <_> + + 0 -1 1268 -9.6492111682891846e-02 + + 1.0172849893569946e-01 -1.7156010493636131e-02 + <_> + + 0 -1 1269 -1.6712839901447296e-01 + + -7.7655118703842163e-01 1.8029559403657913e-02 + <_> + + 0 -1 1270 -8.2981940358877182e-03 + + -1.4397139847278595e-01 5.8948140591382980e-02 + <_> + + 0 -1 1271 -3.7844169419258833e-03 + + 1.7095179855823517e-01 -7.8256443142890930e-02 + <_> + + 0 -1 1272 -1.6076420247554779e-01 + + 2.3138229548931122e-01 -1.3428050093352795e-02 + <_> + + 0 -1 1273 6.4544437918812037e-04 + + -1.4424400031566620e-01 8.3287820219993591e-02 + <_> + + 0 -1 1274 2.2737309336662292e-02 + + -3.4155819565057755e-02 3.5519808530807495e-01 + <_> + + 0 -1 1275 -3.9030050393193960e-03 + + -1.8736769258975983e-01 6.4628012478351593e-02 + <_> + + 0 -1 1276 -5.1145430654287338e-02 + + 6.6892707347869873e-01 -1.1180049739778042e-02 + <_> + + 0 -1 1277 -6.0482369735836983e-03 + + 1.8622750043869019e-01 -6.3018701970577240e-02 + <_> + + 0 -1 1278 1.1743569746613503e-02 + + 2.5449279695749283e-02 -1.3331249356269836e-01 + <_> + + 0 -1 1279 8.4120890824124217e-04 + + -9.3333467841148376e-02 1.3315880298614502e-01 + <_> + + 0 -1 1280 -3.7756171077489853e-02 + + -2.3138800263404846e-01 4.0569789707660675e-02 + <_> + + 0 -1 1281 -2.0867560058832169e-02 + + 1.0056090354919434e-01 -1.1744190007448196e-01 + <_> + + 0 -1 1282 -3.9802178740501404e-02 + + -1.1585719883441925e-01 1.2668189406394958e-01 + <_> + 111 + -6.8169009685516357e-01 + + <_> + + 0 -1 1283 8.4546189755201340e-03 + + -1.6289660334587097e-01 1.9834390282630920e-01 + <_> + + 0 -1 1284 5.1610451191663742e-02 + + -3.0827090144157410e-02 3.3742550015449524e-01 + <_> + + 0 -1 1285 -6.4909443259239197e-02 + + 2.8602281212806702e-01 -5.9848651289939880e-02 + <_> + + 0 -1 1286 -4.3951408006250858e-03 + + 1.1302659660577774e-01 -1.2632089853286743e-01 + <_> + + 0 -1 1287 -8.2756802439689636e-02 + + -6.0790950059890747e-01 2.1967180073261261e-02 + <_> + + 0 -1 1288 -4.8698862083256245e-03 + + 8.5866190493106842e-02 -8.9009523391723633e-02 + <_> + + 0 -1 1289 9.1512441635131836e-02 + + -5.3345348685979843e-02 2.6732870936393738e-01 + <_> + + 0 -1 1290 3.6815661005675793e-03 + + 7.0915699005126953e-02 -1.7941209673881531e-01 + <_> + + 0 -1 1291 6.3032708130776882e-03 + + 1.2378150224685669e-01 -1.2391480058431625e-01 + <_> + + 0 -1 1292 5.8764131972566247e-04 + + -6.3813656568527222e-02 9.5545768737792969e-02 + <_> + + 0 -1 1293 1.4680320397019386e-02 + + -4.9183528870344162e-02 2.9040598869323730e-01 + <_> + + 0 -1 1294 3.5624930169433355e-03 + + -9.7563147544860840e-02 4.8932831734418869e-02 + <_> + + 0 -1 1295 -7.4473340064287186e-03 + + -1.5952460467815399e-01 8.4772646427154541e-02 + <_> + + 0 -1 1296 5.4010991007089615e-02 + + -2.0565150305628777e-02 5.7340717315673828e-01 + <_> + + 0 -1 1297 -2.3613919038325548e-03 + + 1.4957650005817413e-01 -7.5148113071918488e-02 + <_> + + 0 -1 1298 4.0665458887815475e-02 + + 1.4762399718165398e-02 -5.9685671329498291e-01 + <_> + + 0 -1 1299 9.3258380889892578e-02 + + 1.3036210089921951e-02 -6.8643862009048462e-01 + <_> + + 0 -1 1300 2.8593749739229679e-03 + + -5.4904639720916748e-02 9.8074667155742645e-02 + <_> + + 0 -1 1301 -4.9756402149796486e-03 + + 1.6751970350742340e-01 -8.2563832402229309e-02 + <_> + + 0 -1 1302 -2.2061138879507780e-03 + + 7.1486182510852814e-02 -8.4684796631336212e-02 + <_> + + 0 -1 1303 4.3787518516182899e-03 + + 7.5296439230442047e-02 -1.6988970339298248e-01 + <_> + + 0 -1 1304 -4.9143321812152863e-03 + + 1.6274330019950867e-01 -5.7579189538955688e-02 + <_> + + 0 -1 1305 -3.0191219411790371e-03 + + -1.2450099736452103e-01 1.1526980251073837e-01 + <_> + + 0 -1 1306 6.8227178417146206e-03 + + 3.7166971713304520e-02 -1.0093449801206589e-01 + <_> + + 0 -1 1307 3.5116981714963913e-02 + + -4.2997431010007858e-02 3.2959198951721191e-01 + <_> + + 0 -1 1308 -1.4400649815797806e-03 + + -9.8922260105609894e-02 6.7108891904354095e-02 + <_> + + 0 -1 1309 -4.6699359081685543e-03 + + -1.8003439903259277e-01 6.8038396537303925e-02 + <_> + + 0 -1 1310 3.7647720426321030e-02 + + -2.1031750366091728e-02 1.6627119481563568e-01 + <_> + + 0 -1 1311 5.1745469681918621e-03 + + -1.1846090108156204e-01 1.0919190198183060e-01 + <_> + + 0 -1 1312 7.7274879440665245e-03 + + -5.5097330361604691e-02 2.2752280533313751e-01 + <_> + + 0 -1 1313 2.9158849269151688e-02 + + 7.7885583043098450e-02 -1.7775520682334900e-01 + <_> + + 0 -1 1314 2.9885378899052739e-04 + + -7.8875280916690826e-02 5.1163110882043839e-02 + <_> + + 0 -1 1315 1.4456070493906736e-04 + + -1.6097649931907654e-01 8.1574030220508575e-02 + <_> + + 0 -1 1316 4.7840740531682968e-02 + + 1.4210550114512444e-02 -3.1316679716110229e-01 + <_> + + 0 -1 1317 4.3943468481302261e-02 + + -3.1002480536699295e-02 4.2450350522994995e-01 + <_> + + 0 -1 1318 -1.7603389918804169e-01 + + -2.1625219285488129e-01 1.3710640370845795e-02 + <_> + + 0 -1 1319 -2.7010550722479820e-02 + + 4.5448291301727295e-01 -2.8507620096206665e-02 + <_> + + 0 -1 1320 6.4534661360085011e-03 + + -4.9660708755254745e-02 8.3071723580360413e-02 + <_> + + 0 -1 1321 -7.1115070022642612e-03 + + -2.2509810328483582e-01 6.5033361315727234e-02 + <_> + + 0 -1 1322 -2.5184849277138710e-02 + + -1.7480330169200897e-01 1.8751099705696106e-02 + <_> + + 0 -1 1323 -8.8047432655002922e-05 + + 1.2677890062332153e-01 -1.0704579949378967e-01 + <_> + + 0 -1 1324 -3.6020219326019287e-02 + + 2.4649600684642792e-01 -4.9772080034017563e-02 + <_> + + 0 -1 1325 7.6084570027887821e-03 + + 1.0041440278291702e-01 -1.3673840463161469e-01 + <_> + + 0 -1 1326 -8.2404967397451401e-03 + + 1.1703260242938995e-01 -5.2781961858272552e-02 + <_> + + 0 -1 1327 -7.2474818443879485e-04 + + -1.1650030314922333e-01 1.1333490163087845e-01 + <_> + + 0 -1 1328 -7.8272278187796474e-05 + + 6.4425677061080933e-02 -1.5894609689712524e-01 + <_> + + 0 -1 1329 -2.0254699047654867e-03 + + -1.7027080059051514e-01 7.1216866374015808e-02 + <_> + + 0 -1 1330 -1.1882030218839645e-01 + + 3.2878550887107849e-01 -1.5325210057199001e-02 + <_> + + 0 -1 1331 -1.6258429735898972e-02 + + 2.1848890185356140e-01 -5.6253198534250259e-02 + <_> + + 0 -1 1332 -6.8429792299866676e-03 + + -2.3313499987125397e-01 5.7107821106910706e-02 + <_> + + 0 -1 1333 3.4939710050821304e-02 + + -2.7333829551935196e-02 4.5651969313621521e-01 + <_> + + 0 -1 1334 2.2979779541492462e-01 + + 1.4508989639580250e-02 -8.7165087461471558e-01 + <_> + + 0 -1 1335 4.3360598385334015e-02 + + 8.4467595443129539e-03 -8.7500327825546265e-01 + <_> + + 0 -1 1336 -1.1806190013885498e-03 + + 7.8186698257923126e-02 -5.2834209054708481e-02 + <_> + + 0 -1 1337 -4.1772681474685669e-01 + + -8.0729222297668457e-01 1.3048130087554455e-02 + <_> + + 0 -1 1338 -4.6315230429172516e-02 + + 2.9375079274177551e-01 -3.5192389041185379e-02 + <_> + + 0 -1 1339 -4.0271300822496414e-02 + + -5.8174532651901245e-01 1.9768500700592995e-02 + <_> + + 0 -1 1340 -4.3012440204620361e-02 + + 1.0882510244846344e-01 -2.6977609843015671e-02 + <_> + + 0 -1 1341 2.8285770677030087e-03 + + 7.6837047934532166e-02 -1.5720550715923309e-01 + <_> + + 0 -1 1342 -3.3204611390829086e-02 + + -2.3152589797973633e-01 1.5932539477944374e-02 + <_> + + 0 -1 1343 -4.8097351100295782e-04 + + 1.1043740063905716e-01 -1.1589460074901581e-01 + <_> + + 0 -1 1344 2.9704240150749683e-03 + + -3.4243740141391754e-02 6.9107398390769958e-02 + <_> + + 0 -1 1345 1.1893190443515778e-02 + + 8.0122880637645721e-02 -2.0503090322017670e-01 + <_> + + 0 -1 1346 -6.3963606953620911e-02 + + -8.5530751943588257e-01 6.4783529378473759e-03 + <_> + + 0 -1 1347 -5.6093540042638779e-03 + + 1.6278949379920959e-01 -1.0079070180654526e-01 + <_> + + 0 -1 1348 7.5979339890182018e-03 + + 5.4123409092426300e-02 -1.2431269884109497e-01 + <_> + + 0 -1 1349 1.3480819761753082e-02 + + -6.3751302659511566e-02 2.5250628590583801e-01 + <_> + + 0 -1 1350 -9.4613758847117424e-04 + + 4.2835868895053864e-02 -7.6837100088596344e-02 + <_> + + 0 -1 1351 -3.8062490522861481e-02 + + 1.9252179563045502e-01 -6.3947133719921112e-02 + <_> + + 0 -1 1352 1.2410899996757507e-01 + + 7.9416595399379730e-03 -4.2653021216392517e-01 + <_> + + 0 -1 1353 -9.2228442430496216e-02 + + -5.5210620164871216e-01 2.8964910656213760e-02 + <_> + + 0 -1 1354 1.5106770209968090e-02 + + 2.7609340846538544e-02 -1.6688449680805206e-01 + <_> + + 0 -1 1355 -2.3654250428080559e-02 + + -3.4379678964614868e-01 3.9513330906629562e-02 + <_> + + 0 -1 1356 4.7881390899419785e-02 + + 8.0661084502935410e-03 -1.8185199797153473e-01 + <_> + + 0 -1 1357 8.5415288805961609e-02 + + -4.6752408146858215e-02 2.7169001102447510e-01 + <_> + + 0 -1 1358 3.1524940859526396e-03 + + -8.6421400308609009e-02 6.8336002528667450e-02 + <_> + + 0 -1 1359 -3.0099870637059212e-03 + + 8.9336208999156952e-02 -1.3626849651336670e-01 + <_> + + 0 -1 1360 -5.8112520724534988e-02 + + -1.9748120009899139e-01 2.6536440476775169e-02 + <_> + + 0 -1 1361 1.2775669991970062e-01 + + -4.9838040024042130e-02 3.4896400570869446e-01 + <_> + + 0 -1 1362 1.2011290341615677e-01 + + -6.3313432037830353e-03 3.7937548756599426e-01 + <_> + + 0 -1 1363 4.7567482106387615e-03 + + 1.0490419715642929e-01 -1.3542570173740387e-01 + <_> + + 0 -1 1364 -1.5902349725365639e-02 + + 6.1786301434040070e-02 -9.8376080393791199e-02 + <_> + + 0 -1 1365 -5.6423708796501160e-02 + + -6.3371032476425171e-01 2.0224599167704582e-02 + <_> + + 0 -1 1366 -7.9641327261924744e-02 + + -1. 8.7428308324888349e-04 + <_> + + 0 -1 1367 -2.0731301046907902e-03 + + 1.3846459984779358e-01 -9.5865301787853241e-02 + <_> + + 0 -1 1368 5.8470368385314941e-03 + + -5.7033840566873550e-02 1.1691799759864807e-01 + <_> + + 0 -1 1369 -2.6138950139284134e-02 + + -2.2362439334392548e-01 5.5546630173921585e-02 + <_> + + 0 -1 1370 -6.5781630109995604e-04 + + 9.2999227344989777e-02 -8.4152117371559143e-02 + <_> + + 0 -1 1371 -5.6041389703750610e-02 + + 3.5072851181030273e-01 -3.1472280621528625e-02 + <_> + + 0 -1 1372 9.7799800336360931e-02 + + 1.0124430060386658e-02 -3.7714061141014099e-01 + <_> + + 0 -1 1373 4.5515140518546104e-03 + + -7.8311361372470856e-02 1.4166970551013947e-01 + <_> + + 0 -1 1374 1.0168380104005337e-02 + + 5.2113991230726242e-02 -2.4422790110111237e-01 + <_> + + 0 -1 1375 6.2885403633117676e-02 + + -1.8255509436130524e-02 6.2847292423248291e-01 + <_> + + 0 -1 1376 -4.8064131289720535e-02 + + -8.6817431449890137e-01 6.6064838320016861e-03 + <_> + + 0 -1 1377 1.8479900434613228e-02 + + 6.9977812469005585e-02 -1.5929399430751801e-01 + <_> + + 0 -1 1378 2.4549840018153191e-02 + + -1.7519120126962662e-02 1.7961919307708740e-01 + <_> + + 0 -1 1379 3.9227470755577087e-02 + + -4.7417990863323212e-02 2.7945789694786072e-01 + <_> + + 0 -1 1380 4.1248198598623276e-02 + + 1.1459370143711567e-02 -4.3477478623390198e-01 + <_> + + 0 -1 1381 -8.4321142639964819e-04 + + 1.2758859992027283e-01 -9.7010560333728790e-02 + <_> + + 0 -1 1382 -1.3688740320503712e-02 + + -1.6236190497875214e-01 4.3290950357913971e-02 + <_> + + 0 -1 1383 -5.5982511490583420e-02 + + -7.5431138277053833e-01 1.5797710046172142e-02 + <_> + + 0 -1 1384 7.3578268289566040e-02 + + -1.4777439646422863e-03 -1.0000350475311279e+00 + <_> + + 0 -1 1385 3.7084969226270914e-03 + + -9.7184643149375916e-02 1.2435329705476761e-01 + <_> + + 0 -1 1386 -1.4889879821566865e-05 + + 7.1465343236923218e-02 -1.6840849816799164e-01 + <_> + + 0 -1 1387 1.0487560182809830e-01 + + 1.5076650306582451e-02 -7.1159482002258301e-01 + <_> + + 0 -1 1388 1.2587489560246468e-02 + + -2.0771300420165062e-02 1.7468680441379547e-01 + <_> + + 0 -1 1389 -2.2228389570955187e-04 + + 1.1781640350818634e-01 -9.2627458274364471e-02 + <_> + + 0 -1 1390 -7.7760413289070129e-02 + + -7.4605411291122437e-01 3.6328181158751249e-03 + <_> + + 0 -1 1391 4.5043420046567917e-02 + + 2.2217869758605957e-02 -5.0052911043167114e-01 + <_> + + 0 -1 1392 3.5614410880953074e-03 + + -5.1213219761848450e-02 8.9986503124237061e-02 + <_> + + 0 -1 1393 -7.4102368671447039e-04 + + 1.3938049972057343e-01 -1.0272219777107239e-01 + <_> + 107 + -6.0689288377761841e-01 + + <_> + + 0 -1 1394 -8.5600130259990692e-03 + + 1.6578909754753113e-01 -1.6412919759750366e-01 + <_> + + 0 -1 1395 3.0798809602856636e-02 + + -3.3495649695396423e-02 2.8578650951385498e-01 + <_> + + 0 -1 1396 -3.7319411057978868e-04 + + 1.2523449957370758e-01 -1.2115170061588287e-01 + <_> + + 0 -1 1397 -1.9253849983215332e-02 + + -8.7740883231163025e-02 3.9066571742296219e-02 + <_> + + 0 -1 1398 -8.5401646792888641e-03 + + 1.3152270019054413e-01 -1.3007740676403046e-01 + <_> + + 0 -1 1399 1.2424349784851074e-01 + + 1.9019979983568192e-02 -7.8247052431106567e-01 + <_> + + 0 -1 1400 4.0093418210744858e-02 + + -4.0743768215179443e-02 3.8851749897003174e-01 + <_> + + 0 -1 1401 -4.4169559259898961e-05 + + 4.5526970177888870e-02 -8.8063806295394897e-02 + <_> + + 0 -1 1402 -1.7662849277257919e-02 + + -3.1371811032295227e-01 5.1794338971376419e-02 + <_> + + 0 -1 1403 5.2368510514497757e-02 + + -3.5845998674631119e-02 1.5009739995002747e-01 + <_> + + 0 -1 1404 -2.8719279915094376e-02 + + -1.9849379360675812e-01 7.8099071979522705e-02 + <_> + + 0 -1 1405 6.9435790181159973e-02 + + -5.5073730647563934e-02 2.1780849993228912e-01 + <_> + + 0 -1 1406 5.4794438183307648e-02 + + -3.0223689973354340e-02 6.2993967533111572e-01 + <_> + + 0 -1 1407 -1.5315500088036060e-02 + + -1.5052799880504608e-01 2.0194370299577713e-02 + <_> + + 0 -1 1408 2.9001969844102859e-02 + + -2.0738989114761353e-02 4.5645099878311157e-01 + <_> + + 0 -1 1409 -2.3264769464731216e-02 + + 1.4672529697418213e-01 -3.8081351667642593e-02 + <_> + + 0 -1 1410 1.9063109531998634e-02 + + 7.2921238839626312e-02 -2.2723700106143951e-01 + <_> + + 0 -1 1411 1.2208239641040564e-03 + + 7.3471322655677795e-02 -1.9122929871082306e-01 + <_> + + 0 -1 1412 -1.7565910518169403e-01 + + 2.5924688577651978e-01 -5.6015118956565857e-02 + <_> + + 0 -1 1413 -3.8042131811380386e-02 + + 1.6113610565662384e-01 -4.3758820742368698e-02 + <_> + + 0 -1 1414 3.0130259692668915e-02 + + 5.7830829173326492e-02 -2.9774171113967896e-01 + <_> + + 0 -1 1415 2.0089220255613327e-02 + + -6.0509629547595978e-02 3.3441681414842606e-02 + <_> + + 0 -1 1416 2.6193389203399420e-04 + + -1.5175449848175049e-01 1.1094109714031219e-01 + <_> + + 0 -1 1417 4.0310628712177277e-02 + + 1.7477119341492653e-02 -1.4185379445552826e-01 + <_> + + 0 -1 1418 -2.9343019705265760e-03 + + -1.6960139572620392e-01 9.3530252575874329e-02 + <_> + + 0 -1 1419 1.4554520137608051e-02 + + -7.5844526290893555e-02 2.7771660685539246e-01 + <_> + + 0 -1 1420 3.4086001105606556e-03 + + 7.3933310806751251e-02 -1.9626590609550476e-01 + <_> + + 0 -1 1421 -6.7988429218530655e-03 + + -2.0132480561733246e-01 5.8276038616895676e-02 + <_> + + 0 -1 1422 -5.0457930192351341e-03 + + 1.9446060061454773e-01 -7.1691580116748810e-02 + <_> + + 0 -1 1423 1.0465010069310665e-02 + + -4.7314591705799103e-02 1.9316110014915466e-01 + <_> + + 0 -1 1424 -1.6713530058041215e-03 + + 9.2915147542953491e-02 -1.1890129745006561e-01 + <_> + + 0 -1 1425 -4.2704358696937561e-02 + + 1.6961039602756500e-01 -2.0632650703191757e-02 + <_> + + 0 -1 1426 2.0367829501628876e-01 + + 2.3246899247169495e-02 -4.9420261383056641e-01 + <_> + + 0 -1 1427 -8.3379482384771109e-04 + + 5.0001069903373718e-02 -7.3779806494712830e-02 + <_> + + 0 -1 1428 1.7854769527912140e-01 + + 1.5588290058076382e-02 -7.7650082111358643e-01 + <_> + + 0 -1 1429 -1.3535289466381073e-01 + + -5.2299112081527710e-01 3.1595760956406593e-03 + <_> + + 0 -1 1430 4.6555269509553909e-02 + + -4.1891060769557953e-02 3.0324798822402954e-01 + <_> + + 0 -1 1431 2.2663649171590805e-02 + + 3.8851160556077957e-02 -8.5196226835250854e-02 + <_> + + 0 -1 1432 -2.3027729988098145e-01 + + -9.3503099679946899e-01 1.3942349702119827e-02 + <_> + + 0 -1 1433 2.5714140385389328e-02 + + -9.1460775583982468e-03 7.8063201904296875e-01 + <_> + + 0 -1 1434 -7.3728510869841557e-06 + + 6.2730923295021057e-02 -2.0042170584201813e-01 + <_> + + 0 -1 1435 -1.9757889211177826e-02 + + -2.3434729874134064e-01 1.4600900001823902e-02 + <_> + + 0 -1 1436 -4.1893101297318935e-03 + + 1.4971399307250977e-01 -6.9368869066238403e-02 + <_> + + 0 -1 1437 1.1314969742670655e-03 + + -6.9203592836856842e-02 1.0447440296411514e-01 + <_> + + 0 -1 1438 6.3914088532328606e-03 + + 5.6134030222892761e-02 -1.9862769544124603e-01 + <_> + + 0 -1 1439 -3.7047569639980793e-03 + + 9.6817292273044586e-02 -9.5282286405563354e-02 + <_> + + 0 -1 1440 3.0627459287643433e-02 + + -5.0079640001058578e-02 2.6023888587951660e-01 + <_> + + 0 -1 1441 3.2444439828395844e-02 + + 3.1099939718842506e-02 -2.0788609981536865e-01 + <_> + + 0 -1 1442 1.1651559732854366e-02 + + -5.8311950415372849e-02 2.5374108552932739e-01 + <_> + + 0 -1 1443 -3.6515220999717712e-02 + + -2.6749190688133240e-01 2.0536249503493309e-02 + <_> + + 0 -1 1444 1.7474630847573280e-02 + + 4.7416981309652328e-02 -3.3719009160995483e-01 + <_> + + 0 -1 1445 -1.5204170485958457e-03 + + 5.8933809399604797e-02 -9.5844946801662445e-02 + <_> + + 0 -1 1446 4.7761179506778717e-02 + + 1.0849700309336185e-02 -8.6635017395019531e-01 + <_> + + 0 -1 1447 -6.3569113612174988e-02 + + 2.5858598947525024e-01 -1.8156580626964569e-02 + <_> + + 0 -1 1448 -1.7476839711889625e-03 + + 7.5750246644020081e-02 -1.4295279979705811e-01 + <_> + + 0 -1 1449 -4.6762558631598949e-03 + + -9.1223396360874176e-02 1.3135279715061188e-01 + <_> + + 0 -1 1450 2.2202100604772568e-02 + + -5.3397450596094131e-02 2.0743979513645172e-01 + <_> + + 0 -1 1451 -2.4647359549999237e-01 + + -4.5610219240188599e-01 3.5777890589088202e-03 + <_> + + 0 -1 1452 5.0148782320320606e-03 + + 8.8871829211711884e-02 -1.6236490011215210e-01 + <_> + + 0 -1 1453 -4.2023971676826477e-02 + + 1.2805579602718353e-01 -1.1926759965717793e-02 + <_> + + 0 -1 1454 -1.0895519703626633e-01 + + -6.6466122865676880e-01 1.5905549749732018e-02 + <_> + + 0 -1 1455 -3.6672928929328918e-01 + + 3.6374801397323608e-01 -3.1206229701638222e-02 + <_> + + 0 -1 1456 9.5884501934051514e-03 + + 9.1073550283908844e-02 -1.2492360174655914e-01 + <_> + + 0 -1 1457 1.6124530229717493e-03 + + 3.3751979470252991e-02 -5.8749239891767502e-02 + <_> + + 0 -1 1458 -1.7882430925965309e-02 + + 2.0992769300937653e-01 -6.3215233385562897e-02 + <_> + + 0 -1 1459 -6.6655018599703908e-05 + + 5.5020030587911606e-02 -1.7908810079097748e-01 + <_> + + 0 -1 1460 -1.0912610217928886e-02 + + -1.7878860235214233e-01 6.4088903367519379e-02 + <_> + + 0 -1 1461 -1.9031569827347994e-03 + + 1.1012560129165649e-01 -6.2576442956924438e-02 + <_> + + 0 -1 1462 4.7322059981524944e-03 + + 6.0611810535192490e-02 -1.7521250247955322e-01 + <_> + + 0 -1 1463 1.7955000698566437e-01 + + -2.6413710787892342e-02 5.1463198661804199e-01 + <_> + + 0 -1 1464 -1.8869279883801937e-03 + + 7.0732869207859039e-02 -1.8977560102939606e-01 + <_> + + 0 -1 1465 -3.5322420299053192e-03 + + 9.5800288021564484e-02 -4.9251660704612732e-02 + <_> + + 0 -1 1466 1.0818409500643611e-03 + + -9.7082488238811493e-02 1.4092449843883514e-01 + <_> + + 0 -1 1467 -9.5455259084701538e-02 + + -6.8376517295837402e-01 8.8187018409371376e-03 + <_> + + 0 -1 1468 1.6179149970412254e-03 + + -9.5129579305648804e-02 1.1351480334997177e-01 + <_> + + 0 -1 1469 6.5547877550125122e-01 + + 9.7635984420776367e-03 -5.6581187248229980e-01 + <_> + + 0 -1 1470 -7.7973723411560059e-02 + + 3.5573729872703552e-01 -3.3126130700111389e-02 + <_> + + 0 -1 1471 2.0209029316902161e-02 + + 3.9301611483097076e-02 -1.3580250740051270e-01 + <_> + + 0 -1 1472 9.0323589742183685e-02 + + -1.5932930633425713e-02 6.9409132003784180e-01 + <_> + + 0 -1 1473 -6.2048831023275852e-03 + + -1.7037659883499146e-01 6.8090677261352539e-02 + <_> + + 0 -1 1474 -1.5737250447273254e-02 + + 1.6250109672546387e-01 -6.6528938710689545e-02 + <_> + + 0 -1 1475 -3.5397041589021683e-02 + + -8.9766547083854675e-02 4.9135740846395493e-02 + <_> + + 0 -1 1476 3.2850861549377441e-02 + + 8.5158139467239380e-02 -1.3002319633960724e-01 + <_> + + 0 -1 1477 -8.4024056792259216e-02 + + 3.0658489465713501e-01 -3.9313621819019318e-02 + <_> + + 0 -1 1478 2.1347659640014172e-03 + + 8.3386950194835663e-02 -1.2239480018615723e-01 + <_> + + 0 -1 1479 1.7922610044479370e-01 + + 2.6004109531641006e-03 -9.9989092350006104e-01 + <_> + + 0 -1 1480 1.1854390054941177e-01 + + 1.1098369956016541e-02 -8.9629507064819336e-01 + <_> + + 0 -1 1481 -2.7351840399205685e-03 + + 1.1589130014181137e-01 -6.3589207828044891e-02 + <_> + + 0 -1 1482 6.6092880442738533e-03 + + -7.9491429030895233e-02 1.8501229584217072e-01 + <_> + + 0 -1 1483 -2.1072009578347206e-02 + + -1.4708499610424042e-01 2.6071280241012573e-02 + <_> + + 0 -1 1484 1.3411619700491428e-02 + + 4.8645589500665665e-02 -2.2041800618171692e-01 + <_> + + 0 -1 1485 -2.0661540329456329e-02 + + 2.1374049782752991e-01 -2.2243229672312737e-02 + <_> + + 0 -1 1486 -1.0939250141382217e-01 + + -7.9235088825225830e-01 1.1932499706745148e-02 + <_> + + 0 -1 1487 5.4573271423578262e-02 + + -8.7064085528254509e-03 3.8226109743118286e-01 + <_> + + 0 -1 1488 -2.7845989912748337e-02 + + 4.2096340656280518e-01 -3.4300819039344788e-02 + <_> + + 0 -1 1489 1.4973179996013641e-01 + + 5.5857440456748009e-03 -7.1027070283889771e-01 + <_> + + 0 -1 1490 5.4548021405935287e-02 + + 1.9289769232273102e-02 -5.5061852931976318e-01 + <_> + + 0 -1 1491 5.4990737698972225e-03 + + 4.3643891811370850e-02 -1.2233699858188629e-01 + <_> + + 0 -1 1492 3.5988059244118631e-04 + + -9.5005020499229431e-02 1.2501640617847443e-01 + <_> + + 0 -1 1493 -5.1003068685531616e-02 + + -3.4648188948631287e-01 1.4124399982392788e-02 + <_> + + 0 -1 1494 -5.9379130601882935e-02 + + 6.8840432167053223e-01 -2.0780999213457108e-02 + <_> + + 0 -1 1495 6.8976037204265594e-02 + + 8.5678137838840485e-03 -6.9098550081253052e-01 + <_> + + 0 -1 1496 -4.3954830616712570e-03 + + -1.7382889986038208e-01 6.9105990231037140e-02 + <_> + + 0 -1 1497 1.3838030397891998e-02 + + -2.9398119077086449e-02 1.9685789942741394e-01 + <_> + + 0 -1 1498 -7.5316978618502617e-03 + + -3.5790848731994629e-01 3.9685450494289398e-02 + <_> + + 0 -1 1499 -8.8299706578254700e-02 + + -2.3770420253276825e-01 3.0232321005314589e-03 + <_> + + 0 -1 1500 -4.4138759374618530e-02 + + 2.6541408896446228e-01 -5.1865179091691971e-02 + <_> + 107 + -5.6881058216094971e-01 + + <_> + + 0 -1 1501 -9.2582583427429199e-02 + + 3.6183288693428040e-01 -7.8275963664054871e-02 + <_> + + 0 -1 1502 -4.8143980093300343e-03 + + -1.2681719660758972e-01 6.7723788321018219e-02 + <_> + + 0 -1 1503 3.2365128397941589e-02 + + -4.6087108552455902e-02 3.2692021131515503e-01 + <_> + + 0 -1 1504 -1.7028570175170898e-02 + + 9.1306403279304504e-02 -1.1660590022802353e-01 + <_> + + 0 -1 1505 -1.1308620125055313e-01 + + -7.9631358385086060e-01 5.8426991105079651e-02 + <_> + + 0 -1 1506 -3.5633759107440710e-03 + + -8.2610622048377991e-02 1.0166700184345245e-01 + <_> + + 0 -1 1507 -2.4109560251235962e-01 + + 2.7927228808403015e-01 -8.0744966864585876e-02 + <_> + + 0 -1 1508 2.2599289193749428e-02 + + 5.1744598895311356e-02 -2.8865408897399902e-01 + <_> + + 0 -1 1509 2.0002270117402077e-02 + + -5.7962361723184586e-02 2.9044789075851440e-01 + <_> + + 0 -1 1510 -1.9348099594935775e-03 + + 9.8808683454990387e-02 -1.2368459999561310e-01 + <_> + + 0 -1 1511 -7.5757717713713646e-03 + + -2.0071910321712494e-01 9.2741288244724274e-02 + <_> + + 0 -1 1512 3.3381819725036621e-02 + + -3.4530758857727051e-02 3.0876499414443970e-01 + <_> + + 0 -1 1513 4.7418981790542603e-02 + + -1.3563269376754761e-01 1.1016750335693359e-01 + <_> + + 0 -1 1514 -5.4173129610717297e-03 + + -1.6050089895725250e-01 7.2612293064594269e-02 + <_> + + 0 -1 1515 -9.6942558884620667e-03 + + -1.6376489400863647e-01 8.4426470100879669e-02 + <_> + + 0 -1 1516 -6.0632169246673584e-02 + + 1.6474419832229614e-01 -2.6981400325894356e-02 + <_> + + 0 -1 1517 5.0302860327064991e-03 + + -1.0996829718351364e-01 1.3480730354785919e-01 + <_> + + 0 -1 1518 -8.7792202830314636e-02 + + -6.8317967653274536e-01 1.0834610089659691e-02 + <_> + + 0 -1 1519 3.0390409752726555e-02 + + -4.2450569570064545e-02 3.0770599842071533e-01 + <_> + + 0 -1 1520 -5.1566340029239655e-02 + + -6.2840008735656738e-01 9.7069833427667618e-03 + <_> + + 0 -1 1521 -4.2446999577805400e-04 + + 8.4595613181591034e-02 -1.8075129389762878e-01 + <_> + + 0 -1 1522 -1.2135359644889832e-01 + + -1.2717489898204803e-01 9.6575058996677399e-02 + <_> + + 0 -1 1523 -1.5150560066103935e-02 + + 9.3037553131580353e-02 -1.3127900660037994e-01 + <_> + + 0 -1 1524 3.9446409791707993e-02 + + 2.5543639436364174e-02 -1.1460640281438828e-01 + <_> + + 0 -1 1525 -8.2465475425124168e-03 + + 2.4008710682392120e-01 -5.1680248230695724e-02 + <_> + + 0 -1 1526 3.5262361168861389e-02 + + -3.3555049449205399e-02 2.0575499534606934e-01 + <_> + + 0 -1 1527 1.1703060008585453e-02 + + 2.3529250174760818e-02 -4.9983900785446167e-01 + <_> + + 0 -1 1528 4.2969968169927597e-02 + + -1.2683330103754997e-02 5.4043388366699219e-01 + <_> + + 0 -1 1529 -1.5811799094080925e-02 + + 3.9564150571823120e-01 -3.5568390041589737e-02 + <_> + + 0 -1 1530 4.6253358013927937e-03 + + 5.2370540797710419e-02 -2.2989930212497711e-01 + <_> + + 0 -1 1531 -1.5898230485618114e-03 + + 1.3792009651660919e-01 -8.6783193051815033e-02 + <_> + + 0 -1 1532 6.2329089269042015e-04 + + -8.6643829941749573e-02 5.7710029184818268e-02 + <_> + + 0 -1 1533 7.0994929410517216e-03 + + 7.5797617435455322e-02 -1.6898870468139648e-01 + <_> + + 0 -1 1534 6.9608777761459351e-02 + + -1.2454699724912643e-02 2.0845200121402740e-01 + <_> + + 0 -1 1535 -1.8759520724415779e-02 + + -5.5008620023727417e-01 2.1040279418230057e-02 + <_> + + 0 -1 1536 4.6513788402080536e-02 + + -2.5904009118676186e-02 1.8322019279003143e-01 + <_> + + 0 -1 1537 2.1638579666614532e-02 + + -3.8873910903930664e-02 2.9919698834419250e-01 + <_> + + 0 -1 1538 -7.6772570610046387e-02 + + -1. 3.9020550902932882e-03 + <_> + + 0 -1 1539 4.0535528212785721e-02 + + 1.8880680203437805e-02 -6.6033887863159180e-01 + <_> + + 0 -1 1540 4.0338758379220963e-02 + + 9.2877401039004326e-03 -3.4422031044960022e-01 + <_> + + 0 -1 1541 4.3404240161180496e-02 + + -2.2111779078841209e-02 5.1227712631225586e-01 + <_> + + 0 -1 1542 1.6895130276679993e-02 + + 3.0058480799198151e-02 -1.8648600578308105e-01 + <_> + + 0 -1 1543 3.0269259586930275e-03 + + -1.3979099690914154e-01 8.7544560432434082e-02 + <_> + + 0 -1 1544 -3.7171840667724609e-01 + + -2.9676678776741028e-01 1.6241550445556641e-02 + <_> + + 0 -1 1545 -2.5798739865422249e-02 + + -4.3713501095771790e-01 2.6768149808049202e-02 + <_> + + 0 -1 1546 -9.0826600790023804e-03 + + 9.9548496305942535e-02 -3.8500539958477020e-02 + <_> + + 0 -1 1547 -1.7977179959416389e-03 + + 1.3810199499130249e-01 -7.5387232005596161e-02 + <_> + + 0 -1 1548 1.2435699999332428e-01 + + 4.6064029447734356e-03 -3.6909800767898560e-01 + <_> + + 0 -1 1549 -1.2901489622890949e-02 + + -2.0433300733566284e-01 5.3133610635995865e-02 + <_> + + 0 -1 1550 -1.3352099806070328e-02 + + -1.0512170195579529e-01 5.9746239334344864e-02 + <_> + + 0 -1 1551 -3.0650520697236061e-02 + + 3.4366500377655029e-01 -3.9617810398340225e-02 + <_> + + 0 -1 1552 2.0778391044586897e-03 + + -5.0755288451910019e-02 7.2930753231048584e-02 + <_> + + 0 -1 1553 -6.1161179095506668e-02 + + 7.8371667861938477e-01 -1.3940130360424519e-02 + <_> + + 0 -1 1554 -6.6681973636150360e-02 + + -6.7010307312011719e-01 4.2770858854055405e-03 + <_> + + 0 -1 1555 2.7359850704669952e-02 + + 2.4253180250525475e-02 -4.2671859264373779e-01 + <_> + + 0 -1 1556 -2.4731201119720936e-03 + + 9.6493236720561981e-02 -5.7433839887380600e-02 + <_> + + 0 -1 1557 -1.0721489787101746e-02 + + -2.1575610339641571e-01 4.4256970286369324e-02 + <_> + + 0 -1 1558 -1.3936980068683624e-01 + + -3.6377531290054321e-01 1.0005139745771885e-02 + <_> + + 0 -1 1559 -5.6867711246013641e-02 + + 3.0327269434928894e-01 -3.7230789661407471e-02 + <_> + + 0 -1 1560 -6.5776512026786804e-02 + + -1. 1.2443619780242443e-03 + <_> + + 0 -1 1561 -1.5500129666179419e-03 + + 1.2898580729961395e-01 -8.5528247058391571e-02 + <_> + + 0 -1 1562 8.7909551803022623e-04 + + -7.9906381666660309e-02 1.2847130000591278e-01 + <_> + + 0 -1 1563 2.9614660888910294e-03 + + 8.9433841407299042e-02 -1.7047980427742004e-01 + <_> + + 0 -1 1564 -5.0735038518905640e-01 + + -8.4197628498077393e-01 2.3592109791934490e-03 + <_> + + 0 -1 1565 3.5409200936555862e-02 + + 1.7137490212917328e-02 -5.9052079916000366e-01 + <_> + + 0 -1 1566 -4.6220239251852036e-02 + + 4.7383689880371094e-01 -1.1423089541494846e-02 + <_> + + 0 -1 1567 4.0875099599361420e-02 + + -2.6714079082012177e-02 4.2139878869056702e-01 + <_> + + 0 -1 1568 -5.7651810348033905e-02 + + 5.6021291017532349e-01 -9.5757292583584785e-03 + <_> + + 0 -1 1569 3.3733060117810965e-03 + + 7.2323620319366455e-02 -1.5510480105876923e-01 + <_> + + 0 -1 1570 -3.4096160531044006e-01 + + -1. -3.1605950789526105e-04 + <_> + + 0 -1 1571 -5.5850511416792870e-03 + + -1.5768070518970490e-01 7.3625743389129639e-02 + <_> + + 0 -1 1572 -1.1067239940166473e-01 + + 2.3640440404415131e-01 -1.2670779600739479e-02 + <_> + + 0 -1 1573 4.3246410787105560e-02 + + -4.9346420913934708e-02 3.0113101005554199e-01 + <_> + + 0 -1 1574 -5.8916499838232994e-03 + + -1.4727650582790375e-01 6.1345700174570084e-02 + <_> + + 0 -1 1575 -2.8674090572167188e-05 + + 1.1539240181446075e-01 -1.4692650735378265e-01 + <_> + + 0 -1 1576 2.6174910366535187e-02 + + -2.2960580885410309e-02 2.1004410088062286e-01 + <_> + + 0 -1 1577 -1.9902619533240795e-03 + + 9.7250632941722870e-02 -1.3244929909706116e-01 + <_> + + 0 -1 1578 -1.6960840672254562e-02 + + -3.1949061155319214e-01 3.6188289523124695e-02 + <_> + + 0 -1 1579 -1.5634739398956299e-01 + + 3.1934529542922974e-01 -4.1917070746421814e-02 + <_> + + 0 -1 1580 -2.3863950371742249e-01 + + 3.8183578848838806e-01 -8.6567532271146774e-03 + <_> + + 0 -1 1581 -7.7641502022743225e-02 + + -3.3156651258468628e-01 3.3491149544715881e-02 + <_> + + 0 -1 1582 -4.5257899910211563e-02 + + 4.6058529615402222e-01 -3.1354859471321106e-02 + <_> + + 0 -1 1583 -3.3390790224075317e-02 + + -7.2974747419357300e-01 1.6206990927457809e-02 + <_> + + 0 -1 1584 7.3079466819763184e-02 + + -1.9201450049877167e-02 3.4011909365653992e-01 + <_> + + 0 -1 1585 -5.4536230862140656e-02 + + 3.3227160573005676e-01 -3.3163428306579590e-02 + <_> + + 0 -1 1586 3.9552688598632812e-02 + + 1.1817559599876404e-02 -3.2131719589233398e-01 + <_> + + 0 -1 1587 5.9160130331292748e-04 + + -1.1766350269317627e-01 8.8002361357212067e-02 + <_> + + 0 -1 1588 3.5379730165004730e-02 + + 1.8286190927028656e-02 -1.6206890344619751e-01 + <_> + + 0 -1 1589 2.0152490586042404e-02 + + 2.2825939580798149e-02 -4.3034788966178894e-01 + <_> + + 0 -1 1590 -2.9185289517045021e-02 + + 1.8256959319114685e-01 -1.6376309096813202e-02 + <_> + + 0 -1 1591 -2.1705780178308487e-02 + + -6.6977721452713013e-01 1.6782360151410103e-02 + <_> + + 0 -1 1592 4.2584270238876343e-02 + + -1.6852499917149544e-02 3.4360399842262268e-01 + <_> + + 0 -1 1593 -1.2663739919662476e-01 + + 2.6748588681221008e-01 -3.6107789725065231e-02 + <_> + + 0 -1 1594 1.4260070025920868e-01 + + 1.4445270411670208e-02 -1.9729509949684143e-01 + <_> + + 0 -1 1595 5.3560931235551834e-02 + + 1.7324799671769142e-02 -5.9609222412109375e-01 + <_> + + 0 -1 1596 -5.9380959719419479e-03 + + -6.5156273543834686e-02 5.9645600616931915e-02 + <_> + + 0 -1 1597 -6.6497321240603924e-03 + + 1.4270019531250000e-01 -7.9669818282127380e-02 + <_> + + 0 -1 1598 -3.0137640424072742e-03 + + 1.3996289670467377e-01 -9.4831757247447968e-02 + <_> + + 0 -1 1599 -1.7213050276041031e-02 + + -1.7265740036964417e-01 6.9451652467250824e-02 + <_> + + 0 -1 1600 1.0775709897279739e-01 + + -4.6757548116147518e-03 9.2161870002746582e-01 + <_> + + 0 -1 1601 5.8738540858030319e-02 + + -4.2458981275558472e-02 2.8832349181175232e-01 + <_> + + 0 -1 1602 -3.0475479364395142e-01 + + -1. 2.6918480216409080e-05 + <_> + + 0 -1 1603 2.0395779609680176e-01 + + 2.5317989289760590e-02 -5.0275158882141113e-01 + <_> + + 0 -1 1604 -9.7794281318783760e-03 + + -1.9060879945755005e-01 3.0577139928936958e-02 + <_> + + 0 -1 1605 -2.2775499150156975e-02 + + 2.7048370242118835e-01 -5.1001209765672684e-02 + <_> + + 0 -1 1606 9.8080374300479889e-03 + + 2.4180250242352486e-02 -7.5000837445259094e-02 + <_> + + 0 -1 1607 -1.1130969971418381e-02 + + -2.3825749754905701e-01 6.4388722181320190e-02 + <_> + 123 + -6.5824240446090698e-01 + + <_> + + 0 -1 1608 -2.1380689740180969e-01 + + 2.7686640620231628e-01 -9.2777818441390991e-02 + <_> + + 0 -1 1609 -3.3374479971826077e-03 + + 1.4119230210781097e-01 -5.1907159388065338e-02 + <_> + + 0 -1 1610 -2.8738550841808319e-02 + + -3.6243250966072083e-01 3.1938020139932632e-02 + <_> + + 0 -1 1611 -3.5554158966988325e-03 + + 1.1969120055437088e-01 -5.2306748926639557e-02 + <_> + + 0 -1 1612 -1.0732459835708141e-02 + + 2.8602668642997742e-01 -6.0555059462785721e-02 + <_> + + 0 -1 1613 8.7310239672660828e-02 + + -3.3613391220569611e-02 4.7786781191825867e-01 + <_> + + 0 -1 1614 2.1971999667584896e-03 + + 6.0207970440387726e-02 -2.1543750166893005e-01 + <_> + + 0 -1 1615 -7.4302748544141650e-05 + + 1.4141289889812469e-01 -1.2711560726165771e-01 + <_> + + 0 -1 1616 -2.9314011335372925e-01 + + -5.5598288774490356e-01 7.8105749562382698e-03 + <_> + + 0 -1 1617 7.7996537089347839e-02 + + -2.0238140597939491e-02 2.2233769297599792e-01 + <_> + + 0 -1 1618 4.9733570776879787e-03 + + -1.5410329401493073e-01 9.8874516785144806e-02 + <_> + + 0 -1 1619 -6.2232650816440582e-02 + + -2.5253909826278687e-01 2.5864329189062119e-02 + <_> + + 0 -1 1620 -7.4750548228621483e-03 + + -1.9071790575981140e-01 8.4528200328350067e-02 + <_> + + 0 -1 1621 2.2246010601520538e-02 + + -3.1024629250168800e-02 1.5289239585399628e-01 + <_> + + 0 -1 1622 -1.2305259704589844e-02 + + 1.1693249642848969e-01 -1.1092559993267059e-01 + <_> + + 0 -1 1623 -1.3985290424898267e-03 + + -2.0435670018196106e-01 8.7592259049415588e-02 + <_> + + 0 -1 1624 3.6361250281333923e-01 + + -1.8750319257378578e-02 8.5054528713226318e-01 + <_> + + 0 -1 1625 -3.8815739098936319e-03 + + 8.0643877387046814e-02 -1.0520999878644943e-01 + <_> + + 0 -1 1626 -5.2500631660223007e-02 + + 3.8002520799636841e-01 -3.6049079149961472e-02 + <_> + + 0 -1 1627 -7.9602311598137021e-04 + + 3.3794969320297241e-02 -7.5603879988193512e-02 + <_> + + 0 -1 1628 -2.0066089928150177e-02 + + -4.3842989206314087e-01 3.3389199525117874e-02 + <_> + + 0 -1 1629 -2.4233239237219095e-03 + + -9.3005247414112091e-02 4.9772828817367554e-02 + <_> + + 0 -1 1630 -6.8737422116100788e-03 + + 2.0374830067157745e-01 -5.8165848255157471e-02 + <_> + + 0 -1 1631 6.5535600297152996e-03 + + -7.0293396711349487e-02 1.4400149881839752e-01 + <_> + + 0 -1 1632 -1.6780680045485497e-02 + + -3.2226520776748657e-01 4.3717250227928162e-02 + <_> + + 0 -1 1633 2.5448070839047432e-02 + + 4.3461918830871582e-02 -1.5376989543437958e-01 + <_> + + 0 -1 1634 3.4656568896025419e-03 + + -6.3119992613792419e-02 2.1394529938697815e-01 + <_> + + 0 -1 1635 1.0132250189781189e-01 + + -1.7095830291509628e-02 1.8853299319744110e-01 + <_> + + 0 -1 1636 1.0714309662580490e-01 + + 3.5406891256570816e-02 -3.4869039058685303e-01 + <_> + + 0 -1 1637 -1.4500999823212624e-02 + + 3.7903580814599991e-02 -4.9169208854436874e-02 + <_> + + 0 -1 1638 -1.5354759991168976e-01 + + 3.5048320889472961e-01 -3.2774008810520172e-02 + <_> + + 0 -1 1639 -6.5137587487697601e-02 + + -4.1380020976066589e-01 7.3137627914547920e-03 + <_> + + 0 -1 1640 -2.9204839374870062e-03 + + -1.3756680488586426e-01 9.0795390307903290e-02 + <_> + + 0 -1 1641 -3.4104570746421814e-01 + + -6.7252027988433838e-01 1.5200230292975903e-02 + <_> + + 0 -1 1642 -4.4478259951574728e-05 + + 9.6579946577548981e-02 -1.0403420031070709e-01 + <_> + + 0 -1 1643 -1.1172229796648026e-01 + + -4.2234420776367188e-01 4.9457307904958725e-03 + <_> + + 0 -1 1644 2.0429869182407856e-03 + + 9.9474698305130005e-02 -1.0384540259838104e-01 + <_> + + 0 -1 1645 -7.2571309283375740e-03 + + -1.5049630403518677e-01 2.9724840074777603e-02 + <_> + + 0 -1 1646 -8.4451176226139069e-03 + + 9.5648579299449921e-02 -1.1805369704961777e-01 + <_> + + 0 -1 1647 -3.0194969847798347e-02 + + 4.6570628881454468e-01 -1.4386899769306183e-02 + <_> + + 0 -1 1648 5.7423918042331934e-04 + + -1.0382310301065445e-01 1.5052829682826996e-01 + <_> + + 0 -1 1649 8.2014611689373851e-04 + + -7.5132526457309723e-02 1.0363759845495224e-01 + <_> + + 0 -1 1650 7.0748180150985718e-03 + + 6.6062167286872864e-02 -1.7638419568538666e-01 + <_> + + 0 -1 1651 4.8304669559001923e-02 + + -1.7767660319805145e-02 2.6820158958435059e-01 + <_> + + 0 -1 1652 7.9041812568902969e-03 + + 5.1522739231586456e-02 -2.0632369816303253e-01 + <_> + + 0 -1 1653 8.4705486893653870e-02 + + 7.2250380180776119e-03 -5.9514737129211426e-01 + <_> + + 0 -1 1654 3.9120440487749875e-04 + + -1.0663530230522156e-01 1.1103810369968414e-01 + <_> + + 0 -1 1655 1.5959320589900017e-02 + + -4.8573691397905350e-02 2.5832009315490723e-01 + <_> + + 0 -1 1656 -1.8649259582161903e-03 + + 1.1551269888877869e-01 -1.5048590302467346e-01 + <_> + + 0 -1 1657 1.2727979570627213e-02 + + 4.7930240631103516e-02 -3.0310231447219849e-01 + <_> + + 0 -1 1658 -1.5954229747876525e-03 + + -1.5537570416927338e-01 8.3214886486530304e-02 + <_> + + 0 -1 1659 2.0234890282154083e-01 + + 1.1625860352069139e-03 -1.0000209808349609e+00 + <_> + + 0 -1 1660 -3.9196871221065521e-02 + + 3.0884549021720886e-01 -4.4524021446704865e-02 + <_> + + 0 -1 1661 1.5810640528798103e-02 + + -1.5927329659461975e-02 1.0144449770450592e-01 + <_> + + 0 -1 1662 -2.1568681113421917e-03 + + 9.5205381512641907e-02 -1.2910960614681244e-01 + <_> + + 0 -1 1663 -3.4604359418153763e-02 + + 2.7843558788299561e-01 -1.0775060392916203e-02 + <_> + + 0 -1 1664 -2.6206790935248137e-03 + + -1.3744530081748962e-01 9.2945456504821777e-02 + <_> + + 0 -1 1665 4.6692821197211742e-03 + + -5.8331821113824844e-02 1.5733839571475983e-01 + <_> + + 0 -1 1666 7.8623533248901367e-02 + + 1.1130830273032188e-02 -9.7138148546218872e-01 + <_> + + 0 -1 1667 3.9556730538606644e-02 + + 2.1708509884774685e-03 -4.3425449728965759e-01 + <_> + + 0 -1 1668 4.0571438148617744e-03 + + 8.6120717227458954e-02 -1.5579399466514587e-01 + <_> + + 0 -1 1669 -1.5014669857919216e-02 + + 1.3523979485034943e-01 -2.5724019855260849e-02 + <_> + + 0 -1 1670 4.6183250378817320e-04 + + -1.0766889899969101e-01 1.3633869588375092e-01 + <_> + + 0 -1 1671 5.2875209599733353e-02 + + 5.4555749520659447e-03 -3.9382910728454590e-01 + <_> + + 0 -1 1672 -5.9510860592126846e-02 + + 2.8690820932388306e-01 -4.2876079678535461e-02 + <_> + + 0 -1 1673 1.6650360077619553e-02 + + 2.8605299070477486e-02 -3.0349490046501160e-01 + <_> + + 0 -1 1674 1.4959629625082016e-02 + + -5.2699029445648193e-02 2.1825259923934937e-01 + <_> + + 0 -1 1675 -9.6224267035722733e-03 + + -2.1431450545787811e-01 4.8350628465414047e-02 + <_> + + 0 -1 1676 -4.5304261147975922e-02 + + -8.7308478355407715e-01 1.2449770234525204e-02 + <_> + + 0 -1 1677 -7.4465242214500904e-03 + + -1.3586209714412689e-01 3.3087320625782013e-02 + <_> + + 0 -1 1678 -1.1953880311921239e-03 + + 1.4848570525646210e-01 -8.5291646420955658e-02 + <_> + + 0 -1 1679 5.6622507981956005e-03 + + -5.3212448954582214e-02 1.2967950105667114e-01 + <_> + + 0 -1 1680 1.3971360400319099e-02 + + 2.5338830426335335e-02 -4.2097410559654236e-01 + <_> + + 0 -1 1681 -4.5216218568384647e-03 + + 1.2621529400348663e-01 -6.3135430216789246e-02 + <_> + + 0 -1 1682 4.7776158899068832e-03 + + -6.2899917364120483e-02 1.7724449932575226e-01 + <_> + + 0 -1 1683 -5.8305878192186356e-03 + + 8.7906002998352051e-02 -1.5553380548954010e-01 + <_> + + 0 -1 1684 -1.5879280865192413e-02 + + -1.2694430351257324e-01 1.0280299931764603e-01 + <_> + + 0 -1 1685 1.9526369869709015e-03 + + -7.6803453266620636e-02 4.7297749668359756e-02 + <_> + + 0 -1 1686 2.4521650746464729e-02 + + -2.7714680880308151e-02 4.0350469946861267e-01 + <_> + + 0 -1 1687 -8.4529399871826172e-02 + + 1. -2.1367999725043774e-03 + <_> + + 0 -1 1688 1.6844070050865412e-03 + + 7.4043400585651398e-02 -1.6334819793701172e-01 + <_> + + 0 -1 1689 1.3399059884250164e-02 + + -4.2453180998563766e-02 2.4164129793643951e-01 + <_> + + 0 -1 1690 4.4182639569044113e-02 + + 1.8039569258689880e-02 -6.4396840333938599e-01 + <_> + + 0 -1 1691 3.8327239453792572e-02 + + 7.5849238783121109e-03 -3.6534211039543152e-01 + <_> + + 0 -1 1692 2.5997089687734842e-03 + + -8.8553480803966522e-02 1.3763660192489624e-01 + <_> + + 0 -1 1693 1.0775480419397354e-02 + + 4.5753169804811478e-02 -1.1956000328063965e-01 + <_> + + 0 -1 1694 -2.0433649420738220e-02 + + 2.2020170092582703e-01 -5.1925841718912125e-02 + <_> + + 0 -1 1695 -1.2402729690074921e-01 + + 8.8846582174301147e-01 -5.1234480924904346e-03 + <_> + + 0 -1 1696 4.7838478349149227e-03 + + 5.3047031164169312e-02 -2.1085900068283081e-01 + <_> + + 0 -1 1697 -4.5895349234342575e-02 + + 4.4482690095901489e-01 -1.5117119997739792e-02 + <_> + + 0 -1 1698 1.4473790302872658e-02 + + -4.5201409608125687e-02 2.3556250333786011e-01 + <_> + + 0 -1 1699 1.8887920305132866e-03 + + 7.6443381607532501e-02 -1.6385370492935181e-01 + <_> + + 0 -1 1700 -1.9082069396972656e-01 + + 6.4662021398544312e-01 -1.8242619931697845e-02 + <_> + + 0 -1 1701 7.2158463299274445e-02 + + 6.2836478464305401e-03 -7.4822348356246948e-01 + <_> + + 0 -1 1702 9.7802944947034121e-04 + + 7.9063102602958679e-02 -1.3163650035858154e-01 + <_> + + 0 -1 1703 4.8602250171825290e-04 + + -4.2594909667968750e-02 6.9462761282920837e-02 + <_> + + 0 -1 1704 -1.0882800444960594e-02 + + -2.4503070116043091e-01 5.2326161414384842e-02 + <_> + + 0 -1 1705 1.1573769734241068e-04 + + -6.6729307174682617e-02 8.7088912725448608e-02 + <_> + + 0 -1 1706 2.0960739348083735e-03 + + -7.6154567301273346e-02 1.3598169386386871e-01 + <_> + + 0 -1 1707 4.3664351105690002e-02 + + 8.4812156856060028e-03 -8.1097167730331421e-01 + <_> + + 0 -1 1708 -1.1464370181784034e-03 + + 1.2721230089664459e-01 -8.4783419966697693e-02 + <_> + + 0 -1 1709 -5.5613541044294834e-03 + + -1.9722530245780945e-01 5.4411068558692932e-02 + <_> + + 0 -1 1710 3.4083850681781769e-02 + + -3.2338548451662064e-02 3.4062281250953674e-01 + <_> + + 0 -1 1711 5.1227081567049026e-02 + + -1.3262039981782436e-02 2.3953630030155182e-01 + <_> + + 0 -1 1712 3.3531729131937027e-02 + + 2.0279919728636742e-02 -4.8339051008224487e-01 + <_> + + 0 -1 1713 1.5396219678223133e-02 + + -2.9320189729332924e-02 1.5866099298000336e-01 + <_> + + 0 -1 1714 -1.7550770193338394e-02 + + 2.7488970756530762e-01 -3.7798319011926651e-02 + <_> + + 0 -1 1715 -7.5705647468566895e-02 + + -8.2214397192001343e-01 3.8814740255475044e-03 + <_> + + 0 -1 1716 -5.3475350141525269e-03 + + -1.6710759699344635e-01 7.7180616557598114e-02 + <_> + + 0 -1 1717 -3.3435279037803411e-03 + + -1.0673490166664124e-01 4.7575470060110092e-02 + <_> + + 0 -1 1718 1.9328270107507706e-02 + + -4.6563290059566498e-02 2.4716560542583466e-01 + <_> + + 0 -1 1719 8.5368983447551727e-02 + + 2.3296920582652092e-02 -5.0002247095108032e-01 + <_> + + 0 -1 1720 2.5927850510925055e-03 + + -1.1182250082492828e-01 1.1046089977025986e-01 + <_> + + 0 -1 1721 -9.1061238199472427e-03 + + 4.7107011079788208e-02 -5.5807661265134811e-02 + <_> + + 0 -1 1722 1.0170699656009674e-01 + + -1.5966609120368958e-02 6.9857317209243774e-01 + <_> + + 0 -1 1723 2.2854980081319809e-02 + + -1.7226219177246094e-02 1.2225689738988876e-01 + <_> + + 0 -1 1724 -1.6577079892158508e-02 + + -2.2225829958915710e-01 5.6578300893306732e-02 + <_> + + 0 -1 1725 -2.3641420528292656e-02 + + -2.7734050154685974e-01 1.6076890751719475e-02 + <_> + + 0 -1 1726 5.6385230273008347e-03 + + 4.5439280569553375e-02 -2.2549630701541901e-01 + <_> + + 0 -1 1727 5.7422029785811901e-03 + + -7.8568778932094574e-02 1.5234960615634918e-01 + <_> + + 0 -1 1728 -4.3363519944250584e-04 + + 9.5920950174331665e-02 -1.1274240165948868e-01 + <_> + + 0 -1 1729 1.0267919860780239e-02 + + -4.9332991242408752e-02 2.4810829758644104e-01 + <_> + + 0 -1 1730 1.3865719549357891e-02 + + 7.0547938346862793e-02 -1.8594330549240112e-01 + <_> + 127 + -3.0620599746704102e+01 + + <_> + + 0 -1 1731 -4.6980630606412888e-02 + + 1.7078550159931183e-01 -1.5687310695648193e-01 + <_> + + 0 -1 1732 -1.1967960000038147e-01 + + 5.1738417148590088e-01 -1.1747590266168118e-02 + <_> + + 0 -1 1733 -2.8477180749177933e-02 + + 2.3505200445652008e-01 -5.7424411177635193e-02 + <_> + + 0 -1 1734 1.9697479903697968e-01 + + -9.3123828992247581e-04 1.0037239789962769e+00 + <_> + + 0 -1 1735 7.9039083793759346e-03 + + 8.3357498049736023e-02 -1.6527499258518219e-01 + <_> + + 0 -1 1736 3.9338979870080948e-02 + + -6.5605872077867389e-04 3.2361468672752380e-01 + <_> + + 0 -1 1737 -1.5762429684400558e-03 + + 9.1129466891288757e-02 -1.4164330065250397e-01 + <_> + + 0 -1 1738 2.0851049339398742e-04 + + -1.3802680373191833e-01 7.7212989330291748e-02 + <_> + + 0 -1 1739 -2.6843539671972394e-04 + + 1.3646720349788666e-01 -9.4255752861499786e-02 + <_> + + 0 -1 1740 8.8506387546658516e-03 + + 2.4603420868515968e-02 -1.6884680092334747e-01 + <_> + + 0 -1 1741 -8.4813922876492143e-04 + + -1.3972400128841400e-01 1.1566729843616486e-01 + <_> + + 0 -1 1742 -3.7090150726726279e-05 + + 7.5284272432327271e-02 -1.7708149552345276e-01 + <_> + + 0 -1 1743 -2.1533910185098648e-02 + + 2.0233030617237091e-01 -6.6978476941585541e-02 + <_> + + 0 -1 1744 1.1713660322129726e-02 + + 8.6853489279747009e-02 -1.1251810193061829e-01 + <_> + + 0 -1 1745 -9.8365638405084610e-03 + + 3.0164790153503418e-01 -5.0179660320281982e-02 + <_> + + 0 -1 1746 -6.2104999087750912e-03 + + 6.8224228918552399e-02 -9.4441823661327362e-02 + <_> + + 0 -1 1747 -2.0034300163388252e-02 + + -2.8657549619674683e-01 4.5728500932455063e-02 + <_> + + 0 -1 1748 -2.2154829639475793e-04 + + 7.1603760123252869e-02 -8.7115049362182617e-02 + <_> + + 0 -1 1749 -5.2436119876801968e-03 + + 1.3439500331878662e-01 -9.0288907289505005e-02 + <_> + + 0 -1 1750 -1.1711229570209980e-02 + + 1.4874699711799622e-01 -2.5951780378818512e-02 + <_> + + 0 -1 1751 5.8587929233908653e-03 + + -6.6982023417949677e-02 1.8096329271793365e-01 + <_> + + 0 -1 1752 1.0432569682598114e-01 + + 1.0209330357611179e-02 -7.9540812969207764e-01 + <_> + + 0 -1 1753 -1.7049130052328110e-02 + + -2.0516310632228851e-01 6.4470991492271423e-02 + <_> + + 0 -1 1754 2.5877699255943298e-02 + + -3.0079720541834831e-02 1.6041970252990723e-01 + <_> + + 0 -1 1755 -4.0637338533997536e-03 + + 1.0870960354804993e-01 -1.1665400117635727e-01 + <_> + + 0 -1 1756 -1.9286720082163811e-02 + + -1.2503950297832489e-01 2.8055189177393913e-02 + <_> + + 0 -1 1757 -7.2130301305151079e-06 + + 1.1845260113477707e-01 -1.2367019802331924e-01 + <_> + + 0 -1 1758 -2.6098350062966347e-03 + + -1.4498670399188995e-01 8.2318760454654694e-02 + <_> + + 0 -1 1759 3.2303779153153300e-04 + + -9.5855496823787689e-02 1.1992660164833069e-01 + <_> + + 0 -1 1760 -1.1308960383757949e-03 + + 1.2882959842681885e-01 -8.2697473466396332e-02 + <_> + + 0 -1 1761 1.7176469787955284e-02 + + 3.6024659872055054e-02 -3.0873811244964600e-01 + <_> + + 0 -1 1762 -1.0515330359339714e-02 + + 9.6330337226390839e-02 -1.0785780102014542e-01 + <_> + + 0 -1 1763 5.0583500415086746e-02 + + -3.4715801477432251e-02 4.5134508609771729e-01 + <_> + + 0 -1 1764 8.7582931155338883e-04 + + -9.5677152276039124e-02 7.3631688952445984e-02 + <_> + + 0 -1 1765 -3.1957220286130905e-02 + + -3.1473490595817566e-01 3.6329280585050583e-02 + <_> + + 0 -1 1766 5.9863331262022257e-04 + + -4.2676690965890884e-02 5.4342899471521378e-02 + <_> + + 0 -1 1767 -6.6270949319005013e-03 + + 7.3510922491550446e-02 -1.7309080064296722e-01 + <_> + + 0 -1 1768 -7.3186516761779785e-02 + + 6.8777692317962646e-01 -5.6781149469316006e-03 + <_> + + 0 -1 1769 2.0290840417146683e-02 + + -4.0720541030168533e-02 3.0450868606567383e-01 + <_> + + 0 -1 1770 -3.0989840161055326e-03 + + -1.2787370383739471e-01 5.4329689592123032e-02 + <_> + + 0 -1 1771 -1.1258859885856509e-03 + + 1.1980079859495163e-01 -8.3477236330509186e-02 + <_> + + 0 -1 1772 3.9993048994801939e-04 + + -9.5427073538303375e-02 7.6952911913394928e-02 + <_> + + 0 -1 1773 1.1202540248632431e-02 + + 2.5125309824943542e-02 -4.0314701199531555e-01 + <_> + + 0 -1 1774 -2.1753970533609390e-02 + + -2.3042400181293488e-01 1.5338519588112831e-02 + <_> + + 0 -1 1775 7.6912459917366505e-05 + + -9.5581486821174622e-02 1.0388170182704926e-01 + <_> + + 0 -1 1776 9.1011539101600647e-02 + + -8.7168300524353981e-03 7.5593751668930054e-01 + <_> + + 0 -1 1777 -4.3160789646208286e-03 + + 1.3494439423084259e-01 -7.0152096450328827e-02 + <_> + + 0 -1 1778 -5.0581190735101700e-02 + + -6.6112691164016724e-01 2.2676400840282440e-03 + <_> + + 0 -1 1779 -8.3926003426313400e-03 + + -1.2883609533309937e-01 7.7920481562614441e-02 + <_> + + 0 -1 1780 5.5040661245584488e-02 + + 7.7853789553046227e-03 -2.7820050716400146e-01 + <_> + + 0 -1 1781 -4.1862551122903824e-02 + + 4.3335449695587158e-01 -2.9194639995694160e-02 + <_> + + 0 -1 1782 -7.4230520986020565e-03 + + 1.3154500722885132e-01 -3.2047510147094727e-02 + <_> + + 0 -1 1783 1.9948489498347044e-03 + + 8.3299688994884491e-02 -1.1662559956312180e-01 + <_> + + 0 -1 1784 4.1851431131362915e-02 + + 4.1461169719696045e-02 -1.2815159559249878e-01 + <_> + + 0 -1 1785 2.7844381332397461e-01 + + -2.2612810134887695e-02 5.2236318588256836e-01 + <_> + + 0 -1 1786 -7.1095931343734264e-03 + + 1.2902510166168213e-01 -2.7944799512624741e-02 + <_> + + 0 -1 1787 1.1175610125064850e-02 + + 5.1366660743951797e-02 -1.9559539854526520e-01 + <_> + + 0 -1 1788 -1.0364210233092308e-02 + + -7.2631381452083588e-02 1.5199509263038635e-01 + <_> + + 0 -1 1789 -9.4094304367899895e-03 + + -2.0993369817733765e-01 5.3346861153841019e-02 + <_> + + 0 -1 1790 -1.0375010222196579e-01 + + -3.3693191409111023e-01 3.9442018605768681e-03 + <_> + + 0 -1 1791 -9.5977628370746970e-04 + + 1.0307610034942627e-01 -1.0574100166559219e-01 + <_> + + 0 -1 1792 -5.5816810578107834e-02 + + 2.6074001193046570e-01 -4.4885180890560150e-02 + <_> + + 0 -1 1793 -1.3430939614772797e-01 + + -8.1660747528076172e-01 1.5410860069096088e-02 + <_> + + 0 -1 1794 6.0456950217485428e-02 + + -3.0265029054135084e-03 -9.9991780519485474e-01 + <_> + + 0 -1 1795 2.4359079077839851e-02 + + 2.4191310629248619e-02 -4.6632158756256104e-01 + <_> + + 0 -1 1796 5.2735779434442520e-02 + + -2.4266760796308517e-02 2.1460479497909546e-01 + <_> + + 0 -1 1797 -5.5626039393246174e-03 + + 1.0879939794540405e-01 -1.2120909988880157e-01 + <_> + + 0 -1 1798 9.0855263173580170e-02 + + 1.0956900223391131e-04 -9.9975770711898804e-01 + <_> + + 0 -1 1799 -3.4681189805269241e-02 + + -4.5409980416297913e-01 2.3691149428486824e-02 + <_> + + 0 -1 1800 -2.9579090551123954e-05 + + 4.8031318932771683e-02 -4.9872968345880508e-02 + <_> + + 0 -1 1801 2.6277130469679832e-02 + + -2.9456760734319687e-02 3.3974370360374451e-01 + <_> + + 0 -1 1802 -4.6276021748781204e-02 + + 4.5496609807014465e-01 -1.0359579697251320e-02 + <_> + + 0 -1 1803 1.2048200005665421e-04 + + -1.0575199872255325e-01 1.0096730291843414e-01 + <_> + + 0 -1 1804 6.8154390901327133e-03 + + 2.8495609760284424e-02 -9.9765069782733917e-02 + <_> + + 0 -1 1805 1.6169620212167501e-03 + + -1.3256169855594635e-01 8.7828978896141052e-02 + <_> + + 0 -1 1806 1.4563379809260368e-02 + + -4.3079901486635208e-02 2.5113260746002197e-01 + <_> + + 0 -1 1807 2.0352909341454506e-02 + + 3.9463639259338379e-02 -3.2518970966339111e-01 + <_> + + 0 -1 1808 -2.0789269357919693e-02 + + 1.8993359804153442e-01 -2.1271999925374985e-02 + <_> + + 0 -1 1809 3.1780101358890533e-02 + + -2.3768220096826553e-02 4.3957829475402832e-01 + <_> + + 0 -1 1810 1.2459229677915573e-01 + + 6.5275398083031178e-03 -9.9991798400878906e-01 + <_> + + 0 -1 1811 -8.4007039666175842e-02 + + -3.5620281100273132e-01 2.8916560113430023e-02 + <_> + + 0 -1 1812 9.6772145479917526e-03 + + 6.4073942601680756e-02 -1.5482710301876068e-01 + <_> + + 0 -1 1813 1.0405039787292480e-01 + + -2.2652050480246544e-02 5.7623207569122314e-01 + <_> + + 0 -1 1814 4.0814410895109177e-02 + + -3.7368569523096085e-02 7.7298507094383240e-02 + <_> + + 0 -1 1815 -4.6916189789772034e-01 + + -7.7304631471633911e-01 1.3607080094516277e-02 + <_> + + 0 -1 1816 -1.3723419606685638e-01 + + -1. -1.7328710528090596e-03 + <_> + + 0 -1 1817 3.7569448351860046e-02 + + 3.1412709504365921e-02 -3.5512429475784302e-01 + <_> + + 0 -1 1818 -1.2645379640161991e-02 + + -7.1322880685329437e-02 4.1889548301696777e-02 + <_> + + 0 -1 1819 3.9933860301971436e-02 + + -3.3447001129388809e-02 3.5932940244674683e-01 + <_> + + 0 -1 1820 1.7207439988851547e-02 + + 2.6126530021429062e-02 -7.7634379267692566e-02 + <_> + + 0 -1 1821 5.9702228754758835e-02 + + -2.3717980831861496e-02 5.7321798801422119e-01 + <_> + + 0 -1 1822 7.9917803406715393e-02 + + -9.7547564655542374e-03 4.3467441201210022e-01 + <_> + + 0 -1 1823 1.1351720243692398e-01 + + -3.8921970874071121e-02 2.6120808720588684e-01 + <_> + + 0 -1 1824 4.8379451036453247e-01 + + 7.8452667221426964e-03 -6.5024161338806152e-01 + <_> + + 0 -1 1825 -1.0045070201158524e-01 + + -8.0072021484375000e-01 1.2250199913978577e-02 + <_> + + 0 -1 1826 2.7176019549369812e-01 + + 4.4636582024395466e-03 -6.9393122196197510e-01 + <_> + + 0 -1 1827 -1.2301249802112579e-01 + + 3.2483839988708496e-01 -3.3841550350189209e-02 + <_> + + 0 -1 1828 6.1188749969005585e-02 + + 7.1536018513143063e-03 -7.7817517518997192e-01 + <_> + + 0 -1 1829 -7.8828241676092148e-03 + + -1.9754239916801453e-01 6.7795433104038239e-02 + <_> + + 0 -1 1830 -2.5584879517555237e-01 + + -1. 1.4300020411610603e-03 + <_> + + 0 -1 1831 1.3098469376564026e-01 + + -1.6668310388922691e-02 7.4547207355499268e-01 + <_> + + 0 -1 1832 -8.4553077816963196e-02 + + -6.3423901796340942e-01 8.3142798393964767e-03 + <_> + + 0 -1 1833 -8.8297717273235321e-02 + + -8.5705971717834473e-01 1.0549940168857574e-02 + <_> + + 0 -1 1834 -1.0374879837036133e-01 + + 1.2073180079460144e-01 -2.2488579154014587e-02 + <_> + + 0 -1 1835 1.4872249448671937e-03 + + -1.1096440255641937e-01 1.0405410081148148e-01 + <_> + + 0 -1 1836 2.1364030241966248e-01 + + 7.3841079138219357e-03 -4.9760338664054871e-01 + <_> + + 0 -1 1837 2.6294309645891190e-02 + + -6.3212700188159943e-02 2.6284760236740112e-01 + <_> + + 0 -1 1838 -2.6777000166475773e-03 + + 5.6488350033760071e-02 -1.0174310207366943e-01 + <_> + + 0 -1 1839 -2.1261540241539478e-03 + + -1.6442880034446716e-01 6.6159963607788086e-02 + <_> + + 0 -1 1840 -8.2200914621353149e-03 + + -1.6132779419422150e-01 8.3515472710132599e-02 + <_> + + 0 -1 1841 -1.1701880022883415e-02 + + 2.1516199409961700e-01 -5.9116050601005554e-02 + <_> + + 0 -1 1842 -7.0460740244016051e-04 + + 9.6142299473285675e-02 -1.3008759915828705e-01 + <_> + + 0 -1 1843 -1.9671309273689985e-03 + + 1.2605039775371552e-01 -8.8542640209197998e-02 + <_> + + 0 -1 1844 -9.5004076138138771e-03 + + -2.3604579269886017e-01 4.5922629535198212e-02 + <_> + + 0 -1 1845 2.6802370324730873e-02 + + -4.8966769129037857e-02 2.3887130618095398e-01 + <_> + + 0 -1 1846 2.2177420556545258e-02 + + -1.2560590170323849e-02 2.7084270119667053e-01 + <_> + + 0 -1 1847 9.3382880091667175e-02 + + 3.3835850656032562e-02 -3.9707890152931213e-01 + <_> + + 0 -1 1848 -1.3151080347597599e-02 + + -1.1364260315895081e-01 2.5930739939212799e-02 + <_> + + 0 -1 1849 2.6929581072181463e-03 + + 6.8202346563339233e-02 -1.6290910542011261e-01 + <_> + + 0 -1 1850 -5.7519129477441311e-03 + + 1.3197720050811768e-01 -5.7711899280548096e-02 + <_> + + 0 -1 1851 -1.1071159970015287e-03 + + 1.4550089836120605e-01 -7.7300041913986206e-02 + <_> + + 0 -1 1852 3.1805180013179779e-02 + + 1.4181279577314854e-02 -2.1803429722785950e-01 + <_> + + 0 -1 1853 4.0729498863220215e-01 + + -1.3772940263152122e-02 7.4853348731994629e-01 + <_> + + 0 -1 1854 7.0173077285289764e-02 + + 1.1535810306668282e-02 -8.6094629764556885e-01 + <_> + + 0 -1 1855 -1.9437450100667775e-04 + + 6.3009992241859436e-02 -1.5111440420150757e-01 + <_> + + 0 -1 1856 3.9425559341907501e-02 + + 2.4115329608321190e-02 -4.7253820300102234e-01 + <_> + + 0 -1 1857 2.6128459721803665e-03 + + 5.3963150829076767e-02 -1.7429760098457336e-01 + <_> + 152 + -3.0691600799560547e+01 + + <_> + + 0 -1 1858 1.0468430072069168e-01 + + -4.7570109367370605e-02 4.2454048991203308e-01 + <_> + + 0 -1 1859 -4.2946420609951019e-02 + + 1.6328890621662140e-01 -1.2655169703066349e-02 + <_> + + 0 -1 1860 -8.1577729433774948e-03 + + 1.0235799849033356e-01 -1.0876630246639252e-01 + <_> + + 0 -1 1861 2.1813691128045321e-03 + + 8.7985247373580933e-02 -5.5899761617183685e-02 + <_> + + 0 -1 1862 -6.5157511271536350e-03 + + 8.2863852381706238e-02 -1.3736319541931152e-01 + <_> + + 0 -1 1863 2.4716500192880630e-02 + + 1.6755210235714912e-02 1.3371250033378601e-01 + <_> + + 0 -1 1864 -5.9396267170086503e-04 + + -1.3771370053291321e-01 1.0501290112733841e-01 + <_> + + 0 -1 1865 2.9373820871114731e-02 + + -4.4581398367881775e-02 4.2731860280036926e-01 + <_> + + 0 -1 1866 -1.6576919704675674e-02 + + -2.9827460646629333e-01 2.9718369245529175e-02 + <_> + + 0 -1 1867 9.4569493085145950e-03 + + 5.3616948425769806e-02 -7.6675526797771454e-02 + <_> + + 0 -1 1868 7.4581913650035858e-02 + + -4.6554408967494965e-02 3.0179610848426819e-01 + <_> + + 0 -1 1869 -3.8055621087551117e-02 + + -2.8255119919776917e-01 2.0355690270662308e-02 + <_> + + 0 -1 1870 1.1065539903938770e-02 + + -5.3942598402500153e-02 2.3132629692554474e-01 + <_> + + 0 -1 1871 1.3538219965994358e-02 + + 2.8102980926632881e-02 -2.1802890300750732e-01 + <_> + + 0 -1 1872 4.6914750710129738e-03 + + 6.3617020845413208e-02 -1.7460820078849792e-01 + <_> + + 0 -1 1873 4.3054440617561340e-01 + + -2.1062379702925682e-02 5.7197797298431396e-01 + <_> + + 0 -1 1874 1.4298999449238181e-03 + + -1.6780039668083191e-01 7.6851062476634979e-02 + <_> + + 0 -1 1875 2.7855230495333672e-02 + + -3.5647969692945480e-02 2.8956910967826843e-01 + <_> + + 0 -1 1876 1.4391670003533363e-02 + + 8.3300426602363586e-02 -1.2951320409774780e-01 + <_> + + 0 -1 1877 -7.7637381851673126e-02 + + -1. 8.1426621181890368e-04 + <_> + + 0 -1 1878 1.6051199287176132e-02 + + -5.4008588194847107e-02 2.1967799961566925e-01 + <_> + + 0 -1 1879 -7.0988729596138000e-02 + + 6.1602139472961426e-01 -1.6476400196552277e-02 + <_> + + 0 -1 1880 -5.8310989290475845e-02 + + -9.5955359935760498e-01 1.2517100200057030e-02 + <_> + + 0 -1 1881 -7.9547446221113205e-03 + + -9.3684002757072449e-02 3.3896960318088531e-02 + <_> + + 0 -1 1882 -4.9685798585414886e-02 + + 3.1466799974441528e-01 -2.9716050252318382e-02 + <_> + + 0 -1 1883 9.7751528024673462e-02 + + 7.5905729318037629e-04 -6.7009872198104858e-01 + <_> + + 0 -1 1884 7.5908802449703217e-02 + + 1.6073329374194145e-02 -6.6251361370086670e-01 + <_> + + 0 -1 1885 1.3333460083231330e-03 + + 5.2241399884223938e-02 -1.8808710575103760e-01 + <_> + + 0 -1 1886 6.9728610105812550e-04 + + -8.9044801890850067e-02 1.6642339527606964e-01 + <_> + + 0 -1 1887 2.0889509469270706e-02 + + 2.1368719637393951e-02 -1.6083440184593201e-01 + <_> + + 0 -1 1888 -1.7649700166657567e-03 + + 1.2398529797792435e-01 -8.5922397673130035e-02 + <_> + + 0 -1 1889 2.7779850643128157e-03 + + -4.4366151094436646e-02 2.9322549700737000e-02 + <_> + + 0 -1 1890 7.9974532127380371e-04 + + -1.2351520359516144e-01 8.8818296790122986e-02 + <_> + + 0 -1 1891 7.0215959567576647e-04 + + -8.0154180526733398e-02 1.4544290304183960e-01 + <_> + + 0 -1 1892 -4.0604420006275177e-02 + + -3.6047580838203430e-01 3.4314859658479691e-02 + <_> + + 0 -1 1893 -4.1686851531267166e-02 + + -2.0927760004997253e-01 8.5808392614126205e-03 + <_> + + 0 -1 1894 -4.6390198171138763e-02 + + 5.3768527507781982e-01 -2.2632500156760216e-02 + <_> + + 0 -1 1895 -1.5822030603885651e-01 + + -1. 1.4312319690361619e-03 + <_> + + 0 -1 1896 -7.5683370232582092e-02 + + -8.0503028631210327e-01 1.2843839824199677e-02 + <_> + + 0 -1 1897 -5.7808328419923782e-02 + + 3.8675680756568909e-01 -1.2630320154130459e-02 + <_> + + 0 -1 1898 -4.5112581574358046e-05 + + 7.4958987534046173e-02 -1.3433749973773956e-01 + <_> + + 0 -1 1899 3.9205480366945267e-02 + + 2.1980579942464828e-02 -4.5748621225357056e-01 + <_> + + 0 -1 1900 4.4945240020751953e-02 + + -2.3763459175825119e-02 4.8715281486511230e-01 + <_> + + 0 -1 1901 -5.7849191129207611e-02 + + 3.5563638806343079e-01 -6.2380530871450901e-03 + <_> + + 0 -1 1902 -1.0397239774465561e-01 + + -6.2262791395187378e-01 1.5022880397737026e-02 + <_> + + 0 -1 1903 -2.5238281488418579e-01 + + -5.9059482812881470e-01 -1.9238379900343716e-04 + <_> + + 0 -1 1904 1.9675880670547485e-01 + + 1.2625159695744514e-02 -7.2753208875656128e-01 + <_> + + 0 -1 1905 3.7412419915199280e-02 + + -2.3478340357542038e-02 1.2147639691829681e-01 + <_> + + 0 -1 1906 -8.0470675602555275e-03 + + -1.8167789280414581e-01 4.9743499606847763e-02 + <_> + + 0 -1 1907 4.1297491639852524e-02 + + 1.0259049944579601e-02 -1.4679500460624695e-01 + <_> + + 0 -1 1908 -5.0735730677843094e-02 + + 2.2679640352725983e-01 -4.9807049334049225e-02 + <_> + + 0 -1 1909 -3.6145109334029257e-04 + + 4.1798278689384460e-02 -7.0410832762718201e-02 + <_> + + 0 -1 1910 -1.2359450012445450e-01 + + 5.8283501863479614e-01 -1.6822429373860359e-02 + <_> + + 0 -1 1911 5.7071618735790253e-02 + + -4.0532071143388748e-02 1.7078270018100739e-01 + <_> + + 0 -1 1912 5.8561540208756924e-03 + + -1.3827900588512421e-01 8.2565233111381531e-02 + <_> + + 0 -1 1913 -1.1472850292921066e-01 + + -4.6754041314125061e-01 3.4348990302532911e-03 + <_> + + 0 -1 1914 2.0518699660897255e-02 + + 8.1507943570613861e-02 -1.6894109547138214e-01 + <_> + + 0 -1 1915 5.4629769176244736e-02 + + -7.4763749726116657e-03 2.3640379309654236e-01 + <_> + + 0 -1 1916 -6.9312967360019684e-02 + + 3.0071571469306946e-01 -3.4785300493240356e-02 + <_> + + 0 -1 1917 -7.4176848866045475e-03 + + -2.8766560554504395e-01 4.7531820833683014e-02 + <_> + + 0 -1 1918 1.0223260149359703e-02 + + -3.0834799632430077e-02 3.9249539375305176e-01 + <_> + + 0 -1 1919 -2.7346659451723099e-02 + + -1.5695489943027496e-01 1.3967529870569706e-02 + <_> + + 0 -1 1920 3.3875100314617157e-02 + + 2.6063309982419014e-02 -3.9006409049034119e-01 + <_> + + 0 -1 1921 4.5174721628427505e-02 + + 8.9199207723140717e-03 -5.6769150495529175e-01 + <_> + + 0 -1 1922 1.1488229967653751e-02 + + -4.5491419732570648e-02 2.5109928846359253e-01 + <_> + + 0 -1 1923 -1.0496149770915508e-02 + + 6.4895443618297577e-02 -1.0623539984226227e-01 + <_> + + 0 -1 1924 6.0881208628416061e-03 + + 8.0929182469844818e-02 -1.4776149392127991e-01 + <_> + + 0 -1 1925 -2.6524660643190145e-03 + + 1.2062519788742065e-01 -7.2674863040447235e-02 + <_> + + 0 -1 1926 2.3559860419481993e-03 + + -8.1811271607875824e-02 1.4126540720462799e-01 + <_> + + 0 -1 1927 -2.6777219772338867e-01 + + -7.8083831071853638e-01 4.4526048004627228e-03 + <_> + + 0 -1 1928 1.5965799987316132e-01 + + 2.8381649404764175e-02 -3.8967838883399963e-01 + <_> + + 0 -1 1929 5.1899369806051254e-02 + + -3.4305319190025330e-02 1.5921010076999664e-01 + <_> + + 0 -1 1930 -1.3652780326083302e-03 + + -1.3755479454994202e-01 7.2719998657703400e-02 + <_> + + 0 -1 1931 2.2497299313545227e-01 + + -4.8017292283475399e-03 9.9994850158691406e-01 + <_> + + 0 -1 1932 3.1434150878340006e-03 + + 5.5151570588350296e-02 -1.6643160581588745e-01 + <_> + + 0 -1 1933 -6.2940339557826519e-03 + + 6.2896028161048889e-02 -6.0436379164457321e-02 + <_> + + 0 -1 1934 5.1301911473274231e-02 + + -3.1671810895204544e-02 3.8534939289093018e-01 + <_> + + 0 -1 1935 -6.6980808973312378e-02 + + -1.0925900191068649e-01 8.9958757162094116e-03 + <_> + + 0 -1 1936 5.1464758813381195e-02 + + 2.6210019364953041e-02 -4.2159339785575867e-01 + <_> + + 0 -1 1937 -9.0982139110565186e-02 + + 3.2760378718376160e-01 -7.8134387731552124e-03 + <_> + + 0 -1 1938 5.2848970517516136e-03 + + -7.9399570822715759e-02 1.4998179674148560e-01 + <_> + + 0 -1 1939 -1.5017699915915728e-03 + + 9.7703106701374054e-02 -7.3532037436962128e-02 + <_> + + 0 -1 1940 -2.5415199343115091e-03 + + 6.7801132798194885e-02 -1.4883249998092651e-01 + <_> + + 0 -1 1941 4.4252820312976837e-02 + + 1.6475830227136612e-02 -2.2880180180072784e-01 + <_> + + 0 -1 1942 -3.3457159996032715e-02 + + 4.1966789960861206e-01 -3.2553531229496002e-02 + <_> + + 0 -1 1943 1.3529899716377258e-01 + + 9.0894084423780441e-03 -7.3839122056961060e-01 + <_> + + 0 -1 1944 -3.7440970540046692e-02 + + -4.2613020539283752e-01 2.3972390219569206e-02 + <_> + + 0 -1 1945 -1.4479730452876538e-05 + + 5.6783780455589294e-02 -1.5888829529285431e-01 + <_> + + 0 -1 1946 -1.1839280277490616e-01 + + 5.0500631332397461e-01 -2.1859649568796158e-02 + <_> + + 0 -1 1947 -8.5000684484839439e-03 + + 5.2339930087327957e-02 -4.5925021171569824e-02 + <_> + + 0 -1 1948 -1.4189509674906731e-02 + + -2.3597060143947601e-01 4.0358349680900574e-02 + <_> + + 0 -1 1949 7.3599420487880707e-02 + + 3.2680039294064045e-03 -5.8853602409362793e-01 + <_> + + 0 -1 1950 5.4971270263195038e-02 + + -2.0196519792079926e-02 5.5482727289199829e-01 + <_> + + 0 -1 1951 -2.2816160693764687e-02 + + -1.7589579522609711e-01 1.7851740121841431e-02 + <_> + + 0 -1 1952 2.3204670287668705e-03 + + -8.1749923527240753e-02 1.2833079695701599e-01 + <_> + + 0 -1 1953 -1.0797909647226334e-01 + + -1. 1.7423679819330573e-03 + <_> + + 0 -1 1954 -4.1111931204795837e-02 + + 5.8432698249816895e-01 -1.8878869712352753e-02 + <_> + + 0 -1 1955 -3.5695650149136782e-03 + + -1.7558470368385315e-01 6.4731426537036896e-02 + <_> + + 0 -1 1956 -6.6358670592308044e-02 + + -1. 9.2067662626504898e-03 + <_> + + 0 -1 1957 -1.8944580107927322e-02 + + 2.5783088803291321e-01 -1.8944939598441124e-02 + <_> + + 0 -1 1958 -1.2871269881725311e-01 + + -5.8477258682250977e-01 1.4466489665210247e-02 + <_> + + 0 -1 1959 2.4218629114329815e-03 + + -7.3590897023677826e-02 7.0332102477550507e-02 + <_> + + 0 -1 1960 2.9718460515141487e-02 + + -2.3011969402432442e-02 4.0542769432067871e-01 + <_> + + 0 -1 1961 1.7555029690265656e-01 + + 2.0808730274438858e-02 -3.7285649776458740e-01 + <_> + + 0 -1 1962 3.7122450768947601e-02 + + -2.7959629893302917e-02 3.5908779501914978e-01 + <_> + + 0 -1 1963 -3.8044541142880917e-03 + + -1.3337990641593933e-01 9.2061348259449005e-02 + <_> + + 0 -1 1964 -1.0930700227618217e-02 + + 2.3196309804916382e-01 -4.4535879045724869e-02 + <_> + + 0 -1 1965 1.6103629767894745e-01 + + -8.7691349908709526e-03 2.2045169770717621e-01 + <_> + + 0 -1 1966 2.5971230119466782e-02 + + 6.4421012997627258e-02 -1.8919080495834351e-01 + <_> + + 0 -1 1967 1.2638209760189056e-01 + + -1.0362179949879646e-02 1.7057189345359802e-01 + <_> + + 0 -1 1968 -9.1393403708934784e-03 + + -1.3828249275684357e-01 8.6790062487125397e-02 + <_> + + 0 -1 1969 1.7722090706229210e-02 + + 3.9719890803098679e-02 -1.2294259667396545e-01 + <_> + + 0 -1 1970 -8.2425750792026520e-02 + + 3.0023100972175598e-01 -3.3165920525789261e-02 + <_> + + 0 -1 1971 4.3892528861761093e-02 + + -1.3056339696049690e-02 9.8728686571121216e-02 + <_> + + 0 -1 1972 3.5575369838625193e-03 + + 1.1186280101537704e-01 -9.2797823250293732e-02 + <_> + + 0 -1 1973 -1.5298820100724697e-02 + + -1.3007879257202148e-01 2.3159010335803032e-02 + <_> + + 0 -1 1974 -2.6504450943320990e-03 + + 1.3526280224323273e-01 -7.3355458676815033e-02 + <_> + + 0 -1 1975 4.1636861860752106e-02 + + -1.9068980589509010e-02 3.5857999324798584e-01 + <_> + + 0 -1 1976 -7.5290258973836899e-03 + + -1.8672360479831696e-01 5.8248449116945267e-02 + <_> + + 0 -1 1977 -4.0031488984823227e-02 + + 2.2969779372215271e-01 -1.4608230441808701e-02 + <_> + + 0 -1 1978 -1.3624709844589233e-01 + + -8.7086462974548340e-01 1.1211199685931206e-02 + <_> + + 0 -1 1979 4.5124008320271969e-03 + + -3.5644959658384323e-02 1.0103099793195724e-01 + <_> + + 0 -1 1980 5.4118070751428604e-02 + + -1.4689410105347633e-02 6.7652267217636108e-01 + <_> + + 0 -1 1981 -3.4553959965705872e-02 + + 2.1854560077190399e-01 -9.7846649587154388e-03 + <_> + + 0 -1 1982 -2.5520840659737587e-02 + + -4.6898001432418823e-01 2.4060370400547981e-02 + <_> + + 0 -1 1983 -3.5473700612783432e-02 + + 1.3427549600601196e-01 -2.1438699215650558e-02 + <_> + + 0 -1 1984 2.8683411073870957e-04 + + -9.7300283610820770e-02 1.0760939866304398e-01 + <_> + + 0 -1 1985 -7.8717589378356934e-02 + + -1. 2.7187850791960955e-03 + <_> + + 0 -1 1986 -1.5701749362051487e-04 + + 1.1199659854173660e-01 -9.9441379308700562e-02 + <_> + + 0 -1 1987 1.6026569530367851e-02 + + 3.4198261797428131e-02 -1.9100490212440491e-01 + <_> + + 0 -1 1988 -1.9164729863405228e-02 + + 8.9024826884269714e-02 -1.1919700354337692e-01 + <_> + + 0 -1 1989 -3.9445150643587112e-02 + + -1.0717990249395370e-01 3.7615209817886353e-02 + <_> + + 0 -1 1990 2.2417430300265551e-03 + + -9.0581007301807404e-02 1.7547470331192017e-01 + <_> + + 0 -1 1991 -3.8842540234327316e-03 + + 9.2697329819202423e-02 -4.2431369423866272e-02 + <_> + + 0 -1 1992 -2.1914629265666008e-02 + + -2.8017508983612061e-01 3.7537671625614166e-02 + <_> + + 0 -1 1993 -3.7512119859457016e-02 + + 3.6218520998954773e-01 -1.7507450655102730e-02 + <_> + + 0 -1 1994 -8.4374047582969069e-04 + + 1.2348400056362152e-01 -8.0245867371559143e-02 + <_> + + 0 -1 1995 -2.6424999814480543e-03 + + 5.2565738558769226e-02 -8.3335436880588531e-02 + <_> + + 0 -1 1996 -9.2836812138557434e-02 + + -4.2060381174087524e-01 2.3360429331660271e-02 + <_> + + 0 -1 1997 8.2463070750236511e-02 + + -2.9815400484949350e-03 7.8999197483062744e-01 + <_> + + 0 -1 1998 -6.9864951074123383e-02 + + 7.3802971839904785e-01 -1.4021299779415131e-02 + <_> + + 0 -1 1999 4.5439340174198151e-02 + + -1.1321160010993481e-02 1.9973699748516083e-01 + <_> + + 0 -1 2000 -5.0297789275646210e-02 + + 6.0764670372009277e-01 -1.7632890492677689e-02 + <_> + + 0 -1 2001 6.0456149280071259e-02 + + -5.9354598633944988e-03 3.1622889637947083e-01 + <_> + + 0 -1 2002 -4.6769347973167896e-03 + + -1.8090610206127167e-01 5.9660188853740692e-02 + <_> + + 0 -1 2003 3.6530068609863520e-04 + + -9.1220043599605560e-02 1.1092729866504669e-01 + <_> + + 0 -1 2004 -1.9491260871291161e-02 + + -3.7075570225715637e-01 2.8416309505701065e-02 + <_> + + 0 -1 2005 2.0056450739502907e-02 + + -5.8159679174423218e-02 7.8105233609676361e-02 + <_> + + 0 -1 2006 -3.9371181279420853e-02 + + 2.9012489318847656e-01 -4.1875660419464111e-02 + <_> + + 0 -1 2007 2.1523650735616684e-02 + + 1.6573080793023109e-02 -2.3614850640296936e-01 + <_> + + 0 -1 2008 -3.1294699292629957e-03 + + -1.6466400027275085e-01 6.2233809381723404e-02 + <_> + + 0 -1 2009 2.8589619323611259e-03 + + -3.8098409771919250e-02 5.5751629173755646e-02 + <_> + 135 + -3.0609300613403320e+01 + + <_> + + 0 -1 2010 -2.0576130598783493e-02 + + 1.7351129651069641e-01 -1.5058030188083649e-01 + <_> + + 0 -1 2011 1.6125949099659920e-02 + + -4.1612371802330017e-02 2.3984450101852417e-01 + <_> + + 0 -1 2012 -1.2352580204606056e-02 + + 9.7780853509902954e-02 -1.2391830235719681e-01 + <_> + + 0 -1 2013 -5.7473899796605110e-03 + + 7.7615208923816681e-02 -9.6236728131771088e-02 + <_> + + 0 -1 2014 2.9579061083495617e-03 + + -6.7683719098567963e-02 2.6594209671020508e-01 + <_> + + 0 -1 2015 -8.3472225815057755e-03 + + -1.1188179999589920e-01 1.3736370205879211e-01 + <_> + + 0 -1 2016 -5.8408780023455620e-04 + + 4.5943111181259155e-02 -1.6486530005931854e-01 + <_> + + 0 -1 2017 -3.5136839142069221e-04 + + 9.7791008651256561e-02 -6.4357861876487732e-02 + <_> + + 0 -1 2018 8.4126877482049167e-05 + + -1.3847629725933075e-01 8.8727742433547974e-02 + <_> + + 0 -1 2019 -2.6592490077018738e-01 + + -6.7525398731231689e-01 1.6188669949769974e-02 + <_> + + 0 -1 2020 4.3727741576731205e-03 + + 7.2884798049926758e-02 -1.2560360133647919e-01 + <_> + + 0 -1 2021 -2.2660531103610992e-03 + + 8.7269246578216553e-02 -6.8355433642864227e-02 + <_> + + 0 -1 2022 -6.5290732309222221e-03 + + -1.2197560071945190e-01 8.0927930772304535e-02 + <_> + + 0 -1 2023 9.6436247229576111e-02 + + -8.2637304440140724e-03 4.9127399921417236e-01 + <_> + + 0 -1 2024 -4.3594818562269211e-02 + + 4.5575308799743652e-01 -2.5600390508770943e-02 + <_> + + 0 -1 2025 -2.1098319441080093e-02 + + -1.1892750114202499e-01 2.3539589717984200e-02 + <_> + + 0 -1 2026 -2.5200019590556622e-03 + + 1.2724469602108002e-01 -9.0751722455024719e-02 + <_> + + 0 -1 2027 -8.9241685345768929e-03 + + -1.1514320224523544e-01 4.3497029691934586e-02 + <_> + + 0 -1 2028 3.4590170253068209e-03 + + 6.3537172973155975e-02 -1.8261429667472839e-01 + <_> + + 0 -1 2029 -3.6076800897717476e-03 + + 1.2005910277366638e-01 -5.2449110895395279e-02 + <_> + + 0 -1 2030 5.3778890520334244e-02 + + -1.8675789237022400e-02 5.2313017845153809e-01 + <_> + + 0 -1 2031 4.5245189219713211e-02 + + -1.7504919320344925e-02 2.1871849894523621e-01 + <_> + + 0 -1 2032 1.3272929936647415e-03 + + 7.8659959137439728e-02 -1.3551670312881470e-01 + <_> + + 0 -1 2033 1.2393640354275703e-02 + + 2.8952300548553467e-02 -7.2149537503719330e-02 + <_> + + 0 -1 2034 -3.7702780216932297e-02 + + 4.1850051283836365e-01 -3.0355349183082581e-02 + <_> + + 0 -1 2035 -4.8910409212112427e-02 + + 3.7365001440048218e-01 -5.6771109811961651e-03 + <_> + + 0 -1 2036 -5.9961699880659580e-03 + + -2.0756420493125916e-01 7.0438846945762634e-02 + <_> + + 0 -1 2037 5.6631930172443390e-02 + + -1.7292939126491547e-02 2.5498399138450623e-01 + <_> + + 0 -1 2038 3.1650230288505554e-02 + + -2.0658250898122787e-02 4.8398271203041077e-01 + <_> + + 0 -1 2039 -2.1152989938855171e-02 + + 2.0028789341449738e-01 -2.4872610345482826e-02 + <_> + + 0 -1 2040 8.7676532566547394e-02 + + -2.4999700486660004e-02 4.1126599907875061e-01 + <_> + + 0 -1 2041 5.3299881517887115e-02 + + -8.6766229942440987e-03 3.7446591258049011e-01 + <_> + + 0 -1 2042 -2.6251509552821517e-04 + + 9.9231846630573273e-02 -1.1989200115203857e-01 + <_> + + 0 -1 2043 -8.5897604003548622e-03 + + -1.8593010306358337e-01 3.4370779991149902e-02 + <_> + + 0 -1 2044 1.6940470784902573e-02 + + -3.4768261015415192e-02 2.7288261055946350e-01 + <_> + + 0 -1 2045 5.0596110522747040e-02 + + 3.6170349922031164e-03 -3.9460760354995728e-01 + <_> + + 0 -1 2046 -8.3048436790704727e-03 + + 9.8577797412872314e-02 -1.1666280031204224e-01 + <_> + + 0 -1 2047 1.0586270131170750e-02 + + 3.9117150008678436e-02 -8.5843667387962341e-02 + <_> + + 0 -1 2048 -3.2558601349592209e-02 + + -3.7352150678634644e-01 2.5410100817680359e-02 + <_> + + 0 -1 2049 -3.2352130860090256e-02 + + 2.6129978895187378e-01 -2.8631040826439857e-02 + <_> + + 0 -1 2050 2.5547049939632416e-02 + + 3.3884890377521515e-02 -3.0452328920364380e-01 + <_> + + 0 -1 2051 4.2252440005540848e-02 + + 8.9510334655642509e-03 -2.4091260135173798e-01 + <_> + + 0 -1 2052 3.8109479937702417e-03 + + -7.2638936340808868e-02 1.4634390175342560e-01 + <_> + + 0 -1 2053 2.0821709185838699e-02 + + -3.6271940916776657e-02 1.8324719369411469e-01 + <_> + + 0 -1 2054 2.6497790589928627e-02 + + 2.8160110116004944e-02 -3.9517199993133545e-01 + <_> + + 0 -1 2055 2.0283530652523041e-01 + + -9.3782292678952217e-03 4.4868949055671692e-01 + <_> + + 0 -1 2056 -1.7996610701084137e-01 + + -7.9595959186553955e-01 1.2027840130031109e-02 + <_> + + 0 -1 2057 -7.0968091487884521e-02 + + -7.6951277256011963e-01 1.0918079642578959e-03 + <_> + + 0 -1 2058 2.7555041015148163e-03 + + 7.0150263607501984e-02 -1.2915180623531342e-01 + <_> + + 0 -1 2059 -7.7004402875900269e-02 + + -4.9155071377754211e-01 2.8067480307072401e-03 + <_> + + 0 -1 2060 -2.0257910713553429e-02 + + 2.3568239808082581e-01 -4.3432798236608505e-02 + <_> + + 0 -1 2061 -8.6421817541122437e-02 + + -3.4541681408882141e-01 1.1248850263655186e-02 + <_> + + 0 -1 2062 -6.7245952785015106e-02 + + -6.8752902746200562e-01 1.1868669651448727e-02 + <_> + + 0 -1 2063 -1.2990389764308929e-01 + + -7.9069268703460693e-01 2.5537670589983463e-03 + <_> + + 0 -1 2064 -3.0394670367240906e-01 + + -8.9989352226257324e-01 8.1501724198460579e-03 + <_> + + 0 -1 2065 -4.1988548636436462e-01 + + -7.7303320169448853e-01 1.3665149454027414e-03 + <_> + + 0 -1 2066 -1.6851289570331573e-01 + + 2.4319399893283844e-01 -4.1280739009380341e-02 + <_> + + 0 -1 2067 2.8788880445063114e-03 + + 2.0577169954776764e-02 -1.8590900301933289e-01 + <_> + + 0 -1 2068 -4.0223840624094009e-02 + + 4.3099269270896912e-01 -2.3104710504412651e-02 + <_> + + 0 -1 2069 3.9687040261924267e-03 + + 4.3601520359516144e-02 -9.2233568429946899e-02 + <_> + + 0 -1 2070 -2.7650719508528709e-02 + + -6.1707872152328491e-01 1.4680569991469383e-02 + <_> + + 0 -1 2071 -2.3034301120787859e-03 + + 9.0349592268466949e-02 -6.1664551496505737e-02 + <_> + + 0 -1 2072 -2.9040789231657982e-02 + + 2.7737939357757568e-01 -3.9218869060277939e-02 + <_> + + 0 -1 2073 1.3288260437548161e-02 + + 3.1138259917497635e-02 -1.3558749854564667e-01 + <_> + + 0 -1 2074 3.3968928619287908e-05 + + -1.3562929630279541e-01 7.6467581093311310e-02 + <_> + + 0 -1 2075 -6.8583860993385315e-03 + + -1.0365810245275497e-01 2.5939159095287323e-02 + <_> + + 0 -1 2076 -1.4360919594764709e-02 + + -2.1136499941349030e-01 5.2973140031099319e-02 + <_> + + 0 -1 2077 -1.7468679696321487e-02 + + -1.0518109798431396e-01 1.7715079709887505e-02 + <_> + + 0 -1 2078 -9.8544567823410034e-02 + + 2.5649461150169373e-01 -4.4229641556739807e-02 + <_> + + 0 -1 2079 -2.8123459778726101e-03 + + -7.3800362646579742e-02 1.5400940179824829e-01 + <_> + + 0 -1 2080 2.1941340528428555e-03 + + -1.4216299355030060e-01 8.9139223098754883e-02 + <_> + + 0 -1 2081 4.6820759773254395e-02 + + 2.9364090412855148e-02 -6.2754891812801361e-02 + <_> + + 0 -1 2082 3.2891759276390076e-01 + + 1.3015690259635448e-02 -7.8347128629684448e-01 + <_> + + 0 -1 2083 -2.0470520481467247e-02 + + -7.6814353466033936e-02 3.9800468832254410e-02 + <_> + + 0 -1 2084 8.8677026331424713e-02 + + -4.0312368422746658e-02 2.8453868627548218e-01 + <_> + + 0 -1 2085 -1.1557979742065072e-03 + + 4.2199321091175079e-02 -4.1446208953857422e-02 + <_> + + 0 -1 2086 6.0524538159370422e-02 + + -1.6918700188398361e-02 6.7237138748168945e-01 + <_> + + 0 -1 2087 4.0830459445714951e-02 + + 1.3364840298891068e-02 -3.1113299727439880e-01 + <_> + + 0 -1 2088 -3.1132870353758335e-03 + + -1.7262780666351318e-01 5.9382218867540359e-02 + <_> + + 0 -1 2089 -4.3638627976179123e-03 + + 1.7265330255031586e-01 -6.2423970550298691e-02 + <_> + + 0 -1 2090 -3.2834090292453766e-02 + + 4.0275371074676514e-01 -2.5799039751291275e-02 + <_> + + 0 -1 2091 6.4377002418041229e-02 + + -4.7380630858242512e-03 7.5221067667007446e-01 + <_> + + 0 -1 2092 2.7642730623483658e-02 + + 3.7644479423761368e-02 -2.9220271110534668e-01 + <_> + + 0 -1 2093 2.2171199321746826e-02 + + -2.4654069915413857e-02 2.0533810555934906e-01 + <_> + + 0 -1 2094 1.5859310515224934e-03 + + 8.9463792741298676e-02 -1.2611730396747589e-01 + <_> + + 0 -1 2095 -1.8872050568461418e-02 + + 1.3072650134563446e-01 -3.6953710019588470e-02 + <_> + + 0 -1 2096 -1.3306169770658016e-02 + + -2.2963209450244904e-01 4.2687188833951950e-02 + <_> + + 0 -1 2097 -7.0407122373580933e-02 + + -7.1117508411407471e-01 6.6957580856978893e-03 + <_> + + 0 -1 2098 4.1748929768800735e-02 + + -3.2927870750427246e-02 3.0035281181335449e-01 + <_> + + 0 -1 2099 5.3282231092453003e-03 + + 5.1811750978231430e-02 -1.9069090485572815e-01 + <_> + + 0 -1 2100 2.4094989057630301e-03 + + -8.0687969923019409e-02 1.2510129809379578e-01 + <_> + + 0 -1 2101 -6.2405979260802269e-03 + + 1.0740630328655243e-01 -3.9979010820388794e-02 + <_> + + 0 -1 2102 -6.7312467098236084e-01 + + -1. 1.0070810094475746e-02 + <_> + + 0 -1 2103 -9.2983558773994446e-02 + + -1. -2.4261360522359610e-03 + <_> + + 0 -1 2104 3.3629760146141052e-02 + + 2.4122869595885277e-02 -4.1387900710105896e-01 + <_> + + 0 -1 2105 2.3880619555711746e-02 + + 9.6614202484488487e-03 -2.1973779797554016e-01 + <_> + + 0 -1 2106 1.2738780351355672e-03 + + -8.3555117249488831e-02 1.2269689887762070e-01 + <_> + + 0 -1 2107 1.8414139747619629e-02 + + 3.0798140913248062e-02 -3.5609170794487000e-01 + <_> + + 0 -1 2108 -5.6469578295946121e-02 + + 8.8631778955459595e-01 -1.2698300182819366e-02 + <_> + + 0 -1 2109 -4.6219761134125292e-04 + + 3.4681901335716248e-02 -8.2850828766822815e-02 + <_> + + 0 -1 2110 -1.9060859456658363e-02 + + 3.5369411110877991e-01 -2.7611760422587395e-02 + <_> + + 0 -1 2111 1.5762279508635402e-03 + + 4.0939908474683762e-02 -2.2517409920692444e-01 + <_> + + 0 -1 2112 2.0101880654692650e-02 + + -2.3995550349354744e-02 4.1091251373291016e-01 + <_> + + 0 -1 2113 2.7211669366806746e-03 + + 2.8122449293732643e-02 -1.4200119674205780e-01 + <_> + + 0 -1 2114 -1.0944429785013199e-01 + + 9.5085740089416504e-01 -9.4355372712016106e-03 + <_> + + 0 -1 2115 -1.2755279894918203e-03 + + 5.6902900338172913e-02 -8.3429783582687378e-02 + <_> + + 0 -1 2116 -8.0578401684761047e-02 + + -9.5139288902282715e-01 8.2268668338656425e-03 + <_> + + 0 -1 2117 -1.2047989666461945e-01 + + -3.0273869633674622e-01 2.8489340096712112e-02 + <_> + + 0 -1 2118 -1.8294970691204071e-01 + + 2.3866130411624908e-01 -6.2773942947387695e-02 + <_> + + 0 -1 2119 -1.7106409370899200e-01 + + -5.9394681453704834e-01 3.1515269074589014e-03 + <_> + + 0 -1 2120 -7.3414877057075500e-02 + + -8.6933082342147827e-01 1.0084389708936214e-02 + <_> + + 0 -1 2121 2.4238299578428268e-02 + + -2.1756110712885857e-02 1.6218559443950653e-01 + <_> + + 0 -1 2122 -7.1713668294250965e-03 + + -9.7345590591430664e-02 9.2148497700691223e-02 + <_> + + 0 -1 2123 -3.3344399183988571e-02 + + 7.4645392596721649e-02 -2.2160679101943970e-02 + <_> + + 0 -1 2124 7.2907900903373957e-04 + + -9.4971813261508942e-02 1.1826740205287933e-01 + <_> + + 0 -1 2125 -1.0217289673164487e-03 + + 5.6426230818033218e-02 -3.7573829293251038e-02 + <_> + + 0 -1 2126 -8.4900937508791685e-04 + + -1.3883149623870850e-01 7.0047326385974884e-02 + <_> + + 0 -1 2127 9.9850513041019440e-02 + + -1.4011589810252190e-02 2.6115679740905762e-01 + <_> + + 0 -1 2128 -1.3090069591999054e-01 + + 7.1379351615905762e-01 -1.1643799953162670e-02 + <_> + + 0 -1 2129 9.1210529208183289e-03 + + 4.5402809977531433e-02 -2.1830010414123535e-01 + <_> + + 0 -1 2130 2.0106479525566101e-01 + + -2.0753270015120506e-02 5.1230221986770630e-01 + <_> + + 0 -1 2131 4.7389309853315353e-02 + + 9.4779124483466148e-03 -4.7942391037940979e-01 + <_> + + 0 -1 2132 -5.7118538767099380e-02 + + 3.9166051149368286e-01 -2.6703910902142525e-02 + <_> + + 0 -1 2133 -8.3700623363256454e-03 + + -1.3399459421634674e-01 4.8460900783538818e-02 + <_> + + 0 -1 2134 4.0913890115916729e-03 + + -5.9489779174327850e-02 1.7438539862632751e-01 + <_> + + 0 -1 2135 7.1899488568305969e-02 + + 1.1723180301487446e-02 -3.6274778842926025e-01 + <_> + + 0 -1 2136 -3.6888250615447760e-03 + + 7.5763627886772156e-02 -1.5033599734306335e-01 + <_> + + 0 -1 2137 -7.4795219115912914e-03 + + 1.5027859807014465e-01 -4.5870490372180939e-02 + <_> + + 0 -1 2138 -1.2582589872181416e-02 + + -1.9915549457073212e-01 6.3917450606822968e-02 + <_> + + 0 -1 2139 3.5687079653143883e-03 + + -1.2117239832878113e-01 1.0956080257892609e-01 + <_> + + 0 -1 2140 1.7363800434395671e-03 + + 1.2258529663085938e-01 -9.3556262552738190e-02 + <_> + + 0 -1 2141 -1.4523629797622561e-03 + + 9.6722528338432312e-02 -8.0739699304103851e-02 + <_> + + 0 -1 2142 3.1017749570310116e-03 + + -6.9076471030712128e-02 1.5396459400653839e-01 + <_> + + 0 -1 2143 -8.5509587079286575e-03 + + -1.5186290442943573e-01 4.0346920490264893e-02 + <_> + + 0 -1 2144 -1.8966189818456769e-03 + + 1.2172549962997437e-01 -9.8543442785739899e-02 + <_> + 135 + -3.0601499557495117e+01 + + <_> + + 0 -1 2145 -2.3754740133881569e-02 + + 1.7095300555229187e-01 -1.1534280329942703e-01 + <_> + + 0 -1 2146 -7.3806629516184330e-03 + + 8.8067196309566498e-02 -4.0317770093679428e-02 + <_> + + 0 -1 2147 1.1198900174349546e-03 + + -7.9895302653312683e-02 1.3448899984359741e-01 + <_> + + 0 -1 2148 3.3718731254339218e-02 + + -1.5220030210912228e-02 2.9914170503616333e-01 + <_> + + 0 -1 2149 -2.8022660990245640e-04 + + 6.3599728047847748e-02 -1.5619190037250519e-01 + <_> + + 0 -1 2150 -3.9523928426206112e-03 + + -9.7961323335766792e-03 1.0571649670600891e-01 + <_> + + 0 -1 2151 2.1397129166871309e-03 + + 8.9953586459159851e-02 -1.4483779668807983e-01 + <_> + + 0 -1 2152 -6.7521296441555023e-02 + + 2.0932430028915405e-01 -5.3923811763525009e-02 + <_> + + 0 -1 2153 1.0378950275480747e-02 + + -6.4177162945270538e-02 2.7814629673957825e-01 + <_> + + 0 -1 2154 6.2903137877583504e-03 + + -4.9253720790147781e-02 8.2168422639369965e-02 + <_> + + 0 -1 2155 9.3974275514483452e-03 + + 8.4537737071514130e-02 -2.2885300219058990e-01 + <_> + + 0 -1 2156 1.0120930150151253e-02 + + 3.3337119966745377e-02 -8.1664256751537323e-02 + <_> + + 0 -1 2157 3.1531939748674631e-03 + + -1.0220990329980850e-01 1.1837360262870789e-01 + <_> + + 0 -1 2158 7.5137287378311157e-02 + + 2.7504051104187965e-03 -1.0000959634780884e+00 + <_> + + 0 -1 2159 -2.3692219983786345e-03 + + 9.9092483520507812e-02 -1.1425189673900604e-01 + <_> + + 0 -1 2160 -2.4510379880666733e-02 + + 2.8708320856094360e-01 -1.6148800030350685e-02 + <_> + + 0 -1 2161 -1.9670750480145216e-03 + + -1.1531370133161545e-01 8.6816556751728058e-02 + <_> + + 0 -1 2162 3.0845379456877708e-02 + + -2.4090610444545746e-02 1.9607549905776978e-01 + <_> + + 0 -1 2163 2.3816309869289398e-02 + + 3.2824039459228516e-02 -3.5710439085960388e-01 + <_> + + 0 -1 2164 -4.0199130773544312e-02 + + -5.2850788831710815e-01 6.0749719850718975e-03 + <_> + + 0 -1 2165 -6.8876100704073906e-03 + + 2.2058850526809692e-01 -5.9151489287614822e-02 + <_> + + 0 -1 2166 -2.5466730585321784e-04 + + 7.1897879242897034e-02 -8.4962032735347748e-02 + <_> + + 0 -1 2167 9.8468195647001266e-03 + + 4.1366759687662125e-02 -2.3984520137310028e-01 + <_> + + 0 -1 2168 2.7934400364756584e-02 + + -2.3647159337997437e-02 2.4738009274005890e-01 + <_> + + 0 -1 2169 -2.2960390895605087e-02 + + -4.5187929272651672e-01 2.2305779159069061e-02 + <_> + + 0 -1 2170 3.2323438790626824e-04 + + -8.7536007165908813e-02 7.8490957617759705e-02 + <_> + + 0 -1 2171 3.1954899430274963e-02 + + -2.6202389970421791e-02 3.9204901456832886e-01 + <_> + + 0 -1 2172 1.9027979578822851e-03 + + 6.2762781977653503e-02 -1.6107350587844849e-01 + <_> + + 0 -1 2173 -3.2691629603505135e-03 + + 1.0168000310659409e-01 -1.0432480275630951e-01 + <_> + + 0 -1 2174 1.0040200315415859e-02 + + -2.8046580031514168e-02 1.2117899954319000e-01 + <_> + + 0 -1 2175 -3.4158680588006973e-02 + + -2.8974449634552002e-01 3.5282660275697708e-02 + <_> + + 0 -1 2176 1.7615250544622540e-03 + + -5.5583070963621140e-02 7.4158452451229095e-02 + <_> + + 0 -1 2177 -2.1134650334715843e-02 + + 2.5130590796470642e-01 -4.0354639291763306e-02 + <_> + + 0 -1 2178 2.9759369790554047e-02 + + 3.8029540330171585e-02 -1.4226369559764862e-01 + <_> + + 0 -1 2179 1.4866080135107040e-02 + + -3.9721690118312836e-02 2.7522540092468262e-01 + <_> + + 0 -1 2180 -3.5829428583383560e-02 + + -3.3451971411705017e-01 9.6839247271418571e-03 + <_> + + 0 -1 2181 -3.2887340057641268e-03 + + -1.4258219301700592e-01 6.8576209247112274e-02 + <_> + + 0 -1 2182 4.2714878916740417e-02 + + -1.4240439981222153e-02 3.8765299320220947e-01 + <_> + + 0 -1 2183 1.2328879674896598e-03 + + 7.8623853623867035e-02 -1.1869420111179352e-01 + <_> + + 0 -1 2184 -1.0447620414197445e-02 + + -1.4882990717887878e-01 3.1571168452501297e-02 + <_> + + 0 -1 2185 1.2656359933316708e-02 + + -4.6572461724281311e-02 2.6212608814239502e-01 + <_> + + 0 -1 2186 4.9849718809127808e-02 + + 1.7015339806675911e-02 -1.4268730580806732e-01 + <_> + + 0 -1 2187 -1.8607240170240402e-02 + + 2.3338650166988373e-01 -4.7094941139221191e-02 + <_> + + 0 -1 2188 -5.4397370666265488e-02 + + -4.0511301159858704e-01 8.1606470048427582e-03 + <_> + + 0 -1 2189 2.9153900686651468e-03 + + -8.9313946664333344e-02 1.3335379958152771e-01 + <_> + + 0 -1 2190 -5.9154080227017403e-03 + + -2.0414529740810394e-01 4.8475701361894608e-02 + <_> + + 0 -1 2191 -1.9841329194605350e-03 + + 1.3428109884262085e-01 -7.5892791152000427e-02 + <_> + + 0 -1 2192 -4.4047520495951176e-03 + + 4.1852138936519623e-02 -1.0119090229272842e-01 + <_> + + 0 -1 2193 1.7982879653573036e-02 + + 4.3978679925203323e-02 -2.5054019689559937e-01 + <_> + + 0 -1 2194 -7.8059501945972443e-02 + + -3.3025071024894714e-01 6.3089421018958092e-03 + <_> + + 0 -1 2195 7.2548650205135345e-03 + + -1.0872170329093933e-01 9.9411018192768097e-02 + <_> + + 0 -1 2196 -2.7871869970113039e-03 + + 1.3659299910068512e-01 -8.4799639880657196e-02 + <_> + + 0 -1 2197 -9.3798413872718811e-03 + + -1.1872450262308121e-01 7.9108059406280518e-02 + <_> + + 0 -1 2198 -5.4926410317420959e-02 + + 1.4382070302963257e-01 -3.0072269961237907e-02 + <_> + + 0 -1 2199 -4.4219079427421093e-03 + + 1.0666429996490479e-01 -1.0838100314140320e-01 + <_> + + 0 -1 2200 1.0763059835880995e-03 + + 2.7380989864468575e-02 -5.5446051061153412e-02 + <_> + + 0 -1 2201 -7.2514012455940247e-02 + + -1.0893449932336807e-01 1.0097540169954300e-01 + <_> + + 0 -1 2202 -1.6472190618515015e-01 + + 3.0365368723869324e-01 -4.3666210025548935e-02 + <_> + + 0 -1 2203 7.9837806522846222e-02 + + -1.0828680358827114e-02 8.9977437257766724e-01 + <_> + + 0 -1 2204 -5.2413612138479948e-04 + + 8.5230633616447449e-02 -1.2053979933261871e-01 + <_> + + 0 -1 2205 -2.1632270887494087e-02 + + -2.1092039346694946e-01 6.5582543611526489e-02 + <_> + + 0 -1 2206 1.2691530585289001e-01 + + -4.5935749076306820e-03 4.5089641213417053e-01 + <_> + + 0 -1 2207 9.5472350716590881e-02 + + -2.0798899233341217e-02 5.2474659681320190e-01 + <_> + + 0 -1 2208 -8.2936078310012817e-02 + + 8.4976738691329956e-01 -5.0510508008301258e-03 + <_> + + 0 -1 2209 7.7482969500124454e-03 + + -5.5318288505077362e-02 1.7145830392837524e-01 + <_> + + 0 -1 2210 -2.1768439561128616e-02 + + -1.5947930514812469e-01 6.0873799026012421e-02 + <_> + + 0 -1 2211 -1.1072609777329490e-04 + + 7.8877292573451996e-02 -1.3177630305290222e-01 + <_> + + 0 -1 2212 3.1122909858822823e-03 + + -4.3046839535236359e-02 6.2392581254243851e-02 + <_> + + 0 -1 2213 -2.8692940250039101e-03 + + 1.3746979832649231e-01 -8.0494217574596405e-02 + <_> + + 0 -1 2214 1.0575760155916214e-01 + + 1.0569440200924873e-03 -9.9993818998336792e-01 + <_> + + 0 -1 2215 4.6192679554224014e-02 + + 1.7228020355105400e-02 -5.2604919672012329e-01 + <_> + + 0 -1 2216 -2.5476190447807312e-01 + + -6.2927299737930298e-01 1.3698619790375233e-02 + <_> + + 0 -1 2217 -2.7374029159545898e-03 + + 1.2747539579868317e-01 -6.9591522216796875e-02 + <_> + + 0 -1 2218 2.1854760125279427e-03 + + 4.1854761540889740e-02 -2.6481458544731140e-01 + <_> + + 0 -1 2219 -2.4050710722804070e-02 + + -2.6191109418869019e-01 3.4489940851926804e-02 + <_> + + 0 -1 2220 1.0211429744958878e-01 + + -1.5302860178053379e-02 3.9992758631706238e-01 + <_> + + 0 -1 2221 1.0281659662723541e-01 + + -2.9020670801401138e-02 3.6887159943580627e-01 + <_> + + 0 -1 2222 3.9206489920616150e-02 + + 8.9045017957687378e-03 -4.3242999911308289e-01 + <_> + + 0 -1 2223 -3.7830859422683716e-02 + + -6.2731212377548218e-01 1.4882829971611500e-02 + <_> + + 0 -1 2224 1.2507890351116657e-02 + + -1.7865059897303581e-02 1.4156140387058258e-01 + <_> + + 0 -1 2225 -1.5477590262889862e-02 + + 3.1676650047302246e-01 -3.3510830253362656e-02 + <_> + + 0 -1 2226 -4.5885699801146984e-03 + + -1.5222150087356567e-01 7.3211863636970520e-02 + <_> + + 0 -1 2227 -2.0505970343947411e-02 + + 1.1725380271673203e-01 -9.7457922995090485e-02 + <_> + + 0 -1 2228 -1.3098320364952087e-01 + + 5.4338067770004272e-01 -5.8803129941225052e-03 + <_> + + 0 -1 2229 4.7888278961181641e-02 + + -2.7120810002088547e-02 3.5723638534545898e-01 + <_> + + 0 -1 2230 2.5441530346870422e-01 + + 2.5680949911475182e-03 -9.9988257884979248e-01 + <_> + + 0 -1 2231 2.0652529783546925e-03 + + -9.4255000352859497e-02 1.0068359971046448e-01 + <_> + + 0 -1 2232 3.0141780152916908e-02 + + -1.5984520316123962e-02 2.4209509789943695e-01 + <_> + + 0 -1 2233 1.2305500358343124e-01 + + 4.3902460485696793e-02 -2.9046860337257385e-01 + <_> + + 0 -1 2234 1.1436889879405499e-02 + + 3.1826701015233994e-02 -1.0569609701633453e-01 + <_> + + 0 -1 2235 1.4229659922420979e-02 + + -6.4518727362155914e-02 1.6178989410400391e-01 + <_> + + 0 -1 2236 -1.9808039069175720e-02 + + 2.0909899473190308e-01 -2.7245460078120232e-02 + <_> + + 0 -1 2237 -3.2634709030389786e-02 + + -4.6265149116516113e-01 2.3877989500761032e-02 + <_> + + 0 -1 2238 8.1568211317062378e-02 + + -1.0983820073306561e-02 7.4517530202865601e-01 + <_> + + 0 -1 2239 1.7331159906461835e-03 + + 6.2832579016685486e-02 -1.5800160169601440e-01 + <_> + + 0 -1 2240 4.1524558328092098e-03 + + 2.8520949184894562e-02 -8.3923816680908203e-02 + <_> + + 0 -1 2241 2.0917340589221567e-04 + + -1.6536650061607361e-01 8.3170376718044281e-02 + <_> + + 0 -1 2242 -6.9550168700516224e-04 + + 5.7298898696899414e-02 -9.8668128252029419e-02 + <_> + + 0 -1 2243 1.0114730149507523e-01 + + -2.7031859382987022e-02 5.0937288999557495e-01 + <_> + + 0 -1 2244 2.0371530205011368e-02 + + -1.5991339460015297e-02 2.1110190451145172e-01 + <_> + + 0 -1 2245 1.9490359723567963e-01 + + 1.1169149540364742e-02 -8.0626577138900757e-01 + <_> + + 0 -1 2246 -1.5187750104814768e-03 + + 8.8670432567596436e-02 -6.5779693424701691e-02 + <_> + + 0 -1 2247 -2.2300280761555769e-05 + + 7.0237100124359131e-02 -1.3656799495220184e-01 + <_> + + 0 -1 2248 7.0241810753941536e-03 + + 4.5264270156621933e-02 -1.2246630340814590e-01 + <_> + + 0 -1 2249 -5.8513730764389038e-03 + + 1.4548699557781219e-01 -7.7512867748737335e-02 + <_> + + 0 -1 2250 -1.2228869833052158e-02 + + -1.5762320160865784e-01 3.3091600984334946e-02 + <_> + + 0 -1 2251 -2.7475339174270630e-01 + + 4.1415899991989136e-01 -2.3306179791688919e-02 + <_> + + 0 -1 2252 -8.3073312416672707e-03 + + -6.6158972680568695e-02 4.5423369854688644e-02 + <_> + + 0 -1 2253 1.4967099763453007e-02 + + 3.9580021053552628e-02 -2.4474979937076569e-01 + <_> + + 0 -1 2254 3.5121920518577099e-03 + + -3.2608591020107269e-02 7.2080552577972412e-02 + <_> + + 0 -1 2255 6.0676191933453083e-03 + + -6.6284246742725372e-02 1.6455779969692230e-01 + <_> + + 0 -1 2256 -6.0948841273784637e-03 + + -1.6784119606018066e-01 6.8097747862339020e-02 + <_> + + 0 -1 2257 -4.4710501097142696e-03 + + 1.4348860085010529e-01 -7.5286053121089935e-02 + <_> + + 0 -1 2258 2.7629999443888664e-02 + + -6.0715568251907825e-03 4.6235299110412598e-01 + <_> + + 0 -1 2259 -4.1778348386287689e-03 + + -9.4480186700820923e-02 1.0268689692020416e-01 + <_> + + 0 -1 2260 -1.4997010293882340e-04 + + 4.5903969556093216e-02 -1.2689989805221558e-01 + <_> + + 0 -1 2261 9.3421656638383865e-03 + + -4.7851350158452988e-02 2.3776920139789581e-01 + <_> + + 0 -1 2262 -9.0454798191785812e-03 + + -1.4881759881973267e-01 2.5717660784721375e-02 + <_> + + 0 -1 2263 -1.0563050163909793e-03 + + -1.2465219944715500e-01 8.2118943333625793e-02 + <_> + + 0 -1 2264 -1.5602169558405876e-02 + + 3.0471551418304443e-01 -2.4503290653228760e-02 + <_> + + 0 -1 2265 -8.9588612318038940e-03 + + -2.3624059557914734e-01 4.6290140599012375e-02 + <_> + + 0 -1 2266 -7.6452922075986862e-03 + + 1.1393140256404877e-01 -2.6573060080409050e-02 + <_> + + 0 -1 2267 -1.9294900819659233e-02 + + 2.8820019960403442e-01 -3.5906881093978882e-02 + <_> + + 0 -1 2268 8.6250286549329758e-03 + + 6.1006020754575729e-02 -1.6832630336284637e-01 + <_> + + 0 -1 2269 2.5883490219712257e-02 + + -4.0142849087715149e-02 2.3263120651245117e-01 + <_> + + 0 -1 2270 -7.4946112930774689e-02 + + 7.1168798208236694e-01 -6.0237408615648746e-03 + <_> + + 0 -1 2271 -2.6808120310306549e-04 + + 7.7717900276184082e-02 -1.5358750522136688e-01 + <_> + + 0 -1 2272 6.1041440814733505e-02 + + -3.4070160239934921e-02 2.5833290815353394e-01 + <_> + + 0 -1 2273 -4.7920648939907551e-03 + + -1.5077829360961914e-01 8.4577240049839020e-02 + <_> + + 0 -1 2274 -1.2610630691051483e-01 + + -4.8404538631439209e-01 8.6965439841151237e-03 + <_> + + 0 -1 2275 -2.2879270836710930e-02 + + 6.7734187841415405e-01 -1.4856100082397461e-02 + <_> + + 0 -1 2276 -6.2760512810200453e-04 + + 5.0910349935293198e-02 -1.4076440036296844e-01 + <_> + + 0 -1 2277 -1.0543179698288441e-02 + + -9.0707249939441681e-02 1.1281900107860565e-01 + <_> + + 0 -1 2278 -2.4953829124569893e-03 + + 8.9523762464523315e-02 -7.5541287660598755e-02 + <_> + + 0 -1 2279 6.0986150056123734e-02 + + -3.2006978988647461e-02 3.3000910282135010e-01 + <_> + 143 + -3.0555000305175781e+01 + + <_> + + 0 -1 2280 -4.1241809725761414e-02 + + 2.4841840565204620e-01 -6.9879129528999329e-02 + <_> + + 0 -1 2281 -7.4663497507572174e-02 + + -7.5433689355850220e-01 4.0493709966540337e-03 + <_> + + 0 -1 2282 -2.3803679272532463e-02 + + 2.4313099682331085e-01 -4.5283928513526917e-02 + <_> + + 0 -1 2283 3.2028619199991226e-02 + + -1.2230539694428444e-02 3.9811220765113831e-01 + <_> + + 0 -1 2284 3.8454410969279706e-04 + + 6.9244839251041412e-02 -1.7288799583911896e-01 + <_> + + 0 -1 2285 -2.0599530544131994e-03 + + 4.5083250850439072e-02 -6.3824482262134552e-02 + <_> + + 0 -1 2286 5.9174500405788422e-02 + + 1.3756089843809605e-02 5.8063977956771851e-01 + <_> + + 0 -1 2287 -8.1204501911997795e-03 + + -7.9060196876525879e-02 3.2097879797220230e-02 + <_> + + 0 -1 2288 -5.4362448863685131e-03 + + 8.0285012722015381e-02 -1.3880789279937744e-01 + <_> + + 0 -1 2289 4.0768779814243317e-02 + + 3.5265129059553146e-02 -1.6821040213108063e-01 + <_> + + 0 -1 2290 -1.0705769993364811e-02 + + -1.3227799534797668e-01 9.7147703170776367e-02 + <_> + + 0 -1 2291 -2.1374409552663565e-03 + + -1.1135129630565643e-01 1.0501199960708618e-01 + <_> + + 0 -1 2292 -6.0069030150771141e-03 + + 7.9701423645019531e-02 -1.4503550529479980e-01 + <_> + + 0 -1 2293 6.8584359250962734e-03 + + -2.8629170730710030e-02 1.5494349598884583e-01 + <_> + + 0 -1 2294 8.4308702498674393e-03 + + -6.8725876510143280e-02 1.3571439683437347e-01 + <_> + + 0 -1 2295 -3.1918209046125412e-02 + + -9.0021647512912750e-02 7.0172756910324097e-02 + <_> + + 0 -1 2296 1.4346960186958313e-01 + + 3.7936199456453323e-02 -3.3849731087684631e-01 + <_> + + 0 -1 2297 -5.3501531481742859e-02 + + -1. -1.3069049455225468e-03 + <_> + + 0 -1 2298 -4.3198501225560904e-04 + + 6.3140459358692169e-02 -1.4891080558300018e-01 + <_> + + 0 -1 2299 -3.6825511604547501e-02 + + 1.6418960690498352e-01 -3.6547198891639709e-02 + <_> + + 0 -1 2300 -9.3230612576007843e-02 + + -8.1855481863021851e-01 1.0488729923963547e-02 + <_> + + 0 -1 2301 -7.5886500999331474e-03 + + 9.6189923584461212e-02 -3.2392729073762894e-02 + <_> + + 0 -1 2302 1.9316580146551132e-03 + + -9.7133457660675049e-02 9.6836537122726440e-02 + <_> + + 0 -1 2303 -1.7610849440097809e-01 + + -1. 3.9064860902726650e-04 + <_> + + 0 -1 2304 -4.5753358863294125e-03 + + -1.4245940744876862e-01 7.2629533708095551e-02 + <_> + + 0 -1 2305 -7.1555696427822113e-02 + + 7.0124769210815430e-01 -8.1192785874009132e-03 + <_> + + 0 -1 2306 -5.1939189434051514e-03 + + -1.7593400180339813e-01 6.6920258104801178e-02 + <_> + + 0 -1 2307 9.7410175949335098e-03 + + -4.0632858872413635e-02 1.5366269648075104e-01 + <_> + + 0 -1 2308 -1.9197730347514153e-02 + + 8.8404722511768341e-02 -1.1119589954614639e-01 + <_> + + 0 -1 2309 7.7713979408144951e-03 + + -5.1531080156564713e-02 2.3341870307922363e-01 + <_> + + 0 -1 2310 4.6741779893636703e-02 + + 5.8658950030803680e-02 -2.1825340390205383e-01 + <_> + + 0 -1 2311 -6.7051820456981659e-02 + + -7.6968950033187866e-01 2.2733330260962248e-03 + <_> + + 0 -1 2312 1.0403609834611416e-02 + + -5.7208269834518433e-02 1.9874769449234009e-01 + <_> + + 0 -1 2313 6.8136617541313171e-02 + + 1.0924750007688999e-02 -2.3514769971370697e-01 + <_> + + 0 -1 2314 5.5462731979787350e-03 + + 7.6430208981037140e-02 -1.5048150718212128e-01 + <_> + + 0 -1 2315 3.5827890038490295e-02 + + 5.2330200560390949e-03 -9.0509557723999023e-01 + <_> + + 0 -1 2316 1.0099080391228199e-02 + + -4.9438349902629852e-02 1.9236649572849274e-01 + <_> + + 0 -1 2317 -7.3000352131202817e-04 + + 8.0038689076900482e-02 -5.9875860810279846e-02 + <_> + + 0 -1 2318 -6.2627308070659637e-02 + + -6.8771952390670776e-01 1.4409339986741543e-02 + <_> + + 0 -1 2319 4.1463607922196388e-03 + + 6.2068879604339600e-02 -1.4138600230216980e-01 + <_> + + 0 -1 2320 -1.4136059582233429e-01 + + 5.9439867734909058e-01 -1.6910530626773834e-02 + <_> + + 0 -1 2321 7.0147067308425903e-02 + + 3.5781029146164656e-03 -8.4541380405426025e-01 + <_> + + 0 -1 2322 1.8181180348619819e-03 + + -5.9031128883361816e-02 1.7709979414939880e-01 + <_> + + 0 -1 2323 6.3149541616439819e-02 + + -7.9691512510180473e-03 2.4575470387935638e-01 + <_> + + 0 -1 2324 1.7065559513866901e-03 + + -1.3776679337024689e-01 7.2286598384380341e-02 + <_> + + 0 -1 2325 -4.1844159364700317e-02 + + -1.0204549878835678e-01 1.9412880763411522e-02 + <_> + + 0 -1 2326 6.1876028776168823e-02 + + 1.7572570592164993e-02 -5.9611201286315918e-01 + <_> + + 0 -1 2327 8.6206607520580292e-02 + + -8.3246696740388870e-03 5.9274739027023315e-01 + <_> + + 0 -1 2328 1.5561250038444996e-02 + + 5.5908791720867157e-02 -2.0174680650234222e-01 + <_> + + 0 -1 2329 1.9683360587805510e-03 + + 8.4109783172607422e-02 -9.5114283263683319e-02 + <_> + + 0 -1 2330 -3.2295130658894777e-03 + + 1.9859789311885834e-01 -6.0371041297912598e-02 + <_> + + 0 -1 2331 4.3861459940671921e-02 + + -7.5495638884603977e-03 2.7785310149192810e-01 + <_> + + 0 -1 2332 -7.1588042192161083e-04 + + 1.0671679675579071e-01 -1.1605340242385864e-01 + <_> + + 0 -1 2333 -1.1585080064833164e-02 + + 1.3923209905624390e-01 -7.2681717574596405e-02 + <_> + + 0 -1 2334 -2.4132030084729195e-02 + + -3.4343299269676208e-01 2.8587639331817627e-02 + <_> + + 0 -1 2335 -5.9670167975127697e-03 + + 6.2854968011379242e-02 -6.3237912952899933e-02 + <_> + + 0 -1 2336 -5.7298261672258377e-02 + + 3.3512100577354431e-01 -3.4425679594278336e-02 + <_> + + 0 -1 2337 -1.4440530538558960e-01 + + -1. -2.0486500579863787e-04 + <_> + + 0 -1 2338 -1.6152009367942810e-02 + + -1.8017260730266571e-01 6.0698080807924271e-02 + <_> + + 0 -1 2339 3.1132341246120632e-04 + + -8.7393969297409058e-02 1.0814479738473892e-01 + <_> + + 0 -1 2340 -3.4905138891190290e-03 + + 1.3089099526405334e-01 -8.2502506673336029e-02 + <_> + + 0 -1 2341 -5.1078200340270996e-02 + + -6.6744989156723022e-01 9.7670806571841240e-03 + <_> + + 0 -1 2342 2.3027899861335754e-01 + + 8.9318687096238136e-03 -8.8892549276351929e-01 + <_> + + 0 -1 2343 3.3260289579629898e-02 + + -3.8846820592880249e-02 1.1871550232172012e-01 + <_> + + 0 -1 2344 3.6332090385258198e-03 + + -8.1865288317203522e-02 1.2006369978189468e-01 + <_> + + 0 -1 2345 -1.3659459364134818e-04 + + 2.9094040393829346e-02 -8.6412712931632996e-02 + <_> + + 0 -1 2346 4.2663831263780594e-03 + + 5.9642590582370758e-02 -1.6777870059013367e-01 + <_> + + 0 -1 2347 -3.7726368755102158e-02 + + 2.5201418995857239e-01 -1.1480459943413734e-02 + <_> + + 0 -1 2348 -3.7723951041698456e-02 + + 3.6150801181793213e-01 -2.5164980441331863e-02 + <_> + + 0 -1 2349 -3.5217531025409698e-02 + + -2.0768259465694427e-01 1.5659499913454056e-02 + <_> + + 0 -1 2350 -2.6250150054693222e-02 + + 6.4363038539886475e-01 -1.3971080072224140e-02 + <_> + + 0 -1 2351 7.1132831275463104e-02 + + 5.0701410509645939e-03 -8.1053668260574341e-01 + <_> + + 0 -1 2352 2.8358760755509138e-03 + + 8.0034732818603516e-02 -1.1766050010919571e-01 + <_> + + 0 -1 2353 3.4837881103157997e-03 + + 6.9709457457065582e-02 -1.2136720120906830e-01 + <_> + + 0 -1 2354 2.9538539820350707e-05 + + -1.7090520262718201e-01 7.0092067122459412e-02 + <_> + + 0 -1 2355 2.6345230638980865e-02 + + -1.1046449653804302e-02 3.5467839241027832e-01 + <_> + + 0 -1 2356 3.3180779428221285e-04 + + -8.9763849973678589e-02 1.0402739793062210e-01 + <_> + + 0 -1 2357 9.9607985466718674e-03 + + -1.0574670135974884e-01 8.7481163442134857e-02 + <_> + + 0 -1 2358 6.9068476557731628e-02 + + -2.3135760799050331e-02 3.7765979766845703e-01 + <_> + + 0 -1 2359 -3.3804871141910553e-02 + + -8.0052927136421204e-02 6.6171988844871521e-02 + <_> + + 0 -1 2360 -2.1103899925947189e-03 + + 7.2913236916065216e-02 -1.6986669600009918e-01 + <_> + + 0 -1 2361 7.1675583720207214e-02 + + -2.2668020799756050e-02 4.3757459521293640e-01 + <_> + + 0 -1 2362 -1.7637129873037338e-02 + + 1.4710550010204315e-01 -7.7648147940635681e-02 + <_> + + 0 -1 2363 2.1559430751949549e-03 + + -4.4561479240655899e-02 8.0616250634193420e-02 + <_> + + 0 -1 2364 -2.9923371039330959e-03 + + 1.6013230383396149e-01 -7.2628170251846313e-02 + <_> + + 0 -1 2365 -2.8351619839668274e-02 + + -2.4835529923439026e-01 7.8493626788258553e-03 + <_> + + 0 -1 2366 -5.3842412307858467e-03 + + -1.3290390372276306e-01 7.8615352511405945e-02 + <_> + + 0 -1 2367 1.6513720154762268e-02 + + -3.0867580324411392e-02 2.2910499572753906e-01 + <_> + + 0 -1 2368 -2.3480059579014778e-02 + + -3.4656900167465210e-01 2.8477910906076431e-02 + <_> + + 0 -1 2369 6.4804457128047943e-02 + + 3.2681180164217949e-03 -8.1848317384719849e-01 + <_> + + 0 -1 2370 2.9363438952714205e-03 + + 6.8371996283531189e-02 -1.6038259863853455e-01 + <_> + + 0 -1 2371 1.9352639093995094e-02 + + 1.2330809608101845e-02 -1.7751510441303253e-01 + <_> + + 0 -1 2372 -1.4157049590721726e-03 + + 1.6248740255832672e-01 -8.4821969270706177e-02 + <_> + + 0 -1 2373 -3.2165680080652237e-02 + + 2.5495579838752747e-01 -1.5387820079922676e-02 + <_> + + 0 -1 2374 9.9883928894996643e-02 + + 1.1630980297923088e-02 -8.6939221620559692e-01 + <_> + + 0 -1 2375 -8.5509859491139650e-04 + + 3.7509139627218246e-02 -4.1315130889415741e-02 + <_> + + 0 -1 2376 1.9948679953813553e-02 + + -3.3211439847946167e-02 2.6546698808670044e-01 + <_> + + 0 -1 2377 -1.6821360215544701e-02 + + -1.9504530727863312e-01 4.5578271150588989e-02 + <_> + + 0 -1 2378 -8.1685081124305725e-02 + + 8.0823719501495361e-01 -1.0028379969298840e-02 + <_> + + 0 -1 2379 -3.9467110764235258e-04 + + 3.7868868559598923e-02 -7.4321702122688293e-02 + <_> + + 0 -1 2380 -4.1939578950405121e-02 + + -7.5310271978378296e-01 1.2494780123233795e-02 + <_> + + 0 -1 2381 1.2319780141115189e-01 + + 1.5212129801511765e-03 -8.7456828355789185e-01 + <_> + + 0 -1 2382 4.3162349611520767e-03 + + 9.5917366445064545e-02 -9.8286882042884827e-02 + <_> + + 0 -1 2383 1.7064419807866216e-03 + + -6.7283846437931061e-02 5.8372668921947479e-02 + <_> + + 0 -1 2384 6.8853497505187988e-02 + + 3.9853271096944809e-02 -2.7014040946960449e-01 + <_> + + 0 -1 2385 1.5133110573515296e-03 + + 3.6803830415010452e-02 -7.8638777136802673e-02 + <_> + + 0 -1 2386 1.6671700403094292e-02 + + -5.2208479493856430e-02 2.5476139783859253e-01 + <_> + + 0 -1 2387 -2.4927379563450813e-03 + + -6.8352922797203064e-02 3.9182528853416443e-02 + <_> + + 0 -1 2388 1.7946650041267276e-03 + + 7.5641617178916931e-02 -1.8443019688129425e-01 + <_> + + 0 -1 2389 6.5764516592025757e-02 + + -2.7957379817962646e-02 1.3770729303359985e-01 + <_> + + 0 -1 2390 -3.2415628433227539e-02 + + 2.4957719445228577e-01 -3.8401741534471512e-02 + <_> + + 0 -1 2391 1.5985220670700073e-01 + + 2.3139530792832375e-02 -4.5876979827880859e-01 + <_> + + 0 -1 2392 3.3003050833940506e-02 + + -2.8549650683999062e-02 3.6482268571853638e-01 + <_> + + 0 -1 2393 8.3292415365576744e-03 + + 2.3422110825777054e-02 -1.2992739677429199e-01 + <_> + + 0 -1 2394 -1.4707380533218384e-01 + + -1. 1.0342770256102085e-02 + <_> + + 0 -1 2395 1.0625930130481720e-01 + + 2.8901589103043079e-03 -6.2105101346969604e-01 + <_> + + 0 -1 2396 4.7905001789331436e-02 + + -2.5437310338020325e-02 3.8595038652420044e-01 + <_> + + 0 -1 2397 4.3562948703765869e-02 + + 1.2963670305907726e-02 -3.1574508547782898e-01 + <_> + + 0 -1 2398 -6.6401511430740356e-02 + + 3.7184339761734009e-01 -2.4248229339718819e-02 + <_> + + 0 -1 2399 1.0357169667258859e-03 + + -3.3857159316539764e-02 7.2818137705326080e-02 + <_> + + 0 -1 2400 -1.0010260343551636e-01 + + -2.6162430644035339e-01 4.0561348199844360e-02 + <_> + + 0 -1 2401 -1.4029429852962494e-01 + + 1.6186380386352539e-01 -3.7463869899511337e-02 + <_> + + 0 -1 2402 -3.6629181355237961e-02 + + -3.7988689541816711e-01 2.2493759170174599e-02 + <_> + + 0 -1 2403 1.8527939915657043e-01 + + -3.4648380242288113e-03 9.9972921609878540e-01 + <_> + + 0 -1 2404 1.3452930375933647e-02 + + 6.6191017627716064e-02 -1.5208050608634949e-01 + <_> + + 0 -1 2405 8.4628060460090637e-02 + + -3.2134260982275009e-02 2.2877800464630127e-01 + <_> + + 0 -1 2406 -8.7568372488021851e-02 + + 4.3229681253433228e-01 -2.4735029786825180e-02 + <_> + + 0 -1 2407 2.6502339169383049e-02 + + 2.3526629433035851e-02 -2.9849499464035034e-01 + <_> + + 0 -1 2408 -1.8273059278726578e-02 + + 5.0878030061721802e-01 -1.9735949113965034e-02 + <_> + + 0 -1 2409 -1.1995369568467140e-03 + + 7.4867762625217438e-02 -7.3861390352249146e-02 + <_> + + 0 -1 2410 3.1381230801343918e-02 + + -2.6280479505658150e-02 3.6583951115608215e-01 + <_> + + 0 -1 2411 2.3178670555353165e-02 + + 3.7155259400606155e-02 -2.5468569993972778e-01 + <_> + + 0 -1 2412 -1.3644699938595295e-02 + + 2.0717699825763702e-01 -4.2792771011590958e-02 + <_> + + 0 -1 2413 7.8315278515219688e-03 + + 3.6028519272804260e-02 -8.0337040126323700e-02 + <_> + + 0 -1 2414 -1.0035780258476734e-02 + + -2.2253769636154175e-01 4.2950030416250229e-02 + <_> + + 0 -1 2415 -5.1132131367921829e-02 + + 3.0586650967597961e-01 -2.7054589241743088e-02 + <_> + + 0 -1 2416 -6.9544702768325806e-02 + + 3.4688460826873779e-01 -3.1736221164464951e-02 + <_> + + 0 -1 2417 -2.4079360067844391e-02 + + 1.3291560113430023e-01 -3.0277779325842857e-02 + <_> + + 0 -1 2418 -6.6630518995225430e-03 + + -1.8473480641841888e-01 7.8750252723693848e-02 + <_> + + 0 -1 2419 4.3147690594196320e-02 + + -9.1566536575555801e-03 2.9485818743705750e-01 + <_> + + 0 -1 2420 -1.3808339834213257e-02 + + -2.8479158878326416e-01 3.2622188329696655e-02 + <_> + + 0 -1 2421 1.6351899504661560e-01 + + -3.7377059925347567e-03 5.6042182445526123e-01 + <_> + + 0 -1 2422 -2.4086149409413338e-02 + + 1.5841430425643921e-01 -6.6294513642787933e-02 + + <_> + + <_> + 5 5 12 6 -1. + <_> + 9 5 4 6 3. + <_> + + <_> + 7 13 10 4 -1. + <_> + 7 15 10 2 2. + <_> + + <_> + 3 14 9 4 -1. + <_> + 6 14 3 4 3. + <_> + + <_> + 15 6 5 6 -1. + <_> + 15 6 5 3 2. + 1 + <_> + + <_> + 0 1 22 14 -1. + <_> + 11 1 11 14 2. + <_> + + <_> + 1 11 20 4 -1. + <_> + 6 11 10 4 2. + <_> + + <_> + 7 6 6 5 -1. + <_> + 7 6 3 5 2. + 1 + <_> + + <_> + 5 13 12 4 -1. + <_> + 11 13 6 2 2. + <_> + 5 15 6 2 2. + <_> + + <_> + 7 12 8 6 -1. + <_> + 7 12 4 3 2. + <_> + 11 15 4 3 2. + <_> + + <_> + 20 0 2 18 -1. + <_> + 20 9 2 9 2. + <_> + + <_> + 8 6 6 12 -1. + <_> + 10 6 2 12 3. + <_> + + <_> + 8 5 6 6 -1. + <_> + 10 5 2 6 3. + <_> + + <_> + 5 15 12 2 -1. + <_> + 5 16 12 1 2. + <_> + + <_> + 20 0 2 18 -1. + <_> + 20 9 2 9 2. + <_> + + <_> + 0 0 2 18 -1. + <_> + 0 9 2 9 2. + <_> + + <_> + 13 7 6 4 -1. + <_> + 13 7 6 2 2. + 1 + <_> + + <_> + 2 14 7 4 -1. + <_> + 2 16 7 2 2. + <_> + + <_> + 13 7 7 4 -1. + <_> + 13 7 7 2 2. + 1 + <_> + + <_> + 4 6 4 12 -1. + <_> + 4 10 4 4 3. + <_> + + <_> + 8 4 6 10 -1. + <_> + 11 4 3 5 2. + <_> + 8 9 3 5 2. + <_> + + <_> + 6 8 6 10 -1. + <_> + 6 8 3 5 2. + <_> + 9 13 3 5 2. + <_> + + <_> + 11 12 6 6 -1. + <_> + 11 15 6 3 2. + <_> + + <_> + 1 15 8 3 -1. + <_> + 5 15 4 3 2. + <_> + + <_> + 6 9 10 4 -1. + <_> + 6 11 10 2 2. + <_> + + <_> + 11 5 8 3 -1. + <_> + 10 6 8 1 3. + 1 + <_> + + <_> + 0 13 22 5 -1. + <_> + 0 13 11 5 2. + <_> + + <_> + 2 13 14 3 -1. + <_> + 9 13 7 3 2. + <_> + + <_> + 11 5 2 10 -1. + <_> + 11 5 1 10 2. + 1 + <_> + + <_> + 11 5 10 2 -1. + <_> + 11 5 10 1 2. + 1 + <_> + + <_> + 14 0 8 8 -1. + <_> + 18 0 4 4 2. + <_> + 14 4 4 4 2. + <_> + + <_> + 5 0 3 10 -1. + <_> + 5 5 3 5 2. + <_> + + <_> + 16 0 3 12 -1. + <_> + 16 6 3 6 2. + <_> + + <_> + 3 3 12 4 -1. + <_> + 3 3 6 2 2. + <_> + 9 5 6 2 2. + <_> + + <_> + 2 2 20 3 -1. + <_> + 7 2 10 3 2. + <_> + + <_> + 11 7 3 8 -1. + <_> + 11 7 3 4 2. + 1 + <_> + + <_> + 4 9 18 3 -1. + <_> + 4 10 18 1 3. + <_> + + <_> + 3 3 16 14 -1. + <_> + 3 3 8 7 2. + <_> + 11 10 8 7 2. + <_> + + <_> + 7 14 8 4 -1. + <_> + 7 14 4 4 2. + <_> + + <_> + 10 7 4 7 -1. + <_> + 10 7 2 7 2. + 1 + <_> + + <_> + 11 9 6 5 -1. + <_> + 11 9 3 5 2. + <_> + + <_> + 0 6 22 4 -1. + <_> + 11 6 11 4 2. + <_> + + <_> + 14 6 6 12 -1. + <_> + 17 6 3 6 2. + <_> + 14 12 3 6 2. + <_> + + <_> + 4 14 6 4 -1. + <_> + 4 16 6 2 2. + <_> + + <_> + 12 14 6 4 -1. + <_> + 12 16 6 2 2. + <_> + + <_> + 4 14 6 4 -1. + <_> + 4 16 6 2 2. + <_> + + <_> + 10 6 6 6 -1. + <_> + 12 6 2 6 3. + <_> + + <_> + 9 0 11 3 -1. + <_> + 8 1 11 1 3. + 1 + <_> + + <_> + 7 0 12 4 -1. + <_> + 13 0 6 2 2. + <_> + 7 2 6 2 2. + <_> + + <_> + 6 6 6 6 -1. + <_> + 8 6 2 6 3. + <_> + + <_> + 15 5 3 8 -1. + <_> + 15 9 3 4 2. + <_> + + <_> + 5 2 12 7 -1. + <_> + 9 2 4 7 3. + <_> + + <_> + 5 5 12 4 -1. + <_> + 9 5 4 4 3. + <_> + + <_> + 7 3 4 7 -1. + <_> + 7 3 2 7 2. + 1 + <_> + + <_> + 2 14 6 4 -1. + <_> + 5 14 3 4 2. + <_> + + <_> + 11 4 6 6 -1. + <_> + 13 4 2 6 3. + <_> + + <_> + 5 14 12 4 -1. + <_> + 5 14 6 2 2. + <_> + 11 16 6 2 2. + <_> + + <_> + 3 12 16 6 -1. + <_> + 11 12 8 3 2. + <_> + 3 15 8 3 2. + <_> + + <_> + 1 11 20 4 -1. + <_> + 6 11 10 4 2. + <_> + + <_> + 9 0 10 10 -1. + <_> + 14 0 5 5 2. + <_> + 9 5 5 5 2. + <_> + + <_> + 8 8 4 6 -1. + <_> + 8 8 2 6 2. + 1 + <_> + + <_> + 1 7 20 11 -1. + <_> + 1 7 10 11 2. + <_> + + <_> + 9 0 12 3 -1. + <_> + 9 0 6 3 2. + 1 + <_> + + <_> + 13 0 6 6 -1. + <_> + 13 0 3 6 2. + <_> + + <_> + 5 0 12 8 -1. + <_> + 5 2 12 4 2. + <_> + + <_> + 14 0 8 6 -1. + <_> + 18 0 4 3 2. + <_> + 14 3 4 3 2. + <_> + + <_> + 7 6 8 6 -1. + <_> + 9 6 4 6 2. + <_> + + <_> + 11 3 6 6 -1. + <_> + 13 3 2 6 3. + <_> + + <_> + 5 3 6 6 -1. + <_> + 7 3 2 6 3. + <_> + + <_> + 13 0 8 6 -1. + <_> + 17 0 4 3 2. + <_> + 13 3 4 3 2. + <_> + + <_> + 0 0 8 6 -1. + <_> + 0 0 4 3 2. + <_> + 4 3 4 3 2. + <_> + + <_> + 7 0 10 6 -1. + <_> + 12 0 5 3 2. + <_> + 7 3 5 3 2. + <_> + + <_> + 0 15 22 2 -1. + <_> + 11 15 11 2 2. + <_> + + <_> + 5 14 12 4 -1. + <_> + 5 15 12 2 2. + <_> + + <_> + 5 13 6 4 -1. + <_> + 5 15 6 2 2. + <_> + + <_> + 3 9 17 3 -1. + <_> + 3 10 17 1 3. + <_> + + <_> + 3 8 16 10 -1. + <_> + 3 8 8 5 2. + <_> + 11 13 8 5 2. + <_> + + <_> + 9 0 10 6 -1. + <_> + 14 0 5 3 2. + <_> + 9 3 5 3 2. + <_> + + <_> + 3 0 12 4 -1. + <_> + 3 0 6 2 2. + <_> + 9 2 6 2 2. + <_> + + <_> + 4 10 14 3 -1. + <_> + 4 10 7 3 2. + <_> + + <_> + 1 14 11 4 -1. + <_> + 1 16 11 2 2. + <_> + + <_> + 7 0 12 6 -1. + <_> + 13 0 6 3 2. + <_> + 7 3 6 3 2. + <_> + + <_> + 3 0 10 6 -1. + <_> + 3 0 5 3 2. + <_> + 8 3 5 3 2. + <_> + + <_> + 6 0 10 3 -1. + <_> + 6 0 5 3 2. + 1 + <_> + + <_> + 14 8 6 4 -1. + <_> + 14 8 6 2 2. + 1 + <_> + + <_> + 0 2 5 16 -1. + <_> + 0 10 5 8 2. + <_> + + <_> + 0 3 22 5 -1. + <_> + 0 3 11 5 2. + <_> + + <_> + 6 15 8 3 -1. + <_> + 10 15 4 3 2. + <_> + + <_> + 15 0 2 14 -1. + <_> + 15 0 1 14 2. + 1 + <_> + + <_> + 7 0 14 2 -1. + <_> + 7 0 14 1 2. + 1 + <_> + + <_> + 1 11 20 5 -1. + <_> + 6 11 10 5 2. + <_> + + <_> + 5 3 12 9 -1. + <_> + 9 6 4 3 9. + <_> + + <_> + 10 1 12 3 -1. + <_> + 14 1 4 3 3. + <_> + + <_> + 0 1 12 3 -1. + <_> + 4 1 4 3 3. + <_> + + <_> + 14 12 4 6 -1. + <_> + 14 12 2 6 2. + <_> + + <_> + 0 10 22 7 -1. + <_> + 11 10 11 7 2. + <_> + + <_> + 11 2 4 11 -1. + <_> + 11 2 2 11 2. + 1 + <_> + + <_> + 3 14 16 4 -1. + <_> + 3 14 8 2 2. + <_> + 11 16 8 2 2. + <_> + + <_> + 12 12 6 6 -1. + <_> + 14 12 2 6 3. + <_> + + <_> + 4 12 6 6 -1. + <_> + 6 12 2 6 3. + <_> + + <_> + 11 14 6 4 -1. + <_> + 11 16 6 2 2. + <_> + + <_> + 0 0 12 4 -1. + <_> + 0 0 6 2 2. + <_> + 6 2 6 2 2. + <_> + + <_> + 15 11 4 6 -1. + <_> + 15 11 2 6 2. + <_> + + <_> + 3 11 4 6 -1. + <_> + 5 11 2 6 2. + <_> + + <_> + 18 5 4 7 -1. + <_> + 18 5 2 7 2. + 1 + <_> + + <_> + 4 5 7 4 -1. + <_> + 4 5 7 2 2. + 1 + <_> + + <_> + 9 6 12 3 -1. + <_> + 13 6 4 3 3. + <_> + + <_> + 1 6 12 3 -1. + <_> + 5 6 4 3 3. + <_> + + <_> + 0 0 22 10 -1. + <_> + 11 0 11 5 2. + <_> + 0 5 11 5 2. + <_> + + <_> + 2 4 14 3 -1. + <_> + 2 5 14 1 3. + <_> + + <_> + 13 3 8 6 -1. + <_> + 17 3 4 3 2. + <_> + 13 6 4 3 2. + <_> + + <_> + 4 14 14 4 -1. + <_> + 4 14 7 2 2. + <_> + 11 16 7 2 2. + <_> + + <_> + 11 2 4 11 -1. + <_> + 11 2 2 11 2. + 1 + <_> + + <_> + 11 2 11 4 -1. + <_> + 11 2 11 2 2. + 1 + <_> + + <_> + 10 7 12 3 -1. + <_> + 10 7 6 3 2. + <_> + + <_> + 9 7 4 6 -1. + <_> + 9 7 2 6 2. + 1 + <_> + + <_> + 3 11 16 6 -1. + <_> + 11 11 8 3 2. + <_> + 3 14 8 3 2. + <_> + + <_> + 1 3 8 6 -1. + <_> + 1 3 4 3 2. + <_> + 5 6 4 3 2. + <_> + + <_> + 5 4 12 3 -1. + <_> + 5 5 12 1 3. + <_> + + <_> + 7 14 8 4 -1. + <_> + 11 14 4 4 2. + <_> + + <_> + 7 3 15 3 -1. + <_> + 7 4 15 1 3. + <_> + + <_> + 6 8 6 4 -1. + <_> + 6 8 6 2 2. + 1 + <_> + + <_> + 10 7 12 3 -1. + <_> + 10 7 6 3 2. + <_> + + <_> + 0 7 12 3 -1. + <_> + 6 7 6 3 2. + <_> + + <_> + 7 7 9 4 -1. + <_> + 10 7 3 4 3. + <_> + + <_> + 6 2 4 16 -1. + <_> + 6 10 4 8 2. + <_> + + <_> + 8 4 6 6 -1. + <_> + 10 4 2 6 3. + <_> + + <_> + 1 11 20 3 -1. + <_> + 6 11 10 3 2. + <_> + + <_> + 14 9 6 8 -1. + <_> + 17 9 3 4 2. + <_> + 14 13 3 4 2. + <_> + + <_> + 11 0 9 4 -1. + <_> + 11 0 9 2 2. + 1 + <_> + + <_> + 11 10 6 8 -1. + <_> + 14 10 3 4 2. + <_> + 11 14 3 4 2. + <_> + + <_> + 5 16 12 2 -1. + <_> + 5 17 12 1 2. + <_> + + <_> + 5 9 14 4 -1. + <_> + 5 11 14 2 2. + <_> + + <_> + 2 9 6 8 -1. + <_> + 2 9 3 4 2. + <_> + 5 13 3 4 2. + <_> + + <_> + 15 8 6 4 -1. + <_> + 15 8 3 4 2. + <_> + + <_> + 1 8 6 4 -1. + <_> + 4 8 3 4 2. + <_> + + <_> + 13 5 8 5 -1. + <_> + 13 5 4 5 2. + 1 + <_> + + <_> + 11 5 9 2 -1. + <_> + 11 5 9 1 2. + 1 + <_> + + <_> + 12 6 9 12 -1. + <_> + 15 10 3 4 9. + <_> + + <_> + 5 10 6 8 -1. + <_> + 5 10 3 4 2. + <_> + 8 14 3 4 2. + <_> + + <_> + 9 5 5 12 -1. + <_> + 9 8 5 6 2. + <_> + + <_> + 11 5 9 2 -1. + <_> + 11 5 9 1 2. + 1 + <_> + + <_> + 5 0 15 12 -1. + <_> + 10 4 5 4 9. + <_> + + <_> + 1 13 8 5 -1. + <_> + 5 13 4 5 2. + <_> + + <_> + 14 8 6 4 -1. + <_> + 14 8 3 4 2. + 1 + <_> + + <_> + 8 8 4 6 -1. + <_> + 8 8 4 3 2. + 1 + <_> + + <_> + 7 0 12 9 -1. + <_> + 11 3 4 3 9. + <_> + + <_> + 7 13 6 4 -1. + <_> + 7 15 6 2 2. + <_> + + <_> + 10 7 6 10 -1. + <_> + 13 7 3 5 2. + <_> + 10 12 3 5 2. + <_> + + <_> + 6 7 6 10 -1. + <_> + 6 7 3 5 2. + <_> + 9 12 3 5 2. + <_> + + <_> + 7 0 12 2 -1. + <_> + 7 0 6 2 2. + <_> + + <_> + 2 0 18 9 -1. + <_> + 2 3 18 3 3. + <_> + + <_> + 12 2 6 15 -1. + <_> + 12 2 3 15 2. + <_> + + <_> + 4 2 6 15 -1. + <_> + 7 2 3 15 2. + <_> + + <_> + 7 12 12 4 -1. + <_> + 7 13 12 2 2. + <_> + + <_> + 4 4 4 14 -1. + <_> + 4 4 2 7 2. + <_> + 6 11 2 7 2. + <_> + + <_> + 12 6 9 12 -1. + <_> + 15 10 3 4 9. + <_> + + <_> + 1 6 9 12 -1. + <_> + 4 10 3 4 9. + <_> + + <_> + 13 6 8 12 -1. + <_> + 17 6 4 6 2. + <_> + 13 12 4 6 2. + <_> + + <_> + 7 14 8 3 -1. + <_> + 11 14 4 3 2. + <_> + + <_> + 5 5 12 3 -1. + <_> + 9 5 4 3 3. + <_> + + <_> + 10 0 2 18 -1. + <_> + 10 6 2 6 3. + <_> + + <_> + 4 14 14 2 -1. + <_> + 4 14 7 2 2. + <_> + + <_> + 3 0 6 4 -1. + <_> + 6 0 3 4 2. + <_> + + <_> + 13 12 6 4 -1. + <_> + 13 12 3 4 2. + <_> + + <_> + 1 0 8 4 -1. + <_> + 5 0 4 4 2. + <_> + + <_> + 7 9 14 4 -1. + <_> + 14 9 7 2 2. + <_> + 7 11 7 2 2. + <_> + + <_> + 1 0 8 18 -1. + <_> + 1 0 4 9 2. + <_> + 5 9 4 9 2. + <_> + + <_> + 13 8 6 4 -1. + <_> + 13 8 3 4 2. + 1 + <_> + + <_> + 9 8 4 6 -1. + <_> + 9 8 4 3 2. + 1 + <_> + + <_> + 3 13 6 4 -1. + <_> + 6 13 3 4 2. + <_> + + <_> + 11 4 6 7 -1. + <_> + 13 4 2 7 3. + <_> + + <_> + 6 8 6 4 -1. + <_> + 6 8 3 4 2. + 1 + <_> + + <_> + 10 7 12 5 -1. + <_> + 13 7 6 5 2. + <_> + + <_> + 3 5 12 3 -1. + <_> + 9 5 6 3 2. + <_> + + <_> + 13 5 4 6 -1. + <_> + 13 8 4 3 2. + <_> + + <_> + 5 5 4 6 -1. + <_> + 5 8 4 3 2. + <_> + + <_> + 13 12 6 6 -1. + <_> + 15 12 2 6 3. + <_> + + <_> + 10 2 4 10 -1. + <_> + 10 2 4 5 2. + 1 + <_> + + <_> + 13 12 6 6 -1. + <_> + 15 12 2 6 3. + <_> + + <_> + 3 12 6 6 -1. + <_> + 5 12 2 6 3. + <_> + + <_> + 11 12 6 6 -1. + <_> + 11 14 6 2 3. + <_> + + <_> + 5 12 8 6 -1. + <_> + 5 12 4 3 2. + <_> + 9 15 4 3 2. + <_> + + <_> + 5 11 12 6 -1. + <_> + 11 11 6 3 2. + <_> + 5 14 6 3 2. + <_> + + <_> + 0 9 22 8 -1. + <_> + 0 9 11 4 2. + <_> + 11 13 11 4 2. + <_> + + <_> + 6 9 13 3 -1. + <_> + 6 10 13 1 3. + <_> + + <_> + 0 2 8 6 -1. + <_> + 0 2 4 3 2. + <_> + 4 5 4 3 2. + <_> + + <_> + 4 9 16 3 -1. + <_> + 4 10 16 1 3. + <_> + + <_> + 4 9 12 3 -1. + <_> + 4 10 12 1 3. + <_> + + <_> + 16 2 5 16 -1. + <_> + 16 10 5 8 2. + <_> + + <_> + 6 13 7 4 -1. + <_> + 6 15 7 2 2. + <_> + + <_> + 1 7 20 8 -1. + <_> + 11 7 10 4 2. + <_> + 1 11 10 4 2. + <_> + + <_> + 5 2 12 3 -1. + <_> + 5 3 12 1 3. + <_> + + <_> + 13 13 6 4 -1. + <_> + 13 15 6 2 2. + <_> + + <_> + 1 0 5 8 -1. + <_> + 1 4 5 4 2. + <_> + + <_> + 5 0 13 8 -1. + <_> + 5 4 13 4 2. + <_> + + <_> + 9 1 4 8 -1. + <_> + 9 5 4 4 2. + <_> + + <_> + 11 2 8 8 -1. + <_> + 9 4 8 4 2. + 1 + <_> + + <_> + 11 2 8 8 -1. + <_> + 13 4 4 8 2. + 1 + <_> + + <_> + 8 0 14 4 -1. + <_> + 15 0 7 2 2. + <_> + 8 2 7 2 2. + <_> + + <_> + 0 10 12 4 -1. + <_> + 0 10 6 2 2. + <_> + 6 12 6 2 2. + <_> + + <_> + 8 0 14 4 -1. + <_> + 15 0 7 2 2. + <_> + 8 2 7 2 2. + <_> + + <_> + 3 4 16 14 -1. + <_> + 7 4 8 14 2. + <_> + + <_> + 13 13 6 4 -1. + <_> + 13 15 6 2 2. + <_> + + <_> + 3 13 6 4 -1. + <_> + 3 15 6 2 2. + <_> + + <_> + 11 5 2 10 -1. + <_> + 11 5 1 10 2. + 1 + <_> + + <_> + 11 5 10 2 -1. + <_> + 11 5 10 1 2. + 1 + <_> + + <_> + 4 0 18 4 -1. + <_> + 13 0 9 2 2. + <_> + 4 2 9 2 2. + <_> + + <_> + 6 5 4 6 -1. + <_> + 6 5 2 6 2. + 1 + <_> + + <_> + 16 6 6 6 -1. + <_> + 14 8 6 2 3. + 1 + <_> + + <_> + 6 6 6 6 -1. + <_> + 8 8 2 6 3. + 1 + <_> + + <_> + 4 0 18 12 -1. + <_> + 4 0 9 12 2. + <_> + + <_> + 0 12 8 6 -1. + <_> + 2 12 4 6 2. + <_> + + <_> + 7 12 8 6 -1. + <_> + 7 12 4 6 2. + <_> + + <_> + 7 6 3 12 -1. + <_> + 8 6 1 12 3. + <_> + + <_> + 15 5 6 6 -1. + <_> + 15 5 3 6 2. + 1 + <_> + + <_> + 2 12 8 3 -1. + <_> + 6 12 4 3 2. + <_> + + <_> + 2 6 18 3 -1. + <_> + 8 6 6 3 3. + <_> + + <_> + 0 11 22 2 -1. + <_> + 11 11 11 2 2. + <_> + + <_> + 10 14 6 4 -1. + <_> + 10 16 6 2 2. + <_> + + <_> + 3 12 6 4 -1. + <_> + 6 12 3 4 2. + <_> + + <_> + 14 0 4 12 -1. + <_> + 14 0 4 6 2. + 1 + <_> + + <_> + 5 10 6 4 -1. + <_> + 8 10 3 4 2. + <_> + + <_> + 1 12 20 6 -1. + <_> + 11 12 10 3 2. + <_> + 1 15 10 3 2. + <_> + + <_> + 5 15 12 3 -1. + <_> + 9 15 4 3 3. + <_> + + <_> + 13 1 3 10 -1. + <_> + 13 6 3 5 2. + <_> + + <_> + 9 0 10 4 -1. + <_> + 9 0 5 4 2. + 1 + <_> + + <_> + 13 1 3 10 -1. + <_> + 13 6 3 5 2. + <_> + + <_> + 6 1 3 10 -1. + <_> + 6 6 3 5 2. + <_> + + <_> + 11 4 10 4 -1. + <_> + 11 4 10 2 2. + 1 + <_> + + <_> + 0 10 20 8 -1. + <_> + 0 10 10 4 2. + <_> + 10 14 10 4 2. + <_> + + <_> + 15 11 6 7 -1. + <_> + 17 11 2 7 3. + <_> + + <_> + 4 14 9 4 -1. + <_> + 4 16 9 2 2. + <_> + + <_> + 15 0 6 8 -1. + <_> + 15 4 6 4 2. + <_> + + <_> + 1 11 6 7 -1. + <_> + 3 11 2 7 3. + <_> + + <_> + 12 6 8 4 -1. + <_> + 12 6 8 2 2. + 1 + <_> + + <_> + 11 2 6 2 -1. + <_> + 11 2 6 1 2. + 1 + <_> + + <_> + 11 0 11 8 -1. + <_> + 11 4 11 4 2. + <_> + + <_> + 0 1 22 6 -1. + <_> + 0 1 11 3 2. + <_> + 11 4 11 3 2. + <_> + + <_> + 11 6 3 12 -1. + <_> + 12 6 1 12 3. + <_> + + <_> + 0 1 14 7 -1. + <_> + 7 1 7 7 2. + <_> + + <_> + 16 8 4 6 -1. + <_> + 16 8 2 6 2. + 1 + <_> + + <_> + 1 11 20 7 -1. + <_> + 6 11 10 7 2. + <_> + + <_> + 13 12 4 6 -1. + <_> + 13 15 4 3 2. + <_> + + <_> + 0 3 13 3 -1. + <_> + 0 4 13 1 3. + <_> + + <_> + 6 3 12 3 -1. + <_> + 6 4 12 1 3. + <_> + + <_> + 0 4 22 10 -1. + <_> + 0 4 11 5 2. + <_> + 11 9 11 5 2. + <_> + + <_> + 14 3 8 4 -1. + <_> + 14 3 8 2 2. + 1 + <_> + + <_> + 5 5 12 6 -1. + <_> + 5 5 6 3 2. + <_> + 11 8 6 3 2. + <_> + + <_> + 11 6 6 6 -1. + <_> + 13 6 2 6 3. + <_> + + <_> + 9 4 4 13 -1. + <_> + 10 4 2 13 2. + <_> + + <_> + 11 3 3 13 -1. + <_> + 12 3 1 13 3. + <_> + + <_> + 9 5 4 6 -1. + <_> + 11 5 2 6 2. + <_> + + <_> + 7 2 12 15 -1. + <_> + 11 7 4 5 9. + <_> + + <_> + 3 2 12 15 -1. + <_> + 7 7 4 5 9. + <_> + + <_> + 5 2 12 12 -1. + <_> + 9 6 4 4 9. + <_> + + <_> + 8 5 4 12 -1. + <_> + 8 8 4 6 2. + <_> + + <_> + 8 9 8 7 -1. + <_> + 10 9 4 7 2. + <_> + + <_> + 6 9 8 7 -1. + <_> + 8 9 4 7 2. + <_> + + <_> + 0 4 22 14 -1. + <_> + 11 4 11 7 2. + <_> + 0 11 11 7 2. + <_> + + <_> + 2 12 18 6 -1. + <_> + 2 14 18 2 3. + <_> + + <_> + 6 5 6 5 -1. + <_> + 9 5 3 5 2. + <_> + + <_> + 11 14 9 4 -1. + <_> + 14 14 3 4 3. + <_> + + <_> + 6 14 6 4 -1. + <_> + 6 16 6 2 2. + <_> + + <_> + 15 6 6 5 -1. + <_> + 15 6 3 5 2. + 1 + <_> + + <_> + 7 6 5 6 -1. + <_> + 7 6 5 3 2. + 1 + <_> + + <_> + 13 12 8 6 -1. + <_> + 13 12 4 6 2. + <_> + + <_> + 6 10 10 8 -1. + <_> + 6 12 10 4 2. + <_> + + <_> + 2 13 18 2 -1. + <_> + 2 13 9 2 2. + <_> + + <_> + 1 15 8 3 -1. + <_> + 5 15 4 3 2. + <_> + + <_> + 14 7 6 4 -1. + <_> + 14 7 6 2 2. + 1 + <_> + + <_> + 10 0 7 2 -1. + <_> + 10 0 7 1 2. + 1 + <_> + + <_> + 17 8 4 6 -1. + <_> + 17 8 4 3 2. + 1 + <_> + + <_> + 2 0 15 9 -1. + <_> + 7 3 5 3 9. + <_> + + <_> + 9 3 4 6 -1. + <_> + 9 6 4 3 2. + <_> + + <_> + 3 0 16 12 -1. + <_> + 3 6 16 6 2. + <_> + + <_> + 11 0 3 10 -1. + <_> + 11 0 3 5 2. + 1 + <_> + + <_> + 0 3 22 14 -1. + <_> + 11 3 11 14 2. + <_> + + <_> + 10 3 6 7 -1. + <_> + 12 3 2 7 3. + <_> + + <_> + 11 1 11 4 -1. + <_> + 10 2 11 2 2. + 1 + <_> + + <_> + 14 7 6 4 -1. + <_> + 14 7 6 2 2. + 1 + <_> + + <_> + 5 5 4 12 -1. + <_> + 5 11 4 6 2. + <_> + + <_> + 2 6 20 9 -1. + <_> + 2 6 10 9 2. + <_> + + <_> + 1 9 18 3 -1. + <_> + 7 9 6 3 3. + <_> + + <_> + 11 6 6 6 -1. + <_> + 13 6 2 6 3. + <_> + + <_> + 8 13 6 4 -1. + <_> + 11 13 3 4 2. + <_> + + <_> + 10 14 6 4 -1. + <_> + 10 14 3 4 2. + <_> + + <_> + 5 6 6 6 -1. + <_> + 7 6 2 6 3. + <_> + + <_> + 15 0 3 8 -1. + <_> + 16 1 1 8 3. + 1 + <_> + + <_> + 5 8 12 3 -1. + <_> + 9 8 4 3 3. + <_> + + <_> + 2 7 18 4 -1. + <_> + 2 9 18 2 2. + <_> + + <_> + 11 1 10 4 -1. + <_> + 11 1 5 4 2. + 1 + <_> + + <_> + 15 0 3 8 -1. + <_> + 16 1 1 8 3. + 1 + <_> + + <_> + 7 0 8 3 -1. + <_> + 6 1 8 1 3. + 1 + <_> + + <_> + 10 0 12 4 -1. + <_> + 16 0 6 2 2. + <_> + 10 2 6 2 2. + <_> + + <_> + 5 2 12 3 -1. + <_> + 5 3 12 1 3. + <_> + + <_> + 8 2 14 3 -1. + <_> + 8 3 14 1 3. + <_> + + <_> + 0 0 12 4 -1. + <_> + 0 0 6 2 2. + <_> + 6 2 6 2 2. + <_> + + <_> + 8 0 14 4 -1. + <_> + 15 0 7 2 2. + <_> + 8 2 7 2 2. + <_> + + <_> + 0 5 8 6 -1. + <_> + 0 5 4 3 2. + <_> + 4 8 4 3 2. + <_> + + <_> + 14 14 6 4 -1. + <_> + 14 14 3 4 2. + <_> + + <_> + 6 12 10 4 -1. + <_> + 11 12 5 4 2. + <_> + + <_> + 14 6 6 6 -1. + <_> + 12 8 6 2 3. + 1 + <_> + + <_> + 8 6 6 6 -1. + <_> + 10 8 2 6 3. + 1 + <_> + + <_> + 2 8 6 10 -1. + <_> + 2 8 3 5 2. + <_> + 5 13 3 5 2. + <_> + + <_> + 11 3 4 9 -1. + <_> + 12 4 2 9 2. + 1 + <_> + + <_> + 2 0 12 4 -1. + <_> + 2 0 6 2 2. + <_> + 8 2 6 2 2. + <_> + + <_> + 11 5 3 9 -1. + <_> + 12 6 1 9 3. + 1 + <_> + + <_> + 11 3 9 4 -1. + <_> + 10 4 9 2 2. + 1 + <_> + + <_> + 13 13 8 5 -1. + <_> + 13 13 4 5 2. + <_> + + <_> + 1 13 8 5 -1. + <_> + 5 13 4 5 2. + <_> + + <_> + 7 13 8 3 -1. + <_> + 7 13 4 3 2. + <_> + + <_> + 8 13 6 4 -1. + <_> + 11 13 3 4 2. + <_> + + <_> + 11 7 3 8 -1. + <_> + 12 8 1 8 3. + 1 + <_> + + <_> + 5 1 6 8 -1. + <_> + 7 1 2 8 3. + <_> + + <_> + 14 14 6 4 -1. + <_> + 14 16 6 2 2. + <_> + + <_> + 11 7 8 3 -1. + <_> + 10 8 8 1 3. + 1 + <_> + + <_> + 12 3 3 12 -1. + <_> + 8 7 3 4 3. + 1 + <_> + + <_> + 8 5 5 6 -1. + <_> + 8 8 5 3 2. + <_> + + <_> + 11 3 8 4 -1. + <_> + 11 3 8 2 2. + 1 + <_> + + <_> + 7 5 8 6 -1. + <_> + 9 5 4 6 2. + <_> + + <_> + 11 4 6 6 -1. + <_> + 9 6 6 2 3. + 1 + <_> + + <_> + 11 4 6 6 -1. + <_> + 13 6 2 6 3. + 1 + <_> + + <_> + 12 8 6 4 -1. + <_> + 12 8 3 4 2. + 1 + <_> + + <_> + 5 15 8 3 -1. + <_> + 9 15 4 3 2. + <_> + + <_> + 0 5 22 13 -1. + <_> + 0 5 11 13 2. + <_> + + <_> + 2 12 9 6 -1. + <_> + 5 12 3 6 3. + <_> + + <_> + 19 1 3 10 -1. + <_> + 19 6 3 5 2. + <_> + + <_> + 5 14 12 4 -1. + <_> + 5 16 12 2 2. + <_> + + <_> + 10 14 10 4 -1. + <_> + 10 16 10 2 2. + <_> + + <_> + 1 3 14 3 -1. + <_> + 1 4 14 1 3. + <_> + + <_> + 3 14 16 4 -1. + <_> + 11 14 8 2 2. + <_> + 3 16 8 2 2. + <_> + + <_> + 0 14 6 4 -1. + <_> + 3 14 3 4 2. + <_> + + <_> + 10 1 11 4 -1. + <_> + 10 3 11 2 2. + <_> + + <_> + 1 1 11 4 -1. + <_> + 1 3 11 2 2. + <_> + + <_> + 9 3 6 6 -1. + <_> + 9 5 6 2 3. + <_> + + <_> + 4 5 12 3 -1. + <_> + 4 6 12 1 3. + <_> + + <_> + 12 0 7 6 -1. + <_> + 12 3 7 3 2. + <_> + + <_> + 1 3 16 4 -1. + <_> + 1 4 16 2 2. + <_> + + <_> + 4 9 15 3 -1. + <_> + 4 10 15 1 3. + <_> + + <_> + 2 4 18 6 -1. + <_> + 2 4 9 3 2. + <_> + 11 7 9 3 2. + <_> + + <_> + 13 5 4 13 -1. + <_> + 14 5 2 13 2. + <_> + + <_> + 4 6 6 4 -1. + <_> + 4 8 6 2 2. + <_> + + <_> + 8 7 6 5 -1. + <_> + 8 7 3 5 2. + <_> + + <_> + 10 8 4 6 -1. + <_> + 10 8 4 3 2. + 1 + <_> + + <_> + 6 12 12 4 -1. + <_> + 6 12 6 4 2. + <_> + + <_> + 3 11 10 3 -1. + <_> + 8 11 5 3 2. + <_> + + <_> + 12 2 3 12 -1. + <_> + 12 2 3 6 2. + 1 + <_> + + <_> + 0 2 14 16 -1. + <_> + 7 2 7 16 2. + <_> + + <_> + 1 5 20 4 -1. + <_> + 6 5 10 4 2. + <_> + + <_> + 0 1 18 15 -1. + <_> + 9 1 9 15 2. + <_> + + <_> + 15 2 6 8 -1. + <_> + 15 4 6 4 2. + <_> + + <_> + 4 14 13 4 -1. + <_> + 4 15 13 2 2. + <_> + + <_> + 11 2 3 12 -1. + <_> + 12 2 1 12 3. + <_> + + <_> + 0 16 15 2 -1. + <_> + 0 17 15 1 2. + <_> + + <_> + 12 14 6 4 -1. + <_> + 12 16 6 2 2. + <_> + + <_> + 5 13 12 4 -1. + <_> + 5 14 12 2 2. + <_> + + <_> + 12 12 6 6 -1. + <_> + 12 14 6 2 3. + <_> + + <_> + 0 9 15 3 -1. + <_> + 0 10 15 1 3. + <_> + + <_> + 6 9 14 3 -1. + <_> + 6 10 14 1 3. + <_> + + <_> + 4 12 7 6 -1. + <_> + 4 14 7 2 3. + <_> + + <_> + 6 6 10 6 -1. + <_> + 11 6 5 3 2. + <_> + 6 9 5 3 2. + <_> + + <_> + 3 0 16 2 -1. + <_> + 3 0 8 2 2. + 1 + <_> + + <_> + 5 9 12 9 -1. + <_> + 5 12 12 3 3. + <_> + + <_> + 6 9 10 6 -1. + <_> + 6 12 10 3 2. + <_> + + <_> + 7 4 8 6 -1. + <_> + 7 6 8 2 3. + <_> + + <_> + 6 5 3 12 -1. + <_> + 6 11 3 6 2. + <_> + + <_> + 12 12 6 6 -1. + <_> + 14 12 2 6 3. + <_> + + <_> + 6 15 8 3 -1. + <_> + 10 15 4 3 2. + <_> + + <_> + 4 13 14 4 -1. + <_> + 4 15 14 2 2. + <_> + + <_> + 10 4 11 3 -1. + <_> + 9 5 11 1 3. + 1 + <_> + + <_> + 11 4 4 9 -1. + <_> + 12 5 2 9 2. + 1 + <_> + + <_> + 0 8 13 3 -1. + <_> + 0 9 13 1 3. + <_> + + <_> + 13 2 6 10 -1. + <_> + 16 2 3 5 2. + <_> + 13 7 3 5 2. + <_> + + <_> + 3 2 6 10 -1. + <_> + 3 2 3 5 2. + <_> + 6 7 3 5 2. + <_> + + <_> + 11 2 4 11 -1. + <_> + 11 2 2 11 2. + 1 + <_> + + <_> + 4 2 12 3 -1. + <_> + 4 3 12 1 3. + <_> + + <_> + 12 1 4 12 -1. + <_> + 12 1 2 12 2. + 1 + <_> + + <_> + 11 2 11 4 -1. + <_> + 11 2 11 2 2. + 1 + <_> + + <_> + 11 0 4 9 -1. + <_> + 11 0 2 9 2. + 1 + <_> + + <_> + 11 0 9 4 -1. + <_> + 11 0 9 2 2. + 1 + <_> + + <_> + 16 2 6 10 -1. + <_> + 19 2 3 5 2. + <_> + 16 7 3 5 2. + <_> + + <_> + 11 0 6 3 -1. + <_> + 10 1 6 1 3. + 1 + <_> + + <_> + 11 0 3 8 -1. + <_> + 12 1 1 8 3. + 1 + <_> + + <_> + 11 0 8 3 -1. + <_> + 10 1 8 1 3. + 1 + <_> + + <_> + 17 1 4 12 -1. + <_> + 19 1 2 6 2. + <_> + 17 7 2 6 2. + <_> + + <_> + 8 4 6 4 -1. + <_> + 8 6 6 2 2. + <_> + + <_> + 8 5 8 5 -1. + <_> + 8 5 4 5 2. + <_> + + <_> + 8 4 6 13 -1. + <_> + 10 4 2 13 3. + <_> + + <_> + 16 3 6 8 -1. + <_> + 19 3 3 4 2. + <_> + 16 7 3 4 2. + <_> + + <_> + 0 3 6 8 -1. + <_> + 0 3 3 4 2. + <_> + 3 7 3 4 2. + <_> + + <_> + 10 9 12 4 -1. + <_> + 16 9 6 2 2. + <_> + 10 11 6 2 2. + <_> + + <_> + 1 2 9 12 -1. + <_> + 4 6 3 4 9. + <_> + + <_> + 15 12 4 6 -1. + <_> + 15 12 2 6 2. + <_> + + <_> + 5 15 12 3 -1. + <_> + 11 15 6 3 2. + <_> + + <_> + 2 16 20 2 -1. + <_> + 2 16 10 2 2. + <_> + + <_> + 1 8 10 6 -1. + <_> + 1 8 5 3 2. + <_> + 6 11 5 3 2. + <_> + + <_> + 6 3 16 14 -1. + <_> + 14 3 8 7 2. + <_> + 6 10 8 7 2. + <_> + + <_> + 1 4 6 8 -1. + <_> + 1 4 3 4 2. + <_> + 4 8 3 4 2. + <_> + + <_> + 7 2 12 4 -1. + <_> + 7 3 12 2 2. + <_> + + <_> + 1 9 6 9 -1. + <_> + 4 9 3 9 2. + <_> + + <_> + 12 14 10 4 -1. + <_> + 12 14 5 4 2. + <_> + + <_> + 2 12 12 5 -1. + <_> + 5 12 6 5 2. + <_> + + <_> + 15 12 6 6 -1. + <_> + 17 12 2 6 3. + <_> + + <_> + 1 12 6 6 -1. + <_> + 3 12 2 6 3. + <_> + + <_> + 8 12 6 6 -1. + <_> + 10 12 2 6 3. + <_> + + <_> + 5 2 12 16 -1. + <_> + 5 10 12 8 2. + <_> + + <_> + 4 2 18 14 -1. + <_> + 4 9 18 7 2. + <_> + + <_> + 5 4 12 14 -1. + <_> + 5 11 12 7 2. + <_> + + <_> + 2 5 20 8 -1. + <_> + 7 5 10 8 2. + <_> + + <_> + 8 0 10 7 -1. + <_> + 8 0 5 7 2. + 1 + <_> + + <_> + 12 0 5 8 -1. + <_> + 12 0 5 4 2. + 1 + <_> + + <_> + 7 4 6 13 -1. + <_> + 10 4 3 13 2. + <_> + + <_> + 7 14 8 4 -1. + <_> + 7 16 8 2 2. + <_> + + <_> + 8 0 3 12 -1. + <_> + 9 0 1 12 3. + <_> + + <_> + 11 6 3 12 -1. + <_> + 12 6 1 12 3. + <_> + + <_> + 4 0 3 12 -1. + <_> + 4 4 3 4 3. + <_> + + <_> + 11 3 3 15 -1. + <_> + 12 3 1 15 3. + <_> + + <_> + 5 12 7 6 -1. + <_> + 5 14 7 2 3. + <_> + + <_> + 11 6 3 12 -1. + <_> + 12 6 1 12 3. + <_> + + <_> + 8 6 3 12 -1. + <_> + 9 6 1 12 3. + <_> + + <_> + 5 16 12 2 -1. + <_> + 5 16 6 2 2. + <_> + + <_> + 1 12 20 6 -1. + <_> + 6 12 10 6 2. + <_> + + <_> + 8 11 9 4 -1. + <_> + 11 11 3 4 3. + <_> + + <_> + 5 11 9 4 -1. + <_> + 8 11 3 4 3. + <_> + + <_> + 11 6 9 12 -1. + <_> + 14 10 3 4 9. + <_> + + <_> + 2 6 9 12 -1. + <_> + 5 10 3 4 9. + <_> + + <_> + 5 9 12 2 -1. + <_> + 5 10 12 1 2. + <_> + + <_> + 0 3 16 3 -1. + <_> + 4 3 8 3 2. + <_> + + <_> + 11 6 3 12 -1. + <_> + 12 6 1 12 3. + <_> + + <_> + 0 2 14 3 -1. + <_> + 0 3 14 1 3. + <_> + + <_> + 10 2 12 3 -1. + <_> + 10 3 12 1 3. + <_> + + <_> + 5 14 12 3 -1. + <_> + 11 14 6 3 2. + <_> + + <_> + 8 13 8 3 -1. + <_> + 8 13 4 3 2. + <_> + + <_> + 9 2 4 8 -1. + <_> + 9 6 4 4 2. + <_> + + <_> + 15 1 3 11 -1. + <_> + 16 2 1 11 3. + 1 + <_> + + <_> + 8 1 10 4 -1. + <_> + 7 2 10 2 2. + 1 + <_> + + <_> + 5 5 15 3 -1. + <_> + 5 6 15 1 3. + <_> + + <_> + 5 1 9 5 -1. + <_> + 8 1 3 5 3. + <_> + + <_> + 14 0 4 18 -1. + <_> + 15 0 2 18 2. + <_> + + <_> + 6 0 5 16 -1. + <_> + 6 8 5 8 2. + <_> + + <_> + 12 4 4 8 -1. + <_> + 12 8 4 4 2. + <_> + + <_> + 11 4 10 2 -1. + <_> + 11 4 10 1 2. + 1 + <_> + + <_> + 10 0 12 3 -1. + <_> + 14 0 4 3 3. + <_> + + <_> + 0 2 20 13 -1. + <_> + 5 2 10 13 2. + <_> + + <_> + 12 4 4 8 -1. + <_> + 12 8 4 4 2. + <_> + + <_> + 6 4 4 8 -1. + <_> + 6 8 4 4 2. + <_> + + <_> + 11 6 3 12 -1. + <_> + 12 6 1 12 3. + <_> + + <_> + 8 6 3 12 -1. + <_> + 9 6 1 12 3. + <_> + + <_> + 7 1 14 2 -1. + <_> + 7 1 7 2 2. + <_> + + <_> + 4 8 14 10 -1. + <_> + 4 13 14 5 2. + <_> + + <_> + 11 14 9 4 -1. + <_> + 14 14 3 4 3. + <_> + + <_> + 1 7 17 8 -1. + <_> + 1 11 17 4 2. + <_> + + <_> + 10 12 7 6 -1. + <_> + 10 15 7 3 2. + <_> + + <_> + 10 1 8 9 -1. + <_> + 10 1 4 9 2. + 1 + <_> + + <_> + 11 2 4 11 -1. + <_> + 11 2 2 11 2. + 1 + <_> + + <_> + 6 9 4 9 -1. + <_> + 8 9 2 9 2. + <_> + + <_> + 8 3 12 4 -1. + <_> + 14 3 6 2 2. + <_> + 8 5 6 2 2. + <_> + + <_> + 5 14 7 4 -1. + <_> + 5 16 7 2 2. + <_> + + <_> + 13 0 4 13 -1. + <_> + 13 0 2 13 2. + 1 + <_> + + <_> + 9 0 13 4 -1. + <_> + 9 0 13 2 2. + 1 + <_> + + <_> + 12 9 4 9 -1. + <_> + 12 12 4 3 3. + <_> + + <_> + 7 4 12 2 -1. + <_> + 7 4 12 1 2. + 1 + <_> + + <_> + 12 5 10 6 -1. + <_> + 17 5 5 3 2. + <_> + 12 8 5 3 2. + <_> + + <_> + 1 0 17 3 -1. + <_> + 1 1 17 1 3. + <_> + + <_> + 15 4 6 8 -1. + <_> + 18 4 3 4 2. + <_> + 15 8 3 4 2. + <_> + + <_> + 3 2 4 14 -1. + <_> + 3 2 2 7 2. + <_> + 5 9 2 7 2. + <_> + + <_> + 14 8 6 4 -1. + <_> + 14 8 6 2 2. + 1 + <_> + + <_> + 8 8 4 6 -1. + <_> + 8 8 2 6 2. + 1 + <_> + + <_> + 12 1 4 16 -1. + <_> + 14 1 2 8 2. + <_> + 12 9 2 8 2. + <_> + + <_> + 7 0 6 8 -1. + <_> + 7 0 3 4 2. + <_> + 10 4 3 4 2. + <_> + + <_> + 8 12 6 5 -1. + <_> + 8 12 3 5 2. + <_> + + <_> + 7 5 6 12 -1. + <_> + 7 5 3 6 2. + <_> + 10 11 3 6 2. + <_> + + <_> + 15 5 6 6 -1. + <_> + 15 5 3 6 2. + 1 + <_> + + <_> + 6 10 3 8 -1. + <_> + 6 14 3 4 2. + <_> + + <_> + 4 0 14 3 -1. + <_> + 4 1 14 1 3. + <_> + + <_> + 0 9 8 3 -1. + <_> + 4 9 4 3 2. + <_> + + <_> + 9 3 4 6 -1. + <_> + 9 6 4 3 2. + <_> + + <_> + 3 0 10 10 -1. + <_> + 3 0 5 5 2. + <_> + 8 5 5 5 2. + <_> + + <_> + 5 13 12 4 -1. + <_> + 5 13 6 4 2. + <_> + + <_> + 6 12 10 3 -1. + <_> + 11 12 5 3 2. + <_> + + <_> + 12 15 10 3 -1. + <_> + 12 15 5 3 2. + <_> + + <_> + 0 15 10 3 -1. + <_> + 5 15 5 3 2. + <_> + + <_> + 3 0 17 14 -1. + <_> + 3 7 17 7 2. + <_> + + <_> + 9 0 4 16 -1. + <_> + 9 0 2 8 2. + <_> + 11 8 2 8 2. + <_> + + <_> + 11 4 6 8 -1. + <_> + 11 8 6 4 2. + <_> + + <_> + 0 9 12 3 -1. + <_> + 0 10 12 1 3. + <_> + + <_> + 1 5 20 8 -1. + <_> + 11 5 10 4 2. + <_> + 1 9 10 4 2. + <_> + + <_> + 1 8 13 3 -1. + <_> + 1 9 13 1 3. + <_> + + <_> + 8 8 14 3 -1. + <_> + 8 9 14 1 3. + <_> + + <_> + 4 16 14 2 -1. + <_> + 4 17 14 1 2. + <_> + + <_> + 11 1 3 6 -1. + <_> + 12 2 1 6 3. + 1 + <_> + + <_> + 11 1 6 3 -1. + <_> + 10 2 6 1 3. + 1 + <_> + + <_> + 13 1 6 10 -1. + <_> + 16 1 3 5 2. + <_> + 13 6 3 5 2. + <_> + + <_> + 11 0 10 3 -1. + <_> + 10 1 10 1 3. + 1 + <_> + + <_> + 12 1 3 12 -1. + <_> + 13 2 1 12 3. + 1 + <_> + + <_> + 10 1 12 3 -1. + <_> + 9 2 12 1 3. + 1 + <_> + + <_> + 13 1 6 10 -1. + <_> + 16 1 3 5 2. + <_> + 13 6 3 5 2. + <_> + + <_> + 3 1 6 10 -1. + <_> + 3 1 3 5 2. + <_> + 6 6 3 5 2. + <_> + + <_> + 14 7 6 10 -1. + <_> + 17 7 3 5 2. + <_> + 14 12 3 5 2. + <_> + + <_> + 3 2 6 8 -1. + <_> + 3 2 3 4 2. + <_> + 6 6 3 4 2. + <_> + + <_> + 11 14 9 4 -1. + <_> + 14 14 3 4 3. + <_> + + <_> + 1 8 15 8 -1. + <_> + 1 12 15 4 2. + <_> + + <_> + 9 12 8 4 -1. + <_> + 9 14 8 2 2. + <_> + + <_> + 6 5 7 6 -1. + <_> + 6 7 7 2 3. + <_> + + <_> + 9 5 6 5 -1. + <_> + 9 5 3 5 2. + <_> + + <_> + 0 12 8 6 -1. + <_> + 2 12 4 6 2. + <_> + + <_> + 14 8 6 4 -1. + <_> + 14 8 3 4 2. + 1 + <_> + + <_> + 8 8 4 6 -1. + <_> + 8 8 4 3 2. + 1 + <_> + + <_> + 9 4 6 8 -1. + <_> + 11 4 2 8 3. + <_> + + <_> + 7 4 6 8 -1. + <_> + 9 4 2 8 3. + <_> + + <_> + 0 15 10 3 -1. + <_> + 5 15 5 3 2. + <_> + + <_> + 11 5 3 9 -1. + <_> + 12 6 1 9 3. + 1 + <_> + + <_> + 11 5 9 3 -1. + <_> + 10 6 9 1 3. + 1 + <_> + + <_> + 12 6 8 4 -1. + <_> + 12 6 8 2 2. + 1 + <_> + + <_> + 10 6 4 8 -1. + <_> + 10 6 2 8 2. + 1 + <_> + + <_> + 13 0 5 12 -1. + <_> + 13 0 5 6 2. + 1 + <_> + + <_> + 1 3 12 4 -1. + <_> + 4 3 6 4 2. + <_> + + <_> + 15 7 6 5 -1. + <_> + 15 7 3 5 2. + <_> + + <_> + 1 7 12 3 -1. + <_> + 1 8 12 1 3. + <_> + + <_> + 15 7 6 5 -1. + <_> + 15 7 3 5 2. + <_> + + <_> + 1 7 6 5 -1. + <_> + 4 7 3 5 2. + <_> + + <_> + 12 13 6 4 -1. + <_> + 12 15 6 2 2. + <_> + + <_> + 5 12 12 6 -1. + <_> + 5 12 6 3 2. + <_> + 11 15 6 3 2. + <_> + + <_> + 11 5 2 9 -1. + <_> + 11 5 1 9 2. + 1 + <_> + + <_> + 11 5 9 2 -1. + <_> + 11 5 9 1 2. + 1 + <_> + + <_> + 10 12 9 4 -1. + <_> + 13 12 3 4 3. + <_> + + <_> + 8 6 6 6 -1. + <_> + 8 6 6 3 2. + 1 + <_> + + <_> + 10 14 6 4 -1. + <_> + 10 14 3 4 2. + <_> + + <_> + 0 2 14 3 -1. + <_> + 0 3 14 1 3. + <_> + + <_> + 8 2 12 3 -1. + <_> + 8 3 12 1 3. + <_> + + <_> + 8 7 5 6 -1. + <_> + 8 7 5 3 2. + 1 + <_> + + <_> + 12 6 8 3 -1. + <_> + 12 6 4 3 2. + 1 + <_> + + <_> + 4 10 4 6 -1. + <_> + 6 10 2 6 2. + <_> + + <_> + 1 11 20 4 -1. + <_> + 6 11 10 4 2. + <_> + + <_> + 6 10 8 7 -1. + <_> + 8 10 4 7 2. + <_> + + <_> + 11 3 3 9 -1. + <_> + 12 4 1 9 3. + 1 + <_> + + <_> + 0 8 22 4 -1. + <_> + 11 8 11 4 2. + <_> + + <_> + 3 10 16 3 -1. + <_> + 3 10 8 3 2. + <_> + + <_> + 11 3 9 3 -1. + <_> + 10 4 9 1 3. + 1 + <_> + + <_> + 5 3 12 9 -1. + <_> + 9 6 4 3 9. + <_> + + <_> + 7 12 4 6 -1. + <_> + 9 12 2 6 2. + <_> + + <_> + 9 12 6 6 -1. + <_> + 9 12 3 6 2. + <_> + + <_> + 2 13 16 5 -1. + <_> + 10 13 8 5 2. + <_> + + <_> + 12 12 8 3 -1. + <_> + 12 12 4 3 2. + <_> + + <_> + 10 4 12 2 -1. + <_> + 10 4 6 2 2. + 1 + <_> + + <_> + 11 3 8 4 -1. + <_> + 11 3 4 4 2. + 1 + <_> + + <_> + 4 6 10 3 -1. + <_> + 9 6 5 3 2. + <_> + + <_> + 10 1 6 8 -1. + <_> + 13 1 3 4 2. + <_> + 10 5 3 4 2. + <_> + + <_> + 11 1 6 6 -1. + <_> + 11 1 6 3 2. + 1 + <_> + + <_> + 11 6 6 4 -1. + <_> + 11 8 6 2 2. + <_> + + <_> + 2 2 12 3 -1. + <_> + 2 3 12 1 3. + <_> + + <_> + 11 3 8 4 -1. + <_> + 11 3 4 4 2. + 1 + <_> + + <_> + 1 0 8 6 -1. + <_> + 1 0 4 3 2. + <_> + 5 3 4 3 2. + <_> + + <_> + 8 3 14 3 -1. + <_> + 8 4 14 1 3. + <_> + + <_> + 11 3 4 8 -1. + <_> + 11 3 4 4 2. + 1 + <_> + + <_> + 6 0 12 10 -1. + <_> + 9 0 6 10 2. + <_> + + <_> + 4 16 14 2 -1. + <_> + 4 17 14 1 2. + <_> + + <_> + 10 11 12 3 -1. + <_> + 10 12 12 1 3. + <_> + + <_> + 3 0 4 6 -1. + <_> + 5 0 2 6 2. + <_> + + <_> + 16 12 6 4 -1. + <_> + 16 12 3 4 2. + <_> + + <_> + 0 13 10 4 -1. + <_> + 5 13 5 4 2. + <_> + + <_> + 3 1 16 4 -1. + <_> + 11 1 8 2 2. + <_> + 3 3 8 2 2. + <_> + + <_> + 0 1 11 4 -1. + <_> + 0 3 11 2 2. + <_> + + <_> + 6 8 11 6 -1. + <_> + 6 11 11 3 2. + <_> + + <_> + 8 5 5 10 -1. + <_> + 8 10 5 5 2. + <_> + + <_> + 9 2 4 6 -1. + <_> + 9 5 4 3 2. + <_> + + <_> + 2 3 12 6 -1. + <_> + 2 3 6 3 2. + <_> + 8 6 6 3 2. + <_> + + <_> + 13 3 7 9 -1. + <_> + 13 6 7 3 3. + <_> + + <_> + 2 3 7 9 -1. + <_> + 2 6 7 3 3. + <_> + + <_> + 11 0 3 6 -1. + <_> + 12 1 1 6 3. + 1 + <_> + + <_> + 3 3 13 3 -1. + <_> + 3 4 13 1 3. + <_> + + <_> + 8 3 14 3 -1. + <_> + 8 4 14 1 3. + <_> + + <_> + 3 6 7 12 -1. + <_> + 3 9 7 6 2. + <_> + + <_> + 12 13 6 4 -1. + <_> + 12 15 6 2 2. + <_> + + <_> + 4 13 6 4 -1. + <_> + 4 15 6 2 2. + <_> + + <_> + 6 1 15 2 -1. + <_> + 6 2 15 1 2. + <_> + + <_> + 4 3 3 12 -1. + <_> + 5 3 1 12 3. + <_> + + <_> + 14 4 2 12 -1. + <_> + 14 4 2 6 2. + 1 + <_> + + <_> + 11 0 6 3 -1. + <_> + 10 1 6 1 3. + 1 + <_> + + <_> + 4 9 14 5 -1. + <_> + 4 9 7 5 2. + <_> + + <_> + 11 2 10 3 -1. + <_> + 10 3 10 1 3. + 1 + <_> + + <_> + 9 12 7 6 -1. + <_> + 9 14 7 2 3. + <_> + + <_> + 1 8 8 10 -1. + <_> + 1 8 4 5 2. + <_> + 5 13 4 5 2. + <_> + + <_> + 5 5 12 5 -1. + <_> + 9 5 4 5 3. + <_> + + <_> + 8 8 4 6 -1. + <_> + 8 8 2 6 2. + 1 + <_> + + <_> + 7 6 8 10 -1. + <_> + 7 11 8 5 2. + <_> + + <_> + 6 14 6 4 -1. + <_> + 9 14 3 4 2. + <_> + + <_> + 5 15 12 2 -1. + <_> + 5 16 12 1 2. + <_> + + <_> + 6 4 10 6 -1. + <_> + 6 6 10 2 3. + <_> + + <_> + 9 12 8 6 -1. + <_> + 9 14 8 2 3. + <_> + + <_> + 1 11 20 5 -1. + <_> + 6 11 10 5 2. + <_> + + <_> + 10 8 8 4 -1. + <_> + 10 8 4 4 2. + <_> + + <_> + 2 4 18 6 -1. + <_> + 2 6 18 2 3. + <_> + + <_> + 8 4 12 11 -1. + <_> + 8 4 6 11 2. + <_> + + <_> + 11 5 11 2 -1. + <_> + 11 5 11 1 2. + 1 + <_> + + <_> + 3 6 18 9 -1. + <_> + 9 9 6 3 9. + <_> + + <_> + 3 2 10 9 -1. + <_> + 8 2 5 9 2. + <_> + + <_> + 14 5 6 6 -1. + <_> + 16 5 2 6 3. + <_> + + <_> + 5 5 12 6 -1. + <_> + 8 5 6 6 2. + <_> + + <_> + 11 3 10 4 -1. + <_> + 11 3 5 4 2. + 1 + <_> + + <_> + 6 3 8 6 -1. + <_> + 6 3 4 3 2. + <_> + 10 6 4 3 2. + <_> + + <_> + 16 0 3 15 -1. + <_> + 16 5 3 5 3. + <_> + + <_> + 3 0 3 15 -1. + <_> + 3 5 3 5 3. + <_> + + <_> + 5 2 12 16 -1. + <_> + 8 2 6 16 2. + <_> + + <_> + 6 8 4 6 -1. + <_> + 8 8 2 6 2. + <_> + + <_> + 5 9 13 9 -1. + <_> + 5 12 13 3 3. + <_> + + <_> + 11 7 8 3 -1. + <_> + 11 7 4 3 2. + 1 + <_> + + <_> + 7 0 9 4 -1. + <_> + 10 0 3 4 3. + <_> + + <_> + 7 6 6 5 -1. + <_> + 10 6 3 5 2. + <_> + + <_> + 2 7 18 6 -1. + <_> + 8 9 6 2 9. + <_> + + <_> + 11 4 10 3 -1. + <_> + 10 5 10 1 3. + 1 + <_> + + <_> + 13 14 8 4 -1. + <_> + 13 16 8 2 2. + <_> + + <_> + 1 14 8 4 -1. + <_> + 1 16 8 2 2. + <_> + + <_> + 11 4 3 10 -1. + <_> + 12 5 1 10 3. + 1 + <_> + + <_> + 11 4 10 3 -1. + <_> + 10 5 10 1 3. + 1 + <_> + + <_> + 2 12 18 6 -1. + <_> + 11 12 9 3 2. + <_> + 2 15 9 3 2. + <_> + + <_> + 5 2 8 6 -1. + <_> + 5 2 4 3 2. + <_> + 9 5 4 3 2. + <_> + + <_> + 8 14 6 4 -1. + <_> + 8 16 6 2 2. + <_> + + <_> + 1 10 6 8 -1. + <_> + 1 10 3 4 2. + <_> + 4 14 3 4 2. + <_> + + <_> + 7 2 15 9 -1. + <_> + 12 5 5 3 9. + <_> + + <_> + 0 2 15 9 -1. + <_> + 5 5 5 3 9. + <_> + + <_> + 10 5 6 7 -1. + <_> + 12 5 2 7 3. + <_> + + <_> + 5 14 12 4 -1. + <_> + 5 14 6 2 2. + <_> + 11 16 6 2 2. + <_> + + <_> + 10 1 12 3 -1. + <_> + 10 2 12 1 3. + <_> + + <_> + 8 1 3 12 -1. + <_> + 9 1 1 12 3. + <_> + + <_> + 14 2 6 7 -1. + <_> + 14 2 3 7 2. + <_> + + <_> + 1 0 12 9 -1. + <_> + 5 3 4 3 9. + <_> + + <_> + 8 3 7 6 -1. + <_> + 8 6 7 3 2. + <_> + + <_> + 1 12 20 3 -1. + <_> + 6 12 10 3 2. + <_> + + <_> + 5 2 12 16 -1. + <_> + 5 6 12 8 2. + <_> + + <_> + 4 3 7 6 -1. + <_> + 4 6 7 3 2. + <_> + + <_> + 9 5 6 6 -1. + <_> + 11 5 2 6 3. + <_> + + <_> + 7 0 8 2 -1. + <_> + 7 0 8 1 2. + 1 + <_> + + <_> + 5 14 12 2 -1. + <_> + 5 15 12 1 2. + <_> + + <_> + 3 11 16 6 -1. + <_> + 3 13 16 2 3. + <_> + + <_> + 11 5 3 8 -1. + <_> + 11 5 3 4 2. + 1 + <_> + + <_> + 2 15 12 3 -1. + <_> + 8 15 6 3 2. + <_> + + <_> + 4 13 15 3 -1. + <_> + 9 13 5 3 3. + <_> + + <_> + 2 3 12 4 -1. + <_> + 2 3 6 2 2. + <_> + 8 5 6 2 2. + <_> + + <_> + 17 5 4 7 -1. + <_> + 17 5 2 7 2. + 1 + <_> + + <_> + 5 4 7 4 -1. + <_> + 5 4 7 2 2. + 1 + <_> + + <_> + 2 2 18 3 -1. + <_> + 8 2 6 3 3. + <_> + + <_> + 2 2 18 9 -1. + <_> + 8 5 6 3 9. + <_> + + <_> + 15 6 6 4 -1. + <_> + 15 6 3 4 2. + <_> + + <_> + 0 1 12 3 -1. + <_> + 0 2 12 1 3. + <_> + + <_> + 16 2 6 4 -1. + <_> + 16 2 6 2 2. + 1 + <_> + + <_> + 0 9 14 6 -1. + <_> + 7 9 7 6 2. + <_> + + <_> + 13 5 8 4 -1. + <_> + 13 5 4 4 2. + 1 + <_> + + <_> + 9 5 4 8 -1. + <_> + 9 5 4 4 2. + 1 + <_> + + <_> + 12 4 3 14 -1. + <_> + 12 11 3 7 2. + <_> + + <_> + 1 13 20 5 -1. + <_> + 6 13 10 5 2. + <_> + + <_> + 12 4 3 14 -1. + <_> + 12 11 3 7 2. + <_> + + <_> + 7 4 3 14 -1. + <_> + 7 11 3 7 2. + <_> + + <_> + 16 2 6 4 -1. + <_> + 16 2 6 2 2. + 1 + <_> + + <_> + 6 2 4 6 -1. + <_> + 6 2 2 6 2. + 1 + <_> + + <_> + 7 4 15 14 -1. + <_> + 7 11 15 7 2. + <_> + + <_> + 1 16 16 2 -1. + <_> + 1 17 16 1 2. + <_> + + <_> + 0 6 12 4 -1. + <_> + 3 6 6 4 2. + <_> + + <_> + 6 9 10 9 -1. + <_> + 6 12 10 3 3. + <_> + + <_> + 0 6 6 5 -1. + <_> + 3 6 3 5 2. + <_> + + <_> + 11 14 7 4 -1. + <_> + 11 16 7 2 2. + <_> + + <_> + 7 8 8 2 -1. + <_> + 7 8 8 1 2. + 1 + <_> + + <_> + 10 13 7 4 -1. + <_> + 10 15 7 2 2. + <_> + + <_> + 1 16 20 2 -1. + <_> + 11 16 10 2 2. + <_> + + <_> + 5 12 14 4 -1. + <_> + 5 12 7 4 2. + <_> + + <_> + 8 8 4 6 -1. + <_> + 8 8 2 6 2. + 1 + <_> + + <_> + 17 2 2 14 -1. + <_> + 17 2 2 7 2. + 1 + <_> + + <_> + 7 1 8 4 -1. + <_> + 11 1 4 4 2. + <_> + + <_> + 5 7 12 3 -1. + <_> + 9 7 4 3 3. + <_> + + <_> + 2 14 6 4 -1. + <_> + 5 14 3 4 2. + <_> + + <_> + 10 9 12 4 -1. + <_> + 16 9 6 2 2. + <_> + 10 11 6 2 2. + <_> + + <_> + 6 14 9 4 -1. + <_> + 9 14 3 4 3. + <_> + + <_> + 11 9 2 6 -1. + <_> + 11 9 1 6 2. + 1 + <_> + + <_> + 3 9 14 9 -1. + <_> + 3 12 14 3 3. + <_> + + <_> + 5 10 16 6 -1. + <_> + 5 12 16 2 3. + <_> + + <_> + 5 12 10 6 -1. + <_> + 5 12 5 3 2. + <_> + 10 15 5 3 2. + <_> + + <_> + 4 13 18 5 -1. + <_> + 4 13 9 5 2. + <_> + + <_> + 0 13 18 5 -1. + <_> + 9 13 9 5 2. + <_> + + <_> + 4 9 16 3 -1. + <_> + 4 10 16 1 3. + <_> + + <_> + 5 1 15 2 -1. + <_> + 5 1 15 1 2. + 1 + <_> + + <_> + 13 5 2 9 -1. + <_> + 13 5 1 9 2. + 1 + <_> + + <_> + 9 5 9 2 -1. + <_> + 9 5 9 1 2. + 1 + <_> + + <_> + 1 11 20 5 -1. + <_> + 6 11 10 5 2. + <_> + + <_> + 3 9 13 3 -1. + <_> + 3 10 13 1 3. + <_> + + <_> + 18 5 4 12 -1. + <_> + 20 5 2 6 2. + <_> + 18 11 2 6 2. + <_> + + <_> + 4 12 5 6 -1. + <_> + 4 15 5 3 2. + <_> + + <_> + 15 1 2 8 -1. + <_> + 15 1 1 8 2. + 1 + <_> + + <_> + 7 1 8 2 -1. + <_> + 7 1 8 1 2. + 1 + <_> + + <_> + 18 5 4 12 -1. + <_> + 20 5 2 6 2. + <_> + 18 11 2 6 2. + <_> + + <_> + 10 4 10 2 -1. + <_> + 10 4 10 1 2. + 1 + <_> + + <_> + 2 4 20 4 -1. + <_> + 7 4 10 4 2. + <_> + + <_> + 1 9 8 3 -1. + <_> + 5 9 4 3 2. + <_> + + <_> + 18 5 4 12 -1. + <_> + 20 5 2 6 2. + <_> + 18 11 2 6 2. + <_> + + <_> + 0 5 4 12 -1. + <_> + 0 5 2 6 2. + <_> + 2 11 2 6 2. + <_> + + <_> + 6 0 14 18 -1. + <_> + 6 9 14 9 2. + <_> + + <_> + 4 4 12 3 -1. + <_> + 4 5 12 1 3. + <_> + + <_> + 8 4 14 3 -1. + <_> + 8 5 14 1 3. + <_> + + <_> + 4 13 14 3 -1. + <_> + 4 14 14 1 3. + <_> + + <_> + 8 2 6 14 -1. + <_> + 11 2 3 7 2. + <_> + 8 9 3 7 2. + <_> + + <_> + 0 13 15 4 -1. + <_> + 0 14 15 2 2. + <_> + + <_> + 11 14 7 4 -1. + <_> + 11 16 7 2 2. + <_> + + <_> + 11 7 7 3 -1. + <_> + 10 8 7 1 3. + 1 + <_> + + <_> + 10 6 6 6 -1. + <_> + 10 9 6 3 2. + <_> + + <_> + 2 0 4 14 -1. + <_> + 2 0 2 7 2. + <_> + 4 7 2 7 2. + <_> + + <_> + 2 6 18 5 -1. + <_> + 8 6 6 5 3. + <_> + + <_> + 2 0 18 18 -1. + <_> + 8 0 6 18 3. + <_> + + <_> + 13 1 4 8 -1. + <_> + 14 2 2 8 2. + 1 + <_> + + <_> + 4 0 12 18 -1. + <_> + 4 0 6 9 2. + <_> + 10 9 6 9 2. + <_> + + <_> + 12 14 6 4 -1. + <_> + 12 16 6 2 2. + <_> + + <_> + 4 14 6 4 -1. + <_> + 4 16 6 2 2. + <_> + + <_> + 11 8 2 6 -1. + <_> + 11 8 1 6 2. + 1 + <_> + + <_> + 1 10 20 6 -1. + <_> + 1 10 10 3 2. + <_> + 11 13 10 3 2. + <_> + + <_> + 13 1 7 9 -1. + <_> + 10 4 7 3 3. + 1 + <_> + + <_> + 5 3 4 6 -1. + <_> + 5 6 4 3 2. + <_> + + <_> + 13 0 2 12 -1. + <_> + 13 6 2 6 2. + <_> + + <_> + 7 11 8 3 -1. + <_> + 11 11 4 3 2. + <_> + + <_> + 9 6 12 11 -1. + <_> + 12 6 6 11 2. + <_> + + <_> + 6 8 10 9 -1. + <_> + 11 8 5 9 2. + <_> + + <_> + 11 14 6 4 -1. + <_> + 11 14 3 4 2. + <_> + + <_> + 3 6 12 4 -1. + <_> + 7 6 4 4 3. + <_> + + <_> + 10 5 6 7 -1. + <_> + 12 5 2 7 3. + <_> + + <_> + 8 0 6 4 -1. + <_> + 11 0 3 4 2. + <_> + + <_> + 10 6 6 12 -1. + <_> + 12 6 2 12 3. + <_> + + <_> + 6 6 6 12 -1. + <_> + 8 6 2 12 3. + <_> + + <_> + 6 9 9 6 -1. + <_> + 6 12 9 3 2. + <_> + + <_> + 14 6 6 6 -1. + <_> + 14 6 6 3 2. + 1 + <_> + + <_> + 1 13 20 5 -1. + <_> + 6 13 10 5 2. + <_> + + <_> + 8 14 6 4 -1. + <_> + 8 16 6 2 2. + <_> + + <_> + 4 7 8 3 -1. + <_> + 4 7 4 3 2. + 1 + <_> + + <_> + 16 0 2 15 -1. + <_> + 16 0 1 15 2. + 1 + <_> + + <_> + 9 3 12 2 -1. + <_> + 9 3 12 1 2. + 1 + <_> + + <_> + 7 1 8 6 -1. + <_> + 9 1 4 6 2. + <_> + + <_> + 6 15 8 3 -1. + <_> + 10 15 4 3 2. + <_> + + <_> + 8 3 6 6 -1. + <_> + 10 3 2 6 3. + <_> + + <_> + 1 1 16 3 -1. + <_> + 1 2 16 1 3. + <_> + + <_> + 9 1 12 3 -1. + <_> + 9 2 12 1 3. + <_> + + <_> + 0 0 22 6 -1. + <_> + 0 0 11 3 2. + <_> + 11 3 11 3 2. + <_> + + <_> + 10 5 4 6 -1. + <_> + 10 5 2 6 2. + <_> + + <_> + 10 0 8 5 -1. + <_> + 10 0 4 5 2. + 1 + <_> + + <_> + 12 4 4 10 -1. + <_> + 13 5 2 10 2. + 1 + <_> + + <_> + 10 4 10 4 -1. + <_> + 9 5 10 2 2. + 1 + <_> + + <_> + 15 1 2 8 -1. + <_> + 15 1 1 8 2. + 1 + <_> + + <_> + 7 1 8 2 -1. + <_> + 7 1 8 1 2. + 1 + <_> + + <_> + 17 0 3 11 -1. + <_> + 18 1 1 11 3. + 1 + <_> + + <_> + 9 8 4 6 -1. + <_> + 9 8 4 3 2. + 1 + <_> + + <_> + 14 6 6 12 -1. + <_> + 17 6 3 6 2. + <_> + 14 12 3 6 2. + <_> + + <_> + 2 12 18 6 -1. + <_> + 8 14 6 2 9. + <_> + + <_> + 14 7 3 10 -1. + <_> + 14 12 3 5 2. + <_> + + <_> + 3 8 16 10 -1. + <_> + 3 8 8 5 2. + <_> + 11 13 8 5 2. + <_> + + <_> + 15 12 4 6 -1. + <_> + 15 15 4 3 2. + <_> + + <_> + 2 8 18 10 -1. + <_> + 2 8 9 5 2. + <_> + 11 13 9 5 2. + <_> + + <_> + 10 1 12 3 -1. + <_> + 10 2 12 1 3. + <_> + + <_> + 1 1 12 3 -1. + <_> + 1 2 12 1 3. + <_> + + <_> + 8 0 14 4 -1. + <_> + 15 0 7 2 2. + <_> + 8 2 7 2 2. + <_> + + <_> + 2 4 14 4 -1. + <_> + 2 5 14 2 2. + <_> + + <_> + 8 4 12 3 -1. + <_> + 8 5 12 1 3. + <_> + + <_> + 1 0 8 8 -1. + <_> + 1 0 4 4 2. + <_> + 5 4 4 4 2. + <_> + + <_> + 13 0 8 6 -1. + <_> + 17 0 4 3 2. + <_> + 13 3 4 3 2. + <_> + + <_> + 1 0 8 6 -1. + <_> + 1 0 4 3 2. + <_> + 5 3 4 3 2. + <_> + + <_> + 9 6 6 5 -1. + <_> + 9 6 3 5 2. + <_> + + <_> + 5 6 8 3 -1. + <_> + 9 6 4 3 2. + <_> + + <_> + 13 3 6 9 -1. + <_> + 10 6 6 3 3. + 1 + <_> + + <_> + 9 3 9 6 -1. + <_> + 12 6 3 6 3. + 1 + <_> + + <_> + 4 11 18 3 -1. + <_> + 4 12 18 1 3. + <_> + + <_> + 0 13 15 4 -1. + <_> + 5 13 5 4 3. + <_> + + <_> + 15 12 4 6 -1. + <_> + 15 15 4 3 2. + <_> + + <_> + 3 12 4 6 -1. + <_> + 3 15 4 3 2. + <_> + + <_> + 9 12 6 6 -1. + <_> + 11 12 2 6 3. + <_> + + <_> + 6 9 9 7 -1. + <_> + 9 9 3 7 3. + <_> + + <_> + 13 10 6 8 -1. + <_> + 16 10 3 4 2. + <_> + 13 14 3 4 2. + <_> + + <_> + 3 10 6 8 -1. + <_> + 3 10 3 4 2. + <_> + 6 14 3 4 2. + <_> + + <_> + 7 10 8 4 -1. + <_> + 7 10 4 4 2. + <_> + + <_> + 7 5 6 11 -1. + <_> + 10 5 3 11 2. + <_> + + <_> + 10 6 6 6 -1. + <_> + 10 9 6 3 2. + <_> + + <_> + 6 6 6 6 -1. + <_> + 6 9 6 3 2. + <_> + + <_> + 8 6 12 8 -1. + <_> + 12 6 4 8 3. + <_> + + <_> + 2 11 12 3 -1. + <_> + 6 11 4 3 3. + <_> + + <_> + 14 3 6 8 -1. + <_> + 17 3 3 4 2. + <_> + 14 7 3 4 2. + <_> + + <_> + 0 5 13 3 -1. + <_> + 0 6 13 1 3. + <_> + + <_> + 14 0 6 6 -1. + <_> + 14 2 6 2 3. + <_> + + <_> + 3 0 6 6 -1. + <_> + 3 2 6 2 3. + <_> + + <_> + 8 8 14 3 -1. + <_> + 8 9 14 1 3. + <_> + + <_> + 7 2 2 15 -1. + <_> + 8 2 1 15 2. + <_> + + <_> + 4 14 16 4 -1. + <_> + 4 14 8 4 2. + <_> + + <_> + 1 6 20 12 -1. + <_> + 6 6 10 12 2. + <_> + + <_> + 5 10 16 6 -1. + <_> + 13 10 8 3 2. + <_> + 5 13 8 3 2. + <_> + + <_> + 1 10 16 6 -1. + <_> + 1 10 8 3 2. + <_> + 9 13 8 3 2. + <_> + + <_> + 8 8 14 6 -1. + <_> + 8 8 7 6 2. + <_> + + <_> + 0 8 14 6 -1. + <_> + 7 8 7 6 2. + <_> + + <_> + 5 6 12 11 -1. + <_> + 8 6 6 11 2. + <_> + + <_> + 1 3 8 6 -1. + <_> + 1 3 4 3 2. + <_> + 5 6 4 3 2. + <_> + + <_> + 13 1 7 6 -1. + <_> + 13 1 7 3 2. + 1 + <_> + + <_> + 1 4 5 10 -1. + <_> + 1 9 5 5 2. + <_> + + <_> + 18 6 3 8 -1. + <_> + 18 10 3 4 2. + <_> + + <_> + 1 6 3 8 -1. + <_> + 1 10 3 4 2. + <_> + + <_> + 8 5 13 3 -1. + <_> + 8 6 13 1 3. + <_> + + <_> + 1 5 13 3 -1. + <_> + 1 6 13 1 3. + <_> + + <_> + 18 0 3 12 -1. + <_> + 19 0 1 12 3. + <_> + + <_> + 1 0 3 12 -1. + <_> + 2 0 1 12 3. + <_> + + <_> + 4 2 18 2 -1. + <_> + 4 2 9 2 2. + <_> + + <_> + 6 3 6 6 -1. + <_> + 9 3 3 6 2. + <_> + + <_> + 9 5 12 11 -1. + <_> + 12 5 6 11 2. + <_> + + <_> + 1 5 12 11 -1. + <_> + 4 5 6 11 2. + <_> + + <_> + 8 4 8 8 -1. + <_> + 8 4 4 8 2. + <_> + + <_> + 0 8 22 4 -1. + <_> + 0 8 11 2 2. + <_> + 11 10 11 2 2. + <_> + + <_> + 8 6 8 4 -1. + <_> + 8 6 4 4 2. + <_> + + <_> + 6 3 8 8 -1. + <_> + 10 3 4 8 2. + <_> + + <_> + 3 6 16 4 -1. + <_> + 11 6 8 2 2. + <_> + 3 8 8 2 2. + <_> + + <_> + 2 14 16 4 -1. + <_> + 10 14 8 4 2. + <_> + + <_> + 11 13 6 5 -1. + <_> + 11 13 3 5 2. + <_> + + <_> + 5 13 6 5 -1. + <_> + 8 13 3 5 2. + <_> + + <_> + 12 2 2 7 -1. + <_> + 12 2 1 7 2. + 1 + <_> + + <_> + 0 9 21 9 -1. + <_> + 7 12 7 3 9. + <_> + + <_> + 5 3 12 9 -1. + <_> + 9 6 4 3 9. + <_> + + <_> + 3 9 16 8 -1. + <_> + 3 9 8 4 2. + <_> + 11 13 8 4 2. + <_> + + <_> + 7 0 14 18 -1. + <_> + 7 0 7 18 2. + <_> + + <_> + 5 8 6 4 -1. + <_> + 5 8 3 4 2. + 1 + <_> + + <_> + 3 11 16 4 -1. + <_> + 11 11 8 2 2. + <_> + 3 13 8 2 2. + <_> + + <_> + 6 9 6 8 -1. + <_> + 6 9 3 4 2. + <_> + 9 13 3 4 2. + <_> + + <_> + 7 0 14 18 -1. + <_> + 7 0 7 18 2. + <_> + + <_> + 1 0 14 18 -1. + <_> + 8 0 7 18 2. + <_> + + <_> + 13 14 8 3 -1. + <_> + 13 14 4 3 2. + <_> + + <_> + 8 4 6 4 -1. + <_> + 8 6 6 2 2. + <_> + + <_> + 6 6 14 4 -1. + <_> + 13 6 7 2 2. + <_> + 6 8 7 2 2. + <_> + + <_> + 7 3 11 4 -1. + <_> + 6 4 11 2 2. + 1 + <_> + + <_> + 7 0 12 4 -1. + <_> + 13 0 6 2 2. + <_> + 7 2 6 2 2. + <_> + + <_> + 4 0 14 4 -1. + <_> + 4 0 7 2 2. + <_> + 11 2 7 2 2. + <_> + + <_> + 15 8 6 9 -1. + <_> + 17 8 2 9 3. + <_> + + <_> + 1 8 6 9 -1. + <_> + 3 8 2 9 3. + <_> + + <_> + 12 5 5 9 -1. + <_> + 12 8 5 3 3. + <_> + + <_> + 5 5 5 9 -1. + <_> + 5 8 5 3 3. + <_> + + <_> + 17 9 4 6 -1. + <_> + 17 9 2 6 2. + <_> + + <_> + 1 9 4 6 -1. + <_> + 3 9 2 6 2. + <_> + + <_> + 4 3 14 3 -1. + <_> + 4 4 14 1 3. + <_> + + <_> + 6 0 10 3 -1. + <_> + 5 1 10 1 3. + 1 + <_> + + <_> + 10 4 11 14 -1. + <_> + 10 11 11 7 2. + <_> + + <_> + 2 5 6 6 -1. + <_> + 2 7 6 2 3. + <_> + + <_> + 12 2 5 12 -1. + <_> + 12 6 5 4 3. + <_> + + <_> + 5 16 12 2 -1. + <_> + 5 17 12 1 2. + <_> + + <_> + 3 4 18 3 -1. + <_> + 3 5 18 1 3. + <_> + + <_> + 1 4 11 14 -1. + <_> + 1 11 11 7 2. + <_> + + <_> + 8 12 11 4 -1. + <_> + 8 14 11 2 2. + <_> + + <_> + 7 11 8 7 -1. + <_> + 11 11 4 7 2. + <_> + + <_> + 12 2 4 11 -1. + <_> + 12 2 2 11 2. + 1 + <_> + + <_> + 10 4 11 2 -1. + <_> + 10 4 11 1 2. + 1 + <_> + + <_> + 16 0 2 14 -1. + <_> + 16 0 1 14 2. + 1 + <_> + + <_> + 6 0 14 2 -1. + <_> + 6 0 14 1 2. + 1 + <_> + + <_> + 19 4 2 12 -1. + <_> + 19 4 1 12 2. + 1 + <_> + + <_> + 8 2 6 10 -1. + <_> + 8 7 6 5 2. + <_> + + <_> + 19 4 2 12 -1. + <_> + 19 4 1 12 2. + 1 + <_> + + <_> + 11 3 6 8 -1. + <_> + 11 3 6 4 2. + 1 + <_> + + <_> + 11 2 10 6 -1. + <_> + 11 2 5 6 2. + 1 + <_> + + <_> + 3 5 13 2 -1. + <_> + 3 6 13 1 2. + <_> + + <_> + 5 4 12 6 -1. + <_> + 5 6 12 2 3. + <_> + + <_> + 6 9 9 9 -1. + <_> + 9 9 3 9 3. + <_> + + <_> + 19 1 3 12 -1. + <_> + 20 2 1 12 3. + 1 + <_> + + <_> + 2 13 9 5 -1. + <_> + 5 13 3 5 3. + <_> + + <_> + 11 2 10 6 -1. + <_> + 11 2 5 6 2. + 1 + <_> + + <_> + 11 2 6 10 -1. + <_> + 11 2 6 5 2. + 1 + <_> + + <_> + 1 6 21 3 -1. + <_> + 8 6 7 3 3. + <_> + + <_> + 5 5 3 8 -1. + <_> + 5 9 3 4 2. + <_> + + <_> + 10 5 7 6 -1. + <_> + 10 7 7 2 3. + <_> + + <_> + 10 0 7 6 -1. + <_> + 8 2 7 2 3. + 1 + <_> + + <_> + 13 5 6 6 -1. + <_> + 13 7 6 2 3. + <_> + + <_> + 5 5 7 6 -1. + <_> + 5 7 7 2 3. + <_> + + <_> + 9 1 6 8 -1. + <_> + 12 1 3 4 2. + <_> + 9 5 3 4 2. + <_> + + <_> + 7 1 6 8 -1. + <_> + 7 1 3 4 2. + <_> + 10 5 3 4 2. + <_> + + <_> + 7 0 9 4 -1. + <_> + 10 0 3 4 3. + <_> + + <_> + 1 9 14 3 -1. + <_> + 1 10 14 1 3. + <_> + + <_> + 5 9 15 3 -1. + <_> + 5 10 15 1 3. + <_> + + <_> + 3 1 12 3 -1. + <_> + 2 2 12 1 3. + 1 + <_> + + <_> + 5 12 12 6 -1. + <_> + 11 12 6 3 2. + <_> + 5 15 6 3 2. + <_> + + <_> + 5 12 12 4 -1. + <_> + 5 12 6 2 2. + <_> + 11 14 6 2 2. + <_> + + <_> + 15 4 3 9 -1. + <_> + 16 5 1 9 3. + 1 + <_> + + <_> + 7 4 9 3 -1. + <_> + 6 5 9 1 3. + 1 + <_> + + <_> + 13 3 7 4 -1. + <_> + 13 5 7 2 2. + <_> + + <_> + 4 0 9 5 -1. + <_> + 7 0 3 5 3. + <_> + + <_> + 10 6 6 6 -1. + <_> + 12 6 2 6 3. + <_> + + <_> + 0 6 12 4 -1. + <_> + 0 6 6 2 2. + <_> + 6 8 6 2 2. + <_> + + <_> + 10 11 9 6 -1. + <_> + 13 11 3 6 3. + <_> + + <_> + 2 6 16 8 -1. + <_> + 2 10 16 4 2. + <_> + + <_> + 17 0 2 10 -1. + <_> + 17 0 1 10 2. + 1 + <_> + + <_> + 5 0 10 2 -1. + <_> + 5 0 10 1 2. + 1 + <_> + + <_> + 9 11 13 3 -1. + <_> + 9 12 13 1 3. + <_> + + <_> + 0 11 13 3 -1. + <_> + 0 12 13 1 3. + <_> + + <_> + 18 6 4 12 -1. + <_> + 18 9 4 6 2. + <_> + + <_> + 6 4 9 7 -1. + <_> + 9 4 3 7 3. + <_> + + <_> + 11 9 6 7 -1. + <_> + 13 9 2 7 3. + <_> + + <_> + 5 9 6 7 -1. + <_> + 7 9 2 7 3. + <_> + + <_> + 1 13 20 5 -1. + <_> + 6 13 10 5 2. + <_> + + <_> + 7 9 8 6 -1. + <_> + 9 9 4 6 2. + <_> + + <_> + 5 5 12 4 -1. + <_> + 8 5 6 4 2. + <_> + + <_> + 1 11 20 6 -1. + <_> + 6 11 10 6 2. + <_> + + <_> + 1 8 20 7 -1. + <_> + 6 8 10 7 2. + <_> + + <_> + 2 9 18 6 -1. + <_> + 8 11 6 2 9. + <_> + + <_> + 8 13 9 4 -1. + <_> + 8 15 9 2 2. + <_> + + <_> + 1 12 9 6 -1. + <_> + 1 15 9 3 2. + <_> + + <_> + 9 2 8 6 -1. + <_> + 13 2 4 3 2. + <_> + 9 5 4 3 2. + <_> + + <_> + 0 5 22 5 -1. + <_> + 11 5 11 5 2. + <_> + + <_> + 2 0 18 18 -1. + <_> + 2 9 18 9 2. + <_> + + <_> + 6 7 3 8 -1. + <_> + 6 11 3 4 2. + <_> + + <_> + 11 12 8 6 -1. + <_> + 13 12 4 6 2. + <_> + + <_> + 3 8 6 8 -1. + <_> + 3 8 3 4 2. + <_> + 6 12 3 4 2. + <_> + + <_> + 11 6 7 4 -1. + <_> + 11 8 7 2 2. + <_> + + <_> + 9 2 4 6 -1. + <_> + 11 2 2 6 2. + <_> + + <_> + 3 14 16 4 -1. + <_> + 11 14 8 2 2. + <_> + 3 16 8 2 2. + <_> + + <_> + 5 14 6 4 -1. + <_> + 5 16 6 2 2. + <_> + + <_> + 9 5 4 6 -1. + <_> + 9 5 2 6 2. + <_> + + <_> + 5 12 12 6 -1. + <_> + 8 12 6 6 2. + <_> + + <_> + 7 14 8 4 -1. + <_> + 7 16 8 2 2. + <_> + + <_> + 1 3 18 3 -1. + <_> + 1 4 18 1 3. + <_> + + <_> + 8 3 14 3 -1. + <_> + 8 4 14 1 3. + <_> + + <_> + 1 0 14 4 -1. + <_> + 1 0 7 2 2. + <_> + 8 2 7 2 2. + <_> + + <_> + 10 10 12 3 -1. + <_> + 10 11 12 1 3. + <_> + + <_> + 1 10 12 3 -1. + <_> + 1 11 12 1 3. + <_> + + <_> + 10 7 8 3 -1. + <_> + 10 7 4 3 2. + <_> + + <_> + 11 0 6 6 -1. + <_> + 9 2 6 2 3. + 1 + <_> + + <_> + 17 0 2 10 -1. + <_> + 17 0 1 10 2. + 1 + <_> + + <_> + 4 7 8 3 -1. + <_> + 8 7 4 3 2. + <_> + + <_> + 13 0 8 6 -1. + <_> + 13 2 8 2 3. + <_> + + <_> + 1 0 8 6 -1. + <_> + 1 2 8 2 3. + <_> + + <_> + 17 0 2 10 -1. + <_> + 17 0 1 10 2. + 1 + <_> + + <_> + 5 0 10 2 -1. + <_> + 5 0 10 1 2. + 1 + <_> + + <_> + 10 6 6 4 -1. + <_> + 10 6 3 4 2. + <_> + + <_> + 0 4 14 3 -1. + <_> + 0 5 14 1 3. + <_> + + <_> + 3 3 16 10 -1. + <_> + 11 3 8 5 2. + <_> + 3 8 8 5 2. + <_> + + <_> + 1 5 12 3 -1. + <_> + 1 6 12 1 3. + <_> + + <_> + 9 6 13 4 -1. + <_> + 9 8 13 2 2. + <_> + + <_> + 7 5 8 6 -1. + <_> + 7 5 4 3 2. + <_> + 11 8 4 3 2. + <_> + + <_> + 13 3 4 11 -1. + <_> + 14 4 2 11 2. + 1 + <_> + + <_> + 9 2 11 2 -1. + <_> + 9 2 11 1 2. + 1 + <_> + + <_> + 5 13 12 4 -1. + <_> + 5 14 12 2 2. + <_> + + <_> + 0 9 16 4 -1. + <_> + 0 9 8 2 2. + <_> + 8 11 8 2 2. + <_> + + <_> + 7 10 9 7 -1. + <_> + 10 10 3 7 3. + <_> + + <_> + 10 7 5 6 -1. + <_> + 10 7 5 3 2. + 1 + <_> + + <_> + 11 5 10 3 -1. + <_> + 11 5 5 3 2. + 1 + <_> + + <_> + 2 13 12 5 -1. + <_> + 5 13 6 5 2. + <_> + + <_> + 17 9 4 7 -1. + <_> + 17 9 2 7 2. + <_> + + <_> + 0 6 12 3 -1. + <_> + 0 7 12 1 3. + <_> + + <_> + 18 6 2 10 -1. + <_> + 18 6 1 10 2. + 1 + <_> + + <_> + 1 14 8 3 -1. + <_> + 5 14 4 3 2. + <_> + + <_> + 6 11 12 3 -1. + <_> + 10 11 4 3 3. + <_> + + <_> + 0 14 8 3 -1. + <_> + 4 14 4 3 2. + <_> + + <_> + 5 11 16 3 -1. + <_> + 9 11 8 3 2. + <_> + + <_> + 1 9 4 7 -1. + <_> + 3 9 2 7 2. + <_> + + <_> + 6 12 10 6 -1. + <_> + 6 14 10 2 3. + <_> + + <_> + 0 16 12 2 -1. + <_> + 0 17 12 1 2. + <_> + + <_> + 12 5 4 12 -1. + <_> + 14 5 2 6 2. + <_> + 12 11 2 6 2. + <_> + + <_> + 6 11 6 6 -1. + <_> + 8 11 2 6 3. + <_> + + <_> + 4 16 15 2 -1. + <_> + 4 17 15 1 2. + <_> + + <_> + 5 0 12 9 -1. + <_> + 9 3 4 3 9. + <_> + + <_> + 8 0 6 9 -1. + <_> + 8 3 6 3 3. + <_> + + <_> + 1 0 3 13 -1. + <_> + 2 0 1 13 3. + <_> + + <_> + 10 1 6 4 -1. + <_> + 10 1 3 4 2. + <_> + + <_> + 8 1 6 9 -1. + <_> + 10 1 2 9 3. + <_> + + <_> + 8 3 6 6 -1. + <_> + 10 3 2 6 3. + <_> + + <_> + 3 5 11 2 -1. + <_> + 3 5 11 1 2. + 1 + <_> + + <_> + 9 5 6 6 -1. + <_> + 11 5 2 6 3. + <_> + + <_> + 6 4 6 10 -1. + <_> + 6 9 6 5 2. + <_> + + <_> + 11 2 3 12 -1. + <_> + 12 2 1 12 3. + <_> + + <_> + 8 2 3 12 -1. + <_> + 9 2 1 12 3. + <_> + + <_> + 18 9 4 9 -1. + <_> + 18 9 2 9 2. + <_> + + <_> + 1 5 6 6 -1. + <_> + 1 8 6 3 2. + <_> + + <_> + 10 6 6 6 -1. + <_> + 12 6 2 6 3. + <_> + + <_> + 10 2 2 12 -1. + <_> + 11 2 1 12 2. + <_> + + <_> + 11 0 5 6 -1. + <_> + 11 3 5 3 2. + <_> + + <_> + 6 0 5 6 -1. + <_> + 6 3 5 3 2. + <_> + + <_> + 13 9 5 8 -1. + <_> + 13 13 5 4 2. + <_> + + <_> + 0 9 20 2 -1. + <_> + 10 9 10 2 2. + <_> + + <_> + 14 7 3 10 -1. + <_> + 14 12 3 5 2. + <_> + + <_> + 11 5 11 2 -1. + <_> + 11 5 11 1 2. + 1 + <_> + + <_> + 14 7 3 10 -1. + <_> + 14 12 3 5 2. + <_> + + <_> + 5 13 12 2 -1. + <_> + 5 14 12 1 2. + <_> + + <_> + 11 8 4 9 -1. + <_> + 11 11 4 3 3. + <_> + + <_> + 1 8 12 6 -1. + <_> + 1 10 12 2 3. + <_> + + <_> + 16 8 3 8 -1. + <_> + 16 12 3 4 2. + <_> + + <_> + 3 8 3 8 -1. + <_> + 3 12 3 4 2. + <_> + + <_> + 11 8 4 9 -1. + <_> + 11 11 4 3 3. + <_> + + <_> + 7 8 4 9 -1. + <_> + 7 11 4 3 3. + <_> + + <_> + 7 3 15 12 -1. + <_> + 12 7 5 4 9. + <_> + + <_> + 4 10 14 4 -1. + <_> + 4 10 7 2 2. + <_> + 11 12 7 2 2. + <_> + + <_> + 9 10 10 6 -1. + <_> + 14 10 5 3 2. + <_> + 9 13 5 3 2. + <_> + + <_> + 3 10 10 6 -1. + <_> + 3 10 5 3 2. + <_> + 8 13 5 3 2. + <_> + + <_> + 16 7 6 6 -1. + <_> + 18 7 2 6 3. + <_> + + <_> + 3 5 14 2 -1. + <_> + 10 5 7 2 2. + <_> + + <_> + 18 2 4 12 -1. + <_> + 20 2 2 6 2. + <_> + 18 8 2 6 2. + <_> + + <_> + 3 14 12 4 -1. + <_> + 3 15 12 2 2. + <_> + + <_> + 7 6 9 6 -1. + <_> + 7 9 9 3 2. + <_> + + <_> + 1 14 6 4 -1. + <_> + 4 14 3 4 2. + <_> + + <_> + 12 5 5 12 -1. + <_> + 12 8 5 6 2. + <_> + + <_> + 5 0 3 17 -1. + <_> + 6 0 1 17 3. + <_> + + <_> + 16 7 6 6 -1. + <_> + 18 7 2 6 3. + <_> + + <_> + 0 7 6 6 -1. + <_> + 2 7 2 6 3. + <_> + + <_> + 14 0 3 18 -1. + <_> + 15 0 1 18 3. + <_> + + <_> + 0 5 5 10 -1. + <_> + 0 10 5 5 2. + <_> + + <_> + 5 12 12 4 -1. + <_> + 5 13 12 2 2. + <_> + + <_> + 7 9 8 6 -1. + <_> + 7 11 8 2 3. + <_> + + <_> + 2 10 15 4 -1. + <_> + 2 12 15 2 2. + <_> + + <_> + 5 15 12 3 -1. + <_> + 5 15 6 3 2. + <_> + + <_> + 7 4 3 14 -1. + <_> + 8 4 1 14 3. + <_> + + <_> + 7 15 8 3 -1. + <_> + 7 15 4 3 2. + <_> + + <_> + 1 2 8 6 -1. + <_> + 1 2 4 3 2. + <_> + 5 5 4 3 2. + <_> + + <_> + 14 9 6 8 -1. + <_> + 17 9 3 4 2. + <_> + 14 13 3 4 2. + <_> + + <_> + 0 0 6 8 -1. + <_> + 0 0 3 4 2. + <_> + 3 4 3 4 2. + <_> + + <_> + 14 9 6 8 -1. + <_> + 17 9 3 4 2. + <_> + 14 13 3 4 2. + <_> + + <_> + 2 9 6 8 -1. + <_> + 2 9 3 4 2. + <_> + 5 13 3 4 2. + <_> + + <_> + 14 10 6 8 -1. + <_> + 17 10 3 4 2. + <_> + 14 14 3 4 2. + <_> + + <_> + 2 10 6 8 -1. + <_> + 2 10 3 4 2. + <_> + 5 14 3 4 2. + <_> + + <_> + 13 1 6 8 -1. + <_> + 16 1 3 4 2. + <_> + 13 5 3 4 2. + <_> + + <_> + 3 3 12 3 -1. + <_> + 3 4 12 1 3. + <_> + + <_> + 13 1 6 8 -1. + <_> + 16 1 3 4 2. + <_> + 13 5 3 4 2. + <_> + + <_> + 3 1 6 8 -1. + <_> + 3 1 3 4 2. + <_> + 6 5 3 4 2. + <_> + + <_> + 3 3 16 3 -1. + <_> + 3 4 16 1 3. + <_> + + <_> + 7 13 6 4 -1. + <_> + 7 15 6 2 2. + <_> + + <_> + 10 14 6 4 -1. + <_> + 10 16 6 2 2. + <_> + + <_> + 2 10 15 3 -1. + <_> + 2 11 15 1 3. + <_> + + <_> + 8 12 8 6 -1. + <_> + 10 12 4 6 2. + <_> + + <_> + 2 4 13 4 -1. + <_> + 2 5 13 2 2. + <_> + + <_> + 9 9 12 3 -1. + <_> + 9 10 12 1 3. + <_> + + <_> + 3 13 16 4 -1. + <_> + 3 13 8 2 2. + <_> + 11 15 8 2 2. + <_> + + <_> + 8 12 8 6 -1. + <_> + 10 12 4 6 2. + <_> + + <_> + 6 12 8 6 -1. + <_> + 8 12 4 6 2. + <_> + + <_> + 9 4 13 2 -1. + <_> + 9 5 13 1 2. + <_> + + <_> + 7 3 8 12 -1. + <_> + 7 9 8 6 2. + <_> + + <_> + 3 6 17 3 -1. + <_> + 3 7 17 1 3. + <_> + + <_> + 3 0 14 4 -1. + <_> + 3 0 7 2 2. + <_> + 10 2 7 2 2. + <_> + + <_> + 11 4 6 5 -1. + <_> + 11 4 3 5 2. + 1 + <_> + + <_> + 11 4 5 6 -1. + <_> + 11 4 5 3 2. + 1 + <_> + + <_> + 10 5 4 6 -1. + <_> + 10 5 2 6 2. + <_> + + <_> + 4 12 12 3 -1. + <_> + 8 12 4 3 3. + <_> + + <_> + 8 6 8 7 -1. + <_> + 8 6 4 7 2. + <_> + + <_> + 5 0 8 12 -1. + <_> + 5 0 4 6 2. + <_> + 9 6 4 6 2. + <_> + + <_> + 7 0 12 4 -1. + <_> + 13 0 6 2 2. + <_> + 7 2 6 2 2. + <_> + + <_> + 1 4 6 5 -1. + <_> + 4 4 3 5 2. + <_> + + <_> + 15 0 7 4 -1. + <_> + 15 0 7 2 2. + 1 + <_> + + <_> + 5 2 8 6 -1. + <_> + 5 2 4 3 2. + <_> + 9 5 4 3 2. + <_> + + <_> + 4 2 15 3 -1. + <_> + 4 3 15 1 3. + <_> + + <_> + 4 1 14 3 -1. + <_> + 4 2 14 1 3. + <_> + + <_> + 15 5 4 6 -1. + <_> + 15 8 4 3 2. + <_> + + <_> + 0 1 17 2 -1. + <_> + 0 2 17 1 2. + <_> + + <_> + 15 5 4 6 -1. + <_> + 15 8 4 3 2. + <_> + + <_> + 3 5 4 6 -1. + <_> + 3 8 4 3 2. + <_> + + <_> + 3 0 18 3 -1. + <_> + 3 1 18 1 3. + <_> + + <_> + 7 1 6 4 -1. + <_> + 10 1 3 4 2. + <_> + + <_> + 0 11 22 7 -1. + <_> + 0 11 11 7 2. + <_> + + <_> + 3 5 4 12 -1. + <_> + 3 5 2 6 2. + <_> + 5 11 2 6 2. + <_> + + <_> + 14 7 3 10 -1. + <_> + 14 12 3 5 2. + <_> + + <_> + 4 11 14 4 -1. + <_> + 4 11 7 2 2. + <_> + 11 13 7 2 2. + <_> + + <_> + 7 11 8 6 -1. + <_> + 11 11 4 3 2. + <_> + 7 14 4 3 2. + <_> + + <_> + 3 5 3 13 -1. + <_> + 4 5 1 13 3. + <_> + + <_> + 17 1 4 12 -1. + <_> + 19 1 2 6 2. + <_> + 17 7 2 6 2. + <_> + + <_> + 1 1 4 12 -1. + <_> + 1 1 2 6 2. + <_> + 3 7 2 6 2. + <_> + + <_> + 7 0 13 16 -1. + <_> + 7 4 13 8 2. + <_> + + <_> + 1 4 13 2 -1. + <_> + 1 5 13 1 2. + <_> + + <_> + 9 14 6 4 -1. + <_> + 9 16 6 2 2. + <_> + + <_> + 2 4 17 3 -1. + <_> + 2 5 17 1 3. + <_> + + <_> + 14 0 3 10 -1. + <_> + 15 1 1 10 3. + 1 + <_> + + <_> + 7 0 8 3 -1. + <_> + 6 1 8 1 3. + 1 + <_> + + <_> + 14 0 3 10 -1. + <_> + 15 1 1 10 3. + 1 + <_> + + <_> + 8 0 10 3 -1. + <_> + 7 1 10 1 3. + 1 + <_> + + <_> + 11 1 2 7 -1. + <_> + 11 1 1 7 2. + 1 + <_> + + <_> + 8 0 3 14 -1. + <_> + 9 0 1 14 3. + <_> + + <_> + 11 1 2 7 -1. + <_> + 11 1 1 7 2. + 1 + <_> + + <_> + 11 1 7 2 -1. + <_> + 11 1 7 1 2. + 1 + <_> + + <_> + 7 9 9 8 -1. + <_> + 10 9 3 8 3. + <_> + + <_> + 1 7 4 8 -1. + <_> + 3 7 2 8 2. + <_> + + <_> + 17 11 4 6 -1. + <_> + 17 11 2 6 2. + <_> + + <_> + 8 12 6 6 -1. + <_> + 10 12 2 6 3. + <_> + + <_> + 11 0 3 6 -1. + <_> + 12 1 1 6 3. + 1 + <_> + + <_> + 11 0 6 3 -1. + <_> + 10 1 6 1 3. + 1 + <_> + + <_> + 9 14 9 4 -1. + <_> + 12 14 3 4 3. + <_> + + <_> + 8 2 6 4 -1. + <_> + 8 2 6 2 2. + 1 + <_> + + <_> + 10 10 4 6 -1. + <_> + 10 10 2 6 2. + <_> + + <_> + 1 8 18 2 -1. + <_> + 1 9 18 1 2. + <_> + + <_> + 8 8 14 3 -1. + <_> + 8 9 14 1 3. + <_> + + <_> + 3 15 14 3 -1. + <_> + 10 15 7 3 2. + <_> + + <_> + 8 8 14 3 -1. + <_> + 8 9 14 1 3. + <_> + + <_> + 4 14 9 4 -1. + <_> + 7 14 3 4 3. + <_> + + <_> + 10 6 4 8 -1. + <_> + 10 6 2 8 2. + 1 + <_> + + <_> + 2 11 18 3 -1. + <_> + 8 11 6 3 3. + <_> + + <_> + 10 0 12 4 -1. + <_> + 10 0 12 2 2. + 1 + <_> + + <_> + 6 6 16 4 -1. + <_> + 14 6 8 2 2. + <_> + 6 8 8 2 2. + <_> + + <_> + 6 3 4 14 -1. + <_> + 7 3 2 14 2. + <_> + + <_> + 12 12 6 6 -1. + <_> + 14 12 2 6 3. + <_> + + <_> + 4 12 6 6 -1. + <_> + 6 12 2 6 3. + <_> + + <_> + 14 8 3 8 -1. + <_> + 14 12 3 4 2. + <_> + + <_> + 0 6 16 4 -1. + <_> + 0 6 8 2 2. + <_> + 8 8 8 2 2. + <_> + + <_> + 9 10 5 6 -1. + <_> + 9 13 5 3 2. + <_> + + <_> + 7 5 6 12 -1. + <_> + 7 5 3 6 2. + <_> + 10 11 3 6 2. + <_> + + <_> + 1 5 21 9 -1. + <_> + 8 8 7 3 9. + <_> + + <_> + 8 6 3 12 -1. + <_> + 9 6 1 12 3. + <_> + + <_> + 11 3 3 11 -1. + <_> + 12 4 1 11 3. + 1 + <_> + + <_> + 11 5 9 3 -1. + <_> + 10 6 9 1 3. + 1 + <_> + + <_> + 12 11 6 6 -1. + <_> + 12 13 6 2 3. + <_> + + <_> + 0 1 9 9 -1. + <_> + 3 1 3 9 3. + <_> + + <_> + 6 0 12 12 -1. + <_> + 9 0 6 12 2. + <_> + + <_> + 7 14 6 4 -1. + <_> + 10 14 3 4 2. + <_> + + <_> + 8 7 13 3 -1. + <_> + 8 8 13 1 3. + <_> + + <_> + 2 13 12 4 -1. + <_> + 5 13 6 4 2. + <_> + + <_> + 15 3 2 13 -1. + <_> + 15 3 1 13 2. + 1 + <_> + + <_> + 9 5 11 2 -1. + <_> + 9 5 11 1 2. + 1 + <_> + + <_> + 13 2 2 16 -1. + <_> + 13 10 2 8 2. + <_> + + <_> + 7 2 2 16 -1. + <_> + 7 10 2 8 2. + <_> + + <_> + 14 0 7 6 -1. + <_> + 12 2 7 2 3. + 1 + <_> + + <_> + 7 3 6 12 -1. + <_> + 7 3 3 6 2. + <_> + 10 9 3 6 2. + <_> + + <_> + 9 14 8 4 -1. + <_> + 9 16 8 2 2. + <_> + + <_> + 11 3 11 3 -1. + <_> + 10 4 11 1 3. + 1 + <_> + + <_> + 11 1 4 6 -1. + <_> + 12 2 2 6 2. + 1 + <_> + + <_> + 11 1 6 4 -1. + <_> + 10 2 6 2 2. + 1 + <_> + + <_> + 10 10 6 8 -1. + <_> + 12 10 2 8 3. + <_> + + <_> + 2 4 12 4 -1. + <_> + 2 4 6 2 2. + <_> + 8 6 6 2 2. + <_> + + <_> + 14 1 3 10 -1. + <_> + 15 2 1 10 3. + 1 + <_> + + <_> + 0 7 22 7 -1. + <_> + 11 7 11 7 2. + <_> + + <_> + 8 2 14 3 -1. + <_> + 8 3 14 1 3. + <_> + + <_> + 0 2 14 3 -1. + <_> + 0 3 14 1 3. + <_> + + <_> + 14 1 3 10 -1. + <_> + 15 2 1 10 3. + 1 + <_> + + <_> + 8 1 10 3 -1. + <_> + 7 2 10 1 3. + 1 + <_> + + <_> + 12 3 3 10 -1. + <_> + 13 4 1 10 3. + 1 + <_> + + <_> + 11 4 10 3 -1. + <_> + 10 5 10 1 3. + 1 + <_> + + <_> + 12 1 7 6 -1. + <_> + 12 3 7 2 3. + <_> + + <_> + 0 3 14 3 -1. + <_> + 0 4 14 1 3. + <_> + + <_> + 8 0 12 4 -1. + <_> + 14 0 6 2 2. + <_> + 8 2 6 2 2. + <_> + + <_> + 2 0 12 4 -1. + <_> + 2 0 6 2 2. + <_> + 8 2 6 2 2. + <_> + + <_> + 8 4 12 3 -1. + <_> + 8 5 12 1 3. + <_> + + <_> + 0 1 14 2 -1. + <_> + 7 1 7 2 2. + <_> + + <_> + 5 0 15 11 -1. + <_> + 10 0 5 11 3. + <_> + + <_> + 2 0 15 11 -1. + <_> + 7 0 5 11 3. + <_> + + <_> + 11 6 6 12 -1. + <_> + 14 6 3 6 2. + <_> + 11 12 3 6 2. + <_> + + <_> + 7 5 6 6 -1. + <_> + 9 5 2 6 3. + <_> + + <_> + 14 13 6 5 -1. + <_> + 14 13 3 5 2. + <_> + + <_> + 6 10 6 8 -1. + <_> + 8 10 2 8 3. + <_> + + <_> + 10 10 6 6 -1. + <_> + 12 10 2 6 3. + <_> + + <_> + 6 10 6 6 -1. + <_> + 8 10 2 6 3. + <_> + + <_> + 6 11 14 3 -1. + <_> + 6 11 7 3 2. + <_> + + <_> + 3 1 7 6 -1. + <_> + 3 3 7 2 3. + <_> + + <_> + 11 8 6 10 -1. + <_> + 14 8 3 5 2. + <_> + 11 13 3 5 2. + <_> + + <_> + 8 5 3 13 -1. + <_> + 9 5 1 13 3. + <_> + + <_> + 11 0 6 4 -1. + <_> + 11 0 3 4 2. + 1 + <_> + + <_> + 11 0 4 6 -1. + <_> + 11 0 4 3 2. + 1 + <_> + + <_> + 14 3 2 12 -1. + <_> + 14 3 2 6 2. + 1 + <_> + + <_> + 5 4 10 7 -1. + <_> + 10 4 5 7 2. + <_> + + <_> + 8 9 6 6 -1. + <_> + 10 9 2 6 3. + <_> + + <_> + 0 8 12 9 -1. + <_> + 4 11 4 3 9. + <_> + + <_> + 13 12 4 6 -1. + <_> + 13 15 4 3 2. + <_> + + <_> + 5 12 5 6 -1. + <_> + 5 15 5 3 2. + <_> + + <_> + 12 4 2 11 -1. + <_> + 12 4 1 11 2. + 1 + <_> + + <_> + 9 4 11 2 -1. + <_> + 9 4 11 1 2. + 1 + <_> + + <_> + 11 8 6 10 -1. + <_> + 14 8 3 5 2. + <_> + 11 13 3 5 2. + <_> + + <_> + 5 8 6 10 -1. + <_> + 5 8 3 5 2. + <_> + 8 13 3 5 2. + <_> + + <_> + 11 7 6 10 -1. + <_> + 14 7 3 5 2. + <_> + 11 12 3 5 2. + <_> + + <_> + 2 1 18 3 -1. + <_> + 2 2 18 1 3. + <_> + + <_> + 16 4 6 7 -1. + <_> + 16 4 3 7 2. + <_> + + <_> + 5 7 6 10 -1. + <_> + 5 7 3 5 2. + <_> + 8 12 3 5 2. + <_> + + <_> + 12 0 3 14 -1. + <_> + 12 7 3 7 2. + <_> + + <_> + 7 10 8 7 -1. + <_> + 11 10 4 7 2. + <_> + + <_> + 8 0 12 3 -1. + <_> + 8 1 12 1 3. + <_> + + <_> + 3 0 13 4 -1. + <_> + 3 1 13 2 2. + <_> + + <_> + 7 11 12 4 -1. + <_> + 7 12 12 2 2. + <_> + + <_> + 0 0 8 18 -1. + <_> + 4 0 4 18 2. + <_> + + <_> + 14 13 6 5 -1. + <_> + 14 13 3 5 2. + <_> + + <_> + 0 5 22 4 -1. + <_> + 11 5 11 4 2. + <_> + + <_> + 11 2 10 9 -1. + <_> + 11 5 10 3 3. + <_> + + <_> + 1 2 10 9 -1. + <_> + 1 5 10 3 3. + <_> + + <_> + 18 6 2 12 -1. + <_> + 18 6 1 12 2. + <_> + + <_> + 2 6 2 12 -1. + <_> + 3 6 1 12 2. + <_> + + <_> + 15 6 4 12 -1. + <_> + 15 9 4 6 2. + <_> + + <_> + 3 6 4 12 -1. + <_> + 3 9 4 6 2. + <_> + + <_> + 14 13 6 5 -1. + <_> + 14 13 3 5 2. + <_> + + <_> + 2 13 6 5 -1. + <_> + 5 13 3 5 2. + <_> + + <_> + 8 12 12 5 -1. + <_> + 11 12 6 5 2. + <_> + + <_> + 2 12 12 5 -1. + <_> + 5 12 6 5 2. + <_> + + <_> + 12 12 6 6 -1. + <_> + 12 14 6 2 3. + <_> + + <_> + 0 10 16 8 -1. + <_> + 4 10 8 8 2. + <_> + + <_> + 13 1 8 8 -1. + <_> + 15 1 4 8 2. + <_> + + <_> + 1 1 8 8 -1. + <_> + 3 1 4 8 2. + <_> + + <_> + 14 8 3 8 -1. + <_> + 14 12 3 4 2. + <_> + + <_> + 10 4 7 6 -1. + <_> + 10 4 7 3 2. + 1 + <_> + + <_> + 9 10 4 8 -1. + <_> + 9 14 4 4 2. + <_> + + <_> + 5 8 3 8 -1. + <_> + 5 12 3 4 2. + <_> + + <_> + 6 9 4 9 -1. + <_> + 6 12 4 3 3. + <_> + + <_> + 6 3 16 4 -1. + <_> + 14 3 8 2 2. + <_> + 6 5 8 2 2. + <_> + + <_> + 1 3 20 4 -1. + <_> + 1 3 10 2 2. + <_> + 11 5 10 2 2. + <_> + + <_> + 9 5 6 12 -1. + <_> + 12 5 3 6 2. + <_> + 9 11 3 6 2. + <_> + + <_> + 1 6 2 12 -1. + <_> + 2 6 1 12 2. + <_> + + <_> + 19 0 2 16 -1. + <_> + 19 0 1 16 2. + <_> + + <_> + 1 0 2 16 -1. + <_> + 2 0 1 16 2. + <_> + + <_> + 13 5 5 9 -1. + <_> + 13 8 5 3 3. + <_> + + <_> + 5 16 12 2 -1. + <_> + 5 17 12 1 2. + <_> + + <_> + 5 14 12 4 -1. + <_> + 5 15 12 2 2. + <_> + + <_> + 5 3 12 9 -1. + <_> + 9 6 4 3 9. + <_> + + <_> + 7 5 13 2 -1. + <_> + 7 6 13 1 2. + <_> + + <_> + 8 1 12 2 -1. + <_> + 8 1 12 1 2. + 1 + <_> + + <_> + 0 4 22 8 -1. + <_> + 11 4 11 4 2. + <_> + 0 8 11 4 2. + <_> + + <_> + 2 3 6 4 -1. + <_> + 5 3 3 4 2. + <_> + + <_> + 7 11 15 3 -1. + <_> + 7 12 15 1 3. + <_> + + <_> + 5 7 6 7 -1. + <_> + 8 7 3 7 2. + <_> + + <_> + 7 12 12 4 -1. + <_> + 13 12 6 2 2. + <_> + 7 14 6 2 2. + <_> + + <_> + 0 11 16 2 -1. + <_> + 8 11 8 2 2. + <_> + + <_> + 18 3 4 10 -1. + <_> + 18 3 4 5 2. + 1 + <_> + + <_> + 2 2 17 3 -1. + <_> + 2 3 17 1 3. + <_> + + <_> + 10 14 12 4 -1. + <_> + 16 14 6 2 2. + <_> + 10 16 6 2 2. + <_> + + <_> + 1 9 11 6 -1. + <_> + 1 11 11 2 3. + <_> + + <_> + 4 9 18 3 -1. + <_> + 4 10 18 1 3. + <_> + + <_> + 0 9 18 3 -1. + <_> + 0 10 18 1 3. + <_> + + <_> + 11 5 11 12 -1. + <_> + 11 11 11 6 2. + <_> + + <_> + 5 12 6 6 -1. + <_> + 5 14 6 2 3. + <_> + + <_> + 14 10 6 8 -1. + <_> + 17 10 3 4 2. + <_> + 14 14 3 4 2. + <_> + + <_> + 0 5 11 12 -1. + <_> + 0 11 11 6 2. + <_> + + <_> + 15 3 2 12 -1. + <_> + 15 3 2 6 2. + 1 + <_> + + <_> + 3 0 12 4 -1. + <_> + 3 0 6 2 2. + <_> + 9 2 6 2 2. + <_> + + <_> + 14 10 6 8 -1. + <_> + 17 10 3 4 2. + <_> + 14 14 3 4 2. + <_> + + <_> + 5 12 8 6 -1. + <_> + 5 12 4 3 2. + <_> + 9 15 4 3 2. + <_> + + <_> + 8 11 10 5 -1. + <_> + 8 11 5 5 2. + <_> + + <_> + 4 11 10 5 -1. + <_> + 9 11 5 5 2. + <_> + + <_> + 6 6 12 12 -1. + <_> + 12 6 6 6 2. + <_> + 6 12 6 6 2. + <_> + + <_> + 7 10 6 8 -1. + <_> + 7 12 6 4 2. + <_> + + <_> + 7 8 15 10 -1. + <_> + 7 13 15 5 2. + <_> + + <_> + 0 0 22 4 -1. + <_> + 0 0 11 2 2. + <_> + 11 2 11 2 2. + <_> + + <_> + 10 3 12 3 -1. + <_> + 10 4 12 1 3. + <_> + + <_> + 0 3 13 3 -1. + <_> + 0 4 13 1 3. + <_> + + <_> + 9 3 4 12 -1. + <_> + 9 6 4 6 2. + <_> + + <_> + 4 5 9 6 -1. + <_> + 4 8 9 3 2. + <_> + + <_> + 11 6 2 9 -1. + <_> + 11 6 1 9 2. + 1 + <_> + + <_> + 9 2 4 8 -1. + <_> + 9 6 4 4 2. + <_> + + <_> + 7 0 8 10 -1. + <_> + 7 5 8 5 2. + <_> + + <_> + 11 5 9 2 -1. + <_> + 11 5 9 1 2. + 1 + <_> + + <_> + 17 0 3 11 -1. + <_> + 18 1 1 11 3. + 1 + <_> + + <_> + 5 0 11 3 -1. + <_> + 4 1 11 1 3. + 1 + <_> + + <_> + 9 6 4 7 -1. + <_> + 9 6 2 7 2. + <_> + + <_> + 3 11 6 6 -1. + <_> + 3 13 6 2 3. + <_> + + <_> + 6 10 16 8 -1. + <_> + 6 12 16 4 2. + <_> + + <_> + 11 6 9 3 -1. + <_> + 10 7 9 1 3. + 1 + <_> + + <_> + 12 11 8 6 -1. + <_> + 12 13 8 2 3. + <_> + + <_> + 0 10 16 8 -1. + <_> + 0 12 16 4 2. + <_> + + <_> + 10 14 12 4 -1. + <_> + 16 14 6 2 2. + <_> + 10 16 6 2 2. + <_> + + <_> + 2 11 8 6 -1. + <_> + 2 13 8 2 3. + <_> + + <_> + 6 11 16 4 -1. + <_> + 14 11 8 2 2. + <_> + 6 13 8 2 2. + <_> + + <_> + 0 11 22 6 -1. + <_> + 11 11 11 6 2. + <_> + + <_> + 14 10 6 8 -1. + <_> + 17 10 3 4 2. + <_> + 14 14 3 4 2. + <_> + + <_> + 2 10 6 8 -1. + <_> + 2 10 3 4 2. + <_> + 5 14 3 4 2. + <_> + + <_> + 6 4 15 12 -1. + <_> + 11 8 5 4 9. + <_> + + <_> + 0 4 18 12 -1. + <_> + 6 8 6 4 9. + <_> + + <_> + 15 7 2 8 -1. + <_> + 15 7 1 8 2. + 1 + <_> + + <_> + 3 3 10 3 -1. + <_> + 2 4 10 1 3. + 1 + <_> + + <_> + 4 2 14 3 -1. + <_> + 4 3 14 1 3. + <_> + + <_> + 10 8 8 2 -1. + <_> + 10 8 8 1 2. + 1 + <_> + + <_> + 15 5 4 7 -1. + <_> + 15 5 2 7 2. + 1 + <_> + + <_> + 3 6 5 6 -1. + <_> + 3 9 5 3 2. + <_> + + <_> + 14 1 8 6 -1. + <_> + 18 1 4 3 2. + <_> + 14 4 4 3 2. + <_> + + <_> + 0 1 8 6 -1. + <_> + 0 1 4 3 2. + <_> + 4 4 4 3 2. + <_> + + <_> + 17 0 4 12 -1. + <_> + 18 0 2 12 2. + <_> + + <_> + 1 0 4 12 -1. + <_> + 2 0 2 12 2. + <_> + + <_> + 9 16 12 2 -1. + <_> + 9 17 12 1 2. + <_> + + <_> + 1 16 12 2 -1. + <_> + 1 17 12 1 2. + <_> + + <_> + 10 15 12 3 -1. + <_> + 10 16 12 1 3. + <_> + + <_> + 0 15 12 3 -1. + <_> + 0 16 12 1 3. + <_> + + <_> + 10 14 12 4 -1. + <_> + 16 14 6 2 2. + <_> + 10 16 6 2 2. + <_> + + <_> + 0 14 12 4 -1. + <_> + 0 14 6 2 2. + <_> + 6 16 6 2 2. + <_> + + <_> + 9 11 12 4 -1. + <_> + 15 11 6 2 2. + <_> + 9 13 6 2 2. + <_> + + <_> + 0 11 16 4 -1. + <_> + 0 11 8 2 2. + <_> + 8 13 8 2 2. + <_> + + <_> + 8 12 9 6 -1. + <_> + 8 14 9 2 3. + <_> + + <_> + 5 12 9 6 -1. + <_> + 5 14 9 2 3. + <_> + + <_> + 4 5 16 2 -1. + <_> + 4 5 8 2 2. + <_> + + <_> + 1 10 10 8 -1. + <_> + 1 10 5 4 2. + <_> + 6 14 5 4 2. + <_> + + <_> + 16 2 5 9 -1. + <_> + 13 5 5 3 3. + 1 + <_> + + <_> + 4 4 4 6 -1. + <_> + 6 4 2 6 2. + <_> + + <_> + 9 2 9 7 -1. + <_> + 12 2 3 7 3. + <_> + + <_> + 4 2 9 7 -1. + <_> + 7 2 3 7 3. + <_> + + <_> + 16 2 5 9 -1. + <_> + 13 5 5 3 3. + 1 + <_> + + <_> + 6 2 9 5 -1. + <_> + 9 5 3 5 3. + 1 + <_> + + <_> + 5 12 14 6 -1. + <_> + 5 14 14 2 3. + <_> + + <_> + 6 4 4 12 -1. + <_> + 6 4 2 6 2. + <_> + 8 10 2 6 2. + <_> + + <_> + 9 4 10 8 -1. + <_> + 9 4 5 8 2. + <_> + + <_> + 7 5 6 8 -1. + <_> + 7 5 3 4 2. + <_> + 10 9 3 4 2. + <_> + + <_> + 8 7 6 8 -1. + <_> + 11 7 3 4 2. + <_> + 8 11 3 4 2. + <_> + + <_> + 2 4 11 2 -1. + <_> + 2 4 11 1 2. + 1 + <_> + + <_> + 16 0 3 13 -1. + <_> + 17 0 1 13 3. + <_> + + <_> + 2 0 18 3 -1. + <_> + 2 1 18 1 3. + <_> + + <_> + 15 8 6 4 -1. + <_> + 15 8 3 4 2. + <_> + + <_> + 2 0 13 3 -1. + <_> + 2 1 13 1 3. + <_> + + <_> + 4 4 18 4 -1. + <_> + 4 6 18 2 2. + <_> + + <_> + 3 3 10 9 -1. + <_> + 8 3 5 9 2. + <_> + + <_> + 2 7 18 6 -1. + <_> + 8 9 6 2 9. + <_> + + <_> + 10 4 11 2 -1. + <_> + 10 4 11 1 2. + 1 + <_> + + <_> + 14 6 6 12 -1. + <_> + 17 6 3 6 2. + <_> + 14 12 3 6 2. + <_> + + <_> + 2 6 6 12 -1. + <_> + 2 6 3 6 2. + <_> + 5 12 3 6 2. + <_> + + <_> + 3 4 16 6 -1. + <_> + 3 6 16 2 3. + <_> + + <_> + 1 11 16 3 -1. + <_> + 5 11 8 3 2. + <_> + + <_> + 12 10 8 3 -1. + <_> + 12 10 4 3 2. + <_> + + <_> + 0 9 17 9 -1. + <_> + 0 12 17 3 3. + <_> + + <_> + 8 4 6 10 -1. + <_> + 11 4 3 5 2. + <_> + 8 9 3 5 2. + <_> + + <_> + 2 4 16 8 -1. + <_> + 2 4 8 4 2. + <_> + 10 8 8 4 2. + <_> + + <_> + 9 6 12 4 -1. + <_> + 15 6 6 2 2. + <_> + 9 8 6 2 2. + <_> + + <_> + 9 3 4 6 -1. + <_> + 9 6 4 3 2. + <_> + + <_> + 15 5 7 4 -1. + <_> + 15 5 7 2 2. + 1 + <_> + + <_> + 0 6 18 6 -1. + <_> + 0 6 9 3 2. + <_> + 9 9 9 3 2. + <_> + + <_> + 4 2 15 3 -1. + <_> + 4 3 15 1 3. + <_> + + <_> + 2 0 6 6 -1. + <_> + 5 0 3 6 2. + <_> + + <_> + 13 4 8 6 -1. + <_> + 17 4 4 3 2. + <_> + 13 7 4 3 2. + <_> + + <_> + 4 2 13 6 -1. + <_> + 4 4 13 2 3. + <_> + + <_> + 9 8 12 3 -1. + <_> + 9 9 12 1 3. + <_> + + <_> + 1 8 16 3 -1. + <_> + 1 9 16 1 3. + <_> + + <_> + 11 4 5 8 -1. + <_> + 11 8 5 4 2. + <_> + + <_> + 3 4 11 2 -1. + <_> + 3 4 11 1 2. + 1 + <_> + + <_> + 10 7 12 3 -1. + <_> + 10 8 12 1 3. + <_> + + <_> + 9 3 7 8 -1. + <_> + 9 3 7 4 2. + 1 + <_> + + <_> + 13 2 2 12 -1. + <_> + 13 2 2 6 2. + 1 + <_> + + <_> + 0 9 12 4 -1. + <_> + 0 9 6 2 2. + <_> + 6 11 6 2 2. + <_> + + <_> + 11 7 8 6 -1. + <_> + 13 7 4 6 2. + <_> + + <_> + 0 8 6 6 -1. + <_> + 2 8 2 6 3. + <_> + + <_> + 11 7 8 6 -1. + <_> + 13 7 4 6 2. + <_> + + <_> + 3 7 8 6 -1. + <_> + 5 7 4 6 2. + <_> + + <_> + 10 6 6 4 -1. + <_> + 10 6 3 4 2. + <_> + + <_> + 4 8 12 10 -1. + <_> + 4 8 6 5 2. + <_> + 10 13 6 5 2. + <_> + + <_> + 15 7 6 10 -1. + <_> + 17 7 2 10 3. + <_> + + <_> + 6 14 6 4 -1. + <_> + 9 14 3 4 2. + <_> + + <_> + 8 13 10 4 -1. + <_> + 8 13 5 4 2. + <_> + + <_> + 2 0 4 18 -1. + <_> + 4 0 2 18 2. + <_> + + <_> + 11 0 8 10 -1. + <_> + 11 0 8 5 2. + 1 + <_> + + <_> + 0 7 12 3 -1. + <_> + 0 8 12 1 3. + <_> + + <_> + 17 0 2 10 -1. + <_> + 17 0 1 10 2. + 1 + <_> + + <_> + 5 6 6 4 -1. + <_> + 5 8 6 2 2. + <_> + + <_> + 15 10 7 6 -1. + <_> + 15 12 7 2 3. + <_> + + <_> + 0 10 7 6 -1. + <_> + 0 12 7 2 3. + <_> + + <_> + 13 12 6 6 -1. + <_> + 15 12 2 6 3. + <_> + + <_> + 1 11 20 7 -1. + <_> + 11 11 10 7 2. + <_> + + <_> + 13 5 4 9 -1. + <_> + 13 8 4 3 3. + <_> + + <_> + 2 12 8 6 -1. + <_> + 2 12 4 3 2. + <_> + 6 15 4 3 2. + <_> + + <_> + 9 14 6 4 -1. + <_> + 9 16 6 2 2. + <_> + + <_> + 7 12 8 6 -1. + <_> + 7 12 4 3 2. + <_> + 11 15 4 3 2. + <_> + + <_> + 6 1 12 14 -1. + <_> + 12 1 6 7 2. + <_> + 6 8 6 7 2. + <_> + + <_> + 5 5 4 9 -1. + <_> + 5 8 4 3 3. + <_> + + <_> + 5 13 12 4 -1. + <_> + 11 13 6 2 2. + <_> + 5 15 6 2 2. + <_> + + <_> + 9 7 8 3 -1. + <_> + 8 8 8 1 3. + 1 + <_> + + <_> + 7 5 8 10 -1. + <_> + 7 10 8 5 2. + <_> + + <_> + 7 1 8 3 -1. + <_> + 6 2 8 1 3. + 1 + <_> + + <_> + 10 14 12 3 -1. + <_> + 10 15 12 1 3. + <_> + + <_> + 0 6 18 12 -1. + <_> + 0 12 18 6 2. + <_> + + <_> + 9 8 6 6 -1. + <_> + 9 11 6 3 2. + <_> + + <_> + 3 2 4 12 -1. + <_> + 3 2 2 6 2. + <_> + 5 8 2 6 2. + <_> + + <_> + 13 2 2 12 -1. + <_> + 13 2 2 6 2. + 1 + <_> + + <_> + 2 4 6 8 -1. + <_> + 2 4 3 4 2. + <_> + 5 8 3 4 2. + <_> + + <_> + 14 10 4 6 -1. + <_> + 14 10 2 6 2. + <_> + + <_> + 0 0 2 12 -1. + <_> + 0 6 2 6 2. + <_> + + <_> + 13 2 2 12 -1. + <_> + 13 2 2 6 2. + 1 + <_> + + <_> + 9 2 12 2 -1. + <_> + 9 2 6 2 2. + 1 + <_> + + <_> + 10 9 12 4 -1. + <_> + 16 9 6 2 2. + <_> + 10 11 6 2 2. + <_> + + <_> + 0 9 12 4 -1. + <_> + 0 9 6 2 2. + <_> + 6 11 6 2 2. + <_> + + <_> + 17 9 4 9 -1. + <_> + 17 12 4 3 3. + <_> + + <_> + 1 9 10 6 -1. + <_> + 1 9 5 3 2. + <_> + 6 12 5 3 2. + <_> + + <_> + 8 12 9 4 -1. + <_> + 8 14 9 2 2. + <_> + + <_> + 2 8 6 10 -1. + <_> + 2 8 3 5 2. + <_> + 5 13 3 5 2. + <_> + + <_> + 7 10 12 6 -1. + <_> + 10 10 6 6 2. + <_> + + <_> + 3 10 12 6 -1. + <_> + 6 10 6 6 2. + <_> + + <_> + 20 0 2 12 -1. + <_> + 20 6 2 6 2. + <_> + + <_> + 0 0 2 12 -1. + <_> + 0 6 2 6 2. + <_> + + <_> + 14 3 4 15 -1. + <_> + 14 3 2 15 2. + <_> + + <_> + 0 1 16 14 -1. + <_> + 0 1 8 7 2. + <_> + 8 8 8 7 2. + <_> + + <_> + 11 0 8 10 -1. + <_> + 11 0 8 5 2. + 1 + <_> + + <_> + 0 3 16 4 -1. + <_> + 0 3 8 2 2. + <_> + 8 5 8 2 2. + <_> + + <_> + 13 0 7 12 -1. + <_> + 13 4 7 4 3. + <_> + + <_> + 5 3 11 15 -1. + <_> + 5 8 11 5 3. + <_> + + <_> + 13 0 7 12 -1. + <_> + 13 4 7 4 3. + <_> + + <_> + 2 0 7 12 -1. + <_> + 2 4 7 4 3. + <_> + + <_> + 4 5 18 12 -1. + <_> + 10 9 6 4 9. + <_> + + <_> + 4 7 14 6 -1. + <_> + 4 7 7 3 2. + <_> + 11 10 7 3 2. + <_> + + <_> + 7 9 13 3 -1. + <_> + 7 10 13 1 3. + <_> + + <_> + 2 9 13 3 -1. + <_> + 2 10 13 1 3. + <_> + + <_> + 5 9 17 3 -1. + <_> + 5 10 17 1 3. + <_> + + <_> + 1 1 10 9 -1. + <_> + 1 4 10 3 3. + <_> + + <_> + 4 1 16 8 -1. + <_> + 4 3 16 4 2. + <_> + + <_> + 6 5 6 12 -1. + <_> + 8 5 2 12 3. + <_> + + <_> + 11 7 6 5 -1. + <_> + 11 7 3 5 2. + 1 + <_> + + <_> + 5 4 9 5 -1. + <_> + 8 4 3 5 3. + <_> + + <_> + 2 12 18 4 -1. + <_> + 11 12 9 2 2. + <_> + 2 14 9 2 2. + <_> + + <_> + 11 4 9 3 -1. + <_> + 10 5 9 1 3. + 1 + <_> + + <_> + 15 0 2 10 -1. + <_> + 15 0 1 10 2. + 1 + <_> + + <_> + 0 5 18 12 -1. + <_> + 6 9 6 4 9. + <_> + + <_> + 14 9 4 6 -1. + <_> + 14 9 2 6 2. + <_> + + <_> + 5 6 3 12 -1. + <_> + 5 10 3 4 3. + <_> + + <_> + 11 0 3 9 -1. + <_> + 12 1 1 9 3. + 1 + <_> + + <_> + 1 9 4 9 -1. + <_> + 1 12 4 3 3. + <_> + + <_> + 18 9 4 9 -1. + <_> + 18 12 4 3 3. + <_> + + <_> + 6 9 6 4 -1. + <_> + 9 9 3 4 2. + <_> + + <_> + 11 0 3 9 -1. + <_> + 12 1 1 9 3. + 1 + <_> + + <_> + 11 0 9 3 -1. + <_> + 10 1 9 1 3. + 1 + <_> + + <_> + 5 15 12 2 -1. + <_> + 5 16 12 1 2. + <_> + + <_> + 0 0 22 2 -1. + <_> + 11 0 11 2 2. + <_> + + <_> + 20 0 2 13 -1. + <_> + 20 0 1 13 2. + <_> + + <_> + 0 0 2 13 -1. + <_> + 1 0 1 13 2. + <_> + + <_> + 10 1 6 6 -1. + <_> + 12 1 2 6 3. + <_> + + <_> + 6 1 6 6 -1. + <_> + 8 1 2 6 3. + <_> + + <_> + 10 7 12 3 -1. + <_> + 10 8 12 1 3. + <_> + + <_> + 0 7 12 3 -1. + <_> + 0 8 12 1 3. + <_> + + <_> + 1 9 8 6 -1. + <_> + 1 9 4 3 2. + <_> + 5 12 4 3 2. + <_> + + <_> + 10 10 7 4 -1. + <_> + 10 12 7 2 2. + <_> + + <_> + 8 10 4 6 -1. + <_> + 10 10 2 6 2. + <_> + + <_> + 13 6 8 4 -1. + <_> + 13 6 4 4 2. + 1 + <_> + + <_> + 10 1 8 7 -1. + <_> + 12 3 4 7 2. + 1 + <_> + + <_> + 8 5 8 7 -1. + <_> + 8 5 4 7 2. + <_> + + <_> + 6 5 8 7 -1. + <_> + 10 5 4 7 2. + <_> + + <_> + 6 3 16 12 -1. + <_> + 14 3 8 6 2. + <_> + 6 9 8 6 2. + <_> + + <_> + 4 11 6 6 -1. + <_> + 4 13 6 2 3. + <_> + + <_> + 4 2 18 14 -1. + <_> + 13 2 9 7 2. + <_> + 4 9 9 7 2. + <_> + + <_> + 5 0 11 12 -1. + <_> + 5 3 11 6 2. + <_> + + <_> + 4 7 16 9 -1. + <_> + 4 10 16 3 3. + <_> + + <_> + 0 1 18 3 -1. + <_> + 0 2 18 1 3. + <_> + + <_> + 12 13 6 4 -1. + <_> + 12 15 6 2 2. + <_> + + <_> + 1 10 6 8 -1. + <_> + 1 10 3 4 2. + <_> + 4 14 3 4 2. + <_> + + <_> + 14 12 8 6 -1. + <_> + 18 12 4 3 2. + <_> + 14 15 4 3 2. + <_> + + <_> + 9 3 12 3 -1. + <_> + 13 7 4 3 3. + 1 + <_> + + <_> + 8 12 6 6 -1. + <_> + 8 12 3 6 2. + <_> + + <_> + 4 8 14 10 -1. + <_> + 4 13 14 5 2. + <_> + + <_> + 11 2 8 8 -1. + <_> + 11 2 4 8 2. + 1 + <_> + + <_> + 9 6 4 8 -1. + <_> + 9 6 4 4 2. + 1 + <_> + + <_> + 18 3 4 10 -1. + <_> + 18 3 4 5 2. + 1 + <_> + + <_> + 5 15 12 3 -1. + <_> + 9 15 4 3 3. + <_> + + <_> + 11 8 4 6 -1. + <_> + 11 8 4 3 2. + 1 + <_> + + <_> + 11 8 6 4 -1. + <_> + 11 8 3 4 2. + 1 + <_> + + <_> + 3 13 16 5 -1. + <_> + 7 13 8 5 2. + <_> + + <_> + 6 2 4 12 -1. + <_> + 6 2 2 6 2. + <_> + 8 8 2 6 2. + <_> + + <_> + 2 14 18 4 -1. + <_> + 11 14 9 2 2. + <_> + 2 16 9 2 2. + <_> + + <_> + 3 1 12 3 -1. + <_> + 3 2 12 1 3. + <_> + + <_> + 6 1 16 3 -1. + <_> + 6 2 16 1 3. + <_> + + <_> + 5 3 8 3 -1. + <_> + 9 3 4 3 2. + <_> + + <_> + 16 3 4 6 -1. + <_> + 16 3 4 3 2. + 1 + <_> + + <_> + 4 3 10 4 -1. + <_> + 4 3 5 4 2. + 1 + <_> + + <_> + 14 5 6 8 -1. + <_> + 17 5 3 4 2. + <_> + 14 9 3 4 2. + <_> + + <_> + 1 2 14 12 -1. + <_> + 1 5 14 6 2. + <_> + + <_> + 11 2 6 12 -1. + <_> + 11 5 6 6 2. + <_> + + <_> + 5 2 6 12 -1. + <_> + 5 5 6 6 2. + <_> + + <_> + 11 5 8 5 -1. + <_> + 11 5 4 5 2. + 1 + <_> + + <_> + 4 0 9 18 -1. + <_> + 7 0 3 18 3. + <_> + + <_> + 11 14 6 4 -1. + <_> + 11 16 6 2 2. + <_> + + <_> + 5 14 6 4 -1. + <_> + 5 16 6 2 2. + <_> + + <_> + 12 13 6 4 -1. + <_> + 12 15 6 2 2. + <_> + + <_> + 1 6 13 3 -1. + <_> + 1 7 13 1 3. + <_> + + <_> + 10 6 12 3 -1. + <_> + 10 7 12 1 3. + <_> + + <_> + 1 8 6 4 -1. + <_> + 4 8 3 4 2. + <_> + + <_> + 14 12 6 6 -1. + <_> + 16 12 2 6 3. + <_> + + <_> + 2 12 6 6 -1. + <_> + 4 12 2 6 3. + <_> + + <_> + 7 15 12 3 -1. + <_> + 11 15 4 3 3. + <_> + + <_> + 1 12 8 5 -1. + <_> + 5 12 4 5 2. + <_> + + <_> + 14 5 6 8 -1. + <_> + 17 5 3 4 2. + <_> + 14 9 3 4 2. + <_> + + <_> + 2 5 6 8 -1. + <_> + 2 5 3 4 2. + <_> + 5 9 3 4 2. + <_> + + <_> + 14 11 8 6 -1. + <_> + 18 11 4 3 2. + <_> + 14 14 4 3 2. + <_> + + <_> + 4 0 8 6 -1. + <_> + 4 0 4 3 2. + <_> + 8 3 4 3 2. + <_> + + <_> + 14 3 7 4 -1. + <_> + 14 3 7 2 2. + 1 + <_> + + <_> + 0 11 8 6 -1. + <_> + 0 11 4 3 2. + <_> + 4 14 4 3 2. + <_> + + <_> + 4 13 14 4 -1. + <_> + 4 15 14 2 2. + <_> + + <_> + 5 3 9 8 -1. + <_> + 8 3 3 8 3. + <_> + + <_> + 5 0 15 8 -1. + <_> + 10 0 5 8 3. + <_> + + <_> + 2 0 15 8 -1. + <_> + 7 0 5 8 3. + <_> + + <_> + 14 0 6 11 -1. + <_> + 16 0 2 11 3. + <_> + + <_> + 0 16 18 2 -1. + <_> + 6 16 6 2 3. + <_> + + <_> + 5 3 12 9 -1. + <_> + 9 6 4 3 9. + <_> + + <_> + 8 3 4 7 -1. + <_> + 8 3 2 7 2. + 1 + <_> + + <_> + 10 3 6 8 -1. + <_> + 12 3 2 8 3. + <_> + + <_> + 6 3 6 8 -1. + <_> + 8 3 2 8 3. + <_> + + <_> + 7 13 12 4 -1. + <_> + 7 15 12 2 2. + <_> + + <_> + 3 9 16 8 -1. + <_> + 3 9 8 4 2. + <_> + 11 13 8 4 2. + <_> + + <_> + 9 0 13 3 -1. + <_> + 9 1 13 1 3. + <_> + + <_> + 4 0 4 12 -1. + <_> + 4 0 2 6 2. + <_> + 6 6 2 6 2. + <_> + + <_> + 1 11 20 4 -1. + <_> + 6 11 10 4 2. + <_> + + <_> + 3 14 6 4 -1. + <_> + 6 14 3 4 2. + <_> + + <_> + 10 6 12 3 -1. + <_> + 10 7 12 1 3. + <_> + + <_> + 0 6 12 3 -1. + <_> + 0 7 12 1 3. + <_> + + <_> + 6 2 14 6 -1. + <_> + 6 4 14 2 3. + <_> + + <_> + 4 1 6 4 -1. + <_> + 4 1 6 2 2. + 1 + <_> + + <_> + 1 0 21 18 -1. + <_> + 8 0 7 18 3. + <_> + + <_> + 5 0 14 2 -1. + <_> + 5 0 7 2 2. + 1 + <_> + + <_> + 14 8 4 9 -1. + <_> + 14 11 4 3 3. + <_> + + <_> + 2 0 6 10 -1. + <_> + 4 0 2 10 3. + <_> + + <_> + 5 11 12 4 -1. + <_> + 11 11 6 2 2. + <_> + 5 13 6 2 2. + <_> + + <_> + 8 5 4 6 -1. + <_> + 10 5 2 6 2. + <_> + + <_> + 7 1 15 9 -1. + <_> + 12 4 5 3 9. + <_> + + <_> + 0 1 15 9 -1. + <_> + 5 4 5 3 9. + <_> + + <_> + 5 0 12 16 -1. + <_> + 11 0 6 8 2. + <_> + 5 8 6 8 2. + <_> + + <_> + 8 10 6 5 -1. + <_> + 11 10 3 5 2. + <_> + + <_> + 10 4 8 9 -1. + <_> + 10 7 8 3 3. + <_> + + <_> + 4 4 8 9 -1. + <_> + 4 7 8 3 3. + <_> + + <_> + 8 3 12 3 -1. + <_> + 8 4 12 1 3. + <_> + + <_> + 0 3 13 3 -1. + <_> + 0 4 13 1 3. + <_> + + <_> + 10 1 12 3 -1. + <_> + 14 1 4 3 3. + <_> + + <_> + 0 1 12 3 -1. + <_> + 4 1 4 3 3. + <_> + + <_> + 8 3 12 3 -1. + <_> + 8 4 12 1 3. + <_> + + <_> + 8 4 6 4 -1. + <_> + 8 4 3 4 2. + 1 + <_> + + <_> + 13 2 2 11 -1. + <_> + 13 2 1 11 2. + 1 + <_> + + <_> + 9 2 11 2 -1. + <_> + 9 2 11 1 2. + 1 + <_> + + <_> + 11 1 3 16 -1. + <_> + 11 9 3 8 2. + <_> + + <_> + 7 1 4 9 -1. + <_> + 7 4 4 3 3. + <_> + + <_> + 12 4 4 8 -1. + <_> + 12 8 4 4 2. + <_> + + <_> + 1 7 6 4 -1. + <_> + 1 9 6 2 2. + <_> + + <_> + 12 4 4 8 -1. + <_> + 12 8 4 4 2. + <_> + + <_> + 6 4 4 8 -1. + <_> + 6 8 4 4 2. + <_> + + <_> + 19 3 3 12 -1. + <_> + 20 4 1 12 3. + 1 + <_> + + <_> + 3 3 12 3 -1. + <_> + 2 4 12 1 3. + 1 + <_> + + <_> + 13 6 3 7 -1. + <_> + 14 7 1 7 3. + 1 + <_> + + <_> + 8 12 6 4 -1. + <_> + 11 12 3 4 2. + <_> + + <_> + 10 8 10 10 -1. + <_> + 15 8 5 5 2. + <_> + 10 13 5 5 2. + <_> + + <_> + 2 8 10 10 -1. + <_> + 2 8 5 5 2. + <_> + 7 13 5 5 2. + <_> + + <_> + 1 11 20 3 -1. + <_> + 6 11 10 3 2. + <_> + + <_> + 13 8 6 4 -1. + <_> + 13 8 3 4 2. + 1 + <_> + + <_> + 4 11 8 4 -1. + <_> + 8 11 4 4 2. + <_> + + <_> + 9 5 10 6 -1. + <_> + 9 5 5 6 2. + <_> + + <_> + 4 8 6 9 -1. + <_> + 7 8 3 9 2. + <_> + + <_> + 4 5 16 4 -1. + <_> + 4 5 8 4 2. + <_> + + <_> + 2 4 18 6 -1. + <_> + 8 6 6 2 9. + <_> + + <_> + 11 1 2 11 -1. + <_> + 11 1 1 11 2. + 1 + <_> + + <_> + 7 1 6 8 -1. + <_> + 7 1 3 4 2. + <_> + 10 5 3 4 2. + <_> + + <_> + 7 10 8 6 -1. + <_> + 9 10 4 6 2. + <_> + + <_> + 6 12 9 4 -1. + <_> + 9 12 3 4 3. + <_> + + <_> + 10 12 9 4 -1. + <_> + 13 12 3 4 3. + <_> + + <_> + 8 0 10 8 -1. + <_> + 8 0 5 8 2. + 1 + <_> + + <_> + 9 6 12 4 -1. + <_> + 15 6 6 2 2. + <_> + 9 8 6 2 2. + <_> + + <_> + 4 9 14 5 -1. + <_> + 11 9 7 5 2. + <_> + + <_> + 14 6 6 6 -1. + <_> + 12 8 6 2 3. + 1 + <_> + + <_> + 6 4 6 7 -1. + <_> + 8 4 2 7 3. + <_> + + <_> + 14 9 6 6 -1. + <_> + 14 12 6 3 2. + <_> + + <_> + 2 9 6 6 -1. + <_> + 2 12 6 3 2. + <_> + + <_> + 13 8 4 8 -1. + <_> + 13 8 2 8 2. + <_> + + <_> + 5 8 4 9 -1. + <_> + 7 8 2 9 2. + <_> + + <_> + 2 4 18 12 -1. + <_> + 8 8 6 4 9. + <_> + + <_> + 3 5 10 6 -1. + <_> + 8 5 5 6 2. + <_> + + <_> + 6 0 12 8 -1. + <_> + 6 0 6 8 2. + <_> + + <_> + 0 11 8 7 -1. + <_> + 2 11 4 7 2. + <_> + + <_> + 15 11 6 7 -1. + <_> + 17 11 2 7 3. + <_> + + <_> + 3 16 14 2 -1. + <_> + 3 17 14 1 2. + <_> + + <_> + 9 15 13 3 -1. + <_> + 9 16 13 1 3. + <_> + + <_> + 0 15 13 3 -1. + <_> + 0 16 13 1 3. + <_> + + <_> + 5 13 12 3 -1. + <_> + 5 14 12 1 3. + <_> + + <_> + 0 14 14 3 -1. + <_> + 0 15 14 1 3. + <_> + + <_> + 13 5 6 6 -1. + <_> + 15 5 2 6 3. + <_> + + <_> + 3 5 6 6 -1. + <_> + 5 5 2 6 3. + <_> + + <_> + 2 3 20 4 -1. + <_> + 7 3 10 4 2. + <_> + + <_> + 4 13 12 2 -1. + <_> + 4 14 12 1 2. + <_> + + <_> + 9 6 9 6 -1. + <_> + 12 6 3 6 3. + <_> + + <_> + 8 5 6 7 -1. + <_> + 10 5 2 7 3. + <_> + + <_> + 15 0 3 10 -1. + <_> + 16 1 1 10 3. + 1 + <_> + + <_> + 7 0 10 3 -1. + <_> + 6 1 10 1 3. + 1 + <_> + + <_> + 11 4 8 6 -1. + <_> + 15 4 4 3 2. + <_> + 11 7 4 3 2. + <_> + + <_> + 7 0 12 3 -1. + <_> + 6 1 12 1 3. + 1 + <_> + + <_> + 19 4 3 11 -1. + <_> + 20 5 1 11 3. + 1 + <_> + + <_> + 1 11 6 7 -1. + <_> + 3 11 2 7 3. + <_> + + <_> + 7 4 15 14 -1. + <_> + 7 11 15 7 2. + <_> + + <_> + 3 4 11 3 -1. + <_> + 2 5 11 1 3. + 1 + <_> + + <_> + 14 6 3 8 -1. + <_> + 15 7 1 8 3. + 1 + <_> + + <_> + 3 0 3 18 -1. + <_> + 4 0 1 18 3. + <_> + + <_> + 14 3 8 4 -1. + <_> + 14 3 8 2 2. + 1 + <_> + + <_> + 8 3 4 8 -1. + <_> + 8 3 2 8 2. + 1 + <_> + + <_> + 18 2 4 12 -1. + <_> + 15 5 4 6 2. + 1 + <_> + + <_> + 2 9 17 3 -1. + <_> + 2 10 17 1 3. + <_> + + <_> + 7 9 14 3 -1. + <_> + 7 10 14 1 3. + <_> + + <_> + 8 2 6 8 -1. + <_> + 8 2 3 4 2. + <_> + 11 6 3 4 2. + <_> + + <_> + 11 4 8 6 -1. + <_> + 15 4 4 3 2. + <_> + 11 7 4 3 2. + <_> + + <_> + 3 4 8 6 -1. + <_> + 3 4 4 3 2. + <_> + 7 7 4 3 2. + <_> + + <_> + 3 1 18 3 -1. + <_> + 3 2 18 1 3. + <_> + + <_> + 0 9 8 3 -1. + <_> + 4 9 4 3 2. + <_> + + <_> + 13 2 9 10 -1. + <_> + 13 7 9 5 2. + <_> + + <_> + 1 2 8 12 -1. + <_> + 1 2 4 6 2. + <_> + 5 8 4 6 2. + <_> + + <_> + 12 5 8 6 -1. + <_> + 16 5 4 3 2. + <_> + 12 8 4 3 2. + <_> + + <_> + 1 0 17 3 -1. + <_> + 1 1 17 1 3. + <_> + + <_> + 4 0 15 2 -1. + <_> + 4 1 15 1 2. + <_> + + <_> + 5 0 12 4 -1. + <_> + 5 2 12 2 2. + <_> + + <_> + 7 4 15 14 -1. + <_> + 7 11 15 7 2. + <_> + + <_> + 8 2 9 2 -1. + <_> + 8 2 9 1 2. + 1 + <_> + + <_> + 16 0 2 13 -1. + <_> + 16 0 1 13 2. + 1 + <_> + + <_> + 6 0 13 2 -1. + <_> + 6 0 13 1 2. + 1 + <_> + + <_> + 12 7 2 9 -1. + <_> + 12 7 1 9 2. + 1 + <_> + + <_> + 10 7 9 2 -1. + <_> + 10 7 9 1 2. + 1 + <_> + + <_> + 9 0 11 10 -1. + <_> + 9 5 11 5 2. + <_> + + <_> + 8 5 9 2 -1. + <_> + 8 5 9 1 2. + 1 + <_> + + <_> + 13 2 9 10 -1. + <_> + 13 7 9 5 2. + <_> + + <_> + 0 2 9 10 -1. + <_> + 0 7 9 5 2. + <_> + + <_> + 17 2 3 8 -1. + <_> + 17 6 3 4 2. + <_> + + <_> + 2 2 3 8 -1. + <_> + 2 6 3 4 2. + <_> + + <_> + 4 4 18 4 -1. + <_> + 13 4 9 2 2. + <_> + 4 6 9 2 2. + <_> + + <_> + 0 4 18 4 -1. + <_> + 0 4 9 2 2. + <_> + 9 6 9 2 2. + <_> + + <_> + 4 1 14 4 -1. + <_> + 11 1 7 2 2. + <_> + 4 3 7 2 2. + <_> + + <_> + 0 0 21 8 -1. + <_> + 7 0 7 8 3. + <_> + + <_> + 5 0 14 18 -1. + <_> + 12 0 7 9 2. + <_> + 5 9 7 9 2. + <_> + + <_> + 1 11 16 4 -1. + <_> + 5 11 8 4 2. + <_> + + <_> + 6 9 10 6 -1. + <_> + 6 11 10 2 3. + <_> + + <_> + 5 10 12 4 -1. + <_> + 5 11 12 2 2. + <_> + + <_> + 15 4 6 6 -1. + <_> + 15 4 3 6 2. + 1 + <_> + + <_> + 7 4 6 6 -1. + <_> + 7 4 6 3 2. + 1 + <_> + + <_> + 12 5 8 6 -1. + <_> + 16 5 4 3 2. + <_> + 12 8 4 3 2. + <_> + + <_> + 5 5 8 4 -1. + <_> + 5 5 8 2 2. + 1 + <_> + + <_> + 17 6 3 12 -1. + <_> + 17 10 3 4 3. + <_> + + <_> + 5 7 9 2 -1. + <_> + 5 7 9 1 2. + 1 + <_> + + <_> + 14 6 3 8 -1. + <_> + 15 7 1 8 3. + 1 + <_> + + <_> + 5 7 12 2 -1. + <_> + 5 8 12 1 2. + <_> + + <_> + 4 5 18 3 -1. + <_> + 4 6 18 1 3. + <_> + + <_> + 1 6 15 9 -1. + <_> + 6 6 5 9 3. + <_> + + <_> + 19 4 3 10 -1. + <_> + 19 4 3 5 2. + 1 + <_> + + <_> + 0 12 18 6 -1. + <_> + 0 15 18 3 2. + <_> + + <_> + 6 13 13 4 -1. + <_> + 6 15 13 2 2. + <_> + + <_> + 3 5 8 9 -1. + <_> + 3 8 8 3 3. + <_> + + <_> + 6 8 10 8 -1. + <_> + 6 10 10 4 2. + <_> + + <_> + 4 6 13 6 -1. + <_> + 4 9 13 3 2. + <_> + + <_> + 14 3 2 12 -1. + <_> + 14 3 2 6 2. + 1 + <_> + + <_> + 8 3 12 2 -1. + <_> + 8 3 6 2 2. + 1 + <_> + + <_> + 13 1 5 12 -1. + <_> + 13 1 5 6 2. + 1 + <_> + + <_> + 9 1 12 5 -1. + <_> + 9 1 6 5 2. + 1 + <_> + + <_> + 8 12 8 3 -1. + <_> + 8 12 4 3 2. + <_> + + <_> + 5 12 12 4 -1. + <_> + 8 12 6 4 2. + <_> + + <_> + 13 8 6 4 -1. + <_> + 13 8 3 4 2. + 1 + <_> + + <_> + 9 8 4 6 -1. + <_> + 9 8 4 3 2. + 1 + <_> + + <_> + 1 7 20 11 -1. + <_> + 6 7 10 11 2. + <_> + + <_> + 10 13 12 3 -1. + <_> + 10 14 12 1 3. + <_> + + <_> + 1 10 6 4 -1. + <_> + 4 10 3 4 2. + <_> + + <_> + 15 10 6 4 -1. + <_> + 15 10 3 4 2. + <_> + + <_> + 0 13 12 3 -1. + <_> + 0 14 12 1 3. + <_> + + <_> + 4 10 14 8 -1. + <_> + 4 14 14 4 2. + <_> + + <_> + 5 14 12 4 -1. + <_> + 5 15 12 2 2. + <_> + + <_> + 5 16 12 2 -1. + <_> + 5 17 12 1 2. + <_> + + <_> + 1 0 20 12 -1. + <_> + 6 0 10 12 2. + <_> + + <_> + 7 12 15 5 -1. + <_> + 12 12 5 5 3. + <_> + + <_> + 6 0 15 2 -1. + <_> + 6 0 15 1 2. + 1 + <_> + + <_> + 6 5 12 8 -1. + <_> + 12 5 6 4 2. + <_> + 6 9 6 4 2. + <_> + + <_> + 4 5 12 8 -1. + <_> + 4 5 6 4 2. + <_> + 10 9 6 4 2. + <_> + + <_> + 6 2 16 6 -1. + <_> + 14 2 8 3 2. + <_> + 6 5 8 3 2. + <_> + + <_> + 1 2 16 14 -1. + <_> + 1 2 8 7 2. + <_> + 9 9 8 7 2. + <_> + + <_> + 11 14 6 4 -1. + <_> + 11 14 3 4 2. + <_> + + <_> + 3 8 12 9 -1. + <_> + 7 11 4 3 9. + <_> + + <_> + 8 3 14 4 -1. + <_> + 15 3 7 2 2. + <_> + 8 5 7 2 2. + <_> + + <_> + 9 0 6 8 -1. + <_> + 11 2 2 8 3. + 1 + <_> + + <_> + 12 13 6 4 -1. + <_> + 12 15 6 2 2. + <_> + + <_> + 4 13 6 4 -1. + <_> + 4 15 6 2 2. + <_> + + <_> + 6 16 16 2 -1. + <_> + 6 17 16 1 2. + <_> + + <_> + 0 3 12 3 -1. + <_> + 0 4 12 1 3. + <_> + + <_> + 8 3 14 3 -1. + <_> + 8 4 14 1 3. + <_> + + <_> + 6 2 3 16 -1. + <_> + 6 6 3 8 2. + <_> + + <_> + 5 2 14 14 -1. + <_> + 12 2 7 7 2. + <_> + 5 9 7 7 2. + <_> + + <_> + 5 8 3 8 -1. + <_> + 5 12 3 4 2. + <_> + + <_> + 14 7 7 4 -1. + <_> + 14 7 7 2 2. + 1 + <_> + + <_> + 4 6 12 9 -1. + <_> + 8 9 4 3 9. + <_> + + <_> + 7 11 15 6 -1. + <_> + 12 11 5 6 3. + <_> + + <_> + 0 11 15 6 -1. + <_> + 5 11 5 6 3. + <_> + + <_> + 15 7 6 8 -1. + <_> + 18 7 3 4 2. + <_> + 15 11 3 4 2. + <_> + + <_> + 0 7 22 10 -1. + <_> + 0 7 11 5 2. + <_> + 11 12 11 5 2. + <_> + + <_> + 1 8 20 8 -1. + <_> + 6 8 10 8 2. + <_> + + <_> + 2 5 7 6 -1. + <_> + 2 7 7 2 3. + <_> + + <_> + 7 2 15 8 -1. + <_> + 7 4 15 4 2. + <_> + + <_> + 3 1 14 8 -1. + <_> + 3 3 14 4 2. + <_> + + <_> + 9 2 13 2 -1. + <_> + 9 3 13 1 2. + <_> + + <_> + 8 3 6 8 -1. + <_> + 10 3 2 8 3. + <_> + + <_> + 7 1 15 2 -1. + <_> + 7 2 15 1 2. + <_> + + <_> + 0 1 15 2 -1. + <_> + 0 2 15 1 2. + <_> + + <_> + 6 0 12 3 -1. + <_> + 6 1 12 1 3. + <_> + + <_> + 4 0 9 4 -1. + <_> + 7 0 3 4 3. + <_> + + <_> + 12 3 8 3 -1. + <_> + 12 3 4 3 2. + 1 + <_> + + <_> + 8 12 6 4 -1. + <_> + 11 12 3 4 2. + <_> + + <_> + 12 1 10 4 -1. + <_> + 12 1 5 4 2. + <_> + + <_> + 0 1 10 4 -1. + <_> + 5 1 5 4 2. + <_> + + <_> + 16 13 6 5 -1. + <_> + 16 13 3 5 2. + <_> + + <_> + 0 13 6 5 -1. + <_> + 3 13 3 5 2. + <_> + + <_> + 18 11 4 7 -1. + <_> + 18 11 2 7 2. + <_> + + <_> + 0 11 4 7 -1. + <_> + 2 11 2 7 2. + <_> + + <_> + 15 0 6 14 -1. + <_> + 17 0 2 14 3. + <_> + + <_> + 1 0 6 14 -1. + <_> + 3 0 2 14 3. + <_> + + <_> + 13 0 4 14 -1. + <_> + 15 0 2 7 2. + <_> + 13 7 2 7 2. + <_> + + <_> + 5 0 4 14 -1. + <_> + 5 0 2 7 2. + <_> + 7 7 2 7 2. + <_> + + <_> + 13 2 6 4 -1. + <_> + 13 2 3 4 2. + <_> + + <_> + 1 7 12 4 -1. + <_> + 1 7 6 2 2. + <_> + 7 9 6 2 2. + <_> + + <_> + 4 13 18 3 -1. + <_> + 4 14 18 1 3. + <_> + + <_> + 2 6 2 12 -1. + <_> + 2 12 2 6 2. + <_> + + <_> + 4 11 16 4 -1. + <_> + 12 11 8 2 2. + <_> + 4 13 8 2 2. + <_> + + <_> + 2 11 16 4 -1. + <_> + 2 11 8 2 2. + <_> + 10 13 8 2 2. + <_> + + <_> + 10 12 12 4 -1. + <_> + 16 12 6 2 2. + <_> + 10 14 6 2 2. + <_> + + <_> + 0 12 12 4 -1. + <_> + 0 12 6 2 2. + <_> + 6 14 6 2 2. + <_> + + <_> + 12 12 10 6 -1. + <_> + 17 12 5 3 2. + <_> + 12 15 5 3 2. + <_> + + <_> + 0 10 10 8 -1. + <_> + 0 10 5 4 2. + <_> + 5 14 5 4 2. + <_> + + <_> + 8 0 7 4 -1. + <_> + 8 2 7 2 2. + <_> + + <_> + 0 3 14 3 -1. + <_> + 0 4 14 1 3. + <_> + + <_> + 15 1 6 8 -1. + <_> + 18 1 3 4 2. + <_> + 15 5 3 4 2. + <_> + + <_> + 2 3 7 4 -1. + <_> + 2 5 7 2 2. + <_> + + <_> + 13 2 6 4 -1. + <_> + 13 2 3 4 2. + <_> + + <_> + 3 2 6 4 -1. + <_> + 6 2 3 4 2. + <_> + + <_> + 5 1 16 4 -1. + <_> + 5 2 16 2 2. + <_> + + <_> + 4 15 13 3 -1. + <_> + 4 16 13 1 3. + <_> + + <_> + 12 6 3 12 -1. + <_> + 13 6 1 12 3. + <_> + + <_> + 0 16 16 2 -1. + <_> + 8 16 8 2 2. + <_> + + <_> + 3 2 16 10 -1. + <_> + 3 7 16 5 2. + <_> + + <_> + 7 1 12 4 -1. + <_> + 10 4 6 4 2. + 1 + <_> + + <_> + 14 1 2 9 -1. + <_> + 14 1 1 9 2. + 1 + <_> + + <_> + 4 10 3 8 -1. + <_> + 4 14 3 4 2. + <_> + + <_> + 11 12 6 6 -1. + <_> + 11 14 6 2 3. + <_> + + <_> + 5 12 6 6 -1. + <_> + 5 14 6 2 3. + <_> + + <_> + 12 6 3 12 -1. + <_> + 13 6 1 12 3. + <_> + + <_> + 10 6 8 3 -1. + <_> + 9 7 8 1 3. + 1 + <_> + + <_> + 12 6 3 12 -1. + <_> + 13 6 1 12 3. + <_> + + <_> + 7 6 3 12 -1. + <_> + 8 6 1 12 3. + <_> + + <_> + 14 1 2 9 -1. + <_> + 14 1 1 9 2. + 1 + <_> + + <_> + 11 4 10 3 -1. + <_> + 10 5 10 1 3. + 1 + <_> + + <_> + 8 11 9 4 -1. + <_> + 11 11 3 4 3. + <_> + + <_> + 7 5 2 12 -1. + <_> + 8 5 1 12 2. + <_> + + <_> + 13 1 3 16 -1. + <_> + 14 1 1 16 3. + <_> + + <_> + 7 4 6 6 -1. + <_> + 9 4 2 6 3. + <_> + + <_> + 10 4 2 12 -1. + <_> + 10 4 1 12 2. + <_> + + <_> + 0 0 18 5 -1. + <_> + 9 0 9 5 2. + <_> + + <_> + 16 3 2 12 -1. + <_> + 16 3 1 12 2. + 1 + <_> + + <_> + 6 3 12 2 -1. + <_> + 6 3 12 1 2. + 1 + <_> + + <_> + 13 6 4 7 -1. + <_> + 14 7 2 7 2. + 1 + <_> + + <_> + 7 3 13 2 -1. + <_> + 7 3 13 1 2. + 1 + <_> + + <_> + 5 14 17 4 -1. + <_> + 5 15 17 2 2. + <_> + + <_> + 0 13 18 3 -1. + <_> + 0 14 18 1 3. + <_> + + <_> + 6 13 14 3 -1. + <_> + 6 14 14 1 3. + <_> + + <_> + 2 13 14 3 -1. + <_> + 2 14 14 1 3. + <_> + + <_> + 5 13 12 2 -1. + <_> + 5 14 12 1 2. + <_> + + <_> + 0 5 4 8 -1. + <_> + 0 9 4 4 2. + <_> + + <_> + 15 7 6 8 -1. + <_> + 18 7 3 4 2. + <_> + 15 11 3 4 2. + <_> + + <_> + 9 2 4 7 -1. + <_> + 11 2 2 7 2. + <_> + + <_> + 8 4 14 3 -1. + <_> + 8 5 14 1 3. + <_> + + <_> + 0 4 12 3 -1. + <_> + 0 5 12 1 3. + <_> + + <_> + 13 2 4 9 -1. + <_> + 13 5 4 3 3. + <_> + + <_> + 5 2 4 9 -1. + <_> + 5 5 4 3 3. + <_> + + <_> + 12 6 6 4 -1. + <_> + 12 8 6 2 2. + <_> + + <_> + 5 5 12 3 -1. + <_> + 11 5 6 3 2. + <_> + + <_> + 7 1 8 12 -1. + <_> + 7 4 8 6 2. + <_> + + <_> + 9 3 6 7 -1. + <_> + 11 5 2 7 3. + 1 + <_> + + <_> + 12 1 9 6 -1. + <_> + 10 3 9 2 3. + 1 + <_> + + <_> + 11 7 8 3 -1. + <_> + 11 7 4 3 2. + 1 + <_> + + <_> + 14 1 2 9 -1. + <_> + 14 1 1 9 2. + 1 + <_> + + <_> + 1 7 6 8 -1. + <_> + 1 7 3 4 2. + <_> + 4 11 3 4 2. + <_> + + <_> + 11 0 4 6 -1. + <_> + 11 0 2 6 2. + <_> + + <_> + 7 0 4 6 -1. + <_> + 9 0 2 6 2. + <_> + + <_> + 0 7 22 4 -1. + <_> + 11 7 11 2 2. + <_> + 0 9 11 2 2. + <_> + + <_> + 3 5 4 8 -1. + <_> + 3 9 4 4 2. + <_> + + <_> + 5 4 12 3 -1. + <_> + 9 4 4 3 3. + <_> + + <_> + 10 2 12 3 -1. + <_> + 10 2 6 3 2. + 1 + <_> + + <_> + 5 2 6 16 -1. + <_> + 5 10 6 8 2. + <_> + + <_> + 12 6 8 4 -1. + <_> + 12 6 8 2 2. + 1 + <_> + + <_> + 3 12 6 6 -1. + <_> + 5 12 2 6 3. + <_> + + <_> + 12 1 3 12 -1. + <_> + 12 1 3 6 2. + 1 + <_> + + <_> + 10 1 12 3 -1. + <_> + 10 1 6 3 2. + 1 + <_> + + <_> + 4 8 16 4 -1. + <_> + 8 8 8 4 2. + <_> + + <_> + 6 10 4 6 -1. + <_> + 8 10 2 6 2. + <_> + + <_> + 7 14 9 4 -1. + <_> + 10 14 3 4 3. + <_> + + <_> + 8 10 4 7 -1. + <_> + 10 10 2 7 2. + <_> + + <_> + 12 12 4 6 -1. + <_> + 12 12 2 6 2. + <_> + + <_> + 6 12 4 6 -1. + <_> + 8 12 2 6 2. + <_> + + <_> + 9 12 4 6 -1. + <_> + 9 15 4 3 2. + <_> + + <_> + 5 12 6 6 -1. + <_> + 7 12 2 6 3. + <_> + + <_> + 6 2 11 16 -1. + <_> + 6 6 11 8 2. + <_> + + <_> + 11 2 6 2 -1. + <_> + 11 2 6 1 2. + 1 + <_> + + <_> + 10 1 6 8 -1. + <_> + 13 1 3 4 2. + <_> + 10 5 3 4 2. + <_> + + <_> + 5 2 12 2 -1. + <_> + 11 2 6 2 2. + <_> + + <_> + 10 13 8 3 -1. + <_> + 10 13 4 3 2. + <_> + + <_> + 5 0 12 6 -1. + <_> + 11 0 6 6 2. + <_> + + <_> + 10 7 12 3 -1. + <_> + 10 8 12 1 3. + <_> + + <_> + 0 7 12 3 -1. + <_> + 0 8 12 1 3. + <_> + + <_> + 20 0 2 18 -1. + <_> + 20 9 2 9 2. + <_> + + <_> + 0 0 2 18 -1. + <_> + 0 9 2 9 2. + <_> + + <_> + 14 6 6 12 -1. + <_> + 17 6 3 6 2. + <_> + 14 12 3 6 2. + <_> + + <_> + 1 5 6 10 -1. + <_> + 1 10 6 5 2. + <_> + + <_> + 16 1 4 12 -1. + <_> + 16 5 4 4 3. + <_> + + <_> + 2 1 4 12 -1. + <_> + 2 5 4 4 3. + <_> + + <_> + 3 12 16 4 -1. + <_> + 11 12 8 2 2. + <_> + 3 14 8 2 2. + <_> + + <_> + 0 2 12 2 -1. + <_> + 0 3 12 1 2. + <_> + + <_> + 6 2 13 3 -1. + <_> + 6 3 13 1 3. + <_> + + <_> + 1 0 10 6 -1. + <_> + 1 0 5 3 2. + <_> + 6 3 5 3 2. + <_> + + <_> + 9 11 12 5 -1. + <_> + 13 11 4 5 3. + <_> + + <_> + 2 6 6 12 -1. + <_> + 2 6 3 6 2. + <_> + 5 12 3 6 2. + <_> + + <_> + 9 12 8 6 -1. + <_> + 13 12 4 3 2. + <_> + 9 15 4 3 2. + <_> + + <_> + 1 7 6 8 -1. + <_> + 1 7 3 4 2. + <_> + 4 11 3 4 2. + <_> + + <_> + 14 6 3 8 -1. + <_> + 15 7 1 8 3. + 1 + <_> + + <_> + 2 14 12 4 -1. + <_> + 6 14 4 4 3. + <_> + + <_> + 14 4 2 11 -1. + <_> + 14 4 1 11 2. + 1 + <_> + + <_> + 8 6 8 3 -1. + <_> + 7 7 8 1 3. + 1 + <_> + + <_> + 6 12 12 3 -1. + <_> + 6 13 12 1 3. + <_> + + <_> + 2 3 18 3 -1. + <_> + 2 4 18 1 3. + <_> + + <_> + 11 6 9 9 -1. + <_> + 14 6 3 9 3. + <_> + + <_> + 3 13 11 4 -1. + <_> + 3 15 11 2 2. + <_> + + <_> + 17 5 4 6 -1. + <_> + 17 5 2 6 2. + <_> + + <_> + 1 5 4 6 -1. + <_> + 3 5 2 6 2. + <_> + + <_> + 6 0 16 3 -1. + <_> + 10 0 8 3 2. + <_> + + <_> + 8 6 3 12 -1. + <_> + 9 6 1 12 3. + <_> + + <_> + 14 2 2 8 -1. + <_> + 14 2 1 8 2. + 1 + <_> + + <_> + 9 0 12 3 -1. + <_> + 9 0 6 3 2. + 1 + <_> + + <_> + 6 0 16 3 -1. + <_> + 10 0 8 3 2. + <_> + + <_> + 0 0 16 3 -1. + <_> + 4 0 8 3 2. + <_> + + <_> + 8 12 14 3 -1. + <_> + 8 13 14 1 3. + <_> + + <_> + 8 4 11 2 -1. + <_> + 8 4 11 1 2. + 1 + <_> + + <_> + 2 5 20 13 -1. + <_> + 2 5 10 13 2. + <_> + + <_> + 0 2 18 9 -1. + <_> + 6 5 6 3 9. + <_> + + <_> + 10 13 12 3 -1. + <_> + 10 14 12 1 3. + <_> + + <_> + 8 11 6 7 -1. + <_> + 10 11 2 7 3. + <_> + + <_> + 5 6 12 11 -1. + <_> + 9 6 4 11 3. + <_> + + <_> + 3 6 6 6 -1. + <_> + 5 6 2 6 3. + <_> + + <_> + 13 4 6 13 -1. + <_> + 15 4 2 13 3. + <_> + + <_> + 3 4 6 13 -1. + <_> + 5 4 2 13 3. + <_> + + <_> + 5 10 12 3 -1. + <_> + 9 10 4 3 3. + <_> + + <_> + 5 8 12 6 -1. + <_> + 8 8 6 6 2. + <_> + + <_> + 14 2 2 8 -1. + <_> + 14 2 1 8 2. + 1 + <_> + + <_> + 8 2 8 2 -1. + <_> + 8 2 8 1 2. + 1 + <_> + + <_> + 8 6 9 5 -1. + <_> + 11 6 3 5 3. + <_> + + <_> + 0 3 14 4 -1. + <_> + 0 3 7 2 2. + <_> + 7 5 7 2 2. + <_> + + <_> + 12 1 3 8 -1. + <_> + 13 2 1 8 3. + 1 + <_> + + <_> + 10 1 8 3 -1. + <_> + 9 2 8 1 3. + 1 + <_> + + <_> + 14 3 6 6 -1. + <_> + 14 5 6 2 3. + <_> + + <_> + 4 1 6 10 -1. + <_> + 4 1 3 5 2. + <_> + 7 6 3 5 2. + <_> + + <_> + 18 1 3 13 -1. + <_> + 19 1 1 13 3. + <_> + + <_> + 1 1 3 13 -1. + <_> + 2 1 1 13 3. + <_> + + <_> + 11 1 2 8 -1. + <_> + 11 1 1 8 2. + 1 + <_> + + <_> + 11 1 8 2 -1. + <_> + 11 1 8 1 2. + 1 + <_> + + <_> + 8 4 6 6 -1. + <_> + 8 6 6 2 3. + <_> + + <_> + 5 4 7 6 -1. + <_> + 5 6 7 2 3. + <_> + + <_> + 9 11 13 3 -1. + <_> + 9 12 13 1 3. + <_> + + <_> + 0 11 13 3 -1. + <_> + 0 12 13 1 3. + <_> + + <_> + 12 10 9 8 -1. + <_> + 12 14 9 4 2. + <_> + + <_> + 1 10 9 8 -1. + <_> + 1 14 9 4 2. + <_> + + <_> + 4 10 18 8 -1. + <_> + 13 10 9 4 2. + <_> + 4 14 9 4 2. + <_> + + <_> + 0 10 18 8 -1. + <_> + 0 10 9 4 2. + <_> + 9 14 9 4 2. + <_> + + <_> + 12 2 4 12 -1. + <_> + 12 2 2 12 2. + 1 + <_> + + <_> + 0 5 20 13 -1. + <_> + 10 5 10 13 2. + <_> + + <_> + 10 6 9 6 -1. + <_> + 10 8 9 2 3. + <_> + + <_> + 3 6 9 6 -1. + <_> + 3 8 9 2 3. + <_> + + <_> + 7 4 15 8 -1. + <_> + 7 6 15 4 2. + <_> + + <_> + 9 2 12 2 -1. + <_> + 9 2 12 1 2. + 1 + <_> + + <_> + 12 6 6 4 -1. + <_> + 12 6 6 2 2. + 1 + <_> + + <_> + 7 0 13 3 -1. + <_> + 6 1 13 1 3. + 1 + <_> + + <_> + 3 0 18 2 -1. + <_> + 3 0 9 2 2. + <_> + + <_> + 4 5 13 12 -1. + <_> + 4 9 13 4 3. + <_> + + <_> + 4 6 18 9 -1. + <_> + 10 9 6 3 9. + <_> + + <_> + 8 5 6 11 -1. + <_> + 10 5 2 11 3. + <_> + + <_> + 6 2 16 16 -1. + <_> + 6 6 16 8 2. + <_> + + <_> + 0 2 16 16 -1. + <_> + 0 6 16 8 2. + <_> + + <_> + 18 1 2 12 -1. + <_> + 18 7 2 6 2. + <_> + + <_> + 2 1 2 12 -1. + <_> + 2 7 2 6 2. + <_> + + <_> + 8 3 14 9 -1. + <_> + 8 6 14 3 3. + <_> + + <_> + 0 3 14 9 -1. + <_> + 0 6 14 3 3. + <_> + + <_> + 10 6 4 9 -1. + <_> + 10 9 4 3 3. + <_> + + <_> + 0 6 3 12 -1. + <_> + 0 12 3 6 2. + <_> + + <_> + 16 2 6 9 -1. + <_> + 13 5 6 3 3. + 1 + <_> + + <_> + 10 0 12 4 -1. + <_> + 9 1 12 2 2. + 1 + <_> + + <_> + 11 0 10 18 -1. + <_> + 16 0 5 9 2. + <_> + 11 9 5 9 2. + <_> + + <_> + 1 0 10 18 -1. + <_> + 1 0 5 9 2. + <_> + 6 9 5 9 2. + <_> + + <_> + 7 12 14 3 -1. + <_> + 7 12 7 3 2. + <_> + + <_> + 7 11 8 3 -1. + <_> + 11 11 4 3 2. + <_> + + <_> + 2 13 18 4 -1. + <_> + 2 13 9 4 2. + <_> + + <_> + 10 6 4 6 -1. + <_> + 10 6 2 6 2. + 1 + <_> + + <_> + 8 9 6 9 -1. + <_> + 10 9 2 9 3. + <_> + + <_> + 3 11 13 3 -1. + <_> + 3 12 13 1 3. + <_> + + <_> + 18 10 4 6 -1. + <_> + 18 10 2 6 2. + <_> + + <_> + 5 5 9 5 -1. + <_> + 8 5 3 5 3. + <_> + + <_> + 13 0 2 14 -1. + <_> + 13 0 1 14 2. + <_> + + <_> + 2 0 18 7 -1. + <_> + 8 0 6 7 3. + <_> + + <_> + 13 4 6 8 -1. + <_> + 16 4 3 4 2. + <_> + 13 8 3 4 2. + <_> + + <_> + 3 4 6 8 -1. + <_> + 3 4 3 4 2. + <_> + 6 8 3 4 2. + <_> + + <_> + 8 5 12 2 -1. + <_> + 8 6 12 1 2. + <_> + + <_> + 7 0 3 12 -1. + <_> + 8 0 1 12 3. + <_> + + <_> + 15 0 3 10 -1. + <_> + 16 1 1 10 3. + 1 + <_> + + <_> + 2 4 12 12 -1. + <_> + 6 8 4 4 9. + <_> + + <_> + 5 10 13 3 -1. + <_> + 5 11 13 1 3. + <_> + + <_> + 5 15 12 2 -1. + <_> + 5 16 12 1 2. + <_> + + <_> + 17 8 5 6 -1. + <_> + 17 11 5 3 2. + <_> + + <_> + 5 12 6 6 -1. + <_> + 5 14 6 2 3. + <_> + + <_> + 10 6 4 7 -1. + <_> + 10 6 2 7 2. + 1 + <_> + + <_> + 12 3 4 10 -1. + <_> + 13 4 2 10 2. + 1 + <_> + + <_> + 10 3 10 4 -1. + <_> + 9 4 10 2 2. + 1 + <_> + + <_> + 12 4 2 12 -1. + <_> + 12 4 1 12 2. + 1 + <_> + + <_> + 1 11 15 3 -1. + <_> + 6 11 5 3 3. + <_> + + <_> + 11 6 6 9 -1. + <_> + 13 6 2 9 3. + <_> + + <_> + 5 6 6 9 -1. + <_> + 7 6 2 9 3. + <_> + + <_> + 8 5 6 6 -1. + <_> + 10 5 2 6 3. + <_> + + <_> + 1 2 6 8 -1. + <_> + 1 2 3 4 2. + <_> + 4 6 3 4 2. + <_> + + <_> + 14 0 4 9 -1. + <_> + 14 3 4 3 3. + <_> + + <_> + 0 0 18 9 -1. + <_> + 0 3 18 3 3. + <_> + + <_> + 9 5 5 12 -1. + <_> + 9 8 5 6 2. + <_> + + <_> + 3 5 16 3 -1. + <_> + 3 6 16 1 3. + <_> + + <_> + 16 2 6 8 -1. + <_> + 19 2 3 4 2. + <_> + 16 6 3 4 2. + <_> + + <_> + 0 2 6 8 -1. + <_> + 0 2 3 4 2. + <_> + 3 6 3 4 2. + <_> + + <_> + 5 2 12 16 -1. + <_> + 5 10 12 8 2. + <_> + + <_> + 5 11 8 6 -1. + <_> + 5 11 4 3 2. + <_> + 9 14 4 3 2. + <_> + + <_> + 8 2 6 8 -1. + <_> + 11 2 3 4 2. + <_> + 8 6 3 4 2. + <_> + + <_> + 0 6 7 12 -1. + <_> + 0 10 7 4 3. + <_> + + <_> + 16 8 6 8 -1. + <_> + 16 10 6 4 2. + <_> + + <_> + 0 8 6 8 -1. + <_> + 0 10 6 4 2. + <_> + + <_> + 4 0 17 3 -1. + <_> + 4 1 17 1 3. + <_> + + <_> + 7 4 4 14 -1. + <_> + 8 4 2 14 2. + <_> + + <_> + 9 5 5 12 -1. + <_> + 9 8 5 6 2. + <_> + + <_> + 10 4 10 4 -1. + <_> + 9 5 10 2 2. + 1 + <_> + + <_> + 13 1 3 13 -1. + <_> + 14 2 1 13 3. + 1 + <_> + + <_> + 9 1 13 3 -1. + <_> + 8 2 13 1 3. + 1 + <_> + + <_> + 4 16 14 2 -1. + <_> + 4 17 14 1 2. + <_> + + <_> + 0 16 15 2 -1. + <_> + 0 17 15 1 2. + <_> + + <_> + 11 4 2 6 -1. + <_> + 11 4 1 6 2. + 1 + <_> + + <_> + 0 6 4 9 -1. + <_> + 0 9 4 3 3. + <_> + + <_> + 14 0 7 6 -1. + <_> + 12 2 7 2 3. + 1 + <_> + + <_> + 8 4 6 10 -1. + <_> + 8 4 3 5 2. + <_> + 11 9 3 5 2. + <_> + + <_> + 7 7 8 10 -1. + <_> + 11 7 4 5 2. + <_> + 7 12 4 5 2. + <_> + + <_> + 5 6 12 8 -1. + <_> + 5 6 6 4 2. + <_> + 11 10 6 4 2. + <_> + + <_> + 8 6 8 8 -1. + <_> + 12 6 4 4 2. + <_> + 8 10 4 4 2. + <_> + + <_> + 6 6 8 8 -1. + <_> + 6 6 4 4 2. + <_> + 10 10 4 4 2. + <_> + + <_> + 12 4 6 6 -1. + <_> + 10 6 6 2 3. + 1 + <_> + + <_> + 5 7 10 8 -1. + <_> + 5 7 5 4 2. + <_> + 10 11 5 4 2. + <_> + + <_> + 4 5 18 3 -1. + <_> + 4 6 18 1 3. + <_> + + <_> + 3 16 15 2 -1. + <_> + 3 17 15 1 2. + <_> + + <_> + 3 10 16 2 -1. + <_> + 3 11 16 1 2. + <_> + + <_> + 3 12 6 6 -1. + <_> + 5 12 2 6 3. + <_> + + <_> + 18 2 3 13 -1. + <_> + 19 2 1 13 3. + <_> + + <_> + 4 10 12 4 -1. + <_> + 8 10 4 4 3. + <_> + + <_> + 7 7 14 7 -1. + <_> + 7 7 7 7 2. + <_> + + <_> + 1 7 14 7 -1. + <_> + 8 7 7 7 2. + <_> + + <_> + 11 0 8 13 -1. + <_> + 11 0 4 13 2. + <_> + + <_> + 0 6 4 12 -1. + <_> + 0 6 2 6 2. + <_> + 2 12 2 6 2. + <_> + + <_> + 14 2 2 12 -1. + <_> + 14 2 1 12 2. + 1 + <_> + + <_> + 2 2 8 12 -1. + <_> + 2 2 4 6 2. + <_> + 6 8 4 6 2. + <_> + + <_> + 17 0 4 16 -1. + <_> + 17 8 4 8 2. + <_> + + <_> + 1 0 4 16 -1. + <_> + 1 8 4 8 2. + <_> + + <_> + 6 1 16 16 -1. + <_> + 6 9 16 8 2. + <_> + + <_> + 8 0 6 7 -1. + <_> + 10 2 2 7 3. + 1 + <_> + + <_> + 15 1 6 6 -1. + <_> + 13 3 6 2 3. + 1 + <_> + + <_> + 7 1 6 6 -1. + <_> + 9 3 2 6 3. + 1 + <_> + + <_> + 14 2 2 12 -1. + <_> + 14 2 1 12 2. + 1 + <_> + + <_> + 5 11 12 6 -1. + <_> + 5 14 12 3 2. + <_> + + <_> + 5 13 12 4 -1. + <_> + 5 14 12 2 2. + <_> + + <_> + 2 15 18 2 -1. + <_> + 2 16 18 1 2. + <_> + + <_> + 18 4 4 14 -1. + <_> + 20 4 2 7 2. + <_> + 18 11 2 7 2. + <_> + + <_> + 0 4 4 14 -1. + <_> + 0 4 2 7 2. + <_> + 2 11 2 7 2. + <_> + + <_> + 11 0 3 12 -1. + <_> + 12 0 1 12 3. + <_> + + <_> + 9 3 4 6 -1. + <_> + 9 6 4 3 2. + <_> + + <_> + 7 4 15 10 -1. + <_> + 7 9 15 5 2. + <_> + + <_> + 4 2 9 12 -1. + <_> + 4 6 9 4 3. + <_> + + <_> + 3 1 17 3 -1. + <_> + 3 2 17 1 3. + <_> + + <_> + 0 1 16 3 -1. + <_> + 0 2 16 1 3. + <_> + + <_> + 7 4 15 10 -1. + <_> + 7 9 15 5 2. + <_> + + <_> + 0 4 15 10 -1. + <_> + 0 9 15 5 2. + <_> + + <_> + 15 0 6 18 -1. + <_> + 15 9 6 9 2. + <_> + + <_> + 3 14 12 4 -1. + <_> + 3 14 6 2 2. + <_> + 9 16 6 2 2. + <_> + + <_> + 13 0 9 5 -1. + <_> + 16 3 3 5 3. + 1 + <_> + + <_> + 9 7 9 2 -1. + <_> + 9 7 9 1 2. + 1 + <_> + + <_> + 12 6 3 7 -1. + <_> + 13 7 1 7 3. + 1 + <_> + + <_> + 3 4 8 8 -1. + <_> + 7 4 4 8 2. + <_> + + <_> + 7 8 12 3 -1. + <_> + 11 8 4 3 3. + <_> + + <_> + 8 6 5 6 -1. + <_> + 8 6 5 3 2. + 1 + <_> + + <_> + 10 7 10 6 -1. + <_> + 10 10 10 3 2. + <_> + + <_> + 0 9 16 3 -1. + <_> + 0 10 16 1 3. + <_> + + <_> + 7 9 12 3 -1. + <_> + 7 10 12 1 3. + <_> + + <_> + 2 10 8 6 -1. + <_> + 2 13 8 3 2. + <_> + + <_> + 16 6 4 12 -1. + <_> + 16 9 4 6 2. + <_> + + <_> + 3 11 8 6 -1. + <_> + 3 11 4 3 2. + <_> + 7 14 4 3 2. + <_> + + <_> + 4 5 16 10 -1. + <_> + 12 5 8 5 2. + <_> + 4 10 8 5 2. + <_> + + <_> + 7 10 3 8 -1. + <_> + 7 14 3 4 2. + <_> + + <_> + 9 14 6 4 -1. + <_> + 9 16 6 2 2. + <_> + + <_> + 2 9 15 9 -1. + <_> + 2 12 15 3 3. + <_> + + <_> + 11 2 8 6 -1. + <_> + 15 2 4 3 2. + <_> + 11 5 4 3 2. + <_> + + <_> + 4 11 8 6 -1. + <_> + 4 13 8 2 3. + <_> + + <_> + 16 0 2 14 -1. + <_> + 16 0 1 14 2. + 1 + <_> + + <_> + 6 0 14 2 -1. + <_> + 6 0 14 1 2. + 1 + <_> + + <_> + 13 9 7 6 -1. + <_> + 13 11 7 2 3. + <_> + + <_> + 10 6 7 3 -1. + <_> + 9 7 7 1 3. + 1 + <_> + + <_> + 18 2 3 13 -1. + <_> + 19 2 1 13 3. + <_> + + <_> + 1 2 3 13 -1. + <_> + 2 2 1 13 3. + <_> + + <_> + 5 1 12 4 -1. + <_> + 11 1 6 2 2. + <_> + 5 3 6 2 2. + <_> + + <_> + 7 8 6 6 -1. + <_> + 7 10 6 2 3. + <_> + + <_> + 8 13 14 3 -1. + <_> + 8 14 14 1 3. + <_> + + <_> + 10 5 6 6 -1. + <_> + 12 7 2 6 3. + 1 + <_> + + <_> + 15 6 4 8 -1. + <_> + 16 7 2 8 2. + 1 + <_> + + <_> + 0 13 14 4 -1. + <_> + 0 13 7 2 2. + <_> + 7 15 7 2 2. + <_> + + <_> + 1 7 21 6 -1. + <_> + 8 9 7 2 9. + <_> + + <_> + 7 4 6 8 -1. + <_> + 7 4 3 4 2. + <_> + 10 8 3 4 2. + <_> + + <_> + 7 4 8 8 -1. + <_> + 11 4 4 4 2. + <_> + 7 8 4 4 2. + <_> + + <_> + 10 6 7 4 -1. + <_> + 9 7 7 2 2. + 1 + <_> + + <_> + 11 2 6 7 -1. + <_> + 11 2 3 7 2. + 1 + <_> + + <_> + 11 2 7 6 -1. + <_> + 11 2 7 3 2. + 1 + <_> + + <_> + 11 4 8 6 -1. + <_> + 11 4 4 6 2. + 1 + <_> + + <_> + 11 4 6 8 -1. + <_> + 11 4 6 4 2. + 1 + <_> + + <_> + 12 3 8 5 -1. + <_> + 12 3 4 5 2. + 1 + <_> + + <_> + 10 3 5 8 -1. + <_> + 10 3 5 4 2. + 1 + <_> + + <_> + 13 0 9 5 -1. + <_> + 16 3 3 5 3. + 1 + <_> + + <_> + 2 6 10 12 -1. + <_> + 2 9 10 6 2. + <_> + + <_> + 15 6 5 12 -1. + <_> + 15 9 5 6 2. + <_> + + <_> + 3 7 13 3 -1. + <_> + 3 8 13 1 3. + <_> + + <_> + 4 7 17 3 -1. + <_> + 4 8 17 1 3. + <_> + + <_> + 2 9 7 6 -1. + <_> + 2 11 7 2 3. + <_> + + <_> + 13 9 9 4 -1. + <_> + 13 11 9 2 2. + <_> + + <_> + 9 0 5 9 -1. + <_> + 6 3 5 3 3. + 1 + <_> + + <_> + 9 3 8 3 -1. + <_> + 9 3 4 3 2. + <_> + + <_> + 3 0 4 13 -1. + <_> + 4 0 2 13 2. + <_> + + <_> + 13 0 8 6 -1. + <_> + 15 0 4 6 2. + <_> + + <_> + 3 0 6 5 -1. + <_> + 6 0 3 5 2. + <_> + + <_> + 9 0 12 5 -1. + <_> + 9 0 6 5 2. + <_> + + <_> + 1 2 6 8 -1. + <_> + 3 2 2 8 3. + <_> + + <_> + 18 2 4 6 -1. + <_> + 18 2 2 6 2. + <_> + + <_> + 0 2 4 6 -1. + <_> + 2 2 2 6 2. + <_> + + <_> + 16 9 6 6 -1. + <_> + 16 11 6 2 3. + <_> + + <_> + 10 0 12 6 -1. + <_> + 13 3 6 6 2. + 1 + <_> + + <_> + 14 2 3 12 -1. + <_> + 10 6 3 4 3. + 1 + <_> + + <_> + 8 3 6 7 -1. + <_> + 11 3 3 7 2. + <_> + + <_> + 16 1 3 15 -1. + <_> + 17 1 1 15 3. + <_> + + <_> + 0 1 6 8 -1. + <_> + 2 1 2 8 3. + <_> + + <_> + 13 0 3 14 -1. + <_> + 14 0 1 14 3. + <_> + + <_> + 6 0 3 14 -1. + <_> + 7 0 1 14 3. + <_> + + <_> + 4 13 18 2 -1. + <_> + 4 13 9 2 2. + <_> + + <_> + 2 9 15 3 -1. + <_> + 7 9 5 3 3. + <_> + + <_> + 9 5 10 6 -1. + <_> + 14 5 5 3 2. + <_> + 9 8 5 3 2. + <_> + + <_> + 3 5 10 6 -1. + <_> + 3 5 5 3 2. + <_> + 8 8 5 3 2. + <_> + + <_> + 14 3 2 12 -1. + <_> + 14 3 1 12 2. + 1 + <_> + + <_> + 8 3 12 2 -1. + <_> + 8 3 12 1 2. + 1 + <_> + + <_> + 12 7 6 6 -1. + <_> + 14 7 2 6 3. + <_> + + <_> + 4 7 6 6 -1. + <_> + 6 7 2 6 3. + <_> + + <_> + 7 0 8 3 -1. + <_> + 7 0 4 3 2. + <_> + + <_> + 9 0 4 6 -1. + <_> + 11 0 2 6 2. + <_> + + <_> + 10 0 12 12 -1. + <_> + 13 0 6 12 2. + <_> + + <_> + 0 0 12 12 -1. + <_> + 3 0 6 12 2. + <_> + + <_> + 16 5 6 4 -1. + <_> + 16 5 3 4 2. + <_> + + <_> + 0 5 6 4 -1. + <_> + 3 5 3 4 2. + <_> + + <_> + 9 0 12 5 -1. + <_> + 9 0 6 5 2. + <_> + + <_> + 1 8 8 10 -1. + <_> + 1 8 4 5 2. + <_> + 5 13 4 5 2. + <_> + + <_> + 8 16 14 2 -1. + <_> + 8 16 7 2 2. + <_> + + <_> + 0 11 16 3 -1. + <_> + 8 11 8 3 2. + <_> + + <_> + 10 16 12 2 -1. + <_> + 10 16 6 2 2. + <_> + + <_> + 0 16 12 2 -1. + <_> + 6 16 6 2 2. + <_> + + <_> + 3 11 18 6 -1. + <_> + 12 11 9 3 2. + <_> + 3 14 9 3 2. + <_> + + <_> + 7 13 6 4 -1. + <_> + 7 15 6 2 2. + <_> + + <_> + 10 11 6 6 -1. + <_> + 10 13 6 2 3. + <_> + + <_> + 6 14 9 4 -1. + <_> + 9 14 3 4 3. + <_> + + <_> + 5 4 16 10 -1. + <_> + 5 9 16 5 2. + <_> + + <_> + 11 7 3 8 -1. + <_> + 11 7 3 4 2. + 1 + <_> + + <_> + 13 10 6 6 -1. + <_> + 13 12 6 2 3. + <_> + + <_> + 0 6 22 12 -1. + <_> + 0 6 11 6 2. + <_> + 11 12 11 6 2. + <_> + + <_> + 9 5 6 12 -1. + <_> + 12 5 3 6 2. + <_> + 9 11 3 6 2. + <_> + + <_> + 7 5 6 12 -1. + <_> + 7 5 3 6 2. + <_> + 10 11 3 6 2. + <_> + + <_> + 14 1 6 9 -1. + <_> + 14 4 6 3 3. + <_> + + <_> + 2 1 6 9 -1. + <_> + 2 4 6 3 3. + <_> + + <_> + 13 4 4 6 -1. + <_> + 13 7 4 3 2. + <_> + + <_> + 5 4 4 6 -1. + <_> + 5 7 4 3 2. + <_> + + <_> + 10 13 12 3 -1. + <_> + 10 14 12 1 3. + <_> + + <_> + 3 3 15 3 -1. + <_> + 3 4 15 1 3. + <_> + + <_> + 13 5 2 9 -1. + <_> + 13 5 1 9 2. + 1 + <_> + + <_> + 9 5 9 2 -1. + <_> + 9 5 9 1 2. + 1 + <_> + + <_> + 6 2 14 10 -1. + <_> + 6 2 7 10 2. + <_> + + <_> + 8 2 12 2 -1. + <_> + 8 2 12 1 2. + 1 + <_> + + <_> + 17 0 2 13 -1. + <_> + 17 0 1 13 2. + 1 + <_> + + <_> + 5 0 13 2 -1. + <_> + 5 0 13 1 2. + 1 + <_> + + <_> + 12 4 3 10 -1. + <_> + 12 4 3 5 2. + 1 + <_> + + <_> + 0 6 12 3 -1. + <_> + 0 7 12 1 3. + <_> + + <_> + 6 6 15 3 -1. + <_> + 6 7 15 1 3. + <_> + + <_> + 8 8 5 9 -1. + <_> + 8 11 5 3 3. + <_> + + <_> + 10 11 7 6 -1. + <_> + 10 13 7 2 3. + <_> + + <_> + 5 11 7 6 -1. + <_> + 5 13 7 2 3. + <_> + + <_> + 5 12 13 4 -1. + <_> + 5 13 13 2 2. + <_> + + <_> + 9 4 4 6 -1. + <_> + 9 7 4 3 2. + <_> + + <_> + 13 1 2 9 -1. + <_> + 13 1 1 9 2. + 1 + <_> + + <_> + 5 2 8 6 -1. + <_> + 5 2 4 3 2. + <_> + 9 5 4 3 2. + <_> + + <_> + 11 0 4 8 -1. + <_> + 12 1 2 8 2. + 1 + <_> + + <_> + 11 0 8 4 -1. + <_> + 10 1 8 2 2. + 1 + <_> + + <_> + 7 9 15 3 -1. + <_> + 7 10 15 1 3. + <_> + + <_> + 5 10 12 3 -1. + <_> + 5 11 12 1 3. + <_> + + <_> + 15 2 7 6 -1. + <_> + 15 4 7 2 3. + <_> + + <_> + 0 2 7 6 -1. + <_> + 0 4 7 2 3. + <_> + + <_> + 12 3 2 7 -1. + <_> + 12 3 1 7 2. + 1 + <_> + + <_> + 10 3 7 2 -1. + <_> + 10 3 7 1 2. + 1 + <_> + + <_> + 2 3 20 14 -1. + <_> + 12 3 10 7 2. + <_> + 2 10 10 7 2. + <_> + + <_> + 5 2 12 8 -1. + <_> + 11 2 6 8 2. + <_> + + <_> + 18 4 4 8 -1. + <_> + 18 8 4 4 2. + <_> + + <_> + 6 4 6 8 -1. + <_> + 6 4 3 4 2. + <_> + 9 8 3 4 2. + <_> + + <_> + 12 2 4 6 -1. + <_> + 12 2 2 6 2. + 1 + <_> + + <_> + 10 2 6 4 -1. + <_> + 10 2 6 2 2. + 1 + <_> + + <_> + 9 3 8 15 -1. + <_> + 11 3 4 15 2. + <_> + + <_> + 1 11 8 7 -1. + <_> + 3 11 4 7 2. + <_> + + <_> + 13 7 6 10 -1. + <_> + 15 7 2 10 3. + <_> + + <_> + 2 3 10 14 -1. + <_> + 7 3 5 14 2. + <_> + + <_> + 6 5 15 12 -1. + <_> + 11 5 5 12 3. + <_> + + <_> + 1 5 15 12 -1. + <_> + 6 5 5 12 3. + <_> + + <_> + 9 14 8 4 -1. + <_> + 9 16 8 2 2. + <_> + + <_> + 9 6 4 10 -1. + <_> + 11 6 2 10 2. + <_> + + <_> + 8 6 10 4 -1. + <_> + 8 8 10 2 2. + <_> + + <_> + 2 14 7 4 -1. + <_> + 2 16 7 2 2. + <_> + + <_> + 7 9 15 3 -1. + <_> + 7 10 15 1 3. + <_> + + <_> + 0 10 16 4 -1. + <_> + 0 10 8 2 2. + <_> + 8 12 8 2 2. + <_> + + <_> + 10 11 6 7 -1. + <_> + 12 11 2 7 3. + <_> + + <_> + 8 13 6 5 -1. + <_> + 11 13 3 5 2. + <_> + + <_> + 10 11 6 7 -1. + <_> + 12 11 2 7 3. + <_> + + <_> + 6 11 6 7 -1. + <_> + 8 11 2 7 3. + <_> + + <_> + 18 4 4 8 -1. + <_> + 18 8 4 4 2. + <_> + + <_> + 4 6 8 11 -1. + <_> + 8 6 4 11 2. + <_> + + <_> + 7 5 8 12 -1. + <_> + 9 5 4 12 2. + <_> + + <_> + 5 3 6 6 -1. + <_> + 7 3 2 6 3. + <_> + + <_> + 11 2 10 6 -1. + <_> + 11 2 10 3 2. + 1 + <_> + + <_> + 11 1 8 9 -1. + <_> + 11 1 4 9 2. + 1 + <_> + + <_> + 12 4 3 10 -1. + <_> + 12 4 3 5 2. + 1 + <_> + + <_> + 11 1 11 4 -1. + <_> + 11 1 11 2 2. + 1 + <_> + + <_> + 18 4 4 8 -1. + <_> + 18 8 4 4 2. + <_> + + <_> + 0 4 4 8 -1. + <_> + 0 8 4 4 2. + <_> + + <_> + 12 2 2 12 -1. + <_> + 12 2 1 12 2. + 1 + <_> + + <_> + 4 12 12 3 -1. + <_> + 4 13 12 1 3. + <_> + + <_> + 2 12 18 3 -1. + <_> + 2 13 18 1 3. + <_> + + <_> + 0 0 16 3 -1. + <_> + 0 1 16 1 3. + <_> + + <_> + 12 2 2 12 -1. + <_> + 12 2 1 12 2. + 1 + <_> + + <_> + 10 2 12 2 -1. + <_> + 10 2 12 1 2. + 1 + <_> + + <_> + 13 10 6 7 -1. + <_> + 15 10 2 7 3. + <_> + + <_> + 5 13 12 2 -1. + <_> + 11 13 6 2 2. + <_> + + <_> + 16 8 6 8 -1. + <_> + 19 8 3 4 2. + <_> + 16 12 3 4 2. + <_> + + <_> + 4 1 8 6 -1. + <_> + 4 3 8 2 3. + <_> + + <_> + 18 0 4 9 -1. + <_> + 18 3 4 3 3. + <_> + + <_> + 8 2 6 8 -1. + <_> + 8 6 6 4 2. + <_> + + <_> + 8 1 6 4 -1. + <_> + 8 3 6 2 2. + <_> + + <_> + 1 2 12 3 -1. + <_> + 1 3 12 1 3. + <_> + + <_> + 7 2 12 3 -1. + <_> + 7 3 12 1 3. + <_> + + <_> + 1 0 16 18 -1. + <_> + 1 9 16 9 2. + <_> + + <_> + 16 8 6 8 -1. + <_> + 19 8 3 4 2. + <_> + 16 12 3 4 2. + <_> + + <_> + 0 8 6 8 -1. + <_> + 0 8 3 4 2. + <_> + 3 12 3 4 2. + <_> + + <_> + 18 4 4 6 -1. + <_> + 18 7 4 3 2. + <_> + + <_> + 0 12 14 3 -1. + <_> + 0 13 14 1 3. + <_> + + <_> + 3 12 16 3 -1. + <_> + 3 13 16 1 3. + <_> + + <_> + 0 4 4 6 -1. + <_> + 0 7 4 3 2. + <_> + + <_> + 9 14 8 4 -1. + <_> + 9 16 8 2 2. + <_> + + <_> + 0 13 14 3 -1. + <_> + 0 14 14 1 3. + <_> + + <_> + 4 14 14 2 -1. + <_> + 4 15 14 1 2. + <_> + + <_> + 3 12 15 6 -1. + <_> + 3 15 15 3 2. + <_> + + <_> + 7 12 14 6 -1. + <_> + 7 15 14 3 2. + <_> + + <_> + 0 0 14 4 -1. + <_> + 0 2 14 2 2. + <_> + + <_> + 13 10 6 7 -1. + <_> + 15 10 2 7 3. + <_> + + <_> + 3 10 6 7 -1. + <_> + 5 10 2 7 3. + <_> + + <_> + 2 4 18 4 -1. + <_> + 8 4 6 4 3. + <_> + + <_> + 5 3 12 9 -1. + <_> + 9 6 4 3 9. + <_> + + <_> + 10 8 10 7 -1. + <_> + 10 8 5 7 2. + <_> + + <_> + 5 2 4 16 -1. + <_> + 5 6 4 8 2. + <_> + + <_> + 16 8 6 8 -1. + <_> + 19 8 3 4 2. + <_> + 16 12 3 4 2. + <_> + + <_> + 0 12 17 4 -1. + <_> + 0 14 17 2 2. + <_> + + <_> + 7 12 14 6 -1. + <_> + 7 15 14 3 2. + <_> + + <_> + 0 13 12 4 -1. + <_> + 0 13 6 2 2. + <_> + 6 15 6 2 2. + <_> + + <_> + 10 13 12 3 -1. + <_> + 10 14 12 1 3. + <_> + + <_> + 7 11 8 6 -1. + <_> + 7 11 4 3 2. + <_> + 11 14 4 3 2. + <_> + + <_> + 9 6 12 9 -1. + <_> + 12 6 6 9 2. + <_> + + <_> + 1 6 12 8 -1. + <_> + 4 6 6 8 2. + <_> + + <_> + 8 12 6 6 -1. + <_> + 8 14 6 2 3. + <_> + + <_> + 1 4 20 14 -1. + <_> + 1 4 10 7 2. + <_> + 11 11 10 7 2. + <_> + + <_> + 18 0 4 10 -1. + <_> + 19 1 2 10 2. + 1 + <_> + + <_> + 2 2 6 12 -1. + <_> + 2 5 6 6 2. + <_> + + <_> + 16 5 4 9 -1. + <_> + 16 8 4 3 3. + <_> + + <_> + 6 9 8 4 -1. + <_> + 10 9 4 4 2. + <_> + + <_> + 7 8 14 3 -1. + <_> + 7 8 7 3 2. + <_> + + <_> + 0 8 18 3 -1. + <_> + 9 8 9 3 2. + <_> + + <_> + 14 6 8 4 -1. + <_> + 14 6 8 2 2. + 1 + <_> + + <_> + 0 3 18 2 -1. + <_> + 9 3 9 2 2. + <_> + + <_> + 6 6 10 8 -1. + <_> + 6 8 10 4 2. + <_> + + <_> + 1 5 10 12 -1. + <_> + 1 8 10 6 2. + <_> + + <_> + 11 6 3 12 -1. + <_> + 12 6 1 12 3. + <_> + + <_> + 8 6 3 12 -1. + <_> + 9 6 1 12 3. + <_> + + <_> + 11 1 3 13 -1. + <_> + 12 1 1 13 3. + <_> + + <_> + 8 2 3 13 -1. + <_> + 9 2 1 13 3. + <_> + + <_> + 6 6 2 12 -1. + <_> + 6 12 2 6 2. + <_> + + <_> + 17 4 2 9 -1. + <_> + 17 4 1 9 2. + 1 + <_> + + <_> + 0 0 12 4 -1. + <_> + 0 1 12 2 2. + <_> + + <_> + 8 4 12 4 -1. + <_> + 14 4 6 2 2. + <_> + 8 6 6 2 2. + <_> + + <_> + 6 13 6 4 -1. + <_> + 6 15 6 2 2. + <_> + + <_> + 7 13 12 4 -1. + <_> + 7 15 12 2 2. + <_> + + <_> + 1 8 6 4 -1. + <_> + 4 8 3 4 2. + <_> + + <_> + 15 8 6 10 -1. + <_> + 15 8 3 10 2. + <_> + + <_> + 1 8 6 10 -1. + <_> + 4 8 3 10 2. + <_> + + <_> + 16 12 6 4 -1. + <_> + 16 12 3 4 2. + <_> + + <_> + 1 6 6 8 -1. + <_> + 1 6 3 4 2. + <_> + 4 10 3 4 2. + <_> + + <_> + 11 1 4 11 -1. + <_> + 12 2 2 11 2. + 1 + <_> + + <_> + 11 1 11 4 -1. + <_> + 10 2 11 2 2. + 1 + <_> + + <_> + 12 0 4 7 -1. + <_> + 13 1 2 7 2. + 1 + <_> + + <_> + 10 0 7 4 -1. + <_> + 9 1 7 2 2. + 1 + <_> + + <_> + 13 5 2 12 -1. + <_> + 13 5 1 12 2. + <_> + + <_> + 7 5 2 12 -1. + <_> + 8 5 1 12 2. + <_> + + <_> + 8 5 9 4 -1. + <_> + 11 5 3 4 3. + <_> + + <_> + 7 0 10 3 -1. + <_> + 6 1 10 1 3. + 1 + <_> + + <_> + 17 4 2 9 -1. + <_> + 17 4 1 9 2. + 1 + <_> + + <_> + 5 4 9 2 -1. + <_> + 5 4 9 1 2. + 1 + <_> + + <_> + 12 10 4 8 -1. + <_> + 12 10 2 8 2. + <_> + + <_> + 2 0 12 4 -1. + <_> + 2 0 6 2 2. + <_> + 8 2 6 2 2. + <_> + + <_> + 7 7 15 3 -1. + <_> + 7 8 15 1 3. + <_> + + <_> + 2 0 12 4 -1. + <_> + 2 0 6 2 2. + <_> + 8 2 6 2 2. + <_> + + <_> + 10 14 6 4 -1. + <_> + 10 14 3 4 2. + <_> + + <_> + 0 8 17 3 -1. + <_> + 0 9 17 1 3. + <_> + + <_> + 6 13 10 5 -1. + <_> + 6 13 5 5 2. + <_> + + <_> + 5 11 8 5 -1. + <_> + 9 11 4 5 2. + <_> + + <_> + 14 8 4 6 -1. + <_> + 14 8 2 6 2. + <_> + + <_> + 0 10 5 8 -1. + <_> + 0 14 5 4 2. + <_> + + <_> + 7 7 15 3 -1. + <_> + 7 8 15 1 3. + <_> + + <_> + 2 11 7 4 -1. + <_> + 2 13 7 2 2. + <_> + + <_> + 8 3 11 12 -1. + <_> + 8 6 11 6 2. + <_> + + <_> + 2 4 12 4 -1. + <_> + 2 4 6 2 2. + <_> + 8 6 6 2 2. + <_> + + <_> + 19 2 3 12 -1. + <_> + 20 3 1 12 3. + 1 + <_> + + <_> + 1 6 12 4 -1. + <_> + 1 6 6 2 2. + <_> + 7 8 6 2 2. + <_> + + <_> + 9 9 13 3 -1. + <_> + 9 10 13 1 3. + <_> + + <_> + 0 5 12 6 -1. + <_> + 0 5 6 3 2. + <_> + 6 8 6 3 2. + <_> + + <_> + 11 0 3 13 -1. + <_> + 12 0 1 13 3. + <_> + + <_> + 8 0 3 13 -1. + <_> + 9 0 1 13 3. + <_> + + <_> + 14 6 8 8 -1. + <_> + 14 10 8 4 2. + <_> + + <_> + 0 8 8 6 -1. + <_> + 0 10 8 2 3. + <_> + + <_> + 9 9 13 3 -1. + <_> + 9 10 13 1 3. + <_> + + <_> + 0 9 13 3 -1. + <_> + 0 10 13 1 3. + <_> + + <_> + 4 14 14 4 -1. + <_> + 11 14 7 2 2. + <_> + 4 16 7 2 2. + <_> + + <_> + 0 3 6 6 -1. + <_> + 2 3 2 6 3. + <_> + + <_> + 2 6 20 4 -1. + <_> + 7 6 10 4 2. + <_> + + <_> + 2 7 6 6 -1. + <_> + 4 7 2 6 3. + <_> + + <_> + 15 8 6 10 -1. + <_> + 17 8 2 10 3. + <_> + + <_> + 1 8 6 10 -1. + <_> + 3 8 2 10 3. + <_> + + <_> + 9 9 13 3 -1. + <_> + 9 10 13 1 3. + <_> + + <_> + 6 8 4 6 -1. + <_> + 6 8 4 3 2. + 1 + <_> + + <_> + 16 5 6 13 -1. + <_> + 16 5 3 13 2. + <_> + + <_> + 0 5 6 13 -1. + <_> + 3 5 3 13 2. + <_> + + <_> + 4 10 18 2 -1. + <_> + 4 10 9 2 2. + <_> + + <_> + 0 7 21 7 -1. + <_> + 7 7 7 7 3. + <_> + + <_> + 5 6 12 12 -1. + <_> + 9 6 4 12 3. + <_> + + <_> + 10 4 10 3 -1. + <_> + 9 5 10 1 3. + 1 + <_> + + <_> + 9 9 9 7 -1. + <_> + 12 9 3 7 3. + <_> + + <_> + 11 5 9 4 -1. + <_> + 14 8 3 4 3. + 1 + <_> + + <_> + 12 3 3 10 -1. + <_> + 12 3 3 5 2. + 1 + <_> + + <_> + 8 3 12 2 -1. + <_> + 8 3 6 2 2. + 1 + <_> + + <_> + 14 6 4 8 -1. + <_> + 14 10 4 4 2. + <_> + + <_> + 4 6 4 8 -1. + <_> + 4 10 4 4 2. + <_> + + <_> + 6 0 11 12 -1. + <_> + 6 3 11 6 2. + <_> + + <_> + 8 0 6 6 -1. + <_> + 8 3 6 3 2. + <_> + + <_> + 10 0 10 4 -1. + <_> + 10 0 5 4 2. + <_> + + <_> + 2 0 10 4 -1. + <_> + 7 0 5 4 2. + <_> + + <_> + 10 3 8 8 -1. + <_> + 14 3 4 4 2. + <_> + 10 7 4 4 2. + <_> + + <_> + 4 3 8 8 -1. + <_> + 4 3 4 4 2. + <_> + 8 7 4 4 2. + <_> + + <_> + 2 9 18 5 -1. + <_> + 8 9 6 5 3. + <_> + + <_> + 0 15 16 3 -1. + <_> + 0 16 16 1 3. + <_> + + <_> + 6 16 12 2 -1. + <_> + 6 17 12 1 2. + <_> + + <_> + 3 0 4 8 -1. + <_> + 3 4 4 4 2. + <_> + + <_> + 15 6 6 6 -1. + <_> + 13 8 6 2 3. + 1 + <_> + + <_> + 7 6 6 6 -1. + <_> + 9 8 2 6 3. + 1 + <_> + + <_> + 13 12 6 6 -1. + <_> + 13 14 6 2 3. + <_> + + <_> + 3 12 6 6 -1. + <_> + 3 14 6 2 3. + <_> + + <_> + 8 13 14 4 -1. + <_> + 8 14 14 2 2. + <_> + + <_> + 0 13 14 4 -1. + <_> + 0 14 14 2 2. + <_> + + <_> + 3 13 17 2 -1. + <_> + 3 14 17 1 2. + <_> + + <_> + 4 6 12 4 -1. + <_> + 8 6 4 4 3. + <_> + + <_> + 8 7 9 4 -1. + <_> + 11 7 3 4 3. + <_> + + <_> + 10 0 6 8 -1. + <_> + 8 2 6 4 2. + 1 + <_> + + <_> + 9 2 12 12 -1. + <_> + 9 6 12 4 3. + <_> + + <_> + 11 0 6 3 -1. + <_> + 10 1 6 1 3. + 1 + <_> + + <_> + 13 1 3 7 -1. + <_> + 14 2 1 7 3. + 1 + <_> + + <_> + 2 3 12 9 -1. + <_> + 6 6 4 3 9. + <_> + + <_> + 19 2 3 12 -1. + <_> + 20 3 1 12 3. + 1 + <_> + + <_> + 3 5 12 5 -1. + <_> + 7 5 4 5 3. + <_> + + <_> + 13 1 3 7 -1. + <_> + 14 2 1 7 3. + 1 + <_> + + <_> + 9 1 7 3 -1. + <_> + 8 2 7 1 3. + 1 + <_> + + <_> + 9 7 8 6 -1. + <_> + 13 7 4 3 2. + <_> + 9 10 4 3 2. + <_> + + <_> + 4 14 14 4 -1. + <_> + 4 15 14 2 2. + <_> + + <_> + 10 14 6 4 -1. + <_> + 10 14 3 4 2. + <_> + + <_> + 6 14 6 4 -1. + <_> + 9 14 3 4 2. + <_> + + <_> + 14 0 4 16 -1. + <_> + 16 0 2 8 2. + <_> + 14 8 2 8 2. + <_> + + <_> + 0 15 20 3 -1. + <_> + 5 15 10 3 2. + <_> + + <_> + 16 5 3 13 -1. + <_> + 17 5 1 13 3. + <_> + + <_> + 2 6 13 8 -1. + <_> + 2 10 13 4 2. + <_> + + <_> + 16 5 3 13 -1. + <_> + 17 5 1 13 3. + <_> + + <_> + 7 12 7 4 -1. + <_> + 7 14 7 2 2. + <_> + + <_> + 15 1 4 9 -1. + <_> + 15 4 4 3 3. + <_> + + <_> + 0 4 16 2 -1. + <_> + 0 5 16 1 2. + <_> + + <_> + 8 4 12 2 -1. + <_> + 8 5 12 1 2. + <_> + + <_> + 6 3 9 15 -1. + <_> + 9 8 3 5 9. + <_> + + <_> + 12 3 3 8 -1. + <_> + 12 7 3 4 2. + <_> + + <_> + 5 6 12 4 -1. + <_> + 5 6 6 2 2. + <_> + 11 8 6 2 2. + <_> + + <_> + 16 3 3 14 -1. + <_> + 17 3 1 14 3. + <_> + + <_> + 3 3 3 14 -1. + <_> + 4 3 1 14 3. + <_> + + <_> + 0 4 22 4 -1. + <_> + 11 4 11 2 2. + <_> + 0 6 11 2 2. + <_> + + <_> + 1 4 4 9 -1. + <_> + 1 7 4 3 3. + <_> + + <_> + 7 13 12 4 -1. + <_> + 7 15 12 2 2. + <_> + + <_> + 3 13 12 4 -1. + <_> + 3 15 12 2 2. + <_> + + <_> + 11 14 6 4 -1. + <_> + 11 16 6 2 2. + <_> + + <_> + 1 0 13 3 -1. + <_> + 1 1 13 1 3. + <_> + + <_> + 11 0 6 4 -1. + <_> + 11 2 6 2 2. + <_> + + <_> + 4 14 14 4 -1. + <_> + 4 14 7 2 2. + <_> + 11 16 7 2 2. + <_> + + <_> + 6 0 12 2 -1. + <_> + 6 1 12 1 2. + <_> + + <_> + 5 0 6 4 -1. + <_> + 5 2 6 2 2. + <_> + + <_> + 11 0 3 6 -1. + <_> + 12 1 1 6 3. + 1 + <_> + + <_> + 11 0 6 3 -1. + <_> + 10 1 6 1 3. + 1 + <_> + + <_> + 7 12 8 6 -1. + <_> + 9 12 4 6 2. + <_> + + <_> + 1 1 5 10 -1. + <_> + 1 6 5 5 2. + <_> + + <_> + 13 0 2 12 -1. + <_> + 13 6 2 6 2. + <_> + + <_> + 7 0 2 12 -1. + <_> + 7 6 2 6 2. + <_> + + <_> + 12 1 8 14 -1. + <_> + 16 1 4 7 2. + <_> + 12 8 4 7 2. + <_> + + <_> + 1 0 8 10 -1. + <_> + 1 0 4 5 2. + <_> + 5 5 4 5 2. + <_> + + <_> + 6 6 16 4 -1. + <_> + 10 6 8 4 2. + <_> + + <_> + 1 14 13 2 -1. + <_> + 1 15 13 1 2. + <_> + + <_> + 2 7 20 3 -1. + <_> + 7 7 10 3 2. + <_> + + <_> + 11 2 9 4 -1. + <_> + 14 5 3 4 3. + 1 + <_> + + <_> + 6 5 13 2 -1. + <_> + 6 6 13 1 2. + <_> + + <_> + 3 0 6 15 -1. + <_> + 6 0 3 15 2. + <_> + + <_> + 3 12 8 6 -1. + <_> + 5 12 4 6 2. + <_> + + <_> + 13 1 4 7 -1. + <_> + 14 2 2 7 2. + 1 + <_> + + <_> + 9 1 7 4 -1. + <_> + 8 2 7 2 2. + 1 + <_> + + <_> + 11 11 6 4 -1. + <_> + 11 13 6 2 2. + <_> + + <_> + 0 12 8 6 -1. + <_> + 0 12 4 3 2. + <_> + 4 15 4 3 2. + <_> + + <_> + 11 11 6 4 -1. + <_> + 11 13 6 2 2. + <_> + + <_> + 2 6 6 12 -1. + <_> + 2 6 3 6 2. + <_> + 5 12 3 6 2. + <_> + + <_> + 11 11 6 4 -1. + <_> + 11 13 6 2 2. + <_> + + <_> + 5 11 9 4 -1. + <_> + 8 11 3 4 3. + <_> + + <_> + 8 13 9 5 -1. + <_> + 11 13 3 5 3. + <_> + + <_> + 3 15 8 3 -1. + <_> + 7 15 4 3 2. + <_> + + <_> + 4 12 14 6 -1. + <_> + 11 12 7 3 2. + <_> + 4 15 7 3 2. + <_> + + <_> + 2 15 8 3 -1. + <_> + 6 15 4 3 2. + <_> + + <_> + 11 11 6 4 -1. + <_> + 11 13 6 2 2. + <_> + + <_> + 6 5 6 7 -1. + <_> + 8 5 2 7 3. + <_> + + <_> + 8 4 9 12 -1. + <_> + 11 8 3 4 9. + <_> + + <_> + 5 4 9 12 -1. + <_> + 8 8 3 4 9. + <_> + + <_> + 14 12 6 4 -1. + <_> + 14 14 6 2 2. + <_> + + <_> + 2 12 6 4 -1. + <_> + 2 14 6 2 2. + <_> + + <_> + 9 6 6 8 -1. + <_> + 11 6 2 8 3. + <_> + + <_> + 7 4 8 6 -1. + <_> + 7 6 8 2 3. + <_> + + <_> + 13 7 6 4 -1. + <_> + 13 7 6 2 2. + 1 + <_> + + <_> + 10 2 12 3 -1. + <_> + 9 3 12 1 3. + 1 + <_> + + <_> + 12 4 6 6 -1. + <_> + 14 6 2 6 3. + 1 + <_> + + <_> + 10 4 6 6 -1. + <_> + 8 6 6 2 3. + 1 + <_> + + <_> + 11 5 3 9 -1. + <_> + 12 6 1 9 3. + 1 + <_> + + <_> + 4 0 16 2 -1. + <_> + 4 0 16 1 2. + 1 + <_> + + <_> + 12 12 8 3 -1. + <_> + 12 12 4 3 2. + <_> + + <_> + 10 0 12 6 -1. + <_> + 13 3 6 6 2. + 1 + <_> + + <_> + 9 2 4 6 -1. + <_> + 9 5 4 3 2. + <_> + + <_> + 0 2 18 9 -1. + <_> + 6 5 6 3 9. + <_> + + <_> + 16 2 3 9 -1. + <_> + 17 3 1 9 3. + 1 + <_> + + <_> + 6 2 9 3 -1. + <_> + 5 3 9 1 3. + 1 + <_> + + <_> + 10 1 12 4 -1. + <_> + 14 1 4 4 3. + <_> + + <_> + 0 1 12 4 -1. + <_> + 4 1 4 4 3. + <_> + + <_> + 6 14 12 4 -1. + <_> + 12 14 6 2 2. + <_> + 6 16 6 2 2. + <_> + + <_> + 4 2 13 3 -1. + <_> + 4 3 13 1 3. + <_> + + <_> + 7 2 13 3 -1. + <_> + 7 3 13 1 3. + <_> + + <_> + 1 12 20 2 -1. + <_> + 11 12 10 2 2. + <_> + + <_> + 5 2 12 3 -1. + <_> + 9 2 4 3 3. + <_> + + <_> + 4 8 14 9 -1. + <_> + 11 8 7 9 2. + <_> + + <_> + 10 2 4 8 -1. + <_> + 10 2 2 8 2. + <_> + + <_> + 8 2 4 8 -1. + <_> + 10 2 2 8 2. + <_> + + <_> + 16 1 2 16 -1. + <_> + 16 9 2 8 2. + <_> + + <_> + 2 8 9 4 -1. + <_> + 5 8 3 4 3. + <_> + + <_> + 16 1 2 16 -1. + <_> + 16 9 2 8 2. + <_> + + <_> + 4 1 2 16 -1. + <_> + 4 9 2 8 2. + <_> + + <_> + 10 7 8 6 -1. + <_> + 14 7 4 3 2. + <_> + 10 10 4 3 2. + <_> + + <_> + 4 7 8 6 -1. + <_> + 4 7 4 3 2. + <_> + 8 10 4 3 2. + <_> + + <_> + 12 8 2 7 -1. + <_> + 12 8 1 7 2. + 1 + <_> + + <_> + 5 8 6 8 -1. + <_> + 5 8 3 4 2. + <_> + 8 12 3 4 2. + <_> + + <_> + 12 8 2 7 -1. + <_> + 12 8 1 7 2. + 1 + <_> + + <_> + 10 8 7 2 -1. + <_> + 10 8 7 1 2. + 1 + <_> + + <_> + 5 9 13 8 -1. + <_> + 5 11 13 4 2. + <_> + + <_> + 7 9 4 9 -1. + <_> + 9 9 2 9 2. + <_> + + <_> + 9 6 6 10 -1. + <_> + 11 6 2 10 3. + <_> + + <_> + 7 6 6 10 -1. + <_> + 9 6 2 10 3. + <_> + + <_> + 6 0 14 6 -1. + <_> + 13 0 7 3 2. + <_> + 6 3 7 3 2. + <_> + + <_> + 2 0 14 6 -1. + <_> + 2 0 7 3 2. + <_> + 9 3 7 3 2. + <_> + + <_> + 3 6 16 3 -1. + <_> + 3 7 16 1 3. + <_> + + <_> + 1 6 15 3 -1. + <_> + 1 7 15 1 3. + <_> + + <_> + 8 5 8 4 -1. + <_> + 8 7 8 2 2. + <_> + + <_> + 2 4 12 10 -1. + <_> + 8 4 6 10 2. + <_> + + <_> + 7 0 14 16 -1. + <_> + 7 0 7 16 2. + <_> + + <_> + 1 1 18 3 -1. + <_> + 10 1 9 3 2. + <_> + + <_> + 8 8 12 2 -1. + <_> + 8 8 6 2 2. + <_> + + <_> + 8 1 6 4 -1. + <_> + 11 1 3 4 2. + <_> + + <_> + 11 0 4 10 -1. + <_> + 12 1 2 10 2. + 1 + <_> + + <_> + 11 0 10 4 -1. + <_> + 10 1 10 2 2. + 1 + <_> + + <_> + 13 7 9 4 -1. + <_> + 16 7 3 4 3. + <_> + + <_> + 11 1 6 2 -1. + <_> + 11 1 6 1 2. + 1 + <_> + + <_> + 8 8 12 2 -1. + <_> + 8 8 6 2 2. + <_> + + <_> + 7 12 6 5 -1. + <_> + 10 12 3 5 2. + <_> + + <_> + 10 7 9 11 -1. + <_> + 13 7 3 11 3. + <_> + + <_> + 6 15 8 3 -1. + <_> + 10 15 4 3 2. + <_> + + <_> + 19 3 2 12 -1. + <_> + 19 3 1 12 2. + <_> + + <_> + 1 3 2 12 -1. + <_> + 2 3 1 12 2. + <_> + + <_> + 11 1 9 10 -1. + <_> + 14 1 3 10 3. + <_> + + <_> + 1 3 16 6 -1. + <_> + 5 3 8 6 2. + <_> + + <_> + 7 1 12 12 -1. + <_> + 11 1 4 12 3. + <_> + + <_> + 2 8 12 2 -1. + <_> + 8 8 6 2 2. + <_> + + <_> + 14 7 3 10 -1. + <_> + 14 12 3 5 2. + <_> + + <_> + 1 15 18 3 -1. + <_> + 10 15 9 3 2. + <_> + + <_> + 9 0 13 3 -1. + <_> + 9 1 13 1 3. + <_> + + <_> + 5 0 12 3 -1. + <_> + 5 1 12 1 3. + <_> + + <_> + 12 1 2 15 -1. + <_> + 12 1 1 15 2. + <_> + + <_> + 8 1 2 15 -1. + <_> + 9 1 1 15 2. + <_> + + <_> + 12 2 3 13 -1. + <_> + 13 2 1 13 3. + <_> + + <_> + 1 6 4 8 -1. + <_> + 3 6 2 8 2. + <_> + + <_> + 17 1 4 12 -1. + <_> + 19 1 2 6 2. + <_> + 17 7 2 6 2. + <_> + + <_> + 1 1 4 12 -1. + <_> + 1 1 2 6 2. + <_> + 3 7 2 6 2. + <_> + + <_> + 17 0 4 7 -1. + <_> + 17 0 2 7 2. + <_> + + <_> + 1 0 4 7 -1. + <_> + 3 0 2 7 2. + <_> + + <_> + 12 2 3 13 -1. + <_> + 13 2 1 13 3. + <_> + + <_> + 7 4 5 9 -1. + <_> + 7 7 5 3 3. + <_> + + <_> + 12 2 3 13 -1. + <_> + 13 2 1 13 3. + <_> + + <_> + 7 2 3 13 -1. + <_> + 8 2 1 13 3. + <_> + + <_> + 3 5 17 4 -1. + <_> + 3 6 17 2 2. + <_> + + <_> + 2 3 18 3 -1. + <_> + 2 4 18 1 3. + <_> + + <_> + 11 11 6 4 -1. + <_> + 11 13 6 2 2. + <_> + + <_> + 5 11 6 4 -1. + <_> + 5 13 6 2 2. + <_> + + <_> + 15 5 6 4 -1. + <_> + 15 5 6 2 2. + 1 + <_> + + <_> + 7 5 4 6 -1. + <_> + 7 5 2 6 2. + 1 + <_> + + <_> + 13 1 8 8 -1. + <_> + 15 1 4 8 2. + <_> + + <_> + 3 1 12 12 -1. + <_> + 7 1 4 12 3. + <_> + + <_> + 14 2 4 12 -1. + <_> + 14 2 2 12 2. + <_> + + <_> + 4 2 4 12 -1. + <_> + 6 2 2 12 2. + <_> + + <_> + 15 0 2 14 -1. + <_> + 15 0 1 14 2. + <_> + + <_> + 5 0 2 14 -1. + <_> + 6 0 1 14 2. + <_> + + <_> + 15 1 7 15 -1. + <_> + 15 6 7 5 3. + <_> + + <_> + 6 1 7 6 -1. + <_> + 4 3 7 2 3. + 1 + <_> + + <_> + 1 4 20 14 -1. + <_> + 11 4 10 7 2. + <_> + 1 11 10 7 2. + <_> + + <_> + 1 2 6 8 -1. + <_> + 3 2 2 8 3. + <_> + + <_> + 15 0 2 13 -1. + <_> + 15 0 1 13 2. + <_> + + <_> + 2 1 9 10 -1. + <_> + 5 1 3 10 3. + <_> + + <_> + 9 9 6 6 -1. + <_> + 11 9 2 6 3. + <_> + + <_> + 5 5 8 4 -1. + <_> + 5 5 8 2 2. + 1 + <_> + + <_> + 5 8 14 4 -1. + <_> + 5 9 14 2 2. + <_> + + <_> + 0 7 20 2 -1. + <_> + 10 7 10 2 2. + <_> + + <_> + 8 0 10 10 -1. + <_> + 8 0 5 10 2. + <_> + + <_> + 4 0 10 10 -1. + <_> + 9 0 5 10 2. + <_> + + <_> + 5 1 15 10 -1. + <_> + 10 1 5 10 3. + <_> + + <_> + 0 9 18 4 -1. + <_> + 0 10 18 2 2. + <_> + + <_> + 8 8 10 6 -1. + <_> + 8 10 10 2 3. + <_> + + <_> + 4 8 10 6 -1. + <_> + 4 10 10 2 3. + <_> + + <_> + 11 6 10 12 -1. + <_> + 11 10 10 4 3. + <_> + + <_> + 8 5 4 8 -1. + <_> + 8 5 4 4 2. + 1 + <_> + + <_> + 17 8 5 6 -1. + <_> + 17 11 5 3 2. + <_> + + <_> + 8 11 4 7 -1. + <_> + 10 11 2 7 2. + <_> + + <_> + 9 5 12 3 -1. + <_> + 9 6 12 1 3. + <_> + + <_> + 2 9 13 3 -1. + <_> + 2 10 13 1 3. + <_> + + <_> + 3 13 16 3 -1. + <_> + 3 13 8 3 2. + <_> + + <_> + 5 12 8 4 -1. + <_> + 9 12 4 4 2. + <_> + + <_> + 14 8 6 9 -1. + <_> + 14 11 6 3 3. + <_> + + <_> + 4 10 12 3 -1. + <_> + 4 11 12 1 3. + <_> + + <_> + 6 7 11 9 -1. + <_> + 6 10 11 3 3. + <_> + + <_> + 4 1 9 4 -1. + <_> + 7 4 3 4 3. + 1 + <_> + + <_> + 12 1 9 9 -1. + <_> + 15 1 3 9 3. + <_> + + <_> + 1 1 9 9 -1. + <_> + 4 1 3 9 3. + <_> + + <_> + 14 1 6 6 -1. + <_> + 16 1 2 6 3. + <_> + + <_> + 4 6 4 6 -1. + <_> + 6 6 2 6 2. + <_> + + <_> + 7 5 12 7 -1. + <_> + 10 5 6 7 2. + <_> + + <_> + 3 5 12 7 -1. + <_> + 6 5 6 7 2. + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/detail/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/detail/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..71917cce8679bbfddc13b7fcc650b713f12d9251 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/detail/__init__.pyi @@ -0,0 +1,600 @@ +__all__: list[str] = [] + +import cv2 +import cv2.gapi +import cv2.gapi.ie +import cv2.gapi.onnx +import cv2.gapi.ov +import cv2.typing +import numpy +import typing as _typing + + +# Enumerations +TEST_CUSTOM: int +TEST_EQ: int +TEST_NE: int +TEST_LE: int +TEST_LT: int +TEST_GE: int +TEST_GT: int +TestOp = int +"""One of [TEST_CUSTOM, TEST_EQ, TEST_NE, TEST_LE, TEST_LT, TEST_GE, TEST_GT]""" + +WAVE_CORRECT_HORIZ: int +WAVE_CORRECT_VERT: int +WAVE_CORRECT_AUTO: int +WaveCorrectKind = int +"""One of [WAVE_CORRECT_HORIZ, WAVE_CORRECT_VERT, WAVE_CORRECT_AUTO]""" + +OpaqueKind_CV_UNKNOWN: int +OPAQUE_KIND_CV_UNKNOWN: int +OpaqueKind_CV_BOOL: int +OPAQUE_KIND_CV_BOOL: int +OpaqueKind_CV_INT: int +OPAQUE_KIND_CV_INT: int +OpaqueKind_CV_INT64: int +OPAQUE_KIND_CV_INT64: int +OpaqueKind_CV_DOUBLE: int +OPAQUE_KIND_CV_DOUBLE: int +OpaqueKind_CV_FLOAT: int +OPAQUE_KIND_CV_FLOAT: int +OpaqueKind_CV_UINT64: int +OPAQUE_KIND_CV_UINT64: int +OpaqueKind_CV_STRING: int +OPAQUE_KIND_CV_STRING: int +OpaqueKind_CV_POINT: int +OPAQUE_KIND_CV_POINT: int +OpaqueKind_CV_POINT2F: int +OPAQUE_KIND_CV_POINT2F: int +OpaqueKind_CV_POINT3F: int +OPAQUE_KIND_CV_POINT3F: int +OpaqueKind_CV_SIZE: int +OPAQUE_KIND_CV_SIZE: int +OpaqueKind_CV_RECT: int +OPAQUE_KIND_CV_RECT: int +OpaqueKind_CV_SCALAR: int +OPAQUE_KIND_CV_SCALAR: int +OpaqueKind_CV_MAT: int +OPAQUE_KIND_CV_MAT: int +OpaqueKind_CV_DRAW_PRIM: int +OPAQUE_KIND_CV_DRAW_PRIM: int +OpaqueKind = int +"""One of [OpaqueKind_CV_UNKNOWN, OPAQUE_KIND_CV_UNKNOWN, OpaqueKind_CV_BOOL, OPAQUE_KIND_CV_BOOL, OpaqueKind_CV_INT, OPAQUE_KIND_CV_INT, OpaqueKind_CV_INT64, OPAQUE_KIND_CV_INT64, OpaqueKind_CV_DOUBLE, OPAQUE_KIND_CV_DOUBLE, OpaqueKind_CV_FLOAT, OPAQUE_KIND_CV_FLOAT, OpaqueKind_CV_UINT64, OPAQUE_KIND_CV_UINT64, OpaqueKind_CV_STRING, OPAQUE_KIND_CV_STRING, OpaqueKind_CV_POINT, OPAQUE_KIND_CV_POINT, OpaqueKind_CV_POINT2F, OPAQUE_KIND_CV_POINT2F, OpaqueKind_CV_POINT3F, OPAQUE_KIND_CV_POINT3F, OpaqueKind_CV_SIZE, OPAQUE_KIND_CV_SIZE, OpaqueKind_CV_RECT, OPAQUE_KIND_CV_RECT, OpaqueKind_CV_SCALAR, OPAQUE_KIND_CV_SCALAR, OpaqueKind_CV_MAT, OPAQUE_KIND_CV_MAT, OpaqueKind_CV_DRAW_PRIM, OPAQUE_KIND_CV_DRAW_PRIM]""" + +ArgKind_OPAQUE_VAL: int +ARG_KIND_OPAQUE_VAL: int +ArgKind_OPAQUE: int +ARG_KIND_OPAQUE: int +ArgKind_GOBJREF: int +ARG_KIND_GOBJREF: int +ArgKind_GMAT: int +ARG_KIND_GMAT: int +ArgKind_GMATP: int +ARG_KIND_GMATP: int +ArgKind_GFRAME: int +ARG_KIND_GFRAME: int +ArgKind_GSCALAR: int +ARG_KIND_GSCALAR: int +ArgKind_GARRAY: int +ARG_KIND_GARRAY: int +ArgKind_GOPAQUE: int +ARG_KIND_GOPAQUE: int +ArgKind = int +"""One of [ArgKind_OPAQUE_VAL, ARG_KIND_OPAQUE_VAL, ArgKind_OPAQUE, ARG_KIND_OPAQUE, ArgKind_GOBJREF, ARG_KIND_GOBJREF, ArgKind_GMAT, ARG_KIND_GMAT, ArgKind_GMATP, ARG_KIND_GMATP, ArgKind_GFRAME, ARG_KIND_GFRAME, ArgKind_GSCALAR, ARG_KIND_GSCALAR, ArgKind_GARRAY, ARG_KIND_GARRAY, ArgKind_GOPAQUE, ARG_KIND_GOPAQUE]""" + + +Blender_NO: int +BLENDER_NO: int +Blender_FEATHER: int +BLENDER_FEATHER: int +Blender_MULTI_BAND: int +BLENDER_MULTI_BAND: int + +ExposureCompensator_NO: int +EXPOSURE_COMPENSATOR_NO: int +ExposureCompensator_GAIN: int +EXPOSURE_COMPENSATOR_GAIN: int +ExposureCompensator_GAIN_BLOCKS: int +EXPOSURE_COMPENSATOR_GAIN_BLOCKS: int +ExposureCompensator_CHANNELS: int +EXPOSURE_COMPENSATOR_CHANNELS: int +ExposureCompensator_CHANNELS_BLOCKS: int +EXPOSURE_COMPENSATOR_CHANNELS_BLOCKS: int + +SeamFinder_NO: int +SEAM_FINDER_NO: int +SeamFinder_VORONOI_SEAM: int +SEAM_FINDER_VORONOI_SEAM: int +SeamFinder_DP_SEAM: int +SEAM_FINDER_DP_SEAM: int + +DpSeamFinder_COLOR: int +DP_SEAM_FINDER_COLOR: int +DpSeamFinder_COLOR_GRAD: int +DP_SEAM_FINDER_COLOR_GRAD: int +DpSeamFinder_CostFunction = int +"""One of [DpSeamFinder_COLOR, DP_SEAM_FINDER_COLOR, DpSeamFinder_COLOR_GRAD, DP_SEAM_FINDER_COLOR_GRAD]""" + +Timelapser_AS_IS: int +TIMELAPSER_AS_IS: int +Timelapser_CROP: int +TIMELAPSER_CROP: int + +GraphCutSeamFinderBase_COST_COLOR: int +GRAPH_CUT_SEAM_FINDER_BASE_COST_COLOR: int +GraphCutSeamFinderBase_COST_COLOR_GRAD: int +GRAPH_CUT_SEAM_FINDER_BASE_COST_COLOR_GRAD: int +GraphCutSeamFinderBase_CostType = int +"""One of [GraphCutSeamFinderBase_COST_COLOR, GRAPH_CUT_SEAM_FINDER_BASE_COST_COLOR, GraphCutSeamFinderBase_COST_COLOR_GRAD, GRAPH_CUT_SEAM_FINDER_BASE_COST_COLOR_GRAD]""" + +TrackerSamplerCSC_MODE_INIT_POS: int +TRACKER_SAMPLER_CSC_MODE_INIT_POS: int +TrackerSamplerCSC_MODE_INIT_NEG: int +TRACKER_SAMPLER_CSC_MODE_INIT_NEG: int +TrackerSamplerCSC_MODE_TRACK_POS: int +TRACKER_SAMPLER_CSC_MODE_TRACK_POS: int +TrackerSamplerCSC_MODE_TRACK_NEG: int +TRACKER_SAMPLER_CSC_MODE_TRACK_NEG: int +TrackerSamplerCSC_MODE_DETECT: int +TRACKER_SAMPLER_CSC_MODE_DETECT: int +TrackerSamplerCSC_MODE = int +"""One of [TrackerSamplerCSC_MODE_INIT_POS, TRACKER_SAMPLER_CSC_MODE_INIT_POS, TrackerSamplerCSC_MODE_INIT_NEG, TRACKER_SAMPLER_CSC_MODE_INIT_NEG, TrackerSamplerCSC_MODE_TRACK_POS, TRACKER_SAMPLER_CSC_MODE_TRACK_POS, TrackerSamplerCSC_MODE_TRACK_NEG, TRACKER_SAMPLER_CSC_MODE_TRACK_NEG, TrackerSamplerCSC_MODE_DETECT, TRACKER_SAMPLER_CSC_MODE_DETECT]""" + + +# Classes +class Blender: + # Functions + @classmethod + def createDefault(cls, type: int, try_gpu: bool = ...) -> Blender: ... + + @_typing.overload + def prepare(self, corners: _typing.Sequence[cv2.typing.Point], sizes: _typing.Sequence[cv2.typing.Size]) -> None: ... + @_typing.overload + def prepare(self, dst_roi: cv2.typing.Rect) -> None: ... + + @_typing.overload + def feed(self, img: cv2.typing.MatLike, mask: cv2.typing.MatLike, tl: cv2.typing.Point) -> None: ... + @_typing.overload + def feed(self, img: cv2.UMat, mask: cv2.UMat, tl: cv2.typing.Point) -> None: ... + + @_typing.overload + def blend(self, dst: cv2.typing.MatLike, dst_mask: cv2.typing.MatLike) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def blend(self, dst: cv2.UMat, dst_mask: cv2.UMat) -> tuple[cv2.UMat, cv2.UMat]: ... + + +class FeatherBlender(Blender): + # Functions + def __init__(self, sharpness: float = ...) -> None: ... + + def sharpness(self) -> float: ... + + def setSharpness(self, val: float) -> None: ... + + def prepare(self, dst_roi: cv2.typing.Rect) -> None: ... + + @_typing.overload + def feed(self, img: cv2.typing.MatLike, mask: cv2.typing.MatLike, tl: cv2.typing.Point) -> None: ... + @_typing.overload + def feed(self, img: cv2.UMat, mask: cv2.UMat, tl: cv2.typing.Point) -> None: ... + + @_typing.overload + def blend(self, dst: cv2.typing.MatLike, dst_mask: cv2.typing.MatLike) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def blend(self, dst: cv2.UMat, dst_mask: cv2.UMat) -> tuple[cv2.UMat, cv2.UMat]: ... + + def createWeightMaps(self, masks: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], weight_maps: _typing.Sequence[cv2.UMat]) -> tuple[cv2.typing.Rect, _typing.Sequence[cv2.UMat]]: ... + + +class MultiBandBlender(Blender): + # Functions + def __init__(self, try_gpu: int = ..., num_bands: int = ..., weight_type: int = ...) -> None: ... + + def numBands(self) -> int: ... + + def setNumBands(self, val: int) -> None: ... + + def prepare(self, dst_roi: cv2.typing.Rect) -> None: ... + + @_typing.overload + def feed(self, img: cv2.typing.MatLike, mask: cv2.typing.MatLike, tl: cv2.typing.Point) -> None: ... + @_typing.overload + def feed(self, img: cv2.UMat, mask: cv2.UMat, tl: cv2.typing.Point) -> None: ... + + @_typing.overload + def blend(self, dst: cv2.typing.MatLike, dst_mask: cv2.typing.MatLike) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def blend(self, dst: cv2.UMat, dst_mask: cv2.UMat) -> tuple[cv2.UMat, cv2.UMat]: ... + + +class CameraParams: + focal: float + aspect: float + ppx: float + ppy: float + R: cv2.typing.MatLike + t: cv2.typing.MatLike + + # Functions + def K(self) -> cv2.typing.MatLike: ... + + +class ExposureCompensator: + # Functions + @classmethod + def createDefault(cls, type: int) -> ExposureCompensator: ... + + def feed(self, corners: _typing.Sequence[cv2.typing.Point], images: _typing.Sequence[cv2.UMat], masks: _typing.Sequence[cv2.UMat]) -> None: ... + + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ... + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ... + + def getMatGains(self, arg1: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + + def setMatGains(self, arg1: _typing.Sequence[cv2.typing.MatLike]) -> None: ... + + def setUpdateGain(self, b: bool) -> None: ... + + def getUpdateGain(self) -> bool: ... + + +class NoExposureCompensator(ExposureCompensator): + # Functions + @_typing.overload + def apply(self, arg1: int, arg2: cv2.typing.Point, arg3: cv2.typing.MatLike, arg4: cv2.typing.MatLike) -> cv2.typing.MatLike: ... + @_typing.overload + def apply(self, arg1: int, arg2: cv2.typing.Point, arg3: cv2.UMat, arg4: cv2.UMat) -> cv2.UMat: ... + + def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + + def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ... + + +class GainCompensator(ExposureCompensator): + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, nr_feeds: int) -> None: ... + + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ... + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ... + + def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + + def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ... + + def setNrFeeds(self, nr_feeds: int) -> None: ... + + def getNrFeeds(self) -> int: ... + + def setSimilarityThreshold(self, similarity_threshold: float) -> None: ... + + def getSimilarityThreshold(self) -> float: ... + + +class ChannelsCompensator(ExposureCompensator): + # Functions + def __init__(self, nr_feeds: int = ...) -> None: ... + + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ... + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ... + + def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + + def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ... + + def setNrFeeds(self, nr_feeds: int) -> None: ... + + def getNrFeeds(self) -> int: ... + + def setSimilarityThreshold(self, similarity_threshold: float) -> None: ... + + def getSimilarityThreshold(self) -> float: ... + + +class BlocksCompensator(ExposureCompensator): + # Functions + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ... + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ... + + def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + + def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ... + + def setNrFeeds(self, nr_feeds: int) -> None: ... + + def getNrFeeds(self) -> int: ... + + def setSimilarityThreshold(self, similarity_threshold: float) -> None: ... + + def getSimilarityThreshold(self) -> float: ... + + @_typing.overload + def setBlockSize(self, width: int, height: int) -> None: ... + @_typing.overload + def setBlockSize(self, size: cv2.typing.Size) -> None: ... + + def getBlockSize(self) -> cv2.typing.Size: ... + + def setNrGainsFilteringIterations(self, nr_iterations: int) -> None: ... + + def getNrGainsFilteringIterations(self) -> int: ... + + +class BlocksGainCompensator(BlocksCompensator): + # Functions + @_typing.overload + def __init__(self, bl_width: int = ..., bl_height: int = ...) -> None: ... + @_typing.overload + def __init__(self, bl_width: int, bl_height: int, nr_feeds: int) -> None: ... + + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ... + @_typing.overload + def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ... + + def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + + def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ... + + +class BlocksChannelsCompensator(BlocksCompensator): + # Functions + def __init__(self, bl_width: int = ..., bl_height: int = ..., nr_feeds: int = ...) -> None: ... + + +class ImageFeatures: + img_idx: int + img_size: cv2.typing.Size + keypoints: _typing.Sequence[cv2.KeyPoint] + descriptors: cv2.UMat + + # Functions + def getKeypoints(self) -> _typing.Sequence[cv2.KeyPoint]: ... + + +class MatchesInfo: + src_img_idx: int + dst_img_idx: int + matches: _typing.Sequence[cv2.DMatch] + inliers_mask: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] + num_inliers: int + H: cv2.typing.MatLike + confidence: float + + # Functions + def getMatches(self) -> _typing.Sequence[cv2.DMatch]: ... + + def getInliers(self) -> numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]: ... + + +class FeaturesMatcher: + # Functions + def apply(self, features1: ImageFeatures, features2: ImageFeatures) -> MatchesInfo: ... + + def apply2(self, features: _typing.Sequence[ImageFeatures], mask: cv2.UMat | None = ...) -> _typing.Sequence[MatchesInfo]: ... + + def isThreadSafe(self) -> bool: ... + + def collectGarbage(self) -> None: ... + + +class BestOf2NearestMatcher(FeaturesMatcher): + # Functions + def __init__(self, try_use_gpu: bool = ..., match_conf: float = ..., num_matches_thresh1: int = ..., num_matches_thresh2: int = ..., matches_confindece_thresh: float = ...) -> None: ... + + def collectGarbage(self) -> None: ... + + @classmethod + def create(cls, try_use_gpu: bool = ..., match_conf: float = ..., num_matches_thresh1: int = ..., num_matches_thresh2: int = ..., matches_confindece_thresh: float = ...) -> BestOf2NearestMatcher: ... + + +class BestOf2NearestRangeMatcher(BestOf2NearestMatcher): + # Functions + def __init__(self, range_width: int = ..., try_use_gpu: bool = ..., match_conf: float = ..., num_matches_thresh1: int = ..., num_matches_thresh2: int = ...) -> None: ... + + +class AffineBestOf2NearestMatcher(BestOf2NearestMatcher): + # Functions + def __init__(self, full_affine: bool = ..., try_use_gpu: bool = ..., match_conf: float = ..., num_matches_thresh1: int = ...) -> None: ... + + +class Estimator: + # Functions + def apply(self, features: _typing.Sequence[ImageFeatures], pairwise_matches: _typing.Sequence[MatchesInfo], cameras: _typing.Sequence[CameraParams]) -> tuple[bool, _typing.Sequence[CameraParams]]: ... + + +class HomographyBasedEstimator(Estimator): + # Functions + def __init__(self, is_focals_estimated: bool = ...) -> None: ... + + +class AffineBasedEstimator(Estimator): + # Functions + def __init__(self) -> None: ... + + +class BundleAdjusterBase(Estimator): + # Functions + def refinementMask(self) -> cv2.typing.MatLike: ... + + def setRefinementMask(self, mask: cv2.typing.MatLike) -> None: ... + + def confThresh(self) -> float: ... + + def setConfThresh(self, conf_thresh: float) -> None: ... + + def termCriteria(self) -> cv2.typing.TermCriteria: ... + + def setTermCriteria(self, term_criteria: cv2.typing.TermCriteria) -> None: ... + + +class NoBundleAdjuster(BundleAdjusterBase): + # Functions + def __init__(self) -> None: ... + + +class BundleAdjusterReproj(BundleAdjusterBase): + # Functions + def __init__(self) -> None: ... + + +class BundleAdjusterRay(BundleAdjusterBase): + # Functions + def __init__(self) -> None: ... + + +class BundleAdjusterAffine(BundleAdjusterBase): + # Functions + def __init__(self) -> None: ... + + +class BundleAdjusterAffinePartial(BundleAdjusterBase): + # Functions + def __init__(self) -> None: ... + + +class SeamFinder: + # Functions + def find(self, src: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], masks: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... + + @classmethod + def createDefault(cls, type: int) -> SeamFinder: ... + + +class NoSeamFinder(SeamFinder): + # Functions + def find(self, arg1: _typing.Sequence[cv2.UMat], arg2: _typing.Sequence[cv2.typing.Point], arg3: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... + + +class PairwiseSeamFinder(SeamFinder): + # Functions + def find(self, src: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], masks: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... + + +class VoronoiSeamFinder(PairwiseSeamFinder): + # Functions + def find(self, src: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], masks: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... + + +class DpSeamFinder(SeamFinder): + # Functions + def __init__(self, costFunc: str) -> None: ... + + def setCostFunction(self, val: str) -> None: ... + + +class GraphCutSeamFinder: + # Functions + def __init__(self, cost_type: str, terminal_cost: float = ..., bad_region_penalty: float = ...) -> None: ... + + def find(self, src: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], masks: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... + + +class Timelapser: + # Functions + @classmethod + def createDefault(cls, type: int) -> Timelapser: ... + + def initialize(self, corners: _typing.Sequence[cv2.typing.Point], sizes: _typing.Sequence[cv2.typing.Size]) -> None: ... + + @_typing.overload + def process(self, img: cv2.typing.MatLike, mask: cv2.typing.MatLike, tl: cv2.typing.Point) -> None: ... + @_typing.overload + def process(self, img: cv2.UMat, mask: cv2.UMat, tl: cv2.typing.Point) -> None: ... + + def getDst(self) -> cv2.UMat: ... + + +class TimelapserCrop(Timelapser): + ... + +class ProjectorBase: + ... + +class SphericalProjector(ProjectorBase): + # Functions + def mapForward(self, x: float, y: float, u: float, v: float) -> None: ... + + def mapBackward(self, u: float, v: float, x: float, y: float) -> None: ... + + + +# Functions +def calibrateRotatingCamera(Hs: _typing.Sequence[cv2.typing.MatLike], K: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike]: ... + +@_typing.overload +def computeImageFeatures(featuresFinder: cv2.Feature2D, images: _typing.Sequence[cv2.typing.MatLike], masks: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[ImageFeatures]: ... +@_typing.overload +def computeImageFeatures(featuresFinder: cv2.Feature2D, images: _typing.Sequence[cv2.UMat], masks: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[ImageFeatures]: ... + +@_typing.overload +def computeImageFeatures2(featuresFinder: cv2.Feature2D, image: cv2.typing.MatLike, mask: cv2.typing.MatLike | None = ...) -> ImageFeatures: ... +@_typing.overload +def computeImageFeatures2(featuresFinder: cv2.Feature2D, image: cv2.UMat, mask: cv2.UMat | None = ...) -> ImageFeatures: ... + +@_typing.overload +def createLaplacePyr(img: cv2.typing.MatLike, num_levels: int, pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... +@_typing.overload +def createLaplacePyr(img: cv2.UMat, num_levels: int, pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... + +@_typing.overload +def createLaplacePyrGpu(img: cv2.typing.MatLike, num_levels: int, pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... +@_typing.overload +def createLaplacePyrGpu(img: cv2.UMat, num_levels: int, pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... + +@_typing.overload +def createWeightMap(mask: cv2.typing.MatLike, sharpness: float, weight: cv2.typing.MatLike) -> cv2.typing.MatLike: ... +@_typing.overload +def createWeightMap(mask: cv2.UMat, sharpness: float, weight: cv2.UMat) -> cv2.UMat: ... + +def focalsFromHomography(H: cv2.typing.MatLike, f0: float, f1: float, f0_ok: bool, f1_ok: bool) -> None: ... + +def leaveBiggestComponent(features: _typing.Sequence[ImageFeatures], pairwise_matches: _typing.Sequence[MatchesInfo], conf_threshold: float) -> _typing.Sequence[int]: ... + +def matchesGraphAsString(paths: _typing.Sequence[str], pairwise_matches: _typing.Sequence[MatchesInfo], conf_threshold: float) -> str: ... + +@_typing.overload +def normalizeUsingWeightMap(weight: cv2.typing.MatLike, src: cv2.typing.MatLike) -> cv2.typing.MatLike: ... +@_typing.overload +def normalizeUsingWeightMap(weight: cv2.UMat, src: cv2.UMat) -> cv2.UMat: ... + +def overlapRoi(tl1: cv2.typing.Point, tl2: cv2.typing.Point, sz1: cv2.typing.Size, sz2: cv2.typing.Size, roi: cv2.typing.Rect) -> bool: ... + +def restoreImageFromLaplacePyr(pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... + +def restoreImageFromLaplacePyrGpu(pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ... + +@_typing.overload +def resultRoi(corners: _typing.Sequence[cv2.typing.Point], images: _typing.Sequence[cv2.UMat]) -> cv2.typing.Rect: ... +@_typing.overload +def resultRoi(corners: _typing.Sequence[cv2.typing.Point], sizes: _typing.Sequence[cv2.typing.Size]) -> cv2.typing.Rect: ... + +def resultRoiIntersection(corners: _typing.Sequence[cv2.typing.Point], sizes: _typing.Sequence[cv2.typing.Size]) -> cv2.typing.Rect: ... + +def resultTl(corners: _typing.Sequence[cv2.typing.Point]) -> cv2.typing.Point: ... + +def selectRandomSubset(count: int, size: int, subset: _typing.Sequence[int]) -> None: ... + +def stitchingLogLevel() -> int: ... + +@_typing.overload +def strip(params: cv2.gapi.ie.PyParams) -> cv2.gapi.GNetParam: ... +@_typing.overload +def strip(params: cv2.gapi.onnx.PyParams) -> cv2.gapi.GNetParam: ... +@_typing.overload +def strip(params: cv2.gapi.ov.PyParams) -> cv2.gapi.GNetParam: ... + +def waveCorrect(rmats: _typing.Sequence[cv2.typing.MatLike], kind: WaveCorrectKind) -> _typing.Sequence[cv2.typing.MatLike]: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/dnn/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/dnn/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..674ee05c650021bebc7a9fa704fa1dd536bc388d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/dnn/__init__.pyi @@ -0,0 +1,536 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import numpy +import sys +import typing as _typing +if sys.version_info >= (3, 8): + from typing import Protocol +else: + from typing_extensions import Protocol + + +# Enumerations +DNN_BACKEND_DEFAULT: int +DNN_BACKEND_HALIDE: int +DNN_BACKEND_INFERENCE_ENGINE: int +DNN_BACKEND_OPENCV: int +DNN_BACKEND_VKCOM: int +DNN_BACKEND_CUDA: int +DNN_BACKEND_WEBNN: int +DNN_BACKEND_TIMVX: int +DNN_BACKEND_CANN: int +Backend = int +"""One of [DNN_BACKEND_DEFAULT, DNN_BACKEND_HALIDE, DNN_BACKEND_INFERENCE_ENGINE, DNN_BACKEND_OPENCV, DNN_BACKEND_VKCOM, DNN_BACKEND_CUDA, DNN_BACKEND_WEBNN, DNN_BACKEND_TIMVX, DNN_BACKEND_CANN]""" + +DNN_TARGET_CPU: int +DNN_TARGET_OPENCL: int +DNN_TARGET_OPENCL_FP16: int +DNN_TARGET_MYRIAD: int +DNN_TARGET_VULKAN: int +DNN_TARGET_FPGA: int +DNN_TARGET_CUDA: int +DNN_TARGET_CUDA_FP16: int +DNN_TARGET_HDDL: int +DNN_TARGET_NPU: int +DNN_TARGET_CPU_FP16: int +Target = int +"""One of [DNN_TARGET_CPU, DNN_TARGET_OPENCL, DNN_TARGET_OPENCL_FP16, DNN_TARGET_MYRIAD, DNN_TARGET_VULKAN, DNN_TARGET_FPGA, DNN_TARGET_CUDA, DNN_TARGET_CUDA_FP16, DNN_TARGET_HDDL, DNN_TARGET_NPU, DNN_TARGET_CPU_FP16]""" + +DNN_LAYOUT_UNKNOWN: int +DNN_LAYOUT_ND: int +DNN_LAYOUT_NCHW: int +DNN_LAYOUT_NCDHW: int +DNN_LAYOUT_NHWC: int +DNN_LAYOUT_NDHWC: int +DNN_LAYOUT_PLANAR: int +DataLayout = int +"""One of [DNN_LAYOUT_UNKNOWN, DNN_LAYOUT_ND, DNN_LAYOUT_NCHW, DNN_LAYOUT_NCDHW, DNN_LAYOUT_NHWC, DNN_LAYOUT_NDHWC, DNN_LAYOUT_PLANAR]""" + +DNN_PMODE_NULL: int +DNN_PMODE_CROP_CENTER: int +DNN_PMODE_LETTERBOX: int +ImagePaddingMode = int +"""One of [DNN_PMODE_NULL, DNN_PMODE_CROP_CENTER, DNN_PMODE_LETTERBOX]""" + +SoftNMSMethod_SOFTNMS_LINEAR: int +SOFT_NMSMETHOD_SOFTNMS_LINEAR: int +SoftNMSMethod_SOFTNMS_GAUSSIAN: int +SOFT_NMSMETHOD_SOFTNMS_GAUSSIAN: int +SoftNMSMethod = int +"""One of [SoftNMSMethod_SOFTNMS_LINEAR, SOFT_NMSMETHOD_SOFTNMS_LINEAR, SoftNMSMethod_SOFTNMS_GAUSSIAN, SOFT_NMSMETHOD_SOFTNMS_GAUSSIAN]""" + + + +# Classes +class DictValue: + # Functions + @_typing.overload + def __init__(self, i: int) -> None: ... + @_typing.overload + def __init__(self, p: float) -> None: ... + @_typing.overload + def __init__(self, s: str) -> None: ... + + def isInt(self) -> bool: ... + + def isString(self) -> bool: ... + + def isReal(self) -> bool: ... + + def getIntValue(self, idx: int = ...) -> int: ... + + def getRealValue(self, idx: int = ...) -> float: ... + + def getStringValue(self, idx: int = ...) -> str: ... + + +class Layer(cv2.Algorithm): + blobs: _typing.Sequence[cv2.typing.MatLike] + @property + def name(self) -> str: ... + @property + def type(self) -> str: ... + @property + def preferableTarget(self) -> int: ... + + # Functions + @_typing.overload + def finalize(self, inputs: _typing.Sequence[cv2.typing.MatLike], outputs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + @_typing.overload + def finalize(self, inputs: _typing.Sequence[cv2.UMat], outputs: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ... + + def run(self, inputs: _typing.Sequence[cv2.typing.MatLike], internals: _typing.Sequence[cv2.typing.MatLike], outputs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike]]: ... + + def outputNameToIndex(self, outputName: str) -> int: ... + + +class Net: + # Functions + def __init__(self) -> None: ... + + @classmethod + @_typing.overload + def readFromModelOptimizer(cls, xml: str, bin: str) -> Net: ... + @classmethod + @_typing.overload + def readFromModelOptimizer(cls, bufferModelConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferWeights: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ... + + def empty(self) -> bool: ... + + def dump(self) -> str: ... + + def dumpToFile(self, path: str) -> None: ... + + def dumpToPbtxt(self, path: str) -> None: ... + + def addLayer(self, name: str, type: str, dtype: int, params: cv2.typing.LayerParams) -> int: ... + + def addLayerToPrev(self, name: str, type: str, dtype: int, params: cv2.typing.LayerParams) -> int: ... + + def getLayerId(self, layer: str) -> int: ... + + def getLayerNames(self) -> _typing.Sequence[str]: ... + + @_typing.overload + def getLayer(self, layerId: int) -> Layer: ... + @_typing.overload + def getLayer(self, layerName: str) -> Layer: ... + @_typing.overload + def getLayer(self, layerId: cv2.typing.LayerId) -> Layer: ... + + def connect(self, outPin: str, inpPin: str) -> None: ... + + def registerOutput(self, outputName: str, layerId: int, outputPort: int) -> int: ... + + def setInputsNames(self, inputBlobNames: _typing.Sequence[str]) -> None: ... + + def setInputShape(self, inputName: str, shape: cv2.typing.MatShape) -> None: ... + + @_typing.overload + def forward(self, outputName: str = ...) -> cv2.typing.MatLike: ... + @_typing.overload + def forward(self, outputBlobs: _typing.Sequence[cv2.typing.MatLike] | None = ..., outputName: str = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + @_typing.overload + def forward(self, outputBlobs: _typing.Sequence[cv2.UMat] | None = ..., outputName: str = ...) -> _typing.Sequence[cv2.UMat]: ... + @_typing.overload + def forward(self, outBlobNames: _typing.Sequence[str], outputBlobs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + @_typing.overload + def forward(self, outBlobNames: _typing.Sequence[str], outputBlobs: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ... + + def forwardAsync(self, outputName: str = ...) -> cv2.AsyncArray: ... + + def forwardAndRetrieve(self, outBlobNames: _typing.Sequence[str]) -> _typing.Sequence[_typing.Sequence[cv2.typing.MatLike]]: ... + + @_typing.overload + def quantize(self, calibData: _typing.Sequence[cv2.typing.MatLike], inputsDtype: int, outputsDtype: int, perChannel: bool = ...) -> Net: ... + @_typing.overload + def quantize(self, calibData: _typing.Sequence[cv2.UMat], inputsDtype: int, outputsDtype: int, perChannel: bool = ...) -> Net: ... + + def getInputDetails(self) -> tuple[_typing.Sequence[float], _typing.Sequence[int]]: ... + + def getOutputDetails(self) -> tuple[_typing.Sequence[float], _typing.Sequence[int]]: ... + + def setHalideScheduler(self, scheduler: str) -> None: ... + + def setPreferableBackend(self, backendId: int) -> None: ... + + def setPreferableTarget(self, targetId: int) -> None: ... + + @_typing.overload + def setInput(self, blob: cv2.typing.MatLike, name: str = ..., scalefactor: float = ..., mean: cv2.typing.Scalar = ...) -> None: ... + @_typing.overload + def setInput(self, blob: cv2.UMat, name: str = ..., scalefactor: float = ..., mean: cv2.typing.Scalar = ...) -> None: ... + + @_typing.overload + def setParam(self, layer: int, numParam: int, blob: cv2.typing.MatLike) -> None: ... + @_typing.overload + def setParam(self, layerName: str, numParam: int, blob: cv2.typing.MatLike) -> None: ... + + @_typing.overload + def getParam(self, layer: int, numParam: int = ...) -> cv2.typing.MatLike: ... + @_typing.overload + def getParam(self, layerName: str, numParam: int = ...) -> cv2.typing.MatLike: ... + + def getUnconnectedOutLayers(self) -> _typing.Sequence[int]: ... + + def getUnconnectedOutLayersNames(self) -> _typing.Sequence[str]: ... + + @_typing.overload + def getLayersShapes(self, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> tuple[_typing.Sequence[int], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]]]: ... + @_typing.overload + def getLayersShapes(self, netInputShape: cv2.typing.MatShape) -> tuple[_typing.Sequence[int], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]]]: ... + + @_typing.overload + def getFLOPS(self, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> int: ... + @_typing.overload + def getFLOPS(self, netInputShape: cv2.typing.MatShape) -> int: ... + @_typing.overload + def getFLOPS(self, layerId: int, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> int: ... + @_typing.overload + def getFLOPS(self, layerId: int, netInputShape: cv2.typing.MatShape) -> int: ... + + def getLayerTypes(self) -> _typing.Sequence[str]: ... + + def getLayersCount(self, layerType: str) -> int: ... + + @_typing.overload + def getMemoryConsumption(self, netInputShape: cv2.typing.MatShape) -> tuple[int, int]: ... + @_typing.overload + def getMemoryConsumption(self, layerId: int, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> tuple[int, int]: ... + @_typing.overload + def getMemoryConsumption(self, layerId: int, netInputShape: cv2.typing.MatShape) -> tuple[int, int]: ... + + def enableFusion(self, fusion: bool) -> None: ... + + def enableWinograd(self, useWinograd: bool) -> None: ... + + def getPerfProfile(self) -> tuple[int, _typing.Sequence[float]]: ... + + +class Image2BlobParams: + scalefactor: cv2.typing.Scalar + size: cv2.typing.Size + mean: cv2.typing.Scalar + swapRB: bool + ddepth: int + datalayout: DataLayout + paddingmode: ImagePaddingMode + borderValue: cv2.typing.Scalar + + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, scalefactor: cv2.typing.Scalar, size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., ddepth: int = ..., datalayout: DataLayout = ..., mode: ImagePaddingMode = ..., borderValue: cv2.typing.Scalar = ...) -> None: ... + + def blobRectToImageRect(self, rBlob: cv2.typing.Rect, size: cv2.typing.Size) -> cv2.typing.Rect: ... + + def blobRectsToImageRects(self, rBlob: _typing.Sequence[cv2.typing.Rect], size: cv2.typing.Size) -> _typing.Sequence[cv2.typing.Rect]: ... + + +class Model: + # Functions + @_typing.overload + def __init__(self, model: str, config: str = ...) -> None: ... + @_typing.overload + def __init__(self, network: Net) -> None: ... + + @_typing.overload + def setInputSize(self, size: cv2.typing.Size) -> Model: ... + @_typing.overload + def setInputSize(self, width: int, height: int) -> Model: ... + + def setInputMean(self, mean: cv2.typing.Scalar) -> Model: ... + + def setInputScale(self, scale: cv2.typing.Scalar) -> Model: ... + + def setInputCrop(self, crop: bool) -> Model: ... + + def setInputSwapRB(self, swapRB: bool) -> Model: ... + + def setOutputNames(self, outNames: _typing.Sequence[str]) -> Model: ... + + def setInputParams(self, scale: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ...) -> None: ... + + @_typing.overload + def predict(self, frame: cv2.typing.MatLike, outs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + @_typing.overload + def predict(self, frame: cv2.UMat, outs: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ... + + def setPreferableBackend(self, backendId: Backend) -> Model: ... + + def setPreferableTarget(self, targetId: Target) -> Model: ... + + def enableWinograd(self, useWinograd: bool) -> Model: ... + + +class ClassificationModel(Model): + # Functions + @_typing.overload + def __init__(self, model: str, config: str = ...) -> None: ... + @_typing.overload + def __init__(self, network: Net) -> None: ... + + def setEnableSoftmaxPostProcessing(self, enable: bool) -> ClassificationModel: ... + + def getEnableSoftmaxPostProcessing(self) -> bool: ... + + @_typing.overload + def classify(self, frame: cv2.typing.MatLike) -> tuple[int, float]: ... + @_typing.overload + def classify(self, frame: cv2.UMat) -> tuple[int, float]: ... + + +class KeypointsModel(Model): + # Functions + @_typing.overload + def __init__(self, model: str, config: str = ...) -> None: ... + @_typing.overload + def __init__(self, network: Net) -> None: ... + + @_typing.overload + def estimate(self, frame: cv2.typing.MatLike, thresh: float = ...) -> _typing.Sequence[cv2.typing.Point2f]: ... + @_typing.overload + def estimate(self, frame: cv2.UMat, thresh: float = ...) -> _typing.Sequence[cv2.typing.Point2f]: ... + + +class SegmentationModel(Model): + # Functions + @_typing.overload + def __init__(self, model: str, config: str = ...) -> None: ... + @_typing.overload + def __init__(self, network: Net) -> None: ... + + @_typing.overload + def segment(self, frame: cv2.typing.MatLike, mask: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ... + @_typing.overload + def segment(self, frame: cv2.UMat, mask: cv2.UMat | None = ...) -> cv2.UMat: ... + + +class DetectionModel(Model): + # Functions + @_typing.overload + def __init__(self, model: str, config: str = ...) -> None: ... + @_typing.overload + def __init__(self, network: Net) -> None: ... + + def setNmsAcrossClasses(self, value: bool) -> DetectionModel: ... + + def getNmsAcrossClasses(self) -> bool: ... + + @_typing.overload + def detect(self, frame: cv2.typing.MatLike, confThreshold: float = ..., nmsThreshold: float = ...) -> tuple[_typing.Sequence[int], _typing.Sequence[float], _typing.Sequence[cv2.typing.Rect]]: ... + @_typing.overload + def detect(self, frame: cv2.UMat, confThreshold: float = ..., nmsThreshold: float = ...) -> tuple[_typing.Sequence[int], _typing.Sequence[float], _typing.Sequence[cv2.typing.Rect]]: ... + + +class TextRecognitionModel(Model): + # Functions + @_typing.overload + def __init__(self, network: Net) -> None: ... + @_typing.overload + def __init__(self, model: str, config: str = ...) -> None: ... + + def setDecodeType(self, decodeType: str) -> TextRecognitionModel: ... + + def getDecodeType(self) -> str: ... + + def setDecodeOptsCTCPrefixBeamSearch(self, beamSize: int, vocPruneSize: int = ...) -> TextRecognitionModel: ... + + def setVocabulary(self, vocabulary: _typing.Sequence[str]) -> TextRecognitionModel: ... + + def getVocabulary(self) -> _typing.Sequence[str]: ... + + @_typing.overload + def recognize(self, frame: cv2.typing.MatLike) -> str: ... + @_typing.overload + def recognize(self, frame: cv2.UMat) -> str: ... + @_typing.overload + def recognize(self, frame: cv2.typing.MatLike, roiRects: _typing.Sequence[cv2.typing.MatLike]) -> _typing.Sequence[str]: ... + @_typing.overload + def recognize(self, frame: cv2.UMat, roiRects: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[str]: ... + + +class TextDetectionModel(Model): + # Functions + @_typing.overload + def detect(self, frame: cv2.typing.MatLike) -> tuple[_typing.Sequence[_typing.Sequence[cv2.typing.Point]], _typing.Sequence[float]]: ... + @_typing.overload + def detect(self, frame: cv2.UMat) -> tuple[_typing.Sequence[_typing.Sequence[cv2.typing.Point]], _typing.Sequence[float]]: ... + @_typing.overload + def detect(self, frame: cv2.typing.MatLike) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point]]: ... + @_typing.overload + def detect(self, frame: cv2.UMat) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point]]: ... + + @_typing.overload + def detectTextRectangles(self, frame: cv2.typing.MatLike) -> tuple[_typing.Sequence[cv2.typing.RotatedRect], _typing.Sequence[float]]: ... + @_typing.overload + def detectTextRectangles(self, frame: cv2.UMat) -> tuple[_typing.Sequence[cv2.typing.RotatedRect], _typing.Sequence[float]]: ... + @_typing.overload + def detectTextRectangles(self, frame: cv2.typing.MatLike) -> _typing.Sequence[cv2.typing.RotatedRect]: ... + @_typing.overload + def detectTextRectangles(self, frame: cv2.UMat) -> _typing.Sequence[cv2.typing.RotatedRect]: ... + + +class TextDetectionModel_EAST(TextDetectionModel): + # Functions + @_typing.overload + def __init__(self, network: Net) -> None: ... + @_typing.overload + def __init__(self, model: str, config: str = ...) -> None: ... + + def setConfidenceThreshold(self, confThreshold: float) -> TextDetectionModel_EAST: ... + + def getConfidenceThreshold(self) -> float: ... + + def setNMSThreshold(self, nmsThreshold: float) -> TextDetectionModel_EAST: ... + + def getNMSThreshold(self) -> float: ... + + +class TextDetectionModel_DB(TextDetectionModel): + # Functions + @_typing.overload + def __init__(self, network: Net) -> None: ... + @_typing.overload + def __init__(self, model: str, config: str = ...) -> None: ... + + def setBinaryThreshold(self, binaryThreshold: float) -> TextDetectionModel_DB: ... + + def getBinaryThreshold(self) -> float: ... + + def setPolygonThreshold(self, polygonThreshold: float) -> TextDetectionModel_DB: ... + + def getPolygonThreshold(self) -> float: ... + + def setUnclipRatio(self, unclipRatio: float) -> TextDetectionModel_DB: ... + + def getUnclipRatio(self) -> float: ... + + def setMaxCandidates(self, maxCandidates: int) -> TextDetectionModel_DB: ... + + def getMaxCandidates(self) -> int: ... + + +class LayerProtocol(Protocol): + # Functions + def __init__(self, params: dict[str, DictValue], blobs: _typing.Sequence[cv2.typing.MatLike]) -> None: ... + + def getMemoryShapes(self, inputs: _typing.Sequence[_typing.Sequence[int]]) -> _typing.Sequence[_typing.Sequence[int]]: ... + + def forward(self, inputs: _typing.Sequence[cv2.typing.MatLike]) -> _typing.Sequence[cv2.typing.MatLike]: ... + + + +# Functions +def NMSBoxes(bboxes: _typing.Sequence[cv2.typing.Rect2d], scores: _typing.Sequence[float], score_threshold: float, nms_threshold: float, eta: float = ..., top_k: int = ...) -> _typing.Sequence[int]: ... + +def NMSBoxesBatched(bboxes: _typing.Sequence[cv2.typing.Rect2d], scores: _typing.Sequence[float], class_ids: _typing.Sequence[int], score_threshold: float, nms_threshold: float, eta: float = ..., top_k: int = ...) -> _typing.Sequence[int]: ... + +def NMSBoxesRotated(bboxes: _typing.Sequence[cv2.typing.RotatedRect], scores: _typing.Sequence[float], score_threshold: float, nms_threshold: float, eta: float = ..., top_k: int = ...) -> _typing.Sequence[int]: ... + +@_typing.overload +def blobFromImage(image: cv2.typing.MatLike, scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def blobFromImage(image: cv2.UMat, scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ... + +@_typing.overload +def blobFromImageWithParams(image: cv2.typing.MatLike, param: Image2BlobParams = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def blobFromImageWithParams(image: cv2.UMat, param: Image2BlobParams = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def blobFromImageWithParams(image: cv2.typing.MatLike, blob: cv2.typing.MatLike | None = ..., param: Image2BlobParams = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def blobFromImageWithParams(image: cv2.UMat, blob: cv2.UMat | None = ..., param: Image2BlobParams = ...) -> cv2.UMat: ... + +@_typing.overload +def blobFromImages(images: _typing.Sequence[cv2.typing.MatLike], scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def blobFromImages(images: _typing.Sequence[cv2.UMat], scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ... + +@_typing.overload +def blobFromImagesWithParams(images: _typing.Sequence[cv2.typing.MatLike], param: Image2BlobParams = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def blobFromImagesWithParams(images: _typing.Sequence[cv2.UMat], param: Image2BlobParams = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def blobFromImagesWithParams(images: _typing.Sequence[cv2.typing.MatLike], blob: cv2.typing.MatLike | None = ..., param: Image2BlobParams = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def blobFromImagesWithParams(images: _typing.Sequence[cv2.UMat], blob: cv2.UMat | None = ..., param: Image2BlobParams = ...) -> cv2.UMat: ... + +def getAvailableTargets(be: Backend) -> _typing.Sequence[Target]: ... + +@_typing.overload +def imagesFromBlob(blob_: cv2.typing.MatLike, images_: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... +@_typing.overload +def imagesFromBlob(blob_: cv2.typing.MatLike, images_: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ... + +@_typing.overload +def readNet(model: str, config: str = ..., framework: str = ...) -> Net: ... +@_typing.overload +def readNet(framework: str, bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ... + +@_typing.overload +def readNetFromCaffe(prototxt: str, caffeModel: str = ...) -> Net: ... +@_typing.overload +def readNetFromCaffe(bufferProto: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ... + +@_typing.overload +def readNetFromDarknet(cfgFile: str, darknetModel: str = ...) -> Net: ... +@_typing.overload +def readNetFromDarknet(bufferCfg: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ... + +@_typing.overload +def readNetFromModelOptimizer(xml: str, bin: str = ...) -> Net: ... +@_typing.overload +def readNetFromModelOptimizer(bufferModelConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferWeights: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ... + +@_typing.overload +def readNetFromONNX(onnxFile: str) -> Net: ... +@_typing.overload +def readNetFromONNX(buffer: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ... + +@_typing.overload +def readNetFromTFLite(model: str) -> Net: ... +@_typing.overload +def readNetFromTFLite(bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ... + +@_typing.overload +def readNetFromTensorflow(model: str, config: str = ...) -> Net: ... +@_typing.overload +def readNetFromTensorflow(bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ... + +def readNetFromTorch(model: str, isBinary: bool = ..., evaluate: bool = ...) -> Net: ... + +def readTensorFromONNX(path: str) -> cv2.typing.MatLike: ... + +def readTorchBlob(filename: str, isBinary: bool = ...) -> cv2.typing.MatLike: ... + +def shrinkCaffeModel(src: str, dst: str, layersTypes: _typing.Sequence[str] = ...) -> None: ... + +def softNMSBoxes(bboxes: _typing.Sequence[cv2.typing.Rect], scores: _typing.Sequence[float], score_threshold: float, nms_threshold: float, top_k: int = ..., sigma: float = ..., method: SoftNMSMethod = ...) -> tuple[_typing.Sequence[float], _typing.Sequence[int]]: ... + +def writeTextGraph(model: str, output: str) -> None: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/fisheye/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/fisheye/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..c3567809f577a09bb4507fd508388088dc367a73 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/fisheye/__init__.pyi @@ -0,0 +1,88 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +# Enumerations +CALIB_USE_INTRINSIC_GUESS: int +CALIB_RECOMPUTE_EXTRINSIC: int +CALIB_CHECK_COND: int +CALIB_FIX_SKEW: int +CALIB_FIX_K1: int +CALIB_FIX_K2: int +CALIB_FIX_K3: int +CALIB_FIX_K4: int +CALIB_FIX_INTRINSIC: int +CALIB_FIX_PRINCIPAL_POINT: int +CALIB_ZERO_DISPARITY: int +CALIB_FIX_FOCAL_LENGTH: int + + + +# Functions +@_typing.overload +def calibrate(objectPoints: _typing.Sequence[cv2.typing.MatLike], imagePoints: _typing.Sequence[cv2.typing.MatLike], image_size: cv2.typing.Size, K: cv2.typing.MatLike, D: cv2.typing.MatLike, rvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., tvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike]]: ... +@_typing.overload +def calibrate(objectPoints: _typing.Sequence[cv2.UMat], imagePoints: _typing.Sequence[cv2.UMat], image_size: cv2.typing.Size, K: cv2.UMat, D: cv2.UMat, rvecs: _typing.Sequence[cv2.UMat] | None = ..., tvecs: _typing.Sequence[cv2.UMat] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], _typing.Sequence[cv2.UMat]]: ... + +@_typing.overload +def distortPoints(undistorted: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, distorted: cv2.typing.MatLike | None = ..., alpha: float = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def distortPoints(undistorted: cv2.UMat, K: cv2.UMat, D: cv2.UMat, distorted: cv2.UMat | None = ..., alpha: float = ...) -> cv2.UMat: ... +@_typing.overload +def distortPoints(undistorted: cv2.typing.MatLike, Kundistorted: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, distorted: cv2.typing.MatLike | None = ..., alpha: float = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def distortPoints(undistorted: cv2.UMat, Kundistorted: cv2.UMat, K: cv2.UMat, D: cv2.UMat, distorted: cv2.UMat | None = ..., alpha: float = ...) -> cv2.UMat: ... + +@_typing.overload +def estimateNewCameraMatrixForUndistortRectify(K: cv2.typing.MatLike, D: cv2.typing.MatLike, image_size: cv2.typing.Size, R: cv2.typing.MatLike, P: cv2.typing.MatLike | None = ..., balance: float = ..., new_size: cv2.typing.Size = ..., fov_scale: float = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def estimateNewCameraMatrixForUndistortRectify(K: cv2.UMat, D: cv2.UMat, image_size: cv2.typing.Size, R: cv2.UMat, P: cv2.UMat | None = ..., balance: float = ..., new_size: cv2.typing.Size = ..., fov_scale: float = ...) -> cv2.UMat: ... + +@_typing.overload +def initUndistortRectifyMap(K: cv2.typing.MatLike, D: cv2.typing.MatLike, R: cv2.typing.MatLike, P: cv2.typing.MatLike, size: cv2.typing.Size, m1type: int, map1: cv2.typing.MatLike | None = ..., map2: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ... +@_typing.overload +def initUndistortRectifyMap(K: cv2.UMat, D: cv2.UMat, R: cv2.UMat, P: cv2.UMat, size: cv2.typing.Size, m1type: int, map1: cv2.UMat | None = ..., map2: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ... + +@_typing.overload +def projectPoints(objectPoints: cv2.typing.MatLike, rvec: cv2.typing.MatLike, tvec: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, imagePoints: cv2.typing.MatLike | None = ..., alpha: float = ..., jacobian: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ... +@_typing.overload +def projectPoints(objectPoints: cv2.UMat, rvec: cv2.UMat, tvec: cv2.UMat, K: cv2.UMat, D: cv2.UMat, imagePoints: cv2.UMat | None = ..., alpha: float = ..., jacobian: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ... + +@_typing.overload +def solvePnP(objectPoints: cv2.typing.MatLike, imagePoints: cv2.typing.MatLike, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvec: cv2.typing.MatLike | None = ..., tvec: cv2.typing.MatLike | None = ..., useExtrinsicGuess: bool = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike]: ... +@_typing.overload +def solvePnP(objectPoints: cv2.UMat, imagePoints: cv2.UMat, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvec: cv2.UMat | None = ..., tvec: cv2.UMat | None = ..., useExtrinsicGuess: bool = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[bool, cv2.UMat, cv2.UMat]: ... + +@_typing.overload +def solvePnPRansac(objectPoints: cv2.typing.MatLike, imagePoints: cv2.typing.MatLike, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvec: cv2.typing.MatLike | None = ..., tvec: cv2.typing.MatLike | None = ..., useExtrinsicGuess: bool = ..., iterationsCount: int = ..., reprojectionError: float = ..., confidence: float = ..., inliers: cv2.typing.MatLike | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ... +@_typing.overload +def solvePnPRansac(objectPoints: cv2.UMat, imagePoints: cv2.UMat, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvec: cv2.UMat | None = ..., tvec: cv2.UMat | None = ..., useExtrinsicGuess: bool = ..., iterationsCount: int = ..., reprojectionError: float = ..., confidence: float = ..., inliers: cv2.UMat | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ... + +@_typing.overload +def stereoCalibrate(objectPoints: _typing.Sequence[cv2.typing.MatLike], imagePoints1: _typing.Sequence[cv2.typing.MatLike], imagePoints2: _typing.Sequence[cv2.typing.MatLike], K1: cv2.typing.MatLike, D1: cv2.typing.MatLike, K2: cv2.typing.MatLike, D2: cv2.typing.MatLike, imageSize: cv2.typing.Size, R: cv2.typing.MatLike | None = ..., T: cv2.typing.MatLike | None = ..., rvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., tvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike]]: ... +@_typing.overload +def stereoCalibrate(objectPoints: _typing.Sequence[cv2.UMat], imagePoints1: _typing.Sequence[cv2.UMat], imagePoints2: _typing.Sequence[cv2.UMat], K1: cv2.UMat, D1: cv2.UMat, K2: cv2.UMat, D2: cv2.UMat, imageSize: cv2.typing.Size, R: cv2.UMat | None = ..., T: cv2.UMat | None = ..., rvecs: _typing.Sequence[cv2.UMat] | None = ..., tvecs: _typing.Sequence[cv2.UMat] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], _typing.Sequence[cv2.UMat]]: ... +@_typing.overload +def stereoCalibrate(objectPoints: _typing.Sequence[cv2.typing.MatLike], imagePoints1: _typing.Sequence[cv2.typing.MatLike], imagePoints2: _typing.Sequence[cv2.typing.MatLike], K1: cv2.typing.MatLike, D1: cv2.typing.MatLike, K2: cv2.typing.MatLike, D2: cv2.typing.MatLike, imageSize: cv2.typing.Size, R: cv2.typing.MatLike | None = ..., T: cv2.typing.MatLike | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ... +@_typing.overload +def stereoCalibrate(objectPoints: _typing.Sequence[cv2.UMat], imagePoints1: _typing.Sequence[cv2.UMat], imagePoints2: _typing.Sequence[cv2.UMat], K1: cv2.UMat, D1: cv2.UMat, K2: cv2.UMat, D2: cv2.UMat, imageSize: cv2.typing.Size, R: cv2.UMat | None = ..., T: cv2.UMat | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat]: ... + +@_typing.overload +def stereoRectify(K1: cv2.typing.MatLike, D1: cv2.typing.MatLike, K2: cv2.typing.MatLike, D2: cv2.typing.MatLike, imageSize: cv2.typing.Size, R: cv2.typing.MatLike, tvec: cv2.typing.MatLike, flags: int, R1: cv2.typing.MatLike | None = ..., R2: cv2.typing.MatLike | None = ..., P1: cv2.typing.MatLike | None = ..., P2: cv2.typing.MatLike | None = ..., Q: cv2.typing.MatLike | None = ..., newImageSize: cv2.typing.Size = ..., balance: float = ..., fov_scale: float = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ... +@_typing.overload +def stereoRectify(K1: cv2.UMat, D1: cv2.UMat, K2: cv2.UMat, D2: cv2.UMat, imageSize: cv2.typing.Size, R: cv2.UMat, tvec: cv2.UMat, flags: int, R1: cv2.UMat | None = ..., R2: cv2.UMat | None = ..., P1: cv2.UMat | None = ..., P2: cv2.UMat | None = ..., Q: cv2.UMat | None = ..., newImageSize: cv2.typing.Size = ..., balance: float = ..., fov_scale: float = ...) -> tuple[cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat]: ... + +@_typing.overload +def undistortImage(distorted: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, undistorted: cv2.typing.MatLike | None = ..., Knew: cv2.typing.MatLike | None = ..., new_size: cv2.typing.Size = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def undistortImage(distorted: cv2.UMat, K: cv2.UMat, D: cv2.UMat, undistorted: cv2.UMat | None = ..., Knew: cv2.UMat | None = ..., new_size: cv2.typing.Size = ...) -> cv2.UMat: ... + +@_typing.overload +def undistortPoints(distorted: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, undistorted: cv2.typing.MatLike | None = ..., R: cv2.typing.MatLike | None = ..., P: cv2.typing.MatLike | None = ..., criteria: cv2.typing.TermCriteria = ...) -> cv2.typing.MatLike: ... +@_typing.overload +def undistortPoints(distorted: cv2.UMat, K: cv2.UMat, D: cv2.UMat, undistorted: cv2.UMat | None = ..., R: cv2.UMat | None = ..., P: cv2.UMat | None = ..., criteria: cv2.typing.TermCriteria = ...) -> cv2.UMat: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/flann/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/flann/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..a107c75226d71aa41e3e225d318761cf754527e4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/flann/__init__.pyi @@ -0,0 +1,64 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +# Enumerations +FLANN_INDEX_TYPE_8U: int +FLANN_INDEX_TYPE_8S: int +FLANN_INDEX_TYPE_16U: int +FLANN_INDEX_TYPE_16S: int +FLANN_INDEX_TYPE_32S: int +FLANN_INDEX_TYPE_32F: int +FLANN_INDEX_TYPE_64F: int +FLANN_INDEX_TYPE_STRING: int +FLANN_INDEX_TYPE_BOOL: int +FLANN_INDEX_TYPE_ALGORITHM: int +LAST_VALUE_FLANN_INDEX_TYPE: int +FlannIndexType = int +"""One of [FLANN_INDEX_TYPE_8U, FLANN_INDEX_TYPE_8S, FLANN_INDEX_TYPE_16U, FLANN_INDEX_TYPE_16S, FLANN_INDEX_TYPE_32S, FLANN_INDEX_TYPE_32F, FLANN_INDEX_TYPE_64F, FLANN_INDEX_TYPE_STRING, FLANN_INDEX_TYPE_BOOL, FLANN_INDEX_TYPE_ALGORITHM, LAST_VALUE_FLANN_INDEX_TYPE]""" + + + +# Classes +class Index: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, features: cv2.typing.MatLike, params: cv2.typing.IndexParams, distType: int = ...) -> None: ... + @_typing.overload + def __init__(self, features: cv2.UMat, params: cv2.typing.IndexParams, distType: int = ...) -> None: ... + + @_typing.overload + def build(self, features: cv2.typing.MatLike, params: cv2.typing.IndexParams, distType: int = ...) -> None: ... + @_typing.overload + def build(self, features: cv2.UMat, params: cv2.typing.IndexParams, distType: int = ...) -> None: ... + + @_typing.overload + def knnSearch(self, query: cv2.typing.MatLike, knn: int, indices: cv2.typing.MatLike | None = ..., dists: cv2.typing.MatLike | None = ..., params: cv2.typing.SearchParams = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def knnSearch(self, query: cv2.UMat, knn: int, indices: cv2.UMat | None = ..., dists: cv2.UMat | None = ..., params: cv2.typing.SearchParams = ...) -> tuple[cv2.UMat, cv2.UMat]: ... + + @_typing.overload + def radiusSearch(self, query: cv2.typing.MatLike, radius: float, maxResults: int, indices: cv2.typing.MatLike | None = ..., dists: cv2.typing.MatLike | None = ..., params: cv2.typing.SearchParams = ...) -> tuple[int, cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def radiusSearch(self, query: cv2.UMat, radius: float, maxResults: int, indices: cv2.UMat | None = ..., dists: cv2.UMat | None = ..., params: cv2.typing.SearchParams = ...) -> tuple[int, cv2.UMat, cv2.UMat]: ... + + def save(self, filename: str) -> None: ... + + @_typing.overload + def load(self, features: cv2.typing.MatLike, filename: str) -> bool: ... + @_typing.overload + def load(self, features: cv2.UMat, filename: str) -> bool: ... + + def release(self) -> None: ... + + def getDistance(self) -> int: ... + + def getAlgorithm(self) -> int: ... + + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2b21e54e4195658f71a4d90d8a1d8b993710010b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/__init__.py @@ -0,0 +1,323 @@ +__all__ = ['op', 'kernel'] + +import sys +import cv2 as cv + +# NB: Register function in specific module +def register(mname): + def parameterized(func): + sys.modules[mname].__dict__[func.__name__] = func + return func + return parameterized + + +@register('cv2.gapi') +def networks(*args): + return cv.gapi_GNetPackage(list(map(cv.detail.strip, args))) + + +@register('cv2.gapi') +def compile_args(*args): + return list(map(cv.GCompileArg, args)) + + +@register('cv2') +def GIn(*args): + return [*args] + + +@register('cv2') +def GOut(*args): + return [*args] + + +@register('cv2') +def gin(*args): + return [*args] + + +@register('cv2.gapi') +def descr_of(*args): + return [*args] + + +@register('cv2') +class GOpaque(): + # NB: Inheritance from c++ class cause segfault. + # So just aggregate cv.GOpaqueT instead of inheritance + def __new__(cls, argtype): + return cv.GOpaqueT(argtype) + + class Bool(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_BOOL) + + class Int(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_INT) + + class Int64(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_INT64) + + class UInt64(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_UINT64) + + class Double(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_DOUBLE) + + class Float(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_FLOAT) + + class String(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_STRING) + + class Point(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_POINT) + + class Point2f(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_POINT2F) + + class Point3f(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_POINT3F) + + class Size(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_SIZE) + + class Rect(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_RECT) + + class Prim(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_DRAW_PRIM) + + class Any(): + def __new__(self): + return cv.GOpaqueT(cv.gapi.CV_ANY) + +@register('cv2') +class GArray(): + # NB: Inheritance from c++ class cause segfault. + # So just aggregate cv.GArrayT instead of inheritance + def __new__(cls, argtype): + return cv.GArrayT(argtype) + + class Bool(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_BOOL) + + class Int(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_INT) + + class Int64(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_INT64) + + class UInt64(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_UINT64) + + class Double(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_DOUBLE) + + class Float(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_FLOAT) + + class String(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_STRING) + + class Point(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_POINT) + + class Point2f(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_POINT2F) + + class Point3f(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_POINT3F) + + class Size(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_SIZE) + + class Rect(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_RECT) + + class Scalar(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_SCALAR) + + class Mat(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_MAT) + + class GMat(): + def __new__(self): + return cv.GArrayT(cv.gapi.CV_GMAT) + + class Prim(): + def __new__(self): + return cv.GArray(cv.gapi.CV_DRAW_PRIM) + + class Any(): + def __new__(self): + return cv.GArray(cv.gapi.CV_ANY) + + +# NB: Top lvl decorator takes arguments +def op(op_id, in_types, out_types): + + garray_types= { + cv.GArray.Bool: cv.gapi.CV_BOOL, + cv.GArray.Int: cv.gapi.CV_INT, + cv.GArray.Int64: cv.gapi.CV_INT64, + cv.GArray.UInt64: cv.gapi.CV_UINT64, + cv.GArray.Double: cv.gapi.CV_DOUBLE, + cv.GArray.Float: cv.gapi.CV_FLOAT, + cv.GArray.String: cv.gapi.CV_STRING, + cv.GArray.Point: cv.gapi.CV_POINT, + cv.GArray.Point2f: cv.gapi.CV_POINT2F, + cv.GArray.Point3f: cv.gapi.CV_POINT3F, + cv.GArray.Size: cv.gapi.CV_SIZE, + cv.GArray.Rect: cv.gapi.CV_RECT, + cv.GArray.Scalar: cv.gapi.CV_SCALAR, + cv.GArray.Mat: cv.gapi.CV_MAT, + cv.GArray.GMat: cv.gapi.CV_GMAT, + cv.GArray.Prim: cv.gapi.CV_DRAW_PRIM, + cv.GArray.Any: cv.gapi.CV_ANY + } + + gopaque_types= { + cv.GOpaque.Size: cv.gapi.CV_SIZE, + cv.GOpaque.Rect: cv.gapi.CV_RECT, + cv.GOpaque.Bool: cv.gapi.CV_BOOL, + cv.GOpaque.Int: cv.gapi.CV_INT, + cv.GOpaque.Int64: cv.gapi.CV_INT64, + cv.GOpaque.UInt64: cv.gapi.CV_UINT64, + cv.GOpaque.Double: cv.gapi.CV_DOUBLE, + cv.GOpaque.Float: cv.gapi.CV_FLOAT, + cv.GOpaque.String: cv.gapi.CV_STRING, + cv.GOpaque.Point: cv.gapi.CV_POINT, + cv.GOpaque.Point2f: cv.gapi.CV_POINT2F, + cv.GOpaque.Point3f: cv.gapi.CV_POINT3F, + cv.GOpaque.Size: cv.gapi.CV_SIZE, + cv.GOpaque.Rect: cv.gapi.CV_RECT, + cv.GOpaque.Prim: cv.gapi.CV_DRAW_PRIM, + cv.GOpaque.Any: cv.gapi.CV_ANY + } + + type2str = { + cv.gapi.CV_BOOL: 'cv.gapi.CV_BOOL' , + cv.gapi.CV_INT: 'cv.gapi.CV_INT' , + cv.gapi.CV_INT64: 'cv.gapi.CV_INT64' , + cv.gapi.CV_UINT64: 'cv.gapi.CV_UINT64' , + cv.gapi.CV_DOUBLE: 'cv.gapi.CV_DOUBLE' , + cv.gapi.CV_FLOAT: 'cv.gapi.CV_FLOAT' , + cv.gapi.CV_STRING: 'cv.gapi.CV_STRING' , + cv.gapi.CV_POINT: 'cv.gapi.CV_POINT' , + cv.gapi.CV_POINT2F: 'cv.gapi.CV_POINT2F' , + cv.gapi.CV_POINT3F: 'cv.gapi.CV_POINT3F' , + cv.gapi.CV_SIZE: 'cv.gapi.CV_SIZE', + cv.gapi.CV_RECT: 'cv.gapi.CV_RECT', + cv.gapi.CV_SCALAR: 'cv.gapi.CV_SCALAR', + cv.gapi.CV_MAT: 'cv.gapi.CV_MAT', + cv.gapi.CV_GMAT: 'cv.gapi.CV_GMAT', + cv.gapi.CV_DRAW_PRIM: 'cv.gapi.CV_DRAW_PRIM' + } + + # NB: Second lvl decorator takes class to decorate + def op_with_params(cls): + if not in_types: + raise Exception('{} operation should have at least one input!'.format(cls.__name__)) + + if not out_types: + raise Exception('{} operation should have at least one output!'.format(cls.__name__)) + + for i, t in enumerate(out_types): + if t not in [cv.GMat, cv.GScalar, *garray_types, *gopaque_types]: + raise Exception('{} unsupported output type: {} in position: {}' + .format(cls.__name__, t.__name__, i)) + + def on(*args): + if len(in_types) != len(args): + raise Exception('Invalid number of input elements!\nExpected: {}, Actual: {}' + .format(len(in_types), len(args))) + + for i, (t, a) in enumerate(zip(in_types, args)): + if t in garray_types: + if not isinstance(a, cv.GArrayT): + raise Exception("{} invalid type for argument {}.\nExpected: {}, Actual: {}" + .format(cls.__name__, i, cv.GArrayT.__name__, type(a).__name__)) + + elif a.type() != garray_types[t]: + raise Exception("{} invalid GArrayT type for argument {}.\nExpected: {}, Actual: {}" + .format(cls.__name__, i, type2str[garray_types[t]], type2str[a.type()])) + + elif t in gopaque_types: + if not isinstance(a, cv.GOpaqueT): + raise Exception("{} invalid type for argument {}.\nExpected: {}, Actual: {}" + .format(cls.__name__, i, cv.GOpaqueT.__name__, type(a).__name__)) + + elif a.type() != gopaque_types[t]: + raise Exception("{} invalid GOpaque type for argument {}.\nExpected: {}, Actual: {}" + .format(cls.__name__, i, type2str[gopaque_types[t]], type2str[a.type()])) + + else: + if t != type(a): + raise Exception('{} invalid input type for argument {}.\nExpected: {}, Actual: {}' + .format(cls.__name__, i, t.__name__, type(a).__name__)) + + op = cv.gapi.__op(op_id, cls.outMeta, *args) + + out_protos = [] + for i, out_type in enumerate(out_types): + if out_type == cv.GMat: + out_protos.append(op.getGMat()) + elif out_type == cv.GScalar: + out_protos.append(op.getGScalar()) + elif out_type in gopaque_types: + out_protos.append(op.getGOpaque(gopaque_types[out_type])) + elif out_type in garray_types: + out_protos.append(op.getGArray(garray_types[out_type])) + else: + raise Exception("""In {}: G-API operation can't produce the output with type: {} in position: {}""" + .format(cls.__name__, out_type.__name__, i)) + + return tuple(out_protos) if len(out_protos) != 1 else out_protos[0] + + # NB: Extend operation class + cls.id = op_id + cls.on = staticmethod(on) + return cls + + return op_with_params + + +def kernel(op_cls): + # NB: Second lvl decorator takes class to decorate + def kernel_with_params(cls): + # NB: Add new members to kernel class + cls.id = op_cls.id + cls.outMeta = op_cls.outMeta + return cls + + return kernel_with_params + + +cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..bdc68bd69c5b275a02c29b8605e8502d84f55bbe --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/__init__.pyi @@ -0,0 +1,349 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +from cv2.gapi import core as core +from cv2.gapi import ie as ie +from cv2.gapi import imgproc as imgproc +from cv2.gapi import oak as oak +from cv2.gapi import onnx as onnx +from cv2.gapi import ot as ot +from cv2.gapi import ov as ov +from cv2.gapi import own as own +from cv2.gapi import render as render +from cv2.gapi import streaming as streaming +from cv2.gapi import video as video +from cv2.gapi import wip as wip + + +# Enumerations +StereoOutputFormat_DEPTH_FLOAT16: int +STEREO_OUTPUT_FORMAT_DEPTH_FLOAT16: int +StereoOutputFormat_DEPTH_FLOAT32: int +STEREO_OUTPUT_FORMAT_DEPTH_FLOAT32: int +StereoOutputFormat_DISPARITY_FIXED16_11_5: int +STEREO_OUTPUT_FORMAT_DISPARITY_FIXED16_11_5: int +StereoOutputFormat_DISPARITY_FIXED16_12_4: int +STEREO_OUTPUT_FORMAT_DISPARITY_FIXED16_12_4: int +StereoOutputFormat_DEPTH_16F: int +STEREO_OUTPUT_FORMAT_DEPTH_16F: int +StereoOutputFormat_DEPTH_32F: int +STEREO_OUTPUT_FORMAT_DEPTH_32F: int +StereoOutputFormat_DISPARITY_16Q_10_5: int +STEREO_OUTPUT_FORMAT_DISPARITY_16Q_10_5: int +StereoOutputFormat_DISPARITY_16Q_11_4: int +STEREO_OUTPUT_FORMAT_DISPARITY_16Q_11_4: int +StereoOutputFormat = int +"""One of [StereoOutputFormat_DEPTH_FLOAT16, STEREO_OUTPUT_FORMAT_DEPTH_FLOAT16, StereoOutputFormat_DEPTH_FLOAT32, STEREO_OUTPUT_FORMAT_DEPTH_FLOAT32, StereoOutputFormat_DISPARITY_FIXED16_11_5, STEREO_OUTPUT_FORMAT_DISPARITY_FIXED16_11_5, StereoOutputFormat_DISPARITY_FIXED16_12_4, STEREO_OUTPUT_FORMAT_DISPARITY_FIXED16_12_4, StereoOutputFormat_DEPTH_16F, STEREO_OUTPUT_FORMAT_DEPTH_16F, StereoOutputFormat_DEPTH_32F, STEREO_OUTPUT_FORMAT_DEPTH_32F, StereoOutputFormat_DISPARITY_16Q_10_5, STEREO_OUTPUT_FORMAT_DISPARITY_16Q_10_5, StereoOutputFormat_DISPARITY_16Q_11_4, STEREO_OUTPUT_FORMAT_DISPARITY_16Q_11_4]""" + +CV_BOOL: int +CV_INT: int +CV_INT64: int +CV_UINT64: int +CV_DOUBLE: int +CV_FLOAT: int +CV_STRING: int +CV_POINT: int +CV_POINT2F: int +CV_POINT3F: int +CV_SIZE: int +CV_RECT: int +CV_SCALAR: int +CV_MAT: int +CV_GMAT: int +CV_DRAW_PRIM: int +CV_ANY: int +ArgType = int +"""One of [CV_BOOL, CV_INT, CV_INT64, CV_UINT64, CV_DOUBLE, CV_FLOAT, CV_STRING, CV_POINT, CV_POINT2F, CV_POINT3F, CV_SIZE, CV_RECT, CV_SCALAR, CV_MAT, CV_GMAT, CV_DRAW_PRIM, CV_ANY]""" + + + +# Classes +class GNetParam: + ... + +class GNetPackage: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, nets: _typing.Sequence[GNetParam]) -> None: ... + + + +# Functions +def BGR2Gray(src: cv2.GMat) -> cv2.GMat: ... + +def BGR2I420(src: cv2.GMat) -> cv2.GMat: ... + +def BGR2LUV(src: cv2.GMat) -> cv2.GMat: ... + +def BGR2RGB(src: cv2.GMat) -> cv2.GMat: ... + +def BGR2YUV(src: cv2.GMat) -> cv2.GMat: ... + +def BayerGR2RGB(src_gr: cv2.GMat) -> cv2.GMat: ... + +def Canny(image: cv2.GMat, threshold1: float, threshold2: float, apertureSize: int = ..., L2gradient: bool = ...) -> cv2.GMat: ... + +def I4202BGR(src: cv2.GMat) -> cv2.GMat: ... + +def I4202RGB(src: cv2.GMat) -> cv2.GMat: ... + +def LUT(src: cv2.GMat, lut: cv2.typing.MatLike) -> cv2.GMat: ... + +def LUV2BGR(src: cv2.GMat) -> cv2.GMat: ... + +def Laplacian(src: cv2.GMat, ddepth: int, ksize: int = ..., scale: float = ..., delta: float = ..., borderType: int = ...) -> cv2.GMat: ... + +def NV12toBGR(src_y: cv2.GMat, src_uv: cv2.GMat) -> cv2.GMat: ... + +def NV12toGray(src_y: cv2.GMat, src_uv: cv2.GMat) -> cv2.GMat: ... + +def NV12toRGB(src_y: cv2.GMat, src_uv: cv2.GMat) -> cv2.GMat: ... + +@_typing.overload +def RGB2Gray(src: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def RGB2Gray(src: cv2.GMat, rY: float, gY: float, bY: float) -> cv2.GMat: ... + +def RGB2HSV(src: cv2.GMat) -> cv2.GMat: ... + +def RGB2I420(src: cv2.GMat) -> cv2.GMat: ... + +def RGB2Lab(src: cv2.GMat) -> cv2.GMat: ... + +def RGB2YUV(src: cv2.GMat) -> cv2.GMat: ... + +def RGB2YUV422(src: cv2.GMat) -> cv2.GMat: ... + +def Sobel(src: cv2.GMat, ddepth: int, dx: int, dy: int, ksize: int = ..., scale: float = ..., delta: float = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def SobelXY(src: cv2.GMat, ddepth: int, order: int, ksize: int = ..., scale: float = ..., delta: float = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> tuple[cv2.GMat, cv2.GMat]: ... + +def YUV2BGR(src: cv2.GMat) -> cv2.GMat: ... + +def YUV2RGB(src: cv2.GMat) -> cv2.GMat: ... + +def absDiff(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... + +def absDiffC(src: cv2.GMat, c: cv2.GScalar) -> cv2.GMat: ... + +def add(src1: cv2.GMat, src2: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ... + +@_typing.overload +def addC(src1: cv2.GMat, c: cv2.GScalar, ddepth: int = ...) -> cv2.GMat: ... +@_typing.overload +def addC(c: cv2.GScalar, src1: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ... + +def addWeighted(src1: cv2.GMat, alpha: float, src2: cv2.GMat, beta: float, gamma: float, ddepth: int = ...) -> cv2.GMat: ... + +def bilateralFilter(src: cv2.GMat, d: int, sigmaColor: float, sigmaSpace: float, borderType: int = ...) -> cv2.GMat: ... + +@_typing.overload +def bitwise_and(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def bitwise_and(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ... + +def bitwise_not(src: cv2.GMat) -> cv2.GMat: ... + +@_typing.overload +def bitwise_or(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def bitwise_or(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ... + +@_typing.overload +def bitwise_xor(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def bitwise_xor(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ... + +def blur(src: cv2.GMat, ksize: cv2.typing.Size, anchor: cv2.typing.Point = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +@_typing.overload +def boundingRect(src: cv2.GMat) -> cv2.GOpaqueT: ... +@_typing.overload +def boundingRect(src: cv2.GArrayT) -> cv2.GOpaqueT: ... +@_typing.overload +def boundingRect(src: cv2.GArrayT) -> cv2.GOpaqueT: ... + +def boxFilter(src: cv2.GMat, dtype: int, ksize: cv2.typing.Size, anchor: cv2.typing.Point = ..., normalize: bool = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def cartToPolar(x: cv2.GMat, y: cv2.GMat, angleInDegrees: bool = ...) -> tuple[cv2.GMat, cv2.GMat]: ... + +@_typing.overload +def cmpEQ(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def cmpEQ(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ... + +@_typing.overload +def cmpGE(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def cmpGE(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ... + +@_typing.overload +def cmpGT(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def cmpGT(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ... + +@_typing.overload +def cmpLE(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def cmpLE(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ... + +@_typing.overload +def cmpLT(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def cmpLT(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ... + +@_typing.overload +def cmpNE(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def cmpNE(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ... + +def combine(lhs: cv2.GKernelPackage, rhs: cv2.GKernelPackage) -> cv2.GKernelPackage: ... + +@_typing.overload +def concatHor(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def concatHor(v: _typing.Sequence[cv2.GMat]) -> cv2.GMat: ... + +@_typing.overload +def concatVert(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... +@_typing.overload +def concatVert(v: _typing.Sequence[cv2.GMat]) -> cv2.GMat: ... + +def convertTo(src: cv2.GMat, rdepth: int, alpha: float = ..., beta: float = ...) -> cv2.GMat: ... + +def copy(in_: cv2.GMat) -> cv2.GMat: ... + +def countNonZero(src: cv2.GMat) -> cv2.GOpaqueT: ... + +def crop(src: cv2.GMat, rect: cv2.typing.Rect) -> cv2.GMat: ... + +def dilate(src: cv2.GMat, kernel: cv2.typing.MatLike, anchor: cv2.typing.Point = ..., iterations: int = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def dilate3x3(src: cv2.GMat, iterations: int = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def div(src1: cv2.GMat, src2: cv2.GMat, scale: float, ddepth: int = ...) -> cv2.GMat: ... + +def divC(src: cv2.GMat, divisor: cv2.GScalar, scale: float, ddepth: int = ...) -> cv2.GMat: ... + +def divRC(divident: cv2.GScalar, src: cv2.GMat, scale: float, ddepth: int = ...) -> cv2.GMat: ... + +def equalizeHist(src: cv2.GMat) -> cv2.GMat: ... + +def erode(src: cv2.GMat, kernel: cv2.typing.MatLike, anchor: cv2.typing.Point = ..., iterations: int = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def erode3x3(src: cv2.GMat, iterations: int = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def filter2D(src: cv2.GMat, ddepth: int, kernel: cv2.typing.MatLike, anchor: cv2.typing.Point = ..., delta: cv2.typing.Scalar = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def flip(src: cv2.GMat, flipCode: int) -> cv2.GMat: ... + +def gaussianBlur(src: cv2.GMat, ksize: cv2.typing.Size, sigmaX: float, sigmaY: float = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def goodFeaturesToTrack(image: cv2.GMat, maxCorners: int, qualityLevel: float, minDistance: float, mask: cv2.typing.MatLike | None = ..., blockSize: int = ..., useHarrisDetector: bool = ..., k: float = ...) -> cv2.GArrayT: ... + +def inRange(src: cv2.GMat, threshLow: cv2.GScalar, threshUp: cv2.GScalar) -> cv2.GMat: ... + +@_typing.overload +def infer(name: str, inputs: cv2.GInferInputs) -> cv2.GInferOutputs: ... +@_typing.overload +def infer(name: str, roi: cv2.GOpaqueT, inputs: cv2.GInferInputs) -> cv2.GInferOutputs: ... +@_typing.overload +def infer(name: str, rois: cv2.GArrayT, inputs: cv2.GInferInputs) -> cv2.GInferListOutputs: ... + +def infer2(name: str, in_: cv2.GMat, inputs: cv2.GInferListInputs) -> cv2.GInferListOutputs: ... + +def integral(src: cv2.GMat, sdepth: int = ..., sqdepth: int = ...) -> tuple[cv2.GMat, cv2.GMat]: ... + +@_typing.overload +def kmeans(data: cv2.GMat, K: int, bestLabels: cv2.GMat, criteria: cv2.typing.TermCriteria, attempts: int, flags: cv2.KmeansFlags) -> tuple[cv2.GOpaqueT, cv2.GMat, cv2.GMat]: ... +@_typing.overload +def kmeans(data: cv2.GMat, K: int, criteria: cv2.typing.TermCriteria, attempts: int, flags: cv2.KmeansFlags) -> tuple[cv2.GOpaqueT, cv2.GMat, cv2.GMat]: ... +@_typing.overload +def kmeans(data: cv2.GArrayT, K: int, bestLabels: cv2.GArrayT, criteria: cv2.typing.TermCriteria, attempts: int, flags: cv2.KmeansFlags) -> tuple[cv2.GOpaqueT, cv2.GArrayT, cv2.GArrayT]: ... +@_typing.overload +def kmeans(data: cv2.GArrayT, K: int, bestLabels: cv2.GArrayT, criteria: cv2.typing.TermCriteria, attempts: int, flags: cv2.KmeansFlags) -> tuple[cv2.GOpaqueT, cv2.GArrayT, cv2.GArrayT]: ... + +def mask(src: cv2.GMat, mask: cv2.GMat) -> cv2.GMat: ... + +def max(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... + +def mean(src: cv2.GMat) -> cv2.GScalar: ... + +def medianBlur(src: cv2.GMat, ksize: int) -> cv2.GMat: ... + +def merge3(src1: cv2.GMat, src2: cv2.GMat, src3: cv2.GMat) -> cv2.GMat: ... + +def merge4(src1: cv2.GMat, src2: cv2.GMat, src3: cv2.GMat, src4: cv2.GMat) -> cv2.GMat: ... + +def min(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ... + +def morphologyEx(src: cv2.GMat, op: cv2.MorphTypes, kernel: cv2.typing.MatLike, anchor: cv2.typing.Point = ..., iterations: int = ..., borderType: cv2.BorderTypes = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def mul(src1: cv2.GMat, src2: cv2.GMat, scale: float = ..., ddepth: int = ...) -> cv2.GMat: ... + +@_typing.overload +def mulC(src: cv2.GMat, multiplier: float, ddepth: int = ...) -> cv2.GMat: ... +@_typing.overload +def mulC(src: cv2.GMat, multiplier: cv2.GScalar, ddepth: int = ...) -> cv2.GMat: ... +@_typing.overload +def mulC(multiplier: cv2.GScalar, src: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ... + +def normInf(src: cv2.GMat) -> cv2.GScalar: ... + +def normL1(src: cv2.GMat) -> cv2.GScalar: ... + +def normL2(src: cv2.GMat) -> cv2.GScalar: ... + +def normalize(src: cv2.GMat, alpha: float, beta: float, norm_type: int, ddepth: int = ...) -> cv2.GMat: ... + +@_typing.overload +def parseSSD(in_: cv2.GMat, inSz: cv2.GOpaqueT, confidenceThreshold: float = ..., filterLabel: int = ...) -> tuple[cv2.GArrayT, cv2.GArrayT]: ... +@_typing.overload +def parseSSD(in_: cv2.GMat, inSz: cv2.GOpaqueT, confidenceThreshold: float, alignmentToSquare: bool, filterOutOfBounds: bool) -> cv2.GArrayT: ... + +def parseYolo(in_: cv2.GMat, inSz: cv2.GOpaqueT, confidenceThreshold: float = ..., nmsThreshold: float = ..., anchors: _typing.Sequence[float] = ...) -> tuple[cv2.GArrayT, cv2.GArrayT]: ... + +def phase(x: cv2.GMat, y: cv2.GMat, angleInDegrees: bool = ...) -> cv2.GMat: ... + +def polarToCart(magnitude: cv2.GMat, angle: cv2.GMat, angleInDegrees: bool = ...) -> tuple[cv2.GMat, cv2.GMat]: ... + +def remap(src: cv2.GMat, map1: cv2.typing.MatLike, map2: cv2.typing.MatLike, interpolation: int, borderMode: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def resize(src: cv2.GMat, dsize: cv2.typing.Size, fx: float = ..., fy: float = ..., interpolation: int = ...) -> cv2.GMat: ... + +def select(src1: cv2.GMat, src2: cv2.GMat, mask: cv2.GMat) -> cv2.GMat: ... + +def sepFilter(src: cv2.GMat, ddepth: int, kernelX: cv2.typing.MatLike, kernelY: cv2.typing.MatLike, anchor: cv2.typing.Point, delta: cv2.typing.Scalar, borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def split3(src: cv2.GMat) -> tuple[cv2.GMat, cv2.GMat, cv2.GMat]: ... + +def split4(src: cv2.GMat) -> tuple[cv2.GMat, cv2.GMat, cv2.GMat, cv2.GMat]: ... + +def sqrt(src: cv2.GMat) -> cv2.GMat: ... + +def sub(src1: cv2.GMat, src2: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ... + +def subC(src: cv2.GMat, c: cv2.GScalar, ddepth: int = ...) -> cv2.GMat: ... + +def subRC(c: cv2.GScalar, src: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ... + +def sum(src: cv2.GMat) -> cv2.GScalar: ... + +@_typing.overload +def threshold(src: cv2.GMat, thresh: cv2.GScalar, maxval: cv2.GScalar, type: int) -> cv2.GMat: ... +@_typing.overload +def threshold(src: cv2.GMat, maxval: cv2.GScalar, type: int) -> tuple[cv2.GMat, cv2.GScalar]: ... + +def transpose(src: cv2.GMat) -> cv2.GMat: ... + +def warpAffine(src: cv2.GMat, M: cv2.typing.MatLike, dsize: cv2.typing.Size, flags: int = ..., borderMode: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + +def warpPerspective(src: cv2.GMat, M: cv2.typing.MatLike, dsize: cv2.typing.Size, flags: int = ..., borderMode: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91288e7bfe0cbbf5e149bd2471eb4cf22fac044d Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..a418f70ab798fcac580de697773d460ea9a12055 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/__init__.pyi @@ -0,0 +1,7 @@ +__all__: list[str] = [] + +from cv2.gapi.core import cpu as cpu +from cv2.gapi.core import fluid as fluid +from cv2.gapi.core import ocl as ocl + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/cpu/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/cpu/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..b85ebb121e506c99a5bf55d46d4b61f31b62da80 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/cpu/__init__.pyi @@ -0,0 +1,9 @@ +__all__: list[str] = [] + +import cv2 + + +# Functions +def kernels() -> cv2.GKernelPackage: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/fluid/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/fluid/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..b85ebb121e506c99a5bf55d46d4b61f31b62da80 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/fluid/__init__.pyi @@ -0,0 +1,9 @@ +__all__: list[str] = [] + +import cv2 + + +# Functions +def kernels() -> cv2.GKernelPackage: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/ocl/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/ocl/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..b85ebb121e506c99a5bf55d46d4b61f31b62da80 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/core/ocl/__init__.pyi @@ -0,0 +1,9 @@ +__all__: list[str] = [] + +import cv2 + + +# Functions +def kernels() -> cv2.GKernelPackage: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ie/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ie/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..700ce621174e38511b7d9c32ced225fbfcca0338 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ie/__init__.pyi @@ -0,0 +1,51 @@ +__all__: list[str] = [] + +import cv2.typing +import typing as _typing + + +from cv2.gapi.ie import detail as detail + + +# Enumerations +TraitAs_TENSOR: int +TRAIT_AS_TENSOR: int +TraitAs_IMAGE: int +TRAIT_AS_IMAGE: int +TraitAs = int +"""One of [TraitAs_TENSOR, TRAIT_AS_TENSOR, TraitAs_IMAGE, TRAIT_AS_IMAGE]""" + +Sync: int +SYNC: int +Async: int +ASYNC: int +InferMode = int +"""One of [Sync, SYNC, Async, ASYNC]""" + + + +# Classes +class PyParams: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, tag: str, model: str, weights: str, device: str) -> None: ... + @_typing.overload + def __init__(self, tag: str, model: str, device: str) -> None: ... + + def constInput(self, layer_name: str, data: cv2.typing.MatLike, hint: TraitAs = ...) -> PyParams: ... + + def cfgNumRequests(self, nireq: int) -> PyParams: ... + + def cfgBatchSize(self, size: int) -> PyParams: ... + + + +# Functions +@_typing.overload +def params(tag: str, model: str, weights: str, device: str) -> PyParams: ... +@_typing.overload +def params(tag: str, model: str, device: str) -> PyParams: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ie/detail/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ie/detail/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..e9aa68c68a73a2a25a419d64f5781581931251ab --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ie/detail/__init__.pyi @@ -0,0 +1,12 @@ +__all__: list[str] = [] + +ParamDesc_Kind_Load: int +PARAM_DESC_KIND_LOAD: int +ParamDesc_Kind_Import: int +PARAM_DESC_KIND_IMPORT: int +ParamDesc_Kind = int +"""One of [ParamDesc_Kind_Load, PARAM_DESC_KIND_LOAD, ParamDesc_Kind_Import, PARAM_DESC_KIND_IMPORT]""" + + +# Classes + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/imgproc/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/imgproc/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..0d4b571303e9fa6f30f5928b113a0a5403b61069 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/imgproc/__init__.pyi @@ -0,0 +1,5 @@ +__all__: list[str] = [] + +from cv2.gapi.imgproc import fluid as fluid + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/imgproc/fluid/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/imgproc/fluid/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..b85ebb121e506c99a5bf55d46d4b61f31b62da80 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/imgproc/fluid/__init__.pyi @@ -0,0 +1,9 @@ +__all__: list[str] = [] + +import cv2 + + +# Functions +def kernels() -> cv2.GKernelPackage: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/oak/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/oak/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..2a871fab56aa9149d1fd71986bd024d1d6b2a9d4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/oak/__init__.pyi @@ -0,0 +1,37 @@ +__all__: list[str] = [] + +EncoderConfig_RateControlMode_CBR: int +ENCODER_CONFIG_RATE_CONTROL_MODE_CBR: int +EncoderConfig_RateControlMode_VBR: int +ENCODER_CONFIG_RATE_CONTROL_MODE_VBR: int +EncoderConfig_RateControlMode = int +"""One of [EncoderConfig_RateControlMode_CBR, ENCODER_CONFIG_RATE_CONTROL_MODE_CBR, EncoderConfig_RateControlMode_VBR, ENCODER_CONFIG_RATE_CONTROL_MODE_VBR]""" + +EncoderConfig_Profile_H264_BASELINE: int +ENCODER_CONFIG_PROFILE_H264_BASELINE: int +EncoderConfig_Profile_H264_HIGH: int +ENCODER_CONFIG_PROFILE_H264_HIGH: int +EncoderConfig_Profile_H264_MAIN: int +ENCODER_CONFIG_PROFILE_H264_MAIN: int +EncoderConfig_Profile_H265_MAIN: int +ENCODER_CONFIG_PROFILE_H265_MAIN: int +EncoderConfig_Profile_MJPEG: int +ENCODER_CONFIG_PROFILE_MJPEG: int +EncoderConfig_Profile = int +"""One of [EncoderConfig_Profile_H264_BASELINE, ENCODER_CONFIG_PROFILE_H264_BASELINE, EncoderConfig_Profile_H264_HIGH, ENCODER_CONFIG_PROFILE_H264_HIGH, EncoderConfig_Profile_H264_MAIN, ENCODER_CONFIG_PROFILE_H264_MAIN, EncoderConfig_Profile_H265_MAIN, ENCODER_CONFIG_PROFILE_H265_MAIN, EncoderConfig_Profile_MJPEG, ENCODER_CONFIG_PROFILE_MJPEG]""" + +ColorCameraParams_BoardSocket_RGB: int +COLOR_CAMERA_PARAMS_BOARD_SOCKET_RGB: int +ColorCameraParams_BoardSocket_BGR: int +COLOR_CAMERA_PARAMS_BOARD_SOCKET_BGR: int +ColorCameraParams_BoardSocket = int +"""One of [ColorCameraParams_BoardSocket_RGB, COLOR_CAMERA_PARAMS_BOARD_SOCKET_RGB, ColorCameraParams_BoardSocket_BGR, COLOR_CAMERA_PARAMS_BOARD_SOCKET_BGR]""" + +ColorCameraParams_Resolution_THE_1080_P: int +COLOR_CAMERA_PARAMS_RESOLUTION_THE_1080_P: int +ColorCameraParams_Resolution = int +"""One of [ColorCameraParams_Resolution_THE_1080_P, COLOR_CAMERA_PARAMS_RESOLUTION_THE_1080_P]""" + + +# Classes + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/onnx/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/onnx/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..a5bf8777fbb835e6446eb37982f86053de55386d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/onnx/__init__.pyi @@ -0,0 +1,55 @@ +__all__: list[str] = [] + +import cv2.gapi.onnx.ep +import cv2.typing +import typing as _typing + + +from cv2.gapi.onnx import ep as ep + + +# Enumerations +TraitAs_TENSOR: int +TRAIT_AS_TENSOR: int +TraitAs_IMAGE: int +TRAIT_AS_IMAGE: int +TraitAs = int +"""One of [TraitAs_TENSOR, TRAIT_AS_TENSOR, TraitAs_IMAGE, TRAIT_AS_IMAGE]""" + + + +# Classes +class PyParams: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, tag: str, model_path: str) -> None: ... + + def cfgMeanStd(self, layer_name: str, m: cv2.typing.Scalar, s: cv2.typing.Scalar) -> PyParams: ... + + def cfgNormalize(self, layer_name: str, flag: bool) -> PyParams: ... + + @_typing.overload + def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.OpenVINO) -> PyParams: ... + @_typing.overload + def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.DirectML) -> PyParams: ... + @_typing.overload + def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.CoreML) -> PyParams: ... + @_typing.overload + def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.CUDA) -> PyParams: ... + @_typing.overload + def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.TensorRT) -> PyParams: ... + + def cfgDisableMemPattern(self) -> PyParams: ... + + def cfgSessionOptions(self, options: cv2.typing.map_string_and_string) -> PyParams: ... + + def cfgOptLevel(self, opt_level: int) -> PyParams: ... + + + +# Functions +def params(tag: str, model_path: str) -> PyParams: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/onnx/ep/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/onnx/ep/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..e32f039760ac0f095f7d1aa6112e6e1ac692fc85 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/onnx/ep/__init__.pyi @@ -0,0 +1,63 @@ +__all__: list[str] = [] + +import cv2.typing +import typing as _typing + + +# Classes +class CoreML: + # Functions + def __init__(self) -> None: ... + + def cfgUseCPUOnly(self) -> CoreML: ... + + def cfgEnableOnSubgraph(self) -> CoreML: ... + + def cfgEnableOnlyNeuralEngine(self) -> CoreML: ... + + +class CUDA: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, dev_id: int) -> None: ... + + +class TensorRT: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, dev_id: int) -> None: ... + + +class OpenVINO: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, dev_type: str) -> None: ... + @_typing.overload + def __init__(self, params: cv2.typing.map_string_and_string) -> None: ... + + def cfgCacheDir(self, dir: str) -> OpenVINO: ... + + def cfgNumThreads(self, nthreads: int) -> OpenVINO: ... + + def cfgEnableOpenCLThrottling(self) -> OpenVINO: ... + + def cfgEnableDynamicShapes(self) -> OpenVINO: ... + + +class DirectML: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, device_id: int) -> None: ... + @_typing.overload + def __init__(self, adapter_name: str) -> None: ... + + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ot/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ot/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..09e95e7c124d443526e47c881e8066923a58a26e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ot/__init__.pyi @@ -0,0 +1,32 @@ +__all__: list[str] = [] + +import cv2 +import typing as _typing + + +from cv2.gapi.ot import cpu as cpu + + +# Enumerations +NEW: int +TRACKED: int +LOST: int +TrackingStatus = int +"""One of [NEW, TRACKED, LOST]""" + + + +# Classes +class ObjectTrackerParams: + max_num_objects: int + input_image_format: int + tracking_per_class: bool + + +# Functions +@_typing.overload +def track(mat: cv2.GMat, detected_rects: cv2.GArrayT, detected_class_labels: cv2.GArrayT, delta: float) -> tuple[cv2.GArrayT, cv2.GArrayT, cv2.GArrayT, cv2.GArrayT]: ... +@_typing.overload +def track(frame: cv2.GFrame, detected_rects: cv2.GArrayT, detected_class_labels: cv2.GArrayT, delta: float) -> tuple[cv2.GArrayT, cv2.GArrayT, cv2.GArrayT, cv2.GArrayT]: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ot/cpu/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ot/cpu/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..b85ebb121e506c99a5bf55d46d4b61f31b62da80 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ot/cpu/__init__.pyi @@ -0,0 +1,9 @@ +__all__: list[str] = [] + +import cv2 + + +# Functions +def kernels() -> cv2.GKernelPackage: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ov/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ov/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..9bc2c8683cd47aa3c2466a9c40832c7a04e464fb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/ov/__init__.pyi @@ -0,0 +1,74 @@ +__all__: list[str] = [] + +import cv2.typing +import typing as _typing + + +# Classes +class PyParams: + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, tag: str, model_path: str, bin_path: str, device: str) -> None: ... + @_typing.overload + def __init__(self, tag: str, blob_path: str, device: str) -> None: ... + + def cfgPluginConfig(self, config: cv2.typing.map_string_and_string) -> PyParams: ... + + @_typing.overload + def cfgInputTensorLayout(self, tensor_layout: str) -> PyParams: ... + @_typing.overload + def cfgInputTensorLayout(self, layout_map: cv2.typing.map_string_and_string) -> PyParams: ... + + @_typing.overload + def cfgInputModelLayout(self, tensor_layout: str) -> PyParams: ... + @_typing.overload + def cfgInputModelLayout(self, layout_map: cv2.typing.map_string_and_string) -> PyParams: ... + + @_typing.overload + def cfgOutputTensorLayout(self, tensor_layout: str) -> PyParams: ... + @_typing.overload + def cfgOutputTensorLayout(self, layout_map: cv2.typing.map_string_and_string) -> PyParams: ... + + @_typing.overload + def cfgOutputModelLayout(self, tensor_layout: str) -> PyParams: ... + @_typing.overload + def cfgOutputModelLayout(self, layout_map: cv2.typing.map_string_and_string) -> PyParams: ... + + @_typing.overload + def cfgOutputTensorPrecision(self, precision: int) -> PyParams: ... + @_typing.overload + def cfgOutputTensorPrecision(self, precision_map: cv2.typing.map_string_and_int) -> PyParams: ... + + @_typing.overload + def cfgReshape(self, new_shape: _typing.Sequence[int]) -> PyParams: ... + @_typing.overload + def cfgReshape(self, new_shape_map: cv2.typing.map_string_and_vector_size_t) -> PyParams: ... + + def cfgNumRequests(self, nireq: int) -> PyParams: ... + + @_typing.overload + def cfgMean(self, mean_values: _typing.Sequence[float]) -> PyParams: ... + @_typing.overload + def cfgMean(self, mean_map: cv2.typing.map_string_and_vector_float) -> PyParams: ... + + @_typing.overload + def cfgScale(self, scale_values: _typing.Sequence[float]) -> PyParams: ... + @_typing.overload + def cfgScale(self, scale_map: cv2.typing.map_string_and_vector_float) -> PyParams: ... + + @_typing.overload + def cfgResize(self, interpolation: int) -> PyParams: ... + @_typing.overload + def cfgResize(self, interpolation: cv2.typing.map_string_and_int) -> PyParams: ... + + + +# Functions +@_typing.overload +def params(tag: str, model_path: str, weights: str, device: str) -> PyParams: ... +@_typing.overload +def params(tag: str, bin_path: str, device: str) -> PyParams: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/own/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/own/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..9ac6ecc9d0061d0cda93097f6a4fe9d154c2fcab --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/own/__init__.pyi @@ -0,0 +1,5 @@ +__all__: list[str] = [] + +from cv2.gapi.own import detail as detail + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/own/detail/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/own/detail/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..cde2a28e5daddbafa3c4354eb4db93053629d49a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/own/detail/__init__.pyi @@ -0,0 +1,10 @@ +__all__: list[str] = [] + +MatHeader_AUTO_STEP: int +MAT_HEADER_AUTO_STEP: int +MatHeader_TYPE_MASK: int +MAT_HEADER_TYPE_MASK: int + + +# Classes + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/render/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/render/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..229877aa6c1063c56e3162c9d5c76d95cc6f472b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/render/__init__.pyi @@ -0,0 +1,5 @@ +__all__: list[str] = [] + +from cv2.gapi.render import ocv as ocv + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/render/ocv/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/render/ocv/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..b85ebb121e506c99a5bf55d46d4b61f31b62da80 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/render/ocv/__init__.pyi @@ -0,0 +1,9 @@ +__all__: list[str] = [] + +import cv2 + + +# Functions +def kernels() -> cv2.GKernelPackage: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/streaming/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/streaming/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..2b70ce7ed2dcf40e9d89607cb3fa7c99e69f2d03 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/streaming/__init__.pyi @@ -0,0 +1,42 @@ +__all__: list[str] = [] + +import cv2 +import typing as _typing + + +# Enumerations +sync_policy_dont_sync: int +SYNC_POLICY_DONT_SYNC: int +sync_policy_drop: int +SYNC_POLICY_DROP: int +sync_policy = int +"""One of [sync_policy_dont_sync, SYNC_POLICY_DONT_SYNC, sync_policy_drop, SYNC_POLICY_DROP]""" + + + +# Classes +class queue_capacity: + capacity: int + + # Functions + def __init__(self, cap: int = ...) -> None: ... + + + +# Functions +def desync(g: cv2.GMat) -> cv2.GMat: ... + +def seqNo(arg1: cv2.GMat) -> cv2.GOpaqueT: ... + +def seq_id(arg1: cv2.GMat) -> cv2.GOpaqueT: ... + +@_typing.overload +def size(src: cv2.GMat) -> cv2.GOpaqueT: ... +@_typing.overload +def size(r: cv2.GOpaqueT) -> cv2.GOpaqueT: ... +@_typing.overload +def size(src: cv2.GFrame) -> cv2.GOpaqueT: ... + +def timestamp(arg1: cv2.GMat) -> cv2.GOpaqueT: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/video/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/video/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..e1c5477db9927fbfd260bdc490a8e80739764b2d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/video/__init__.pyi @@ -0,0 +1,10 @@ +__all__: list[str] = [] + +# Enumerations +TYPE_BS_MOG2: int +TYPE_BS_KNN: int +BackgroundSubtractorType = int +"""One of [TYPE_BS_MOG2, TYPE_BS_KNN]""" + + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..c38bca4c5085c288bf8921b8ed8624f22d2dba90 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/__init__.pyi @@ -0,0 +1,41 @@ +__all__: list[str] = [] + +import cv2 +import cv2.gapi +import cv2.gapi.wip.gst +import cv2.typing +import typing as _typing + + +from cv2.gapi.wip import draw as draw +from cv2.gapi.wip import gst as gst +from cv2.gapi.wip import onevpl as onevpl + + +# Classes +class GOutputs: + # Functions + def getGMat(self) -> cv2.GMat: ... + + def getGScalar(self) -> cv2.GScalar: ... + + def getGArray(self, type: cv2.gapi.ArgType) -> cv2.GArrayT: ... + + def getGOpaque(self, type: cv2.gapi.ArgType) -> cv2.GOpaqueT: ... + + +class IStreamSource: + ... + + +# Functions +def get_streaming_source(pipeline: cv2.gapi.wip.gst.GStreamerPipeline, appsinkName: str, outputType: cv2.gapi.wip.gst.GStreamerSource_OutputType = ...) -> IStreamSource: ... + +@_typing.overload +def make_capture_src(path: str, properties: cv2.typing.map_int_and_double = ...) -> IStreamSource: ... +@_typing.overload +def make_capture_src(id: int, properties: cv2.typing.map_int_and_double = ...) -> IStreamSource: ... + +def make_gst_src(pipeline: str, outputType: cv2.gapi.wip.gst.GStreamerSource_OutputType = ...) -> IStreamSource: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/draw/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/draw/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..075337837eaf411a536bb5ea8ca0d7084b9ad52b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/draw/__init__.pyi @@ -0,0 +1,119 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +# Classes +class Text: + text: str + org: cv2.typing.Point + ff: int + fs: float + color: cv2.typing.Scalar + thick: int + lt: int + bottom_left_origin: bool + + # Functions + @_typing.overload + def __init__(self, text_: str, org_: cv2.typing.Point, ff_: int, fs_: float, color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., bottom_left_origin_: bool = ...) -> None: ... + @_typing.overload + def __init__(self) -> None: ... + + +class Rect: + rect: cv2.typing.Rect + color: cv2.typing.Scalar + thick: int + lt: int + shift: int + + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, rect_: cv2.typing.Rect2i, color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., shift_: int = ...) -> None: ... + + +class Circle: + center: cv2.typing.Point + radius: int + color: cv2.typing.Scalar + thick: int + lt: int + shift: int + + # Functions + @_typing.overload + def __init__(self, center_: cv2.typing.Point, radius_: int, color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., shift_: int = ...) -> None: ... + @_typing.overload + def __init__(self) -> None: ... + + +class Line: + pt1: cv2.typing.Point + pt2: cv2.typing.Point + color: cv2.typing.Scalar + thick: int + lt: int + shift: int + + # Functions + @_typing.overload + def __init__(self, pt1_: cv2.typing.Point, pt2_: cv2.typing.Point, color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., shift_: int = ...) -> None: ... + @_typing.overload + def __init__(self) -> None: ... + + +class Mosaic: + mos: cv2.typing.Rect + cellSz: int + decim: int + + # Functions + @_typing.overload + def __init__(self) -> None: ... + @_typing.overload + def __init__(self, mos_: cv2.typing.Rect2i, cellSz_: int, decim_: int) -> None: ... + + +class Image: + org: cv2.typing.Point + img: cv2.typing.MatLike + alpha: cv2.typing.MatLike + + # Functions + @_typing.overload + def __init__(self, org_: cv2.typing.Point, img_: cv2.typing.MatLike, alpha_: cv2.typing.MatLike) -> None: ... + @_typing.overload + def __init__(self) -> None: ... + + +class Poly: + points: _typing.Sequence[cv2.typing.Point] + color: cv2.typing.Scalar + thick: int + lt: int + shift: int + + # Functions + @_typing.overload + def __init__(self, points_: _typing.Sequence[cv2.typing.Point], color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., shift_: int = ...) -> None: ... + @_typing.overload + def __init__(self) -> None: ... + + + +# Functions +@_typing.overload +def render(bgr: cv2.typing.MatLike, prims: _typing.Sequence[cv2.typing.Prim], args: _typing.Sequence[cv2.GCompileArg] = ...) -> None: ... +@_typing.overload +def render(y_plane: cv2.typing.MatLike, uv_plane: cv2.typing.MatLike, prims: _typing.Sequence[cv2.typing.Prim], args: _typing.Sequence[cv2.GCompileArg] = ...) -> None: ... + +def render3ch(src: cv2.GMat, prims: cv2.GArrayT) -> cv2.GMat: ... + +def renderNV12(y: cv2.GMat, uv: cv2.GMat, prims: cv2.GArrayT) -> tuple[cv2.GMat, cv2.GMat]: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/gst/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/gst/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..739778186a9ea96cb71a4f06244f895653524a44 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/gst/__init__.pyi @@ -0,0 +1,17 @@ +__all__: list[str] = [] + +GStreamerSource_OutputType_FRAME: int +GSTREAMER_SOURCE_OUTPUT_TYPE_FRAME: int +GStreamerSource_OutputType_MAT: int +GSTREAMER_SOURCE_OUTPUT_TYPE_MAT: int +GStreamerSource_OutputType = int +"""One of [GStreamerSource_OutputType_FRAME, GSTREAMER_SOURCE_OUTPUT_TYPE_FRAME, GStreamerSource_OutputType_MAT, GSTREAMER_SOURCE_OUTPUT_TYPE_MAT]""" + + +# Classes +class GStreamerPipeline: + # Functions + def __init__(self, pipeline: str) -> None: ... + + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/onevpl/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/onevpl/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..46acf87b226d3a40736df7bbe985f714eb803887 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/gapi/wip/onevpl/__init__.pyi @@ -0,0 +1,16 @@ +__all__: list[str] = [] + +# Enumerations +AccelType_HOST: int +ACCEL_TYPE_HOST: int +AccelType_DX11: int +ACCEL_TYPE_DX11: int +AccelType_VAAPI: int +ACCEL_TYPE_VAAPI: int +AccelType_LAST_VALUE: int +ACCEL_TYPE_LAST_VALUE: int +AccelType = int +"""One of [AccelType_HOST, ACCEL_TYPE_HOST, AccelType_DX11, ACCEL_TYPE_DX11, AccelType_VAAPI, ACCEL_TYPE_VAAPI, AccelType_LAST_VALUE, ACCEL_TYPE_LAST_VALUE]""" + + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/ipp/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/ipp/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..23b6636ee899355b99cfe4fd3c2d5f897e538b33 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/ipp/__init__.pyi @@ -0,0 +1,14 @@ +__all__: list[str] = [] + +# Functions +def getIppVersion() -> str: ... + +def setUseIPP(flag: bool) -> None: ... + +def setUseIPP_NotExact(flag: bool) -> None: ... + +def useIPP() -> bool: ... + +def useIPP_NotExact() -> bool: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/mat_wrapper/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/cv2/mat_wrapper/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8a1e4580c9830128b44272fc86e86d60d06d0970 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/mat_wrapper/__init__.py @@ -0,0 +1,40 @@ +__all__ = [] + +import numpy as np +import cv2 as cv +from typing import TYPE_CHECKING, Any + +# Same as cv2.typing.NumPyArrayNumeric, but avoids circular dependencies +if TYPE_CHECKING: + _NumPyArrayNumeric = np.ndarray[Any, np.dtype[np.integer[Any] | np.floating[Any]]] +else: + _NumPyArrayNumeric = np.ndarray + +# NumPy documentation: https://numpy.org/doc/stable/user/basics.subclassing.html + + +class Mat(_NumPyArrayNumeric): + ''' + cv.Mat wrapper for numpy array. + + Stores extra metadata information how to interpret and process of numpy array for underlying C++ code. + ''' + + def __new__(cls, arr, **kwargs): + obj = arr.view(Mat) + return obj + + def __init__(self, arr, **kwargs): + self.wrap_channels = kwargs.pop('wrap_channels', getattr(arr, 'wrap_channels', False)) + if len(kwargs) > 0: + raise TypeError('Unknown parameters: {}'.format(repr(kwargs))) + + def __array_finalize__(self, obj): + if obj is None: + return + self.wrap_channels = getattr(obj, 'wrap_channels', None) + + +Mat.__module__ = cv.__name__ +cv.Mat = Mat +cv._registerMatType(Mat) diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/mat_wrapper/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/mat_wrapper/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1b2bea65839a1f4d4d69434289d9d2ce1098233 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/mat_wrapper/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3e0559d3d4718e454eb687530f262bcf244e70e5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/__init__.py @@ -0,0 +1 @@ +from .version import get_ocv_version diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c9682c5f567e867edb78c70fb44c4edd05524a05 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/__pycache__/version.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/__pycache__/version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..764f2989c15589a9dbf3fd5b5ef95c894e22245a Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/__pycache__/version.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/version.py b/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/version.py new file mode 100644 index 0000000000000000000000000000000000000000..d34705872edab5e755e896f9d85a0534b9ab7657 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/misc/version.py @@ -0,0 +1,5 @@ +import cv2 + + +def get_ocv_version(): + return getattr(cv2, "__version__", "unavailable") diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/ml/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/ml/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..688da1a1f289f0430e5bacc246444709075d2b33 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/ml/__init__.pyi @@ -0,0 +1,695 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +# Enumerations +VAR_NUMERICAL: int +VAR_ORDERED: int +VAR_CATEGORICAL: int +VariableTypes = int +"""One of [VAR_NUMERICAL, VAR_ORDERED, VAR_CATEGORICAL]""" + +TEST_ERROR: int +TRAIN_ERROR: int +ErrorTypes = int +"""One of [TEST_ERROR, TRAIN_ERROR]""" + +ROW_SAMPLE: int +COL_SAMPLE: int +SampleTypes = int +"""One of [ROW_SAMPLE, COL_SAMPLE]""" + + +StatModel_UPDATE_MODEL: int +STAT_MODEL_UPDATE_MODEL: int +StatModel_RAW_OUTPUT: int +STAT_MODEL_RAW_OUTPUT: int +StatModel_COMPRESSED_INPUT: int +STAT_MODEL_COMPRESSED_INPUT: int +StatModel_PREPROCESSED_INPUT: int +STAT_MODEL_PREPROCESSED_INPUT: int +StatModel_Flags = int +"""One of [StatModel_UPDATE_MODEL, STAT_MODEL_UPDATE_MODEL, StatModel_RAW_OUTPUT, STAT_MODEL_RAW_OUTPUT, StatModel_COMPRESSED_INPUT, STAT_MODEL_COMPRESSED_INPUT, StatModel_PREPROCESSED_INPUT, STAT_MODEL_PREPROCESSED_INPUT]""" + +KNearest_BRUTE_FORCE: int +KNEAREST_BRUTE_FORCE: int +KNearest_KDTREE: int +KNEAREST_KDTREE: int +KNearest_Types = int +"""One of [KNearest_BRUTE_FORCE, KNEAREST_BRUTE_FORCE, KNearest_KDTREE, KNEAREST_KDTREE]""" + +SVM_C_SVC: int +SVM_NU_SVC: int +SVM_ONE_CLASS: int +SVM_EPS_SVR: int +SVM_NU_SVR: int +SVM_Types = int +"""One of [SVM_C_SVC, SVM_NU_SVC, SVM_ONE_CLASS, SVM_EPS_SVR, SVM_NU_SVR]""" + +SVM_CUSTOM: int +SVM_LINEAR: int +SVM_POLY: int +SVM_RBF: int +SVM_SIGMOID: int +SVM_CHI2: int +SVM_INTER: int +SVM_KernelTypes = int +"""One of [SVM_CUSTOM, SVM_LINEAR, SVM_POLY, SVM_RBF, SVM_SIGMOID, SVM_CHI2, SVM_INTER]""" + +SVM_C: int +SVM_GAMMA: int +SVM_P: int +SVM_NU: int +SVM_COEF: int +SVM_DEGREE: int +SVM_ParamTypes = int +"""One of [SVM_C, SVM_GAMMA, SVM_P, SVM_NU, SVM_COEF, SVM_DEGREE]""" + +EM_COV_MAT_SPHERICAL: int +EM_COV_MAT_DIAGONAL: int +EM_COV_MAT_GENERIC: int +EM_COV_MAT_DEFAULT: int +EM_Types = int +"""One of [EM_COV_MAT_SPHERICAL, EM_COV_MAT_DIAGONAL, EM_COV_MAT_GENERIC, EM_COV_MAT_DEFAULT]""" + +EM_DEFAULT_NCLUSTERS: int +EM_DEFAULT_MAX_ITERS: int +EM_START_E_STEP: int +EM_START_M_STEP: int +EM_START_AUTO_STEP: int + +DTrees_PREDICT_AUTO: int +DTREES_PREDICT_AUTO: int +DTrees_PREDICT_SUM: int +DTREES_PREDICT_SUM: int +DTrees_PREDICT_MAX_VOTE: int +DTREES_PREDICT_MAX_VOTE: int +DTrees_PREDICT_MASK: int +DTREES_PREDICT_MASK: int +DTrees_Flags = int +"""One of [DTrees_PREDICT_AUTO, DTREES_PREDICT_AUTO, DTrees_PREDICT_SUM, DTREES_PREDICT_SUM, DTrees_PREDICT_MAX_VOTE, DTREES_PREDICT_MAX_VOTE, DTrees_PREDICT_MASK, DTREES_PREDICT_MASK]""" + +Boost_DISCRETE: int +BOOST_DISCRETE: int +Boost_REAL: int +BOOST_REAL: int +Boost_LOGIT: int +BOOST_LOGIT: int +Boost_GENTLE: int +BOOST_GENTLE: int +Boost_Types = int +"""One of [Boost_DISCRETE, BOOST_DISCRETE, Boost_REAL, BOOST_REAL, Boost_LOGIT, BOOST_LOGIT, Boost_GENTLE, BOOST_GENTLE]""" + +ANN_MLP_BACKPROP: int +ANN_MLP_RPROP: int +ANN_MLP_ANNEAL: int +ANN_MLP_TrainingMethods = int +"""One of [ANN_MLP_BACKPROP, ANN_MLP_RPROP, ANN_MLP_ANNEAL]""" + +ANN_MLP_IDENTITY: int +ANN_MLP_SIGMOID_SYM: int +ANN_MLP_GAUSSIAN: int +ANN_MLP_RELU: int +ANN_MLP_LEAKYRELU: int +ANN_MLP_ActivationFunctions = int +"""One of [ANN_MLP_IDENTITY, ANN_MLP_SIGMOID_SYM, ANN_MLP_GAUSSIAN, ANN_MLP_RELU, ANN_MLP_LEAKYRELU]""" + +ANN_MLP_UPDATE_WEIGHTS: int +ANN_MLP_NO_INPUT_SCALE: int +ANN_MLP_NO_OUTPUT_SCALE: int +ANN_MLP_TrainFlags = int +"""One of [ANN_MLP_UPDATE_WEIGHTS, ANN_MLP_NO_INPUT_SCALE, ANN_MLP_NO_OUTPUT_SCALE]""" + +LogisticRegression_REG_DISABLE: int +LOGISTIC_REGRESSION_REG_DISABLE: int +LogisticRegression_REG_L1: int +LOGISTIC_REGRESSION_REG_L1: int +LogisticRegression_REG_L2: int +LOGISTIC_REGRESSION_REG_L2: int +LogisticRegression_RegKinds = int +"""One of [LogisticRegression_REG_DISABLE, LOGISTIC_REGRESSION_REG_DISABLE, LogisticRegression_REG_L1, LOGISTIC_REGRESSION_REG_L1, LogisticRegression_REG_L2, LOGISTIC_REGRESSION_REG_L2]""" + +LogisticRegression_BATCH: int +LOGISTIC_REGRESSION_BATCH: int +LogisticRegression_MINI_BATCH: int +LOGISTIC_REGRESSION_MINI_BATCH: int +LogisticRegression_Methods = int +"""One of [LogisticRegression_BATCH, LOGISTIC_REGRESSION_BATCH, LogisticRegression_MINI_BATCH, LOGISTIC_REGRESSION_MINI_BATCH]""" + +SVMSGD_SGD: int +SVMSGD_ASGD: int +SVMSGD_SvmsgdType = int +"""One of [SVMSGD_SGD, SVMSGD_ASGD]""" + +SVMSGD_SOFT_MARGIN: int +SVMSGD_HARD_MARGIN: int +SVMSGD_MarginType = int +"""One of [SVMSGD_SOFT_MARGIN, SVMSGD_HARD_MARGIN]""" + + +# Classes +class ParamGrid: + minVal: float + maxVal: float + logStep: float + + # Functions + @classmethod + def create(cls, minVal: float = ..., maxVal: float = ..., logstep: float = ...) -> ParamGrid: ... + + +class TrainData: + # Functions + def getLayout(self) -> int: ... + + def getNTrainSamples(self) -> int: ... + + def getNTestSamples(self) -> int: ... + + def getNSamples(self) -> int: ... + + def getNVars(self) -> int: ... + + def getNAllVars(self) -> int: ... + + @_typing.overload + def getSample(self, varIdx: cv2.typing.MatLike, sidx: int, buf: float) -> None: ... + @_typing.overload + def getSample(self, varIdx: cv2.UMat, sidx: int, buf: float) -> None: ... + + def getSamples(self) -> cv2.typing.MatLike: ... + + def getMissing(self) -> cv2.typing.MatLike: ... + + def getTrainSamples(self, layout: int = ..., compressSamples: bool = ..., compressVars: bool = ...) -> cv2.typing.MatLike: ... + + def getTrainResponses(self) -> cv2.typing.MatLike: ... + + def getTrainNormCatResponses(self) -> cv2.typing.MatLike: ... + + def getTestResponses(self) -> cv2.typing.MatLike: ... + + def getTestNormCatResponses(self) -> cv2.typing.MatLike: ... + + def getResponses(self) -> cv2.typing.MatLike: ... + + def getNormCatResponses(self) -> cv2.typing.MatLike: ... + + def getSampleWeights(self) -> cv2.typing.MatLike: ... + + def getTrainSampleWeights(self) -> cv2.typing.MatLike: ... + + def getTestSampleWeights(self) -> cv2.typing.MatLike: ... + + def getVarIdx(self) -> cv2.typing.MatLike: ... + + def getVarType(self) -> cv2.typing.MatLike: ... + + def getVarSymbolFlags(self) -> cv2.typing.MatLike: ... + + def getResponseType(self) -> int: ... + + def getTrainSampleIdx(self) -> cv2.typing.MatLike: ... + + def getTestSampleIdx(self) -> cv2.typing.MatLike: ... + + @_typing.overload + def getValues(self, vi: int, sidx: cv2.typing.MatLike, values: float) -> None: ... + @_typing.overload + def getValues(self, vi: int, sidx: cv2.UMat, values: float) -> None: ... + + def getDefaultSubstValues(self) -> cv2.typing.MatLike: ... + + def getCatCount(self, vi: int) -> int: ... + + def getClassLabels(self) -> cv2.typing.MatLike: ... + + def getCatOfs(self) -> cv2.typing.MatLike: ... + + def getCatMap(self) -> cv2.typing.MatLike: ... + + def setTrainTestSplit(self, count: int, shuffle: bool = ...) -> None: ... + + def setTrainTestSplitRatio(self, ratio: float, shuffle: bool = ...) -> None: ... + + def shuffleTrainTest(self) -> None: ... + + def getTestSamples(self) -> cv2.typing.MatLike: ... + + def getNames(self, names: _typing.Sequence[str]) -> None: ... + + @staticmethod + def getSubVector(vec: cv2.typing.MatLike, idx: cv2.typing.MatLike) -> cv2.typing.MatLike: ... + + @staticmethod + def getSubMatrix(matrix: cv2.typing.MatLike, idx: cv2.typing.MatLike, layout: int) -> cv2.typing.MatLike: ... + + @classmethod + @_typing.overload + def create(cls, samples: cv2.typing.MatLike, layout: int, responses: cv2.typing.MatLike, varIdx: cv2.typing.MatLike | None = ..., sampleIdx: cv2.typing.MatLike | None = ..., sampleWeights: cv2.typing.MatLike | None = ..., varType: cv2.typing.MatLike | None = ...) -> TrainData: ... + @classmethod + @_typing.overload + def create(cls, samples: cv2.UMat, layout: int, responses: cv2.UMat, varIdx: cv2.UMat | None = ..., sampleIdx: cv2.UMat | None = ..., sampleWeights: cv2.UMat | None = ..., varType: cv2.UMat | None = ...) -> TrainData: ... + + +class StatModel(cv2.Algorithm): + # Functions + def getVarCount(self) -> int: ... + + def empty(self) -> bool: ... + + def isTrained(self) -> bool: ... + + def isClassifier(self) -> bool: ... + + @_typing.overload + def train(self, trainData: TrainData, flags: int = ...) -> bool: ... + @_typing.overload + def train(self, samples: cv2.typing.MatLike, layout: int, responses: cv2.typing.MatLike) -> bool: ... + @_typing.overload + def train(self, samples: cv2.UMat, layout: int, responses: cv2.UMat) -> bool: ... + + @_typing.overload + def calcError(self, data: TrainData, test: bool, resp: cv2.typing.MatLike | None = ...) -> tuple[float, cv2.typing.MatLike]: ... + @_typing.overload + def calcError(self, data: TrainData, test: bool, resp: cv2.UMat | None = ...) -> tuple[float, cv2.UMat]: ... + + @_typing.overload + def predict(self, samples: cv2.typing.MatLike, results: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike]: ... + @_typing.overload + def predict(self, samples: cv2.UMat, results: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat]: ... + + +class NormalBayesClassifier(StatModel): + # Functions + @_typing.overload + def predictProb(self, inputs: cv2.typing.MatLike, outputs: cv2.typing.MatLike | None = ..., outputProbs: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def predictProb(self, inputs: cv2.UMat, outputs: cv2.UMat | None = ..., outputProbs: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat, cv2.UMat]: ... + + @classmethod + def create(cls) -> NormalBayesClassifier: ... + + @classmethod + def load(cls, filepath: str, nodeName: str = ...) -> NormalBayesClassifier: ... + + +class KNearest(StatModel): + # Functions + def getDefaultK(self) -> int: ... + + def setDefaultK(self, val: int) -> None: ... + + def getIsClassifier(self) -> bool: ... + + def setIsClassifier(self, val: bool) -> None: ... + + def getEmax(self) -> int: ... + + def setEmax(self, val: int) -> None: ... + + def getAlgorithmType(self) -> int: ... + + def setAlgorithmType(self, val: int) -> None: ... + + @_typing.overload + def findNearest(self, samples: cv2.typing.MatLike, k: int, results: cv2.typing.MatLike | None = ..., neighborResponses: cv2.typing.MatLike | None = ..., dist: cv2.typing.MatLike | None = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def findNearest(self, samples: cv2.UMat, k: int, results: cv2.UMat | None = ..., neighborResponses: cv2.UMat | None = ..., dist: cv2.UMat | None = ...) -> tuple[float, cv2.UMat, cv2.UMat, cv2.UMat]: ... + + @classmethod + def create(cls) -> KNearest: ... + + @classmethod + def load(cls, filepath: str) -> KNearest: ... + + +class SVM(StatModel): + # Functions + def getType(self) -> int: ... + + def setType(self, val: int) -> None: ... + + def getGamma(self) -> float: ... + + def setGamma(self, val: float) -> None: ... + + def getCoef0(self) -> float: ... + + def setCoef0(self, val: float) -> None: ... + + def getDegree(self) -> float: ... + + def setDegree(self, val: float) -> None: ... + + def getC(self) -> float: ... + + def setC(self, val: float) -> None: ... + + def getNu(self) -> float: ... + + def setNu(self, val: float) -> None: ... + + def getP(self) -> float: ... + + def setP(self, val: float) -> None: ... + + def getClassWeights(self) -> cv2.typing.MatLike: ... + + def setClassWeights(self, val: cv2.typing.MatLike) -> None: ... + + def getTermCriteria(self) -> cv2.typing.TermCriteria: ... + + def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ... + + def getKernelType(self) -> int: ... + + def setKernel(self, kernelType: int) -> None: ... + + @_typing.overload + def trainAuto(self, samples: cv2.typing.MatLike, layout: int, responses: cv2.typing.MatLike, kFold: int = ..., Cgrid: ParamGrid = ..., gammaGrid: ParamGrid = ..., pGrid: ParamGrid = ..., nuGrid: ParamGrid = ..., coeffGrid: ParamGrid = ..., degreeGrid: ParamGrid = ..., balanced: bool = ...) -> bool: ... + @_typing.overload + def trainAuto(self, samples: cv2.UMat, layout: int, responses: cv2.UMat, kFold: int = ..., Cgrid: ParamGrid = ..., gammaGrid: ParamGrid = ..., pGrid: ParamGrid = ..., nuGrid: ParamGrid = ..., coeffGrid: ParamGrid = ..., degreeGrid: ParamGrid = ..., balanced: bool = ...) -> bool: ... + + def getSupportVectors(self) -> cv2.typing.MatLike: ... + + def getUncompressedSupportVectors(self) -> cv2.typing.MatLike: ... + + @_typing.overload + def getDecisionFunction(self, i: int, alpha: cv2.typing.MatLike | None = ..., svidx: cv2.typing.MatLike | None = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def getDecisionFunction(self, i: int, alpha: cv2.UMat | None = ..., svidx: cv2.UMat | None = ...) -> tuple[float, cv2.UMat, cv2.UMat]: ... + + @staticmethod + def getDefaultGridPtr(param_id: int) -> ParamGrid: ... + + @classmethod + def create(cls) -> SVM: ... + + @classmethod + def load(cls, filepath: str) -> SVM: ... + + +class EM(StatModel): + # Functions + def getClustersNumber(self) -> int: ... + + def setClustersNumber(self, val: int) -> None: ... + + def getCovarianceMatrixType(self) -> int: ... + + def setCovarianceMatrixType(self, val: int) -> None: ... + + def getTermCriteria(self) -> cv2.typing.TermCriteria: ... + + def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ... + + def getWeights(self) -> cv2.typing.MatLike: ... + + def getMeans(self) -> cv2.typing.MatLike: ... + + def getCovs(self, covs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + + @_typing.overload + def predict(self, samples: cv2.typing.MatLike, results: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike]: ... + @_typing.overload + def predict(self, samples: cv2.UMat, results: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat]: ... + + @_typing.overload + def predict2(self, sample: cv2.typing.MatLike, probs: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.Vec2d, cv2.typing.MatLike]: ... + @_typing.overload + def predict2(self, sample: cv2.UMat, probs: cv2.UMat | None = ...) -> tuple[cv2.typing.Vec2d, cv2.UMat]: ... + + @_typing.overload + def trainEM(self, samples: cv2.typing.MatLike, logLikelihoods: cv2.typing.MatLike | None = ..., labels: cv2.typing.MatLike | None = ..., probs: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def trainEM(self, samples: cv2.UMat, logLikelihoods: cv2.UMat | None = ..., labels: cv2.UMat | None = ..., probs: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ... + + @_typing.overload + def trainE(self, samples: cv2.typing.MatLike, means0: cv2.typing.MatLike, covs0: cv2.typing.MatLike | None = ..., weights0: cv2.typing.MatLike | None = ..., logLikelihoods: cv2.typing.MatLike | None = ..., labels: cv2.typing.MatLike | None = ..., probs: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def trainE(self, samples: cv2.UMat, means0: cv2.UMat, covs0: cv2.UMat | None = ..., weights0: cv2.UMat | None = ..., logLikelihoods: cv2.UMat | None = ..., labels: cv2.UMat | None = ..., probs: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ... + + @_typing.overload + def trainM(self, samples: cv2.typing.MatLike, probs0: cv2.typing.MatLike, logLikelihoods: cv2.typing.MatLike | None = ..., labels: cv2.typing.MatLike | None = ..., probs: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ... + @_typing.overload + def trainM(self, samples: cv2.UMat, probs0: cv2.UMat, logLikelihoods: cv2.UMat | None = ..., labels: cv2.UMat | None = ..., probs: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ... + + @classmethod + def create(cls) -> EM: ... + + @classmethod + def load(cls, filepath: str, nodeName: str = ...) -> EM: ... + + +class DTrees(StatModel): + # Functions + def getMaxCategories(self) -> int: ... + + def setMaxCategories(self, val: int) -> None: ... + + def getMaxDepth(self) -> int: ... + + def setMaxDepth(self, val: int) -> None: ... + + def getMinSampleCount(self) -> int: ... + + def setMinSampleCount(self, val: int) -> None: ... + + def getCVFolds(self) -> int: ... + + def setCVFolds(self, val: int) -> None: ... + + def getUseSurrogates(self) -> bool: ... + + def setUseSurrogates(self, val: bool) -> None: ... + + def getUse1SERule(self) -> bool: ... + + def setUse1SERule(self, val: bool) -> None: ... + + def getTruncatePrunedTree(self) -> bool: ... + + def setTruncatePrunedTree(self, val: bool) -> None: ... + + def getRegressionAccuracy(self) -> float: ... + + def setRegressionAccuracy(self, val: float) -> None: ... + + def getPriors(self) -> cv2.typing.MatLike: ... + + def setPriors(self, val: cv2.typing.MatLike) -> None: ... + + @classmethod + def create(cls) -> DTrees: ... + + @classmethod + def load(cls, filepath: str, nodeName: str = ...) -> DTrees: ... + + +class RTrees(DTrees): + # Functions + def getCalculateVarImportance(self) -> bool: ... + + def setCalculateVarImportance(self, val: bool) -> None: ... + + def getActiveVarCount(self) -> int: ... + + def setActiveVarCount(self, val: int) -> None: ... + + def getTermCriteria(self) -> cv2.typing.TermCriteria: ... + + def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ... + + def getVarImportance(self) -> cv2.typing.MatLike: ... + + @_typing.overload + def getVotes(self, samples: cv2.typing.MatLike, flags: int, results: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ... + @_typing.overload + def getVotes(self, samples: cv2.UMat, flags: int, results: cv2.UMat | None = ...) -> cv2.UMat: ... + + def getOOBError(self) -> float: ... + + @classmethod + def create(cls) -> RTrees: ... + + @classmethod + def load(cls, filepath: str, nodeName: str = ...) -> RTrees: ... + + +class Boost(DTrees): + # Functions + def getBoostType(self) -> int: ... + + def setBoostType(self, val: int) -> None: ... + + def getWeakCount(self) -> int: ... + + def setWeakCount(self, val: int) -> None: ... + + def getWeightTrimRate(self) -> float: ... + + def setWeightTrimRate(self, val: float) -> None: ... + + @classmethod + def create(cls) -> Boost: ... + + @classmethod + def load(cls, filepath: str, nodeName: str = ...) -> Boost: ... + + +class ANN_MLP(StatModel): + # Functions + def setTrainMethod(self, method: int, param1: float = ..., param2: float = ...) -> None: ... + + def getTrainMethod(self) -> int: ... + + def setActivationFunction(self, type: int, param1: float = ..., param2: float = ...) -> None: ... + + @_typing.overload + def setLayerSizes(self, _layer_sizes: cv2.typing.MatLike) -> None: ... + @_typing.overload + def setLayerSizes(self, _layer_sizes: cv2.UMat) -> None: ... + + def getLayerSizes(self) -> cv2.typing.MatLike: ... + + def getTermCriteria(self) -> cv2.typing.TermCriteria: ... + + def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ... + + def getBackpropWeightScale(self) -> float: ... + + def setBackpropWeightScale(self, val: float) -> None: ... + + def getBackpropMomentumScale(self) -> float: ... + + def setBackpropMomentumScale(self, val: float) -> None: ... + + def getRpropDW0(self) -> float: ... + + def setRpropDW0(self, val: float) -> None: ... + + def getRpropDWPlus(self) -> float: ... + + def setRpropDWPlus(self, val: float) -> None: ... + + def getRpropDWMinus(self) -> float: ... + + def setRpropDWMinus(self, val: float) -> None: ... + + def getRpropDWMin(self) -> float: ... + + def setRpropDWMin(self, val: float) -> None: ... + + def getRpropDWMax(self) -> float: ... + + def setRpropDWMax(self, val: float) -> None: ... + + def getAnnealInitialT(self) -> float: ... + + def setAnnealInitialT(self, val: float) -> None: ... + + def getAnnealFinalT(self) -> float: ... + + def setAnnealFinalT(self, val: float) -> None: ... + + def getAnnealCoolingRatio(self) -> float: ... + + def setAnnealCoolingRatio(self, val: float) -> None: ... + + def getAnnealItePerStep(self) -> int: ... + + def setAnnealItePerStep(self, val: int) -> None: ... + + def getWeights(self, layerIdx: int) -> cv2.typing.MatLike: ... + + @classmethod + def create(cls) -> ANN_MLP: ... + + @classmethod + def load(cls, filepath: str) -> ANN_MLP: ... + + +class LogisticRegression(StatModel): + # Functions + def getLearningRate(self) -> float: ... + + def setLearningRate(self, val: float) -> None: ... + + def getIterations(self) -> int: ... + + def setIterations(self, val: int) -> None: ... + + def getRegularization(self) -> int: ... + + def setRegularization(self, val: int) -> None: ... + + def getTrainMethod(self) -> int: ... + + def setTrainMethod(self, val: int) -> None: ... + + def getMiniBatchSize(self) -> int: ... + + def setMiniBatchSize(self, val: int) -> None: ... + + def getTermCriteria(self) -> cv2.typing.TermCriteria: ... + + def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ... + + @_typing.overload + def predict(self, samples: cv2.typing.MatLike, results: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike]: ... + @_typing.overload + def predict(self, samples: cv2.UMat, results: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat]: ... + + def get_learnt_thetas(self) -> cv2.typing.MatLike: ... + + @classmethod + def create(cls) -> LogisticRegression: ... + + @classmethod + def load(cls, filepath: str, nodeName: str = ...) -> LogisticRegression: ... + + +class SVMSGD(StatModel): + # Functions + def getWeights(self) -> cv2.typing.MatLike: ... + + def getShift(self) -> float: ... + + @classmethod + def create(cls) -> SVMSGD: ... + + @classmethod + def load(cls, filepath: str, nodeName: str = ...) -> SVMSGD: ... + + def setOptimalParameters(self, svmsgdType: int = ..., marginType: int = ...) -> None: ... + + def getSvmsgdType(self) -> int: ... + + def setSvmsgdType(self, svmsgdType: int) -> None: ... + + def getMarginType(self) -> int: ... + + def setMarginType(self, marginType: int) -> None: ... + + def getMarginRegularization(self) -> float: ... + + def setMarginRegularization(self, marginRegularization: float) -> None: ... + + def getInitialStepSize(self) -> float: ... + + def setInitialStepSize(self, InitialStepSize: float) -> None: ... + + def getStepDecreasingPower(self) -> float: ... + + def setStepDecreasingPower(self, stepDecreasingPower: float) -> None: ... + + def getTermCriteria(self) -> cv2.typing.TermCriteria: ... + + def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ... + + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/ocl/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/ocl/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..1bf5bb2590c25ca1d490537a9b7ac2350031ac6f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/ocl/__init__.pyi @@ -0,0 +1,252 @@ +__all__: list[str] = [] + +# Enumerations +OCL_VECTOR_OWN: int +OCL_VECTOR_MAX: int +OCL_VECTOR_DEFAULT: int +OclVectorStrategy = int +"""One of [OCL_VECTOR_OWN, OCL_VECTOR_MAX, OCL_VECTOR_DEFAULT]""" + + +Device_TYPE_DEFAULT: int +DEVICE_TYPE_DEFAULT: int +Device_TYPE_CPU: int +DEVICE_TYPE_CPU: int +Device_TYPE_GPU: int +DEVICE_TYPE_GPU: int +Device_TYPE_ACCELERATOR: int +DEVICE_TYPE_ACCELERATOR: int +Device_TYPE_DGPU: int +DEVICE_TYPE_DGPU: int +Device_TYPE_IGPU: int +DEVICE_TYPE_IGPU: int +Device_TYPE_ALL: int +DEVICE_TYPE_ALL: int +Device_FP_DENORM: int +DEVICE_FP_DENORM: int +Device_FP_INF_NAN: int +DEVICE_FP_INF_NAN: int +Device_FP_ROUND_TO_NEAREST: int +DEVICE_FP_ROUND_TO_NEAREST: int +Device_FP_ROUND_TO_ZERO: int +DEVICE_FP_ROUND_TO_ZERO: int +Device_FP_ROUND_TO_INF: int +DEVICE_FP_ROUND_TO_INF: int +Device_FP_FMA: int +DEVICE_FP_FMA: int +Device_FP_SOFT_FLOAT: int +DEVICE_FP_SOFT_FLOAT: int +Device_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT: int +DEVICE_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT: int +Device_EXEC_KERNEL: int +DEVICE_EXEC_KERNEL: int +Device_EXEC_NATIVE_KERNEL: int +DEVICE_EXEC_NATIVE_KERNEL: int +Device_NO_CACHE: int +DEVICE_NO_CACHE: int +Device_READ_ONLY_CACHE: int +DEVICE_READ_ONLY_CACHE: int +Device_READ_WRITE_CACHE: int +DEVICE_READ_WRITE_CACHE: int +Device_NO_LOCAL_MEM: int +DEVICE_NO_LOCAL_MEM: int +Device_LOCAL_IS_LOCAL: int +DEVICE_LOCAL_IS_LOCAL: int +Device_LOCAL_IS_GLOBAL: int +DEVICE_LOCAL_IS_GLOBAL: int +Device_UNKNOWN_VENDOR: int +DEVICE_UNKNOWN_VENDOR: int +Device_VENDOR_AMD: int +DEVICE_VENDOR_AMD: int +Device_VENDOR_INTEL: int +DEVICE_VENDOR_INTEL: int +Device_VENDOR_NVIDIA: int +DEVICE_VENDOR_NVIDIA: int + +KernelArg_LOCAL: int +KERNEL_ARG_LOCAL: int +KernelArg_READ_ONLY: int +KERNEL_ARG_READ_ONLY: int +KernelArg_WRITE_ONLY: int +KERNEL_ARG_WRITE_ONLY: int +KernelArg_READ_WRITE: int +KERNEL_ARG_READ_WRITE: int +KernelArg_CONSTANT: int +KERNEL_ARG_CONSTANT: int +KernelArg_PTR_ONLY: int +KERNEL_ARG_PTR_ONLY: int +KernelArg_NO_SIZE: int +KERNEL_ARG_NO_SIZE: int + + +# Classes +class Device: + # Functions + def __init__(self) -> None: ... + + def name(self) -> str: ... + + def extensions(self) -> str: ... + + def isExtensionSupported(self, extensionName: str) -> bool: ... + + def version(self) -> str: ... + + def vendorName(self) -> str: ... + + def OpenCL_C_Version(self) -> str: ... + + def OpenCLVersion(self) -> str: ... + + def deviceVersionMajor(self) -> int: ... + + def deviceVersionMinor(self) -> int: ... + + def driverVersion(self) -> str: ... + + def type(self) -> int: ... + + def addressBits(self) -> int: ... + + def available(self) -> bool: ... + + def compilerAvailable(self) -> bool: ... + + def linkerAvailable(self) -> bool: ... + + def doubleFPConfig(self) -> int: ... + + def singleFPConfig(self) -> int: ... + + def halfFPConfig(self) -> int: ... + + def hasFP64(self) -> bool: ... + + def hasFP16(self) -> bool: ... + + def endianLittle(self) -> bool: ... + + def errorCorrectionSupport(self) -> bool: ... + + def executionCapabilities(self) -> int: ... + + def globalMemCacheSize(self) -> int: ... + + def globalMemCacheType(self) -> int: ... + + def globalMemCacheLineSize(self) -> int: ... + + def globalMemSize(self) -> int: ... + + def localMemSize(self) -> int: ... + + def localMemType(self) -> int: ... + + def hostUnifiedMemory(self) -> bool: ... + + def imageSupport(self) -> bool: ... + + def imageFromBufferSupport(self) -> bool: ... + + def intelSubgroupsSupport(self) -> bool: ... + + def image2DMaxWidth(self) -> int: ... + + def image2DMaxHeight(self) -> int: ... + + def image3DMaxWidth(self) -> int: ... + + def image3DMaxHeight(self) -> int: ... + + def image3DMaxDepth(self) -> int: ... + + def imageMaxBufferSize(self) -> int: ... + + def imageMaxArraySize(self) -> int: ... + + def vendorID(self) -> int: ... + + def isAMD(self) -> bool: ... + + def isIntel(self) -> bool: ... + + def isNVidia(self) -> bool: ... + + def maxClockFrequency(self) -> int: ... + + def maxComputeUnits(self) -> int: ... + + def maxConstantArgs(self) -> int: ... + + def maxConstantBufferSize(self) -> int: ... + + def maxMemAllocSize(self) -> int: ... + + def maxParameterSize(self) -> int: ... + + def maxReadImageArgs(self) -> int: ... + + def maxWriteImageArgs(self) -> int: ... + + def maxSamplers(self) -> int: ... + + def maxWorkGroupSize(self) -> int: ... + + def maxWorkItemDims(self) -> int: ... + + def memBaseAddrAlign(self) -> int: ... + + def nativeVectorWidthChar(self) -> int: ... + + def nativeVectorWidthShort(self) -> int: ... + + def nativeVectorWidthInt(self) -> int: ... + + def nativeVectorWidthLong(self) -> int: ... + + def nativeVectorWidthFloat(self) -> int: ... + + def nativeVectorWidthDouble(self) -> int: ... + + def nativeVectorWidthHalf(self) -> int: ... + + def preferredVectorWidthChar(self) -> int: ... + + def preferredVectorWidthShort(self) -> int: ... + + def preferredVectorWidthInt(self) -> int: ... + + def preferredVectorWidthLong(self) -> int: ... + + def preferredVectorWidthFloat(self) -> int: ... + + def preferredVectorWidthDouble(self) -> int: ... + + def preferredVectorWidthHalf(self) -> int: ... + + def printfBufferSize(self) -> int: ... + + def profilingTimerResolution(self) -> int: ... + + @classmethod + def getDefault(cls) -> Device: ... + + +class OpenCLExecutionContext: + ... + + +# Functions +def finish() -> None: ... + +def haveAmdBlas() -> bool: ... + +def haveAmdFft() -> bool: ... + +def haveOpenCL() -> bool: ... + +def setUseOpenCL(flag: bool) -> None: ... + +def useOpenCL() -> bool: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/ogl/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/ogl/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..503e1a837721dd524bd7b1f6b34250c98459f274 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/ogl/__init__.pyi @@ -0,0 +1,51 @@ +__all__: list[str] = [] + +# Enumerations +POINTS: int +LINES: int +LINE_LOOP: int +LINE_STRIP: int +TRIANGLES: int +TRIANGLE_STRIP: int +TRIANGLE_FAN: int +QUADS: int +QUAD_STRIP: int +POLYGON: int +RenderModes = int +"""One of [POINTS, LINES, LINE_LOOP, LINE_STRIP, TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN, QUADS, QUAD_STRIP, POLYGON]""" + + +Buffer_ARRAY_BUFFER: int +BUFFER_ARRAY_BUFFER: int +Buffer_ELEMENT_ARRAY_BUFFER: int +BUFFER_ELEMENT_ARRAY_BUFFER: int +Buffer_PIXEL_PACK_BUFFER: int +BUFFER_PIXEL_PACK_BUFFER: int +Buffer_PIXEL_UNPACK_BUFFER: int +BUFFER_PIXEL_UNPACK_BUFFER: int +Buffer_Target = int +"""One of [Buffer_ARRAY_BUFFER, BUFFER_ARRAY_BUFFER, Buffer_ELEMENT_ARRAY_BUFFER, BUFFER_ELEMENT_ARRAY_BUFFER, Buffer_PIXEL_PACK_BUFFER, BUFFER_PIXEL_PACK_BUFFER, Buffer_PIXEL_UNPACK_BUFFER, BUFFER_PIXEL_UNPACK_BUFFER]""" + +Buffer_READ_ONLY: int +BUFFER_READ_ONLY: int +Buffer_WRITE_ONLY: int +BUFFER_WRITE_ONLY: int +Buffer_READ_WRITE: int +BUFFER_READ_WRITE: int +Buffer_Access = int +"""One of [Buffer_READ_ONLY, BUFFER_READ_ONLY, Buffer_WRITE_ONLY, BUFFER_WRITE_ONLY, Buffer_READ_WRITE, BUFFER_READ_WRITE]""" + +Texture2D_NONE: int +TEXTURE2D_NONE: int +Texture2D_DEPTH_COMPONENT: int +TEXTURE2D_DEPTH_COMPONENT: int +Texture2D_RGB: int +TEXTURE2D_RGB: int +Texture2D_RGBA: int +TEXTURE2D_RGBA: int +Texture2D_Format = int +"""One of [Texture2D_NONE, TEXTURE2D_NONE, Texture2D_DEPTH_COMPONENT, TEXTURE2D_DEPTH_COMPONENT, Texture2D_RGB, TEXTURE2D_RGB, Texture2D_RGBA, TEXTURE2D_RGBA]""" + + +# Classes + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/parallel/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/parallel/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..50b6311be205a2c04750ef667717bd225a07bd76 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/parallel/__init__.pyi @@ -0,0 +1,6 @@ +__all__: list[str] = [] + +# Functions +def setParallelForBackend(backendName: str, propagateNumThreads: bool = ...) -> bool: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/samples/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/samples/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..03f2f9633de8ff81541a0ae6d15538100ed78aa5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/samples/__init__.pyi @@ -0,0 +1,12 @@ +__all__: list[str] = [] + +# Functions +def addSamplesDataSearchPath(path: str) -> None: ... + +def addSamplesDataSearchSubDirectory(subdir: str) -> None: ... + +def findFile(relative_path: str, required: bool = ..., silentMode: bool = ...) -> str: ... + +def findFileOrKeep(relative_path: str, silentMode: bool = ...) -> str: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/segmentation/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/segmentation/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..7baa0d1932b720547a9e5155bfe4eab9b5681822 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/segmentation/__init__.pyi @@ -0,0 +1,39 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +# Classes +class IntelligentScissorsMB: + # Functions + def __init__(self) -> None: ... + + def setWeights(self, weight_non_edge: float, weight_gradient_direction: float, weight_gradient_magnitude: float) -> IntelligentScissorsMB: ... + + def setGradientMagnitudeMaxLimit(self, gradient_magnitude_threshold_max: float = ...) -> IntelligentScissorsMB: ... + + def setEdgeFeatureZeroCrossingParameters(self, gradient_magnitude_min_value: float = ...) -> IntelligentScissorsMB: ... + + def setEdgeFeatureCannyParameters(self, threshold1: float, threshold2: float, apertureSize: int = ..., L2gradient: bool = ...) -> IntelligentScissorsMB: ... + + @_typing.overload + def applyImage(self, image: cv2.typing.MatLike) -> IntelligentScissorsMB: ... + @_typing.overload + def applyImage(self, image: cv2.UMat) -> IntelligentScissorsMB: ... + + @_typing.overload + def applyImageFeatures(self, non_edge: cv2.typing.MatLike, gradient_direction: cv2.typing.MatLike, gradient_magnitude: cv2.typing.MatLike, image: cv2.typing.MatLike | None = ...) -> IntelligentScissorsMB: ... + @_typing.overload + def applyImageFeatures(self, non_edge: cv2.UMat, gradient_direction: cv2.UMat, gradient_magnitude: cv2.UMat, image: cv2.UMat | None = ...) -> IntelligentScissorsMB: ... + + def buildMap(self, sourcePt: cv2.typing.Point) -> None: ... + + @_typing.overload + def getContour(self, targetPt: cv2.typing.Point, contour: cv2.typing.MatLike | None = ..., backward: bool = ...) -> cv2.typing.MatLike: ... + @_typing.overload + def getContour(self, targetPt: cv2.typing.Point, contour: cv2.UMat | None = ..., backward: bool = ...) -> cv2.UMat: ... + + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/typing/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/cv2/typing/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6150c8a04a0c8a937a696893410a4ee078ed9c62 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/typing/__init__.py @@ -0,0 +1,180 @@ +__all__ = [ + "IntPointer", + "MatLike", + "MatShape", + "Size", + "Size2f", + "Scalar", + "Point", + "Point2i", + "Point2f", + "Point2d", + "Point3i", + "Point3f", + "Point3d", + "Range", + "Rect", + "Rect2i", + "Rect2f", + "Rect2d", + "Moments", + "RotatedRect", + "TermCriteria", + "Vec2i", + "Vec2f", + "Vec2d", + "Vec3i", + "Vec3f", + "Vec3d", + "Vec4i", + "Vec4f", + "Vec4d", + "Vec6f", + "FeatureDetector", + "DescriptorExtractor", + "FeatureExtractor", + "Matx33f", + "Matx33d", + "Matx44f", + "Matx44d", + "LayerId", + "LayerParams", + "IndexParams", + "SearchParams", + "map_string_and_string", + "map_string_and_int", + "map_string_and_vector_size_t", + "map_string_and_vector_float", + "map_int_and_double", + "GProtoArg", + "GProtoInputArgs", + "GProtoOutputArgs", + "GRunArg", + "GOptRunArg", + "GMetaArg", + "Prim", + "GTypeInfo", + "ExtractArgsCallback", + "ExtractMetaCallback", +] + +import cv2 +import cv2.gapi.wip.draw +import cv2.mat_wrapper +import typing as _typing +import numpy +import cv2.dnn + + +if _typing.TYPE_CHECKING: + NumPyArrayNumeric = numpy.ndarray[_typing.Any, numpy.dtype[numpy.integer[_typing.Any] | numpy.floating[_typing.Any]]] +else: + NumPyArrayNumeric = numpy.ndarray + + +if _typing.TYPE_CHECKING: + NumPyArrayFloat32 = numpy.ndarray[_typing.Any, numpy.dtype[numpy.float32]] +else: + NumPyArrayFloat32 = numpy.ndarray + + +if _typing.TYPE_CHECKING: + NumPyArrayFloat64 = numpy.ndarray[_typing.Any, numpy.dtype[numpy.float64]] +else: + NumPyArrayFloat64 = numpy.ndarray + + +if _typing.TYPE_CHECKING: + TermCriteria_Type = cv2.TermCriteria_Type +else: + TermCriteria_Type = int + + +IntPointer = int +"""Represents an arbitrary pointer""" +MatLike = _typing.Union[cv2.mat_wrapper.Mat, NumPyArrayNumeric] +MatShape = _typing.Sequence[int] +Size = _typing.Sequence[int] +"""Required length is 2""" +Size2f = _typing.Sequence[float] +"""Required length is 2""" +Scalar = _typing.Union[_typing.Sequence[float], float] +"""Max sequence length is at most 4""" +Point = _typing.Sequence[int] +"""Required length is 2""" +Point2i = Point +Point2f = _typing.Sequence[float] +"""Required length is 2""" +Point2d = _typing.Sequence[float] +"""Required length is 2""" +Point3i = _typing.Sequence[int] +"""Required length is 3""" +Point3f = _typing.Sequence[float] +"""Required length is 3""" +Point3d = _typing.Sequence[float] +"""Required length is 3""" +Range = _typing.Sequence[int] +"""Required length is 2""" +Rect = _typing.Sequence[int] +"""Required length is 4""" +Rect2i = _typing.Sequence[int] +"""Required length is 4""" +Rect2f = _typing.Sequence[float] +"""Required length is 4""" +Rect2d = _typing.Sequence[float] +"""Required length is 4""" +Moments = _typing.Dict[str, float] +RotatedRect = _typing.Tuple[Point2f, Size2f, float] +"""Any type providing sequence protocol is supported""" +TermCriteria = _typing.Tuple[TermCriteria_Type, int, float] +"""Any type providing sequence protocol is supported""" +Vec2i = _typing.Sequence[int] +"""Required length is 2""" +Vec2f = _typing.Sequence[float] +"""Required length is 2""" +Vec2d = _typing.Sequence[float] +"""Required length is 2""" +Vec3i = _typing.Sequence[int] +"""Required length is 3""" +Vec3f = _typing.Sequence[float] +"""Required length is 3""" +Vec3d = _typing.Sequence[float] +"""Required length is 3""" +Vec4i = _typing.Sequence[int] +"""Required length is 4""" +Vec4f = _typing.Sequence[float] +"""Required length is 4""" +Vec4d = _typing.Sequence[float] +"""Required length is 4""" +Vec6f = _typing.Sequence[float] +"""Required length is 6""" +FeatureDetector = cv2.Feature2D +DescriptorExtractor = cv2.Feature2D +FeatureExtractor = cv2.Feature2D +Matx33f = NumPyArrayFloat32 +"""NDArray(shape=(3, 3), dtype=numpy.float32)""" +Matx33d = NumPyArrayFloat64 +"""NDArray(shape=(3, 3), dtype=numpy.float64)""" +Matx44f = NumPyArrayFloat32 +"""NDArray(shape=(4, 4), dtype=numpy.float32)""" +Matx44d = NumPyArrayFloat64 +"""NDArray(shape=(4, 4), dtype=numpy.float64)""" +LayerId = cv2.dnn.DictValue +LayerParams = _typing.Dict[str, _typing.Union[int, float, str]] +IndexParams = _typing.Dict[str, _typing.Union[bool, int, float, str]] +SearchParams = _typing.Dict[str, _typing.Union[bool, int, float, str]] +map_string_and_string = _typing.Dict[str, str] +map_string_and_int = _typing.Dict[str, int] +map_string_and_vector_size_t = _typing.Dict[str, _typing.Sequence[int]] +map_string_and_vector_float = _typing.Dict[str, _typing.Sequence[float]] +map_int_and_double = _typing.Dict[int, float] +GProtoArg = _typing.Union[Scalar, cv2.GMat, cv2.GOpaqueT, cv2.GArrayT] +GProtoInputArgs = _typing.Sequence[GProtoArg] +GProtoOutputArgs = _typing.Sequence[GProtoArg] +GRunArg = _typing.Union[MatLike, Scalar, cv2.GOpaqueT, cv2.GArrayT, _typing.Sequence[_typing.Any], None] +GOptRunArg = _typing.Optional[GRunArg] +GMetaArg = _typing.Union[cv2.GMat, Scalar, cv2.GOpaqueT, cv2.GArrayT] +Prim = _typing.Union[cv2.gapi.wip.draw.Text, cv2.gapi.wip.draw.Circle, cv2.gapi.wip.draw.Image, cv2.gapi.wip.draw.Line, cv2.gapi.wip.draw.Rect, cv2.gapi.wip.draw.Mosaic, cv2.gapi.wip.draw.Poly] +GTypeInfo = _typing.Union[cv2.GMat, Scalar, cv2.GOpaqueT, cv2.GArrayT] +ExtractArgsCallback = _typing.Callable[[_typing.Sequence[GTypeInfo]], _typing.Sequence[GRunArg]] +ExtractMetaCallback = _typing.Callable[[_typing.Sequence[GTypeInfo]], _typing.Sequence[GMetaArg]] diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/typing/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/typing/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e84cff04b7d74a729a31eb038f2874a9bf17cee Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/typing/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..49cd40ba2db2d47df1043faf7e293aa978efa5a1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/__init__.py @@ -0,0 +1,14 @@ +from collections import namedtuple + +import cv2 + + +NativeMethodPatchedResult = namedtuple("NativeMethodPatchedResult", + ("py", "native")) + + +def testOverwriteNativeMethod(arg): + return NativeMethodPatchedResult( + arg + 1, + cv2.utils._native.testOverwriteNativeMethod(arg) + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..8825e79b4bb48b409b28cc4c5c90556594d54bee --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/__init__.pyi @@ -0,0 +1,109 @@ +__all__: list[str] = [] + +import cv2 +import cv2.typing +import typing as _typing + + +from cv2.utils import fs as fs +from cv2.utils import nested as nested + + +# Classes +class ClassWithKeywordProperties: + lambda_: int + @property + def except_(self) -> int: ... + + # Functions + def __init__(self, lambda_arg: int = ..., except_arg: int = ...) -> None: ... + + + +# Functions +@_typing.overload +def copyMatAndDumpNamedArguments(src: cv2.typing.MatLike, dst: cv2.typing.MatLike | None = ..., lambda_: int = ..., sigma: float = ...) -> tuple[str, cv2.typing.MatLike]: ... +@_typing.overload +def copyMatAndDumpNamedArguments(src: cv2.UMat, dst: cv2.UMat | None = ..., lambda_: int = ..., sigma: float = ...) -> tuple[str, cv2.UMat]: ... + +def dumpBool(argument: bool) -> str: ... + +def dumpCString(argument: str) -> str: ... + +def dumpDouble(argument: float) -> str: ... + +def dumpFloat(argument: float) -> str: ... + +@_typing.overload +def dumpInputArray(argument: cv2.typing.MatLike) -> str: ... +@_typing.overload +def dumpInputArray(argument: cv2.UMat) -> str: ... + +@_typing.overload +def dumpInputArrayOfArrays(argument: _typing.Sequence[cv2.typing.MatLike]) -> str: ... +@_typing.overload +def dumpInputArrayOfArrays(argument: _typing.Sequence[cv2.UMat]) -> str: ... + +@_typing.overload +def dumpInputOutputArray(argument: cv2.typing.MatLike) -> tuple[str, cv2.typing.MatLike]: ... +@_typing.overload +def dumpInputOutputArray(argument: cv2.UMat) -> tuple[str, cv2.UMat]: ... + +@_typing.overload +def dumpInputOutputArrayOfArrays(argument: _typing.Sequence[cv2.typing.MatLike]) -> tuple[str, _typing.Sequence[cv2.typing.MatLike]]: ... +@_typing.overload +def dumpInputOutputArrayOfArrays(argument: _typing.Sequence[cv2.UMat]) -> tuple[str, _typing.Sequence[cv2.UMat]]: ... + +def dumpInt(argument: int) -> str: ... + +def dumpInt64(argument: int) -> str: ... + +def dumpRange(argument: cv2.typing.Range) -> str: ... + +def dumpRect(argument: cv2.typing.Rect) -> str: ... + +def dumpRotatedRect(argument: cv2.typing.RotatedRect) -> str: ... + +def dumpSizeT(argument: int) -> str: ... + +def dumpString(argument: str) -> str: ... + +def dumpTermCriteria(argument: cv2.typing.TermCriteria) -> str: ... + +def dumpVec2i(value: cv2.typing.Vec2i = ...) -> str: ... + +def dumpVectorOfDouble(vec: _typing.Sequence[float]) -> str: ... + +def dumpVectorOfInt(vec: _typing.Sequence[int]) -> str: ... + +def dumpVectorOfRect(vec: _typing.Sequence[cv2.typing.Rect]) -> str: ... + +def generateVectorOfInt(len: int) -> _typing.Sequence[int]: ... + +def generateVectorOfMat(len: int, rows: int, cols: int, dtype: int, vec: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ... + +def generateVectorOfRect(len: int) -> _typing.Sequence[cv2.typing.Rect]: ... + +@_typing.overload +def testAsyncArray(argument: cv2.typing.MatLike) -> cv2.AsyncArray: ... +@_typing.overload +def testAsyncArray(argument: cv2.UMat) -> cv2.AsyncArray: ... + +def testAsyncException() -> cv2.AsyncArray: ... + +@_typing.overload +def testOverloadResolution(value: int, point: cv2.typing.Point = ...) -> str: ... +@_typing.overload +def testOverloadResolution(rect: cv2.typing.Rect) -> str: ... + +def testOverwriteNativeMethod(argument: int) -> int: ... + +def testRaiseGeneralException() -> None: ... + +def testReservedKeywordConversion(positional_argument: int, lambda_: int = ..., from_: int = ...) -> str: ... + +def testRotatedRect(x: float, y: float, w: float, h: float, angle: float) -> cv2.typing.RotatedRect: ... + +def testRotatedRectVector(x: float, y: float, w: float, h: float, angle: float) -> _typing.Sequence[cv2.typing.RotatedRect]: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fd3b36b7aa7079c0142f7d1d8600a031708b8c4 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/fs/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/fs/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..3a7234f5fa1fd340f40523b5e5d7cf7e21d02bab --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/fs/__init__.pyi @@ -0,0 +1,6 @@ +__all__: list[str] = [] + +# Functions +def getCacheDirectoryForDownloads() -> str: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/nested/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/nested/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..1b30f925015ec5e9794d28e6185d0458b905925f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/utils/nested/__init__.pyi @@ -0,0 +1,31 @@ +__all__: list[str] = [] + +# Classes +class ExportClassName: + # Classes + class Params: + int_value: int + float_value: float + + # Functions + def __init__(self, int_param: int = ..., float_param: float = ...) -> None: ... + + + + # Functions + def getIntParam(self) -> int: ... + + def getFloatParam(self) -> float: ... + + @staticmethod + def originalName() -> str: ... + + @classmethod + def create(cls, params: ExportClassName.Params = ...) -> ExportClassName: ... + + + +# Functions +def testEchoBooleanFunction(flag: bool) -> bool: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/cv2/videoio_registry/__init__.pyi b/tool_server/.venv/lib/python3.12/site-packages/cv2/videoio_registry/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..5dd99d09bf5994b43e81728b25b84465d197cb76 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/cv2/videoio_registry/__init__.pyi @@ -0,0 +1,31 @@ +__all__: list[str] = [] + +import cv2 + + +# Functions +def getBackendName(api: cv2.VideoCaptureAPIs) -> str: ... + +def getBackends() -> _typing.Sequence[cv2.VideoCaptureAPIs]: ... + +def getCameraBackendPluginVersion(api: cv2.VideoCaptureAPIs) -> tuple[str, int, int]: ... + +def getCameraBackends() -> _typing.Sequence[cv2.VideoCaptureAPIs]: ... + +def getStreamBackendPluginVersion(api: cv2.VideoCaptureAPIs) -> tuple[str, int, int]: ... + +def getStreamBackends() -> _typing.Sequence[cv2.VideoCaptureAPIs]: ... + +def getStreamBufferedBackendPluginVersion(api: cv2.VideoCaptureAPIs) -> tuple[str, int, int]: ... + +def getStreamBufferedBackends() -> _typing.Sequence[cv2.VideoCaptureAPIs]: ... + +def getWriterBackendPluginVersion(api: cv2.VideoCaptureAPIs) -> tuple[str, int, int]: ... + +def getWriterBackends() -> _typing.Sequence[cv2.VideoCaptureAPIs]: ... + +def hasBackend(api: cv2.VideoCaptureAPIs) -> bool: ... + +def isBackendBuiltIn(api: cv2.VideoCaptureAPIs) -> bool: ... + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d6f1b60b91123bc82090a116f4db968e6040a9f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/__main__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/__main__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd2feda8561745fee45e9a41674d102996084338 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/__main__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/cli.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/cli.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..018b20993de9213d439a906ec7a9d0fb54ee14d1 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/cli.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/ipython.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/ipython.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e4bfde520ef5a4baa92db4c4c47ffb2f2229a911 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/ipython.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/main.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/main.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7aaac865210d7bf864754a8f5de6762f51867572 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/main.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/parser.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/parser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d5ad8dcb2c8632987fb019b6e9915745857d686 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/parser.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/variables.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/variables.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36b0102fcadef68101d500e49530c863f44e1137 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/variables.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/version.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..60bfcdeb59bb810aa0e4de0c56894c8f43234be3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/dotenv/__pycache__/version.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11-0.16.0.dist-info/licenses/LICENSE.txt b/tool_server/.venv/lib/python3.12/site-packages/h11-0.16.0.dist-info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..8f080eae848f759c9173bfc0c79506357ebe5090 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/h11-0.16.0.dist-info/licenses/LICENSE.txt @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2016 Nathaniel J. Smith and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4c6024474600c5422d1f9fa2cb37655cd5b249d Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_abnf.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_abnf.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a9803629da33f9e9a3f86319ffb959e58323e5c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_abnf.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_connection.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_connection.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..461c001b6b377b2ba3ef035c156fc0ed9de90c8f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_connection.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_events.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_events.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b319d34cc5e53054e25598d38ad49bf071c0a5f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_events.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_headers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_headers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1c7332c5d5eb0adc07b81ee578e999f1df40ae9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_headers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_readers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_readers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5069f83649d8934ff0872c71dff0c85ca744062e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_readers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_receivebuffer.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_receivebuffer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..261f4bbeefe72fe059382f2dad1117ce84c31b6c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_receivebuffer.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_state.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_state.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50e20efe420bfd0b42ccc725e929e86e236f1eea Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_state.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_util.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_util.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e219e103c9b78345bd7a06b3316affe0a269b41 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_util.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_version.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dfb4bc8ea71167e280d11ef0f7d489f42861145c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_version.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_writers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_writers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0d1f3b25b0bac652c88336f12af17983489c6eae Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/h11/__pycache__/_writers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7e69282a77427b892c9d4073f432bbd2942faf4 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/codec.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/codec.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac89d12afe2f7df0ba271c8cc2f900f00f56b5f8 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/codec.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/compat.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/compat.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0cda5dd9899b15c682356b03bc3e7c0bab1d2028 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/compat.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/core.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/core.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c09df56b37032a87257612b01ae80fe4d1bea1cf Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/core.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/idnadata.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/idnadata.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31042189f207d1eb7797f1f612410bc3b3061981 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/idnadata.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/intranges.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/intranges.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a79fb85c64e0427527feea341eb63e4c654d5233 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/intranges.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/package_data.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/package_data.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f2b1585350456d7accca27a594fcb144e1f55846 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/package_data.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/uts46data.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/uts46data.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0547eb952963c0797ea5c1654c199bfc484c7594 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/idna/__pycache__/uts46data.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53e9a7d334a30dfeee4e5b8af9511ebe07971e20d06403e7a1b2c33dc7b2a431 +size 158832 diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4ba07b82d1f9099b2d5dc90b49f1309096bdd5e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/ast_utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/ast_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a974d3e87178d2026810528fb3d1ab4d41610b9d Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/ast_utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/common.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/common.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e08f2bfb4e8e8965e38bce2ab57cff3248eb2ea Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/common.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/exceptions.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e4aa13286ade1fcbaa2689ba3b0a39001682dc51 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/exceptions.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/grammar.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/grammar.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c6f9a706f6e4370ea1ce5c7bae7cfc275719a34 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/grammar.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/indenter.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/indenter.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc9284a0d8aa940b7aba936557376f5d788619ee Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/indenter.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/lark.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/lark.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..150565031afba796b4d87717628ced1ac356b479 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/lark.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/lexer.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/lexer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f360d4524f43aceed1fa8b8c1f5689f199c4eac5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/lexer.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/load_grammar.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/load_grammar.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..021488a3c3c287a6450f9fdfb6eef2dcd560e108 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/load_grammar.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/parse_tree_builder.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/parse_tree_builder.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d370c63e35f76de56b2bc0c7930e674b943848be Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/parse_tree_builder.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/parser_frontends.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/parser_frontends.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a48635fbcb9a9453dd5ff2464c7ef3f95ced270b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/parser_frontends.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/reconstruct.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/reconstruct.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45e5a9a376593e43e3f0d51b20d99eb17f8e07b7 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/reconstruct.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/tree.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/tree.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5281dbe40505caa1f5cc69e338279c5d5c0bef01 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/tree.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/tree_matcher.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/tree_matcher.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b4f3f0237be03c5908acc4e01ed32b57d371eaf5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/tree_matcher.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/tree_templates.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/tree_templates.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..867ea3212278ddea0d8a03a42b7534b694bc8341 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/tree_templates.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48f58960b1e3cf93fbbe19ffa2ee02042d456147 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/visitors.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/visitors.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..698caed87bc74bccc55dfca8c6eab1c8ec0047aa Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pycache__/visitors.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9da62a3333a8c1d0ad7dc93692871cb36b225781 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/__init__.py @@ -0,0 +1,6 @@ +# For usage of lark with PyInstaller. See https://pyinstaller-sample-hook.readthedocs.io/en/latest/index.html + +import os + +def get_hook_dirs(): + return [os.path.dirname(__file__)] diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fa7b69ab16ee7fc94fa15b5a092bd7336295d7f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/__pycache__/hook-lark.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/__pycache__/hook-lark.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebc955ac3bf046cfca54c4b3fa482e5dee32eadf Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/__pycache__/hook-lark.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/hook-lark.py b/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/hook-lark.py new file mode 100644 index 0000000000000000000000000000000000000000..cf3d8e3d16090a57aba10da2eaec4ddb268fe7d1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/__pyinstaller/hook-lark.py @@ -0,0 +1,14 @@ +#----------------------------------------------------------------------------- +# Copyright (c) 2017-2020, PyInstaller Development Team. +# +# Distributed under the terms of the GNU General Public License (version 2 +# or later) with exception for distributing the bootloader. +# +# The full license is in the file COPYING.txt, distributed with this software. +# +# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) +#----------------------------------------------------------------------------- + +from PyInstaller.utils.hooks import collect_data_files + +datas = collect_data_files('lark') diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d5530ce702d8ee5bb01c9c9bd323562a1d351eb Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/common.lark b/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/common.lark new file mode 100644 index 0000000000000000000000000000000000000000..d2e86d17c696e492281b822080811ea76ca790c3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/common.lark @@ -0,0 +1,59 @@ +// Basic terminals for common use + + +// +// Numbers +// + +DIGIT: "0".."9" +HEXDIGIT: "a".."f"|"A".."F"|DIGIT + +INT: DIGIT+ +SIGNED_INT: ["+"|"-"] INT +DECIMAL: INT "." INT? | "." INT + +// float = /-?\d+(\.\d+)?([eE][+-]?\d+)?/ +_EXP: ("e"|"E") SIGNED_INT +FLOAT: INT _EXP | DECIMAL _EXP? +SIGNED_FLOAT: ["+"|"-"] FLOAT + +NUMBER: FLOAT | INT +SIGNED_NUMBER: ["+"|"-"] NUMBER + +// +// Strings +// +_STRING_INNER: /.*?/ +_STRING_ESC_INNER: _STRING_INNER /(? ignore + | "%import" import_path ["->" name] -> import + | "%import" import_path name_list -> multi_import + | "%override" rule -> override_rule + | "%declare" name+ -> declare + +!import_path: "."? name ("." name)* +name_list: "(" name ("," name)* ")" + +?expansions: alias (_VBAR alias)* + +?alias: expansion ["->" RULE] + +?expansion: expr* + +?expr: atom [OP | "~" NUMBER [".." NUMBER]] + +?atom: "(" expansions ")" + | "[" expansions "]" -> maybe + | value + +?value: STRING ".." STRING -> literal_range + | name + | (REGEXP | STRING) -> literal + | name "{" value ("," value)* "}" -> template_usage + +name: RULE + | TOKEN + +_VBAR: _NL? "|" +OP: /[+*]|[?](?![a-z])/ +RULE: /!?[_?]?[a-z][_a-z0-9]*/ +TOKEN: /_?[A-Z][_A-Z0-9]*/ +STRING: _STRING "i"? +REGEXP: /\/(?!\/)(\\\/|\\\\|[^\/])*?\/[imslux]*/ +_NL: /(\r?\n)+\s*/ + +%import common.ESCAPED_STRING -> _STRING +%import common.SIGNED_INT -> NUMBER +%import common.WS_INLINE + +COMMENT: /\s*/ "//" /[^\n]/* | /\s*/ "#" /[^\n]/* + +%ignore WS_INLINE +%ignore COMMENT diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/python.lark b/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/python.lark new file mode 100644 index 0000000000000000000000000000000000000000..8a75966b29642baec43d1a89343da873b1574d26 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/grammars/python.lark @@ -0,0 +1,302 @@ +// Python 3 grammar for Lark + +// This grammar should parse all python 3.x code successfully. + +// Adapted from: https://docs.python.org/3/reference/grammar.html + +// Start symbols for the grammar: +// single_input is a single interactive statement; +// file_input is a module or sequence of commands read from an input file; +// eval_input is the input for the eval() functions. +// NB: compound_stmt in single_input is followed by extra NEWLINE! +// + +single_input: _NEWLINE | simple_stmt | compound_stmt _NEWLINE +file_input: (_NEWLINE | stmt)* +eval_input: testlist _NEWLINE* + +decorator: "@" dotted_name [ "(" [arguments] ")" ] _NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef | async_funcdef) + +async_funcdef: "async" funcdef +funcdef: "def" name "(" [parameters] ")" ["->" test] ":" suite + +parameters: paramvalue ("," paramvalue)* ["," SLASH ("," paramvalue)*] ["," [starparams | kwparams]] + | starparams + | kwparams + +SLASH: "/" // Otherwise the it will completely disappear and it will be undisguisable in the result +starparams: (starparam | starguard) poststarparams +starparam: "*" typedparam +starguard: "*" +poststarparams: ("," paramvalue)* ["," kwparams] +kwparams: "**" typedparam ","? + +?paramvalue: typedparam ("=" test)? +?typedparam: name (":" test)? + + +lambdef: "lambda" [lambda_params] ":" test +lambdef_nocond: "lambda" [lambda_params] ":" test_nocond +lambda_params: lambda_paramvalue ("," lambda_paramvalue)* ["," [lambda_starparams | lambda_kwparams]] + | lambda_starparams + | lambda_kwparams +?lambda_paramvalue: name ("=" test)? +lambda_starparams: "*" [name] ("," lambda_paramvalue)* ["," [lambda_kwparams]] +lambda_kwparams: "**" name ","? + + +?stmt: simple_stmt | compound_stmt +?simple_stmt: small_stmt (";" small_stmt)* [";"] _NEWLINE +?small_stmt: (expr_stmt | assign_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr +assign_stmt: annassign | augassign | assign + +annassign: testlist_star_expr ":" test ["=" test] +assign: testlist_star_expr ("=" (yield_expr|testlist_star_expr))+ +augassign: testlist_star_expr augassign_op (yield_expr|testlist) +!augassign_op: "+=" | "-=" | "*=" | "@=" | "/=" | "%=" | "&=" | "|=" | "^=" | "<<=" | ">>=" | "**=" | "//=" +?testlist_star_expr: test_or_star_expr + | test_or_star_expr ("," test_or_star_expr)+ ","? -> tuple + | test_or_star_expr "," -> tuple + +// For normal and annotated assignments, additional restrictions enforced by the interpreter +del_stmt: "del" exprlist +pass_stmt: "pass" +?flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: "break" +continue_stmt: "continue" +return_stmt: "return" [testlist] +yield_stmt: yield_expr +raise_stmt: "raise" [test ["from" test]] +import_stmt: import_name | import_from +import_name: "import" dotted_as_names +// note below: the ("." | "...") is necessary because "..." is tokenized as ELLIPSIS +import_from: "from" (dots? dotted_name | dots) "import" ("*" | "(" import_as_names ")" | import_as_names) +!dots: "."+ +import_as_name: name ["as" name] +dotted_as_name: dotted_name ["as" name] +import_as_names: import_as_name ("," import_as_name)* [","] +dotted_as_names: dotted_as_name ("," dotted_as_name)* +dotted_name: name ("." name)* +global_stmt: "global" name ("," name)* +nonlocal_stmt: "nonlocal" name ("," name)* +assert_stmt: "assert" test ["," test] + +?compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | match_stmt + | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: "async" (funcdef | with_stmt | for_stmt) +if_stmt: "if" test ":" suite elifs ["else" ":" suite] +elifs: elif_* +elif_: "elif" test ":" suite +while_stmt: "while" test ":" suite ["else" ":" suite] +for_stmt: "for" exprlist "in" testlist ":" suite ["else" ":" suite] +try_stmt: "try" ":" suite except_clauses ["else" ":" suite] [finally] + | "try" ":" suite finally -> try_finally +finally: "finally" ":" suite +except_clauses: except_clause+ +except_clause: "except" [test ["as" name]] ":" suite +// NB compile.c makes sure that the default except clause is last + + +with_stmt: "with" with_items ":" suite +with_items: with_item ("," with_item)* +with_item: test ["as" name] + +match_stmt: "match" test ":" _NEWLINE _INDENT case+ _DEDENT + +case: "case" pattern ["if" test] ":" suite + +?pattern: sequence_item_pattern "," _sequence_pattern -> sequence_pattern + | as_pattern +?as_pattern: or_pattern ("as" NAME)? +?or_pattern: closed_pattern ("|" closed_pattern)* +?closed_pattern: literal_pattern + | NAME -> capture_pattern + | "_" -> any_pattern + | attr_pattern + | "(" as_pattern ")" + | "[" _sequence_pattern "]" -> sequence_pattern + | "(" (sequence_item_pattern "," _sequence_pattern)? ")" -> sequence_pattern + | "{" (mapping_item_pattern ("," mapping_item_pattern)* ","?)?"}" -> mapping_pattern + | "{" (mapping_item_pattern ("," mapping_item_pattern)* ",")? "**" NAME ","? "}" -> mapping_star_pattern + | class_pattern + +literal_pattern: inner_literal_pattern + +?inner_literal_pattern: "None" -> const_none + | "True" -> const_true + | "False" -> const_false + | STRING -> string + | number + +attr_pattern: NAME ("." NAME)+ -> value + +name_or_attr_pattern: NAME ("." NAME)* -> value + +mapping_item_pattern: (literal_pattern|attr_pattern) ":" as_pattern + +_sequence_pattern: (sequence_item_pattern ("," sequence_item_pattern)* ","?)? +?sequence_item_pattern: as_pattern + | "*" NAME -> star_pattern + +class_pattern: name_or_attr_pattern "(" [arguments_pattern ","?] ")" +arguments_pattern: pos_arg_pattern ["," keyws_arg_pattern] + | keyws_arg_pattern -> no_pos_arguments + +pos_arg_pattern: as_pattern ("," as_pattern)* +keyws_arg_pattern: keyw_arg_pattern ("," keyw_arg_pattern)* +keyw_arg_pattern: NAME "=" as_pattern + + + +suite: simple_stmt | _NEWLINE _INDENT stmt+ _DEDENT + +?test: or_test ("if" or_test "else" test)? + | lambdef + | assign_expr + +assign_expr: name ":=" test + +?test_nocond: or_test | lambdef_nocond + +?or_test: and_test ("or" and_test)* +?and_test: not_test_ ("and" not_test_)* +?not_test_: "not" not_test_ -> not_test + | comparison +?comparison: expr (comp_op expr)* +star_expr: "*" expr + +?expr: or_expr +?or_expr: xor_expr ("|" xor_expr)* +?xor_expr: and_expr ("^" and_expr)* +?and_expr: shift_expr ("&" shift_expr)* +?shift_expr: arith_expr (_shift_op arith_expr)* +?arith_expr: term (_add_op term)* +?term: factor (_mul_op factor)* +?factor: _unary_op factor | power + +!_unary_op: "+"|"-"|"~" +!_add_op: "+"|"-" +!_shift_op: "<<"|">>" +!_mul_op: "*"|"@"|"/"|"%"|"//" +// <> isn't actually a valid comparison operator in Python. It's here for the +// sake of a __future__ import described in PEP 401 (which really works :-) +!comp_op: "<"|">"|"=="|">="|"<="|"<>"|"!="|"in"|"not" "in"|"is"|"is" "not" + +?power: await_expr ("**" factor)? +?await_expr: AWAIT? atom_expr +AWAIT: "await" + +?atom_expr: atom_expr "(" [arguments] ")" -> funccall + | atom_expr "[" subscriptlist "]" -> getitem + | atom_expr "." name -> getattr + | atom + +?atom: "(" yield_expr ")" + | "(" _tuple_inner? ")" -> tuple + | "(" comprehension{test_or_star_expr} ")" -> tuple_comprehension + | "[" _exprlist? "]" -> list + | "[" comprehension{test_or_star_expr} "]" -> list_comprehension + | "{" _dict_exprlist? "}" -> dict + | "{" comprehension{key_value} "}" -> dict_comprehension + | "{" _exprlist "}" -> set + | "{" comprehension{test} "}" -> set_comprehension + | name -> var + | number + | string_concat + | "(" test ")" + | "..." -> ellipsis + | "None" -> const_none + | "True" -> const_true + | "False" -> const_false + + +?string_concat: string+ + +_tuple_inner: test_or_star_expr (("," test_or_star_expr)+ [","] | ",") + +?test_or_star_expr: test + | star_expr + +?subscriptlist: subscript + | subscript (("," subscript)+ [","] | ",") -> subscript_tuple +?subscript: test | ([test] ":" [test] [sliceop]) -> slice +sliceop: ":" [test] +?exprlist: (expr|star_expr) + | (expr|star_expr) (("," (expr|star_expr))+ [","]|",") +?testlist: test | testlist_tuple +testlist_tuple: test (("," test)+ [","] | ",") +_dict_exprlist: (key_value | "**" expr) ("," (key_value | "**" expr))* [","] + +key_value: test ":" test + +_exprlist: test_or_star_expr ("," test_or_star_expr)* [","] + +classdef: "class" name ["(" [arguments] ")"] ":" suite + + + +arguments: argvalue ("," argvalue)* ("," [ starargs | kwargs])? + | starargs + | kwargs + | comprehension{test} + +starargs: stararg ("," stararg)* ("," argvalue)* ["," kwargs] +stararg: "*" test +kwargs: "**" test ("," argvalue)* + +?argvalue: test ("=" test)? + + +comprehension{comp_result}: comp_result comp_fors [comp_if] +comp_fors: comp_for+ +comp_for: [ASYNC] "for" exprlist "in" or_test +ASYNC: "async" +?comp_if: "if" test_nocond + +// not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: name + +yield_expr: "yield" [testlist] + | "yield" "from" test -> yield_from + +number: DEC_NUMBER | HEX_NUMBER | BIN_NUMBER | OCT_NUMBER | FLOAT_NUMBER | IMAG_NUMBER +string: STRING | LONG_STRING + +// Other terminals + +_NEWLINE: ( /\r?\n[\t ]*/ | COMMENT )+ + +%ignore /[\t \f]+/ // WS +%ignore /\\[\t \f]*\r?\n/ // LINE_CONT +%ignore COMMENT +%declare _INDENT _DEDENT + + +// Python terminals + +!name: NAME | "match" | "case" +NAME: /[^\W\d]\w*/ +COMMENT: /#[^\n]*/ + +STRING: /([ubf]?r?|r[ubf])("(?!"").*?(? %s' % (str(self.lhs), ' '.join(str(x) for x in self.rhs)) + + def __repr__(self): + return str(self) + + def __hash__(self): + return hash((self.lhs, tuple(self.rhs))) + + def __eq__(self, other): + return self.lhs == other.lhs and self.rhs == other.rhs + + def __ne__(self, other): + return not (self == other) + + +class Grammar: + """Context-free grammar.""" + + def __init__(self, rules): + self.rules = frozenset(rules) + + def __eq__(self, other): + return self.rules == other.rules + + def __str__(self): + return '\n' + '\n'.join(sorted(repr(x) for x in self.rules)) + '\n' + + def __repr__(self): + return str(self) + + +# Parse tree data structures +class RuleNode: + """A node in the parse tree, which also contains the full rhs rule.""" + + def __init__(self, rule, children, weight=0): + self.rule = rule + self.children = children + self.weight = weight + + def __repr__(self): + return 'RuleNode(%s, [%s])' % (repr(self.rule.lhs), ', '.join(str(x) for x in self.children)) + + + +class Parser: + """Parser wrapper.""" + + def __init__(self, rules): + super(Parser, self).__init__() + self.orig_rules = {rule: rule for rule in rules} + rules = [self._to_rule(rule) for rule in rules] + self.grammar = to_cnf(Grammar(rules)) + + def _to_rule(self, lark_rule): + """Converts a lark rule, (lhs, rhs, callback, options), to a Rule.""" + assert isinstance(lark_rule.origin, NT) + assert all(isinstance(x, Symbol) for x in lark_rule.expansion) + return Rule( + lark_rule.origin, lark_rule.expansion, + weight=lark_rule.options.priority if lark_rule.options.priority else 0, + alias=lark_rule) + + def parse(self, tokenized, start): # pylint: disable=invalid-name + """Parses input, which is a list of tokens.""" + assert start + start = NT(start) + + table, trees = _parse(tokenized, self.grammar) + # Check if the parse succeeded. + if all(r.lhs != start for r in table[(0, len(tokenized) - 1)]): + raise ParseError('Parsing failed.') + parse = trees[(0, len(tokenized) - 1)][start] + return self._to_tree(revert_cnf(parse)) + + def _to_tree(self, rule_node): + """Converts a RuleNode parse tree to a lark Tree.""" + orig_rule = self.orig_rules[rule_node.rule.alias] + children = [] + for child in rule_node.children: + if isinstance(child, RuleNode): + children.append(self._to_tree(child)) + else: + assert isinstance(child.name, Token) + children.append(child.name) + t = Tree(orig_rule.origin, children) + t.rule=orig_rule + return t + + +def print_parse(node, indent=0): + if isinstance(node, RuleNode): + print(' ' * (indent * 2) + str(node.rule.lhs)) + for child in node.children: + print_parse(child, indent + 1) + else: + print(' ' * (indent * 2) + str(node.s)) + + +def _parse(s, g): + """Parses sentence 's' using CNF grammar 'g'.""" + # The CYK table. Indexed with a 2-tuple: (start pos, end pos) + table = defaultdict(set) + # Top-level structure is similar to the CYK table. Each cell is a dict from + # rule name to the best (lightest) tree for that rule. + trees = defaultdict(dict) + # Populate base case with existing terminal production rules + for i, w in enumerate(s): + for terminal, rules in g.terminal_rules.items(): + if match(terminal, w): + for rule in rules: + table[(i, i)].add(rule) + if (rule.lhs not in trees[(i, i)] or + rule.weight < trees[(i, i)][rule.lhs].weight): + trees[(i, i)][rule.lhs] = RuleNode(rule, [T(w)], weight=rule.weight) + + # Iterate over lengths of sub-sentences + for l in range(2, len(s) + 1): + # Iterate over sub-sentences with the given length + for i in range(len(s) - l + 1): + # Choose partition of the sub-sentence in [1, l) + for p in range(i + 1, i + l): + span1 = (i, p - 1) + span2 = (p, i + l - 1) + for r1, r2 in itertools.product(table[span1], table[span2]): + for rule in g.nonterminal_rules.get((r1.lhs, r2.lhs), []): + table[(i, i + l - 1)].add(rule) + r1_tree = trees[span1][r1.lhs] + r2_tree = trees[span2][r2.lhs] + rule_total_weight = rule.weight + r1_tree.weight + r2_tree.weight + if (rule.lhs not in trees[(i, i + l - 1)] + or rule_total_weight < trees[(i, i + l - 1)][rule.lhs].weight): + trees[(i, i + l - 1)][rule.lhs] = RuleNode(rule, [r1_tree, r2_tree], weight=rule_total_weight) + return table, trees + + +# This section implements context-free grammar converter to Chomsky normal form. +# It also implements a conversion of parse trees from its CNF to the original +# grammar. +# Overview: +# Applies the following operations in this order: +# * TERM: Eliminates non-solitary terminals from all rules +# * BIN: Eliminates rules with more than 2 symbols on their right-hand-side. +# * UNIT: Eliminates non-terminal unit rules +# +# The following grammar characteristics aren't featured: +# * Start symbol appears on RHS +# * Empty rules (epsilon rules) + + +class CnfWrapper: + """CNF wrapper for grammar. + + Validates that the input grammar is CNF and provides helper data structures. + """ + + def __init__(self, grammar): + super(CnfWrapper, self).__init__() + self.grammar = grammar + self.rules = grammar.rules + self.terminal_rules = defaultdict(list) + self.nonterminal_rules = defaultdict(list) + for r in self.rules: + # Validate that the grammar is CNF and populate auxiliary data structures. + assert isinstance(r.lhs, NT), r + if len(r.rhs) not in [1, 2]: + raise ParseError("CYK doesn't support empty rules") + if len(r.rhs) == 1 and isinstance(r.rhs[0], T): + self.terminal_rules[r.rhs[0]].append(r) + elif len(r.rhs) == 2 and all(isinstance(x, NT) for x in r.rhs): + self.nonterminal_rules[tuple(r.rhs)].append(r) + else: + assert False, r + + def __eq__(self, other): + return self.grammar == other.grammar + + def __repr__(self): + return repr(self.grammar) + + +class UnitSkipRule(Rule): + """A rule that records NTs that were skipped during transformation.""" + + def __init__(self, lhs, rhs, skipped_rules, weight, alias): + super(UnitSkipRule, self).__init__(lhs, rhs, weight, alias) + self.skipped_rules = skipped_rules + + def __eq__(self, other): + return isinstance(other, type(self)) and self.skipped_rules == other.skipped_rules + + __hash__ = Rule.__hash__ + + +def build_unit_skiprule(unit_rule, target_rule): + skipped_rules = [] + if isinstance(unit_rule, UnitSkipRule): + skipped_rules += unit_rule.skipped_rules + skipped_rules.append(target_rule) + if isinstance(target_rule, UnitSkipRule): + skipped_rules += target_rule.skipped_rules + return UnitSkipRule(unit_rule.lhs, target_rule.rhs, skipped_rules, + weight=unit_rule.weight + target_rule.weight, alias=unit_rule.alias) + + +def get_any_nt_unit_rule(g): + """Returns a non-terminal unit rule from 'g', or None if there is none.""" + for rule in g.rules: + if len(rule.rhs) == 1 and isinstance(rule.rhs[0], NT): + return rule + return None + + +def _remove_unit_rule(g, rule): + """Removes 'rule' from 'g' without changing the language produced by 'g'.""" + new_rules = [x for x in g.rules if x != rule] + refs = [x for x in g.rules if x.lhs == rule.rhs[0]] + new_rules += [build_unit_skiprule(rule, ref) for ref in refs] + return Grammar(new_rules) + + +def _split(rule): + """Splits a rule whose len(rhs) > 2 into shorter rules.""" + rule_str = str(rule.lhs) + '__' + '_'.join(str(x) for x in rule.rhs) + rule_name = '__SP_%s' % (rule_str) + '_%d' + yield Rule(rule.lhs, [rule.rhs[0], NT(rule_name % 1)], weight=rule.weight, alias=rule.alias) + for i in range(1, len(rule.rhs) - 2): + yield Rule(NT(rule_name % i), [rule.rhs[i], NT(rule_name % (i + 1))], weight=0, alias='Split') + yield Rule(NT(rule_name % (len(rule.rhs) - 2)), rule.rhs[-2:], weight=0, alias='Split') + + +def _term(g): + """Applies the TERM rule on 'g' (see top comment).""" + all_t = {x for rule in g.rules for x in rule.rhs if isinstance(x, T)} + t_rules = {t: Rule(NT('__T_%s' % str(t)), [t], weight=0, alias='Term') for t in all_t} + new_rules = [] + for rule in g.rules: + if len(rule.rhs) > 1 and any(isinstance(x, T) for x in rule.rhs): + new_rhs = [t_rules[x].lhs if isinstance(x, T) else x for x in rule.rhs] + new_rules.append(Rule(rule.lhs, new_rhs, weight=rule.weight, alias=rule.alias)) + new_rules.extend(v for k, v in t_rules.items() if k in rule.rhs) + else: + new_rules.append(rule) + return Grammar(new_rules) + + +def _bin(g): + """Applies the BIN rule to 'g' (see top comment).""" + new_rules = [] + for rule in g.rules: + if len(rule.rhs) > 2: + new_rules += _split(rule) + else: + new_rules.append(rule) + return Grammar(new_rules) + + +def _unit(g): + """Applies the UNIT rule to 'g' (see top comment).""" + nt_unit_rule = get_any_nt_unit_rule(g) + while nt_unit_rule: + g = _remove_unit_rule(g, nt_unit_rule) + nt_unit_rule = get_any_nt_unit_rule(g) + return g + + +def to_cnf(g): + """Creates a CNF grammar from a general context-free grammar 'g'.""" + g = _unit(_bin(_term(g))) + return CnfWrapper(g) + + +def unroll_unit_skiprule(lhs, orig_rhs, skipped_rules, children, weight, alias): + if not skipped_rules: + return RuleNode(Rule(lhs, orig_rhs, weight=weight, alias=alias), children, weight=weight) + else: + weight = weight - skipped_rules[0].weight + return RuleNode( + Rule(lhs, [skipped_rules[0].lhs], weight=weight, alias=alias), [ + unroll_unit_skiprule(skipped_rules[0].lhs, orig_rhs, + skipped_rules[1:], children, + skipped_rules[0].weight, skipped_rules[0].alias) + ], weight=weight) + + +def revert_cnf(node): + """Reverts a parse tree (RuleNode) to its original non-CNF form (Node).""" + if isinstance(node, T): + return node + # Reverts TERM rule. + if node.rule.lhs.name.startswith('__T_'): + return node.children[0] + else: + children = [] + for child in map(revert_cnf, node.children): + # Reverts BIN rule. + if isinstance(child, RuleNode) and child.rule.lhs.name.startswith('__SP_'): + children += child.children + else: + children.append(child) + # Reverts UNIT rule. + if isinstance(node.rule, UnitSkipRule): + return unroll_unit_skiprule(node.rule.lhs, node.rule.rhs, + node.rule.skipped_rules, children, + node.rule.weight, node.rule.alias) + else: + return RuleNode(node.rule, children) diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/earley.py b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/earley.py new file mode 100644 index 0000000000000000000000000000000000000000..d173129a36f9c00c41f1d9b45facbed23cddd6c1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/earley.py @@ -0,0 +1,317 @@ +"""This module implements an Earley parser. + +The core Earley algorithm used here is based on Elizabeth Scott's implementation, here: + https://www.sciencedirect.com/science/article/pii/S1571066108001497 + +That is probably the best reference for understanding the algorithm here. + +The Earley parser outputs an SPPF-tree as per that document. The SPPF tree format +is explained here: https://lark-parser.readthedocs.io/en/latest/_static/sppf/sppf.html +""" + +from typing import TYPE_CHECKING, Callable, Optional, List, Any +from collections import deque + +from ..lexer import Token +from ..tree import Tree +from ..exceptions import UnexpectedEOF, UnexpectedToken +from ..utils import logger, OrderedSet, dedup_list +from .grammar_analysis import GrammarAnalyzer +from ..grammar import NonTerminal +from .earley_common import Item +from .earley_forest import ForestSumVisitor, SymbolNode, StableSymbolNode, TokenNode, ForestToParseTree + +if TYPE_CHECKING: + from ..common import LexerConf, ParserConf + +class Parser: + lexer_conf: 'LexerConf' + parser_conf: 'ParserConf' + debug: bool + + def __init__(self, lexer_conf: 'LexerConf', parser_conf: 'ParserConf', term_matcher: Callable, + resolve_ambiguity: bool=True, debug: bool=False, + tree_class: Optional[Callable[[str, List], Any]]=Tree, ordered_sets: bool=True): + analysis = GrammarAnalyzer(parser_conf) + self.lexer_conf = lexer_conf + self.parser_conf = parser_conf + self.resolve_ambiguity = resolve_ambiguity + self.debug = debug + self.Tree = tree_class + self.Set = OrderedSet if ordered_sets else set + self.SymbolNode = StableSymbolNode if ordered_sets else SymbolNode + + self.FIRST = analysis.FIRST + self.NULLABLE = analysis.NULLABLE + self.callbacks = parser_conf.callbacks + # TODO add typing info + self.predictions = {} # type: ignore[var-annotated] + + ## These could be moved to the grammar analyzer. Pre-computing these is *much* faster than + # the slow 'isupper' in is_terminal. + self.TERMINALS = { sym for r in parser_conf.rules for sym in r.expansion if sym.is_term } + self.NON_TERMINALS = { sym for r in parser_conf.rules for sym in r.expansion if not sym.is_term } + + self.forest_sum_visitor = None + for rule in parser_conf.rules: + if rule.origin not in self.predictions: + self.predictions[rule.origin] = [x.rule for x in analysis.expand_rule(rule.origin)] + + ## Detect if any rules/terminals have priorities set. If the user specified priority = None, then + # the priorities will be stripped from all rules/terminals before they reach us, allowing us to + # skip the extra tree walk. We'll also skip this if the user just didn't specify priorities + # on any rules/terminals. + if self.forest_sum_visitor is None and rule.options.priority is not None: + self.forest_sum_visitor = ForestSumVisitor + + # Check terminals for priorities + # Ignore terminal priorities if the basic lexer is used + if self.lexer_conf.lexer_type != 'basic' and self.forest_sum_visitor is None: + for term in self.lexer_conf.terminals: + if term.priority: + self.forest_sum_visitor = ForestSumVisitor + break + + self.term_matcher = term_matcher + + + def predict_and_complete(self, i, to_scan, columns, transitives): + """The core Earley Predictor and Completer. + + At each stage of the input, we handling any completed items (things + that matched on the last cycle) and use those to predict what should + come next in the input stream. The completions and any predicted + non-terminals are recursively processed until we reach a set of, + which can be added to the scan list for the next scanner cycle.""" + # Held Completions (H in E.Scotts paper). + node_cache = {} + held_completions = {} + + column = columns[i] + # R (items) = Ei (column.items) + items = deque(column) + while items: + item = items.pop() # remove an element, A say, from R + + ### The Earley completer + if item.is_complete: ### (item.s == string) + if item.node is None: + label = (item.s, item.start, i) + item.node = node_cache[label] if label in node_cache else node_cache.setdefault(label, self.SymbolNode(*label)) + item.node.add_family(item.s, item.rule, item.start, None, None) + + # create_leo_transitives(item.rule.origin, item.start) + + ###R Joop Leo right recursion Completer + if item.rule.origin in transitives[item.start]: + transitive = transitives[item.start][item.s] + if transitive.previous in transitives[transitive.column]: + root_transitive = transitives[transitive.column][transitive.previous] + else: + root_transitive = transitive + + new_item = Item(transitive.rule, transitive.ptr, transitive.start) + label = (root_transitive.s, root_transitive.start, i) + new_item.node = node_cache[label] if label in node_cache else node_cache.setdefault(label, self.SymbolNode(*label)) + new_item.node.add_path(root_transitive, item.node) + if new_item.expect in self.TERMINALS: + # Add (B :: aC.B, h, y) to Q + to_scan.add(new_item) + elif new_item not in column: + # Add (B :: aC.B, h, y) to Ei and R + column.add(new_item) + items.append(new_item) + ###R Regular Earley completer + else: + # Empty has 0 length. If we complete an empty symbol in a particular + # parse step, we need to be able to use that same empty symbol to complete + # any predictions that result, that themselves require empty. Avoids + # infinite recursion on empty symbols. + # held_completions is 'H' in E.Scott's paper. + is_empty_item = item.start == i + if is_empty_item: + held_completions[item.rule.origin] = item.node + + originators = [originator for originator in columns[item.start] if originator.expect is not None and originator.expect == item.s] + for originator in originators: + new_item = originator.advance() + label = (new_item.s, originator.start, i) + new_item.node = node_cache[label] if label in node_cache else node_cache.setdefault(label, self.SymbolNode(*label)) + new_item.node.add_family(new_item.s, new_item.rule, i, originator.node, item.node) + if new_item.expect in self.TERMINALS: + # Add (B :: aC.B, h, y) to Q + to_scan.add(new_item) + elif new_item not in column: + # Add (B :: aC.B, h, y) to Ei and R + column.add(new_item) + items.append(new_item) + + ### The Earley predictor + elif item.expect in self.NON_TERMINALS: ### (item.s == lr0) + new_items = [] + for rule in self.predictions[item.expect]: + new_item = Item(rule, 0, i) + new_items.append(new_item) + + # Process any held completions (H). + if item.expect in held_completions: + new_item = item.advance() + label = (new_item.s, item.start, i) + new_item.node = node_cache[label] if label in node_cache else node_cache.setdefault(label, self.SymbolNode(*label)) + new_item.node.add_family(new_item.s, new_item.rule, new_item.start, item.node, held_completions[item.expect]) + new_items.append(new_item) + + for new_item in new_items: + if new_item.expect in self.TERMINALS: + to_scan.add(new_item) + elif new_item not in column: + column.add(new_item) + items.append(new_item) + + def _parse(self, lexer, columns, to_scan, start_symbol=None): + + def is_quasi_complete(item): + if item.is_complete: + return True + + quasi = item.advance() + while not quasi.is_complete: + if quasi.expect not in self.NULLABLE: + return False + if quasi.rule.origin == start_symbol and quasi.expect == start_symbol: + return False + quasi = quasi.advance() + return True + + # def create_leo_transitives(origin, start): + # ... # removed at commit 4c1cfb2faf24e8f8bff7112627a00b94d261b420 + + def scan(i, token, to_scan): + """The core Earley Scanner. + + This is a custom implementation of the scanner that uses the + Lark lexer to match tokens. The scan list is built by the + Earley predictor, based on the previously completed tokens. + This ensures that at each phase of the parse we have a custom + lexer context, allowing for more complex ambiguities.""" + next_to_scan = self.Set() + next_set = self.Set() + columns.append(next_set) + transitives.append({}) + node_cache = {} + + for item in self.Set(to_scan): + if match(item.expect, token): + new_item = item.advance() + label = (new_item.s, new_item.start, i) + # 'terminals' may not contain token.type when using %declare + # Additionally, token is not always a Token + # For example, it can be a Tree when using TreeMatcher + term = terminals.get(token.type) if isinstance(token, Token) else None + # Set the priority of the token node to 0 so that the + # terminal priorities do not affect the Tree chosen by + # ForestSumVisitor after the basic lexer has already + # "used up" the terminal priorities + token_node = TokenNode(token, term, priority=0) + new_item.node = node_cache[label] if label in node_cache else node_cache.setdefault(label, self.SymbolNode(*label)) + new_item.node.add_family(new_item.s, item.rule, new_item.start, item.node, token_node) + + if new_item.expect in self.TERMINALS: + # add (B ::= Aai+1.B, h, y) to Q' + next_to_scan.add(new_item) + else: + # add (B ::= Aa+1.B, h, y) to Ei+1 + next_set.add(new_item) + + if not next_set and not next_to_scan: + expect = {i.expect.name for i in to_scan} + raise UnexpectedToken(token, expect, considered_rules=set(to_scan), state=frozenset(i.s for i in to_scan)) + + return next_to_scan + + + # Define parser functions + match = self.term_matcher + + terminals = self.lexer_conf.terminals_by_name + + # Cache for nodes & tokens created in a particular parse step. + transitives = [{}] + + ## The main Earley loop. + # Run the Prediction/Completion cycle for any Items in the current Earley set. + # Completions will be added to the SPPF tree, and predictions will be recursively + # processed down to terminals/empty nodes to be added to the scanner for the next + # step. + expects = {i.expect for i in to_scan} + i = 0 + for token in lexer.lex(expects): + self.predict_and_complete(i, to_scan, columns, transitives) + + to_scan = scan(i, token, to_scan) + i += 1 + + expects.clear() + expects |= {i.expect for i in to_scan} + + self.predict_and_complete(i, to_scan, columns, transitives) + + ## Column is now the final column in the parse. + assert i == len(columns)-1 + return to_scan + + def parse(self, lexer, start): + assert start, start + start_symbol = NonTerminal(start) + + columns = [self.Set()] + to_scan = self.Set() # The scan buffer. 'Q' in E.Scott's paper. + + ## Predict for the start_symbol. + # Add predicted items to the first Earley set (for the predictor) if they + # result in a non-terminal, or the scanner if they result in a terminal. + for rule in self.predictions[start_symbol]: + item = Item(rule, 0, 0) + if item.expect in self.TERMINALS: + to_scan.add(item) + else: + columns[0].add(item) + + to_scan = self._parse(lexer, columns, to_scan, start_symbol) + + # If the parse was successful, the start + # symbol should have been completed in the last step of the Earley cycle, and will be in + # this column. Find the item for the start_symbol, which is the root of the SPPF tree. + solutions = dedup_list(n.node for n in columns[-1] if n.is_complete and n.node is not None and n.s == start_symbol and n.start == 0) + if not solutions: + expected_terminals = [t.expect.name for t in to_scan] + raise UnexpectedEOF(expected_terminals, state=frozenset(i.s for i in to_scan)) + + if self.debug: + from .earley_forest import ForestToPyDotVisitor + try: + debug_walker = ForestToPyDotVisitor() + except ImportError: + logger.warning("Cannot find dependency 'pydot', will not generate sppf debug image") + else: + for i, s in enumerate(solutions): + debug_walker.visit(s, f"sppf{i}.png") + + + if self.Tree is not None: + # Perform our SPPF -> AST conversion + # Disable the ForestToParseTree cache when ambiguity='resolve' + # to prevent a tree construction bug. See issue #1283 + use_cache = not self.resolve_ambiguity + transformer = ForestToParseTree(self.Tree, self.callbacks, self.forest_sum_visitor and self.forest_sum_visitor(), self.resolve_ambiguity, use_cache) + solutions = [transformer.transform(s) for s in solutions] + + if len(solutions) > 1 and not self.resolve_ambiguity: + t: Tree = self.Tree('_ambig', solutions) + t.expand_kids_by_data('_ambig') # solutions may themselves be _ambig nodes + return t + return solutions[0] + + # return the root of the SPPF + # TODO return a list of solutions, or join them together somehow + return solutions[0] diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/earley_common.py b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/earley_common.py new file mode 100644 index 0000000000000000000000000000000000000000..0ea2d4fa9e0058bf19776d009f4a983baf849ad9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/earley_common.py @@ -0,0 +1,42 @@ +"""This module implements useful building blocks for the Earley parser +""" + + +class Item: + "An Earley Item, the atom of the algorithm." + + __slots__ = ('s', 'rule', 'ptr', 'start', 'is_complete', 'expect', 'previous', 'node', '_hash') + def __init__(self, rule, ptr, start): + self.is_complete = len(rule.expansion) == ptr + self.rule = rule # rule + self.ptr = ptr # ptr + self.start = start # j + self.node = None # w + if self.is_complete: + self.s = rule.origin + self.expect = None + self.previous = rule.expansion[ptr - 1] if ptr > 0 and len(rule.expansion) else None + else: + self.s = (rule, ptr) + self.expect = rule.expansion[ptr] + self.previous = rule.expansion[ptr - 1] if ptr > 0 and len(rule.expansion) else None + self._hash = hash((self.s, self.start, self.rule)) + + def advance(self): + return Item(self.rule, self.ptr + 1, self.start) + + def __eq__(self, other): + return self is other or (self.s == other.s and self.start == other.start and self.rule == other.rule) + + def __hash__(self): + return self._hash + + def __repr__(self): + before = ( expansion.name for expansion in self.rule.expansion[:self.ptr] ) + after = ( expansion.name for expansion in self.rule.expansion[self.ptr:] ) + symbol = "{} ::= {}* {}".format(self.rule.origin.name, ' '.join(before), ' '.join(after)) + return '%s (%d)' % (symbol, self.start) + + +# class TransitiveItem(Item): +# ... # removed at commit 4c1cfb2faf24e8f8bff7112627a00b94d261b420 diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/earley_forest.py b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/earley_forest.py new file mode 100644 index 0000000000000000000000000000000000000000..c60f3a6b51eb97cc725f9d2f9e815351af8e66dc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/earley_forest.py @@ -0,0 +1,802 @@ +""""This module implements an SPPF implementation + +This is used as the primary output mechanism for the Earley parser +in order to store complex ambiguities. + +Full reference and more details is here: +https://web.archive.org/web/20190616123959/http://www.bramvandersanden.com/post/2014/06/shared-packed-parse-forest/ +""" + +from typing import Type, AbstractSet +from random import randint +from collections import deque +from operator import attrgetter +from importlib import import_module +from functools import partial + +from ..parse_tree_builder import AmbiguousIntermediateExpander +from ..visitors import Discard +from ..utils import logger, OrderedSet +from ..tree import Tree + +class ForestNode: + pass + +class SymbolNode(ForestNode): + """ + A Symbol Node represents a symbol (or Intermediate LR0). + + Symbol nodes are keyed by the symbol (s). For intermediate nodes + s will be an LR0, stored as a tuple of (rule, ptr). For completed symbol + nodes, s will be a string representing the non-terminal origin (i.e. + the left hand side of the rule). + + The children of a Symbol or Intermediate Node will always be Packed Nodes; + with each Packed Node child representing a single derivation of a production. + + Hence a Symbol Node with a single child is unambiguous. + + Parameters: + s: A Symbol, or a tuple of (rule, ptr) for an intermediate node. + start: For dynamic lexers, the index of the start of the substring matched by this symbol (inclusive). + end: For dynamic lexers, the index of the end of the substring matched by this symbol (exclusive). + + Properties: + is_intermediate: True if this node is an intermediate node. + priority: The priority of the node's symbol. + """ + Set: Type[AbstractSet] = set # Overridden by StableSymbolNode + __slots__ = ('s', 'start', 'end', '_children', 'paths', 'paths_loaded', 'priority', 'is_intermediate') + def __init__(self, s, start, end): + self.s = s + self.start = start + self.end = end + self._children = self.Set() + self.paths = self.Set() + self.paths_loaded = False + + ### We use inf here as it can be safely negated without resorting to conditionals, + # unlike None or float('NaN'), and sorts appropriately. + self.priority = float('-inf') + self.is_intermediate = isinstance(s, tuple) + + def add_family(self, lr0, rule, start, left, right): + self._children.add(PackedNode(self, lr0, rule, start, left, right)) + + def add_path(self, transitive, node): + self.paths.add((transitive, node)) + + def load_paths(self): + for transitive, node in self.paths: + if transitive.next_titem is not None: + vn = type(self)(transitive.next_titem.s, transitive.next_titem.start, self.end) + vn.add_path(transitive.next_titem, node) + self.add_family(transitive.reduction.rule.origin, transitive.reduction.rule, transitive.reduction.start, transitive.reduction.node, vn) + else: + self.add_family(transitive.reduction.rule.origin, transitive.reduction.rule, transitive.reduction.start, transitive.reduction.node, node) + self.paths_loaded = True + + @property + def is_ambiguous(self): + """Returns True if this node is ambiguous.""" + return len(self.children) > 1 + + @property + def children(self): + """Returns a list of this node's children sorted from greatest to + least priority.""" + if not self.paths_loaded: + self.load_paths() + return sorted(self._children, key=attrgetter('sort_key')) + + def __iter__(self): + return iter(self._children) + + def __repr__(self): + if self.is_intermediate: + rule = self.s[0] + ptr = self.s[1] + before = ( expansion.name for expansion in rule.expansion[:ptr] ) + after = ( expansion.name for expansion in rule.expansion[ptr:] ) + symbol = "{} ::= {}* {}".format(rule.origin.name, ' '.join(before), ' '.join(after)) + else: + symbol = self.s.name + return "({}, {}, {}, {})".format(symbol, self.start, self.end, self.priority) + +class StableSymbolNode(SymbolNode): + "A version of SymbolNode that uses OrderedSet for output stability" + Set = OrderedSet + +class PackedNode(ForestNode): + """ + A Packed Node represents a single derivation in a symbol node. + + Parameters: + rule: The rule associated with this node. + parent: The parent of this node. + left: The left child of this node. ``None`` if one does not exist. + right: The right child of this node. ``None`` if one does not exist. + priority: The priority of this node. + """ + __slots__ = ('parent', 's', 'rule', 'start', 'left', 'right', 'priority', '_hash') + def __init__(self, parent, s, rule, start, left, right): + self.parent = parent + self.s = s + self.start = start + self.rule = rule + self.left = left + self.right = right + self.priority = float('-inf') + self._hash = hash((self.left, self.right)) + + @property + def is_empty(self): + return self.left is None and self.right is None + + @property + def sort_key(self): + """ + Used to sort PackedNode children of SymbolNodes. + A SymbolNode has multiple PackedNodes if it matched + ambiguously. Hence, we use the sort order to identify + the order in which ambiguous children should be considered. + """ + return self.is_empty, -self.priority, self.rule.order + + @property + def children(self): + """Returns a list of this node's children.""" + return [x for x in [self.left, self.right] if x is not None] + + def __iter__(self): + yield self.left + yield self.right + + def __eq__(self, other): + if not isinstance(other, PackedNode): + return False + return self is other or (self.left == other.left and self.right == other.right) + + def __hash__(self): + return self._hash + + def __repr__(self): + if isinstance(self.s, tuple): + rule = self.s[0] + ptr = self.s[1] + before = ( expansion.name for expansion in rule.expansion[:ptr] ) + after = ( expansion.name for expansion in rule.expansion[ptr:] ) + symbol = "{} ::= {}* {}".format(rule.origin.name, ' '.join(before), ' '.join(after)) + else: + symbol = self.s.name + return "({}, {}, {}, {})".format(symbol, self.start, self.priority, self.rule.order) + +class TokenNode(ForestNode): + """ + A Token Node represents a matched terminal and is always a leaf node. + + Parameters: + token: The Token associated with this node. + term: The TerminalDef matched by the token. + priority: The priority of this node. + """ + __slots__ = ('token', 'term', 'priority', '_hash') + def __init__(self, token, term, priority=None): + self.token = token + self.term = term + if priority is not None: + self.priority = priority + else: + self.priority = term.priority if term is not None else 0 + self._hash = hash(token) + + def __eq__(self, other): + if not isinstance(other, TokenNode): + return False + return self is other or (self.token == other.token) + + def __hash__(self): + return self._hash + + def __repr__(self): + return repr(self.token) + +class ForestVisitor: + """ + An abstract base class for building forest visitors. + + This class performs a controllable depth-first walk of an SPPF. + The visitor will not enter cycles and will backtrack if one is encountered. + Subclasses are notified of cycles through the ``on_cycle`` method. + + Behavior for visit events is defined by overriding the + ``visit*node*`` functions. + + The walk is controlled by the return values of the ``visit*node_in`` + methods. Returning a node(s) will schedule them to be visited. The visitor + will begin to backtrack if no nodes are returned. + + Parameters: + single_visit: If ``True``, non-Token nodes will only be visited once. + """ + + def __init__(self, single_visit=False): + self.single_visit = single_visit + + def visit_token_node(self, node): + """Called when a ``Token`` is visited. ``Token`` nodes are always leaves.""" + pass + + def visit_symbol_node_in(self, node): + """Called when a symbol node is visited. Nodes that are returned + will be scheduled to be visited. If ``visit_intermediate_node_in`` + is not implemented, this function will be called for intermediate + nodes as well.""" + pass + + def visit_symbol_node_out(self, node): + """Called after all nodes returned from a corresponding ``visit_symbol_node_in`` + call have been visited. If ``visit_intermediate_node_out`` + is not implemented, this function will be called for intermediate + nodes as well.""" + pass + + def visit_packed_node_in(self, node): + """Called when a packed node is visited. Nodes that are returned + will be scheduled to be visited. """ + pass + + def visit_packed_node_out(self, node): + """Called after all nodes returned from a corresponding ``visit_packed_node_in`` + call have been visited.""" + pass + + def on_cycle(self, node, path): + """Called when a cycle is encountered. + + Parameters: + node: The node that causes a cycle. + path: The list of nodes being visited: nodes that have been + entered but not exited. The first element is the root in a forest + visit, and the last element is the node visited most recently. + ``path`` should be treated as read-only. + """ + pass + + def get_cycle_in_path(self, node, path): + """A utility function for use in ``on_cycle`` to obtain a slice of + ``path`` that only contains the nodes that make up the cycle.""" + index = len(path) - 1 + while id(path[index]) != id(node): + index -= 1 + return path[index:] + + def visit(self, root): + # Visiting is a list of IDs of all symbol/intermediate nodes currently in + # the stack. It serves two purposes: to detect when we 'recurse' in and out + # of a symbol/intermediate so that we can process both up and down. Also, + # since the SPPF can have cycles it allows us to detect if we're trying + # to recurse into a node that's already on the stack (infinite recursion). + visiting = set() + + # set of all nodes that have been visited + visited = set() + + # a list of nodes that are currently being visited + # used for the `on_cycle` callback + path = [] + + # We do not use recursion here to walk the Forest due to the limited + # stack size in python. Therefore input_stack is essentially our stack. + input_stack = deque([root]) + + # It is much faster to cache these as locals since they are called + # many times in large parses. + vpno = getattr(self, 'visit_packed_node_out') + vpni = getattr(self, 'visit_packed_node_in') + vsno = getattr(self, 'visit_symbol_node_out') + vsni = getattr(self, 'visit_symbol_node_in') + vino = getattr(self, 'visit_intermediate_node_out', vsno) + vini = getattr(self, 'visit_intermediate_node_in', vsni) + vtn = getattr(self, 'visit_token_node') + oc = getattr(self, 'on_cycle') + + while input_stack: + current = next(reversed(input_stack)) + try: + next_node = next(current) + except StopIteration: + input_stack.pop() + continue + except TypeError: + ### If the current object is not an iterator, pass through to Token/SymbolNode + pass + else: + if next_node is None: + continue + + if id(next_node) in visiting: + oc(next_node, path) + continue + + input_stack.append(next_node) + continue + + if isinstance(current, TokenNode): + vtn(current.token) + input_stack.pop() + continue + + current_id = id(current) + if current_id in visiting: + if isinstance(current, PackedNode): + vpno(current) + elif current.is_intermediate: + vino(current) + else: + vsno(current) + input_stack.pop() + path.pop() + visiting.remove(current_id) + visited.add(current_id) + elif self.single_visit and current_id in visited: + input_stack.pop() + else: + visiting.add(current_id) + path.append(current) + if isinstance(current, PackedNode): + next_node = vpni(current) + elif current.is_intermediate: + next_node = vini(current) + else: + next_node = vsni(current) + if next_node is None: + continue + + if not isinstance(next_node, ForestNode): + next_node = iter(next_node) + elif id(next_node) in visiting: + oc(next_node, path) + continue + + input_stack.append(next_node) + +class ForestTransformer(ForestVisitor): + """The base class for a bottom-up forest transformation. Most users will + want to use ``TreeForestTransformer`` instead as it has a friendlier + interface and covers most use cases. + + Transformations are applied via inheritance and overriding of the + ``transform*node`` methods. + + ``transform_token_node`` receives a ``Token`` as an argument. + All other methods receive the node that is being transformed and + a list of the results of the transformations of that node's children. + The return value of these methods are the resulting transformations. + + If ``Discard`` is raised in a node's transformation, no data from that node + will be passed to its parent's transformation. + """ + + def __init__(self): + super(ForestTransformer, self).__init__() + # results of transformations + self.data = dict() + # used to track parent nodes + self.node_stack = deque() + + def transform(self, root): + """Perform a transformation on an SPPF.""" + self.node_stack.append('result') + self.data['result'] = [] + self.visit(root) + assert len(self.data['result']) <= 1 + if self.data['result']: + return self.data['result'][0] + + def transform_symbol_node(self, node, data): + """Transform a symbol node.""" + return node + + def transform_intermediate_node(self, node, data): + """Transform an intermediate node.""" + return node + + def transform_packed_node(self, node, data): + """Transform a packed node.""" + return node + + def transform_token_node(self, node): + """Transform a ``Token``.""" + return node + + def visit_symbol_node_in(self, node): + self.node_stack.append(id(node)) + self.data[id(node)] = [] + return node.children + + def visit_packed_node_in(self, node): + self.node_stack.append(id(node)) + self.data[id(node)] = [] + return node.children + + def visit_token_node(self, node): + transformed = self.transform_token_node(node) + if transformed is not Discard: + self.data[self.node_stack[-1]].append(transformed) + + def _visit_node_out_helper(self, node, method): + self.node_stack.pop() + transformed = method(node, self.data[id(node)]) + if transformed is not Discard: + self.data[self.node_stack[-1]].append(transformed) + del self.data[id(node)] + + def visit_symbol_node_out(self, node): + self._visit_node_out_helper(node, self.transform_symbol_node) + + def visit_intermediate_node_out(self, node): + self._visit_node_out_helper(node, self.transform_intermediate_node) + + def visit_packed_node_out(self, node): + self._visit_node_out_helper(node, self.transform_packed_node) + + +class ForestSumVisitor(ForestVisitor): + """ + A visitor for prioritizing ambiguous parts of the Forest. + + This visitor is used when support for explicit priorities on + rules is requested (whether normal, or invert). It walks the + forest (or subsets thereof) and cascades properties upwards + from the leaves. + + It would be ideal to do this during parsing, however this would + require processing each Earley item multiple times. That's + a big performance drawback; so running a forest walk is the + lesser of two evils: there can be significantly more Earley + items created during parsing than there are SPPF nodes in the + final tree. + """ + def __init__(self): + super(ForestSumVisitor, self).__init__(single_visit=True) + + def visit_packed_node_in(self, node): + yield node.left + yield node.right + + def visit_symbol_node_in(self, node): + return iter(node.children) + + def visit_packed_node_out(self, node): + priority = node.rule.options.priority if not node.parent.is_intermediate and node.rule.options.priority else 0 + priority += getattr(node.right, 'priority', 0) + priority += getattr(node.left, 'priority', 0) + node.priority = priority + + def visit_symbol_node_out(self, node): + node.priority = max(child.priority for child in node.children) + +class PackedData(): + """Used in transformationss of packed nodes to distinguish the data + that comes from the left child and the right child. + """ + + class _NoData(): + pass + + NO_DATA = _NoData() + + def __init__(self, node, data): + self.left = self.NO_DATA + self.right = self.NO_DATA + if data: + if node.left is not None: + self.left = data[0] + if len(data) > 1: + self.right = data[1] + else: + self.right = data[0] + +class ForestToParseTree(ForestTransformer): + """Used by the earley parser when ambiguity equals 'resolve' or + 'explicit'. Transforms an SPPF into an (ambiguous) parse tree. + + Parameters: + tree_class: The tree class to use for construction + callbacks: A dictionary of rules to functions that output a tree + prioritizer: A ``ForestVisitor`` that manipulates the priorities of ForestNodes + resolve_ambiguity: If True, ambiguities will be resolved based on + priorities. Otherwise, `_ambig` nodes will be in the resulting tree. + use_cache: If True, the results of packed node transformations will be cached. + """ + + def __init__(self, tree_class=Tree, callbacks=dict(), prioritizer=ForestSumVisitor(), resolve_ambiguity=True, use_cache=True): + super(ForestToParseTree, self).__init__() + self.tree_class = tree_class + self.callbacks = callbacks + self.prioritizer = prioritizer + self.resolve_ambiguity = resolve_ambiguity + self._use_cache = use_cache + self._cache = {} + self._on_cycle_retreat = False + self._cycle_node = None + self._successful_visits = set() + + def visit(self, root): + if self.prioritizer: + self.prioritizer.visit(root) + super(ForestToParseTree, self).visit(root) + self._cache = {} + + def on_cycle(self, node, path): + logger.debug("Cycle encountered in the SPPF at node: %s. " + "As infinite ambiguities cannot be represented in a tree, " + "this family of derivations will be discarded.", node) + self._cycle_node = node + self._on_cycle_retreat = True + + def _check_cycle(self, node): + if self._on_cycle_retreat: + if id(node) == id(self._cycle_node) or id(node) in self._successful_visits: + self._cycle_node = None + self._on_cycle_retreat = False + else: + return Discard + + def _collapse_ambig(self, children): + new_children = [] + for child in children: + if hasattr(child, 'data') and child.data == '_ambig': + new_children += child.children + else: + new_children.append(child) + return new_children + + def _call_rule_func(self, node, data): + # called when transforming children of symbol nodes + # data is a list of trees or tokens that correspond to the + # symbol's rule expansion + return self.callbacks[node.rule](data) + + def _call_ambig_func(self, node, data): + # called when transforming a symbol node + # data is a list of trees where each tree's data is + # equal to the name of the symbol or one of its aliases. + if len(data) > 1: + return self.tree_class('_ambig', data) + elif data: + return data[0] + return Discard + + def transform_symbol_node(self, node, data): + if id(node) not in self._successful_visits: + return Discard + r = self._check_cycle(node) + if r is Discard: + return r + self._successful_visits.remove(id(node)) + data = self._collapse_ambig(data) + return self._call_ambig_func(node, data) + + def transform_intermediate_node(self, node, data): + if id(node) not in self._successful_visits: + return Discard + r = self._check_cycle(node) + if r is Discard: + return r + self._successful_visits.remove(id(node)) + if len(data) > 1: + children = [self.tree_class('_inter', c) for c in data] + return self.tree_class('_iambig', children) + return data[0] + + def transform_packed_node(self, node, data): + r = self._check_cycle(node) + if r is Discard: + return r + if self.resolve_ambiguity and id(node.parent) in self._successful_visits: + return Discard + if self._use_cache and id(node) in self._cache: + return self._cache[id(node)] + children = [] + assert len(data) <= 2 + data = PackedData(node, data) + if data.left is not PackedData.NO_DATA: + if node.left.is_intermediate and isinstance(data.left, list): + children += data.left + else: + children.append(data.left) + if data.right is not PackedData.NO_DATA: + children.append(data.right) + transformed = children if node.parent.is_intermediate else self._call_rule_func(node, children) + if self._use_cache: + self._cache[id(node)] = transformed + return transformed + + def visit_symbol_node_in(self, node): + super(ForestToParseTree, self).visit_symbol_node_in(node) + if self._on_cycle_retreat: + return + return node.children + + def visit_packed_node_in(self, node): + self._on_cycle_retreat = False + to_visit = super(ForestToParseTree, self).visit_packed_node_in(node) + if not self.resolve_ambiguity or id(node.parent) not in self._successful_visits: + if not self._use_cache or id(node) not in self._cache: + return to_visit + + def visit_packed_node_out(self, node): + super(ForestToParseTree, self).visit_packed_node_out(node) + if not self._on_cycle_retreat: + self._successful_visits.add(id(node.parent)) + +def handles_ambiguity(func): + """Decorator for methods of subclasses of ``TreeForestTransformer``. + Denotes that the method should receive a list of transformed derivations.""" + func.handles_ambiguity = True + return func + +class TreeForestTransformer(ForestToParseTree): + """A ``ForestTransformer`` with a tree ``Transformer``-like interface. + By default, it will construct a tree. + + Methods provided via inheritance are called based on the rule/symbol + names of nodes in the forest. + + Methods that act on rules will receive a list of the results of the + transformations of the rule's children. By default, trees and tokens. + + Methods that act on tokens will receive a token. + + Alternatively, methods that act on rules may be annotated with + ``handles_ambiguity``. In this case, the function will receive a list + of all the transformations of all the derivations of the rule. + By default, a list of trees where each tree.data is equal to the + rule name or one of its aliases. + + Non-tree transformations are made possible by override of + ``__default__``, ``__default_token__``, and ``__default_ambig__``. + + Note: + Tree shaping features such as inlined rules and token filtering are + not built into the transformation. Positions are also not propagated. + + Parameters: + tree_class: The tree class to use for construction + prioritizer: A ``ForestVisitor`` that manipulates the priorities of nodes in the SPPF. + resolve_ambiguity: If True, ambiguities will be resolved based on priorities. + use_cache (bool): If True, caches the results of some transformations, + potentially improving performance when ``resolve_ambiguity==False``. + Only use if you know what you are doing: i.e. All transformation + functions are pure and referentially transparent. + """ + + def __init__(self, tree_class=Tree, prioritizer=ForestSumVisitor(), resolve_ambiguity=True, use_cache=False): + super(TreeForestTransformer, self).__init__(tree_class, dict(), prioritizer, resolve_ambiguity, use_cache) + + def __default__(self, name, data): + """Default operation on tree (for override). + + Returns a tree with name with data as children. + """ + return self.tree_class(name, data) + + def __default_ambig__(self, name, data): + """Default operation on ambiguous rule (for override). + + Wraps data in an '_ambig_' node if it contains more than + one element. + """ + if len(data) > 1: + return self.tree_class('_ambig', data) + elif data: + return data[0] + return Discard + + def __default_token__(self, node): + """Default operation on ``Token`` (for override). + + Returns ``node``. + """ + return node + + def transform_token_node(self, node): + return getattr(self, node.type, self.__default_token__)(node) + + def _call_rule_func(self, node, data): + name = node.rule.alias or node.rule.options.template_source or node.rule.origin.name + user_func = getattr(self, name, self.__default__) + if user_func == self.__default__ or hasattr(user_func, 'handles_ambiguity'): + user_func = partial(self.__default__, name) + if not self.resolve_ambiguity: + wrapper = partial(AmbiguousIntermediateExpander, self.tree_class) + user_func = wrapper(user_func) + return user_func(data) + + def _call_ambig_func(self, node, data): + name = node.s.name + user_func = getattr(self, name, self.__default_ambig__) + if user_func == self.__default_ambig__ or not hasattr(user_func, 'handles_ambiguity'): + user_func = partial(self.__default_ambig__, name) + return user_func(data) + +class ForestToPyDotVisitor(ForestVisitor): + """ + A Forest visitor which writes the SPPF to a PNG. + + The SPPF can get really large, really quickly because + of the amount of meta-data it stores, so this is probably + only useful for trivial trees and learning how the SPPF + is structured. + """ + def __init__(self, rankdir="TB"): + super(ForestToPyDotVisitor, self).__init__(single_visit=True) + self.pydot = import_module('pydot') + self.graph = self.pydot.Dot(graph_type='digraph', rankdir=rankdir) + + def visit(self, root, filename): + super(ForestToPyDotVisitor, self).visit(root) + try: + self.graph.write_png(filename) + except FileNotFoundError as e: + logger.error("Could not write png: ", e) + + def visit_token_node(self, node): + graph_node_id = str(id(node)) + graph_node_label = "\"{}\"".format(node.value.replace('"', '\\"')) + graph_node_color = 0x808080 + graph_node_style = "\"filled,rounded\"" + graph_node_shape = "diamond" + graph_node = self.pydot.Node(graph_node_id, style=graph_node_style, fillcolor="#{:06x}".format(graph_node_color), shape=graph_node_shape, label=graph_node_label) + self.graph.add_node(graph_node) + + def visit_packed_node_in(self, node): + graph_node_id = str(id(node)) + graph_node_label = repr(node) + graph_node_color = 0x808080 + graph_node_style = "filled" + graph_node_shape = "diamond" + graph_node = self.pydot.Node(graph_node_id, style=graph_node_style, fillcolor="#{:06x}".format(graph_node_color), shape=graph_node_shape, label=graph_node_label) + self.graph.add_node(graph_node) + yield node.left + yield node.right + + def visit_packed_node_out(self, node): + graph_node_id = str(id(node)) + graph_node = self.graph.get_node(graph_node_id)[0] + for child in [node.left, node.right]: + if child is not None: + child_graph_node_id = str(id(child.token if isinstance(child, TokenNode) else child)) + child_graph_node = self.graph.get_node(child_graph_node_id)[0] + self.graph.add_edge(self.pydot.Edge(graph_node, child_graph_node)) + else: + #### Try and be above the Python object ID range; probably impl. specific, but maybe this is okay. + child_graph_node_id = str(randint(100000000000000000000000000000,123456789012345678901234567890)) + child_graph_node_style = "invis" + child_graph_node = self.pydot.Node(child_graph_node_id, style=child_graph_node_style, label="None") + child_edge_style = "invis" + self.graph.add_node(child_graph_node) + self.graph.add_edge(self.pydot.Edge(graph_node, child_graph_node, style=child_edge_style)) + + def visit_symbol_node_in(self, node): + graph_node_id = str(id(node)) + graph_node_label = repr(node) + graph_node_color = 0x808080 + graph_node_style = "\"filled\"" + if node.is_intermediate: + graph_node_shape = "ellipse" + else: + graph_node_shape = "rectangle" + graph_node = self.pydot.Node(graph_node_id, style=graph_node_style, fillcolor="#{:06x}".format(graph_node_color), shape=graph_node_shape, label=graph_node_label) + self.graph.add_node(graph_node) + return iter(node.children) + + def visit_symbol_node_out(self, node): + graph_node_id = str(id(node)) + graph_node = self.graph.get_node(graph_node_id)[0] + for child in node.children: + child_graph_node_id = str(id(child)) + child_graph_node = self.graph.get_node(child_graph_node_id)[0] + self.graph.add_edge(self.pydot.Edge(graph_node, child_graph_node)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/grammar_analysis.py b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/grammar_analysis.py new file mode 100644 index 0000000000000000000000000000000000000000..28d3cb637fa5cfe2a2be3c4fc1191ee635a199b9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/grammar_analysis.py @@ -0,0 +1,203 @@ +"Provides for superficial grammar analysis." + +from collections import Counter, defaultdict +from typing import List, Dict, Iterator, FrozenSet, Set + +from ..utils import bfs, fzset, classify, OrderedSet +from ..exceptions import GrammarError +from ..grammar import Rule, Terminal, NonTerminal, Symbol +from ..common import ParserConf + + +class RulePtr: + __slots__ = ('rule', 'index') + rule: Rule + index: int + + def __init__(self, rule: Rule, index: int): + assert isinstance(rule, Rule) + assert index <= len(rule.expansion) + self.rule = rule + self.index = index + + def __repr__(self): + before = [x.name for x in self.rule.expansion[:self.index]] + after = [x.name for x in self.rule.expansion[self.index:]] + return '<%s : %s * %s>' % (self.rule.origin.name, ' '.join(before), ' '.join(after)) + + @property + def next(self) -> Symbol: + return self.rule.expansion[self.index] + + def advance(self, sym: Symbol) -> 'RulePtr': + assert self.next == sym + return RulePtr(self.rule, self.index+1) + + @property + def is_satisfied(self) -> bool: + return self.index == len(self.rule.expansion) + + def __eq__(self, other) -> bool: + if not isinstance(other, RulePtr): + return NotImplemented + return self.rule == other.rule and self.index == other.index + + def __hash__(self) -> int: + return hash((self.rule, self.index)) + + +State = FrozenSet[RulePtr] + +# state generation ensures no duplicate LR0ItemSets +class LR0ItemSet: + __slots__ = ('kernel', 'closure', 'transitions', 'lookaheads') + + kernel: State + closure: State + transitions: Dict[Symbol, 'LR0ItemSet'] + lookaheads: Dict[Symbol, Set[Rule]] + + def __init__(self, kernel, closure): + self.kernel = fzset(kernel) + self.closure = fzset(closure) + self.transitions = {} + self.lookaheads = defaultdict(set) + + def __repr__(self): + return '{%s | %s}' % (', '.join([repr(r) for r in self.kernel]), ', '.join([repr(r) for r in self.closure])) + + +def update_set(set1, set2): + if not set2 or set1 > set2: + return False + + copy = set(set1) + set1 |= set2 + return set1 != copy + +def calculate_sets(rules): + """Calculate FOLLOW sets. + + Adapted from: http://lara.epfl.ch/w/cc09:algorithm_for_first_and_follow_sets""" + symbols = {sym for rule in rules for sym in rule.expansion} | {rule.origin for rule in rules} + + # foreach grammar rule X ::= Y(1) ... Y(k) + # if k=0 or {Y(1),...,Y(k)} subset of NULLABLE then + # NULLABLE = NULLABLE union {X} + # for i = 1 to k + # if i=1 or {Y(1),...,Y(i-1)} subset of NULLABLE then + # FIRST(X) = FIRST(X) union FIRST(Y(i)) + # for j = i+1 to k + # if i=k or {Y(i+1),...Y(k)} subset of NULLABLE then + # FOLLOW(Y(i)) = FOLLOW(Y(i)) union FOLLOW(X) + # if i+1=j or {Y(i+1),...,Y(j-1)} subset of NULLABLE then + # FOLLOW(Y(i)) = FOLLOW(Y(i)) union FIRST(Y(j)) + # until none of NULLABLE,FIRST,FOLLOW changed in last iteration + + NULLABLE = set() + FIRST = {} + FOLLOW = {} + for sym in symbols: + FIRST[sym]={sym} if sym.is_term else set() + FOLLOW[sym]=set() + + # Calculate NULLABLE and FIRST + changed = True + while changed: + changed = False + + for rule in rules: + if set(rule.expansion) <= NULLABLE: + if update_set(NULLABLE, {rule.origin}): + changed = True + + for i, sym in enumerate(rule.expansion): + if set(rule.expansion[:i]) <= NULLABLE: + if update_set(FIRST[rule.origin], FIRST[sym]): + changed = True + else: + break + + # Calculate FOLLOW + changed = True + while changed: + changed = False + + for rule in rules: + for i, sym in enumerate(rule.expansion): + if i==len(rule.expansion)-1 or set(rule.expansion[i+1:]) <= NULLABLE: + if update_set(FOLLOW[sym], FOLLOW[rule.origin]): + changed = True + + for j in range(i+1, len(rule.expansion)): + if set(rule.expansion[i+1:j]) <= NULLABLE: + if update_set(FOLLOW[sym], FIRST[rule.expansion[j]]): + changed = True + + return FIRST, FOLLOW, NULLABLE + + +class GrammarAnalyzer: + def __init__(self, parser_conf: ParserConf, debug: bool=False, strict: bool=False): + self.debug = debug + self.strict = strict + + root_rules = {start: Rule(NonTerminal('$root_' + start), [NonTerminal(start), Terminal('$END')]) + for start in parser_conf.start} + + rules = parser_conf.rules + list(root_rules.values()) + self.rules_by_origin: Dict[NonTerminal, List[Rule]] = classify(rules, lambda r: r.origin) + + if len(rules) != len(set(rules)): + duplicates = [item for item, count in Counter(rules).items() if count > 1] + raise GrammarError("Rules defined twice: %s" % ', '.join(str(i) for i in duplicates)) + + for r in rules: + for sym in r.expansion: + if not (sym.is_term or sym in self.rules_by_origin): + raise GrammarError("Using an undefined rule: %s" % sym) + + self.start_states = {start: self.expand_rule(root_rule.origin) + for start, root_rule in root_rules.items()} + + self.end_states = {start: fzset({RulePtr(root_rule, len(root_rule.expansion))}) + for start, root_rule in root_rules.items()} + + lr0_root_rules = {start: Rule(NonTerminal('$root_' + start), [NonTerminal(start)]) + for start in parser_conf.start} + + lr0_rules = parser_conf.rules + list(lr0_root_rules.values()) + assert(len(lr0_rules) == len(set(lr0_rules))) + + self.lr0_rules_by_origin = classify(lr0_rules, lambda r: r.origin) + + # cache RulePtr(r, 0) in r (no duplicate RulePtr objects) + self.lr0_start_states = {start: LR0ItemSet([RulePtr(root_rule, 0)], self.expand_rule(root_rule.origin, self.lr0_rules_by_origin)) + for start, root_rule in lr0_root_rules.items()} + + self.FIRST, self.FOLLOW, self.NULLABLE = calculate_sets(rules) + + def expand_rule(self, source_rule: NonTerminal, rules_by_origin=None) -> OrderedSet[RulePtr]: + "Returns all init_ptrs accessible by rule (recursive)" + + if rules_by_origin is None: + rules_by_origin = self.rules_by_origin + + init_ptrs = OrderedSet[RulePtr]() + def _expand_rule(rule: NonTerminal) -> Iterator[NonTerminal]: + assert not rule.is_term, rule + + for r in rules_by_origin[rule]: + init_ptr = RulePtr(r, 0) + init_ptrs.add(init_ptr) + + if r.expansion: # if not empty rule + new_r = init_ptr.next + if not new_r.is_term: + assert isinstance(new_r, NonTerminal) + yield new_r + + for _ in bfs([source_rule], _expand_rule): + pass + + return init_ptrs diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_analysis.py b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_analysis.py new file mode 100644 index 0000000000000000000000000000000000000000..b7b3fdfc7a327533e333c2bafa842cb9b348adae --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_analysis.py @@ -0,0 +1,332 @@ +"""This module builds a LALR(1) transition-table for lalr_parser.py + +For now, shift/reduce conflicts are automatically resolved as shifts. +""" + +# Author: Erez Shinan (2017) +# Email : erezshin@gmail.com + +from typing import Dict, Set, Iterator, Tuple, List, TypeVar, Generic +from collections import defaultdict + +from ..utils import classify, classify_bool, bfs, fzset, Enumerator, logger +from ..exceptions import GrammarError + +from .grammar_analysis import GrammarAnalyzer, Terminal, LR0ItemSet, RulePtr, State +from ..grammar import Rule, Symbol +from ..common import ParserConf + +###{standalone + +class Action: + def __init__(self, name): + self.name = name + def __str__(self): + return self.name + def __repr__(self): + return str(self) + +Shift = Action('Shift') +Reduce = Action('Reduce') + +StateT = TypeVar("StateT") + +class ParseTableBase(Generic[StateT]): + states: Dict[StateT, Dict[str, Tuple]] + start_states: Dict[str, StateT] + end_states: Dict[str, StateT] + + def __init__(self, states, start_states, end_states): + self.states = states + self.start_states = start_states + self.end_states = end_states + + def serialize(self, memo): + tokens = Enumerator() + + states = { + state: {tokens.get(token): ((1, arg.serialize(memo)) if action is Reduce else (0, arg)) + for token, (action, arg) in actions.items()} + for state, actions in self.states.items() + } + + return { + 'tokens': tokens.reversed(), + 'states': states, + 'start_states': self.start_states, + 'end_states': self.end_states, + } + + @classmethod + def deserialize(cls, data, memo): + tokens = data['tokens'] + states = { + state: {tokens[token]: ((Reduce, Rule.deserialize(arg, memo)) if action==1 else (Shift, arg)) + for token, (action, arg) in actions.items()} + for state, actions in data['states'].items() + } + return cls(states, data['start_states'], data['end_states']) + +class ParseTable(ParseTableBase['State']): + """Parse-table whose key is State, i.e. set[RulePtr] + + Slower than IntParseTable, but useful for debugging + """ + pass + + +class IntParseTable(ParseTableBase[int]): + """Parse-table whose key is int. Best for performance.""" + + @classmethod + def from_ParseTable(cls, parse_table: ParseTable): + enum = list(parse_table.states) + state_to_idx: Dict['State', int] = {s:i for i,s in enumerate(enum)} + int_states = {} + + for s, la in parse_table.states.items(): + la = {k:(v[0], state_to_idx[v[1]]) if v[0] is Shift else v + for k,v in la.items()} + int_states[ state_to_idx[s] ] = la + + + start_states = {start:state_to_idx[s] for start, s in parse_table.start_states.items()} + end_states = {start:state_to_idx[s] for start, s in parse_table.end_states.items()} + return cls(int_states, start_states, end_states) + +###} + + +# digraph and traverse, see The Theory and Practice of Compiler Writing + +# computes F(x) = G(x) union (union { G(y) | x R y }) +# X: nodes +# R: relation (function mapping node -> list of nodes that satisfy the relation) +# G: set valued function +def digraph(X, R, G): + F = {} + S = [] + N = dict.fromkeys(X, 0) + for x in X: + # this is always true for the first iteration, but N[x] may be updated in traverse below + if N[x] == 0: + traverse(x, S, N, X, R, G, F) + return F + +# x: single node +# S: stack +# N: weights +# X: nodes +# R: relation (see above) +# G: set valued function +# F: set valued function we are computing (map of input -> output) +def traverse(x, S, N, X, R, G, F): + S.append(x) + d = len(S) + N[x] = d + F[x] = G[x] + for y in R[x]: + if N[y] == 0: + traverse(y, S, N, X, R, G, F) + n_x = N[x] + assert(n_x > 0) + n_y = N[y] + assert(n_y != 0) + if (n_y > 0) and (n_y < n_x): + N[x] = n_y + F[x].update(F[y]) + if N[x] == d: + f_x = F[x] + while True: + z = S.pop() + N[z] = -1 + F[z] = f_x + if z == x: + break + + +class LALR_Analyzer(GrammarAnalyzer): + lr0_itemsets: Set[LR0ItemSet] + nonterminal_transitions: List[Tuple[LR0ItemSet, Symbol]] + lookback: Dict[Tuple[LR0ItemSet, Symbol], Set[Tuple[LR0ItemSet, Rule]]] + includes: Dict[Tuple[LR0ItemSet, Symbol], Set[Tuple[LR0ItemSet, Symbol]]] + reads: Dict[Tuple[LR0ItemSet, Symbol], Set[Tuple[LR0ItemSet, Symbol]]] + directly_reads: Dict[Tuple[LR0ItemSet, Symbol], Set[Symbol]] + + + def __init__(self, parser_conf: ParserConf, debug: bool=False, strict: bool=False): + GrammarAnalyzer.__init__(self, parser_conf, debug, strict) + self.nonterminal_transitions = [] + self.directly_reads = defaultdict(set) + self.reads = defaultdict(set) + self.includes = defaultdict(set) + self.lookback = defaultdict(set) + + + def compute_lr0_states(self) -> None: + self.lr0_itemsets = set() + # map of kernels to LR0ItemSets + cache: Dict['State', LR0ItemSet] = {} + + def step(state: LR0ItemSet) -> Iterator[LR0ItemSet]: + _, unsat = classify_bool(state.closure, lambda rp: rp.is_satisfied) + + d = classify(unsat, lambda rp: rp.next) + for sym, rps in d.items(): + kernel = fzset({rp.advance(sym) for rp in rps}) + new_state = cache.get(kernel, None) + if new_state is None: + closure = set(kernel) + for rp in kernel: + if not rp.is_satisfied and not rp.next.is_term: + closure |= self.expand_rule(rp.next, self.lr0_rules_by_origin) + new_state = LR0ItemSet(kernel, closure) + cache[kernel] = new_state + + state.transitions[sym] = new_state + yield new_state + + self.lr0_itemsets.add(state) + + for _ in bfs(self.lr0_start_states.values(), step): + pass + + def compute_reads_relations(self): + # handle start state + for root in self.lr0_start_states.values(): + assert(len(root.kernel) == 1) + for rp in root.kernel: + assert(rp.index == 0) + self.directly_reads[(root, rp.next)] = set([ Terminal('$END') ]) + + for state in self.lr0_itemsets: + seen = set() + for rp in state.closure: + if rp.is_satisfied: + continue + s = rp.next + # if s is a not a nonterminal + if s not in self.lr0_rules_by_origin: + continue + if s in seen: + continue + seen.add(s) + nt = (state, s) + self.nonterminal_transitions.append(nt) + dr = self.directly_reads[nt] + r = self.reads[nt] + next_state = state.transitions[s] + for rp2 in next_state.closure: + if rp2.is_satisfied: + continue + s2 = rp2.next + # if s2 is a terminal + if s2 not in self.lr0_rules_by_origin: + dr.add(s2) + if s2 in self.NULLABLE: + r.add((next_state, s2)) + + def compute_includes_lookback(self): + for nt in self.nonterminal_transitions: + state, nonterminal = nt + includes = [] + lookback = self.lookback[nt] + for rp in state.closure: + if rp.rule.origin != nonterminal: + continue + # traverse the states for rp(.rule) + state2 = state + for i in range(rp.index, len(rp.rule.expansion)): + s = rp.rule.expansion[i] + nt2 = (state2, s) + state2 = state2.transitions[s] + if nt2 not in self.reads: + continue + for j in range(i + 1, len(rp.rule.expansion)): + if rp.rule.expansion[j] not in self.NULLABLE: + break + else: + includes.append(nt2) + # state2 is at the final state for rp.rule + if rp.index == 0: + for rp2 in state2.closure: + if (rp2.rule == rp.rule) and rp2.is_satisfied: + lookback.add((state2, rp2.rule)) + for nt2 in includes: + self.includes[nt2].add(nt) + + def compute_lookaheads(self): + read_sets = digraph(self.nonterminal_transitions, self.reads, self.directly_reads) + follow_sets = digraph(self.nonterminal_transitions, self.includes, read_sets) + + for nt, lookbacks in self.lookback.items(): + for state, rule in lookbacks: + for s in follow_sets[nt]: + state.lookaheads[s].add(rule) + + def compute_lalr1_states(self) -> None: + m: Dict[LR0ItemSet, Dict[str, Tuple]] = {} + reduce_reduce = [] + for itemset in self.lr0_itemsets: + actions: Dict[Symbol, Tuple] = {la: (Shift, next_state.closure) + for la, next_state in itemset.transitions.items()} + for la, rules in itemset.lookaheads.items(): + if len(rules) > 1: + # Try to resolve conflict based on priority + p = [(r.options.priority or 0, r) for r in rules] + p.sort(key=lambda r: r[0], reverse=True) + best, second_best = p[:2] + if best[0] > second_best[0]: + rules = {best[1]} + else: + reduce_reduce.append((itemset, la, rules)) + continue + + rule ,= rules + if la in actions: + if self.strict: + raise GrammarError(f"Shift/Reduce conflict for terminal {la.name}. [strict-mode]\n ") + elif self.debug: + logger.warning('Shift/Reduce conflict for terminal %s: (resolving as shift)', la.name) + logger.warning(' * %s', rule) + else: + logger.debug('Shift/Reduce conflict for terminal %s: (resolving as shift)', la.name) + logger.debug(' * %s', rule) + else: + actions[la] = (Reduce, rule) + m[itemset] = { k.name: v for k, v in actions.items() } + + if reduce_reduce: + msgs = [] + for itemset, la, rules in reduce_reduce: + msg = 'Reduce/Reduce collision in %s between the following rules: %s' % (la, ''.join([ '\n\t- ' + str(r) for r in rules ])) + if self.debug: + msg += '\n collision occurred in state: {%s\n }' % ''.join(['\n\t' + str(x) for x in itemset.closure]) + msgs.append(msg) + raise GrammarError('\n\n'.join(msgs)) + + states = { k.closure: v for k, v in m.items() } + + # compute end states + end_states: Dict[str, 'State'] = {} + for state in states: + for rp in state: + for start in self.lr0_start_states: + if rp.rule.origin.name == ('$root_' + start) and rp.is_satisfied: + assert start not in end_states + end_states[start] = state + + start_states = { start: state.closure for start, state in self.lr0_start_states.items() } + _parse_table = ParseTable(states, start_states, end_states) + + if self.debug: + self.parse_table = _parse_table + else: + self.parse_table = IntParseTable.from_ParseTable(_parse_table) + + def compute_lalr(self): + self.compute_lr0_states() + self.compute_reads_relations() + self.compute_includes_lookback() + self.compute_lookaheads() + self.compute_lalr1_states() diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_interactive_parser.py b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_interactive_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..fbf0d1f12e553958dc59d22796c5fa6e367b7ad5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_interactive_parser.py @@ -0,0 +1,158 @@ +# This module provides a LALR interactive parser, which is used for debugging and error handling + +from typing import Iterator, List +from copy import copy +import warnings + +from lark.exceptions import UnexpectedToken +from lark.lexer import Token, LexerThread +from .lalr_parser_state import ParserState + +###{standalone + +class InteractiveParser: + """InteractiveParser gives you advanced control over parsing and error handling when parsing with LALR. + + For a simpler interface, see the ``on_error`` argument to ``Lark.parse()``. + """ + def __init__(self, parser, parser_state: ParserState, lexer_thread: LexerThread): + self.parser = parser + self.parser_state = parser_state + self.lexer_thread = lexer_thread + self.result = None + + @property + def lexer_state(self) -> LexerThread: + warnings.warn("lexer_state will be removed in subsequent releases. Use lexer_thread instead.", DeprecationWarning) + return self.lexer_thread + + def feed_token(self, token: Token): + """Feed the parser with a token, and advance it to the next state, as if it received it from the lexer. + + Note that ``token`` has to be an instance of ``Token``. + """ + return self.parser_state.feed_token(token, token.type == '$END') + + def iter_parse(self) -> Iterator[Token]: + """Step through the different stages of the parse, by reading tokens from the lexer + and feeding them to the parser, one per iteration. + + Returns an iterator of the tokens it encounters. + + When the parse is over, the resulting tree can be found in ``InteractiveParser.result``. + """ + for token in self.lexer_thread.lex(self.parser_state): + yield token + self.result = self.feed_token(token) + + def exhaust_lexer(self) -> List[Token]: + """Try to feed the rest of the lexer state into the interactive parser. + + Note that this modifies the instance in place and does not feed an '$END' Token + """ + return list(self.iter_parse()) + + + def feed_eof(self, last_token=None): + """Feed a '$END' Token. Borrows from 'last_token' if given.""" + eof = Token.new_borrow_pos('$END', '', last_token) if last_token is not None else self.lexer_thread._Token('$END', '', 0, 1, 1) + return self.feed_token(eof) + + + def __copy__(self): + """Create a new interactive parser with a separate state. + + Calls to feed_token() won't affect the old instance, and vice-versa. + """ + return self.copy() + + def copy(self, deepcopy_values=True): + return type(self)( + self.parser, + self.parser_state.copy(deepcopy_values=deepcopy_values), + copy(self.lexer_thread), + ) + + def __eq__(self, other): + if not isinstance(other, InteractiveParser): + return False + + return self.parser_state == other.parser_state and self.lexer_thread == other.lexer_thread + + def as_immutable(self): + """Convert to an ``ImmutableInteractiveParser``.""" + p = copy(self) + return ImmutableInteractiveParser(p.parser, p.parser_state, p.lexer_thread) + + def pretty(self): + """Print the output of ``choices()`` in a way that's easier to read.""" + out = ["Parser choices:"] + for k, v in self.choices().items(): + out.append('\t- %s -> %r' % (k, v)) + out.append('stack size: %s' % len(self.parser_state.state_stack)) + return '\n'.join(out) + + def choices(self): + """Returns a dictionary of token types, matched to their action in the parser. + + Only returns token types that are accepted by the current state. + + Updated by ``feed_token()``. + """ + return self.parser_state.parse_conf.parse_table.states[self.parser_state.position] + + def accepts(self): + """Returns the set of possible tokens that will advance the parser into a new valid state.""" + accepts = set() + conf_no_callbacks = copy(self.parser_state.parse_conf) + # We don't want to call callbacks here since those might have arbitrary side effects + # and are unnecessarily slow. + conf_no_callbacks.callbacks = {} + for t in self.choices(): + if t.isupper(): # is terminal? + new_cursor = self.copy(deepcopy_values=False) + new_cursor.parser_state.parse_conf = conf_no_callbacks + try: + new_cursor.feed_token(self.lexer_thread._Token(t, '')) + except UnexpectedToken: + pass + else: + accepts.add(t) + return accepts + + def resume_parse(self): + """Resume automated parsing from the current state. + """ + return self.parser.parse_from_state(self.parser_state, last_token=self.lexer_thread.state.last_token) + + + +class ImmutableInteractiveParser(InteractiveParser): + """Same as ``InteractiveParser``, but operations create a new instance instead + of changing it in-place. + """ + + result = None + + def __hash__(self): + return hash((self.parser_state, self.lexer_thread)) + + def feed_token(self, token): + c = copy(self) + c.result = InteractiveParser.feed_token(c, token) + return c + + def exhaust_lexer(self): + """Try to feed the rest of the lexer state into the parser. + + Note that this returns a new ImmutableInteractiveParser and does not feed an '$END' Token""" + cursor = self.as_mutable() + cursor.exhaust_lexer() + return cursor.as_immutable() + + def as_mutable(self): + """Convert to an ``InteractiveParser``.""" + p = copy(self) + return InteractiveParser(p.parser, p.parser_state, p.lexer_thread) + +###} diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_parser.py b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..6ae2a04fde801fc7953b159c8a6529fa69b3ecbd --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_parser.py @@ -0,0 +1,122 @@ +"""This module implements a LALR(1) Parser +""" +# Author: Erez Shinan (2017) +# Email : erezshin@gmail.com +from typing import Dict, Any, Optional +from ..lexer import Token, LexerThread +from ..utils import Serialize +from ..common import ParserConf, ParserCallbacks + +from .lalr_analysis import LALR_Analyzer, IntParseTable, ParseTableBase +from .lalr_interactive_parser import InteractiveParser +from lark.exceptions import UnexpectedCharacters, UnexpectedInput, UnexpectedToken +from .lalr_parser_state import ParserState, ParseConf + +###{standalone + +class LALR_Parser(Serialize): + def __init__(self, parser_conf: ParserConf, debug: bool=False, strict: bool=False): + analysis = LALR_Analyzer(parser_conf, debug=debug, strict=strict) + analysis.compute_lalr() + callbacks = parser_conf.callbacks + + self._parse_table = analysis.parse_table + self.parser_conf = parser_conf + self.parser = _Parser(analysis.parse_table, callbacks, debug) + + @classmethod + def deserialize(cls, data, memo, callbacks, debug=False): + inst = cls.__new__(cls) + inst._parse_table = IntParseTable.deserialize(data, memo) + inst.parser = _Parser(inst._parse_table, callbacks, debug) + return inst + + def serialize(self, memo: Any = None) -> Dict[str, Any]: + return self._parse_table.serialize(memo) + + def parse_interactive(self, lexer: LexerThread, start: str): + return self.parser.parse(lexer, start, start_interactive=True) + + def parse(self, lexer, start, on_error=None): + try: + return self.parser.parse(lexer, start) + except UnexpectedInput as e: + if on_error is None: + raise + + while True: + if isinstance(e, UnexpectedCharacters): + s = e.interactive_parser.lexer_thread.state + p = s.line_ctr.char_pos + + if not on_error(e): + raise e + + if isinstance(e, UnexpectedCharacters): + # If user didn't change the character position, then we should + if p == s.line_ctr.char_pos: + s.line_ctr.feed(s.text[p:p+1]) + + try: + return e.interactive_parser.resume_parse() + except UnexpectedToken as e2: + if (isinstance(e, UnexpectedToken) + and e.token.type == e2.token.type == '$END' + and e.interactive_parser == e2.interactive_parser): + # Prevent infinite loop + raise e2 + e = e2 + except UnexpectedCharacters as e2: + e = e2 + + +class _Parser: + parse_table: ParseTableBase + callbacks: ParserCallbacks + debug: bool + + def __init__(self, parse_table: ParseTableBase, callbacks: ParserCallbacks, debug: bool=False): + self.parse_table = parse_table + self.callbacks = callbacks + self.debug = debug + + def parse(self, lexer: LexerThread, start: str, value_stack=None, state_stack=None, start_interactive=False): + parse_conf = ParseConf(self.parse_table, self.callbacks, start) + parser_state = ParserState(parse_conf, lexer, state_stack, value_stack) + if start_interactive: + return InteractiveParser(self, parser_state, parser_state.lexer) + return self.parse_from_state(parser_state) + + + def parse_from_state(self, state: ParserState, last_token: Optional[Token]=None): + """Run the main LALR parser loop + + Parameters: + state - the initial state. Changed in-place. + last_token - Used only for line information in case of an empty lexer. + """ + try: + token = last_token + for token in state.lexer.lex(state): + assert token is not None + state.feed_token(token) + + end_token = Token.new_borrow_pos('$END', '', token) if token else Token('$END', '', 0, 1, 1) + return state.feed_token(end_token, True) + except UnexpectedInput as e: + try: + e.interactive_parser = InteractiveParser(self, state, state.lexer) + except NameError: + pass + raise e + except Exception as e: + if self.debug: + print("") + print("STATE STACK DUMP") + print("----------------") + for i, s in enumerate(state.state_stack): + print('%d)' % i , s) + print("") + + raise +###} diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_parser_state.py b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_parser_state.py new file mode 100644 index 0000000000000000000000000000000000000000..273bc002e555abe0bc27cc8f89a34eb109ad58c7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/lalr_parser_state.py @@ -0,0 +1,110 @@ +from copy import deepcopy, copy +from typing import Dict, Any, Generic, List +from ..lexer import Token, LexerThread +from ..common import ParserCallbacks + +from .lalr_analysis import Shift, ParseTableBase, StateT +from lark.exceptions import UnexpectedToken + +###{standalone + +class ParseConf(Generic[StateT]): + __slots__ = 'parse_table', 'callbacks', 'start', 'start_state', 'end_state', 'states' + + parse_table: ParseTableBase[StateT] + callbacks: ParserCallbacks + start: str + + start_state: StateT + end_state: StateT + states: Dict[StateT, Dict[str, tuple]] + + def __init__(self, parse_table: ParseTableBase[StateT], callbacks: ParserCallbacks, start: str): + self.parse_table = parse_table + + self.start_state = self.parse_table.start_states[start] + self.end_state = self.parse_table.end_states[start] + self.states = self.parse_table.states + + self.callbacks = callbacks + self.start = start + +class ParserState(Generic[StateT]): + __slots__ = 'parse_conf', 'lexer', 'state_stack', 'value_stack' + + parse_conf: ParseConf[StateT] + lexer: LexerThread + state_stack: List[StateT] + value_stack: list + + def __init__(self, parse_conf: ParseConf[StateT], lexer: LexerThread, state_stack=None, value_stack=None): + self.parse_conf = parse_conf + self.lexer = lexer + self.state_stack = state_stack or [self.parse_conf.start_state] + self.value_stack = value_stack or [] + + @property + def position(self) -> StateT: + return self.state_stack[-1] + + # Necessary for match_examples() to work + def __eq__(self, other) -> bool: + if not isinstance(other, ParserState): + return NotImplemented + return len(self.state_stack) == len(other.state_stack) and self.position == other.position + + def __copy__(self): + return self.copy() + + def copy(self, deepcopy_values=True) -> 'ParserState[StateT]': + return type(self)( + self.parse_conf, + self.lexer, # XXX copy + copy(self.state_stack), + deepcopy(self.value_stack) if deepcopy_values else copy(self.value_stack), + ) + + def feed_token(self, token: Token, is_end=False) -> Any: + state_stack = self.state_stack + value_stack = self.value_stack + states = self.parse_conf.states + end_state = self.parse_conf.end_state + callbacks = self.parse_conf.callbacks + + while True: + state = state_stack[-1] + try: + action, arg = states[state][token.type] + except KeyError: + expected = {s for s in states[state].keys() if s.isupper()} + raise UnexpectedToken(token, expected, state=self, interactive_parser=None) + + assert arg != end_state + + if action is Shift: + # shift once and return + assert not is_end + state_stack.append(arg) + value_stack.append(token if token.type not in callbacks else callbacks[token.type](token)) + return + else: + # reduce+shift as many times as necessary + rule = arg + size = len(rule.expansion) + if size: + s = value_stack[-size:] + del state_stack[-size:] + del value_stack[-size:] + else: + s = [] + + value = callbacks[rule](s) if callbacks else s + + _action, new_state = states[state_stack[-1]][rule.origin.name] + assert _action is Shift + state_stack.append(new_state) + value_stack.append(value) + + if is_end and state_stack[-1] == end_state: + return value_stack[-1] +###} diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/xearley.py b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/xearley.py new file mode 100644 index 0000000000000000000000000000000000000000..a0f43acb324298fc5d82438c7da517918f3f0b5b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/parsers/xearley.py @@ -0,0 +1,165 @@ +"""This module implements an Earley parser with a dynamic lexer + +The core Earley algorithm used here is based on Elizabeth Scott's implementation, here: + https://www.sciencedirect.com/science/article/pii/S1571066108001497 + +That is probably the best reference for understanding the algorithm here. + +The Earley parser outputs an SPPF-tree as per that document. The SPPF tree format +is better documented here: + http://www.bramvandersanden.com/post/2014/06/shared-packed-parse-forest/ + +Instead of running a lexer beforehand, or using a costy char-by-char method, this parser +uses regular expressions by necessity, achieving high-performance while maintaining all of +Earley's power in parsing any CFG. +""" + +from typing import TYPE_CHECKING, Callable, Optional, List, Any +from collections import defaultdict + +from ..tree import Tree +from ..exceptions import UnexpectedCharacters +from ..lexer import Token +from ..grammar import Terminal +from .earley import Parser as BaseParser +from .earley_forest import TokenNode + +if TYPE_CHECKING: + from ..common import LexerConf, ParserConf + +class Parser(BaseParser): + def __init__(self, lexer_conf: 'LexerConf', parser_conf: 'ParserConf', term_matcher: Callable, + resolve_ambiguity: bool=True, complete_lex: bool=False, debug: bool=False, + tree_class: Optional[Callable[[str, List], Any]]=Tree, ordered_sets: bool=True): + BaseParser.__init__(self, lexer_conf, parser_conf, term_matcher, resolve_ambiguity, + debug, tree_class, ordered_sets) + self.ignore = [Terminal(t) for t in lexer_conf.ignore] + self.complete_lex = complete_lex + + def _parse(self, stream, columns, to_scan, start_symbol=None): + + def scan(i, to_scan): + """The core Earley Scanner. + + This is a custom implementation of the scanner that uses the + Lark lexer to match tokens. The scan list is built by the + Earley predictor, based on the previously completed tokens. + This ensures that at each phase of the parse we have a custom + lexer context, allowing for more complex ambiguities.""" + + node_cache = {} + + # 1) Loop the expectations and ask the lexer to match. + # Since regexp is forward looking on the input stream, and we only + # want to process tokens when we hit the point in the stream at which + # they complete, we push all tokens into a buffer (delayed_matches), to + # be held possibly for a later parse step when we reach the point in the + # input stream at which they complete. + for item in self.Set(to_scan): + m = match(item.expect, stream, i) + if m: + t = Token(item.expect.name, m.group(0), i, text_line, text_column) + delayed_matches[m.end()].append( (item, i, t) ) + + if self.complete_lex: + s = m.group(0) + for j in range(1, len(s)): + m = match(item.expect, s[:-j]) + if m: + t = Token(item.expect.name, m.group(0), i, text_line, text_column) + delayed_matches[i+m.end()].append( (item, i, t) ) + + # XXX The following 3 lines were commented out for causing a bug. See issue #768 + # # Remove any items that successfully matched in this pass from the to_scan buffer. + # # This ensures we don't carry over tokens that already matched, if we're ignoring below. + # to_scan.remove(item) + + # 3) Process any ignores. This is typically used for e.g. whitespace. + # We carry over any unmatched items from the to_scan buffer to be matched again after + # the ignore. This should allow us to use ignored symbols in non-terminals to implement + # e.g. mandatory spacing. + for x in self.ignore: + m = match(x, stream, i) + if m: + # Carry over any items still in the scan buffer, to past the end of the ignored items. + delayed_matches[m.end()].extend([(item, i, None) for item in to_scan ]) + + # If we're ignoring up to the end of the file, # carry over the start symbol if it already completed. + delayed_matches[m.end()].extend([(item, i, None) for item in columns[i] if item.is_complete and item.s == start_symbol]) + + next_to_scan = self.Set() + next_set = self.Set() + columns.append(next_set) + transitives.append({}) + + ## 4) Process Tokens from delayed_matches. + # This is the core of the Earley scanner. Create an SPPF node for each Token, + # and create the symbol node in the SPPF tree. Advance the item that completed, + # and add the resulting new item to either the Earley set (for processing by the + # completer/predictor) or the to_scan buffer for the next parse step. + for item, start, token in delayed_matches[i+1]: + if token is not None: + token.end_line = text_line + token.end_column = text_column + 1 + token.end_pos = i + 1 + + new_item = item.advance() + label = (new_item.s, new_item.start, i + 1) + token_node = TokenNode(token, terminals[token.type]) + new_item.node = node_cache[label] if label in node_cache else node_cache.setdefault(label, self.SymbolNode(*label)) + new_item.node.add_family(new_item.s, item.rule, new_item.start, item.node, token_node) + else: + new_item = item + + if new_item.expect in self.TERMINALS: + # add (B ::= Aai+1.B, h, y) to Q' + next_to_scan.add(new_item) + else: + # add (B ::= Aa+1.B, h, y) to Ei+1 + next_set.add(new_item) + + del delayed_matches[i+1] # No longer needed, so unburden memory + + if not next_set and not delayed_matches and not next_to_scan: + considered_rules = list(sorted(to_scan, key=lambda key: key.rule.origin.name)) + raise UnexpectedCharacters(stream, i, text_line, text_column, {item.expect.name for item in to_scan}, + set(to_scan), state=frozenset(i.s for i in to_scan), + considered_rules=considered_rules + ) + + return next_to_scan + + + delayed_matches = defaultdict(list) + match = self.term_matcher + terminals = self.lexer_conf.terminals_by_name + + # Cache for nodes & tokens created in a particular parse step. + transitives = [{}] + + text_line = 1 + text_column = 1 + + ## The main Earley loop. + # Run the Prediction/Completion cycle for any Items in the current Earley set. + # Completions will be added to the SPPF tree, and predictions will be recursively + # processed down to terminals/empty nodes to be added to the scanner for the next + # step. + i = 0 + for token in stream: + self.predict_and_complete(i, to_scan, columns, transitives) + + to_scan = scan(i, to_scan) + + if token == '\n': + text_line += 1 + text_column = 1 + else: + text_column += 1 + i += 1 + + self.predict_and_complete(i, to_scan, columns, transitives) + + ## Column is now the final column in the parse. + assert i == len(columns)-1 + return to_scan diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..eeb40e10bb723fa1f49da2a7d69c6f15032796c5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__init__.py @@ -0,0 +1,70 @@ +import sys +from argparse import ArgumentParser, FileType +from textwrap import indent +from logging import DEBUG, INFO, WARN, ERROR +from typing import Optional +import warnings + +from lark import Lark, logger +try: + from interegular import logger as interegular_logger + has_interegular = True +except ImportError: + has_interegular = False + +lalr_argparser = ArgumentParser(add_help=False, epilog='Look at the Lark documentation for more info on the options') + +flags = [ + ('d', 'debug'), + 'keep_all_tokens', + 'regex', + 'propagate_positions', + 'maybe_placeholders', + 'use_bytes' +] + +options = ['start', 'lexer'] + +lalr_argparser.add_argument('-v', '--verbose', action='count', default=0, help="Increase Logger output level, up to three times") +lalr_argparser.add_argument('-s', '--start', action='append', default=[]) +lalr_argparser.add_argument('-l', '--lexer', default='contextual', choices=('basic', 'contextual')) +lalr_argparser.add_argument('-o', '--out', type=FileType('w', encoding='utf-8'), default=sys.stdout, help='the output file (default=stdout)') +lalr_argparser.add_argument('grammar_file', type=FileType('r', encoding='utf-8'), help='A valid .lark file') + +for flag in flags: + if isinstance(flag, tuple): + options.append(flag[1]) + lalr_argparser.add_argument('-' + flag[0], '--' + flag[1], action='store_true') + elif isinstance(flag, str): + options.append(flag) + lalr_argparser.add_argument('--' + flag, action='store_true') + else: + raise NotImplementedError("flags must only contain strings or tuples of strings") + + +def build_lalr(namespace): + logger.setLevel((ERROR, WARN, INFO, DEBUG)[min(namespace.verbose, 3)]) + if has_interegular: + interegular_logger.setLevel(logger.getEffectiveLevel()) + if len(namespace.start) == 0: + namespace.start.append('start') + kwargs = {n: getattr(namespace, n) for n in options} + return Lark(namespace.grammar_file, parser='lalr', **kwargs), namespace.out + + +def showwarning_as_comment(message, category, filename, lineno, file=None, line=None): + # Based on warnings._showwarnmsg_impl + text = warnings.formatwarning(message, category, filename, lineno, line) + text = indent(text, '# ') + if file is None: + file = sys.stderr + if file is None: + return + try: + file.write(text) + except OSError: + pass + + +def make_warnings_comments(): + warnings.showwarning = showwarning_as_comment diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e3d4c28771fc8d4cbad7cf47b09d45c0b13033d7 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/nearley.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/nearley.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..feddc58e261743aff9ca9f0b530ff84bcf30f230 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/nearley.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/serialize.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/serialize.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a633973d49bec26b7d3867239467e39c571eaf3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/serialize.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/standalone.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/standalone.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7541bc7d0014ae36df6a73255bfb3bd3bd88220 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/__pycache__/standalone.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/tools/nearley.py b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/nearley.py new file mode 100644 index 0000000000000000000000000000000000000000..1fc27d565b4ba98192a5037c791c3819fe534586 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/nearley.py @@ -0,0 +1,202 @@ +"Converts Nearley grammars to Lark" + +import os.path +import sys +import codecs +import argparse + + +from lark import Lark, Transformer, v_args + +nearley_grammar = r""" + start: (ruledef|directive)+ + + directive: "@" NAME (STRING|NAME) + | "@" JS -> js_code + ruledef: NAME "->" expansions + | NAME REGEXP "->" expansions -> macro + expansions: expansion ("|" expansion)* + + expansion: expr+ js + + ?expr: item (":" /[+*?]/)? + + ?item: rule|string|regexp|null + | "(" expansions ")" + + rule: NAME + string: STRING + regexp: REGEXP + null: "null" + JS: /{%.*?%}/s + js: JS? + + NAME: /[a-zA-Z_$]\w*/ + COMMENT: /#[^\n]*/ + REGEXP: /\[.*?\]/ + + STRING: _STRING "i"? + + %import common.ESCAPED_STRING -> _STRING + %import common.WS + %ignore WS + %ignore COMMENT + + """ + +nearley_grammar_parser = Lark(nearley_grammar, parser='earley', lexer='basic') + +def _get_rulename(name): + name = {'_': '_ws_maybe', '__': '_ws'}.get(name, name) + return 'n_' + name.replace('$', '__DOLLAR__').lower() + +@v_args(inline=True) +class NearleyToLark(Transformer): + def __init__(self): + self._count = 0 + self.extra_rules = {} + self.extra_rules_rev = {} + self.alias_js_code = {} + + def _new_function(self, code): + name = 'alias_%d' % self._count + self._count += 1 + + self.alias_js_code[name] = code + return name + + def _extra_rule(self, rule): + if rule in self.extra_rules_rev: + return self.extra_rules_rev[rule] + + name = 'xrule_%d' % len(self.extra_rules) + assert name not in self.extra_rules + self.extra_rules[name] = rule + self.extra_rules_rev[rule] = name + return name + + def rule(self, name): + return _get_rulename(name) + + def ruledef(self, name, exps): + return '!%s: %s' % (_get_rulename(name), exps) + + def expr(self, item, op): + rule = '(%s)%s' % (item, op) + return self._extra_rule(rule) + + def regexp(self, r): + return '/%s/' % r + + def null(self): + return '' + + def string(self, s): + return self._extra_rule(s) + + def expansion(self, *x): + x, js = x[:-1], x[-1] + if js.children: + js_code ,= js.children + js_code = js_code[2:-2] + alias = '-> ' + self._new_function(js_code) + else: + alias = '' + return ' '.join(x) + alias + + def expansions(self, *x): + return '%s' % ('\n |'.join(x)) + + def start(self, *rules): + return '\n'.join(filter(None, rules)) + +def _nearley_to_lark(g, builtin_path, n2l, js_code, folder_path, includes): + rule_defs = [] + + tree = nearley_grammar_parser.parse(g) + for statement in tree.children: + if statement.data == 'directive': + directive, arg = statement.children + if directive in ('builtin', 'include'): + folder = builtin_path if directive == 'builtin' else folder_path + path = os.path.join(folder, arg[1:-1]) + if path not in includes: + includes.add(path) + with codecs.open(path, encoding='utf8') as f: + text = f.read() + rule_defs += _nearley_to_lark(text, builtin_path, n2l, js_code, os.path.abspath(os.path.dirname(path)), includes) + else: + assert False, directive + elif statement.data == 'js_code': + code ,= statement.children + code = code[2:-2] + js_code.append(code) + elif statement.data == 'macro': + pass # TODO Add support for macros! + elif statement.data == 'ruledef': + rule_defs.append(n2l.transform(statement)) + else: + raise Exception("Unknown statement: %s" % statement) + + return rule_defs + + +def create_code_for_nearley_grammar(g, start, builtin_path, folder_path, es6=False): + import js2py + + emit_code = [] + def emit(x=None): + if x: + emit_code.append(x) + emit_code.append('\n') + + js_code = ['function id(x) {return x[0];}'] + n2l = NearleyToLark() + rule_defs = _nearley_to_lark(g, builtin_path, n2l, js_code, folder_path, set()) + lark_g = '\n'.join(rule_defs) + lark_g += '\n'+'\n'.join('!%s: %s' % item for item in n2l.extra_rules.items()) + + emit('from lark import Lark, Transformer') + emit() + emit('grammar = ' + repr(lark_g)) + emit() + + for alias, code in n2l.alias_js_code.items(): + js_code.append('%s = (%s);' % (alias, code)) + + if es6: + emit(js2py.translate_js6('\n'.join(js_code))) + else: + emit(js2py.translate_js('\n'.join(js_code))) + emit('class TransformNearley(Transformer):') + for alias in n2l.alias_js_code: + emit(" %s = var.get('%s').to_python()" % (alias, alias)) + emit(" __default__ = lambda self, n, c, m: c if c else None") + + emit() + emit('parser = Lark(grammar, start="n_%s", maybe_placeholders=False)' % start) + emit('def parse(text):') + emit(' return TransformNearley().transform(parser.parse(text))') + + return ''.join(emit_code) + +def main(fn, start, nearley_lib, es6=False): + with codecs.open(fn, encoding='utf8') as f: + grammar = f.read() + return create_code_for_nearley_grammar(grammar, start, os.path.join(nearley_lib, 'builtin'), os.path.abspath(os.path.dirname(fn)), es6=es6) + +def get_arg_parser(): + parser = argparse.ArgumentParser(description='Reads a Nearley grammar (with js functions), and outputs an equivalent lark parser.') + parser.add_argument('nearley_grammar', help='Path to the file containing the nearley grammar') + parser.add_argument('start_rule', help='Rule within the nearley grammar to make the base rule') + parser.add_argument('nearley_lib', help='Path to root directory of nearley codebase (used for including builtins)') + parser.add_argument('--es6', help='Enable experimental ES6 support', action='store_true') + return parser + +if __name__ == '__main__': + parser = get_arg_parser() + if len(sys.argv) == 1: + parser.print_help(sys.stderr) + sys.exit(1) + args = parser.parse_args() + print(main(fn=args.nearley_grammar, start=args.start_rule, nearley_lib=args.nearley_lib, es6=args.es6)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/tools/serialize.py b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/serialize.py new file mode 100644 index 0000000000000000000000000000000000000000..eb28824b7a7df56150e89b02b233d886e1514eba --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/serialize.py @@ -0,0 +1,32 @@ +import sys +import json + +from lark.grammar import Rule +from lark.lexer import TerminalDef +from lark.tools import lalr_argparser, build_lalr + +import argparse + +argparser = argparse.ArgumentParser(prog='python -m lark.tools.serialize', parents=[lalr_argparser], + description="Lark Serialization Tool - Stores Lark's internal state & LALR analysis as a JSON file", + epilog='Look at the Lark documentation for more info on the options') + + +def serialize(lark_inst, outfile): + data, memo = lark_inst.memo_serialize([TerminalDef, Rule]) + outfile.write('{\n') + outfile.write(' "data": %s,\n' % json.dumps(data)) + outfile.write(' "memo": %s\n' % json.dumps(memo)) + outfile.write('}\n') + + +def main(): + if len(sys.argv)==1: + argparser.print_help(sys.stderr) + sys.exit(1) + ns = argparser.parse_args() + serialize(*build_lalr(ns)) + + +if __name__ == '__main__': + main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/lark/tools/standalone.py b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/standalone.py new file mode 100644 index 0000000000000000000000000000000000000000..9940ccbf50543fb6ece2bc53c8a8365378df66a7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/lark/tools/standalone.py @@ -0,0 +1,196 @@ +###{standalone +# +# +# Lark Stand-alone Generator Tool +# ---------------------------------- +# Generates a stand-alone LALR(1) parser +# +# Git: https://github.com/erezsh/lark +# Author: Erez Shinan (erezshin@gmail.com) +# +# +# >>> LICENSE +# +# This tool and its generated code use a separate license from Lark, +# and are subject to the terms of the Mozilla Public License, v. 2.0. +# If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. +# +# If you wish to purchase a commercial license for this tool and its +# generated code, you may contact me via email or otherwise. +# +# If MPL2 is incompatible with your free or open-source project, +# contact me and we'll work it out. +# +# + +from copy import deepcopy +from abc import ABC, abstractmethod +from types import ModuleType +from typing import ( + TypeVar, Generic, Type, Tuple, List, Dict, Iterator, Collection, Callable, Optional, FrozenSet, Any, + Union, Iterable, IO, TYPE_CHECKING, overload, Sequence, + Pattern as REPattern, ClassVar, Set, Mapping +) +###} + +import sys +import token, tokenize +import os +from os import path +from collections import defaultdict +from functools import partial +from argparse import ArgumentParser + +import lark +from lark.tools import lalr_argparser, build_lalr, make_warnings_comments + + +from lark.grammar import Rule +from lark.lexer import TerminalDef + +_dir = path.dirname(__file__) +_larkdir = path.join(_dir, path.pardir) + + +EXTRACT_STANDALONE_FILES = [ + 'tools/standalone.py', + 'exceptions.py', + 'utils.py', + 'tree.py', + 'visitors.py', + 'grammar.py', + 'lexer.py', + 'common.py', + 'parse_tree_builder.py', + 'parsers/lalr_analysis.py', + 'parsers/lalr_parser_state.py', + 'parsers/lalr_parser.py', + 'parsers/lalr_interactive_parser.py', + 'parser_frontends.py', + 'lark.py', + 'indenter.py', +] + +def extract_sections(lines): + section = None + text = [] + sections = defaultdict(list) + for line in lines: + if line.startswith('###'): + if line[3] == '{': + section = line[4:].strip() + elif line[3] == '}': + sections[section] += text + section = None + text = [] + else: + raise ValueError(line) + elif section: + text.append(line) + + return {name: ''.join(text) for name, text in sections.items()} + + +def strip_docstrings(line_gen): + """ Strip comments and docstrings from a file. + Based on code from: https://stackoverflow.com/questions/1769332/script-to-remove-python-comments-docstrings + """ + res = [] + + prev_toktype = token.INDENT + last_lineno = -1 + last_col = 0 + + tokgen = tokenize.generate_tokens(line_gen) + for toktype, ttext, (slineno, scol), (elineno, ecol), ltext in tokgen: + if slineno > last_lineno: + last_col = 0 + if scol > last_col: + res.append(" " * (scol - last_col)) + if toktype == token.STRING and prev_toktype == token.INDENT: + # Docstring + res.append("#--") + elif toktype == tokenize.COMMENT: + # Comment + res.append("##\n") + else: + res.append(ttext) + prev_toktype = toktype + last_col = ecol + last_lineno = elineno + + return ''.join(res) + + +def gen_standalone(lark_inst, output=None, out=sys.stdout, compress=False): + if output is None: + output = partial(print, file=out) + + import pickle, zlib, base64 + def compressed_output(obj): + s = pickle.dumps(obj, pickle.HIGHEST_PROTOCOL) + c = zlib.compress(s) + output(repr(base64.b64encode(c))) + + def output_decompress(name): + output('%(name)s = pickle.loads(zlib.decompress(base64.b64decode(%(name)s)))' % locals()) + + output('# The file was automatically generated by Lark v%s' % lark.__version__) + output('__version__ = "%s"' % lark.__version__) + output() + + for i, pyfile in enumerate(EXTRACT_STANDALONE_FILES): + with open(os.path.join(_larkdir, pyfile)) as f: + code = extract_sections(f)['standalone'] + if i: # if not this file + code = strip_docstrings(partial(next, iter(code.splitlines(True)))) + output(code) + + data, m = lark_inst.memo_serialize([TerminalDef, Rule]) + output('import pickle, zlib, base64') + if compress: + output('DATA = (') + compressed_output(data) + output(')') + output_decompress('DATA') + output('MEMO = (') + compressed_output(m) + output(')') + output_decompress('MEMO') + else: + output('DATA = (') + output(data) + output(')') + output('MEMO = (') + output(m) + output(')') + + + output('Shift = 0') + output('Reduce = 1') + output("def Lark_StandAlone(**kwargs):") + output(" return Lark._load_from_dict(DATA, MEMO, **kwargs)") + + + + +def main(): + make_warnings_comments() + parser = ArgumentParser(prog="prog='python -m lark.tools.standalone'", description="Lark Stand-alone Generator Tool", + parents=[lalr_argparser], epilog='Look at the Lark documentation for more info on the options') + parser.add_argument('-c', '--compress', action='store_true', default=0, help="Enable compression") + if len(sys.argv) == 1: + parser.print_help(sys.stderr) + sys.exit(1) + ns = parser.parse_args() + + lark_inst, out = build_lalr(ns) + gen_standalone(lark_inst, out=out, compress=ns.compress) + + ns.out.close() + ns.grammar_file.close() + + +if __name__ == '__main__': + main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3110061d7a419298e216a349c8a35b616c2bf3ff Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/__main__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/__main__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4aab896da9f362712be50a2e96e9bea08beacd00 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/__main__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/_version.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/_version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2296641ee7c44410668638ed1389c83750d8d3ca Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/_version.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/ninja_syntax.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/ninja_syntax.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c05cf5340bd0604f43d81a4af5f0a55423602218 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/ninja/__pycache__/ninja_syntax.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cext/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0ff54a4d6820fae84f4bda25d4cd577c1389fea8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/__init__.py @@ -0,0 +1,23 @@ +""" +Utilities for getting information about Numba C extensions +""" + +import os + + +def get_extension_libs(): + """Return the .c files in the `numba.cext` directory. + """ + libs = [] + base = get_path() + for fn in os.listdir(base): + if fn.endswith('.c'): + fn = os.path.join(base, fn) + libs.append(fn) + return libs + + +def get_path(): + """Returns the path to the directory for `numba.cext`. + """ + return os.path.abspath(os.path.join(os.path.dirname(__file__))) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cext/cext.h b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/cext.h new file mode 100644 index 0000000000000000000000000000000000000000..aa2b7eb26b979c353090a9f0f5fef641f9cde970 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/cext.h @@ -0,0 +1,21 @@ +#ifndef NUMBA_EXTENSION_HELPER_H_ +#define NUMBA_EXTENSION_HELPER_H_ + +#include "Python.h" +#include "../_numba_common.h" + +/* Define all runtime-required symbols in this C module, but do not + export them outside the shared library if possible. */ +#define NUMBA_EXPORT_FUNC(_rettype) VISIBILITY_HIDDEN _rettype +#define NUMBA_EXPORT_DATA(_vartype) VISIBILITY_HIDDEN _vartype + +/* Use to declare a symbol as exported (global). */ +#define NUMBA_GLOBAL_FUNC(_rettype) VISIBILITY_GLOBAL _rettype + +NUMBA_EXPORT_FUNC(Py_ssize_t) +aligned_size(Py_ssize_t sz); + +#include "dictobject.h" +#include "listobject.h" + +#endif // end NUMBA_EXTENSION_HELPER_H_ diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cext/dictobject.c b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/dictobject.c new file mode 100644 index 0000000000000000000000000000000000000000..3557757ba577235d02cbedbf371cf7fedbff4cc4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/dictobject.c @@ -0,0 +1,1265 @@ +/* The following is adapted from CPython3.7. +The exact commit is: + +- https://github.com/python/cpython/blob/44467e8ea4cea390b0718702291b4cfe8ddd67ed/Objects/dictobject.c + + +*/ + +/* Dictionary object implementation using a hash table */ + +/* The distribution includes a separate file, Objects/dictnotes.txt, + describing explorations into dictionary design and optimization. + It covers typical dictionary use patterns, the parameters for + tuning dictionaries, and several ideas for possible optimizations. +*/ + +/* PyDictKeysObject + +This implements the dictionary's hashtable. + +As of Python 3.6, this is compact and ordered. Basic idea is described here: +* https://mail.python.org/pipermail/python-dev/2012-December/123028.html +* https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html + +layout: + ++---------------+ +| dk_refcnt | +| dk_size | +| dk_lookup | +| dk_usable | +| dk_nentries | ++---------------+ +| dk_indices | +| | ++---------------+ +| dk_entries | +| | ++---------------+ + +dk_indices is actual hashtable. It holds index in entries, or DKIX_EMPTY(-1) +or DKIX_DUMMY(-2). +Size of indices is dk_size. Type of each index in indices is vary on dk_size: + +* int8 for dk_size <= 128 +* int16 for 256 <= dk_size <= 2**15 +* int32 for 2**16 <= dk_size <= 2**31 +* int64 for 2**32 <= dk_size + +dk_entries is array of PyDictKeyEntry. It's size is USABLE_FRACTION(dk_size). +DK_ENTRIES(dk) can be used to get pointer to entries. + +NOTE: Since negative value is used for DKIX_EMPTY and DKIX_DUMMY, type of +dk_indices entry is signed integer and int16 is used for table which +dk_size == 256. +*/ + + +/* +The DictObject can be in one of two forms. + +Either: + A combined table: + ma_values == NULL, dk_refcnt == 1. + Values are stored in the me_value field of the PyDictKeysObject. +Or: + + (Numba dev notes: split table logic is removed) + + A split table: + ma_values != NULL, dk_refcnt >= 1 + Values are stored in the ma_values array. + Only string (unicode) keys are allowed. + All dicts sharing same key must have same insertion order. + +There are four kinds of slots in the table (slot is index, and +DK_ENTRIES(keys)[index] if index >= 0): + +1. Unused. index == DKIX_EMPTY + Does not hold an active (key, value) pair now and never did. Unused can + transition to Active upon key insertion. This is each slot's initial state. + +2. Active. index >= 0, me_key != NULL and me_value != NULL + Holds an active (key, value) pair. Active can transition to Dummy or + Pending upon key deletion (for combined and split tables respectively). + This is the only case in which me_value != NULL. + +3. Dummy. index == DKIX_DUMMY (combined only) + Previously held an active (key, value) pair, but that was deleted and an + active pair has not yet overwritten the slot. Dummy can transition to + Active upon key insertion. Dummy slots cannot be made Unused again + else the probe sequence in case of collision would have no way to know + they were once active. + +4. Pending. index >= 0, key != NULL, and value == NULL (split only) + Not yet inserted in split-table. +*/ + +/* +Preserving insertion order + +It's simple for combined table. Since dk_entries is mostly append only, we can +get insertion order by just iterating dk_entries. + +One exception is .popitem(). It removes last item in dk_entries and decrement +dk_nentries to achieve amortized O(1). Since there are DKIX_DUMMY remains in +dk_indices, we can't increment dk_usable even though dk_nentries is +decremented. + +In split table, inserting into pending entry is allowed only for dk_entries[ix] +where ix == mp->ma_used. Inserting into other index and deleting item cause +converting the dict to the combined table. +*/ + + +/* D_MINSIZE (adapted from PyDict_MINSIZE) + * is the starting size for any new dict. + * 8 allows dicts with no more than 5 active entries; experiments suggested + * this suffices for the majority of dicts (consisting mostly of usually-small + * dicts created to pass keyword arguments). + * Making this 8, rather than 4 reduces the number of resizes for most + * dictionaries, without any significant extra memory use. + */ +#define D_MINSIZE 8 + +#include "dictobject.h" + + +#if defined(_MSC_VER) +# if _MSC_VER <= 1900 /* Visual Studio 2014 */ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; +# endif + /* Use _alloca() to dynamically allocate on the stack on MSVC */ + #define STACK_ALLOC(Type, Name, Size) Type * const Name = _alloca(Size); +#else + #define STACK_ALLOC(Type, Name, Size) Type Name[Size]; +#endif + + +/*[clinic input] +class dict "PyDictObject *" "&PyDict_Type" +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=f157a5a0ce9589d6]*/ + + +/* +To ensure the lookup algorithm terminates, there must be at least one Unused +slot (NULL key) in the table. +To avoid slowing down lookups on a near-full table, we resize the table when +it's USABLE_FRACTION (currently two-thirds) full. +*/ + +#define PERTURB_SHIFT 5 + +/* +Major subtleties ahead: Most hash schemes depend on having a "good" hash +function, in the sense of simulating randomness. Python doesn't: its most +important hash functions (for ints) are very regular in common +cases: + + >>>[hash(i) for i in range(4)] + [0, 1, 2, 3] + +This isn't necessarily bad! To the contrary, in a table of size 2**i, taking +the low-order i bits as the initial table index is extremely fast, and there +are no collisions at all for dicts indexed by a contiguous range of ints. So +this gives better-than-random behavior in common cases, and that's very +desirable. + +OTOH, when collisions occur, the tendency to fill contiguous slices of the +hash table makes a good collision resolution strategy crucial. Taking only +the last i bits of the hash code is also vulnerable: for example, consider +the list [i << 16 for i in range(20000)] as a set of keys. Since ints are +their own hash codes, and this fits in a dict of size 2**15, the last 15 bits + of every hash code are all 0: they *all* map to the same table index. + +But catering to unusual cases should not slow the usual ones, so we just take +the last i bits anyway. It's up to collision resolution to do the rest. If +we *usually* find the key we're looking for on the first try (and, it turns +out, we usually do -- the table load factor is kept under 2/3, so the odds +are solidly in our favor), then it makes best sense to keep the initial index +computation dirt cheap. + +The first half of collision resolution is to visit table indices via this +recurrence: + + j = ((5*j) + 1) mod 2**i + +For any initial j in range(2**i), repeating that 2**i times generates each +int in range(2**i) exactly once (see any text on random-number generation for +proof). By itself, this doesn't help much: like linear probing (setting +j += 1, or j -= 1, on each loop trip), it scans the table entries in a fixed +order. This would be bad, except that's not the only thing we do, and it's +actually *good* in the common cases where hash keys are consecutive. In an +example that's really too small to make this entirely clear, for a table of +size 2**3 the order of indices is: + + 0 -> 1 -> 6 -> 7 -> 4 -> 5 -> 2 -> 3 -> 0 [and here it's repeating] + +If two things come in at index 5, the first place we look after is index 2, +not 6, so if another comes in at index 6 the collision at 5 didn't hurt it. +Linear probing is deadly in this case because there the fixed probe order +is the *same* as the order consecutive keys are likely to arrive. But it's +extremely unlikely hash codes will follow a 5*j+1 recurrence by accident, +and certain that consecutive hash codes do not. + +The other half of the strategy is to get the other bits of the hash code +into play. This is done by initializing a (unsigned) vrbl "perturb" to the +full hash code, and changing the recurrence to: + + perturb >>= PERTURB_SHIFT; + j = (5*j) + 1 + perturb; + use j % 2**i as the next table index; + +Now the probe sequence depends (eventually) on every bit in the hash code, +and the pseudo-scrambling property of recurring on 5*j+1 is more valuable, +because it quickly magnifies small differences in the bits that didn't affect +the initial index. Note that because perturb is unsigned, if the recurrence +is executed often enough perturb eventually becomes and remains 0. At that +point (very rarely reached) the recurrence is on (just) 5*j+1 again, and +that's certain to find an empty slot eventually (since it generates every int +in range(2**i), and we make sure there's always at least one empty slot). + +Selecting a good value for PERTURB_SHIFT is a balancing act. You want it +small so that the high bits of the hash code continue to affect the probe +sequence across iterations; but you want it large so that in really bad cases +the high-order hash bits have an effect on early iterations. 5 was "the +best" in minimizing total collisions across experiments Tim Peters ran (on +both normal and pathological cases), but 4 and 6 weren't significantly worse. + +Historical: Reimer Behrends contributed the idea of using a polynomial-based +approach, using repeated multiplication by x in GF(2**n) where an irreducible +polynomial for each table size was chosen such that x was a primitive root. +Christian Tismer later extended that to use division by x instead, as an +efficient way to get the high bits of the hash code into play. This scheme +also gave excellent collision statistics, but was more expensive: two +if-tests were required inside the loop; computing "the next" index took about +the same number of operations but without as much potential parallelism +(e.g., computing 5*j can go on at the same time as computing 1+perturb in the +above, and then shifting perturb can be done while the table index is being +masked); and the PyDictObject struct required a member to hold the table's +polynomial. In Tim's experiments the current scheme ran faster, produced +equally good collision statistics, needed less code & used less memory. + +*/ + +#define DKIX_EMPTY (-1) +#define DKIX_DUMMY (-2) /* Used internally */ +#define DKIX_ERROR (-3) + +typedef enum { + OK = 0, + OK_REPLACED = 1, + ERR_NO_MEMORY = -1, + ERR_DICT_MUTATED = -2, + ERR_ITER_EXHAUSTED = -3, + ERR_DICT_EMPTY = -4, + ERR_CMP_FAILED = -5, +} Status; + + +#ifndef NDEBUG +static +int mem_cmp_zeros(void *obj, size_t n){ + int diff = 0; + char *mem = obj; + char *it; + for (it = mem; it < mem + n; ++it) { + if (*it != 0) diff += 1; + } + return diff; +} +#endif + +#define D_MASK(dk) ((dk)->size-1) +#define D_GROWTH_RATE(d) ((d)->used*3) + +static int +ix_size(Py_ssize_t size) { + if ( size < 0xff ) return 1; + if ( size < 0xffff ) return 2; + if ( size < 0xffffffff ) return 4; + return sizeof(int64_t); +} + +#ifndef NDEBUG +/* NOTE: This function is only used in assert()s */ +/* Align pointer *ptr* to pointer size */ +static void* +aligned_pointer(void *ptr) { + return (void*)aligned_size((size_t)ptr); +} +#endif + +/* lookup indices. returns DKIX_EMPTY, DKIX_DUMMY, or ix >=0 */ +static Py_ssize_t +get_index(NB_DictKeys *dk, Py_ssize_t i) +{ + Py_ssize_t s = dk->size; + Py_ssize_t ix; + + if (s <= 0xff) { + int8_t *indices = (int8_t*)(dk->indices); + assert (i < dk->size); + ix = indices[i]; + } + else if (s <= 0xffff) { + int16_t *indices = (int16_t*)(dk->indices); + ix = indices[i]; + } +#if SIZEOF_VOID_P > 4 + else if (s > 0xffffffff) { + int64_t *indices = (int64_t*)(dk->indices); + ix = indices[i]; + } +#endif + else { + int32_t *indices = (int32_t*)(dk->indices); + ix = indices[i]; + } + assert(ix >= DKIX_DUMMY); + return ix; +} + +/* write to indices. */ +static void +set_index(NB_DictKeys *dk, Py_ssize_t i, Py_ssize_t ix) +{ + Py_ssize_t s = dk->size; + + assert(ix >= DKIX_DUMMY); + + if (s <= 0xff) { + int8_t *indices = (int8_t*)(dk->indices); + assert(ix <= 0x7f); + indices[i] = (char)ix; + } + else if (s <= 0xffff) { + int16_t *indices = (int16_t*)(dk->indices); + assert(ix <= 0x7fff); + indices[i] = (int16_t)ix; + } +#if SIZEOF_VOID_P > 4 + else if (s > 0xffffffff) { + int64_t *indices = (int64_t*)(dk->indices); + indices[i] = ix; + } +#endif + else { + int32_t *indices = (int32_t*)(dk->indices); + assert(ix <= 0x7fffffff); + indices[i] = (int32_t)ix; + } +} + + +/* USABLE_FRACTION is the maximum dictionary load. + * Increasing this ratio makes dictionaries more dense resulting in more + * collisions. Decreasing it improves sparseness at the expense of spreading + * indices over more cache lines and at the cost of total memory consumed. + * + * USABLE_FRACTION must obey the following: + * (0 < USABLE_FRACTION(n) < n) for all n >= 2 + * + * USABLE_FRACTION should be quick to calculate. + * Fractions around 1/2 to 2/3 seem to work well in practice. + */ + +#define USABLE_FRACTION(n) (((n) << 1)/3) // ratio: 2/3 + +/* Alternative fraction that is otherwise close enough to 2n/3 to make + * little difference. 8 * 2/3 == 8 * 5/8 == 5. 16 * 2/3 == 16 * 5/8 == 10. + * 32 * 2/3 = 21, 32 * 5/8 = 20. + * Its advantage is that it is faster to compute on machines with slow division. + * #define USABLE_FRACTION(n) (((n) >> 1) + ((n) >> 2) - ((n) >> 3)) // ratio: 5/8 + */ + + +/* INV_USABLE_FRACTION gives the inverse of USABLE_FRACTION. + * Used for sizing a new dictionary to a specified number of keys. + * + * NOTE: If the denominator of the USABLE_FRACTION ratio is not a power + * of 2, must add 1 to the result of the inverse for correct sizing. + * + * For example, when USABLE_FRACTION ratio = 5/8 (8 is a power of 2): + * #define INV_USABLE_FRACTION(n) (((n) << 3)/5) // inv_ratio: 8/5 + * + * When USABLE_FRACTION ratio = 5/7 (7 is not a power of 2): + * #define INV_USABLE_FRACTION(n) ((7*(n))/5 + 1) // inv_ratio: 7/5 + */ + +#define INV_USABLE_FRACTION(n) ((n) + ((n) >> 1) + 1) // inv_ratio: 3/2 + + +/* GROWTH_RATE. Growth rate upon hitting maximum load. + * Currently set to used*3. + * This means that dicts double in size when growing without deletions, + * but have more head room when the number of deletions is on a par with the + * number of insertions. See also bpo-17563 and bpo-33205. + * + * GROWTH_RATE was set to used*4 up to version 3.2. + * GROWTH_RATE was set to used*2 in version 3.3.0 + * GROWTH_RATE was set to used*2 + capacity/2 in 3.4.0-3.6.0. + */ +#define GROWTH_RATE(d) ((d)->ma_used*3) + + +static NB_DictEntry* +get_entry(NB_DictKeys *dk, Py_ssize_t idx) { + Py_ssize_t offset; + char *ptr; + + assert (idx < dk->size); + offset = idx * dk->entry_size; + ptr = dk->indices + dk->entry_offset + offset; + return (NB_DictEntry*)ptr; +} + +static void +zero_key(NB_DictKeys *dk, char *data){ + memset(data, 0, dk->key_size); +} + +static void +zero_val(NB_DictKeys *dk, char *data){ + memset(data, 0, dk->val_size); +} + +static void +copy_key(NB_DictKeys *dk, char *dst, const char *src){ + memcpy(dst, src, dk->key_size); +} + +static void +copy_val(NB_DictKeys *dk, char *dst, const char *src){ + memcpy(dst, src, dk->val_size); +} + +/* Returns -1 for error; 0 for not equal; 1 for equal */ +static int +key_equal(NB_DictKeys *dk, const char *lhs, const char *rhs) { + if ( dk->methods.key_equal ) { + return dk->methods.key_equal(lhs, rhs); + } else { + return memcmp(lhs, rhs, dk->key_size) == 0; + } +} + +static char * +entry_get_key(NB_DictKeys *dk, NB_DictEntry* entry) { + char * out = entry->keyvalue; + assert (out == aligned_pointer(out)); + return out; +} + +static char * +entry_get_val(NB_DictKeys *dk, NB_DictEntry* entry) { + char * out = entry_get_key(dk, entry) + aligned_size(dk->key_size); + assert (out == aligned_pointer(out)); + return out; +} + +static void +dk_incref_key(NB_DictKeys *dk, const char *key) { + if ( dk->methods.key_incref ) { + dk->methods.key_incref(key); + } +} + +static void +dk_decref_key(NB_DictKeys *dk, const char *key) { + if ( dk->methods.key_decref ) { + dk->methods.key_decref(key); + } +} + +static void +dk_incref_val(NB_DictKeys *dk, const char *val) { + if ( dk->methods.value_incref ) { + dk->methods.value_incref(val); + } +} + +static void +dk_decref_val(NB_DictKeys *dk, const char *val) { + if ( dk->methods.value_decref ) { + dk->methods.value_decref(val); + } +} + + +void +numba_dictkeys_free(NB_DictKeys *dk) { + /* Clear all references from the entries */ + Py_ssize_t i; + NB_DictEntry *ep; + + for (i = 0; i < dk->nentries; i++) { + ep = get_entry(dk, i); + if (ep->hash != DKIX_EMPTY) { + dk_decref_key(dk, entry_get_key(dk, ep)); + dk_decref_val(dk, entry_get_val(dk, ep)); + } + } + /* Deallocate */ + free(dk); +} + +void +numba_dict_free(NB_Dict *d) { + numba_dictkeys_free(d->keys); + free(d); +} + +Py_ssize_t +numba_dict_length(NB_Dict *d) { + return d->used; +} + +/* Allocate new dictionary keys + +Adapted from CPython's new_keys_object(). +*/ +int +numba_dictkeys_new(NB_DictKeys **out, Py_ssize_t size, Py_ssize_t key_size, Py_ssize_t val_size) { + Py_ssize_t usable = USABLE_FRACTION(size); + Py_ssize_t index_size = ix_size(size); + Py_ssize_t entry_size = aligned_size(sizeof(NB_DictEntry) + aligned_size(key_size) + aligned_size(val_size)); + Py_ssize_t entry_offset = aligned_size(index_size * size); + Py_ssize_t alloc_size = sizeof(NB_DictKeys) + entry_offset + entry_size * usable; + + NB_DictKeys *dk = malloc(aligned_size(alloc_size)); + if (!dk) return ERR_NO_MEMORY; + + assert ( size >= D_MINSIZE ); + + dk->size = size; + dk->usable = usable; + dk->nentries = 0; + dk->key_size = key_size; + dk->val_size = val_size; + dk->entry_offset = entry_offset; + dk->entry_size = entry_size; + + assert (aligned_pointer(dk->indices) == dk->indices ); + /* Ensure that the method table is all nulls */ + memset(&dk->methods, 0x00, sizeof(type_based_methods_table)); + /* Ensure hash is (-1) for empty entry */ + memset(dk->indices, 0xff, entry_offset + entry_size * usable); + + *out = dk; + return OK; +} + + +/* Allocate new dictionary */ +int +numba_dict_new(NB_Dict **out, Py_ssize_t size, Py_ssize_t key_size, Py_ssize_t val_size) { + NB_DictKeys *dk; + NB_Dict *d; + int status = numba_dictkeys_new(&dk, size, key_size, val_size); + if (status != OK) return status; + + d = malloc(sizeof(NB_Dict)); + if (!d) { + numba_dictkeys_free(dk); + return ERR_NO_MEMORY; + } + + d->used = 0; + d->keys = dk; + *out = d; + return OK; +} + + +/* +Adapted from CPython lookdict_index(). + +Search index of hash table from offset of entry table +*/ +static Py_ssize_t +lookdict_index(NB_DictKeys *dk, Py_hash_t hash, Py_ssize_t index) +{ + size_t mask = D_MASK(dk); + size_t perturb = (size_t)hash; + size_t i = (size_t)hash & mask; + + for (;;) { + Py_ssize_t ix = get_index(dk, i); + if (ix == index) { + return i; + } + if (ix == DKIX_EMPTY) { + return DKIX_EMPTY; + } + perturb >>= PERTURB_SHIFT; + i = mask & (i*5 + perturb + 1); + } + assert(0 && "unreachable"); +} + +/* + +Adapted from the CPython3.7 lookdict(). + +The basic lookup function used by all operations. +This is based on Algorithm D from Knuth Vol. 3, Sec. 6.4. +Open addressing is preferred over chaining since the link overhead for +chaining would be substantial (100% with typical malloc overhead). + +The initial probe index is computed as hash mod the table size. Subsequent +probe indices are computed as explained earlier. + +All arithmetic on hash should ignore overflow. + +The details in this version are due to Tim Peters, building on many past +contributions by Reimer Behrends, Jyrki Alakuijala, Vladimir Marangozov and +Christian Tismer. + +lookdict() is general-purpose, and may return DKIX_ERROR if (and only if) a +comparison raises an exception. +lookdict_unicode() below is specialized to string keys, comparison of which can +never raise an exception; that function can never return DKIX_ERROR when key +is string. Otherwise, it falls back to lookdict(). +lookdict_unicode_nodummy is further specialized for string keys that cannot be +the value. +For both, when the key isn't found a DKIX_EMPTY is returned. +*/ +Py_ssize_t +numba_dict_lookup(NB_Dict *d, const char *key_bytes, Py_hash_t hash, char *oldval_bytes) +{ + NB_DictKeys *dk = d->keys; + size_t mask = D_MASK(dk); + size_t perturb = hash; + size_t i = (size_t)hash & mask; + + for (;;) { + Py_ssize_t ix = get_index(dk, i); + if (ix == DKIX_EMPTY) { + zero_val(dk, oldval_bytes); + return ix; + } + if (ix >= 0) { + NB_DictEntry *ep = get_entry(dk, ix); + const char *startkey = NULL; + if (ep->hash == hash) { + int cmp; + + startkey = entry_get_key(dk, ep); + cmp = key_equal(dk, startkey, key_bytes); + if (cmp < 0) { + // error'ed in comparison + memset(oldval_bytes, 0, dk->val_size); + return DKIX_ERROR; + } + if (cmp > 0) { + // key is equal; retrieve the value. + copy_val(dk, oldval_bytes, entry_get_val(dk, ep)); + return ix; + } + } + } + perturb >>= PERTURB_SHIFT; + i = (i*5 + perturb + 1) & mask; + } + assert(0 && "unreachable"); +} + + +/* Internal function to find slot for an item from its hash + when it is known that the key is not present in the dict. + + The dict must be combined. */ +static Py_ssize_t +find_empty_slot(NB_DictKeys *dk, Py_hash_t hash){ + size_t mask; + size_t i; + Py_ssize_t ix; + size_t perturb; + + assert(dk != NULL); + + mask = D_MASK(dk); + i = hash & mask; + ix = get_index(dk, i); + for (perturb = hash; ix >= 0;) { + perturb >>= PERTURB_SHIFT; + i = (i*5 + perturb + 1) & mask; + ix = get_index(dk, i); + } + return i; +} + +static int +insertion_resize(NB_Dict *d) +{ + return numba_dict_resize(d, D_GROWTH_RATE(d)); +} + +int +numba_dict_insert( + NB_Dict *d, + const char *key_bytes, + Py_hash_t hash, + const char *val_bytes, + char *oldval_bytes + ) +{ + + NB_DictKeys *dk = d->keys; + + Py_ssize_t ix = numba_dict_lookup(d, key_bytes, hash, oldval_bytes); + if (ix == DKIX_ERROR) { + // exception in key comparison in lookup. + return ERR_CMP_FAILED; + } + + if (ix == DKIX_EMPTY) { + /* Insert into new slot */ + Py_ssize_t hashpos; + NB_DictEntry *ep; + + if (dk->usable <= 0) { + /* Need to resize */ + if (insertion_resize(d) != OK) + return ERR_NO_MEMORY; + else + dk = d->keys; // reload + } + hashpos = find_empty_slot(dk, hash); + ep = get_entry(dk, dk->nentries); + set_index(dk, hashpos, dk->nentries); + copy_key(dk, entry_get_key(dk, ep), key_bytes); + assert ( hash != -1 ); + ep->hash = hash; + copy_val(dk, entry_get_val(dk, ep), val_bytes); + + /* incref */ + dk_incref_key(dk, key_bytes); + dk_incref_val(dk, val_bytes); + + d->used += 1; + dk->usable -= 1; + dk->nentries += 1; + assert (dk->usable >= 0); + return OK; + } else { + /* Replace existing value in the slot at ix */ + /* decref old value */ + dk_decref_val(dk, oldval_bytes); + // Replace the previous value + copy_val(dk, entry_get_val(dk, get_entry(dk, ix)), val_bytes); + + /* incref */ + dk_incref_val(dk, val_bytes); + return OK_REPLACED; + } +} + +/* +Adapted from build_indices(). +Internal routine used by dictresize() to build a hashtable of entries. +*/ +void +build_indices(NB_DictKeys *keys, Py_ssize_t n) { + size_t mask = (size_t)D_MASK(keys); + Py_ssize_t ix; + for (ix = 0; ix != n; ix++) { + size_t perturb; + Py_hash_t hash = get_entry(keys, ix)->hash; + size_t i = hash & mask; + for (perturb = hash; get_index(keys, i) != DKIX_EMPTY;) { + perturb >>= PERTURB_SHIFT; + i = mask & (i*5 + perturb + 1); + } + set_index(keys, i, ix); + } +} + +/* + +Adapted from CPython dictresize(). + +Restructure the table by allocating a new table and reinserting all +items again. When entries have been deleted, the new table may +actually be smaller than the old one. +If a table is split (its keys and hashes are shared, its values are not), +then the values are temporarily copied into the table, it is resized as +a combined table, then the me_value slots in the old table are NULLed out. +After resizing a table is always combined, +but can be resplit by make_keys_shared(). +*/ +int +numba_dict_resize(NB_Dict *d, Py_ssize_t minsize) { + Py_ssize_t newsize, numentries; + NB_DictKeys *oldkeys; + int status; + + /* Find the smallest table size > minused. */ + for (newsize = D_MINSIZE; + newsize < minsize && newsize > 0; + newsize <<= 1) + ; + if (newsize <= 0) { + return ERR_NO_MEMORY; + } + oldkeys = d->keys; + + /* NOTE: Current odict checks mp->ma_keys to detect resize happen. + * So we can't reuse oldkeys even if oldkeys->dk_size == newsize. + * TODO: Try reusing oldkeys when reimplement odict. + */ + + /* Allocate a new table. */ + status = numba_dictkeys_new( + &d->keys, newsize, oldkeys->key_size, oldkeys->val_size + ); + if (status != OK) { + d->keys = oldkeys; + return status; + } + // New table must be large enough. + assert(d->keys->usable >= d->used); + // Copy method table + memcpy(&d->keys->methods, &oldkeys->methods, sizeof(type_based_methods_table)); + + numentries = d->used; + + if (oldkeys->nentries == numentries) { + NB_DictEntry *oldentries, *newentries; + + oldentries = get_entry(oldkeys, 0); + newentries = get_entry(d->keys, 0); + memcpy(newentries, oldentries, numentries * oldkeys->entry_size); + // to avoid decref + memset(oldentries, 0xff, numentries * oldkeys->entry_size); + } + else { + Py_ssize_t i; + size_t epi = 0; + for (i=0; ihash == (-1) hash means it is empty + + Here, we skip until a non empty entry is encountered. + */ + while( get_entry(oldkeys, epi)->hash == DKIX_EMPTY ) { + assert( mem_cmp_zeros(entry_get_val(oldkeys, get_entry(oldkeys, epi)), oldkeys->val_size) == 0 ); + epi += 1; + } + memcpy( + get_entry(d->keys, i), + get_entry(oldkeys, epi), + oldkeys->entry_size + ); + get_entry(oldkeys, epi)->hash = DKIX_EMPTY; // to avoid decref + epi += 1; + + } + + } + numba_dictkeys_free(oldkeys); + + build_indices(d->keys, numentries); + d->keys->usable -= numentries; + d->keys->nentries = numentries; + return OK; +} + +/* + Adapted from CPython delitem_common + */ +int +numba_dict_delitem(NB_Dict *d, Py_hash_t hash, Py_ssize_t ix) +{ + Py_ssize_t hashpos; + NB_DictEntry *ep; + NB_DictKeys *dk = d->keys; + + hashpos = lookdict_index(dk, hash, ix); + assert(hashpos >= 0); + + d->used -= 1; + ep = get_entry(dk, ix); + set_index(dk, hashpos, DKIX_DUMMY); + + /* decref */ + dk_decref_key(dk, entry_get_key(dk, ep)); + dk_decref_val(dk, entry_get_val(dk, ep)); + + /* zero the entries */ + zero_key(dk, entry_get_key(dk, ep)); + zero_val(dk, entry_get_val(dk, ep)); + ep->hash = DKIX_EMPTY; // to mark it as empty; + + return OK; +} + + +/** + * Adapted from dict_popitem + * + */ +int +numba_dict_popitem(NB_Dict *d, char *key_bytes, char *val_bytes) +{ + Py_ssize_t i, j; + char *key_ptr, *val_ptr; + NB_DictEntry *ep = NULL; + + if (d->used == 0) { + return ERR_DICT_EMPTY; + } + + /* Pop last item */ + i = d->keys->nentries - 1; + while (i >= 0 && (ep = get_entry(d->keys, i))->hash == DKIX_EMPTY ) { + i--; + } + assert(i >= 0); + + j = lookdict_index(d->keys, ep->hash, i); + assert(j >= 0); + assert(get_index(d->keys, j) == i); + set_index(d->keys, j, DKIX_DUMMY); + + key_ptr = entry_get_key(d->keys, ep); + val_ptr = entry_get_val(d->keys, ep); + + copy_key(d->keys, key_bytes, key_ptr); + copy_val(d->keys, val_bytes, val_ptr); + + zero_key(d->keys, key_ptr); + zero_val(d->keys, val_ptr); + + /* We can't dk_usable++ since there is DKIX_DUMMY in indices */ + d->keys->nentries = i; + d->used--; + + return OK; +} + +void +numba_dict_dump(NB_Dict *d) { + long long i, j, k; + long long size, n; + char *cp; + NB_DictEntry *ep; + NB_DictKeys *dk = d->keys; + + n = d->used; + size = dk->nentries; + + printf("Dict dump\n"); + printf(" key_size = %lld\n", (long long)d->keys->key_size); + printf(" val_size = %lld\n", (long long)d->keys->val_size); + + for (i = 0, j = 0; i < size; i++) { + ep = get_entry(dk, i); + if (ep->hash != DKIX_EMPTY) { + long long hash = ep->hash; + printf(" key="); + for (cp=entry_get_key(dk, ep), k=0; k < d->keys->key_size; ++k, ++cp){ + printf("%02x ", ((int)*cp) & 0xff); + } + printf(" hash=%llu value=", hash); + for (cp=entry_get_val(dk, ep), k=0; k < d->keys->val_size; ++k, ++cp){ + printf("%02x ", ((int)*cp) & 0xff); + } + printf("\n"); + j++; + } + } + printf("j = %lld; n = %lld\n", j, n); + assert(j == n); +} + +size_t +numba_dict_iter_sizeof() { + return sizeof(NB_DictIter); +} + +void +numba_dict_iter(NB_DictIter *it, NB_Dict *d) { + it->parent = d; + it->parent_keys = d->keys; + it->size = d->used; + it->pos = 0; +} + +int +numba_dict_iter_next(NB_DictIter *it, const char **key_ptr, const char **val_ptr) { + /* Detect dictionary mutation during iteration */ + NB_DictKeys *dk; + if (it->parent->keys != it->parent_keys || + it->parent->used != it->size) { + return ERR_DICT_MUTATED; + } + dk = it->parent_keys; + while ( it->pos < dk->nentries ) { + NB_DictEntry *ep = get_entry(dk, it->pos++); + if ( ep->hash != DKIX_EMPTY ) { + *key_ptr = entry_get_key(dk, ep); + *val_ptr = entry_get_val(dk, ep); + return OK; + } + } + return ERR_ITER_EXHAUSTED; +} + +int +numba_dict_insert_ez( + NB_Dict *d, + const char *key_bytes, + Py_hash_t hash, + const char *val_bytes + ) +{ + STACK_ALLOC(char, old, d->keys->val_size); + return numba_dict_insert(d, key_bytes, hash, val_bytes, old); +} + + +/* Allocate a new dictionary with enough space to hold n_keys without resizes */ +int +numba_dict_new_sized(NB_Dict **out, Py_ssize_t n_keys, Py_ssize_t key_size, Py_ssize_t val_size) { + + /* Respect D_MINSIZE */ + if (n_keys <= USABLE_FRACTION(D_MINSIZE)) { + return numba_dict_new(out, D_MINSIZE, key_size, val_size); + } + + /* Adjust for load factor */ + Py_ssize_t size = INV_USABLE_FRACTION(n_keys) - 1; + + /* Round up size to the nearest power of 2. */ + for (unsigned int shift = 1; shift < sizeof(Py_ssize_t) * CHAR_BIT; shift <<= 1) { + size |= (size >> shift); + } + size++; + + /* Handle overflows */ + if (size <= 0) { + return ERR_NO_MEMORY; + } + + return numba_dict_new(out, size, key_size, val_size); +} + + +void +numba_dict_set_method_table(NB_Dict *d, type_based_methods_table *methods) +{ + memcpy(&d->keys->methods, methods, sizeof(type_based_methods_table)); +} + + +#define CHECK(CASE) { \ + if ( !(CASE) ) { \ + printf("'%s' failed file %s:%d\n", #CASE, __FILE__, __LINE__); \ + return 1; \ + } \ +} + +int +numba_test_dict(void) { + NB_Dict *d; + int status; + Py_ssize_t ix; + Py_ssize_t usable; + Py_ssize_t it_count; + const char *it_key, *it_val; + NB_DictIter iter; + +#if defined(_MSC_VER) + /* So that VS2008 compiler is happy */ + char *got_key, *got_value; + got_key = _alloca(4); + got_value = _alloca(8); +#else + char got_key[4]; + char got_value[8]; +#endif + puts("test_dict"); + + status = numba_dict_new(&d, D_MINSIZE, 4, 8); + CHECK(status == OK); + CHECK(d->keys->size == D_MINSIZE); + CHECK(d->keys->key_size == 4); + CHECK(d->keys->val_size == 8); + CHECK(ix_size(d->keys->size) == 1); + printf("aligned_size(index_size * size) = %d\n", (int)(aligned_size(ix_size(d->keys->size) * d->keys->size))); + + printf("d %p\n", d); + printf("d->usable = %u\n", (int)d->keys->usable); + usable = d->keys->usable; + printf("d[0] %d\n", (int)((char*)get_entry(d->keys, 0) - (char*)d->keys)); + CHECK ((char*)get_entry(d->keys, 0) - (char*)d->keys->indices == d->keys->entry_offset); + printf("d[1] %d\n", (int)((char*)get_entry(d->keys, 1) - (char*)d->keys)); + CHECK ((char*)get_entry(d->keys, 1) - (char*)d->keys->indices == d->keys->entry_offset + d->keys->entry_size); + + ix = numba_dict_lookup(d, "bef", 0xbeef, got_value); + printf("ix = %d\n", (int)ix); + CHECK (ix == DKIX_EMPTY); + + // insert 1st key + status = numba_dict_insert(d, "bef", 0xbeef, "1234567", got_value); + CHECK (status == OK); + CHECK (d->used == 1); + CHECK (d->keys->usable == usable - d->used); + + // insert same key + status = numba_dict_insert(d, "bef", 0xbeef, "1234567", got_value); + CHECK (status == OK_REPLACED); + printf("got_value %s\n", got_value); + CHECK (d->used == 1); + CHECK (d->keys->usable == usable - d->used); + + // insert 2nd key + status = numba_dict_insert(d, "beg", 0xbeef, "1234568", got_value); + CHECK (status == OK); + CHECK (d->used == 2); + CHECK (d->keys->usable == usable - d->used); + + // insert 3rd key + status = numba_dict_insert(d, "beh", 0xcafe, "1234569", got_value); + CHECK (status == OK); + CHECK (d->used == 3); + CHECK (d->keys->usable == usable - d->used); + + // replace key "bef"'s value + status = numba_dict_insert(d, "bef", 0xbeef, "7654321", got_value); + CHECK (status == OK_REPLACED); + CHECK (d->used == 3); + CHECK (d->keys->usable == usable - d->used); + + // insert 4th key + status = numba_dict_insert(d, "bei", 0xcafe, "0_0_0_1", got_value); + CHECK (status == OK); + CHECK (d->used == 4); + CHECK (d->keys->usable == usable - d->used); + + // insert 5th key + status = numba_dict_insert(d, "bej", 0xcafe, "0_0_0_2", got_value); + CHECK (status == OK); + CHECK (d->used == 5); + CHECK (d->keys->usable == usable - d->used); + + // insert 6th key & triggers resize + status = numba_dict_insert(d, "bek", 0xcafe, "0_0_0_3", got_value); + CHECK (status == OK); + CHECK (d->used == 6); + CHECK (d->keys->usable == USABLE_FRACTION(d->keys->size) - d->used); + + // Dump + numba_dict_dump(d); + + // Make sure everything are still in there + ix = numba_dict_lookup(d, "bef", 0xbeef, got_value); + CHECK (ix >= 0); + CHECK (memcpy(got_value, "7654321", d->keys->val_size)); + + ix = numba_dict_lookup(d, "beg", 0xbeef, got_value); + CHECK (ix >= 0); + CHECK (memcpy(got_value, "1234567", d->keys->val_size)); + + ix = numba_dict_lookup(d, "beh", 0xcafe, got_value); + printf("ix = %d\n", (int)ix); + CHECK (ix >= 0); + CHECK (memcpy(got_value, "1234569", d->keys->val_size)); + + ix = numba_dict_lookup(d, "bei", 0xcafe, got_value); + CHECK (ix >= 0); + CHECK (memcpy(got_value, "0_0_0_1", d->keys->val_size)); + + ix = numba_dict_lookup(d, "bej", 0xcafe, got_value); + CHECK (ix >= 0); + CHECK (memcpy(got_value, "0_0_0_2", d->keys->val_size)); + + ix = numba_dict_lookup(d, "bek", 0xcafe, got_value); + CHECK (ix >= 0); + CHECK (memcpy(got_value, "0_0_0_3", d->keys->val_size)); + + // Test delete + ix = numba_dict_lookup(d, "beg", 0xbeef, got_value); + status = numba_dict_delitem(d, 0xbeef, ix); + CHECK (status == OK); + + ix = numba_dict_lookup(d, "beg", 0xbeef, got_value); + CHECK (ix == DKIX_EMPTY); // not found + + ix = numba_dict_lookup(d, "bef", 0xbeef, got_value); + CHECK (ix >= 0); + ix = numba_dict_lookup(d, "beh", 0xcafe, got_value); + CHECK (ix >= 0); + + + // Test popitem + // They are always the last item + status = numba_dict_popitem(d, got_key, got_value); + CHECK(status == OK); + CHECK(memcmp("bek", got_key, d->keys->key_size) == 0); + CHECK(memcmp("0_0_0_3", got_value, d->keys->val_size) == 0); + + status = numba_dict_popitem(d, got_key, got_value); + CHECK(status == OK); + CHECK(memcmp("bej", got_key, d->keys->key_size) == 0); + CHECK(memcmp("0_0_0_2", got_value, d->keys->val_size) == 0); + + // Test iterator + CHECK( d->used > 0 ); + numba_dict_iter(&iter, d); + it_count = 0; + while ( (status = numba_dict_iter_next(&iter, &it_key, &it_val)) == OK) { + it_count += 1; // valid items + CHECK(it_key != NULL); + CHECK(it_val != NULL); + } + + CHECK(status == ERR_ITER_EXHAUSTED); + CHECK(d->used == it_count); + + numba_dict_free(d); + + /* numba_dict_new_sized() */ + + Py_ssize_t target_size; + Py_ssize_t n_keys; + + // Test if minsize dict returned with n_keys=0 + target_size = D_MINSIZE; + n_keys = 0; + + numba_dict_new_sized(&d, n_keys, 1, 1); + CHECK(d->keys->size == target_size); + CHECK(d->keys->usable == USABLE_FRACTION(target_size)); + numba_dict_free(d); + + // Test sizing at power of 2 boundary + target_size = D_MINSIZE * 2; + n_keys = USABLE_FRACTION(target_size); + + numba_dict_new_sized(&d, n_keys, 1, 1); + CHECK(d->keys->size == target_size); + CHECK(d->keys->usable == n_keys); + numba_dict_free(d); + + target_size *= 2; + n_keys++; + + numba_dict_new_sized(&d, n_keys, 1, 1); + CHECK(d->keys->size == target_size); + CHECK(d->keys->usable > n_keys); + CHECK(d->keys->usable == USABLE_FRACTION(target_size)); + numba_dict_free(d); + + return 0; + +} + +#undef CHECK diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cext/dictobject.h b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/dictobject.h new file mode 100644 index 0000000000000000000000000000000000000000..82f237a2de1b781cb7a69975fed157b615f09060 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/dictobject.h @@ -0,0 +1,228 @@ +/* Adapted from CPython3.7 Objects/dict-common.h */ +#include "cext.h" + +#ifndef NUMBA_DICT_COMMON_H +#define NUMBA_DICT_COMMON_H + +typedef struct { + /* Uses Py_ssize_t instead of Py_hash_t to guarantee word size alignment */ + Py_ssize_t hash; + char keyvalue[]; +} NB_DictEntry; + + +typedef int (*dict_key_comparator_t)(const char *lhs, const char *rhs); +typedef void (*dict_refcount_op_t)(const void*); + + +typedef struct { + dict_key_comparator_t key_equal; + dict_refcount_op_t key_incref; + dict_refcount_op_t key_decref; + dict_refcount_op_t value_incref; + dict_refcount_op_t value_decref; +} type_based_methods_table; + + +typedef struct { + /* hash table size */ + Py_ssize_t size; + /* Usable size of the hash table. + Also, size of the entries */ + Py_ssize_t usable; + /* hash table used entries */ + Py_ssize_t nentries; + /* Entry info + - key_size is the sizeof key type + - val_size is the sizeof value type + - entry_size is key_size + val_size + alignment + */ + Py_ssize_t key_size, val_size, entry_size; + /* Byte offset from indices to the first entry. */ + Py_ssize_t entry_offset; + + /* Method table for type-dependent operations. */ + type_based_methods_table methods; + + /* hash table */ + char indices[]; +} NB_DictKeys; + + +typedef struct { + /* num of elements in the hashtable */ + Py_ssize_t used; + NB_DictKeys *keys; +} NB_Dict; + + +typedef struct { + /* parent dictionary */ + NB_Dict *parent; + /* parent keys object */ + NB_DictKeys *parent_keys; + /* dict size */ + Py_ssize_t size; + /* iterator position; indicates the next position to read */ + Py_ssize_t pos; +} NB_DictIter; + + + +/* A test function for the dict +Returns 0 for OK; 1 for failure. +*/ +NUMBA_EXPORT_FUNC(int) +numba_test_dict(void); + +/* Allocate a new dict +Parameters +- NB_Dict **out + Output for the new dictionary. +- Py_ssize_t size + Hashtable size. Must be power of two. +- Py_ssize_t key_size + Size of a key entry. +- Py_ssize_t val_size + Size of a value entry. +*/ +NUMBA_EXPORT_FUNC(int) +numba_dict_new(NB_Dict **out, Py_ssize_t size, Py_ssize_t key_size, Py_ssize_t val_size); + +/* Allocate a new dict with enough space to hold n_keys without resizing. +Parameters +- NB_Dict **out + Output for the new dictionary. +- Py_ssize_t n_keys + The number of keys to fit without needing resize. +- Py_ssize_t key_size + Size of a key entry. +- Py_ssize_t val_size + Size of a value entry. +*/ +NUMBA_EXPORT_FUNC(int) +numba_dict_new_sized(NB_Dict** out, Py_ssize_t n_keys, Py_ssize_t key_size, Py_ssize_t val_size); + +/* Free a dict */ +NUMBA_EXPORT_FUNC(void) +numba_dict_free(NB_Dict *d); + +/* Returns length of a dict */ +NUMBA_EXPORT_FUNC(Py_ssize_t) +numba_dict_length(NB_Dict *d); + +/* Set the method table for type specific operations +*/ +NUMBA_EXPORT_FUNC(void) +numba_dict_set_method_table(NB_Dict *d, type_based_methods_table *methods); + +/* Lookup a key + +Parameters +- NB_Dict *d + The dictionary object. +- const char *key_bytes + The key as a byte buffer. +- Py_hash_t hash + The precomputed hash of the key. +- char *oldval_bytes + An output parameter to store the associated value if the key is found. + Must point to memory of sufficient size to store the value. +*/ +NUMBA_EXPORT_FUNC(Py_ssize_t) +numba_dict_lookup(NB_Dict *d, const char *key_bytes, Py_hash_t hash, char *oldval_bytes); + +/* Resize the dict to at least *minsize*. +*/ +NUMBA_EXPORT_FUNC(int) +numba_dict_resize(NB_Dict *d, Py_ssize_t minsize); + +/* Insert to the dict + +Parameters +- NB_Dict *d + The dictionary object. +- const char *key_bytes + The key as a byte buffer. +- Py_hash_t hash + The precomputed hash of key. +- const char *val_bytes + The value as a byte buffer. +- char *oldval_bytes + An output buffer to store the replaced value. + Must point to memory of sufficient size to store the value. + +Returns +- < 0 for error +- 0 for ok +- 1 for ok and oldval_bytes has a copy of the replaced value. +*/ +NUMBA_EXPORT_FUNC(int) +numba_dict_insert(NB_Dict *d, const char *key_bytes, Py_hash_t hash, const char *val_bytes, char *oldval_bytes); + +/* Same as numba_dict_insert() but oldval_bytes is not needed */ +NUMBA_EXPORT_FUNC(int) +numba_dict_insert_ez(NB_Dict *d, const char *key_bytes, Py_hash_t hash, const char *val_bytes); + +/* Delete an entry from the dict +Parameters +- NB_Dict *d + The dictionary +- Py_hash_t hash + Precomputed hash of the key to be deleted +- Py_ssize_t ix + Precomputed entry index of the key to be deleted. + Usually results of numba_dict_lookup(). +*/ +NUMBA_EXPORT_FUNC(int) +numba_dict_delitem(NB_Dict *d, Py_hash_t hash, Py_ssize_t ix); + +/* Remove an item from the dict +Parameters +- NB_Dict *d + The dictionary +- char *key_bytes + Output. The key as a byte buffer +- char *val_bytes + Output. The value as a byte buffer +*/ +NUMBA_EXPORT_FUNC(int) +numba_dict_popitem(NB_Dict *d, char *key_bytes, char *val_bytes); + +/* Returns the sizeof a dictionary iterator +*/ +NUMBA_EXPORT_FUNC(size_t) +numba_dict_iter_sizeof(void); + +/* Fill a NB_DictIter for a dictionary to begin iteration +Parameters +- NB_DictIter *it + Output. Must points to memory of size at least `numba_dict_iter_sizeof()`. +- NB_Dict *d + The dictionary to be iterated. +*/ +NUMBA_EXPORT_FUNC(void) +numba_dict_iter(NB_DictIter *it, NB_Dict *d); + +/* Advance the iterator +Parameters +- NB_DictIter *it + The iterator +- const char **key_ptr + Output pointer for the key. Points to data in the dictionary. +- const char **val_ptr + Output pointer for the key. Points to data in the dictionary. + +Returns +- 0 for success; valid key_ptr and val_ptr +- ERR_ITER_EXHAUSTED for end of iterator. +- ERR_DICT_MUTATED for detected dictionary mutation. +*/ +NUMBA_EXPORT_FUNC(int) +numba_dict_iter_next(NB_DictIter *it, const char **key_ptr, const char **val_ptr); + + +NUMBA_EXPORT_FUNC(void) +numba_dict_dump(NB_Dict *); + +#endif diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cext/listobject.c b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/listobject.c new file mode 100644 index 0000000000000000000000000000000000000000..9de03f5ff1d61b73bf6e4a340d51388bc09f2bc9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/listobject.c @@ -0,0 +1,977 @@ +#include "listobject.h" + +/* This implements the C component of the Numba typed list. It is loosely + * inspired by the list implementation of the cpython list with some parts + * taken from the cpython slice implementation. The exact commit-id of the + * relevant files are: + * + * https://github.com/python/cpython/blob/51ddab8dae056867f3595ab3400bffc93f67c8d4/Objects/listobject.c + * https://github.com/python/cpython/blob/51ddab8dae056867f3595ab3400bffc93f67c8d4/Objects/sliceobject.c + * + * Algorithmically, this list is very similar to the cpython implementation so + * it should have the same performance (Big-O) characteristics for accessing, + * adding and removing elements/items. Specifically, it implements the same + * algorithms for list overallocation and growth. However, it never deals with + * PyObject types and instead must be typed with a type-size. As a result, the + * typed-list is type homogeneous and in contrast to the cpython version can + * not store a mixture of arbitrarily typed objects. Reference counting via the + * Numba Runtime (NRT) is supported and incrementing and decrementing functions + * are store as part of the struct and can be setup from the compiler level. + * + * Importantly, only a very limited subset of the cpython c functions have been + * ported over and the rest have been implemented (in Python) at the compiler + * level using the c functions provided. Additionally, initialization of, and + * iteration over, a ListIter is provided + * + * The following functions are implemented for the list: + * + * - Check valid index valid_index + * - Creation numba_list_new + * - Deletion numba_list_free + * - Accessing the length numba_list_length + * - Appending to the list numba_list_append + * - Getting an item numba_list_setitem + * - Setting an item numba_list_getitem + * - Resizing the list numba_list_resize + * - Deleting an item numba_list_delitem + * - Deleting a slice numba_list_delete_slice + * + * As you can see, only a single function for slices is implemented. The rest + * is all done entirely at the compiler level which then calls the c functions + * to mutate the list accordingly. Since slicing allows for replace, insert and + * delete operations over multiple items, we can simply implement those using + * the basic functions above. + * + * The following additional functions are implemented for the list, these are + * needed to make the list work within Numba. + * + * - Accessing the allocation numba_list_allocated + * - Copying an item copy_item + * - Calling incref on item list_incref_item + * - Calling decref on item list_decref_item + * - Set method table numba_list_set_method_table + * + * The following functions are implemented for the iterator: + * + * - Size of the iterator numba_list_iter_size + * - Initialization of iter numba_list_iter + * - Get next item from iter numba_list_iter_next + * + * Two methods are provided to query and set the 'is_mutable': + * + * - Query numba_list_is_mutable + * - Set numba_list_set_is_mutable + * + * Lastly a set of pure C level tests are provided which come in handy when + * needing to use valgrind and friends. + * + */ + + +/* Return status for the list functions. + */ +typedef enum { + LIST_OK = 0, + LIST_ERR_INDEX = -1, + LIST_ERR_NO_MEMORY = -2, + LIST_ERR_MUTATED = -3, + LIST_ERR_ITER_EXHAUSTED = -4, + LIST_ERR_IMMUTABLE = -5, +} ListStatus; + +/* Copy an item from a list. + * + * lp: a list + * dst: destination pointer + * src: source pointer + */ +static void +copy_item(NB_List *lp, char *dst, const char *src){ + memcpy(dst, src, lp->item_size); +} + +/* Increment a reference to an item in a list. + * + * lp: a list + * item: the item to increment the reference for + */ +static void +list_incref_item(NB_List *lp, const char *item){ + if (lp->methods.item_incref) { + lp->methods.item_incref(item); + } +} + +/* Decrement a reference to an item in a list. + * + * lp: a list + * item: the item to decrement the reference for + */ +static void +list_decref_item(NB_List *lp, const char *item){ + if (lp->methods.item_decref) { + lp->methods.item_decref(item); + } +} + +/* Setup the method table for a list. + * + * This function is used from the compiler level to initialize the internal + * method table. + * + * lp: a list + * methods: the methods table to set up + */ +void +numba_list_set_method_table(NB_List *lp, list_type_based_methods_table *methods) +{ + memcpy(&lp->methods, methods, sizeof(list_type_based_methods_table)); +} + +/* Check if a list index is valid. + * + * i: the index to check + * limit: the size of a list + * + * Adapted from CPython's valid_index(). + * + * FIXME: need to find a way to inline this, even for Python 2.7 on Windows + */ +static int +valid_index(Py_ssize_t i, Py_ssize_t limit){ + /* The cast to size_t lets us use just a single comparison + to check whether i is in the range: 0 <= i < limit. + + See: Section 14.2 "Bounds Checking" in the Agner Fog + optimization manual found at: + https://www.agner.org/optimize/optimizing_cpp.pdf + */ + return (size_t) i < (size_t) limit; +} + +/* Initialize a new list. + * + * out: pointer to hold an initialized list + * item_size: the size in bytes of the items in the list + * allocated: preallocation of the list in items + * + * This will allocate sufficient memory to hold the list structure and any + * items if requested (allocated != 0). See _listobject.h for more information + * on the NB_List struct. + */ +int +numba_list_new(NB_List **out, Py_ssize_t item_size, Py_ssize_t allocated){ + NB_List *lp; + char *items; + // allocate memory to hold the struct + lp = malloc(aligned_size(sizeof(NB_List))); + if (lp == NULL) { + return LIST_ERR_NO_MEMORY; + } + // set up members + lp->size = 0; + lp->item_size = item_size; + lp->allocated = allocated; + lp->is_mutable = 1; + // set method table to zero */ + memset(&lp->methods, 0x00, sizeof(list_type_based_methods_table)); + // allocate memory to hold items, if requested + if (allocated != 0) { + items = malloc(aligned_size(lp->item_size * allocated)); + // allocated was definitely not zero, if malloc returns NULL + // this is definitely an error + if (items == NULL) { + // free previously allocated struct to avoid leaking memory + free(lp); + return LIST_ERR_NO_MEMORY; + } + lp->items = items; + } + else { + // be explicit + lp->items = NULL; + } + *out = lp; + return LIST_OK; +} + +/* Free the memory associated with a list. + * + * lp: a list + */ +void +numba_list_free(NB_List *lp) { + // decref all items, if needed + Py_ssize_t i; + if (lp->methods.item_decref) { + for (i = 0; i < lp->size; i++) { + char *item = lp->items + lp->item_size * i; + list_decref_item(lp, item); + } + } + // free items and list + if (lp->items != NULL) { + free(lp->items); + } + free(lp); +} + +/* Return the base pointer of the list items. + */ +char * +numba_list_base_ptr(NB_List *lp) +{ + return lp->items; +} + +/* Return the address of the list size. + */ +Py_ssize_t +numba_list_size_address(NB_List *lp) +{ + return (Py_ssize_t)&lp->size; +} + + +/* Return the length of a list. + * + * lp: a list + */ +Py_ssize_t +numba_list_length(NB_List *lp) { + return lp->size; +} + +/* Return the current allocation of a list. + * + * lp: a list + */ +Py_ssize_t +numba_list_allocated(NB_List *lp) { + return lp->allocated; +} + +/* Return the mutability status of the list + * + * lp: a list + * + */ +int +numba_list_is_mutable(NB_List *lp){ + return lp->is_mutable; +} + +/* Set the is_mutable attribute + * + * lp: a list + * is_mutable: an int, 0(False) or 1(True) + * + */ +void +numba_list_set_is_mutable(NB_List *lp, int is_mutable){ + lp->is_mutable = is_mutable; +} + +/* Set an item in a list. + * + * lp: a list + * index: the index of the item to set (must be in range 0 <= index < len(list)) + * item: the item to set + * + * This assume there is already an element at the given index that will be + * overwritten and thereby have its reference decremented. DO NOT use this to + * write to an unassigned location. + */ +int +numba_list_setitem(NB_List *lp, Py_ssize_t index, const char *item) { + char *loc; + // check for mutability + if (!lp->is_mutable) { + return LIST_ERR_IMMUTABLE; + } + // check index is valid + // FIXME: this can be (and probably is) checked at the compiler level + if (!valid_index(index, lp->size)) { + return LIST_ERR_INDEX; + } + // set item at desired location + loc = lp->items + lp-> item_size * index; + list_decref_item(lp, loc); + copy_item(lp, loc, item); + list_incref_item(lp, loc); + return LIST_OK; +} + +/* Get an item from a list. + * + * lp: a list + * index: the index of the item to get (must be in range 0 <= index < len(list)) + * out: a pointer to hold the item + */ +int +numba_list_getitem(NB_List *lp, Py_ssize_t index, char *out) { + char *loc; + // check index is valid + // FIXME: this can be (and probably is) checked at the compiler level + if (!valid_index(index, lp->size)) { + return LIST_ERR_INDEX; + } + // get item at desired location + loc = lp->items + lp->item_size * index; + copy_item(lp, out, loc); + return LIST_OK; +} + +/* Append an item to the end of a list. + * + * lp: a list + * item: the item to append. + */ +int +numba_list_append(NB_List *lp, const char *item) { + char *loc; + // check for mutability + if (!lp->is_mutable) { + return LIST_ERR_IMMUTABLE; + } + // resize by one, will change list size + int result = numba_list_resize(lp, lp->size + 1); + if(result < LIST_OK) { + return result; + } + // insert item at index: original size before resize + loc = lp->items + lp->item_size * (lp->size - 1); + copy_item(lp, loc, item); + list_incref_item(lp, loc); + return LIST_OK; +} + +/* Resize a list. + * + * lp: a list + * newsize: the desired new size of the list. + * + * This will increase or decrease the size of the list, including reallocating + * the required memory and increasing the total allocation (additional free + * space to hold new items). + * + * + * Adapted from CPython's list_resize(). + * + * Ensure lp->items has room for at least newsize elements, and set + * lp->size to newsize. If newsize > lp->size on entry, the content + * of the new slots at exit is undefined heap trash; it's the caller's + * responsibility to overwrite them with sane values. + * The number of allocated elements may grow, shrink, or stay the same. + * Failure is impossible if newsize <= lp->allocated on entry, although + * that partly relies on an assumption that the system realloc() never + * fails when passed a number of bytes <= the number of bytes last + * allocated (the C standard doesn't guarantee this, but it's hard to + * imagine a realloc implementation where it wouldn't be true). + * Note that lp->items may change, and even if newsize is less + * than lp->size on entry. + */ +int +numba_list_resize(NB_List *lp, Py_ssize_t newsize) { + char * items; + // check for mutability + if (!lp->is_mutable) { + return LIST_ERR_IMMUTABLE; + } + size_t new_allocated, num_allocated_bytes; + /* Bypass realloc() when a previous overallocation is large enough + to accommodate the newsize. If the newsize falls lower than half + the allocated size, then proceed with the realloc() to shrink the list. + */ + if (lp->allocated >= newsize && newsize >= (lp->allocated >> 1)) { + assert(lp->items != NULL || newsize == 0); + lp->size = newsize; + return LIST_OK; + } + /* This over-allocates proportional to the list size, making room + * for additional growth. The over-allocation is mild, but is + * enough to give linear-time amortized behavior over a long + * sequence of appends() in the presence of a poorly-performing + * system realloc(). + * The growth pattern is: 0, 4, 8, 16, 25, 35, 46, 58, 72, 88, ... + * Note: new_allocated won't overflow because the largest possible value + * is PY_SSIZE_T_MAX * (9 / 8) + 6 which always fits in a size_t. + */ + new_allocated = (size_t)newsize + (newsize >> 3) + (newsize < 9 ? 3 : 6); + if (new_allocated > (size_t)PY_SSIZE_T_MAX / lp->item_size) { + return LIST_ERR_NO_MEMORY; + } + + if (newsize == 0) + new_allocated = 0; + num_allocated_bytes = new_allocated * lp->item_size; + items = realloc(lp->items, aligned_size(num_allocated_bytes)); + // realloc may return NULL if requested size is 0 + if (num_allocated_bytes != 0 && items == NULL) { + return LIST_ERR_NO_MEMORY; + } + lp->items = items; + lp->size = newsize; + lp->allocated = (Py_ssize_t)new_allocated; + return LIST_OK; +} + +/* Delete a single item. + * + * lp: a list + * index: the index of the item to delete + * (must be in range 0 <= index < len(list)) + * + * */ +int +numba_list_delitem(NB_List *lp, Py_ssize_t index) { + int result; + char *loc, *new_loc; + Py_ssize_t leftover_bytes; + // check for mutability + if (!lp->is_mutable) { + return LIST_ERR_IMMUTABLE; + } + // check index is valid + // FIXME: this can be (and probably is) checked at the compiler level + if (!valid_index(index, lp->size)) { + return LIST_ERR_INDEX; + } + // obtain item and decref if needed + loc = lp->items + lp->item_size * index; + list_decref_item(lp, loc); + if (index != lp->size - 1) { + // delitem from somewhere other than the end, incur the memory copy + leftover_bytes = (lp->size - 1 - index) * lp->item_size; + new_loc = lp->items + (lp->item_size * (index + 1)); + // use memmove instead of memcpy since we may be dealing with + // overlapping regions of memory and the behaviour of memcpy is + // undefined in such situation (C99). + memmove(loc, new_loc, leftover_bytes); + } + // finally, shrink list by one + result = numba_list_resize(lp, lp->size - 1); + if(result < LIST_OK) { + // Since we are decreasing the size, this should never happen + return result; + } + return LIST_OK; + +} + +/* Delete a slice + * + * start: the start index of ths slice + * stop: the stop index of the slice (not included) + * step: the step to take + * + * This function assumes that the start and stop were clipped appropriately. + * I.e. if step > 0 start >= 0 and stop <= len(l) and + * if step < 0 start <= length and stop >= -1 + * step != 0 and no Python negative indexing allowed. + * + * This code was copied and edited from the relevant section in + * list_ass_subscript from the cpython implementation, see the top of this file + * for the exact source + */ +int +numba_list_delete_slice(NB_List *lp, + Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step) { + int result, i, slicelength, new_length; + char *loc, *new_loc; + Py_ssize_t leftover_bytes, cur, lim; + // check for mutability + if (!lp->is_mutable) { + return LIST_ERR_IMMUTABLE; + } + // calculate the slicelength, taken from PySlice_AdjustIndices, see the top + // of this file for the exact source + if (step > 0) { + slicelength = start < stop ? (stop - start - 1) / step + 1 : 0; + } else { + slicelength = stop < start ? (start - stop - 1) / -step + 1 : 0; + } + if (slicelength <= 0){ + return LIST_OK; + } + new_length = lp->size - slicelength; + // reverse step and indices + if (step < 0) { + stop = start + 1; + start = stop + step * (slicelength - 1) - 1; + step = -step; + } + if (step == 1) { + // decref if needed + if (lp->methods.item_decref) { + for (i = start ; i < stop ; i++){ + loc = lp->items + lp->item_size * i; + lp->methods.item_decref(loc); + } + } + // memmove items into place + leftover_bytes = (lp->size - stop) * lp->item_size; + loc = lp->items + lp->item_size * start; + new_loc = lp->items + lp->item_size * stop; + memmove(loc, new_loc, leftover_bytes); + } + else { // step != 1 + /* drawing pictures might help understand these for + * loops. Basically, we memmove the parts of the + * list that are *not* part of the slice: step-1 + * items for each item that is part of the slice, + * and then tail end of the list that was not + * covered by the slice + * + * */ + for (cur = start, // index of item to be deleted + i = 0; // counter of total items deleted so far + cur < stop; + cur += step, + i++) { + lim = step - 1; // number of leftover items after deletion of item + // clip limit, in case we are at the end of the slice, and there + // are now less than step-1 items to be moved + if (cur + step >= lp->size) { + lim = lp->size - cur - 1; + } + // decref item being removed + loc = lp->items + lp->item_size * cur; + list_decref_item(lp, loc); + /* memmove the aforementioned step-1 (or less) items + * dst : index of deleted item minus total deleted sofar + * src : index of deleted item plus one (next item) + */ + memmove(lp->items + lp->item_size * (cur - i), + lp->items + lp->item_size * (cur + 1), + lim * lp->item_size); + } + // memmove tail of the list + cur = start + slicelength * step; + if (cur < lp->size) { + memmove(lp->items + lp->item_size * (cur - slicelength), + lp->items + lp->item_size * cur, + (lp->size - cur) * lp->item_size); + } + } + // resize to correct size + result = numba_list_resize(lp, new_length); + if(result < LIST_OK) { + // Since we are decreasing the size, this should never happen + return result; + } + return LIST_OK; +} + + +/* Return the size of the list iterator (NB_ListIter) struct. + */ +size_t +numba_list_iter_sizeof() { + return sizeof(NB_ListIter); +} + +/* Initialize a list iterator (NB_ListIter). + * + * it: an iterator + * lp: a list to iterate over + */ +void +numba_list_iter(NB_ListIter *it, NB_List *lp) { + // set members of iterator + it->parent = lp; + it->size = lp->size; + it->pos = 0; +} + +/* Obtain the next item from a list iterator. + * + * it: an iterator + * item_ptr: pointer to hold the next item + */ +int +numba_list_iter_next(NB_ListIter *it, const char **item_ptr) { + NB_List *lp; + lp = it->parent; + /* FIXME: Detect list mutation during iteration */ + if (lp->size != it->size) { + return LIST_ERR_MUTATED; + } + // get next element + if (it->pos < lp->size) { + *item_ptr = lp->items + lp->item_size * it->pos++; + return LIST_OK; + }else{ + return LIST_ERR_ITER_EXHAUSTED; + } +} + + +#define CHECK(CASE) { \ + if ( !(CASE) ) { \ + printf("'%s' failed file %s:%d\n", #CASE, __FILE__, __LINE__); \ + return -1; \ + } \ +} + +/* Basic C based tests for the list. + */ +int +numba_test_list(void) { + NB_List *lp = NULL; + int status, i; + Py_ssize_t it_count; + const char *it_item = NULL; + NB_ListIter iter; + char got_item[4] = "\x00\x00\x00\x00"; + const char *test_items_1 = NULL, *test_items_2 = NULL; + char *test_items_3 = NULL; + puts("test_list"); + + + status = numba_list_new(&lp, 4, 0); + CHECK(status == LIST_OK); + CHECK(lp->item_size == 4); + CHECK(lp->size == 0); + CHECK(lp->allocated == 0); + CHECK(lp->is_mutable == 1); + + // flip and check the is_mutable bit + CHECK(numba_list_is_mutable(lp) == 1); + numba_list_set_is_mutable(lp, 0); + CHECK(numba_list_is_mutable(lp) == 0); + numba_list_set_is_mutable(lp, 1); + CHECK(numba_list_is_mutable(lp) == 1); + + // append 1st item, this will cause a realloc + status = numba_list_append(lp, "abc"); + CHECK(status == LIST_OK); + CHECK(lp->size == 1); + CHECK(lp->allocated == 4); + status = numba_list_getitem(lp, 0, got_item); + CHECK(status == LIST_OK); + CHECK(memcmp(got_item, "abc", 4) == 0); + + // append 2nd item + status = numba_list_append(lp, "def"); + CHECK(status == LIST_OK); + CHECK(lp->size == 2); + CHECK(lp->allocated == 4); + status = numba_list_getitem(lp, 1, got_item); + CHECK(status == LIST_OK); + CHECK(memcmp(got_item, "def", 4) == 0); + + // append 3rd item + status = numba_list_append(lp, "ghi"); + CHECK(status == LIST_OK); + CHECK(lp->size == 3); + CHECK(lp->allocated == 4); + status = numba_list_getitem(lp, 2, got_item); + CHECK(status == LIST_OK); + CHECK(memcmp(got_item, "ghi", 4) == 0); + + // append 4th item + status = numba_list_append(lp, "jkl"); + CHECK(status == LIST_OK); + CHECK(lp->size == 4); + CHECK(lp->allocated == 4); + status = numba_list_getitem(lp, 3, got_item); + CHECK(status == LIST_OK); + CHECK(memcmp(got_item, "jkl", 4) == 0); + + // append 5th item, this will cause another realloc + status = numba_list_append(lp, "mno"); + CHECK(status == LIST_OK); + CHECK(lp->size == 5); + CHECK(lp->allocated == 8); + status = numba_list_getitem(lp, 4, got_item); + CHECK(status == LIST_OK); + CHECK(memcmp(got_item, "mno", 4) == 0); + + // overwrite 1st item + status = numba_list_setitem(lp, 0, "pqr"); + CHECK(status == LIST_OK); + CHECK(lp->size == 5); + CHECK(lp->allocated == 8); + status = numba_list_getitem(lp, 0, got_item); + CHECK(status == LIST_OK); + CHECK(memcmp(got_item, "pqr", 4) == 0); + + // get and del 1st item, check item shift + status = numba_list_getitem(lp, 0, got_item); + status = numba_list_delitem(lp, 0); + CHECK(status == LIST_OK); + CHECK(lp->size == 4); + CHECK(lp->allocated == 8); + CHECK(memcmp(got_item, "pqr", 4) == 0); + CHECK(memcmp(lp->items, "def\x00ghi\x00jkl\x00mno\x00", 16) == 0); + + // get and del last (4th) item, no shift since only last item affected + status = numba_list_getitem(lp, 3, got_item); + status = numba_list_delitem(lp, 3); + CHECK(status == LIST_OK); + CHECK(lp->size == 3); + CHECK(lp->allocated == 6); // this also shrinks the allocation + CHECK(memcmp(got_item, "mno", 4) == 0); + CHECK(memcmp(lp->items, "def\x00ghi\x00jkl\x00", 12) == 0); + + // flip and check the is_mutable member + CHECK(numba_list_is_mutable(lp) == 1); + numba_list_set_is_mutable(lp, 0); + CHECK(numba_list_is_mutable(lp) == 0); + + // ensure that any attempts to mutate an immutable list fail + CHECK(numba_list_setitem(lp, 0, "zzz") == LIST_ERR_IMMUTABLE); + CHECK(numba_list_append(lp, "zzz") == LIST_ERR_IMMUTABLE); + CHECK(numba_list_delitem(lp, 0) == LIST_ERR_IMMUTABLE); + CHECK(numba_list_resize(lp, 23) == LIST_ERR_IMMUTABLE); + CHECK(numba_list_delete_slice(lp, 0, 3, 1) == LIST_ERR_IMMUTABLE); + + // ensure that all attempts to query/read from and immutable list succeed + CHECK(numba_list_length(lp) == 3); + status = numba_list_getitem(lp, 0, got_item); + CHECK(status == LIST_OK); + CHECK(memcmp(got_item, "def", 4) == 0); + + // flip the is_mutable member back and check + numba_list_set_is_mutable(lp, 1); + CHECK(numba_list_is_mutable(lp) == 1); + + // test iterator + CHECK(lp->size > 0); + numba_list_iter(&iter, lp); + it_count = 0; + CHECK(iter.parent == lp); + CHECK(iter.pos == it_count); + + // current contents of list + test_items_1 = "def\x00ghi\x00jkl\x00"; + while ( (status = numba_list_iter_next(&iter, &it_item)) == LIST_OK) { + it_count += 1; + CHECK(iter.pos == it_count); // check iterator position + CHECK(it_item != NULL); // quick check item is non-null + // go fishing in test_items_1 + CHECK(memcmp((const char *)test_items_1 + ((it_count - 1) * 4), it_item, 4) == 0); + } + + CHECK(status == LIST_ERR_ITER_EXHAUSTED); + CHECK(lp->size == it_count); + + // free existing list + numba_list_free(lp); + + // test growth upon append and shrink during delitem + status = numba_list_new(&lp, 1, 0); + CHECK(status == LIST_OK); + CHECK(lp->item_size == 1); + CHECK(lp->size == 0); + CHECK(lp->allocated == 0); + + // first, grow the list + // Use exactly 17 elements, should go through the allocation pattern: + // 0, 4, 8, 16, 25 + for (i = 0; i < 17 ; i++) { + switch(i) { + // Check the allocation before + case 0: CHECK(lp->allocated == 0); break; + case 4: CHECK(lp->allocated == 4); break; + case 8: CHECK(lp->allocated == 8); break; + case 16: CHECK(lp->allocated == 16); break; + } + status = numba_list_append(lp, (const char*)&i); + CHECK(status == LIST_OK); + switch(i) { + // Check that the growth happened accordingly + case 0: CHECK(lp->allocated == 4); break; + case 4: CHECK(lp->allocated == 8); break; + case 8: CHECK(lp->allocated == 16); break; + case 16: CHECK(lp->allocated == 25); break; + } + } + CHECK(lp->size == 17); + + // Check current contents of list + test_items_2 = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"; + CHECK(memcmp(lp->items, test_items_2, 17) == 0); + + // Now, delete them again and check that list shrinks + for (i = 17; i > 0 ; i--) { + switch(i) { + // Check the allocation before delitem + case 17: CHECK(lp->allocated == 25); break; + case 12: CHECK(lp->allocated == 25); break; + case 9: CHECK(lp->allocated == 18); break; + case 6: CHECK(lp->allocated == 12); break; + case 4: CHECK(lp->allocated == 8); break; + case 3: CHECK(lp->allocated == 6); break; + case 2: CHECK(lp->allocated == 5); break; + case 1: CHECK(lp->allocated == 4); break; + } + status = numba_list_getitem(lp, i-1, got_item); + status = numba_list_delitem(lp, i-1); + CHECK(status == LIST_OK); + switch(i) { + // Check that the shrink happened accordingly + case 17: CHECK(lp->allocated == 25); break; + case 12: CHECK(lp->allocated == 18); break; + case 9: CHECK(lp->allocated == 12); break; + case 6: CHECK(lp->allocated == 8); break; + case 4: CHECK(lp->allocated == 6); break; + case 3: CHECK(lp->allocated == 5); break; + case 2: CHECK(lp->allocated == 4); break; + case 1: CHECK(lp->allocated == 0); break; + } + } + // free existing list + numba_list_free(lp); + + + // Setup list for testing delete_slice + status = numba_list_new(&lp, 1, 0); + CHECK(status == LIST_OK); + CHECK(lp->item_size == 1); + CHECK(lp->size == 0); + CHECK(lp->allocated == 0); + for (i = 0; i < 17 ; i++) { + status = numba_list_append(lp, (const char*)&i); + CHECK(status == LIST_OK); + } + CHECK(lp->size == 17); + test_items_3 = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"; + CHECK(memcmp(lp->items, test_items_3, 17) == 0); + + // delete multiple elements from the middle + status = numba_list_delete_slice(lp, 2, 5, 1); + CHECK(status == LIST_OK); + CHECK(lp->size == 14); + test_items_3 = "\x00\x01\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"; + CHECK(memcmp(lp->items, test_items_3, 14) == 0); + + // delete single element from start + status = numba_list_delete_slice(lp, 0, 1, 1); + CHECK(status == LIST_OK); + CHECK(lp->size == 13); + test_items_3 = "\x01\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"; + CHECK(memcmp(lp->items, test_items_3, 13) == 0); + + // delete single element from end + status = numba_list_delete_slice(lp, 12, 13, 1); + CHECK(status == LIST_OK); + CHECK(lp->size == 12); + test_items_3 = "\x01\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"; + CHECK(memcmp(lp->items, test_items_3, 12) == 0); + + // delete single element from middle + status = numba_list_delete_slice(lp, 4, 5, 1); + CHECK(status == LIST_OK); + CHECK(lp->size == 11); + test_items_3 = "\x01\x05\x06\x07\x09\x0a\x0b\x0c\x0d\x0e\x0f"; + CHECK(memcmp(lp->items, test_items_3, 11) == 0); + + // delete all elements except first and last + status = numba_list_delete_slice(lp, 1, 10, 1); + CHECK(status == LIST_OK); + CHECK(lp->size == 2); + test_items_3 = "\x01\x0f"; + CHECK(memcmp(lp->items, test_items_3, 2) == 0); + + // delete all remaining elements + status = numba_list_delete_slice(lp, 0, lp->size, 1); + CHECK(status == LIST_OK); + CHECK(lp->size == 0); + test_items_3 = ""; + CHECK(memcmp(lp->items, test_items_3, 0) == 0); + + // free existing list + numba_list_free(lp); + + // Setup list for testing delete_slice with non unary step + status = numba_list_new(&lp, 1, 0); + CHECK(status == LIST_OK); + CHECK(lp->item_size == 1); + CHECK(lp->size == 0); + CHECK(lp->allocated == 0); + for (i = 0; i < 17 ; i++) { + status = numba_list_append(lp, (const char*)&i); + CHECK(status == LIST_OK); + } + CHECK(lp->size == 17); + + // delete all items with odd index + status = numba_list_delete_slice(lp, 0, 17, 2); + CHECK(status == LIST_OK); + CHECK(lp->size == 8); + test_items_3 = "\x01\x03\x05\x07\x09\x0b\x0d\x0f"; + CHECK(memcmp(lp->items, test_items_3, 8) == 0); + + // delete with a step of 4, starting at index 1 + status = numba_list_delete_slice(lp, 1, 8, 4); + CHECK(status == LIST_OK); + CHECK(lp->size == 6); + test_items_3 = "\x01\x05\x07\x09\x0d\x0f"; + CHECK(memcmp(lp->items, test_items_3, 6) == 0); + + // delete with a step of 2, but finish before end of list + status = numba_list_delete_slice(lp, 0, 4, 2); + CHECK(status == LIST_OK); + CHECK(lp->size == 4); + test_items_3 = "\x05\x09\x0d\x0f"; + CHECK(memcmp(lp->items, test_items_3, 4) == 0); + + // no-op on empty slice + status = numba_list_delete_slice(lp, 0, 0, 1); + CHECK(status == LIST_OK); + CHECK(lp->size == 4); + test_items_3 = "\x05\x09\x0d\x0f"; + CHECK(memcmp(lp->items, test_items_3, 4) == 0); + + // no-op on empty slice, non-zero index + status = numba_list_delete_slice(lp, 2, 2, 1); + CHECK(status == LIST_OK); + CHECK(lp->size == 4); + test_items_3 = "\x05\x09\x0d\x0f"; + CHECK(memcmp(lp->items, test_items_3, 4) == 0); + + // free list and return 0 + numba_list_free(lp); + + // Setup list for testing delete_slice with negative step + status = numba_list_new(&lp, 1, 0); + CHECK(status == LIST_OK); + CHECK(lp->item_size == 1); + CHECK(lp->size == 0); + CHECK(lp->allocated == 0); + for (i = 0; i < 17 ; i++) { + status = numba_list_append(lp, (const char*)&i); + CHECK(status == LIST_OK); + } + CHECK(lp->size == 17); + + // delete all items using unary negative slice + status = numba_list_delete_slice(lp, 16, -1, -1); + CHECK(status == LIST_OK); + CHECK(lp->size == 0); + + // refill list + for (i = 0; i < 17 ; i++) { + status = numba_list_append(lp, (const char*)&i); + CHECK(status == LIST_OK); + } + + // delete all items using unary negative slice + // need to start at index of last item (16) and + // go beyond first item, i.e. -1 in Cd + status = numba_list_delete_slice(lp, 16, -1, -2); + CHECK(status == LIST_OK); + CHECK(lp->size == 8); + test_items_3 = "\x01\x03\x05\x07\x09\x0b\x0d\x0f"; + CHECK(memcmp(lp->items, test_items_3, 8) == 0); + + // free list and return 0 + numba_list_free(lp); + return 0; + + +} + +#undef CHECK diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cext/listobject.h b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/listobject.h new file mode 100644 index 0000000000000000000000000000000000000000..099840ac24c139a30055fd78c9dfc9321348b8da --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/listobject.h @@ -0,0 +1,137 @@ +/* Adapted from CPython3.7 Include/listobject.h + * + * The exact commit-id of the relevant file is: + * + * https://github.com/python/cpython/blob/51ddab8dae056867f3595ab3400bffc93f67c8d4/Include/listobject.h + * + * WARNING: + * Most interfaces listed here are exported (global), but they are not + * supported, stable, or part of Numba's public API. These interfaces and their + * underlying implementations may be changed or removed in future without + * notice. + * */ + +#ifndef NUMBA_LIST_H +#define NUMBA_LIST_H + +#include "cext.h" + +typedef void (*list_refcount_op_t)(const void*); + +typedef struct { + list_refcount_op_t item_incref; + list_refcount_op_t item_decref; +} list_type_based_methods_table; + +/* This is the struct for the Numba typed list. It is largely inspired by the + * CPython list struct in listobject.h. In essence the list is a homogeneously + * typed container that can grow and shrink upon insertion and deletion. This + * means that appending an item to, or removing an item from, the end of the + * list, this will have a O(1) amortized runtime. This matches the + * behaviour of the CPython list type and it will grow with the same + * increments. + * + * 'items' contains space for 'allocated' elements. The number + * currently in use is 'size'. The size in bytes of the items stored in the + * list is given by 'item_size'. + * + * Invariants: + * 0 <= size <= allocated + * len(list) == size + * item == NULL implies size == allocated == 0 + * + * FIXME: list.sort() temporarily sets allocated to -1 to detect mutations. + * + * Items must normally not be NULL, except during construction when + * the list is not yet visible outside the function that builds it. + * + * Additionally, this list has boolean member 'is_mutable' that can be used to + * set a list as immutable. Two functions to query and set this member are + * provided. Any attempt to mutate an immutable list will result in a status + * of LIST_ERR_IMMUTABLE. + * + */ +typedef struct { + /* size of the list in items */ + Py_ssize_t size; + /* size of the list items in bytes */ + Py_ssize_t item_size; + /* total allocated slots in items */ + Py_ssize_t allocated; + /* is the list mutable */ + int is_mutable; + /* method table for type-dependent operations */ + list_type_based_methods_table methods; + /* array/pointer for items. Interpretation is governed by item_size */ + char * items; +} NB_List; + + +typedef struct { + /* parent list */ + NB_List *parent; + /* list size */ + Py_ssize_t size; + /* iterator position; indicates the next position to read */ + Py_ssize_t pos; +} NB_ListIter; + +NUMBA_GLOBAL_FUNC(void) +numba_list_set_method_table(NB_List *lp, list_type_based_methods_table *methods); + +NUMBA_GLOBAL_FUNC(int) +numba_list_new(NB_List **out, Py_ssize_t item_size, Py_ssize_t allocated); + +NUMBA_GLOBAL_FUNC(void) +numba_list_free(NB_List *lp); + +NUMBA_GLOBAL_FUNC(char *) +numba_list_base_ptr(NB_List *lp); + +NUMBA_GLOBAL_FUNC(Py_ssize_t) +numba_list_size_address(NB_List *lp); + +NUMBA_GLOBAL_FUNC(Py_ssize_t) +numba_list_length(NB_List *lp); + +NUMBA_GLOBAL_FUNC(Py_ssize_t) +numba_list_allocated(NB_List *lp); + +NUMBA_GLOBAL_FUNC(int) +numba_list_is_mutable(NB_List *lp); + +NUMBA_GLOBAL_FUNC(void) +numba_list_set_is_mutable(NB_List *lp, int is_mutable); + +NUMBA_GLOBAL_FUNC(int) +numba_list_setitem(NB_List *lp, Py_ssize_t index, const char *item); + +NUMBA_GLOBAL_FUNC(int) +numba_list_getitem(NB_List *lp, Py_ssize_t index, char *out); + +NUMBA_GLOBAL_FUNC(int) +numba_list_append(NB_List *lp, const char *item); + +NUMBA_GLOBAL_FUNC(int) +numba_list_resize(NB_List *lp, Py_ssize_t newsize); + +NUMBA_GLOBAL_FUNC(int) +numba_list_delitem(NB_List *lp, Py_ssize_t index); + +NUMBA_GLOBAL_FUNC(int) +numba_list_delete_slice(NB_List *lp, + Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step); + +NUMBA_GLOBAL_FUNC(size_t) +numba_list_iter_sizeof(void); + +NUMBA_GLOBAL_FUNC(void) +numba_list_iter(NB_ListIter *it, NB_List *l); + +NUMBA_GLOBAL_FUNC(int) +numba_list_iter_next(NB_ListIter *it, const char **item_ptr); + +NUMBA_EXPORT_FUNC(int) +numba_test_list(void); + +#endif diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cext/utils.c b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/utils.c new file mode 100644 index 0000000000000000000000000000000000000000..17f4992f40d1eed2573b8dbda7cbdaa0d2280f76 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cext/utils.c @@ -0,0 +1,8 @@ +#include "cext.h" + +/* Align size *sz* to pointer width */ +Py_ssize_t +aligned_size(Py_ssize_t sz) { + Py_ssize_t alignment = sizeof(void*); + return sz + (alignment - sz % alignment) % alignment; +} diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cloudpickle/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cloudpickle/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..58a8d086ff616b2ef75ab0d788d990e749f96e8d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cloudpickle/__init__.py @@ -0,0 +1,18 @@ +from . import cloudpickle +from .cloudpickle import * # noqa + +__doc__ = cloudpickle.__doc__ + +__version__ = "3.0.0" + +__all__ = [ # noqa + "__version__", + "Pickler", + "CloudPickler", + "dumps", + "loads", + "dump", + "load", + "register_pickle_by_value", + "unregister_pickle_by_value", +] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cloudpickle/cloudpickle.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cloudpickle/cloudpickle.py new file mode 100644 index 0000000000000000000000000000000000000000..5329f45db6ad119b6544c8c2827b52cd4271f610 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cloudpickle/cloudpickle.py @@ -0,0 +1,1504 @@ +""" +This is a modified version of the cloudpickle module. +Patches: +- https://github.com/numba/numba/pull/7388 + Avoid resetting class state of dynamic classes. + +Original module docstring: + +Pickler class to extend the standard pickle.Pickler functionality + +The main objective is to make it natural to perform distributed computing on +clusters (such as PySpark, Dask, Ray...) with interactively defined code +(functions, classes, ...) written in notebooks or console. + +In particular this pickler adds the following features: +- serialize interactively-defined or locally-defined functions, classes, + enums, typevars, lambdas and nested functions to compiled byte code; +- deal with some other non-serializable objects in an ad-hoc manner where + applicable. + +This pickler is therefore meant to be used for the communication between short +lived Python processes running the same version of Python and libraries. In +particular, it is not meant to be used for long term storage of Python objects. + +It does not include an unpickler, as standard Python unpickling suffices. + +This module was extracted from the `cloud` package, developed by `PiCloud, Inc. +`_. + +Copyright (c) 2012-now, CloudPickle developers and contributors. +Copyright (c) 2012, Regents of the University of California. +Copyright (c) 2009 `PiCloud, Inc. `_. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the University of California, Berkeley nor the + names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + +import _collections_abc +from collections import ChainMap, OrderedDict +import abc +import builtins +import copyreg +import dataclasses +import dis +from enum import Enum +import io +import itertools +import logging +import opcode +import pickle +from pickle import _getattribute +import platform +import struct +import sys +import threading +import types +import typing +import uuid +import warnings +import weakref + +# The following import is required to be imported in the cloudpickle +# namespace to be able to load pickle files generated with older versions of +# cloudpickle. See: tests/test_backward_compat.py +from types import CellType # noqa: F401 + + +# cloudpickle is meant for inter process communication: we expect all +# communicating processes to run the same Python version hence we favor +# communication speed over compatibility: +DEFAULT_PROTOCOL = pickle.HIGHEST_PROTOCOL + +# Names of modules whose resources should be treated as dynamic. +_PICKLE_BY_VALUE_MODULES = set() + +# Track the provenance of reconstructed dynamic classes to make it possible to +# reconstruct instances from the matching singleton class definition when +# appropriate and preserve the usual "isinstance" semantics of Python objects. +_DYNAMIC_CLASS_TRACKER_BY_CLASS = weakref.WeakKeyDictionary() +_DYNAMIC_CLASS_TRACKER_BY_ID = weakref.WeakValueDictionary() +_DYNAMIC_CLASS_TRACKER_LOCK = threading.Lock() +_DYNAMIC_CLASS_TRACKER_REUSING = weakref.WeakSet() + +PYPY = platform.python_implementation() == "PyPy" + +builtin_code_type = None +if PYPY: + # builtin-code objects only exist in pypy + builtin_code_type = type(float.__new__.__code__) + +_extract_code_globals_cache = weakref.WeakKeyDictionary() + + +def _get_or_create_tracker_id(class_def): + with _DYNAMIC_CLASS_TRACKER_LOCK: + class_tracker_id = _DYNAMIC_CLASS_TRACKER_BY_CLASS.get(class_def) + if class_tracker_id is None: + class_tracker_id = uuid.uuid4().hex + _DYNAMIC_CLASS_TRACKER_BY_CLASS[class_def] = class_tracker_id + _DYNAMIC_CLASS_TRACKER_BY_ID[class_tracker_id] = class_def + return class_tracker_id + + +def _lookup_class_or_track(class_tracker_id, class_def): + if class_tracker_id is not None: + with _DYNAMIC_CLASS_TRACKER_LOCK: + orig_class_def = class_def + class_def = _DYNAMIC_CLASS_TRACKER_BY_ID.setdefault( + class_tracker_id, class_def + ) + _DYNAMIC_CLASS_TRACKER_BY_CLASS[class_def] = class_tracker_id + # Check if we are reusing a previous class_def + if orig_class_def is not class_def: + # Remember the class_def is being reused + _DYNAMIC_CLASS_TRACKER_REUSING.add(class_def) + return class_def + + +def register_pickle_by_value(module): + """Register a module to make it functions and classes picklable by value. + + By default, functions and classes that are attributes of an importable + module are to be pickled by reference, that is relying on re-importing + the attribute from the module at load time. + + If `register_pickle_by_value(module)` is called, all its functions and + classes are subsequently to be pickled by value, meaning that they can + be loaded in Python processes where the module is not importable. + + This is especially useful when developing a module in a distributed + execution environment: restarting the client Python process with the new + source code is enough: there is no need to re-install the new version + of the module on all the worker nodes nor to restart the workers. + + Note: this feature is considered experimental. See the cloudpickle + README.md file for more details and limitations. + """ + if not isinstance(module, types.ModuleType): + raise ValueError(f"Input should be a module object, got {str(module)} instead") + # In the future, cloudpickle may need a way to access any module registered + # for pickling by value in order to introspect relative imports inside + # functions pickled by value. (see + # https://github.com/cloudpipe/cloudpickle/pull/417#issuecomment-873684633). + # This access can be ensured by checking that module is present in + # sys.modules at registering time and assuming that it will still be in + # there when accessed during pickling. Another alternative would be to + # store a weakref to the module. Even though cloudpickle does not implement + # this introspection yet, in order to avoid a possible breaking change + # later, we still enforce the presence of module inside sys.modules. + if module.__name__ not in sys.modules: + raise ValueError( + f"{module} was not imported correctly, have you used an " + "`import` statement to access it?" + ) + _PICKLE_BY_VALUE_MODULES.add(module.__name__) + + +def unregister_pickle_by_value(module): + """Unregister that the input module should be pickled by value.""" + if not isinstance(module, types.ModuleType): + raise ValueError(f"Input should be a module object, got {str(module)} instead") + if module.__name__ not in _PICKLE_BY_VALUE_MODULES: + raise ValueError(f"{module} is not registered for pickle by value") + else: + _PICKLE_BY_VALUE_MODULES.remove(module.__name__) + + +def list_registry_pickle_by_value(): + return _PICKLE_BY_VALUE_MODULES.copy() + + +def _is_registered_pickle_by_value(module): + module_name = module.__name__ + if module_name in _PICKLE_BY_VALUE_MODULES: + return True + while True: + parent_name = module_name.rsplit(".", 1)[0] + if parent_name == module_name: + break + if parent_name in _PICKLE_BY_VALUE_MODULES: + return True + module_name = parent_name + return False + + +def _whichmodule(obj, name): + """Find the module an object belongs to. + + This function differs from ``pickle.whichmodule`` in two ways: + - it does not mangle the cases where obj's module is __main__ and obj was + not found in any module. + - Errors arising during module introspection are ignored, as those errors + are considered unwanted side effects. + """ + module_name = getattr(obj, "__module__", None) + + if module_name is not None: + return module_name + # Protect the iteration by using a copy of sys.modules against dynamic + # modules that trigger imports of other modules upon calls to getattr or + # other threads importing at the same time. + for module_name, module in sys.modules.copy().items(): + # Some modules such as coverage can inject non-module objects inside + # sys.modules + if ( + module_name == "__main__" + or module is None + or not isinstance(module, types.ModuleType) + ): + continue + try: + if _getattribute(module, name)[0] is obj: + return module_name + except Exception: + pass + return None + + +def _should_pickle_by_reference(obj, name=None): + """Test whether an function or a class should be pickled by reference + + Pickling by reference means by that the object (typically a function or a + class) is an attribute of a module that is assumed to be importable in the + target Python environment. Loading will therefore rely on importing the + module and then calling `getattr` on it to access the function or class. + + Pickling by reference is the only option to pickle functions and classes + in the standard library. In cloudpickle the alternative option is to + pickle by value (for instance for interactively or locally defined + functions and classes or for attributes of modules that have been + explicitly registered to be pickled by value. + """ + if isinstance(obj, types.FunctionType) or issubclass(type(obj), type): + module_and_name = _lookup_module_and_qualname(obj, name=name) + if module_and_name is None: + return False + module, name = module_and_name + return not _is_registered_pickle_by_value(module) + + elif isinstance(obj, types.ModuleType): + # We assume that sys.modules is primarily used as a cache mechanism for + # the Python import machinery. Checking if a module has been added in + # is sys.modules therefore a cheap and simple heuristic to tell us + # whether we can assume that a given module could be imported by name + # in another Python process. + if _is_registered_pickle_by_value(obj): + return False + return obj.__name__ in sys.modules + else: + raise TypeError( + "cannot check importability of {} instances".format(type(obj).__name__) + ) + + +def _lookup_module_and_qualname(obj, name=None): + if name is None: + name = getattr(obj, "__qualname__", None) + if name is None: # pragma: no cover + # This used to be needed for Python 2.7 support but is probably not + # needed anymore. However we keep the __name__ introspection in case + # users of cloudpickle rely on this old behavior for unknown reasons. + name = getattr(obj, "__name__", None) + + module_name = _whichmodule(obj, name) + + if module_name is None: + # In this case, obj.__module__ is None AND obj was not found in any + # imported module. obj is thus treated as dynamic. + return None + + if module_name == "__main__": + return None + + # Note: if module_name is in sys.modules, the corresponding module is + # assumed importable at unpickling time. See #357 + module = sys.modules.get(module_name, None) + if module is None: + # The main reason why obj's module would not be imported is that this + # module has been dynamically created, using for example + # types.ModuleType. The other possibility is that module was removed + # from sys.modules after obj was created/imported. But this case is not + # supported, as the standard pickle does not support it either. + return None + + try: + obj2, parent = _getattribute(module, name) + except AttributeError: + # obj was not found inside the module it points to + return None + if obj2 is not obj: + return None + return module, name + + +def _extract_code_globals(co): + """Find all globals names read or written to by codeblock co.""" + out_names = _extract_code_globals_cache.get(co) + if out_names is None: + # We use a dict with None values instead of a set to get a + # deterministic order and avoid introducing non-deterministic pickle + # bytes as a results. + out_names = {name: None for name in _walk_global_ops(co)} + + # Declaring a function inside another one using the "def ..." syntax + # generates a constant code object corresponding to the one of the + # nested function's As the nested function may itself need global + # variables, we need to introspect its code, extract its globals, (look + # for code object in it's co_consts attribute..) and add the result to + # code_globals + if co.co_consts: + for const in co.co_consts: + if isinstance(const, types.CodeType): + out_names.update(_extract_code_globals(const)) + + _extract_code_globals_cache[co] = out_names + + return out_names + + +def _find_imported_submodules(code, top_level_dependencies): + """Find currently imported submodules used by a function. + + Submodules used by a function need to be detected and referenced for the + function to work correctly at depickling time. Because submodules can be + referenced as attribute of their parent package (``package.submodule``), we + need a special introspection technique that does not rely on GLOBAL-related + opcodes to find references of them in a code object. + + Example: + ``` + import concurrent.futures + import cloudpickle + def func(): + x = concurrent.futures.ThreadPoolExecutor + if __name__ == '__main__': + cloudpickle.dumps(func) + ``` + The globals extracted by cloudpickle in the function's state include the + concurrent package, but not its submodule (here, concurrent.futures), which + is the module used by func. Find_imported_submodules will detect the usage + of concurrent.futures. Saving this module alongside with func will ensure + that calling func once depickled does not fail due to concurrent.futures + not being imported + """ + + subimports = [] + # check if any known dependency is an imported package + for x in top_level_dependencies: + if ( + isinstance(x, types.ModuleType) + and hasattr(x, "__package__") + and x.__package__ + ): + # check if the package has any currently loaded sub-imports + prefix = x.__name__ + "." + # A concurrent thread could mutate sys.modules, + # make sure we iterate over a copy to avoid exceptions + for name in list(sys.modules): + # Older versions of pytest will add a "None" module to + # sys.modules. + if name is not None and name.startswith(prefix): + # check whether the function can address the sub-module + tokens = set(name[len(prefix) :].split(".")) + if not tokens - set(code.co_names): + subimports.append(sys.modules[name]) + return subimports + + +# relevant opcodes +STORE_GLOBAL = opcode.opmap["STORE_GLOBAL"] +DELETE_GLOBAL = opcode.opmap["DELETE_GLOBAL"] +LOAD_GLOBAL = opcode.opmap["LOAD_GLOBAL"] +GLOBAL_OPS = (STORE_GLOBAL, DELETE_GLOBAL, LOAD_GLOBAL) +HAVE_ARGUMENT = dis.HAVE_ARGUMENT +EXTENDED_ARG = dis.EXTENDED_ARG + + +_BUILTIN_TYPE_NAMES = {} +for k, v in types.__dict__.items(): + if type(v) is type: + _BUILTIN_TYPE_NAMES[v] = k + + +def _builtin_type(name): + if name == "ClassType": # pragma: no cover + # Backward compat to load pickle files generated with cloudpickle + # < 1.3 even if loading pickle files from older versions is not + # officially supported. + return type + return getattr(types, name) + + +def _walk_global_ops(code): + """Yield referenced name for global-referencing instructions in code.""" + for instr in dis.get_instructions(code): + op = instr.opcode + if op in GLOBAL_OPS: + yield instr.argval + + +def _extract_class_dict(cls): + """Retrieve a copy of the dict of a class without the inherited method.""" + clsdict = dict(cls.__dict__) # copy dict proxy to a dict + if len(cls.__bases__) == 1: + inherited_dict = cls.__bases__[0].__dict__ + else: + inherited_dict = {} + for base in reversed(cls.__bases__): + inherited_dict.update(base.__dict__) + to_remove = [] + for name, value in clsdict.items(): + try: + base_value = inherited_dict[name] + if value is base_value: + to_remove.append(name) + except KeyError: + pass + for name in to_remove: + clsdict.pop(name) + return clsdict + + +def is_tornado_coroutine(func): + """Return whether `func` is a Tornado coroutine function. + + Running coroutines are not supported. + """ + warnings.warn( + "is_tornado_coroutine is deprecated in cloudpickle 3.0 and will be " + "removed in cloudpickle 4.0. Use tornado.gen.is_coroutine_function " + "directly instead.", + category=DeprecationWarning, + ) + if "tornado.gen" not in sys.modules: + return False + gen = sys.modules["tornado.gen"] + if not hasattr(gen, "is_coroutine_function"): + # Tornado version is too old + return False + return gen.is_coroutine_function(func) + + +def subimport(name): + # We cannot do simply: `return __import__(name)`: Indeed, if ``name`` is + # the name of a submodule, __import__ will return the top-level root module + # of this submodule. For instance, __import__('os.path') returns the `os` + # module. + __import__(name) + return sys.modules[name] + + +def dynamic_subimport(name, vars): + mod = types.ModuleType(name) + mod.__dict__.update(vars) + mod.__dict__["__builtins__"] = builtins.__dict__ + return mod + + +def _get_cell_contents(cell): + try: + return cell.cell_contents + except ValueError: + # Handle empty cells explicitly with a sentinel value. + return _empty_cell_value + + +def instance(cls): + """Create a new instance of a class. + + Parameters + ---------- + cls : type + The class to create an instance of. + + Returns + ------- + instance : cls + A new instance of ``cls``. + """ + return cls() + + +@instance +class _empty_cell_value: + """Sentinel for empty closures.""" + + @classmethod + def __reduce__(cls): + return cls.__name__ + + +def _make_function(code, globals, name, argdefs, closure): + # Setting __builtins__ in globals is needed for nogil CPython. + globals["__builtins__"] = __builtins__ + return types.FunctionType(code, globals, name, argdefs, closure) + + +def _make_empty_cell(): + if False: + # trick the compiler into creating an empty cell in our lambda + cell = None + raise AssertionError("this route should not be executed") + + return (lambda: cell).__closure__[0] + + +def _make_cell(value=_empty_cell_value): + cell = _make_empty_cell() + if value is not _empty_cell_value: + cell.cell_contents = value + return cell + + +def _make_skeleton_class( + type_constructor, name, bases, type_kwargs, class_tracker_id, extra +): + """Build dynamic class with an empty __dict__ to be filled once memoized + + If class_tracker_id is not None, try to lookup an existing class definition + matching that id. If none is found, track a newly reconstructed class + definition under that id so that other instances stemming from the same + class id will also reuse this class definition. + + The "extra" variable is meant to be a dict (or None) that can be used for + forward compatibility shall the need arise. + """ + skeleton_class = types.new_class( + name, bases, {"metaclass": type_constructor}, lambda ns: ns.update(type_kwargs) + ) + return _lookup_class_or_track(class_tracker_id, skeleton_class) + + +def _make_skeleton_enum( + bases, name, qualname, members, module, class_tracker_id, extra +): + """Build dynamic enum with an empty __dict__ to be filled once memoized + + The creation of the enum class is inspired by the code of + EnumMeta._create_. + + If class_tracker_id is not None, try to lookup an existing enum definition + matching that id. If none is found, track a newly reconstructed enum + definition under that id so that other instances stemming from the same + class id will also reuse this enum definition. + + The "extra" variable is meant to be a dict (or None) that can be used for + forward compatibility shall the need arise. + """ + # enums always inherit from their base Enum class at the last position in + # the list of base classes: + enum_base = bases[-1] + metacls = enum_base.__class__ + classdict = metacls.__prepare__(name, bases) + + for member_name, member_value in members.items(): + classdict[member_name] = member_value + enum_class = metacls.__new__(metacls, name, bases, classdict) + enum_class.__module__ = module + enum_class.__qualname__ = qualname + + return _lookup_class_or_track(class_tracker_id, enum_class) + + +def _make_typevar(name, bound, constraints, covariant, contravariant, class_tracker_id): + tv = typing.TypeVar( + name, + *constraints, + bound=bound, + covariant=covariant, + contravariant=contravariant, + ) + return _lookup_class_or_track(class_tracker_id, tv) + + +def _decompose_typevar(obj): + return ( + obj.__name__, + obj.__bound__, + obj.__constraints__, + obj.__covariant__, + obj.__contravariant__, + _get_or_create_tracker_id(obj), + ) + + +def _typevar_reduce(obj): + # TypeVar instances require the module information hence why we + # are not using the _should_pickle_by_reference directly + module_and_name = _lookup_module_and_qualname(obj, name=obj.__name__) + + if module_and_name is None: + return (_make_typevar, _decompose_typevar(obj)) + elif _is_registered_pickle_by_value(module_and_name[0]): + return (_make_typevar, _decompose_typevar(obj)) + + return (getattr, module_and_name) + + +def _get_bases(typ): + if "__orig_bases__" in getattr(typ, "__dict__", {}): + # For generic types (see PEP 560) + # Note that simply checking `hasattr(typ, '__orig_bases__')` is not + # correct. Subclasses of a fully-parameterized generic class does not + # have `__orig_bases__` defined, but `hasattr(typ, '__orig_bases__')` + # will return True because it's defined in the base class. + bases_attr = "__orig_bases__" + else: + # For regular class objects + bases_attr = "__bases__" + return getattr(typ, bases_attr) + + +def _make_dict_keys(obj, is_ordered=False): + if is_ordered: + return OrderedDict.fromkeys(obj).keys() + else: + return dict.fromkeys(obj).keys() + + +def _make_dict_values(obj, is_ordered=False): + if is_ordered: + return OrderedDict((i, _) for i, _ in enumerate(obj)).values() + else: + return {i: _ for i, _ in enumerate(obj)}.values() + + +def _make_dict_items(obj, is_ordered=False): + if is_ordered: + return OrderedDict(obj).items() + else: + return obj.items() + + +# COLLECTION OF OBJECTS __getnewargs__-LIKE METHODS +# ------------------------------------------------- + + +def _class_getnewargs(obj): + type_kwargs = {} + if "__module__" in obj.__dict__: + type_kwargs["__module__"] = obj.__module__ + + __dict__ = obj.__dict__.get("__dict__", None) + if isinstance(__dict__, property): + type_kwargs["__dict__"] = __dict__ + + return ( + type(obj), + obj.__name__, + _get_bases(obj), + type_kwargs, + _get_or_create_tracker_id(obj), + None, + ) + + +def _enum_getnewargs(obj): + members = {e.name: e.value for e in obj} + return ( + obj.__bases__, + obj.__name__, + obj.__qualname__, + members, + obj.__module__, + _get_or_create_tracker_id(obj), + None, + ) + + +# COLLECTION OF OBJECTS RECONSTRUCTORS +# ------------------------------------ +def _file_reconstructor(retval): + return retval + + +# COLLECTION OF OBJECTS STATE GETTERS +# ----------------------------------- + + +def _function_getstate(func): + # - Put func's dynamic attributes (stored in func.__dict__) in state. These + # attributes will be restored at unpickling time using + # f.__dict__.update(state) + # - Put func's members into slotstate. Such attributes will be restored at + # unpickling time by iterating over slotstate and calling setattr(func, + # slotname, slotvalue) + slotstate = { + "__name__": func.__name__, + "__qualname__": func.__qualname__, + "__annotations__": func.__annotations__, + "__kwdefaults__": func.__kwdefaults__, + "__defaults__": func.__defaults__, + "__module__": func.__module__, + "__doc__": func.__doc__, + "__closure__": func.__closure__, + } + + f_globals_ref = _extract_code_globals(func.__code__) + f_globals = {k: func.__globals__[k] for k in f_globals_ref if k in func.__globals__} + + if func.__closure__ is not None: + closure_values = list(map(_get_cell_contents, func.__closure__)) + else: + closure_values = () + + # Extract currently-imported submodules used by func. Storing these modules + # in a smoke _cloudpickle_subimports attribute of the object's state will + # trigger the side effect of importing these modules at unpickling time + # (which is necessary for func to work correctly once depickled) + slotstate["_cloudpickle_submodules"] = _find_imported_submodules( + func.__code__, itertools.chain(f_globals.values(), closure_values) + ) + slotstate["__globals__"] = f_globals + + state = func.__dict__ + return state, slotstate + + +def _class_getstate(obj): + clsdict = _extract_class_dict(obj) + clsdict.pop("__weakref__", None) + + if issubclass(type(obj), abc.ABCMeta): + # If obj is an instance of an ABCMeta subclass, don't pickle the + # cache/negative caches populated during isinstance/issubclass + # checks, but pickle the list of registered subclasses of obj. + clsdict.pop("_abc_cache", None) + clsdict.pop("_abc_negative_cache", None) + clsdict.pop("_abc_negative_cache_version", None) + registry = clsdict.pop("_abc_registry", None) + if registry is None: + # The abc caches and registered subclasses of a + # class are bundled into the single _abc_impl attribute + clsdict.pop("_abc_impl", None) + (registry, _, _, _) = abc._get_dump(obj) + + clsdict["_abc_impl"] = [subclass_weakref() for subclass_weakref in registry] + else: + # In the above if clause, registry is a set of weakrefs -- in + # this case, registry is a WeakSet + clsdict["_abc_impl"] = [type_ for type_ in registry] + + if "__slots__" in clsdict: + # pickle string length optimization: member descriptors of obj are + # created automatically from obj's __slots__ attribute, no need to + # save them in obj's state + if isinstance(obj.__slots__, str): + clsdict.pop(obj.__slots__) + else: + for k in obj.__slots__: + clsdict.pop(k, None) + + clsdict.pop("__dict__", None) # unpicklable property object + + return (clsdict, {}) + + +def _enum_getstate(obj): + clsdict, slotstate = _class_getstate(obj) + + members = {e.name: e.value for e in obj} + # Cleanup the clsdict that will be passed to _make_skeleton_enum: + # Those attributes are already handled by the metaclass. + for attrname in [ + "_generate_next_value_", + "_member_names_", + "_member_map_", + "_member_type_", + "_value2member_map_", + ]: + clsdict.pop(attrname, None) + for member in members: + clsdict.pop(member) + # Special handling of Enum subclasses + return clsdict, slotstate + + +# COLLECTIONS OF OBJECTS REDUCERS +# ------------------------------- +# A reducer is a function taking a single argument (obj), and that returns a +# tuple with all the necessary data to re-construct obj. Apart from a few +# exceptions (list, dict, bytes, int, etc.), a reducer is necessary to +# correctly pickle an object. +# While many built-in objects (Exceptions objects, instances of the "object" +# class, etc), are shipped with their own built-in reducer (invoked using +# obj.__reduce__), some do not. The following methods were created to "fill +# these holes". + + +def _code_reduce(obj): + """code object reducer.""" + # If you are not sure about the order of arguments, take a look at help + # of the specific type from types, for example: + # >>> from types import CodeType + # >>> help(CodeType) + if hasattr(obj, "co_exceptiontable"): + # Python 3.11 and later: there are some new attributes + # related to the enhanced exceptions. + args = ( + obj.co_argcount, + obj.co_posonlyargcount, + obj.co_kwonlyargcount, + obj.co_nlocals, + obj.co_stacksize, + obj.co_flags, + obj.co_code, + obj.co_consts, + obj.co_names, + obj.co_varnames, + obj.co_filename, + obj.co_name, + obj.co_qualname, + obj.co_firstlineno, + obj.co_linetable, + obj.co_exceptiontable, + obj.co_freevars, + obj.co_cellvars, + ) + elif hasattr(obj, "co_linetable"): + # Python 3.10 and later: obj.co_lnotab is deprecated and constructor + # expects obj.co_linetable instead. + args = ( + obj.co_argcount, + obj.co_posonlyargcount, + obj.co_kwonlyargcount, + obj.co_nlocals, + obj.co_stacksize, + obj.co_flags, + obj.co_code, + obj.co_consts, + obj.co_names, + obj.co_varnames, + obj.co_filename, + obj.co_name, + obj.co_firstlineno, + obj.co_linetable, + obj.co_freevars, + obj.co_cellvars, + ) + elif hasattr(obj, "co_nmeta"): # pragma: no cover + # "nogil" Python: modified attributes from 3.9 + args = ( + obj.co_argcount, + obj.co_posonlyargcount, + obj.co_kwonlyargcount, + obj.co_nlocals, + obj.co_framesize, + obj.co_ndefaultargs, + obj.co_nmeta, + obj.co_flags, + obj.co_code, + obj.co_consts, + obj.co_varnames, + obj.co_filename, + obj.co_name, + obj.co_firstlineno, + obj.co_lnotab, + obj.co_exc_handlers, + obj.co_jump_table, + obj.co_freevars, + obj.co_cellvars, + obj.co_free2reg, + obj.co_cell2reg, + ) + else: + # Backward compat for 3.8 and 3.9 + args = ( + obj.co_argcount, + obj.co_posonlyargcount, + obj.co_kwonlyargcount, + obj.co_nlocals, + obj.co_stacksize, + obj.co_flags, + obj.co_code, + obj.co_consts, + obj.co_names, + obj.co_varnames, + obj.co_filename, + obj.co_name, + obj.co_firstlineno, + obj.co_lnotab, + obj.co_freevars, + obj.co_cellvars, + ) + return types.CodeType, args + + +def _cell_reduce(obj): + """Cell (containing values of a function's free variables) reducer.""" + try: + obj.cell_contents + except ValueError: # cell is empty + return _make_empty_cell, () + else: + return _make_cell, (obj.cell_contents,) + + +def _classmethod_reduce(obj): + orig_func = obj.__func__ + return type(obj), (orig_func,) + + +def _file_reduce(obj): + """Save a file.""" + import io + + if not hasattr(obj, "name") or not hasattr(obj, "mode"): + raise pickle.PicklingError( + "Cannot pickle files that do not map to an actual file" + ) + if obj is sys.stdout: + return getattr, (sys, "stdout") + if obj is sys.stderr: + return getattr, (sys, "stderr") + if obj is sys.stdin: + raise pickle.PicklingError("Cannot pickle standard input") + if obj.closed: + raise pickle.PicklingError("Cannot pickle closed files") + if hasattr(obj, "isatty") and obj.isatty(): + raise pickle.PicklingError("Cannot pickle files that map to tty objects") + if "r" not in obj.mode and "+" not in obj.mode: + raise pickle.PicklingError( + "Cannot pickle files that are not opened for reading: %s" % obj.mode + ) + + name = obj.name + + retval = io.StringIO() + + try: + # Read the whole file + curloc = obj.tell() + obj.seek(0) + contents = obj.read() + obj.seek(curloc) + except OSError as e: + raise pickle.PicklingError( + "Cannot pickle file %s as it cannot be read" % name + ) from e + retval.write(contents) + retval.seek(curloc) + + retval.name = name + return _file_reconstructor, (retval,) + + +def _getset_descriptor_reduce(obj): + return getattr, (obj.__objclass__, obj.__name__) + + +def _mappingproxy_reduce(obj): + return types.MappingProxyType, (dict(obj),) + + +def _memoryview_reduce(obj): + return bytes, (obj.tobytes(),) + + +def _module_reduce(obj): + if _should_pickle_by_reference(obj): + return subimport, (obj.__name__,) + else: + # Some external libraries can populate the "__builtins__" entry of a + # module's `__dict__` with unpicklable objects (see #316). For that + # reason, we do not attempt to pickle the "__builtins__" entry, and + # restore a default value for it at unpickling time. + state = obj.__dict__.copy() + state.pop("__builtins__", None) + return dynamic_subimport, (obj.__name__, state) + + +def _method_reduce(obj): + return (types.MethodType, (obj.__func__, obj.__self__)) + + +def _logger_reduce(obj): + return logging.getLogger, (obj.name,) + + +def _root_logger_reduce(obj): + return logging.getLogger, () + + +def _property_reduce(obj): + return property, (obj.fget, obj.fset, obj.fdel, obj.__doc__) + + +def _weakset_reduce(obj): + return weakref.WeakSet, (list(obj),) + + +def _dynamic_class_reduce(obj): + """Save a class that can't be referenced as a module attribute. + + This method is used to serialize classes that are defined inside + functions, or that otherwise can't be serialized as attribute lookups + from importable modules. + """ + if Enum is not None and issubclass(obj, Enum): + return ( + _make_skeleton_enum, + _enum_getnewargs(obj), + _enum_getstate(obj), + None, + None, + _class_setstate, + ) + else: + return ( + _make_skeleton_class, + _class_getnewargs(obj), + _class_getstate(obj), + None, + None, + _class_setstate, + ) + + +def _class_reduce(obj): + """Select the reducer depending on the dynamic nature of the class obj.""" + if obj is type(None): # noqa + return type, (None,) + elif obj is type(Ellipsis): + return type, (Ellipsis,) + elif obj is type(NotImplemented): + return type, (NotImplemented,) + elif obj in _BUILTIN_TYPE_NAMES: + return _builtin_type, (_BUILTIN_TYPE_NAMES[obj],) + elif not _should_pickle_by_reference(obj): + return _dynamic_class_reduce(obj) + return NotImplemented + + +def _dict_keys_reduce(obj): + # Safer not to ship the full dict as sending the rest might + # be unintended and could potentially cause leaking of + # sensitive information + return _make_dict_keys, (list(obj),) + + +def _dict_values_reduce(obj): + # Safer not to ship the full dict as sending the rest might + # be unintended and could potentially cause leaking of + # sensitive information + return _make_dict_values, (list(obj),) + + +def _dict_items_reduce(obj): + return _make_dict_items, (dict(obj),) + + +def _odict_keys_reduce(obj): + # Safer not to ship the full dict as sending the rest might + # be unintended and could potentially cause leaking of + # sensitive information + return _make_dict_keys, (list(obj), True) + + +def _odict_values_reduce(obj): + # Safer not to ship the full dict as sending the rest might + # be unintended and could potentially cause leaking of + # sensitive information + return _make_dict_values, (list(obj), True) + + +def _odict_items_reduce(obj): + return _make_dict_items, (dict(obj), True) + + +def _dataclass_field_base_reduce(obj): + return _get_dataclass_field_type_sentinel, (obj.name,) + + +# COLLECTIONS OF OBJECTS STATE SETTERS +# ------------------------------------ +# state setters are called at unpickling time, once the object is created and +# it has to be updated to how it was at unpickling time. + + +def _function_setstate(obj, state): + """Update the state of a dynamic function. + + As __closure__ and __globals__ are readonly attributes of a function, we + cannot rely on the native setstate routine of pickle.load_build, that calls + setattr on items of the slotstate. Instead, we have to modify them inplace. + """ + state, slotstate = state + obj.__dict__.update(state) + + obj_globals = slotstate.pop("__globals__") + obj_closure = slotstate.pop("__closure__") + # _cloudpickle_subimports is a set of submodules that must be loaded for + # the pickled function to work correctly at unpickling time. Now that these + # submodules are depickled (hence imported), they can be removed from the + # object's state (the object state only served as a reference holder to + # these submodules) + slotstate.pop("_cloudpickle_submodules") + + obj.__globals__.update(obj_globals) + obj.__globals__["__builtins__"] = __builtins__ + + if obj_closure is not None: + for i, cell in enumerate(obj_closure): + try: + value = cell.cell_contents + except ValueError: # cell is empty + continue + obj.__closure__[i].cell_contents = value + + for k, v in slotstate.items(): + setattr(obj, k, v) + + +def _class_setstate(obj, state): + # Check if class is being reused and needs bypass setstate logic. + if obj in _DYNAMIC_CLASS_TRACKER_REUSING: + return obj + state, slotstate = state + registry = None + for attrname, attr in state.items(): + if attrname == "_abc_impl": + registry = attr + else: + setattr(obj, attrname, attr) + if registry is not None: + for subclass in registry: + obj.register(subclass) + + return obj + + +# COLLECTION OF DATACLASS UTILITIES +# --------------------------------- +# There are some internal sentinel values whose identity must be preserved when +# unpickling dataclass fields. Each sentinel value has a unique name that we can +# use to retrieve its identity at unpickling time. + + +_DATACLASSE_FIELD_TYPE_SENTINELS = { + dataclasses._FIELD.name: dataclasses._FIELD, + dataclasses._FIELD_CLASSVAR.name: dataclasses._FIELD_CLASSVAR, + dataclasses._FIELD_INITVAR.name: dataclasses._FIELD_INITVAR, +} + + +def _get_dataclass_field_type_sentinel(name): + return _DATACLASSE_FIELD_TYPE_SENTINELS[name] + + +class Pickler(pickle.Pickler): + # set of reducers defined and used by cloudpickle (private) + _dispatch_table = {} + _dispatch_table[classmethod] = _classmethod_reduce + _dispatch_table[io.TextIOWrapper] = _file_reduce + _dispatch_table[logging.Logger] = _logger_reduce + _dispatch_table[logging.RootLogger] = _root_logger_reduce + _dispatch_table[memoryview] = _memoryview_reduce + _dispatch_table[property] = _property_reduce + _dispatch_table[staticmethod] = _classmethod_reduce + _dispatch_table[CellType] = _cell_reduce + _dispatch_table[types.CodeType] = _code_reduce + _dispatch_table[types.GetSetDescriptorType] = _getset_descriptor_reduce + _dispatch_table[types.ModuleType] = _module_reduce + _dispatch_table[types.MethodType] = _method_reduce + _dispatch_table[types.MappingProxyType] = _mappingproxy_reduce + _dispatch_table[weakref.WeakSet] = _weakset_reduce + _dispatch_table[typing.TypeVar] = _typevar_reduce + _dispatch_table[_collections_abc.dict_keys] = _dict_keys_reduce + _dispatch_table[_collections_abc.dict_values] = _dict_values_reduce + _dispatch_table[_collections_abc.dict_items] = _dict_items_reduce + _dispatch_table[type(OrderedDict().keys())] = _odict_keys_reduce + _dispatch_table[type(OrderedDict().values())] = _odict_values_reduce + _dispatch_table[type(OrderedDict().items())] = _odict_items_reduce + _dispatch_table[abc.abstractmethod] = _classmethod_reduce + _dispatch_table[abc.abstractclassmethod] = _classmethod_reduce + _dispatch_table[abc.abstractstaticmethod] = _classmethod_reduce + _dispatch_table[abc.abstractproperty] = _property_reduce + _dispatch_table[dataclasses._FIELD_BASE] = _dataclass_field_base_reduce + + dispatch_table = ChainMap(_dispatch_table, copyreg.dispatch_table) + + # function reducers are defined as instance methods of cloudpickle.Pickler + # objects, as they rely on a cloudpickle.Pickler attribute (globals_ref) + def _dynamic_function_reduce(self, func): + """Reduce a function that is not pickleable via attribute lookup.""" + newargs = self._function_getnewargs(func) + state = _function_getstate(func) + return (_make_function, newargs, state, None, None, _function_setstate) + + def _function_reduce(self, obj): + """Reducer for function objects. + + If obj is a top-level attribute of a file-backed module, this reducer + returns NotImplemented, making the cloudpickle.Pickler fall back to + traditional pickle.Pickler routines to save obj. Otherwise, it reduces + obj using a custom cloudpickle reducer designed specifically to handle + dynamic functions. + """ + if _should_pickle_by_reference(obj): + return NotImplemented + else: + return self._dynamic_function_reduce(obj) + + def _function_getnewargs(self, func): + code = func.__code__ + + # base_globals represents the future global namespace of func at + # unpickling time. Looking it up and storing it in + # cloudpickle.Pickler.globals_ref allow functions sharing the same + # globals at pickling time to also share them once unpickled, at one + # condition: since globals_ref is an attribute of a cloudpickle.Pickler + # instance, and that a new cloudpickle.Pickler is created each time + # cloudpickle.dump or cloudpickle.dumps is called, functions also need + # to be saved within the same invocation of + # cloudpickle.dump/cloudpickle.dumps (for example: + # cloudpickle.dumps([f1, f2])). There is no such limitation when using + # cloudpickle.Pickler.dump, as long as the multiple invocations are + # bound to the same cloudpickle.Pickler instance. + base_globals = self.globals_ref.setdefault(id(func.__globals__), {}) + + if base_globals == {}: + # Add module attributes used to resolve relative imports + # instructions inside func. + for k in ["__package__", "__name__", "__path__", "__file__"]: + if k in func.__globals__: + base_globals[k] = func.__globals__[k] + + # Do not bind the free variables before the function is created to + # avoid infinite recursion. + if func.__closure__ is None: + closure = None + else: + closure = tuple(_make_empty_cell() for _ in range(len(code.co_freevars))) + + return code, base_globals, None, None, closure + + def dump(self, obj): + try: + return super().dump(obj) + except RuntimeError as e: + if len(e.args) > 0 and "recursion" in e.args[0]: + msg = "Could not pickle object as excessively deep recursion required." + raise pickle.PicklingError(msg) from e + else: + raise + + def __init__(self, file, protocol=None, buffer_callback=None): + if protocol is None: + protocol = DEFAULT_PROTOCOL + super().__init__(file, protocol=protocol, buffer_callback=buffer_callback) + # map functions __globals__ attribute ids, to ensure that functions + # sharing the same global namespace at pickling time also share + # their global namespace at unpickling time. + self.globals_ref = {} + self.proto = int(protocol) + + if not PYPY: + # pickle.Pickler is the C implementation of the CPython pickler and + # therefore we rely on reduce_override method to customize the pickler + # behavior. + + # `cloudpickle.Pickler.dispatch` is only left for backward + # compatibility - note that when using protocol 5, + # `cloudpickle.Pickler.dispatch` is not an extension of + # `pickle._Pickler.dispatch` dictionary, because `cloudpickle.Pickler` + # subclasses the C-implemented `pickle.Pickler`, which does not expose + # a `dispatch` attribute. Earlier versions of `cloudpickle.Pickler` + # used `cloudpickle.Pickler.dispatch` as a class-level attribute + # storing all reducers implemented by cloudpickle, but the attribute + # name was not a great choice given because it would collide with a + # similarly named attribute in the pure-Python `pickle._Pickler` + # implementation in the standard library. + dispatch = dispatch_table + + # Implementation of the reducer_override callback, in order to + # efficiently serialize dynamic functions and classes by subclassing + # the C-implemented `pickle.Pickler`. + # TODO: decorrelate reducer_override (which is tied to CPython's + # implementation - would it make sense to backport it to pypy? - and + # pickle's protocol 5 which is implementation agnostic. Currently, the + # availability of both notions coincide on CPython's pickle, but it may + # not be the case anymore when pypy implements protocol 5. + + def reducer_override(self, obj): + """Type-agnostic reducing callback for function and classes. + + For performance reasons, subclasses of the C `pickle.Pickler` class + cannot register custom reducers for functions and classes in the + dispatch_table attribute. Reducers for such types must instead + implemented via the special `reducer_override` method. + + Note that this method will be called for any object except a few + builtin-types (int, lists, dicts etc.), which differs from reducers + in the Pickler's dispatch_table, each of them being invoked for + objects of a specific type only. + + This property comes in handy for classes: although most classes are + instances of the ``type`` metaclass, some of them can be instances + of other custom metaclasses (such as enum.EnumMeta for example). In + particular, the metaclass will likely not be known in advance, and + thus cannot be special-cased using an entry in the dispatch_table. + reducer_override, among other things, allows us to register a + reducer that will be called for any class, independently of its + type. + + Notes: + + * reducer_override has the priority over dispatch_table-registered + reducers. + * reducer_override can be used to fix other limitations of + cloudpickle for other types that suffered from type-specific + reducers, such as Exceptions. See + https://github.com/cloudpipe/cloudpickle/issues/248 + """ + t = type(obj) + try: + is_anyclass = issubclass(t, type) + except TypeError: # t is not a class (old Boost; see SF #502085) + is_anyclass = False + + if is_anyclass: + return _class_reduce(obj) + elif isinstance(obj, types.FunctionType): + return self._function_reduce(obj) + else: + # fallback to save_global, including the Pickler's + # dispatch_table + return NotImplemented + + else: + # When reducer_override is not available, hack the pure-Python + # Pickler's types.FunctionType and type savers. Note: the type saver + # must override Pickler.save_global, because pickle.py contains a + # hard-coded call to save_global when pickling meta-classes. + dispatch = pickle.Pickler.dispatch.copy() + + def _save_reduce_pickle5( + self, + func, + args, + state=None, + listitems=None, + dictitems=None, + state_setter=None, + obj=None, + ): + save = self.save + write = self.write + self.save_reduce( + func, + args, + state=None, + listitems=listitems, + dictitems=dictitems, + obj=obj, + ) + # backport of the Python 3.8 state_setter pickle operations + save(state_setter) + save(obj) # simple BINGET opcode as obj is already memoized. + save(state) + write(pickle.TUPLE2) + # Trigger a state_setter(obj, state) function call. + write(pickle.REDUCE) + # The purpose of state_setter is to carry-out an + # inplace modification of obj. We do not care about what the + # method might return, so its output is eventually removed from + # the stack. + write(pickle.POP) + + def save_global(self, obj, name=None, pack=struct.pack): + """Main dispatch method. + + The name of this method is somewhat misleading: all types get + dispatched here. + """ + if obj is type(None): # noqa + return self.save_reduce(type, (None,), obj=obj) + elif obj is type(Ellipsis): + return self.save_reduce(type, (Ellipsis,), obj=obj) + elif obj is type(NotImplemented): + return self.save_reduce(type, (NotImplemented,), obj=obj) + elif obj in _BUILTIN_TYPE_NAMES: + return self.save_reduce( + _builtin_type, (_BUILTIN_TYPE_NAMES[obj],), obj=obj + ) + + if name is not None: + super().save_global(obj, name=name) + elif not _should_pickle_by_reference(obj, name=name): + self._save_reduce_pickle5(*_dynamic_class_reduce(obj), obj=obj) + else: + super().save_global(obj, name=name) + + dispatch[type] = save_global + + def save_function(self, obj, name=None): + """Registered with the dispatch to handle all function types. + + Determines what kind of function obj is (e.g. lambda, defined at + interactive prompt, etc) and handles the pickling appropriately. + """ + if _should_pickle_by_reference(obj, name=name): + return super().save_global(obj, name=name) + elif PYPY and isinstance(obj.__code__, builtin_code_type): + return self.save_pypy_builtin_func(obj) + else: + return self._save_reduce_pickle5( + *self._dynamic_function_reduce(obj), obj=obj + ) + + def save_pypy_builtin_func(self, obj): + """Save pypy equivalent of builtin functions. + + PyPy does not have the concept of builtin-functions. Instead, + builtin-functions are simple function instances, but with a + builtin-code attribute. + Most of the time, builtin functions should be pickled by attribute. + But PyPy has flaky support for __qualname__, so some builtin + functions such as float.__new__ will be classified as dynamic. For + this reason only, we created this special routine. Because + builtin-functions are not expected to have closure or globals, + there is no additional hack (compared the one already implemented + in pickle) to protect ourselves from reference cycles. A simple + (reconstructor, newargs, obj.__dict__) tuple is save_reduced. Note + also that PyPy improved their support for __qualname__ in v3.6, so + this routing should be removed when cloudpickle supports only PyPy + 3.6 and later. + """ + rv = ( + types.FunctionType, + (obj.__code__, {}, obj.__name__, obj.__defaults__, obj.__closure__), + obj.__dict__, + ) + self.save_reduce(*rv, obj=obj) + + dispatch[types.FunctionType] = save_function + + +# Shorthands similar to pickle.dump/pickle.dumps + + +def dump(obj, file, protocol=None, buffer_callback=None): + """Serialize obj as bytes streamed into file + + protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to + pickle.HIGHEST_PROTOCOL. This setting favors maximum communication + speed between processes running the same Python version. + + Set protocol=pickle.DEFAULT_PROTOCOL instead if you need to ensure + compatibility with older versions of Python (although this is not always + guaranteed to work because cloudpickle relies on some internal + implementation details that can change from one Python version to the + next). + """ + Pickler(file, protocol=protocol, buffer_callback=buffer_callback).dump(obj) + + +def dumps(obj, protocol=None, buffer_callback=None): + """Serialize obj as a string of bytes allocated in memory + + protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to + pickle.HIGHEST_PROTOCOL. This setting favors maximum communication + speed between processes running the same Python version. + + Set protocol=pickle.DEFAULT_PROTOCOL instead if you need to ensure + compatibility with older versions of Python (although this is not always + guaranteed to work because cloudpickle relies on some internal + implementation details that can change from one Python version to the + next). + """ + with io.BytesIO() as file: + cp = Pickler(file, protocol=protocol, buffer_callback=buffer_callback) + cp.dump(obj) + return file.getvalue() + + +# Include pickles unloading functions in this namespace for convenience. +load, loads = pickle.load, pickle.loads + +# Backward compat alias. +CloudPickler = Pickler diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cloudpickle/cloudpickle_fast.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cloudpickle/cloudpickle_fast.py new file mode 100644 index 0000000000000000000000000000000000000000..52d6732e44ebcc0053b24969943f7c3b742268bb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cloudpickle/cloudpickle_fast.py @@ -0,0 +1,13 @@ +"""Compatibility module. + +It can be necessary to load files generated by previous versions of cloudpickle +that rely on symbols being defined under the `cloudpickle.cloudpickle_fast` +namespace. + +See: tests/test_backward_compat.py +""" +from . import cloudpickle + + +def __getattr__(name): + return getattr(cloudpickle, name) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/analysis.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/analysis.py new file mode 100644 index 0000000000000000000000000000000000000000..4e6691b5bb7c4a221ab9419ca606d598f7b3f012 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/analysis.py @@ -0,0 +1,726 @@ +""" +Utils for IR analysis +""" +import operator +from functools import reduce +from collections import namedtuple, defaultdict + +from .controlflow import CFGraph +from numba.core import types, errors, ir, consts +from numba.misc import special + +# +# Analysis related to variable lifetime +# + +_use_defs_result = namedtuple('use_defs_result', 'usemap,defmap') + +# other packages that define new nodes add calls for finding defs +# format: {type:function} +ir_extension_usedefs = {} + + +def compute_use_defs(blocks): + """ + Find variable use/def per block. + """ + + var_use_map = {} # { block offset -> set of vars } + var_def_map = {} # { block offset -> set of vars } + for offset, ir_block in blocks.items(): + var_use_map[offset] = use_set = set() + var_def_map[offset] = def_set = set() + for stmt in ir_block.body: + if type(stmt) in ir_extension_usedefs: + func = ir_extension_usedefs[type(stmt)] + func(stmt, use_set, def_set) + continue + if isinstance(stmt, ir.Assign): + if isinstance(stmt.value, ir.Inst): + rhs_set = set(var.name for var in stmt.value.list_vars()) + elif isinstance(stmt.value, ir.Var): + rhs_set = set([stmt.value.name]) + elif isinstance(stmt.value, (ir.Arg, ir.Const, ir.Global, + ir.FreeVar)): + rhs_set = () + else: + raise AssertionError('unreachable', type(stmt.value)) + # If lhs not in rhs of the assignment + if stmt.target.name not in rhs_set: + def_set.add(stmt.target.name) + + for var in stmt.list_vars(): + # do not include locally defined vars to use-map + if var.name not in def_set: + use_set.add(var.name) + + return _use_defs_result(usemap=var_use_map, defmap=var_def_map) + + +def compute_live_map(cfg, blocks, var_use_map, var_def_map): + """ + Find variables that must be alive at the ENTRY of each block. + We use a simple fix-point algorithm that iterates until the set of + live variables is unchanged for each block. + """ + def fix_point_progress(dct): + """Helper function to determine if a fix-point has been reached. + """ + return tuple(len(v) for v in dct.values()) + + def fix_point(fn, dct): + """Helper function to run fix-point algorithm. + """ + old_point = None + new_point = fix_point_progress(dct) + while old_point != new_point: + fn(dct) + old_point = new_point + new_point = fix_point_progress(dct) + + def def_reach(dct): + """Find all variable definition reachable at the entry of a block + """ + for offset in var_def_map: + used_or_defined = var_def_map[offset] | var_use_map[offset] + dct[offset] |= used_or_defined + # Propagate to outgoing nodes + for out_blk, _ in cfg.successors(offset): + dct[out_blk] |= dct[offset] + + def liveness(dct): + """Find live variables. + + Push var usage backward. + """ + for offset in dct: + # Live vars here + live_vars = dct[offset] + for inc_blk, _data in cfg.predecessors(offset): + # Reachable at the predecessor + reachable = live_vars & def_reach_map[inc_blk] + # But not defined in the predecessor + dct[inc_blk] |= reachable - var_def_map[inc_blk] + + live_map = {} + for offset in blocks.keys(): + live_map[offset] = set(var_use_map[offset]) + + def_reach_map = defaultdict(set) + fix_point(def_reach, def_reach_map) + fix_point(liveness, live_map) + return live_map + + +_dead_maps_result = namedtuple('dead_maps_result', 'internal,escaping,combined') + + +def compute_dead_maps(cfg, blocks, live_map, var_def_map): + """ + Compute the end-of-live information for variables. + `live_map` contains a mapping of block offset to all the living + variables at the ENTRY of the block. + """ + # The following three dictionaries will be + # { block offset -> set of variables to delete } + # all vars that should be deleted at the start of the successors + escaping_dead_map = defaultdict(set) + # all vars that should be deleted within this block + internal_dead_map = defaultdict(set) + # all vars that should be deleted after the function exit + exit_dead_map = defaultdict(set) + + for offset, ir_block in blocks.items(): + # live vars WITHIN the block will include all the locally + # defined variables + cur_live_set = live_map[offset] | var_def_map[offset] + # vars alive in the outgoing blocks + outgoing_live_map = dict((out_blk, live_map[out_blk]) + for out_blk, _data in cfg.successors(offset)) + # vars to keep alive for the terminator + terminator_liveset = set(v.name + for v in ir_block.terminator.list_vars()) + # vars to keep alive in the successors + combined_liveset = reduce(operator.or_, outgoing_live_map.values(), + set()) + # include variables used in terminator + combined_liveset |= terminator_liveset + # vars that are dead within the block because they are not + # propagated to any outgoing blocks + internal_set = cur_live_set - combined_liveset + internal_dead_map[offset] = internal_set + # vars that escape this block + escaping_live_set = cur_live_set - internal_set + for out_blk, new_live_set in outgoing_live_map.items(): + # successor should delete the unused escaped vars + new_live_set = new_live_set | var_def_map[out_blk] + escaping_dead_map[out_blk] |= escaping_live_set - new_live_set + + # if no outgoing blocks + if not outgoing_live_map: + # insert var used by terminator + exit_dead_map[offset] = terminator_liveset + + # Verify that the dead maps cover all live variables + all_vars = reduce(operator.or_, live_map.values(), set()) + internal_dead_vars = reduce(operator.or_, internal_dead_map.values(), + set()) + escaping_dead_vars = reduce(operator.or_, escaping_dead_map.values(), + set()) + exit_dead_vars = reduce(operator.or_, exit_dead_map.values(), set()) + dead_vars = (internal_dead_vars | escaping_dead_vars | exit_dead_vars) + missing_vars = all_vars - dead_vars + if missing_vars: + # There are no exit points + if not cfg.exit_points(): + # We won't be able to verify this + pass + else: + msg = 'liveness info missing for vars: {0}'.format(missing_vars) + raise RuntimeError(msg) + + combined = dict((k, internal_dead_map[k] | escaping_dead_map[k]) + for k in blocks) + + return _dead_maps_result(internal=internal_dead_map, + escaping=escaping_dead_map, + combined=combined) + + +def compute_live_variables(cfg, blocks, var_def_map, var_dead_map): + """ + Compute the live variables at the beginning of each block + and at each yield point. + The ``var_def_map`` and ``var_dead_map`` indicates the variable defined + and deleted at each block, respectively. + """ + # live var at the entry per block + block_entry_vars = defaultdict(set) + + def fix_point_progress(): + return tuple(map(len, block_entry_vars.values())) + + old_point = None + new_point = fix_point_progress() + + # Propagate defined variables and still live the successors. + # (note the entry block automatically gets an empty set) + + # Note: This is finding the actual available variables at the entry + # of each block. The algorithm in compute_live_map() is finding + # the variable that must be available at the entry of each block. + # This is top-down in the dataflow. The other one is bottom-up. + while old_point != new_point: + # We iterate until the result stabilizes. This is necessary + # because of loops in the graphself. + for offset in blocks: + # vars available + variable defined + avail = block_entry_vars[offset] | var_def_map[offset] + # subtract variables deleted + avail -= var_dead_map[offset] + # add ``avail`` to each successors + for succ, _data in cfg.successors(offset): + block_entry_vars[succ] |= avail + + old_point = new_point + new_point = fix_point_progress() + + return block_entry_vars + + +# +# Analysis related to controlflow +# + +def compute_cfg_from_blocks(blocks): + cfg = CFGraph() + for k in blocks: + cfg.add_node(k) + + for k, b in blocks.items(): + term = b.terminator + for target in term.get_targets(): + cfg.add_edge(k, target) + + cfg.set_entry_point(min(blocks)) + cfg.process() + return cfg + + +def find_top_level_loops(cfg): + """ + A generator that yields toplevel loops given a control-flow-graph + """ + blocks_in_loop = set() + # get loop bodies + for loop in cfg.loops().values(): + insiders = set(loop.body) | set(loop.entries) | set(loop.exits) + insiders.discard(loop.header) + blocks_in_loop |= insiders + # find loop that is not part of other loops + for loop in cfg.loops().values(): + if loop.header not in blocks_in_loop: + yield _fix_loop_exit(cfg, loop) + + +def _fix_loop_exit(cfg, loop): + """ + Fixes loop.exits for Py3.8+ bytecode CFG changes. + This is to handle `break` inside loops. + """ + # Computes the common postdoms of exit nodes + postdoms = cfg.post_dominators() + exits = reduce( + operator.and_, + [postdoms[b] for b in loop.exits], + loop.exits, + ) + if exits: + # Put the non-common-exits as body nodes + body = loop.body | loop.exits - exits + return loop._replace(exits=exits, body=body) + else: + return loop + + +# Used to describe a nullified condition in dead branch pruning +nullified = namedtuple('nullified', 'condition, taken_br, rewrite_stmt') + + +# Functions to manipulate IR +def dead_branch_prune(func_ir, called_args): + """ + Removes dead branches based on constant inference from function args. + This directly mutates the IR. + + func_ir is the IR + called_args are the actual arguments with which the function is called + """ + from numba.core.ir_utils import (get_definition, guard, find_const, + GuardException) + + DEBUG = 0 + + def find_branches(func_ir): + # find *all* branches + branches = [] + for blk in func_ir.blocks.values(): + branch_or_jump = blk.body[-1] + if isinstance(branch_or_jump, ir.Branch): + branch = branch_or_jump + pred = guard(get_definition, func_ir, branch.cond.name) + if pred is not None and getattr(pred, "op", None) == "call": + function = guard(get_definition, func_ir, pred.func) + if (function is not None and + isinstance(function, ir.Global) and + function.value is bool): + condition = guard(get_definition, func_ir, pred.args[0]) + if condition is not None: + branches.append((branch, condition, blk)) + return branches + + def do_prune(take_truebr, blk): + keep = branch.truebr if take_truebr else branch.falsebr + # replace the branch with a direct jump + jmp = ir.Jump(keep, loc=branch.loc) + blk.body[-1] = jmp + return 1 if keep == branch.truebr else 0 + + def prune_by_type(branch, condition, blk, *conds): + # this prunes a given branch and fixes up the IR + # at least one needs to be a NoneType + lhs_cond, rhs_cond = conds + lhs_none = isinstance(lhs_cond, types.NoneType) + rhs_none = isinstance(rhs_cond, types.NoneType) + if lhs_none or rhs_none: + try: + take_truebr = condition.fn(lhs_cond, rhs_cond) + except Exception: + return False, None + if DEBUG > 0: + kill = branch.falsebr if take_truebr else branch.truebr + print("Pruning %s" % kill, branch, lhs_cond, rhs_cond, + condition.fn) + taken = do_prune(take_truebr, blk) + return True, taken + return False, None + + def prune_by_value(branch, condition, blk, *conds): + lhs_cond, rhs_cond = conds + try: + take_truebr = condition.fn(lhs_cond, rhs_cond) + except Exception: + return False, None + if DEBUG > 0: + kill = branch.falsebr if take_truebr else branch.truebr + print("Pruning %s" % kill, branch, lhs_cond, rhs_cond, condition.fn) + do_prune(take_truebr, blk) + # It is not safe to rewrite the predicate to a nominal value based on + # which branch is taken, the rewritten const predicate needs to + # hold the actual computed const value as something else may refer to + # it! + return True, take_truebr + + def prune_by_predicate(branch, pred, blk): + try: + # Just to prevent accidents, whilst already guarded, ensure this + # is an ir.Const + if not isinstance(pred, (ir.Const, ir.FreeVar, ir.Global)): + raise TypeError('Expected constant Numba IR node') + take_truebr = bool(pred.value) + except TypeError: + return False, None + if DEBUG > 0: + kill = branch.falsebr if take_truebr else branch.truebr + print("Pruning %s" % kill, branch, pred) + taken = do_prune(take_truebr, blk) + return True, taken + + class Unknown(object): + pass + + def resolve_input_arg_const(input_arg_idx): + """ + Resolves an input arg to a constant (if possible) + """ + input_arg_ty = called_args[input_arg_idx] + + # comparing to None? + if isinstance(input_arg_ty, types.NoneType): + return input_arg_ty + + # is it a kwarg default + if isinstance(input_arg_ty, types.Omitted): + val = input_arg_ty.value + if isinstance(val, types.NoneType): + return val + elif val is None: + return types.NoneType('none') + + # literal type, return the type itself so comparisons like `x == None` + # still work as e.g. x = types.int64 will never be None/NoneType so + # the branch can still be pruned + return getattr(input_arg_ty, 'literal_type', Unknown()) + + if DEBUG > 1: + print("before".center(80, '-')) + print(func_ir.dump()) + + phi2lbl = dict() + phi2asgn = dict() + for lbl, blk in func_ir.blocks.items(): + for stmt in blk.body: + if isinstance(stmt, ir.Assign): + if isinstance(stmt.value, ir.Expr) and stmt.value.op == 'phi': + phi2lbl[stmt.value] = lbl + phi2asgn[stmt.value] = stmt + + # This looks for branches where: + # at least one arg of the condition is in input args and const + # at least one an arg of the condition is a const + # if the condition is met it will replace the branch with a jump + branch_info = find_branches(func_ir) + # stores conditions that have no impact post prune + nullified_conditions = [] + + for branch, condition, blk in branch_info: + const_conds = [] + if isinstance(condition, ir.Expr) and condition.op == 'binop': + prune = prune_by_value + for arg in [condition.lhs, condition.rhs]: + resolved_const = Unknown() + arg_def = guard(get_definition, func_ir, arg) + if isinstance(arg_def, ir.Arg): + # it's an e.g. literal argument to the function + resolved_const = resolve_input_arg_const(arg_def.index) + prune = prune_by_type + else: + # it's some const argument to the function, cannot use guard + # here as the const itself may be None + try: + resolved_const = find_const(func_ir, arg) + if resolved_const is None: + resolved_const = types.NoneType('none') + except GuardException: + pass + + if not isinstance(resolved_const, Unknown): + const_conds.append(resolved_const) + + # lhs/rhs are consts + if len(const_conds) == 2: + # prune the branch, switch the branch for an unconditional jump + prune_stat, taken = prune(branch, condition, blk, *const_conds) + if (prune_stat): + # add the condition to the list of nullified conditions + nullified_conditions.append(nullified(condition, taken, + True)) + else: + # see if this is a branch on a constant value predicate + resolved_const = Unknown() + try: + pred_call = get_definition(func_ir, branch.cond) + resolved_const = find_const(func_ir, pred_call.args[0]) + if resolved_const is None: + resolved_const = types.NoneType('none') + except GuardException: + pass + + if not isinstance(resolved_const, Unknown): + prune_stat, taken = prune_by_predicate(branch, condition, blk) + if (prune_stat): + # add the condition to the list of nullified conditions + nullified_conditions.append(nullified(condition, taken, + False)) + + # 'ERE BE DRAGONS... + # It is the evaluation of the condition expression that often trips up type + # inference, so ideally it would be removed as it is effectively rendered + # dead by the unconditional jump if a branch was pruned. However, there may + # be references to the condition that exist in multiple places (e.g. dels) + # and we cannot run DCE here as typing has not taken place to give enough + # information to run DCE safely. Upshot of all this is the condition gets + # rewritten below into a benign const that typing will be happy with and DCE + # can remove it and its reference post typing when it is safe to do so + # (if desired). It is required that the const is assigned a value that + # indicates the branch taken as its mutated value would be read in the case + # of object mode fall back in place of the condition itself. For + # completeness the func_ir._definitions and ._consts are also updated to + # make the IR state self consistent. + + deadcond = [x.condition for x in nullified_conditions] + for _, cond, blk in branch_info: + if cond in deadcond: + for x in blk.body: + if isinstance(x, ir.Assign) and x.value is cond: + # rewrite the condition as a true/false bit + nullified_info = nullified_conditions[deadcond.index(cond)] + # only do a rewrite of conditions, predicates need to retain + # their value as they may be used later. + if nullified_info.rewrite_stmt: + branch_bit = nullified_info.taken_br + x.value = ir.Const(branch_bit, loc=x.loc) + # update the specific definition to the new const + defns = func_ir._definitions[x.target.name] + repl_idx = defns.index(cond) + defns[repl_idx] = x.value + + # Check post dominators of dead nodes from in the original CFG for use of + # vars that are being removed in the dead blocks which might be referred to + # by phi nodes. + # + # Multiple things to fix up: + # + # 1. Cases like: + # + # A A + # |\ | + # | B --> B + # |/ | + # C C + # + # i.e. the branch is dead but the block is still alive. In this case CFG + # simplification will fuse A-B-C and any phi in C can be updated as an + # direct assignment from the last assigned version in the dominators of the + # fused block. + # + # 2. Cases like: + # + # A A + # / \ | + # B C --> B + # \ / | + # D D + # + # i.e. the block C is dead. In this case the phis in D need updating to + # reflect the collapse of the phi condition. This should result in a direct + # assignment of the surviving version in B to the LHS of the phi in D. + + new_cfg = compute_cfg_from_blocks(func_ir.blocks) + dead_blocks = new_cfg.dead_nodes() + + # for all phis that are still in live blocks. + for phi, lbl in phi2lbl.items(): + if lbl in dead_blocks: + continue + new_incoming = [x[0] for x in new_cfg.predecessors(lbl)] + if set(new_incoming) != set(phi.incoming_blocks): + # Something has changed in the CFG... + if len(new_incoming) == 1: + # There's now just one incoming. Replace the PHI node by a + # direct assignment + idx = phi.incoming_blocks.index(new_incoming[0]) + phi2asgn[phi].value = phi.incoming_values[idx] + else: + # There's more than one incoming still, then look through the + # incoming and remove dead + ic_val_tmp = [] + ic_blk_tmp = [] + for ic_val, ic_blk in zip(phi.incoming_values, + phi.incoming_blocks): + if ic_blk in dead_blocks: + continue + else: + ic_val_tmp.append(ic_val) + ic_blk_tmp.append(ic_blk) + phi.incoming_values.clear() + phi.incoming_values.extend(ic_val_tmp) + phi.incoming_blocks.clear() + phi.incoming_blocks.extend(ic_blk_tmp) + + # Remove dead blocks, this is safe as it relies on the CFG only. + for dead in dead_blocks: + del func_ir.blocks[dead] + + # if conditions were nullified then consts were rewritten, update + if nullified_conditions: + func_ir._consts = consts.ConstantInference(func_ir) + + if DEBUG > 1: + print("after".center(80, '-')) + print(func_ir.dump()) + + +def rewrite_semantic_constants(func_ir, called_args): + """ + This rewrites values known to be constant by their semantics as ir.Const + nodes, this is to give branch pruning the best chance possible of killing + branches. An example might be rewriting len(tuple) as the literal length. + + func_ir is the IR + called_args are the actual arguments with which the function is called + """ + DEBUG = 0 + + if DEBUG > 1: + print(("rewrite_semantic_constants: " + + func_ir.func_id.func_name).center(80, '-')) + print("before".center(80, '*')) + func_ir.dump() + + def rewrite_statement(func_ir, stmt, new_val): + """ + Rewrites the stmt as a ir.Const new_val and fixes up the entries in + func_ir._definitions + """ + stmt.value = ir.Const(new_val, stmt.loc) + defns = func_ir._definitions[stmt.target.name] + repl_idx = defns.index(val) + defns[repl_idx] = stmt.value + + def rewrite_array_ndim(val, func_ir, called_args): + # rewrite Array.ndim as const(ndim) + if getattr(val, 'op', None) == 'getattr': + if val.attr == 'ndim': + arg_def = guard(get_definition, func_ir, val.value) + if isinstance(arg_def, ir.Arg): + argty = called_args[arg_def.index] + if isinstance(argty, types.Array): + rewrite_statement(func_ir, stmt, argty.ndim) + + def rewrite_tuple_len(val, func_ir, called_args): + # rewrite len(tuple) as const(len(tuple)) + if getattr(val, 'op', None) == 'call': + func = guard(get_definition, func_ir, val.func) + if (func is not None and isinstance(func, ir.Global) and + getattr(func, 'value', None) is len): + + (arg,) = val.args + arg_def = guard(get_definition, func_ir, arg) + if isinstance(arg_def, ir.Arg): + argty = called_args[arg_def.index] + if isinstance(argty, types.BaseTuple): + rewrite_statement(func_ir, stmt, argty.count) + elif (isinstance(arg_def, ir.Expr) and + arg_def.op == 'typed_getitem'): + argty = arg_def.dtype + if isinstance(argty, types.BaseTuple): + rewrite_statement(func_ir, stmt, argty.count) + + from numba.core.ir_utils import get_definition, guard + for blk in func_ir.blocks.values(): + for stmt in blk.body: + if isinstance(stmt, ir.Assign): + val = stmt.value + if isinstance(val, ir.Expr): + rewrite_array_ndim(val, func_ir, called_args) + rewrite_tuple_len(val, func_ir, called_args) + + if DEBUG > 1: + print("after".center(80, '*')) + func_ir.dump() + print('-' * 80) + + +def find_literally_calls(func_ir, argtypes): + """An analysis to find `numba.literally` call inside the given IR. + When an unsatisfied literal typing request is found, a `ForceLiteralArg` + exception is raised. + + Parameters + ---------- + + func_ir : numba.ir.FunctionIR + + argtypes : Sequence[numba.types.Type] + The argument types. + """ + from numba.core import ir_utils + + marked_args = set() + first_loc = {} + # Scan for literally calls + for blk in func_ir.blocks.values(): + for assign in blk.find_exprs(op='call'): + var = ir_utils.guard(ir_utils.get_definition, func_ir, assign.func) + if isinstance(var, (ir.Global, ir.FreeVar)): + fnobj = var.value + else: + fnobj = ir_utils.guard(ir_utils.resolve_func_from_module, + func_ir, var) + if fnobj is special.literally: + # Found + [arg] = assign.args + defarg = func_ir.get_definition(arg) + if isinstance(defarg, ir.Arg): + argindex = defarg.index + marked_args.add(argindex) + first_loc.setdefault(argindex, assign.loc) + # Signal the dispatcher to force literal typing + for pos in marked_args: + query_arg = argtypes[pos] + do_raise = (isinstance(query_arg, types.InitialValue) and + query_arg.initial_value is None) + if do_raise: + loc = first_loc[pos] + raise errors.ForceLiteralArg(marked_args, loc=loc) + + if not isinstance(query_arg, (types.Literal, types.InitialValue)): + loc = first_loc[pos] + raise errors.ForceLiteralArg(marked_args, loc=loc) + + +ir_extension_use_alloca = {} + + +def must_use_alloca(blocks): + """ + Analyzes a dictionary of blocks to find variables that must be + stack allocated with alloca. For each statement in the blocks, + determine if that statement requires certain variables to be + stack allocated. This function uses the extension point + ir_extension_use_alloca to allow other IR node types like parfors + to register to be processed by this analysis function. At the + moment, parfors are the only IR node types that may require + something to be stack allocated. + """ + use_alloca_vars = set() + + for ir_block in blocks.values(): + for stmt in ir_block.body: + if type(stmt) in ir_extension_use_alloca: + func = ir_extension_use_alloca[type(stmt)] + func(stmt, use_alloca_vars) + continue + + return use_alloca_vars diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/base.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/base.py new file mode 100644 index 0000000000000000000000000000000000000000..355235b2349ebf06c302ee36beddf4dbb9c5189e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/base.py @@ -0,0 +1,1255 @@ +from collections import defaultdict +import copy +import sys +from itertools import permutations, takewhile +from contextlib import contextmanager +from functools import cached_property + +from llvmlite import ir as llvmir +from llvmlite.ir import Constant +import llvmlite.binding as ll + +from numba.core import types, utils, datamodel, debuginfo, funcdesc, config, cgutils, imputils +from numba.core import event, errors, targetconfig +from numba import _dynfunc, _helperlib +from numba.core.compiler_lock import global_compiler_lock +from numba.core.pythonapi import PythonAPI +from numba.core.imputils import (user_function, user_generator, + builtin_registry, impl_ret_borrowed, + RegistryLoader) +from numba.cpython import builtins + +GENERIC_POINTER = llvmir.PointerType(llvmir.IntType(8)) +PYOBJECT = GENERIC_POINTER +void_ptr = GENERIC_POINTER + + +class OverloadSelector(object): + """ + An object matching an actual signature against a registry of formal + signatures and choosing the best candidate, if any. + + In the current implementation: + - a "signature" is a tuple of type classes or type instances + - the "best candidate" is the most specific match + """ + + def __init__(self): + # A list of (formal args tuple, value) + self.versions = [] + self._cache = {} + + def find(self, sig): + out = self._cache.get(sig) + if out is None: + out = self._find(sig) + self._cache[sig] = out + return out + + def _find(self, sig): + candidates = self._select_compatible(sig) + if candidates: + return candidates[self._best_signature(candidates)] + else: + raise errors.NumbaNotImplementedError(f'{self}, {sig}') + + def _select_compatible(self, sig): + """ + Select all compatible signatures and their implementation. + """ + out = {} + for ver_sig, impl in self.versions: + if self._match_arglist(ver_sig, sig): + out[ver_sig] = impl + return out + + def _best_signature(self, candidates): + """ + Returns the best signature out of the candidates + """ + ordered, genericity = self._sort_signatures(candidates) + # check for ambiguous signatures + if len(ordered) > 1: + firstscore = genericity[ordered[0]] + same = list(takewhile(lambda x: genericity[x] == firstscore, + ordered)) + if len(same) > 1: + msg = ["{n} ambiguous signatures".format(n=len(same))] + for sig in same: + msg += ["{0} => {1}".format(sig, candidates[sig])] + raise errors.NumbaTypeError('\n'.join(msg)) + return ordered[0] + + def _sort_signatures(self, candidates): + """ + Sort signatures in ascending level of genericity. + + Returns a 2-tuple: + + * ordered list of signatures + * dictionary containing genericity scores + """ + # score by genericity + genericity = defaultdict(int) + for this, other in permutations(candidates.keys(), r=2): + matched = self._match_arglist(formal_args=this, actual_args=other) + if matched: + # genericity score +1 for every another compatible signature + genericity[this] += 1 + # order candidates in ascending level of genericity + ordered = sorted(candidates.keys(), key=lambda x: genericity[x]) + return ordered, genericity + + def _match_arglist(self, formal_args, actual_args): + """ + Returns True if the signature is "matching". + A formal signature is "matching" if the actual signature matches exactly + or if the formal signature is a compatible generic signature. + """ + # normalize VarArg + if formal_args and isinstance(formal_args[-1], types.VarArg): + ndiff = len(actual_args) - len(formal_args) + 1 + formal_args = formal_args[:-1] + (formal_args[-1].dtype,) * ndiff + + if len(formal_args) != len(actual_args): + return False + + for formal, actual in zip(formal_args, actual_args): + if not self._match(formal, actual): + return False + + return True + + def _match(self, formal, actual): + if formal == actual: + # formal argument matches actual arguments + return True + elif types.Any == formal: + # formal argument is any + return True + elif isinstance(formal, type) and issubclass(formal, types.Type): + if isinstance(actual, type) and issubclass(actual, formal): + # formal arg is a type class and actual arg is a subclass + return True + elif isinstance(actual, formal): + # formal arg is a type class of which actual arg is an instance + return True + + def append(self, value, sig): + """ + Add a formal signature and its associated value. + """ + assert isinstance(sig, tuple), (value, sig) + self.versions.append((sig, value)) + self._cache.clear() + + +@utils.runonce +def _load_global_helpers(): + """ + Execute once to install special symbols into the LLVM symbol table. + """ + # This is Py_None's real C name + ll.add_symbol("_Py_NoneStruct", id(None)) + + # Add Numba C helper functions + for c_helpers in (_helperlib.c_helpers, _dynfunc.c_helpers): + for py_name, c_address in c_helpers.items(): + c_name = "numba_" + py_name + ll.add_symbol(c_name, c_address) + + # Add all built-in exception classes + for obj in utils.builtins.__dict__.values(): + if isinstance(obj, type) and issubclass(obj, BaseException): + ll.add_symbol("PyExc_%s" % (obj.__name__), id(obj)) + + +class BaseContext(object): + """ + + Notes on Structure + ------------------ + + Most objects are lowered as plain-old-data structure in the generated + llvm. They are passed around by reference (a pointer to the structure). + Only POD structure can live across function boundaries by copying the + data. + """ + # True if the target requires strict alignment + # Causes exception to be raised if the record members are not aligned. + strict_alignment = False + + # Force powi implementation as math.pow call + implement_powi_as_math_call = False + implement_pow_as_math_call = False + + # Emit Debug info + enable_debuginfo = False + DIBuilder = debuginfo.DIBuilder + + # Bound checking + @property + def enable_boundscheck(self): + if config.BOUNDSCHECK is not None: + return config.BOUNDSCHECK + return self._boundscheck + + @enable_boundscheck.setter + def enable_boundscheck(self, value): + self._boundscheck = value + + # NRT + enable_nrt = False + + # Auto parallelization + auto_parallel = False + + # PYCC + aot_mode = False + + # Error model for various operations (only FP exceptions currently) + error_model = None + + # Whether dynamic globals (CPU runtime addresses) is allowed + allow_dynamic_globals = False + + # Fast math flags + fastmath = False + + # python execution environment + environment = None + + # the function descriptor + fndesc = None + + def __init__(self, typing_context, target): + _load_global_helpers() + + self.address_size = utils.MACHINE_BITS + self.typing_context = typing_context + from numba.core.target_extension import target_registry + self.target_name = target + self.target = target_registry[target] + + # A mapping of installed registries to their loaders + self._registries = {} + # Declarations loaded from registries and other sources + self._defns = defaultdict(OverloadSelector) + self._getattrs = defaultdict(OverloadSelector) + self._setattrs = defaultdict(OverloadSelector) + self._casts = OverloadSelector() + self._get_constants = OverloadSelector() + # Other declarations + self._generators = {} + self.special_ops = {} + self.cached_internal_func = {} + self._pid = None + self._codelib_stack = [] + + self._boundscheck = False + + self.data_model_manager = datamodel.default_manager + + # Initialize + self.init() + + def init(self): + """ + For subclasses to add initializer + """ + + def refresh(self): + """ + Refresh context with new declarations from known registries. + Useful for third-party extensions. + """ + # load target specific registries + self.load_additional_registries() + + # Populate the builtin registry, this has to happen after loading + # additional registries as some of the "additional" registries write + # their implementations into the builtin_registry and would be missed if + # this ran first. + self.install_registry(builtin_registry) + + # Also refresh typing context, since @overload declarations can + # affect it. + self.typing_context.refresh() + + def load_additional_registries(self): + """ + Load target-specific registries. Can be overridden by subclasses. + """ + + def mangler(self, name, types, *, abi_tags=(), uid=None): + """ + Perform name mangling. + """ + return funcdesc.default_mangler(name, types, abi_tags=abi_tags, uid=uid) + + def get_env_name(self, fndesc): + """Get the environment name given a FunctionDescriptor. + + Use this instead of the ``fndesc.env_name`` so that the target-context + can provide necessary mangling of the symbol to meet ABI requirements. + """ + return fndesc.env_name + + def declare_env_global(self, module, envname): + """Declare the Environment pointer as a global of the module. + + The pointer is initialized to NULL. It must be filled by the runtime + with the actual address of the Env before the associated function + can be executed. + + Parameters + ---------- + module : + The LLVM Module + envname : str + The name of the global variable. + """ + if envname not in module.globals: + gv = llvmir.GlobalVariable(module, cgutils.voidptr_t, name=envname) + gv.linkage = 'common' + gv.initializer = cgutils.get_null_value(gv.type.pointee) + + return module.globals[envname] + + def get_arg_packer(self, fe_args): + return datamodel.ArgPacker(self.data_model_manager, fe_args) + + def get_data_packer(self, fe_types): + return datamodel.DataPacker(self.data_model_manager, fe_types) + + @property + def target_data(self): + raise NotImplementedError + + @cached_property + def nonconst_module_attrs(self): + """ + All module attrs are constant for targets using BaseContext. + """ + return tuple() + + @cached_property + def nrt(self): + from numba.core.runtime.context import NRTContext + return NRTContext(self, self.enable_nrt) + + def subtarget(self, **kws): + obj = copy.copy(self) # shallow copy + for k, v in kws.items(): + if not hasattr(obj, k): + raise NameError("unknown option {0!r}".format(k)) + setattr(obj, k, v) + if obj.codegen() is not self.codegen(): + # We can't share functions across different codegens + obj.cached_internal_func = {} + return obj + + def install_registry(self, registry): + """ + Install a *registry* (a imputils.Registry instance) of function + and attribute implementations. + """ + try: + loader = self._registries[registry] + except KeyError: + loader = RegistryLoader(registry) + self._registries[registry] = loader + self.insert_func_defn(loader.new_registrations('functions')) + self._insert_getattr_defn(loader.new_registrations('getattrs')) + self._insert_setattr_defn(loader.new_registrations('setattrs')) + self._insert_cast_defn(loader.new_registrations('casts')) + self._insert_get_constant_defn(loader.new_registrations('constants')) + + def insert_func_defn(self, defns): + for impl, func, sig in defns: + self._defns[func].append(impl, sig) + + def _insert_getattr_defn(self, defns): + for impl, attr, sig in defns: + self._getattrs[attr].append(impl, sig) + + def _insert_setattr_defn(self, defns): + for impl, attr, sig in defns: + self._setattrs[attr].append(impl, sig) + + def _insert_cast_defn(self, defns): + for impl, sig in defns: + self._casts.append(impl, sig) + + def _insert_get_constant_defn(self, defns): + for impl, sig in defns: + self._get_constants.append(impl, sig) + + def insert_user_function(self, func, fndesc, libs=()): + impl = user_function(fndesc, libs) + self._defns[func].append(impl, impl.signature) + + def insert_generator(self, genty, gendesc, libs=()): + assert isinstance(genty, types.Generator) + impl = user_generator(gendesc, libs) + self._generators[genty] = gendesc, impl + + def remove_user_function(self, func): + """ + Remove user function *func*. + KeyError is raised if the function isn't known to us. + """ + del self._defns[func] + + def get_external_function_type(self, fndesc): + argtypes = [self.get_argument_type(aty) + for aty in fndesc.argtypes] + # don't wrap in pointer + restype = self.get_argument_type(fndesc.restype) + fnty = llvmir.FunctionType(restype, argtypes) + return fnty + + def declare_function(self, module, fndesc): + fnty = self.call_conv.get_function_type(fndesc.restype, fndesc.argtypes) + fn = cgutils.get_or_insert_function(module, fnty, fndesc.mangled_name) + self.call_conv.decorate_function(fn, fndesc.args, fndesc.argtypes, noalias=fndesc.noalias) + if fndesc.inline: + fn.attributes.add('alwaysinline') + # alwaysinline overrides optnone + fn.attributes.discard('noinline') + fn.attributes.discard('optnone') + return fn + + def declare_external_function(self, module, fndesc): + fnty = self.get_external_function_type(fndesc) + fn = cgutils.get_or_insert_function(module, fnty, fndesc.mangled_name) + assert fn.is_declaration + for ak, av in zip(fndesc.args, fn.args): + av.name = "arg.%s" % ak + return fn + + def insert_const_string(self, mod, string): + """ + Insert constant *string* (a str object) into module *mod*. + """ + stringtype = GENERIC_POINTER + name = ".const.%s" % string + text = cgutils.make_bytearray(string.encode("utf-8") + b"\x00") + gv = self.insert_unique_const(mod, name, text) + return Constant.bitcast(gv, stringtype) + + def insert_const_bytes(self, mod, bytes, name=None): + """ + Insert constant *byte* (a `bytes` object) into module *mod*. + """ + stringtype = GENERIC_POINTER + name = ".bytes.%s" % (name or hash(bytes)) + text = cgutils.make_bytearray(bytes) + gv = self.insert_unique_const(mod, name, text) + return Constant.bitcast(gv, stringtype) + + def insert_unique_const(self, mod, name, val): + """ + Insert a unique internal constant named *name*, with LLVM value + *val*, into module *mod*. + """ + try: + gv = mod.get_global(name) + except KeyError: + return cgutils.global_constant(mod, name, val) + else: + return gv + + def get_argument_type(self, ty): + return self.data_model_manager[ty].get_argument_type() + + def get_return_type(self, ty): + return self.data_model_manager[ty].get_return_type() + + def get_data_type(self, ty): + """ + Get a LLVM data representation of the Numba type *ty* that is safe + for storage. Record data are stored as byte array. + + The return value is a llvmlite.ir.Type object, or None if the type + is an opaque pointer (???). + """ + return self.data_model_manager[ty].get_data_type() + + def get_value_type(self, ty): + return self.data_model_manager[ty].get_value_type() + + def pack_value(self, builder, ty, value, ptr, align=None): + """ + Pack value into the array storage at *ptr*. + If *align* is given, it is the guaranteed alignment for *ptr* + (by default, the standard ABI alignment). + """ + dataval = self.data_model_manager[ty].as_data(builder, value) + builder.store(dataval, ptr, align=align) + + def unpack_value(self, builder, ty, ptr, align=None): + """ + Unpack value from the array storage at *ptr*. + If *align* is given, it is the guaranteed alignment for *ptr* + (by default, the standard ABI alignment). + """ + dm = self.data_model_manager[ty] + return dm.load_from_data_pointer(builder, ptr, align) + + def get_constant_generic(self, builder, ty, val): + """ + Return a LLVM constant representing value *val* of Numba type *ty*. + """ + try: + impl = self._get_constants.find((ty,)) + return impl(self, builder, ty, val) + except NotImplementedError: + raise NotImplementedError("Cannot lower constant of type '%s'" % (ty,)) + + def get_constant(self, ty, val): + """ + Same as get_constant_generic(), but without specifying *builder*. + Works only for simple types. + """ + # HACK: pass builder=None to preserve get_constant() API + return self.get_constant_generic(None, ty, val) + + def get_constant_undef(self, ty): + lty = self.get_value_type(ty) + return Constant(lty, llvmir.Undefined) + + def get_constant_null(self, ty): + lty = self.get_value_type(ty) + return Constant(lty, None) + + def get_function(self, fn, sig, _firstcall=True): + """ + Return the implementation of function *fn* for signature *sig*. + The return value is a callable with the signature (builder, args). + """ + assert sig is not None + sig = sig.as_function() + if isinstance(fn, types.Callable): + key = fn.get_impl_key(sig) + overloads = self._defns[key] + else: + key = fn + overloads = self._defns[key] + + try: + return _wrap_impl(overloads.find(sig.args), self, sig) + except errors.NumbaNotImplementedError: + pass + if isinstance(fn, types.Type): + # It's a type instance => try to find a definition for the type class + try: + return self.get_function(type(fn), sig) + except NotImplementedError: + # Raise exception for the type instance, for a better error message + pass + + # Automatically refresh the context to load new registries if we are + # calling the first time. + if _firstcall: + self.refresh() + return self.get_function(fn, sig, _firstcall=False) + + raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) + + def get_generator_desc(self, genty): + """ + """ + return self._generators[genty][0] + + def get_generator_impl(self, genty): + """ + """ + res = self._generators[genty][1] + self.add_linking_libs(getattr(res, 'libs', ())) + return res + + def get_bound_function(self, builder, obj, ty): + assert self.get_value_type(ty) == obj.type + return obj + + def get_getattr(self, typ, attr): + """ + Get the getattr() implementation for the given type and attribute name. + The return value is a callable with the signature + (context, builder, typ, val, attr). + """ + const_attr = (typ, attr) not in self.nonconst_module_attrs + is_module = isinstance(typ, types.Module) + if is_module and const_attr: + # Implement getattr for module-level globals that we treat as + # constants. + # XXX We shouldn't have to retype this + attrty = self.typing_context.resolve_module_constants(typ, attr) + if attrty is None or isinstance(attrty, types.Dummy): + # No implementation required for dummies (functions, modules...), + # which are dealt with later + return None + else: + pyval = getattr(typ.pymod, attr) + def imp(context, builder, typ, val, attr): + llval = self.get_constant_generic(builder, attrty, pyval) + return impl_ret_borrowed(context, builder, attrty, llval) + return imp + + # Lookup specific getattr implementation for this type and attribute + overloads = self._getattrs[attr] + try: + return overloads.find((typ,)) + except errors.NumbaNotImplementedError: + pass + # Lookup generic getattr implementation for this type + overloads = self._getattrs[None] + try: + return overloads.find((typ,)) + except errors.NumbaNotImplementedError: + pass + + raise NotImplementedError("No definition for lowering %s.%s" % (typ, attr)) + + def get_setattr(self, attr, sig): + """ + Get the setattr() implementation for the given attribute name + and signature. + The return value is a callable with the signature (builder, args). + """ + assert len(sig.args) == 2 + typ = sig.args[0] + valty = sig.args[1] + + def wrap_setattr(impl): + def wrapped(builder, args): + return impl(self, builder, sig, args, attr) + return wrapped + + # Lookup specific setattr implementation for this type and attribute + overloads = self._setattrs[attr] + try: + return wrap_setattr(overloads.find((typ, valty))) + except errors.NumbaNotImplementedError: + pass + # Lookup generic setattr implementation for this type + overloads = self._setattrs[None] + try: + return wrap_setattr(overloads.find((typ, valty))) + except errors.NumbaNotImplementedError: + pass + + raise NotImplementedError("No definition for lowering %s.%s = %s" + % (typ, attr, valty)) + + def get_argument_value(self, builder, ty, val): + """ + Argument representation to local value representation + """ + return self.data_model_manager[ty].from_argument(builder, val) + + def get_returned_value(self, builder, ty, val): + """ + Return value representation to local value representation + """ + return self.data_model_manager[ty].from_return(builder, val) + + def get_return_value(self, builder, ty, val): + """ + Local value representation to return type representation + """ + return self.data_model_manager[ty].as_return(builder, val) + + def get_value_as_argument(self, builder, ty, val): + """Prepare local value representation as argument type representation + """ + return self.data_model_manager[ty].as_argument(builder, val) + + def get_value_as_data(self, builder, ty, val): + return self.data_model_manager[ty].as_data(builder, val) + + def get_data_as_value(self, builder, ty, val): + return self.data_model_manager[ty].from_data(builder, val) + + def pair_first(self, builder, val, ty): + """ + Extract the first element of a heterogeneous pair. + """ + pair = self.make_helper(builder, ty, val) + return pair.first + + def pair_second(self, builder, val, ty): + """ + Extract the second element of a heterogeneous pair. + """ + pair = self.make_helper(builder, ty, val) + return pair.second + + def cast(self, builder, val, fromty, toty): + """ + Cast a value of type *fromty* to type *toty*. + This implements implicit conversions as can happen due to the + granularity of the Numba type system, or lax Python semantics. + """ + if fromty is types._undef_var: + # Special case for undefined variable + return self.get_constant_null(toty) + elif fromty == toty or toty == types.Any: + return val + try: + impl = self._casts.find((fromty, toty)) + return impl(self, builder, fromty, toty, val) + except errors.NumbaNotImplementedError: + raise errors.NumbaNotImplementedError( + "Cannot cast %s to %s: %s" % (fromty, toty, val)) + + def generic_compare(self, builder, key, argtypes, args): + """ + Compare the given LLVM values of the given Numba types using + the comparison *key* (e.g. '=='). The values are first cast to + a common safe conversion type. + """ + at, bt = argtypes + av, bv = args + ty = self.typing_context.unify_types(at, bt) + assert ty is not None + cav = self.cast(builder, av, at, ty) + cbv = self.cast(builder, bv, bt, ty) + fnty = self.typing_context.resolve_value_type(key) + # the sig is homogeneous in the unified casted type + cmpsig = fnty.get_call_type(self.typing_context, (ty, ty), {}) + cmpfunc = self.get_function(fnty, cmpsig) + self.add_linking_libs(getattr(cmpfunc, 'libs', ())) + return cmpfunc(builder, (cav, cbv)) + + def make_optional_none(self, builder, valtype): + optval = self.make_helper(builder, types.Optional(valtype)) + optval.valid = cgutils.false_bit + return optval._getvalue() + + def make_optional_value(self, builder, valtype, value): + optval = self.make_helper(builder, types.Optional(valtype)) + optval.valid = cgutils.true_bit + optval.data = value + return optval._getvalue() + + def is_true(self, builder, typ, val): + """ + Return the truth value of a value of the given Numba type. + """ + fnty = self.typing_context.resolve_value_type(bool) + sig = fnty.get_call_type(self.typing_context, (typ,), {}) + impl = self.get_function(fnty, sig) + return impl(builder, (val,)) + + def get_c_value(self, builder, typ, name, dllimport=False): + """ + Get a global value through its C-accessible *name*, with the given + LLVM type. + If *dllimport* is true, the symbol will be marked as imported + from a DLL (necessary for AOT compilation under Windows). + """ + module = builder.function.module + try: + gv = module.globals[name] + except KeyError: + gv = cgutils.add_global_variable(module, typ, name) + if dllimport and self.aot_mode and sys.platform == 'win32': + gv.storage_class = "dllimport" + return gv + + def call_external_function(self, builder, callee, argtys, args): + args = [self.get_value_as_argument(builder, ty, arg) + for ty, arg in zip(argtys, args)] + retval = builder.call(callee, args) + return retval + + def get_function_pointer_type(self, typ): + return self.data_model_manager[typ].get_data_type() + + def call_function_pointer(self, builder, funcptr, args, cconv=None): + return builder.call(funcptr, args, cconv=cconv) + + def print_string(self, builder, text): + mod = builder.module + cstring = GENERIC_POINTER + fnty = llvmir.FunctionType(llvmir.IntType(32), [cstring]) + puts = cgutils.get_or_insert_function(mod, fnty, "puts") + return builder.call(puts, [text]) + + def debug_print(self, builder, text): + mod = builder.module + cstr = self.insert_const_string(mod, str(text)) + self.print_string(builder, cstr) + + def printf(self, builder, format_string, *args): + mod = builder.module + if isinstance(format_string, str): + cstr = self.insert_const_string(mod, format_string) + else: + cstr = format_string + fnty = llvmir.FunctionType(llvmir.IntType(32), (GENERIC_POINTER,), var_arg=True) + fn = cgutils.get_or_insert_function(mod, fnty, "printf") + return builder.call(fn, (cstr,) + tuple(args)) + + def get_struct_type(self, struct): + """ + Get the LLVM struct type for the given Structure class *struct*. + """ + fields = [self.get_value_type(v) for _, v in struct._fields] + return llvmir.LiteralStructType(fields) + + def get_dummy_value(self): + return Constant(self.get_dummy_type(), None) + + def get_dummy_type(self): + return GENERIC_POINTER + + def _compile_subroutine_no_cache(self, builder, impl, sig, locals={}, + flags=None): + """ + Invoke the compiler to compile a function to be used inside a + nopython function, but without generating code to call that + function. + + Note this context's flags are not inherited. + """ + # Compile + from numba.core import compiler + + with global_compiler_lock: + codegen = self.codegen() + library = codegen.create_library(impl.__name__) + if flags is None: + + cstk = targetconfig.ConfigStack() + flags = compiler.Flags() + if cstk: + tls_flags = cstk.top() + if tls_flags.is_set("nrt") and tls_flags.nrt: + flags.nrt = True + + flags.no_compile = True + flags.no_cpython_wrapper = True + flags.no_cfunc_wrapper = True + + cres = compiler.compile_internal(self.typing_context, self, + library, + impl, sig.args, + sig.return_type, flags, + locals=locals) + + # Allow inlining the function inside callers. + self.active_code_library.add_linking_library(cres.library) + return cres + + def compile_subroutine(self, builder, impl, sig, locals={}, flags=None, + caching=True): + """ + Compile the function *impl* for the given *sig* (in nopython mode). + Return an instance of CompileResult. + + If *caching* evaluates True, the function keeps the compiled function + for reuse in *.cached_internal_func*. + """ + cache_key = (impl.__code__, sig, type(self.error_model)) + if not caching: + cached = None + else: + if impl.__closure__: + # XXX This obviously won't work if a cell's value is + # unhashable. + cache_key += tuple(c.cell_contents for c in impl.__closure__) + cached = self.cached_internal_func.get(cache_key) + if cached is None: + cres = self._compile_subroutine_no_cache(builder, impl, sig, + locals=locals, + flags=flags) + self.cached_internal_func[cache_key] = cres + + cres = self.cached_internal_func[cache_key] + # Allow inlining the function inside callers. + self.active_code_library.add_linking_library(cres.library) + return cres + + def compile_internal(self, builder, impl, sig, args, locals={}): + """ + Like compile_subroutine(), but also call the function with the given + *args*. + """ + cres = self.compile_subroutine(builder, impl, sig, locals) + return self.call_internal(builder, cres.fndesc, sig, args) + + def call_internal(self, builder, fndesc, sig, args): + """ + Given the function descriptor of an internally compiled function, + emit a call to that function with the given arguments. + """ + status, res = self.call_internal_no_propagate(builder, fndesc, sig, args) + with cgutils.if_unlikely(builder, status.is_error): + self.call_conv.return_status_propagate(builder, status) + + res = imputils.fix_returning_optional(self, builder, sig, status, res) + return res + + def call_internal_no_propagate(self, builder, fndesc, sig, args): + """Similar to `.call_internal()` but does not handle or propagate + the return status automatically. + """ + # Add call to the generated function + llvm_mod = builder.module + fn = self.declare_function(llvm_mod, fndesc) + status, res = self.call_conv.call_function(builder, fn, sig.return_type, + sig.args, args) + return status, res + + def call_unresolved(self, builder, name, sig, args): + """ + Insert a function call to an unresolved symbol with the given *name*. + + Note: this is used for recursive call. + + In the mutual recursion case:: + + @njit + def foo(): + ... # calls bar() + + @njit + def bar(): + ... # calls foo() + + foo() + + When foo() is called, the compilation of bar() is fully completed + (codegen'ed and loaded) before foo() is. Since MCJIT's eager compilation + doesn't allow loading modules with declare-only functions (which is + needed for foo() in bar()), the call_unresolved injects a global + variable that the "linker" can update even after the module is loaded by + MCJIT. The linker would allocate space for the global variable before + the bar() module is loaded. When later foo() module is defined, it will + update bar()'s reference to foo(). + + The legacy lazy JIT and the new ORC JIT would allow a declare-only + function be used in a module as long as it is defined by the time of its + first use. + """ + # Insert an unresolved reference to the function being called. + codegen = self.codegen() + fnty = self.call_conv.get_function_type(sig.return_type, sig.args) + fn = codegen.insert_unresolved_ref(builder, fnty, name) + # Normal call sequence + status, res = self.call_conv.call_function(builder, fn, sig.return_type, + sig.args, args) + with cgutils.if_unlikely(builder, status.is_error): + self.call_conv.return_status_propagate(builder, status) + + res = imputils.fix_returning_optional(self, builder, sig, status, res) + return res + + def get_executable(self, func, fndesc, env): + raise NotImplementedError + + def get_python_api(self, builder): + return PythonAPI(self, builder) + + def sentry_record_alignment(self, rectyp, attr): + """ + Assumes offset starts from a properly aligned location + """ + if self.strict_alignment: + offset = rectyp.offset(attr) + elemty = rectyp.typeof(attr) + if isinstance(elemty, types.NestedArray): + # For a NestedArray we need to consider the data type of + # elements of the array for alignment, not the array structure + # itself + elemty = elemty.dtype + align = self.get_abi_alignment(self.get_data_type(elemty)) + if offset % align: + msg = "{rec}.{attr} of type {type} is not aligned".format( + rec=rectyp, attr=attr, type=elemty) + raise errors.NumbaTypeError(msg) + + def get_helper_class(self, typ, kind='value'): + """ + Get a helper class for the given *typ*. + """ + # XXX handle all types: complex, array, etc. + # XXX should it be a method on the model instead? this would allow a default kind... + return cgutils.create_struct_proxy(typ, kind) + + def _make_helper(self, builder, typ, value=None, ref=None, kind='value'): + cls = self.get_helper_class(typ, kind) + return cls(self, builder, value=value, ref=ref) + + def make_helper(self, builder, typ, value=None, ref=None): + """ + Get a helper object to access the *typ*'s members, + for the given value or reference. + """ + return self._make_helper(builder, typ, value, ref, kind='value') + + def make_data_helper(self, builder, typ, ref=None): + """ + As make_helper(), but considers the value as stored in memory, + rather than a live value. + """ + return self._make_helper(builder, typ, ref=ref, kind='data') + + def make_array(self, typ): + from numba.np import arrayobj + return arrayobj.make_array(typ) + + def populate_array(self, arr, **kwargs): + """ + Populate array structure. + """ + from numba.np import arrayobj + return arrayobj.populate_array(arr, **kwargs) + + def make_complex(self, builder, typ, value=None): + """ + Get a helper object to access the given complex numbers' members. + """ + assert isinstance(typ, types.Complex), typ + return self.make_helper(builder, typ, value) + + def make_tuple(self, builder, typ, values): + """ + Create a tuple of the given *typ* containing the *values*. + """ + tup = self.get_constant_undef(typ) + for i, val in enumerate(values): + tup = builder.insert_value(tup, val, i) + return tup + + def make_constant_array(self, builder, typ, ary): + """ + Create an array structure reifying the given constant array. + A low-level contiguous array constant is created in the LLVM IR. + """ + datatype = self.get_data_type(typ.dtype) + # don't freeze ary of non-contig or bigger than 1MB + size_limit = 10**6 + + if (self.allow_dynamic_globals and + (typ.layout not in 'FC' or ary.nbytes > size_limit)): + # get pointer from the ary + dataptr = ary.ctypes.data + data = self.add_dynamic_addr(builder, dataptr, info=str(type(dataptr))) + rt_addr = self.add_dynamic_addr(builder, id(ary), info=str(type(ary))) + else: + # Handle data: reify the flattened array in "C" or "F" order as a + # global array of bytes. + flat = ary.flatten(order=typ.layout) + # Note: we use `bytearray(flat.data)` instead of `bytearray(flat)` to + # workaround issue #1850 which is due to numpy issue #3147 + consts = cgutils.create_constant_array(llvmir.IntType(8), bytearray(flat.data)) + data = cgutils.global_constant(builder, ".const.array.data", consts) + # Ensure correct data alignment (issue #1933) + data.align = self.get_abi_alignment(datatype) + # No reference to parent ndarray + rt_addr = None + + # Handle shape + llintp = self.get_value_type(types.intp) + shapevals = [self.get_constant(types.intp, s) for s in ary.shape] + cshape = cgutils.create_constant_array(llintp, shapevals) + + # Handle strides + stridevals = [self.get_constant(types.intp, s) for s in ary.strides] + cstrides = cgutils.create_constant_array(llintp, stridevals) + + # Create array structure + cary = self.make_array(typ)(self, builder) + + intp_itemsize = self.get_constant(types.intp, ary.dtype.itemsize) + self.populate_array(cary, + data=builder.bitcast(data, cary.data.type), + shape=cshape, + strides=cstrides, + itemsize=intp_itemsize, + parent=rt_addr, + meminfo=None) + + return cary._getvalue() + + def add_dynamic_addr(self, builder, intaddr, info): + """ + Returns dynamic address as a void pointer `i8*`. + + Internally, a global variable is added to inform the lowerer about + the usage of dynamic addresses. Caching will be disabled. + """ + assert self.allow_dynamic_globals, "dyn globals disabled in this target" + assert isinstance(intaddr, int), 'dyn addr not of int type' + mod = builder.module + llvoidptr = self.get_value_type(types.voidptr) + addr = self.get_constant(types.uintp, intaddr).inttoptr(llvoidptr) + # Use a unique name by embedding the address value + symname = 'numba.dynamic.globals.{:x}'.format(intaddr) + gv = cgutils.add_global_variable(mod, llvoidptr, symname) + # Use linkonce linkage to allow merging with other GV of the same name. + # And, avoid optimization from assuming its value. + gv.linkage = 'linkonce' + gv.initializer = addr + return builder.load(gv) + + def get_abi_sizeof(self, ty): + """ + Get the ABI size of LLVM type *ty*. + """ + assert isinstance(ty, llvmir.Type), "Expected LLVM type" + return ty.get_abi_size(self.target_data) + + def get_abi_alignment(self, ty): + """ + Get the ABI alignment of LLVM type *ty*. + """ + assert isinstance(ty, llvmir.Type), "Expected LLVM type" + return ty.get_abi_alignment(self.target_data) + + def get_preferred_array_alignment(context, ty): + """ + Get preferred array alignment for Numba type *ty*. + """ + # AVX prefers 32-byte alignment + return 32 + + def post_lowering(self, mod, library): + """Run target specific post-lowering transformation here. + """ + + def create_module(self, name): + """Create a LLVM module + + The default implementation in BaseContext always raises a + ``NotImplementedError`` exception. Subclasses should implement + this method. + """ + raise NotImplementedError + + @property + def active_code_library(self): + """Get the active code library + """ + return self._codelib_stack[-1] + + @contextmanager + def push_code_library(self, lib): + """Push the active code library for the context + """ + self._codelib_stack.append(lib) + try: + yield + finally: + self._codelib_stack.pop() + + def add_linking_libs(self, libs): + """Add iterable of linking libraries to the *active_code_library*. + """ + colib = self.active_code_library + for lib in libs: + colib.add_linking_library(lib) + + def get_ufunc_info(self, ufunc_key): + """Get the ufunc implementation for a given ufunc object. + + The default implementation in BaseContext always raises a + ``NotImplementedError`` exception. Subclasses may raise ``KeyError`` + to signal that the given ``ufunc_key`` is not available. + + Parameters + ---------- + ufunc_key : NumPy ufunc + + Returns + ------- + res : dict[str, callable] + A mapping of a NumPy ufunc type signature to a lower-level + implementation. + """ + raise NotImplementedError(f"{self} does not support ufunc") + +class _wrap_impl(object): + """ + A wrapper object to call an implementation function with some predefined + (context, signature) arguments. + The wrapper also forwards attribute queries, which is important. + """ + + def __init__(self, imp, context, sig): + self._callable = _wrap_missing_loc(imp) + self._imp = self._callable() + self._context = context + self._sig = sig + + def __call__(self, builder, args, loc=None): + res = self._imp(self._context, builder, self._sig, args, loc=loc) + self._context.add_linking_libs(getattr(self, 'libs', ())) + return res + + def __getattr__(self, item): + return getattr(self._imp, item) + + def __repr__(self): + return "" % repr(self._callable) + +def _has_loc(fn): + """Does function *fn* take ``loc`` argument? + """ + sig = utils.pysignature(fn) + return 'loc' in sig.parameters + + +class _wrap_missing_loc(object): + + def __init__(self, fn): + self.func = fn # store this to help with debug + + def __call__(self): + """Wrap function for missing ``loc`` keyword argument. + Otherwise, return the original *fn*. + """ + fn = self.func + if not _has_loc(fn): + def wrapper(*args, **kwargs): + kwargs.pop('loc') # drop unused loc + return fn(*args, **kwargs) + + # Copy the following attributes from the wrapped. + # Following similar implementation as functools.wraps but + # ignore attributes if not available (i.e fix py2.7) + attrs = '__name__', 'libs' + for attr in attrs: + try: + val = getattr(fn, attr) + except AttributeError: + pass + else: + setattr(wrapper, attr, val) + + return wrapper + else: + return fn + + def __repr__(self): + return "" % self.func + + +@utils.runonce +def _initialize_llvm_lock_event(): + """Initial event triggers for LLVM lock + """ + def enter_fn(): + event.start_event("numba:llvm_lock") + + def exit_fn(): + event.end_event("numba:llvm_lock") + + ll.ffi.register_lock_callback(enter_fn, exit_fn) + + +_initialize_llvm_lock_event() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/boxing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/boxing.py new file mode 100644 index 0000000000000000000000000000000000000000..9e91c155b0d496e3dc2b4c8125939d6368c3ca90 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/boxing.py @@ -0,0 +1,10 @@ +import sys +from numba.core.utils import _RedirectSubpackage +from numba.core import config + +if config.USE_LEGACY_TYPE_SYSTEM: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.core.old_boxing") +else: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.core.new_boxing") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/bytecode.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/bytecode.py new file mode 100644 index 0000000000000000000000000000000000000000..3df9c06bddfdfaeab7cd26938d68ebb2cebd048c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/bytecode.py @@ -0,0 +1,677 @@ +from collections import namedtuple, OrderedDict +import dis +import inspect +import itertools + +from types import CodeType, ModuleType + +from numba.core import errors, utils, serialize +from numba.core.utils import PYVERSION + + +if PYVERSION in ((3, 12), (3, 13)): + from opcode import _inline_cache_entries + # Instruction/opcode length in bytes + INSTR_LEN = 2 +elif PYVERSION in ((3, 10), (3, 11)): + pass +else: + raise NotImplementedError(PYVERSION) + + +opcode_info = namedtuple('opcode_info', ['argsize']) +_ExceptionTableEntry = namedtuple("_ExceptionTableEntry", + "start end target depth lasti") + +# The following offset is used as a hack to inject a NOP at the start of the +# bytecode. So that function starting with `while True` will not have block-0 +# as a jump target. The Lowerer puts argument initialization at block-0. +_FIXED_OFFSET = 2 + + +def get_function_object(obj): + """ + Objects that wraps function should provide a "__numba__" magic attribute + that contains a name of an attribute that contains the actual python + function object. + """ + attr = getattr(obj, "__numba__", None) + if attr: + return getattr(obj, attr) + return obj + + +def get_code_object(obj): + "Shamelessly borrowed from llpython" + return getattr(obj, '__code__', getattr(obj, 'func_code', None)) + + +def _as_opcodes(seq): + lst = [] + for s in seq: + c = dis.opmap.get(s) + if c is not None: + lst.append(c) + return lst + + +JREL_OPS = frozenset(dis.hasjrel) +JABS_OPS = frozenset(dis.hasjabs) +JUMP_OPS = JREL_OPS | JABS_OPS +TERM_OPS = frozenset(_as_opcodes(['RETURN_VALUE', 'RAISE_VARARGS'])) +EXTENDED_ARG = dis.EXTENDED_ARG +HAVE_ARGUMENT = dis.HAVE_ARGUMENT + + +class ByteCodeInst(object): + ''' + Attributes + ---------- + - offset: + byte offset of opcode + - opcode: + opcode integer value + - arg: + instruction arg + - lineno: + -1 means unknown + ''' + __slots__ = 'offset', 'next', 'opcode', 'opname', 'arg', 'lineno' + + def __init__(self, offset, opcode, arg, nextoffset): + self.offset = offset + self.next = nextoffset + self.opcode = opcode + self.opname = dis.opname[opcode] + self.arg = arg + self.lineno = -1 # unknown line number + + @property + def is_jump(self): + return self.opcode in JUMP_OPS + + @property + def is_terminator(self): + return self.opcode in TERM_OPS + + def get_jump_target(self): + # With Python 3.10 the addressing of "bytecode" instructions has + # changed from using bytes to using 16-bit words instead. As a + # consequence the code to determine where a jump will lead had to be + # adapted. + # See also: + # https://bugs.python.org/issue26647 + # https://bugs.python.org/issue27129 + # https://github.com/python/cpython/pull/25069 + assert self.is_jump + if PYVERSION in ((3, 13),): + if self.opcode in (dis.opmap[k] + for k in ["JUMP_BACKWARD", + "JUMP_BACKWARD_NO_INTERRUPT"]): + return self.next - (self.arg * 2) + elif PYVERSION in ((3, 12),): + if self.opcode in (dis.opmap[k] + for k in ["JUMP_BACKWARD"]): + return self.offset - (self.arg - 1) * 2 + elif PYVERSION in ((3, 11), ): + if self.opcode in (dis.opmap[k] + for k in ("JUMP_BACKWARD", + "POP_JUMP_BACKWARD_IF_TRUE", + "POP_JUMP_BACKWARD_IF_FALSE", + "POP_JUMP_BACKWARD_IF_NONE", + "POP_JUMP_BACKWARD_IF_NOT_NONE",)): + return self.offset - (self.arg - 1) * 2 + elif PYVERSION in ((3, 10),): + pass + else: + raise NotImplementedError(PYVERSION) + + if PYVERSION in ((3, 10), (3, 11), (3, 12), (3, 13)): + if self.opcode in JREL_OPS: + return self.next + self.arg * 2 + else: + assert self.opcode in JABS_OPS + return self.arg * 2 - 2 + else: + raise NotImplementedError(PYVERSION) + + def __repr__(self): + return '%s(arg=%s, lineno=%d)' % (self.opname, self.arg, self.lineno) + + @property + def block_effect(self): + """Effect of the block stack + Returns +1 (push), 0 (none) or -1 (pop) + """ + if self.opname.startswith('SETUP_'): + return 1 + elif self.opname == 'POP_BLOCK': + return -1 + else: + return 0 + + +CODE_LEN = 1 +ARG_LEN = 1 +NO_ARG_LEN = 1 + +OPCODE_NOP = dis.opname.index('NOP') + + +if PYVERSION in ((3, 13),): + + def _unpack_opargs(code): + buf = [] + for i, start_offset, op, arg in dis._unpack_opargs(code): + buf.append((start_offset, op, arg)) + for i, (start_offset, op, arg) in enumerate(buf): + if i + 1 < len(buf): + next_offset = buf[i + 1][0] + else: + next_offset = len(code) + yield (start_offset, op, arg, next_offset) + +elif PYVERSION in ((3, 10), (3, 11), (3, 12)): + + # Adapted from Lib/dis.py + def _unpack_opargs(code): + """ + Returns a 4-int-tuple of + (bytecode offset, opcode, argument, offset of next bytecode). + """ + extended_arg = 0 + n = len(code) + offset = i = 0 + while i < n: + op = code[i] + i += CODE_LEN + if op >= HAVE_ARGUMENT: + arg = code[i] | extended_arg + for j in range(ARG_LEN): + arg |= code[i + j] << (8 * j) + i += ARG_LEN + if PYVERSION in ((3, 12),): + # Python 3.12 introduced cache slots. We need to account for + # cache slots when we determine the offset of the next + # opcode. The number of cache slots is specific to each + # opcode and can be looked up in the _inline_cache_entries + # dictionary. + i += _inline_cache_entries[op] * INSTR_LEN + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + if op == EXTENDED_ARG: + # This is a deviation from what dis does... + # In python 3.11 it seems like EXTENDED_ARGs appear more + # often and are also used as jump targets. So as to not have + # to do "book keeping" for where EXTENDED_ARGs have been + # "skipped" they are replaced with NOPs so as to provide a + # legal jump target and also ensure that the bytecode + # offsets are correct. + yield (offset, OPCODE_NOP, arg, i) + extended_arg = arg << 8 * ARG_LEN + offset = i + continue + else: + arg = None + i += NO_ARG_LEN + if PYVERSION in ((3, 12),): + # Python 3.12 introduced cache slots. We need to account for + # cache slots when we determine the offset of the next + # opcode. The number of cache slots is specific to each + # opcode and can be looked up in the _inline_cache_entries + # dictionary. + i += _inline_cache_entries[op] * INSTR_LEN + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + extended_arg = 0 + yield (offset, op, arg, i) + offset = i # Mark inst offset at first extended +else: + raise NotImplementedError(PYVERSION) + + +def _patched_opargs(bc_stream): + """Patch the bytecode stream. + + - Adds a NOP bytecode at the start to avoid jump target being at the entry. + """ + # Injected NOP + yield (0, OPCODE_NOP, None, _FIXED_OFFSET) + # Adjust bytecode offset for the rest of the stream + for offset, opcode, arg, nextoffset in bc_stream: + # If the opcode has an absolute jump target, adjust it. + if opcode in JABS_OPS: + arg += _FIXED_OFFSET + yield offset + _FIXED_OFFSET, opcode, arg, nextoffset + _FIXED_OFFSET + + +class ByteCodeIter(object): + def __init__(self, code): + self.code = code + self.iter = iter(_patched_opargs(_unpack_opargs(self.code.co_code))) + + def __iter__(self): + return self + + def _fetch_opcode(self): + return next(self.iter) + + def next(self): + offset, opcode, arg, nextoffset = self._fetch_opcode() + return offset, ByteCodeInst(offset=offset, opcode=opcode, arg=arg, + nextoffset=nextoffset) + + __next__ = next + + def read_arg(self, size): + buf = 0 + for i in range(size): + _offset, byte = next(self.iter) + buf |= byte << (8 * i) + return buf + + +class _ByteCode(object): + """ + The decoded bytecode of a function, and related information. + """ + __slots__ = ('func_id', 'co_names', 'co_varnames', 'co_consts', + 'co_cellvars', 'co_freevars', 'exception_entries', + 'table', 'labels') + + def __init__(self, func_id): + code = func_id.code + + labels = set(x + _FIXED_OFFSET for x in dis.findlabels(code.co_code)) + labels.add(0) + + # A map of {offset: ByteCodeInst} + table = OrderedDict(ByteCodeIter(code)) + self._compute_lineno(table, code) + + self.func_id = func_id + self.co_names = code.co_names + self.co_varnames = code.co_varnames + self.co_consts = code.co_consts + self.co_cellvars = code.co_cellvars + self.co_freevars = code.co_freevars + + self.table = table + self.labels = sorted(labels) + + @classmethod + def _compute_lineno(cls, table, code): + """ + Compute the line numbers for all bytecode instructions. + """ + for offset, lineno in dis.findlinestarts(code): + adj_offset = offset + _FIXED_OFFSET + if adj_offset in table: + table[adj_offset].lineno = lineno + # Assign unfilled lineno + # Start with first bytecode's lineno + known = code.co_firstlineno + for inst in table.values(): + if inst.lineno is not None and inst.lineno >= 0: + known = inst.lineno + else: + inst.lineno = known + return table + + def __iter__(self): + return iter(self.table.values()) + + def __getitem__(self, offset): + return self.table[offset] + + def __contains__(self, offset): + return offset in self.table + + def dump(self): + def label_marker(i): + if i[1].offset in self.labels: + return '>' + else: + return ' ' + + return '\n'.join('%s %10s\t%s' % ((label_marker(i),) + i) + for i in self.table.items() + if i[1].opname != "CACHE") + + @classmethod + def _compute_used_globals(cls, func, table, co_consts, co_names): + """ + Compute the globals used by the function with the given + bytecode table. + """ + d = {} + globs = func.__globals__ + builtins = globs.get('__builtins__', utils.builtins) + if isinstance(builtins, ModuleType): + builtins = builtins.__dict__ + # Look for LOAD_GLOBALs in the bytecode + for inst in table.values(): + if inst.opname == 'LOAD_GLOBAL': + name = co_names[_fix_LOAD_GLOBAL_arg(inst.arg)] + if name not in d: + try: + value = globs[name] + except KeyError: + value = builtins[name] + d[name] = value + # Add globals used by any nested code object + for co in co_consts: + if isinstance(co, CodeType): + subtable = OrderedDict(ByteCodeIter(co)) + d.update(cls._compute_used_globals(func, subtable, + co.co_consts, co.co_names)) + return d + + def get_used_globals(self): + """ + Get a {name: value} map of the globals used by this code + object and any nested code objects. + """ + return self._compute_used_globals(self.func_id.func, self.table, + self.co_consts, self.co_names) + + +def _fix_LOAD_GLOBAL_arg(arg): + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + return arg >> 1 + elif PYVERSION in ((3, 10),): + return arg + else: + raise NotImplementedError(PYVERSION) + + +class ByteCodePy311(_ByteCode): + + def __init__(self, func_id): + super().__init__(func_id) + entries = dis.Bytecode(func_id.code).exception_entries + self.exception_entries = tuple(map(self.fixup_eh, entries)) + + @staticmethod + def fixup_eh(ent): + # Patch up the exception table offset + # because we add a NOP in _patched_opargs + out = dis._ExceptionTableEntry( + start=ent.start + _FIXED_OFFSET, end=ent.end + _FIXED_OFFSET, + target=ent.target + _FIXED_OFFSET, + depth=ent.depth, lasti=ent.lasti, + ) + return out + + def find_exception_entry(self, offset): + """ + Returns the exception entry for the given instruction offset + """ + candidates = [] + for ent in self.exception_entries: + if ent.start <= offset < ent.end: + candidates.append((ent.depth, ent)) + if candidates: + ent = max(candidates)[1] + return ent + + +class ByteCodePy312(ByteCodePy311): + + def __init__(self, func_id): + super().__init__(func_id) + + # initialize lazy property + self._ordered_offsets = None + + # Fixup offsets for all exception entries. + entries = [self.fixup_eh(e) for e in + dis.Bytecode(func_id.code).exception_entries + ] + + # Remove exceptions, innermost ones first + # Can be done by using a stack + entries = self.remove_build_list_swap_pattern(entries) + + # If this is a generator, we need to skip any exception table entries + # that point to the exception handler with the highest offset. + if func_id.is_generator: + # Get the exception handler with the highest offset. + max_exception_target = max([e.target for e in entries]) + # Remove any exception table entries that point to that exception + # handler. + entries = [e for e in entries if e.target != max_exception_target] + + self.exception_entries = tuple(entries) + + @property + def ordered_offsets(self): + if not self._ordered_offsets: + # Get an ordered list of offsets. + self._ordered_offsets = [o for o in self.table] + return self._ordered_offsets + + def remove_build_list_swap_pattern(self, entries): + """ Find the following bytecode pattern: + + BUILD_{LIST, MAP, SET} + SWAP(2) + FOR_ITER + ... + END_FOR + SWAP(2) + + This pattern indicates that a list/dict/set comprehension has + been inlined. In this case we can skip the exception blocks + entirely along with the dead exceptions that it points to. + A pair of exception that sandwiches these exception will + also be merged into a single exception. + + Update for Python 3.13, the ending of the pattern has a extra + POP_TOP: + + ... + END_FOR + POP_TOP + SWAP(2) + + Update for Python 3.13.1, there's now a GET_ITER before FOR_ITER. + This patch the GET_ITER to NOP to minimize changes downstream + (e.g. array-comprehension). + """ + def pop_and_merge_exceptions(entries: list, + entry_to_remove: _ExceptionTableEntry): + lower_entry_idx = entries.index(entry_to_remove) - 1 + upper_entry_idx = entries.index(entry_to_remove) + 1 + + # Merge the upper and lower exceptions if possible. + if lower_entry_idx >= 0 and upper_entry_idx < len(entries): + lower_entry = entries[lower_entry_idx] + upper_entry = entries[upper_entry_idx] + if lower_entry.target == upper_entry.target: + entries[lower_entry_idx] = _ExceptionTableEntry( + lower_entry.start, + upper_entry.end, + lower_entry.target, + lower_entry.depth, + upper_entry.lasti) + entries.remove(upper_entry) + + # Remove the exception entry. + entries.remove(entry_to_remove) + # Remove dead exceptions, if any, that the entry above may point to. + entries = [e for e in entries + if not e.start == entry_to_remove.target] + return entries + + change_to_nop = set() + work_remaining = True + while work_remaining: + # Temporarily set work_remaining to False, if we find a pattern + # then work is not complete, hence we set it again to True. + work_remaining = False + current_nop_fixes = set() + for entry in entries.copy(): + # Check start of pattern, three instructions. + # Work out the index of the instruction. + index = self.ordered_offsets.index(entry.start) + # If there is a BUILD_{LIST, MAP, SET} instruction at this + # location. + curr_inst = self.table[self.ordered_offsets[index]] + if curr_inst.opname not in ("BUILD_LIST", + "BUILD_MAP", + "BUILD_SET"): + continue + # Check if the BUILD_{LIST, MAP, SET} instruction is followed + # by a SWAP(2). + next_inst = self.table[self.ordered_offsets[index + 1]] + if not next_inst.opname == "SWAP" and next_inst.arg == 2: + continue + next_inst = self.table[self.ordered_offsets[index + 2]] + # Check if the SWAP is followed by a FOR_ITER + # BUT Python3.13.1 introduced an extra GET_ITER. + # If we see a GET_ITER here, check if the next thing is a + # FOR_ITER. + if next_inst.opname == "GET_ITER": + # Add the inst to potentially be replaced to NOP + current_nop_fixes.add(next_inst) + # Loop up next instruction. + next_inst = self.table[self.ordered_offsets[index + 3]] + + if not next_inst.opname == "FOR_ITER": + continue + + if PYVERSION in ((3, 13),): + # Check end of pattern, two instructions. + # Check for the corresponding END_FOR, exception table end + # is non-inclusive, so subtract one. + index = self.ordered_offsets.index(entry.end) + curr_inst = self.table[self.ordered_offsets[index - 2]] + if not curr_inst.opname == "END_FOR": + continue + next_inst = self.table[self.ordered_offsets[index - 1]] + if not next_inst.opname == "POP_TOP": + continue + # END_FOR must be followed by SWAP(2) + next_inst = self.table[self.ordered_offsets[index]] + if not next_inst.opname == "SWAP" and next_inst.arg == 2: + continue + elif PYVERSION in ((3, 10), (3, 11), (3, 12)): + # Check end of pattern, two instructions. + # Check for the corresponding END_FOR, exception table end + # is non-inclusive, so subtract one. + index = self.ordered_offsets.index(entry.end) + curr_inst = self.table[self.ordered_offsets[index - 1]] + if not curr_inst.opname == "END_FOR": + continue + # END_FOR must be followed by SWAP(2) + next_inst = self.table[self.ordered_offsets[index]] + if not next_inst.opname == "SWAP" and next_inst.arg == 2: + continue + else: + raise NotImplementedError(PYVERSION) + # If all conditions are met that means this exception entry + # is for a list/dict/set comprehension and can be removed. + # Also if there exist exception entries above and below this + # entry pointing to the same target. those can be merged into + # a single bigger exception block. + entries = pop_and_merge_exceptions(entries, entry) + work_remaining = True + + # Commit NOP fixes since we confirmed the suspects belong to + # a comprehension code. + change_to_nop |= current_nop_fixes + + # Complete fixes to NOPs + for inst in change_to_nop: + self.table[inst.offset] = ByteCodeInst(inst.offset, + dis.opmap["NOP"], + None, + inst.next) + return entries + + +if PYVERSION == (3, 11): + ByteCode = ByteCodePy311 +elif PYVERSION in ((3, 12), (3, 13),): + ByteCode = ByteCodePy312 +elif PYVERSION < (3, 11): + ByteCode = _ByteCode +else: + raise NotImplementedError(PYVERSION) + + +class FunctionIdentity(serialize.ReduceMixin): + """ + A function's identity and metadata. + + Note this typically represents a function whose bytecode is + being compiled, not necessarily the top-level user function + (the two might be distinct). + """ + _unique_ids = itertools.count(1) + + @classmethod + def from_function(cls, pyfunc): + """ + Create the FunctionIdentity of the given function. + """ + func = get_function_object(pyfunc) + code = get_code_object(func) + pysig = utils.pysignature(func) + if not code: + raise errors.ByteCodeSupportError( + "%s does not provide its bytecode" % func) + + try: + func_qualname = func.__qualname__ + except AttributeError: + func_qualname = func.__name__ + + self = cls() + self.func = func + self.func_qualname = func_qualname + self.func_name = func_qualname.split('.')[-1] + self.code = code + self.module = inspect.getmodule(func) + self.modname = (utils._dynamic_modname + if self.module is None + else self.module.__name__) + self.is_generator = inspect.isgeneratorfunction(func) + self.pysig = pysig + self.filename = code.co_filename + self.firstlineno = code.co_firstlineno + self.arg_count = len(pysig.parameters) + self.arg_names = list(pysig.parameters) + + # Even the same function definition can be compiled into + # several different function objects with distinct closure + # variables, so we make sure to disambiguate using an unique id. + uid = next(cls._unique_ids) + self.unique_name = '{}${}'.format(self.func_qualname, uid) + self.unique_id = uid + + return self + + def derive(self): + """Copy the object and increment the unique counter. + """ + return self.from_function(self.func) + + def _reduce_states(self): + """ + NOTE: part of ReduceMixin protocol + """ + return dict(pyfunc=self.func) + + @classmethod + def _rebuild(cls, pyfunc): + """ + NOTE: part of ReduceMixin protocol + """ + return cls.from_function(pyfunc) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/byteflow.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/byteflow.py new file mode 100644 index 0000000000000000000000000000000000000000..4e344999c67d3e9476fb1ce89135fd53c415d0a9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/byteflow.py @@ -0,0 +1,2222 @@ +""" +Implement python 3.8+ bytecode analysis +""" +import dis +import logging +from collections import namedtuple, defaultdict, deque +from functools import total_ordering + +from numba.core.utils import (UniqueDict, PYVERSION, ALL_BINOPS_TO_OPERATORS, + _lazy_pformat) +from numba.core.controlflow import NEW_BLOCKERS, CFGraph +from numba.core.ir import Loc +from numba.core.errors import UnsupportedBytecodeError + + +_logger = logging.getLogger(__name__) + +_EXCEPT_STACK_OFFSET = 6 +_FINALLY_POP = _EXCEPT_STACK_OFFSET +_NO_RAISE_OPS = frozenset({ + 'LOAD_CONST', + 'NOP', + 'LOAD_DEREF', + 'PRECALL', +}) + +if PYVERSION in ((3, 12), (3, 13)): + from enum import Enum + + # Operands for CALL_INTRINSIC_1 + class CALL_INTRINSIC_1_Operand(Enum): + INTRINSIC_STOPITERATION_ERROR = 3 + UNARY_POSITIVE = 5 + INTRINSIC_LIST_TO_TUPLE = 6 + ci1op = CALL_INTRINSIC_1_Operand +elif PYVERSION in ((3, 10), (3, 11)): + pass +else: + raise NotImplementedError(PYVERSION) + + +@total_ordering +class BlockKind(object): + """Kinds of block to make related code safer than just `str`. + """ + _members = frozenset({ + 'LOOP', + 'TRY', 'EXCEPT', 'FINALLY', + 'WITH', 'WITH_FINALLY', + }) + + def __init__(self, value): + assert value in self._members + self._value = value + + def __hash__(self): + return hash((type(self), self._value)) + + def __lt__(self, other): + if isinstance(other, BlockKind): + return self._value < other._value + else: + raise TypeError('cannot compare to {!r}'.format(type(other))) + + def __eq__(self, other): + if isinstance(other, BlockKind): + return self._value == other._value + else: + raise TypeError('cannot compare to {!r}'.format(type(other))) + + def __repr__(self): + return "BlockKind({})".format(self._value) + + +class Flow(object): + """Data+Control Flow analysis. + + Simulate execution to recover dataflow and controlflow information. + """ + def __init__(self, bytecode): + _logger.debug("bytecode dump:\n%s", bytecode.dump()) + self._bytecode = bytecode + self.block_infos = UniqueDict() + + def run(self): + """Run a trace over the bytecode over all reachable path. + + The trace starts at bytecode offset 0 and gathers stack and control- + flow information by partially interpreting each bytecode. + Each ``State`` instance in the trace corresponds to a basic-block. + The State instances forks when a jump instruction is encountered. + A newly forked state is then added to the list of pending states. + The trace ends when there are no more pending states. + """ + firststate = State(bytecode=self._bytecode, pc=0, nstack=0, + blockstack=()) + runner = TraceRunner(debug_filename=self._bytecode.func_id.filename) + runner.pending.append(firststate) + + # Enforce unique-ness on initial PC to avoid re-entering the PC with + # a different stack-depth. We don't know if such a case is ever + # possible, but no such case has been encountered in our tests. + first_encounter = UniqueDict() + # Loop over each pending state at a initial PC. + # Each state is tracing a basic block + while runner.pending: + _logger.debug("pending: %s", runner.pending) + state = runner.pending.popleft() + if state not in runner.finished: + _logger.debug("stack: %s", state._stack) + _logger.debug("state.pc_initial: %s", state) + first_encounter[state.pc_initial] = state + # Loop over the state until it is terminated. + while True: + runner.dispatch(state) + # Terminated? + if state.has_terminated(): + break + else: + if self._run_handle_exception(runner, state): + break + + if self._is_implicit_new_block(state): + # check if this is a with...as, abort if so + self._guard_with_as(state) + # else split + state.split_new_block() + break + _logger.debug("end state. edges=%s", state.outgoing_edges) + runner.finished.add(state) + out_states = state.get_outgoing_states() + runner.pending.extend(out_states) + + # Complete controlflow + self._build_cfg(runner.finished) + # Prune redundant PHI-nodes + self._prune_phis(runner) + # Post process + for state in sorted(runner.finished, key=lambda x: x.pc_initial): + self.block_infos[state.pc_initial] = si = adapt_state_infos(state) + _logger.debug("block_infos %s:\n%s", state, si) + + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + def _run_handle_exception(self, runner, state): + if not state.in_with() and ( + state.has_active_try() and + state.get_inst().opname not in _NO_RAISE_OPS): + # Is in a *try* block + state.fork(pc=state.get_inst().next) + runner._adjust_except_stack(state) + return True + else: + state.advance_pc() + + # Must the new PC be a new block? + if not state.in_with() and state.is_in_exception(): + _logger.debug("3.11 exception %s PC=%s", + state.get_exception(), state._pc) + eh = state.get_exception() + eh_top = state.get_top_block('TRY') + if eh_top and eh_top['end'] == eh.target: + # Same exception + eh_block = None + else: + eh_block = state.make_block("TRY", end=eh.target) + eh_block['end_offset'] = eh.end + eh_block['stack_depth'] = eh.depth + eh_block['push_lasti'] = eh.lasti + state.fork(pc=state._pc, extra_block=eh_block) + return True + elif PYVERSION in ((3, 10),): + def _run_handle_exception(self, runner, state): + if (state.has_active_try() and + state.get_inst().opname not in _NO_RAISE_OPS): + # Is in a *try* block + state.fork(pc=state.get_inst().next) + tryblk = state.get_top_block('TRY') + state.pop_block_and_above(tryblk) + nstack = state.stack_depth + kwargs = {} + if nstack > tryblk['entry_stack']: + kwargs['npop'] = nstack - tryblk['entry_stack'] + handler = tryblk['handler'] + kwargs['npush'] = { + BlockKind('EXCEPT'): _EXCEPT_STACK_OFFSET, + BlockKind('FINALLY'): _FINALLY_POP + }[handler['kind']] + kwargs['extra_block'] = handler + state.fork(pc=tryblk['end'], **kwargs) + return True + else: + state.advance_pc() + else: + raise NotImplementedError(PYVERSION) + + def _build_cfg(self, all_states): + graph = CFGraph() + for state in all_states: + b = state.pc_initial + graph.add_node(b) + for state in all_states: + for edge in state.outgoing_edges: + graph.add_edge(state.pc_initial, edge.pc, 0) + graph.set_entry_point(0) + graph.process() + self.cfgraph = graph + + def _prune_phis(self, runner): + # Find phis that are unused in the local block + _logger.debug("Prune PHIs".center(60, '-')) + + # Compute dataflow for used phis and propagate + + # 1. Get used-phis for each block + # Map block to used_phis + def get_used_phis_per_state(): + used_phis = defaultdict(set) + phi_set = set() + for state in runner.finished: + used = set(state._used_regs) + phis = set(state._phis) + used_phis[state] |= phis & used + phi_set |= phis + return used_phis, phi_set + + # Find use-defs + def find_use_defs(): + defmap = {} + phismap = defaultdict(set) + for state in runner.finished: + for phi, rhs in state._outgoing_phis.items(): + if rhs not in phi_set: + # Is a definition + defmap[phi] = state + phismap[phi].add((rhs, state)) + _logger.debug("defmap: %s", _lazy_pformat(defmap)) + _logger.debug("phismap: %s", _lazy_pformat(phismap)) + return defmap, phismap + + def propagate_phi_map(phismap): + """An iterative dataflow algorithm to find the definition + (the source) of each PHI node. + """ + blacklist = defaultdict(set) + + while True: + changing = False + for phi, defsites in sorted(list(phismap.items())): + for rhs, state in sorted(list(defsites)): + if rhs in phi_set: + defsites |= phismap[rhs] + blacklist[phi].add((rhs, state)) + to_remove = blacklist[phi] + if to_remove & defsites: + defsites -= to_remove + changing = True + + _logger.debug("changing phismap: %s", _lazy_pformat(phismap)) + if not changing: + break + + def apply_changes(used_phis, phismap): + keep = {} + for state, used_set in used_phis.items(): + for phi in used_set: + keep[phi] = phismap[phi] + _logger.debug("keep phismap: %s", _lazy_pformat(keep)) + new_out = defaultdict(dict) + for phi in keep: + for rhs, state in keep[phi]: + new_out[state][phi] = rhs + + _logger.debug("new_out: %s", _lazy_pformat(new_out)) + for state in runner.finished: + state._outgoing_phis.clear() + state._outgoing_phis.update(new_out[state]) + + used_phis, phi_set = get_used_phis_per_state() + _logger.debug("Used_phis: %s", _lazy_pformat(used_phis)) + defmap, phismap = find_use_defs() + propagate_phi_map(phismap) + apply_changes(used_phis, phismap) + _logger.debug("DONE Prune PHIs".center(60, '-')) + + def _is_implicit_new_block(self, state): + inst = state.get_inst() + + if inst.offset in self._bytecode.labels: + return True + elif inst.opname in NEW_BLOCKERS: + return True + else: + return False + + def _guard_with_as(self, state): + """Checks if the next instruction after a SETUP_WITH is something other + than a POP_TOP, if it is something else it'll be some sort of store + which is not supported (this corresponds to `with CTXMGR as VAR(S)`).""" + current_inst = state.get_inst() + if current_inst.opname in {"SETUP_WITH", "BEFORE_WITH"}: + next_op = self._bytecode[current_inst.next].opname + if next_op != "POP_TOP": + msg = ("The 'with (context manager) as " + "(variable):' construct is not " + "supported.") + raise UnsupportedBytecodeError(msg) + + +def _is_null_temp_reg(reg): + return reg.startswith("$null$") + + +class TraceRunner(object): + """Trace runner contains the states for the trace and the opcode dispatch. + """ + def __init__(self, debug_filename): + self.debug_filename = debug_filename + self.pending = deque() + self.finished = set() + + def get_debug_loc(self, lineno): + return Loc(self.debug_filename, lineno) + + def dispatch(self, state): + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + if state._blockstack: + state: State + while state._blockstack: + topblk = state._blockstack[-1] + blk_end = topblk['end'] + if blk_end is not None and blk_end <= state.pc_initial: + state._blockstack.pop() + else: + break + elif PYVERSION in ((3, 10),): + pass + else: + raise NotImplementedError(PYVERSION) + inst = state.get_inst() + if inst.opname != "CACHE": + _logger.debug("dispatch pc=%s, inst=%s", state._pc, inst) + _logger.debug("stack %s", state._stack) + fn = getattr(self, "op_{}".format(inst.opname), None) + if fn is not None: + fn(state, inst) + else: + msg = "Use of unsupported opcode (%s) found" % inst.opname + raise UnsupportedBytecodeError(msg, + loc=self.get_debug_loc(inst.lineno)) + + def _adjust_except_stack(self, state): + """ + Adjust stack when entering an exception handler to match expectation + by the bytecode. + """ + tryblk = state.get_top_block('TRY') + state.pop_block_and_above(tryblk) + nstack = state.stack_depth + kwargs = {} + expected_depth = tryblk['stack_depth'] + if nstack > expected_depth: + # Pop extra item in the stack + kwargs['npop'] = nstack - expected_depth + # Set extra stack itemcount due to the exception values. + extra_stack = 1 + if tryblk['push_lasti']: + extra_stack += 1 + kwargs['npush'] = extra_stack + state.fork(pc=tryblk['end'], **kwargs) + + def op_NOP(self, state, inst): + state.append(inst) + + def op_RESUME(self, state, inst): + state.append(inst) + + def op_CACHE(self, state, inst): + state.append(inst) + + def op_PRECALL(self, state, inst): + state.append(inst) + + def op_PUSH_NULL(self, state, inst): + state.push(state.make_null()) + state.append(inst) + + def op_RETURN_GENERATOR(self, state, inst): + # This impl doesn't follow what CPython does. CPython is hacking + # the frame stack in the interpreter. From usage, it always + # has a POP_TOP after it so we push a dummy value to the stack. + # + # Example bytecode: + # > 0 NOP(arg=None, lineno=80) + # 2 RETURN_GENERATOR(arg=None, lineno=80) + # 4 POP_TOP(arg=None, lineno=80) + # 6 RESUME(arg=0, lineno=80) + state.push(state.make_temp()) + state.append(inst) + + if PYVERSION in ((3, 13),): + def op_FORMAT_SIMPLE(self, state, inst): + assert PYVERSION == (3, 13) + value = state.pop() + strvar = state.make_temp() + res = state.make_temp() + state.append(inst, value=value, res=res, strvar=strvar) + state.push(res) + + def op_FORMAT_VALUE(self, state, inst): + """ + FORMAT_VALUE(flags): flags argument specifies format spec which is + not supported yet. Currently, we just call str() on the value. + Pops a value from stack and pushes results back. + Required for supporting f-strings. + https://docs.python.org/3/library/dis.html#opcode-FORMAT_VALUE + """ + if inst.arg != 0: + msg = "format spec in f-strings not supported yet" + raise UnsupportedBytecodeError(msg, + loc=self.get_debug_loc(inst.lineno)) + value = state.pop() + strvar = state.make_temp() + res = state.make_temp() + state.append(inst, value=value, res=res, strvar=strvar) + state.push(res) + + def op_BUILD_STRING(self, state, inst): + """ + BUILD_STRING(count): Concatenates count strings from the stack and + pushes the resulting string onto the stack. + Required for supporting f-strings. + https://docs.python.org/3/library/dis.html#opcode-BUILD_STRING + """ + count = inst.arg + strings = list(reversed([state.pop() for _ in range(count)])) + # corner case: f"" + if count == 0: + tmps = [state.make_temp()] + else: + tmps = [state.make_temp() for _ in range(count - 1)] + state.append(inst, strings=strings, tmps=tmps) + state.push(tmps[-1]) + + def op_POP_TOP(self, state, inst): + state.pop() + + if PYVERSION in ((3, 13),): + def op_TO_BOOL(self, state, inst): + res = state.make_temp() + tos = state.pop() + state.append(inst, val=tos, res=res) + state.push(res) + + elif PYVERSION < (3, 13): + pass + + if PYVERSION in ((3, 13),): + def op_LOAD_GLOBAL(self, state, inst): + # Ordering of the global value and NULL is swapped in Py3.13 + res = state.make_temp() + idx = inst.arg >> 1 + state.append(inst, idx=idx, res=res) + state.push(res) + # ignoring the NULL + if inst.arg & 1: + state.push(state.make_null()) + elif PYVERSION in ((3, 11), (3, 12)): + def op_LOAD_GLOBAL(self, state, inst): + res = state.make_temp() + idx = inst.arg >> 1 + state.append(inst, idx=idx, res=res) + # ignoring the NULL + if inst.arg & 1: + state.push(state.make_null()) + state.push(res) + elif PYVERSION in ((3, 10),): + def op_LOAD_GLOBAL(self, state, inst): + res = state.make_temp() + state.append(inst, res=res) + state.push(res) + else: + raise NotImplementedError(PYVERSION) + + def op_COPY_FREE_VARS(self, state, inst): + state.append(inst) + + def op_MAKE_CELL(self, state, inst): + state.append(inst) + + def op_LOAD_DEREF(self, state, inst): + res = state.make_temp() + state.append(inst, res=res) + state.push(res) + + def op_LOAD_CONST(self, state, inst): + # append const index for interpreter to read the const value + res = state.make_temp("const") + f".{inst.arg}" + state.push(res) + state.append(inst, res=res) + + def op_LOAD_ATTR(self, state, inst): + item = state.pop() + res = state.make_temp() + if PYVERSION in ((3, 13),): + state.push(res) # the attr + if inst.arg & 1: + state.push(state.make_null()) + elif PYVERSION in ((3, 12),): + if inst.arg & 1: + state.push(state.make_null()) + state.push(res) + elif PYVERSION in ((3, 10), (3, 11)): + state.push(res) + else: + raise NotImplementedError(PYVERSION) + state.append(inst, item=item, res=res) + + def op_LOAD_FAST(self, state, inst): + assert PYVERSION <= (3, 13) + if PYVERSION in ((3, 13), ): + try: + name = state.get_varname(inst) + except IndexError: # oparg is out of range + # Handle this like a LOAD_DEREF + # Assume MAKE_CELL and COPY_FREE_VARS has correctly setup the + # states. + # According to https://github.com/python/cpython/blob/9ac606080a0074cdf7589d9b7c9413a73e0ddf37/Objects/codeobject.c#L730C9-L759 # noqa E501 + # localsplus is locals + cells + freevars + bc = state._bytecode + num_varnames = len(bc.co_varnames) + num_freevars = len(bc.co_freevars) + num_cellvars = len(bc.co_cellvars) + max_fast_local = num_cellvars + num_freevars + assert 0 <= inst.arg - num_varnames < max_fast_local + res = state.make_temp() + state.append(inst, res=res, as_load_deref=True) + state.push(res) + return + else: + name = state.get_varname(inst) + res = state.make_temp(name) + state.append(inst, res=res) + state.push(res) + + if PYVERSION in ((3, 13),): + def op_LOAD_FAST_LOAD_FAST(self, state, inst): + oparg = inst.arg + oparg1 = oparg >> 4 + oparg2 = oparg & 15 + name1 = state.get_varname_by_arg(oparg1) + name2 = state.get_varname_by_arg(oparg2) + res1 = state.make_temp(name1) + res2 = state.make_temp(name2) + state.append(inst, res1=res1, res2=res2) + state.push(res1) + state.push(res2) + + def op_STORE_FAST_LOAD_FAST(self, state, inst): + oparg = inst.arg + # oparg1 = oparg >> 4 # not needed + oparg2 = oparg & 15 + store_value = state.pop() + load_name = state.get_varname_by_arg(oparg2) + load_res = state.make_temp(load_name) + state.append(inst, store_value=store_value, load_res=load_res) + state.push(load_res) + + def op_STORE_FAST_STORE_FAST(self, state, inst): + value1 = state.pop() + value2 = state.pop() + state.append(inst, value1=value1, value2=value2) + + elif PYVERSION in ((3, 10), (3, 11), (3, 12)): + pass + else: + raise NotImplementedError(PYVERSION) + + if PYVERSION in ((3, 12), (3, 13)): + op_LOAD_FAST_CHECK = op_LOAD_FAST + op_LOAD_FAST_AND_CLEAR = op_LOAD_FAST + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def op_DELETE_FAST(self, state, inst): + state.append(inst) + + def op_DELETE_ATTR(self, state, inst): + target = state.pop() + state.append(inst, target=target) + + def op_STORE_ATTR(self, state, inst): + target = state.pop() + value = state.pop() + state.append(inst, target=target, value=value) + + def op_STORE_DEREF(self, state, inst): + value = state.pop() + state.append(inst, value=value) + + def op_STORE_FAST(self, state, inst): + value = state.pop() + state.append(inst, value=value) + + def op_SLICE_1(self, state, inst): + """ + TOS = TOS1[TOS:] + """ + tos = state.pop() + tos1 = state.pop() + res = state.make_temp() + slicevar = state.make_temp() + indexvar = state.make_temp() + nonevar = state.make_temp() + state.append( + inst, + base=tos1, + start=tos, + res=res, + slicevar=slicevar, + indexvar=indexvar, + nonevar=nonevar, + ) + state.push(res) + + def op_SLICE_2(self, state, inst): + """ + TOS = TOS1[:TOS] + """ + tos = state.pop() + tos1 = state.pop() + res = state.make_temp() + slicevar = state.make_temp() + indexvar = state.make_temp() + nonevar = state.make_temp() + state.append( + inst, + base=tos1, + stop=tos, + res=res, + slicevar=slicevar, + indexvar=indexvar, + nonevar=nonevar, + ) + state.push(res) + + def op_SLICE_3(self, state, inst): + """ + TOS = TOS2[TOS1:TOS] + """ + tos = state.pop() + tos1 = state.pop() + tos2 = state.pop() + res = state.make_temp() + slicevar = state.make_temp() + indexvar = state.make_temp() + state.append( + inst, + base=tos2, + start=tos1, + stop=tos, + res=res, + slicevar=slicevar, + indexvar=indexvar, + ) + state.push(res) + + def op_STORE_SLICE_0(self, state, inst): + """ + TOS[:] = TOS1 + """ + tos = state.pop() + value = state.pop() + slicevar = state.make_temp() + indexvar = state.make_temp() + nonevar = state.make_temp() + state.append( + inst, + base=tos, + value=value, + slicevar=slicevar, + indexvar=indexvar, + nonevar=nonevar, + ) + + def op_STORE_SLICE_1(self, state, inst): + """ + TOS1[TOS:] = TOS2 + """ + tos = state.pop() + tos1 = state.pop() + value = state.pop() + slicevar = state.make_temp() + indexvar = state.make_temp() + nonevar = state.make_temp() + state.append( + inst, + base=tos1, + start=tos, + slicevar=slicevar, + value=value, + indexvar=indexvar, + nonevar=nonevar, + ) + + def op_STORE_SLICE_2(self, state, inst): + """ + TOS1[:TOS] = TOS2 + """ + tos = state.pop() + tos1 = state.pop() + value = state.pop() + slicevar = state.make_temp() + indexvar = state.make_temp() + nonevar = state.make_temp() + state.append( + inst, + base=tos1, + stop=tos, + value=value, + slicevar=slicevar, + indexvar=indexvar, + nonevar=nonevar, + ) + + def op_STORE_SLICE_3(self, state, inst): + """ + TOS2[TOS1:TOS] = TOS3 + """ + tos = state.pop() + tos1 = state.pop() + tos2 = state.pop() + value = state.pop() + slicevar = state.make_temp() + indexvar = state.make_temp() + state.append( + inst, + base=tos2, + start=tos1, + stop=tos, + value=value, + slicevar=slicevar, + indexvar=indexvar, + ) + + def op_DELETE_SLICE_0(self, state, inst): + """ + del TOS[:] + """ + tos = state.pop() + slicevar = state.make_temp() + indexvar = state.make_temp() + nonevar = state.make_temp() + state.append( + inst, base=tos, slicevar=slicevar, indexvar=indexvar, + nonevar=nonevar, + ) + + def op_DELETE_SLICE_1(self, state, inst): + """ + del TOS1[TOS:] + """ + tos = state.pop() + tos1 = state.pop() + slicevar = state.make_temp() + indexvar = state.make_temp() + nonevar = state.make_temp() + state.append( + inst, + base=tos1, + start=tos, + slicevar=slicevar, + indexvar=indexvar, + nonevar=nonevar, + ) + + def op_DELETE_SLICE_2(self, state, inst): + """ + del TOS1[:TOS] + """ + tos = state.pop() + tos1 = state.pop() + slicevar = state.make_temp() + indexvar = state.make_temp() + nonevar = state.make_temp() + state.append( + inst, + base=tos1, + stop=tos, + slicevar=slicevar, + indexvar=indexvar, + nonevar=nonevar, + ) + + def op_DELETE_SLICE_3(self, state, inst): + """ + del TOS2[TOS1:TOS] + """ + tos = state.pop() + tos1 = state.pop() + tos2 = state.pop() + slicevar = state.make_temp() + indexvar = state.make_temp() + state.append( + inst, base=tos2, start=tos1, stop=tos, slicevar=slicevar, + indexvar=indexvar + ) + + def op_BUILD_SLICE(self, state, inst): + """ + slice(TOS1, TOS) or slice(TOS2, TOS1, TOS) + """ + argc = inst.arg + if argc == 2: + tos = state.pop() + tos1 = state.pop() + start = tos1 + stop = tos + step = None + elif argc == 3: + tos = state.pop() + tos1 = state.pop() + tos2 = state.pop() + start = tos2 + stop = tos1 + step = tos + else: + raise Exception("unreachable") + slicevar = state.make_temp() + res = state.make_temp() + state.append( + inst, start=start, stop=stop, step=step, res=res, slicevar=slicevar + ) + state.push(res) + + if PYVERSION in ((3, 12), (3, 13)): + def op_BINARY_SLICE(self, state, inst): + end = state.pop() + start = state.pop() + container = state.pop() + temp_res = state.make_temp() + res = state.make_temp() + slicevar = state.make_temp() + state.append( + inst, start=start, end=end, container=container, res=res, + slicevar=slicevar, temp_res=temp_res + ) + state.push(res) + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + if PYVERSION in ((3, 12), (3, 13)): + def op_STORE_SLICE(self, state, inst): + end = state.pop() + start = state.pop() + container = state.pop() + value = state.pop() + + slicevar = state.make_temp() + res = state.make_temp() + state.append( + inst, start=start, end=end, container=container, value=value, + res=res, slicevar=slicevar, + ) + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def _op_POP_JUMP_IF(self, state, inst): + pred = state.pop() + state.append(inst, pred=pred) + + target_inst = inst.get_jump_target() + next_inst = inst.next + # if the next inst and the jump target are the same location, issue one + # fork else issue a fork for the next and the target. + state.fork(pc=next_inst) + if target_inst != next_inst: + state.fork(pc=target_inst) + + op_POP_JUMP_IF_TRUE = _op_POP_JUMP_IF + op_POP_JUMP_IF_FALSE = _op_POP_JUMP_IF + + if PYVERSION in ((3, 12), (3, 13)): + op_POP_JUMP_IF_NONE = _op_POP_JUMP_IF + op_POP_JUMP_IF_NOT_NONE = _op_POP_JUMP_IF + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def _op_JUMP_IF_OR_POP(self, state, inst): + pred = state.get_tos() + state.append(inst, pred=pred) + state.fork(pc=inst.next, npop=1) + state.fork(pc=inst.get_jump_target()) + + op_JUMP_IF_FALSE_OR_POP = _op_JUMP_IF_OR_POP + op_JUMP_IF_TRUE_OR_POP = _op_JUMP_IF_OR_POP + + def op_POP_JUMP_FORWARD_IF_NONE(self, state, inst): + self._op_POP_JUMP_IF(state, inst) + + def op_POP_JUMP_FORWARD_IF_NOT_NONE(self, state, inst): + self._op_POP_JUMP_IF(state, inst) + + def op_POP_JUMP_BACKWARD_IF_NONE(self, state, inst): + self._op_POP_JUMP_IF(state, inst) + + def op_POP_JUMP_BACKWARD_IF_NOT_NONE(self, state, inst): + self._op_POP_JUMP_IF(state, inst) + + def op_POP_JUMP_FORWARD_IF_FALSE(self, state, inst): + self._op_POP_JUMP_IF(state, inst) + + def op_POP_JUMP_FORWARD_IF_TRUE(self, state, inst): + self._op_POP_JUMP_IF(state, inst) + + def op_POP_JUMP_BACKWARD_IF_FALSE(self, state, inst): + self._op_POP_JUMP_IF(state, inst) + + def op_POP_JUMP_BACKWARD_IF_TRUE(self, state, inst): + self._op_POP_JUMP_IF(state, inst) + + def op_JUMP_FORWARD(self, state, inst): + state.append(inst) + state.fork(pc=inst.get_jump_target()) + + def op_JUMP_BACKWARD(self, state, inst): + state.append(inst) + state.fork(pc=inst.get_jump_target()) + + op_JUMP_BACKWARD_NO_INTERRUPT = op_JUMP_BACKWARD + + def op_JUMP_ABSOLUTE(self, state, inst): + state.append(inst) + state.fork(pc=inst.get_jump_target()) + + def op_BREAK_LOOP(self, state, inst): + # NOTE: bytecode removed since py3.8 + end = state.get_top_block('LOOP')['end'] + state.append(inst, end=end) + state.pop_block() + state.fork(pc=end) + + def op_RETURN_VALUE(self, state, inst): + state.append(inst, retval=state.pop(), castval=state.make_temp()) + state.terminate() + + if PYVERSION in ((3, 12), (3, 13)): + def op_RETURN_CONST(self, state, inst): + res = state.make_temp("const") + state.append(inst, retval=res, castval=state.make_temp()) + state.terminate() + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def op_YIELD_VALUE(self, state, inst): + val = state.pop() + res = state.make_temp() + state.append(inst, value=val, res=res) + state.push(res) + + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + def op_RAISE_VARARGS(self, state, inst): + if inst.arg == 0: + exc = None + # No re-raising within a try-except block. + # But we allow bare reraise. + if state.has_active_try(): + raise UnsupportedBytecodeError( + "The re-raising of an exception is not yet supported.", + loc=self.get_debug_loc(inst.lineno), + ) + elif inst.arg == 1: + exc = state.pop() + else: + raise ValueError("Multiple argument raise is not supported.") + state.append(inst, exc=exc) + + if state.has_active_try(): + self._adjust_except_stack(state) + else: + state.terminate() + + elif PYVERSION in ((3, 10),): + def op_RAISE_VARARGS(self, state, inst): + in_exc_block = any([ + state.get_top_block("EXCEPT") is not None, + state.get_top_block("FINALLY") is not None + ]) + if inst.arg == 0: + exc = None + if in_exc_block: + raise UnsupportedBytecodeError( + "The re-raising of an exception is not yet supported.", + loc=self.get_debug_loc(inst.lineno), + ) + elif inst.arg == 1: + exc = state.pop() + else: + raise ValueError("Multiple argument raise is not supported.") + state.append(inst, exc=exc) + state.terminate() + else: + raise NotImplementedError(PYVERSION) + + def op_BEGIN_FINALLY(self, state, inst): + temps = [] + for i in range(_EXCEPT_STACK_OFFSET): + tmp = state.make_temp() + temps.append(tmp) + state.push(tmp) + state.append(inst, temps=temps) + + def op_END_FINALLY(self, state, inst): + blk = state.pop_block() + state.reset_stack(blk['entry_stack']) + + if PYVERSION in ((3, 13),): + def op_END_FOR(self, state, inst): + state.pop() + elif PYVERSION in ((3, 12),): + def op_END_FOR(self, state, inst): + state.pop() + state.pop() + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def op_POP_FINALLY(self, state, inst): + # we don't emulate the exact stack behavior + if inst.arg != 0: + msg = ('Unsupported use of a bytecode related to try..finally' + ' or a with-context') + raise UnsupportedBytecodeError(msg, + loc=self.get_debug_loc(inst.lineno)) + + def op_CALL_FINALLY(self, state, inst): + pass + + def op_WITH_EXCEPT_START(self, state, inst): + state.terminate() # do not support + + def op_WITH_CLEANUP_START(self, state, inst): + # we don't emulate the exact stack behavior + state.append(inst) + + def op_WITH_CLEANUP_FINISH(self, state, inst): + # we don't emulate the exact stack behavior + state.append(inst) + + def op_SETUP_LOOP(self, state, inst): + # NOTE: bytecode removed since py3.8 + state.push_block( + state.make_block( + kind='LOOP', + end=inst.get_jump_target(), + ) + ) + + def op_BEFORE_WITH(self, state, inst): + # Almost the same as py3.10 SETUP_WITH just lacking the finally block. + cm = state.pop() # the context-manager + + yielded = state.make_temp() + exitfn = state.make_temp(prefix='setup_with_exitfn') + + state.push(exitfn) + state.push(yielded) + + # Gather all exception entries for this WITH. There maybe multiple + # entries; esp. for nested WITHs. + bc = state._bytecode + ehhead = bc.find_exception_entry(inst.next) + ehrelated = [ehhead] + for eh in bc.exception_entries: + if eh.target == ehhead.target: + ehrelated.append(eh) + end = max(eh.end for eh in ehrelated) + state.append(inst, contextmanager=cm, exitfn=exitfn, end=end) + + state.push_block( + state.make_block( + kind='WITH', + end=end, + ) + ) + # Forces a new block + state.fork(pc=inst.next) + + def op_SETUP_WITH(self, state, inst): + cm = state.pop() # the context-manager + + yielded = state.make_temp() + exitfn = state.make_temp(prefix='setup_with_exitfn') + state.append(inst, contextmanager=cm, exitfn=exitfn) + + state.push(exitfn) + state.push(yielded) + + state.push_block( + state.make_block( + kind='WITH', + end=inst.get_jump_target(), + ) + ) + # Forces a new block + state.fork(pc=inst.next) + + def _setup_try(self, kind, state, next, end): + # Forces a new block + # Fork to the body of the finally + handler_block = state.make_block( + kind=kind, + end=None, + reset_stack=False, + ) + # Forces a new block + # Fork to the body of the finally + state.fork( + pc=next, + extra_block=state.make_block( + kind='TRY', + end=end, + reset_stack=False, + handler=handler_block, + ) + ) + + def op_PUSH_EXC_INFO(self, state, inst): + tos = state.pop() + state.push(state.make_temp("exception")) + state.push(tos) + + def op_SETUP_FINALLY(self, state, inst): + state.append(inst) + self._setup_try( + 'FINALLY', state, next=inst.next, end=inst.get_jump_target(), + ) + + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + def op_POP_EXCEPT(self, state, inst): + state.pop() + + elif PYVERSION in ((3, 10),): + def op_POP_EXCEPT(self, state, inst): + blk = state.pop_block() + if blk['kind'] not in {BlockKind('EXCEPT'), BlockKind('FINALLY')}: + raise UnsupportedBytecodeError( + f"POP_EXCEPT got an unexpected block: {blk['kind']}", + loc=self.get_debug_loc(inst.lineno), + ) + state.pop() + state.pop() + state.pop() + # Forces a new block + state.fork(pc=inst.next) + else: + raise NotImplementedError(PYVERSION) + + def op_POP_BLOCK(self, state, inst): + blk = state.pop_block() + if blk['kind'] == BlockKind('TRY'): + state.append(inst, kind='try') + elif blk['kind'] == BlockKind('WITH'): + state.append(inst, kind='with') + state.fork(pc=inst.next) + + def op_BINARY_SUBSCR(self, state, inst): + index = state.pop() + target = state.pop() + res = state.make_temp() + state.append(inst, index=index, target=target, res=res) + state.push(res) + + def op_STORE_SUBSCR(self, state, inst): + index = state.pop() + target = state.pop() + value = state.pop() + state.append(inst, target=target, index=index, value=value) + + def op_DELETE_SUBSCR(self, state, inst): + index = state.pop() + target = state.pop() + state.append(inst, target=target, index=index) + + def op_CALL(self, state, inst): + narg = inst.arg + args = list(reversed([state.pop() for _ in range(narg)])) + if PYVERSION == (3, 13): + null_or_self = state.pop() + # position of the callable is fixed + callable = state.pop() + if not _is_null_temp_reg(null_or_self): + args = [null_or_self, *args] + kw_names = None + elif PYVERSION < (3, 13): + callable_or_firstarg = state.pop() + null_or_callable = state.pop() + if _is_null_temp_reg(null_or_callable): + callable = callable_or_firstarg + else: + callable = null_or_callable + args = [callable_or_firstarg, *args] + kw_names = state.pop_kw_names() + res = state.make_temp() + + state.append(inst, func=callable, args=args, kw_names=kw_names, res=res) + state.push(res) + + def op_KW_NAMES(self, state, inst): + state.set_kw_names(inst.arg) + + def op_CALL_FUNCTION(self, state, inst): + narg = inst.arg + args = list(reversed([state.pop() for _ in range(narg)])) + func = state.pop() + + res = state.make_temp() + state.append(inst, func=func, args=args, res=res) + state.push(res) + + def op_CALL_FUNCTION_KW(self, state, inst): + narg = inst.arg + names = state.pop() # tuple of names + args = list(reversed([state.pop() for _ in range(narg)])) + func = state.pop() + + res = state.make_temp() + state.append(inst, func=func, args=args, names=names, res=res) + state.push(res) + + if PYVERSION in ((3, 13),): + def op_CALL_KW(self, state, inst): + narg = inst.arg + kw_names = state.pop() + args = list(reversed([state.pop() for _ in range(narg)])) + null_or_firstarg = state.pop() + callable = state.pop() + if not _is_null_temp_reg(null_or_firstarg): + args = [null_or_firstarg, *args] + + res = state.make_temp() + state.append(inst, func=callable, args=args, kw_names=kw_names, + res=res) + state.push(res) + + elif PYVERSION in ((3, 10), (3, 11), (3, 12)): + pass + else: + raise NotImplementedError(PYVERSION) + + if PYVERSION in ((3, 13),): + def op_CALL_FUNCTION_EX(self, state, inst): + # (func, unused, callargs, kwargs if (oparg & 1) -- result)) + if inst.arg & 1: + varkwarg = state.pop() + else: + varkwarg = None + + vararg = state.pop() + state.pop() # unused + func = state.pop() + + res = state.make_temp() + state.append(inst, func=func, vararg=vararg, varkwarg=varkwarg, + res=res) + state.push(res) + + elif PYVERSION in ((3, 10), (3, 11), (3, 12)): + + def op_CALL_FUNCTION_EX(self, state, inst): + if inst.arg & 1: + varkwarg = state.pop() + else: + varkwarg = None + vararg = state.pop() + func = state.pop() + + if PYVERSION in ((3, 11), (3, 12)): + if _is_null_temp_reg(state.peek(1)): + state.pop() # pop NULL, it's not used + elif PYVERSION in ((3, 10),): + pass + else: + raise NotImplementedError(PYVERSION) + + res = state.make_temp() + state.append(inst, func=func, vararg=vararg, varkwarg=varkwarg, + res=res) + state.push(res) + else: + raise NotImplementedError(PYVERSION) + + def _dup_topx(self, state, inst, count): + orig = [state.pop() for _ in range(count)] + orig.reverse() + # We need to actually create new temporaries if we want the + # IR optimization pass to work correctly (see issue #580) + duped = [state.make_temp() for _ in range(count)] + state.append(inst, orig=orig, duped=duped) + for val in orig: + state.push(val) + for val in duped: + state.push(val) + + if PYVERSION in ((3, 12), (3, 13)): + def op_CALL_INTRINSIC_1(self, state, inst): + # See https://github.com/python/cpython/blob/v3.12.0rc2/Include/ + # internal/pycore_intrinsics.h#L3-L17C36 + try: + operand = CALL_INTRINSIC_1_Operand(inst.arg) + except TypeError: + msg = f"op_CALL_INTRINSIC_1({inst.arg})" + loc = self.get_debug_loc(inst.lineno) + raise UnsupportedBytecodeError(msg, loc=loc) + if operand == ci1op.INTRINSIC_STOPITERATION_ERROR: + state.append(inst, operand=operand) + state.terminate() + return + elif operand == ci1op.UNARY_POSITIVE: + val = state.pop() + res = state.make_temp() + state.append(inst, operand=operand, + value=val, res=res) + state.push(res) + return + elif operand == ci1op.INTRINSIC_LIST_TO_TUPLE: + tos = state.pop() + res = state.make_temp() + state.append(inst, operand=operand, + const_list=tos, res=res) + state.push(res) + return + else: + raise NotImplementedError(operand) + + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def op_DUP_TOPX(self, state, inst): + count = inst.arg + assert 1 <= count <= 5, "Invalid DUP_TOPX count" + self._dup_topx(state, inst, count) + + def op_DUP_TOP(self, state, inst): + self._dup_topx(state, inst, count=1) + + def op_DUP_TOP_TWO(self, state, inst): + self._dup_topx(state, inst, count=2) + + def op_COPY(self, state, inst): + state.push(state.peek(inst.arg)) + + def op_SWAP(self, state, inst): + state.swap(inst.arg) + + def op_ROT_TWO(self, state, inst): + first = state.pop() + second = state.pop() + state.push(first) + state.push(second) + + def op_ROT_THREE(self, state, inst): + first = state.pop() + second = state.pop() + third = state.pop() + state.push(first) + state.push(third) + state.push(second) + + def op_ROT_FOUR(self, state, inst): + first = state.pop() + second = state.pop() + third = state.pop() + forth = state.pop() + state.push(first) + state.push(forth) + state.push(third) + state.push(second) + + def op_UNPACK_SEQUENCE(self, state, inst): + count = inst.arg + iterable = state.pop() + stores = [state.make_temp() for _ in range(count)] + tupleobj = state.make_temp() + state.append(inst, iterable=iterable, stores=stores, tupleobj=tupleobj) + for st in reversed(stores): + state.push(st) + + def op_BUILD_TUPLE(self, state, inst): + count = inst.arg + items = list(reversed([state.pop() for _ in range(count)])) + tup = state.make_temp() + state.append(inst, items=items, res=tup) + state.push(tup) + + def _build_tuple_unpack(self, state, inst): + # Builds tuple from other tuples on the stack + tuples = list(reversed([state.pop() for _ in range(inst.arg)])) + temps = [state.make_temp() for _ in range(len(tuples) - 1)] + + # if the unpack is assign-like, e.g. x = (*y,), it needs handling + # differently. + is_assign = len(tuples) == 1 + if is_assign: + temps = [state.make_temp(),] + + state.append(inst, tuples=tuples, temps=temps, is_assign=is_assign) + # The result is in the last temp var + state.push(temps[-1]) + + def op_BUILD_TUPLE_UNPACK_WITH_CALL(self, state, inst): + # just unpack the input tuple, call inst will be handled afterwards + self._build_tuple_unpack(state, inst) + + def op_BUILD_TUPLE_UNPACK(self, state, inst): + self._build_tuple_unpack(state, inst) + + def op_LIST_TO_TUPLE(self, state, inst): + # "Pops a list from the stack and pushes a tuple containing the same + # values." + tos = state.pop() + res = state.make_temp() # new tuple var + state.append(inst, const_list=tos, res=res) + state.push(res) + + def op_BUILD_CONST_KEY_MAP(self, state, inst): + keys = state.pop() + vals = list(reversed([state.pop() for _ in range(inst.arg)])) + keytmps = [state.make_temp() for _ in range(inst.arg)] + res = state.make_temp() + state.append(inst, keys=keys, keytmps=keytmps, values=vals, res=res) + state.push(res) + + def op_BUILD_LIST(self, state, inst): + count = inst.arg + items = list(reversed([state.pop() for _ in range(count)])) + lst = state.make_temp() + state.append(inst, items=items, res=lst) + state.push(lst) + + def op_LIST_APPEND(self, state, inst): + value = state.pop() + index = inst.arg + target = state.peek(index) + appendvar = state.make_temp() + res = state.make_temp() + state.append(inst, target=target, value=value, appendvar=appendvar, + res=res) + + def op_LIST_EXTEND(self, state, inst): + value = state.pop() + index = inst.arg + target = state.peek(index) + extendvar = state.make_temp() + res = state.make_temp() + state.append(inst, target=target, value=value, extendvar=extendvar, + res=res) + + def op_BUILD_MAP(self, state, inst): + dct = state.make_temp() + count = inst.arg + items = [] + # In 3.5+, BUILD_MAP takes pairs from the stack + for i in range(count): + v, k = state.pop(), state.pop() + items.append((k, v)) + state.append(inst, items=items[::-1], size=count, res=dct) + state.push(dct) + + def op_MAP_ADD(self, state, inst): + TOS = state.pop() + TOS1 = state.pop() + key, value = (TOS1, TOS) + index = inst.arg + target = state.peek(index) + setitemvar = state.make_temp() + res = state.make_temp() + state.append(inst, target=target, key=key, value=value, + setitemvar=setitemvar, res=res) + + def op_BUILD_SET(self, state, inst): + count = inst.arg + # Note: related python bug http://bugs.python.org/issue26020 + items = list(reversed([state.pop() for _ in range(count)])) + res = state.make_temp() + state.append(inst, items=items, res=res) + state.push(res) + + def op_SET_UPDATE(self, state, inst): + value = state.pop() + index = inst.arg + target = state.peek(index) + updatevar = state.make_temp() + res = state.make_temp() + state.append(inst, target=target, value=value, updatevar=updatevar, + res=res) + + def op_DICT_UPDATE(self, state, inst): + value = state.pop() + index = inst.arg + target = state.peek(index) + updatevar = state.make_temp() + res = state.make_temp() + state.append(inst, target=target, value=value, updatevar=updatevar, + res=res) + + def op_GET_ITER(self, state, inst): + value = state.pop() + res = state.make_temp() + state.append(inst, value=value, res=res) + state.push(res) + + def op_FOR_ITER(self, state, inst): + iterator = state.get_tos() + pair = state.make_temp() + indval = state.make_temp() + pred = state.make_temp() + state.append(inst, iterator=iterator, pair=pair, indval=indval, + pred=pred) + state.push(indval) + end = inst.get_jump_target() + if PYVERSION in ((3, 12), (3, 13)): + # Changed in version 3.12: Up until 3.11 the iterator was + # popped when it was exhausted. Now this is handled using END_FOR + # op code. + state.fork(pc=end) + elif PYVERSION in ((3, 10), (3, 11)): + state.fork(pc=end, npop=2) + else: + raise NotImplementedError(PYVERSION) + state.fork(pc=inst.next) + + def op_GEN_START(self, state, inst): + """Pops TOS. If TOS was not None, raises an exception. The kind + operand corresponds to the type of generator or coroutine and + determines the error message. The legal kinds are 0 for generator, + 1 for coroutine, and 2 for async generator. + + New in version 3.10. + """ + # no-op in Numba + pass + + def op_BINARY_OP(self, state, inst): + op = dis._nb_ops[inst.arg][1] + rhs = state.pop() + lhs = state.pop() + op_name = ALL_BINOPS_TO_OPERATORS[op].__name__ + res = state.make_temp(prefix=f"binop_{op_name}") + state.append(inst, op=op, lhs=lhs, rhs=rhs, res=res) + state.push(res) + + def _unaryop(self, state, inst): + val = state.pop() + res = state.make_temp() + state.append(inst, value=val, res=res) + state.push(res) + + op_UNARY_NEGATIVE = _unaryop + op_UNARY_POSITIVE = _unaryop + op_UNARY_NOT = _unaryop + op_UNARY_INVERT = _unaryop + + def _binaryop(self, state, inst): + rhs = state.pop() + lhs = state.pop() + res = state.make_temp() + state.append(inst, lhs=lhs, rhs=rhs, res=res) + state.push(res) + + op_COMPARE_OP = _binaryop + op_IS_OP = _binaryop + op_CONTAINS_OP = _binaryop + + op_INPLACE_ADD = _binaryop + op_INPLACE_SUBTRACT = _binaryop + op_INPLACE_MULTIPLY = _binaryop + op_INPLACE_DIVIDE = _binaryop + op_INPLACE_TRUE_DIVIDE = _binaryop + op_INPLACE_FLOOR_DIVIDE = _binaryop + op_INPLACE_MODULO = _binaryop + op_INPLACE_POWER = _binaryop + op_INPLACE_MATRIX_MULTIPLY = _binaryop + + op_INPLACE_LSHIFT = _binaryop + op_INPLACE_RSHIFT = _binaryop + op_INPLACE_AND = _binaryop + op_INPLACE_OR = _binaryop + op_INPLACE_XOR = _binaryop + + op_BINARY_ADD = _binaryop + op_BINARY_SUBTRACT = _binaryop + op_BINARY_MULTIPLY = _binaryop + op_BINARY_DIVIDE = _binaryop + op_BINARY_TRUE_DIVIDE = _binaryop + op_BINARY_FLOOR_DIVIDE = _binaryop + op_BINARY_MODULO = _binaryop + op_BINARY_POWER = _binaryop + op_BINARY_MATRIX_MULTIPLY = _binaryop + + op_BINARY_LSHIFT = _binaryop + op_BINARY_RSHIFT = _binaryop + op_BINARY_AND = _binaryop + op_BINARY_OR = _binaryop + op_BINARY_XOR = _binaryop + + def op_MAKE_FUNCTION(self, state, inst, MAKE_CLOSURE=False): + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + # https://github.com/python/cpython/commit/2f180ce + # name set via co_qualname + name = None + elif PYVERSION in ((3, 10),): + name = state.pop() + else: + raise NotImplementedError(PYVERSION) + code = state.pop() + closure = annotations = kwdefaults = defaults = None + if PYVERSION in ((3, 13), ): + assert inst.arg is None + # SET_FUNCTION_ATTRIBUTE is responsible for setting + # closure, annotations, kwdefaults and defaults. + else: + if inst.arg & 0x8: + closure = state.pop() + if inst.arg & 0x4: + annotations = state.pop() + if inst.arg & 0x2: + kwdefaults = state.pop() + if inst.arg & 0x1: + defaults = state.pop() + res = state.make_temp() + state.append( + inst, + name=name, + code=code, + closure=closure, + annotations=annotations, + kwdefaults=kwdefaults, + defaults=defaults, + res=res, + ) + state.push(res) + + def op_SET_FUNCTION_ATTRIBUTE(self, state, inst): + assert PYVERSION in ((3, 13), ) + make_func_stack = state.pop() + data = state.pop() + if inst.arg == 0x1: + # 0x01 a tuple of default values for positional-only and + # positional-or-keyword parameters in positional order + state.set_function_attribute(make_func_stack, defaults=data) + elif inst.arg & 0x2: + # 0x02 a tuple of strings containing parameters’ annotations + state.set_function_attribute(make_func_stack, kwdefaults=data) + elif inst.arg & 0x4: + # 0x04 a tuple of strings containing parameters’ annotations + state.set_function_attribute(make_func_stack, annotations=data) + elif inst.arg == 0x8: + # 0x08 a tuple containing cells for free variables, making a closure + state.set_function_attribute(make_func_stack, closure=data) + else: + raise AssertionError("unreachable") + state.push(make_func_stack) + + def op_MAKE_CLOSURE(self, state, inst): + self.op_MAKE_FUNCTION(state, inst, MAKE_CLOSURE=True) + + def op_LOAD_CLOSURE(self, state, inst): + res = state.make_temp() + state.append(inst, res=res) + state.push(res) + + def op_LOAD_ASSERTION_ERROR(self, state, inst): + res = state.make_temp("assertion_error") + state.append(inst, res=res) + state.push(res) + + def op_CHECK_EXC_MATCH(self, state, inst): + pred = state.make_temp("predicate") + tos = state.pop() + tos1 = state.get_tos() + state.append(inst, pred=pred, tos=tos, tos1=tos1) + state.push(pred) + + def op_JUMP_IF_NOT_EXC_MATCH(self, state, inst): + # Tests whether the second value on the stack is an exception matching + # TOS, and jumps if it is not. Pops two values from the stack. + pred = state.make_temp("predicate") + tos = state.pop() + tos1 = state.pop() + state.append(inst, pred=pred, tos=tos, tos1=tos1) + state.fork(pc=inst.next) + state.fork(pc=inst.get_jump_target()) + + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + def op_RERAISE(self, state, inst): + # This isn't handled, but the state is set up anyway + exc = state.pop() + if inst.arg != 0: + state.pop() # lasti + state.append(inst, exc=exc) + + if state.has_active_try(): + self._adjust_except_stack(state) + else: + state.terminate() + + elif PYVERSION in ((3, 10),): + def op_RERAISE(self, state, inst): + # This isn't handled, but the state is set up anyway + exc = state.pop() + state.append(inst, exc=exc) + state.terminate() + else: + raise NotImplementedError(PYVERSION) + + # NOTE: Please see notes in `interpreter.py` surrounding the implementation + # of LOAD_METHOD and CALL_METHOD. + + if PYVERSION in ((3, 12), (3, 13)): + # LOAD_METHOD has become a pseudo-instruction in 3.12 + pass + elif PYVERSION in ((3, 11), ): + def op_LOAD_METHOD(self, state, inst): + item = state.pop() + extra = state.make_null() + state.push(extra) + res = state.make_temp() + state.append(inst, item=item, res=res) + state.push(res) + elif PYVERSION in ((3, 10),): + def op_LOAD_METHOD(self, state, inst): + self.op_LOAD_ATTR(state, inst) + else: + raise NotImplementedError(PYVERSION) + + def op_CALL_METHOD(self, state, inst): + self.op_CALL_FUNCTION(state, inst) + + +@total_ordering +class _State(object): + """State of the trace + """ + def __init__(self, bytecode, pc, nstack, blockstack, nullvals=()): + """ + Parameters + ---------- + bytecode : numba.bytecode.ByteCode + function bytecode + pc : int + program counter + nstack : int + stackdepth at entry + blockstack : Sequence[Dict] + A sequence of dictionary denoting entries on the blockstack. + """ + self._bytecode = bytecode + self._pc_initial = pc + self._pc = pc + self._nstack_initial = nstack + self._stack = [] + self._blockstack_initial = tuple(blockstack) + self._blockstack = list(blockstack) + self._temp_registers = [] + self._insts = [] + self._outedges = [] + self._terminated = False + self._phis = {} + self._outgoing_phis = UniqueDict() + self._used_regs = set() + for i in range(nstack): + if i in nullvals: + phi = self.make_temp("null$") + else: + phi = self.make_temp("phi") + self._phis[phi] = i + self.push(phi) + + def __repr__(self): + return "State(pc_initial={} nstack_initial={})".format( + self._pc_initial, self._nstack_initial + ) + + def get_identity(self): + return (self._pc_initial, self._nstack_initial) + + def __hash__(self): + return hash(self.get_identity()) + + def __lt__(self, other): + return self.get_identity() < other.get_identity() + + def __eq__(self, other): + return self.get_identity() == other.get_identity() + + @property + def pc_initial(self): + """The starting bytecode offset of this State. + The PC given to the constructor. + """ + return self._pc_initial + + @property + def instructions(self): + """The list of instructions information as a 2-tuple of + ``(pc : int, register_map : Dict)`` + """ + return self._insts + + @property + def outgoing_edges(self): + """The list of outgoing edges. + + Returns + ------- + edges : List[State] + """ + return self._outedges + + @property + def outgoing_phis(self): + """The dictionary of outgoing phi nodes. + + The keys are the name of the PHI nodes. + The values are the outgoing states. + """ + return self._outgoing_phis + + @property + def blockstack_initial(self): + """A copy of the initial state of the blockstack + """ + return self._blockstack_initial + + @property + def stack_depth(self): + """The current size of the stack + + Returns + ------- + res : int + """ + return len(self._stack) + + def find_initial_try_block(self): + """Find the initial *try* block. + """ + for blk in reversed(self._blockstack_initial): + if blk['kind'] == BlockKind('TRY'): + return blk + + def has_terminated(self): + return self._terminated + + def get_inst(self): + return self._bytecode[self._pc] + + def advance_pc(self): + inst = self.get_inst() + self._pc = inst.next + + def make_temp(self, prefix=""): + if not prefix: + name = "${prefix}{offset}{opname}.{tempct}".format( + prefix=prefix, + offset=self._pc, + opname=self.get_inst().opname.lower(), + tempct=len(self._temp_registers), + ) + else: + name = "${prefix}{offset}.{tempct}".format( + prefix=prefix, + offset=self._pc, + tempct=len(self._temp_registers), + ) + + self._temp_registers.append(name) + return name + + def append(self, inst, **kwargs): + """Append new inst""" + self._insts.append((inst.offset, kwargs)) + self._used_regs |= set(_flatten_inst_regs(kwargs.values())) + + def get_tos(self): + return self.peek(1) + + def peek(self, k): + """Return the k'th element on the stack + """ + return self._stack[-k] + + def push(self, item): + """Push to stack""" + self._stack.append(item) + + def pop(self): + """Pop the stack""" + return self._stack.pop() + + def swap(self, idx): + """Swap stack[idx] with the tos""" + s = self._stack + s[-1], s[-idx] = s[-idx], s[-1] + + def push_block(self, synblk): + """Push a block to blockstack + """ + assert 'stack_depth' in synblk + self._blockstack.append(synblk) + + def reset_stack(self, depth): + """Reset the stack to the given stack depth. + Returning the popped items. + """ + self._stack, popped = self._stack[:depth], self._stack[depth:] + return popped + + def make_block(self, kind, end, reset_stack=True, handler=None): + """Make a new block + """ + d = { + 'kind': BlockKind(kind), + 'end': end, + 'entry_stack': len(self._stack), + } + if reset_stack: + d['stack_depth'] = len(self._stack) + else: + d['stack_depth'] = None + d['handler'] = handler + return d + + def pop_block(self): + """Pop a block and unwind the stack + """ + b = self._blockstack.pop() + self.reset_stack(b['stack_depth']) + return b + + def pop_block_and_above(self, blk): + """Find *blk* in the blockstack and remove it and all blocks above it + from the stack. + """ + idx = self._blockstack.index(blk) + assert 0 <= idx < len(self._blockstack) + self._blockstack = self._blockstack[:idx] + + def get_top_block(self, kind): + """Find the first block that matches *kind* + """ + kind = BlockKind(kind) + for bs in reversed(self._blockstack): + if bs['kind'] == kind: + return bs + + def get_top_block_either(self, *kinds): + """Find the first block that matches *kind* + """ + kinds = {BlockKind(kind) for kind in kinds} + for bs in reversed(self._blockstack): + if bs['kind'] in kinds: + return bs + + def has_active_try(self): + """Returns a boolean indicating if the top-block is a *try* block + """ + return self.get_top_block('TRY') is not None + + def get_varname(self, inst): + """Get referenced variable name from the instruction's oparg + """ + return self.get_varname_by_arg(inst.arg) + + def get_varname_by_arg(self, oparg: int): + """Get referenced variable name from the oparg + """ + return self._bytecode.co_varnames[oparg] + + def terminate(self): + """Mark block as terminated + """ + self._terminated = True + + def fork(self, pc, npop=0, npush=0, extra_block=None): + """Fork the state + """ + # Handle changes on the stack + stack = list(self._stack) + if npop: + assert 0 <= npop <= len(self._stack) + nstack = len(self._stack) - npop + stack = stack[:nstack] + if npush: + assert 0 <= npush + for i in range(npush): + stack.append(self.make_temp()) + # Handle changes on the blockstack + blockstack = list(self._blockstack) + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + # pop expired block in destination pc + while blockstack: + top = blockstack[-1] + end = top.get('end_offset') or top['end'] + if pc >= end: + blockstack.pop() + else: + break + elif PYVERSION in ((3, 10),): + pass # intentionally bypass + else: + raise NotImplementedError(PYVERSION) + + if extra_block: + blockstack.append(extra_block) + self._outedges.append(Edge( + pc=pc, stack=tuple(stack), npush=npush, + blockstack=tuple(blockstack), + )) + self.terminate() + + def split_new_block(self): + """Split the state + """ + self.fork(pc=self._pc) + + def get_outgoing_states(self): + """Get states for each outgoing edges + """ + # Should only call once + assert not self._outgoing_phis + ret = [] + for edge in self._outedges: + state = State(bytecode=self._bytecode, pc=edge.pc, + nstack=len(edge.stack), blockstack=edge.blockstack, + nullvals=[i for i, v in enumerate(edge.stack) + if _is_null_temp_reg(v)]) + ret.append(state) + # Map outgoing_phis + for phi, i in state._phis.items(): + self._outgoing_phis[phi] = edge.stack[i] + return ret + + def get_outgoing_edgepushed(self): + """ + Returns + ------- + Dict[int, int] + where keys are the PC + values are the edge-pushed stack values + """ + + return {edge.pc: tuple(edge.stack[-edge.npush:]) + for edge in self._outedges} + + +class StatePy311(_State): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._kw_names = None + + def pop_kw_names(self): + out = self._kw_names + self._kw_names = None + return out + + def set_kw_names(self, val): + assert self._kw_names is None + self._kw_names = val + + def is_in_exception(self): + bc = self._bytecode + return bc.find_exception_entry(self._pc) is not None + + def get_exception(self): + bc = self._bytecode + return bc.find_exception_entry(self._pc) + + def in_with(self): + for ent in self._blockstack_initial: + if ent["kind"] == BlockKind("WITH"): + return True + + def make_null(self): + return self.make_temp(prefix="null$") + + +class StatePy313(StatePy311): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._make_func_attrs = defaultdict(dict) + + def set_function_attribute(self, make_func_res, **kwargs): + self._make_func_attrs[make_func_res].update(kwargs) + + def get_function_attributes(self, make_func_res): + return self._make_func_attrs[make_func_res] + + +if PYVERSION in ((3, 13), ): + State = StatePy313 +elif PYVERSION in ((3, 11), (3, 12)): + State = StatePy311 +elif PYVERSION < (3, 11): + State = _State +else: + raise NotImplementedError(PYVERSION) + + +Edge = namedtuple("Edge", ["pc", "stack", "blockstack", "npush"]) + + +class AdaptDFA(object): + """Adapt Flow to the old DFA class expected by Interpreter + """ + def __init__(self, flow): + self._flow = flow + + @property + def infos(self): + return self._flow.block_infos + + +AdaptBlockInfo = namedtuple( + "AdaptBlockInfo", + ["insts", "outgoing_phis", "blockstack", "active_try_block", + "outgoing_edgepushed"], +) + + +def adapt_state_infos(state): + def process_function_attributes(inst_pair): + offset, data = inst_pair + inst = state._bytecode[offset] + if inst.opname == "MAKE_FUNCTION": + data.update(state.get_function_attributes(data['res'])) + return offset, data + if PYVERSION in ((3, 13), ): + insts = tuple(map(process_function_attributes, state.instructions)) + elif PYVERSION in ((3, 10), (3, 11), (3, 12)): + insts = tuple(state.instructions) + else: + raise NotImplementedError(PYVERSION) + return AdaptBlockInfo( + insts=insts, + outgoing_phis=state.outgoing_phis, + blockstack=state.blockstack_initial, + active_try_block=state.find_initial_try_block(), + outgoing_edgepushed=state.get_outgoing_edgepushed(), + ) + + +def _flatten_inst_regs(iterable): + """Flatten an iterable of registers used in an instruction + """ + for item in iterable: + if isinstance(item, str): + yield item + elif isinstance(item, (tuple, list)): + for x in _flatten_inst_regs(item): + yield x + + +class AdaptCFA(object): + """Adapt Flow to the old CFA class expected by Interpreter + """ + def __init__(self, flow): + self._flow = flow + self._blocks = {} + for offset, blockinfo in flow.block_infos.items(): + self._blocks[offset] = AdaptCFBlock(blockinfo, offset) + backbone = self._flow.cfgraph.backbone() + + graph = flow.cfgraph + # Find backbone + backbone = graph.backbone() + # Filter out in loop blocks (Assuming no other cyclic control blocks) + # This is to unavoid variables defined in loops being considered as + # function scope. + inloopblocks = set() + for b in self.blocks.keys(): + if graph.in_loops(b): + inloopblocks.add(b) + self._backbone = backbone - inloopblocks + + @property + def graph(self): + return self._flow.cfgraph + + @property + def backbone(self): + return self._backbone + + @property + def blocks(self): + return self._blocks + + def iterliveblocks(self): + for b in sorted(self.blocks): + yield self.blocks[b] + + def dump(self): + self._flow.cfgraph.dump() + + +class AdaptCFBlock(object): + def __init__(self, blockinfo, offset): + self.offset = offset + self.body = tuple(i for i, _ in blockinfo.insts) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/caching.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/caching.py new file mode 100644 index 0000000000000000000000000000000000000000..26dacfb356a1932f44f80de3259738755ed6ed26 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/caching.py @@ -0,0 +1,777 @@ +""" +Caching mechanism for compiled functions. +""" + + +from abc import ABCMeta, abstractmethod, abstractproperty +import contextlib +import errno +import hashlib +import inspect +import itertools +import os +import pickle +import sys +import tempfile +import uuid +import warnings + +from numba.misc.appdirs import AppDirs +import zipfile +from pathlib import Path + +import numba +from numba.core.errors import NumbaWarning +from numba.core.base import BaseContext +from numba.core.codegen import CodeLibrary +from numba.core.compiler import CompileResult +from numba.core import config, compiler +from numba.core.serialize import dumps + + +def _cache_log(msg, *args): + if config.DEBUG_CACHE: + msg = msg % args + print(msg) + + +class _Cache(metaclass=ABCMeta): + + @abstractproperty + def cache_path(self): + """ + The base filesystem path of this cache (for example its root folder). + """ + + @abstractmethod + def load_overload(self, sig, target_context): + """ + Load an overload for the given signature using the target context. + The saved object must be returned if successful, None if not found + in the cache. + """ + + @abstractmethod + def save_overload(self, sig, data): + """ + Save the overload for the given signature. + """ + + @abstractmethod + def enable(self): + """ + Enable the cache. + """ + + @abstractmethod + def disable(self): + """ + Disable the cache. + """ + + @abstractmethod + def flush(self): + """ + Flush the cache. + """ + + +class NullCache(_Cache): + @property + def cache_path(self): + return None + + def load_overload(self, sig, target_context): + pass + + def save_overload(self, sig, cres): + pass + + def enable(self): + pass + + def disable(self): + pass + + def flush(self): + pass + + +class _CacheLocator(metaclass=ABCMeta): + """ + A filesystem locator for caching a given function. + """ + + def ensure_cache_path(self): + path = self.get_cache_path() + os.makedirs(path, exist_ok=True) + # Ensure the directory is writable by trying to write a temporary file + tempfile.TemporaryFile(dir=path).close() + + @abstractmethod + def get_cache_path(self): + """ + Return the directory the function is cached in. + """ + + @abstractmethod + def get_source_stamp(self): + """ + Get a timestamp representing the source code's freshness. + Can return any picklable Python object. + """ + + @abstractmethod + def get_disambiguator(self): + """ + Get a string disambiguator for this locator's function. + It should allow disambiguating different but similarly-named functions. + """ + + @classmethod + def from_function(cls, py_func, py_file): + """ + Create a locator instance for the given function located in the + given file. + """ + raise NotImplementedError + + @classmethod + def get_suitable_cache_subpath(cls, py_file): + """Given the Python file path, compute a suitable path inside the + cache directory. + + This will reduce a file path that is too long, which can be a problem + on some operating system (i.e. Windows 7). + """ + path = os.path.abspath(py_file) + subpath = os.path.dirname(path) + parentdir = os.path.split(subpath)[-1] + # Use SHA1 to reduce path length. + # Note: windows doesn't like long path. + hashed = hashlib.sha1(subpath.encode()).hexdigest() + # Retain parent directory name for easier debugging + return '_'.join([parentdir, hashed]) + + +class _SourceFileBackedLocatorMixin(object): + """ + A cache locator mixin for functions which are backed by a well-known + Python source file. + """ + + def get_source_stamp(self): + if getattr(sys, 'frozen', False): + st = os.stat(sys.executable) + else: + st = os.stat(self._py_file) + # We use both timestamp and size as some filesystems only have second + # granularity. + return st.st_mtime, st.st_size + + def get_disambiguator(self): + return str(self._lineno) + + @classmethod + def from_function(cls, py_func, py_file): + if not os.path.exists(py_file): + # Perhaps a placeholder (e.g. "") + return + self = cls(py_func, py_file) + try: + self.ensure_cache_path() + except OSError: + # Cannot ensure the cache directory exists or is writable + return + return self + + +class _UserProvidedCacheLocator(_SourceFileBackedLocatorMixin, _CacheLocator): + """ + A locator that always point to the user provided directory in + `numba.config.CACHE_DIR` + """ + def __init__(self, py_func, py_file): + self._py_file = py_file + self._lineno = py_func.__code__.co_firstlineno + cache_subpath = self.get_suitable_cache_subpath(py_file) + self._cache_path = os.path.join(config.CACHE_DIR, cache_subpath) + + def get_cache_path(self): + return self._cache_path + + @classmethod + def from_function(cls, py_func, py_file): + if not config.CACHE_DIR: + return + parent = super(_UserProvidedCacheLocator, cls) + return parent.from_function(py_func, py_file) + + +class _InTreeCacheLocator(_SourceFileBackedLocatorMixin, _CacheLocator): + """ + A locator for functions backed by a regular Python module with a + writable __pycache__ directory. + """ + + def __init__(self, py_func, py_file): + self._py_file = py_file + self._lineno = py_func.__code__.co_firstlineno + self._cache_path = os.path.join(os.path.dirname(self._py_file), '__pycache__') + + def get_cache_path(self): + return self._cache_path + + +class _UserWideCacheLocator(_SourceFileBackedLocatorMixin, _CacheLocator): + """ + A locator for functions backed by a regular Python module or a + frozen executable, cached into a user-wide cache directory. + """ + + def __init__(self, py_func, py_file): + self._py_file = py_file + self._lineno = py_func.__code__.co_firstlineno + appdirs = AppDirs(appname="numba", appauthor=False) + cache_dir = appdirs.user_cache_dir + cache_subpath = self.get_suitable_cache_subpath(py_file) + self._cache_path = os.path.join(cache_dir, cache_subpath) + + def get_cache_path(self): + return self._cache_path + + @classmethod + def from_function(cls, py_func, py_file): + if not (os.path.exists(py_file) or getattr(sys, 'frozen', False)): + # Perhaps a placeholder (e.g. "") + # stop function exit if frozen, since it uses a temp placeholder + return + self = cls(py_func, py_file) + try: + self.ensure_cache_path() + except OSError: + # Cannot ensure the cache directory exists or is writable + return + return self + + +class _IPythonCacheLocator(_CacheLocator): + """ + A locator for functions entered at the IPython prompt (notebook or other). + """ + + def __init__(self, py_func, py_file): + self._py_file = py_file + # Note IPython enhances the linecache module to be able to + # inspect source code of functions defined on the interactive prompt. + source = inspect.getsource(py_func) + if isinstance(source, bytes): + self._bytes_source = source + else: + self._bytes_source = source.encode('utf-8') + + def get_cache_path(self): + # We could also use jupyter_core.paths.jupyter_runtime_dir() + # In both cases this is a user-wide directory, so we need to + # be careful when disambiguating if we don't want too many + # conflicts (see below). + try: + from IPython.paths import get_ipython_cache_dir + except ImportError: + # older IPython version + from IPython.utils.path import get_ipython_cache_dir + return os.path.join(get_ipython_cache_dir(), 'numba_cache') + + def get_source_stamp(self): + return hashlib.sha256(self._bytes_source).hexdigest() + + def get_disambiguator(self): + # Heuristic: we don't want too many variants being saved, but + # we don't want similar named functions (e.g. "f") to compete + # for the cache, so we hash the first two lines of the function + # source (usually this will be the @jit decorator + the function + # signature). + firstlines = b''.join(self._bytes_source.splitlines(True)[:2]) + return hashlib.sha256(firstlines).hexdigest()[:10] + + @classmethod + def from_function(cls, py_func, py_file): + if not ( + py_file.startswith("' can appear in the qualname (e.g. '') but + # are forbidden in Windows filenames + fixed_fullname = fullname.replace('<', '').replace('>', '') + fmt = '%s-%s.py%d%d%s' + return fmt % (fixed_fullname, self.locator.get_disambiguator(), + sys.version_info[0], sys.version_info[1], abiflags) + + @property + def filename_base(self): + return self._filename_base + + @property + def locator(self): + return self._locator + + @abstractmethod + def reduce(self, data): + "Returns the serialized form the data" + pass + + @abstractmethod + def rebuild(self, target_context, reduced_data): + "Returns the de-serialized form of the *reduced_data*" + pass + + @abstractmethod + def check_cachable(self, data): + "Returns True if the given data is cachable; otherwise, returns False." + pass + + +class CompileResultCacheImpl(CacheImpl): + """ + Implements the logic to cache CompileResult objects. + """ + + def reduce(self, cres): + """ + Returns a serialized CompileResult + """ + return cres._reduce() + + def rebuild(self, target_context, payload): + """ + Returns the unserialized CompileResult + """ + return compiler.CompileResult._rebuild(target_context, *payload) + + def check_cachable(self, cres): + """ + Check cachability of the given compile result. + """ + cannot_cache = None + if any(not x.can_cache for x in cres.lifted): + cannot_cache = "as it uses lifted code" + elif cres.library.has_dynamic_globals: + cannot_cache = ("as it uses dynamic globals " + "(such as ctypes pointers and large global arrays)") + if cannot_cache: + msg = ('Cannot cache compiled function "%s" %s' + % (cres.fndesc.qualname.split('.')[-1], cannot_cache)) + warnings.warn_explicit(msg, NumbaWarning, + self._locator._py_file, self._lineno) + return False + return True + + +class CodeLibraryCacheImpl(CacheImpl): + """ + Implements the logic to cache CodeLibrary objects. + """ + + _filename_prefix = None # must be overridden + + def reduce(self, codelib): + """ + Returns a serialized CodeLibrary + """ + return codelib.serialize_using_object_code() + + def rebuild(self, target_context, payload): + """ + Returns the unserialized CodeLibrary + """ + return target_context.codegen().unserialize_library(payload) + + def check_cachable(self, codelib): + """ + Check cachability of the given CodeLibrary. + """ + return not codelib.has_dynamic_globals + + def get_filename_base(self, fullname, abiflags): + parent = super(CodeLibraryCacheImpl, self) + res = parent.get_filename_base(fullname, abiflags) + return '-'.join([self._filename_prefix, res]) + + +class IndexDataCacheFile(object): + """ + Implements the logic for the index file and data file used by a cache. + """ + def __init__(self, cache_path, filename_base, source_stamp): + self._cache_path = cache_path + self._index_name = '%s.nbi' % (filename_base,) + self._index_path = os.path.join(self._cache_path, self._index_name) + self._data_name_pattern = '%s.{number:d}.nbc' % (filename_base,) + self._source_stamp = source_stamp + self._version = numba.__version__ + + def flush(self): + self._save_index({}) + + def save(self, key, data): + """ + Save a new cache entry with *key* and *data*. + """ + overloads = self._load_index() + try: + # If key already exists, we will overwrite the file + data_name = overloads[key] + except KeyError: + # Find an available name for the data file + existing = set(overloads.values()) + for i in itertools.count(1): + data_name = self._data_name(i) + if data_name not in existing: + break + overloads[key] = data_name + self._save_index(overloads) + self._save_data(data_name, data) + + def load(self, key): + """ + Load a cache entry with *key*. + """ + overloads = self._load_index() + data_name = overloads.get(key) + if data_name is None: + return + try: + return self._load_data(data_name) + except OSError: + # File could have been removed while the index still refers it. + return + + def _load_index(self): + """ + Load the cache index and return it as a dictionary (possibly + empty if cache is empty or obsolete). + """ + try: + with open(self._index_path, "rb") as f: + version = pickle.load(f) + data = f.read() + except FileNotFoundError: + # Index doesn't exist yet? + return {} + if version != self._version: + # This is another version. Avoid trying to unpickling the + # rest of the stream, as that may fail. + return {} + stamp, overloads = pickle.loads(data) + _cache_log("[cache] index loaded from %r", self._index_path) + if stamp != self._source_stamp: + # Cache is not fresh. Stale data files will be eventually + # overwritten, since they are numbered in incrementing order. + return {} + else: + return overloads + + def _save_index(self, overloads): + data = self._source_stamp, overloads + data = self._dump(data) + with self._open_for_write(self._index_path) as f: + pickle.dump(self._version, f, protocol=-1) + f.write(data) + _cache_log("[cache] index saved to %r", self._index_path) + + def _load_data(self, name): + path = self._data_path(name) + with open(path, "rb") as f: + data = f.read() + tup = pickle.loads(data) + _cache_log("[cache] data loaded from %r", path) + return tup + + def _save_data(self, name, data): + data = self._dump(data) + path = self._data_path(name) + with self._open_for_write(path) as f: + f.write(data) + _cache_log("[cache] data saved to %r", path) + + def _data_name(self, number): + return self._data_name_pattern.format(number=number) + + def _data_path(self, name): + return os.path.join(self._cache_path, name) + + def _dump(self, obj): + return dumps(obj) + + @contextlib.contextmanager + def _open_for_write(self, filepath): + """ + Open *filepath* for writing in a race condition-free way (hopefully). + uuid4 is used to try and avoid name collisions on a shared filesystem. + """ + uid = uuid.uuid4().hex[:16] # avoid long paths + tmpname = '%s.tmp.%s' % (filepath, uid) + try: + with open(tmpname, "wb") as f: + yield f + os.replace(tmpname, filepath) + except Exception: + # In case of error, remove dangling tmp file + try: + os.unlink(tmpname) + except OSError: + pass + raise + + +class Cache(_Cache): + """ + A per-function compilation cache. The cache saves data in separate + data files and maintains information in an index file. + + There is one index file per function and Python version + ("function_name-.pyXY.nbi") which contains a mapping of + signatures and architectures to data files. + It is prefixed by a versioning key and a timestamp of the Python source + file containing the function. + + There is one data file ("function_name-.pyXY..nbc") + per function, function signature, target architecture and Python version. + + Separate index and data files per Python version avoid pickle + compatibility problems. + + Note: + This contains the driver logic only. The core logic is provided + by a subclass of ``CacheImpl`` specified as *_impl_class* in the subclass. + """ + + # The following class variables must be overridden by subclass. + _impl_class = None + + def __init__(self, py_func): + self._name = repr(py_func) + self._py_func = py_func + self._impl = self._impl_class(py_func) + self._cache_path = self._impl.locator.get_cache_path() + # This may be a bit strict but avoids us maintaining a magic number + source_stamp = self._impl.locator.get_source_stamp() + filename_base = self._impl.filename_base + self._cache_file = IndexDataCacheFile(cache_path=self._cache_path, + filename_base=filename_base, + source_stamp=source_stamp) + self.enable() + + def __repr__(self): + return "<%s py_func=%r>" % (self.__class__.__name__, self._name) + + @property + def cache_path(self): + return self._cache_path + + def enable(self): + self._enabled = True + + def disable(self): + self._enabled = False + + def flush(self): + self._cache_file.flush() + + def load_overload(self, sig, target_context): + """ + Load and recreate the cached object for the given signature, + using the *target_context*. + """ + # Refresh the context to ensure it is initialized + target_context.refresh() + with self._guard_against_spurious_io_errors(): + return self._load_overload(sig, target_context) + # None returned if the `with` block swallows an exception + + def _load_overload(self, sig, target_context): + if not self._enabled: + return + key = self._index_key(sig, target_context.codegen()) + data = self._cache_file.load(key) + if data is not None: + data = self._impl.rebuild(target_context, data) + return data + + def save_overload(self, sig, data): + """ + Save the data for the given signature in the cache. + """ + with self._guard_against_spurious_io_errors(): + self._save_overload(sig, data) + + def _save_overload(self, sig, data): + if not self._enabled: + return + if not self._impl.check_cachable(data): + return + self._impl.locator.ensure_cache_path() + key = self._index_key(sig, data.codegen) + data = self._impl.reduce(data) + self._cache_file.save(key, data) + + @contextlib.contextmanager + def _guard_against_spurious_io_errors(self): + if os.name == 'nt': + # Guard against permission errors due to accessing the file + # from several processes (see #2028) + try: + yield + except OSError as e: + if e.errno != errno.EACCES: + raise + else: + # No such conditions under non-Windows OSes + yield + + def _index_key(self, sig, codegen): + """ + Compute index key for the given signature and codegen. + It includes a description of the OS, target architecture and hashes of + the bytecode for the function and, if the function has a __closure__, + a hash of the cell_contents. + """ + codebytes = self._py_func.__code__.co_code + if self._py_func.__closure__ is not None: + cvars = tuple([x.cell_contents for x in self._py_func.__closure__]) + # Note: cloudpickle serializes a function differently depending + # on how the process is launched; e.g. multiprocessing.Process + cvarbytes = dumps(cvars) + else: + cvarbytes = b'' + + hasher = lambda x: hashlib.sha256(x).hexdigest() + return (sig, codegen.magic_tuple(), (hasher(codebytes), + hasher(cvarbytes),)) + + +class FunctionCache(Cache): + """ + Implements Cache that saves and loads CompileResult objects. + """ + _impl_class = CompileResultCacheImpl + + +# Remember used cache filename prefixes. +_lib_cache_prefixes = set(['']) + + +def make_library_cache(prefix): + """ + Create a Cache class for additional compilation features to cache their + result for reuse. The cache is saved in filename pattern like + in ``FunctionCache`` but with additional *prefix* as specified. + """ + # avoid cache prefix reuse + assert prefix not in _lib_cache_prefixes + _lib_cache_prefixes.add(prefix) + + class CustomCodeLibraryCacheImpl(CodeLibraryCacheImpl): + _filename_prefix = prefix + + class LibraryCache(Cache): + """ + Implements Cache that saves and loads CodeLibrary objects for additional + feature for the specified python function. + """ + _impl_class = CustomCodeLibraryCacheImpl + + return LibraryCache + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/callconv.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/callconv.py new file mode 100644 index 0000000000000000000000000000000000000000..2bf15431467300180ab09d0bffc77262bb1da5a6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/callconv.py @@ -0,0 +1,961 @@ +""" +Calling conventions for Numba-compiled functions. +""" + +from collections import namedtuple +from collections.abc import Iterable +import itertools +import hashlib + +from llvmlite import ir + +from numba.core import types, cgutils, errors +from numba.core.base import PYOBJECT, GENERIC_POINTER + + +TryStatus = namedtuple('TryStatus', ['in_try', 'excinfo']) + + +Status = namedtuple("Status", + ("code", + # If the function returned ok (a value or None) + "is_ok", + # If the function returned None + "is_none", + # If the function errored out (== not is_ok) + "is_error", + # If the generator exited with StopIteration + "is_stop_iteration", + # If the function errored with an already set exception + "is_python_exc", + # If the function errored with a user exception + "is_user_exc", + # The pointer to the exception info structure (for user + # exceptions) + "excinfoptr", + )) + +int32_t = ir.IntType(32) +int64_t = ir.IntType(64) +errcode_t = int32_t + + +def _const_int(code): + return ir.Constant(errcode_t, code) + + +RETCODE_OK = _const_int(0) +RETCODE_EXC = _const_int(-1) +RETCODE_NONE = _const_int(-2) +# StopIteration +RETCODE_STOPIT = _const_int(-3) + +FIRST_USEREXC = 1 + +RETCODE_USEREXC = _const_int(FIRST_USEREXC) + + +class BaseCallConv(object): + + def __init__(self, context): + self.context = context + + def return_optional_value(self, builder, retty, valty, value): + if valty == types.none: + # Value is none + self.return_native_none(builder) + + elif retty == valty: + # Value is an optional, need a runtime switch + optval = self.context.make_helper(builder, retty, value=value) + + validbit = cgutils.as_bool_bit(builder, optval.valid) + with builder.if_then(validbit): + retval = self.context.get_return_value(builder, retty.type, + optval.data) + self.return_value(builder, retval) + + self.return_native_none(builder) + + elif not isinstance(valty, types.Optional): + # Value is not an optional, need a cast + if valty != retty.type: + value = self.context.cast(builder, value, fromty=valty, + toty=retty.type) + retval = self.context.get_return_value(builder, retty.type, value) + self.return_value(builder, retval) + + else: + raise NotImplementedError("returning {0} for {1}".format(valty, + retty)) + + def return_native_none(self, builder): + self._return_errcode_raw(builder, RETCODE_NONE) + + def return_exc(self, builder): + self._return_errcode_raw(builder, RETCODE_EXC) + + def return_stop_iteration(self, builder): + self._return_errcode_raw(builder, RETCODE_STOPIT) + + def get_return_type(self, ty): + """ + Get the actual type of the return argument for Numba type *ty*. + """ + restype = self.context.data_model_manager[ty].get_return_type() + return restype.as_pointer() + + def init_call_helper(self, builder): + """ + Initialize and return a call helper object for the given builder. + """ + ch = self._make_call_helper(builder) + builder.__call_helper = ch + return ch + + def _get_call_helper(self, builder): + return builder.__call_helper + + def unpack_exception(self, builder, pyapi, status): + return pyapi.unserialize(status.excinfoptr) + + def raise_error(self, builder, pyapi, status): + """ + Given a non-ok *status*, raise the corresponding Python exception. + """ + bbend = builder.function.append_basic_block() + + with builder.if_then(status.is_user_exc): + # Unserialize user exception. + # Make sure another error may not interfere. + pyapi.err_clear() + exc = self.unpack_exception(builder, pyapi, status) + with cgutils.if_likely(builder, + cgutils.is_not_null(builder, exc)): + pyapi.raise_object(exc) # steals ref + builder.branch(bbend) + + with builder.if_then(status.is_stop_iteration): + pyapi.err_set_none("PyExc_StopIteration") + builder.branch(bbend) + + with builder.if_then(status.is_python_exc): + # Error already raised => nothing to do + builder.branch(bbend) + + pyapi.err_set_string("PyExc_SystemError", + "unknown error when calling native function") + builder.branch(bbend) + + builder.position_at_end(bbend) + + def decode_arguments(self, builder, argtypes, func): + """ + Get the decoded (unpacked) Python arguments with *argtypes* + from LLVM function *func*. A tuple of LLVM values is returned. + """ + raw_args = self.get_arguments(func) + arginfo = self._get_arg_packer(argtypes) + return arginfo.from_arguments(builder, raw_args) + + def _get_arg_packer(self, argtypes): + """ + Get an argument packer for the given argument types. + """ + return self.context.get_arg_packer(argtypes) + + +class MinimalCallConv(BaseCallConv): + """ + A minimal calling convention, suitable for e.g. GPU targets. + The implemented function signature is: + + retcode_t (*, ... ) + + The return code will be one of the RETCODE_* constants or a + function-specific user exception id (>= RETCODE_USEREXC). + + Caller is responsible for allocating a slot for the return value + (passed as a pointer in the first argument). + """ + + def _make_call_helper(self, builder): + return _MinimalCallHelper() + + def return_value(self, builder, retval): + retptr = builder.function.args[0] + assert retval.type == retptr.type.pointee, \ + (str(retval.type), str(retptr.type.pointee)) + builder.store(retval, retptr) + self._return_errcode_raw(builder, RETCODE_OK) + + def return_user_exc(self, builder, exc, exc_args=None, loc=None, + func_name=None): + if exc is not None and not issubclass(exc, BaseException): + raise TypeError("exc should be None or exception class, got %r" + % (exc,)) + if exc_args is not None and not isinstance(exc_args, tuple): + raise TypeError("exc_args should be None or tuple, got %r" + % (exc_args,)) + + # Build excinfo struct + if loc is not None: + fname = loc._raw_function_name() + if fname is None: + # could be exec() or REPL, try func_name + fname = func_name + + locinfo = (fname, loc.filename, loc.line) + if None in locinfo: + locinfo = None + else: + locinfo = None + + call_helper = self._get_call_helper(builder) + exc_id = call_helper._add_exception(exc, exc_args, locinfo) + self._return_errcode_raw(builder, _const_int(exc_id)) + + def return_status_propagate(self, builder, status): + self._return_errcode_raw(builder, status.code) + + def _return_errcode_raw(self, builder, code): + if isinstance(code, int): + code = _const_int(code) + builder.ret(code) + + def _get_return_status(self, builder, code): + """ + Given a return *code*, get a Status instance. + """ + norm = builder.icmp_signed('==', code, RETCODE_OK) + none = builder.icmp_signed('==', code, RETCODE_NONE) + ok = builder.or_(norm, none) + err = builder.not_(ok) + exc = builder.icmp_signed('==', code, RETCODE_EXC) + is_stop_iteration = builder.icmp_signed('==', code, RETCODE_STOPIT) + is_user_exc = builder.icmp_signed('>=', code, RETCODE_USEREXC) + + status = Status(code=code, + is_ok=ok, + is_error=err, + is_python_exc=exc, + is_none=none, + is_user_exc=is_user_exc, + is_stop_iteration=is_stop_iteration, + excinfoptr=None) + return status + + def get_function_type(self, restype, argtypes): + """ + Get the implemented Function type for *restype* and *argtypes*. + """ + arginfo = self._get_arg_packer(argtypes) + argtypes = list(arginfo.argument_types) + resptr = self.get_return_type(restype) + fnty = ir.FunctionType(errcode_t, [resptr] + argtypes) + return fnty + + def decorate_function(self, fn, args, fe_argtypes, noalias=False): + """ + Set names and attributes of function arguments. + """ + assert not noalias + arginfo = self._get_arg_packer(fe_argtypes) + arginfo.assign_names(self.get_arguments(fn), + ['arg.' + a for a in args]) + fn.args[0].name = ".ret" + + def get_arguments(self, func): + """ + Get the Python-level arguments of LLVM *func*. + """ + return func.args[1:] + + def call_function(self, builder, callee, resty, argtys, args): + """ + Call the Numba-compiled *callee*. + """ + retty = callee.args[0].type.pointee + retvaltmp = cgutils.alloca_once(builder, retty) + # initialize return value + builder.store(cgutils.get_null_value(retty), retvaltmp) + + arginfo = self._get_arg_packer(argtys) + args = arginfo.as_arguments(builder, args) + realargs = [retvaltmp] + list(args) + code = builder.call(callee, realargs) + status = self._get_return_status(builder, code) + retval = builder.load(retvaltmp) + out = self.context.get_returned_value(builder, resty, retval) + return status, out + + +class _MinimalCallHelper(object): + """ + A call helper object for the "minimal" calling convention. + User exceptions are represented as integer codes and stored in + a mapping for retrieval from the caller. + """ + + def __init__(self): + self.exceptions = {} + + def _add_exception(self, exc, exc_args, locinfo): + """ + Add a new user exception to this helper. Returns an integer that can be + used to refer to the added exception in future. + + Parameters + ---------- + exc : + exception type + exc_args : None or tuple + exception args + locinfo : tuple + location information + """ + exc_id = len(self.exceptions) + FIRST_USEREXC + self.exceptions[exc_id] = exc, exc_args, locinfo + return exc_id + + def get_exception(self, exc_id): + """ + Get information about a user exception. Returns a tuple of + (exception type, exception args, location information). + + Parameters + ---------- + id : integer + The ID of the exception to look up + """ + try: + return self.exceptions[exc_id] + except KeyError: + msg = "unknown error %d in native function" % exc_id + exc = SystemError + exc_args = (msg,) + locinfo = None + return exc, exc_args, locinfo + + +# The structure type constructed by PythonAPI.serialize_uncached() +# i.e a {i8* pickle_buf, i32 pickle_bufsz, i8* hash_buf, i8* fn, i32 alloc_flag} +PICKLE_BUF_IDX = 0 +PICKLE_BUFSZ_IDX = 1 +HASH_BUF_IDX = 2 +UNWRAP_FUNC_IDX = 3 +ALLOC_FLAG_IDX = 4 +excinfo_t = ir.LiteralStructType( + [GENERIC_POINTER, int32_t, GENERIC_POINTER, GENERIC_POINTER, int32_t]) +excinfo_ptr_t = ir.PointerType(excinfo_t) + + +class CPUCallConv(BaseCallConv): + """ + The calling convention for CPU targets. + The implemented function signature is: + + retcode_t (*, excinfo **, ... ) + + The return code will be one of the RETCODE_* constants. + If RETCODE_USEREXC, the exception info pointer will be filled with + a pointer to a constant struct describing the raised exception. + + Caller is responsible for allocating slots for the return value + and the exception info pointer (passed as first and second arguments, + respectively). + """ + _status_ids = itertools.count(1) + + def _make_call_helper(self, builder): + return None + + def return_value(self, builder, retval): + retptr = self._get_return_argument(builder.function) + assert retval.type == retptr.type.pointee, \ + (str(retval.type), str(retptr.type.pointee)) + builder.store(retval, retptr) + self._return_errcode_raw(builder, RETCODE_OK) + + def build_excinfo_struct(self, exc, exc_args, loc, func_name): + # Build excinfo struct + if loc is not None: + fname = loc._raw_function_name() + if fname is None: + # could be exec() or REPL, try func_name + fname = func_name + + locinfo = (fname, loc.filename, loc.line) + if None in locinfo: + locinfo = None + else: + locinfo = None + + exc = (exc, exc_args, locinfo) + return exc + + def set_static_user_exc(self, builder, exc, exc_args=None, loc=None, + func_name=None): + if exc is not None and not issubclass(exc, BaseException): + raise TypeError("exc should be None or exception class, got %r" + % (exc,)) + if exc_args is not None and not isinstance(exc_args, tuple): + raise TypeError("exc_args should be None or tuple, got %r" + % (exc_args,)) + # None is indicative of no args, set the exc_args to an empty tuple + # as PyObject_CallObject(exc, exc_args) requires the second argument to + # be a tuple (or nullptr, but doing this makes it consistent) + if exc_args is None: + exc_args = tuple() + + # An exception in Numba is defined as the excinfo_t struct defined + # above. Some arguments in this struct are not used, depending on + # which kind of exception is being raised. A static exception uses + # only the first three members whilst a dynamic exception uses all + # members: + # + # static exc - last 2 args are NULL and 0 + # vvv vvv vvv + # excinfo_t: {i8*, i32, i8*, i8*, i32} + # ^^^ ^^^ ^^^ + # dynamic exc only - first 2 args are used for + # static info + # + # Comment below details how the struct is used in the case of a dynamic + # exception. For dynamic exceptions, see + # CPUCallConv::set_dynamic_user_exc + # + # {i8*, ___, ___, ___, ___} + # ^ serialized info about the exception (loc, kind, compile time + # args) + # + # {___, i32, ___, ___, ___} + # ^ len(serialized_exception) + # + # {___, ___, i8*, ___, ___} + # ^ Store a list of native values in a dynamic exception. + # Or a hash(serialized_exception) in a static exc. + # + # {___, ___, ___, i8*, ___} + # ^ "NULL" as this member is not used in a static exc + # + # {___, ___, ___, ___, i32} + # ^ Number of dynamic args in the exception. For + # static exceptions, this value is "0" + + pyapi = self.context.get_python_api(builder) + exc = self.build_excinfo_struct(exc, exc_args, loc, func_name) + struct_gv = pyapi.serialize_object(exc) + excptr = self._get_excinfo_argument(builder.function) + store = builder.store(struct_gv, excptr) + md = builder.module.add_metadata([ir.IntType(1)(1)]) + store.set_metadata("numba_exception_output", md) + + def return_user_exc(self, builder, exc, exc_args=None, loc=None, + func_name=None): + try_info = getattr(builder, '_in_try_block', False) + self.set_static_user_exc(builder, exc, exc_args=exc_args, + loc=loc, func_name=func_name) + self.check_try_status(builder) + if try_info: + # This is a hack for old-style impl. + # We will branch directly to the exception handler. + builder.branch(try_info['target']) + else: + # Return from the current function + self._return_errcode_raw(builder, RETCODE_USEREXC) + + def unpack_dynamic_exception(self, builder, pyapi, status): + excinfo_ptr = status.excinfoptr + + # load the serialized exception buffer from the module and create + # a python bytes object + picklebuf = builder.extract_value( + builder.load(excinfo_ptr), PICKLE_BUF_IDX) + picklebuf_sz = builder.extract_value( + builder.load(excinfo_ptr), PICKLE_BUFSZ_IDX) + static_exc_bytes = pyapi.bytes_from_string_and_size( + picklebuf, builder.sext(picklebuf_sz, pyapi.py_ssize_t)) + + # Load dynamic args (i8*) and the unwrap function + dyn_args = builder.extract_value( + builder.load(excinfo_ptr), HASH_BUF_IDX) + func_ptr = builder.extract_value( + builder.load(excinfo_ptr), UNWRAP_FUNC_IDX) + + # Convert the unwrap function to a function pointer and call it. + # Function returns a python tuple with dynamic arguments converted to + # CPython objects + fnty = ir.FunctionType(PYOBJECT, [GENERIC_POINTER]) + fn = builder.bitcast(func_ptr, fnty.as_pointer()) + py_tuple = builder.call(fn, [dyn_args]) + + # We check at this stage if creating the Python tuple was successful + # or not. Note the exception is raised by calling PyErr_SetString + # directly as the current function is the CPython wrapper. + failed = cgutils.is_null(builder, py_tuple) + with cgutils.if_unlikely(builder, failed): + msg = ('Error creating Python tuple from runtime exception ' + 'arguments') + pyapi.err_set_string("PyExc_RuntimeError", msg) + # Return NULL to indicate an error was raised + fnty = builder.function.function_type + if not isinstance(fnty.return_type, ir.VoidType): + # in some ufuncs, the return type is void + builder.ret(cgutils.get_null_value(fnty.return_type)) + else: + builder.ret_void() + + # merge static and dynamic variables + excinfo = pyapi.build_dynamic_excinfo_struct(static_exc_bytes, py_tuple) + + # At this point, one can free the entire excinfo_ptr struct + if self.context.enable_nrt: + # One can safely emit a free instruction as it is only executed + # if its in a dynamic exception branch + self.context.nrt.free( + builder, builder.bitcast(excinfo_ptr, pyapi.voidptr)) + return excinfo + + def unpack_exception(self, builder, pyapi, status): + # Emit code that checks the alloc flag (last excinfo member) + # if alloc_flag > 0: + # (dynamic) unpack the exception to retrieve runtime information + # and merge with static info + # else: + # (static) unserialize the exception using pythonapi.unserialize + + excinfo_ptr = status.excinfoptr + alloc_flag = builder.extract_value(builder.load(excinfo_ptr), + ALLOC_FLAG_IDX) + gt = builder.icmp_signed('>', alloc_flag, int32_t(0)) + with builder.if_else(gt) as (then, otherwise): + with then: + dyn_exc = self.unpack_dynamic_exception(builder, pyapi, status) + bb_then = builder.block + with otherwise: + static_exc = pyapi.unserialize(excinfo_ptr) + bb_else = builder.block + phi = builder.phi(static_exc.type) + phi.add_incoming(dyn_exc, bb_then) + phi.add_incoming(static_exc, bb_else) + return phi + + def emit_unwrap_dynamic_exception_fn(self, module, st_type, nb_types): + # Create a function that converts a list of runtime arguments to a tuple + # of PyObjects. i.e.: + # + # @njit('void(float, int64)') + # def func(a, b): + # raise ValueError(a, 123, b) + # + # The last three arguments of the exception info structure will hold: + # {___, ___, i8*, i8*, i32} + # ^ A ptr to a {f32, i64} struct + # ^ function ptr that converts i8* -> {f32, i64}* -> + # python tuple + # ^ Number of dynamic arguments = 2 + # + + _hash = hashlib.sha1(str(st_type).encode()).hexdigest() + name = f'__excinfo_unwrap_args{_hash}' + if name in module.globals: + return module.globals.get(name) + + fnty = ir.FunctionType(GENERIC_POINTER, [GENERIC_POINTER]) + fn = ir.Function(module, fnty, name) + + # prevent the function from being inlined + fn.attributes.add('nounwind') + fn.attributes.add('noinline') + + bb_entry = fn.append_basic_block('') + builder = ir.IRBuilder(bb_entry) + pyapi = self.context.get_python_api(builder) + + # i8* -> {native arg1 type, native arg2 type, ...} + st_type_ptr = st_type.as_pointer() + st_ptr = builder.bitcast(fn.args[0], st_type_ptr) + # compile time values are stored as None + nb_types = [typ for typ in nb_types if typ is not None] + + # convert native values into CPython objects + objs = [] + env_manager = self.context.get_env_manager(builder, + return_pyobject=True) + for i, typ in enumerate(nb_types): + val = builder.extract_value(builder.load(st_ptr), i) + obj = pyapi.from_native_value(typ, val, env_manager=env_manager) + + # If object cannot be boxed, raise an exception + if obj == cgutils.get_null_value(obj.type): + # When not supported, abort compilation + msg = f'Cannot convert native {typ} to a Python object.' + raise errors.TypingError(msg) + + objs.append(obj) + + # at this point, a pointer to the list of runtime values can be freed + self.context.nrt.free(builder, + self._get_return_argument(builder.function)) + + # Create a tuple of CPython objects + tup = pyapi.tuple_pack(objs) + builder.ret(tup) + + return fn + + def emit_wrap_args_insts(self, builder, pyapi, struct_type, exc_args): + """ + Create an anonymous struct containing the given LLVM *values*. + """ + st_size = pyapi.py_ssize_t(self.context.get_abi_sizeof(struct_type)) + + st_ptr = builder.bitcast( + self.context.nrt.allocate(builder, st_size), + struct_type.as_pointer()) + + # skip compile-time values + exc_args = [arg for arg in exc_args if isinstance(arg, ir.Value)] + + zero = int32_t(0) + for idx, arg in enumerate(exc_args): + builder.store(arg, builder.gep(st_ptr, [zero, int32_t(idx)])) + + return st_ptr + + def set_dynamic_user_exc(self, builder, exc, exc_args, nb_types, loc=None, + func_name=None): + """ + Compute the required bits to emit an exception with dynamic (runtime) + values + """ + if not issubclass(exc, BaseException): + raise TypeError("exc should be an exception class, got %r" + % (exc,)) + if exc_args is not None and not isinstance(exc_args, tuple): + raise TypeError("exc_args should be None or tuple, got %r" + % (exc_args,)) + + # An exception in Numba is defined as the excinfo_t struct defined + # above. Some arguments in this struct are not used, depending on + # which kind of exception is being raised. A static exception uses + # only the first three members whilst a dynamic exception uses all + # members: + # + # static exc - last 2 args are NULL and 0 + # vvv vvv vvv + # excinfo_t: {i8*, i32, i8*, i8*, i32} + # ^^^ ^^^ ^^^ + # dynamic exc only - first 2 args are used for + # static info + # + # Comment below details how the struct is used in the case of a dynamic + # exception. For static exception, see CPUCallConv::set_static_user_exc + # + # {i8*, ___, ___, ___, ___} + # ^ serialized info about the exception (loc, kind, compile time + # args) + # + # {___, i32, ___, ___, ___} + # ^ len(serialized_exception) + # + # {___, ___, i8*, ___, ___} + # ^ Store a list of native values in a dynamic exception. + # Or a hash(serialized_exception) in a static exc. + # + # {___, ___, ___, i8*, ___} + # ^ Pointer to function that convert native values + # into PyObject*. NULL in the case of a static + # exception + # + # {___, ___, ___, ___, i32} + # ^ Number of dynamic args in the exception. + # Default is "0" + # + # The following code will: + # 1) Serialize compile time information and store them in the first + # two args {i8*, i32, ___, ___, ___} of excinfo_t + # 2) Emit the required code for converting native values to CPython + # objects. Those objects are stored in the last three args + # {___, ___, i8*, i8*, i32} of excinfo_t + # 3) Allocate a new excinfo_t struct + # 4) Fill excinfo_t struct and copy the pointer to the excinfo** arg + + # serialize comp. time args + pyapi = self.context.get_python_api(builder) + dummy = self.context.get_dummy_value() + exc_args_static = tuple( + [dummy if isinstance(arg, ir.Value) else arg for arg in exc_args]) + exc = self.build_excinfo_struct(exc, exc_args_static, loc, func_name) + excinfo_pp = self._get_excinfo_argument(builder.function) + struct_gv = builder.load(pyapi.serialize_object(exc)) + + # Create the struct for runtime args and emit a function to convert it + # into a Python tuple + struct_type = ir.LiteralStructType([arg.type for arg in exc_args if + isinstance(arg, ir.Value)]) + st_ptr = self.emit_wrap_args_insts(builder, pyapi, struct_type, + exc_args) + unwrap_fn = self.emit_unwrap_dynamic_exception_fn( + builder.module, struct_type, nb_types) + + # allocate the excinfo struct + exc_size = pyapi.py_ssize_t(self.context.get_abi_sizeof(excinfo_t)) + excinfo_p = builder.bitcast( + self.context.nrt.allocate(builder, exc_size), + excinfo_ptr_t) + + # fill the args + zero = int32_t(0) + exc_fields = (builder.extract_value(struct_gv, PICKLE_BUF_IDX), + builder.extract_value(struct_gv, PICKLE_BUFSZ_IDX), + builder.bitcast(st_ptr, GENERIC_POINTER), + builder.bitcast(unwrap_fn, GENERIC_POINTER), + int32_t(len(struct_type))) + for idx, arg in enumerate(exc_fields): + builder.store(arg, builder.gep(excinfo_p, [zero, int32_t(idx)])) + builder.store(excinfo_p, excinfo_pp) + + def return_dynamic_user_exc(self, builder, exc, exc_args, nb_types, + loc=None, func_name=None): + """ + Same as ::return_user_exc but for dynamic exceptions + """ + self.set_dynamic_user_exc(builder, exc, exc_args, nb_types, + loc=loc, func_name=func_name) + self._return_errcode_raw(builder, RETCODE_USEREXC) + + def _get_try_state(self, builder): + try: + return builder.__eh_try_state + except AttributeError: + ptr = cgutils.alloca_once( + builder, cgutils.intp_t, name='try_state', zfill=True, + ) + builder.__eh_try_state = ptr + return ptr + + def check_try_status(self, builder): + try_state_ptr = self._get_try_state(builder) + try_depth = builder.load(try_state_ptr) + # try_depth > 0 + in_try = builder.icmp_unsigned('>', try_depth, try_depth.type(0)) + + excinfoptr = self._get_excinfo_argument(builder.function) + excinfo = builder.load(excinfoptr) + + return TryStatus(in_try=in_try, excinfo=excinfo) + + def set_try_status(self, builder): + try_state_ptr = self._get_try_state(builder) + # Increment try depth + old = builder.load(try_state_ptr) + new = builder.add(old, old.type(1)) + builder.store(new, try_state_ptr) + + def unset_try_status(self, builder): + try_state_ptr = self._get_try_state(builder) + # Decrement try depth + old = builder.load(try_state_ptr) + new = builder.sub(old, old.type(1)) + builder.store(new, try_state_ptr) + + # Needs to reset the exception state so that the exception handler + # will run normally. + excinfoptr = self._get_excinfo_argument(builder.function) + null = cgutils.get_null_value(excinfoptr.type.pointee) + builder.store(null, excinfoptr) + + def return_status_propagate(self, builder, status): + trystatus = self.check_try_status(builder) + excptr = self._get_excinfo_argument(builder.function) + builder.store(status.excinfoptr, excptr) + with builder.if_then(builder.not_(trystatus.in_try)): + self._return_errcode_raw(builder, status.code) + + def _return_errcode_raw(self, builder, code): + builder.ret(code) + + def _get_return_status(self, builder, code, excinfoptr): + """ + Given a return *code* and *excinfoptr*, get a Status instance. + """ + norm = builder.icmp_signed('==', code, RETCODE_OK) + none = builder.icmp_signed('==', code, RETCODE_NONE) + exc = builder.icmp_signed('==', code, RETCODE_EXC) + is_stop_iteration = builder.icmp_signed('==', code, RETCODE_STOPIT) + ok = builder.or_(norm, none) + err = builder.not_(ok) + is_user_exc = builder.icmp_signed('>=', code, RETCODE_USEREXC) + excinfoptr = builder.select(is_user_exc, excinfoptr, + ir.Constant(excinfo_ptr_t, ir.Undefined)) + + status = Status(code=code, + is_ok=ok, + is_error=err, + is_python_exc=exc, + is_none=none, + is_user_exc=is_user_exc, + is_stop_iteration=is_stop_iteration, + excinfoptr=excinfoptr) + return status + + def get_function_type(self, restype, argtypes): + """ + Get the implemented Function type for *restype* and *argtypes*. + """ + arginfo = self._get_arg_packer(argtypes) + argtypes = list(arginfo.argument_types) + resptr = self.get_return_type(restype) + fnty = ir.FunctionType(errcode_t, + [resptr, ir.PointerType(excinfo_ptr_t)] + + argtypes) + return fnty + + def decorate_function(self, fn, args, fe_argtypes, noalias=False): + """ + Set names of function arguments, and add useful attributes to them. + """ + arginfo = self._get_arg_packer(fe_argtypes) + arginfo.assign_names(self.get_arguments(fn), + ['arg.' + a for a in args]) + retarg = self._get_return_argument(fn) + retarg.name = "retptr" + retarg.add_attribute("nocapture") + retarg.add_attribute("noalias") + excarg = self._get_excinfo_argument(fn) + excarg.name = "excinfo" + excarg.add_attribute("nocapture") + excarg.add_attribute("noalias") + + if noalias: + args = self.get_arguments(fn) + for a in args: + if isinstance(a.type, ir.PointerType): + a.add_attribute("nocapture") + a.add_attribute("noalias") + + # Add metadata to mark functions that may need NRT + # thus disabling aggressive refct pruning in removerefctpass.py + def type_may_always_need_nrt(ty): + # Returns True if it's a non-Array type that is contains MemInfo + if not isinstance(ty, types.Array): + dmm = self.context.data_model_manager + if dmm[ty].contains_nrt_meminfo(): + return True + return False + + args_may_always_need_nrt = any( + map(type_may_always_need_nrt, fe_argtypes) + ) + + if args_may_always_need_nrt: + nmd = fn.module.add_named_metadata( + 'numba_args_may_always_need_nrt', + ) + nmd.add(fn.module.add_metadata([fn])) + + def get_arguments(self, func): + """ + Get the Python-level arguments of LLVM *func*. + """ + return func.args[2:] + + def _get_return_argument(self, func): + return func.args[0] + + def _get_excinfo_argument(self, func): + return func.args[1] + + def call_function(self, builder, callee, resty, argtys, args, + attrs=None): + """ + Call the Numba-compiled *callee*. + Parameters: + ----------- + attrs: LLVM style string or iterable of individual attributes, default + is None which specifies no attributes. Examples: + LLVM style string: "noinline fast" + Equivalent iterable: ("noinline", "fast") + """ + retty = self.get_return_type(resty).pointee + actual_retty = self._get_return_argument(callee.function_type).pointee + if retty != actual_retty: + m = f"Function type returns {actual_retty} but resty={retty}" + raise ValueError(m) + + retvaltmp = cgutils.alloca_once(builder, retty) + # initialize return value to zeros + builder.store(cgutils.get_null_value(retty), retvaltmp) + + excinfoptr = cgutils.alloca_once(builder, ir.PointerType(excinfo_t), + name="excinfo") + + arginfo = self._get_arg_packer(argtys) + args = list(arginfo.as_arguments(builder, args)) + realargs = [retvaltmp, excinfoptr] + args + # deal with attrs, it's fine to specify a load in a string like + # "noinline fast" as per LLVM or equally as an iterable of individual + # attributes. + if attrs is None: + _attrs = () + elif isinstance(attrs, Iterable) and not isinstance(attrs, str): + _attrs = tuple(attrs) + else: + raise TypeError("attrs must be an iterable of strings or None") + code = builder.call(callee, realargs, attrs=_attrs) + status = self._get_return_status(builder, code, + builder.load(excinfoptr)) + retval = builder.load(retvaltmp) + out = self.context.get_returned_value(builder, resty, retval) + return status, out + + +class ErrorModel(object): + + def __init__(self, call_conv): + self.call_conv = call_conv + + def fp_zero_division(self, builder, exc_args=None, loc=None): + if self.raise_on_fp_zero_division: + self.call_conv.return_user_exc(builder, ZeroDivisionError, exc_args, + loc) + return True + else: + return False + + +class PythonErrorModel(ErrorModel): + """ + The Python error model. Any invalid FP input raises an exception. + """ + raise_on_fp_zero_division = True + + +class NumpyErrorModel(ErrorModel): + """ + In the Numpy error model, floating-point errors don't raise an + exception. The FPU exception state is inspected by Numpy at the + end of a ufunc's execution and a warning is raised if appropriate. + + Note there's no easy way to set the FPU exception state from LLVM. + Instructions known to set an FP exception can be optimized away: + https://llvm.org/bugs/show_bug.cgi?id=6050 + http://lists.llvm.org/pipermail/llvm-dev/2014-September/076918.html + http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20140929/237997.html + """ + raise_on_fp_zero_division = False + + +error_models = { + 'python': PythonErrorModel, + 'numpy': NumpyErrorModel, +} + + +def create_error_model(model_name, context): + """ + Create an error model instance for the given target context. + """ + return error_models[model_name](context.call_conv) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/callwrapper.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/callwrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..5508aa38e516b92d89f1c97c01c2ec861a612cc0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/callwrapper.py @@ -0,0 +1,226 @@ +from llvmlite.ir import Constant, IRBuilder +import llvmlite.ir + +from numba.core import types, config, cgutils + + +class _ArgManager(object): + """ + A utility class to handle argument unboxing and cleanup + """ + def __init__(self, context, builder, api, env_manager, endblk, nargs): + self.context = context + self.builder = builder + self.api = api + self.env_manager = env_manager + self.arg_count = 0 # how many function arguments have been processed + self.cleanups = [] + self.nextblk = endblk + + def add_arg(self, obj, ty): + """ + Unbox argument and emit code that handles any error during unboxing. + Args are cleaned up in reverse order of the parameter list, and + cleanup begins as soon as unboxing of any argument fails. E.g. failure + on arg2 will result in control flow going through: + + arg2.err -> arg1.err -> arg0.err -> arg.end (returns) + """ + # Unbox argument + native = self.api.to_native_value(ty, obj) + + # If an error occurred, go to the cleanup block for + # the previous argument + with cgutils.if_unlikely(self.builder, native.is_error): + self.builder.branch(self.nextblk) + + # Define the cleanup function for the argument + def cleanup_arg(): + # Native value reflection + self.api.reflect_native_value(ty, native.value, self.env_manager) + + # Native value cleanup + if native.cleanup is not None: + native.cleanup() + + # NRT cleanup + # (happens after the native value cleanup as the latter + # may need the native value) + if self.context.enable_nrt: + self.context.nrt.decref(self.builder, ty, native.value) + + self.cleanups.append(cleanup_arg) + + # Write the on-error cleanup block for this argument + cleanupblk = self.builder.append_basic_block( + "arg%d.err" % self.arg_count) + with self.builder.goto_block(cleanupblk): + cleanup_arg() + # Go to next cleanup block + self.builder.branch(self.nextblk) + + self.nextblk = cleanupblk + self.arg_count += 1 + return native.value + + def emit_cleanup(self): + """ + Emit the cleanup code after returning from the wrapped function. + """ + for dtor in self.cleanups: + dtor() + + +class _GilManager(object): + """ + A utility class to handle releasing the GIL and then re-acquiring it + again. + """ + + def __init__(self, builder, api, argman): + self.builder = builder + self.api = api + self.argman = argman + self.thread_state = api.save_thread() + + def emit_cleanup(self): + self.api.restore_thread(self.thread_state) + self.argman.emit_cleanup() + + +class PyCallWrapper(object): + def __init__(self, context, module, func, fndesc, env, call_helper, + release_gil): + self.context = context + self.module = module + self.func = func + self.fndesc = fndesc + self.env = env + self.release_gil = release_gil + + def build(self): + wrapname = self.fndesc.llvm_cpython_wrapper_name + + # This is the signature of PyCFunctionWithKeywords + # (see CPython's methodobject.h) + pyobj = self.context.get_argument_type(types.pyobject) + wrapty = llvmlite.ir.FunctionType(pyobj, [pyobj, pyobj, pyobj]) + wrapper = llvmlite.ir.Function(self.module, wrapty, name=wrapname) + + builder = IRBuilder(wrapper.append_basic_block('entry')) + + # - `closure` will receive the `self` pointer stored in the + # PyCFunction object (see _dynfunc.c) + # - `args` and `kws` will receive the tuple and dict objects + # of positional and keyword arguments, respectively. + closure, args, kws = wrapper.args + closure.name = 'py_closure' + args.name = 'py_args' + kws.name = 'py_kws' + + api = self.context.get_python_api(builder) + self.build_wrapper(api, builder, closure, args, kws) + + return wrapper, api + + def build_wrapper(self, api, builder, closure, args, kws): + nargs = len(self.fndesc.argtypes) + + objs = [api.alloca_obj() for _ in range(nargs)] + parseok = api.unpack_tuple(args, self.fndesc.qualname, + nargs, nargs, *objs) + + pred = builder.icmp_unsigned( + '==', + parseok, + Constant(parseok.type, None)) + with cgutils.if_unlikely(builder, pred): + builder.ret(api.get_null_object()) + + # Block that returns after erroneous argument unboxing/cleanup + endblk = builder.append_basic_block("arg.end") + with builder.goto_block(endblk): + builder.ret(api.get_null_object()) + + # Get the Environment object + env_manager = self.get_env(api, builder) + + cleanup_manager = _ArgManager(self.context, builder, api, + env_manager, endblk, nargs) + + # Compute the arguments to the compiled Numba function. + innerargs = [] + for obj, ty in zip(objs, self.fndesc.argtypes): + if isinstance(ty, types.Omitted): + # It's an omitted value => ignore dummy Python object + innerargs.append(None) + else: + val = cleanup_manager.add_arg(builder.load(obj), ty) + innerargs.append(val) + + if self.release_gil: + cleanup_manager = _GilManager(builder, api, cleanup_manager) + + # We elect to not inline the top level user function into the call + # wrapper, this incurs an overhead of a function call, however, it + # increases optimisation stability in that the optimised user function + # is what will actually be run and it is this function that all the + # inspection tools "see". Further, this makes optimisation "stable" in + # that calling the user function from e.g. C or from this wrapper will + # result in the same code executing, were inlining permitted this may + # not be the case as the inline could trigger additional optimisation + # as the function goes into the wrapper, this resulting in the executing + # instruction stream being different from that of the instruction stream + # present in the user function. + status, retval = self.context.call_conv.call_function( + builder, self.func, self.fndesc.restype, self.fndesc.argtypes, + innerargs, attrs=('noinline',)) + # Do clean up + self.debug_print(builder, "# callwrapper: emit_cleanup") + cleanup_manager.emit_cleanup() + self.debug_print(builder, "# callwrapper: emit_cleanup end") + + # Determine return status + with builder.if_then(status.is_ok, likely=True): + # Ok => return boxed Python value + with builder.if_then(status.is_none): + api.return_none() + + retty = self._simplified_return_type() + obj = api.from_native_return(retty, retval, env_manager) + builder.ret(obj) + + # Error out + self.context.call_conv.raise_error(builder, api, status) + builder.ret(api.get_null_object()) + + def get_env(self, api, builder): + """Get the Environment object which is declared as a global + in the module of the wrapped function. + """ + envname = self.context.get_env_name(self.fndesc) + gvptr = self.context.declare_env_global(builder.module, envname) + envptr = builder.load(gvptr) + + env_body = self.context.get_env_body(builder, envptr) + + api.emit_environment_sentry(envptr, return_pyobject=True, + debug_msg=self.fndesc.env_name) + env_manager = api.get_env_manager(self.env, env_body, envptr) + return env_manager + + def _simplified_return_type(self): + """ + The NPM callconv has already converted simplified optional types. + We can simply use the value type from it. + """ + restype = self.fndesc.restype + # Optional type + if isinstance(restype, types.Optional): + return restype.type + else: + return restype + + def debug_print(self, builder, msg): + if config.DEBUG_JIT: + self.context.debug_print(builder, "DEBUGJIT: {0}".format(msg)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/ccallback.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/ccallback.py new file mode 100644 index 0000000000000000000000000000000000000000..b68d0efb5f4831233f56fecfc79af50cc2791064 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/ccallback.py @@ -0,0 +1,135 @@ +""" +Implementation of compiled C callbacks (@cfunc). +""" + + +import ctypes +from functools import cached_property + +from numba.core import compiler, registry +from numba.core.caching import NullCache, FunctionCache +from numba.core.dispatcher import _FunctionCompiler +from numba.core.typing import signature +from numba.core.typing.ctypes_utils import to_ctypes +from numba.core.compiler_lock import global_compiler_lock + + +class _CFuncCompiler(_FunctionCompiler): + + def _customize_flags(self, flags): + flags.no_cpython_wrapper = True + flags.no_cfunc_wrapper = False + # Disable compilation of the IR module, because we first want to + # add the cfunc wrapper. + flags.no_compile = True + # Object mode is not currently supported in C callbacks + # (no reliable way to get the environment) + flags.enable_pyobject = False + if flags.force_pyobject: + raise NotImplementedError("object mode not allowed in C callbacks") + return flags + + +class CFunc(object): + """ + A compiled C callback, as created by the @cfunc decorator. + """ + _targetdescr = registry.cpu_target + + def __init__(self, pyfunc, sig, locals, options, + pipeline_class=compiler.Compiler): + args, return_type = sig + if return_type is None: + raise TypeError("C callback needs an explicit return type") + self.__name__ = pyfunc.__name__ + self.__qualname__ = getattr(pyfunc, '__qualname__', self.__name__) + self.__wrapped__ = pyfunc + + self._pyfunc = pyfunc + self._sig = signature(return_type, *args) + self._compiler = _CFuncCompiler(pyfunc, self._targetdescr, + options, locals, + pipeline_class=pipeline_class) + + self._wrapper_name = None + self._wrapper_address = None + self._cache = NullCache() + self._cache_hits = 0 + + def enable_caching(self): + self._cache = FunctionCache(self._pyfunc) + + @global_compiler_lock + def compile(self): + # Try to load from cache + cres = self._cache.load_overload(self._sig, + self._targetdescr.target_context) + if cres is None: + cres = self._compile_uncached() + self._cache.save_overload(self._sig, cres) + else: + self._cache_hits += 1 + + self._library = cres.library + self._wrapper_name = cres.fndesc.llvm_cfunc_wrapper_name + self._wrapper_address = self._library.get_pointer_to_function( + self._wrapper_name) + + def _compile_uncached(self): + sig = self._sig + + # Compile native function as well as cfunc wrapper + return self._compiler.compile(sig.args, sig.return_type) + + @property + def native_name(self): + """ + The process-wide symbol the C callback is exposed as. + """ + # Note from our point of view, the C callback is the wrapper around + # the native function. + return self._wrapper_name + + @property + def address(self): + """ + The address of the C callback. + """ + return self._wrapper_address + + @cached_property + def cffi(self): + """ + A cffi function pointer representing the C callback. + """ + import cffi + ffi = cffi.FFI() + # cffi compares types by name, so using precise types would risk + # spurious mismatches (such as "int32_t" vs. "int"). + return ffi.cast("void *", self.address) + + @cached_property + def ctypes(self): + """ + A ctypes function object representing the C callback. + """ + ctypes_args = [to_ctypes(ty) for ty in self._sig.args] + ctypes_restype = to_ctypes(self._sig.return_type) + functype = ctypes.CFUNCTYPE(ctypes_restype, *ctypes_args) + return functype(self.address) + + def inspect_llvm(self): + """ + Return the LLVM IR of the C callback definition. + """ + return self._library.get_llvm_str() + + @property + def cache_hits(self): + return self._cache_hits + + def __repr__(self): + return "" % (self.__qualname__,) + + def __call__(self, *args, **kwargs): + return self._pyfunc(*args, **kwargs) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/cgutils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/cgutils.py new file mode 100644 index 0000000000000000000000000000000000000000..04bb3cb5c072b929612ea7856cf4bd12a80c668a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/cgutils.py @@ -0,0 +1,1239 @@ +""" +Generic helpers for LLVM code generation. +""" + + +import collections +from contextlib import contextmanager, ExitStack +import functools + +from llvmlite import ir + +from numba.core import utils, types, config, debuginfo +import numba.core.datamodel + + +bool_t = ir.IntType(1) +int8_t = ir.IntType(8) +int32_t = ir.IntType(32) +intp_t = ir.IntType(utils.MACHINE_BITS) +voidptr_t = int8_t.as_pointer() + +true_bit = bool_t(1) +false_bit = bool_t(0) +true_byte = int8_t(1) +false_byte = int8_t(0) + + +def as_bool_bit(builder, value): + return builder.icmp_unsigned('!=', value, value.type(0)) + + +def make_anonymous_struct(builder, values, struct_type=None): + """ + Create an anonymous struct containing the given LLVM *values*. + """ + if struct_type is None: + struct_type = ir.LiteralStructType([v.type for v in values]) + struct_val = struct_type(ir.Undefined) + for i, v in enumerate(values): + struct_val = builder.insert_value(struct_val, v, i) + return struct_val + + +def make_bytearray(buf): + """ + Make a byte array constant from *buf*. + """ + b = bytearray(buf) + n = len(b) + return ir.Constant(ir.ArrayType(ir.IntType(8), n), b) + + +_struct_proxy_cache = {} + + +def create_struct_proxy(fe_type, kind='value'): + """ + Returns a specialized StructProxy subclass for the given fe_type. + """ + cache_key = (fe_type, kind) + res = _struct_proxy_cache.get(cache_key) + if res is None: + base = {'value': ValueStructProxy, + 'data': DataStructProxy, + }[kind] + clsname = base.__name__ + '_' + str(fe_type) + bases = (base,) + clsmembers = dict(_fe_type=fe_type) + res = type(clsname, bases, clsmembers) + + _struct_proxy_cache[cache_key] = res + return res + + +def copy_struct(dst, src, repl={}): + """ + Copy structure from *src* to *dst* with replacement from *repl*. + """ + repl = repl.copy() + # copy data from src or use those in repl + for k in src._datamodel._fields: + v = repl.pop(k, getattr(src, k)) + setattr(dst, k, v) + # use remaining key-values in repl + for k, v in repl.items(): + setattr(dst, k, v) + return dst + + +class _StructProxy(object): + """ + Creates a `Structure` like interface that is constructed with information + from DataModel instance. FE type must have a data model that is a + subclass of StructModel. + """ + # The following class members must be overridden by subclass + _fe_type = None + + def __init__(self, context, builder, value=None, ref=None): + self._context = context + self._datamodel = self._context.data_model_manager[self._fe_type] + if not isinstance(self._datamodel, numba.core.datamodel.StructModel): + raise TypeError( + "Not a structure model: {0}".format(self._datamodel)) + self._builder = builder + + self._be_type = self._get_be_type(self._datamodel) + assert not is_pointer(self._be_type) + + outer_ref, ref = self._make_refs(ref) + if ref.type.pointee != self._be_type: + raise AssertionError("bad ref type: expected %s, got %s" + % (self._be_type.as_pointer(), ref.type)) + + if value is not None: + if value.type != outer_ref.type.pointee: + raise AssertionError("bad value type: expected %s, got %s" + % (outer_ref.type.pointee, value.type)) + self._builder.store(value, outer_ref) + + self._value = ref + self._outer_ref = outer_ref + + def _make_refs(self, ref): + """ + Return an (outer ref, value ref) pair. By default, these are + the same pointers, but a derived class may override this. + """ + if ref is None: + ref = alloca_once(self._builder, self._be_type, zfill=True) + return ref, ref + + def _get_be_type(self, datamodel): + raise NotImplementedError + + def _cast_member_to_value(self, index, val): + raise NotImplementedError + + def _cast_member_from_value(self, index, val): + raise NotImplementedError + + def _get_ptr_by_index(self, index): + return gep_inbounds(self._builder, self._value, 0, index) + + def _get_ptr_by_name(self, attrname): + index = self._datamodel.get_field_position(attrname) + return self._get_ptr_by_index(index) + + def __getattr__(self, field): + """ + Load the LLVM value of the named *field*. + """ + if not field.startswith('_'): + return self[self._datamodel.get_field_position(field)] + else: + raise AttributeError(field) + + def __setattr__(self, field, value): + """ + Store the LLVM *value* into the named *field*. + """ + if field.startswith('_'): + return super(_StructProxy, self).__setattr__(field, value) + self[self._datamodel.get_field_position(field)] = value + + def __getitem__(self, index): + """ + Load the LLVM value of the field at *index*. + """ + member_val = self._builder.load(self._get_ptr_by_index(index)) + return self._cast_member_to_value(index, member_val) + + def __setitem__(self, index, value): + """ + Store the LLVM *value* into the field at *index*. + """ + ptr = self._get_ptr_by_index(index) + value = self._cast_member_from_value(index, value) + if value.type != ptr.type.pointee: + if (is_pointer(value.type) and is_pointer(ptr.type.pointee) + and value.type.pointee == ptr.type.pointee.pointee): + # Differ by address-space only + # Auto coerce it + value = self._context.addrspacecast(self._builder, + value, + ptr.type.pointee.addrspace) + else: + raise TypeError("Invalid store of {value.type} to " + "{ptr.type.pointee} in " + "{self._datamodel} " + "(trying to write member #{index})" + .format(value=value, ptr=ptr, self=self, + index=index)) + self._builder.store(value, ptr) + + def __len__(self): + """ + Return the number of fields. + """ + return self._datamodel.field_count + + def _getpointer(self): + """ + Return the LLVM pointer to the underlying structure. + """ + return self._outer_ref + + def _getvalue(self): + """ + Load and return the value of the underlying LLVM structure. + """ + return self._builder.load(self._outer_ref) + + def _setvalue(self, value): + """ + Store the value in this structure. + """ + assert not is_pointer(value.type) + assert value.type == self._be_type, (value.type, self._be_type) + self._builder.store(value, self._value) + + +class ValueStructProxy(_StructProxy): + """ + Create a StructProxy suitable for accessing regular values + (e.g. LLVM values or alloca slots). + """ + def _get_be_type(self, datamodel): + return datamodel.get_value_type() + + def _cast_member_to_value(self, index, val): + return val + + def _cast_member_from_value(self, index, val): + return val + + +class DataStructProxy(_StructProxy): + """ + Create a StructProxy suitable for accessing data persisted in memory. + """ + def _get_be_type(self, datamodel): + return datamodel.get_data_type() + + def _cast_member_to_value(self, index, val): + model = self._datamodel.get_model(index) + return model.from_data(self._builder, val) + + def _cast_member_from_value(self, index, val): + model = self._datamodel.get_model(index) + return model.as_data(self._builder, val) + + +class Structure(object): + """ + A high-level object wrapping a alloca'ed LLVM structure, including + named fields and attribute access. + """ + + # XXX Should this warrant several separate constructors? + def __init__(self, context, builder, value=None, ref=None, cast_ref=False): + self._type = context.get_struct_type(self) + self._context = context + self._builder = builder + if ref is None: + self._value = alloca_once(builder, self._type, zfill=True) + if value is not None: + assert not is_pointer(value.type) + assert value.type == self._type, (value.type, self._type) + builder.store(value, self._value) + else: + assert value is None + assert is_pointer(ref.type) + if self._type != ref.type.pointee: + if cast_ref: + ref = builder.bitcast(ref, self._type.as_pointer()) + else: + raise TypeError( + "mismatching pointer type: got %s, expected %s" + % (ref.type.pointee, self._type)) + self._value = ref + + self._namemap = {} + self._fdmap = [] + self._typemap = [] + base = int32_t(0) + for i, (k, tp) in enumerate(self._fields): + self._namemap[k] = i + self._fdmap.append((base, int32_t(i))) + self._typemap.append(tp) + + def _get_ptr_by_index(self, index): + ptr = self._builder.gep(self._value, self._fdmap[index], inbounds=True) + return ptr + + def _get_ptr_by_name(self, attrname): + return self._get_ptr_by_index(self._namemap[attrname]) + + def __getattr__(self, field): + """ + Load the LLVM value of the named *field*. + """ + if not field.startswith('_'): + return self[self._namemap[field]] + else: + raise AttributeError(field) + + def __setattr__(self, field, value): + """ + Store the LLVM *value* into the named *field*. + """ + if field.startswith('_'): + return super(Structure, self).__setattr__(field, value) + self[self._namemap[field]] = value + + def __getitem__(self, index): + """ + Load the LLVM value of the field at *index*. + """ + + return self._builder.load(self._get_ptr_by_index(index)) + + def __setitem__(self, index, value): + """ + Store the LLVM *value* into the field at *index*. + """ + ptr = self._get_ptr_by_index(index) + if ptr.type.pointee != value.type: + fmt = "Type mismatch: __setitem__(%d, ...) expected %r but got %r" + raise AssertionError(fmt % (index, + str(ptr.type.pointee), + str(value.type))) + self._builder.store(value, ptr) + + def __len__(self): + """ + Return the number of fields. + """ + return len(self._namemap) + + def _getpointer(self): + """ + Return the LLVM pointer to the underlying structure. + """ + return self._value + + def _getvalue(self): + """ + Load and return the value of the underlying LLVM structure. + """ + return self._builder.load(self._value) + + def _setvalue(self, value): + """Store the value in this structure""" + assert not is_pointer(value.type) + assert value.type == self._type, (value.type, self._type) + self._builder.store(value, self._value) + + # __iter__ is derived by Python from __len__ and __getitem__ + + +def alloca_once(builder, ty, size=None, name='', zfill=False): + """Allocate stack memory at the entry block of the current function + pointed by ``builder`` with llvm type ``ty``. The optional ``size`` arg + set the number of element to allocate. The default is 1. The optional + ``name`` arg set the symbol name inside the llvm IR for debugging. + If ``zfill`` is set, fill the memory with zeros at the current + use-site location. Note that the memory is always zero-filled after the + ``alloca`` at init-site (the entry block). + """ + if isinstance(size, int): + size = ir.Constant(intp_t, size) + # suspend debug metadata emission else it links up python source lines with + # alloca in the entry block as well as their actual location and it makes + # the debug info "jump about". + with debuginfo.suspend_emission(builder): + with builder.goto_entry_block(): + ptr = builder.alloca(ty, size=size, name=name) + # Always zero-fill at init-site. This is safe. + builder.store(ty(None), ptr) + # Also zero-fill at the use-site + if zfill: + builder.store(ptr.type.pointee(None), ptr) + return ptr + + +def sizeof(builder, ptr_type): + """Compute sizeof using GEP + """ + null = ptr_type(None) + offset = null.gep([int32_t(1)]) + return builder.ptrtoint(offset, intp_t) + + +def alloca_once_value(builder, value, name='', zfill=False): + """ + Like alloca_once(), but passing a *value* instead of a type. The + type is inferred and the allocated slot is also initialized with the + given value. + """ + storage = alloca_once(builder, value.type, zfill=zfill) + builder.store(value, storage) + return storage + + +def insert_pure_function(module, fnty, name): + """ + Insert a pure function (in the functional programming sense) in the + given module. + """ + fn = get_or_insert_function(module, fnty, name) + fn.attributes.add("readonly") + fn.attributes.add("nounwind") + return fn + + +def get_or_insert_function(module, fnty, name): + """ + Get the function named *name* with type *fnty* from *module*, or insert it + if it doesn't exist. + """ + fn = module.globals.get(name, None) + if fn is None: + fn = ir.Function(module, fnty, name) + return fn + + +def get_or_insert_named_metadata(module, name): + try: + return module.get_named_metadata(name) + except KeyError: + return module.add_named_metadata(name) + + +def add_global_variable(module, ty, name, addrspace=0): + unique_name = module.get_unique_name(name) + return ir.GlobalVariable(module, ty, unique_name, addrspace) + + +def terminate(builder, bbend): + bb = builder.basic_block + if bb.terminator is None: + builder.branch(bbend) + + +def get_null_value(ltype): + return ltype(None) + + +def is_null(builder, val): + null = get_null_value(val.type) + return builder.icmp_unsigned('==', null, val) + + +def is_not_null(builder, val): + null = get_null_value(val.type) + return builder.icmp_unsigned('!=', null, val) + + +def if_unlikely(builder, pred): + return builder.if_then(pred, likely=False) + + +def if_likely(builder, pred): + return builder.if_then(pred, likely=True) + + +def ifnot(builder, pred): + return builder.if_then(builder.not_(pred)) + + +def increment_index(builder, val): + """ + Increment an index *val*. + """ + one = val.type(1) + # We pass the "nsw" flag in the hope that LLVM understands the index + # never changes sign. Unfortunately this doesn't always work + # (e.g. ndindex()). + return builder.add(val, one, flags=['nsw']) + + +Loop = collections.namedtuple('Loop', ('index', 'do_break')) + + +@contextmanager +def for_range(builder, count, start=None, intp=None): + """ + Generate LLVM IR for a for-loop in [start, count). + *start* is equal to 0 by default. + + Yields a Loop namedtuple with the following members: + - `index` is the loop index's value + - `do_break` is a no-argument callable to break out of the loop + """ + if intp is None: + intp = count.type + if start is None: + start = intp(0) + stop = count + + bbcond = builder.append_basic_block("for.cond") + bbbody = builder.append_basic_block("for.body") + bbend = builder.append_basic_block("for.end") + + def do_break(): + builder.branch(bbend) + + bbstart = builder.basic_block + builder.branch(bbcond) + + with builder.goto_block(bbcond): + index = builder.phi(intp, name="loop.index") + pred = builder.icmp_signed('<', index, stop) + builder.cbranch(pred, bbbody, bbend) + + with builder.goto_block(bbbody): + yield Loop(index, do_break) + # Update bbbody as a new basic block may have been activated + bbbody = builder.basic_block + incr = increment_index(builder, index) + terminate(builder, bbcond) + + index.add_incoming(start, bbstart) + index.add_incoming(incr, bbbody) + + builder.position_at_end(bbend) + + +@contextmanager +def for_range_slice(builder, start, stop, step, intp=None, inc=True): + """ + Generate LLVM IR for a for-loop based on a slice. Yields a + (index, count) tuple where `index` is the slice index's value + inside the loop, and `count` the iteration count. + + Parameters + ------------- + builder : object + IRBuilder object + start : int + The beginning value of the slice + stop : int + The end value of the slice + step : int + The step value of the slice + intp : + The data type + inc : boolean, optional + Signals whether the step is positive (True) or negative (False). + + Returns + ----------- + None + """ + if intp is None: + intp = start.type + + bbcond = builder.append_basic_block("for.cond") + bbbody = builder.append_basic_block("for.body") + bbend = builder.append_basic_block("for.end") + bbstart = builder.basic_block + builder.branch(bbcond) + + with builder.goto_block(bbcond): + index = builder.phi(intp, name="loop.index") + count = builder.phi(intp, name="loop.count") + if (inc): + pred = builder.icmp_signed('<', index, stop) + else: + pred = builder.icmp_signed('>', index, stop) + builder.cbranch(pred, bbbody, bbend) + + with builder.goto_block(bbbody): + yield index, count + bbbody = builder.basic_block + incr = builder.add(index, step) + next_count = increment_index(builder, count) + terminate(builder, bbcond) + + index.add_incoming(start, bbstart) + index.add_incoming(incr, bbbody) + count.add_incoming(ir.Constant(intp, 0), bbstart) + count.add_incoming(next_count, bbbody) + builder.position_at_end(bbend) + + +@contextmanager +def for_range_slice_generic(builder, start, stop, step): + """ + A helper wrapper for for_range_slice(). This is a context manager which + yields two for_range_slice()-alike context managers, the first for + the positive step case, the second for the negative step case. + + Use: + with for_range_slice_generic(...) as (pos_range, neg_range): + with pos_range as (idx, count): + ... + with neg_range as (idx, count): + ... + """ + intp = start.type + is_pos_step = builder.icmp_signed('>=', step, ir.Constant(intp, 0)) + + pos_for_range = for_range_slice(builder, start, stop, step, intp, inc=True) + neg_for_range = for_range_slice(builder, start, stop, step, intp, inc=False) + + @contextmanager + def cm_cond(cond, inner_cm): + with cond: + with inner_cm as value: + yield value + + with builder.if_else(is_pos_step, likely=True) as (then, otherwise): + yield cm_cond(then, pos_for_range), cm_cond(otherwise, neg_for_range) + + +@contextmanager +def loop_nest(builder, shape, intp, order='C'): + """ + Generate a loop nest walking a N-dimensional array. + Yields a tuple of N indices for use in the inner loop body, + iterating over the *shape* space. + + If *order* is 'C' (the default), indices are incremented inside-out + (i.e. (0,0), (0,1), (0,2), (1,0) etc.). + If *order* is 'F', they are incremented outside-in + (i.e. (0,0), (1,0), (2,0), (0,1) etc.). + This has performance implications when walking an array as it impacts + the spatial locality of memory accesses. + """ + assert order in 'CF' + if not shape: + # 0-d array + yield () + else: + if order == 'F': + _swap = lambda x: x[::-1] + else: + _swap = lambda x: x + with _loop_nest(builder, _swap(shape), intp) as indices: + assert len(indices) == len(shape) + yield _swap(indices) + + +@contextmanager +def _loop_nest(builder, shape, intp): + with for_range(builder, shape[0], intp=intp) as loop: + if len(shape) > 1: + with _loop_nest(builder, shape[1:], intp) as indices: + yield (loop.index,) + indices + else: + yield (loop.index,) + + +def pack_array(builder, values, ty=None): + """ + Pack a sequence of values in a LLVM array. *ty* should be given + if the array may be empty, in which case the type can't be inferred + from the values. + """ + n = len(values) + if ty is None: + ty = values[0].type + ary = ir.ArrayType(ty, n)(ir.Undefined) + for i, v in enumerate(values): + ary = builder.insert_value(ary, v, i) + return ary + + +def pack_struct(builder, values): + """ + Pack a sequence of values into a LLVM struct. + """ + structty = ir.LiteralStructType([v.type for v in values]) + st = structty(ir.Undefined) + for i, v in enumerate(values): + st = builder.insert_value(st, v, i) + return st + + +def unpack_tuple(builder, tup, count=None): + """ + Unpack an array or structure of values, return a Python tuple. + """ + if count is None: + # Assuming *tup* is an aggregate + count = len(tup.type.elements) + vals = [builder.extract_value(tup, i) + for i in range(count)] + return vals + + +def get_item_pointer(context, builder, aryty, ary, inds, wraparound=False, + boundscheck=False): + # Set boundscheck=True for any pointer access that should be + # boundschecked. do_boundscheck() will handle enabling or disabling the + # actual boundschecking based on the user config. + shapes = unpack_tuple(builder, ary.shape, count=aryty.ndim) + strides = unpack_tuple(builder, ary.strides, count=aryty.ndim) + return get_item_pointer2(context, builder, data=ary.data, shape=shapes, + strides=strides, layout=aryty.layout, inds=inds, + wraparound=wraparound, boundscheck=boundscheck) + + +def do_boundscheck(context, builder, ind, dimlen, axis=None): + def _dbg(): + # Remove this when we figure out how to include this information + # in the error message. + if axis is not None: + if isinstance(axis, int): + printf(builder, "debug: IndexError: index %d is out of bounds " + "for axis {} with size %d\n".format(axis), ind, dimlen) + else: + printf(builder, "debug: IndexError: index %d is out of bounds " + "for axis %d with size %d\n", ind, axis, + dimlen) + else: + printf(builder, + "debug: IndexError: index %d is out of bounds for size %d\n", + ind, dimlen) + + msg = "index is out of bounds" + out_of_bounds_upper = builder.icmp_signed('>=', ind, dimlen) + with if_unlikely(builder, out_of_bounds_upper): + if config.FULL_TRACEBACKS: + _dbg() + context.call_conv.return_user_exc(builder, IndexError, (msg,)) + out_of_bounds_lower = builder.icmp_signed('<', ind, ind.type(0)) + with if_unlikely(builder, out_of_bounds_lower): + if config.FULL_TRACEBACKS: + _dbg() + context.call_conv.return_user_exc(builder, IndexError, (msg,)) + + +def get_item_pointer2(context, builder, data, shape, strides, layout, inds, + wraparound=False, boundscheck=False): + # Set boundscheck=True for any pointer access that should be + # boundschecked. do_boundscheck() will handle enabling or disabling the + # actual boundschecking based on the user config. + if wraparound: + # Wraparound + indices = [] + for ind, dimlen in zip(inds, shape): + negative = builder.icmp_signed('<', ind, ind.type(0)) + wrapped = builder.add(dimlen, ind) + selected = builder.select(negative, wrapped, ind) + indices.append(selected) + else: + indices = inds + if boundscheck: + for axis, (ind, dimlen) in enumerate(zip(indices, shape)): + do_boundscheck(context, builder, ind, dimlen, axis) + + if not indices: + # Indexing with empty tuple + return builder.gep(data, [int32_t(0)]) + intp = indices[0].type + # Indexing code + if layout in 'CF': + steps = [] + # Compute steps for each dimension + if layout == 'C': + # C contiguous + for i in range(len(shape)): + last = intp(1) + for j in shape[i + 1:]: + last = builder.mul(last, j) + steps.append(last) + elif layout == 'F': + # F contiguous + for i in range(len(shape)): + last = intp(1) + for j in shape[:i]: + last = builder.mul(last, j) + steps.append(last) + else: + raise Exception("unreachable") + + # Compute index + loc = intp(0) + for i, s in zip(indices, steps): + tmp = builder.mul(i, s) + loc = builder.add(loc, tmp) + ptr = builder.gep(data, [loc]) + return ptr + else: + # Any layout + dimoffs = [builder.mul(s, i) for s, i in zip(strides, indices)] + offset = functools.reduce(builder.add, dimoffs) + return pointer_add(builder, data, offset) + + +def _scalar_pred_against_zero(builder, value, fpred, icond): + nullval = value.type(0) + if isinstance(value.type, (ir.FloatType, ir.DoubleType)): + isnull = fpred(value, nullval) + elif isinstance(value.type, ir.IntType): + isnull = builder.icmp_signed(icond, value, nullval) + else: + raise TypeError("unexpected value type %s" % (value.type,)) + return isnull + + +def is_scalar_zero(builder, value): + """ + Return a predicate representing whether *value* is equal to zero. + """ + return _scalar_pred_against_zero( + builder, value, functools.partial(builder.fcmp_ordered, '=='), '==') + + +def is_not_scalar_zero(builder, value): + """ + Return a predicate representing whether a *value* is not equal to zero. + (not exactly "not is_scalar_zero" because of nans) + """ + return _scalar_pred_against_zero( + builder, value, functools.partial(builder.fcmp_unordered, '!='), '!=') + + +def is_scalar_zero_or_nan(builder, value): + """ + Return a predicate representing whether *value* is equal to either zero + or NaN. + """ + return _scalar_pred_against_zero( + builder, value, functools.partial(builder.fcmp_unordered, '=='), '==') + + +is_true = is_not_scalar_zero +is_false = is_scalar_zero + + +def is_scalar_neg(builder, value): + """ + Is *value* negative? Assumes *value* is signed. + """ + return _scalar_pred_against_zero( + builder, value, functools.partial(builder.fcmp_ordered, '<'), '<') + + +@contextmanager +def early_exit_if(builder, stack: ExitStack, cond): + """ + The Python code:: + + with contextlib.ExitStack() as stack: + with early_exit_if(builder, stack, cond): + cleanup() + body() + + emits the code:: + + if (cond) { + + } + else { + + } + + This can be useful for generating code with lots of early exits, without + having to increase the indentation each time. + """ + then, otherwise = stack.enter_context(builder.if_else(cond, likely=False)) + with then: + yield + stack.enter_context(otherwise) + + +def early_exit_if_null(builder, stack, obj): + """ + A convenience wrapper for :func:`early_exit_if`, for the common case where + the CPython API indicates an error by returning ``NULL``. + """ + return early_exit_if(builder, stack, is_null(builder, obj)) + + +def guard_null(context, builder, value, exc_tuple): + """ + Guard against *value* being null or zero. + *exc_tuple* should be a (exception type, arguments...) tuple. + """ + with builder.if_then(is_scalar_zero(builder, value), likely=False): + exc = exc_tuple[0] + exc_args = exc_tuple[1:] or None + context.call_conv.return_user_exc(builder, exc, exc_args) + + +def guard_memory_error(context, builder, pointer, msg=None): + """ + Guard against *pointer* being NULL (and raise a MemoryError). + """ + assert isinstance(pointer.type, ir.PointerType), pointer.type + exc_args = (msg,) if msg else () + with builder.if_then(is_null(builder, pointer), likely=False): + context.call_conv.return_user_exc(builder, MemoryError, exc_args) + + +@contextmanager +def if_zero(builder, value, likely=False): + """ + Execute the given block if the scalar value is zero. + """ + with builder.if_then(is_scalar_zero(builder, value), likely=likely): + yield + + +guard_zero = guard_null + + +def is_pointer(ltyp): + """ + Whether the LLVM type *typ* is a struct type. + """ + return isinstance(ltyp, ir.PointerType) + + +def get_record_member(builder, record, offset, typ): + pval = gep_inbounds(builder, record, 0, offset) + assert not is_pointer(pval.type.pointee) + return builder.bitcast(pval, typ.as_pointer()) + + +def is_neg_int(builder, val): + return builder.icmp_signed('<', val, val.type(0)) + + +def gep_inbounds(builder, ptr, *inds, **kws): + """ + Same as *gep*, but add the `inbounds` keyword. + """ + return gep(builder, ptr, *inds, inbounds=True, **kws) + + +def gep(builder, ptr, *inds, **kws): + """ + Emit a getelementptr instruction for the given pointer and indices. + The indices can be LLVM values or Python int constants. + """ + name = kws.pop('name', '') + inbounds = kws.pop('inbounds', False) + assert not kws + idx = [] + for i in inds: + if isinstance(i, int): + # NOTE: llvm only accepts int32 inside structs, not int64 + ind = int32_t(i) + else: + ind = i + idx.append(ind) + return builder.gep(ptr, idx, name=name, inbounds=inbounds) + + +def pointer_add(builder, ptr, offset, return_type=None): + """ + Add an integral *offset* to pointer *ptr*, and return a pointer + of *return_type* (or, if omitted, the same type as *ptr*). + + Note the computation is done in bytes, and ignores the width of + the pointed item type. + """ + intptr = builder.ptrtoint(ptr, intp_t) + if isinstance(offset, int): + offset = intp_t(offset) + intptr = builder.add(intptr, offset) + return builder.inttoptr(intptr, return_type or ptr.type) + + +def memset(builder, ptr, size, value): + """ + Fill *size* bytes starting from *ptr* with *value*. + """ + fn = builder.module.declare_intrinsic('llvm.memset', (voidptr_t, size.type)) + ptr = builder.bitcast(ptr, voidptr_t) + if isinstance(value, int): + value = int8_t(value) + builder.call(fn, [ptr, value, size, bool_t(0)]) + + +def memset_padding(builder, ptr): + """ + Fill padding bytes of the pointee with zeros. + """ + # Load existing value + val = builder.load(ptr) + # Fill pointee with zeros + memset(builder, ptr, sizeof(builder, ptr.type), 0) + # Store value back + builder.store(val, ptr) + + +def global_constant(builder_or_module, name, value, linkage='internal'): + """ + Get or create a (LLVM module-)global constant with *name* or *value*. + """ + if isinstance(builder_or_module, ir.Module): + module = builder_or_module + else: + module = builder_or_module.module + data = add_global_variable(module, value.type, name) + data.linkage = linkage + data.global_constant = True + data.initializer = value + return data + + +def divmod_by_constant(builder, val, divisor): + """ + Compute the (quotient, remainder) of *val* divided by the constant + positive *divisor*. The semantics reflects those of Python integer + floor division, rather than C's / LLVM's signed division and modulo. + The difference lies with a negative *val*. + """ + assert divisor > 0 + divisor = val.type(divisor) + one = val.type(1) + + quot = alloca_once(builder, val.type) + + with builder.if_else(is_neg_int(builder, val)) as (if_neg, if_pos): + with if_pos: + # quot = val / divisor + quot_val = builder.sdiv(val, divisor) + builder.store(quot_val, quot) + with if_neg: + # quot = -1 + (val + 1) / divisor + val_plus_one = builder.add(val, one) + quot_val = builder.sdiv(val_plus_one, divisor) + builder.store(builder.sub(quot_val, one), quot) + + # rem = val - quot * divisor + # (should be slightly faster than a separate modulo operation) + quot_val = builder.load(quot) + rem_val = builder.sub(val, builder.mul(quot_val, divisor)) + return quot_val, rem_val + + +def cbranch_or_continue(builder, cond, bbtrue): + """ + Branch conditionally or continue. + + Note: a new block is created and builder is moved to the end of the new + block. + """ + bbcont = builder.append_basic_block('.continue') + builder.cbranch(cond, bbtrue, bbcont) + builder.position_at_end(bbcont) + return bbcont + + +def memcpy(builder, dst, src, count): + """ + Emit a memcpy to the builder. + + Copies each element of dst to src. Unlike the C equivalent, each element + can be any LLVM type. + + Assumes + ------- + * dst.type == src.type + * count is positive + """ + # Note this does seem to be optimized as a raw memcpy() by LLVM + # whenever possible... + assert dst.type == src.type + with for_range(builder, count, intp=count.type) as loop: + out_ptr = builder.gep(dst, [loop.index]) + in_ptr = builder.gep(src, [loop.index]) + builder.store(builder.load(in_ptr), out_ptr) + + +def _raw_memcpy(builder, func_name, dst, src, count, itemsize, align): + size_t = count.type + if isinstance(itemsize, int): + itemsize = ir.Constant(size_t, itemsize) + + memcpy = builder.module.declare_intrinsic(func_name, + [voidptr_t, voidptr_t, size_t]) + is_volatile = false_bit + builder.call(memcpy, [builder.bitcast(dst, voidptr_t), + builder.bitcast(src, voidptr_t), + builder.mul(count, itemsize), + is_volatile]) + + +def raw_memcpy(builder, dst, src, count, itemsize, align=1): + """ + Emit a raw memcpy() call for `count` items of size `itemsize` + from `src` to `dest`. + """ + return _raw_memcpy(builder, 'llvm.memcpy', dst, src, count, itemsize, align) + + +def raw_memmove(builder, dst, src, count, itemsize, align=1): + """ + Emit a raw memmove() call for `count` items of size `itemsize` + from `src` to `dest`. + """ + return _raw_memcpy(builder, 'llvm.memmove', dst, src, count, + itemsize, align) + + +def muladd_with_overflow(builder, a, b, c): + """ + Compute (a * b + c) and return a (result, overflow bit) pair. + The operands must be signed integers. + """ + p = builder.smul_with_overflow(a, b) + prod = builder.extract_value(p, 0) + prod_ovf = builder.extract_value(p, 1) + s = builder.sadd_with_overflow(prod, c) + res = builder.extract_value(s, 0) + ovf = builder.or_(prod_ovf, builder.extract_value(s, 1)) + return res, ovf + + +def printf(builder, format, *args): + """ + Calls printf(). + Argument `format` is expected to be a Python string. + Values to be printed are listed in `args`. + + Note: There is no checking to ensure there is correct number of values + in `args` and there type matches the declaration in the format string. + """ + assert isinstance(format, str) + mod = builder.module + # Make global constant for format string + cstring = voidptr_t + fmt_bytes = make_bytearray((format + '\00').encode('ascii')) + global_fmt = global_constant(mod, "printf_format", fmt_bytes) + fnty = ir.FunctionType(int32_t, [cstring], var_arg=True) + # Insert printf() + try: + fn = mod.get_global('printf') + except KeyError: + fn = ir.Function(mod, fnty, name="printf") + # Call + ptr_fmt = builder.bitcast(global_fmt, cstring) + return builder.call(fn, [ptr_fmt] + list(args)) + + +def snprintf(builder, buffer, bufsz, format, *args): + """Calls libc snprintf(buffer, bufsz, format, ...args) + """ + assert isinstance(format, str) + mod = builder.module + # Make global constant for format string + cstring = voidptr_t + fmt_bytes = make_bytearray((format + '\00').encode('ascii')) + global_fmt = global_constant(mod, "snprintf_format", fmt_bytes) + fnty = ir.FunctionType( + int32_t, [cstring, intp_t, cstring], var_arg=True, + ) + # Actual symbol name of snprintf is different on win32. + symbol = 'snprintf' + if config.IS_WIN32: + symbol = '_' + symbol + # Insert snprintf() + try: + fn = mod.get_global(symbol) + except KeyError: + fn = ir.Function(mod, fnty, name=symbol) + # Call + ptr_fmt = builder.bitcast(global_fmt, cstring) + return builder.call(fn, [buffer, bufsz, ptr_fmt] + list(args)) + + +def snprintf_stackbuffer(builder, bufsz, format, *args): + """Similar to `snprintf()` but the buffer is stack allocated to size + *bufsz*. + + Returns the buffer pointer as i8*. + """ + assert isinstance(bufsz, int) + spacety = ir.ArrayType(ir.IntType(8), bufsz) + space = alloca_once(builder, spacety, zfill=True) + buffer = builder.bitcast(space, voidptr_t) + snprintf(builder, buffer, intp_t(bufsz), format, *args) + return buffer + + +def normalize_ir_text(text): + """ + Normalize the given string to latin1 compatible encoding that is + suitable for use in LLVM IR. + """ + # Just re-encoding to latin1 is enough + return text.encode('utf8').decode('latin1') + + +def hexdump(builder, ptr, nbytes): + """Debug print the memory region in *ptr* to *ptr + nbytes* + as hex. + """ + bytes_per_line = 16 + nbytes = builder.zext(nbytes, intp_t) + printf(builder, "hexdump p=%p n=%zu", + ptr, nbytes) + byte_t = ir.IntType(8) + ptr = builder.bitcast(ptr, byte_t.as_pointer()) + # Loop to print the bytes in *ptr* as hex + with for_range(builder, nbytes) as idx: + div_by = builder.urem(idx.index, intp_t(bytes_per_line)) + do_new_line = builder.icmp_unsigned("==", div_by, intp_t(0)) + with builder.if_then(do_new_line): + printf(builder, "\n") + + offset = builder.gep(ptr, [idx.index]) + val = builder.load(offset) + printf(builder, " %02x", val) + printf(builder, "\n") + + +def is_nonelike(ty): + """ returns if 'ty' is none """ + return ( + ty is None or + isinstance(ty, types.NoneType) or + isinstance(ty, types.Omitted) + ) + + +def is_empty_tuple(ty): + """ returns if 'ty' is an empty tuple """ + return ( + isinstance(ty, types.Tuple) and + len(ty.types) == 0 + ) + + +def create_constant_array(ty, val): + """ + Create an LLVM-constant of a fixed-length array from Python values. + + The type provided is the type of the elements. + """ + return ir.Constant(ir.ArrayType(ty, len(val)), val) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/codegen.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/codegen.py new file mode 100644 index 0000000000000000000000000000000000000000..1fe953fbb94a7ee20ccf03fdd89643375f04b0eb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/codegen.py @@ -0,0 +1,1457 @@ +import warnings +import functools +import locale +import weakref +import ctypes +import html +import textwrap + +import llvmlite.binding as ll +import llvmlite.ir as llvmir + +from abc import abstractmethod, ABCMeta +from numba.core import utils, config, cgutils +from numba.core.llvm_bindings import create_pass_manager_builder +from numba.core.runtime.nrtopt import remove_redundant_nrt_refct +from numba.core.runtime import rtsys +from numba.core.compiler_lock import require_global_compiler_lock +from numba.core.errors import NumbaInvalidConfigWarning +from numba.misc.inspection import disassemble_elf_to_cfg +from numba.misc.llvm_pass_timings import PassTimingsCollection + + +_x86arch = frozenset(['x86', 'i386', 'i486', 'i586', 'i686', 'i786', + 'i886', 'i986']) + + +def _is_x86(triple): + arch = triple.split('-')[0] + return arch in _x86arch + + +def _parse_refprune_flags(): + """Parse refprune flags from the `config`. + + Invalid values are ignored an warn via a `NumbaInvalidConfigWarning` + category. + + Returns + ------- + flags : llvmlite.binding.RefPruneSubpasses + """ + flags = config.LLVM_REFPRUNE_FLAGS.split(',') + if not flags: + return 0 + val = 0 + for item in flags: + item = item.strip() + try: + val |= getattr(ll.RefPruneSubpasses, item.upper()) + except AttributeError: + warnings.warn(f"invalid refprune flags {item!r}", + NumbaInvalidConfigWarning) + return val + + +def dump(header, body, lang): + if config.HIGHLIGHT_DUMPS: + try: + import pygments + except ImportError: + msg = "Please install pygments to see highlighted dumps" + raise ValueError(msg) + else: + from pygments import highlight + from pygments.lexers import GasLexer as gas_lexer + from pygments.lexers import LlvmLexer as llvm_lexer + from pygments.formatters import Terminal256Formatter + from numba.misc.dump_style import by_colorscheme + + lexer_map = {'llvm': llvm_lexer, 'asm': gas_lexer} + lexer = lexer_map[lang] + def printer(arg): + print(highlight(arg, lexer(), + Terminal256Formatter(style=by_colorscheme()))) + else: + printer = print + print('=' * 80) + print(header.center(80, '-')) + printer(body) + print('=' * 80) + + +class _CFG(object): + """ + Wraps the CFG graph for different display method. + + Instance of the class can be stringified (``__repr__`` is defined) to get + the graph in DOT format. The ``.display()`` method plots the graph in + PDF. If in IPython notebook, the returned image can be inlined. + """ + def __init__(self, cres, name, py_func, **kwargs): + self.cres = cres + self.name = name + self.py_func = py_func + fn = cres.get_function(name) + self.dot = ll.get_function_cfg(fn) + self.kwargs = kwargs + + def pretty_printer(self, filename=None, view=None, render_format=None, + highlight=True, + interleave=False, strip_ir=False, show_key=True, + fontsize=10): + """ + "Pretty" prints the DOT graph of the CFG. + For explanation of the parameters see the docstring for + numba.core.dispatcher::inspect_cfg. + """ + import graphviz as gv + import re + import json + import inspect + from llvmlite import binding as ll + from numba.typed import List + from types import SimpleNamespace + from collections import defaultdict + + _default = False + _highlight = SimpleNamespace(incref=_default, + decref=_default, + returns=_default, + raises=_default, + meminfo=_default, + branches=_default, + llvm_intrin_calls=_default, + function_calls=_default,) + _interleave = SimpleNamespace(python=_default, lineinfo=_default) + + def parse_config(_config, kwarg): + """ Parses the kwarg into a consistent format for use in configuring + the Digraph rendering. _config is the configuration instance to + update, kwarg is the kwarg on which to base the updates. + """ + if isinstance(kwarg, bool): + for attr in _config.__dict__: + setattr(_config, attr, kwarg) + elif isinstance(kwarg, dict): + for k, v in kwarg.items(): + if k not in _config.__dict__: + raise ValueError("Unexpected key in kwarg: %s" % k) + if isinstance(v, bool): + setattr(_config, k, v) + else: + msg = "Unexpected value for key: %s, got:%s" + raise ValueError(msg % (k, v)) + elif isinstance(kwarg, set): + for item in kwarg: + if item not in _config.__dict__: + raise ValueError("Unexpected key in kwarg: %s" % item) + else: + setattr(_config, item, True) + else: + msg = "Unhandled configuration type for kwarg %s" + raise ValueError(msg % type(kwarg)) + + parse_config(_highlight, highlight) + parse_config(_interleave, interleave) + + # This is the colour scheme. The graphviz HTML label renderer only takes + # names for colours: https://www.graphviz.org/doc/info/shapes.html#html + cs = defaultdict(lambda: 'white') # default bg colour is white + cs['marker'] = 'orange' + cs['python'] = 'yellow' + cs['truebr'] = 'green' + cs['falsebr'] = 'red' + cs['incref'] = 'cyan' + cs['decref'] = 'turquoise' + cs['raise'] = 'lightpink' + cs['meminfo'] = 'lightseagreen' + cs['return'] = 'purple' + cs['llvm_intrin_calls'] = 'rosybrown' + cs['function_calls'] = 'tomato' + + # Get the raw dot format information from LLVM and the LLVM IR + fn = self.cres.get_function(self.name) + #raw_dot = ll.get_function_cfg(fn).replace('\\l...', '') + llvm_str = self.cres.get_llvm_str() + + def get_metadata(llvm_str): + """ Gets the metadata entries from the LLVM IR, these look something + like '!123 = INFORMATION'. Returns a map of metadata key to metadata + value, i.e. from the example {'!123': INFORMATION}""" + md = {} + metadata_entry = re.compile(r'(^[!][0-9]+)(\s+=\s+.*)') + for x in llvm_str.splitlines(): + match = metadata_entry.match(x) + if match is not None: + g = match.groups() + if g is not None: + assert len(g) == 2 + md[g[0]] = g[1] + return md + + md = get_metadata(llvm_str) + + # setup digraph with initial properties + def init_digraph(name, fname, fontsize): + # name and fname are arbitrary graph and file names, they appear in + # some rendering formats, the fontsize determines the output + # fontsize. + + # truncate massive mangled names as file names as it causes OSError + # when trying to render to pdf + cmax = 200 + if len(fname) > cmax: + wstr = (f'CFG output filename "{fname}" exceeds maximum ' + f'supported length, it will be truncated.') + warnings.warn(wstr, NumbaInvalidConfigWarning) + fname = fname[:cmax] + f = gv.Digraph(name, filename=fname) + f.attr(rankdir='TB') + f.attr('node', shape='none', fontsize='%s' % str(fontsize)) + return f + + f = init_digraph(self.name, self.name, fontsize) + + # A lot of regex is needed to parse the raw dot output. This output + # contains a mix of LLVM IR in the labels, and also DOT markup. + + # DOT syntax, matches a "port" (where the tail of an edge starts) + port_match = re.compile('.*{(.*)}.*') + # DOT syntax, matches the "port" value from a found "port_match" + port_jmp_match = re.compile('.*<(.*)>(.*)') + # LLVM syntax, matches a LLVM debug marker + metadata_marker = re.compile(r'.*!dbg\s+(![0-9]+).*') + # LLVM syntax, matches a location entry + location_expr = (r'.*!DILocation\(line:\s+([0-9]+),' + r'\s+column:\s+([0-9]),.*') + location_entry = re.compile(location_expr) + # LLVM syntax, matches LLVMs internal debug value calls + dbg_value = re.compile(r'.*call void @llvm.dbg.value.*') + # LLVM syntax, matches tokens for highlighting + nrt_incref = re.compile(r"@NRT_incref\b") + nrt_decref = re.compile(r"@NRT_decref\b") + nrt_meminfo = re.compile("@NRT_MemInfo") + ll_intrin_calls = re.compile(r".*call.*@llvm\..*") + ll_function_call = re.compile(r".*call.*@.*") + ll_raise = re.compile(r"store .*\!numba_exception_output.*") + ll_return = re.compile("ret i32 [^1],?.*") + + # wrapper function for line wrapping LLVM lines + def wrap(s): + return textwrap.wrap(s, width=120, subsequent_indent='... ') + + # function to fix (sometimes escaped for DOT!) LLVM IR etc that needs to + # be HTML escaped + def clean(s): + # Grab first 300 chars only, 1. this should be enough to identify + # the token and it keeps names short. 2. graphviz/dot has a maximum + # buffer size near 585?!, with additional transforms it's hard to + # know if this would be exceeded. 3. hash of the token string is + # written into the rendering to permit exact identification against + # e.g. LLVM IR dump if necessary. + n = 300 + if len(s) > n: + hs = str(hash(s)) + s = '{}...'.format(s[:n], hs) + s = html.escape(s) # deals with &, < and > + s = s.replace('\\{', "{") + s = s.replace('\\}', "}") + s = s.replace('\\', "\") + s = s.replace('%', "%") + s = s.replace('!', "!") + return s + + # These hold the node and edge ids from the raw dot information. They + # are used later to wire up a new DiGraph that has the same structure + # as the raw dot but with new nodes. + node_ids = {} + edge_ids = {} + + # Python source lines, used if python source interleave is requested + if _interleave.python: + src_code, firstlineno = inspect.getsourcelines(self.py_func) + + # This is the dot info from LLVM, it's in DOT form and has continuation + # lines, strip them and then re-parse into `dot_json` form for use in + # producing a formatted output. + raw_dot = ll.get_function_cfg(fn).replace('\\l...', '') + json_bytes = gv.Source(raw_dot).pipe(format='dot_json') + jzon = json.loads(json_bytes.decode('utf-8')) + + idc = 0 + # Walk the "objects" (nodes) in the DOT output + for obj in jzon['objects']: + # These are used to keep tabs on the current line and column numbers + # as per the markers. They are tracked so as to make sure a marker + # is only emitted if there's a change in the marker. + cur_line, cur_col = -1, -1 + label = obj['label'] + name = obj['name'] + gvid = obj['_gvid'] + node_ids[gvid] = name + # Label is DOT format, it needs the head and tail removing and then + # splitting for walking. + label = label[1:-1] + lines = label.split('\\l') + + # Holds the new lines + new_lines = [] + + # Aim is to produce an HTML table a bit like this: + # + # |------------| + # | HEADER | <-- this is the block header + # |------------| + # | LLVM SRC | <-- + # | Marker? | < this is the label/block body + # | Python src?| <-- + # |------------| + # | T | F | <-- this is the "ports", also determines col_span + # -------------- + # + + # This is HTML syntax, its the column span. If there's a switch or a + # branch at the bottom of the node this is rendered as multiple + # columns in a table. First job is to go and render that and work + # out how many columns are needed as that dictates how many columns + # the rest of the source lines must span. In DOT syntax the places + # that edges join nodes are referred to as "ports". Syntax in DOT + # is like `node:port`. + col_span = 1 + + # First see if there is a port entry for this node + port_line = '' + matched = port_match.match(lines[-1]) + sliced_lines = lines + if matched is not None: + # There is a port + ports = matched.groups()[0] + ports_tokens = ports.split('|') + col_span = len(ports_tokens) + # Generate HTML table data cells, one for each port. If the + # ports correspond to a branch then they can optionally + # highlighted based on T/F. + tdfmt = ('{}') + tbl_data = [] + if _highlight.branches: + colors = {'T': cs['truebr'], 'F': cs['falsebr']} + else: + colors = {} + for tok in ports_tokens: + target, value = port_jmp_match.match(tok).groups() + color = colors.get(value, 'white') + tbl_data.append(tdfmt.format(color, target, value)) + port_line = ''.join(tbl_data) + # Drop the last line from the rest of the parse as it's the port + # and just been dealt with. + sliced_lines = lines[:-1] + + # loop peel the block header, it needs a HTML border + fmtheader = ('{}') + new_lines.append(fmtheader.format(cs['default'], col_span, + clean(sliced_lines[0].strip()))) + + # process rest of block creating the table row at a time. + fmt = ('{}') + + def metadata_interleave(l, new_lines): + """ + Search line `l` for metadata associated with python or line info + and inject it into `new_lines` if requested. + """ + matched = metadata_marker.match(l) + if matched is not None: + # there's a metadata marker + g = matched.groups() + if g is not None: + assert len(g) == 1, g + marker = g[0] + debug_data = md.get(marker, None) + if debug_data is not None: + # and the metadata marker has a corresponding piece + # of metadata + ld = location_entry.match(debug_data) + if ld is not None: + # and the metadata is line info... proceed + assert len(ld.groups()) == 2, ld + line, col = ld.groups() + # only emit a new marker if the line number in + # the metadata is "new". + if line != cur_line or col != cur_col: + if _interleave.lineinfo: + mfmt = 'Marker %s, Line %s, column %s' + mark_line = mfmt % (marker, line, col) + ln = fmt.format(cs['marker'], col_span, + clean(mark_line)) + new_lines.append(ln) + if _interleave.python: + # TODO: + # +1 for decorator, this probably needs + # the same thing doing as for the + # error messages where the decorator + # is scanned for, its not always +1! + lidx = int(line) - (firstlineno + 1) + source_line = src_code[lidx + 1] + ln = fmt.format(cs['python'], col_span, + clean(source_line)) + new_lines.append(ln) + return line, col + + for l in sliced_lines[1:]: + + # Drop LLVM debug call entries + if dbg_value.match(l): + continue + + # if requested generate interleaving of markers or python from + # metadata + if _interleave.lineinfo or _interleave.python: + updated_lineinfo = metadata_interleave(l, new_lines) + if updated_lineinfo is not None: + cur_line, cur_col = updated_lineinfo + + # Highlight other LLVM features if requested, HTML BGCOLOR + # property is set by this. + if _highlight.incref and nrt_incref.search(l): + colour = cs['incref'] + elif _highlight.decref and nrt_decref.search(l): + colour = cs['decref'] + elif _highlight.meminfo and nrt_meminfo.search(l): + colour = cs['meminfo'] + elif _highlight.raises and ll_raise.search(l): + # search for raise as its more specific than exit + colour = cs['raise'] + elif _highlight.returns and ll_return.search(l): + colour = cs['return'] + elif _highlight.llvm_intrin_calls and ll_intrin_calls.search(l): + colour = cs['llvm_intrin_calls'] + elif _highlight.function_calls and ll_function_call.search(l): + colour = cs['function_calls'] + else: + colour = cs['default'] + + # Use the default coloring as a flag to force printing if a + # special token print was requested AND LLVM ir stripping is + # required + if colour is not cs['default'] or not strip_ir: + for x in wrap(clean(l)): + new_lines.append(fmt.format(colour, col_span, x)) + + # add in the port line at the end of the block if it was present + # (this was built right at the top of the parse) + if port_line: + new_lines.append('{}'.format(port_line)) + + # If there was data, create a table, else don't! + dat = ''.join(new_lines) + if dat: + tab = (('%s
') % (idc, + dat)) + label = '<{}>'.format(tab) + else: + label = '' + + # finally, add a replacement node for the original with a new marked + # up label. + f.node(name, label=label) + + # Parse the edge data + if 'edges' in jzon: # might be a single block, no edges + for edge in jzon['edges']: + gvid = edge['_gvid'] + tp = edge.get('tailport', None) + edge_ids[gvid] = (edge['head'], edge['tail'], tp) + + # Write in the edge wiring with respect to the new nodes:ports. + for gvid, edge in edge_ids.items(): + tail = node_ids[edge[1]] + head = node_ids[edge[0]] + port = edge[2] + if port is not None: + tail += ':%s' % port + f.edge(tail, head) + + # Add a key to the graph if requested. + if show_key: + key_tab = [] + for k, v in cs.items(): + key_tab.append(('{}').format(v, k)) + # The first < and last > are DOT syntax, rest is DOT HTML. + f.node("Key", label=('<{}
' + 'Key:
>').format(''.join(key_tab))) + + # Render if required + if filename is not None or view is not None: + f.render(filename=filename, view=view, format=render_format) + + # Else pipe out a SVG + return f.pipe(format='svg') + + def display(self, filename=None, format='pdf', view=False): + """ + Plot the CFG. In IPython notebook, the return image object can be + inlined. + + The *filename* option can be set to a specific path for the rendered + output to write to. If *view* option is True, the plot is opened by + the system default application for the image format (PDF). *format* can + be any valid format string accepted by graphviz, default is 'pdf'. + """ + rawbyt = self.pretty_printer(filename=filename, view=view, + render_format=format, **self.kwargs) + return rawbyt.decode('utf-8') + + def _repr_svg_(self): + return self.pretty_printer(**self.kwargs).decode('utf-8') + + def __repr__(self): + return self.dot + + +class CodeLibrary(metaclass=ABCMeta): + """ + An interface for bundling LLVM code together and compiling it. + It is tied to a *codegen* instance (e.g. JITCPUCodegen) that will + determine how the LLVM code is transformed and linked together. + """ + + _finalized = False + _object_caching_enabled = False + _disable_inspection = False + + def __init__(self, codegen: "CPUCodegen", name: str): + self._codegen = codegen + self._name = name + ptc_name = f"{self.__class__.__name__}({self._name!r})" + self._recorded_timings = PassTimingsCollection(ptc_name) + # Track names of the dynamic globals + self._dynamic_globals = [] + + @property + def has_dynamic_globals(self): + self._ensure_finalized() + return len(self._dynamic_globals) > 0 + + @property + def recorded_timings(self): + return self._recorded_timings + + @property + def codegen(self): + """ + The codegen object owning this library. + """ + return self._codegen + + @property + def name(self): + return self._name + + def __repr__(self): + return "" % (self.name, id(self)) + + def _raise_if_finalized(self): + if self._finalized: + raise RuntimeError("operation impossible on finalized object %r" + % (self,)) + + def _ensure_finalized(self): + if not self._finalized: + self.finalize() + + def create_ir_module(self, name): + """ + Create an LLVM IR module for use by this library. + """ + self._raise_if_finalized() + ir_module = self._codegen._create_empty_module(name) + return ir_module + + @abstractmethod + def add_linking_library(self, library): + """ + Add a library for linking into this library, without losing + the original library. + """ + + @abstractmethod + def add_ir_module(self, ir_module): + """ + Add an LLVM IR module's contents to this library. + """ + + @abstractmethod + def finalize(self): + """ + Finalize the library. After this call, nothing can be added anymore. + Finalization involves various stages of code optimization and + linking. + """ + + @abstractmethod + def get_function(self, name): + """ + Return the function named ``name``. + """ + + @abstractmethod + def get_llvm_str(self): + """ + Get the human-readable form of the LLVM module. + """ + + @abstractmethod + def get_asm_str(self): + """ + Get the human-readable assembly. + """ + + # + # Object cache hooks and serialization + # + + def enable_object_caching(self): + self._object_caching_enabled = True + self._compiled_object = None + self._compiled = False + + def _get_compiled_object(self): + if not self._object_caching_enabled: + raise ValueError("object caching not enabled in %s" % (self,)) + if self._compiled_object is None: + raise RuntimeError("no compiled object yet for %s" % (self,)) + return self._compiled_object + + def _set_compiled_object(self, value): + if not self._object_caching_enabled: + raise ValueError("object caching not enabled in %s" % (self,)) + if self._compiled: + raise ValueError("library already compiled: %s" % (self,)) + self._compiled_object = value + self._disable_inspection = True + + +class CPUCodeLibrary(CodeLibrary): + + def __init__(self, codegen, name): + super().__init__(codegen, name) + self._linking_libraries = [] # maintain insertion order + self._final_module = ll.parse_assembly( + str(self._codegen._create_empty_module(self.name))) + self._final_module.name = cgutils.normalize_ir_text(self.name) + self._shared_module = None + + def _optimize_functions(self, ll_module): + """ + Internal: run function-level optimizations inside *ll_module*. + """ + # Enforce data layout to enable layout-specific optimizations + ll_module.data_layout = self._codegen._data_layout + with self._codegen._function_pass_manager(ll_module) as fpm: + # Run function-level optimizations to reduce memory usage and improve + # module-level optimization. + for func in ll_module.functions: + k = f"Function passes on {func.name!r}" + with self._recorded_timings.record(k): + fpm.initialize() + fpm.run(func) + fpm.finalize() + + def _optimize_final_module(self): + """ + Internal: optimize this library's final module. + """ + + mpm_cheap = self._codegen._module_pass_manager(loop_vectorize=self._codegen._loopvect, + slp_vectorize=False, + opt=self._codegen._opt_level, + cost="cheap") + + mpm_full = self._codegen._module_pass_manager() + + cheap_name = "Module passes (cheap optimization for refprune)" + with self._recorded_timings.record(cheap_name): + # A cheaper optimisation pass is run first to try and get as many + # refops into the same function as possible via inlining + mpm_cheap.run(self._final_module) + # Refop pruning is then run on the heavily inlined function + if not config.LLVM_REFPRUNE_PASS: + self._final_module = remove_redundant_nrt_refct(self._final_module) + full_name = "Module passes (full optimization)" + with self._recorded_timings.record(full_name): + # The full optimisation suite is then run on the refop pruned IR + mpm_full.run(self._final_module) + + def _get_module_for_linking(self): + """ + Internal: get a LLVM module suitable for linking multiple times + into another library. Exported functions are made "linkonce_odr" + to allow for multiple definitions, inlining, and removal of + unused exports. + + See discussion in https://github.com/numba/numba/pull/890 + """ + self._ensure_finalized() + if self._shared_module is not None: + return self._shared_module + mod = self._final_module + to_fix = [] + nfuncs = 0 + for fn in mod.functions: + nfuncs += 1 + if not fn.is_declaration and fn.linkage == ll.Linkage.external: + to_fix.append(fn.name) + if nfuncs == 0: + # This is an issue which can occur if loading a module + # from an object file and trying to link with it, so detect it + # here to make debugging easier. + raise RuntimeError("library unfit for linking: " + "no available functions in %s" + % (self,)) + if to_fix: + mod = mod.clone() + for name in to_fix: + # NOTE: this will mark the symbol WEAK if serialized + # to an ELF file + mod.get_function(name).linkage = 'linkonce_odr' + self._shared_module = mod + return mod + + def add_linking_library(self, library): + library._ensure_finalized() + self._linking_libraries.append(library) + + def add_ir_module(self, ir_module): + self._raise_if_finalized() + assert isinstance(ir_module, llvmir.Module) + ir = cgutils.normalize_ir_text(str(ir_module)) + ll_module = ll.parse_assembly(ir) + ll_module.name = ir_module.name + ll_module.verify() + self.add_llvm_module(ll_module) + + def add_llvm_module(self, ll_module): + self._optimize_functions(ll_module) + # TODO: we shouldn't need to recreate the LLVM module object + if not config.LLVM_REFPRUNE_PASS: + ll_module = remove_redundant_nrt_refct(ll_module) + self._final_module.link_in(ll_module) + + def finalize(self): + require_global_compiler_lock() + + # Report any LLVM-related problems to the user + self._codegen._check_llvm_bugs() + + self._raise_if_finalized() + + if config.DUMP_FUNC_OPT: + dump("FUNCTION OPTIMIZED DUMP %s" % self.name, + self.get_llvm_str(), 'llvm') + + # Link libraries for shared code + seen = set() + for library in self._linking_libraries: + if library not in seen: + seen.add(library) + self._final_module.link_in( + library._get_module_for_linking(), preserve=True, + ) + + # Optimize the module after all dependences are linked in above, + # to allow for inlining. + self._optimize_final_module() + + self._final_module.verify() + self._finalize_final_module() + + def _finalize_dynamic_globals(self): + # Scan for dynamic globals + for gv in self._final_module.global_variables: + if gv.name.startswith('numba.dynamic.globals'): + self._dynamic_globals.append(gv.name) + + def _verify_declare_only_symbols(self): + # Verify that no declare-only function compiled by numba. + for fn in self._final_module.functions: + # We will only check for symbol name starting with '_ZN5numba' + if fn.is_declaration and fn.name.startswith('_ZN5numba'): + msg = 'Symbol {} not linked properly' + raise AssertionError(msg.format(fn.name)) + + def _finalize_final_module(self): + """ + Make the underlying LLVM module ready to use. + """ + self._finalize_dynamic_globals() + self._verify_declare_only_symbols() + + # Remember this on the module, for the object cache hooks + self._final_module.__library = weakref.proxy(self) + + # It seems add_module() must be done only here and not before + # linking in other modules, otherwise get_pointer_to_function() + # could fail. + cleanup = self._codegen._add_module(self._final_module) + if cleanup: + weakref.finalize(self, cleanup) + self._finalize_specific() + + self._finalized = True + + if config.DUMP_OPTIMIZED: + dump("OPTIMIZED DUMP %s" % self.name, self.get_llvm_str(), 'llvm') + + if config.DUMP_ASSEMBLY: + dump("ASSEMBLY %s" % self.name, self.get_asm_str(), 'asm') + + def get_defined_functions(self): + """ + Get all functions defined in the library. The library must have + been finalized. + """ + mod = self._final_module + for fn in mod.functions: + if not fn.is_declaration: + yield fn + + def get_function(self, name): + return self._final_module.get_function(name) + + def _sentry_cache_disable_inspection(self): + if self._disable_inspection: + warnings.warn('Inspection disabled for cached code. ' + 'Invalid result is returned.') + + def get_llvm_str(self): + self._sentry_cache_disable_inspection() + return str(self._final_module) + + def get_asm_str(self): + self._sentry_cache_disable_inspection() + return str(self._codegen._tm.emit_assembly(self._final_module)) + + def get_function_cfg(self, name, py_func=None, **kwargs): + """ + Get control-flow graph of the LLVM function + """ + self._sentry_cache_disable_inspection() + return _CFG(self, name, py_func, **kwargs) + + def get_disasm_cfg(self, mangled_name): + """ + Get the CFG of the disassembly of the ELF object at symbol mangled_name. + + Requires python package: r2pipe + Requires radare2 binary on $PATH. + Notebook rendering requires python package: graphviz + Optionally requires a compiler toolchain (via pycc) to link the ELF to + get better disassembly results. + """ + elf = self._get_compiled_object() + return disassemble_elf_to_cfg(elf, mangled_name) + + @classmethod + def _dump_elf(cls, buf): + """ + Dump the symbol table of an ELF file. + Needs pyelftools (https://github.com/eliben/pyelftools) + """ + from elftools.elf.elffile import ELFFile + from elftools.elf import descriptions + from io import BytesIO + f = ELFFile(BytesIO(buf)) + print("ELF file:") + for sec in f.iter_sections(): + if sec['sh_type'] == 'SHT_SYMTAB': + symbols = sorted(sec.iter_symbols(), key=lambda sym: sym.name) + print(" symbols:") + for sym in symbols: + if not sym.name: + continue + print(" - %r: size=%d, value=0x%x, type=%s, bind=%s" + % (sym.name.decode(), + sym['st_size'], + sym['st_value'], + descriptions.describe_symbol_type(sym['st_info']['type']), + descriptions.describe_symbol_bind(sym['st_info']['bind']), + )) + print() + + @classmethod + def _object_compiled_hook(cls, ll_module, buf): + """ + `ll_module` was compiled into object code `buf`. + """ + try: + self = ll_module.__library + except AttributeError: + return + if self._object_caching_enabled: + self._compiled = True + self._compiled_object = buf + + @classmethod + def _object_getbuffer_hook(cls, ll_module): + """ + Return a cached object code for `ll_module`. + """ + try: + self = ll_module.__library + except AttributeError: + return + if self._object_caching_enabled and self._compiled_object: + buf = self._compiled_object + self._compiled_object = None + return buf + + def serialize_using_bitcode(self): + """ + Serialize this library using its bitcode as the cached representation. + """ + self._ensure_finalized() + return (self.name, 'bitcode', self._final_module.as_bitcode()) + + def serialize_using_object_code(self): + """ + Serialize this library using its object code as the cached + representation. We also include its bitcode for further inlining + with other libraries. + """ + self._ensure_finalized() + data = (self._get_compiled_object(), + self._get_module_for_linking().as_bitcode()) + return (self.name, 'object', data) + + @classmethod + def _unserialize(cls, codegen, state): + name, kind, data = state + self = codegen.create_library(name) + assert isinstance(self, cls) + if kind == 'bitcode': + # No need to re-run optimizations, just make the module ready + self._final_module = ll.parse_bitcode(data) + self._finalize_final_module() + return self + elif kind == 'object': + object_code, shared_bitcode = data + self.enable_object_caching() + self._set_compiled_object(object_code) + self._shared_module = ll.parse_bitcode(shared_bitcode) + self._finalize_final_module() + # Load symbols from cache + self._codegen._engine._load_defined_symbols(self._shared_module) + return self + else: + raise ValueError("unsupported serialization kind %r" % (kind,)) + + +class AOTCodeLibrary(CPUCodeLibrary): + + def emit_native_object(self): + """ + Return this library as a native object (a bytestring) -- for example + ELF under Linux. + + This function implicitly calls .finalize(). + """ + self._ensure_finalized() + return self._codegen._tm.emit_object(self._final_module) + + def emit_bitcode(self): + """ + Return this library as LLVM bitcode (a bytestring). + + This function implicitly calls .finalize(). + """ + self._ensure_finalized() + return self._final_module.as_bitcode() + + def _finalize_specific(self): + pass + + +class JITCodeLibrary(CPUCodeLibrary): + + def get_pointer_to_function(self, name): + """ + Generate native code for function named *name* and return a pointer + to the start of the function (as an integer). + + This function implicitly calls .finalize(). + + Returns + ------- + pointer : int + - zero (null) if no symbol of *name* is defined by this code + library. + - non-zero if the symbol is defined. + """ + self._ensure_finalized() + ee = self._codegen._engine + if not ee.is_symbol_defined(name): + return 0 + else: + return self._codegen._engine.get_function_address(name) + + def _finalize_specific(self): + self._codegen._scan_and_fix_unresolved_refs(self._final_module) + with self._recorded_timings.record("Finalize object"): + self._codegen._engine.finalize_object() + + +class RuntimeLinker(object): + """ + For tracking unresolved symbols generated at runtime due to recursion. + """ + PREFIX = '.numba.unresolved$' + + def __init__(self): + self._unresolved = utils.UniqueDict() + self._defined = set() + self._resolved = [] + + def scan_unresolved_symbols(self, module, engine): + """ + Scan and track all unresolved external symbols in the module and + allocate memory for it. + """ + prefix = self.PREFIX + + for gv in module.global_variables: + if gv.name.startswith(prefix): + sym = gv.name[len(prefix):] + # Avoid remapping to existing GV + if engine.is_symbol_defined(gv.name): + continue + # Allocate a memory space for the pointer + abortfn = rtsys.library.get_pointer_to_function("nrt_unresolved_abort") + ptr = ctypes.c_void_p(abortfn) + engine.add_global_mapping(gv, ctypes.addressof(ptr)) + self._unresolved[sym] = ptr + + def scan_defined_symbols(self, module): + """ + Scan and track all defined symbols. + """ + for fn in module.functions: + if not fn.is_declaration: + self._defined.add(fn.name) + + def resolve(self, engine): + """ + Fix unresolved symbols if they are defined. + """ + # An iterator to get all unresolved but available symbols + pending = [name for name in self._unresolved if name in self._defined] + # Resolve pending symbols + for name in pending: + # Get runtime address + fnptr = engine.get_function_address(name) + # Fix all usage + ptr = self._unresolved[name] + ptr.value = fnptr + self._resolved.append((name, ptr)) # keep ptr alive + # Delete resolved + del self._unresolved[name] + +def _proxy(old): + @functools.wraps(old) + def wrapper(self, *args, **kwargs): + return old(self._ee, *args, **kwargs) + return wrapper + + +class JitEngine(object): + """Wraps an ExecutionEngine to provide custom symbol tracking. + Since the symbol tracking is incomplete (doesn't consider + loaded code object), we are not putting it in llvmlite. + """ + def __init__(self, ee): + self._ee = ee + # Track symbol defined via codegen'd Module + # but not any cached object. + # NOTE: `llvm::ExecutionEngine` will catch duplicated symbols and + # we are not going to protect against that. A proper duplicated + # symbol detection will need a more logic to check for the linkage + # (e.g. like `weak` linkage symbol can override). This + # `_defined_symbols` set will be just enough to tell if a symbol + # exists and will not cause the `EE` symbol lookup to `exit(1)` + # when symbol-not-found. + self._defined_symbols = set() + + def is_symbol_defined(self, name): + """Is the symbol defined in this session? + """ + return name in self._defined_symbols + + def _load_defined_symbols(self, mod): + """Extract symbols from the module + """ + for gsets in (mod.functions, mod.global_variables): + self._defined_symbols |= {gv.name for gv in gsets + if not gv.is_declaration} + + def add_module(self, module): + """Override ExecutionEngine.add_module + to keep info about defined symbols. + """ + self._load_defined_symbols(module) + return self._ee.add_module(module) + + def add_global_mapping(self, gv, addr): + """Override ExecutionEngine.add_global_mapping + to keep info about defined symbols. + """ + self._defined_symbols.add(gv.name) + return self._ee.add_global_mapping(gv, addr) + + # + # The remaining methods are re-export of the ExecutionEngine APIs + # + set_object_cache = _proxy(ll.ExecutionEngine.set_object_cache) + finalize_object = _proxy(ll.ExecutionEngine.finalize_object) + get_function_address = _proxy(ll.ExecutionEngine.get_function_address) + get_global_value_address = _proxy( + ll.ExecutionEngine.get_global_value_address + ) + + +class Codegen(metaclass=ABCMeta): + """ + Base Codegen class. It is expected that subclasses set the class attribute + ``_library_class``, indicating the CodeLibrary class for the target. + + Subclasses should also initialize: + + ``self._data_layout``: the data layout for the target. + ``self._target_data``: the binding layer ``TargetData`` for the target. + """ + + @abstractmethod + def _create_empty_module(self, name): + """ + Create a new empty module suitable for the target. + """ + + @abstractmethod + def _add_module(self, module): + """ + Add a module to the execution engine. Ownership of the module is + transferred to the engine. + """ + + @property + def target_data(self): + """ + The LLVM "target data" object for this codegen instance. + """ + return self._target_data + + def create_library(self, name, **kwargs): + """ + Create a :class:`CodeLibrary` object for use with this codegen + instance. + """ + return self._library_class(self, name, **kwargs) + + def unserialize_library(self, serialized): + return self._library_class._unserialize(self, serialized) + + +class CPUCodegen(Codegen): + + def __init__(self, module_name): + initialize_llvm() + + self._data_layout = None + self._llvm_module = ll.parse_assembly( + str(self._create_empty_module(module_name))) + self._llvm_module.name = "global_codegen_module" + self._rtlinker = RuntimeLinker() + self._init(self._llvm_module) + + def _init(self, llvm_module): + assert list(llvm_module.global_variables) == [], "Module isn't empty" + + target = ll.Target.from_triple(ll.get_process_triple()) + tm_options = dict(opt=config.OPT) + self._tm_features = self._customize_tm_features() + self._customize_tm_options(tm_options) + tm = target.create_target_machine(**tm_options) + use_lmm = config.USE_LLVMLITE_MEMORY_MANAGER + engine = ll.create_mcjit_compiler(llvm_module, tm, use_lmm=use_lmm) + + if config.ENABLE_PROFILING: + engine.enable_jit_events() + + self._tm = tm + self._engine = JitEngine(engine) + self._target_data = engine.target_data + self._data_layout = str(self._target_data) + + if config.OPT.is_opt_max: + # If the OPT level is set to 'max' then the user is requesting that + # compilation time is traded for potential performance gain. This + # currently manifests as running the "cheap" pass at -O3 + # optimisation level with loop-vectorization enabled. There's no + # guarantee that this will increase runtime performance, it may + # detriment it, this is here to give the user an easily accessible + # option to try. + self._loopvect = True + self._opt_level = 3 + else: + # The default behaviour is to do an opt=0 pass to try and inline as + # much as possible with the cheapest cost of doing so. This is so + # that the ref-op pruner pass that runs after the cheap pass will + # have the largest possible scope for working on pruning references. + self._loopvect = False + self._opt_level = 0 + + self._engine.set_object_cache(self._library_class._object_compiled_hook, + self._library_class._object_getbuffer_hook) + + def _create_empty_module(self, name): + ir_module = llvmir.Module(cgutils.normalize_ir_text(name)) + ir_module.triple = ll.get_process_triple() + if self._data_layout: + ir_module.data_layout = self._data_layout + return ir_module + + def _module_pass_manager(self, **kwargs): + pm = ll.create_module_pass_manager() + pm.add_target_library_info(ll.get_process_triple()) + self._tm.add_analysis_passes(pm) + cost = kwargs.pop("cost", None) + with self._pass_manager_builder(**kwargs) as pmb: + pmb.populate(pm) + # If config.OPT==0 do not include these extra passes to help with + # vectorization. + if cost is not None and cost == "cheap" and config.OPT != 0: + # This knocks loops into rotated form early to reduce the likelihood + # of vectorization failing due to unknown PHI nodes. + pm.add_loop_rotate_pass() + # These passes are required to get SVML to vectorize tests + pm.add_instruction_combining_pass() + pm.add_jump_threading_pass() + + if config.LLVM_REFPRUNE_PASS: + pm.add_refprune_pass(_parse_refprune_flags()) + return pm + + def _function_pass_manager(self, llvm_module, **kwargs): + pm = ll.create_function_pass_manager(llvm_module) + pm.add_target_library_info(llvm_module.triple) + self._tm.add_analysis_passes(pm) + with self._pass_manager_builder(**kwargs) as pmb: + pmb.populate(pm) + if config.LLVM_REFPRUNE_PASS: + pm.add_refprune_pass(_parse_refprune_flags()) + return pm + + def _pass_manager_builder(self, **kwargs): + """ + Create a PassManagerBuilder. + + Note: a PassManagerBuilder seems good only for one use, so you + should call this method each time you want to populate a module + or function pass manager. Otherwise some optimizations will be + missed... + """ + opt_level = kwargs.pop('opt', config.OPT) + loop_vectorize = kwargs.pop('loop_vectorize', config.LOOP_VECTORIZE) + slp_vectorize = kwargs.pop('slp_vectorize', config.SLP_VECTORIZE) + + pmb = create_pass_manager_builder(opt=opt_level, + loop_vectorize=loop_vectorize, + slp_vectorize=slp_vectorize, + **kwargs) + + return pmb + + def _check_llvm_bugs(self): + """ + Guard against some well-known LLVM bug(s). + """ + # Check the locale bug at https://github.com/numba/numba/issues/1569 + # Note we can't cache the result as locale settings can change + # across a process's lifetime. Also, for this same reason, + # the check here is a mere heuristic (there may be a race condition + # between now and actually compiling IR). + ir = """ + define double @func() + { + ret double 1.23e+01 + } + """ + mod = ll.parse_assembly(ir) + ir_out = str(mod) + if "12.3" in ir_out or "1.23" in ir_out: + # Everything ok + return + if "1.0" in ir_out: + loc = locale.getlocale() + raise RuntimeError( + "LLVM will produce incorrect floating-point code " + "in the current locale %s.\nPlease read " + "https://numba.readthedocs.io/en/stable/user/faq.html#llvm-locale-bug " + "for more information." + % (loc,)) + raise AssertionError("Unexpected IR:\n%s\n" % (ir_out,)) + + def magic_tuple(self): + """ + Return a tuple unambiguously describing the codegen behaviour. + """ + return (self._llvm_module.triple, self._get_host_cpu_name(), + self._tm_features) + + def _scan_and_fix_unresolved_refs(self, module): + self._rtlinker.scan_unresolved_symbols(module, self._engine) + self._rtlinker.scan_defined_symbols(module) + self._rtlinker.resolve(self._engine) + + def insert_unresolved_ref(self, builder, fnty, name): + voidptr = llvmir.IntType(8).as_pointer() + ptrname = self._rtlinker.PREFIX + name + llvm_mod = builder.module + try: + fnptr = llvm_mod.get_global(ptrname) + except KeyError: + # Not defined? + fnptr = llvmir.GlobalVariable(llvm_mod, voidptr, name=ptrname) + fnptr.linkage = 'external' + return builder.bitcast(builder.load(fnptr), fnty.as_pointer()) + + def _get_host_cpu_name(self): + return (ll.get_host_cpu_name() + if config.CPU_NAME is None + else config.CPU_NAME) + + def _get_host_cpu_features(self): + if config.CPU_FEATURES is not None: + return config.CPU_FEATURES + return get_host_cpu_features() + + +class AOTCPUCodegen(CPUCodegen): + """ + A codegen implementation suitable for Ahead-Of-Time compilation + (e.g. generation of object files). + """ + + _library_class = AOTCodeLibrary + + def __init__(self, module_name, cpu_name=None): + # By default, use generic cpu model for the arch + self._cpu_name = cpu_name or '' + CPUCodegen.__init__(self, module_name) + + def _customize_tm_options(self, options): + cpu_name = self._cpu_name + if cpu_name == 'host': + cpu_name = self._get_host_cpu_name() + options['cpu'] = cpu_name + options['reloc'] = 'pic' + options['codemodel'] = 'default' + options['features'] = self._tm_features + + def _customize_tm_features(self): + # ISA features are selected according to the requested CPU model + # in _customize_tm_options() + return '' + + def _add_module(self, module): + pass + + +class JITCPUCodegen(CPUCodegen): + """ + A codegen implementation suitable for Just-In-Time compilation. + """ + + _library_class = JITCodeLibrary + + def _customize_tm_options(self, options): + # As long as we don't want to ship the code to another machine, + # we can specialize for this CPU. + options['cpu'] = self._get_host_cpu_name() + # LLVM 7 change: # https://reviews.llvm.org/D47211#inline-425406 + # JIT needs static relocation on x86* + # native target is already initialized from base class __init__ + arch = ll.Target.from_default_triple().name + if arch.startswith('x86'): # one of x86 or x86_64 + reloc_model = 'static' + elif arch.startswith('ppc'): + reloc_model = 'pic' + else: + reloc_model = 'default' + options['reloc'] = reloc_model + options['codemodel'] = 'jitdefault' + + # Set feature attributes (such as ISA extensions) + # This overrides default feature selection by CPU model above + options['features'] = self._tm_features + + # Deal with optional argument to ll.Target.create_target_machine + sig = utils.pysignature(ll.Target.create_target_machine) + if 'jit' in sig.parameters: + # Mark that this is making a JIT engine + options['jit'] = True + + def _customize_tm_features(self): + # For JIT target, we will use LLVM to get the feature map + return self._get_host_cpu_features() + + def _add_module(self, module): + self._engine.add_module(module) + # XXX: disabling remove module due to MCJIT engine leakage in + # removeModule. The removeModule causes consistent access + # violation with certain test combinations. + # # Early bind the engine method to avoid keeping a reference to self. + # return functools.partial(self._engine.remove_module, module) + + def set_env(self, env_name, env): + """Set the environment address. + + Update the GlobalVariable named *env_name* to the address of *env*. + """ + gvaddr = self._engine.get_global_value_address(env_name) + envptr = (ctypes.c_void_p * 1).from_address(gvaddr) + envptr[0] = ctypes.c_void_p(id(env)) + + +def initialize_llvm(): + """Safe to use multiple times. + """ + ll.initialize() + ll.initialize_native_target() + ll.initialize_native_asmprinter() + + +def get_host_cpu_features(): + """Get host CPU features using LLVM. + + The features may be modified due to user setting. + See numba.config.ENABLE_AVX. + """ + try: + features = ll.get_host_cpu_features() + except RuntimeError: + return '' + else: + if not config.ENABLE_AVX: + # Disable all features with name starting with 'avx' + for k in features: + if k.startswith('avx'): + features[k] = False + + # Set feature attributes + return features.flatten() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/compiler.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/compiler.py new file mode 100644 index 0000000000000000000000000000000000000000..d4259f555262dfd1170683835b4e0cdb74859f52 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/compiler.py @@ -0,0 +1,813 @@ +from collections import namedtuple +import copy +import warnings +from numba.core.tracing import event + +from numba.core import (errors, interpreter, bytecode, postproc, config, + callconv, cpu) +from numba.parfors.parfor import ParforDiagnostics +from numba.core.errors import CompilerError +from numba.core.environment import lookup_environment + +from numba.core.compiler_machinery import PassManager + +from numba.core.untyped_passes import (ExtractByteCode, TranslateByteCode, + FixupArgs, IRProcessing, DeadBranchPrune, + RewriteSemanticConstants, + InlineClosureLikes, GenericRewrites, + WithLifting, InlineInlinables, + FindLiterallyCalls, + MakeFunctionToJitFunction, + CanonicalizeLoopExit, + CanonicalizeLoopEntry, LiteralUnroll, + ReconstructSSA, RewriteDynamicRaises, + LiteralPropagationSubPipelinePass, + ) + +from numba.core.typed_passes import (NopythonTypeInference, AnnotateTypes, + NopythonRewrites, PreParforPass, + ParforPass, DumpParforDiagnostics, + IRLegalization, NoPythonBackend, + InlineOverloads, PreLowerStripPhis, + NativeLowering, NativeParforLowering, + NoPythonSupportedFeatureValidation, + ParforFusionPass, ParforPreLoweringPass + ) + +from numba.core.object_mode_passes import (ObjectModeFrontEnd, + ObjectModeBackEnd) +from numba.core.targetconfig import TargetConfig, Option, ConfigStack + + +class Flags(TargetConfig): + __slots__ = () + + enable_looplift = Option( + type=bool, + default=False, + doc="Enable loop-lifting", + ) + enable_pyobject = Option( + type=bool, + default=False, + doc="Enable pyobject mode (in general)", + ) + enable_pyobject_looplift = Option( + type=bool, + default=False, + doc="Enable pyobject mode inside lifted loops", + ) + enable_ssa = Option( + type=bool, + default=True, + doc="Enable SSA", + ) + force_pyobject = Option( + type=bool, + default=False, + doc="Force pyobject mode inside the whole function", + ) + release_gil = Option( + type=bool, + default=False, + doc="Release GIL inside the native function", + ) + no_compile = Option( + type=bool, + default=False, + doc="TODO", + ) + debuginfo = Option( + type=bool, + default=False, + doc="TODO", + ) + boundscheck = Option( + type=bool, + default=False, + doc="TODO", + ) + forceinline = Option( + type=bool, + default=False, + doc="Force inlining of the function. Overrides _dbg_optnone.", + ) + no_cpython_wrapper = Option( + type=bool, + default=False, + doc="TODO", + ) + no_cfunc_wrapper = Option( + type=bool, + default=False, + doc="TODO", + ) + auto_parallel = Option( + type=cpu.ParallelOptions, + default=cpu.ParallelOptions(False), + doc="""Enable automatic parallel optimization, can be fine-tuned by +taking a dictionary of sub-options instead of a boolean, see parfor.py for +detail""", + ) + nrt = Option( + type=bool, + default=False, + doc="TODO", + ) + no_rewrites = Option( + type=bool, + default=False, + doc="TODO", + ) + error_model = Option( + type=str, + default="python", + doc="TODO", + ) + fastmath = Option( + type=cpu.FastMathOptions, + default=cpu.FastMathOptions(False), + doc="TODO", + ) + noalias = Option( + type=bool, + default=False, + doc="TODO", + ) + inline = Option( + type=cpu.InlineOptions, + default=cpu.InlineOptions("never"), + doc="TODO", + ) + + dbg_extend_lifetimes = Option( + type=bool, + default=False, + doc=("Extend variable lifetime for debugging. " + "This automatically turns on with debug=True."), + ) + + dbg_optnone = Option( + type=bool, + default=False, + doc=("Disable optimization for debug. " + "Equivalent to adding optnone attribute in the LLVM Function.") + ) + + dbg_directives_only = Option( + type=bool, + default=False, + doc=("Make debug emissions directives-only. " + "Used when generating lineinfo.") + ) + + +DEFAULT_FLAGS = Flags() +DEFAULT_FLAGS.nrt = True + + +CR_FIELDS = ["typing_context", + "target_context", + "entry_point", + "typing_error", + "type_annotation", + "signature", + "objectmode", + "lifted", + "fndesc", + "library", + "call_helper", + "environment", + "metadata", + # List of functions to call to initialize on unserialization + # (i.e cache load). + "reload_init", + "referenced_envs", + ] + + +class CompileResult(namedtuple("_CompileResult", CR_FIELDS)): + """ + A structure holding results from the compilation of a function. + """ + + __slots__ = () + + def _reduce(self): + """ + Reduce a CompileResult to picklable components. + """ + libdata = self.library.serialize_using_object_code() + # Make it (un)picklable efficiently + typeann = str(self.type_annotation) + fndesc = self.fndesc + # Those don't need to be pickled and may fail + fndesc.typemap = fndesc.calltypes = None + # Include all referenced environments + referenced_envs = self._find_referenced_environments() + return (libdata, self.fndesc, self.environment, self.signature, + self.objectmode, self.lifted, typeann, self.reload_init, + tuple(referenced_envs)) + + def _find_referenced_environments(self): + """Returns a list of referenced environments + """ + mod = self.library._final_module + # Find environments + referenced_envs = [] + for gv in mod.global_variables: + gvn = gv.name + if gvn.startswith("_ZN08NumbaEnv"): + env = lookup_environment(gvn) + if env is not None: + if env.can_cache(): + referenced_envs.append(env) + return referenced_envs + + @classmethod + def _rebuild(cls, target_context, libdata, fndesc, env, + signature, objectmode, lifted, typeann, + reload_init, referenced_envs): + if reload_init: + # Re-run all + for fn in reload_init: + fn() + + library = target_context.codegen().unserialize_library(libdata) + cfunc = target_context.get_executable(library, fndesc, env) + cr = cls(target_context=target_context, + typing_context=target_context.typing_context, + library=library, + environment=env, + entry_point=cfunc, + fndesc=fndesc, + type_annotation=typeann, + signature=signature, + objectmode=objectmode, + lifted=lifted, + typing_error=None, + call_helper=None, + metadata=None, # Do not store, arbitrary & potentially large! + reload_init=reload_init, + referenced_envs=referenced_envs, + ) + + # Load Environments + for env in referenced_envs: + library.codegen.set_env(env.env_name, env) + + return cr + + @property + def codegen(self): + return self.target_context.codegen() + + def dump(self, tab=''): + print(f'{tab}DUMP {type(self).__name__} {self.entry_point}') + self.signature.dump(tab=tab + ' ') + print(f'{tab}END DUMP') + + +_LowerResult = namedtuple("_LowerResult", [ + "fndesc", + "call_helper", + "cfunc", + "env", +]) + + +def sanitize_compile_result_entries(entries): + keys = set(entries.keys()) + fieldset = set(CR_FIELDS) + badnames = keys - fieldset + if badnames: + raise NameError(*badnames) + missing = fieldset - keys + for k in missing: + entries[k] = None + # Avoid keeping alive traceback variables + err = entries['typing_error'] + if err is not None: + entries['typing_error'] = err.with_traceback(None) + return entries + + +def compile_result(**entries): + entries = sanitize_compile_result_entries(entries) + return CompileResult(**entries) + + +def run_frontend(func, inline_closures=False, emit_dels=False): + """ + Run the compiler frontend over the given Python function, and return + the function's canonical Numba IR. + + If inline_closures is Truthy then closure inlining will be run + If emit_dels is Truthy the ir.Del nodes will be emitted appropriately + """ + # XXX make this a dedicated Pipeline? + func_id = bytecode.FunctionIdentity.from_function(func) + interp = interpreter.Interpreter(func_id) + bc = bytecode.ByteCode(func_id=func_id) + func_ir = interp.interpret(bc) + if inline_closures: + from numba.core.inline_closurecall import InlineClosureCallPass + inline_pass = InlineClosureCallPass(func_ir, cpu.ParallelOptions(False), + {}, False) + inline_pass.run() + post_proc = postproc.PostProcessor(func_ir) + post_proc.run(emit_dels) + return func_ir + + +class _CompileStatus(object): + """ + Describes the state of compilation. Used like a C record. + """ + __slots__ = ['fail_reason', 'can_fallback'] + + def __init__(self, can_fallback): + self.fail_reason = None + self.can_fallback = can_fallback + + def __repr__(self): + vals = [] + for k in self.__slots__: + vals.append("{k}={v}".format(k=k, v=getattr(self, k))) + return ', '.join(vals) + + +class _EarlyPipelineCompletion(Exception): + """ + Raised to indicate that a pipeline has completed early + """ + + def __init__(self, result): + self.result = result + + +class StateDict(dict): + """ + A dictionary that has an overloaded getattr and setattr to permit getting + and setting key/values through the use of attributes. + """ + + def __getattr__(self, attr): + try: + return self[attr] + except KeyError: + raise AttributeError(attr) + + def __setattr__(self, attr, value): + self[attr] = value + + +def _make_subtarget(targetctx, flags): + """ + Make a new target context from the given target context and flags. + """ + subtargetoptions = {} + if flags.debuginfo: + subtargetoptions['enable_debuginfo'] = True + if flags.boundscheck: + subtargetoptions['enable_boundscheck'] = True + if flags.nrt: + subtargetoptions['enable_nrt'] = True + if flags.auto_parallel: + subtargetoptions['auto_parallel'] = flags.auto_parallel + if flags.fastmath: + subtargetoptions['fastmath'] = flags.fastmath + error_model = callconv.create_error_model(flags.error_model, targetctx) + subtargetoptions['error_model'] = error_model + + return targetctx.subtarget(**subtargetoptions) + + +class CompilerBase(object): + """ + Stores and manages states for the compiler + """ + + def __init__(self, typingctx, targetctx, library, args, return_type, flags, + locals): + # Make sure the environment is reloaded + config.reload_config() + typingctx.refresh() + targetctx.refresh() + + self.state = StateDict() + + self.state.typingctx = typingctx + self.state.targetctx = _make_subtarget(targetctx, flags) + self.state.library = library + self.state.args = args + self.state.return_type = return_type + self.state.flags = flags + self.state.locals = locals + + # Results of various steps of the compilation pipeline + self.state.bc = None + self.state.func_id = None + self.state.func_ir = None + self.state.lifted = None + self.state.lifted_from = None + self.state.typemap = None + self.state.calltypes = None + self.state.type_annotation = None + # holds arbitrary inter-pipeline stage meta data + self.state.metadata = {} + self.state.reload_init = [] + # hold this for e.g. with_lifting, null out on exit + self.state.pipeline = self + + # parfor diagnostics info, add to metadata + self.state.parfor_diagnostics = ParforDiagnostics() + self.state.metadata['parfor_diagnostics'] = \ + self.state.parfor_diagnostics + self.state.metadata['parfors'] = {} + + self.state.status = _CompileStatus( + can_fallback=self.state.flags.enable_pyobject + ) + + def compile_extra(self, func): + self.state.func_id = bytecode.FunctionIdentity.from_function(func) + ExtractByteCode().run_pass(self.state) + + self.state.lifted = () + self.state.lifted_from = None + return self._compile_bytecode() + + def compile_ir(self, func_ir, lifted=(), lifted_from=None): + self.state.func_id = func_ir.func_id + self.state.lifted = lifted + self.state.lifted_from = lifted_from + self.state.func_ir = func_ir + self.state.nargs = self.state.func_ir.arg_count + + FixupArgs().run_pass(self.state) + return self._compile_ir() + + def define_pipelines(self): + """Child classes override this to customize the pipelines in use. + """ + raise NotImplementedError() + + def _compile_core(self): + """ + Populate and run compiler pipeline + """ + with ConfigStack().enter(self.state.flags.copy()): + pms = self.define_pipelines() + for pm in pms: + pipeline_name = pm.pipeline_name + func_name = "%s.%s" % (self.state.func_id.modname, + self.state.func_id.func_qualname) + + event("Pipeline: %s for %s" % (pipeline_name, func_name)) + self.state.metadata['pipeline_times'] = {pipeline_name: + pm.exec_times} + is_final_pipeline = pm == pms[-1] + res = None + try: + pm.run(self.state) + if self.state.cr is not None: + break + except _EarlyPipelineCompletion as e: + res = e.result + break + except Exception as e: + if not isinstance(e, errors.NumbaError): + raise e + self.state.status.fail_reason = e + if is_final_pipeline: + raise e + else: + raise CompilerError("All available pipelines exhausted") + + # Pipeline is done, remove self reference to release refs to user + # code + self.state.pipeline = None + + # organise a return + if res is not None: + # Early pipeline completion + return res + else: + assert self.state.cr is not None + return self.state.cr + + def _compile_bytecode(self): + """ + Populate and run pipeline for bytecode input + """ + assert self.state.func_ir is None + return self._compile_core() + + def _compile_ir(self): + """ + Populate and run pipeline for IR input + """ + assert self.state.func_ir is not None + return self._compile_core() + + +class Compiler(CompilerBase): + """The default compiler + """ + + def define_pipelines(self): + if self.state.flags.force_pyobject: + # either object mode + return [DefaultPassBuilder.define_objectmode_pipeline(self.state),] + else: + # or nopython mode + return [DefaultPassBuilder.define_nopython_pipeline(self.state),] + + +class DefaultPassBuilder(object): + """ + This is the default pass builder, it contains the "classic" default + pipelines as pre-canned PassManager instances: + - nopython + - objectmode + - interpreted + - typed + - untyped + - nopython lowering + """ + @staticmethod + def define_nopython_pipeline(state, name='nopython'): + """Returns an nopython mode pipeline based PassManager + """ + # compose pipeline from untyped, typed and lowering parts + dpb = DefaultPassBuilder + pm = PassManager(name) + untyped_passes = dpb.define_untyped_pipeline(state) + pm.passes.extend(untyped_passes.passes) + + typed_passes = dpb.define_typed_pipeline(state) + pm.passes.extend(typed_passes.passes) + + lowering_passes = dpb.define_nopython_lowering_pipeline(state) + pm.passes.extend(lowering_passes.passes) + + pm.finalize() + return pm + + @staticmethod + def define_nopython_lowering_pipeline(state, name='nopython_lowering'): + pm = PassManager(name) + # legalise + pm.add_pass(NoPythonSupportedFeatureValidation, + "ensure features that are in use are in a valid form") + pm.add_pass(IRLegalization, + "ensure IR is legal prior to lowering") + # Annotate only once legalized + pm.add_pass(AnnotateTypes, "annotate types") + # lower + if state.flags.auto_parallel.enabled: + pm.add_pass(NativeParforLowering, "native parfor lowering") + else: + pm.add_pass(NativeLowering, "native lowering") + pm.add_pass(NoPythonBackend, "nopython mode backend") + pm.add_pass(DumpParforDiagnostics, "dump parfor diagnostics") + pm.finalize() + return pm + + @staticmethod + def define_parfor_gufunc_nopython_lowering_pipeline( + state, name='parfor_gufunc_nopython_lowering'): + pm = PassManager(name) + # legalise + pm.add_pass(NoPythonSupportedFeatureValidation, + "ensure features that are in use are in a valid form") + pm.add_pass(IRLegalization, + "ensure IR is legal prior to lowering") + # Annotate only once legalized + pm.add_pass(AnnotateTypes, "annotate types") + # lower + if state.flags.auto_parallel.enabled: + pm.add_pass(NativeParforLowering, "native parfor lowering") + else: + pm.add_pass(NativeLowering, "native lowering") + pm.add_pass(NoPythonBackend, "nopython mode backend") + pm.finalize() + return pm + + @staticmethod + def define_typed_pipeline(state, name="typed"): + """Returns the typed part of the nopython pipeline""" + pm = PassManager(name) + # typing + pm.add_pass(NopythonTypeInference, "nopython frontend") + + # strip phis + pm.add_pass(PreLowerStripPhis, "remove phis nodes") + + # optimisation + pm.add_pass(InlineOverloads, "inline overloaded functions") + if state.flags.auto_parallel.enabled: + pm.add_pass(PreParforPass, "Preprocessing for parfors") + if not state.flags.no_rewrites: + pm.add_pass(NopythonRewrites, "nopython rewrites") + if state.flags.auto_parallel.enabled: + pm.add_pass(ParforPass, "convert to parfors") + pm.add_pass(ParforFusionPass, "fuse parfors") + pm.add_pass(ParforPreLoweringPass, "parfor prelowering") + + pm.finalize() + return pm + + @staticmethod + def define_parfor_gufunc_pipeline(state, name="parfor_gufunc_typed"): + """Returns the typed part of the nopython pipeline""" + pm = PassManager(name) + assert state.func_ir + pm.add_pass(IRProcessing, "processing IR") + pm.add_pass(NopythonTypeInference, "nopython frontend") + pm.add_pass(ParforPreLoweringPass, "parfor prelowering") + + pm.finalize() + return pm + + @staticmethod + def define_untyped_pipeline(state, name='untyped'): + """Returns an untyped part of the nopython pipeline""" + pm = PassManager(name) + if state.func_ir is None: + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(FixupArgs, "fix up args") + pm.add_pass(IRProcessing, "processing IR") + pm.add_pass(WithLifting, "Handle with contexts") + + # inline closures early in case they are using nonlocal's + # see issue #6585. + pm.add_pass(InlineClosureLikes, + "inline calls to locally defined closures") + + # pre typing + if not state.flags.no_rewrites: + pm.add_pass(RewriteSemanticConstants, "rewrite semantic constants") + pm.add_pass(DeadBranchPrune, "dead branch pruning") + pm.add_pass(GenericRewrites, "nopython rewrites") + + pm.add_pass(RewriteDynamicRaises, "rewrite dynamic raises") + + # convert any remaining closures into functions + pm.add_pass(MakeFunctionToJitFunction, + "convert make_function into JIT functions") + # inline functions that have been determined as inlinable and rerun + # branch pruning, this needs to be run after closures are inlined as + # the IR repr of a closure masks call sites if an inlinable is called + # inside a closure + pm.add_pass(InlineInlinables, "inline inlinable functions") + if not state.flags.no_rewrites: + pm.add_pass(DeadBranchPrune, "dead branch pruning") + + pm.add_pass(FindLiterallyCalls, "find literally calls") + pm.add_pass(LiteralUnroll, "handles literal_unroll") + + if state.flags.enable_ssa: + pm.add_pass(ReconstructSSA, "ssa") + + if not state.flags.no_rewrites: + pm.add_pass(DeadBranchPrune, "dead branch pruning") + + pm.add_pass(LiteralPropagationSubPipelinePass, "Literal propagation") + + pm.finalize() + return pm + + @staticmethod + def define_objectmode_pipeline(state, name='object'): + """Returns an object-mode pipeline based PassManager + """ + pm = PassManager(name) + if state.func_ir is None: + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(FixupArgs, "fix up args") + else: + # Reaches here if it's a fallback from nopython mode. + # Strip the phi nodes. + pm.add_pass(PreLowerStripPhis, "remove phis nodes") + pm.add_pass(IRProcessing, "processing IR") + + # The following passes are needed to adjust for looplifting + pm.add_pass(CanonicalizeLoopEntry, "canonicalize loop entry") + pm.add_pass(CanonicalizeLoopExit, "canonicalize loop exit") + + pm.add_pass(ObjectModeFrontEnd, "object mode frontend") + pm.add_pass(InlineClosureLikes, + "inline calls to locally defined closures") + # convert any remaining closures into functions + pm.add_pass(MakeFunctionToJitFunction, + "convert make_function into JIT functions") + pm.add_pass(IRLegalization, "ensure IR is legal prior to lowering") + pm.add_pass(AnnotateTypes, "annotate types") + pm.add_pass(ObjectModeBackEnd, "object mode backend") + pm.finalize() + return pm + + +def compile_extra(typingctx, targetctx, func, args, return_type, flags, + locals, library=None, pipeline_class=Compiler): + """Compiler entry point + + Parameter + --------- + typingctx : + typing context + targetctx : + target context + func : function + the python function to be compiled + args : tuple, list + argument types + return_type : + Use ``None`` to indicate void return + flags : numba.compiler.Flags + compiler flags + library : numba.codegen.CodeLibrary + Used to store the compiled code. + If it is ``None``, a new CodeLibrary is used. + pipeline_class : type like numba.compiler.CompilerBase + compiler pipeline + """ + pipeline = pipeline_class(typingctx, targetctx, library, + args, return_type, flags, locals) + return pipeline.compile_extra(func) + + +def compile_ir(typingctx, targetctx, func_ir, args, return_type, flags, + locals, lifted=(), lifted_from=None, is_lifted_loop=False, + library=None, pipeline_class=Compiler): + """ + Compile a function with the given IR. + + For internal use only. + """ + + # This is a special branch that should only run on IR from a lifted loop + if is_lifted_loop: + # This code is pessimistic and costly, but it is a not often trodden + # path and it will go away once IR is made immutable. The problem is + # that the rewrite passes can mutate the IR into a state that makes + # it possible for invalid tokens to be transmitted to lowering which + # then trickle through into LLVM IR and causes RuntimeErrors as LLVM + # cannot compile it. As a result the following approach is taken: + # 1. Create some new flags that copy the original ones but switch + # off rewrites. + # 2. Compile with 1. to get a compile result + # 3. Try and compile another compile result but this time with the + # original flags (and IR being rewritten). + # 4. If 3 was successful, use the result, else use 2. + + # create flags with no rewrites + norw_flags = copy.deepcopy(flags) + norw_flags.no_rewrites = True + + def compile_local(the_ir, the_flags): + pipeline = pipeline_class(typingctx, targetctx, library, + args, return_type, the_flags, locals) + return pipeline.compile_ir(func_ir=the_ir, lifted=lifted, + lifted_from=lifted_from) + + # compile with rewrites off, IR shouldn't be mutated irreparably + norw_cres = compile_local(func_ir.copy(), norw_flags) + + # try and compile with rewrites on if no_rewrites was not set in the + # original flags, IR might get broken but we've got a CompileResult + # that's usable from above. + rw_cres = None + if not flags.no_rewrites: + # Suppress warnings in compilation retry + with warnings.catch_warnings(): + warnings.simplefilter("ignore", errors.NumbaWarning) + try: + rw_cres = compile_local(func_ir.copy(), flags) + except Exception: + pass + # if the rewrite variant of compilation worked, use it, else use + # the norewrites backup + if rw_cres is not None: + cres = rw_cres + else: + cres = norw_cres + return cres + + else: + pipeline = pipeline_class(typingctx, targetctx, library, + args, return_type, flags, locals) + return pipeline.compile_ir(func_ir=func_ir, lifted=lifted, + lifted_from=lifted_from) + + +def compile_internal(typingctx, targetctx, library, + func, args, return_type, flags, locals): + """ + For internal use only. + """ + pipeline = Compiler(typingctx, targetctx, library, + args, return_type, flags, locals) + return pipeline.compile_extra(func) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/compiler_lock.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/compiler_lock.py new file mode 100644 index 0000000000000000000000000000000000000000..874fced9fd9924d549655b55caec96d7518182f4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/compiler_lock.py @@ -0,0 +1,56 @@ +import threading +import functools +import numba.core.event as ev + + +# Lock for the preventing multiple compiler execution +class _CompilerLock(object): + def __init__(self): + self._lock = threading.RLock() + + def acquire(self): + ev.start_event("numba:compiler_lock") + self._lock.acquire() + + def release(self): + self._lock.release() + ev.end_event("numba:compiler_lock") + + def __enter__(self): + self.acquire() + + def __exit__(self, exc_val, exc_type, traceback): + self.release() + + def is_locked(self): + is_owned = getattr(self._lock, '_is_owned') + if not callable(is_owned): + is_owned = self._is_owned + return is_owned() + + def __call__(self, func): + @functools.wraps(func) + def _acquire_compile_lock(*args, **kwargs): + with self: + return func(*args, **kwargs) + return _acquire_compile_lock + + def _is_owned(self): + # This method is borrowed from threading.Condition. + # Return True if lock is owned by current_thread. + # This method is called only if _lock doesn't have _is_owned(). + if self._lock.acquire(0): + self._lock.release() + return False + else: + return True + + +global_compiler_lock = _CompilerLock() + + +def require_global_compiler_lock(): + """Sentry that checks the global_compiler_lock is acquired. + """ + # Use assert to allow turning off this check + assert global_compiler_lock.is_locked() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/compiler_machinery.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/compiler_machinery.py new file mode 100644 index 0000000000000000000000000000000000000000..a168264d3a4196a24f0e6571646c40c67427962f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/compiler_machinery.py @@ -0,0 +1,462 @@ +import timeit +from abc import abstractmethod, ABCMeta +from collections import namedtuple, OrderedDict +import inspect + + +from numba.core.compiler_lock import global_compiler_lock +from numba.core import errors, config, transforms, utils +from numba.core.tracing import event +from numba.core.postproc import PostProcessor +from numba.core.ir_utils import enforce_no_dels, legalize_single_scope +import numba.core.event as ev + +# terminal color markup +_termcolor = errors.termcolor() + + +class SimpleTimer(object): + """ + A simple context managed timer + """ + + def __enter__(self): + self.ts = timeit.default_timer() + return self + + def __exit__(self, *exc): + self.elapsed = timeit.default_timer() - self.ts + + +class CompilerPass(metaclass=ABCMeta): + """ The base class for all compiler passes. + """ + + @abstractmethod + def __init__(self, *args, **kwargs): + self._analysis = None + self._pass_id = None + + @classmethod + def name(cls): + """ + Returns the name of the pass + """ + return cls._name + + @property + def pass_id(self): + """ + The ID of the pass + """ + return self._pass_id + + @pass_id.setter + def pass_id(self, val): + """ + Sets the ID of the pass + """ + self._pass_id = val + + @property + def analysis(self): + """ + Analysis data for the pass + """ + return self._analysis + + @analysis.setter + def analysis(self, val): + """ + Set the analysis data for the pass + """ + self._analysis = val + + def run_initialization(self, *args, **kwargs): + """ + Runs the initialization sequence for the pass, will run before + `run_pass`. + """ + return False + + @abstractmethod + def run_pass(self, *args, **kwargs): + """ + Runs the pass itself. Must return True/False depending on whether + statement level modification took place. + """ + pass + + def run_finalizer(self, *args, **kwargs): + """ + Runs the initialization sequence for the pass, will run before + `run_pass`. + """ + return False + + def get_analysis_usage(self, AU): + """ Override to set analysis usage + """ + pass + + def get_analysis(self, pass_name): + """ + Gets the analysis from a given pass + """ + return self._analysis[pass_name] + + +class SSACompliantMixin(object): + """ Mixin to indicate a pass is SSA form compliant. Nothing is asserted + about this condition at present. + """ + pass + + +class FunctionPass(CompilerPass): + """ Base class for function passes + """ + pass + + +class AnalysisPass(CompilerPass): + """ Base class for analysis passes (no modification made to state) + """ + pass + + +class LoweringPass(CompilerPass): + """ Base class for lowering passes + """ + pass + + +class AnalysisUsage(object): + """This looks and behaves like LLVM's AnalysisUsage because its like that. + """ + + def __init__(self): + self._required = set() + self._preserved = set() + + def get_required_set(self): + return self._required + + def get_preserved_set(self): + return self._preserved + + def add_required(self, pss): + self._required.add(pss) + + def add_preserved(self, pss): + self._preserved.add(pss) + + def __str__(self): + return "required: %s\n" % self._required + + +_DEBUG = False + + +def debug_print(*args, **kwargs): + if _DEBUG: + print(*args, **kwargs) + + +pass_timings = namedtuple('pass_timings', 'init run finalize') + + +class PassManager(object): + """ + The PassManager is a named instance of a particular compilation pipeline + """ + # TODO: Eventually enable this, it enforces self consistency after each pass + _ENFORCING = False + + def __init__(self, pipeline_name): + """ + Create a new pipeline with name "pipeline_name" + """ + self.passes = [] + self.exec_times = OrderedDict() + self._finalized = False + self._analysis = None + self._print_after = None + self.pipeline_name = pipeline_name + + def _validate_pass(self, pass_cls): + if (not (isinstance(pass_cls, str) or + (inspect.isclass(pass_cls) and + issubclass(pass_cls, CompilerPass)))): + msg = ("Pass must be referenced by name or be a subclass of a " + "CompilerPass. Have %s" % pass_cls) + raise TypeError(msg) + if isinstance(pass_cls, str): + pass_cls = _pass_registry.find_by_name(pass_cls) + else: + if not _pass_registry.is_registered(pass_cls): + raise ValueError("Pass %s is not registered" % pass_cls) + + def add_pass(self, pss, description=""): + """ + Append a pass to the PassManager's compilation pipeline + """ + self._validate_pass(pss) + func_desc_tuple = (pss, description) + self.passes.append(func_desc_tuple) + self._finalized = False + + def add_pass_after(self, pass_cls, location): + """ + Add a pass `pass_cls` to the PassManager's compilation pipeline after + the pass `location`. + """ + assert self.passes + self._validate_pass(pass_cls) + self._validate_pass(location) + for idx, (x, _) in enumerate(self.passes): + if x == location: + break + else: + raise ValueError("Could not find pass %s" % location) + self.passes.insert(idx + 1, (pass_cls, str(pass_cls))) + # if a pass has been added, it's not finalized + self._finalized = False + + def _debug_init(self): + # determine after which passes IR dumps should take place + def parse(conf_item): + print_passes = [] + if conf_item != "none": + if conf_item == "all": + print_passes = [x.name() for (x, _) in self.passes] + else: + # we don't validate whether the named passes exist in this + # pipeline the compiler may be used reentrantly and + # different pipelines may contain different passes + splitted = conf_item.split(',') + print_passes = [x.strip() for x in splitted] + return print_passes + ret = (parse(config.DEBUG_PRINT_AFTER), + parse(config.DEBUG_PRINT_BEFORE), + parse(config.DEBUG_PRINT_WRAP),) + return ret + + def finalize(self): + """ + Finalize the PassManager, after which no more passes may be added + without re-finalization. + """ + self._analysis = self.dependency_analysis() + self._print_after, self._print_before, self._print_wrap = \ + self._debug_init() + self._finalized = True + + @property + def finalized(self): + return self._finalized + + def _patch_error(self, desc, exc): + """ + Patches the error to show the stage that it arose in. + """ + newmsg = "{desc}\n{exc}".format(desc=desc, exc=exc) + exc.args = (newmsg,) + return exc + + @global_compiler_lock # this need a lock, likely calls LLVM + def _runPass(self, index, pss, internal_state): + mutated = False + + def check(func, compiler_state): + mangled = func(compiler_state) + if mangled not in (True, False): + msg = ("CompilerPass implementations should return True/False. " + "CompilerPass with name '%s' did not.") + raise ValueError(msg % pss.name()) + return mangled + + def debug_print(pass_name, print_condition, printable_condition): + if pass_name in print_condition: + fid = internal_state.func_id + args = (fid.modname, fid.func_qualname, self.pipeline_name, + printable_condition, pass_name) + print(("%s.%s: %s: %s %s" % args).center(120, '-')) + if internal_state.func_ir is not None: + internal_state.func_ir.dump() + else: + print("func_ir is None") + + # debug print before this pass? + debug_print(pss.name(), self._print_before + self._print_wrap, "BEFORE") + + # wire in the analysis info so it's accessible + pss.analysis = self._analysis + + qualname = internal_state.func_id.func_qualname + + ev_details = dict( + name=f"{pss.name()} [{qualname}]", + qualname=qualname, + module=internal_state.func_id.modname, + flags=utils._lazy_pformat(internal_state.flags.values()), + args=str(internal_state.args), + return_type=str(internal_state.return_type), + ) + errctx = errors.new_error_context(f"Pass {pss.name()}") + with ev.trigger_event("numba:run_pass", data=ev_details), errctx: + with SimpleTimer() as init_time: + mutated |= check(pss.run_initialization, internal_state) + with SimpleTimer() as pass_time: + mutated |= check(pss.run_pass, internal_state) + with SimpleTimer() as finalize_time: + mutated |= check(pss.run_finalizer, internal_state) + + # Check that if the pass is an instance of a FunctionPass that it hasn't + # emitted ir.Dels. + if isinstance(pss, FunctionPass): + enforce_no_dels(internal_state.func_ir) + + if self._ENFORCING: + # TODO: Add in self consistency enforcement for + # `func_ir._definitions` etc + if _pass_registry.get(pss.__class__).mutates_CFG: + if mutated: # block level changes, rebuild all + PostProcessor(internal_state.func_ir).run() + else: # CFG level changes rebuild CFG + internal_state.func_ir.blocks = transforms.canonicalize_cfg( + internal_state.func_ir.blocks) + # Check the func_ir has exactly one Scope instance + if not legalize_single_scope(internal_state.func_ir.blocks): + raise errors.CompilerError( + f"multiple scope in func_ir detected in {pss}", + ) + # inject runtimes + pt = pass_timings(init_time.elapsed, pass_time.elapsed, + finalize_time.elapsed) + self.exec_times["%s_%s" % (index, pss.name())] = pt + + # debug print after this pass? + debug_print(pss.name(), self._print_after + self._print_wrap, "AFTER") + + def run(self, state): + """ + Run the defined pipelines on the state. + """ + from numba.core.compiler import _EarlyPipelineCompletion + if not self.finalized: + raise RuntimeError("Cannot run non-finalised pipeline") + + # walk the passes and run them + for idx, (pss, pass_desc) in enumerate(self.passes): + try: + event("-- %s" % pass_desc) + pass_inst = _pass_registry.get(pss).pass_inst + if isinstance(pass_inst, CompilerPass): + self._runPass(idx, pass_inst, state) + else: + raise BaseException("Legacy pass in use") + except _EarlyPipelineCompletion as e: + raise e + except Exception as e: + if not isinstance(e, errors.NumbaError): + raise e + msg = "Failed in %s mode pipeline (step: %s)" % \ + (self.pipeline_name, pass_desc) + patched_exception = self._patch_error(msg, e) + raise patched_exception + + def dependency_analysis(self): + """ + Computes dependency analysis + """ + deps = dict() + for (pss, _) in self.passes: + x = _pass_registry.get(pss).pass_inst + au = AnalysisUsage() + x.get_analysis_usage(au) + deps[type(x)] = au + + requires_map = dict() + for k, v in deps.items(): + requires_map[k] = v.get_required_set() + + def resolve_requires(key, rmap): + def walk(lkey, rmap): + dep_set = rmap[lkey] if lkey in rmap else set() + if dep_set: + for x in dep_set: + dep_set |= (walk(x, rmap)) + return dep_set + else: + return set() + ret = set() + for k in key: + ret |= walk(k, rmap) + return ret + + dep_chain = dict() + for k, v in requires_map.items(): + dep_chain[k] = set(v) | (resolve_requires(v, requires_map)) + + return dep_chain + + +pass_info = namedtuple('pass_info', 'pass_inst mutates_CFG analysis_only') + + +class PassRegistry(object): + """ + Pass registry singleton class. + """ + + _id = 0 + + _registry = dict() + + def register(self, mutates_CFG, analysis_only): + def make_festive(pass_class): + assert not self.is_registered(pass_class) + assert not self._does_pass_name_alias(pass_class.name()) + pass_class.pass_id = self._id + self._id += 1 + self._registry[pass_class] = pass_info(pass_class(), mutates_CFG, + analysis_only) + return pass_class + return make_festive + + def is_registered(self, clazz): + return clazz in self._registry.keys() + + def get(self, clazz): + assert self.is_registered(clazz) + return self._registry[clazz] + + def _does_pass_name_alias(self, check): + for k, v in self._registry.items(): + if v.pass_inst.name == check: + return True + return False + + def find_by_name(self, class_name): + assert isinstance(class_name, str) + for k, v in self._registry.items(): + if v.pass_inst.name == class_name: + return v + else: + raise ValueError("No pass with name %s is registered" % class_name) + + def dump(self): + for k, v in self._registry.items(): + print("%s: %s" % (k, v)) + + +_pass_registry = PassRegistry() +del PassRegistry + + +""" +register_pass is used to register a compiler pass class for use with PassManager +instances. +""" +register_pass = _pass_registry.register diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/config.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/config.py new file mode 100644 index 0000000000000000000000000000000000000000..ad7deab48fd2a1a8827bb8ea06eb051a2d0769f5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/config.py @@ -0,0 +1,592 @@ +import platform +import sys +import os +import re +import shutil +import warnings +import traceback + +# YAML needed to use file based Numba config +try: + import yaml + _HAVE_YAML = True +except ImportError: + _HAVE_YAML = False + + +import llvmlite.binding as ll + + +IS_WIN32 = sys.platform.startswith('win32') +IS_OSX = sys.platform.startswith('darwin') +MACHINE_BITS = tuple.__itemsize__ * 8 +IS_32BITS = MACHINE_BITS == 32 +# Python version in (major, minor) tuple +PYVERSION = sys.version_info[:2] + +# this is the name of the user supplied configuration file +_config_fname = '.numba_config.yaml' + + +def _parse_cc(text): + """ + Parse CUDA compute capability version string. + """ + if not text: + return None + else: + m = re.match(r'(\d+)\.(\d+)', text) + if not m: + raise ValueError("Compute capability must be specified as a " + "string of \"major.minor\" where major " + "and minor are decimals") + grp = m.groups() + return int(grp[0]), int(grp[1]) + + +def _os_supports_avx(): + """ + Whether the current OS supports AVX, regardless of the CPU. + + This is necessary because the user may be running a very old Linux + kernel (e.g. CentOS 5) on a recent CPU. + """ + if (not sys.platform.startswith('linux') + or platform.machine() not in ('i386', 'i586', 'i686', 'x86_64')): + return True + # Executing the CPUID instruction may report AVX available even though + # the kernel doesn't support it, so parse /proc/cpuinfo instead. + try: + f = open('/proc/cpuinfo', 'r') + except OSError: + # If /proc isn't available, assume yes + return True + with f: + for line in f: + head, _, body = line.partition(':') + if head.strip() == 'flags' and 'avx' in body.split(): + return True + else: + return False + + +class _OptLevel(int): + """This class holds the "optimisation level" set in `NUMBA_OPT`. As this env + var can be an int or a string, but is almost always interpreted as an int, + this class subclasses int so as to get the common behaviour but stores the + actual value as a `_raw_value` member. The value "max" is a special case + and the property `is_opt_max` can be queried to find if the optimisation + level (supplied value at construction time) is "max".""" + + def __new__(cls, *args, **kwargs): + assert len(args) == 1 + (value,) = args + _int_value = 3 if value == 'max' else int(value) + # the int ctor is always called with an appropriate integer value + new = super().__new__(cls, _int_value, **kwargs) + # raw value is max or int + new._raw_value = value if value == 'max' else _int_value + return new + + @property + def is_opt_max(self): + """Returns True if the the optimisation level is "max" False + otherwise.""" + return self._raw_value == "max" + + def __repr__(self): + if isinstance(self._raw_value, str): + arg = f"'{self._raw_value}'" + else: + arg = self._raw_value + return f"_OptLevel({arg})" + + +def _process_opt_level(opt_level): + + if opt_level not in ('0', '1', '2', '3', 'max'): + msg = ("Environment variable `NUMBA_OPT` is set to an unsupported " + f"value '{opt_level}', supported values are 0, 1, 2, 3, and " + "'max'") + raise ValueError(msg) + else: + return _OptLevel(opt_level) + + +class _EnvReloader(object): + + def __init__(self): + self.reset() + + def reset(self): + self.old_environ = {} + self.update(force=True) + + def update(self, force=False): + new_environ = {} + + # first check if there's a .numba_config.yaml and use values from that + if os.path.exists(_config_fname) and os.path.isfile(_config_fname): + if not _HAVE_YAML: + msg = ("A Numba config file is found but YAML parsing " + "capabilities appear to be missing. " + "To use this feature please install `pyyaml`. e.g. " + "`conda install pyyaml`.") + warnings.warn(msg) + else: + with open(_config_fname, 'rt') as f: + y_conf = yaml.safe_load(f) + if y_conf is not None: + for k, v in y_conf.items(): + new_environ['NUMBA_' + k.upper()] = v + + # clobber file based config with any locally defined env vars + for name, value in os.environ.items(): + if name.startswith('NUMBA_'): + new_environ[name] = value + # We update the config variables if at least one NUMBA environment + # variable was modified. This lets the user modify values + # directly in the config module without having them when + # reload_config() is called by the compiler. + if force or self.old_environ != new_environ: + self.process_environ(new_environ) + # Store a copy + self.old_environ = dict(new_environ) + + self.validate() + + def validate(self): + global CUDA_USE_NVIDIA_BINDING + + if CUDA_USE_NVIDIA_BINDING: # noqa: F821 + try: + import cuda # noqa: F401 + except ImportError as ie: + msg = ("CUDA Python bindings requested (the environment " + "variable NUMBA_CUDA_USE_NVIDIA_BINDING is set), " + f"but they are not importable: {ie.msg}.") + warnings.warn(msg) + + CUDA_USE_NVIDIA_BINDING = False + + if CUDA_PER_THREAD_DEFAULT_STREAM: # noqa: F821 + warnings.warn("PTDS support is handled by CUDA Python when " + "using the NVIDIA binding. Please set the " + "environment variable " + "CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM to 1 " + "instead.") + + def process_environ(self, environ): + def _readenv(name, ctor, default): + value = environ.get(name) + if value is None: + return default() if callable(default) else default + try: + return ctor(value) + except Exception: + warnings.warn(f"Environment variable '{name}' is defined but " + f"its associated value '{value}' could not be " + "parsed.\nThe parse failed with exception:\n" + f"{traceback.format_exc()}", + RuntimeWarning) + return default + + def optional_str(x): + return str(x) if x is not None else None + + # Type casting rules selection + USE_LEGACY_TYPE_SYSTEM = _readenv( + "NUMBA_USE_LEGACY_TYPE_SYSTEM", int, 1 + ) + + # developer mode produces full tracebacks, disables help instructions + DEVELOPER_MODE = _readenv("NUMBA_DEVELOPER_MODE", int, 0) + + # disable performance warnings, will switch of the generation of + # warnings of the class NumbaPerformanceWarning + DISABLE_PERFORMANCE_WARNINGS = _readenv( + "NUMBA_DISABLE_PERFORMANCE_WARNINGS", int, 0) + + # Flag to enable full exception reporting + FULL_TRACEBACKS = _readenv( + "NUMBA_FULL_TRACEBACKS", int, DEVELOPER_MODE) + + # Show help text when an error occurs + SHOW_HELP = _readenv("NUMBA_SHOW_HELP", int, 0) + + # The color scheme to use for error messages, default is no color + # just bold fonts in use. + COLOR_SCHEME = _readenv("NUMBA_COLOR_SCHEME", str, "no_color") + + # Whether to globally enable bounds checking. The default None means + # to use the value of the flag to @njit. 0 or 1 overrides the flag + # globally. + BOUNDSCHECK = _readenv("NUMBA_BOUNDSCHECK", int, None) + + # Whether to always warn about potential uninitialized variables + # because static controlflow analysis cannot find a definition + # in one or more of the incoming paths. + ALWAYS_WARN_UNINIT_VAR = _readenv( + "NUMBA_ALWAYS_WARN_UNINIT_VAR", int, 0, + ) + + # Whether to warn about kernel launches where the grid size will + # under utilize the GPU due to low occupancy. On by default. + CUDA_LOW_OCCUPANCY_WARNINGS = _readenv( + "NUMBA_CUDA_LOW_OCCUPANCY_WARNINGS", int, 1) + + # Whether to use the official CUDA Python API Bindings + CUDA_USE_NVIDIA_BINDING = _readenv( + "NUMBA_CUDA_USE_NVIDIA_BINDING", int, 0) + + # Debug flag to control compiler debug print + DEBUG = _readenv("NUMBA_DEBUG", int, 0) + + # DEBUG print IR after pass names + DEBUG_PRINT_AFTER = _readenv("NUMBA_DEBUG_PRINT_AFTER", str, "none") + + # DEBUG print IR before pass names + DEBUG_PRINT_BEFORE = _readenv("NUMBA_DEBUG_PRINT_BEFORE", str, "none") + + # DEBUG print IR before and after pass names + DEBUG_PRINT_WRAP = _readenv("NUMBA_DEBUG_PRINT_WRAP", str, "none") + + # Highlighting in intermediate dumps + HIGHLIGHT_DUMPS = _readenv("NUMBA_HIGHLIGHT_DUMPS", int, 0) + + # JIT Debug flag to trigger IR instruction print + DEBUG_JIT = _readenv("NUMBA_DEBUG_JIT", int, 0) + + # Enable debugging of front-end operation + # (up to and including IR generation) + DEBUG_FRONTEND = _readenv("NUMBA_DEBUG_FRONTEND", int, 0) + + # Enable debug prints in nrtdynmod and use of "safe" API functions + DEBUG_NRT = _readenv("NUMBA_DEBUG_NRT", int, 0) + + # Enable NRT statistics counters + NRT_STATS = _readenv("NUMBA_NRT_STATS", int, 0) + + # How many recently deserialized functions to retain regardless + # of external references + FUNCTION_CACHE_SIZE = _readenv("NUMBA_FUNCTION_CACHE_SIZE", int, 128) + + # Maximum tuple size that parfors will unpack and pass to + # internal gufunc. + PARFOR_MAX_TUPLE_SIZE = _readenv("NUMBA_PARFOR_MAX_TUPLE_SIZE", + int, 100) + + # Enable logging of cache operation + DEBUG_CACHE = _readenv("NUMBA_DEBUG_CACHE", int, DEBUG) + + # Redirect cache directory + # Contains path to the directory + CACHE_DIR = _readenv("NUMBA_CACHE_DIR", str, "") + + # Enable tracing support + TRACE = _readenv("NUMBA_TRACE", int, 0) + + # Enable chrome tracing support + CHROME_TRACE = _readenv("NUMBA_CHROME_TRACE", str, "") + + # Enable debugging of type inference + DEBUG_TYPEINFER = _readenv("NUMBA_DEBUG_TYPEINFER", int, 0) + + # Configure compilation target to use the specified CPU name + # and CPU feature as the host information. + # Note: this overrides "host" option for AOT compilation. + CPU_NAME = _readenv("NUMBA_CPU_NAME", optional_str, None) + CPU_FEATURES = _readenv("NUMBA_CPU_FEATURES", optional_str, + ("" if str(CPU_NAME).lower() == 'generic' + else None)) + # Optimization level + OPT = _readenv("NUMBA_OPT", _process_opt_level, _OptLevel(3)) + + # Force dump of Python bytecode + DUMP_BYTECODE = _readenv("NUMBA_DUMP_BYTECODE", int, DEBUG_FRONTEND) + + # Force dump of control flow graph + DUMP_CFG = _readenv("NUMBA_DUMP_CFG", int, DEBUG_FRONTEND) + + # Force dump of Numba IR + DUMP_IR = _readenv("NUMBA_DUMP_IR", int, + DEBUG_FRONTEND) + + # Force dump of Numba IR in SSA form + DUMP_SSA = _readenv("NUMBA_DUMP_SSA", int, + DEBUG_FRONTEND or DEBUG_TYPEINFER) + + # print debug info of analysis and optimization on array operations + DEBUG_ARRAY_OPT = _readenv("NUMBA_DEBUG_ARRAY_OPT", int, 0) + + # insert debug stmts to print information at runtime + DEBUG_ARRAY_OPT_RUNTIME = _readenv( + "NUMBA_DEBUG_ARRAY_OPT_RUNTIME", int, 0) + + # print stats about parallel for-loops + DEBUG_ARRAY_OPT_STATS = _readenv("NUMBA_DEBUG_ARRAY_OPT_STATS", int, 0) + + # prints user friendly information about parallel + PARALLEL_DIAGNOSTICS = _readenv("NUMBA_PARALLEL_DIAGNOSTICS", int, 0) + + # print debug info of inline closure pass + DEBUG_INLINE_CLOSURE = _readenv("NUMBA_DEBUG_INLINE_CLOSURE", int, 0) + + # Force dump of LLVM IR + DUMP_LLVM = _readenv("NUMBA_DUMP_LLVM", int, DEBUG) + + # Force dump of Function optimized LLVM IR + DUMP_FUNC_OPT = _readenv("NUMBA_DUMP_FUNC_OPT", int, DEBUG) + + # Force dump of Optimized LLVM IR + DUMP_OPTIMIZED = _readenv("NUMBA_DUMP_OPTIMIZED", int, DEBUG) + + # Force disable loop vectorize + LOOP_VECTORIZE = _readenv("NUMBA_LOOP_VECTORIZE", int, 1) + + # Enable superword-level parallelism vectorization, default is off + # since #8705 (miscompilation). + SLP_VECTORIZE = _readenv("NUMBA_SLP_VECTORIZE", int, 0) + + # Force dump of generated assembly + DUMP_ASSEMBLY = _readenv("NUMBA_DUMP_ASSEMBLY", int, DEBUG) + + # Force dump of type annotation + ANNOTATE = _readenv("NUMBA_DUMP_ANNOTATION", int, 0) + + # Dump IR in such as way as to aid in "diff"ing. + DIFF_IR = _readenv("NUMBA_DIFF_IR", int, 0) + + # Dump type annotation in html format + def fmt_html_path(path): + if path is None: + return path + else: + return os.path.abspath(path) + + HTML = _readenv("NUMBA_DUMP_HTML", fmt_html_path, None) + + # x86-64 specific + # Enable AVX on supported platforms where it won't degrade performance. + def avx_default(): + if not _os_supports_avx(): + return False + else: + # There are various performance issues with AVX and LLVM + # on some CPUs (list at + # http://llvm.org/bugs/buglist.cgi?quicksearch=avx). + # For now we'd rather disable it, since it can pessimize code + cpu_name = CPU_NAME or ll.get_host_cpu_name() + disabled_cpus = {'corei7-avx', 'core-avx-i', + 'sandybridge', 'ivybridge'} + # Disable known baseline CPU names that virtual machines may + # incorrectly report as having AVX support. + # This can cause problems with the SVML-pass's use of AVX512. + # See https://github.com/numba/numba/issues/9582 + disabled_cpus |= {'nocona'} + return cpu_name not in disabled_cpus + + ENABLE_AVX = _readenv("NUMBA_ENABLE_AVX", int, avx_default) + + # if set and SVML is available, it will be disabled + # By default, it's disabled on 32-bit platforms. + DISABLE_INTEL_SVML = _readenv( + "NUMBA_DISABLE_INTEL_SVML", int, IS_32BITS) + + # Disable jit for debugging + DISABLE_JIT = _readenv("NUMBA_DISABLE_JIT", int, 0) + + # choose parallel backend to use + THREADING_LAYER_PRIORITY = _readenv( + "NUMBA_THREADING_LAYER_PRIORITY", + lambda string: string.split(), + ['tbb', 'omp', 'workqueue'], + ) + THREADING_LAYER = _readenv("NUMBA_THREADING_LAYER", str, 'default') + + # CUDA Configs + + # Whether to warn about kernel launches where a host array + # is used as a parameter, forcing a copy to and from the device. + # On by default. + CUDA_WARN_ON_IMPLICIT_COPY = _readenv( + "NUMBA_CUDA_WARN_ON_IMPLICIT_COPY", int, 1) + + # Force CUDA compute capability to a specific version + FORCE_CUDA_CC = _readenv("NUMBA_FORCE_CUDA_CC", _parse_cc, None) + + # The default compute capability to target when compiling to PTX. + CUDA_DEFAULT_PTX_CC = _readenv("NUMBA_CUDA_DEFAULT_PTX_CC", _parse_cc, + (5, 0)) + + # Disable CUDA support + DISABLE_CUDA = _readenv("NUMBA_DISABLE_CUDA", + int, int(MACHINE_BITS == 32)) + + # Enable CUDA simulator + ENABLE_CUDASIM = _readenv("NUMBA_ENABLE_CUDASIM", int, 0) + + # CUDA logging level + # Any level name from the *logging* module. Case insensitive. + # Defaults to CRITICAL if not set or invalid. + # Note: This setting only applies when logging is not configured. + # Any existing logging configuration is preserved. + CUDA_LOG_LEVEL = _readenv("NUMBA_CUDA_LOG_LEVEL", str, '') + + # Include argument values in the CUDA Driver API logs + CUDA_LOG_API_ARGS = _readenv("NUMBA_CUDA_LOG_API_ARGS", int, 0) + + # Maximum number of pending CUDA deallocations (default: 10) + CUDA_DEALLOCS_COUNT = _readenv("NUMBA_CUDA_MAX_PENDING_DEALLOCS_COUNT", + int, 10) + + # Maximum ratio of pending CUDA deallocations to capacity (default: 0.2) + CUDA_DEALLOCS_RATIO = _readenv("NUMBA_CUDA_MAX_PENDING_DEALLOCS_RATIO", + float, 0.2) + + CUDA_ARRAY_INTERFACE_SYNC = _readenv("NUMBA_CUDA_ARRAY_INTERFACE_SYNC", + int, 1) + + # Path of the directory that the CUDA driver libraries are located + CUDA_DRIVER = _readenv("NUMBA_CUDA_DRIVER", str, '') + + # Buffer size for logs produced by CUDA driver operations (e.g. + # linking) + CUDA_LOG_SIZE = _readenv("NUMBA_CUDA_LOG_SIZE", int, 1024) + + # Whether to generate verbose log messages when JIT linking + CUDA_VERBOSE_JIT_LOG = _readenv("NUMBA_CUDA_VERBOSE_JIT_LOG", int, 1) + + # Whether the default stream is the per-thread default stream + CUDA_PER_THREAD_DEFAULT_STREAM = _readenv( + "NUMBA_CUDA_PER_THREAD_DEFAULT_STREAM", int, 0) + + CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY = _readenv( + "NUMBA_CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY", int, 0) + + # Location of the CUDA include files + if IS_WIN32: + cuda_path = os.environ.get('CUDA_PATH') + if cuda_path: + default_cuda_include_path = os.path.join(cuda_path, "include") + else: + default_cuda_include_path = "cuda_include_not_found" + else: + default_cuda_include_path = os.path.join(os.sep, 'usr', 'local', + 'cuda', 'include') + CUDA_INCLUDE_PATH = _readenv("NUMBA_CUDA_INCLUDE_PATH", str, + default_cuda_include_path) + + # Threading settings + + # The default number of threads to use. + def num_threads_default(): + try: + sched_getaffinity = os.sched_getaffinity + except AttributeError: + pass + else: + return max(1, len(sched_getaffinity(0))) + + cpu_count = os.cpu_count() + if cpu_count is not None: + return max(1, cpu_count) + + return 1 + + NUMBA_DEFAULT_NUM_THREADS = num_threads_default() + + # Numba thread pool size (defaults to number of CPUs on the system). + _NUMBA_NUM_THREADS = _readenv("NUMBA_NUM_THREADS", int, + NUMBA_DEFAULT_NUM_THREADS) + if ('NUMBA_NUM_THREADS' in globals() + and globals()['NUMBA_NUM_THREADS'] != _NUMBA_NUM_THREADS): + + from numba.np.ufunc import parallel + if parallel._is_initialized: + raise RuntimeError("Cannot set NUMBA_NUM_THREADS to a " + "different value once the threads have been " + "launched (currently have %s, " + "trying to set %s)" % + (_NUMBA_NUM_THREADS, + globals()['NUMBA_NUM_THREADS'])) + + NUMBA_NUM_THREADS = _NUMBA_NUM_THREADS + del _NUMBA_NUM_THREADS + + # sys.monitoring support + ENABLE_SYS_MONITORING = _readenv("NUMBA_ENABLE_SYS_MONITORING", + int, 0) + + # Profiling support + + # Indicates if a profiler detected. Only VTune can be detected for now + RUNNING_UNDER_PROFILER = 'VS_PROFILER' in os.environ + + # Enables jit events in LLVM to support profiling of dynamic code + ENABLE_PROFILING = _readenv( + "NUMBA_ENABLE_PROFILING", int, int(RUNNING_UNDER_PROFILER)) + + # Debug Info + + # The default value for the `debug` flag + DEBUGINFO_DEFAULT = _readenv("NUMBA_DEBUGINFO", int, ENABLE_PROFILING) + CUDA_DEBUGINFO_DEFAULT = _readenv("NUMBA_CUDA_DEBUGINFO", int, 0) + + EXTEND_VARIABLE_LIFETIMES = _readenv("NUMBA_EXTEND_VARIABLE_LIFETIMES", + int, 0) + + # gdb binary location + def which_gdb(path_or_bin): + gdb = shutil.which(path_or_bin) + return gdb if gdb is not None else path_or_bin + + GDB_BINARY = _readenv("NUMBA_GDB_BINARY", which_gdb, 'gdb') + + # CUDA Memory management + CUDA_MEMORY_MANAGER = _readenv("NUMBA_CUDA_MEMORY_MANAGER", str, + 'default') + + # Experimental refprune pass + LLVM_REFPRUNE_PASS = _readenv( + "NUMBA_LLVM_REFPRUNE_PASS", int, 1, + ) + LLVM_REFPRUNE_FLAGS = _readenv( + "NUMBA_LLVM_REFPRUNE_FLAGS", str, + "all" if LLVM_REFPRUNE_PASS else "", + ) + + # llvmlite memory manager + USE_LLVMLITE_MEMORY_MANAGER = _readenv( + "NUMBA_USE_LLVMLITE_MEMORY_MANAGER", int, None + ) + + # Timing support. + + # LLVM_PASS_TIMINGS enables LLVM recording of pass timings. + LLVM_PASS_TIMINGS = _readenv( + "NUMBA_LLVM_PASS_TIMINGS", int, 0, + ) + + # Coverage support. + + # JIT_COVERAGE (bool) controls whether the compiler report compiled + # lines to coverage tools. Defaults to off. + JIT_COVERAGE = _readenv( + "NUMBA_JIT_COVERAGE", int, 0, + ) + + # Inject the configuration values into the module globals + for name, value in locals().copy().items(): + if name.isupper(): + globals()[name] = value + + +_env_reloader = _EnvReloader() + + +def reload_config(): + """ + Reload the configuration from environment variables, if necessary. + """ + _env_reloader.update() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/consts.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/consts.py new file mode 100644 index 0000000000000000000000000000000000000000..d062b320893e5902ff828f68bc7d8b4221a8a9a1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/consts.py @@ -0,0 +1,118 @@ +from types import ModuleType + +import weakref + +from numba.core.errors import ConstantInferenceError, NumbaError +from numba.core import ir + + +class ConstantInference(object): + """ + A constant inference engine for a given interpreter. + Inference inspects the IR to try and compute a compile-time constant for + a variable. + + This shouldn't be used directly, instead call Interpreter.infer_constant(). + """ + + def __init__(self, func_ir): + # Avoid cyclic references as some user-visible objects may be + # held alive in the cache + self._func_ir = weakref.proxy(func_ir) + self._cache = {} + + def infer_constant(self, name, loc=None): + """ + Infer a constant value for the given variable *name*. + If no value can be inferred, numba.errors.ConstantInferenceError + is raised. + """ + if name not in self._cache: + try: + self._cache[name] = (True, self._do_infer(name)) + except ConstantInferenceError as exc: + # Store the exception args only, to avoid keeping + # a whole traceback alive. + self._cache[name] = (False, (exc.__class__, exc.args)) + success, val = self._cache[name] + if success: + return val + else: + exc, args = val + if issubclass(exc, NumbaError): + raise exc(*args, loc=loc) + else: + raise exc(*args) + + def _fail(self, val): + # The location here is set to None because `val` is the ir.Var name + # and not the actual offending use of the var. When this is raised it is + # caught in the flow control of `infer_constant` and the class and args + # (the message) are captured and then raised again but with the location + # set to the expression that caused the constant inference error. + raise ConstantInferenceError( + "Constant inference not possible for: %s" % (val,), loc=None) + + def _do_infer(self, name): + if not isinstance(name, str): + raise TypeError("infer_constant() called with non-str %r" + % (name,)) + try: + defn = self._func_ir.get_definition(name) + except KeyError: + raise ConstantInferenceError( + "no single definition for %r" % (name,)) + try: + const = defn.infer_constant() + except ConstantInferenceError: + if isinstance(defn, ir.Expr): + return self._infer_expr(defn) + self._fail(defn) + return const + + def _infer_expr(self, expr): + # Infer an expression: handle supported cases + if expr.op == 'call': + func = self.infer_constant(expr.func.name, loc=expr.loc) + return self._infer_call(func, expr) + elif expr.op == 'getattr': + value = self.infer_constant(expr.value.name, loc=expr.loc) + return self._infer_getattr(value, expr) + elif expr.op == 'build_list': + return [self.infer_constant(i.name, loc=expr.loc) for i in + expr.items] + elif expr.op == 'build_tuple': + return tuple(self.infer_constant(i.name, loc=expr.loc) for i in + expr.items) + self._fail(expr) + + def _infer_call(self, func, expr): + if expr.kws or expr.vararg: + self._fail(expr) + # Check supported callables + _slice = func in (slice,) + _exc = isinstance(func, type) and issubclass(func, BaseException) + if _slice or _exc: + args = [self.infer_constant(a.name, loc=expr.loc) for a in + expr.args] + if _slice: + return func(*args) + elif _exc: + # If the exception class is user defined it may implement a ctor + # that does not pass the args to the super. Therefore return the + # raw class and the args so this can be instantiated at the call + # site in the way the user source expects it to be. + return func, args + else: + assert 0, 'Unreachable' + + self._fail(expr) + + def _infer_getattr(self, value, expr): + if isinstance(value, (ModuleType, type)): + # Allow looking up a constant on a class or module + try: + return getattr(value, expr.attr) + except AttributeError: + pass + self._fail(expr) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/controlflow.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/controlflow.py new file mode 100644 index 0000000000000000000000000000000000000000..01db54e282a6cf49e5e4a698be6bb332befa6a58 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/controlflow.py @@ -0,0 +1,972 @@ +import collections +import functools +import sys + +from numba.core.ir import Loc +from numba.core.errors import UnsupportedError +from numba.core.utils import PYVERSION + +# List of bytecodes creating a new block in the control flow graph +# (in addition to explicit jump labels). +NEW_BLOCKERS = frozenset([ + 'SETUP_LOOP', 'FOR_ITER', 'SETUP_WITH', 'BEFORE_WITH' +]) + + +class CFBlock(object): + + def __init__(self, offset): + self.offset = offset + self.body = [] + # A map of jumps to outgoing blocks (successors): + # { offset of outgoing block -> number of stack pops } + self.outgoing_jumps = {} + # A map of jumps to incoming blocks (predecessors): + # { offset of incoming block -> number of stack pops } + self.incoming_jumps = {} + self.terminating = False + + def __repr__(self): + args = (self.offset, + sorted(self.outgoing_jumps), + sorted(self.incoming_jumps)) + return "block(offset:%d, outgoing: %s, incoming: %s)" % args + + def __iter__(self): + return iter(self.body) + + +class Loop(collections.namedtuple("Loop", + ("entries", "exits", "header", "body"))): + """ + A control flow loop, as detected by a CFGraph object. + """ + + __slots__ = () + + # The loop header is enough to detect that two loops are really + # the same, assuming they belong to the same graph. + # (note: in practice, only one loop instance is created per graph + # loop, so identity would be fine) + + def __eq__(self, other): + return isinstance(other, Loop) and other.header == self.header + + def __hash__(self): + return hash(self.header) + + +class _DictOfContainers(collections.defaultdict): + """A defaultdict with customized equality checks that ignore empty values. + + Non-empty value is checked by: `bool(value_item) == True`. + """ + + def __eq__(self, other): + if isinstance(other, _DictOfContainers): + mine = self._non_empty_items() + theirs = other._non_empty_items() + return mine == theirs + + return NotImplemented + + def __ne__(self, other): + ret = self.__eq__(other) + if ret is NotImplemented: + return ret + else: + return not ret + + def _non_empty_items(self): + return [(k, vs) for k, vs in sorted(self.items()) if vs] + + +class CFGraph(object): + """ + Generic (almost) implementation of a Control Flow Graph. + """ + + def __init__(self): + self._nodes = set() + self._preds = _DictOfContainers(set) + self._succs = _DictOfContainers(set) + self._edge_data = {} + self._entry_point = None + + def add_node(self, node): + """ + Add *node* to the graph. This is necessary before adding any + edges from/to the node. *node* can be any hashable object. + """ + self._nodes.add(node) + + def add_edge(self, src, dest, data=None): + """ + Add an edge from node *src* to node *dest*, with optional + per-edge *data*. + If such an edge already exists, it is replaced (duplicate edges + are not possible). + """ + if src not in self._nodes: + raise ValueError("Cannot add edge as src node %s not in nodes %s" % + (src, self._nodes)) + if dest not in self._nodes: + raise ValueError("Cannot add edge as dest node %s not in nodes %s" % + (dest, self._nodes)) + self._add_edge(src, dest, data) + + def successors(self, src): + """ + Yield (node, data) pairs representing the successors of node *src*. + (*data* will be None if no data was specified when adding the edge) + """ + for dest in self._succs[src]: + yield dest, self._edge_data[src, dest] + + def predecessors(self, dest): + """ + Yield (node, data) pairs representing the predecessors of node *dest*. + (*data* will be None if no data was specified when adding the edge) + """ + for src in self._preds[dest]: + yield src, self._edge_data[src, dest] + + def set_entry_point(self, node): + """ + Set the entry point of the graph to *node*. + """ + assert node in self._nodes + self._entry_point = node + + def process(self): + """ + Compute essential properties of the control flow graph. The graph + must have been fully populated, and its entry point specified. Other + graph properties are computed on-demand. + """ + if self._entry_point is None: + raise RuntimeError("no entry point defined!") + self._eliminate_dead_blocks() + + def dominators(self): + """ + Return a dictionary of {node -> set(nodes)} mapping each node to + the nodes dominating it. + + A node D dominates a node N when any path leading to N must go through D + """ + return self._doms + + def post_dominators(self): + """ + Return a dictionary of {node -> set(nodes)} mapping each node to + the nodes post-dominating it. + + A node P post-dominates a node N when any path starting from N must go + through P. + """ + return self._post_doms + + def immediate_dominators(self): + """ + Return a dictionary of {node -> node} mapping each node to its + immediate dominator (idom). + + The idom(B) is the closest strict dominator of V + """ + return self._idom + + def dominance_frontier(self): + """ + Return a dictionary of {node -> set(nodes)} mapping each node to + the nodes in its dominance frontier. + + The dominance frontier _df(N) is the set of all nodes that are + immediate successors to blocks dominated by N but which aren't + strictly dominated by N + """ + return self._df + + def dominator_tree(self): + """ + return a dictionary of {node -> set(nodes)} mapping each node to + the set of nodes it immediately dominates + + The domtree(B) is the closest strict set of nodes that B dominates + """ + return self._domtree + + @functools.cached_property + def _exit_points(self): + return self._find_exit_points() + + @functools.cached_property + def _doms(self): + return self._find_dominators() + + @functools.cached_property + def _back_edges(self): + return self._find_back_edges() + + @functools.cached_property + def _topo_order(self): + return self._find_topo_order() + + @functools.cached_property + def _descs(self): + return self._find_descendents() + + @functools.cached_property + def _loops(self): + return self._find_loops() + + @functools.cached_property + def _in_loops(self): + return self._find_in_loops() + + @functools.cached_property + def _post_doms(self): + return self._find_post_dominators() + + @functools.cached_property + def _idom(self): + return self._find_immediate_dominators() + + @functools.cached_property + def _df(self): + return self._find_dominance_frontier() + + @functools.cached_property + def _domtree(self): + return self._find_dominator_tree() + + def descendents(self, node): + """ + Return the set of descendents of the given *node*, in topological + order (ignoring back edges). + """ + return self._descs[node] + + def entry_point(self): + """ + Return the entry point node. + """ + assert self._entry_point is not None + return self._entry_point + + def exit_points(self): + """ + Return the computed set of exit nodes (may be empty). + """ + return self._exit_points + + def backbone(self): + """ + Return the set of nodes constituting the graph's backbone. + (i.e. the nodes that every path starting from the entry point + must go through). By construction, it is non-empty: it contains + at least the entry point. + """ + return self._post_doms[self._entry_point] + + def loops(self): + """ + Return a dictionary of {node -> loop} mapping each loop header + to the loop (a Loop instance) starting with it. + """ + return self._loops + + def in_loops(self, node): + """ + Return the list of Loop objects the *node* belongs to, + from innermost to outermost. + """ + return [self._loops[x] for x in self._in_loops.get(node, ())] + + def dead_nodes(self): + """ + Return the set of dead nodes (eliminated from the graph). + """ + return self._dead_nodes + + def nodes(self): + """ + Return the set of live nodes. + """ + return self._nodes + + def topo_order(self): + """ + Return the sequence of nodes in topological order (ignoring back + edges). + """ + return self._topo_order + + def topo_sort(self, nodes, reverse=False): + """ + Iterate over the *nodes* in topological order (ignoring back edges). + The sort isn't guaranteed to be stable. + """ + nodes = set(nodes) + it = self._topo_order + if reverse: + it = reversed(it) + for n in it: + if n in nodes: + yield n + + def dump(self, file=None): + """ + Dump extensive debug information. + """ + import pprint + file = file or sys.stdout + if 1: + print("CFG adjacency lists:", file=file) + self._dump_adj_lists(file) + print("CFG dominators:", file=file) + pprint.pprint(self._doms, stream=file) + print("CFG post-dominators:", file=file) + pprint.pprint(self._post_doms, stream=file) + print("CFG back edges:", sorted(self._back_edges), file=file) + print("CFG loops:", file=file) + pprint.pprint(self._loops, stream=file) + print("CFG node-to-loops:", file=file) + pprint.pprint(self._in_loops, stream=file) + print("CFG backbone:", file=file) + pprint.pprint(self.backbone(), stream=file) + + def render_dot(self, filename="numba_cfg.dot"): + """Render the controlflow graph with GraphViz DOT via the + ``graphviz`` python binding. + + Returns + ------- + g : graphviz.Digraph + Use `g.view()` to open the graph in the default PDF application. + """ + + try: + import graphviz as gv + except ImportError: + raise ImportError( + "The feature requires `graphviz` but it is not available. " + "Please install with `pip install graphviz`" + ) + g = gv.Digraph(filename=filename) + # Populate the nodes + for n in self._nodes: + g.node(str(n)) + # Populate the edges + for n in self._nodes: + for edge in self._succs[n]: + g.edge(str(n), str(edge)) + return g + + # Internal APIs + + def _add_edge(self, from_, to, data=None): + # This internal version allows adding edges to/from unregistered + # (ghost) nodes. + self._preds[to].add(from_) + self._succs[from_].add(to) + self._edge_data[from_, to] = data + + def _remove_node_edges(self, node): + for succ in self._succs.pop(node, ()): + self._preds[succ].remove(node) + del self._edge_data[node, succ] + for pred in self._preds.pop(node, ()): + self._succs[pred].remove(node) + del self._edge_data[pred, node] + + def _dfs(self, entries=None): + if entries is None: + entries = (self._entry_point,) + seen = set() + stack = list(entries) + while stack: + node = stack.pop() + if node not in seen: + yield node + seen.add(node) + for succ in self._succs[node]: + stack.append(succ) + + def _eliminate_dead_blocks(self): + """ + Eliminate all blocks not reachable from the entry point, and + stash them into self._dead_nodes. + """ + live = set() + for node in self._dfs(): + live.add(node) + self._dead_nodes = self._nodes - live + self._nodes = live + # Remove all edges leading from dead nodes + for dead in self._dead_nodes: + self._remove_node_edges(dead) + + def _find_exit_points(self): + """ + Compute the graph's exit points. + """ + exit_points = set() + for n in self._nodes: + if not self._succs.get(n): + exit_points.add(n) + return exit_points + + def _find_postorder(self): + succs = self._succs + back_edges = self._back_edges + post_order = [] + seen = set() + + post_order = [] + + # DFS + def dfs_rec(node): + if node not in seen: + seen.add(node) + stack.append((post_order.append, node)) + for dest in succs[node]: + if (node, dest) not in back_edges: + stack.append((dfs_rec, dest)) + + stack = [(dfs_rec, self._entry_point)] + while stack: + cb, data = stack.pop() + cb(data) + + return post_order + + def _find_immediate_dominators(self): + # The algorithm implemented computes the immediate dominator + # for each node in the CFG which is equivalent to build a dominator tree + # Based on the implementation from NetworkX + # library - nx.immediate_dominators + # https://github.com/networkx/networkx/blob/858e7cb183541a78969fed0cbcd02346f5866c02/networkx/algorithms/dominance.py # noqa: E501 + # References: + # Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy + # A Simple, Fast Dominance Algorithm + # https://www.cs.rice.edu/~keith/EMBED/dom.pdf + def intersect(u, v): + while u != v: + while idx[u] < idx[v]: + u = idom[u] + while idx[u] > idx[v]: + v = idom[v] + return u + + entry = self._entry_point + preds_table = self._preds + + order = self._find_postorder() + idx = {e: i for i, e in enumerate(order)} # index of each node + idom = {entry : entry} + order.pop() + order.reverse() + + changed = True + while changed: + changed = False + for u in order: + new_idom = functools.reduce(intersect, + (v for v in preds_table[u] + if v in idom)) + if u not in idom or idom[u] != new_idom: + idom[u] = new_idom + changed = True + + return idom + + def _find_dominator_tree(self): + idom = self._idom + domtree = _DictOfContainers(set) + + for u, v in idom.items(): + # v dominates u + if u not in domtree: + domtree[u] = set() + if u != v: + domtree[v].add(u) + + return domtree + + def _find_dominance_frontier(self): + idom = self._idom + preds_table = self._preds + df = {u: set() for u in idom} + + for u in idom: + if len(preds_table[u]) < 2: + continue + for v in preds_table[u]: + while v != idom[u]: + df[v].add(u) + v = idom[v] + + return df + + def _find_dominators_internal(self, post=False): + # See theoretical description in + # http://en.wikipedia.org/wiki/Dominator_%28graph_theory%29 + # The algorithm implemented here uses a todo-list as described + # in http://pages.cs.wisc.edu/~fischer/cs701.f08/finding.loops.html + if post: + entries = set(self._exit_points) + preds_table = self._succs + succs_table = self._preds + else: + entries = set([self._entry_point]) + preds_table = self._preds + succs_table = self._succs + + if not entries: + raise RuntimeError("no entry points: dominator algorithm " + "cannot be seeded") + + doms = {} + for e in entries: + doms[e] = set([e]) + + todo = [] + for n in self._nodes: + if n not in entries: + doms[n] = set(self._nodes) + todo.append(n) + + while todo: + n = todo.pop() + if n in entries: + continue + new_doms = set([n]) + preds = preds_table[n] + if preds: + new_doms |= functools.reduce(set.intersection, + [doms[p] for p in preds]) + if new_doms != doms[n]: + assert len(new_doms) < len(doms[n]) + doms[n] = new_doms + todo.extend(succs_table[n]) + return doms + + def _find_dominators(self): + return self._find_dominators_internal(post=False) + + def _find_post_dominators(self): + # To handle infinite loops correctly, we need to add a dummy + # exit point, and link members of infinite loops to it. + dummy_exit = object() + self._exit_points.add(dummy_exit) + for loop in self._loops.values(): + if not loop.exits: + for b in loop.body: + self._add_edge(b, dummy_exit) + pdoms = self._find_dominators_internal(post=True) + # Fix the _post_doms table to make no reference to the dummy exit + del pdoms[dummy_exit] + for doms in pdoms.values(): + doms.discard(dummy_exit) + self._remove_node_edges(dummy_exit) + self._exit_points.remove(dummy_exit) + return pdoms + + # Finding loops and back edges: see + # http://pages.cs.wisc.edu/~fischer/cs701.f08/finding.loops.html + + def _find_back_edges(self, stats=None): + """ + Find back edges. An edge (src, dest) is a back edge if and + only if *dest* dominates *src*. + """ + # Prepare stats to capture execution information + if stats is not None: + if not isinstance(stats, dict): + raise TypeError(f"*stats* must be a dict; got {type(stats)}") + stats.setdefault('iteration_count', 0) + + # Uses a simple DFS to find back-edges. + # The new algorithm is faster than the the previous dominator based + # algorithm. + back_edges = set() + # stack: keeps track of the traversal path + stack = [] + # succs_state: keep track of unvisited successors of a node + succs_state = {} + entry_point = self.entry_point() + + checked = set() + + def push_state(node): + stack.append(node) + succs_state[node] = [dest for dest in self._succs[node]] + + push_state(entry_point) + + # Keep track for iteration count for debugging + iter_ct = 0 + while stack: + iter_ct += 1 + tos = stack[-1] + tos_succs = succs_state[tos] + # Are there successors not checked? + if tos_succs: + # Check the next successor + cur_node = tos_succs.pop() + # Is it in our traversal path? + if cur_node in stack: + # Yes, it's a backedge + back_edges.add((tos, cur_node)) + elif cur_node not in checked: + # Push + push_state(cur_node) + else: + # Checked all successors. Pop + stack.pop() + checked.add(tos) + + if stats is not None: + stats['iteration_count'] += iter_ct + return back_edges + + def _find_topo_order(self): + succs = self._succs + back_edges = self._back_edges + post_order = [] + seen = set() + + def _dfs_rec(node): + if node not in seen: + seen.add(node) + for dest in succs[node]: + if (node, dest) not in back_edges: + _dfs_rec(dest) + post_order.append(node) + + _dfs_rec(self._entry_point) + post_order.reverse() + return post_order + + def _find_descendents(self): + descs = {} + for node in reversed(self._topo_order): + descs[node] = node_descs = set() + for succ in self._succs[node]: + if (node, succ) not in self._back_edges: + node_descs.add(succ) + node_descs.update(descs[succ]) + return descs + + def _find_loops(self): + """ + Find the loops defined by the graph's back edges. + """ + bodies = {} + for src, dest in self._back_edges: + # The destination of the back edge is the loop header + header = dest + # Build up the loop body from the back edge's source node, + # up to the source header. + body = set([header]) + queue = [src] + while queue: + n = queue.pop() + if n not in body: + body.add(n) + queue.extend(self._preds[n]) + # There can be several back edges to a given loop header; + # if so, merge the resulting body fragments. + if header in bodies: + bodies[header].update(body) + else: + bodies[header] = body + + # Create a Loop object for each header. + loops = {} + for header, body in bodies.items(): + entries = set() + exits = set() + for n in body: + entries.update(self._preds[n] - body) + exits.update(self._succs[n] - body) + loop = Loop(header=header, body=body, entries=entries, exits=exits) + loops[header] = loop + return loops + + def _find_in_loops(self): + loops = self._loops + # Compute the loops to which each node belongs. + in_loops = dict((n, []) for n in self._nodes) + # Sort loops from longest to shortest + # This ensures that outer loops will come before inner loops + for loop in sorted(loops.values(), key=lambda loop: len(loop.body)): + for n in loop.body: + in_loops[n].append(loop.header) + return in_loops + + def _dump_adj_lists(self, file): + adj_lists = dict((src, sorted(list(dests))) + for src, dests in self._succs.items()) + import pprint + pprint.pprint(adj_lists, stream=file) + + def __eq__(self, other): + if not isinstance(other, CFGraph): + return NotImplemented + + for x in ['_nodes', '_edge_data', '_entry_point', '_preds', '_succs']: + this = getattr(self, x, None) + that = getattr(other, x, None) + if this != that: + return False + return True + + def __ne__(self, other): + return not self.__eq__(other) + + +class ControlFlowAnalysis(object): + """ + Attributes + ---------- + - bytecode + + - blocks + + - blockseq + + - doms: dict of set + Dominators + + - backbone: set of block offsets + The set of block that is common to all possible code path. + + """ + def __init__(self, bytecode): + self.bytecode = bytecode + self.blocks = {} + self.liveblocks = {} + self.blockseq = [] + self.doms = None + self.backbone = None + # Internal temp states + self._force_new_block = True + self._curblock = None + self._blockstack = [] + self._loops = [] + self._withs = [] + + def iterblocks(self): + """ + Return all blocks in sequence of occurrence + """ + for i in self.blockseq: + yield self.blocks[i] + + def iterliveblocks(self): + """ + Return all live blocks in sequence of occurrence + """ + for i in self.blockseq: + if i in self.liveblocks: + yield self.blocks[i] + + def incoming_blocks(self, block): + """ + Yield (incoming block, number of stack pops) pairs for *block*. + """ + for i, pops in block.incoming_jumps.items(): + if i in self.liveblocks: + yield self.blocks[i], pops + + def dump(self, file=None): + self.graph.dump(file=None) + + def run(self): + for inst in self._iter_inst(): + fname = "op_%s" % inst.opname + fn = getattr(self, fname, None) + if fn is not None: + fn(inst) + elif inst.is_jump: + # this catches e.g. try... except + l = Loc(self.bytecode.func_id.filename, inst.lineno) + if inst.opname in {"SETUP_FINALLY"}: + msg = "'try' block not supported until python3.7 or later" + else: + msg = "Use of unsupported opcode (%s) found" % inst.opname + raise UnsupportedError(msg, loc=l) + else: + # Non-jump instructions are ignored + pass # intentionally + + # Close all blocks + for cur, nxt in zip(self.blockseq, self.blockseq[1:]): + blk = self.blocks[cur] + if not blk.outgoing_jumps and not blk.terminating: + blk.outgoing_jumps[nxt] = 0 + + graph = CFGraph() + for b in self.blocks: + graph.add_node(b) + for b in self.blocks.values(): + for out, pops in b.outgoing_jumps.items(): + graph.add_edge(b.offset, out, pops) + graph.set_entry_point(min(self.blocks)) + graph.process() + self.graph = graph + + # Fill incoming + for b in self.blocks.values(): + for out, pops in b.outgoing_jumps.items(): + self.blocks[out].incoming_jumps[b.offset] = pops + + # Find liveblocks + self.liveblocks = dict((i, self.blocks[i]) + for i in self.graph.nodes()) + + for lastblk in reversed(self.blockseq): + if lastblk in self.liveblocks: + break + else: + raise AssertionError("No live block that exits!?") + + # Find backbone + backbone = self.graph.backbone() + # Filter out in loop blocks (Assuming no other cyclic control blocks) + # This is to unavoid variable defined in loops to be considered as + # function scope. + inloopblocks = set() + + for b in self.blocks.keys(): + if self.graph.in_loops(b): + inloopblocks.add(b) + + self.backbone = backbone - inloopblocks + + def jump(self, target, pops=0): + """ + Register a jump (conditional or not) to *target* offset. + *pops* is the number of stack pops implied by the jump (default 0). + """ + self._curblock.outgoing_jumps[target] = pops + + def _iter_inst(self): + for inst in self.bytecode: + if self._use_new_block(inst): + self._guard_with_as(inst) + self._start_new_block(inst) + self._curblock.body.append(inst.offset) + yield inst + + def _use_new_block(self, inst): + if inst.offset in self.bytecode.labels: + res = True + elif inst.opname in NEW_BLOCKERS: + res = True + else: + res = self._force_new_block + + self._force_new_block = False + return res + + def _start_new_block(self, inst): + self._curblock = CFBlock(inst.offset) + self.blocks[inst.offset] = self._curblock + self.blockseq.append(inst.offset) + + def _guard_with_as(self, current_inst): + """Checks if the next instruction after a SETUP_WITH is something other + than a POP_TOP, if it is something else it'll be some sort of store + which is not supported (this corresponds to `with CTXMGR as VAR(S)`).""" + if current_inst.opname == "SETUP_WITH": + next_op = self.bytecode[current_inst.next].opname + if next_op != "POP_TOP": + msg = ("The 'with (context manager) as " + "(variable):' construct is not " + "supported.") + raise UnsupportedError(msg) + + def op_SETUP_LOOP(self, inst): + end = inst.get_jump_target() + self._blockstack.append(end) + self._loops.append((inst.offset, end)) + # TODO: Looplifting requires the loop entry be its own block. + # Forcing a new block here is the simplest solution for now. + # But, we should consider other less ad-hoc ways. + self.jump(inst.next) + self._force_new_block = True + + def op_SETUP_WITH(self, inst): + end = inst.get_jump_target() + self._blockstack.append(end) + self._withs.append((inst.offset, end)) + # TODO: WithLifting requires the loop entry be its own block. + # Forcing a new block here is the simplest solution for now. + # But, we should consider other less ad-hoc ways. + self.jump(inst.next) + self._force_new_block = True + + def op_POP_BLOCK(self, inst): + self._blockstack.pop() + + def op_FOR_ITER(self, inst): + self.jump(inst.get_jump_target()) + self.jump(inst.next) + self._force_new_block = True + + def _op_ABSOLUTE_JUMP_IF(self, inst): + self.jump(inst.get_jump_target()) + self.jump(inst.next) + self._force_new_block = True + + op_POP_JUMP_IF_FALSE = _op_ABSOLUTE_JUMP_IF + op_POP_JUMP_IF_TRUE = _op_ABSOLUTE_JUMP_IF + op_JUMP_IF_FALSE = _op_ABSOLUTE_JUMP_IF + op_JUMP_IF_TRUE = _op_ABSOLUTE_JUMP_IF + + op_POP_JUMP_FORWARD_IF_FALSE = _op_ABSOLUTE_JUMP_IF + op_POP_JUMP_BACKWARD_IF_FALSE = _op_ABSOLUTE_JUMP_IF + op_POP_JUMP_FORWARD_IF_TRUE = _op_ABSOLUTE_JUMP_IF + op_POP_JUMP_BACKWARD_IF_TRUE = _op_ABSOLUTE_JUMP_IF + + def _op_ABSOLUTE_JUMP_OR_POP(self, inst): + self.jump(inst.get_jump_target()) + self.jump(inst.next, pops=1) + self._force_new_block = True + + op_JUMP_IF_FALSE_OR_POP = _op_ABSOLUTE_JUMP_OR_POP + op_JUMP_IF_TRUE_OR_POP = _op_ABSOLUTE_JUMP_OR_POP + + def op_JUMP_ABSOLUTE(self, inst): + self.jump(inst.get_jump_target()) + self._force_new_block = True + + def op_JUMP_FORWARD(self, inst): + self.jump(inst.get_jump_target()) + self._force_new_block = True + + op_JUMP_BACKWARD = op_JUMP_FORWARD + + def op_RETURN_VALUE(self, inst): + self._curblock.terminating = True + self._force_new_block = True + + if PYVERSION in ((3, 12), (3, 13)): + def op_RETURN_CONST(self, inst): + self._curblock.terminating = True + self._force_new_block = True + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def op_RAISE_VARARGS(self, inst): + self._curblock.terminating = True + self._force_new_block = True + + def op_BREAK_LOOP(self, inst): + self.jump(self._blockstack[-1]) + self._force_new_block = True diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/cpu.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/cpu.py new file mode 100644 index 0000000000000000000000000000000000000000..2d0d4b0dc6138ff146fb2c6f8a762477874279b0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/cpu.py @@ -0,0 +1,325 @@ +import platform + +import llvmlite.binding as ll +from llvmlite import ir + +from numba import _dynfunc +from numba.core.callwrapper import PyCallWrapper +from numba.core.base import BaseContext +from numba.core import (utils, types, config, cgutils, callconv, codegen, + externals, fastmathpass, intrinsics) +from numba.core.options import TargetOptions, include_default_options +from numba.core.runtime import rtsys +from numba.core.compiler_lock import global_compiler_lock +import numba.core.entrypoints +# Re-export these options, they are used from the cpu module throughout the code +# base. +from numba.core.cpu_options import (ParallelOptions, # noqa F401 + FastMathOptions, InlineOptions) # noqa F401 +from numba.np import ufunc_db + +# Keep those structures in sync with _dynfunc.c. + + +class ClosureBody(cgutils.Structure): + _fields = [('env', types.pyobject)] + + +class EnvBody(cgutils.Structure): + _fields = [ + ('globals', types.pyobject), + ('consts', types.pyobject), + ] + + +class CPUContext(BaseContext): + """ + Changes BaseContext calling convention + """ + allow_dynamic_globals = True + + def __init__(self, typingctx, target='cpu'): + super().__init__(typingctx, target) + + # Overrides + def create_module(self, name): + return self._internal_codegen._create_empty_module(name) + + @global_compiler_lock + def init(self): + self.is32bit = (utils.MACHINE_BITS == 32) + self._internal_codegen = codegen.JITCPUCodegen("numba.exec") + + # Add ARM ABI functions from libgcc_s + if platform.machine() == 'armv7l': + ll.load_library_permanently('libgcc_s.so.1') + + # Map external C functions. + externals.c_math_functions.install(self) + + def load_additional_registries(self): + # Only initialize the NRT once something is about to be compiled. The + # "initialized" state doesn't need to be threadsafe, there's a lock + # around the internal compilation and the rtsys.initialize call can be + # made multiple times, worse case init just gets called a bit more often + # than optimal. + rtsys.initialize(self) + + # Add implementations that work via import + from numba.cpython import (builtins, charseq, enumimpl, # noqa F401 + hashing, heapq, iterators, # noqa F401 + listobj, numbers, rangeobj, # noqa F401 + setobj, slicing, tupleobj, # noqa F401 + unicode,) # noqa F401 + from numba.core import optional, inline_closurecall # noqa F401 + from numba.misc import gdb_hook, literal # noqa F401 + from numba.np import linalg, arraymath, arrayobj # noqa F401 + from numba.np.random import generator_core, generator_methods # noqa F401 + from numba.np.polynomial import polynomial_core, polynomial_functions # noqa F401 + from numba.typed import typeddict, dictimpl # noqa F401 + from numba.typed import typedlist, listobject # noqa F401 + from numba.experimental import jitclass, function_type # noqa F401 + from numba.np import npdatetime # noqa F401 + + # Add target specific implementations + from numba.np import npyimpl + from numba.cpython import cmathimpl, mathimpl, printimpl, randomimpl + from numba.misc import cffiimpl + from numba.experimental.jitclass.base import ClassBuilder as \ + jitclassimpl + self.install_registry(cmathimpl.registry) + self.install_registry(cffiimpl.registry) + self.install_registry(mathimpl.registry) + self.install_registry(npyimpl.registry) + self.install_registry(printimpl.registry) + self.install_registry(randomimpl.registry) + self.install_registry(jitclassimpl.class_impl_registry) + + # load 3rd party extensions + numba.core.entrypoints.init_all() + + # fix for #8940 + from numba.np.unsafe import ndarray # noqa F401 + + @property + def target_data(self): + return self._internal_codegen.target_data + + def with_aot_codegen(self, name, **aot_options): + aot_codegen = codegen.AOTCPUCodegen(name, **aot_options) + return self.subtarget(_internal_codegen=aot_codegen, + aot_mode=True) + + def codegen(self): + return self._internal_codegen + + @property + def call_conv(self): + return callconv.CPUCallConv(self) + + def get_env_body(self, builder, envptr): + """ + From the given *envptr* (a pointer to a _dynfunc.Environment object), + get a EnvBody allowing structured access to environment fields. + """ + body_ptr = cgutils.pointer_add( + builder, envptr, _dynfunc._impl_info['offsetof_env_body']) + return EnvBody(self, builder, ref=body_ptr, cast_ref=True) + + def get_env_manager(self, builder, return_pyobject=False): + envgv = self.declare_env_global(builder.module, + self.get_env_name(self.fndesc)) + envarg = builder.load(envgv) + pyapi = self.get_python_api(builder) + pyapi.emit_environment_sentry( + envarg, + return_pyobject=return_pyobject, + debug_msg=self.fndesc.env_name, + ) + env_body = self.get_env_body(builder, envarg) + return pyapi.get_env_manager(self.environment, env_body, envarg) + + def get_generator_state(self, builder, genptr, return_type): + """ + From the given *genptr* (a pointer to a _dynfunc.Generator object), + get a pointer to its state area. + """ + return cgutils.pointer_add( + builder, genptr, _dynfunc._impl_info['offsetof_generator_state'], + return_type=return_type) + + def build_list(self, builder, list_type, items): + """ + Build a list from the Numba *list_type* and its initial *items*. + """ + from numba.cpython import listobj + return listobj.build_list(self, builder, list_type, items) + + def build_set(self, builder, set_type, items): + """ + Build a set from the Numba *set_type* and its initial *items*. + """ + from numba.cpython import setobj + return setobj.build_set(self, builder, set_type, items) + + def build_map(self, builder, dict_type, item_types, items): + from numba.typed import dictobject + + return dictobject.build_map(self, builder, dict_type, item_types, items) + + def post_lowering(self, mod, library): + if self.fastmath: + fastmathpass.rewrite_module(mod, self.fastmath) + + if self.is32bit: + # 32-bit machine needs to replace all 64-bit div/rem to avoid + # calls to compiler-rt + intrinsics.fix_divmod(mod) + + library.add_linking_library(rtsys.library) + + def create_cpython_wrapper(self, library, fndesc, env, call_helper, + release_gil=False): + wrapper_module = self.create_module("wrapper") + fnty = self.call_conv.get_function_type(fndesc.restype, fndesc.argtypes) + wrapper_callee = ir.Function(wrapper_module, fnty, + fndesc.llvm_func_name) + builder = PyCallWrapper(self, wrapper_module, wrapper_callee, + fndesc, env, call_helper=call_helper, + release_gil=release_gil) + builder.build() + library.add_ir_module(wrapper_module) + + def create_cfunc_wrapper(self, library, fndesc, env, call_helper): + wrapper_module = self.create_module("cfunc_wrapper") + fnty = self.call_conv.get_function_type(fndesc.restype, fndesc.argtypes) + wrapper_callee = ir.Function(wrapper_module, fnty, + fndesc.llvm_func_name) + + ll_argtypes = [self.get_value_type(ty) for ty in fndesc.argtypes] + ll_return_type = self.get_value_type(fndesc.restype) + wrapty = ir.FunctionType(ll_return_type, ll_argtypes) + wrapfn = ir.Function(wrapper_module, wrapty, + fndesc.llvm_cfunc_wrapper_name) + builder = ir.IRBuilder(wrapfn.append_basic_block('entry')) + + status, out = self.call_conv.call_function( + builder, wrapper_callee, fndesc.restype, fndesc.argtypes, + wrapfn.args, attrs=('noinline',)) + + with builder.if_then(status.is_error, likely=False): + # If (and only if) an error occurred, acquire the GIL + # and use the interpreter to write out the exception. + pyapi = self.get_python_api(builder) + gil_state = pyapi.gil_ensure() + self.call_conv.raise_error(builder, pyapi, status) + cstr = self.insert_const_string(builder.module, repr(self)) + strobj = pyapi.string_from_string(cstr) + pyapi.err_write_unraisable(strobj) + pyapi.decref(strobj) + pyapi.gil_release(gil_state) + + builder.ret(out) + library.add_ir_module(wrapper_module) + + def get_executable(self, library, fndesc, env): + """ + Returns + ------- + (cfunc, fnptr) + + - cfunc + callable function (Can be None) + - fnptr + callable function address + - env + an execution environment (from _dynfunc) + """ + # Code generation + fnptr = library.get_pointer_to_function( + fndesc.llvm_cpython_wrapper_name) + + # Note: we avoid reusing the original docstring to avoid encoding + # issues on Python 2, see issue #1908 + doc = "compiled wrapper for %r" % (fndesc.qualname,) + cfunc = _dynfunc.make_function(fndesc.lookup_module(), + fndesc.qualname.split('.')[-1], + doc, fnptr, env, + # objects to keepalive with the function + (library,) + ) + library.codegen.set_env(self.get_env_name(fndesc), env) + return cfunc + + def calc_array_sizeof(self, ndim): + ''' + Calculate the size of an array struct on the CPU target + ''' + aryty = types.Array(types.int32, ndim, 'A') + return self.get_abi_sizeof(self.get_value_type(aryty)) + + # Overrides + def get_ufunc_info(self, ufunc_key): + return ufunc_db.get_ufunc_info(ufunc_key) + + +# ---------------------------------------------------------------------------- +# TargetOptions + +_options_mixin = include_default_options( + "nopython", + "forceobj", + "looplift", + "_nrt", + "debug", + "boundscheck", + "nogil", + "no_rewrites", + "no_cpython_wrapper", + "no_cfunc_wrapper", + "parallel", + "fastmath", + "error_model", + "inline", + "forceinline", + "_dbg_extend_lifetimes", + "_dbg_optnone", +) + + +class CPUTargetOptions(_options_mixin, TargetOptions): + def finalize(self, flags, options): + if not flags.is_set("enable_pyobject"): + flags.enable_pyobject = True + + if not flags.is_set("enable_looplift"): + flags.enable_looplift = True + + flags.inherit_if_not_set("nrt", default=True) + + if not flags.is_set("debuginfo"): + flags.debuginfo = config.DEBUGINFO_DEFAULT + + if not flags.is_set("dbg_extend_lifetimes"): + if flags.debuginfo: + # auto turn on extend-lifetimes if debuginfo is on and + # dbg_extend_lifetimes is not set + flags.dbg_extend_lifetimes = True + else: + # set flag using env-var config + flags.dbg_extend_lifetimes = config.EXTEND_VARIABLE_LIFETIMES + + if not flags.is_set("boundscheck"): + flags.boundscheck = flags.debuginfo + + flags.enable_pyobject_looplift = True + + flags.inherit_if_not_set("fastmath") + + flags.inherit_if_not_set("error_model", default="python") + + flags.inherit_if_not_set("forceinline") + + if flags.forceinline: + # forceinline turns off optnone, just like clang. + flags.dbg_optnone = False diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/cpu_options.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/cpu_options.py new file mode 100644 index 0000000000000000000000000000000000000000..e2136c3194b44542072d69d9f5d8cd2736171886 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/cpu_options.py @@ -0,0 +1,181 @@ +""" +Defines CPU Options for use in the CPU target +""" +from abc import ABCMeta, abstractmethod + + +class AbstractOptionValue(metaclass=ABCMeta): + """Abstract base class for custom option values. + """ + @abstractmethod + def encode(self) -> str: + """Returns an encoding of the values + """ + ... + + def __repr__(self) -> str: + return f"{self.__class__.__name__}({self.encode()})" + + +class FastMathOptions(AbstractOptionValue): + """ + Options for controlling fast math optimization. + """ + + def __init__(self, value): + # https://releases.llvm.org/7.0.0/docs/LangRef.html#fast-math-flags + valid_flags = { + 'fast', + 'nnan', 'ninf', 'nsz', 'arcp', + 'contract', 'afn', 'reassoc', + } + + if isinstance(value, FastMathOptions): + self.flags = value.flags.copy() + elif value is True: + self.flags = {'fast'} + elif value is False: + self.flags = set() + elif isinstance(value, set): + invalid = value - valid_flags + if invalid: + raise ValueError("Unrecognized fastmath flags: %s" % invalid) + self.flags = value + elif isinstance(value, dict): + invalid = set(value.keys()) - valid_flags + if invalid: + raise ValueError("Unrecognized fastmath flags: %s" % invalid) + self.flags = {v for v, enable in value.items() if enable} + else: + msg = "Expected fastmath option(s) to be either a bool, dict or set" + raise ValueError(msg) + + def __bool__(self): + return bool(self.flags) + + __nonzero__ = __bool__ + + def encode(self) -> str: + return str(self.flags) + + def __eq__(self, other): + if type(other) is type(self): + return self.flags == other.flags + return NotImplemented + + +class ParallelOptions(AbstractOptionValue): + """ + Options for controlling auto parallelization. + """ + __slots__ = ("enabled", "comprehension", "reduction", "inplace_binop", + "setitem", "numpy", "stencil", "fusion", "prange") + + def __init__(self, value): + if isinstance(value, bool): + self.enabled = value + self.comprehension = value + self.reduction = value + self.inplace_binop = value + self.setitem = value + self.numpy = value + self.stencil = value + self.fusion = value + self.prange = value + elif isinstance(value, dict): + self.enabled = True + self.comprehension = value.pop('comprehension', True) + self.reduction = value.pop('reduction', True) + self.inplace_binop = value.pop('inplace_binop', True) + self.setitem = value.pop('setitem', True) + self.numpy = value.pop('numpy', True) + self.stencil = value.pop('stencil', True) + self.fusion = value.pop('fusion', True) + self.prange = value.pop('prange', True) + if value: + msg = "Unrecognized parallel options: %s" % value.keys() + raise NameError(msg) + elif isinstance(value, ParallelOptions): + self.enabled = value.enabled + self.comprehension = value.comprehension + self.reduction = value.reduction + self.inplace_binop = value.inplace_binop + self.setitem = value.setitem + self.numpy = value.numpy + self.stencil = value.stencil + self.fusion = value.fusion + self.prange = value.prange + else: + msg = "Expect parallel option to be either a bool or a dict" + raise ValueError(msg) + + def _get_values(self): + """Get values as dictionary. + """ + return {k: getattr(self, k) for k in self.__slots__} + + def __eq__(self, other): + if type(other) is type(self): + return self._get_values() == other._get_values() + return NotImplemented + + def encode(self) -> str: + return ", ".join(f"{k}={v}" for k, v in self._get_values().items()) + + +class InlineOptions(AbstractOptionValue): + """ + Options for controlling inlining + """ + + def __init__(self, value): + ok = False + if isinstance(value, str): + if value in ('always', 'never'): + ok = True + else: + ok = hasattr(value, '__call__') + + if ok: + self._inline = value + else: + msg = ("kwarg 'inline' must be one of the strings 'always' or " + "'never', or it can be a callable that returns True/False. " + "Found value %s" % value) + raise ValueError(msg) + + @property + def is_never_inline(self): + """ + True if never inline + """ + return self._inline == 'never' + + @property + def is_always_inline(self): + """ + True if always inline + """ + return self._inline == 'always' + + @property + def has_cost_model(self): + """ + True if a cost model is provided + """ + return not (self.is_always_inline or self.is_never_inline) + + @property + def value(self): + """ + The raw value + """ + return self._inline + + def __eq__(self, other): + if type(other) is type(self): + return self.value == other.value + return NotImplemented + + def encode(self) -> str: + return repr(self._inline) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/debuginfo.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/debuginfo.py new file mode 100644 index 0000000000000000000000000000000000000000..7970fc8e626995814def48ffe524e133e11477d6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/debuginfo.py @@ -0,0 +1,456 @@ +""" +Implements helpers to build LLVM debuginfo. +""" + + +import abc +import os.path +from contextlib import contextmanager + +from llvmlite import ir +from numba.core import cgutils, types +from numba.core.datamodel.models import ComplexModel, UniTupleModel +from numba.core import config + + +@contextmanager +def suspend_emission(builder): + """Suspends the emission of debug_metadata for the duration of the context + managed block.""" + ref = builder.debug_metadata + builder.debug_metadata = None + try: + yield + finally: + builder.debug_metadata = ref + + +class AbstractDIBuilder(metaclass=abc.ABCMeta): + @abc.abstractmethod + def mark_variable(self, builder, allocavalue, name, lltype, size, line, + datamodel=None, argidx=None): + """Emit debug info for the variable. + """ + pass + + @abc.abstractmethod + def mark_location(self, builder, line): + """Emit source location information to the given IRBuilder. + """ + pass + + @abc.abstractmethod + def mark_subprogram(self, function, qualname, argnames, argtypes, line): + """Emit source location information for the given function. + """ + pass + + @abc.abstractmethod + def initialize(self): + """Initialize the debug info. An opportunity for the debuginfo to + prepare any necessary data structures. + """ + + @abc.abstractmethod + def finalize(self): + """Finalize the debuginfo by emitting all necessary metadata. + """ + pass + + +class DummyDIBuilder(AbstractDIBuilder): + + def __init__(self, module, filepath, cgctx, directives_only): + pass + + def mark_variable(self, builder, allocavalue, name, lltype, size, line, + datamodel=None, argidx=None): + pass + + def mark_location(self, builder, line): + pass + + def mark_subprogram(self, function, qualname, argnames, argtypes, line): + pass + + def initialize(self): + pass + + def finalize(self): + pass + + +_BYTE_SIZE = 8 + + +class DIBuilder(AbstractDIBuilder): + DWARF_VERSION = 4 + DEBUG_INFO_VERSION = 3 + DBG_CU_NAME = 'llvm.dbg.cu' + _DEBUG = False + + def __init__(self, module, filepath, cgctx, directives_only): + self.module = module + self.filepath = os.path.abspath(filepath) + self.difile = self._di_file() + self.subprograms = [] + self.cgctx = cgctx + + if directives_only: + self.emission_kind = 'DebugDirectivesOnly' + else: + self.emission_kind = 'FullDebug' + + self.initialize() + + def initialize(self): + # Create the compile unit now because it is referenced when + # constructing subprograms + self.dicompileunit = self._di_compile_unit() + + def _var_type(self, lltype, size, datamodel=None): + if self._DEBUG: + print("-->", lltype, size, datamodel, + getattr(datamodel, 'fe_type', 'NO FE TYPE')) + m = self.module + bitsize = _BYTE_SIZE * size + + int_type = ir.IntType, + real_type = ir.FloatType, ir.DoubleType + # For simple numeric types, choose the closest encoding. + # We treat all integers as unsigned when there's no known datamodel. + if isinstance(lltype, int_type + real_type): + if datamodel is None: + # This is probably something like an `i8*` member of a struct + name = str(lltype) + if isinstance(lltype, int_type): + ditok = 'DW_ATE_unsigned' + else: + ditok = 'DW_ATE_float' + else: + # This is probably a known int/float scalar type + name = str(datamodel.fe_type) + if isinstance(datamodel.fe_type, types.Integer): + if datamodel.fe_type.signed: + ditok = 'DW_ATE_signed' + else: + ditok = 'DW_ATE_unsigned' + else: + ditok = 'DW_ATE_float' + mdtype = m.add_debug_info('DIBasicType', { + 'name': name, + 'size': bitsize, + 'encoding': ir.DIToken(ditok), + }) + elif isinstance(datamodel, ComplexModel): + # TODO: Is there a better way of determining "this is a complex + # number"? + # + # NOTE: Commented below is the way to generate the metadata for a + # C99 complex type that's directly supported by DWARF. Numba however + # generates a struct with real/imag cf. CPython to give a more + # pythonic feel to inspection. + # + # mdtype = m.add_debug_info('DIBasicType', { + # 'name': f"{datamodel.fe_type} ({str(lltype)})", + # 'size': bitsize, + # 'encoding': ir.DIToken('DW_ATE_complex_float'), + #}) + meta = [] + offset = 0 + for ix, name in enumerate(('real', 'imag')): + component = lltype.elements[ix] + component_size = self.cgctx.get_abi_sizeof(component) + component_basetype = m.add_debug_info('DIBasicType', { + 'name': str(component), + 'size': _BYTE_SIZE * component_size, # bits + 'encoding': ir.DIToken('DW_ATE_float'), + }) + derived_type = m.add_debug_info('DIDerivedType', { + 'tag': ir.DIToken('DW_TAG_member'), + 'name': name, + 'baseType': component_basetype, + 'size': _BYTE_SIZE * component_size, # DW_TAG_member size is in bits + 'offset': offset, + }) + meta.append(derived_type) + offset += (_BYTE_SIZE * component_size) # offset is in bits + mdtype = m.add_debug_info('DICompositeType', { + 'tag': ir.DIToken('DW_TAG_structure_type'), + 'name': f"{datamodel.fe_type} ({str(lltype)})", + 'identifier': str(lltype), + 'elements': m.add_metadata(meta), + 'size': offset, + }, is_distinct=True) + elif isinstance(datamodel, UniTupleModel): + element = lltype.element + el_size = self.cgctx.get_abi_sizeof(element) + basetype = self._var_type(element, el_size) + name = f"{datamodel.fe_type} ({str(lltype)})" + count = size // el_size + mdrange = m.add_debug_info('DISubrange', { + 'count': count, + }) + mdtype = m.add_debug_info('DICompositeType', { + 'tag': ir.DIToken('DW_TAG_array_type'), + 'baseType': basetype, + 'name': name, + 'size': bitsize, + 'identifier': str(lltype), + 'elements': m.add_metadata([mdrange]), + }) + elif isinstance(lltype, ir.PointerType): + model = getattr(datamodel, '_pointee_model', None) + basetype = self._var_type(lltype.pointee, + self.cgctx.get_abi_sizeof(lltype.pointee), + model) + mdtype = m.add_debug_info('DIDerivedType', { + 'tag': ir.DIToken('DW_TAG_pointer_type'), + 'baseType': basetype, + 'size': _BYTE_SIZE * self.cgctx.get_abi_sizeof(lltype) + }) + elif isinstance(lltype, ir.LiteralStructType): + # Struct type + meta = [] + offset = 0 + if datamodel is None or not datamodel.inner_models(): + name = f"Anonymous struct ({str(lltype)})" + for field_id, element in enumerate(lltype.elements): + size = self.cgctx.get_abi_sizeof(element) + basetype = self._var_type(element, size) + derived_type = m.add_debug_info('DIDerivedType', { + 'tag': ir.DIToken('DW_TAG_member'), + 'name': f'', + 'baseType': basetype, + 'size': _BYTE_SIZE * size, # DW_TAG_member size is in bits + 'offset': offset, + }) + meta.append(derived_type) + offset += (_BYTE_SIZE * size) # offset is in bits + else: + name = f"{datamodel.fe_type} ({str(lltype)})" + for element, field, model in zip(lltype.elements, + datamodel._fields, + datamodel.inner_models()): + size = self.cgctx.get_abi_sizeof(element) + basetype = self._var_type(element, size, datamodel=model) + derived_type = m.add_debug_info('DIDerivedType', { + 'tag': ir.DIToken('DW_TAG_member'), + 'name': field, + 'baseType': basetype, + 'size': _BYTE_SIZE * size, # DW_TAG_member size is in bits + 'offset': offset, + }) + meta.append(derived_type) + offset += (_BYTE_SIZE * size) # offset is in bits + + mdtype = m.add_debug_info('DICompositeType', { + 'tag': ir.DIToken('DW_TAG_structure_type'), + 'name': name, + 'identifier': str(lltype), + 'elements': m.add_metadata(meta), + 'size': offset, + }, is_distinct=True) + elif isinstance(lltype, ir.ArrayType): + element = lltype.element + el_size = self.cgctx.get_abi_sizeof(element) + basetype = self._var_type(element, el_size) + count = size // el_size + mdrange = m.add_debug_info('DISubrange', { + 'count': count, + }) + mdtype = m.add_debug_info('DICompositeType', { + 'tag': ir.DIToken('DW_TAG_array_type'), + 'baseType': basetype, + 'name': str(lltype), + 'size': bitsize, + 'identifier': str(lltype), + 'elements': m.add_metadata([mdrange]), + }) + else: + # For all other types, describe it as sequence of bytes + count = size + mdrange = m.add_debug_info('DISubrange', { + 'count': count, + }) + mdbase = m.add_debug_info('DIBasicType', { + 'name': 'byte', + 'size': _BYTE_SIZE, + 'encoding': ir.DIToken('DW_ATE_unsigned_char'), + }) + mdtype = m.add_debug_info('DICompositeType', { + 'tag': ir.DIToken('DW_TAG_array_type'), + 'baseType': mdbase, + 'name': str(lltype), + 'size': bitsize, + 'identifier': str(lltype), + 'elements': m.add_metadata([mdrange]), + }) + + return mdtype + + def mark_variable(self, builder, allocavalue, name, lltype, size, line, + datamodel=None, argidx=None): + + arg_index = 0 if argidx is None else argidx + m = self.module + fnty = ir.FunctionType(ir.VoidType(), [ir.MetaDataType()] * 3) + decl = cgutils.get_or_insert_function(m, fnty, 'llvm.dbg.declare') + + mdtype = self._var_type(lltype, size, datamodel=datamodel) + name = name.replace('.', '$') # for gdb to work correctly + mdlocalvar = m.add_debug_info('DILocalVariable', { + 'name': name, + 'arg': arg_index, + 'scope': self.subprograms[-1], + 'file': self.difile, + 'line': line, + 'type': mdtype, + }) + mdexpr = m.add_debug_info('DIExpression', {}) + + return builder.call(decl, [allocavalue, mdlocalvar, mdexpr]) + + def mark_location(self, builder, line): + builder.debug_metadata = self._add_location(line) + + def mark_subprogram(self, function, qualname, argnames, argtypes, line): + name = qualname + argmap = dict(zip(argnames, argtypes)) + di_subp = self._add_subprogram(name=name, linkagename=function.name, + line=line, function=function, + argmap=argmap) + function.set_metadata("dbg", di_subp) + + def finalize(self): + dbgcu = cgutils.get_or_insert_named_metadata(self.module, self.DBG_CU_NAME) + dbgcu.add(self.dicompileunit) + self._set_module_flags() + + # + # Internal APIs + # + + def _set_module_flags(self): + """Set the module flags metadata + """ + module = self.module + mflags = cgutils.get_or_insert_named_metadata(module, 'llvm.module.flags') + # Set *require* behavior to warning + # See http://llvm.org/docs/LangRef.html#module-flags-metadata + require_warning_behavior = self._const_int(2) + if self.DWARF_VERSION is not None: + dwarf_version = module.add_metadata([ + require_warning_behavior, + "Dwarf Version", + self._const_int(self.DWARF_VERSION) + ]) + if dwarf_version not in mflags.operands: + mflags.add(dwarf_version) + debuginfo_version = module.add_metadata([ + require_warning_behavior, + "Debug Info Version", + self._const_int(self.DEBUG_INFO_VERSION) + ]) + if debuginfo_version not in mflags.operands: + mflags.add(debuginfo_version) + + def _add_subprogram(self, name, linkagename, line, function, argmap): + """Emit subprogram metadata + """ + subp = self._di_subprogram(name, linkagename, line, function, argmap) + self.subprograms.append(subp) + return subp + + def _add_location(self, line): + """Emit location metatdaa + """ + loc = self._di_location(line) + return loc + + @classmethod + def _const_int(cls, num, bits=32): + """Util to create constant int in metadata + """ + return ir.IntType(bits)(num) + + @classmethod + def _const_bool(cls, boolean): + """Util to create constant boolean in metadata + """ + return ir.IntType(1)(boolean) + + # + # Helpers to emit the metadata nodes + # + + def _di_file(self): + return self.module.add_debug_info('DIFile', { + 'directory': os.path.dirname(self.filepath), + 'filename': os.path.basename(self.filepath), + }) + + def _di_compile_unit(self): + return self.module.add_debug_info('DICompileUnit', { + 'language': ir.DIToken('DW_LANG_C_plus_plus'), + 'file': self.difile, + # Numba has to pretend to be clang to ensure the prologue is skipped + # correctly in gdb. See: + # https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/amd64-tdep.c;h=e563d369d8cb3eb3c2f732c2fa850ec70ba8d63b;hb=a4b0231e179607e47b1cdf1fe15c5dc25e482fad#l2521 + # Note the "producer_is_llvm" call to specialise the prologue + # handling, this is defined here: + # https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/producer.c;h=cdfd80d904c09394febd18749bb90359b2d128cc;hb=a4b0231e179607e47b1cdf1fe15c5dc25e482fad#l124 + # and to get a match for this condition the 'producer' must start + # with "clang ", hence the following... + 'producer': 'clang (Numba)', + 'runtimeVersion': 0, + 'isOptimized': config.OPT != 0, + 'emissionKind': ir.DIToken(self.emission_kind), + }, is_distinct=True) + + def _di_subroutine_type(self, line, function, argmap): + # The function call conv needs encoding. + llfunc = function + md = [] + + for idx, llarg in enumerate(llfunc.args): + if not llarg.name.startswith('arg.'): + name = llarg.name.replace('.', '$') # for gdb to work correctly + lltype = llarg.type + size = self.cgctx.get_abi_sizeof(lltype) + mdtype = self._var_type(lltype, size, datamodel=None) + md.append(mdtype) + + for idx, (name, nbtype) in enumerate(argmap.items()): + name = name.replace('.', '$') # for gdb to work correctly + datamodel = self.cgctx.data_model_manager[nbtype] + lltype = self.cgctx.get_value_type(nbtype) + size = self.cgctx.get_abi_sizeof(lltype) + mdtype = self._var_type(lltype, size, datamodel=datamodel) + md.append(mdtype) + + return self.module.add_debug_info('DISubroutineType', { + 'types': self.module.add_metadata(md), + }) + + def _di_subprogram(self, name, linkagename, line, function, argmap): + return self.module.add_debug_info('DISubprogram', { + 'name': name, + 'linkageName': linkagename, + 'scope': self.difile, + 'file': self.difile, + 'line': line, + 'type': self._di_subroutine_type(line, function, argmap), + 'isLocal': False, + 'isDefinition': True, + 'scopeLine': line, + 'isOptimized': config.OPT != 0, + 'unit': self.dicompileunit, + }, is_distinct=True) + + def _di_location(self, line): + return self.module.add_debug_info('DILocation', { + 'line': line, + 'column': 1, + 'scope': self.subprograms[-1], + }) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/decorators.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/decorators.py new file mode 100644 index 0000000000000000000000000000000000000000..6801a8e04cdcc2d3e84fbe21b2d450bb5a7638b4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/decorators.py @@ -0,0 +1,302 @@ +""" +Define @jit and related decorators. +""" + + +import sys +import warnings +import inspect +import logging + +from numba.core.errors import DeprecationError, NumbaDeprecationWarning +from numba.stencils.stencil import stencil +from numba.core import config, extending, sigutils, registry + +_logger = logging.getLogger(__name__) + + +# ----------------------------------------------------------------------------- +# Decorators + +_msg_deprecated_signature_arg = ("Deprecated keyword argument `{0}`. " + "Signatures should be passed as the first " + "positional argument.") + + +def jit(signature_or_function=None, locals={}, cache=False, + pipeline_class=None, boundscheck=None, **options): + """ + This decorator is used to compile a Python function into native code. + + Args + ----- + signature_or_function: + The (optional) signature or list of signatures to be compiled. + If not passed, required signatures will be compiled when the + decorated function is called, depending on the argument values. + As a convenience, you can directly pass the function to be compiled + instead. + + locals: dict + Mapping of local variable names to Numba types. Used to override the + types deduced by Numba's type inference engine. + + pipeline_class: type numba.compiler.CompilerBase + The compiler pipeline type for customizing the compilation stages. + + options: + For a cpu target, valid options are: + nopython: bool + Set to True to disable the use of PyObjects and Python API + calls. The default behavior is to allow the use of PyObjects + and Python API. Default value is True. + + forceobj: bool + Set to True to force the use of PyObjects for every value. + Default value is False. + + looplift: bool + Set to True to enable jitting loops in nopython mode while + leaving surrounding code in object mode. This allows functions + to allocate NumPy arrays and use Python objects, while the + tight loops in the function can still be compiled in nopython + mode. Any arrays that the tight loop uses should be created + before the loop is entered. Default value is True. + + error_model: str + The error-model affects divide-by-zero behavior. + Valid values are 'python' and 'numpy'. The 'python' model + raises exception. The 'numpy' model sets the result to + *+/-inf* or *nan*. Default value is 'python'. + + inline: str or callable + The inline option will determine whether a function is inlined + at into its caller if called. String options are 'never' + (default) which will never inline, and 'always', which will + always inline. If a callable is provided it will be called with + the call expression node that is requesting inlining, the + caller's IR and callee's IR as arguments, it is expected to + return Truthy as to whether to inline. + NOTE: This inlining is performed at the Numba IR level and is in + no way related to LLVM inlining. + + boundscheck: bool or None + Set to True to enable bounds checking for array indices. Out + of bounds accesses will raise IndexError. The default is to + not do bounds checking. If False, bounds checking is disabled, + out of bounds accesses can produce garbage results or segfaults. + However, enabling bounds checking will slow down typical + functions, so it is recommended to only use this flag for + debugging. You can also set the NUMBA_BOUNDSCHECK environment + variable to 0 or 1 to globally override this flag. The default + value is None, which under normal execution equates to False, + but if debug is set to True then bounds checking will be + enabled. + + Returns + -------- + A callable usable as a compiled function. Actual compiling will be + done lazily if no explicit signatures are passed. + + Examples + -------- + The function can be used in the following ways: + + 1) jit(signatures, **targetoptions) -> jit(function) + + Equivalent to: + + d = dispatcher(function, targetoptions) + for signature in signatures: + d.compile(signature) + + Create a dispatcher object for a python function. Then, compile + the function with the given signature(s). + + Example: + + @jit("int32(int32, int32)") + def foo(x, y): + return x + y + + @jit(["int32(int32, int32)", "float32(float32, float32)"]) + def bar(x, y): + return x + y + + 2) jit(function, **targetoptions) -> dispatcher + + Create a dispatcher function object that specializes at call site. + + Examples: + + @jit + def foo(x, y): + return x + y + + @jit(nopython=True) + def bar(x, y): + return x + y + + """ + forceobj = options.get('forceobj', False) + if 'argtypes' in options: + raise DeprecationError(_msg_deprecated_signature_arg.format('argtypes')) + if 'restype' in options: + raise DeprecationError(_msg_deprecated_signature_arg.format('restype')) + nopython = options.get('nopython', None) + if nopython is not None: + assert type(nopython) is bool, "nopython option must be a bool" + if nopython is True and forceobj: + raise ValueError("Only one of 'nopython' or 'forceobj' can be True.") + target = options.pop('_target', 'cpu') + + if nopython is False: + msg = ("The keyword argument 'nopython=False' was supplied. From " + "Numba 0.59.0 the default is True and supplying this argument " + "has no effect.") + warnings.warn(msg, NumbaDeprecationWarning) + # nopython is True by default since 0.59.0, but if `forceobj` is set + # `nopython` needs to set to False so that things like typing of args in the + # dispatcher layer continues to work. + if forceobj: + options['nopython'] = False + else: + options['nopython'] = True + + options['boundscheck'] = boundscheck + + # Handle signature + if signature_or_function is None: + # No signature, no function + pyfunc = None + sigs = None + elif isinstance(signature_or_function, list): + # A list of signatures is passed + pyfunc = None + sigs = signature_or_function + elif sigutils.is_signature(signature_or_function): + # A single signature is passed + pyfunc = None + sigs = [signature_or_function] + else: + # A function is passed + pyfunc = signature_or_function + sigs = None + + dispatcher_args = {} + if pipeline_class is not None: + dispatcher_args['pipeline_class'] = pipeline_class + wrapper = _jit(sigs, locals=locals, target=target, cache=cache, + targetoptions=options, **dispatcher_args) + if pyfunc is not None: + return wrapper(pyfunc) + else: + return wrapper + + +def _jit(sigs, locals, target, cache, targetoptions, **dispatcher_args): + + from numba.core.target_extension import resolve_dispatcher_from_str + dispatcher = resolve_dispatcher_from_str(target) + + def wrapper(func): + if extending.is_jitted(func): + raise TypeError( + "A jit decorator was called on an already jitted function " + f"{func}. If trying to access the original python " + f"function, use the {func}.py_func attribute." + ) + + if not inspect.isfunction(func): + raise TypeError( + "The decorated object is not a function (got type " + f"{type(func)})." + ) + + if config.ENABLE_CUDASIM and target == 'cuda': + from numba import cuda + return cuda.jit(func) + if config.DISABLE_JIT and not target == 'npyufunc': + return func + disp = dispatcher(py_func=func, locals=locals, + targetoptions=targetoptions, + **dispatcher_args) + if cache: + disp.enable_caching() + if sigs is not None: + # Register the Dispatcher to the type inference mechanism, + # even though the decorator hasn't returned yet. + from numba.core import typeinfer + with typeinfer.register_dispatcher(disp): + for sig in sigs: + disp.compile(sig) + disp.disable_compile() + return disp + + return wrapper + + +def njit(*args, **kws): + """ + Equivalent to jit(nopython=True) + + See documentation for jit function/decorator for full description. + """ + if 'nopython' in kws: + warnings.warn('nopython is set for njit and is ignored', RuntimeWarning) + if 'forceobj' in kws: + warnings.warn('forceobj is set for njit and is ignored', RuntimeWarning) + del kws['forceobj'] + kws.update({'nopython': True}) + return jit(*args, **kws) + + +def cfunc(sig, locals={}, cache=False, pipeline_class=None, **options): + """ + This decorator is used to compile a Python function into a C callback + usable with foreign C libraries. + + Usage:: + @cfunc("float64(float64, float64)", nopython=True, cache=True) + def add(a, b): + return a + b + + """ + sig = sigutils.normalize_signature(sig) + + def wrapper(func): + from numba.core.ccallback import CFunc + additional_args = {} + if pipeline_class is not None: + additional_args['pipeline_class'] = pipeline_class + res = CFunc(func, sig, locals=locals, options=options, **additional_args) + if cache: + res.enable_caching() + res.compile() + return res + + return wrapper + + +def jit_module(**kwargs): + """ Automatically ``jit``-wraps functions defined in a Python module + + Note that ``jit_module`` should only be called at the end of the module to + be jitted. In addition, only functions which are defined in the module + ``jit_module`` is called from are considered for automatic jit-wrapping. + See the Numba documentation for more information about what can/cannot be + jitted. + + :param kwargs: Keyword arguments to pass to ``jit`` such as ``nopython`` + or ``error_model``. + + """ + # Get the module jit_module is being called from + frame = inspect.stack()[1] + module = inspect.getmodule(frame[0]) + # Replace functions in module with jit-wrapped versions + for name, obj in module.__dict__.items(): + if inspect.isfunction(obj) and inspect.getmodule(obj) == module: + _logger.debug("Auto decorating function {} from module {} with jit " + "and options: {}".format(obj, module.__name__, kwargs)) + module.__dict__[name] = jit(obj, **kwargs) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/descriptors.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/descriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..9c0c367e9c99dc2799cfdb738e62cbd85d93f8eb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/descriptors.py @@ -0,0 +1,21 @@ +""" +Target Descriptors +""" + +from abc import ABCMeta, abstractmethod + + +class TargetDescriptor(metaclass=ABCMeta): + + def __init__(self, target_name): + self._target_name = target_name + + @property + @abstractmethod + def typing_context(self): + ... + + @property + @abstractmethod + def target_context(self): + ... diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/dispatcher.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/dispatcher.py new file mode 100644 index 0000000000000000000000000000000000000000..1c284f024f3b461ddd855f960aa28d474971245f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/dispatcher.py @@ -0,0 +1,1333 @@ +# -*- coding: utf-8 -*- + + +import collections +import functools +import sys +import types as pytypes +import uuid +import weakref +from contextlib import ExitStack +from abc import abstractmethod + +from numba import _dispatcher +from numba.core import ( + utils, types, errors, typing, serialize, config, compiler, sigutils +) +from numba.core.compiler_lock import global_compiler_lock +from numba.core.typeconv.rules import default_type_manager +from numba.core.typing.templates import fold_arguments +from numba.core.typing.typeof import Purpose, typeof +from numba.core.bytecode import get_code_object +from numba.core.caching import NullCache, FunctionCache +from numba.core import entrypoints +import numba.core.event as ev + + +class OmittedArg(object): + """ + A placeholder for omitted arguments with a default value. + """ + + def __init__(self, value): + self.value = value + + def __repr__(self): + return "omitted arg(%r)" % (self.value,) + + @property + def _numba_type_(self): + return types.Omitted(self.value) + + +class _FunctionCompiler(object): + def __init__(self, py_func, targetdescr, targetoptions, locals, + pipeline_class): + self.py_func = py_func + self.targetdescr = targetdescr + self.targetoptions = targetoptions + self.locals = locals + self.pysig = utils.pysignature(self.py_func) + self.pipeline_class = pipeline_class + # Remember key=(args, return_type) combinations that will fail + # compilation to avoid compilation attempt on them. The values are + # the exceptions. + self._failed_cache = {} + + def fold_argument_types(self, args, kws): + """ + Given positional and named argument types, fold keyword arguments + and resolve defaults by inserting types.Omitted() instances. + + A (pysig, argument types) tuple is returned. + """ + def normal_handler(index, param, value): + return value + + def default_handler(index, param, default): + return types.Omitted(default) + + def stararg_handler(index, param, values): + return types.StarArgTuple(values) + # For now, we take argument values from the @jit function + args = fold_arguments(self.pysig, args, kws, + normal_handler, + default_handler, + stararg_handler) + return self.pysig, args + + def compile(self, args, return_type): + status, retval = self._compile_cached(args, return_type) + if status: + return retval + else: + raise retval + + def _compile_cached(self, args, return_type): + key = tuple(args), return_type + try: + return False, self._failed_cache[key] + except KeyError: + pass + + try: + retval = self._compile_core(args, return_type) + except errors.TypingError as e: + self._failed_cache[key] = e + return False, e + else: + return True, retval + + def _compile_core(self, args, return_type): + flags = compiler.Flags() + self.targetdescr.options.parse_as_flags(flags, self.targetoptions) + flags = self._customize_flags(flags) + + impl = self._get_implementation(args, {}) + cres = compiler.compile_extra(self.targetdescr.typing_context, + self.targetdescr.target_context, + impl, + args=args, return_type=return_type, + flags=flags, locals=self.locals, + pipeline_class=self.pipeline_class) + # Check typing error if object mode is used + if cres.typing_error is not None and not flags.enable_pyobject: + raise cres.typing_error + return cres + + def get_globals_for_reduction(self): + return serialize._get_function_globals_for_reduction(self.py_func) + + def _get_implementation(self, args, kws): + return self.py_func + + def _customize_flags(self, flags): + return flags + + +class _GeneratedFunctionCompiler(_FunctionCompiler): + + def __init__(self, py_func, targetdescr, targetoptions, locals, + pipeline_class): + super(_GeneratedFunctionCompiler, self).__init__( + py_func, targetdescr, targetoptions, locals, pipeline_class) + self.impls = set() + + def get_globals_for_reduction(self): + # This will recursively get the globals used by any nested + # implementation function. + return serialize._get_function_globals_for_reduction(self.py_func) + + def _get_implementation(self, args, kws): + impl = self.py_func(*args, **kws) + # Check the generating function and implementation signatures are + # compatible, otherwise compiling would fail later. + pysig = utils.pysignature(self.py_func) + implsig = utils.pysignature(impl) + ok = len(pysig.parameters) == len(implsig.parameters) + if ok: + for pyparam, implparam in zip(pysig.parameters.values(), + implsig.parameters.values()): + # We allow the implementation to omit default values, but + # if it mentions them, they should have the same value... + if (pyparam.name != implparam.name or + pyparam.kind != implparam.kind or + (implparam.default is not implparam.empty and + implparam.default != pyparam.default)): + ok = False + if not ok: + raise TypeError("generated implementation %s should be compatible " + "with signature '%s', but has signature '%s'" + % (impl, pysig, implsig)) + self.impls.add(impl) + return impl + + +_CompileStats = collections.namedtuple( + '_CompileStats', ('cache_path', 'cache_hits', 'cache_misses')) + + +class CompilingCounter(object): + """ + A simple counter that increment in __enter__ and decrement in __exit__. + """ + + def __init__(self): + self.counter = 0 + + def __enter__(self): + assert self.counter >= 0 + self.counter += 1 + + def __exit__(self, *args, **kwargs): + self.counter -= 1 + assert self.counter >= 0 + + def __bool__(self): + return self.counter > 0 + + __nonzero__ = __bool__ + + +class _DispatcherBase(_dispatcher.Dispatcher): + """ + Common base class for dispatcher Implementations. + """ + + __numba__ = "py_func" + + def __init__(self, arg_count, py_func, pysig, can_fallback, + exact_match_required): + self._tm = default_type_manager + + # A mapping of signatures to compile results + self.overloads = collections.OrderedDict() + + self.py_func = py_func + # other parts of Numba assume the old Python 2 name for code object + self.func_code = get_code_object(py_func) + # but newer python uses a different name + self.__code__ = self.func_code + # a place to keep an active reference to the types of the active call + self._types_active_call = set() + # Default argument values match the py_func + self.__defaults__ = py_func.__defaults__ + + argnames = tuple(pysig.parameters) + default_values = self.py_func.__defaults__ or () + defargs = tuple(OmittedArg(val) for val in default_values) + try: + lastarg = list(pysig.parameters.values())[-1] + except IndexError: + has_stararg = False + else: + has_stararg = lastarg.kind == lastarg.VAR_POSITIONAL + _dispatcher.Dispatcher.__init__(self, self._tm.get_pointer(), + arg_count, self._fold_args, + argnames, defargs, + can_fallback, + has_stararg, + exact_match_required) + + self.doc = py_func.__doc__ + self._compiling_counter = CompilingCounter() + self._enable_sysmon = bool(config.ENABLE_SYS_MONITORING) + weakref.finalize(self, self._make_finalizer()) + + def _compilation_chain_init_hook(self): + """ + This will be called ahead of any part of compilation taking place (this + even includes being ahead of working out the types of the arguments). + This permits activities such as initialising extension entry points so + that the compiler knows about additional externally defined types etc + before it does anything. + """ + entrypoints.init_all() + + def _reset_overloads(self): + self._clear() + self.overloads.clear() + + def _make_finalizer(self): + """ + Return a finalizer function that will release references to + related compiled functions. + """ + overloads = self.overloads + targetctx = self.targetctx + + # Early-bind utils.shutting_down() into the function's local namespace + # (see issue #689) + def finalizer(shutting_down=utils.shutting_down): + # The finalizer may crash at shutdown, skip it (resources + # will be cleared by the process exiting, anyway). + if shutting_down(): + return + # This function must *not* hold any reference to self: + # we take care to bind the necessary objects in the closure. + for cres in overloads.values(): + try: + targetctx.remove_user_function(cres.entry_point) + except KeyError: + pass + + return finalizer + + @property + def signatures(self): + """ + Returns a list of compiled function signatures. + """ + return list(self.overloads) + + @property + def nopython_signatures(self): + return [cres.signature for cres in self.overloads.values() + if not cres.objectmode] + + def disable_compile(self, val=True): + """Disable the compilation of new signatures at call time. + """ + # If disabling compilation then there must be at least one signature + assert (not val) or len(self.signatures) > 0 + self._can_compile = not val + + def add_overload(self, cres): + args = tuple(cres.signature.args) + sig = [a._code for a in args] + self._insert(sig, cres.entry_point, cres.objectmode) + self.overloads[args] = cres + + def fold_argument_types(self, args, kws): + return self._compiler.fold_argument_types(args, kws) + + def get_call_template(self, args, kws): + """ + Get a typing.ConcreteTemplate for this dispatcher and the given + *args* and *kws* types. This allows to resolve the return type. + + A (template, pysig, args, kws) tuple is returned. + """ + # XXX how about a dispatcher template class automating the + # following? + + # Fold keyword arguments and resolve default values + pysig, args = self._compiler.fold_argument_types(args, kws) + kws = {} + # Ensure an overload is available + if self._can_compile: + self.compile(tuple(args)) + + # Create function type for typing + func_name = self.py_func.__name__ + name = "CallTemplate({0})".format(func_name) + # The `key` isn't really used except for diagnosis here, + # so avoid keeping a reference to `cfunc`. + call_template = typing.make_concrete_template( + name, key=func_name, signatures=self.nopython_signatures) + return call_template, pysig, args, kws + + def get_overload(self, sig): + """ + Return the compiled function for the given signature. + """ + args, return_type = sigutils.normalize_signature(sig) + return self.overloads[tuple(args)].entry_point + + @property + def is_compiling(self): + """ + Whether a specialization is currently being compiled. + """ + return self._compiling_counter + + def _compile_for_args(self, *args, **kws): + """ + For internal use. Compile a specialized version of the function + for the given *args* and *kws*, and return the resulting callable. + """ + assert not kws + # call any initialisation required for the compilation chain (e.g. + # extension point registration). + self._compilation_chain_init_hook() + + def error_rewrite(e, issue_type): + """ + Rewrite and raise Exception `e` with help supplied based on the + specified issue_type. + """ + if config.SHOW_HELP: + help_msg = errors.error_extras[issue_type] + e.patch_message('\n'.join((str(e).rstrip(), help_msg))) + if config.FULL_TRACEBACKS: + raise e + else: + raise e.with_traceback(None) + + argtypes = [] + for a in args: + if isinstance(a, OmittedArg): + argtypes.append(types.Omitted(a.value)) + else: + argtypes.append(self.typeof_pyval(a)) + + return_val = None + try: + return_val = self.compile(tuple(argtypes)) + except errors.ForceLiteralArg as e: + # Received request for compiler re-entry with the list of arguments + # indicated by e.requested_args. + # First, check if any of these args are already Literal-ized + already_lit_pos = [i for i in e.requested_args + if isinstance(args[i], types.Literal)] + if already_lit_pos: + # Abort compilation if any argument is already a Literal. + # Letting this continue will cause infinite compilation loop. + m = ("Repeated literal typing request.\n" + "{}.\n" + "This is likely caused by an error in typing. " + "Please see nested and suppressed exceptions.") + info = ', '.join('Arg #{} is {}'.format(i, args[i]) + for i in sorted(already_lit_pos)) + raise errors.CompilerError(m.format(info)) + # Convert requested arguments into a Literal. + args = [(types.literal + if i in e.requested_args + else lambda x: x)(args[i]) + for i, v in enumerate(args)] + # Re-enter compilation with the Literal-ized arguments + return_val = self._compile_for_args(*args) + + except errors.TypingError as e: + # Intercept typing error that may be due to an argument + # that failed inferencing as a Numba type + failed_args = [] + for i, arg in enumerate(args): + val = arg.value if isinstance(arg, OmittedArg) else arg + try: + tp = typeof(val, Purpose.argument) + except ValueError as typeof_exc: + failed_args.append((i, str(typeof_exc))) + else: + if tp is None: + failed_args.append( + (i, f"cannot determine Numba type of value {val}")) + if failed_args: + # Patch error message to ease debugging + args_str = "\n".join( + f"- argument {i}: {err}" for i, err in failed_args + ) + msg = (f"{str(e).rstrip()} \n\nThis error may have been caused " + f"by the following argument(s):\n{args_str}\n") + e.patch_message(msg) + + error_rewrite(e, 'typing') + except errors.UnsupportedError as e: + # Something unsupported is present in the user code, add help info + error_rewrite(e, 'unsupported_error') + except (errors.NotDefinedError, errors.RedefinedError, + errors.VerificationError) as e: + # These errors are probably from an issue with either the code + # supplied being syntactically or otherwise invalid + error_rewrite(e, 'interpreter') + except errors.ConstantInferenceError as e: + # this is from trying to infer something as constant when it isn't + # or isn't supported as a constant + error_rewrite(e, 'constant_inference') + except Exception as e: + if config.SHOW_HELP: + if hasattr(e, 'patch_message'): + help_msg = errors.error_extras['reportable'] + e.patch_message('\n'.join((str(e).rstrip(), help_msg))) + # ignore the FULL_TRACEBACKS config, this needs reporting! + raise e + finally: + self._types_active_call.clear() + return return_val + + def inspect_llvm(self, signature=None): + """Get the LLVM intermediate representation generated by compilation. + + Parameters + ---------- + signature : tuple of numba types, optional + Specify a signature for which to obtain the LLVM IR. If None, the + IR is returned for all available signatures. + + Returns + ------- + llvm : dict[signature, str] or str + Either the LLVM IR string for the specified signature, or, if no + signature was given, a dictionary mapping signatures to LLVM IR + strings. + """ + if signature is not None: + lib = self.overloads[signature].library + return lib.get_llvm_str() + + return dict((sig, self.inspect_llvm(sig)) for sig in self.signatures) + + def inspect_asm(self, signature=None): + """Get the generated assembly code. + + Parameters + ---------- + signature : tuple of numba types, optional + Specify a signature for which to obtain the assembly code. If + None, the assembly code is returned for all available signatures. + + Returns + ------- + asm : dict[signature, str] or str + Either the assembly code for the specified signature, or, if no + signature was given, a dictionary mapping signatures to assembly + code. + """ + if signature is not None: + lib = self.overloads[signature].library + return lib.get_asm_str() + + return dict((sig, self.inspect_asm(sig)) for sig in self.signatures) + + def inspect_types(self, file=None, signature=None, + pretty=False, style='default', **kwargs): + """Print/return Numba intermediate representation (IR)-annotated code. + + Parameters + ---------- + file : file-like object, optional + File to which to print. Defaults to sys.stdout if None. Must be + None if ``pretty=True``. + signature : tuple of numba types, optional + Print/return the intermediate representation for only the given + signature. If None, the IR is printed for all available signatures. + pretty : bool, optional + If True, an Annotate object will be returned that can render the + IR with color highlighting in Jupyter and IPython. ``file`` must + be None if ``pretty`` is True. Additionally, the ``pygments`` + library must be installed for ``pretty=True``. + style : str, optional + Choose a style for rendering. Ignored if ``pretty`` is ``False``. + This is directly consumed by ``pygments`` formatters. To see a + list of available styles, import ``pygments`` and run + ``list(pygments.styles.get_all_styles())``. + + Returns + ------- + annotated : Annotate object, optional + Only returned if ``pretty=True``, otherwise this function is only + used for its printing side effect. If ``pretty=True``, an Annotate + object is returned that can render itself in Jupyter and IPython. + """ + overloads = self.overloads + if signature is not None: + overloads = {signature: self.overloads[signature]} + + if not pretty: + if file is None: + file = sys.stdout + + for ver, res in overloads.items(): + print("%s %s" % (self.py_func.__name__, ver), file=file) + print('-' * 80, file=file) + print(res.type_annotation, file=file) + print('=' * 80, file=file) + else: + if file is not None: + raise ValueError("`file` must be None if `pretty=True`") + from numba.core.annotations.pretty_annotate import Annotate + return Annotate(self, signature=signature, style=style) + + def inspect_cfg(self, signature=None, show_wrapper=None, **kwargs): + """ + For inspecting the CFG of the function. + + By default the CFG of the user function is shown. The *show_wrapper* + option can be set to "python" or "cfunc" to show the python wrapper + function or the *cfunc* wrapper function, respectively. + + Parameters accepted in kwargs + ----------------------------- + filename : string, optional + the name of the output file, if given this will write the output to + filename + view : bool, optional + whether to immediately view the optional output file + highlight : bool, set, dict, optional + what, if anything, to highlight, options are: + { incref : bool, # highlight NRT_incref calls + decref : bool, # highlight NRT_decref calls + returns : bool, # highlight exits which are normal returns + raises : bool, # highlight exits which are from raise + meminfo : bool, # highlight calls to NRT*meminfo + branches : bool, # highlight true/false branches + } + Default is True which sets all of the above to True. Supplying a set + of strings is also accepted, these are interpreted as key:True with + respect to the above dictionary. e.g. {'incref', 'decref'} would + switch on highlighting on increfs and decrefs. + interleave: bool, set, dict, optional + what, if anything, to interleave in the LLVM IR, options are: + { python: bool # interleave python source code with the LLVM IR + lineinfo: bool # interleave line information markers with the LLVM + # IR + } + Default is True which sets all of the above to True. Supplying a set + of strings is also accepted, these are interpreted as key:True with + respect to the above dictionary. e.g. {'python',} would + switch on interleaving of python source code in the LLVM IR. + strip_ir : bool, optional + Default is False. If set to True all LLVM IR that is superfluous to + that requested in kwarg `highlight` will be removed. + show_key : bool, optional + Default is True. Create a "key" for the highlighting in the rendered + CFG. + fontsize : int, optional + Default is 8. Set the fontsize in the output to this value. + """ + if signature is not None: + cres = self.overloads[signature] + lib = cres.library + if show_wrapper == 'python': + fname = cres.fndesc.llvm_cpython_wrapper_name + elif show_wrapper == 'cfunc': + fname = cres.fndesc.llvm_cfunc_wrapper_name + else: + fname = cres.fndesc.mangled_name + return lib.get_function_cfg(fname, py_func=self.py_func, **kwargs) + + return dict((sig, self.inspect_cfg(sig, show_wrapper=show_wrapper)) + for sig in self.signatures) + + def inspect_disasm_cfg(self, signature=None): + """ + For inspecting the CFG of the disassembly of the function. + + Requires python package: r2pipe + Requires radare2 binary on $PATH. + Notebook rendering requires python package: graphviz + + signature : tuple of Numba types, optional + Print/return the disassembly CFG for only the given signatures. + If None, the IR is printed for all available signatures. + """ + if signature is not None: + cres = self.overloads[signature] + lib = cres.library + return lib.get_disasm_cfg(cres.fndesc.mangled_name) + + return dict((sig, self.inspect_disasm_cfg(sig)) + for sig in self.signatures) + + def get_annotation_info(self, signature=None): + """ + Gets the annotation information for the function specified by + signature. If no signature is supplied a dictionary of signature to + annotation information is returned. + """ + signatures = self.signatures if signature is None else [signature] + out = collections.OrderedDict() + for sig in signatures: + cres = self.overloads[sig] + ta = cres.type_annotation + key = (ta.func_id.filename + ':' + str(ta.func_id.firstlineno + 1), + ta.signature) + out[key] = ta.annotate_raw()[key] + return out + + def _explain_ambiguous(self, *args, **kws): + """ + Callback for the C _Dispatcher object. + """ + assert not kws, "kwargs not handled" + args = tuple([self.typeof_pyval(a) for a in args]) + # The order here must be deterministic for testing purposes, which + # is ensured by the OrderedDict. + sigs = self.nopython_signatures + # This will raise + self.typingctx.resolve_overload(self.py_func, sigs, args, kws, + allow_ambiguous=False) + + def _explain_matching_error(self, *args, **kws): + """ + Callback for the C _Dispatcher object. + """ + assert not kws, "kwargs not handled" + args = [self.typeof_pyval(a) for a in args] + msg = ("No matching definition for argument type(s) %s" + % ', '.join(map(str, args))) + raise TypeError(msg) + + def _search_new_conversions(self, *args, **kws): + """ + Callback for the C _Dispatcher object. + Search for approximately matching signatures for the given arguments, + and ensure the corresponding conversions are registered in the C++ + type manager. + """ + assert not kws, "kwargs not handled" + args = [self.typeof_pyval(a) for a in args] + found = False + for sig in self.nopython_signatures: + conv = self.typingctx.install_possible_conversions(args, sig.args) + if conv: + found = True + return found + + def __repr__(self): + return "%s(%s)" % (type(self).__name__, self.py_func) + + def typeof_pyval(self, val): + """ + Resolve the Numba type of Python value *val*. + This is called from numba._dispatcher as a fallback if the native code + cannot decide the type. + """ + try: + tp = typeof(val, Purpose.argument) + except ValueError: + tp = types.pyobject + else: + if tp is None: + tp = types.pyobject + self._types_active_call.add(tp) + return tp + + def _callback_add_timer(self, duration, cres, lock_name): + md = cres.metadata + # md can be None when code is loaded from cache + if md is not None: + timers = md.setdefault("timers", {}) + if lock_name not in timers: + # Only write if the metadata does not exist + timers[lock_name] = duration + else: + msg = f"'{lock_name} metadata is already defined." + raise AssertionError(msg) + + def _callback_add_compiler_timer(self, duration, cres): + return self._callback_add_timer(duration, cres, + lock_name="compiler_lock") + + def _callback_add_llvm_timer(self, duration, cres): + return self._callback_add_timer(duration, cres, + lock_name="llvm_lock") + + +class _MemoMixin: + __uuid = None + # A {uuid -> instance} mapping, for deserialization + _memo = weakref.WeakValueDictionary() + # hold refs to last N functions deserialized, retaining them in _memo + # regardless of whether there is another reference + _recent = collections.deque(maxlen=config.FUNCTION_CACHE_SIZE) + + @property + def _uuid(self): + """ + An instance-specific UUID, to avoid multiple deserializations of + a given instance. + + Note: this is lazily-generated, for performance reasons. + """ + u = self.__uuid + if u is None: + u = str(uuid.uuid4()) + self._set_uuid(u) + return u + + def _set_uuid(self, u): + assert self.__uuid is None + self.__uuid = u + self._memo[u] = self + self._recent.append(self) + + +class Dispatcher(serialize.ReduceMixin, _MemoMixin, _DispatcherBase): + """ + Implementation of user-facing dispatcher objects (i.e. created using + the @jit decorator). + This is an abstract base class. Subclasses should define the targetdescr + class attribute. + """ + _fold_args = True + + __numba__ = 'py_func' + + def __init__(self, py_func, locals={}, targetoptions={}, + pipeline_class=compiler.Compiler): + """ + Parameters + ---------- + py_func: function object to be compiled + locals: dict, optional + Mapping of local variable names to Numba types. Used to override + the types deduced by the type inference engine. + targetoptions: dict, optional + Target-specific config options. + pipeline_class: type numba.compiler.CompilerBase + The compiler pipeline type. + """ + self.typingctx = self.targetdescr.typing_context + self.targetctx = self.targetdescr.target_context + + pysig = utils.pysignature(py_func) + arg_count = len(pysig.parameters) + can_fallback = not targetoptions.get('nopython', False) + + _DispatcherBase.__init__(self, arg_count, py_func, pysig, can_fallback, + exact_match_required=False) + + functools.update_wrapper(self, py_func) + + self.targetoptions = targetoptions + self.locals = locals + self._cache = NullCache() + compiler_class = _FunctionCompiler + self._compiler = compiler_class(py_func, self.targetdescr, + targetoptions, locals, pipeline_class) + self._cache_hits = collections.Counter() + self._cache_misses = collections.Counter() + + self._type = types.Dispatcher(self) + self.typingctx.insert_global(self, self._type) + + def dump(self, tab=''): + print(f'{tab}DUMP {type(self).__name__}[{self.py_func.__name__}' + f', type code={self._type._code}]') + for cres in self.overloads.values(): + cres.dump(tab=tab + ' ') + print(f'{tab}END DUMP {type(self).__name__}[{self.py_func.__name__}]') + + @property + def _numba_type_(self): + return types.Dispatcher(self) + + def enable_caching(self): + self._cache = FunctionCache(self.py_func) + + def __get__(self, obj, objtype=None): + '''Allow a JIT function to be bound as a method to an object''' + if obj is None: # Unbound method + return self + else: # Bound method + return pytypes.MethodType(self, obj) + + def _reduce_states(self): + """ + Reduce the instance for pickling. This will serialize + the original function as well the compilation options and + compiled signatures, but not the compiled code itself. + + NOTE: part of ReduceMixin protocol + """ + if self._can_compile: + sigs = [] + else: + sigs = [cr.signature for cr in self.overloads.values()] + + return dict( + uuid=str(self._uuid), + py_func=self.py_func, + locals=self.locals, + targetoptions=self.targetoptions, + can_compile=self._can_compile, + sigs=sigs, + ) + + @classmethod + def _rebuild(cls, uuid, py_func, locals, targetoptions, + can_compile, sigs): + """ + Rebuild an Dispatcher instance after it was __reduce__'d. + + NOTE: part of ReduceMixin protocol + """ + try: + return cls._memo[uuid] + except KeyError: + pass + self = cls(py_func, locals, targetoptions) + # Make sure this deserialization will be merged with subsequent ones + self._set_uuid(uuid) + for sig in sigs: + self.compile(sig) + self._can_compile = can_compile + return self + + def compile(self, sig): + with ExitStack() as scope: + cres = None + + def cb_compiler(dur): + if cres is not None: + self._callback_add_compiler_timer(dur, cres) + + def cb_llvm(dur): + if cres is not None: + self._callback_add_llvm_timer(dur, cres) + + scope.enter_context(ev.install_timer("numba:compiler_lock", + cb_compiler)) + scope.enter_context(ev.install_timer("numba:llvm_lock", cb_llvm)) + scope.enter_context(global_compiler_lock) + + if not self._can_compile: + raise RuntimeError("compilation disabled") + # Use counter to track recursion compilation depth + with self._compiling_counter: + args, return_type = sigutils.normalize_signature(sig) + # Don't recompile if signature already exists + existing = self.overloads.get(tuple(args)) + if existing is not None: + return existing.entry_point + # Try to load from disk cache + cres = self._cache.load_overload(sig, self.targetctx) + if cres is not None: + self._cache_hits[sig] += 1 + # XXX fold this in add_overload()? (also see compiler.py) + if not cres.objectmode: + self.targetctx.insert_user_function(cres.entry_point, + cres.fndesc, + [cres.library]) + self.add_overload(cres) + return cres.entry_point + + self._cache_misses[sig] += 1 + ev_details = dict( + dispatcher=self, + args=args, + return_type=return_type, + ) + with ev.trigger_event("numba:compile", data=ev_details): + try: + cres = self._compiler.compile(args, return_type) + except errors.ForceLiteralArg as e: + def folded(args, kws): + return self._compiler.fold_argument_types(args, + kws)[1] + raise e.bind_fold_arguments(folded) + self.add_overload(cres) + self._cache.save_overload(sig, cres) + return cres.entry_point + + def get_compile_result(self, sig): + """Compile (if needed) and return the compilation result with the + given signature. + + Returns ``CompileResult``. + Raises ``NumbaError`` if the signature is incompatible. + """ + atypes = tuple(sig.args) + if atypes not in self.overloads: + if self._can_compile: + # Compiling may raise any NumbaError + self.compile(atypes) + else: + msg = f"{sig} not available and compilation disabled" + raise errors.TypingError(msg) + return self.overloads[atypes] + + def recompile(self): + """ + Recompile all signatures afresh. + """ + sigs = list(self.overloads) + old_can_compile = self._can_compile + # Ensure the old overloads are disposed of, + # including compiled functions. + self._make_finalizer()() + self._reset_overloads() + self._cache.flush() + self._can_compile = True + try: + for sig in sigs: + self.compile(sig) + finally: + self._can_compile = old_can_compile + + @property + def stats(self): + return _CompileStats( + cache_path=self._cache.cache_path, + cache_hits=self._cache_hits, + cache_misses=self._cache_misses, + ) + + def parallel_diagnostics(self, signature=None, level=1): + """ + Print parallel diagnostic information for the given signature. If no + signature is present it is printed for all known signatures. level is + used to adjust the verbosity, level=1 (default) is minimal verbosity, + and 2, 3, and 4 provide increasing levels of verbosity. + """ + def dump(sig): + ol = self.overloads[sig] + pfdiag = ol.metadata.get('parfor_diagnostics', None) + if pfdiag is None: + msg = "No parfors diagnostic available, is 'parallel=True' set?" + raise ValueError(msg) + pfdiag.dump(level) + if signature is not None: + dump(signature) + else: + [dump(sig) for sig in self.signatures] + + def get_metadata(self, signature=None): + """ + Obtain the compilation metadata for a given signature. + """ + if signature is not None: + return self.overloads[signature].metadata + else: + return dict( + (sig,self.overloads[sig].metadata) for sig in self.signatures + ) + + def get_function_type(self): + """Return unique function type of dispatcher when possible, otherwise + return None. + + A Dispatcher instance has unique function type when it + contains exactly one compilation result and its compilation + has been disabled (via its disable_compile method). + """ + if not self._can_compile and len(self.overloads) == 1: + cres = tuple(self.overloads.values())[0] + return types.FunctionType(cres.signature) + + +class LiftedCode(serialize.ReduceMixin, _MemoMixin, _DispatcherBase): + """ + Implementation of the hidden dispatcher objects used for lifted code + (a lifted loop is really compiled as a separate function). + """ + _fold_args = False + can_cache = False + + def __init__(self, func_ir, typingctx, targetctx, flags, locals): + self.func_ir = func_ir + self.lifted_from = None + + self.typingctx = typingctx + self.targetctx = targetctx + self.flags = flags + self.locals = locals + + _DispatcherBase.__init__(self, self.func_ir.arg_count, + self.func_ir.func_id.func, + self.func_ir.func_id.pysig, + can_fallback=True, + exact_match_required=False) + + def _reduce_states(self): + """ + Reduce the instance for pickling. This will serialize + the original function as well the compilation options and + compiled signatures, but not the compiled code itself. + + NOTE: part of ReduceMixin protocol + """ + return dict( + uuid=self._uuid, func_ir=self.func_ir, flags=self.flags, + locals=self.locals, extras=self._reduce_extras(), + ) + + def _reduce_extras(self): + """ + NOTE: sub-class can override to add extra states + """ + return {} + + @classmethod + def _rebuild(cls, uuid, func_ir, flags, locals, extras): + """ + Rebuild an Dispatcher instance after it was __reduce__'d. + + NOTE: part of ReduceMixin protocol + """ + try: + return cls._memo[uuid] + except KeyError: + pass + + # NOTE: We are assuming that this is must be cpu_target, which is true + # for now. + # TODO: refactor this to not assume on `cpu_target` + + from numba.core import registry + typingctx = registry.cpu_target.typing_context + targetctx = registry.cpu_target.target_context + + self = cls(func_ir, typingctx, targetctx, flags, locals, **extras) + self._set_uuid(uuid) + return self + + def get_source_location(self): + """Return the starting line number of the loop. + """ + return self.func_ir.loc.line + + def _pre_compile(self, args, return_type, flags): + """Pre-compile actions + """ + pass + + @abstractmethod + def compile(self, sig): + """Lifted code should implement a compilation method that will return + a CompileResult.entry_point for the given signature.""" + pass + + def _get_dispatcher_for_current_target(self): + # Lifted code does not honor the target switch currently. + # No work has been done to check if this can be allowed. + return self + + +class LiftedLoop(LiftedCode): + def _pre_compile(self, args, return_type, flags): + assert not flags.enable_looplift, "Enable looplift flags is on" + + def compile(self, sig): + with ExitStack() as scope: + cres = None + + def cb_compiler(dur): + if cres is not None: + self._callback_add_compiler_timer(dur, cres) + + def cb_llvm(dur): + if cres is not None: + self._callback_add_llvm_timer(dur, cres) + + scope.enter_context(ev.install_timer("numba:compiler_lock", + cb_compiler)) + scope.enter_context(ev.install_timer("numba:llvm_lock", cb_llvm)) + scope.enter_context(global_compiler_lock) + + # Use counter to track recursion compilation depth + with self._compiling_counter: + # XXX this is mostly duplicated from Dispatcher. + flags = self.flags + args, return_type = sigutils.normalize_signature(sig) + + # Don't recompile if signature already exists + # (e.g. if another thread compiled it before we got the lock) + existing = self.overloads.get(tuple(args)) + if existing is not None: + return existing.entry_point + + self._pre_compile(args, return_type, flags) + + # copy the flags, use nopython first + npm_loop_flags = flags.copy() + npm_loop_flags.force_pyobject = False + + pyobject_loop_flags = flags.copy() + pyobject_loop_flags.force_pyobject = True + + # Clone IR to avoid (some of the) mutation in the rewrite pass + cloned_func_ir_npm = self.func_ir.copy() + cloned_func_ir_fbk = self.func_ir.copy() + + ev_details = dict( + dispatcher=self, + args=args, + return_type=return_type, + ) + with ev.trigger_event("numba:compile", data=ev_details): + # this emulates "object mode fall-back", try nopython, if it + # fails, then try again in object mode. + try: + cres = compiler.compile_ir(typingctx=self.typingctx, + targetctx=self.targetctx, + func_ir=cloned_func_ir_npm, + args=args, + return_type=return_type, + flags=npm_loop_flags, + locals=self.locals, + lifted=(), + lifted_from=self.lifted_from, + is_lifted_loop=True,) + except errors.TypingError: + cres = compiler.compile_ir(typingctx=self.typingctx, + targetctx=self.targetctx, + func_ir=cloned_func_ir_fbk, + args=args, + return_type=return_type, + flags=pyobject_loop_flags, + locals=self.locals, + lifted=(), + lifted_from=self.lifted_from, + is_lifted_loop=True,) + # Check typing error if object mode is used + if (cres.typing_error is not None): + raise cres.typing_error + self.add_overload(cres) + return cres.entry_point + + +class LiftedWith(LiftedCode): + + can_cache = True + + def _reduce_extras(self): + return dict(output_types=self.output_types) + + @property + def _numba_type_(self): + return types.Dispatcher(self) + + def get_call_template(self, args, kws): + """ + Get a typing.ConcreteTemplate for this dispatcher and the given + *args* and *kws* types. This enables the resolving of the return type. + + A (template, pysig, args, kws) tuple is returned. + """ + # Ensure an overload is available + if self._can_compile: + self.compile(tuple(args)) + + pysig = None + # Create function type for typing + func_name = self.py_func.__name__ + name = "CallTemplate({0})".format(func_name) + # The `key` isn't really used except for diagnosis here, + # so avoid keeping a reference to `cfunc`. + call_template = typing.make_concrete_template( + name, key=func_name, signatures=self.nopython_signatures) + return call_template, pysig, args, kws + + def compile(self, sig): + # this is similar to LiftedLoop's compile but does not have the + # "fallback" to object mode part. + with ExitStack() as scope: + cres = None + + def cb_compiler(dur): + if cres is not None: + self._callback_add_compiler_timer(dur, cres) + + def cb_llvm(dur): + if cres is not None: + self._callback_add_llvm_timer(dur, cres) + + scope.enter_context(ev.install_timer("numba:compiler_lock", + cb_compiler)) + scope.enter_context(ev.install_timer("numba:llvm_lock", cb_llvm)) + scope.enter_context(global_compiler_lock) + + # Use counter to track recursion compilation depth + with self._compiling_counter: + # XXX this is mostly duplicated from Dispatcher. + flags = self.flags + args, return_type = sigutils.normalize_signature(sig) + + # Don't recompile if signature already exists + # (e.g. if another thread compiled it before we got the lock) + existing = self.overloads.get(tuple(args)) + if existing is not None: + return existing.entry_point + + self._pre_compile(args, return_type, flags) + + # Clone IR to avoid (some of the) mutation in the rewrite pass + cloned_func_ir = self.func_ir.copy() + + ev_details = dict( + dispatcher=self, + args=args, + return_type=return_type, + ) + with ev.trigger_event("numba:compile", data=ev_details): + cres = compiler.compile_ir(typingctx=self.typingctx, + targetctx=self.targetctx, + func_ir=cloned_func_ir, + args=args, + return_type=return_type, + flags=flags, locals=self.locals, + lifted=(), + lifted_from=self.lifted_from, + is_lifted_loop=True,) + + # Check typing error if object mode is used + if (cres.typing_error is not None and + not flags.enable_pyobject): + raise cres.typing_error + self.add_overload(cres) + return cres.entry_point + + +class ObjModeLiftedWith(LiftedWith): + def __init__(self, *args, **kwargs): + self.output_types = kwargs.pop('output_types', None) + super(LiftedWith, self).__init__(*args, **kwargs) + if not self.flags.force_pyobject: + raise ValueError("expecting `flags.force_pyobject`") + if self.output_types is None: + raise TypeError('`output_types` must be provided') + # switch off rewrites, they have no effect + self.flags.no_rewrites = True + + @property + def _numba_type_(self): + return types.ObjModeDispatcher(self) + + def get_call_template(self, args, kws): + """ + Get a typing.ConcreteTemplate for this dispatcher and the given + *args* and *kws* types. This enables the resolving of the return type. + + A (template, pysig, args, kws) tuple is returned. + """ + assert not kws + self._legalize_arg_types(args) + # Coerce to object mode + args = [types.ffi_forced_object] * len(args) + + if self._can_compile: + self.compile(tuple(args)) + + signatures = [typing.signature(self.output_types, *args)] + pysig = None + func_name = self.py_func.__name__ + name = "CallTemplate({0})".format(func_name) + call_template = typing.make_concrete_template( + name, key=func_name, signatures=signatures) + + return call_template, pysig, args, kws + + def _legalize_arg_types(self, args): + for i, a in enumerate(args, start=1): + if isinstance(a, types.List): + msg = ( + 'Does not support list type inputs into ' + 'with-context for arg {}' + ) + raise errors.TypingError(msg.format(i)) + elif isinstance(a, types.Dispatcher): + msg = ( + 'Does not support function type inputs into ' + 'with-context for arg {}' + ) + raise errors.TypingError(msg.format(i)) + + @global_compiler_lock + def compile(self, sig): + args, _ = sigutils.normalize_signature(sig) + sig = (types.ffi_forced_object,) * len(args) + return super().compile(sig) + + +if config.USE_LEGACY_TYPE_SYSTEM: # Old type system + # Initialize typeof machinery + _dispatcher.typeof_init( + OmittedArg, + dict((str(t), t._code) for t in types.number_domain)) +else: # New type system + # Initialize typeof machinery + _dispatcher.typeof_init( + OmittedArg, + dict((str(t).split('_')[-1], t._code) for t in types.np_number_domain)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/entrypoints.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/entrypoints.py new file mode 100644 index 0000000000000000000000000000000000000000..ceb0de4e3fcc66dfefa32d6c5b99752aac0f8757 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/entrypoints.py @@ -0,0 +1,46 @@ +import logging +import warnings + +from importlib import metadata as importlib_metadata + + +_already_initialized = False +logger = logging.getLogger(__name__) + + +def init_all(): + """Execute all `numba_extensions` entry points with the name `init` + + If extensions have already been initialized, this function does nothing. + """ + global _already_initialized + if _already_initialized: + return + + # Must put this here to avoid extensions re-triggering initialization + _already_initialized = True + + def load_ep(entry_point): + """Loads a given entry point. Warns and logs on failure. + """ + logger.debug('Loading extension: %s', entry_point) + try: + func = entry_point.load() + func() + except Exception as e: + msg = (f"Numba extension module '{entry_point.module}' " + f"failed to load due to '{type(e).__name__}({str(e)})'.") + warnings.warn(msg, stacklevel=3) + logger.debug('Extension loading failed for: %s', entry_point) + + eps = importlib_metadata.entry_points() + # Split, Python 3.10+ and importlib_metadata 3.6+ have the "selectable" + # interface, versions prior to that do not. See "compatibility note" in: + # https://docs.python.org/3.10/library/importlib.metadata.html#entry-points + if hasattr(eps, 'select'): + for entry_point in eps.select(group="numba_extensions", name="init"): + load_ep(entry_point) + else: + for entry_point in eps.get("numba_extensions", ()): + if entry_point.name == "init": + load_ep(entry_point) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/environment.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/environment.py new file mode 100644 index 0000000000000000000000000000000000000000..ffc5feb59defcbabc02fd96d728a94d307e84c4a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/environment.py @@ -0,0 +1,64 @@ +import weakref +import importlib + +from numba import _dynfunc + + +class Environment(_dynfunc.Environment): + """Stores globals and constant pyobjects for runtime. + + It is often needed to convert b/w nopython objects and pyobjects. + """ + __slots__ = ('env_name', '__weakref__') + # A weak-value dictionary to store live environment with env_name as the + # key. + _memo = weakref.WeakValueDictionary() + + @classmethod + def from_fndesc(cls, fndesc): + try: + # Avoid creating new Env + return cls._memo[fndesc.env_name] + except KeyError: + inst = cls(fndesc.lookup_globals()) + inst.env_name = fndesc.env_name + cls._memo[fndesc.env_name] = inst + return inst + + def can_cache(self): + is_dyn = '__name__' not in self.globals + return not is_dyn + + def __reduce__(self): + return _rebuild_env, ( + self.globals.get('__name__'), + self.consts, + self.env_name, + ) + + def __del__(self): + return + + def __repr__(self): + return f"" + + +def _rebuild_env(modname, consts, env_name): + env = lookup_environment(env_name) + if env is not None: + return env + + mod = importlib.import_module(modname) + env = Environment(mod.__dict__) + env.consts[:] = consts + env.env_name = env_name + # Cache loaded object + Environment._memo[env_name] = env + return env + + +def lookup_environment(env_name): + """Returns the Environment object for the given name; + or None if not found + """ + return Environment._memo.get(env_name) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/errors.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/errors.py new file mode 100644 index 0000000000000000000000000000000000000000..d3cf6f4a413c4395bcfc0321028a23cec821ac94 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/errors.py @@ -0,0 +1,867 @@ +""" +Numba-specific errors and warnings. +""" + + +import abc +import contextlib +import os +import warnings +import numba.core.config +import numpy as np +from collections import defaultdict +from functools import wraps +from abc import abstractmethod + +# Filled at the end +__all__ = [] + + +def _is_numba_core_config_loaded(): + """ + To detect if numba.core.config has been initialized due to circular imports. + """ + try: + numba.core.config + except AttributeError: + return False + else: + return True + + +class NumbaWarning(Warning): + """ + Base category for all Numba compiler warnings. + """ + + def __init__(self, msg, loc=None, highlighting=True, ): + self.msg = msg + self.loc = loc + + # If a warning is emitted inside validation of env-vars in + # numba.core.config. Highlighting will not be available. + if highlighting and _is_numba_core_config_loaded(): + highlight = termcolor().errmsg + else: + def highlight(x): + return x + if loc: + super(NumbaWarning, self).__init__( + highlight("%s\n%s\n" % (msg, loc.strformat()))) + else: + super(NumbaWarning, self).__init__(highlight("%s" % (msg,))) + + +class NumbaPerformanceWarning(NumbaWarning): + """ + Warning category for when an operation might not be + as fast as expected. + """ + + +class NumbaDeprecationWarning(NumbaWarning, DeprecationWarning): + """ + Warning category for use of a deprecated feature. + """ + + +class NumbaPendingDeprecationWarning(NumbaWarning, PendingDeprecationWarning): + """ + Warning category for use of a feature that is pending deprecation. + """ + + +class NumbaParallelSafetyWarning(NumbaWarning): + """ + Warning category for when an operation in a prange + might not have parallel semantics. + """ + + +class NumbaTypeSafetyWarning(NumbaWarning): + """ + Warning category for unsafe casting operations. + """ + + +class NumbaExperimentalFeatureWarning(NumbaWarning): + """ + Warning category for using an experimental feature. + """ + + +class NumbaInvalidConfigWarning(NumbaWarning): + """ + Warning category for using an invalid configuration. + """ + + +class NumbaPedanticWarning(NumbaWarning): + """ + Warning category for reporting pedantic messages. + """ + def __init__(self, msg, **kwargs): + super().__init__(f"{msg}\n{pedantic_warning_info}") + + +class NumbaIRAssumptionWarning(NumbaPedanticWarning): + """ + Warning category for reporting an IR assumption violation. + """ + + +class NumbaDebugInfoWarning(NumbaWarning): + """ + Warning category for an issue with the emission of debug information. + """ + + +class NumbaSystemWarning(NumbaWarning): + """ + Warning category for an issue with the system configuration. + """ + +# These are needed in the color formatting of errors setup + + +class _ColorScheme(metaclass=abc.ABCMeta): + + @abstractmethod + def code(self, msg): + pass + + @abstractmethod + def errmsg(self, msg): + pass + + @abstractmethod + def filename(self, msg): + pass + + @abstractmethod + def indicate(self, msg): + pass + + @abstractmethod + def highlight(self, msg): + pass + + @abstractmethod + def reset(self, msg): + pass + + +class _DummyColorScheme(_ColorScheme): + + def __init__(self, theme=None): + pass + + def code(self, msg): + pass + + def errmsg(self, msg): + pass + + def filename(self, msg): + pass + + def indicate(self, msg): + pass + + def highlight(self, msg): + pass + + def reset(self, msg): + pass + + +# holds reference to the instance of the terminal color scheme in use +_termcolor_inst = None + +try: + import colorama + + # If the colorama version is < 0.3.9 it can break stdout/stderr in some + # situations, as a result if this condition is met colorama is disabled and + # the user is warned. Note that early versions did not have a __version__. + colorama_version = getattr(colorama, '__version__', '0.0.0') + + if tuple([int(x) for x in colorama_version.split('.')]) < (0, 3, 9): + msg = ("Insufficiently recent colorama version found. " + "Numba requires colorama >= 0.3.9") + # warn the user + warnings.warn(msg) + # trip the exception to disable color errors + raise ImportError + + # If Numba is running in testsuite mode then do not use error message + # coloring so CI system output is consistently readable without having + # to read between shell escape characters. + if os.environ.get('NUMBA_DISABLE_ERROR_MESSAGE_HIGHLIGHTING', None): + raise ImportError # just to trigger the exception handler below + +except ImportError: + + class NOPColorScheme(_DummyColorScheme): + def __init__(self, theme=None): + if theme is not None: + raise ValueError("specifying a theme has no effect") + _DummyColorScheme.__init__(self, theme=theme) + + def code(self, msg): + return msg + + def errmsg(self, msg): + return msg + + def filename(self, msg): + return msg + + def indicate(self, msg): + return msg + + def highlight(self, msg): + return msg + + def reset(self, msg): + return msg + + def termcolor(): + global _termcolor_inst + if _termcolor_inst is None: + _termcolor_inst = NOPColorScheme() + return _termcolor_inst + +else: + + from colorama import init, reinit, deinit, Fore, Style + + class ColorShell(object): + _has_initialized = False + + def __init__(self): + init() + self._has_initialized = True + + def __enter__(self): + if self._has_initialized: + reinit() + + def __exit__(self, *exc_detail): + Style.RESET_ALL + deinit() + + class reset_terminal(object): + def __init__(self): + self._buf = bytearray(b'') + + def __enter__(self): + return self._buf + + def __exit__(self, *exc_detail): + self._buf += bytearray(Style.RESET_ALL.encode('utf-8')) + + # define some default themes, if more are added, update the envvars docs! + themes = {} + + # No color added, just bold weighting + themes['no_color'] = {'code': None, + 'errmsg': None, + 'filename': None, + 'indicate': None, + 'highlight': None, + 'reset': None, } + + # suitable for terminals with a dark background + themes['dark_bg'] = {'code': Fore.BLUE, + 'errmsg': Fore.YELLOW, + 'filename': Fore.WHITE, + 'indicate': Fore.GREEN, + 'highlight': Fore.RED, + 'reset': Style.RESET_ALL, } + + # suitable for terminals with a light background + themes['light_bg'] = {'code': Fore.BLUE, + 'errmsg': Fore.BLACK, + 'filename': Fore.MAGENTA, + 'indicate': Fore.BLACK, + 'highlight': Fore.RED, + 'reset': Style.RESET_ALL, } + + # suitable for terminals with a blue background + themes['blue_bg'] = {'code': Fore.WHITE, + 'errmsg': Fore.YELLOW, + 'filename': Fore.MAGENTA, + 'indicate': Fore.CYAN, + 'highlight': Fore.RED, + 'reset': Style.RESET_ALL, } + + # suitable for use in jupyter notebooks + themes['jupyter_nb'] = {'code': Fore.BLACK, + 'errmsg': Fore.BLACK, + 'filename': Fore.GREEN, + 'indicate': Fore.CYAN, + 'highlight': Fore.RED, + 'reset': Style.RESET_ALL, } + + default_theme = themes['no_color'] + + class HighlightColorScheme(_DummyColorScheme): + def __init__(self, theme=default_theme): + self._code = theme['code'] + self._errmsg = theme['errmsg'] + self._filename = theme['filename'] + self._indicate = theme['indicate'] + self._highlight = theme['highlight'] + self._reset = theme['reset'] + _DummyColorScheme.__init__(self, theme=theme) + + def _markup(self, msg, color=None, style=Style.BRIGHT): + features = '' + if color: + features += color + if style: + features += style + with ColorShell(): + with reset_terminal() as mu: + mu += features.encode('utf-8') + mu += (msg).encode('utf-8') + return mu.decode('utf-8') + + def code(self, msg): + return self._markup(msg, self._code) + + def errmsg(self, msg): + return self._markup(msg, self._errmsg) + + def filename(self, msg): + return self._markup(msg, self._filename) + + def indicate(self, msg): + return self._markup(msg, self._indicate) + + def highlight(self, msg): + return self._markup(msg, self._highlight) + + def reset(self, msg): + return self._markup(msg, self._reset) + + def termcolor(): + global _termcolor_inst + if _termcolor_inst is None: + scheme = themes[numba.core.config.COLOR_SCHEME] + _termcolor_inst = HighlightColorScheme(scheme) + return _termcolor_inst + + +pedantic_warning_info = """ +This warning came from an internal pedantic check. Please report the warning +message and traceback, along with a minimal reproducer at: +https://github.com/numba/numba/issues/new?template=bug_report.md +""" + +feedback_details = """ +Please report the error message and traceback, along with a minimal reproducer +at: https://github.com/numba/numba/issues/new?template=bug_report.md + +If more help is needed please feel free to speak to the Numba core developers +directly at: https://gitter.im/numba/numba + +Thanks in advance for your help in improving Numba! +""" + +unsupported_error_info = """ +Unsupported functionality was found in the code Numba was trying to compile. + +If this functionality is important to you please file a feature request at: +https://github.com/numba/numba/issues/new?template=feature_request.md +""" + +interpreter_error_info = """ +Unsupported Python functionality was found in the code Numba was trying to +compile. This error could be due to invalid code, does the code work +without Numba? (To temporarily disable Numba JIT, set the `NUMBA_DISABLE_JIT` +environment variable to non-zero, and then rerun the code). + +If the code is valid and the unsupported functionality is important to you +please file a feature request at: +https://github.com/numba/numba/issues/new?template=feature_request.md + +To see Python/NumPy features supported by the latest release of Numba visit: +https://numba.readthedocs.io/en/stable/reference/pysupported.html +and +https://numba.readthedocs.io/en/stable/reference/numpysupported.html +""" + +constant_inference_info = """ +Numba could not make a constant out of something that it decided should be +a constant. This could well be a current limitation in Numba's internals, +however please first check that your code is valid for compilation, +particularly with respect to string interpolation (not supported!) and +the requirement of compile time constants as arguments to exceptions: +https://numba.readthedocs.io/en/stable/reference/pysupported.html?highlight=exceptions#constructs + +If the code is valid and the unsupported functionality is important to you +please file a feature request at: +https://github.com/numba/numba/issues/new?template=feature_request.md + +If you think your code should work with Numba. %s +""" % feedback_details + +typing_error_info = """ +This is not usually a problem with Numba itself but instead often caused by +the use of unsupported features or an issue in resolving types. + +To see Python/NumPy features supported by the latest release of Numba visit: +https://numba.readthedocs.io/en/stable/reference/pysupported.html +and +https://numba.readthedocs.io/en/stable/reference/numpysupported.html + +For more information about typing errors and how to debug them visit: +https://numba.readthedocs.io/en/stable/user/troubleshoot.html#my-code-doesn-t-compile + +If you think your code should work with Numba, please report the error message +and traceback, along with a minimal reproducer at: +https://github.com/numba/numba/issues/new?template=bug_report.md +""" + +reportable_issue_info = """ +------------------------------------------------------------------------------- +This should not have happened, a problem has occurred in Numba's internals. +You are currently using Numba version %s. +%s +""" % (numba.__version__, feedback_details) + +error_extras = dict() +error_extras['unsupported_error'] = unsupported_error_info +error_extras['typing'] = typing_error_info +error_extras['reportable'] = reportable_issue_info +error_extras['interpreter'] = interpreter_error_info +error_extras['constant_inference'] = constant_inference_info + + +def deprecated(arg): + """Define a deprecation decorator. + An optional string should refer to the new API to be used instead. + + Example: + @deprecated + def old_func(): ... + + @deprecated('new_func') + def old_func(): ...""" + + subst = arg if isinstance(arg, str) else None + + def decorator(func): + def wrapper(*args, **kwargs): + msg = "Call to deprecated function \"{}\"." + if subst: + msg += "\n Use \"{}\" instead." + warnings.warn(msg.format(func.__name__, subst), + category=DeprecationWarning, stacklevel=2) + return func(*args, **kwargs) + + return wraps(func)(wrapper) + + if not subst: + return decorator(arg) + else: + return decorator + + +class WarningsFixer(object): + """ + An object "fixing" warnings of a given category caught during + certain phases. The warnings can have their filename and lineno fixed, + and they are deduplicated as well. + + When used as a context manager, any warnings caught by `.catch_warnings()` + will be flushed at the exit of the context manager. + """ + + def __init__(self, category): + self._category = category + # {(filename, lineno, category) -> messages} + self._warnings = defaultdict(set) + + @contextlib.contextmanager + def catch_warnings(self, filename=None, lineno=None): + """ + Store warnings and optionally fix their filename and lineno. + """ + with warnings.catch_warnings(record=True) as wlist: + warnings.simplefilter('always', self._category) + yield + + for w in wlist: + msg = str(w.message) + if issubclass(w.category, self._category): + # Store warnings of this category for deduplication + filename = filename or w.filename + lineno = lineno or w.lineno + self._warnings[filename, lineno, w.category].add(msg) + else: + # Simply emit other warnings again + warnings.warn_explicit(msg, w.category, + w.filename, w.lineno) + + def flush(self): + """ + Emit all stored warnings. + """ + def key(arg): + # It is possible through codegen to create entirely identical + # warnings, this leads to comparing types when sorting which breaks + # on Python 3. Key as str() and if the worse happens then `id` + # creates some uniqueness + return str(arg) + str(id(arg)) + + for (filename, lineno, category), messages in sorted( + self._warnings.items(), key=key): + for msg in sorted(messages): + warnings.warn_explicit(msg, category, filename, lineno) + self._warnings.clear() + + def __enter__(self): + return + + def __exit__(self, exc_type, exc_value, traceback): + self.flush() + + +class NumbaError(Exception): + def __init__(self, msg, loc=None, highlighting=True): + self.msg = msg + self.loc = loc + if highlighting: + highlight = termcolor().errmsg + else: + def highlight(x): + return x + + if loc: + new_msg = "%s\n%s\n" % (msg, loc.strformat()) + else: + new_msg = "%s" % (msg,) + super(NumbaError, self).__init__(highlight(new_msg)) + + @property + def contexts(self): + try: + return self._contexts + except AttributeError: + self._contexts = lst = [] + return lst + + def add_context(self, msg): + """ + Add contextual info. The exception message is expanded with the new + contextual information. + """ + self.contexts.append(msg) + f = termcolor().errmsg('{0}\n') + termcolor().filename('During: {1}') + newmsg = f.format(self, msg) + self.args = (newmsg,) + return self + + def patch_message(self, new_message): + """ + Change the error message to the given new message. + """ + self.args = (new_message,) + self.args[1:] + + +class UnsupportedError(NumbaError): + """ + Numba does not have an implementation for this functionality. + """ + + +class UnsupportedBytecodeError(Exception): + """Unsupported bytecode is non-recoverable + """ + def __init__(self, msg, loc=None): + super().__init__(f"{msg}. Raised from {loc}") + + +class UnsupportedRewriteError(UnsupportedError): + """UnsupportedError from rewrite passes + """ + pass + + +class IRError(NumbaError): + """ + An error occurred during Numba IR generation. + """ + pass + + +class RedefinedError(IRError): + """ + An error occurred during interpretation of IR due to variable redefinition. + """ + pass + + +class NotDefinedError(IRError): + """ + An undefined variable is encountered during interpretation of IR. + """ + + def __init__(self, name, loc=None): + self.name = name + msg = ("The compiler failed to analyze the bytecode. " + "Variable '%s' is not defined." % name) + super(NotDefinedError, self).__init__(msg, loc=loc) + + +class VerificationError(IRError): + """ + An error occurred during IR verification. Once Numba's internal + representation (IR) is constructed it is then verified to ensure that + terminators are both present and in the correct places within the IR. If + it is the case that this condition is not met, a VerificationError is + raised. + """ + pass + + +class DeprecationError(NumbaError): + """ + Functionality is deprecated. + """ + pass + + +class LoweringError(NumbaError): + """ + An error occurred during lowering. + """ + + def __init__(self, msg, loc=None): + super(LoweringError, self).__init__(msg, loc=loc) + + +class UnsupportedParforsError(NumbaError): + """ + An error occurred because parfors is not supported on the platform. + """ + pass + + +class ForbiddenConstruct(LoweringError): + """ + A forbidden Python construct was encountered (e.g. use of locals()). + """ + pass + + +class TypingError(NumbaError): + """ + A type inference failure. + """ + pass + + +class UntypedAttributeError(TypingError): + def __init__(self, value, attr, loc=None): + module = getattr(value, 'pymod', None) + if module is not None and module == np: + # unsupported numpy feature. + msg = ("Use of unsupported NumPy function 'numpy.%s' " + "or unsupported use of the function.") % attr + else: + msg = "Unknown attribute '{attr}' of type {type}" + msg = msg.format(type=value, attr=attr) + super(UntypedAttributeError, self).__init__(msg, loc=loc) + + +class ByteCodeSupportError(NumbaError): + """ + Failure to extract the bytecode of the user's function. + """ + + def __init__(self, msg, loc=None): + super(ByteCodeSupportError, self).__init__(msg, loc=loc) + + +class CompilerError(NumbaError): + """ + Some high-level error in the compiler. + """ + pass + + +class ConstantInferenceError(NumbaError): + """ + Failure during constant inference. + """ + + def __init__(self, value, loc=None): + super(ConstantInferenceError, self).__init__(value, loc=loc) + + +class InternalError(NumbaError): + """ + For wrapping internal error occurred within the compiler + """ + + def __init__(self, exception): + super(InternalError, self).__init__(str(exception)) + self.old_exception = exception + + +class InternalTargetMismatchError(InternalError): + """For signalling a target mismatch error occurred internally within the + compiler. + """ + def __init__(self, kind, target_hw, hw_clazz): + msg = (f"{kind.title()} being resolved on a target from which it does " + f"not inherit. Local target is {target_hw}, declared " + f"target class is {hw_clazz}.") + super().__init__(msg) + + +class NonexistentTargetError(InternalError): + """For signalling that a target that does not exist was requested. + """ + pass + + +class RequireLiteralValue(TypingError): + """ + For signalling that a function's typing requires a constant value for + some of its arguments. + """ + pass + + +class ForceLiteralArg(NumbaError): + """A Pseudo-exception to signal the dispatcher to type an argument literally + + Attributes + ---------- + requested_args : frozenset[int] + requested positions of the arguments. + """ + def __init__(self, arg_indices, fold_arguments=None, loc=None): + """ + Parameters + ---------- + arg_indices : Sequence[int] + requested positions of the arguments. + fold_arguments: callable + A function ``(tuple, dict) -> tuple`` that binds and flattens + the ``args`` and ``kwargs``. + loc : numba.ir.Loc or None + """ + super(ForceLiteralArg, self).__init__( + "Pseudo-exception to force literal arguments in the dispatcher", + loc=loc, + ) + self.requested_args = frozenset(arg_indices) + self.fold_arguments = fold_arguments + + def bind_fold_arguments(self, fold_arguments): + """Bind the fold_arguments function + """ + # to avoid circular import + from numba.core.utils import chain_exception + + e = ForceLiteralArg(self.requested_args, fold_arguments, + loc=self.loc) + return chain_exception(e, self) + + def combine(self, other): + """Returns a new instance by or'ing the requested_args. + """ + if not isinstance(other, ForceLiteralArg): + m = '*other* must be a {} but got a {} instead' + raise TypeError(m.format(ForceLiteralArg, type(other))) + return ForceLiteralArg(self.requested_args | other.requested_args) + + def __or__(self, other): + """Same as self.combine(other) + """ + return self.combine(other) + + +class LiteralTypingError(TypingError): + """ + Failure in typing a Literal type + """ + pass + + +# These Exception classes are just Numba copies of their Python equivalents for +# use internally in cases where we want e.g. type inference to keep on trying. +# Exceptions extending from NumbaError are considered "special" by Numba's +# internals and are treated differently to standard Python exceptions which are +# permitted to just propagate up the stack. + +class NumbaValueError(TypingError): + pass + + +class NumbaTypeError(TypingError): + pass + + +class NumbaAttributeError(TypingError): + pass + + +class NumbaAssertionError(TypingError): + pass + + +class NumbaNotImplementedError(TypingError): + pass + + +class NumbaKeyError(TypingError): + pass + + +class NumbaIndexError(TypingError): + pass + + +class NumbaRuntimeError(NumbaError): + pass + + +def _format_msg(fmt, args, kwargs): + return fmt.format(*args, **kwargs) + + +_numba_path = os.path.dirname(__file__) +loc_info = {} + + +@contextlib.contextmanager +def new_error_context(fmt_, *args, **kwargs): + """ + A contextmanager that prepend contextual information to any exception + raised within. + + The first argument is a message that describes the context. It can be a + format string. If there are additional arguments, it will be used as + ``fmt_.format(*args, **kwargs)`` to produce the final message string. + """ + loc = kwargs.get('loc', None) + if loc is not None and not loc.filename.startswith(_numba_path): + loc_info.update(kwargs) + + try: + yield + except NumbaError as e: + e.add_context(_format_msg(fmt_, args, kwargs)) + raise + + +__all__ += [name for (name, value) in globals().items() + if not name.startswith('_') and isinstance(value, type) + and issubclass(value, (Exception, Warning))] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/event.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/event.py new file mode 100644 index 0000000000000000000000000000000000000000..7190db75b28454ede95bcac9de7e4a504209ba86 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/event.py @@ -0,0 +1,485 @@ +""" +The ``numba.core.event`` module provides a simple event system for applications +to register callbacks to listen to specific compiler events. + +The following events are built in: + +- ``"numba:compile"`` is broadcast when a dispatcher is compiling. Events of + this kind have ``data`` defined to be a ``dict`` with the following + key-values: + + - ``"dispatcher"``: the dispatcher object that is compiling. + - ``"args"``: the argument types. + - ``"return_type"``: the return type. + +- ``"numba:compiler_lock"`` is broadcast when the internal compiler-lock is + acquired. This is mostly used internally to measure time spent with the lock + acquired. + +- ``"numba:llvm_lock"`` is broadcast when the internal LLVM-lock is acquired. + This is used internally to measure time spent with the lock acquired. + +- ``"numba:run_pass"`` is broadcast when a compiler pass is running. + + - ``"name"``: pass name. + - ``"qualname"``: qualified name of the function being compiled. + - ``"module"``: module name of the function being compiled. + - ``"flags"``: compilation flags. + - ``"args"``: argument types. + - ``"return_type"`` return type. + +Applications can register callbacks that are listening for specific events using +``register(kind: str, listener: Listener)``, where ``listener`` is an instance +of ``Listener`` that defines custom actions on occurrence of the specific event. +""" + +import os +import json +import atexit +import abc +import enum +import time +import threading +from timeit import default_timer as timer +from contextlib import contextmanager, ExitStack +from collections import defaultdict + +from numba.core import config, utils + + +class EventStatus(enum.Enum): + """Status of an event. + """ + START = enum.auto() + END = enum.auto() + + +# Builtin event kinds. +_builtin_kinds = frozenset([ + "numba:compiler_lock", + "numba:compile", + "numba:llvm_lock", + "numba:run_pass", +]) + + +def _guard_kind(kind): + """Guard to ensure that an event kind is valid. + + All event kinds with a "numba:" prefix must be defined in the pre-defined + ``numba.core.event._builtin_kinds``. + Custom event kinds are allowed by not using the above prefix. + + Parameters + ---------- + kind : str + + Return + ------ + res : str + """ + if kind.startswith("numba:") and kind not in _builtin_kinds: + msg = (f"{kind} is not a valid event kind, " + "it starts with the reserved prefix 'numba:'") + raise ValueError(msg) + return kind + + +class Event: + """An event. + + Parameters + ---------- + kind : str + status : EventStatus + data : any; optional + Additional data for the event. + exc_details : 3-tuple; optional + Same 3-tuple for ``__exit__``. + """ + def __init__(self, kind, status, data=None, exc_details=None): + self._kind = _guard_kind(kind) + self._status = status + self._data = data + self._exc_details = (None + if exc_details is None or exc_details[0] is None + else exc_details) + + @property + def kind(self): + """Event kind + + Returns + ------- + res : str + """ + return self._kind + + @property + def status(self): + """Event status + + Returns + ------- + res : EventStatus + """ + return self._status + + @property + def data(self): + """Event data + + Returns + ------- + res : object + """ + return self._data + + @property + def is_start(self): + """Is it a *START* event? + + Returns + ------- + res : bool + """ + return self._status == EventStatus.START + + @property + def is_end(self): + """Is it an *END* event? + + Returns + ------- + res : bool + """ + return self._status == EventStatus.END + + @property + def is_failed(self): + """Is the event carrying an exception? + + This is used for *END* event. This method will never return ``True`` + in a *START* event. + + Returns + ------- + res : bool + """ + return self._exc_details is None + + def __str__(self): + data = (f"{type(self.data).__qualname__}" + if self.data is not None else "None") + return f"Event({self._kind}, {self._status}, data: {data})" + + __repr__ = __str__ + + +_registered = defaultdict(list) + + +def register(kind, listener): + """Register a listener for a given event kind. + + Parameters + ---------- + kind : str + listener : Listener + """ + assert isinstance(listener, Listener) + kind = _guard_kind(kind) + _registered[kind].append(listener) + + +def unregister(kind, listener): + """Unregister a listener for a given event kind. + + Parameters + ---------- + kind : str + listener : Listener + """ + assert isinstance(listener, Listener) + kind = _guard_kind(kind) + lst = _registered[kind] + lst.remove(listener) + + +def broadcast(event): + """Broadcast an event to all registered listeners. + + Parameters + ---------- + event : Event + """ + for listener in _registered[event.kind]: + listener.notify(event) + + +class Listener(abc.ABC): + """Base class for all event listeners. + """ + @abc.abstractmethod + def on_start(self, event): + """Called when there is a *START* event. + + Parameters + ---------- + event : Event + """ + pass + + @abc.abstractmethod + def on_end(self, event): + """Called when there is a *END* event. + + Parameters + ---------- + event : Event + """ + pass + + def notify(self, event): + """Notify this Listener with the given Event. + + Parameters + ---------- + event : Event + """ + if event.is_start: + self.on_start(event) + elif event.is_end: + self.on_end(event) + else: + raise AssertionError("unreachable") + + +class TimingListener(Listener): + """A listener that measures the total time spent between *START* and + *END* events during the time this listener is active. + """ + def __init__(self): + self._depth = 0 + + def on_start(self, event): + if self._depth == 0: + self._ts = timer() + self._depth += 1 + + def on_end(self, event): + self._depth -= 1 + if self._depth == 0: + last = getattr(self, "_duration", 0) + self._duration = (timer() - self._ts) + last + + @property + def done(self): + """Returns a ``bool`` indicating whether a measurement has been made. + + When this returns ``False``, the matching event has never fired. + If and only if this returns ``True``, ``.duration`` can be read without + error. + """ + return hasattr(self, "_duration") + + @property + def duration(self): + """Returns the measured duration. + + This may raise ``AttributeError``. Users can use ``.done`` to check + that a measurement has been made. + """ + return self._duration + + +class RecordingListener(Listener): + """A listener that records all events and stores them in the ``.buffer`` + attribute as a list of 2-tuple ``(float, Event)``, where the first element + is the time the event occurred as returned by ``time.time()`` and the second + element is the event. + """ + def __init__(self): + self.buffer = [] + + def on_start(self, event): + self.buffer.append((time.time(), event)) + + def on_end(self, event): + self.buffer.append((time.time(), event)) + + +@contextmanager +def install_listener(kind, listener): + """Install a listener for event "kind" temporarily within the duration of + the context. + + Returns + ------- + res : Listener + The *listener* provided. + + Examples + -------- + + >>> with install_listener("numba:compile", listener): + >>> some_code() # listener will be active here. + >>> other_code() # listener will be unregistered by this point. + + """ + register(kind, listener) + try: + yield listener + finally: + unregister(kind, listener) + + +@contextmanager +def install_timer(kind, callback): + """Install a TimingListener temporarily to measure the duration of + an event. + + If the context completes successfully, the *callback* function is executed. + The *callback* function is expected to take a float argument for the + duration in seconds. + + Returns + ------- + res : TimingListener + + Examples + -------- + + This is equivalent to: + + >>> with install_listener(kind, TimingListener()) as res: + >>> ... + """ + tl = TimingListener() + with install_listener(kind, tl): + yield tl + + if tl.done: + callback(tl.duration) + + +@contextmanager +def install_recorder(kind): + """Install a RecordingListener temporarily to record all events. + + Once the context is closed, users can use ``RecordingListener.buffer`` + to access the recorded events. + + Returns + ------- + res : RecordingListener + + Examples + -------- + + This is equivalent to: + + >>> with install_listener(kind, RecordingListener()) as res: + >>> ... + """ + rl = RecordingListener() + with install_listener(kind, rl): + yield rl + + +def start_event(kind, data=None): + """Trigger the start of an event of *kind* with *data*. + + Parameters + ---------- + kind : str + Event kind. + data : any; optional + Extra event data. + """ + evt = Event(kind=kind, status=EventStatus.START, data=data) + broadcast(evt) + + +def end_event(kind, data=None, exc_details=None): + """Trigger the end of an event of *kind*, *exc_details*. + + Parameters + ---------- + kind : str + Event kind. + data : any; optional + Extra event data. + exc_details : 3-tuple; optional + Same 3-tuple for ``__exit__``. Or, ``None`` if no error. + """ + evt = Event( + kind=kind, status=EventStatus.END, data=data, exc_details=exc_details, + ) + broadcast(evt) + + +@contextmanager +def trigger_event(kind, data=None): + """A context manager to trigger the start and end events of *kind* with + *data*. The start event is triggered when entering the context. + The end event is triggered when exiting the context. + + Parameters + ---------- + kind : str + Event kind. + data : any; optional + Extra event data. + """ + with ExitStack() as scope: + @scope.push + def on_exit(*exc_details): + end_event(kind, data=data, exc_details=exc_details) + + start_event(kind, data=data) + yield + + +def _prepare_chrome_trace_data(listener: RecordingListener): + """Prepare events in `listener` for serializing as chrome trace data. + """ + # The spec for the trace event format can be found at: + # https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit # noqa + # This code only uses the JSON Array Format for simplicity. + pid = os.getpid() + tid = threading.get_native_id() + evs = [] + for ts, rec in listener.buffer: + data = rec.data + cat = str(rec.kind) + ts_scaled = ts * 1_000_000 # scale to microseconds + ph = 'B' if rec.is_start else 'E' + name = data['name'] + args = data + ev = dict( + cat=cat, pid=pid, tid=tid, ts=ts_scaled, ph=ph, name=name, + args=args, + ) + evs.append(ev) + return evs + + +def _setup_chrome_trace_exit_handler(): + """Setup a RecordingListener and an exit handler to write the captured + events to file. + """ + listener = RecordingListener() + register("numba:run_pass", listener) + filename = config.CHROME_TRACE + + @atexit.register + def _write_chrome_trace(): + # The following output file is not multi-process safe. + evs = _prepare_chrome_trace_data(listener) + with open(filename, "w") as out: + json.dump(evs, out, cls=utils._LazyJSONEncoder) + + +if config.CHROME_TRACE: + _setup_chrome_trace_exit_handler() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/extending.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/extending.py new file mode 100644 index 0000000000000000000000000000000000000000..e4da9109988124024b6a8e7d30f733026bf764bd --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/extending.py @@ -0,0 +1,587 @@ +import os +import uuid +import weakref +import collections +import functools + +import numba +from numba.core import types, errors, utils, config + +# Exported symbols +from numba.core.typing.typeof import typeof_impl # noqa: F401 +from numba.core.typing.asnumbatype import as_numba_type # noqa: F401 +from numba.core.typing.templates import infer, infer_getattr # noqa: F401 +from numba.core.imputils import ( # noqa: F401 + lower_builtin, lower_getattr, lower_getattr_generic, # noqa: F401 + lower_setattr, lower_setattr_generic, lower_cast) # noqa: F401 +from numba.core.datamodel import models # noqa: F401 +from numba.core.datamodel import register_default as register_model # noqa: F401, E501 +from numba.core.pythonapi import box, unbox, reflect, NativeValue # noqa: F401 +from numba._helperlib import _import_cython_function # noqa: F401 +from numba.core.serialize import ReduceMixin + + +def type_callable(func): + """ + Decorate a function as implementing typing for the callable *func*. + *func* can be a callable object (probably a global) or a string + denoting a built-in operation (such 'getitem' or '__array_wrap__') + """ + from numba.core.typing.templates import (CallableTemplate, infer, + infer_global) + if not callable(func) and not isinstance(func, str): + raise TypeError("`func` should be a function or string") + try: + func_name = func.__name__ + except AttributeError: + func_name = str(func) + + def decorate(typing_func): + def generic(self): + return typing_func(self.context) + + name = "%s_CallableTemplate" % (func_name,) + bases = (CallableTemplate,) + class_dict = dict(key=func, generic=generic) + template = type(name, bases, class_dict) + infer(template) + if callable(func): + infer_global(func, types.Function(template)) + return typing_func + + return decorate + + +# By default, an *overload* does not have a cpython wrapper because it is not +# callable from python. It also has `nopython=True`, this has been default since +# its inception! +_overload_default_jit_options = {'no_cpython_wrapper': True, + 'nopython':True} + + +def overload(func, jit_options={}, strict=True, inline='never', + prefer_literal=False, **kwargs): + """ + A decorator marking the decorated function as typing and implementing + *func* in nopython mode. + + The decorated function will have the same formal parameters as *func* + and be passed the Numba types of those parameters. It should return + a function implementing *func* for the given types. + + Here is an example implementing len() for tuple types:: + + @overload(len) + def tuple_len(seq): + if isinstance(seq, types.BaseTuple): + n = len(seq) + def len_impl(seq): + return n + return len_impl + + Compiler options can be passed as an dictionary using the **jit_options** + argument. + + Overloading strictness (that the typing and implementing signatures match) + is enforced by the **strict** keyword argument, it is recommended that this + is set to True (default). + + To handle a function that accepts imprecise types, an overload + definition can return 2-tuple of ``(signature, impl_function)``, where + the ``signature`` is a ``typing.Signature`` specifying the precise + signature to be used; and ``impl_function`` is the same implementation + function as in the simple case. + + If the kwarg inline determines whether the overload is inlined in the + calling function and can be one of three values: + * 'never' (default) - the overload is never inlined. + * 'always' - the overload is always inlined. + * a function that takes two arguments, both of which are instances of a + namedtuple with fields: + * func_ir + * typemap + * calltypes + * signature + The first argument holds the information from the caller, the second + holds the information from the callee. The function should return Truthy + to determine whether to inline, this essentially permitting custom + inlining rules (typical use might be cost models). + + The *prefer_literal* option allows users to control if literal types should + be tried first or last. The default (`False`) is to use non-literal types. + Implementations that can specialize based on literal values should set the + option to `True`. Note, this option maybe expanded in the near future to + allow for more control (e.g. disabling non-literal types). + + **kwargs prescribes additional arguments passed through to the overload + template. The only accepted key at present is 'target' which is a string + corresponding to the target that this overload should be bound against. + """ + from numba.core.typing.templates import make_overload_template, infer_global + + # set default options + opts = _overload_default_jit_options.copy() + opts.update(jit_options) # let user options override + + # TODO: abort now if the kwarg 'target' relates to an unregistered target, + # this requires sorting out the circular imports first. + + def decorate(overload_func): + template = make_overload_template(func, overload_func, opts, strict, + inline, prefer_literal, **kwargs) + infer(template) + if callable(func): + infer_global(func, types.Function(template)) + return overload_func + + return decorate + + +def register_jitable(*args, **kwargs): + """ + Register a regular python function that can be executed by the python + interpreter and can be compiled into a nopython function when referenced + by other jit'ed functions. Can be used as:: + + @register_jitable + def foo(x, y): + return x + y + + Or, with compiler options:: + + @register_jitable(_nrt=False) # disable runtime allocation + def foo(x, y): + return x + y + + """ + def wrap(fn): + # It is just a wrapper for @overload + inline = kwargs.pop('inline', 'never') + + @overload(fn, jit_options=kwargs, inline=inline, strict=False) + def ov_wrap(*args, **kwargs): + return fn + return fn + + if kwargs: + return wrap + else: + return wrap(*args) + + +def overload_attribute(typ, attr, **kwargs): + """ + A decorator marking the decorated function as typing and implementing + attribute *attr* for the given Numba type in nopython mode. + + *kwargs* are passed to the underlying `@overload` call. + + Here is an example implementing .nbytes for array types:: + + @overload_attribute(types.Array, 'nbytes') + def array_nbytes(arr): + def get(arr): + return arr.size * arr.itemsize + return get + """ + # TODO implement setters + from numba.core.typing.templates import make_overload_attribute_template + + def decorate(overload_func): + template = make_overload_attribute_template( + typ, attr, overload_func, + **kwargs + ) + infer_getattr(template) + overload(overload_func, **kwargs)(overload_func) + return overload_func + + return decorate + + +def _overload_method_common(typ, attr, **kwargs): + """Common code for overload_method and overload_classmethod + """ + from numba.core.typing.templates import make_overload_method_template + + def decorate(overload_func): + copied_kwargs = kwargs.copy() # avoid mutating parent dict + template = make_overload_method_template( + typ, attr, overload_func, + inline=copied_kwargs.pop('inline', 'never'), + prefer_literal=copied_kwargs.pop('prefer_literal', False), + **copied_kwargs, + ) + infer_getattr(template) + overload(overload_func, **kwargs)(overload_func) + return overload_func + + return decorate + + +def overload_method(typ, attr, **kwargs): + """ + A decorator marking the decorated function as typing and implementing + method *attr* for the given Numba type in nopython mode. + + *kwargs* are passed to the underlying `@overload` call. + + Here is an example implementing .take() for array types:: + + @overload_method(types.Array, 'take') + def array_take(arr, indices): + if isinstance(indices, types.Array): + def take_impl(arr, indices): + n = indices.shape[0] + res = np.empty(n, arr.dtype) + for i in range(n): + res[i] = arr[indices[i]] + return res + return take_impl + """ + return _overload_method_common(typ, attr, **kwargs) + + +def overload_classmethod(typ, attr, **kwargs): + """ + A decorator marking the decorated function as typing and implementing + classmethod *attr* for the given Numba type in nopython mode. + + + Similar to ``overload_method``. + + + Here is an example implementing a classmethod on the Array type to call + ``np.arange()``:: + + @overload_classmethod(types.Array, "make") + def ov_make(cls, nitems): + def impl(cls, nitems): + return np.arange(nitems) + return impl + + The above code will allow the following to work in jit-compiled code:: + + @njit + def foo(n): + return types.Array.make(n) + """ + return _overload_method_common(types.TypeRef(typ), attr, **kwargs) + + +def make_attribute_wrapper(typeclass, struct_attr, python_attr): + """ + Make an automatic attribute wrapper exposing member named *struct_attr* + as a read-only attribute named *python_attr*. + The given *typeclass*'s model must be a StructModel subclass. + """ + from numba.core.typing.templates import AttributeTemplate + from numba.core.datamodel import default_manager + from numba.core.datamodel.models import StructModel + from numba.core.imputils import impl_ret_borrowed + from numba.core import cgutils + + if not isinstance(typeclass, type) or not issubclass(typeclass, types.Type): + raise TypeError("typeclass should be a Type subclass, got %s" + % (typeclass,)) + + def get_attr_fe_type(typ): + """ + Get the Numba type of member *struct_attr* in *typ*. + """ + model = default_manager.lookup(typ) + if not isinstance(model, StructModel): + raise TypeError("make_struct_attribute_wrapper() needs a type " + "with a StructModel, but got %s" % (model,)) + return model.get_member_fe_type(struct_attr) + + @infer_getattr + class StructAttribute(AttributeTemplate): + key = typeclass + + def generic_resolve(self, typ, attr): + if attr == python_attr: + return get_attr_fe_type(typ) + + @lower_getattr(typeclass, python_attr) + def struct_getattr_impl(context, builder, typ, val): + val = cgutils.create_struct_proxy(typ)(context, builder, value=val) + attrty = get_attr_fe_type(typ) + attrval = getattr(val, struct_attr) + return impl_ret_borrowed(context, builder, attrty, attrval) + + +class _Intrinsic(ReduceMixin): + """ + Dummy callable for intrinsic + """ + _memo = weakref.WeakValueDictionary() + # hold refs to last N functions deserialized, retaining them in _memo + # regardless of whether there is another reference + _recent = collections.deque(maxlen=config.FUNCTION_CACHE_SIZE) + + __uuid = None + + def __init__(self, name, defn, prefer_literal=False, **kwargs): + self._ctor_kwargs = kwargs + self._name = name + self._defn = defn + self._prefer_literal = prefer_literal + functools.update_wrapper(self, defn) + + @property + def _uuid(self): + """ + An instance-specific UUID, to avoid multiple deserializations of + a given instance. + + Note this is lazily-generated, for performance reasons. + """ + u = self.__uuid + if u is None: + u = str(uuid.uuid1()) + self._set_uuid(u) + return u + + def _set_uuid(self, u): + assert self.__uuid is None + self.__uuid = u + self._memo[u] = self + self._recent.append(self) + + def _register(self): + # _ctor_kwargs + from numba.core.typing.templates import (make_intrinsic_template, + infer_global) + + template = make_intrinsic_template(self, self._defn, self._name, + prefer_literal=self._prefer_literal, + kwargs=self._ctor_kwargs) + infer(template) + infer_global(self, types.Function(template)) + + def __call__(self, *args, **kwargs): + """ + This is only defined to pretend to be a callable from CPython. + """ + msg = '{0} is not usable in pure-python'.format(self) + raise NotImplementedError(msg) + + def __repr__(self): + return "".format(self._name) + + def __deepcopy__(self, memo): + # NOTE: Intrinsic are immutable and we don't need to copy. + # This is triggered from deepcopy of statements. + return self + + def _reduce_states(self): + """ + NOTE: part of ReduceMixin protocol + """ + return dict(uuid=self._uuid, name=self._name, defn=self._defn) + + @classmethod + def _rebuild(cls, uuid, name, defn): + """ + NOTE: part of ReduceMixin protocol + """ + try: + return cls._memo[uuid] + except KeyError: + llc = cls(name=name, defn=defn) + llc._register() + llc._set_uuid(uuid) + return llc + + +def intrinsic(*args, **kwargs): + """ + A decorator marking the decorated function as typing and implementing + *func* in nopython mode using the llvmlite IRBuilder API. This is an escape + hatch for expert users to build custom LLVM IR that will be inlined to + the caller. + + The first argument to *func* is the typing context. The rest of the + arguments corresponds to the type of arguments of the decorated function. + These arguments are also used as the formal argument of the decorated + function. If *func* has the signature ``foo(typing_context, arg0, arg1)``, + the decorated function will have the signature ``foo(arg0, arg1)``. + + The return values of *func* should be a 2-tuple of expected type signature, + and a code-generation function that will passed to ``lower_builtin``. + For unsupported operation, return None. + + Here is an example implementing a ``cast_int_to_byte_ptr`` that cast + any integer to a byte pointer:: + + @intrinsic + def cast_int_to_byte_ptr(typingctx, src): + # check for accepted types + if isinstance(src, types.Integer): + # create the expected type signature + result_type = types.CPointer(types.uint8) + sig = result_type(types.uintp) + # defines the custom code generation + def codegen(context, builder, signature, args): + # llvm IRBuilder code here + [src] = args + rtype = signature.return_type + llrtype = context.get_value_type(rtype) + return builder.inttoptr(src, llrtype) + return sig, codegen + """ + # Make inner function for the actual work + def _intrinsic(func): + name = getattr(func, '__name__', str(func)) + llc = _Intrinsic(name, func, **kwargs) + llc._register() + return llc + + if not kwargs: + # No option is given + return _intrinsic(*args) + else: + # options are given, create a new callable to recv the + # definition function + def wrapper(func): + return _intrinsic(func) + return wrapper + + +def get_cython_function_address(module_name, function_name): + """ + Get the address of a Cython function. + + Args + ---- + module_name: + Name of the Cython module + function_name: + Name of the Cython function + + Returns + ------- + A Python int containing the address of the function + + """ + return _import_cython_function(module_name, function_name) + + +def include_path(): + """Returns the C include directory path. + """ + include_dir = os.path.dirname(os.path.dirname(numba.__file__)) + path = os.path.abspath(include_dir) + return path + + +def sentry_literal_args(pysig, literal_args, args, kwargs): + """Ensures that the given argument types (in *args* and *kwargs*) are + literally typed for a function with the python signature *pysig* and the + list of literal argument names in *literal_args*. + + Alternatively, this is the same as:: + + SentryLiteralArgs(literal_args).for_pysig(pysig).bind(*args, **kwargs) + """ + boundargs = pysig.bind(*args, **kwargs) + + # Find literal argument positions and whether it is satisfied. + request_pos = set() + missing = False + for i, (k, v) in enumerate(boundargs.arguments.items()): + if k in literal_args: + request_pos.add(i) + if not isinstance(v, types.Literal): + missing = True + if missing: + # Yes, there are missing required literal arguments + e = errors.ForceLiteralArg(request_pos) + + # A helper function to fold arguments + def folded(args, kwargs): + out = pysig.bind(*args, **kwargs).arguments.values() + return tuple(out) + + raise e.bind_fold_arguments(folded) + + +class SentryLiteralArgs(collections.namedtuple( + '_SentryLiteralArgs', ['literal_args'])): + """ + Parameters + ---------- + literal_args : Sequence[str] + A sequence of names for literal arguments + + Examples + -------- + + The following line: + + >>> SentryLiteralArgs(literal_args).for_pysig(pysig).bind(*args, **kwargs) + + is equivalent to: + + >>> sentry_literal_args(pysig, literal_args, args, kwargs) + """ + def for_function(self, func): + """Bind the sentry to the signature of *func*. + + Parameters + ---------- + func : Function + A python function. + + Returns + ------- + obj : BoundLiteralArgs + """ + return self.for_pysig(utils.pysignature(func)) + + def for_pysig(self, pysig): + """Bind the sentry to the given signature *pysig*. + + Parameters + ---------- + pysig : inspect.Signature + + + Returns + ------- + obj : BoundLiteralArgs + """ + return BoundLiteralArgs( + pysig=pysig, + literal_args=self.literal_args, + ) + + +class BoundLiteralArgs(collections.namedtuple( + 'BoundLiteralArgs', ['pysig', 'literal_args'])): + """ + This class is usually created by SentryLiteralArgs. + """ + def bind(self, *args, **kwargs): + """Bind to argument types. + """ + return sentry_literal_args( + self.pysig, + self.literal_args, + args, + kwargs, + ) + + +def is_jitted(function): + """Returns True if a function is wrapped by one of the Numba @jit + decorators, for example: numba.jit, numba.njit + + The purpose of this function is to provide a means to check if a function is + already JIT decorated. + """ + + # don't want to export this so import locally + from numba.core.dispatcher import Dispatcher + return isinstance(function, Dispatcher) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/externals.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/externals.py new file mode 100644 index 0000000000000000000000000000000000000000..e181b5f43d9d8dda06a84ba93a176058cc5b1543 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/externals.py @@ -0,0 +1,155 @@ +""" +Register external C functions necessary for Numba code generation. +""" + +import sys + +from llvmlite import ir +import llvmlite.binding as ll + +from numba.core import utils, intrinsics +from numba import _helperlib + + +def _add_missing_symbol(symbol, addr): + """Add missing symbol into LLVM internal symtab + """ + if not ll.address_of_symbol(symbol): + ll.add_symbol(symbol, addr) + + +def _get_msvcrt_symbol(symbol): + """ + Under Windows, look up a symbol inside the C runtime + and return the raw pointer value as an integer. + """ + from ctypes import cdll, cast, c_void_p + f = getattr(cdll.msvcrt, symbol) + return cast(f, c_void_p).value + + +def compile_multi3(context): + """ + Compile the multi3() helper function used by LLVM + for 128-bit multiplication on 32-bit platforms. + """ + codegen = context.codegen() + library = codegen.create_library("multi3") + + ir_mod = library.create_ir_module("multi3") + + i64 = ir.IntType(64) + i128 = ir.IntType(128) + lower_mask = ir.Constant(i64, 0xffffffff) + _32 = ir.Constant(i64, 32) + _64 = ir.Constant(i128, 64) + + fn_type = ir.FunctionType(i128, [i128, i128]) + fn = ir.Function(ir_mod, fn_type, name="multi3") + + a, b = fn.args + bb = fn.append_basic_block() + builder = ir.IRBuilder(bb) + + # This implementation mimics compiler-rt's. + al = builder.trunc(a, i64) + bl = builder.trunc(b, i64) + ah = builder.trunc(builder.ashr(a, _64), i64) + bh = builder.trunc(builder.ashr(b, _64), i64) + + # Compute {rh, rl} = al * bl (unsigned 64-bit multiplication) + # rl = (al & 0xffffffff) * (bl & 0xffffffff) + rl = builder.mul(builder.and_(al, lower_mask), builder.and_(bl, lower_mask)) + # t = rl >> 32 + t = builder.lshr(rl, _32) + # rl &= 0xffffffff + rl = builder.and_(rl, lower_mask) + # t += (al >> 32) * (bl & 0xffffffff) + t = builder.add(t, builder.mul(builder.lshr(al, _32), + builder.and_(bl, lower_mask))) + # rl += t << 32 + rl = builder.add(rl, builder.shl(t, _32)) + # rh = t >> 32 + rh = builder.lshr(t, _32) + # t = rl >> 32 + t = builder.lshr(rl, _32) + # rl &= 0xffffffff + rl = builder.and_(rl, lower_mask) + # t += (bl >> 32) * (al & 0xffffffff) + t = builder.add(t, builder.mul(builder.lshr(bl, _32), + builder.and_(al, lower_mask))) + # rl += t << 32 + rl = builder.add(rl, builder.shl(t, _32)) + # rh += t >> 32 + rh = builder.add(rh, builder.lshr(t, _32)) + # rh += (al >> 32) * (bl >> 32) + rh = builder.add(rh, builder.mul(builder.lshr(al, _32), + builder.lshr(bl, _32))) + + # rh += (bh * al) + (bl * ah) + rh = builder.add(rh, builder.mul(bh, al)) + rh = builder.add(rh, builder.mul(bl, ah)) + + # r = rl + (rh << 64) + r = builder.zext(rl, i128) + r = builder.add(r, builder.shl(builder.zext(rh, i128), _64)) + builder.ret(r) + + library.add_ir_module(ir_mod) + library.finalize() + + return library + + +class _Installer(object): + + _installed = False + + def install(self, context): + """ + Install the functions into LLVM. This only needs to be done once, + as the mappings are persistent during the process lifetime. + """ + if not self._installed: + self._do_install(context) + self._installed = True + + +class _ExternalMathFunctions(_Installer): + """ + Map the math functions from the C runtime library into the LLVM + execution environment. + """ + + def _do_install(self, context): + is32bit = utils.MACHINE_BITS == 32 + c_helpers = _helperlib.c_helpers + + if sys.platform.startswith('win32') and is32bit: + # For Windows XP _ftol2 is not defined, we will just use + # _ftol as a replacement. + # On Windows 7, this is not necessary but will work anyway. + ftol = _get_msvcrt_symbol("_ftol") + _add_missing_symbol("_ftol2", ftol) + + elif sys.platform.startswith('linux') and is32bit: + _add_missing_symbol("__fixunsdfdi", c_helpers["fptoui"]) + _add_missing_symbol("__fixunssfdi", c_helpers["fptouif"]) + + if is32bit: + # Make the library immortal + self._multi3_lib = compile_multi3(context) + ptr = self._multi3_lib.get_pointer_to_function("multi3") + assert ptr + _add_missing_symbol("__multi3", ptr) + + # List available C-math + for fname in intrinsics.INTR_MATH: + # Force binding from CPython's C runtime library. + # (under Windows, different versions of the C runtime can + # be loaded at the same time, for example msvcrt100 by + # CPython and msvcrt120 by LLVM) + ll.add_symbol(fname, c_helpers[fname]) + + +c_math_functions = _ExternalMathFunctions() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/fastmathpass.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/fastmathpass.py new file mode 100644 index 0000000000000000000000000000000000000000..d6dd1b89c20cb78cd9b819663aa21ce270ce4bbe --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/fastmathpass.py @@ -0,0 +1,44 @@ +from llvmlite import ir +from llvmlite.ir.transforms import Visitor, CallVisitor + + +class FastFloatBinOpVisitor(Visitor): + """ + A pass to add fastmath flag to float-binop instruction if they don't have + any flags. + """ + float_binops = frozenset(['fadd', 'fsub', 'fmul', 'fdiv', 'frem', 'fcmp']) + + def __init__(self, flags): + self.flags = flags + + def visit_Instruction(self, instr): + if instr.opname in self.float_binops: + if not instr.flags: + for flag in self.flags: + instr.flags.append(flag) + + +class FastFloatCallVisitor(CallVisitor): + """ + A pass to change all float function calls to use fastmath. + """ + + def __init__(self, flags): + self.flags = flags + + def visit_Call(self, instr): + # Add to any call that has float/double return type + if instr.type in (ir.FloatType(), ir.DoubleType()): + for flag in self.flags: + instr.fastmath.add(flag) + + +def rewrite_module(mod, options): + """ + Rewrite the given LLVM module to use fastmath everywhere. + """ + flags = options.flags + FastFloatBinOpVisitor(flags).visit(mod) + FastFloatCallVisitor(flags).visit(mod) + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/funcdesc.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/funcdesc.py new file mode 100644 index 0000000000000000000000000000000000000000..0508a3aaeed8d5746d5f76f731620d6056a190b5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/funcdesc.py @@ -0,0 +1,230 @@ +""" +Function descriptors. +""" + +from collections import defaultdict +import importlib + +from numba.core import types, itanium_mangler +from numba.core.utils import _dynamic_modname, _dynamic_module + + +def default_mangler(name, argtypes, *, abi_tags=(), uid=None): + return itanium_mangler.mangle(name, argtypes, abi_tags=abi_tags, uid=uid) + + +def qualifying_prefix(modname, qualname): + """ + Returns a new string that is used for the first half of the mangled name. + """ + # XXX choose a different convention for object mode + return '{}.{}'.format(modname, qualname) if modname else qualname + + +class FunctionDescriptor(object): + """ + Base class for function descriptors: an object used to carry + useful metadata about a natively callable function. + + Note that while `FunctionIdentity` denotes a Python function + which is being concretely compiled by Numba, `FunctionDescriptor` + may be more "abstract". + """ + __slots__ = ('native', 'modname', 'qualname', 'doc', 'typemap', + 'calltypes', 'args', 'kws', 'restype', 'argtypes', + 'mangled_name', 'unique_name', 'env_name', 'global_dict', + 'inline', 'noalias', 'abi_tags', 'uid') + + def __init__(self, native, modname, qualname, unique_name, doc, + typemap, restype, calltypes, args, kws, mangler=None, + argtypes=None, inline=False, noalias=False, env_name=None, + global_dict=None, abi_tags=(), uid=None): + self.native = native + self.modname = modname + self.global_dict = global_dict + self.qualname = qualname + self.unique_name = unique_name + self.doc = doc + # XXX typemap and calltypes should be on the compile result, + # not the FunctionDescriptor + self.typemap = typemap + self.calltypes = calltypes + self.args = args + self.kws = kws + self.restype = restype + # Argument types + if argtypes is not None: + assert isinstance(argtypes, tuple), argtypes + self.argtypes = argtypes + else: + # Get argument types from the type inference result + # (note the "arg.FOO" convention as used in typeinfer + self.argtypes = tuple(self.typemap['arg.' + a] for a in args) + mangler = default_mangler if mangler is None else mangler + # The mangled name *must* be unique, else the wrong function can + # be chosen at link time. + qualprefix = qualifying_prefix(self.modname, self.qualname) + self.uid = uid + self.mangled_name = mangler( + qualprefix, self.argtypes, abi_tags=abi_tags, uid=uid, + ) + if env_name is None: + env_name = mangler(".NumbaEnv.{}".format(qualprefix), + self.argtypes, abi_tags=abi_tags, uid=uid) + self.env_name = env_name + self.inline = inline + self.noalias = noalias + self.abi_tags = abi_tags + + def lookup_globals(self): + """ + Return the global dictionary of the function. + It may not match the Module's globals if the function is created + dynamically (i.e. exec) + """ + return self.global_dict or self.lookup_module().__dict__ + + def lookup_module(self): + """ + Return the module in which this function is supposed to exist. + This may be a dummy module if the function was dynamically + generated or the module can't be found. + """ + if self.modname == _dynamic_modname: + return _dynamic_module + else: + try: + # ensure module exist + return importlib.import_module(self.modname) + except ImportError: + return _dynamic_module + + def lookup_function(self): + """ + Return the original function object described by this object. + """ + return getattr(self.lookup_module(), self.qualname) + + @property + def llvm_func_name(self): + """ + The LLVM-registered name for the raw function. + """ + return self.mangled_name + + # XXX refactor this + + @property + def llvm_cpython_wrapper_name(self): + """ + The LLVM-registered name for a CPython-compatible wrapper of the + raw function (i.e. a PyCFunctionWithKeywords). + """ + return itanium_mangler.prepend_namespace(self.mangled_name, + ns='cpython') + + @property + def llvm_cfunc_wrapper_name(self): + """ + The LLVM-registered name for a C-compatible wrapper of the + raw function. + """ + return 'cfunc.' + self.mangled_name + + def __repr__(self): + return "" % (self.unique_name) + + @classmethod + def _get_function_info(cls, func_ir): + """ + Returns + ------- + qualname, unique_name, modname, doc, args, kws, globals + + ``unique_name`` must be a unique name. + """ + func = func_ir.func_id.func + qualname = func_ir.func_id.func_qualname + # XXX to func_id + modname = func.__module__ + doc = func.__doc__ or '' + args = tuple(func_ir.arg_names) + kws = () # TODO + global_dict = None + + if modname is None: + # Dynamically generated function. + modname = _dynamic_modname + # Retain a reference to the dictionary of the function. + # This disables caching, serialization and pickling. + global_dict = func_ir.func_id.func.__globals__ + + unique_name = func_ir.func_id.unique_name + + return qualname, unique_name, modname, doc, args, kws, global_dict + + @classmethod + def _from_python_function(cls, func_ir, typemap, restype, + calltypes, native, mangler=None, + inline=False, noalias=False, abi_tags=()): + (qualname, unique_name, modname, doc, args, kws, global_dict, + ) = cls._get_function_info(func_ir) + + self = cls(native, modname, qualname, unique_name, doc, + typemap, restype, calltypes, + args, kws, mangler=mangler, inline=inline, noalias=noalias, + global_dict=global_dict, abi_tags=abi_tags, + uid=func_ir.func_id.unique_id) + return self + + +class PythonFunctionDescriptor(FunctionDescriptor): + """ + A FunctionDescriptor subclass for Numba-compiled functions. + """ + __slots__ = () + + @classmethod + def from_specialized_function(cls, func_ir, typemap, restype, calltypes, + mangler, inline, noalias, abi_tags): + """ + Build a FunctionDescriptor for a given specialization of a Python + function (in nopython mode). + """ + return cls._from_python_function(func_ir, typemap, restype, calltypes, + native=True, mangler=mangler, + inline=inline, noalias=noalias, + abi_tags=abi_tags) + + @classmethod + def from_object_mode_function(cls, func_ir): + """ + Build a FunctionDescriptor for an object mode variant of a Python + function. + """ + typemap = defaultdict(lambda: types.pyobject) + calltypes = typemap.copy() + restype = types.pyobject + return cls._from_python_function(func_ir, typemap, restype, calltypes, + native=False) + + +class ExternalFunctionDescriptor(FunctionDescriptor): + """ + A FunctionDescriptor subclass for opaque external functions + (e.g. raw C functions). + """ + __slots__ = () + + def __init__(self, name, restype, argtypes): + args = ["arg%d" % i for i in range(len(argtypes))] + + def mangler(a, x, abi_tags, uid=None): + return a + super(ExternalFunctionDescriptor, self + ).__init__(native=True, modname=None, qualname=name, + unique_name=name, doc='', typemap=None, + restype=restype, calltypes=None, args=args, + kws=None, + mangler=mangler, + argtypes=argtypes) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/generators.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/generators.py new file mode 100644 index 0000000000000000000000000000000000000000..88456bdabb0639d10d993156d24ebf30c6eb9b8c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/generators.py @@ -0,0 +1,360 @@ +""" +Support for lowering generators. +""" + +import llvmlite.ir +from llvmlite.ir import Constant, IRBuilder + +from numba.core import types, config, cgutils +from numba.core.funcdesc import FunctionDescriptor + + +class GeneratorDescriptor(FunctionDescriptor): + """ + The descriptor for a generator's next function. + """ + __slots__ = () + + @classmethod + def from_generator_fndesc(cls, func_ir, fndesc, gentype, mangler): + """ + Build a GeneratorDescriptor for the generator returned by the + function described by *fndesc*, with type *gentype*. + + The generator inherits the env_name from the *fndesc*. + All emitted functions for the generator shares the same Env. + """ + assert isinstance(gentype, types.Generator) + restype = gentype.yield_type + args = ['gen'] + argtypes = (gentype,) + qualname = fndesc.qualname + '.next' + unique_name = fndesc.unique_name + '.next' + self = cls(fndesc.native, fndesc.modname, qualname, unique_name, + fndesc.doc, fndesc.typemap, restype, fndesc.calltypes, + args, fndesc.kws, argtypes=argtypes, mangler=mangler, + inline=False, env_name=fndesc.env_name) + return self + + @property + def llvm_finalizer_name(self): + """ + The LLVM name of the generator's finalizer function + (if .has_finalizer is true). + """ + return 'finalize_' + self.mangled_name + + +class BaseGeneratorLower(object): + """ + Base support class for lowering generators. + """ + + def __init__(self, lower): + self.context = lower.context + self.fndesc = lower.fndesc + self.library = lower.library + self.func_ir = lower.func_ir + self.lower = lower + + self.geninfo = lower.generator_info + self.gentype = self.get_generator_type() + self.gendesc = GeneratorDescriptor.from_generator_fndesc( + lower.func_ir, self.fndesc, self.gentype, self.context.mangler) + # Helps packing non-omitted arguments into a structure + self.arg_packer = self.context.get_data_packer(self.fndesc.argtypes) + + self.resume_blocks = {} + + @property + def call_conv(self): + return self.lower.call_conv + + def get_args_ptr(self, builder, genptr): + return cgutils.gep_inbounds(builder, genptr, 0, 1) + + def get_resume_index_ptr(self, builder, genptr): + return cgutils.gep_inbounds(builder, genptr, 0, 0, + name='gen.resume_index') + + def get_state_ptr(self, builder, genptr): + return cgutils.gep_inbounds(builder, genptr, 0, 2, + name='gen.state') + + def lower_init_func(self, lower): + """ + Lower the generator's initialization function (which will fill up + the passed-by-reference generator structure). + """ + lower.setup_function(self.fndesc) + + builder = lower.builder + + # Insert the generator into the target context in order to allow + # calling from other Numba-compiled functions. + lower.context.insert_generator(self.gentype, self.gendesc, + [self.library]) + + # Init argument values + lower.extract_function_arguments() + + lower.pre_lower() + + # Initialize the return structure (i.e. the generator structure). + retty = self.context.get_return_type(self.gentype) + # Structure index #0: the initial resume index (0 == start of generator) + resume_index = self.context.get_constant(types.int32, 0) + # Structure index #1: the function arguments + argsty = retty.elements[1] + statesty = retty.elements[2] + + lower.debug_print("# low_init_func incref") + # Incref all NRT arguments before storing into generator states + if self.context.enable_nrt: + for argty, argval in zip(self.fndesc.argtypes, lower.fnargs): + self.context.nrt.incref(builder, argty, argval) + + # Filter out omitted arguments + argsval = self.arg_packer.as_data(builder, lower.fnargs) + + # Zero initialize states + statesval = Constant(statesty, None) + gen_struct = cgutils.make_anonymous_struct(builder, + [resume_index, argsval, + statesval], + retty) + + retval = self.box_generator_struct(lower, gen_struct) + + lower.debug_print("# low_init_func before return") + self.call_conv.return_value(builder, retval) + lower.post_lower() + + def lower_next_func(self, lower): + """ + Lower the generator's next() function (which takes the + passed-by-reference generator structure and returns the next + yielded value). + """ + lower.setup_function(self.gendesc) + lower.debug_print("# lower_next_func: {0}".format(self.gendesc.unique_name)) + assert self.gendesc.argtypes[0] == self.gentype + builder = lower.builder + function = lower.function + + # Extract argument values and other information from generator struct + genptr, = self.call_conv.get_arguments(function) + self.arg_packer.load_into(builder, + self.get_args_ptr(builder, genptr), + lower.fnargs) + + self.resume_index_ptr = self.get_resume_index_ptr(builder, genptr) + self.gen_state_ptr = self.get_state_ptr(builder, genptr) + + prologue = function.append_basic_block("generator_prologue") + + # Lower the generator's Python code + entry_block_tail = lower.lower_function_body() + + # Add block for StopIteration on entry + stop_block = function.append_basic_block("stop_iteration") + builder.position_at_end(stop_block) + self.call_conv.return_stop_iteration(builder) + + # Add prologue switch to resume blocks + builder.position_at_end(prologue) + # First Python block is also the resume point on first next() call + first_block = self.resume_blocks[0] = lower.blkmap[lower.firstblk] + + # Create front switch to resume points + switch = builder.switch(builder.load(self.resume_index_ptr), + stop_block) + for index, block in self.resume_blocks.items(): + switch.add_case(index, block) + + # Close tail of entry block + builder.position_at_end(entry_block_tail) + builder.branch(prologue) + + def lower_finalize_func(self, lower): + """ + Lower the generator's finalizer. + """ + fnty = llvmlite.ir.FunctionType(llvmlite.ir.VoidType(), + [self.context.get_value_type(self.gentype)]) + function = cgutils.get_or_insert_function( + lower.module, fnty, self.gendesc.llvm_finalizer_name) + entry_block = function.append_basic_block('entry') + builder = IRBuilder(entry_block) + + genptrty = self.context.get_value_type(self.gentype) + genptr = builder.bitcast(function.args[0], genptrty) + self.lower_finalize_func_body(builder, genptr) + + def return_from_generator(self, lower): + """ + Emit a StopIteration at generator end and mark the generator exhausted. + """ + indexval = Constant(self.resume_index_ptr.type.pointee, -1) + lower.builder.store(indexval, self.resume_index_ptr) + self.call_conv.return_stop_iteration(lower.builder) + + def create_resumption_block(self, lower, index): + block_name = "generator_resume%d" % (index,) + block = lower.function.append_basic_block(block_name) + lower.builder.position_at_end(block) + self.resume_blocks[index] = block + + def debug_print(self, builder, msg): + if config.DEBUG_JIT: + self.context.debug_print(builder, "DEBUGJIT: {0}".format(msg)) + +class GeneratorLower(BaseGeneratorLower): + """ + Support class for lowering nopython generators. + """ + + def get_generator_type(self): + return self.fndesc.restype + + def box_generator_struct(self, lower, gen_struct): + return gen_struct + + def lower_finalize_func_body(self, builder, genptr): + """ + Lower the body of the generator's finalizer: decref all live + state variables. + """ + self.debug_print(builder, "# generator: finalize") + if self.context.enable_nrt: + + # Always dereference all arguments + # self.debug_print(builder, "# generator: clear args") + args_ptr = self.get_args_ptr(builder, genptr) + for ty, val in self.arg_packer.load(builder, args_ptr): + self.context.nrt.decref(builder, ty, val) + + self.debug_print(builder, "# generator: finalize end") + builder.ret_void() + +class PyGeneratorLower(BaseGeneratorLower): + """ + Support class for lowering object mode generators. + """ + + def get_generator_type(self): + """ + Compute the actual generator type (the generator function's return + type is simply "pyobject"). + """ + return types.Generator( + gen_func=self.func_ir.func_id.func, + yield_type=types.pyobject, + arg_types=(types.pyobject,) * self.func_ir.arg_count, + state_types=(types.pyobject,) * len(self.geninfo.state_vars), + has_finalizer=True, + ) + + def box_generator_struct(self, lower, gen_struct): + """ + Box the raw *gen_struct* as a Python object. + """ + gen_ptr = cgutils.alloca_once_value(lower.builder, gen_struct) + return lower.pyapi.from_native_generator(gen_ptr, self.gentype, lower.envarg) + + def init_generator_state(self, lower): + """ + NULL-initialize all generator state variables, to avoid spurious + decref's on cleanup. + """ + lower.builder.store(Constant(self.gen_state_ptr.type.pointee, None), + self.gen_state_ptr) + + def lower_finalize_func_body(self, builder, genptr): + """ + Lower the body of the generator's finalizer: decref all live + state variables. + """ + pyapi = self.context.get_python_api(builder) + resume_index_ptr = self.get_resume_index_ptr(builder, genptr) + resume_index = builder.load(resume_index_ptr) + # If resume_index is 0, next() was never called + # If resume_index is -1, generator terminated cleanly + # (note function arguments are saved in state variables, + # so they don't need a separate cleanup step) + need_cleanup = builder.icmp_signed( + '>', resume_index, Constant(resume_index.type, 0)) + + with cgutils.if_unlikely(builder, need_cleanup): + # Decref all live vars (some may be NULL) + gen_state_ptr = self.get_state_ptr(builder, genptr) + for state_index in range(len(self.gentype.state_types)): + state_slot = cgutils.gep_inbounds(builder, gen_state_ptr, + 0, state_index) + ty = self.gentype.state_types[state_index] + val = self.context.unpack_value(builder, ty, state_slot) + pyapi.decref(val) + + builder.ret_void() + + +class LowerYield(object): + """ + Support class for lowering a particular yield point. + """ + + def __init__(self, lower, yield_point, live_vars): + self.lower = lower + self.context = lower.context + self.builder = lower.builder + self.genlower = lower.genlower + self.gentype = self.genlower.gentype + + self.gen_state_ptr = self.genlower.gen_state_ptr + self.resume_index_ptr = self.genlower.resume_index_ptr + self.yp = yield_point + self.inst = self.yp.inst + self.live_vars = live_vars + self.live_var_indices = [lower.generator_info.state_vars.index(v) + for v in live_vars] + + def lower_yield_suspend(self): + self.lower.debug_print("# generator suspend") + # Save live vars in state + for state_index, name in zip(self.live_var_indices, self.live_vars): + state_slot = cgutils.gep_inbounds(self.builder, self.gen_state_ptr, + 0, state_index) + ty = self.gentype.state_types[state_index] + # The yield might be in a loop, in which case the state might + # contain a predicate var that branches back to the loop head, in + # this case the var is live but in sequential lowering won't have + # been alloca'd yet, so do this here. + fetype = self.lower.typeof(name) + self.lower._alloca_var(name, fetype) + val = self.lower.loadvar(name) + # IncRef newly stored value + if self.context.enable_nrt: + self.context.nrt.incref(self.builder, ty, val) + + self.context.pack_value(self.builder, ty, val, state_slot) + # Save resume index + indexval = Constant(self.resume_index_ptr.type.pointee, + self.inst.index) + self.builder.store(indexval, self.resume_index_ptr) + self.lower.debug_print("# generator suspend end") + + def lower_yield_resume(self): + # Emit resumption point + self.genlower.create_resumption_block(self.lower, self.inst.index) + self.lower.debug_print("# generator resume") + # Reload live vars from state + for state_index, name in zip(self.live_var_indices, self.live_vars): + state_slot = cgutils.gep_inbounds(self.builder, self.gen_state_ptr, + 0, state_index) + ty = self.gentype.state_types[state_index] + val = self.context.unpack_value(self.builder, ty, state_slot) + self.lower.storevar(val, name) + # Previous storevar is making an extra incref + if self.context.enable_nrt: + self.context.nrt.decref(self.builder, ty, val) + self.lower.debug_print("# generator resume end") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/imputils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/imputils.py new file mode 100644 index 0000000000000000000000000000000000000000..06c35abb9cf99389b6015755fb9aec7048c8387f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/imputils.py @@ -0,0 +1,469 @@ +""" +Utilities to simplify the boilerplate for native lowering. +""" + + +import collections +import contextlib +import inspect +import functools +from enum import Enum + +from numba.core import typing, types, utils, cgutils +from numba.core.typing.templates import BaseRegistryLoader + + +class Registry(object): + """ + A registry of function and attribute implementations. + """ + def __init__(self, name='unspecified'): + self.name = name + self.functions = [] + self.getattrs = [] + self.setattrs = [] + self.casts = [] + self.constants = [] + + def lower(self, func, *argtys): + """ + Decorate an implementation of *func* for the given argument types. + *func* may be an actual global function object, or any + pseudo-function supported by Numba, such as "getitem". + + The decorated implementation has the signature + (context, builder, sig, args). + """ + def decorate(impl): + self.functions.append((impl, func, argtys)) + return impl + return decorate + + def _decorate_attr(self, impl, ty, attr, impl_list, decorator): + real_impl = decorator(impl, ty, attr) + impl_list.append((real_impl, attr, real_impl.signature)) + return impl + + def lower_getattr(self, ty, attr): + """ + Decorate an implementation of __getattr__ for type *ty* and + the attribute *attr*. + + The decorated implementation will have the signature + (context, builder, typ, val). + """ + def decorate(impl): + return self._decorate_attr(impl, ty, attr, self.getattrs, + _decorate_getattr) + return decorate + + def lower_getattr_generic(self, ty): + """ + Decorate the fallback implementation of __getattr__ for type *ty*. + + The decorated implementation will have the signature + (context, builder, typ, val, attr). The implementation is + called for attributes which haven't been explicitly registered + with lower_getattr(). + """ + return self.lower_getattr(ty, None) + + def lower_setattr(self, ty, attr): + """ + Decorate an implementation of __setattr__ for type *ty* and + the attribute *attr*. + + The decorated implementation will have the signature + (context, builder, sig, args). + """ + def decorate(impl): + return self._decorate_attr(impl, ty, attr, self.setattrs, + _decorate_setattr) + return decorate + + def lower_setattr_generic(self, ty): + """ + Decorate the fallback implementation of __setattr__ for type *ty*. + + The decorated implementation will have the signature + (context, builder, sig, args, attr). The implementation is + called for attributes which haven't been explicitly registered + with lower_setattr(). + """ + return self.lower_setattr(ty, None) + + def lower_cast(self, fromty, toty): + """ + Decorate the implementation of implicit conversion between + *fromty* and *toty*. + + The decorated implementation will have the signature + (context, builder, fromty, toty, val). + """ + def decorate(impl): + self.casts.append((impl, (fromty, toty))) + return impl + return decorate + + def lower_constant(self, ty): + """ + Decorate the implementation for creating a constant of type *ty*. + + The decorated implementation will have the signature + (context, builder, ty, pyval). + """ + def decorate(impl): + self.constants.append((impl, (ty,))) + return impl + return decorate + + def __repr__(self): + return f"Lowering Registry<{self.name}>" + + +class RegistryLoader(BaseRegistryLoader): + """ + An incremental loader for a target registry. + """ + registry_items = ('functions', 'getattrs', 'setattrs', 'casts', 'constants') + + +# Global registry for implementations of builtin operations +# (functions, attributes, type casts) +builtin_registry = Registry('builtin_registry') + +lower_builtin = builtin_registry.lower +lower_getattr = builtin_registry.lower_getattr +lower_getattr_generic = builtin_registry.lower_getattr_generic +lower_setattr = builtin_registry.lower_setattr +lower_setattr_generic = builtin_registry.lower_setattr_generic +lower_cast = builtin_registry.lower_cast +lower_constant = builtin_registry.lower_constant + + +def _decorate_getattr(impl, ty, attr): + real_impl = impl + + if attr is not None: + def res(context, builder, typ, value, attr): + return real_impl(context, builder, typ, value) + else: + def res(context, builder, typ, value, attr): + return real_impl(context, builder, typ, value, attr) + + res.signature = (ty,) + res.attr = attr + return res + +def _decorate_setattr(impl, ty, attr): + real_impl = impl + + if attr is not None: + def res(context, builder, sig, args, attr): + return real_impl(context, builder, sig, args) + else: + def res(context, builder, sig, args, attr): + return real_impl(context, builder, sig, args, attr) + + res.signature = (ty, types.Any) + res.attr = attr + return res + + +def fix_returning_optional(context, builder, sig, status, retval): + # Reconstruct optional return type + if isinstance(sig.return_type, types.Optional): + value_type = sig.return_type.type + optional_none = context.make_optional_none(builder, value_type) + retvalptr = cgutils.alloca_once_value(builder, optional_none) + with builder.if_then(builder.not_(status.is_none)): + optional_value = context.make_optional_value( + builder, value_type, retval, + ) + builder.store(optional_value, retvalptr) + retval = builder.load(retvalptr) + return retval + +def user_function(fndesc, libs): + """ + A wrapper inserting code calling Numba-compiled *fndesc*. + """ + + def imp(context, builder, sig, args): + func = context.declare_function(builder.module, fndesc) + # env=None assumes this is a nopython function + status, retval = context.call_conv.call_function( + builder, func, fndesc.restype, fndesc.argtypes, args) + with cgutils.if_unlikely(builder, status.is_error): + context.call_conv.return_status_propagate(builder, status) + assert sig.return_type == fndesc.restype + # Reconstruct optional return type + retval = fix_returning_optional(context, builder, sig, status, retval) + # If the data representations don't match up + if retval.type != context.get_value_type(sig.return_type): + msg = "function returned {0} but expect {1}" + raise TypeError(msg.format(retval.type, sig.return_type)) + + return impl_ret_new_ref(context, builder, fndesc.restype, retval) + + imp.signature = fndesc.argtypes + imp.libs = tuple(libs) + return imp + + +def user_generator(gendesc, libs): + """ + A wrapper inserting code calling Numba-compiled *gendesc*. + """ + + def imp(context, builder, sig, args): + func = context.declare_function(builder.module, gendesc) + # env=None assumes this is a nopython function + status, retval = context.call_conv.call_function( + builder, func, gendesc.restype, gendesc.argtypes, args) + # Return raw status for caller to process StopIteration + return status, retval + + imp.libs = tuple(libs) + return imp + + +def iterator_impl(iterable_type, iterator_type): + """ + Decorator a given class as implementing *iterator_type* + (by providing an `iternext()` method). + """ + + def wrapper(cls): + # These are unbound methods + iternext = cls.iternext + + @iternext_impl(RefType.BORROWED) + def iternext_wrapper(context, builder, sig, args, result): + (value,) = args + iterobj = cls(context, builder, value) + return iternext(iterobj, context, builder, result) + + lower_builtin('iternext', iterator_type)(iternext_wrapper) + return cls + + return wrapper + + +class _IternextResult(object): + """ + A result wrapper for iteration, passed by iternext_impl() into the + wrapped function. + """ + __slots__ = ('_context', '_builder', '_pairobj') + + def __init__(self, context, builder, pairobj): + self._context = context + self._builder = builder + self._pairobj = pairobj + + def set_exhausted(self): + """ + Mark the iterator as exhausted. + """ + self._pairobj.second = self._context.get_constant(types.boolean, False) + + def set_valid(self, is_valid=True): + """ + Mark the iterator as valid according to *is_valid* (which must + be either a Python boolean or a LLVM inst). + """ + if is_valid in (False, True): + is_valid = self._context.get_constant(types.boolean, is_valid) + self._pairobj.second = is_valid + + def yield_(self, value): + """ + Mark the iterator as yielding the given *value* (a LLVM inst). + """ + self._pairobj.first = value + + def is_valid(self): + """ + Return whether the iterator is marked valid. + """ + return self._context.get_argument_value(self._builder, + types.boolean, + self._pairobj.second) + + def yielded_value(self): + """ + Return the iterator's yielded value, if any. + """ + return self._pairobj.first + +class RefType(Enum): + """ + Enumerate the reference type + """ + """ + A new reference + """ + NEW = 1 + """ + A borrowed reference + """ + BORROWED = 2 + """ + An untracked reference + """ + UNTRACKED = 3 + +def iternext_impl(ref_type=None): + """ + Wrap the given iternext() implementation so that it gets passed + an _IternextResult() object easing the returning of the iternext() + result pair. + + ref_type: a numba.targets.imputils.RefType value, the reference type used is + that specified through the RefType enum. + + The wrapped function will be called with the following signature: + (context, builder, sig, args, iternext_result) + """ + if ref_type not in [x for x in RefType]: + raise ValueError("ref_type must be an enum member of imputils.RefType") + + def outer(func): + def wrapper(context, builder, sig, args): + pair_type = sig.return_type + pairobj = context.make_helper(builder, pair_type) + func(context, builder, sig, args, + _IternextResult(context, builder, pairobj)) + if ref_type == RefType.NEW: + impl_ret = impl_ret_new_ref + elif ref_type == RefType.BORROWED: + impl_ret = impl_ret_borrowed + elif ref_type == RefType.UNTRACKED: + impl_ret = impl_ret_untracked + else: + raise ValueError("Unknown ref_type encountered") + return impl_ret(context, builder, + pair_type, pairobj._getvalue()) + return wrapper + return outer + + +def call_getiter(context, builder, iterable_type, val): + """ + Call the `getiter()` implementation for the given *iterable_type* + of value *val*, and return the corresponding LLVM inst. + """ + getiter_sig = typing.signature(iterable_type.iterator_type, iterable_type) + getiter_impl = context.get_function('getiter', getiter_sig) + return getiter_impl(builder, (val,)) + + +def call_iternext(context, builder, iterator_type, val): + """ + Call the `iternext()` implementation for the given *iterator_type* + of value *val*, and return a convenience _IternextResult() object + reflecting the results. + """ + itemty = iterator_type.yield_type + pair_type = types.Pair(itemty, types.boolean) + iternext_sig = typing.signature(pair_type, iterator_type) + iternext_impl = context.get_function('iternext', iternext_sig) + val = iternext_impl(builder, (val,)) + pairobj = context.make_helper(builder, pair_type, val) + return _IternextResult(context, builder, pairobj) + + +def call_len(context, builder, ty, val): + """ + Call len() on the given value. Return None if len() isn't defined on + this type. + """ + try: + len_impl = context.get_function(len, typing.signature(types.intp, ty,)) + except NotImplementedError: + return None + else: + return len_impl(builder, (val,)) + + +_ForIterLoop = collections.namedtuple('_ForIterLoop', + ('value', 'do_break')) + + +@contextlib.contextmanager +def for_iter(context, builder, iterable_type, val): + """ + Simulate a for loop on the given iterable. Yields a namedtuple with + the given members: + - `value` is the value being yielded + - `do_break` is a callable to early out of the loop + """ + iterator_type = iterable_type.iterator_type + iterval = call_getiter(context, builder, iterable_type, val) + + bb_body = builder.append_basic_block('for_iter.body') + bb_end = builder.append_basic_block('for_iter.end') + + def do_break(): + builder.branch(bb_end) + + builder.branch(bb_body) + + with builder.goto_block(bb_body): + res = call_iternext(context, builder, iterator_type, iterval) + with builder.if_then(builder.not_(res.is_valid()), likely=False): + builder.branch(bb_end) + yield _ForIterLoop(res.yielded_value(), do_break) + builder.branch(bb_body) + + builder.position_at_end(bb_end) + if context.enable_nrt: + context.nrt.decref(builder, iterator_type, iterval) + + +def impl_ret_new_ref(ctx, builder, retty, ret): + """ + The implementation returns a new reference. + """ + return ret + + +def impl_ret_borrowed(ctx, builder, retty, ret): + """ + The implementation returns a borrowed reference. + This function automatically incref so that the implementation is + returning a new reference. + """ + if ctx.enable_nrt: + ctx.nrt.incref(builder, retty, ret) + return ret + + +def impl_ret_untracked(ctx, builder, retty, ret): + """ + The return type is not a NRT object. + """ + return ret + + +@contextlib.contextmanager +def force_error_model(context, model_name='numpy'): + """ + Temporarily change the context's error model. + """ + from numba.core import callconv + + old_error_model = context.error_model + context.error_model = callconv.create_error_model(model_name, context) + try: + yield + finally: + context.error_model = old_error_model + + +def numba_typeref_ctor(*args, **kwargs): + """A stub for use internally by Numba when a call is emitted + on a TypeRef. + """ + raise NotImplementedError("This function should not be executed.") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/inline_closurecall.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/inline_closurecall.py new file mode 100644 index 0000000000000000000000000000000000000000..1e5e3b50bebd8725529701c1855b9a85a7836eac --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/inline_closurecall.py @@ -0,0 +1,1682 @@ +import types as pytypes # avoid confusion with numba.types +import copy +import ctypes +import numba.core.analysis +from numba.core import (types, typing, errors, ir, rewrites, config, ir_utils, + cgutils) +from numba.parfors.parfor import internal_prange +from numba.core.ir_utils import ( + next_label, + add_offset_to_labels, + replace_vars, + remove_dels, + rename_labels, + find_topo_order, + merge_adjacent_blocks, + GuardException, + require, + guard, + get_definition, + find_callname, + find_build_sequence, + get_np_ufunc_typ, + get_ir_of_code, + simplify_CFG, + canonicalize_array_math, + dead_code_elimination, +) + +from numba.core.analysis import ( + compute_cfg_from_blocks, + compute_use_defs, + compute_live_variables) +from numba.core.imputils import impl_ret_untracked +from numba.core.extending import intrinsic +from numba.core.typing import signature +from numba.cpython.listobj import ListIterInstance +from numba.cpython.rangeobj import range_impl_map +from numba.np.arrayobj import make_array + +from numba.core import postproc +from numba.np.unsafe.ndarray import empty_inferred as unsafe_empty_inferred +import numpy as np +import operator +import numba.misc.special + +""" +Variable enable_inline_arraycall is only used for testing purpose. +""" +enable_inline_arraycall = True + + +def callee_ir_validator(func_ir): + """Checks the IR of a callee is supported for inlining + """ + for blk in func_ir.blocks.values(): + for stmt in blk.find_insts(ir.Assign): + if isinstance(stmt.value, ir.Yield): + msg = "The use of yield in a closure is unsupported." + raise errors.UnsupportedError(msg, loc=stmt.loc) + + +def _created_inlined_var_name(function_name, var_name): + """Creates a name for an inlined variable based on the function name and the + variable name. It does this "safely" to avoid the use of characters that are + illegal in python variable names as there are occasions when function + generation needs valid python name tokens.""" + inlined_name = f'{function_name}.{var_name}' + # Replace angle brackets, e.g. "" is replaced with "_locals_" + new_name = inlined_name.replace('<', '_').replace('>', '_') + # The version "version" of the closure function e.g. foo$2 (id 2) is + # rewritten as "foo_v2". Further "." is also replaced with "_". + new_name = new_name.replace('.', '_').replace('$', '_v') + return new_name + + +class InlineClosureCallPass(object): + """InlineClosureCallPass class looks for direct calls to locally defined + closures, and inlines the body of the closure function to the call site. + """ + + def __init__(self, func_ir, parallel_options, swapped={}, typed=False): + self.func_ir = func_ir + self.parallel_options = parallel_options + self.swapped = swapped + self._processed_stencils = [] + self.typed = typed + + def run(self): + """Run inline closure call pass. + """ + # Analysis relies on ir.Del presence, strip out later + pp = postproc.PostProcessor(self.func_ir) + pp.run(True) + + modified = False + work_list = list(self.func_ir.blocks.items()) + debug_print = _make_debug_print("InlineClosureCallPass") + debug_print(f"START {self.func_ir.func_id.func_qualname}") + while work_list: + _label, block = work_list.pop() + for i, instr in enumerate(block.body): + if isinstance(instr, ir.Assign): + expr = instr.value + if isinstance(expr, ir.Expr) and expr.op == 'call': + call_name = guard(find_callname, self.func_ir, expr) + func_def = guard(get_definition, self.func_ir, + expr.func) + + if guard(self._inline_reduction, + work_list, block, i, expr, call_name): + modified = True + break # because block structure changed + + if guard(self._inline_closure, + work_list, block, i, func_def): + modified = True + break # because block structure changed + + if guard(self._inline_stencil, + instr, call_name, func_def): + modified = True + + if enable_inline_arraycall: + # Identify loop structure + if modified: + # Need to do some cleanups if closure inlining kicked in + merge_adjacent_blocks(self.func_ir.blocks) + cfg = compute_cfg_from_blocks(self.func_ir.blocks) + debug_print("start inline arraycall") + _debug_dump(cfg) + loops = cfg.loops() + sized_loops = [(k, len(loops[k].body)) for k in loops.keys()] + visited = [] + # We go over all loops, bigger loops first (outer first) + for k, s in sorted(sized_loops, key=lambda tup: tup[1], + reverse=True): + visited.append(k) + if guard(_inline_arraycall, self.func_ir, cfg, visited, + loops[k], self.swapped, + self.parallel_options.comprehension, self.typed): + modified = True + if modified: + _fix_nested_array(self.func_ir) + + if modified: + # clean up now dead/unreachable blocks, e.g. unconditionally raising + # an exception in an inlined function would render some parts of the + # inliner unreachable + cfg = compute_cfg_from_blocks(self.func_ir.blocks) + for dead in cfg.dead_nodes(): + del self.func_ir.blocks[dead] + + # run dead code elimination + dead_code_elimination(self.func_ir) + # do label renaming + self.func_ir.blocks = rename_labels(self.func_ir.blocks) + + # inlining done, strip dels + remove_dels(self.func_ir.blocks) + + debug_print("END") + + def _inline_reduction(self, work_list, block, i, expr, call_name): + # only inline reduction in sequential execution, parallel handling + # is done in ParforPass. + require(not self.parallel_options.reduction) + require(call_name == ('reduce', 'builtins') or + call_name == ('reduce', '_functools')) + if len(expr.args) not in (2, 3): + raise TypeError("invalid reduce call, " + "two arguments are required (optional initial " + "value can also be specified)") + check_reduce_func(self.func_ir, expr.args[0]) + + def reduce_func(f, A, v=None): + it = iter(A) + if v is not None: + s = v + else: + s = next(it) + for a in it: + s = f(s, a) + return s + + inline_closure_call( + self.func_ir, self.func_ir.func_id.func.__globals__, + block, i, reduce_func, work_list=work_list, + callee_validator=callee_ir_validator + ) + return True + + def _inline_stencil(self, instr, call_name, func_def): + from numba.stencils.stencil import StencilFunc + lhs = instr.target + expr = instr.value + # We keep the escaping variables of the stencil kernel + # alive by adding them to the actual kernel call as extra + # keyword arguments, which is ignored anyway. + if (isinstance(func_def, ir.Global) and + func_def.name == 'stencil' and + isinstance(func_def.value, StencilFunc)): + if expr.kws: + expr.kws += func_def.value.kws + else: + expr.kws = func_def.value.kws + return True + # Otherwise we proceed to check if it is a call to numba.stencil + require(call_name == ('stencil', 'numba.stencils.stencil') or + call_name == ('stencil', 'numba')) + require(expr not in self._processed_stencils) + self._processed_stencils.append(expr) + if not len(expr.args) == 1: + raise ValueError("As a minimum Stencil requires" + " a kernel as an argument") + stencil_def = guard(get_definition, self.func_ir, expr.args[0]) + require(isinstance(stencil_def, ir.Expr) and + stencil_def.op == "make_function") + kernel_ir = get_ir_of_code(self.func_ir.func_id.func.__globals__, + stencil_def.code) + options = dict(expr.kws) + if 'neighborhood' in options: + fixed = guard(self._fix_stencil_neighborhood, options) + if not fixed: + raise ValueError( + "stencil neighborhood option should be a tuple" + " with constant structure such as ((-w, w),)" + ) + if 'index_offsets' in options: + fixed = guard(self._fix_stencil_index_offsets, options) + if not fixed: + raise ValueError( + "stencil index_offsets option should be a tuple" + " with constant structure such as (offset, )" + ) + sf = StencilFunc(kernel_ir, 'constant', options) + sf.kws = expr.kws # hack to keep variables live + sf_global = ir.Global('stencil', sf, expr.loc) + self.func_ir._definitions[lhs.name] = [sf_global] + instr.value = sf_global + return True + + def _fix_stencil_neighborhood(self, options): + """ + Extract the two-level tuple representing the stencil neighborhood + from the program IR to provide a tuple to StencilFunc. + """ + # build_tuple node with neighborhood for each dimension + dims_build_tuple = get_definition(self.func_ir, options['neighborhood']) + require(hasattr(dims_build_tuple, 'items')) + res = [] + for window_var in dims_build_tuple.items: + win_build_tuple = get_definition(self.func_ir, window_var) + require(hasattr(win_build_tuple, 'items')) + res.append(tuple(win_build_tuple.items)) + options['neighborhood'] = tuple(res) + return True + + def _fix_stencil_index_offsets(self, options): + """ + Extract the tuple representing the stencil index offsets + from the program IR to provide to StencilFunc. + """ + offset_tuple = get_definition(self.func_ir, options['index_offsets']) + require(hasattr(offset_tuple, 'items')) + options['index_offsets'] = tuple(offset_tuple.items) + return True + + def _inline_closure(self, work_list, block, i, func_def): + require(isinstance(func_def, ir.Expr) and + func_def.op == "make_function") + inline_closure_call(self.func_ir, + self.func_ir.func_id.func.__globals__, + block, i, func_def, work_list=work_list, + callee_validator=callee_ir_validator) + return True + + +def check_reduce_func(func_ir, func_var): + """Checks the function at func_var in func_ir to make sure it's amenable + for inlining. Returns the function itself""" + reduce_func = guard(get_definition, func_ir, func_var) + if reduce_func is None: + raise ValueError("Reduce function cannot be found for njit \ + analysis") + if isinstance(reduce_func, (ir.FreeVar, ir.Global)): + if not isinstance(reduce_func.value, + numba.core.registry.CPUDispatcher): + raise ValueError("Invalid reduction function") + # pull out the python function for inlining + reduce_func = reduce_func.value.py_func + elif not (hasattr(reduce_func, 'code') + or hasattr(reduce_func, '__code__')): + raise ValueError("Invalid reduction function") + f_code = (reduce_func.code + if hasattr(reduce_func, 'code') + else reduce_func.__code__) + if not f_code.co_argcount == 2: + raise TypeError("Reduction function should take 2 arguments") + return reduce_func + + +class InlineWorker(object): + """ A worker class for inlining, this is a more advanced version of + `inline_closure_call` in that it permits inlining from function type, Numba + IR and code object. It also, runs the entire untyped compiler pipeline on + the inlinee to ensure that it is transformed as though it were compiled + directly. + """ + + def __init__(self, + typingctx=None, + targetctx=None, + locals=None, + pipeline=None, + flags=None, + validator=callee_ir_validator, + typemap=None, + calltypes=None): + """ + Instantiate a new InlineWorker, all arguments are optional though some + must be supplied together for certain use cases. The methods will refuse + to run if the object isn't configured in the manner needed. Args are the + same as those in a numba.core.Compiler.state, except the validator which + is a function taking Numba IR and validating it for use when inlining + (this is optional and really to just provide better error messages about + things which the inliner cannot handle like yield in closure). + """ + def check(arg, name): + if arg is None: + raise TypeError("{} must not be None".format(name)) + + from numba.core.compiler import DefaultPassBuilder + + # check the stuff needed to run the more advanced compilation pipeline + # is valid if any of it is provided + compiler_args = (targetctx, locals, pipeline, flags) + compiler_group = [x is not None for x in compiler_args] + if any(compiler_group) and not all(compiler_group): + check(targetctx, 'targetctx') + check(locals, 'locals') + check(pipeline, 'pipeline') + check(flags, 'flags') + elif all(compiler_group): + check(typingctx, 'typingctx') + + self._compiler_pipeline = DefaultPassBuilder.define_untyped_pipeline + + self.typingctx = typingctx + self.targetctx = targetctx + self.locals = locals + self.pipeline = pipeline + self.flags = flags + self.validator = validator + self.debug_print = _make_debug_print("InlineWorker") + + # check whether this inliner can also support typemap and calltypes + # update and if what's provided is valid + pair = (typemap, calltypes) + pair_is_none = [x is None for x in pair] + if any(pair_is_none) and not all(pair_is_none): + msg = ("typemap and calltypes must both be either None or have a " + "value, got: %s, %s") + raise TypeError(msg % pair) + self._permit_update_type_and_call_maps = not all(pair_is_none) + self.typemap = typemap + self.calltypes = calltypes + + def inline_ir(self, caller_ir, block, i, callee_ir, callee_freevars, + arg_typs=None): + """ Inlines the callee_ir in the caller_ir at statement index i of block + `block`, callee_freevars are the free variables for the callee_ir. If + the callee_ir is derived from a function `func` then this is + `func.__code__.co_freevars`. If `arg_typs` is given and the InlineWorker + instance was initialized with a typemap and calltypes then they will be + appropriately updated based on the arg_typs. + """ + + # Always copy the callee IR, it gets mutated + def copy_ir(the_ir): + kernel_copy = the_ir.copy() + kernel_copy.blocks = {} + for block_label, block in the_ir.blocks.items(): + new_block = copy.deepcopy(the_ir.blocks[block_label]) + kernel_copy.blocks[block_label] = new_block + return kernel_copy + + callee_ir = copy_ir(callee_ir) + + # check that the contents of the callee IR is something that can be + # inlined if a validator is present + if self.validator is not None: + self.validator(callee_ir) + + # save an unmutated copy of the callee_ir to return + callee_ir_original = copy_ir(callee_ir) + scope = block.scope + instr = block.body[i] + call_expr = instr.value + callee_blocks = callee_ir.blocks + + # 1. relabel callee_ir by adding an offset + max_label = max( + ir_utils._the_max_label.next(), + max(caller_ir.blocks.keys()), + ) + callee_blocks = add_offset_to_labels(callee_blocks, max_label + 1) + callee_blocks = simplify_CFG(callee_blocks) + callee_ir.blocks = callee_blocks + min_label = min(callee_blocks.keys()) + max_label = max(callee_blocks.keys()) + # reset globals in ir_utils before we use it + ir_utils._the_max_label.update(max_label) + self.debug_print("After relabel") + _debug_dump(callee_ir) + + # 2. rename all local variables in callee_ir with new locals created in + # caller_ir + callee_scopes = _get_all_scopes(callee_blocks) + self.debug_print("callee_scopes = ", callee_scopes) + # one function should only have one local scope + assert (len(callee_scopes) == 1) + callee_scope = callee_scopes[0] + var_dict = {} + for var in tuple(callee_scope.localvars._con.values()): + if not (var.name in callee_freevars): + inlined_name = _created_inlined_var_name( + callee_ir.func_id.unique_name, var.name) + # Update the caller scope with the new names + new_var = scope.redefine(inlined_name, loc=var.loc) + # Also update the callee scope with the new names. Should the + # type and call maps need updating (which requires SSA form) the + # transformation to SSA is valid as the IR object is internally + # consistent. + callee_scope.redefine(inlined_name, loc=var.loc) + var_dict[var.name] = new_var + self.debug_print("var_dict = ", var_dict) + replace_vars(callee_blocks, var_dict) + self.debug_print("After local var rename") + _debug_dump(callee_ir) + + # 3. replace formal parameters with actual arguments + callee_func = callee_ir.func_id.func + args = _get_callee_args(call_expr, callee_func, block.body[i].loc, + caller_ir) + + # 4. Update typemap + if self._permit_update_type_and_call_maps: + if arg_typs is None: + raise TypeError('arg_typs should have a value not None') + self.update_type_and_call_maps(callee_ir, arg_typs) + # update_type_and_call_maps replaces blocks + callee_blocks = callee_ir.blocks + + self.debug_print("After arguments rename: ") + _debug_dump(callee_ir) + + _replace_args_with(callee_blocks, args) + # 5. split caller blocks into two + new_blocks = [] + new_block = ir.Block(scope, block.loc) + new_block.body = block.body[i + 1:] + new_label = next_label() + caller_ir.blocks[new_label] = new_block + new_blocks.append((new_label, new_block)) + block.body = block.body[:i] + block.body.append(ir.Jump(min_label, instr.loc)) + + # 6. replace Return with assignment to LHS + topo_order = find_topo_order(callee_blocks) + _replace_returns(callee_blocks, instr.target, new_label) + + # remove the old definition of instr.target too + if (instr.target.name in caller_ir._definitions + and call_expr in caller_ir._definitions[instr.target.name]): + # NOTE: target can have multiple definitions due to control flow + caller_ir._definitions[instr.target.name].remove(call_expr) + + # 7. insert all new blocks, and add back definitions + for label in topo_order: + # block scope must point to parent's + block = callee_blocks[label] + block.scope = scope + _add_definitions(caller_ir, block) + caller_ir.blocks[label] = block + new_blocks.append((label, block)) + self.debug_print("After merge in") + _debug_dump(caller_ir) + + return callee_ir_original, callee_blocks, var_dict, new_blocks + + def inline_function(self, caller_ir, block, i, function, arg_typs=None): + """ Inlines the function in the caller_ir at statement index i of block + `block`. If `arg_typs` is given and the InlineWorker instance was + initialized with a typemap and calltypes then they will be appropriately + updated based on the arg_typs. + """ + callee_ir = self.run_untyped_passes(function) + freevars = function.__code__.co_freevars + return self.inline_ir(caller_ir, block, i, callee_ir, freevars, + arg_typs=arg_typs) + + def run_untyped_passes(self, func, enable_ssa=False): + """ + Run the compiler frontend's untyped passes over the given Python + function, and return the function's canonical Numba IR. + + Disable SSA transformation by default, since the call site won't be in + SSA form and self.inline_ir depends on this being the case. + """ + from numba.core.compiler import StateDict, _CompileStatus + from numba.core.untyped_passes import ExtractByteCode + from numba.core import bytecode + from numba.parfors.parfor import ParforDiagnostics + state = StateDict() + state.func_ir = None + state.typingctx = self.typingctx + state.targetctx = self.targetctx + state.locals = self.locals + state.pipeline = self.pipeline + state.flags = self.flags + state.flags.enable_ssa = enable_ssa + + state.func_id = bytecode.FunctionIdentity.from_function(func) + + state.typemap = None + state.calltypes = None + state.type_annotation = None + state.status = _CompileStatus(False) + state.return_type = None + state.parfor_diagnostics = ParforDiagnostics() + state.metadata = {} + + ExtractByteCode().run_pass(state) + # This is a lie, just need *some* args for the case where an obj mode + # with lift is needed + state.args = len(state.bc.func_id.pysig.parameters) * (types.pyobject,) + + pm = self._compiler_pipeline(state) + + pm.finalize() + pm.run(state) + return state.func_ir + + def update_type_and_call_maps(self, callee_ir, arg_typs): + """ Updates the type and call maps based on calling callee_ir with + arguments from arg_typs""" + from numba.core.ssa import reconstruct_ssa + from numba.core.typed_passes import PreLowerStripPhis + + if not self._permit_update_type_and_call_maps: + msg = ("InlineWorker instance not configured correctly, typemap or " + "calltypes missing in initialization.") + raise ValueError(msg) + from numba.core import typed_passes + # call branch pruning to simplify IR and avoid inference errors + callee_ir._definitions = ir_utils.build_definitions(callee_ir.blocks) + numba.core.analysis.dead_branch_prune(callee_ir, arg_typs) + # callee's typing may require SSA + callee_ir = reconstruct_ssa(callee_ir) + callee_ir._definitions = ir_utils.build_definitions(callee_ir.blocks) + [f_typemap, + _f_return_type, + f_calltypes, _] = typed_passes.type_inference_stage( + self.typingctx, self.targetctx, callee_ir, arg_typs, None, + ) + callee_ir = PreLowerStripPhis()._strip_phi_nodes(callee_ir) + callee_ir._definitions = ir_utils.build_definitions(callee_ir.blocks) + canonicalize_array_math(callee_ir, f_typemap, + f_calltypes, self.typingctx) + # remove argument entries like arg.a from typemap + arg_names = [vname for vname in f_typemap if vname.startswith("arg.")] + for a in arg_names: + f_typemap.pop(a) + self.typemap.update(f_typemap) + self.calltypes.update(f_calltypes) + + +def inline_closure_call(func_ir, glbls, block, i, callee, typingctx=None, + targetctx=None, arg_typs=None, typemap=None, + calltypes=None, work_list=None, callee_validator=None, + replace_freevars=True): + """Inline the body of `callee` at its callsite (`i`-th instruction of + `block`) + + `func_ir` is the func_ir object of the caller function and `glbls` is its + global variable environment (func_ir.func_id.func.__globals__). + `block` is the IR block of the callsite and `i` is the index of the + callsite's node. `callee` is either the called function or a + make_function node. `typingctx`, `typemap` and `calltypes` are typing + data structures of the caller, available if we are in a typed pass. + `arg_typs` includes the types of the arguments at the callsite. + `callee_validator` is an optional callable which can be used to validate the + IR of the callee to ensure that it contains IR supported for inlining, it + takes one argument, the func_ir of the callee + + Returns IR blocks of the callee and the variable renaming dictionary used + for them to facilitate further processing of new blocks. + """ + scope = block.scope + instr = block.body[i] + call_expr = instr.value + debug_print = _make_debug_print("inline_closure_call") + debug_print("Found closure call: ", instr, " with callee = ", callee) + # support both function object and make_function Expr + callee_code = callee.code if hasattr(callee, 'code') else callee.__code__ + callee_closure = (callee.closure + if hasattr(callee, 'closure') else callee.__closure__) + # first, get the IR of the callee + if isinstance(callee, pytypes.FunctionType): + from numba.core import compiler + callee_ir = compiler.run_frontend(callee, inline_closures=True) + else: + callee_ir = get_ir_of_code(glbls, callee_code) + + # check that the contents of the callee IR is something that can be inlined + # if a validator is supplied + if callee_validator is not None: + callee_validator(callee_ir) + + callee_blocks = callee_ir.blocks + + # 1. relabel callee_ir by adding an offset + max_label = max(ir_utils._the_max_label.next(), max(func_ir.blocks.keys())) + callee_blocks = add_offset_to_labels(callee_blocks, max_label + 1) + callee_blocks = simplify_CFG(callee_blocks) + callee_ir.blocks = callee_blocks + min_label = min(callee_blocks.keys()) + max_label = max(callee_blocks.keys()) + # reset globals in ir_utils before we use it + ir_utils._the_max_label.update(max_label) + debug_print("After relabel") + _debug_dump(callee_ir) + + # 2. rename all local variables in callee_ir with new locals created in + # func_ir + callee_scopes = _get_all_scopes(callee_blocks) + debug_print("callee_scopes = ", callee_scopes) + # one function should only have one local scope + assert (len(callee_scopes) == 1) + callee_scope = callee_scopes[0] + var_dict = {} + for var in callee_scope.localvars._con.values(): + if not (var.name in callee_code.co_freevars): + inlined_name = _created_inlined_var_name( + callee_ir.func_id.unique_name, var.name) + new_var = scope.redefine(inlined_name, loc=var.loc) + var_dict[var.name] = new_var + debug_print("var_dict = ", var_dict) + replace_vars(callee_blocks, var_dict) + debug_print("After local var rename") + _debug_dump(callee_ir) + + # 3. replace formal parameters with actual arguments + args = _get_callee_args(call_expr, callee, block.body[i].loc, func_ir) + + debug_print("After arguments rename: ") + _debug_dump(callee_ir) + + # 4. replace freevar with actual closure var + if callee_closure and replace_freevars: + closure = func_ir.get_definition(callee_closure) + debug_print("callee's closure = ", closure) + if isinstance(closure, tuple): + cellget = ctypes.pythonapi.PyCell_Get + cellget.restype = ctypes.py_object + cellget.argtypes = (ctypes.py_object,) + items = tuple(cellget(x) for x in closure) + else: + assert (isinstance(closure, ir.Expr) + and closure.op == 'build_tuple') + items = closure.items + assert (len(callee_code.co_freevars) == len(items)) + _replace_freevars(callee_blocks, items) + debug_print("After closure rename") + _debug_dump(callee_ir) + + if typingctx: + from numba.core import typed_passes + # call branch pruning to simplify IR and avoid inference errors + callee_ir._definitions = ir_utils.build_definitions(callee_ir.blocks) + numba.core.analysis.dead_branch_prune(callee_ir, arg_typs) + try: + [f_typemap, f_return_type, + f_calltypes, _] = typed_passes.type_inference_stage( + typingctx, targetctx, callee_ir, arg_typs, None) + except Exception: + [f_typemap, f_return_type, + f_calltypes, _] = typed_passes.type_inference_stage( + typingctx, targetctx, callee_ir, arg_typs, None) + canonicalize_array_math(callee_ir, f_typemap, + f_calltypes, typingctx) + # remove argument entries like arg.a from typemap + arg_names = [vname for vname in f_typemap if vname.startswith("arg.")] + for a in arg_names: + f_typemap.pop(a) + typemap.update(f_typemap) + calltypes.update(f_calltypes) + + _replace_args_with(callee_blocks, args) + # 5. split caller blocks into two + new_blocks = [] + new_block = ir.Block(scope, block.loc) + new_block.body = block.body[i + 1:] + new_label = next_label() + func_ir.blocks[new_label] = new_block + new_blocks.append((new_label, new_block)) + block.body = block.body[:i] + block.body.append(ir.Jump(min_label, instr.loc)) + + # 6. replace Return with assignment to LHS + topo_order = find_topo_order(callee_blocks) + _replace_returns(callee_blocks, instr.target, new_label) + + # remove the old definition of instr.target too + if (instr.target.name in func_ir._definitions + and call_expr in func_ir._definitions[instr.target.name]): + # NOTE: target can have multiple definitions due to control flow + func_ir._definitions[instr.target.name].remove(call_expr) + + # 7. insert all new blocks, and add back definitions + for label in topo_order: + # block scope must point to parent's + block = callee_blocks[label] + block.scope = scope + _add_definitions(func_ir, block) + func_ir.blocks[label] = block + new_blocks.append((label, block)) + debug_print("After merge in") + _debug_dump(func_ir) + + if work_list is not None: + for block in new_blocks: + work_list.append(block) + return callee_blocks, var_dict + + +def _get_callee_args(call_expr, callee, loc, func_ir): + """Get arguments for calling 'callee', including the default arguments. + keyword arguments are currently only handled when 'callee' is a function. + """ + if call_expr.op == 'call': + args = list(call_expr.args) + if call_expr.vararg: + msg = "Calling a closure with *args is unsupported." + raise errors.UnsupportedError(msg, call_expr.loc) + elif call_expr.op == 'getattr': + args = [call_expr.value] + elif ir_utils.is_operator_or_getitem(call_expr): + args = call_expr.list_vars() + else: + raise TypeError("Unsupported ir.Expr.{}".format(call_expr.op)) + + debug_print = _make_debug_print("inline_closure_call default handling") + + # handle defaults and kw arguments using pysignature if callee is function + if isinstance(callee, pytypes.FunctionType): + pysig = numba.core.utils.pysignature(callee) + normal_handler = lambda index, param, default: default + default_handler = lambda index, param, default: ir.Const(default, loc) + + # Throw error for stararg + # TODO: handle stararg + def stararg_handler(index, param, default): + raise NotImplementedError( + "Stararg not supported in inliner for arg {} {}".format( + index, param)) + if call_expr.op == 'call': + kws = dict(call_expr.kws) + else: + kws = {} + return numba.core.typing.fold_arguments( + pysig, args, kws, normal_handler, default_handler, + stararg_handler) + else: + # TODO: handle arguments for make_function case similar to function + # case above + callee_defaults = (callee.defaults if hasattr(callee, 'defaults') + else callee.__defaults__) + if callee_defaults: + debug_print("defaults = ", callee_defaults) + if isinstance(callee_defaults, tuple): # Python 3.5 + defaults_list = [] + for x in callee_defaults: + if isinstance(x, ir.Var): + defaults_list.append(x) + else: + # this branch is predominantly for kwargs from + # inlinable functions + defaults_list.append(ir.Const(value=x, loc=loc)) + args = args + defaults_list + elif (isinstance(callee_defaults, ir.Var) + or isinstance(callee_defaults, str)): + default_tuple = func_ir.get_definition(callee_defaults) + assert (isinstance(default_tuple, ir.Expr)) + assert (default_tuple.op == "build_tuple") + const_vals = [func_ir.get_definition(x) for + x in default_tuple.items] + args = args + const_vals + else: + raise NotImplementedError( + "Unsupported defaults to make_function: {}".format( + callee_defaults)) + return args + + +def _make_debug_print(prefix): + def debug_print(*args): + if config.DEBUG_INLINE_CLOSURE: + print(prefix + ": " + "".join(str(x) for x in args)) + return debug_print + + +def _debug_dump(func_ir): + if config.DEBUG_INLINE_CLOSURE: + func_ir.dump() + + +def _get_all_scopes(blocks): + """Get all block-local scopes from an IR. + """ + all_scopes = [] + for label, block in blocks.items(): + if not (block.scope in all_scopes): + all_scopes.append(block.scope) + return all_scopes + + +def _replace_args_with(blocks, args): + """ + Replace ir.Arg(...) with real arguments from call site + """ + for label, block in blocks.items(): + assigns = block.find_insts(ir.Assign) + for stmt in assigns: + if isinstance(stmt.value, ir.Arg): + idx = stmt.value.index + assert (idx < len(args)) + stmt.value = args[idx] + + +def _replace_freevars(blocks, args): + """ + Replace ir.FreeVar(...) with real variables from parent function + """ + for label, block in blocks.items(): + assigns = block.find_insts(ir.Assign) + for stmt in assigns: + if isinstance(stmt.value, ir.FreeVar): + idx = stmt.value.index + assert (idx < len(args)) + if isinstance(args[idx], ir.Var): + stmt.value = args[idx] + else: + stmt.value = ir.Const(args[idx], stmt.loc) + + +def _replace_returns(blocks, target, return_label): + """ + Return return statement by assigning directly to target, and a jump. + """ + for label, block in blocks.items(): + casts = [] + for i in range(len(block.body)): + stmt = block.body[i] + if isinstance(stmt, ir.Return): + assert (i + 1 == len(block.body)) + block.body[i] = ir.Assign(stmt.value, target, stmt.loc) + block.body.append(ir.Jump(return_label, stmt.loc)) + # remove cast of the returned value + for cast in casts: + if cast.target.name == stmt.value.name: + cast.value = cast.value.value + elif (isinstance(stmt, ir.Assign) and + isinstance(stmt.value, ir.Expr) and + stmt.value.op == 'cast'): + casts.append(stmt) + + +def _add_definitions(func_ir, block): + """ + Add variable definitions found in a block to parent func_ir. + """ + definitions = func_ir._definitions + assigns = block.find_insts(ir.Assign) + for stmt in assigns: + definitions[stmt.target.name].append(stmt.value) + + +def _find_arraycall(func_ir, block): + """Look for statement like "x = numpy.array(y)" or "x[..] = y" + immediately after the closure call that creates list y (the i-th + statement in block). Return the statement index if found, or + raise GuardException. + """ + array_var = None + list_var_dead_after_array_call = False + list_var = None + + i = 0 + while i < len(block.body): + instr = block.body[i] + if isinstance(instr, ir.Del): + # Stop the process if list_var becomes dead + if list_var and array_var and instr.value == list_var.name: + list_var_dead_after_array_call = True + break + pass + elif isinstance(instr, ir.Assign): + # Found array_var = array(list_var) + lhs = instr.target + expr = instr.value + if (guard(find_callname, func_ir, expr) == ('array', 'numpy') and + isinstance(expr.args[0], ir.Var)): + list_var = expr.args[0] + array_var = lhs + array_stmt_index = i + array_kws = dict(expr.kws) + elif (isinstance(instr, ir.SetItem) and + isinstance(instr.value, ir.Var) and + not list_var): + list_var = instr.value + # Found array_var[..] = list_var, the case for nested array + array_var = instr.target + array_def = get_definition(func_ir, array_var) + require(guard(_find_unsafe_empty_inferred, func_ir, array_def)) + array_stmt_index = i + array_kws = {} + else: + # Bail out otherwise + break + i = i + 1 + # require array_var is found, and list_var is dead after array_call. + require(array_var and list_var_dead_after_array_call) + _make_debug_print("find_array_call")(block.body[array_stmt_index]) + return list_var, array_stmt_index, array_kws + + +def _find_iter_range(func_ir, range_iter_var, swapped): + """Find the iterator's actual range if it is either range(n), or + range(m, n), otherwise return raise GuardException. + """ + debug_print = _make_debug_print("find_iter_range") + range_iter_def = get_definition(func_ir, range_iter_var) + debug_print("range_iter_var = ", range_iter_var, " def = ", range_iter_def) + require(isinstance(range_iter_def, ir.Expr) and + range_iter_def.op == 'getiter') + range_var = range_iter_def.value + range_def = get_definition(func_ir, range_var) + debug_print("range_var = ", range_var, " range_def = ", range_def) + require(isinstance(range_def, ir.Expr) and range_def.op == 'call') + func_var = range_def.func + func_def = get_definition(func_ir, func_var) + debug_print("func_var = ", func_var, " func_def = ", func_def) + require(isinstance(func_def, ir.Global) and + (func_def.value == range or + func_def.value == numba.misc.special.prange)) + nargs = len(range_def.args) + swapping = [('"array comprehension"', 'closure of'), range_def.func.loc] + if nargs == 1: + swapped[range_def.func.name] = swapping + stop = get_definition(func_ir, range_def.args[0], lhs_only=True) + return (0, range_def.args[0], func_def) + elif nargs == 2: + swapped[range_def.func.name] = swapping + start = get_definition(func_ir, range_def.args[0], lhs_only=True) + stop = get_definition(func_ir, range_def.args[1], lhs_only=True) + return (start, stop, func_def) + else: + raise GuardException + + +@intrinsic +def length_of_iterator(typingctx, val): + """ + An implementation of len(iter) for internal use. + Primary use is for array comprehensions (see inline_closurecall). + """ + if isinstance(val, types.RangeIteratorType): + val_type = val.yield_type + + def codegen(context, builder, sig, args): + (value,) = args + iter_type = range_impl_map[val_type][1] + iterobj = cgutils.create_struct_proxy(iter_type)(context, builder, + value) + int_type = iterobj.count.type + return impl_ret_untracked(context, builder, int_type, + builder.load(iterobj.count)) + return signature(val_type, val), codegen + elif isinstance(val, types.ListIter): + def codegen(context, builder, sig, args): + (value,) = args + intp_t = context.get_value_type(types.intp) + iterobj = ListIterInstance(context, builder, sig.args[0], value) + return impl_ret_untracked(context, builder, intp_t, iterobj.size) + return signature(types.intp, val), codegen + elif isinstance(val, types.ArrayIterator): + def codegen(context, builder, sig, args): + (iterty,) = sig.args + (value,) = args + intp_t = context.get_value_type(types.intp) + iterobj = context.make_helper(builder, iterty, value=value) + arrayty = iterty.array_type + ary = make_array(arrayty)(context, builder, value=iterobj.array) + shape = cgutils.unpack_tuple(builder, ary.shape) + # array iterates along the outer dimension + return impl_ret_untracked(context, builder, intp_t, shape[0]) + return signature(types.intp, val), codegen + elif isinstance(val, types.UniTupleIter): + def codegen(context, builder, sig, args): + (iterty,) = sig.args + tuplety = iterty.container + intp_t = context.get_value_type(types.intp) + count_const = intp_t(tuplety.count) + return impl_ret_untracked(context, builder, intp_t, count_const) + + return signature(types.intp, val), codegen + elif isinstance(val, types.ListTypeIteratorType): + def codegen(context, builder, sig, args): + (value,) = args + intp_t = context.get_value_type(types.intp) + from numba.typed.listobject import ListIterInstance + iterobj = ListIterInstance(context, builder, sig.args[0], value) + return impl_ret_untracked(context, builder, intp_t, iterobj.size) + return signature(types.intp, val), codegen + else: + msg = ('Unsupported iterator found in array comprehension, try ' + 'preallocating the array and filling manually.') + raise errors.TypingError(msg) + + +def _inline_arraycall(func_ir, cfg, visited, loop, swapped, enable_prange=False, + typed=False): + """Look for array(list) call in the exit block of a given loop, and turn + list operations into array operations in the loop if the following + conditions are met: + 1. The exit block contains an array call on the list; + 2. The list variable is no longer live after array call; + 3. The list is created in the loop entry block; + 4. The loop is created from an range iterator whose length is known prior + to the loop; + 5. There is only one list_append operation on the list variable in the + loop body; + 6. The block that contains list_append dominates the loop head, which + ensures list length is the same as loop length; + If any condition check fails, no modification will be made to the incoming + IR. + """ + debug_print = _make_debug_print("inline_arraycall") + # There should only be one loop exit + require(len(loop.exits) == 1) + exit_block = next(iter(loop.exits)) + list_var, array_call_index, array_kws = _find_arraycall( + func_ir, func_ir.blocks[exit_block], + ) + + # check if dtype is present in array call + dtype_def = None + dtype_mod_def = None + if 'dtype' in array_kws: + require(isinstance(array_kws['dtype'], ir.Var)) + # We require that dtype argument to be a constant of getattr Expr, and + # we'll remember its definition for later use. + dtype_def = get_definition(func_ir, array_kws['dtype']) + require(isinstance(dtype_def, ir.Expr) and dtype_def.op == 'getattr') + dtype_mod_def = get_definition(func_ir, dtype_def.value) + + list_var_def = get_definition(func_ir, list_var) + debug_print("list_var = ", list_var, " def = ", list_var_def) + if isinstance(list_var_def, ir.Expr) and list_var_def.op == 'cast': + list_var_def = get_definition(func_ir, list_var_def.value) + # Check if the definition is a build_list + require(isinstance(list_var_def, ir.Expr) and + list_var_def.op == 'build_list') + # The build_list must be empty + require(len(list_var_def.items) == 0) + + # Look for list_append in "last" block in loop body, which should be a block + # that is a post-dominator of the loop header. + list_append_stmts = [] + for label in loop.body: + # We have to consider blocks of this loop, but not sub-loops. + # To achieve this, we require the set of "in_loops" of "label" to be + # visited loops. + in_visited_loops = [l.header in visited for l in cfg.in_loops(label)] + if not all(in_visited_loops): + continue + block = func_ir.blocks[label] + debug_print("check loop body block ", label) + for stmt in block.find_insts(ir.Assign): + expr = stmt.value + if isinstance(expr, ir.Expr) and expr.op == 'call': + func_def = get_definition(func_ir, expr.func) + if (isinstance(func_def, ir.Expr) and func_def.op == 'getattr' + and func_def.attr == 'append'): + list_def = get_definition(func_ir, func_def.value) + debug_print("list_def = ", list_def, + list_def is list_var_def) + if list_def is list_var_def: + # found matching append call + list_append_stmts.append((label, block, stmt)) + + # Require only one list_append, otherwise we won't know the indices + require(len(list_append_stmts) == 1) + append_block_label, append_block, append_stmt = list_append_stmts[0] + + # Check if append_block (besides loop entry) dominates loop header. + # Since CFG doesn't give us this info without loop entry, we approximate + # by checking if the predecessor set of the header block is the same + # as loop_entries plus append_block, which is certainly more restrictive + # than necessary, and can be relaxed if needed. + preds = set(l for l, b in cfg.predecessors(loop.header)) + debug_print("preds = ", preds, (loop.entries | set([append_block_label]))) + require(preds == (loop.entries | set([append_block_label]))) + + # Find iterator in loop header + iter_vars = [] + iter_first_vars = [] + loop_header = func_ir.blocks[loop.header] + for stmt in loop_header.find_insts(ir.Assign): + expr = stmt.value + if isinstance(expr, ir.Expr): + if expr.op == 'iternext': + iter_def = get_definition(func_ir, expr.value) + debug_print("iter_def = ", iter_def) + iter_vars.append(expr.value) + elif expr.op == 'pair_first': + iter_first_vars.append(stmt.target) + + # Require only one iterator in loop header + require(len(iter_vars) == 1 and len(iter_first_vars) == 1) + # variable that holds the iterator object + iter_var = iter_vars[0] + # variable that holds the value out of iterator + iter_first_var = iter_first_vars[0] + + # Final requirement: only one loop entry, and we're going to modify it by: + # 1. replacing the list definition with an array definition; + # 2. adding a counter for the array iteration. + require(len(loop.entries) == 1) + loop_entry = func_ir.blocks[next(iter(loop.entries))] + terminator = loop_entry.terminator + scope = loop_entry.scope + loc = loop_entry.loc + stmts = [] + removed = [] + + def is_removed(val, removed): + if isinstance(val, ir.Var): + for x in removed: + if x.name == val.name: + return True + return False + + # Skip list construction and skip terminator, add the rest to stmts + for i in range(len(loop_entry.body) - 1): + stmt = loop_entry.body[i] + if (isinstance(stmt, ir.Assign) and + (stmt.value is list_def or is_removed(stmt.value, removed))): + removed.append(stmt.target) + else: + stmts.append(stmt) + debug_print("removed variables: ", removed) + + # Define an index_var to index the array. + # If the range happens to be single step ranges like range(n), or + # range(m, n), then the index_var correlates to iterator index; otherwise + # we'll have to define a new counter. + range_def = guard(_find_iter_range, func_ir, iter_var, swapped) + index_var = scope.redefine("index", loc) + if range_def and range_def[0] == 0: + # iterator starts with 0, index_var can just be iter_first_var + index_var = iter_first_var + else: + # index_var = -1 # starting the index with -1 since it will incremented + # in loop header + stmts.append(_new_definition(func_ir, index_var, + ir.Const(value=-1, loc=loc), loc)) + + # Insert statement to get the size of the loop iterator + size_var = scope.redefine("size", loc) + if range_def: + start, stop, range_func_def = range_def + if start == 0: + size_val = stop + else: + size_val = ir.Expr.binop(fn=operator.sub, lhs=stop, rhs=start, + loc=loc) + # we can parallelize this loop if enable_prange = True, by changing + # range function from range, to prange. + if enable_prange and isinstance(range_func_def, ir.Global): + range_func_def.name = 'internal_prange' + range_func_def.value = internal_prange + + else: + # this doesn't work in objmode as it's effectively untyped + if typed: + len_func_var = scope.redefine("len_func", loc) + stmts.append(_new_definition(func_ir, len_func_var, + ir.Global('length_of_iterator', + length_of_iterator, + loc=loc), + loc)) + size_val = ir.Expr.call(len_func_var, (iter_var,), (), loc=loc) + else: + raise GuardException + + stmts.append(_new_definition(func_ir, size_var, size_val, loc)) + + size_tuple_var = scope.redefine("size_tuple", loc) + stmts.append(_new_definition(func_ir, size_tuple_var, + ir.Expr.build_tuple(items=[size_var], loc=loc), loc)) + + # Insert array allocation + array_var = scope.redefine("array", loc) + empty_func = scope.redefine("empty_func", loc) + if dtype_def and dtype_mod_def: + # when dtype is present, we'll call empty with dtype + dtype_mod_var = scope.redefine("dtype_mod", loc) + dtype_var = scope.redefine("dtype", loc) + stmts.append(_new_definition( + func_ir, dtype_mod_var, dtype_mod_def, loc)) + stmts.append(_new_definition( + func_ir, dtype_var, + ir.Expr.getattr(dtype_mod_var, dtype_def.attr, loc), loc)) + stmts.append(_new_definition( + func_ir, empty_func, ir.Global('empty', np.empty, loc=loc), loc)) + array_kws = [('dtype', dtype_var)] + else: + # this doesn't work in objmode as it's effectively untyped + if typed: + # otherwise we'll call unsafe_empty_inferred + stmts.append(_new_definition( + func_ir, empty_func, + ir.Global('unsafe_empty_inferred', unsafe_empty_inferred, + loc=loc), + loc)) + array_kws = [] + else: + raise GuardException + + # array_var = empty_func(size_tuple_var) + stmts.append(_new_definition(func_ir, array_var, + ir.Expr.call(empty_func, (size_tuple_var,), list(array_kws), + loc=loc), loc)) + + # Add back removed just in case they are used by something else + for var in removed: + stmts.append(_new_definition(func_ir, var, array_var, loc)) + + # Add back terminator + stmts.append(terminator) + # Modify loop_entry + loop_entry.body = stmts + + if range_def: + if range_def[0] != 0: + # when range doesn't start from 0, index_var becomes loop index + # (iter_first_var) minus an offset (range_def[0]) + terminator = loop_header.terminator + assert (isinstance(terminator, ir.Branch)) + # find the block in the loop body that header jumps to + block_id = terminator.truebr + blk = func_ir.blocks[block_id] + loc = blk.loc + blk.body.insert( + 0, + _new_definition( + func_ir, index_var, + ir.Expr.binop(fn=operator.sub, lhs=iter_first_var, + rhs=range_def[0], loc=loc), + loc + ) + ) + else: + # Insert index_var increment to the end of loop header + loc = loop_header.loc + terminator = loop_header.terminator + stmts = loop_header.body[0:-1] + next_index_var = scope.redefine("next_index", loc) + one = scope.redefine("one", loc) + # one = 1 + stmts.append(_new_definition(func_ir, one, + ir.Const(value=1,loc=loc), loc)) + # next_index_var = index_var + 1 + stmts.append(_new_definition(func_ir, next_index_var, + ir.Expr.binop(fn=operator.add, lhs=index_var, rhs=one, + loc=loc), loc)) + # index_var = next_index_var + stmts.append(_new_definition(func_ir, index_var, next_index_var, loc)) + stmts.append(terminator) + loop_header.body = stmts + + # In append_block, change list_append into array assign + for i in range(len(append_block.body)): + if append_block.body[i] is append_stmt: + debug_print("Replace append with SetItem") + append_block.body[i] = ir.SetItem( + target=array_var, index=index_var, + value=append_stmt.value.args[0], loc=append_stmt.loc) + + # replace array call, by changing "a = array(b)" to "a = b" + stmt = func_ir.blocks[exit_block].body[array_call_index] + # stmt can be either array call or SetItem, we only replace array call + if isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Expr): + stmt.value = array_var + func_ir._definitions[stmt.target.name] = [stmt.value] + + return True + + +def _find_unsafe_empty_inferred(func_ir, expr): + unsafe_empty_inferred + require(isinstance(expr, ir.Expr) and expr.op == 'call') + callee = expr.func + callee_def = get_definition(func_ir, callee) + require(isinstance(callee_def, ir.Global)) + _make_debug_print("_find_unsafe_empty_inferred")(callee_def.value) + return callee_def.value == unsafe_empty_inferred + + +def _fix_nested_array(func_ir): + """Look for assignment like: a[..] = b, where both a and b are numpy arrays, + and try to eliminate array b by expanding a with an extra dimension. + """ + blocks = func_ir.blocks + cfg = compute_cfg_from_blocks(blocks) + usedefs = compute_use_defs(blocks) + empty_deadmap = dict([(label, set()) for label in blocks.keys()]) + livemap = compute_live_variables(cfg, blocks, usedefs.defmap, empty_deadmap) + + def find_array_def(arr): + """Find numpy array definition such as + arr = numba.unsafe.ndarray.empty_inferred(...). + If it is arr = b[...], find array definition of b recursively. + """ + arr_def = get_definition(func_ir, arr) + _make_debug_print("find_array_def")(arr, arr_def) + if isinstance(arr_def, ir.Expr): + if guard(_find_unsafe_empty_inferred, func_ir, arr_def): + return arr_def + elif arr_def.op == 'getitem': + return find_array_def(arr_def.value) + raise GuardException + + def fix_dependencies(expr, varlist): + """Double check if all variables in varlist are defined before + expr is used. Try to move constant definition when the check fails. + Bails out by raising GuardException if it can't be moved. + """ + debug_print = _make_debug_print("fix_dependencies") + for label, block in blocks.items(): + scope = block.scope + body = block.body + defined = set() + for i in range(len(body)): + inst = body[i] + if isinstance(inst, ir.Assign): + defined.add(inst.target.name) + if inst.value is expr: + new_varlist = [] + for var in varlist: + # var must be defined before this inst, or live + # and not later defined. + if (var.name in defined or + (var.name in livemap[label] and + not (var.name in usedefs.defmap[label]))): + debug_print(var.name, " already defined") + new_varlist.append(var) + else: + debug_print(var.name, " not yet defined") + var_def = get_definition(func_ir, var.name) + if isinstance(var_def, ir.Const): + loc = var.loc + new_var = scope.redefine("new_var", loc) + new_const = ir.Const(var_def.value, loc) + new_vardef = _new_definition( + func_ir, new_var, new_const, loc) + new_body = [] + new_body.extend(body[:i]) + new_body.append(new_vardef) + new_body.extend(body[i:]) + block.body = new_body + new_varlist.append(new_var) + else: + raise GuardException + return new_varlist + # when expr is not found in block + raise GuardException + + def fix_array_assign(stmt): + """For assignment like lhs[idx] = rhs, where both lhs and rhs are + arrays, do the following: + 1. find the definition of rhs, which has to be a call to + numba.unsafe.ndarray.empty_inferred + 2. find the source array creation for lhs, insert an extra dimension of + size of b. + 3. replace the definition of + rhs = numba.unsafe.ndarray.empty_inferred(...) with rhs = lhs[idx] + """ + require(isinstance(stmt, ir.SetItem)) + require(isinstance(stmt.value, ir.Var)) + debug_print = _make_debug_print("fix_array_assign") + debug_print("found SetItem: ", stmt) + lhs = stmt.target + # Find the source array creation of lhs + lhs_def = find_array_def(lhs) + debug_print("found lhs_def: ", lhs_def) + rhs_def = get_definition(func_ir, stmt.value) + debug_print("found rhs_def: ", rhs_def) + require(isinstance(rhs_def, ir.Expr)) + if rhs_def.op == 'cast': + rhs_def = get_definition(func_ir, rhs_def.value) + require(isinstance(rhs_def, ir.Expr)) + require(_find_unsafe_empty_inferred(func_ir, rhs_def)) + # Find the array dimension of rhs + dim_def = get_definition(func_ir, rhs_def.args[0]) + require(isinstance(dim_def, ir.Expr) and dim_def.op == 'build_tuple') + debug_print("dim_def = ", dim_def) + extra_dims = [get_definition(func_ir, x, lhs_only=True) + for x in dim_def.items ] + debug_print("extra_dims = ", extra_dims) + # Expand size tuple when creating lhs_def with extra_dims + size_tuple_def = get_definition(func_ir, lhs_def.args[0]) + require(isinstance(size_tuple_def, ir.Expr) and + size_tuple_def.op == 'build_tuple') + debug_print("size_tuple_def = ", size_tuple_def) + extra_dims = fix_dependencies(size_tuple_def, extra_dims) + size_tuple_def.items += extra_dims + # In-place modify rhs_def to be getitem + rhs_def.op = 'getitem' + rhs_def.fn = operator.getitem + rhs_def.value = get_definition(func_ir, lhs, lhs_only=True) + rhs_def.index = stmt.index + del rhs_def._kws['func'] + del rhs_def._kws['args'] + del rhs_def._kws['vararg'] + del rhs_def._kws['kws'] + # success + return True + + for label in find_topo_order(func_ir.blocks): + block = func_ir.blocks[label] + for stmt in block.body: + if guard(fix_array_assign, stmt): + block.body.remove(stmt) + + +def _new_definition(func_ir, var, value, loc): + func_ir._definitions[var.name] = [value] + return ir.Assign(value=value, target=var, loc=loc) + + +@rewrites.register_rewrite('after-inference') +class RewriteArrayOfConsts(rewrites.Rewrite): + '''The RewriteArrayOfConsts class is responsible for finding + 1D array creations from a constant list, and rewriting it into + direct initialization of array elements without creating the list. + ''' + def __init__(self, state, *args, **kws): + self.typingctx = state.typingctx + super(RewriteArrayOfConsts, self).__init__(*args, **kws) + + def match(self, func_ir, block, typemap, calltypes): + if len(calltypes) == 0: + return False + self.crnt_block = block + self.new_body = guard(_inline_const_arraycall, block, func_ir, + self.typingctx, typemap, calltypes) + return self.new_body is not None + + def apply(self): + self.crnt_block.body = self.new_body + return self.crnt_block + + +def _inline_const_arraycall(block, func_ir, context, typemap, calltypes): + """Look for array(list) call where list is a constant list created by + build_list, and turn them into direct array creation and initialization, if + the following conditions are met: + 1. The build_list call immediate precedes the array call; + 2. The list variable is no longer live after array call; + If any condition check fails, no modification will be made. + """ + debug_print = _make_debug_print("inline_const_arraycall") + scope = block.scope + + def inline_array(array_var, expr, stmts, list_vars, dels): + """Check to see if the given "array_var" is created from a list + of constants, and try to inline the list definition as array + initialization. + + Extra statements produced with be appended to "stmts". + """ + callname = guard(find_callname, func_ir, expr) + require(callname and callname[1] == 'numpy' and callname[0] == 'array') + require(expr.args[0].name in list_vars) + ret_type = calltypes[expr].return_type + require(isinstance(ret_type, types.ArrayCompatible) and + ret_type.ndim == 1) + loc = expr.loc + list_var = expr.args[0] + # Get the type of the array to be created. + array_typ = typemap[array_var.name] + debug_print("inline array_var = ", array_var, " list_var = ", list_var) + # Get the element type of the array to be created. + dtype = array_typ.dtype + # Get the sequence of operations to provide values to the new array. + seq, _ = find_build_sequence(func_ir, list_var) + size = len(seq) + # Create a tuple to pass to empty below to specify the new array size. + size_var = scope.redefine("size", loc) + size_tuple_var = scope.redefine("size_tuple", loc) + size_typ = types.intp + size_tuple_typ = types.UniTuple(size_typ, 1) + typemap[size_var.name] = size_typ + typemap[size_tuple_var.name] = size_tuple_typ + stmts.append( + _new_definition(func_ir, size_var, + ir.Const(size, loc=loc), loc)) + stmts.append( + _new_definition(func_ir, size_tuple_var, + ir.Expr.build_tuple(items=[size_var], loc=loc), + loc)) + + # The general approach is to create an empty array and then fill + # the elements in one-by-one from their specification. + + # Get the numpy type to pass to empty. + nptype = types.DType(dtype) + + # Create a variable to hold the numpy empty function. + empty_func = scope.redefine("empty_func", loc) + fnty = get_np_ufunc_typ(np.empty) + context.resolve_function_type(fnty, (size_typ,), {'dtype': nptype}) + + typemap[empty_func.name] = fnty + + stmts.append( + _new_definition(func_ir, empty_func, + ir.Global('empty', np.empty, loc=loc), loc)) + + # We pass two arguments to empty, first the size tuple and second + # the dtype of the new array. Here, we created typ_var which is + # the dtype argument of the new array. typ_var in turn is created + # by getattr of the dtype string on the numpy module. + + # Create var for numpy module. + g_np_var = scope.redefine("$np_g_var", loc) + typemap[g_np_var.name] = types.misc.Module(np) + g_np = ir.Global('np', np, loc) + stmts.append(_new_definition(func_ir, g_np_var, g_np, loc)) + + # Create var for result of numpy.. + typ_var = scope.redefine("$np_typ_var", loc) + typemap[typ_var.name] = nptype + dtype_str = str(dtype) + if dtype_str == 'bool': + dtype_str = 'bool_' + # Get dtype attribute of numpy module. + np_typ_getattr = ir.Expr.getattr(g_np_var, dtype_str, loc) + stmts.append(_new_definition(func_ir, typ_var, np_typ_getattr, loc)) + + # Create the call to numpy.empty passing the size tuple and dtype var. + empty_call = ir.Expr.call(empty_func, [size_var, typ_var], {}, loc=loc) + calltypes[empty_call] = typing.signature(array_typ, size_typ, nptype) + stmts.append(_new_definition(func_ir, array_var, empty_call, loc)) + + # Fill in the new empty array one-by-one. + for i in range(size): + index_var = scope.redefine("index", loc) + index_typ = types.intp + typemap[index_var.name] = index_typ + stmts.append( + _new_definition(func_ir, index_var, ir.Const(i, loc), loc)) + setitem = ir.SetItem(array_var, index_var, seq[i], loc) + calltypes[setitem] = typing.signature(types.none, array_typ, + index_typ, dtype) + stmts.append(setitem) + + stmts.extend(dels) + return True + + class State(object): + """ + This class is used to hold the state in the following loop so as to make + it easy to reset the state of the variables tracking the various + statement kinds + """ + + def __init__(self): + # list_vars keep track of the variable created from the latest + # build_list instruction, as well as its synonyms. + self.list_vars = [] + # dead_vars keep track of those in list_vars that are considered + # dead. + self.dead_vars = [] + # list_items keep track of the elements used in build_list. + self.list_items = [] + self.stmts = [] + # dels keep track of the deletion of list_items, which will need to + # be moved after array initialization. + self.dels = [] + # tracks if a modification has taken place + self.modified = False + + def reset(self): + """ + Resets the internal state of the variables used for tracking + """ + self.list_vars = [] + self.dead_vars = [] + self.list_items = [] + self.dels = [] + + def list_var_used(self, inst): + """ + Returns True if the list being analysed is used between the + build_list and the array call. + """ + return any([x.name in self.list_vars for x in inst.list_vars()]) + + state = State() + + for inst in block.body: + if isinstance(inst, ir.Assign): + if isinstance(inst.value, ir.Var): + if inst.value.name in state.list_vars: + state.list_vars.append(inst.target.name) + state.stmts.append(inst) + continue + elif isinstance(inst.value, ir.Expr): + expr = inst.value + if expr.op == 'build_list': + # new build_list encountered, reset state + state.reset() + state.list_items = [x.name for x in expr.items] + state.list_vars = [inst.target.name] + state.stmts.append(inst) + continue + elif expr.op == 'call' and expr in calltypes: + if guard(inline_array, inst.target, expr, + state.stmts, state.list_vars, state.dels): + state.modified = True + continue + elif isinstance(inst, ir.Del): + removed_var = inst.value + if removed_var in state.list_items: + state.dels.append(inst) + continue + elif removed_var in state.list_vars: + # one of the list_vars is considered dead. + state.dead_vars.append(removed_var) + state.list_vars.remove(removed_var) + state.stmts.append(inst) + if state.list_vars == []: + # if all list_vars are considered dead, we need to filter + # them out from existing stmts to completely remove + # build_list. + # Note that if a translation didn't take place, dead_vars + # will also be empty when we reach this point. + body = [] + for inst in state.stmts: + if ((isinstance(inst, ir.Assign) and + inst.target.name in state.dead_vars) or + (isinstance(inst, ir.Del) and + inst.value in state.dead_vars)): + continue + body.append(inst) + state.stmts = body + state.dead_vars = [] + state.modified = True + continue + state.stmts.append(inst) + + # If the list is used in any capacity between build_list and array + # call, then we must call off the translation for this list because + # it could be mutated and list_items would no longer be applicable. + if state.list_var_used(inst): + state.reset() + + return state.stmts if state.modified else None diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/interpreter.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/interpreter.py new file mode 100644 index 0000000000000000000000000000000000000000..605ca2982999cf3f813b5b39dbd6119a8db872de --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/interpreter.py @@ -0,0 +1,3424 @@ +import builtins +import collections +import dis +import operator +import logging +import textwrap + +from numba.core import errors, ir, config +from numba.core.errors import ( + NotDefinedError, + UnsupportedBytecodeError, + error_extras, +) +from numba.core.ir_utils import get_definition, guard +from numba.core.utils import (PYVERSION, BINOPS_TO_OPERATORS, + INPLACE_BINOPS_TO_OPERATORS,) +from numba.core.byteflow import Flow, AdaptDFA, AdaptCFA, BlockKind +from numba.core.unsafe import eh +from numba.cpython.unsafe.tuple import unpack_single_tuple + + +if PYVERSION in ((3, 12), (3, 13)): + # Operands for CALL_INTRINSIC_1 + from numba.core.byteflow import CALL_INTRINSIC_1_Operand as ci1op +elif PYVERSION in ((3, 10), (3, 11)): + pass +else: + raise NotImplementedError(PYVERSION) + + +class _UNKNOWN_VALUE(object): + """Represents an unknown value, this is for ease of debugging purposes only. + """ + + def __init__(self, varname): + self._varname = varname + + def __repr__(self): + return "_UNKNOWN_VALUE({})".format(self._varname) + + +_logger = logging.getLogger(__name__) + + +class Assigner(object): + """ + This object keeps track of potential assignment simplifications + inside a code block. + For example `$O.1 = x` followed by `y = $0.1` can be simplified + into `y = x`, but it's not possible anymore if we have `x = z` + in-between those two instructions. + + NOTE: this is not only an optimization, but is actually necessary + due to certain limitations of Numba - such as only accepting the + returning of an array passed as function argument. + """ + + def __init__(self): + # { destination variable name -> source Var object } + self.dest_to_src = {} + # Basically a reverse mapping of dest_to_src: + # { source variable name -> all destination names in dest_to_src } + self.src_invalidate = collections.defaultdict(list) + self.unused_dests = set() + + def assign(self, srcvar, destvar): + """ + Assign *srcvar* to *destvar*. Return either *srcvar* or a possible + simplified assignment source (earlier assigned to *srcvar*). + """ + srcname = srcvar.name + destname = destvar.name + if destname in self.src_invalidate: + # destvar will change, invalidate all previously known + # simplifications + for d in self.src_invalidate.pop(destname): + self.dest_to_src.pop(d) + if srcname in self.dest_to_src: + srcvar = self.dest_to_src[srcname] + if destvar.is_temp: + self.dest_to_src[destname] = srcvar + self.src_invalidate[srcname].append(destname) + self.unused_dests.add(destname) + return srcvar + + def get_assignment_source(self, destname): + """ + Get a possible assignment source (a ir.Var instance) to replace + *destname*, otherwise None. + """ + if destname in self.dest_to_src: + return self.dest_to_src[destname] + self.unused_dests.discard(destname) + return None + + +def _remove_assignment_definition(old_body, idx, func_ir, already_deleted_defs): + """ + Deletes the definition defined for old_body at index idx + from func_ir. We assume this stmt will be deleted from + new_body. + + In some optimizations we may update the same variable multiple times. + In this situation, we only need to delete a particular definition once, + this is tracked in already_deleted_def, which is a map from + assignment name to the set of values that have already been + deleted. + """ + lhs = old_body[idx].target.name + rhs = old_body[idx].value + if rhs in func_ir._definitions[lhs]: + func_ir._definitions[lhs].remove(rhs) + already_deleted_defs[lhs].add(rhs) + elif rhs not in already_deleted_defs[lhs]: + raise UnsupportedBytecodeError( + "Inconsistency found in the definitions while executing" + " a peephole optimization. This suggests an internal" + " error or inconsistency elsewhere in the compiler." + ) + + +def _call_function_ex_replace_kws_small( + old_body, + keyword_expr, + new_body, + buildmap_idx, + func_ir, + already_deleted_defs +): + """ + Extracts the kws args passed as varkwarg + for CALL_FUNCTION_EX. This pass is taken when + n_kws <= 15 and the bytecode looks like: + + # Start for each argument + LOAD_FAST # Load each argument. + # End for each argument + ... + BUILD_CONST_KEY_MAP # Build a map + + In the generated IR, the varkwarg refers + to a single build_map that contains all of the + kws. In addition to returning the kws, this + function updates new_body to remove all usage + of the map. + """ + kws = keyword_expr.items.copy() + # kws are required to have constant keys. + # We update these with the value_indexes + value_indexes = keyword_expr.value_indexes + for key, index in value_indexes.items(): + kws[index] = (key, kws[index][1]) + # Remove the build_map by setting the list + # index to None. Nones will be removed later. + new_body[buildmap_idx] = None + # Remove the definition. + _remove_assignment_definition( + old_body, buildmap_idx, func_ir, already_deleted_defs + ) + return kws + + +def _call_function_ex_replace_kws_large( + old_body, + buildmap_name, + buildmap_idx, + search_end, + new_body, + func_ir, + errmsg, + already_deleted_defs +): + """ + Extracts the kws args passed as varkwarg + for CALL_FUNCTION_EX. This pass is taken when + n_kws > 15 and the bytecode looks like: + + BUILD_MAP # Construct the map + # Start for each argument + LOAD_CONST # Load a constant for the name of the argument + LOAD_FAST # Load each argument. + MAP_ADD # Append the (key, value) pair to the map + # End for each argument + + In the IR generated, the initial build map is empty and a series + of setitems are applied afterwards. THE IR looks like: + + $build_map_var = build_map(items=[]) + $constvar = const(str, ...) # create the const key + # CREATE THE ARGUMENT, This may take multiple lines. + $created_arg = ... + $var = getattr( + value=$build_map_var, + attr=__setitem__, + ) + $unused_var = call $var($constvar, $created_arg) + + We iterate through the IR, deleting all usages of the buildmap + from the new_body, and adds the kws to a new kws list. + """ + # Remove the build_map from the body. + new_body[buildmap_idx] = None + # Remove the definition. + _remove_assignment_definition( + old_body, buildmap_idx, func_ir, already_deleted_defs + ) + kws = [] + search_start = buildmap_idx + 1 + while search_start <= search_end: + # The first value must be a constant. + const_stmt = old_body[search_start] + if not ( + isinstance(const_stmt, ir.Assign) + and isinstance(const_stmt.value, ir.Const) + ): + # We cannot handle this format so raise the + # original error message. + raise UnsupportedBytecodeError(errmsg) + key_var_name = const_stmt.target.name + key_val = const_stmt.value.value + search_start += 1 + # Now we need to search for a getattr with setitem + found_getattr = False + while ( + search_start <= search_end + and not found_getattr + ): + getattr_stmt = old_body[search_start] + if ( + isinstance(getattr_stmt, ir.Assign) + and isinstance(getattr_stmt.value, ir.Expr) + and getattr_stmt.value.op == "getattr" + and ( + getattr_stmt.value.value.name + == buildmap_name + ) + and getattr_stmt.value.attr == "__setitem__" + ): + found_getattr = True + else: + # If the argument is "created" in JIT, then there + # will be intermediate operations in between setitems. + # For example we have arg5=pow(arg5, 2), + # then the IR would look like: + # + # # Creation of the constant key. + # $const44.26 = const(str, arg5) + # + # # Argument creation. This is the section we are skipping + # $46load_global.27 = global(pow: ) + # $const50.29 = const(int, 2) + # $call.30 = call $46load_global.27(arg5, $const50.29) + # + # # Setitem with arg5 + # $54map_add.31 = getattr(value=$map.2, attr=__setitem__) + # $54map_add.32 = call $54map_add.31($const44.26, $call.30) + search_start += 1 + if ( + not found_getattr + or search_start == search_end + ): + # We cannot handle this format so raise the + # original error message. + raise UnsupportedBytecodeError(errmsg) + setitem_stmt = old_body[search_start + 1] + if not ( + isinstance(setitem_stmt, ir.Assign) + and isinstance(setitem_stmt.value, ir.Expr) + and setitem_stmt.value.op == "call" + and ( + setitem_stmt.value.func.name + == getattr_stmt.target.name + ) + and len(setitem_stmt.value.args) == 2 + and ( + setitem_stmt.value.args[0].name + == key_var_name + ) + ): + # A call statement should always immediately follow the + # getattr. If for some reason this doesn't match the code + # format, we raise the original error message. This check + # is meant as a precaution. + raise UnsupportedBytecodeError(errmsg) + arg_var = setitem_stmt.value.args[1] + # Append the (key, value) pair. + kws.append((key_val, arg_var)) + # Remove the __setitem__ getattr and call + new_body[search_start] = None + new_body[search_start + 1] = None + # Remove the definitions. + _remove_assignment_definition( + old_body, search_start, func_ir, already_deleted_defs + ) + _remove_assignment_definition( + old_body, search_start + 1, func_ir, already_deleted_defs + ) + search_start += 2 + return kws + + +def _call_function_ex_replace_args_small( + old_body, + tuple_expr, + new_body, + buildtuple_idx, + func_ir, + already_deleted_defs +): + """ + Extracts the args passed as vararg + for CALL_FUNCTION_EX. This pass is taken when + n_args <= 30 and the bytecode looks like: + + # Start for each argument + LOAD_FAST # Load each argument. + # End for each argument + ... + BUILD_TUPLE # Create a tuple of the arguments + + In the IR generated, the vararg refer + to a single build_tuple that contains all of the + args. In addition to returning the args, this + function updates new_body to remove all usage + of the tuple. + """ + # Delete the build tuple + new_body[buildtuple_idx] = None + # Remove the definition. + _remove_assignment_definition( + old_body, buildtuple_idx, func_ir, already_deleted_defs + ) + # Return the args. + return tuple_expr.items + + +def _call_function_ex_replace_args_large( + old_body, + vararg_stmt, + new_body, + search_end, + func_ir, + errmsg, + already_deleted_defs +): + """ + Extracts the args passed as vararg + for CALL_FUNCTION_EX. This pass is taken when + n_args > 30 and the bytecode looks like: + + BUILD_TUPLE # Create a list to append to + # Start for each argument + LOAD_FAST # Load each argument. + LIST_APPEND # Add the argument to the list + # End for each argument + ... + LIST_TO_TUPLE # Convert the args to a tuple. + + In the IR generated, the tuple is created by concatenating + together several 1 element tuples to an initial empty tuple. + We traverse backwards in the IR, collecting args, until we + find the original empty tuple. For example, the IR might + look like: + + $orig_tuple = build_tuple(items=[]) + $first_var = build_tuple(items=[Var(arg0, test.py:6)]) + $next_tuple = $orig_tuple + $first_var + ... + $final_var = build_tuple(items=[Var(argn, test.py:6)]) + $final_tuple = $prev_tuple + $final_var + $varargs_var = $final_tuple + """ + # We traverse to the front of the block to look for the original + # tuple. + search_start = 0 + total_args = [] + if ( + isinstance(vararg_stmt, ir.Assign) + and isinstance(vararg_stmt.value, ir.Var) + ): + target_name = vararg_stmt.value.name + # If there is an initial assignment, delete it + new_body[search_end] = None + # Remove the definition. + _remove_assignment_definition( + old_body, search_end, func_ir, already_deleted_defs + ) + search_end -= 1 + else: + # There must always be an initial assignment + # https://github.com/numba/numba/blob/59fa2e335be68148b3bd72a29de3ff011430038d/numba/core/interpreter.py#L259-L260 + # If this changes we may need to support this branch. + raise AssertionError("unreachable") + # Traverse backwards to find all concatenations + # until eventually reaching the original empty tuple. + while search_end >= search_start: + concat_stmt = old_body[search_end] + if ( + isinstance(concat_stmt, ir.Assign) + and concat_stmt.target.name == target_name + and isinstance(concat_stmt.value, ir.Expr) + and concat_stmt.value.op == "build_tuple" + and not concat_stmt.value.items + ): + new_body[search_end] = None + # Remove the definition. + _remove_assignment_definition( + old_body, search_end, func_ir, already_deleted_defs + ) + # If we have reached the build_tuple we exit. + break + else: + # We expect to find another arg to append. + # The first stmt must be a binop "add" + if (search_end == search_start) or not ( + isinstance(concat_stmt, ir.Assign) + and ( + concat_stmt.target.name + == target_name + ) + and isinstance( + concat_stmt.value, ir.Expr + ) + and concat_stmt.value.op == "binop" + and concat_stmt.value.fn == operator.add + ): + # We cannot handle this format. + raise UnsupportedBytecodeError(errmsg) + lhs_name = concat_stmt.value.lhs.name + rhs_name = concat_stmt.value.rhs.name + # The previous statement should be a + # build_tuple containing the arg. + arg_tuple_stmt = old_body[search_end - 1] + if not ( + isinstance(arg_tuple_stmt, ir.Assign) + and isinstance( + arg_tuple_stmt.value, ir.Expr + ) + and ( + arg_tuple_stmt.value.op + == "build_tuple" + ) + and len(arg_tuple_stmt.value.items) == 1 + ): + # We cannot handle this format. + raise UnsupportedBytecodeError(errmsg) + if arg_tuple_stmt.target.name == lhs_name: + # The tuple should always be generated on the RHS. + raise AssertionError("unreachable") + elif arg_tuple_stmt.target.name == rhs_name: + target_name = lhs_name + else: + # We cannot handle this format. + raise UnsupportedBytecodeError(errmsg) + total_args.append( + arg_tuple_stmt.value.items[0] + ) + new_body[search_end] = None + new_body[search_end - 1] = None + # Remove the definitions. + _remove_assignment_definition( + old_body, search_end, func_ir, already_deleted_defs + ) + _remove_assignment_definition( + old_body, search_end - 1, func_ir, already_deleted_defs + ) + search_end -= 2 + # Avoid any space between appends + keep_looking = True + while search_end >= search_start and keep_looking: + next_stmt = old_body[search_end] + if ( + isinstance(next_stmt, ir.Assign) + and ( + next_stmt.target.name + == target_name + ) + ): + keep_looking = False + else: + # If the argument is "created" in JIT, then there + # will be intermediate operations in between appends. + # For example if the next arg after arg4 is pow(arg5, 2), + # then the IR would look like: + # + # # Appending arg4 + # $arg4_tup = build_tuple(items=[arg4]) + # $append_var.5 = $append_var.4 + $arg4_tup + # + # # Creation of arg5. + # # This is the section that we are skipping. + # $32load_global.20 = global(pow: ) + # $const36.22 = const(int, 2) + # $call.23 = call $32load_global.20(arg5, $const36.22) + # + # # Appending arg5 + # $arg5_tup = build_tuple(items=[$call.23]) + # $append_var.6 = $append_var.5 + $arg5_tup + search_end -= 1 + if search_end == search_start: + # If we reached the start we never found the build_tuple. + # We cannot handle this format so raise the + # original error message. + raise UnsupportedBytecodeError(errmsg) + # Reverse the arguments so we get the correct order. + return total_args[::-1] + + +def peep_hole_call_function_ex_to_call_function_kw(func_ir): + """ + This peephole rewrites a bytecode sequence unique to Python 3.10 + where CALL_FUNCTION_EX is used instead of CALL_FUNCTION_KW because of + stack limitations set by CPython. This limitation is imposed whenever + a function call has too many arguments or keyword arguments. + + https://github.com/python/cpython/blob/a58ebcc701dd6c43630df941481475ff0f615a81/Python/compile.c#L55 + https://github.com/python/cpython/blob/a58ebcc701dd6c43630df941481475ff0f615a81/Python/compile.c#L4442 + + In particular, this change is imposed whenever (n_args / 2) + n_kws > 15. + + Different bytecode is generated for args depending on if n_args > 30 + or n_args <= 30 and similarly if n_kws > 15 or n_kws <= 15. + + This function unwraps the *args and **kwargs in the function call + and places these values directly into the args and kwargs of the call. + """ + # All changes are local to the a single block + # so it can be traversed in any order. + errmsg = textwrap.dedent(""" + CALL_FUNCTION_EX with **kwargs not supported. + If you are not using **kwargs this may indicate that + you have a large number of kwargs and are using inlined control + flow. You can resolve this issue by moving the control flow out of + the function call. For example, if you have + + f(a=1 if flag else 0, ...) + + Replace that with: + + a_val = 1 if flag else 0 + f(a=a_val, ...)""") + + # Track which definitions have already been deleted + already_deleted_defs = collections.defaultdict(set) + for blk in func_ir.blocks.values(): + blk_changed = False + new_body = [] + for i, stmt in enumerate(blk.body): + if ( + isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == "call" + and stmt.value.varkwarg is not None + ): + blk_changed = True + call = stmt.value + args = call.args + kws = call.kws + # We need to check the call expression contents if + # it contains either vararg or varkwarg. If it contains + # varkwarg we need to update the IR. If it just contains + # vararg we don't need to update the IR, but we need to + # check if peep_hole_list_to_tuple failed to replace the + # vararg list with a tuple. If so, we output an error + # message with suggested code changes. + vararg = call.vararg + varkwarg = call.varkwarg + start_search = i - 1 + # varkwarg should be defined second so we start there. + varkwarg_loc = start_search + keyword_def = None + found = False + while varkwarg_loc >= 0 and not found: + keyword_def = blk.body[varkwarg_loc] + if ( + isinstance(keyword_def, ir.Assign) + and keyword_def.target.name == varkwarg.name + ): + found = True + else: + varkwarg_loc -= 1 + if ( + kws + or not found + or not ( + isinstance(keyword_def.value, ir.Expr) + and keyword_def.value.op == "build_map" + ) + ): + # If we couldn't find where the kwargs are created + # then it should be a normal **kwargs call + # so we produce an unsupported message. + raise UnsupportedBytecodeError(errmsg) + # Determine the kws + if keyword_def.value.items: + # n_kws <= 15 case. + # Here the IR looks like a series of + # constants, then the arguments and finally + # a build_map that contains all of the pairs. + # For Example: + # + # $const_n = const("arg_name") + # $arg_n = ... + # $kwargs_var = build_map(items=[ + # ($const_0, $arg_0), + # ..., + # ($const_n, $arg_n),]) + kws = _call_function_ex_replace_kws_small( + blk.body, + keyword_def.value, + new_body, + varkwarg_loc, + func_ir, + already_deleted_defs, + ) + else: + # n_kws > 15 case. + # Here the IR is an initial empty build_map + # followed by a series of setitems with a constant + # key and then the argument. + # For example: + # + # $kwargs_var = build_map(items=[]) + # $const_0 = const("arg_name") + # $arg_0 = ... + # $my_attr = getattr(const_0, attr=__setitem__) + # $unused_var = call $my_attr($const_0, $arg_0) + # ... + kws = _call_function_ex_replace_kws_large( + blk.body, + varkwarg.name, + varkwarg_loc, + i - 1, + new_body, + func_ir, + errmsg, + already_deleted_defs, + ) + start_search = varkwarg_loc + # Vararg isn't required to be provided. + if vararg is not None: + if args: + # If we have vararg then args is expected to + # be an empty list. + raise UnsupportedBytecodeError(errmsg) + vararg_loc = start_search + args_def = None + found = False + while vararg_loc >= 0 and not found: + args_def = blk.body[vararg_loc] + if ( + isinstance(args_def, ir.Assign) + and args_def.target.name == vararg.name + ): + found = True + else: + vararg_loc -= 1 + if not found: + # If we couldn't find where the args are created + # then we can't handle this format. + raise UnsupportedBytecodeError(errmsg) + if ( + isinstance(args_def.value, ir.Expr) + and args_def.value.op == "build_tuple" + ): + # n_args <= 30 case. + # Here the IR is a simple build_tuple containing + # all of the args. + # For example: + # + # $arg_n = ... + # $varargs = build_tuple( + # items=[$arg_0, ..., $arg_n] + # ) + args = _call_function_ex_replace_args_small( + blk.body, + args_def.value, + new_body, + vararg_loc, + func_ir, + already_deleted_defs, + ) + elif ( + isinstance(args_def.value, ir.Expr) + and args_def.value.op == "list_to_tuple" + ): + # If there is a call with vararg we need to check + # if the list -> tuple conversion failed and if so + # throw an error. + raise UnsupportedBytecodeError(errmsg) + else: + # Here the IR is an initial empty build_tuple. + # Then for each arg, a new tuple with a single + # element is created and one by one these are + # added to a growing tuple. + # For example: + # + # $combo_tup_0 = build_tuple(items=[]) + # $arg0 = ... + # $arg0_tup = build_tuple(items=[$arg0]) + # $combo_tup_1 = $combo_tup_0 + $arg0_tup + # $arg1 = ... + # $arg1_tup = build_tuple(items=[$arg1]) + # $combo_tup_2 = $combo_tup_1 + $arg1_tup + # ... + # $combo_tup_n = $combo_tup_{n-1} + $argn_tup + # + # In addition, the IR contains a final + # assignment for the varargs that looks like: + # + # $varargs_var = $combo_tup_n + # + # Here args_def is expected to be a simple assignment. + args = _call_function_ex_replace_args_large( + blk.body, + args_def, + new_body, + vararg_loc, + func_ir, + errmsg, + already_deleted_defs, + ) + # Create a new call updating the args and kws + new_call = ir.Expr.call( + call.func, args, kws, call.loc, target=call.target + ) + # Drop the existing definition for this stmt. + _remove_assignment_definition( + blk.body, i, func_ir, already_deleted_defs + ) + # Update the statement + stmt = ir.Assign(new_call, stmt.target, stmt.loc) + # Update the definition + func_ir._definitions[stmt.target.name].append(new_call) + elif ( + isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == "call" + and stmt.value.vararg is not None + ): + # If there is a call with vararg we need to check + # if the list -> tuple conversion failed and if so + # throw an error. + call = stmt.value + vararg_name = call.vararg.name + if ( + vararg_name in func_ir._definitions + and len(func_ir._definitions[vararg_name]) == 1 + ): + # If this value is still a list to tuple raise the + # exception. + expr = func_ir._definitions[vararg_name][0] + if isinstance(expr, ir.Expr) and expr.op == "list_to_tuple": + raise UnsupportedBytecodeError(errmsg) + + new_body.append(stmt) + # Replace the block body if we changed the IR + if blk_changed: + blk.body.clear() + blk.body.extend([x for x in new_body if x is not None]) + return func_ir + + +def peep_hole_list_to_tuple(func_ir): + """ + This peephole rewrites a bytecode sequence new to Python 3.9 that looks + like e.g.: + + def foo(a): + return (*a,) + + 41 0 BUILD_LIST 0 + 2 LOAD_FAST 0 (a) + 4 LIST_EXTEND 1 + 6 LIST_TO_TUPLE + 8 RETURN_VAL + + essentially, the unpacking of tuples is written as a list which is appended + to/extended and then "magicked" into a tuple by the new LIST_TO_TUPLE + opcode. + + This peephole repeatedly analyses the bytecode in a block looking for a + window between a `LIST_TO_TUPLE` and `BUILD_LIST` and... + + 1. Turns the BUILD_LIST into a BUILD_TUPLE + 2. Sets an accumulator's initial value as the target of the BUILD_TUPLE + 3. Searches for 'extend' on the original list and turns these into binary + additions on the accumulator. + 4. Searches for 'append' on the original list and turns these into a + `BUILD_TUPLE` which is then appended via binary addition to the + accumulator. + 5. Assigns the accumulator to the variable that exits the peephole and the + rest of the block/code refers to as the result of the unpack operation. + 6. Patches up + """ + _DEBUG = False + + # For all blocks + for offset, blk in func_ir.blocks.items(): + # keep doing the peephole rewrite until nothing is left that matches + while True: + # first try and find a matching region + # i.e. BUILD_LIST......LIST_TO_TUPLE + def find_postive_region(): + found = False + for idx in reversed(range(len(blk.body))): + stmt = blk.body[idx] + if isinstance(stmt, ir.Assign): + value = stmt.value + if (isinstance(value, ir.Expr) and + value.op == 'list_to_tuple'): + target_list = value.info[0] + found = True + bt = (idx, stmt) + if found: + if isinstance(stmt, ir.Assign): + if stmt.target.name == target_list: + region = (bt, (idx, stmt)) + return region + + region = find_postive_region() + # if there's a peep hole region then do something with it + if region is not None: + peep_hole = blk.body[region[1][0] : region[0][0]] + if _DEBUG: + print("\nWINDOW:") + for x in peep_hole: + print(x) + print("") + + appends = [] + extends = [] + init = region[1][1] + const_list = init.target.name + # Walk through the peep_hole and find things that are being + # "extend"ed and "append"ed to the BUILD_LIST + for x in peep_hole: + if isinstance(x, ir.Assign): + if isinstance(x.value, ir.Expr): + expr = x.value + if (expr.op == 'getattr' and + expr.value.name == const_list): + # it's not strictly necessary to split out + # extends and appends, but it helps with + # debugging to do so! + if expr.attr == 'extend': + extends.append(x.target.name) + elif expr.attr == 'append': + appends.append(x.target.name) + else: + assert 0 + # go back through the peep hole build new IR based on it. + new_hole = [] + + def append_and_fix(x): + """ Adds to the new_hole and fixes up definitions""" + new_hole.append(x) + if x.target.name in func_ir._definitions: + # if there's already a definition, drop it, should only + # be 1 as the way cpython emits the sequence for + # `list_to_tuple` should ensure this. + assert len(func_ir._definitions[x.target.name]) == 1 + func_ir._definitions[x.target.name].clear() + func_ir._definitions[x.target.name].append(x.value) + + the_build_list = init.target + + # Do the transform on the peep hole + if _DEBUG: + print("\nBLOCK:") + blk.dump() + + # This section basically accumulates list appends and extends + # as binop(+) on tuples, it drops all the getattr() for extend + # and append as they are now dead and replaced with binop(+). + # It also switches out the build_list for a build_tuple and then + # ensures everything is wired up and defined ok. + t2l_agn = region[0][1] + acc = the_build_list + for x in peep_hole: + if isinstance(x, ir.Assign): + if isinstance(x.value, ir.Expr): + expr = x.value + if expr.op == 'getattr': + if (x.target.name in extends or + x.target.name in appends): + # drop definition, it's being wholesale + # replaced. + func_ir._definitions.pop(x.target.name) + continue + else: + # a getattr on something we're not + # interested in + new_hole.append(x) + elif expr.op == 'call': + fname = expr.func.name + if fname in extends or fname in appends: + arg = expr.args[0] + if isinstance(arg, ir.Var): + tmp_name = "%s_var_%s" % (fname, + arg.name) + if fname in appends: + bt = ir.Expr.build_tuple([arg,], + expr.loc) + else: + # Extend as tuple + gv_tuple = ir.Global( + name="tuple", value=tuple, + loc=expr.loc, + ) + tuple_var = arg.scope.redefine( + "$_list_extend_gv_tuple", + loc=expr.loc, + ) + new_hole.append( + ir.Assign( + target=tuple_var, + value=gv_tuple, + loc=expr.loc, + ), + ) + bt = ir.Expr.call( + tuple_var, (arg,), (), + loc=expr.loc, + ) + var = ir.Var(arg.scope, tmp_name, + expr.loc) + asgn = ir.Assign(bt, var, expr.loc) + append_and_fix(asgn) + arg = var + + # this needs to be a binary add + new = ir.Expr.binop(fn=operator.add, + lhs=acc, + rhs=arg, + loc=x.loc) + asgn = ir.Assign(new, x.target, expr.loc) + append_and_fix(asgn) + acc = asgn.target + else: + # there could be a call in the unpack, like + # *(a, x.append(y)) + new_hole.append(x) + elif (expr.op == 'build_list' and + x.target.name == const_list): + new = ir.Expr.build_tuple(expr.items, expr.loc) + asgn = ir.Assign(new, x.target, expr.loc) + # Not a temporary any more + append_and_fix(asgn) + else: + new_hole.append(x) + else: + new_hole.append(x) + + else: + # stick everything else in as-is + new_hole.append(x) + # Finally write the result back into the original build list as + # everything refers to it. + append_and_fix(ir.Assign(acc, t2l_agn.target, + the_build_list.loc)) + if _DEBUG: + print("\nNEW HOLE:") + for x in new_hole: + print(x) + + # and then update the block body with the modified region + cpy = blk.body[:] + head = cpy[:region[1][0]] + tail = blk.body[region[0][0] + 1:] + tmp = head + new_hole + tail + blk.body.clear() + blk.body.extend(tmp) + + if _DEBUG: + print("\nDUMP post hole:") + blk.dump() + + else: + # else escape + break + + return func_ir + + +def peep_hole_delete_with_exit(func_ir): + """ + This rewrite removes variables used to store the `__exit__` function + loaded by SETUP_WITH. + """ + dead_vars = set() + + for blk in func_ir.blocks.values(): + for stmt in blk.body: + # Any statement that uses a variable with the '$setup_with_exitfn' + # prefix is considered dead. + used = set(stmt.list_vars()) + for v in used: + if v.name.startswith('$setup_with_exitfn'): + dead_vars.add(v) + # Any assignment that uses any of the dead variable is considered + # dead. + if used & dead_vars: + if isinstance(stmt, ir.Assign): + dead_vars.add(stmt.target) + + new_body = [] + for stmt in blk.body: + # Skip any statements that uses anyone of the dead variable. + if not (set(stmt.list_vars()) & dead_vars): + new_body.append(stmt) + blk.body.clear() + blk.body.extend(new_body) + + return func_ir + + +def peep_hole_fuse_dict_add_updates(func_ir): + """ + This rewrite removes d1._update_from_bytecode(d2) + calls that are between two dictionaries, d1 and d2, + in the same basic block. This pattern can appear as a + result of Python 3.10 bytecode emission changes, which + prevent large constant literal dictionaries + (> 15 elements) from being constant. If both dictionaries + are constant dictionaries defined in the same block and + neither is used between the update call, then we replace d1 + with a new definition that combines the two dictionaries. At + the bytecode translation stage we convert DICT_UPDATE into + _update_from_bytecode, so we know that _update_from_bytecode + always comes from the bytecode change and not user code. + + Python 3.10 may also rewrite the individual dictionaries + as an empty build_map + many map_add. Here we again look + for an _update_from_bytecode, and if so we replace these + with a single constant dictionary. + + When running this algorithm we can always safely remove d2. + + This is the relevant section of the CPython 3.10 that causes + this bytecode change: + https://github.com/python/cpython/blob/3.10/Python/compile.c#L4048 + """ + + # This algorithm fuses build_map expressions into the largest + # possible build map before use. For example, if we have an + # IR that looks like this: + # + # $d1 = build_map([]) + # $key = const("a") + # $value = const(2) + # $setitem_func = getattr($d1, "__setitem__") + # $unused1 = call (setitem_func, ($key, $value)) + # $key2 = const("b") + # $value2 = const(3) + # $d2 = build_map([($key2, $value2)]) + # $update_func = getattr($d1, "_update_from_bytecode") + # $unused2 = call ($update_func, ($d2,)) + # $othervar = None + # $retvar = cast($othervar) + # return $retvar + # + # Then the IR is rewritten such that any __setitem__ and + # _update_from_bytecode operations are fused into the original buildmap. + # The new buildmap is then added to the + # last location where it had previously had encountered a __setitem__, + # _update_from_bytecode, or build_map before any other uses. + # The new IR would look like: + # + # $key = const("a") + # $value = const(2) + # $key2 = const("b") + # $value2 = const(3) + # $d1 = build_map([($key, $value), ($key2, $value2)]) + # $othervar = None + # $retvar = cast($othervar) + # return $retvar + # + # Note that we don't push $d1 to the bottom of the block. This is because + # some values may be found below this block (e.g pop_block) that are pattern + # matched in other locations, such as objmode handling. It should be safe to + # move a map to the last location at which there was _update_from_bytecode. + + errmsg = textwrap.dedent(""" + A DICT_UPDATE op-code was encountered that could not be replaced. + If you have created a large constant dictionary, this may + be an an indication that you are using inlined control + flow. You can resolve this issue by moving the control flow out of + the dicitonary constructor. For example, if you have + + d = {a: 1 if flag else 0, ...) + + Replace that with: + + a_val = 1 if flag else 0 + d = {a: a_val, ...)""") + + already_deleted_defs = collections.defaultdict(set) + for blk in func_ir.blocks.values(): + new_body = [] + # literal map var name -> block idx of the original build_map + lit_map_def_idx = {} + # literal map var name -> list(map_uses) + # This is the index of every build_map or __setitem__ + # in the IR that will need to be removed if the map + # is updated. + lit_map_use_idx = collections.defaultdict(list) + # literal map var name -> list of key/value items for build map + map_updates = {} + blk_changed = False + + for i, stmt in enumerate(blk.body): + # What instruction should we append + new_inst = stmt + # Name that should be skipped when tracking used + # vars in statement. This is always the lhs with + # a build_map. + stmt_build_map_out = None + if isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Expr): + if stmt.value.op == "build_map": + # Skip the output build_map when looking for used vars. + stmt_build_map_out = stmt.target.name + # If we encounter a build map add it to the + # tracked maps. + lit_map_def_idx[stmt.target.name] = i + lit_map_use_idx[stmt.target.name].append(i) + map_updates[stmt.target.name] = stmt.value.items.copy() + elif stmt.value.op == "call" and i > 0: + # If we encounter a call we may need to replace + # the body + func_name = stmt.value.func.name + # If we have an update or a setitem + # it will be the previous expression. + getattr_stmt = blk.body[i - 1] + args = stmt.value.args + if ( + isinstance(getattr_stmt, ir.Assign) + and getattr_stmt.target.name == func_name + and isinstance(getattr_stmt.value, ir.Expr) + and getattr_stmt.value.op == "getattr" + and getattr_stmt.value.attr in ( + "__setitem__", "_update_from_bytecode" + ) + ): + update_map_name = getattr_stmt.value.value.name + attr = getattr_stmt.value.attr + if (attr == "__setitem__" + and update_map_name in lit_map_use_idx): + # If we have a setitem, update the lists + map_updates[update_map_name].append(args) + # Update the list of instructions that would + # need to be removed to include the setitem + # and the the getattr + lit_map_use_idx[update_map_name].extend([i - 1, i]) + elif attr == "_update_from_bytecode": + d2_map_name = args[0].name + if (update_map_name in lit_map_use_idx + and d2_map_name in lit_map_use_idx): + # If we have an update and the arg is also + # a literal dictionary, fuse the lists. + map_updates[update_map_name].extend( + map_updates[d2_map_name] + ) + # Delete the old IR for d1 and d2 + lit_map_use_idx[update_map_name].extend( + lit_map_use_idx[d2_map_name] + ) + lit_map_use_idx[update_map_name].append(i - 1) + for linenum in lit_map_use_idx[update_map_name]: + # Drop the existing definition. + _remove_assignment_definition( + blk.body, + linenum, + func_ir, + already_deleted_defs, + ) + # Delete it from the new block + new_body[linenum] = None + # Delete the maps from dicts + del lit_map_def_idx[d2_map_name] + del lit_map_use_idx[d2_map_name] + del map_updates[d2_map_name] + # Add d1 as the new instruction, removing the + # old definition. + _remove_assignment_definition( + blk.body, i, func_ir, already_deleted_defs + ) + new_inst = _build_new_build_map( + func_ir, + update_map_name, + blk.body, + lit_map_def_idx[update_map_name], + map_updates[update_map_name], + ) + # Update d1 in lit_map_use_idx to just the new + # definition and clear the previous list. + lit_map_use_idx[update_map_name].clear() + lit_map_use_idx[update_map_name].append(i) + # Mark that this block has been modified + blk_changed = True + else: + # If we cannot remove _update_from_bytecode + # Then raise an error for the user. + raise UnsupportedBytecodeError(errmsg) + + # Check if we need to drop any maps from being tracked. + # Skip the setitem/_update_from_bytecode getattr that + # will be removed when handling their call in the next + # iteration. + if not ( + isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == "getattr" + and stmt.value.value.name in lit_map_use_idx + and stmt.value.attr in ("__setitem__", "_update_from_bytecode") + ): + for var in stmt.list_vars(): + # If a map is used it cannot be fused later in + # the block. As a result we delete it from + # the dicitonaries + if ( + var.name in lit_map_use_idx + and var.name != stmt_build_map_out + ): + del lit_map_def_idx[var.name] + del lit_map_use_idx[var.name] + del map_updates[var.name] + + # Append the instruction to the new block + new_body.append(new_inst) + + if blk_changed: + # If the block is changed replace the block body. + blk.body.clear() + blk.body.extend([x for x in new_body if x is not None]) + + return func_ir + + +def peep_hole_split_at_pop_block(func_ir): + """ + Split blocks that contain ir.PopBlock. + + This rewrite restores the IR structure to pre 3.11 so that withlifting + can work correctly. + """ + new_block_map = {} + sorted_blocks = sorted(func_ir.blocks.items()) + for blk_idx, (label, blk) in enumerate(sorted_blocks): + # Gather locations of PopBlock + pop_block_locs = [] + for i, inst in enumerate(blk.body): + if isinstance(inst, ir.PopBlock): + pop_block_locs.append(i) + # Rewrite block with PopBlock + if pop_block_locs: + new_blocks = [] + for i in pop_block_locs: + before_blk = ir.Block(blk.scope, loc=blk.loc) + before_blk.body.extend(blk.body[:i]) + new_blocks.append(before_blk) + + popblk_blk = ir.Block(blk.scope, loc=blk.loc) + popblk_blk.body.append(blk.body[i]) + new_blocks.append(popblk_blk) + # Add jump instructions + prev_label = label + for newblk in new_blocks: + new_block_map[prev_label] = newblk + next_label = prev_label + 1 + newblk.body.append(ir.Jump(next_label, loc=blk.loc)) + prev_label = next_label + # Check prev_label does not exceed current new block label + if blk_idx + 1 < len(sorted_blocks): + if prev_label >= sorted_blocks[blk_idx + 1][0]: + # Panic! Due to heuristic in with-lifting, block labels + # must be monotonically increasing. We cannot continue if we + # run out of usable label between the two blocks. + raise errors.InternalError("POP_BLOCK peephole failed") + # Add tail block, which will get the original terminator + tail_blk = ir.Block(blk.scope, loc=blk.loc) + tail_blk.body.extend(blk.body[pop_block_locs[-1] + 1:]) + new_block_map[prev_label] = tail_blk + + func_ir.blocks.update(new_block_map) + return func_ir + + +def _build_new_build_map(func_ir, name, old_body, old_lineno, new_items): + """ + Create a new build_map with a new set of key/value items + but all the other info the same. + """ + old_assign = old_body[old_lineno] + old_target = old_assign.target + old_bm = old_assign.value + # Build the literals + literal_keys = [] + # Track the constant key/values to set the literal_value + # field of build_map properly + values = [] + for pair in new_items: + k, v = pair + key_def = guard(get_definition, func_ir, k) + if isinstance(key_def, (ir.Const, ir.Global, ir.FreeVar)): + literal_keys.append(key_def.value) + value_def = guard(get_definition, func_ir, v) + if isinstance(value_def, (ir.Const, ir.Global, ir.FreeVar)): + values.append(value_def.value) + else: + # Append unknown value if not a literal. + values.append(_UNKNOWN_VALUE(v.name)) + + value_indexes = {} + if len(literal_keys) == len(new_items): + # All keys must be literals to have any literal values. + literal_value = {x: y for x, y in zip(literal_keys, values)} + for i, k in enumerate(literal_keys): + value_indexes[k] = i + else: + literal_value = None + + # Construct a new build map. + new_bm = ir.Expr.build_map( + items=new_items, + size=len(new_items), + literal_value=literal_value, + value_indexes=value_indexes, + loc=old_bm.loc, + ) + + # The previous definition has already been removed + # when updating the IR in peep_hole_fuse_dict_add_updates + func_ir._definitions[name].append(new_bm) + + # Return a new assign. + return ir.Assign( + new_bm, ir.Var(old_target.scope, name, old_target.loc), new_bm.loc + ) + + +class Interpreter(object): + """A bytecode interpreter that builds up the IR. + """ + + _DEBUG_PRINT = False + + def __init__(self, func_id): + self.func_id = func_id + if self._DEBUG_PRINT: + print(func_id.func) + self.arg_count = func_id.arg_count + self.arg_names = func_id.arg_names + self.loc = self.first_loc = ir.Loc.from_function_id(func_id) + self.is_generator = func_id.is_generator + + # { inst offset : ir.Block } + self.blocks = {} + # { name: [definitions] } of local variables + self.definitions = collections.defaultdict(list) + # A set to keep track of all exception variables. + # To be used in _legalize_exception_vars() + self._exception_vars = set() + + def interpret(self, bytecode): + """ + Generate IR for this bytecode. + """ + self.bytecode = bytecode + + self.scopes = [] + global_scope = ir.Scope(parent=None, loc=self.loc) + self.scopes.append(global_scope) + + flow = Flow(bytecode) + flow.run() + self.dfa = AdaptDFA(flow) + self.cfa = AdaptCFA(flow) + if config.DUMP_CFG: + self.cfa.dump() + + # Temp states during interpretation + self.current_block = None + self.current_block_offset = None + last_active_offset = 0 + for _, inst_blocks in self.cfa.blocks.items(): + if inst_blocks.body: + last_active_offset = max(last_active_offset, + max(inst_blocks.body)) + self.last_active_offset = last_active_offset + + if PYVERSION in ((3, 12), (3, 13)): + self.active_exception_entries = tuple( + [entry for entry in self.bytecode.exception_entries + if entry.start < self.last_active_offset]) + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + self.syntax_blocks = [] + self.dfainfo = None + + self.scopes.append(ir.Scope(parent=self.current_scope, loc=self.loc)) + + # Interpret loop + for inst, kws in self._iter_inst(): + self._dispatch(inst, kws) + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + # Insert end of try markers + self._end_try_blocks() + elif PYVERSION in ((3, 10),): + pass + else: + raise NotImplementedError(PYVERSION) + self._legalize_exception_vars() + # Prepare FunctionIR + func_ir = ir.FunctionIR(self.blocks, self.is_generator, self.func_id, + self.first_loc, self.definitions, + self.arg_count, self.arg_names) + _logger.debug(func_ir.dump_to_string()) + + # post process the IR to rewrite opcodes/byte sequences that are too + # involved to risk handling as part of direct interpretation + peepholes = [] + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + peepholes.append(peep_hole_split_at_pop_block) + if PYVERSION in ((3, 10), (3, 11), (3, 12), (3, 13)): + peepholes.append(peep_hole_list_to_tuple) + peepholes.append(peep_hole_delete_with_exit) + if PYVERSION in ((3, 10), (3, 11), (3, 12), (3, 13)): + # peep_hole_call_function_ex_to_call_function_kw + # depends on peep_hole_list_to_tuple converting + # any large number of arguments from a list to a + # tuple. + peepholes.append(peep_hole_call_function_ex_to_call_function_kw) + peepholes.append(peep_hole_fuse_dict_add_updates) + + post_processed_ir = self.post_process(peepholes, func_ir) + + return post_processed_ir + + def post_process(self, peepholes, func_ir): + for peep in peepholes: + func_ir = peep(func_ir) + return func_ir + + def _end_try_blocks(self): + """Closes all try blocks by inserting the required marker at the + exception handler + + This is only needed for py3.11 because of the changes in exception + handling. This merely maps the new py3.11 semantics back to the old way. + + What the code does: + + - For each block, compute the difference of blockstack to its incoming + blocks' blockstack. + - If the incoming blockstack has an extra TRY, the current block must + be the EXCEPT block and we need to insert a marker. + + See also: _insert_try_block_end + """ + assert PYVERSION in ((3, 11), (3, 12), (3, 13)) + graph = self.cfa.graph + for offset, block in self.blocks.items(): + # Get current blockstack + cur_bs = self.dfa.infos[offset].blockstack + # Check blockstack of the incoming blocks + for inc, _ in graph.predecessors(offset): + inc_bs = self.dfa.infos[inc].blockstack + + # find first diff in the blockstack + for i, (x, y) in enumerate(zip(cur_bs, inc_bs)): + if x != y: + break + else: + i = min(len(cur_bs), len(inc_bs)) + + def do_change(remain): + while remain: + ent = remain.pop() + if ent['kind'] == BlockKind('TRY'): + # Extend block with marker for end of try + self.current_block = block + oldbody = list(block.body) + block.body.clear() + self._insert_try_block_end() + block.body.extend(oldbody) + return True + + if do_change(list(inc_bs[i:])): + break + + def _legalize_exception_vars(self): + """Search for unsupported use of exception variables. + Note, they cannot be stored into user variable. + """ + # Build a set of exception variables + excvars = self._exception_vars.copy() + # Propagate the exception variables to LHS of assignment + for varname, defnvars in self.definitions.items(): + for v in defnvars: + if isinstance(v, ir.Var): + k = v.name + if k in excvars: + excvars.add(varname) + # Filter out the user variables. + uservar = list(filter(lambda x: not x.startswith('$'), excvars)) + if uservar: + # Complain about the first user-variable storing an exception + first = uservar[0] + loc = self.current_scope.get(first).loc + msg = "Exception object cannot be stored into variable ({})." + raise errors.UnsupportedBytecodeError(msg.format(first), loc=loc) + + def init_first_block(self): + # Define variables receiving the function arguments + for index, name in enumerate(self.arg_names): + val = ir.Arg(index=index, name=name, loc=self.loc) + self.store(val, name) + + def _iter_inst(self): + for blkct, block in enumerate(self.cfa.iterliveblocks()): + firstinst = self.bytecode[block.offset] + # If its an END_FOR instruction, the start location of block + # is set to start of the FOR loop, so take the location of + # next instruction. This only affects the source location + # marking and has no impact to semantic. + if firstinst.opname == 'END_FOR': + firstinst = self.bytecode[firstinst.next] + self.loc = self.loc.with_lineno(firstinst.lineno) + self._start_new_block(block.offset) + if blkct == 0: + # Is first block + self.init_first_block() + for offset, kws in self.dfainfo.insts: + inst = self.bytecode[offset] + self.loc = self.loc.with_lineno(inst.lineno) + yield inst, kws + self._end_current_block() + + def _start_new_block(self, offset): + oldblock = self.current_block + self.insert_block(offset) + + tryblk = self.dfainfo.active_try_block if self.dfainfo else None + # Ensure the last block is terminated + if oldblock is not None and not oldblock.is_terminated: + # Handle ending try block. + # If there's an active try-block and the handler block is live. + if tryblk is not None and tryblk['end'] in self.cfa.graph.nodes(): + # We are in a try-block, insert a branch to except-block. + # This logic cannot be in self._end_current_block() + # because we don't know the non-raising next block-offset. + branch = ir.Branch( + cond=self.get('$exception_check'), + truebr=tryblk['end'], + falsebr=offset, + loc=self.loc, + ) + oldblock.append(branch) + # Handle normal case + else: + jmp = ir.Jump(offset, loc=self.loc) + oldblock.append(jmp) + + # Get DFA block info + self.dfainfo = self.dfa.infos[self.current_block_offset] + self.assigner = Assigner() + # Check out-of-scope syntactic-block + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + # This is recreating pre-3.11 code structure + while self.syntax_blocks: + if offset >= self.syntax_blocks[-1].exit: + synblk = self.syntax_blocks.pop() + if isinstance(synblk, ir.With): + self.current_block.append(ir.PopBlock(self.loc)) + else: + break + # inject try block: + newtryblk = self.dfainfo.active_try_block + if newtryblk is not None: + if newtryblk is not tryblk: + self._insert_try_block_begin() + elif PYVERSION in ((3, 10),): + while self.syntax_blocks: + if offset >= self.syntax_blocks[-1].exit: + self.syntax_blocks.pop() + else: + break + else: + raise NotImplementedError(PYVERSION) + + def _end_current_block(self): + # Handle try block + if not self.current_block.is_terminated: + tryblk = self.dfainfo.active_try_block + if tryblk is not None: + self._insert_exception_check() + # Handle normal block cleanup + self._remove_unused_temporaries() + self._insert_outgoing_phis() + + def _inject_call(self, func, gv_name, res_name=None): + """A helper function to inject a call to *func* which is a python + function. + Parameters + ---------- + func : callable + The function object to be called. + gv_name : str + The variable name to be used to store the function object. + res_name : str; optional + The variable name to be used to store the call result. + If ``None``, a name is created automatically. + """ + gv_fn = ir.Global(gv_name, func, loc=self.loc) + self.store(value=gv_fn, name=gv_name, redefine=True) + callres = ir.Expr.call(self.get(gv_name), (), (), loc=self.loc) + res_name = res_name or '$callres_{}'.format(gv_name) + self.store(value=callres, name=res_name, redefine=True) + + def _insert_try_block_begin(self): + """Insert IR-nodes to mark the start of a `try` block. + """ + self._inject_call(eh.mark_try_block, 'mark_try_block') + + def _insert_try_block_end(self): + """Insert IR-nodes to mark the end of a `try` block. + """ + self._inject_call(eh.end_try_block, 'end_try_block') + + def _insert_exception_variables(self): + """Insert IR-nodes to initialize the exception variables. + """ + tryblk = self.dfainfo.active_try_block + # Get exception variables + endblk = tryblk['end'] + edgepushed = self.dfainfo.outgoing_edgepushed.get(endblk) + # Note: the last value on the stack is the exception value + # Note: due to the current limitation, all exception variables are None + if edgepushed: + const_none = ir.Const(value=None, loc=self.loc) + # For each variable going to the handler block. + for var in edgepushed: + if var in self.definitions: + raise AssertionError( + "exception variable CANNOT be defined by other code", + ) + self.store(value=const_none, name=var) + self._exception_vars.add(var) + + def _insert_exception_check(self): + """Called before the end of a block to inject checks if raised. + """ + self._insert_exception_variables() + # Do exception check + self._inject_call(eh.exception_check, 'exception_check', + '$exception_check') + + def _remove_unused_temporaries(self): + """ + Remove assignments to unused temporary variables from the + current block. + """ + new_body = [] + replaced_var = {} + for inst in self.current_block.body: + # the same temporary is assigned to multiple variables in cases + # like a = b[i] = 1, so need to handle replaced temporaries in + # later setitem/setattr nodes + if (isinstance(inst, (ir.SetItem, ir.SetAttr)) + and inst.value.name in replaced_var): + inst.value = replaced_var[inst.value.name] + elif isinstance(inst, ir.Assign): + if (inst.target.is_temp + and inst.target.name in self.assigner.unused_dests): + continue + # the same temporary is assigned to multiple variables in cases + # like a = b = 1, so need to handle replaced temporaries in + # later assignments + if (isinstance(inst.value, ir.Var) + and inst.value.name in replaced_var): + inst.value = replaced_var[inst.value.name] + new_body.append(inst) + continue + # chained unpack cases may reuse temporary + # e.g. a = (b, c) = (x, y) + if (isinstance(inst.value, ir.Expr) + and inst.value.op == "exhaust_iter" + and inst.value.value.name in replaced_var): + inst.value.value = replaced_var[inst.value.value.name] + new_body.append(inst) + continue + # eliminate temporary variables that are assigned to user + # variables right after creation. E.g.: + # $1 = f(); a = $1 -> a = f() + # the temporary variable is not reused elsewhere since CPython + # bytecode is stack-based and this pattern corresponds to a pop + if (isinstance(inst.value, ir.Var) and inst.value.is_temp + and new_body and isinstance(new_body[-1], ir.Assign)): + prev_assign = new_body[-1] + # _var_used_in_binop check makes sure we don't create a new + # inplace binop operation which can fail + # (see TestFunctionType.test_in_iter_func_call) + if (prev_assign.target.name == inst.value.name + and not self._var_used_in_binop( + inst.target.name, prev_assign.value)): + replaced_var[inst.value.name] = inst.target + prev_assign.target = inst.target + # replace temp var definition in target with proper defs + self.definitions[inst.target.name].remove(inst.value) + self.definitions[inst.target.name].extend( + self.definitions.pop(inst.value.name) + ) + continue + + new_body.append(inst) + + self.current_block.body = new_body + + def _var_used_in_binop(self, varname, expr): + """return True if 'expr' is a binary expression and 'varname' is used + in it as an argument + """ + return (isinstance(expr, ir.Expr) + and expr.op in ("binop", "inplace_binop") + and (varname == expr.lhs.name or varname == expr.rhs.name)) + + def _insert_outgoing_phis(self): + """ + Add assignments to forward requested outgoing values + to subsequent blocks. + """ + for phiname, varname in self.dfainfo.outgoing_phis.items(): + target = self.current_scope.get_or_define(phiname, + loc=self.loc) + try: + val = self.get(varname) + except ir.NotDefinedError: + # Hack to make sure exception variables are defined + assert PYVERSION in ((3, 11), (3, 12), (3, 13)), \ + "unexpected missing definition" + val = ir.Const(value=None, loc=self.loc) + stmt = ir.Assign(value=val, target=target, + loc=self.loc) + self.definitions[target.name].append(stmt.value) + if not self.current_block.is_terminated: + self.current_block.append(stmt) + else: + self.current_block.insert_before_terminator(stmt) + + def get_global_value(self, name): + """ + Get a global value from the func_global (first) or + as a builtins (second). If both failed, return a ir.UNDEFINED. + """ + try: + return self.func_id.func.__globals__[name] + except KeyError: + return getattr(builtins, name, ir.UNDEFINED) + + def get_closure_value(self, index): + """ + Get a value from the cell contained in this function's closure. + If not set, return a ir.UNDEFINED. + """ + cell = self.func_id.func.__closure__[index] + try: + return cell.cell_contents + except ValueError: + return ir.UNDEFINED + + @property + def current_scope(self): + return self.scopes[-1] + + @property + def code_consts(self): + return self.bytecode.co_consts + + @property + def code_locals(self): + return self.bytecode.co_varnames + + @property + def code_names(self): + return self.bytecode.co_names + + @property + def code_cellvars(self): + return self.bytecode.co_cellvars + + @property + def code_freevars(self): + return self.bytecode.co_freevars + + def _dispatch(self, inst, kws): + if self._DEBUG_PRINT: + print(inst) + assert self.current_block is not None + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + if self.syntax_blocks: + top = self.syntax_blocks[-1] + if isinstance(top, ir.With) : + if inst.offset >= top.exit: + self.current_block.append(ir.PopBlock(loc=self.loc)) + self.syntax_blocks.pop() + elif PYVERSION in ((3, 10),): + pass + else: + raise NotImplementedError(PYVERSION) + + fname = "op_%s" % inst.opname.replace('+', '_') + try: + fn = getattr(self, fname) + except AttributeError: + raise NotImplementedError(inst) + else: + try: + return fn(inst, **kws) + except errors.NotDefinedError as e: + if e.loc is None: + loc = self.loc + else: + loc = e.loc + + err = errors.NotDefinedError(e.name, loc=loc) + if not config.FULL_TRACEBACKS: + raise err from None + else: + m = f"handling op: {inst} | offset: {inst.offset}" + err.add_context(m) + err.add_context(self.bytecode.dump()) + raise err + + # --- Scope operations --- + + def store(self, value, name, redefine=False): + """ + Store *value* (a Expr or Var instance) into the variable named *name* + (a str object). Returns the target variable. + """ + if redefine or self.current_block_offset in self.cfa.backbone: + rename = not (name in self.code_cellvars) + target = self.current_scope.redefine(name, loc=self.loc, + rename=rename) + else: + target = self.current_scope.get_or_define(name, loc=self.loc) + if isinstance(value, ir.Var): + value = self.assigner.assign(value, target) + stmt = ir.Assign(value=value, target=target, loc=self.loc) + self.current_block.append(stmt) + self.definitions[target.name].append(value) + return target + + def get(self, name): + """ + Get the variable (a Var instance) with the given *name*. + """ + # Implicit argument for comprehension starts with '.' + # See Parameter class in inspect.py (from Python source) + if name[0] == '.' and name[1:].isdigit(): + name = 'implicit{}'.format(name[1:]) + + # Try to simplify the variable lookup by returning an earlier + # variable assigned to *name*. + var = self.assigner.get_assignment_source(name) + if var is None: + var = self.current_scope.get(name) + return var + + # --- Block operations --- + + def insert_block(self, offset, scope=None, loc=None): + scope = scope or self.current_scope + loc = loc or self.loc + blk = ir.Block(scope=scope, loc=loc) + self.blocks[offset] = blk + self.current_block = blk + self.current_block_offset = offset + return blk + + # --- Bytecode handlers --- + + def op_NOP(self, inst): + pass + + def op_RESUME(self, inst): + pass + + def op_CACHE(self, inst): + pass + + def op_PRECALL(self, inst): + pass + + def op_PUSH_NULL(self, inst): + pass + + def op_RETURN_GENERATOR(self, inst): + pass + + def op_PRINT_ITEM(self, inst, item, printvar, res): + item = self.get(item) + printgv = ir.Global("print", print, loc=self.loc) + self.store(value=printgv, name=printvar) + call = ir.Expr.call(self.get(printvar), (item,), (), loc=self.loc) + self.store(value=call, name=res) + + def op_PRINT_NEWLINE(self, inst, printvar, res): + printgv = ir.Global("print", print, loc=self.loc) + self.store(value=printgv, name=printvar) + call = ir.Expr.call(self.get(printvar), (), (), loc=self.loc) + self.store(value=call, name=res) + + def op_UNPACK_SEQUENCE(self, inst, iterable, stores, tupleobj): + count = len(stores) + # Exhaust the iterable into a tuple-like object + tup = ir.Expr.exhaust_iter(value=self.get(iterable), loc=self.loc, + count=count) + self.store(name=tupleobj, value=tup) + + # then index the tuple-like object to extract the values + for i, st in enumerate(stores): + expr = ir.Expr.static_getitem(self.get(tupleobj), + index=i, index_var=None, + loc=self.loc) + self.store(expr, st) + + def op_FORMAT_SIMPLE(self, inst, value, res, strvar): + # Same as FORMAT_VALUE + return self.op_FORMAT_VALUE(inst, value, res, strvar) + + def op_FORMAT_VALUE(self, inst, value, res, strvar): + """ + FORMAT_VALUE(flags): flags argument specifies format spec which is not + supported yet. Currently, str() is simply called on the value. + https://docs.python.org/3/library/dis.html#opcode-FORMAT_VALUE + """ + value = self.get(value) + strgv = ir.Global("str", str, loc=self.loc) + self.store(value=strgv, name=strvar) + call = ir.Expr.call(self.get(strvar), (value,), (), loc=self.loc) + self.store(value=call, name=res) + + def op_BUILD_STRING(self, inst, strings, tmps): + """ + BUILD_STRING(count): Concatenates count strings. + Required for supporting f-strings. + https://docs.python.org/3/library/dis.html#opcode-BUILD_STRING + """ + count = inst.arg + # corner case: f"" + if count == 0: + const = ir.Const("", loc=self.loc) + self.store(const, tmps[-1]) + return + + prev = self.get(strings[0]) + for other, tmp in zip(strings[1:], tmps): + other = self.get(other) + expr = ir.Expr.binop( + operator.add, lhs=prev, rhs=other, loc=self.loc + ) + self.store(expr, tmp) + prev = self.get(tmp) + + def op_BUILD_SLICE(self, inst, start, stop, step, res, slicevar): + start = self.get(start) + stop = self.get(stop) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + if step is None: + sliceinst = ir.Expr.call(self.get(slicevar), (start, stop), (), + loc=self.loc) + else: + step = self.get(step) + sliceinst = ir.Expr.call(self.get(slicevar), (start, stop, step), + (), loc=self.loc) + self.store(value=sliceinst, name=res) + + if PYVERSION in ((3, 12), (3, 13)): + def op_BINARY_SLICE(self, inst, start, end, container, res, slicevar, + temp_res): + start = self.get(start) + end = self.get(end) + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + sliceinst = ir.Expr.call(self.get(slicevar), (start, end), (), + loc=self.loc) + self.store(value=sliceinst, name=temp_res) + index = self.get(temp_res) + target = self.get(container) + expr = ir.Expr.getitem(target, index=index, loc=self.loc) + self.store(expr, res) + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + if PYVERSION in ((3, 12), (3, 13)): + def op_STORE_SLICE(self, inst, start, end, container, value, res, + slicevar): + start = self.get(start) + end = self.get(end) + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + sliceinst = ir.Expr.call(self.get(slicevar), (start, end), (), + loc=self.loc) + self.store(value=sliceinst, name=res) + index = self.get(res) + target = self.get(container) + value = self.get(value) + + stmt = ir.SetItem(target=target, index=index, value=value, + loc=self.loc) + self.current_block.append(stmt) + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def op_SLICE_0(self, inst, base, res, slicevar, indexvar, nonevar): + base = self.get(base) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + nonegv = ir.Const(None, loc=self.loc) + self.store(value=nonegv, name=nonevar) + none = self.get(nonevar) + + index = ir.Expr.call(self.get(slicevar), (none, none), (), loc=self.loc) + self.store(value=index, name=indexvar) + + expr = ir.Expr.getitem(base, self.get(indexvar), loc=self.loc) + self.store(value=expr, name=res) + + def op_SLICE_1(self, inst, base, start, nonevar, res, slicevar, indexvar): + base = self.get(base) + start = self.get(start) + + nonegv = ir.Const(None, loc=self.loc) + self.store(value=nonegv, name=nonevar) + none = self.get(nonevar) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + index = ir.Expr.call(self.get(slicevar), (start, none), (), + loc=self.loc) + self.store(value=index, name=indexvar) + + expr = ir.Expr.getitem(base, self.get(indexvar), loc=self.loc) + self.store(value=expr, name=res) + + def op_SLICE_2(self, inst, base, nonevar, stop, res, slicevar, indexvar): + base = self.get(base) + stop = self.get(stop) + + nonegv = ir.Const(None, loc=self.loc) + self.store(value=nonegv, name=nonevar) + none = self.get(nonevar) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + index = ir.Expr.call(self.get(slicevar), (none, stop,), (), + loc=self.loc) + self.store(value=index, name=indexvar) + + expr = ir.Expr.getitem(base, self.get(indexvar), loc=self.loc) + self.store(value=expr, name=res) + + def op_SLICE_3(self, inst, base, start, stop, res, slicevar, indexvar): + base = self.get(base) + start = self.get(start) + stop = self.get(stop) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + index = ir.Expr.call(self.get(slicevar), (start, stop), (), + loc=self.loc) + self.store(value=index, name=indexvar) + + expr = ir.Expr.getitem(base, self.get(indexvar), loc=self.loc) + self.store(value=expr, name=res) + + def op_STORE_SLICE_0(self, inst, base, value, slicevar, indexvar, nonevar): + base = self.get(base) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + nonegv = ir.Const(None, loc=self.loc) + self.store(value=nonegv, name=nonevar) + none = self.get(nonevar) + + index = ir.Expr.call(self.get(slicevar), (none, none), (), loc=self.loc) + self.store(value=index, name=indexvar) + + stmt = ir.SetItem(base, self.get(indexvar), self.get(value), + loc=self.loc) + self.current_block.append(stmt) + + def op_STORE_SLICE_1(self, inst, base, start, nonevar, value, slicevar, + indexvar): + base = self.get(base) + start = self.get(start) + + nonegv = ir.Const(None, loc=self.loc) + self.store(value=nonegv, name=nonevar) + none = self.get(nonevar) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + index = ir.Expr.call(self.get(slicevar), (start, none), (), + loc=self.loc) + self.store(value=index, name=indexvar) + + stmt = ir.SetItem(base, self.get(indexvar), self.get(value), + loc=self.loc) + self.current_block.append(stmt) + + def op_STORE_SLICE_2(self, inst, base, nonevar, stop, value, slicevar, + indexvar): + base = self.get(base) + stop = self.get(stop) + + nonegv = ir.Const(None, loc=self.loc) + self.store(value=nonegv, name=nonevar) + none = self.get(nonevar) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + index = ir.Expr.call(self.get(slicevar), (none, stop,), (), + loc=self.loc) + self.store(value=index, name=indexvar) + + stmt = ir.SetItem(base, self.get(indexvar), self.get(value), + loc=self.loc) + self.current_block.append(stmt) + + def op_STORE_SLICE_3(self, inst, base, start, stop, value, slicevar, + indexvar): + base = self.get(base) + start = self.get(start) + stop = self.get(stop) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + index = ir.Expr.call(self.get(slicevar), (start, stop), (), + loc=self.loc) + self.store(value=index, name=indexvar) + stmt = ir.SetItem(base, self.get(indexvar), self.get(value), + loc=self.loc) + self.current_block.append(stmt) + + def op_DELETE_SLICE_0(self, inst, base, slicevar, indexvar, nonevar): + base = self.get(base) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + nonegv = ir.Const(None, loc=self.loc) + self.store(value=nonegv, name=nonevar) + none = self.get(nonevar) + + index = ir.Expr.call(self.get(slicevar), (none, none), (), loc=self.loc) + self.store(value=index, name=indexvar) + + stmt = ir.DelItem(base, self.get(indexvar), loc=self.loc) + self.current_block.append(stmt) + + def op_DELETE_SLICE_1(self, inst, base, start, nonevar, slicevar, indexvar): + base = self.get(base) + start = self.get(start) + + nonegv = ir.Const(None, loc=self.loc) + self.store(value=nonegv, name=nonevar) + none = self.get(nonevar) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + index = ir.Expr.call(self.get(slicevar), (start, none), (), + loc=self.loc) + self.store(value=index, name=indexvar) + + stmt = ir.DelItem(base, self.get(indexvar), loc=self.loc) + self.current_block.append(stmt) + + def op_DELETE_SLICE_2(self, inst, base, nonevar, stop, slicevar, indexvar): + base = self.get(base) + stop = self.get(stop) + + nonegv = ir.Const(None, loc=self.loc) + self.store(value=nonegv, name=nonevar) + none = self.get(nonevar) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + index = ir.Expr.call(self.get(slicevar), (none, stop,), (), + loc=self.loc) + self.store(value=index, name=indexvar) + + stmt = ir.DelItem(base, self.get(indexvar), loc=self.loc) + self.current_block.append(stmt) + + def op_DELETE_SLICE_3(self, inst, base, start, stop, slicevar, indexvar): + base = self.get(base) + start = self.get(start) + stop = self.get(stop) + + slicegv = ir.Global("slice", slice, loc=self.loc) + self.store(value=slicegv, name=slicevar) + + index = ir.Expr.call(self.get(slicevar), (start, stop), (), + loc=self.loc) + self.store(value=index, name=indexvar) + stmt = ir.DelItem(base, self.get(indexvar), loc=self.loc) + self.current_block.append(stmt) + + def _op_LOAD_FAST(self, inst, res): + srcname = self.code_locals[inst.arg] + self.store(value=self.get(srcname), name=res) + + if PYVERSION in ((3, 13), ): + def op_LOAD_FAST(self, inst, res, as_load_deref=False): + if as_load_deref: + self.op_LOAD_DEREF(inst, res) + else: + self._op_LOAD_FAST(inst, res) + + else: + op_LOAD_FAST = _op_LOAD_FAST + + if PYVERSION in ((3, 13),): + def op_LOAD_FAST_LOAD_FAST(self, inst, res1, res2): + oparg = inst.arg + oparg1 = oparg >> 4 + oparg2 = oparg & 15 + src1 = self.get(self.code_locals[oparg1]) + src2 = self.get(self.code_locals[oparg2]) + self.store(value=src1, name=res1) + self.store(value=src2, name=res2) + + def op_STORE_FAST_LOAD_FAST(self, inst, store_value, load_res): + oparg = inst.arg + oparg1 = oparg >> 4 + oparg2 = oparg & 15 + + dstname = self.code_locals[oparg1] + dst_value = self.get(store_value) + self.store(value=dst_value, name=dstname) + + src_value = self.get(self.code_locals[oparg2]) + self.store(value=src_value, name=load_res) + + def op_STORE_FAST_STORE_FAST(self, inst, value1, value2): + oparg = inst.arg + oparg1 = oparg >> 4 + oparg2 = oparg & 15 + + dstname = self.code_locals[oparg1] + self.store(value=self.get(value1), name=dstname) + dstname = self.code_locals[oparg2] + self.store(value=self.get(value2), name=dstname) + + elif PYVERSION in ((3, 10), (3, 11), (3, 12)): + pass + else: + raise NotImplementedError(PYVERSION) + + if PYVERSION in ((3, 12), (3, 13)): + op_LOAD_FAST_CHECK = op_LOAD_FAST + + def op_LOAD_FAST_AND_CLEAR(self, inst, res): + try: + # try the regular LOAD_FAST logic + srcname = self.code_locals[inst.arg] + self.store(value=self.get(srcname), name=res) + except NotDefinedError: + # If the variable is not in the scope, set it to `undef` + undef = ir.Expr.undef(loc=self.loc) + self.store(undef, name=res) + + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def op_STORE_FAST(self, inst, value): + dstname = self.code_locals[inst.arg] + value = self.get(value) + self.store(value=value, name=dstname) + + def op_DELETE_FAST(self, inst): + dstname = self.code_locals[inst.arg] + self.current_block.append(ir.Del(dstname, loc=self.loc)) + + def op_DUP_TOPX(self, inst, orig, duped): + for src, dst in zip(orig, duped): + self.store(value=self.get(src), name=dst) + + op_DUP_TOP = op_DUP_TOPX + op_DUP_TOP_TWO = op_DUP_TOPX + + def op_STORE_ATTR(self, inst, target, value): + attr = self.code_names[inst.arg] + sa = ir.SetAttr(target=self.get(target), value=self.get(value), + attr=attr, loc=self.loc) + self.current_block.append(sa) + + def op_DELETE_ATTR(self, inst, target): + attr = self.code_names[inst.arg] + sa = ir.DelAttr(target=self.get(target), attr=attr, loc=self.loc) + self.current_block.append(sa) + + def op_LOAD_ATTR(self, inst, item, res): + item = self.get(item) + if PYVERSION in ((3, 12), (3, 13)): + attr = self.code_names[inst.arg >> 1] + elif PYVERSION in ((3, 10), (3, 11)): + attr = self.code_names[inst.arg] + else: + raise NotImplementedError(PYVERSION) + getattr = ir.Expr.getattr(item, attr, loc=self.loc) + self.store(getattr, res) + + def op_LOAD_CONST(self, inst, res): + value = self.code_consts[inst.arg] + if isinstance(value, tuple): + st = [] + for x in value: + nm = '$const_%s' % str(x) + val_const = ir.Const(x, loc=self.loc) + target = self.store(val_const, name=nm, redefine=True) + st.append(target) + const = ir.Expr.build_tuple(st, loc=self.loc) + elif isinstance(value, frozenset): + st = [] + for x in value: + nm = '$const_%s' % str(x) + val_const = ir.Const(x, loc=self.loc) + target = self.store(val_const, name=nm, redefine=True) + st.append(target) + const = ir.Expr.build_set(st, loc=self.loc) + else: + const = ir.Const(value, loc=self.loc) + self.store(const, res) + + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + def op_LOAD_GLOBAL(self, inst, idx, res): + name = self.code_names[idx] + value = self.get_global_value(name) + gl = ir.Global(name, value, loc=self.loc) + self.store(gl, res) + elif PYVERSION in ((3, 10),): + def op_LOAD_GLOBAL(self, inst, res): + name = self.code_names[inst.arg] + value = self.get_global_value(name) + gl = ir.Global(name, value, loc=self.loc) + self.store(gl, res) + else: + raise NotImplementedError(PYVERSION) + + def op_COPY_FREE_VARS(self, inst): + pass + + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + def op_LOAD_DEREF(self, inst, res): + name = self.func_id.func.__code__._varname_from_oparg(inst.arg) + if name in self.code_cellvars: + try: + gl = self.get(name) + except NotDefinedError: + msg = "Unsupported use of cell variable encountered" + raise NotImplementedError(msg) + elif name in self.code_freevars: + idx = self.code_freevars.index(name) + value = self.get_closure_value(idx) + gl = ir.FreeVar(idx, name, value, loc=self.loc) + self.store(gl, res) + elif PYVERSION in ((3, 10),): + def op_LOAD_DEREF(self, inst, res): + n_cellvars = len(self.code_cellvars) + if inst.arg < n_cellvars: + name = self.code_cellvars[inst.arg] + gl = self.get(name) + else: + idx = inst.arg - n_cellvars + name = self.code_freevars[idx] + value = self.get_closure_value(idx) + gl = ir.FreeVar(idx, name, value, loc=self.loc) + self.store(gl, res) + else: + raise NotImplementedError(PYVERSION) + + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + def op_MAKE_CELL(self, inst): + pass # ignored bytecode + + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + def op_STORE_DEREF(self, inst, value): + name = self.func_id.func.__code__._varname_from_oparg(inst.arg) + value = self.get(value) + self.store(value=value, name=name) + elif PYVERSION in ((3, 10),): + def op_STORE_DEREF(self, inst, value): + n_cellvars = len(self.code_cellvars) + if inst.arg < n_cellvars: + dstname = self.code_cellvars[inst.arg] + else: + dstname = self.code_freevars[inst.arg - n_cellvars] + value = self.get(value) + self.store(value=value, name=dstname) + else: + raise NotImplementedError(PYVERSION) + + def op_SETUP_LOOP(self, inst): + assert self.blocks[inst.offset] is self.current_block + loop = ir.Loop(inst.offset, exit=(inst.next + inst.arg)) + self.syntax_blocks.append(loop) + + def op_SETUP_WITH(self, inst, contextmanager, exitfn=None): + assert self.blocks[inst.offset] is self.current_block + # Handle with + exitpt = inst.next + inst.arg + + wth = ir.With(inst.offset, exit=exitpt) + self.syntax_blocks.append(wth) + ctxmgr = self.get(contextmanager) + self.current_block.append(ir.EnterWith(contextmanager=ctxmgr, + begin=inst.offset, + end=exitpt, loc=self.loc,)) + + # Store exit fn + exit_fn_obj = ir.Const(None, loc=self.loc) + self.store(value=exit_fn_obj, name=exitfn) + + def op_BEFORE_WITH(self, inst, contextmanager, exitfn, end): + assert self.blocks[inst.offset] is self.current_block + if PYVERSION in ((3, 12), (3, 13)): + # Python 3.12 hack for handling nested with blocks + if end > self.last_active_offset: + # Use exception entries to figure out end of syntax block + end = max([ex.end for ex in self.active_exception_entries + if ex.target == end]) + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + # Handle with + wth = ir.With(inst.offset, exit=end) + self.syntax_blocks.append(wth) + ctxmgr = self.get(contextmanager) + self.current_block.append(ir.EnterWith(contextmanager=ctxmgr, + begin=inst.offset, + end=end, loc=self.loc,)) + + # Store exit function + exit_fn_obj = ir.Const(None, loc=self.loc) + self.store(value=exit_fn_obj, name=exitfn) + + def op_SETUP_FINALLY(self, inst): + # Removed since python3.11 + self._insert_try_block_begin() + + def op_WITH_CLEANUP(self, inst): + "no-op" + + def op_WITH_CLEANUP_START(self, inst): + "no-op" + + def op_WITH_CLEANUP_FINISH(self, inst): + "no-op" + + def op_END_FINALLY(self, inst): + "no-op" + + def op_BEGIN_FINALLY(self, inst, temps): + # The *temps* are the exception variables + const_none = ir.Const(None, loc=self.loc) + for tmp in temps: + # Set to None for now + self.store(const_none, name=tmp) + self._exception_vars.add(tmp) + + def op_CALL(self, inst, func, args, kw_names, res): + func = self.get(func) + args = [self.get(x) for x in args] + if kw_names is not None: + assert PYVERSION < (3, 13) + names = self.code_consts[kw_names] + kwargs = list(zip(names, args[-len(names):])) + args = args[:-len(names)] + else: + kwargs = () + expr = ir.Expr.call(func, args, kwargs, loc=self.loc) + self.store(expr, res) + + if PYVERSION in ((3, 13),): + def op_CALL_KW(self, inst, func, args, kw_names, res): + func = self.get(func) + args = [self.get(x) for x in args] + consti = int(kw_names.rsplit('.', 2)[-1]) + names = self.code_consts[consti] + kwargs = list(zip(names, args[-len(names):])) + args = args[:-len(names)] + expr = ir.Expr.call(func, args, kwargs, loc=self.loc) + self.store(expr, res) + else: + assert PYVERSION < (3, 13) + + def op_CALL_FUNCTION(self, inst, func, args, res): + func = self.get(func) + args = [self.get(x) for x in args] + expr = ir.Expr.call(func, args, (), loc=self.loc) + self.store(expr, res) + + def op_CALL_FUNCTION_KW(self, inst, func, args, names, res): + func = self.get(func) + args = [self.get(x) for x in args] + # Find names const + names = self.get(names) + for inst in self.current_block.body: + if isinstance(inst, ir.Assign) and inst.target is names: + self.current_block.remove(inst) + # scan up the block looking for the values, remove them + # and find their name strings + named_items = [] + for x in inst.value.items: + for y in self.current_block.body[::-1]: + if x == y.target: + self.current_block.remove(y) + named_items.append(y.value.value) + break + keys = named_items + break + + nkeys = len(keys) + posvals = args[:-nkeys] + kwvals = args[-nkeys:] + keyvalues = list(zip(keys, kwvals)) + + expr = ir.Expr.call(func, posvals, keyvalues, loc=self.loc) + self.store(expr, res) + + def op_CALL_FUNCTION_EX(self, inst, func, vararg, varkwarg, res): + func = self.get(func) + vararg = self.get(vararg) + if varkwarg is not None: + varkwarg = self.get(varkwarg) + expr = ir.Expr.call( + func, [], [], loc=self.loc, vararg=vararg, varkwarg=varkwarg + ) + self.store(expr, res) + + def _build_tuple_unpack(self, inst, tuples, temps, is_assign): + first = self.get(tuples[0]) + if is_assign: + # it's assign-like, defer handling to an intrinsic that will have + # type information. + # Can deal with tuples only, i.e. y = (*x,). where x = + gv_name = "unpack_single_tuple" + gv_fn = ir.Global(gv_name, unpack_single_tuple, loc=self.loc,) + self.store(value=gv_fn, name=gv_name, redefine=True) + exc = ir.Expr.call(self.get(gv_name), args=(first,), kws=(), + loc=self.loc,) + self.store(exc, temps[0]) + else: + loc = self.loc + for other, tmp in zip(map(self.get, tuples[1:]), temps): + # Emit as `first + tuple(other)` + gv_tuple = ir.Global( + name="tuple", value=tuple, + loc=loc, + ) + tuple_var = self.store( + gv_tuple, "$_list_extend_gv_tuple", redefine=True, + ) + tuplify_val = ir.Expr.call( + tuple_var, (other,), (), + loc=loc, + ) + tuplify_var = self.store(tuplify_val, "$_tuplify", + redefine=True) + out = ir.Expr.binop( + fn=operator.add, lhs=first, rhs=self.get(tuplify_var.name), + loc=self.loc, + ) + self.store(out, tmp) + first = self.get(tmp) + + def op_BUILD_TUPLE_UNPACK_WITH_CALL(self, inst, tuples, temps, is_assign): + # just unpack the input tuple, call inst will be handled afterwards + self._build_tuple_unpack(inst, tuples, temps, is_assign) + + def op_BUILD_TUPLE_UNPACK(self, inst, tuples, temps, is_assign): + self._build_tuple_unpack(inst, tuples, temps, is_assign) + + def op_LIST_TO_TUPLE(self, inst, const_list, res): + expr = ir.Expr.dummy('list_to_tuple', (const_list,), loc=self.loc) + self.store(expr, res) + + def op_BUILD_CONST_KEY_MAP(self, inst, keys, keytmps, values, res): + # Unpack the constant key-tuple and reused build_map which takes + # a sequence of (key, value) pair. + keyvar = self.get(keys) + # TODO: refactor this pattern. occurred several times. + for inst in self.current_block.body: + if isinstance(inst, ir.Assign) and inst.target is keyvar: + self.current_block.remove(inst) + # scan up the block looking for the values, remove them + # and find their name strings + named_items = [] + for x in inst.value.items: + for y in self.current_block.body[::-1]: + if x == y.target: + self.current_block.remove(y) + named_items.append(y.value.value) + break + keytup = named_items + break + assert len(keytup) == len(values) + keyconsts = [ir.Const(value=x, loc=self.loc) for x in keytup] + for kval, tmp in zip(keyconsts, keytmps): + self.store(kval, tmp) + items = list(zip(map(self.get, keytmps), map(self.get, values))) + + # sort out literal values + literal_items = [] + for v in values: + defns = self.definitions[v] + if len(defns) != 1: + break + defn = defns[0] + if not isinstance(defn, ir.Const): + break + literal_items.append(defn.value) + + def resolve_const(v): + defns = self.definitions[v] + if len(defns) != 1: + return _UNKNOWN_VALUE(self.get(v).name) + defn = defns[0] + if not isinstance(defn, ir.Const): + return _UNKNOWN_VALUE(self.get(v).name) + return defn.value + + if len(literal_items) != len(values): + literal_dict = {x: resolve_const(y) for x, y in + zip(keytup, values)} + else: + literal_dict = {x:y for x, y in zip(keytup, literal_items)} + + # to deal with things like {'a': 1, 'a': 'cat', 'b': 2, 'a': 2j} + # store the index of the actual used value for a given key, this is + # used when lowering to pull the right value out into the tuple repr + # of a mixed value type dictionary. + value_indexes = {} + for i, k in enumerate(keytup): + value_indexes[k] = i + + expr = ir.Expr.build_map(items=items, + size=2, + literal_value=literal_dict, + value_indexes=value_indexes, + loc=self.loc) + + self.store(expr, res) + + def op_GET_ITER(self, inst, value, res): + expr = ir.Expr.getiter(value=self.get(value), loc=self.loc) + self.store(expr, res) + + def op_FOR_ITER(self, inst, iterator, pair, indval, pred): + """ + Assign new block other this instruction. + """ + assert inst.offset in self.blocks, "FOR_ITER must be block head" + + # Emit code + val = self.get(iterator) + + pairval = ir.Expr.iternext(value=val, loc=self.loc) + self.store(pairval, pair) + + iternext = ir.Expr.pair_first(value=self.get(pair), loc=self.loc) + self.store(iternext, indval) + + isvalid = ir.Expr.pair_second(value=self.get(pair), loc=self.loc) + self.store(isvalid, pred) + + # Conditional jump + br = ir.Branch(cond=self.get(pred), truebr=inst.next, + falsebr=inst.get_jump_target(), + loc=self.loc) + self.current_block.append(br) + + def op_BINARY_SUBSCR(self, inst, target, index, res): + index = self.get(index) + target = self.get(target) + expr = ir.Expr.getitem(target, index=index, loc=self.loc) + self.store(expr, res) + + def op_STORE_SUBSCR(self, inst, target, index, value): + index = self.get(index) + target = self.get(target) + value = self.get(value) + stmt = ir.SetItem(target=target, index=index, value=value, + loc=self.loc) + self.current_block.append(stmt) + + def op_DELETE_SUBSCR(self, inst, target, index): + index = self.get(index) + target = self.get(target) + stmt = ir.DelItem(target=target, index=index, loc=self.loc) + self.current_block.append(stmt) + + def op_BUILD_TUPLE(self, inst, items, res): + expr = ir.Expr.build_tuple(items=[self.get(x) for x in items], + loc=self.loc) + self.store(expr, res) + + def op_BUILD_LIST(self, inst, items, res): + expr = ir.Expr.build_list(items=[self.get(x) for x in items], + loc=self.loc) + self.store(expr, res) + + def op_BUILD_SET(self, inst, items, res): + expr = ir.Expr.build_set(items=[self.get(x) for x in items], + loc=self.loc) + self.store(expr, res) + + def op_SET_UPDATE(self, inst, target, value, updatevar, res): + target = self.get(target) + value = self.get(value) + updateattr = ir.Expr.getattr(target, 'update', loc=self.loc) + self.store(value=updateattr, name=updatevar) + updateinst = ir.Expr.call(self.get(updatevar), (value,), (), + loc=self.loc) + self.store(value=updateinst, name=res) + + def op_DICT_UPDATE(self, inst, target, value, updatevar, res): + target = self.get(target) + value = self.get(value) + # We generate _update_from_bytecode instead of update so we can + # differentiate between user .update() calls and those from the + # bytecode. This is then used to recombine dictionaries in peephole + # optimizations. See the dicussion in this PR about why: + # https://github.com/numba/numba/pull/7964/files#r868229306 + updateattr = ir.Expr.getattr( + target, '_update_from_bytecode', loc=self.loc + ) + self.store(value=updateattr, name=updatevar) + updateinst = ir.Expr.call(self.get(updatevar), (value,), (), + loc=self.loc) + self.store(value=updateinst, name=res) + + def op_BUILD_MAP(self, inst, items, size, res): + got_items = [(self.get(k), self.get(v)) for k, v in items] + + # sort out literal values, this is a bit contrived but is to handle + # situations like `{1: 10, 1: 10}` where the size of the literal dict + # is smaller than the definition + def get_literals(target): + literal_items = [] + values = [self.get(v.name) for v in target] + for v in values: + defns = self.definitions[v.name] + if len(defns) != 1: + break + defn = defns[0] + if not isinstance(defn, ir.Const): + break + literal_items.append(defn.value) + return literal_items + + literal_keys = get_literals(x[0] for x in got_items) + literal_values = get_literals(x[1] for x in got_items) + + has_literal_keys = len(literal_keys) == len(got_items) + has_literal_values = len(literal_values) == len(got_items) + + value_indexes = {} + if not has_literal_keys and not has_literal_values: + literal_dict = None + elif has_literal_keys and not has_literal_values: + literal_dict = {x: _UNKNOWN_VALUE(y[1]) for x, y in + zip(literal_keys, got_items)} + for i, k in enumerate(literal_keys): + value_indexes[k] = i + else: + literal_dict = {x: y for x, y in zip(literal_keys, literal_values)} + for i, k in enumerate(literal_keys): + value_indexes[k] = i + + expr = ir.Expr.build_map(items=got_items, size=size, + literal_value=literal_dict, + value_indexes=value_indexes, + loc=self.loc) + self.store(expr, res) + + def op_STORE_MAP(self, inst, dct, key, value): + stmt = ir.StoreMap(dct=self.get(dct), key=self.get(key), + value=self.get(value), loc=self.loc) + self.current_block.append(stmt) + + def op_UNARY_NEGATIVE(self, inst, value, res): + value = self.get(value) + expr = ir.Expr.unary('-', value=value, loc=self.loc) + return self.store(expr, res) + + def op_UNARY_POSITIVE(self, inst, value, res): + value = self.get(value) + expr = ir.Expr.unary('+', value=value, loc=self.loc) + return self.store(expr, res) + + def op_UNARY_INVERT(self, inst, value, res): + value = self.get(value) + expr = ir.Expr.unary('~', value=value, loc=self.loc) + return self.store(expr, res) + + def op_UNARY_NOT(self, inst, value, res): + value = self.get(value) + expr = ir.Expr.unary('not', value=value, loc=self.loc) + return self.store(expr, res) + + def _binop(self, op, lhs, rhs, res): + op = BINOPS_TO_OPERATORS[op] + lhs = self.get(lhs) + rhs = self.get(rhs) + expr = ir.Expr.binop(op, lhs=lhs, rhs=rhs, loc=self.loc) + self.store(expr, res) + + def _inplace_binop(self, op, lhs, rhs, res): + immuop = BINOPS_TO_OPERATORS[op] + op = INPLACE_BINOPS_TO_OPERATORS[op + '='] + lhs = self.get(lhs) + rhs = self.get(rhs) + expr = ir.Expr.inplace_binop(op, immuop, lhs=lhs, rhs=rhs, + loc=self.loc) + self.store(expr, res) + + def op_BINARY_OP(self, inst, op, lhs, rhs, res): + if "=" in op: + self._inplace_binop(op[:-1], lhs, rhs, res) + else: + self._binop(op, lhs, rhs, res) + + def op_BINARY_ADD(self, inst, lhs, rhs, res): + self._binop('+', lhs, rhs, res) + + def op_BINARY_SUBTRACT(self, inst, lhs, rhs, res): + self._binop('-', lhs, rhs, res) + + def op_BINARY_MULTIPLY(self, inst, lhs, rhs, res): + self._binop('*', lhs, rhs, res) + + def op_BINARY_DIVIDE(self, inst, lhs, rhs, res): + self._binop('/?', lhs, rhs, res) + + def op_BINARY_TRUE_DIVIDE(self, inst, lhs, rhs, res): + self._binop('/', lhs, rhs, res) + + def op_BINARY_FLOOR_DIVIDE(self, inst, lhs, rhs, res): + self._binop('//', lhs, rhs, res) + + def op_BINARY_MODULO(self, inst, lhs, rhs, res): + self._binop('%', lhs, rhs, res) + + def op_BINARY_POWER(self, inst, lhs, rhs, res): + self._binop('**', lhs, rhs, res) + + def op_BINARY_MATRIX_MULTIPLY(self, inst, lhs, rhs, res): + self._binop('@', lhs, rhs, res) + + def op_BINARY_LSHIFT(self, inst, lhs, rhs, res): + self._binop('<<', lhs, rhs, res) + + def op_BINARY_RSHIFT(self, inst, lhs, rhs, res): + self._binop('>>', lhs, rhs, res) + + def op_BINARY_AND(self, inst, lhs, rhs, res): + self._binop('&', lhs, rhs, res) + + def op_BINARY_OR(self, inst, lhs, rhs, res): + self._binop('|', lhs, rhs, res) + + def op_BINARY_XOR(self, inst, lhs, rhs, res): + self._binop('^', lhs, rhs, res) + + def op_INPLACE_ADD(self, inst, lhs, rhs, res): + self._inplace_binop('+', lhs, rhs, res) + + def op_INPLACE_SUBTRACT(self, inst, lhs, rhs, res): + self._inplace_binop('-', lhs, rhs, res) + + def op_INPLACE_MULTIPLY(self, inst, lhs, rhs, res): + self._inplace_binop('*', lhs, rhs, res) + + def op_INPLACE_DIVIDE(self, inst, lhs, rhs, res): + self._inplace_binop('/?', lhs, rhs, res) + + def op_INPLACE_TRUE_DIVIDE(self, inst, lhs, rhs, res): + self._inplace_binop('/', lhs, rhs, res) + + def op_INPLACE_FLOOR_DIVIDE(self, inst, lhs, rhs, res): + self._inplace_binop('//', lhs, rhs, res) + + def op_INPLACE_MODULO(self, inst, lhs, rhs, res): + self._inplace_binop('%', lhs, rhs, res) + + def op_INPLACE_POWER(self, inst, lhs, rhs, res): + self._inplace_binop('**', lhs, rhs, res) + + def op_INPLACE_MATRIX_MULTIPLY(self, inst, lhs, rhs, res): + self._inplace_binop('@', lhs, rhs, res) + + def op_INPLACE_LSHIFT(self, inst, lhs, rhs, res): + self._inplace_binop('<<', lhs, rhs, res) + + def op_INPLACE_RSHIFT(self, inst, lhs, rhs, res): + self._inplace_binop('>>', lhs, rhs, res) + + def op_INPLACE_AND(self, inst, lhs, rhs, res): + self._inplace_binop('&', lhs, rhs, res) + + def op_INPLACE_OR(self, inst, lhs, rhs, res): + self._inplace_binop('|', lhs, rhs, res) + + def op_INPLACE_XOR(self, inst, lhs, rhs, res): + self._inplace_binop('^', lhs, rhs, res) + + def op_JUMP_ABSOLUTE(self, inst): + jmp = ir.Jump(inst.get_jump_target(), loc=self.loc) + self.current_block.append(jmp) + + def op_JUMP_FORWARD(self, inst): + jmp = ir.Jump(inst.get_jump_target(), loc=self.loc) + self.current_block.append(jmp) + + def op_JUMP_BACKWARD(self, inst): + jmp = ir.Jump(inst.get_jump_target(), loc=self.loc) + self.current_block.append(jmp) + + op_JUMP_BACKWARD_NO_INTERRUPT = op_JUMP_BACKWARD + + def op_POP_BLOCK(self, inst, kind=None): + if kind is None: + self.syntax_blocks.pop() + elif kind == 'with': + d = ir.PopBlock(loc=self.loc) + self.current_block.append(d) + elif kind == 'try': + self._insert_try_block_end() + + def op_RETURN_VALUE(self, inst, retval, castval): + self.store(ir.Expr.cast(self.get(retval), loc=self.loc), castval) + ret = ir.Return(self.get(castval), loc=self.loc) + self.current_block.append(ret) + + if PYVERSION in ((3, 12), (3, 13)): + def op_RETURN_CONST(self, inst, retval, castval): + value = self.code_consts[inst.arg] + const = ir.Const(value, loc=self.loc) + self.store(const, retval) + self.store(ir.Expr.cast(self.get(retval), loc=self.loc), castval) + ret = ir.Return(self.get(castval), loc=self.loc) + self.current_block.append(ret) + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + if PYVERSION in ((3, 13),): + def op_TO_BOOL(self, inst, val, res): + self.store(self.get(val), res) # TODO: just a lazy hack + + elif PYVERSION in ((3, 10), (3, 11), (3, 12)): + pass + else: + raise NotImplementedError(PYVERSION) + + def op_COMPARE_OP(self, inst, lhs, rhs, res): + if PYVERSION in ((3, 13),): + op = dis.cmp_op[inst.arg >> 5] + # TODO: fifth lowest bit now indicates a forced version to bool. + elif PYVERSION in ((3, 12),): + op = dis.cmp_op[inst.arg >> 4] + elif PYVERSION in ((3, 10), (3, 11)): + op = dis.cmp_op[inst.arg] + else: + raise NotImplementedError(PYVERSION) + if op == 'in' or op == 'not in': + lhs, rhs = rhs, lhs + + if op == 'not in': + self._binop('in', lhs, rhs, res) + tmp = self.get(res) + out = ir.Expr.unary('not', value=tmp, loc=self.loc) + self.store(out, res) + elif op == 'exception match': + gv_fn = ir.Global( + "exception_match", eh.exception_match, loc=self.loc, + ) + exc_match_name = '$exc_match' + self.store(value=gv_fn, name=exc_match_name, redefine=True) + lhs = self.get(lhs) + rhs = self.get(rhs) + exc = ir.Expr.call( + self.get(exc_match_name), args=(lhs, rhs), kws=(), loc=self.loc, + ) + self.store(exc, res) + else: + self._binop(op, lhs, rhs, res) + + def op_IS_OP(self, inst, lhs, rhs, res): + # invert if op case is 1 + op = 'is not' if inst.arg == 1 else 'is' + self._binop(op, lhs, rhs, res) + + def op_CONTAINS_OP(self, inst, lhs, rhs, res): + lhs, rhs = rhs, lhs + self._binop('in', lhs, rhs, res) + # invert if op case is 1 + if inst.arg == 1: + tmp = self.get(res) + out = ir.Expr.unary('not', value=tmp, loc=self.loc) + self.store(out, res) + + def op_BREAK_LOOP(self, inst, end=None): + if end is None: + loop = self.syntax_blocks[-1] + assert isinstance(loop, ir.Loop) + end = loop.exit + jmp = ir.Jump(target=end, loc=self.loc) + self.current_block.append(jmp) + + def _op_JUMP_IF(self, inst, pred, iftrue): + brs = { + True: inst.get_jump_target(), + False: inst.next, + } + truebr = brs[iftrue] + falsebr = brs[not iftrue] + + name = "bool%s" % (inst.offset) + gv_fn = ir.Global("bool", bool, loc=self.loc) + self.store(value=gv_fn, name=name) + + callres = ir.Expr.call(self.get(name), (self.get(pred),), (), + loc=self.loc) + + pname = "$%spred" % (inst.offset) + predicate = self.store(value=callres, name=pname) + bra = ir.Branch(cond=predicate, truebr=truebr, falsebr=falsebr, + loc=self.loc) + self.current_block.append(bra) + + def op_JUMP_IF_FALSE(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=False) + + def op_JUMP_IF_TRUE(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=True) + + def _jump_if_none(self, inst, pred, iftrue): + # branch pruning assumes true falls through and false is jump + truebr = inst.next + falsebr = inst.get_jump_target() + + # this seems strange + if not iftrue: + op = BINOPS_TO_OPERATORS["is"] + else: + op = BINOPS_TO_OPERATORS["is not"] + + rhs = self.store(value=ir.Const(None, loc=self.loc), + name=f"$constNone{inst.offset}") + lhs = self.get(pred) + isnone = ir.Expr.binop(op, lhs=lhs, rhs=rhs, loc=self.loc) + + maybeNone = f"$maybeNone{inst.offset}" + self.store(value=isnone, name=maybeNone) + + name = f"$bool{inst.offset}" + gv_fn = ir.Global("bool", bool, loc=self.loc) + self.store(value=gv_fn, name=name) + + callres = ir.Expr.call(self.get(name), (self.get(maybeNone),), (), + loc=self.loc) + + pname = f"$pred{inst.offset}" + predicate = self.store(value=callres, name=pname) + branch = ir.Branch(cond=predicate, + truebr=truebr, + falsebr=falsebr, + loc=self.loc) + self.current_block.append(branch) + + def op_POP_JUMP_FORWARD_IF_NONE(self, inst, pred): + self._jump_if_none(inst, pred, True) + + def op_POP_JUMP_FORWARD_IF_NOT_NONE(self, inst, pred): + self._jump_if_none(inst, pred, False) + + if PYVERSION in ((3, 12), (3, 13)): + def op_POP_JUMP_IF_NONE(self, inst, pred): + self._jump_if_none(inst, pred, True) + + def op_POP_JUMP_IF_NOT_NONE(self, inst, pred): + self._jump_if_none(inst, pred, False) + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + def op_POP_JUMP_BACKWARD_IF_NONE(self, inst, pred): + self._jump_if_none(inst, pred, True) + + def op_POP_JUMP_BACKWARD_IF_NOT_NONE(self, inst, pred): + self._jump_if_none(inst, pred, False) + + def op_POP_JUMP_FORWARD_IF_FALSE(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=False) + + def op_POP_JUMP_FORWARD_IF_TRUE(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=True) + + def op_POP_JUMP_BACKWARD_IF_FALSE(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=False) + + def op_POP_JUMP_BACKWARD_IF_TRUE(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=True) + + def op_POP_JUMP_IF_FALSE(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=False) + + def op_POP_JUMP_IF_TRUE(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=True) + + def op_JUMP_IF_FALSE_OR_POP(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=False) + + def op_JUMP_IF_TRUE_OR_POP(self, inst, pred): + self._op_JUMP_IF(inst, pred=pred, iftrue=True) + + def op_CHECK_EXC_MATCH(self, inst, pred, tos, tos1): + gv_fn = ir.Global( + "exception_match", eh.exception_match, loc=self.loc, + ) + exc_match_name = '$exc_match' + self.store(value=gv_fn, name=exc_match_name, redefine=True) + lhs = self.get(tos1) + rhs = self.get(tos) + exc = ir.Expr.call( + self.get(exc_match_name), args=(lhs, rhs), kws=(), loc=self.loc, + ) + self.store(exc, pred) + + def op_JUMP_IF_NOT_EXC_MATCH(self, inst, pred, tos, tos1): + truebr = inst.next + falsebr = inst.get_jump_target() + gv_fn = ir.Global( + "exception_match", eh.exception_match, loc=self.loc, + ) + exc_match_name = '$exc_match' + self.store(value=gv_fn, name=exc_match_name, redefine=True) + lhs = self.get(tos1) + rhs = self.get(tos) + exc = ir.Expr.call( + self.get(exc_match_name), args=(lhs, rhs), kws=(), loc=self.loc, + ) + predicate = self.store(exc, pred) + bra = ir.Branch(cond=predicate, truebr=truebr, falsebr=falsebr, + loc=self.loc) + self.current_block.append(bra) + + def op_RERAISE(self, inst, exc): + tryblk = self.dfainfo.active_try_block + if tryblk is not None: + stmt = ir.TryRaise(exception=None, loc=self.loc) + self.current_block.append(stmt) + self._insert_try_block_end() + self.current_block.append(ir.Jump(tryblk['end'], loc=self.loc)) + else: + # Numba can't handle this case and it's caught else where, this is a + # runtime guard in case this is reached by unknown means. + msg = (f"Unreachable condition reached (op code RERAISE executed)" + f"{error_extras['reportable']}") + stmt = ir.StaticRaise(AssertionError, (msg,), self.loc) + self.current_block.append(stmt) + + def op_RAISE_VARARGS(self, inst, exc): + if exc is not None: + exc = self.get(exc) + tryblk = self.dfainfo.active_try_block + if tryblk is not None: + # In a try block + stmt = ir.TryRaise(exception=exc, loc=self.loc) + self.current_block.append(stmt) + self._insert_try_block_end() + self.current_block.append(ir.Jump(tryblk['end'], loc=self.loc)) + else: + # Not in a try block + stmt = ir.Raise(exception=exc, loc=self.loc) + self.current_block.append(stmt) + + def op_YIELD_VALUE(self, inst, value, res): + # initialize index to None. it's being set later in post-processing + index = None + inst = ir.Yield(value=self.get(value), index=index, loc=self.loc) + return self.store(inst, res) + + def op_MAKE_FUNCTION(self, inst, name, code, closure, annotations, + kwdefaults, defaults, res): + # annotations are ignored by numba but useful for static analysis + # re. https://github.com/numba/numba/issues/7269 + if kwdefaults is not None: + msg = "op_MAKE_FUNCTION with kwdefaults is not implemented" + raise NotImplementedError(msg) + if defaults: + if isinstance(defaults, tuple): + defaults = tuple([self.get(name) for name in defaults]) + else: + defaults = self.get(defaults) + + assume_code_const = self.definitions[code][0] + if not isinstance(assume_code_const, ir.Const): + msg = ( + "Unsupported use of closure. " + "Probably caused by complex control-flow constructs; " + "e.g. try-except" + ) + raise errors.UnsupportedBytecodeError(msg, loc=self.loc) + fcode = assume_code_const.value + if name: + name = self.get(name) + if closure: + closure = self.get(closure) + expr = ir.Expr.make_function(name, fcode, closure, defaults, self.loc) + self.store(expr, res) + + def op_MAKE_CLOSURE(self, inst, name, code, closure, annotations, + kwdefaults, defaults, res): + self.op_MAKE_FUNCTION(inst, name, code, closure, annotations, + kwdefaults, defaults, res) + + if PYVERSION in ((3, 11), (3, 12), (3, 13)): + def op_LOAD_CLOSURE(self, inst, res): + name = self.func_id.func.__code__._varname_from_oparg(inst.arg) + if name in self.code_cellvars: + try: + gl = self.get(name) + except NotDefinedError: + msg = "Unsupported use of cell variable encountered" + raise NotImplementedError(msg) + elif name in self.code_freevars: + idx = self.code_freevars.index(name) + value = self.get_closure_value(idx) + gl = ir.FreeVar(idx, name, value, loc=self.loc) + else: + assert 0, "unreachable" + self.store(gl, res) + + elif PYVERSION in ((3, 10),): + def op_LOAD_CLOSURE(self, inst, res): + n_cellvars = len(self.code_cellvars) + if inst.arg < n_cellvars: + name = self.code_cellvars[inst.arg] + try: + gl = self.get(name) + except NotDefinedError: + msg = "Unsupported use of cell variable encountered" + raise NotImplementedError(msg) + else: + idx = inst.arg - n_cellvars + name = self.code_freevars[idx] + value = self.get_closure_value(idx) + gl = ir.FreeVar(idx, name, value, loc=self.loc) + self.store(gl, res) + else: + raise NotImplementedError(PYVERSION) + + def op_LIST_APPEND(self, inst, target, value, appendvar, res): + target = self.get(target) + value = self.get(value) + appendattr = ir.Expr.getattr(target, 'append', loc=self.loc) + self.store(value=appendattr, name=appendvar) + appendinst = ir.Expr.call(self.get(appendvar), (value,), (), + loc=self.loc) + self.store(value=appendinst, name=res) + + def op_LIST_EXTEND(self, inst, target, value, extendvar, res): + target = self.get(target) + value = self.get(value) + # If the statements between the current instruction and the target + # are N * consts followed by build_tuple AND the target has no items, + # it's a situation where a list is being statically initialised, rewrite + # the build_tuple as a build_list, drop the extend, and wire up the + # target as the result from the build_tuple that's been rewritten. + + # See if this is the first statement in a block, if so its probably from + # control flow in a tuple unpack like: + # `(*(1, (2,) if predicate else (3,)))` + # this cannot be handled as present so raise + msg = ("An unsupported bytecode sequence has been encountered: " + "op_LIST_EXTEND at the start of a block.\n\nThis could be " + "due to the use of a branch in a tuple unpacking statement.") + if not self.current_block.body: + raise errors.UnsupportedBytecodeError(msg) + + # is last emitted statement a build_tuple? + stmt = self.current_block.body[-1] + ok = isinstance(stmt.value, ir.Expr) and stmt.value.op == "build_tuple" + # check statements from self.current_block.body[-1] through to target, + # make sure they are consts + build_empty_list = None + if ok: + for stmt in reversed(self.current_block.body[:-1]): + if not isinstance(stmt, ir.Assign): + ok = False + break + # if its not a const, it needs to be the `build_list` for the + # target, else it's something else we don't know about so just + # bail + if isinstance(stmt.value, ir.Const): + continue + + # it's not a const, check for target + elif isinstance(stmt.value, ir.Expr) and stmt.target == target: + build_empty_list = stmt + # it's only ok to do this if the target has no initializer + # already + ok = not stmt.value.items + break + else: + ok = False + break + if ok and build_empty_list is None: + raise errors.UnsupportedBytecodeError(msg) + if ok: + stmts = self.current_block.body + build_tuple_asgn = self.current_block.body[-1] + # move build list to last issued statement + stmts.append(stmts.pop(stmts.index(build_empty_list))) + # fix the build list + build_tuple = build_tuple_asgn.value + build_list = build_empty_list.value + build_list.items = build_tuple.items + else: + # it's just a list extend with no static init, let it be + extendattr = ir.Expr.getattr(target, 'extend', loc=self.loc) + self.store(value=extendattr, name=extendvar) + extendinst = ir.Expr.call(self.get(extendvar), (value,), (), + loc=self.loc) + self.store(value=extendinst, name=res) + + def op_MAP_ADD(self, inst, target, key, value, setitemvar, res): + target = self.get(target) + key = self.get(key) + value = self.get(value) + setitemattr = ir.Expr.getattr(target, '__setitem__', loc=self.loc) + self.store(value=setitemattr, name=setitemvar) + appendinst = ir.Expr.call(self.get(setitemvar), (key, value,), (), + loc=self.loc) + self.store(value=appendinst, name=res) + + def op_LOAD_ASSERTION_ERROR(self, inst, res): + gv_fn = ir.Global("AssertionError", AssertionError, loc=self.loc) + self.store(value=gv_fn, name=res) + + # NOTE: The LOAD_METHOD opcode is implemented as a LOAD_ATTR for ease, + # however this means a new object (the bound-method instance) could be + # created. Conversely, using a pure LOAD_METHOD no intermediary is present + # and it is essentially like a pointer grab and forward to CALL_METHOD. The + # net outcome is that the implementation in Numba produces the same result, + # but in object mode it may be that it runs more slowly than it would if + # run in CPython. + + def op_LOAD_METHOD(self, *args, **kws): + self.op_LOAD_ATTR(*args, **kws) + + def op_CALL_METHOD(self, *args, **kws): + self.op_CALL_FUNCTION(*args, **kws) + + if PYVERSION in ((3, 12), (3, 13)): + def op_CALL_INTRINSIC_1(self, inst, operand, **kwargs): + if operand == ci1op.INTRINSIC_STOPITERATION_ERROR: + stmt = ir.StaticRaise(INTRINSIC_STOPITERATION_ERROR, (), + self.loc) + self.current_block.append(stmt) + return + elif operand == ci1op.UNARY_POSITIVE: + self.op_UNARY_POSITIVE(inst, **kwargs) + return + elif operand == ci1op.INTRINSIC_LIST_TO_TUPLE: + self.op_LIST_TO_TUPLE(inst, **kwargs) + return + else: + raise NotImplementedError(operand) + elif PYVERSION in ((3, 10), (3, 11)): + pass + else: + raise NotImplementedError(PYVERSION) + + +if PYVERSION in ((3, 12), (3, 13)): + class INTRINSIC_STOPITERATION_ERROR(AssertionError): + pass +elif PYVERSION in ((3, 10), (3, 11)): + pass +else: + raise NotImplementedError(PYVERSION) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/intrinsics.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/intrinsics.py new file mode 100644 index 0000000000000000000000000000000000000000..8e85bb35400e7770c1746fb375afc248cb0fe35d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/intrinsics.py @@ -0,0 +1,101 @@ +""" +LLVM pass that converts intrinsic into other math calls +""" + +from llvmlite import ir + + +class _DivmodFixer(ir.Visitor): + def visit_Instruction(self, instr): + if instr.type == ir.IntType(64): + if instr.opname in ['srem', 'urem', 'sdiv', 'udiv']: + name = 'numba_{op}'.format(op=instr.opname) + fn = self.module.globals.get(name) + # Declare the function if it doesn't already exist + if fn is None: + opty = instr.type + sdivfnty = ir.FunctionType(opty, [opty, opty]) + fn = ir.Function(self.module, sdivfnty, name=name) + # Replace the operation with a call to the builtin + repl = ir.CallInstr(parent=instr.parent, func=fn, + args=instr.operands, name=instr.name) + instr.parent.replace(instr, repl) + + +def fix_divmod(mod): + """Replace division and reminder instructions to builtins calls + """ + _DivmodFixer().visit(mod) + + +INTR_TO_CMATH = { + "llvm.pow.f32": "powf", + "llvm.pow.f64": "pow", + + "llvm.sin.f32": "sinf", + "llvm.sin.f64": "sin", + + "llvm.cos.f32": "cosf", + "llvm.cos.f64": "cos", + + "llvm.sqrt.f32": "sqrtf", + "llvm.sqrt.f64": "sqrt", + + "llvm.exp.f32": "expf", + "llvm.exp.f64": "exp", + + "llvm.log.f32": "logf", + "llvm.log.f64": "log", + + "llvm.log10.f32": "log10f", + "llvm.log10.f64": "log10", + + "llvm.fabs.f32": "fabsf", + "llvm.fabs.f64": "fabs", + + "llvm.floor.f32": "floorf", + "llvm.floor.f64": "floor", + + "llvm.ceil.f32": "ceilf", + "llvm.ceil.f64": "ceil", + + "llvm.trunc.f32": "truncf", + "llvm.trunc.f64": "trunc", +} + +OTHER_CMATHS = ''' +tan +tanf +sinh +sinhf +cosh +coshf +tanh +tanhf +asin +asinf +acos +acosf +atan +atanf +atan2 +atan2f +asinh +asinhf +acosh +acoshf +atanh +atanhf +expm1 +expm1f +log1p +log1pf +log10 +log10f +fmod +fmodf +round +roundf +'''.split() + +INTR_MATH = frozenset(INTR_TO_CMATH.values()) | frozenset(OTHER_CMATHS) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/ir.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/ir.py new file mode 100644 index 0000000000000000000000000000000000000000..c7efe4017e83f3de6e8cb83a969bb0d1754c6dd8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/ir.py @@ -0,0 +1,1702 @@ +from collections import defaultdict +import copy +import itertools +import os +import linecache +import pprint +import re +import sys +import operator +from types import FunctionType, BuiltinFunctionType +from functools import total_ordering +from io import StringIO + +from numba.core import errors, config +from numba.core.utils import (BINOPS_TO_OPERATORS, INPLACE_BINOPS_TO_OPERATORS, + UNARY_BUITINS_TO_OPERATORS, OPERATORS_TO_BUILTINS) +from numba.core.errors import (NotDefinedError, RedefinedError, + VerificationError, ConstantInferenceError) +from numba.core import consts + +# terminal color markup +_termcolor = errors.termcolor() + + +class Loc(object): + """Source location + + """ + _defmatcher = re.compile(r'def\s+(\w+)') + + def __init__(self, filename, line, col=None, maybe_decorator=False): + """ Arguments: + filename - name of the file + line - line in file + col - column + maybe_decorator - Set to True if location is likely a jit decorator + """ + self.filename = filename + self.line = line + self.col = col + self.lines = None # the source lines from the linecache + self.maybe_decorator = maybe_decorator + + def __eq__(self, other): + # equivalence is solely based on filename, line and col + if type(self) is not type(other): return False + if self.filename != other.filename: return False + if self.line != other.line: return False + if self.col != other.col: return False + return True + + def __ne__(self, other): + return not self.__eq__(other) + + @classmethod + def from_function_id(cls, func_id): + return cls(func_id.filename, func_id.firstlineno, maybe_decorator=True) + + def __repr__(self): + return "Loc(filename=%s, line=%s, col=%s)" % (self.filename, + self.line, self.col) + + def __str__(self): + if self.col is not None: + return "%s (%s:%s)" % (self.filename, self.line, self.col) + else: + return "%s (%s)" % (self.filename, self.line) + + def _find_definition(self): + # try and find a def, go backwards from error line + fn_name = None + lines = self.get_lines() + for x in reversed(lines[:self.line - 1]): + # the strip and startswith is to handle user code with commented out + # 'def' or use of 'def' in a docstring. + if x.strip().startswith('def '): + fn_name = x + break + + return fn_name + + def _raw_function_name(self): + defn = self._find_definition() + if defn: + m = self._defmatcher.match(defn.strip()) + if m: + return m.groups()[0] + # Probably exec() or REPL. + return None + + def get_lines(self): + if self.lines is None: + path = self._get_path() + # Avoid reading from dynamic string. They are most likely + # overridden. Problem started with Python 3.13. "" seems + # to be something from multiprocessing. + lns = [] if path == "" else linecache.getlines(path) + self.lines = lns + return self.lines + + def _get_path(self): + path = None + try: + # Try to get a relative path + # ipython/jupyter input just returns as self.filename + path = os.path.relpath(self.filename) + except ValueError: + # Fallback to absolute path if error occurred in getting the + # relative path. + # This may happen on windows if the drive is different + path = os.path.abspath(self.filename) + return path + + + def strformat(self, nlines_up=2): + + lines = self.get_lines() + + use_line = self.line + + if self.maybe_decorator: + # try and sort out a better `loc`, if it's suspected that this loc + # points at a jit decorator by virtue of + # `__code__.co_firstlineno` + + # get lines, add a dummy entry at the start as lines count from + # 1 but list index counts from 0 + tmplines = [''] + lines + + if lines and use_line and 'def ' not in tmplines[use_line]: + # look forward 10 lines, unlikely anyone managed to stretch + # a jit call declaration over >10 lines?! + min_line = max(0, use_line) + max_line = use_line + 10 + selected = tmplines[min_line : max_line] + index = 0 + for idx, x in enumerate(selected): + if 'def ' in x: + index = idx + break + use_line = use_line + index + + + ret = [] # accumulates output + if lines and use_line > 0: + + def count_spaces(string): + spaces = 0 + for x in itertools.takewhile(str.isspace, str(string)): + spaces += 1 + return spaces + + # A few places in the code still use no `loc` or default to line 1 + # this is often in places where exceptions are used for the purposes + # of flow control. As a result max is in use to prevent slice from + # `[negative: positive]` + selected = lines[max(0, use_line - nlines_up):use_line] + + # see if selected contains a definition + def_found = False + for x in selected: + if 'def ' in x: + def_found = True + + # no definition found, try and find one + if not def_found: + # try and find a def, go backwards from error line + fn_name = None + for x in reversed(lines[:use_line - 1]): + if 'def ' in x: + fn_name = x + break + if fn_name: + ret.append(fn_name) + spaces = count_spaces(x) + ret.append(' '*(4 + spaces) + '\n') + + if selected: + ret.extend(selected[:-1]) + ret.append(_termcolor.highlight(selected[-1])) + + # point at the problem with a caret + spaces = count_spaces(selected[-1]) + ret.append(' '*(spaces) + _termcolor.indicate("^")) + + # if in the REPL source may not be available + if not ret: + if not lines: + ret = "" + elif use_line <= 0: + ret = "" + + + err = _termcolor.filename('\nFile "%s", line %d:')+'\n%s' + tmp = err % (self._get_path(), use_line, _termcolor.code(''.join(ret))) + return tmp + + def with_lineno(self, line, col=None): + """ + Return a new Loc with this line number. + """ + return type(self)(self.filename, line, col) + + def short(self): + """ + Returns a short string + """ + shortfilename = os.path.basename(self.filename) + return "%s:%s" % (shortfilename, self.line) + + +# Used for annotating errors when source location is unknown. +unknown_loc = Loc("unknown location", 0, 0) + + +@total_ordering +class SlotEqualityCheckMixin(object): + # some ir nodes are __dict__ free using __slots__ instead, this mixin + # should not trigger the unintended creation of __dict__. + __slots__ = tuple() + + def __eq__(self, other): + if type(self) is type(other): + for name in self.__slots__: + if getattr(self, name) != getattr(other, name): + return False + else: + return True + return False + + def __le__(self, other): + return str(self) <= str(other) + + def __hash__(self): + return id(self) + + +@total_ordering +class EqualityCheckMixin(object): + """ Mixin for basic equality checking """ + + def __eq__(self, other): + if type(self) is type(other): + def fixup(adict): + bad = ('loc', 'scope') + d = dict(adict) + for x in bad: + d.pop(x, None) + return d + d1 = fixup(self.__dict__) + d2 = fixup(other.__dict__) + if d1 == d2: + return True + return False + + def __le__(self, other): + return str(self) < str(other) + + def __hash__(self): + return id(self) + + +class VarMap(object): + def __init__(self): + self._con = {} + + def define(self, name, var): + if name in self._con: + raise RedefinedError(name) + else: + self._con[name] = var + + def get(self, name): + try: + return self._con[name] + except KeyError: + raise NotDefinedError(name) + + def __contains__(self, name): + return name in self._con + + def __len__(self): + return len(self._con) + + def __repr__(self): + return pprint.pformat(self._con) + + def __hash__(self): + return hash(self.name) + + def __iter__(self): + return self._con.iterkeys() + + def __eq__(self, other): + if type(self) is type(other): + # check keys only, else __eq__ ref cycles, scope -> varmap -> var + return self._con.keys() == other._con.keys() + return False + + def __ne__(self, other): + return not self.__eq__(other) + + +class AbstractRHS(object): + """Abstract base class for anything that can be the RHS of an assignment. + This class **does not** define any methods. + """ + + +class Inst(EqualityCheckMixin, AbstractRHS): + """ + Base class for all IR instructions. + """ + + def list_vars(self): + """ + List the variables used (read or written) by the instruction. + """ + raise NotImplementedError + + def _rec_list_vars(self, val): + """ + A recursive helper used to implement list_vars() in subclasses. + """ + if isinstance(val, Var): + return [val] + elif isinstance(val, Inst): + return val.list_vars() + elif isinstance(val, (list, tuple)): + lst = [] + for v in val: + lst.extend(self._rec_list_vars(v)) + return lst + elif isinstance(val, dict): + lst = [] + for v in val.values(): + lst.extend(self._rec_list_vars(v)) + return lst + else: + return [] + + +class Stmt(Inst): + """ + Base class for IR statements (instructions which can appear on their + own in a Block). + """ + # Whether this statement ends its basic block (i.e. it will either jump + # to another block or exit the function). + is_terminator = False + # Whether this statement exits the function. + is_exit = False + + def list_vars(self): + return self._rec_list_vars(self.__dict__) + + +class Terminator(Stmt): + """ + IR statements that are terminators: the last statement in a block. + A terminator must either: + - exit the function + - jump to a block + + All subclass of Terminator must override `.get_targets()` to return a list + of jump targets. + """ + is_terminator = True + + def get_targets(self): + raise NotImplementedError(type(self)) + + +class Expr(Inst): + """ + An IR expression (an instruction which can only be part of a larger + statement). + """ + + def __init__(self, op, loc, **kws): + assert isinstance(op, str) + assert isinstance(loc, Loc) + self.op = op + self.loc = loc + self._kws = kws + + def __getattr__(self, name): + if name.startswith('_'): + return Inst.__getattr__(self, name) + return self._kws[name] + + def __setattr__(self, name, value): + if name in ('op', 'loc', '_kws'): + self.__dict__[name] = value + else: + self._kws[name] = value + + @classmethod + def binop(cls, fn, lhs, rhs, loc): + assert isinstance(fn, BuiltinFunctionType) + assert isinstance(lhs, Var) + assert isinstance(rhs, Var) + assert isinstance(loc, Loc) + op = 'binop' + return cls(op=op, loc=loc, fn=fn, lhs=lhs, rhs=rhs, + static_lhs=UNDEFINED, static_rhs=UNDEFINED) + + @classmethod + def inplace_binop(cls, fn, immutable_fn, lhs, rhs, loc): + assert isinstance(fn, BuiltinFunctionType) + assert isinstance(immutable_fn, BuiltinFunctionType) + assert isinstance(lhs, Var) + assert isinstance(rhs, Var) + assert isinstance(loc, Loc) + op = 'inplace_binop' + return cls(op=op, loc=loc, fn=fn, immutable_fn=immutable_fn, + lhs=lhs, rhs=rhs, + static_lhs=UNDEFINED, static_rhs=UNDEFINED) + + @classmethod + def unary(cls, fn, value, loc): + assert isinstance(value, (str, Var, FunctionType)) + assert isinstance(loc, Loc) + op = 'unary' + fn = UNARY_BUITINS_TO_OPERATORS.get(fn, fn) + return cls(op=op, loc=loc, fn=fn, value=value) + + @classmethod + def call(cls, func, args, kws, loc, vararg=None, varkwarg=None, target=None): + assert isinstance(func, Var) + assert isinstance(loc, Loc) + op = 'call' + return cls(op=op, loc=loc, func=func, args=args, kws=kws, + vararg=vararg, varkwarg=varkwarg, target=target) + + @classmethod + def build_tuple(cls, items, loc): + assert isinstance(loc, Loc) + op = 'build_tuple' + return cls(op=op, loc=loc, items=items) + + @classmethod + def build_list(cls, items, loc): + assert isinstance(loc, Loc) + op = 'build_list' + return cls(op=op, loc=loc, items=items) + + @classmethod + def build_set(cls, items, loc): + assert isinstance(loc, Loc) + op = 'build_set' + return cls(op=op, loc=loc, items=items) + + @classmethod + def build_map(cls, items, size, literal_value, value_indexes, loc): + assert isinstance(loc, Loc) + op = 'build_map' + return cls(op=op, loc=loc, items=items, size=size, + literal_value=literal_value, value_indexes=value_indexes) + + @classmethod + def pair_first(cls, value, loc): + assert isinstance(value, Var) + op = 'pair_first' + return cls(op=op, loc=loc, value=value) + + @classmethod + def pair_second(cls, value, loc): + assert isinstance(value, Var) + assert isinstance(loc, Loc) + op = 'pair_second' + return cls(op=op, loc=loc, value=value) + + @classmethod + def getiter(cls, value, loc): + assert isinstance(value, Var) + assert isinstance(loc, Loc) + op = 'getiter' + return cls(op=op, loc=loc, value=value) + + @classmethod + def iternext(cls, value, loc): + assert isinstance(value, Var) + assert isinstance(loc, Loc) + op = 'iternext' + return cls(op=op, loc=loc, value=value) + + @classmethod + def exhaust_iter(cls, value, count, loc): + assert isinstance(value, Var) + assert isinstance(count, int) + assert isinstance(loc, Loc) + op = 'exhaust_iter' + return cls(op=op, loc=loc, value=value, count=count) + + @classmethod + def getattr(cls, value, attr, loc): + assert isinstance(value, Var) + assert isinstance(attr, str) + assert isinstance(loc, Loc) + op = 'getattr' + return cls(op=op, loc=loc, value=value, attr=attr) + + @classmethod + def getitem(cls, value, index, loc): + assert isinstance(value, Var) + assert isinstance(index, Var) + assert isinstance(loc, Loc) + op = 'getitem' + fn = operator.getitem + return cls(op=op, loc=loc, value=value, index=index, fn=fn) + + @classmethod + def typed_getitem(cls, value, dtype, index, loc): + assert isinstance(value, Var) + assert isinstance(loc, Loc) + op = 'typed_getitem' + return cls(op=op, loc=loc, value=value, dtype=dtype, + index=index) + + @classmethod + def static_getitem(cls, value, index, index_var, loc): + assert isinstance(value, Var) + assert index_var is None or isinstance(index_var, Var) + assert isinstance(loc, Loc) + op = 'static_getitem' + fn = operator.getitem + return cls(op=op, loc=loc, value=value, index=index, + index_var=index_var, fn=fn) + + @classmethod + def cast(cls, value, loc): + """ + A node for implicit casting at the return statement + """ + assert isinstance(value, Var) + assert isinstance(loc, Loc) + op = 'cast' + return cls(op=op, value=value, loc=loc) + + @classmethod + def phi(cls, loc): + """Phi node + """ + assert isinstance(loc, Loc) + return cls(op='phi', incoming_values=[], incoming_blocks=[], loc=loc) + + @classmethod + def make_function(cls, name, code, closure, defaults, loc): + """ + A node for making a function object. + """ + assert isinstance(loc, Loc) + op = 'make_function' + return cls(op=op, name=name, code=code, closure=closure, defaults=defaults, loc=loc) + + @classmethod + def null(cls, loc): + """ + A node for null value. + + This node is not handled by type inference. It is only added by + post-typing passes. + """ + assert isinstance(loc, Loc) + op = 'null' + return cls(op=op, loc=loc) + + @classmethod + def undef(cls, loc): + """ + A node for undefined value specifically from LOAD_FAST_AND_CLEAR opcode. + """ + assert isinstance(loc, Loc) + op = 'undef' + return cls(op=op, loc=loc) + + @classmethod + def dummy(cls, op, info, loc): + """ + A node for a dummy value. + + This node is a place holder for carrying information through to a point + where it is rewritten into something valid. This node is not handled + by type inference or lowering. It's presence outside of the interpreter + renders IR as illegal. + """ + assert isinstance(loc, Loc) + assert isinstance(op, str) + return cls(op=op, info=info, loc=loc) + + def __repr__(self): + if self.op == 'call': + args = ', '.join(str(a) for a in self.args) + pres_order = self._kws.items() if config.DIFF_IR == 0 else sorted(self._kws.items()) + kws = ', '.join('%s=%s' % (k, v) for k, v in pres_order) + vararg = '*%s' % (self.vararg,) if self.vararg is not None else '' + arglist = ', '.join(filter(None, [args, vararg, kws])) + return 'call %s(%s)' % (self.func, arglist) + elif self.op == 'binop': + lhs, rhs = self.lhs, self.rhs + if self.fn == operator.contains: + lhs, rhs = rhs, lhs + fn = OPERATORS_TO_BUILTINS.get(self.fn, self.fn) + return '%s %s %s' % (lhs, fn, rhs) + else: + pres_order = self._kws.items() if config.DIFF_IR == 0 else sorted(self._kws.items()) + args = ('%s=%s' % (k, v) for k, v in pres_order) + return '%s(%s)' % (self.op, ', '.join(args)) + + def list_vars(self): + return self._rec_list_vars(self._kws) + + def infer_constant(self): + raise ConstantInferenceError('%s' % self, loc=self.loc) + + +class SetItem(Stmt): + """ + target[index] = value + """ + + def __init__(self, target, index, value, loc): + assert isinstance(target, Var) + assert isinstance(index, Var) + assert isinstance(value, Var) + assert isinstance(loc, Loc) + self.target = target + self.index = index + self.value = value + self.loc = loc + + def __repr__(self): + return '%s[%s] = %s' % (self.target, self.index, self.value) + + +class StaticSetItem(Stmt): + """ + target[constant index] = value + """ + + def __init__(self, target, index, index_var, value, loc): + assert isinstance(target, Var) + assert not isinstance(index, Var) + assert isinstance(index_var, Var) + assert isinstance(value, Var) + assert isinstance(loc, Loc) + self.target = target + self.index = index + self.index_var = index_var + self.value = value + self.loc = loc + + def __repr__(self): + return '%s[%r] = %s' % (self.target, self.index, self.value) + + +class DelItem(Stmt): + """ + del target[index] + """ + + def __init__(self, target, index, loc): + assert isinstance(target, Var) + assert isinstance(index, Var) + assert isinstance(loc, Loc) + self.target = target + self.index = index + self.loc = loc + + def __repr__(self): + return 'del %s[%s]' % (self.target, self.index) + + +class SetAttr(Stmt): + def __init__(self, target, attr, value, loc): + assert isinstance(target, Var) + assert isinstance(attr, str) + assert isinstance(value, Var) + assert isinstance(loc, Loc) + self.target = target + self.attr = attr + self.value = value + self.loc = loc + + def __repr__(self): + return '(%s).%s = %s' % (self.target, self.attr, self.value) + + +class DelAttr(Stmt): + def __init__(self, target, attr, loc): + assert isinstance(target, Var) + assert isinstance(attr, str) + assert isinstance(loc, Loc) + self.target = target + self.attr = attr + self.loc = loc + + def __repr__(self): + return 'del (%s).%s' % (self.target, self.attr) + + +class StoreMap(Stmt): + def __init__(self, dct, key, value, loc): + assert isinstance(dct, Var) + assert isinstance(key, Var) + assert isinstance(value, Var) + assert isinstance(loc, Loc) + self.dct = dct + self.key = key + self.value = value + self.loc = loc + + def __repr__(self): + return '%s[%s] = %s' % (self.dct, self.key, self.value) + + +class Del(Stmt): + def __init__(self, value, loc): + assert isinstance(value, str) + assert isinstance(loc, Loc) + self.value = value + self.loc = loc + + def __str__(self): + return "del %s" % self.value + + +class Raise(Terminator): + is_exit = True + + def __init__(self, exception, loc): + assert exception is None or isinstance(exception, Var) + assert isinstance(loc, Loc) + self.exception = exception + self.loc = loc + + def __str__(self): + return "raise %s" % self.exception + + def get_targets(self): + return [] + + +class StaticRaise(Terminator): + """ + Raise an exception class and arguments known at compile-time. + Note that if *exc_class* is None, a bare "raise" statement is implied + (i.e. re-raise the current exception). + """ + is_exit = True + + def __init__(self, exc_class, exc_args, loc): + assert exc_class is None or isinstance(exc_class, type) + assert isinstance(loc, Loc) + assert exc_args is None or isinstance(exc_args, tuple) + self.exc_class = exc_class + self.exc_args = exc_args + self.loc = loc + + def __str__(self): + if self.exc_class is None: + return " raise" + elif self.exc_args is None: + return " raise %s" % (self.exc_class,) + else: + return " raise %s(%s)" % (self.exc_class, + ", ".join(map(repr, self.exc_args))) + + def get_targets(self): + return [] + + +class DynamicRaise(Terminator): + """ + Raise an exception class and some argument *values* unknown at compile-time. + Note that if *exc_class* is None, a bare "raise" statement is implied + (i.e. re-raise the current exception). + """ + is_exit = True + + def __init__(self, exc_class, exc_args, loc): + assert exc_class is None or isinstance(exc_class, type) + assert isinstance(loc, Loc) + assert exc_args is None or isinstance(exc_args, tuple) + self.exc_class = exc_class + self.exc_args = exc_args + self.loc = loc + + def __str__(self): + if self.exc_class is None: + return " raise" + elif self.exc_args is None: + return " raise %s" % (self.exc_class,) + else: + return " raise %s(%s)" % (self.exc_class, + ", ".join(map(repr, self.exc_args))) + + def get_targets(self): + return [] + + +class TryRaise(Stmt): + """A raise statement inside a try-block + Similar to ``Raise`` but does not terminate. + """ + def __init__(self, exception, loc): + assert exception is None or isinstance(exception, Var) + assert isinstance(loc, Loc) + self.exception = exception + self.loc = loc + + def __str__(self): + return "try_raise %s" % self.exception + + +class StaticTryRaise(Stmt): + """A raise statement inside a try-block. + Similar to ``StaticRaise`` but does not terminate. + """ + def __init__(self, exc_class, exc_args, loc): + assert exc_class is None or isinstance(exc_class, type) + assert isinstance(loc, Loc) + assert exc_args is None or isinstance(exc_args, tuple) + self.exc_class = exc_class + self.exc_args = exc_args + self.loc = loc + + def __str__(self): + if self.exc_class is None: + return f"static_try_raise" + elif self.exc_args is None: + return f"static_try_raise {self.exc_class}" + else: + args = ", ".join(map(repr, self.exc_args)) + return f"static_try_raise {self.exc_class}({args})" + + +class DynamicTryRaise(Stmt): + """A raise statement inside a try-block. + Similar to ``DynamicRaise`` but does not terminate. + """ + def __init__(self, exc_class, exc_args, loc): + assert exc_class is None or isinstance(exc_class, type) + assert isinstance(loc, Loc) + assert exc_args is None or isinstance(exc_args, tuple) + self.exc_class = exc_class + self.exc_args = exc_args + self.loc = loc + + def __str__(self): + if self.exc_class is None: + return f"dynamic_try_raise" + elif self.exc_args is None: + return f"dynamic_try_raise {self.exc_class}" + else: + args = ", ".join(map(repr, self.exc_args)) + return f"dynamic_try_raise {self.exc_class}({args})" + + +class Return(Terminator): + """ + Return to caller. + """ + is_exit = True + + def __init__(self, value, loc): + assert isinstance(value, Var), type(value) + assert isinstance(loc, Loc) + self.value = value + self.loc = loc + + def __str__(self): + return 'return %s' % self.value + + def get_targets(self): + return [] + + +class Jump(Terminator): + """ + Unconditional branch. + """ + + def __init__(self, target, loc): + assert isinstance(loc, Loc) + self.target = target + self.loc = loc + + def __str__(self): + return 'jump %s' % self.target + + def get_targets(self): + return [self.target] + + +class Branch(Terminator): + """ + Conditional branch. + """ + + def __init__(self, cond, truebr, falsebr, loc): + assert isinstance(cond, Var) + assert isinstance(loc, Loc) + self.cond = cond + self.truebr = truebr + self.falsebr = falsebr + self.loc = loc + + def __str__(self): + return 'branch %s, %s, %s' % (self.cond, self.truebr, self.falsebr) + + def get_targets(self): + return [self.truebr, self.falsebr] + + +class Assign(Stmt): + """ + Assign to a variable. + """ + def __init__(self, value, target, loc): + assert isinstance(value, AbstractRHS) + assert isinstance(target, Var) + assert isinstance(loc, Loc) + self.value = value + self.target = target + self.loc = loc + + def __str__(self): + return '%s = %s' % (self.target, self.value) + + +class Print(Stmt): + """ + Print some values. + """ + def __init__(self, args, vararg, loc): + assert all(isinstance(x, Var) for x in args) + assert vararg is None or isinstance(vararg, Var) + assert isinstance(loc, Loc) + self.args = tuple(args) + self.vararg = vararg + # Constant-inferred arguments + self.consts = {} + self.loc = loc + + def __str__(self): + return 'print(%s)' % ', '.join(str(v) for v in self.args) + + +class Yield(Inst): + def __init__(self, value, loc, index): + assert isinstance(value, Var) + assert isinstance(loc, Loc) + self.value = value + self.loc = loc + self.index = index + + def __str__(self): + return 'yield %s' % (self.value,) + + def list_vars(self): + return [self.value] + + +class EnterWith(Stmt): + """Enter a "with" context + """ + def __init__(self, contextmanager, begin, end, loc): + """ + Parameters + ---------- + contextmanager : IR value + begin, end : int + The beginning and the ending offset of the with-body. + loc : ir.Loc instance + Source location + """ + assert isinstance(contextmanager, Var) + assert isinstance(loc, Loc) + self.contextmanager = contextmanager + self.begin = begin + self.end = end + self.loc = loc + + def __str__(self): + return 'enter_with {}'.format(self.contextmanager) + + def list_vars(self): + return [self.contextmanager] + + +class PopBlock(Stmt): + """Marker statement for a pop block op code""" + def __init__(self, loc): + assert isinstance(loc, Loc) + self.loc = loc + + def __str__(self): + return 'pop_block' + + +class Arg(EqualityCheckMixin, AbstractRHS): + def __init__(self, name, index, loc): + assert isinstance(name, str) + assert isinstance(index, int) + assert isinstance(loc, Loc) + self.name = name + self.index = index + self.loc = loc + + def __repr__(self): + return 'arg(%d, name=%s)' % (self.index, self.name) + + def infer_constant(self): + raise ConstantInferenceError('%s' % self, loc=self.loc) + + +class Const(EqualityCheckMixin, AbstractRHS): + def __init__(self, value, loc, use_literal_type=True): + assert isinstance(loc, Loc) + self.value = value + self.loc = loc + # Note: need better way to tell if this is a literal or not. + self.use_literal_type = use_literal_type + + def __repr__(self): + return 'const(%s, %s)' % (type(self.value).__name__, self.value) + + def infer_constant(self): + return self.value + + def __deepcopy__(self, memo): + # Override to not copy constant values in code + return Const( + value=self.value, loc=self.loc, + use_literal_type=self.use_literal_type, + ) + + +class Global(EqualityCheckMixin, AbstractRHS): + def __init__(self, name, value, loc): + assert isinstance(loc, Loc) + self.name = name + self.value = value + self.loc = loc + + def __str__(self): + return 'global(%s: %s)' % (self.name, self.value) + + def infer_constant(self): + return self.value + + def __deepcopy__(self, memo): + # don't copy value since it can fail (e.g. modules) + # value is readonly and doesn't need copying + return Global(self.name, self.value, copy.deepcopy(self.loc)) + + +class FreeVar(EqualityCheckMixin, AbstractRHS): + """ + A freevar, as loaded by LOAD_DECREF. + (i.e. a variable defined in an enclosing non-global scope) + """ + + def __init__(self, index, name, value, loc): + assert isinstance(index, int) + assert isinstance(name, str) + assert isinstance(loc, Loc) + # index inside __code__.co_freevars + self.index = index + # variable name + self.name = name + # frozen value + self.value = value + self.loc = loc + + def __str__(self): + return 'freevar(%s: %s)' % (self.name, self.value) + + def infer_constant(self): + return self.value + + def __deepcopy__(self, memo): + # Override to not copy constant values in code + return FreeVar(index=self.index, name=self.name, value=self.value, + loc=self.loc) + + + +class Var(EqualityCheckMixin, AbstractRHS): + """ + Attributes + ----------- + - scope: Scope + + - name: str + + - loc: Loc + Definition location + """ + + def __init__(self, scope, name, loc): + # NOTE: Use of scope=None should be removed. + assert scope is None or isinstance(scope, Scope) + assert isinstance(name, str) + assert isinstance(loc, Loc) + self.scope = scope + self.name = name + self.loc = loc + + def __repr__(self): + return 'Var(%s, %s)' % (self.name, self.loc.short()) + + def __str__(self): + return self.name + + @property + def is_temp(self): + return self.name.startswith("$") + + @property + def unversioned_name(self): + """The unversioned name of this variable, i.e. SSA renaming removed + """ + for k, redef_set in self.scope.var_redefinitions.items(): + if self.name in redef_set: + return k + return self.name + + @property + def versioned_names(self): + """Known versioned names for this variable, i.e. known variable names in + the scope that have been formed from applying SSA to this variable + """ + return self.scope.get_versions_of(self.unversioned_name) + + @property + def all_names(self): + """All known versioned and unversioned names for this variable + """ + return self.versioned_names | {self.unversioned_name,} + + def __deepcopy__(self, memo): + out = Var(copy.deepcopy(self.scope, memo), self.name, self.loc) + memo[id(self)] = out + return out + + +class Scope(EqualityCheckMixin): + """ + Attributes + ----------- + - parent: Scope + Parent scope + + - localvars: VarMap + Scope-local variable map + + - loc: Loc + Start of scope location + + """ + + def __init__(self, parent, loc): + assert parent is None or isinstance(parent, Scope) + assert isinstance(loc, Loc) + self.parent = parent + self.localvars = VarMap() + self.loc = loc + self.redefined = defaultdict(int) + self.var_redefinitions = defaultdict(set) + + def define(self, name, loc): + """ + Define a variable + """ + v = Var(scope=self, name=name, loc=loc) + self.localvars.define(v.name, v) + return v + + def get(self, name): + """ + Refer to a variable. Returns the latest version. + """ + if name in self.redefined: + name = "%s.%d" % (name, self.redefined[name]) + return self.get_exact(name) + + def get_exact(self, name): + """ + Refer to a variable. The returned variable has the exact + name (exact variable version). + """ + try: + return self.localvars.get(name) + except NotDefinedError: + if self.has_parent: + return self.parent.get(name) + else: + raise + + def get_or_define(self, name, loc): + if name in self.redefined: + name = "%s.%d" % (name, self.redefined[name]) + + if name not in self.localvars: + return self.define(name, loc) + else: + return self.localvars.get(name) + + def redefine(self, name, loc, rename=True): + """ + Redefine if the name is already defined + """ + if name not in self.localvars: + return self.define(name, loc) + elif not rename: + # Must use the same name if the variable is a cellvar, which + # means it could be captured in a closure. + return self.localvars.get(name) + else: + while True: + ct = self.redefined[name] + self.redefined[name] = ct + 1 + newname = "%s.%d" % (name, ct + 1) + try: + res = self.define(newname, loc) + except RedefinedError: + continue + else: + self.var_redefinitions[name].add(newname) + return res + + def get_versions_of(self, name): + """ + Gets all known versions of a given name + """ + vers = set() + def walk(thename): + redefs = self.var_redefinitions.get(thename, None) + if redefs: + for v in redefs: + vers.add(v) + walk(v) + walk(name) + return vers + + def make_temp(self, loc): + n = len(self.localvars) + v = Var(scope=self, name='$%d' % n, loc=loc) + self.localvars.define(v.name, v) + return v + + @property + def has_parent(self): + return self.parent is not None + + def __repr__(self): + return "Scope(has_parent=%r, num_vars=%d, %s)" % (self.has_parent, + len(self.localvars), + self.loc) + + +class Block(EqualityCheckMixin): + """A code block + + """ + + def __init__(self, scope, loc): + assert isinstance(scope, Scope) + assert isinstance(loc, Loc) + self.scope = scope + self.body = [] + self.loc = loc + + def copy(self): + block = Block(self.scope, self.loc) + block.body = self.body[:] + return block + + def find_exprs(self, op=None): + """ + Iterate over exprs of the given *op* in this block. + """ + for inst in self.body: + if isinstance(inst, Assign): + expr = inst.value + if isinstance(expr, Expr): + if op is None or expr.op == op: + yield expr + + def find_insts(self, cls=None): + """ + Iterate over insts of the given class in this block. + """ + for inst in self.body: + if isinstance(inst, cls): + yield inst + + def find_variable_assignment(self, name): + """ + Returns the assignment inst associated with variable "name", None if + it cannot be found. + """ + for x in self.find_insts(cls=Assign): + if x.target.name == name: + return x + return None + + def prepend(self, inst): + assert isinstance(inst, Stmt) + self.body.insert(0, inst) + + def append(self, inst): + assert isinstance(inst, Stmt) + self.body.append(inst) + + def remove(self, inst): + assert isinstance(inst, Stmt) + del self.body[self.body.index(inst)] + + def clear(self): + del self.body[:] + + def dump(self, file=None): + # Avoid early bind of sys.stdout as default value + file = file or sys.stdout + for inst in self.body: + if hasattr(inst, 'dump'): + inst.dump(file) + else: + inst_vars = sorted(str(v) for v in inst.list_vars()) + print(' %-40s %s' % (inst, inst_vars), file=file) + + @property + def terminator(self): + return self.body[-1] + + @property + def is_terminated(self): + return self.body and self.body[-1].is_terminator + + def verify(self): + if not self.is_terminated: + raise VerificationError("Missing block terminator") + # Only the last instruction can be a terminator + for inst in self.body[:-1]: + if inst.is_terminator: + raise VerificationError("Terminator before the last " + "instruction") + + def insert_after(self, stmt, other): + """ + Insert *stmt* after *other*. + """ + index = self.body.index(other) + self.body.insert(index + 1, stmt) + + def insert_before_terminator(self, stmt): + assert isinstance(stmt, Stmt) + assert self.is_terminated + self.body.insert(-1, stmt) + + def __repr__(self): + return "" % (self.loc,) + + +class Loop(SlotEqualityCheckMixin): + """Describes a loop-block + """ + __slots__ = "entry", "exit" + + def __init__(self, entry, exit): + self.entry = entry + self.exit = exit + + def __repr__(self): + args = self.entry, self.exit + return "Loop(entry=%s, exit=%s)" % args + + +class With(SlotEqualityCheckMixin): + """Describes a with-block + """ + __slots__ = "entry", "exit" + + def __init__(self, entry, exit): + self.entry = entry + self.exit = exit + + def __repr__(self): + args = self.entry, self.exit + return "With(entry=%s, exit=%s)" % args + + +class FunctionIR(object): + + def __init__(self, blocks, is_generator, func_id, loc, + definitions, arg_count, arg_names): + self.blocks = blocks + self.is_generator = is_generator + self.func_id = func_id + self.loc = loc + self.arg_count = arg_count + self.arg_names = arg_names + + self._definitions = definitions + + self._reset_analysis_variables() + + def equal_ir(self, other): + """ Checks that the IR contained within is equal to the IR in other. + Equality is defined by being equal in fundamental structure (blocks, + labels, IR node type and the order in which they are defined) and the + IR nodes being equal. IR node equality essentially comes down to + ensuring a node's `.__dict__` or `.__slots__` is equal, with the + exception of ignoring 'loc' and 'scope' entries. The upshot is that the + comparison is essentially location and scope invariant, but otherwise + behaves as unsurprisingly as possible. + """ + if type(self) is type(other): + return self.blocks == other.blocks + return False + + def diff_str(self, other): + """ + Compute a human readable difference in the IR, returns a formatted + string ready for printing. + """ + msg = [] + for label, block in self.blocks.items(): + other_blk = other.blocks.get(label, None) + if other_blk is not None: + if block != other_blk: + msg.append(("Block %s differs" % label).center(80, '-')) + # see if the instructions are just a permutation + block_del = [x for x in block.body if isinstance(x, Del)] + oth_del = [x for x in other_blk.body if isinstance(x, Del)] + if block_del != oth_del: + # this is a common issue, dels are all present, but + # order shuffled. + if sorted(block_del) == sorted(oth_del): + msg.append(("Block %s contains the same dels but " + "their order is different") % label) + if len(block.body) > len(other_blk.body): + msg.append("This block contains more statements") + elif len(block.body) < len(other_blk.body): + msg.append("Other block contains more statements") + + # find the indexes where they don't match + tmp = [] + for idx, stmts in enumerate(zip(block.body, + other_blk.body)): + b_s, o_s = stmts + if b_s != o_s: + tmp.append(idx) + + def get_pad(ablock, l): + pointer = '-> ' + sp = len(pointer) * ' ' + pad = [] + nstmt = len(ablock) + for i in range(nstmt): + if i in tmp: + item = pointer + elif i >= l: + item = pointer + else: + item = sp + pad.append(item) + return pad + + min_stmt_len = min(len(block.body), len(other_blk.body)) + + with StringIO() as buf: + it = [("self", block), ("other", other_blk)] + for name, _block in it: + buf.truncate(0) + _block.dump(file=buf) + stmts = buf.getvalue().splitlines() + pad = get_pad(_block.body, min_stmt_len) + title = ("%s: block %s" % (name, label)) + msg.append(title.center(80, '-')) + msg.extend(["{0}{1}".format(a, b) for a, b in + zip(pad, stmts)]) + if msg == []: + msg.append("IR is considered equivalent.") + return '\n'.join(msg) + + def _reset_analysis_variables(self): + + self._consts = consts.ConstantInference(self) + + # Will be computed by PostProcessor + self.generator_info = None + self.variable_lifetime = None + # { ir.Block: { variable names (potentially) alive at start of block } } + self.block_entry_vars = {} + + def derive(self, blocks, arg_count=None, arg_names=None, + force_non_generator=False, loc=None): + """ + Derive a new function IR from this one, using the given blocks, + and possibly modifying the argument count and generator flag. + + Post-processing will have to be run again on the new IR. + """ + firstblock = blocks[min(blocks)] + + new_ir = copy.copy(self) + new_ir.blocks = blocks + new_ir.loc = firstblock.loc if loc is None else loc + if force_non_generator: + new_ir.is_generator = False + if arg_count is not None: + new_ir.arg_count = arg_count + if arg_names is not None: + new_ir.arg_names = arg_names + new_ir._reset_analysis_variables() + # Make fresh func_id + new_ir.func_id = new_ir.func_id.derive() + return new_ir + + def copy(self): + new_ir = copy.copy(self) + blocks = {} + block_entry_vars = {} + for label, block in self.blocks.items(): + new_block = block.copy() + blocks[label] = new_block + if block in self.block_entry_vars: + block_entry_vars[new_block] = self.block_entry_vars[block] + new_ir.blocks = blocks + new_ir.block_entry_vars = block_entry_vars + return new_ir + + def get_block_entry_vars(self, block): + """ + Return a set of variable names possibly alive at the beginning of + the block. + """ + return self.block_entry_vars[block] + + def infer_constant(self, name): + """ + Try to infer the constant value of a given variable. + """ + if isinstance(name, Var): + name = name.name + return self._consts.infer_constant(name) + + def get_definition(self, value, lhs_only=False): + """ + Get the definition site for the given variable name or instance. + A Expr instance is returned by default, but if lhs_only is set + to True, the left-hand-side variable is returned instead. + """ + lhs = value + while True: + if isinstance(value, Var): + lhs = value + name = value.name + elif isinstance(value, str): + lhs = value + name = value + else: + return lhs if lhs_only else value + defs = self._definitions[name] + if len(defs) == 0: + raise KeyError("no definition for %r" + % (name,)) + if len(defs) > 1: + raise KeyError("more than one definition for %r" + % (name,)) + value = defs[0] + + def get_assignee(self, rhs_value, in_blocks=None): + """ + Finds the assignee for a given RHS value. If in_blocks is given the + search will be limited to the specified blocks. + """ + if in_blocks is None: + blocks = self.blocks.values() + elif isinstance(in_blocks, int): + blocks = [self.blocks[in_blocks]] + else: + blocks = [self.blocks[blk] for blk in list(in_blocks)] + + assert isinstance(rhs_value, AbstractRHS) + + for blk in blocks: + for assign in blk.find_insts(Assign): + if assign.value == rhs_value: + return assign.target + + raise ValueError("Could not find an assignee for %s" % rhs_value) + + + def dump(self, file=None): + nofile = file is None + # Avoid early bind of sys.stdout as default value + file = file or StringIO() + for offset, block in sorted(self.blocks.items()): + print('label %s:' % (offset,), file=file) + block.dump(file=file) + if nofile: + text = file.getvalue() + if config.HIGHLIGHT_DUMPS: + try: + import pygments + except ImportError: + msg = "Please install pygments to see highlighted dumps" + raise ValueError(msg) + else: + from pygments import highlight + from numba.misc.dump_style import NumbaIRLexer as lexer + from numba.misc.dump_style import by_colorscheme + from pygments.formatters import Terminal256Formatter + print(highlight(text, lexer(), Terminal256Formatter( + style=by_colorscheme()))) + else: + print(text) + + + def dump_to_string(self): + with StringIO() as sb: + self.dump(file=sb) + return sb.getvalue() + + def dump_generator_info(self, file=None): + file = file or sys.stdout + gi = self.generator_info + print("generator state variables:", sorted(gi.state_vars), file=file) + for index, yp in sorted(gi.yield_points.items()): + print("yield point #%d: live variables = %s, weak live variables = %s" + % (index, sorted(yp.live_vars), sorted(yp.weak_live_vars)), + file=file) + + def render_dot(self, filename_prefix="numba_ir", include_ir=True): + """Render the CFG of the IR with GraphViz DOT via the + ``graphviz`` python binding. + + Returns + ------- + g : graphviz.Digraph + Use `g.view()` to open the graph in the default PDF application. + """ + + try: + import graphviz as gv + except ImportError: + raise ImportError( + "The feature requires `graphviz` but it is not available. " + "Please install with `pip install graphviz`" + ) + g = gv.Digraph( + filename="{}{}.dot".format( + filename_prefix, + self.func_id.unique_name, + ) + ) + # Populate the nodes + for k, blk in self.blocks.items(): + with StringIO() as sb: + blk.dump(sb) + label = sb.getvalue() + if include_ir: + label = ''.join( + [r' {}\l'.format(x) for x in label.splitlines()], + ) + label = r"block {}\l".format(k) + label + g.node(str(k), label=label, shape='rect') + else: + label = r"{}\l".format(k) + g.node(str(k), label=label, shape='circle') + # Populate the edges + for src, blk in self.blocks.items(): + for dst in blk.terminator.get_targets(): + g.edge(str(src), str(dst)) + return g + + +# A stub for undefined global reference +class UndefinedType(EqualityCheckMixin): + + _singleton = None + + def __new__(cls): + obj = cls._singleton + if obj is not None: + return obj + else: + obj = object.__new__(cls) + cls._singleton = obj + return obj + + def __repr__(self): + return "Undefined" + + +UNDEFINED = UndefinedType() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/ir_utils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/ir_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..063badd3bd575e3757f752a1ee49b10818abefc6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/ir_utils.py @@ -0,0 +1,2409 @@ +# +# Copyright (c) 2017 Intel Corporation +# SPDX-License-Identifier: BSD-2-Clause +# + +import numpy +import math + +import types as pytypes +import collections +import warnings + +import numba +from numba.core.extending import _Intrinsic +from numba.core import types, typing, ir, analysis, postproc, rewrites, config +from numba.core.typing.templates import signature +from numba.core.analysis import (compute_live_map, compute_use_defs, + compute_cfg_from_blocks) +from numba.core.errors import (TypingError, UnsupportedError, + NumbaPendingDeprecationWarning, + CompilerError) + +import copy + +_unique_var_count = 0 + + +def mk_unique_var(prefix): + global _unique_var_count + var = prefix + "." + str(_unique_var_count) + _unique_var_count = _unique_var_count + 1 + return var + + +class _MaxLabel: + def __init__(self, value=0): + self._value = value + + def next(self): + self._value += 1 + return self._value + + def update(self, newval): + self._value = max(newval, self._value) + + +_the_max_label = _MaxLabel() +del _MaxLabel + + +def get_unused_var_name(prefix, var_table): + """ Get a new var name with a given prefix and + make sure it is unused in the given variable table. + """ + cur = 0 + while True: + var = prefix + str(cur) + if var not in var_table: + return var + cur += 1 + + +def next_label(): + return _the_max_label.next() + + +def mk_alloc(typingctx, typemap, calltypes, lhs, size_var, dtype, scope, loc, + lhs_typ): + """generate an array allocation with np.empty() and return list of nodes. + size_var can be an int variable or tuple of int variables. + lhs_typ is the type of the array being allocated. + """ + out = [] + ndims = 1 + size_typ = types.intp + if isinstance(size_var, tuple): + if len(size_var) == 1: + size_var = size_var[0] + size_var = convert_size_to_var(size_var, typemap, scope, loc, out) + else: + # tuple_var = build_tuple([size_var...]) + ndims = len(size_var) + tuple_var = ir.Var(scope, mk_unique_var("$tuple_var"), loc) + if typemap: + typemap[tuple_var.name] = types.containers.UniTuple( + types.intp, ndims) + # constant sizes need to be assigned to vars + new_sizes = [convert_size_to_var(s, typemap, scope, loc, out) + for s in size_var] + tuple_call = ir.Expr.build_tuple(new_sizes, loc) + tuple_assign = ir.Assign(tuple_call, tuple_var, loc) + out.append(tuple_assign) + size_var = tuple_var + size_typ = types.containers.UniTuple(types.intp, ndims) + if hasattr(lhs_typ, "__allocate__"): + return lhs_typ.__allocate__( + typingctx, + typemap, + calltypes, + lhs, + size_var, + dtype, + scope, + loc, + lhs_typ, + size_typ, + out, + ) + # g_np_var = Global(numpy) + g_np_var = ir.Var(scope, mk_unique_var("$np_g_var"), loc) + if typemap: + typemap[g_np_var.name] = types.misc.Module(numpy) + g_np = ir.Global('np', numpy, loc) + g_np_assign = ir.Assign(g_np, g_np_var, loc) + # attr call: empty_attr = getattr(g_np_var, empty) + empty_attr_call = ir.Expr.getattr(g_np_var, "empty", loc) + attr_var = ir.Var(scope, mk_unique_var("$empty_attr_attr"), loc) + if typemap: + typemap[attr_var.name] = get_np_ufunc_typ(numpy.empty) + attr_assign = ir.Assign(empty_attr_call, attr_var, loc) + # Assume str(dtype) returns a valid type + dtype_str = str(dtype) + # alloc call: lhs = empty_attr(size_var, typ_var) + typ_var = ir.Var(scope, mk_unique_var("$np_typ_var"), loc) + if typemap: + typemap[typ_var.name] = types.functions.NumberClass(dtype) + # If dtype is a datetime/timedelta with a unit, + # then it won't return a valid type and instead can be created + # with a string. i.e. "datetime64[ns]") + if (isinstance(dtype, (types.NPDatetime, types.NPTimedelta)) and + dtype.unit != ''): + typename_const = ir.Const(dtype_str, loc) + typ_var_assign = ir.Assign(typename_const, typ_var, loc) + else: + if dtype_str=='bool': + # empty doesn't like 'bool' sometimes (e.g. kmeans example) + dtype_str = 'bool_' + np_typ_getattr = ir.Expr.getattr(g_np_var, dtype_str, loc) + typ_var_assign = ir.Assign(np_typ_getattr, typ_var, loc) + alloc_call = ir.Expr.call(attr_var, [size_var, typ_var], (), loc) + + if calltypes: + cac = typemap[attr_var.name].get_call_type( + typingctx, [size_typ, types.functions.NumberClass(dtype)], {}) + # By default, all calls to "empty" are typed as returning a standard + # NumPy ndarray. If we are allocating a ndarray subclass here then + # just change the return type to be that of the subclass. + cac._return_type = (lhs_typ.copy(layout='C') + if lhs_typ.layout == 'F' + else lhs_typ) + calltypes[alloc_call] = cac + if lhs_typ.layout == 'F': + empty_c_typ = lhs_typ.copy(layout='C') + empty_c_var = ir.Var(scope, mk_unique_var("$empty_c_var"), loc) + if typemap: + typemap[empty_c_var.name] = lhs_typ.copy(layout='C') + empty_c_assign = ir.Assign(alloc_call, empty_c_var, loc) + + # attr call: asfortranarray = getattr(g_np_var, asfortranarray) + asfortranarray_attr_call = ir.Expr.getattr(g_np_var, "asfortranarray", loc) + afa_attr_var = ir.Var(scope, mk_unique_var("$asfortran_array_attr"), loc) + if typemap: + typemap[afa_attr_var.name] = get_np_ufunc_typ(numpy.asfortranarray) + afa_attr_assign = ir.Assign(asfortranarray_attr_call, afa_attr_var, loc) + # call asfortranarray + asfortranarray_call = ir.Expr.call(afa_attr_var, [empty_c_var], (), loc) + if calltypes: + calltypes[asfortranarray_call] = typemap[afa_attr_var.name].get_call_type( + typingctx, [empty_c_typ], {}) + + asfortranarray_assign = ir.Assign(asfortranarray_call, lhs, loc) + + out.extend([g_np_assign, attr_assign, typ_var_assign, empty_c_assign, + afa_attr_assign, asfortranarray_assign]) + else: + alloc_assign = ir.Assign(alloc_call, lhs, loc) + out.extend([g_np_assign, attr_assign, typ_var_assign, alloc_assign]) + + return out + + +def convert_size_to_var(size_var, typemap, scope, loc, nodes): + if isinstance(size_var, int): + new_size = ir.Var(scope, mk_unique_var("$alloc_size"), loc) + if typemap: + typemap[new_size.name] = types.intp + size_assign = ir.Assign(ir.Const(size_var, loc), new_size, loc) + nodes.append(size_assign) + return new_size + assert isinstance(size_var, ir.Var) + return size_var + + +def get_np_ufunc_typ(func): + """get type of the incoming function from builtin registry""" + for (k, v) in typing.npydecl.registry.globals: + if k == func: + return v + for (k, v) in typing.templates.builtin_registry.globals: + if k == func: + return v + raise RuntimeError("type for func ", func, " not found") + + +def mk_range_block(typemap, start, stop, step, calltypes, scope, loc): + """make a block that initializes loop range and iteration variables. + target label in jump needs to be set. + """ + # g_range_var = Global(range) + g_range_var = ir.Var(scope, mk_unique_var("$range_g_var"), loc) + typemap[g_range_var.name] = get_global_func_typ(range) + g_range = ir.Global('range', range, loc) + g_range_assign = ir.Assign(g_range, g_range_var, loc) + arg_nodes, args = _mk_range_args(typemap, start, stop, step, scope, loc) + # range_call_var = call g_range_var(start, stop, step) + range_call = ir.Expr.call(g_range_var, args, (), loc) + calltypes[range_call] = typemap[g_range_var.name].get_call_type( + typing.Context(), [types.intp] * len(args), {}) + #signature(types.range_state64_type, types.intp) + range_call_var = ir.Var(scope, mk_unique_var("$range_c_var"), loc) + typemap[range_call_var.name] = types.iterators.RangeType(types.intp) + range_call_assign = ir.Assign(range_call, range_call_var, loc) + # iter_var = getiter(range_call_var) + iter_call = ir.Expr.getiter(range_call_var, loc) + if config.USE_LEGACY_TYPE_SYSTEM: + calltype_sig = signature(types.range_iter64_type, types.range_state64_type) + else: + calltype_sig = signature(types.range_iter_type, types.range_state_type) + calltypes[iter_call] = calltype_sig + iter_var = ir.Var(scope, mk_unique_var("$iter_var"), loc) + typemap[iter_var.name] = types.iterators.RangeIteratorType(types.intp) + iter_call_assign = ir.Assign(iter_call, iter_var, loc) + # $phi = iter_var + phi_var = ir.Var(scope, mk_unique_var("$phi"), loc) + typemap[phi_var.name] = types.iterators.RangeIteratorType(types.intp) + phi_assign = ir.Assign(iter_var, phi_var, loc) + # jump to header + jump_header = ir.Jump(-1, loc) + range_block = ir.Block(scope, loc) + range_block.body = arg_nodes + [g_range_assign, range_call_assign, + iter_call_assign, phi_assign, jump_header] + return range_block + + +def _mk_range_args(typemap, start, stop, step, scope, loc): + nodes = [] + if isinstance(stop, ir.Var): + g_stop_var = stop + else: + assert isinstance(stop, int) + g_stop_var = ir.Var(scope, mk_unique_var("$range_stop"), loc) + if typemap: + typemap[g_stop_var.name] = types.intp + stop_assign = ir.Assign(ir.Const(stop, loc), g_stop_var, loc) + nodes.append(stop_assign) + if start == 0 and step == 1: + return nodes, [g_stop_var] + + if isinstance(start, ir.Var): + g_start_var = start + else: + assert isinstance(start, int) + g_start_var = ir.Var(scope, mk_unique_var("$range_start"), loc) + if typemap: + typemap[g_start_var.name] = types.intp + start_assign = ir.Assign(ir.Const(start, loc), g_start_var, loc) + nodes.append(start_assign) + if step == 1: + return nodes, [g_start_var, g_stop_var] + + if isinstance(step, ir.Var): + g_step_var = step + else: + assert isinstance(step, int) + g_step_var = ir.Var(scope, mk_unique_var("$range_step"), loc) + if typemap: + typemap[g_step_var.name] = types.intp + step_assign = ir.Assign(ir.Const(step, loc), g_step_var, loc) + nodes.append(step_assign) + + return nodes, [g_start_var, g_stop_var, g_step_var] + + +def get_global_func_typ(func): + """get type variable for func() from builtin registry""" + for (k, v) in typing.templates.builtin_registry.globals: + if k == func: + return v + raise RuntimeError("func type not found {}".format(func)) + + +def mk_loop_header(typemap, phi_var, calltypes, scope, loc): + """make a block that is a loop header updating iteration variables. + target labels in branch need to be set. + """ + # iternext_var = iternext(phi_var) + iternext_var = ir.Var(scope, mk_unique_var("$iternext_var"), loc) + typemap[iternext_var.name] = types.containers.Pair( + types.intp, types.boolean) + iternext_call = ir.Expr.iternext(phi_var, loc) + if config.USE_LEGACY_TYPE_SYSTEM: + range_iter_type = types.range_iter64_type + else: + range_iter_type = types.range_iter_type + calltypes[iternext_call] = signature( + types.containers.Pair( + types.intp, + types.boolean), + range_iter_type) + iternext_assign = ir.Assign(iternext_call, iternext_var, loc) + # pair_first_var = pair_first(iternext_var) + pair_first_var = ir.Var(scope, mk_unique_var("$pair_first_var"), loc) + typemap[pair_first_var.name] = types.intp + pair_first_call = ir.Expr.pair_first(iternext_var, loc) + pair_first_assign = ir.Assign(pair_first_call, pair_first_var, loc) + # pair_second_var = pair_second(iternext_var) + pair_second_var = ir.Var(scope, mk_unique_var("$pair_second_var"), loc) + typemap[pair_second_var.name] = types.boolean + pair_second_call = ir.Expr.pair_second(iternext_var, loc) + pair_second_assign = ir.Assign(pair_second_call, pair_second_var, loc) + # phi_b_var = pair_first_var + phi_b_var = ir.Var(scope, mk_unique_var("$phi"), loc) + typemap[phi_b_var.name] = types.intp + phi_b_assign = ir.Assign(pair_first_var, phi_b_var, loc) + # branch pair_second_var body_block out_block + branch = ir.Branch(pair_second_var, -1, -1, loc) + header_block = ir.Block(scope, loc) + header_block.body = [iternext_assign, pair_first_assign, + pair_second_assign, phi_b_assign, branch] + return header_block + + +def legalize_names(varnames): + """returns a dictionary for conversion of variable names to legal + parameter names. + """ + var_map = {} + for var in varnames: + new_name = var.replace("_", "__").replace("$", "_").replace(".", "_") + assert new_name not in var_map + var_map[var] = new_name + return var_map + + +def get_name_var_table(blocks): + """create a mapping from variable names to their ir.Var objects""" + def get_name_var_visit(var, namevar): + namevar[var.name] = var + return var + namevar = {} + visit_vars(blocks, get_name_var_visit, namevar) + return namevar + + +def replace_var_names(blocks, namedict): + """replace variables (ir.Var to ir.Var) from dictionary (name -> name)""" + # remove identity values to avoid infinite loop + new_namedict = {} + for l, r in namedict.items(): + if l != r: + new_namedict[l] = r + + def replace_name(var, namedict): + assert isinstance(var, ir.Var) + while var.name in namedict: + var = ir.Var(var.scope, namedict[var.name], var.loc) + return var + visit_vars(blocks, replace_name, new_namedict) + + +def replace_var_callback(var, vardict): + assert isinstance(var, ir.Var) + while var.name in vardict.keys(): + assert(vardict[var.name].name != var.name) + new_var = vardict[var.name] + var = ir.Var(new_var.scope, new_var.name, new_var.loc) + return var + + +def replace_vars(blocks, vardict): + """replace variables (ir.Var to ir.Var) from dictionary (name -> ir.Var)""" + # remove identity values to avoid infinite loop + new_vardict = {} + for l, r in vardict.items(): + if l != r.name: + new_vardict[l] = r + visit_vars(blocks, replace_var_callback, new_vardict) + + +def replace_vars_stmt(stmt, vardict): + visit_vars_stmt(stmt, replace_var_callback, vardict) + + +def replace_vars_inner(node, vardict): + return visit_vars_inner(node, replace_var_callback, vardict) + + +# other packages that define new nodes add calls to visit variables in them +# format: {type:function} +visit_vars_extensions = {} + + +def visit_vars(blocks, callback, cbdata): + """go over statements of block bodies and replace variable names with + dictionary. + """ + for block in blocks.values(): + for stmt in block.body: + visit_vars_stmt(stmt, callback, cbdata) + return + + +def visit_vars_stmt(stmt, callback, cbdata): + # let external calls handle stmt if type matches + for t, f in visit_vars_extensions.items(): + if isinstance(stmt, t): + f(stmt, callback, cbdata) + return + if isinstance(stmt, ir.Assign): + stmt.target = visit_vars_inner(stmt.target, callback, cbdata) + stmt.value = visit_vars_inner(stmt.value, callback, cbdata) + elif isinstance(stmt, ir.Arg): + stmt.name = visit_vars_inner(stmt.name, callback, cbdata) + elif isinstance(stmt, ir.Return): + stmt.value = visit_vars_inner(stmt.value, callback, cbdata) + elif isinstance(stmt, ir.Raise): + stmt.exception = visit_vars_inner(stmt.exception, callback, cbdata) + elif isinstance(stmt, ir.Branch): + stmt.cond = visit_vars_inner(stmt.cond, callback, cbdata) + elif isinstance(stmt, ir.Jump): + stmt.target = visit_vars_inner(stmt.target, callback, cbdata) + elif isinstance(stmt, ir.Del): + # Because Del takes only a var name, we make up by + # constructing a temporary variable. + var = ir.Var(None, stmt.value, stmt.loc) + var = visit_vars_inner(var, callback, cbdata) + stmt.value = var.name + elif isinstance(stmt, ir.DelAttr): + stmt.target = visit_vars_inner(stmt.target, callback, cbdata) + stmt.attr = visit_vars_inner(stmt.attr, callback, cbdata) + elif isinstance(stmt, ir.SetAttr): + stmt.target = visit_vars_inner(stmt.target, callback, cbdata) + stmt.attr = visit_vars_inner(stmt.attr, callback, cbdata) + stmt.value = visit_vars_inner(stmt.value, callback, cbdata) + elif isinstance(stmt, ir.DelItem): + stmt.target = visit_vars_inner(stmt.target, callback, cbdata) + stmt.index = visit_vars_inner(stmt.index, callback, cbdata) + elif isinstance(stmt, ir.StaticSetItem): + stmt.target = visit_vars_inner(stmt.target, callback, cbdata) + stmt.index_var = visit_vars_inner(stmt.index_var, callback, cbdata) + stmt.value = visit_vars_inner(stmt.value, callback, cbdata) + elif isinstance(stmt, ir.SetItem): + stmt.target = visit_vars_inner(stmt.target, callback, cbdata) + stmt.index = visit_vars_inner(stmt.index, callback, cbdata) + stmt.value = visit_vars_inner(stmt.value, callback, cbdata) + elif isinstance(stmt, ir.Print): + stmt.args = [visit_vars_inner(x, callback, cbdata) for x in stmt.args] + else: + # TODO: raise NotImplementedError("no replacement for IR node: ", stmt) + pass + return + + +def visit_vars_inner(node, callback, cbdata): + if isinstance(node, ir.Var): + return callback(node, cbdata) + elif isinstance(node, list): + return [visit_vars_inner(n, callback, cbdata) for n in node] + elif isinstance(node, tuple): + return tuple([visit_vars_inner(n, callback, cbdata) for n in node]) + elif isinstance(node, ir.Expr): + # if node.op in ['binop', 'inplace_binop']: + # lhs = node.lhs.name + # rhs = node.rhs.name + # node.lhs.name = callback, cbdata.get(lhs, lhs) + # node.rhs.name = callback, cbdata.get(rhs, rhs) + for arg in node._kws.keys(): + node._kws[arg] = visit_vars_inner(node._kws[arg], callback, cbdata) + elif isinstance(node, ir.Yield): + node.value = visit_vars_inner(node.value, callback, cbdata) + return node + + +add_offset_to_labels_extensions = {} + + +def add_offset_to_labels(blocks, offset): + """add an offset to all block labels and jump/branch targets + """ + new_blocks = {} + for l, b in blocks.items(): + # some parfor last blocks might be empty + term = None + if b.body: + term = b.body[-1] + for inst in b.body: + for T, f in add_offset_to_labels_extensions.items(): + if isinstance(inst, T): + f_max = f(inst, offset) + if isinstance(term, ir.Jump): + b.body[-1] = ir.Jump(term.target + offset, term.loc) + if isinstance(term, ir.Branch): + b.body[-1] = ir.Branch(term.cond, term.truebr + offset, + term.falsebr + offset, term.loc) + new_blocks[l + offset] = b + return new_blocks + + +find_max_label_extensions = {} + + +def find_max_label(blocks): + max_label = 0 + for l, b in blocks.items(): + term = None + if b.body: + term = b.body[-1] + for inst in b.body: + for T, f in find_max_label_extensions.items(): + if isinstance(inst, T): + f_max = f(inst) + if f_max > max_label: + max_label = f_max + if l > max_label: + max_label = l + return max_label + + +def flatten_labels(blocks): + """makes the labels in range(0, len(blocks)), useful to compare CFGs + """ + # first bulk move the labels out of the rewrite range + blocks = add_offset_to_labels(blocks, find_max_label(blocks) + 1) + # order them in topo order because it's easier to read + new_blocks = {} + topo_order = find_topo_order(blocks) + l_map = dict() + idx = 0 + for x in topo_order: + l_map[x] = idx + idx += 1 + + for t_node in topo_order: + b = blocks[t_node] + # some parfor last blocks might be empty + term = None + if b.body: + term = b.body[-1] + if isinstance(term, ir.Jump): + b.body[-1] = ir.Jump(l_map[term.target], term.loc) + if isinstance(term, ir.Branch): + b.body[-1] = ir.Branch(term.cond, l_map[term.truebr], + l_map[term.falsebr], term.loc) + new_blocks[l_map[t_node]] = b + return new_blocks + + +def remove_dels(blocks): + """remove ir.Del nodes""" + for block in blocks.values(): + new_body = [] + for stmt in block.body: + if not isinstance(stmt, ir.Del): + new_body.append(stmt) + block.body = new_body + return + + +def remove_args(blocks): + """remove ir.Arg nodes""" + for block in blocks.values(): + new_body = [] + for stmt in block.body: + if isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Arg): + continue + new_body.append(stmt) + block.body = new_body + return + + +def dead_code_elimination(func_ir, typemap=None, alias_map=None, + arg_aliases=None): + """ Performs dead code elimination and leaves the IR in a valid state on + exit + """ + do_post_proc = False + while (remove_dead(func_ir.blocks, func_ir.arg_names, func_ir, typemap, + alias_map, arg_aliases)): + do_post_proc = True + + if do_post_proc: + post_proc = postproc.PostProcessor(func_ir) + post_proc.run() + + +def remove_dead(blocks, args, func_ir, typemap=None, alias_map=None, arg_aliases=None): + """dead code elimination using liveness and CFG info. + Returns True if something has been removed, or False if nothing is removed. + """ + cfg = compute_cfg_from_blocks(blocks) + usedefs = compute_use_defs(blocks) + live_map = compute_live_map(cfg, blocks, usedefs.usemap, usedefs.defmap) + call_table, _ = get_call_table(blocks) + if alias_map is None or arg_aliases is None: + alias_map, arg_aliases = find_potential_aliases(blocks, args, typemap, + func_ir) + if config.DEBUG_ARRAY_OPT >= 1: + print("args:", args) + print("alias map:", alias_map) + print("arg_aliases:", arg_aliases) + print("live_map:", live_map) + print("usemap:", usedefs.usemap) + print("defmap:", usedefs.defmap) + # keep set for easier search + alias_set = set(alias_map.keys()) + + removed = False + for label, block in blocks.items(): + # find live variables at each statement to delete dead assignment + lives = {v.name for v in block.terminator.list_vars()} + if config.DEBUG_ARRAY_OPT >= 2: + print("remove_dead processing block", label, lives) + # find live variables at the end of block + for out_blk, _data in cfg.successors(label): + if config.DEBUG_ARRAY_OPT >= 2: + print("succ live_map", out_blk, live_map[out_blk]) + lives |= live_map[out_blk] + removed |= remove_dead_block(block, lives, call_table, arg_aliases, + alias_map, alias_set, func_ir, typemap) + + return removed + + +# other packages that define new nodes add calls to remove dead code in them +# format: {type:function} +remove_dead_extensions = {} + + +def remove_dead_block(block, lives, call_table, arg_aliases, alias_map, + alias_set, func_ir, typemap): + """remove dead code using liveness info. + Mutable arguments (e.g. arrays) that are not definitely assigned are live + after return of function. + """ + # TODO: find mutable args that are not definitely assigned instead of + # assuming all args are live after return + removed = False + + # add statements in reverse order + new_body = [block.terminator] + # for each statement in reverse order, excluding terminator + for stmt in reversed(block.body[:-1]): + if config.DEBUG_ARRAY_OPT >= 2: + print("remove_dead_block", stmt) + # aliases of lives are also live + alias_lives = set() + init_alias_lives = lives & alias_set + for v in init_alias_lives: + alias_lives |= alias_map[v] + lives_n_aliases = lives | alias_lives | arg_aliases + + # let external calls handle stmt if type matches + if type(stmt) in remove_dead_extensions: + f = remove_dead_extensions[type(stmt)] + stmt = f(stmt, lives, lives_n_aliases, arg_aliases, alias_map, func_ir, + typemap) + if stmt is None: + if config.DEBUG_ARRAY_OPT >= 2: + print("Statement was removed.") + removed = True + continue + + # ignore assignments that their lhs is not live or lhs==rhs + if isinstance(stmt, ir.Assign): + lhs = stmt.target + rhs = stmt.value + if lhs.name not in lives and has_no_side_effect( + rhs, lives_n_aliases, call_table): + if config.DEBUG_ARRAY_OPT >= 2: + print("Statement was removed.") + removed = True + continue + if isinstance(rhs, ir.Var) and lhs.name == rhs.name: + if config.DEBUG_ARRAY_OPT >= 2: + print("Statement was removed.") + removed = True + continue + # TODO: remove other nodes like SetItem etc. + + if isinstance(stmt, ir.Del): + if stmt.value not in lives: + if config.DEBUG_ARRAY_OPT >= 2: + print("Statement was removed.") + removed = True + continue + + if isinstance(stmt, ir.SetItem): + name = stmt.target.name + if name not in lives_n_aliases: + if config.DEBUG_ARRAY_OPT >= 2: + print("Statement was removed.") + continue + + if type(stmt) in analysis.ir_extension_usedefs: + def_func = analysis.ir_extension_usedefs[type(stmt)] + uses, defs = def_func(stmt) + lives -= defs + lives |= uses + else: + lives |= {v.name for v in stmt.list_vars()} + if isinstance(stmt, ir.Assign): + # make sure lhs is not used in rhs, e.g. a = g(a) + if isinstance(stmt.value, ir.Expr): + rhs_vars = {v.name for v in stmt.value.list_vars()} + if lhs.name not in rhs_vars: + lives.remove(lhs.name) + else: + lives.remove(lhs.name) + + new_body.append(stmt) + new_body.reverse() + block.body = new_body + return removed + +# list of functions +remove_call_handlers = [] + +def remove_dead_random_call(rhs, lives, call_list): + if len(call_list) == 3 and call_list[1:] == ['random', numpy]: + return call_list[0] not in {'seed', 'shuffle'} + return False + +remove_call_handlers.append(remove_dead_random_call) + +def has_no_side_effect(rhs, lives, call_table): + """ Returns True if this expression has no side effects that + would prevent re-ordering. + """ + from numba.parfors import array_analysis, parfor + from numba.misc.special import prange + if isinstance(rhs, ir.Expr) and rhs.op == 'call': + func_name = rhs.func.name + if func_name not in call_table or call_table[func_name] == []: + return False + call_list = call_table[func_name] + if (call_list == ['empty', numpy] or + call_list == [slice] or + call_list == ['stencil', numba] or + call_list == ['log', numpy] or + call_list == ['dtype', numpy] or + call_list == [array_analysis.wrap_index] or + call_list == [prange] or + call_list == ['prange', numba] or + call_list == ['pndindex', numba] or + call_list == [parfor.internal_prange] or + call_list == ['ceil', math] or + call_list == [max] or + call_list == [int]): + return True + elif (isinstance(call_list[0], _Intrinsic) and + (call_list[0]._name == 'empty_inferred' or + call_list[0]._name == 'unsafe_empty_inferred')): + return True + from numba.core.registry import CPUDispatcher + from numba.np.linalg import dot_3_mv_check_args + if isinstance(call_list[0], CPUDispatcher): + py_func = call_list[0].py_func + if py_func == dot_3_mv_check_args: + return True + for f in remove_call_handlers: + if f(rhs, lives, call_list): + return True + return False + if isinstance(rhs, ir.Expr) and rhs.op == 'inplace_binop': + return rhs.lhs.name not in lives + if isinstance(rhs, ir.Yield): + return False + if isinstance(rhs, ir.Expr) and rhs.op == 'pair_first': + # don't remove pair_first since prange looks for it + return False + return True + +is_pure_extensions = [] + +def is_pure(rhs, lives, call_table): + """ Returns True if every time this expression is evaluated it + returns the same result. This is not the case for things + like calls to numpy.random. + """ + if isinstance(rhs, ir.Expr): + if rhs.op == 'call': + func_name = rhs.func.name + if func_name not in call_table or call_table[func_name] == []: + return False + call_list = call_table[func_name] + if (call_list == [slice] or + call_list == ['log', numpy] or + call_list == ['empty', numpy] or + call_list == ['ceil', math] or + call_list == [max] or + call_list == [int]): + return True + for f in is_pure_extensions: + if f(rhs, lives, call_list): + return True + return False + elif rhs.op == 'getiter' or rhs.op == 'iternext': + return False + if isinstance(rhs, ir.Yield): + return False + return True + +def is_const_call(module_name, func_name): + # Returns True if there is no state in the given module changed by the given function. + if module_name == 'numpy': + if func_name in ['empty']: + return True + return False + +alias_analysis_extensions = {} +alias_func_extensions = {} + +def get_canonical_alias(v, alias_map): + if v not in alias_map: + return v + + v_aliases = sorted(list(alias_map[v])) + return v_aliases[0] + +def find_potential_aliases(blocks, args, typemap, func_ir, alias_map=None, + arg_aliases=None): + "find all array aliases and argument aliases to avoid remove as dead" + if alias_map is None: + alias_map = {} + if arg_aliases is None: + arg_aliases = set(a for a in args if not is_immutable_type(a, typemap)) + + # update definitions since they are not guaranteed to be up-to-date + # FIXME keep definitions up-to-date to avoid the need for rebuilding + func_ir._definitions = build_definitions(func_ir.blocks) + np_alias_funcs = ['ravel', 'transpose', 'reshape'] + + for bl in blocks.values(): + for instr in bl.body: + if type(instr) in alias_analysis_extensions: + f = alias_analysis_extensions[type(instr)] + f(instr, args, typemap, func_ir, alias_map, arg_aliases) + if isinstance(instr, ir.Assign): + expr = instr.value + lhs = instr.target.name + # only mutable types can alias + if is_immutable_type(lhs, typemap): + continue + if isinstance(expr, ir.Var) and lhs!=expr.name: + _add_alias(lhs, expr.name, alias_map, arg_aliases) + # subarrays like A = B[0] for 2D B + if (isinstance(expr, ir.Expr) and (expr.op == 'cast' or + expr.op in ['getitem', 'static_getitem'])): + _add_alias(lhs, expr.value.name, alias_map, arg_aliases) + if isinstance(expr, ir.Expr) and expr.op == 'inplace_binop': + _add_alias(lhs, expr.lhs.name, alias_map, arg_aliases) + # array attributes like A.T + if (isinstance(expr, ir.Expr) and expr.op == 'getattr' + and expr.attr in ['T', 'ctypes', 'flat']): + _add_alias(lhs, expr.value.name, alias_map, arg_aliases) + # a = b.c. a should alias b + if (isinstance(expr, ir.Expr) and expr.op == 'getattr' + and expr.attr not in ['shape'] + and expr.value.name in arg_aliases): + _add_alias(lhs, expr.value.name, alias_map, arg_aliases) + # calls that can create aliases such as B = A.ravel() + if isinstance(expr, ir.Expr) and expr.op == 'call': + fdef = guard(find_callname, func_ir, expr, typemap) + # TODO: sometimes gufunc backend creates duplicate code + # causing find_callname to fail. Example: test_argmax + # ignored here since those cases don't create aliases + # but should be fixed in general + if fdef is None: + continue + fname, fmod = fdef + if fdef in alias_func_extensions: + alias_func = alias_func_extensions[fdef] + alias_func(lhs, expr.args, alias_map, arg_aliases) + if fmod == 'numpy' and fname in np_alias_funcs: + _add_alias(lhs, expr.args[0].name, alias_map, arg_aliases) + if isinstance(fmod, ir.Var) and fname in np_alias_funcs: + _add_alias(lhs, fmod.name, alias_map, arg_aliases) + + # copy to avoid changing size during iteration + old_alias_map = copy.deepcopy(alias_map) + # combine all aliases transitively + for v in old_alias_map: + for w in old_alias_map[v]: + alias_map[v] |= alias_map[w] + for w in old_alias_map[v]: + alias_map[w] = alias_map[v] + + return alias_map, arg_aliases + +def _add_alias(lhs, rhs, alias_map, arg_aliases): + if rhs in arg_aliases: + arg_aliases.add(lhs) + else: + if rhs not in alias_map: + alias_map[rhs] = set() + if lhs not in alias_map: + alias_map[lhs] = set() + alias_map[rhs].add(lhs) + alias_map[lhs].add(rhs) + return + +def is_immutable_type(var, typemap): + # Conservatively, assume mutable if type not available + if typemap is None or var not in typemap: + return False + typ = typemap[var] + # TODO: add more immutable types + if isinstance(typ, (types.Number, types.scalars._NPDatetimeBase, + types.iterators.RangeType)): + return True + if typ==types.string: + return True + # conservatively, assume mutable + return False + +def copy_propagate(blocks, typemap): + """compute copy propagation information for each block using fixed-point + iteration on data flow equations: + in_b = intersect(predec(B)) + out_b = gen_b | (in_b - kill_b) + """ + cfg = compute_cfg_from_blocks(blocks) + entry = cfg.entry_point() + + # format: dict of block labels to copies as tuples + # label -> (l,r) + c_data = init_copy_propagate_data(blocks, entry, typemap) + (gen_copies, all_copies, kill_copies, in_copies, out_copies) = c_data + + old_point = None + new_point = copy.deepcopy(out_copies) + # comparison works since dictionary of built-in types + while old_point != new_point: + for label in blocks.keys(): + if label == entry: + continue + predecs = [i for i, _d in cfg.predecessors(label)] + # in_b = intersect(predec(B)) + in_copies[label] = out_copies[predecs[0]].copy() + for p in predecs: + in_copies[label] &= out_copies[p] + + # out_b = gen_b | (in_b - kill_b) + out_copies[label] = (gen_copies[label] + | (in_copies[label] - kill_copies[label])) + old_point = new_point + new_point = copy.deepcopy(out_copies) + if config.DEBUG_ARRAY_OPT >= 1: + print("copy propagate out_copies:", out_copies) + return in_copies, out_copies + + +def init_copy_propagate_data(blocks, entry, typemap): + """get initial condition of copy propagation data flow for each block. + """ + # gen is all definite copies, extra_kill is additional ones that may hit + # for example, parfors can have control flow so they may hit extra copies + gen_copies, extra_kill = get_block_copies(blocks, typemap) + # set of all program copies + all_copies = set() + for l, s in gen_copies.items(): + all_copies |= gen_copies[l] + kill_copies = {} + for label, gen_set in gen_copies.items(): + kill_copies[label] = set() + for lhs, rhs in all_copies: + if lhs in extra_kill[label] or rhs in extra_kill[label]: + kill_copies[label].add((lhs, rhs)) + # a copy is killed if it is not in this block and lhs or rhs are + # assigned in this block + assigned = {lhs for lhs, rhs in gen_set} + if ((lhs, rhs) not in gen_set + and (lhs in assigned or rhs in assigned)): + kill_copies[label].add((lhs, rhs)) + # set initial values + # all copies are in for all blocks except entry + in_copies = {l: all_copies.copy() for l in blocks.keys()} + in_copies[entry] = set() + out_copies = {} + for label in blocks.keys(): + # out_b = gen_b | (in_b - kill_b) + out_copies[label] = (gen_copies[label] + | (in_copies[label] - kill_copies[label])) + out_copies[entry] = gen_copies[entry] + return (gen_copies, all_copies, kill_copies, in_copies, out_copies) + + +# other packages that define new nodes add calls to get copies in them +# format: {type:function} +copy_propagate_extensions = {} + + +def get_block_copies(blocks, typemap): + """get copies generated and killed by each block + """ + block_copies = {} + extra_kill = {} + for label, block in blocks.items(): + assign_dict = {} + extra_kill[label] = set() + # assignments as dict to replace with latest value + for stmt in block.body: + for T, f in copy_propagate_extensions.items(): + if isinstance(stmt, T): + gen_set, kill_set = f(stmt, typemap) + for lhs, rhs in gen_set: + assign_dict[lhs] = rhs + # if a=b is in dict and b is killed, a is also killed + new_assign_dict = {} + for l, r in assign_dict.items(): + if l not in kill_set and r not in kill_set: + new_assign_dict[l] = r + if r in kill_set: + extra_kill[label].add(l) + assign_dict = new_assign_dict + extra_kill[label] |= kill_set + if isinstance(stmt, ir.Assign): + lhs = stmt.target.name + if isinstance(stmt.value, ir.Var): + rhs = stmt.value.name + # copy is valid only if same type (see + # TestCFunc.test_locals) + # Some transformations can produce assignments of the + # form A = A. We don't put these mapping in the + # copy propagation set because then you get cycles and + # infinite loops in the replacement phase. + if typemap[lhs] == typemap[rhs] and lhs != rhs: + assign_dict[lhs] = rhs + continue + if isinstance(stmt.value, + ir.Expr) and stmt.value.op == 'inplace_binop': + in1_var = stmt.value.lhs.name + in1_typ = typemap[in1_var] + # inplace_binop assigns first operand if mutable + if not (isinstance(in1_typ, types.Number) + or in1_typ == types.string): + extra_kill[label].add(in1_var) + # if a=b is in dict and b is killed, a is also killed + new_assign_dict = {} + for l, r in assign_dict.items(): + if l != in1_var and r != in1_var: + new_assign_dict[l] = r + if r == in1_var: + extra_kill[label].add(l) + assign_dict = new_assign_dict + extra_kill[label].add(lhs) + block_cps = set(assign_dict.items()) + block_copies[label] = block_cps + return block_copies, extra_kill + + +# other packages that define new nodes add calls to apply copy propagate in them +# format: {type:function} +apply_copy_propagate_extensions = {} + + +def apply_copy_propagate(blocks, in_copies, name_var_table, typemap, calltypes, + save_copies=None): + """apply copy propagation to IR: replace variables when copies available""" + # save_copies keeps an approximation of the copies that were applied, so + # that the variable names of removed user variables can be recovered to some + # extent. + if save_copies is None: + save_copies = [] + + for label, block in blocks.items(): + var_dict = {l: name_var_table[r] for l, r in in_copies[label]} + # assignments as dict to replace with latest value + for stmt in block.body: + if type(stmt) in apply_copy_propagate_extensions: + f = apply_copy_propagate_extensions[type(stmt)] + f(stmt, var_dict, name_var_table, + typemap, calltypes, save_copies) + # only rhs of assignments should be replaced + # e.g. if x=y is available, x in x=z shouldn't be replaced + elif isinstance(stmt, ir.Assign): + stmt.value = replace_vars_inner(stmt.value, var_dict) + else: + replace_vars_stmt(stmt, var_dict) + fix_setitem_type(stmt, typemap, calltypes) + for T, f in copy_propagate_extensions.items(): + if isinstance(stmt, T): + gen_set, kill_set = f(stmt, typemap) + for lhs, rhs in gen_set: + if rhs in name_var_table: + var_dict[lhs] = name_var_table[rhs] + for l, r in var_dict.copy().items(): + if l in kill_set or r.name in kill_set: + var_dict.pop(l) + if isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Var): + lhs = stmt.target.name + rhs = stmt.value.name + # rhs could be replaced with lhs from previous copies + if lhs != rhs: + # copy is valid only if same type (see + # TestCFunc.test_locals) + if typemap[lhs] == typemap[rhs] and rhs in name_var_table: + var_dict[lhs] = name_var_table[rhs] + else: + var_dict.pop(lhs, None) + # a=b kills previous t=a + lhs_kill = [] + for k, v in var_dict.items(): + if v.name == lhs: + lhs_kill.append(k) + for k in lhs_kill: + var_dict.pop(k, None) + if (isinstance(stmt, ir.Assign) + and not isinstance(stmt.value, ir.Var)): + lhs = stmt.target.name + var_dict.pop(lhs, None) + # previous t=a is killed if a is killed + lhs_kill = [] + for k, v in var_dict.items(): + if v.name == lhs: + lhs_kill.append(k) + for k in lhs_kill: + var_dict.pop(k, None) + save_copies.extend(var_dict.items()) + + return save_copies + +def fix_setitem_type(stmt, typemap, calltypes): + """Copy propagation can replace setitem target variable, which can be array + with 'A' layout. The replaced variable can be 'C' or 'F', so we update + setitem call type reflect this (from matrix power test) + """ + if not isinstance(stmt, (ir.SetItem, ir.StaticSetItem)): + return + t_typ = typemap[stmt.target.name] + s_typ = calltypes[stmt].args[0] + # test_optional t_typ can be Optional with array + if not isinstance( + s_typ, + types.npytypes.Array) or not isinstance( + t_typ, + types.npytypes.Array): + return + if s_typ.layout == 'A' and t_typ.layout != 'A': + new_s_typ = s_typ.copy(layout=t_typ.layout) + calltypes[stmt].args = ( + new_s_typ, + calltypes[stmt].args[1], + calltypes[stmt].args[2]) + return + + +def dprint_func_ir(func_ir, title, blocks=None): + """Debug print function IR, with an optional blocks argument + that may differ from the IR's original blocks. + """ + if config.DEBUG_ARRAY_OPT >= 1: + ir_blocks = func_ir.blocks + func_ir.blocks = ir_blocks if blocks == None else blocks + name = func_ir.func_id.func_qualname + print(("IR %s: %s" % (title, name)).center(80, "-")) + func_ir.dump() + print("-" * 40) + func_ir.blocks = ir_blocks + + +def find_topo_order(blocks, cfg = None): + """find topological order of blocks such that true branches are visited + first (e.g. for_break test in test_dataflow). This is written as an iterative + implementation of post order traversal to avoid recursion limit issues. + """ + if cfg is None: + cfg = compute_cfg_from_blocks(blocks) + + post_order = [] + # Has the node already added its children? + seen = set() + # Has the node already been pushed to post order? + visited = set() + stack = [cfg.entry_point()] + + while len(stack) > 0: + node = stack[-1] + if node not in visited and node not in seen: + # We haven't added a node or its children. + seen.add(node) + succs = cfg._succs[node] + last_inst = blocks[node].body[-1] + if isinstance(last_inst, ir.Branch): + succs = [last_inst.truebr, last_inst.falsebr] + for dest in succs: + if (node, dest) not in cfg._back_edges: + if dest not in seen: + stack.append(dest) + else: + # This node has already added its children. We either need + # to visit the node or it has been added multiple times in + # which case we should just skip the node. + node = stack.pop() + if node not in visited: + post_order.append(node) + visited.add(node) + if node in seen: + # Remove the node from seen if it exists to limit the memory + # usage to 1 entry per node. Otherwise the memory requirement + # can double the recursive version. + seen.remove(node) + + post_order.reverse() + return post_order + + +# other packages that define new nodes add calls to get call table +# format: {type:function} +call_table_extensions = {} + + +def get_call_table(blocks, call_table=None, reverse_call_table=None, topological_ordering=True): + """returns a dictionary of call variables and their references. + """ + # call_table example: c = np.zeros becomes c:["zeroes", np] + # reverse_call_table example: c = np.zeros becomes np_var:c + if call_table is None: + call_table = {} + if reverse_call_table is None: + reverse_call_table = {} + + if topological_ordering: + order = find_topo_order(blocks) + else: + order = list(blocks.keys()) + + for label in reversed(order): + for inst in reversed(blocks[label].body): + if isinstance(inst, ir.Assign): + lhs = inst.target.name + rhs = inst.value + if isinstance(rhs, ir.Expr) and rhs.op == 'call': + call_table[rhs.func.name] = [] + if isinstance(rhs, ir.Expr) and rhs.op == 'getattr': + if lhs in call_table: + call_table[lhs].append(rhs.attr) + reverse_call_table[rhs.value.name] = lhs + if lhs in reverse_call_table: + call_var = reverse_call_table[lhs] + call_table[call_var].append(rhs.attr) + reverse_call_table[rhs.value.name] = call_var + if isinstance(rhs, ir.Global): + if lhs in call_table: + call_table[lhs].append(rhs.value) + if lhs in reverse_call_table: + call_var = reverse_call_table[lhs] + call_table[call_var].append(rhs.value) + if isinstance(rhs, ir.FreeVar): + if lhs in call_table: + call_table[lhs].append(rhs.value) + if lhs in reverse_call_table: + call_var = reverse_call_table[lhs] + call_table[call_var].append(rhs.value) + if isinstance(rhs, ir.Var): + if lhs in call_table: + call_table[lhs].append(rhs.name) + reverse_call_table[rhs.name] = lhs + if lhs in reverse_call_table: + call_var = reverse_call_table[lhs] + call_table[call_var].append(rhs.name) + for T, f in call_table_extensions.items(): + if isinstance(inst, T): + f(inst, call_table, reverse_call_table) + return call_table, reverse_call_table + + +# other packages that define new nodes add calls to get tuple table +# format: {type:function} +tuple_table_extensions = {} + + +def get_tuple_table(blocks, tuple_table=None): + """returns a dictionary of tuple variables and their values. + """ + if tuple_table is None: + tuple_table = {} + + for block in blocks.values(): + for inst in block.body: + if isinstance(inst, ir.Assign): + lhs = inst.target.name + rhs = inst.value + if isinstance(rhs, ir.Expr) and rhs.op == 'build_tuple': + tuple_table[lhs] = rhs.items + if isinstance(rhs, ir.Const) and isinstance(rhs.value, tuple): + tuple_table[lhs] = rhs.value + for T, f in tuple_table_extensions.items(): + if isinstance(inst, T): + f(inst, tuple_table) + return tuple_table + + +def get_stmt_writes(stmt): + writes = set() + if isinstance(stmt, (ir.Assign, ir.SetItem, ir.StaticSetItem)): + writes.add(stmt.target.name) + return writes + + +def rename_labels(blocks): + """rename labels of function body blocks according to topological sort. + The set of labels of these blocks will remain unchanged. + """ + topo_order = find_topo_order(blocks) + + # make a block with return last if available (just for readability) + return_label = -1 + for l, b in blocks.items(): + if isinstance(b.body[-1], ir.Return): + return_label = l + # some cases like generators can have no return blocks + if return_label != -1: + topo_order.remove(return_label) + topo_order.append(return_label) + + label_map = {} + all_labels = sorted(topo_order, reverse=True) + for label in topo_order: + label_map[label] = all_labels.pop() + # update target labels in jumps/branches + for b in blocks.values(): + term = b.terminator + # create new IR nodes instead of mutating the existing one as copies of + # the IR may also refer to the same nodes! + if isinstance(term, ir.Jump): + b.body[-1] = ir.Jump(label_map[term.target], term.loc) + if isinstance(term, ir.Branch): + b.body[-1] = ir.Branch(term.cond, + label_map[term.truebr], + label_map[term.falsebr], + term.loc) + + + + # update blocks dictionary keys + new_blocks = {} + for k, b in blocks.items(): + new_label = label_map[k] + new_blocks[new_label] = b + + return new_blocks + + +def simplify_CFG(blocks): + """transform chains of blocks that have no loop into a single block""" + # first, inline single-branch-block to its predecessors + cfg = compute_cfg_from_blocks(blocks) + def find_single_branch(label): + block = blocks[label] + return len(block.body) == 1 and isinstance(block.body[0], ir.Branch) + single_branch_blocks = list(filter(find_single_branch, blocks.keys())) + marked_for_del = set() + for label in single_branch_blocks: + inst = blocks[label].body[0] + predecessors = cfg.predecessors(label) + delete_block = True + for (p, q) in predecessors: + block = blocks[p] + if isinstance(block.body[-1], ir.Jump): + block.body[-1] = copy.copy(inst) + else: + delete_block = False + if delete_block: + marked_for_del.add(label) + # Delete marked labels + for label in marked_for_del: + del blocks[label] + merge_adjacent_blocks(blocks) + return rename_labels(blocks) + + +arr_math = ['min', 'max', 'sum', 'prod', 'mean', 'var', 'std', + 'cumsum', 'cumprod', 'argmax', 'argmin', 'argsort', + 'nonzero', 'ravel'] + + +def canonicalize_array_math(func_ir, typemap, calltypes, typingctx): + # save array arg to call + # call_varname -> array + blocks = func_ir.blocks + saved_arr_arg = {} + topo_order = find_topo_order(blocks) + for label in topo_order: + block = blocks[label] + new_body = [] + for stmt in block.body: + if isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Expr): + lhs = stmt.target.name + rhs = stmt.value + # replace A.func with np.func, and save A in saved_arr_arg + if (rhs.op == 'getattr' and rhs.attr in arr_math + and isinstance( + typemap[rhs.value.name], types.npytypes.Array)): + rhs = stmt.value + arr = rhs.value + saved_arr_arg[lhs] = arr + scope = arr.scope + loc = arr.loc + # g_np_var = Global(numpy) + g_np_var = ir.Var(scope, mk_unique_var("$np_g_var"), loc) + typemap[g_np_var.name] = types.misc.Module(numpy) + g_np = ir.Global('np', numpy, loc) + g_np_assign = ir.Assign(g_np, g_np_var, loc) + rhs.value = g_np_var + new_body.append(g_np_assign) + func_ir._definitions[g_np_var.name] = [g_np] + # update func var type + func = getattr(numpy, rhs.attr) + func_typ = get_np_ufunc_typ(func) + typemap.pop(lhs) + typemap[lhs] = func_typ + if rhs.op == 'call' and rhs.func.name in saved_arr_arg: + # add array as first arg + arr = saved_arr_arg[rhs.func.name] + # update call type signature to include array arg + old_sig = calltypes.pop(rhs) + # argsort requires kws for typing so sig.args can't be used + # reusing sig.args since some types become Const in sig + argtyps = old_sig.args[:len(rhs.args)] + kwtyps = {name: typemap[v.name] for name, v in rhs.kws} + calltypes[rhs] = typemap[rhs.func.name].get_call_type( + typingctx, [typemap[arr.name]] + list(argtyps), kwtyps) + rhs.args = [arr] + rhs.args + + new_body.append(stmt) + block.body = new_body + return + + +# format: {type:function} +array_accesses_extensions = {} + + +def get_array_accesses(blocks, accesses=None): + """returns a set of arrays accessed and their indices. + """ + if accesses is None: + accesses = set() + + for block in blocks.values(): + for inst in block.body: + if isinstance(inst, ir.SetItem): + accesses.add((inst.target.name, inst.index.name)) + if isinstance(inst, ir.StaticSetItem): + accesses.add((inst.target.name, inst.index_var.name)) + if isinstance(inst, ir.Assign): + lhs = inst.target.name + rhs = inst.value + if isinstance(rhs, ir.Expr) and rhs.op == 'getitem': + accesses.add((rhs.value.name, rhs.index.name)) + if isinstance(rhs, ir.Expr) and rhs.op == 'static_getitem': + index = rhs.index + # slice is unhashable, so just keep the variable + if index is None or is_slice_index(index): + index = rhs.index_var.name + accesses.add((rhs.value.name, index)) + for T, f in array_accesses_extensions.items(): + if isinstance(inst, T): + f(inst, accesses) + return accesses + +def is_slice_index(index): + """see if index is a slice index or has slice in it""" + if isinstance(index, slice): + return True + if isinstance(index, tuple): + for i in index: + if isinstance(i, slice): + return True + return False + +def merge_adjacent_blocks(blocks): + cfg = compute_cfg_from_blocks(blocks) + # merge adjacent blocks + removed = set() + for label in list(blocks.keys()): + if label in removed: + continue + block = blocks[label] + succs = list(cfg.successors(label)) + while True: + if len(succs) != 1: + break + next_label = succs[0][0] + if next_label in removed: + break + preds = list(cfg.predecessors(next_label)) + succs = list(cfg.successors(next_label)) + if len(preds) != 1 or preds[0][0] != label: + break + next_block = blocks[next_label] + # XXX: commented out since scope objects are not consistent + # throughout the compiler. for example, pieces of code are compiled + # and inlined on the fly without proper scope merge. + # if block.scope != next_block.scope: + # break + # merge + block.body.pop() # remove Jump + block.body += next_block.body + del blocks[next_label] + removed.add(next_label) + label = next_label + + +def restore_copy_var_names(blocks, save_copies, typemap): + """ + restores variable names of user variables after applying copy propagation + """ + if not save_copies: + return {} + + rename_dict = {} + var_rename_map = {} + for (a, b) in save_copies: + # a is string name, b is variable + # if a is user variable and b is generated temporary and b is not + # already renamed + if (not a.startswith('$') and b.name.startswith('$') + and b.name not in rename_dict): + new_name = mk_unique_var('${}'.format(a)); + rename_dict[b.name] = new_name + var_rename_map[new_name] = a + typ = typemap.pop(b.name) + typemap[new_name] = typ + + replace_var_names(blocks, rename_dict) + return var_rename_map + + +def simplify(func_ir, typemap, calltypes, metadata): + # get copies in to blocks and out from blocks + in_cps, _ = copy_propagate(func_ir.blocks, typemap) + # table mapping variable names to ir.Var objects to help replacement + name_var_table = get_name_var_table(func_ir.blocks) + save_copies = apply_copy_propagate( + func_ir.blocks, + in_cps, + name_var_table, + typemap, + calltypes) + var_rename_map = restore_copy_var_names(func_ir.blocks, save_copies, typemap) + if "var_rename_map" not in metadata: + metadata["var_rename_map"] = {} + metadata["var_rename_map"].update(var_rename_map) + # remove dead code to enable fusion + if config.DEBUG_ARRAY_OPT >= 1: + dprint_func_ir(func_ir, "after copy prop") + remove_dead(func_ir.blocks, func_ir.arg_names, func_ir, typemap) + func_ir.blocks = simplify_CFG(func_ir.blocks) + if config.DEBUG_ARRAY_OPT >= 1: + dprint_func_ir(func_ir, "after simplify") + + +class GuardException(Exception): + pass + + +def require(cond): + """ + Raise GuardException if the given condition is False. + """ + if not cond: + raise GuardException + +def guard(func, *args, **kwargs): + """ + Run a function with given set of arguments, and guard against + any GuardException raised by the function by returning None, + or the expected return results if no such exception was raised. + """ + try: + return func(*args, **kwargs) + except GuardException: + return None + +def get_definition(func_ir, name, **kwargs): + """ + Same as func_ir.get_definition(name), but raise GuardException if + exception KeyError is caught. + """ + try: + return func_ir.get_definition(name, **kwargs) + except KeyError: + raise GuardException + +def build_definitions(blocks, definitions=None): + """Build the definitions table of the given blocks by scanning + through all blocks and instructions, useful when the definitions + table is out-of-sync. + Will return a new definition table if one is not passed. + """ + if definitions is None: + definitions = collections.defaultdict(list) + + for block in blocks.values(): + for inst in block.body: + if isinstance(inst, ir.Assign): + name = inst.target.name + definition = definitions.get(name, []) + if definition == []: + definitions[name] = definition + definition.append(inst.value) + if type(inst) in build_defs_extensions: + f = build_defs_extensions[type(inst)] + f(inst, definitions) + + return definitions + +build_defs_extensions = {} + +def find_callname(func_ir, expr, typemap=None, definition_finder=get_definition): + """Try to find a call expression's function and module names and return + them as strings for unbounded calls. If the call is a bounded call, return + the self object instead of module name. Raise GuardException if failed. + + Providing typemap can make the call matching more accurate in corner cases + such as bounded call on an object which is inside another object. + """ + require(isinstance(expr, ir.Expr) and expr.op == 'call') + callee = expr.func + callee_def = definition_finder(func_ir, callee) + attrs = [] + obj = None + while True: + if isinstance(callee_def, (ir.Global, ir.FreeVar)): + # require(callee_def.value == numpy) + # these checks support modules like numpy, numpy.random as well as + # calls like len() and intrinsics like assertEquiv + keys = ['name', '_name', '__name__'] + value = None + for key in keys: + if hasattr(callee_def.value, key): + value = getattr(callee_def.value, key) + break + if not value or not isinstance(value, str): + raise GuardException + attrs.append(value) + def_val = callee_def.value + # get the underlying definition of Intrinsic object to be able to + # find the module effectively. + # Otherwise, it will return numba.extending + if isinstance(def_val, _Intrinsic): + def_val = def_val._defn + if hasattr(def_val, '__module__'): + mod_name = def_val.__module__ + # The reason for first checking if the function is in NumPy's + # top level name space by module is that some functions are + # deprecated in NumPy but the functions' names are aliased with + # other common names. This prevents deprecation warnings on + # e.g. getattr(numpy, 'bool') were a bool the target. + # For context see #6175, impacts NumPy>=1.20. + mod_not_none = mod_name is not None + numpy_toplevel = (mod_not_none and + (mod_name == 'numpy' + or mod_name.startswith('numpy.'))) + # it might be a numpy function imported directly + if (numpy_toplevel and hasattr(numpy, value) + and def_val == getattr(numpy, value)): + attrs += ['numpy'] + # it might be a np.random function imported directly + elif (hasattr(numpy.random, value) + and def_val == getattr(numpy.random, value)): + attrs += ['random', 'numpy'] + elif mod_not_none: + attrs.append(mod_name) + else: + class_name = def_val.__class__.__name__ + if class_name == 'builtin_function_or_method': + class_name = 'builtin' + if class_name != 'module': + attrs.append(class_name) + break + elif isinstance(callee_def, ir.Expr) and callee_def.op == 'getattr': + obj = callee_def.value + attrs.append(callee_def.attr) + if typemap and obj.name in typemap: + typ = typemap[obj.name] + if not isinstance(typ, types.Module): + return attrs[0], obj + callee_def = definition_finder(func_ir, obj) + else: + # obj.func calls where obj is not np array + if obj is not None: + return '.'.join(reversed(attrs)), obj + raise GuardException + return attrs[0], '.'.join(reversed(attrs[1:])) + +def find_build_sequence(func_ir, var): + """Check if a variable is constructed via build_tuple or + build_list or build_set, and return the sequence and the + operator, or raise GuardException otherwise. + Note: only build_tuple is immutable, so use with care. + """ + require(isinstance(var, ir.Var)) + var_def = get_definition(func_ir, var) + require(isinstance(var_def, ir.Expr)) + build_ops = ['build_tuple', 'build_list', 'build_set'] + require(var_def.op in build_ops) + return var_def.items, var_def.op + +def find_const(func_ir, var): + """Check if a variable is defined as constant, and return + the constant value, or raise GuardException otherwise. + """ + require(isinstance(var, ir.Var)) + var_def = get_definition(func_ir, var) + require(isinstance(var_def, (ir.Const, ir.Global, ir.FreeVar))) + return var_def.value + +def compile_to_numba_ir(mk_func, glbls, typingctx=None, targetctx=None, + arg_typs=None, typemap=None, calltypes=None): + """ + Compile a function or a make_function node to Numba IR. + + Rename variables and + labels to avoid conflict if inlined somewhere else. Perform type inference + if typingctx and other typing inputs are available and update typemap and + calltypes. + """ + from numba.core import typed_passes + # mk_func can be actual function or make_function node, or a njit function + if hasattr(mk_func, 'code'): + code = mk_func.code + elif hasattr(mk_func, '__code__'): + code = mk_func.__code__ + else: + raise NotImplementedError("function type not recognized {}".format(mk_func)) + f_ir = get_ir_of_code(glbls, code) + remove_dels(f_ir.blocks) + + # relabel by adding an offset + f_ir.blocks = add_offset_to_labels(f_ir.blocks, _the_max_label.next()) + max_label = max(f_ir.blocks.keys()) + _the_max_label.update(max_label) + + # rename all variables to avoid conflict + var_table = get_name_var_table(f_ir.blocks) + new_var_dict = {} + for name, var in var_table.items(): + new_var_dict[name] = mk_unique_var(name) + replace_var_names(f_ir.blocks, new_var_dict) + + # perform type inference if typingctx is available and update type + # data structures typemap and calltypes + if typingctx: + f_typemap, f_return_type, f_calltypes, _ = typed_passes.type_inference_stage( + typingctx, targetctx, f_ir, arg_typs, None) + # remove argument entries like arg.a from typemap + arg_names = [vname for vname in f_typemap if vname.startswith("arg.")] + for a in arg_names: + f_typemap.pop(a) + typemap.update(f_typemap) + calltypes.update(f_calltypes) + return f_ir + +def _create_function_from_code_obj(fcode, func_env, func_arg, func_clo, glbls): + """ + Creates a function from a code object. Args: + * fcode - the code object + * func_env - string for the freevar placeholders + * func_arg - string for the function args (e.g. "a, b, c, d=None") + * func_clo - string for the closure args + * glbls - the function globals + """ + sanitized_co_name = fcode.co_name.replace('<', '_').replace('>', '_') + func_text = (f"def closure():\n{func_env}\n" + f"\tdef {sanitized_co_name}({func_arg}):\n" + f"\t\treturn ({func_clo})\n" + f"\treturn {sanitized_co_name}") + loc = {} + exec(func_text, glbls, loc) + + f = loc['closure']() + # replace the code body + f.__code__ = fcode + f.__name__ = fcode.co_name + return f + +def get_ir_of_code(glbls, fcode): + """ + Compile a code object to get its IR, ir.Del nodes are emitted + """ + nfree = len(fcode.co_freevars) + func_env = "\n".join(["\tc_%d = None" % i for i in range(nfree)]) + func_clo = ",".join(["c_%d" % i for i in range(nfree)]) + func_arg = ",".join(["x_%d" % i for i in range(fcode.co_argcount)]) + + f = _create_function_from_code_obj(fcode, func_env, func_arg, func_clo, + glbls) + + from numba.core import compiler + ir = compiler.run_frontend(f) + # we need to run the before inference rewrite pass to normalize the IR + # XXX: check rewrite pass flag? + # for example, Raise nodes need to become StaticRaise before type inference + class DummyPipeline(object): + def __init__(self, f_ir): + self.state = compiler.StateDict() + self.state.typingctx = None + self.state.targetctx = None + self.state.args = None + self.state.func_ir = f_ir + self.state.typemap = None + self.state.return_type = None + self.state.calltypes = None + state = DummyPipeline(ir).state + rewrites.rewrite_registry.apply('before-inference', state) + # call inline pass to handle cases like stencils and comprehensions + swapped = {} # TODO: get this from diagnostics store + import numba.core.inline_closurecall + inline_pass = numba.core.inline_closurecall.InlineClosureCallPass( + ir, numba.core.cpu.ParallelOptions(False), swapped) + inline_pass.run() + + # TODO: DO NOT ADD MORE THINGS HERE! + # If adding more things here is being contemplated, it really is time to + # retire this function and work on getting the InlineWorker class from + # numba.core.inline_closurecall into sufficient shape as a replacement. + # The issue with `get_ir_of_code` is that it doesn't run a full compilation + # pipeline and as a result various additional things keep needing to be + # added to create valid IR. + + # rebuild IR in SSA form + from numba.core.untyped_passes import ReconstructSSA + from numba.core.typed_passes import PreLowerStripPhis + reconstruct_ssa = ReconstructSSA() + phistrip = PreLowerStripPhis() + reconstruct_ssa.run_pass(state) + phistrip.run_pass(state) + + post_proc = postproc.PostProcessor(ir) + post_proc.run(True) + return ir + +def replace_arg_nodes(block, args): + """ + Replace ir.Arg(...) with variables + """ + for stmt in block.body: + if isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Arg): + idx = stmt.value.index + assert(idx < len(args)) + stmt.value = args[idx] + return + + +def replace_returns(blocks, target, return_label): + """ + Return return statement by assigning directly to target, and a jump. + """ + for block in blocks.values(): + # some blocks may be empty during transformations + if not block.body: + continue + stmt = block.terminator + if isinstance(stmt, ir.Return): + block.body.pop() # remove return + cast_stmt = block.body.pop() + assert (isinstance(cast_stmt, ir.Assign) + and isinstance(cast_stmt.value, ir.Expr) + and cast_stmt.value.op == 'cast'), "invalid return cast" + block.body.append(ir.Assign(cast_stmt.value.value, target, stmt.loc)) + block.body.append(ir.Jump(return_label, stmt.loc)) + + +def gen_np_call(func_as_str, func, lhs, args, typingctx, typemap, calltypes): + scope = args[0].scope + loc = args[0].loc + + # g_np_var = Global(numpy) + g_np_var = ir.Var(scope, mk_unique_var("$np_g_var"), loc) + typemap[g_np_var.name] = types.misc.Module(numpy) + g_np = ir.Global('np', numpy, loc) + g_np_assign = ir.Assign(g_np, g_np_var, loc) + # attr call: _attr = getattr(g_np_var, func_as_str) + np_attr_call = ir.Expr.getattr(g_np_var, func_as_str, loc) + attr_var = ir.Var(scope, mk_unique_var("$np_attr_attr"), loc) + func_var_typ = get_np_ufunc_typ(func) + typemap[attr_var.name] = func_var_typ + attr_assign = ir.Assign(np_attr_call, attr_var, loc) + # np call: lhs = np_attr(*args) + np_call = ir.Expr.call(attr_var, args, (), loc) + arg_types = [typemap[x.name] for x in args] + func_typ = func_var_typ.get_call_type(typingctx, arg_types, {}) + calltypes[np_call] = func_typ + np_assign = ir.Assign(np_call, lhs, loc) + return [g_np_assign, attr_assign, np_assign] + +def dump_block(label, block): + print(label, ":") + for stmt in block.body: + print(" ", stmt) + +def dump_blocks(blocks): + for label, block in blocks.items(): + dump_block(label, block) + +def is_operator_or_getitem(expr): + """true if expr is unary or binary operator or getitem""" + return (isinstance(expr, ir.Expr) + and getattr(expr, 'op', False) + and expr.op in ['unary', 'binop', 'inplace_binop', 'getitem', 'static_getitem']) + +def is_get_setitem(stmt): + """stmt is getitem assignment or setitem (and static cases)""" + return is_getitem(stmt) or is_setitem(stmt) + + +def is_getitem(stmt): + """true if stmt is a getitem or static_getitem assignment""" + return (isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op in ['getitem', 'static_getitem']) + +def is_setitem(stmt): + """true if stmt is a SetItem or StaticSetItem node""" + return isinstance(stmt, (ir.SetItem, ir.StaticSetItem)) + +def index_var_of_get_setitem(stmt): + """get index variable for getitem/setitem nodes (and static cases)""" + if is_getitem(stmt): + if stmt.value.op == 'getitem': + return stmt.value.index + else: + return stmt.value.index_var + + if is_setitem(stmt): + if isinstance(stmt, ir.SetItem): + return stmt.index + else: + return stmt.index_var + + return None + +def set_index_var_of_get_setitem(stmt, new_index): + if is_getitem(stmt): + if stmt.value.op == 'getitem': + stmt.value.index = new_index + else: + stmt.value.index_var = new_index + elif is_setitem(stmt): + if isinstance(stmt, ir.SetItem): + stmt.index = new_index + else: + stmt.index_var = new_index + else: + raise ValueError("getitem or setitem node expected but received {}".format( + stmt)) + + +def is_namedtuple_class(c): + """check if c is a namedtuple class""" + if not isinstance(c, type): + return False + # should have only tuple as superclass + bases = c.__bases__ + if len(bases) != 1 or bases[0] != tuple: + return False + # should have _make method + if not hasattr(c, '_make'): + return False + # should have _fields that is all string + fields = getattr(c, '_fields', None) + if not isinstance(fields, tuple): + return False + return all(isinstance(f, str) for f in fields) + + +def fill_block_with_call(newblock, callee, label_next, inputs, outputs): + """Fill *newblock* to call *callee* with arguments listed in *inputs*. + The returned values are unwrapped into variables in *outputs*. + The block would then jump to *label_next*. + """ + scope = newblock.scope + loc = newblock.loc + + fn = ir.Const(value=callee, loc=loc) + fnvar = scope.make_temp(loc=loc) + newblock.append(ir.Assign(target=fnvar, value=fn, loc=loc)) + # call + args = [scope.get_exact(name) for name in inputs] + callexpr = ir.Expr.call(func=fnvar, args=args, kws=(), loc=loc) + callres = scope.make_temp(loc=loc) + newblock.append(ir.Assign(target=callres, value=callexpr, loc=loc)) + # unpack return value + for i, out in enumerate(outputs): + target = scope.get_exact(out) + getitem = ir.Expr.static_getitem(value=callres, index=i, + index_var=None, loc=loc) + newblock.append(ir.Assign(target=target, value=getitem, loc=loc)) + # jump to next block + newblock.append(ir.Jump(target=label_next, loc=loc)) + return newblock + + +def fill_callee_prologue(block, inputs, label_next): + """ + Fill a new block *block* that unwraps arguments using names in *inputs* and + then jumps to *label_next*. + + Expected to use with *fill_block_with_call()* + """ + scope = block.scope + loc = block.loc + # load args + args = [ir.Arg(name=k, index=i, loc=loc) + for i, k in enumerate(inputs)] + for aname, aval in zip(inputs, args): + tmp = ir.Var(scope=scope, name=aname, loc=loc) + block.append(ir.Assign(target=tmp, value=aval, loc=loc)) + # jump to loop entry + block.append(ir.Jump(target=label_next, loc=loc)) + return block + + +def fill_callee_epilogue(block, outputs): + """ + Fill a new block *block* to prepare the return values. + This block is the last block of the function. + + Expected to use with *fill_block_with_call()* + """ + scope = block.scope + loc = block.loc + # prepare tuples to return + vals = [scope.get_exact(name=name) for name in outputs] + tupexpr = ir.Expr.build_tuple(items=vals, loc=loc) + tup = scope.make_temp(loc=loc) + block.append(ir.Assign(target=tup, value=tupexpr, loc=loc)) + # return + block.append(ir.Return(value=tup, loc=loc)) + return block + + +def find_outer_value(func_ir, var): + """Check if a variable is a global value, and return the value, + or raise GuardException otherwise. + """ + dfn = get_definition(func_ir, var) + if isinstance(dfn, (ir.Global, ir.FreeVar)): + return dfn.value + + if isinstance(dfn, ir.Expr) and dfn.op == 'getattr': + prev_val = find_outer_value(func_ir, dfn.value) + try: + val = getattr(prev_val, dfn.attr) + return val + except AttributeError: + raise GuardException + + raise GuardException + + +def raise_on_unsupported_feature(func_ir, typemap): + """ + Helper function to walk IR and raise if it finds op codes + that are unsupported. Could be extended to cover IR sequences + as well as op codes. Intended use is to call it as a pipeline + stage just prior to lowering to prevent LoweringErrors for known + unsupported features. + """ + gdb_calls = [] # accumulate calls to gdb/gdb_init + + # issue 2195: check for excessively large tuples + for arg_name in func_ir.arg_names: + if arg_name in typemap and \ + isinstance(typemap[arg_name], types.containers.UniTuple) and \ + typemap[arg_name].count > 1000: + # Raise an exception when len(tuple) > 1000. The choice of this number (1000) + # was entirely arbitrary + msg = ("Tuple '{}' length must be smaller than 1000.\n" + "Large tuples lead to the generation of a prohibitively large " + "LLVM IR which causes excessive memory pressure " + "and large compile times.\n" + "As an alternative, the use of a 'list' is recommended in " + "place of a 'tuple' as lists do not suffer from this problem.".format(arg_name)) + raise UnsupportedError(msg, func_ir.loc) + + for blk in func_ir.blocks.values(): + for stmt in blk.find_insts(ir.Assign): + # This raises on finding `make_function` + if isinstance(stmt.value, ir.Expr): + if stmt.value.op == 'make_function': + val = stmt.value + + # See if the construct name can be refined + code = getattr(val, 'code', None) + if code is not None: + # check if this is a closure, the co_name will + # be the captured function name which is not + # useful so be explicit + if getattr(val, 'closure', None) is not None: + use = '' + expr = '' + else: + use = code.co_name + expr = '(%s) ' % use + else: + use = '' + expr = '' + + msg = ("Numba encountered the use of a language " + "feature it does not support in this context: " + "%s (op code: make_function not supported). If " + "the feature is explicitly supported it is " + "likely that the result of the expression %s" + "is being used in an unsupported manner.") % \ + (use, expr) + raise UnsupportedError(msg, stmt.value.loc) + + # this checks for gdb initialization calls, only one is permitted + if isinstance(stmt.value, (ir.Global, ir.FreeVar)): + val = stmt.value + val = getattr(val, 'value', None) + if val is None: + continue + + # check global function + found = False + if isinstance(val, pytypes.FunctionType): + found = val in {numba.gdb, numba.gdb_init} + if not found: # freevar bind to intrinsic + found = getattr(val, '_name', "") == "gdb_internal" + if found: + gdb_calls.append(stmt.loc) # report last seen location + + # this checks that np. was called if view is called + if isinstance(stmt.value, ir.Expr): + if stmt.value.op == 'getattr' and stmt.value.attr == 'view': + var = stmt.value.value.name + if isinstance(typemap[var], types.Array): + continue + df = func_ir.get_definition(var) + cn = guard(find_callname, func_ir, df) + if cn and cn[1] == 'numpy': + ty = getattr(numpy, cn[0]) + if (numpy.issubdtype(ty, numpy.integer) or + numpy.issubdtype(ty, numpy.floating)): + continue + + vardescr = '' if var.startswith('$') else "'{}' ".format(var) + raise TypingError( + "'view' can only be called on NumPy dtypes, " + "try wrapping the variable {}with 'np.()'". + format(vardescr), loc=stmt.loc) + + # checks for globals that are also reflected + if isinstance(stmt.value, ir.Global): + ty = typemap[stmt.target.name] + msg = ("The use of a %s type, assigned to variable '%s' in " + "globals, is not supported as globals are considered " + "compile-time constants and there is no known way to " + "compile a %s type as a constant.") + if (getattr(ty, 'reflected', False) or + isinstance(ty, (types.DictType, types.ListType))): + raise TypingError(msg % (ty, stmt.value.name, ty), loc=stmt.loc) + + # checks for generator expressions (yield in use when func_ir has + # not been identified as a generator). + if isinstance(stmt.value, ir.Yield) and not func_ir.is_generator: + msg = "The use of generator expressions is unsupported." + raise UnsupportedError(msg, loc=stmt.loc) + + # There is more than one call to function gdb/gdb_init + if len(gdb_calls) > 1: + msg = ("Calling either numba.gdb() or numba.gdb_init() more than once " + "in a function is unsupported (strange things happen!), use " + "numba.gdb_breakpoint() to create additional breakpoints " + "instead.\n\nRelevant documentation is available here:\n" + "https://numba.readthedocs.io/en/stable/user/troubleshoot.html" + "#using-numba-s-direct-gdb-bindings-in-nopython-mode\n\n" + "Conflicting calls found at:\n %s") + buf = '\n'.join([x.strformat() for x in gdb_calls]) + raise UnsupportedError(msg % buf) + + +def warn_deprecated(func_ir, typemap): + # first pass, just walk the type map + for name, ty in typemap.items(): + # the Type Metaclass has a reflected member + if ty.reflected: + # if its an arg, report function call + if name.startswith('arg.'): + loc = func_ir.loc + arg = name.split('.')[1] + fname = func_ir.func_id.func_qualname + tyname = 'list' if isinstance(ty, types.List) else 'set' + url = ("https://numba.readthedocs.io/en/stable/reference/" + "deprecation.html#deprecation-of-reflection-for-list-and" + "-set-types") + msg = ("\nEncountered the use of a type that is scheduled for " + "deprecation: type 'reflected %s' found for argument " + "'%s' of function '%s'.\n\nFor more information visit " + "%s" % (tyname, arg, fname, url)) + warnings.warn(NumbaPendingDeprecationWarning(msg, loc=loc)) + + +def resolve_func_from_module(func_ir, node): + """ + This returns the python function that is being getattr'd from a module in + some IR, it resolves import chains/submodules recursively. Should it not be + possible to find the python function being called None will be returned. + + func_ir - the FunctionIR object + node - the IR node from which to start resolving (should be a `getattr`). + """ + getattr_chain = [] + def resolve_mod(mod): + if getattr(mod, 'op', False) == 'getattr': + getattr_chain.insert(0, mod.attr) + try: + mod = func_ir.get_definition(mod.value) + except KeyError: # multiple definitions + return None + return resolve_mod(mod) + elif isinstance(mod, (ir.Global, ir.FreeVar)): + if isinstance(mod.value, pytypes.ModuleType): + return mod + return None + + mod = resolve_mod(node) + if mod is not None: + defn = mod.value + for x in getattr_chain: + defn = getattr(defn, x, False) + if not defn: + break + else: + return defn + else: + return None + + +def enforce_no_dels(func_ir): + """ + Enforce there being no ir.Del nodes in the IR. + """ + for blk in func_ir.blocks.values(): + dels = [x for x in blk.find_insts(ir.Del)] + if dels: + msg = "Illegal IR, del found at: %s" % dels[0] + raise CompilerError(msg, loc=dels[0].loc) + +def enforce_no_phis(func_ir): + """ + Enforce there being no ir.Expr.phi nodes in the IR. + """ + for blk in func_ir.blocks.values(): + phis = [x for x in blk.find_exprs(op='phi')] + if phis: + msg = "Illegal IR, phi found at: %s" % phis[0] + raise CompilerError(msg, loc=phis[0].loc) + + +def legalize_single_scope(blocks): + """Check the given mapping of ir.Block for containing a single scope. + """ + return len({blk.scope for blk in blocks.values()}) == 1 + + +def check_and_legalize_ir(func_ir, flags: "numba.core.compiler.Flags"): + """ + This checks that the IR presented is legal + """ + enforce_no_phis(func_ir) + enforce_no_dels(func_ir) + # postprocess and emit ir.Dels + post_proc = postproc.PostProcessor(func_ir) + post_proc.run(True, extend_lifetimes=flags.dbg_extend_lifetimes) + +def convert_code_obj_to_function(code_obj, caller_ir): + """ + Converts a code object from a `make_function.code` attr in the IR into a + python function, caller_ir is the FunctionIR of the caller and is used for + the resolution of freevars. + """ + fcode = code_obj.code + nfree = len(fcode.co_freevars) + + # try and resolve freevars if they are consts in the caller's IR + # these can be baked into the new function + freevars = [] + for x in fcode.co_freevars: + # not using guard here to differentiate between multiple definition and + # non-const variable + try: + freevar_def = caller_ir.get_definition(x) + except KeyError: + msg = ("Cannot capture a constant value for variable '%s' as there " + "are multiple definitions present." % x) + raise TypingError(msg, loc=code_obj.loc) + if isinstance(freevar_def, ir.Const): + freevars.append(freevar_def.value) + else: + msg = ("Cannot capture the non-constant value associated with " + "variable '%s' in a function that may escape." % x) + raise TypingError(msg, loc=code_obj.loc) + + func_env = "\n".join(["\tc_%d = %s" % (i, x) for i, x in enumerate(freevars)]) + func_clo = ",".join(["c_%d" % i for i in range(nfree)]) + co_varnames = list(fcode.co_varnames) + + # This is horrible. The code object knows about the number of args present + # it also knows the name of the args but these are bundled in with other + # vars in `co_varnames`. The make_function IR node knows what the defaults + # are, they are defined in the IR as consts. The following finds the total + # number of args (args + kwargs with defaults), finds the default values + # and infers the number of "kwargs with defaults" from this and then infers + # the number of actual arguments from that. + n_kwargs = 0 + n_allargs = fcode.co_argcount + kwarg_defaults = caller_ir.get_definition(code_obj.defaults) + if kwarg_defaults is not None: + if isinstance(kwarg_defaults, tuple): + d = [caller_ir.get_definition(x).value for x in kwarg_defaults] + kwarg_defaults_tup = tuple(d) + else: + d = [caller_ir.get_definition(x).value + for x in kwarg_defaults.items] + kwarg_defaults_tup = tuple(d) + n_kwargs = len(kwarg_defaults_tup) + nargs = n_allargs - n_kwargs + + func_arg = ",".join(["%s" % (co_varnames[i]) for i in range(nargs)]) + if n_kwargs: + kw_const = ["%s = %s" % (co_varnames[i + nargs], kwarg_defaults_tup[i]) + for i in range(n_kwargs)] + func_arg += ", " + func_arg += ", ".join(kw_const) + + # globals are the same as those in the caller + glbls = caller_ir.func_id.func.__globals__ + + # create the function and return it + return _create_function_from_code_obj(fcode, func_env, func_arg, func_clo, + glbls) + + +def fixup_var_define_in_scope(blocks): + """Fixes the mapping of ir.Block to ensure all referenced ir.Var are + defined in every scope used by the function. Such that looking up a variable + from any scope in this function will not fail. + + Note: This is a workaround. Ideally, all the blocks should refer to the + same ir.Scope, but that property is not maintained by all the passes. + """ + # Scan for all used variables + used_var = {} + for blk in blocks.values(): + scope = blk.scope + for inst in blk.body: + for var in inst.list_vars(): + used_var[var] = inst + # Note: not all blocks share a single scope even though they should. + # Ensure the scope of each block defines all used variables. + for blk in blocks.values(): + scope = blk.scope + for var, inst in used_var.items(): + # add this variable if it's not in scope + if var.name not in scope.localvars: + # Note: using a internal method to reuse the same + scope.localvars.define(var.name, var) + + +def transfer_scope(block, scope): + """Transfer the ir.Block to use the given ir.Scope. + """ + old_scope = block.scope + if old_scope is scope: + # bypass if the block is already using the given scope + return block + # Ensure variables are defined in the new scope + for var in old_scope.localvars._con.values(): + if var.name not in scope.localvars: + scope.localvars.define(var.name, var) + # replace scope + block.scope = scope + return block + + +def is_setup_with(stmt): + return isinstance(stmt, ir.EnterWith) + + +def is_terminator(stmt): + return isinstance(stmt, ir.Terminator) + + +def is_raise(stmt): + return isinstance(stmt, ir.Raise) + + +def is_return(stmt): + return isinstance(stmt, ir.Return) + + +def is_pop_block(stmt): + return isinstance(stmt, ir.PopBlock) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/itanium_mangler.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/itanium_mangler.py new file mode 100644 index 0000000000000000000000000000000000000000..2fb55ee5ac31f267e16ff66bb22d99c625594a7b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/itanium_mangler.py @@ -0,0 +1,225 @@ +""" +Itanium CXX ABI Mangler + +Reference: https://itanium-cxx-abi.github.io/cxx-abi/abi.html + +The basics of the mangling scheme. + +We are hijacking the CXX mangling scheme for our use. We map Python modules +into CXX namespace. A `module1.submodule2.foo` is mapped to +`module1::submodule2::foo`. For parameterized numba types, we treat them as +templated types; for example, `array(int64, 1d, C)` becomes an +`array`. + +All mangled names are prefixed with "_Z". It is followed by the name of the +entity. A name contains one or more identifiers. Each identifier is encoded +as "". If the name is namespaced and, therefore, +has multiple identifiers, the entire name is encoded as "NE". + +For functions, arguments types follow. There are condensed encodings for basic +built-in types; e.g. "i" for int, "f" for float. For other types, the +previously mentioned name encoding should be used. + +For templated types, the template parameters are encoded immediately after the +name. If it is namespaced, it should be within the 'N' 'E' marker. Template +parameters are encoded in "IE", where each parameter is encoded using +the mentioned name encoding scheme. Template parameters can contain literal +values like the '1' in the array type shown earlier. There is special encoding +scheme for them to avoid leading digits. +""" + + +import re + +from numba.core import types, config + + +# According the scheme, valid characters for mangled names are [a-zA-Z0-9_]. +# We borrow the '_' as the escape character to encode invalid char into +# '_xx' where 'xx' is the hex codepoint. +_re_invalid_char = re.compile(r'[^a-z0-9_]', re.I) + +PREFIX = "_Z" + +# Numba types to mangled type code. These correspond with the codes listed in +# https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-builtin +if config.USE_LEGACY_TYPE_SYSTEM: # Old type system + N2CODE = { + types.void: 'v', + types.boolean: 'b', + types.uint8: 'h', + types.int8: 'a', + types.uint16: 't', + types.int16: 's', + types.uint32: 'j', + types.int32: 'i', + types.uint64: 'y', + types.int64: 'x', + types.float16: 'Dh', + types.float32: 'f', + types.float64: 'd' + } +else: + N2CODE = { + types.void: 'v', + types.py_bool: 'b', + types.py_int: 'x', + types.py_float: 'd', + types.np_bool_: 'b', + types.np_uint8: 'h', + types.np_int8: 'a', + types.np_uint16: 't', + types.np_int16: 's', + types.np_uint32: 'j', + types.np_int32: 'i', + types.np_uint64: 'y', + types.np_int64: 'x', + types.np_float16: 'Dh', + types.np_float32: 'f', + types.np_float64: 'd' + } + + +def _escape_string(text): + """Escape the given string so that it only contains ASCII characters + of [a-zA-Z0-9_$]. + + The dollar symbol ($) and other invalid characters are escaped into + the string sequence of "$xx" where "xx" is the hex codepoint of the char. + + Multibyte characters are encoded into utf8 and converted into the above + hex format. + """ + + def repl(m): + return ''.join(('_%02x' % ch) + for ch in m.group(0).encode('utf8')) + ret = re.sub(_re_invalid_char, repl, text) + # Return str if we got a unicode (for py2) + if not isinstance(ret, str): + return ret.encode('ascii') + return ret + + +def _fix_lead_digit(text): + """ + Fix text with leading digit + """ + if text and text[0].isdigit(): + return '_' + text + else: + return text + + +def _len_encoded(string): + """ + Prefix string with digit indicating the length. + Add underscore if string is prefixed with digits. + """ + string = _fix_lead_digit(string) + return '%u%s' % (len(string), string) + + +def mangle_abi_tag(abi_tag: str) -> str: + return "B" + _len_encoded(_escape_string(abi_tag)) + + +def mangle_identifier(ident, template_params='', *, abi_tags=(), uid=None): + """ + Mangle the identifier with optional template parameters and abi_tags. + + Note: + + This treats '.' as '::' in C++. + """ + if uid is not None: + # Add uid to abi-tags + abi_tags = (f"v{uid}", *abi_tags) + parts = [_len_encoded(_escape_string(x)) for x in ident.split('.')] + enc_abi_tags = list(map(mangle_abi_tag, abi_tags)) + extras = template_params + ''.join(enc_abi_tags) + if len(parts) > 1: + return 'N%s%sE' % (''.join(parts), extras) + else: + return '%s%s' % (parts[0], extras) + + +def mangle_type_or_value(typ): + """ + Mangle type parameter and arbitrary value. + """ + # Handle numba types + if isinstance(typ, types.Type): + if typ in N2CODE: + return N2CODE[typ] + else: + return mangle_templated_ident(*typ.mangling_args) + # Handle integer literal + elif isinstance(typ, int): + return 'Li%dE' % typ + # Handle str as identifier + elif isinstance(typ, str): + return mangle_identifier(typ) + # Otherwise + else: + enc = _escape_string(str(typ)) + return _len_encoded(enc) + + +# Alias +mangle_type = mangle_type_or_value +mangle_value = mangle_type_or_value + + +def mangle_templated_ident(identifier, parameters): + """ + Mangle templated identifier. + """ + template_params = ('I%sE' % ''.join(map(mangle_type_or_value, parameters)) + if parameters else '') + return mangle_identifier(identifier, template_params) + + +def mangle_args(argtys): + """ + Mangle sequence of Numba type objects and arbitrary values. + """ + return ''.join([mangle_type_or_value(t) for t in argtys]) + + +def mangle(ident, argtys, *, abi_tags=(), uid=None): + """ + Mangle identifier with Numba type objects and abi-tags. + """ + return ''.join([PREFIX, + mangle_identifier(ident, abi_tags=abi_tags, uid=uid), + mangle_args(argtys)]) + + +def prepend_namespace(mangled, ns): + """ + Prepend namespace to mangled name. + """ + if not mangled.startswith(PREFIX): + raise ValueError('input is not a mangled name') + elif mangled.startswith(PREFIX + 'N'): + # nested + remaining = mangled[3:] + ret = PREFIX + 'N' + mangle_identifier(ns) + remaining + else: + # non-nested + remaining = mangled[2:] + head, tail = _split_mangled_ident(remaining) + ret = PREFIX + 'N' + mangle_identifier(ns) + head + 'E' + tail + return ret + + +def _split_mangled_ident(mangled): + """ + Returns `(head, tail)` where `head` is the ` + ` encoded + identifier and `tail` is the remaining. + """ + ct = int(mangled) + ctlen = len(str(ct)) + at = ctlen + ct + return mangled[:at], mangled[at:] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/llvm_bindings.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/llvm_bindings.py new file mode 100644 index 0000000000000000000000000000000000000000..fa94ad428b45088e6e9b685ac2766234e9c6cc06 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/llvm_bindings.py @@ -0,0 +1,46 @@ +""" +Useful options to debug LLVM passes + +llvm.set_option("test", "-debug-pass=Details") +llvm.set_option("test", "-debug-pass=Executions") +llvm.set_option("test", "-debug-pass=Arguments") +llvm.set_option("test", "-debug-pass=Structure") +llvm.set_option("test", "-debug-only=loop-vectorize") +llvm.set_option("test", "-help-hidden") + +""" + +from llvmlite import binding as llvm + + +def _inlining_threshold(optlevel, sizelevel=0): + """ + Compute the inlining threshold for the desired optimisation level + + Refer to http://llvm.org/docs/doxygen/html/InlineSimple_8cpp_source.html + """ + if optlevel > 2: + return 275 + + # -Os + if sizelevel == 1: + return 75 + + # -Oz + if sizelevel == 2: + return 25 + + return 225 + + +def create_pass_manager_builder(opt=2, loop_vectorize=False, + slp_vectorize=False): + """ + Create an LLVM pass manager with the desired optimisation level and options. + """ + pmb = llvm.create_pass_manager_builder() + pmb.opt_level = opt + pmb.loop_vectorize = loop_vectorize + pmb.slp_vectorize = slp_vectorize + pmb.inlining_threshold = _inlining_threshold(opt) + return pmb diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/lowering.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/lowering.py new file mode 100644 index 0000000000000000000000000000000000000000..071f46fbe1b183bd2436a6758262ba8234c289d6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/lowering.py @@ -0,0 +1,1652 @@ +from collections import namedtuple, defaultdict +import operator +import warnings +from functools import partial + +import llvmlite.ir +from llvmlite.ir import Constant, IRBuilder + +from numba.core import (typing, utils, types, ir, debuginfo, funcdesc, + generators, config, ir_utils, cgutils, removerefctpass, + targetconfig) +from numba.core.errors import (LoweringError, new_error_context, TypingError, + LiteralTypingError, UnsupportedError, + NumbaDebugInfoWarning) +from numba.core.funcdesc import default_mangler +from numba.core.environment import Environment +from numba.core.analysis import compute_use_defs, must_use_alloca +from numba.misc.firstlinefinder import get_func_body_first_lineno +from numba.misc.coverage_support import get_registered_loc_notify + + +_VarArgItem = namedtuple("_VarArgItem", ("vararg", "index")) + + +class BaseLower(object): + """ + Lower IR to LLVM + """ + + def __init__(self, context, library, fndesc, func_ir, metadata=None): + self.library = library + self.fndesc = fndesc + self.blocks = utils.SortedMap(func_ir.blocks.items()) + self.func_ir = func_ir + self.generator_info = func_ir.generator_info + self.metadata = metadata + self.flags = targetconfig.ConfigStack.top_or_none() + + # Initialize LLVM + self.module = self.library.create_ir_module(self.fndesc.unique_name) + + # Python execution environment (will be available to the compiled + # function). + self.env = Environment.from_fndesc(self.fndesc) + + # Internal states + self.blkmap = {} + self.pending_phis = {} + self.varmap = {} + self.firstblk = min(self.blocks.keys()) + self.loc = -1 + + # Specializes the target context as seen inside the Lowerer + # This adds: + # - environment: the python execution environment + self.context = context.subtarget(environment=self.env, + fndesc=self.fndesc) + + # Debuginfo + dibuildercls = (self.context.DIBuilder + if self.context.enable_debuginfo + else debuginfo.DummyDIBuilder) + + # debuginfo def location + self.defn_loc = self._compute_def_location() + + directives_only = self.flags.dbg_directives_only + self.debuginfo = dibuildercls(module=self.module, + filepath=func_ir.loc.filename, + cgctx=context, + directives_only=directives_only) + + # Loc notify objects + self._loc_notify_registry = get_registered_loc_notify() + + # Subclass initialization + self.init() + + @property + def call_conv(self): + return self.context.call_conv + + def init(self): + pass + + def init_pyapi(self): + """ + Init the Python API and Environment Manager for the function being + lowered. + """ + if self.pyapi is not None: + return + self.pyapi = self.context.get_python_api(self.builder) + + # Store environment argument for later use + self.env_manager = self.context.get_env_manager(self.builder) + self.env_body = self.env_manager.env_body + self.envarg = self.env_manager.env_ptr + + def _compute_def_location(self): + # Debuginfo requires source to be accurate. Find it and warn if not + # found. If it's not found, use the func_ir line + 1, this assumes that + # the function definition is decorated with a 1 line jit decorator. + defn_loc = self.func_ir.loc.with_lineno(self.func_ir.loc.line + 1) + if self.context.enable_debuginfo: + fn = self.func_ir.func_id.func + optional_lno = get_func_body_first_lineno(fn) + if optional_lno is not None: + # -1 as lines start at 1 and this is an offset. + offset = optional_lno - 1 + defn_loc = self.func_ir.loc.with_lineno(offset) + else: + msg = ("Could not find source for function: " + f"{self.func_ir.func_id.func}. Debug line information " + "may be inaccurate.") + warnings.warn(NumbaDebugInfoWarning(msg)) + return defn_loc + + def pre_lower(self): + """ + Called before lowering all blocks. + """ + # A given Lower object can be used for several LL functions + # (for generators) and it's important to use a new API and + # EnvironmentManager. + self.pyapi = None + self.debuginfo.mark_subprogram(function=self.builder.function, + qualname=self.fndesc.qualname, + argnames=self.fndesc.args, + argtypes=self.fndesc.argtypes, + line=self.defn_loc.line) + + # When full debug info is enabled, disable inlining where possible, to + # improve the quality of the debug experience. 'alwaysinline' functions + # cannot have inlining disabled. + attributes = self.builder.function.attributes + full_debug = self.flags.debuginfo and not self.flags.dbg_directives_only + if full_debug and 'alwaysinline' not in attributes: + attributes.add('noinline') + + def post_lower(self): + """ + Called after all blocks are lowered + """ + self.debuginfo.finalize() + for notify in self._loc_notify_registry: + notify.close() + + def pre_block(self, block): + """ + Called before lowering a block. + """ + + def post_block(self, block): + """ + Called after lowering a block. + """ + + def return_dynamic_exception(self, exc_class, exc_args, nb_types, loc=None): + self.call_conv.return_dynamic_user_exc( + self.builder, exc_class, exc_args, nb_types, + loc=loc, func_name=self.func_ir.func_id.func_name, + ) + + def return_exception(self, exc_class, exc_args=None, loc=None): + """Propagate exception to the caller. + """ + self.call_conv.return_user_exc( + self.builder, exc_class, exc_args, + loc=loc, func_name=self.func_ir.func_id.func_name, + ) + + def set_exception(self, exc_class, exc_args=None, loc=None): + """Set exception state in the current function. + """ + self.call_conv.set_static_user_exc( + self.builder, exc_class, exc_args, + loc=loc, func_name=self.func_ir.func_id.func_name, + ) + + def emit_environment_object(self): + """Emit a pointer to hold the Environment object. + """ + # Define global for the environment and initialize it to NULL + envname = self.context.get_env_name(self.fndesc) + self.context.declare_env_global(self.module, envname) + + def lower(self): + # Emit the Env into the module + self.emit_environment_object() + if self.generator_info is None: + self.genlower = None + self.lower_normal_function(self.fndesc) + else: + self.genlower = self.GeneratorLower(self) + self.gentype = self.genlower.gentype + + self.genlower.lower_init_func(self) + self.genlower.lower_next_func(self) + if self.gentype.has_finalizer: + self.genlower.lower_finalize_func(self) + + if config.DUMP_LLVM: + utils.dump_llvm(self.fndesc, self.module) + + # Special optimization to remove NRT on functions that do not need it. + if self.context.enable_nrt and self.generator_info is None: + removerefctpass.remove_unnecessary_nrt_usage(self.function, + context=self.context, + fndesc=self.fndesc) + + # Run target specific post lowering transformation + self.context.post_lowering(self.module, self.library) + + # Materialize LLVM Module + self.library.add_ir_module(self.module) + + def extract_function_arguments(self): + self.fnargs = self.call_conv.decode_arguments(self.builder, + self.fndesc.argtypes, + self.function) + return self.fnargs + + def lower_normal_function(self, fndesc): + """ + Lower non-generator *fndesc*. + """ + self.setup_function(fndesc) + + # Init argument values + self.extract_function_arguments() + entry_block_tail = self.lower_function_body() + + # Close tail of entry block, do not emit debug metadata else the + # unconditional jump gets associated with the metadata from the function + # body end. + with debuginfo.suspend_emission(self.builder): + self.builder.position_at_end(entry_block_tail) + self.builder.branch(self.blkmap[self.firstblk]) + + def lower_function_body(self): + """ + Lower the current function's body, and return the entry block. + """ + # Init Python blocks + for offset in self.blocks: + bname = "B%s" % offset + self.blkmap[offset] = self.function.append_basic_block(bname) + + self.pre_lower() + # pre_lower() may have changed the current basic block + entry_block_tail = self.builder.basic_block + + self.debug_print("# function begin: {0}".format( + self.fndesc.unique_name)) + + # Lower all blocks + for offset, block in sorted(self.blocks.items()): + bb = self.blkmap[offset] + self.builder.position_at_end(bb) + self.debug_print(f"# lower block: {offset}") + self.lower_block(block) + self.post_lower() + return entry_block_tail + + def lower_block(self, block): + """ + Lower the given block. + """ + self.pre_block(block) + for inst in block.body: + self.loc = inst.loc + defaulterrcls = partial(LoweringError, loc=self.loc) + with new_error_context('lowering "{inst}" at {loc}', inst=inst, + loc=self.loc, errcls_=defaulterrcls): + self.lower_inst(inst) + self.post_block(block) + + def create_cpython_wrapper(self, release_gil=False): + """ + Create CPython wrapper(s) around this function (or generator). + """ + if self.genlower: + self.context.create_cpython_wrapper(self.library, + self.genlower.gendesc, + self.env, self.call_helper, + release_gil=release_gil) + self.context.create_cpython_wrapper(self.library, self.fndesc, + self.env, self.call_helper, + release_gil=release_gil) + + def create_cfunc_wrapper(self): + """ + Create C wrapper around this function. + """ + if self.genlower: + raise UnsupportedError('generator as a first-class function type') + self.context.create_cfunc_wrapper(self.library, self.fndesc, + self.env, self.call_helper) + + def setup_function(self, fndesc): + # Setup function + self.function = self.context.declare_function(self.module, fndesc) + if self.flags.dbg_optnone: + attrset = self.function.attributes + if "alwaysinline" not in attrset: + attrset.add("optnone") + attrset.add("noinline") + self.entry_block = self.function.append_basic_block('entry') + self.builder = IRBuilder(self.entry_block) + self.call_helper = self.call_conv.init_call_helper(self.builder) + + def typeof(self, varname): + return self.fndesc.typemap[varname] + + def notify_loc(self, loc: ir.Loc) -> None: + """Called when a new instruction with the given `loc` is about to be + lowered. + """ + for notify_obj in self._loc_notify_registry: + notify_obj.notify(loc) + + def debug_print(self, msg): + if config.DEBUG_JIT: + self.context.debug_print( + self.builder, f"DEBUGJIT [{self.fndesc.qualname}]: {msg}") + + def print_variable(self, msg, varname): + """Helper to emit ``print(msg, varname)`` for debugging. + + Parameters + ---------- + msg : str + Literal string to be printed. + varname : str + A variable name whose value will be printed. + """ + argtys = ( + types.literal(msg), + self.fndesc.typemap[varname] + ) + args = ( + self.context.get_dummy_value(), + self.loadvar(varname), + ) + sig = typing.signature(types.none, *argtys) + + impl = self.context.get_function(print, sig) + impl(self.builder, args) + + +class Lower(BaseLower): + GeneratorLower = generators.GeneratorLower + + def init(self): + super().init() + # find all singly assigned variables + self._find_singly_assigned_variable() + + @property + def _disable_sroa_like_opt(self): + """Flags that the SROA like optimisation that Numba performs (which + prevent alloca and subsequent load/store for locals) should be disabled. + Currently, this is conditional solely on the presence of a request for + the emission of debug information.""" + if self.flags is None: + return False + + return self.flags.debuginfo and not self.flags.dbg_directives_only + + def _find_singly_assigned_variable(self): + func_ir = self.func_ir + blocks = func_ir.blocks + + sav = set() + + if not self.func_ir.func_id.is_generator: + use_defs = compute_use_defs(blocks) + alloca_vars = must_use_alloca(blocks) + + # Compute where variables are defined + var_assign_map = defaultdict(set) + for blk, vl in use_defs.defmap.items(): + for var in vl: + var_assign_map[var].add(blk) + + # Compute where variables are used + var_use_map = defaultdict(set) + for blk, vl in use_defs.usemap.items(): + for var in vl: + var_use_map[var].add(blk) + + # Keep only variables that are defined locally and used locally + for var in var_assign_map: + if var not in alloca_vars and len(var_assign_map[var]) == 1: + # Usemap does not keep locally defined variables. + if len(var_use_map[var]) == 0: + # Ensure that the variable is not defined multiple times + # in the block + [defblk] = var_assign_map[var] + assign_stmts = self.blocks[defblk].find_insts(ir.Assign) + assigns = [stmt for stmt in assign_stmts + if stmt.target.name == var] + if len(assigns) == 1: + sav.add(var) + + self._singly_assigned_vars = sav + self._blk_local_varmap = {} + + def pre_block(self, block): + from numba.core.unsafe import eh + + super(Lower, self).pre_block(block) + self._cur_ir_block = block + + if block == self.firstblk: + # create slots for all the vars, irrespective of whether they are + # initialized, SSA will pick this up and warn users about using + # uninitialized variables. Slots are added as alloca in the first + # block + bb = self.blkmap[self.firstblk] + self.builder.position_at_end(bb) + all_names = set() + for block in self.blocks.values(): + for x in block.find_insts(ir.Del): + if x.value not in all_names: + all_names.add(x.value) + for name in all_names: + fetype = self.typeof(name) + self._alloca_var(name, fetype) + + # Detect if we are in a TRY block by looking for a call to + # `eh.exception_check`. + for call in block.find_exprs(op='call'): + defn = ir_utils.guard( + ir_utils.get_definition, self.func_ir, call.func, + ) + if defn is not None and isinstance(defn, ir.Global): + if defn.value is eh.exception_check: + if isinstance(block.terminator, ir.Branch): + targetblk = self.blkmap[block.terminator.truebr] + # NOTE: This hacks in an attribute for call_conv to + # pick up. This hack is no longer needed when + # all old-style implementations are gone. + self.builder._in_try_block = {'target': targetblk} + break + + def post_block(self, block): + # Clean-up + try: + del self.builder._in_try_block + except AttributeError: + pass + + def lower_inst(self, inst): + # Set debug location for all subsequent LL instructions + self.debuginfo.mark_location(self.builder, self.loc.line) + self.notify_loc(self.loc) + self.debug_print(str(inst)) + if isinstance(inst, ir.Assign): + ty = self.typeof(inst.target.name) + val = self.lower_assign(ty, inst) + argidx = None + # If this is a store from an arg, like x = arg.x then tell debuginfo + # that this is the arg + if isinstance(inst.value, ir.Arg): + # NOTE: debug location is the `def ` line + self.debuginfo.mark_location(self.builder, self.defn_loc.line) + argidx = inst.value.index + 1 # args start at 1 + self.storevar(val, inst.target.name, argidx=argidx) + + elif isinstance(inst, ir.Branch): + cond = self.loadvar(inst.cond.name) + tr = self.blkmap[inst.truebr] + fl = self.blkmap[inst.falsebr] + + condty = self.typeof(inst.cond.name) + pred = self.context.cast(self.builder, cond, condty, types.boolean) + assert pred.type == llvmlite.ir.IntType(1),\ + ("cond is not i1: %s" % pred.type) + self.builder.cbranch(pred, tr, fl) + + elif isinstance(inst, ir.Jump): + target = self.blkmap[inst.target] + self.builder.branch(target) + + elif isinstance(inst, ir.Return): + if self.generator_info: + # StopIteration + self.genlower.return_from_generator(self) + return + val = self.loadvar(inst.value.name) + oty = self.typeof(inst.value.name) + ty = self.fndesc.restype + if isinstance(ty, types.Optional): + # If returning an optional type + self.call_conv.return_optional_value(self.builder, ty, oty, val) + return + assert ty == oty, ( + "type '{}' does not match return type '{}'".format(oty, ty)) + retval = self.context.get_return_value(self.builder, ty, val) + self.call_conv.return_value(self.builder, retval) + + elif isinstance(inst, ir.PopBlock): + pass # this is just a marker + + elif isinstance(inst, ir.StaticSetItem): + signature = self.fndesc.calltypes[inst] + assert signature is not None + try: + impl = self.context.get_function('static_setitem', signature) + except NotImplementedError: + return self.lower_setitem(inst.target, inst.index_var, + inst.value, signature) + else: + target = self.loadvar(inst.target.name) + value = self.loadvar(inst.value.name) + valuety = self.typeof(inst.value.name) + value = self.context.cast(self.builder, value, valuety, + signature.args[2]) + return impl(self.builder, (target, inst.index, value)) + + elif isinstance(inst, ir.Print): + self.lower_print(inst) + + elif isinstance(inst, ir.SetItem): + signature = self.fndesc.calltypes[inst] + assert signature is not None + return self.lower_setitem(inst.target, inst.index, inst.value, + signature) + + elif isinstance(inst, ir.StoreMap): + signature = self.fndesc.calltypes[inst] + assert signature is not None + return self.lower_setitem(inst.dct, inst.key, inst.value, signature) + + elif isinstance(inst, ir.DelItem): + target = self.loadvar(inst.target.name) + index = self.loadvar(inst.index.name) + + targetty = self.typeof(inst.target.name) + indexty = self.typeof(inst.index.name) + + signature = self.fndesc.calltypes[inst] + assert signature is not None + + op = operator.delitem + fnop = self.context.typing_context.resolve_value_type(op) + callsig = fnop.get_call_type( + self.context.typing_context, signature.args, {}, + ) + impl = self.context.get_function(fnop, callsig) + + assert targetty == signature.args[0] + index = self.context.cast(self.builder, index, indexty, + signature.args[1]) + + return impl(self.builder, (target, index)) + + elif isinstance(inst, ir.Del): + self.delvar(inst.value) + + elif isinstance(inst, ir.SetAttr): + target = self.loadvar(inst.target.name) + value = self.loadvar(inst.value.name) + signature = self.fndesc.calltypes[inst] + + targetty = self.typeof(inst.target.name) + valuety = self.typeof(inst.value.name) + assert signature is not None + assert signature.args[0] == targetty + impl = self.context.get_setattr(inst.attr, signature) + + # Convert argument to match + value = self.context.cast(self.builder, value, valuety, + signature.args[1]) + + return impl(self.builder, (target, value)) + + elif isinstance(inst, ir.DynamicRaise): + self.lower_dynamic_raise(inst) + + elif isinstance(inst, ir.DynamicTryRaise): + self.lower_try_dynamic_raise(inst) + + elif isinstance(inst, ir.StaticRaise): + self.lower_static_raise(inst) + + elif isinstance(inst, ir.StaticTryRaise): + self.lower_static_try_raise(inst) + + else: + raise NotImplementedError(type(inst)) + + def lower_setitem(self, target_var, index_var, value_var, signature): + target = self.loadvar(target_var.name) + value = self.loadvar(value_var.name) + index = self.loadvar(index_var.name) + + targetty = self.typeof(target_var.name) + valuety = self.typeof(value_var.name) + indexty = self.typeof(index_var.name) + + op = operator.setitem + fnop = self.context.typing_context.resolve_value_type(op) + callsig = fnop.get_call_type( + self.context.typing_context, signature.args, {}, + ) + impl = self.context.get_function(fnop, callsig) + + # Convert argument to match + if isinstance(targetty, types.Optional): + target = self.context.cast(self.builder, target, targetty, + targetty.type) + else: + ul = types.unliteral + assert ul(targetty) == ul(signature.args[0]) + + index = self.context.cast(self.builder, index, indexty, + signature.args[1]) + value = self.context.cast(self.builder, value, valuety, + signature.args[2]) + + return impl(self.builder, (target, index, value)) + + def lower_try_dynamic_raise(self, inst): + # Numba is a bit limited in what it can do with exceptions in a try + # block. Thus, it is safe to use the same code as the static try raise. + self.lower_static_try_raise(inst) + + def lower_dynamic_raise(self, inst): + exc_args = inst.exc_args + args = [] + nb_types = [] + for exc_arg in exc_args: + if isinstance(exc_arg, ir.Var): + # dynamic values + typ = self.typeof(exc_arg.name) + val = self.loadvar(exc_arg.name) + self.incref(typ, val) + else: + typ = None + val = exc_arg + nb_types.append(typ) + args.append(val) + + self.return_dynamic_exception(inst.exc_class, tuple(args), + tuple(nb_types), loc=self.loc) + + def lower_static_raise(self, inst): + if inst.exc_class is None: + # Reraise + self.return_exception(None, loc=self.loc) + else: + self.return_exception(inst.exc_class, inst.exc_args, loc=self.loc) + + def lower_static_try_raise(self, inst): + if inst.exc_class is None: + # Reraise + self.set_exception(None, loc=self.loc) + else: + self.set_exception(inst.exc_class, inst.exc_args, loc=self.loc) + + def lower_assign(self, ty, inst): + value = inst.value + # In nopython mode, closure vars are frozen like globals + if isinstance(value, (ir.Const, ir.Global, ir.FreeVar)): + res = self.context.get_constant_generic(self.builder, ty, + value.value) + self.incref(ty, res) + return res + + elif isinstance(value, ir.Expr): + return self.lower_expr(ty, value) + + elif isinstance(value, ir.Var): + val = self.loadvar(value.name) + oty = self.typeof(value.name) + res = self.context.cast(self.builder, val, oty, ty) + self.incref(ty, res) + return res + + elif isinstance(value, ir.Arg): + # Suspend debug info else all the arg repacking ends up being + # associated with some line or other and it's actually just a detail + # of Numba's CC. + with debuginfo.suspend_emission(self.builder): + # Cast from the argument type to the local variable type + # (note the "arg.FOO" convention as used in typeinfer) + argty = self.typeof("arg." + value.name) + if isinstance(argty, types.Omitted): + pyval = argty.value + tyctx = self.context.typing_context + valty = tyctx.resolve_value_type_prefer_literal(pyval) + # use the type of the constant value + const = self.context.get_constant_generic( + self.builder, valty, pyval, + ) + # cast it to the variable type + res = self.context.cast(self.builder, const, valty, ty) + else: + val = self.fnargs[value.index] + res = self.context.cast(self.builder, val, argty, ty) + self.incref(ty, res) + return res + + elif isinstance(value, ir.Yield): + res = self.lower_yield(ty, value) + self.incref(ty, res) + return res + + raise NotImplementedError(type(value), value) + + def lower_yield(self, retty, inst): + yp = self.generator_info.yield_points[inst.index] + assert yp.inst is inst + y = generators.LowerYield(self, yp, yp.live_vars) + y.lower_yield_suspend() + # Yield to caller + val = self.loadvar(inst.value.name) + typ = self.typeof(inst.value.name) + actual_rettyp = self.gentype.yield_type + + # cast the local val to the type yielded + yret = self.context.cast(self.builder, val, typ, actual_rettyp) + + # get the return repr of yielded value + retval = self.context.get_return_value( + self.builder, actual_rettyp, yret, + ) + + # return + self.call_conv.return_value(self.builder, retval) + + # Resumption point + y.lower_yield_resume() + # None is returned by the yield expression + return self.context.get_constant_generic(self.builder, retty, None) + + def lower_binop(self, resty, expr, op): + # if op in utils.OPERATORS_TO_BUILTINS: + # map operator.the_op => the corresponding types.Function() + # TODO: is this looks dodgy ... + op = self.context.typing_context.resolve_value_type(op) + + lhs = expr.lhs + rhs = expr.rhs + static_lhs = expr.static_lhs + static_rhs = expr.static_rhs + lty = self.typeof(lhs.name) + rty = self.typeof(rhs.name) + lhs = self.loadvar(lhs.name) + rhs = self.loadvar(rhs.name) + + # Convert argument to match + signature = self.fndesc.calltypes[expr] + lhs = self.context.cast(self.builder, lhs, lty, signature.args[0]) + rhs = self.context.cast(self.builder, rhs, rty, signature.args[1]) + + def cast_result(res): + return self.context.cast(self.builder, res, + signature.return_type, resty) + + # First try with static operands, if known + def try_static_impl(tys, args): + if any(a is ir.UNDEFINED for a in args): + return None + try: + if isinstance(op, types.Function): + static_sig = op.get_call_type(self.context.typing_context, + tys, {}) + else: + static_sig = typing.signature(signature.return_type, *tys) + except TypingError: + return None + try: + static_impl = self.context.get_function(op, static_sig) + return static_impl(self.builder, args) + except NotImplementedError: + return None + + res = try_static_impl( + (_lit_or_omitted(static_lhs), _lit_or_omitted(static_rhs)), + (static_lhs, static_rhs), + ) + if res is not None: + return cast_result(res) + + res = try_static_impl( + (_lit_or_omitted(static_lhs), rty), + (static_lhs, rhs), + ) + if res is not None: + return cast_result(res) + + res = try_static_impl( + (lty, _lit_or_omitted(static_rhs)), + (lhs, static_rhs), + ) + if res is not None: + return cast_result(res) + + # Normal implementation for generic arguments + + sig = op.get_call_type(self.context.typing_context, signature.args, {}) + impl = self.context.get_function(op, sig) + res = impl(self.builder, (lhs, rhs)) + return cast_result(res) + + def lower_getitem(self, resty, expr, value, index, signature): + baseval = self.loadvar(value.name) + indexval = self.loadvar(index.name) + # Get implementation of getitem + op = operator.getitem + fnop = self.context.typing_context.resolve_value_type(op) + callsig = fnop.get_call_type( + self.context.typing_context, signature.args, {}, + ) + impl = self.context.get_function(fnop, callsig) + + argvals = (baseval, indexval) + argtyps = (self.typeof(value.name), + self.typeof(index.name)) + castvals = [self.context.cast(self.builder, av, at, ft) + for av, at, ft in zip(argvals, argtyps, + signature.args)] + res = impl(self.builder, castvals) + return self.context.cast(self.builder, res, + signature.return_type, + resty) + + def _cast_var(self, var, ty): + """ + Cast a Numba IR variable to the given Numba type, returning a + low-level value. + """ + if isinstance(var, _VarArgItem): + varty = self.typeof(var.vararg.name)[var.index] + val = self.builder.extract_value(self.loadvar(var.vararg.name), + var.index) + else: + varty = self.typeof(var.name) + val = self.loadvar(var.name) + return self.context.cast(self.builder, val, varty, ty) + + def fold_call_args(self, fnty, signature, pos_args, vararg, kw_args): + if vararg: + # Inject *args from function call + # The lowering will be done in _cast_var() above. + tp_vararg = self.typeof(vararg.name) + assert isinstance(tp_vararg, types.BaseTuple) + pos_args = pos_args + [_VarArgItem(vararg, i) + for i in range(len(tp_vararg))] + + # Fold keyword arguments and resolve default argument values + pysig = signature.pysig + if pysig is None: + if kw_args: + raise NotImplementedError("unsupported keyword arguments " + "when calling %s" % (fnty,)) + argvals = [self._cast_var(var, sigty) + for var, sigty in zip(pos_args, signature.args)] + else: + def normal_handler(index, param, var): + return self._cast_var(var, signature.args[index]) + + def default_handler(index, param, default): + return self.context.get_constant_generic( + self.builder, signature.args[index], default) + + def stararg_handler(index, param, vars): + stararg_ty = signature.args[index] + assert isinstance(stararg_ty, types.BaseTuple), stararg_ty + values = [self._cast_var(var, sigty) + for var, sigty in zip(vars, stararg_ty)] + return cgutils.make_anonymous_struct(self.builder, values) + + argvals = typing.fold_arguments(pysig, + pos_args, dict(kw_args), + normal_handler, + default_handler, + stararg_handler) + return argvals + + def lower_print(self, inst): + """ + Lower a ir.Print() + """ + # We handle this, as far as possible, as a normal call to built-in + # print(). This will make it easy to undo the special ir.Print + # rewrite when it becomes unnecessary (e.g. when we have native + # strings). + sig = self.fndesc.calltypes[inst] + assert sig.return_type == types.none + fnty = self.context.typing_context.resolve_value_type(print) + + # Fix the call signature to inject any constant-inferred + # string argument + pos_tys = list(sig.args) + pos_args = list(inst.args) + for i in range(len(pos_args)): + if i in inst.consts: + pyval = inst.consts[i] + if isinstance(pyval, str): + pos_tys[i] = types.literal(pyval) + + fixed_sig = typing.signature(sig.return_type, *pos_tys) + fixed_sig = fixed_sig.replace(pysig=sig.pysig) + + argvals = self.fold_call_args(fnty, sig, pos_args, inst.vararg, {}) + impl = self.context.get_function(print, fixed_sig) + impl(self.builder, argvals) + + def lower_call(self, resty, expr): + signature = self.fndesc.calltypes[expr] + self.debug_print("# lower_call: expr = {0}".format(expr)) + if isinstance(signature.return_type, types.Phantom): + return self.context.get_dummy_value() + + fnty = self.typeof(expr.func.name) + + if isinstance(fnty, types.ObjModeDispatcher): + res = self._lower_call_ObjModeDispatcher(fnty, expr, signature) + + elif isinstance(fnty, types.ExternalFunction): + res = self._lower_call_ExternalFunction(fnty, expr, signature) + + elif isinstance(fnty, types.ExternalFunctionPointer): + res = self._lower_call_ExternalFunctionPointer( + fnty, expr, signature) + + elif isinstance(fnty, types.RecursiveCall): + res = self._lower_call_RecursiveCall(fnty, expr, signature) + + elif isinstance(fnty, types.FunctionType): + res = self._lower_call_FunctionType(fnty, expr, signature) + + else: + res = self._lower_call_normal(fnty, expr, signature) + + # If lowering the call returned None, interpret that as returning dummy + # value if the return type of the function is void, otherwise there is + # a problem + if res is None: + if signature.return_type == types.void: + res = self.context.get_dummy_value() + else: + raise LoweringError( + msg="non-void function returns None from implementation", + loc=self.loc + ) + + return self.context.cast(self.builder, res, signature.return_type, + resty) + + def _lower_call_ObjModeDispatcher(self, fnty, expr, signature): + from numba.core.pythonapi import ObjModeUtils + + self.init_pyapi() + # Acquire the GIL + gil_state = self.pyapi.gil_ensure() + # Fix types + argnames = [a.name for a in expr.args] + argtypes = [self.typeof(a) for a in argnames] + argvalues = [self.loadvar(a) for a in argnames] + for v, ty in zip(argvalues, argtypes): + # Because .from_native_value steal the reference + self.incref(ty, v) + + argobjs = [self.pyapi.from_native_value(atyp, aval, + self.env_manager) + for atyp, aval in zip(argtypes, argvalues)] + + # Load objmode dispatcher + callee = ObjModeUtils(self.pyapi).load_dispatcher(fnty, argtypes) + # Make Call + ret_obj = self.pyapi.call_function_objargs(callee, argobjs) + has_exception = cgutils.is_null(self.builder, ret_obj) + with self. builder.if_else(has_exception) as (then, orelse): + # Handles exception + # This branch must exit the function + with then: + # Clean arg + for obj in argobjs: + self.pyapi.decref(obj) + + # Release the GIL + self.pyapi.gil_release(gil_state) + + # Return and signal exception + self.call_conv.return_exc(self.builder) + + # Handles normal return + with orelse: + # Fix output value + native = self.pyapi.to_native_value( + fnty.dispatcher.output_types, + ret_obj, + ) + output = native.value + + # Release objs + self.pyapi.decref(ret_obj) + for obj in argobjs: + self.pyapi.decref(obj) + + # cleanup output + if callable(native.cleanup): + native.cleanup() + + # Release the GIL + self.pyapi.gil_release(gil_state) + + # Error during unboxing + with self.builder.if_then(native.is_error): + self.call_conv.return_exc(self.builder) + + return output + + def _lower_call_ExternalFunction(self, fnty, expr, signature): + # Handle a named external function + self.debug_print("# external function") + argvals = self.fold_call_args( + fnty, signature, expr.args, expr.vararg, expr.kws, + ) + fndesc = funcdesc.ExternalFunctionDescriptor( + fnty.symbol, fnty.sig.return_type, fnty.sig.args) + func = self.context.declare_external_function( + self.builder.module, fndesc) + return self.context.call_external_function( + self.builder, func, fndesc.argtypes, argvals, + ) + + def _lower_call_ExternalFunctionPointer(self, fnty, expr, signature): + # Handle a C function pointer + self.debug_print("# calling external function pointer") + argvals = self.fold_call_args( + fnty, signature, expr.args, expr.vararg, expr.kws, + ) + pointer = self.loadvar(expr.func.name) + # If the external function pointer uses libpython + if fnty.requires_gil: + self.init_pyapi() + # Acquire the GIL + gil_state = self.pyapi.gil_ensure() + # Make PyObjects + newargvals = [] + pyvals = [] + for exptyp, gottyp, aval in zip(fnty.sig.args, signature.args, + argvals): + # Adjust argument values to pyobjects + if exptyp == types.ffi_forced_object: + self.incref(gottyp, aval) + obj = self.pyapi.from_native_value( + gottyp, aval, self.env_manager, + ) + newargvals.append(obj) + pyvals.append(obj) + else: + newargvals.append(aval) + + # Call external function + res = self.context.call_function_pointer( + self.builder, pointer, newargvals, fnty.cconv, + ) + # Release PyObjects + for obj in pyvals: + self.pyapi.decref(obj) + + # Release the GIL + self.pyapi.gil_release(gil_state) + # If the external function pointer does NOT use libpython + else: + res = self.context.call_function_pointer( + self.builder, pointer, argvals, fnty.cconv, + ) + return res + + def _lower_call_RecursiveCall(self, fnty, expr, signature): + # Recursive call + argvals = self.fold_call_args( + fnty, signature, expr.args, expr.vararg, expr.kws, + ) + rec_ov = fnty.get_overloads(signature.args) + mangler = self.context.mangler or default_mangler + abi_tags = self.fndesc.abi_tags + mangled_name = mangler(rec_ov.qualname, signature.args, + abi_tags=abi_tags, uid=rec_ov.uid) + # special case self recursion + if self.builder.function.name.startswith(mangled_name): + res = self.context.call_internal( + self.builder, self.fndesc, signature, argvals, + ) + else: + res = self.context.call_unresolved( + self.builder, mangled_name, signature, argvals, + ) + return res + + def _lower_call_FunctionType(self, fnty, expr, signature): + self.debug_print("# calling first-class function type") + sig = types.unliteral(signature) + if not fnty.check_signature(signature): + # value dependent polymorphism? + raise UnsupportedError( + f'mismatch of function types:' + f' expected {fnty} but got {types.FunctionType(sig)}') + argvals = self.fold_call_args( + fnty, sig, expr.args, expr.vararg, expr.kws, + ) + return self.__call_first_class_function_pointer( + fnty.ftype, expr.func.name, sig, argvals, + ) + + def __call_first_class_function_pointer(self, ftype, fname, sig, argvals): + """ + Calls a first-class function pointer. + + This function is responsible for calling a first-class function pointer, + which can either be a JIT-compiled function or a Python function. It + determines if a JIT address is available, and if so, calls the function + using the JIT address. Otherwise, it calls the function using a function + pointer obtained from the `__get_first_class_function_pointer` method. + + Args: + ftype: The type of the function. + fname: The name of the function. + sig: The signature of the function. + argvals: The argument values to pass to the function. + + Returns: + The result of calling the function. + """ + context = self.context + builder = self.builder + # Determine if jit address is available + fstruct = self.loadvar(fname) + struct = cgutils.create_struct_proxy(self.typeof(fname))( + context, builder, value=fstruct + ) + jit_addr = struct.jit_addr + jit_addr.name = f'jit_addr_of_{fname}' + + ctx = context + res_slot = cgutils.alloca_once(builder, + ctx.get_value_type(sig.return_type)) + + if_jit_addr_is_null = builder.if_else( + cgutils.is_null(builder, jit_addr), + likely=False + ) + with if_jit_addr_is_null as (then, orelse): + with then: + func_ptr = self.__get_first_class_function_pointer( + ftype, fname, sig) + res = builder.call(func_ptr, argvals) + builder.store(res, res_slot) + + with orelse: + llty = ctx.call_conv.get_function_type( + sig.return_type, + sig.args + ).as_pointer() + func_ptr = builder.bitcast(jit_addr, llty) + # call + status, res = ctx.call_conv.call_function( + builder, func_ptr, sig.return_type, sig.args, argvals + ) + with cgutils.if_unlikely(builder, status.is_error): + context.call_conv.return_status_propagate(builder, status) + builder.store(res, res_slot) + return builder.load(res_slot) + + def __get_first_class_function_pointer(self, ftype, fname, sig): + from numba.experimental.function_type import lower_get_wrapper_address + + llty = self.context.get_value_type(ftype) + fstruct = self.loadvar(fname) + addr = self.builder.extract_value(fstruct, 0, + name='addr_of_%s' % (fname)) + + fptr = cgutils.alloca_once(self.builder, llty, + name="fptr_of_%s" % (fname)) + with self.builder.if_else( + cgutils.is_null(self.builder, addr), + likely=False) as (then, orelse): + with then: + self.init_pyapi() + # Acquire the GIL + gil_state = self.pyapi.gil_ensure() + pyaddr = self.builder.extract_value( + fstruct, 1, + name='pyaddr_of_%s' % (fname)) + # try to recover the function address, see + # test_zero_address BadToGood example in + # test_function_type.py + addr1 = lower_get_wrapper_address( + self.context, self.builder, pyaddr, sig, + failure_mode='ignore') + with self.builder.if_then( + cgutils.is_null(self.builder, addr1), likely=False): + self.return_exception( + RuntimeError, + exc_args=(f"{ftype} function address is null",), + loc=self.loc) + addr2 = self.pyapi.long_as_voidptr(addr1) + self.builder.store(self.builder.bitcast(addr2, llty), fptr) + self.pyapi.decref(addr1) + self.pyapi.gil_release(gil_state) + with orelse: + self.builder.store(self.builder.bitcast(addr, llty), fptr) + return self.builder.load(fptr) + + def _lower_call_normal(self, fnty, expr, signature): + # Normal function resolution + self.debug_print("# calling normal function: {0}".format(fnty)) + self.debug_print("# signature: {0}".format(signature)) + if isinstance(fnty, types.ObjModeDispatcher): + argvals = expr.func.args + else: + argvals = self.fold_call_args( + fnty, signature, expr.args, expr.vararg, expr.kws, + ) + tname = expr.target + if tname is not None: + from numba.core.target_extension import resolve_dispatcher_from_str + disp = resolve_dispatcher_from_str(tname) + hw_ctx = disp.targetdescr.target_context + impl = hw_ctx.get_function(fnty, signature) + else: + impl = self.context.get_function(fnty, signature) + if signature.recvr: + # The "self" object is passed as the function object + # for bounded function + the_self = self.loadvar(expr.func.name) + # Prepend the self reference + argvals = [the_self] + list(argvals) + + res = impl(self.builder, argvals, self.loc) + return res + + def lower_expr(self, resty, expr): + if expr.op == 'binop': + return self.lower_binop(resty, expr, expr.fn) + elif expr.op == 'inplace_binop': + lty = self.typeof(expr.lhs.name) + if lty.mutable: + return self.lower_binop(resty, expr, expr.fn) + else: + # inplace operators on non-mutable types reuse the same + # definition as the corresponding copying operators.) + return self.lower_binop(resty, expr, expr.immutable_fn) + elif expr.op == 'unary': + val = self.loadvar(expr.value.name) + typ = self.typeof(expr.value.name) + func_ty = self.context.typing_context.resolve_value_type(expr.fn) + # Get function + signature = self.fndesc.calltypes[expr] + impl = self.context.get_function(func_ty, signature) + # Convert argument to match + val = self.context.cast(self.builder, val, typ, signature.args[0]) + res = impl(self.builder, [val]) + res = self.context.cast(self.builder, res, + signature.return_type, resty) + return res + + elif expr.op == 'call': + res = self.lower_call(resty, expr) + return res + + elif expr.op == 'pair_first': + val = self.loadvar(expr.value.name) + ty = self.typeof(expr.value.name) + res = self.context.pair_first(self.builder, val, ty) + self.incref(resty, res) + return res + + elif expr.op == 'pair_second': + val = self.loadvar(expr.value.name) + ty = self.typeof(expr.value.name) + res = self.context.pair_second(self.builder, val, ty) + self.incref(resty, res) + return res + + elif expr.op in ('getiter', 'iternext'): + val = self.loadvar(expr.value.name) + ty = self.typeof(expr.value.name) + signature = self.fndesc.calltypes[expr] + impl = self.context.get_function(expr.op, signature) + [fty] = signature.args + castval = self.context.cast(self.builder, val, ty, fty) + res = impl(self.builder, (castval,)) + res = self.context.cast(self.builder, res, signature.return_type, + resty) + return res + + elif expr.op == 'exhaust_iter': + val = self.loadvar(expr.value.name) + ty = self.typeof(expr.value.name) + # Unpack optional + if isinstance(ty, types.Optional): + val = self.context.cast(self.builder, val, ty, ty.type) + ty = ty.type + + # If we have a tuple, we needn't do anything + # (and we can't iterate over the heterogeneous ones). + if isinstance(ty, types.BaseTuple): + assert ty == resty + self.incref(ty, val) + return val + + itemty = ty.iterator_type.yield_type + tup = self.context.get_constant_undef(resty) + pairty = types.Pair(itemty, types.boolean) + getiter_sig = typing.signature(ty.iterator_type, ty) + getiter_impl = self.context.get_function('getiter', + getiter_sig) + iternext_sig = typing.signature(pairty, ty.iterator_type) + iternext_impl = self.context.get_function('iternext', + iternext_sig) + iterobj = getiter_impl(self.builder, (val,)) + # We call iternext() as many times as desired (`expr.count`). + for i in range(expr.count): + pair = iternext_impl(self.builder, (iterobj,)) + is_valid = self.context.pair_second(self.builder, + pair, pairty) + with cgutils.if_unlikely(self.builder, + self.builder.not_(is_valid)): + self.return_exception(ValueError, loc=self.loc) + item = self.context.pair_first(self.builder, + pair, pairty) + tup = self.builder.insert_value(tup, item, i) + + # Call iternext() once more to check that the iterator + # is exhausted. + pair = iternext_impl(self.builder, (iterobj,)) + is_valid = self.context.pair_second(self.builder, + pair, pairty) + with cgutils.if_unlikely(self.builder, is_valid): + self.return_exception(ValueError, loc=self.loc) + + self.decref(ty.iterator_type, iterobj) + return tup + + elif expr.op == "getattr": + val = self.loadvar(expr.value.name) + ty = self.typeof(expr.value.name) + + if isinstance(resty, types.BoundFunction): + # if we are getting out a method, assume we have typed this + # properly and just build a bound function object + casted = self.context.cast(self.builder, val, ty, resty.this) + res = self.context.get_bound_function(self.builder, casted, + resty.this) + self.incref(resty, res) + return res + else: + impl = self.context.get_getattr(ty, expr.attr) + attrty = self.context.typing_context.resolve_getattr(ty, + expr.attr) + + if impl is None: + # ignore the attribute + return self.context.get_dummy_value() + else: + res = impl(self.context, self.builder, ty, val, expr.attr) + + # Cast the attribute type to the expected output type + res = self.context.cast(self.builder, res, attrty, resty) + return res + + elif expr.op == "static_getitem": + signature = typing.signature( + resty, + self.typeof(expr.value.name), + _lit_or_omitted(expr.index), + ) + try: + # Both get_function() and the returned implementation can + # raise NotImplementedError if the types aren't supported + impl = self.context.get_function("static_getitem", signature) + return impl(self.builder, + (self.loadvar(expr.value.name), expr.index)) + except NotImplementedError: + if expr.index_var is None: + raise + # Fall back on the generic getitem() implementation + # for this type. + signature = self.fndesc.calltypes[expr] + return self.lower_getitem(resty, expr, expr.value, + expr.index_var, signature) + elif expr.op == "typed_getitem": + signature = typing.signature( + resty, + self.typeof(expr.value.name), + self.typeof(expr.index.name), + ) + impl = self.context.get_function("typed_getitem", signature) + return impl(self.builder, (self.loadvar(expr.value.name), + self.loadvar(expr.index.name))) + elif expr.op == "getitem": + signature = self.fndesc.calltypes[expr] + return self.lower_getitem(resty, expr, expr.value, expr.index, + signature) + + elif expr.op == "build_tuple": + itemvals = [self.loadvar(i.name) for i in expr.items] + itemtys = [self.typeof(i.name) for i in expr.items] + castvals = [self.context.cast(self.builder, val, fromty, toty) + for val, toty, fromty in zip(itemvals, resty, itemtys)] + tup = self.context.make_tuple(self.builder, resty, castvals) + self.incref(resty, tup) + return tup + + elif expr.op == "build_list": + itemvals = [self.loadvar(i.name) for i in expr.items] + itemtys = [self.typeof(i.name) for i in expr.items] + if isinstance(resty, types.LiteralList): + castvals = [self.context.cast(self.builder, val, fromty, toty) + for val, toty, fromty in zip(itemvals, resty.types, + itemtys)] + tup = self.context.make_tuple(self.builder, + types.Tuple(resty.types), + castvals) + self.incref(resty, tup) + return tup + else: + castvals = [self.context.cast(self.builder, val, fromty, + resty.dtype) + for val, fromty in zip(itemvals, itemtys)] + return self.context.build_list(self.builder, resty, castvals) + + elif expr.op == "build_set": + # Insert in reverse order, as Python does + items = expr.items[::-1] + itemvals = [self.loadvar(i.name) for i in items] + itemtys = [self.typeof(i.name) for i in items] + castvals = [self.context.cast(self.builder, val, fromty, + resty.dtype) + for val, fromty in zip(itemvals, itemtys)] + return self.context.build_set(self.builder, resty, castvals) + + elif expr.op == "build_map": + items = expr.items + keys, values = [], [] + key_types, value_types = [], [] + for k, v in items: + key = self.loadvar(k.name) + keytype = self.typeof(k.name) + val = self.loadvar(v.name) + valtype = self.typeof(v.name) + keys.append(key) + values.append(val) + key_types.append(keytype) + value_types.append(valtype) + return self.context.build_map(self.builder, resty, + list(zip(key_types, value_types)), + list(zip(keys, values))) + + elif expr.op == "cast": + val = self.loadvar(expr.value.name) + ty = self.typeof(expr.value.name) + castval = self.context.cast(self.builder, val, ty, resty) + self.incref(resty, castval) + return castval + + elif expr.op == "phi": + raise LoweringError("PHI not stripped") + + elif expr.op == 'null': + return self.context.get_constant_null(resty) + + elif expr.op == 'undef': + # Numba does not raise an UnboundLocalError for undefined variables. + # The variable is set to zero. + return self.context.get_constant_null(resty) + + elif expr.op in self.context.special_ops: + res = self.context.special_ops[expr.op](self, expr) + return res + + raise NotImplementedError(expr) + + def _alloca_var(self, name, fetype): + """ + Ensure the given variable has an allocated stack slot (if needed). + """ + if name in self.varmap: + # quit early + return + + # If the name is used in multiple blocks or lowering with debuginfo... + if ((name not in self._singly_assigned_vars) or + self._disable_sroa_like_opt): + # If not already defined, allocate it + ptr = self.alloca(name, fetype) + # Remember the pointer + self.varmap[name] = ptr + + def getvar(self, name): + """ + Get a pointer to the given variable's slot. + """ + if not self._disable_sroa_like_opt: + assert name not in self._blk_local_varmap + assert name not in self._singly_assigned_vars + if name not in self.varmap: + # Allocate undefined variable as needed. + # NOTE: Py3.12 use of LOAD_FAST_AND_CLEAR will allow variable be + # referenced before it is defined. + self._alloca_var(name, self.typeof(name)) + return self.varmap[name] + + def loadvar(self, name): + """ + Load the given variable's value. + """ + if name in self._blk_local_varmap and not self._disable_sroa_like_opt: + return self._blk_local_varmap[name] + ptr = self.getvar(name) + + # Don't associate debuginfo with the load for a function arg else it + # creates instructions ahead of the first source line of the + # function which then causes problems with breaking on the function + # symbol (it hits the symbol, not the first line). + if name in self.func_ir.arg_names: + with debuginfo.suspend_emission(self.builder): + return self.builder.load(ptr) + else: + return self.builder.load(ptr) + + def storevar(self, value, name, argidx=None): + """ + Store the value into the given variable. + """ + fetype = self.typeof(name) + # Define if not already + self._alloca_var(name, fetype) + + # Store variable + if (name in self._singly_assigned_vars and + not self._disable_sroa_like_opt): + self._blk_local_varmap[name] = value + else: + if argidx is None: + # Clean up existing value stored in the variable, not needed + # if it's an arg + old = self.loadvar(name) + self.decref(fetype, old) + + # stack stored variable + ptr = self.getvar(name) + if value.type != ptr.type.pointee: + msg = ("Storing {value.type} to ptr of {ptr.type.pointee} " + "('{name}'). FE type {fetype}").format(value=value, + ptr=ptr, + fetype=fetype, + name=name) + raise AssertionError(msg) + + # If this store is associated with an argument to the function (i.e. + # store following reassemble from CC splatting structs as many args + # to the function) then mark this variable as such. + if argidx is not None: + with debuginfo.suspend_emission(self.builder): + self.builder.store(value, ptr) + loc = self.defn_loc # the line with `def ` + lltype = self.context.get_value_type(fetype) + sizeof = self.context.get_abi_sizeof(lltype) + datamodel = self.context.data_model_manager[fetype] + self.debuginfo.mark_variable(self.builder, ptr, name=name, + lltype=lltype, size=sizeof, + line=loc.line, datamodel=datamodel, + argidx=argidx) + else: + self.builder.store(value, ptr) + + def delvar(self, name): + """ + Delete the given variable. + """ + fetype = self.typeof(name) + + # Out-of-order + if (name not in self._blk_local_varmap and + not self._disable_sroa_like_opt): + if name in self._singly_assigned_vars: + self._singly_assigned_vars.discard(name) + + # Define if not already (may happen if the variable is deleted + # at the beginning of a loop, but only set later in the loop) + self._alloca_var(name, fetype) + + if name in self._blk_local_varmap and not self._disable_sroa_like_opt: + llval = self._blk_local_varmap[name] + self.decref(fetype, llval) + else: + ptr = self.getvar(name) + self.decref(fetype, self.builder.load(ptr)) + # Zero-fill variable to avoid double frees on subsequent dels + self.builder.store(Constant(ptr.type.pointee, None), ptr) + + def alloca(self, name, type): + lltype = self.context.get_value_type(type) + datamodel = self.context.data_model_manager[type] + return self.alloca_lltype(name, lltype, datamodel=datamodel) + + def alloca_lltype(self, name, lltype, datamodel=None): + # Is user variable? + is_uservar = not name.startswith('$') + # Allocate space for variable + aptr = cgutils.alloca_once(self.builder, lltype, + name=name, zfill=False) + + # Emit debug info for user variable + if is_uservar: + # Don't associate debuginfo with the alloca for a function arg, this + # is handled by the first store to the alloca so that repacking the + # splatted args from the CC is dealt with. + if name not in self.func_ir.arg_names: + sizeof = self.context.get_abi_sizeof(lltype) + self.debuginfo.mark_variable(self.builder, aptr, name=name, + lltype=lltype, size=sizeof, + line=self.loc.line, + datamodel=datamodel,) + return aptr + + def incref(self, typ, val): + if not self.context.enable_nrt: + return + + self.context.nrt.incref(self.builder, typ, val) + + def decref(self, typ, val): + if not self.context.enable_nrt: + return + + # do not associate decref with "use", it creates "jumpy" line info as + # the decrefs are usually where the ir.Del nodes are, which is at the + # end of the block. + with debuginfo.suspend_emission(self.builder): + self.context.nrt.decref(self.builder, typ, val) + + +def _lit_or_omitted(value): + """Returns a Literal instance if the type of value is supported; + otherwise, return `Omitted(value)`. + """ + try: + return types.literal(value) + except LiteralTypingError: + return types.Omitted(value) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/new_boxing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/new_boxing.py new file mode 100644 index 0000000000000000000000000000000000000000..83955504bf9ada44067c099bfaf5ffec80a5300d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/new_boxing.py @@ -0,0 +1,1362 @@ +""" +Boxing and unboxing of native Numba values to / from CPython objects. +""" + +from llvmlite import ir + +from numba.core import types, cgutils +from numba.core.pythonapi import box, unbox, reflect, NativeValue +from numba.core.errors import NumbaNotImplementedError, TypingError +from numba.core.typing.typeof import typeof, Purpose + +from numba.cpython import setobj, listobj +from numba.np import numpy_support +from contextlib import contextmanager, ExitStack + + +# +# Scalar types +# + +def box_np_scalars(typ, val, c, py_boxing_func, py_type): + py_scalar = py_boxing_func(py_type, val, c) + np_scalar = cgutils.alloca_once_value(c.builder, c.pyapi.borrow_none()) + with cgutils.if_likely(c.builder, cgutils.is_not_null(c.builder, py_scalar)): + numpy_name = c.context.insert_const_string(c.builder.module, 'numpy') + numpy_module = c.pyapi.import_module(numpy_name) + with cgutils.if_likely(c.builder, cgutils.is_not_null(c.builder, numpy_module)): + type_str = typ.name.split('np_')[1] + np_scalar_constructor = c.pyapi.object_getattr_string(numpy_module, type_str) + c.pyapi.decref(numpy_module) + with cgutils.if_likely(c.builder, cgutils.is_not_null(c.builder, np_scalar_constructor)): + c.builder.store(c.pyapi.call_function_objargs(np_scalar_constructor, (py_scalar,)), np_scalar) + c.pyapi.decref(np_scalar_constructor) + c.pyapi.decref(py_scalar) + return c.builder.load(np_scalar) + + +@box(types.PythonBoolean) +def box_py_bool(typ, val, c): + return c.pyapi.bool_from_bool(val) + + +@box(types.NumPyBoolean) +def box_np_bool(typ, val, c): + return box_np_scalars(typ, val, c, box_py_bool, types.py_bool) + + +@unbox(types.PythonBoolean) +@unbox(types.NumPyBoolean) +def unbox_boolean(typ, obj, c): + istrue = c.pyapi.object_istrue(obj) + zero = ir.Constant(istrue.type, 0) + val = c.builder.icmp_signed('!=', istrue, zero) + return NativeValue(val, is_error=c.pyapi.c_api_error()) + + +@box(types.PythonIntegerLiteral) +@box(types.PythonBooleanLiteral) +@box(types.NumPyIntegerLiteral) +@box(types.NumPyBooleanLiteral) +def box_literal_integer(typ, val, c): + val = c.context.cast(c.builder, val, typ, typ.literal_type) + return c.box(typ.literal_type, val) + + +@unbox(types.PythonInteger) +@unbox(types.NumPyInteger) +def unbox_integer(typ, obj, c): + ll_type = c.context.get_argument_type(typ) + val = cgutils.alloca_once(c.builder, ll_type) + longobj = c.pyapi.number_long(obj) + with c.pyapi.if_object_ok(longobj): + if typ.signed: + llval = c.pyapi.long_as_longlong(longobj) + else: + llval = c.pyapi.long_as_ulonglong(longobj) + c.pyapi.decref(longobj) + c.builder.store(c.builder.trunc(llval, ll_type), val) + return NativeValue(c.builder.load(val), + is_error=c.pyapi.c_api_error()) + + +@box(types.PythonInteger) +def box_py_integer(typ, val, c): + ival = c.builder.sext(val, c.pyapi.longlong) + return c.pyapi.long_from_longlong(ival) + + +@box(types.NumPyInteger) +def box_np_integer(typ, val, c): + return box_np_scalars(typ, val, c, box_py_integer, types.py_int) + + +@box(types.PythonFloat) +def box_py_float(typ, val, c): + return c.pyapi.float_from_double(val) + + +@box(types.NumPyFloat) +def box_np_float(typ, val, c): + if typ.bitwidth <= 32: + val = c.builder.fpext(val, c.pyapi.double) + return box_np_scalars(typ, val, c, box_py_float, types.py_float) + + +@unbox(types.PythonFloat) +@unbox(types.NumPyFloat) +def unbox_float(typ, obj, c): + fobj = c.pyapi.number_float(obj) + dbval = c.pyapi.float_as_double(fobj) + c.pyapi.decref(fobj) + if typ.bitwidth <= 32: + val = c.builder.fptrunc(dbval, + c.context.get_argument_type(typ)) + else: + val = dbval + return NativeValue(val, is_error=c.pyapi.c_api_error()) + + +@box(types.PythonComplex) +def box_py_complex(typ, val, c): + cval = c.context.make_complex(c.builder, typ, value=val) + assert typ == types.py_complex + freal, fimag = cval.real, cval.imag + return c.pyapi.complex_from_doubles(freal, fimag) + + +@unbox(types.PythonComplex) +@unbox(types.NumPyComplex) +def unbox_py_complex(typ, obj, c): + c128 = c.context.make_complex(c.builder, types.py_complex) + ok = c.pyapi.complex_adaptor(obj, c128._getpointer()) + failed = cgutils.is_false(c.builder, ok) + + with cgutils.if_unlikely(c.builder, failed): + c.pyapi.err_set_string("PyExc_TypeError", + "conversion to %s failed" % (typ,)) + + if typ == types.np_complex64: + # Downcast to complex64 if necessary + cplx = c.context.make_complex(c.builder, typ) + cplx.real = c.context.cast(c.builder, c128.real, + types.py_float, types.np_float32) + cplx.imag = c.context.cast(c.builder, c128.imag, + types.py_float, types.np_float32) + else: + cplx = c128 + + return NativeValue(cplx._getvalue(), is_error=failed) + + +@box(types.NumPyComplex) +def box_np_complex(typ, val, c): + cval = c.context.make_complex(c.builder, typ, value=val) + if typ == types.np_complex64: + freal = c.builder.fpext(cval.real, c.pyapi.double) + fimag = c.builder.fpext(cval.imag, c.pyapi.double) + else: + assert typ == types.np_complex128 + freal, fimag = cval.real, cval.imag + py_scalar = c.pyapi.complex_from_doubles(freal, fimag) + np_scalar = cgutils.alloca_once_value(c.builder, c.pyapi.borrow_none()) + with cgutils.if_likely(c.builder, cgutils.is_not_null(c.builder, py_scalar)): + numpy_name = c.context.insert_const_string(c.builder.module, 'numpy') + numpy_module = c.pyapi.import_module(numpy_name) + type_str = typ.name.split('np_')[1] + np_scalar_constructor = c.pyapi.object_getattr_string(numpy_module, type_str) + with cgutils.if_likely(c.builder, cgutils.is_not_null(c.builder, np_scalar_constructor)): + c.builder.store(c.pyapi.call_function_objargs(np_scalar_constructor, (py_scalar,)), np_scalar) + c.pyapi.decref(np_scalar_constructor) + c.pyapi.decref(py_scalar) + return c.builder.load(np_scalar) + + +@box(types.NoneType) +def box_none(typ, val, c): + return c.pyapi.make_none() + +@unbox(types.NoneType) +@unbox(types.EllipsisType) +def unbox_none(typ, val, c): + return NativeValue(c.context.get_dummy_value()) + + +@box(types.NPDatetime) +def box_npdatetime(typ, val, c): + return c.pyapi.create_np_datetime(val, typ.unit_code) + +@unbox(types.NPDatetime) +def unbox_npdatetime(typ, obj, c): + val = c.pyapi.extract_np_datetime(obj) + return NativeValue(val, is_error=c.pyapi.c_api_error()) + + +@box(types.NPTimedelta) +def box_nptimedelta(typ, val, c): + return c.pyapi.create_np_timedelta(val, typ.unit_code) + +@unbox(types.NPTimedelta) +def unbox_nptimedelta(typ, obj, c): + val = c.pyapi.extract_np_timedelta(obj) + return NativeValue(val, is_error=c.pyapi.c_api_error()) + + +@box(types.RawPointer) +def box_raw_pointer(typ, val, c): + """ + Convert a raw pointer to a Python int. + """ + ll_intp = c.context.get_value_type(types.uintp) + addr = c.builder.ptrtoint(val, ll_intp) + return c.box(types.uintp, addr) + + +@box(types.EnumMember) +def box_enum(typ, val, c): + """ + Fetch an enum member given its native value. + """ + valobj = c.box(typ.dtype, val) + # Call the enum class with the value object + cls_obj = c.pyapi.unserialize(c.pyapi.serialize_object(typ.instance_class)) + return c.pyapi.call_function_objargs(cls_obj, (valobj,)) + + +@unbox(types.EnumMember) +def unbox_enum(typ, obj, c): + """ + Convert an enum member's value to its native value. + """ + valobj = c.pyapi.object_getattr_string(obj, "value") + return c.unbox(typ.dtype, valobj) + + +@box(types.UndefVar) +def box_undefvar(typ, val, c): + """This type cannot be boxed, there's no Python equivalent""" + msg = ("UndefVar type cannot be boxed, there is no Python equivalent of " + "this type.") + raise TypingError(msg) + +# +# Composite types +# + +@box(types.Record) +def box_record(typ, val, c): + # Note we will create a copy of the record + # This is the only safe way. + size = ir.Constant(ir.IntType(32), val.type.pointee.count) + ptr = c.builder.bitcast(val, ir.PointerType(ir.IntType(8))) + return c.pyapi.recreate_record(ptr, size, typ.dtype, c.env_manager) + + +@unbox(types.Record) +def unbox_record(typ, obj, c): + buf = c.pyapi.alloca_buffer() + ptr = c.pyapi.extract_record_data(obj, buf) + is_error = cgutils.is_null(c.builder, ptr) + + ltyp = c.context.get_value_type(typ) + val = c.builder.bitcast(ptr, ltyp) + + def cleanup(): + c.pyapi.release_buffer(buf) + return NativeValue(val, cleanup=cleanup, is_error=is_error) + + +@box(types.UnicodeCharSeq) +def box_unicodecharseq(typ, val, c): + # XXX could kind be determined from strptr? + unicode_kind = { + 1: c.pyapi.py_unicode_1byte_kind, + 2: c.pyapi.py_unicode_2byte_kind, + 4: c.pyapi.py_unicode_4byte_kind}[numpy_support.sizeof_unicode_char] + kind = c.context.get_constant(types.int32, unicode_kind) + rawptr = cgutils.alloca_once_value(c.builder, value=val) + strptr = c.builder.bitcast(rawptr, c.pyapi.cstring) + + fullsize = c.context.get_constant(types.intp, typ.count) + zero = fullsize.type(0) + one = fullsize.type(1) + step = fullsize.type(numpy_support.sizeof_unicode_char) + count = cgutils.alloca_once_value(c.builder, zero) + with cgutils.loop_nest(c.builder, [fullsize], fullsize.type) as [idx]: + # Get char at idx + ch = c.builder.load(c.builder.gep(strptr, [c.builder.mul(idx, step)])) + # If the char is a non-null-byte, store the next index as count + with c.builder.if_then(cgutils.is_not_null(c.builder, ch)): + c.builder.store(c.builder.add(idx, one), count) + strlen = c.builder.load(count) + return c.pyapi.string_from_kind_and_data(kind, strptr, strlen) + + +@unbox(types.UnicodeCharSeq) +def unbox_unicodecharseq(typ, obj, c): + lty = c.context.get_value_type(typ) + + ok, buffer, size, kind, is_ascii, hashv = \ + c.pyapi.string_as_string_size_and_kind(obj) + + # If conversion is ok, copy the buffer to the output storage. + with cgutils.if_likely(c.builder, ok): + # Check if the returned string size fits in the charseq + storage_size = ir.Constant(size.type, typ.count) + size_fits = c.builder.icmp_unsigned("<=", size, storage_size) + + # Allow truncation of string + size = c.builder.select(size_fits, size, storage_size) + + # Initialize output to zero bytes + null_string = ir.Constant(lty, None) + outspace = cgutils.alloca_once_value(c.builder, null_string) + + # We don't need to set the NULL-terminator because the storage + # is already zero-filled. + cgutils.memcpy(c.builder, + c.builder.bitcast(outspace, buffer.type), + buffer, size) + + ret = c.builder.load(outspace) + return NativeValue(ret, is_error=c.builder.not_(ok)) + + +@box(types.Bytes) +def box_bytes(typ, val, c): + obj = c.context.make_helper(c.builder, typ, val) + ret = c.pyapi.bytes_from_string_and_size(obj.data, obj.nitems) + c.context.nrt.decref(c.builder, typ, val) + return ret + + +@box(types.CharSeq) +def box_charseq(typ, val, c): + rawptr = cgutils.alloca_once_value(c.builder, value=val) + strptr = c.builder.bitcast(rawptr, c.pyapi.cstring) + fullsize = c.context.get_constant(types.intp, typ.count) + zero = fullsize.type(0) + one = fullsize.type(1) + count = cgutils.alloca_once_value(c.builder, zero) + + # Find the length of the string, mimicking Numpy's behaviour: + # search for the last non-null byte in the underlying storage + # (e.g. b'A\0\0B\0\0\0' will return the logical string b'A\0\0B') + with cgutils.loop_nest(c.builder, [fullsize], fullsize.type) as [idx]: + # Get char at idx + ch = c.builder.load(c.builder.gep(strptr, [idx])) + # If the char is a non-null-byte, store the next index as count + with c.builder.if_then(cgutils.is_not_null(c.builder, ch)): + c.builder.store(c.builder.add(idx, one), count) + + strlen = c.builder.load(count) + return c.pyapi.bytes_from_string_and_size(strptr, strlen) + + +@unbox(types.CharSeq) +def unbox_charseq(typ, obj, c): + lty = c.context.get_value_type(typ) + ok, buffer, size = c.pyapi.string_as_string_and_size(obj) + + # If conversion is ok, copy the buffer to the output storage. + with cgutils.if_likely(c.builder, ok): + # Check if the returned string size fits in the charseq + storage_size = ir.Constant(size.type, typ.count) + size_fits = c.builder.icmp_unsigned("<=", size, storage_size) + + # Allow truncation of string + size = c.builder.select(size_fits, size, storage_size) + + # Initialize output to zero bytes + null_string = ir.Constant(lty, None) + outspace = cgutils.alloca_once_value(c.builder, null_string) + + # We don't need to set the NULL-terminator because the storage + # is already zero-filled. + cgutils.memcpy(c.builder, + c.builder.bitcast(outspace, buffer.type), + buffer, size) + + ret = c.builder.load(outspace) + return NativeValue(ret, is_error=c.builder.not_(ok)) + + +@box(types.Optional) +def box_optional(typ, val, c): + optval = c.context.make_helper(c.builder, typ, val) + ret = cgutils.alloca_once_value(c.builder, c.pyapi.borrow_none()) + with c.builder.if_else(optval.valid) as (then, otherwise): + with then: + validres = c.box(typ.type, optval.data) + c.builder.store(validres, ret) + with otherwise: + c.builder.store(c.pyapi.make_none(), ret) + return c.builder.load(ret) + + +@unbox(types.Optional) +def unbox_optional(typ, obj, c): + """ + Convert object *obj* to a native optional structure. + """ + noneval = c.context.make_optional_none(c.builder, typ.type) + is_not_none = c.builder.icmp_signed('!=', obj, c.pyapi.borrow_none()) + + retptr = cgutils.alloca_once(c.builder, noneval.type) + errptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + + with c.builder.if_else(is_not_none) as (then, orelse): + with then: + native = c.unbox(typ.type, obj) + just = c.context.make_optional_value(c.builder, + typ.type, native.value) + c.builder.store(just, retptr) + c.builder.store(native.is_error, errptr) + + with orelse: + c.builder.store(noneval, retptr) + + if native.cleanup is not None: + def cleanup(): + with c.builder.if_then(is_not_none): + native.cleanup() + else: + cleanup = None + + ret = c.builder.load(retptr) + return NativeValue(ret, is_error=c.builder.load(errptr), + cleanup=cleanup) + + +@unbox(types.SliceType) +def unbox_slice(typ, obj, c): + """ + Convert object *obj* to a native slice structure. + """ + from numba.cpython import slicing + ok, start, stop, step = c.pyapi.slice_as_ints(obj) + sli = c.context.make_helper(c.builder, typ) + sli.start = start + sli.stop = stop + sli.step = step + return NativeValue(sli._getvalue(), is_error=c.builder.not_(ok)) + +@box(types.SliceLiteral) +def box_slice_literal(typ, val, c): + # Check for integer overflows at compile time. + slice_lit = typ.literal_value + for field_name in ("start", "stop", "step"): + field_obj = getattr(slice_lit, field_name) + if isinstance(field_obj, int): + try: + typeof(field_obj, Purpose) + except ValueError as e: + raise ValueError(( + f"Unable to create literal slice. " + f"Error encountered with {field_name} " + f"attribute. {str(e)}") + ) + + py_ctor, py_args = typ.literal_value.__reduce__() + serialized_ctor = c.pyapi.serialize_object(py_ctor) + serialized_args = c.pyapi.serialize_object(py_args) + ctor = c.pyapi.unserialize(serialized_ctor) + args = c.pyapi.unserialize(serialized_args) + obj = c.pyapi.call(ctor, args) + c.pyapi.decref(ctor) + c.pyapi.decref(args) + return obj + +@unbox(types.StringLiteral) +def unbox_string_literal(typ, obj, c): + # A string literal is a dummy value + return NativeValue(c.context.get_dummy_value()) + +# +# Collections +# + +# NOTE: boxing functions are supposed to steal any NRT references in +# the given native value. + +@box(types.Array) +def box_array(typ, val, c): + nativearycls = c.context.make_array(typ) + nativeary = nativearycls(c.context, c.builder, value=val) + if c.context.enable_nrt: + np_dtype = numpy_support.as_dtype(typ.dtype) + dtypeptr = c.env_manager.read_const(c.env_manager.add_const(np_dtype)) + newary = c.pyapi.nrt_adapt_ndarray_to_python(typ, val, dtypeptr) + # Steals NRT ref + c.context.nrt.decref(c.builder, typ, val) + return newary + else: + parent = nativeary.parent + c.pyapi.incref(parent) + return parent + + +@unbox(types.Buffer) +def unbox_buffer(typ, obj, c): + """ + Convert a Py_buffer-providing object to a native array structure. + """ + buf = c.pyapi.alloca_buffer() + res = c.pyapi.get_buffer(obj, buf) + is_error = cgutils.is_not_null(c.builder, res) + + nativearycls = c.context.make_array(typ) + nativeary = nativearycls(c.context, c.builder) + aryptr = nativeary._getpointer() + + with cgutils.if_likely(c.builder, c.builder.not_(is_error)): + ptr = c.builder.bitcast(aryptr, c.pyapi.voidptr) + if c.context.enable_nrt: + c.pyapi.nrt_adapt_buffer_from_python(buf, ptr) + else: + c.pyapi.numba_buffer_adaptor(buf, ptr) + + def cleanup(): + c.pyapi.release_buffer(buf) + + return NativeValue(c.builder.load(aryptr), is_error=is_error, + cleanup=cleanup) + +@unbox(types.Array) +def unbox_array(typ, obj, c): + """ + Convert a Numpy array object to a native array structure. + """ + # This is necessary because unbox_buffer() does not work on some + # dtypes, e.g. datetime64 and timedelta64. + # TODO check matching dtype. + # currently, mismatching dtype will still work and causes + # potential memory corruption + nativearycls = c.context.make_array(typ) + nativeary = nativearycls(c.context, c.builder) + aryptr = nativeary._getpointer() + + ptr = c.builder.bitcast(aryptr, c.pyapi.voidptr) + if c.context.enable_nrt: + errcode = c.pyapi.nrt_adapt_ndarray_from_python(obj, ptr) + else: + errcode = c.pyapi.numba_array_adaptor(obj, ptr) + + # TODO: here we have minimal typechecking by the itemsize. + # need to do better + try: + expected_itemsize = numpy_support.as_dtype(typ.dtype).itemsize + except NumbaNotImplementedError: + # Don't check types that can't be `as_dtype()`-ed + itemsize_mismatch = cgutils.false_bit + else: + expected_itemsize = nativeary.itemsize.type(expected_itemsize) + itemsize_mismatch = c.builder.icmp_unsigned( + '!=', + nativeary.itemsize, + expected_itemsize, + ) + + failed = c.builder.or_( + cgutils.is_not_null(c.builder, errcode), + itemsize_mismatch, + ) + # Handle error + with c.builder.if_then(failed, likely=False): + c.pyapi.err_set_string("PyExc_TypeError", + "can't unbox array from PyObject into " + "native value. The object maybe of a " + "different type") + return NativeValue(c.builder.load(aryptr), is_error=failed) + + +@box(types.Tuple) +@box(types.UniTuple) +def box_tuple(typ, val, c): + """ + Convert native array or structure *val* to a tuple object. + """ + tuple_val = c.pyapi.tuple_new(typ.count) + + for i, dtype in enumerate(typ): + item = c.builder.extract_value(val, i) + obj = c.box(dtype, item) + c.pyapi.tuple_setitem(tuple_val, i, obj) + + return tuple_val + +@box(types.NamedTuple) +@box(types.NamedUniTuple) +def box_namedtuple(typ, val, c): + """ + Convert native array or structure *val* to a namedtuple object. + """ + cls_obj = c.pyapi.unserialize(c.pyapi.serialize_object(typ.instance_class)) + tuple_obj = box_tuple(typ, val, c) + obj = c.pyapi.call(cls_obj, tuple_obj) + c.pyapi.decref(cls_obj) + c.pyapi.decref(tuple_obj) + return obj + + +@unbox(types.BaseTuple) +def unbox_tuple(typ, obj, c): + """ + Convert tuple *obj* to a native array (if homogeneous) or structure. + """ + n = len(typ) + values = [] + cleanups = [] + lty = c.context.get_value_type(typ) + + is_error_ptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + value_ptr = cgutils.alloca_once(c.builder, lty) + + # Issue #1638: need to check the tuple size + actual_size = c.pyapi.tuple_size(obj) + size_matches = c.builder.icmp_unsigned('==', actual_size, + ir.Constant(actual_size.type, n)) + with c.builder.if_then(c.builder.not_(size_matches), likely=False): + c.pyapi.err_format( + "PyExc_ValueError", + "size mismatch for tuple, expected %d element(s) but got %%zd" % (n,), + actual_size) + c.builder.store(cgutils.true_bit, is_error_ptr) + + # We unbox the items even if not `size_matches`, to avoid issues with + # the generated IR (instruction doesn't dominate all uses) + for i, eltype in enumerate(typ): + elem = c.pyapi.tuple_getitem(obj, i) + native = c.unbox(eltype, elem) + values.append(native.value) + with c.builder.if_then(native.is_error, likely=False): + c.builder.store(cgutils.true_bit, is_error_ptr) + if native.cleanup is not None: + cleanups.append(native.cleanup) + + value = c.context.make_tuple(c.builder, typ, values) + c.builder.store(value, value_ptr) + + if cleanups: + with c.builder.if_then(size_matches, likely=True): + def cleanup(): + for func in reversed(cleanups): + func() + else: + cleanup = None + + return NativeValue(c.builder.load(value_ptr), cleanup=cleanup, + is_error=c.builder.load(is_error_ptr)) + + +@box(types.List) +def box_list(typ, val, c): + """ + Convert native list *val* to a list object. + """ + list = listobj.ListInstance(c.context, c.builder, typ, val) + obj = list.parent + res = cgutils.alloca_once_value(c.builder, obj) + with c.builder.if_else(cgutils.is_not_null(c.builder, obj)) as (has_parent, otherwise): + with has_parent: + # List is actually reflected => return the original object + # (note not all list instances whose *type* is reflected are + # actually reflected; see numba.tests.test_lists for an example) + c.pyapi.incref(obj) + + with otherwise: + # Build a new Python list + nitems = list.size + obj = c.pyapi.list_new(nitems) + with c.builder.if_then(cgutils.is_not_null(c.builder, obj), + likely=True): + with cgutils.for_range(c.builder, nitems) as loop: + item = list.getitem(loop.index) + list.incref_value(item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_setitem(obj, loop.index, itemobj) + + c.builder.store(obj, res) + + # Steal NRT ref + c.context.nrt.decref(c.builder, typ, val) + return c.builder.load(res) + + +class _NumbaTypeHelper(object): + """A helper for acquiring `numba.typeof` for type checking. + + Usage + ----- + + # `c` is the boxing context. + with _NumbaTypeHelper(c) as nth: + # This contextmanager maintains the lifetime of the `numba.typeof` + # function. + the_numba_type = nth.typeof(some_object) + # Do work on the type object + do_checks(the_numba_type) + # Cleanup + c.pyapi.decref(the_numba_type) + # At this point *nth* should not be used. + """ + def __init__(self, c): + self.c = c + + def __enter__(self): + c = self.c + numba_name = c.context.insert_const_string(c.builder.module, 'numba') + numba_mod = c.pyapi.import_module(numba_name) + typeof_fn = c.pyapi.object_getattr_string(numba_mod, 'typeof') + self.typeof_fn = typeof_fn + c.pyapi.decref(numba_mod) + return self + + def __exit__(self, *args, **kwargs): + c = self.c + c.pyapi.decref(self.typeof_fn) + + def typeof(self, obj): + res = self.c.pyapi.call_function_objargs(self.typeof_fn, [obj]) + return res + + +def _python_list_to_native(typ, obj, c, size, listptr, errorptr): + """ + Construct a new native list from a Python list. + """ + def check_element_type(nth, itemobj, expected_typobj): + typobj = nth.typeof(itemobj) + # Check if *typobj* is NULL + with c.builder.if_then( + cgutils.is_null(c.builder, typobj), + likely=False, + ): + c.builder.store(cgutils.true_bit, errorptr) + loop.do_break() + # Mandate that objects all have the same exact type + type_mismatch = c.builder.icmp_signed('!=', typobj, expected_typobj) + + with c.builder.if_then(type_mismatch, likely=False): + c.builder.store(cgutils.true_bit, errorptr) + c.pyapi.err_format( + "PyExc_TypeError", + "can't unbox heterogeneous list: %S != %S", + expected_typobj, typobj, + ) + c.pyapi.decref(typobj) + loop.do_break() + c.pyapi.decref(typobj) + + # Allocate a new native list + ok, list = listobj.ListInstance.allocate_ex(c.context, c.builder, typ, size) + with c.builder.if_else(ok, likely=True) as (if_ok, if_not_ok): + with if_ok: + list.size = size + zero = ir.Constant(size.type, 0) + with c.builder.if_then(c.builder.icmp_signed('>', size, zero), + likely=True): + # Traverse Python list and unbox objects into native list + with _NumbaTypeHelper(c) as nth: + # Note: *expected_typobj* can't be NULL + expected_typobj = nth.typeof(c.pyapi.list_getitem(obj, zero)) + with cgutils.for_range(c.builder, size) as loop: + itemobj = c.pyapi.list_getitem(obj, loop.index) + check_element_type(nth, itemobj, expected_typobj) + # XXX we don't call native cleanup for each + # list element, since that would require keeping + # of which unboxings have been successful. + native = c.unbox(typ.dtype, itemobj) + with c.builder.if_then(native.is_error, likely=False): + c.builder.store(cgutils.true_bit, errorptr) + loop.do_break() + # The reference is borrowed so incref=False + list.setitem(loop.index, native.value, incref=False) + c.pyapi.decref(expected_typobj) + if typ.reflected: + list.parent = obj + # Stuff meminfo pointer into the Python object for + # later reuse. + with c.builder.if_then(c.builder.not_(c.builder.load(errorptr)), + likely=False): + c.pyapi.object_set_private_data(obj, list.meminfo) + list.set_dirty(False) + c.builder.store(list.value, listptr) + + with if_not_ok: + c.builder.store(cgutils.true_bit, errorptr) + + # If an error occurred, drop the whole native list + with c.builder.if_then(c.builder.load(errorptr)): + c.context.nrt.decref(c.builder, typ, list.value) + + +@unbox(types.List) +def unbox_list(typ, obj, c): + """ + Convert list *obj* to a native list. + + If list was previously unboxed, we reuse the existing native list + to ensure consistency. + """ + size = c.pyapi.list_size(obj) + + errorptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + listptr = cgutils.alloca_once(c.builder, c.context.get_value_type(typ)) + + # See if the list was previously unboxed, if so, re-use the meminfo. + ptr = c.pyapi.object_get_private_data(obj) + + with c.builder.if_else(cgutils.is_not_null(c.builder, ptr)) \ + as (has_meminfo, otherwise): + + with has_meminfo: + # List was previously unboxed => reuse meminfo + list = listobj.ListInstance.from_meminfo(c.context, c.builder, typ, ptr) + list.size = size + if typ.reflected: + list.parent = obj + c.builder.store(list.value, listptr) + + with otherwise: + _python_list_to_native(typ, obj, c, size, listptr, errorptr) + + def cleanup(): + # Clean up the associated pointer, as the meminfo is now invalid. + c.pyapi.object_reset_private_data(obj) + + return NativeValue(c.builder.load(listptr), + is_error=c.builder.load(errorptr), + cleanup=cleanup) + + +@reflect(types.List) +def reflect_list(typ, val, c): + """ + Reflect the native list's contents into the Python object. + """ + if not typ.reflected: + return + if typ.dtype.reflected: + msg = "cannot reflect element of reflected container: {}\n".format(typ) + raise TypeError(msg) + + list = listobj.ListInstance(c.context, c.builder, typ, val) + with c.builder.if_then(list.dirty, likely=False): + obj = list.parent + size = c.pyapi.list_size(obj) + new_size = list.size + diff = c.builder.sub(new_size, size) + diff_gt_0 = c.builder.icmp_signed('>=', diff, + ir.Constant(diff.type, 0)) + with c.builder.if_else(diff_gt_0) as (if_grow, if_shrink): + # XXX no error checking below + with if_grow: + # First overwrite existing items + with cgutils.for_range(c.builder, size) as loop: + item = list.getitem(loop.index) + list.incref_value(item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_setitem(obj, loop.index, itemobj) + # Then add missing items + with cgutils.for_range(c.builder, diff) as loop: + idx = c.builder.add(size, loop.index) + item = list.getitem(idx) + list.incref_value(item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_append(obj, itemobj) + c.pyapi.decref(itemobj) + + with if_shrink: + # First delete list tail + c.pyapi.list_setslice(obj, new_size, size, None) + # Then overwrite remaining items + with cgutils.for_range(c.builder, new_size) as loop: + item = list.getitem(loop.index) + list.incref_value(item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_setitem(obj, loop.index, itemobj) + + # Mark the list clean, in case it is reflected twice + list.set_dirty(False) + + +def _python_set_to_native(typ, obj, c, size, setptr, errorptr): + """ + Construct a new native set from a Python set. + """ + # Allocate a new native set + ok, inst = setobj.SetInstance.allocate_ex(c.context, c.builder, typ, size) + with c.builder.if_else(ok, likely=True) as (if_ok, if_not_ok): + with if_ok: + # Traverse Python set and unbox objects into native set + typobjptr = cgutils.alloca_once_value(c.builder, + ir.Constant(c.pyapi.pyobj, None)) + + with c.pyapi.set_iterate(obj) as loop: + itemobj = loop.value + # Mandate that objects all have the same exact type + typobj = c.pyapi.get_type(itemobj) + expected_typobj = c.builder.load(typobjptr) + + with c.builder.if_else( + cgutils.is_null(c.builder, expected_typobj), + likely=False) as (if_first, if_not_first): + with if_first: + # First iteration => store item type + c.builder.store(typobj, typobjptr) + with if_not_first: + # Otherwise, check item type + type_mismatch = c.builder.icmp_signed('!=', typobj, + expected_typobj) + with c.builder.if_then(type_mismatch, likely=False): + c.builder.store(cgutils.true_bit, errorptr) + c.pyapi.err_set_string("PyExc_TypeError", + "can't unbox heterogeneous set") + loop.do_break() + + # XXX we don't call native cleanup for each set element, + # since that would require keeping track + # of which unboxings have been successful. + native = c.unbox(typ.dtype, itemobj) + with c.builder.if_then(native.is_error, likely=False): + c.builder.store(cgutils.true_bit, errorptr) + inst.add_pyapi(c.pyapi, native.value, do_resize=False) + + if typ.reflected: + inst.parent = obj + # Associate meminfo pointer with the Python object for later reuse. + with c.builder.if_then(c.builder.not_(c.builder.load(errorptr)), + likely=False): + c.pyapi.object_set_private_data(obj, inst.meminfo) + inst.set_dirty(False) + c.builder.store(inst.value, setptr) + + with if_not_ok: + c.builder.store(cgutils.true_bit, errorptr) + + # If an error occurred, drop the whole native set + with c.builder.if_then(c.builder.load(errorptr)): + c.context.nrt.decref(c.builder, typ, inst.value) + + +@unbox(types.Set) +def unbox_set(typ, obj, c): + """ + Convert set *obj* to a native set. + + If set was previously unboxed, we reuse the existing native set + to ensure consistency. + """ + size = c.pyapi.set_size(obj) + + errorptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + setptr = cgutils.alloca_once(c.builder, c.context.get_value_type(typ)) + + # See if the set was previously unboxed, if so, re-use the meminfo. + ptr = c.pyapi.object_get_private_data(obj) + + with c.builder.if_else(cgutils.is_not_null(c.builder, ptr)) \ + as (has_meminfo, otherwise): + + with has_meminfo: + # Set was previously unboxed => reuse meminfo + inst = setobj.SetInstance.from_meminfo(c.context, c.builder, typ, ptr) + if typ.reflected: + inst.parent = obj + c.builder.store(inst.value, setptr) + + with otherwise: + _python_set_to_native(typ, obj, c, size, setptr, errorptr) + + def cleanup(): + # Clean up the associated pointer, as the meminfo is now invalid. + c.pyapi.object_reset_private_data(obj) + + return NativeValue(c.builder.load(setptr), + is_error=c.builder.load(errorptr), + cleanup=cleanup) + + +def _native_set_to_python_list(typ, payload, c): + """ + Create a Python list from a native set's items. + """ + nitems = payload.used + listobj = c.pyapi.list_new(nitems) + ok = cgutils.is_not_null(c.builder, listobj) + with c.builder.if_then(ok, likely=True): + index = cgutils.alloca_once_value(c.builder, + ir.Constant(nitems.type, 0)) + with payload._iterate() as loop: + i = c.builder.load(index) + item = loop.entry.key + c.context.nrt.incref(c.builder, typ.dtype, item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_setitem(listobj, i, itemobj) + i = c.builder.add(i, ir.Constant(i.type, 1)) + c.builder.store(i, index) + + return ok, listobj + + +@box(types.Set) +def box_set(typ, val, c): + """ + Convert native set *val* to a set object. + """ + inst = setobj.SetInstance(c.context, c.builder, typ, val) + obj = inst.parent + res = cgutils.alloca_once_value(c.builder, obj) + + with c.builder.if_else(cgutils.is_not_null(c.builder, obj)) as (has_parent, otherwise): + with has_parent: + # Set is actually reflected => return the original object + # (note not all set instances whose *type* is reflected are + # actually reflected; see numba.tests.test_sets for an example) + c.pyapi.incref(obj) + + with otherwise: + # Build a new Python list and then create a set from that + payload = inst.payload + ok, listobj = _native_set_to_python_list(typ, payload, c) + with c.builder.if_then(ok, likely=True): + obj = c.pyapi.set_new(listobj) + c.pyapi.decref(listobj) + c.builder.store(obj, res) + + # Steal NRT ref + c.context.nrt.decref(c.builder, typ, val) + return c.builder.load(res) + +@reflect(types.Set) +def reflect_set(typ, val, c): + """ + Reflect the native set's contents into the Python object. + """ + if not typ.reflected: + return + inst = setobj.SetInstance(c.context, c.builder, typ, val) + payload = inst.payload + + with c.builder.if_then(payload.dirty, likely=False): + obj = inst.parent + # XXX errors are not dealt with below + c.pyapi.set_clear(obj) + + # Build a new Python list and then update the set with that + ok, listobj = _native_set_to_python_list(typ, payload, c) + with c.builder.if_then(ok, likely=True): + c.pyapi.set_update(obj, listobj) + c.pyapi.decref(listobj) + + # Mark the set clean, in case it is reflected twice + inst.set_dirty(False) + + +# +# Other types +# + +@box(types.Generator) +def box_generator(typ, val, c): + return c.pyapi.from_native_generator(val, typ, c.env_manager.env_ptr) + +@unbox(types.Generator) +def unbox_generator(typ, obj, c): + return c.pyapi.to_native_generator(obj, typ) + + +@box(types.DType) +def box_dtype(typ, val, c): + np_dtype = numpy_support.as_dtype(typ.dtype) + return c.pyapi.unserialize(c.pyapi.serialize_object(np_dtype)) + +@unbox(types.DType) +def unbox_dtype(typ, val, c): + return NativeValue(c.context.get_dummy_value()) + + +@box(types.NumberClass) +def box_number_class(typ, val, c): + np_dtype = numpy_support.as_dtype(typ.dtype) + return c.pyapi.unserialize(c.pyapi.serialize_object(np_dtype)) + +@unbox(types.NumberClass) +def unbox_number_class(typ, val, c): + return NativeValue(c.context.get_dummy_value()) + + +@box(types.PyObject) +@box(types.Object) +def box_pyobject(typ, val, c): + return val + +@unbox(types.PyObject) +@unbox(types.Object) +def unbox_pyobject(typ, obj, c): + return NativeValue(obj) + + +@unbox(types.ExternalFunctionPointer) +def unbox_funcptr(typ, obj, c): + if typ.get_pointer is None: + raise NotImplementedError(typ) + + # Call get_pointer() on the object to get the raw pointer value + ptrty = c.context.get_function_pointer_type(typ) + ret = cgutils.alloca_once_value(c.builder, + ir.Constant(ptrty, None), + name='fnptr') + ser = c.pyapi.serialize_object(typ.get_pointer) + get_pointer = c.pyapi.unserialize(ser) + with cgutils.if_likely(c.builder, + cgutils.is_not_null(c.builder, get_pointer)): + intobj = c.pyapi.call_function_objargs(get_pointer, (obj,)) + c.pyapi.decref(get_pointer) + with cgutils.if_likely(c.builder, + cgutils.is_not_null(c.builder, intobj)): + ptr = c.pyapi.long_as_voidptr(intobj) + c.pyapi.decref(intobj) + c.builder.store(c.builder.bitcast(ptr, ptrty), ret) + return NativeValue(c.builder.load(ret), is_error=c.pyapi.c_api_error()) + +@box(types.DeferredType) +def box_deferred(typ, val, c): + out = c.pyapi.from_native_value(typ.get(), + c.builder.extract_value(val, [0]), + env_manager=c.env_manager) + return out + + +@unbox(types.DeferredType) +def unbox_deferred(typ, obj, c): + native_value = c.pyapi.to_native_value(typ.get(), obj) + model = c.context.data_model_manager[typ] + res = model.set(c.builder, model.make_uninitialized(), native_value.value) + return NativeValue(res, is_error=native_value.is_error, + cleanup=native_value.cleanup) + + +@unbox(types.Dispatcher) +def unbox_dispatcher(typ, obj, c): + # In native code, Dispatcher types can be casted to FunctionType. + return NativeValue(obj) + + +@box(types.Dispatcher) +def box_pyobject(typ, val, c): + c.pyapi.incref(val) + return val + + +def unbox_unsupported(typ, obj, c): + c.pyapi.err_set_string("PyExc_TypeError", + "can't unbox {!r} type".format(typ)) + res = c.context.get_constant_null(typ) + return NativeValue(res, is_error=cgutils.true_bit) + + +def box_unsupported(typ, val, c): + msg = "cannot convert native %s to Python object" % (typ,) + c.pyapi.err_set_string("PyExc_TypeError", msg) + res = c.pyapi.get_null_object() + return res + + +@box(types.Literal) +def box_literal(typ, val, c): + # Const type contains the python object of the constant value, + # which we can directly return. + retval = typ.literal_value + # Serialize the value into the IR + return c.pyapi.unserialize(c.pyapi.serialize_object(retval)) + + +@box(types.MemInfoPointer) +def box_meminfo_pointer(typ, val, c): + return c.pyapi.nrt_meminfo_as_pyobject(val) + + +@unbox(types.MemInfoPointer) +def unbox_meminfo_pointer(typ, obj, c): + res = c.pyapi.nrt_meminfo_from_pyobject(obj) + errored = cgutils.is_null(c.builder, res) + return NativeValue(res, is_error=errored) + +@unbox(types.TypeRef) +def unbox_typeref(typ, val, c): + return NativeValue(c.context.get_dummy_value(), is_error=cgutils.false_bit) + + +@box(types.LiteralStrKeyDict) +def box_LiteralStrKeyDict(typ, val, c): + return box_unsupported(typ, val, c) + + +# Original implementation at: https://github.com/numba/numba/issues/4499#issuecomment-1063138477 +@unbox(types.NumPyRandomBitGeneratorType) +def unbox_numpy_random_bitgenerator(typ, obj, c): + """ + The bit_generator instance has a `.ctypes` attr which is a namedtuple + with the following members (types): + * state_address (Python int) + * state (ctypes.c_void_p) + * next_uint64 (ctypes.CFunctionType instance) + * next_uint32 (ctypes.CFunctionType instance) + * next_double (ctypes.CFunctionType instance) + * bit_generator (ctypes.c_void_p) + """ + + is_error_ptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + extra_refs = [] + + def clear_extra_refs(): + for _ref in extra_refs: + c.pyapi.decref(_ref) + + def handle_failure(): + c.builder.store(cgutils.true_bit, is_error_ptr) + clear_extra_refs() + + with ExitStack() as stack: + + def object_getattr_safely(obj, attr): + attr_obj = c.pyapi.object_getattr_string(obj, attr) + extra_refs.append(attr_obj) + return attr_obj + + struct_ptr = cgutils.create_struct_proxy(typ)(c.context, c.builder) + struct_ptr.parent = obj + + # Get the .ctypes attr + ctypes_binding = object_getattr_safely(obj, 'ctypes') + with cgutils.early_exit_if_null(c.builder, stack, ctypes_binding): + handle_failure() + + # Look up the "state_address" member and wire it into the struct + interface_state_address = object_getattr_safely( + ctypes_binding, 'state_address') + with cgutils.early_exit_if_null(c.builder, stack, interface_state_address): + handle_failure() + + setattr(struct_ptr, 'state_address', + c.unbox(types.uintp, interface_state_address).value) + + # Look up the "state" member and wire it into the struct + interface_state = object_getattr_safely(ctypes_binding, 'state') + with cgutils.early_exit_if_null(c.builder, stack, interface_state): + handle_failure() + + interface_state_value = object_getattr_safely( + interface_state, 'value') + with cgutils.early_exit_if_null(c.builder, stack, interface_state_value): + handle_failure() + setattr( + struct_ptr, + 'state', + c.unbox( + types.uintp, + interface_state_value).value) + + # Want to store callable function pointers to these CFunctionTypes, so + # import ctypes and use it to cast the CFunctionTypes to c_void_p and + # store the results. + # First find ctypes.cast, and ctypes.c_void_p + ctypes_name = c.context.insert_const_string(c.builder.module, 'ctypes') + ctypes_module = c.pyapi.import_module(ctypes_name) + extra_refs.append(ctypes_module) + with cgutils.early_exit_if_null(c.builder, stack, ctypes_module): + handle_failure() + + ct_cast = object_getattr_safely(ctypes_module, 'cast') + with cgutils.early_exit_if_null(c.builder, stack, ct_cast): + handle_failure() + + ct_voidptr_ty = object_getattr_safely(ctypes_module, 'c_void_p') + with cgutils.early_exit_if_null(c.builder, stack, ct_voidptr_ty): + handle_failure() + + # This wires in the fnptrs referred to by name + def wire_in_fnptrs(name): + # Find the CFunctionType function + interface_next_fn = c.pyapi.object_getattr_string( + ctypes_binding, name) + + extra_refs.append(interface_next_fn) + with cgutils.early_exit_if_null(c.builder, stack, interface_next_fn): + handle_failure() + + # Want to do ctypes.cast(CFunctionType, ctypes.c_void_p), create an + # args tuple for that. + args = c.pyapi.tuple_pack([interface_next_fn, ct_voidptr_ty]) + with cgutils.early_exit_if_null(c.builder, stack, args): + handle_failure() + + # Call ctypes.cast() + interface_next_fn_casted = c.pyapi.call(ct_cast, args) + + # Fetch the .value attr on the resulting ctypes.c_void_p for storage + # in the function pointer slot. + interface_next_fn_casted_value = object_getattr_safely( + interface_next_fn_casted, 'value') + with cgutils.early_exit_if_null(c.builder, stack, interface_next_fn_casted_value): + handle_failure() + + # Wire up + setattr(struct_ptr, f'fnptr_{name}', + c.unbox(types.uintp, interface_next_fn_casted_value).value) + + + wire_in_fnptrs('next_double') + wire_in_fnptrs('next_uint64') + wire_in_fnptrs('next_uint32') + + clear_extra_refs() + + return NativeValue(struct_ptr._getvalue(), is_error=c.builder.load(is_error_ptr)) + +_bit_gen_type = types.NumPyRandomBitGeneratorType('bit_generator') + +@unbox(types.NumPyRandomGeneratorType) +def unbox_numpy_random_generator(typ, obj, c): + """ + Here we're creating a NumPyRandomGeneratorType StructModel with following fields: + * ('bit_generator', _bit_gen_type): The unboxed BitGenerator associated with + this Generator object instance. + * ('parent', types.pyobject): Pointer to the original Generator PyObject. + * ('meminfo', types.MemInfoPointer(types.voidptr)): The information about the memory + stored at the pointer (to the original Generator PyObject). This is useful for + keeping track of reference counts within the Python runtime. Helps prevent cases + where deletion happens in Python runtime without NRT being awareness of it. + """ + is_error_ptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + + with ExitStack() as stack: + struct_ptr = cgutils.create_struct_proxy(typ)(c.context, c.builder) + bit_gen_inst = c.pyapi.object_getattr_string(obj, 'bit_generator') + with cgutils.early_exit_if_null(c.builder, stack, bit_gen_inst): + c.builder.store(cgutils.true_bit, is_error_ptr) + unboxed = c.unbox(_bit_gen_type, bit_gen_inst).value + struct_ptr.bit_generator = unboxed + struct_ptr.parent = obj + NULL = cgutils.voidptr_t(None) + struct_ptr.meminfo = c.pyapi.nrt_meminfo_new_from_pyobject( + NULL, # there's no data + obj, # the python object, the call to nrt_meminfo_new_from_pyobject + # will py_incref + ) + c.pyapi.decref(bit_gen_inst) + + return NativeValue(struct_ptr._getvalue(), is_error=c.builder.load(is_error_ptr)) + + +@box(types.NumPyRandomGeneratorType) +def box_numpy_random_generator(typ, val, c): + inst = c.context.make_helper(c.builder, typ, val) + obj = inst.parent + res = cgutils.alloca_once_value(c.builder, obj) + c.pyapi.incref(obj) + # Steal NRT ref + c.context.nrt.decref(c.builder, typ, val) + return c.builder.load(res) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/object_mode_passes.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/object_mode_passes.py new file mode 100644 index 0000000000000000000000000000000000000000..f5b463c14b14e018df3fafdc68e0d7a5ca92489a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/object_mode_passes.py @@ -0,0 +1,147 @@ +from numba.core import (types, typing, funcdesc, config, pylowering, transforms, + errors) +from numba.core.compiler_machinery import (FunctionPass, LoweringPass, + register_pass) +from collections import defaultdict +import warnings + + +@register_pass(mutates_CFG=True, analysis_only=False) +class ObjectModeFrontEnd(FunctionPass): + _name = "object_mode_front_end" + + def __init__(self): + FunctionPass.__init__(self) + + def _frontend_looplift(self, state): + """ + Loop lifting analysis and transformation + """ + loop_flags = state.flags.copy() + outer_flags = state.flags.copy() + # Do not recursively loop lift + outer_flags.enable_looplift = False + loop_flags.enable_looplift = False + if not state.flags.enable_pyobject_looplift: + loop_flags.enable_pyobject = False + loop_flags.enable_ssa = False + + main, loops = transforms.loop_lifting(state.func_ir, + typingctx=state.typingctx, + targetctx=state.targetctx, + locals=state.locals, + flags=loop_flags) + if loops: + # Some loops were extracted + if config.DEBUG_FRONTEND or config.DEBUG: + for loop in loops: + print("Lifting loop", loop.get_source_location()) + from numba.core.compiler import compile_ir + cres = compile_ir(state.typingctx, state.targetctx, main, + state.args, state.return_type, + outer_flags, state.locals, + lifted=tuple(loops), lifted_from=None, + is_lifted_loop=True) + return cres + + def run_pass(self, state): + from numba.core.compiler import _EarlyPipelineCompletion + # NOTE: That so much stuff, including going back into the compiler, is + # captured in a single pass is not ideal. + if state.flags.enable_looplift: + assert not state.lifted + cres = self._frontend_looplift(state) + if cres is not None: + raise _EarlyPipelineCompletion(cres) + + # Fallback typing: everything is a python object + state.typemap = defaultdict(lambda: types.pyobject) + state.calltypes = defaultdict(lambda: types.pyobject) + state.return_type = types.pyobject + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class ObjectModeBackEnd(LoweringPass): + + _name = "object_mode_back_end" + + def __init__(self): + LoweringPass.__init__(self) + + def _py_lowering_stage(self, targetctx, library, interp, flags): + fndesc = funcdesc.PythonFunctionDescriptor.from_object_mode_function( + interp + ) + with targetctx.push_code_library(library): + lower = pylowering.PyLower(targetctx, library, fndesc, interp) + lower.lower() + if not flags.no_cpython_wrapper: + lower.create_cpython_wrapper() + env = lower.env + call_helper = lower.call_helper + del lower + from numba.core.compiler import _LowerResult # TODO: move this + if flags.no_compile: + return _LowerResult(fndesc, call_helper, cfunc=None, env=env) + else: + # Prepare for execution + cfunc = targetctx.get_executable(library, fndesc, env) + return _LowerResult(fndesc, call_helper, cfunc=cfunc, env=env) + + def run_pass(self, state): + """ + Lowering for object mode + """ + + if state.library is None: + codegen = state.targetctx.codegen() + state.library = codegen.create_library(state.func_id.func_qualname) + # Enable object caching upfront, so that the library can + # be later serialized. + state.library.enable_object_caching() + + def backend_object_mode(): + """ + Object mode compilation + """ + if len(state.args) != state.nargs: + # append missing + # BUG?: What's going on with nargs here? + # check state.nargs vs self.nargs on original code + state.args = (tuple(state.args) + (types.pyobject,) * + (state.nargs - len(state.args))) + + return self._py_lowering_stage(state.targetctx, + state.library, + state.func_ir, + state.flags) + + lowered = backend_object_mode() + signature = typing.signature(state.return_type, *state.args) + from numba.core.compiler import compile_result + state.cr = compile_result( + typing_context=state.typingctx, + target_context=state.targetctx, + entry_point=lowered.cfunc, + typing_error=state.status.fail_reason, + type_annotation=state.type_annotation, + library=state.library, + call_helper=lowered.call_helper, + signature=signature, + objectmode=True, + lifted=state.lifted, + fndesc=lowered.fndesc, + environment=lowered.env, + metadata=state.metadata, + reload_init=state.reload_init, + ) + + if state.flags.release_gil: + warn_msg = ("Code running in object mode won't allow parallel" + " execution despite nogil=True.") + warnings.warn_explicit(warn_msg, errors.NumbaWarning, + state.func_id.filename, + state.func_id.firstlineno) + + return True diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/old_boxing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/old_boxing.py new file mode 100644 index 0000000000000000000000000000000000000000..0432f35243438ea6efea19e581e2b5c54d74923d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/old_boxing.py @@ -0,0 +1,1313 @@ +""" +Boxing and unboxing of native Numba values to / from CPython objects. +""" + +from llvmlite import ir + +from numba.core import types, cgutils +from numba.core.pythonapi import box, unbox, reflect, NativeValue +from numba.core.errors import NumbaNotImplementedError, TypingError +from numba.core.typing.typeof import typeof, Purpose + +from numba.cpython import setobj, listobj +from numba.np import numpy_support +from contextlib import contextmanager, ExitStack + + +# +# Scalar types +# + +@box(types.Boolean) +def box_bool(typ, val, c): + return c.pyapi.bool_from_bool(val) + +@unbox(types.Boolean) +def unbox_boolean(typ, obj, c): + istrue = c.pyapi.object_istrue(obj) + zero = ir.Constant(istrue.type, 0) + val = c.builder.icmp_signed('!=', istrue, zero) + return NativeValue(val, is_error=c.pyapi.c_api_error()) + + +@box(types.IntegerLiteral) +@box(types.BooleanLiteral) +def box_literal_integer(typ, val, c): + val = c.context.cast(c.builder, val, typ, typ.literal_type) + return c.box(typ.literal_type, val) + + +@box(types.Integer) +def box_integer(typ, val, c): + if typ.signed: + ival = c.builder.sext(val, c.pyapi.longlong) + return c.pyapi.long_from_longlong(ival) + else: + ullval = c.builder.zext(val, c.pyapi.ulonglong) + return c.pyapi.long_from_ulonglong(ullval) + +@unbox(types.Integer) +def unbox_integer(typ, obj, c): + ll_type = c.context.get_argument_type(typ) + val = cgutils.alloca_once(c.builder, ll_type) + longobj = c.pyapi.number_long(obj) + with c.pyapi.if_object_ok(longobj): + if typ.signed: + llval = c.pyapi.long_as_longlong(longobj) + else: + llval = c.pyapi.long_as_ulonglong(longobj) + c.pyapi.decref(longobj) + c.builder.store(c.builder.trunc(llval, ll_type), val) + return NativeValue(c.builder.load(val), + is_error=c.pyapi.c_api_error()) + + +@box(types.Float) +def box_float(typ, val, c): + if typ == types.float32: + dbval = c.builder.fpext(val, c.pyapi.double) + else: + assert typ == types.float64 + dbval = val + return c.pyapi.float_from_double(dbval) + +@unbox(types.Float) +def unbox_float(typ, obj, c): + fobj = c.pyapi.number_float(obj) + dbval = c.pyapi.float_as_double(fobj) + c.pyapi.decref(fobj) + if typ == types.float32: + val = c.builder.fptrunc(dbval, + c.context.get_argument_type(typ)) + else: + assert typ == types.float64 + val = dbval + return NativeValue(val, is_error=c.pyapi.c_api_error()) + + +@box(types.Complex) +def box_complex(typ, val, c): + cval = c.context.make_complex(c.builder, typ, value=val) + + if typ == types.complex64: + freal = c.builder.fpext(cval.real, c.pyapi.double) + fimag = c.builder.fpext(cval.imag, c.pyapi.double) + else: + assert typ == types.complex128 + freal, fimag = cval.real, cval.imag + return c.pyapi.complex_from_doubles(freal, fimag) + +@unbox(types.Complex) +def unbox_complex(typ, obj, c): + # First unbox to complex128, since that's what CPython gives us + c128 = c.context.make_complex(c.builder, types.complex128) + ok = c.pyapi.complex_adaptor(obj, c128._getpointer()) + failed = cgutils.is_false(c.builder, ok) + + with cgutils.if_unlikely(c.builder, failed): + c.pyapi.err_set_string("PyExc_TypeError", + "conversion to %s failed" % (typ,)) + + if typ == types.complex64: + # Downcast to complex64 if necessary + cplx = c.context.make_complex(c.builder, typ) + cplx.real = c.context.cast(c.builder, c128.real, + types.float64, types.float32) + cplx.imag = c.context.cast(c.builder, c128.imag, + types.float64, types.float32) + else: + assert typ == types.complex128 + cplx = c128 + return NativeValue(cplx._getvalue(), is_error=failed) + + +@box(types.NoneType) +def box_none(typ, val, c): + return c.pyapi.make_none() + +@unbox(types.NoneType) +@unbox(types.EllipsisType) +def unbox_none(typ, val, c): + return NativeValue(c.context.get_dummy_value()) + + +@box(types.NPDatetime) +def box_npdatetime(typ, val, c): + return c.pyapi.create_np_datetime(val, typ.unit_code) + +@unbox(types.NPDatetime) +def unbox_npdatetime(typ, obj, c): + val = c.pyapi.extract_np_datetime(obj) + return NativeValue(val, is_error=c.pyapi.c_api_error()) + + +@box(types.NPTimedelta) +def box_nptimedelta(typ, val, c): + return c.pyapi.create_np_timedelta(val, typ.unit_code) + +@unbox(types.NPTimedelta) +def unbox_nptimedelta(typ, obj, c): + val = c.pyapi.extract_np_timedelta(obj) + return NativeValue(val, is_error=c.pyapi.c_api_error()) + + +@box(types.RawPointer) +def box_raw_pointer(typ, val, c): + """ + Convert a raw pointer to a Python int. + """ + ll_intp = c.context.get_value_type(types.uintp) + addr = c.builder.ptrtoint(val, ll_intp) + return c.box(types.uintp, addr) + + +@box(types.EnumMember) +def box_enum(typ, val, c): + """ + Fetch an enum member given its native value. + """ + valobj = c.box(typ.dtype, val) + # Call the enum class with the value object + cls_obj = c.pyapi.unserialize(c.pyapi.serialize_object(typ.instance_class)) + return c.pyapi.call_function_objargs(cls_obj, (valobj,)) + + +@unbox(types.EnumMember) +def unbox_enum(typ, obj, c): + """ + Convert an enum member's value to its native value. + """ + valobj = c.pyapi.object_getattr_string(obj, "value") + return c.unbox(typ.dtype, valobj) + + +@box(types.UndefVar) +def box_undefvar(typ, val, c): + """This type cannot be boxed, there's no Python equivalent""" + msg = ("UndefVar type cannot be boxed, there is no Python equivalent of " + "this type.") + raise TypingError(msg) + +# +# Composite types +# + +@box(types.Record) +def box_record(typ, val, c): + # Note we will create a copy of the record + # This is the only safe way. + size = ir.Constant(ir.IntType(32), val.type.pointee.count) + ptr = c.builder.bitcast(val, ir.PointerType(ir.IntType(8))) + return c.pyapi.recreate_record(ptr, size, typ.dtype, c.env_manager) + + +@unbox(types.Record) +def unbox_record(typ, obj, c): + buf = c.pyapi.alloca_buffer() + ptr = c.pyapi.extract_record_data(obj, buf) + is_error = cgutils.is_null(c.builder, ptr) + + ltyp = c.context.get_value_type(typ) + val = c.builder.bitcast(ptr, ltyp) + + def cleanup(): + c.pyapi.release_buffer(buf) + return NativeValue(val, cleanup=cleanup, is_error=is_error) + + +@box(types.UnicodeCharSeq) +def box_unicodecharseq(typ, val, c): + # XXX could kind be determined from strptr? + unicode_kind = { + 1: c.pyapi.py_unicode_1byte_kind, + 2: c.pyapi.py_unicode_2byte_kind, + 4: c.pyapi.py_unicode_4byte_kind}[numpy_support.sizeof_unicode_char] + kind = c.context.get_constant(types.int32, unicode_kind) + rawptr = cgutils.alloca_once_value(c.builder, value=val) + strptr = c.builder.bitcast(rawptr, c.pyapi.cstring) + + fullsize = c.context.get_constant(types.intp, typ.count) + zero = fullsize.type(0) + one = fullsize.type(1) + step = fullsize.type(numpy_support.sizeof_unicode_char) + count = cgutils.alloca_once_value(c.builder, zero) + with cgutils.loop_nest(c.builder, [fullsize], fullsize.type) as [idx]: + # Get char at idx + ch = c.builder.load(c.builder.gep(strptr, [c.builder.mul(idx, step)])) + # If the char is a non-null-byte, store the next index as count + with c.builder.if_then(cgutils.is_not_null(c.builder, ch)): + c.builder.store(c.builder.add(idx, one), count) + strlen = c.builder.load(count) + return c.pyapi.string_from_kind_and_data(kind, strptr, strlen) + + +@unbox(types.UnicodeCharSeq) +def unbox_unicodecharseq(typ, obj, c): + lty = c.context.get_value_type(typ) + + ok, buffer, size, kind, is_ascii, hashv = \ + c.pyapi.string_as_string_size_and_kind(obj) + + # If conversion is ok, copy the buffer to the output storage. + with cgutils.if_likely(c.builder, ok): + # Check if the returned string size fits in the charseq + storage_size = ir.Constant(size.type, typ.count) + size_fits = c.builder.icmp_unsigned("<=", size, storage_size) + + # Allow truncation of string + size = c.builder.select(size_fits, size, storage_size) + + # Initialize output to zero bytes + null_string = ir.Constant(lty, None) + outspace = cgutils.alloca_once_value(c.builder, null_string) + + # We don't need to set the NULL-terminator because the storage + # is already zero-filled. + cgutils.memcpy(c.builder, + c.builder.bitcast(outspace, buffer.type), + buffer, size) + + ret = c.builder.load(outspace) + return NativeValue(ret, is_error=c.builder.not_(ok)) + + +@box(types.Bytes) +def box_bytes(typ, val, c): + obj = c.context.make_helper(c.builder, typ, val) + ret = c.pyapi.bytes_from_string_and_size(obj.data, obj.nitems) + c.context.nrt.decref(c.builder, typ, val) + return ret + + +@box(types.CharSeq) +def box_charseq(typ, val, c): + rawptr = cgutils.alloca_once_value(c.builder, value=val) + strptr = c.builder.bitcast(rawptr, c.pyapi.cstring) + fullsize = c.context.get_constant(types.intp, typ.count) + zero = fullsize.type(0) + one = fullsize.type(1) + count = cgutils.alloca_once_value(c.builder, zero) + + # Find the length of the string, mimicking Numpy's behaviour: + # search for the last non-null byte in the underlying storage + # (e.g. b'A\0\0B\0\0\0' will return the logical string b'A\0\0B') + with cgutils.loop_nest(c.builder, [fullsize], fullsize.type) as [idx]: + # Get char at idx + ch = c.builder.load(c.builder.gep(strptr, [idx])) + # If the char is a non-null-byte, store the next index as count + with c.builder.if_then(cgutils.is_not_null(c.builder, ch)): + c.builder.store(c.builder.add(idx, one), count) + + strlen = c.builder.load(count) + return c.pyapi.bytes_from_string_and_size(strptr, strlen) + + +@unbox(types.CharSeq) +def unbox_charseq(typ, obj, c): + lty = c.context.get_value_type(typ) + ok, buffer, size = c.pyapi.string_as_string_and_size(obj) + + # If conversion is ok, copy the buffer to the output storage. + with cgutils.if_likely(c.builder, ok): + # Check if the returned string size fits in the charseq + storage_size = ir.Constant(size.type, typ.count) + size_fits = c.builder.icmp_unsigned("<=", size, storage_size) + + # Allow truncation of string + size = c.builder.select(size_fits, size, storage_size) + + # Initialize output to zero bytes + null_string = ir.Constant(lty, None) + outspace = cgutils.alloca_once_value(c.builder, null_string) + + # We don't need to set the NULL-terminator because the storage + # is already zero-filled. + cgutils.memcpy(c.builder, + c.builder.bitcast(outspace, buffer.type), + buffer, size) + + ret = c.builder.load(outspace) + return NativeValue(ret, is_error=c.builder.not_(ok)) + + +@box(types.Optional) +def box_optional(typ, val, c): + optval = c.context.make_helper(c.builder, typ, val) + ret = cgutils.alloca_once_value(c.builder, c.pyapi.borrow_none()) + with c.builder.if_else(optval.valid) as (then, otherwise): + with then: + validres = c.box(typ.type, optval.data) + c.builder.store(validres, ret) + with otherwise: + c.builder.store(c.pyapi.make_none(), ret) + return c.builder.load(ret) + + +@unbox(types.Optional) +def unbox_optional(typ, obj, c): + """ + Convert object *obj* to a native optional structure. + """ + noneval = c.context.make_optional_none(c.builder, typ.type) + is_not_none = c.builder.icmp_signed('!=', obj, c.pyapi.borrow_none()) + + retptr = cgutils.alloca_once(c.builder, noneval.type) + errptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + + with c.builder.if_else(is_not_none) as (then, orelse): + with then: + native = c.unbox(typ.type, obj) + just = c.context.make_optional_value(c.builder, + typ.type, native.value) + c.builder.store(just, retptr) + c.builder.store(native.is_error, errptr) + + with orelse: + c.builder.store(noneval, retptr) + + if native.cleanup is not None: + def cleanup(): + with c.builder.if_then(is_not_none): + native.cleanup() + else: + cleanup = None + + ret = c.builder.load(retptr) + return NativeValue(ret, is_error=c.builder.load(errptr), + cleanup=cleanup) + + +@unbox(types.SliceType) +def unbox_slice(typ, obj, c): + """ + Convert object *obj* to a native slice structure. + """ + from numba.cpython import slicing + ok, start, stop, step = c.pyapi.slice_as_ints(obj) + sli = c.context.make_helper(c.builder, typ) + sli.start = start + sli.stop = stop + sli.step = step + return NativeValue(sli._getvalue(), is_error=c.builder.not_(ok)) + +@box(types.SliceLiteral) +def box_slice_literal(typ, val, c): + # Check for integer overflows at compile time. + slice_lit = typ.literal_value + for field_name in ("start", "stop", "step"): + field_obj = getattr(slice_lit, field_name) + if isinstance(field_obj, int): + try: + typeof(field_obj, Purpose) + except ValueError as e: + raise ValueError(( + f"Unable to create literal slice. " + f"Error encountered with {field_name} " + f"attribute. {str(e)}") + ) + + py_ctor, py_args = typ.literal_value.__reduce__() + serialized_ctor = c.pyapi.serialize_object(py_ctor) + serialized_args = c.pyapi.serialize_object(py_args) + ctor = c.pyapi.unserialize(serialized_ctor) + args = c.pyapi.unserialize(serialized_args) + obj = c.pyapi.call(ctor, args) + c.pyapi.decref(ctor) + c.pyapi.decref(args) + return obj + +@unbox(types.StringLiteral) +def unbox_string_literal(typ, obj, c): + # A string literal is a dummy value + return NativeValue(c.context.get_dummy_value()) + +# +# Collections +# + +# NOTE: boxing functions are supposed to steal any NRT references in +# the given native value. + +@box(types.Array) +def box_array(typ, val, c): + nativearycls = c.context.make_array(typ) + nativeary = nativearycls(c.context, c.builder, value=val) + if c.context.enable_nrt: + np_dtype = numpy_support.as_dtype(typ.dtype) + dtypeptr = c.env_manager.read_const(c.env_manager.add_const(np_dtype)) + newary = c.pyapi.nrt_adapt_ndarray_to_python(typ, val, dtypeptr) + # Steals NRT ref + c.context.nrt.decref(c.builder, typ, val) + return newary + else: + parent = nativeary.parent + c.pyapi.incref(parent) + return parent + + +@unbox(types.Buffer) +def unbox_buffer(typ, obj, c): + """ + Convert a Py_buffer-providing object to a native array structure. + """ + buf = c.pyapi.alloca_buffer() + res = c.pyapi.get_buffer(obj, buf) + is_error = cgutils.is_not_null(c.builder, res) + + nativearycls = c.context.make_array(typ) + nativeary = nativearycls(c.context, c.builder) + aryptr = nativeary._getpointer() + + with cgutils.if_likely(c.builder, c.builder.not_(is_error)): + ptr = c.builder.bitcast(aryptr, c.pyapi.voidptr) + if c.context.enable_nrt: + c.pyapi.nrt_adapt_buffer_from_python(buf, ptr) + else: + c.pyapi.numba_buffer_adaptor(buf, ptr) + + def cleanup(): + c.pyapi.release_buffer(buf) + + return NativeValue(c.builder.load(aryptr), is_error=is_error, + cleanup=cleanup) + +@unbox(types.Array) +def unbox_array(typ, obj, c): + """ + Convert a Numpy array object to a native array structure. + """ + # This is necessary because unbox_buffer() does not work on some + # dtypes, e.g. datetime64 and timedelta64. + # TODO check matching dtype. + # currently, mismatching dtype will still work and causes + # potential memory corruption + nativearycls = c.context.make_array(typ) + nativeary = nativearycls(c.context, c.builder) + aryptr = nativeary._getpointer() + + ptr = c.builder.bitcast(aryptr, c.pyapi.voidptr) + if c.context.enable_nrt: + errcode = c.pyapi.nrt_adapt_ndarray_from_python(obj, ptr) + else: + errcode = c.pyapi.numba_array_adaptor(obj, ptr) + + # TODO: here we have minimal typechecking by the itemsize. + # need to do better + try: + expected_itemsize = numpy_support.as_dtype(typ.dtype).itemsize + except NumbaNotImplementedError: + # Don't check types that can't be `as_dtype()`-ed + itemsize_mismatch = cgutils.false_bit + else: + expected_itemsize = nativeary.itemsize.type(expected_itemsize) + itemsize_mismatch = c.builder.icmp_unsigned( + '!=', + nativeary.itemsize, + expected_itemsize, + ) + + failed = c.builder.or_( + cgutils.is_not_null(c.builder, errcode), + itemsize_mismatch, + ) + # Handle error + with c.builder.if_then(failed, likely=False): + c.pyapi.err_set_string("PyExc_TypeError", + "can't unbox array from PyObject into " + "native value. The object maybe of a " + "different type") + return NativeValue(c.builder.load(aryptr), is_error=failed) + + +@box(types.Tuple) +@box(types.UniTuple) +def box_tuple(typ, val, c): + """ + Convert native array or structure *val* to a tuple object. + """ + tuple_val = c.pyapi.tuple_new(typ.count) + + for i, dtype in enumerate(typ): + item = c.builder.extract_value(val, i) + obj = c.box(dtype, item) + c.pyapi.tuple_setitem(tuple_val, i, obj) + + return tuple_val + +@box(types.NamedTuple) +@box(types.NamedUniTuple) +def box_namedtuple(typ, val, c): + """ + Convert native array or structure *val* to a namedtuple object. + """ + cls_obj = c.pyapi.unserialize(c.pyapi.serialize_object(typ.instance_class)) + tuple_obj = box_tuple(typ, val, c) + obj = c.pyapi.call(cls_obj, tuple_obj) + c.pyapi.decref(cls_obj) + c.pyapi.decref(tuple_obj) + return obj + + +@unbox(types.BaseTuple) +def unbox_tuple(typ, obj, c): + """ + Convert tuple *obj* to a native array (if homogeneous) or structure. + """ + n = len(typ) + values = [] + cleanups = [] + lty = c.context.get_value_type(typ) + + is_error_ptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + value_ptr = cgutils.alloca_once(c.builder, lty) + + # Issue #1638: need to check the tuple size + actual_size = c.pyapi.tuple_size(obj) + size_matches = c.builder.icmp_unsigned('==', actual_size, + ir.Constant(actual_size.type, n)) + with c.builder.if_then(c.builder.not_(size_matches), likely=False): + c.pyapi.err_format( + "PyExc_ValueError", + "size mismatch for tuple, expected %d element(s) but got %%zd" % (n,), + actual_size) + c.builder.store(cgutils.true_bit, is_error_ptr) + + # We unbox the items even if not `size_matches`, to avoid issues with + # the generated IR (instruction doesn't dominate all uses) + for i, eltype in enumerate(typ): + elem = c.pyapi.tuple_getitem(obj, i) + native = c.unbox(eltype, elem) + values.append(native.value) + with c.builder.if_then(native.is_error, likely=False): + c.builder.store(cgutils.true_bit, is_error_ptr) + if native.cleanup is not None: + cleanups.append(native.cleanup) + + value = c.context.make_tuple(c.builder, typ, values) + c.builder.store(value, value_ptr) + + if cleanups: + with c.builder.if_then(size_matches, likely=True): + def cleanup(): + for func in reversed(cleanups): + func() + else: + cleanup = None + + return NativeValue(c.builder.load(value_ptr), cleanup=cleanup, + is_error=c.builder.load(is_error_ptr)) + + +@box(types.List) +def box_list(typ, val, c): + """ + Convert native list *val* to a list object. + """ + list = listobj.ListInstance(c.context, c.builder, typ, val) + obj = list.parent + res = cgutils.alloca_once_value(c.builder, obj) + with c.builder.if_else(cgutils.is_not_null(c.builder, obj)) as (has_parent, otherwise): + with has_parent: + # List is actually reflected => return the original object + # (note not all list instances whose *type* is reflected are + # actually reflected; see numba.tests.test_lists for an example) + c.pyapi.incref(obj) + + with otherwise: + # Build a new Python list + nitems = list.size + obj = c.pyapi.list_new(nitems) + with c.builder.if_then(cgutils.is_not_null(c.builder, obj), + likely=True): + with cgutils.for_range(c.builder, nitems) as loop: + item = list.getitem(loop.index) + list.incref_value(item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_setitem(obj, loop.index, itemobj) + + c.builder.store(obj, res) + + # Steal NRT ref + c.context.nrt.decref(c.builder, typ, val) + return c.builder.load(res) + + +class _NumbaTypeHelper(object): + """A helper for acquiring `numba.typeof` for type checking. + + Usage + ----- + + # `c` is the boxing context. + with _NumbaTypeHelper(c) as nth: + # This contextmanager maintains the lifetime of the `numba.typeof` + # function. + the_numba_type = nth.typeof(some_object) + # Do work on the type object + do_checks(the_numba_type) + # Cleanup + c.pyapi.decref(the_numba_type) + # At this point *nth* should not be used. + """ + def __init__(self, c): + self.c = c + + def __enter__(self): + c = self.c + numba_name = c.context.insert_const_string(c.builder.module, 'numba') + numba_mod = c.pyapi.import_module(numba_name) + typeof_fn = c.pyapi.object_getattr_string(numba_mod, 'typeof') + self.typeof_fn = typeof_fn + c.pyapi.decref(numba_mod) + return self + + def __exit__(self, *args, **kwargs): + c = self.c + c.pyapi.decref(self.typeof_fn) + + def typeof(self, obj): + res = self.c.pyapi.call_function_objargs(self.typeof_fn, [obj]) + return res + + +def _python_list_to_native(typ, obj, c, size, listptr, errorptr): + """ + Construct a new native list from a Python list. + """ + def check_element_type(nth, itemobj, expected_typobj): + typobj = nth.typeof(itemobj) + # Check if *typobj* is NULL + with c.builder.if_then( + cgutils.is_null(c.builder, typobj), + likely=False, + ): + c.builder.store(cgutils.true_bit, errorptr) + loop.do_break() + # Mandate that objects all have the same exact type + type_mismatch = c.builder.icmp_signed('!=', typobj, expected_typobj) + + with c.builder.if_then(type_mismatch, likely=False): + c.builder.store(cgutils.true_bit, errorptr) + c.pyapi.err_format( + "PyExc_TypeError", + "can't unbox heterogeneous list: %S != %S", + expected_typobj, typobj, + ) + c.pyapi.decref(typobj) + loop.do_break() + c.pyapi.decref(typobj) + + # Allocate a new native list + ok, list = listobj.ListInstance.allocate_ex(c.context, c.builder, typ, size) + with c.builder.if_else(ok, likely=True) as (if_ok, if_not_ok): + with if_ok: + list.size = size + zero = ir.Constant(size.type, 0) + with c.builder.if_then(c.builder.icmp_signed('>', size, zero), + likely=True): + # Traverse Python list and unbox objects into native list + with _NumbaTypeHelper(c) as nth: + # Note: *expected_typobj* can't be NULL + expected_typobj = nth.typeof(c.pyapi.list_getitem(obj, zero)) + with cgutils.for_range(c.builder, size) as loop: + itemobj = c.pyapi.list_getitem(obj, loop.index) + check_element_type(nth, itemobj, expected_typobj) + # XXX we don't call native cleanup for each + # list element, since that would require keeping + # of which unboxings have been successful. + native = c.unbox(typ.dtype, itemobj) + with c.builder.if_then(native.is_error, likely=False): + c.builder.store(cgutils.true_bit, errorptr) + loop.do_break() + # The reference is borrowed so incref=False + list.setitem(loop.index, native.value, incref=False) + c.pyapi.decref(expected_typobj) + if typ.reflected: + list.parent = obj + # Stuff meminfo pointer into the Python object for + # later reuse. + with c.builder.if_then(c.builder.not_(c.builder.load(errorptr)), + likely=False): + c.pyapi.object_set_private_data(obj, list.meminfo) + list.set_dirty(False) + c.builder.store(list.value, listptr) + + with if_not_ok: + c.builder.store(cgutils.true_bit, errorptr) + + # If an error occurred, drop the whole native list + with c.builder.if_then(c.builder.load(errorptr)): + c.context.nrt.decref(c.builder, typ, list.value) + + +@unbox(types.List) +def unbox_list(typ, obj, c): + """ + Convert list *obj* to a native list. + + If list was previously unboxed, we reuse the existing native list + to ensure consistency. + """ + size = c.pyapi.list_size(obj) + + errorptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + listptr = cgutils.alloca_once(c.builder, c.context.get_value_type(typ)) + + # See if the list was previously unboxed, if so, re-use the meminfo. + ptr = c.pyapi.object_get_private_data(obj) + + with c.builder.if_else(cgutils.is_not_null(c.builder, ptr)) \ + as (has_meminfo, otherwise): + + with has_meminfo: + # List was previously unboxed => reuse meminfo + list = listobj.ListInstance.from_meminfo(c.context, c.builder, typ, ptr) + list.size = size + if typ.reflected: + list.parent = obj + c.builder.store(list.value, listptr) + + with otherwise: + _python_list_to_native(typ, obj, c, size, listptr, errorptr) + + def cleanup(): + # Clean up the associated pointer, as the meminfo is now invalid. + c.pyapi.object_reset_private_data(obj) + + return NativeValue(c.builder.load(listptr), + is_error=c.builder.load(errorptr), + cleanup=cleanup) + + +@reflect(types.List) +def reflect_list(typ, val, c): + """ + Reflect the native list's contents into the Python object. + """ + if not typ.reflected: + return + if typ.dtype.reflected: + msg = "cannot reflect element of reflected container: {}\n".format(typ) + raise TypeError(msg) + + list = listobj.ListInstance(c.context, c.builder, typ, val) + with c.builder.if_then(list.dirty, likely=False): + obj = list.parent + size = c.pyapi.list_size(obj) + new_size = list.size + diff = c.builder.sub(new_size, size) + diff_gt_0 = c.builder.icmp_signed('>=', diff, + ir.Constant(diff.type, 0)) + with c.builder.if_else(diff_gt_0) as (if_grow, if_shrink): + # XXX no error checking below + with if_grow: + # First overwrite existing items + with cgutils.for_range(c.builder, size) as loop: + item = list.getitem(loop.index) + list.incref_value(item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_setitem(obj, loop.index, itemobj) + # Then add missing items + with cgutils.for_range(c.builder, diff) as loop: + idx = c.builder.add(size, loop.index) + item = list.getitem(idx) + list.incref_value(item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_append(obj, itemobj) + c.pyapi.decref(itemobj) + + with if_shrink: + # First delete list tail + c.pyapi.list_setslice(obj, new_size, size, None) + # Then overwrite remaining items + with cgutils.for_range(c.builder, new_size) as loop: + item = list.getitem(loop.index) + list.incref_value(item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_setitem(obj, loop.index, itemobj) + + # Mark the list clean, in case it is reflected twice + list.set_dirty(False) + + +def _python_set_to_native(typ, obj, c, size, setptr, errorptr): + """ + Construct a new native set from a Python set. + """ + # Allocate a new native set + ok, inst = setobj.SetInstance.allocate_ex(c.context, c.builder, typ, size) + with c.builder.if_else(ok, likely=True) as (if_ok, if_not_ok): + with if_ok: + # Traverse Python set and unbox objects into native set + typobjptr = cgutils.alloca_once_value(c.builder, + ir.Constant(c.pyapi.pyobj, None)) + + with c.pyapi.set_iterate(obj) as loop: + itemobj = loop.value + # Mandate that objects all have the same exact type + typobj = c.pyapi.get_type(itemobj) + expected_typobj = c.builder.load(typobjptr) + + with c.builder.if_else( + cgutils.is_null(c.builder, expected_typobj), + likely=False) as (if_first, if_not_first): + with if_first: + # First iteration => store item type + c.builder.store(typobj, typobjptr) + with if_not_first: + # Otherwise, check item type + type_mismatch = c.builder.icmp_signed('!=', typobj, + expected_typobj) + with c.builder.if_then(type_mismatch, likely=False): + c.builder.store(cgutils.true_bit, errorptr) + c.pyapi.err_set_string("PyExc_TypeError", + "can't unbox heterogeneous set") + loop.do_break() + + # XXX we don't call native cleanup for each set element, + # since that would require keeping track + # of which unboxings have been successful. + native = c.unbox(typ.dtype, itemobj) + with c.builder.if_then(native.is_error, likely=False): + c.builder.store(cgutils.true_bit, errorptr) + inst.add_pyapi(c.pyapi, native.value, do_resize=False) + + if typ.reflected: + inst.parent = obj + # Associate meminfo pointer with the Python object for later reuse. + with c.builder.if_then(c.builder.not_(c.builder.load(errorptr)), + likely=False): + c.pyapi.object_set_private_data(obj, inst.meminfo) + inst.set_dirty(False) + c.builder.store(inst.value, setptr) + + with if_not_ok: + c.builder.store(cgutils.true_bit, errorptr) + + # If an error occurred, drop the whole native set + with c.builder.if_then(c.builder.load(errorptr)): + c.context.nrt.decref(c.builder, typ, inst.value) + + +@unbox(types.Set) +def unbox_set(typ, obj, c): + """ + Convert set *obj* to a native set. + + If set was previously unboxed, we reuse the existing native set + to ensure consistency. + """ + size = c.pyapi.set_size(obj) + + errorptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + setptr = cgutils.alloca_once(c.builder, c.context.get_value_type(typ)) + + # See if the set was previously unboxed, if so, re-use the meminfo. + ptr = c.pyapi.object_get_private_data(obj) + + with c.builder.if_else(cgutils.is_not_null(c.builder, ptr)) \ + as (has_meminfo, otherwise): + + with has_meminfo: + # Set was previously unboxed => reuse meminfo + inst = setobj.SetInstance.from_meminfo(c.context, c.builder, typ, ptr) + if typ.reflected: + inst.parent = obj + c.builder.store(inst.value, setptr) + + with otherwise: + _python_set_to_native(typ, obj, c, size, setptr, errorptr) + + def cleanup(): + # Clean up the associated pointer, as the meminfo is now invalid. + c.pyapi.object_reset_private_data(obj) + + return NativeValue(c.builder.load(setptr), + is_error=c.builder.load(errorptr), + cleanup=cleanup) + + +def _native_set_to_python_list(typ, payload, c): + """ + Create a Python list from a native set's items. + """ + nitems = payload.used + listobj = c.pyapi.list_new(nitems) + ok = cgutils.is_not_null(c.builder, listobj) + with c.builder.if_then(ok, likely=True): + index = cgutils.alloca_once_value(c.builder, + ir.Constant(nitems.type, 0)) + with payload._iterate() as loop: + i = c.builder.load(index) + item = loop.entry.key + c.context.nrt.incref(c.builder, typ.dtype, item) + itemobj = c.box(typ.dtype, item) + c.pyapi.list_setitem(listobj, i, itemobj) + i = c.builder.add(i, ir.Constant(i.type, 1)) + c.builder.store(i, index) + + return ok, listobj + + +@box(types.Set) +def box_set(typ, val, c): + """ + Convert native set *val* to a set object. + """ + inst = setobj.SetInstance(c.context, c.builder, typ, val) + obj = inst.parent + res = cgutils.alloca_once_value(c.builder, obj) + + with c.builder.if_else(cgutils.is_not_null(c.builder, obj)) as (has_parent, otherwise): + with has_parent: + # Set is actually reflected => return the original object + # (note not all set instances whose *type* is reflected are + # actually reflected; see numba.tests.test_sets for an example) + c.pyapi.incref(obj) + + with otherwise: + # Build a new Python list and then create a set from that + payload = inst.payload + ok, listobj = _native_set_to_python_list(typ, payload, c) + with c.builder.if_then(ok, likely=True): + obj = c.pyapi.set_new(listobj) + c.pyapi.decref(listobj) + c.builder.store(obj, res) + + # Steal NRT ref + c.context.nrt.decref(c.builder, typ, val) + return c.builder.load(res) + +@reflect(types.Set) +def reflect_set(typ, val, c): + """ + Reflect the native set's contents into the Python object. + """ + if not typ.reflected: + return + inst = setobj.SetInstance(c.context, c.builder, typ, val) + payload = inst.payload + + with c.builder.if_then(payload.dirty, likely=False): + obj = inst.parent + # XXX errors are not dealt with below + c.pyapi.set_clear(obj) + + # Build a new Python list and then update the set with that + ok, listobj = _native_set_to_python_list(typ, payload, c) + with c.builder.if_then(ok, likely=True): + c.pyapi.set_update(obj, listobj) + c.pyapi.decref(listobj) + + # Mark the set clean, in case it is reflected twice + inst.set_dirty(False) + + +# +# Other types +# + +@box(types.Generator) +def box_generator(typ, val, c): + return c.pyapi.from_native_generator(val, typ, c.env_manager.env_ptr) + +@unbox(types.Generator) +def unbox_generator(typ, obj, c): + return c.pyapi.to_native_generator(obj, typ) + + +@box(types.DType) +def box_dtype(typ, val, c): + np_dtype = numpy_support.as_dtype(typ.dtype) + return c.pyapi.unserialize(c.pyapi.serialize_object(np_dtype)) + +@unbox(types.DType) +def unbox_dtype(typ, val, c): + return NativeValue(c.context.get_dummy_value()) + + +@box(types.NumberClass) +def box_number_class(typ, val, c): + np_dtype = numpy_support.as_dtype(typ.dtype) + return c.pyapi.unserialize(c.pyapi.serialize_object(np_dtype)) + +@unbox(types.NumberClass) +def unbox_number_class(typ, val, c): + return NativeValue(c.context.get_dummy_value()) + + +@box(types.PyObject) +@box(types.Object) +def box_pyobject(typ, val, c): + return val + +@unbox(types.PyObject) +@unbox(types.Object) +def unbox_pyobject(typ, obj, c): + return NativeValue(obj) + + +@unbox(types.ExternalFunctionPointer) +def unbox_funcptr(typ, obj, c): + if typ.get_pointer is None: + raise NotImplementedError(typ) + + # Call get_pointer() on the object to get the raw pointer value + ptrty = c.context.get_function_pointer_type(typ) + ret = cgutils.alloca_once_value(c.builder, + ir.Constant(ptrty, None), + name='fnptr') + ser = c.pyapi.serialize_object(typ.get_pointer) + get_pointer = c.pyapi.unserialize(ser) + with cgutils.if_likely(c.builder, + cgutils.is_not_null(c.builder, get_pointer)): + intobj = c.pyapi.call_function_objargs(get_pointer, (obj,)) + c.pyapi.decref(get_pointer) + with cgutils.if_likely(c.builder, + cgutils.is_not_null(c.builder, intobj)): + ptr = c.pyapi.long_as_voidptr(intobj) + c.pyapi.decref(intobj) + c.builder.store(c.builder.bitcast(ptr, ptrty), ret) + return NativeValue(c.builder.load(ret), is_error=c.pyapi.c_api_error()) + +@box(types.DeferredType) +def box_deferred(typ, val, c): + out = c.pyapi.from_native_value(typ.get(), + c.builder.extract_value(val, [0]), + env_manager=c.env_manager) + return out + + +@unbox(types.DeferredType) +def unbox_deferred(typ, obj, c): + native_value = c.pyapi.to_native_value(typ.get(), obj) + model = c.context.data_model_manager[typ] + res = model.set(c.builder, model.make_uninitialized(), native_value.value) + return NativeValue(res, is_error=native_value.is_error, + cleanup=native_value.cleanup) + + +@unbox(types.Dispatcher) +def unbox_dispatcher(typ, obj, c): + # In native code, Dispatcher types can be casted to FunctionType. + return NativeValue(obj) + + +@box(types.Dispatcher) +def box_pyobject(typ, val, c): + c.pyapi.incref(val) + return val + + +def unbox_unsupported(typ, obj, c): + c.pyapi.err_set_string("PyExc_TypeError", + "can't unbox {!r} type".format(typ)) + res = c.context.get_constant_null(typ) + return NativeValue(res, is_error=cgutils.true_bit) + + +def box_unsupported(typ, val, c): + msg = "cannot convert native %s to Python object" % (typ,) + c.pyapi.err_set_string("PyExc_TypeError", msg) + res = c.pyapi.get_null_object() + return res + + +@box(types.Literal) +def box_literal(typ, val, c): + # Const type contains the python object of the constant value, + # which we can directly return. + retval = typ.literal_value + # Serialize the value into the IR + return c.pyapi.unserialize(c.pyapi.serialize_object(retval)) + + +@box(types.MemInfoPointer) +def box_meminfo_pointer(typ, val, c): + return c.pyapi.nrt_meminfo_as_pyobject(val) + + +@unbox(types.MemInfoPointer) +def unbox_meminfo_pointer(typ, obj, c): + res = c.pyapi.nrt_meminfo_from_pyobject(obj) + errored = cgutils.is_null(c.builder, res) + return NativeValue(res, is_error=errored) + +@unbox(types.TypeRef) +def unbox_typeref(typ, val, c): + return NativeValue(c.context.get_dummy_value(), is_error=cgutils.false_bit) + + +@box(types.LiteralStrKeyDict) +def box_LiteralStrKeyDict(typ, val, c): + return box_unsupported(typ, val, c) + + +# Original implementation at: https://github.com/numba/numba/issues/4499#issuecomment-1063138477 +@unbox(types.NumPyRandomBitGeneratorType) +def unbox_numpy_random_bitgenerator(typ, obj, c): + """ + The bit_generator instance has a `.ctypes` attr which is a namedtuple + with the following members (types): + * state_address (Python int) + * state (ctypes.c_void_p) + * next_uint64 (ctypes.CFunctionType instance) + * next_uint32 (ctypes.CFunctionType instance) + * next_double (ctypes.CFunctionType instance) + * bit_generator (ctypes.c_void_p) + """ + + is_error_ptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + extra_refs = [] + + def clear_extra_refs(): + for _ref in extra_refs: + c.pyapi.decref(_ref) + + def handle_failure(): + c.builder.store(cgutils.true_bit, is_error_ptr) + clear_extra_refs() + + with ExitStack() as stack: + + def object_getattr_safely(obj, attr): + attr_obj = c.pyapi.object_getattr_string(obj, attr) + extra_refs.append(attr_obj) + return attr_obj + + struct_ptr = cgutils.create_struct_proxy(typ)(c.context, c.builder) + struct_ptr.parent = obj + + # Get the .ctypes attr + ctypes_binding = object_getattr_safely(obj, 'ctypes') + with cgutils.early_exit_if_null(c.builder, stack, ctypes_binding): + handle_failure() + + # Look up the "state_address" member and wire it into the struct + interface_state_address = object_getattr_safely( + ctypes_binding, 'state_address') + with cgutils.early_exit_if_null(c.builder, stack, interface_state_address): + handle_failure() + + setattr(struct_ptr, 'state_address', + c.unbox(types.uintp, interface_state_address).value) + + # Look up the "state" member and wire it into the struct + interface_state = object_getattr_safely(ctypes_binding, 'state') + with cgutils.early_exit_if_null(c.builder, stack, interface_state): + handle_failure() + + interface_state_value = object_getattr_safely( + interface_state, 'value') + with cgutils.early_exit_if_null(c.builder, stack, interface_state_value): + handle_failure() + setattr( + struct_ptr, + 'state', + c.unbox( + types.uintp, + interface_state_value).value) + + # Want to store callable function pointers to these CFunctionTypes, so + # import ctypes and use it to cast the CFunctionTypes to c_void_p and + # store the results. + # First find ctypes.cast, and ctypes.c_void_p + ctypes_name = c.context.insert_const_string(c.builder.module, 'ctypes') + ctypes_module = c.pyapi.import_module(ctypes_name) + extra_refs.append(ctypes_module) + with cgutils.early_exit_if_null(c.builder, stack, ctypes_module): + handle_failure() + + ct_cast = object_getattr_safely(ctypes_module, 'cast') + with cgutils.early_exit_if_null(c.builder, stack, ct_cast): + handle_failure() + + ct_voidptr_ty = object_getattr_safely(ctypes_module, 'c_void_p') + with cgutils.early_exit_if_null(c.builder, stack, ct_voidptr_ty): + handle_failure() + + # This wires in the fnptrs referred to by name + def wire_in_fnptrs(name): + # Find the CFunctionType function + interface_next_fn = c.pyapi.object_getattr_string( + ctypes_binding, name) + + extra_refs.append(interface_next_fn) + with cgutils.early_exit_if_null(c.builder, stack, interface_next_fn): + handle_failure() + + # Want to do ctypes.cast(CFunctionType, ctypes.c_void_p), create an + # args tuple for that. + args = c.pyapi.tuple_pack([interface_next_fn, ct_voidptr_ty]) + with cgutils.early_exit_if_null(c.builder, stack, args): + handle_failure() + extra_refs.append(args) + + # Call ctypes.cast() + interface_next_fn_casted = c.pyapi.call(ct_cast, args) + extra_refs.append(interface_next_fn_casted) + + # Fetch the .value attr on the resulting ctypes.c_void_p for storage + # in the function pointer slot. + interface_next_fn_casted_value = object_getattr_safely( + interface_next_fn_casted, 'value') + with cgutils.early_exit_if_null(c.builder, stack, interface_next_fn_casted_value): + handle_failure() + + # Wire up + setattr(struct_ptr, f'fnptr_{name}', + c.unbox(types.uintp, interface_next_fn_casted_value).value) + + + wire_in_fnptrs('next_double') + wire_in_fnptrs('next_uint64') + wire_in_fnptrs('next_uint32') + + clear_extra_refs() + + return NativeValue(struct_ptr._getvalue(), is_error=c.builder.load(is_error_ptr)) + +_bit_gen_type = types.NumPyRandomBitGeneratorType('bit_generator') + +@unbox(types.NumPyRandomGeneratorType) +def unbox_numpy_random_generator(typ, obj, c): + """ + Here we're creating a NumPyRandomGeneratorType StructModel with following fields: + * ('bit_generator', _bit_gen_type): The unboxed BitGenerator associated with + this Generator object instance. + * ('parent', types.pyobject): Pointer to the original Generator PyObject. + * ('meminfo', types.MemInfoPointer(types.voidptr)): The information about the memory + stored at the pointer (to the original Generator PyObject). This is useful for + keeping track of reference counts within the Python runtime. Helps prevent cases + where deletion happens in Python runtime without NRT being awareness of it. + """ + is_error_ptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit) + + with ExitStack() as stack: + struct_ptr = cgutils.create_struct_proxy(typ)(c.context, c.builder) + bit_gen_inst = c.pyapi.object_getattr_string(obj, 'bit_generator') + with cgutils.early_exit_if_null(c.builder, stack, bit_gen_inst): + c.builder.store(cgutils.true_bit, is_error_ptr) + unboxed = c.unbox(_bit_gen_type, bit_gen_inst).value + struct_ptr.bit_generator = unboxed + struct_ptr.parent = obj + NULL = cgutils.voidptr_t(None) + struct_ptr.meminfo = c.pyapi.nrt_meminfo_new_from_pyobject( + NULL, # there's no data + obj, # the python object, the call to nrt_meminfo_new_from_pyobject + # will py_incref + ) + c.pyapi.decref(bit_gen_inst) + + return NativeValue(struct_ptr._getvalue(), is_error=c.builder.load(is_error_ptr)) + + +@box(types.NumPyRandomGeneratorType) +def box_numpy_random_generator(typ, val, c): + inst = c.context.make_helper(c.builder, typ, val) + obj = inst.parent + res = cgutils.alloca_once_value(c.builder, obj) + c.pyapi.incref(obj) + # Steal NRT ref + c.context.nrt.decref(c.builder, typ, val) + return c.builder.load(res) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/optional.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/optional.py new file mode 100644 index 0000000000000000000000000000000000000000..16dcb52360ad2190c9b6af44023a362bbc33bf37 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/optional.py @@ -0,0 +1,121 @@ +import operator + +from numba.core import types, typing, cgutils + +from numba.core.imputils import (lower_cast, lower_builtin, + lower_getattr_generic, impl_ret_untracked, + lower_setattr_generic) + + +def always_return_true_impl(context, builder, sig, args): + return cgutils.true_bit + + +def always_return_false_impl(context, builder, sig, args): + return cgutils.false_bit + + +def optional_is_none(context, builder, sig, args): + """ + Check if an Optional value is invalid + """ + [lty, rty] = sig.args + [lval, rval] = args + + # Make sure None is on the right + if lty == types.none: + lty, rty = rty, lty + lval, rval = rval, lval + + opt_type = lty + opt_val = lval + + opt = context.make_helper(builder, opt_type, opt_val) + res = builder.not_(cgutils.as_bool_bit(builder, opt.valid)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# None is/not None +lower_builtin(operator.is_, types.none, types.none)(always_return_true_impl) + +# Optional is None +lower_builtin(operator.is_, types.Optional, types.none)(optional_is_none) +lower_builtin(operator.is_, types.none, types.Optional)(optional_is_none) + + +@lower_getattr_generic(types.Optional) +def optional_getattr(context, builder, typ, value, attr): + """ + Optional.__getattr__ => redirect to the wrapped type. + """ + inner_type = typ.type + val = context.cast(builder, value, typ, inner_type) + imp = context.get_getattr(inner_type, attr) + return imp(context, builder, inner_type, val, attr) + + +@lower_setattr_generic(types.Optional) +def optional_setattr(context, builder, sig, args, attr): + """ + Optional.__setattr__ => redirect to the wrapped type. + """ + basety, valty = sig.args + target, val = args + target_type = basety.type + target = context.cast(builder, target, basety, target_type) + + newsig = typing.signature(sig.return_type, target_type, valty) + imp = context.get_setattr(attr, newsig) + return imp(builder, (target, val)) + + +@lower_cast(types.Optional, types.Optional) +def optional_to_optional(context, builder, fromty, toty, val): + """ + The handling of optional->optional cast must be special cased for + correct propagation of None value. Given type T and U. casting of + T? to U? (? denotes optional) should always succeed. If the from-value + is None, the None value the casted value (U?) should be None; otherwise, + the from-value is casted to U. This is different from casting T? to U, + which requires the from-value must not be None. + """ + optval = context.make_helper(builder, fromty, value=val) + validbit = cgutils.as_bool_bit(builder, optval.valid) + # Create uninitialized optional value + outoptval = context.make_helper(builder, toty) + + with builder.if_else(validbit) as (is_valid, is_not_valid): + with is_valid: + # Cast internal value + outoptval.valid = cgutils.true_bit + outoptval.data = context.cast(builder, optval.data, + fromty.type, toty.type) + + with is_not_valid: + # Store None to result + outoptval.valid = cgutils.false_bit + outoptval.data = cgutils.get_null_value( + outoptval.data.type) + + return outoptval._getvalue() + + +@lower_cast(types.Any, types.Optional) +def any_to_optional(context, builder, fromty, toty, val): + if fromty == types.none: + return context.make_optional_none(builder, toty.type) + else: + val = context.cast(builder, val, fromty, toty.type) + return context.make_optional_value(builder, toty.type, val) + + +@lower_cast(types.Optional, types.Any) +@lower_cast(types.Optional, types.Boolean) +def optional_to_any(context, builder, fromty, toty, val): + optval = context.make_helper(builder, fromty, value=val) + validbit = cgutils.as_bool_bit(builder, optval.valid) + with builder.if_then(builder.not_(validbit), likely=False): + msg = "expected %s, got None" % (fromty.type,) + context.call_conv.return_user_exc(builder, TypeError, (msg,)) + + return context.cast(builder, optval.data, fromty.type, toty) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/options.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/options.py new file mode 100644 index 0000000000000000000000000000000000000000..d8e99c8daad1e9cdbec479aba13bcd069e5148f9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/options.py @@ -0,0 +1,108 @@ +""" +Target Options +""" +import operator + +from numba.core import config, utils +from numba.core.targetconfig import TargetConfig, Option + + +class TargetOptions: + """Target options maps user options from decorators to the + ``numba.core.compiler.Flags`` used by lowering and target context. + """ + class Mapping: + def __init__(self, flag_name, apply=lambda x: x): + self.flag_name = flag_name + self.apply = apply + + def finalize(self, flags, options): + """Subclasses can override this method to make target specific + customizations of default flags. + + Parameters + ---------- + flags : Flags + options : dict + """ + pass + + @classmethod + def parse_as_flags(cls, flags, options): + """Parse target options defined in ``options`` and set ``flags`` + accordingly. + + Parameters + ---------- + flags : Flags + options : dict + """ + opt = cls() + opt._apply(flags, options) + opt.finalize(flags, options) + return flags + + def _apply(self, flags, options): + # Find all Mapping instances in the class + mappings = {} + cls = type(self) + for k in dir(cls): + v = getattr(cls, k) + if isinstance(v, cls.Mapping): + mappings[k] = v + + used = set() + for k, mapping in mappings.items(): + if k in options: + v = mapping.apply(options[k]) + setattr(flags, mapping.flag_name, v) + used.add(k) + + unused = set(options) - used + if unused: + # Unread options? + m = (f"Unrecognized options: {unused}. " + f"Known options are {mappings.keys()}") + raise KeyError(m) + + +_mapping = TargetOptions.Mapping + + +class DefaultOptions: + """Defines how user-level target options are mapped to the target flags. + """ + nopython = _mapping("enable_pyobject", operator.not_) + forceobj = _mapping("force_pyobject") + looplift = _mapping("enable_looplift") + _nrt = _mapping("nrt") + debug = _mapping("debuginfo") + boundscheck = _mapping("boundscheck") + nogil = _mapping("release_gil") + writable_args = _mapping("writable_args") + + no_rewrites = _mapping("no_rewrites") + no_cpython_wrapper = _mapping("no_cpython_wrapper") + no_cfunc_wrapper = _mapping("no_cfunc_wrapper") + + parallel = _mapping("auto_parallel") + fastmath = _mapping("fastmath") + error_model = _mapping("error_model") + inline = _mapping("inline") + forceinline = _mapping("forceinline") + + _dbg_extend_lifetimes = _mapping("dbg_extend_lifetimes") + _dbg_optnone = _mapping("dbg_optnone") + + +def include_default_options(*args): + """Returns a mixin class with a subset of the options + + Parameters + ---------- + *args : str + Option names to include. + """ + glbs = {k: getattr(DefaultOptions, k) for k in args} + + return type("OptionMixins", (), glbs) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/postproc.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/postproc.py new file mode 100644 index 0000000000000000000000000000000000000000..eab5310ca3e4ca89507e6cfb700f8855891e30e7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/postproc.py @@ -0,0 +1,239 @@ +from functools import cached_property +from numba.core import ir, analysis, transforms, ir_utils + + +class YieldPoint(object): + + def __init__(self, block, inst): + assert isinstance(block, ir.Block) + assert isinstance(inst, ir.Yield) + self.block = block + self.inst = inst + self.live_vars = None + self.weak_live_vars = None + + +class GeneratorInfo(object): + + def __init__(self): + # { index: YieldPoint } + self.yield_points = {} + # Ordered list of variable names + self.state_vars = [] + + def get_yield_points(self): + """ + Return an iterable of YieldPoint instances. + """ + return self.yield_points.values() + + +class VariableLifetime(object): + """ + For lazily building information of variable lifetime + """ + def __init__(self, blocks): + self._blocks = blocks + + @cached_property + def cfg(self): + return analysis.compute_cfg_from_blocks(self._blocks) + + @cached_property + def usedefs(self): + return analysis.compute_use_defs(self._blocks) + + @cached_property + def livemap(self): + return analysis.compute_live_map(self.cfg, self._blocks, + self.usedefs.usemap, + self.usedefs.defmap) + + @cached_property + def deadmaps(self): + return analysis.compute_dead_maps(self.cfg, self._blocks, self.livemap, + self.usedefs.defmap) + + +# other packages that define new nodes add calls for inserting dels +# format: {type:function} +ir_extension_insert_dels = {} + + +class PostProcessor(object): + """ + A post-processor for Numba IR. + """ + + def __init__(self, func_ir): + self.func_ir = func_ir + + def run(self, emit_dels: bool = False, extend_lifetimes: bool = False): + """ + Run the following passes over Numba IR: + - canonicalize the CFG + - emit explicit `del` instructions for variables + - compute lifetime of variables + - compute generator info (if function is a generator function) + """ + self.func_ir.blocks = transforms.canonicalize_cfg(self.func_ir.blocks) + vlt = VariableLifetime(self.func_ir.blocks) + self.func_ir.variable_lifetime = vlt + + bev = analysis.compute_live_variables(vlt.cfg, self.func_ir.blocks, + vlt.usedefs.defmap, + vlt.deadmaps.combined) + for offset, ir_block in self.func_ir.blocks.items(): + self.func_ir.block_entry_vars[ir_block] = bev[offset] + + if self.func_ir.is_generator: + self.func_ir.generator_info = GeneratorInfo() + self._compute_generator_info() + else: + self.func_ir.generator_info = None + + # Emit del nodes, do this last as the generator info parsing generates + # and then strips dels as part of its analysis. + if emit_dels: + self._insert_var_dels(extend_lifetimes=extend_lifetimes) + + def _populate_generator_info(self): + """ + Fill `index` for the Yield instruction and create YieldPoints. + """ + dct = self.func_ir.generator_info.yield_points + assert not dct, 'rerunning _populate_generator_info' + for block in self.func_ir.blocks.values(): + for inst in block.body: + if isinstance(inst, ir.Assign): + yieldinst = inst.value + if isinstance(yieldinst, ir.Yield): + index = len(dct) + 1 + yieldinst.index = index + yp = YieldPoint(block, yieldinst) + dct[yieldinst.index] = yp + + def _compute_generator_info(self): + """ + Compute the generator's state variables as the union of live variables + at all yield points. + """ + # generate del info, it's used in analysis here, strip it out at the end + self._insert_var_dels() + self._populate_generator_info() + gi = self.func_ir.generator_info + for yp in gi.get_yield_points(): + live_vars = set(self.func_ir.get_block_entry_vars(yp.block)) + weak_live_vars = set() + stmts = iter(yp.block.body) + for stmt in stmts: + if isinstance(stmt, ir.Assign): + if stmt.value is yp.inst: + break + live_vars.add(stmt.target.name) + elif isinstance(stmt, ir.Del): + live_vars.remove(stmt.value) + else: + assert 0, "couldn't find yield point" + # Try to optimize out any live vars that are deleted immediately + # after the yield point. + for stmt in stmts: + if isinstance(stmt, ir.Del): + name = stmt.value + if name in live_vars: + live_vars.remove(name) + weak_live_vars.add(name) + else: + break + yp.live_vars = live_vars + yp.weak_live_vars = weak_live_vars + + st = set() + for yp in gi.get_yield_points(): + st |= yp.live_vars + st |= yp.weak_live_vars + gi.state_vars = sorted(st) + self.remove_dels() + + def _insert_var_dels(self, extend_lifetimes=False): + """ + Insert del statements for each variable. + Returns a 2-tuple of (variable definition map, variable deletion map) + which indicates variables defined and deleted in each block. + + The algorithm avoids relying on explicit knowledge on loops and + distinguish between variables that are defined locally vs variables that + come from incoming blocks. + We start with simple usage (variable reference) and definition (variable + creation) maps on each block. Propagate the liveness info to predecessor + blocks until it stabilize, at which point we know which variables must + exist before entering each block. Then, we compute the end of variable + lives and insert del statements accordingly. Variables are deleted after + the last use. Variable referenced by terminators (e.g. conditional + branch and return) are deleted by the successors or the caller. + """ + vlt = self.func_ir.variable_lifetime + self._patch_var_dels(vlt.deadmaps.internal, vlt.deadmaps.escaping, + extend_lifetimes=extend_lifetimes) + + def _patch_var_dels(self, internal_dead_map, escaping_dead_map, + extend_lifetimes=False): + """ + Insert delete in each block + """ + for offset, ir_block in self.func_ir.blocks.items(): + # for each internal var, insert delete after the last use + internal_dead_set = internal_dead_map[offset].copy() + delete_pts = [] + # for each statement in reverse order + for stmt in reversed(ir_block.body[:-1]): + # internal vars that are used here + live_set = set(v.name for v in stmt.list_vars()) + dead_set = live_set & internal_dead_set + for T, def_func in ir_extension_insert_dels.items(): + if isinstance(stmt, T): + done_dels = def_func(stmt, dead_set) + dead_set -= done_dels + internal_dead_set -= done_dels + # used here but not afterwards + delete_pts.append((stmt, dead_set)) + internal_dead_set -= dead_set + + # rewrite body and insert dels + body = [] + lastloc = ir_block.loc + del_store = [] + for stmt, delete_set in reversed(delete_pts): + # If using extended lifetimes then the Dels are all put at the + # block end just ahead of the terminator, so associate their + # location with the terminator. + if extend_lifetimes: + lastloc = ir_block.body[-1].loc + else: + lastloc = stmt.loc + # Ignore dels (assuming no user inserted deletes) + if not isinstance(stmt, ir.Del): + body.append(stmt) + # note: the reverse sort is not necessary for correctness + # it is just to minimize changes to test for now + for var_name in sorted(delete_set, reverse=True): + delnode = ir.Del(var_name, loc=lastloc) + if extend_lifetimes: + del_store.append(delnode) + else: + body.append(delnode) + if extend_lifetimes: + body.extend(del_store) + body.append(ir_block.body[-1]) # terminator + ir_block.body = body + + # vars to delete at the start + escape_dead_set = escaping_dead_map[offset] + for var_name in sorted(escape_dead_set): + ir_block.prepend(ir.Del(var_name, loc=ir_block.body[0].loc)) + + def remove_dels(self): + """ + Strips the IR of Del nodes + """ + ir_utils.remove_dels(self.func_ir.blocks) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/pylowering.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/pylowering.py new file mode 100644 index 0000000000000000000000000000000000000000..ca09fe3701041a74e5d9d716372ccba70b2a9330 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/pylowering.py @@ -0,0 +1,672 @@ +""" +Lowering implementation for object mode. +""" + + +import builtins +import operator +import inspect +from functools import cached_property + +import llvmlite.ir + +from numba.core import types, utils, ir, generators, cgutils +from numba.core.errors import (ForbiddenConstruct, LoweringError, + NumbaNotImplementedError) +from numba.core.lowering import BaseLower + + +# Issue #475: locals() is unsupported as calling it naively would give +# out wrong results. +_unsupported_builtins = set([locals]) + + +class _Undefined: + """ + A sentinel value for undefined variable created by Expr.undef. + """ + def __repr__(self): + return "" + + +_UNDEFINED = _Undefined() + + +# Map operators to methods on the PythonAPI class +PYTHON_BINOPMAP = { + operator.add: ("number_add", False), + operator.sub: ("number_subtract", False), + operator.mul: ("number_multiply", False), + operator.truediv: ("number_truedivide", False), + operator.floordiv: ("number_floordivide", False), + operator.mod: ("number_remainder", False), + operator.pow: ("number_power", False), + operator.lshift: ("number_lshift", False), + operator.rshift: ("number_rshift", False), + operator.and_: ("number_and", False), + operator.or_: ("number_or", False), + operator.xor: ("number_xor", False), + # inplace operators + operator.iadd: ("number_add", True), + operator.isub: ("number_subtract", True), + operator.imul: ("number_multiply", True), + operator.itruediv: ("number_truedivide", True), + operator.ifloordiv: ("number_floordivide", True), + operator.imod: ("number_remainder", True), + operator.ipow: ("number_power", True), + operator.ilshift: ("number_lshift", True), + operator.irshift: ("number_rshift", True), + operator.iand: ("number_and", True), + operator.ior: ("number_or", True), + operator.ixor: ("number_xor", True), +} + +PYTHON_BINOPMAP[operator.matmul] = ("number_matrix_multiply", False) +PYTHON_BINOPMAP[operator.imatmul] = ("number_matrix_multiply", True) + +PYTHON_COMPAREOPMAP = { + operator.eq: '==', + operator.ne: '!=', + operator.lt: '<', + operator.le: '<=', + operator.gt: '>', + operator.ge: '>=', + operator.is_: 'is', + operator.is_not: 'is not', + operator.contains: 'in' +} + +class PyLower(BaseLower): + + GeneratorLower = generators.PyGeneratorLower + + def init(self): + # Strings to be frozen into the Environment object + self._frozen_strings = set() + + self._live_vars = set() + + def pre_lower(self): + super(PyLower, self).pre_lower() + self.init_pyapi() + + def post_lower(self): + pass + + def pre_block(self, block): + self.init_vars(block) + + def lower_inst(self, inst): + if isinstance(inst, ir.Assign): + value = self.lower_assign(inst) + self.storevar(value, inst.target.name) + + elif isinstance(inst, ir.SetItem): + target = self.loadvar(inst.target.name) + index = self.loadvar(inst.index.name) + value = self.loadvar(inst.value.name) + ok = self.pyapi.object_setitem(target, index, value) + self.check_int_status(ok) + + elif isinstance(inst, ir.DelItem): + target = self.loadvar(inst.target.name) + index = self.loadvar(inst.index.name) + ok = self.pyapi.object_delitem(target, index) + self.check_int_status(ok) + + elif isinstance(inst, ir.SetAttr): + target = self.loadvar(inst.target.name) + value = self.loadvar(inst.value.name) + ok = self.pyapi.object_setattr(target, + self._freeze_string(inst.attr), + value) + self.check_int_status(ok) + + elif isinstance(inst, ir.DelAttr): + target = self.loadvar(inst.target.name) + ok = self.pyapi.object_delattr(target, + self._freeze_string(inst.attr)) + self.check_int_status(ok) + + elif isinstance(inst, ir.StoreMap): + dct = self.loadvar(inst.dct.name) + key = self.loadvar(inst.key.name) + value = self.loadvar(inst.value.name) + ok = self.pyapi.dict_setitem(dct, key, value) + self.check_int_status(ok) + + elif isinstance(inst, ir.Return): + retval = self.loadvar(inst.value.name) + if self.generator_info: + # StopIteration + # We own a reference to the "return value", but we + # don't return it. + self.pyapi.decref(retval) + self.genlower.return_from_generator(self) + return + # No need to incref() as the reference is already owned. + self.call_conv.return_value(self.builder, retval) + + elif isinstance(inst, ir.Branch): + cond = self.loadvar(inst.cond.name) + if cond.type == llvmlite.ir.IntType(1): + istrue = cond + else: + istrue = self.pyapi.object_istrue(cond) + zero = llvmlite.ir.Constant(istrue.type, None) + pred = self.builder.icmp_unsigned('!=', istrue, zero) + tr = self.blkmap[inst.truebr] + fl = self.blkmap[inst.falsebr] + self.builder.cbranch(pred, tr, fl) + + elif isinstance(inst, ir.Jump): + target = self.blkmap[inst.target] + self.builder.branch(target) + + elif isinstance(inst, ir.Del): + self.delvar(inst.value) + + elif isinstance(inst, ir.PopBlock): + pass # this is just a marker + + elif isinstance(inst, ir.Raise): + if inst.exception is not None: + exc = self.loadvar(inst.exception.name) + # A reference will be stolen by raise_object() and another + # by return_exception_raised(). + self.incref(exc) + else: + exc = None + self.pyapi.raise_object(exc) + self.return_exception_raised() + + else: + msg = f"{type(inst)}, {inst}" + raise NumbaNotImplementedError(msg) + + @cached_property + def _omitted_typobj(self): + """Return a `OmittedArg` type instance as a LLVM value suitable for + testing at runtime. + """ + from numba.core.dispatcher import OmittedArg + return self.pyapi.unserialize( + self.pyapi.serialize_object(OmittedArg)) + + def lower_assign(self, inst): + """ + The returned object must have a new reference + """ + value = inst.value + if isinstance(value, (ir.Const, ir.FreeVar)): + return self.lower_const(value.value) + elif isinstance(value, ir.Var): + val = self.loadvar(value.name) + self.incref(val) + return val + elif isinstance(value, ir.Expr): + return self.lower_expr(value) + elif isinstance(value, ir.Global): + return self.lower_global(value.name, value.value) + elif isinstance(value, ir.Yield): + return self.lower_yield(value) + elif isinstance(value, ir.Arg): + param = self.func_ir.func_id.pysig.parameters.get(value.name) + + obj = self.fnargs[value.index] + slot = cgutils.alloca_once_value(self.builder, obj) + # Don't check for OmittedArg unless the argument has a default + if param is not None and param.default is inspect.Parameter.empty: + self.incref(obj) + self.builder.store(obj, slot) + else: + # When an argument is omitted, the dispatcher hands it as + # _OmittedArg() + typobj = self.pyapi.get_type(obj) + is_omitted = self.builder.icmp_unsigned('==', typobj, + self._omitted_typobj) + with self.builder.if_else(is_omitted, likely=False) as (omitted, present): + with present: + self.incref(obj) + self.builder.store(obj, slot) + with omitted: + # The argument is omitted => get the default value + obj = self.pyapi.object_getattr_string(obj, 'value') + self.builder.store(obj, slot) + + return self.builder.load(slot) + else: + raise NotImplementedError(type(value), value) + + def lower_yield(self, inst): + yp = self.generator_info.yield_points[inst.index] + assert yp.inst is inst + self.genlower.init_generator_state(self) + + # Save live vars in state + # We also need to save live vars that are del'ed afterwards. + y = generators.LowerYield(self, yp, yp.live_vars | yp.weak_live_vars) + y.lower_yield_suspend() + # Yield to caller + val = self.loadvar(inst.value.name) + # Let caller own the reference + self.pyapi.incref(val) + self.call_conv.return_value(self.builder, val) + + # Resumption point + y.lower_yield_resume() + # None is returned by the yield expression + return self.pyapi.make_none() + + def lower_binop(self, expr, op, inplace=False): + lhs = self.loadvar(expr.lhs.name) + rhs = self.loadvar(expr.rhs.name) + assert not isinstance(op, str) + if op in PYTHON_BINOPMAP: + fname, inplace = PYTHON_BINOPMAP[op] + fn = getattr(self.pyapi, fname) + res = fn(lhs, rhs, inplace=inplace) + else: + # Assumed to be rich comparison + fn = PYTHON_COMPAREOPMAP.get(expr.fn, expr.fn) + if fn == 'in': # 'in' and operator.contains have args reversed + lhs, rhs = rhs, lhs + res = self.pyapi.object_richcompare(lhs, rhs, fn) + self.check_error(res) + return res + + def lower_expr(self, expr): + if expr.op == 'binop': + return self.lower_binop(expr, expr.fn, inplace=False) + elif expr.op == 'inplace_binop': + return self.lower_binop(expr, expr.fn, inplace=True) + elif expr.op == 'unary': + value = self.loadvar(expr.value.name) + if expr.fn == operator.neg: + res = self.pyapi.number_negative(value) + elif expr.fn == operator.pos: + res = self.pyapi.number_positive(value) + elif expr.fn == operator.not_: + res = self.pyapi.object_not(value) + self.check_int_status(res) + res = self.pyapi.bool_from_bool(res) + elif expr.fn == operator.invert: + res = self.pyapi.number_invert(value) + else: + raise NotImplementedError(expr) + self.check_error(res) + return res + elif expr.op == 'call': + argvals = [self.loadvar(a.name) for a in expr.args] + fn = self.loadvar(expr.func.name) + args = self.pyapi.tuple_pack(argvals) + if expr.vararg: + # Expand *args + varargs = self.pyapi.sequence_tuple( + self.loadvar(expr.vararg.name)) + new_args = self.pyapi.sequence_concat(args, varargs) + self.decref(varargs) + self.decref(args) + args = new_args + if not expr.kws: + # No named arguments + ret = self.pyapi.call(fn, args, None) + else: + # Named arguments + keyvalues = [(k, self.loadvar(v.name)) for k, v in expr.kws] + kws = self.pyapi.dict_pack(keyvalues) + ret = self.pyapi.call(fn, args, kws) + self.decref(kws) + self.decref(args) + self.check_error(ret) + return ret + elif expr.op == 'getattr': + obj = self.loadvar(expr.value.name) + res = self.pyapi.object_getattr(obj, self._freeze_string(expr.attr)) + self.check_error(res) + return res + elif expr.op == 'build_tuple': + items = [self.loadvar(it.name) for it in expr.items] + res = self.pyapi.tuple_pack(items) + self.check_error(res) + return res + elif expr.op == 'build_list': + items = [self.loadvar(it.name) for it in expr.items] + res = self.pyapi.list_pack(items) + self.check_error(res) + return res + elif expr.op == 'build_map': + res = self.pyapi.dict_new(expr.size) + self.check_error(res) + for k, v in expr.items: + key = self.loadvar(k.name) + value = self.loadvar(v.name) + ok = self.pyapi.dict_setitem(res, key, value) + self.check_int_status(ok) + return res + elif expr.op == 'build_set': + items = [self.loadvar(it.name) for it in expr.items] + res = self.pyapi.set_new() + self.check_error(res) + for it in items: + ok = self.pyapi.set_add(res, it) + self.check_int_status(ok) + return res + elif expr.op == 'getiter': + obj = self.loadvar(expr.value.name) + res = self.pyapi.object_getiter(obj) + self.check_error(res) + return res + elif expr.op == 'iternext': + iterobj = self.loadvar(expr.value.name) + item = self.pyapi.iter_next(iterobj) + is_valid = cgutils.is_not_null(self.builder, item) + pair = self.pyapi.tuple_new(2) + with self.builder.if_else(is_valid) as (then, otherwise): + with then: + self.pyapi.tuple_setitem(pair, 0, item) + with otherwise: + self.check_occurred() + # Make the tuple valid by inserting None as dummy + # iteration "result" (it will be ignored). + self.pyapi.tuple_setitem(pair, 0, self.pyapi.make_none()) + self.pyapi.tuple_setitem(pair, 1, self.pyapi.bool_from_bool(is_valid)) + return pair + elif expr.op == 'pair_first': + pair = self.loadvar(expr.value.name) + first = self.pyapi.tuple_getitem(pair, 0) + self.incref(first) + return first + elif expr.op == 'pair_second': + pair = self.loadvar(expr.value.name) + second = self.pyapi.tuple_getitem(pair, 1) + self.incref(second) + return second + elif expr.op == 'exhaust_iter': + iterobj = self.loadvar(expr.value.name) + tup = self.pyapi.sequence_tuple(iterobj) + self.check_error(tup) + # Check tuple size is as expected + tup_size = self.pyapi.tuple_size(tup) + expected_size = self.context.get_constant(types.intp, expr.count) + has_wrong_size = self.builder.icmp_unsigned('!=', + tup_size, expected_size) + with cgutils.if_unlikely(self.builder, has_wrong_size): + self.return_exception(ValueError) + return tup + elif expr.op == 'getitem': + value = self.loadvar(expr.value.name) + index = self.loadvar(expr.index.name) + res = self.pyapi.object_getitem(value, index) + self.check_error(res) + return res + elif expr.op == 'static_getitem': + value = self.loadvar(expr.value.name) + index = self.context.get_constant(types.intp, expr.index) + indexobj = self.pyapi.long_from_ssize_t(index) + self.check_error(indexobj) + res = self.pyapi.object_getitem(value, indexobj) + self.decref(indexobj) + self.check_error(res) + return res + elif expr.op == 'getslice': + target = self.loadvar(expr.target.name) + start = self.loadvar(expr.start.name) + stop = self.loadvar(expr.stop.name) + + slicefn = self.get_builtin_obj("slice") + sliceobj = self.pyapi.call_function_objargs(slicefn, (start, stop)) + self.decref(slicefn) + self.check_error(sliceobj) + + res = self.pyapi.object_getitem(target, sliceobj) + self.check_error(res) + + return res + + elif expr.op == 'cast': + val = self.loadvar(expr.value.name) + self.incref(val) + return val + elif expr.op == 'phi': + raise LoweringError("PHI not stripped") + + elif expr.op == 'null': + # Make null value + return cgutils.get_null_value(self.pyapi.pyobj) + + elif expr.op == 'undef': + # Use a sentinel value for undefined variable + return self.lower_const(_UNDEFINED) + + else: + raise NotImplementedError(expr) + + def lower_const(self, const): + # All constants are frozen inside the environment + index = self.env_manager.add_const(const) + ret = self.env_manager.read_const(index) + self.check_error(ret) + self.incref(ret) + return ret + + def lower_global(self, name, value): + """ + 1) Check global scope dictionary. + 2) Check __builtins__. + 2a) is it a dictionary (for non __main__ module) + 2b) is it a module (for __main__ module) + """ + moddict = self.get_module_dict() + obj = self.pyapi.dict_getitem(moddict, self._freeze_string(name)) + self.incref(obj) # obj is borrowed + + try: + if value in _unsupported_builtins: + raise ForbiddenConstruct("builtins %s() is not supported" + % name, loc=self.loc) + except TypeError: + # `value` is unhashable, ignore + pass + + if hasattr(builtins, name): + obj_is_null = self.is_null(obj) + bbelse = self.builder.basic_block + + with self.builder.if_then(obj_is_null): + mod = self.pyapi.dict_getitem(moddict, + self._freeze_string("__builtins__")) + builtin = self.builtin_lookup(mod, name) + bbif = self.builder.basic_block + + retval = self.builder.phi(self.pyapi.pyobj) + retval.add_incoming(obj, bbelse) + retval.add_incoming(builtin, bbif) + + else: + retval = obj + with cgutils.if_unlikely(self.builder, self.is_null(retval)): + self.pyapi.raise_missing_global_error(name) + self.return_exception_raised() + + return retval + + # ------------------------------------------------------------------------- + + def get_module_dict(self): + return self.env_body.globals + + def get_builtin_obj(self, name): + # XXX The builtins dict could be bound into the environment + moddict = self.get_module_dict() + mod = self.pyapi.dict_getitem(moddict, + self._freeze_string("__builtins__")) + return self.builtin_lookup(mod, name) + + def builtin_lookup(self, mod, name): + """ + Args + ---- + mod: + The __builtins__ dictionary or module, as looked up in + a module's globals. + name: str + The object to lookup + """ + fromdict = self.pyapi.dict_getitem(mod, self._freeze_string(name)) + self.incref(fromdict) # fromdict is borrowed + bbifdict = self.builder.basic_block + + with cgutils.if_unlikely(self.builder, self.is_null(fromdict)): + # This happen if we are using the __main__ module + frommod = self.pyapi.object_getattr(mod, self._freeze_string(name)) + + with cgutils.if_unlikely(self.builder, self.is_null(frommod)): + self.pyapi.raise_missing_global_error(name) + self.return_exception_raised() + + bbifmod = self.builder.basic_block + + builtin = self.builder.phi(self.pyapi.pyobj) + builtin.add_incoming(fromdict, bbifdict) + builtin.add_incoming(frommod, bbifmod) + + return builtin + + def check_occurred(self): + """ + Return if an exception occurred. + """ + err_occurred = cgutils.is_not_null(self.builder, + self.pyapi.err_occurred()) + + with cgutils.if_unlikely(self.builder, err_occurred): + self.return_exception_raised() + + def check_error(self, obj): + """ + Return if *obj* is NULL. + """ + with cgutils.if_unlikely(self.builder, self.is_null(obj)): + self.return_exception_raised() + + return obj + + def check_int_status(self, num, ok_value=0): + """ + Raise an exception if *num* is smaller than *ok_value*. + """ + ok = llvmlite.ir.Constant(num.type, ok_value) + pred = self.builder.icmp_signed('<', num, ok) + with cgutils.if_unlikely(self.builder, pred): + self.return_exception_raised() + + def is_null(self, obj): + return cgutils.is_null(self.builder, obj) + + def return_exception_raised(self): + """ + Return with the currently raised exception. + """ + self.cleanup_vars() + self.call_conv.return_exc(self.builder) + + def init_vars(self, block): + """ + Initialize live variables for *block*. + """ + self._live_vars = set(self.func_ir.get_block_entry_vars(block)) + + def _getvar(self, name, ltype=None): + if name not in self.varmap: + self.varmap[name] = self.alloca(name, ltype=ltype) + return self.varmap[name] + + def loadvar(self, name): + """ + Load the llvm value of the variable named *name*. + """ + # If this raises then the live variables analysis is wrong + assert name in self._live_vars, name + ptr = self.varmap[name] + val = self.builder.load(ptr) + with cgutils.if_unlikely(self.builder, self.is_null(val)): + self.pyapi.raise_missing_name_error(name) + self.return_exception_raised() + return val + + def delvar(self, name): + """ + Delete the variable slot with the given name. This will decref + the corresponding Python object. + """ + # If this raises then the live variables analysis is wrong + self._live_vars.remove(name) + ptr = self._getvar(name) # initializes `name` if not already + self.decref(self.builder.load(ptr)) + # This is a safety guard against double decref's, but really + # the IR should be correct and have only one Del per variable + # and code path. + self.builder.store(cgutils.get_null_value(ptr.type.pointee), ptr) + + def storevar(self, value, name, clobber=False): + """ + Stores a llvm value and allocate stack slot if necessary. + The llvm value can be of arbitrary type. + """ + is_redefine = name in self._live_vars and not clobber + ptr = self._getvar(name, ltype=value.type) + if is_redefine: + old = self.builder.load(ptr) + else: + self._live_vars.add(name) + assert value.type == ptr.type.pointee, (str(value.type), + str(ptr.type.pointee)) + self.builder.store(value, ptr) + # Safe to call decref even on non python object + if is_redefine: + self.decref(old) + + def cleanup_vars(self): + """ + Cleanup live variables. + """ + for name in self._live_vars: + ptr = self._getvar(name) + self.decref(self.builder.load(ptr)) + + def alloca(self, name, ltype=None): + """ + Allocate a stack slot and initialize it to NULL. + The default is to allocate a pyobject pointer. + Use ``ltype`` to override. + """ + if ltype is None: + ltype = self.context.get_value_type(types.pyobject) + with self.builder.goto_block(self.entry_block): + ptr = self.builder.alloca(ltype, name=name) + self.builder.store(cgutils.get_null_value(ltype), ptr) + return ptr + + def _alloca_var(self, name, fetype): + # This is here for API compatibility with lowering.py::Lower. + # NOTE: fetype is unused + return self.alloca(name) + + def incref(self, value): + self.pyapi.incref(value) + + def decref(self, value): + """ + This is allow to be called on non pyobject pointer, in which case + no code is inserted. + """ + lpyobj = self.context.get_value_type(types.pyobject) + if value.type == lpyobj: + self.pyapi.decref(value) + + def _freeze_string(self, string): + """ + Freeze a Python string object into the code. + """ + return self.lower_const(string) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/pythonapi.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/pythonapi.py new file mode 100644 index 0000000000000000000000000000000000000000..2e29a1694f8a19f20a83a6557df56f8dc6b077e7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/pythonapi.py @@ -0,0 +1,1725 @@ +from collections import namedtuple +import contextlib +import pickle +import hashlib +import sys + +from llvmlite import ir +from llvmlite.ir import Constant + +import ctypes +from numba import _helperlib +from numba.core import ( + types, utils, config, lowering, cgutils, imputils, serialize, +) +from numba.core.utils import PYVERSION + +PY_UNICODE_1BYTE_KIND = _helperlib.py_unicode_1byte_kind +PY_UNICODE_2BYTE_KIND = _helperlib.py_unicode_2byte_kind +PY_UNICODE_4BYTE_KIND = _helperlib.py_unicode_4byte_kind +if PYVERSION in ((3, 10), (3, 11)): + PY_UNICODE_WCHAR_KIND = _helperlib.py_unicode_wchar_kind + + +class _Registry(object): + + def __init__(self): + self.functions = {} + + def register(self, typeclass): + assert issubclass(typeclass, types.Type) + def decorator(func): + if typeclass in self.functions: + raise KeyError("duplicate registration for %s" % (typeclass,)) + self.functions[typeclass] = func + return func + return decorator + + def lookup(self, typeclass, default=None): + assert issubclass(typeclass, types.Type) + for cls in typeclass.__mro__: + func = self.functions.get(cls) + if func is not None: + return func + return default + +# Registries of boxing / unboxing implementations +_boxers = _Registry() +_unboxers = _Registry() +_reflectors = _Registry() + +box = _boxers.register +unbox = _unboxers.register +reflect = _reflectors.register + +class _BoxContext(namedtuple("_BoxContext", + ("context", "builder", "pyapi", "env_manager"))): + """ + The facilities required by boxing implementations. + """ + __slots__ = () + + def box(self, typ, val): + return self.pyapi.from_native_value(typ, val, self.env_manager) + + +class _UnboxContext(namedtuple("_UnboxContext", + ("context", "builder", "pyapi"))): + """ + The facilities required by unboxing implementations. + """ + __slots__ = () + + def unbox(self, typ, obj): + return self.pyapi.to_native_value(typ, obj) + + +class _ReflectContext(namedtuple("_ReflectContext", + ("context", "builder", "pyapi", "env_manager", + "is_error"))): + """ + The facilities required by reflection implementations. + """ + __slots__ = () + + # XXX the error bit is currently unused by consumers (e.g. PyCallWrapper) + def set_error(self): + self.builder.store(self.is_error, cgutils.true_bit) + + def box(self, typ, val): + return self.pyapi.from_native_value(typ, val, self.env_manager) + + def reflect(self, typ, val): + return self.pyapi.reflect_native_value(typ, val, self.env_manager) + + +class NativeValue(object): + """ + Encapsulate the result of converting a Python object to a native value, + recording whether the conversion was successful and how to cleanup. + """ + + def __init__(self, value, is_error=None, cleanup=None): + self.value = value + self.is_error = is_error if is_error is not None else cgutils.false_bit + self.cleanup = cleanup + + +class EnvironmentManager(object): + + def __init__(self, pyapi, env, env_body, env_ptr): + assert isinstance(env, lowering.Environment) + self.pyapi = pyapi + self.env = env + self.env_body = env_body + self.env_ptr = env_ptr + + def add_const(self, const): + """ + Add a constant to the environment, return its index. + """ + # All constants are frozen inside the environment + if isinstance(const, str): + const = sys.intern(const) + for index, val in enumerate(self.env.consts): + if val is const: + break + else: + index = len(self.env.consts) + self.env.consts.append(const) + return index + + def read_const(self, index): + """ + Look up constant number *index* inside the environment body. + A borrowed reference is returned. + + The returned LLVM value may have NULL value at runtime which indicates + an error at runtime. + """ + assert index < len(self.env.consts) + + builder = self.pyapi.builder + consts = self.env_body.consts + ret = cgutils.alloca_once(builder, self.pyapi.pyobj, zfill=True) + with builder.if_else(cgutils.is_not_null(builder, consts)) as \ + (br_not_null, br_null): + with br_not_null: + getitem = self.pyapi.list_getitem(consts, index) + builder.store(getitem, ret) + with br_null: + # This can happen when the Environment is accidentally released + # and has subsequently been garbage collected. + self.pyapi.err_set_string( + "PyExc_RuntimeError", + "`env.consts` is NULL in `read_const`", + ) + return builder.load(ret) + + +_IteratorLoop = namedtuple('_IteratorLoop', ('value', 'do_break')) + + +class PythonAPI(object): + """ + Code generation facilities to call into the CPython C API (and related + helpers). + """ + + def __init__(self, context, builder): + """ + Note: Maybe called multiple times when lowering a function + """ + self.context = context + self.builder = builder + + self.module = builder.basic_block.function.module + # A unique mapping of serialized objects in this module + try: + self.module.__serialized + except AttributeError: + self.module.__serialized = {} + + # Initialize types + self.pyobj = self.context.get_argument_type(types.pyobject) + self.pyobjptr = self.pyobj.as_pointer() + self.voidptr = ir.PointerType(ir.IntType(8)) + self.long = ir.IntType(ctypes.sizeof(ctypes.c_long) * 8) + self.ulong = self.long + self.longlong = ir.IntType(ctypes.sizeof(ctypes.c_ulonglong) * 8) + self.ulonglong = self.longlong + self.double = ir.DoubleType() + if config.USE_LEGACY_TYPE_SYSTEM: + self.py_ssize_t = self.context.get_value_type(types.intp) + else: + self.py_ssize_t = self.context.get_value_type(types.c_intp) + self.cstring = ir.PointerType(ir.IntType(8)) + self.gil_state = ir.IntType(_helperlib.py_gil_state_size * 8) + self.py_buffer_t = ir.ArrayType(ir.IntType(8), _helperlib.py_buffer_size) + self.py_hash_t = self.py_ssize_t + self.py_unicode_1byte_kind = _helperlib.py_unicode_1byte_kind + self.py_unicode_2byte_kind = _helperlib.py_unicode_2byte_kind + self.py_unicode_4byte_kind = _helperlib.py_unicode_4byte_kind + + def get_env_manager(self, env, env_body, env_ptr): + return EnvironmentManager(self, env, env_body, env_ptr) + + def emit_environment_sentry(self, envptr, return_pyobject=False, + debug_msg=''): + """Emits LLVM code to ensure the `envptr` is not NULL + """ + is_null = cgutils.is_null(self.builder, envptr) + with cgutils.if_unlikely(self.builder, is_null): + if return_pyobject: + fnty = self.builder.function.type.pointee + assert fnty.return_type == self.pyobj + self.err_set_string( + "PyExc_RuntimeError", f"missing Environment: {debug_msg}", + ) + self.builder.ret(self.get_null_object()) + else: + self.context.call_conv.return_user_exc( + self.builder, RuntimeError, + (f"missing Environment: {debug_msg}",), + ) + + # ------ Python API ----- + + # + # Basic object API + # + + def incref(self, obj): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj]) + fn = self._get_function(fnty, name="Py_IncRef") + self.builder.call(fn, [obj]) + + def decref(self, obj): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj]) + fn = self._get_function(fnty, name="Py_DecRef") + self.builder.call(fn, [obj]) + + def get_type(self, obj): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="numba_py_type") + return self.builder.call(fn, [obj]) + + # + # Argument unpacking + # + + def parse_tuple_and_keywords(self, args, kws, fmt, keywords, *objs): + charptr = ir.PointerType(ir.IntType(8)) + charptrary = ir.PointerType(charptr) + argtypes = [self.pyobj, self.pyobj, charptr, charptrary] + fnty = ir.FunctionType(ir.IntType(32), argtypes, var_arg=True) + fn = self._get_function(fnty, name="PyArg_ParseTupleAndKeywords") + return self.builder.call(fn, [args, kws, fmt, keywords] + list(objs)) + + def parse_tuple(self, args, fmt, *objs): + charptr = ir.PointerType(ir.IntType(8)) + argtypes = [self.pyobj, charptr] + fnty = ir.FunctionType(ir.IntType(32), argtypes, var_arg=True) + fn = self._get_function(fnty, name="PyArg_ParseTuple") + return self.builder.call(fn, [args, fmt] + list(objs)) + + def unpack_tuple(self, args, name, n_min, n_max, *objs): + charptr = ir.PointerType(ir.IntType(8)) + argtypes = [self.pyobj, charptr, self.py_ssize_t, self.py_ssize_t] + fnty = ir.FunctionType(ir.IntType(32), argtypes, var_arg=True) + fn = self._get_function(fnty, name="PyArg_UnpackTuple") + n_min = Constant(self.py_ssize_t, int(n_min)) + n_max = Constant(self.py_ssize_t, int(n_max)) + if isinstance(name, str): + name = self.context.insert_const_string(self.builder.module, name) + return self.builder.call(fn, [args, name, n_min, n_max] + list(objs)) + + # + # Exception and errors + # + + def err_occurred(self): + fnty = ir.FunctionType(self.pyobj, ()) + fn = self._get_function(fnty, name="PyErr_Occurred") + return self.builder.call(fn, ()) + + def err_clear(self): + fnty = ir.FunctionType(ir.VoidType(), ()) + fn = self._get_function(fnty, name="PyErr_Clear") + return self.builder.call(fn, ()) + + def err_set_string(self, exctype, msg): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj, self.cstring]) + fn = self._get_function(fnty, name="PyErr_SetString") + if isinstance(exctype, str): + exctype = self.get_c_object(exctype) + if isinstance(msg, str): + msg = self.context.insert_const_string(self.module, msg) + return self.builder.call(fn, (exctype, msg)) + + def err_format(self, exctype, msg, *format_args): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj, self.cstring], var_arg=True) + fn = self._get_function(fnty, name="PyErr_Format") + if isinstance(exctype, str): + exctype = self.get_c_object(exctype) + if isinstance(msg, str): + msg = self.context.insert_const_string(self.module, msg) + return self.builder.call(fn, (exctype, msg) + tuple(format_args)) + + def raise_object(self, exc=None): + """ + Raise an arbitrary exception (type or value or (type, args) + or None - if reraising). A reference to the argument is consumed. + """ + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj]) + fn = self._get_function(fnty, name="numba_do_raise") + if exc is None: + exc = self.make_none() + return self.builder.call(fn, (exc,)) + + def err_set_object(self, exctype, excval): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyErr_SetObject") + if isinstance(exctype, str): + exctype = self.get_c_object(exctype) + return self.builder.call(fn, (exctype, excval)) + + def err_set_none(self, exctype): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj]) + fn = self._get_function(fnty, name="PyErr_SetNone") + if isinstance(exctype, str): + exctype = self.get_c_object(exctype) + return self.builder.call(fn, (exctype,)) + + def err_write_unraisable(self, obj): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj]) + fn = self._get_function(fnty, name="PyErr_WriteUnraisable") + return self.builder.call(fn, (obj,)) + + def err_fetch(self, pty, pval, ptb): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobjptr] * 3) + fn = self._get_function(fnty, name="PyErr_Fetch") + return self.builder.call(fn, (pty, pval, ptb)) + + def err_restore(self, ty, val, tb): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj] * 3) + fn = self._get_function(fnty, name="PyErr_Restore") + return self.builder.call(fn, (ty, val, tb)) + + @contextlib.contextmanager + def err_push(self, keep_new=False): + """ + Temporarily push the current error indicator while the code + block is executed. If *keep_new* is True and the code block + raises a new error, the new error is kept, otherwise the old + error indicator is restored at the end of the block. + """ + pty, pval, ptb = [cgutils.alloca_once(self.builder, self.pyobj) + for i in range(3)] + self.err_fetch(pty, pval, ptb) + yield + ty = self.builder.load(pty) + val = self.builder.load(pval) + tb = self.builder.load(ptb) + if keep_new: + new_error = cgutils.is_not_null(self.builder, self.err_occurred()) + with self.builder.if_else(new_error, likely=False) as (if_error, if_ok): + with if_error: + # Code block raised an error, keep it + self.decref(ty) + self.decref(val) + self.decref(tb) + with if_ok: + # Restore previous error + self.err_restore(ty, val, tb) + else: + self.err_restore(ty, val, tb) + + def get_c_object(self, name): + """ + Get a Python object through its C-accessible *name* + (e.g. "PyExc_ValueError"). The underlying variable must be + a `PyObject *`, and the value of that pointer is returned. + """ + # A LLVM global variable is implicitly a pointer to the declared + # type, so fix up by using pyobj.pointee. + return self.context.get_c_value(self.builder, self.pyobj.pointee, name, + dllimport=True) + + def raise_missing_global_error(self, name): + msg = "global name '%s' is not defined" % name + cstr = self.context.insert_const_string(self.module, msg) + self.err_set_string("PyExc_NameError", cstr) + + def raise_missing_name_error(self, name): + msg = "name '%s' is not defined" % name + cstr = self.context.insert_const_string(self.module, msg) + self.err_set_string("PyExc_NameError", cstr) + + def fatal_error(self, msg): + fnty = ir.FunctionType(ir.VoidType(), [self.cstring]) + fn = self._get_function(fnty, name="Py_FatalError") + fn.attributes.add("noreturn") + cstr = self.context.insert_const_string(self.module, msg) + self.builder.call(fn, (cstr,)) + + # + # Concrete dict API + # + + def dict_getitem_string(self, dic, name): + """Lookup name inside dict + + Returns a borrowed reference + """ + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.cstring]) + fn = self._get_function(fnty, name="PyDict_GetItemString") + cstr = self.context.insert_const_string(self.module, name) + return self.builder.call(fn, [dic, cstr]) + + def dict_getitem(self, dic, name): + """Lookup name inside dict + + Returns a borrowed reference + """ + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyDict_GetItem") + return self.builder.call(fn, [dic, name]) + + def dict_new(self, presize=0): + if presize == 0: + fnty = ir.FunctionType(self.pyobj, ()) + fn = self._get_function(fnty, name="PyDict_New") + return self.builder.call(fn, ()) + else: + fnty = ir.FunctionType(self.pyobj, [self.py_ssize_t]) + fn = self._get_function(fnty, name="_PyDict_NewPresized") + return self.builder.call(fn, + [Constant(self.py_ssize_t, int(presize))]) + + def dict_setitem(self, dictobj, nameobj, valobj): + fnty = ir.FunctionType(ir.IntType(32), (self.pyobj, self.pyobj, + self.pyobj)) + fn = self._get_function(fnty, name="PyDict_SetItem") + return self.builder.call(fn, (dictobj, nameobj, valobj)) + + def dict_setitem_string(self, dictobj, name, valobj): + fnty = ir.FunctionType(ir.IntType(32), (self.pyobj, self.cstring, + self.pyobj)) + fn = self._get_function(fnty, name="PyDict_SetItemString") + cstr = self.context.insert_const_string(self.module, name) + return self.builder.call(fn, (dictobj, cstr, valobj)) + + def dict_pack(self, keyvalues): + """ + Args + ----- + keyvalues: iterable of (str, llvm.Value of PyObject*) + """ + dictobj = self.dict_new() + with self.if_object_ok(dictobj): + for k, v in keyvalues: + self.dict_setitem_string(dictobj, k, v) + return dictobj + + # + # Concrete number APIs + # + + def float_from_double(self, fval): + fnty = ir.FunctionType(self.pyobj, [self.double]) + fn = self._get_function(fnty, name="PyFloat_FromDouble") + return self.builder.call(fn, [fval]) + + def number_as_ssize_t(self, numobj): + fnty = ir.FunctionType(self.py_ssize_t, [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyNumber_AsSsize_t") + # We don't want any clipping, so pass OverflowError as the 2nd arg + exc_class = self.get_c_object("PyExc_OverflowError") + return self.builder.call(fn, [numobj, exc_class]) + + def number_long(self, numobj): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PyNumber_Long") + return self.builder.call(fn, [numobj]) + + def long_as_ulonglong(self, numobj): + fnty = ir.FunctionType(self.ulonglong, [self.pyobj]) + fn = self._get_function(fnty, name="PyLong_AsUnsignedLongLong") + return self.builder.call(fn, [numobj]) + + def long_as_longlong(self, numobj): + fnty = ir.FunctionType(self.ulonglong, [self.pyobj]) + fn = self._get_function(fnty, name="PyLong_AsLongLong") + return self.builder.call(fn, [numobj]) + + def long_as_voidptr(self, numobj): + """ + Convert the given Python integer to a void*. This is recommended + over number_as_ssize_t as it isn't affected by signedness. + """ + fnty = ir.FunctionType(self.voidptr, [self.pyobj]) + fn = self._get_function(fnty, name="PyLong_AsVoidPtr") + return self.builder.call(fn, [numobj]) + + def _long_from_native_int(self, ival, func_name, native_int_type, + signed): + fnty = ir.FunctionType(self.pyobj, [native_int_type]) + fn = self._get_function(fnty, name=func_name) + resptr = cgutils.alloca_once(self.builder, self.pyobj) + fn = self._get_function(fnty, name=func_name) + self.builder.store(self.builder.call(fn, [ival]), resptr) + + return self.builder.load(resptr) + + def long_from_long(self, ival): + func_name = "PyLong_FromLong" + fnty = ir.FunctionType(self.pyobj, [self.long]) + fn = self._get_function(fnty, name=func_name) + return self.builder.call(fn, [ival]) + + def long_from_ulong(self, ival): + return self._long_from_native_int(ival, "PyLong_FromUnsignedLong", + self.long, signed=False) + + def long_from_ssize_t(self, ival): + return self._long_from_native_int(ival, "PyLong_FromSsize_t", + self.py_ssize_t, signed=True) + + def long_from_longlong(self, ival): + return self._long_from_native_int(ival, "PyLong_FromLongLong", + self.longlong, signed=True) + + def long_from_ulonglong(self, ival): + return self._long_from_native_int(ival, "PyLong_FromUnsignedLongLong", + self.ulonglong, signed=False) + + def long_from_signed_int(self, ival): + """ + Return a Python integer from any native integer value. + """ + bits = ival.type.width + if bits <= self.long.width: + return self.long_from_long(self.builder.sext(ival, self.long)) + elif bits <= self.longlong.width: + return self.long_from_longlong(self.builder.sext(ival, self.longlong)) + else: + raise OverflowError("integer too big (%d bits)" % (bits)) + + def long_from_unsigned_int(self, ival): + """ + Same as long_from_signed_int, but for unsigned values. + """ + bits = ival.type.width + if bits <= self.ulong.width: + return self.long_from_ulong(self.builder.zext(ival, self.ulong)) + elif bits <= self.ulonglong.width: + return self.long_from_ulonglong(self.builder.zext(ival, self.ulonglong)) + else: + raise OverflowError("integer too big (%d bits)" % (bits)) + + def _get_number_operator(self, name): + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyNumber_%s" % name) + return fn + + def _call_number_operator(self, name, lhs, rhs, inplace=False): + if inplace: + name = "InPlace" + name + fn = self._get_number_operator(name) + return self.builder.call(fn, [lhs, rhs]) + + def number_add(self, lhs, rhs, inplace=False): + return self._call_number_operator("Add", lhs, rhs, inplace=inplace) + + def number_subtract(self, lhs, rhs, inplace=False): + return self._call_number_operator("Subtract", lhs, rhs, inplace=inplace) + + def number_multiply(self, lhs, rhs, inplace=False): + return self._call_number_operator("Multiply", lhs, rhs, inplace=inplace) + + def number_truedivide(self, lhs, rhs, inplace=False): + return self._call_number_operator("TrueDivide", lhs, rhs, inplace=inplace) + + def number_floordivide(self, lhs, rhs, inplace=False): + return self._call_number_operator("FloorDivide", lhs, rhs, inplace=inplace) + + def number_remainder(self, lhs, rhs, inplace=False): + return self._call_number_operator("Remainder", lhs, rhs, inplace=inplace) + + def number_matrix_multiply(self, lhs, rhs, inplace=False): + return self._call_number_operator("MatrixMultiply", lhs, rhs, inplace=inplace) + + def number_lshift(self, lhs, rhs, inplace=False): + return self._call_number_operator("Lshift", lhs, rhs, inplace=inplace) + + def number_rshift(self, lhs, rhs, inplace=False): + return self._call_number_operator("Rshift", lhs, rhs, inplace=inplace) + + def number_and(self, lhs, rhs, inplace=False): + return self._call_number_operator("And", lhs, rhs, inplace=inplace) + + def number_or(self, lhs, rhs, inplace=False): + return self._call_number_operator("Or", lhs, rhs, inplace=inplace) + + def number_xor(self, lhs, rhs, inplace=False): + return self._call_number_operator("Xor", lhs, rhs, inplace=inplace) + + def number_power(self, lhs, rhs, inplace=False): + fnty = ir.FunctionType(self.pyobj, [self.pyobj] * 3) + fname = "PyNumber_InPlacePower" if inplace else "PyNumber_Power" + fn = self._get_function(fnty, fname) + return self.builder.call(fn, [lhs, rhs, self.borrow_none()]) + + def number_negative(self, obj): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PyNumber_Negative") + return self.builder.call(fn, (obj,)) + + def number_positive(self, obj): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PyNumber_Positive") + return self.builder.call(fn, (obj,)) + + def number_float(self, val): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PyNumber_Float") + return self.builder.call(fn, [val]) + + def number_invert(self, obj): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PyNumber_Invert") + return self.builder.call(fn, (obj,)) + + def float_as_double(self, fobj): + fnty = ir.FunctionType(self.double, [self.pyobj]) + fn = self._get_function(fnty, name="PyFloat_AsDouble") + return self.builder.call(fn, [fobj]) + + def bool_from_bool(self, bval): + """ + Get a Python bool from a LLVM boolean. + """ + longval = self.builder.zext(bval, self.long) + return self.bool_from_long(longval) + + def bool_from_long(self, ival): + fnty = ir.FunctionType(self.pyobj, [self.long]) + fn = self._get_function(fnty, name="PyBool_FromLong") + return self.builder.call(fn, [ival]) + + def complex_from_doubles(self, realval, imagval): + fnty = ir.FunctionType(self.pyobj, [ir.DoubleType(), ir.DoubleType()]) + fn = self._get_function(fnty, name="PyComplex_FromDoubles") + return self.builder.call(fn, [realval, imagval]) + + def complex_real_as_double(self, cobj): + fnty = ir.FunctionType(ir.DoubleType(), [self.pyobj]) + fn = self._get_function(fnty, name="PyComplex_RealAsDouble") + return self.builder.call(fn, [cobj]) + + def complex_imag_as_double(self, cobj): + fnty = ir.FunctionType(ir.DoubleType(), [self.pyobj]) + fn = self._get_function(fnty, name="PyComplex_ImagAsDouble") + return self.builder.call(fn, [cobj]) + + # + # Concrete slice API + # + def slice_as_ints(self, obj): + """ + Read the members of a slice of integers. + + Returns a (ok, start, stop, step) tuple where ok is a boolean and + the following members are pointer-sized ints. + """ + pstart = cgutils.alloca_once(self.builder, self.py_ssize_t) + pstop = cgutils.alloca_once(self.builder, self.py_ssize_t) + pstep = cgutils.alloca_once(self.builder, self.py_ssize_t) + fnty = ir.FunctionType(ir.IntType(32), + [self.pyobj] + [self.py_ssize_t.as_pointer()] * 3) + fn = self._get_function(fnty, name="numba_unpack_slice") + res = self.builder.call(fn, (obj, pstart, pstop, pstep)) + start = self.builder.load(pstart) + stop = self.builder.load(pstop) + step = self.builder.load(pstep) + return cgutils.is_null(self.builder, res), start, stop, step + + # + # List and sequence APIs + # + + def sequence_getslice(self, obj, start, stop): + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.py_ssize_t, + self.py_ssize_t]) + fn = self._get_function(fnty, name="PySequence_GetSlice") + return self.builder.call(fn, (obj, start, stop)) + + def sequence_tuple(self, obj): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PySequence_Tuple") + return self.builder.call(fn, [obj]) + + def sequence_concat(self, obj1, obj2): + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PySequence_Concat") + return self.builder.call(fn, [obj1, obj2]) + + def list_new(self, szval): + fnty = ir.FunctionType(self.pyobj, [self.py_ssize_t]) + fn = self._get_function(fnty, name="PyList_New") + return self.builder.call(fn, [szval]) + + def list_size(self, lst): + fnty = ir.FunctionType(self.py_ssize_t, [self.pyobj]) + fn = self._get_function(fnty, name="PyList_Size") + return self.builder.call(fn, [lst]) + + def list_append(self, lst, val): + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyList_Append") + return self.builder.call(fn, [lst, val]) + + def list_setitem(self, lst, idx, val): + """ + Warning: Steals reference to ``val`` + """ + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.py_ssize_t, + self.pyobj]) + fn = self._get_function(fnty, name="PyList_SetItem") + return self.builder.call(fn, [lst, idx, val]) + + def list_getitem(self, lst, idx): + """ + Returns a borrowed reference. + """ + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.py_ssize_t]) + fn = self._get_function(fnty, name="PyList_GetItem") + if isinstance(idx, int): + idx = self.context.get_constant(types.intp, idx) + return self.builder.call(fn, [lst, idx]) + + def list_setslice(self, lst, start, stop, obj): + if obj is None: + obj = self.get_null_object() + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.py_ssize_t, + self.py_ssize_t, self.pyobj]) + fn = self._get_function(fnty, name="PyList_SetSlice") + return self.builder.call(fn, (lst, start, stop, obj)) + + + # + # Concrete tuple API + # + + def tuple_getitem(self, tup, idx): + """ + Borrow reference + """ + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.py_ssize_t]) + fn = self._get_function(fnty, name="PyTuple_GetItem") + idx = self.context.get_constant(types.intp, idx) + return self.builder.call(fn, [tup, idx]) + + def tuple_pack(self, items): + fnty = ir.FunctionType(self.pyobj, [self.py_ssize_t], var_arg=True) + fn = self._get_function(fnty, name="PyTuple_Pack") + n = self.context.get_constant(types.intp, len(items)) + args = [n] + args.extend(items) + return self.builder.call(fn, args) + + def tuple_size(self, tup): + fnty = ir.FunctionType(self.py_ssize_t, [self.pyobj]) + fn = self._get_function(fnty, name="PyTuple_Size") + return self.builder.call(fn, [tup]) + + def tuple_new(self, count): + fnty = ir.FunctionType(self.pyobj, [self.py_ssize_t]) + fn = self._get_function(fnty, name='PyTuple_New') + return self.builder.call(fn, [self.py_ssize_t(count)]) + + def tuple_setitem(self, tuple_val, index, item): + """ + Steals a reference to `item`. + """ + fnty = ir.FunctionType(ir.IntType(32), + [self.pyobj, self.py_ssize_t, self.pyobj]) + setitem_fn = self._get_function(fnty, name='PyTuple_SetItem') + index = self.py_ssize_t(index) + self.builder.call(setitem_fn, [tuple_val, index, item]) + + # + # Concrete set API + # + + def set_new(self, iterable=None): + if iterable is None: + iterable = self.get_null_object() + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PySet_New") + return self.builder.call(fn, [iterable]) + + def set_add(self, set, value): + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PySet_Add") + return self.builder.call(fn, [set, value]) + + def set_clear(self, set): + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj]) + fn = self._get_function(fnty, name="PySet_Clear") + return self.builder.call(fn, [set]) + + def set_size(self, set): + fnty = ir.FunctionType(self.py_ssize_t, [self.pyobj]) + fn = self._get_function(fnty, name="PySet_Size") + return self.builder.call(fn, [set]) + + def set_update(self, set, iterable): + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="_PySet_Update") + return self.builder.call(fn, [set, iterable]) + + def set_next_entry(self, set, posptr, keyptr, hashptr): + fnty = ir.FunctionType(ir.IntType(32), + [self.pyobj, self.py_ssize_t.as_pointer(), + self.pyobj.as_pointer(), self.py_hash_t.as_pointer()]) + fn = self._get_function(fnty, name="_PySet_NextEntry") + return self.builder.call(fn, (set, posptr, keyptr, hashptr)) + + @contextlib.contextmanager + def set_iterate(self, set): + builder = self.builder + + hashptr = cgutils.alloca_once(builder, self.py_hash_t, name="hashptr") + keyptr = cgutils.alloca_once(builder, self.pyobj, name="keyptr") + posptr = cgutils.alloca_once_value(builder, + Constant(self.py_ssize_t, 0), + name="posptr") + + bb_body = builder.append_basic_block("bb_body") + bb_end = builder.append_basic_block("bb_end") + + builder.branch(bb_body) + def do_break(): + builder.branch(bb_end) + + with builder.goto_block(bb_body): + r = self.set_next_entry(set, posptr, keyptr, hashptr) + finished = cgutils.is_null(builder, r) + with builder.if_then(finished, likely=False): + builder.branch(bb_end) + yield _IteratorLoop(builder.load(keyptr), do_break) + builder.branch(bb_body) + + builder.position_at_end(bb_end) + + # + # GIL APIs + # + + def gil_ensure(self): + """ + Ensure the GIL is acquired. + The returned value must be consumed by gil_release(). + """ + gilptrty = ir.PointerType(self.gil_state) + fnty = ir.FunctionType(ir.VoidType(), [gilptrty]) + fn = self._get_function(fnty, "numba_gil_ensure") + gilptr = cgutils.alloca_once(self.builder, self.gil_state) + self.builder.call(fn, [gilptr]) + return gilptr + + def gil_release(self, gil): + """ + Release the acquired GIL by gil_ensure(). + Must be paired with a gil_ensure(). + """ + gilptrty = ir.PointerType(self.gil_state) + fnty = ir.FunctionType(ir.VoidType(), [gilptrty]) + fn = self._get_function(fnty, "numba_gil_release") + return self.builder.call(fn, [gil]) + + def save_thread(self): + """ + Release the GIL and return the former thread state + (an opaque non-NULL pointer). + """ + fnty = ir.FunctionType(self.voidptr, []) + fn = self._get_function(fnty, name="PyEval_SaveThread") + return self.builder.call(fn, []) + + def restore_thread(self, thread_state): + """ + Restore the given thread state by reacquiring the GIL. + """ + fnty = ir.FunctionType(ir.VoidType(), [self.voidptr]) + fn = self._get_function(fnty, name="PyEval_RestoreThread") + self.builder.call(fn, [thread_state]) + + # + # Generic object private data (a way of associating an arbitrary void * + # pointer to an arbitrary Python object). + # + + def object_get_private_data(self, obj): + fnty = ir.FunctionType(self.voidptr, [self.pyobj]) + fn = self._get_function(fnty, name="numba_get_pyobject_private_data") + return self.builder.call(fn, (obj,)) + + def object_set_private_data(self, obj, ptr): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj, self.voidptr]) + fn = self._get_function(fnty, name="numba_set_pyobject_private_data") + return self.builder.call(fn, (obj, ptr)) + + def object_reset_private_data(self, obj): + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj]) + fn = self._get_function(fnty, name="numba_reset_pyobject_private_data") + return self.builder.call(fn, (obj,)) + + + # + # Other APIs (organize them better!) + # + + def import_module(self, modname): + fnty = ir.FunctionType(self.pyobj, [self.cstring]) + fn = self._get_function(fnty, name="PyImport_ImportModule") + return self.builder.call(fn, [modname]) + + def call_function_objargs(self, callee, objargs): + fnty = ir.FunctionType(self.pyobj, [self.pyobj], var_arg=True) + fn = self._get_function(fnty, name="PyObject_CallFunctionObjArgs") + args = [callee] + list(objargs) + args.append(self.context.get_constant_null(types.pyobject)) + return self.builder.call(fn, args) + + def call_method(self, callee, method, objargs=()): + cname = self.context.insert_const_string(self.module, method) + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.cstring, self.cstring], + var_arg=True) + fn = self._get_function(fnty, name="PyObject_CallMethod") + fmt = 'O' * len(objargs) + cfmt = self.context.insert_const_string(self.module, fmt) + args = [callee, cname, cfmt] + if objargs: + args.extend(objargs) + args.append(self.context.get_constant_null(types.pyobject)) + return self.builder.call(fn, args) + + def call(self, callee, args=None, kws=None): + if args_was_none := args is None: + args = self.tuple_new(0) + if kws is None: + kws = self.get_null_object() + fnty = ir.FunctionType(self.pyobj, [self.pyobj] * 3) + fn = self._get_function(fnty, name="PyObject_Call") + result = self.builder.call(fn, (callee, args, kws)) + if args_was_none: + self.decref(args) + return result + + def object_type(self, obj): + """Emit a call to ``PyObject_Type(obj)`` to get the type of ``obj``. + """ + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PyObject_Type") + return self.builder.call(fn, (obj,)) + + def object_istrue(self, obj): + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj]) + fn = self._get_function(fnty, name="PyObject_IsTrue") + return self.builder.call(fn, [obj]) + + def object_not(self, obj): + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj]) + fn = self._get_function(fnty, name="PyObject_Not") + return self.builder.call(fn, [obj]) + + def object_richcompare(self, lhs, rhs, opstr): + """ + Refer to Python source Include/object.h for macros definition + of the opid. + """ + ops = ['<', '<=', '==', '!=', '>', '>='] + if opstr in ops: + opid = ops.index(opstr) + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.pyobj, ir.IntType(32)]) + fn = self._get_function(fnty, name="PyObject_RichCompare") + lopid = self.context.get_constant(types.int32, opid) + return self.builder.call(fn, (lhs, rhs, lopid)) + elif opstr == 'is': + bitflag = self.builder.icmp_unsigned('==', lhs, rhs) + return self.bool_from_bool(bitflag) + elif opstr == 'is not': + bitflag = self.builder.icmp_unsigned('!=', lhs, rhs) + return self.bool_from_bool(bitflag) + elif opstr in ('in', 'not in'): + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PySequence_Contains") + status = self.builder.call(fn, (rhs, lhs)) + negone = self.context.get_constant(types.int32, -1) + is_good = self.builder.icmp_unsigned('!=', status, negone) + # Stack allocate output and initialize to Null + outptr = cgutils.alloca_once_value(self.builder, + Constant(self.pyobj, None)) + # If PySequence_Contains returns non-error value + with cgutils.if_likely(self.builder, is_good): + if opstr == 'not in': + status = self.builder.not_(status) + # Store the status as a boolean object + truncated = self.builder.trunc(status, ir.IntType(1)) + self.builder.store(self.bool_from_bool(truncated), + outptr) + + return self.builder.load(outptr) + else: + raise NotImplementedError("Unknown operator {op!r}".format( + op=opstr)) + + def iter_next(self, iterobj): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PyIter_Next") + return self.builder.call(fn, [iterobj]) + + def object_getiter(self, obj): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PyObject_GetIter") + return self.builder.call(fn, [obj]) + + def object_getattr_string(self, obj, attr): + cstr = self.context.insert_const_string(self.module, attr) + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.cstring]) + fn = self._get_function(fnty, name="PyObject_GetAttrString") + return self.builder.call(fn, [obj, cstr]) + + def object_getattr(self, obj, attr): + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyObject_GetAttr") + return self.builder.call(fn, [obj, attr]) + + def object_setattr_string(self, obj, attr, val): + cstr = self.context.insert_const_string(self.module, attr) + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.cstring, self.pyobj]) + fn = self._get_function(fnty, name="PyObject_SetAttrString") + return self.builder.call(fn, [obj, cstr, val]) + + def object_setattr(self, obj, attr, val): + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyObject_SetAttr") + return self.builder.call(fn, [obj, attr, val]) + + def object_delattr_string(self, obj, attr): + # PyObject_DelAttrString() is actually a C macro calling + # PyObject_SetAttrString() with value == NULL. + return self.object_setattr_string(obj, attr, self.get_null_object()) + + def object_delattr(self, obj, attr): + # PyObject_DelAttr() is actually a C macro calling + # PyObject_SetAttr() with value == NULL. + return self.object_setattr(obj, attr, self.get_null_object()) + + def object_getitem(self, obj, key): + """ + Return obj[key] + """ + fnty = ir.FunctionType(self.pyobj, [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyObject_GetItem") + return self.builder.call(fn, (obj, key)) + + def object_setitem(self, obj, key, val): + """ + obj[key] = val + """ + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyObject_SetItem") + return self.builder.call(fn, (obj, key, val)) + + def object_delitem(self, obj, key): + """ + del obj[key] + """ + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.pyobj]) + fn = self._get_function(fnty, name="PyObject_DelItem") + return self.builder.call(fn, (obj, key)) + + def string_as_string(self, strobj): + fnty = ir.FunctionType(self.cstring, [self.pyobj]) + fname = "PyUnicode_AsUTF8" + fn = self._get_function(fnty, name=fname) + return self.builder.call(fn, [strobj]) + + def string_as_string_and_size(self, strobj): + """ + Returns a tuple of ``(ok, buffer, length)``. + The ``ok`` is i1 value that is set if ok. + The ``buffer`` is a i8* of the output buffer. + The ``length`` is a i32/i64 (py_ssize_t) of the length of the buffer. + """ + + p_length = cgutils.alloca_once(self.builder, self.py_ssize_t) + fnty = ir.FunctionType(self.cstring, [self.pyobj, + self.py_ssize_t.as_pointer()]) + fname = "PyUnicode_AsUTF8AndSize" + fn = self._get_function(fnty, name=fname) + + buffer = self.builder.call(fn, [strobj, p_length]) + ok = self.builder.icmp_unsigned('!=', + Constant(buffer.type, None), + buffer) + return (ok, buffer, self.builder.load(p_length)) + + def string_as_string_size_and_kind(self, strobj): + """ + Returns a tuple of ``(ok, buffer, length, kind)``. + The ``ok`` is i1 value that is set if ok. + The ``buffer`` is a i8* of the output buffer. + The ``length`` is a i32/i64 (py_ssize_t) of the length of the buffer. + The ``kind`` is a i32 (int32) of the Unicode kind constant + The ``hash`` is a long/uint64_t (py_hash_t) of the Unicode constant hash + """ + p_length = cgutils.alloca_once(self.builder, self.py_ssize_t) + p_kind = cgutils.alloca_once(self.builder, ir.IntType(32)) + p_ascii = cgutils.alloca_once(self.builder, ir.IntType(32)) + p_hash = cgutils.alloca_once(self.builder, self.py_hash_t) + fnty = ir.FunctionType(self.cstring, [self.pyobj, + self.py_ssize_t.as_pointer(), + ir.IntType(32).as_pointer(), + ir.IntType(32).as_pointer(), + self.py_hash_t.as_pointer()]) + fname = "numba_extract_unicode" + fn = self._get_function(fnty, name=fname) + + buffer = self.builder.call( + fn, [strobj, p_length, p_kind, p_ascii, p_hash]) + ok = self.builder.icmp_unsigned('!=', + Constant(buffer.type, None), + buffer) + return (ok, buffer, self.builder.load(p_length), + self.builder.load(p_kind), self.builder.load(p_ascii), + self.builder.load(p_hash)) + + def string_from_string_and_size(self, string, size): + fnty = ir.FunctionType(self.pyobj, [self.cstring, self.py_ssize_t]) + fname = "PyString_FromStringAndSize" + fn = self._get_function(fnty, name=fname) + return self.builder.call(fn, [string, size]) + + def string_from_string(self, string): + fnty = ir.FunctionType(self.pyobj, [self.cstring]) + fname = "PyUnicode_FromString" + fn = self._get_function(fnty, name=fname) + return self.builder.call(fn, [string]) + + def string_from_kind_and_data(self, kind, string, size): + fnty = ir.FunctionType(self.pyobj, [ir.IntType(32), self.cstring, self.py_ssize_t]) + fname = "PyUnicode_FromKindAndData" + fn = self._get_function(fnty, name=fname) + return self.builder.call(fn, [kind, string, size]) + + def bytes_as_string(self, obj): + fnty = ir.FunctionType(self.cstring, [self.pyobj]) + fname = "PyBytes_AsString" + fn = self._get_function(fnty, name=fname) + return self.builder.call(fn, [obj]) + + def bytes_as_string_and_size(self, obj, p_buffer, p_length): + fnty = ir.FunctionType( + ir.IntType(32), + [self.pyobj, self.cstring.as_pointer(), self.py_ssize_t.as_pointer()], + ) + fname = "PyBytes_AsStringAndSize" + fn = self._get_function(fnty, name=fname) + result = self.builder.call(fn, [obj, p_buffer, p_length]) + ok = self.builder.icmp_signed("!=", Constant(result.type, -1), result) + return ok + + def bytes_from_string_and_size(self, string, size): + fnty = ir.FunctionType(self.pyobj, [self.cstring, self.py_ssize_t]) + fname = "PyBytes_FromStringAndSize" + fn = self._get_function(fnty, name=fname) + return self.builder.call(fn, [string, size]) + + def object_hash(self, obj): + fnty = ir.FunctionType(self.py_hash_t, [self.pyobj, ]) + fname = "PyObject_Hash" + fn = self._get_function(fnty, name=fname) + return self.builder.call(fn, [obj,]) + + def object_str(self, obj): + fnty = ir.FunctionType(self.pyobj, [self.pyobj]) + fn = self._get_function(fnty, name="PyObject_Str") + return self.builder.call(fn, [obj]) + + def make_none(self): + obj = self.borrow_none() + self.incref(obj) + return obj + + def borrow_none(self): + return self.get_c_object("_Py_NoneStruct") + + def sys_write_stdout(self, fmt, *args): + fnty = ir.FunctionType(ir.VoidType(), [self.cstring], var_arg=True) + fn = self._get_function(fnty, name="PySys_FormatStdout") + return self.builder.call(fn, (fmt,) + args) + + def object_dump(self, obj): + """ + Dump a Python object on C stderr. For debugging purposes. + """ + fnty = ir.FunctionType(ir.VoidType(), [self.pyobj]) + fn = self._get_function(fnty, name="_PyObject_Dump") + return self.builder.call(fn, (obj,)) + + # + # NRT (Numba runtime) APIs + # + + def nrt_adapt_ndarray_to_python(self, aryty, ary, dtypeptr): + assert self.context.enable_nrt, "NRT required" + + intty = ir.IntType(32) + # Embed the Python type of the array (maybe subclass) in the LLVM IR. + serial_aryty_pytype = self.unserialize(self.serialize_object(aryty.box_type)) + + fnty = ir.FunctionType(self.pyobj, + [self.voidptr, self.pyobj, intty, intty, self.pyobj]) + fn = self._get_function(fnty, name="NRT_adapt_ndarray_to_python_acqref") + fn.args[0].add_attribute('nocapture') + + ndim = self.context.get_constant(types.int32, aryty.ndim) + writable = self.context.get_constant(types.int32, int(aryty.mutable)) + + aryptr = cgutils.alloca_once_value(self.builder, ary) + return self.builder.call(fn, [self.builder.bitcast(aryptr, + self.voidptr), + serial_aryty_pytype, + ndim, writable, dtypeptr]) + + def nrt_meminfo_new_from_pyobject(self, data, pyobj): + """ + Allocate a new MemInfo with data payload borrowed from a python + object. + """ + mod = self.builder.module + fnty = ir.FunctionType( + cgutils.voidptr_t, + [cgutils.voidptr_t, cgutils.voidptr_t], + ) + fn = cgutils.get_or_insert_function( + mod, + fnty, + "NRT_meminfo_new_from_pyobject", + ) + fn.args[0].add_attribute('nocapture') + fn.args[1].add_attribute('nocapture') + fn.return_value.add_attribute("noalias") + return self.builder.call(fn, [data, pyobj]) + + def nrt_meminfo_as_pyobject(self, miptr): + mod = self.builder.module + fnty = ir.FunctionType( + self.pyobj, + [cgutils.voidptr_t] + ) + fn = cgutils.get_or_insert_function( + mod, + fnty, + 'NRT_meminfo_as_pyobject', + ) + fn.return_value.add_attribute("noalias") + return self.builder.call(fn, [miptr]) + + def nrt_meminfo_from_pyobject(self, miobj): + mod = self.builder.module + fnty = ir.FunctionType( + cgutils.voidptr_t, + [self.pyobj] + ) + fn = cgutils.get_or_insert_function( + mod, + fnty, + 'NRT_meminfo_from_pyobject', + ) + fn.return_value.add_attribute("noalias") + return self.builder.call(fn, [miobj]) + + def nrt_adapt_ndarray_from_python(self, ary, ptr): + assert self.context.enable_nrt + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.voidptr]) + fn = self._get_function(fnty, name="NRT_adapt_ndarray_from_python") + fn.args[0].add_attribute('nocapture') + fn.args[1].add_attribute('nocapture') + return self.builder.call(fn, (ary, ptr)) + + def nrt_adapt_buffer_from_python(self, buf, ptr): + assert self.context.enable_nrt + fnty = ir.FunctionType(ir.VoidType(), [ir.PointerType(self.py_buffer_t), + self.voidptr]) + fn = self._get_function(fnty, name="NRT_adapt_buffer_from_python") + fn.args[0].add_attribute('nocapture') + fn.args[1].add_attribute('nocapture') + return self.builder.call(fn, (buf, ptr)) + + # ------ utils ----- + + def _get_function(self, fnty, name): + return cgutils.get_or_insert_function(self.module, fnty, name) + + def alloca_obj(self): + return self.builder.alloca(self.pyobj) + + def alloca_buffer(self): + """ + Return a pointer to a stack-allocated, zero-initialized Py_buffer. + """ + # Treat the buffer as an opaque array of bytes + ptr = cgutils.alloca_once_value(self.builder, + Constant(self.py_buffer_t, None)) + return ptr + + @contextlib.contextmanager + def if_object_ok(self, obj): + with cgutils.if_likely(self.builder, + cgutils.is_not_null(self.builder, obj)): + yield + + def print_object(self, obj): + strobj = self.object_str(obj) + cstr = self.string_as_string(strobj) + fmt = self.context.insert_const_string(self.module, "%s") + self.sys_write_stdout(fmt, cstr) + self.decref(strobj) + + def print_string(self, text): + fmt = self.context.insert_const_string(self.module, text) + self.sys_write_stdout(fmt) + + def get_null_object(self): + return Constant(self.pyobj, None) + + def return_none(self): + none = self.make_none() + self.builder.ret(none) + + def list_pack(self, items): + n = len(items) + seq = self.list_new(self.context.get_constant(types.intp, n)) + with self.if_object_ok(seq): + for i in range(n): + idx = self.context.get_constant(types.intp, i) + self.incref(items[i]) + self.list_setitem(seq, idx, items[i]) + return seq + + def unserialize(self, structptr): + """ + Unserialize some data. *structptr* should be a pointer to + a {i8* data, i32 length, i8* hashbuf, i8* func_ptr, i32 alloc_flag} + structure. + """ + fnty = ir.FunctionType(self.pyobj, + (self.voidptr, ir.IntType(32), self.voidptr)) + fn = self._get_function(fnty, name="numba_unpickle") + ptr = self.builder.extract_value(self.builder.load(structptr), 0) + n = self.builder.extract_value(self.builder.load(structptr), 1) + hashed = self.builder.extract_value(self.builder.load(structptr), 2) + return self.builder.call(fn, (ptr, n, hashed)) + + def build_dynamic_excinfo_struct(self, struct_gv, exc_args): + """ + Serialize some data at runtime. Returns a pointer to a python tuple + (bytes_data, hash) where the first element is the serialized data as + bytes and the second its hash. + """ + fnty = ir.FunctionType(self.pyobj, (self.pyobj, self.pyobj)) + fn = self._get_function(fnty, name="numba_runtime_build_excinfo_struct") + return self.builder.call(fn, (struct_gv, exc_args)) + + def serialize_uncached(self, obj): + """ + Same as serialize_object(), but don't create a global variable, + simply return a literal for structure: + {i8* data, i32 length, i8* hashbuf, i8* func_ptr, i32 alloc_flag} + """ + # First make the array constant + data = serialize.dumps(obj) + assert len(data) < 2**31 + name = ".const.pickledata.%s" % (id(obj) if config.DIFF_IR == 0 else "DIFF_IR") + bdata = cgutils.make_bytearray(data) + # Make SHA1 hash on the pickled content + # NOTE: update buffer size in numba_unpickle() when changing the + # hash algorithm. + hashed = cgutils.make_bytearray(hashlib.sha1(data).digest()) + arr = self.context.insert_unique_const(self.module, name, bdata) + hasharr = self.context.insert_unique_const( + self.module, f"{name}.sha1", hashed, + ) + # Then populate the structure constant + struct = Constant.literal_struct([ + arr.bitcast(self.voidptr), + Constant(ir.IntType(32), arr.type.pointee.count), + hasharr.bitcast(self.voidptr), + cgutils.get_null_value(self.voidptr), + Constant(ir.IntType(32), 0), + ]) + return struct + + def serialize_object(self, obj): + """ + Serialize the given object in the bitcode, and return it + as a pointer to a + {i8* data, i32 length, i8* hashbuf, i8* fn_ptr, i32 alloc_flag}, + structure constant (suitable for passing to unserialize()). + """ + try: + gv = self.module.__serialized[obj] + except KeyError: + struct = self.serialize_uncached(obj) + name = ".const.picklebuf.%s" % (id(obj) if config.DIFF_IR == 0 else "DIFF_IR") + gv = self.context.insert_unique_const(self.module, name, struct) + # Make the id() (and hence the name) unique while populating the module. + self.module.__serialized[obj] = gv + return gv + + def c_api_error(self): + return cgutils.is_not_null(self.builder, self.err_occurred()) + + def to_native_value(self, typ, obj): + """ + Unbox the Python object as the given Numba type. + A NativeValue instance is returned. + """ + from numba.core.boxing import unbox_unsupported + + impl = _unboxers.lookup(typ.__class__, unbox_unsupported) + c = _UnboxContext(self.context, self.builder, self) + return impl(typ, obj, c) + + def from_native_return(self, typ, val, env_manager): + assert not isinstance(typ, types.Optional), "callconv should have " \ + "prevented the return of " \ + "optional value" + out = self.from_native_value(typ, val, env_manager) + return out + + def from_native_value(self, typ, val, env_manager=None): + """ + Box the native value of the given Numba type. A Python object + pointer is returned (NULL if an error occurred). + This method steals any native (NRT) reference embedded in *val*. + """ + from numba.core.boxing import box_unsupported + + impl = _boxers.lookup(typ.__class__, box_unsupported) + + c = _BoxContext(self.context, self.builder, self, env_manager) + return impl(typ, val, c) + + def reflect_native_value(self, typ, val, env_manager=None): + """ + Reflect the native value onto its Python original, if any. + An error bit (as an LLVM value) is returned. + """ + impl = _reflectors.lookup(typ.__class__) + if impl is None: + # Reflection isn't needed for most types + return cgutils.false_bit + + is_error = cgutils.alloca_once_value(self.builder, cgutils.false_bit) + c = _ReflectContext(self.context, self.builder, self, env_manager, + is_error) + impl(typ, val, c) + return self.builder.load(c.is_error) + + def to_native_generator(self, obj, typ): + """ + Extract the generator structure pointer from a generator *obj* + (a _dynfunc.Generator instance). + """ + gen_ptr_ty = ir.PointerType(self.context.get_data_type(typ)) + value = self.context.get_generator_state(self.builder, obj, gen_ptr_ty) + return NativeValue(value) + + def from_native_generator(self, val, typ, env=None): + """ + Make a Numba generator (a _dynfunc.Generator instance) from a + generator structure pointer *val*. + *env* is an optional _dynfunc.Environment instance to be wrapped + in the generator. + """ + llty = self.context.get_data_type(typ) + assert not llty.is_pointer + gen_struct_size = self.context.get_abi_sizeof(llty) + + gendesc = self.context.get_generator_desc(typ) + + # This is the PyCFunctionWithKeywords generated by PyCallWrapper + genfnty = ir.FunctionType(self.pyobj, [self.pyobj, self.pyobj, self.pyobj]) + genfn = self._get_function(genfnty, name=gendesc.llvm_cpython_wrapper_name) + + # This is the raw finalizer generated by _lower_generator_finalize_func() + finalizerty = ir.FunctionType(ir.VoidType(), [self.voidptr]) + if typ.has_finalizer: + finalizer = self._get_function(finalizerty, name=gendesc.llvm_finalizer_name) + else: + finalizer = Constant(ir.PointerType(finalizerty), None) + + # PyObject *numba_make_generator(state_size, initial_state, nextfunc, finalizer, env) + fnty = ir.FunctionType(self.pyobj, [self.py_ssize_t, + self.voidptr, + ir.PointerType(genfnty), + ir.PointerType(finalizerty), + self.voidptr]) + fn = self._get_function(fnty, name="numba_make_generator") + + state_size = Constant(self.py_ssize_t, gen_struct_size) + initial_state = self.builder.bitcast(val, self.voidptr) + if env is None: + env = self.get_null_object() + env = self.builder.bitcast(env, self.voidptr) + + return self.builder.call(fn, + (state_size, initial_state, genfn, finalizer, env)) + + def numba_array_adaptor(self, ary, ptr): + assert not self.context.enable_nrt + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, self.voidptr]) + fn = self._get_function(fnty, name="numba_adapt_ndarray") + fn.args[0].add_attribute('nocapture') + fn.args[1].add_attribute('nocapture') + return self.builder.call(fn, (ary, ptr)) + + def numba_buffer_adaptor(self, buf, ptr): + fnty = ir.FunctionType(ir.VoidType(), + [ir.PointerType(self.py_buffer_t), self.voidptr]) + fn = self._get_function(fnty, name="numba_adapt_buffer") + fn.args[0].add_attribute('nocapture') + fn.args[1].add_attribute('nocapture') + return self.builder.call(fn, (buf, ptr)) + + def complex_adaptor(self, cobj, cmplx): + fnty = ir.FunctionType(ir.IntType(32), [self.pyobj, cmplx.type]) + fn = self._get_function(fnty, name="numba_complex_adaptor") + return self.builder.call(fn, [cobj, cmplx]) + + def extract_record_data(self, obj, pbuf): + fnty = ir.FunctionType(self.voidptr, + [self.pyobj, ir.PointerType(self.py_buffer_t)]) + fn = self._get_function(fnty, name="numba_extract_record_data") + return self.builder.call(fn, [obj, pbuf]) + + def get_buffer(self, obj, pbuf): + fnty = ir.FunctionType(ir.IntType(32), + [self.pyobj, ir.PointerType(self.py_buffer_t)]) + fn = self._get_function(fnty, name="numba_get_buffer") + return self.builder.call(fn, [obj, pbuf]) + + def release_buffer(self, pbuf): + fnty = ir.FunctionType(ir.VoidType(), [ir.PointerType(self.py_buffer_t)]) + fn = self._get_function(fnty, name="numba_release_buffer") + return self.builder.call(fn, [pbuf]) + + def extract_np_datetime(self, obj): + fnty = ir.FunctionType(ir.IntType(64), [self.pyobj]) + fn = self._get_function(fnty, name="numba_extract_np_datetime") + return self.builder.call(fn, [obj]) + + def extract_np_timedelta(self, obj): + fnty = ir.FunctionType(ir.IntType(64), [self.pyobj]) + fn = self._get_function(fnty, name="numba_extract_np_timedelta") + return self.builder.call(fn, [obj]) + + def create_np_datetime(self, val, unit_code): + unit_code = Constant(ir.IntType(32), int(unit_code)) + fnty = ir.FunctionType(self.pyobj, [ir.IntType(64), ir.IntType(32)]) + fn = self._get_function(fnty, name="numba_create_np_datetime") + return self.builder.call(fn, [val, unit_code]) + + def create_np_timedelta(self, val, unit_code): + unit_code = Constant(ir.IntType(32), int(unit_code)) + fnty = ir.FunctionType(self.pyobj, [ir.IntType(64), ir.IntType(32)]) + fn = self._get_function(fnty, name="numba_create_np_timedelta") + return self.builder.call(fn, [val, unit_code]) + + def recreate_record(self, pdata, size, dtype, env_manager): + fnty = ir.FunctionType(self.pyobj, [ir.PointerType(ir.IntType(8)), + ir.IntType(32), self.pyobj]) + fn = self._get_function(fnty, name="numba_recreate_record") + dtypeaddr = env_manager.read_const(env_manager.add_const(dtype)) + return self.builder.call(fn, [pdata, size, dtypeaddr]) + + def string_from_constant_string(self, string): + cstr = self.context.insert_const_string(self.module, string) + sz = self.context.get_constant(types.intp, len(string)) + return self.string_from_string_and_size(cstr, sz) + + def call_jit_code(self, func, sig, args): + """Calls into Numba jitted code and propagate error using the Python + calling convention. + + Parameters + ---------- + func : function + The Python function to be compiled. This function is compiled + in nopython-mode. + sig : numba.typing.Signature + The function signature for *func*. + args : Sequence[llvmlite.binding.Value] + LLVM values to use as arguments. + + Returns + ------- + (is_error, res) : 2-tuple of llvmlite.binding.Value. + is_error : true iff *func* raised an exception. + res : Returned value from *func* iff *is_error* is false. + + If *is_error* is true, this method will adapt the nopython exception + into a Python exception. Caller should return NULL to Python to + indicate an error. + """ + # Compile *func* + builder = self.builder + cres = self.context.compile_subroutine(builder, func, sig) + got_retty = cres.signature.return_type + retty = sig.return_type + if got_retty != retty: + # This error indicates an error in *func* or the caller of this + # method. + raise errors.LoweringError( + f'mismatching signature {got_retty} != {retty}.\n' + ) + # Call into *func* + status, res = self.context.call_internal_no_propagate( + builder, cres.fndesc, sig, args, + ) + # Post-call handling for *func* + is_error_ptr = cgutils.alloca_once(builder, cgutils.bool_t, zfill=True) + res_type = self.context.get_value_type(sig.return_type) + res_ptr = cgutils.alloca_once(builder, res_type, zfill=True) + + # Handle error and adapt the nopython exception into cpython exception + with builder.if_else(status.is_error) as (has_err, no_err): + with has_err: + builder.store(status.is_error, is_error_ptr) + # Set error state in the Python interpreter + self.context.call_conv.raise_error(builder, self, status) + with no_err: + # Handle returned value + res = imputils.fix_returning_optional( + self.context, builder, sig, status, res, + ) + builder.store(res, res_ptr) + + is_error = builder.load(is_error_ptr) + res = builder.load(res_ptr) + return is_error, res + + +class ObjModeUtils: + """Internal utils for calling objmode dispatcher from within NPM code. + """ + def __init__(self, pyapi): + self.pyapi = pyapi + + def load_dispatcher(self, fnty, argtypes): + builder = self.pyapi.builder + tyctx = self.pyapi.context + m = builder.module + + # Add a global variable to cache the objmode dispatcher + gv = ir.GlobalVariable( + m, self.pyapi.pyobj, + name=m.get_unique_name("cached_objmode_dispatcher"), + ) + gv.initializer = gv.type.pointee(None) + gv.linkage = 'internal' + + # Make a basic-block to common exit + bb_end = builder.append_basic_block("bb_end") + + if serialize.is_serialiable(fnty.dispatcher): + serialized_dispatcher = self.pyapi.serialize_object( + (fnty.dispatcher, tuple(argtypes)), + ) + compile_args = self.pyapi.unserialize(serialized_dispatcher) + # unserialize (unpickling) can fail + failed_unser = cgutils.is_null(builder, compile_args) + with builder.if_then(failed_unser): + # early exit. `gv` is still null. + builder.branch(bb_end) + + cached = builder.load(gv) + with builder.if_then(cgutils.is_null(builder, cached)): + if serialize.is_serialiable(fnty.dispatcher): + cls = type(self) + compiler = self.pyapi.unserialize( + self.pyapi.serialize_object(cls._call_objmode_dispatcher) + ) + callee = self.pyapi.call_function_objargs( + compiler, [compile_args], + ) + # Clean up + self.pyapi.decref(compiler) + self.pyapi.decref(compile_args) + else: + entry_pt = fnty.dispatcher.compile(tuple(argtypes)) + callee = tyctx.add_dynamic_addr( + builder, id(entry_pt), info="with_objectmode", + ) + # Incref the dispatcher and cache it + self.pyapi.incref(callee) + builder.store(callee, gv) + # Jump to the exit block + builder.branch(bb_end) + # Define the exit block + builder.position_at_end(bb_end) + callee = builder.load(gv) + return callee + + @staticmethod + def _call_objmode_dispatcher(compile_args): + dispatcher, argtypes = compile_args + entrypt = dispatcher.compile(argtypes) + return entrypt diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/registry.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/registry.py new file mode 100644 index 0000000000000000000000000000000000000000..14f23aae7072b9709d9f0b2b99252f1711bf8ed9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/registry.py @@ -0,0 +1,84 @@ +import contextlib +#from functools import cached_property +from numba.core.utils import threadsafe_cached_property as cached_property + +from numba.core.descriptors import TargetDescriptor +from numba.core import utils, typing, dispatcher, cpu + +# ----------------------------------------------------------------------------- +# Default CPU target descriptors + + +class CPUTarget(TargetDescriptor): + options = cpu.CPUTargetOptions + + @cached_property + def _toplevel_target_context(self): + # Lazily-initialized top-level target context, for all threads + return cpu.CPUContext(self.typing_context, self._target_name) + + @cached_property + def _toplevel_typing_context(self): + # Lazily-initialized top-level typing context, for all threads + return typing.Context() + + @property + def target_context(self): + """ + The target context for CPU targets. + """ + return self._toplevel_target_context + + @property + def typing_context(self): + """ + The typing context for CPU targets. + """ + return self._toplevel_typing_context + + +# The global CPU target +cpu_target = CPUTarget('cpu') + + +class CPUDispatcher(dispatcher.Dispatcher): + targetdescr = cpu_target + + +class DelayedRegistry(utils.UniqueDict): + """ + A unique dictionary but with deferred initialisation of the values. + + Attributes + ---------- + ondemand: + + A dictionary of key -> value, where value is executed + the first time it is is used. It is used for part of a deferred + initialization strategy. + """ + def __init__(self, *args, **kws): + self.ondemand = utils.UniqueDict() + self.key_type = kws.pop('key_type', None) + self.value_type = kws.pop('value_type', None) + self._type_check = self.key_type or self.value_type + super(DelayedRegistry, self).__init__(*args, **kws) + + def __getitem__(self, item): + if item in self.ondemand: + self[item] = self.ondemand[item]() + del self.ondemand[item] + return super(DelayedRegistry, self).__getitem__(item) + + def __setitem__(self, key, value): + if self._type_check: + def check(x, ty_x): + if isinstance(ty_x, type): + assert ty_x in x.__mro__, (x, ty_x) + else: + assert isinstance(x, ty_x), (x, ty_x) + if self.key_type is not None: + check(key, self.key_type) + if self.value_type is not None: + check(value, self.value_type) + return super(DelayedRegistry, self).__setitem__(key, value) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/removerefctpass.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/removerefctpass.py new file mode 100644 index 0000000000000000000000000000000000000000..98c04869a0bc5988dc936b920340a43ea06b438c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/removerefctpass.py @@ -0,0 +1,120 @@ +""" +Implement a rewrite pass on a LLVM module to remove unnecessary +refcount operations. +""" + +from llvmlite.ir.transforms import CallVisitor + +from numba.core import types + + +class _MarkNrtCallVisitor(CallVisitor): + """ + A pass to mark all NRT_incref and NRT_decref. + """ + def __init__(self): + self.marked = set() + + def visit_Call(self, instr): + if getattr(instr.callee, 'name', '') in _accepted_nrtfns: + self.marked.add(instr) + + +def _rewrite_function(function): + # Mark NRT usage + markpass = _MarkNrtCallVisitor() + markpass.visit_Function(function) + # Remove NRT usage + for bb in function.basic_blocks: + for inst in list(bb.instructions): + if inst in markpass.marked: + bb.instructions.remove(inst) + + +_accepted_nrtfns = 'NRT_incref', 'NRT_decref' + + +def _legalize(module, dmm, fndesc): + """ + Legalize the code in the module. + Returns True if the module is legal for the rewrite pass that removes + unnecessary refcounts. + """ + + def valid_output(ty): + """ + Valid output are any type that does not need refcount + """ + model = dmm[ty] + return not model.contains_nrt_meminfo() + + def valid_input(ty): + """ + Valid input are any type that does not need refcount except Array. + """ + return valid_output(ty) or isinstance(ty, types.Array) + + + # Ensure no reference to function marked as + # "numba_args_may_always_need_nrt" + try: + nmd = module.get_named_metadata("numba_args_may_always_need_nrt") + except KeyError: + # Nothing marked + pass + else: + # Has functions marked as "numba_args_may_always_need_nrt" + if len(nmd.operands) > 0: + # The pass is illegal for this compilation unit. + return False + + # More legalization base on function type + argtypes = fndesc.argtypes + restype = fndesc.restype + calltypes = fndesc.calltypes + + # Legalize function arguments + for argty in argtypes: + if not valid_input(argty): + return False + + # Legalize function return + if not valid_output(restype): + return False + + # Legalize all called functions + for callty in calltypes.values(): + if callty is not None and not valid_output(callty.return_type): + return False + + # Ensure no allocation + for fn in module.functions: + if fn.name.startswith("NRT_"): + if fn.name not in _accepted_nrtfns: + return False + + return True + + +def remove_unnecessary_nrt_usage(function, context, fndesc): + """ + Remove unnecessary NRT incref/decref in the given LLVM function. + It uses highlevel type info to determine if the function does not need NRT. + Such a function does not: + + - return array object(s); + - take arguments that need refcounting except array; + - call function(s) that return refcounted object. + + In effect, the function will not capture or create references that extend + the lifetime of any refcounted objects beyond the lifetime of the function. + + The rewrite is performed in place. + If rewrite has happened, this function returns True, otherwise, it returns False. + """ + dmm = context.data_model_manager + if _legalize(function.module, dmm, fndesc): + _rewrite_function(function) + return True + else: + return False diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/serialize.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/serialize.py new file mode 100644 index 0000000000000000000000000000000000000000..a06f3d1a21cfd2f372dbb438d0ca48bab6e89ee3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/serialize.py @@ -0,0 +1,259 @@ +""" +Serialization support for compiled functions. +""" +import sys +import abc +import io +import copyreg + + +import pickle +from numba import cloudpickle +from llvmlite import ir + + +# +# Pickle support +# + +def _rebuild_reduction(cls, *args): + """ + Global hook to rebuild a given class from its __reduce__ arguments. + """ + return cls._rebuild(*args) + + +# Keep unpickled object via `numba_unpickle` alive. +_unpickled_memo = {} + + +def _numba_unpickle(address, bytedata, hashed): + """Used by `numba_unpickle` from _helperlib.c + + Parameters + ---------- + address : int + bytedata : bytes + hashed : bytes + + Returns + ------- + obj : object + unpickled object + """ + key = (address, hashed) + try: + obj = _unpickled_memo[key] + except KeyError: + _unpickled_memo[key] = obj = cloudpickle.loads(bytedata) + return obj + + +def dumps(obj): + """Similar to `pickle.dumps()`. Returns the serialized object in bytes. + """ + pickler = NumbaPickler + with io.BytesIO() as buf: + p = pickler(buf, protocol=4) + p.dump(obj) + pickled = buf.getvalue() + + return pickled + + +def runtime_build_excinfo_struct(static_exc, exc_args): + exc, static_args, locinfo = cloudpickle.loads(static_exc) + real_args = [] + exc_args_iter = iter(exc_args) + for arg in static_args: + if isinstance(arg, ir.Value): + real_args.append(next(exc_args_iter)) + else: + real_args.append(arg) + return (exc, tuple(real_args), locinfo) + + +# Alias to pickle.loads to allow `serialize.loads()` +loads = cloudpickle.loads + + +class _CustomPickled: + """A wrapper for objects that must be pickled with `NumbaPickler`. + + Standard `pickle` will pick up the implementation registered via `copyreg`. + This will spawn a `NumbaPickler` instance to serialize the data. + + `NumbaPickler` overrides the handling of this type so as not to spawn a + new pickler for the object when it is already being pickled by a + `NumbaPickler`. + """ + + __slots__ = 'ctor', 'states' + + def __init__(self, ctor, states): + self.ctor = ctor + self.states = states + + def _reduce(self): + return _CustomPickled._rebuild, (self.ctor, self.states) + + @classmethod + def _rebuild(cls, ctor, states): + return cls(ctor, states) + + +def _unpickle__CustomPickled(serialized): + """standard unpickling for `_CustomPickled`. + + Uses `NumbaPickler` to load. + """ + ctor, states = loads(serialized) + return _CustomPickled(ctor, states) + + +def _pickle__CustomPickled(cp): + """standard pickling for `_CustomPickled`. + + Uses `NumbaPickler` to dump. + """ + serialized = dumps((cp.ctor, cp.states)) + return _unpickle__CustomPickled, (serialized,) + + +# Register custom pickling for the standard pickler. +copyreg.pickle(_CustomPickled, _pickle__CustomPickled) + + +def custom_reduce(cls, states): + """For customizing object serialization in `__reduce__`. + + Object states provided here are used as keyword arguments to the + `._rebuild()` class method. + + Parameters + ---------- + states : dict + Dictionary of object states to be serialized. + + Returns + ------- + result : tuple + This tuple conforms to the return type requirement for `__reduce__`. + """ + return custom_rebuild, (_CustomPickled(cls, states),) + + +def custom_rebuild(custom_pickled): + """Customized object deserialization. + + This function is referenced internally by `custom_reduce()`. + """ + cls, states = custom_pickled.ctor, custom_pickled.states + return cls._rebuild(**states) + + +def is_serialiable(obj): + """Check if *obj* can be serialized. + + Parameters + ---------- + obj : object + + Returns + -------- + can_serialize : bool + """ + with io.BytesIO() as fout: + pickler = NumbaPickler(fout) + try: + pickler.dump(obj) + except pickle.PicklingError: + return False + else: + return True + + +def _no_pickle(obj): + raise pickle.PicklingError(f"Pickling of {type(obj)} is unsupported") + + +def disable_pickling(typ): + """This is called on a type to disable pickling + """ + NumbaPickler.disabled_types.add(typ) + # Return `typ` to allow use as a decorator + return typ + + +class NumbaPickler(cloudpickle.CloudPickler): + disabled_types = set() + """A set of types that pickling cannot is disabled. + """ + + def reducer_override(self, obj): + # Overridden to disable pickling of certain types + if type(obj) in self.disabled_types: + _no_pickle(obj) # noreturn + return super().reducer_override(obj) + + +def _custom_reduce__custompickled(cp): + return cp._reduce() + + +NumbaPickler.dispatch_table[_CustomPickled] = _custom_reduce__custompickled + + +class ReduceMixin(abc.ABC): + """A mixin class for objects that should be reduced by the NumbaPickler + instead of the standard pickler. + """ + # Subclass MUST override the below methods + + @abc.abstractmethod + def _reduce_states(self): + raise NotImplementedError + + @abc.abstractclassmethod + def _rebuild(cls, **kwargs): + raise NotImplementedError + + # Subclass can override the below methods + + def _reduce_class(self): + return self.__class__ + + # Private methods + + def __reduce__(self): + return custom_reduce(self._reduce_class(), self._reduce_states()) + + +class PickleCallableByPath: + """Wrap a callable object to be pickled by path to workaround limitation + in pickling due to non-pickleable objects in function non-locals. + + Note: + - Do not use this as a decorator. + - Wrapped object must be a global that exist in its parent module and it + can be imported by `from the_module import the_object`. + + Usage: + + >>> def my_fn(x): + >>> ... + >>> wrapped_fn = PickleCallableByPath(my_fn) + >>> # refer to `wrapped_fn` instead of `my_fn` + """ + def __init__(self, fn): + self._fn = fn + + def __call__(self, *args, **kwargs): + return self._fn(*args, **kwargs) + + def __reduce__(self): + return type(self)._rebuild, (self._fn.__module__, self._fn.__name__,) + + @classmethod + def _rebuild(cls, modname, fn_path): + return cls(getattr(sys.modules[modname], fn_path)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/sigutils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/sigutils.py new file mode 100644 index 0000000000000000000000000000000000000000..aecdb8f6525e8d276a77591f0c2cc54af968051d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/sigutils.py @@ -0,0 +1,53 @@ +from numba.core import types, typing + + +def is_signature(sig): + """ + Return whether *sig* is a potentially valid signature + specification (for user-facing APIs). + """ + return isinstance(sig, (str, tuple, typing.Signature)) + + +def _parse_signature_string(signature_str): + """ + Parameters + ---------- + signature_str : str + """ + # Just eval signature_str using the types submodules as globals + return eval(signature_str, {}, types.__dict__) + + +def normalize_signature(sig): + """ + From *sig* (a signature specification), return a ``(args, return_type)`` + tuple, where ``args`` itself is a tuple of types, and ``return_type`` + can be None if not specified. + """ + if isinstance(sig, str): + parsed = _parse_signature_string(sig) + else: + parsed = sig + if isinstance(parsed, tuple): + args, return_type = parsed, None + elif isinstance(parsed, typing.Signature): + args, return_type = parsed.args, parsed.return_type + else: + raise TypeError("invalid signature: %r (type: %r) evaluates to %r " + "instead of tuple or Signature" % ( + sig, sig.__class__.__name__, + parsed.__class__.__name__ + )) + + def check_type(ty): + if not isinstance(ty, types.Type): + raise TypeError("invalid type in signature: expected a type " + "instance, got %r" % (ty,)) + + if return_type is not None: + check_type(return_type) + for ty in args: + check_type(ty) + + return args, return_type diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/ssa.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/ssa.py new file mode 100644 index 0000000000000000000000000000000000000000..7a44d3eb3016f90c07dfe55888a7787b1748e95e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/ssa.py @@ -0,0 +1,489 @@ +""" +Implement Dominance-Fronter-based SSA by Choi et al described in Inria SSA book + +References: + +- Static Single Assignment Book by Inria + http://ssabook.gforge.inria.fr/latest/book.pdf +- Choi et al. Incremental computation of static single assignment form. +""" +import logging +import operator +import warnings +from functools import reduce +from copy import copy +from collections import defaultdict + +from numba import config +from numba.core import ir, ir_utils, errors +from numba.core.utils import OrderedSet, _lazy_pformat +from numba.core.analysis import compute_cfg_from_blocks + + +_logger = logging.getLogger(__name__) + + +def reconstruct_ssa(func_ir): + """Apply SSA reconstruction algorithm on the given IR. + + Produces minimal SSA using Choi et al algorithm. + """ + func_ir.blocks = _run_ssa(func_ir.blocks) + + return func_ir + + +class _CacheListVars: + def __init__(self): + self._saved = {} + + def get(self, inst): + got = self._saved.get(inst) + if got is None: + self._saved[inst] = got = inst.list_vars() + return got + + +def _run_ssa(blocks): + """Run SSA reconstruction on IR blocks of a function. + """ + if not blocks: + # Empty blocks? + return {} + # Run CFG on the blocks + cfg = compute_cfg_from_blocks(blocks) + df_plus = _iterated_domfronts(cfg) + # Find SSA violators + violators = _find_defs_violators(blocks, cfg) + # Make cache for .list_vars() + cache_list_vars = _CacheListVars() + + # Process one SSA-violating variable at a time + for varname in violators: + _logger.debug( + "Fix SSA violator on var %s", varname, + ) + # Fix up the LHS + # Put fresh variables for all assignments to the variable + blocks, defmap = _fresh_vars(blocks, varname) + _logger.debug("Replaced assignments: %s", _lazy_pformat(defmap)) + # Fix up the RHS + # Re-associate the variable uses with the reaching definition + blocks = _fix_ssa_vars(blocks, varname, defmap, cfg, df_plus, + cache_list_vars) + + # Post-condition checks. + # CFG invariant + cfg_post = compute_cfg_from_blocks(blocks) + if cfg_post != cfg: + raise errors.CompilerError("CFG mutated in SSA pass") + return blocks + + +def _fix_ssa_vars(blocks, varname, defmap, cfg, df_plus, cache_list_vars): + """Rewrite all uses to ``varname`` given the definition map + """ + states = _make_states(blocks) + states['varname'] = varname + states['defmap'] = defmap + states['phimap'] = phimap = defaultdict(list) + states['cfg'] = cfg + states['phi_locations'] = _compute_phi_locations(df_plus, defmap) + newblocks = _run_block_rewrite(blocks, states, _FixSSAVars(cache_list_vars)) + # insert phi nodes + for label, philist in phimap.items(): + curblk = newblocks[label] + # Prepend PHI nodes to the block + curblk.body = philist + curblk.body + return newblocks + + +def _iterated_domfronts(cfg): + """Compute the iterated dominance frontiers (DF+ in literatures). + + Returns a dictionary which maps block label to the set of labels of its + iterated dominance frontiers. + """ + domfronts = {k: set(vs) for k, vs in cfg.dominance_frontier().items()} + keep_going = True + while keep_going: + keep_going = False + for k, vs in domfronts.items(): + inner = reduce(operator.or_, [domfronts[v] for v in vs], set()) + if inner.difference(vs): + vs |= inner + keep_going = True + return domfronts + + +def _compute_phi_locations(iterated_df, defmap): + # See basic algorithm in Ch 4.1 in Inria SSA Book + # Compute DF+(defs) + # DF of all DFs is the union of all DFs + phi_locations = set() + for deflabel, defstmts in defmap.items(): + if defstmts: + phi_locations |= iterated_df[deflabel] + return phi_locations + + +def _fresh_vars(blocks, varname): + """Rewrite to put fresh variable names + """ + states = _make_states(blocks) + states['varname'] = varname + states['defmap'] = defmap = defaultdict(list) + newblocks = _run_block_rewrite(blocks, states, _FreshVarHandler()) + return newblocks, defmap + + +def _get_scope(blocks): + first, *_ = blocks.values() + return first.scope + + +def _find_defs_violators(blocks, cfg): + """ + Returns + ------- + res : Set[str] + The SSA violators in a dictionary of variable names. + """ + defs = defaultdict(list) + uses = defaultdict(set) + states = dict(defs=defs, uses=uses) + _run_block_analysis(blocks, states, _GatherDefsHandler()) + _logger.debug("defs %s", _lazy_pformat(defs)) + # Gather violators by number of definitions. + # The violators are added by the order that they are seen and the algorithm + # scan from the first to the last basic-block as they occur in bytecode. + violators = OrderedSet([k for k, vs in defs.items() if len(vs) > 1]) + # Gather violators by uses not dominated by the one def + doms = cfg.dominators() + for k, use_blocks in uses.items(): + if k not in violators: + for label in use_blocks: + dom = doms[label] + def_labels = {label for _assign, label in defs[k] } + if not def_labels.intersection(dom): + violators.add(k) + break + _logger.debug("SSA violators %s", _lazy_pformat(violators)) + return violators + + +def _run_block_analysis(blocks, states, handler): + for label, blk in blocks.items(): + _logger.debug("==== SSA block analysis pass on %s", label) + states['label'] = label + for _ in _run_ssa_block_pass(states, blk, handler): + pass + + +def _run_block_rewrite(blocks, states, handler): + newblocks = {} + for label, blk in blocks.items(): + _logger.debug("==== SSA block rewrite pass on %s", label) + newblk = ir.Block(scope=blk.scope, loc=blk.loc) + + newbody = [] + states['label'] = label + states['block'] = blk + for stmt in _run_ssa_block_pass(states, blk, handler): + assert stmt is not None + newbody.append(stmt) + newblk.body = newbody + newblocks[label] = newblk + return newblocks + + +def _make_states(blocks): + return dict( + scope=_get_scope(blocks), + ) + + +def _run_ssa_block_pass(states, blk, handler): + _logger.debug("Running %s", handler) + for stmt in blk.body: + _logger.debug("on stmt: %s", stmt) + if isinstance(stmt, ir.Assign): + ret = handler.on_assign(states, stmt) + else: + ret = handler.on_other(states, stmt) + if ret is not stmt and ret is not None: + _logger.debug("replaced with: %s", ret) + yield ret + + +class _BaseHandler: + """A base handler for all the passes used here for the SSA algorithm. + """ + def on_assign(self, states, assign): + """ + Called when the pass sees an ``ir.Assign``. + + Subclasses should override this for custom behavior + + Parameters + ----------- + states : dict + assign : numba.ir.Assign + + Returns + ------- + stmt : numba.ir.Assign or None + For rewrite passes, the return value is used as the replacement + for the given statement. + """ + + def on_other(self, states, stmt): + """ + Called when the pass sees an ``ir.Stmt`` that's not an assignment. + + Subclasses should override this for custom behavior + + Parameters + ----------- + states : dict + assign : numba.ir.Stmt + + Returns + ------- + stmt : numba.ir.Stmt or None + For rewrite passes, the return value is used as the replacement + for the given statement. + """ + + +class _GatherDefsHandler(_BaseHandler): + """Find all defs and uses of variable in each block + + ``states["label"]`` is a int; label of the current block + ``states["defs"]`` is a Mapping[str, List[Tuple[ir.Assign, int]]]: + - a mapping of the name of the assignee variable to the assignment + IR node and the block label. + ``states["uses"]`` is a Mapping[Set[int]] + """ + def on_assign(self, states, assign): + # keep track of assignment and the block + states["defs"][assign.target.name].append((assign, states["label"])) + # keep track of uses + for var in assign.list_vars(): + k = var.name + if k != assign.target.name: + states["uses"][k].add(states["label"]) + + def on_other(self, states, stmt): + # keep track of uses + for var in stmt.list_vars(): + k = var.name + states["uses"][k].add(states["label"]) + + +class UndefinedVariable: + def __init__(self): + raise NotImplementedError("Not intended for instantiation") + + target = ir.UNDEFINED + + +class _FreshVarHandler(_BaseHandler): + """Replaces assignment target with new fresh variables. + """ + def on_assign(self, states, assign): + if assign.target.name == states['varname']: + scope = states['scope'] + defmap = states['defmap'] + # Allow first assignment to retain the name + if len(defmap) == 0: + newtarget = assign.target + _logger.debug("first assign: %s", newtarget) + if newtarget.name not in scope.localvars: + wmsg = f"variable {newtarget.name!r} is not in scope." + warnings.warn(errors.NumbaIRAssumptionWarning(wmsg, + loc=assign.loc)) + else: + newtarget = scope.redefine(assign.target.name, loc=assign.loc) + assign = ir.Assign( + target=newtarget, + value=assign.value, + loc=assign.loc + ) + defmap[states['label']].append(assign) + return assign + + def on_other(self, states, stmt): + return stmt + + +class _FixSSAVars(_BaseHandler): + """Replace variable uses in IR nodes to the correct reaching variable + and introduce Phi nodes if necessary. This class contains the core of + the SSA reconstruction algorithm. + + See Ch 5 of the Inria SSA book for reference. The method names used here + are similar to the names used in the pseudocode in the book. + """ + + def __init__(self, cache_list_vars): + self._cache_list_vars = cache_list_vars + + def on_assign(self, states, assign): + rhs = assign.value + if isinstance(rhs, ir.Inst): + newdef = self._fix_var( + states, assign, self._cache_list_vars.get(assign.value), + ) + # Has a replacement that is not the current variable + if newdef is not None and newdef.target is not ir.UNDEFINED: + if states['varname'] != newdef.target.name: + replmap = {states['varname']: newdef.target} + rhs = copy(rhs) + + ir_utils.replace_vars_inner(rhs, replmap) + return ir.Assign( + target=assign.target, + value=rhs, + loc=assign.loc, + ) + elif isinstance(rhs, ir.Var): + newdef = self._fix_var(states, assign, [rhs]) + # Has a replacement that is not the current variable + if newdef is not None and newdef.target is not ir.UNDEFINED: + if states['varname'] != newdef.target.name: + return ir.Assign( + target=assign.target, + value=newdef.target, + loc=assign.loc, + ) + + return assign + + def on_other(self, states, stmt): + newdef = self._fix_var( + states, stmt, self._cache_list_vars.get(stmt), + ) + if newdef is not None and newdef.target is not ir.UNDEFINED: + if states['varname'] != newdef.target.name: + replmap = {states['varname']: newdef.target} + stmt = copy(stmt) + ir_utils.replace_vars_stmt(stmt, replmap) + return stmt + + def _fix_var(self, states, stmt, used_vars): + """Fix all variable uses in ``used_vars``. + """ + varnames = [k.name for k in used_vars] + phivar = states['varname'] + if phivar in varnames: + return self._find_def(states, stmt) + + def _find_def(self, states, stmt): + """Find definition of ``stmt`` for the statement ``stmt`` + """ + _logger.debug("find_def var=%r stmt=%s", states['varname'], stmt) + selected_def = None + label = states['label'] + local_defs = states['defmap'][label] + local_phis = states['phimap'][label] + block = states['block'] + + cur_pos = self._stmt_index(stmt, block) + for defstmt in reversed(local_defs): + # Phi nodes have no index + def_pos = self._stmt_index(defstmt, block, stop=cur_pos) + if def_pos < cur_pos: + selected_def = defstmt + break + # Maybe it's a PHI + elif defstmt in local_phis: + selected_def = local_phis[-1] + break + + if selected_def is None: + selected_def = self._find_def_from_top( + states, label, loc=stmt.loc, + ) + return selected_def + + def _find_def_from_top(self, states, label, loc): + """Find definition reaching block of ``label``. + + This method would look at all dominance frontiers. + Insert phi node if necessary. + """ + _logger.debug("find_def_from_top label %r", label) + cfg = states['cfg'] + defmap = states['defmap'] + phimap = states['phimap'] + phi_locations = states['phi_locations'] + + if label in phi_locations: + scope = states['scope'] + loc = states['block'].loc + # fresh variable + freshvar = scope.redefine(states['varname'], loc=loc) + # insert phi + phinode = ir.Assign( + target=freshvar, + value=ir.Expr.phi(loc=loc), + loc=loc, + ) + _logger.debug("insert phi node %s at %s", phinode, label) + defmap[label].insert(0, phinode) + phimap[label].append(phinode) + # Find incoming values for the Phi node + for pred, _ in cfg.predecessors(label): + incoming_def = self._find_def_from_bottom( + states, pred, loc=loc, + ) + _logger.debug("incoming_def %s", incoming_def) + phinode.value.incoming_values.append(incoming_def.target) + phinode.value.incoming_blocks.append(pred) + return phinode + else: + idom = cfg.immediate_dominators()[label] + if idom == label: + # We have searched to the top of the idom tree. + # Since we still cannot find a definition, + # we will warn. + _warn_about_uninitialized_variable(states['varname'], loc) + return UndefinedVariable + _logger.debug("idom %s from label %s", idom, label) + return self._find_def_from_bottom(states, idom, loc=loc) + + def _find_def_from_bottom(self, states, label, loc): + """Find definition from within the block at ``label``. + """ + _logger.debug("find_def_from_bottom label %r", label) + defmap = states['defmap'] + defs = defmap[label] + if defs: + lastdef = defs[-1] + return lastdef + else: + return self._find_def_from_top(states, label, loc=loc) + + def _stmt_index(self, defstmt, block, stop=-1): + """Find the positional index of the statement at ``block``. + + Assumptions: + - no two statements can point to the same object. + """ + # Compare using id() as IR node equality is for semantic equivalence + # opposed to direct equality (the location and scope are not considered + # as part of the equality measure, this is important here). + for i in range(len(block.body))[:stop]: + if block.body[i] is defstmt: + return i + return len(block.body) + + +def _warn_about_uninitialized_variable(varname, loc): + if config.ALWAYS_WARN_UNINIT_VAR: + warnings.warn( + errors.NumbaWarning( + f"Detected uninitialized variable {varname}", + loc=loc), + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/target_extension.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/target_extension.py new file mode 100644 index 0000000000000000000000000000000000000000..91e5df09985b75f4971466efb07aa9c965decc1b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/target_extension.py @@ -0,0 +1,169 @@ +from abc import ABC, abstractmethod +from numba.core.registry import DelayedRegistry, CPUDispatcher +from numba.core.decorators import jit +from numba.core.errors import (InternalTargetMismatchError, + NonexistentTargetError) +from threading import local as tls + + +_active_context = tls() +_active_context_default = 'cpu' + + +class _TargetRegistry(DelayedRegistry): + + def __getitem__(self, item): + try: + return super().__getitem__(item) + except KeyError: + msg = "No target is registered against '{}', known targets:\n{}" + known = '\n'.join([f"{k: <{10}} -> {v}" + for k, v in target_registry.items()]) + raise NonexistentTargetError(msg.format(item, known)) from None + + +# Registry mapping target name strings to Target classes +target_registry = _TargetRegistry() + +# Registry mapping Target classes the @jit decorator for that target +jit_registry = DelayedRegistry() + + +class target_override(object): + """Context manager to temporarily override the current target with that + prescribed.""" + def __init__(self, name): + self._orig_target = getattr(_active_context, 'target', + _active_context_default) + self.target = name + + def __enter__(self): + _active_context.target = self.target + + def __exit__(self, ty, val, tb): + _active_context.target = self._orig_target + + +def current_target(): + """Returns the current target + """ + return getattr(_active_context, 'target', _active_context_default) + + +def get_local_target(context): + """ + Gets the local target from the call stack if available and the TLS + override if not. + """ + # TODO: Should this logic be reversed to prefer TLS override? + if len(context.callstack._stack) > 0: + target = context.callstack[0].target + else: + target = target_registry.get(current_target(), None) + if target is None: + msg = ("The target found is not registered." + "Given target was {}.") + raise ValueError(msg.format(target)) + else: + return target + + +def resolve_target_str(target_str): + """Resolves a target specified as a string to its Target class.""" + return target_registry[target_str] + + +def resolve_dispatcher_from_str(target_str): + """Returns the dispatcher associated with a target string""" + target_hw = resolve_target_str(target_str) + return dispatcher_registry[target_hw] + + +def _get_local_target_checked(tyctx, hwstr, reason): + """Returns the local target if it is compatible with the given target + name during a type resolution; otherwise, raises an exception. + + Parameters + ---------- + tyctx: typing context + hwstr: str + target name to check against + reason: str + Reason for the resolution. Expects a noun. + Returns + ------- + target_hw : Target + + Raises + ------ + InternalTargetMismatchError + """ + # Get the class for the target declared by the function + hw_clazz = resolve_target_str(hwstr) + # get the local target + target_hw = get_local_target(tyctx) + # make sure the target_hw is in the MRO for hw_clazz else bail + if not target_hw.inherits_from(hw_clazz): + raise InternalTargetMismatchError(reason, target_hw, hw_clazz) + return target_hw + + +class JitDecorator(ABC): + + @abstractmethod + def __call__(self): + return NotImplemented + + +class Target(ABC): + """ Implements a target """ + + @classmethod + def inherits_from(cls, other): + """Returns True if this target inherits from 'other' False otherwise""" + return issubclass(cls, other) + + +class Generic(Target): + """Mark the target as generic, i.e. suitable for compilation on + any target. All must inherit from this. + """ + + +class CPU(Generic): + """Mark the target as CPU. + """ + + +class GPU(Generic): + """Mark the target as GPU, i.e. suitable for compilation on a GPU + target. + """ + + +class CUDA(GPU): + """Mark the target as CUDA. + """ + + +class NPyUfunc(Target): + """Mark the target as a ufunc + """ + + +target_registry['generic'] = Generic +target_registry['CPU'] = CPU +target_registry['cpu'] = CPU +target_registry['GPU'] = GPU +target_registry['gpu'] = GPU +target_registry['CUDA'] = CUDA +target_registry['cuda'] = CUDA +target_registry['npyufunc'] = NPyUfunc + +dispatcher_registry = DelayedRegistry(key_type=Target) + + +# Register the cpu target token with its dispatcher and jit +cpu_target = target_registry['cpu'] +dispatcher_registry[cpu_target] = CPUDispatcher +jit_registry[cpu_target] = jit diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/targetconfig.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/targetconfig.py new file mode 100644 index 0000000000000000000000000000000000000000..4fe47f9864f8d5acdd34a98711baf01275c44c32 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/targetconfig.py @@ -0,0 +1,322 @@ +""" +This module contains utils for manipulating target configurations such as +compiler flags. +""" +import re +import zlib +import base64 + +from types import MappingProxyType +from numba.core import utils + + +class Option: + """An option to be used in ``TargetConfig``. + """ + __slots__ = "_type", "_default", "_doc" + + def __init__(self, type, *, default, doc): + """ + Parameters + ---------- + type : + Type of the option value. It can be a callable. + The setter always calls ``self._type(value)``. + default : + The default value for the option. + doc : str + Docstring for the option. + """ + self._type = type + self._default = default + self._doc = doc + + @property + def type(self): + return self._type + + @property + def default(self): + return self._default + + @property + def doc(self): + return self._doc + + +class _FlagsStack(utils.ThreadLocalStack, stack_name="flags"): + pass + + +class ConfigStack: + """A stack for tracking target configurations in the compiler. + + It stores the stack in a thread-local class attribute. All instances in the + same thread will see the same stack. + """ + @classmethod + def top_or_none(cls): + """Get the TOS or return None if no config is set. + """ + self = cls() + if self: + flags = self.top() + else: + # Note: should this be the default flag for the target instead? + flags = None + return flags + + def __init__(self): + self._stk = _FlagsStack() + + def top(self): + return self._stk.top() + + def __len__(self): + return len(self._stk) + + def enter(self, flags): + """Returns a contextmanager that performs ``push(flags)`` on enter and + ``pop()`` on exit. + """ + return self._stk.enter(flags) + + +class _MetaTargetConfig(type): + """Metaclass for ``TargetConfig``. + + When a subclass of ``TargetConfig`` is created, all ``Option`` defined + as class members will be parsed and corresponding getters, setters, and + delters will be inserted. + """ + def __init__(cls, name, bases, dct): + """Invoked when subclass is created. + + Insert properties for each ``Option`` that are class members. + All the options will be grouped inside the ``.options`` class + attribute. + """ + # Gather options from base classes and class dict + opts = {} + # Reversed scan into the base classes to follow MRO ordering such that + # the closest base class is overriding + for base_cls in reversed(bases): + opts.update(base_cls.options) + opts.update(cls.find_options(dct)) + # Store the options into class attribute as a ready-only mapping. + cls.options = MappingProxyType(opts) + + # Make properties for each of the options + def make_prop(name, option): + def getter(self): + return self._values.get(name, option.default) + + def setter(self, val): + self._values[name] = option.type(val) + + def delter(self): + del self._values[name] + + return property(getter, setter, delter, option.doc) + + for name, option in cls.options.items(): + setattr(cls, name, make_prop(name, option)) + + def find_options(cls, dct): + """Returns a new dict with all the items that are a mapping to an + ``Option``. + """ + return {k: v for k, v in dct.items() if isinstance(v, Option)} + + +class _NotSetType: + def __repr__(self): + return "" + + +_NotSet = _NotSetType() + + +class TargetConfig(metaclass=_MetaTargetConfig): + """Base class for ``TargetConfig``. + + Subclass should fill class members with ``Option``. For example: + + >>> class MyTargetConfig(TargetConfig): + >>> a_bool_option = Option(type=bool, default=False, doc="a bool") + >>> an_int_option = Option(type=int, default=0, doc="an int") + + The metaclass will insert properties for each ``Option``. For example: + + >>> tc = MyTargetConfig() + >>> tc.a_bool_option = True # invokes the setter + >>> print(tc.an_int_option) # print the default + """ + __slots__ = ["_values"] + + # Used for compression in mangling. + # Set to -15 to disable the header and checksum for smallest output. + _ZLIB_CONFIG = {"wbits": -15} + + def __init__(self, copy_from=None): + """ + Parameters + ---------- + copy_from : TargetConfig or None + if None, creates an empty ``TargetConfig``. + Otherwise, creates a copy. + """ + self._values = {} + if copy_from is not None: + assert isinstance(copy_from, TargetConfig) + self._values.update(copy_from._values) + + def __repr__(self): + # NOTE: default options will be placed at the end and grouped inside + # a square bracket; i.e. [optname=optval, ...] + args = [] + defs = [] + for k in self.options: + msg = f"{k}={getattr(self, k)}" + if not self.is_set(k): + defs.append(msg) + else: + args.append(msg) + clsname = self.__class__.__name__ + return f"{clsname}({', '.join(args)}, [{', '.join(defs)}])" + + def __hash__(self): + return hash(tuple(sorted(self.values()))) + + def __eq__(self, other): + if isinstance(other, TargetConfig): + return self.values() == other.values() + else: + return NotImplemented + + def values(self): + """Returns a dict of all the values + """ + return {k: getattr(self, k) for k in self.options} + + def is_set(self, name): + """Is the option set? + """ + self._guard_option(name) + return name in self._values + + def discard(self, name): + """Remove the option by name if it is defined. + + After this, the value for the option will be set to its default value. + """ + self._guard_option(name) + self._values.pop(name, None) + + def inherit_if_not_set(self, name, default=_NotSet): + """Inherit flag from ``ConfigStack``. + + Parameters + ---------- + name : str + Option name. + default : optional + When given, it overrides the default value. + It is only used when the flag is not defined locally and there is + no entry in the ``ConfigStack``. + """ + self._guard_option(name) + if not self.is_set(name): + cstk = ConfigStack() + if cstk: + # inherit + top = cstk.top() + setattr(self, name, getattr(top, name)) + elif default is not _NotSet: + setattr(self, name, default) + + def copy(self): + """Clone this instance. + """ + return type(self)(self) + + def summary(self) -> str: + """Returns a ``str`` that summarizes this instance. + + In contrast to ``__repr__``, only options that are explicitly set will + be shown. + """ + args = [f"{k}={v}" for k, v in self._summary_args()] + clsname = self.__class__.__name__ + return f"{clsname}({', '.join(args)})" + + def _guard_option(self, name): + if name not in self.options: + msg = f"{name!r} is not a valid option for {type(self)}" + raise ValueError(msg) + + def _summary_args(self): + """returns a sorted sequence of 2-tuple containing the + ``(flag_name, flag_value)`` for flag that are set with a non-default + value. + """ + args = [] + for k in sorted(self.options): + opt = self.options[k] + if self.is_set(k): + flagval = getattr(self, k) + if opt.default != flagval: + v = (k, flagval) + args.append(v) + return args + + @classmethod + def _make_compression_dictionary(cls) -> bytes: + """Returns a ``bytes`` object suitable for use as a dictionary for + compression. + """ + buf = [] + # include package name + buf.append("numba") + # include class name + buf.append(cls.__class__.__name__) + # include common values + buf.extend(["True", "False"]) + # include all options name and their default value + for k, opt in cls.options.items(): + buf.append(k) + buf.append(str(opt.default)) + return ''.join(buf).encode() + + def get_mangle_string(self) -> str: + """Return a string suitable for symbol mangling. + """ + zdict = self._make_compression_dictionary() + + comp = zlib.compressobj(zdict=zdict, level=zlib.Z_BEST_COMPRESSION, + **self._ZLIB_CONFIG) + # The mangled string is a compressed and base64 encoded version of the + # summary + buf = [comp.compress(self.summary().encode())] + buf.append(comp.flush()) + return base64.b64encode(b''.join(buf)).decode() + + @classmethod + def demangle(cls, mangled: str) -> str: + """Returns the demangled result from ``.get_mangle_string()`` + """ + # unescape _XX sequence + def repl(x): + return chr(int('0x' + x.group(0)[1:], 16)) + unescaped = re.sub(r"_[a-zA-Z0-9][a-zA-Z0-9]", repl, mangled) + # decode base64 + raw = base64.b64decode(unescaped) + # decompress + zdict = cls._make_compression_dictionary() + dc = zlib.decompressobj(zdict=zdict, **cls._ZLIB_CONFIG) + buf = [] + while raw: + buf.append(dc.decompress(raw)) + raw = dc.unconsumed_tail + buf.append(dc.flush()) + return b''.join(buf).decode() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/tracing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/tracing.py new file mode 100644 index 0000000000000000000000000000000000000000..282e844200afe9c8e7e860cee73cb983a2d781db --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/tracing.py @@ -0,0 +1,216 @@ +import logging +import sys +import types +import threading +import inspect +from functools import wraps +from itertools import chain +from numba.core import config + +class TLS(threading.local): + """Use a subclass to properly initialize the TLS variables in all threads.""" + def __init__(self): + self.tracing = False + self.indent = 0 + +tls = TLS() + +def find_function_info(func, spec, args): + """Return function meta-data in a tuple. + + (name, type)""" + + module = getattr(func, '__module__', None) + name = getattr(func, '__name__', None) + self = getattr(func, '__self__', None) + cname = None + if self: + cname = self.__name__ + #cname = self.__class__.__name__ + # Try to deduce the class' name even for unbound methods from their + # first argument, which we assume to be a class instance if named 'self'... + elif len(spec.args) and spec.args[0] == 'self': + cname = args[0].__class__.__name__ + # ...or a class object if named 'cls' + elif len(spec.args) and spec.args[0] == 'cls': + cname = args[0].__name__ + if name: + qname = [] + if module and module != '__main__': + qname.append(module) + qname.append('.') + if cname: + qname.append(cname) + qname.append('.') + qname.append(name) + name = ''.join(qname) + return name, None + +def chop(value): + MAX_SIZE = 320 + s = repr(value) + if len(s) > MAX_SIZE: + return s[:MAX_SIZE] + '...' + s[-1] + else: + return s + +def create_events(fname, spec, args, kwds): + + values = dict() + if spec.defaults: + values = dict(zip(spec.args[-len(spec.defaults):],spec.defaults)) + values.update(kwds) + values.update(list(zip(spec.args[:len(args)], args))) + positional = ['%s=%r'%(a, values.pop(a)) for a in spec.args] + anonymous = [str(a) for a in args[len(positional):]] + keywords = ['%s=%r'%(k, values[k]) for k in sorted(values.keys())] + params = ', '.join([f for f in chain(positional, anonymous, keywords) if f]) + + enter = ['>> ', tls.indent * ' ', fname, '(', params, ')'] + leave = ['<< ', tls.indent * ' ', fname] + return enter, leave + + +def dotrace(*args, **kwds): + """Function decorator to trace a function's entry and exit. + + *args: categories in which to trace this function. Example usage: + + @trace + def function(...):... + + @trace('mycategory') + def function(...):... + + + """ + + recursive = kwds.get('recursive', False) + def decorator(func): + + spec = None + logger = logging.getLogger('trace') + def wrapper(*args, **kwds): + if not logger.isEnabledFor(logging.INFO) or tls.tracing: + return func(*args, **kwds) + + fname, ftype = find_function_info(func, spec, args) + + try: + tls.tracing = True + enter, leave = create_events(fname, spec, args, kwds) + + try: + logger.info(''.join(enter)) + tls.indent += 1 + try: + try: + tls.tracing = False + result = func(*args, **kwds) + finally: + tls.tracing = True + except: + type, value, traceback = sys.exc_info() + leave.append(' => exception thrown\n\traise ') + mname = type.__module__ + if mname != '__main__': + leave.append(mname) + leave.append('.') + leave.append(type.__name__) + if value.args: + leave.append('(') + leave.append(', '.join(chop(v) for v in value.args)) + leave.append(')') + else: + leave.append('()') + raise + else: + if result is not None: + leave.append(' -> ') + leave.append(chop(result)) + finally: + tls.indent -= 1 + logger.info(''.join(leave)) + finally: + tls.tracing = False + return result + # wrapper end + + result = None + rewrap = lambda x: x + # Unwrap already wrapped functions + # (to be rewrapped again later) + if type(func) == classmethod: + rewrap = type(func) + # Note: 'func.__func__' only works in Python 3 + func = func.__get__(True).__func__ + elif type(func) == staticmethod: + rewrap = type(func) + # Note: 'func.__func__' only works in Python 3 + func = func.__get__(True) + elif type(func) == property: + raise NotImplementedError + + spec = inspect.getfullargspec(func) + return rewrap(wraps(func)(wrapper)) + + arg0 = len(args) and args[0] or None + # not supported yet... + if recursive: + raise NotImplementedError + if inspect.ismodule(arg0): + for n, f in inspect.getmembers(arg0, inspect.isfunction): + setattr(arg0, n, decorator(f)) + for n, c in inspect.getmembers(arg0, inspect.isclass): + dotrace(c, *args, recursive=recursive) + elif inspect.isclass(arg0): + for n, f in inspect.getmembers(arg0, lambda x: (inspect.isfunction(x) or + inspect.ismethod(x))): + setattr(arg0, n, decorator(f)) + + + if callable(arg0) or type(arg0) in (classmethod, staticmethod): + return decorator(arg0) + elif type(arg0) == property: + # properties combine up to three functions: 'get', 'set', 'del', + # so let's wrap them all. + pget, pset, pdel = None, None, None + if arg0.fget: + pget = decorator(arg0.fget) + if arg0.fset: + pset = decorator(arg0.fset) + if arg0.fdel: + pdel = decorator(arg0.fdel) + return property(pget, pset, pdel) + + else: + return decorator + +def notrace(*args, **kwds): + """Just a no-op in case tracing is disabled.""" + def decorator(func): + return func + arg0 = len(args) and args[0] or None + + if callable(arg0) or type(arg0) in (classmethod, staticmethod): + return decorator(arg0) + else: + return decorator + +def doevent(msg): + msg = ['== ', tls.indent * ' ', msg] + logger = logging.getLogger('trace') + logger.info(''.join(msg)) + +def noevent(msg): + pass + +if config.TRACE: + logger = logging.getLogger('trace') + logger.setLevel(logging.INFO) + logger.handlers = [logging.StreamHandler()] + trace = dotrace + event = doevent +else: + trace = notrace + event = noevent diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/transforms.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/transforms.py new file mode 100644 index 0000000000000000000000000000000000000000..fbc6cd6886839832de3a165899dca095fa3169c7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/transforms.py @@ -0,0 +1,913 @@ +""" +Implement transformation on Numba IR +""" + + +from collections import namedtuple, defaultdict +import logging +import operator + +from numba.core.analysis import compute_cfg_from_blocks, find_top_level_loops +from numba.core import errors, ir, ir_utils +from numba.core.analysis import compute_use_defs, compute_cfg_from_blocks +from numba.core.utils import PYVERSION + + +_logger = logging.getLogger(__name__) + + +def _extract_loop_lifting_candidates(cfg, blocks): + """ + Returns a list of loops that are candidate for loop lifting + """ + # check well-formed-ness of the loop + def same_exit_point(loop): + "all exits must point to the same location" + outedges = set() + for k in loop.exits: + succs = set(x for x, _ in cfg.successors(k)) + if not succs: + # If the exit point has no successor, it contains an return + # statement, which is not handled by the looplifting code. + # Thus, this loop is not a candidate. + _logger.debug("return-statement in loop.") + return False + outedges |= succs + ok = len(outedges) == 1 + _logger.debug("same_exit_point=%s (%s)", ok, outedges) + return ok + + def one_entry(loop): + "there is one entry" + ok = len(loop.entries) == 1 + _logger.debug("one_entry=%s", ok) + return ok + + def cannot_yield(loop): + "cannot have yield inside the loop" + insiders = set(loop.body) | set(loop.entries) | set(loop.exits) + for blk in map(blocks.__getitem__, insiders): + for inst in blk.body: + if isinstance(inst, ir.Assign): + if isinstance(inst.value, ir.Yield): + _logger.debug("has yield") + return False + _logger.debug("no yield") + return True + + _logger.info('finding looplift candidates') + # the check for cfg.entry_point in the loop.entries is to prevent a bad + # rewrite where a prelude for a lifted loop would get written into block -1 + # if a loop entry were in block 0 + candidates = [] + for loop in find_top_level_loops(cfg): + _logger.debug("top-level loop: %s", loop) + if (same_exit_point(loop) and one_entry(loop) and cannot_yield(loop) and + cfg.entry_point() not in loop.entries): + candidates.append(loop) + _logger.debug("add candidate: %s", loop) + return candidates + + +def find_region_inout_vars(blocks, livemap, callfrom, returnto, body_block_ids): + """Find input and output variables to a block region. + """ + inputs = livemap[callfrom] + outputs = livemap[returnto] + + # ensure live variables are actually used in the blocks, else remove, + # saves having to create something valid to run through postproc + # to achieve similar + loopblocks = {} + for k in body_block_ids: + loopblocks[k] = blocks[k] + + used_vars = set() + def_vars = set() + defs = compute_use_defs(loopblocks) + for vs in defs.usemap.values(): + used_vars |= vs + for vs in defs.defmap.values(): + def_vars |= vs + used_or_defined = used_vars | def_vars + + # note: sorted for stable ordering + inputs = sorted(set(inputs) & used_or_defined) + outputs = sorted(set(outputs) & used_or_defined & def_vars) + return inputs, outputs + + +_loop_lift_info = namedtuple('loop_lift_info', + 'loop,inputs,outputs,callfrom,returnto') + + +def _loop_lift_get_candidate_infos(cfg, blocks, livemap): + """ + Returns information on looplifting candidates. + """ + loops = _extract_loop_lifting_candidates(cfg, blocks) + loopinfos = [] + for loop in loops: + + [callfrom] = loop.entries # requirement checked earlier + an_exit = next(iter(loop.exits)) # anyone of the exit block + if len(loop.exits) > 1: + # has multiple exits + [(returnto, _)] = cfg.successors(an_exit) # requirement checked earlier + else: + # does not have multiple exits + returnto = an_exit + + local_block_ids = set(loop.body) | set(loop.entries) | set(loop.exits) + inputs, outputs = find_region_inout_vars( + blocks=blocks, + livemap=livemap, + callfrom=callfrom, + returnto=returnto, + body_block_ids=local_block_ids, + ) + + lli = _loop_lift_info(loop=loop, inputs=inputs, outputs=outputs, + callfrom=callfrom, returnto=returnto) + loopinfos.append(lli) + + return loopinfos + + +def _loop_lift_modify_call_block(liftedloop, block, inputs, outputs, returnto): + """ + Transform calling block from top-level function to call the lifted loop. + """ + scope = block.scope + loc = block.loc + blk = ir.Block(scope=scope, loc=loc) + + ir_utils.fill_block_with_call( + newblock=blk, + callee=liftedloop, + label_next=returnto, + inputs=inputs, + outputs=outputs, + ) + return blk + + +def _loop_lift_prepare_loop_func(loopinfo, blocks): + """ + Inplace transform loop blocks for use as lifted loop. + """ + entry_block = blocks[loopinfo.callfrom] + scope = entry_block.scope + loc = entry_block.loc + + # Lowering assumes the first block to be the one with the smallest offset + firstblk = min(blocks) - 1 + blocks[firstblk] = ir_utils.fill_callee_prologue( + block=ir.Block(scope=scope, loc=loc), + inputs=loopinfo.inputs, + label_next=loopinfo.callfrom, + ) + blocks[loopinfo.returnto] = ir_utils.fill_callee_epilogue( + block=ir.Block(scope=scope, loc=loc), + outputs=loopinfo.outputs, + ) + + +def _loop_lift_modify_blocks(func_ir, loopinfo, blocks, + typingctx, targetctx, flags, locals): + """ + Modify the block inplace to call to the lifted-loop. + Returns a dictionary of blocks of the lifted-loop. + """ + from numba.core.dispatcher import LiftedLoop + + # Copy loop blocks + loop = loopinfo.loop + + loopblockkeys = set(loop.body) | set(loop.entries) + if len(loop.exits) > 1: + # has multiple exits + loopblockkeys |= loop.exits + loopblocks = dict((k, blocks[k].copy()) for k in loopblockkeys) + # Modify the loop blocks + _loop_lift_prepare_loop_func(loopinfo, loopblocks) + # Since Python 3.13, [END_FOR, POP_TOP] sequence becomes the start of the + # block causing the block to have line number of the start of previous loop. + # Fix this using the loc of the first getiter. + getiter_exprs = [] + for blk in loopblocks.values(): + getiter_exprs.extend(blk.find_exprs(op="getiter")) + first_getiter = min(getiter_exprs, key=lambda x: x.loc.line) + loop_loc = first_getiter.loc + # Create a new IR for the lifted loop + lifted_ir = func_ir.derive(blocks=loopblocks, + arg_names=tuple(loopinfo.inputs), + arg_count=len(loopinfo.inputs), + force_non_generator=True, + loc=loop_loc) + liftedloop = LiftedLoop(lifted_ir, + typingctx, targetctx, flags, locals) + + # modify for calling into liftedloop + callblock = _loop_lift_modify_call_block(liftedloop, blocks[loopinfo.callfrom], + loopinfo.inputs, loopinfo.outputs, + loopinfo.returnto) + # remove blocks + for k in loopblockkeys: + del blocks[k] + # update main interpreter callsite into the liftedloop + blocks[loopinfo.callfrom] = callblock + return liftedloop + + +def _has_multiple_loop_exits(cfg, lpinfo): + """Returns True if there is more than one exit in the loop. + + NOTE: "common exits" refers to the situation where a loop exit has another + loop exit as its successor. In that case, we do not need to alter it. + """ + if len(lpinfo.exits) <= 1: + return False + exits = set(lpinfo.exits) + pdom = cfg.post_dominators() + + # Eliminate blocks that have other blocks as post-dominators. + processed = set() + remain = set(exits) # create a copy to work on + while remain: + node = remain.pop() + processed.add(node) + exits -= pdom[node] - {node} + remain = exits - processed + + return len(exits) > 1 + + +def _pre_looplift_transform(func_ir): + """Canonicalize loops for looplifting. + """ + from numba.core.postproc import PostProcessor + + cfg = compute_cfg_from_blocks(func_ir.blocks) + # For every loop that has multiple exits, combine the exits into one. + for loop_info in cfg.loops().values(): + if _has_multiple_loop_exits(cfg, loop_info): + func_ir, _common_key = _fix_multi_exit_blocks( + func_ir, loop_info.exits + ) + # Reset and reprocess the func_ir + func_ir._reset_analysis_variables() + PostProcessor(func_ir).run() + return func_ir + + +def loop_lifting(func_ir, typingctx, targetctx, flags, locals): + """ + Loop lifting transformation. + + Given a interpreter `func_ir` returns a 2 tuple of + `(toplevel_interp, [loop0_interp, loop1_interp, ....])` + """ + func_ir = _pre_looplift_transform(func_ir) + blocks = func_ir.blocks.copy() + cfg = compute_cfg_from_blocks(blocks) + loopinfos = _loop_lift_get_candidate_infos(cfg, blocks, + func_ir.variable_lifetime.livemap) + loops = [] + if loopinfos: + _logger.debug('loop lifting this IR with %d candidates:\n%s', + len(loopinfos), func_ir.dump_to_string()) + for loopinfo in loopinfos: + lifted = _loop_lift_modify_blocks(func_ir, loopinfo, blocks, + typingctx, targetctx, flags, locals) + loops.append(lifted) + + # Make main IR + main = func_ir.derive(blocks=blocks) + + return main, loops + + +def canonicalize_cfg_single_backedge(blocks): + """ + Rewrite loops that have multiple backedges. + """ + cfg = compute_cfg_from_blocks(blocks) + newblocks = blocks.copy() + + def new_block_id(): + return max(newblocks.keys()) + 1 + + def has_multiple_backedges(loop): + count = 0 + for k in loop.body: + blk = blocks[k] + edges = blk.terminator.get_targets() + # is a backedge? + if loop.header in edges: + count += 1 + if count > 1: + # early exit + return True + return False + + def yield_loops_with_multiple_backedges(): + for lp in cfg.loops().values(): + if has_multiple_backedges(lp): + yield lp + + def replace_target(term, src, dst): + def replace(target): + return (dst if target == src else target) + + if isinstance(term, ir.Branch): + return ir.Branch(cond=term.cond, + truebr=replace(term.truebr), + falsebr=replace(term.falsebr), + loc=term.loc) + elif isinstance(term, ir.Jump): + return ir.Jump(target=replace(term.target), loc=term.loc) + else: + assert not term.get_targets() + return term + + def rewrite_single_backedge(loop): + """ + Add new tail block that gathers all the backedges + """ + header = loop.header + tailkey = new_block_id() + for blkkey in loop.body: + blk = newblocks[blkkey] + if header in blk.terminator.get_targets(): + newblk = blk.copy() + # rewrite backedge into jumps to new tail block + newblk.body[-1] = replace_target(blk.terminator, header, + tailkey) + newblocks[blkkey] = newblk + # create new tail block + entryblk = newblocks[header] + tailblk = ir.Block(scope=entryblk.scope, loc=entryblk.loc) + # add backedge + tailblk.append(ir.Jump(target=header, loc=tailblk.loc)) + newblocks[tailkey] = tailblk + + for loop in yield_loops_with_multiple_backedges(): + rewrite_single_backedge(loop) + + return newblocks + + +def canonicalize_cfg(blocks): + """ + Rewrite the given blocks to canonicalize the CFG. + Returns a new dictionary of blocks. + """ + return canonicalize_cfg_single_backedge(blocks) + + +def with_lifting(func_ir, typingctx, targetctx, flags, locals): + """With-lifting transformation + + Rewrite the IR to extract all withs. + Only the top-level withs are extracted. + Returns the (the_new_ir, the_lifted_with_ir) + """ + from numba.core import postproc + + def dispatcher_factory(func_ir, objectmode=False, **kwargs): + from numba.core.dispatcher import LiftedWith, ObjModeLiftedWith + + myflags = flags.copy() + if objectmode: + # Lifted with-block cannot looplift + myflags.enable_looplift = False + # Lifted with-block uses object mode + myflags.enable_pyobject = True + myflags.force_pyobject = True + myflags.no_cpython_wrapper = False + cls = ObjModeLiftedWith + else: + cls = LiftedWith + return cls(func_ir, typingctx, targetctx, myflags, locals, **kwargs) + + # find where with-contexts regions are + withs, func_ir = find_setupwiths(func_ir) + + if not withs: + return func_ir, [] + + postproc.PostProcessor(func_ir).run() # ensure we have variable lifetime + assert func_ir.variable_lifetime + vlt = func_ir.variable_lifetime + blocks = func_ir.blocks.copy() + cfg = vlt.cfg + # For each with-regions, mutate them according to + # the kind of contextmanager + sub_irs = [] + for (blk_start, blk_end) in withs: + body_blocks = [] + for node in _cfg_nodes_in_region(cfg, blk_start, blk_end): + body_blocks.append(node) + _legalize_with_head(blocks[blk_start]) + # Find the contextmanager + cmkind, extra = _get_with_contextmanager(func_ir, blocks, blk_start) + # Mutate the body and get new IR + sub = cmkind.mutate_with_body(func_ir, blocks, blk_start, blk_end, + body_blocks, dispatcher_factory, + extra) + sub_irs.append(sub) + if not sub_irs: + # Unchanged + new_ir = func_ir + else: + new_ir = func_ir.derive(blocks) + return new_ir, sub_irs + + +def _get_with_contextmanager(func_ir, blocks, blk_start): + """Get the global object used for the context manager + """ + _illegal_cm_msg = "Illegal use of context-manager." + + def get_var_dfn(var): + """Get the definition given a variable""" + return func_ir.get_definition(var) + + def get_ctxmgr_obj(var_ref): + """Return the context-manager object and extra info. + + The extra contains the arguments if the context-manager is used + as a call. + """ + # If the contextmanager used as a Call + dfn = func_ir.get_definition(var_ref) + if isinstance(dfn, ir.Expr) and dfn.op == 'call': + args = [get_var_dfn(x) for x in dfn.args] + kws = {k: get_var_dfn(v) for k, v in dfn.kws} + extra = {'args': args, 'kwargs': kws} + var_ref = dfn.func + else: + extra = None + + ctxobj = ir_utils.guard(ir_utils.find_outer_value, func_ir, var_ref) + + # check the contextmanager object + if ctxobj is ir.UNDEFINED: + raise errors.CompilerError( + "Undefined variable used as context manager", + loc=blocks[blk_start].loc, + ) + + if ctxobj is None: + raise errors.CompilerError(_illegal_cm_msg, loc=dfn.loc) + + return ctxobj, extra + + # Scan the start of the with-region for the contextmanager + for stmt in blocks[blk_start].body: + if isinstance(stmt, ir.EnterWith): + var_ref = stmt.contextmanager + ctxobj, extra = get_ctxmgr_obj(var_ref) + if not hasattr(ctxobj, 'mutate_with_body'): + raise errors.CompilerError( + "Unsupported context manager in use", + loc=blocks[blk_start].loc, + ) + return ctxobj, extra + # No contextmanager found? + raise errors.CompilerError( + "malformed with-context usage", + loc=blocks[blk_start].loc, + ) + + +def _legalize_with_head(blk): + """Given *blk*, the head block of the with-context, check that it doesn't + do anything else. + """ + counters = defaultdict(int) + for stmt in blk.body: + counters[type(stmt)] += 1 + if counters.pop(ir.EnterWith) != 1: + raise errors.CompilerError( + "with's head-block must have exactly 1 ENTER_WITH", + loc=blk.loc, + ) + if counters.pop(ir.Jump, 0) != 1: + raise errors.CompilerError( + "with's head-block must have exactly 1 JUMP", + loc=blk.loc, + ) + # Can have any number of del + counters.pop(ir.Del, None) + # There MUST NOT be any other statements + if counters: + raise errors.CompilerError( + "illegal statements in with's head-block", + loc=blk.loc, + ) + + +def _cfg_nodes_in_region(cfg, region_begin, region_end): + """Find the set of CFG nodes that are in the given region + """ + region_nodes = set() + stack = [region_begin] + while stack: + tos = stack.pop() + succlist = list(cfg.successors(tos)) + # a single block function will have a empty successor list + if succlist: + succs, _ = zip(*succlist) + nodes = set([node for node in succs + if node not in region_nodes and + node != region_end]) + stack.extend(nodes) + region_nodes |= nodes + + return region_nodes + + +def find_setupwiths(func_ir): + """Find all top-level with. + + Returns a list of ranges for the with-regions. + """ + def find_ranges(blocks): + + cfg = compute_cfg_from_blocks(blocks) + sus_setups, sus_pops = set(), set() + # traverse the cfg and collect all suspected SETUP_WITH and POP_BLOCK + # statements so that we can iterate over them + for label, block in blocks.items(): + for stmt in block.body: + if ir_utils.is_setup_with(stmt): + sus_setups.add(label) + if ir_utils.is_pop_block(stmt): + sus_pops.add(label) + + # now that we do have the statements, iterate through them in reverse + # topo order and from each start looking for pop_blocks + setup_with_to_pop_blocks_map = defaultdict(set) + for setup_block in cfg.topo_sort(sus_setups, reverse=True): + # begin pop_block, search + to_visit, seen = [], [] + to_visit.append(setup_block) + while to_visit: + # get whatever is next and record that we have seen it + block = to_visit.pop() + seen.append(block) + # go through the body of the block, looking for statements + for stmt in blocks[block].body: + # raise detected before pop_block + if ir_utils.is_raise(stmt): + raise errors.CompilerError( + 'unsupported control flow due to raise ' + 'statements inside with block' + ) + # if a pop_block, process it + if ir_utils.is_pop_block(stmt) and block in sus_pops: + # record the jump target of this block belonging to this setup + setup_with_to_pop_blocks_map[setup_block].add(block) + # remove the block from blocks to be matched + sus_pops.remove(block) + # stop looking, we have reached the frontier + break + # if we are still here, by the block terminator, + # add all its targets to the to_visit stack, unless we + # have seen them already + if ir_utils.is_terminator(stmt): + for t in stmt.get_targets(): + if t not in seen: + to_visit.append(t) + + return setup_with_to_pop_blocks_map + + blocks = func_ir.blocks + # initial find, will return a dictionary, mapping indices of blocks + # containing SETUP_WITH statements to a set of indices of blocks containing + # POP_BLOCK statements + with_ranges_dict = find_ranges(blocks) + # rewrite the CFG in case there are multiple POP_BLOCK statements for one + # with + func_ir = consolidate_multi_exit_withs(with_ranges_dict, blocks, func_ir) + # here we need to turn the withs back into a list of tuples so that the + # rest of the code can cope + with_ranges_tuple = [(s, list(p)[0]) + for (s, p) in with_ranges_dict.items()] + + # check for POP_BLOCKS with multiple outgoing edges and reject + for (_, p) in with_ranges_tuple: + targets = blocks[p].terminator.get_targets() + if len(targets) != 1: + raise errors.CompilerError( + "unsupported control flow: with-context contains branches " + "(i.e. break/return/raise) that can leave the block " + ) + # now we check for returns inside with and reject them + for (_, p) in with_ranges_tuple: + target_block = blocks[p] + if ir_utils.is_return(func_ir.blocks[ + target_block.terminator.get_targets()[0]].terminator): + _rewrite_return(func_ir, p) + + # now we need to rewrite the tuple such that we have SETUP_WITH matching the + # successor of the block that contains the POP_BLOCK. + with_ranges_tuple = [(s, func_ir.blocks[p].terminator.get_targets()[0]) + for (s, p) in with_ranges_tuple] + + # finally we check for nested with statements and reject them + with_ranges_tuple = _eliminate_nested_withs(with_ranges_tuple) + + return with_ranges_tuple, func_ir + + +def _rewrite_return(func_ir, target_block_label): + """Rewrite a return block inside a with statement. + + Arguments + --------- + + func_ir: Function IR + the CFG to transform + target_block_label: int + the block index/label of the block containing the POP_BLOCK statement + + + This implements a CFG transformation to insert a block between two other + blocks. + + The input situation is: + + ┌───────────────┐ + │ top │ + │ POP_BLOCK │ + │ bottom │ + └───────┬───────┘ + │ + ┌───────▼───────┐ + │ │ + │ RETURN │ + │ │ + └───────────────┘ + + If such a pattern is detected in IR, it means there is a `return` statement + within a `with` context. The basic idea is to rewrite the CFG as follows: + + ┌───────────────┐ + │ top │ + │ POP_BLOCK │ + │ │ + └───────┬───────┘ + │ + ┌───────▼───────┐ + │ │ + │ bottom │ + │ │ + └───────┬───────┘ + │ + ┌───────▼───────┐ + │ │ + │ RETURN │ + │ │ + └───────────────┘ + + We split the block that contains the `POP_BLOCK` statement into two blocks. + Everything from the beginning of the block up to and including the + `POP_BLOCK` statement is considered the 'top' and everything below is + considered 'bottom'. Finally the jump statements are re-wired to make sure + the CFG remains valid. + + """ + # the block itself from the index + target_block = func_ir.blocks[target_block_label] + # get the index of the block containing the return + target_block_successor_label = target_block.terminator.get_targets()[0] + # the return block + target_block_successor = func_ir.blocks[target_block_successor_label] + + # create the new return block with an appropriate label + max_label = ir_utils.find_max_label(func_ir.blocks) + new_label = max_label + 1 + # create the new return block + new_block_loc = target_block_successor.loc + new_block_scope = ir.Scope(None, loc=new_block_loc) + new_block = ir.Block(new_block_scope, loc=new_block_loc) + + # Split the block containing the POP_BLOCK into top and bottom + # Block must be of the form: + # ----------------- + # + # POP_BLOCK + # + # JUMP + # ----------------- + top_body, bottom_body = [], [] + pop_blocks = [*target_block.find_insts(ir.PopBlock)] + assert len(pop_blocks) == 1 + assert len([*target_block.find_insts(ir.Jump)]) == 1 + assert isinstance(target_block.body[-1], ir.Jump) + pb_marker = pop_blocks[0] + pb_is = target_block.body.index(pb_marker) + top_body.extend(target_block.body[:pb_is]) + top_body.append(ir.Jump(target_block_successor_label, target_block.loc)) + bottom_body.extend(target_block.body[pb_is:-1]) + bottom_body.append(ir.Jump(new_label, target_block.loc)) + + # get the contents of the return block + return_body = func_ir.blocks[target_block_successor_label].body + # finally, re-assign all blocks + new_block.body.extend(return_body) + target_block_successor.body.clear() + target_block_successor.body.extend(bottom_body) + target_block.body.clear() + target_block.body.extend(top_body) + + # finally, append the new return block and rebuild the IR properties + func_ir.blocks[new_label] = new_block + func_ir._definitions = ir_utils.build_definitions(func_ir.blocks) + return func_ir + + +def _eliminate_nested_withs(with_ranges): + known_ranges = [] + def within_known_range(start, end, known_ranges): + for a, b in known_ranges: + # FIXME: this should be a comparison in topological order, right + # now we are comparing the integers of the blocks, stuff probably + # works by accident. + if start > a and end < b: + return True + return False + + for s, e in sorted(with_ranges): + if not within_known_range(s, e, known_ranges): + known_ranges.append((s, e)) + + return known_ranges + +def consolidate_multi_exit_withs(withs: dict, blocks, func_ir): + """Modify the FunctionIR to merge the exit blocks of with constructs. + """ + for k in withs: + vs : set = withs[k] + if len(vs) > 1: + func_ir, common = _fix_multi_exit_blocks( + func_ir, vs, split_condition=ir_utils.is_pop_block, + ) + withs[k] = {common} + return func_ir + + +def _fix_multi_exit_blocks(func_ir, exit_nodes, *, split_condition=None): + """Modify the FunctionIR to create a single common exit node given the + original exit nodes. + + Parameters + ---------- + func_ir : + The FunctionIR. Mutated inplace. + exit_nodes : + The original exit nodes. A sequence of block keys. + split_condition : callable or None + If not None, it is a callable with the signature + `split_condition(statement)` that determines if the `statement` is the + splitting point (e.g. `POP_BLOCK`) in an exit node. + If it's None, the exit node is not split. + """ + + # Convert the following: + # + # | | + # +-------+ +-------+ + # | exit0 | | exit1 | + # +-------+ +-------+ + # | | + # +-------+ +-------+ + # | after0| | after1| + # +-------+ +-------+ + # | | + # + # To roughly: + # + # | | + # +-------+ +-------+ + # | exit0 | | exit1 | + # +-------+ +-------+ + # | | + # +-----+-----+ + # | + # +---------+ + # | common | + # +---------+ + # | + # +-------+ + # | post | + # +-------+ + # | + # +-----+-----+ + # | | + # +-------+ +-------+ + # | after0| | after1| + # +-------+ +-------+ + + blocks = func_ir.blocks + # Getting the scope + any_blk = min(func_ir.blocks.values()) + scope = any_blk.scope + # Getting the maximum block label + max_label = max(func_ir.blocks) + 1 + # Define the new common block for the new exit. + common_block = ir.Block(any_blk.scope, loc=ir.unknown_loc) + common_label = max_label + max_label += 1 + blocks[common_label] = common_block + # Define the new block after the exit. + post_block = ir.Block(any_blk.scope, loc=ir.unknown_loc) + post_label = max_label + max_label += 1 + blocks[post_label] = post_block + + # Adjust each exit node + remainings = [] + for i, k in enumerate(exit_nodes): + blk = blocks[k] + + # split the block if needed + if split_condition is not None: + for pt, stmt in enumerate(blk.body): + if split_condition(stmt): + break + else: + # no splitting + pt = -1 + + before = blk.body[:pt] + after = blk.body[pt:] + remainings.append(after) + + # Add control-point variable to mark which exit block this is. + blk.body = before + loc = blk.loc + blk.body.append( + ir.Assign(value=ir.Const(i, loc=loc), + target=scope.get_or_define("$cp", loc=loc), + loc=loc) + ) + # Replace terminator with a jump to the common block + assert not blk.is_terminated + blk.body.append(ir.Jump(common_label, loc=ir.unknown_loc)) + + if split_condition is not None: + # Move the splitting statement to the common block + common_block.body.append(remainings[0][0]) + assert not common_block.is_terminated + # Append jump from common block to post block + common_block.body.append(ir.Jump(post_label, loc=loc)) + + # Make if-else tree to jump to target + remain_blocks = [] + for remain in remainings: + remain_blocks.append(max_label) + max_label += 1 + + switch_block = post_block + loc = ir.unknown_loc + for i, remain in enumerate(remainings): + match_expr = scope.redefine("$cp_check", loc=loc) + match_rhs = scope.redefine("$cp_rhs", loc=loc) + + # Do comparison to match control-point variable to the exit block + switch_block.body.append( + ir.Assign( + value=ir.Const(i, loc=loc), + target=match_rhs, + loc=loc + ), + ) + + # Add assignment for the comparison + switch_block.body.append( + ir.Assign( + value=ir.Expr.binop( + fn=operator.eq, lhs=scope.get("$cp"), rhs=match_rhs, + loc=loc, + ), + target=match_expr, + loc=loc + ), + ) + + # Insert jump to the next case + [jump_target] = remain[-1].get_targets() + switch_block.body.append( + ir.Branch(match_expr, jump_target, remain_blocks[i], loc=loc), + ) + switch_block = ir.Block(scope=scope, loc=loc) + blocks[remain_blocks[i]] = switch_block + + # Add the final jump + switch_block.body.append(ir.Jump(jump_target, loc=loc)) + + return func_ir, common_label diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/typed_passes.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/typed_passes.py new file mode 100644 index 0000000000000000000000000000000000000000..d981ae409386444562a7b82f1acfcbe2857fb421 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/typed_passes.py @@ -0,0 +1,1039 @@ +import abc +from contextlib import contextmanager +from collections import defaultdict, namedtuple +from functools import partial +from copy import copy +import warnings + +from numba.core import (errors, types, typing, ir, funcdesc, rewrites, + typeinfer, config, lowering) + +from numba.parfors.parfor import PreParforPass as _parfor_PreParforPass +from numba.parfors.parfor import ParforPass as _parfor_ParforPass +from numba.parfors.parfor import ParforFusionPass as _parfor_ParforFusionPass +from numba.parfors.parfor import ParforPreLoweringPass as \ + _parfor_ParforPreLoweringPass +from numba.parfors.parfor import Parfor +from numba.parfors.parfor_lowering import ParforLower + +from numba.core.compiler_machinery import (FunctionPass, LoweringPass, + AnalysisPass, register_pass) +from numba.core.annotations import type_annotations +from numba.core.ir_utils import (raise_on_unsupported_feature, warn_deprecated, + check_and_legalize_ir, guard, + dead_code_elimination, simplify_CFG, + get_definition, + build_definitions, compute_cfg_from_blocks, + is_operator_or_getitem, + replace_vars) +from numba.core import postproc +from llvmlite import binding as llvm + + +# Outputs of type inference pass +_TypingResults = namedtuple("_TypingResults", [ + "typemap", + "return_type", + "calltypes", + "typing_errors", +]) + + +@contextmanager +def fallback_context(state, msg): + """ + Wraps code that would signal a fallback to object mode + """ + try: + yield + except Exception as e: + if not state.status.can_fallback: + raise + else: + # Clear all references attached to the traceback + e = e.with_traceback(None) + # this emits a warning containing the error message body in the + # case of fallback from npm to objmode + loop_lift = '' if state.flags.enable_looplift else 'OUT' + msg_rewrite = ("\nCompilation is falling back to object mode " + "WITH%s looplifting enabled because %s" + % (loop_lift, msg)) + warnings.warn_explicit('%s due to: %s' % (msg_rewrite, e), + errors.NumbaWarning, + state.func_id.filename, + state.func_id.firstlineno) + raise + + +def type_inference_stage(typingctx, targetctx, interp, args, return_type, + locals={}, raise_errors=True): + if len(args) != interp.arg_count: + raise TypeError("Mismatch number of argument types") + warnings = errors.WarningsFixer(errors.NumbaWarning) + + infer = typeinfer.TypeInferer(typingctx, interp, warnings) + callstack_ctx = typingctx.callstack.register(targetctx.target, infer, + interp.func_id, args) + # Setup two contexts: 1) callstack setup/teardown 2) flush warnings + with callstack_ctx, warnings: + # Seed argument types + for index, (name, ty) in enumerate(zip(interp.arg_names, args)): + infer.seed_argument(name, index, ty) + + # Seed return type + if return_type is not None: + infer.seed_return(return_type) + + # Seed local types + for k, v in locals.items(): + infer.seed_type(k, v) + + infer.build_constraint() + # return errors in case of partial typing + errs = infer.propagate(raise_errors=raise_errors) + typemap, restype, calltypes = infer.unify(raise_errors=raise_errors) + + return _TypingResults(typemap, restype, calltypes, errs) + + +class BaseTypeInference(FunctionPass): + _raise_errors = True + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Type inference and legalization + """ + with fallback_context(state, 'Function "%s" failed type inference' + % (state.func_id.func_name,)): + # Type inference + typemap, return_type, calltypes, errs = type_inference_stage( + state.typingctx, + state.targetctx, + state.func_ir, + state.args, + state.return_type, + state.locals, + raise_errors=self._raise_errors) + state.typemap = typemap + # save errors in case of partial typing + state.typing_errors = errs + if self._raise_errors: + state.return_type = return_type + state.calltypes = calltypes + + def legalize_return_type(return_type, interp, targetctx): + """ + Only accept array return type iff it is passed into the function. + Reject function object return types if in nopython mode. + """ + if (not targetctx.enable_nrt and + isinstance(return_type, types.Array)): + # Walk IR to discover all arguments and all return statements + retstmts = [] + caststmts = {} + argvars = set() + for bid, blk in interp.blocks.items(): + for inst in blk.body: + if isinstance(inst, ir.Return): + retstmts.append(inst.value.name) + elif isinstance(inst, ir.Assign): + if (isinstance(inst.value, ir.Expr) + and inst.value.op == 'cast'): + caststmts[inst.target.name] = inst.value + elif isinstance(inst.value, ir.Arg): + argvars.add(inst.target.name) + + assert retstmts, "No return statements?" + + for var in retstmts: + cast = caststmts.get(var) + if cast is None or cast.value.name not in argvars: + if self._raise_errors: + msg = ("Only accept returning of array passed into " + "the function as argument") + raise errors.NumbaTypeError(msg) + + elif (isinstance(return_type, types.Function) or + isinstance(return_type, types.Phantom)): + if self._raise_errors: + msg = "Can't return function object ({}) in nopython mode" + raise errors.NumbaTypeError(msg.format(return_type)) + + with fallback_context(state, 'Function "%s" has invalid return type' + % (state.func_id.func_name,)): + legalize_return_type(state.return_type, state.func_ir, + state.targetctx) + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class NopythonTypeInference(BaseTypeInference): + _name = "nopython_type_inference" + + +@register_pass(mutates_CFG=True, analysis_only=False) +class PartialTypeInference(BaseTypeInference): + _name = "partial_type_inference" + _raise_errors = False + + +@register_pass(mutates_CFG=False, analysis_only=False) +class AnnotateTypes(AnalysisPass): + _name = "annotate_types" + + def __init__(self): + AnalysisPass.__init__(self) + + def get_analysis_usage(self, AU): + AU.add_required(IRLegalization) + + def run_pass(self, state): + """ + Create type annotation after type inference + """ + func_ir = state.func_ir.copy() + state.type_annotation = type_annotations.TypeAnnotation( + func_ir=func_ir, + typemap=state.typemap, + calltypes=state.calltypes, + lifted=state.lifted, + lifted_from=state.lifted_from, + args=state.args, + return_type=state.return_type, + html_output=config.HTML) + + if config.ANNOTATE: + print("ANNOTATION".center(80, '-')) + print(state.type_annotation) + print('=' * 80) + if config.HTML: + with open(config.HTML, 'w') as fout: + state.type_annotation.html_annotate(fout) + + return False + + +@register_pass(mutates_CFG=True, analysis_only=False) +class NopythonRewrites(FunctionPass): + _name = "nopython_rewrites" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Perform any intermediate representation rewrites after type + inference. + """ + # a bunch of these passes are either making assumptions or rely on some + # very picky and slightly bizarre state particularly in relation to + # ir.Del presence. To accommodate, ir.Dels are added ahead of running + # this pass and stripped at the end. + + # Ensure we have an IR and type information. + assert state.func_ir + assert isinstance(getattr(state, 'typemap', None), dict) + assert isinstance(getattr(state, 'calltypes', None), dict) + msg = ('Internal error in post-inference rewriting ' + 'pass encountered during compilation of ' + 'function "%s"' % (state.func_id.func_name,)) + + pp = postproc.PostProcessor(state.func_ir) + pp.run(True) + with fallback_context(state, msg): + rewrites.rewrite_registry.apply('after-inference', state) + pp.remove_dels() + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class PreParforPass(FunctionPass): + + _name = "pre_parfor_pass" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Preprocessing for data-parallel computations. + """ + # Ensure we have an IR and type information. + assert state.func_ir + preparfor_pass = _parfor_PreParforPass( + state.func_ir, + state.typemap, + state.calltypes, + state.typingctx, + state.targetctx, + state.flags.auto_parallel, + state.parfor_diagnostics.replaced_fns + ) + + preparfor_pass.run() + return True + + +# this is here so it pickles and for no other reason +def _reload_parfors(): + """Reloader for cached parfors + """ + # Re-initialize the parallel backend when load from cache. + from numba.np.ufunc.parallel import _launch_threads + _launch_threads() + + +@register_pass(mutates_CFG=True, analysis_only=False) +class ParforPass(FunctionPass): + + _name = "parfor_pass" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Convert data-parallel computations into Parfor nodes + """ + # Ensure we have an IR and type information. + assert state.func_ir + parfor_pass = _parfor_ParforPass(state.func_ir, + state.typemap, + state.calltypes, + state.return_type, + state.typingctx, + state.targetctx, + state.flags.auto_parallel, + state.flags, + state.metadata, + state.parfor_diagnostics) + parfor_pass.run() + + # check the parfor pass worked and warn if it didn't + has_parfor = False + for blk in state.func_ir.blocks.values(): + for stmnt in blk.body: + if isinstance(stmnt, Parfor): + has_parfor = True + break + else: + continue + break + + if not has_parfor: + # parfor calls the compiler chain again with a string + if not (config.DISABLE_PERFORMANCE_WARNINGS or + state.func_ir.loc.filename == ''): + url = ("https://numba.readthedocs.io/en/stable/user/" + "parallel.html#diagnostics") + msg = ("\nThe keyword argument 'parallel=True' was specified " + "but no transformation for parallel execution was " + "possible.\n\nTo find out why, try turning on parallel " + "diagnostics, see %s for help." % url) + warnings.warn(errors.NumbaPerformanceWarning(msg, + state.func_ir.loc)) + + # Add reload function to initialize the parallel backend. + state.reload_init.append(_reload_parfors) + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class ParforFusionPass(FunctionPass): + + _name = "parfor_fusion_pass" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Do fusion of parfor nodes. + """ + # Ensure we have an IR and type information. + assert state.func_ir + parfor_pass = _parfor_ParforFusionPass(state.func_ir, + state.typemap, + state.calltypes, + state.return_type, + state.typingctx, + state.targetctx, + state.flags.auto_parallel, + state.flags, + state.metadata, + state.parfor_diagnostics) + parfor_pass.run() + + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class ParforPreLoweringPass(FunctionPass): + + _name = "parfor_prelowering_pass" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Prepare parfors for lowering. + """ + # Ensure we have an IR and type information. + assert state.func_ir + parfor_pass = _parfor_ParforPreLoweringPass(state.func_ir, + state.typemap, + state.calltypes, + state.return_type, + state.typingctx, + state.targetctx, + state.flags.auto_parallel, + state.flags, + state.metadata, + state.parfor_diagnostics) + parfor_pass.run() + + return True + + +@register_pass(mutates_CFG=False, analysis_only=True) +class DumpParforDiagnostics(AnalysisPass): + + _name = "dump_parfor_diagnostics" + + def __init__(self): + AnalysisPass.__init__(self) + + def run_pass(self, state): + if state.flags.auto_parallel.enabled: + if config.PARALLEL_DIAGNOSTICS: + if state.parfor_diagnostics is not None: + state.parfor_diagnostics.dump(config.PARALLEL_DIAGNOSTICS) + else: + raise RuntimeError("Diagnostics failed.") + return True + + +class BaseNativeLowering(abc.ABC, LoweringPass): + """The base class for a lowering pass. The lowering functionality must be + specified in inheriting classes by providing an appropriate lowering class + implementation in the overridden `lowering_class` property.""" + + _name = None + + def __init__(self): + LoweringPass.__init__(self) + + @property + @abc.abstractmethod + def lowering_class(self): + """Returns the class that performs the lowering of the IR describing the + function that is the target of the current compilation.""" + pass + + def run_pass(self, state): + if state.library is None: + codegen = state.targetctx.codegen() + state.library = codegen.create_library(state.func_id.func_qualname) + # Enable object caching upfront, so that the library can + # be later serialized. + state.library.enable_object_caching() + + library = state.library + targetctx = state.targetctx + interp = state.func_ir # why is it called this?! + typemap = state.typemap + restype = state.return_type + calltypes = state.calltypes + flags = state.flags + metadata = state.metadata + pre_stats = llvm.passmanagers.dump_refprune_stats() + + msg = ("Function %s failed at nopython " + "mode lowering" % (state.func_id.func_name,)) + with fallback_context(state, msg): + # Lowering + fndesc = \ + funcdesc.PythonFunctionDescriptor.from_specialized_function( + interp, typemap, restype, calltypes, + mangler=targetctx.mangler, inline=flags.forceinline, + noalias=flags.noalias, abi_tags=[flags.get_mangle_string()]) + + with targetctx.push_code_library(library): + lower = self.lowering_class(targetctx, library, fndesc, interp, + metadata=metadata) + lower.lower() + if not flags.no_cpython_wrapper: + lower.create_cpython_wrapper(flags.release_gil) + + if not flags.no_cfunc_wrapper: + # skip cfunc wrapper generation if unsupported + # argument or return types are used + for t in state.args: + if isinstance(t, (types.Omitted, types.Generator)): + break + else: + if isinstance(restype, + (types.Optional, types.Generator)): + pass + else: + lower.create_cfunc_wrapper() + + env = lower.env + call_helper = lower.call_helper + del lower + + from numba.core.compiler import _LowerResult # TODO: move this + if flags.no_compile: + state['cr'] = _LowerResult(fndesc, call_helper, + cfunc=None, env=env) + else: + # Prepare for execution + # Insert native function for use by other jitted-functions. + # We also register its library to allow for inlining. + cfunc = targetctx.get_executable(library, fndesc, env) + targetctx.insert_user_function(cfunc, fndesc, [library]) + state['cr'] = _LowerResult(fndesc, call_helper, + cfunc=cfunc, env=env) + + # capture pruning stats + post_stats = llvm.passmanagers.dump_refprune_stats() + metadata['prune_stats'] = post_stats - pre_stats + + # Save the LLVM pass timings + metadata['llvm_pass_timings'] = library.recorded_timings + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class NativeLowering(BaseNativeLowering): + """Lowering pass for a native function IR described solely in terms of + Numba's standard `numba.core.ir` nodes.""" + _name = "native_lowering" + + @property + def lowering_class(self): + return lowering.Lower + + +@register_pass(mutates_CFG=True, analysis_only=False) +class NativeParforLowering(BaseNativeLowering): + """Lowering pass for a native function IR described using Numba's standard + `numba.core.ir` nodes and also parfor.Parfor nodes.""" + _name = "native_parfor_lowering" + + @property + def lowering_class(self): + return ParforLower + + +@register_pass(mutates_CFG=False, analysis_only=True) +class NoPythonSupportedFeatureValidation(AnalysisPass): + """NoPython Mode check: Validates the IR to ensure that features in use are + in a form that is supported""" + + _name = "nopython_supported_feature_validation" + + def __init__(self): + AnalysisPass.__init__(self) + + def run_pass(self, state): + raise_on_unsupported_feature(state.func_ir, state.typemap) + warn_deprecated(state.func_ir, state.typemap) + return False + + +@register_pass(mutates_CFG=False, analysis_only=True) +class IRLegalization(AnalysisPass): + + _name = "ir_legalization" + + def __init__(self): + AnalysisPass.__init__(self) + + def run_pass(self, state): + # NOTE: this function call must go last, it checks and fixes invalid IR! + check_and_legalize_ir(state.func_ir, flags=state.flags) + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class NoPythonBackend(LoweringPass): + + _name = "nopython_backend" + + def __init__(self): + LoweringPass.__init__(self) + + def run_pass(self, state): + """ + Back-end: Generate LLVM IR from Numba IR, compile to machine code + """ + lowered = state['cr'] + signature = typing.signature(state.return_type, *state.args) + + from numba.core.compiler import compile_result + state.cr = compile_result( + typing_context=state.typingctx, + target_context=state.targetctx, + entry_point=lowered.cfunc, + typing_error=state.status.fail_reason, + type_annotation=state.type_annotation, + library=state.library, + call_helper=lowered.call_helper, + signature=signature, + objectmode=False, + lifted=state.lifted, + fndesc=lowered.fndesc, + environment=lowered.env, + metadata=state.metadata, + reload_init=state.reload_init, + ) + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class InlineOverloads(FunctionPass): + """ + This pass will inline a function wrapped by the numba.extending.overload + decorator directly into the site of its call depending on the value set in + the 'inline' kwarg to the decorator. + + This is a typed pass. CFG simplification and DCE are performed on + completion. + """ + + _name = "inline_overloads" + + def __init__(self): + FunctionPass.__init__(self) + + _DEBUG = False + + def run_pass(self, state): + """Run inlining of overloads + """ + if self._DEBUG: + print('before overload inline'.center(80, '-')) + print(state.func_id.unique_name) + print(state.func_ir.dump()) + print(''.center(80, '-')) + from numba.core.inline_closurecall import (InlineWorker, + callee_ir_validator) + inline_worker = InlineWorker(state.typingctx, + state.targetctx, + state.locals, + state.pipeline, + state.flags, + callee_ir_validator, + state.typemap, + state.calltypes, + ) + modified = False + work_list = list(state.func_ir.blocks.items()) + # use a work list, look for call sites via `ir.Expr.op == call` and + # then pass these to `self._do_work` to make decisions about inlining. + while work_list: + label, block = work_list.pop() + for i, instr in enumerate(block.body): + # TO-DO: other statements (setitem) + if isinstance(instr, ir.Assign): + expr = instr.value + if isinstance(expr, ir.Expr): + workfn = self._do_work_expr + + if guard(workfn, state, work_list, block, i, expr, + inline_worker): + modified = True + break # because block structure changed + + if self._DEBUG: + print('after overload inline'.center(80, '-')) + print(state.func_id.unique_name) + print(state.func_ir.dump()) + print(''.center(80, '-')) + + if modified: + # Remove dead blocks, this is safe as it relies on the CFG only. + cfg = compute_cfg_from_blocks(state.func_ir.blocks) + for dead in cfg.dead_nodes(): + del state.func_ir.blocks[dead] + # clean up blocks + dead_code_elimination(state.func_ir, + typemap=state.typemap) + # clean up unconditional branches that appear due to inlined + # functions introducing blocks + state.func_ir.blocks = simplify_CFG(state.func_ir.blocks) + + if self._DEBUG: + print('after overload inline DCE'.center(80, '-')) + print(state.func_id.unique_name) + print(state.func_ir.dump()) + print(''.center(80, '-')) + return True + + def _get_attr_info(self, state, expr): + recv_type = state.typemap[expr.value.name] + recv_type = types.unliteral(recv_type) + matched = state.typingctx.find_matching_getattr_template( + recv_type, expr.attr, + ) + if not matched: + return None + + template = matched['template'] + if getattr(template, 'is_method', False): + # The attribute template is representing a method. + # Don't inline the getattr. + return None + + templates = [template] + sig = typing.signature(matched['return_type'], recv_type) + arg_typs = sig.args + is_method = False + + return templates, sig, arg_typs, is_method + + def _get_callable_info(self, state, expr): + + def get_func_type(state, expr): + func_ty = None + if expr.op == 'call': + # check this is a known and typed function + try: + func_ty = state.typemap[expr.func.name] + except KeyError: + # e.g. Calls to CUDA Intrinsic have no mapped type + # so KeyError + return None + if not hasattr(func_ty, 'get_call_type'): + return None + + elif is_operator_or_getitem(expr): + func_ty = state.typingctx.resolve_value_type(expr.fn) + else: + return None + + return func_ty + + if expr.op == 'call': + # try and get a definition for the call, this isn't always + # possible as it might be a eval(str)/part generated + # awaiting update etc. (parfors) + to_inline = None + try: + to_inline = state.func_ir.get_definition(expr.func) + except Exception: + return None + + # do not handle closure inlining here, another pass deals with that + if getattr(to_inline, 'op', False) == 'make_function': + return None + + func_ty = get_func_type(state, expr) + if func_ty is None: + return None + + sig = state.calltypes[expr] + if not sig: + return None + + templates, arg_typs, is_method = None, None, False + if getattr(func_ty, 'template', None) is not None: + # @overload_method + is_method = True + templates = [func_ty.template] + arg_typs = (func_ty.template.this,) + sig.args + else: + # @overload case + templates = getattr(func_ty, 'templates', None) + arg_typs = sig.args + + return templates, sig, arg_typs, is_method + + def _do_work_expr(self, state, work_list, block, i, expr, inline_worker): + + def select_template(templates, args): + if templates is None: + return None + + impl = None + for template in templates: + inline_type = getattr(template, '_inline', None) + if inline_type is None: + # inline not defined + continue + if args not in template._inline_overloads: + # skip overloads not matching signature + continue + if not inline_type.is_never_inline: + try: + impl = template._overload_func(*args) + if impl is None: + raise Exception # abort for this template + break + except Exception: + continue + else: + return None + + return template, inline_type, impl + + inlinee_info = None + if expr.op == 'getattr': + inlinee_info = self._get_attr_info(state, expr) + else: + inlinee_info = self._get_callable_info(state, expr) + + if not inlinee_info: + return False + + templates, sig, arg_typs, is_method = inlinee_info + inlinee = select_template(templates, arg_typs) + if inlinee is None: + return False + template, inlinee_type, impl = inlinee + + return self._run_inliner( + state, inlinee_type, sig, template, arg_typs, expr, i, impl, block, + work_list, is_method, inline_worker, + ) + + def _run_inliner( + self, state, inline_type, sig, template, arg_typs, expr, i, impl, block, + work_list, is_method, inline_worker, + ): + + do_inline = True + if not inline_type.is_always_inline: + from numba.core.typing.templates import _inline_info + caller_inline_info = _inline_info(state.func_ir, + state.typemap, + state.calltypes, + sig) + + # must be a cost-model function, run the function + iinfo = template._inline_overloads[arg_typs]['iinfo'] + if inline_type.has_cost_model: + do_inline = inline_type.value(expr, caller_inline_info, iinfo) + else: + assert 'unreachable' + + if do_inline: + if is_method: + if not self._add_method_self_arg(state, expr): + return False + arg_typs = template._inline_overloads[arg_typs]['folded_args'] + iinfo = template._inline_overloads[arg_typs]['iinfo'] + freevars = iinfo.func_ir.func_id.func.__code__.co_freevars + _, _, _, new_blocks = inline_worker.inline_ir(state.func_ir, + block, + i, + iinfo.func_ir, + freevars, + arg_typs=arg_typs) + if work_list is not None: + for blk in new_blocks: + work_list.append(blk) + return True + else: + return False + + def _add_method_self_arg(self, state, expr): + func_def = guard(get_definition, state.func_ir, expr.func) + if func_def is None: + return False + expr.args.insert(0, func_def.value) + return True + + +@register_pass(mutates_CFG=False, analysis_only=False) +class DeadCodeElimination(FunctionPass): + """ + Does dead code elimination + """ + + _name = "dead_code_elimination" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + dead_code_elimination(state.func_ir, state.typemap) + return True + + +@register_pass(mutates_CFG=False, analysis_only=False) +class PreLowerStripPhis(FunctionPass): + """Remove phi nodes (ir.Expr.phi) introduced by SSA. + + This is needed before Lowering because the phi nodes in Numba IR do not + match the semantics of phi nodes in LLVM IR. In Numba IR, phi nodes may + expand into multiple LLVM instructions. + """ + + _name = "strip_phis" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + state.func_ir = self._strip_phi_nodes(state.func_ir) + state.func_ir._definitions = build_definitions(state.func_ir.blocks) + if "flags" in state and state.flags.auto_parallel.enabled: + self._simplify_conditionally_defined_variable(state.func_ir) + state.func_ir._definitions = build_definitions(state.func_ir.blocks) + + # Rerun postprocessor to update metadata + post_proc = postproc.PostProcessor(state.func_ir) + post_proc.run(emit_dels=False) + + # Ensure we are not in objectmode generator + if (state.func_ir.generator_info is not None + and state.typemap is not None): + # Rebuild generator type + # TODO: move this into PostProcessor + gentype = state.return_type + state_vars = state.func_ir.generator_info.state_vars + state_types = [state.typemap[k] for k in state_vars] + state.return_type = types.Generator( + gen_func=gentype.gen_func, + yield_type=gentype.yield_type, + arg_types=gentype.arg_types, + state_types=state_types, + has_finalizer=gentype.has_finalizer, + ) + return True + + def _strip_phi_nodes(self, func_ir): + """Strip Phi nodes from ``func_ir`` + + For each phi node, put incoming value to their respective incoming + basic-block at possibly the latest position (i.e. after the latest + assignment to the corresponding variable). + """ + exporters = defaultdict(list) + phis = set() + # Find all variables that needs to be exported + for label, block in func_ir.blocks.items(): + for assign in block.find_insts(ir.Assign): + if isinstance(assign.value, ir.Expr): + if assign.value.op == 'phi': + phis.add(assign) + phi = assign.value + for ib, iv in zip(phi.incoming_blocks, + phi.incoming_values): + exporters[ib].append((assign.target, iv)) + + # Rewrite the blocks with the new exporting assignments + newblocks = {} + for label, block in func_ir.blocks.items(): + newblk = copy(block) + newblocks[label] = newblk + + # strip phis + newblk.body = [stmt for stmt in block.body if stmt not in phis] + + # insert exporters + for target, rhs in exporters[label]: + # If RHS is undefined + if rhs is ir.UNDEFINED: + # Put in a NULL initializer, set the location to be in what + # will eventually materialize as the prologue. + rhs = ir.Expr.null(loc=func_ir.loc) + + assign = ir.Assign( + target=target, + value=rhs, + loc=rhs.loc + ) + # Insert at the earliest possible location; i.e. after the + # last assignment to rhs + assignments = [stmt for stmt in newblk.find_insts(ir.Assign) + if stmt.target == rhs] + if assignments: + last_assignment = assignments[-1] + newblk.insert_after(assign, last_assignment) + else: + newblk.prepend(assign) + + func_ir.blocks = newblocks + return func_ir + + def _simplify_conditionally_defined_variable(self, func_ir): + """ + Rewrite assignments like: + + ver1 = null() + ... + ver1 = ver + ... + uses(ver1) + + into: + # delete all assignments to ver1 + uses(ver) + + This is only needed for parfors because the SSA pass will create extra + variable assignments that the parfor code does not expect. + This pass helps avoid problems by reverting the effect of SSA. + """ + any_block = next(iter(func_ir.blocks.values())) + scope = any_block.scope + defs = func_ir._definitions + + def unver_or_undef(unver, defn): + # Is the definition undefined or pointing to the unversioned name? + if isinstance(defn, ir.Var): + if defn.unversioned_name == unver: + return True + elif isinstance(defn, ir.Expr): + if defn.op == "null": + return True + return False + + def legalize_all_versioned_names(var): + # Are all versioned names undefined or defined to the same + # variable chain? + if not var.versioned_names: + return False + for versioned in var.versioned_names: + vs = defs.get(versioned, ()) + if not all(map(partial(unver_or_undef, k), vs)): + return False + return True + + # Find unversioned variables that met the conditions + suspects = set() + for k in defs: + try: + # This may fail? + var = scope.get_exact(k) + except errors.NotDefinedError: + continue + # is the var name unversioned? + if var.unversioned_name == k: + if legalize_all_versioned_names(var): + suspects.add(var) + + delete_set = set() + replace_map = {} + for var in suspects: + # rewrite Var uses to the unversioned name + for versioned in var.versioned_names: + ver_var = scope.get_exact(versioned) + # delete assignment to the versioned name + delete_set.add(ver_var) + # replace references to versioned name with the unversioned + replace_map[versioned] = var + + # remove assignments to the versioned names + for _label, blk in func_ir.blocks.items(): + for assign in blk.find_insts(ir.Assign): + if assign.target in delete_set: + blk.remove(assign) + # do variable replacement + replace_vars(func_ir.blocks, replace_map) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/typeinfer.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/typeinfer.py new file mode 100644 index 0000000000000000000000000000000000000000..04b411bace433100ea2ba20abe2f43437bd51745 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/typeinfer.py @@ -0,0 +1,1788 @@ +""" +Type inference base on CPA. +The algorithm guarantees monotonic growth of type-sets for each variable. + +Steps: + 1. seed initial types + 2. build constraints + 3. propagate constraints + 4. unify types + +Constraint propagation is precise and does not regret (no backtracing). +Constraints push types forward following the dataflow. +""" + + +import logging +import operator +import contextlib +import itertools +from pprint import pprint +from collections import OrderedDict, defaultdict +from functools import reduce + +from numba.core import types, utils, typing, ir, config +from numba.core.typing.templates import Signature +from numba.core.errors import (TypingError, UntypedAttributeError, + new_error_context, termcolor, UnsupportedError, + ForceLiteralArg, CompilerError, NumbaValueError) +from numba.core.funcdesc import qualifying_prefix +from numba.core.typeconv import Conversion + +_logger = logging.getLogger(__name__) + + +class NOTSET: + pass + + +# terminal color markup +_termcolor = termcolor() + + +class TypeVar(object): + def __init__(self, context, var): + self.context = context + self.var = var + self.type = None + self.locked = False + # Stores source location of first definition + self.define_loc = None + # Qualifiers + self.literal_value = NOTSET + + def add_type(self, tp, loc): + assert isinstance(tp, types.Type), type(tp) + # Special case for _undef_var. + # If the typevar is the _undef_var, use the incoming type directly. + if self.type is types._undef_var: + self.type = tp + return self.type + + if self.locked: + if tp != self.type: + if self.context.can_convert(tp, self.type) is None: + msg = ("No conversion from %s to %s for '%s', " + "defined at %s") + raise TypingError(msg % (tp, self.type, self.var, + self.define_loc), + loc=loc) + else: + if self.type is not None: + unified = self.context.unify_pairs(self.type, tp) + if unified is None: + msg = "Cannot unify %s and %s for '%s', defined at %s" + raise TypingError(msg % (self.type, tp, self.var, + self.define_loc), + loc=self.define_loc) + else: + # First time definition + unified = tp + self.define_loc = loc + + self.type = unified + + return self.type + + def lock(self, tp, loc, literal_value=NOTSET): + assert isinstance(tp, types.Type), type(tp) + + if self.locked: + msg = ("Invalid reassignment of a type-variable detected, type " + "variables are locked according to the user provided " + "function signature or from an ir.Const node. This is a " + "bug! Type={}. {}").format(tp, self.type) + raise CompilerError(msg, loc) + + # If there is already a type, ensure we can convert it to the + # locked type. + if (self.type is not None and + self.context.can_convert(self.type, tp) is None): + raise TypingError("No conversion from %s to %s for " + "'%s'" % (tp, self.type, self.var), loc=loc) + + self.type = tp + self.locked = True + if self.define_loc is None: + self.define_loc = loc + self.literal_value = literal_value + + def union(self, other, loc): + if other.type is not None: + self.add_type(other.type, loc=loc) + + return self.type + + def __repr__(self): + return '%s := %s' % (self.var, self.type or "") + + @property + def defined(self): + return self.type is not None + + def get(self): + return (self.type,) if self.type is not None else () + + def getone(self): + if self.type is None: + raise TypingError("Undecided type {}".format(self)) + return self.type + + def __len__(self): + return 1 if self.type is not None else 0 + + +class ConstraintNetwork(object): + """ + TODO: It is possible to optimize constraint propagation to consider only + dirty type variables. + """ + + def __init__(self): + self.constraints = [] + + def append(self, constraint): + self.constraints.append(constraint) + + def propagate(self, typeinfer): + """ + Execute all constraints. Errors are caught and returned as a list. + This allows progressing even though some constraints may fail + due to lack of information + (e.g. imprecise types such as List(undefined)). + """ + errors = [] + for constraint in self.constraints: + loc = constraint.loc + with typeinfer.warnings.catch_warnings(filename=loc.filename, + lineno=loc.line): + try: + constraint(typeinfer) + except ForceLiteralArg as e: + errors.append(e) + except TypingError as e: + _logger.debug("captured error", exc_info=e) + new_exc = TypingError( + str(e), loc=constraint.loc, + highlighting=False, + ) + errors.append(utils.chain_exception(new_exc, e)) + + return errors + + +class Propagate(object): + """ + A simple constraint for direct propagation of types for assignments. + """ + + def __init__(self, dst, src, loc): + self.dst = dst + self.src = src + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of assignment at {0}", self.loc, + loc=self.loc): + typeinfer.copy_type(self.src, self.dst, loc=self.loc) + # If `dst` is refined, notify us + typeinfer.refine_map[self.dst] = self + + def refine(self, typeinfer, target_type): + # Do not back-propagate to locked variables (e.g. constants) + assert target_type.is_precise() + typeinfer.add_type(self.src, target_type, unless_locked=True, + loc=self.loc) + + +class ArgConstraint(object): + + def __init__(self, dst, src, loc): + self.dst = dst + self.src = src + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of argument at {0}", self.loc): + typevars = typeinfer.typevars + src = typevars[self.src] + if not src.defined: + return + ty = src.getone() + if isinstance(ty, types.Omitted): + ty = typeinfer.context.resolve_value_type_prefer_literal( + ty.value, + ) + if not ty.is_precise(): + raise TypingError('non-precise type {}'.format(ty)) + typeinfer.add_type(self.dst, ty, loc=self.loc) + + +class BuildTupleConstraint(object): + def __init__(self, target, items, loc): + self.target = target + self.items = items + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of tuple at {0}", self.loc): + typevars = typeinfer.typevars + tsets = [typevars[i.name].get() for i in self.items] + for vals in itertools.product(*tsets): + if vals and all(vals[0] == v for v in vals): + tup = types.UniTuple(dtype=vals[0], count=len(vals)) + else: + # empty tuples fall here as well + tup = types.Tuple(vals) + assert tup.is_precise() + typeinfer.add_type(self.target, tup, loc=self.loc) + + +class _BuildContainerConstraint(object): + + def __init__(self, target, items, loc): + self.target = target + self.items = items + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of {0} at {1}", + self.container_type, self.loc): + typevars = typeinfer.typevars + tsets = [typevars[i.name].get() for i in self.items] + if not tsets: + typeinfer.add_type(self.target, + self.container_type(types.undefined), + loc=self.loc) + else: + for typs in itertools.product(*tsets): + unified = typeinfer.context.unify_types(*typs) + if unified is not None: + typeinfer.add_type(self.target, + self.container_type(unified), + loc=self.loc) + + +class BuildListConstraint(_BuildContainerConstraint): + + def __init__(self, target, items, loc): + self.target = target + self.items = items + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of {0} at {1}", + types.List, self.loc): + typevars = typeinfer.typevars + tsets = [typevars[i.name].get() for i in self.items] + if not tsets: + typeinfer.add_type(self.target, + types.List(types.undefined), + loc=self.loc) + else: + for typs in itertools.product(*tsets): + unified = typeinfer.context.unify_types(*typs) + if unified is not None: + # pull out literals if available + islit = [isinstance(x, types.Literal) for x in typs] + iv = None + if all(islit): + iv = [x.literal_value for x in typs] + typeinfer.add_type(self.target, + types.List(unified, + initial_value=iv), + loc=self.loc) + else: + typeinfer.add_type(self.target, + types.LiteralList(typs), + loc=self.loc) + + +class BuildSetConstraint(_BuildContainerConstraint): + container_type = types.Set + + +class BuildMapConstraint(object): + + def __init__(self, target, items, special_value, value_indexes, loc): + self.target = target + self.items = items + self.special_value = special_value + self.value_indexes = value_indexes + self.loc = loc + + def __call__(self, typeinfer): + + with new_error_context("typing of dict at {0}", self.loc): + typevars = typeinfer.typevars + + # figure out what sort of dict is being dealt with + tsets = [(typevars[k.name].getone(), typevars[v.name].getone()) + for k, v in self.items] + + if not tsets: + typeinfer.add_type(self.target, + types.DictType(types.undefined, + types.undefined, + self.special_value), + loc=self.loc) + else: + # all the info is known about the dict, if its + # str keys -> random heterogeneous values treat as literalstrkey + ktys = [x[0] for x in tsets] + vtys = [x[1] for x in tsets] + strkey = all([isinstance(x, types.StringLiteral) for x in ktys]) + literalvty = all([isinstance(x, types.Literal) for x in vtys]) + vt0 = types.unliteral(vtys[0]) + + # homogeneous values comes in the form of being able to cast + # all the other values in the ctor to the type of the first. + # The order is important as `typed.Dict` takes it's type from + # the first element. + def check(other): + conv = typeinfer.context.can_convert(other, vt0) + return conv is not None and conv < Conversion.unsafe + homogeneous = all([check(types.unliteral(x)) for x in vtys]) + + # Special cases: + # Single key:value in ctor, key is str, value is an otherwise + # illegal container type, e.g. LiteralStrKeyDict or + # List, there's no way to put this into a typed.Dict, so make it + # a LiteralStrKeyDict, same goes for LiteralList. + if len(vtys) == 1: + valty = vtys[0] + if isinstance(valty, (types.LiteralStrKeyDict, + types.List, + types.LiteralList)): + homogeneous = False + + if strkey and not homogeneous: + resolved_dict = {x: y for x, y in zip(ktys, vtys)} + ty = types.LiteralStrKeyDict(resolved_dict, + self.value_indexes) + typeinfer.add_type(self.target, ty, loc=self.loc) + else: + init_value = self.special_value if literalvty else None + key_type, value_type = tsets[0] + typeinfer.add_type(self.target, + types.DictType(key_type, + value_type, + init_value), + loc=self.loc) + + +class ExhaustIterConstraint(object): + def __init__(self, target, count, iterator, loc): + self.target = target + self.count = count + self.iterator = iterator + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of exhaust iter at {0}", self.loc): + typevars = typeinfer.typevars + for tp in typevars[self.iterator.name].get(): + # unpack optional + tp = tp.type if isinstance(tp, types.Optional) else tp + if isinstance(tp, types.BaseTuple): + if len(tp) == self.count: + assert tp.is_precise() + typeinfer.add_type(self.target, tp, loc=self.loc) + break + else: + msg = (f"wrong tuple length for {self.iterator.name}: ", + f"expected {self.count}, got {len(tp)}") + raise NumbaValueError(msg) + elif isinstance(tp, types.IterableType): + tup = types.UniTuple(dtype=tp.iterator_type.yield_type, + count=self.count) + assert tup.is_precise() + typeinfer.add_type(self.target, tup, loc=self.loc) + break + else: + raise TypingError("failed to unpack {}".format(tp), + loc=self.loc) + + +class PairFirstConstraint(object): + def __init__(self, target, pair, loc): + self.target = target + self.pair = pair + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of pair-first at {0}", self.loc): + typevars = typeinfer.typevars + for tp in typevars[self.pair.name].get(): + if not isinstance(tp, types.Pair): + # XXX is this an error? + continue + assert (isinstance(tp.first_type, types.UndefinedFunctionType) + or tp.first_type.is_precise()) + typeinfer.add_type(self.target, tp.first_type, loc=self.loc) + + +class PairSecondConstraint(object): + def __init__(self, target, pair, loc): + self.target = target + self.pair = pair + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of pair-second at {0}", self.loc): + typevars = typeinfer.typevars + for tp in typevars[self.pair.name].get(): + if not isinstance(tp, types.Pair): + # XXX is this an error? + continue + assert tp.second_type.is_precise() + typeinfer.add_type(self.target, tp.second_type, loc=self.loc) + + +class StaticGetItemConstraint(object): + def __init__(self, target, value, index, index_var, loc): + self.target = target + self.value = value + self.index = index + if index_var is not None: + self.fallback = IntrinsicCallConstraint(target, operator.getitem, + (value, index_var), {}, + None, loc) + else: + self.fallback = None + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of static-get-item at {0}", self.loc): + typevars = typeinfer.typevars + for ty in typevars[self.value.name].get(): + sig = typeinfer.context.resolve_static_getitem( + value=ty, index=self.index, + ) + + if sig is not None: + itemty = sig.return_type + # if the itemty is not precise, let it through, unification + # will catch it and produce a better error message + typeinfer.add_type(self.target, itemty, loc=self.loc) + elif self.fallback is not None: + self.fallback(typeinfer) + + def get_call_signature(self): + # The signature is only needed for the fallback case in lowering + return self.fallback and self.fallback.get_call_signature() + + +class TypedGetItemConstraint(object): + def __init__(self, target, value, dtype, index, loc): + self.target = target + self.value = value + self.dtype = dtype + self.index = index + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of typed-get-item at {0}", self.loc): + typevars = typeinfer.typevars + idx_ty = typevars[self.index.name].get() + ty = typevars[self.value.name].get() + self.signature = Signature(self.dtype, ty + idx_ty, None) + typeinfer.add_type(self.target, self.dtype, loc=self.loc) + + def get_call_signature(self): + return self.signature + + +def fold_arg_vars(typevars, args, vararg, kws): + """ + Fold and resolve the argument variables of a function call. + """ + # Fetch all argument types, bail if any is unknown + n_pos_args = len(args) + kwds = [kw for (kw, var) in kws] + argtypes = [typevars[a.name] for a in args] + argtypes += [typevars[var.name] for (kw, var) in kws] + if vararg is not None: + argtypes.append(typevars[vararg.name]) + + if not all(a.defined for a in argtypes): + return + + args = tuple(a.getone() for a in argtypes) + + pos_args = args[:n_pos_args] + if vararg is not None: + errmsg = "*args in function call should be a tuple, got %s" + # Handle constant literal used for `*args` + if isinstance(args[-1], types.Literal): + const_val = args[-1].literal_value + # Is the constant value a tuple? + if not isinstance(const_val, tuple): + raise TypingError(errmsg % (args[-1],)) + # Append the elements in the const tuple to the positional args + pos_args += const_val + # Handle non-constant + elif not isinstance(args[-1], types.BaseTuple): + # Unsuitable for *args + # (Python is more lenient and accepts all iterables) + raise TypingError(errmsg % (args[-1],)) + else: + # Append the elements in the tuple to the positional args + pos_args += args[-1].types + # Drop the last arg + args = args[:-1] + kw_args = dict(zip(kwds, args[n_pos_args:])) + return pos_args, kw_args + + +def _is_array_not_precise(arrty): + """Check type is array and it is not precise + """ + return isinstance(arrty, types.Array) and not arrty.is_precise() + + +class CallConstraint(object): + """Constraint for calling functions. + Perform case analysis foreach combinations of argument types. + """ + signature = None + + def __init__(self, target, func, args, kws, vararg, loc): + self.target = target + self.func = func + self.args = args + self.kws = kws or {} + self.vararg = vararg + self.loc = loc + + def __call__(self, typeinfer): + msg = "typing of call at {0}\n".format(self.loc) + with new_error_context(msg): + typevars = typeinfer.typevars + with new_error_context( + "resolving caller type: {}".format(self.func)): + fnty = typevars[self.func].getone() + with new_error_context("resolving callee type: {0}", fnty): + self.resolve(typeinfer, typevars, fnty) + + def resolve(self, typeinfer, typevars, fnty): + assert fnty + context = typeinfer.context + + r = fold_arg_vars(typevars, self.args, self.vararg, self.kws) + if r is None: + # Cannot resolve call type until all argument types are known + return + pos_args, kw_args = r + + # Check argument to be precise + for a in itertools.chain(pos_args, kw_args.values()): + # Forbids imprecise type except array of undefined dtype + if not a.is_precise() and not isinstance(a, types.Array): + return + + # Resolve call type + if isinstance(fnty, types.TypeRef): + # Unwrap TypeRef + fnty = fnty.instance_type + try: + sig = typeinfer.resolve_call(fnty, pos_args, kw_args) + except ForceLiteralArg as e: + # Adjust for bound methods + folding_args = ((fnty.this,) + tuple(self.args) + if isinstance(fnty, types.BoundFunction) + else self.args) + folded = e.fold_arguments(folding_args, self.kws) + requested = set() + unsatisfied = set() + for idx in e.requested_args: + maybe_arg = typeinfer.func_ir.get_definition(folded[idx]) + if isinstance(maybe_arg, ir.Arg): + requested.add(maybe_arg.index) + else: + unsatisfied.add(idx) + if unsatisfied: + raise TypingError("Cannot request literal type.", loc=self.loc) + elif requested: + raise ForceLiteralArg(requested, loc=self.loc) + if sig is None: + # Note: duplicated error checking. + # See types.BaseFunction.get_call_type + # Arguments are invalid => explain why + headtemp = "Invalid use of {0} with parameters ({1})" + args = [str(a) for a in pos_args] + args += ["%s=%s" % (k, v) for k, v in sorted(kw_args.items())] + head = headtemp.format(fnty, ', '.join(map(str, args))) + desc = context.explain_function_type(fnty) + msg = '\n'.join([head, desc]) + raise TypingError(msg) + + typeinfer.add_type(self.target, sig.return_type, loc=self.loc) + + # If the function is a bound function and its receiver type + # was refined, propagate it. + if (isinstance(fnty, types.BoundFunction) + and sig.recvr is not None + and sig.recvr != fnty.this): + refined_this = context.unify_pairs(sig.recvr, fnty.this) + if (refined_this is None and + fnty.this.is_precise() and + sig.recvr.is_precise()): + msg = "Cannot refine type {} to {}".format( + sig.recvr, fnty.this, + ) + raise TypingError(msg, loc=self.loc) + if refined_this is not None and refined_this.is_precise(): + refined_fnty = fnty.copy(this=refined_this) + typeinfer.propagate_refined_type(self.func, refined_fnty) + + # If the return type is imprecise but can be unified with the + # target variable's inferred type, use the latter. + # Useful for code such as:: + # s = set() + # s.add(1) + # (the set() call must be typed as int64(), not undefined()) + if not sig.return_type.is_precise(): + target = typevars[self.target] + if target.defined: + targetty = target.getone() + if context.unify_pairs(targetty, sig.return_type) == targetty: + sig = sig.replace(return_type=targetty) + + self.signature = sig + self._add_refine_map(typeinfer, typevars, sig) + + def _add_refine_map(self, typeinfer, typevars, sig): + """Add this expression to the refine_map base on the type of target_type + """ + target_type = typevars[self.target].getone() + # Array + if (isinstance(target_type, types.Array) + and isinstance(sig.return_type.dtype, types.Undefined)): + typeinfer.refine_map[self.target] = self + # DictType + if (isinstance(target_type, types.DictType) and + not target_type.is_precise()): + typeinfer.refine_map[self.target] = self + + def refine(self, typeinfer, updated_type): + # Is getitem? + if self.func == operator.getitem: + aryty = typeinfer.typevars[self.args[0].name].getone() + # is array not precise? + if _is_array_not_precise(aryty): + # allow refinement of dtype + assert updated_type.is_precise() + newtype = aryty.copy(dtype=updated_type.dtype) + typeinfer.add_type(self.args[0].name, newtype, loc=self.loc) + else: + m = 'no type refinement implemented for function {} updating to {}' + raise TypingError(m.format(self.func, updated_type)) + + def get_call_signature(self): + return self.signature + + +class IntrinsicCallConstraint(CallConstraint): + def __call__(self, typeinfer): + with new_error_context("typing of intrinsic-call at {0}", self.loc): + fnty = self.func + if fnty in utils.OPERATORS_TO_BUILTINS: + fnty = typeinfer.resolve_value_type(None, fnty) + self.resolve(typeinfer, typeinfer.typevars, fnty=fnty) + + +class GetAttrConstraint(object): + def __init__(self, target, attr, value, loc, inst): + self.target = target + self.attr = attr + self.value = value + self.loc = loc + self.inst = inst + + def __call__(self, typeinfer): + with new_error_context("typing of get attribute at {0}", self.loc): + typevars = typeinfer.typevars + valtys = typevars[self.value.name].get() + for ty in valtys: + attrty = typeinfer.context.resolve_getattr(ty, self.attr) + if attrty is None: + raise UntypedAttributeError(ty, self.attr, + loc=self.inst.loc) + else: + assert attrty.is_precise() + typeinfer.add_type(self.target, attrty, loc=self.loc) + typeinfer.refine_map[self.target] = self + + def refine(self, typeinfer, target_type): + if isinstance(target_type, types.BoundFunction): + recvr = target_type.this + assert recvr.is_precise() + typeinfer.add_type(self.value.name, recvr, loc=self.loc) + source_constraint = typeinfer.refine_map.get(self.value.name) + if source_constraint is not None: + source_constraint.refine(typeinfer, recvr) + + def __repr__(self): + return 'resolving type of attribute "{attr}" of "{value}"'.format( + value=self.value, attr=self.attr) + + +class SetItemRefinement(object): + """A mixin class to provide the common refinement logic in setitem + and static setitem. + """ + + def _refine_target_type(self, typeinfer, targetty, idxty, valty, sig): + """Refine the target-type given the known index type and value type. + """ + # For array setitem, refine imprecise array dtype + if _is_array_not_precise(targetty): + typeinfer.add_type(self.target.name, sig.args[0], loc=self.loc) + # For Dict setitem + if isinstance(targetty, types.DictType): + if not targetty.is_precise(): + refined = targetty.refine(idxty, valty) + typeinfer.add_type( + self.target.name, refined, + loc=self.loc, + ) + elif isinstance(targetty, types.LiteralStrKeyDict): + typeinfer.add_type( + self.target.name, types.DictType(idxty, valty), + loc=self.loc, + ) + + +class SetItemConstraint(SetItemRefinement): + def __init__(self, target, index, value, loc): + self.target = target + self.index = index + self.value = value + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of setitem at {0}", self.loc): + typevars = typeinfer.typevars + if not all(typevars[var.name].defined + for var in (self.target, self.index, self.value)): + return + targetty = typevars[self.target.name].getone() + idxty = typevars[self.index.name].getone() + valty = typevars[self.value.name].getone() + + sig = typeinfer.context.resolve_setitem(targetty, idxty, valty) + if sig is None: + raise TypingError("Cannot resolve setitem: %s[%s] = %s" % + (targetty, idxty, valty), loc=self.loc) + + self.signature = sig + self._refine_target_type(typeinfer, targetty, idxty, valty, sig) + + def get_call_signature(self): + return self.signature + + +class StaticSetItemConstraint(SetItemRefinement): + def __init__(self, target, index, index_var, value, loc): + self.target = target + self.index = index + self.index_var = index_var + self.value = value + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of staticsetitem at {0}", self.loc): + typevars = typeinfer.typevars + if not all(typevars[var.name].defined + for var in (self.target, self.index_var, self.value)): + return + targetty = typevars[self.target.name].getone() + idxty = typevars[self.index_var.name].getone() + valty = typevars[self.value.name].getone() + + sig = typeinfer.context.resolve_static_setitem(targetty, + self.index, valty) + if sig is None: + sig = typeinfer.context.resolve_setitem(targetty, idxty, valty) + if sig is None: + raise TypingError("Cannot resolve setitem: %s[%r] = %s" % + (targetty, self.index, valty), loc=self.loc) + self.signature = sig + self._refine_target_type(typeinfer, targetty, idxty, valty, sig) + + def get_call_signature(self): + return self.signature + + +class DelItemConstraint(object): + def __init__(self, target, index, loc): + self.target = target + self.index = index + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of delitem at {0}", self.loc): + typevars = typeinfer.typevars + if not all(typevars[var.name].defined + for var in (self.target, self.index)): + return + targetty = typevars[self.target.name].getone() + idxty = typevars[self.index.name].getone() + + sig = typeinfer.context.resolve_delitem(targetty, idxty) + if sig is None: + raise TypingError("Cannot resolve delitem: %s[%s]" % + (targetty, idxty), loc=self.loc) + self.signature = sig + + def get_call_signature(self): + return self.signature + + +class SetAttrConstraint(object): + def __init__(self, target, attr, value, loc): + self.target = target + self.attr = attr + self.value = value + self.loc = loc + + def __call__(self, typeinfer): + with new_error_context("typing of set attribute {0!r} at {1}", + self.attr, self.loc): + typevars = typeinfer.typevars + if not all(typevars[var.name].defined + for var in (self.target, self.value)): + return + targetty = typevars[self.target.name].getone() + valty = typevars[self.value.name].getone() + sig = typeinfer.context.resolve_setattr(targetty, self.attr, + valty) + if sig is None: + raise TypingError("Cannot resolve setattr: (%s).%s = %s" % + (targetty, self.attr, valty), + loc=self.loc) + self.signature = sig + + def get_call_signature(self): + return self.signature + + +class PrintConstraint(object): + def __init__(self, args, vararg, loc): + self.args = args + self.vararg = vararg + self.loc = loc + + def __call__(self, typeinfer): + typevars = typeinfer.typevars + + r = fold_arg_vars(typevars, self.args, self.vararg, {}) + if r is None: + # Cannot resolve call type until all argument types are known + return + pos_args, kw_args = r + + fnty = typeinfer.context.resolve_value_type(print) + assert fnty is not None + sig = typeinfer.resolve_call(fnty, pos_args, kw_args) + self.signature = sig + + def get_call_signature(self): + return self.signature + + +class TypeVarMap(dict): + def set_context(self, context): + self.context = context + + def __getitem__(self, name): + if name not in self: + self[name] = TypeVar(self.context, name) + return super(TypeVarMap, self).__getitem__(name) + + def __setitem__(self, name, value): + assert isinstance(name, str) + if name in self: + raise KeyError("Cannot redefine typevar %s" % name) + else: + super(TypeVarMap, self).__setitem__(name, value) + + +# A temporary mapping of {function name: dispatcher object} +_temporary_dispatcher_map = {} +# A temporary mapping of {function name: dispatcher object reference count} +# Reference: https://github.com/numba/numba/issues/3658 +_temporary_dispatcher_map_ref_count = defaultdict(int) + + +@contextlib.contextmanager +def register_dispatcher(disp): + """ + Register a Dispatcher for inference while it is not yet stored + as global or closure variable (e.g. during execution of the @jit() + call). This allows resolution of recursive calls with eager + compilation. + """ + assert callable(disp) + assert callable(disp.py_func) + name = disp.py_func.__name__ + _temporary_dispatcher_map[name] = disp + _temporary_dispatcher_map_ref_count[name] += 1 + try: + yield + finally: + _temporary_dispatcher_map_ref_count[name] -= 1 + if not _temporary_dispatcher_map_ref_count[name]: + del _temporary_dispatcher_map[name] + + +typeinfer_extensions = {} + + +class TypeInferer(object): + """ + Operates on block that shares the same ir.Scope. + """ + + def __init__(self, context, func_ir, warnings): + self.context = context + # sort based on label, ensure iteration order! + self.blocks = OrderedDict() + for k in sorted(func_ir.blocks.keys()): + self.blocks[k] = func_ir.blocks[k] + self.generator_info = func_ir.generator_info + self.func_id = func_ir.func_id + self.func_ir = func_ir + + self.typevars = TypeVarMap() + self.typevars.set_context(context) + self.constraints = ConstraintNetwork() + self.warnings = warnings + + # { index: mangled name } + self.arg_names = {} + # self.return_type = None + # Set of assumed immutable globals + self.assumed_immutables = set() + # Track all calls and associated constraints + self.calls = [] + # The inference result of the above calls + self.calltypes = utils.UniqueDict() + # Target var -> constraint with refine hook + self.refine_map = {} + + if config.DEBUG or config.DEBUG_TYPEINFER: + self.debug = TypeInferDebug(self) + else: + self.debug = NullDebug() + + self._skip_recursion = False + + def copy(self, skip_recursion=False): + clone = TypeInferer(self.context, self.func_ir, self.warnings) + clone.arg_names = self.arg_names.copy() + clone._skip_recursion = skip_recursion + + for k, v in self.typevars.items(): + if not v.locked and v.defined: + clone.typevars[k].add_type(v.getone(), loc=v.define_loc) + + return clone + + def _mangle_arg_name(self, name): + # Disambiguise argument name + return "arg.%s" % (name,) + + def _get_return_vars(self): + rets = [] + for blk in self.blocks.values(): + inst = blk.terminator + if isinstance(inst, ir.Return): + rets.append(inst.value) + return rets + + def get_argument_types(self): + return [self.typevars[k].getone() for k in self.arg_names.values()] + + def seed_argument(self, name, index, typ): + name = self._mangle_arg_name(name) + self.seed_type(name, typ) + self.arg_names[index] = name + + def seed_type(self, name, typ): + """All arguments should be seeded. + """ + self.lock_type(name, typ, loc=None) + + def seed_return(self, typ): + """Seeding of return value is optional. + """ + for var in self._get_return_vars(): + self.lock_type(var.name, typ, loc=None) + + def build_constraint(self): + for blk in self.blocks.values(): + for inst in blk.body: + self.constrain_statement(inst) + + def return_types_from_partial(self): + """ + Resume type inference partially to deduce the return type. + Note: No side-effect to `self`. + + Returns the inferred return type or None if it cannot deduce the return + type. + """ + # Clone the typeinferer and disable typing recursive calls + cloned = self.copy(skip_recursion=True) + # rebuild constraint network + cloned.build_constraint() + # propagate without raising + cloned.propagate(raise_errors=False) + # get return types + rettypes = set() + for retvar in cloned._get_return_vars(): + if retvar.name in cloned.typevars: + typevar = cloned.typevars[retvar.name] + if typevar and typevar.defined: + rettypes.add(types.unliteral(typevar.getone())) + if not rettypes: + return + # unify return types + return cloned._unify_return_types(rettypes) + + def propagate(self, raise_errors=True): + newtoken = self.get_state_token() + oldtoken = None + # Since the number of types are finite, the typesets will eventually + # stop growing. + + while newtoken != oldtoken: + self.debug.propagate_started() + oldtoken = newtoken + # Errors can appear when the type set is incomplete; only + # raise them when there is no progress anymore. + errors = self.constraints.propagate(self) + newtoken = self.get_state_token() + self.debug.propagate_finished() + if errors: + if raise_errors: + force_lit_args = [e for e in errors + if isinstance(e, ForceLiteralArg)] + if not force_lit_args: + raise errors[0] + else: + raise reduce(operator.or_, force_lit_args) + else: + return errors + + def add_type(self, var, tp, loc, unless_locked=False): + assert isinstance(var, str), type(var) + tv = self.typevars[var] + if unless_locked and tv.locked: + return + oldty = tv.type + unified = tv.add_type(tp, loc=loc) + if unified != oldty: + self.propagate_refined_type(var, unified) + + def add_calltype(self, inst, signature): + assert signature is not None + self.calltypes[inst] = signature + + def copy_type(self, src_var, dest_var, loc): + self.typevars[dest_var].union(self.typevars[src_var], loc=loc) + + def lock_type(self, var, tp, loc, literal_value=NOTSET): + tv = self.typevars[var] + tv.lock(tp, loc=loc, literal_value=literal_value) + + def propagate_refined_type(self, updated_var, updated_type): + source_constraint = self.refine_map.get(updated_var) + if source_constraint is not None: + source_constraint.refine(self, updated_type) + + def unify(self, raise_errors=True): + """ + Run the final unification pass over all inferred types, and + catch imprecise types. + """ + typdict = utils.UniqueDict() + + def find_offender(name, exhaustive=False): + # finds the offending variable definition by name + # if exhaustive is set it will try and trace through temporary + # variables to find a concrete offending definition. + offender = None + for block in self.func_ir.blocks.values(): + offender = block.find_variable_assignment(name) + if offender is not None: + if not exhaustive: + break + try: # simple assignment + hasattr(offender.value, 'name') + offender_value = offender.value.name + except (AttributeError, KeyError): + break + orig_offender = offender + if offender_value.startswith('$'): + offender = find_offender(offender_value, + exhaustive=exhaustive) + if offender is None: + offender = orig_offender + break + return offender + + def diagnose_imprecision(offender): + # helper for diagnosing imprecise types + + list_msg = """\n +For Numba to be able to compile a list, the list must have a known and +precise type that can be inferred from the other variables. Whilst sometimes +the type of empty lists can be inferred, this is not always the case, see this +documentation for help: + +https://numba.readthedocs.io/en/stable/user/troubleshoot.html#my-code-has-an-untyped-list-problem +""" + if offender is not None: + # This block deals with imprecise lists + if hasattr(offender, 'value'): + if hasattr(offender.value, 'op'): + # might be `foo = []` + if offender.value.op == 'build_list': + return list_msg + # or might be `foo = list()` + elif offender.value.op == 'call': + try: # assignment involving a call + call_name = offender.value.func.name + # find the offender based on the call name + offender = find_offender(call_name) + if isinstance(offender.value, ir.Global): + if offender.value.name == 'list': + return list_msg + except (AttributeError, KeyError): + pass + return "" # no help possible + + def check_var(name): + tv = self.typevars[name] + if not tv.defined: + if raise_errors: + offender = find_offender(name) + val = getattr(offender, 'value', 'unknown operation') + loc = getattr(offender, 'loc', ir.unknown_loc) + msg = ("Type of variable '%s' cannot be determined, " + "operation: %s, location: %s") + raise TypingError(msg % (var, val, loc), loc) + else: + typdict[var] = types.unknown + return + tp = tv.getone() + + if isinstance(tp, types.UndefinedFunctionType): + tp = tp.get_precise() + + if not tp.is_precise(): + offender = find_offender(name, exhaustive=True) + msg = ("Cannot infer the type of variable '%s'%s, " + "have imprecise type: %s. %s") + istmp = " (temporary variable)" if var.startswith('$') else "" + loc = getattr(offender, 'loc', ir.unknown_loc) + # is this an untyped list? try and provide help + extra_msg = diagnose_imprecision(offender) + if raise_errors: + raise TypingError(msg % (var, istmp, tp, extra_msg), loc) + else: + typdict[var] = types.unknown + return + else: # type is precise, hold it + typdict[var] = tp + + # For better error display, check first user-visible vars, then + # temporaries + temps = set(k for k in self.typevars if not k[0].isalpha()) + others = set(self.typevars) - temps + for var in sorted(others): + check_var(var) + for var in sorted(temps): + check_var(var) + + try: + retty = self.get_return_type(typdict) + except Exception as e: + # partial type inference may raise e.g. attribute error if a + # constraint has no computable signature, ignore this as needed + if raise_errors: + raise e + else: + retty = None + else: + typdict = utils.UniqueDict( + typdict, **{v.name: retty for v in self._get_return_vars()}) + + try: + fntys = self.get_function_types(typdict) + except Exception as e: + # partial type inference may raise e.g. attribute error if a + # constraint has no computable signature, ignore this as needed + if raise_errors: + raise e + else: + fntys = None + + if self.generator_info: + retty = self.get_generator_type(typdict, retty, + raise_errors=raise_errors) + + def check_undef_var_in_calls(): + # Check for undefined variables in the call arguments. + for callnode, calltype in self.calltypes.items(): + if calltype is not None: + for i, v in enumerate(calltype.args, start=1): + if v is types._undef_var: + m = f"undefined variable used in call argument #{i}" + raise TypingError(m, loc=callnode.loc) + + check_undef_var_in_calls() + + self.debug.unify_finished(typdict, retty, fntys) + + return typdict, retty, fntys + + def get_generator_type(self, typdict, retty, raise_errors=True): + gi = self.generator_info + arg_types = [None] * len(self.arg_names) + for index, name in self.arg_names.items(): + arg_types[index] = typdict[name] + + state_types = None + try: + state_types = [typdict[var_name] for var_name in gi.state_vars] + except KeyError: + msg = "Cannot type generator: state variable types cannot be found" + if raise_errors: + raise TypingError(msg) + state_types = [types.unknown for _ in gi.state_vars] + + yield_types = None + try: + yield_types = [typdict[y.inst.value.name] + for y in gi.get_yield_points()] + except KeyError: + msg = "Cannot type generator: yield type cannot be found" + if raise_errors: + raise TypingError(msg) + if not yield_types: + msg = "Cannot type generator: it does not yield any value" + if raise_errors: + raise TypingError(msg) + yield_types = [types.unknown for _ in gi.get_yield_points()] + + if not yield_types or all(yield_types) == types.unknown: + # unknown yield, probably partial type inference, escape + return types.Generator(self.func_id.func, types.unknown, arg_types, + state_types, has_finalizer=True) + + yield_type = self.context.unify_types(*yield_types) + if yield_type is None or isinstance(yield_type, types.Optional): + msg = "Cannot type generator: cannot unify yielded types %s" + yp_highlights = [] + for y in gi.get_yield_points(): + msg = (_termcolor.errmsg("Yield of: IR '%s', type '%s', " + "location: %s")) + yp_highlights.append(msg % (str(y.inst), + typdict[y.inst.value.name], + y.inst.loc.strformat())) + + explain_ty = set() + for ty in yield_types: + if isinstance(ty, types.Optional): + explain_ty.add(ty.type) + explain_ty.add(types.NoneType('none')) + else: + explain_ty.add(ty) + if raise_errors: + raise TypingError("Can't unify yield type from the " + "following types: %s" + % ", ".join(sorted(map(str, explain_ty))) + + "\n\n" + "\n".join(yp_highlights)) + + return types.Generator(self.func_id.func, yield_type, arg_types, + state_types, has_finalizer=True) + + def get_function_types(self, typemap): + """ + Fill and return the calltypes map. + """ + # XXX why can't this be done on the fly? + calltypes = self.calltypes + for call, constraint in self.calls: + calltypes[call] = constraint.get_call_signature() + return calltypes + + def _unify_return_types(self, rettypes): + if rettypes: + unified = self.context.unify_types(*rettypes) + if isinstance(unified, types.FunctionType): + # unified is allowed to be UndefinedFunctionType + # instance (that is imprecise). + return unified + if unified is None or not unified.is_precise(): + def check_type(atype): + lst = [] + for k, v in self.typevars.items(): + if atype == v.type: + lst.append(k) + returns = {} + for x in reversed(lst): + for block in self.func_ir.blocks.values(): + for instr in block.find_insts(ir.Return): + value = instr.value + if isinstance(value, ir.Var): + name = value.name + else: + pass + if x == name: + returns[x] = instr + break + + interped = "" + for name, offender in returns.items(): + loc = getattr(offender, 'loc', ir.unknown_loc) + msg = ("Return of: IR name '%s', type '%s', " + "location: %s") + interped = msg % (name, atype, loc.strformat()) + return interped + + problem_str = [] + for xtype in rettypes: + problem_str.append(_termcolor.errmsg(check_type(xtype))) + + raise TypingError("Can't unify return type from the " + "following types: %s" + % ", ".join(sorted(map(str, rettypes))) + + "\n" + "\n".join(problem_str)) + return unified + else: + # Function without a successful return path + return types.none + + def get_return_type(self, typemap): + rettypes = set() + for var in self._get_return_vars(): + rettypes.add(typemap[var.name]) + retty = self._unify_return_types(rettypes) + # Check return value is not undefined + if retty is types._undef_var: + raise TypingError("return value is undefined") + return retty + + def get_state_token(self): + """The algorithm is monotonic. It can only grow or "refine" the + typevar map. + """ + return [tv.type for name, tv in sorted(self.typevars.items())] + + def constrain_statement(self, inst): + if isinstance(inst, ir.Assign): + self.typeof_assign(inst) + elif isinstance(inst, ir.SetItem): + self.typeof_setitem(inst) + elif isinstance(inst, ir.StaticSetItem): + self.typeof_static_setitem(inst) + elif isinstance(inst, ir.DelItem): + self.typeof_delitem(inst) + elif isinstance(inst, ir.SetAttr): + self.typeof_setattr(inst) + elif isinstance(inst, ir.Print): + self.typeof_print(inst) + elif isinstance(inst, ir.StoreMap): + self.typeof_storemap(inst) + elif isinstance(inst, (ir.Jump, ir.Branch, ir.Return, ir.Del)): + pass + elif isinstance(inst, (ir.DynamicRaise, ir.DynamicTryRaise)): + pass + elif isinstance(inst, (ir.StaticRaise, ir.StaticTryRaise)): + pass + elif isinstance(inst, ir.PopBlock): + pass # It's a marker statement + elif type(inst) in typeinfer_extensions: + # let external calls handle stmt if type matches + f = typeinfer_extensions[type(inst)] + f(inst, self) + else: + msg = "Unsupported constraint encountered: %s" % inst + raise UnsupportedError(msg, loc=inst.loc) + + def typeof_setitem(self, inst): + constraint = SetItemConstraint(target=inst.target, index=inst.index, + value=inst.value, loc=inst.loc) + self.constraints.append(constraint) + self.calls.append((inst, constraint)) + + def typeof_storemap(self, inst): + constraint = SetItemConstraint(target=inst.dct, index=inst.key, + value=inst.value, loc=inst.loc) + self.constraints.append(constraint) + self.calls.append((inst, constraint)) + + def typeof_static_setitem(self, inst): + constraint = StaticSetItemConstraint(target=inst.target, + index=inst.index, + index_var=inst.index_var, + value=inst.value, loc=inst.loc) + self.constraints.append(constraint) + self.calls.append((inst, constraint)) + + def typeof_delitem(self, inst): + constraint = DelItemConstraint(target=inst.target, index=inst.index, + loc=inst.loc) + self.constraints.append(constraint) + self.calls.append((inst, constraint)) + + def typeof_setattr(self, inst): + constraint = SetAttrConstraint(target=inst.target, attr=inst.attr, + value=inst.value, loc=inst.loc) + self.constraints.append(constraint) + self.calls.append((inst, constraint)) + + def typeof_print(self, inst): + constraint = PrintConstraint(args=inst.args, vararg=inst.vararg, + loc=inst.loc) + self.constraints.append(constraint) + self.calls.append((inst, constraint)) + + def typeof_assign(self, inst): + value = inst.value + if isinstance(value, ir.Const): + self.typeof_const(inst, inst.target, value.value) + elif isinstance(value, ir.Var): + self.constraints.append(Propagate(dst=inst.target.name, + src=value.name, loc=inst.loc)) + elif isinstance(value, (ir.Global, ir.FreeVar)): + self.typeof_global(inst, inst.target, value) + elif isinstance(value, ir.Arg): + self.typeof_arg(inst, inst.target, value) + elif isinstance(value, ir.Expr): + self.typeof_expr(inst, inst.target, value) + elif isinstance(value, ir.Yield): + self.typeof_yield(inst, inst.target, value) + else: + msg = ("Unsupported assignment encountered: %s %s" % + (type(value), str(value))) + raise UnsupportedError(msg, loc=inst.loc) + + def resolve_value_type(self, inst, val): + """ + Resolve the type of a simple Python value, such as can be + represented by literals. + """ + try: + return self.context.resolve_value_type(val) + except ValueError as e: + msg = str(e) + raise TypingError(msg, loc=inst.loc) + + def typeof_arg(self, inst, target, arg): + src_name = self._mangle_arg_name(arg.name) + self.constraints.append(ArgConstraint(dst=target.name, + src=src_name, + loc=inst.loc)) + + def typeof_const(self, inst, target, const): + ty = self.resolve_value_type(inst, const) + if inst.value.use_literal_type: + lit = types.maybe_literal(value=const) + else: + lit = None + self.add_type(target.name, lit or ty, loc=inst.loc) + + def typeof_yield(self, inst, target, yield_): + # Sending values into generators isn't supported. + self.add_type(target.name, types.none, loc=inst.loc) + + def sentry_modified_builtin(self, inst, gvar): + """ + Ensure that builtins are not modified. + """ + if gvar.name == 'range' and gvar.value is not range: + bad = True + elif gvar.name == 'slice' and gvar.value is not slice: + bad = True + elif gvar.name == 'len' and gvar.value is not len: + bad = True + else: + bad = False + + if bad: + raise TypingError("Modified builtin '%s'" % gvar.name, + loc=inst.loc) + + def resolve_call(self, fnty, pos_args, kw_args): + """ + Resolve a call to a given function type. A signature is returned. + """ + if isinstance(fnty, types.FunctionType): + return fnty.get_call_type(self, pos_args, kw_args) + if isinstance(fnty, types.RecursiveCall) and not self._skip_recursion: + # Recursive call + disp = fnty.dispatcher_type.dispatcher + pysig, args = disp.fold_argument_types(pos_args, kw_args) + + frame = self.context.callstack.match(disp.py_func, args) + + # If the signature is not being compiled + if frame is None: + sig = self.context.resolve_function_type(fnty.dispatcher_type, + pos_args, kw_args) + fndesc = disp.overloads[args].fndesc + qual = qualifying_prefix(fndesc.modname, fndesc.qualname) + fnty.add_overloads(args, qual, fndesc.uid) + return sig + + fnid = frame.func_id + qual = qualifying_prefix(fnid.modname, fnid.func_qualname) + fnty.add_overloads(args, qual, fnid.unique_id) + # Resume propagation in parent frame + return_type = frame.typeinfer.return_types_from_partial() + # No known return type + if return_type is None: + raise TypingError("cannot type infer runaway recursion") + + sig = typing.signature(return_type, *args) + sig = sig.replace(pysig=pysig) + # Keep track of unique return_type + frame.add_return_type(return_type) + return sig + else: + # Normal non-recursive call + return self.context.resolve_function_type(fnty, pos_args, kw_args) + + def typeof_global(self, inst, target, gvar): + try: + typ = self.resolve_value_type(inst, gvar.value) + except TypingError as e: + if (gvar.name == self.func_id.func_name + and gvar.name in _temporary_dispatcher_map): + # Self-recursion case where the dispatcher is not (yet?) known + # as a global variable + typ = types.Dispatcher(_temporary_dispatcher_map[gvar.name]) + else: + from numba.misc import special + + nm = gvar.name + # check if the problem is actually a name error + func_glbls = self.func_id.func.__globals__ + if (nm not in func_glbls.keys() and + nm not in special.__all__ and + nm not in __builtins__.keys() and + nm not in self.func_id.code.co_freevars): + errstr = "NameError: name '%s' is not defined" + msg = _termcolor.errmsg(errstr % nm) + e.patch_message(msg) + raise + else: + msg = _termcolor.errmsg("Untyped global name '%s':" % nm) + msg += " %s" # interps the actual error + + # if the untyped global is a numba internal function then add + # to the error message asking if it's been imported. + + if nm in special.__all__: + tmp = ("\n'%s' looks like a Numba internal function, has " + "it been imported (i.e. 'from numba import %s')?\n" % + (nm, nm)) + msg += _termcolor.errmsg(tmp) + e.patch_message(msg % e) + raise + + if isinstance(typ, types.Dispatcher) and typ.dispatcher.is_compiling: + # Recursive call + callstack = self.context.callstack + callframe = callstack.findfirst(typ.dispatcher.py_func) + if callframe is not None: + typ = types.RecursiveCall(typ) + else: + raise NotImplementedError( + "call to %s: unsupported recursion" + % typ.dispatcher) + + if isinstance(typ, types.Array): + # Global array in nopython mode is constant + typ = typ.copy(readonly=True) + + if isinstance(typ, types.BaseAnonymousTuple): + # if it's a tuple of literal types, swap the type for the more + # specific literal version + literaled = [types.maybe_literal(x) for x in gvar.value] + if all(literaled): + typ = types.Tuple(literaled) + + # if any of the items in the tuple are arrays, they need to be + # typed as readonly, mutating an array in a global container + # is not supported (should be compile time constant etc). + def mark_array_ro(tup): + newtup = [] + for item in tup.types: + if isinstance(item, types.Array): + item = item.copy(readonly=True) + elif isinstance(item, types.BaseAnonymousTuple): + item = mark_array_ro(item) + newtup.append(item) + return types.BaseTuple.from_types(newtup) + typ = mark_array_ro(typ) + + self.sentry_modified_builtin(inst, gvar) + # Setting literal_value for globals because they are handled + # like const value in numba + lit = types.maybe_literal(gvar.value) + # The user may have provided the type for this variable already. + # In this case, call add_type() to make sure the value type is + # consistent. See numba.tests.test_array_reductions + # TestArrayReductions.test_array_cumsum for examples. + # Variable type locked by using the locals dict. + tv = self.typevars[target.name] + if tv.locked: + tv.add_type(lit or typ, loc=inst.loc) + else: + self.lock_type(target.name, lit or typ, loc=inst.loc) + self.assumed_immutables.add(inst) + + def typeof_expr(self, inst, target, expr): + if expr.op == 'call': + self.typeof_call(inst, target, expr) + elif expr.op in ('getiter', 'iternext'): + self.typeof_intrinsic_call(inst, target, expr.op, expr.value) + elif expr.op == 'exhaust_iter': + constraint = ExhaustIterConstraint(target.name, count=expr.count, + iterator=expr.value, + loc=expr.loc) + self.constraints.append(constraint) + elif expr.op == 'pair_first': + constraint = PairFirstConstraint(target.name, pair=expr.value, + loc=expr.loc) + self.constraints.append(constraint) + elif expr.op == 'pair_second': + constraint = PairSecondConstraint(target.name, pair=expr.value, + loc=expr.loc) + self.constraints.append(constraint) + elif expr.op == 'binop': + self.typeof_intrinsic_call(inst, target, expr.fn, expr.lhs, + expr.rhs) + elif expr.op == 'inplace_binop': + self.typeof_intrinsic_call(inst, target, expr.fn, + expr.lhs, expr.rhs) + elif expr.op == 'unary': + self.typeof_intrinsic_call(inst, target, expr.fn, expr.value) + elif expr.op == 'static_getitem': + constraint = StaticGetItemConstraint(target.name, value=expr.value, + index=expr.index, + index_var=expr.index_var, + loc=expr.loc) + self.constraints.append(constraint) + self.calls.append((inst.value, constraint)) + elif expr.op == 'getitem': + self.typeof_intrinsic_call(inst, target, operator.getitem, + expr.value, expr.index,) + elif expr.op == 'typed_getitem': + constraint = TypedGetItemConstraint(target.name, value=expr.value, + dtype=expr.dtype, + index=expr.index, + loc=expr.loc) + self.constraints.append(constraint) + self.calls.append((inst.value, constraint)) + + elif expr.op == 'getattr': + constraint = GetAttrConstraint(target.name, attr=expr.attr, + value=expr.value, loc=inst.loc, + inst=inst) + self.constraints.append(constraint) + elif expr.op == 'build_tuple': + constraint = BuildTupleConstraint(target.name, items=expr.items, + loc=inst.loc) + self.constraints.append(constraint) + elif expr.op == 'build_list': + constraint = BuildListConstraint(target.name, items=expr.items, + loc=inst.loc) + self.constraints.append(constraint) + elif expr.op == 'build_set': + constraint = BuildSetConstraint(target.name, items=expr.items, + loc=inst.loc) + self.constraints.append(constraint) + elif expr.op == 'build_map': + constraint = BuildMapConstraint( + target.name, + items=expr.items, + special_value=expr.literal_value, + value_indexes=expr.value_indexes, + loc=inst.loc) + self.constraints.append(constraint) + elif expr.op == 'cast': + self.constraints.append(Propagate(dst=target.name, + src=expr.value.name, + loc=inst.loc)) + elif expr.op == 'phi': + for iv in expr.incoming_values: + if iv is not ir.UNDEFINED: + self.constraints.append(Propagate(dst=target.name, + src=iv.name, + loc=inst.loc)) + elif expr.op == 'make_function': + self.lock_type(target.name, types.MakeFunctionLiteral(expr), + loc=inst.loc, literal_value=expr) + + elif expr.op == 'undef': + self.add_type(target.name, types._undef_var, loc=inst.loc) + + else: + msg = "Unsupported op-code encountered: %s" % expr + raise UnsupportedError(msg, loc=inst.loc) + + def typeof_call(self, inst, target, call): + constraint = CallConstraint(target.name, call.func.name, call.args, + call.kws, call.vararg, loc=inst.loc) + self.constraints.append(constraint) + self.calls.append((inst.value, constraint)) + + def typeof_intrinsic_call(self, inst, target, func, *args): + constraint = IntrinsicCallConstraint(target.name, func, args, + kws=(), vararg=None, loc=inst.loc) + self.constraints.append(constraint) + self.calls.append((inst.value, constraint)) + + +class NullDebug(object): + + def propagate_started(self): + pass + + def propagate_finished(self): + pass + + def unify_finished(self, typdict, retty, fntys): + pass + + +class TypeInferDebug(object): + + def __init__(self, typeinfer): + self.typeinfer = typeinfer + + def _dump_state(self): + print('---- type variables ----') + pprint([v for k, v in sorted(self.typeinfer.typevars.items())]) + + def propagate_started(self): + print("propagate".center(80, '-')) + + def propagate_finished(self): + self._dump_state() + + def unify_finished(self, typdict, retty, fntys): + print("Variable types".center(80, "-")) + pprint(typdict) + print("Return type".center(80, "-")) + pprint(retty) + print("Call types".center(80, "-")) + pprint(fntys) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/untyped_passes.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/untyped_passes.py new file mode 100644 index 0000000000000000000000000000000000000000..ca0cfdb28727ee6b2180843cae86aca94b2f4181 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/untyped_passes.py @@ -0,0 +1,1813 @@ +from collections import defaultdict, namedtuple +from contextlib import contextmanager +from copy import deepcopy, copy +import warnings + +from numba.core.compiler_machinery import (FunctionPass, AnalysisPass, + SSACompliantMixin, register_pass) +from numba.core import (errors, types, ir, bytecode, postproc, rewrites, config, + transforms, consts) +from numba.misc.special import literal_unroll +from numba.core.analysis import (dead_branch_prune, rewrite_semantic_constants, + find_literally_calls, compute_cfg_from_blocks, + compute_use_defs) +from numba.core.ir_utils import (guard, resolve_func_from_module, simplify_CFG, + GuardException, convert_code_obj_to_function, + build_definitions, + replace_var_names, get_name_var_table, + compile_to_numba_ir, get_definition, + find_max_label, rename_labels, + transfer_scope, fixup_var_define_in_scope, + ) +from numba.core.ssa import reconstruct_ssa +from numba.core import interpreter + + +@contextmanager +def fallback_context(state, msg): + """ + Wraps code that would signal a fallback to object mode + """ + try: + yield + except Exception as e: + if not state.status.can_fallback: + raise + else: + # Clear all references attached to the traceback + e = e.with_traceback(None) + # this emits a warning containing the error message body in the + # case of fallback from npm to objmode + loop_lift = '' if state.flags.enable_looplift else 'OUT' + msg_rewrite = ("\nCompilation is falling back to object mode " + "WITH%s looplifting enabled because %s" + % (loop_lift, msg)) + warnings.warn_explicit('%s due to: %s' % (msg_rewrite, e), + errors.NumbaWarning, + state.func_id.filename, + state.func_id.firstlineno) + raise + + +@register_pass(mutates_CFG=True, analysis_only=False) +class ExtractByteCode(FunctionPass): + _name = "extract_bytecode" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Extract bytecode from function + """ + func_id = state['func_id'] + bc = bytecode.ByteCode(func_id) + if config.DUMP_BYTECODE: + print(bc.dump()) + + state['bc'] = bc + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class TranslateByteCode(FunctionPass): + _name = "translate_bytecode" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Analyze bytecode and translating to Numba IR + """ + func_id = state['func_id'] + bc = state['bc'] + interp = interpreter.Interpreter(func_id) + func_ir = interp.interpret(bc) + state["func_ir"] = func_ir + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class FixupArgs(FunctionPass): + _name = "fixup_args" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + state['nargs'] = state['func_ir'].arg_count + if not state['args'] and state['flags'].force_pyobject: + # Allow an empty argument types specification when object mode + # is explicitly requested. + state['args'] = (types.pyobject,) * state['nargs'] + elif len(state['args']) != state['nargs']: + raise TypeError("Signature mismatch: %d argument types given, " + "but function takes %d arguments" + % (len(state['args']), state['nargs'])) + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class IRProcessing(FunctionPass): + _name = "ir_processing" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + func_ir = state['func_ir'] + post_proc = postproc.PostProcessor(func_ir) + post_proc.run() + + if config.DEBUG or config.DUMP_IR: + name = func_ir.func_id.func_qualname + print(("IR DUMP: %s" % name).center(80, "-")) + func_ir.dump() + if func_ir.is_generator: + print(("GENERATOR INFO: %s" % name).center(80, "-")) + func_ir.dump_generator_info() + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class RewriteSemanticConstants(FunctionPass): + _name = "rewrite_semantic_constants" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + This prunes dead branches, a dead branch is one which is derivable as + not taken at compile time purely based on const/literal evaluation. + """ + assert state.func_ir + msg = ('Internal error in pre-inference dead branch pruning ' + 'pass encountered during compilation of ' + 'function "%s"' % (state.func_id.func_name,)) + with fallback_context(state, msg): + rewrite_semantic_constants(state.func_ir, state.args) + + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class DeadBranchPrune(SSACompliantMixin, FunctionPass): + _name = "dead_branch_prune" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + This prunes dead branches, a dead branch is one which is derivable as + not taken at compile time purely based on const/literal evaluation. + """ + + # purely for demonstration purposes, obtain the analysis from a pass + # declare as a required dependent + semantic_const_analysis = self.get_analysis(type(self)) # noqa + + assert state.func_ir + msg = ('Internal error in pre-inference dead branch pruning ' + 'pass encountered during compilation of ' + 'function "%s"' % (state.func_id.func_name,)) + with fallback_context(state, msg): + dead_branch_prune(state.func_ir, state.args) + + return True + + def get_analysis_usage(self, AU): + AU.add_required(RewriteSemanticConstants) + + +@register_pass(mutates_CFG=True, analysis_only=False) +class InlineClosureLikes(FunctionPass): + _name = "inline_closure_likes" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + # Ensure we have an IR and type information. + assert state.func_ir + + # if the return type is a pyobject, there's no type info available and + # no ability to resolve certain typed function calls in the array + # inlining code, use this variable to indicate + typed_pass = not isinstance(state.return_type, types.misc.PyObject) + from numba.core.inline_closurecall import InlineClosureCallPass + inline_pass = InlineClosureCallPass( + state.func_ir, + state.flags.auto_parallel, + state.parfor_diagnostics.replaced_fns, + typed_pass) + inline_pass.run() + + # Remove all Dels, and re-run postproc + post_proc = postproc.PostProcessor(state.func_ir) + post_proc.run() + + fixup_var_define_in_scope(state.func_ir.blocks) + + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class GenericRewrites(FunctionPass): + _name = "generic_rewrites" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Perform any intermediate representation rewrites before type + inference. + """ + assert state.func_ir + msg = ('Internal error in pre-inference rewriting ' + 'pass encountered during compilation of ' + 'function "%s"' % (state.func_id.func_name,)) + with fallback_context(state, msg): + rewrites.rewrite_registry.apply('before-inference', state) + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class WithLifting(FunctionPass): + _name = "with_lifting" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """ + Extract with-contexts + """ + main, withs = transforms.with_lifting( + func_ir=state.func_ir, + typingctx=state.typingctx, + targetctx=state.targetctx, + flags=state.flags, + locals=state.locals, + ) + if withs: + from numba.core.compiler import compile_ir, _EarlyPipelineCompletion + cres = compile_ir(state.typingctx, state.targetctx, main, + state.args, state.return_type, + state.flags, state.locals, + lifted=tuple(withs), lifted_from=None, + pipeline_class=type(state.pipeline)) + raise _EarlyPipelineCompletion(cres) + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class InlineInlinables(FunctionPass): + """ + This pass will inline a function wrapped by the numba.jit decorator directly + into the site of its call depending on the value set in the 'inline' kwarg + to the decorator. + + This is an untyped pass. CFG simplification is performed at the end of the + pass but no block level clean up is performed on the mutated IR (typing + information is not available to do so). + """ + _name = "inline_inlinables" + _DEBUG = False + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + """Run inlining of inlinables + """ + if self._DEBUG: + print('before inline'.center(80, '-')) + print(state.func_ir.dump()) + print(''.center(80, '-')) + + from numba.core.inline_closurecall import (InlineWorker, + callee_ir_validator) + inline_worker = InlineWorker(state.typingctx, + state.targetctx, + state.locals, + state.pipeline, + state.flags, + validator=callee_ir_validator) + + modified = False + # use a work list, look for call sites via `ir.Expr.op == call` and + # then pass these to `self._do_work` to make decisions about inlining. + work_list = list(state.func_ir.blocks.items()) + while work_list: + label, block = work_list.pop() + for i, instr in enumerate(block.body): + if isinstance(instr, ir.Assign): + expr = instr.value + if isinstance(expr, ir.Expr) and expr.op == 'call': + if guard(self._do_work, state, work_list, block, i, + expr, inline_worker): + modified = True + break # because block structure changed + + if modified: + # clean up unconditional branches that appear due to inlined + # functions introducing blocks + cfg = compute_cfg_from_blocks(state.func_ir.blocks) + for dead in cfg.dead_nodes(): + del state.func_ir.blocks[dead] + post_proc = postproc.PostProcessor(state.func_ir) + post_proc.run() + state.func_ir.blocks = simplify_CFG(state.func_ir.blocks) + + if self._DEBUG: + print('after inline'.center(80, '-')) + print(state.func_ir.dump()) + print(''.center(80, '-')) + return True + + def _do_work(self, state, work_list, block, i, expr, inline_worker): + from numba.core.compiler import run_frontend + from numba.core.cpu import InlineOptions + + # try and get a definition for the call, this isn't always possible as + # it might be a eval(str)/part generated awaiting update etc. (parfors) + to_inline = None + try: + to_inline = state.func_ir.get_definition(expr.func) + except Exception: + if self._DEBUG: + print("Cannot find definition for %s" % expr.func) + return False + # do not handle closure inlining here, another pass deals with that. + if getattr(to_inline, 'op', False) == 'make_function': + return False + + # see if the definition is a "getattr", in which case walk the IR to + # try and find the python function via the module from which it's + # imported, this should all be encoded in the IR. + if getattr(to_inline, 'op', False) == 'getattr': + val = resolve_func_from_module(state.func_ir, to_inline) + else: + # This is likely a freevar or global + # + # NOTE: getattr 'value' on a call may fail if it's an ir.Expr as + # getattr is overloaded to look in _kws. + try: + val = getattr(to_inline, 'value', False) + except Exception: + raise GuardException + + # if something was found... + if val: + # check it's dispatcher-like, the targetoptions attr holds the + # kwargs supplied in the jit decorator and is where 'inline' will + # be if it is present. + topt = getattr(val, 'targetoptions', False) + if topt: + inline_type = topt.get('inline', None) + # has 'inline' been specified? + if inline_type is not None: + inline_opt = InlineOptions(inline_type) + # Could this be inlinable? + if not inline_opt.is_never_inline: + # yes, it could be inlinable + do_inline = True + pyfunc = val.py_func + # Has it got an associated cost model? + if inline_opt.has_cost_model: + # yes, it has a cost model, use it to determine + # whether to do the inline + py_func_ir = run_frontend(pyfunc) + do_inline = inline_type(expr, state.func_ir, + py_func_ir) + # if do_inline is True then inline! + if do_inline: + _, _, _, new_blocks = \ + inline_worker.inline_function(state.func_ir, + block, i, pyfunc,) + if work_list is not None: + for blk in new_blocks: + work_list.append(blk) + return True + return False + + +@register_pass(mutates_CFG=False, analysis_only=False) +class PreserveIR(AnalysisPass): + """ + Preserves the IR in the metadata + """ + + _name = "preserve_ir" + + def __init__(self): + AnalysisPass.__init__(self) + + def run_pass(self, state): + state.metadata['preserved_ir'] = state.func_ir.copy() + return False + + +@register_pass(mutates_CFG=False, analysis_only=True) +class FindLiterallyCalls(FunctionPass): + """Find calls to `numba.literally()` and signal if its requirement is not + satisfied. + """ + _name = "find_literally" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + find_literally_calls(state.func_ir, state.args) + return False + + +@register_pass(mutates_CFG=True, analysis_only=False) +class CanonicalizeLoopExit(FunctionPass): + """A pass to canonicalize loop exit by splitting it from function exit. + """ + _name = "canonicalize_loop_exit" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + fir = state.func_ir + cfg = compute_cfg_from_blocks(fir.blocks) + status = False + for loop in cfg.loops().values(): + for exit_label in loop.exits: + if exit_label in cfg.exit_points(): + self._split_exit_block(fir, cfg, exit_label) + status = True + + fir._reset_analysis_variables() + + vlt = postproc.VariableLifetime(fir.blocks) + fir.variable_lifetime = vlt + return status + + def _split_exit_block(self, fir, cfg, exit_label): + curblock = fir.blocks[exit_label] + newlabel = exit_label + 1 + newlabel = find_max_label(fir.blocks) + 1 + fir.blocks[newlabel] = curblock + newblock = ir.Block(scope=curblock.scope, loc=curblock.loc) + newblock.append(ir.Jump(newlabel, loc=curblock.loc)) + fir.blocks[exit_label] = newblock + # Rename all labels + fir.blocks = rename_labels(fir.blocks) + + +@register_pass(mutates_CFG=True, analysis_only=False) +class CanonicalizeLoopEntry(FunctionPass): + """A pass to canonicalize loop header by splitting it from function entry. + + This is needed for loop-lifting; esp in py3.8 + """ + _name = "canonicalize_loop_entry" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + fir = state.func_ir + cfg = compute_cfg_from_blocks(fir.blocks) + status = False + for loop in cfg.loops().values(): + if len(loop.entries) == 1: + [entry_label] = loop.entries + if entry_label == cfg.entry_point(): + self._split_entry_block(fir, cfg, loop, entry_label) + status = True + fir._reset_analysis_variables() + + vlt = postproc.VariableLifetime(fir.blocks) + fir.variable_lifetime = vlt + return status + + def _split_entry_block(self, fir, cfg, loop, entry_label): + # Find iterator inputs into the for-loop header + header_block = fir.blocks[loop.header] + deps = set() + for expr in header_block.find_exprs(op="iternext"): + deps.add(expr.value) + # Find the getiter for each iterator + entry_block = fir.blocks[entry_label] + + # Find the start of loop entry statement that needs to be included. + startpt = None + list_of_insts = list(entry_block.find_insts(ir.Assign)) + for assign in reversed(list_of_insts): + if assign.target in deps: + rhs = assign.value + if isinstance(rhs, ir.Var): + if rhs.is_temp: + deps.add(rhs) + elif isinstance(rhs, ir.Expr): + expr = rhs + if expr.op == 'getiter': + startpt = assign + if expr.value.is_temp: + deps.add(expr.value) + elif expr.op == 'call': + defn = guard(get_definition, fir, expr.func) + if isinstance(defn, ir.Global): + if expr.func.is_temp: + deps.add(expr.func) + elif isinstance(rhs, ir.Global) and rhs.value is range: + startpt = assign + + if startpt is None: + return + + splitpt = entry_block.body.index(startpt) + new_block = entry_block.copy() + new_block.body = new_block.body[splitpt:] + new_block.loc = new_block.body[0].loc + new_label = find_max_label(fir.blocks) + 1 + entry_block.body = entry_block.body[:splitpt] + entry_block.append(ir.Jump(new_label, loc=new_block.loc)) + + fir.blocks[new_label] = new_block + # Rename all labels + fir.blocks = rename_labels(fir.blocks) + + +@register_pass(mutates_CFG=False, analysis_only=True) +class PrintIRCFG(FunctionPass): + _name = "print_ir_cfg" + + def __init__(self): + FunctionPass.__init__(self) + self._ver = 0 + + def run_pass(self, state): + fir = state.func_ir + self._ver += 1 + fir.render_dot(filename_prefix='v{}'.format(self._ver)).render() + return False + + +@register_pass(mutates_CFG=True, analysis_only=False) +class MakeFunctionToJitFunction(FunctionPass): + """ + This swaps an ir.Expr.op == "make_function" i.e. a closure, for a compiled + function containing the closure body and puts it in ir.Global. It's a 1:1 + statement value swap. `make_function` is already untyped + """ + _name = "make_function_op_code_to_jit_function" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + from numba import njit + func_ir = state.func_ir + mutated = False + for idx, blk in func_ir.blocks.items(): + for stmt in blk.body: + if isinstance(stmt, ir.Assign): + if isinstance(stmt.value, ir.Expr): + if stmt.value.op == "make_function": + node = stmt.value + getdef = func_ir.get_definition + kw_default = getdef(node.defaults) + ok = False + if (kw_default is None or + isinstance(kw_default, ir.Const)): + ok = True + elif isinstance(kw_default, tuple): + ok = all([isinstance(getdef(x), ir.Const) + for x in kw_default]) + elif isinstance(kw_default, ir.Expr): + if kw_default.op != "build_tuple": + continue + ok = all([isinstance(getdef(x), ir.Const) + for x in kw_default.items]) + if not ok: + continue + + pyfunc = convert_code_obj_to_function(node, func_ir) + func = njit()(pyfunc) + new_node = ir.Global(node.code.co_name, func, + stmt.loc) + stmt.value = new_node + mutated |= True + + # if a change was made the del ordering is probably wrong, patch up + if mutated: + post_proc = postproc.PostProcessor(func_ir) + post_proc.run() + + return mutated + + +@register_pass(mutates_CFG=True, analysis_only=False) +class TransformLiteralUnrollConstListToTuple(FunctionPass): + """ This pass spots a `literal_unroll([])` and rewrites it + as a `literal_unroll(tuple())`. + """ + _name = "transform_literal_unroll_const_list_to_tuple" + + _accepted_types = (types.BaseTuple, types.LiteralList) + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + mutated = False + func_ir = state.func_ir + for label, blk in func_ir.blocks.items(): + calls = [_ for _ in blk.find_exprs('call')] + for call in calls: + glbl = guard(get_definition, func_ir, call.func) + if glbl and isinstance(glbl, (ir.Global, ir.FreeVar)): + # find a literal_unroll + if glbl.value is literal_unroll: + if len(call.args) > 1: + msg = "literal_unroll takes one argument, found %s" + raise errors.UnsupportedError(msg % len(call.args), + call.loc) + # get the arg, make sure its a build_list + unroll_var = call.args[0] + to_unroll = guard(get_definition, func_ir, unroll_var) + if (isinstance(to_unroll, ir.Expr) and + to_unroll.op == "build_list"): + # make sure they are all const items in the list + for i, item in enumerate(to_unroll.items): + val = guard(get_definition, func_ir, item) + if not val: + msg = ("multiple definitions for variable " + "%s, cannot resolve constant") + raise errors.UnsupportedError(msg % item, + to_unroll.loc) + if not isinstance(val, ir.Const): + msg = ("Found non-constant value at " + "position %s in a list argument to " + "literal_unroll" % i) + raise errors.UnsupportedError(msg, + to_unroll.loc) + # The above appears ok, now swap the build_list for + # a built tuple. + + # find the assignment for the unroll target + to_unroll_lhs = guard(get_definition, func_ir, + unroll_var, lhs_only=True) + + if to_unroll_lhs is None: + msg = ("multiple definitions for variable " + "%s, cannot resolve constant") + raise errors.UnsupportedError(msg % unroll_var, + to_unroll.loc) + # scan all blocks looking for the LHS + for b in func_ir.blocks.values(): + asgn = b.find_variable_assignment( + to_unroll_lhs.name) + if asgn is not None: + break + else: + msg = ("Cannot find assignment for known " + "variable %s") % to_unroll_lhs.name + raise errors.CompilerError(msg, to_unroll.loc) + + # Create a tuple with the list items as contents + tup = ir.Expr.build_tuple(to_unroll.items, + to_unroll.loc) + + # swap the list for the tuple + asgn.value = tup + mutated = True + elif (isinstance(to_unroll, ir.Expr) and + to_unroll.op == "build_tuple"): + # this is fine, do nothing + pass + elif (isinstance(to_unroll, (ir.Global, ir.FreeVar)) and + isinstance(to_unroll.value, tuple)): + # this is fine, do nothing + pass + elif isinstance(to_unroll, ir.Arg): + # this is only fine if the arg is a tuple + ty = state.typemap[to_unroll.name] + if not isinstance(ty, self._accepted_types): + msg = ("Invalid use of literal_unroll with a " + "function argument, only tuples are " + "supported as function arguments, found " + "%s") % ty + raise errors.UnsupportedError(msg, + to_unroll.loc) + else: + extra = None + if isinstance(to_unroll, ir.Expr): + # probably a slice + if to_unroll.op == "getitem": + ty = state.typemap[to_unroll.value.name] + # check if this is a tuple slice + if not isinstance(ty, self._accepted_types): + extra = "operation %s" % to_unroll.op + loc = to_unroll.loc + elif isinstance(to_unroll, ir.Arg): + extra = "non-const argument %s" % to_unroll.name + loc = to_unroll.loc + else: + if to_unroll is None: + extra = ('multiple definitions of ' + 'variable "%s".' % unroll_var.name) + loc = unroll_var.loc + else: + loc = to_unroll.loc + extra = "unknown problem" + + if extra: + msg = ("Invalid use of literal_unroll, " + "argument should be a tuple or a list " + "of constant values. Failure reason: " + "found %s" % extra) + raise errors.UnsupportedError(msg, loc) + return mutated + + +@register_pass(mutates_CFG=True, analysis_only=False) +class MixedContainerUnroller(FunctionPass): + _name = "mixed_container_unroller" + + _DEBUG = False + + _accepted_types = (types.BaseTuple, types.LiteralList) + + def __init__(self): + FunctionPass.__init__(self) + + def analyse_tuple(self, tup): + """ + Returns a map of type->list(indexes) for a typed tuple + """ + d = defaultdict(list) + for i, ty in enumerate(tup): + d[ty].append(i) + return d + + def add_offset_to_labels_w_ignore(self, blocks, offset, ignore=None): + """add an offset to all block labels and jump/branch targets + don't add an offset to anything in the ignore list + """ + if ignore is None: + ignore = set() + + new_blocks = {} + for l, b in blocks.items(): + # some parfor last blocks might be empty + term = None + if b.body: + term = b.body[-1] + if isinstance(term, ir.Jump): + if term.target not in ignore: + b.body[-1] = ir.Jump(term.target + offset, term.loc) + if isinstance(term, ir.Branch): + if term.truebr not in ignore: + new_true = term.truebr + offset + else: + new_true = term.truebr + + if term.falsebr not in ignore: + new_false = term.falsebr + offset + else: + new_false = term.falsebr + b.body[-1] = ir.Branch(term.cond, new_true, new_false, term.loc) + new_blocks[l + offset] = b + return new_blocks + + def inject_loop_body(self, switch_ir, loop_ir, caller_max_label, + dont_replace, switch_data): + """ + Injects the "loop body" held in `loop_ir` into `switch_ir` where ever + there is a statement of the form `SENTINEL. = RHS`. It also: + * Finds and then deliberately does not relabel non-local jumps so as to + make the switch table suitable for injection into the IR from which + the loop body was derived. + * Looks for `typed_getitem` and wires them up to loop body version + specific variables or, if possible, directly writes in their constant + value at their use site. + + Args: + - switch_ir, the switch table with SENTINELS as generated by + self.gen_switch + - loop_ir, the IR of the loop blocks (derived from the original func_ir) + - caller_max_label, the maximum label in the func_ir caller + - dont_replace, variables that should not be renamed (to handle + references to variables that are incoming at the loop head/escaping at + the loop exit. + - switch_data, the switch table data used to generated the switch_ir, + can be generated by self.analyse_tuple. + + Returns: + - A type specific switch table with each case containing a versioned + loop body suitable for injection as a replacement for the loop_ir. + """ + + # Switch IR came from code gen, immediately relabel to prevent + # collisions with IR derived from the user code (caller) + switch_ir.blocks = self.add_offset_to_labels_w_ignore( + switch_ir.blocks, caller_max_label + 1) + + # Find the sentinels and validate the form + sentinel_exits = set() + sentinel_blocks = [] + for lbl, blk in switch_ir.blocks.items(): + for i, stmt in enumerate(blk.body): + if isinstance(stmt, ir.Assign): + if "SENTINEL" in stmt.target.name: + sentinel_blocks.append(lbl) + sentinel_exits.add(blk.body[-1].target) + break + + assert len(sentinel_exits) == 1 # should only be 1 exit + switch_ir.blocks.pop(sentinel_exits.pop()) # kill the exit, it's dead + + # find jumps that are non-local, we won't relabel these + ignore_set = set() + local_lbl = [x for x in loop_ir.blocks.keys()] + for lbl, blk in loop_ir.blocks.items(): + for i, stmt in enumerate(blk.body): + if isinstance(stmt, ir.Jump): + if stmt.target not in local_lbl: + ignore_set.add(stmt.target) + if isinstance(stmt, ir.Branch): + if stmt.truebr not in local_lbl: + ignore_set.add(stmt.truebr) + if stmt.falsebr not in local_lbl: + ignore_set.add(stmt.falsebr) + + # make sure the generated switch table matches the switch data + assert len(sentinel_blocks) == len(switch_data) + + # replace the sentinel_blocks with the loop body + for lbl, branch_ty in zip(sentinel_blocks, switch_data.keys()): + loop_blocks = deepcopy(loop_ir.blocks) + # relabel blocks WRT switch table, each block replacement will shift + # the maximum label + max_label = max(switch_ir.blocks.keys()) + loop_blocks = self.add_offset_to_labels_w_ignore( + loop_blocks, max_label + 1, ignore_set) + + # start label + loop_start_lbl = min(loop_blocks.keys()) + + # fix the typed_getitem locations in the loop blocks + for blk in loop_blocks.values(): + new_body = [] + for stmt in blk.body: + if isinstance(stmt, ir.Assign): + if (isinstance(stmt.value, ir.Expr) and + stmt.value.op == "typed_getitem"): + if isinstance(branch_ty, types.Literal): + scope = switch_ir.blocks[lbl].scope + new_const_name = scope.redefine( + "branch_const", stmt.loc).name + new_const_var = ir.Var( + blk.scope, new_const_name, stmt.loc) + new_const_val = ir.Const( + branch_ty.literal_value, stmt.loc) + const_assign = ir.Assign( + new_const_val, new_const_var, stmt.loc) + new_assign = ir.Assign( + new_const_var, stmt.target, stmt.loc) + new_body.append(const_assign) + new_body.append(new_assign) + dont_replace.append(new_const_name) + else: + orig = stmt.value + new_typed_getitem = ir.Expr.typed_getitem( + value=orig.value, dtype=branch_ty, + index=orig.index, loc=orig.loc) + new_assign = ir.Assign( + new_typed_getitem, stmt.target, stmt.loc) + new_body.append(new_assign) + else: + new_body.append(stmt) + else: + new_body.append(stmt) + blk.body = new_body + + # rename + var_table = get_name_var_table(loop_blocks) + drop_keys = [] + for k, v in var_table.items(): + if v.name in dont_replace: + drop_keys.append(k) + for k in drop_keys: + var_table.pop(k) + + new_var_dict = {} + for name, var in var_table.items(): + scope = switch_ir.blocks[lbl].scope + try: + scope.get_exact(name) + except errors.NotDefinedError: + # In case the scope doesn't have the variable, we need to + # define it prior creating new copies of it! This is + # because the scope of the function and the scope of the + # loop are different and the variable needs to be redefined + # within the scope of the loop. + scope.define(name, var.loc) + new_var_dict[name] = scope.redefine(name, var.loc).name + replace_var_names(loop_blocks, new_var_dict) + + # clobber the sentinel body and then stuff in the rest + switch_ir.blocks[lbl] = deepcopy(loop_blocks[loop_start_lbl]) + remaining_keys = [y for y in loop_blocks.keys()] + remaining_keys.remove(loop_start_lbl) + for k in remaining_keys: + switch_ir.blocks[k] = deepcopy(loop_blocks[k]) + + if self._DEBUG: + print("-" * 80 + "EXIT STUFFER") + switch_ir.dump() + print("-" * 80) + + return switch_ir + + def gen_switch(self, data, index): + """ + Generates a function with a switch table like + def foo(): + if PLACEHOLDER_INDEX in (): + SENTINEL = None + elif PLACEHOLDER_INDEX in (): + SENTINEL = None + ... + else: + raise RuntimeError + + The data is a map of (type : indexes) for example: + (int64, int64, float64) + might give: + {int64: [0, 1], float64: [2]} + + The index is the index variable for the driving range loop over the + mixed tuple. + """ + elif_tplt = "\n\telif PLACEHOLDER_INDEX in (%s,):\n\t\tSENTINEL = None" + + # Note regarding the insertion of the garbage/defeat variables below: + # These values have been designed and inserted to defeat a specific + # behaviour of the cpython optimizer. The optimization was introduced + # in Python 3.10. + + # The URL for the BPO is: + # https://bugs.python.org/issue44626 + # The code for the optimization can be found at: + # https://github.com/python/cpython/blob/d41abe8/Python/compile.c#L7533-L7557 + + # Essentially the CPython optimizer will inline the exit block under + # certain circumstances and thus replace the jump with a return if the + # exit block is small enough. This is an issue for unroller, as it + # looks for a jump, not a return, when it inserts the generated switch + # table. + + # Part of the condition for this optimization to be applied is that the + # exit block not exceed a certain (4 at the time of writing) number of + # bytecode instructions. We defeat the optimizer by inserting a + # sufficient number of instructions so that the exit block is big + # enough. We don't care about this garbage, because the generated exit + # block is discarded anyway when we smash the switch table into the + # original function and so all the inserted garbage is dropped again. + + # The final lines of the stacktrace w/o this will look like: + # + # File "/numba/numba/core/untyped_passes.py", line 830, \ + # in inject_loop_body + # sentinel_exits.add(blk.body[-1].target) + # AttributeError: Failed in nopython mode pipeline \ + # (step: handles literal_unroll) + # Failed in literal_unroll_subpipeline mode pipeline \ + # (step: performs mixed container unroll) + # 'Return' object has no attribute 'target' + # + # Which indicates that a Return has been found instead of a Jump + + b = ('def foo():\n\tif PLACEHOLDER_INDEX in (%s,):\n\t\t' + 'SENTINEL = None\n%s\n\telse:\n\t\t' + 'raise RuntimeError("Unreachable")\n\t' + 'py310_defeat1 = 1\n\t' + 'py310_defeat2 = 2\n\t' + 'py310_defeat3 = 3\n\t' + 'py310_defeat4 = 4\n\t' + ) + keys = [k for k in data.keys()] + + elifs = [] + for i in range(1, len(keys)): + elifs.append(elif_tplt % ','.join(map(str, data[keys[i]]))) + src = b % (','.join(map(str, data[keys[0]])), ''.join(elifs)) + wstr = src + l = {} + exec(wstr, {}, l) + bfunc = l['foo'] + branches = compile_to_numba_ir(bfunc, {}) + for lbl, blk in branches.blocks.items(): + for stmt in blk.body: + if isinstance(stmt, ir.Assign): + if isinstance(stmt.value, ir.Global): + if stmt.value.name == "PLACEHOLDER_INDEX": + stmt.value = index + return branches + + def apply_transform(self, state): + # compute new CFG + func_ir = state.func_ir + cfg = compute_cfg_from_blocks(func_ir.blocks) + # find loops + loops = cfg.loops() + + # 0. Find the loops containing literal_unroll and store this + # information + unroll_info = namedtuple( + "unroll_info", [ + "loop", "call", "arg", "getitem"]) + + def get_call_args(init_arg, want): + # Chases the assignment of a called value back through a specific + # call to a global function "want" and returns the arguments + # supplied to that function's call + some_call = get_definition(func_ir, init_arg) + if not isinstance(some_call, ir.Expr): + raise GuardException + if not some_call.op == "call": + raise GuardException + the_global = get_definition(func_ir, some_call.func) + if not isinstance(the_global, ir.Global): + raise GuardException + if the_global.value is not want: + raise GuardException + return some_call + + def find_unroll_loops(loops): + """This finds loops which are compliant with the form: + for i in range(len(literal_unroll(>)))""" + unroll_loops = {} + for header_lbl, loop in loops.items(): + # TODO: check the loop head has literal_unroll, if it does but + # does not conform to the following then raise + + # scan loop header + iternexts = [_ for _ in + func_ir.blocks[loop.header].find_exprs('iternext')] + # needs to be an single iternext driven loop + if len(iternexts) != 1: + continue + for iternext in iternexts: + # Walk the canonicalised loop structure and check it + # Check loop form range(literal_unroll(container))) + phi = guard(get_definition, func_ir, iternext.value) + if phi is None: + continue + + # check call global "range" + range_call = guard(get_call_args, phi.value, range) + if range_call is None: + continue + range_arg = range_call.args[0] + + # check call global "len" + len_call = guard(get_call_args, range_arg, len) + if len_call is None: + continue + len_arg = len_call.args[0] + + # check literal_unroll + literal_unroll_call = guard(get_definition, func_ir, + len_arg) + if literal_unroll_call is None: + continue + if not isinstance(literal_unroll_call, ir.Expr): + continue + if literal_unroll_call.op != "call": + continue + literal_func = getattr(literal_unroll_call, 'func', None) + if not literal_func: + continue + call_func = guard(get_definition, func_ir, + literal_unroll_call.func) + if call_func is None: + continue + call_func_value = call_func.value + + if call_func_value is literal_unroll: + assert len(literal_unroll_call.args) == 1 + unroll_loops[loop] = literal_unroll_call + return unroll_loops + + def ensure_no_nested_unroll(unroll_loops): + # Validate loop nests, nested literal_unroll loops are unsupported. + # This doesn't check that there's a getitem or anything else + # required for the transform to work, simply just that there's no + # nesting. + for test_loop in unroll_loops: + for ref_loop in unroll_loops: + if test_loop == ref_loop: # comparing to self! skip + continue + if test_loop.header in ref_loop.body: + msg = ("Nesting of literal_unroll is unsupported") + loc = func_ir.blocks[test_loop.header].loc + raise errors.UnsupportedError(msg, loc) + + def collect_literal_unroll_info(literal_unroll_loops): + """Finds the loops induced by `literal_unroll`, returns a list of + unroll_info namedtuples for use in the transform pass. + """ + + literal_unroll_info = [] + for loop, literal_unroll_call in literal_unroll_loops.items(): + arg = literal_unroll_call.args[0] + typemap = state.typemap + resolved_arg = guard(get_definition, func_ir, arg, + lhs_only=True) + ty = typemap[resolved_arg.name] + assert isinstance(ty, self._accepted_types) + # loop header is spelled ok, now make sure the body + # actually contains a getitem + + # find a "getitem"... only looks in the blocks that belong + # _solely_ to this literal_unroll (there should not be nested + # literal_unroll loops, this is unsupported). + tuple_getitem = None + for lbli in loop.body: + blk = func_ir.blocks[lbli] + for stmt in blk.body: + if isinstance(stmt, ir.Assign): + if (isinstance(stmt.value, ir.Expr) and + stmt.value.op == "getitem"): + # check for something like a[i] + if stmt.value.value != arg: + # that failed, so check for the + # definition + dfn = guard(get_definition, func_ir, + stmt.value.value) + if dfn is None: + continue + try: + args = getattr(dfn, 'args', False) + except KeyError: + continue + if not args: + continue + if not args[0] == arg: + continue + target_ty = state.typemap[arg.name] + if not isinstance(target_ty, + self._accepted_types): + continue + tuple_getitem = stmt + break + if tuple_getitem: + break + else: + continue # no getitem in this loop + + ui = unroll_info(loop, literal_unroll_call, arg, + tuple_getitem) + literal_unroll_info.append(ui) + return literal_unroll_info + + # 1. Collect info about the literal_unroll loops, ensure they are legal + literal_unroll_loops = find_unroll_loops(loops) + # validate + ensure_no_nested_unroll(literal_unroll_loops) + # assemble info + literal_unroll_info = collect_literal_unroll_info(literal_unroll_loops) + if not literal_unroll_info: + return False + + # 2. Do the unroll, get a loop and process it! + info = literal_unroll_info[0] + self.unroll_loop(state, info) + + # 3. Rebuild the state, the IR has taken a hammering + func_ir.blocks = simplify_CFG(func_ir.blocks) + post_proc = postproc.PostProcessor(func_ir) + post_proc.run() + if self._DEBUG: + print('-' * 80 + "END OF PASS, SIMPLIFY DONE") + func_ir.dump() + func_ir._definitions = build_definitions(func_ir.blocks) + return True + + def unroll_loop(self, state, loop_info): + # The general idea here is to: + # 1. Find *a* getitem that conforms to the literal_unroll semantic, + # i.e. one that is targeting a tuple with a loop induced index + # 2. Compute a structure from the tuple that describes which + # iterations of a loop will have which type + # 3. Generate a switch table in IR form for the structure in 2 + # 4. Switch out getitems for the tuple for a `typed_getitem` + # 5. Inject switch table as replacement loop body + # 6. Patch up + func_ir = state.func_ir + getitem_target = loop_info.arg + target_ty = state.typemap[getitem_target.name] + assert isinstance(target_ty, self._accepted_types) + + # 1. find a "getitem" that conforms + tuple_getitem = [] + for lbl in loop_info.loop.body: + blk = func_ir.blocks[lbl] + for stmt in blk.body: + if isinstance(stmt, ir.Assign): + if isinstance(stmt.value, + ir.Expr) and stmt.value.op == "getitem": + # try a couple of spellings... a[i] and ref(a)[i] + if stmt.value.value != getitem_target: + dfn = func_ir.get_definition(stmt.value.value) + try: + args = getattr(dfn, 'args', False) + except KeyError: + continue + if not args: + continue + if not args[0] == getitem_target: + continue + target_ty = state.typemap[getitem_target.name] + if not isinstance(target_ty, self._accepted_types): + continue + tuple_getitem.append(stmt) + + if not tuple_getitem: + msg = ("Loop unrolling analysis has failed, there's no getitem " + "in loop body that conforms to literal_unroll " + "requirements.") + LOC = func_ir.blocks[loop_info.loop.header].loc + raise errors.CompilerError(msg, LOC) + + # 2. get switch data + switch_data = self.analyse_tuple(target_ty) + + # 3. generate switch IR + index = func_ir._definitions[tuple_getitem[0].value.index.name][0] + branches = self.gen_switch(switch_data, index) + + # 4. swap getitems for a typed_getitem, these are actually just + # placeholders at this point. When the loop is duplicated they can + # be swapped for a typed_getitem of the correct type or if the item + # is literal it can be shoved straight into the duplicated loop body + for item in tuple_getitem: + old = item.value + new = ir.Expr.typed_getitem( + old.value, types.void, old.index, old.loc) + item.value = new + + # 5. Inject switch table + + # Find the actual loop without the header (that won't get replaced) + # and derive some new IR for this set of blocks + this_loop = loop_info.loop + this_loop_body = this_loop.body - \ + set([this_loop.header]) + loop_blocks = { + x: func_ir.blocks[x] for x in this_loop_body} + new_ir = func_ir.derive(loop_blocks) + + # Work out what is live on entry and exit so as to prevent + # replacement (defined vars can escape, used vars live at the header + # need to remain as-is so their references are correct, they can + # also escape). + + usedefs = compute_use_defs(func_ir.blocks) + idx = this_loop.header + keep = set() + keep |= usedefs.usemap[idx] | usedefs.defmap[idx] + keep |= func_ir.variable_lifetime.livemap[idx] + dont_replace = [x for x in (keep)] + + # compute the unrolled body + unrolled_body = self.inject_loop_body( + branches, new_ir, max(func_ir.blocks.keys()) + 1, + dont_replace, switch_data) + + # 6. Patch in the unrolled body and fix up + blks = state.func_ir.blocks + the_scope = next(iter(blks.values())).scope + orig_lbl = tuple(this_loop_body) + + replace, *delete = orig_lbl + unroll, header_block = unrolled_body, this_loop.header + unroll_lbl = [x for x in sorted(unroll.blocks.keys())] + blks[replace] = transfer_scope(unroll.blocks[unroll_lbl[0]], the_scope) + [blks.pop(d) for d in delete] + for k in unroll_lbl[1:]: + blks[k] = transfer_scope(unroll.blocks[k], the_scope) + # stitch up the loop predicate true -> new loop body jump + blks[header_block].body[-1].truebr = replace + + def run_pass(self, state): + mutated = False + func_ir = state.func_ir + # first limit the work by squashing the CFG if possible + func_ir.blocks = simplify_CFG(func_ir.blocks) + + if self._DEBUG: + print("-" * 80 + "PASS ENTRY") + func_ir.dump() + print("-" * 80) + + # limitations: + # 1. No nested unrolls + # 2. Opt in via `numba.literal_unroll` + # 3. No multiple mix-tuple use + + # keep running the transform loop until it reports no more changes + while (True): + stat = self.apply_transform(state) + mutated |= stat + if not stat: + break + + # reset type inference now we are done with the partial results + state.typemap = {} + state.calltypes = None + + return mutated + + +@register_pass(mutates_CFG=True, analysis_only=False) +class IterLoopCanonicalization(FunctionPass): + """ Transforms loops that are induced by `getiter` into range() driven loops + If the typemap is available this will only impact Tuple and UniTuple, if it + is not available it will impact all matching loops. + """ + _name = "iter_loop_canonicalisation" + + _DEBUG = False + + # if partial typing info is available it will only look at these types + _accepted_types = (types.BaseTuple, types.LiteralList) + _accepted_calls = (literal_unroll,) + + def __init__(self): + FunctionPass.__init__(self) + + def assess_loop(self, loop, func_ir, partial_typemap=None): + # it's a iter loop if: + # - loop header is driven by an iternext + # - the iternext value is a phi derived from getiter() + + # check header + iternexts = [_ for _ in + func_ir.blocks[loop.header].find_exprs('iternext')] + if len(iternexts) != 1: + return False + for iternext in iternexts: + phi = guard(get_definition, func_ir, iternext.value) + if phi is None: + return False + if getattr(phi, 'op', False) == 'getiter': + if partial_typemap: + # check that the call site is accepted, until we're + # confident that tuple unrolling is behaving require opt-in + # guard of `literal_unroll`, remove this later! + phi_val_defn = guard(get_definition, func_ir, phi.value) + if not isinstance(phi_val_defn, ir.Expr): + return False + if not phi_val_defn.op == "call": + return False + call = guard(get_definition, func_ir, phi_val_defn) + if call is None or len(call.args) != 1: + return False + func_var = guard(get_definition, func_ir, call.func) + func = guard(get_definition, func_ir, func_var) + if func is None or not isinstance(func, + (ir.Global, ir.FreeVar)): + return False + if (func.value is None or + func.value not in self._accepted_calls): + return False + + # now check the type is supported + ty = partial_typemap.get(call.args[0].name, None) + if ty and isinstance(ty, self._accepted_types): + return len(loop.entries) == 1 + else: + return len(loop.entries) == 1 + + def transform(self, loop, func_ir, cfg): + def get_range(a): + return range(len(a)) + + iternext = [_ for _ in + func_ir.blocks[loop.header].find_exprs('iternext')][0] + LOC = func_ir.blocks[loop.header].loc + scope = func_ir.blocks[loop.header].scope + get_range_var = scope.redefine("CANONICALISER_get_range_gbl", LOC) + get_range_global = ir.Global('get_range', get_range, LOC) + assgn = ir.Assign(get_range_global, get_range_var, LOC) + + loop_entry = tuple(loop.entries)[0] + entry_block = func_ir.blocks[loop_entry] + entry_block.body.insert(0, assgn) + + iterarg = guard(get_definition, func_ir, iternext.value) + if iterarg is not None: + iterarg = iterarg.value + + # look for iternext + idx = 0 + for stmt in entry_block.body: + if isinstance(stmt, ir.Assign): + if isinstance(stmt.value, + ir.Expr) and stmt.value.op == 'getiter': + break + idx += 1 + else: + raise ValueError("problem") + + # create a range(len(tup)) and inject it + call_get_range_var = scope.redefine('CANONICALISER_call_get_range', LOC) + make_call = ir.Expr.call(get_range_var, (stmt.value.value,), (), LOC) + assgn_call = ir.Assign(make_call, call_get_range_var, LOC) + entry_block.body.insert(idx, assgn_call) + entry_block.body[idx + 1].value.value = call_get_range_var + + glbls = copy(func_ir.func_id.func.__globals__) + from numba.core.inline_closurecall import inline_closure_call + inline_closure_call(func_ir, glbls, entry_block, idx, get_range,) + kill = entry_block.body.index(assgn) + entry_block.body.pop(kill) + + # find the induction variable + references in the loop header + # fixed point iter to do this, it's a bit clunky + induction_vars = set() + header_block = func_ir.blocks[loop.header] + + # find induction var + ind = [x for x in header_block.find_exprs('pair_first')] + for x in ind: + induction_vars.add(func_ir.get_assignee(x, loop.header)) + # find aliases of the induction var + tmp = set() + for x in induction_vars: + try: # there's not always an alias, e.g. loop from inlined closure + tmp.add(func_ir.get_assignee(x, loop.header)) + except ValueError: + pass + induction_vars |= tmp + induction_var_names = set([x.name for x in induction_vars]) + + # Find the downstream blocks that might reference the induction var + succ = set() + for lbl in loop.exits: + succ |= set([x[0] for x in cfg.successors(lbl)]) + check_blocks = (loop.body | loop.exits | succ) ^ {loop.header} + + # replace RHS use of induction var with getitem + for lbl in check_blocks: + for stmt in func_ir.blocks[lbl].body: + if isinstance(stmt, ir.Assign): + # check for aliases + try: + lookup = getattr(stmt.value, 'name', None) + except KeyError: + continue + if lookup and lookup in induction_var_names: + stmt.value = ir.Expr.getitem( + iterarg, stmt.value, stmt.loc) + + post_proc = postproc.PostProcessor(func_ir) + post_proc.run() + + def run_pass(self, state): + func_ir = state.func_ir + cfg = compute_cfg_from_blocks(func_ir.blocks) + loops = cfg.loops() + + mutated = False + for header, loop in loops.items(): + stat = self.assess_loop(loop, func_ir, state.typemap) + if stat: + if self._DEBUG: + print("Canonicalising loop", loop) + self.transform(loop, func_ir, cfg) + mutated = True + else: + if self._DEBUG: + print("NOT Canonicalising loop", loop) + + func_ir.blocks = simplify_CFG(func_ir.blocks) + return mutated + + +@register_pass(mutates_CFG=False, analysis_only=False) +class PropagateLiterals(FunctionPass): + """Implement literal propagation based on partial type inference""" + _name = "PropagateLiterals" + + def __init__(self): + FunctionPass.__init__(self) + + def get_analysis_usage(self, AU): + AU.add_required(ReconstructSSA) + + def run_pass(self, state): + func_ir = state.func_ir + typemap = state.typemap + flags = state.flags + + accepted_functions = ('isinstance', 'hasattr') + + if not hasattr(func_ir, '_definitions') \ + and not flags.enable_ssa: + func_ir._definitions = build_definitions(func_ir.blocks) + + changed = False + + for block in func_ir.blocks.values(): + for assign in block.find_insts(ir.Assign): + value = assign.value + if isinstance(value, (ir.Arg, ir.Const, ir.FreeVar, ir.Global)): + continue + + # 1) Don't change return stmt in the form + # $return_xyz = cast(value=ABC) + # 2) Don't propagate literal values that are not primitives + if isinstance(value, ir.Expr) and \ + value.op in ('cast', 'build_map', 'build_list', + 'build_tuple', 'build_set'): + continue + + target = assign.target + if not flags.enable_ssa: + # SSA is disabled when doing inlining + if guard(get_definition, func_ir, target.name) is None: # noqa: E501 + continue + + # Numba cannot safely determine if an isinstance call + # with a PHI node is True/False. For instance, in + # the case below, the partial type inference step can coerce + # '$z' to float, so any call to 'isinstance(z, int)' would fail. + # + # def fn(x): + # if x > 4: + # z = 1 + # else: + # z = 3.14 + # if isinstance(z, int): + # print('int') + # else: + # print('float') + # + # At the moment, one avoid propagating the literal + # value if the argument is a PHI node + + if isinstance(value, ir.Expr) and value.op == 'call': + + fn = guard(get_definition, func_ir, value.func.name) + if fn is None: + continue + + if not (isinstance(fn, ir.Global) and fn.name in + accepted_functions): + continue + + for arg in value.args: + # check if any of the args to isinstance is a PHI node + iv = func_ir._definitions[arg.name] + assert len(iv) == 1 # SSA! + if isinstance(iv[0], ir.Expr) and iv[0].op == 'phi': + msg = (f'{fn.name}() cannot determine the ' + f'type of variable "{arg.unversioned_name}" ' + 'due to a branch.') + raise errors.NumbaTypeError(msg, loc=assign.loc) + + # Only propagate a PHI node if all arguments are the same + # constant + if isinstance(value, ir.Expr) and value.op == 'phi': + # typemap will return None in case `inc.name` not in typemap + v = [typemap.get(inc.name) for inc in value.incoming_values] + # stop if the elements in `v` do not hold the same value + if v[0] is not None and any([v[0] != vi for vi in v]): + continue + + lit = typemap.get(target.name, None) + if lit and isinstance(lit, types.Literal): + # replace assign instruction by ir.Const(lit) iff + # lit is a literal value + rhs = ir.Const(lit.literal_value, assign.loc) + new_assign = ir.Assign(rhs, target, assign.loc) + + # replace instruction + block.insert_after(new_assign, assign) + block.remove(assign) + + changed = True + + # reset type inference now we are done with the partial results + state.typemap = None + state.calltypes = None + + if changed: + # Rebuild definitions + func_ir._definitions = build_definitions(func_ir.blocks) + + return changed + + +@register_pass(mutates_CFG=True, analysis_only=False) +class LiteralPropagationSubPipelinePass(FunctionPass): + """Implement literal propagation based on partial type inference""" + _name = "LiteralPropagation" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + # Determine whether to even attempt this pass... if there's no + # `isinstance` as a global or as a freevar then just skip. + + found = False + func_ir = state.func_ir + for blk in func_ir.blocks.values(): + for asgn in blk.find_insts(ir.Assign): + if isinstance(asgn.value, (ir.Global, ir.FreeVar)): + value = asgn.value.value + if value is isinstance or value is hasattr: + found = True + break + if found: + break + if not found: + return False + + # run as subpipeline + from numba.core.compiler_machinery import PassManager + from numba.core.typed_passes import PartialTypeInference + pm = PassManager("literal_propagation_subpipeline") + + pm.add_pass(PartialTypeInference, "performs partial type inference") + pm.add_pass(PropagateLiterals, "performs propagation of literal values") + + # rewrite consts / dead branch pruning + pm.add_pass(RewriteSemanticConstants, "rewrite semantic constants") + pm.add_pass(DeadBranchPrune, "dead branch pruning") + + pm.finalize() + pm.run(state) + return True + + def get_analysis_usage(self, AU): + AU.add_required(ReconstructSSA) + + +@register_pass(mutates_CFG=True, analysis_only=False) +class LiteralUnroll(FunctionPass): + """Implement the literal_unroll semantics""" + _name = "literal_unroll" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + # Determine whether to even attempt this pass... if there's no + # `literal_unroll` as a global or as a freevar then just skip. + found = False + func_ir = state.func_ir + for blk in func_ir.blocks.values(): + for asgn in blk.find_insts(ir.Assign): + if isinstance(asgn.value, (ir.Global, ir.FreeVar)): + if asgn.value.value is literal_unroll: + found = True + break + if found: + break + if not found: + return False + + # run as subpipeline + from numba.core.compiler_machinery import PassManager + from numba.core.typed_passes import PartialTypeInference + pm = PassManager("literal_unroll_subpipeline") + # get types where possible to help with list->tuple change + pm.add_pass(PartialTypeInference, "performs partial type inference") + # make const lists tuples + pm.add_pass(TransformLiteralUnrollConstListToTuple, + "switch const list for tuples") + # recompute partial typemap following IR change + pm.add_pass(PartialTypeInference, "performs partial type inference") + # canonicalise loops + pm.add_pass(IterLoopCanonicalization, + "switch iter loops for range driven loops") + # rewrite consts + pm.add_pass(RewriteSemanticConstants, "rewrite semantic constants") + # do the unroll + pm.add_pass(MixedContainerUnroller, "performs mixed container unroll") + # rewrite dynamic getitem to static getitem as it's possible some more + # getitems will now be statically resolvable + pm.add_pass(GenericRewrites, "Generic Rewrites") + pm.add_pass(RewriteSemanticConstants, "rewrite semantic constants") + pm.finalize() + pm.run(state) + return True + + +@register_pass(mutates_CFG=True, analysis_only=False) +class SimplifyCFG(FunctionPass): + """Perform CFG simplification""" + _name = "simplify_cfg" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + blks = state.func_ir.blocks + new_blks = simplify_CFG(blks) + state.func_ir.blocks = new_blks + mutated = blks != new_blks + return mutated + + +@register_pass(mutates_CFG=False, analysis_only=False) +class ReconstructSSA(FunctionPass): + """Perform SSA-reconstruction + + Produces minimal SSA. + """ + _name = "reconstruct_ssa" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + state.func_ir = reconstruct_ssa(state.func_ir) + self._patch_locals(state) + + # Rebuild definitions + state.func_ir._definitions = build_definitions(state.func_ir.blocks) + + # Rerun postprocessor to update metadata + # example generator_info + post_proc = postproc.PostProcessor(state.func_ir) + post_proc.run(emit_dels=False) + + if config.DEBUG or config.DUMP_SSA: + name = state.func_ir.func_id.func_qualname + print(f"SSA IR DUMP: {name}".center(80, "-")) + state.func_ir.dump() + + return True # XXX detect if it actually got changed + + def _patch_locals(self, state): + # Fix dispatcher locals dictionary type annotation + locals_dict = state.get('locals') + if locals_dict is None: + return + + first_blk, *_ = state.func_ir.blocks.values() + scope = first_blk.scope + for parent, redefs in scope.var_redefinitions.items(): + if parent in locals_dict: + typ = locals_dict[parent] + for derived in redefs: + locals_dict[derived] = typ + + +@register_pass(mutates_CFG=False, analysis_only=False) +class RewriteDynamicRaises(FunctionPass): + """Replace existing raise statements by dynamic raises in Numba IR. + """ + _name = "Rewrite dynamic raises" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + func_ir = state.func_ir + changed = False + + for block in func_ir.blocks.values(): + for raise_ in block.find_insts((ir.Raise, ir.TryRaise)): + call_inst = guard(get_definition, func_ir, raise_.exception) + if call_inst is None: + continue + exc_type = func_ir.infer_constant(call_inst.func.name) + exc_args = [] + for exc_arg in call_inst.args: + try: + const = func_ir.infer_constant(exc_arg) + exc_args.append(const) + except consts.ConstantInferenceError: + exc_args.append(exc_arg) + loc = raise_.loc + + cls = { + ir.TryRaise: ir.DynamicTryRaise, + ir.Raise: ir.DynamicRaise, + }[type(raise_)] + + dyn_raise = cls(exc_type, tuple(exc_args), loc) + block.insert_after(dyn_raise, raise_) + block.remove(raise_) + changed = True + return changed diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/utils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..3439982f90d05a3eba253a098e961dd7c3335202 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/utils.py @@ -0,0 +1,775 @@ +import atexit +import builtins +import functools +import inspect +import os +import operator +import timeit +import math +import sys +import traceback +import weakref +import warnings +import threading +import contextlib +import json +import typing as _tp +from pprint import pformat + +from types import ModuleType +from importlib import import_module +import numpy as np + +from inspect import signature as pysignature # noqa: F401 +from inspect import Signature as pySignature # noqa: F401 +from inspect import Parameter as pyParameter # noqa: F401 + +from numba.core.config import (PYVERSION, MACHINE_BITS, # noqa: F401 + DEVELOPER_MODE) # noqa: F401 +from numba.core import config +from numba.core import types + +from collections.abc import Mapping, Sequence, MutableSet, MutableMapping + + +def erase_traceback(exc_value): + """ + Erase the traceback and hanging locals from the given exception instance. + """ + if exc_value.__traceback__ is not None: + traceback.clear_frames(exc_value.__traceback__) + return exc_value.with_traceback(None) + + +def safe_relpath(path, start=os.curdir): + """ + Produces a "safe" relative path, on windows relpath doesn't work across + drives as technically they don't share the same root. + See: https://bugs.python.org/issue7195 for details. + """ + # find the drive letters for path and start and if they are not the same + # then don't use relpath! + drive_letter = lambda x: os.path.splitdrive(os.path.abspath(x))[0] + drive_path = drive_letter(path) + drive_start = drive_letter(start) + if drive_path != drive_start: + return os.path.abspath(path) + else: + return os.path.relpath(path, start=start) + + +# Mapping between operator module functions and the corresponding built-in +# operators. + +BINOPS_TO_OPERATORS = { + '+': operator.add, + '-': operator.sub, + '*': operator.mul, + '//': operator.floordiv, + '/': operator.truediv, + '%': operator.mod, + '**': operator.pow, + '&': operator.and_, + '|': operator.or_, + '^': operator.xor, + '<<': operator.lshift, + '>>': operator.rshift, + '==': operator.eq, + '!=': operator.ne, + '<': operator.lt, + '<=': operator.le, + '>': operator.gt, + '>=': operator.ge, + 'is': operator.is_, + 'is not': operator.is_not, + # This one has its args reversed! + 'in': operator.contains, + '@': operator.matmul, +} + +INPLACE_BINOPS_TO_OPERATORS = { + '+=': operator.iadd, + '-=': operator.isub, + '*=': operator.imul, + '//=': operator.ifloordiv, + '/=': operator.itruediv, + '%=': operator.imod, + '**=': operator.ipow, + '&=': operator.iand, + '|=': operator.ior, + '^=': operator.ixor, + '<<=': operator.ilshift, + '>>=': operator.irshift, + '@=': operator.imatmul, +} + + +ALL_BINOPS_TO_OPERATORS = {**BINOPS_TO_OPERATORS, + **INPLACE_BINOPS_TO_OPERATORS} + + +UNARY_BUITINS_TO_OPERATORS = { + '+': operator.pos, + '-': operator.neg, + '~': operator.invert, + 'not': operator.not_, + 'is_true': operator.truth +} + +OPERATORS_TO_BUILTINS = { + operator.add: '+', + operator.iadd: '+=', + operator.sub: '-', + operator.isub: '-=', + operator.mul: '*', + operator.imul: '*=', + operator.floordiv: '//', + operator.ifloordiv: '//=', + operator.truediv: '/', + operator.itruediv: '/=', + operator.mod: '%', + operator.imod: '%=', + operator.pow: '**', + operator.ipow: '**=', + operator.and_: '&', + operator.iand: '&=', + operator.or_: '|', + operator.ior: '|=', + operator.xor: '^', + operator.ixor: '^=', + operator.lshift: '<<', + operator.ilshift: '<<=', + operator.rshift: '>>', + operator.irshift: '>>=', + operator.eq: '==', + operator.ne: '!=', + operator.lt: '<', + operator.le: '<=', + operator.gt: '>', + operator.ge: '>=', + operator.is_: 'is', + operator.is_not: 'is not', + # This one has its args reversed! + operator.contains: 'in', + # Unary + operator.pos: '+', + operator.neg: '-', + operator.invert: '~', + operator.not_: 'not', + operator.truth: 'is_true', +} + + +_shutting_down = False + + +def _at_shutdown(): + global _shutting_down + _shutting_down = True + + +def shutting_down(globals=globals): + """ + Whether the interpreter is currently shutting down. + For use in finalizers, __del__ methods, and similar; it is advised + to early bind this function rather than look it up when calling it, + since at shutdown module globals may be cleared. + """ + # At shutdown, the attribute may have been cleared or set to None. + v = globals().get('_shutting_down') + return v is True or v is None + + +# weakref.finalize registers an exit function that runs all finalizers for +# which atexit is True. Some of these finalizers may call shutting_down() to +# check whether the interpreter is shutting down. For this to behave correctly, +# we need to make sure that _at_shutdown is called before the finalizer exit +# function. Since atexit operates as a LIFO stack, we first construct a dummy +# finalizer then register atexit to ensure this ordering. +weakref.finalize(lambda: None, lambda: None) +atexit.register(_at_shutdown) + + +class ThreadLocalStack: + """A TLS stack container. + + Uses the BORG pattern and stores states in threadlocal storage. + """ + _tls = threading.local() + stack_name: str + _registered = {} + + def __init_subclass__(cls, *, stack_name, **kwargs): + super().__init_subclass__(**kwargs) + # Register stack_name mapping to the new subclass + assert stack_name not in cls._registered, \ + f"stack_name: '{stack_name}' already in use" + cls.stack_name = stack_name + cls._registered[stack_name] = cls + + def __init__(self): + # This class must not be used directly. + assert type(self) is not ThreadLocalStack + tls = self._tls + attr = f"stack_{self.stack_name}" + try: + tls_stack = getattr(tls, attr) + except AttributeError: + tls_stack = list() + setattr(tls, attr, tls_stack) + + self._stack = tls_stack + + def push(self, state): + """Push to the stack + """ + self._stack.append(state) + + def pop(self): + """Pop from the stack + """ + return self._stack.pop() + + def top(self): + """Get the top item on the stack. + + Raises IndexError if the stack is empty. Users should check the size + of the stack beforehand. + """ + return self._stack[-1] + + def __len__(self): + return len(self._stack) + + @contextlib.contextmanager + def enter(self, state): + """A contextmanager that pushes ``state`` for the duration of the + context. + """ + self.push(state) + try: + yield + finally: + self.pop() + + +class ConfigOptions(object): + OPTIONS = {} + + def __init__(self): + self._values = self.OPTIONS.copy() + + def set(self, name, value=True): + if name not in self.OPTIONS: + raise NameError("Invalid flag: %s" % name) + self._values[name] = value + + def unset(self, name): + self.set(name, False) + + def _check_attr(self, name): + if name not in self.OPTIONS: + raise AttributeError("Invalid flag: %s" % name) + + def __getattr__(self, name): + self._check_attr(name) + return self._values[name] + + def __setattr__(self, name, value): + if name.startswith('_'): + super(ConfigOptions, self).__setattr__(name, value) + else: + self._check_attr(name) + self._values[name] = value + + def __repr__(self): + return "Flags(%s)" % ', '.join('%s=%s' % (k, v) + for k, v in self._values.items() + if v is not False) + + def copy(self): + copy = type(self)() + copy._values = self._values.copy() + return copy + + def __eq__(self, other): + return (isinstance(other, ConfigOptions) and + other._values == self._values) + + def __ne__(self, other): + return not self == other + + def __hash__(self): + return hash(tuple(sorted(self._values.items()))) + + +def order_by_target_specificity(target, templates, fnkey=''): + """This orders the given templates from most to least specific against the + current "target". "fnkey" is an indicative typing key for use in the + exception message in the case that there's no usable templates for the + current "target". + """ + # No templates... return early! + if templates == []: + return [] + + from numba.core.target_extension import target_registry + + # fish out templates that are specific to the target if a target is + # specified + DEFAULT_TARGET = 'generic' + usable = [] + for ix, temp_cls in enumerate(templates): + # ? Need to do something about this next line + md = getattr(temp_cls, "metadata", {}) + hw = md.get('target', DEFAULT_TARGET) + if hw is not None: + hw_clazz = target_registry[hw] + if target.inherits_from(hw_clazz): + usable.append((temp_cls, hw_clazz, ix)) + + # sort templates based on target specificity + def key(x): + return target.__mro__.index(x[1]) + order = [x[0] for x in sorted(usable, key=key)] + + if not order: + msg = (f"Function resolution cannot find any matches for function " + f"'{fnkey}' for the current target: '{target}'.") + from numba.core.errors import UnsupportedError + raise UnsupportedError(msg) + + return order + + +T = _tp.TypeVar('T') + + +class OrderedSet(MutableSet[T]): + + def __init__(self, iterable: _tp.Iterable[T] = ()): + # Just uses a dictionary under-the-hood to maintain insertion order. + self._data = dict.fromkeys(iterable, None) + + def __contains__(self, key): + return key in self._data + + def __iter__(self): + return iter(self._data) + + def __len__(self): + return len(self._data) + + def add(self, item): + self._data[item] = None + + def discard(self, item): + self._data.pop(item, None) + + +class MutableSortedSet(MutableSet[T], _tp.Generic[T]): + """Mutable Sorted Set + """ + + def __init__(self, values: _tp.Iterable[T] = ()): + self._values = set(values) + + def __len__(self): + return len(self._values) + + def __iter__(self): + return iter(k for k in sorted(self._values)) + + def __contains__(self, x: T) -> bool: + return self._values.__contains__(x) + + def add(self, x: T): + return self._values.add(x) + + def discard(self, value: T): + self._values.discard(value) + + def update(self, values): + self._values.update(values) + + +Tk = _tp.TypeVar('Tk') +Tv = _tp.TypeVar('Tv') + + +class SortedMap(Mapping[Tk, Tv], _tp.Generic[Tk, Tv]): + """Immutable + """ + + def __init__(self, seq): + self._values = [] + self._index = {} + for i, (k, v) in enumerate(sorted(seq)): + self._index[k] = i + self._values.append((k, v)) + + def __getitem__(self, k): + i = self._index[k] + return self._values[i][1] + + def __len__(self): + return len(self._values) + + def __iter__(self): + return iter(k for k, v in self._values) + + +class MutableSortedMap(MutableMapping[Tk, Tv], _tp.Generic[Tk, Tv]): + def __init__(self, dct=None): + if dct is None: + dct = {} + self._dct: dict[Tk, Tv] = dct + + def __getitem__(self, k: Tk) -> Tv: + return self._dct[k] + + def __setitem__(self, k: Tk, v: Tv): + self._dct[k] = v + + def __delitem__(self, k: Tk): + del self._dct[k] + + def __len__(self) -> int: + return len(self._dct) + + def __iter__(self) -> int: + return iter(k for k in sorted(self._dct)) + + +class UniqueDict(dict): + def __setitem__(self, key, value): + if key in self: + raise AssertionError("key already in dictionary: %r" % (key,)) + super(UniqueDict, self).__setitem__(key, value) + + +def runonce(fn): + @functools.wraps(fn) + def inner(): + if not inner._ran: + res = fn() + inner._result = res + inner._ran = True + return inner._result + + inner._ran = False + return inner + + +def bit_length(intval): + """ + Return the number of bits necessary to represent integer `intval`. + """ + assert isinstance(intval, int) + if intval >= 0: + return len(bin(intval)) - 2 + else: + return len(bin(-intval - 1)) - 2 + + +def stream_list(lst): + """ + Given a list, return an infinite iterator of iterators. + Each iterator iterates over the list from the last seen point up to + the current end-of-list. + + In effect, each iterator will give the newly appended elements from the + previous iterator instantiation time. + """ + def sublist_iterator(start, stop): + return iter(lst[start:stop]) + + start = 0 + while True: + stop = len(lst) + yield sublist_iterator(start, stop) + start = stop + + +class BenchmarkResult(object): + def __init__(self, func, records, loop): + self.func = func + self.loop = loop + self.records = np.array(records) / loop + self.best = np.min(self.records) + + def __repr__(self): + name = getattr(self.func, "__name__", self.func) + args = (name, self.loop, self.records.size, format_time(self.best)) + return "%20s: %10d loops, best of %d: %s per loop" % args + + +def format_time(tm): + units = "s ms us ns ps".split() + base = 1 + for unit in units[:-1]: + if tm >= base: + break + base /= 1000 + else: + unit = units[-1] + return "%.1f%s" % (tm / base, unit) + + +def benchmark(func, maxsec=1): + timer = timeit.Timer(func) + number = 1 + result = timer.repeat(1, number) + # Too fast to be measured + while min(result) / number == 0: + number *= 10 + result = timer.repeat(3, number) + best = min(result) / number + if best >= maxsec: + return BenchmarkResult(func, result, number) + # Scale it up to make it close the maximum time + max_per_run_time = maxsec / 3 / number + number = max(max_per_run_time / best / 3, 1) + # Round to the next power of 10 + number = int(10 ** math.ceil(math.log10(number))) + records = timer.repeat(3, number) + return BenchmarkResult(func, records, number) + + +# A dummy module for dynamically-generated functions +_dynamic_modname = '' +_dynamic_module = ModuleType(_dynamic_modname) +_dynamic_module.__builtins__ = builtins + + +def chain_exception(new_exc, old_exc): + """Set the __cause__ attribute on *new_exc* for explicit exception + chaining. Returns the inplace modified *new_exc*. + """ + if DEVELOPER_MODE: + new_exc.__cause__ = old_exc + return new_exc + + +def get_nargs_range(pyfunc): + """Return the minimal and maximal number of Python function + positional arguments. + """ + sig = pysignature(pyfunc) + min_nargs = 0 + max_nargs = 0 + for p in sig.parameters.values(): + max_nargs += 1 + if p.default == inspect._empty: + min_nargs += 1 + return min_nargs, max_nargs + + +def unify_function_types(numba_types): + """Return a normalized tuple of Numba function types so that + + Tuple(numba_types) + + becomes + + UniTuple(dtype=, count=len(numba_types)) + + If the above transformation would be incorrect, return the + original input as given. For instance, if the input tuple contains + types that are not function or dispatcher type, the transformation + is considered incorrect. + """ + dtype = unified_function_type(numba_types) + if dtype is None: + return numba_types + return (dtype,) * len(numba_types) + + +def unified_function_type(numba_types, require_precise=True): + """Returns a unified Numba function type if possible. + + Parameters + ---------- + numba_types : Sequence of numba Type instances. + require_precise : bool + If True, the returned Numba function type must be precise. + + Returns + ------- + typ : {numba.core.types.Type, None} + A unified Numba function type. Or ``None`` when the Numba types + cannot be unified, e.g. when the ``numba_types`` contains at + least two different Numba function type instances. + + If ``numba_types`` contains a Numba dispatcher type, the unified + Numba function type will be an imprecise ``UndefinedFunctionType`` + instance, or None when ``require_precise=True`` is specified. + + Specifying ``require_precise=False`` enables unifying imprecise + Numba dispatcher instances when used in tuples or if-then branches + when the precise Numba function cannot be determined on the first + occurrence that is not a call expression. + """ + from numba.core.errors import NumbaExperimentalFeatureWarning + + if not (isinstance(numba_types, Sequence) and + len(numba_types) > 0 and + isinstance(numba_types[0], + (types.Dispatcher, types.FunctionType))): + return + + warnings.warn("First-class function type feature is experimental", + category=NumbaExperimentalFeatureWarning) + + mnargs, mxargs = None, None + dispatchers = set() + function = None + undefined_function = None + + for t in numba_types: + if isinstance(t, types.Dispatcher): + mnargs1, mxargs1 = get_nargs_range(t.dispatcher.py_func) + if mnargs is None: + mnargs, mxargs = mnargs1, mxargs1 + elif not (mnargs, mxargs) == (mnargs1, mxargs1): + return + dispatchers.add(t.dispatcher) + t = t.dispatcher.get_function_type() + if t is None: + continue + if isinstance(t, types.FunctionType): + if mnargs is None: + mnargs = mxargs = t.nargs + elif not (mnargs == mxargs == t.nargs): + return + if isinstance(t, types.UndefinedFunctionType): + if undefined_function is None: + undefined_function = t + else: + # Refuse to unify using function type + return + dispatchers.update(t.dispatchers) + else: + if function is None: + function = t + else: + assert function == t + else: + return + if require_precise and (function is None or undefined_function is not None): + return + if function is not None: + if undefined_function is not None: + assert function.nargs == undefined_function.nargs + function = undefined_function + elif undefined_function is not None: + undefined_function.dispatchers.update(dispatchers) + function = undefined_function + else: + function = types.UndefinedFunctionType(mnargs, dispatchers) + + return function + + +class _RedirectSubpackage(ModuleType): + """Redirect a subpackage to a subpackage. + + This allows all references like: + + >>> from numba.old_subpackage import module + >>> module.item + + >>> import numba.old_subpackage.module + >>> numba.old_subpackage.module.item + + >>> from numba.old_subpackage.module import item + """ + def __init__(self, old_module_locals, new_module): + old_module = old_module_locals['__name__'] + super().__init__(old_module) + + self.__old_module_states = {} + self.__new_module = new_module + + new_mod_obj = import_module(new_module) + + # Map all sub-modules over + for k, v in new_mod_obj.__dict__.items(): + # Get attributes so that `subpackage.xyz` and + # `from subpackage import xyz` work + setattr(self, k, v) + if isinstance(v, ModuleType): + # Map modules into the interpreter so that + # `import subpackage.xyz` works + sys.modules[f"{old_module}.{k}"] = sys.modules[v.__name__] + + # copy across dunders so that package imports work too + for attr, value in old_module_locals.items(): + if attr.startswith('__') and attr.endswith('__'): + if attr != "__builtins__": + setattr(self, attr, value) + self.__old_module_states[attr] = value + + def __reduce__(self): + args = (self.__old_module_states, self.__new_module) + return _RedirectSubpackage, args + + +def get_hashable_key(value): + """ + Given a value, returns a key that can be used + as a hash. If the value is hashable, we return + the value, otherwise we return id(value). + + See discussion in gh #6957 + """ + try: + hash(value) + except TypeError: + return id(value) + else: + return value + + +class threadsafe_cached_property(functools.cached_property): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._lock = threading.RLock() + + def __get__(self, *args, **kwargs): + with self._lock: + return super().__get__(*args, **kwargs) + + +def dump_llvm(fndesc, module): + print(("LLVM DUMP %s" % fndesc).center(80, '-')) + if config.HIGHLIGHT_DUMPS: + try: + from pygments import highlight + from pygments.lexers import LlvmLexer as lexer + from pygments.formatters import Terminal256Formatter + from numba.misc.dump_style import by_colorscheme + print(highlight(module.__repr__(), lexer(), + Terminal256Formatter( style=by_colorscheme()))) + except ImportError: + msg = "Please install pygments to see highlighted dumps" + raise ValueError(msg) + else: + print(module) + print('=' * 80) + + +class _lazy_pformat(object): + def __init__(self, *args, **kwargs): + self.args = args + self.kwargs = kwargs + + def __str__(self): + return pformat(*self.args, **self.kwargs) + + +class _LazyJSONEncoder(json.JSONEncoder): + def default(self, obj): + if isinstance(obj, _lazy_pformat): + return str(obj) + return super().default(obj) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/core/withcontexts.py b/tool_server/.venv/lib/python3.12/site-packages/numba/core/withcontexts.py new file mode 100644 index 0000000000000000000000000000000000000000..e61cca969436fc4962adce49c698a70ca930b514 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/core/withcontexts.py @@ -0,0 +1,535 @@ +from numba.core import types, errors, ir, sigutils, ir_utils +from numba.core.typing.typeof import typeof_impl +from numba.core.transforms import find_region_inout_vars +from numba.core.ir_utils import build_definitions +import numba + + +class WithContext(object): + """A dummy object for use as contextmanager. + This can be used as a contextmanager. + """ + is_callable = False + + def __enter__(self): + pass + + def __exit__(self, typ, val, tb): + pass + + def mutate_with_body(self, func_ir, blocks, blk_start, blk_end, + body_blocks, dispatcher_factory, extra): + """Mutate the *blocks* to implement this contextmanager. + + Parameters + ---------- + func_ir : FunctionIR + blocks : dict[ir.Block] + blk_start, blk_end : int + labels of the starting and ending block of the context-manager. + body_block: sequence[int] + A sequence of int's representing labels of the with-body + dispatcher_factory : callable + A callable that takes a `FunctionIR` and returns a `Dispatcher`. + """ + raise NotImplementedError + + +@typeof_impl.register(WithContext) +def typeof_contextmanager(val, c): + return types.ContextManager(val) + + +def _get_var_parent(name): + """Get parent of the variable given its name + """ + # If not a temporary variable + if not name.startswith('$'): + # Return the base component of the name + return name.split('.', )[0] + + +def _clear_blocks(blocks, to_clear): + """Remove keys in *to_clear* from *blocks*. + """ + for b in to_clear: + del blocks[b] + + +class _ByPassContextType(WithContext): + """A simple context-manager that tells the compiler to bypass the body + of the with-block. + """ + def mutate_with_body(self, func_ir, blocks, blk_start, blk_end, + body_blocks, dispatcher_factory, extra): + assert extra is None + # Determine variables that need forwarding + vlt = func_ir.variable_lifetime + inmap = {_get_var_parent(k): k for k in vlt.livemap[blk_start]} + outmap = {_get_var_parent(k): k for k in vlt.livemap[blk_end]} + forwardvars = {inmap[k]: outmap[k] for k in filter(bool, outmap)} + # Transform the block + _bypass_with_context(blocks, blk_start, blk_end, forwardvars) + _clear_blocks(blocks, body_blocks) + + +bypass_context = _ByPassContextType() + + +class _CallContextType(WithContext): + """A simple context-manager that tells the compiler to lift the body of the + with-block as another function. + """ + def mutate_with_body(self, func_ir, blocks, blk_start, blk_end, + body_blocks, dispatcher_factory, extra): + assert extra is None + vlt = func_ir.variable_lifetime + + inputs, outputs = find_region_inout_vars( + blocks=blocks, + livemap=vlt.livemap, + callfrom=blk_start, + returnto=blk_end, + body_block_ids=set(body_blocks), + ) + + lifted_blks = {k: blocks[k] for k in body_blocks} + _mutate_with_block_callee(lifted_blks, blk_start, blk_end, + inputs, outputs) + + # XXX: transform body-blocks to return the output variables + lifted_ir = func_ir.derive( + blocks=lifted_blks, + arg_names=tuple(inputs), + arg_count=len(inputs), + force_non_generator=True, + ) + + dispatcher = dispatcher_factory(lifted_ir) + + newblk = _mutate_with_block_caller( + dispatcher, blocks, blk_start, blk_end, inputs, outputs, + ) + + blocks[blk_start] = newblk + _clear_blocks(blocks, body_blocks) + return dispatcher + + +call_context = _CallContextType() + + +class _ObjModeContextType(WithContext): + """Creates a contextmanager to be used inside jitted functions to enter + *object-mode* for using interpreter features. The body of the with-context + is lifted into a function that is compiled in *object-mode*. This + transformation process is limited and cannot process all possible + Python code. However, users can wrap complicated logic in another + Python function, which will then be executed by the interpreter. + + Use this as a function that takes keyword arguments only. + The argument names must correspond to the output variables from the + with-block. Their respective values can be: + + 1. strings representing the expected types; i.e. ``"float32"``. + 2. compile-time bound global or nonlocal variables referring to the + expected type. The variables are read at compile time. + + When exiting the with-context, the output variables are converted + to the expected nopython types according to the annotation. This process + is the same as passing Python objects into arguments of a nopython + function. + + Example:: + + import numpy as np + from numba import njit, objmode, types + + def bar(x): + # This code is executed by the interpreter. + return np.asarray(list(reversed(x.tolist()))) + + # Output type as global variable + out_ty = types.intp[:] + + @njit + def foo(): + x = np.arange(5) + y = np.zeros_like(x) + with objmode(y='intp[:]', z=out_ty): # annotate return type + # this region is executed by object-mode. + y += bar(x) + z = y + return y, z + + .. note:: Known limitations: + + - with-block cannot use incoming list objects. + - with-block cannot use incoming function objects. + - with-block cannot ``yield``, ``break``, ``return`` or ``raise`` \ + such that the execution will leave the with-block immediately. + - with-block cannot contain `with` statements. + - random number generator states do not synchronize; i.e. \ + nopython-mode and object-mode uses different RNG states. + + .. note:: When used outside of no-python mode, the context-manager has no + effect. + + .. warning:: This feature is experimental. The supported features may + change with or without notice. + + """ + is_callable = True + + def _legalize_args(self, func_ir, args, kwargs, loc, func_globals, + func_closures): + """ + Legalize arguments to the context-manager + + Parameters + ---------- + func_ir: FunctionIR + args: tuple + Positional arguments to the with-context call as IR nodes. + kwargs: dict + Keyword arguments to the with-context call as IR nodes. + loc: numba.core.ir.Loc + Source location of the with-context call. + func_globals: dict + The globals dictionary of the calling function. + func_closures: dict + The resolved closure variables of the calling function. + """ + if args: + raise errors.CompilerError( + "objectmode context doesn't take any positional arguments", + ) + typeanns = {} + + def report_error(varname, msg, loc): + raise errors.CompilerError( + f"Error handling objmode argument {varname!r}. {msg}", + loc=loc, + ) + + for k, v in kwargs.items(): + if isinstance(v, ir.Const) and isinstance(v.value, str): + typeanns[k] = sigutils._parse_signature_string(v.value) + elif isinstance(v, ir.FreeVar): + try: + v = func_closures[v.name] + except KeyError: + report_error( + varname=k, + msg=f"Freevar {v.name!r} is not defined.", + loc=loc, + ) + typeanns[k] = v + elif isinstance(v, ir.Global): + try: + v = func_globals[v.name] + except KeyError: + report_error( + varname=k, + msg=f"Global {v.name!r} is not defined.", + loc=loc, + ) + typeanns[k] = v + elif isinstance(v, ir.Expr) and v.op == "getattr": + try: + base_obj = func_ir.infer_constant(v.value) + typ = getattr(base_obj, v.attr) + except (errors.ConstantInferenceError, AttributeError): + report_error( + varname=k, + msg="Getattr cannot be resolved at compile-time.", + loc=loc, + ) + else: + typeanns[k] = typ + else: + report_error( + varname=k, + msg=("The value must be a compile-time constant either as " + "a non-local variable or a getattr expression that " + "refers to a Numba type."), + loc=loc + ) + + # Legalize the types for objmode + for name, typ in typeanns.items(): + self._legalize_arg_type(name, typ, loc) + + return typeanns + + def _legalize_arg_type(self, name, typ, loc): + """Legalize the argument type + + Parameters + ---------- + name: str + argument name. + typ: numba.core.types.Type + argument type. + loc: numba.core.ir.Loc + source location for error reporting. + """ + if getattr(typ, "reflected", False): + msgbuf = [ + "Objmode context failed.", + f"Argument {name!r} is declared as " + f"an unsupported type: {typ}.", + f"Reflected types are not supported.", + ] + raise errors.CompilerError(" ".join(msgbuf), loc=loc) + + def mutate_with_body(self, func_ir, blocks, blk_start, blk_end, + body_blocks, dispatcher_factory, extra): + cellnames = func_ir.func_id.func.__code__.co_freevars + closures = func_ir.func_id.func.__closure__ + func_globals = func_ir.func_id.func.__globals__ + if closures is not None: + # Resolve free variables + func_closures = {} + for cellname, closure in zip(cellnames, closures): + try: + cellval = closure.cell_contents + except ValueError as e: + # empty cell will raise + if str(e) != "Cell is empty": + raise + else: + func_closures[cellname] = cellval + else: + # Missing closure object + func_closures = {} + args = extra['args'] if extra else () + kwargs = extra['kwargs'] if extra else {} + + typeanns = self._legalize_args(func_ir=func_ir, + args=args, + kwargs=kwargs, + loc=blocks[blk_start].loc, + func_globals=func_globals, + func_closures=func_closures, + ) + vlt = func_ir.variable_lifetime + + inputs, outputs = find_region_inout_vars( + blocks=blocks, + livemap=vlt.livemap, + callfrom=blk_start, + returnto=blk_end, + body_block_ids=set(body_blocks), + ) + + # Determine types in the output tuple + def strip_var_ver(x): + return x.split('.', 1)[0] + + stripped_outs = list(map(strip_var_ver, outputs)) + + # Verify that only outputs are annotated + extra_annotated = set(typeanns) - set(stripped_outs) + if extra_annotated: + msg = ( + 'Invalid type annotation on non-outgoing variables: {}.' + 'Suggestion: remove annotation of the listed variables' + ) + raise errors.TypingError(msg.format(extra_annotated)) + + # Verify that all outputs are annotated + + # Note on "$cp" variable: + # ``transforms.consolidate_multi_exit_withs()`` introduces the variable + # for the control-point to determine the correct exit block. This + # variable crosses the with-region boundary. Thus, it will be consider + # an output variable leaving the lifted with-region. + typeanns["$cp"] = types.int32 + not_annotated = set(stripped_outs) - set(typeanns) + if not_annotated: + msg = ( + 'Missing type annotation on outgoing variable(s): {0}\n\n' + 'Example code: with objmode({1}=\'<' + 'add_type_as_string_here>\')\n' + ) + stable_ann = sorted(not_annotated) + raise errors.TypingError(msg.format(stable_ann, stable_ann[0])) + + # Get output types + outtup = types.Tuple([typeanns[v] for v in stripped_outs]) + + lifted_blks = {k: blocks[k] for k in body_blocks} + _mutate_with_block_callee(lifted_blks, blk_start, blk_end, + inputs, outputs) + + lifted_ir = func_ir.derive( + blocks=lifted_blks, + arg_names=tuple(inputs), + arg_count=len(inputs), + force_non_generator=True, + ) + + dispatcher = dispatcher_factory(lifted_ir, objectmode=True, + output_types=outtup) + + newblk = _mutate_with_block_caller( + dispatcher, blocks, blk_start, blk_end, inputs, outputs, + ) + + blocks[blk_start] = newblk + _clear_blocks(blocks, body_blocks) + return dispatcher + + def __call__(self, *args, **kwargs): + # No effect when used in pure-python + return self + + +objmode_context = _ObjModeContextType() + + +def _bypass_with_context(blocks, blk_start, blk_end, forwardvars): + """Given the starting and ending block of the with-context, + replaces the head block with a new block that jumps to the end. + + *blocks* is modified inplace. + """ + sblk = blocks[blk_start] + scope = sblk.scope + loc = sblk.loc + newblk = ir.Block(scope=scope, loc=loc) + for k, v in forwardvars.items(): + newblk.append(ir.Assign(value=scope.get_exact(k), + target=scope.get_exact(v), + loc=loc)) + newblk.append(ir.Jump(target=blk_end, loc=loc)) + blocks[blk_start] = newblk + + +def _mutate_with_block_caller(dispatcher, blocks, blk_start, blk_end, + inputs, outputs): + """Make a new block that calls into the lifeted with-context. + + Parameters + ---------- + dispatcher : Dispatcher + blocks : dict[ir.Block] + blk_start, blk_end : int + labels of the starting and ending block of the context-manager. + inputs: sequence[str] + Input variable names + outputs: sequence[str] + Output variable names + """ + sblk = blocks[blk_start] + scope = sblk.scope + loc = sblk.loc + newblock = ir.Block(scope=scope, loc=loc) + + ir_utils.fill_block_with_call( + newblock=newblock, + callee=dispatcher, + label_next=blk_end, + inputs=inputs, + outputs=outputs, + ) + return newblock + + +def _mutate_with_block_callee(blocks, blk_start, blk_end, inputs, outputs): + """Mutate *blocks* for the callee of a with-context. + + Parameters + ---------- + blocks : dict[ir.Block] + blk_start, blk_end : int + labels of the starting and ending block of the context-manager. + inputs: sequence[str] + Input variable names + outputs: sequence[str] + Output variable names + """ + if not blocks: + raise errors.NumbaValueError("No blocks in with-context block") + head_blk = min(blocks) + temp_blk = blocks[head_blk] + scope = temp_blk.scope + loc = temp_blk.loc + + blocks[blk_start] = ir_utils.fill_callee_prologue( + block=ir.Block(scope=scope, loc=loc), + inputs=inputs, + label_next=head_blk, + ) + blocks[blk_end] = ir_utils.fill_callee_epilogue( + block=ir.Block(scope=scope, loc=loc), + outputs=outputs, + ) + +class _ParallelChunksize(WithContext): + is_callable = True + + """A context-manager that on entry stores the current chunksize + for the executing parfors and then changes the current chunksize + to the programmer specified value. On exit the original + chunksize is restored. + """ + def mutate_with_body(self, func_ir, blocks, blk_start, blk_end, + body_blocks, dispatcher_factory, extra): + ir_utils.dprint_func_ir(func_ir, "Before with changes", blocks=blocks) + assert extra is not None + args = extra["args"] + assert len(args) == 1 + arg = args[0] + scope = blocks[blk_start].scope + loc = blocks[blk_start].loc + if isinstance(arg, ir.Arg): + arg = ir.Var(scope, arg.name, loc) + + set_state = [] + restore_state = [] + + # global for Numba itself + gvar = scope.redefine("$ngvar", loc) + set_state.append(ir.Assign(ir.Global('numba', numba, loc), gvar, loc)) + # getattr for set chunksize function in Numba + spcattr = ir.Expr.getattr(gvar, 'set_parallel_chunksize', loc) + spcvar = scope.redefine("$spc", loc) + set_state.append(ir.Assign(spcattr, spcvar, loc)) + # call set_parallel_chunksize + orig_pc_var = scope.redefine("$save_pc", loc) + cs_var = scope.redefine("$cs_var", loc) + set_state.append(ir.Assign(arg, cs_var, loc)) + spc_call = ir.Expr.call(spcvar, [cs_var], (), loc) + set_state.append(ir.Assign(spc_call, orig_pc_var, loc)) + + restore_spc_call = ir.Expr.call(spcvar, [orig_pc_var], (), loc) + restore_state.append(ir.Assign(restore_spc_call, orig_pc_var, loc)) + + blocks[blk_start].body = (blocks[blk_start].body[1:-1] + + set_state + + [blocks[blk_start].body[-1]]) + blocks[blk_end].body = restore_state + blocks[blk_end].body + func_ir._definitions = build_definitions(blocks) + ir_utils.dprint_func_ir(func_ir, "After with changes", blocks=blocks) + + def __call__(self, *args, **kwargs): + """Act like a function and enforce the contract that + setting the chunksize takes only one integer input. + """ + if len(args) != 1 or kwargs or not isinstance(args[0], int): + raise ValueError("parallel_chunksize takes only a " + "single integer argument.") + + self.chunksize = args[0] + return self + + def __enter__(self): + self.orig_chunksize = numba.get_parallel_chunksize() + numba.set_parallel_chunksize(self.chunksize) + + def __exit__(self, typ, val, tb): + numba.set_parallel_chunksize(self.orig_chunksize) + +parallel_chunksize = _ParallelChunksize() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/builtins.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..e9bdcd07aa9c8bed34a896ed3e48ed9801cbcb68 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/builtins.py @@ -0,0 +1,10 @@ +import sys +from numba.core.utils import _RedirectSubpackage +from numba.core import config + +if config.USE_LEGACY_TYPE_SYSTEM: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.old_builtins") +else: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.new_builtins") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/charseq.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/charseq.py new file mode 100644 index 0000000000000000000000000000000000000000..1157727e4165083dc7c0719b0bd41fd39a90da2d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/charseq.py @@ -0,0 +1,1023 @@ +"""Implements operations on bytes and str (unicode) array items.""" +import operator +import numpy as np +from llvmlite import ir + +from numba.core import types, cgutils, config +from numba.core.extending import (overload, intrinsic, overload_method, + lower_cast, register_jitable) +from numba.core.cgutils import is_nonelike +from numba.cpython import unicode + +# bytes and str arrays items are of type CharSeq and UnicodeCharSeq, +# respectively. See numpy/types/npytypes.py for CharSeq, +# UnicodeCharSeq definitions. The corresponding data models are +# defined in numpy/datamodel/models.py. Boxing/unboxing of item types +# are defined in numpy/targets/boxing.py, see box_unicodecharseq, +# unbox_unicodecharseq, box_charseq, unbox_charseq. + +s1_dtype = np.dtype('S1') +assert s1_dtype.itemsize == 1 +if config.USE_LEGACY_TYPE_SYSTEM: + bytes_type = types.Bytes(types.uint8, 1, "C", readonly=True) +else: + bytes_type = types.Bytes(types.c_uint8, 1, "C", readonly=True) + +# Currently, NumPy supports only UTF-32 arrays but this may change in +# future and the approach used here for supporting str arrays may need +# a revision depending on how NumPy will support UTF-8 and UTF-16 +# arrays. +u1_dtype = np.dtype('U1') +unicode_byte_width = u1_dtype.itemsize +unicode_uint = {1: np.uint8, 2: np.uint16, 4: np.uint32}[unicode_byte_width] +unicode_kind = {1: unicode.PY_UNICODE_1BYTE_KIND, + 2: unicode.PY_UNICODE_2BYTE_KIND, + 4: unicode.PY_UNICODE_4BYTE_KIND}[unicode_byte_width] + + +# this is modified version of numba.unicode.make_deref_codegen +def make_deref_codegen(bitsize): + def codegen(context, builder, signature, args): + data, idx = args + rawptr = cgutils.alloca_once_value(builder, value=data) + ptr = builder.bitcast(rawptr, ir.IntType(bitsize).as_pointer()) + ch = builder.load(builder.gep(ptr, [idx])) + return builder.zext(ch, ir.IntType(32)) + return codegen + + +@intrinsic +def deref_uint8(typingctx, data, offset): + sig = types.uint32(data, types.intp) + return sig, make_deref_codegen(8) + + +@intrinsic +def deref_uint16(typingctx, data, offset): + sig = types.uint32(data, types.intp) + return sig, make_deref_codegen(16) + + +@intrinsic +def deref_uint32(typingctx, data, offset): + sig = types.uint32(data, types.intp) + return sig, make_deref_codegen(32) + + +@register_jitable(_nrt=False) +def charseq_get_code(a, i): + """Access i-th item of CharSeq object via code value + """ + return deref_uint8(a, i) + + +@register_jitable +def charseq_get_value(a, i): + """Access i-th item of CharSeq object via code value. + + null code is interpreted as IndexError + """ + code = charseq_get_code(a, i) + if code == 0: + raise IndexError('index out of range') + return code + + +@register_jitable(_nrt=False) +def unicode_charseq_get_code(a, i): + """Access i-th item of UnicodeCharSeq object via code value + """ + if unicode_byte_width == 4: + return deref_uint32(a, i) + elif unicode_byte_width == 2: + return deref_uint16(a, i) + elif unicode_byte_width == 1: + return deref_uint8(a, i) + else: + raise NotImplementedError( + 'unicode_charseq_get_code: unicode_byte_width not in [1, 2, 4]') + + +@register_jitable +def unicode_get_code(a, i): + """Access i-th item of UnicodeType object. + """ + return unicode._get_code_point(a, i) + + +@register_jitable +def bytes_get_code(a, i): + """Access i-th item of Bytes object. + """ + return a[i] + + +def _get_code_impl(a): + if isinstance(a, types.CharSeq): + return charseq_get_code + elif isinstance(a, types.Bytes): + return bytes_get_code + elif isinstance(a, types.UnicodeCharSeq): + return unicode_charseq_get_code + elif isinstance(a, types.UnicodeType): + return unicode_get_code + + +def _same_kind(a, b): + for t in [(types.CharSeq, types.Bytes), + (types.UnicodeCharSeq, types.UnicodeType)]: + if isinstance(a, t) and isinstance(b, t): + return True + return False + + +def _is_bytes(a): + return isinstance(a, (types.CharSeq, types.Bytes)) + + +def is_default(x, default): + return x == default or isinstance(x, types.Omitted) + + +@register_jitable +def unicode_charseq_get_value(a, i): + """Access i-th item of UnicodeCharSeq object via unicode value + + null code is interpreted as IndexError + """ + code = unicode_charseq_get_code(a, i) + if code == 0: + raise IndexError('index out of range') + # Return numpy equivalent of `chr(code)` + return np.array(code, unicode_uint).view(u1_dtype)[()] + + +# +# CAST +# +# Currently, the following casting operations are supported: +# Bytes -> CharSeq (ex: a=np.array(b'abc'); a[()] = b'123') +# UnicodeType -> UnicodeCharSeq (ex: a=np.array('abc'); a[()] = '123') +# CharSeq -> Bytes (ex: a=np.array(b'abc'); b = bytes(a[()])) +# UnicodeType -> Bytes (ex: str('123')._to_bytes()) +# +# The following casting operations can be implemented when required: +# Bytes -> UnicodeCharSeq (ex: a=np.array('abc'); a[()] = b'123') +# UnicodeType -> CharSeq (ex: a=np.array(b'abc'); a[()] = '123') +# UnicodeType -> Bytes (ex: bytes('123', 'utf8')) +# + + +@lower_cast(types.Bytes, types.CharSeq) +def bytes_to_charseq(context, builder, fromty, toty, val): + barr = cgutils.create_struct_proxy(fromty)(context, builder, value=val) + src = builder.bitcast(barr.data, ir.IntType(8).as_pointer()) + src_length = barr.nitems + + lty = context.get_value_type(toty) + dstint_t = ir.IntType(8) + dst_ptr = cgutils.alloca_once(builder, lty) + dst = builder.bitcast(dst_ptr, dstint_t.as_pointer()) + + dst_length = ir.Constant(src_length.type, toty.count) + is_shorter_value = builder.icmp_unsigned('<', src_length, dst_length) + count = builder.select(is_shorter_value, src_length, dst_length) + with builder.if_then(is_shorter_value): + cgutils.memset(builder, + dst, + ir.Constant(src_length.type, + toty.count), 0) + with cgutils.for_range(builder, count) as loop: + in_ptr = builder.gep(src, [loop.index]) + in_val = builder.zext(builder.load(in_ptr), dstint_t) + builder.store(in_val, builder.gep(dst, [loop.index])) + + return builder.load(dst_ptr) + + +def _make_constant_bytes(context, builder, nbytes): + bstr_ctor = cgutils.create_struct_proxy(bytes_type) + bstr = bstr_ctor(context, builder) + + if isinstance(nbytes, int): + nbytes = ir.Constant(bstr.nitems.type, nbytes) + + bstr.meminfo = context.nrt.meminfo_alloc(builder, nbytes) + bstr.nitems = nbytes + bstr.itemsize = ir.Constant(bstr.itemsize.type, 1) + bstr.data = context.nrt.meminfo_data(builder, bstr.meminfo) + bstr.parent = cgutils.get_null_value(bstr.parent.type) + # bstr.shape and bstr.strides are not used + bstr.shape = cgutils.get_null_value(bstr.shape.type) + bstr.strides = cgutils.get_null_value(bstr.strides.type) + return bstr + + +@lower_cast(types.CharSeq, types.Bytes) +def charseq_to_bytes(context, builder, fromty, toty, val): + bstr = _make_constant_bytes(context, builder, val.type.count) + rawptr = cgutils.alloca_once_value(builder, value=val) + ptr = builder.bitcast(rawptr, bstr.data.type) + cgutils.memcpy(builder, bstr.data, ptr, bstr.nitems) + return bstr + + +@lower_cast(types.UnicodeType, types.Bytes) +def unicode_to_bytes_cast(context, builder, fromty, toty, val): + uni_str = cgutils.create_struct_proxy(fromty)(context, builder, value=val) + src1 = builder.bitcast(uni_str.data, ir.IntType(8).as_pointer()) + notkind1 = builder.icmp_unsigned('!=', uni_str.kind, + ir.Constant(uni_str.kind.type, 1)) + src_length = uni_str.length + + with builder.if_then(notkind1): + context.call_conv.return_user_exc( + builder, ValueError, + ("cannot cast higher than 8-bit unicode_type to bytes",)) + + bstr = _make_constant_bytes(context, builder, src_length) + cgutils.memcpy(builder, bstr.data, src1, bstr.nitems) + return bstr + + +@intrinsic +def _unicode_to_bytes(typingctx, s): + # used in _to_bytes method + assert s == types.unicode_type + sig = bytes_type(s) + + def codegen(context, builder, signature, args): + return unicode_to_bytes_cast( + context, builder, s, bytes_type, args[0])._getvalue() + return sig, codegen + + +@lower_cast(types.UnicodeType, types.UnicodeCharSeq) +def unicode_to_unicode_charseq(context, builder, fromty, toty, val): + uni_str = cgutils.create_struct_proxy(fromty)(context, builder, value=val) + src1 = builder.bitcast(uni_str.data, ir.IntType(8).as_pointer()) + src2 = builder.bitcast(uni_str.data, ir.IntType(16).as_pointer()) + src4 = builder.bitcast(uni_str.data, ir.IntType(32).as_pointer()) + kind1 = builder.icmp_unsigned('==', uni_str.kind, + ir.Constant(uni_str.kind.type, 1)) + kind2 = builder.icmp_unsigned('==', uni_str.kind, + ir.Constant(uni_str.kind.type, 2)) + kind4 = builder.icmp_unsigned('==', uni_str.kind, + ir.Constant(uni_str.kind.type, 4)) + src_length = uni_str.length + + lty = context.get_value_type(toty) + dstint_t = ir.IntType(8 * unicode_byte_width) + dst_ptr = cgutils.alloca_once(builder, lty) + dst = builder.bitcast(dst_ptr, dstint_t.as_pointer()) + + dst_length = ir.Constant(src_length.type, toty.count) + is_shorter_value = builder.icmp_unsigned('<', src_length, dst_length) + count = builder.select(is_shorter_value, src_length, dst_length) + with builder.if_then(is_shorter_value): + cgutils.memset(builder, + dst, + ir.Constant(src_length.type, + toty.count * unicode_byte_width), 0) + + with builder.if_then(kind1): + with cgutils.for_range(builder, count) as loop: + in_ptr = builder.gep(src1, [loop.index]) + in_val = builder.zext(builder.load(in_ptr), dstint_t) + builder.store(in_val, builder.gep(dst, [loop.index])) + + with builder.if_then(kind2): + if unicode_byte_width >= 2: + with cgutils.for_range(builder, count) as loop: + in_ptr = builder.gep(src2, [loop.index]) + in_val = builder.zext(builder.load(in_ptr), dstint_t) + builder.store(in_val, builder.gep(dst, [loop.index])) + else: + context.call_conv.return_user_exc( + builder, ValueError, + ("cannot cast 16-bit unicode_type to %s-bit %s" + % (unicode_byte_width * 8, toty))) + + with builder.if_then(kind4): + if unicode_byte_width >= 4: + with cgutils.for_range(builder, count) as loop: + in_ptr = builder.gep(src4, [loop.index]) + in_val = builder.zext(builder.load(in_ptr), dstint_t) + builder.store(in_val, builder.gep(dst, [loop.index])) + else: + context.call_conv.return_user_exc( + builder, ValueError, + ("cannot cast 32-bit unicode_type to %s-bit %s" + % (unicode_byte_width * 8, toty))) + + return builder.load(dst_ptr) + +# +# Operations on bytes/str array items +# +# Implementation note: while some operations need +# CharSeq/UnicodeCharSeq specific implementations (getitem, len, str, +# etc), many operations can be supported by casting +# CharSeq/UnicodeCharSeq objects to Bytes/UnicodeType objects and +# re-use existing operations. +# +# However, in numba more operations are implemented for UnicodeType +# than for Bytes objects, hence the support for operations with bytes +# array items will be less complete than for str arrays. Although, in +# some cases (hash, contains, etc) the UnicodeType implementations can +# be reused for Bytes objects via using `_to_str` method. +# + + +@overload(operator.getitem) +def charseq_getitem(s, i): + get_value = None + if isinstance(i, types.Integer): + if isinstance(s, types.CharSeq): + get_value = charseq_get_value + if isinstance(s, types.UnicodeCharSeq): + get_value = unicode_charseq_get_value + if get_value is not None: + max_i = s.count + msg = 'index out of range [0, %s]' % (max_i - 1) + + def getitem_impl(s, i): + if i < max_i and i >= 0: + return get_value(s, i) + raise IndexError(msg) + return getitem_impl + + +@overload(len) +def charseq_len(s): + if isinstance(s, (types.CharSeq, types.UnicodeCharSeq)): + get_code = _get_code_impl(s) + n = s.count + if n == 0: + def len_impl(s): + return 0 + return len_impl + else: + def len_impl(s): + # return the index of the last non-null value (numpy + # behavior) + i = n + code = 0 + while code == 0: + i = i - 1 + if i < 0: + break + code = get_code(s, i) + return i + 1 + return len_impl + + +@overload(operator.add) +@overload(operator.iadd) +def charseq_concat(a, b): + if not _same_kind(a, b): + return + if (isinstance(a, types.UnicodeCharSeq) and + isinstance(b, types.UnicodeType)): + def impl(a, b): + return str(a) + b + return impl + if (isinstance(b, types.UnicodeCharSeq) and + isinstance(a, types.UnicodeType)): + def impl(a, b): + return a + str(b) + return impl + if (isinstance(a, types.UnicodeCharSeq) and + isinstance(b, types.UnicodeCharSeq)): + def impl(a, b): + return str(a) + str(b) + return impl + if (isinstance(a, (types.CharSeq, types.Bytes)) and + isinstance(b, (types.CharSeq, types.Bytes))): + def impl(a, b): + return (a._to_str() + b._to_str())._to_bytes() + return impl + + +@overload(operator.mul) +def charseq_repeat(a, b): + if isinstance(a, types.UnicodeCharSeq): + def wrap(a, b): + return str(a) * b + return wrap + if isinstance(b, types.UnicodeCharSeq): + def wrap(a, b): + return a * str(b) + return wrap + if isinstance(a, (types.CharSeq, types.Bytes)): + def wrap(a, b): + return (a._to_str() * b)._to_bytes() + return wrap + if isinstance(b, (types.CharSeq, types.Bytes)): + def wrap(a, b): + return (a * b._to_str())._to_bytes() + return wrap + + +@overload(operator.not_) +def charseq_not(a): + if isinstance(a, (types.UnicodeCharSeq, types.CharSeq, types.Bytes)): + def impl(a): + return len(a) == 0 + return impl + + +@overload(operator.eq) +def charseq_eq(a, b): + if not _same_kind(a, b): + return + left_code = _get_code_impl(a) + right_code = _get_code_impl(b) + if left_code is not None and right_code is not None: + def eq_impl(a, b): + n = len(a) + if n != len(b): + return False + for i in range(n): + if left_code(a, i) != right_code(b, i): + return False + return True + return eq_impl + + +@overload(operator.ne) +def charseq_ne(a, b): + if not _same_kind(a, b): + return + left_code = _get_code_impl(a) + right_code = _get_code_impl(b) + if left_code is not None and right_code is not None: + def ne_impl(a, b): + return not (a == b) + return ne_impl + + +@overload(operator.lt) +def charseq_lt(a, b): + if not _same_kind(a, b): + return + left_code = _get_code_impl(a) + right_code = _get_code_impl(b) + if left_code is not None and right_code is not None: + def lt_impl(a, b): + na = len(a) + nb = len(b) + n = min(na, nb) + for i in range(n): + ca, cb = left_code(a, i), right_code(b, i) + if ca != cb: + return ca < cb + return na < nb + return lt_impl + + +@overload(operator.gt) +def charseq_gt(a, b): + if not _same_kind(a, b): + return + left_code = _get_code_impl(a) + right_code = _get_code_impl(b) + if left_code is not None and right_code is not None: + def gt_impl(a, b): + return b < a + return gt_impl + + +@overload(operator.le) +def charseq_le(a, b): + if not _same_kind(a, b): + return + left_code = _get_code_impl(a) + right_code = _get_code_impl(b) + if left_code is not None and right_code is not None: + def le_impl(a, b): + return not (a > b) + return le_impl + + +@overload(operator.ge) +def charseq_ge(a, b): + if not _same_kind(a, b): + return + left_code = _get_code_impl(a) + right_code = _get_code_impl(b) + if left_code is not None and right_code is not None: + def ge_impl(a, b): + return not (a < b) + return ge_impl + + +@overload(operator.contains) +def charseq_contains(a, b): + if not _same_kind(a, b): + return + left_code = _get_code_impl(a) + right_code = _get_code_impl(b) + if left_code is not None and right_code is not None: + if _is_bytes(a): + def contains_impl(a, b): + # Ideally, `return bytes(b) in bytes(a)` would be used + # here, but numba Bytes does not implement + # contains. So, using `unicode_type` implementation + # here: + return b._to_str() in a._to_str() + else: + def contains_impl(a, b): + return str(b) in str(a) + return contains_impl + + +@overload_method(types.UnicodeCharSeq, 'isascii') +@overload_method(types.CharSeq, 'isascii') +@overload_method(types.Bytes, 'isascii') +def charseq_isascii(s): + get_code = _get_code_impl(s) + + def impl(s): + for i in range(len(s)): + if get_code(s, i) > 127: + return False + return True + return impl + + +@overload_method(types.UnicodeCharSeq, '_get_kind') +@overload_method(types.CharSeq, '_get_kind') +def charseq_get_kind(s): + get_code = _get_code_impl(s) + + def impl(s): + max_code = 0 + for i in range(len(s)): + code = get_code(s, i) + if code > max_code: + max_code = code + if max_code > 0xffff: + return unicode.PY_UNICODE_4BYTE_KIND + if max_code > 0xff: + return unicode.PY_UNICODE_2BYTE_KIND + return unicode.PY_UNICODE_1BYTE_KIND + return impl + + +@overload_method(types.UnicodeType, '_to_bytes') +def unicode_to_bytes_mth(s): + """Convert unicode_type object to Bytes object. + + Note: The usage of _to_bytes method can be eliminated once all + Python bytes operations are implemented for numba Bytes objects. + + """ + def impl(s): + return _unicode_to_bytes(s) + return impl + + +@overload_method(types.CharSeq, '_to_str') +@overload_method(types.Bytes, '_to_str') +def charseq_to_str_mth(s): + """Convert bytes array item or bytes instance to UTF-8 str. + + Note: The usage of _to_str method can be eliminated once all + Python bytes operations are implemented for numba Bytes objects. + """ + get_code = _get_code_impl(s) + + def tostr_impl(s): + n = len(s) + is_ascii = s.isascii() + result = unicode._empty_string( + unicode.PY_UNICODE_1BYTE_KIND, n, is_ascii) + for i in range(n): + code = get_code(s, i) + unicode._set_code_point(result, i, code) + return result + return tostr_impl + + +@overload_method(types.UnicodeCharSeq, "__str__") +def charseq_str(s): + get_code = _get_code_impl(s) + + def str_impl(s): + n = len(s) + kind = s._get_kind() + is_ascii = kind == 1 and s.isascii() + result = unicode._empty_string(kind, n, is_ascii) + for i in range(n): + code = get_code(s, i) + unicode._set_code_point(result, i, code) + return result + + return str_impl + + +@overload(bytes) +def charseq_bytes(s): + if isinstance(s, types.CharSeq): + return lambda s: s + + +@overload_method(types.UnicodeCharSeq, '__hash__') +def unicode_charseq_hash(s): + def impl(s): + return hash(str(s)) + return impl + + +@overload_method(types.CharSeq, '__hash__') +def charseq_hash(s): + def impl(s): + # Ideally, `return hash(bytes(s))` would be used here but + # numba Bytes does not implement hash (yet). However, for a + # UTF-8 string `s`, we have hash(bytes(s)) == hash(s), hence, + # we can convert CharSeq object to unicode_type and reuse its + # hash implementation: + return hash(s._to_str()) + return impl + + +@overload_method(types.UnicodeCharSeq, 'isupper') +def unicode_charseq_isupper(s): + def impl(s): + # workaround unicode_type.isupper bug: it returns int value + return not not str(s).isupper() + return impl + + +@overload_method(types.CharSeq, 'isupper') +def charseq_isupper(s): + def impl(s): + # return bytes(s).isupper() # TODO: implement isupper for Bytes + return not not s._to_str().isupper() + return impl + + +@overload_method(types.UnicodeCharSeq, 'upper') +def unicode_charseq_upper(s): + def impl(s): + return str(s).upper() + return impl + + +@overload_method(types.CharSeq, 'upper') +def charseq_upper(s): + def impl(s): + # return bytes(s).upper() # TODO: implement upper for Bytes + return s._to_str().upper()._to_bytes() + return impl + + +@overload_method(types.UnicodeCharSeq, 'find') +@overload_method(types.CharSeq, 'find') +@overload_method(types.Bytes, 'find') +def unicode_charseq_find(a, b): + if isinstance(a, types.UnicodeCharSeq): + if isinstance(b, types.UnicodeCharSeq): + def impl(a, b): + return str(a).find(str(b)) + return impl + if isinstance(b, types.UnicodeType): + def impl(a, b): + return str(a).find(b) + return impl + if isinstance(a, types.CharSeq): + if isinstance(b, (types.CharSeq, types.Bytes)): + def impl(a, b): + return a._to_str().find(b._to_str()) + return impl + if isinstance(a, types.UnicodeType): + if isinstance(b, types.UnicodeCharSeq): + def impl(a, b): + return a.find(str(b)) + return impl + if isinstance(a, types.Bytes): + if isinstance(b, types.CharSeq): + def impl(a, b): + return a._to_str().find(b._to_str()) + return impl + + +@overload_method(types.UnicodeCharSeq, 'rfind') +@overload_method(types.CharSeq, 'rfind') +@overload_method(types.Bytes, 'rfind') +def unicode_charseq_rfind(a, b): + if isinstance(a, types.UnicodeCharSeq): + if isinstance(b, types.UnicodeCharSeq): + def impl(a, b): + return str(a).rfind(str(b)) + return impl + if isinstance(b, types.UnicodeType): + def impl(a, b): + return str(a).rfind(b) + return impl + if isinstance(a, types.CharSeq): + if isinstance(b, (types.CharSeq, types.Bytes)): + def impl(a, b): + return a._to_str().rfind(b._to_str()) + return impl + if isinstance(a, types.UnicodeType): + if isinstance(b, types.UnicodeCharSeq): + def impl(a, b): + return a.rfind(str(b)) + return impl + if isinstance(a, types.Bytes): + if isinstance(b, types.CharSeq): + def impl(a, b): + return a._to_str().rfind(b._to_str()) + return impl + + +@overload_method(types.UnicodeCharSeq, 'startswith') +@overload_method(types.CharSeq, 'startswith') +@overload_method(types.Bytes, 'startswith') +def unicode_charseq_startswith(a, b): + if isinstance(a, types.UnicodeCharSeq): + if isinstance(b, types.UnicodeCharSeq): + def impl(a, b): + return str(a).startswith(str(b)) + return impl + if isinstance(b, types.UnicodeType): + def impl(a, b): + return str(a).startswith(b) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + if isinstance(b, (types.CharSeq, types.Bytes)): + def impl(a, b): + return a._to_str().startswith(b._to_str()) + return impl + + +@overload_method(types.UnicodeCharSeq, 'endswith') +@overload_method(types.CharSeq, 'endswith') +@overload_method(types.Bytes, 'endswith') +def unicode_charseq_endswith(a, b): + if isinstance(a, types.UnicodeCharSeq): + if isinstance(b, types.UnicodeCharSeq): + def impl(a, b): + return str(a).endswith(str(b)) + return impl + if isinstance(b, types.UnicodeType): + def impl(a, b): + return str(a).endswith(b) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + if isinstance(b, (types.CharSeq, types.Bytes)): + def impl(a, b): + return a._to_str().endswith(b._to_str()) + return impl + + +@register_jitable +def _map_bytes(seq): + return [s._to_bytes() for s in seq] + + +@overload_method(types.UnicodeCharSeq, 'split') +@overload_method(types.CharSeq, 'split') +@overload_method(types.Bytes, 'split') +def unicode_charseq_split(a, sep=None, maxsplit=-1): + if not (maxsplit == -1 or + isinstance(maxsplit, (types.Omitted, types.Integer, + types.IntegerLiteral))): + return None + if isinstance(a, types.UnicodeCharSeq): + if isinstance(sep, types.UnicodeCharSeq): + def impl(a, sep=None, maxsplit=-1): + return str(a).split(sep=str(sep), maxsplit=maxsplit) + return impl + if isinstance(sep, types.UnicodeType): + def impl(a, sep=None, maxsplit=-1): + return str(a).split(sep=sep, maxsplit=maxsplit) + return impl + if is_nonelike(sep): + if is_default(maxsplit, -1): + def impl(a, sep=None, maxsplit=-1): + return str(a).split() + else: + def impl(a, sep=None, maxsplit=-1): + return str(a).split(maxsplit=maxsplit) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + if isinstance(sep, (types.CharSeq, types.Bytes)): + def impl(a, sep=None, maxsplit=-1): + return _map_bytes(a._to_str().split(sep._to_str(), + maxsplit=maxsplit)) + return impl + if is_nonelike(sep): + if is_default(maxsplit, -1): + def impl(a, sep=None, maxsplit=-1): + return _map_bytes(a._to_str().split()) + else: + def impl(a, sep=None, maxsplit=-1): + return _map_bytes(a._to_str().split(maxsplit=maxsplit)) + return impl + +# NOT IMPLEMENTED: rsplit + + +@overload_method(types.UnicodeCharSeq, 'ljust') +@overload_method(types.CharSeq, 'ljust') +@overload_method(types.Bytes, 'ljust') +def unicode_charseq_ljust(a, width, fillchar=' '): + if isinstance(a, types.UnicodeCharSeq): + if is_default(fillchar, ' '): + def impl(a, width, fillchar=' '): + return str(a).ljust(width) + return impl + elif isinstance(fillchar, types.UnicodeCharSeq): + def impl(a, width, fillchar=' '): + return str(a).ljust(width, str(fillchar)) + return impl + elif isinstance(fillchar, types.UnicodeType): + def impl(a, width, fillchar=' '): + return str(a).ljust(width, fillchar) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + if is_default(fillchar, ' ') or is_default(fillchar, b' '): + def impl(a, width, fillchar=' '): + return a._to_str().ljust(width)._to_bytes() + return impl + elif isinstance(fillchar, (types.CharSeq, types.Bytes)): + def impl(a, width, fillchar=' '): + return a._to_str().ljust(width, fillchar._to_str())._to_bytes() + return impl + + +@overload_method(types.UnicodeCharSeq, 'rjust') +@overload_method(types.CharSeq, 'rjust') +@overload_method(types.Bytes, 'rjust') +def unicode_charseq_rjust(a, width, fillchar=' '): + if isinstance(a, types.UnicodeCharSeq): + if is_default(fillchar, ' '): + def impl(a, width, fillchar=' '): + return str(a).rjust(width) + return impl + elif isinstance(fillchar, types.UnicodeCharSeq): + def impl(a, width, fillchar=' '): + return str(a).rjust(width, str(fillchar)) + return impl + elif isinstance(fillchar, types.UnicodeType): + def impl(a, width, fillchar=' '): + return str(a).rjust(width, fillchar) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + if is_default(fillchar, ' ') or is_default(fillchar, b' '): + def impl(a, width, fillchar=' '): + return a._to_str().rjust(width)._to_bytes() + return impl + elif isinstance(fillchar, (types.CharSeq, types.Bytes)): + def impl(a, width, fillchar=' '): + return a._to_str().rjust(width, fillchar._to_str())._to_bytes() + return impl + + +@overload_method(types.UnicodeCharSeq, 'center') +@overload_method(types.CharSeq, 'center') +@overload_method(types.Bytes, 'center') +def unicode_charseq_center(a, width, fillchar=' '): + if isinstance(a, types.UnicodeCharSeq): + if is_default(fillchar, ' '): + def impl(a, width, fillchar=' '): + return str(a).center(width) + return impl + elif isinstance(fillchar, types.UnicodeCharSeq): + def impl(a, width, fillchar=' '): + return str(a).center(width, str(fillchar)) + return impl + elif isinstance(fillchar, types.UnicodeType): + def impl(a, width, fillchar=' '): + return str(a).center(width, fillchar) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + if is_default(fillchar, ' ') or is_default(fillchar, b' '): + def impl(a, width, fillchar=' '): + return a._to_str().center(width)._to_bytes() + return impl + elif isinstance(fillchar, (types.CharSeq, types.Bytes)): + def impl(a, width, fillchar=' '): + return a._to_str().center(width, fillchar._to_str())._to_bytes() + return impl + + +@overload_method(types.UnicodeCharSeq, 'zfill') +@overload_method(types.CharSeq, 'zfill') +@overload_method(types.Bytes, 'zfill') +def unicode_charseq_zfill(a, width): + if isinstance(a, types.UnicodeCharSeq): + def impl(a, width): + return str(a).zfill(width) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + def impl(a, width): + return a._to_str().zfill(width)._to_bytes() + return impl + + +@overload_method(types.UnicodeCharSeq, 'lstrip') +@overload_method(types.CharSeq, 'lstrip') +@overload_method(types.Bytes, 'lstrip') +def unicode_charseq_lstrip(a, chars=None): + if isinstance(a, types.UnicodeCharSeq): + if is_nonelike(chars): + def impl(a, chars=None): + return str(a).lstrip() + return impl + elif isinstance(chars, types.UnicodeCharSeq): + def impl(a, chars=None): + return str(a).lstrip(str(chars)) + return impl + elif isinstance(chars, types.UnicodeType): + def impl(a, chars=None): + return str(a).lstrip(chars) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + if is_nonelike(chars): + def impl(a, chars=None): + return a._to_str().lstrip()._to_bytes() + return impl + elif isinstance(chars, (types.CharSeq, types.Bytes)): + def impl(a, chars=None): + return a._to_str().lstrip(chars._to_str())._to_bytes() + return impl + + +@overload_method(types.UnicodeCharSeq, 'rstrip') +@overload_method(types.CharSeq, 'rstrip') +@overload_method(types.Bytes, 'rstrip') +def unicode_charseq_rstrip(a, chars=None): + if isinstance(a, types.UnicodeCharSeq): + if is_nonelike(chars): + def impl(a, chars=None): + return str(a).rstrip() + return impl + elif isinstance(chars, types.UnicodeCharSeq): + def impl(a, chars=None): + return str(a).rstrip(str(chars)) + return impl + elif isinstance(chars, types.UnicodeType): + def impl(a, chars=None): + return str(a).rstrip(chars) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + if is_nonelike(chars): + def impl(a, chars=None): + return a._to_str().rstrip()._to_bytes() + return impl + elif isinstance(chars, (types.CharSeq, types.Bytes)): + def impl(a, chars=None): + return a._to_str().rstrip(chars._to_str())._to_bytes() + return impl + + +@overload_method(types.UnicodeCharSeq, 'strip') +@overload_method(types.CharSeq, 'strip') +@overload_method(types.Bytes, 'strip') +def unicode_charseq_strip(a, chars=None): + if isinstance(a, types.UnicodeCharSeq): + if is_nonelike(chars): + def impl(a, chars=None): + return str(a).strip() + return impl + elif isinstance(chars, types.UnicodeCharSeq): + def impl(a, chars=None): + return str(a).strip(str(chars)) + return impl + elif isinstance(chars, types.UnicodeType): + def impl(a, chars=None): + return str(a).strip(chars) + return impl + if isinstance(a, (types.CharSeq, types.Bytes)): + if is_nonelike(chars): + def impl(a, chars=None): + return a._to_str().strip()._to_bytes() + return impl + elif isinstance(chars, (types.CharSeq, types.Bytes)): + def impl(a, chars=None): + return a._to_str().strip(chars._to_str())._to_bytes() + return impl + + +@overload_method(types.UnicodeCharSeq, 'join') +@overload_method(types.CharSeq, 'join') +@overload_method(types.Bytes, 'join') +def unicode_charseq_join(a, parts): + + if isinstance(a, types.UnicodeCharSeq): + # assuming parts contains UnicodeCharSeq or UnicodeType objects + def impl(a, parts): + _parts = [str(p) for p in parts] + return str(a).join(_parts) + return impl + + if isinstance(a, (types.CharSeq, types.Bytes)): + # assuming parts contains CharSeq or Bytes objects + def impl(a, parts): + _parts = [p._to_str() for p in parts] + return a._to_str().join(_parts)._to_bytes() + return impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/cmathimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/cmathimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..4305e9d45dde68b5f32b56e462bd5b064bfaed18 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/cmathimpl.py @@ -0,0 +1,542 @@ +""" +Implement the cmath module functions. +""" + + +import cmath +import math + +from numba.core.imputils import Registry, impl_ret_untracked +from numba.core import types, cgutils +from numba.core.typing import signature +from numba.cpython import builtins, mathimpl +from numba.core.extending import overload + +registry = Registry('cmathimpl') +lower = registry.lower + + +def is_nan(builder, z): + return builder.fcmp_unordered('uno', z.real, z.imag) + +def is_inf(builder, z): + return builder.or_(mathimpl.is_inf(builder, z.real), + mathimpl.is_inf(builder, z.imag)) + +def is_finite(builder, z): + return builder.and_(mathimpl.is_finite(builder, z.real), + mathimpl.is_finite(builder, z.imag)) + + +@lower(cmath.isnan, types.Complex) +def isnan_float_impl(context, builder, sig, args): + [typ] = sig.args + [value] = args + z = context.make_complex(builder, typ, value=value) + res = is_nan(builder, z) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower(cmath.isinf, types.Complex) +def isinf_float_impl(context, builder, sig, args): + [typ] = sig.args + [value] = args + z = context.make_complex(builder, typ, value=value) + res = is_inf(builder, z) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(cmath.isfinite, types.Complex) +def isfinite_float_impl(context, builder, sig, args): + [typ] = sig.args + [value] = args + z = context.make_complex(builder, typ, value=value) + res = is_finite(builder, z) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@overload(cmath.rect) +def impl_cmath_rect(r, phi): + if all([isinstance(typ, types.Float) for typ in [r, phi]]): + def impl(r, phi): + if not math.isfinite(phi): + if not r: + # cmath.rect(0, phi={inf, nan}) = 0 + return abs(r) + if math.isinf(r): + # cmath.rect(inf, phi={inf, nan}) = inf + j phi + return complex(r, phi) + real = math.cos(phi) + imag = math.sin(phi) + if real == 0. and math.isinf(r): + # 0 * inf would return NaN, we want to keep 0 but xor the sign + real /= r + else: + real *= r + if imag == 0. and math.isinf(r): + # ditto + imag /= r + else: + imag *= r + return complex(real, imag) + return impl + + +def intrinsic_complex_unary(inner_func): + def wrapper(context, builder, sig, args): + [typ] = sig.args + [value] = args + z = context.make_complex(builder, typ, value=value) + x = z.real + y = z.imag + # Same as above: math.isfinite() is unavailable on 2.x so we precompute + # its value and pass it to the pure Python implementation. + x_is_finite = mathimpl.is_finite(builder, x) + y_is_finite = mathimpl.is_finite(builder, y) + inner_sig = signature(sig.return_type, + *(typ.underlying_float,) * 2 + (types.boolean,) * 2) + res = context.compile_internal(builder, inner_func, inner_sig, + (x, y, x_is_finite, y_is_finite)) + return impl_ret_untracked(context, builder, sig, res) + return wrapper + + +NAN = float('nan') +INF = float('inf') + +@lower(cmath.exp, types.Complex) +@intrinsic_complex_unary +def exp_impl(x, y, x_is_finite, y_is_finite): + """cmath.exp(x + y j)""" + if x_is_finite: + if y_is_finite: + c = math.cos(y) + s = math.sin(y) + r = math.exp(x) + return complex(r * c, r * s) + else: + return complex(NAN, NAN) + elif math.isnan(x): + if y: + return complex(x, x) # nan + j nan + else: + return complex(x, y) # nan + 0j + elif x > 0.0: + # x == +inf + if y_is_finite: + real = math.cos(y) + imag = math.sin(y) + # Avoid NaNs if math.cos(y) or math.sin(y) == 0 + # (e.g. cmath.exp(inf + 0j) == inf + 0j) + if real != 0: + real *= x + if imag != 0: + imag *= x + return complex(real, imag) + else: + return complex(x, NAN) + else: + # x == -inf + if y_is_finite: + r = math.exp(x) + c = math.cos(y) + s = math.sin(y) + return complex(r * c, r * s) + else: + r = 0 + return complex(r, r) + +@lower(cmath.log, types.Complex) +@intrinsic_complex_unary +def log_impl(x, y, x_is_finite, y_is_finite): + """cmath.log(x + y j)""" + a = math.log(math.hypot(x, y)) + b = math.atan2(y, x) + return complex(a, b) + + +@lower(cmath.log, types.Complex, types.Complex) +def log_base_impl(context, builder, sig, args): + """cmath.log(z, base)""" + [z, base] = args + + def log_base(z, base): + return cmath.log(z) / cmath.log(base) + + res = context.compile_internal(builder, log_base, sig, args) + return impl_ret_untracked(context, builder, sig, res) + + +@overload(cmath.log10) +def impl_cmath_log10(z): + if not isinstance(z, types.Complex): + return + + LN_10 = 2.302585092994045684 + + def log10_impl(z): + """cmath.log10(z)""" + z = cmath.log(z) + # This formula gives better results on +/-inf than cmath.log(z, 10) + # See http://bugs.python.org/issue22544 + return complex(z.real / LN_10, z.imag / LN_10) + + return log10_impl + + +@overload(cmath.phase) +def phase_impl(x): + """cmath.phase(x + y j)""" + + if not isinstance(x, types.Complex): + return + + def impl(x): + return math.atan2(x.imag, x.real) + return impl + + +@overload(cmath.polar) +def polar_impl(x): + if not isinstance(x, types.Complex): + return + + def impl(x): + r, i = x.real, x.imag + return math.hypot(r, i), math.atan2(i, r) + return impl + + +@lower(cmath.sqrt, types.Complex) +def sqrt_impl(context, builder, sig, args): + # We risk spurious overflow for components >= FLT_MAX / (1 + sqrt(2)). + + SQRT2 = 1.414213562373095048801688724209698079E0 + ONE_PLUS_SQRT2 = (1. + SQRT2) + theargflt = sig.args[0].underlying_float + # Get a type specific maximum value so scaling for overflow is based on that + MAX = mathimpl.DBL_MAX if theargflt.bitwidth == 64 else mathimpl.FLT_MAX + # THRES will be double precision, should not impact typing as it's just + # used for comparison, there *may* be a few values near THRES which + # deviate from e.g. NumPy due to rounding that occurs in the computation + # of this value in the case of a 32bit argument. + THRES = MAX / ONE_PLUS_SQRT2 + + def sqrt_impl(z): + """cmath.sqrt(z)""" + # This is NumPy's algorithm, see npy_csqrt() in npy_math_complex.c.src + a = z.real + b = z.imag + if a == 0.0 and b == 0.0: + return complex(abs(b), b) + if math.isinf(b): + return complex(abs(b), b) + if math.isnan(a): + return complex(a, a) + if math.isinf(a): + if a < 0.0: + return complex(abs(b - b), math.copysign(a, b)) + else: + return complex(a, math.copysign(b - b, b)) + + # The remaining special case (b is NaN) is handled just fine by + # the normal code path below. + + # Scale to avoid overflow + if abs(a) >= THRES or abs(b) >= THRES: + a *= 0.25 + b *= 0.25 + scale = True + else: + scale = False + # Algorithm 312, CACM vol 10, Oct 1967 + if a >= 0: + t = math.sqrt((a + math.hypot(a, b)) * 0.5) + real = t + imag = b / (2 * t) + else: + t = math.sqrt((-a + math.hypot(a, b)) * 0.5) + real = abs(b) / (2 * t) + imag = math.copysign(t, b) + # Rescale + if scale: + return complex(real * 2, imag) + else: + return complex(real, imag) + + res = context.compile_internal(builder, sqrt_impl, sig, args) + return impl_ret_untracked(context, builder, sig, res) + + +@lower(cmath.cos, types.Complex) +def cos_impl(context, builder, sig, args): + def cos_impl(z): + """cmath.cos(z) = cmath.cosh(z j)""" + return cmath.cosh(complex(-z.imag, z.real)) + + res = context.compile_internal(builder, cos_impl, sig, args) + return impl_ret_untracked(context, builder, sig, res) + +@overload(cmath.cosh) +def impl_cmath_cosh(z): + if not isinstance(z, types.Complex): + return + + def cosh_impl(z): + """cmath.cosh(z)""" + x = z.real + y = z.imag + if math.isinf(x): + if math.isnan(y): + # x = +inf, y = NaN => cmath.cosh(x + y j) = inf + Nan * j + real = abs(x) + imag = y + elif y == 0.0: + # x = +inf, y = 0 => cmath.cosh(x + y j) = inf + 0j + real = abs(x) + imag = y + else: + real = math.copysign(x, math.cos(y)) + imag = math.copysign(x, math.sin(y)) + if x < 0.0: + # x = -inf => negate imaginary part of result + imag = -imag + return complex(real, imag) + return complex(math.cos(y) * math.cosh(x), + math.sin(y) * math.sinh(x)) + return cosh_impl + + +@lower(cmath.sin, types.Complex) +def sin_impl(context, builder, sig, args): + def sin_impl(z): + """cmath.sin(z) = -j * cmath.sinh(z j)""" + r = cmath.sinh(complex(-z.imag, z.real)) + return complex(r.imag, -r.real) + + res = context.compile_internal(builder, sin_impl, sig, args) + return impl_ret_untracked(context, builder, sig, res) + +@overload(cmath.sinh) +def impl_cmath_sinh(z): + if not isinstance(z, types.Complex): + return + + def sinh_impl(z): + """cmath.sinh(z)""" + x = z.real + y = z.imag + if math.isinf(x): + if math.isnan(y): + # x = +/-inf, y = NaN => cmath.sinh(x + y j) = x + NaN * j + real = x + imag = y + else: + real = math.cos(y) + imag = math.sin(y) + if real != 0.: + real *= x + if imag != 0.: + imag *= abs(x) + return complex(real, imag) + return complex(math.cos(y) * math.sinh(x), + math.sin(y) * math.cosh(x)) + return sinh_impl + + +@lower(cmath.tan, types.Complex) +def tan_impl(context, builder, sig, args): + def tan_impl(z): + """cmath.tan(z) = -j * cmath.tanh(z j)""" + r = cmath.tanh(complex(-z.imag, z.real)) + return complex(r.imag, -r.real) + + res = context.compile_internal(builder, tan_impl, sig, args) + return impl_ret_untracked(context, builder, sig, res) + + +@overload(cmath.tanh) +def impl_cmath_tanh(z): + if not isinstance(z, types.Complex): + return + + def tanh_impl(z): + """cmath.tanh(z)""" + x = z.real + y = z.imag + if math.isinf(x): + real = math.copysign(1., x) + if math.isinf(y): + imag = 0. + else: + imag = math.copysign(0., math.sin(2. * y)) + return complex(real, imag) + # This is CPython's algorithm (see c_tanh() in cmathmodule.c). + # XXX how to force float constants into single precision? + tx = math.tanh(x) + ty = math.tan(y) + cx = 1. / math.cosh(x) + txty = tx * ty + denom = 1. + txty * txty + return complex( + tx * (1. + ty * ty) / denom, + ((ty / denom) * cx) * cx) + + return tanh_impl + + +@lower(cmath.acos, types.Complex) +def acos_impl(context, builder, sig, args): + LN_4 = math.log(4) + THRES = mathimpl.FLT_MAX / 4 + + def acos_impl(z): + """cmath.acos(z)""" + # CPython's algorithm (see c_acos() in cmathmodule.c) + if abs(z.real) > THRES or abs(z.imag) > THRES: + # Avoid unnecessary overflow for large arguments + # (also handles infinities gracefully) + real = math.atan2(abs(z.imag), z.real) + imag = math.copysign( + math.log(math.hypot(z.real * 0.5, z.imag * 0.5)) + LN_4, + -z.imag) + return complex(real, imag) + else: + s1 = cmath.sqrt(complex(1. - z.real, -z.imag)) + s2 = cmath.sqrt(complex(1. + z.real, z.imag)) + real = 2. * math.atan2(s1.real, s2.real) + imag = math.asinh(s2.real * s1.imag - s2.imag * s1.real) + return complex(real, imag) + + res = context.compile_internal(builder, acos_impl, sig, args) + return impl_ret_untracked(context, builder, sig, res) + +@overload(cmath.acosh) +def impl_cmath_acosh(z): + if not isinstance(z, types.Complex): + return + + LN_4 = math.log(4) + THRES = mathimpl.FLT_MAX / 4 + + def acosh_impl(z): + """cmath.acosh(z)""" + # CPython's algorithm (see c_acosh() in cmathmodule.c) + if abs(z.real) > THRES or abs(z.imag) > THRES: + # Avoid unnecessary overflow for large arguments + # (also handles infinities gracefully) + real = math.log(math.hypot(z.real * 0.5, z.imag * 0.5)) + LN_4 + imag = math.atan2(z.imag, z.real) + return complex(real, imag) + else: + s1 = cmath.sqrt(complex(z.real - 1., z.imag)) + s2 = cmath.sqrt(complex(z.real + 1., z.imag)) + real = math.asinh(s1.real * s2.real + s1.imag * s2.imag) + imag = 2. * math.atan2(s1.imag, s2.real) + return complex(real, imag) + # Condensed formula (NumPy) + #return cmath.log(z + cmath.sqrt(z + 1.) * cmath.sqrt(z - 1.)) + + return acosh_impl + + +@lower(cmath.asinh, types.Complex) +def asinh_impl(context, builder, sig, args): + LN_4 = math.log(4) + THRES = mathimpl.FLT_MAX / 4 + + def asinh_impl(z): + """cmath.asinh(z)""" + # CPython's algorithm (see c_asinh() in cmathmodule.c) + if abs(z.real) > THRES or abs(z.imag) > THRES: + real = math.copysign( + math.log(math.hypot(z.real * 0.5, z.imag * 0.5)) + LN_4, + z.real) + imag = math.atan2(z.imag, abs(z.real)) + return complex(real, imag) + else: + s1 = cmath.sqrt(complex(1. + z.imag, -z.real)) + s2 = cmath.sqrt(complex(1. - z.imag, z.real)) + real = math.asinh(s1.real * s2.imag - s2.real * s1.imag) + imag = math.atan2(z.imag, s1.real * s2.real - s1.imag * s2.imag) + return complex(real, imag) + + res = context.compile_internal(builder, asinh_impl, sig, args) + return impl_ret_untracked(context, builder, sig, res) + +@lower(cmath.asin, types.Complex) +def asin_impl(context, builder, sig, args): + def asin_impl(z): + """cmath.asin(z) = -j * cmath.asinh(z j)""" + r = cmath.asinh(complex(-z.imag, z.real)) + return complex(r.imag, -r.real) + + res = context.compile_internal(builder, asin_impl, sig, args) + return impl_ret_untracked(context, builder, sig, res) + +@lower(cmath.atan, types.Complex) +def atan_impl(context, builder, sig, args): + def atan_impl(z): + """cmath.atan(z) = -j * cmath.atanh(z j)""" + r = cmath.atanh(complex(-z.imag, z.real)) + if math.isinf(z.real) and math.isnan(z.imag): + # XXX this is odd but necessary + return complex(r.imag, r.real) + else: + return complex(r.imag, -r.real) + + res = context.compile_internal(builder, atan_impl, sig, args) + return impl_ret_untracked(context, builder, sig, res) + +@lower(cmath.atanh, types.Complex) +def atanh_impl(context, builder, sig, args): + LN_4 = math.log(4) + THRES_LARGE = math.sqrt(mathimpl.FLT_MAX / 4) + THRES_SMALL = math.sqrt(mathimpl.FLT_MIN) + PI_12 = math.pi / 2 + + def atanh_impl(z): + """cmath.atanh(z)""" + # CPython's algorithm (see c_atanh() in cmathmodule.c) + if z.real < 0.: + # Reduce to case where z.real >= 0., using atanh(z) = -atanh(-z). + negate = True + z = -z + else: + negate = False + + ay = abs(z.imag) + if math.isnan(z.real) or z.real > THRES_LARGE or ay > THRES_LARGE: + if math.isinf(z.imag): + real = math.copysign(0., z.real) + elif math.isinf(z.real): + real = 0. + else: + # may be safe from overflow, depending on hypot's implementation... + h = math.hypot(z.real * 0.5, z.imag * 0.5) + real = z.real/4./h/h + imag = -math.copysign(PI_12, -z.imag) + elif z.real == 1. and ay < THRES_SMALL: + # C99 standard says: atanh(1+/-0.) should be inf +/- 0j + if ay == 0.: + real = INF + imag = z.imag + else: + real = -math.log(math.sqrt(ay) / + math.sqrt(math.hypot(ay, 2.))) + imag = math.copysign(math.atan2(2., -ay) / 2, z.imag) + else: + sqay = ay * ay + zr1 = 1 - z.real + real = math.log1p(4. * z.real / (zr1 * zr1 + sqay)) * 0.25 + imag = -math.atan2(-2. * z.imag, + zr1 * (1 + z.real) - sqay) * 0.5 + + if math.isnan(z.imag): + imag = NAN + if negate: + return complex(-real, -imag) + else: + return complex(real, imag) + + res = context.compile_internal(builder, atanh_impl, sig, args) + return impl_ret_untracked(context, builder, sig, res) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/enumimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/enumimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..4d811d22e5e9272486bd1cdf594ed573478eb751 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/enumimpl.py @@ -0,0 +1,89 @@ +""" +Implementation of enums. +""" +import operator + +from numba.core.imputils import (lower_builtin, lower_getattr, + lower_getattr_generic, lower_cast, + lower_constant, impl_ret_untracked) +from numba.core import types +from numba.core.extending import overload_method + + +@lower_builtin(operator.eq, types.EnumMember, types.EnumMember) +def enum_eq(context, builder, sig, args): + tu, tv = sig.args + u, v = args + res = context.generic_compare(builder, operator.eq, + (tu.dtype, tv.dtype), (u, v)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.is_, types.EnumMember, types.EnumMember) +def enum_is(context, builder, sig, args): + tu, tv = sig.args + u, v = args + if tu == tv: + res = context.generic_compare(builder, operator.eq, + (tu.dtype, tv.dtype), (u, v)) + else: + res = context.get_constant(sig.return_type, False) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.ne, types.EnumMember, types.EnumMember) +def enum_ne(context, builder, sig, args): + tu, tv = sig.args + u, v = args + res = context.generic_compare(builder, operator.ne, + (tu.dtype, tv.dtype), (u, v)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_getattr(types.EnumMember, 'value') +def enum_value(context, builder, ty, val): + return val + + +@lower_cast(types.IntEnumMember, types.Integer) +def int_enum_to_int(context, builder, fromty, toty, val): + """ + Convert an IntEnum member to its raw integer value. + """ + return context.cast(builder, val, fromty.dtype, toty) + + +@lower_constant(types.EnumMember) +def enum_constant(context, builder, ty, pyval): + """ + Return a LLVM constant representing enum member *pyval*. + """ + return context.get_constant_generic(builder, ty.dtype, pyval.value) + + +@lower_getattr_generic(types.EnumClass) +def enum_class_getattr(context, builder, ty, val, attr): + """ + Return an enum member by attribute name. + """ + member = getattr(ty.instance_class, attr) + return context.get_constant_generic(builder, ty.dtype, member.value) + + +@lower_builtin('static_getitem', types.EnumClass, types.StringLiteral) +def enum_class_getitem(context, builder, sig, args): + """ + Return an enum member by index name. + """ + enum_cls_typ, idx = sig.args + member = enum_cls_typ.instance_class[idx.literal_value] + return context.get_constant_generic(builder, enum_cls_typ.dtype, + member.value) + + +@overload_method(types.IntEnumMember, '__hash__') +def intenum_hash(val): + # uses the hash of the value, for IntEnums this will be int.__hash__ + def hash_impl(val): + return hash(val.value) + return hash_impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/hashing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/hashing.py new file mode 100644 index 0000000000000000000000000000000000000000..410f9be325d778887d340da9c016cd9eb9174980 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/hashing.py @@ -0,0 +1,10 @@ +import sys +from numba.core.utils import _RedirectSubpackage +from numba.core import config + +if config.USE_LEGACY_TYPE_SYSTEM: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.old_hashing") +else: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.new_hashing") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/heapq.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/heapq.py new file mode 100644 index 0000000000000000000000000000000000000000..15c8166d8f7ac133b4cb63dda332c59e3918a20c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/heapq.py @@ -0,0 +1,266 @@ +# A port of https://github.com/python/cpython/blob/e42b7051/Lib/heapq.py + + +import heapq as hq + +from numba.core import types +from numba.core.errors import TypingError +from numba.core.extending import overload, register_jitable + + +@register_jitable +def _siftdown(heap, startpos, pos): + newitem = heap[pos] + + while pos > startpos: + parentpos = (pos - 1) >> 1 + parent = heap[parentpos] + if newitem < parent: + heap[pos] = parent + pos = parentpos + continue + break + + heap[pos] = newitem + + +@register_jitable +def _siftup(heap, pos): + endpos = len(heap) + startpos = pos + newitem = heap[pos] + + childpos = 2 * pos + 1 + while childpos < endpos: + + rightpos = childpos + 1 + if rightpos < endpos and not heap[childpos] < heap[rightpos]: + childpos = rightpos + + heap[pos] = heap[childpos] + pos = childpos + childpos = 2 * pos + 1 + + heap[pos] = newitem + _siftdown(heap, startpos, pos) + + +@register_jitable +def _siftdown_max(heap, startpos, pos): + newitem = heap[pos] + + while pos > startpos: + parentpos = (pos - 1) >> 1 + parent = heap[parentpos] + if parent < newitem: + heap[pos] = parent + pos = parentpos + continue + break + heap[pos] = newitem + + +@register_jitable +def _siftup_max(heap, pos): + endpos = len(heap) + startpos = pos + newitem = heap[pos] + + childpos = 2 * pos + 1 + while childpos < endpos: + + rightpos = childpos + 1 + if rightpos < endpos and not heap[rightpos] < heap[childpos]: + childpos = rightpos + + heap[pos] = heap[childpos] + pos = childpos + childpos = 2 * pos + 1 + + heap[pos] = newitem + _siftdown_max(heap, startpos, pos) + + +@register_jitable +def reversed_range(x): + # analogous to reversed(range(x)) + return range(x - 1, -1, -1) + + +@register_jitable +def _heapify_max(x): + n = len(x) + + for i in reversed_range(n // 2): + _siftup_max(x, i) + + +@register_jitable +def _heapreplace_max(heap, item): + returnitem = heap[0] + heap[0] = item + _siftup_max(heap, 0) + return returnitem + + +def assert_heap_type(heap): + if not isinstance(heap, (types.List, types.ListType)): + raise TypingError('heap argument must be a list') + + dt = heap.dtype + if isinstance(dt, types.Complex): + msg = ("'<' not supported between instances " + "of 'complex' and 'complex'") + raise TypingError(msg) + + +def assert_item_type_consistent_with_heap_type(heap, item): + if not heap.dtype == item: + raise TypingError('heap type must be the same as item type') + + +@overload(hq.heapify) +def hq_heapify(x): + assert_heap_type(x) + + def hq_heapify_impl(x): + n = len(x) + for i in reversed_range(n // 2): + _siftup(x, i) + + return hq_heapify_impl + + +@overload(hq.heappop) +def hq_heappop(heap): + assert_heap_type(heap) + + def hq_heappop_impl(heap): + lastelt = heap.pop() + if heap: + returnitem = heap[0] + heap[0] = lastelt + _siftup(heap, 0) + return returnitem + return lastelt + + return hq_heappop_impl + + +@overload(hq.heappush) +def heappush(heap, item): + assert_heap_type(heap) + assert_item_type_consistent_with_heap_type(heap, item) + + def hq_heappush_impl(heap, item): + heap.append(item) + _siftdown(heap, 0, len(heap) - 1) + + return hq_heappush_impl + + +@overload(hq.heapreplace) +def heapreplace(heap, item): + assert_heap_type(heap) + assert_item_type_consistent_with_heap_type(heap, item) + + def hq_heapreplace(heap, item): + returnitem = heap[0] + heap[0] = item + _siftup(heap, 0) + return returnitem + + return hq_heapreplace + + +@overload(hq.heappushpop) +def heappushpop(heap, item): + assert_heap_type(heap) + assert_item_type_consistent_with_heap_type(heap, item) + + def hq_heappushpop_impl(heap, item): + if heap and heap[0] < item: + item, heap[0] = heap[0], item + _siftup(heap, 0) + return item + + return hq_heappushpop_impl + + +def check_input_types(n, iterable): + + if not isinstance(n, (types.Integer, types.Boolean)): + raise TypingError("First argument 'n' must be an integer") + # heapq also accepts 1.0 (but not 0.0, 2.0, 3.0...) but + # this isn't replicated + + if not isinstance(iterable, (types.Sequence, types.Array, types.ListType)): + raise TypingError("Second argument 'iterable' must be iterable") + + +@overload(hq.nsmallest) +def nsmallest(n, iterable): + check_input_types(n, iterable) + + def hq_nsmallest_impl(n, iterable): + + if n == 0: + return [iterable[0] for _ in range(0)] + elif n == 1: + out = min(iterable) + return [out] + + size = len(iterable) + if n >= size: + return sorted(iterable)[:n] + + it = iter(iterable) + result = [(elem, i) for i, elem in zip(range(n), it)] + + _heapify_max(result) + top = result[0][0] + order = n + + for elem in it: + if elem < top: + _heapreplace_max(result, (elem, order)) + top, _order = result[0] + order += 1 + result.sort() + return [elem for (elem, order) in result] + + return hq_nsmallest_impl + + +@overload(hq.nlargest) +def nlargest(n, iterable): + check_input_types(n, iterable) + + def hq_nlargest_impl(n, iterable): + + if n == 0: + return [iterable[0] for _ in range(0)] + elif n == 1: + out = max(iterable) + return [out] + + size = len(iterable) + if n >= size: + return sorted(iterable)[::-1][:n] + + it = iter(iterable) + result = [(elem, i) for i, elem in zip(range(0, -n, -1), it)] + + hq.heapify(result) + top = result[0][0] + order = -n + + for elem in it: + if top < elem: + hq.heapreplace(result, (elem, order)) + top, _order = result[0] + order -= 1 + result.sort(reverse=True) + return [elem for (elem, order) in result] + + return hq_nlargest_impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/iterators.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/iterators.py new file mode 100644 index 0000000000000000000000000000000000000000..fa55dd2b1342f3dd07f034987be724945e423382 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/iterators.py @@ -0,0 +1,140 @@ +""" +Implementation of various iterable and iterator types. +""" + +from numba.core import types, cgutils +from numba.core.imputils import ( + lower_builtin, iternext_impl, call_iternext, call_getiter, + impl_ret_borrowed, impl_ret_new_ref, RefType) + + + +@lower_builtin('getiter', types.IteratorType) +def iterator_getiter(context, builder, sig, args): + [it] = args + return impl_ret_borrowed(context, builder, sig.return_type, it) + +#------------------------------------------------------------------------------- +# builtin `enumerate` implementation + +@lower_builtin(enumerate, types.IterableType) +@lower_builtin(enumerate, types.IterableType, types.Integer) +def make_enumerate_object(context, builder, sig, args): + assert len(args) == 1 or len(args) == 2 # enumerate(it) or enumerate(it, start) + srcty = sig.args[0] + + if len(args) == 1: + src = args[0] + start_val = context.get_constant(types.intp, 0) + elif len(args) == 2: + src = args[0] + start_val = context.cast(builder, args[1], sig.args[1], types.intp) + + iterobj = call_getiter(context, builder, srcty, src) + + enum = context.make_helper(builder, sig.return_type) + + countptr = cgutils.alloca_once(builder, start_val.type) + builder.store(start_val, countptr) + + enum.count = countptr + enum.iter = iterobj + + res = enum._getvalue() + return impl_ret_new_ref(context, builder, sig.return_type, res) + +@lower_builtin('iternext', types.EnumerateType) +@iternext_impl(RefType.NEW) +def iternext_enumerate(context, builder, sig, args, result): + [enumty] = sig.args + [enum] = args + + enum = context.make_helper(builder, enumty, value=enum) + + count = builder.load(enum.count) + ncount = builder.add(count, context.get_constant(types.intp, 1)) + builder.store(ncount, enum.count) + + srcres = call_iternext(context, builder, enumty.source_type, enum.iter) + is_valid = srcres.is_valid() + result.set_valid(is_valid) + + with builder.if_then(is_valid): + srcval = srcres.yielded_value() + result.yield_(context.make_tuple(builder, enumty.yield_type, + [count, srcval])) + + +#------------------------------------------------------------------------------- +# builtin `zip` implementation + +@lower_builtin(zip, types.VarArg(types.Any)) +def make_zip_object(context, builder, sig, args): + zip_type = sig.return_type + + assert len(args) == len(zip_type.source_types) + + zipobj = context.make_helper(builder, zip_type) + + for i, (arg, srcty) in enumerate(zip(args, sig.args)): + zipobj[i] = call_getiter(context, builder, srcty, arg) + + res = zipobj._getvalue() + return impl_ret_new_ref(context, builder, sig.return_type, res) + +@lower_builtin('iternext', types.ZipType) +@iternext_impl(RefType.NEW) +def iternext_zip(context, builder, sig, args, result): + [zip_type] = sig.args + [zipobj] = args + + zipobj = context.make_helper(builder, zip_type, value=zipobj) + + if len(zipobj) == 0: + # zip() is an empty iterator + result.set_exhausted() + return + + p_ret_tup = cgutils.alloca_once(builder, + context.get_value_type(zip_type.yield_type)) + p_is_valid = cgutils.alloca_once_value(builder, value=cgutils.true_bit) + + for i, (iterobj, srcty) in enumerate(zip(zipobj, zip_type.source_types)): + is_valid = builder.load(p_is_valid) + # Avoid calling the remaining iternext if a iterator has been exhausted + with builder.if_then(is_valid): + srcres = call_iternext(context, builder, srcty, iterobj) + is_valid = builder.and_(is_valid, srcres.is_valid()) + builder.store(is_valid, p_is_valid) + val = srcres.yielded_value() + ptr = cgutils.gep_inbounds(builder, p_ret_tup, 0, i) + builder.store(val, ptr) + + is_valid = builder.load(p_is_valid) + result.set_valid(is_valid) + + with builder.if_then(is_valid): + result.yield_(builder.load(p_ret_tup)) + + +#------------------------------------------------------------------------------- +# generator implementation + +@lower_builtin('iternext', types.Generator) +@iternext_impl(RefType.BORROWED) +def iternext_zip(context, builder, sig, args, result): + genty, = sig.args + gen, = args + impl = context.get_generator_impl(genty) + status, retval = impl(context, builder, sig, args) + context.add_linking_libs(getattr(impl, 'libs', ())) + + with cgutils.if_likely(builder, status.is_ok): + result.set_valid(True) + result.yield_(retval) + with cgutils.if_unlikely(builder, status.is_stop_iteration): + result.set_exhausted() + with cgutils.if_unlikely(builder, + builder.and_(status.is_error, + builder.not_(status.is_stop_iteration))): + context.call_conv.return_status_propagate(builder, status) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/listobj.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/listobj.py new file mode 100644 index 0000000000000000000000000000000000000000..08c23dea4835862d38ed2c9f11812d7764006f96 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/listobj.py @@ -0,0 +1,1260 @@ +""" +Support for native homogeneous lists. +""" + + +import math +import operator +from functools import cached_property + +from llvmlite import ir +from numba.core import types, typing, errors, cgutils, config +from numba.core.imputils import (lower_builtin, lower_cast, + iternext_impl, impl_ret_borrowed, + impl_ret_new_ref, impl_ret_untracked, + RefType) +from numba.core.extending import overload_method, overload +from numba.misc import quicksort +from numba.cpython import slicing +from numba import literal_unroll + + +def get_list_payload(context, builder, list_type, value): + """ + Given a list value and type, get its payload structure (as a + reference, so that mutations are seen by all). + """ + payload_type = types.ListPayload(list_type) + payload = context.nrt.meminfo_data(builder, value.meminfo) + ptrty = context.get_data_type(payload_type).as_pointer() + payload = builder.bitcast(payload, ptrty) + return context.make_data_helper(builder, payload_type, ref=payload) + + +def get_itemsize(context, list_type): + """ + Return the item size for the given list type. + """ + llty = context.get_data_type(list_type.dtype) + return context.get_abi_sizeof(llty) + + +class _ListPayloadMixin(object): + + @property + def size(self): + return self._payload.size + + @size.setter + def size(self, value): + self._payload.size = value + + @property + def dirty(self): + return self._payload.dirty + + @property + def data(self): + return self._payload._get_ptr_by_name('data') + + def _gep(self, idx): + return cgutils.gep(self._builder, self.data, idx) + + def getitem(self, idx): + ptr = self._gep(idx) + data_item = self._builder.load(ptr) + return self._datamodel.from_data(self._builder, data_item) + + def fix_index(self, idx): + """ + Fix negative indices by adding the size to them. Positive + indices are left untouched. + """ + is_negative = self._builder.icmp_signed('<', idx, + ir.Constant(idx.type, 0)) + wrapped_index = self._builder.add(idx, self.size) + return self._builder.select(is_negative, wrapped_index, idx) + + def is_out_of_bounds(self, idx): + """ + Return whether the index is out of bounds. + """ + underflow = self._builder.icmp_signed('<', idx, + ir.Constant(idx.type, 0)) + overflow = self._builder.icmp_signed('>=', idx, self.size) + return self._builder.or_(underflow, overflow) + + def clamp_index(self, idx): + """ + Clamp the index in [0, size]. + """ + builder = self._builder + idxptr = cgutils.alloca_once_value(builder, idx) + + zero = ir.Constant(idx.type, 0) + size = self.size + + underflow = self._builder.icmp_signed('<', idx, zero) + with builder.if_then(underflow, likely=False): + builder.store(zero, idxptr) + overflow = self._builder.icmp_signed('>=', idx, size) + with builder.if_then(overflow, likely=False): + builder.store(size, idxptr) + + return builder.load(idxptr) + + def guard_index(self, idx, msg): + """ + Raise an error if the index is out of bounds. + """ + with self._builder.if_then(self.is_out_of_bounds(idx), likely=False): + self._context.call_conv.return_user_exc(self._builder, + IndexError, (msg,)) + + def fix_slice(self, slice): + """ + Fix slice start and stop to be valid (inclusive and exclusive, resp) + indexing bounds. + """ + return slicing.fix_slice(self._builder, slice, self.size) + + def incref_value(self, val): + "Incref an element value" + self._context.nrt.incref(self._builder, self.dtype, val) + + def decref_value(self, val): + "Decref an element value" + self._context.nrt.decref(self._builder, self.dtype, val) + + +class ListPayloadAccessor(_ListPayloadMixin): + """ + A helper object to access the list attributes given the pointer to the + payload type. + """ + def __init__(self, context, builder, list_type, payload_ptr): + self._context = context + self._builder = builder + self._ty = list_type + self._datamodel = context.data_model_manager[list_type.dtype] + payload_type = types.ListPayload(list_type) + ptrty = context.get_data_type(payload_type).as_pointer() + payload_ptr = builder.bitcast(payload_ptr, ptrty) + payload = context.make_data_helper(builder, payload_type, + ref=payload_ptr) + self._payload = payload + + +class ListInstance(_ListPayloadMixin): + + def __init__(self, context, builder, list_type, list_val): + self._context = context + self._builder = builder + self._ty = list_type + self._list = context.make_helper(builder, list_type, list_val) + self._itemsize = get_itemsize(context, list_type) + self._datamodel = context.data_model_manager[list_type.dtype] + + @property + def dtype(self): + return self._ty.dtype + + @property + def _payload(self): + # This cannot be cached as it can be reallocated + return get_list_payload(self._context, self._builder, self._ty, self._list) + + @property + def parent(self): + return self._list.parent + + @parent.setter + def parent(self, value): + self._list.parent = value + + @property + def value(self): + return self._list._getvalue() + + @property + def meminfo(self): + return self._list.meminfo + + def set_dirty(self, val): + if self._ty.reflected: + self._payload.dirty = cgutils.true_bit if val else cgutils.false_bit + + def clear_value(self, idx): + """Remove the value at the location + """ + self.decref_value(self.getitem(idx)) + # it's necessary for the dtor which just decref every slot on it. + self.zfill(idx, self._builder.add(idx, idx.type(1))) + + def setitem(self, idx, val, incref, decref_old_value=True): + # Decref old data + if decref_old_value: + self.decref_value(self.getitem(idx)) + + ptr = self._gep(idx) + data_item = self._datamodel.as_data(self._builder, val) + self._builder.store(data_item, ptr) + self.set_dirty(True) + if incref: + # Incref the underlying data + self.incref_value(val) + + def inititem(self, idx, val, incref=True): + ptr = self._gep(idx) + data_item = self._datamodel.as_data(self._builder, val) + self._builder.store(data_item, ptr) + if incref: + self.incref_value(val) + + def zfill(self, start, stop): + """Zero-fill the memory at index *start* to *stop* + + *stop* MUST not be smaller than *start*. + """ + builder = self._builder + base = self._gep(start) + end = self._gep(stop) + intaddr_t = self._context.get_value_type(types.intp) + size = builder.sub(builder.ptrtoint(end, intaddr_t), + builder.ptrtoint(base, intaddr_t)) + cgutils.memset(builder, base, size, ir.IntType(8)(0)) + + @classmethod + def allocate_ex(cls, context, builder, list_type, nitems): + """ + Allocate a ListInstance with its storage. + Return a (ok, instance) tuple where *ok* is a LLVM boolean and + *instance* is a ListInstance object (the object's contents are + only valid when *ok* is true). + """ + intp_t = context.get_value_type(types.intp) + + if isinstance(nitems, int): + nitems = ir.Constant(intp_t, nitems) + + payload_type = context.get_data_type(types.ListPayload(list_type)) + payload_size = context.get_abi_sizeof(payload_type) + + itemsize = get_itemsize(context, list_type) + # Account for the fact that the payload struct contains one entry + payload_size -= itemsize + + ok = cgutils.alloca_once_value(builder, cgutils.true_bit) + self = cls(context, builder, list_type, None) + + # Total allocation size = + nitems * itemsize + allocsize, ovf = cgutils.muladd_with_overflow(builder, nitems, + ir.Constant(intp_t, itemsize), + ir.Constant(intp_t, payload_size)) + with builder.if_then(ovf, likely=False): + builder.store(cgutils.false_bit, ok) + + with builder.if_then(builder.load(ok), likely=True): + meminfo = context.nrt.meminfo_new_varsize_dtor_unchecked( + builder, size=allocsize, dtor=self.get_dtor()) + with builder.if_else(cgutils.is_null(builder, meminfo), + likely=False) as (if_error, if_ok): + with if_error: + builder.store(cgutils.false_bit, ok) + with if_ok: + self._list.meminfo = meminfo + self._list.parent = context.get_constant_null(types.pyobject) + self._payload.allocated = nitems + self._payload.size = ir.Constant(intp_t, 0) # for safety + self._payload.dirty = cgutils.false_bit + # Zero the allocated region + self.zfill(self.size.type(0), nitems) + + return builder.load(ok), self + + def define_dtor(self): + "Define the destructor if not already defined" + context = self._context + builder = self._builder + mod = builder.module + # Declare dtor + fnty = ir.FunctionType(ir.VoidType(), [cgutils.voidptr_t]) + fn = cgutils.get_or_insert_function(mod, fnty, + '.dtor.list.{}'.format(self.dtype)) + if not fn.is_declaration: + # End early if the dtor is already defined + return fn + fn.linkage = 'linkonce_odr' + # Populate the dtor + builder = ir.IRBuilder(fn.append_basic_block()) + base_ptr = fn.args[0] # void* + + # get payload + payload = ListPayloadAccessor(context, builder, self._ty, base_ptr) + + # Loop over all data to decref + intp = payload.size.type + with cgutils.for_range_slice( + builder, start=intp(0), stop=payload.size, step=intp(1), + intp=intp) as (idx, _): + val = payload.getitem(idx) + context.nrt.decref(builder, self.dtype, val) + builder.ret_void() + return fn + + def get_dtor(self): + """"Get the element dtor function pointer as void pointer. + + It's safe to be called multiple times. + """ + # Define and set the Dtor + dtor = self.define_dtor() + dtor_fnptr = self._builder.bitcast(dtor, cgutils.voidptr_t) + return dtor_fnptr + + @classmethod + def allocate(cls, context, builder, list_type, nitems): + """ + Allocate a ListInstance with its storage. Same as allocate_ex(), + but return an initialized *instance*. If allocation failed, + control is transferred to the caller using the target's current + call convention. + """ + ok, self = cls.allocate_ex(context, builder, list_type, nitems) + with builder.if_then(builder.not_(ok), likely=False): + context.call_conv.return_user_exc(builder, MemoryError, + ("cannot allocate list",)) + return self + + @classmethod + def from_meminfo(cls, context, builder, list_type, meminfo): + """ + Allocate a new list instance pointing to an existing payload + (a meminfo pointer). + Note the parent field has to be filled by the caller. + """ + self = cls(context, builder, list_type, None) + self._list.meminfo = meminfo + self._list.parent = context.get_constant_null(types.pyobject) + context.nrt.incref(builder, list_type, self.value) + # Payload is part of the meminfo, no need to touch it + return self + + def resize(self, new_size): + """ + Ensure the list is properly sized for the new size. + """ + def _payload_realloc(new_allocated): + payload_type = context.get_data_type(types.ListPayload(self._ty)) + payload_size = context.get_abi_sizeof(payload_type) + # Account for the fact that the payload struct contains one entry + payload_size -= itemsize + + allocsize, ovf = cgutils.muladd_with_overflow( + builder, new_allocated, + ir.Constant(intp_t, itemsize), + ir.Constant(intp_t, payload_size)) + with builder.if_then(ovf, likely=False): + context.call_conv.return_user_exc(builder, MemoryError, + ("cannot resize list",)) + + ptr = context.nrt.meminfo_varsize_realloc_unchecked(builder, + self._list.meminfo, + size=allocsize) + cgutils.guard_memory_error(context, builder, ptr, + "cannot resize list") + self._payload.allocated = new_allocated + + context = self._context + builder = self._builder + intp_t = new_size.type + + itemsize = get_itemsize(context, self._ty) + allocated = self._payload.allocated + + two = ir.Constant(intp_t, 2) + eight = ir.Constant(intp_t, 8) + + # allocated < new_size + is_too_small = builder.icmp_signed('<', allocated, new_size) + # (allocated >> 2) > new_size + is_too_large = builder.icmp_signed('>', builder.ashr(allocated, two), new_size) + + with builder.if_then(is_too_large, likely=False): + # Exact downsize to requested size + # NOTE: is_too_large must be aggressive enough to avoid repeated + # upsizes and downsizes when growing a list. + _payload_realloc(new_size) + + with builder.if_then(is_too_small, likely=False): + # Upsize with moderate over-allocation (size + size >> 2 + 8) + new_allocated = builder.add(eight, + builder.add(new_size, + builder.ashr(new_size, two))) + _payload_realloc(new_allocated) + self.zfill(self.size, new_allocated) + + self._payload.size = new_size + self.set_dirty(True) + + def move(self, dest_idx, src_idx, count): + """ + Move `count` elements from `src_idx` to `dest_idx`. + """ + dest_ptr = self._gep(dest_idx) + src_ptr = self._gep(src_idx) + cgutils.raw_memmove(self._builder, dest_ptr, src_ptr, + count, itemsize=self._itemsize) + + self.set_dirty(True) + +class ListIterInstance(_ListPayloadMixin): + + def __init__(self, context, builder, iter_type, iter_val): + self._context = context + self._builder = builder + self._ty = iter_type + self._iter = context.make_helper(builder, iter_type, iter_val) + self._datamodel = context.data_model_manager[iter_type.yield_type] + + @classmethod + def from_list(cls, context, builder, iter_type, list_val): + list_inst = ListInstance(context, builder, iter_type.container, list_val) + self = cls(context, builder, iter_type, None) + index = context.get_constant(types.intp, 0) + self._iter.index = cgutils.alloca_once_value(builder, index) + self._iter.meminfo = list_inst.meminfo + return self + + @property + def _payload(self): + # This cannot be cached as it can be reallocated + return get_list_payload(self._context, self._builder, + self._ty.container, self._iter) + + @property + def value(self): + return self._iter._getvalue() + + @property + def index(self): + return self._builder.load(self._iter.index) + + @index.setter + def index(self, value): + self._builder.store(value, self._iter.index) + + +#------------------------------------------------------------------------------- +# Constructors + +def build_list(context, builder, list_type, items): + """ + Build a list of the given type, containing the given items. + """ + nitems = len(items) + inst = ListInstance.allocate(context, builder, list_type, nitems) + # Populate list + inst.size = context.get_constant(types.intp, nitems) + for i, val in enumerate(items): + inst.setitem(context.get_constant(types.intp, i), val, incref=True) + + return impl_ret_new_ref(context, builder, list_type, inst.value) + + +@lower_builtin(list, types.IterableType) +def list_constructor(context, builder, sig, args): + + def list_impl(iterable): + res = [] + res.extend(iterable) + return res + + return context.compile_internal(builder, list_impl, sig, args) + +@lower_builtin(list) +def list_constructor(context, builder, sig, args): + list_type = sig.return_type + list_len = 0 + inst = ListInstance.allocate(context, builder, list_type, list_len) + return impl_ret_new_ref(context, builder, list_type, inst.value) + +#------------------------------------------------------------------------------- +# Various operations + +@lower_builtin(len, types.List) +def list_len(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + return inst.size + +@lower_builtin('getiter', types.List) +def getiter_list(context, builder, sig, args): + inst = ListIterInstance.from_list(context, builder, sig.return_type, args[0]) + return impl_ret_borrowed(context, builder, sig.return_type, inst.value) + +@lower_builtin('iternext', types.ListIter) +@iternext_impl(RefType.BORROWED) +def iternext_listiter(context, builder, sig, args, result): + inst = ListIterInstance(context, builder, sig.args[0], args[0]) + + index = inst.index + nitems = inst.size + is_valid = builder.icmp_signed('<', index, nitems) + result.set_valid(is_valid) + + with builder.if_then(is_valid): + result.yield_(inst.getitem(index)) + inst.index = builder.add(index, context.get_constant(types.intp, 1)) + + +@lower_builtin(operator.getitem, types.List, types.Integer) +def getitem_list(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + index = args[1] + + index = inst.fix_index(index) + inst.guard_index(index, msg="getitem out of range") + result = inst.getitem(index) + + return impl_ret_borrowed(context, builder, sig.return_type, result) + +@lower_builtin(operator.setitem, types.List, types.Integer, types.Any) +def setitem_list(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + index = args[1] + value = args[2] + + index = inst.fix_index(index) + inst.guard_index(index, msg="setitem out of range") + inst.setitem(index, value, incref=True) + return context.get_dummy_value() + + +@lower_builtin(operator.getitem, types.List, types.SliceType) +def getslice_list(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + slice = context.make_helper(builder, sig.args[1], args[1]) + slicing.guard_invalid_slice(context, builder, sig.args[1], slice) + inst.fix_slice(slice) + + # Allocate result and populate it + result_size = slicing.get_slice_length(builder, slice) + result = ListInstance.allocate(context, builder, sig.return_type, + result_size) + result.size = result_size + with cgutils.for_range_slice_generic(builder, slice.start, slice.stop, + slice.step) as (pos_range, neg_range): + with pos_range as (idx, count): + value = inst.getitem(idx) + result.inititem(count, value, incref=True) + with neg_range as (idx, count): + value = inst.getitem(idx) + result.inititem(count, value, incref=True) + + return impl_ret_new_ref(context, builder, sig.return_type, result.value) + +@lower_builtin(operator.setitem, types.List, types.SliceType, types.Any) +def setitem_list(context, builder, sig, args): + dest = ListInstance(context, builder, sig.args[0], args[0]) + src = ListInstance(context, builder, sig.args[2], args[2]) + + slice = context.make_helper(builder, sig.args[1], args[1]) + slicing.guard_invalid_slice(context, builder, sig.args[1], slice) + dest.fix_slice(slice) + + src_size = src.size + avail_size = slicing.get_slice_length(builder, slice) + size_delta = builder.sub(src.size, avail_size) + + zero = ir.Constant(size_delta.type, 0) + one = ir.Constant(size_delta.type, 1) + + with builder.if_else(builder.icmp_signed('==', slice.step, one)) as (then, otherwise): + with then: + # Slice step == 1 => we can resize + + # Compute the real stop, e.g. for dest[2:0] = [...] + real_stop = builder.add(slice.start, avail_size) + # Size of the list tail, after the end of slice + tail_size = builder.sub(dest.size, real_stop) + + with builder.if_then(builder.icmp_signed('>', size_delta, zero)): + # Grow list then move list tail + dest.resize(builder.add(dest.size, size_delta)) + dest.move(builder.add(real_stop, size_delta), real_stop, + tail_size) + + with builder.if_then(builder.icmp_signed('<', size_delta, zero)): + # Move list tail then shrink list + dest.move(builder.add(real_stop, size_delta), real_stop, + tail_size) + dest.resize(builder.add(dest.size, size_delta)) + + dest_offset = slice.start + + with cgutils.for_range(builder, src_size) as loop: + value = src.getitem(loop.index) + dest.setitem(builder.add(loop.index, dest_offset), value, incref=True) + + with otherwise: + with builder.if_then(builder.icmp_signed('!=', size_delta, zero)): + msg = "cannot resize extended list slice with step != 1" + context.call_conv.return_user_exc(builder, ValueError, (msg,)) + + with cgutils.for_range_slice_generic( + builder, slice.start, slice.stop, slice.step) as (pos_range, neg_range): + with pos_range as (index, count): + value = src.getitem(count) + dest.setitem(index, value, incref=True) + with neg_range as (index, count): + value = src.getitem(count) + dest.setitem(index, value, incref=True) + + return context.get_dummy_value() + + + +@lower_builtin(operator.delitem, types.List, types.Integer) +def delitem_list_index(context, builder, sig, args): + + def list_delitem_impl(lst, i): + lst.pop(i) + + return context.compile_internal(builder, list_delitem_impl, sig, args) + + +@lower_builtin(operator.delitem, types.List, types.SliceType) +def delitem_list(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + slice = context.make_helper(builder, sig.args[1], args[1]) + + slicing.guard_invalid_slice(context, builder, sig.args[1], slice) + inst.fix_slice(slice) + + slice_len = slicing.get_slice_length(builder, slice) + + one = ir.Constant(slice_len.type, 1) + + with builder.if_then(builder.icmp_signed('!=', slice.step, one), likely=False): + msg = "unsupported del list[start:stop:step] with step != 1" + context.call_conv.return_user_exc(builder, NotImplementedError, (msg,)) + + # Compute the real stop, e.g. for dest[2:0] + start = slice.start + real_stop = builder.add(start, slice_len) + # Decref the removed range + with cgutils.for_range_slice( + builder, start, real_stop, start.type(1) + ) as (idx, _): + inst.decref_value(inst.getitem(idx)) + + # Size of the list tail, after the end of slice + tail_size = builder.sub(inst.size, real_stop) + inst.move(start, real_stop, tail_size) + inst.resize(builder.sub(inst.size, slice_len)) + + return context.get_dummy_value() + + +# XXX should there be a specific module for Sequence or collection base classes? + +@lower_builtin(operator.contains, types.Sequence, types.Any) +def in_seq(context, builder, sig, args): + def seq_contains_impl(lst, value): + for elem in lst: + if elem == value: + return True + return False + + return context.compile_internal(builder, seq_contains_impl, sig, args) + +@lower_builtin(bool, types.Sequence) +def sequence_bool(context, builder, sig, args): + def sequence_bool_impl(seq): + return len(seq) != 0 + + return context.compile_internal(builder, sequence_bool_impl, sig, args) + + +@overload(operator.truth) +def sequence_truth(seq): + if isinstance(seq, types.Sequence): + def impl(seq): + return len(seq) != 0 + return impl + + +@lower_builtin(operator.add, types.List, types.List) +def list_add(context, builder, sig, args): + a = ListInstance(context, builder, sig.args[0], args[0]) + b = ListInstance(context, builder, sig.args[1], args[1]) + + a_size = a.size + b_size = b.size + nitems = builder.add(a_size, b_size) + dest = ListInstance.allocate(context, builder, sig.return_type, nitems) + dest.size = nitems + + with cgutils.for_range(builder, a_size) as loop: + value = a.getitem(loop.index) + value = context.cast(builder, value, a.dtype, dest.dtype) + dest.setitem(loop.index, value, incref=True) + with cgutils.for_range(builder, b_size) as loop: + value = b.getitem(loop.index) + value = context.cast(builder, value, b.dtype, dest.dtype) + dest.setitem(builder.add(loop.index, a_size), value, incref=True) + + return impl_ret_new_ref(context, builder, sig.return_type, dest.value) + +@lower_builtin(operator.iadd, types.List, types.List) +def list_add_inplace(context, builder, sig, args): + assert sig.args[0].dtype == sig.return_type.dtype + dest = _list_extend_list(context, builder, sig, args) + + return impl_ret_borrowed(context, builder, sig.return_type, dest.value) + + +@lower_builtin(operator.mul, types.List, types.Integer) +@lower_builtin(operator.mul, types.Integer, types.List) +def list_mul(context, builder, sig, args): + if isinstance(sig.args[0], types.List): + list_idx, int_idx = 0, 1 + else: + list_idx, int_idx = 1, 0 + src = ListInstance(context, builder, sig.args[list_idx], args[list_idx]) + src_size = src.size + + mult = args[int_idx] + zero = ir.Constant(mult.type, 0) + mult = builder.select(cgutils.is_neg_int(builder, mult), zero, mult) + nitems = builder.mul(mult, src_size) + + dest = ListInstance.allocate(context, builder, sig.return_type, nitems) + dest.size = nitems + + with cgutils.for_range_slice(builder, zero, nitems, src_size, inc=True) as (dest_offset, _): + with cgutils.for_range(builder, src_size) as loop: + value = src.getitem(loop.index) + dest.setitem(builder.add(loop.index, dest_offset), value, incref=True) + + return impl_ret_new_ref(context, builder, sig.return_type, dest.value) + +@lower_builtin(operator.imul, types.List, types.Integer) +def list_mul_inplace(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + src_size = inst.size + + mult = args[1] + zero = ir.Constant(mult.type, 0) + mult = builder.select(cgutils.is_neg_int(builder, mult), zero, mult) + nitems = builder.mul(mult, src_size) + + inst.resize(nitems) + + with cgutils.for_range_slice(builder, src_size, nitems, src_size, inc=True) as (dest_offset, _): + with cgutils.for_range(builder, src_size) as loop: + value = inst.getitem(loop.index) + inst.setitem(builder.add(loop.index, dest_offset), value, incref=True) + + return impl_ret_borrowed(context, builder, sig.return_type, inst.value) + + +#------------------------------------------------------------------------------- +# Comparisons + +@lower_builtin(operator.is_, types.List, types.List) +def list_is(context, builder, sig, args): + a = ListInstance(context, builder, sig.args[0], args[0]) + b = ListInstance(context, builder, sig.args[1], args[1]) + ma = builder.ptrtoint(a.meminfo, cgutils.intp_t) + mb = builder.ptrtoint(b.meminfo, cgutils.intp_t) + return builder.icmp_signed('==', ma, mb) + +@lower_builtin(operator.eq, types.List, types.List) +def list_eq(context, builder, sig, args): + aty, bty = sig.args + a = ListInstance(context, builder, aty, args[0]) + b = ListInstance(context, builder, bty, args[1]) + + a_size = a.size + same_size = builder.icmp_signed('==', a_size, b.size) + + res = cgutils.alloca_once_value(builder, same_size) + + with builder.if_then(same_size): + with cgutils.for_range(builder, a_size) as loop: + v = a.getitem(loop.index) + w = b.getitem(loop.index) + itemres = context.generic_compare(builder, operator.eq, + (aty.dtype, bty.dtype), (v, w)) + with builder.if_then(builder.not_(itemres)): + # Exit early + builder.store(cgutils.false_bit, res) + loop.do_break() + + return builder.load(res) + + +def all_list(*args): + return all([isinstance(typ, types.List) for typ in args]) + +@overload(operator.ne) +def impl_list_ne(a, b): + if not all_list(a, b): + return + + def list_ne_impl(a, b): + return not (a == b) + + return list_ne_impl + +@overload(operator.le) +def impl_list_le(a, b): + if not all_list(a, b): + return + + def list_le_impl(a, b): + m = len(a) + n = len(b) + for i in range(min(m, n)): + if a[i] < b[i]: + return True + elif a[i] > b[i]: + return False + return m <= n + + return list_le_impl + +@overload(operator.lt) +def impl_list_lt(a, b): + if not all_list(a, b): + return + + def list_lt_impl(a, b): + m = len(a) + n = len(b) + for i in range(min(m, n)): + if a[i] < b[i]: + return True + elif a[i] > b[i]: + return False + return m < n + + return list_lt_impl + +@overload(operator.ge) +def impl_list_ge(a, b): + if not all_list(a, b): + return + + def list_ge_impl(a, b): + return b <= a + + return list_ge_impl + +@overload(operator.gt) +def impl_list_gt(a, b): + if not all_list(a, b): + return + + def list_gt_impl(a, b): + return b < a + + return list_gt_impl + +#------------------------------------------------------------------------------- +# Methods + +@lower_builtin("list.append", types.List, types.Any) +def list_append(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + item = args[1] + + n = inst.size + new_size = builder.add(n, ir.Constant(n.type, 1)) + inst.resize(new_size) + inst.setitem(n, item, incref=True) + + return context.get_dummy_value() + +@lower_builtin("list.clear", types.List) +def list_clear(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + inst.resize(context.get_constant(types.intp, 0)) + + return context.get_dummy_value() + + +@overload_method(types.List, "copy") +def list_copy(lst): + def list_copy_impl(lst): + return list(lst) + + return list_copy_impl + + +@overload_method(types.List, "count") +def list_count(lst, value): + + def list_count_impl(lst, value): + res = 0 + for elem in lst: + if elem == value: + res += 1 + return res + + return list_count_impl + + +def _list_extend_list(context, builder, sig, args): + src = ListInstance(context, builder, sig.args[1], args[1]) + dest = ListInstance(context, builder, sig.args[0], args[0]) + + src_size = src.size + dest_size = dest.size + nitems = builder.add(src_size, dest_size) + dest.resize(nitems) + dest.size = nitems + + with cgutils.for_range(builder, src_size) as loop: + value = src.getitem(loop.index) + value = context.cast(builder, value, src.dtype, dest.dtype) + dest.setitem(builder.add(loop.index, dest_size), value, incref=True) + + return dest + +@lower_builtin("list.extend", types.List, types.IterableType) +def list_extend(context, builder, sig, args): + if isinstance(sig.args[1], types.List): + # Specialize for list operands, for speed. + _list_extend_list(context, builder, sig, args) + return context.get_dummy_value() + + def list_extend(lst, iterable): + # Speed hack to avoid NRT refcount operations inside the loop + meth = lst.append + for v in iterable: + meth(v) + + return context.compile_internal(builder, list_extend, sig, args) + + +if config.USE_LEGACY_TYPE_SYSTEM: + intp_max = types.intp.maxval +else: + intp_max = types.py_int.maxval + + +@overload_method(types.List, "index") +def list_index(lst, value, start=0, stop=intp_max): + + if not isinstance(start, (int, types.Integer, types.Omitted)): + raise errors.TypingError(f'arg "start" must be an Integer. Got {start}') + if not isinstance(stop, (int, types.Integer, types.Omitted)): + raise errors.TypingError(f'arg "stop" must be an Integer. Got {stop}') + + def list_index_impl(lst, value, start=0, stop=intp_max): + n = len(lst) + if start < 0: + start += n + if start < 0: + start = 0 + if stop < 0: + stop += n + if stop > n: + stop = n + for i in range(start, stop): + if lst[i] == value: + return i + # XXX references are leaked when raising + raise ValueError("value not in list") + return list_index_impl + + +@lower_builtin("list.insert", types.List, types.Integer, + types.Any) +def list_insert(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + index = inst.fix_index(args[1]) + index = inst.clamp_index(index) + value = args[2] + + n = inst.size + one = ir.Constant(n.type, 1) + new_size = builder.add(n, one) + inst.resize(new_size) + inst.move(builder.add(index, one), index, builder.sub(n, index)) + inst.setitem(index, value, incref=True, decref_old_value=False) + + return context.get_dummy_value() + +@lower_builtin("list.pop", types.List) +def list_pop(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + + n = inst.size + cgutils.guard_zero(context, builder, n, + (IndexError, "pop from empty list")) + n = builder.sub(n, ir.Constant(n.type, 1)) + res = inst.getitem(n) + inst.incref_value(res) # incref the pop'ed element + inst.clear_value(n) # clear the storage space + inst.resize(n) + return impl_ret_new_ref(context, builder, sig.return_type, res) + +@lower_builtin("list.pop", types.List, types.Integer) +def list_pop(context, builder, sig, args): + inst = ListInstance(context, builder, sig.args[0], args[0]) + idx = inst.fix_index(args[1]) + + n = inst.size + cgutils.guard_zero(context, builder, n, + (IndexError, "pop from empty list")) + inst.guard_index(idx, "pop index out of range") + + res = inst.getitem(idx) + + one = ir.Constant(n.type, 1) + n = builder.sub(n, ir.Constant(n.type, 1)) + inst.move(idx, builder.add(idx, one), builder.sub(n, idx)) + inst.resize(n) + return impl_ret_new_ref(context, builder, sig.return_type, res) + +@overload_method(types.List, "remove") +def list_remove(lst, value): + + def list_remove_impl(lst, value): + for i in range(len(lst)): + if lst[i] == value: + lst.pop(i) + return + # XXX references are leaked when raising + raise ValueError("list.remove(x): x not in list") + + return list_remove_impl + +@overload_method(types.List, "reverse") +def list_reverse(lst): + + def list_reverse_impl(lst): + for a in range(0, len(lst) // 2): + b = -a - 1 + lst[a], lst[b] = lst[b], lst[a] + + return list_reverse_impl + +# ----------------------------------------------------------------------------- +# Sorting + +def gt(a, b): + return a > b + +sort_forwards = quicksort.make_jit_quicksort().run_quicksort +sort_backwards = quicksort.make_jit_quicksort(lt=gt).run_quicksort + +arg_sort_forwards = quicksort.make_jit_quicksort(is_argsort=True, + is_list=True).run_quicksort +arg_sort_backwards = quicksort.make_jit_quicksort(is_argsort=True, lt=gt, + is_list=True).run_quicksort + + +def _sort_check_reverse(reverse): + if isinstance(reverse, types.Omitted): + rty = reverse.value + elif isinstance(reverse, types.Optional): + rty = reverse.type + else: + rty = reverse + if not isinstance(rty, (types.Boolean, types.Integer, int, bool)): + msg = "an integer is required for 'reverse' (got type %s)" % reverse + raise errors.TypingError(msg) + return rty + + +def _sort_check_key(key): + if isinstance(key, types.Optional): + msg = ("Key must concretely be None or a Numba JIT compiled function, " + "an Optional (union of None and a value) was found") + raise errors.TypingError(msg) + if not (cgutils.is_nonelike(key) or isinstance(key, types.Dispatcher)): + msg = "Key must be None or a Numba JIT compiled function" + raise errors.TypingError(msg) + + +@overload_method(types.List, "sort") +def ol_list_sort(lst, key=None, reverse=False): + + _sort_check_key(key) + _sort_check_reverse(reverse) + + if cgutils.is_nonelike(key): + KEY = False + sort_f = sort_forwards + sort_b = sort_backwards + elif isinstance(key, types.Dispatcher): + KEY = True + sort_f = arg_sort_forwards + sort_b = arg_sort_backwards + + def impl(lst, key=None, reverse=False): + if KEY is True: + _lst = [key(x) for x in lst] + else: + _lst = lst + if reverse is False or reverse == 0: + tmp = sort_f(_lst) + else: + tmp = sort_b(_lst) + if KEY is True: + lst[:] = [lst[i] for i in tmp] + return impl + + +@overload(sorted) +def ol_sorted(iterable, key=None, reverse=False): + + if not isinstance(iterable, types.IterableType): + return False + + _sort_check_key(key) + _sort_check_reverse(reverse) + + def impl(iterable, key=None, reverse=False): + lst = list(iterable) + lst.sort(key=key, reverse=reverse) + return lst + return impl + +# ----------------------------------------------------------------------------- +# Implicit casting + +@lower_cast(types.List, types.List) +def list_to_list(context, builder, fromty, toty, val): + # Casting from non-reflected to reflected + assert fromty.dtype == toty.dtype + return val + +# ----------------------------------------------------------------------------- +# Implementations for types.LiteralList +# ----------------------------------------------------------------------------- + +_banned_error = errors.TypingError("Cannot mutate a literal list") + + +# Things that mutate literal lists are banned +@overload_method(types.LiteralList, 'append') +def literal_list_banned_append(lst, obj): + raise _banned_error + + +@overload_method(types.LiteralList, 'extend') +def literal_list_banned_extend(lst, iterable): + raise _banned_error + + +@overload_method(types.LiteralList, 'insert') +def literal_list_banned_insert(lst, index, obj): + raise _banned_error + + +@overload_method(types.LiteralList, 'remove') +def literal_list_banned_remove(lst, value): + raise _banned_error + + +@overload_method(types.LiteralList, 'pop') +def literal_list_banned_pop(lst, index=-1): + raise _banned_error + + +@overload_method(types.LiteralList, 'clear') +def literal_list_banned_clear(lst): + raise _banned_error + + +@overload_method(types.LiteralList, 'sort') +def literal_list_banned_sort(lst, key=None, reverse=False): + raise _banned_error + + +@overload_method(types.LiteralList, 'reverse') +def literal_list_banned_reverse(lst): + raise _banned_error + +if config.USE_LEGACY_TYPE_SYSTEM: + _index_end = types.intp.maxval +else: + _index_end = types.py_int.maxval + +@overload_method(types.LiteralList, 'index') +def literal_list_index(lst, x, start=0, end=_index_end): + # TODO: To make this work, need consts as slice for start/end so as to + # be able to statically analyse the bounds, then its a just loop body + # versioning based iteration along with enumerate to find the item + if isinstance(lst, types.LiteralList): + msg = "list.index is unsupported for literal lists" + raise errors.TypingError(msg) + +@overload_method(types.LiteralList, 'count') +def literal_list_count(lst, x): + if isinstance(lst, types.LiteralList): + def impl(lst, x): + count = 0 + for val in literal_unroll(lst): + if val == x: + count += 1 + return count + return impl + +@overload_method(types.LiteralList, 'copy') +def literal_list_count(lst): + if isinstance(lst, types.LiteralList): + def impl(lst): + return lst # tuples are immutable, as is this, so just return it + return impl + +@overload(operator.delitem) +def literal_list_delitem(lst, index): + if isinstance(lst, types.LiteralList): + raise _banned_error + +@overload(operator.setitem) +def literal_list_setitem(lst, index, value): + if isinstance(lst, types.LiteralList): + raise errors.TypingError("Cannot mutate a literal list") + +@overload(operator.getitem) +def literal_list_getitem(lst, *args): + if not isinstance(lst, types.LiteralList): + return + msg = ("Cannot __getitem__ on a literal list, return type cannot be " + "statically determined.") + raise errors.TypingError(msg) + +@overload(len) +def literal_list_len(lst): + if not isinstance(lst, types.LiteralList): + return + l = lst.count + return lambda lst: l + +@overload(operator.contains) +def literal_list_contains(lst, item): + if isinstance(lst, types.LiteralList): + def impl(lst, item): + for val in literal_unroll(lst): + if val == item: + return True + return False + return impl + +@lower_cast(types.LiteralList, types.LiteralList) +def literallist_to_literallist(context, builder, fromty, toty, val): + if len(fromty) != len(toty): + # Disallowed by typing layer + raise NotImplementedError + + olditems = cgutils.unpack_tuple(builder, val, len(fromty)) + items = [context.cast(builder, v, f, t) + for v, f, t in zip(olditems, fromty, toty)] + return context.make_tuple(builder, toty, items) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/mathimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/mathimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..3be374c1ba7e3e6a413e5ddc356da5b51f8ab055 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/mathimpl.py @@ -0,0 +1,10 @@ +import sys +from numba.core.utils import _RedirectSubpackage +from numba.core import config + +if config.USE_LEGACY_TYPE_SYSTEM: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.old_mathimpl") +else: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.new_mathimpl") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_builtins.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..c04f57e45ec4732b548d63960249a71029ba069b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_builtins.py @@ -0,0 +1,1026 @@ +from collections import namedtuple +import math +from functools import reduce + +import numpy as np +import operator +import warnings + +from llvmlite import ir + +from numba.core.imputils import (lower_builtin, lower_getattr, + lower_getattr_generic, lower_cast, + lower_constant, iternext_impl, + call_getiter, call_iternext, impl_ret_borrowed, + impl_ret_untracked, numba_typeref_ctor) +from numba.core import typing, types, utils, cgutils +from numba.core.extending import overload, intrinsic +from numba.core.typeconv import Conversion +from numba.core.typing.templates import (AbstractTemplate, infer_global, + signature) +from numba.core.errors import (TypingError, LoweringError, + NumbaExperimentalFeatureWarning, + NumbaTypeError, RequireLiteralValue, + NumbaPerformanceWarning) +from numba.misc.special import literal_unroll +from numba.core.typing.asnumbatype import as_numba_type + + +@overload(operator.truth) +def ol_truth(val): + if isinstance(val, types.Boolean): + def impl(val): + return val + return impl + + +@lower_builtin(operator.is_not, types.Any, types.Any) +def generic_is_not(context, builder, sig, args): + """ + Implement `x is not y` as `not (x is y)`. + """ + is_impl = context.get_function(operator.is_, sig) + return builder.not_(is_impl(builder, args)) + + +@lower_builtin(operator.is_, types.Any, types.Any) +def generic_is(context, builder, sig, args): + """ + Default implementation for `x is y` + """ + lhs_type, rhs_type = sig.args + # the lhs and rhs have the same type + if lhs_type == rhs_type: + # mutable types + if lhs_type.mutable: + msg = 'no default `is` implementation' + raise LoweringError(msg) + # immutable types + else: + # fallbacks to `==` + try: + eq_impl = context.get_function(operator.eq, sig) + except NotImplementedError: + # no `==` implemented for this type + return cgutils.false_bit + else: + return eq_impl(builder, args) + else: + return cgutils.false_bit + + +@lower_builtin(operator.is_, types.Opaque, types.Opaque) +def opaque_is(context, builder, sig, args): + """ + Implementation for `x is y` for Opaque types. + """ + lhs_type, rhs_type = sig.args + # the lhs and rhs have the same type + if lhs_type == rhs_type: + lhs_ptr = builder.ptrtoint(args[0], cgutils.intp_t) + rhs_ptr = builder.ptrtoint(args[1], cgutils.intp_t) + + return builder.icmp_unsigned('==', lhs_ptr, rhs_ptr) + else: + return cgutils.false_bit + + +@lower_builtin(operator.is_, types.Boolean, types.Boolean) +def bool_is_impl(context, builder, sig, args): + """ + Implementation for `x is y` for types derived from types.Boolean + (e.g. BooleanLiteral), and cross-checks between literal and non-literal + booleans, to satisfy Python's behavior preserving identity for bools. + """ + arg1, arg2 = args + arg1_type, arg2_type = sig.args + _arg1 = context.cast(builder, arg1, arg1_type, types.boolean) + _arg2 = context.cast(builder, arg2, arg2_type, types.boolean) + eq_impl = context.get_function( + operator.eq, + typing.signature(types.boolean, types.boolean, types.boolean) + ) + return eq_impl(builder, (_arg1, _arg2)) + + +# keep types.IntegerLiteral, as otherwise there's ambiguity between this and int_eq_impl +@lower_builtin(operator.eq, types.Literal, types.Literal) +@lower_builtin(operator.eq, types.IntegerLiteral, types.IntegerLiteral) +def const_eq_impl(context, builder, sig, args): + arg1, arg2 = sig.args + val = 0 + if arg1.literal_value == arg2.literal_value: + val = 1 + res = ir.Constant(ir.IntType(1), val) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# keep types.IntegerLiteral, as otherwise there's ambiguity between this and int_ne_impl +@lower_builtin(operator.ne, types.Literal, types.Literal) +@lower_builtin(operator.ne, types.IntegerLiteral, types.IntegerLiteral) +def const_ne_impl(context, builder, sig, args): + arg1, arg2 = sig.args + val = 0 + if arg1.literal_value != arg2.literal_value: + val = 1 + res = ir.Constant(ir.IntType(1), val) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def gen_non_eq(val): + def none_equality(a, b): + a_none = isinstance(a, types.NoneType) + b_none = isinstance(b, types.NoneType) + if a_none and b_none: + def impl(a, b): + return val + return impl + elif a_none ^ b_none: + def impl(a, b): + return not val + return impl + return none_equality + +overload(operator.eq)(gen_non_eq(True)) +overload(operator.ne)(gen_non_eq(False)) + +#------------------------------------------------------------------------------- + +@lower_getattr_generic(types.DeferredType) +def deferred_getattr(context, builder, typ, value, attr): + """ + Deferred.__getattr__ => redirect to the actual type. + """ + inner_type = typ.get() + val = context.cast(builder, value, typ, inner_type) + imp = context.get_getattr(inner_type, attr) + return imp(context, builder, inner_type, val, attr) + +@lower_cast(types.Any, types.DeferredType) +@lower_cast(types.Optional, types.DeferredType) +@lower_cast(types.Boolean, types.DeferredType) +def any_to_deferred(context, builder, fromty, toty, val): + actual = context.cast(builder, val, fromty, toty.get()) + model = context.data_model_manager[toty] + return model.set(builder, model.make_uninitialized(), actual) + +@lower_cast(types.DeferredType, types.Any) +@lower_cast(types.DeferredType, types.Boolean) +@lower_cast(types.DeferredType, types.Optional) +def deferred_to_any(context, builder, fromty, toty, val): + model = context.data_model_manager[fromty] + val = model.get(builder, val) + return context.cast(builder, val, fromty.get(), toty) + + +#------------------------------------------------------------------------------ + +@lower_builtin(operator.getitem, types.CPointer, types.Integer) +def getitem_cpointer(context, builder, sig, args): + base_ptr, idx = args + elem_ptr = builder.gep(base_ptr, [idx]) + res = builder.load(elem_ptr) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(operator.setitem, types.CPointer, types.Integer, types.Any) +def setitem_cpointer(context, builder, sig, args): + base_ptr, idx, val = args + elem_ptr = builder.gep(base_ptr, [idx]) + builder.store(val, elem_ptr) + + +#------------------------------------------------------------------------------- + +def do_minmax(context, builder, argtys, args, cmpop): + assert len(argtys) == len(args), (argtys, args) + assert len(args) > 0 + + def binary_minmax(accumulator, value): + # This is careful to reproduce Python's algorithm, e.g. + # max(1.5, nan, 2.5) should return 2.5 (not nan or 1.5) + accty, acc = accumulator + vty, v = value + ty = context.typing_context.unify_types(accty, vty) + assert ty is not None + acc = context.cast(builder, acc, accty, ty) + v = context.cast(builder, v, vty, ty) + cmpsig = typing.signature(types.py_bool, ty, ty) + ge = context.get_function(cmpop, cmpsig) + pred = ge(builder, (v, acc)) + res = builder.select(pred, v, acc) + return ty, res + + typvals = zip(argtys, args) + resty, resval = reduce(binary_minmax, typvals) + return resval + + +@lower_builtin(max, types.BaseTuple) +def max_iterable(context, builder, sig, args): + argtys = list(sig.args[0]) + args = cgutils.unpack_tuple(builder, args[0]) + return do_minmax(context, builder, argtys, args, operator.gt) + +@lower_builtin(max, types.VarArg(types.Any)) +def max_vararg(context, builder, sig, args): + return do_minmax(context, builder, sig.args, args, operator.gt) + +@lower_builtin(min, types.BaseTuple) +def min_iterable(context, builder, sig, args): + argtys = list(sig.args[0]) + args = cgutils.unpack_tuple(builder, args[0]) + return do_minmax(context, builder, argtys, args, operator.lt) + +@lower_builtin(min, types.VarArg(types.Any)) +def min_vararg(context, builder, sig, args): + return do_minmax(context, builder, sig.args, args, operator.lt) + + +def _round_intrinsic(tp): + # round() rounds half to even + return "llvm.rint.f%d" % (tp.bitwidth,) + +@lower_builtin(round, types.Float) +def round_impl_unary(context, builder, sig, args): + fltty = sig.args[0] + llty = context.get_value_type(fltty) + module = builder.module + fnty = ir.FunctionType(llty, [llty]) + fn = cgutils.get_or_insert_function(module, fnty, _round_intrinsic(fltty)) + res = builder.call(fn, args) + # unary round() returns an int + res = builder.fptosi(res, context.get_value_type(sig.return_type)) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(round, types.Float, types.Integer) +def round_impl_binary(context, builder, sig, args): + fltty = sig.args[0] + # Allow calling the intrinsic from the Python implementation below. + # This avoids the conversion to an int in Python 3's unary round(). + _round = types.ExternalFunction( + _round_intrinsic(fltty), typing.signature(fltty, fltty)) + + def round_ndigits(x, ndigits): + if math.isinf(x) or math.isnan(x): + return x + + if ndigits >= 0: + if ndigits > 22: + # pow1 and pow2 are each safe from overflow, but + # pow1*pow2 ~= pow(10.0, ndigits) might overflow. + pow1 = 10.0 ** (ndigits - 22) + pow2 = 1e22 + else: + pow1 = 10.0 ** ndigits + pow2 = 1.0 + y = (x * pow1) * pow2 + if math.isinf(y): + return x + return (_round(y) / pow2) / pow1 + + else: + pow1 = 10.0 ** (-ndigits) + y = x / pow1 + return _round(y) * pow1 + + res = context.compile_internal(builder, round_ndigits, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +#------------------------------------------------------------------------------- +# Numeric constructors + +@lower_builtin(int, types.Any) +@lower_builtin(float, types.Any) +def int_impl(context, builder, sig, args): + [ty] = sig.args + [val] = args + res = context.cast(builder, val, ty, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(float, types.StringLiteral) +def float_literal_impl(context, builder, sig, args): + [ty] = sig.args + res = context.get_constant(sig.return_type, float(ty.literal_value)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(complex, types.VarArg(types.Any)) +def complex_impl(context, builder, sig, args): + complex_type = sig.return_type + float_type = complex_type.underlying_float + if len(sig.args) == 1: + [argty] = sig.args + [arg] = args + if isinstance(argty, types.Complex): + # Cast Complex* to Complex* + res = context.cast(builder, arg, argty, complex_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + else: + real = context.cast(builder, arg, argty, float_type) + imag = context.get_constant(float_type, 0) + + elif len(sig.args) == 2: + [realty, imagty] = sig.args + [real, imag] = args + real = context.cast(builder, real, realty, float_type) + imag = context.cast(builder, imag, imagty, float_type) + + cmplx = context.make_complex(builder, complex_type) + cmplx.real = real + cmplx.imag = imag + res = cmplx._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(types.NumberClass, types.Any) +def number_constructor(context, builder, sig, args): + """ + Call a number class, e.g. np.int32(...) + """ + if isinstance(sig.return_type, types.Array): + # Array constructor + dt = sig.return_type.dtype + def foo(*arg_hack): + return np.array(arg_hack, dtype=dt) + res = context.compile_internal(builder, foo, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + else: + # Scalar constructor + [val] = args + [valty] = sig.args + return context.cast(builder, val, valty, sig.return_type) + + +#------------------------------------------------------------------------------- +# Constants + +@lower_constant(types.Dummy) +def constant_dummy(context, builder, ty, pyval): + # This handles None, etc. + return context.get_dummy_value() + +@lower_constant(types.ExternalFunctionPointer) +def constant_function_pointer(context, builder, ty, pyval): + ptrty = context.get_function_pointer_type(ty) + ptrval = context.add_dynamic_addr(builder, ty.get_pointer(pyval), + info=str(pyval)) + return builder.bitcast(ptrval, ptrty) + + +@lower_constant(types.Optional) +def constant_optional(context, builder, ty, pyval): + if pyval is None: + return context.make_optional_none(builder, ty.type) + else: + return context.make_optional_value(builder, ty.type, pyval) + + +# ----------------------------------------------------------------------------- + +@lower_builtin(type, types.Any) +def type_impl(context, builder, sig, args): + """ + One-argument type() builtin. + """ + return context.get_dummy_value() + + +@lower_builtin(iter, types.IterableType) +def iter_impl(context, builder, sig, args): + ty, = sig.args + val, = args + iterval = call_getiter(context, builder, ty, val) + return iterval + + +@lower_builtin(next, types.IteratorType) +def next_impl(context, builder, sig, args): + iterty, = sig.args + iterval, = args + + res = call_iternext(context, builder, iterty, iterval) + + with builder.if_then(builder.not_(res.is_valid()), likely=False): + context.call_conv.return_user_exc(builder, StopIteration, ()) + + return res.yielded_value() + + +# ----------------------------------------------------------------------------- + +@lower_builtin("not in", types.Any, types.Any) +def not_in(context, builder, sig, args): + def in_impl(a, b): + return operator.contains(b, a) + + res = context.compile_internal(builder, in_impl, sig, args) + return builder.not_(res) + + +# ----------------------------------------------------------------------------- + +@lower_builtin(len, types.ConstSized) +def constsized_len(context, builder, sig, args): + [ty] = sig.args + retty = sig.return_type + res = context.get_constant(retty, len(ty.types)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(bool, types.Sized) +def sized_bool(context, builder, sig, args): + [ty] = sig.args + if len(ty): + return cgutils.true_bit + else: + return cgutils.false_bit + +@lower_builtin(tuple) +def lower_empty_tuple(context, builder, sig, args): + retty = sig.return_type + res = context.get_constant_undef(retty) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(tuple, types.BaseTuple) +def lower_tuple(context, builder, sig, args): + val, = args + return impl_ret_borrowed(context, builder, sig.return_type, val) + +@overload(bool) +def bool_sequence(x): + valid_types = ( + types.CharSeq, + types.UnicodeCharSeq, + types.DictType, + types.ListType, + types.UnicodeType, + types.Set, + ) + + if isinstance(x, valid_types): + def bool_impl(x): + return len(x) > 0 + return bool_impl + +@overload(bool, inline='always') +def bool_none(x): + if isinstance(x, types.NoneType) or x is None: + return lambda x: False + +# ----------------------------------------------------------------------------- + +def get_type_max_value(typ): + if isinstance(typ, types.Float): + return np.inf + if isinstance(typ, types.Integer): + return typ.maxval + raise NumbaTypeError("Unsupported type") + +def get_type_min_value(typ): + if isinstance(typ, types.Float): + return -np.inf + if isinstance(typ, types.Integer): + return typ.minval + raise NumbaTypeError("Unsupported type") + +@infer_global(get_type_min_value) +@infer_global(get_type_max_value) +class MinValInfer(AbstractTemplate): + def generic(self, args, kws): + assert not kws + assert len(args) == 1 + if isinstance(args[0], (types.DType, types.NumberClass)): + return signature(args[0].dtype, *args) + +@lower_builtin(get_type_min_value, types.NumberClass) +@lower_builtin(get_type_min_value, types.DType) +def lower_get_type_min_value(context, builder, sig, args): + typ = sig.args[0].dtype + + if isinstance(typ, types.Integer): + bw = typ.bitwidth + lty = ir.IntType(bw) + val = typ.minval + res = ir.Constant(lty, val) + elif isinstance(typ, types.Float): + bw = typ.bitwidth + if bw == 32: + lty = ir.FloatType() + elif bw == 64: + lty = ir.DoubleType() + else: + raise NotImplementedError("llvmlite only supports 32 and 64 bit floats") + npty = getattr(np, 'float{}'.format(bw)) + res = ir.Constant(lty, -np.inf) + elif isinstance(typ, (types.NPDatetime, types.NPTimedelta)): + bw = 64 + lty = ir.IntType(bw) + val = types.int64.minval + 1 # minval is NaT, so minval + 1 is the smallest value + res = ir.Constant(lty, val) + return impl_ret_untracked(context, builder, lty, res) + +@lower_builtin(get_type_max_value, types.NumberClass) +@lower_builtin(get_type_max_value, types.DType) +def lower_get_type_max_value(context, builder, sig, args): + typ = sig.args[0].dtype + + if isinstance(typ, types.Integer): + bw = typ.bitwidth + lty = ir.IntType(bw) + val = typ.maxval + res = ir.Constant(lty, val) + elif isinstance(typ, types.Float): + bw = typ.bitwidth + if bw == 32: + lty = ir.FloatType() + elif bw == 64: + lty = ir.DoubleType() + else: + raise NotImplementedError("llvmlite only supports 32 and 64 bit floats") + npty = getattr(np, 'float{}'.format(bw)) + res = ir.Constant(lty, np.inf) + elif isinstance(typ, (types.NPDatetime, types.NPTimedelta)): + bw = 64 + lty = ir.IntType(bw) + val = types.int64.maxval + res = ir.Constant(lty, val) + return impl_ret_untracked(context, builder, lty, res) + +# ----------------------------------------------------------------------------- + +from numba.core.typing.builtins import IndexValue, IndexValueType +from numba.extending import overload, register_jitable + +@lower_builtin(IndexValue, types.py_int, types.Type) +@lower_builtin(IndexValue, types.np_intp, types.Type) +@lower_builtin(IndexValue, types.np_uintp, types.Type) +def impl_index_value(context, builder, sig, args): + typ = sig.return_type + index, value = args + index_value = cgutils.create_struct_proxy(typ)(context, builder) + index_value.index = index + index_value.value = value + return index_value._getvalue() + + +@overload(min) +def indval_min(indval1, indval2): + if isinstance(indval1, IndexValueType) and \ + isinstance(indval2, IndexValueType): + def min_impl(indval1, indval2): + if np.isnan(indval1.value): + if np.isnan(indval2.value): + # both indval1 and indval2 are nans so order by index + if indval1.index < indval2.index: + return indval1 + else: + return indval2 + else: + # comparing against one nan always considered less + return indval1 + elif np.isnan(indval2.value): + # indval1 not a nan but indval2 is so consider indval2 less + return indval2 + elif indval1.value > indval2.value: + return indval2 + elif indval1.value == indval2.value: + if indval1.index < indval2.index: + return indval1 + else: + return indval2 + return indval1 + return min_impl + + +@overload(min) +def boolval_min(val1, val2): + if isinstance(val1, types.Boolean) and \ + isinstance(val2, types.Boolean): + def bool_min_impl(val1, val2): + return val1 and val2 + return bool_min_impl + + +@overload(max) +def indval_max(indval1, indval2): + if isinstance(indval1, IndexValueType) and \ + isinstance(indval2, IndexValueType): + def max_impl(indval1, indval2): + if np.isnan(indval1.value): + if np.isnan(indval2.value): + # both indval1 and indval2 are nans so order by index + if indval1.index < indval2.index: + return indval1 + else: + return indval2 + else: + # comparing against one nan always considered larger + return indval1 + elif np.isnan(indval2.value): + # indval1 not a nan but indval2 is so consider indval2 larger + return indval2 + elif indval2.value > indval1.value: + return indval2 + elif indval1.value == indval2.value: + if indval1.index < indval2.index: + return indval1 + else: + return indval2 + return indval1 + return max_impl + + +@overload(max) +def boolval_max(val1, val2): + if isinstance(val1, types.Boolean) and \ + isinstance(val2, types.Boolean): + def bool_max_impl(val1, val2): + return val1 or val2 + return bool_max_impl + + +greater_than = register_jitable(lambda a, b: a > b) +less_than = register_jitable(lambda a, b: a < b) + + +@register_jitable +def min_max_impl(iterable, op): + if isinstance(iterable, types.IterableType): + def impl(iterable): + it = iter(iterable) + return_val = next(it) + for val in it: + if op(val, return_val): + return_val = val + return return_val + return impl + + +@overload(min) +def iterable_min(iterable): + return min_max_impl(iterable, less_than) + + +@overload(max) +def iterable_max(iterable): + return min_max_impl(iterable, greater_than) + + +@lower_builtin(types.TypeRef, types.VarArg(types.Any)) +def redirect_type_ctor(context, builder, sig, args): + """Redirect constructor implementation to `numba_typeref_ctor(cls, *args)`, + which should be overloaded by the type's implementation. + + For example: + + d = Dict() + + `d` will be typed as `TypeRef[DictType]()`. Thus, it will call into this + implementation. We need to redirect the lowering to a function + named ``numba_typeref_ctor``. + """ + cls = sig.return_type + + def call_ctor(cls, *args): + return numba_typeref_ctor(cls, *args) + + # Pack arguments into a tuple for `*args` + ctor_args = types.Tuple.from_types(sig.args) + # Make signature T(TypeRef[T], *args) where T is cls + sig = typing.signature(cls, types.TypeRef(cls), ctor_args) + if len(ctor_args) > 0: + args = (context.get_dummy_value(), # Type object has no runtime repr. + context.make_tuple(builder, ctor_args, args)) + else: + args = (context.get_dummy_value(), # Type object has no runtime repr. + context.make_tuple(builder, ctor_args, ())) + + return context.compile_internal(builder, call_ctor, sig, args) + + +@overload(sum) +def ol_sum(iterable, start=0): + # Cpython explicitly rejects strings, bytes and bytearrays + # https://github.com/python/cpython/blob/3.9/Python/bltinmodule.c#L2310-L2329 # noqa: E501 + error = None + if isinstance(start, types.UnicodeType): + error = ('strings', '') + elif isinstance(start, types.Bytes): + error = ('bytes', 'b') + elif isinstance(start, types.ByteArray): + error = ('bytearray', 'b') + + if error is not None: + msg = "sum() can't sum {} [use {}''.join(seq) instead]".format(*error) + raise TypingError(msg) + + # if the container is homogeneous then it's relatively easy to handle. + if isinstance(iterable, (types.containers._HomogeneousTuple, types.List, + types.ListType, types.Array, types.RangeType)): + iterator = iter + elif isinstance(iterable, (types.containers._HeterogeneousTuple)): + # if container is heterogeneous then literal unroll and hope for the + # best. + iterator = literal_unroll + else: + return None + + def impl(iterable, start=0): + acc = start + for x in iterator(iterable): + # This most likely widens the type, this is expected Numba behaviour + acc = acc + x + return acc + return impl + + +# ------------------------------------------------------------------------------ +# map, filter, reduce + + +@overload(map) +def ol_map(func, iterable, *args): + def impl(func, iterable, *args): + for x in zip(iterable, *args): + yield func(*x) + return impl + + +@overload(filter) +def ol_filter(func, iterable): + if (func is None) or isinstance(func, types.NoneType): + def impl(func, iterable): + for x in iterable: + if x: + yield x + else: + def impl(func, iterable): + for x in iterable: + if func(x): + yield x + return impl + + +@overload(isinstance) +def ol_isinstance(var, typs): + + def true_impl(var, typs): + return True + + def false_impl(var, typs): + return False + + var_ty = as_numba_type(var) + + if isinstance(var_ty, types.Optional): + msg = f'isinstance cannot handle optional types. Found: "{var_ty}"' + raise NumbaTypeError(msg) + + # NOTE: The current implementation of `isinstance` restricts the type of the + # instance variable to types that are well known and in common use. The + # danger of unrestricted type comparison is that a "default" of `False` is + # required and this means that if there is a bug in the logic of the + # comparison tree `isinstance` returns False! It's therefore safer to just + # reject the compilation as untypable! + supported_var_ty = (types.Number, types.Bytes, types.RangeType, + types.DictType, types.LiteralStrKeyDict, types.List, + types.ListType, types.Tuple, types.UniTuple, types.Set, + types.Function, types.ClassType, types.UnicodeType, + types.ClassInstanceType, types.NoneType, types.Array, + types.Boolean, types.Float, types.UnicodeCharSeq, + types.Complex, types.NPDatetime, types.NPTimedelta,) + if not isinstance(var_ty, supported_var_ty): + msg = f'isinstance() does not support variables of type "{var_ty}".' + raise NumbaTypeError(msg) + + t_typs = typs + + # Check the types that the var can be an instance of, it'll be a scalar, + # a unituple or a tuple. + if isinstance(t_typs, types.UniTuple): + # corner case - all types in isinstance are the same + t_typs = (t_typs.key[0]) + + if not isinstance(t_typs, types.Tuple): + t_typs = (t_typs, ) + + for typ in t_typs: + + if isinstance(typ, types.Function): + key = typ.key[0] # functions like int(..), float(..), str(..) + elif isinstance(typ, types.ClassType): + key = typ # jitclasses + else: + key = typ.key + + # corner cases for bytes, range, ... + # avoid registering those types on `as_numba_type` + types_not_registered = { + bytes: types.Bytes, + range: types.RangeType, + dict: (types.DictType, types.LiteralStrKeyDict), + list: types.List, + tuple: types.BaseTuple, + set: types.Set, + } + if key in types_not_registered: + if isinstance(var_ty, types_not_registered[key]): + return true_impl + continue + + if isinstance(typ, types.TypeRef): + # Use of Numba type classes is in general not supported as they do + # not work when the jit is disabled. + if key not in (types.ListType, types.DictType): + msg = ("Numba type classes (except numba.typed.* container " + "types) are not supported.") + raise NumbaTypeError(msg) + # Case for TypeRef (i.e. isinstance(var, typed.List)) + # var_ty == ListType[int64] (instance) + # typ == types.ListType (class) + return true_impl if type(var_ty) is key else false_impl + else: + numba_typ = as_numba_type(key) + if var_ty == numba_typ: + return true_impl + elif isinstance(numba_typ, (types.NPDatetime, types.NPTimedelta)): + if isinstance(var_ty, type(numba_typ)): + return true_impl + elif isinstance(numba_typ, types.ClassType) and \ + isinstance(var_ty, types.ClassInstanceType) and \ + var_ty.key == numba_typ.instance_type.key: + # check for jitclasses + return true_impl + elif isinstance(numba_typ, types.Container) and \ + numba_typ.key[0] == types.undefined: + # check for containers (list, tuple, set, ...) + if isinstance(var_ty, numba_typ.__class__) or \ + (isinstance(var_ty, types.BaseTuple) and \ + isinstance(numba_typ, types.BaseTuple)): + return true_impl + + return false_impl + + +# -- getattr implementation + +def _getattr_raise_attr_exc(obj, name): + # Dummy function for the purpose of creating an overloadable stub from + # which to raise an AttributeError as needed + pass + + +@overload(_getattr_raise_attr_exc) +def ol__getattr_raise_attr_exc(obj, name): + if not isinstance(name, types.StringLiteral): + raise RequireLiteralValue("argument 'name' must be a literal string") + lname = name.literal_value + message = f"'{obj}' has no attribute '{lname}'" + + def impl(obj, name): + raise AttributeError(message) + return impl + + +@intrinsic +def resolve_getattr(tyctx, obj, name, default): + if not isinstance(name, types.StringLiteral): + raise RequireLiteralValue("argument 'name' must be a literal string") + lname = name.literal_value + fn = tyctx.resolve_getattr(obj, lname) + # Cannot handle things like `getattr(np, 'cos')` as the return type is + # types.Function. + if isinstance(fn, types.Function): + msg = ("Returning function objects is not implemented. " + f"getattr() was requested to return {fn} from attribute " + f"'{lname}' of {obj}.") + raise TypingError(msg) + + if fn is None: # No attribute + + # if default is not _getattr_default then return the default + if not (isinstance(default, types.NamedTuple) and + default.instance_class == _getattr_default_type): + # it's not the marker default value, so return it + sig = default(obj, name, default) + def impl(cgctx, builder, sig, llargs): + tmp = llargs[-1] + cgctx.nrt.incref(builder, default, tmp) + return tmp + else: + # else wire in raising an AttributeError + fnty = tyctx.resolve_value_type(_getattr_raise_attr_exc) + raise_sig = fnty.get_call_type(tyctx, (obj, name), {}) + sig = types.none(obj, name, default) + def impl(cgctx, builder, sig, llargs): + native_impl = cgctx.get_function(fnty, raise_sig) + return native_impl(builder, llargs[:-1]) + + else: # Attribute present, wire in handing it back to the overload(getattr) + sig = fn(obj, name, default) + if isinstance(fn, types.BoundFunction): + # It's a method on an object + def impl(cgctx, builder, sig, ll_args): + cast_type = fn.this + casted = cgctx.cast(builder, ll_args[0], obj, cast_type) + res = cgctx.get_bound_function(builder, casted, cast_type) + cgctx.nrt.incref(builder, fn, res) + return res + else: + # Else it's some other type of attribute. + # Ensure typing calls occur at typing time, not at lowering + attrty = tyctx.resolve_getattr(obj, lname) + def impl(cgctx, builder, sig, ll_args): + attr_impl = cgctx.get_getattr(obj, lname) + res = attr_impl(cgctx, builder, obj, ll_args[0], lname) + casted = cgctx.cast(builder, res, attrty, fn) + cgctx.nrt.incref(builder, fn, casted) + return casted + return sig, impl + + +# These are marker objects to indicate "no default has been provided" in a call +_getattr_default_type = namedtuple('_getattr_default_type', '') +_getattr_default = _getattr_default_type() + + +# getattr with no default arg, obj is an open type and name is forced as a +# literal string. The _getattr_default marker is used to indicate "no default +# was provided". +@overload(getattr, prefer_literal=True) +def ol_getattr_2(obj, name): + def impl(obj, name): + return resolve_getattr(obj, name, _getattr_default) + return impl + + +# getattr with default arg present, obj is an open type, name is forced as a +# literal string, the "default" is again an open type. Note that the CPython +# definition is: `getattr(object, name[, default]) -> value`, the `default` +# is not a kwarg. +@overload(getattr) +def ol_getattr_3(obj, name, default): + def impl(obj, name, default): + return resolve_getattr(obj, name, default) + return impl + + +@intrinsic +def resolve_hasattr(tyctx, obj, name): + if not isinstance(name, types.StringLiteral): + raise RequireLiteralValue("argument 'name' must be a literal string") + lname = name.literal_value + fn = tyctx.resolve_getattr(obj, lname) + # Whilst technically the return type could be a types.bool_, the literal + # value is resolvable at typing time. Propagating this literal information + # into the type system allows the compiler to prune branches based on a + # hasattr predicate. As a result the signature is based on literals. This is + # "safe" because the overload requires a literal string so each will be a + # different variant of (obj, literal(name)) -> literal(bool). + if fn is None: + retty = types.literal(False) + else: + retty = types.literal(True) + sig = retty(obj, name) + def impl(cgctx, builder, sig, ll_args): + return cgutils.false_bit if fn is None else cgutils.true_bit + return sig, impl + +# hasattr cannot be implemented as a getattr call and then catching +# AttributeError because Numba doesn't support catching anything other than +# "Exception", so lacks the specificity required. Instead this implementation +# tries to resolve the attribute via typing information and returns True/False +# based on that. +@overload(hasattr) +def ol_hasattr(obj, name): + def impl(obj, name): + return resolve_hasattr(obj, name) + return impl + + +@overload(repr) +def ol_repr_generic(obj): + missing_repr_format = f"" + def impl(obj): + attr = '__repr__' + if hasattr(obj, attr) == True: + return getattr(obj, attr)() + else: + # There's no __str__ or __repr__ defined for this object, return + # something generic + return missing_repr_format + return impl + + +@overload(str) +def ol_str_generic(object=''): + def impl(object=""): + attr = '__str__' + if hasattr(object, attr) == True: + return getattr(object, attr)() + else: + return repr(object) + return impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_hashing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_hashing.py new file mode 100644 index 0000000000000000000000000000000000000000..5d3573738f5729d1251c661441e738af7d73c913 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_hashing.py @@ -0,0 +1,747 @@ +""" +Hash implementations for Numba types +""" + +import math +import numpy as np +import sys +import ctypes +import warnings +from collections import namedtuple + +import llvmlite.binding as ll +from llvmlite import ir + +from numba import literal_unroll +from numba.core.extending import ( + overload, overload_method, intrinsic, register_jitable) +from numba.core import errors +from numba.core import types +from numba.core.unsafe.bytes import grab_byte, grab_uint64_t +from numba.cpython.randomimpl import (const_int, get_next_int, get_next_int32, + get_state_ptr) + +# This is Py_hash_t, which is a Py_ssize_t, which has sizeof(size_t): +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Include/pyport.h#L91-L96 # noqa: E501 +_hash_width = sys.hash_info.width +_Py_hash_t = getattr(types, 'py_int') +_Py_uhash_t = getattr(types, 'py_int') + +# Constants from CPython source, obtained by various means: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Include/pyhash.h # noqa: E501 +_PyHASH_INF = sys.hash_info.inf +_PyHASH_NAN = sys.hash_info.nan +_PyHASH_MODULUS = _Py_uhash_t(sys.hash_info.modulus) +_PyHASH_BITS = 31 if types.py_int.bitwidth == 32 else 61 # mersenne primes +_PyHASH_MULTIPLIER = 0xf4243 # 1000003UL +_PyHASH_IMAG = _PyHASH_MULTIPLIER +_PyLong_SHIFT = sys.int_info.bits_per_digit +_Py_HASH_CUTOFF = sys.hash_info.cutoff +_Py_hashfunc_name = sys.hash_info.algorithm + + +# This stub/overload pair are used to force branch pruning to remove the dead +# branch based on the potential `None` type of the hash_func which works better +# if the predicate for the prune in an ir.Arg. The obj is an arg to allow for +# a custom error message. +def _defer_hash(hash_func): + pass + + +@overload(_defer_hash) +def ol_defer_hash(obj, hash_func): + err_msg = f"unhashable type: '{obj}'" + + def impl(obj, hash_func): + if hash_func is None: + raise TypeError(err_msg) + else: + return hash_func() + return impl + + +# hash(obj) is implemented by calling obj.__hash__() +@overload(hash) +def hash_overload(obj): + attempt_generic_msg = ("No __hash__ is defined for object of type " + f"'{obj}' and a generic hash() cannot be " + "performed as there is no suitable object " + "represention in Numba compiled code!") + + def impl(obj): + if hasattr(obj, '__hash__'): + return _defer_hash(obj, getattr(obj, '__hash__')) + else: + raise TypeError(attempt_generic_msg) + return impl + + +@register_jitable +def process_return(val): + asint = _Py_hash_t(val) + if (asint == int(-1)): + asint = int(-2) + return asint + + +# This is a translation of CPython's _Py_HashDouble: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Python/pyhash.c#L34-L129 # noqa: E501 +# NOTE: In Python 3.10 hash of nan is now hash of the pointer to the PyObject +# containing said nan. Numba cannot replicate this as there is no object, so it +# elects to replicate the behaviour i.e. hash of nan is something "unique" which +# satisfies https://bugs.python.org/issue43475. + + +@register_jitable(locals={'x': _Py_uhash_t, + 'y': _Py_uhash_t, + 'm': types.np_double, + 'e': types.np_intc, + 'sign': types.np_intc, + '_PyHASH_MODULUS': _Py_uhash_t, + '_PyHASH_BITS': types.np_intc + }) +def _Py_HashDouble(v): + if not np.isfinite(v): + if (np.isinf(v)): + if (v > 0): + return _PyHASH_INF + else: + return -_PyHASH_INF + else: + # Python 3.10 does not use `_PyHASH_NAN`. + # https://github.com/python/cpython/blob/2c4792264f9218692a1bd87398a60591f756b171/Python/pyhash.c#L102 # noqa: E501 + # Numba returns a pseudo-random number to reflect the spirit of the + # change. + x = _prng_random_hash() + return process_return(x) + + m, e = math.frexp(v) + + sign = 1 + if (m < 0): + sign = -1 + m = -m + + # process 28 bits at a time; this should work well both for binary + # and hexadecimal floating point. + x = 0 + while (m): + x = ((x << 28) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - 28) + m *= 268435456.0 # /* 2**28 */ + e -= 28 + y = int(m) # /* pull out integer part */ + m -= y + x += y + if x >= _PyHASH_MODULUS: + x -= _PyHASH_MODULUS + # /* adjust for the exponent; first reduce it modulo _PyHASH_BITS */ + if e >= 0: + e = e % _PyHASH_BITS + else: + e = _PyHASH_BITS - 1 - ((-1 - e) % _PyHASH_BITS) + + x = ((x << e) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - e) + + x = x * sign + return process_return(x) + + +@intrinsic +def _fpext(tyctx, val): + def impl(cgctx, builder, signature, args): + val = args[0] + return builder.fpext(val, ir.DoubleType()) + sig = types.c_float64(types.c_float32) + return sig, impl + + +@intrinsic +def _prng_random_hash(tyctx): + + def impl(cgctx, builder, signature, args): + state_ptr = get_state_ptr(cgctx, builder, "internal") + bits = const_int(_hash_width) + + # Why not just use get_next_int() with the correct bitwidth? + # get_next_int() always returns an i64, because the bitwidth it is + # passed may not be a compile-time constant, so it needs to allocate + # the largest unit of storage that may be required. Therefore, if the + # hash width is 32, then we need to use get_next_int32() to ensure we + # don't return a wider-than-expected hash, even if everything above + # the low 32 bits would have been zero. + if _hash_width == 32: + value = get_next_int32(cgctx, builder, state_ptr) + else: + value = get_next_int(cgctx, builder, state_ptr, bits, False) + + return value + + sig = _Py_hash_t() + return sig, impl + + +# This is a translation of CPython's long_hash, but restricted to the numerical +# domain reachable by int64/uint64 (i.e. no BigInt like support): +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Objects/longobject.c#L2934-L2989 # noqa: E501 +# obdigit is a uint32_t which is typedef'd to digit +# int32_t is typedef'd to sdigit + + +@register_jitable(locals={'x': _Py_uhash_t, + 'p1': _Py_uhash_t, + 'p2': _Py_uhash_t, + 'p3': _Py_uhash_t, + 'p4': _Py_uhash_t, + '_PyHASH_MODULUS': _Py_uhash_t, + '_PyHASH_BITS': types.c_int32, + '_PyLong_SHIFT': types.c_int32,}) +def _long_impl(val): + # This function assumes val came from a long int repr with val being a + # uint64_t this means having to split the input into PyLong_SHIFT size + # chunks in an unsigned hash wide type, max numba can handle is a 64bit int + + # mask to select low _PyLong_SHIFT bits + _tmp_shift = 32 - _PyLong_SHIFT + mask_shift = (~types.c_uint32(0x0)) >> _tmp_shift + + # a 64bit wide max means Numba only needs 3 x 30 bit values max, + # or 5 x 15 bit values max on 32bit platforms + i = (64 // _PyLong_SHIFT) + 1 + + # alg as per hash_long + x = 0 + p3 = (_PyHASH_BITS - _PyLong_SHIFT) + for idx in range(i - 1, -1, -1): + p1 = x << _PyLong_SHIFT + p2 = p1 & _PyHASH_MODULUS + p4 = x >> p3 + x = p2 | p4 + # the shift and mask splits out the `ob_digit` parts of a Long repr + x += types.c_uint32((val >> idx * _PyLong_SHIFT) & mask_shift) + if x >= _PyHASH_MODULUS: + x -= _PyHASH_MODULUS + return _Py_hash_t(x) + + +# This has no CPython equivalent, CPython uses long_hash. +@overload_method(types.Integer, '__hash__') +@overload_method(types.Boolean, '__hash__') +def int_hash(val): + + _HASH_I64_MIN = -2 if sys.maxsize <= 2 ** 32 else -4 + _SIGNED_MIN = types.c_int64(-0x8000000000000000) + + # Find a suitable type to hold a "big" value, i.e. iinfo(ty).min/max + # this is to ensure e.g. int32.min is handled ok as it's abs() is its value + _BIG = types.c_int64 if getattr(val, 'signed', False) else types.c_uint64 + + # this is a bit involved due to the CPython repr of ints + def impl(val): + # If the magnitude is under PyHASH_MODULUS, just return the + # value val as the hash, couple of special cases if val == val: + # 1. it's 0, in which case return 0 + # 2. it's signed int minimum value, return the value CPython computes + # but Numba cannot as there's no type wide enough to hold the shifts. + # + # If the magnitude is greater than PyHASH_MODULUS then... if the value + # is negative then negate it switch the sign on the hash once computed + # and use the standard wide unsigned hash implementation + val = _BIG(val) + mag = abs(val) + if mag < _PyHASH_MODULUS: + if val == 0: + ret = 0 + elif val == _SIGNED_MIN: # e.g. int64 min, -0x8000000000000000 + ret = _Py_hash_t(_HASH_I64_MIN) + else: + ret = _Py_hash_t(val) + else: + needs_negate = False + if val < 0: + val = -val + needs_negate = True + ret = _long_impl(val) + if needs_negate: + ret = -ret + return process_return(ret) + return impl + +# This is a translation of CPython's float_hash: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Objects/floatobject.c#L528-L532 # noqa: E501 + + +@overload_method(types.Float, '__hash__') +def float_hash(val): + if val.bitwidth == 64: + def impl(val): + hashed = _Py_HashDouble(val) + return hashed + else: + def impl(val): + # widen the 32bit float to 64bit + fpextended = np.float64(_fpext(val)) + hashed = _Py_HashDouble(fpextended) + return hashed + return impl + +# This is a translation of CPython's complex_hash: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Objects/complexobject.c#L408-L428 # noqa: E501 + + +@overload_method(types.Complex, '__hash__') +def complex_hash(val): + def impl(val): + hashreal = hash(val.real) + hashimag = hash(val.imag) + # Note: if the imaginary part is 0, hashimag is 0 now, + # so the following returns hashreal unchanged. This is + # important because numbers of different types that + # compare equal must have the same hash value, so that + # hash(x + 0*j) must equal hash(x). + combined = hashreal + _PyHASH_IMAG * hashimag + return process_return(combined) + return impl + + +# Python 3.8 strengthened its hash alg for tuples. +# This is a translation of CPython's tuplehash for Python >=3.8 +# https://github.com/python/cpython/blob/b738237d6792acba85b1f6e6c8993a812c7fd815/Objects/tupleobject.c#L338-L391 # noqa: E501 + +# These consts are needed for this alg variant, they are from: +# https://github.com/python/cpython/blob/b738237d6792acba85b1f6e6c8993a812c7fd815/Objects/tupleobject.c#L353-L363 # noqa: E501 + +if _Py_uhash_t.bitwidth // 8 > 4: + _PyHASH_XXPRIME_1 = _Py_uhash_t(11400714785074694791) + _PyHASH_XXPRIME_2 = _Py_uhash_t(14029467366897019727) + _PyHASH_XXPRIME_5 = _Py_uhash_t(2870177450012600261) + + @register_jitable(locals={'x': types.np_uint64}) + def _PyHASH_XXROTATE(x): + # Rotate left 31 bits + return ((x << types.np_uint64(31)) | (x >> types.np_uint64(33))) +else: + _PyHASH_XXPRIME_1 = _Py_uhash_t(2654435761) + _PyHASH_XXPRIME_2 = _Py_uhash_t(2246822519) + _PyHASH_XXPRIME_5 = _Py_uhash_t(374761393) + + @register_jitable(locals={'x': types.np_uint64}) + def _PyHASH_XXROTATE(x): + # Rotate left 13 bits + return ((x << types.np_uint64(13)) | (x >> types.np_uint64(19))) + + +@register_jitable(locals={'acc': _Py_uhash_t, 'lane': _Py_uhash_t, + '_PyHASH_XXPRIME_5': _Py_uhash_t, + '_PyHASH_XXPRIME_1': _Py_uhash_t, + 'tl': _Py_uhash_t}) +def _tuple_hash(tup): + tl = len(tup) + acc = _PyHASH_XXPRIME_5 + for x in literal_unroll(tup): + lane = hash(x) + if lane == _Py_uhash_t(-1): + return -1 + acc += lane * _PyHASH_XXPRIME_2 + acc = _PyHASH_XXROTATE(acc) + acc *= _PyHASH_XXPRIME_1 + + acc += tl ^ (_PyHASH_XXPRIME_5 ^ _Py_uhash_t(3527539)) + + if acc == _Py_uhash_t(-1): + return process_return(1546275796) + + return process_return(acc) + + +@overload_method(types.BaseTuple, '__hash__') +def tuple_hash(val): + def impl(val): + return _tuple_hash(val) + return impl + + +# ------------------------------------------------------------------------------ +# String/bytes hashing needs hashseed info, this is from: +# https://stackoverflow.com/a/41088757 +# with thanks to Martijn Pieters +# +# Developer note: +# CPython makes use of an internal "hashsecret" which is essentially a struct +# containing some state that is set on CPython initialization and contains magic +# numbers used particularly in unicode/string hashing. This code binds to the +# Python runtime libraries in use by the current process and reads the +# "hashsecret" state so that it can be used by Numba. As this is done at runtime +# the behaviour and influence of the PYTHONHASHSEED environment variable is +# accommodated. + +from ctypes import ( # noqa + c_size_t, + c_ubyte, + c_uint64, + pythonapi, + Structure, + Union, +) # noqa + + +class FNV(Structure): + _fields_ = [ + ('prefix', c_size_t), + ('suffix', c_size_t) + ] + + +class SIPHASH(Structure): + _fields_ = [ + ('k0', c_uint64), + ('k1', c_uint64), + ] + + +class DJBX33A(Structure): + _fields_ = [ + ('padding', c_ubyte * 16), + ('suffix', c_size_t), + ] + + +class EXPAT(Structure): + _fields_ = [ + ('padding', c_ubyte * 16), + ('hashsalt', c_size_t), + ] + + +class _Py_HashSecret_t(Union): + _fields_ = [ + # ensure 24 bytes + ('uc', c_ubyte * 24), + # two Py_hash_t for FNV + ('fnv', FNV), + # two uint64 for SipHash24 + ('siphash', SIPHASH), + # a different (!) Py_hash_t for small string optimization + ('djbx33a', DJBX33A), + ('expat', EXPAT), + ] + + +_hashsecret_entry = namedtuple('_hashsecret_entry', ['symbol', 'value']) + + +# Only a few members are needed at present +def _build_hashsecret(): + """Read hash secret from the Python process + + Returns + ------- + info : dict + - keys are "djbx33a_suffix", "siphash_k0", siphash_k1". + - values are the namedtuple[symbol:str, value:int] + """ + # Read hashsecret and inject it into the LLVM symbol map under the + # prefix `_numba_hashsecret_`. + pyhashsecret = _Py_HashSecret_t.in_dll(pythonapi, '_Py_HashSecret') + info = {} + + def inject(name, val): + symbol_name = "_numba_hashsecret_{}".format(name) + val = ctypes.c_uint64(val) + addr = ctypes.addressof(val) + ll.add_symbol(symbol_name, addr) + info[name] = _hashsecret_entry(symbol=symbol_name, value=val) + + inject('djbx33a_suffix', pyhashsecret.djbx33a.suffix) + inject('siphash_k0', pyhashsecret.siphash.k0) + inject('siphash_k1', pyhashsecret.siphash.k1) + return info + + +_hashsecret = _build_hashsecret() + + +# ------------------------------------------------------------------------------ + + +if _Py_hashfunc_name in ('siphash13', 'siphash24', 'fnv'): + + # Check for use of the FNV hashing alg, warn users that it's not implemented + # and functionality relying of properties derived from hashing will be fine + # but hash values themselves are likely to be different. + if _Py_hashfunc_name == 'fnv': + msg = ("FNV hashing is not implemented in Numba. See PEP 456 " + "https://www.python.org/dev/peps/pep-0456/ " + "for rationale over not using FNV. Numba will continue to work, " + "but hashes for built in types will be computed using " + "siphash24. This will permit e.g. dictionaries to continue to " + "behave as expected, however anything relying on the value of " + "the hash opposed to hash as a derived property is likely to " + "not work as expected.") + warnings.warn(msg) + + # This is a translation of CPython's siphash24 function: + # https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Python/pyhash.c#L287-L413 # noqa: E501 + # and also, since Py 3.11, a translation of CPython's siphash13 function: + # https://github.com/python/cpython/blob/9dda9020abcf0d51d59b283a89c58c8e1fb0f574/Python/pyhash.c#L376-L424 + # the only differences are in the use of SINGLE_ROUND in siphash13 vs. + # DOUBLE_ROUND in siphash24, and that siphash13 has an extra "ROUND" applied + # just before the final XORing of components to create the return value. + + # /* ********************************************************************* + # + # Copyright (c) 2013 Marek Majkowski + + # Permission is hereby granted, free of charge, to any person obtaining a + # copy of this software and associated documentation files (the "Software"), + # to deal in the Software without restriction, including without limitation + # the rights to use, copy, modify, merge, publish, distribute, sublicense, + # and/or sell copies of the Software, and to permit persons to whom the + # Software is furnished to do so, subject to the following conditions: + + # The above copyright notice and this permission notice shall be included in + # all copies or substantial portions of the Software. + + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + # DEALINGS IN THE SOFTWARE. + # + + # Original location: + # https://github.com/majek/csiphash/ + + # Solution inspired by code from: + # Samuel Neves (supercop/crypto_auth/siphash24/little) + #djb (supercop/crypto_auth/siphash24/little2) + # Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c) + + # Modified for Python by Christian Heimes: + # - C89 / MSVC compatibility + # - _rotl64() on Windows + # - letoh64() fallback + # */ + + @register_jitable(locals={'x': types.np_uint64, + 'b': types.np_uint64, }) + def _ROTATE(x, b): + return types.np_uint64(((x) << (b)) | + ((x) >> (types.np_uint64(64) - (b)))) + + @register_jitable(locals={'a': types.np_uint64, + 'b': types.np_uint64, + 'c': types.np_uint64, + 'd': types.np_uint64, + 's': types.np_uint64, + 't': types.np_uint64, }) + def _HALF_ROUND(a, b, c, d, s, t): + a += b + c += d + b = _ROTATE(b, s) ^ a + d = _ROTATE(d, t) ^ c + a = _ROTATE(a, 32) + return a, b, c, d + + @register_jitable(locals={'v0': types.np_uint64, + 'v1': types.np_uint64, + 'v2': types.np_uint64, + 'v3': types.np_uint64, }) + def _SINGLE_ROUND(v0, v1, v2, v3): + v0, v1, v2, v3 = _HALF_ROUND(v0, v1, v2, v3, 13, 16) + v2, v1, v0, v3 = _HALF_ROUND(v2, v1, v0, v3, 17, 21) + return v0, v1, v2, v3 + + @register_jitable(locals={'v0': types.np_uint64, + 'v1': types.np_uint64, + 'v2': types.np_uint64, + 'v3': types.np_uint64, }) + def _DOUBLE_ROUND(v0, v1, v2, v3): + v0, v1, v2, v3 = _SINGLE_ROUND(v0, v1, v2, v3) + v0, v1, v2, v3 = _SINGLE_ROUND(v0, v1, v2, v3) + return v0, v1, v2, v3 + + def _gen_siphash(alg): + if alg == 'siphash13': + _ROUNDER = _SINGLE_ROUND + _EXTRA_ROUND = True + elif alg == 'siphash24': + _ROUNDER = _DOUBLE_ROUND + _EXTRA_ROUND = False + else: + assert 0, 'unreachable' + + @register_jitable(locals={'v0': types.np_uint64, + 'v1': types.np_uint64, + 'v2': types.np_uint64, + 'v3': types.np_uint64, + 'b': types.np_uint64, + 'mi': types.np_uint64, + 't': types.np_uint64, + 'mask': types.np_uint64, + 'jmp': types.np_uint64, + 'ohexefef': types.np_uint64}) + def _siphash(k0, k1, src, src_sz): + b = types.np_uint64(src_sz) << 56 + v0 = k0 ^ types.np_uint64(0x736f6d6570736575) + v1 = k1 ^ types.np_uint64(0x646f72616e646f6d) + v2 = k0 ^ types.np_uint64(0x6c7967656e657261) + v3 = k1 ^ types.np_uint64(0x7465646279746573) + + idx = 0 + while (src_sz >= 8): + mi = grab_uint64_t(src, idx) + idx += 1 + src_sz -= 8 + v3 ^= mi + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + v0 ^= mi + + # this is the switch fallthrough: + # https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Python/pyhash.c#L390-L400 # noqa: E501 + t = types.np_uint64(0x0) + boffset = idx * 8 + ohexefef = types.np_uint64(0xff) + if src_sz >= 7: + jmp = (6 * 8) + mask = ~types.np_uint64(ohexefef << jmp) + t = (t & mask) | (types.np_uint64(grab_byte(src, boffset + 6)) + << jmp) + if src_sz >= 6: + jmp = (5 * 8) + mask = ~types.np_uint64(ohexefef << jmp) + t = (t & mask) | (types.np_uint64(grab_byte(src, boffset + 5)) + << jmp) + if src_sz >= 5: + jmp = (4 * 8) + mask = ~types.np_uint64(ohexefef << jmp) + t = (t & mask) | (types.np_uint64(grab_byte(src, boffset + 4)) + << jmp) + if src_sz >= 4: + t &= types.np_uint64(0xffffffff00000000) + for i in range(4): + jmp = i * 8 + mask = ~types.np_uint64(ohexefef << jmp) + t = (t & mask) | \ + (types.np_uint64(grab_byte(src, boffset + i)) << jmp) + if src_sz >= 3: + jmp = (2 * 8) + mask = ~types.np_uint64(ohexefef << jmp) + t = (t & mask) | (types.np_uint64(grab_byte(src, boffset + 2)) + << jmp) + if src_sz >= 2: + jmp = (1 * 8) + mask = ~types.np_uint64(ohexefef << jmp) + t = (t & mask) | (types.np_uint64(grab_byte(src, boffset + 1)) + << jmp) + if src_sz >= 1: + mask = ~(ohexefef) + t = (t & mask) | (types.np_uint64(grab_byte(src, boffset + 0))) + + b |= t + v3 ^= b + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + v0 ^= b + v2 ^= ohexefef + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + if _EXTRA_ROUND: + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + t = (v0 ^ v1) ^ (v2 ^ v3) + return t + + return _siphash + + _siphash13 = _gen_siphash('siphash13') + _siphash24 = _gen_siphash('siphash24') + + _siphasher = _siphash13 if _Py_hashfunc_name == 'siphash13' else _siphash24 + +else: + msg = "Unsupported hashing algorithm in use %s" % _Py_hashfunc_name + raise ValueError(msg) + + +@intrinsic +def _inject_hashsecret_read(tyctx, name): + """Emit code to load the hashsecret. + """ + if not isinstance(name, types.StringLiteral): + raise errors.TypingError("requires literal string") + + sym = _hashsecret[name.literal_value].symbol + resty = types.np_uint64 + sig = resty(name) + + def impl(cgctx, builder, sig, args): + mod = builder.module + try: + # Search for existing global + gv = mod.get_global(sym) + except KeyError: + # Inject the symbol if not already exist. + gv = ir.GlobalVariable(mod, ir.IntType(64), name=sym) + v = builder.load(gv) + return v + + return sig, impl + + +def _load_hashsecret(name): + return _hashsecret[name].value + + +@overload(_load_hashsecret) +def _impl_load_hashsecret(name): + def imp(name): + return _inject_hashsecret_read(name) + return imp + + +# This is a translation of CPythons's _Py_HashBytes: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Python/pyhash.c#L145-L191 # noqa: E501 + + +@register_jitable(locals={'_hash': _Py_uhash_t}) +def _Py_HashBytes(val, _len): + if (_len == 0): + return process_return(0) + + if (_len < _Py_HASH_CUTOFF): + # TODO: this branch needs testing, needs a CPython setup for it! + # /* Optimize hashing of very small strings with inline DJBX33A. */ + _hash = _Py_uhash_t(5381) # /* DJBX33A starts with 5381 */ + for idx in range(_len): + _hash = ((_hash << 5) + _hash) + np.uint8(grab_byte(val, idx)) + + _hash ^= _len + _hash ^= _load_hashsecret('djbx33a_suffix') + else: + tmp = _siphasher(types.np_uint64(_load_hashsecret('siphash_k0')), + types.np_uint64(_load_hashsecret('siphash_k1')), + val, _len) + _hash = process_return(tmp) + return process_return(_hash) + +# This is an approximate translation of CPython's unicode_hash: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Objects/unicodeobject.c#L11635-L11663 # noqa: E501 + + +@overload_method(types.UnicodeType, '__hash__') +def unicode_hash(val): + from numba.cpython.unicode import _kind_to_byte_width + + def impl(val): + kindwidth = _kind_to_byte_width(val._kind) + _len = len(val) + # use the cache if possible + current_hash = val._hash + if current_hash != -1: + return current_hash + else: + # cannot write hash value to cache in the unicode struct due to + # pass by value on the struct making the struct member immutable + return _Py_HashBytes(val._data, kindwidth * _len) + + return impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_mathimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_mathimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..45905e58eaaf0653fff629b28a48934791bf865b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_mathimpl.py @@ -0,0 +1,469 @@ +""" +Provide math calls that uses intrinsics or libc math functions. +""" + +import math +import operator +import sys +import numpy as np + +import llvmlite.ir +from llvmlite.ir import Constant + +from numba.core.imputils import Registry, impl_ret_untracked +from numba import typeof +from numba.core import types, utils, config, cgutils +from numba.core.extending import overload +from numba.core.typing import signature +from numba.cpython.unsafe.numbers import trailing_zeros + + +registry = Registry('mathimpl') +lower = registry.lower + + +# Helpers, shared with cmathimpl. +_NP_FLT_FINFO = np.finfo(np.dtype('float32')) +FLT_MAX = _NP_FLT_FINFO.max +FLT_MIN = _NP_FLT_FINFO.tiny + +_NP_DBL_FINFO = np.finfo(np.dtype('float64')) +DBL_MAX = _NP_DBL_FINFO.max +DBL_MIN = _NP_DBL_FINFO.tiny + +FLOAT_ABS_MASK = 0x7fffffff +FLOAT_SIGN_MASK = 0x80000000 +DOUBLE_ABS_MASK = 0x7fffffffffffffff +DOUBLE_SIGN_MASK = 0x8000000000000000 + + +def is_nan(builder, val): + """ + Return a condition testing whether *val* is a NaN. + """ + return builder.fcmp_unordered('uno', val, val) + +def is_inf(builder, val): + """ + Return a condition testing whether *val* is an infinite. + """ + pos_inf = Constant(val.type, float("+inf")) + neg_inf = Constant(val.type, float("-inf")) + isposinf = builder.fcmp_ordered('==', val, pos_inf) + isneginf = builder.fcmp_ordered('==', val, neg_inf) + return builder.or_(isposinf, isneginf) + +def is_finite(builder, val): + """ + Return a condition testing whether *val* is a finite. + """ + # is_finite(x) <=> x - x != NaN + val_minus_val = builder.fsub(val, val) + return builder.fcmp_ordered('ord', val_minus_val, val_minus_val) + +def f64_as_int64(builder, val): + """ + Bitcast a double into a 64-bit integer. + """ + assert val.type == llvmlite.ir.DoubleType() + return builder.bitcast(val, llvmlite.ir.IntType(64)) + +def int64_as_f64(builder, val): + """ + Bitcast a 64-bit integer into a double. + """ + assert val.type == llvmlite.ir.IntType(64) + return builder.bitcast(val, llvmlite.ir.DoubleType()) + +def f32_as_int32(builder, val): + """ + Bitcast a float into a 32-bit integer. + """ + assert val.type == llvmlite.ir.FloatType() + return builder.bitcast(val, llvmlite.ir.IntType(32)) + +def int32_as_f32(builder, val): + """ + Bitcast a 32-bit integer into a float. + """ + assert val.type == llvmlite.ir.IntType(32) + return builder.bitcast(val, llvmlite.ir.FloatType()) + +def negate_real(builder, val): + """ + Negate real number *val*, with proper handling of zeros. + """ + # The negative zero forces LLVM to handle signed zeros properly. + return builder.fsub(Constant(val.type, -0.0), val) + +def call_fp_intrinsic(builder, name, args): + """ + Call a LLVM intrinsic floating-point operation. + """ + mod = builder.module + intr = mod.declare_intrinsic(name, [a.type for a in args]) + return builder.call(intr, args) + + +def _unary_int_input_wrapper_impl(wrapped_impl): + """ + Return an implementation factory to convert the single integral input + argument to a float64, then defer to the *wrapped_impl*. + """ + def implementer(context, builder, sig, args): + val, = args + input_type = sig.args[0] + fpval = context.cast(builder, val, input_type, types.float64) + inner_sig = signature(types.float64, types.float64) + res = wrapped_impl(context, builder, inner_sig, (fpval,)) + return context.cast(builder, res, types.float64, sig.return_type) + + return implementer + +def unary_math_int_impl(fn, float_impl): + impl = _unary_int_input_wrapper_impl(float_impl) + lower(fn, types.Integer)(impl) + +def unary_math_intr(fn, intrcode): + """ + Implement the math function *fn* using the LLVM intrinsic *intrcode*. + """ + @lower(fn, types.Float) + def float_impl(context, builder, sig, args): + res = call_fp_intrinsic(builder, intrcode, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + unary_math_int_impl(fn, float_impl) + return float_impl + +def unary_math_extern(fn, f32extern, f64extern, int_restype=False): + """ + Register implementations of Python function *fn* using the + external function named *f32extern* and *f64extern* (for float32 + and float64 inputs, respectively). + If *int_restype* is true, then the function's return value should be + integral, otherwise floating-point. + """ + f_restype = types.py_int if int_restype else None + + def float_impl(context, builder, sig, args): + """ + Implement *fn* for a types.Float input. + """ + [val] = args + mod = builder.module + input_type = sig.args[0] + lty = context.get_value_type(input_type) + func_name = { + types.float32: f32extern, + types.float64: f64extern, + }[input_type] + fnty = llvmlite.ir.FunctionType(lty, [lty]) + fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name) + res = builder.call(fn, (val,)) + res = context.cast(builder, res, input_type, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + lower(fn, types.Float)(float_impl) + + # Implement wrapper for integer inputs + unary_math_int_impl(fn, float_impl) + + return float_impl + + +unary_math_intr(math.fabs, 'llvm.fabs') +exp_impl = unary_math_intr(math.exp, 'llvm.exp') +log_impl = unary_math_intr(math.log, 'llvm.log') +log10_impl = unary_math_intr(math.log10, 'llvm.log10') +log2_impl = unary_math_intr(math.log2, 'llvm.log2') +sin_impl = unary_math_intr(math.sin, 'llvm.sin') +cos_impl = unary_math_intr(math.cos, 'llvm.cos') + +log1p_impl = unary_math_extern(math.log1p, "log1pf", "log1p") +expm1_impl = unary_math_extern(math.expm1, "expm1f", "expm1") +erf_impl = unary_math_extern(math.erf, "erff", "erf") +erfc_impl = unary_math_extern(math.erfc, "erfcf", "erfc") + +tan_impl = unary_math_extern(math.tan, "tanf", "tan") +asin_impl = unary_math_extern(math.asin, "asinf", "asin") +acos_impl = unary_math_extern(math.acos, "acosf", "acos") +atan_impl = unary_math_extern(math.atan, "atanf", "atan") + +asinh_impl = unary_math_extern(math.asinh, "asinhf", "asinh") +acosh_impl = unary_math_extern(math.acosh, "acoshf", "acosh") +atanh_impl = unary_math_extern(math.atanh, "atanhf", "atanh") +sinh_impl = unary_math_extern(math.sinh, "sinhf", "sinh") +cosh_impl = unary_math_extern(math.cosh, "coshf", "cosh") +tanh_impl = unary_math_extern(math.tanh, "tanhf", "tanh") + +log2_impl = unary_math_extern(math.log2, "log2f", "log2") +ceil_impl = unary_math_extern(math.ceil, "ceilf", "ceil", True) +floor_impl = unary_math_extern(math.floor, "floorf", "floor", True) + +gamma_impl = unary_math_extern(math.gamma, "numba_gammaf", "numba_gamma") # work-around +sqrt_impl = unary_math_extern(math.sqrt, "sqrtf", "sqrt") +trunc_impl = unary_math_extern(math.trunc, "truncf", "trunc", True) +lgamma_impl = unary_math_extern(math.lgamma, "lgammaf", "lgamma") + + +@lower(math.isnan, types.Float) +def isnan_float_impl(context, builder, sig, args): + [val] = args + res = is_nan(builder, val) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower(math.isnan, types.Integer) +def isnan_int_impl(context, builder, sig, args): + res = cgutils.false_bit + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.isinf, types.Float) +def isinf_float_impl(context, builder, sig, args): + [val] = args + res = is_inf(builder, val) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower(math.isinf, types.Integer) +def isinf_int_impl(context, builder, sig, args): + res = cgutils.false_bit + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.isfinite, types.Float) +def isfinite_float_impl(context, builder, sig, args): + [val] = args + res = is_finite(builder, val) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.isfinite, types.Integer) +def isfinite_int_impl(context, builder, sig, args): + res = cgutils.true_bit + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.copysign, types.Float, types.Float) +def copysign_float_impl(context, builder, sig, args): + lty = args[0].type + mod = builder.module + fn = cgutils.get_or_insert_function(mod, llvmlite.ir.FunctionType(lty, (lty, lty)), + 'llvm.copysign.%s' % lty.intrinsic_name) + res = builder.call(fn, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# ----------------------------------------------------------------------------- + + +@lower(math.frexp, types.Float) +def frexp_impl(context, builder, sig, args): + val, = args + fltty = context.get_data_type(sig.args[0]) + intty = context.get_data_type(sig.return_type[1]) + expptr = cgutils.alloca_once(builder, intty, name='exp') + fnty = llvmlite.ir.FunctionType(fltty, (fltty, llvmlite.ir.PointerType(intty))) + fname = { + "float": "numba_frexpf", + "double": "numba_frexp", + }[str(fltty)] + fn = cgutils.get_or_insert_function(builder.module, fnty, fname) + res = builder.call(fn, (val, expptr)) + res = cgutils.make_anonymous_struct(builder, (res, builder.load(expptr))) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.ldexp, types.Float, types.np_intc) +def ldexp_impl(context, builder, sig, args): + val, exp = args + fltty, intty = map(context.get_data_type, sig.args) + fnty = llvmlite.ir.FunctionType(fltty, (fltty, intty)) + fname = { + "float": "numba_ldexpf", + "double": "numba_ldexp", + }[str(fltty)] + fn = cgutils.insert_pure_function(builder.module, fnty, name=fname) + res = builder.call(fn, (val, exp)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# ----------------------------------------------------------------------------- + + +@lower(math.atan2, types.np_int64, types.np_int64) +def atan2_s64_impl(context, builder, sig, args): + [y, x] = args + y = builder.sitofp(y, llvmlite.ir.DoubleType()) + x = builder.sitofp(x, llvmlite.ir.DoubleType()) + fsig = signature(types.float64, types.float64, types.float64) + return atan2_float_impl(context, builder, fsig, (y, x)) + +@lower(math.atan2, types.np_uint64, types.np_uint64) +def atan2_u64_impl(context, builder, sig, args): + [y, x] = args + y = builder.uitofp(y, llvmlite.ir.DoubleType()) + x = builder.uitofp(x, llvmlite.ir.DoubleType()) + fsig = signature(types.float64, types.float64, types.float64) + return atan2_float_impl(context, builder, fsig, (y, x)) + +@lower(math.atan2, types.Float, types.Float) +def atan2_float_impl(context, builder, sig, args): + assert len(args) == 2 + mod = builder.module + ty = sig.args[0] + lty = context.get_value_type(ty) + func_name = { + types.float32: "atan2f", + types.float64: "atan2" + }[ty] + fnty = llvmlite.ir.FunctionType(lty, (lty, lty)) + fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name) + res = builder.call(fn, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# ----------------------------------------------------------------------------- + + +@lower(math.hypot, types.np_int64, types.np_int64) +def hypot_s64_impl(context, builder, sig, args): + [x, y] = args + y = builder.sitofp(y, llvmlite.ir.DoubleType()) + x = builder.sitofp(x, llvmlite.ir.DoubleType()) + fsig = signature(types.float64, types.float64, types.float64) + res = hypot_float_impl(context, builder, fsig, (x, y)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.hypot, types.np_uint64, types.np_uint64) +def hypot_u64_impl(context, builder, sig, args): + [x, y] = args + y = builder.sitofp(y, llvmlite.ir.DoubleType()) + x = builder.sitofp(x, llvmlite.ir.DoubleType()) + fsig = signature(types.float64, types.float64, types.float64) + res = hypot_float_impl(context, builder, fsig, (x, y)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.hypot, types.Float, types.Float) +def hypot_float_impl(context, builder, sig, args): + xty, yty = sig.args + assert xty == yty == sig.return_type + x, y = args + + # Windows has alternate names for hypot/hypotf, see + # https://msdn.microsoft.com/fr-fr/library/a9yb3dbt%28v=vs.80%29.aspx + fname = { + types.float32: "_hypotf" if sys.platform == 'win32' else "hypotf", + types.float64: "_hypot" if sys.platform == 'win32' else "hypot", + }[xty] + plat_hypot = types.ExternalFunction(fname, sig) + + if sys.platform == 'win32' and config.MACHINE_BITS == 32: + inf = xty(float('inf')) + + def hypot_impl(x, y): + if math.isinf(x) or math.isinf(y): + return inf + return plat_hypot(x, y) + else: + def hypot_impl(x, y): + return plat_hypot(x, y) + + res = context.compile_internal(builder, hypot_impl, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# ----------------------------------------------------------------------------- + +@lower(math.radians, types.Float) +def radians_float_impl(context, builder, sig, args): + [x] = args + coef = context.get_constant(sig.return_type, math.pi / 180) + res = builder.fmul(x, coef) + return impl_ret_untracked(context, builder, sig.return_type, res) + +unary_math_int_impl(math.radians, radians_float_impl) + +# ----------------------------------------------------------------------------- + +@lower(math.degrees, types.Float) +def degrees_float_impl(context, builder, sig, args): + [x] = args + coef = context.get_constant(sig.return_type, 180 / math.pi) + res = builder.fmul(x, coef) + return impl_ret_untracked(context, builder, sig.return_type, res) + +unary_math_int_impl(math.degrees, degrees_float_impl) + +# ----------------------------------------------------------------------------- + +@lower(math.pow, types.Float, types.Float) +@lower(math.pow, types.Float, types.Integer) +def pow_impl(context, builder, sig, args): + impl = context.get_function(operator.pow, sig) + return impl(builder, args) + +# ----------------------------------------------------------------------------- + +@lower(math.nextafter, types.Float, types.Float) +def nextafter_impl(context, builder, sig, args): + assert len(args) == 2 + ty = sig.args[0] + lty = context.get_value_type(ty) + func_name = { + types.float32: "nextafterf", + types.float64: "nextafter" + }[ty] + fnty = llvmlite.ir.FunctionType(lty, (lty, lty)) + fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name) + res = builder.call(fn, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +# ----------------------------------------------------------------------------- + +def _unsigned(T): + """Convert integer to unsigned integer of equivalent width.""" + pass + +@overload(_unsigned) +def _unsigned_impl(T): + if T in types.unsigned_domain: + return lambda T: T + elif T in types.signed_domain: + newT = getattr(types, 'uint{}'.format(T.bitwidth)) + return lambda T: newT(T) + + +def gcd_impl(context, builder, sig, args): + xty, yty = sig.args + assert xty == yty == sig.return_type + x, y = args + + def gcd(a, b): + """ + Stein's algorithm, heavily cribbed from Julia implementation. + """ + T = type(a) + if a == 0: return abs(b) + if b == 0: return abs(a) + za = trailing_zeros(a) + zb = trailing_zeros(b) + k = min(za, zb) + # Uses np.*_shift instead of operators due to return types + u = _unsigned(abs(np.right_shift(a, za))) + v = _unsigned(abs(np.right_shift(b, zb))) + while u != v: + if u > v: + u, v = v, u + v -= u + v = np.right_shift(v, trailing_zeros(v)) + r = np.left_shift(T(u), k) + return r + + res = context.compile_internal(builder, gcd, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +lower(math.gcd, types.Integer, types.Integer)(gcd_impl) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_numbers.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_numbers.py new file mode 100644 index 0000000000000000000000000000000000000000..5b335e30dc892a874cb97d6478539c8dd2585a86 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_numbers.py @@ -0,0 +1,1397 @@ +import math +import numbers +import itertools + +import numpy as np +import operator + +from llvmlite import ir +from llvmlite.ir import Constant + +from numba.core.imputils import (lower_builtin, lower_getattr, + lower_cast, lower_constant, + impl_ret_untracked) +from numba.core import typing, types, errors, cgutils +from numba.core.extending import overload_method +from numba.cpython.unsafe.numbers import viewer + +def _int_arith_flags(rettype): + """ + Return the modifier flags for integer arithmetic. + """ + if rettype.signed: + # Ignore the effects of signed overflow. This is important for + # optimization of some indexing operations. For example + # array[i+1] could see `i+1` trigger a signed overflow and + # give a negative number. With Python's indexing, a negative + # index is treated differently: its resolution has a runtime cost. + # Telling LLVM to ignore signed overflows allows it to optimize + # away the check for a negative `i+1` if it knows `i` is positive. + return ['nsw'] + else: + return [] + + +def int_add_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + a = context.cast(builder, va, ta, sig.return_type) + b = context.cast(builder, vb, tb, sig.return_type) + res = builder.add(a, b, flags=_int_arith_flags(sig.return_type)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sub_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + a = context.cast(builder, va, ta, sig.return_type) + b = context.cast(builder, vb, tb, sig.return_type) + res = builder.sub(a, b, flags=_int_arith_flags(sig.return_type)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_mul_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + a = context.cast(builder, va, ta, sig.return_type) + b = context.cast(builder, vb, tb, sig.return_type) + res = builder.mul(a, b, flags=_int_arith_flags(sig.return_type)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_divmod_signed(context, builder, ty, x, y): + """ + Reference Objects/intobject.c + xdivy = x / y; + xmody = (long)(x - (unsigned long)xdivy * y); + /* If the signs of x and y differ, and the remainder is non-0, + * C89 doesn't define whether xdivy is now the floor or the + * ceiling of the infinitely precise quotient. We want the floor, + * and we have it iff the remainder's sign matches y's. + */ + if (xmody && ((y ^ xmody) < 0) /* i.e. and signs differ */) { + xmody += y; + --xdivy; + assert(xmody && ((y ^ xmody) >= 0)); + } + *p_xdivy = xdivy; + *p_xmody = xmody; + """ + assert x.type == y.type + + ZERO = y.type(0) + ONE = y.type(1) + + # NOTE: On x86 at least, dividing the lowest representable integer + # (e.g. 0x80000000 for int32) by -1 causes a SIFGPE (division overflow), + # causing the process to crash. + # We return 0, 0 instead (more or less like Numpy). + + resdiv = cgutils.alloca_once_value(builder, ZERO) + resmod = cgutils.alloca_once_value(builder, ZERO) + + is_overflow = builder.and_( + builder.icmp_signed('==', x, x.type(ty.minval)), + builder.icmp_signed('==', y, y.type(-1))) + + with builder.if_then(builder.not_(is_overflow), likely=True): + # Note LLVM will optimize this to a single divmod instruction, + # if available on the target CPU (e.g. x86). + xdivy = builder.sdiv(x, y) + xmody = builder.srem(x, y) + + y_xor_xmody_ltz = builder.icmp_signed('<', builder.xor(y, xmody), ZERO) + xmody_istrue = builder.icmp_signed('!=', xmody, ZERO) + cond = builder.and_(xmody_istrue, y_xor_xmody_ltz) + + with builder.if_else(cond) as (if_different_signs, if_same_signs): + with if_same_signs: + builder.store(xdivy, resdiv) + builder.store(xmody, resmod) + + with if_different_signs: + builder.store(builder.sub(xdivy, ONE), resdiv) + builder.store(builder.add(xmody, y), resmod) + + return builder.load(resdiv), builder.load(resmod) + + +def int_divmod(context, builder, ty, x, y): + """ + Integer divmod(x, y). The caller must ensure that y != 0. + """ + if ty.signed: + return int_divmod_signed(context, builder, ty, x, y) + else: + return builder.udiv(x, y), builder.urem(x, y) + + +def _int_divmod_impl(context, builder, sig, args, zerodiv_message): + va, vb = args + ta, tb = sig.args + + ty = sig.return_type + if isinstance(ty, types.UniTuple): + ty = ty.dtype + a = context.cast(builder, va, ta, ty) + b = context.cast(builder, vb, tb, ty) + quot = cgutils.alloca_once(builder, a.type, name="quot") + rem = cgutils.alloca_once(builder, a.type, name="rem") + + with builder.if_else(cgutils.is_scalar_zero(builder, b), likely=False + ) as (if_zero, if_non_zero): + with if_zero: + if not context.error_model.fp_zero_division( + builder, (zerodiv_message,)): + # No exception raised => return 0 + # XXX We should also set the FPU exception status, but + # there's no easy way to do that from LLVM. + builder.store(b, quot) + builder.store(b, rem) + with if_non_zero: + q, r = int_divmod(context, builder, ty, a, b) + builder.store(q, quot) + builder.store(r, rem) + + return quot, rem + + +@lower_builtin(divmod, types.Integer, types.Integer) +def int_divmod_impl(context, builder, sig, args): + quot, rem = _int_divmod_impl(context, builder, sig, args, + "integer divmod by zero") + + return cgutils.pack_array(builder, + (builder.load(quot), builder.load(rem))) + + +@lower_builtin(operator.floordiv, types.Integer, types.Integer) +@lower_builtin(operator.ifloordiv, types.Integer, types.Integer) +def int_floordiv_impl(context, builder, sig, args): + quot, rem = _int_divmod_impl(context, builder, sig, args, + "integer division by zero") + return builder.load(quot) + + +@lower_builtin(operator.truediv, types.Integer, types.Integer) +@lower_builtin(operator.itruediv, types.Integer, types.Integer) +def int_truediv_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + a = context.cast(builder, va, ta, sig.return_type) + b = context.cast(builder, vb, tb, sig.return_type) + with cgutils.if_zero(builder, b): + context.error_model.fp_zero_division(builder, ("division by zero",)) + res = builder.fdiv(a, b) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.mod, types.Integer, types.Integer) +@lower_builtin(operator.imod, types.Integer, types.Integer) +def int_rem_impl(context, builder, sig, args): + quot, rem = _int_divmod_impl(context, builder, sig, args, + "integer modulo by zero") + return builder.load(rem) + + +def _get_power_zerodiv_return(context, return_type): + if (isinstance(return_type, types.Integer) + and not context.error_model.raise_on_fp_zero_division): + # If not raising, return 0x8000... when computing 0 ** + return -1 << (return_type.bitwidth - 1) + else: + return False + + +def int_power_impl(context, builder, sig, args): + """ + a ^ b, where a is an integer or real, and b an integer + """ + is_integer = isinstance(sig.args[0], types.Integer) + tp = sig.return_type + zerodiv_return = _get_power_zerodiv_return(context, tp) + + def int_power(a, b): + # Ensure computations are done with a large enough width + r = tp(1) + a = tp(a) + if b < 0: + invert = True + exp = -b + if exp < 0: + raise OverflowError + if is_integer: + if a == 0: + if zerodiv_return: + return zerodiv_return + else: + raise ZeroDivisionError("0 cannot be raised to a negative power") + if a != 1 and a != -1: + return 0 + else: + invert = False + exp = b + if exp > 0x10000: + # Optimization cutoff: fallback on the generic algorithm + return math.pow(a, float(b)) + while exp != 0: + if exp & 1: + r *= a + exp >>= 1 + a *= a + + return 1.0 / r if invert else r + + res = context.compile_internal(builder, int_power, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.pow, types.Integer, types.IntegerLiteral) +@lower_builtin(operator.ipow, types.Integer, types.IntegerLiteral) +@lower_builtin(operator.pow, types.Float, types.IntegerLiteral) +@lower_builtin(operator.ipow, types.Float, types.IntegerLiteral) +def static_power_impl(context, builder, sig, args): + """ + a ^ b, where a is an integer or real, and b a constant integer + """ + exp = sig.args[1].value + if not isinstance(exp, numbers.Integral): + raise NotImplementedError + if abs(exp) > 0x10000: + # Optimization cutoff: fallback on the generic algorithm above + raise NotImplementedError + invert = exp < 0 + exp = abs(exp) + + tp = sig.return_type + is_integer = isinstance(tp, types.Integer) + zerodiv_return = _get_power_zerodiv_return(context, tp) + + val = context.cast(builder, args[0], sig.args[0], tp) + lty = val.type + + def mul(a, b): + if is_integer: + return builder.mul(a, b) + else: + return builder.fmul(a, b) + + # Unroll the exponentiation loop + res = lty(1) + a = val + while exp != 0: + if exp & 1: + res = mul(res, val) + exp >>= 1 + val = mul(val, val) + + if invert: + # If the exponent was negative, fix the result by inverting it + if is_integer: + # Integer inversion + def invert_impl(a): + if a == 0: + if zerodiv_return: + return zerodiv_return + else: + raise ZeroDivisionError("0 cannot be raised to a negative power") + if a != 1 and a != -1: + return 0 + else: + return a + + else: + # Real inversion + def invert_impl(a): + return 1.0 / a + + res = context.compile_internal(builder, invert_impl, + typing.signature(tp, tp), (res,)) + + return res + + +def int_slt_impl(context, builder, sig, args): + res = builder.icmp_signed('<', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sle_impl(context, builder, sig, args): + res = builder.icmp_signed('<=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sgt_impl(context, builder, sig, args): + res = builder.icmp_signed('>', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sge_impl(context, builder, sig, args): + res = builder.icmp_signed('>=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_ult_impl(context, builder, sig, args): + res = builder.icmp_unsigned('<', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_ule_impl(context, builder, sig, args): + res = builder.icmp_unsigned('<=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_ugt_impl(context, builder, sig, args): + res = builder.icmp_unsigned('>', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_uge_impl(context, builder, sig, args): + res = builder.icmp_unsigned('>=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_eq_impl(context, builder, sig, args): + res = builder.icmp_unsigned('==', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_ne_impl(context, builder, sig, args): + res = builder.icmp_unsigned('!=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_signed_unsigned_cmp(op): + def impl(context, builder, sig, args): + (left, right) = args + # This code is translated from the NumPy source. + # What we're going to do is divide the range of a signed value at zero. + # If the signed value is less than zero, then we can treat zero as the + # unsigned value since the unsigned value is necessarily zero or larger + # and any signed comparison between a negative value and zero/infinity + # will yield the same result. If the signed value is greater than or + # equal to zero, then we can safely cast it to an unsigned value and do + # the expected unsigned-unsigned comparison operation. + # Original: https://github.com/numpy/numpy/pull/23713 + cmp_zero = builder.icmp_signed('<', left, Constant(left.type, 0)) + lt_zero = builder.icmp_signed(op, left, Constant(left.type, 0)) + ge_zero = builder.icmp_unsigned(op, left, right) + res = builder.select(cmp_zero, lt_zero, ge_zero) + return impl_ret_untracked(context, builder, sig.return_type, res) + return impl + + +def int_unsigned_signed_cmp(op): + def impl(context, builder, sig, args): + (left, right) = args + # See the function `int_signed_unsigned_cmp` for implementation notes. + cmp_zero = builder.icmp_signed('<', right, Constant(right.type, 0)) + lt_zero = builder.icmp_signed(op, Constant(right.type, 0), right) + ge_zero = builder.icmp_unsigned(op, left, right) + res = builder.select(cmp_zero, lt_zero, ge_zero) + return impl_ret_untracked(context, builder, sig.return_type, res) + return impl + + +def int_abs_impl(context, builder, sig, args): + [x] = args + ZERO = Constant(x.type, None) + ltz = builder.icmp_signed('<', x, ZERO) + negated = builder.neg(x) + res = builder.select(ltz, negated, x) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def uint_abs_impl(context, builder, sig, args): + [x] = args + return impl_ret_untracked(context, builder, sig.return_type, x) + + +def int_shl_impl(context, builder, sig, args): + [valty, amtty] = sig.args + [val, amt] = args + val = context.cast(builder, val, valty, sig.return_type) + amt = context.cast(builder, amt, amtty, sig.return_type) + res = builder.shl(val, amt) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_shr_impl(context, builder, sig, args): + [valty, amtty] = sig.args + [val, amt] = args + val = context.cast(builder, val, valty, sig.return_type) + amt = context.cast(builder, amt, amtty, sig.return_type) + if sig.return_type.signed: + res = builder.ashr(val, amt) + else: + res = builder.lshr(val, amt) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_and_impl(context, builder, sig, args): + [at, bt] = sig.args + [av, bv] = args + cav = context.cast(builder, av, at, sig.return_type) + cbc = context.cast(builder, bv, bt, sig.return_type) + res = builder.and_(cav, cbc) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_or_impl(context, builder, sig, args): + [at, bt] = sig.args + [av, bv] = args + cav = context.cast(builder, av, at, sig.return_type) + cbc = context.cast(builder, bv, bt, sig.return_type) + res = builder.or_(cav, cbc) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_xor_impl(context, builder, sig, args): + [at, bt] = sig.args + [av, bv] = args + cav = context.cast(builder, av, at, sig.return_type) + cbc = context.cast(builder, bv, bt, sig.return_type) + res = builder.xor(cav, cbc) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_negate_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + # Negate before upcasting, for unsigned numbers + res = builder.neg(val) + res = context.cast(builder, res, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_positive_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + res = context.cast(builder, val, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_invert_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + # Invert before upcasting, for unsigned numbers + res = builder.xor(val, Constant(val.type, int('1' * val.type.width, 2))) + res = context.cast(builder, res, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sign_impl(context, builder, sig, args): + """ + np.sign(int) + """ + [x] = args + POS = Constant(x.type, 1) + NEG = Constant(x.type, -1) + ZERO = Constant(x.type, 0) + + cmp_zero = builder.icmp_unsigned('==', x, ZERO) + cmp_pos = builder.icmp_signed('>', x, ZERO) + + presult = cgutils.alloca_once(builder, x.type) + + bb_zero = builder.append_basic_block(".zero") + bb_postest = builder.append_basic_block(".postest") + bb_pos = builder.append_basic_block(".pos") + bb_neg = builder.append_basic_block(".neg") + bb_exit = builder.append_basic_block(".exit") + + builder.cbranch(cmp_zero, bb_zero, bb_postest) + + with builder.goto_block(bb_zero): + builder.store(ZERO, presult) + builder.branch(bb_exit) + + with builder.goto_block(bb_postest): + builder.cbranch(cmp_pos, bb_pos, bb_neg) + + with builder.goto_block(bb_pos): + builder.store(POS, presult) + builder.branch(bb_exit) + + with builder.goto_block(bb_neg): + builder.store(NEG, presult) + builder.branch(bb_exit) + + builder.position_at_end(bb_exit) + res = builder.load(presult) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def bool_negate_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + res = context.cast(builder, val, typ, sig.return_type) + res = builder.neg(res) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def bool_unary_positive_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + res = context.cast(builder, val, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +lower_builtin(operator.eq, types.py_bool, types.py_bool)(int_eq_impl) +lower_builtin(operator.ne, types.py_bool, types.py_bool)(int_ne_impl) +lower_builtin(operator.lt, types.py_bool, types.py_bool)(int_ult_impl) +lower_builtin(operator.le, types.py_bool, types.py_bool)(int_ule_impl) +lower_builtin(operator.gt, types.py_bool, types.py_bool)(int_ugt_impl) +lower_builtin(operator.ge, types.py_bool, types.py_bool)(int_uge_impl) +lower_builtin(operator.neg, types.py_bool)(bool_negate_impl) +lower_builtin(operator.pos, types.py_bool)(bool_unary_positive_impl) + + +def _implement_integer_operators(): + ty = types.Integer + + lower_builtin(operator.add, ty, ty)(int_add_impl) + lower_builtin(operator.iadd, ty, ty)(int_add_impl) + lower_builtin(operator.sub, ty, ty)(int_sub_impl) + lower_builtin(operator.isub, ty, ty)(int_sub_impl) + lower_builtin(operator.mul, ty, ty)(int_mul_impl) + lower_builtin(operator.imul, ty, ty)(int_mul_impl) + lower_builtin(operator.eq, ty, ty)(int_eq_impl) + lower_builtin(operator.ne, ty, ty)(int_ne_impl) + + lower_builtin(operator.lshift, ty, ty)(int_shl_impl) + lower_builtin(operator.ilshift, ty, ty)(int_shl_impl) + lower_builtin(operator.rshift, ty, ty)(int_shr_impl) + lower_builtin(operator.irshift, ty, ty)(int_shr_impl) + + lower_builtin(operator.neg, ty)(int_negate_impl) + lower_builtin(operator.pos, ty)(int_positive_impl) + + lower_builtin(operator.pow, ty, ty)(int_power_impl) + lower_builtin(operator.ipow, ty, ty)(int_power_impl) + lower_builtin(pow, ty, ty)(int_power_impl) + + for ty in types.np_unsigned_domain: + lower_builtin(operator.lt, ty, ty)(int_ult_impl) + lower_builtin(operator.le, ty, ty)(int_ule_impl) + lower_builtin(operator.gt, ty, ty)(int_ugt_impl) + lower_builtin(operator.ge, ty, ty)(int_uge_impl) + lower_builtin(operator.pow, types.Float, ty)(int_power_impl) + lower_builtin(operator.ipow, types.Float, ty)(int_power_impl) + lower_builtin(pow, types.Float, ty)(int_power_impl) + lower_builtin(abs, ty)(uint_abs_impl) + + lower_builtin(operator.lt, types.IntegerLiteral, types.IntegerLiteral)(int_slt_impl) + lower_builtin(operator.gt, types.IntegerLiteral, types.IntegerLiteral)(int_slt_impl) + lower_builtin(operator.le, types.IntegerLiteral, types.IntegerLiteral)(int_slt_impl) + lower_builtin(operator.ge, types.IntegerLiteral, types.IntegerLiteral)(int_slt_impl) + for ty in itertools.chain(types.py_signed_domain, + types.np_signed_domain): + lower_builtin(operator.lt, ty, ty)(int_slt_impl) + lower_builtin(operator.le, ty, ty)(int_sle_impl) + lower_builtin(operator.gt, ty, ty)(int_sgt_impl) + lower_builtin(operator.ge, ty, ty)(int_sge_impl) + lower_builtin(operator.pow, types.Float, ty)(int_power_impl) + lower_builtin(operator.ipow, types.Float, ty)(int_power_impl) + lower_builtin(pow, types.Float, ty)(int_power_impl) + lower_builtin(abs, ty)(int_abs_impl) + +def _implement_bitwise_operators(): + for ty in (types.Boolean, types.Integer): + lower_builtin(operator.and_, ty, ty)(int_and_impl) + lower_builtin(operator.iand, ty, ty)(int_and_impl) + lower_builtin(operator.or_, ty, ty)(int_or_impl) + lower_builtin(operator.ior, ty, ty)(int_or_impl) + lower_builtin(operator.xor, ty, ty)(int_xor_impl) + lower_builtin(operator.ixor, ty, ty)(int_xor_impl) + + lower_builtin(operator.invert, ty)(int_invert_impl) + +_implement_integer_operators() + +_implement_bitwise_operators() + + +def real_add_impl(context, builder, sig, args): + res = builder.fadd(*args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_sub_impl(context, builder, sig, args): + res = builder.fsub(*args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_mul_impl(context, builder, sig, args): + res = builder.fmul(*args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_div_impl(context, builder, sig, args): + with cgutils.if_zero(builder, args[1]): + context.error_model.fp_zero_division(builder, ("division by zero",)) + res = builder.fdiv(*args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_divmod(context, builder, x, y): + assert x.type == y.type + floatty = x.type + + module = builder.module + fname = context.mangler(".numba.python.rem", [x.type]) + fnty = ir.FunctionType(floatty, (floatty, floatty, ir.PointerType(floatty))) + fn = cgutils.get_or_insert_function(module, fnty, fname) + + if fn.is_declaration: + fn.linkage = 'linkonce_odr' + fnbuilder = ir.IRBuilder(fn.append_basic_block('entry')) + fx, fy, pmod = fn.args + div, mod = real_divmod_func_body(context, fnbuilder, fx, fy) + fnbuilder.store(mod, pmod) + fnbuilder.ret(div) + + pmod = cgutils.alloca_once(builder, floatty) + quotient = builder.call(fn, (x, y, pmod)) + return quotient, builder.load(pmod) + + +def real_divmod_func_body(context, builder, vx, wx): + # Reference Objects/floatobject.c + # + # float_divmod(PyObject *v, PyObject *w) + # { + # double vx, wx; + # double div, mod, floordiv; + # CONVERT_TO_DOUBLE(v, vx); + # CONVERT_TO_DOUBLE(w, wx); + # mod = fmod(vx, wx); + # /* fmod is typically exact, so vx-mod is *mathematically* an + # exact multiple of wx. But this is fp arithmetic, and fp + # vx - mod is an approximation; the result is that div may + # not be an exact integral value after the division, although + # it will always be very close to one. + # */ + # div = (vx - mod) / wx; + # if (mod) { + # /* ensure the remainder has the same sign as the denominator */ + # if ((wx < 0) != (mod < 0)) { + # mod += wx; + # div -= 1.0; + # } + # } + # else { + # /* the remainder is zero, and in the presence of signed zeroes + # fmod returns different results across platforms; ensure + # it has the same sign as the denominator; we'd like to do + # "mod = wx * 0.0", but that may get optimized away */ + # mod *= mod; /* hide "mod = +0" from optimizer */ + # if (wx < 0.0) + # mod = -mod; + # } + # /* snap quotient to nearest integral value */ + # if (div) { + # floordiv = floor(div); + # if (div - floordiv > 0.5) + # floordiv += 1.0; + # } + # else { + # /* div is zero - get the same sign as the true quotient */ + # div *= div; /* hide "div = +0" from optimizers */ + # floordiv = div * vx / wx; /* zero w/ sign of vx/wx */ + # } + # return Py_BuildValue("(dd)", floordiv, mod); + # } + pmod = cgutils.alloca_once(builder, vx.type) + pdiv = cgutils.alloca_once(builder, vx.type) + pfloordiv = cgutils.alloca_once(builder, vx.type) + + mod = builder.frem(vx, wx) + div = builder.fdiv(builder.fsub(vx, mod), wx) + + builder.store(mod, pmod) + builder.store(div, pdiv) + + # Note the use of negative zero for proper negating with `ZERO - x` + ZERO = vx.type(0.0) + NZERO = vx.type(-0.0) + ONE = vx.type(1.0) + mod_istrue = builder.fcmp_unordered('!=', mod, ZERO) + wx_ltz = builder.fcmp_ordered('<', wx, ZERO) + mod_ltz = builder.fcmp_ordered('<', mod, ZERO) + + with builder.if_else(mod_istrue, likely=True) as (if_nonzero_mod, if_zero_mod): + with if_nonzero_mod: + # `mod` is non-zero or NaN + # Ensure the remainder has the same sign as the denominator + wx_ltz_ne_mod_ltz = builder.icmp_unsigned('!=', wx_ltz, mod_ltz) + + with builder.if_then(wx_ltz_ne_mod_ltz): + builder.store(builder.fsub(div, ONE), pdiv) + builder.store(builder.fadd(mod, wx), pmod) + + with if_zero_mod: + # `mod` is zero, select the proper sign depending on + # the denominator's sign + mod = builder.select(wx_ltz, NZERO, ZERO) + builder.store(mod, pmod) + + del mod, div + + div = builder.load(pdiv) + div_istrue = builder.fcmp_ordered('!=', div, ZERO) + + with builder.if_then(div_istrue): + realtypemap = {'float': types.float32, + 'double': types.float64} + realtype = realtypemap[str(wx.type)] + floorfn = context.get_function(math.floor, + typing.signature(realtype, realtype)) + floordiv = floorfn(builder, [div]) + floordivdiff = builder.fsub(div, floordiv) + floordivincr = builder.fadd(floordiv, ONE) + HALF = Constant(wx.type, 0.5) + pred = builder.fcmp_ordered('>', floordivdiff, HALF) + floordiv = builder.select(pred, floordivincr, floordiv) + builder.store(floordiv, pfloordiv) + + with cgutils.ifnot(builder, div_istrue): + div = builder.fmul(div, div) + builder.store(div, pdiv) + floordiv = builder.fdiv(builder.fmul(div, vx), wx) + builder.store(floordiv, pfloordiv) + + return builder.load(pfloordiv), builder.load(pmod) + + +@lower_builtin(divmod, types.Float, types.Float) +def real_divmod_impl(context, builder, sig, args, loc=None): + x, y = args + quot = cgutils.alloca_once(builder, x.type, name="quot") + rem = cgutils.alloca_once(builder, x.type, name="rem") + + with builder.if_else(cgutils.is_scalar_zero(builder, y), likely=False + ) as (if_zero, if_non_zero): + with if_zero: + if not context.error_model.fp_zero_division( + builder, ("modulo by zero",), loc): + # No exception raised => compute the nan result, + # and set the FP exception word for Numpy warnings. + q = builder.fdiv(x, y) + r = builder.frem(x, y) + builder.store(q, quot) + builder.store(r, rem) + with if_non_zero: + q, r = real_divmod(context, builder, x, y) + builder.store(q, quot) + builder.store(r, rem) + + return cgutils.pack_array(builder, + (builder.load(quot), builder.load(rem))) + + +def real_mod_impl(context, builder, sig, args, loc=None): + x, y = args + res = cgutils.alloca_once(builder, x.type) + with builder.if_else(cgutils.is_scalar_zero(builder, y), likely=False + ) as (if_zero, if_non_zero): + with if_zero: + if not context.error_model.fp_zero_division( + builder, ("modulo by zero",), loc): + # No exception raised => compute the nan result, + # and set the FP exception word for Numpy warnings. + rem = builder.frem(x, y) + builder.store(rem, res) + with if_non_zero: + _, rem = real_divmod(context, builder, x, y) + builder.store(rem, res) + return impl_ret_untracked(context, builder, sig.return_type, + builder.load(res)) + + +def real_floordiv_impl(context, builder, sig, args, loc=None): + x, y = args + res = cgutils.alloca_once(builder, x.type) + with builder.if_else(cgutils.is_scalar_zero(builder, y), likely=False + ) as (if_zero, if_non_zero): + with if_zero: + if not context.error_model.fp_zero_division( + builder, ("division by zero",), loc): + # No exception raised => compute the +/-inf or nan result, + # and set the FP exception word for Numpy warnings. + quot = builder.fdiv(x, y) + builder.store(quot, res) + with if_non_zero: + quot, _ = real_divmod(context, builder, x, y) + builder.store(quot, res) + return impl_ret_untracked(context, builder, sig.return_type, + builder.load(res)) + + +def real_power_impl(context, builder, sig, args): + x, y = args + module = builder.module + if context.implement_powi_as_math_call: + imp = context.get_function(math.pow, sig) + res = imp(builder, args) + else: + fn = module.declare_intrinsic('llvm.pow', [y.type]) + res = builder.call(fn, (x, y)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_lt_impl(context, builder, sig, args): + res = builder.fcmp_ordered('<', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_le_impl(context, builder, sig, args): + res = builder.fcmp_ordered('<=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_gt_impl(context, builder, sig, args): + res = builder.fcmp_ordered('>', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_ge_impl(context, builder, sig, args): + res = builder.fcmp_ordered('>=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_eq_impl(context, builder, sig, args): + res = builder.fcmp_ordered('==', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_ne_impl(context, builder, sig, args): + res = builder.fcmp_unordered('!=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_abs_impl(context, builder, sig, args): + [ty] = sig.args + sig = typing.signature(ty, ty) + impl = context.get_function(math.fabs, sig) + return impl(builder, args) + + +def real_negate_impl(context, builder, sig, args): + from numba.cpython import mathimpl + res = mathimpl.negate_real(builder, args[0]) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_positive_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + res = context.cast(builder, val, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_sign_impl(context, builder, sig, args): + """ + np.sign(float) + """ + [x] = args + POS = Constant(x.type, 1) + NEG = Constant(x.type, -1) + ZERO = Constant(x.type, 0) + + presult = cgutils.alloca_once(builder, x.type) + + is_pos = builder.fcmp_ordered('>', x, ZERO) + is_neg = builder.fcmp_ordered('<', x, ZERO) + + with builder.if_else(is_pos) as (gt_zero, not_gt_zero): + with gt_zero: + builder.store(POS, presult) + with not_gt_zero: + with builder.if_else(is_neg) as (lt_zero, not_lt_zero): + with lt_zero: + builder.store(NEG, presult) + with not_lt_zero: + # For both NaN and 0, the result of sign() is simply + # the input value. + builder.store(x, presult) + + res = builder.load(presult) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +ty = types.Float + +lower_builtin(operator.add, ty, ty)(real_add_impl) +lower_builtin(operator.iadd, ty, ty)(real_add_impl) +lower_builtin(operator.sub, ty, ty)(real_sub_impl) +lower_builtin(operator.isub, ty, ty)(real_sub_impl) +lower_builtin(operator.mul, ty, ty)(real_mul_impl) +lower_builtin(operator.imul, ty, ty)(real_mul_impl) +lower_builtin(operator.floordiv, ty, ty)(real_floordiv_impl) +lower_builtin(operator.ifloordiv, ty, ty)(real_floordiv_impl) +lower_builtin(operator.truediv, ty, ty)(real_div_impl) +lower_builtin(operator.itruediv, ty, ty)(real_div_impl) +lower_builtin(operator.mod, ty, ty)(real_mod_impl) +lower_builtin(operator.imod, ty, ty)(real_mod_impl) +lower_builtin(operator.pow, ty, ty)(real_power_impl) +lower_builtin(operator.ipow, ty, ty)(real_power_impl) +lower_builtin(pow, ty, ty)(real_power_impl) + +lower_builtin(operator.eq, ty, ty)(real_eq_impl) +lower_builtin(operator.ne, ty, ty)(real_ne_impl) +lower_builtin(operator.lt, ty, ty)(real_lt_impl) +lower_builtin(operator.le, ty, ty)(real_le_impl) +lower_builtin(operator.gt, ty, ty)(real_gt_impl) +lower_builtin(operator.ge, ty, ty)(real_ge_impl) + +lower_builtin(abs, ty)(real_abs_impl) + +lower_builtin(operator.neg, ty)(real_negate_impl) +lower_builtin(operator.pos, ty)(real_positive_impl) + +del ty + + +@lower_getattr(types.Complex, "real") +def complex_real_impl(context, builder, typ, value): + cplx = context.make_complex(builder, typ, value=value) + res = cplx.real + return impl_ret_untracked(context, builder, typ, res) + +@lower_getattr(types.Complex, "imag") +def complex_imag_impl(context, builder, typ, value): + cplx = context.make_complex(builder, typ, value=value) + res = cplx.imag + return impl_ret_untracked(context, builder, typ, res) + +@lower_builtin("complex.conjugate", types.Complex) +def complex_conjugate_impl(context, builder, sig, args): + from numba.cpython import mathimpl + z = context.make_complex(builder, sig.args[0], args[0]) + z.imag = mathimpl.negate_real(builder, z.imag) + res = z._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + +def real_real_impl(context, builder, typ, value): + return impl_ret_untracked(context, builder, typ, value) + +def real_imag_impl(context, builder, typ, value): + res = cgutils.get_null_value(value.type) + return impl_ret_untracked(context, builder, typ, res) + +def real_conjugate_impl(context, builder, sig, args): + return impl_ret_untracked(context, builder, sig.return_type, args[0]) + +for cls in (types.Float, types.Integer): + lower_getattr(cls, "real")(real_real_impl) + lower_getattr(cls, "imag")(real_imag_impl) + lower_builtin("complex.conjugate", cls)(real_conjugate_impl) + + +@lower_builtin(operator.pow, types.Complex, types.Complex) +@lower_builtin(operator.ipow, types.Complex, types.Complex) +@lower_builtin(pow, types.Complex, types.Complex) +def complex_power_impl(context, builder, sig, args): + [ca, cb] = args + ty = sig.args[0] + fty = ty.underlying_float + a = context.make_helper(builder, ty, value=ca) + b = context.make_helper(builder, ty, value=cb) + c = context.make_helper(builder, ty) + module = builder.module + pa = a._getpointer() + pb = b._getpointer() + pc = c._getpointer() + + # Optimize for square because cpow loses a lot of precision + TWO = context.get_constant(fty, 2) + ZERO = context.get_constant(fty, 0) + + b_real_is_two = builder.fcmp_ordered('==', b.real, TWO) + b_imag_is_zero = builder.fcmp_ordered('==', b.imag, ZERO) + b_is_two = builder.and_(b_real_is_two, b_imag_is_zero) + + with builder.if_else(b_is_two) as (then, otherwise): + with then: + # Lower as multiplication + res = complex_mul_impl(context, builder, sig, (ca, ca)) + cres = context.make_helper(builder, ty, value=res) + c.real = cres.real + c.imag = cres.imag + + with otherwise: + # Lower with call to external function + func_name = { + types.complex64: "numba_cpowf", + types.complex128: "numba_cpow", + }[ty] + fnty = ir.FunctionType(ir.VoidType(), [pa.type] * 3) + cpow = cgutils.get_or_insert_function(module, fnty, func_name) + builder.call(cpow, (pa, pb, pc)) + + res = builder.load(pc) + return impl_ret_untracked(context, builder, sig.return_type, res) + +def complex_add_impl(context, builder, sig, args): + [cx, cy] = args + ty = sig.args[0] + x = context.make_complex(builder, ty, value=cx) + y = context.make_complex(builder, ty, value=cy) + z = context.make_complex(builder, ty) + a = x.real + b = x.imag + c = y.real + d = y.imag + z.real = builder.fadd(a, c) + z.imag = builder.fadd(b, d) + res = z._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_sub_impl(context, builder, sig, args): + [cx, cy] = args + ty = sig.args[0] + x = context.make_complex(builder, ty, value=cx) + y = context.make_complex(builder, ty, value=cy) + z = context.make_complex(builder, ty) + a = x.real + b = x.imag + c = y.real + d = y.imag + z.real = builder.fsub(a, c) + z.imag = builder.fsub(b, d) + res = z._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_mul_impl(context, builder, sig, args): + """ + (a+bi)(c+di)=(ac-bd)+i(ad+bc) + """ + [cx, cy] = args + ty = sig.args[0] + x = context.make_complex(builder, ty, value=cx) + y = context.make_complex(builder, ty, value=cy) + z = context.make_complex(builder, ty) + a = x.real + b = x.imag + c = y.real + d = y.imag + ac = builder.fmul(a, c) + bd = builder.fmul(b, d) + ad = builder.fmul(a, d) + bc = builder.fmul(b, c) + z.real = builder.fsub(ac, bd) + z.imag = builder.fadd(ad, bc) + res = z._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +NAN = float('nan') + +def complex_div_impl(context, builder, sig, args): + def complex_div(a, b): + # This is CPython's algorithm (in _Py_c_quot()). + areal = a.real + aimag = a.imag + breal = b.real + bimag = b.imag + if not breal and not bimag: + raise ZeroDivisionError("complex division by zero") + if abs(breal) >= abs(bimag): + # Divide tops and bottom by b.real + if not breal: + return complex(NAN, NAN) + ratio = bimag / breal + denom = breal + bimag * ratio + return complex( + (areal + aimag * ratio) / denom, + (aimag - areal * ratio) / denom) + else: + # Divide tops and bottom by b.imag + if not bimag: + return complex(NAN, NAN) + ratio = breal / bimag + denom = breal * ratio + bimag + return complex( + (a.real * ratio + a.imag) / denom, + (a.imag * ratio - a.real) / denom) + + res = context.compile_internal(builder, complex_div, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_negate_impl(context, builder, sig, args): + from numba.cpython import mathimpl + [typ] = sig.args + [val] = args + cmplx = context.make_complex(builder, typ, value=val) + res = context.make_complex(builder, typ) + res.real = mathimpl.negate_real(builder, cmplx.real) + res.imag = mathimpl.negate_real(builder, cmplx.imag) + res = res._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_positive_impl(context, builder, sig, args): + [val] = args + return impl_ret_untracked(context, builder, sig.return_type, val) + + +def complex_eq_impl(context, builder, sig, args): + [cx, cy] = args + typ = sig.args[0] + x = context.make_complex(builder, typ, value=cx) + y = context.make_complex(builder, typ, value=cy) + + reals_are_eq = builder.fcmp_ordered('==', x.real, y.real) + imags_are_eq = builder.fcmp_ordered('==', x.imag, y.imag) + res = builder.and_(reals_are_eq, imags_are_eq) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_ne_impl(context, builder, sig, args): + [cx, cy] = args + typ = sig.args[0] + x = context.make_complex(builder, typ, value=cx) + y = context.make_complex(builder, typ, value=cy) + + reals_are_ne = builder.fcmp_unordered('!=', x.real, y.real) + imags_are_ne = builder.fcmp_unordered('!=', x.imag, y.imag) + res = builder.or_(reals_are_ne, imags_are_ne) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_abs_impl(context, builder, sig, args): + """ + abs(z) := hypot(z.real, z.imag) + """ + def complex_abs(z): + return math.hypot(z.real, z.imag) + + res = context.compile_internal(builder, complex_abs, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +ty = types.Complex + +lower_builtin(operator.add, ty, ty)(complex_add_impl) +lower_builtin(operator.iadd, ty, ty)(complex_add_impl) +lower_builtin(operator.sub, ty, ty)(complex_sub_impl) +lower_builtin(operator.isub, ty, ty)(complex_sub_impl) +lower_builtin(operator.mul, ty, ty)(complex_mul_impl) +lower_builtin(operator.imul, ty, ty)(complex_mul_impl) +lower_builtin(operator.truediv, ty, ty)(complex_div_impl) +lower_builtin(operator.itruediv, ty, ty)(complex_div_impl) +lower_builtin(operator.neg, ty)(complex_negate_impl) +lower_builtin(operator.pos, ty)(complex_positive_impl) +# Complex modulo is deprecated in python3 + +lower_builtin(operator.eq, ty, ty)(complex_eq_impl) +lower_builtin(operator.ne, ty, ty)(complex_ne_impl) + +lower_builtin(abs, ty)(complex_abs_impl) + +del ty + + +@lower_builtin("number.item", types.Boolean) +@lower_builtin("number.item", types.Number) +def number_item_impl(context, builder, sig, args): + """ + The no-op .item() method on booleans and numbers. + """ + return args[0] + + +#------------------------------------------------------------------------------ + + +def number_not_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + istrue = context.cast(builder, val, typ, sig.return_type) + res = builder.not_(istrue) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(bool, types.Boolean) +def bool_as_bool(context, builder, sig, args): + [val] = args + return val + +@lower_builtin(bool, types.Integer) +def int_as_bool(context, builder, sig, args): + [val] = args + return builder.icmp_unsigned('!=', val, Constant(val.type, 0)) + +@lower_builtin(bool, types.Float) +def float_as_bool(context, builder, sig, args): + [val] = args + return builder.fcmp_unordered('!=', val, Constant(val.type, 0.0)) + +@lower_builtin(bool, types.Complex) +def complex_as_bool(context, builder, sig, args): + [typ] = sig.args + [val] = args + cmplx = context.make_complex(builder, typ, val) + real, imag = cmplx.real, cmplx.imag + zero = Constant(real.type, 0.0) + real_istrue = builder.fcmp_unordered('!=', real, zero) + imag_istrue = builder.fcmp_unordered('!=', imag, zero) + return builder.or_(real_istrue, imag_istrue) + + +for ty in (types.Integer, types.Float, types.Complex): + lower_builtin(operator.not_, ty)(number_not_impl) + + +lower_builtin(operator.not_, types.py_bool)(number_not_impl) + + +#------------------------------------------------------------------------------ +# Hashing numbers, see hashing.py + +#------------------------------------------------------------------------------- +# Implicit casts between numerics + +@lower_cast(types.IntegerLiteral, types.Integer) +@lower_cast(types.IntegerLiteral, types.Float) +@lower_cast(types.IntegerLiteral, types.Complex) +def literal_int_to_number(context, builder, fromty, toty, val): + lit = context.get_constant_generic( + builder, + fromty.literal_type, + fromty.literal_value, + ) + return context.cast(builder, lit, fromty.literal_type, toty) + + +@lower_cast(types.Integer, types.Integer) +def integer_to_integer(context, builder, fromty, toty, val): + if toty.bitwidth == fromty.bitwidth: + # Just a change of signedness + return val + elif toty.bitwidth < fromty.bitwidth: + # Downcast + return builder.trunc(val, context.get_value_type(toty)) + elif fromty.signed: + # Signed upcast + return builder.sext(val, context.get_value_type(toty)) + else: + # Unsigned upcast + return builder.zext(val, context.get_value_type(toty)) + +@lower_cast(types.Integer, types.voidptr) +def integer_to_voidptr(context, builder, fromty, toty, val): + return builder.inttoptr(val, context.get_value_type(toty)) + +@lower_cast(types.Float, types.Float) +def float_to_float(context, builder, fromty, toty, val): + lty = context.get_value_type(toty) + if fromty.bitwidth < toty.bitwidth: + return builder.fpext(val, lty) + else: + return builder.fptrunc(val, lty) + +@lower_cast(types.Integer, types.Float) +def integer_to_float(context, builder, fromty, toty, val): + lty = context.get_value_type(toty) + if fromty.signed: + return builder.sitofp(val, lty) + else: + return builder.uitofp(val, lty) + +@lower_cast(types.Float, types.Integer) +def float_to_integer(context, builder, fromty, toty, val): + lty = context.get_value_type(toty) + if toty.signed: + return builder.fptosi(val, lty) + else: + return builder.fptoui(val, lty) + +@lower_cast(types.Float, types.Complex) +@lower_cast(types.Integer, types.Complex) +def non_complex_to_complex(context, builder, fromty, toty, val): + real = context.cast(builder, val, fromty, toty.underlying_float) + imag = context.get_constant(toty.underlying_float, 0) + + cmplx = context.make_complex(builder, toty) + cmplx.real = real + cmplx.imag = imag + return cmplx._getvalue() + +@lower_cast(types.Complex, types.Complex) +def complex_to_complex(context, builder, fromty, toty, val): + srcty = fromty.underlying_float + dstty = toty.underlying_float + + src = context.make_complex(builder, fromty, value=val) + dst = context.make_complex(builder, toty) + dst.real = context.cast(builder, src.real, srcty, dstty) + dst.imag = context.cast(builder, src.imag, srcty, dstty) + return dst._getvalue() + +@lower_cast(types.Any, types.Boolean) +def any_to_boolean(context, builder, fromty, toty, val): + return context.is_true(builder, fromty, val) + +@lower_cast(types.Boolean, types.Number) +def boolean_to_any(context, builder, fromty, toty, val): + # Casting from boolean to anything first casts to int32 + asint = builder.zext(val, ir.IntType(32)) + return context.cast(builder, asint, types.int32, toty) + +@lower_cast(types.IntegerLiteral, types.Boolean) +@lower_cast(types.BooleanLiteral, types.Boolean) +def literal_int_to_boolean(context, builder, fromty, toty, val): + lit = context.get_constant_generic( + builder, + fromty.literal_type, + fromty.literal_value, + ) + return context.is_true(builder, fromty.literal_type, lit) + +#------------------------------------------------------------------------------- +# Constants + +@lower_constant(types.Complex) +def constant_complex(context, builder, ty, pyval): + fty = ty.underlying_float + real = context.get_constant_generic(builder, fty, pyval.real) + imag = context.get_constant_generic(builder, fty, pyval.imag) + return Constant.literal_struct((real, imag)) + +@lower_constant(types.Integer) +@lower_constant(types.Float) +@lower_constant(types.Boolean) +def constant_integer(context, builder, ty, pyval): + # See https://github.com/numba/numba/issues/6979 + # llvmlite ir.IntType specialises the formatting of the constant for a + # cpython bool. A NumPy np.bool_ is not a cpython bool so force it to be one + # so that the constant renders correctly! + if isinstance(pyval, np.bool_): + pyval = bool(pyval) + lty = context.get_value_type(ty) + return lty(pyval) + + +#------------------------------------------------------------------------------- +# View + +def scalar_view(scalar, viewty): + """ Typing for the np scalar 'view' method. """ + if (isinstance(scalar, (types.Float, types.Integer)) + and isinstance(viewty, types.abstract.DTypeSpec)): + if scalar.bitwidth != viewty.dtype.bitwidth: + raise errors.TypingError( + "Changing the dtype of a 0d array is only supported if the " + "itemsize is unchanged") + + def impl(scalar, viewty): + return viewer(scalar, viewty) + return impl + + +overload_method(types.Float, 'view')(scalar_view) +overload_method(types.Integer, 'view')(scalar_view) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_tupleobj.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_tupleobj.py new file mode 100644 index 0000000000000000000000000000000000000000..792f413a4936e05462eaaf9b5e727d1b9048e050 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/new_tupleobj.py @@ -0,0 +1,414 @@ +""" +Implementation of tuple objects +""" + +import operator + +from numba.core.imputils import (lower_builtin, lower_getattr_generic, + lower_cast, lower_constant, iternext_impl, + impl_ret_borrowed, impl_ret_untracked, + RefType) +from numba.core import typing, types, cgutils +from numba.core.extending import overload_method, overload, intrinsic + + +@lower_builtin(types.NamedTupleClass, types.VarArg(types.Any)) +def namedtuple_constructor(context, builder, sig, args): + # A namedtuple has the same representation as a regular tuple + # the arguments need casting (lower_cast) from the types in the ctor args + # to those in the ctor return type, this is to handle cases such as a + # literal present in the args, but a type present in the return type. + newargs = [] + for i, arg in enumerate(args): + casted = context.cast(builder, arg, sig.args[i], sig.return_type[i]) + newargs.append(casted) + res = context.make_tuple(builder, sig.return_type, tuple(newargs)) + # The tuple's contents are borrowed + return impl_ret_borrowed(context, builder, sig.return_type, res) + +@lower_builtin(operator.add, types.BaseTuple, types.BaseTuple) +def tuple_add(context, builder, sig, args): + left, right = [cgutils.unpack_tuple(builder, x) for x in args] + res = context.make_tuple(builder, sig.return_type, left + right) + # The tuple's contents are borrowed + return impl_ret_borrowed(context, builder, sig.return_type, res) + +def tuple_cmp_ordered(context, builder, op, sig, args): + tu, tv = sig.args + u, v = args + res = cgutils.alloca_once_value(builder, cgutils.true_bit) + bbend = builder.append_basic_block("cmp_end") + for i, (ta, tb) in enumerate(zip(tu.types, tv.types)): + a = builder.extract_value(u, i) + b = builder.extract_value(v, i) + not_equal = context.generic_compare(builder, operator.ne, (ta, tb), (a, b)) + with builder.if_then(not_equal): + pred = context.generic_compare(builder, op, (ta, tb), (a, b)) + builder.store(pred, res) + builder.branch(bbend) + # Everything matched equal => compare lengths + len_compare = op(len(tu.types), len(tv.types)) + pred = context.get_constant(types.boolean, len_compare) + builder.store(pred, res) + builder.branch(bbend) + builder.position_at_end(bbend) + return builder.load(res) + + +@lower_builtin(operator.eq, types.BaseTuple, types.BaseTuple) +def tuple_eq(context, builder, sig, args): + tu, tv = sig.args + u, v = args + if len(tu.types) != len(tv.types): + res = context.get_constant(types.boolean, False) + return impl_ret_untracked(context, builder, sig.return_type, res) + res = context.get_constant(types.boolean, True) + for i, (ta, tb) in enumerate(zip(tu.types, tv.types)): + a = builder.extract_value(u, i) + b = builder.extract_value(v, i) + pred = context.generic_compare(builder, operator.eq, (ta, tb), (a, b)) + res = builder.and_(res, pred) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.ne, types.BaseTuple, types.BaseTuple) +def tuple_ne(context, builder, sig, args): + res = builder.not_(tuple_eq(context, builder, sig, args)) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.lt, types.BaseTuple, types.BaseTuple) +def tuple_lt(context, builder, sig, args): + res = tuple_cmp_ordered(context, builder, operator.lt, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.le, types.BaseTuple, types.BaseTuple) +def tuple_le(context, builder, sig, args): + res = tuple_cmp_ordered(context, builder, operator.le, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.gt, types.BaseTuple, types.BaseTuple) +def tuple_gt(context, builder, sig, args): + res = tuple_cmp_ordered(context, builder, operator.gt, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.ge, types.BaseTuple, types.BaseTuple) +def tuple_ge(context, builder, sig, args): + res = tuple_cmp_ordered(context, builder, operator.ge, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +# for hashing see hashing.py + +@lower_getattr_generic(types.BaseNamedTuple) +def namedtuple_getattr(context, builder, typ, value, attr): + """ + Fetch a namedtuple's field. + """ + index = typ.fields.index(attr) + res = builder.extract_value(value, index) + return impl_ret_borrowed(context, builder, typ[index], res) + + +@lower_constant(types.UniTuple) +@lower_constant(types.NamedUniTuple) +def unituple_constant(context, builder, ty, pyval): + """ + Create a homogeneous tuple constant. + """ + consts = [context.get_constant_generic(builder, ty.dtype, v) + for v in pyval] + return impl_ret_borrowed( + context, builder, ty, cgutils.pack_array(builder, consts), + ) + +@lower_constant(types.Tuple) +@lower_constant(types.NamedTuple) +def unituple_constant(context, builder, ty, pyval): + """ + Create a heterogeneous tuple constant. + """ + consts = [context.get_constant_generic(builder, ty.types[i], v) + for i, v in enumerate(pyval)] + return impl_ret_borrowed( + context, builder, ty, cgutils.pack_struct(builder, consts), + ) + + +#------------------------------------------------------------------------------ +# Tuple iterators + +@lower_builtin('getiter', types.UniTuple) +@lower_builtin('getiter', types.NamedUniTuple) +def getiter_unituple(context, builder, sig, args): + [tupty] = sig.args + [tup] = args + + iterval = context.make_helper(builder, types.UniTupleIter(tupty)) + + index0 = context.get_constant(types.intp, 0) + indexptr = cgutils.alloca_once(builder, index0.type) + builder.store(index0, indexptr) + + iterval.index = indexptr + iterval.tuple = tup + + res = iterval._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin('iternext', types.UniTupleIter) +@iternext_impl(RefType.BORROWED) +def iternext_unituple(context, builder, sig, args, result): + [tupiterty] = sig.args + [tupiter] = args + + iterval = context.make_helper(builder, tupiterty, value=tupiter) + + tup = iterval.tuple + idxptr = iterval.index + idx = builder.load(idxptr) + count = context.get_constant(types.intp, tupiterty.container.count) + + is_valid = builder.icmp_signed('<', idx, count) + result.set_valid(is_valid) + + with builder.if_then(is_valid): + getitem_sig = typing.signature(tupiterty.container.dtype, + tupiterty.container, + types.intp) + getitem_out = getitem_unituple(context, builder, getitem_sig, + [tup, idx]) + # As a iternext_impl function, this will incref the yieled value. + # We need to release the new reference from getitem_unituple. + if context.enable_nrt: + context.nrt.decref(builder, tupiterty.container.dtype, getitem_out) + result.yield_(getitem_out) + nidx = builder.add(idx, context.get_constant(types.intp, 1)) + builder.store(nidx, iterval.index) + + +@overload(operator.getitem) +def getitem_literal_idx(tup, idx): + """ + Overloads BaseTuple getitem to cover cases where constant + inference and RewriteConstGetitems cannot replace it + with a static_getitem. + """ + if not (isinstance(tup, types.BaseTuple) + and isinstance(idx, types.IntegerLiteral)): + return None + + idx_val = idx.literal_value + def getitem_literal_idx_impl(tup, idx): + return tup[idx_val] + + return getitem_literal_idx_impl + + +@lower_builtin('typed_getitem', types.BaseTuple, types.Any) +def getitem_typed(context, builder, sig, args): + tupty, _ = sig.args + tup, idx = args + errmsg_oob = ("tuple index out of range",) + + if len(tupty) == 0: + # Empty tuple. + + # Always branch and raise IndexError + with builder.if_then(cgutils.true_bit): + context.call_conv.return_user_exc(builder, IndexError, + errmsg_oob) + # This is unreachable in runtime, + # but it exists to not terminate the current basicblock. + res = context.get_constant_null(sig.return_type) + return impl_ret_untracked(context, builder, + sig.return_type, res) + else: + # The tuple is not empty + + bbelse = builder.append_basic_block("typed_switch.else") + bbend = builder.append_basic_block("typed_switch.end") + switch = builder.switch(idx, bbelse) + + with builder.goto_block(bbelse): + context.call_conv.return_user_exc(builder, IndexError, + errmsg_oob) + + lrtty = context.get_value_type(sig.return_type) + voidptrty = context.get_value_type(types.voidptr) + with builder.goto_block(bbend): + phinode = builder.phi(voidptrty) + + for i in range(tupty.count): + ki = context.get_constant(types.intp, i) + bbi = builder.append_basic_block("typed_switch.%d" % i) + switch.add_case(ki, bbi) + # handle negative indexing, create case (-tuple.count + i) to + # reference same block as i + kin = context.get_constant(types.intp, -tupty.count + i) + switch.add_case(kin, bbi) + with builder.goto_block(bbi): + value = builder.extract_value(tup, i) + # Dragon warning... + # The fact the code has made it this far suggests that type + # inference decided whatever was being done with the item pulled + # from the tuple was legitimate, it is not the job of lowering + # to argue about that. However, here lies a problem, the tuple + # lowering is implemented as a switch table with each case + # writing to a phi node slot that is returned. The type of this + # phi node slot needs to be "correct" for the current type but + # it also needs to survive stores being made to it from the + # other cases that will in effect never run. To do this a stack + # slot is made for each case for the specific type and then cast + # to a void pointer type, this is then added as an incoming on + # the phi node, at the end of the switch the phi node is then + # cast back to the required return type for this typed_getitem. + # The only further complication is that if the value is not a + # pointer then the void* juggle won't work so a cast is made + # prior to store, again, that type inference has permitted it + # suggests this is safe. + # End Dragon warning... + DOCAST = context.typing_context.unify_types(sig.args[0][i], + sig.return_type) == sig.return_type + if DOCAST: + value_slot = builder.alloca(lrtty, + name="TYPED_VALUE_SLOT%s" % i) + casted = context.cast(builder, value, sig.args[0][i], + sig.return_type) + builder.store(casted, value_slot) + else: + value_slot = builder.alloca(value.type, + name="TYPED_VALUE_SLOT%s" % i) + builder.store(value, value_slot) + phinode.add_incoming(builder.bitcast(value_slot, voidptrty), + bbi) + builder.branch(bbend) + + builder.position_at_end(bbend) + res = builder.bitcast(phinode, lrtty.as_pointer()) + res = builder.load(res) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(operator.getitem, types.UniTuple, types.py_int) +@lower_builtin(operator.getitem, types.UniTuple, types.np_intp) +@lower_builtin(operator.getitem, types.UniTuple, types.np_uintp) +@lower_builtin(operator.getitem, types.NamedUniTuple, types.py_int) +@lower_builtin(operator.getitem, types.NamedUniTuple, types.np_intp) +@lower_builtin(operator.getitem, types.NamedUniTuple, types.np_uintp) +def getitem_unituple(context, builder, sig, args): + tupty, _ = sig.args + tup, idx = args + + errmsg_oob = ("tuple index out of range",) + + if len(tupty) == 0: + # Empty tuple. + + # Always branch and raise IndexError + with builder.if_then(cgutils.true_bit): + context.call_conv.return_user_exc(builder, IndexError, + errmsg_oob) + # This is unreachable in runtime, + # but it exists to not terminate the current basicblock. + res = context.get_constant_null(sig.return_type) + return impl_ret_untracked(context, builder, + sig.return_type, res) + else: + # The tuple is not empty + bbelse = builder.append_basic_block("switch.else") + bbend = builder.append_basic_block("switch.end") + switch = builder.switch(idx, bbelse) + + with builder.goto_block(bbelse): + context.call_conv.return_user_exc(builder, IndexError, + errmsg_oob) + + lrtty = context.get_value_type(tupty.dtype) + with builder.goto_block(bbend): + phinode = builder.phi(lrtty) + + for i in range(tupty.count): + ki = context.get_constant(types.intp, i) + bbi = builder.append_basic_block("switch.%d" % i) + switch.add_case(ki, bbi) + # handle negative indexing, create case (-tuple.count + i) to + # reference same block as i + kin = context.get_constant(types.intp, -tupty.count + i) + switch.add_case(kin, bbi) + with builder.goto_block(bbi): + value = builder.extract_value(tup, i) + builder.branch(bbend) + phinode.add_incoming(value, bbi) + + builder.position_at_end(bbend) + res = phinode + assert sig.return_type == tupty.dtype + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin('static_getitem', types.LiteralStrKeyDict, types.StringLiteral) +@lower_builtin('static_getitem', types.LiteralList, types.IntegerLiteral) +@lower_builtin('static_getitem', types.LiteralList, types.SliceLiteral) +@lower_builtin('static_getitem', types.BaseTuple, types.IntegerLiteral) +@lower_builtin('static_getitem', types.BaseTuple, types.SliceLiteral) +def static_getitem_tuple(context, builder, sig, args): + tupty, idxty = sig.args + tup, idx = args + if isinstance(idx, int): + if idx < 0: + idx += len(tupty) + if not 0 <= idx < len(tupty): + raise IndexError("cannot index at %d in %s" % (idx, tupty)) + res = builder.extract_value(tup, idx) + elif isinstance(idx, slice): + items = cgutils.unpack_tuple(builder, tup)[idx] + res = context.make_tuple(builder, sig.return_type, items) + elif isinstance(tupty, types.LiteralStrKeyDict): + # pretend to be a dictionary + idx_val = idxty.literal_value + idx_offset = tupty.fields.index(idx_val) + res = builder.extract_value(tup, idx_offset) + else: + raise NotImplementedError("unexpected index %r for %s" + % (idx, sig.args[0])) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +#------------------------------------------------------------------------------ +# Implicit conversion + +@lower_cast(types.BaseTuple, types.BaseTuple) +def tuple_to_tuple(context, builder, fromty, toty, val): + if (isinstance(fromty, types.BaseNamedTuple) + or isinstance(toty, types.BaseNamedTuple)): + # Disallowed by typing layer + raise NotImplementedError + + if len(fromty) != len(toty): + # Disallowed by typing layer + raise NotImplementedError + + olditems = cgutils.unpack_tuple(builder, val, len(fromty)) + items = [context.cast(builder, v, f, t) + for v, f, t in zip(olditems, fromty, toty)] + return context.make_tuple(builder, toty, items) + + +#------------------------------------------------------------------------------ +# Methods + +@overload_method(types.BaseTuple, 'index') +def tuple_index(tup, value): + + def tuple_index_impl(tup, value): + for i in range(len(tup)): + if tup[i] == value: + return i + raise ValueError("tuple.index(x): x not in tuple") + + return tuple_index_impl + + +@overload(operator.contains) +def in_seq_empty_tuple(x, y): + if isinstance(x, types.Tuple) and not x.types: + return lambda x, y: False diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/numbers.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/numbers.py new file mode 100644 index 0000000000000000000000000000000000000000..ed32395434cb7f585956ddb6f45fcbab723533e4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/numbers.py @@ -0,0 +1,10 @@ +import sys +from numba.core.utils import _RedirectSubpackage +from numba.core import config + +if config.USE_LEGACY_TYPE_SYSTEM: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.old_numbers") +else: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.new_numbers") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_builtins.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..1ebb2d7786abf8dd435324d57a20367f75190124 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_builtins.py @@ -0,0 +1,1025 @@ +from collections import namedtuple +import math +from functools import reduce + +import numpy as np +import operator +import warnings + +from llvmlite import ir + +from numba.core.imputils import (lower_builtin, lower_getattr, + lower_getattr_generic, lower_cast, + lower_constant, iternext_impl, + call_getiter, call_iternext, impl_ret_borrowed, + impl_ret_untracked, numba_typeref_ctor) +from numba.core import typing, types, utils, cgutils +from numba.core.extending import overload, intrinsic +from numba.core.typeconv import Conversion +from numba.core.errors import (TypingError, LoweringError, + NumbaExperimentalFeatureWarning, + NumbaTypeError, RequireLiteralValue, + NumbaPerformanceWarning) +from numba.core.typing.templates import (AbstractTemplate, infer_global, + signature) +from numba.misc.special import literal_unroll +from numba.core.typing.asnumbatype import as_numba_type + + +@overload(operator.truth) +def ol_truth(val): + if isinstance(val, types.Boolean): + def impl(val): + return val + return impl + + +@lower_builtin(operator.is_not, types.Any, types.Any) +def generic_is_not(context, builder, sig, args): + """ + Implement `x is not y` as `not (x is y)`. + """ + is_impl = context.get_function(operator.is_, sig) + return builder.not_(is_impl(builder, args)) + + +@lower_builtin(operator.is_, types.Any, types.Any) +def generic_is(context, builder, sig, args): + """ + Default implementation for `x is y` + """ + lhs_type, rhs_type = sig.args + # the lhs and rhs have the same type + if lhs_type == rhs_type: + # mutable types + if lhs_type.mutable: + msg = 'no default `is` implementation' + raise LoweringError(msg) + # immutable types + else: + # fallbacks to `==` + try: + eq_impl = context.get_function(operator.eq, sig) + except NotImplementedError: + # no `==` implemented for this type + return cgutils.false_bit + else: + return eq_impl(builder, args) + else: + return cgutils.false_bit + + +@lower_builtin(operator.is_, types.Opaque, types.Opaque) +def opaque_is(context, builder, sig, args): + """ + Implementation for `x is y` for Opaque types. + """ + lhs_type, rhs_type = sig.args + # the lhs and rhs have the same type + if lhs_type == rhs_type: + lhs_ptr = builder.ptrtoint(args[0], cgutils.intp_t) + rhs_ptr = builder.ptrtoint(args[1], cgutils.intp_t) + + return builder.icmp_unsigned('==', lhs_ptr, rhs_ptr) + else: + return cgutils.false_bit + + +@lower_builtin(operator.is_, types.Boolean, types.Boolean) +def bool_is_impl(context, builder, sig, args): + """ + Implementation for `x is y` for types derived from types.Boolean + (e.g. BooleanLiteral), and cross-checks between literal and non-literal + booleans, to satisfy Python's behavior preserving identity for bools. + """ + arg1, arg2 = args + arg1_type, arg2_type = sig.args + _arg1 = context.cast(builder, arg1, arg1_type, types.boolean) + _arg2 = context.cast(builder, arg2, arg2_type, types.boolean) + eq_impl = context.get_function( + operator.eq, + typing.signature(types.boolean, types.boolean, types.boolean) + ) + return eq_impl(builder, (_arg1, _arg2)) + + +# keep types.IntegerLiteral, as otherwise there's ambiguity between this and int_eq_impl +@lower_builtin(operator.eq, types.Literal, types.Literal) +@lower_builtin(operator.eq, types.IntegerLiteral, types.IntegerLiteral) +def const_eq_impl(context, builder, sig, args): + arg1, arg2 = sig.args + val = 0 + if arg1.literal_value == arg2.literal_value: + val = 1 + res = ir.Constant(ir.IntType(1), val) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# keep types.IntegerLiteral, as otherwise there's ambiguity between this and int_ne_impl +@lower_builtin(operator.ne, types.Literal, types.Literal) +@lower_builtin(operator.ne, types.IntegerLiteral, types.IntegerLiteral) +def const_ne_impl(context, builder, sig, args): + arg1, arg2 = sig.args + val = 0 + if arg1.literal_value != arg2.literal_value: + val = 1 + res = ir.Constant(ir.IntType(1), val) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def gen_non_eq(val): + def none_equality(a, b): + a_none = isinstance(a, types.NoneType) + b_none = isinstance(b, types.NoneType) + if a_none and b_none: + def impl(a, b): + return val + return impl + elif a_none ^ b_none: + def impl(a, b): + return not val + return impl + return none_equality + +overload(operator.eq)(gen_non_eq(True)) +overload(operator.ne)(gen_non_eq(False)) + +#------------------------------------------------------------------------------- + +@lower_getattr_generic(types.DeferredType) +def deferred_getattr(context, builder, typ, value, attr): + """ + Deferred.__getattr__ => redirect to the actual type. + """ + inner_type = typ.get() + val = context.cast(builder, value, typ, inner_type) + imp = context.get_getattr(inner_type, attr) + return imp(context, builder, inner_type, val, attr) + +@lower_cast(types.Any, types.DeferredType) +@lower_cast(types.Optional, types.DeferredType) +@lower_cast(types.Boolean, types.DeferredType) +def any_to_deferred(context, builder, fromty, toty, val): + actual = context.cast(builder, val, fromty, toty.get()) + model = context.data_model_manager[toty] + return model.set(builder, model.make_uninitialized(), actual) + +@lower_cast(types.DeferredType, types.Any) +@lower_cast(types.DeferredType, types.Boolean) +@lower_cast(types.DeferredType, types.Optional) +def deferred_to_any(context, builder, fromty, toty, val): + model = context.data_model_manager[fromty] + val = model.get(builder, val) + return context.cast(builder, val, fromty.get(), toty) + + +#------------------------------------------------------------------------------ + +@lower_builtin(operator.getitem, types.CPointer, types.Integer) +def getitem_cpointer(context, builder, sig, args): + base_ptr, idx = args + elem_ptr = builder.gep(base_ptr, [idx]) + res = builder.load(elem_ptr) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(operator.setitem, types.CPointer, types.Integer, types.Any) +def setitem_cpointer(context, builder, sig, args): + base_ptr, idx, val = args + elem_ptr = builder.gep(base_ptr, [idx]) + builder.store(val, elem_ptr) + + +#------------------------------------------------------------------------------- + +def do_minmax(context, builder, argtys, args, cmpop): + assert len(argtys) == len(args), (argtys, args) + assert len(args) > 0 + + def binary_minmax(accumulator, value): + # This is careful to reproduce Python's algorithm, e.g. + # max(1.5, nan, 2.5) should return 2.5 (not nan or 1.5) + accty, acc = accumulator + vty, v = value + ty = context.typing_context.unify_types(accty, vty) + assert ty is not None + acc = context.cast(builder, acc, accty, ty) + v = context.cast(builder, v, vty, ty) + cmpsig = typing.signature(types.boolean, ty, ty) + ge = context.get_function(cmpop, cmpsig) + pred = ge(builder, (v, acc)) + res = builder.select(pred, v, acc) + return ty, res + + typvals = zip(argtys, args) + resty, resval = reduce(binary_minmax, typvals) + return resval + + +@lower_builtin(max, types.BaseTuple) +def max_iterable(context, builder, sig, args): + argtys = list(sig.args[0]) + args = cgutils.unpack_tuple(builder, args[0]) + return do_minmax(context, builder, argtys, args, operator.gt) + +@lower_builtin(max, types.VarArg(types.Any)) +def max_vararg(context, builder, sig, args): + return do_minmax(context, builder, sig.args, args, operator.gt) + +@lower_builtin(min, types.BaseTuple) +def min_iterable(context, builder, sig, args): + argtys = list(sig.args[0]) + args = cgutils.unpack_tuple(builder, args[0]) + return do_minmax(context, builder, argtys, args, operator.lt) + +@lower_builtin(min, types.VarArg(types.Any)) +def min_vararg(context, builder, sig, args): + return do_minmax(context, builder, sig.args, args, operator.lt) + + +def _round_intrinsic(tp): + # round() rounds half to even + return "llvm.rint.f%d" % (tp.bitwidth,) + +@lower_builtin(round, types.Float) +def round_impl_unary(context, builder, sig, args): + fltty = sig.args[0] + llty = context.get_value_type(fltty) + module = builder.module + fnty = ir.FunctionType(llty, [llty]) + fn = cgutils.get_or_insert_function(module, fnty, _round_intrinsic(fltty)) + res = builder.call(fn, args) + # unary round() returns an int + res = builder.fptosi(res, context.get_value_type(sig.return_type)) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(round, types.Float, types.Integer) +def round_impl_binary(context, builder, sig, args): + fltty = sig.args[0] + # Allow calling the intrinsic from the Python implementation below. + # This avoids the conversion to an int in Python 3's unary round(). + _round = types.ExternalFunction( + _round_intrinsic(fltty), typing.signature(fltty, fltty)) + + def round_ndigits(x, ndigits): + if math.isinf(x) or math.isnan(x): + return x + + if ndigits >= 0: + if ndigits > 22: + # pow1 and pow2 are each safe from overflow, but + # pow1*pow2 ~= pow(10.0, ndigits) might overflow. + pow1 = 10.0 ** (ndigits - 22) + pow2 = 1e22 + else: + pow1 = 10.0 ** ndigits + pow2 = 1.0 + y = (x * pow1) * pow2 + if math.isinf(y): + return x + return (_round(y) / pow2) / pow1 + + else: + pow1 = 10.0 ** (-ndigits) + y = x / pow1 + return _round(y) * pow1 + + res = context.compile_internal(builder, round_ndigits, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +#------------------------------------------------------------------------------- +# Numeric constructors + +@lower_builtin(int, types.Any) +@lower_builtin(float, types.Any) +def int_impl(context, builder, sig, args): + [ty] = sig.args + [val] = args + res = context.cast(builder, val, ty, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(float, types.StringLiteral) +def float_literal_impl(context, builder, sig, args): + [ty] = sig.args + res = context.get_constant(sig.return_type, float(ty.literal_value)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(complex, types.VarArg(types.Any)) +def complex_impl(context, builder, sig, args): + complex_type = sig.return_type + float_type = complex_type.underlying_float + if len(sig.args) == 1: + [argty] = sig.args + [arg] = args + if isinstance(argty, types.Complex): + # Cast Complex* to Complex* + res = context.cast(builder, arg, argty, complex_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + else: + real = context.cast(builder, arg, argty, float_type) + imag = context.get_constant(float_type, 0) + + elif len(sig.args) == 2: + [realty, imagty] = sig.args + [real, imag] = args + real = context.cast(builder, real, realty, float_type) + imag = context.cast(builder, imag, imagty, float_type) + + cmplx = context.make_complex(builder, complex_type) + cmplx.real = real + cmplx.imag = imag + res = cmplx._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(types.NumberClass, types.Any) +def number_constructor(context, builder, sig, args): + """ + Call a number class, e.g. np.int32(...) + """ + if isinstance(sig.return_type, types.Array): + # Array constructor + dt = sig.return_type.dtype + def foo(*arg_hack): + return np.array(arg_hack, dtype=dt) + res = context.compile_internal(builder, foo, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + else: + # Scalar constructor + [val] = args + [valty] = sig.args + return context.cast(builder, val, valty, sig.return_type) + + +#------------------------------------------------------------------------------- +# Constants + +@lower_constant(types.Dummy) +def constant_dummy(context, builder, ty, pyval): + # This handles None, etc. + return context.get_dummy_value() + +@lower_constant(types.ExternalFunctionPointer) +def constant_function_pointer(context, builder, ty, pyval): + ptrty = context.get_function_pointer_type(ty) + ptrval = context.add_dynamic_addr(builder, ty.get_pointer(pyval), + info=str(pyval)) + return builder.bitcast(ptrval, ptrty) + + +@lower_constant(types.Optional) +def constant_optional(context, builder, ty, pyval): + if pyval is None: + return context.make_optional_none(builder, ty.type) + else: + return context.make_optional_value(builder, ty.type, pyval) + + +# ----------------------------------------------------------------------------- + +@lower_builtin(type, types.Any) +def type_impl(context, builder, sig, args): + """ + One-argument type() builtin. + """ + return context.get_dummy_value() + + +@lower_builtin(iter, types.IterableType) +def iter_impl(context, builder, sig, args): + ty, = sig.args + val, = args + iterval = call_getiter(context, builder, ty, val) + return iterval + + +@lower_builtin(next, types.IteratorType) +def next_impl(context, builder, sig, args): + iterty, = sig.args + iterval, = args + + res = call_iternext(context, builder, iterty, iterval) + + with builder.if_then(builder.not_(res.is_valid()), likely=False): + context.call_conv.return_user_exc(builder, StopIteration, ()) + + return res.yielded_value() + + +# ----------------------------------------------------------------------------- + +@lower_builtin("not in", types.Any, types.Any) +def not_in(context, builder, sig, args): + def in_impl(a, b): + return operator.contains(b, a) + + res = context.compile_internal(builder, in_impl, sig, args) + return builder.not_(res) + + +# ----------------------------------------------------------------------------- + +@lower_builtin(len, types.ConstSized) +def constsized_len(context, builder, sig, args): + [ty] = sig.args + retty = sig.return_type + res = context.get_constant(retty, len(ty.types)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(bool, types.Sized) +def sized_bool(context, builder, sig, args): + [ty] = sig.args + if len(ty): + return cgutils.true_bit + else: + return cgutils.false_bit + +@lower_builtin(tuple) +def lower_empty_tuple(context, builder, sig, args): + retty = sig.return_type + res = context.get_constant_undef(retty) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(tuple, types.BaseTuple) +def lower_tuple(context, builder, sig, args): + val, = args + return impl_ret_borrowed(context, builder, sig.return_type, val) + +@overload(bool) +def bool_sequence(x): + valid_types = ( + types.CharSeq, + types.UnicodeCharSeq, + types.DictType, + types.ListType, + types.UnicodeType, + types.Set, + ) + + if isinstance(x, valid_types): + def bool_impl(x): + return len(x) > 0 + return bool_impl + +@overload(bool, inline='always') +def bool_none(x): + if isinstance(x, types.NoneType) or x is None: + return lambda x: False + +# ----------------------------------------------------------------------------- + +def get_type_max_value(typ): + if isinstance(typ, types.Float): + return np.inf + if isinstance(typ, types.Integer): + return typ.maxval + raise NotImplementedError("Unsupported type") + +def get_type_min_value(typ): + if isinstance(typ, types.Float): + return -np.inf + if isinstance(typ, types.Integer): + return typ.minval + raise NotImplementedError("Unsupported type") + +@infer_global(get_type_min_value) +@infer_global(get_type_max_value) +class MinValInfer(AbstractTemplate): + def generic(self, args, kws): + assert not kws + assert len(args) == 1 + if isinstance(args[0], (types.DType, types.NumberClass)): + return signature(args[0].dtype, *args) + +@lower_builtin(get_type_min_value, types.NumberClass) +@lower_builtin(get_type_min_value, types.DType) +def lower_get_type_min_value(context, builder, sig, args): + typ = sig.args[0].dtype + + if isinstance(typ, types.Integer): + bw = typ.bitwidth + lty = ir.IntType(bw) + val = typ.minval + res = ir.Constant(lty, val) + elif isinstance(typ, types.Float): + bw = typ.bitwidth + if bw == 32: + lty = ir.FloatType() + elif bw == 64: + lty = ir.DoubleType() + else: + raise NotImplementedError("llvmlite only supports 32 and 64 bit floats") + npty = getattr(np, 'float{}'.format(bw)) + res = ir.Constant(lty, -np.inf) + elif isinstance(typ, (types.NPDatetime, types.NPTimedelta)): + bw = 64 + lty = ir.IntType(bw) + val = types.int64.minval + 1 # minval is NaT, so minval + 1 is the smallest value + res = ir.Constant(lty, val) + return impl_ret_untracked(context, builder, lty, res) + +@lower_builtin(get_type_max_value, types.NumberClass) +@lower_builtin(get_type_max_value, types.DType) +def lower_get_type_max_value(context, builder, sig, args): + typ = sig.args[0].dtype + + if isinstance(typ, types.Integer): + bw = typ.bitwidth + lty = ir.IntType(bw) + val = typ.maxval + res = ir.Constant(lty, val) + elif isinstance(typ, types.Float): + bw = typ.bitwidth + if bw == 32: + lty = ir.FloatType() + elif bw == 64: + lty = ir.DoubleType() + else: + raise NotImplementedError("llvmlite only supports 32 and 64 bit floats") + npty = getattr(np, 'float{}'.format(bw)) + res = ir.Constant(lty, np.inf) + elif isinstance(typ, (types.NPDatetime, types.NPTimedelta)): + bw = 64 + lty = ir.IntType(bw) + val = types.int64.maxval + res = ir.Constant(lty, val) + return impl_ret_untracked(context, builder, lty, res) + +# ----------------------------------------------------------------------------- + +from numba.core.typing.builtins import IndexValue, IndexValueType +from numba.extending import overload, register_jitable + +@lower_builtin(IndexValue, types.intp, types.Type) +@lower_builtin(IndexValue, types.uintp, types.Type) +def impl_index_value(context, builder, sig, args): + typ = sig.return_type + index, value = args + index_value = cgutils.create_struct_proxy(typ)(context, builder) + index_value.index = index + index_value.value = value + return index_value._getvalue() + + +@overload(min) +def indval_min(indval1, indval2): + if isinstance(indval1, IndexValueType) and \ + isinstance(indval2, IndexValueType): + def min_impl(indval1, indval2): + if np.isnan(indval1.value): + if np.isnan(indval2.value): + # both indval1 and indval2 are nans so order by index + if indval1.index < indval2.index: + return indval1 + else: + return indval2 + else: + # comparing against one nan always considered less + return indval1 + elif np.isnan(indval2.value): + # indval1 not a nan but indval2 is so consider indval2 less + return indval2 + elif indval1.value > indval2.value: + return indval2 + elif indval1.value == indval2.value: + if indval1.index < indval2.index: + return indval1 + else: + return indval2 + return indval1 + return min_impl + + +@overload(min) +def boolval_min(val1, val2): + if isinstance(val1, types.Boolean) and \ + isinstance(val2, types.Boolean): + def bool_min_impl(val1, val2): + return val1 and val2 + return bool_min_impl + + +@overload(max) +def indval_max(indval1, indval2): + if isinstance(indval1, IndexValueType) and \ + isinstance(indval2, IndexValueType): + def max_impl(indval1, indval2): + if np.isnan(indval1.value): + if np.isnan(indval2.value): + # both indval1 and indval2 are nans so order by index + if indval1.index < indval2.index: + return indval1 + else: + return indval2 + else: + # comparing against one nan always considered larger + return indval1 + elif np.isnan(indval2.value): + # indval1 not a nan but indval2 is so consider indval2 larger + return indval2 + elif indval2.value > indval1.value: + return indval2 + elif indval1.value == indval2.value: + if indval1.index < indval2.index: + return indval1 + else: + return indval2 + return indval1 + return max_impl + + +@overload(max) +def boolval_max(val1, val2): + if isinstance(val1, types.Boolean) and \ + isinstance(val2, types.Boolean): + def bool_max_impl(val1, val2): + return val1 or val2 + return bool_max_impl + + +greater_than = register_jitable(lambda a, b: a > b) +less_than = register_jitable(lambda a, b: a < b) + + +@register_jitable +def min_max_impl(iterable, op): + if isinstance(iterable, types.IterableType): + def impl(iterable): + it = iter(iterable) + return_val = next(it) + for val in it: + if op(val, return_val): + return_val = val + return return_val + return impl + + +@overload(min) +def iterable_min(iterable): + return min_max_impl(iterable, less_than) + + +@overload(max) +def iterable_max(iterable): + return min_max_impl(iterable, greater_than) + + +@lower_builtin(types.TypeRef, types.VarArg(types.Any)) +def redirect_type_ctor(context, builder, sig, args): + """Redirect constructor implementation to `numba_typeref_ctor(cls, *args)`, + which should be overloaded by the type's implementation. + + For example: + + d = Dict() + + `d` will be typed as `TypeRef[DictType]()`. Thus, it will call into this + implementation. We need to redirect the lowering to a function + named ``numba_typeref_ctor``. + """ + cls = sig.return_type + + def call_ctor(cls, *args): + return numba_typeref_ctor(cls, *args) + + # Pack arguments into a tuple for `*args` + ctor_args = types.Tuple.from_types(sig.args) + # Make signature T(TypeRef[T], *args) where T is cls + sig = typing.signature(cls, types.TypeRef(cls), ctor_args) + if len(ctor_args) > 0: + args = (context.get_dummy_value(), # Type object has no runtime repr. + context.make_tuple(builder, ctor_args, args)) + else: + args = (context.get_dummy_value(), # Type object has no runtime repr. + context.make_tuple(builder, ctor_args, ())) + + return context.compile_internal(builder, call_ctor, sig, args) + + +@overload(sum) +def ol_sum(iterable, start=0): + # Cpython explicitly rejects strings, bytes and bytearrays + # https://github.com/python/cpython/blob/3.9/Python/bltinmodule.c#L2310-L2329 # noqa: E501 + error = None + if isinstance(start, types.UnicodeType): + error = ('strings', '') + elif isinstance(start, types.Bytes): + error = ('bytes', 'b') + elif isinstance(start, types.ByteArray): + error = ('bytearray', 'b') + + if error is not None: + msg = "sum() can't sum {} [use {}''.join(seq) instead]".format(*error) + raise TypingError(msg) + + # if the container is homogeneous then it's relatively easy to handle. + if isinstance(iterable, (types.containers._HomogeneousTuple, types.List, + types.ListType, types.Array, types.RangeType)): + iterator = iter + elif isinstance(iterable, (types.containers._HeterogeneousTuple)): + # if container is heterogeneous then literal unroll and hope for the + # best. + iterator = literal_unroll + else: + return None + + def impl(iterable, start=0): + acc = start + for x in iterator(iterable): + # This most likely widens the type, this is expected Numba behaviour + acc = acc + x + return acc + return impl + + +# ------------------------------------------------------------------------------ +# map, filter, reduce + + +@overload(map) +def ol_map(func, iterable, *args): + def impl(func, iterable, *args): + for x in zip(iterable, *args): + yield func(*x) + return impl + + +@overload(filter) +def ol_filter(func, iterable): + if (func is None) or isinstance(func, types.NoneType): + def impl(func, iterable): + for x in iterable: + if x: + yield x + else: + def impl(func, iterable): + for x in iterable: + if func(x): + yield x + return impl + + +@overload(isinstance) +def ol_isinstance(var, typs): + + def true_impl(var, typs): + return True + + def false_impl(var, typs): + return False + + var_ty = as_numba_type(var) + + if isinstance(var_ty, types.Optional): + msg = f'isinstance cannot handle optional types. Found: "{var_ty}"' + raise NumbaTypeError(msg) + + # NOTE: The current implementation of `isinstance` restricts the type of the + # instance variable to types that are well known and in common use. The + # danger of unrestricted type comparison is that a "default" of `False` is + # required and this means that if there is a bug in the logic of the + # comparison tree `isinstance` returns False! It's therefore safer to just + # reject the compilation as untypable! + supported_var_ty = (types.Number, types.Bytes, types.RangeType, + types.DictType, types.LiteralStrKeyDict, types.List, + types.ListType, types.Tuple, types.UniTuple, types.Set, + types.Function, types.ClassType, types.UnicodeType, + types.ClassInstanceType, types.NoneType, types.Array, + types.Boolean, types.Float, types.UnicodeCharSeq, + types.Complex, types.NPDatetime, types.NPTimedelta,) + if not isinstance(var_ty, supported_var_ty): + msg = f'isinstance() does not support variables of type "{var_ty}".' + raise NumbaTypeError(msg) + + t_typs = typs + + # Check the types that the var can be an instance of, it'll be a scalar, + # a unituple or a tuple. + if isinstance(t_typs, types.UniTuple): + # corner case - all types in isinstance are the same + t_typs = (t_typs.key[0]) + + if not isinstance(t_typs, types.Tuple): + t_typs = (t_typs, ) + + for typ in t_typs: + + if isinstance(typ, types.Function): + key = typ.key[0] # functions like int(..), float(..), str(..) + elif isinstance(typ, types.ClassType): + key = typ # jitclasses + else: + key = typ.key + + # corner cases for bytes, range, ... + # avoid registering those types on `as_numba_type` + types_not_registered = { + bytes: types.Bytes, + range: types.RangeType, + dict: (types.DictType, types.LiteralStrKeyDict), + list: types.List, + tuple: types.BaseTuple, + set: types.Set, + } + if key in types_not_registered: + if isinstance(var_ty, types_not_registered[key]): + return true_impl + continue + + if isinstance(typ, types.TypeRef): + # Use of Numba type classes is in general not supported as they do + # not work when the jit is disabled. + if key not in (types.ListType, types.DictType): + msg = ("Numba type classes (except numba.typed.* container " + "types) are not supported.") + raise NumbaTypeError(msg) + # Case for TypeRef (i.e. isinstance(var, typed.List)) + # var_ty == ListType[int64] (instance) + # typ == types.ListType (class) + return true_impl if type(var_ty) is key else false_impl + else: + numba_typ = as_numba_type(key) + if var_ty == numba_typ: + return true_impl + elif isinstance(numba_typ, (types.NPDatetime, types.NPTimedelta)): + if isinstance(var_ty, type(numba_typ)): + return true_impl + elif isinstance(numba_typ, types.ClassType) and \ + isinstance(var_ty, types.ClassInstanceType) and \ + var_ty.key == numba_typ.instance_type.key: + # check for jitclasses + return true_impl + elif isinstance(numba_typ, types.Container) and \ + numba_typ.key[0] == types.undefined: + # check for containers (list, tuple, set, ...) + if isinstance(var_ty, numba_typ.__class__) or \ + (isinstance(var_ty, types.BaseTuple) and \ + isinstance(numba_typ, types.BaseTuple)): + return true_impl + + return false_impl + + +# -- getattr implementation + +def _getattr_raise_attr_exc(obj, name): + # Dummy function for the purpose of creating an overloadable stub from + # which to raise an AttributeError as needed + pass + + +@overload(_getattr_raise_attr_exc) +def ol__getattr_raise_attr_exc(obj, name): + if not isinstance(name, types.StringLiteral): + raise RequireLiteralValue("argument 'name' must be a literal string") + lname = name.literal_value + message = f"'{obj}' has no attribute '{lname}'" + + def impl(obj, name): + raise AttributeError(message) + return impl + + +@intrinsic +def resolve_getattr(tyctx, obj, name, default): + if not isinstance(name, types.StringLiteral): + raise RequireLiteralValue("argument 'name' must be a literal string") + lname = name.literal_value + fn = tyctx.resolve_getattr(obj, lname) + # Cannot handle things like `getattr(np, 'cos')` as the return type is + # types.Function. + if isinstance(fn, types.Function): + msg = ("Returning function objects is not implemented. " + f"getattr() was requested to return {fn} from attribute " + f"'{lname}' of {obj}.") + raise TypingError(msg) + + if fn is None: # No attribute + + # if default is not _getattr_default then return the default + if not (isinstance(default, types.NamedTuple) and + default.instance_class == _getattr_default_type): + # it's not the marker default value, so return it + sig = default(obj, name, default) + def impl(cgctx, builder, sig, llargs): + tmp = llargs[-1] + cgctx.nrt.incref(builder, default, tmp) + return tmp + else: + # else wire in raising an AttributeError + fnty = tyctx.resolve_value_type(_getattr_raise_attr_exc) + raise_sig = fnty.get_call_type(tyctx, (obj, name), {}) + sig = types.none(obj, name, default) + def impl(cgctx, builder, sig, llargs): + native_impl = cgctx.get_function(fnty, raise_sig) + return native_impl(builder, llargs[:-1]) + + else: # Attribute present, wire in handing it back to the overload(getattr) + sig = fn(obj, name, default) + if isinstance(fn, types.BoundFunction): + # It's a method on an object + def impl(cgctx, builder, sig, ll_args): + cast_type = fn.this + casted = cgctx.cast(builder, ll_args[0], obj, cast_type) + res = cgctx.get_bound_function(builder, casted, cast_type) + cgctx.nrt.incref(builder, fn, res) + return res + else: + # Else it's some other type of attribute. + # Ensure typing calls occur at typing time, not at lowering + attrty = tyctx.resolve_getattr(obj, lname) + def impl(cgctx, builder, sig, ll_args): + attr_impl = cgctx.get_getattr(obj, lname) + res = attr_impl(cgctx, builder, obj, ll_args[0], lname) + casted = cgctx.cast(builder, res, attrty, fn) + cgctx.nrt.incref(builder, fn, casted) + return casted + return sig, impl + + +# These are marker objects to indicate "no default has been provided" in a call +_getattr_default_type = namedtuple('_getattr_default_type', '') +_getattr_default = _getattr_default_type() + + +# getattr with no default arg, obj is an open type and name is forced as a +# literal string. The _getattr_default marker is used to indicate "no default +# was provided". +@overload(getattr, prefer_literal=True) +def ol_getattr_2(obj, name): + def impl(obj, name): + return resolve_getattr(obj, name, _getattr_default) + return impl + + +# getattr with default arg present, obj is an open type, name is forced as a +# literal string, the "default" is again an open type. Note that the CPython +# definition is: `getattr(object, name[, default]) -> value`, the `default` +# is not a kwarg. +@overload(getattr) +def ol_getattr_3(obj, name, default): + def impl(obj, name, default): + return resolve_getattr(obj, name, default) + return impl + + +@intrinsic +def resolve_hasattr(tyctx, obj, name): + if not isinstance(name, types.StringLiteral): + raise RequireLiteralValue("argument 'name' must be a literal string") + lname = name.literal_value + fn = tyctx.resolve_getattr(obj, lname) + # Whilst technically the return type could be a types.bool_, the literal + # value is resolvable at typing time. Propagating this literal information + # into the type system allows the compiler to prune branches based on a + # hasattr predicate. As a result the signature is based on literals. This is + # "safe" because the overload requires a literal string so each will be a + # different variant of (obj, literal(name)) -> literal(bool). + if fn is None: + retty = types.literal(False) + else: + retty = types.literal(True) + sig = retty(obj, name) + def impl(cgctx, builder, sig, ll_args): + return cgutils.false_bit if fn is None else cgutils.true_bit + return sig, impl + +# hasattr cannot be implemented as a getattr call and then catching +# AttributeError because Numba doesn't support catching anything other than +# "Exception", so lacks the specificity required. Instead this implementation +# tries to resolve the attribute via typing information and returns True/False +# based on that. +@overload(hasattr) +def ol_hasattr(obj, name): + def impl(obj, name): + return resolve_hasattr(obj, name) + return impl + + +@overload(repr) +def ol_repr_generic(obj): + missing_repr_format = f"" + def impl(obj): + attr = '__repr__' + if hasattr(obj, attr) == True: + return getattr(obj, attr)() + else: + # There's no __str__ or __repr__ defined for this object, return + # something generic + return missing_repr_format + return impl + + +@overload(str) +def ol_str_generic(object=''): + def impl(object=""): + attr = '__str__' + if hasattr(object, attr) == True: + return getattr(object, attr)() + else: + return repr(object) + return impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_hashing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_hashing.py new file mode 100644 index 0000000000000000000000000000000000000000..836d1616a2a49e291321fce0823492cc48e33273 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_hashing.py @@ -0,0 +1,743 @@ +""" +Hash implementations for Numba types +""" + +import math +import numpy as np +import sys +import ctypes +import warnings +from collections import namedtuple + +import llvmlite.binding as ll +from llvmlite import ir + +from numba import literal_unroll +from numba.core.extending import ( + overload, overload_method, intrinsic, register_jitable) +from numba.core import errors +from numba.core import types +from numba.core.unsafe.bytes import grab_byte, grab_uint64_t +from numba.cpython.randomimpl import (const_int, get_next_int, get_next_int32, + get_state_ptr) + +# This is Py_hash_t, which is a Py_ssize_t, which has sizeof(size_t): +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Include/pyport.h#L91-L96 # noqa: E501 +_hash_width = sys.hash_info.width +_Py_hash_t = getattr(types, 'int%s' % _hash_width) +_Py_uhash_t = getattr(types, 'uint%s' % _hash_width) + +# Constants from CPython source, obtained by various means: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Include/pyhash.h # noqa: E501 +_PyHASH_INF = sys.hash_info.inf +_PyHASH_NAN = sys.hash_info.nan +_PyHASH_MODULUS = _Py_uhash_t(sys.hash_info.modulus) +_PyHASH_BITS = 31 if types.intp.bitwidth == 32 else 61 # mersenne primes +_PyHASH_MULTIPLIER = 0xf4243 # 1000003UL +_PyHASH_IMAG = _PyHASH_MULTIPLIER +_PyLong_SHIFT = sys.int_info.bits_per_digit +_Py_HASH_CUTOFF = sys.hash_info.cutoff +_Py_hashfunc_name = sys.hash_info.algorithm + + +# This stub/overload pair are used to force branch pruning to remove the dead +# branch based on the potential `None` type of the hash_func which works better +# if the predicate for the prune in an ir.Arg. The obj is an arg to allow for +# a custom error message. +def _defer_hash(hash_func): + pass + + +@overload(_defer_hash) +def ol_defer_hash(obj, hash_func): + err_msg = f"unhashable type: '{obj}'" + + def impl(obj, hash_func): + if hash_func is None: + raise TypeError(err_msg) + else: + return hash_func() + return impl + + +# hash(obj) is implemented by calling obj.__hash__() +@overload(hash) +def hash_overload(obj): + attempt_generic_msg = ("No __hash__ is defined for object of type " + f"'{obj}' and a generic hash() cannot be " + "performed as there is no suitable object " + "represention in Numba compiled code!") + + def impl(obj): + if hasattr(obj, '__hash__'): + return _defer_hash(obj, getattr(obj, '__hash__')) + else: + raise TypeError(attempt_generic_msg) + return impl + + +@register_jitable +def process_return(val): + asint = _Py_hash_t(val) + if (asint == int(-1)): + asint = int(-2) + return asint + + +# This is a translation of CPython's _Py_HashDouble: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Python/pyhash.c#L34-L129 # noqa: E501 +# NOTE: In Python 3.10 hash of nan is now hash of the pointer to the PyObject +# containing said nan. Numba cannot replicate this as there is no object, so it +# elects to replicate the behaviour i.e. hash of nan is something "unique" which +# satisfies https://bugs.python.org/issue43475. + +@register_jitable(locals={'x': _Py_uhash_t, + 'y': _Py_uhash_t, + 'm': types.double, + 'e': types.intc, + 'sign': types.intc, + '_PyHASH_MODULUS': _Py_uhash_t, + '_PyHASH_BITS': types.intc}) +def _Py_HashDouble(v): + if not np.isfinite(v): + if (np.isinf(v)): + if (v > 0): + return _PyHASH_INF + else: + return -_PyHASH_INF + else: + # Python 3.10 does not use `_PyHASH_NAN`. + # https://github.com/python/cpython/blob/2c4792264f9218692a1bd87398a60591f756b171/Python/pyhash.c#L102 # noqa: E501 + # Numba returns a pseudo-random number to reflect the spirit of the + # change. + x = _prng_random_hash() + return process_return(x) + + m, e = math.frexp(v) + + sign = 1 + if (m < 0): + sign = -1 + m = -m + + # process 28 bits at a time; this should work well both for binary + # and hexadecimal floating point. + x = 0 + while (m): + x = ((x << 28) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - 28) + m *= 268435456.0 # /* 2**28 */ + e -= 28 + y = int(m) # /* pull out integer part */ + m -= y + x += y + if x >= _PyHASH_MODULUS: + x -= _PyHASH_MODULUS + # /* adjust for the exponent; first reduce it modulo _PyHASH_BITS */ + if e >= 0: + e = e % _PyHASH_BITS + else: + e = _PyHASH_BITS - 1 - ((-1 - e) % _PyHASH_BITS) + + x = ((x << e) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - e) + + x = x * sign + return process_return(x) + + +@intrinsic +def _fpext(tyctx, val): + def impl(cgctx, builder, signature, args): + val = args[0] + return builder.fpext(val, ir.DoubleType()) + sig = types.float64(types.float32) + return sig, impl + + +@intrinsic +def _prng_random_hash(tyctx): + + def impl(cgctx, builder, signature, args): + state_ptr = get_state_ptr(cgctx, builder, "internal") + bits = const_int(_hash_width) + + # Why not just use get_next_int() with the correct bitwidth? + # get_next_int() always returns an i64, because the bitwidth it is + # passed may not be a compile-time constant, so it needs to allocate + # the largest unit of storage that may be required. Therefore, if the + # hash width is 32, then we need to use get_next_int32() to ensure we + # don't return a wider-than-expected hash, even if everything above + # the low 32 bits would have been zero. + if _hash_width == 32: + value = get_next_int32(cgctx, builder, state_ptr) + else: + value = get_next_int(cgctx, builder, state_ptr, bits, False) + + return value + + sig = _Py_hash_t() + return sig, impl + + +# This is a translation of CPython's long_hash, but restricted to the numerical +# domain reachable by int64/uint64 (i.e. no BigInt like support): +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Objects/longobject.c#L2934-L2989 # noqa: E501 +# obdigit is a uint32_t which is typedef'd to digit +# int32_t is typedef'd to sdigit + + +@register_jitable(locals={'x': _Py_uhash_t, + 'p1': _Py_uhash_t, + 'p2': _Py_uhash_t, + 'p3': _Py_uhash_t, + 'p4': _Py_uhash_t, + '_PyHASH_MODULUS': _Py_uhash_t, + '_PyHASH_BITS': types.int32, + '_PyLong_SHIFT': types.int32,}) +def _long_impl(val): + # This function assumes val came from a long int repr with val being a + # uint64_t this means having to split the input into PyLong_SHIFT size + # chunks in an unsigned hash wide type, max numba can handle is a 64bit int + + # mask to select low _PyLong_SHIFT bits + _tmp_shift = 32 - _PyLong_SHIFT + mask_shift = (~types.uint32(0x0)) >> _tmp_shift + + # a 64bit wide max means Numba only needs 3 x 30 bit values max, + # or 5 x 15 bit values max on 32bit platforms + i = (64 // _PyLong_SHIFT) + 1 + + # alg as per hash_long + x = 0 + p3 = (_PyHASH_BITS - _PyLong_SHIFT) + for idx in range(i - 1, -1, -1): + p1 = x << _PyLong_SHIFT + p2 = p1 & _PyHASH_MODULUS + p4 = x >> p3 + x = p2 | p4 + # the shift and mask splits out the `ob_digit` parts of a Long repr + x += types.uint32((val >> idx * _PyLong_SHIFT) & mask_shift) + if x >= _PyHASH_MODULUS: + x -= _PyHASH_MODULUS + return _Py_hash_t(x) + + +# This has no CPython equivalent, CPython uses long_hash. +@overload_method(types.Integer, '__hash__') +@overload_method(types.Boolean, '__hash__') +def int_hash(val): + + _HASH_I64_MIN = -2 if sys.maxsize <= 2 ** 32 else -4 + _SIGNED_MIN = types.int64(-0x8000000000000000) + + # Find a suitable type to hold a "big" value, i.e. iinfo(ty).min/max + # this is to ensure e.g. int32.min is handled ok as it's abs() is its value + _BIG = types.int64 if getattr(val, 'signed', False) else types.uint64 + + # this is a bit involved due to the CPython repr of ints + def impl(val): + # If the magnitude is under PyHASH_MODULUS, just return the + # value val as the hash, couple of special cases if val == val: + # 1. it's 0, in which case return 0 + # 2. it's signed int minimum value, return the value CPython computes + # but Numba cannot as there's no type wide enough to hold the shifts. + # + # If the magnitude is greater than PyHASH_MODULUS then... if the value + # is negative then negate it switch the sign on the hash once computed + # and use the standard wide unsigned hash implementation + val = _BIG(val) + mag = abs(val) + if mag < _PyHASH_MODULUS: + if val == 0: + ret = 0 + elif val == _SIGNED_MIN: # e.g. int64 min, -0x8000000000000000 + ret = _Py_hash_t(_HASH_I64_MIN) + else: + ret = _Py_hash_t(val) + else: + needs_negate = False + if val < 0: + val = -val + needs_negate = True + ret = _long_impl(val) + if needs_negate: + ret = -ret + return process_return(ret) + return impl + +# This is a translation of CPython's float_hash: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Objects/floatobject.c#L528-L532 # noqa: E501 + + +@overload_method(types.Float, '__hash__') +def float_hash(val): + if val.bitwidth == 64: + def impl(val): + hashed = _Py_HashDouble(val) + return hashed + else: + def impl(val): + # widen the 32bit float to 64bit + fpextended = np.float64(_fpext(val)) + hashed = _Py_HashDouble(fpextended) + return hashed + return impl + +# This is a translation of CPython's complex_hash: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Objects/complexobject.c#L408-L428 # noqa: E501 + + +@overload_method(types.Complex, '__hash__') +def complex_hash(val): + def impl(val): + hashreal = hash(val.real) + hashimag = hash(val.imag) + # Note: if the imaginary part is 0, hashimag is 0 now, + # so the following returns hashreal unchanged. This is + # important because numbers of different types that + # compare equal must have the same hash value, so that + # hash(x + 0*j) must equal hash(x). + combined = hashreal + _PyHASH_IMAG * hashimag + return process_return(combined) + return impl + + +# Python 3.8 strengthened its hash alg for tuples. +# This is a translation of CPython's tuplehash for Python >=3.8 +# https://github.com/python/cpython/blob/b738237d6792acba85b1f6e6c8993a812c7fd815/Objects/tupleobject.c#L338-L391 # noqa: E501 + +# These consts are needed for this alg variant, they are from: +# https://github.com/python/cpython/blob/b738237d6792acba85b1f6e6c8993a812c7fd815/Objects/tupleobject.c#L353-L363 # noqa: E501 +if _Py_uhash_t.bitwidth // 8 > 4: + _PyHASH_XXPRIME_1 = _Py_uhash_t(11400714785074694791) + _PyHASH_XXPRIME_2 = _Py_uhash_t(14029467366897019727) + _PyHASH_XXPRIME_5 = _Py_uhash_t(2870177450012600261) + + @register_jitable(locals={'x': types.uint64}) + def _PyHASH_XXROTATE(x): + # Rotate left 31 bits + return ((x << types.uint64(31)) | (x >> types.uint64(33))) +else: + _PyHASH_XXPRIME_1 = _Py_uhash_t(2654435761) + _PyHASH_XXPRIME_2 = _Py_uhash_t(2246822519) + _PyHASH_XXPRIME_5 = _Py_uhash_t(374761393) + + @register_jitable(locals={'x': types.uint64}) + def _PyHASH_XXROTATE(x): + # Rotate left 13 bits + return ((x << types.uint64(13)) | (x >> types.uint64(19))) + + +@register_jitable(locals={'acc': _Py_uhash_t, 'lane': _Py_uhash_t, + '_PyHASH_XXPRIME_5': _Py_uhash_t, + '_PyHASH_XXPRIME_1': _Py_uhash_t, + 'tl': _Py_uhash_t}) +def _tuple_hash(tup): + tl = len(tup) + acc = _PyHASH_XXPRIME_5 + for x in literal_unroll(tup): + lane = hash(x) + if lane == _Py_uhash_t(-1): + return -1 + acc += lane * _PyHASH_XXPRIME_2 + acc = _PyHASH_XXROTATE(acc) + acc *= _PyHASH_XXPRIME_1 + + acc += tl ^ (_PyHASH_XXPRIME_5 ^ _Py_uhash_t(3527539)) + + if acc == _Py_uhash_t(-1): + return process_return(1546275796) + + return process_return(acc) + + +@overload_method(types.BaseTuple, '__hash__') +def tuple_hash(val): + def impl(val): + return _tuple_hash(val) + return impl + + +# ------------------------------------------------------------------------------ +# String/bytes hashing needs hashseed info, this is from: +# https://stackoverflow.com/a/41088757 +# with thanks to Martijn Pieters +# +# Developer note: +# CPython makes use of an internal "hashsecret" which is essentially a struct +# containing some state that is set on CPython initialization and contains magic +# numbers used particularly in unicode/string hashing. This code binds to the +# Python runtime libraries in use by the current process and reads the +# "hashsecret" state so that it can be used by Numba. As this is done at runtime +# the behaviour and influence of the PYTHONHASHSEED environment variable is +# accommodated. + +from ctypes import ( # noqa + c_size_t, + c_ubyte, + c_uint64, + pythonapi, + Structure, + Union, +) # noqa + + +class FNV(Structure): + _fields_ = [ + ('prefix', c_size_t), + ('suffix', c_size_t) + ] + + +class SIPHASH(Structure): + _fields_ = [ + ('k0', c_uint64), + ('k1', c_uint64), + ] + + +class DJBX33A(Structure): + _fields_ = [ + ('padding', c_ubyte * 16), + ('suffix', c_size_t), + ] + + +class EXPAT(Structure): + _fields_ = [ + ('padding', c_ubyte * 16), + ('hashsalt', c_size_t), + ] + + +class _Py_HashSecret_t(Union): + _fields_ = [ + # ensure 24 bytes + ('uc', c_ubyte * 24), + # two Py_hash_t for FNV + ('fnv', FNV), + # two uint64 for SipHash24 + ('siphash', SIPHASH), + # a different (!) Py_hash_t for small string optimization + ('djbx33a', DJBX33A), + ('expat', EXPAT), + ] + + +_hashsecret_entry = namedtuple('_hashsecret_entry', ['symbol', 'value']) + + +# Only a few members are needed at present +def _build_hashsecret(): + """Read hash secret from the Python process + + Returns + ------- + info : dict + - keys are "djbx33a_suffix", "siphash_k0", siphash_k1". + - values are the namedtuple[symbol:str, value:int] + """ + # Read hashsecret and inject it into the LLVM symbol map under the + # prefix `_numba_hashsecret_`. + pyhashsecret = _Py_HashSecret_t.in_dll(pythonapi, '_Py_HashSecret') + info = {} + + def inject(name, val): + symbol_name = "_numba_hashsecret_{}".format(name) + val = ctypes.c_uint64(val) + addr = ctypes.addressof(val) + ll.add_symbol(symbol_name, addr) + info[name] = _hashsecret_entry(symbol=symbol_name, value=val) + + inject('djbx33a_suffix', pyhashsecret.djbx33a.suffix) + inject('siphash_k0', pyhashsecret.siphash.k0) + inject('siphash_k1', pyhashsecret.siphash.k1) + return info + + +_hashsecret = _build_hashsecret() + + +# ------------------------------------------------------------------------------ + + +if _Py_hashfunc_name in ('siphash13', 'siphash24', 'fnv'): + + # Check for use of the FNV hashing alg, warn users that it's not implemented + # and functionality relying of properties derived from hashing will be fine + # but hash values themselves are likely to be different. + if _Py_hashfunc_name == 'fnv': + msg = ("FNV hashing is not implemented in Numba. See PEP 456 " + "https://www.python.org/dev/peps/pep-0456/ " + "for rationale over not using FNV. Numba will continue to work, " + "but hashes for built in types will be computed using " + "siphash24. This will permit e.g. dictionaries to continue to " + "behave as expected, however anything relying on the value of " + "the hash opposed to hash as a derived property is likely to " + "not work as expected.") + warnings.warn(msg) + + # This is a translation of CPython's siphash24 function: + # https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Python/pyhash.c#L287-L413 # noqa: E501 + # and also, since Py 3.11, a translation of CPython's siphash13 function: + # https://github.com/python/cpython/blob/9dda9020abcf0d51d59b283a89c58c8e1fb0f574/Python/pyhash.c#L376-L424 + # the only differences are in the use of SINGLE_ROUND in siphash13 vs. + # DOUBLE_ROUND in siphash24, and that siphash13 has an extra "ROUND" applied + # just before the final XORing of components to create the return value. + + # /* ********************************************************************* + # + # Copyright (c) 2013 Marek Majkowski + + # Permission is hereby granted, free of charge, to any person obtaining a + # copy of this software and associated documentation files (the "Software"), + # to deal in the Software without restriction, including without limitation + # the rights to use, copy, modify, merge, publish, distribute, sublicense, + # and/or sell copies of the Software, and to permit persons to whom the + # Software is furnished to do so, subject to the following conditions: + + # The above copyright notice and this permission notice shall be included in + # all copies or substantial portions of the Software. + + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + # DEALINGS IN THE SOFTWARE. + # + + # Original location: + # https://github.com/majek/csiphash/ + + # Solution inspired by code from: + # Samuel Neves (supercop/crypto_auth/siphash24/little) + #djb (supercop/crypto_auth/siphash24/little2) + # Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c) + + # Modified for Python by Christian Heimes: + # - C89 / MSVC compatibility + # - _rotl64() on Windows + # - letoh64() fallback + # */ + + @register_jitable(locals={'x': types.uint64, + 'b': types.uint64, }) + def _ROTATE(x, b): + return types.uint64(((x) << (b)) | ((x) >> (types.uint64(64) - (b)))) + + @register_jitable(locals={'a': types.uint64, + 'b': types.uint64, + 'c': types.uint64, + 'd': types.uint64, + 's': types.uint64, + 't': types.uint64, }) + def _HALF_ROUND(a, b, c, d, s, t): + a += b + c += d + b = _ROTATE(b, s) ^ a + d = _ROTATE(d, t) ^ c + a = _ROTATE(a, 32) + return a, b, c, d + + @register_jitable(locals={'v0': types.uint64, + 'v1': types.uint64, + 'v2': types.uint64, + 'v3': types.uint64, }) + def _SINGLE_ROUND(v0, v1, v2, v3): + v0, v1, v2, v3 = _HALF_ROUND(v0, v1, v2, v3, 13, 16) + v2, v1, v0, v3 = _HALF_ROUND(v2, v1, v0, v3, 17, 21) + return v0, v1, v2, v3 + + @register_jitable(locals={'v0': types.uint64, + 'v1': types.uint64, + 'v2': types.uint64, + 'v3': types.uint64, }) + def _DOUBLE_ROUND(v0, v1, v2, v3): + v0, v1, v2, v3 = _SINGLE_ROUND(v0, v1, v2, v3) + v0, v1, v2, v3 = _SINGLE_ROUND(v0, v1, v2, v3) + return v0, v1, v2, v3 + + def _gen_siphash(alg): + if alg == 'siphash13': + _ROUNDER = _SINGLE_ROUND + _EXTRA_ROUND = True + elif alg == 'siphash24': + _ROUNDER = _DOUBLE_ROUND + _EXTRA_ROUND = False + else: + assert 0, 'unreachable' + + @register_jitable(locals={'v0': types.uint64, + 'v1': types.uint64, + 'v2': types.uint64, + 'v3': types.uint64, + 'b': types.uint64, + 'mi': types.uint64, + 't': types.uint64, + 'mask': types.uint64, + 'jmp': types.uint64, + 'ohexefef': types.uint64}) + def _siphash(k0, k1, src, src_sz): + b = types.uint64(src_sz) << 56 + v0 = k0 ^ types.uint64(0x736f6d6570736575) + v1 = k1 ^ types.uint64(0x646f72616e646f6d) + v2 = k0 ^ types.uint64(0x6c7967656e657261) + v3 = k1 ^ types.uint64(0x7465646279746573) + + idx = 0 + while (src_sz >= 8): + mi = grab_uint64_t(src, idx) + idx += 1 + src_sz -= 8 + v3 ^= mi + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + v0 ^= mi + + # this is the switch fallthrough: + # https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Python/pyhash.c#L390-L400 # noqa: E501 + t = types.uint64(0x0) + boffset = idx * 8 + ohexefef = types.uint64(0xff) + if src_sz >= 7: + jmp = (6 * 8) + mask = ~types.uint64(ohexefef << jmp) + t = (t & mask) | (types.uint64(grab_byte(src, boffset + 6)) + << jmp) + if src_sz >= 6: + jmp = (5 * 8) + mask = ~types.uint64(ohexefef << jmp) + t = (t & mask) | (types.uint64(grab_byte(src, boffset + 5)) + << jmp) + if src_sz >= 5: + jmp = (4 * 8) + mask = ~types.uint64(ohexefef << jmp) + t = (t & mask) | (types.uint64(grab_byte(src, boffset + 4)) + << jmp) + if src_sz >= 4: + t &= types.uint64(0xffffffff00000000) + for i in range(4): + jmp = i * 8 + mask = ~types.uint64(ohexefef << jmp) + t = (t & mask) | (types.uint64(grab_byte(src, boffset + i)) + << jmp) + if src_sz >= 3: + jmp = (2 * 8) + mask = ~types.uint64(ohexefef << jmp) + t = (t & mask) | (types.uint64(grab_byte(src, boffset + 2)) + << jmp) + if src_sz >= 2: + jmp = (1 * 8) + mask = ~types.uint64(ohexefef << jmp) + t = (t & mask) | (types.uint64(grab_byte(src, boffset + 1)) + << jmp) + if src_sz >= 1: + mask = ~(ohexefef) + t = (t & mask) | (types.uint64(grab_byte(src, boffset + 0))) + + b |= t + v3 ^= b + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + v0 ^= b + v2 ^= ohexefef + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + if _EXTRA_ROUND: + v0, v1, v2, v3 = _ROUNDER(v0, v1, v2, v3) + t = (v0 ^ v1) ^ (v2 ^ v3) + return t + + return _siphash + + _siphash13 = _gen_siphash('siphash13') + _siphash24 = _gen_siphash('siphash24') + + _siphasher = _siphash13 if _Py_hashfunc_name == 'siphash13' else _siphash24 + +else: + msg = "Unsupported hashing algorithm in use %s" % _Py_hashfunc_name + raise ValueError(msg) + + +@intrinsic +def _inject_hashsecret_read(tyctx, name): + """Emit code to load the hashsecret. + """ + if not isinstance(name, types.StringLiteral): + raise errors.TypingError("requires literal string") + + sym = _hashsecret[name.literal_value].symbol + resty = types.uint64 + sig = resty(name) + + def impl(cgctx, builder, sig, args): + mod = builder.module + try: + # Search for existing global + gv = mod.get_global(sym) + except KeyError: + # Inject the symbol if not already exist. + gv = ir.GlobalVariable(mod, ir.IntType(64), name=sym) + v = builder.load(gv) + return v + + return sig, impl + + +def _load_hashsecret(name): + return _hashsecret[name].value + + +@overload(_load_hashsecret) +def _impl_load_hashsecret(name): + def imp(name): + return _inject_hashsecret_read(name) + return imp + + +# This is a translation of CPythons's _Py_HashBytes: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Python/pyhash.c#L145-L191 # noqa: E501 + + +@register_jitable(locals={'_hash': _Py_uhash_t}) +def _Py_HashBytes(val, _len): + if (_len == 0): + return process_return(0) + + if (_len < _Py_HASH_CUTOFF): + # TODO: this branch needs testing, needs a CPython setup for it! + # /* Optimize hashing of very small strings with inline DJBX33A. */ + _hash = _Py_uhash_t(5381) # /* DJBX33A starts with 5381 */ + for idx in range(_len): + _hash = ((_hash << 5) + _hash) + np.uint8(grab_byte(val, idx)) + + _hash ^= _len + _hash ^= _load_hashsecret('djbx33a_suffix') + else: + tmp = _siphasher(types.uint64(_load_hashsecret('siphash_k0')), + types.uint64(_load_hashsecret('siphash_k1')), + val, _len) + _hash = process_return(tmp) + return process_return(_hash) + +# This is an approximate translation of CPython's unicode_hash: +# https://github.com/python/cpython/blob/d1dd6be613381b996b9071443ef081de8e5f3aff/Objects/unicodeobject.c#L11635-L11663 # noqa: E501 + + +@overload_method(types.UnicodeType, '__hash__') +def unicode_hash(val): + from numba.cpython.unicode import _kind_to_byte_width + + def impl(val): + kindwidth = _kind_to_byte_width(val._kind) + _len = len(val) + # use the cache if possible + current_hash = val._hash + if current_hash != -1: + return current_hash + else: + # cannot write hash value to cache in the unicode struct due to + # pass by value on the struct making the struct member immutable + return _Py_HashBytes(val._data, kindwidth * _len) + + return impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_mathimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_mathimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..bd1d6a3405615c7d89537b3b172ac75078f00ffd --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_mathimpl.py @@ -0,0 +1,469 @@ +""" +Provide math calls that uses intrinsics or libc math functions. +""" + +import math +import operator +import sys +import numpy as np + +import llvmlite.ir +from llvmlite.ir import Constant + +from numba.core.imputils import Registry, impl_ret_untracked +from numba import typeof +from numba.core import types, utils, config, cgutils +from numba.core.extending import overload +from numba.core.typing import signature +from numba.cpython.unsafe.numbers import trailing_zeros + + +registry = Registry('mathimpl') +lower = registry.lower + + +# Helpers, shared with cmathimpl. +_NP_FLT_FINFO = np.finfo(np.dtype('float32')) +FLT_MAX = _NP_FLT_FINFO.max +FLT_MIN = _NP_FLT_FINFO.tiny + +_NP_DBL_FINFO = np.finfo(np.dtype('float64')) +DBL_MAX = _NP_DBL_FINFO.max +DBL_MIN = _NP_DBL_FINFO.tiny + +FLOAT_ABS_MASK = 0x7fffffff +FLOAT_SIGN_MASK = 0x80000000 +DOUBLE_ABS_MASK = 0x7fffffffffffffff +DOUBLE_SIGN_MASK = 0x8000000000000000 + + +def is_nan(builder, val): + """ + Return a condition testing whether *val* is a NaN. + """ + return builder.fcmp_unordered('uno', val, val) + +def is_inf(builder, val): + """ + Return a condition testing whether *val* is an infinite. + """ + pos_inf = Constant(val.type, float("+inf")) + neg_inf = Constant(val.type, float("-inf")) + isposinf = builder.fcmp_ordered('==', val, pos_inf) + isneginf = builder.fcmp_ordered('==', val, neg_inf) + return builder.or_(isposinf, isneginf) + +def is_finite(builder, val): + """ + Return a condition testing whether *val* is a finite. + """ + # is_finite(x) <=> x - x != NaN + val_minus_val = builder.fsub(val, val) + return builder.fcmp_ordered('ord', val_minus_val, val_minus_val) + +def f64_as_int64(builder, val): + """ + Bitcast a double into a 64-bit integer. + """ + assert val.type == llvmlite.ir.DoubleType() + return builder.bitcast(val, llvmlite.ir.IntType(64)) + +def int64_as_f64(builder, val): + """ + Bitcast a 64-bit integer into a double. + """ + assert val.type == llvmlite.ir.IntType(64) + return builder.bitcast(val, llvmlite.ir.DoubleType()) + +def f32_as_int32(builder, val): + """ + Bitcast a float into a 32-bit integer. + """ + assert val.type == llvmlite.ir.FloatType() + return builder.bitcast(val, llvmlite.ir.IntType(32)) + +def int32_as_f32(builder, val): + """ + Bitcast a 32-bit integer into a float. + """ + assert val.type == llvmlite.ir.IntType(32) + return builder.bitcast(val, llvmlite.ir.FloatType()) + +def negate_real(builder, val): + """ + Negate real number *val*, with proper handling of zeros. + """ + # The negative zero forces LLVM to handle signed zeros properly. + return builder.fsub(Constant(val.type, -0.0), val) + +def call_fp_intrinsic(builder, name, args): + """ + Call a LLVM intrinsic floating-point operation. + """ + mod = builder.module + intr = mod.declare_intrinsic(name, [a.type for a in args]) + return builder.call(intr, args) + + +def _unary_int_input_wrapper_impl(wrapped_impl): + """ + Return an implementation factory to convert the single integral input + argument to a float64, then defer to the *wrapped_impl*. + """ + def implementer(context, builder, sig, args): + val, = args + input_type = sig.args[0] + fpval = context.cast(builder, val, input_type, types.float64) + inner_sig = signature(types.float64, types.float64) + res = wrapped_impl(context, builder, inner_sig, (fpval,)) + return context.cast(builder, res, types.float64, sig.return_type) + + return implementer + +def unary_math_int_impl(fn, float_impl): + impl = _unary_int_input_wrapper_impl(float_impl) + lower(fn, types.Integer)(impl) + +def unary_math_intr(fn, intrcode): + """ + Implement the math function *fn* using the LLVM intrinsic *intrcode*. + """ + @lower(fn, types.Float) + def float_impl(context, builder, sig, args): + res = call_fp_intrinsic(builder, intrcode, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + unary_math_int_impl(fn, float_impl) + return float_impl + +def unary_math_extern(fn, f32extern, f64extern, int_restype=False): + """ + Register implementations of Python function *fn* using the + external function named *f32extern* and *f64extern* (for float32 + and float64 inputs, respectively). + If *int_restype* is true, then the function's return value should be + integral, otherwise floating-point. + """ + f_restype = types.int64 if int_restype else None + + def float_impl(context, builder, sig, args): + """ + Implement *fn* for a types.Float input. + """ + [val] = args + mod = builder.module + input_type = sig.args[0] + lty = context.get_value_type(input_type) + func_name = { + types.float32: f32extern, + types.float64: f64extern, + }[input_type] + fnty = llvmlite.ir.FunctionType(lty, [lty]) + fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name) + res = builder.call(fn, (val,)) + res = context.cast(builder, res, input_type, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + lower(fn, types.Float)(float_impl) + + # Implement wrapper for integer inputs + unary_math_int_impl(fn, float_impl) + + return float_impl + + +unary_math_intr(math.fabs, 'llvm.fabs') +exp_impl = unary_math_intr(math.exp, 'llvm.exp') +log_impl = unary_math_intr(math.log, 'llvm.log') +log10_impl = unary_math_intr(math.log10, 'llvm.log10') +log2_impl = unary_math_intr(math.log2, 'llvm.log2') +sin_impl = unary_math_intr(math.sin, 'llvm.sin') +cos_impl = unary_math_intr(math.cos, 'llvm.cos') + +log1p_impl = unary_math_extern(math.log1p, "log1pf", "log1p") +expm1_impl = unary_math_extern(math.expm1, "expm1f", "expm1") +erf_impl = unary_math_extern(math.erf, "erff", "erf") +erfc_impl = unary_math_extern(math.erfc, "erfcf", "erfc") + +tan_impl = unary_math_extern(math.tan, "tanf", "tan") +asin_impl = unary_math_extern(math.asin, "asinf", "asin") +acos_impl = unary_math_extern(math.acos, "acosf", "acos") +atan_impl = unary_math_extern(math.atan, "atanf", "atan") + +asinh_impl = unary_math_extern(math.asinh, "asinhf", "asinh") +acosh_impl = unary_math_extern(math.acosh, "acoshf", "acosh") +atanh_impl = unary_math_extern(math.atanh, "atanhf", "atanh") +sinh_impl = unary_math_extern(math.sinh, "sinhf", "sinh") +cosh_impl = unary_math_extern(math.cosh, "coshf", "cosh") +tanh_impl = unary_math_extern(math.tanh, "tanhf", "tanh") + +log2_impl = unary_math_extern(math.log2, "log2f", "log2") +ceil_impl = unary_math_extern(math.ceil, "ceilf", "ceil", True) +floor_impl = unary_math_extern(math.floor, "floorf", "floor", True) + +gamma_impl = unary_math_extern(math.gamma, "numba_gammaf", "numba_gamma") # work-around +sqrt_impl = unary_math_extern(math.sqrt, "sqrtf", "sqrt") +trunc_impl = unary_math_extern(math.trunc, "truncf", "trunc", True) +lgamma_impl = unary_math_extern(math.lgamma, "lgammaf", "lgamma") + + +@lower(math.isnan, types.Float) +def isnan_float_impl(context, builder, sig, args): + [val] = args + res = is_nan(builder, val) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower(math.isnan, types.Integer) +def isnan_int_impl(context, builder, sig, args): + res = cgutils.false_bit + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.isinf, types.Float) +def isinf_float_impl(context, builder, sig, args): + [val] = args + res = is_inf(builder, val) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower(math.isinf, types.Integer) +def isinf_int_impl(context, builder, sig, args): + res = cgutils.false_bit + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.isfinite, types.Float) +def isfinite_float_impl(context, builder, sig, args): + [val] = args + res = is_finite(builder, val) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.isfinite, types.Integer) +def isfinite_int_impl(context, builder, sig, args): + res = cgutils.true_bit + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.copysign, types.Float, types.Float) +def copysign_float_impl(context, builder, sig, args): + lty = args[0].type + mod = builder.module + fn = cgutils.get_or_insert_function(mod, llvmlite.ir.FunctionType(lty, (lty, lty)), + 'llvm.copysign.%s' % lty.intrinsic_name) + res = builder.call(fn, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# ----------------------------------------------------------------------------- + + +@lower(math.frexp, types.Float) +def frexp_impl(context, builder, sig, args): + val, = args + fltty = context.get_data_type(sig.args[0]) + intty = context.get_data_type(sig.return_type[1]) + expptr = cgutils.alloca_once(builder, intty, name='exp') + fnty = llvmlite.ir.FunctionType(fltty, (fltty, llvmlite.ir.PointerType(intty))) + fname = { + "float": "numba_frexpf", + "double": "numba_frexp", + }[str(fltty)] + fn = cgutils.get_or_insert_function(builder.module, fnty, fname) + res = builder.call(fn, (val, expptr)) + res = cgutils.make_anonymous_struct(builder, (res, builder.load(expptr))) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.ldexp, types.Float, types.intc) +def ldexp_impl(context, builder, sig, args): + val, exp = args + fltty, intty = map(context.get_data_type, sig.args) + fnty = llvmlite.ir.FunctionType(fltty, (fltty, intty)) + fname = { + "float": "numba_ldexpf", + "double": "numba_ldexp", + }[str(fltty)] + fn = cgutils.insert_pure_function(builder.module, fnty, name=fname) + res = builder.call(fn, (val, exp)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# ----------------------------------------------------------------------------- + + +@lower(math.atan2, types.int64, types.int64) +def atan2_s64_impl(context, builder, sig, args): + [y, x] = args + y = builder.sitofp(y, llvmlite.ir.DoubleType()) + x = builder.sitofp(x, llvmlite.ir.DoubleType()) + fsig = signature(types.float64, types.float64, types.float64) + return atan2_float_impl(context, builder, fsig, (y, x)) + +@lower(math.atan2, types.uint64, types.uint64) +def atan2_u64_impl(context, builder, sig, args): + [y, x] = args + y = builder.uitofp(y, llvmlite.ir.DoubleType()) + x = builder.uitofp(x, llvmlite.ir.DoubleType()) + fsig = signature(types.float64, types.float64, types.float64) + return atan2_float_impl(context, builder, fsig, (y, x)) + +@lower(math.atan2, types.Float, types.Float) +def atan2_float_impl(context, builder, sig, args): + assert len(args) == 2 + mod = builder.module + ty = sig.args[0] + lty = context.get_value_type(ty) + func_name = { + types.float32: "atan2f", + types.float64: "atan2" + }[ty] + fnty = llvmlite.ir.FunctionType(lty, (lty, lty)) + fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name) + res = builder.call(fn, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# ----------------------------------------------------------------------------- + + +@lower(math.hypot, types.int64, types.int64) +def hypot_s64_impl(context, builder, sig, args): + [x, y] = args + y = builder.sitofp(y, llvmlite.ir.DoubleType()) + x = builder.sitofp(x, llvmlite.ir.DoubleType()) + fsig = signature(types.float64, types.float64, types.float64) + res = hypot_float_impl(context, builder, fsig, (x, y)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.hypot, types.uint64, types.uint64) +def hypot_u64_impl(context, builder, sig, args): + [x, y] = args + y = builder.sitofp(y, llvmlite.ir.DoubleType()) + x = builder.sitofp(x, llvmlite.ir.DoubleType()) + fsig = signature(types.float64, types.float64, types.float64) + res = hypot_float_impl(context, builder, fsig, (x, y)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(math.hypot, types.Float, types.Float) +def hypot_float_impl(context, builder, sig, args): + xty, yty = sig.args + assert xty == yty == sig.return_type + x, y = args + + # Windows has alternate names for hypot/hypotf, see + # https://msdn.microsoft.com/fr-fr/library/a9yb3dbt%28v=vs.80%29.aspx + fname = { + types.float32: "_hypotf" if sys.platform == 'win32' else "hypotf", + types.float64: "_hypot" if sys.platform == 'win32' else "hypot", + }[xty] + plat_hypot = types.ExternalFunction(fname, sig) + + if sys.platform == 'win32' and config.MACHINE_BITS == 32: + inf = xty(float('inf')) + + def hypot_impl(x, y): + if math.isinf(x) or math.isinf(y): + return inf + return plat_hypot(x, y) + else: + def hypot_impl(x, y): + return plat_hypot(x, y) + + res = context.compile_internal(builder, hypot_impl, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# ----------------------------------------------------------------------------- + +@lower(math.radians, types.Float) +def radians_float_impl(context, builder, sig, args): + [x] = args + coef = context.get_constant(sig.return_type, math.pi / 180) + res = builder.fmul(x, coef) + return impl_ret_untracked(context, builder, sig.return_type, res) + +unary_math_int_impl(math.radians, radians_float_impl) + +# ----------------------------------------------------------------------------- + +@lower(math.degrees, types.Float) +def degrees_float_impl(context, builder, sig, args): + [x] = args + coef = context.get_constant(sig.return_type, 180 / math.pi) + res = builder.fmul(x, coef) + return impl_ret_untracked(context, builder, sig.return_type, res) + +unary_math_int_impl(math.degrees, degrees_float_impl) + +# ----------------------------------------------------------------------------- + +@lower(math.pow, types.Float, types.Float) +@lower(math.pow, types.Float, types.Integer) +def pow_impl(context, builder, sig, args): + impl = context.get_function(operator.pow, sig) + return impl(builder, args) + +# ----------------------------------------------------------------------------- + +@lower(math.nextafter, types.Float, types.Float) +def nextafter_impl(context, builder, sig, args): + assert len(args) == 2 + ty = sig.args[0] + lty = context.get_value_type(ty) + func_name = { + types.float32: "nextafterf", + types.float64: "nextafter" + }[ty] + fnty = llvmlite.ir.FunctionType(lty, (lty, lty)) + fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name) + res = builder.call(fn, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +# ----------------------------------------------------------------------------- + +def _unsigned(T): + """Convert integer to unsigned integer of equivalent width.""" + pass + +@overload(_unsigned) +def _unsigned_impl(T): + if T in types.unsigned_domain: + return lambda T: T + elif T in types.signed_domain: + newT = getattr(types, 'uint{}'.format(T.bitwidth)) + return lambda T: newT(T) + + +def gcd_impl(context, builder, sig, args): + xty, yty = sig.args + assert xty == yty == sig.return_type + x, y = args + + def gcd(a, b): + """ + Stein's algorithm, heavily cribbed from Julia implementation. + """ + T = type(a) + if a == 0: return abs(b) + if b == 0: return abs(a) + za = trailing_zeros(a) + zb = trailing_zeros(b) + k = min(za, zb) + # Uses np.*_shift instead of operators due to return types + u = _unsigned(abs(np.right_shift(a, za))) + v = _unsigned(abs(np.right_shift(b, zb))) + while u != v: + if u > v: + u, v = v, u + v -= u + v = np.right_shift(v, trailing_zeros(v)) + r = np.left_shift(T(u), k) + return r + + res = context.compile_internal(builder, gcd, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +lower(math.gcd, types.Integer, types.Integer)(gcd_impl) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_numbers.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_numbers.py new file mode 100644 index 0000000000000000000000000000000000000000..9c616cb8e375fbe2e1ac27c833012ec4edda326d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_numbers.py @@ -0,0 +1,1395 @@ +import math +import numbers + +import numpy as np +import operator + +from llvmlite import ir +from llvmlite.ir import Constant + +from numba.core.imputils import (lower_builtin, lower_getattr, + lower_getattr_generic, lower_cast, + lower_constant, impl_ret_borrowed, + impl_ret_untracked) +from numba.core import typing, types, utils, errors, cgutils, optional +from numba.core.extending import intrinsic, overload_method +from numba.cpython.unsafe.numbers import viewer + +def _int_arith_flags(rettype): + """ + Return the modifier flags for integer arithmetic. + """ + if rettype.signed: + # Ignore the effects of signed overflow. This is important for + # optimization of some indexing operations. For example + # array[i+1] could see `i+1` trigger a signed overflow and + # give a negative number. With Python's indexing, a negative + # index is treated differently: its resolution has a runtime cost. + # Telling LLVM to ignore signed overflows allows it to optimize + # away the check for a negative `i+1` if it knows `i` is positive. + return ['nsw'] + else: + return [] + + +def int_add_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + a = context.cast(builder, va, ta, sig.return_type) + b = context.cast(builder, vb, tb, sig.return_type) + res = builder.add(a, b, flags=_int_arith_flags(sig.return_type)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sub_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + a = context.cast(builder, va, ta, sig.return_type) + b = context.cast(builder, vb, tb, sig.return_type) + res = builder.sub(a, b, flags=_int_arith_flags(sig.return_type)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_mul_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + a = context.cast(builder, va, ta, sig.return_type) + b = context.cast(builder, vb, tb, sig.return_type) + res = builder.mul(a, b, flags=_int_arith_flags(sig.return_type)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_divmod_signed(context, builder, ty, x, y): + """ + Reference Objects/intobject.c + xdivy = x / y; + xmody = (long)(x - (unsigned long)xdivy * y); + /* If the signs of x and y differ, and the remainder is non-0, + * C89 doesn't define whether xdivy is now the floor or the + * ceiling of the infinitely precise quotient. We want the floor, + * and we have it iff the remainder's sign matches y's. + */ + if (xmody && ((y ^ xmody) < 0) /* i.e. and signs differ */) { + xmody += y; + --xdivy; + assert(xmody && ((y ^ xmody) >= 0)); + } + *p_xdivy = xdivy; + *p_xmody = xmody; + """ + assert x.type == y.type + + ZERO = y.type(0) + ONE = y.type(1) + + # NOTE: On x86 at least, dividing the lowest representable integer + # (e.g. 0x80000000 for int32) by -1 causes a SIFGPE (division overflow), + # causing the process to crash. + # We return 0, 0 instead (more or less like Numpy). + + resdiv = cgutils.alloca_once_value(builder, ZERO) + resmod = cgutils.alloca_once_value(builder, ZERO) + + is_overflow = builder.and_( + builder.icmp_signed('==', x, x.type(ty.minval)), + builder.icmp_signed('==', y, y.type(-1))) + + with builder.if_then(builder.not_(is_overflow), likely=True): + # Note LLVM will optimize this to a single divmod instruction, + # if available on the target CPU (e.g. x86). + xdivy = builder.sdiv(x, y) + xmody = builder.srem(x, y) + + y_xor_xmody_ltz = builder.icmp_signed('<', builder.xor(y, xmody), ZERO) + xmody_istrue = builder.icmp_signed('!=', xmody, ZERO) + cond = builder.and_(xmody_istrue, y_xor_xmody_ltz) + + with builder.if_else(cond) as (if_different_signs, if_same_signs): + with if_same_signs: + builder.store(xdivy, resdiv) + builder.store(xmody, resmod) + + with if_different_signs: + builder.store(builder.sub(xdivy, ONE), resdiv) + builder.store(builder.add(xmody, y), resmod) + + return builder.load(resdiv), builder.load(resmod) + + +def int_divmod(context, builder, ty, x, y): + """ + Integer divmod(x, y). The caller must ensure that y != 0. + """ + if ty.signed: + return int_divmod_signed(context, builder, ty, x, y) + else: + return builder.udiv(x, y), builder.urem(x, y) + + +def _int_divmod_impl(context, builder, sig, args, zerodiv_message): + va, vb = args + ta, tb = sig.args + + ty = sig.return_type + if isinstance(ty, types.UniTuple): + ty = ty.dtype + a = context.cast(builder, va, ta, ty) + b = context.cast(builder, vb, tb, ty) + quot = cgutils.alloca_once(builder, a.type, name="quot") + rem = cgutils.alloca_once(builder, a.type, name="rem") + + with builder.if_else(cgutils.is_scalar_zero(builder, b), likely=False + ) as (if_zero, if_non_zero): + with if_zero: + if not context.error_model.fp_zero_division( + builder, (zerodiv_message,)): + # No exception raised => return 0 + # XXX We should also set the FPU exception status, but + # there's no easy way to do that from LLVM. + builder.store(b, quot) + builder.store(b, rem) + with if_non_zero: + q, r = int_divmod(context, builder, ty, a, b) + builder.store(q, quot) + builder.store(r, rem) + + return quot, rem + + +@lower_builtin(divmod, types.Integer, types.Integer) +def int_divmod_impl(context, builder, sig, args): + quot, rem = _int_divmod_impl(context, builder, sig, args, + "integer divmod by zero") + + return cgutils.pack_array(builder, + (builder.load(quot), builder.load(rem))) + + +@lower_builtin(operator.floordiv, types.Integer, types.Integer) +@lower_builtin(operator.ifloordiv, types.Integer, types.Integer) +def int_floordiv_impl(context, builder, sig, args): + quot, rem = _int_divmod_impl(context, builder, sig, args, + "integer division by zero") + return builder.load(quot) + + +@lower_builtin(operator.truediv, types.Integer, types.Integer) +@lower_builtin(operator.itruediv, types.Integer, types.Integer) +def int_truediv_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + a = context.cast(builder, va, ta, sig.return_type) + b = context.cast(builder, vb, tb, sig.return_type) + with cgutils.if_zero(builder, b): + context.error_model.fp_zero_division(builder, ("division by zero",)) + res = builder.fdiv(a, b) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.mod, types.Integer, types.Integer) +@lower_builtin(operator.imod, types.Integer, types.Integer) +def int_rem_impl(context, builder, sig, args): + quot, rem = _int_divmod_impl(context, builder, sig, args, + "integer modulo by zero") + return builder.load(rem) + + +def _get_power_zerodiv_return(context, return_type): + if (isinstance(return_type, types.Integer) + and not context.error_model.raise_on_fp_zero_division): + # If not raising, return 0x8000... when computing 0 ** + return -1 << (return_type.bitwidth - 1) + else: + return False + + +def int_power_impl(context, builder, sig, args): + """ + a ^ b, where a is an integer or real, and b an integer + """ + is_integer = isinstance(sig.args[0], types.Integer) + tp = sig.return_type + zerodiv_return = _get_power_zerodiv_return(context, tp) + + def int_power(a, b): + # Ensure computations are done with a large enough width + r = tp(1) + a = tp(a) + if b < 0: + invert = True + exp = -b + if exp < 0: + raise OverflowError + if is_integer: + if a == 0: + if zerodiv_return: + return zerodiv_return + else: + raise ZeroDivisionError("0 cannot be raised to a negative power") + if a != 1 and a != -1: + return 0 + else: + invert = False + exp = b + if exp > 0x10000: + # Optimization cutoff: fallback on the generic algorithm + return math.pow(a, float(b)) + while exp != 0: + if exp & 1: + r *= a + exp >>= 1 + a *= a + + return 1.0 / r if invert else r + + res = context.compile_internal(builder, int_power, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.pow, types.Integer, types.IntegerLiteral) +@lower_builtin(operator.ipow, types.Integer, types.IntegerLiteral) +@lower_builtin(operator.pow, types.Float, types.IntegerLiteral) +@lower_builtin(operator.ipow, types.Float, types.IntegerLiteral) +def static_power_impl(context, builder, sig, args): + """ + a ^ b, where a is an integer or real, and b a constant integer + """ + exp = sig.args[1].value + if not isinstance(exp, numbers.Integral): + raise NotImplementedError + if abs(exp) > 0x10000: + # Optimization cutoff: fallback on the generic algorithm above + raise NotImplementedError + invert = exp < 0 + exp = abs(exp) + + tp = sig.return_type + is_integer = isinstance(tp, types.Integer) + zerodiv_return = _get_power_zerodiv_return(context, tp) + + val = context.cast(builder, args[0], sig.args[0], tp) + lty = val.type + + def mul(a, b): + if is_integer: + return builder.mul(a, b) + else: + return builder.fmul(a, b) + + # Unroll the exponentiation loop + res = lty(1) + a = val + while exp != 0: + if exp & 1: + res = mul(res, val) + exp >>= 1 + val = mul(val, val) + + if invert: + # If the exponent was negative, fix the result by inverting it + if is_integer: + # Integer inversion + def invert_impl(a): + if a == 0: + if zerodiv_return: + return zerodiv_return + else: + raise ZeroDivisionError("0 cannot be raised to a negative power") + if a != 1 and a != -1: + return 0 + else: + return a + + else: + # Real inversion + def invert_impl(a): + return 1.0 / a + + res = context.compile_internal(builder, invert_impl, + typing.signature(tp, tp), (res,)) + + return res + + +def int_slt_impl(context, builder, sig, args): + res = builder.icmp_signed('<', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sle_impl(context, builder, sig, args): + res = builder.icmp_signed('<=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sgt_impl(context, builder, sig, args): + res = builder.icmp_signed('>', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sge_impl(context, builder, sig, args): + res = builder.icmp_signed('>=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_ult_impl(context, builder, sig, args): + res = builder.icmp_unsigned('<', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_ule_impl(context, builder, sig, args): + res = builder.icmp_unsigned('<=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_ugt_impl(context, builder, sig, args): + res = builder.icmp_unsigned('>', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_uge_impl(context, builder, sig, args): + res = builder.icmp_unsigned('>=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_eq_impl(context, builder, sig, args): + res = builder.icmp_unsigned('==', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_ne_impl(context, builder, sig, args): + res = builder.icmp_unsigned('!=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_signed_unsigned_cmp(op): + def impl(context, builder, sig, args): + (left, right) = args + # This code is translated from the NumPy source. + # What we're going to do is divide the range of a signed value at zero. + # If the signed value is less than zero, then we can treat zero as the + # unsigned value since the unsigned value is necessarily zero or larger + # and any signed comparison between a negative value and zero/infinity + # will yield the same result. If the signed value is greater than or + # equal to zero, then we can safely cast it to an unsigned value and do + # the expected unsigned-unsigned comparison operation. + # Original: https://github.com/numpy/numpy/pull/23713 + cmp_zero = builder.icmp_signed('<', left, Constant(left.type, 0)) + lt_zero = builder.icmp_signed(op, left, Constant(left.type, 0)) + ge_zero = builder.icmp_unsigned(op, left, right) + res = builder.select(cmp_zero, lt_zero, ge_zero) + return impl_ret_untracked(context, builder, sig.return_type, res) + return impl + + +def int_unsigned_signed_cmp(op): + def impl(context, builder, sig, args): + (left, right) = args + # See the function `int_signed_unsigned_cmp` for implementation notes. + cmp_zero = builder.icmp_signed('<', right, Constant(right.type, 0)) + lt_zero = builder.icmp_signed(op, Constant(right.type, 0), right) + ge_zero = builder.icmp_unsigned(op, left, right) + res = builder.select(cmp_zero, lt_zero, ge_zero) + return impl_ret_untracked(context, builder, sig.return_type, res) + return impl + + +def int_abs_impl(context, builder, sig, args): + [x] = args + ZERO = Constant(x.type, None) + ltz = builder.icmp_signed('<', x, ZERO) + negated = builder.neg(x) + res = builder.select(ltz, negated, x) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def uint_abs_impl(context, builder, sig, args): + [x] = args + return impl_ret_untracked(context, builder, sig.return_type, x) + + +def int_shl_impl(context, builder, sig, args): + [valty, amtty] = sig.args + [val, amt] = args + val = context.cast(builder, val, valty, sig.return_type) + amt = context.cast(builder, amt, amtty, sig.return_type) + res = builder.shl(val, amt) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_shr_impl(context, builder, sig, args): + [valty, amtty] = sig.args + [val, amt] = args + val = context.cast(builder, val, valty, sig.return_type) + amt = context.cast(builder, amt, amtty, sig.return_type) + if sig.return_type.signed: + res = builder.ashr(val, amt) + else: + res = builder.lshr(val, amt) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_and_impl(context, builder, sig, args): + [at, bt] = sig.args + [av, bv] = args + cav = context.cast(builder, av, at, sig.return_type) + cbc = context.cast(builder, bv, bt, sig.return_type) + res = builder.and_(cav, cbc) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_or_impl(context, builder, sig, args): + [at, bt] = sig.args + [av, bv] = args + cav = context.cast(builder, av, at, sig.return_type) + cbc = context.cast(builder, bv, bt, sig.return_type) + res = builder.or_(cav, cbc) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_xor_impl(context, builder, sig, args): + [at, bt] = sig.args + [av, bv] = args + cav = context.cast(builder, av, at, sig.return_type) + cbc = context.cast(builder, bv, bt, sig.return_type) + res = builder.xor(cav, cbc) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_negate_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + # Negate before upcasting, for unsigned numbers + res = builder.neg(val) + res = context.cast(builder, res, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_positive_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + res = context.cast(builder, val, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_invert_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + # Invert before upcasting, for unsigned numbers + res = builder.xor(val, Constant(val.type, int('1' * val.type.width, 2))) + res = context.cast(builder, res, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def int_sign_impl(context, builder, sig, args): + """ + np.sign(int) + """ + [x] = args + POS = Constant(x.type, 1) + NEG = Constant(x.type, -1) + ZERO = Constant(x.type, 0) + + cmp_zero = builder.icmp_unsigned('==', x, ZERO) + cmp_pos = builder.icmp_signed('>', x, ZERO) + + presult = cgutils.alloca_once(builder, x.type) + + bb_zero = builder.append_basic_block(".zero") + bb_postest = builder.append_basic_block(".postest") + bb_pos = builder.append_basic_block(".pos") + bb_neg = builder.append_basic_block(".neg") + bb_exit = builder.append_basic_block(".exit") + + builder.cbranch(cmp_zero, bb_zero, bb_postest) + + with builder.goto_block(bb_zero): + builder.store(ZERO, presult) + builder.branch(bb_exit) + + with builder.goto_block(bb_postest): + builder.cbranch(cmp_pos, bb_pos, bb_neg) + + with builder.goto_block(bb_pos): + builder.store(POS, presult) + builder.branch(bb_exit) + + with builder.goto_block(bb_neg): + builder.store(NEG, presult) + builder.branch(bb_exit) + + builder.position_at_end(bb_exit) + res = builder.load(presult) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def bool_negate_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + res = context.cast(builder, val, typ, sig.return_type) + res = builder.neg(res) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def bool_unary_positive_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + res = context.cast(builder, val, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +lower_builtin(operator.eq, types.boolean, types.boolean)(int_eq_impl) +lower_builtin(operator.ne, types.boolean, types.boolean)(int_ne_impl) +lower_builtin(operator.lt, types.boolean, types.boolean)(int_ult_impl) +lower_builtin(operator.le, types.boolean, types.boolean)(int_ule_impl) +lower_builtin(operator.gt, types.boolean, types.boolean)(int_ugt_impl) +lower_builtin(operator.ge, types.boolean, types.boolean)(int_uge_impl) +lower_builtin(operator.neg, types.boolean)(bool_negate_impl) +lower_builtin(operator.pos, types.boolean)(bool_unary_positive_impl) + + +def _implement_integer_operators(): + ty = types.Integer + + lower_builtin(operator.add, ty, ty)(int_add_impl) + lower_builtin(operator.iadd, ty, ty)(int_add_impl) + lower_builtin(operator.sub, ty, ty)(int_sub_impl) + lower_builtin(operator.isub, ty, ty)(int_sub_impl) + lower_builtin(operator.mul, ty, ty)(int_mul_impl) + lower_builtin(operator.imul, ty, ty)(int_mul_impl) + lower_builtin(operator.eq, ty, ty)(int_eq_impl) + lower_builtin(operator.ne, ty, ty)(int_ne_impl) + + lower_builtin(operator.lshift, ty, ty)(int_shl_impl) + lower_builtin(operator.ilshift, ty, ty)(int_shl_impl) + lower_builtin(operator.rshift, ty, ty)(int_shr_impl) + lower_builtin(operator.irshift, ty, ty)(int_shr_impl) + + lower_builtin(operator.neg, ty)(int_negate_impl) + lower_builtin(operator.pos, ty)(int_positive_impl) + + lower_builtin(operator.pow, ty, ty)(int_power_impl) + lower_builtin(operator.ipow, ty, ty)(int_power_impl) + lower_builtin(pow, ty, ty)(int_power_impl) + + for ty in types.unsigned_domain: + lower_builtin(operator.lt, ty, ty)(int_ult_impl) + lower_builtin(operator.le, ty, ty)(int_ule_impl) + lower_builtin(operator.gt, ty, ty)(int_ugt_impl) + lower_builtin(operator.ge, ty, ty)(int_uge_impl) + lower_builtin(operator.pow, types.Float, ty)(int_power_impl) + lower_builtin(operator.ipow, types.Float, ty)(int_power_impl) + lower_builtin(pow, types.Float, ty)(int_power_impl) + lower_builtin(abs, ty)(uint_abs_impl) + + lower_builtin(operator.lt, types.IntegerLiteral, types.IntegerLiteral)(int_slt_impl) + lower_builtin(operator.gt, types.IntegerLiteral, types.IntegerLiteral)(int_slt_impl) + lower_builtin(operator.le, types.IntegerLiteral, types.IntegerLiteral)(int_slt_impl) + lower_builtin(operator.ge, types.IntegerLiteral, types.IntegerLiteral)(int_slt_impl) + for ty in types.signed_domain: + lower_builtin(operator.lt, ty, ty)(int_slt_impl) + lower_builtin(operator.le, ty, ty)(int_sle_impl) + lower_builtin(operator.gt, ty, ty)(int_sgt_impl) + lower_builtin(operator.ge, ty, ty)(int_sge_impl) + lower_builtin(operator.pow, types.Float, ty)(int_power_impl) + lower_builtin(operator.ipow, types.Float, ty)(int_power_impl) + lower_builtin(pow, types.Float, ty)(int_power_impl) + lower_builtin(abs, ty)(int_abs_impl) + +def _implement_bitwise_operators(): + for ty in (types.Boolean, types.Integer): + lower_builtin(operator.and_, ty, ty)(int_and_impl) + lower_builtin(operator.iand, ty, ty)(int_and_impl) + lower_builtin(operator.or_, ty, ty)(int_or_impl) + lower_builtin(operator.ior, ty, ty)(int_or_impl) + lower_builtin(operator.xor, ty, ty)(int_xor_impl) + lower_builtin(operator.ixor, ty, ty)(int_xor_impl) + + lower_builtin(operator.invert, ty)(int_invert_impl) + +_implement_integer_operators() + +_implement_bitwise_operators() + + +def real_add_impl(context, builder, sig, args): + res = builder.fadd(*args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_sub_impl(context, builder, sig, args): + res = builder.fsub(*args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_mul_impl(context, builder, sig, args): + res = builder.fmul(*args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_div_impl(context, builder, sig, args): + with cgutils.if_zero(builder, args[1]): + context.error_model.fp_zero_division(builder, ("division by zero",)) + res = builder.fdiv(*args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_divmod(context, builder, x, y): + assert x.type == y.type + floatty = x.type + + module = builder.module + fname = context.mangler(".numba.python.rem", [x.type]) + fnty = ir.FunctionType(floatty, (floatty, floatty, ir.PointerType(floatty))) + fn = cgutils.get_or_insert_function(module, fnty, fname) + + if fn.is_declaration: + fn.linkage = 'linkonce_odr' + fnbuilder = ir.IRBuilder(fn.append_basic_block('entry')) + fx, fy, pmod = fn.args + div, mod = real_divmod_func_body(context, fnbuilder, fx, fy) + fnbuilder.store(mod, pmod) + fnbuilder.ret(div) + + pmod = cgutils.alloca_once(builder, floatty) + quotient = builder.call(fn, (x, y, pmod)) + return quotient, builder.load(pmod) + + +def real_divmod_func_body(context, builder, vx, wx): + # Reference Objects/floatobject.c + # + # float_divmod(PyObject *v, PyObject *w) + # { + # double vx, wx; + # double div, mod, floordiv; + # CONVERT_TO_DOUBLE(v, vx); + # CONVERT_TO_DOUBLE(w, wx); + # mod = fmod(vx, wx); + # /* fmod is typically exact, so vx-mod is *mathematically* an + # exact multiple of wx. But this is fp arithmetic, and fp + # vx - mod is an approximation; the result is that div may + # not be an exact integral value after the division, although + # it will always be very close to one. + # */ + # div = (vx - mod) / wx; + # if (mod) { + # /* ensure the remainder has the same sign as the denominator */ + # if ((wx < 0) != (mod < 0)) { + # mod += wx; + # div -= 1.0; + # } + # } + # else { + # /* the remainder is zero, and in the presence of signed zeroes + # fmod returns different results across platforms; ensure + # it has the same sign as the denominator; we'd like to do + # "mod = wx * 0.0", but that may get optimized away */ + # mod *= mod; /* hide "mod = +0" from optimizer */ + # if (wx < 0.0) + # mod = -mod; + # } + # /* snap quotient to nearest integral value */ + # if (div) { + # floordiv = floor(div); + # if (div - floordiv > 0.5) + # floordiv += 1.0; + # } + # else { + # /* div is zero - get the same sign as the true quotient */ + # div *= div; /* hide "div = +0" from optimizers */ + # floordiv = div * vx / wx; /* zero w/ sign of vx/wx */ + # } + # return Py_BuildValue("(dd)", floordiv, mod); + # } + pmod = cgutils.alloca_once(builder, vx.type) + pdiv = cgutils.alloca_once(builder, vx.type) + pfloordiv = cgutils.alloca_once(builder, vx.type) + + mod = builder.frem(vx, wx) + div = builder.fdiv(builder.fsub(vx, mod), wx) + + builder.store(mod, pmod) + builder.store(div, pdiv) + + # Note the use of negative zero for proper negating with `ZERO - x` + ZERO = vx.type(0.0) + NZERO = vx.type(-0.0) + ONE = vx.type(1.0) + mod_istrue = builder.fcmp_unordered('!=', mod, ZERO) + wx_ltz = builder.fcmp_ordered('<', wx, ZERO) + mod_ltz = builder.fcmp_ordered('<', mod, ZERO) + + with builder.if_else(mod_istrue, likely=True) as (if_nonzero_mod, if_zero_mod): + with if_nonzero_mod: + # `mod` is non-zero or NaN + # Ensure the remainder has the same sign as the denominator + wx_ltz_ne_mod_ltz = builder.icmp_unsigned('!=', wx_ltz, mod_ltz) + + with builder.if_then(wx_ltz_ne_mod_ltz): + builder.store(builder.fsub(div, ONE), pdiv) + builder.store(builder.fadd(mod, wx), pmod) + + with if_zero_mod: + # `mod` is zero, select the proper sign depending on + # the denominator's sign + mod = builder.select(wx_ltz, NZERO, ZERO) + builder.store(mod, pmod) + + del mod, div + + div = builder.load(pdiv) + div_istrue = builder.fcmp_ordered('!=', div, ZERO) + + with builder.if_then(div_istrue): + realtypemap = {'float': types.float32, + 'double': types.float64} + realtype = realtypemap[str(wx.type)] + floorfn = context.get_function(math.floor, + typing.signature(realtype, realtype)) + floordiv = floorfn(builder, [div]) + floordivdiff = builder.fsub(div, floordiv) + floordivincr = builder.fadd(floordiv, ONE) + HALF = Constant(wx.type, 0.5) + pred = builder.fcmp_ordered('>', floordivdiff, HALF) + floordiv = builder.select(pred, floordivincr, floordiv) + builder.store(floordiv, pfloordiv) + + with cgutils.ifnot(builder, div_istrue): + div = builder.fmul(div, div) + builder.store(div, pdiv) + floordiv = builder.fdiv(builder.fmul(div, vx), wx) + builder.store(floordiv, pfloordiv) + + return builder.load(pfloordiv), builder.load(pmod) + + +@lower_builtin(divmod, types.Float, types.Float) +def real_divmod_impl(context, builder, sig, args, loc=None): + x, y = args + quot = cgutils.alloca_once(builder, x.type, name="quot") + rem = cgutils.alloca_once(builder, x.type, name="rem") + + with builder.if_else(cgutils.is_scalar_zero(builder, y), likely=False + ) as (if_zero, if_non_zero): + with if_zero: + if not context.error_model.fp_zero_division( + builder, ("modulo by zero",), loc): + # No exception raised => compute the nan result, + # and set the FP exception word for Numpy warnings. + q = builder.fdiv(x, y) + r = builder.frem(x, y) + builder.store(q, quot) + builder.store(r, rem) + with if_non_zero: + q, r = real_divmod(context, builder, x, y) + builder.store(q, quot) + builder.store(r, rem) + + return cgutils.pack_array(builder, + (builder.load(quot), builder.load(rem))) + + +def real_mod_impl(context, builder, sig, args, loc=None): + x, y = args + res = cgutils.alloca_once(builder, x.type) + with builder.if_else(cgutils.is_scalar_zero(builder, y), likely=False + ) as (if_zero, if_non_zero): + with if_zero: + if not context.error_model.fp_zero_division( + builder, ("modulo by zero",), loc): + # No exception raised => compute the nan result, + # and set the FP exception word for Numpy warnings. + rem = builder.frem(x, y) + builder.store(rem, res) + with if_non_zero: + _, rem = real_divmod(context, builder, x, y) + builder.store(rem, res) + return impl_ret_untracked(context, builder, sig.return_type, + builder.load(res)) + + +def real_floordiv_impl(context, builder, sig, args, loc=None): + x, y = args + res = cgutils.alloca_once(builder, x.type) + with builder.if_else(cgutils.is_scalar_zero(builder, y), likely=False + ) as (if_zero, if_non_zero): + with if_zero: + if not context.error_model.fp_zero_division( + builder, ("division by zero",), loc): + # No exception raised => compute the +/-inf or nan result, + # and set the FP exception word for Numpy warnings. + quot = builder.fdiv(x, y) + builder.store(quot, res) + with if_non_zero: + quot, _ = real_divmod(context, builder, x, y) + builder.store(quot, res) + return impl_ret_untracked(context, builder, sig.return_type, + builder.load(res)) + + +def real_power_impl(context, builder, sig, args): + x, y = args + module = builder.module + if context.implement_powi_as_math_call: + imp = context.get_function(math.pow, sig) + res = imp(builder, args) + else: + fn = module.declare_intrinsic('llvm.pow', [y.type]) + res = builder.call(fn, (x, y)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_lt_impl(context, builder, sig, args): + res = builder.fcmp_ordered('<', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_le_impl(context, builder, sig, args): + res = builder.fcmp_ordered('<=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_gt_impl(context, builder, sig, args): + res = builder.fcmp_ordered('>', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_ge_impl(context, builder, sig, args): + res = builder.fcmp_ordered('>=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_eq_impl(context, builder, sig, args): + res = builder.fcmp_ordered('==', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_ne_impl(context, builder, sig, args): + res = builder.fcmp_unordered('!=', *args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_abs_impl(context, builder, sig, args): + [ty] = sig.args + sig = typing.signature(ty, ty) + impl = context.get_function(math.fabs, sig) + return impl(builder, args) + + +def real_negate_impl(context, builder, sig, args): + from numba.cpython import mathimpl + res = mathimpl.negate_real(builder, args[0]) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_positive_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + res = context.cast(builder, val, typ, sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def real_sign_impl(context, builder, sig, args): + """ + np.sign(float) + """ + [x] = args + POS = Constant(x.type, 1) + NEG = Constant(x.type, -1) + ZERO = Constant(x.type, 0) + + presult = cgutils.alloca_once(builder, x.type) + + is_pos = builder.fcmp_ordered('>', x, ZERO) + is_neg = builder.fcmp_ordered('<', x, ZERO) + + with builder.if_else(is_pos) as (gt_zero, not_gt_zero): + with gt_zero: + builder.store(POS, presult) + with not_gt_zero: + with builder.if_else(is_neg) as (lt_zero, not_lt_zero): + with lt_zero: + builder.store(NEG, presult) + with not_lt_zero: + # For both NaN and 0, the result of sign() is simply + # the input value. + builder.store(x, presult) + + res = builder.load(presult) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +ty = types.Float + +lower_builtin(operator.add, ty, ty)(real_add_impl) +lower_builtin(operator.iadd, ty, ty)(real_add_impl) +lower_builtin(operator.sub, ty, ty)(real_sub_impl) +lower_builtin(operator.isub, ty, ty)(real_sub_impl) +lower_builtin(operator.mul, ty, ty)(real_mul_impl) +lower_builtin(operator.imul, ty, ty)(real_mul_impl) +lower_builtin(operator.floordiv, ty, ty)(real_floordiv_impl) +lower_builtin(operator.ifloordiv, ty, ty)(real_floordiv_impl) +lower_builtin(operator.truediv, ty, ty)(real_div_impl) +lower_builtin(operator.itruediv, ty, ty)(real_div_impl) +lower_builtin(operator.mod, ty, ty)(real_mod_impl) +lower_builtin(operator.imod, ty, ty)(real_mod_impl) +lower_builtin(operator.pow, ty, ty)(real_power_impl) +lower_builtin(operator.ipow, ty, ty)(real_power_impl) +lower_builtin(pow, ty, ty)(real_power_impl) + +lower_builtin(operator.eq, ty, ty)(real_eq_impl) +lower_builtin(operator.ne, ty, ty)(real_ne_impl) +lower_builtin(operator.lt, ty, ty)(real_lt_impl) +lower_builtin(operator.le, ty, ty)(real_le_impl) +lower_builtin(operator.gt, ty, ty)(real_gt_impl) +lower_builtin(operator.ge, ty, ty)(real_ge_impl) + +lower_builtin(abs, ty)(real_abs_impl) + +lower_builtin(operator.neg, ty)(real_negate_impl) +lower_builtin(operator.pos, ty)(real_positive_impl) + +del ty + + +@lower_getattr(types.Complex, "real") +def complex_real_impl(context, builder, typ, value): + cplx = context.make_complex(builder, typ, value=value) + res = cplx.real + return impl_ret_untracked(context, builder, typ, res) + +@lower_getattr(types.Complex, "imag") +def complex_imag_impl(context, builder, typ, value): + cplx = context.make_complex(builder, typ, value=value) + res = cplx.imag + return impl_ret_untracked(context, builder, typ, res) + +@lower_builtin("complex.conjugate", types.Complex) +def complex_conjugate_impl(context, builder, sig, args): + from numba.cpython import mathimpl + z = context.make_complex(builder, sig.args[0], args[0]) + z.imag = mathimpl.negate_real(builder, z.imag) + res = z._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + +def real_real_impl(context, builder, typ, value): + return impl_ret_untracked(context, builder, typ, value) + +def real_imag_impl(context, builder, typ, value): + res = cgutils.get_null_value(value.type) + return impl_ret_untracked(context, builder, typ, res) + +def real_conjugate_impl(context, builder, sig, args): + return impl_ret_untracked(context, builder, sig.return_type, args[0]) + +for cls in (types.Float, types.Integer): + lower_getattr(cls, "real")(real_real_impl) + lower_getattr(cls, "imag")(real_imag_impl) + lower_builtin("complex.conjugate", cls)(real_conjugate_impl) + + +@lower_builtin(operator.pow, types.Complex, types.Complex) +@lower_builtin(operator.ipow, types.Complex, types.Complex) +@lower_builtin(pow, types.Complex, types.Complex) +def complex_power_impl(context, builder, sig, args): + [ca, cb] = args + ty = sig.args[0] + fty = ty.underlying_float + a = context.make_helper(builder, ty, value=ca) + b = context.make_helper(builder, ty, value=cb) + c = context.make_helper(builder, ty) + module = builder.module + pa = a._getpointer() + pb = b._getpointer() + pc = c._getpointer() + + # Optimize for square because cpow loses a lot of precision + TWO = context.get_constant(fty, 2) + ZERO = context.get_constant(fty, 0) + + b_real_is_two = builder.fcmp_ordered('==', b.real, TWO) + b_imag_is_zero = builder.fcmp_ordered('==', b.imag, ZERO) + b_is_two = builder.and_(b_real_is_two, b_imag_is_zero) + + with builder.if_else(b_is_two) as (then, otherwise): + with then: + # Lower as multiplication + res = complex_mul_impl(context, builder, sig, (ca, ca)) + cres = context.make_helper(builder, ty, value=res) + c.real = cres.real + c.imag = cres.imag + + with otherwise: + # Lower with call to external function + func_name = { + types.complex64: "numba_cpowf", + types.complex128: "numba_cpow", + }[ty] + fnty = ir.FunctionType(ir.VoidType(), [pa.type] * 3) + cpow = cgutils.get_or_insert_function(module, fnty, func_name) + builder.call(cpow, (pa, pb, pc)) + + res = builder.load(pc) + return impl_ret_untracked(context, builder, sig.return_type, res) + +def complex_add_impl(context, builder, sig, args): + [cx, cy] = args + ty = sig.args[0] + x = context.make_complex(builder, ty, value=cx) + y = context.make_complex(builder, ty, value=cy) + z = context.make_complex(builder, ty) + a = x.real + b = x.imag + c = y.real + d = y.imag + z.real = builder.fadd(a, c) + z.imag = builder.fadd(b, d) + res = z._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_sub_impl(context, builder, sig, args): + [cx, cy] = args + ty = sig.args[0] + x = context.make_complex(builder, ty, value=cx) + y = context.make_complex(builder, ty, value=cy) + z = context.make_complex(builder, ty) + a = x.real + b = x.imag + c = y.real + d = y.imag + z.real = builder.fsub(a, c) + z.imag = builder.fsub(b, d) + res = z._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_mul_impl(context, builder, sig, args): + """ + (a+bi)(c+di)=(ac-bd)+i(ad+bc) + """ + [cx, cy] = args + ty = sig.args[0] + x = context.make_complex(builder, ty, value=cx) + y = context.make_complex(builder, ty, value=cy) + z = context.make_complex(builder, ty) + a = x.real + b = x.imag + c = y.real + d = y.imag + ac = builder.fmul(a, c) + bd = builder.fmul(b, d) + ad = builder.fmul(a, d) + bc = builder.fmul(b, c) + z.real = builder.fsub(ac, bd) + z.imag = builder.fadd(ad, bc) + res = z._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +NAN = float('nan') + +def complex_div_impl(context, builder, sig, args): + def complex_div(a, b): + # This is CPython's algorithm (in _Py_c_quot()). + areal = a.real + aimag = a.imag + breal = b.real + bimag = b.imag + if not breal and not bimag: + raise ZeroDivisionError("complex division by zero") + if abs(breal) >= abs(bimag): + # Divide tops and bottom by b.real + if not breal: + return complex(NAN, NAN) + ratio = bimag / breal + denom = breal + bimag * ratio + return complex( + (areal + aimag * ratio) / denom, + (aimag - areal * ratio) / denom) + else: + # Divide tops and bottom by b.imag + if not bimag: + return complex(NAN, NAN) + ratio = breal / bimag + denom = breal * ratio + bimag + return complex( + (a.real * ratio + a.imag) / denom, + (a.imag * ratio - a.real) / denom) + + res = context.compile_internal(builder, complex_div, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_negate_impl(context, builder, sig, args): + from numba.cpython import mathimpl + [typ] = sig.args + [val] = args + cmplx = context.make_complex(builder, typ, value=val) + res = context.make_complex(builder, typ) + res.real = mathimpl.negate_real(builder, cmplx.real) + res.imag = mathimpl.negate_real(builder, cmplx.imag) + res = res._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_positive_impl(context, builder, sig, args): + [val] = args + return impl_ret_untracked(context, builder, sig.return_type, val) + + +def complex_eq_impl(context, builder, sig, args): + [cx, cy] = args + typ = sig.args[0] + x = context.make_complex(builder, typ, value=cx) + y = context.make_complex(builder, typ, value=cy) + + reals_are_eq = builder.fcmp_ordered('==', x.real, y.real) + imags_are_eq = builder.fcmp_ordered('==', x.imag, y.imag) + res = builder.and_(reals_are_eq, imags_are_eq) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_ne_impl(context, builder, sig, args): + [cx, cy] = args + typ = sig.args[0] + x = context.make_complex(builder, typ, value=cx) + y = context.make_complex(builder, typ, value=cy) + + reals_are_ne = builder.fcmp_unordered('!=', x.real, y.real) + imags_are_ne = builder.fcmp_unordered('!=', x.imag, y.imag) + res = builder.or_(reals_are_ne, imags_are_ne) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def complex_abs_impl(context, builder, sig, args): + """ + abs(z) := hypot(z.real, z.imag) + """ + def complex_abs(z): + return math.hypot(z.real, z.imag) + + res = context.compile_internal(builder, complex_abs, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +ty = types.Complex + +lower_builtin(operator.add, ty, ty)(complex_add_impl) +lower_builtin(operator.iadd, ty, ty)(complex_add_impl) +lower_builtin(operator.sub, ty, ty)(complex_sub_impl) +lower_builtin(operator.isub, ty, ty)(complex_sub_impl) +lower_builtin(operator.mul, ty, ty)(complex_mul_impl) +lower_builtin(operator.imul, ty, ty)(complex_mul_impl) +lower_builtin(operator.truediv, ty, ty)(complex_div_impl) +lower_builtin(operator.itruediv, ty, ty)(complex_div_impl) +lower_builtin(operator.neg, ty)(complex_negate_impl) +lower_builtin(operator.pos, ty)(complex_positive_impl) +# Complex modulo is deprecated in python3 + +lower_builtin(operator.eq, ty, ty)(complex_eq_impl) +lower_builtin(operator.ne, ty, ty)(complex_ne_impl) + +lower_builtin(abs, ty)(complex_abs_impl) + +del ty + + +@lower_builtin("number.item", types.Boolean) +@lower_builtin("number.item", types.Number) +def number_item_impl(context, builder, sig, args): + """ + The no-op .item() method on booleans and numbers. + """ + return args[0] + + +#------------------------------------------------------------------------------ + + +def number_not_impl(context, builder, sig, args): + [typ] = sig.args + [val] = args + istrue = context.cast(builder, val, typ, sig.return_type) + res = builder.not_(istrue) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(bool, types.Boolean) +def bool_as_bool(context, builder, sig, args): + [val] = args + return val + +@lower_builtin(bool, types.Integer) +def int_as_bool(context, builder, sig, args): + [val] = args + return builder.icmp_unsigned('!=', val, Constant(val.type, 0)) + +@lower_builtin(bool, types.Float) +def float_as_bool(context, builder, sig, args): + [val] = args + return builder.fcmp_unordered('!=', val, Constant(val.type, 0.0)) + +@lower_builtin(bool, types.Complex) +def complex_as_bool(context, builder, sig, args): + [typ] = sig.args + [val] = args + cmplx = context.make_complex(builder, typ, val) + real, imag = cmplx.real, cmplx.imag + zero = Constant(real.type, 0.0) + real_istrue = builder.fcmp_unordered('!=', real, zero) + imag_istrue = builder.fcmp_unordered('!=', imag, zero) + return builder.or_(real_istrue, imag_istrue) + + +for ty in (types.Integer, types.Float, types.Complex): + lower_builtin(operator.not_, ty)(number_not_impl) + +lower_builtin(operator.not_, types.boolean)(number_not_impl) + + +#------------------------------------------------------------------------------ +# Hashing numbers, see hashing.py + +#------------------------------------------------------------------------------- +# Implicit casts between numerics + +@lower_cast(types.IntegerLiteral, types.Integer) +@lower_cast(types.IntegerLiteral, types.Float) +@lower_cast(types.IntegerLiteral, types.Complex) +def literal_int_to_number(context, builder, fromty, toty, val): + lit = context.get_constant_generic( + builder, + fromty.literal_type, + fromty.literal_value, + ) + return context.cast(builder, lit, fromty.literal_type, toty) + + +@lower_cast(types.Integer, types.Integer) +def integer_to_integer(context, builder, fromty, toty, val): + if toty.bitwidth == fromty.bitwidth: + # Just a change of signedness + return val + elif toty.bitwidth < fromty.bitwidth: + # Downcast + return builder.trunc(val, context.get_value_type(toty)) + elif fromty.signed: + # Signed upcast + return builder.sext(val, context.get_value_type(toty)) + else: + # Unsigned upcast + return builder.zext(val, context.get_value_type(toty)) + +@lower_cast(types.Integer, types.voidptr) +def integer_to_voidptr(context, builder, fromty, toty, val): + return builder.inttoptr(val, context.get_value_type(toty)) + +@lower_cast(types.Float, types.Float) +def float_to_float(context, builder, fromty, toty, val): + lty = context.get_value_type(toty) + if fromty.bitwidth < toty.bitwidth: + return builder.fpext(val, lty) + else: + return builder.fptrunc(val, lty) + +@lower_cast(types.Integer, types.Float) +def integer_to_float(context, builder, fromty, toty, val): + lty = context.get_value_type(toty) + if fromty.signed: + return builder.sitofp(val, lty) + else: + return builder.uitofp(val, lty) + +@lower_cast(types.Float, types.Integer) +def float_to_integer(context, builder, fromty, toty, val): + lty = context.get_value_type(toty) + if toty.signed: + return builder.fptosi(val, lty) + else: + return builder.fptoui(val, lty) + +@lower_cast(types.Float, types.Complex) +@lower_cast(types.Integer, types.Complex) +def non_complex_to_complex(context, builder, fromty, toty, val): + real = context.cast(builder, val, fromty, toty.underlying_float) + imag = context.get_constant(toty.underlying_float, 0) + + cmplx = context.make_complex(builder, toty) + cmplx.real = real + cmplx.imag = imag + return cmplx._getvalue() + +@lower_cast(types.Complex, types.Complex) +def complex_to_complex(context, builder, fromty, toty, val): + srcty = fromty.underlying_float + dstty = toty.underlying_float + + src = context.make_complex(builder, fromty, value=val) + dst = context.make_complex(builder, toty) + dst.real = context.cast(builder, src.real, srcty, dstty) + dst.imag = context.cast(builder, src.imag, srcty, dstty) + return dst._getvalue() + +@lower_cast(types.Any, types.Boolean) +def any_to_boolean(context, builder, fromty, toty, val): + return context.is_true(builder, fromty, val) + +@lower_cast(types.Boolean, types.Number) +def boolean_to_any(context, builder, fromty, toty, val): + # Casting from boolean to anything first casts to int32 + asint = builder.zext(val, ir.IntType(32)) + return context.cast(builder, asint, types.int32, toty) + +@lower_cast(types.IntegerLiteral, types.Boolean) +@lower_cast(types.BooleanLiteral, types.Boolean) +def literal_int_to_boolean(context, builder, fromty, toty, val): + lit = context.get_constant_generic( + builder, + fromty.literal_type, + fromty.literal_value, + ) + return context.is_true(builder, fromty.literal_type, lit) + +#------------------------------------------------------------------------------- +# Constants + +@lower_constant(types.Complex) +def constant_complex(context, builder, ty, pyval): + fty = ty.underlying_float + real = context.get_constant_generic(builder, fty, pyval.real) + imag = context.get_constant_generic(builder, fty, pyval.imag) + return Constant.literal_struct((real, imag)) + +@lower_constant(types.Integer) +@lower_constant(types.Float) +@lower_constant(types.Boolean) +def constant_integer(context, builder, ty, pyval): + # See https://github.com/numba/numba/issues/6979 + # llvmlite ir.IntType specialises the formatting of the constant for a + # cpython bool. A NumPy np.bool_ is not a cpython bool so force it to be one + # so that the constant renders correctly! + if isinstance(pyval, np.bool_): + pyval = bool(pyval) + lty = context.get_value_type(ty) + return lty(pyval) + + +#------------------------------------------------------------------------------- +# View + +def scalar_view(scalar, viewty): + """ Typing for the np scalar 'view' method. """ + if (isinstance(scalar, (types.Float, types.Integer)) + and isinstance(viewty, types.abstract.DTypeSpec)): + if scalar.bitwidth != viewty.dtype.bitwidth: + raise errors.TypingError( + "Changing the dtype of a 0d array is only supported if the " + "itemsize is unchanged") + + def impl(scalar, viewty): + return viewer(scalar, viewty) + return impl + + +overload_method(types.Float, 'view')(scalar_view) +overload_method(types.Integer, 'view')(scalar_view) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_tupleobj.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_tupleobj.py new file mode 100644 index 0000000000000000000000000000000000000000..7a76fea0e2ef9d4002be876f927aae454550e97e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/old_tupleobj.py @@ -0,0 +1,412 @@ +""" +Implementation of tuple objects +""" + +import operator + +from numba.core.imputils import (lower_builtin, lower_getattr_generic, + lower_cast, lower_constant, iternext_impl, + impl_ret_borrowed, impl_ret_untracked, + RefType) +from numba.core import typing, types, cgutils +from numba.core.extending import overload_method, overload, intrinsic + + +@lower_builtin(types.NamedTupleClass, types.VarArg(types.Any)) +def namedtuple_constructor(context, builder, sig, args): + # A namedtuple has the same representation as a regular tuple + # the arguments need casting (lower_cast) from the types in the ctor args + # to those in the ctor return type, this is to handle cases such as a + # literal present in the args, but a type present in the return type. + newargs = [] + for i, arg in enumerate(args): + casted = context.cast(builder, arg, sig.args[i], sig.return_type[i]) + newargs.append(casted) + res = context.make_tuple(builder, sig.return_type, tuple(newargs)) + # The tuple's contents are borrowed + return impl_ret_borrowed(context, builder, sig.return_type, res) + +@lower_builtin(operator.add, types.BaseTuple, types.BaseTuple) +def tuple_add(context, builder, sig, args): + left, right = [cgutils.unpack_tuple(builder, x) for x in args] + res = context.make_tuple(builder, sig.return_type, left + right) + # The tuple's contents are borrowed + return impl_ret_borrowed(context, builder, sig.return_type, res) + +def tuple_cmp_ordered(context, builder, op, sig, args): + tu, tv = sig.args + u, v = args + res = cgutils.alloca_once_value(builder, cgutils.true_bit) + bbend = builder.append_basic_block("cmp_end") + for i, (ta, tb) in enumerate(zip(tu.types, tv.types)): + a = builder.extract_value(u, i) + b = builder.extract_value(v, i) + not_equal = context.generic_compare(builder, operator.ne, (ta, tb), (a, b)) + with builder.if_then(not_equal): + pred = context.generic_compare(builder, op, (ta, tb), (a, b)) + builder.store(pred, res) + builder.branch(bbend) + # Everything matched equal => compare lengths + len_compare = op(len(tu.types), len(tv.types)) + pred = context.get_constant(types.boolean, len_compare) + builder.store(pred, res) + builder.branch(bbend) + builder.position_at_end(bbend) + return builder.load(res) + + +@lower_builtin(operator.eq, types.BaseTuple, types.BaseTuple) +def tuple_eq(context, builder, sig, args): + tu, tv = sig.args + u, v = args + if len(tu.types) != len(tv.types): + res = context.get_constant(types.boolean, False) + return impl_ret_untracked(context, builder, sig.return_type, res) + res = context.get_constant(types.boolean, True) + for i, (ta, tb) in enumerate(zip(tu.types, tv.types)): + a = builder.extract_value(u, i) + b = builder.extract_value(v, i) + pred = context.generic_compare(builder, operator.eq, (ta, tb), (a, b)) + res = builder.and_(res, pred) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.ne, types.BaseTuple, types.BaseTuple) +def tuple_ne(context, builder, sig, args): + res = builder.not_(tuple_eq(context, builder, sig, args)) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.lt, types.BaseTuple, types.BaseTuple) +def tuple_lt(context, builder, sig, args): + res = tuple_cmp_ordered(context, builder, operator.lt, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.le, types.BaseTuple, types.BaseTuple) +def tuple_le(context, builder, sig, args): + res = tuple_cmp_ordered(context, builder, operator.le, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.gt, types.BaseTuple, types.BaseTuple) +def tuple_gt(context, builder, sig, args): + res = tuple_cmp_ordered(context, builder, operator.gt, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +@lower_builtin(operator.ge, types.BaseTuple, types.BaseTuple) +def tuple_ge(context, builder, sig, args): + res = tuple_cmp_ordered(context, builder, operator.ge, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + +# for hashing see hashing.py + +@lower_getattr_generic(types.BaseNamedTuple) +def namedtuple_getattr(context, builder, typ, value, attr): + """ + Fetch a namedtuple's field. + """ + index = typ.fields.index(attr) + res = builder.extract_value(value, index) + return impl_ret_borrowed(context, builder, typ[index], res) + + +@lower_constant(types.UniTuple) +@lower_constant(types.NamedUniTuple) +def unituple_constant(context, builder, ty, pyval): + """ + Create a homogeneous tuple constant. + """ + consts = [context.get_constant_generic(builder, ty.dtype, v) + for v in pyval] + return impl_ret_borrowed( + context, builder, ty, cgutils.pack_array(builder, consts), + ) + +@lower_constant(types.Tuple) +@lower_constant(types.NamedTuple) +def unituple_constant(context, builder, ty, pyval): + """ + Create a heterogeneous tuple constant. + """ + consts = [context.get_constant_generic(builder, ty.types[i], v) + for i, v in enumerate(pyval)] + return impl_ret_borrowed( + context, builder, ty, cgutils.pack_struct(builder, consts), + ) + + +#------------------------------------------------------------------------------ +# Tuple iterators + +@lower_builtin('getiter', types.UniTuple) +@lower_builtin('getiter', types.NamedUniTuple) +def getiter_unituple(context, builder, sig, args): + [tupty] = sig.args + [tup] = args + + iterval = context.make_helper(builder, types.UniTupleIter(tupty)) + + index0 = context.get_constant(types.intp, 0) + indexptr = cgutils.alloca_once(builder, index0.type) + builder.store(index0, indexptr) + + iterval.index = indexptr + iterval.tuple = tup + + res = iterval._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin('iternext', types.UniTupleIter) +@iternext_impl(RefType.BORROWED) +def iternext_unituple(context, builder, sig, args, result): + [tupiterty] = sig.args + [tupiter] = args + + iterval = context.make_helper(builder, tupiterty, value=tupiter) + + tup = iterval.tuple + idxptr = iterval.index + idx = builder.load(idxptr) + count = context.get_constant(types.intp, tupiterty.container.count) + + is_valid = builder.icmp_signed('<', idx, count) + result.set_valid(is_valid) + + with builder.if_then(is_valid): + getitem_sig = typing.signature(tupiterty.container.dtype, + tupiterty.container, + types.intp) + getitem_out = getitem_unituple(context, builder, getitem_sig, + [tup, idx]) + # As a iternext_impl function, this will incref the yieled value. + # We need to release the new reference from getitem_unituple. + if context.enable_nrt: + context.nrt.decref(builder, tupiterty.container.dtype, getitem_out) + result.yield_(getitem_out) + nidx = builder.add(idx, context.get_constant(types.intp, 1)) + builder.store(nidx, iterval.index) + + +@overload(operator.getitem) +def getitem_literal_idx(tup, idx): + """ + Overloads BaseTuple getitem to cover cases where constant + inference and RewriteConstGetitems cannot replace it + with a static_getitem. + """ + if not (isinstance(tup, types.BaseTuple) + and isinstance(idx, types.IntegerLiteral)): + return None + + idx_val = idx.literal_value + def getitem_literal_idx_impl(tup, idx): + return tup[idx_val] + + return getitem_literal_idx_impl + + +@lower_builtin('typed_getitem', types.BaseTuple, types.Any) +def getitem_typed(context, builder, sig, args): + tupty, _ = sig.args + tup, idx = args + errmsg_oob = ("tuple index out of range",) + + if len(tupty) == 0: + # Empty tuple. + + # Always branch and raise IndexError + with builder.if_then(cgutils.true_bit): + context.call_conv.return_user_exc(builder, IndexError, + errmsg_oob) + # This is unreachable in runtime, + # but it exists to not terminate the current basicblock. + res = context.get_constant_null(sig.return_type) + return impl_ret_untracked(context, builder, + sig.return_type, res) + else: + # The tuple is not empty + + bbelse = builder.append_basic_block("typed_switch.else") + bbend = builder.append_basic_block("typed_switch.end") + switch = builder.switch(idx, bbelse) + + with builder.goto_block(bbelse): + context.call_conv.return_user_exc(builder, IndexError, + errmsg_oob) + + lrtty = context.get_value_type(sig.return_type) + voidptrty = context.get_value_type(types.voidptr) + with builder.goto_block(bbend): + phinode = builder.phi(voidptrty) + + for i in range(tupty.count): + ki = context.get_constant(types.intp, i) + bbi = builder.append_basic_block("typed_switch.%d" % i) + switch.add_case(ki, bbi) + # handle negative indexing, create case (-tuple.count + i) to + # reference same block as i + kin = context.get_constant(types.intp, -tupty.count + i) + switch.add_case(kin, bbi) + with builder.goto_block(bbi): + value = builder.extract_value(tup, i) + # Dragon warning... + # The fact the code has made it this far suggests that type + # inference decided whatever was being done with the item pulled + # from the tuple was legitimate, it is not the job of lowering + # to argue about that. However, here lies a problem, the tuple + # lowering is implemented as a switch table with each case + # writing to a phi node slot that is returned. The type of this + # phi node slot needs to be "correct" for the current type but + # it also needs to survive stores being made to it from the + # other cases that will in effect never run. To do this a stack + # slot is made for each case for the specific type and then cast + # to a void pointer type, this is then added as an incoming on + # the phi node, at the end of the switch the phi node is then + # cast back to the required return type for this typed_getitem. + # The only further complication is that if the value is not a + # pointer then the void* juggle won't work so a cast is made + # prior to store, again, that type inference has permitted it + # suggests this is safe. + # End Dragon warning... + DOCAST = context.typing_context.unify_types(sig.args[0][i], + sig.return_type) == sig.return_type + if DOCAST: + value_slot = builder.alloca(lrtty, + name="TYPED_VALUE_SLOT%s" % i) + casted = context.cast(builder, value, sig.args[0][i], + sig.return_type) + builder.store(casted, value_slot) + else: + value_slot = builder.alloca(value.type, + name="TYPED_VALUE_SLOT%s" % i) + builder.store(value, value_slot) + phinode.add_incoming(builder.bitcast(value_slot, voidptrty), + bbi) + builder.branch(bbend) + + builder.position_at_end(bbend) + res = builder.bitcast(phinode, lrtty.as_pointer()) + res = builder.load(res) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(operator.getitem, types.UniTuple, types.intp) +@lower_builtin(operator.getitem, types.UniTuple, types.uintp) +@lower_builtin(operator.getitem, types.NamedUniTuple, types.intp) +@lower_builtin(operator.getitem, types.NamedUniTuple, types.uintp) +def getitem_unituple(context, builder, sig, args): + tupty, _ = sig.args + tup, idx = args + + errmsg_oob = ("tuple index out of range",) + + if len(tupty) == 0: + # Empty tuple. + + # Always branch and raise IndexError + with builder.if_then(cgutils.true_bit): + context.call_conv.return_user_exc(builder, IndexError, + errmsg_oob) + # This is unreachable in runtime, + # but it exists to not terminate the current basicblock. + res = context.get_constant_null(sig.return_type) + return impl_ret_untracked(context, builder, + sig.return_type, res) + else: + # The tuple is not empty + bbelse = builder.append_basic_block("switch.else") + bbend = builder.append_basic_block("switch.end") + switch = builder.switch(idx, bbelse) + + with builder.goto_block(bbelse): + context.call_conv.return_user_exc(builder, IndexError, + errmsg_oob) + + lrtty = context.get_value_type(tupty.dtype) + with builder.goto_block(bbend): + phinode = builder.phi(lrtty) + + for i in range(tupty.count): + ki = context.get_constant(types.intp, i) + bbi = builder.append_basic_block("switch.%d" % i) + switch.add_case(ki, bbi) + # handle negative indexing, create case (-tuple.count + i) to + # reference same block as i + kin = context.get_constant(types.intp, -tupty.count + i) + switch.add_case(kin, bbi) + with builder.goto_block(bbi): + value = builder.extract_value(tup, i) + builder.branch(bbend) + phinode.add_incoming(value, bbi) + + builder.position_at_end(bbend) + res = phinode + assert sig.return_type == tupty.dtype + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin('static_getitem', types.LiteralStrKeyDict, types.StringLiteral) +@lower_builtin('static_getitem', types.LiteralList, types.IntegerLiteral) +@lower_builtin('static_getitem', types.LiteralList, types.SliceLiteral) +@lower_builtin('static_getitem', types.BaseTuple, types.IntegerLiteral) +@lower_builtin('static_getitem', types.BaseTuple, types.SliceLiteral) +def static_getitem_tuple(context, builder, sig, args): + tupty, idxty = sig.args + tup, idx = args + if isinstance(idx, int): + if idx < 0: + idx += len(tupty) + if not 0 <= idx < len(tupty): + raise IndexError("cannot index at %d in %s" % (idx, tupty)) + res = builder.extract_value(tup, idx) + elif isinstance(idx, slice): + items = cgutils.unpack_tuple(builder, tup)[idx] + res = context.make_tuple(builder, sig.return_type, items) + elif isinstance(tupty, types.LiteralStrKeyDict): + # pretend to be a dictionary + idx_val = idxty.literal_value + idx_offset = tupty.fields.index(idx_val) + res = builder.extract_value(tup, idx_offset) + else: + raise NotImplementedError("unexpected index %r for %s" + % (idx, sig.args[0])) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +#------------------------------------------------------------------------------ +# Implicit conversion + +@lower_cast(types.BaseTuple, types.BaseTuple) +def tuple_to_tuple(context, builder, fromty, toty, val): + if (isinstance(fromty, types.BaseNamedTuple) + or isinstance(toty, types.BaseNamedTuple)): + # Disallowed by typing layer + raise NotImplementedError + + if len(fromty) != len(toty): + # Disallowed by typing layer + raise NotImplementedError + + olditems = cgutils.unpack_tuple(builder, val, len(fromty)) + items = [context.cast(builder, v, f, t) + for v, f, t in zip(olditems, fromty, toty)] + return context.make_tuple(builder, toty, items) + + +#------------------------------------------------------------------------------ +# Methods + +@overload_method(types.BaseTuple, 'index') +def tuple_index(tup, value): + + def tuple_index_impl(tup, value): + for i in range(len(tup)): + if tup[i] == value: + return i + raise ValueError("tuple.index(x): x not in tuple") + + return tuple_index_impl + + +@overload(operator.contains) +def in_seq_empty_tuple(x, y): + if isinstance(x, types.Tuple) and not x.types: + return lambda x, y: False diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/printimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/printimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..8ce54004cf1ae3d62f2342c1c6d460c234e45274 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/printimpl.py @@ -0,0 +1,82 @@ +""" +This file implements print functionality for the CPU. +""" +from numba.core import types, typing, cgutils +from numba.core.imputils import Registry, impl_ret_untracked + +registry = Registry('printimpl') +lower = registry.lower + + +# NOTE: the current implementation relies on CPython API even in +# nopython mode. + + +@lower("print_item", types.Literal) +def print_item_impl(context, builder, sig, args): + """ + Print a single constant value. + """ + ty, = sig.args + val = ty.literal_value + + pyapi = context.get_python_api(builder) + + strobj = pyapi.unserialize(pyapi.serialize_object(val)) + pyapi.print_object(strobj) + pyapi.decref(strobj) + + res = context.get_dummy_value() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower("print_item", types.Any) +def print_item_impl(context, builder, sig, args): + """ + Print a single native value by boxing it in a Python object and + invoking the Python interpreter's print routine. + """ + ty, = sig.args + val, = args + + pyapi = context.get_python_api(builder) + env_manager = context.get_env_manager(builder) + + if context.enable_nrt: + context.nrt.incref(builder, ty, val) + + obj = pyapi.from_native_value(ty, val, env_manager) + with builder.if_else(cgutils.is_not_null(builder, obj), likely=True) as (if_ok, if_error): + with if_ok: + pyapi.print_object(obj) + pyapi.decref(obj) + with if_error: + cstr = context.insert_const_string(builder.module, + "the print() function") + strobj = pyapi.string_from_string(cstr) + pyapi.err_write_unraisable(strobj) + pyapi.decref(strobj) + + res = context.get_dummy_value() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower(print, types.VarArg(types.Any)) +def print_varargs_impl(context, builder, sig, args): + """ + A entire print() call. + """ + pyapi = context.get_python_api(builder) + gil = pyapi.gil_ensure() + + for i, (argtype, argval) in enumerate(zip(sig.args, args)): + signature = typing.signature(types.none, argtype) + imp = context.get_function("print_item", signature) + imp(builder, [argval]) + if i < len(args) - 1: + pyapi.print_string(' ') + pyapi.print_string('\n') + + pyapi.gil_release(gil) + res = context.get_dummy_value() + return impl_ret_untracked(context, builder, sig.return_type, res) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/randomimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/randomimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..03a3e23f63b60cde4785e67139d2e75b12b6d856 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/randomimpl.py @@ -0,0 +1,2336 @@ +""" +Implement the random and np.random module functions. +""" + + +import math +import random + +import numpy as np + +from llvmlite import ir + +from numba.core.cgutils import is_nonelike, is_empty_tuple +from numba.core.extending import intrinsic, overload, register_jitable +from numba.core.imputils import (Registry, impl_ret_untracked, + impl_ret_new_ref) +from numba.core.typing import signature +from numba.core import types, cgutils +from numba.core.errors import NumbaTypeError +from numba.np.random._constants import LONG_MAX + +registry = Registry('randomimpl') +lower = registry.lower + +int32_t = ir.IntType(32) +int64_t = ir.IntType(64) +def const_int(x): + return ir.Constant(int32_t, x) +double = ir.DoubleType() + +N = 624 +N_const = ir.Constant(int32_t, N) + + +# This is the same struct as rnd_state_t in _random.c. +rnd_state_t = ir.LiteralStructType([ + # index + int32_t, + # mt[N] + ir.ArrayType(int32_t, N), + # has_gauss + int32_t, + # gauss + double, + # is_initialized + int32_t, + ]) +rnd_state_ptr_t = ir.PointerType(rnd_state_t) + + +def get_state_ptr(context, builder, name): + """ + Get a pointer to the given thread-local random state + (depending on *name*: "py" or "np"). + If the state isn't initialized, it is lazily initialized with + system entropy. + """ + assert name in ('py', 'np', 'internal') + func_name = "numba_get_%s_random_state" % name + fnty = ir.FunctionType(rnd_state_ptr_t, ()) + fn = cgutils.get_or_insert_function(builder.module, fnty, func_name) + # These two attributes allow LLVM to hoist the function call + # outside of loops. + fn.attributes.add('readnone') + fn.attributes.add('nounwind') + return builder.call(fn, ()) + +def get_py_state_ptr(context, builder): + """ + Get a pointer to the thread-local Python random state. + """ + return get_state_ptr(context, builder, 'py') + +def get_np_state_ptr(context, builder): + """ + Get a pointer to the thread-local Numpy random state. + """ + return get_state_ptr(context, builder, 'np') + +def get_internal_state_ptr(context, builder): + """ + Get a pointer to the thread-local internal random state. + """ + return get_state_ptr(context, builder, 'internal') + +# Accessors +def get_index_ptr(builder, state_ptr): + return cgutils.gep_inbounds(builder, state_ptr, 0, 0) + +def get_array_ptr(builder, state_ptr): + return cgutils.gep_inbounds(builder, state_ptr, 0, 1) + +def get_has_gauss_ptr(builder, state_ptr): + return cgutils.gep_inbounds(builder, state_ptr, 0, 2) + +def get_gauss_ptr(builder, state_ptr): + return cgutils.gep_inbounds(builder, state_ptr, 0, 3) + +def get_rnd_shuffle(builder): + """ + Get the internal function to shuffle the MT taste. + """ + fnty = ir.FunctionType(ir.VoidType(), (rnd_state_ptr_t,)) + fn = cgutils.get_or_insert_function(builder.function.module, fnty, + "numba_rnd_shuffle") + fn.args[0].add_attribute("nocapture") + return fn + + +def get_next_int32(context, builder, state_ptr): + """ + Get the next int32 generated by the PRNG at *state_ptr*. + """ + idxptr = get_index_ptr(builder, state_ptr) + idx = builder.load(idxptr) + need_reshuffle = builder.icmp_unsigned('>=', idx, N_const) + with cgutils.if_unlikely(builder, need_reshuffle): + fn = get_rnd_shuffle(builder) + builder.call(fn, (state_ptr,)) + builder.store(const_int(0), idxptr) + idx = builder.load(idxptr) + array_ptr = get_array_ptr(builder, state_ptr) + y = builder.load(cgutils.gep_inbounds(builder, array_ptr, 0, idx)) + idx = builder.add(idx, const_int(1)) + builder.store(idx, idxptr) + # Tempering + y = builder.xor(y, builder.lshr(y, const_int(11))) + y = builder.xor(y, builder.and_(builder.shl(y, const_int(7)), + const_int(0x9d2c5680))) + y = builder.xor(y, builder.and_(builder.shl(y, const_int(15)), + const_int(0xefc60000))) + y = builder.xor(y, builder.lshr(y, const_int(18))) + return y + +def get_next_double(context, builder, state_ptr): + """ + Get the next double generated by the PRNG at *state_ptr*. + """ + # a = rk_random(state) >> 5, b = rk_random(state) >> 6; + a = builder.lshr(get_next_int32(context, builder, state_ptr), const_int(5)) + b = builder.lshr(get_next_int32(context, builder, state_ptr), const_int(6)) + + # return (a * 67108864.0 + b) / 9007199254740992.0; + a = builder.uitofp(a, double) + b = builder.uitofp(b, double) + return builder.fdiv( + builder.fadd(b, builder.fmul(a, ir.Constant(double, 67108864.0))), + ir.Constant(double, 9007199254740992.0)) + +def get_next_int(context, builder, state_ptr, nbits, is_numpy): + """ + Get the next integer with width *nbits*. + """ + c32 = ir.Constant(nbits.type, 32) + def get_shifted_int(nbits): + shift = builder.sub(c32, nbits) + y = get_next_int32(context, builder, state_ptr) + + # This truncation/extension is safe because 0 < nbits <= 64 + if nbits.type.width < y.type.width: + shift = builder.zext(shift, y.type) + elif nbits.type.width > y.type.width: + shift = builder.trunc(shift, y.type) + + if is_numpy: + # Use the last N bits, to match np.random + mask = builder.not_(ir.Constant(y.type, 0)) + mask = builder.lshr(mask, shift) + return builder.and_(y, mask) + else: + # Use the first N bits, to match CPython random + return builder.lshr(y, shift) + + ret = cgutils.alloca_once_value(builder, ir.Constant(int64_t, 0)) + + is_32b = builder.icmp_unsigned('<=', nbits, c32) + with builder.if_else(is_32b) as (ifsmall, iflarge): + with ifsmall: + low = get_shifted_int(nbits) + builder.store(builder.zext(low, int64_t), ret) + with iflarge: + # XXX This assumes nbits <= 64 + if is_numpy: + # Get the high bits first to match np.random + high = get_shifted_int(builder.sub(nbits, c32)) + low = get_next_int32(context, builder, state_ptr) + if not is_numpy: + # Get the high bits second to match CPython random + high = get_shifted_int(builder.sub(nbits, c32)) + total = builder.add( + builder.zext(low, int64_t), + builder.shl(builder.zext(high, int64_t), + ir.Constant(int64_t, 32))) + builder.store(total, ret) + + return builder.load(ret) + + +@overload(random.seed) +def seed_impl(a): + if isinstance(a, types.Integer): + fn = register_jitable(_seed_impl('py')) + def impl(a): + return fn(a) + return impl + + +@overload(np.random.seed) +def seed_impl(seed): + if isinstance(seed, types.Integer): + return _seed_impl('np') + + +def _seed_impl(state_type): + @intrinsic + def _impl(typingcontext, seed): + def codegen(context, builder, sig, args): + seed_value, = args + fnty = ir.FunctionType(ir.VoidType(), (rnd_state_ptr_t, int32_t)) + fn = cgutils.get_or_insert_function(builder.function.module, fnty, + 'numba_rnd_init') + builder.call(fn, (get_state_ptr(context, builder, state_type), + seed_value)) + return context.get_constant(types.none, None) + return signature(types.void, types.uint32), codegen + return lambda seed: _impl(seed) + + +@overload(random.random) +def random_impl(): + @intrinsic + def _impl(typingcontext): + def codegen(context, builder, sig, args): + state_ptr = get_state_ptr(context, builder, "py") + return get_next_double(context, builder, state_ptr) + return signature(types.double), codegen + return lambda: _impl() + + +@overload(np.random.random) +@overload(np.random.random_sample) +@overload(np.random.sample) +@overload(np.random.ranf) +def random_impl0(): + @intrinsic + def _impl(typingcontext): + def codegen(context, builder, sig, args): + state_ptr = get_state_ptr(context, builder, "np") + return get_next_double(context, builder, state_ptr) + return signature(types.float64), codegen + return lambda: _impl() + + +@overload(np.random.random) +@overload(np.random.random_sample) +@overload(np.random.sample) +@overload(np.random.ranf) +def random_impl1(size=None): + if is_nonelike(size): + return lambda size=None: np.random.random() + if is_empty_tuple(size): + # Handle size = () + return lambda size=None: np.array(np.random.random()) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer)): + def _impl(size=None): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.random() + return out + return _impl + + +@overload(random.gauss) +@overload(random.normalvariate) +def gauss_impl(mu, sigma): + if isinstance(mu, (types.Float, types.Integer)) and isinstance( + sigma, (types.Float, types.Integer)): + @intrinsic + def _impl(typingcontext, mu, sigma): + loc_preprocessor = _double_preprocessor(mu) + scale_preprocessor = _double_preprocessor(sigma) + return signature(types.float64, mu, sigma),\ + _gauss_impl("py", loc_preprocessor, scale_preprocessor) + return lambda mu, sigma: _impl(mu, sigma) + + +@overload(np.random.standard_normal) +@overload(np.random.normal) +def np_gauss_impl0(): + return lambda: np.random.normal(0.0, 1.0) + + +@overload(np.random.normal) +def np_gauss_impl1(loc): + if isinstance(loc, (types.Float, types.Integer)): + return lambda loc: np.random.normal(loc, 1.0) + + +@overload(np.random.normal) +def np_gauss_impl2(loc, scale): + if isinstance(loc, (types.Float, types.Integer)) and isinstance( + scale, (types.Float, types.Integer)): + @intrinsic + def _impl(typingcontext, loc, scale): + loc_preprocessor = _double_preprocessor(loc) + scale_preprocessor = _double_preprocessor(scale) + return signature(types.float64, loc, scale),\ + _gauss_impl("np", loc_preprocessor, scale_preprocessor) + return lambda loc, scale: _impl(loc, scale) + + +@overload(np.random.standard_normal) +def standard_normal_impl1(size): + if is_nonelike(size): + return lambda size: np.random.standard_normal() + if is_empty_tuple(size): + # Handle size = () + return lambda size: np.array(np.random.standard_normal()) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer)): + def _impl(size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.standard_normal() + return out + return _impl + + +@overload(np.random.normal) +def np_gauss_impl3(loc, scale, size): + if (isinstance(loc, (types.Float, types.Integer)) and isinstance( + scale, (types.Float, types.Integer)) and + is_nonelike(size)): + return lambda loc, scale, size: np.random.normal(loc, scale) + if (isinstance(loc, (types.Float, types.Integer)) and isinstance( + scale, (types.Float, types.Integer)) and + is_empty_tuple(size)): + # Handle size = () + return lambda loc, scale, size: np.array(np.random.normal(loc, scale)) + if (isinstance(loc, (types.Float, types.Integer)) and isinstance( + scale, (types.Float, types.Integer)) and + (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer)))): + def _impl(loc, scale, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.normal(loc, scale) + return out + return _impl + + +def _gauss_pair_impl(_random): + def compute_gauss_pair(): + """ + Compute a pair of numbers on the normal distribution. + """ + while True: + x1 = 2.0 * _random() - 1.0 + x2 = 2.0 * _random() - 1.0 + r2 = x1*x1 + x2*x2 + if r2 < 1.0 and r2 != 0.0: + break + + # Box-Muller transform + f = math.sqrt(-2.0 * math.log(r2) / r2) + return f * x1, f * x2 + return compute_gauss_pair + + +def _gauss_impl(state, loc_preprocessor, scale_preprocessor): + def _impl(context, builder, sig, args): + # The type for all computations (either float or double) + ty = sig.return_type + llty = context.get_data_type(ty) + _random = {"py": random.random, + "np": np.random.random}[state] + + state_ptr = get_state_ptr(context, builder, state) + + ret = cgutils.alloca_once(builder, llty, name="result") + + gauss_ptr = get_gauss_ptr(builder, state_ptr) + has_gauss_ptr = get_has_gauss_ptr(builder, state_ptr) + has_gauss = cgutils.is_true(builder, builder.load(has_gauss_ptr)) + with builder.if_else(has_gauss) as (then, otherwise): + with then: + # if has_gauss: return it + builder.store(builder.load(gauss_ptr), ret) + builder.store(const_int(0), has_gauss_ptr) + with otherwise: + # if not has_gauss: compute a pair of numbers using the Box-Muller + # transform; keep one and return the other + pair = context.compile_internal(builder, + _gauss_pair_impl(_random), + signature(types.UniTuple(ty, 2)), + ()) + + first, second = cgutils.unpack_tuple(builder, pair, 2) + builder.store(first, gauss_ptr) + builder.store(second, ret) + builder.store(const_int(1), has_gauss_ptr) + + mu, sigma = args + return builder.fadd(loc_preprocessor(builder, mu), + builder.fmul(scale_preprocessor(builder, sigma), + builder.load(ret))) + return _impl + + +def _double_preprocessor(value): + ty = ir.types.DoubleType() + + if isinstance(value, types.Integer): + if value.signed: + return lambda builder, v: builder.sitofp(v, ty) + else: + return lambda builder, v: builder.uitofp(v, ty) + elif isinstance(value, types.Float): + if value.bitwidth != 64: + return lambda builder, v: builder.fpext(v, ty) + else: + return lambda _builder, v: v + else: + raise NumbaTypeError("Cannot convert {} to floating point type" % value) + + +@overload(random.getrandbits) +def getrandbits_impl(k): + if isinstance(k, types.Integer): + @intrinsic + def _impl(typingcontext, k): + def codegen(context, builder, sig, args): + nbits, = args + + too_large = builder.icmp_unsigned(">=", nbits, const_int(65)) + too_small = builder.icmp_unsigned("==", nbits, const_int(0)) + with cgutils.if_unlikely(builder, builder.or_(too_large, + too_small)): + msg = "getrandbits() limited to 64 bits" + context.call_conv.return_user_exc(builder, OverflowError, + (msg,)) + state_ptr = get_state_ptr(context, builder, "py") + return get_next_int(context, builder, state_ptr, nbits, False) + return signature(types.uint64, k), codegen + return lambda k: _impl(k) + + +def _randrange_impl(context, builder, start, stop, step, ty, signed, state): + state_ptr = get_state_ptr(context, builder, state) + zero = ir.Constant(ty, 0) + one = ir.Constant(ty, 1) + nptr = cgutils.alloca_once(builder, ty, name="n") + + # n = stop - start + builder.store(builder.sub(stop, start), nptr) + + with builder.if_then(builder.icmp_signed('<', step, zero)): + # n = (n + step + 1) // step + w = builder.add(builder.add(builder.load(nptr), step), one) + n = builder.sdiv(w, step) + builder.store(n, nptr) + with builder.if_then(builder.icmp_signed('>', step, one)): + # n = (n + step - 1) // step + w = builder.sub(builder.add(builder.load(nptr), step), one) + n = builder.sdiv(w, step) + builder.store(n, nptr) + + n = builder.load(nptr) + with cgutils.if_unlikely(builder, builder.icmp_signed('<=', n, zero)): + # n <= 0 + msg = "empty range for randrange()" + context.call_conv.return_user_exc(builder, ValueError, (msg,)) + + fnty = ir.FunctionType(ty, [ty, cgutils.true_bit.type]) + fn = cgutils.get_or_insert_function(builder.function.module, fnty, + "llvm.ctlz.%s" % ty) + # Since the upper bound is exclusive, we need to subtract one before + # calculating the number of bits. This leads to a special case when + # n == 1; there's only one possible result, so we don't need bits from + # the PRNG. This case is handled separately towards the end of this + # function. CPython's implementation is simpler and just runs another + # iteration of the while loop when the resulting number is too large + # instead of subtracting one, to avoid needing to handle a special + # case. Thus, we only perform this subtraction for the NumPy case. + nm1 = builder.sub(n, one) if state == "np" else n + nbits = builder.trunc(builder.call(fn, [nm1, cgutils.true_bit]), int32_t) + nbits = builder.sub(ir.Constant(int32_t, ty.width), nbits) + + rptr = cgutils.alloca_once(builder, ty, name="r") + + def get_num(): + bbwhile = builder.append_basic_block("while") + bbend = builder.append_basic_block("while.end") + builder.branch(bbwhile) + + builder.position_at_end(bbwhile) + r = get_next_int(context, builder, state_ptr, nbits, state == "np") + r = builder.trunc(r, ty) + too_large = builder.icmp_signed('>=', r, n) + builder.cbranch(too_large, bbwhile, bbend) + + builder.position_at_end(bbend) + builder.store(r, rptr) + + if state == "np": + # Handle n == 1 case, per previous comment. + with builder.if_else(builder.icmp_signed('==', n, one)) as (is_one, is_not_one): + with is_one: + builder.store(zero, rptr) + with is_not_one: + get_num() + else: + get_num() + + return builder.add(start, builder.mul(builder.load(rptr), step)) + + +@overload(random.randrange) +def randrange_impl_1(start): + if isinstance(start, types.Integer): + return lambda start: random.randrange(0, start, 1) + + +@overload(random.randrange) +def randrange_impl_2(start, stop): + if isinstance(start, types.Integer) and isinstance(stop, types.Integer): + return lambda start, stop: random.randrange(start, stop, 1) + + +def _randrange_preprocessor(bitwidth, ty): + if ty.bitwidth != bitwidth: + return (ir.IRBuilder.sext if ty.signed + else ir.IRBuilder.zext) + else: + return lambda _builder, v, _ty: v + + +@overload(random.randrange) +def randrange_impl_3(start, stop, step): + if (isinstance(start, types.Integer) and isinstance(stop, types.Integer) and + isinstance(step, types.Integer)): + signed = max(start.signed, stop.signed, step.signed) + bitwidth = max(start.bitwidth, stop.bitwidth, step.bitwidth) + int_ty = types.Integer.from_bitwidth(bitwidth, signed) + llvm_type = ir.IntType(bitwidth) + + start_preprocessor = _randrange_preprocessor(bitwidth, start) + stop_preprocessor = _randrange_preprocessor(bitwidth, stop) + step_preprocessor = _randrange_preprocessor(bitwidth, step) + + @intrinsic + def _impl(typingcontext, start, stop, step): + def codegen(context, builder, sig, args): + start, stop, step = args + + start = start_preprocessor(builder, start, llvm_type) + stop = stop_preprocessor(builder, stop, llvm_type) + step = step_preprocessor(builder, step, llvm_type) + return _randrange_impl(context, builder, start, stop, step, + llvm_type, signed, 'py') + return signature(int_ty, start, stop, step), codegen + return lambda start, stop, step: _impl(start, stop, step) + + +@overload(random.randint) +def randint_impl_1(a, b): + if isinstance(a, types.Integer) and isinstance(b, types.Integer): + return lambda a, b: random.randrange(a, b + 1, 1) + + +@overload(np.random.randint) +def np_randint_impl_1(low): + if isinstance(low, types.Integer): + return lambda low: np.random.randint(0, low) + + +@overload(np.random.randint) +def np_randint_impl_2(low, high): + if isinstance(low, types.Integer) and isinstance(high, types.Integer): + signed = max(low.signed, high.signed) + bitwidth = max(low.bitwidth, high.bitwidth) + int_ty = types.Integer.from_bitwidth(bitwidth, signed) + llvm_type = ir.IntType(bitwidth) + + start_preprocessor = _randrange_preprocessor(bitwidth, low) + stop_preprocessor = _randrange_preprocessor(bitwidth, high) + + @intrinsic + def _impl(typingcontext, low, high): + def codegen(context, builder, sig, args): + start, stop = args + + start = start_preprocessor(builder, start, llvm_type) + stop = stop_preprocessor(builder, stop, llvm_type) + step = ir.Constant(llvm_type, 1) + return _randrange_impl(context, builder, start, stop, step, + llvm_type, signed, 'np') + return signature(int_ty, low, high), codegen + return lambda low, high: _impl(low, high) + + +@overload(np.random.randint) +def np_randint_impl_3(low, high, size): + if (isinstance(low, types.Integer) and isinstance(high, types.Integer) and + is_nonelike(size)): + return lambda low, high, size: np.random.randint(low, high) + if (isinstance(low, types.Integer) and isinstance(high, types.Integer) and + is_empty_tuple(size)): + # Handle size = () + return lambda low, high, size: np.array(np.random.randint(low, high)) + if (isinstance(low, types.Integer) and isinstance(high, types.Integer) and + (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer)))): + bitwidth = max(low.bitwidth, high.bitwidth) + result_type = getattr(np, f'int{bitwidth}') + + def _impl(low, high, size): + out = np.empty(size, dtype=result_type) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.randint(low, high) + return out + return _impl + + +@overload(np.random.uniform) +def np_uniform_impl0(): + return lambda: np.random.uniform(0.0, 1.0) + + +@overload(random.uniform) +def uniform_impl2(a, b): + if isinstance(a, (types.Float, types.Integer)) and isinstance( + b, (types.Float, types.Integer)): + @intrinsic + def _impl(typingcontext, a, b): + low_preprocessor = _double_preprocessor(a) + high_preprocessor = _double_preprocessor(b) + return signature(types.float64, a, b), uniform_impl( + 'py', low_preprocessor, high_preprocessor) + return lambda a, b: _impl(a, b) + + +@overload(np.random.uniform) +def np_uniform_impl2(low, high): + if isinstance(low, (types.Float, types.Integer)) and isinstance( + high, (types.Float, types.Integer)): + @intrinsic + def _impl(typingcontext, low, high): + low_preprocessor = _double_preprocessor(low) + high_preprocessor = _double_preprocessor(high) + return signature(types.float64, low, high), uniform_impl( + 'np', low_preprocessor, high_preprocessor) + return lambda low, high: _impl(low, high) + + +def uniform_impl(state, a_preprocessor, b_preprocessor): + def impl(context, builder, sig, args): + state_ptr = get_state_ptr(context, builder, state) + a, b = args + a = a_preprocessor(builder, a) + b = b_preprocessor(builder, b) + width = builder.fsub(b, a) + r = get_next_double(context, builder, state_ptr) + return builder.fadd(a, builder.fmul(width, r)) + return impl + + +@overload(np.random.uniform) +def np_uniform_impl3(low, high, size): + if (isinstance(low, (types.Float, types.Integer)) and isinstance( + high, (types.Float, types.Integer)) and + is_nonelike(size)): + return lambda low, high, size: np.random.uniform(low, high) + if (isinstance(low, (types.Float, types.Integer)) and isinstance( + high, (types.Float, types.Integer)) and + is_empty_tuple(size)): + # When calling np.random.uniform with size = (), the returned value isn't a + # float like when size = None. Instead, it's an array of shape () + return lambda low, high, size: np.array(np.random.uniform(low, high)) + if (isinstance(low, (types.Float, types.Integer)) and isinstance( + high, (types.Float, types.Integer)) and + (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer)))): + def _impl(low, high, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.uniform(low, high) + return out + return _impl + + +@overload(random.triangular) +def triangular_impl_2(low, high): + def _impl(low, high): + u = random.random() + c = 0.5 + if u > c: + u = 1.0 - u + low, high = high, low + return low + (high - low) * math.sqrt(u * c) + + if isinstance(low, (types.Float, types.Integer)) and isinstance( + high, (types.Float, types.Integer)): + return _impl + + +@overload(random.triangular) +def triangular_impl_3(low, high, mode): + if (isinstance(low, (types.Float, types.Integer)) and isinstance( + high, (types.Float, types.Integer)) and + isinstance(mode, (types.Float, types.Integer))): + def _impl(low, high, mode): + if high == low: + return low + u = random.random() + c = (mode - low) / (high - low) + if u > c: + u = 1.0 - u + c = 1.0 - c + low, high = high, low + return low + (high - low) * math.sqrt(u * c) + + return _impl + + +@overload(np.random.triangular) +def triangular_impl_3(left, mode, right): + if (isinstance(left, (types.Float, types.Integer)) and isinstance( + mode, (types.Float, types.Integer)) and + isinstance(right, (types.Float, types.Integer))): + def _impl(left, mode, right): + if right == left: + return left + u = np.random.random() + c = (mode - left) / (right - left) + if u > c: + u = 1.0 - u + c = 1.0 - c + left, right = right, left + return left + (right - left) * math.sqrt(u * c) + + return _impl + + +@overload(np.random.triangular) +def triangular_impl(left, mode, right, size=None): + if is_nonelike(size): + return lambda left, mode, right, size=None: np.random.triangular(left, + mode, + right) + if is_empty_tuple(size): + # Handle size = () + return lambda left, mode, right, size=None: np.array( + np.random.triangular(left, mode, right) + ) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer))): + def _impl(left, mode, right, size=None): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.triangular(left, mode, right) + return out + return _impl + + +@overload(random.gammavariate) +def gammavariate_impl(alpha, beta): + if isinstance(alpha, (types.Float, types.Integer)) and isinstance( + beta, (types.Float, types.Integer)): + return _gammavariate_impl(random.random) + + +@overload(np.random.standard_gamma) +@overload(np.random.gamma) +def ol_np_random_gamma1(shape): + if isinstance(shape, (types.Float, types.Integer)): + return lambda shape: np.random.gamma(shape, 1.0) + + +@overload(np.random.gamma) +def ol_np_random_gamma2(shape, scale): + if isinstance(shape, (types.Float, types.Integer)) and isinstance( + scale, (types.Float, types.Integer)): + fn = register_jitable(_gammavariate_impl(np.random.random)) + def impl(shape, scale): + return fn(shape, scale) + return impl + + +def _gammavariate_impl(_random): + def _impl(alpha, beta): + """Gamma distribution. Taken from CPython. + """ + SG_MAGICCONST = 1.0 + math.log(4.5) + # alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2 + + # Warning: a few older sources define the gamma distribution in terms + # of alpha > -1.0 + if alpha <= 0.0 or beta <= 0.0: + raise ValueError('gammavariate: alpha and beta must be > 0.0') + + if alpha > 1.0: + # Uses R.C.H. Cheng, "The generation of Gamma + # variables with non-integral shape parameters", + # Applied Statistics, (1977), 26, No. 1, p71-74 + ainv = math.sqrt(2.0 * alpha - 1.0) + bbb = alpha - math.log(4.0) + ccc = alpha + ainv + + while 1: + u1 = _random() + if not 1e-7 < u1 < .9999999: + continue + u2 = 1.0 - _random() + v = math.log(u1/(1.0-u1))/ainv + x = alpha*math.exp(v) + z = u1*u1*u2 + r = bbb+ccc*v-x + if r + SG_MAGICCONST - 4.5*z >= 0.0 or r >= math.log(z): + return x * beta + + elif alpha == 1.0: + # expovariate(1) + + # Adjust due to cpython + # commit 63d152232e1742660f481c04a811f824b91f6790 + return -math.log(1.0 - _random()) * beta + + else: # alpha is between 0 and 1 (exclusive) + # Uses ALGORITHM GS of Statistical Computing - Kennedy & Gentle + while 1: + u = _random() + b = (math.e + alpha)/math.e + p = b*u + if p <= 1.0: + x = p ** (1.0/alpha) + else: + x = -math.log((b-p)/alpha) + u1 = _random() + if p > 1.0: + if u1 <= x ** (alpha - 1.0): + break + elif u1 <= math.exp(-x): + break + return x * beta + return _impl + + +@overload(np.random.gamma) +def gamma_impl(shape, scale, size): + if is_nonelike(size): + return lambda shape, scale, size: np.random.gamma(shape, scale) + if is_empty_tuple(size): + # Handle size = () + return lambda shape, scale, size: np.array(np.random.gamma(shape, scale)) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer)): + def _impl(shape, scale, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.gamma(shape, scale) + return out + return _impl + + +@overload(np.random.standard_gamma) +def standard_gamma_impl(shape, size): + if is_nonelike(size): + return lambda shape, size: np.random.standard_gamma(shape) + if is_empty_tuple(size): + # Handle size = () + return lambda shape, size: np.array(np.random.standard_gamma(shape)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer))): + def _impl(shape, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.standard_gamma(shape) + return out + return _impl + + +@overload(random.betavariate) +def betavariate_impl(alpha, beta): + if isinstance(alpha, (types.Float, types.Integer)) and isinstance( + beta, (types.Float, types.Integer)): + return _betavariate_impl(random.gammavariate) + + +@overload(np.random.beta) +def ol_np_random_beta(a, b): + if isinstance(a, (types.Float, types.Integer)) and isinstance( + b, (types.Float, types.Integer)): + fn = register_jitable(_betavariate_impl(np.random.gamma)) + def impl(a, b): + return fn(a, b) + return impl + + +def _betavariate_impl(gamma): + def _impl(alpha, beta): + """Beta distribution. Taken from CPython. + """ + # This version due to Janne Sinkkonen, and matches all the std + # texts (e.g., Knuth Vol 2 Ed 3 pg 134 "the beta distribution"). + y = gamma(alpha, 1.) + if y == 0.0: + return 0.0 + else: + return y / (y + gamma(beta, 1.)) + return _impl + + +@overload(np.random.beta) +def beta_impl(a, b, size): + if is_nonelike(size): + return lambda a, b, size: np.random.beta(a, b) + if is_empty_tuple(size): + # When calling np.random.beta with size = (), the returned value isn't a + # float like when size = None. Instead, it's an array of shape () + return lambda a, b, size: np.array(np.random.beta(a, b)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer))): + def _impl(a, b, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.beta(a, b) + return out + return _impl + + +@overload(random.expovariate) +def expovariate_impl(lambd): + if isinstance(lambd, types.Float): + def _impl(lambd): + """Exponential distribution. Taken from CPython. + """ + # lambd: rate lambd = 1/mean + # ('lambda' is a Python reserved word) + + # we use 1-random() instead of random() to preclude the + # possibility of taking the log of zero. + return -math.log(1.0 - random.random()) / lambd + + return _impl + + +@overload(np.random.exponential) +def exponential_impl(scale): + if isinstance(scale, (types.Float, types.Integer)): + def _impl(scale): + return -math.log(1.0 - np.random.random()) * scale + return _impl + + +@overload(np.random.exponential) +def exponential_impl(scale, size): + if is_nonelike(size): + return lambda scale, size: np.random.exponential(scale) + if is_empty_tuple(size): + # Handle size = () + return lambda scale, size: np.array(np.random.exponential(scale)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer))): + def _impl(scale, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.exponential(scale) + return out + return _impl + + +@overload(np.random.standard_exponential) +@overload(np.random.exponential) +def exponential_impl(): + def _impl(): + return -math.log(1.0 - np.random.random()) + return _impl + + +@overload(np.random.standard_exponential) +def standard_exponential_impl(size): + if is_nonelike(size): + return lambda size: np.random.standard_exponential() + if is_empty_tuple(size): + # Handle size = () + return lambda size: np.array(np.random.standard_exponential()) + if (isinstance(size, types.Integer) or + (isinstance(size, types.UniTuple) and isinstance(size.dtype, + types.Integer)) + ): + def _impl(size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.standard_exponential() + return out + return _impl + + +@overload(np.random.lognormal) +def np_lognormal_impl0(): + return lambda: np.random.lognormal(0.0, 1.0) + + +@overload(np.random.lognormal) +def np_log_normal_impl1(mean): + if isinstance(mean, (types.Float, types.Integer)): + return lambda mean: np.random.lognormal(mean, 1.0) + + +@overload(np.random.lognormal) +def np_log_normal_impl2(mean, sigma): + if isinstance(mean, (types.Float, types.Integer)) and isinstance( + sigma, (types.Float, types.Integer)): + fn = register_jitable(_lognormvariate_impl(np.random.normal)) + return lambda mean, sigma: fn(mean, sigma) + + +@overload(np.random.lognormal) +def lognormal_impl(mean, sigma, size): + if is_nonelike(size): + return lambda mean, sigma, size: np.random.lognormal(mean, sigma) + if is_empty_tuple(size): + # Handle size = () + return lambda mean, sigma, size: np.array(np.random.lognormal(mean, sigma)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer))): + def _impl(mean, sigma, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.lognormal(mean, sigma) + return out + return _impl + + +@overload(random.lognormvariate) +def lognormvariate_impl(mu, sigma): + if isinstance(mu, types.Float) and isinstance(sigma, types.Float): + fn = register_jitable(_lognormvariate_impl(random.gauss)) + return lambda mu, sigma: fn(mu, sigma) + + +def _lognormvariate_impl(_gauss): + return lambda mu, sigma: math.exp(_gauss(mu, sigma)) + + +@overload(random.paretovariate) +def paretovariate_impl(alpha): + if isinstance(alpha, types.Float): + def _impl(alpha): + """Pareto distribution. Taken from CPython.""" + # Jain, pg. 495 + u = 1.0 - random.random() + return 1.0 / u ** (1.0/alpha) + + return _impl + + +@overload(np.random.pareto) +def pareto_impl(a): + if isinstance(a, types.Float): + def _impl(a): + # Same as paretovariate() - 1. + u = 1.0 - np.random.random() + return 1.0 / u ** (1.0/a) - 1 + + return _impl + + +@overload(np.random.pareto) +def pareto_impl(a, size): + if is_nonelike(size): + return lambda a, size: np.random.pareto(a) + if is_empty_tuple(size): + # Handle size = () + return lambda a, size: np.array(np.random.pareto(a)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer))): + def _impl(a, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.pareto(a) + return out + return _impl + + +@overload(random.weibullvariate) +def weibullvariate_impl(alpha, beta): + if isinstance(alpha, (types.Float, types.Integer)) and isinstance( + beta, (types.Float, types.Integer)): + def _impl(alpha, beta): + """Weibull distribution. Taken from CPython.""" + # Jain, pg. 499; bug fix courtesy Bill Arms + u = 1.0 - random.random() + return alpha * (-math.log(u)) ** (1.0/beta) + + return _impl + + +@overload(np.random.weibull) +def weibull_impl(a): + if isinstance(a, (types.Float, types.Integer)): + def _impl(a): + # Same as weibullvariate(1.0, a) + u = 1.0 - np.random.random() + return (-math.log(u)) ** (1.0/a) + + return _impl + + +@overload(np.random.weibull) +def weibull_impl2(a, size): + if is_nonelike(size): + return lambda a, size: np.random.weibull(a) + if is_empty_tuple(size): + # Handle size = () + return lambda a, size: np.array(np.random.weibull(a)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer))): + def _impl(a, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.weibull(a) + return out + return _impl + + +@overload(random.vonmisesvariate) +def vonmisesvariate_impl(mu, kappa): + if isinstance(mu, types.Float) and isinstance(kappa, types.Float): + return _vonmisesvariate_impl(random.random) + + +@overload(np.random.vonmises) +def vonmisesvariate_impl(mu, kappa): + if isinstance(mu, types.Float) and isinstance(kappa, types.Float): + return _vonmisesvariate_impl(np.random.random) + + +def _vonmisesvariate_impl(_random): + def _impl(mu, kappa): + """Circular data distribution. Taken from CPython. + Note the algorithm in Python 2.6 and Numpy is different: + http://bugs.python.org/issue17141 + """ + # mu: mean angle (in radians between 0 and 2*pi) + # kappa: concentration parameter kappa (>= 0) + # if kappa = 0 generate uniform random angle + + # Based upon an algorithm published in: Fisher, N.I., + # "Statistical Analysis of Circular Data", Cambridge + # University Press, 1993. + + # Thanks to Magnus Kessler for a correction to the + # implementation of step 4. + if kappa <= 1e-6: + return 2.0 * math.pi * _random() + + s = 0.5 / kappa + r = s + math.sqrt(1.0 + s * s) + + while 1: + u1 = _random() + z = math.cos(math.pi * u1) + + d = z / (r + z) + u2 = _random() + if u2 < 1.0 - d * d or u2 <= (1.0 - d) * math.exp(d): + break + + q = 1.0 / r + f = (q + z) / (1.0 + q * z) + u3 = _random() + if u3 > 0.5: + theta = (mu + math.acos(f)) % (2.0 * math.pi) + else: + theta = (mu - math.acos(f)) % (2.0 * math.pi) + + return theta + + return _impl + + +@overload(np.random.vonmises) +def vonmises_impl(mu, kappa, size): + if is_nonelike(size): + return lambda mu, kappa, size: np.random.vonmises(mu, kappa) + if is_empty_tuple(size): + # Handle size = () + return lambda mu, kappa, size: np.array(np.random.vonmises(mu, kappa)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer))): + def _impl(mu, kappa, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.vonmises(mu, kappa) + return out + return _impl + + +@overload(np.random.binomial) +def binomial_impl(n, p): + if isinstance(n, types.Integer) and isinstance( + p, (types.Float, types.Integer)): + def _impl(n, p): + """ + Binomial distribution. Numpy's variant of the BINV algorithm + is used. + (Numpy uses BTPE for n*p >= 30, though) + """ + if n < 0: + raise ValueError("binomial(): n <= 0") + if not (0.0 <= p <= 1.0): + raise ValueError("binomial(): p outside of [0, 1]") + if p == 0.0: + return 0 + if p == 1.0: + return n + + flipped = p > 0.5 + if flipped: + p = 1.0 - p + q = 1.0 - p + + niters = 1 + qn = q ** n + while qn <= 1e-308: + # Underflow => split into several iterations + # Note this is much slower than Numpy's BTPE + niters <<= 2 + n >>= 2 + qn = q ** n + assert n > 0 + + np_prod = n * p + bound = min(n, np_prod + 10.0 * math.sqrt(np_prod * q + 1)) + + total = 0 + while niters > 0: + X = 0 + U = np.random.random() + px = qn + while X <= bound: + if U <= px: + total += n - X if flipped else X + niters -= 1 + break + U -= px + X += 1 + px = ((n - X + 1) * p * px) / (X * q) + + return total + + return _impl + + +@overload(np.random.binomial) +def binomial_impl(n, p, size): + if is_nonelike(size): + return lambda n, p, size: np.random.binomial(n, p) + if is_empty_tuple(size): + # When calling np.random.binomial with size = (), the returned value isn't a + # float like when size = None. Instead, it's an array of shape () + return lambda n, p, size: np.array(np.random.binomial(n, p)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer))): + def _impl(n, p, size): + out = np.empty(size, dtype=np.intp) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.binomial(n, p) + return out + return _impl + + +@overload(np.random.chisquare) +def chisquare_impl(df): + if isinstance(df, (types.Float, types.Integer)): + def _impl(df): + return 2.0 * np.random.standard_gamma(df / 2.0) + + return _impl + + +@overload(np.random.chisquare) +def chisquare_impl2(df, size): + if is_nonelike(size): + return lambda df, size: np.random.chisquare(df) + if is_empty_tuple(size): + return lambda df, size: np.array(np.random.chisquare(df)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer))): + def _impl(df, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.chisquare(df) + return out + return _impl + + +@overload(np.random.f) +def f_impl(dfnum, dfden): + if isinstance(dfnum, (types.Float, types.Integer)) and isinstance( + dfden, (types.Float, types.Integer)): + def _impl(dfnum, dfden): + return ((np.random.chisquare(dfnum) * dfden) / + (np.random.chisquare(dfden) * dfnum)) + + return _impl + + +@overload(np.random.f) +def f_impl(dfnum, dfden, size): + if (isinstance(dfnum, (types.Float, types.Integer)) and isinstance( + dfden, (types.Float, types.Integer)) and + is_nonelike(size)): + return lambda dfnum, dfden, size: np.random.f(dfnum, dfden) + if (isinstance(dfnum, (types.Float, types.Integer)) and isinstance( + dfden, (types.Float, types.Integer)) and + is_empty_tuple(size)): + # Handle size = () + return lambda dfnum, dfden, size: np.array(np.random.f(dfnum, dfden)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer))): + def _impl(dfnum, dfden, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.f(dfnum, dfden) + return out + return _impl + + +@overload(np.random.geometric) +def geometric_impl(p): + if isinstance(p, (types.Float, types.Integer)): + def _impl(p): + # Numpy's algorithm. + if p <= 0.0 or p > 1.0: + raise ValueError("geometric(): p outside of (0, 1]") + q = 1.0 - p + if p >= 0.333333333333333333333333: + X = int(1) + sum = prod = p + U = np.random.random() + while U > sum: + prod *= q + sum += prod + X += 1 + return X + else: + return math.ceil(math.log(1.0 - np.random.random()) / + math.log(q)) + + return _impl + + +@overload(np.random.geometric) +def geometric_impl(p, size): + if is_nonelike(size): + return lambda p, size: np.random.geometric(p) + if is_empty_tuple(size): + # Handle size = () + return lambda p, size: np.array(np.random.geometric(p)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer))): + def _impl(p, size): + out = np.empty(size, dtype=np.int64) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.geometric(p) + return out + return _impl + + +@overload(np.random.gumbel) +def gumbel_impl(loc, scale): + if isinstance(loc, (types.Float, types.Integer)) and isinstance( + scale, (types.Float, types.Integer)): + def _impl(loc, scale): + U = 1.0 - np.random.random() + return loc - scale * math.log(-math.log(U)) + + return _impl + + +@overload(np.random.gumbel) +def gumbel_impl3(loc, scale, size): + if is_nonelike(size): + return lambda loc, scale, size: np.random.gumbel(loc, scale) + if is_empty_tuple(size): + # Handle size = () + return lambda loc, scale, size: np.array(np.random.gumbel(loc, scale)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer))): + def _impl(loc, scale, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.gumbel(loc, scale) + return out + return _impl + + +@overload(np.random.hypergeometric) +def hypergeometric_impl(ngood, nbad, nsample): + if (isinstance(ngood, (types.Float, types.Integer)) and isinstance( + nbad, (types.Float, types.Integer)) + and isinstance(nsample, (types.Float, types.Integer))): + def _impl(ngood, nbad, nsample): + """Numpy's algorithm for hypergeometric().""" + d1 = int(nbad) + int(ngood) - int(nsample) + d2 = float(min(nbad, ngood)) + + Y = d2 + K = int(nsample) + while Y > 0.0 and K > 0: + Y -= math.floor(np.random.random() + Y / (d1 + K)) + K -= 1 + Z = int(d2 - Y) + if ngood > nbad: + return int(nsample) - Z + else: + return Z + + return _impl + + +@overload(np.random.hypergeometric) +def hypergeometric_impl(ngood, nbad, nsample, size): + if is_nonelike(size): + return lambda ngood, nbad, nsample, size:\ + np.random.hypergeometric(ngood, nbad, nsample) + if is_empty_tuple(size): + # Handle size = () + return lambda ngood, nbad, nsample, size:\ + np.array(np.random.hypergeometric(ngood, nbad, nsample)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer))): + def _impl(ngood, nbad, nsample, size): + out = np.empty(size, dtype=np.intp) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.hypergeometric(ngood, nbad, nsample) + return out + return _impl + + +@overload(np.random.laplace) +def laplace_impl0(): + return lambda: np.random.laplace(0.0, 1.0) + + +@overload(np.random.laplace) +def laplace_impl1(loc): + if isinstance(loc, (types.Float, types.Integer)): + return lambda loc: np.random.laplace(loc, 1.0) + + +@overload(np.random.laplace) +def laplace_impl2(loc, scale): + if isinstance(loc, (types.Float, types.Integer)) and isinstance( + scale, (types.Float, types.Integer)): + return laplace_impl + + +@overload(np.random.laplace) +def laplace_impl3(loc, scale, size): + if is_nonelike(size): + return lambda loc, scale, size: np.random.laplace(loc, scale) + if is_empty_tuple(size): + # Handle size = () + return lambda loc, scale, size: np.array(np.random.laplace(loc, scale)) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer)): + def _impl(loc, scale, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.laplace(loc, scale) + return out + return _impl + + +def laplace_impl(loc, scale): + U = np.random.random() + if U < 0.5: + return loc + scale * math.log(U + U) + else: + return loc - scale * math.log(2.0 - U - U) + + +@overload(np.random.logistic) +def logistic_impl0(): + return lambda: np.random.logistic(0.0, 1.0) + + +@overload(np.random.logistic) +def logistic_impl1(loc): + if isinstance(loc, (types.Float, types.Integer)): + return lambda loc: np.random.logistic(loc, 1.0) + + +@overload(np.random.logistic) +def logistic_impl2(loc, scale): + if isinstance(loc, (types.Float, types.Integer)) and isinstance( + scale, (types.Float, types.Integer)): + return logistic_impl + + +@overload(np.random.logistic) +def logistic_impl3(loc, scale, size): + if is_nonelike(size): + return lambda loc, scale, size: np.random.logistic(loc, scale) + if is_empty_tuple(size): + # Handle size = () + return lambda loc, scale, size: np.array(np.random.logistic(loc, scale)) + if (isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer))): + def _impl(loc, scale, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.logistic(loc, scale) + return out + return _impl + + +def logistic_impl(loc, scale): + U = np.random.random() + return loc + scale * math.log(U / (1.0 - U)) + + +def _logseries_impl(p): + """Numpy's algorithm for logseries().""" + if p <= 0.0 or p > 1.0: + raise ValueError("logseries(): p outside of (0, 1]") + r = math.log(1.0 - p) + + while 1: + V = np.random.random() + if V >= p: + return 1 + U = np.random.random() + q = 1.0 - math.exp(r * U) + if V <= q * q: + # XXX what if V == 0.0 ? + return np.int64(1.0 + math.log(V) / math.log(q)) + elif V >= q: + return 1 + else: + return 2 + + +@overload(np.random.logseries) +def logseries_impl(p): + if isinstance(p, (types.Float, types.Integer)): + return _logseries_impl + + +@overload(np.random.logseries) +def logseries_impl(p, size): + if is_nonelike(size): + return lambda p, size: np.random.logseries(p) + if is_empty_tuple(size): + return lambda p, size: np.array(np.random.logseries(p)) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer)): + def _impl(p, size): + out = np.empty(size, dtype=np.int64) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.logseries(p) + return out + return _impl + + +@overload(np.random.negative_binomial) +def negative_binomial_impl(n, p): + if isinstance(n, types.Integer) and isinstance( + p,(types.Float, types.Integer)): + def _impl(n, p): + if n <= 0: + raise ValueError("negative_binomial(): n <= 0") + if p < 0.0 or p > 1.0: + raise ValueError("negative_binomial(): p outside of [0, 1]") + Y = np.random.gamma(n, (1.0 - p) / p) + return np.random.poisson(Y) + + return _impl + + +@overload(np.random.poisson) +def poisson_impl0(): + return lambda: np.random.poisson(1.0) + + +@overload(np.random.poisson) +def poisson_impl1(lam): + if isinstance(lam, (types.Float, types.Integer)): + @intrinsic + def _impl(typingcontext, lam): + lam_preprocessor = _double_preprocessor(lam) + + def codegen(context, builder, sig, args): + state_ptr = get_np_state_ptr(context, builder) + + retptr = cgutils.alloca_once(builder, int64_t, name="ret") + bbcont = builder.append_basic_block("bbcont") + bbend = builder.append_basic_block("bbend") + + lam, = args + lam = lam_preprocessor(builder, lam) + big_lam = builder.fcmp_ordered('>=', lam, + ir.Constant(double, 10.0)) + with builder.if_then(big_lam): + # For lambda >= 10.0, we switch to a more accurate + # algorithm (see _random.c). + fnty = ir.FunctionType(int64_t, (rnd_state_ptr_t, double)) + fn = cgutils.get_or_insert_function(builder.function.module, + fnty, + "numba_poisson_ptrs") + ret = builder.call(fn, (state_ptr, lam)) + builder.store(ret, retptr) + builder.branch(bbend) + + builder.branch(bbcont) + builder.position_at_end(bbcont) + + _random = np.random.random + _exp = math.exp + + def poisson_impl(lam): + """Numpy's algorithm for poisson() on small *lam*. + + This method is invoked only if the parameter lambda of the + distribution is small ( < 10 ). The algorithm used is + described in "Knuth, D. 1969. 'Seminumerical Algorithms. + The Art of Computer Programming' vol 2. + """ + if lam < 0.0: + raise ValueError("poisson(): lambda < 0") + if lam == 0.0: + return 0 + enlam = _exp(-lam) + X = 0 + prod = 1.0 + while 1: + U = _random() + prod *= U + if prod <= enlam: + return X + X += 1 + + ret = context.compile_internal(builder, poisson_impl, sig, args) + builder.store(ret, retptr) + builder.branch(bbend) + builder.position_at_end(bbend) + return builder.load(retptr) + return signature(types.int64, lam), codegen + return lambda lam: _impl(lam) + + +@overload(np.random.poisson) +def poisson_impl2(lam, size): + if isinstance(lam, (types.Float, types.Integer)) and is_nonelike(size): + return lambda lam, size: np.random.poisson(lam) + if isinstance(lam, (types.Float, types.Integer)) and is_empty_tuple(size): + # Handle size = () + return lambda lam, size: np.array(np.random.poisson(lam)) + if isinstance(lam, (types.Float, types.Integer)) and ( + isinstance(size, types.Integer) or + (isinstance(size, types.UniTuple) and isinstance(size.dtype, + types.Integer)) + ): + def _impl(lam, size): + out = np.empty(size, dtype=np.intp) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.poisson(lam) + return out + return _impl + + +@overload(np.random.power) +def power_impl(a): + if isinstance(a, (types.Float, types.Integer)): + def _impl(a): + if a <= 0.0: + raise ValueError("power(): a <= 0") + return math.pow(1 - math.exp(-np.random.standard_exponential()), + 1./a) + + return _impl + + +@overload(np.random.power) +def power_impl(a, size): + if is_nonelike(size): + return lambda a, size: np.random.power(a) + if is_empty_tuple(size): + # Handle size = () + return lambda a, size: np.array(np.random.power(a)) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer)): + def _impl(a, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.power(a) + return out + return _impl + + +@overload(np.random.rayleigh) +def rayleigh_impl0(): + return lambda: np.random.rayleigh(1.0) + + +@overload(np.random.rayleigh) +def rayleigh_impl1(scale): + if isinstance(scale, (types.Float, types.Integer)): + def impl(scale): + if scale <= 0.0: + raise ValueError("rayleigh(): scale <= 0") + return scale * math.sqrt(-2.0 * math.log(1.0 - np.random.random())) + return impl + + + + +@overload(np.random.rayleigh) +def rayleigh_impl2(scale, size): + if is_nonelike(size): + return lambda scale, size: np.random.rayleigh(scale) + if is_empty_tuple(size): + # Handle size = () + return lambda scale, size: np.array(np.random.rayleigh(scale)) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer)): + def _impl(scale, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.rayleigh(scale) + return out + return _impl + + +@overload(np.random.standard_cauchy) +def cauchy_impl(): + def _impl(): + return np.random.standard_normal() / np.random.standard_normal() + + return _impl + + +@overload(np.random.standard_cauchy) +def standard_cauchy_impl(size): + if is_nonelike(size): + return lambda size: np.random.standard_cauchy() + if is_empty_tuple(size): + # Handle size = () + return lambda size: np.array(np.random.standard_cauchy()) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer)): + def _impl(size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.standard_cauchy() + return out + return _impl + + +@overload(np.random.standard_t) +def standard_t_impl(df): + if isinstance(df, (types.Float, types.Integer)): + def _impl(df): + N = np.random.standard_normal() + G = np.random.standard_gamma(df / 2.0) + X = math.sqrt(df / 2.0) * N / math.sqrt(G) + return X + + return _impl + + +@overload(np.random.standard_t) +def standard_t_impl2(df, size): + if is_nonelike(size): + return lambda df, size: np.random.standard_t(df) + if is_empty_tuple(size): + return lambda df, size: np.array(np.random.standard_t(df)) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer)): + def _impl(df, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.standard_t(df) + return out + return _impl + + +@overload(np.random.wald) +def wald_impl(mean, scale): + if isinstance(mean, types.Float) and isinstance(scale, types.Float): + def _impl(mean, scale): + if mean <= 0.0: + raise ValueError("wald(): mean <= 0") + if scale <= 0.0: + raise ValueError("wald(): scale <= 0") + mu_2l = mean / (2.0 * scale) + Y = np.random.standard_normal() + Y = mean * Y * Y + X = mean + mu_2l * (Y - math.sqrt(4 * scale * Y + Y * Y)) + U = np.random.random() + if U <= mean / (mean + X): + return X + else: + return mean * mean / X + + return _impl + + +@overload(np.random.wald) +def wald_impl2(mean, scale, size): + if is_nonelike(size): + return lambda mean, scale, size: np.random.wald(mean, scale) + if is_empty_tuple(size): + # Handle size = () + return lambda mean, scale, size: np.array(np.random.wald(mean, scale)) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer)): + def _impl(mean, scale, size): + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.wald(mean, scale) + return out + return _impl + + +@overload(np.random.zipf) +def zipf_impl(a): + if isinstance(a, types.Float): + def _impl(a): + if a <= 1.0: + raise ValueError("zipf(): a <= 1") + am1 = a - 1.0 + b = 2.0 ** am1 + while 1: + U = 1.0 - np.random.random() + V = np.random.random() + X = int(math.floor(U ** (-1.0 / am1))) + + if (X > LONG_MAX or X < 1.0): + continue + + T = (1.0 + 1.0 / X) ** am1 + if X >= 1 and V * X * (T - 1.0) / (b - 1.0) <= (T / b): + return X + + return _impl + + +@overload(np.random.zipf) +def zipf_impl(a, size): + if is_nonelike(size): + return lambda a, size: np.random.zipf(a) + if is_empty_tuple(size): + # Handle size = () + return lambda a, size: np.array(np.random.zipf(a)) + if isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) and + isinstance(size.dtype, + types.Integer)): + def _impl(a, size): + out = np.empty(size, dtype=np.intp) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = np.random.zipf(a) + return out + return _impl + +def do_shuffle_impl(x, rng): + + if not isinstance(x, types.Buffer): + msg = "The argument to shuffle() should be a buffer type" + raise NumbaTypeError(msg) + + if rng == "np": + rand = np.random.randint + elif rng == "py": + rand = random.randrange + + if x.ndim == 1: + def impl(x): + i = x.shape[0] - 1 + while i > 0: + j = rand(i + 1) + x[i], x[j] = x[j], x[i] + i -= 1 + else: + def impl(x): + i = x.shape[0] - 1 + while i > 0: + j = rand(i + 1) + x[i], x[j] = np.copy(x[j]), np.copy(x[i]) + i -= 1 + + return impl + + +@overload(random.shuffle) +def shuffle_impl(x): + return do_shuffle_impl(x, "py") + + +@overload(np.random.shuffle) +def shuffle_impl(x): + return do_shuffle_impl(x, "np") + + +@overload(np.random.permutation) +def permutation_impl(x): + if isinstance(x, types.Integer): + def permutation_impl(x): + y = np.arange(x) + np.random.shuffle(y) + return y + elif isinstance(x, types.Array): + def permutation_impl(x): + arr_copy = x.copy() + np.random.shuffle(arr_copy) + return arr_copy + else: + permutation_impl = None + return permutation_impl + + +# ------------------------------------------------------------------------ +# Irregular aliases: np.random.rand, np.random.randn + +@overload(np.random.rand) +def rand(*size): + if len(size) == 0: + # Scalar output + def rand_impl(*size): + return np.random.random() + + else: + # Array output + def rand_impl(*size): + return np.random.random(size) + + return rand_impl + + +@overload(np.random.randn) +def randn(*size): + if len(size) == 0: + # Scalar output + def randn_impl(*size): + return np.random.standard_normal() + + else: + # Array output + def randn_impl(*size): + return np.random.standard_normal(size) + + return randn_impl + + +# ------------------------------------------------------------------------ +# np.random.choice + +@overload(np.random.choice) +def choice(a, size=None, replace=True): + + if isinstance(a, types.Array): + # choice() over an array population + assert a.ndim == 1 + dtype = a.dtype + + @register_jitable + def get_source_size(a): + return len(a) + + @register_jitable + def copy_source(a): + return a.copy() + + @register_jitable + def getitem(a, a_i): + return a[a_i] + + elif isinstance(a, types.Integer): + # choice() over an implied arange() population + dtype = np.intp + + @register_jitable + def get_source_size(a): + return a + + @register_jitable + def copy_source(a): + return np.arange(a) + + @register_jitable + def getitem(a, a_i): + return a_i + + else: + raise NumbaTypeError("np.random.choice() first argument should be " + "int or array, got %s" % (a,)) + + if size in (None, types.none): + def choice_impl(a, size=None, replace=True): + """ + choice() implementation returning a single sample + (note *replace* is ignored) + """ + n = get_source_size(a) + i = np.random.randint(0, n) + return getitem(a, i) + + else: + def choice_impl(a, size=None, replace=True): + """ + choice() implementation returning an array of samples + """ + n = get_source_size(a) + if replace: + out = np.empty(size, dtype) + fl = out.flat + for i in range(len(fl)): + j = np.random.randint(0, n) + fl[i] = getitem(a, j) + return out + else: + # Note we have to construct the array to compute out.size + # (`size` can be an arbitrary int or tuple of ints) + out = np.empty(size, dtype) + if out.size > n: + raise ValueError("Cannot take a larger sample than " + "population when 'replace=False'") + # Get a permuted copy of the source array + # we need this implementation in order to get the + # np.random.choice inside numba to match the output + # of np.random.choice outside numba when np.random.seed + # is set to the same value + permuted_a = np.random.permutation(a) + fl = out.flat + for i in range(len(fl)): + fl[i] = permuted_a[i] + return out + + return choice_impl + + +# ------------------------------------------------------------------------ +# np.random.multinomial + +@overload(np.random.multinomial) +def multinomial(n, pvals, size=None): + + dtype = np.intp + + @register_jitable + def multinomial_inner(n, pvals, out): + # Numpy's algorithm for multinomial() + fl = out.flat + sz = out.size + plen = len(pvals) + + for i in range(0, sz, plen): + # Loop body: take a set of n experiments and fill up + # fl[i:i + plen] with the distribution of results. + + # Current sum of outcome probabilities + p_sum = 1.0 + # Current remaining number of experiments + n_experiments = n + # For each possible outcome `j`, compute the number of results + # with this outcome. This is done by considering the + # conditional probability P(X=j | X>=j) and running a binomial + # distribution over the remaining number of experiments. + for j in range(0, plen - 1): + p_j = pvals[j] + n_j = fl[i + j] = np.random.binomial(n_experiments, p_j / p_sum) + n_experiments -= n_j + if n_experiments <= 0: + # Note the output was initialized to zero + break + p_sum -= p_j + if n_experiments > 0: + # The remaining experiments end up in the last bucket + fl[i + plen - 1] = n_experiments + + if not isinstance(n, types.Integer): + raise NumbaTypeError("np.random.multinomial(): n should be an " + "integer, got %s" % (n,)) + + if not isinstance(pvals, (types.Sequence, types.Array)): + raise NumbaTypeError("np.random.multinomial(): pvals should be an " + "array or sequence, got %s" % (pvals,)) + + if size in (None, types.none): + def multinomial_impl(n, pvals, size=None): + """ + multinomial(..., size=None) + """ + out = np.zeros(len(pvals), dtype) + multinomial_inner(n, pvals, out) + return out + + elif isinstance(size, types.Integer): + def multinomial_impl(n, pvals, size=None): + """ + multinomial(..., size=int) + """ + out = np.zeros((size, len(pvals)), dtype) + multinomial_inner(n, pvals, out) + return out + + elif isinstance(size, types.BaseTuple): + def multinomial_impl(n, pvals, size=None): + """ + multinomial(..., size=tuple) + """ + out = np.zeros(size + (len(pvals),), dtype) + multinomial_inner(n, pvals, out) + return out + + else: + raise NumbaTypeError("np.random.multinomial(): size should be int or " + "tuple or None, got %s" % (size,)) + + return multinomial_impl + +# ------------------------------------------------------------------------ +# np.random.dirichlet + + +@overload(np.random.dirichlet) +def dirichlet(alpha): + if isinstance(alpha, (types.Sequence, types.Array)): + def dirichlet_impl(alpha): + out = np.empty(len(alpha)) + dirichlet_arr(alpha, out) + return out + return dirichlet_impl + + +@overload(np.random.dirichlet) +def dirichlet(alpha, size=None): + if not isinstance(alpha, (types.Sequence, types.Array)): + raise NumbaTypeError( + "np.random.dirichlet(): alpha should be an " + "array or sequence, got %s" % (alpha,) + ) + + if size in (None, types.none) or is_empty_tuple(size): + + def dirichlet_impl(alpha, size=None): + out = np.empty(len(alpha)) + dirichlet_arr(alpha, out) + return out + + elif isinstance(size, types.Integer): + + def dirichlet_impl(alpha, size=None): + """ + dirichlet(..., size=int) + """ + out = np.empty((size, len(alpha))) + dirichlet_arr(alpha, out) + return out + + elif isinstance(size, types.UniTuple) and isinstance(size.dtype, + types.Integer): + def dirichlet_impl(alpha, size=None): + """ + dirichlet(..., size=tuple) + """ + out = np.empty(size + (len(alpha),)) + dirichlet_arr(alpha, out) + return out + + else: + raise NumbaTypeError( + "np.random.dirichlet(): size should be int or " + "tuple of ints or None, got %s" % size + ) + + return dirichlet_impl + + +@register_jitable +def dirichlet_arr(alpha, out): + + # Gamma distribution method to generate a Dirichlet distribution + + for a_val in iter(alpha): + if a_val <= 0: + raise ValueError("dirichlet: alpha must be > 0.0") + + a_len = len(alpha) + size = out.size + flat = out.flat + for i in range(0, size, a_len): + # calculate gamma random numbers per alpha specifications + norm = 0 # use this to normalize every the group total to 1 + for k, w in enumerate(alpha): + flat[i + k] = np.random.gamma(w, 1) + norm += flat[i + k].item() + for k, w in enumerate(alpha): + flat[i + k] /= norm + + +# ------------------------------------------------------------------------ +# np.random.noncentral_chisquare + + +@overload(np.random.noncentral_chisquare) +def noncentral_chisquare(df, nonc): + if isinstance(df, (types.Float, types.Integer)) and isinstance( + nonc, (types.Float, types.Integer)): + def noncentral_chisquare_impl(df, nonc): + validate_noncentral_chisquare_input(df, nonc) + return noncentral_chisquare_single(df, nonc) + + return noncentral_chisquare_impl + + +@overload(np.random.noncentral_chisquare) +def noncentral_chisquare(df, nonc, size=None): + if size in (None, types.none): + def noncentral_chisquare_impl(df, nonc, size=None): + validate_noncentral_chisquare_input(df, nonc) + return noncentral_chisquare_single(df, nonc) + return noncentral_chisquare_impl + if is_empty_tuple(size): + # Handle size = () + def noncentral_chisquare_impl(df, nonc, size=None): + validate_noncentral_chisquare_input(df, nonc) + return np.array(noncentral_chisquare_single(df, nonc)) + return noncentral_chisquare_impl + elif isinstance(size, types.Integer) or (isinstance(size, types.UniTuple) + and isinstance(size.dtype, + types.Integer)): + + def noncentral_chisquare_impl(df, nonc, size=None): + validate_noncentral_chisquare_input(df, nonc) + out = np.empty(size) + out_flat = out.flat + for idx in range(out.size): + out_flat[idx] = noncentral_chisquare_single(df, nonc) + return out + return noncentral_chisquare_impl + else: + raise NumbaTypeError( + "np.random.noncentral_chisquare(): size should be int or " + "tuple of ints or None, got %s" % size + ) + + +@register_jitable +def noncentral_chisquare_single(df, nonc): + # identical to numpy implementation from distributions.c + # https://github.com/numpy/numpy/blob/c65bc212ec1987caefba0ea7efe6a55803318de9/numpy/random/src/distributions/distributions.c#L797 + + if np.isnan(nonc): + return np.nan + + if 1 < df: + chi2 = np.random.chisquare(df-1) + n = np.random.standard_normal() + np.sqrt(nonc) + return chi2 + n * n + + else: + i = np.random.poisson(nonc/2.0) + return np.random.chisquare(df + 2 * i) + + +@register_jitable +def validate_noncentral_chisquare_input(df, nonc): + if df <= 0: + raise ValueError("df <= 0") + if nonc < 0: + raise ValueError("nonc < 0") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/rangeobj.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/rangeobj.py new file mode 100644 index 0000000000000000000000000000000000000000..4e9a55e1301109a63265aff8900c0d238018536c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/rangeobj.py @@ -0,0 +1,247 @@ +""" +Implementation of the range object for fixed-size integers. +""" + +import operator + +from numba import prange +from numba.core import types, cgutils, errors, config +from numba.core.imputils import (lower_builtin, lower_cast, + iterator_impl, impl_ret_untracked) +from numba.core.typing import signature +from numba.core.extending import intrinsic, overload, overload_attribute, register_jitable +from numba.parfors.parfor import internal_prange + +def make_range_iterator(typ): + """ + Return the Structure representation of the given *typ* (an + instance of types.RangeIteratorType). + """ + return cgutils.create_struct_proxy(typ) + + +def make_range_impl(int_type, range_state_type, range_iter_type): + RangeState = cgutils.create_struct_proxy(range_state_type) + + @lower_builtin(range, int_type) + @lower_builtin(prange, int_type) + @lower_builtin(internal_prange, int_type) + def range1_impl(context, builder, sig, args): + """ + range(stop: int) -> range object + """ + [stop] = args + state = RangeState(context, builder) + state.start = context.get_constant(int_type, 0) + state.stop = stop + state.step = context.get_constant(int_type, 1) + return impl_ret_untracked(context, + builder, + range_state_type, + state._getvalue()) + + @lower_builtin(range, int_type, int_type) + @lower_builtin(prange, int_type, int_type) + @lower_builtin(internal_prange, int_type, int_type) + def range2_impl(context, builder, sig, args): + """ + range(start: int, stop: int) -> range object + """ + start, stop = args + state = RangeState(context, builder) + state.start = start + state.stop = stop + state.step = context.get_constant(int_type, 1) + return impl_ret_untracked(context, + builder, + range_state_type, + state._getvalue()) + + @lower_builtin(range, int_type, int_type, int_type) + @lower_builtin(prange, int_type, int_type, int_type) + @lower_builtin(internal_prange, int_type, int_type, int_type) + def range3_impl(context, builder, sig, args): + """ + range(start: int, stop: int, step: int) -> range object + """ + [start, stop, step] = args + state = RangeState(context, builder) + state.start = start + state.stop = stop + state.step = step + return impl_ret_untracked(context, + builder, + range_state_type, + state._getvalue()) + + @lower_builtin(len, range_state_type) + def range_len(context, builder, sig, args): + """ + len(range) + """ + (value,) = args + state = RangeState(context, builder, value) + res = RangeIter.from_range_state(context, builder, state) + return impl_ret_untracked(context, builder, int_type, builder.load(res.count)) + + @lower_builtin('getiter', range_state_type) + def getiter_range32_impl(context, builder, sig, args): + """ + range.__iter__ + """ + (value,) = args + state = RangeState(context, builder, value) + res = RangeIter.from_range_state(context, builder, state)._getvalue() + return impl_ret_untracked(context, builder, range_iter_type, res) + + @iterator_impl(range_state_type, range_iter_type) + class RangeIter(make_range_iterator(range_iter_type)): + + @classmethod + def from_range_state(cls, context, builder, state): + """ + Create a RangeIter initialized from the given RangeState *state*. + """ + self = cls(context, builder) + start = state.start + stop = state.stop + step = state.step + + startptr = cgutils.alloca_once(builder, start.type) + builder.store(start, startptr) + + countptr = cgutils.alloca_once(builder, start.type) + + self.iter = startptr + self.stop = stop + self.step = step + self.count = countptr + + diff = builder.sub(stop, start) + zero = context.get_constant(int_type, 0) + one = context.get_constant(int_type, 1) + pos_diff = builder.icmp_signed('>', diff, zero) + pos_step = builder.icmp_signed('>', step, zero) + sign_differs = builder.xor(pos_diff, pos_step) + zero_step = builder.icmp_unsigned('==', step, zero) + + with cgutils.if_unlikely(builder, zero_step): + # step shouldn't be zero + context.call_conv.return_user_exc(builder, ValueError, + ("range() arg 3 must not be zero",)) + + with builder.if_else(sign_differs) as (then, orelse): + with then: + builder.store(zero, self.count) + + with orelse: + rem = builder.srem(diff, step) + rem = builder.select(pos_diff, rem, builder.neg(rem)) + uneven = builder.icmp_signed('>', rem, zero) + newcount = builder.add(builder.sdiv(diff, step), + builder.select(uneven, one, zero)) + builder.store(newcount, self.count) + + return self + + def iternext(self, context, builder, result): + zero = context.get_constant(int_type, 0) + countptr = self.count + count = builder.load(countptr) + is_valid = builder.icmp_signed('>', count, zero) + result.set_valid(is_valid) + + with builder.if_then(is_valid): + value = builder.load(self.iter) + result.yield_(value) + one = context.get_constant(int_type, 1) + + builder.store(builder.sub(count, one, flags=["nsw"]), countptr) + builder.store(builder.add(value, self.step), self.iter) + + +if config.USE_LEGACY_TYPE_SYSTEM: + range_impl_map = { + types.int32 : (types.range_state32_type, types.range_iter32_type), + types.int64 : (types.range_state64_type, types.range_iter64_type), + types.uint64 : (types.unsigned_range_state64_type, types.unsigned_range_iter64_type) + } +else: + range_impl_map = { + types.py_int: (types.range_state_type, types.range_iter_type), + } + +for int_type, state_types in range_impl_map.items(): + make_range_impl(int_type, *state_types) + +@lower_cast(types.RangeType, types.RangeType) +def range_to_range(context, builder, fromty, toty, val): + olditems = cgutils.unpack_tuple(builder, val, 3) + items = [context.cast(builder, v, fromty.dtype, toty.dtype) + for v in olditems] + return cgutils.make_anonymous_struct(builder, items) + + +def make_range_attr(index, attribute): + @intrinsic + def rangetype_attr_getter(typingctx, a): + if isinstance(a, types.RangeType): + def codegen(context, builder, sig, args): + (val,) = args + items = cgutils.unpack_tuple(builder, val, 3) + return impl_ret_untracked(context, builder, sig.return_type, + items[index]) + return signature(a.dtype, a), codegen + + @overload_attribute(types.RangeType, attribute) + def range_attr(rnge): + def get(rnge): + return rangetype_attr_getter(rnge) + return get + + +@register_jitable +def impl_contains_helper(robj, val): + if robj.step > 0 and (val < robj.start or val >= robj.stop): + return False + elif robj.step < 0 and (val <= robj.stop or val > robj.start): + return False + + return ((val - robj.start) % robj.step) == 0 + + +@overload(operator.contains) +def impl_contains(robj, val): + def impl_false(robj, val): + return False + + if not isinstance(robj, types.RangeType): + return + + elif isinstance(val, (types.Integer, types.Boolean)): + return impl_contains_helper + + elif isinstance(val, types.Float): + def impl(robj, val): + if val % 1 != 0: + return False + else: + return impl_contains_helper(robj, int(val)) + return impl + + elif isinstance(val, types.Complex): + def impl(robj, val): + if val.imag != 0: + return False + elif val.real % 1 != 0: + return False + else: + return impl_contains_helper(robj, int(val.real)) + return impl + + elif not isinstance(val, types.Number): + return impl_false + + +for ix, attr in enumerate(('start', 'stop', 'step')): + make_range_attr(index=ix, attribute=attr) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/setobj.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/setobj.py new file mode 100644 index 0000000000000000000000000000000000000000..441067ef365c12e71e4414de2eff05a10421f078 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/setobj.py @@ -0,0 +1,1711 @@ +""" +Support for native homogeneous sets. +""" + + +import collections +import contextlib +import math +import operator +from functools import cached_property + +from llvmlite import ir +from numba.core import types, typing, cgutils +from numba.core.imputils import (lower_builtin, lower_cast, + iternext_impl, impl_ret_borrowed, + impl_ret_new_ref, impl_ret_untracked, + for_iter, call_len, RefType) +from numba.misc import quicksort +from numba.cpython import slicing +from numba.core.errors import NumbaValueError, TypingError +from numba.core.extending import overload, overload_method, intrinsic + + +def get_payload_struct(context, builder, set_type, ptr): + """ + Given a set value and type, get its payload structure (as a + reference, so that mutations are seen by all). + """ + payload_type = types.SetPayload(set_type) + ptrty = context.get_data_type(payload_type).as_pointer() + payload = builder.bitcast(ptr, ptrty) + return context.make_data_helper(builder, payload_type, ref=payload) + + +def get_entry_size(context, set_type): + """ + Return the entry size for the given set type. + """ + llty = context.get_data_type(types.SetEntry(set_type)) + return context.get_abi_sizeof(llty) + + +# Note these values are special: +# - EMPTY is obtained by issuing memset(..., 0xFF) +# - (unsigned) EMPTY > (unsigned) DELETED > any other hash value +EMPTY = -1 +DELETED = -2 +FALLBACK = -43 + +# Minimal size of entries table. Must be a power of 2! +MINSIZE = 16 + +# Number of cache-friendly linear probes before switching to non-linear probing +LINEAR_PROBES = 3 + +DEBUG_ALLOCS = False + + +def get_hash_value(context, builder, typ, value): + """ + Compute the hash of the given value. + """ + typingctx = context.typing_context + fnty = typingctx.resolve_value_type(hash) + sig = fnty.get_call_type(typingctx, (typ,), {}) + fn = context.get_function(fnty, sig) + h = fn(builder, (value,)) + # Fixup reserved values + is_ok = is_hash_used(context, builder, h) + fallback = ir.Constant(h.type, FALLBACK) + return builder.select(is_ok, h, fallback) + + +@intrinsic +def _get_hash_value_intrinsic(typingctx, value): + def impl(context, builder, typ, args): + return get_hash_value(context, builder, value, args[0]) + fnty = typingctx.resolve_value_type(hash) + sig = fnty.get_call_type(typingctx, (value,), {}) + return sig, impl + + +def is_hash_empty(context, builder, h): + """ + Whether the hash value denotes an empty entry. + """ + empty = ir.Constant(h.type, EMPTY) + return builder.icmp_unsigned('==', h, empty) + +def is_hash_deleted(context, builder, h): + """ + Whether the hash value denotes a deleted entry. + """ + deleted = ir.Constant(h.type, DELETED) + return builder.icmp_unsigned('==', h, deleted) + +def is_hash_used(context, builder, h): + """ + Whether the hash value denotes an active entry. + """ + # Everything below DELETED is an used entry + deleted = ir.Constant(h.type, DELETED) + return builder.icmp_unsigned('<', h, deleted) + + +def check_all_set(*args): + if not all([isinstance(typ, types.Set) for typ in args]): + raise TypingError(f"All arguments must be Sets, got {args}") + + if not all([args[0].dtype == s.dtype for s in args]): + raise TypingError(f"All Sets must be of the same type, got {args}") + + +SetLoop = collections.namedtuple('SetLoop', ('index', 'entry', 'do_break')) + + +class _SetPayload(object): + + def __init__(self, context, builder, set_type, ptr): + payload = get_payload_struct(context, builder, set_type, ptr) + self._context = context + self._builder = builder + self._ty = set_type + self._payload = payload + self._entries = payload._get_ptr_by_name('entries') + self._ptr = ptr + + @property + def mask(self): + return self._payload.mask + + @mask.setter + def mask(self, value): + # CAUTION: mask must be a power of 2 minus 1 + self._payload.mask = value + + @property + def used(self): + return self._payload.used + + @used.setter + def used(self, value): + self._payload.used = value + + @property + def fill(self): + return self._payload.fill + + @fill.setter + def fill(self, value): + self._payload.fill = value + + @property + def finger(self): + return self._payload.finger + + @finger.setter + def finger(self, value): + self._payload.finger = value + + @property + def dirty(self): + return self._payload.dirty + + @dirty.setter + def dirty(self, value): + self._payload.dirty = value + + @property + def entries(self): + """ + A pointer to the start of the entries array. + """ + return self._entries + + @property + def ptr(self): + """ + A pointer to the start of the NRT-allocated area. + """ + return self._ptr + + def get_entry(self, idx): + """ + Get entry number *idx*. + """ + entry_ptr = cgutils.gep(self._builder, self._entries, idx) + entry = self._context.make_data_helper(self._builder, + types.SetEntry(self._ty), + ref=entry_ptr) + return entry + + def _lookup(self, item, h, for_insert=False): + """ + Lookup the *item* with the given hash values in the entries. + + Return a (found, entry index) tuple: + - If found is true, points to the entry containing + the item. + - If found is false, points to the empty entry that + the item can be written to (only if *for_insert* is true) + """ + context = self._context + builder = self._builder + + intp_t = h.type + + mask = self.mask + dtype = self._ty.dtype + tyctx = context.typing_context + fnty = tyctx.resolve_value_type(operator.eq) + sig = fnty.get_call_type(tyctx, (dtype, dtype), {}) + eqfn = context.get_function(fnty, sig) + + one = ir.Constant(intp_t, 1) + five = ir.Constant(intp_t, 5) + + # The perturbation value for probing + perturb = cgutils.alloca_once_value(builder, h) + # The index of the entry being considered: start with (hash & mask) + index = cgutils.alloca_once_value(builder, + builder.and_(h, mask)) + if for_insert: + # The index of the first deleted entry in the lookup chain + free_index_sentinel = mask.type(-1) # highest unsigned index + free_index = cgutils.alloca_once_value(builder, free_index_sentinel) + + bb_body = builder.append_basic_block("lookup.body") + bb_found = builder.append_basic_block("lookup.found") + bb_not_found = builder.append_basic_block("lookup.not_found") + bb_end = builder.append_basic_block("lookup.end") + + def check_entry(i): + """ + Check entry *i* against the value being searched for. + """ + entry = self.get_entry(i) + entry_hash = entry.hash + + with builder.if_then(builder.icmp_unsigned('==', h, entry_hash)): + # Hashes are equal, compare values + # (note this also ensures the entry is used) + eq = eqfn(builder, (item, entry.key)) + with builder.if_then(eq): + builder.branch(bb_found) + + with builder.if_then(is_hash_empty(context, builder, entry_hash)): + builder.branch(bb_not_found) + + if for_insert: + # Memorize the index of the first deleted entry + with builder.if_then(is_hash_deleted(context, builder, entry_hash)): + j = builder.load(free_index) + j = builder.select(builder.icmp_unsigned('==', j, free_index_sentinel), + i, j) + builder.store(j, free_index) + + # First linear probing. When the number of collisions is small, + # the lineary probing loop achieves better cache locality and + # is also slightly cheaper computationally. + with cgutils.for_range(builder, ir.Constant(intp_t, LINEAR_PROBES)): + i = builder.load(index) + check_entry(i) + i = builder.add(i, one) + i = builder.and_(i, mask) + builder.store(i, index) + + # If not found after linear probing, switch to a non-linear + # perturbation keyed on the unmasked hash value. + # XXX how to tell LLVM this branch is unlikely? + builder.branch(bb_body) + with builder.goto_block(bb_body): + i = builder.load(index) + check_entry(i) + + # Perturb to go to next entry: + # perturb >>= 5 + # i = (i * 5 + 1 + perturb) & mask + p = builder.load(perturb) + p = builder.lshr(p, five) + i = builder.add(one, builder.mul(i, five)) + i = builder.and_(mask, builder.add(i, p)) + builder.store(i, index) + builder.store(p, perturb) + # Loop + builder.branch(bb_body) + + with builder.goto_block(bb_not_found): + if for_insert: + # Not found => for insertion, return the index of the first + # deleted entry (if any), to avoid creating an infinite + # lookup chain (issue #1913). + i = builder.load(index) + j = builder.load(free_index) + i = builder.select(builder.icmp_unsigned('==', j, free_index_sentinel), + i, j) + builder.store(i, index) + builder.branch(bb_end) + + with builder.goto_block(bb_found): + builder.branch(bb_end) + + builder.position_at_end(bb_end) + + found = builder.phi(ir.IntType(1), 'found') + found.add_incoming(cgutils.true_bit, bb_found) + found.add_incoming(cgutils.false_bit, bb_not_found) + + return found, builder.load(index) + + @contextlib.contextmanager + def _iterate(self, start=None): + """ + Iterate over the payload's entries. Yield a SetLoop. + """ + context = self._context + builder = self._builder + + intp_t = context.get_value_type(types.intp) + one = ir.Constant(intp_t, 1) + size = builder.add(self.mask, one) + + with cgutils.for_range(builder, size, start=start) as range_loop: + entry = self.get_entry(range_loop.index) + is_used = is_hash_used(context, builder, entry.hash) + with builder.if_then(is_used): + loop = SetLoop(index=range_loop.index, entry=entry, + do_break=range_loop.do_break) + yield loop + + @contextlib.contextmanager + def _next_entry(self): + """ + Yield a random entry from the payload. Caller must ensure the + set isn't empty, otherwise the function won't end. + """ + context = self._context + builder = self._builder + + intp_t = context.get_value_type(types.intp) + zero = ir.Constant(intp_t, 0) + one = ir.Constant(intp_t, 1) + mask = self.mask + + # Start walking the entries from the stored "search finger" and + # break as soon as we find a used entry. + + bb_body = builder.append_basic_block('next_entry_body') + bb_end = builder.append_basic_block('next_entry_end') + + index = cgutils.alloca_once_value(builder, self.finger) + builder.branch(bb_body) + + with builder.goto_block(bb_body): + i = builder.load(index) + # ANDing with mask ensures we stay inside the table boundaries + i = builder.and_(mask, builder.add(i, one)) + builder.store(i, index) + entry = self.get_entry(i) + is_used = is_hash_used(context, builder, entry.hash) + builder.cbranch(is_used, bb_end, bb_body) + + builder.position_at_end(bb_end) + + # Update the search finger with the next position. This avoids + # O(n**2) behaviour when pop() is called in a loop. + i = builder.load(index) + self.finger = i + yield self.get_entry(i) + + +class SetInstance(object): + + def __init__(self, context, builder, set_type, set_val): + self._context = context + self._builder = builder + self._ty = set_type + self._entrysize = get_entry_size(context, set_type) + self._set = context.make_helper(builder, set_type, set_val) + + @property + def dtype(self): + return self._ty.dtype + + @property + def payload(self): + """ + The _SetPayload for this set. + """ + # This cannot be cached as the pointer can move around! + context = self._context + builder = self._builder + + ptr = self._context.nrt.meminfo_data(builder, self.meminfo) + return _SetPayload(context, builder, self._ty, ptr) + + @property + def value(self): + return self._set._getvalue() + + @property + def meminfo(self): + return self._set.meminfo + + @property + def parent(self): + return self._set.parent + + @parent.setter + def parent(self, value): + self._set.parent = value + + def get_size(self): + """ + Return the number of elements in the size. + """ + return self.payload.used + + def set_dirty(self, val): + if self._ty.reflected: + self.payload.dirty = cgutils.true_bit if val else cgutils.false_bit + + def _add_entry(self, payload, entry, item, h, do_resize=True): + context = self._context + builder = self._builder + + old_hash = entry.hash + entry.hash = h + self.incref_value(item) + entry.key = item + # used++ + used = payload.used + one = ir.Constant(used.type, 1) + used = payload.used = builder.add(used, one) + # fill++ if entry wasn't a deleted one + with builder.if_then(is_hash_empty(context, builder, old_hash), + likely=True): + payload.fill = builder.add(payload.fill, one) + # Grow table if necessary + if do_resize: + self.upsize(used) + self.set_dirty(True) + + def _add_key(self, payload, item, h, do_resize=True, do_incref=True): + context = self._context + builder = self._builder + + found, i = payload._lookup(item, h, for_insert=True) + not_found = builder.not_(found) + + with builder.if_then(not_found): + # Not found => add it + entry = payload.get_entry(i) + old_hash = entry.hash + entry.hash = h + if do_incref: + self.incref_value(item) + entry.key = item + # used++ + used = payload.used + one = ir.Constant(used.type, 1) + used = payload.used = builder.add(used, one) + # fill++ if entry wasn't a deleted one + with builder.if_then(is_hash_empty(context, builder, old_hash), + likely=True): + payload.fill = builder.add(payload.fill, one) + # Grow table if necessary + if do_resize: + self.upsize(used) + self.set_dirty(True) + + def _remove_entry(self, payload, entry, do_resize=True, do_decref=True): + # Mark entry deleted + entry.hash = ir.Constant(entry.hash.type, DELETED) + if do_decref: + self.decref_value(entry.key) + # used-- + used = payload.used + one = ir.Constant(used.type, 1) + used = payload.used = self._builder.sub(used, one) + # Shrink table if necessary + if do_resize: + self.downsize(used) + self.set_dirty(True) + + def _remove_key(self, payload, item, h, do_resize=True): + context = self._context + builder = self._builder + + found, i = payload._lookup(item, h) + + with builder.if_then(found): + entry = payload.get_entry(i) + self._remove_entry(payload, entry, do_resize) + + return found + + def add(self, item, do_resize=True): + context = self._context + builder = self._builder + + payload = self.payload + h = get_hash_value(context, builder, self._ty.dtype, item) + self._add_key(payload, item, h, do_resize) + + def add_pyapi(self, pyapi, item, do_resize=True): + """A version of .add for use inside functions following Python calling + convention. + """ + context = self._context + builder = self._builder + + payload = self.payload + h = self._pyapi_get_hash_value(pyapi, context, builder, item) + self._add_key(payload, item, h, do_resize) + + def _pyapi_get_hash_value(self, pyapi, context, builder, item): + """Python API compatible version of `get_hash_value()`. + """ + argtypes = [self._ty.dtype] + resty = types.intp + + def wrapper(val): + return _get_hash_value_intrinsic(val) + + args = [item] + sig = typing.signature(resty, *argtypes) + is_error, retval = pyapi.call_jit_code(wrapper, sig, args) + # Handle return status + with builder.if_then(is_error, likely=False): + # Raise nopython exception as a Python exception + builder.ret(pyapi.get_null_object()) + return retval + + def contains(self, item): + context = self._context + builder = self._builder + + payload = self.payload + h = get_hash_value(context, builder, self._ty.dtype, item) + found, i = payload._lookup(item, h) + return found + + def discard(self, item): + context = self._context + builder = self._builder + + payload = self.payload + h = get_hash_value(context, builder, self._ty.dtype, item) + found = self._remove_key(payload, item, h) + return found + + def pop(self): + context = self._context + builder = self._builder + + lty = context.get_value_type(self._ty.dtype) + key = cgutils.alloca_once(builder, lty) + + payload = self.payload + with payload._next_entry() as entry: + builder.store(entry.key, key) + # since the value is returned don't decref in _remove_entry() + self._remove_entry(payload, entry, do_decref=False) + + return builder.load(key) + + def clear(self): + context = self._context + builder = self._builder + + intp_t = context.get_value_type(types.intp) + minsize = ir.Constant(intp_t, MINSIZE) + self._replace_payload(minsize) + self.set_dirty(True) + + def copy(self): + """ + Return a copy of this set. + """ + context = self._context + builder = self._builder + + payload = self.payload + used = payload.used + fill = payload.fill + + other = type(self)(context, builder, self._ty, None) + + no_deleted_entries = builder.icmp_unsigned('==', used, fill) + with builder.if_else(no_deleted_entries, likely=True) \ + as (if_no_deleted, if_deleted): + with if_no_deleted: + # No deleted entries => raw copy the payload + ok = other._copy_payload(payload) + with builder.if_then(builder.not_(ok), likely=False): + context.call_conv.return_user_exc(builder, MemoryError, + ("cannot copy set",)) + + with if_deleted: + # Deleted entries => re-insert entries one by one + nentries = self.choose_alloc_size(context, builder, used) + ok = other._allocate_payload(nentries) + with builder.if_then(builder.not_(ok), likely=False): + context.call_conv.return_user_exc(builder, MemoryError, + ("cannot copy set",)) + + other_payload = other.payload + with payload._iterate() as loop: + entry = loop.entry + other._add_key(other_payload, entry.key, entry.hash, + do_resize=False) + + return other + + def intersect(self, other): + """ + In-place intersection with *other* set. + """ + context = self._context + builder = self._builder + payload = self.payload + other_payload = other.payload + + with payload._iterate() as loop: + entry = loop.entry + found, _ = other_payload._lookup(entry.key, entry.hash) + with builder.if_then(builder.not_(found)): + self._remove_entry(payload, entry, do_resize=False) + + # Final downsize + self.downsize(payload.used) + + def difference(self, other): + """ + In-place difference with *other* set. + """ + context = self._context + builder = self._builder + payload = self.payload + other_payload = other.payload + + with other_payload._iterate() as loop: + entry = loop.entry + self._remove_key(payload, entry.key, entry.hash, do_resize=False) + + # Final downsize + self.downsize(payload.used) + + def symmetric_difference(self, other): + """ + In-place symmetric difference with *other* set. + """ + context = self._context + builder = self._builder + other_payload = other.payload + + with other_payload._iterate() as loop: + key = loop.entry.key + h = loop.entry.hash + # We must reload our payload as it may be resized during the loop + payload = self.payload + found, i = payload._lookup(key, h, for_insert=True) + entry = payload.get_entry(i) + with builder.if_else(found) as (if_common, if_not_common): + with if_common: + self._remove_entry(payload, entry, do_resize=False) + with if_not_common: + self._add_entry(payload, entry, key, h) + + # Final downsize + self.downsize(self.payload.used) + + def issubset(self, other, strict=False): + context = self._context + builder = self._builder + payload = self.payload + other_payload = other.payload + + cmp_op = '<' if strict else '<=' + + res = cgutils.alloca_once_value(builder, cgutils.true_bit) + with builder.if_else( + builder.icmp_unsigned(cmp_op, payload.used, other_payload.used) + ) as (if_smaller, if_larger): + with if_larger: + # self larger than other => self cannot possibly a subset + builder.store(cgutils.false_bit, res) + with if_smaller: + # check whether each key of self is in other + with payload._iterate() as loop: + entry = loop.entry + found, _ = other_payload._lookup(entry.key, entry.hash) + with builder.if_then(builder.not_(found)): + builder.store(cgutils.false_bit, res) + loop.do_break() + + return builder.load(res) + + def isdisjoint(self, other): + context = self._context + builder = self._builder + payload = self.payload + other_payload = other.payload + + res = cgutils.alloca_once_value(builder, cgutils.true_bit) + + def check(smaller, larger): + # Loop over the smaller of the two, and search in the larger + with smaller._iterate() as loop: + entry = loop.entry + found, _ = larger._lookup(entry.key, entry.hash) + with builder.if_then(found): + builder.store(cgutils.false_bit, res) + loop.do_break() + + with builder.if_else( + builder.icmp_unsigned('>', payload.used, other_payload.used) + ) as (if_larger, otherwise): + + with if_larger: + # len(self) > len(other) + check(other_payload, payload) + + with otherwise: + # len(self) <= len(other) + check(payload, other_payload) + + return builder.load(res) + + def equals(self, other): + context = self._context + builder = self._builder + payload = self.payload + other_payload = other.payload + + res = cgutils.alloca_once_value(builder, cgutils.true_bit) + with builder.if_else( + builder.icmp_unsigned('==', payload.used, other_payload.used) + ) as (if_same_size, otherwise): + with if_same_size: + # same sizes => check whether each key of self is in other + with payload._iterate() as loop: + entry = loop.entry + found, _ = other_payload._lookup(entry.key, entry.hash) + with builder.if_then(builder.not_(found)): + builder.store(cgutils.false_bit, res) + loop.do_break() + with otherwise: + # different sizes => cannot possibly be equal + builder.store(cgutils.false_bit, res) + + return builder.load(res) + + @classmethod + def allocate_ex(cls, context, builder, set_type, nitems=None): + """ + Allocate a SetInstance with its storage. + Return a (ok, instance) tuple where *ok* is a LLVM boolean and + *instance* is a SetInstance object (the object's contents are + only valid when *ok* is true). + """ + intp_t = context.get_value_type(types.intp) + + if nitems is None: + nentries = ir.Constant(intp_t, MINSIZE) + else: + if isinstance(nitems, int): + nitems = ir.Constant(intp_t, nitems) + nentries = cls.choose_alloc_size(context, builder, nitems) + + self = cls(context, builder, set_type, None) + ok = self._allocate_payload(nentries) + return ok, self + + @classmethod + def allocate(cls, context, builder, set_type, nitems=None): + """ + Allocate a SetInstance with its storage. Same as allocate_ex(), + but return an initialized *instance*. If allocation failed, + control is transferred to the caller using the target's current + call convention. + """ + ok, self = cls.allocate_ex(context, builder, set_type, nitems) + with builder.if_then(builder.not_(ok), likely=False): + context.call_conv.return_user_exc(builder, MemoryError, + ("cannot allocate set",)) + return self + + @classmethod + def from_meminfo(cls, context, builder, set_type, meminfo): + """ + Allocate a new set instance pointing to an existing payload + (a meminfo pointer). + Note the parent field has to be filled by the caller. + """ + self = cls(context, builder, set_type, None) + self._set.meminfo = meminfo + self._set.parent = context.get_constant_null(types.pyobject) + context.nrt.incref(builder, set_type, self.value) + # Payload is part of the meminfo, no need to touch it + return self + + @classmethod + def choose_alloc_size(cls, context, builder, nitems): + """ + Choose a suitable number of entries for the given number of items. + """ + intp_t = nitems.type + one = ir.Constant(intp_t, 1) + minsize = ir.Constant(intp_t, MINSIZE) + + # Ensure number of entries >= 2 * used + min_entries = builder.shl(nitems, one) + # Find out first suitable power of 2, starting from MINSIZE + size_p = cgutils.alloca_once_value(builder, minsize) + + bb_body = builder.append_basic_block("calcsize.body") + bb_end = builder.append_basic_block("calcsize.end") + + builder.branch(bb_body) + + with builder.goto_block(bb_body): + size = builder.load(size_p) + is_large_enough = builder.icmp_unsigned('>=', size, min_entries) + with builder.if_then(is_large_enough, likely=False): + builder.branch(bb_end) + next_size = builder.shl(size, one) + builder.store(next_size, size_p) + builder.branch(bb_body) + + builder.position_at_end(bb_end) + return builder.load(size_p) + + def upsize(self, nitems): + """ + When adding to the set, ensure it is properly sized for the given + number of used entries. + """ + context = self._context + builder = self._builder + intp_t = nitems.type + + one = ir.Constant(intp_t, 1) + two = ir.Constant(intp_t, 2) + + payload = self.payload + + # Ensure number of entries >= 2 * used + min_entries = builder.shl(nitems, one) + size = builder.add(payload.mask, one) + need_resize = builder.icmp_unsigned('>=', min_entries, size) + + with builder.if_then(need_resize, likely=False): + # Find out next suitable size + new_size_p = cgutils.alloca_once_value(builder, size) + + bb_body = builder.append_basic_block("calcsize.body") + bb_end = builder.append_basic_block("calcsize.end") + + builder.branch(bb_body) + + with builder.goto_block(bb_body): + # Multiply by 4 (ensuring size remains a power of two) + new_size = builder.load(new_size_p) + new_size = builder.shl(new_size, two) + builder.store(new_size, new_size_p) + is_too_small = builder.icmp_unsigned('>=', min_entries, new_size) + builder.cbranch(is_too_small, bb_body, bb_end) + + builder.position_at_end(bb_end) + + new_size = builder.load(new_size_p) + if DEBUG_ALLOCS: + context.printf(builder, + "upsize to %zd items: current size = %zd, " + "min entries = %zd, new size = %zd\n", + nitems, size, min_entries, new_size) + self._resize(payload, new_size, "cannot grow set") + + def downsize(self, nitems): + """ + When removing from the set, ensure it is properly sized for the given + number of used entries. + """ + context = self._context + builder = self._builder + intp_t = nitems.type + + one = ir.Constant(intp_t, 1) + two = ir.Constant(intp_t, 2) + minsize = ir.Constant(intp_t, MINSIZE) + + payload = self.payload + + # Ensure entries >= max(2 * used, MINSIZE) + min_entries = builder.shl(nitems, one) + min_entries = builder.select(builder.icmp_unsigned('>=', min_entries, minsize), + min_entries, minsize) + # Shrink only if size >= 4 * min_entries && size > MINSIZE + max_size = builder.shl(min_entries, two) + size = builder.add(payload.mask, one) + need_resize = builder.and_( + builder.icmp_unsigned('<=', max_size, size), + builder.icmp_unsigned('<', minsize, size)) + + with builder.if_then(need_resize, likely=False): + # Find out next suitable size + new_size_p = cgutils.alloca_once_value(builder, size) + + bb_body = builder.append_basic_block("calcsize.body") + bb_end = builder.append_basic_block("calcsize.end") + + builder.branch(bb_body) + + with builder.goto_block(bb_body): + # Divide by 2 (ensuring size remains a power of two) + new_size = builder.load(new_size_p) + new_size = builder.lshr(new_size, one) + # Keep current size if new size would be < min_entries + is_too_small = builder.icmp_unsigned('>', min_entries, new_size) + with builder.if_then(is_too_small): + builder.branch(bb_end) + builder.store(new_size, new_size_p) + builder.branch(bb_body) + + builder.position_at_end(bb_end) + + # Ensure new_size >= MINSIZE + new_size = builder.load(new_size_p) + # At this point, new_size should be < size if the factors + # above were chosen carefully! + + if DEBUG_ALLOCS: + context.printf(builder, + "downsize to %zd items: current size = %zd, " + "min entries = %zd, new size = %zd\n", + nitems, size, min_entries, new_size) + self._resize(payload, new_size, "cannot shrink set") + + def _resize(self, payload, nentries, errmsg): + """ + Resize the payload to the given number of entries. + + CAUTION: *nentries* must be a power of 2! + """ + context = self._context + builder = self._builder + + # Allocate new entries + old_payload = payload + + ok = self._allocate_payload(nentries, realloc=True) + with builder.if_then(builder.not_(ok), likely=False): + context.call_conv.return_user_exc(builder, MemoryError, + (errmsg,)) + + # Re-insert old entries + # No incref since they already were the first time they were inserted + payload = self.payload + with old_payload._iterate() as loop: + entry = loop.entry + self._add_key(payload, entry.key, entry.hash, + do_resize=False, do_incref=False) + + self._free_payload(old_payload.ptr) + + def _replace_payload(self, nentries): + """ + Replace the payload with a new empty payload with the given number + of entries. + + CAUTION: *nentries* must be a power of 2! + """ + context = self._context + builder = self._builder + + # decref all of the previous entries + with self.payload._iterate() as loop: + entry = loop.entry + self.decref_value(entry.key) + + # Free old payload + self._free_payload(self.payload.ptr) + + ok = self._allocate_payload(nentries, realloc=True) + with builder.if_then(builder.not_(ok), likely=False): + context.call_conv.return_user_exc(builder, MemoryError, + ("cannot reallocate set",)) + + def _allocate_payload(self, nentries, realloc=False): + """ + Allocate and initialize payload for the given number of entries. + If *realloc* is True, the existing meminfo is reused. + + CAUTION: *nentries* must be a power of 2! + """ + context = self._context + builder = self._builder + + ok = cgutils.alloca_once_value(builder, cgutils.true_bit) + + intp_t = context.get_value_type(types.intp) + zero = ir.Constant(intp_t, 0) + one = ir.Constant(intp_t, 1) + + payload_type = context.get_data_type(types.SetPayload(self._ty)) + payload_size = context.get_abi_sizeof(payload_type) + entry_size = self._entrysize + # Account for the fact that the payload struct already contains an entry + payload_size -= entry_size + + # Total allocation size = + nentries * entry_size + allocsize, ovf = cgutils.muladd_with_overflow(builder, nentries, + ir.Constant(intp_t, entry_size), + ir.Constant(intp_t, payload_size)) + with builder.if_then(ovf, likely=False): + builder.store(cgutils.false_bit, ok) + + with builder.if_then(builder.load(ok), likely=True): + if realloc: + meminfo = self._set.meminfo + ptr = context.nrt.meminfo_varsize_alloc_unchecked(builder, + meminfo, + size=allocsize) + alloc_ok = cgutils.is_null(builder, ptr) + else: + # create destructor to be called upon set destruction + dtor = self._imp_dtor(context, builder.module) + meminfo = context.nrt.meminfo_new_varsize_dtor_unchecked( + builder, allocsize, builder.bitcast(dtor, cgutils.voidptr_t)) + alloc_ok = cgutils.is_null(builder, meminfo) + + with builder.if_else(alloc_ok, + likely=False) as (if_error, if_ok): + with if_error: + builder.store(cgutils.false_bit, ok) + with if_ok: + if not realloc: + self._set.meminfo = meminfo + self._set.parent = context.get_constant_null(types.pyobject) + payload = self.payload + # Initialize entries to 0xff (EMPTY) + cgutils.memset(builder, payload.ptr, allocsize, 0xFF) + payload.used = zero + payload.fill = zero + payload.finger = zero + new_mask = builder.sub(nentries, one) + payload.mask = new_mask + + if DEBUG_ALLOCS: + context.printf(builder, + "allocated %zd bytes for set at %p: mask = %zd\n", + allocsize, payload.ptr, new_mask) + + return builder.load(ok) + + def _free_payload(self, ptr): + """ + Free an allocated old payload at *ptr*. + """ + self._context.nrt.meminfo_varsize_free(self._builder, self.meminfo, ptr) + + def _copy_payload(self, src_payload): + """ + Raw-copy the given payload into self. + """ + context = self._context + builder = self._builder + + ok = cgutils.alloca_once_value(builder, cgutils.true_bit) + + intp_t = context.get_value_type(types.intp) + zero = ir.Constant(intp_t, 0) + one = ir.Constant(intp_t, 1) + + payload_type = context.get_data_type(types.SetPayload(self._ty)) + payload_size = context.get_abi_sizeof(payload_type) + entry_size = self._entrysize + # Account for the fact that the payload struct already contains an entry + payload_size -= entry_size + + mask = src_payload.mask + nentries = builder.add(one, mask) + + # Total allocation size = + nentries * entry_size + # (note there can't be any overflow since we're reusing an existing + # payload's parameters) + allocsize = builder.add(ir.Constant(intp_t, payload_size), + builder.mul(ir.Constant(intp_t, entry_size), + nentries)) + + with builder.if_then(builder.load(ok), likely=True): + # create destructor for new meminfo + dtor = self._imp_dtor(context, builder.module) + meminfo = context.nrt.meminfo_new_varsize_dtor_unchecked( + builder, allocsize, builder.bitcast(dtor, cgutils.voidptr_t)) + alloc_ok = cgutils.is_null(builder, meminfo) + + with builder.if_else(alloc_ok, likely=False) as (if_error, if_ok): + with if_error: + builder.store(cgutils.false_bit, ok) + with if_ok: + self._set.meminfo = meminfo + payload = self.payload + payload.used = src_payload.used + payload.fill = src_payload.fill + payload.finger = zero + payload.mask = mask + + # instead of using `_add_key` for every entry, since the + # size of the new set is the same, we can just copy the + # data directly without having to re-compute the hash + cgutils.raw_memcpy(builder, payload.entries, + src_payload.entries, nentries, + entry_size) + # increment the refcounts to simulate `_add_key` for each + # element + with src_payload._iterate() as loop: + self.incref_value(loop.entry.key) + + if DEBUG_ALLOCS: + context.printf(builder, + "allocated %zd bytes for set at %p: mask = %zd\n", + allocsize, payload.ptr, mask) + + return builder.load(ok) + + def _imp_dtor(self, context, module): + """Define the dtor for set + """ + llvoidptr = cgutils.voidptr_t + llsize_t= context.get_value_type(types.size_t) + # create a dtor function that takes (void* set, size_t size, void* dtor_info) + fnty = ir.FunctionType( + ir.VoidType(), + [llvoidptr, llsize_t, llvoidptr], + ) + # create type-specific name + fname = f".dtor.set.{self._ty.dtype}" + + fn = cgutils.get_or_insert_function(module, fnty, name=fname) + + if fn.is_declaration: + # Set linkage + fn.linkage = 'linkonce_odr' + # Define + builder = ir.IRBuilder(fn.append_basic_block()) + payload = _SetPayload(context, builder, self._ty, fn.args[0]) + with payload._iterate() as loop: + entry = loop.entry + context.nrt.decref(builder, self._ty.dtype, entry.key) + builder.ret_void() + + return fn + + def incref_value(self, val): + """Incref an element value + """ + self._context.nrt.incref(self._builder, self._ty.dtype, val) + + def decref_value(self, val): + """Decref an element value + """ + self._context.nrt.decref(self._builder, self._ty.dtype, val) + + +class SetIterInstance(object): + + def __init__(self, context, builder, iter_type, iter_val): + self._context = context + self._builder = builder + self._ty = iter_type + self._iter = context.make_helper(builder, iter_type, iter_val) + ptr = self._context.nrt.meminfo_data(builder, self.meminfo) + self._payload = _SetPayload(context, builder, self._ty.container, ptr) + + @classmethod + def from_set(cls, context, builder, iter_type, set_val): + set_inst = SetInstance(context, builder, iter_type.container, set_val) + self = cls(context, builder, iter_type, None) + index = context.get_constant(types.intp, 0) + self._iter.index = cgutils.alloca_once_value(builder, index) + self._iter.meminfo = set_inst.meminfo + return self + + @property + def value(self): + return self._iter._getvalue() + + @property + def meminfo(self): + return self._iter.meminfo + + @property + def index(self): + return self._builder.load(self._iter.index) + + @index.setter + def index(self, value): + self._builder.store(value, self._iter.index) + + def iternext(self, result): + index = self.index + payload = self._payload + one = ir.Constant(index.type, 1) + + result.set_exhausted() + + with payload._iterate(start=index) as loop: + # An entry was found + entry = loop.entry + result.set_valid() + result.yield_(entry.key) + self.index = self._builder.add(loop.index, one) + loop.do_break() + + +#------------------------------------------------------------------------------- +# Constructors + +def build_set(context, builder, set_type, items): + """ + Build a set of the given type, containing the given items. + """ + nitems = len(items) + inst = SetInstance.allocate(context, builder, set_type, nitems) + + if nitems > 0: + + # Populate set. Inlining the insertion code for each item would be very + # costly, instead we create a LLVM array and iterate over it. + array = cgutils.pack_array(builder, items) + array_ptr = cgutils.alloca_once_value(builder, array) + + count = context.get_constant(types.intp, nitems) + with cgutils.for_range(builder, count) as loop: + item = builder.load(cgutils.gep(builder, array_ptr, 0, loop.index)) + inst.add(item) + + return impl_ret_new_ref(context, builder, set_type, inst.value) + + +@lower_builtin(set) +def set_empty_constructor(context, builder, sig, args): + set_type = sig.return_type + inst = SetInstance.allocate(context, builder, set_type) + return impl_ret_new_ref(context, builder, set_type, inst.value) + +@lower_builtin(set, types.IterableType) +def set_constructor(context, builder, sig, args): + set_type = sig.return_type + items_type, = sig.args + items, = args + + # If the argument has a len(), preallocate the set so as to + # avoid resizes. + # `for_iter` increfs each item in the set, so a `decref` is required each + # iteration to balance. Because the `incref` from `.add` is dependent on + # the item not already existing in the set, just removing its incref is not + # enough to guarantee all memory is freed + n = call_len(context, builder, items_type, items) + inst = SetInstance.allocate(context, builder, set_type, n) + with for_iter(context, builder, items_type, items) as loop: + inst.add(loop.value) + context.nrt.decref(builder, set_type.dtype, loop.value) + + return impl_ret_new_ref(context, builder, set_type, inst.value) + + +#------------------------------------------------------------------------------- +# Various operations + +@lower_builtin(len, types.Set) +def set_len(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + return inst.get_size() + +@lower_builtin(operator.contains, types.Set, types.Any) +def in_set(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + return inst.contains(args[1]) + +@lower_builtin('getiter', types.Set) +def getiter_set(context, builder, sig, args): + inst = SetIterInstance.from_set(context, builder, sig.return_type, args[0]) + return impl_ret_borrowed(context, builder, sig.return_type, inst.value) + +@lower_builtin('iternext', types.SetIter) +@iternext_impl(RefType.BORROWED) +def iternext_listiter(context, builder, sig, args, result): + inst = SetIterInstance(context, builder, sig.args[0], args[0]) + inst.iternext(result) + + +#------------------------------------------------------------------------------- +# Methods + +# One-item-at-a-time operations + +@lower_builtin("set.add", types.Set, types.Any) +def set_add(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + item = args[1] + inst.add(item) + + return context.get_dummy_value() + + +@intrinsic +def _set_discard(typingctx, s, item): + sig = types.none(s, item) + + def set_discard(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + item = args[1] + inst.discard(item) + + return context.get_dummy_value() + + return sig, set_discard + + +@overload_method(types.Set, "discard") +def ol_set_discard(s, item): + return lambda s, item: _set_discard(s, item) + + +@intrinsic +def _set_pop(typingctx, s): + sig = s.dtype(s) + + def set_pop(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + used = inst.payload.used + with builder.if_then(cgutils.is_null(builder, used), likely=False): + context.call_conv.return_user_exc(builder, KeyError, + ("set.pop(): empty set",)) + + return inst.pop() + + return sig, set_pop + + +@overload_method(types.Set, "pop") +def ol_set_pop(s): + return lambda s: _set_pop(s) + + +@intrinsic +def _set_remove(typingctx, s, item): + sig = types.none(s, item) + + def set_remove(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + item = args[1] + found = inst.discard(item) + with builder.if_then(builder.not_(found), likely=False): + context.call_conv.return_user_exc(builder, KeyError, + ("set.remove(): key not in set",)) + + return context.get_dummy_value() + + return sig, set_remove + + +@overload_method(types.Set, "remove") +def ol_set_remove(s, item): + if s.dtype == item: + return lambda s, item: _set_remove(s, item) + + +# Mutating set operations + +@intrinsic +def _set_clear(typingctx, s): + sig = types.none(s) + + def set_clear(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + inst.clear() + return context.get_dummy_value() + + return sig, set_clear + + +@overload_method(types.Set, "clear") +def ol_set_clear(s): + return lambda s: _set_clear(s) + + +@intrinsic +def _set_copy(typingctx, s): + sig = s(s) + + def set_copy(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + other = inst.copy() + return impl_ret_new_ref(context, builder, sig.return_type, other.value) + + return sig, set_copy + + +@overload_method(types.Set, "copy") +def ol_set_copy(s): + return lambda s: _set_copy(s) + + +def set_difference_update(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + other = SetInstance(context, builder, sig.args[1], args[1]) + + inst.difference(other) + + return context.get_dummy_value() + + +@intrinsic +def _set_difference_update(typingctx, a, b): + sig = types.none(a, b) + return sig, set_difference_update + + +@overload_method(types.Set, "difference_update") +def set_difference_update_impl(a, b): + check_all_set(a, b) + return lambda a, b: _set_difference_update(a, b) + + +def set_intersection_update(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + other = SetInstance(context, builder, sig.args[1], args[1]) + inst.intersect(other) + return context.get_dummy_value() + + +@intrinsic +def _set_intersection_update(typingctx, a, b): + sig = types.none(a, b) + return sig, set_intersection_update + + +@overload_method(types.Set, "intersection_update") +def set_intersection_update_impl(a, b): + check_all_set(a, b) + return lambda a, b: _set_intersection_update(a, b) + + +def set_symmetric_difference_update(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + other = SetInstance(context, builder, sig.args[1], args[1]) + inst.symmetric_difference(other) + return context.get_dummy_value() + + +@intrinsic +def _set_symmetric_difference_update(typingctx, a, b): + sig = types.none(a, b) + return sig, set_symmetric_difference_update + + +@overload_method(types.Set, "symmetric_difference_update") +def set_symmetric_difference_update_impl(a, b): + check_all_set(a, b) + return lambda a, b: _set_symmetric_difference_update(a, b) + + +@lower_builtin("set.update", types.Set, types.IterableType) +def set_update(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + items_type = sig.args[1] + items = args[1] + + # If the argument has a len(), assume there are few collisions and + # presize to len(set) + len(items) + n = call_len(context, builder, items_type, items) + if n is not None: + new_size = builder.add(inst.payload.used, n) + inst.upsize(new_size) + + with for_iter(context, builder, items_type, items) as loop: + # make sure that the items being added are of the same dtype as the + # set instance + casted = context.cast(builder, loop.value, items_type.dtype, inst.dtype) + inst.add(casted) + # decref each item to counter balance the incref from `for_iter` + # `.add` will conditionally incref when the item does not already exist + # in the set, therefore removing its incref is not enough to guarantee + # all memory is freed + context.nrt.decref(builder, items_type.dtype, loop.value) + + if n is not None: + # If we pre-grew the set, downsize in case there were many collisions + inst.downsize(inst.payload.used) + + return context.get_dummy_value() + +def gen_operator_impl(op, impl): + @intrinsic + def _set_operator_intr(typingctx, a, b): + sig = a(a, b) + def codegen(context, builder, sig, args): + assert sig.return_type == sig.args[0] + impl(context, builder, sig, args) + return impl_ret_borrowed(context, builder, sig.args[0], args[0]) + return sig, codegen + + @overload(op) + def _ol_set_operator(a, b): + check_all_set(a, b) + return lambda a, b: _set_operator_intr(a, b) + + +for op_, op_impl in [ + (operator.iand, set_intersection_update), + (operator.ior, set_update), + (operator.isub, set_difference_update), + (operator.ixor, set_symmetric_difference_update), + ]: + gen_operator_impl(op_, op_impl) + + +# Set operations creating a new set + +@overload(operator.sub) +@overload_method(types.Set, "difference") +def impl_set_difference(a, b): + check_all_set(a, b) + + def difference_impl(a, b): + s = a.copy() + s.difference_update(b) + return s + + return difference_impl + +@overload(operator.and_) +@overload_method(types.Set, "intersection") +def set_intersection(a, b): + check_all_set(a, b) + + def intersection_impl(a, b): + if len(a) < len(b): + s = a.copy() + s.intersection_update(b) + return s + else: + s = b.copy() + s.intersection_update(a) + return s + + return intersection_impl + +@overload(operator.xor) +@overload_method(types.Set, "symmetric_difference") +def set_symmetric_difference(a, b): + check_all_set(a, b) + + def symmetric_difference_impl(a, b): + if len(a) > len(b): + s = a.copy() + s.symmetric_difference_update(b) + return s + else: + s = b.copy() + s.symmetric_difference_update(a) + return s + + return symmetric_difference_impl + +@overload(operator.or_) +@overload_method(types.Set, "union") +def set_union(a, b): + check_all_set(a, b) + + def union_impl(a, b): + if len(a) > len(b): + s = a.copy() + s.update(b) + return s + else: + s = b.copy() + s.update(a) + return s + + return union_impl + + +# Predicates + +@intrinsic +def _set_isdisjoint(typingctx, a, b): + sig = types.boolean(a, b) + + def codegen(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + other = SetInstance(context, builder, sig.args[1], args[1]) + + return inst.isdisjoint(other) + + return sig, codegen + + +@overload_method(types.Set, "isdisjoint") +def set_isdisjoint(a, b): + check_all_set(a, b) + + return lambda a, b: _set_isdisjoint(a, b) + + +@intrinsic +def _set_issubset(typingctx, a, b): + sig = types.boolean(a, b) + + def codegen(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + other = SetInstance(context, builder, sig.args[1], args[1]) + + return inst.issubset(other) + + return sig, codegen + +@overload(operator.le) +@overload_method(types.Set, "issubset") +def set_issubset(a, b): + check_all_set(a, b) + + return lambda a, b: _set_issubset(a, b) + + +@overload(operator.ge) +@overload_method(types.Set, "issuperset") +def set_issuperset(a, b): + check_all_set(a, b) + + def superset_impl(a, b): + return b.issubset(a) + + return superset_impl + +@intrinsic +def _set_eq(typingctx, a, b): + sig = types.boolean(a, b) + + def codegen(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + other = SetInstance(context, builder, sig.args[1], args[1]) + + return inst.equals(other) + + return sig, codegen + +@overload(operator.eq) +def set_eq(a, b): + check_all_set(a, b) + + return lambda a, b: _set_eq(a, b) + +@overload(operator.ne) +def set_ne(a, b): + check_all_set(a, b) + + def ne_impl(a, b): + return not a == b + + return ne_impl + +@intrinsic +def _set_lt(typingctx, a, b): + sig = types.boolean(a, b) + + def codegen(context, builder, sig, args): + inst = SetInstance(context, builder, sig.args[0], args[0]) + other = SetInstance(context, builder, sig.args[1], args[1]) + + return inst.issubset(other, strict=True) + + return sig, codegen + +@overload(operator.lt) +def set_lt(a, b): + check_all_set(a, b) + + return lambda a, b: _set_lt(a, b) + +@overload(operator.gt) +def set_gt(a, b): + check_all_set(a, b) + + def gt_impl(a, b): + return b < a + + return gt_impl + +@lower_builtin(operator.is_, types.Set, types.Set) +def set_is(context, builder, sig, args): + a = SetInstance(context, builder, sig.args[0], args[0]) + b = SetInstance(context, builder, sig.args[1], args[1]) + ma = builder.ptrtoint(a.meminfo, cgutils.intp_t) + mb = builder.ptrtoint(b.meminfo, cgutils.intp_t) + return builder.icmp_signed('==', ma, mb) + + +# ----------------------------------------------------------------------------- +# Implicit casting + +@lower_cast(types.Set, types.Set) +def set_to_set(context, builder, fromty, toty, val): + # Casting from non-reflected to reflected + assert fromty.dtype == toty.dtype + return val diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/slicing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/slicing.py new file mode 100644 index 0000000000000000000000000000000000000000..f5c38e2d97992d1dc5565f8c7e61c3b866c3ac75 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/slicing.py @@ -0,0 +1,302 @@ +""" +Implement slices and various slice computations. +""" + +from itertools import zip_longest + +from llvmlite import ir +from numba.core import cgutils, types, typing, utils +from numba.core.imputils import (impl_ret_borrowed, impl_ret_new_ref, + impl_ret_untracked, iternext_impl, + lower_builtin, lower_cast, lower_constant, + lower_getattr) + + +def fix_index(builder, idx, size): + """ + Fix negative index by adding *size* to it. Positive + indices are left untouched. + """ + is_negative = builder.icmp_signed('<', idx, ir.Constant(size.type, 0)) + wrapped_index = builder.add(idx, size) + return builder.select(is_negative, wrapped_index, idx) + + +def fix_slice(builder, slice, size): + """ + Fix *slice* start and stop to be valid (inclusive and exclusive, resp) + indexing bounds for a sequence of the given *size*. + """ + # See PySlice_GetIndicesEx() + zero = ir.Constant(size.type, 0) + minus_one = ir.Constant(size.type, -1) + + def fix_bound(bound_name, lower_repl, upper_repl): + bound = getattr(slice, bound_name) + bound = fix_index(builder, bound, size) + # Store value + setattr(slice, bound_name, bound) + # Still negative? => clamp to lower_repl + underflow = builder.icmp_signed('<', bound, zero) + with builder.if_then(underflow, likely=False): + setattr(slice, bound_name, lower_repl) + # Greater than size? => clamp to upper_repl + overflow = builder.icmp_signed('>=', bound, size) + with builder.if_then(overflow, likely=False): + setattr(slice, bound_name, upper_repl) + + with builder.if_else(cgutils.is_neg_int(builder, slice.step)) as (if_neg_step, if_pos_step): + with if_pos_step: + # < 0 => 0; >= size => size + fix_bound('start', zero, size) + fix_bound('stop', zero, size) + with if_neg_step: + # < 0 => -1; >= size => size - 1 + lower = minus_one + upper = builder.add(size, minus_one) + fix_bound('start', lower, upper) + fix_bound('stop', lower, upper) + + +def get_slice_length(builder, slicestruct): + """ + Given a slice, compute the number of indices it spans, i.e. the + number of iterations that for_range_slice() will execute. + + Pseudo-code: + assert step != 0 + if step > 0: + if stop <= start: + return 0 + else: + return (stop - start - 1) // step + 1 + else: + if stop >= start: + return 0 + else: + return (stop - start + 1) // step + 1 + + (see PySlice_GetIndicesEx() in CPython) + """ + start = slicestruct.start + stop = slicestruct.stop + step = slicestruct.step + one = ir.Constant(start.type, 1) + zero = ir.Constant(start.type, 0) + + is_step_negative = cgutils.is_neg_int(builder, step) + delta = builder.sub(stop, start) + + # Nominal case + pos_dividend = builder.sub(delta, one) + neg_dividend = builder.add(delta, one) + dividend = builder.select(is_step_negative, neg_dividend, pos_dividend) + nominal_length = builder.add(one, builder.sdiv(dividend, step)) + + # Catch zero length + is_zero_length = builder.select(is_step_negative, + builder.icmp_signed('>=', delta, zero), + builder.icmp_signed('<=', delta, zero)) + + # Clamp to 0 if is_zero_length + return builder.select(is_zero_length, zero, nominal_length) + + +def get_slice_bounds(builder, slicestruct): + """ + Return the [lower, upper) indexing bounds of a slice. + """ + start = slicestruct.start + stop = slicestruct.stop + zero = start.type(0) + one = start.type(1) + # This is a bit pessimal, e.g. it will return [1, 5) instead + # of [1, 4) for `1:5:2` + is_step_negative = builder.icmp_signed('<', slicestruct.step, zero) + lower = builder.select(is_step_negative, + builder.add(stop, one), start) + upper = builder.select(is_step_negative, + builder.add(start, one), stop) + return lower, upper + + +def fix_stride(builder, slice, stride): + """ + Fix the given stride for the slice's step. + """ + return builder.mul(slice.step, stride) + +def guard_invalid_slice(context, builder, typ, slicestruct): + """ + Guard against *slicestruct* having a zero step (and raise ValueError). + """ + if typ.has_step: + cgutils.guard_null(context, builder, slicestruct.step, + (ValueError, "slice step cannot be zero")) + + +def get_defaults(context): + """ + Get the default values for a slice's members: + (start for positive step, start for negative step, + stop for positive step, stop for negative step, step) + """ + maxint = (1 << (context.address_size - 1)) - 1 + return (0, maxint, maxint, - maxint - 1, 1) + + +#--------------------------------------------------------------------------- +# The slice structure + +@lower_builtin(slice, types.VarArg(types.Any)) +def slice_constructor_impl(context, builder, sig, args): + ( + default_start_pos, + default_start_neg, + default_stop_pos, + default_stop_neg, + default_step, + ) = [context.get_constant(types.intp, x) for x in get_defaults(context)] + + slice_args = [None] * 3 + + # Fetch non-None arguments + if len(args) == 1 and sig.args[0] is not types.none: + slice_args[1] = args[0] + else: + for i, (ty, val) in enumerate(zip(sig.args, args)): + if ty is not types.none: + slice_args[i] = val + + # Fill omitted arguments + def get_arg_value(i, default): + val = slice_args[i] + if val is None: + return default + else: + return val + + step = get_arg_value(2, default_step) + is_step_negative = builder.icmp_signed('<', step, + context.get_constant(types.intp, 0)) + default_stop = builder.select(is_step_negative, + default_stop_neg, default_stop_pos) + default_start = builder.select(is_step_negative, + default_start_neg, default_start_pos) + stop = get_arg_value(1, default_stop) + start = get_arg_value(0, default_start) + + ty = sig.return_type + sli = context.make_helper(builder, sig.return_type) + sli.start = start + sli.stop = stop + sli.step = step + + res = sli._getvalue() + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_getattr(types.SliceType, "start") +def slice_start_impl(context, builder, typ, value): + sli = context.make_helper(builder, typ, value) + return sli.start + +@lower_getattr(types.SliceType, "stop") +def slice_stop_impl(context, builder, typ, value): + sli = context.make_helper(builder, typ, value) + return sli.stop + +@lower_getattr(types.SliceType, "step") +def slice_step_impl(context, builder, typ, value): + if typ.has_step: + sli = context.make_helper(builder, typ, value) + return sli.step + else: + return context.get_constant(types.intp, 1) + + +@lower_builtin("slice.indices", types.SliceType, types.Integer) +def slice_indices(context, builder, sig, args): + length = args[1] + sli = context.make_helper(builder, sig.args[0], args[0]) + + with builder.if_then(cgutils.is_neg_int(builder, length), likely=False): + context.call_conv.return_user_exc( + builder, ValueError, + ("length should not be negative",) + ) + with builder.if_then(cgutils.is_scalar_zero(builder, sli.step), likely=False): + context.call_conv.return_user_exc( + builder, ValueError, + ("slice step cannot be zero",) + ) + + fix_slice(builder, sli, length) + + return context.make_tuple( + builder, + sig.return_type, + (sli.start, sli.stop, sli.step) + ) + + +def make_slice_from_constant(context, builder, ty, pyval): + sli = context.make_helper(builder, ty) + lty = context.get_value_type(types.intp) + + ( + default_start_pos, + default_start_neg, + default_stop_pos, + default_stop_neg, + default_step, + ) = [context.get_constant(types.intp, x) for x in get_defaults(context)] + + step = pyval.step + if step is None: + step_is_neg = False + step = default_step + else: + step_is_neg = step < 0 + step = lty(step) + + start = pyval.start + if start is None: + if step_is_neg: + start = default_start_neg + else: + start = default_start_pos + else: + start = lty(start) + + stop = pyval.stop + if stop is None: + if step_is_neg: + stop = default_stop_neg + else: + stop = default_stop_pos + else: + stop = lty(stop) + + sli.start = start + sli.stop = stop + sli.step = step + + return sli._getvalue() + + +@lower_constant(types.SliceType) +def constant_slice(context, builder, ty, pyval): + if isinstance(ty, types.Literal): + typ = ty.literal_type + else: + typ = ty + + return make_slice_from_constant(context, builder, typ, pyval) + + +@lower_cast(types.misc.SliceLiteral, types.SliceType) +def cast_from_literal(context, builder, fromty, toty, val): + return make_slice_from_constant( + context, builder, toty, fromty.literal_value, + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/tupleobj.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/tupleobj.py new file mode 100644 index 0000000000000000000000000000000000000000..2a48afeb0c8bb81998fa522d6479cc2dba7fb7bf --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/tupleobj.py @@ -0,0 +1,10 @@ +import sys +from numba.core.utils import _RedirectSubpackage +from numba.core import config + +if config.USE_LEGACY_TYPE_SYSTEM: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.old_tupleobj") +else: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.cpython.new_tupleobj") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/unicode.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/unicode.py new file mode 100644 index 0000000000000000000000000000000000000000..6f4f5cafb9c65cf4d7ed2239de5c753eb6b22704 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/unicode.py @@ -0,0 +1,2675 @@ +import sys +import operator + +import numpy as np +from llvmlite.ir import IntType, Constant + +from numba.core.cgutils import is_nonelike +from numba.core.extending import ( + models, + register_model, + make_attribute_wrapper, + unbox, + box, + NativeValue, + overload, + overload_method, + intrinsic, + register_jitable, +) +from numba.core.imputils import (lower_constant, lower_cast, lower_builtin, + iternext_impl, impl_ret_new_ref, RefType) +from numba.core.datamodel import register_default, StructModel +from numba.core import types, cgutils, config +from numba.core.utils import PYVERSION +from numba.core.pythonapi import ( + PY_UNICODE_1BYTE_KIND, + PY_UNICODE_2BYTE_KIND, + PY_UNICODE_4BYTE_KIND, +) +from numba._helperlib import c_helpers +from numba.cpython.hashing import _Py_hash_t +from numba.core.unsafe.bytes import memcpy_region +from numba.core.errors import TypingError +from numba.cpython.unicode_support import (_Py_TOUPPER, _Py_TOLOWER, _Py_UCS4, + _Py_ISALNUM, + _PyUnicode_ToUpperFull, + _PyUnicode_ToLowerFull, + _PyUnicode_ToFoldedFull, + _PyUnicode_ToTitleFull, + _PyUnicode_IsPrintable, + _PyUnicode_IsSpace, + _Py_ISSPACE, + _PyUnicode_IsXidStart, + _PyUnicode_IsXidContinue, + _PyUnicode_IsCased, + _PyUnicode_IsCaseIgnorable, + _PyUnicode_IsUppercase, + _PyUnicode_IsLowercase, + _PyUnicode_IsLineBreak, + _Py_ISLINEBREAK, + _Py_ISLINEFEED, + _Py_ISCARRIAGERETURN, + _PyUnicode_IsTitlecase, + _Py_ISLOWER, + _Py_ISUPPER, + _Py_TAB, + _Py_LINEFEED, + _Py_CARRIAGE_RETURN, + _Py_SPACE, + _PyUnicode_IsAlpha, + _PyUnicode_IsNumeric, + _Py_ISALPHA, + _PyUnicode_IsDigit, + _PyUnicode_IsDecimalDigit) +from numba.cpython import slicing + +if PYVERSION in ((3, 10), (3, 11)): + from numba.core.pythonapi import PY_UNICODE_WCHAR_KIND + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L84-L85 # noqa: E501 +_MAX_UNICODE = 0x10ffff + +# https://github.com/python/cpython/blob/1960eb005e04b7ad8a91018088cfdb0646bc1ca0/Objects/stringlib/fastsearch.h#L31 # noqa: E501 +if config.USE_LEGACY_TYPE_SYSTEM: + _BLOOM_WIDTH = types.intp.bitwidth +else: + _BLOOM_WIDTH = types.py_int.bitwidth + +# DATA MODEL + + +@register_model(types.UnicodeType) +class UnicodeModel(models.StructModel): + def __init__(self, dmm, fe_type): + members = [ + ('data', types.voidptr), + ('length', types.intp), + ('kind', types.int32), + ('is_ascii', types.uint32), + ('hash', _Py_hash_t), + ('meminfo', types.MemInfoPointer(types.voidptr)), + # A pointer to the owner python str/unicode object + ('parent', types.pyobject), + ] + models.StructModel.__init__(self, dmm, fe_type, members) + + +make_attribute_wrapper(types.UnicodeType, 'data', '_data') +make_attribute_wrapper(types.UnicodeType, 'length', '_length') +make_attribute_wrapper(types.UnicodeType, 'kind', '_kind') +make_attribute_wrapper(types.UnicodeType, 'is_ascii', '_is_ascii') +make_attribute_wrapper(types.UnicodeType, 'hash', '_hash') + + +@register_default(types.UnicodeIteratorType) +class UnicodeIteratorModel(StructModel): + def __init__(self, dmm, fe_type): + members = [('index', types.EphemeralPointer(types.uintp)), + ('data', fe_type.data)] + super(UnicodeIteratorModel, self).__init__(dmm, fe_type, members) + +# CAST + + +def compile_time_get_string_data(obj): + """Get string data from a python string for use at compile-time to embed + the string data into the LLVM module. + """ + from ctypes import ( + CFUNCTYPE, c_void_p, c_int, c_uint, c_ssize_t, c_ubyte, py_object, + POINTER, byref, + ) + + extract_unicode_fn = c_helpers['extract_unicode'] + proto = CFUNCTYPE(c_void_p, py_object, POINTER(c_ssize_t), POINTER(c_int), + POINTER(c_uint), POINTER(c_ssize_t)) + fn = proto(extract_unicode_fn) + length = c_ssize_t() + kind = c_int() + is_ascii = c_uint() + hashv = c_ssize_t() + data = fn(obj, byref(length), byref(kind), byref(is_ascii), byref(hashv)) + if data is None: + raise ValueError("cannot extract unicode data from the given string") + length = length.value + kind = kind.value + is_ascii = is_ascii.value + nbytes = (length + 1) * _kind_to_byte_width(kind) + out = (c_ubyte * nbytes).from_address(data) + return bytes(out), length, kind, is_ascii, hashv.value + + +def make_string_from_constant(context, builder, typ, literal_string): + """ + Get string data by `compile_time_get_string_data()` and return a + unicode_type LLVM value + """ + databytes, length, kind, is_ascii, hashv = \ + compile_time_get_string_data(literal_string) + mod = builder.module + gv = context.insert_const_bytes(mod, databytes) + uni_str = cgutils.create_struct_proxy(typ)(context, builder) + uni_str.data = gv + uni_str.length = uni_str.length.type(length) + uni_str.kind = uni_str.kind.type(kind) + uni_str.is_ascii = uni_str.is_ascii.type(is_ascii) + # Set hash to -1 to indicate that it should be computed. + # We cannot bake in the hash value because of hashseed randomization. + uni_str.hash = uni_str.hash.type(-1) + return uni_str._getvalue() + + +@lower_cast(types.StringLiteral, types.unicode_type) +def cast_from_literal(context, builder, fromty, toty, val): + return make_string_from_constant( + context, builder, toty, fromty.literal_value, + ) + + +# CONSTANT + +@lower_constant(types.unicode_type) +def constant_unicode(context, builder, typ, pyval): + return make_string_from_constant(context, builder, typ, pyval) + + +# BOXING + + +@unbox(types.UnicodeType) +def unbox_unicode_str(typ, obj, c): + """ + Convert a unicode str object to a native unicode structure. + """ + ok, data, length, kind, is_ascii, hashv = \ + c.pyapi.string_as_string_size_and_kind(obj) + uni_str = cgutils.create_struct_proxy(typ)(c.context, c.builder) + uni_str.data = data + uni_str.length = length + uni_str.kind = kind + uni_str.is_ascii = is_ascii + uni_str.hash = hashv + uni_str.meminfo = c.pyapi.nrt_meminfo_new_from_pyobject( + data, # the borrowed data pointer + obj, # the owner pyobject; the call will incref it. + ) + uni_str.parent = obj + + is_error = cgutils.is_not_null(c.builder, c.pyapi.err_occurred()) + return NativeValue(uni_str._getvalue(), is_error=is_error) + + +@box(types.UnicodeType) +def box_unicode_str(typ, val, c): + """ + Convert a native unicode structure to a unicode string + """ + uni_str = cgutils.create_struct_proxy(typ)(c.context, c.builder, value=val) + res = c.pyapi.string_from_kind_and_data( + uni_str.kind, uni_str.data, uni_str.length) + # hash isn't needed now, just compute it so it ends up in the unicodeobject + # hash cache, cpython doesn't always do this, depends how a string was + # created it's safe, just burns the cycles required to hash on @box + c.pyapi.object_hash(res) + c.context.nrt.decref(c.builder, typ, val) + return res + + +# HELPER FUNCTIONS + + +def make_deref_codegen(bitsize): + def codegen(context, builder, signature, args): + data, idx = args + ptr = builder.bitcast(data, IntType(bitsize).as_pointer()) + ch = builder.load(builder.gep(ptr, [idx])) + return builder.zext(ch, IntType(32)) + + return codegen + + +@intrinsic +def deref_uint8(typingctx, data, offset): + sig = types.uint32(types.voidptr, types.intp) + return sig, make_deref_codegen(8) + + +@intrinsic +def deref_uint16(typingctx, data, offset): + sig = types.uint32(types.voidptr, types.intp) + return sig, make_deref_codegen(16) + + +@intrinsic +def deref_uint32(typingctx, data, offset): + sig = types.uint32(types.voidptr, types.intp) + return sig, make_deref_codegen(32) + + +@intrinsic +def _malloc_string(typingctx, kind, char_bytes, length, is_ascii): + """make empty string with data buffer of size alloc_bytes. + + Must set length and kind values for string after it is returned + """ + def details(context, builder, signature, args): + [kind_val, char_bytes_val, length_val, is_ascii_val] = args + + # fill the struct + uni_str_ctor = cgutils.create_struct_proxy(types.unicode_type) + uni_str = uni_str_ctor(context, builder) + # add null padding character + nbytes_val = builder.mul(char_bytes_val, + builder.add(length_val, + Constant(length_val.type, 1))) + uni_str.meminfo = context.nrt.meminfo_alloc(builder, nbytes_val) + uni_str.kind = kind_val + uni_str.is_ascii = is_ascii_val + uni_str.length = length_val + # empty string has hash value -1 to indicate "need to compute hash" + uni_str.hash = context.get_constant(_Py_hash_t, -1) + uni_str.data = context.nrt.meminfo_data(builder, uni_str.meminfo) + # Set parent to NULL + uni_str.parent = cgutils.get_null_value(uni_str.parent.type) + return uni_str._getvalue() + + sig = types.unicode_type(types.int32, types.intp, types.intp, types.uint32) + return sig, details + + +@register_jitable +def _empty_string(kind, length, is_ascii=0): + char_width = _kind_to_byte_width(kind) + s = _malloc_string(kind, char_width, length, is_ascii) + _set_code_point(s, length, np.uint32(0)) # Write NULL character + return s + + +# Disable RefCt for performance. +@register_jitable(_nrt=False) +def _get_code_point(a, i): + if a._kind == PY_UNICODE_1BYTE_KIND: + return deref_uint8(a._data, i) + elif a._kind == PY_UNICODE_2BYTE_KIND: + return deref_uint16(a._data, i) + elif a._kind == PY_UNICODE_4BYTE_KIND: + return deref_uint32(a._data, i) + else: + # there's also a wchar kind, but that's one of the above, + # so skipping for this example + return 0 + +#### + + +def make_set_codegen(bitsize): + def codegen(context, builder, signature, args): + data, idx, ch = args + if bitsize < 32: + ch = builder.trunc(ch, IntType(bitsize)) + ptr = builder.bitcast(data, IntType(bitsize).as_pointer()) + builder.store(ch, builder.gep(ptr, [idx])) + return context.get_dummy_value() + + return codegen + + +@intrinsic +def set_uint8(typingctx, data, idx, ch): + sig = types.void(types.voidptr, types.int64, types.uint32) + return sig, make_set_codegen(8) + + +@intrinsic +def set_uint16(typingctx, data, idx, ch): + sig = types.void(types.voidptr, types.int64, types.uint32) + return sig, make_set_codegen(16) + + +@intrinsic +def set_uint32(typingctx, data, idx, ch): + sig = types.void(types.voidptr, types.int64, types.uint32) + return sig, make_set_codegen(32) + + +@register_jitable(_nrt=False) +def _set_code_point(a, i, ch): + # WARNING: This method is very dangerous: + # * Assumes that data contents can be changed (only allowed for new + # strings) + # * Assumes that the kind of unicode string is sufficiently wide to + # accept ch. Will truncate ch to make it fit. + # * Assumes that i is within the valid boundaries of the function + if a._kind == PY_UNICODE_1BYTE_KIND: + set_uint8(a._data, i, ch) + elif a._kind == PY_UNICODE_2BYTE_KIND: + set_uint16(a._data, i, ch) + elif a._kind == PY_UNICODE_4BYTE_KIND: + set_uint32(a._data, i, ch) + else: + raise AssertionError( + "Unexpected unicode representation in _set_code_point") + + +if PYVERSION in ((3, 12), (3, 13)): + @register_jitable + def _pick_kind(kind1, kind2): + if kind1 == PY_UNICODE_1BYTE_KIND: + return kind2 + elif kind1 == PY_UNICODE_2BYTE_KIND: + if kind2 == PY_UNICODE_4BYTE_KIND: + return kind2 + else: + return kind1 + elif kind1 == PY_UNICODE_4BYTE_KIND: + return kind1 + else: + raise AssertionError( + "Unexpected unicode representation in _pick_kind") +elif PYVERSION in ((3, 10), (3, 11)): + @register_jitable + def _pick_kind(kind1, kind2): + if (kind1 == PY_UNICODE_WCHAR_KIND or kind2 == PY_UNICODE_WCHAR_KIND): + raise AssertionError("PY_UNICODE_WCHAR_KIND unsupported") + + if kind1 == PY_UNICODE_1BYTE_KIND: + return kind2 + elif kind1 == PY_UNICODE_2BYTE_KIND: + if kind2 == PY_UNICODE_4BYTE_KIND: + return kind2 + else: + return kind1 + elif kind1 == PY_UNICODE_4BYTE_KIND: + return kind1 + else: + raise AssertionError( + "Unexpected unicode representation in _pick_kind") +else: + raise NotImplementedError(PYVERSION) + + +@register_jitable +def _pick_ascii(is_ascii1, is_ascii2): + if is_ascii1 == 1 and is_ascii2 == 1: + return types.uint32(1) + return types.uint32(0) + + +if PYVERSION in ((3, 12), (3, 13)): + @register_jitable + def _kind_to_byte_width(kind): + if kind == PY_UNICODE_1BYTE_KIND: + return 1 + elif kind == PY_UNICODE_2BYTE_KIND: + return 2 + elif kind == PY_UNICODE_4BYTE_KIND: + return 4 + else: + raise AssertionError("Unexpected unicode encoding encountered") +elif PYVERSION in ((3, 10), (3, 11)): + @register_jitable + def _kind_to_byte_width(kind): + if kind == PY_UNICODE_1BYTE_KIND: + return 1 + elif kind == PY_UNICODE_2BYTE_KIND: + return 2 + elif kind == PY_UNICODE_4BYTE_KIND: + return 4 + elif kind == PY_UNICODE_WCHAR_KIND: + raise AssertionError("PY_UNICODE_WCHAR_KIND unsupported") + else: + raise AssertionError("Unexpected unicode encoding encountered") +else: + raise NotImplementedError(PYVERSION) + + +@register_jitable(_nrt=False) +def _cmp_region(a, a_offset, b, b_offset, n): + if n == 0: + return 0 + elif a_offset + n > a._length: + return -1 + elif b_offset + n > b._length: + return 1 + + for i in range(n): + a_chr = _get_code_point(a, a_offset + i) + b_chr = _get_code_point(b, b_offset + i) + if a_chr < b_chr: + return -1 + elif a_chr > b_chr: + return 1 + + return 0 + + +@register_jitable +def _codepoint_to_kind(cp): + """ + Compute the minimum unicode kind needed to hold a given codepoint + """ + if cp < 256: + return PY_UNICODE_1BYTE_KIND + elif cp < 65536: + return PY_UNICODE_2BYTE_KIND + else: + # Maximum code point of Unicode 6.0: 0x10ffff (1,114,111) + MAX_UNICODE = 0x10ffff + if cp > MAX_UNICODE: + msg = "Invalid codepoint. Found value greater than Unicode maximum" + raise ValueError(msg) + return PY_UNICODE_4BYTE_KIND + + +@register_jitable +def _codepoint_is_ascii(ch): + """ + Returns true if a codepoint is in the ASCII range + """ + return ch < 128 + + +# PUBLIC API + + +@overload(len) +def unicode_len(s): + if isinstance(s, types.UnicodeType): + def len_impl(s): + return s._length + return len_impl + + +@overload(operator.eq) +def unicode_eq(a, b): + if not (a.is_internal and b.is_internal): + return + if isinstance(a, types.Optional): + check_a = a.type + else: + check_a = a + if isinstance(b, types.Optional): + check_b = b.type + else: + check_b = b + accept = (types.UnicodeType, types.StringLiteral, types.UnicodeCharSeq) + a_unicode = isinstance(check_a, accept) + b_unicode = isinstance(check_b, accept) + if a_unicode and b_unicode: + def eq_impl(a, b): + # handle Optionals at runtime + a_none = a is None + b_none = b is None + if a_none or b_none: + if a_none and b_none: + return True + else: + return False + # the str() is for UnicodeCharSeq, it's a nop else + a = str(a) + b = str(b) + if len(a) != len(b): + return False + return _cmp_region(a, 0, b, 0, len(a)) == 0 + return eq_impl + elif a_unicode ^ b_unicode: + # one of the things is unicode, everything compares False + def eq_impl(a, b): + return False + return eq_impl + + +@overload(operator.ne) +def unicode_ne(a, b): + if not (a.is_internal and b.is_internal): + return + accept = (types.UnicodeType, types.StringLiteral, types.UnicodeCharSeq) + a_unicode = isinstance(a, accept) + b_unicode = isinstance(b, accept) + if a_unicode and b_unicode: + def ne_impl(a, b): + return not (a == b) + return ne_impl + elif a_unicode ^ b_unicode: + # one of the things is unicode, everything compares True + def eq_impl(a, b): + return True + return eq_impl + + +@overload(operator.lt) +def unicode_lt(a, b): + a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) + b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) + if a_unicode and b_unicode: + def lt_impl(a, b): + minlen = min(len(a), len(b)) + eqcode = _cmp_region(a, 0, b, 0, minlen) + if eqcode == -1: + return True + elif eqcode == 0: + return len(a) < len(b) + return False + return lt_impl + + +@overload(operator.gt) +def unicode_gt(a, b): + a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) + b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) + if a_unicode and b_unicode: + def gt_impl(a, b): + minlen = min(len(a), len(b)) + eqcode = _cmp_region(a, 0, b, 0, minlen) + if eqcode == 1: + return True + elif eqcode == 0: + return len(a) > len(b) + return False + return gt_impl + + +@overload(operator.le) +def unicode_le(a, b): + a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) + b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) + if a_unicode and b_unicode: + def le_impl(a, b): + return not (a > b) + return le_impl + + +@overload(operator.ge) +def unicode_ge(a, b): + a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) + b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) + if a_unicode and b_unicode: + def ge_impl(a, b): + return not (a < b) + return ge_impl + + +@overload(operator.contains) +def unicode_contains(a, b): + if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): + def contains_impl(a, b): + # note parameter swap: contains(a, b) == b in a + return _find(a, b) > -1 + return contains_impl + + +def unicode_idx_check_type(ty, name): + """Check object belongs to one of specific types + ty: type + Type of the object + name: str + Name of the object + """ + thety = ty + # if the type is omitted, the concrete type is the value + if isinstance(ty, types.Omitted): + thety = ty.value + # if the type is optional, the concrete type is the captured type + elif isinstance(ty, types.Optional): + thety = ty.type + + accepted = (types.Integer, types.NoneType) + if thety is not None and not isinstance(thety, accepted): + raise TypingError('"{}" must be {}, not {}'.format(name, accepted, ty)) + + +def unicode_sub_check_type(ty, name): + """Check object belongs to unicode type""" + if not isinstance(ty, types.UnicodeType): + msg = '"{}" must be {}, not {}'.format(name, types.UnicodeType, ty) + raise TypingError(msg) + + +# FAST SEARCH algorithm implementation from cpython + +@register_jitable +def _bloom_add(mask, ch): + mask |= (1 << (ch & (_BLOOM_WIDTH - 1))) + return mask + + +@register_jitable +def _bloom_check(mask, ch): + return mask & (1 << (ch & (_BLOOM_WIDTH - 1))) + + +# https://github.com/python/cpython/blob/1960eb005e04b7ad8a91018088cfdb0646bc1ca0/Objects/stringlib/fastsearch.h#L550 # noqa: E501 +@register_jitable +def _default_find(data, substr, start, end): + """Left finder.""" + m = len(substr) + if m == 0: + return start + + gap = mlast = m - 1 + last = _get_code_point(substr, mlast) + + zero = types.intp(0) + mask = _bloom_add(zero, last) + for i in range(mlast): + ch = _get_code_point(substr, i) + mask = _bloom_add(mask, ch) + if ch == last: + gap = mlast - i - 1 + + i = start + while i <= end - m: + ch = _get_code_point(data, mlast + i) + if ch == last: + j = 0 + while j < mlast: + haystack_ch = _get_code_point(data, i + j) + needle_ch = _get_code_point(substr, j) + if haystack_ch != needle_ch: + break + j += 1 + if j == mlast: + # got a match + return i + + ch = _get_code_point(data, mlast + i + 1) + if _bloom_check(mask, ch) == 0: + i += m + else: + i += gap + else: + ch = _get_code_point(data, mlast + i + 1) + if _bloom_check(mask, ch) == 0: + i += m + i += 1 + + return -1 + + +@register_jitable +def _default_rfind(data, substr, start, end): + """Right finder.""" + m = len(substr) + if m == 0: + return end + + skip = mlast = m - 1 + mfirst = _get_code_point(substr, 0) + mask = _bloom_add(0, mfirst) + i = mlast + while i > 0: + ch = _get_code_point(substr, i) + mask = _bloom_add(mask, ch) + if ch == mfirst: + skip = i - 1 + i -= 1 + + i = end - m + while i >= start: + ch = _get_code_point(data, i) + if ch == mfirst: + j = mlast + while j > 0: + haystack_ch = _get_code_point(data, i + j) + needle_ch = _get_code_point(substr, j) + if haystack_ch != needle_ch: + break + j -= 1 + + if j == 0: + # got a match + return i + + ch = _get_code_point(data, i - 1) + if i > start and _bloom_check(mask, ch) == 0: + i -= m + else: + i -= skip + + else: + ch = _get_code_point(data, i - 1) + if i > start and _bloom_check(mask, ch) == 0: + i -= m + i -= 1 + + return -1 + + +def generate_finder(find_func): + """Generate finder either left or right.""" + def impl(data, substr, start=None, end=None): + length = len(data) + sub_length = len(substr) + if start is None: + start = 0 + if end is None: + end = length + + start, end = _adjust_indices(length, start, end) + if end - start < sub_length: + return -1 + + return find_func(data, substr, start, end) + + return impl + + +_find = register_jitable(generate_finder(_default_find)) +_rfind = register_jitable(generate_finder(_default_rfind)) + + +@overload_method(types.UnicodeType, 'find') +def unicode_find(data, substr, start=None, end=None): + """Implements str.find()""" + if isinstance(substr, types.UnicodeCharSeq): + def find_impl(data, substr, start=None, end=None): + return data.find(str(substr)) + return find_impl + + unicode_idx_check_type(start, 'start') + unicode_idx_check_type(end, 'end') + unicode_sub_check_type(substr, 'substr') + + return _find + + +@overload_method(types.UnicodeType, 'rfind') +def unicode_rfind(data, substr, start=None, end=None): + """Implements str.rfind()""" + if isinstance(substr, types.UnicodeCharSeq): + def rfind_impl(data, substr, start=None, end=None): + return data.rfind(str(substr)) + return rfind_impl + + unicode_idx_check_type(start, 'start') + unicode_idx_check_type(end, 'end') + unicode_sub_check_type(substr, 'substr') + + return _rfind + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12831-L12857 # noqa: E501 +@overload_method(types.UnicodeType, 'rindex') +def unicode_rindex(s, sub, start=None, end=None): + """Implements str.rindex()""" + unicode_idx_check_type(start, 'start') + unicode_idx_check_type(end, 'end') + unicode_sub_check_type(sub, 'sub') + + def rindex_impl(s, sub, start=None, end=None): + result = s.rfind(sub, start, end) + if result < 0: + raise ValueError('substring not found') + + return result + + return rindex_impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11692-L11718 # noqa: E501 +@overload_method(types.UnicodeType, 'index') +def unicode_index(s, sub, start=None, end=None): + """Implements str.index()""" + unicode_idx_check_type(start, 'start') + unicode_idx_check_type(end, 'end') + unicode_sub_check_type(sub, 'sub') + + def index_impl(s, sub, start=None, end=None): + result = s.find(sub, start, end) + if result < 0: + raise ValueError('substring not found') + + return result + + return index_impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12922-L12976 # noqa: E501 +@overload_method(types.UnicodeType, 'partition') +def unicode_partition(data, sep): + """Implements str.partition()""" + thety = sep + # if the type is omitted, the concrete type is the value + if isinstance(sep, types.Omitted): + thety = sep.value + # if the type is optional, the concrete type is the captured type + elif isinstance(sep, types.Optional): + thety = sep.type + + accepted = (types.UnicodeType, types.UnicodeCharSeq) + if thety is not None and not isinstance(thety, accepted): + msg = '"{}" must be {}, not {}'.format('sep', accepted, sep) + raise TypingError(msg) + + def impl(data, sep): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/partition.h#L7-L60 # noqa: E501 + sep = str(sep) + empty_str = _empty_string(data._kind, 0, data._is_ascii) + sep_length = len(sep) + if data._kind < sep._kind or len(data) < sep_length: + return data, empty_str, empty_str + + if sep_length == 0: + raise ValueError('empty separator') + + pos = data.find(sep) + if pos < 0: + return data, empty_str, empty_str + + return data[0:pos], sep, data[pos + sep_length:len(data)] + + return impl + + +@overload_method(types.UnicodeType, 'count') +def unicode_count(src, sub, start=None, end=None): + + _count_args_types_check(start) + _count_args_types_check(end) + + if isinstance(sub, types.UnicodeType): + def count_impl(src, sub, start=None, end=None): + count = 0 + src_len = len(src) + sub_len = len(sub) + + start = _normalize_slice_idx_count(start, src_len, 0) + end = _normalize_slice_idx_count(end, src_len, src_len) + + if end - start < 0 or start > src_len: + return 0 + + src = src[start : end] + src_len = len(src) + start, end = 0, src_len + if sub_len == 0: + return src_len + 1 + + while (start + sub_len <= src_len): + if src[start : start + sub_len] == sub: + count += 1 + start += sub_len + else: + start += 1 + return count + return count_impl + error_msg = "The substring must be a UnicodeType, not {}" + raise TypingError(error_msg.format(type(sub))) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12979-L13033 # noqa: E501 +@overload_method(types.UnicodeType, 'rpartition') +def unicode_rpartition(data, sep): + """Implements str.rpartition()""" + thety = sep + # if the type is omitted, the concrete type is the value + if isinstance(sep, types.Omitted): + thety = sep.value + # if the type is optional, the concrete type is the captured type + elif isinstance(sep, types.Optional): + thety = sep.type + + accepted = (types.UnicodeType, types.UnicodeCharSeq) + if thety is not None and not isinstance(thety, accepted): + msg = '"{}" must be {}, not {}'.format('sep', accepted, sep) + raise TypingError(msg) + + def impl(data, sep): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/partition.h#L62-L115 # noqa: E501 + sep = str(sep) + empty_str = _empty_string(data._kind, 0, data._is_ascii) + sep_length = len(sep) + if data._kind < sep._kind or len(data) < sep_length: + return empty_str, empty_str, data + + if sep_length == 0: + raise ValueError('empty separator') + + pos = data.rfind(sep) + if pos < 0: + return empty_str, empty_str, data + + return data[0:pos], sep, data[pos + sep_length:len(data)] + + return impl + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9342-L9354 # noqa: E501 +@register_jitable +def _adjust_indices(length, start, end): + if end > length: + end = length + if end < 0: + end += length + if end < 0: + end = 0 + if start < 0: + start += length + if start < 0: + start = 0 + + return start, end + + +@overload_method(types.UnicodeType, 'startswith') +def unicode_startswith(s, prefix, start=None, end=None): + if not is_nonelike(start) and not isinstance(start, types.Integer): + raise TypingError( + "When specified, the arg 'start' must be an Integer or None") + + if not is_nonelike(end) and not isinstance(end, types.Integer): + raise TypingError( + "When specified, the arg 'end' must be an Integer or None") + + if isinstance(prefix, types.UniTuple) and \ + isinstance(prefix.dtype, types.UnicodeType): + + def startswith_tuple_impl(s, prefix, start=None, end=None): + for item in prefix: + if s.startswith(item, start, end): + return True + return False + + return startswith_tuple_impl + + elif isinstance(prefix, types.UnicodeCharSeq): + def startswith_char_seq_impl(s, prefix, start=None, end=None): + return s.startswith(str(prefix), start, end) + + return startswith_char_seq_impl + + elif isinstance(prefix, types.UnicodeType): + def startswith_unicode_impl(s, prefix, start=None, end=None): + length, prefix_length = len(s), len(prefix) + if start is None: + start = 0 + if end is None: + end = length + + start, end = _adjust_indices(length, start, end) + if end - start < prefix_length: + return False + + if prefix_length == 0: + return True + + s_slice = s[start:end] + + return _cmp_region(s_slice, 0, prefix, 0, prefix_length) == 0 + + return startswith_unicode_impl + + else: + raise TypingError( + "The arg 'prefix' should be a string or a tuple of strings") + + +@overload_method(types.UnicodeType, 'endswith') +def unicode_endswith(s, substr, start=None, end=None): + if not (start is None or isinstance(start, (types.Omitted, + types.Integer, + types.NoneType))): + raise TypingError('The arg must be a Integer or None') + + if not (end is None or isinstance(end, (types.Omitted, + types.Integer, + types.NoneType))): + raise TypingError('The arg must be a Integer or None') + + if isinstance(substr, (types.Tuple, types.UniTuple)): + def endswith_impl(s, substr, start=None, end=None): + for item in substr: + if s.endswith(item, start, end) is True: + return True + + return False + return endswith_impl + + if isinstance(substr, types.UnicodeType): + def endswith_impl(s, substr, start=None, end=None): + length = len(s) + sub_length = len(substr) + if start is None: + start = 0 + if end is None: + end = length + + start, end = _adjust_indices(length, start, end) + if end - start < sub_length: + return False + + if sub_length == 0: + return True + + s = s[start:end] + offset = len(s) - sub_length + + return _cmp_region(s, offset, substr, 0, sub_length) == 0 + return endswith_impl + + if isinstance(substr, types.UnicodeCharSeq): + def endswith_impl(s, substr, start=None, end=None): + return s.endswith(str(substr), start, end) + return endswith_impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11519-L11595 # noqa: E501 +@overload_method(types.UnicodeType, 'expandtabs') +def unicode_expandtabs(data, tabsize=8): + """Implements str.expandtabs()""" + thety = tabsize + # if the type is omitted, the concrete type is the value + if isinstance(tabsize, types.Omitted): + thety = tabsize.value + # if the type is optional, the concrete type is the captured type + elif isinstance(tabsize, types.Optional): + thety = tabsize.type + + accepted = (types.Integer, int) + if thety is not None and not isinstance(thety, accepted): + raise TypingError( + '"tabsize" must be {}, not {}'.format(accepted, tabsize)) + + def expandtabs_impl(data, tabsize=8): + length = len(data) + j = line_pos = 0 + found = False + for i in range(length): + code_point = _get_code_point(data, i) + if code_point == _Py_TAB: + found = True + if tabsize > 0: + # cannot overflow + incr = tabsize - (line_pos % tabsize) + if j > sys.maxsize - incr: + raise OverflowError('new string is too long') + line_pos += incr + j += incr + else: + if j > sys.maxsize - 1: + raise OverflowError('new string is too long') + line_pos += 1 + j += 1 + if code_point in (_Py_LINEFEED, _Py_CARRIAGE_RETURN): + line_pos = 0 + + if not found: + return data + + res = _empty_string(data._kind, j, data._is_ascii) + j = line_pos = 0 + for i in range(length): + code_point = _get_code_point(data, i) + if code_point == _Py_TAB: + if tabsize > 0: + incr = tabsize - (line_pos % tabsize) + line_pos += incr + for idx in range(j, j + incr): + _set_code_point(res, idx, _Py_SPACE) + j += incr + else: + line_pos += 1 + _set_code_point(res, j, code_point) + j += 1 + if code_point in (_Py_LINEFEED, _Py_CARRIAGE_RETURN): + line_pos = 0 + + return res + + return expandtabs_impl + + +@overload_method(types.UnicodeType, 'split') +def unicode_split(a, sep=None, maxsplit=-1): + if not (maxsplit == -1 or + isinstance(maxsplit, (types.Omitted, types.Integer, + types.IntegerLiteral))): + return None # fail typing if maxsplit is not an integer + + if isinstance(sep, types.UnicodeCharSeq): + def split_impl(a, sep=None, maxsplit=-1): + return a.split(str(sep), maxsplit=maxsplit) + return split_impl + + if isinstance(sep, types.UnicodeType): + def split_impl(a, sep=None, maxsplit=-1): + a_len = len(a) + sep_len = len(sep) + + if sep_len == 0: + raise ValueError('empty separator') + + parts = [] + last = 0 + idx = 0 + + if sep_len == 1 and maxsplit == -1: + sep_code_point = _get_code_point(sep, 0) + for idx in range(a_len): + if _get_code_point(a, idx) == sep_code_point: + parts.append(a[last:idx]) + last = idx + 1 + else: + split_count = 0 + + while idx < a_len and (maxsplit == -1 or + split_count < maxsplit): + if _cmp_region(a, idx, sep, 0, sep_len) == 0: + parts.append(a[last:idx]) + idx += sep_len + last = idx + split_count += 1 + else: + idx += 1 + + if last <= a_len: + parts.append(a[last:]) + + return parts + return split_impl + elif sep is None or isinstance(sep, types.NoneType) or \ + getattr(sep, 'value', False) is None: + def split_whitespace_impl(a, sep=None, maxsplit=-1): + a_len = len(a) + + parts = [] + last = 0 + idx = 0 + split_count = 0 + in_whitespace_block = True + + for idx in range(a_len): + code_point = _get_code_point(a, idx) + is_whitespace = _PyUnicode_IsSpace(code_point) + if in_whitespace_block: + if is_whitespace: + pass # keep consuming space + else: + last = idx # this is the start of the next string + in_whitespace_block = False + else: + if not is_whitespace: + pass # keep searching for whitespace transition + else: + parts.append(a[last:idx]) + in_whitespace_block = True + split_count += 1 + if maxsplit != -1 and split_count == maxsplit: + break + + if last <= a_len and not in_whitespace_block: + parts.append(a[last:]) + + return parts + return split_whitespace_impl + + +def generate_rsplit_whitespace_impl(isspace_func): + """Generate whitespace rsplit func based on either ascii or unicode""" + + def rsplit_whitespace_impl(data, sep=None, maxsplit=-1): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/split.h#L192-L240 # noqa: E501 + if maxsplit < 0: + maxsplit = sys.maxsize + + result = [] + i = len(data) - 1 + while maxsplit > 0: + while i >= 0: + code_point = _get_code_point(data, i) + if not isspace_func(code_point): + break + i -= 1 + if i < 0: + break + j = i + i -= 1 + while i >= 0: + code_point = _get_code_point(data, i) + if isspace_func(code_point): + break + i -= 1 + result.append(data[i + 1:j + 1]) + maxsplit -= 1 + + if i >= 0: + # Only occurs when maxsplit was reached + # Skip any remaining whitespace and copy to beginning of string + while i >= 0: + code_point = _get_code_point(data, i) + if not isspace_func(code_point): + break + i -= 1 + if i >= 0: + result.append(data[0:i + 1]) + + return result[::-1] + + return rsplit_whitespace_impl + + +unicode_rsplit_whitespace_impl = register_jitable( + generate_rsplit_whitespace_impl(_PyUnicode_IsSpace)) +ascii_rsplit_whitespace_impl = register_jitable( + generate_rsplit_whitespace_impl(_Py_ISSPACE)) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L13095-L13108 # noqa: E501 +@overload_method(types.UnicodeType, 'rsplit') +def unicode_rsplit(data, sep=None, maxsplit=-1): + """Implements str.unicode_rsplit()""" + + def _unicode_rsplit_check_type(ty, name, accepted): + """Check object belongs to one of specified types""" + thety = ty + # if the type is omitted, the concrete type is the value + if isinstance(ty, types.Omitted): + thety = ty.value + # if the type is optional, the concrete type is the captured type + elif isinstance(ty, types.Optional): + thety = ty.type + + if thety is not None and not isinstance(thety, accepted): + raise TypingError( + '"{}" must be {}, not {}'.format(name, accepted, ty)) + + _unicode_rsplit_check_type(sep, 'sep', (types.UnicodeType, + types.UnicodeCharSeq, + types.NoneType)) + _unicode_rsplit_check_type(maxsplit, 'maxsplit', (types.Integer, int)) + + if sep is None or isinstance(sep, (types.NoneType, types.Omitted)): + + def rsplit_whitespace_impl(data, sep=None, maxsplit=-1): + if data._is_ascii: + return ascii_rsplit_whitespace_impl(data, sep, maxsplit) + return unicode_rsplit_whitespace_impl(data, sep, maxsplit) + + return rsplit_whitespace_impl + + def rsplit_impl(data, sep=None, maxsplit=-1): + sep = str(sep) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/split.h#L286-L333 # noqa: E501 + if data._kind < sep._kind or len(data) < len(sep): + return [data] + + def _rsplit_char(data, ch, maxsplit): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/split.h#L242-L284 # noqa: E501 + result = [] + ch_code_point = _get_code_point(ch, 0) + i = j = len(data) - 1 + while i >= 0 and maxsplit > 0: + data_code_point = _get_code_point(data, i) + if data_code_point == ch_code_point: + result.append(data[i + 1 : j + 1]) + j = i = i - 1 + maxsplit -= 1 + i -= 1 + if j >= -1: + result.append(data[0 : j + 1]) + + return result[::-1] + + if maxsplit < 0: + maxsplit = sys.maxsize + + sep_length = len(sep) + + if sep_length == 0: + raise ValueError('empty separator') + if sep_length == 1: + return _rsplit_char(data, sep, maxsplit) + + result = [] + j = len(data) + while maxsplit > 0: + pos = data.rfind(sep, start=0, end=j) + if pos < 0: + break + result.append(data[pos + sep_length:j]) + j = pos + maxsplit -= 1 + + result.append(data[0:j]) + + return result[::-1] + + return rsplit_impl + + +@overload_method(types.UnicodeType, 'center') +def unicode_center(string, width, fillchar=' '): + if not isinstance(width, types.Integer): + raise TypingError('The width must be an Integer') + + if isinstance(fillchar, types.UnicodeCharSeq): + def center_impl(string, width, fillchar=' '): + return string.center(width, str(fillchar)) + return center_impl + + if not (fillchar == ' ' or + isinstance(fillchar, (types.Omitted, types.UnicodeType))): + raise TypingError('The fillchar must be a UnicodeType') + + def center_impl(string, width, fillchar=' '): + str_len = len(string) + fillchar_len = len(fillchar) + + if fillchar_len != 1: + raise ValueError('The fill character must be exactly one ' + 'character long') + + if width <= str_len: + return string + + allmargin = width - str_len + lmargin = (allmargin // 2) + (allmargin & width & 1) + rmargin = allmargin - lmargin + + l_string = fillchar * lmargin + if lmargin == rmargin: + return l_string + string + l_string + else: + return l_string + string + (fillchar * rmargin) + + return center_impl + + +def gen_unicode_Xjust(STRING_FIRST): + def unicode_Xjust(string, width, fillchar=' '): + if not isinstance(width, types.Integer): + raise TypingError('The width must be an Integer') + + if isinstance(fillchar, types.UnicodeCharSeq): + if STRING_FIRST: + def ljust_impl(string, width, fillchar=' '): + return string.ljust(width, str(fillchar)) + return ljust_impl + else: + def rjust_impl(string, width, fillchar=' '): + return string.rjust(width, str(fillchar)) + return rjust_impl + + if not (fillchar == ' ' or + isinstance(fillchar, (types.Omitted, types.UnicodeType))): + raise TypingError('The fillchar must be a UnicodeType') + + def impl(string, width, fillchar=' '): + str_len = len(string) + fillchar_len = len(fillchar) + + if fillchar_len != 1: + raise ValueError('The fill character must be exactly one ' + 'character long') + + if width <= str_len: + return string + + newstr = (fillchar * (width - str_len)) + if STRING_FIRST: + return string + newstr + else: + return newstr + string + + return impl + + return unicode_Xjust + + +overload_method(types.UnicodeType, 'rjust')(gen_unicode_Xjust(False)) +overload_method(types.UnicodeType, 'ljust')(gen_unicode_Xjust(True)) + + +def generate_splitlines_func(is_line_break_func): + """Generate splitlines performer based on ascii or unicode line breaks.""" + def impl(data, keepends): + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/stringlib/split.h#L335-L389 # noqa: E501 + length = len(data) + result = [] + i = j = 0 + while i < length: + # find a line and append it + while i < length: + code_point = _get_code_point(data, i) + if is_line_break_func(code_point): + break + i += 1 + + # skip the line break reading CRLF as one line break + eol = i + if i < length: + if i + 1 < length: + cur_cp = _get_code_point(data, i) + next_cp = _get_code_point(data, i + 1) + if _Py_ISCARRIAGERETURN(cur_cp) and _Py_ISLINEFEED(next_cp): + i += 1 + i += 1 + if keepends: + eol = i + + result.append(data[j:eol]) + j = i + + return result + + return impl + + +_ascii_splitlines = register_jitable(generate_splitlines_func(_Py_ISLINEBREAK)) +_unicode_splitlines = register_jitable(generate_splitlines_func( + _PyUnicode_IsLineBreak)) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L10196-L10229 # noqa: E501 +@overload_method(types.UnicodeType, 'splitlines') +def unicode_splitlines(data, keepends=False): + """Implements str.splitlines()""" + thety = keepends + # if the type is omitted, the concrete type is the value + if isinstance(keepends, types.Omitted): + thety = keepends.value + # if the type is optional, the concrete type is the captured type + elif isinstance(keepends, types.Optional): + thety = keepends.type + + accepted = (types.Integer, int, types.Boolean, bool) + if thety is not None and not isinstance(thety, accepted): + raise TypingError( + '"{}" must be {}, not {}'.format('keepends', accepted, keepends)) + + def splitlines_impl(data, keepends=False): + if data._is_ascii: + return _ascii_splitlines(data, keepends) + + return _unicode_splitlines(data, keepends) + + return splitlines_impl + + +@register_jitable +def join_list(sep, parts): + parts_len = len(parts) + if parts_len == 0: + return '' + + # Precompute size and char_width of result + sep_len = len(sep) + length = (parts_len - 1) * sep_len + kind = sep._kind + is_ascii = sep._is_ascii + for p in parts: + length += len(p) + kind = _pick_kind(kind, p._kind) + is_ascii = _pick_ascii(is_ascii, p._is_ascii) + + result = _empty_string(kind, length, is_ascii) + + # populate string + part = parts[0] + _strncpy(result, 0, part, 0, len(part)) + dst_offset = len(part) + for idx in range(1, parts_len): + _strncpy(result, dst_offset, sep, 0, sep_len) + dst_offset += sep_len + part = parts[idx] + _strncpy(result, dst_offset, part, 0, len(part)) + dst_offset += len(part) + + return result + + +@overload_method(types.UnicodeType, 'join') +def unicode_join(sep, parts): + + if isinstance(parts, types.List): + if isinstance(parts.dtype, types.UnicodeType): + def join_list_impl(sep, parts): + return join_list(sep, parts) + return join_list_impl + elif isinstance(parts.dtype, types.UnicodeCharSeq): + def join_list_impl(sep, parts): + _parts = [str(p) for p in parts] + return join_list(sep, _parts) + return join_list_impl + else: + pass # lists of any other type not supported + elif isinstance(parts, types.IterableType): + def join_iter_impl(sep, parts): + parts_list = [p for p in parts] + return sep.join(parts_list) + return join_iter_impl + elif isinstance(parts, types.UnicodeType): + # Temporary workaround until UnicodeType is iterable + def join_str_impl(sep, parts): + parts_list = [parts[i] for i in range(len(parts))] + return join_list(sep, parts_list) + return join_str_impl + + +@overload_method(types.UnicodeType, 'zfill') +def unicode_zfill(string, width): + if not isinstance(width, types.Integer): + raise TypingError(" must be an Integer") + + def zfill_impl(string, width): + + str_len = len(string) + + if width <= str_len: + return string + + first_char = string[0] if str_len else '' + padding = '0' * (width - str_len) + + if first_char in ['+', '-']: + newstr = first_char + padding + string[1:] + else: + newstr = padding + string + + return newstr + + return zfill_impl + + +# ------------------------------------------------------------------------------ +# Strip functions +# ------------------------------------------------------------------------------ +@register_jitable +def unicode_strip_left_bound(string, chars): + str_len = len(string) + + i = 0 + if chars is not None: + for i in range(str_len): + if string[i] not in chars: + return i + else: + for i in range(str_len): + if not _PyUnicode_IsSpace(string[i]): + return i + + return str_len + + +@register_jitable +def unicode_strip_right_bound(string, chars): + str_len = len(string) + i = 0 + if chars is not None: + for i in range(str_len - 1, -1, -1): + if string[i] not in chars: + i += 1 + break + else: + for i in range(str_len - 1, -1, -1): + if not _PyUnicode_IsSpace(string[i]): + i += 1 + break + + return i + + +def unicode_strip_types_check(chars): + if isinstance(chars, types.Optional): + chars = chars.type # catch optional type with invalid non-None type + if not (chars is None or isinstance(chars, (types.Omitted, + types.UnicodeType, + types.NoneType))): + raise TypingError('The arg must be a UnicodeType or None') + + +def _count_args_types_check(arg): + if isinstance(arg, types.Optional): + arg = arg.type + if not (arg is None or isinstance(arg, (types.Omitted, + types.Integer, + types.NoneType))): + raise TypingError("The slice indices must be an Integer or None") + + +@overload_method(types.UnicodeType, 'lstrip') +def unicode_lstrip(string, chars=None): + + if isinstance(chars, types.UnicodeCharSeq): + def lstrip_impl(string, chars=None): + return string.lstrip(str(chars)) + return lstrip_impl + + unicode_strip_types_check(chars) + + def lstrip_impl(string, chars=None): + return string[unicode_strip_left_bound(string, chars):] + return lstrip_impl + + +@overload_method(types.UnicodeType, 'rstrip') +def unicode_rstrip(string, chars=None): + + if isinstance(chars, types.UnicodeCharSeq): + def rstrip_impl(string, chars=None): + return string.rstrip(str(chars)) + return rstrip_impl + + unicode_strip_types_check(chars) + + def rstrip_impl(string, chars=None): + return string[:unicode_strip_right_bound(string, chars)] + return rstrip_impl + + +@overload_method(types.UnicodeType, 'strip') +def unicode_strip(string, chars=None): + + if isinstance(chars, types.UnicodeCharSeq): + def strip_impl(string, chars=None): + return string.strip(str(chars)) + return strip_impl + + unicode_strip_types_check(chars) + + def strip_impl(string, chars=None): + lb = unicode_strip_left_bound(string, chars) + rb = unicode_strip_right_bound(string, chars) + return string[lb:rb] + return strip_impl + + +# ------------------------------------------------------------------------------ +# Slice functions +# ------------------------------------------------------------------------------ + +@register_jitable +def normalize_str_idx(idx, length, is_start=True): + """ + Parameters + ---------- + idx : int or None + the index + length : int + the string length + is_start : bool; optional with defaults to True + Is it the *start* or the *stop* of the slice? + + Returns + ------- + norm_idx : int + normalized index + """ + if idx is None: + if is_start: + return 0 + else: + return length + elif idx < 0: + idx += length + + if idx < 0 or idx >= length: + raise IndexError("string index out of range") + + return idx + + +@register_jitable +def _normalize_slice_idx_count(arg, slice_len, default): + """ + Used for unicode_count + + If arg < -slice_len, returns 0 (prevents circle) + + If arg is within slice, e.g -slice_len <= arg < slice_len + returns its real index via arg % slice_len + + If arg > slice_len, returns arg (in this case count must + return 0 if it is start index) + """ + + if arg is None: + return default + if -slice_len <= arg < slice_len: + return arg % slice_len + return 0 if arg < 0 else arg + + +@intrinsic +def _normalize_slice(typingctx, sliceobj, length): + """Fix slice object. + """ + sig = sliceobj(sliceobj, length) + + def codegen(context, builder, sig, args): + [slicetype, lengthtype] = sig.args + [sliceobj, length] = args + slice = context.make_helper(builder, slicetype, sliceobj) + slicing.guard_invalid_slice(context, builder, slicetype, slice) + slicing.fix_slice(builder, slice, length) + return slice._getvalue() + + return sig, codegen + + +@intrinsic +def _slice_span(typingctx, sliceobj): + """Compute the span from the given slice object. + """ + sig = types.intp(sliceobj) + + def codegen(context, builder, sig, args): + [slicetype] = sig.args + [sliceobj] = args + slice = context.make_helper(builder, slicetype, sliceobj) + result_size = slicing.get_slice_length(builder, slice) + return result_size + + return sig, codegen + + +@register_jitable(_nrt=False) +def _strncpy(dst, dst_offset, src, src_offset, n): + if src._kind == dst._kind: + byte_width = _kind_to_byte_width(src._kind) + src_byte_offset = byte_width * src_offset + dst_byte_offset = byte_width * dst_offset + nbytes = n * byte_width + memcpy_region(dst._data, dst_byte_offset, src._data, + src_byte_offset, nbytes, align=1) + else: + for i in range(n): + _set_code_point(dst, dst_offset + i, + _get_code_point(src, src_offset + i)) + + +@intrinsic +def _get_str_slice_view(typingctx, src_t, start_t, length_t): + """Create a slice of a unicode string using a view of its data to avoid + extra allocation. + """ + assert src_t == types.unicode_type + + def codegen(context, builder, sig, args): + src, start, length = args + in_str = cgutils.create_struct_proxy( + types.unicode_type)(context, builder, value=src) + view_str = cgutils.create_struct_proxy( + types.unicode_type)(context, builder) + view_str.meminfo = in_str.meminfo + view_str.kind = in_str.kind + view_str.is_ascii = in_str.is_ascii + view_str.length = length + # hash value -1 to indicate "need to compute hash" + view_str.hash = context.get_constant(_Py_hash_t, -1) + # get a pointer to start of slice data + bw_typ = context.typing_context.resolve_value_type(_kind_to_byte_width) + bw_sig = bw_typ.get_call_type( + context.typing_context, (types.int32,), {}) + bw_impl = context.get_function(bw_typ, bw_sig) + byte_width = bw_impl(builder, (in_str.kind,)) + offset = builder.mul(start, byte_width) + view_str.data = builder.gep(in_str.data, [offset]) + # Set parent pyobject to NULL + view_str.parent = cgutils.get_null_value(view_str.parent.type) + # incref original string + if context.enable_nrt: + context.nrt.incref(builder, sig.args[0], src) + return view_str._getvalue() + + sig = types.unicode_type(types.unicode_type, types.intp, types.intp) + return sig, codegen + + +@overload(operator.getitem) +def unicode_getitem(s, idx): + if isinstance(s, types.UnicodeType): + if isinstance(idx, types.Integer): + def getitem_char(s, idx): + idx = normalize_str_idx(idx, len(s)) + cp = _get_code_point(s, idx) + kind = _codepoint_to_kind(cp) + if kind == s._kind: + return _get_str_slice_view(s, idx, 1) + else: + is_ascii = _codepoint_is_ascii(cp) + ret = _empty_string(kind, 1, is_ascii) + _set_code_point(ret, 0, cp) + return ret + return getitem_char + elif isinstance(idx, types.SliceType): + def getitem_slice(s, idx): + slice_idx = _normalize_slice(idx, len(s)) + span = _slice_span(slice_idx) + + cp = _get_code_point(s, slice_idx.start) + kind = _codepoint_to_kind(cp) + is_ascii = _codepoint_is_ascii(cp) + + # Check slice to see if it's homogeneous in kind + for i in range(slice_idx.start + slice_idx.step, + slice_idx.stop, slice_idx.step): + cp = _get_code_point(s, i) + is_ascii &= _codepoint_is_ascii(cp) + new_kind = _codepoint_to_kind(cp) + if kind != new_kind: + kind = _pick_kind(kind, new_kind) + # TODO: it might be possible to break here if the kind + # is PY_UNICODE_4BYTE_KIND but there are potentially + # strings coming from other internal functions that are + # this wide and also actually ASCII (i.e. kind is larger + # than actually required for storing the code point), so + # it's necessary to continue. + + if slice_idx.step == 1 and kind == s._kind: + # Can return a view, the slice has the same kind as the + # string itself and it's a stride slice 1. + return _get_str_slice_view(s, slice_idx.start, span) + else: + # It's heterogeneous in kind OR stride != 1 + ret = _empty_string(kind, span, is_ascii) + cur = slice_idx.start + for i in range(span): + _set_code_point(ret, i, _get_code_point(s, cur)) + cur += slice_idx.step + return ret + + return getitem_slice + + +# ------------------------------------------------------------------------------ +# String operations +# ------------------------------------------------------------------------------ + + +@overload(operator.add) +@overload(operator.iadd) +def unicode_concat(a, b): + if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): + def concat_impl(a, b): + new_length = a._length + b._length + new_kind = _pick_kind(a._kind, b._kind) + new_ascii = _pick_ascii(a._is_ascii, b._is_ascii) + result = _empty_string(new_kind, new_length, new_ascii) + for i in range(len(a)): + _set_code_point(result, i, _get_code_point(a, i)) + for j in range(len(b)): + _set_code_point(result, len(a) + j, _get_code_point(b, j)) + return result + return concat_impl + + if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeCharSeq): + def concat_impl(a, b): + return a + str(b) + return concat_impl + + +@register_jitable +def _repeat_impl(str_arg, mult_arg): + if str_arg == '' or mult_arg < 1: + return '' + elif mult_arg == 1: + return str_arg + else: + new_length = str_arg._length * mult_arg + new_kind = str_arg._kind + result = _empty_string(new_kind, new_length, str_arg._is_ascii) + # make initial copy into result + len_a = len(str_arg) + _strncpy(result, 0, str_arg, 0, len_a) + # loop through powers of 2 for efficient copying + copy_size = len_a + while 2 * copy_size <= new_length: + _strncpy(result, copy_size, result, 0, copy_size) + copy_size *= 2 + + if not 2 * copy_size == new_length: + # if copy_size not an exact multiple it then needs + # to complete the rest of the copies + rest = new_length - copy_size + _strncpy(result, copy_size, result, copy_size - rest, rest) + return result + + +@overload(operator.mul) +def unicode_repeat(a, b): + if isinstance(a, types.UnicodeType) and isinstance(b, types.Integer): + def wrap(a, b): + return _repeat_impl(a, b) + return wrap + elif isinstance(a, types.Integer) and isinstance(b, types.UnicodeType): + def wrap(a, b): + return _repeat_impl(b, a) + return wrap + + +@overload(operator.not_) +def unicode_not(a): + if isinstance(a, types.UnicodeType): + def impl(a): + return len(a) == 0 + return impl + + +@overload_method(types.UnicodeType, 'replace') +def unicode_replace(s, old_str, new_str, count=-1): + thety = count + if isinstance(count, types.Omitted): + thety = count.value + elif isinstance(count, types.Optional): + thety = count.type + + if not isinstance(thety, (int, types.Integer)): + raise TypingError('Unsupported parameters. The parameters ' + 'must be Integer. Given count: {}'.format(count)) + + if not isinstance(old_str, (types.UnicodeType, types.NoneType)): + raise TypingError('The object must be a UnicodeType.' + ' Given: {}'.format(old_str)) + + if not isinstance(new_str, types.UnicodeType): + raise TypingError('The object must be a UnicodeType.' + ' Given: {}'.format(new_str)) + + def impl(s, old_str, new_str, count=-1): + if count == 0: + return s + if old_str == '': + schars = list(s) + if count == -1: + return new_str + new_str.join(schars) + new_str + split_result = [new_str] + min_count = min(len(schars), count) + for i in range(min_count): + split_result.append(schars[i]) + if i + 1 != min_count: + split_result.append(new_str) + else: + split_result.append(''.join(schars[(i + 1):])) + if count > len(schars): + split_result.append(new_str) + return ''.join(split_result) + schars = s.split(old_str, count) + result = new_str.join(schars) + return result + + return impl + +# ------------------------------------------------------------------------------ +# String `is*()` methods +# ------------------------------------------------------------------------------ + + +# generates isalpha/isalnum +def gen_isAlX(ascii_func, unicode_func): + def unicode_isAlX(data): + + def impl(data): + length = len(data) + if length == 0: + return False + + if length == 1: + code_point = _get_code_point(data, 0) + if data._is_ascii: + return ascii_func(code_point) + else: + return unicode_func(code_point) + + if data._is_ascii: + for i in range(length): + code_point = _get_code_point(data, i) + if not ascii_func(code_point): + return False + + for i in range(length): + code_point = _get_code_point(data, i) + if not unicode_func(code_point): + return False + + return True + + return impl + return unicode_isAlX + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11928-L11964 # noqa: E501 +overload_method(types.UnicodeType, 'isalpha')(gen_isAlX(_Py_ISALPHA, + _PyUnicode_IsAlpha)) + +_unicode_is_alnum = register_jitable(lambda x: + (_PyUnicode_IsNumeric(x) or + _PyUnicode_IsAlpha(x))) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11975-L12006 # noqa: E501 +overload_method(types.UnicodeType, 'isalnum')(gen_isAlX(_Py_ISALNUM, + _unicode_is_alnum)) + + +def _is_upper(is_lower, is_upper, is_title): + # impl is an approximate translation of: + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11794-L11827 # noqa: E501 + # mixed with: + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/bytes_methods.c#L218-L242 # noqa: E501 + def impl(a): + l = len(a) + if l == 1: + return is_upper(_get_code_point(a, 0)) != 0 + if l == 0: + return False + cased = False + for idx in range(l): + code_point = _get_code_point(a, idx) + if is_lower(code_point) or is_title(code_point): + return False + elif (not cased and is_upper(code_point)): + cased = True + return cased + return impl + + +_always_false = register_jitable(lambda x: False) +_ascii_is_upper = register_jitable(_is_upper(_Py_ISLOWER, _Py_ISUPPER, + _always_false)) +_unicode_is_upper = register_jitable(_is_upper(_PyUnicode_IsLowercase, + _PyUnicode_IsUppercase, + _PyUnicode_IsTitlecase)) + + +@overload_method(types.UnicodeType, 'isupper') +def unicode_isupper(a): + """ + Implements .isupper() + """ + def impl(a): + if a._is_ascii: + return _ascii_is_upper(a) + else: + return _unicode_is_upper(a) + return impl + + +@overload_method(types.UnicodeType, 'isascii') +def unicode_isascii(data): + """Implements UnicodeType.isascii()""" + + def impl(data): + return data._is_ascii + return impl + + +@overload_method(types.UnicodeType, 'istitle') +def unicode_istitle(data): + """ + Implements UnicodeType.istitle() + The algorithm is an approximate translation from CPython: + https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11829-L11885 # noqa: E501 + """ + + def impl(data): + length = len(data) + if length == 1: + char = _get_code_point(data, 0) + return _PyUnicode_IsUppercase(char) or _PyUnicode_IsTitlecase(char) + + if length == 0: + return False + + cased = False + previous_is_cased = False + for idx in range(length): + char = _get_code_point(data, idx) + if _PyUnicode_IsUppercase(char) or _PyUnicode_IsTitlecase(char): + if previous_is_cased: + return False + previous_is_cased = True + cased = True + elif _PyUnicode_IsLowercase(char): + if not previous_is_cased: + return False + previous_is_cased = True + cased = True + else: + previous_is_cased = False + + return cased + return impl + + +@overload_method(types.UnicodeType, 'islower') +def unicode_islower(data): + """ + impl is an approximate translation of: + https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L11900-L11933 # noqa: E501 + mixed with: + https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/bytes_methods.c#L131-L156 # noqa: E501 + """ + + def impl(data): + length = len(data) + if length == 1: + return _PyUnicode_IsLowercase(_get_code_point(data, 0)) + if length == 0: + return False + + cased = False + for idx in range(length): + cp = _get_code_point(data, idx) + if _PyUnicode_IsUppercase(cp) or _PyUnicode_IsTitlecase(cp): + return False + elif not cased and _PyUnicode_IsLowercase(cp): + cased = True + return cased + return impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12126-L12161 # noqa: E501 +@overload_method(types.UnicodeType, 'isidentifier') +def unicode_isidentifier(data): + """Implements UnicodeType.isidentifier()""" + + def impl(data): + length = len(data) + if length == 0: + return False + + first_cp = _get_code_point(data, 0) + if not _PyUnicode_IsXidStart(first_cp) and first_cp != 0x5F: + return False + + for i in range(1, length): + code_point = _get_code_point(data, i) + if not _PyUnicode_IsXidContinue(code_point): + return False + + return True + + return impl + + +# generator for simple unicode "isX" methods +def gen_isX(_PyUnicode_IS_func, empty_is_false=True): + def unicode_isX(data): + def impl(data): + length = len(data) + if length == 1: + return _PyUnicode_IS_func(_get_code_point(data, 0)) + + if empty_is_false and length == 0: + return False + + for i in range(length): + code_point = _get_code_point(data, i) + if not _PyUnicode_IS_func(code_point): + return False + + return True + + return impl + return unicode_isX + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L11896-L11925 # noqa: E501 +overload_method(types.UnicodeType, 'isspace')(gen_isX(_PyUnicode_IsSpace)) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12096-L12124 # noqa: E501 +overload_method(types.UnicodeType, 'isnumeric')(gen_isX(_PyUnicode_IsNumeric)) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12056-L12085 # noqa: E501 +overload_method(types.UnicodeType, 'isdigit')(gen_isX(_PyUnicode_IsDigit)) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12017-L12045 # noqa: E501 +overload_method(types.UnicodeType, 'isdecimal')( + gen_isX(_PyUnicode_IsDecimalDigit)) + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L12188-L12213 # noqa: E501 +overload_method(types.UnicodeType, 'isprintable')( + gen_isX(_PyUnicode_IsPrintable, False)) + +# ------------------------------------------------------------------------------ +# String methods that apply a transformation to the characters themselves +# ------------------------------------------------------------------------------ + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9863-L9908 # noqa: E501 +def case_operation(ascii_func, unicode_func): + """Generate common case operation performer.""" + def impl(data): + length = len(data) + if length == 0: + return _empty_string(data._kind, length, data._is_ascii) + + if data._is_ascii: + res = _empty_string(data._kind, length, 1) + ascii_func(data, res) + return res + + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9863-L9908 # noqa: E501 + tmp = _empty_string(PY_UNICODE_4BYTE_KIND, 3 * length, data._is_ascii) + # maxchar should be inside of a list to be pass as argument by reference + maxchars = [0] + newlength = unicode_func(data, length, tmp, maxchars) + maxchar = maxchars[0] + newkind = _codepoint_to_kind(maxchar) + res = _empty_string(newkind, newlength, _codepoint_is_ascii(maxchar)) + for i in range(newlength): + _set_code_point(res, i, _get_code_point(tmp, i)) + + return res + + return impl + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9856-L9883 # noqa: E501 +@register_jitable +def _handle_capital_sigma(data, length, idx): + """This is a translation of the function that handles the capital sigma.""" + c = 0 + j = idx - 1 + while j >= 0: + c = _get_code_point(data, j) + if not _PyUnicode_IsCaseIgnorable(c): + break + j -= 1 + final_sigma = (j >= 0 and _PyUnicode_IsCased(c)) + if final_sigma: + j = idx + 1 + while j < length: + c = _get_code_point(data, j) + if not _PyUnicode_IsCaseIgnorable(c): + break + j += 1 + final_sigma = (j == length or (not _PyUnicode_IsCased(c))) + + return 0x3c2 if final_sigma else 0x3c3 + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9885-L9895 # noqa: E501 +@register_jitable +def _lower_ucs4(code_point, data, length, idx, mapped): + """This is a translation of the function that lowers a character.""" + if code_point == 0x3A3: + mapped[0] = _handle_capital_sigma(data, length, idx) + return 1 + return _PyUnicode_ToLowerFull(code_point, mapped) + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9946-L9965 # noqa: E501 +def _gen_unicode_upper_or_lower(lower): + def _do_upper_or_lower(data, length, res, maxchars): + k = 0 + for idx in range(length): + mapped = np.zeros(3, dtype=_Py_UCS4) + code_point = _get_code_point(data, idx) + if lower: + n_res = _lower_ucs4(code_point, data, length, idx, mapped) + else: + # might be needed if call _do_upper_or_lower in unicode_upper + n_res = _PyUnicode_ToUpperFull(code_point, mapped) + for m in mapped[:n_res]: + maxchars[0] = max(maxchars[0], m) + _set_code_point(res, k, m) + k += 1 + return k + return _do_upper_or_lower + + +_unicode_upper = register_jitable(_gen_unicode_upper_or_lower(False)) +_unicode_lower = register_jitable(_gen_unicode_upper_or_lower(True)) + + +def _gen_ascii_upper_or_lower(func): + def _ascii_upper_or_lower(data, res): + for idx in range(len(data)): + code_point = _get_code_point(data, idx) + _set_code_point(res, idx, func(code_point)) + return _ascii_upper_or_lower + + +_ascii_upper = register_jitable(_gen_ascii_upper_or_lower(_Py_TOUPPER)) +_ascii_lower = register_jitable(_gen_ascii_upper_or_lower(_Py_TOLOWER)) + + +@overload_method(types.UnicodeType, 'lower') +def unicode_lower(data): + """Implements .lower()""" + return case_operation(_ascii_lower, _unicode_lower) + + +@overload_method(types.UnicodeType, 'upper') +def unicode_upper(data): + """Implements .upper()""" + return case_operation(_ascii_upper, _unicode_upper) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9819-L9834 # noqa: E501 +@register_jitable +def _unicode_casefold(data, length, res, maxchars): + k = 0 + mapped = np.zeros(3, dtype=_Py_UCS4) + for idx in range(length): + mapped.fill(0) + code_point = _get_code_point(data, idx) + n_res = _PyUnicode_ToFoldedFull(code_point, mapped) + for m in mapped[:n_res]: + maxchar = maxchars[0] + maxchars[0] = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + + return k + + +@register_jitable +def _ascii_casefold(data, res): + for idx in range(len(data)): + code_point = _get_code_point(data, idx) + _set_code_point(res, idx, _Py_TOLOWER(code_point)) + + +@overload_method(types.UnicodeType, 'casefold') +def unicode_casefold(data): + """Implements str.casefold()""" + return case_operation(_ascii_casefold, _unicode_casefold) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9737-L9759 # noqa: E501 +@register_jitable +def _unicode_capitalize(data, length, res, maxchars): + k = 0 + maxchar = 0 + mapped = np.zeros(3, dtype=_Py_UCS4) + code_point = _get_code_point(data, 0) + + n_res = _PyUnicode_ToTitleFull(code_point, mapped) + + for m in mapped[:n_res]: + maxchar = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + for idx in range(1, length): + mapped.fill(0) + code_point = _get_code_point(data, idx) + n_res = _lower_ucs4(code_point, data, length, idx, mapped) + for m in mapped[:n_res]: + maxchar = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + maxchars[0] = maxchar + return k + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/bytes_methods.c#L361-L382 # noqa: E501 +@register_jitable +def _ascii_capitalize(data, res): + code_point = _get_code_point(data, 0) + _set_code_point(res, 0, _Py_TOUPPER(code_point)) + for idx in range(1, len(data)): + code_point = _get_code_point(data, idx) + _set_code_point(res, idx, _Py_TOLOWER(code_point)) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L10765-L10774 # noqa: E501 +@overload_method(types.UnicodeType, 'capitalize') +def unicode_capitalize(data): + return case_operation(_ascii_capitalize, _unicode_capitalize) + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L9996-L10021 # noqa: E501 +@register_jitable +def _unicode_title(data, length, res, maxchars): + """This is a translation of the function that titles a unicode string.""" + k = 0 + previous_cased = False + mapped = np.empty(3, dtype=_Py_UCS4) + for idx in range(length): + mapped.fill(0) + code_point = _get_code_point(data, idx) + if previous_cased: + n_res = _lower_ucs4(code_point, data, length, idx, mapped) + else: + n_res = _PyUnicode_ToTitleFull(_Py_UCS4(code_point), mapped) + for m in mapped[:n_res]: + maxchar, = maxchars + maxchars[0] = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + previous_cased = _PyUnicode_IsCased(_Py_UCS4(code_point)) + return k + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/bytes_methods.c#L332-L352 # noqa: E501 +@register_jitable +def _ascii_title(data, res): + """ Does .title() on an ASCII string """ + previous_is_cased = False + for idx in range(len(data)): + code_point = _get_code_point(data, idx) + if _Py_ISLOWER(code_point): + if not previous_is_cased: + code_point = _Py_TOUPPER(code_point) + previous_is_cased = True + elif _Py_ISUPPER(code_point): + if previous_is_cased: + code_point = _Py_TOLOWER(code_point) + previous_is_cased = True + else: + previous_is_cased = False + _set_code_point(res, idx, code_point) + + +# https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodeobject.c#L10023-L10069 # noqa: E501 +@overload_method(types.UnicodeType, 'title') +def unicode_title(data): + """Implements str.title()""" + # https://docs.python.org/3/library/stdtypes.html#str.title + return case_operation(_ascii_title, _unicode_title) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/bytes_methods.c#L391-L408 # noqa: E501 +@register_jitable +def _ascii_swapcase(data, res): + for idx in range(len(data)): + code_point = _get_code_point(data, idx) + if _Py_ISUPPER(code_point): + code_point = _Py_TOLOWER(code_point) + elif _Py_ISLOWER(code_point): + code_point = _Py_TOUPPER(code_point) + _set_code_point(res, idx, code_point) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L9761-L9784 # noqa: E501 +@register_jitable +def _unicode_swapcase(data, length, res, maxchars): + k = 0 + maxchar = 0 + mapped = np.empty(3, dtype=_Py_UCS4) + for idx in range(length): + mapped.fill(0) + code_point = _get_code_point(data, idx) + if _PyUnicode_IsUppercase(code_point): + n_res = _lower_ucs4(code_point, data, length, idx, mapped) + elif _PyUnicode_IsLowercase(code_point): + n_res = _PyUnicode_ToUpperFull(code_point, mapped) + else: + n_res = 1 + mapped[0] = code_point + for m in mapped[:n_res]: + maxchar = max(maxchar, m) + _set_code_point(res, k, m) + k += 1 + maxchars[0] = maxchar + return k + + +@overload_method(types.UnicodeType, 'swapcase') +def unicode_swapcase(data): + return case_operation(_ascii_swapcase, _unicode_swapcase) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Python/bltinmodule.c#L1781-L1824 # noqa: E501 +@overload(ord) +def ol_ord(c): + if isinstance(c, types.UnicodeType): + def impl(c): + lc = len(c) + if lc != 1: + # CPython does TypeError + raise TypeError("ord() expected a character") + return _get_code_point(c, 0) + return impl + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L2005-L2028 # noqa: E501 +# This looks a bit different to the cpython implementation but, with the +# exception of a latin1 fast path is logically the same. It finds the "kind" of +# the codepoint `ch`, creates a length 1 string of that kind and then injects +# the code point into the zero position of that string. Cpython does similar but +# branches for each kind (this is encapsulated in Numba's _set_code_point). +@register_jitable +def _unicode_char(ch): + assert ch <= _MAX_UNICODE + kind = _codepoint_to_kind(ch) + ret = _empty_string(kind, 1, kind == PY_UNICODE_1BYTE_KIND) + _set_code_point(ret, 0, ch) + return ret + + +_out_of_range_msg = "chr() arg not in range(0x%hx)" % _MAX_UNICODE + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodeobject.c#L3045-L3055 # noqa: E501 +@register_jitable +def _PyUnicode_FromOrdinal(ordinal): + if (ordinal < 0 or ordinal > _MAX_UNICODE): + raise ValueError(_out_of_range_msg) + + return _unicode_char(_Py_UCS4(ordinal)) + + +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Python/bltinmodule.c#L715-L720 # noqa: E501 +@overload(chr) +def ol_chr(i): + if isinstance(i, types.Integer): + def impl(i): + return _PyUnicode_FromOrdinal(i) + return impl + + +@overload_method(types.UnicodeType, "__str__") +def unicode_str(s): + return lambda s: s + + +@overload_method(types.UnicodeType, "__repr__") +def unicode_repr(s): + # Can't use f-string as the impl ends up calling str and then repr, which + # then recurses somewhere in imports. + return lambda s: "'" + s + "'" + + +@overload_method(types.Integer, "__str__") +def integer_str(n): + + ten = n(10) + + def impl(n): + flag = False + if n < 0: + n = -n + flag = True + if n == 0: + return '0' + length = flag + 1 + int(np.floor(np.log10(n))) + kind = PY_UNICODE_1BYTE_KIND + char_width = _kind_to_byte_width(kind) + s = _malloc_string(kind, char_width, length, True) + if flag: + _set_code_point(s, 0, ord('-')) + idx = length - 1 + while n > 0: + n, digit = divmod(n, ten) + c = ord('0') + digit + _set_code_point(s, idx, c) + idx -= 1 + return s + return impl + + +@overload_method(types.Integer, "__repr__") +def integer_repr(n): + return lambda n: n.__str__() + + +@overload_method(types.Boolean, "__repr__") +@overload_method(types.Boolean, "__str__") +def boolean_str(b): + return lambda b: 'True' if b else 'False' + + +# ------------------------------------------------------------------------------ +# iteration +# ------------------------------------------------------------------------------ + + +@lower_builtin('getiter', types.UnicodeType) +def getiter_unicode(context, builder, sig, args): + [ty] = sig.args + [data] = args + + iterobj = context.make_helper(builder, sig.return_type) + + # set the index to zero + zero = context.get_constant(types.uintp, 0) + indexptr = cgutils.alloca_once_value(builder, zero) + + iterobj.index = indexptr + + # wire in the unicode type data + iterobj.data = data + + # incref as needed + if context.enable_nrt: + context.nrt.incref(builder, ty, data) + + res = iterobj._getvalue() + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +@lower_builtin('iternext', types.UnicodeIteratorType) +# a new ref counted object is put into result._yield so set the new_ref to True! +@iternext_impl(RefType.NEW) +def iternext_unicode(context, builder, sig, args, result): + [iterty] = sig.args + [iter] = args + + tyctx = context.typing_context + + # get ref to unicode.__getitem__ + fnty = tyctx.resolve_value_type(operator.getitem) + getitem_sig = fnty.get_call_type(tyctx, (types.unicode_type, types.uintp), + {}) + getitem_impl = context.get_function(fnty, getitem_sig) + + # get ref to unicode.__len__ + fnty = tyctx.resolve_value_type(len) + len_sig = fnty.get_call_type(tyctx, (types.unicode_type,), {}) + len_impl = context.get_function(fnty, len_sig) + + # grab unicode iterator struct + iterobj = context.make_helper(builder, iterty, value=iter) + + # find the length of the string + strlen = len_impl(builder, (iterobj.data,)) + + # find the current index + index = builder.load(iterobj.index) + + # see if the index is in range + is_valid = builder.icmp_unsigned('<', index, strlen) + result.set_valid(is_valid) + + with builder.if_then(is_valid): + # return value at index + gotitem = getitem_impl(builder, (iterobj.data, index,)) + result.yield_(gotitem) + + # bump index for next cycle + nindex = cgutils.increment_index(builder, index) + builder.store(nindex, iterobj.index) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/unicode_support.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/unicode_support.py new file mode 100644 index 0000000000000000000000000000000000000000..b42b7e0e6152a215f2329ec345fdebed0f711063 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cpython/unicode_support.py @@ -0,0 +1,768 @@ +""" +This module contains support functions for more advanced unicode operations. +This is not a public API and is for Numba internal use only. Most of the +functions are relatively straightforward translations of the functions with the +same name in CPython. +""" +from collections import namedtuple +from enum import IntEnum + +import llvmlite.ir +import numpy as np + +from numba.core import types, cgutils, config +from numba.core.imputils import (impl_ret_untracked) + +from numba.core.extending import overload, intrinsic, register_jitable +from numba.core.errors import TypingError + +# This is equivalent to the struct `_PyUnicode_TypeRecord defined in CPython's +# Objects/unicodectype.c +typerecord = namedtuple('typerecord', + 'upper lower title decimal digit flags') + +# The Py_UCS4 type from CPython: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/unicodeobject.h#L112 # noqa: E501 +if config.USE_LEGACY_TYPE_SYSTEM: + _Py_UCS4 = types.uint32 +else: + _Py_UCS4 = types.c_uint32 + +# ------------------------------------------------------------------------------ +# Start code related to/from CPython's unicodectype impl +# +# NOTE: the original source at: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c # noqa: E501 +# contains this statement: +# +# /* +# Unicode character type helpers. +# +# Written by Marc-Andre Lemburg (mal@lemburg.com). +# Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com) +# +# Copyright (c) Corporation for National Research Initiatives. +# +# */ + + +# This enum contains the values defined in CPython's Objects/unicodectype.c that +# provide masks for use against the various members of the typerecord +# +# See: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L13-L27 # noqa: E501 +# + + +_Py_TAB = 0x9 +_Py_LINEFEED = 0xa +_Py_CARRIAGE_RETURN = 0xd +_Py_SPACE = 0x20 + + +class _PyUnicode_TyperecordMasks(IntEnum): + ALPHA_MASK = 0x01 + DECIMAL_MASK = 0x02 + DIGIT_MASK = 0x04 + LOWER_MASK = 0x08 + LINEBREAK_MASK = 0x10 + SPACE_MASK = 0x20 + TITLE_MASK = 0x40 + UPPER_MASK = 0x80 + XID_START_MASK = 0x100 + XID_CONTINUE_MASK = 0x200 + PRINTABLE_MASK = 0x400 + NUMERIC_MASK = 0x800 + CASE_IGNORABLE_MASK = 0x1000 + CASED_MASK = 0x2000 + EXTENDED_CASE_MASK = 0x4000 + + +def _PyUnicode_gettyperecord(a): + raise RuntimeError("Calling the Python definition is invalid") + + +@intrinsic +def _gettyperecord_impl(typingctx, codepoint): + """ + Provides the binding to numba_gettyperecord, returns a `typerecord` + namedtuple of properties from the codepoint. + """ + if not isinstance(codepoint, types.Integer): + raise TypingError("codepoint must be an integer") + + def details(context, builder, signature, args): + ll_void = context.get_value_type(types.void) + ll_Py_UCS4 = context.get_value_type(_Py_UCS4) + ll_intc = context.get_value_type(types.intc) + ll_intc_ptr = ll_intc.as_pointer() + ll_uchar = context.get_value_type(types.uchar) + ll_uchar_ptr = ll_uchar.as_pointer() + ll_ushort = context.get_value_type(types.ushort) + ll_ushort_ptr = ll_ushort.as_pointer() + fnty = llvmlite.ir.FunctionType(ll_void, [ + ll_Py_UCS4, # code + ll_intc_ptr, # upper + ll_intc_ptr, # lower + ll_intc_ptr, # title + ll_uchar_ptr, # decimal + ll_uchar_ptr, # digit + ll_ushort_ptr, # flags + ]) + fn = cgutils.get_or_insert_function( + builder.module, + fnty, name="numba_gettyperecord") + upper = cgutils.alloca_once(builder, ll_intc, name='upper') + lower = cgutils.alloca_once(builder, ll_intc, name='lower') + title = cgutils.alloca_once(builder, ll_intc, name='title') + decimal = cgutils.alloca_once(builder, ll_uchar, name='decimal') + digit = cgutils.alloca_once(builder, ll_uchar, name='digit') + flags = cgutils.alloca_once(builder, ll_ushort, name='flags') + + byref = [ upper, lower, title, decimal, digit, flags] + builder.call(fn, [args[0]] + byref) + buf = [] + for x in byref: + buf.append(builder.load(x)) + + res = context.make_tuple(builder, signature.return_type, tuple(buf)) + return impl_ret_untracked(context, builder, signature.return_type, res) + + tupty = types.NamedTuple([types.intc, types.intc, types.intc, types.uchar, + types.uchar, types.ushort], typerecord) + sig = tupty(_Py_UCS4) + return sig, details + + +@overload(_PyUnicode_gettyperecord) +def gettyperecord_impl(a): + """ + Provides a _PyUnicode_gettyperecord binding, for convenience it will accept + single character strings and code points. + """ + if isinstance(a, types.UnicodeType): + from numba.cpython.unicode import _get_code_point + + def impl(a): + if len(a) > 1: + msg = "gettyperecord takes a single unicode character" + raise ValueError(msg) + code_point = _get_code_point(a, 0) + data = _gettyperecord_impl(_Py_UCS4(code_point)) + return data + return impl + if isinstance(a, types.Integer): + return lambda a: _gettyperecord_impl(_Py_UCS4(a)) + + +# whilst it's possible to grab the _PyUnicode_ExtendedCase symbol as it's global +# it is safer to use a defined api: +@intrinsic +def _PyUnicode_ExtendedCase(typingctx, index): + """ + Accessor function for the _PyUnicode_ExtendedCase array, binds to + numba_get_PyUnicode_ExtendedCase which wraps the array and does the lookup + """ + if not isinstance(index, types.Integer): + raise TypingError("Expected an index") + + def details(context, builder, signature, args): + ll_Py_UCS4 = context.get_value_type(_Py_UCS4) + ll_intc = context.get_value_type(types.intc) + fnty = llvmlite.ir.FunctionType(ll_Py_UCS4, [ll_intc]) + fn = cgutils.get_or_insert_function( + builder.module, + fnty, name="numba_get_PyUnicode_ExtendedCase") + return builder.call(fn, [args[0]]) + + sig = _Py_UCS4(types.intc) + return sig, details + +# The following functions are replications of the functions with the same name +# in CPython's Objects/unicodectype.c + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L64-L71 # noqa: E501 +@register_jitable +def _PyUnicode_ToTitlecase(ch): + ctype = _PyUnicode_gettyperecord(ch) + if (ctype.flags & _PyUnicode_TyperecordMasks.EXTENDED_CASE_MASK): + return _PyUnicode_ExtendedCase(ctype.title & 0xFFFF) + return ch + ctype.title + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L76-L81 # noqa: E501 +@register_jitable +def _PyUnicode_IsTitlecase(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.TITLE_MASK != 0 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L86-L91 # noqa: E501 +@register_jitable +def _PyUnicode_IsXidStart(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.XID_START_MASK != 0 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L96-L101 # noqa: E501 +@register_jitable +def _PyUnicode_IsXidContinue(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.XID_CONTINUE_MASK != 0 + + +@register_jitable +def _PyUnicode_ToDecimalDigit(ch): + ctype = _PyUnicode_gettyperecord(ch) + if ctype.flags & _PyUnicode_TyperecordMasks.DECIMAL_MASK: + return ctype.decimal + return -1 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L123-L1128 # noqa: E501 +@register_jitable +def _PyUnicode_ToDigit(ch): + ctype = _PyUnicode_gettyperecord(ch) + if ctype.flags & _PyUnicode_TyperecordMasks.DIGIT_MASK: + return ctype.digit + return -1 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L140-L145 # noqa: E501 +@register_jitable +def _PyUnicode_IsNumeric(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.NUMERIC_MASK != 0 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L160-L165 # noqa: E501 +@register_jitable +def _PyUnicode_IsPrintable(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.PRINTABLE_MASK != 0 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L170-L175 # noqa: E501 +@register_jitable +def _PyUnicode_IsLowercase(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.LOWER_MASK != 0 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L180-L185 # noqa: E501 +@register_jitable +def _PyUnicode_IsUppercase(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.UPPER_MASK != 0 + + +@register_jitable +def _PyUnicode_IsLineBreak(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.LINEBREAK_MASK != 0 + + +@register_jitable +def _PyUnicode_ToUppercase(ch): + raise NotImplementedError + + +@register_jitable +def _PyUnicode_ToLowercase(ch): + raise NotImplementedError + + +# From: https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodectype.c#L211-L225 # noqa: E501 +@register_jitable +def _PyUnicode_ToLowerFull(ch, res): + ctype = _PyUnicode_gettyperecord(ch) + if (ctype.flags & _PyUnicode_TyperecordMasks.EXTENDED_CASE_MASK): + index = ctype.lower & 0xFFFF + n = ctype.lower >> 24 + for i in range(n): + res[i] = _PyUnicode_ExtendedCase(index + i) + return n + res[0] = ch + ctype.lower + return 1 + + +# From: https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Objects/unicodectype.c#L227-L241 # noqa: E501 +@register_jitable +def _PyUnicode_ToTitleFull(ch, res): + ctype = _PyUnicode_gettyperecord(ch) + if (ctype.flags & _PyUnicode_TyperecordMasks.EXTENDED_CASE_MASK): + index = ctype.title & 0xFFFF + n = ctype.title >> 24 + for i in range(n): + res[i] = _PyUnicode_ExtendedCase(index + i) + return n + res[0] = ch + ctype.title + return 1 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L243-L257 # noqa: E501 +@register_jitable +def _PyUnicode_ToUpperFull(ch, res): + ctype = _PyUnicode_gettyperecord(ch) + if (ctype.flags & _PyUnicode_TyperecordMasks.EXTENDED_CASE_MASK): + index = ctype.upper & 0xFFFF + n = ctype.upper >> 24 + for i in range(n): + # Perhaps needed to use unicode._set_code_point() here + res[i] = _PyUnicode_ExtendedCase(index + i) + return n + res[0] = ch + ctype.upper + return 1 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L259-L272 # noqa: E501 +@register_jitable +def _PyUnicode_ToFoldedFull(ch, res): + ctype = _PyUnicode_gettyperecord(ch) + extended_case_mask = _PyUnicode_TyperecordMasks.EXTENDED_CASE_MASK + if ctype.flags & extended_case_mask and (ctype.lower >> 20) & 7: + index = (ctype.lower & 0xFFFF) + (ctype.lower >> 24) + n = (ctype.lower >> 20) & 7 + for i in range(n): + res[i] = _PyUnicode_ExtendedCase(index + i) + return n + return _PyUnicode_ToLowerFull(ch, res) + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L274-L279 # noqa: E501 +@register_jitable +def _PyUnicode_IsCased(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.CASED_MASK != 0 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L281-L286 # noqa: E501 +@register_jitable +def _PyUnicode_IsCaseIgnorable(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.CASE_IGNORABLE_MASK != 0 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L123-L135 # noqa: E501 +@register_jitable +def _PyUnicode_IsDigit(ch): + if _PyUnicode_ToDigit(ch) < 0: + return 0 + return 1 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L106-L118 # noqa: E501 +@register_jitable +def _PyUnicode_IsDecimalDigit(ch): + if _PyUnicode_ToDecimalDigit(ch) < 0: + return 0 + return 1 + + +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodectype.c#L291-L296 # noqa: E501 +@register_jitable +def _PyUnicode_IsSpace(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.SPACE_MASK != 0 + + +@register_jitable +def _PyUnicode_IsAlpha(ch): + ctype = _PyUnicode_gettyperecord(ch) + return ctype.flags & _PyUnicode_TyperecordMasks.ALPHA_MASK != 0 + + +# End code related to/from CPython's unicodectype impl +# ------------------------------------------------------------------------------ + + +# ------------------------------------------------------------------------------ +# Start code related to/from CPython's pyctype + +# From the definition in CPython's Include/pyctype.h +# From: https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L5-L11 # noqa: E501 +class _PY_CTF(IntEnum): + LOWER = 0x01 + UPPER = 0x02 + ALPHA = 0x01 | 0x02 + DIGIT = 0x04 + ALNUM = 0x01 | 0x02 | 0x04 + SPACE = 0x08 + XDIGIT = 0x10 + + +# From the definition in CPython's Python/pyctype.c +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Python/pyctype.c#L5 # noqa: E501 +_Py_ctype_table = np.array([ + 0, # 0x0 '\x00' + 0, # 0x1 '\x01' + 0, # 0x2 '\x02' + 0, # 0x3 '\x03' + 0, # 0x4 '\x04' + 0, # 0x5 '\x05' + 0, # 0x6 '\x06' + 0, # 0x7 '\x07' + 0, # 0x8 '\x08' + _PY_CTF.SPACE, # 0x9 '\t' + _PY_CTF.SPACE, # 0xa '\n' + _PY_CTF.SPACE, # 0xb '\v' + _PY_CTF.SPACE, # 0xc '\f' + _PY_CTF.SPACE, # 0xd '\r' + 0, # 0xe '\x0e' + 0, # 0xf '\x0f' + 0, # 0x10 '\x10' + 0, # 0x11 '\x11' + 0, # 0x12 '\x12' + 0, # 0x13 '\x13' + 0, # 0x14 '\x14' + 0, # 0x15 '\x15' + 0, # 0x16 '\x16' + 0, # 0x17 '\x17' + 0, # 0x18 '\x18' + 0, # 0x19 '\x19' + 0, # 0x1a '\x1a' + 0, # 0x1b '\x1b' + 0, # 0x1c '\x1c' + 0, # 0x1d '\x1d' + 0, # 0x1e '\x1e' + 0, # 0x1f '\x1f' + _PY_CTF.SPACE, # 0x20 ' ' + 0, # 0x21 '!' + 0, # 0x22 '"' + 0, # 0x23 '#' + 0, # 0x24 '$' + 0, # 0x25 '%' + 0, # 0x26 '&' + 0, # 0x27 "'" + 0, # 0x28 '(' + 0, # 0x29 ')' + 0, # 0x2a '*' + 0, # 0x2b '+' + 0, # 0x2c ',' + 0, # 0x2d '-' + 0, # 0x2e '.' + 0, # 0x2f '/' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x30 '0' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x31 '1' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x32 '2' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x33 '3' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x34 '4' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x35 '5' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x36 '6' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x37 '7' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x38 '8' + _PY_CTF.DIGIT | _PY_CTF.XDIGIT, # 0x39 '9' + 0, # 0x3a ':' + 0, # 0x3b ';' + 0, # 0x3c '<' + 0, # 0x3d '=' + 0, # 0x3e '>' + 0, # 0x3f '?' + 0, # 0x40 '@' + _PY_CTF.UPPER | _PY_CTF.XDIGIT, # 0x41 'A' + _PY_CTF.UPPER | _PY_CTF.XDIGIT, # 0x42 'B' + _PY_CTF.UPPER | _PY_CTF.XDIGIT, # 0x43 'C' + _PY_CTF.UPPER | _PY_CTF.XDIGIT, # 0x44 'D' + _PY_CTF.UPPER | _PY_CTF.XDIGIT, # 0x45 'E' + _PY_CTF.UPPER | _PY_CTF.XDIGIT, # 0x46 'F' + _PY_CTF.UPPER, # 0x47 'G' + _PY_CTF.UPPER, # 0x48 'H' + _PY_CTF.UPPER, # 0x49 'I' + _PY_CTF.UPPER, # 0x4a 'J' + _PY_CTF.UPPER, # 0x4b 'K' + _PY_CTF.UPPER, # 0x4c 'L' + _PY_CTF.UPPER, # 0x4d 'M' + _PY_CTF.UPPER, # 0x4e 'N' + _PY_CTF.UPPER, # 0x4f 'O' + _PY_CTF.UPPER, # 0x50 'P' + _PY_CTF.UPPER, # 0x51 'Q' + _PY_CTF.UPPER, # 0x52 'R' + _PY_CTF.UPPER, # 0x53 'S' + _PY_CTF.UPPER, # 0x54 'T' + _PY_CTF.UPPER, # 0x55 'U' + _PY_CTF.UPPER, # 0x56 'V' + _PY_CTF.UPPER, # 0x57 'W' + _PY_CTF.UPPER, # 0x58 'X' + _PY_CTF.UPPER, # 0x59 'Y' + _PY_CTF.UPPER, # 0x5a 'Z' + 0, # 0x5b '[' + 0, # 0x5c '\\' + 0, # 0x5d ']' + 0, # 0x5e '^' + 0, # 0x5f '_' + 0, # 0x60 '`' + _PY_CTF.LOWER | _PY_CTF.XDIGIT, # 0x61 'a' + _PY_CTF.LOWER | _PY_CTF.XDIGIT, # 0x62 'b' + _PY_CTF.LOWER | _PY_CTF.XDIGIT, # 0x63 'c' + _PY_CTF.LOWER | _PY_CTF.XDIGIT, # 0x64 'd' + _PY_CTF.LOWER | _PY_CTF.XDIGIT, # 0x65 'e' + _PY_CTF.LOWER | _PY_CTF.XDIGIT, # 0x66 'f' + _PY_CTF.LOWER, # 0x67 'g' + _PY_CTF.LOWER, # 0x68 'h' + _PY_CTF.LOWER, # 0x69 'i' + _PY_CTF.LOWER, # 0x6a 'j' + _PY_CTF.LOWER, # 0x6b 'k' + _PY_CTF.LOWER, # 0x6c 'l' + _PY_CTF.LOWER, # 0x6d 'm' + _PY_CTF.LOWER, # 0x6e 'n' + _PY_CTF.LOWER, # 0x6f 'o' + _PY_CTF.LOWER, # 0x70 'p' + _PY_CTF.LOWER, # 0x71 'q' + _PY_CTF.LOWER, # 0x72 'r' + _PY_CTF.LOWER, # 0x73 's' + _PY_CTF.LOWER, # 0x74 't' + _PY_CTF.LOWER, # 0x75 'u' + _PY_CTF.LOWER, # 0x76 'v' + _PY_CTF.LOWER, # 0x77 'w' + _PY_CTF.LOWER, # 0x78 'x' + _PY_CTF.LOWER, # 0x79 'y' + _PY_CTF.LOWER, # 0x7a 'z' + 0, # 0x7b '{' + 0, # 0x7c '|' + 0, # 0x7d '}' + 0, # 0x7e '~' + 0, # 0x7f '\x7f' + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +], dtype=np.intc) + + +# From the definition in CPython's Python/pyctype.c +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Python/pyctype.c#L145 # noqa: E501 +_Py_ctype_tolower = np.array([ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, +], dtype=np.uint8) + + +# From the definition in CPython's Python/pyctype.c +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Python/pyctype.c#L180 +_Py_ctype_toupper = np.array([ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, +], dtype=np.uint8) + + +class _PY_CTF_LB(IntEnum): + LINE_BREAK = 0x01 + LINE_FEED = 0x02 + CARRIAGE_RETURN = 0x04 + + +_Py_ctype_islinebreak = np.array([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + _PY_CTF_LB.LINE_BREAK | _PY_CTF_LB.LINE_FEED, # 0xa '\n' + _PY_CTF_LB.LINE_BREAK, # 0xb '\v' + _PY_CTF_LB.LINE_BREAK, # 0xc '\f' + _PY_CTF_LB.LINE_BREAK | _PY_CTF_LB.CARRIAGE_RETURN, # 0xd '\r' + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + _PY_CTF_LB.LINE_BREAK, # 0x1c '\x1c' + _PY_CTF_LB.LINE_BREAK, # 0x1d '\x1d' + _PY_CTF_LB.LINE_BREAK, # 0x1e '\x1e' + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + _PY_CTF_LB.LINE_BREAK, # 0x85 '\x85' + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, +], dtype=np.intc) + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pymacro.h#L25 # noqa: E501 +@register_jitable +def _Py_CHARMASK(ch): + """ + Equivalent to the CPython macro `Py_CHARMASK()`, masks off all but the + lowest 256 bits of ch. + """ + return types.uint8(ch) & types.uint8(0xff) + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L30 # noqa: E501 +@register_jitable +def _Py_TOUPPER(ch): + """ + Equivalent to the CPython macro `Py_TOUPPER()` converts an ASCII range + code point to the upper equivalent + """ + return _Py_ctype_toupper[_Py_CHARMASK(ch)] + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L29 # noqa: E501 +@register_jitable +def _Py_TOLOWER(ch): + """ + Equivalent to the CPython macro `Py_TOLOWER()` converts an ASCII range + code point to the lower equivalent + """ + return _Py_ctype_tolower[_Py_CHARMASK(ch)] + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L18 # noqa: E501 +@register_jitable +def _Py_ISLOWER(ch): + """ + Equivalent to the CPython macro `Py_ISLOWER()` + """ + return _Py_ctype_table[_Py_CHARMASK(ch)] & _PY_CTF.LOWER + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L19 # noqa: E501 +@register_jitable +def _Py_ISUPPER(ch): + """ + Equivalent to the CPython macro `Py_ISUPPER()` + """ + return _Py_ctype_table[_Py_CHARMASK(ch)] & _PY_CTF.UPPER + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L20 # noqa: E501 +@register_jitable +def _Py_ISALPHA(ch): + """ + Equivalent to the CPython macro `Py_ISALPHA()` + """ + return _Py_ctype_table[_Py_CHARMASK(ch)] & _PY_CTF.ALPHA + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L21 # noqa: E501 +@register_jitable +def _Py_ISDIGIT(ch): + """ + Equivalent to the CPython macro `Py_ISDIGIT()` + """ + return _Py_ctype_table[_Py_CHARMASK(ch)] & _PY_CTF.DIGIT + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L22 # noqa: E501 +@register_jitable +def _Py_ISXDIGIT(ch): + """ + Equivalent to the CPython macro `Py_ISXDIGIT()` + """ + return _Py_ctype_table[_Py_CHARMASK(ch)] & _PY_CTF.XDIGIT + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L23 # noqa: E501 +@register_jitable +def _Py_ISALNUM(ch): + """ + Equivalent to the CPython macro `Py_ISALNUM()` + """ + return _Py_ctype_table[_Py_CHARMASK(ch)] & _PY_CTF.ALNUM + + +# Translation of: +# https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Include/pyctype.h#L24 # noqa: E501 +@register_jitable +def _Py_ISSPACE(ch): + """ + Equivalent to the CPython macro `Py_ISSPACE()` + """ + return _Py_ctype_table[_Py_CHARMASK(ch)] & _PY_CTF.SPACE + + +@register_jitable +def _Py_ISLINEBREAK(ch): + """Check if character is ASCII line break""" + return _Py_ctype_islinebreak[_Py_CHARMASK(ch)] & _PY_CTF_LB.LINE_BREAK + + +@register_jitable +def _Py_ISLINEFEED(ch): + """Check if character is line feed `\n`""" + return _Py_ctype_islinebreak[_Py_CHARMASK(ch)] & _PY_CTF_LB.LINE_FEED + + +@register_jitable +def _Py_ISCARRIAGERETURN(ch): + """Check if character is carriage return `\r`""" + return _Py_ctype_islinebreak[_Py_CHARMASK(ch)] & _PY_CTF_LB.CARRIAGE_RETURN + + +# End code related to/from CPython's pyctype +# ------------------------------------------------------------------------------ diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4a30c316c4a524b3a41a080dd7e82fe597e6f130 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/__init__.py @@ -0,0 +1,22 @@ +from numba import runtests +from numba.core import config + +if config.ENABLE_CUDASIM: + from .simulator_init import * +else: + from .device_init import * + from .device_init import _auto_device + +from numba.cuda.compiler import (compile, compile_for_current_device, + compile_ptx, compile_ptx_for_current_device) + +# Are we the numba.cuda built in to upstream Numba, or the out-of-tree +# NVIDIA-maintained target? +implementation = "Built-in" + + +def test(*args, **kwargs): + if not is_available(): + raise cuda_error() + + return runtests.main("numba.cuda.tests", *args, **kwargs) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/api.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/api.py new file mode 100644 index 0000000000000000000000000000000000000000..43847496fa17e618fbdbf4e9478360e008f88ab5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/api.py @@ -0,0 +1,525 @@ +""" +API that are reported to numba.cuda +""" + + +import contextlib +import os + +import numpy as np + +from .cudadrv import devicearray, devices, driver +from numba.core import config +from numba.cuda.api_util import prepare_shape_strides_dtype + +# NDarray device helper + +require_context = devices.require_context +current_context = devices.get_context +gpus = devices.gpus + + +@require_context +def from_cuda_array_interface(desc, owner=None, sync=True): + """Create a DeviceNDArray from a cuda-array-interface description. + The ``owner`` is the owner of the underlying memory. + The resulting DeviceNDArray will acquire a reference from it. + + If ``sync`` is ``True``, then the imported stream (if present) will be + synchronized. + """ + version = desc.get('version') + # Mask introduced in version 1 + if 1 <= version: + mask = desc.get('mask') + # Would ideally be better to detect if the mask is all valid + if mask is not None: + raise NotImplementedError('Masked arrays are not supported') + + shape = desc['shape'] + strides = desc.get('strides') + dtype = np.dtype(desc['typestr']) + + shape, strides, dtype = prepare_shape_strides_dtype( + shape, strides, dtype, order='C') + size = driver.memory_size_from_info(shape, strides, dtype.itemsize) + + devptr = driver.get_devptr_for_active_ctx(desc['data'][0]) + data = driver.MemoryPointer( + current_context(), devptr, size=size, owner=owner) + stream_ptr = desc.get('stream', None) + if stream_ptr is not None: + stream = external_stream(stream_ptr) + if sync and config.CUDA_ARRAY_INTERFACE_SYNC: + stream.synchronize() + else: + stream = 0 # No "Numba default stream", not the CUDA default stream + da = devicearray.DeviceNDArray(shape=shape, strides=strides, + dtype=dtype, gpu_data=data, + stream=stream) + return da + + +def as_cuda_array(obj, sync=True): + """Create a DeviceNDArray from any object that implements + the :ref:`cuda array interface `. + + A view of the underlying GPU buffer is created. No copying of the data + is done. The resulting DeviceNDArray will acquire a reference from `obj`. + + If ``sync`` is ``True``, then the imported stream (if present) will be + synchronized. + """ + if not is_cuda_array(obj): + raise TypeError("*obj* doesn't implement the cuda array interface.") + else: + return from_cuda_array_interface(obj.__cuda_array_interface__, + owner=obj, sync=sync) + + +def is_cuda_array(obj): + """Test if the object has defined the `__cuda_array_interface__` attribute. + + Does not verify the validity of the interface. + """ + return hasattr(obj, '__cuda_array_interface__') + + +def is_float16_supported(): + """Whether 16-bit floats are supported. + + float16 is always supported in current versions of Numba - returns True. + """ + return True + + +@require_context +def to_device(obj, stream=0, copy=True, to=None): + """to_device(obj, stream=0, copy=True, to=None) + + Allocate and transfer a numpy ndarray or structured scalar to the device. + + To copy host->device a numpy array:: + + ary = np.arange(10) + d_ary = cuda.to_device(ary) + + To enqueue the transfer to a stream:: + + stream = cuda.stream() + d_ary = cuda.to_device(ary, stream=stream) + + The resulting ``d_ary`` is a ``DeviceNDArray``. + + To copy device->host:: + + hary = d_ary.copy_to_host() + + To copy device->host to an existing array:: + + ary = np.empty(shape=d_ary.shape, dtype=d_ary.dtype) + d_ary.copy_to_host(ary) + + To enqueue the transfer to a stream:: + + hary = d_ary.copy_to_host(stream=stream) + """ + if to is None: + to, new = devicearray.auto_device(obj, stream=stream, copy=copy, + user_explicit=True) + return to + if copy: + to.copy_to_device(obj, stream=stream) + return to + + +@require_context +def device_array(shape, dtype=np.float64, strides=None, order='C', stream=0): + """device_array(shape, dtype=np.float64, strides=None, order='C', stream=0) + + Allocate an empty device ndarray. Similar to :meth:`numpy.empty`. + """ + shape, strides, dtype = prepare_shape_strides_dtype(shape, strides, dtype, + order) + return devicearray.DeviceNDArray(shape=shape, strides=strides, dtype=dtype, + stream=stream) + + +@require_context +def managed_array(shape, dtype=np.float64, strides=None, order='C', stream=0, + attach_global=True): + """managed_array(shape, dtype=np.float64, strides=None, order='C', stream=0, + attach_global=True) + + Allocate a np.ndarray with a buffer that is managed. + Similar to np.empty(). + + Managed memory is supported on Linux / x86 and PowerPC, and is considered + experimental on Windows and Linux / AArch64. + + :param attach_global: A flag indicating whether to attach globally. Global + attachment implies that the memory is accessible from + any stream on any device. If ``False``, attachment is + *host*, and memory is only accessible by devices + with Compute Capability 6.0 and later. + """ + shape, strides, dtype = prepare_shape_strides_dtype(shape, strides, dtype, + order) + bytesize = driver.memory_size_from_info(shape, strides, dtype.itemsize) + buffer = current_context().memallocmanaged(bytesize, + attach_global=attach_global) + npary = np.ndarray(shape=shape, strides=strides, dtype=dtype, order=order, + buffer=buffer) + managedview = np.ndarray.view(npary, type=devicearray.ManagedNDArray) + managedview.device_setup(buffer, stream=stream) + return managedview + + +@require_context +def pinned_array(shape, dtype=np.float64, strides=None, order='C'): + """pinned_array(shape, dtype=np.float64, strides=None, order='C') + + Allocate an :class:`ndarray ` with a buffer that is pinned + (pagelocked). Similar to :func:`np.empty() `. + """ + shape, strides, dtype = prepare_shape_strides_dtype(shape, strides, dtype, + order) + bytesize = driver.memory_size_from_info(shape, strides, + dtype.itemsize) + buffer = current_context().memhostalloc(bytesize) + return np.ndarray(shape=shape, strides=strides, dtype=dtype, order=order, + buffer=buffer) + + +@require_context +def mapped_array(shape, dtype=np.float64, strides=None, order='C', stream=0, + portable=False, wc=False): + """mapped_array(shape, dtype=np.float64, strides=None, order='C', stream=0, + portable=False, wc=False) + + Allocate a mapped ndarray with a buffer that is pinned and mapped on + to the device. Similar to np.empty() + + :param portable: a boolean flag to allow the allocated device memory to be + usable in multiple devices. + :param wc: a boolean flag to enable writecombined allocation which is faster + to write by the host and to read by the device, but slower to + write by the host and slower to write by the device. + """ + shape, strides, dtype = prepare_shape_strides_dtype(shape, strides, dtype, + order) + bytesize = driver.memory_size_from_info(shape, strides, dtype.itemsize) + buffer = current_context().memhostalloc(bytesize, mapped=True) + npary = np.ndarray(shape=shape, strides=strides, dtype=dtype, order=order, + buffer=buffer) + mappedview = np.ndarray.view(npary, type=devicearray.MappedNDArray) + mappedview.device_setup(buffer, stream=stream) + return mappedview + + +@contextlib.contextmanager +@require_context +def open_ipc_array(handle, shape, dtype, strides=None, offset=0): + """ + A context manager that opens a IPC *handle* (*CUipcMemHandle*) that is + represented as a sequence of bytes (e.g. *bytes*, tuple of int) + and represent it as an array of the given *shape*, *strides* and *dtype*. + The *strides* can be omitted. In that case, it is assumed to be a 1D + C contiguous array. + + Yields a device array. + + The IPC handle is closed automatically when context manager exits. + """ + dtype = np.dtype(dtype) + # compute size + size = np.prod(shape) * dtype.itemsize + # manually recreate the IPC mem handle + if driver.USE_NV_BINDING: + driver_handle = driver.binding.CUipcMemHandle() + driver_handle.reserved = handle + else: + driver_handle = driver.drvapi.cu_ipc_mem_handle(*handle) + # use *IpcHandle* to open the IPC memory + ipchandle = driver.IpcHandle(None, driver_handle, size, offset=offset) + yield ipchandle.open_array(current_context(), shape=shape, + strides=strides, dtype=dtype) + ipchandle.close() + + +def synchronize(): + "Synchronize the current context." + return current_context().synchronize() + + +def _contiguous_strides_like_array(ary): + """ + Given an array, compute strides for a new contiguous array of the same + shape. + """ + # Don't recompute strides if the default strides will be sufficient to + # create a contiguous array. + if ary.flags['C_CONTIGUOUS'] or ary.flags['F_CONTIGUOUS'] or ary.ndim <= 1: + return None + + # Otherwise, we need to compute new strides using an algorithm adapted from + # NumPy v1.17.4's PyArray_NewLikeArrayWithShape in + # core/src/multiarray/ctors.c. We permute the strides in ascending order + # then compute the stride for the dimensions with the same permutation. + + # Stride permutation. E.g. a stride array (4, -2, 12) becomes + # [(1, -2), (0, 4), (2, 12)] + strideperm = [ x for x in enumerate(ary.strides) ] + strideperm.sort(key=lambda x: x[1]) + + # Compute new strides using permutation + strides = [0] * len(ary.strides) + stride = ary.dtype.itemsize + for i_perm, _ in strideperm: + strides[i_perm] = stride + stride *= ary.shape[i_perm] + return tuple(strides) + + +def _order_like_array(ary): + if ary.flags['F_CONTIGUOUS'] and not ary.flags['C_CONTIGUOUS']: + return 'F' + else: + return 'C' + + +def device_array_like(ary, stream=0): + """ + Call :func:`device_array() ` with information from + the array. + """ + strides = _contiguous_strides_like_array(ary) + order = _order_like_array(ary) + return device_array(shape=ary.shape, dtype=ary.dtype, strides=strides, + order=order, stream=stream) + + +def mapped_array_like(ary, stream=0, portable=False, wc=False): + """ + Call :func:`mapped_array() ` with the information + from the array. + """ + strides = _contiguous_strides_like_array(ary) + order = _order_like_array(ary) + return mapped_array(shape=ary.shape, dtype=ary.dtype, strides=strides, + order=order, stream=stream, portable=portable, wc=wc) + + +def pinned_array_like(ary): + """ + Call :func:`pinned_array() ` with the information + from the array. + """ + strides = _contiguous_strides_like_array(ary) + order = _order_like_array(ary) + return pinned_array(shape=ary.shape, dtype=ary.dtype, strides=strides, + order=order) + + +# Stream helper +@require_context +def stream(): + """ + Create a CUDA stream that represents a command queue for the device. + """ + return current_context().create_stream() + + +@require_context +def default_stream(): + """ + Get the default CUDA stream. CUDA semantics in general are that the default + stream is either the legacy default stream or the per-thread default stream + depending on which CUDA APIs are in use. In Numba, the APIs for the legacy + default stream are always the ones in use, but an option to use APIs for + the per-thread default stream may be provided in future. + """ + return current_context().get_default_stream() + + +@require_context +def legacy_default_stream(): + """ + Get the legacy default CUDA stream. + """ + return current_context().get_legacy_default_stream() + + +@require_context +def per_thread_default_stream(): + """ + Get the per-thread default CUDA stream. + """ + return current_context().get_per_thread_default_stream() + + +@require_context +def external_stream(ptr): + """Create a Numba stream object for a stream allocated outside Numba. + + :param ptr: Pointer to the external stream to wrap in a Numba Stream + :type ptr: int + """ + return current_context().create_external_stream(ptr) + + +# Page lock +@require_context +@contextlib.contextmanager +def pinned(*arylist): + """A context manager for temporary pinning a sequence of host ndarrays. + """ + pmlist = [] + for ary in arylist: + pm = current_context().mempin(ary, driver.host_pointer(ary), + driver.host_memory_size(ary), + mapped=False) + pmlist.append(pm) + yield + + +@require_context +@contextlib.contextmanager +def mapped(*arylist, **kws): + """A context manager for temporarily mapping a sequence of host ndarrays. + """ + assert not kws or 'stream' in kws, "Only accept 'stream' as keyword." + stream = kws.get('stream', 0) + pmlist = [] + devarylist = [] + for ary in arylist: + pm = current_context().mempin(ary, driver.host_pointer(ary), + driver.host_memory_size(ary), + mapped=True) + pmlist.append(pm) + devary = devicearray.from_array_like(ary, gpu_data=pm, stream=stream) + devarylist.append(devary) + try: + if len(devarylist) == 1: + yield devarylist[0] + else: + yield devarylist + finally: + # When exiting from `with cuda.mapped(*arrs) as mapped_arrs:`, the name + # `mapped_arrs` stays in scope, blocking automatic unmapping based on + # reference count. We therefore invoke the finalizer manually. + for pm in pmlist: + pm.free() + + +def event(timing=True): + """ + Create a CUDA event. Timing data is only recorded by the event if it is + created with ``timing=True``. + """ + evt = current_context().create_event(timing=timing) + return evt + + +event_elapsed_time = driver.event_elapsed_time + + +# Device selection + +def select_device(device_id): + """ + Make the context associated with device *device_id* the current context. + + Returns a Device instance. + + Raises exception on error. + """ + context = devices.get_context(device_id) + return context.device + + +def get_current_device(): + "Get current device associated with the current thread" + return current_context().device + + +def list_devices(): + "Return a list of all detected devices" + return devices.gpus + + +def close(): + """ + Explicitly clears all contexts in the current thread, and destroys all + contexts if the current thread is the main thread. + """ + devices.reset() + + +def _auto_device(ary, stream=0, copy=True): + return devicearray.auto_device(ary, stream=stream, copy=copy) + + +def detect(): + """ + Detect supported CUDA hardware and print a summary of the detected hardware. + + Returns a boolean indicating whether any supported devices were detected. + """ + devlist = list_devices() + print('Found %d CUDA devices' % len(devlist)) + supported_count = 0 + for dev in devlist: + attrs = [] + cc = dev.compute_capability + kernel_timeout = dev.KERNEL_EXEC_TIMEOUT + tcc = dev.TCC_DRIVER + fp32_to_fp64_ratio = dev.SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO + attrs += [('Compute Capability', '%d.%d' % cc)] + attrs += [('PCI Device ID', dev.PCI_DEVICE_ID)] + attrs += [('PCI Bus ID', dev.PCI_BUS_ID)] + attrs += [('UUID', dev.uuid)] + attrs += [('Watchdog', 'Enabled' if kernel_timeout else 'Disabled')] + if os.name == "nt": + attrs += [('Compute Mode', 'TCC' if tcc else 'WDDM')] + attrs += [('FP32/FP64 Performance Ratio', fp32_to_fp64_ratio)] + if cc < (3, 5): + support = '[NOT SUPPORTED: CC < 3.5]' + elif cc < (5, 0): + support = '[SUPPORTED (DEPRECATED)]' + supported_count += 1 + else: + support = '[SUPPORTED]' + supported_count += 1 + + print('id %d %20s %40s' % (dev.id, dev.name, support)) + for key, val in attrs: + print('%40s: %s' % (key, val)) + + print('Summary:') + print('\t%d/%d devices are supported' % (supported_count, len(devlist))) + return supported_count > 0 + + +@contextlib.contextmanager +def defer_cleanup(): + """ + Temporarily disable memory deallocation. + Use this to prevent resource deallocation breaking asynchronous execution. + + For example:: + + with defer_cleanup(): + # all cleanup is deferred in here + do_speed_critical_code() + # cleanup can occur here + + Note: this context manager can be nested. + """ + with current_context().defer_cleanup(): + yield + + +profiling = require_context(driver.profiling) +profile_start = require_context(driver.profile_start) +profile_stop = require_context(driver.profile_stop) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/api_util.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/api_util.py new file mode 100644 index 0000000000000000000000000000000000000000..b8bffb7c108bde4335793599434bf1465360758f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/api_util.py @@ -0,0 +1,30 @@ +import numpy as np + + +def prepare_shape_strides_dtype(shape, strides, dtype, order): + dtype = np.dtype(dtype) + if isinstance(shape, int): + shape = (shape,) + if isinstance(strides, int): + strides = (strides,) + else: + strides = strides or _fill_stride_by_order(shape, dtype, order) + return shape, strides, dtype + + +def _fill_stride_by_order(shape, dtype, order): + nd = len(shape) + if nd == 0: + return () + strides = [0] * nd + if order == 'C': + strides[-1] = dtype.itemsize + for d in reversed(range(nd - 1)): + strides[d] = strides[d + 1] * shape[d + 1] + elif order == 'F': + strides[0] = dtype.itemsize + for d in range(1, nd): + strides[d] = strides[d - 1] * shape[d - 1] + else: + raise ValueError('must be either C/F order') + return tuple(strides) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/args.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/args.py new file mode 100644 index 0000000000000000000000000000000000000000..472bd0b873f46d0bbe8b091e7dc35ffa7ed6d077 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/args.py @@ -0,0 +1,77 @@ +""" +Hints to wrap Kernel arguments to indicate how to manage host-device +memory transfers before & after the kernel call. +""" +import abc + +from numba.core.typing.typeof import typeof, Purpose + + +class ArgHint(metaclass=abc.ABCMeta): + def __init__(self, value): + self.value = value + + @abc.abstractmethod + def to_device(self, retr, stream=0): + """ + :param stream: a stream to use when copying data + :param retr: + a list of clean-up work to do after the kernel's been run. + Append 0-arg lambdas to it! + :return: a value (usually an `DeviceNDArray`) to be passed to + the kernel + """ + pass + + @property + def _numba_type_(self): + return typeof(self.value, Purpose.argument) + + +class In(ArgHint): + def to_device(self, retr, stream=0): + from .cudadrv.devicearray import auto_device + devary, _ = auto_device( + self.value, + stream=stream) + # A dummy writeback functor to keep devary alive until the kernel + # is called. + retr.append(lambda: devary) + return devary + + +class Out(ArgHint): + def to_device(self, retr, stream=0): + from .cudadrv.devicearray import auto_device + devary, conv = auto_device( + self.value, + copy=False, + stream=stream) + if conv: + retr.append(lambda: devary.copy_to_host(self.value, stream=stream)) + return devary + + +class InOut(ArgHint): + def to_device(self, retr, stream=0): + from .cudadrv.devicearray import auto_device + devary, conv = auto_device( + self.value, + stream=stream) + if conv: + retr.append(lambda: devary.copy_to_host(self.value, stream=stream)) + return devary + + +def wrap_arg(value, default=InOut): + return value if isinstance(value, ArgHint) else default(value) + + +__all__ = [ + 'In', + 'Out', + 'InOut', + + 'ArgHint', + 'wrap_arg', +] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cg.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cg.py new file mode 100644 index 0000000000000000000000000000000000000000..00d55704befe578fcc529586bc8696ca9261c6db --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cg.py @@ -0,0 +1,62 @@ +from numba.core import types +from numba.core.extending import overload, overload_method +from numba.core.typing import signature +from numba.cuda import nvvmutils +from numba.cuda.extending import intrinsic +from numba.cuda.types import grid_group, GridGroup as GridGroupClass + + +class GridGroup: + """A cooperative group representing the entire grid""" + + def sync() -> None: + """Synchronize this grid group""" + + +def this_grid() -> GridGroup: + """Get the current grid group.""" + return GridGroup() + + +@intrinsic +def _this_grid(typingctx): + sig = signature(grid_group) + + def codegen(context, builder, sig, args): + one = context.get_constant(types.int32, 1) + mod = builder.module + return builder.call( + nvvmutils.declare_cudaCGGetIntrinsicHandle(mod), + (one,)) + + return sig, codegen + + +@overload(this_grid, target='cuda') +def _ol_this_grid(): + def impl(): + return _this_grid() + + return impl + + +@intrinsic +def _grid_group_sync(typingctx, group): + sig = signature(types.int32, group) + + def codegen(context, builder, sig, args): + flags = context.get_constant(types.int32, 0) + mod = builder.module + return builder.call( + nvvmutils.declare_cudaCGSynchronize(mod), + (*args, flags)) + + return sig, codegen + + +@overload_method(GridGroupClass, 'sync', target='cuda') +def _ol_grid_group_sync(group): + def impl(group): + return _grid_group_sync(group) + + return impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/codegen.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/codegen.py new file mode 100644 index 0000000000000000000000000000000000000000..6009dcbdcc7d3a7c5aaf51b106126fa8fbb6696b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/codegen.py @@ -0,0 +1,378 @@ +from llvmlite import ir + +from numba.core import config, serialize +from numba.core.codegen import Codegen, CodeLibrary +from .cudadrv import devices, driver, nvvm, runtime +from numba.cuda.cudadrv.libs import get_cudalib + +import os +import subprocess +import tempfile + + +CUDA_TRIPLE = 'nvptx64-nvidia-cuda' + + +def run_nvdisasm(cubin, flags): + # nvdisasm only accepts input from a file, so we need to write out to a + # temp file and clean up afterwards. + fd = None + fname = None + try: + fd, fname = tempfile.mkstemp() + with open(fname, 'wb') as f: + f.write(cubin) + + try: + cp = subprocess.run(['nvdisasm', *flags, fname], check=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + except FileNotFoundError as e: + msg = ("nvdisasm has not been found. You may need " + "to install the CUDA toolkit and ensure that " + "it is available on your PATH.\n") + raise RuntimeError(msg) from e + return cp.stdout.decode('utf-8') + finally: + if fd is not None: + os.close(fd) + if fname is not None: + os.unlink(fname) + + +def disassemble_cubin(cubin): + # Request lineinfo in disassembly + flags = ['-gi'] + return run_nvdisasm(cubin, flags) + + +def disassemble_cubin_for_cfg(cubin): + # Request control flow graph in disassembly + flags = ['-cfg'] + return run_nvdisasm(cubin, flags) + + +class CUDACodeLibrary(serialize.ReduceMixin, CodeLibrary): + """ + The CUDACodeLibrary generates PTX, SASS, cubins for multiple different + compute capabilities. It also loads cubins to multiple devices (via + get_cufunc), which may be of different compute capabilities. + """ + + def __init__(self, codegen, name, entry_name=None, max_registers=None, + nvvm_options=None): + """ + codegen: + Codegen object. + name: + Name of the function in the source. + entry_name: + Name of the kernel function in the binary, if this is a global + kernel and not a device function. + max_registers: + The maximum register usage to aim for when linking. + nvvm_options: + Dict of options to pass to NVVM. + """ + super().__init__(codegen, name) + + # The llvmlite module for this library. + self._module = None + # CodeLibrary objects that will be "linked" into this library. The + # modules within them are compiled from NVVM IR to PTX along with the + # IR from this module - in that sense they are "linked" by NVVM at PTX + # generation time, rather than at link time. + self._linking_libraries = set() + # Files to link with the generated PTX. These are linked using the + # Driver API at link time. + self._linking_files = set() + # Should we link libcudadevrt? + self.needs_cudadevrt = False + + # Cache the LLVM IR string + self._llvm_strs = None + # Maps CC -> PTX string + self._ptx_cache = {} + # Maps CC -> LTO-IR + self._ltoir_cache = {} + # Maps CC -> cubin + self._cubin_cache = {} + # Maps CC -> linker info output for cubin + self._linkerinfo_cache = {} + # Maps Device numeric ID -> cufunc + self._cufunc_cache = {} + + self._max_registers = max_registers + if nvvm_options is None: + nvvm_options = {} + self._nvvm_options = nvvm_options + self._entry_name = entry_name + + @property + def llvm_strs(self): + if self._llvm_strs is None: + self._llvm_strs = [str(mod) for mod in self.modules] + return self._llvm_strs + + def get_llvm_str(self): + return "\n\n".join(self.llvm_strs) + + def _ensure_cc(self, cc): + if cc is not None: + return cc + + device = devices.get_context().device + return device.compute_capability + + def get_asm_str(self, cc=None): + cc = self._ensure_cc(cc) + + ptxes = self._ptx_cache.get(cc, None) + if ptxes: + return ptxes + + arch = nvvm.get_arch_option(*cc) + options = self._nvvm_options.copy() + options['arch'] = arch + + irs = self.llvm_strs + + ptx = nvvm.compile_ir(irs, **options) + + # Sometimes the result from NVVM contains trailing whitespace and + # nulls, which we strip so that the assembly dump looks a little + # tidier. + ptx = ptx.decode().strip('\x00').strip() + + if config.DUMP_ASSEMBLY: + print(("ASSEMBLY %s" % self._name).center(80, '-')) + print(ptx) + print('=' * 80) + + self._ptx_cache[cc] = ptx + + return ptx + + def get_ltoir(self, cc=None): + cc = self._ensure_cc(cc) + + ltoir = self._ltoir_cache.get(cc, None) + if ltoir is not None: + return ltoir + + arch = nvvm.get_arch_option(*cc) + options = self._nvvm_options.copy() + options['arch'] = arch + options['gen-lto'] = None + + irs = self.llvm_strs + ltoir = nvvm.compile_ir(irs, **options) + self._ltoir_cache[cc] = ltoir + + return ltoir + + def get_cubin(self, cc=None): + cc = self._ensure_cc(cc) + + cubin = self._cubin_cache.get(cc, None) + if cubin: + return cubin + + linker = driver.Linker.new(max_registers=self._max_registers, cc=cc) + + if linker.lto: + ltoir = self.get_ltoir(cc=cc) + linker.add_ltoir(ltoir) + else: + ptx = self.get_asm_str(cc=cc) + linker.add_ptx(ptx.encode()) + + for path in self._linking_files: + linker.add_file_guess_ext(path) + if self.needs_cudadevrt: + linker.add_file_guess_ext(get_cudalib('cudadevrt', static=True)) + + cubin = linker.complete() + self._cubin_cache[cc] = cubin + self._linkerinfo_cache[cc] = linker.info_log + + return cubin + + def get_cufunc(self): + if self._entry_name is None: + msg = "Missing entry_name - are you trying to get the cufunc " \ + "for a device function?" + raise RuntimeError(msg) + + ctx = devices.get_context() + device = ctx.device + + cufunc = self._cufunc_cache.get(device.id, None) + if cufunc: + return cufunc + + cubin = self.get_cubin(cc=device.compute_capability) + module = ctx.create_module_image(cubin) + + # Load + cufunc = module.get_function(self._entry_name) + + # Populate caches + self._cufunc_cache[device.id] = cufunc + + return cufunc + + def get_linkerinfo(self, cc): + try: + return self._linkerinfo_cache[cc] + except KeyError: + raise KeyError(f'No linkerinfo for CC {cc}') + + def get_sass(self, cc=None): + return disassemble_cubin(self.get_cubin(cc=cc)) + + def get_sass_cfg(self, cc=None): + return disassemble_cubin_for_cfg(self.get_cubin(cc=cc)) + + def add_ir_module(self, mod): + self._raise_if_finalized() + if self._module is not None: + raise RuntimeError('CUDACodeLibrary only supports one module') + self._module = mod + + def add_linking_library(self, library): + library._ensure_finalized() + + # We don't want to allow linking more libraries in after finalization + # because our linked libraries are modified by the finalization, and we + # won't be able to finalize again after adding new ones + self._raise_if_finalized() + + self._linking_libraries.add(library) + + def add_linking_file(self, filepath): + self._linking_files.add(filepath) + + def get_function(self, name): + for fn in self._module.functions: + if fn.name == name: + return fn + raise KeyError(f'Function {name} not found') + + @property + def modules(self): + return [self._module] + [mod for lib in self._linking_libraries + for mod in lib.modules] + + @property + def linking_libraries(self): + # Libraries we link to may link to other libraries, so we recursively + # traverse the linking libraries property to build up a list of all + # linked libraries. + libs = [] + for lib in self._linking_libraries: + libs.extend(lib.linking_libraries) + libs.append(lib) + return libs + + def finalize(self): + # Unlike the CPUCodeLibrary, we don't invoke the binding layer here - + # we only adjust the linkage of functions. Global kernels (with + # external linkage) have their linkage untouched. Device functions are + # set linkonce_odr to prevent them appearing in the PTX. + + self._raise_if_finalized() + + # Note in-place modification of the linkage of functions in linked + # libraries. This presently causes no issues as only device functions + # are shared across code libraries, so they would always need their + # linkage set to linkonce_odr. If in a future scenario some code + # libraries require linkonce_odr linkage of functions in linked + # modules, and another code library requires another linkage, each code + # library will need to take its own private copy of its linked modules. + # + # See also discussion on PR #890: + # https://github.com/numba/numba/pull/890 + for library in self._linking_libraries: + for mod in library.modules: + for fn in mod.functions: + if not fn.is_declaration: + fn.linkage = 'linkonce_odr' + + self._finalized = True + + def _reduce_states(self): + """ + Reduce the instance for serialization. We retain the PTX and cubins, + but loaded functions are discarded. They are recreated when needed + after deserialization. + """ + if self._linking_files: + msg = 'Cannot pickle CUDACodeLibrary with linking files' + raise RuntimeError(msg) + if not self._finalized: + raise RuntimeError('Cannot pickle unfinalized CUDACodeLibrary') + return dict( + codegen=None, + name=self.name, + entry_name=self._entry_name, + llvm_strs=self.llvm_strs, + ptx_cache=self._ptx_cache, + cubin_cache=self._cubin_cache, + linkerinfo_cache=self._linkerinfo_cache, + max_registers=self._max_registers, + nvvm_options=self._nvvm_options, + needs_cudadevrt=self.needs_cudadevrt + ) + + @classmethod + def _rebuild(cls, codegen, name, entry_name, llvm_strs, ptx_cache, + cubin_cache, linkerinfo_cache, max_registers, nvvm_options, + needs_cudadevrt): + """ + Rebuild an instance. + """ + instance = cls(codegen, name, entry_name=entry_name) + + instance._llvm_strs = llvm_strs + instance._ptx_cache = ptx_cache + instance._cubin_cache = cubin_cache + instance._linkerinfo_cache = linkerinfo_cache + + instance._max_registers = max_registers + instance._nvvm_options = nvvm_options + instance.needs_cudadevrt = needs_cudadevrt + + instance._finalized = True + + return instance + + +class JITCUDACodegen(Codegen): + """ + This codegen implementation for CUDA only generates optimized LLVM IR. + Generation of PTX code is done separately (see numba.cuda.compiler). + """ + + _library_class = CUDACodeLibrary + + def __init__(self, module_name): + pass + + def _create_empty_module(self, name): + ir_module = ir.Module(name) + ir_module.triple = CUDA_TRIPLE + ir_module.data_layout = nvvm.NVVM().data_layout + nvvm.add_ir_version(ir_module) + return ir_module + + def _add_module(self, module): + pass + + def magic_tuple(self): + """ + Return a tuple unambiguously describing the codegen behaviour. + """ + ctx = devices.get_context() + cc = ctx.device.compute_capability + return (runtime.runtime.get_version(), cc) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/compiler.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/compiler.py new file mode 100644 index 0000000000000000000000000000000000000000..e2bcb08919eddff275b89e03a19fee4b817fe0e2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/compiler.py @@ -0,0 +1,422 @@ +from llvmlite import ir +from numba.core.typing.templates import ConcreteTemplate +from numba.core import types, typing, funcdesc, config, compiler, sigutils +from numba.core.compiler import (sanitize_compile_result_entries, CompilerBase, + DefaultPassBuilder, Flags, Option, + CompileResult) +from numba.core.compiler_lock import global_compiler_lock +from numba.core.compiler_machinery import (LoweringPass, + PassManager, register_pass) +from numba.core.errors import NumbaInvalidConfigWarning +from numba.core.typed_passes import (IRLegalization, NativeLowering, + AnnotateTypes) +from warnings import warn +from numba.cuda.api import get_current_device +from numba.cuda.target import CUDACABICallConv + + +def _nvvm_options_type(x): + if x is None: + return None + + else: + assert isinstance(x, dict) + return x + + +class CUDAFlags(Flags): + nvvm_options = Option( + type=_nvvm_options_type, + default=None, + doc="NVVM options", + ) + compute_capability = Option( + type=tuple, + default=None, + doc="Compute Capability", + ) + + +# The CUDACompileResult (CCR) has a specially-defined entry point equal to its +# id. This is because the entry point is used as a key into a dict of +# overloads by the base dispatcher. The id of the CCR is the only small and +# unique property of a CompileResult in the CUDA target (cf. the CPU target, +# which uses its entry_point, which is a pointer value). +# +# This does feel a little hackish, and there are two ways in which this could +# be improved: +# +# 1. We could change the core of Numba so that each CompileResult has its own +# unique ID that can be used as a key - e.g. a count, similar to the way in +# which types have unique counts. +# 2. At some future time when kernel launch uses a compiled function, the entry +# point will no longer need to be a synthetic value, but will instead be a +# pointer to the compiled function as in the CPU target. + +class CUDACompileResult(CompileResult): + @property + def entry_point(self): + return id(self) + + +def cuda_compile_result(**entries): + entries = sanitize_compile_result_entries(entries) + return CUDACompileResult(**entries) + + +@register_pass(mutates_CFG=True, analysis_only=False) +class CUDABackend(LoweringPass): + + _name = "cuda_backend" + + def __init__(self): + LoweringPass.__init__(self) + + def run_pass(self, state): + """ + Back-end: Packages lowering output in a compile result + """ + lowered = state['cr'] + signature = typing.signature(state.return_type, *state.args) + + state.cr = cuda_compile_result( + typing_context=state.typingctx, + target_context=state.targetctx, + typing_error=state.status.fail_reason, + type_annotation=state.type_annotation, + library=state.library, + call_helper=lowered.call_helper, + signature=signature, + fndesc=lowered.fndesc, + ) + return True + + +@register_pass(mutates_CFG=False, analysis_only=False) +class CreateLibrary(LoweringPass): + """ + Create a CUDACodeLibrary for the NativeLowering pass to populate. The + NativeLowering pass will create a code library if none exists, but we need + to set it up with nvvm_options from the flags if they are present. + """ + + _name = "create_library" + + def __init__(self): + LoweringPass.__init__(self) + + def run_pass(self, state): + codegen = state.targetctx.codegen() + name = state.func_id.func_qualname + nvvm_options = state.flags.nvvm_options + state.library = codegen.create_library(name, nvvm_options=nvvm_options) + # Enable object caching upfront so that the library can be serialized. + state.library.enable_object_caching() + + return True + + +class CUDACompiler(CompilerBase): + def define_pipelines(self): + dpb = DefaultPassBuilder + pm = PassManager('cuda') + + untyped_passes = dpb.define_untyped_pipeline(self.state) + pm.passes.extend(untyped_passes.passes) + + typed_passes = dpb.define_typed_pipeline(self.state) + pm.passes.extend(typed_passes.passes) + + lowering_passes = self.define_cuda_lowering_pipeline(self.state) + pm.passes.extend(lowering_passes.passes) + + pm.finalize() + return [pm] + + def define_cuda_lowering_pipeline(self, state): + pm = PassManager('cuda_lowering') + # legalise + pm.add_pass(IRLegalization, + "ensure IR is legal prior to lowering") + pm.add_pass(AnnotateTypes, "annotate types") + + # lower + pm.add_pass(CreateLibrary, "create library") + pm.add_pass(NativeLowering, "native lowering") + pm.add_pass(CUDABackend, "cuda backend") + + pm.finalize() + return pm + + +@global_compiler_lock +def compile_cuda(pyfunc, return_type, args, debug=False, lineinfo=False, + inline=False, fastmath=False, nvvm_options=None, + cc=None): + if cc is None: + raise ValueError('Compute Capability must be supplied') + + from .descriptor import cuda_target + typingctx = cuda_target.typing_context + targetctx = cuda_target.target_context + + flags = CUDAFlags() + # Do not compile (generate native code), just lower (to LLVM) + flags.no_compile = True + flags.no_cpython_wrapper = True + flags.no_cfunc_wrapper = True + + # Both debug and lineinfo turn on debug information in the compiled code, + # but we keep them separate arguments in case we later want to overload + # some other behavior on the debug flag. In particular, -opt=3 is not + # supported with debug enabled, and enabling only lineinfo should not + # affect the error model. + if debug or lineinfo: + flags.debuginfo = True + + if lineinfo: + flags.dbg_directives_only = True + + if debug: + flags.error_model = 'python' + else: + flags.error_model = 'numpy' + + if inline: + flags.forceinline = True + if fastmath: + flags.fastmath = True + if nvvm_options: + flags.nvvm_options = nvvm_options + flags.compute_capability = cc + + # Run compilation pipeline + from numba.core.target_extension import target_override + with target_override('cuda'): + cres = compiler.compile_extra(typingctx=typingctx, + targetctx=targetctx, + func=pyfunc, + args=args, + return_type=return_type, + flags=flags, + locals={}, + pipeline_class=CUDACompiler) + + library = cres.library + library.finalize() + + return cres + + +def cabi_wrap_function(context, lib, fndesc, wrapper_function_name, + nvvm_options): + """ + Wrap a Numba ABI function in a C ABI wrapper at the NVVM IR level. + + The C ABI wrapper will have the same name as the source Python function. + """ + # The wrapper will be contained in a new library that links to the wrapped + # function's library + library = lib.codegen.create_library(f'{lib.name}_function_', + entry_name=wrapper_function_name, + nvvm_options=nvvm_options) + library.add_linking_library(lib) + + # Determine the caller (C ABI) and wrapper (Numba ABI) function types + argtypes = fndesc.argtypes + restype = fndesc.restype + c_call_conv = CUDACABICallConv(context) + wrapfnty = c_call_conv.get_function_type(restype, argtypes) + fnty = context.call_conv.get_function_type(fndesc.restype, argtypes) + + # Create a new module and declare the callee + wrapper_module = context.create_module("cuda.cabi.wrapper") + func = ir.Function(wrapper_module, fnty, fndesc.llvm_func_name) + + # Define the caller - populate it with a call to the callee and return + # its return value + + wrapfn = ir.Function(wrapper_module, wrapfnty, wrapper_function_name) + builder = ir.IRBuilder(wrapfn.append_basic_block('')) + + arginfo = context.get_arg_packer(argtypes) + callargs = arginfo.from_arguments(builder, wrapfn.args) + # We get (status, return_value), but we ignore the status since we + # can't propagate it through the C ABI anyway + _, return_value = context.call_conv.call_function( + builder, func, restype, argtypes, callargs) + builder.ret(return_value) + + library.add_ir_module(wrapper_module) + library.finalize() + return library + + +@global_compiler_lock +def compile(pyfunc, sig, debug=False, lineinfo=False, device=True, + fastmath=False, cc=None, opt=True, abi="c", abi_info=None, + output='ptx'): + """Compile a Python function to PTX or LTO-IR for a given set of argument + types. + + :param pyfunc: The Python function to compile. + :param sig: The signature representing the function's input and output + types. If this is a tuple of argument types without a return + type, the inferred return type is returned by this function. If + a signature including a return type is passed, the compiled code + will include a cast from the inferred return type to the + specified return type, and this function will return the + specified return type. + :param debug: Whether to include debug info in the compiled code. + :type debug: bool + :param lineinfo: Whether to include a line mapping from the compiled code + to the source code. Usually this is used with optimized + code (since debug mode would automatically include this), + so we want debug info in the LLVM IR but only the line + mapping in the final output. + :type lineinfo: bool + :param device: Whether to compile a device function. + :type device: bool + :param fastmath: Whether to enable fast math flags (ftz=1, prec_sqrt=0, + prec_div=, and fma=1) + :type fastmath: bool + :param cc: Compute capability to compile for, as a tuple + ``(MAJOR, MINOR)``. Defaults to ``(5, 0)``. + :type cc: tuple + :param opt: Enable optimizations. Defaults to ``True``. + :type opt: bool + :param abi: The ABI for a compiled function - either ``"numba"`` or + ``"c"``. Note that the Numba ABI is not considered stable. + The C ABI is only supported for device functions at present. + :type abi: str + :param abi_info: A dict of ABI-specific options. The ``"c"`` ABI supports + one option, ``"abi_name"``, for providing the wrapper + function's name. The ``"numba"`` ABI has no options. + :type abi_info: dict + :param output: Type of output to generate, either ``"ptx"`` or ``"ltoir"``. + :type output: str + :return: (code, resty): The compiled code and inferred return type + :rtype: tuple + """ + if abi not in ("numba", "c"): + raise NotImplementedError(f'Unsupported ABI: {abi}') + + if abi == 'c' and not device: + raise NotImplementedError('The C ABI is not supported for kernels') + + if output not in ("ptx", "ltoir"): + raise NotImplementedError(f'Unsupported output type: {output}') + + if debug and opt: + msg = ("debug=True with opt=True (the default) " + "is not supported by CUDA. This may result in a crash" + " - set debug=False or opt=False.") + warn(NumbaInvalidConfigWarning(msg)) + + lto = (output == 'ltoir') + abi_info = abi_info or dict() + + nvvm_options = { + 'fastmath': fastmath, + 'opt': 3 if opt else 0 + } + + if lto: + nvvm_options['gen-lto'] = None + + args, return_type = sigutils.normalize_signature(sig) + + cc = cc or config.CUDA_DEFAULT_PTX_CC + cres = compile_cuda(pyfunc, return_type, args, debug=debug, + lineinfo=lineinfo, fastmath=fastmath, + nvvm_options=nvvm_options, cc=cc) + resty = cres.signature.return_type + + if resty and not device and resty != types.void: + raise TypeError("CUDA kernel must have void return type.") + + tgt = cres.target_context + + if device: + lib = cres.library + if abi == "c": + wrapper_name = abi_info.get('abi_name', pyfunc.__name__) + lib = cabi_wrap_function(tgt, lib, cres.fndesc, wrapper_name, + nvvm_options) + else: + code = pyfunc.__code__ + filename = code.co_filename + linenum = code.co_firstlineno + + lib, kernel = tgt.prepare_cuda_kernel(cres.library, cres.fndesc, debug, + lineinfo, nvvm_options, filename, + linenum) + + if lto: + code = lib.get_ltoir(cc=cc) + else: + code = lib.get_asm_str(cc=cc) + return code, resty + + +def compile_for_current_device(pyfunc, sig, debug=False, lineinfo=False, + device=True, fastmath=False, opt=True, + abi="c", abi_info=None, output='ptx'): + """Compile a Python function to PTX or LTO-IR for a given signature for the + current device's compute capabilility. This calls :func:`compile` with an + appropriate ``cc`` value for the current device.""" + cc = get_current_device().compute_capability + return compile(pyfunc, sig, debug=debug, lineinfo=lineinfo, device=device, + fastmath=fastmath, cc=cc, opt=opt, abi=abi, + abi_info=abi_info, output=output) + + +def compile_ptx(pyfunc, sig, debug=False, lineinfo=False, device=False, + fastmath=False, cc=None, opt=True, abi="numba", abi_info=None): + """Compile a Python function to PTX for a given signature. See + :func:`compile`. The defaults for this function are to compile a kernel + with the Numba ABI, rather than :func:`compile`'s default of compiling a + device function with the C ABI.""" + return compile(pyfunc, sig, debug=debug, lineinfo=lineinfo, device=device, + fastmath=fastmath, cc=cc, opt=opt, abi=abi, + abi_info=abi_info, output='ptx') + + +def compile_ptx_for_current_device(pyfunc, sig, debug=False, lineinfo=False, + device=False, fastmath=False, opt=True, + abi="numba", abi_info=None): + """Compile a Python function to PTX for a given signature for the current + device's compute capabilility. See :func:`compile_ptx`.""" + cc = get_current_device().compute_capability + return compile_ptx(pyfunc, sig, debug=debug, lineinfo=lineinfo, + device=device, fastmath=fastmath, cc=cc, opt=opt, + abi=abi, abi_info=abi_info) + + +def declare_device_function(name, restype, argtypes): + return declare_device_function_template(name, restype, argtypes).key + + +def declare_device_function_template(name, restype, argtypes): + from .descriptor import cuda_target + typingctx = cuda_target.typing_context + targetctx = cuda_target.target_context + sig = typing.signature(restype, *argtypes) + extfn = ExternFunction(name, sig) + + class device_function_template(ConcreteTemplate): + key = extfn + cases = [sig] + + fndesc = funcdesc.ExternalFunctionDescriptor( + name=name, restype=restype, argtypes=argtypes) + typingctx.insert_user_function(extfn, device_function_template) + targetctx.insert_user_function(extfn, fndesc) + + return device_function_template + + +class ExternFunction(object): + def __init__(self, name, sig): + self.name = name + self.sig = sig diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cpp_function_wrappers.cu b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cpp_function_wrappers.cu new file mode 100644 index 0000000000000000000000000000000000000000..a2cd1e054c40ebce33016fff1bcd9d869be9f07c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cpp_function_wrappers.cu @@ -0,0 +1,47 @@ +#include "cuda_fp16.h" + +#define FNDEF(fname) __numba_wrapper_ ## fname + +#define UNARY_FUNCTION(fname) extern "C" __device__ int\ + FNDEF(fname)( \ + short* return_value,\ + short x\ +)\ +{\ + __half retval = fname(__short_as_half (x));\ +\ + *return_value = __half_as_short (retval);\ + /* Signal that no Python exception occurred */ \ + return 0;\ +}\ + +extern "C" __device__ int +FNDEF(hdiv)( + short* return_value, + short x, + short y +) +{ + __half retval = __hdiv(__short_as_half (x), __short_as_half (y)); + + *return_value = __half_as_short (retval); + // Signal that no Python exception occurred + return 0; +} + +UNARY_FUNCTION(hsin) +UNARY_FUNCTION(hcos) +UNARY_FUNCTION(hlog) +UNARY_FUNCTION(hlog10) +UNARY_FUNCTION(hlog2) +UNARY_FUNCTION(hexp) +UNARY_FUNCTION(hexp10) +UNARY_FUNCTION(hexp2) +UNARY_FUNCTION(hsqrt) +UNARY_FUNCTION(hrsqrt) +UNARY_FUNCTION(hfloor) +UNARY_FUNCTION(hceil) +UNARY_FUNCTION(hrcp) +UNARY_FUNCTION(hrint) +UNARY_FUNCTION(htrunc) + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cuda_fp16.h b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cuda_fp16.h new file mode 100644 index 0000000000000000000000000000000000000000..3001595e9a4cbe2d20a3c81ffe00bd981e82c9b6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cuda_fp16.h @@ -0,0 +1,3631 @@ +/* +* Copyright 1993-2021 NVIDIA Corporation. All rights reserved. +* +* NOTICE TO LICENSEE: +* +* This source code and/or documentation ("Licensed Deliverables") are +* subject to NVIDIA intellectual property rights under U.S. and +* international Copyright laws. +* +* These Licensed Deliverables contained herein is PROPRIETARY and +* CONFIDENTIAL to NVIDIA and is being provided under the terms and +* conditions of a form of NVIDIA software license agreement by and +* between NVIDIA and Licensee ("License Agreement") or electronically +* accepted by Licensee. Notwithstanding any terms or conditions to +* the contrary in the License Agreement, reproduction or disclosure +* of the Licensed Deliverables to any third party without the express +* written consent of NVIDIA is prohibited. +* +* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE +* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE +* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS +* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. +* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED +* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, +* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. +* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE +* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY +* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY +* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +* OF THESE LICENSED DELIVERABLES. +* +* U.S. Government End Users. These Licensed Deliverables are a +* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT +* 1995), consisting of "commercial computer software" and "commercial +* computer software documentation" as such terms are used in 48 +* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government +* only as a commercial end item. Consistent with 48 C.F.R.12.212 and +* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all +* U.S. Government End Users acquire the Licensed Deliverables with +* only those rights set forth herein. +* +* Any use of the Licensed Deliverables in individual and commercial +* software must include, in the user documentation and internal +* comments to the code, the above Disclaimer and U.S. Government End +* Users Notice. +*/ + +/** +* \defgroup CUDA_MATH_INTRINSIC_HALF Half Precision Intrinsics +* This section describes half precision intrinsic functions that are +* only supported in device code. +* To use these functions, include the header file \p cuda_fp16.h in your program. +*/ + +/** +* \defgroup CUDA_MATH__HALF_ARITHMETIC Half Arithmetic Functions +* \ingroup CUDA_MATH_INTRINSIC_HALF +* To use these functions, include the header file \p cuda_fp16.h in your program. +*/ + +/** +* \defgroup CUDA_MATH__HALF2_ARITHMETIC Half2 Arithmetic Functions +* \ingroup CUDA_MATH_INTRINSIC_HALF +* To use these functions, include the header file \p cuda_fp16.h in your program. +*/ + +/** +* \defgroup CUDA_MATH__HALF_COMPARISON Half Comparison Functions +* \ingroup CUDA_MATH_INTRINSIC_HALF +* To use these functions, include the header file \p cuda_fp16.h in your program. +*/ + +/** +* \defgroup CUDA_MATH__HALF2_COMPARISON Half2 Comparison Functions +* \ingroup CUDA_MATH_INTRINSIC_HALF +* To use these functions, include the header file \p cuda_fp16.h in your program. +*/ + +/** +* \defgroup CUDA_MATH__HALF_MISC Half Precision Conversion and Data Movement +* \ingroup CUDA_MATH_INTRINSIC_HALF +* To use these functions, include the header file \p cuda_fp16.h in your program. +*/ + +/** +* \defgroup CUDA_MATH__HALF_FUNCTIONS Half Math Functions +* \ingroup CUDA_MATH_INTRINSIC_HALF +* To use these functions, include the header file \p cuda_fp16.h in your program. +*/ + +/** +* \defgroup CUDA_MATH__HALF2_FUNCTIONS Half2 Math Functions +* \ingroup CUDA_MATH_INTRINSIC_HALF +* To use these functions, include the header file \p cuda_fp16.h in your program. +*/ + +#ifndef __CUDA_FP16_H__ +#define __CUDA_FP16_H__ + +#if defined(__cplusplus) +#if defined(__CUDACC__) +#define __CUDA_FP16_DECL__ static __device__ __inline__ +#define __CUDA_HOSTDEVICE_FP16_DECL__ static __host__ __device__ __inline__ +#else +#define __CUDA_HOSTDEVICE_FP16_DECL__ static +#endif /* defined(__CUDACC__) */ + +#define __CUDA_FP16_TYPES_EXIST__ + +/* Forward-declaration of structures defined in "cuda_fp16.hpp" */ + +/** + * \brief half datatype + * + * \details This structure implements the datatype for storing + * half-precision floating-point numbers. The structure implements + * assignment operators and type conversions. + * 16 bits are being used in total: 1 sign bit, 5 bits for the exponent, + * and the significand is being stored in 10 bits. + * The total precision is 11 bits. There are 15361 representable + * numbers within the interval [0.0, 1.0], endpoints included. + * On average we have log10(2**11) ~ 3.311 decimal digits. + * + * \internal + * \req IEEE 754-2008 compliant implementation of half-precision + * floating-point numbers. + * \endinternal + */ +struct __half; + +/** + * \brief half2 datatype + * + * \details This structure implements the datatype for storing two + * half-precision floating-point numbers. + * The structure implements assignment operators and type conversions. + * + * \internal + * \req Vectorified version of half. + * \endinternal + */ +struct __half2; + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts double number to half precision in round-to-nearest-even mode +* and returns \p half with converted value. +* +* \details Converts double number \p a to half precision in round-to-nearest-even mode. +* \param[in] a - double. Is only being read. +* \returns half +* \retval a converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __double2half(const double a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts float number to half precision in round-to-nearest-even mode +* and returns \p half with converted value. +* +* \details Converts float number \p a to half precision in round-to-nearest-even mode. +* \param[in] a - float. Is only being read. +* \returns half +* \retval a converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half(const float a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts float number to half precision in round-to-nearest-even mode +* and returns \p half with converted value. +* +* \details Converts float number \p a to half precision in round-to-nearest-even mode. +* \param[in] a - float. Is only being read. +* \returns half +* \retval a converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half_rn(const float a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts float number to half precision in round-towards-zero mode +* and returns \p half with converted value. +* +* \details Converts float number \p a to half precision in round-towards-zero mode. +* \param[in] a - float. Is only being read. +* \returns half +* \retval a converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half_rz(const float a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts float number to half precision in round-down mode +* and returns \p half with converted value. +* +* \details Converts float number \p a to half precision in round-down mode. +* \param[in] a - float. Is only being read. +* +* \returns half +* \retval a converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half_rd(const float a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts float number to half precision in round-up mode +* and returns \p half with converted value. +* +* \details Converts float number \p a to half precision in round-up mode. +* \param[in] a - float. Is only being read. +* +* \returns half +* \retval a converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half_ru(const float a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts \p half number to float. +* +* \details Converts half number \p a to float. +* \param[in] a - float. Is only being read. +* +* \returns float +* \retval a converted to float. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ float __half2float(const __half a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts input to half precision in round-to-nearest-even mode and +* populates both halves of \p half2 with converted value. +* +* \details Converts input \p a to half precision in round-to-nearest-even mode and +* populates both halves of \p half2 with converted value. +* \param[in] a - float. Is only being read. +* +* \returns half2 +* \retval The \p half2 value with both halves equal to the converted half +* precision number. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half2 __float2half2_rn(const float a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts both input floats to half precision in round-to-nearest-even +* mode and returns \p half2 with converted values. +* +* \details Converts both input floats to half precision in round-to-nearest-even mode +* and combines the results into one \p half2 number. Low 16 bits of the return +* value correspond to the input \p a, high 16 bits correspond to the input \p +* b. +* \param[in] a - float. Is only being read. +* \param[in] b - float. Is only being read. +* +* \returns half2 +* \retval The \p half2 value with corresponding halves equal to the +* converted input floats. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half2 __floats2half2_rn(const float a, const float b); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts low 16 bits of \p half2 to float and returns the result +* +* \details Converts low 16 bits of \p half2 input \p a to 32-bit floating-point number +* and returns the result. +* \param[in] a - half2. Is only being read. +* +* \returns float +* \retval The low 16 bits of \p a converted to float. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ float __low2float(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts high 16 bits of \p half2 to float and returns the result +* +* \details Converts high 16 bits of \p half2 input \p a to 32-bit floating-point number +* and returns the result. +* \param[in] a - half2. Is only being read. +* +* \returns float +* \retval The high 16 bits of \p a converted to float. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ float __high2float(const __half2 a); + +#if defined(__CUDACC__) +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts both components of float2 number to half precision in +* round-to-nearest-even mode and returns \p half2 with converted values. +* +* \details Converts both components of float2 to half precision in round-to-nearest +* mode and combines the results into one \p half2 number. Low 16 bits of the +* return value correspond to \p a.x and high 16 bits of the return value +* correspond to \p a.y. +* \param[in] a - float2. Is only being read. +* +* \returns half2 +* \retval The \p half2 which has corresponding halves equal to the +* converted float2 components. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half2 __float22half2_rn(const float2 a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Converts both halves of \p half2 to float2 and returns the result. +* +* \details Converts both halves of \p half2 input \p a to float2 and returns the +* result. +* \param[in] a - half2. Is only being read. +* +* \returns float2 +* \retval a converted to float2. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ float2 __half22float2(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed integer in round-to-nearest-even mode. +* +* \details Convert the half-precision floating-point value \p h to a signed integer in +* round-to-nearest-even mode. +* \param[in] h - half. Is only being read. +* +* \returns int +* \retval h converted to a signed integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ int __half2int_rn(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed integer in round-towards-zero mode. +* +* \details Convert the half-precision floating-point value \p h to a signed integer in +* round-towards-zero mode. +* \param[in] h - half. Is only being read. +* +* \returns int +* \retval h converted to a signed integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ int __half2int_rz(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed integer in round-down mode. +* +* \details Convert the half-precision floating-point value \p h to a signed integer in +* round-down mode. +* \param[in] h - half. Is only being read. +* +* \returns int +* \retval h converted to a signed integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ int __half2int_rd(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed integer in round-up mode. +* +* \details Convert the half-precision floating-point value \p h to a signed integer in +* round-up mode. +* \param[in] h - half. Is only being read. +* +* \returns int +* \retval h converted to a signed integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ int __half2int_ru(const __half h); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed integer to a half in round-to-nearest-even mode. +* +* \details Convert the signed integer value \p i to a half-precision floating-point +* value in round-to-nearest-even mode. +* \param[in] i - int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __int2half_rn(const int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed integer to a half in round-towards-zero mode. +* +* \details Convert the signed integer value \p i to a half-precision floating-point +* value in round-towards-zero mode. +* \param[in] i - int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __int2half_rz(const int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed integer to a half in round-down mode. +* +* \details Convert the signed integer value \p i to a half-precision floating-point +* value in round-down mode. +* \param[in] i - int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __int2half_rd(const int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed integer to a half in round-up mode. +* +* \details Convert the signed integer value \p i to a half-precision floating-point +* value in round-up mode. +* \param[in] i - int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __int2half_ru(const int i); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed short integer in round-to-nearest-even +* mode. +* +* \details Convert the half-precision floating-point value \p h to a signed short +* integer in round-to-nearest-even mode. +* \param[in] h - half. Is only being read. +* +* \returns short int +* \retval h converted to a signed short integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ short int __half2short_rn(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed short integer in round-towards-zero mode. +* +* \details Convert the half-precision floating-point value \p h to a signed short +* integer in round-towards-zero mode. +* \param[in] h - half. Is only being read. +* +* \returns short int +* \retval h converted to a signed short integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ short int __half2short_rz(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed short integer in round-down mode. +* +* \details Convert the half-precision floating-point value \p h to a signed short +* integer in round-down mode. +* \param[in] h - half. Is only being read. +* +* \returns short int +* \retval h converted to a signed short integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ short int __half2short_rd(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed short integer in round-up mode. +* +* \details Convert the half-precision floating-point value \p h to a signed short +* integer in round-up mode. +* \param[in] h - half. Is only being read. +* +* \returns short int +* \retval h converted to a signed short integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ short int __half2short_ru(const __half h); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed short integer to a half in round-to-nearest-even +* mode. +* +* \details Convert the signed short integer value \p i to a half-precision floating-point +* value in round-to-nearest-even mode. +* \param[in] i - short int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __short2half_rn(const short int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed short integer to a half in round-towards-zero mode. +* +* \details Convert the signed short integer value \p i to a half-precision floating-point +* value in round-towards-zero mode. +* \param[in] i - short int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __short2half_rz(const short int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed short integer to a half in round-down mode. +* +* \details Convert the signed short integer value \p i to a half-precision floating-point +* value in round-down mode. +* \param[in] i - short int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __short2half_rd(const short int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed short integer to a half in round-up mode. +* +* \details Convert the signed short integer value \p i to a half-precision floating-point +* value in round-up mode. +* \param[in] i - short int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __short2half_ru(const short int i); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned integer in round-to-nearest-even mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned integer +* in round-to-nearest-even mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned int +* \retval h converted to an unsigned integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ unsigned int __half2uint_rn(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned integer in round-towards-zero mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned integer +* in round-towards-zero mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned int +* \retval h converted to an unsigned integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ unsigned int __half2uint_rz(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned integer in round-down mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned integer +* in round-down mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned int +* \retval h converted to an unsigned integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ unsigned int __half2uint_rd(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned integer in round-up mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned integer +* in round-up mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned int +* \retval h converted to an unsigned integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ unsigned int __half2uint_ru(const __half h); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned integer to a half in round-to-nearest-even mode. +* +* \details Convert the unsigned integer value \p i to a half-precision floating-point +* value in round-to-nearest-even mode. +* \param[in] i - unsigned int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __uint2half_rn(const unsigned int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned integer to a half in round-towards-zero mode. +* +* \details Convert the unsigned integer value \p i to a half-precision floating-point +* value in round-towards-zero mode. +* \param[in] i - unsigned int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __uint2half_rz(const unsigned int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned integer to a half in round-down mode. +* +* \details Convert the unsigned integer value \p i to a half-precision floating-point +* value in round-down mode. +* \param[in] i - unsigned int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __uint2half_rd(const unsigned int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned integer to a half in round-up mode. +* +* \details Convert the unsigned integer value \p i to a half-precision floating-point +* value in round-up mode. +* \param[in] i - unsigned int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __uint2half_ru(const unsigned int i); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned short integer in round-to-nearest-even +* mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned short +* integer in round-to-nearest-even mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned short int +* \retval h converted to an unsigned short integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ unsigned short int __half2ushort_rn(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned short integer in round-towards-zero +* mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned short +* integer in round-towards-zero mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned short int +* \retval h converted to an unsigned short integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ unsigned short int __half2ushort_rz(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned short integer in round-down mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned short +* integer in round-down mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned short int +* \retval h converted to an unsigned short integer. +*/ +__CUDA_FP16_DECL__ unsigned short int __half2ushort_rd(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned short integer in round-up mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned short +* integer in round-up mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned short int +* \retval h converted to an unsigned short integer. +*/ +__CUDA_FP16_DECL__ unsigned short int __half2ushort_ru(const __half h); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned short integer to a half in round-to-nearest-even +* mode. +* +* \details Convert the unsigned short integer value \p i to a half-precision floating-point +* value in round-to-nearest-even mode. +* \param[in] i - unsigned short int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __ushort2half_rn(const unsigned short int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned short integer to a half in round-towards-zero +* mode. +* +* \details Convert the unsigned short integer value \p i to a half-precision floating-point +* value in round-towards-zero mode. +* \param[in] i - unsigned short int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __ushort2half_rz(const unsigned short int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned short integer to a half in round-down mode. +* +* \details Convert the unsigned short integer value \p i to a half-precision floating-point +* value in round-down mode. +* \param[in] i - unsigned short int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __ushort2half_rd(const unsigned short int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned short integer to a half in round-up mode. +* +* \details Convert the unsigned short integer value \p i to a half-precision floating-point +* value in round-up mode. +* \param[in] i - unsigned short int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __ushort2half_ru(const unsigned short int i); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned 64-bit integer in round-to-nearest-even +* mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned 64-bit +* integer in round-to-nearest-even mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned long long int +* \retval h converted to an unsigned 64-bit integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ unsigned long long int __half2ull_rn(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned 64-bit integer in round-towards-zero +* mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned 64-bit +* integer in round-towards-zero mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned long long int +* \retval h converted to an unsigned 64-bit integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ unsigned long long int __half2ull_rz(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned 64-bit integer in round-down mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned 64-bit +* integer in round-down mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned long long int +* \retval h converted to an unsigned 64-bit integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ unsigned long long int __half2ull_rd(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to an unsigned 64-bit integer in round-up mode. +* +* \details Convert the half-precision floating-point value \p h to an unsigned 64-bit +* integer in round-up mode. +* \param[in] h - half. Is only being read. +* +* \returns unsigned long long int +* \retval h converted to an unsigned 64-bit integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ unsigned long long int __half2ull_ru(const __half h); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned 64-bit integer to a half in round-to-nearest-even +* mode. +* +* \details Convert the unsigned 64-bit integer value \p i to a half-precision floating-point +* value in round-to-nearest-even mode. +* \param[in] i - unsigned long long int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __ull2half_rn(const unsigned long long int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned 64-bit integer to a half in round-towards-zero +* mode. +* +* \details Convert the unsigned 64-bit integer value \p i to a half-precision floating-point +* value in round-towards-zero mode. +* \param[in] i - unsigned long long int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __ull2half_rz(const unsigned long long int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned 64-bit integer to a half in round-down mode. +* +* \details Convert the unsigned 64-bit integer value \p i to a half-precision floating-point +* value in round-down mode. +* \param[in] i - unsigned long long int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __ull2half_rd(const unsigned long long int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert an unsigned 64-bit integer to a half in round-up mode. +* +* \details Convert the unsigned 64-bit integer value \p i to a half-precision floating-point +* value in round-up mode. +* \param[in] i - unsigned long long int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __ull2half_ru(const unsigned long long int i); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed 64-bit integer in round-to-nearest-even +* mode. +* +* \details Convert the half-precision floating-point value \p h to a signed 64-bit +* integer in round-to-nearest-even mode. +* \param[in] h - half. Is only being read. +* +* \returns long long int +* \retval h converted to a signed 64-bit integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ long long int __half2ll_rn(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed 64-bit integer in round-towards-zero mode. +* +* \details Convert the half-precision floating-point value \p h to a signed 64-bit +* integer in round-towards-zero mode. +* \param[in] h - half. Is only being read. +* +* \returns long long int +* \retval h converted to a signed 64-bit integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ long long int __half2ll_rz(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed 64-bit integer in round-down mode. +* +* \details Convert the half-precision floating-point value \p h to a signed 64-bit +* integer in round-down mode. +* \param[in] h - half. Is only being read. +* +* \returns long long int +* \retval h converted to a signed 64-bit integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ long long int __half2ll_rd(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a half to a signed 64-bit integer in round-up mode. +* +* \details Convert the half-precision floating-point value \p h to a signed 64-bit +* integer in round-up mode. +* \param[in] h - half. Is only being read. +* +* \returns long long int +* \retval h converted to a signed 64-bit integer. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ long long int __half2ll_ru(const __half h); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed 64-bit integer to a half in round-to-nearest-even +* mode. +* +* \details Convert the signed 64-bit integer value \p i to a half-precision floating-point +* value in round-to-nearest-even mode. +* \param[in] i - long long int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_HOSTDEVICE_FP16_DECL__ __half __ll2half_rn(const long long int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed 64-bit integer to a half in round-towards-zero mode. +* +* \details Convert the signed 64-bit integer value \p i to a half-precision floating-point +* value in round-towards-zero mode. +* \param[in] i - long long int. Is only being read. +* +* \returns half +* \retval i converted to half. +*/ +__CUDA_FP16_DECL__ __half __ll2half_rz(const long long int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed 64-bit integer to a half in round-down mode. +* +* \details Convert the signed 64-bit integer value \p i to a half-precision floating-point +* value in round-down mode. +* \param[in] i - long long int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __ll2half_rd(const long long int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Convert a signed 64-bit integer to a half in round-up mode. +* +* \details Convert the signed 64-bit integer value \p i to a half-precision floating-point +* value in round-up mode. +* \param[in] i - long long int. Is only being read. +* +* \returns half +* \retval i converted to half. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __ll2half_ru(const long long int i); + +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Truncate input argument to the integral part. +* +* \details Round \p h to the nearest integer value that does not exceed \p h in +* magnitude. +* \param[in] h - half. Is only being read. +* +* \returns half +* \retval The truncated integer value. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half htrunc(const __half h); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculate ceiling of the input argument. +* +* \details Compute the smallest integer value not less than \p h. +* \param[in] h - half. Is only being read. +* +* \returns half +* \retval The smallest integer value not less than \p h. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hceil(const __half h); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculate the largest integer less than or equal to \p h. +* +* \details Calculate the largest integer value which is less than or equal to \p h. +* \param[in] h - half. Is only being read. +* +* \returns half +* \retval The largest integer value which is less than or equal to \p h. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hfloor(const __half h); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Round input to nearest integer value in half-precision floating-point +* number. +* +* \details Round \p h to the nearest integer value in half-precision floating-point +* format, with halfway cases rounded to the nearest even integer value. +* \param[in] h - half. Is only being read. +* +* \returns half +* \retval The nearest integer to \p h. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hrint(const __half h); + +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Truncate \p half2 vector input argument to the integral part. +* +* \details Round each component of vector \p h to the nearest integer value that does +* not exceed \p h in magnitude. +* \param[in] h - half2. Is only being read. +* +* \returns half2 +* \retval The truncated \p h. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2trunc(const __half2 h); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculate \p half2 vector ceiling of the input argument. +* +* \details For each component of vector \p h compute the smallest integer value not less +* than \p h. +* \param[in] h - half2. Is only being read. +* +* \returns half2 +* \retval The vector of smallest integers not less than \p h. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2ceil(const __half2 h); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculate the largest integer less than or equal to \p h. +* +* \details For each component of vector \p h calculate the largest integer value which +* is less than or equal to \p h. +* \param[in] h - half2. Is only being read. +* +* \returns half2 +* \retval The vector of largest integers which is less than or equal to \p h. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2floor(const __half2 h); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Round input to nearest integer value in half-precision floating-point +* number. +* +* \details Round each component of \p half2 vector \p h to the nearest integer value in +* half-precision floating-point format, with halfway cases rounded to the +* nearest even integer value. +* \param[in] h - half2. Is only being read. +* +* \returns half2 +* \retval The vector of rounded integer values. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2rint(const __half2 h); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Returns \p half2 with both halves equal to the input value. +* +* \details Returns \p half2 number with both halves equal to the input \p a \p half +* number. +* \param[in] a - half. Is only being read. +* +* \returns half2 +* \retval The vector which has both its halves equal to the input \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __half2half2(const __half a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Swaps both halves of the \p half2 input. +* +* \details Swaps both halves of the \p half2 input and returns a new \p half2 number +* with swapped halves. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval a with its halves being swapped. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __lowhigh2highlow(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Extracts low 16 bits from each of the two \p half2 inputs and combines +* into one \p half2 number. +* +* \details Extracts low 16 bits from each of the two \p half2 inputs and combines into +* one \p half2 number. Low 16 bits from input \p a is stored in low 16 bits of +* the return value, low 16 bits from input \p b is stored in high 16 bits of +* the return value. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The low 16 bits of \p a and of \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __lows2half2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Extracts high 16 bits from each of the two \p half2 inputs and +* combines into one \p half2 number. +* +* \details Extracts high 16 bits from each of the two \p half2 inputs and combines into +* one \p half2 number. High 16 bits from input \p a is stored in low 16 bits of +* the return value, high 16 bits from input \p b is stored in high 16 bits of +* the return value. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The high 16 bits of \p a and of \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __highs2half2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Returns high 16 bits of \p half2 input. +* +* \details Returns high 16 bits of \p half2 input \p a. +* \param[in] a - half2. Is only being read. +* +* \returns half +* \retval The high 16 bits of the input. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __high2half(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Returns low 16 bits of \p half2 input. +* +* \details Returns low 16 bits of \p half2 input \p a. +* \param[in] a - half2. Is only being read. +* +* \returns half +* \retval Returns \p half which contains low 16 bits of the input \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __low2half(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Checks if the input \p half number is infinite. +* +* \details Checks if the input \p half number \p a is infinite. +* \param[in] a - half. Is only being read. +* +* \returns int +* \retval -1 iff \p a is equal to negative infinity, +* \retval 1 iff \p a is equal to positive infinity, +* \retval 0 otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ int __hisinf(const __half a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Combines two \p half numbers into one \p half2 number. +* +* \details Combines two input \p half number \p a and \p b into one \p half2 number. +* Input \p a is stored in low 16 bits of the return value, input \p b is stored +* in high 16 bits of the return value. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half2 +* \retval The half2 with one half equal to \p a and the other to \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __halves2half2(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Extracts low 16 bits from \p half2 input. +* +* \details Extracts low 16 bits from \p half2 input \p a and returns a new \p half2 +* number which has both halves equal to the extracted bits. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The half2 with both halves equal to the low 16 bits of the input. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __low2half2(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Extracts high 16 bits from \p half2 input. +* +* \details Extracts high 16 bits from \p half2 input \p a and returns a new \p half2 +* number which has both halves equal to the extracted bits. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The half2 with both halves equal to the high 16 bits of the input. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __high2half2(const __half2 a); + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Reinterprets bits in a \p half as a signed short integer. +* +* \details Reinterprets the bits in the half-precision floating-point number \p h +* as a signed short integer. +* \param[in] h - half. Is only being read. +* +* \returns short int +* \retval The reinterpreted value. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ short int __half_as_short(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Reinterprets bits in a \p half as an unsigned short integer. +* +* \details Reinterprets the bits in the half-precision floating-point \p h +* as an unsigned short number. +* \param[in] h - half. Is only being read. +* +* \returns unsigned short int +* \retval The reinterpreted value. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ unsigned short int __half_as_ushort(const __half h); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Reinterprets bits in a signed short integer as a \p half. +* +* \details Reinterprets the bits in the signed short integer \p i as a +* half-precision floating-point number. +* \param[in] i - short int. Is only being read. +* +* \returns half +* \retval The reinterpreted value. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __short_as_half(const short int i); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Reinterprets bits in an unsigned short integer as a \p half. +* +* \details Reinterprets the bits in the unsigned short integer \p i as a +* half-precision floating-point number. +* \param[in] i - unsigned short int. Is only being read. +* +* \returns half +* \retval The reinterpreted value. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __ushort_as_half(const unsigned short int i); + +#if __CUDA_ARCH__ >= 300 || !defined(__CUDA_ARCH__) +#if !defined warpSize && !defined __local_warpSize +#define warpSize 32 +#define __local_warpSize +#endif + +#if defined(_WIN32) +# define __DEPRECATED__(msg) __declspec(deprecated(msg)) +#elif (defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5 && !defined(__clang__)))) +# define __DEPRECATED__(msg) __attribute__((deprecated)) +#else +# define __DEPRECATED__(msg) __attribute__((deprecated(msg))) +#endif + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ < 700 +#define __WSB_DEPRECATION_MESSAGE(x) #x"() is deprecated in favor of "#x"_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning)." + +__CUDA_FP16_DECL__ __DEPRECATED__(__WSB_DEPRECATION_MESSAGE(__shfl)) __half2 __shfl(const __half2 var, const int delta, const int width = warpSize); +__CUDA_FP16_DECL__ __DEPRECATED__(__WSB_DEPRECATION_MESSAGE(__shfl_up)) __half2 __shfl_up(const __half2 var, const unsigned int delta, const int width = warpSize); +__CUDA_FP16_DECL__ __DEPRECATED__(__WSB_DEPRECATION_MESSAGE(__shfl_down))__half2 __shfl_down(const __half2 var, const unsigned int delta, const int width = warpSize); +__CUDA_FP16_DECL__ __DEPRECATED__(__WSB_DEPRECATION_MESSAGE(__shfl_xor)) __half2 __shfl_xor(const __half2 var, const int delta, const int width = warpSize); +__CUDA_FP16_DECL__ __DEPRECATED__(__WSB_DEPRECATION_MESSAGE(__shfl)) __half __shfl(const __half var, const int delta, const int width = warpSize); +__CUDA_FP16_DECL__ __DEPRECATED__(__WSB_DEPRECATION_MESSAGE(__shfl_up)) __half __shfl_up(const __half var, const unsigned int delta, const int width = warpSize); +__CUDA_FP16_DECL__ __DEPRECATED__(__WSB_DEPRECATION_MESSAGE(__shfl_down)) __half __shfl_down(const __half var, const unsigned int delta, const int width = warpSize); +__CUDA_FP16_DECL__ __DEPRECATED__(__WSB_DEPRECATION_MESSAGE(__shfl_xor)) __half __shfl_xor(const __half var, const int delta, const int width = warpSize); +#endif + +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Exchange a variable between threads within a warp. Direct copy from indexed thread. +* +* \details Returns the value of var held by the thread whose ID is given by delta. +* If width is less than warpSize then each subsection of the warp behaves as a separate +* entity with a starting logical thread ID of 0. If delta is outside the range [0:width-1], +* the value returned corresponds to the value of var held by the delta modulo width (i.e. +* within the same subsection). width must have a value which is a power of 2; +* results are undefined if width is not a power of 2, or is a number greater than +* warpSize. +* \param[in] mask - unsigned int. Is only being read. +* \param[in] var - half2. Is only being read. +* \param[in] delta - int. Is only being read. +* \param[in] width - int. Is only being read. +* +* \returns Returns the 4-byte word referenced by var from the source thread ID as half2. +* If the source thread ID is out of range or the source thread has exited, the calling thread's own var is returned. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior not reentrant, not thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __shfl_sync(const unsigned mask, const __half2 var, const int delta, const int width = warpSize); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Exchange a variable between threads within a warp. Copy from a thread with lower ID relative to the caller. +* +* \details Calculates a source thread ID by subtracting delta from the caller's lane ID. +* The value of var held by the resulting lane ID is returned: in effect, var is shifted up +* the warp by delta threads. If width is less than warpSize then each subsection of the warp +* behaves as a separate entity with a starting logical thread ID of 0. The source thread index +* will not wrap around the value of width, so effectively the lower delta threads will be unchanged. +* width must have a value which is a power of 2; results are undefined if width is not a power of 2, +* or is a number greater than warpSize. +* \param[in] mask - unsigned int. Is only being read. +* \param[in] var - half2. Is only being read. +* \param[in] delta - int. Is only being read. +* \param[in] width - int. Is only being read. +* +* \returns Returns the 4-byte word referenced by var from the source thread ID as half2. +* If the source thread ID is out of range or the source thread has exited, the calling thread's own var is returned. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior not reentrant, not thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __shfl_up_sync(const unsigned mask, const __half2 var, const unsigned int delta, const int width = warpSize); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Exchange a variable between threads within a warp. Copy from a thread with higher ID relative to the caller. +* +* \details Calculates a source thread ID by adding delta to the caller's thread ID. +* The value of var held by the resulting thread ID is returned: this has the effect +* of shifting var down the warp by delta threads. If width is less than warpSize then +* each subsection of the warp behaves as a separate entity with a starting logical +* thread ID of 0. As for __shfl_up_sync(), the ID number of the source thread +* will not wrap around the value of width and so the upper delta threads +* will remain unchanged. +* \param[in] mask - unsigned int. Is only being read. +* \param[in] var - half2. Is only being read. +* \param[in] delta - int. Is only being read. +* \param[in] width - int. Is only being read. +* +* \returns Returns the 4-byte word referenced by var from the source thread ID as half2. +* If the source thread ID is out of range or the source thread has exited, the calling thread's own var is returned. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior not reentrant, not thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __shfl_down_sync(const unsigned mask, const __half2 var, const unsigned int delta, const int width = warpSize); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Exchange a variable between threads within a warp. Copy from a thread based on bitwise XOR of own thread ID. +* +* \details Calculates a source thread ID by performing a bitwise XOR of the caller's thread ID with mask: +* the value of var held by the resulting thread ID is returned. If width is less than warpSize then each +* group of width consecutive threads are able to access elements from earlier groups of threads, +* however if they attempt to access elements from later groups of threads their own value of var +* will be returned. This mode implements a butterfly addressing pattern such as is used in tree +* reduction and broadcast. +* \param[in] mask - unsigned int. Is only being read. +* \param[in] var - half2. Is only being read. +* \param[in] delta - int. Is only being read. +* \param[in] width - int. Is only being read. +* +* \returns Returns the 4-byte word referenced by var from the source thread ID as half2. +* If the source thread ID is out of range or the source thread has exited, the calling thread's own var is returned. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior not reentrant, not thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __shfl_xor_sync(const unsigned mask, const __half2 var, const int delta, const int width = warpSize); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Exchange a variable between threads within a warp. Direct copy from indexed thread. +* +* \details Returns the value of var held by the thread whose ID is given by delta. +* If width is less than warpSize then each subsection of the warp behaves as a separate +* entity with a starting logical thread ID of 0. If delta is outside the range [0:width-1], +* the value returned corresponds to the value of var held by the delta modulo width (i.e. +* within the same subsection). width must have a value which is a power of 2; +* results are undefined if width is not a power of 2, or is a number greater than +* warpSize. +* \param[in] mask - unsigned int. Is only being read. +* \param[in] var - half. Is only being read. +* \param[in] delta - int. Is only being read. +* \param[in] width - int. Is only being read. +* +* \returns Returns the 2-byte word referenced by var from the source thread ID as half. +* If the source thread ID is out of range or the source thread has exited, the calling thread's own var is returned. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior not reentrant, not thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __shfl_sync(const unsigned mask, const __half var, const int delta, const int width = warpSize); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Exchange a variable between threads within a warp. Copy from a thread with lower ID relative to the caller. +* \details Calculates a source thread ID by subtracting delta from the caller's lane ID. +* The value of var held by the resulting lane ID is returned: in effect, var is shifted up +* the warp by delta threads. If width is less than warpSize then each subsection of the warp +* behaves as a separate entity with a starting logical thread ID of 0. The source thread index +* will not wrap around the value of width, so effectively the lower delta threads will be unchanged. +* width must have a value which is a power of 2; results are undefined if width is not a power of 2, +* or is a number greater than warpSize. +* \param[in] mask - unsigned int. Is only being read. +* \param[in] var - half. Is only being read. +* \param[in] delta - int. Is only being read. +* \param[in] width - int. Is only being read. +* +* \returns Returns the 2-byte word referenced by var from the source thread ID as half. +* If the source thread ID is out of range or the source thread has exited, the calling thread's own var is returned. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior not reentrant, not thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __shfl_up_sync(const unsigned mask, const __half var, const unsigned int delta, const int width = warpSize); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Exchange a variable between threads within a warp. Copy from a thread with higher ID relative to the caller. +* +* \details Calculates a source thread ID by adding delta to the caller's thread ID. +* The value of var held by the resulting thread ID is returned: this has the effect +* of shifting var down the warp by delta threads. If width is less than warpSize then +* each subsection of the warp behaves as a separate entity with a starting logical +* thread ID of 0. As for __shfl_up_sync(), the ID number of the source thread +* will not wrap around the value of width and so the upper delta threads +* will remain unchanged. +* \param[in] mask - unsigned int. Is only being read. +* \param[in] var - half. Is only being read. +* \param[in] delta - int. Is only being read. +* \param[in] width - int. Is only being read. +* +* \returns Returns the 2-byte word referenced by var from the source thread ID as half. +* If the source thread ID is out of range or the source thread has exited, the calling thread's own var is returned. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior not reentrant, not thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __shfl_down_sync(const unsigned mask, const __half var, const unsigned int delta, const int width = warpSize); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Exchange a variable between threads within a warp. Copy from a thread based on bitwise XOR of own thread ID. +* +* \details Calculates a source thread ID by performing a bitwise XOR of the caller's thread ID with mask: +* the value of var held by the resulting thread ID is returned. If width is less than warpSize then each +* group of width consecutive threads are able to access elements from earlier groups of threads, +* however if they attempt to access elements from later groups of threads their own value of var +* will be returned. This mode implements a butterfly addressing pattern such as is used in tree +* reduction and broadcast. +* \param[in] mask - unsigned int. Is only being read. +* \param[in] var - half. Is only being read. +* \param[in] delta - int. Is only being read. +* \param[in] width - int. Is only being read. +* +* \returns Returns the 2-byte word referenced by var from the source thread ID as half. +* If the source thread ID is out of range or the source thread has exited, the calling thread's own var is returned. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior not reentrant, not thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __shfl_xor_sync(const unsigned mask, const __half var, const int delta, const int width = warpSize); + +#if defined(__local_warpSize) +#undef warpSize +#undef __local_warpSize +#endif +#endif /*__CUDA_ARCH__ >= 300 || !defined(__CUDA_ARCH__) */ + +#if defined(__cplusplus) && ( __CUDA_ARCH__ >=320 || !defined(__CUDA_ARCH__) ) +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.nc` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half2 __ldg(const __half2 *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.nc` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half __ldg(const __half *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.cg` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half2 __ldcg(const __half2 *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.cg` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half __ldcg(const __half *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.ca` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half2 __ldca(const __half2 *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.ca` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half __ldca(const __half *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.cs` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half2 __ldcs(const __half2 *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.cs` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half __ldcs(const __half *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.lu` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half2 __ldlu(const __half2 *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.lu` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half __ldlu(const __half *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.cv` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half2 __ldcv(const __half2 *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `ld.global.cv` load instruction. +* \param[in] ptr - memory location +* \returns The value pointed by `ptr` +*/ +__CUDA_FP16_DECL__ __half __ldcv(const __half *const ptr); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `st.global.wb` store instruction. +* \param[out] ptr - memory location +* \param[in] value - the value to be stored +*/ +__CUDA_FP16_DECL__ void __stwb(__half2 *const ptr, const __half2 value); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `st.global.wb` store instruction. +* \param[out] ptr - memory location +* \param[in] value - the value to be stored +*/ +__CUDA_FP16_DECL__ void __stwb(__half *const ptr, const __half value); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `st.global.cg` store instruction. +* \param[out] ptr - memory location +* \param[in] value - the value to be stored +*/ +__CUDA_FP16_DECL__ void __stcg(__half2 *const ptr, const __half2 value); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `st.global.cg` store instruction. +* \param[out] ptr - memory location +* \param[in] value - the value to be stored +*/ +__CUDA_FP16_DECL__ void __stcg(__half *const ptr, const __half value); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `st.global.cs` store instruction. +* \param[out] ptr - memory location +* \param[in] value - the value to be stored +*/ +__CUDA_FP16_DECL__ void __stcs(__half2 *const ptr, const __half2 value); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `st.global.cs` store instruction. +* \param[out] ptr - memory location +* \param[in] value - the value to be stored +*/ +__CUDA_FP16_DECL__ void __stcs(__half *const ptr, const __half value); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `st.global.wt` store instruction. +* \param[out] ptr - memory location +* \param[in] value - the value to be stored +*/ +__CUDA_FP16_DECL__ void __stwt(__half2 *const ptr, const __half2 value); +/** +* \ingroup CUDA_MATH__HALF_MISC +* \brief Generates a `st.global.wt` store instruction. +* \param[out] ptr - memory location +* \param[in] value - the value to be stored +*/ +__CUDA_FP16_DECL__ void __stwt(__half *const ptr, const __half value); +#endif /*defined(__cplusplus) && ( __CUDA_ARCH__ >=320 || !defined(__CUDA_ARCH__) )*/ + +#if __CUDA_ARCH__ >= 530 || !defined(__CUDA_ARCH__) +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs half2 vector if-equal comparison. +* +* \details Performs \p half2 vector if-equal comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The vector result of if-equal comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __heq2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector not-equal comparison. +* +* \details Performs \p half2 vector not-equal comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The vector result of not-equal comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hne2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector less-equal comparison. +* +* \details Performs \p half2 vector less-equal comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The \p half2 result of less-equal comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hle2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector greater-equal comparison. +* +* \details Performs \p half2 vector greater-equal comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The vector result of greater-equal comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hge2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector less-than comparison. +* +* \details Performs \p half2 vector less-than comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The half2 vector result of less-than comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hlt2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector greater-than comparison. +* +* \details Performs \p half2 vector greater-than comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The vector result of greater-than comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hgt2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered if-equal comparison. +* +* \details Performs \p half2 vector if-equal comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The vector result of unordered if-equal comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hequ2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered not-equal comparison. +* +* \details Performs \p half2 vector not-equal comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The vector result of unordered not-equal comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hneu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered less-equal comparison. +* +* Performs \p half2 vector less-equal comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The vector result of unordered less-equal comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hleu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered greater-equal comparison. +* +* \details Performs \p half2 vector greater-equal comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The \p half2 vector result of unordered greater-equal comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hgeu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered less-than comparison. +* +* \details Performs \p half2 vector less-than comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The vector result of unordered less-than comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hltu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered greater-than comparison. +* +* \details Performs \p half2 vector greater-than comparison of inputs \p a and \p b. +* The corresponding \p half results are set to 1.0 for true, or 0.0 for false. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The \p half2 vector result of unordered greater-than comparison of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hgtu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Determine whether \p half2 argument is a NaN. +* +* \details Determine whether each half of input \p half2 number \p a is a NaN. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The half2 with the corresponding \p half results set to +* 1.0 for NaN, 0.0 otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hisnan2(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector addition in round-to-nearest-even mode. +* +* \details Performs \p half2 vector add of inputs \p a and \p b, in round-to-nearest +* mode. +* \internal +* \req DEEPLEARN-SRM_REQ-95 +* \endinternal +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The sum of vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hadd2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector subtraction in round-to-nearest-even mode. +* +* \details Subtracts \p half2 input vector \p b from input vector \p a in +* round-to-nearest-even mode. +* \internal +* \req DEEPLEARN-SRM_REQ-104 +* \endinternal +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The subtraction of vector \p b from \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hsub2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector multiplication in round-to-nearest-even mode. +* +* \details Performs \p half2 vector multiplication of inputs \p a and \p b, in +* round-to-nearest-even mode. +* \internal +* \req DEEPLEARN-SRM_REQ-102 +* \endinternal +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The result of elementwise multiplying the vectors \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hmul2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector division in round-to-nearest-even mode. +* +* \details Divides \p half2 input vector \p a by input vector \p b in round-to-nearest +* mode. +* \internal +* \req DEEPLEARN-SRM_REQ-103 +* \endinternal +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise division of \p a with \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __h2div(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Calculates the absolute value of both halves of the input \p half2 number and +* returns the result. +* +* \details Calculates the absolute value of both halves of the input \p half2 number and +* returns the result. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval Returns \p a with the absolute value of both halves. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __habs2(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector addition in round-to-nearest-even mode, with +* saturation to [0.0, 1.0]. +* +* \details Performs \p half2 vector add of inputs \p a and \p b, in round-to-nearest +* mode, and clamps the results to range [0.0, 1.0]. NaN results are flushed to +* +0.0. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The sum of \p a and \p b, with respect to saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hadd2_sat(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector subtraction in round-to-nearest-even mode, +* with saturation to [0.0, 1.0]. +* +* \details Subtracts \p half2 input vector \p b from input vector \p a in +* round-to-nearest-even mode, and clamps the results to range [0.0, 1.0]. NaN +* results are flushed to +0.0. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The subtraction of vector \p b from \p a, with respect to saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hsub2_sat(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector multiplication in round-to-nearest-even mode, +* with saturation to [0.0, 1.0]. +* +* \details Performs \p half2 vector multiplication of inputs \p a and \p b, in +* round-to-nearest-even mode, and clamps the results to range [0.0, 1.0]. NaN +* results are flushed to +0.0. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The result of elementwise multiplication of vectors \p a and \p b, +* with respect to saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hmul2_sat(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector fused multiply-add in round-to-nearest-even +* mode. +* +* \details Performs \p half2 vector multiply on inputs \p a and \p b, +* then performs a \p half2 vector add of the result with \p c, +* rounding the result once in round-to-nearest-even mode. +* \internal +* \req DEEPLEARN-SRM_REQ-105 +* \endinternal +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* \param[in] c - half2. Is only being read. +* +* \returns half2 +* \retval The result of elementwise fused multiply-add operation on vectors \p a, \p b, and \p c. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hfma2(const __half2 a, const __half2 b, const __half2 c); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector fused multiply-add in round-to-nearest-even +* mode, with saturation to [0.0, 1.0]. +* +* \details Performs \p half2 vector multiply on inputs \p a and \p b, +* then performs a \p half2 vector add of the result with \p c, +* rounding the result once in round-to-nearest-even mode, and clamps the +* results to range [0.0, 1.0]. NaN results are flushed to +0.0. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* \param[in] c - half2. Is only being read. +* +* \returns half2 +* \retval The result of elementwise fused multiply-add operation on vectors \p a, \p b, and \p c, +* with respect to saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hfma2_sat(const __half2 a, const __half2 b, const __half2 c); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Negates both halves of the input \p half2 number and returns the +* result. +* +* \details Negates both halves of the input \p half2 number \p a and returns the result. +* \internal +* \req DEEPLEARN-SRM_REQ-101 +* \endinternal +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval Returns \p a with both halves negated. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hneg2(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Calculates the absolute value of input \p half number and returns the result. +* +* \details Calculates the absolute value of input \p half number and returns the result. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The absolute value of a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __habs(const __half a); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half addition in round-to-nearest-even mode. +* +* \details Performs \p half addition of inputs \p a and \p b, in round-to-nearest-even +* mode. +* \internal +* \req DEEPLEARN-SRM_REQ-94 +* \endinternal +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \retval The sum of \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hadd(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half subtraction in round-to-nearest-even mode. +* +* \details Subtracts \p half input \p b from input \p a in round-to-nearest +* mode. +* \internal +* \req DEEPLEARN-SRM_REQ-97 +* \endinternal +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \retval The result of subtracting \p b from \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hsub(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half multiplication in round-to-nearest-even mode. +* +* \details Performs \p half multiplication of inputs \p a and \p b, in round-to-nearest +* mode. +* \internal +* \req DEEPLEARN-SRM_REQ-99 +* \endinternal +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \retval The result of multiplying \p a and \p b. +*/ +__CUDA_FP16_DECL__ __half __hmul(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half division in round-to-nearest-even mode. +* +* \details Divides \p half input \p a by input \p b in round-to-nearest +* mode. +* \internal +* \req DEEPLEARN-SRM_REQ-98 +* \endinternal +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \retval The result of dividing \p a by \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hdiv(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half addition in round-to-nearest-even mode, with +* saturation to [0.0, 1.0]. +* +* \details Performs \p half add of inputs \p a and \p b, in round-to-nearest-even mode, +* and clamps the result to range [0.0, 1.0]. NaN results are flushed to +0.0. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \retval The sum of \p a and \p b, with respect to saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hadd_sat(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half subtraction in round-to-nearest-even mode, with +* saturation to [0.0, 1.0]. +* +* \details Subtracts \p half input \p b from input \p a in round-to-nearest +* mode, +* and clamps the result to range [0.0, 1.0]. NaN results are flushed to +0.0. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \retval The result of subtraction of \p b from \p a, with respect to saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hsub_sat(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half multiplication in round-to-nearest-even mode, with +* saturation to [0.0, 1.0]. +* +* \details Performs \p half multiplication of inputs \p a and \p b, in round-to-nearest +* mode, and clamps the result to range [0.0, 1.0]. NaN results are flushed to +* +0.0. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \retval The result of multiplying \p a and \p b, with respect to saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hmul_sat(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half fused multiply-add in round-to-nearest-even mode. +* +* \details Performs \p half multiply on inputs \p a and \p b, +* then performs a \p half add of the result with \p c, +* rounding the result once in round-to-nearest-even mode. +* \internal +* \req DEEPLEARN-SRM_REQ-96 +* \endinternal +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* \param[in] c - half. Is only being read. +* +* \returns half +* \retval The result of fused multiply-add operation on \p +* a, \p b, and \p c. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hfma(const __half a, const __half b, const __half c); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half fused multiply-add in round-to-nearest-even mode, +* with saturation to [0.0, 1.0]. +* +* \details Performs \p half multiply on inputs \p a and \p b, +* then performs a \p half add of the result with \p c, +* rounding the result once in round-to-nearest-even mode, and clamps the result +* to range [0.0, 1.0]. NaN results are flushed to +0.0. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* \param[in] c - half. Is only being read. +* +* \returns half +* \retval The result of fused multiply-add operation on \p +* a, \p b, and \p c, with respect to saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hfma_sat(const __half a, const __half b, const __half c); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Negates input \p half number and returns the result. +* +* \details Negates input \p half number and returns the result. +* \internal +* \req DEEPLEARN-SRM_REQ-100 +* \endinternal +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval minus a +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hneg(const __half a); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector if-equal comparison and returns boolean true +* iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector if-equal comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half if-equal comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of if-equal comparison +* of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbeq2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector not-equal comparison and returns boolean +* true iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector not-equal comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half not-equal comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of not-equal comparison +* of vectors \p a and \p b are true, +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbne2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector less-equal comparison and returns boolean +* true iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector less-equal comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half less-equal comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of less-equal comparison +* of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hble2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector greater-equal comparison and returns boolean +* true iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector greater-equal comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half greater-equal comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of greater-equal +* comparison of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbge2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector less-than comparison and returns boolean +* true iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector less-than comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half less-than comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of less-than comparison +* of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hblt2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector greater-than comparison and returns boolean +* true iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector greater-than comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half greater-than comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate false results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of greater-than +* comparison of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbgt2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered if-equal comparison and returns +* boolean true iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector if-equal comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half if-equal comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of unordered if-equal +* comparison of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbequ2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered not-equal comparison and returns +* boolean true iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector not-equal comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half not-equal comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of unordered not-equal +* comparison of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbneu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered less-equal comparison and returns +* boolean true iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector less-equal comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half less-equal comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of unordered less-equal +* comparison of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbleu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered greater-equal comparison and +* returns boolean true iff both \p half results are true, boolean false +* otherwise. +* +* \details Performs \p half2 vector greater-equal comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half greater-equal comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of unordered +* greater-equal comparison of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbgeu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered less-than comparison and returns +* boolean true iff both \p half results are true, boolean false otherwise. +* +* \details Performs \p half2 vector less-than comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half less-than comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of unordered less-than comparison of +* vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbltu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Performs \p half2 vector unordered greater-than comparison and +* returns boolean true iff both \p half results are true, boolean false +* otherwise. +* +* \details Performs \p half2 vector greater-than comparison of inputs \p a and \p b. +* The bool result is set to true only if both \p half greater-than comparisons +* evaluate to true, or false otherwise. +* NaN inputs generate true results. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns bool +* \retval true if both \p half results of unordered +* greater-than comparison of vectors \p a and \p b are true; +* \retval false otherwise. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hbgtu2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half if-equal comparison. +* +* \details Performs \p half if-equal comparison of inputs \p a and \p b. +* NaN inputs generate false results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of if-equal comparison of \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __heq(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half not-equal comparison. +* +* \details Performs \p half not-equal comparison of inputs \p a and \p b. +* NaN inputs generate false results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of not-equal comparison of \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hne(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half less-equal comparison. +* +* \details Performs \p half less-equal comparison of inputs \p a and \p b. +* NaN inputs generate false results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of less-equal comparison of \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hle(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half greater-equal comparison. +* +* \details Performs \p half greater-equal comparison of inputs \p a and \p b. +* NaN inputs generate false results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of greater-equal comparison of \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hge(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half less-than comparison. +* +* \details Performs \p half less-than comparison of inputs \p a and \p b. +* NaN inputs generate false results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of less-than comparison of \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hlt(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half greater-than comparison. +* +* \details Performs \p half greater-than comparison of inputs \p a and \p b. +* NaN inputs generate false results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of greater-than comparison of \p a and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hgt(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half unordered if-equal comparison. +* +* \details Performs \p half if-equal comparison of inputs \p a and \p b. +* NaN inputs generate true results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of unordered if-equal comparison of \p a and +* \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hequ(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half unordered not-equal comparison. +* +* \details Performs \p half not-equal comparison of inputs \p a and \p b. +* NaN inputs generate true results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of unordered not-equal comparison of \p a and +* \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hneu(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half unordered less-equal comparison. +* +* \details Performs \p half less-equal comparison of inputs \p a and \p b. +* NaN inputs generate true results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of unordered less-equal comparison of \p a and +* \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hleu(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half unordered greater-equal comparison. +* +* \details Performs \p half greater-equal comparison of inputs \p a and \p b. +* NaN inputs generate true results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of unordered greater-equal comparison of \p a +* and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hgeu(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half unordered less-than comparison. +* +* \details Performs \p half less-than comparison of inputs \p a and \p b. +* NaN inputs generate true results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of unordered less-than comparison of \p a and +* \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hltu(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Performs \p half unordered greater-than comparison. +* +* \details Performs \p half greater-than comparison of inputs \p a and \p b. +* NaN inputs generate true results. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns bool +* \retval The boolean result of unordered greater-than comparison of \p a +* and \p b. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hgtu(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Determine whether \p half argument is a NaN. +* +* \details Determine whether \p half value \p a is a NaN. +* \param[in] a - half. Is only being read. +* +* \returns bool +* \retval true iff argument is NaN. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ bool __hisnan(const __half a); +#if __CUDA_ARCH__ >= 800 || !defined(__CUDA_ARCH__) +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Calculates \p half maximum of two input values. +* +* \details Calculates \p half max(\p a, \p b) +* defined as (\p a > \p b) ? \p a : \p b. +* - If either of inputs is NaN, the other input is returned. +* - If both inputs are NaNs, then canonical NaN is returned. +* - If values of both inputs are 0.0, then +0.0 > -0.0 +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hmax(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Calculates \p half minimum of two input values. +* +* \details Calculates \p half min(\p a, \p b) +* defined as (\p a < \p b) ? \p a : \p b. +* - If either of inputs is NaN, the other input is returned. +* - If both inputs are NaNs, then canonical NaN is returned. +* - If values of both inputs are 0.0, then +0.0 > -0.0 +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hmin(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Calculates \p half maximum of two input values, NaNs pass through. +* +* \details Calculates \p half max(\p a, \p b) +* defined as (\p a > \p b) ? \p a : \p b. +* - If either of inputs is NaN, then canonical NaN is returned. +* - If values of both inputs are 0.0, then +0.0 > -0.0 +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hmax_nan(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_COMPARISON +* \brief Calculates \p half minimum of two input values, NaNs pass through. +* +* \details Calculates \p half min(\p a, \p b) +* defined as (\p a < \p b) ? \p a : \p b. +* - If either of inputs is NaN, then canonical NaN is returned. +* - If values of both inputs are 0.0, then +0.0 > -0.0 +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* +* \returns half +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hmin_nan(const __half a, const __half b); +/** +* \ingroup CUDA_MATH__HALF_ARITHMETIC +* \brief Performs \p half fused multiply-add in round-to-nearest-even mode with relu saturation. +* +* \details Performs \p half multiply on inputs \p a and \p b, +* then performs a \p half add of the result with \p c, +* rounding the result once in round-to-nearest-even mode. +* Then negative result is clamped to 0. +* NaN result is converted to canonical NaN. +* \param[in] a - half. Is only being read. +* \param[in] b - half. Is only being read. +* \param[in] c - half. Is only being read. +* +* \returns half +* \retval The result of fused multiply-add operation on \p +* a, \p b, and \p c with relu saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half __hfma_relu(const __half a, const __half b, const __half c); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Calculates \p half2 vector maximum of two inputs. +* +* \details Calculates \p half2 vector max(\p a, \p b). +* Elementwise \p half operation is defined as +* (\p a > \p b) ? \p a : \p b. +* - If either of inputs is NaN, the other input is returned. +* - If both inputs are NaNs, then canonical NaN is returned. +* - If values of both inputs are 0.0, then +0.0 > -0.0 +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The result of elementwise maximum of vectors \p a and \p b +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hmax2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Calculates \p half2 vector minimum of two inputs. +* +* \details Calculates \p half2 vector min(\p a, \p b). +* Elementwise \p half operation is defined as +* (\p a < \p b) ? \p a : \p b. +* - If either of inputs is NaN, the other input is returned. +* - If both inputs are NaNs, then canonical NaN is returned. +* - If values of both inputs are 0.0, then +0.0 > -0.0 +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The result of elementwise minimum of vectors \p a and \p b +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hmin2(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Calculates \p half2 vector maximum of two inputs, NaNs pass through. +* +* \details Calculates \p half2 vector max(\p a, \p b). +* Elementwise \p half operation is defined as +* (\p a > \p b) ? \p a : \p b. +* - If either of inputs is NaN, then canonical NaN is returned. +* - If values of both inputs are 0.0, then +0.0 > -0.0 +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The result of elementwise maximum of vectors \p a and \p b, with NaNs pass through +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hmax2_nan(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_COMPARISON +* \brief Calculates \p half2 vector minimum of two inputs, NaNs pass through. +* +* \details Calculates \p half2 vector min(\p a, \p b). +* Elementwise \p half operation is defined as +* (\p a < \p b) ? \p a : \p b. +* - If either of inputs is NaN, then canonical NaN is returned. +* - If values of both inputs are 0.0, then +0.0 > -0.0 +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* +* \returns half2 +* \retval The result of elementwise minimum of vectors \p a and \p b, with NaNs pass through +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hmin2_nan(const __half2 a, const __half2 b); +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs \p half2 vector fused multiply-add in round-to-nearest-even +* mode with relu saturation. +* +* \details Performs \p half2 vector multiply on inputs \p a and \p b, +* then performs a \p half2 vector add of the result with \p c, +* rounding the result once in round-to-nearest-even mode. +* Then negative result is clamped to 0. +* NaN result is converted to canonical NaN. +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* \param[in] c - half2. Is only being read. +* +* \returns half2 +* \retval The result of elementwise fused multiply-add operation on vectors \p a, \p b, and \p c with relu saturation. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hfma2_relu(const __half2 a, const __half2 b, const __half2 c); +#endif /*__CUDA_ARCH__ >= 800 || !defined(__CUDA_ARCH__)*/ +/** +* \ingroup CUDA_MATH__HALF2_ARITHMETIC +* \brief Performs fast complex multiply-accumulate +* +* \details Interprets vector \p half2 input pairs \p a, \p b, and \p c as +* complex numbers in \p half precision and performs +* complex multiply-accumulate operation: a*b + c +* \param[in] a - half2. Is only being read. +* \param[in] b - half2. Is only being read. +* \param[in] c - half2. Is only being read. +* +* \returns half2 +* \retval The result of complex multiply-accumulate operation on complex numbers \p a, \p b, and \p c +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 __hcmadd(const __half2 a, const __half2 b, const __half2 c); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half square root in round-to-nearest-even mode. +* +* \details Calculates \p half square root of input \p a in round-to-nearest-even mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The square root of \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hsqrt(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half reciprocal square root in round-to-nearest-even +* mode. +* +* \details Calculates \p half reciprocal square root of input \p a in round-to-nearest +* mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The reciprocal square root of \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hrsqrt(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half reciprocal in round-to-nearest-even mode. +* +* \details Calculates \p half reciprocal of input \p a in round-to-nearest-even mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The reciprocal of \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hrcp(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half natural logarithm in round-to-nearest-even mode. +* +* \details Calculates \p half natural logarithm of input \p a in round-to-nearest-even +* mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The natural logarithm of \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hlog(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half binary logarithm in round-to-nearest-even mode. +* +* \details Calculates \p half binary logarithm of input \p a in round-to-nearest-even +* mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The binary logarithm of \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hlog2(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half decimal logarithm in round-to-nearest-even mode. +* +* \details Calculates \p half decimal logarithm of input \p a in round-to-nearest-even +* mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The decimal logarithm of \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hlog10(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half natural exponential function in round-to-nearest +* mode. +* +* \details Calculates \p half natural exponential function of input \p a in +* round-to-nearest-even mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The natural exponential function on \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hexp(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half binary exponential function in round-to-nearest +* mode. +* +* \details Calculates \p half binary exponential function of input \p a in +* round-to-nearest-even mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The binary exponential function on \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hexp2(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half decimal exponential function in round-to-nearest +* mode. +* +* \details Calculates \p half decimal exponential function of input \p a in +* round-to-nearest-even mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The decimal exponential function on \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hexp10(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half cosine in round-to-nearest-even mode. +* +* \details Calculates \p half cosine of input \p a in round-to-nearest-even mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The cosine of \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hcos(const __half a); +/** +* \ingroup CUDA_MATH__HALF_FUNCTIONS +* \brief Calculates \p half sine in round-to-nearest-even mode. +* +* \details Calculates \p half sine of input \p a in round-to-nearest-even mode. +* \param[in] a - half. Is only being read. +* +* \returns half +* \retval The sine of \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half hsin(const __half a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector square root in round-to-nearest-even mode. +* +* \details Calculates \p half2 square root of input vector \p a in round-to-nearest +* mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise square root on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2sqrt(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector reciprocal square root in round-to-nearest +* mode. +* +* \details Calculates \p half2 reciprocal square root of input vector \p a in +* round-to-nearest-even mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise reciprocal square root on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2rsqrt(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector reciprocal in round-to-nearest-even mode. +* +* \details Calculates \p half2 reciprocal of input vector \p a in round-to-nearest-even +* mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise reciprocal on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2rcp(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector natural logarithm in round-to-nearest-even +* mode. +* +* \details Calculates \p half2 natural logarithm of input vector \p a in +* round-to-nearest-even mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise natural logarithm on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2log(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector binary logarithm in round-to-nearest-even +* mode. +* +* \details Calculates \p half2 binary logarithm of input vector \p a in round-to-nearest +* mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise binary logarithm on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2log2(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector decimal logarithm in round-to-nearest-even +* mode. +* +* \details Calculates \p half2 decimal logarithm of input vector \p a in +* round-to-nearest-even mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise decimal logarithm on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2log10(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector exponential function in round-to-nearest +* mode. +* +* \details Calculates \p half2 exponential function of input vector \p a in +* round-to-nearest-even mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise exponential function on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2exp(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector binary exponential function in +* round-to-nearest-even mode. +* +* \details Calculates \p half2 binary exponential function of input vector \p a in +* round-to-nearest-even mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise binary exponential function on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2exp2(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector decimal exponential function in +* round-to-nearest-even mode. +* +* \details Calculates \p half2 decimal exponential function of input vector \p a in +* round-to-nearest-even mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise decimal exponential function on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2exp10(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector cosine in round-to-nearest-even mode. +* +* \details Calculates \p half2 cosine of input vector \p a in round-to-nearest-even +* mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise cosine on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2cos(const __half2 a); +/** +* \ingroup CUDA_MATH__HALF2_FUNCTIONS +* \brief Calculates \p half2 vector sine in round-to-nearest-even mode. +* +* \details Calculates \p half2 sine of input vector \p a in round-to-nearest-even mode. +* \param[in] a - half2. Is only being read. +* +* \returns half2 +* \retval The elementwise sine on vector \p a. +* \internal +* \exception-guarantee no-throw guarantee +* \behavior reentrant, thread safe +* \endinternal +*/ +__CUDA_FP16_DECL__ __half2 h2sin(const __half2 a); + +#endif /*if __CUDA_ARCH__ >= 530 || !defined(__CUDA_ARCH__)*/ + +#if __CUDA_ARCH__ >= 600 || !defined(__CUDA_ARCH__) + +__CUDA_FP16_DECL__ __half2 atomicAdd(__half2 *const address, const __half2 val); + +#endif /*if __CUDA_ARCH__ >= 600 || !defined(__CUDA_ARCH__)*/ + +#if __CUDA_ARCH__ >= 700 || !defined(__CUDA_ARCH__) + +__CUDA_FP16_DECL__ __half atomicAdd(__half *const address, const __half val); + +#endif /*if __CUDA_ARCH__ >= 700 || !defined(__CUDA_ARCH__)*/ + +#endif /* defined(__CUDACC__) */ + +#undef __CUDA_FP16_DECL__ +#undef __CUDA_HOSTDEVICE_FP16_DECL__ + +#endif /* defined(__cplusplus) */ + +/* Note the .hpp file is included even for host-side compilation, to capture the "half" & "half2" definitions */ +#include "cuda_fp16.hpp" + +#endif /* end of include guard: __CUDA_FP16_H__ */ diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cuda_fp16.hpp b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cuda_fp16.hpp new file mode 100644 index 0000000000000000000000000000000000000000..19bbd3412d52b6df05404313cdc7ce3699beaaf3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cuda_fp16.hpp @@ -0,0 +1,2465 @@ +/* +* Copyright 1993-2020 NVIDIA Corporation. All rights reserved. +* +* NOTICE TO LICENSEE: +* +* This source code and/or documentation ("Licensed Deliverables") are +* subject to NVIDIA intellectual property rights under U.S. and +* international Copyright laws. +* +* These Licensed Deliverables contained herein is PROPRIETARY and +* CONFIDENTIAL to NVIDIA and is being provided under the terms and +* conditions of a form of NVIDIA software license agreement by and +* between NVIDIA and Licensee ("License Agreement") or electronically +* accepted by Licensee. Notwithstanding any terms or conditions to +* the contrary in the License Agreement, reproduction or disclosure +* of the Licensed Deliverables to any third party without the express +* written consent of NVIDIA is prohibited. +* +* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE +* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE +* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS +* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. +* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED +* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, +* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. +* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE +* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY +* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY +* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +* OF THESE LICENSED DELIVERABLES. +* +* U.S. Government End Users. These Licensed Deliverables are a +* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT +* 1995), consisting of "commercial computer software" and "commercial +* computer software documentation" as such terms are used in 48 +* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government +* only as a commercial end item. Consistent with 48 C.F.R.12.212 and +* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all +* U.S. Government End Users acquire the Licensed Deliverables with +* only those rights set forth herein. +* +* Any use of the Licensed Deliverables in individual and commercial +* software must include, in the user documentation and internal +* comments to the code, the above Disclaimer and U.S. Government End +* Users Notice. +*/ + +#if !defined(__CUDA_FP16_HPP__) +#define __CUDA_FP16_HPP__ + +#if !defined(__CUDA_FP16_H__) +#error "Do not include this file directly. Instead, include cuda_fp16.h." +#endif + +#if !defined(_MSC_VER) && __cplusplus >= 201103L +# define __CPP_VERSION_AT_LEAST_11_FP16 +#elif _MSC_FULL_VER >= 190024210 && _MSVC_LANG >= 201103L +# define __CPP_VERSION_AT_LEAST_11_FP16 +#endif + +/* C++11 header for std::move. + * In RTC mode, std::move is provided implicitly; don't include the header + */ +#if defined(__CPP_VERSION_AT_LEAST_11_FP16) && !defined(__CUDACC_RTC__) +#include +#endif /* __cplusplus >= 201103L && !defined(__CUDACC_RTC__) */ + +/* C++ header for std::memcpy (used for type punning in host-side implementations). + * When compiling as a CUDA source file memcpy is provided implicitly. + * !defined(__CUDACC__) implies !defined(__CUDACC_RTC__). + */ +#if defined(__cplusplus) && !defined(__CUDACC__) +#include +#endif /* defined(__cplusplus) && !defined(__CUDACC__) */ + + +/* Set up function decorations */ +#if defined(__CUDACC__) +#define __CUDA_FP16_DECL__ static __device__ __inline__ +#define __CUDA_HOSTDEVICE_FP16_DECL__ static __host__ __device__ __inline__ +#define __VECTOR_FUNCTIONS_DECL__ static __inline__ __host__ __device__ +#define __CUDA_HOSTDEVICE__ __host__ __device__ +#else /* !defined(__CUDACC__) */ +#if defined(__GNUC__) +#define __CUDA_HOSTDEVICE_FP16_DECL__ static __attribute__ ((unused)) +#else +#define __CUDA_HOSTDEVICE_FP16_DECL__ static +#endif /* defined(__GNUC__) */ +#define __CUDA_HOSTDEVICE__ +#endif /* defined(__CUDACC_) */ + +/* Set up structure-alignment attribute */ +#if defined(__CUDACC__) +#define __CUDA_ALIGN__(align) __align__(align) +#else +/* Define alignment macro based on compiler type (cannot assume C11 "_Alignas" is available) */ +#if __cplusplus >= 201103L +#define __CUDA_ALIGN__(n) alignas(n) /* C++11 kindly gives us a keyword for this */ +#else /* !defined(__CPP_VERSION_AT_LEAST_11_FP16)*/ +#if defined(__GNUC__) +#define __CUDA_ALIGN__(n) __attribute__ ((aligned(n))) +#elif defined(_MSC_VER) +#define __CUDA_ALIGN__(n) __declspec(align(n)) +#else +#define __CUDA_ALIGN__(n) +#endif /* defined(__GNUC__) */ +#endif /* defined(__CPP_VERSION_AT_LEAST_11_FP16) */ +#endif /* defined(__CUDACC__) */ + +/* Macros to allow half & half2 to be used by inline assembly */ +#define __HALF_TO_US(var) *(reinterpret_cast(&(var))) +#define __HALF_TO_CUS(var) *(reinterpret_cast(&(var))) +#define __HALF2_TO_UI(var) *(reinterpret_cast(&(var))) +#define __HALF2_TO_CUI(var) *(reinterpret_cast(&(var))) + +/* Macros for half & half2 binary arithmetic */ +#define __BINARY_OP_HALF_MACRO(name) /* do */ {\ + __half val; \ + asm( "{"#name".f16 %0,%1,%2;\n}" \ + :"=h"(__HALF_TO_US(val)) : "h"(__HALF_TO_CUS(a)),"h"(__HALF_TO_CUS(b))); \ + return val; \ +} /* while(0) */ +#define __BINARY_OP_HALF2_MACRO(name) /* do */ {\ + __half2 val; \ + asm( "{"#name".f16x2 %0,%1,%2;\n}" \ + :"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a)),"r"(__HALF2_TO_CUI(b))); \ + return val; \ +} /* while(0) */ +#define __TERNARY_OP_HALF_MACRO(name) /* do */ {\ + __half val; \ + asm( "{"#name".f16 %0,%1,%2,%3;\n}" \ + :"=h"(__HALF_TO_US(val)) : "h"(__HALF_TO_CUS(a)),"h"(__HALF_TO_CUS(b)),"h"(__HALF_TO_CUS(c))); \ + return val; \ +} /* while(0) */ +#define __TERNARY_OP_HALF2_MACRO(name) /* do */ {\ + __half2 val; \ + asm( "{"#name".f16x2 %0,%1,%2,%3;\n}" \ + :"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a)),"r"(__HALF2_TO_CUI(b)),"r"(__HALF2_TO_CUI(c))); \ + return val; \ +} /* while(0) */ + +/** +* Types which allow static initialization of "half" and "half2" until +* these become an actual builtin. Note this initialization is as a +* bitfield representation of "half", and not a conversion from short->half. +* Such a representation will be deprecated in a future version of CUDA. +* (Note these are visible to non-nvcc compilers, including C-only compilation) +*/ +typedef struct __CUDA_ALIGN__(2) { + unsigned short x; +} __half_raw; + +typedef struct __CUDA_ALIGN__(4) { + unsigned short x; + unsigned short y; +} __half2_raw; + +/* All other definitions in this file are only visible to C++ compilers */ +#if defined(__cplusplus) + +/* Hide GCC member initialization list warnings because of host/device in-function init requirement */ +#if defined(__GNUC__) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Weffc++" +#endif /* __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) */ +#endif /* defined(__GNUC__) */ + +/* class' : multiple assignment operators specified + The class has multiple assignment operators of a single type. This warning is informational */ +#if defined(_MSC_VER) && _MSC_VER >= 1500 +#pragma warning( push ) +#pragma warning( disable:4522 ) +#endif /* defined(__GNUC__) */ + +struct __CUDA_ALIGN__(2) __half { +protected: + unsigned short __x; + +public: +#if defined(__CPP_VERSION_AT_LEAST_11_FP16) + __half() = default; +#else + __CUDA_HOSTDEVICE__ __half() { } +#endif /* defined(__CPP_VERSION_AT_LEAST_11_FP16) */ + + /* Convert to/from __half_raw */ + __CUDA_HOSTDEVICE__ __half(const __half_raw &hr) : __x(hr.x) { } + __CUDA_HOSTDEVICE__ __half &operator=(const __half_raw &hr) { __x = hr.x; return *this; } + __CUDA_HOSTDEVICE__ volatile __half &operator=(const __half_raw &hr) volatile { __x = hr.x; return *this; } + __CUDA_HOSTDEVICE__ volatile __half &operator=(const volatile __half_raw &hr) volatile { __x = hr.x; return *this; } + __CUDA_HOSTDEVICE__ operator __half_raw() const { __half_raw ret; ret.x = __x; return ret; } + __CUDA_HOSTDEVICE__ operator __half_raw() const volatile { __half_raw ret; ret.x = __x; return ret; } + +#if !defined(__CUDA_NO_HALF_CONVERSIONS__) + + /* Construct from float/double */ + __CUDA_HOSTDEVICE__ __half(const float f) { __x = __float2half(f).__x; } + __CUDA_HOSTDEVICE__ __half(const double f) { __x = __double2half(f).__x; } + + __CUDA_HOSTDEVICE__ operator float() const { return __half2float(*this); } + __CUDA_HOSTDEVICE__ __half &operator=(const float f) { __x = __float2half(f).__x; return *this; } + + /* We omit "cast to double" operator, so as to not be ambiguous about up-cast */ + __CUDA_HOSTDEVICE__ __half &operator=(const double f) { __x = __double2half(f).__x; return *this; } + +/* Member functions only available to nvcc compilation so far */ +#if defined(__CUDACC__) + /* Allow automatic construction from types supported natively in hardware */ + /* Note we do avoid constructor init-list because of special host/device compilation rules */ + __CUDA_HOSTDEVICE__ __half(const short val) { __x = __short2half_rn(val).__x; } + __CUDA_HOSTDEVICE__ __half(const unsigned short val) { __x = __ushort2half_rn(val).__x; } + __CUDA_HOSTDEVICE__ __half(const int val) { __x = __int2half_rn(val).__x; } + __CUDA_HOSTDEVICE__ __half(const unsigned int val) { __x = __uint2half_rn(val).__x; } + __CUDA_HOSTDEVICE__ __half(const long long val) { __x = __ll2half_rn(val).__x; } + __CUDA_HOSTDEVICE__ __half(const unsigned long long val) { __x = __ull2half_rn(val).__x; } + + /* Allow automatic casts to supported builtin types, matching all that are permitted with float */ + __CUDA_HOSTDEVICE__ operator short() const { return __half2short_rz(*this); } + __CUDA_HOSTDEVICE__ __half &operator=(const short val) { __x = __short2half_rn(val).__x; return *this; } + + __CUDA_HOSTDEVICE__ operator unsigned short() const { return __half2ushort_rz(*this); } + __CUDA_HOSTDEVICE__ __half &operator=(const unsigned short val) { __x = __ushort2half_rn(val).__x; return *this; } + + __CUDA_HOSTDEVICE__ operator int() const { return __half2int_rz(*this); } + __CUDA_HOSTDEVICE__ __half &operator=(const int val) { __x = __int2half_rn(val).__x; return *this; } + + __CUDA_HOSTDEVICE__ operator unsigned int() const { return __half2uint_rz(*this); } + __CUDA_HOSTDEVICE__ __half &operator=(const unsigned int val) { __x = __uint2half_rn(val).__x; return *this; } + + __CUDA_HOSTDEVICE__ operator long long() const { return __half2ll_rz(*this); } + __CUDA_HOSTDEVICE__ __half &operator=(const long long val) { __x = __ll2half_rn(val).__x; return *this; } + + __CUDA_HOSTDEVICE__ operator unsigned long long() const { return __half2ull_rz(*this); } + __CUDA_HOSTDEVICE__ __half &operator=(const unsigned long long val) { __x = __ull2half_rn(val).__x; return *this; } + + /* Boolean conversion - note both 0 and -0 must return false */ + __CUDA_HOSTDEVICE__ operator bool() const { return (__x & 0x7FFFU) != 0U; } +#endif /* defined(__CUDACC__) */ +#endif /* !defined(__CUDA_NO_HALF_CONVERSIONS__) */ +}; + +/* Global-space operator functions are only available to nvcc compilation */ +#if defined(__CUDACC__) + +/* Arithmetic FP16 operations only supported on arch >= 5.3 */ +#if __CUDA_ARCH__ >= 530 || !defined(__CUDA_ARCH__) +#if !defined(__CUDA_NO_HALF_OPERATORS__) +/* Some basic arithmetic operations expected of a builtin */ +__device__ __forceinline__ __half operator+(const __half &lh, const __half &rh) { return __hadd(lh, rh); } +__device__ __forceinline__ __half operator-(const __half &lh, const __half &rh) { return __hsub(lh, rh); } +__device__ __forceinline__ __half operator*(const __half &lh, const __half &rh) { return __hmul(lh, rh); } +__device__ __forceinline__ __half operator/(const __half &lh, const __half &rh) { return __hdiv(lh, rh); } + +__device__ __forceinline__ __half &operator+=(__half &lh, const __half &rh) { lh = __hadd(lh, rh); return lh; } +__device__ __forceinline__ __half &operator-=(__half &lh, const __half &rh) { lh = __hsub(lh, rh); return lh; } +__device__ __forceinline__ __half &operator*=(__half &lh, const __half &rh) { lh = __hmul(lh, rh); return lh; } +__device__ __forceinline__ __half &operator/=(__half &lh, const __half &rh) { lh = __hdiv(lh, rh); return lh; } + +/* Note for increment and decrement we use the raw value 0x3C00U equating to half(1.0F), to avoid the extra conversion */ +__device__ __forceinline__ __half &operator++(__half &h) { __half_raw one; one.x = 0x3C00U; h += one; return h; } +__device__ __forceinline__ __half &operator--(__half &h) { __half_raw one; one.x = 0x3C00U; h -= one; return h; } +__device__ __forceinline__ __half operator++(__half &h, const int ignored) { const __half ret = h; __half_raw one; one.x = 0x3C00U; h += one; return ret; } +__device__ __forceinline__ __half operator--(__half &h, const int ignored) { const __half ret = h; __half_raw one; one.x = 0x3C00U; h -= one; return ret; } + +/* Unary plus and inverse operators */ +__device__ __forceinline__ __half operator+(const __half &h) { return h; } +__device__ __forceinline__ __half operator-(const __half &h) { return __hneg(h); } + +/* Some basic comparison operations to make it look like a builtin */ +__device__ __forceinline__ bool operator==(const __half &lh, const __half &rh) { return __heq(lh, rh); } +__device__ __forceinline__ bool operator!=(const __half &lh, const __half &rh) { return __hneu(lh, rh); } +__device__ __forceinline__ bool operator> (const __half &lh, const __half &rh) { return __hgt(lh, rh); } +__device__ __forceinline__ bool operator< (const __half &lh, const __half &rh) { return __hlt(lh, rh); } +__device__ __forceinline__ bool operator>=(const __half &lh, const __half &rh) { return __hge(lh, rh); } +__device__ __forceinline__ bool operator<=(const __half &lh, const __half &rh) { return __hle(lh, rh); } +#endif /* !defined(__CUDA_NO_HALF_OPERATORS__) */ +#endif /* __CUDA_ARCH__ >= 530 || !defined(__CUDA_ARCH__) */ +#endif /* defined(__CUDACC__) */ + +/* __half2 is visible to non-nvcc host compilers */ +struct __CUDA_ALIGN__(4) __half2 { + __half x; + __half y; + + // All construct/copy/assign/move +public: +#if defined(__CPP_VERSION_AT_LEAST_11_FP16) + __half2() = default; + __CUDA_HOSTDEVICE__ __half2(const __half2 &&src) { __HALF2_TO_UI(*this) = std::move(__HALF2_TO_CUI(src)); } + __CUDA_HOSTDEVICE__ __half2 &operator=(const __half2 &&src) { __HALF2_TO_UI(*this) = std::move(__HALF2_TO_CUI(src)); return *this; } +#else + __CUDA_HOSTDEVICE__ __half2() { } +#endif /* defined(__CPP_VERSION_AT_LEAST_11_FP16) */ + __CUDA_HOSTDEVICE__ __half2(const __half &a, const __half &b) : x(a), y(b) { } + __CUDA_HOSTDEVICE__ __half2(const __half2 &src) { __HALF2_TO_UI(*this) = __HALF2_TO_CUI(src); } + __CUDA_HOSTDEVICE__ __half2 &operator=(const __half2 &src) { __HALF2_TO_UI(*this) = __HALF2_TO_CUI(src); return *this; } + + /* Convert to/from __half2_raw */ + __CUDA_HOSTDEVICE__ __half2(const __half2_raw &h2r ) { __HALF2_TO_UI(*this) = __HALF2_TO_CUI(h2r); } + __CUDA_HOSTDEVICE__ __half2 &operator=(const __half2_raw &h2r) { __HALF2_TO_UI(*this) = __HALF2_TO_CUI(h2r); return *this; } + __CUDA_HOSTDEVICE__ operator __half2_raw() const { __half2_raw ret; ret.x = 0U; ret.y = 0U; __HALF2_TO_UI(ret) = __HALF2_TO_CUI(*this); return ret; } +}; + +/* Global-space operator functions are only available to nvcc compilation */ +#if defined(__CUDACC__) + +/* Arithmetic FP16x2 operations only supported on arch >= 5.3 */ +#if (__CUDA_ARCH__ >= 530 || !defined(__CUDA_ARCH__)) && !defined(__CUDA_NO_HALF2_OPERATORS__) + +__device__ __forceinline__ __half2 operator+(const __half2 &lh, const __half2 &rh) { return __hadd2(lh, rh); } +__device__ __forceinline__ __half2 operator-(const __half2 &lh, const __half2 &rh) { return __hsub2(lh, rh); } +__device__ __forceinline__ __half2 operator*(const __half2 &lh, const __half2 &rh) { return __hmul2(lh, rh); } +__device__ __forceinline__ __half2 operator/(const __half2 &lh, const __half2 &rh) { return __h2div(lh, rh); } + +__device__ __forceinline__ __half2& operator+=(__half2 &lh, const __half2 &rh) { lh = __hadd2(lh, rh); return lh; } +__device__ __forceinline__ __half2& operator-=(__half2 &lh, const __half2 &rh) { lh = __hsub2(lh, rh); return lh; } +__device__ __forceinline__ __half2& operator*=(__half2 &lh, const __half2 &rh) { lh = __hmul2(lh, rh); return lh; } +__device__ __forceinline__ __half2& operator/=(__half2 &lh, const __half2 &rh) { lh = __h2div(lh, rh); return lh; } + +__device__ __forceinline__ __half2 &operator++(__half2 &h) { __half2_raw one; one.x = 0x3C00U; one.y = 0x3C00U; h = __hadd2(h, one); return h; } +__device__ __forceinline__ __half2 &operator--(__half2 &h) { __half2_raw one; one.x = 0x3C00U; one.y = 0x3C00U; h = __hsub2(h, one); return h; } +__device__ __forceinline__ __half2 operator++(__half2 &h, const int ignored) { const __half2 ret = h; __half2_raw one; one.x = 0x3C00U; one.y = 0x3C00U; h = __hadd2(h, one); return ret; } +__device__ __forceinline__ __half2 operator--(__half2 &h, const int ignored) { const __half2 ret = h; __half2_raw one; one.x = 0x3C00U; one.y = 0x3C00U; h = __hsub2(h, one); return ret; } + +__device__ __forceinline__ __half2 operator+(const __half2 &h) { return h; } +__device__ __forceinline__ __half2 operator-(const __half2 &h) { return __hneg2(h); } + +__device__ __forceinline__ bool operator==(const __half2 &lh, const __half2 &rh) { return __hbeq2(lh, rh); } +__device__ __forceinline__ bool operator!=(const __half2 &lh, const __half2 &rh) { return __hbneu2(lh, rh); } +__device__ __forceinline__ bool operator>(const __half2 &lh, const __half2 &rh) { return __hbgt2(lh, rh); } +__device__ __forceinline__ bool operator<(const __half2 &lh, const __half2 &rh) { return __hblt2(lh, rh); } +__device__ __forceinline__ bool operator>=(const __half2 &lh, const __half2 &rh) { return __hbge2(lh, rh); } +__device__ __forceinline__ bool operator<=(const __half2 &lh, const __half2 &rh) { return __hble2(lh, rh); } + +#endif /* __CUDA_ARCH__ >= 530 || !defined(__CUDA_ARCH__) */ +#endif /* defined(__CUDACC__) */ + +/* Restore warning for multiple assignment operators */ +#if defined(_MSC_VER) && _MSC_VER >= 1500 +#pragma warning( pop ) +#endif /* defined(_MSC_VER) && _MSC_VER >= 1500 */ + +/* Restore -Weffc++ warnings from here on */ +#if defined(__GNUC__) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic pop +#endif /* __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) */ +#endif /* defined(__GNUC__) */ + +#undef __CUDA_HOSTDEVICE__ +#undef __CUDA_ALIGN__ + +#ifndef __CUDACC_RTC__ /* no host functions in NVRTC mode */ +static inline unsigned short __internal_float2half(const float f, unsigned int &sign, unsigned int &remainder) +{ + unsigned int x; + unsigned int u; + unsigned int result; +#if defined(__CUDACC__) + (void)memcpy(&x, &f, sizeof(f)); +#else + (void)std::memcpy(&x, &f, sizeof(f)); +#endif + u = (x & 0x7fffffffU); + sign = ((x >> 16U) & 0x8000U); + // NaN/+Inf/-Inf + if (u >= 0x7f800000U) { + remainder = 0U; + result = ((u == 0x7f800000U) ? (sign | 0x7c00U) : 0x7fffU); + } else if (u > 0x477fefffU) { // Overflows + remainder = 0x80000000U; + result = (sign | 0x7bffU); + } else if (u >= 0x38800000U) { // Normal numbers + remainder = u << 19U; + u -= 0x38000000U; + result = (sign | (u >> 13U)); + } else if (u < 0x33000001U) { // +0/-0 + remainder = u; + result = sign; + } else { // Denormal numbers + const unsigned int exponent = u >> 23U; + const unsigned int shift = 0x7eU - exponent; + unsigned int mantissa = (u & 0x7fffffU); + mantissa |= 0x800000U; + remainder = mantissa << (32U - shift); + result = (sign | (mantissa >> shift)); + } + return static_cast(result); +} +#endif /* #if !defined(__CUDACC_RTC__) */ + +__CUDA_HOSTDEVICE_FP16_DECL__ __half __double2half(const double a) +{ +#if defined(__CUDA_ARCH__) + __half val; + asm("{ cvt.rn.f16.f64 %0, %1;}\n" : "=h"(__HALF_TO_US(val)) : "d"(a)); + return val; +#else + __half result; + // Perform rounding to 11 bits of precision, convert value + // to float and call existing float to half conversion. + // By pre-rounding to 11 bits we avoid additional rounding + // in float to half conversion. + unsigned long long int absa; + unsigned long long int ua; + #if defined(__CUDACC__) + (void)memcpy(&ua, &a, sizeof(a)); + #else + (void)std::memcpy(&ua, &a, sizeof(a)); + #endif + absa = (ua & 0x7fffffffffffffffULL); + if ((absa >= 0x40f0000000000000ULL) || (absa <= 0x3e60000000000000ULL)) + { + // |a| >= 2^16 or NaN or |a| <= 2^(-25) + // double-rounding is not a problem + result = __float2half(static_cast(a)); + } + else + { + // here 2^(-25) < |a| < 2^16 + // prepare shifter value such that a + shifter + // done in double precision performs round-to-nearest-even + // and (a + shifter) - shifter results in a rounded to + // 11 bits of precision. Shifter needs to have exponent of + // a plus 53 - 11 = 42 and a leading bit in mantissa to guard + // against negative values. + // So need to have |a| capped to avoid overflow in exponent. + // For inputs that are smaller than half precision minnorm + // we prepare fixed shifter exponent. + unsigned long long shifterBits; + if (absa >= 0x3f10000000000000ULL) + { // Here if |a| >= 2^(-14) + // add 42 to exponent bits + shifterBits = (ua & 0x7ff0000000000000ULL) + 0x02A0000000000000ULL; + } + else + { // 2^(-25) < |a| < 2^(-14), potentially results in denormal + // set exponent bits to 42 - 14 + bias + shifterBits = 0x41B0000000000000ULL; + } + // set leading mantissa bit to protect against negative inputs + shifterBits |= 0x0008000000000000ULL; + double shifter; + #if defined(__CUDACC__) + (void)memcpy(&shifter, &shifterBits, sizeof(shifterBits)); + #else + (void)std::memcpy(&shifter, &shifterBits, sizeof(shifterBits)); + #endif + double aShiftRound = a + shifter; + + // Prevent the compiler from optimizing away a + shifter - shifter + // by doing intermediate memcopy and harmless bitwize operation + unsigned long long int aShiftRoundBits; + #if defined(__CUDACC__) + (void)memcpy(&aShiftRoundBits, &aShiftRound, sizeof(aShiftRound)); + #else + (void)std::memcpy(&aShiftRoundBits, &aShiftRound, sizeof(aShiftRound)); + #endif + + // the value is positive, so this operation doesn't change anything + aShiftRoundBits &= 0x7fffffffffffffffULL; + + #if defined(__CUDACC__) + (void)memcpy(&aShiftRound, &aShiftRoundBits, sizeof(aShiftRound)); + #else + (void)std::memcpy(&aShiftRound, &aShiftRoundBits, sizeof(aShiftRound)); + #endif + + result = __float2half(static_cast(aShiftRound - shifter)); + } + + return result; +#endif +} + +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half(const float a) +{ + __half val; +#if defined(__CUDA_ARCH__) + asm("{ cvt.rn.f16.f32 %0, %1;}\n" : "=h"(__HALF_TO_US(val)) : "f"(a)); +#else + __half_raw r; + unsigned int sign = 0U; + unsigned int remainder = 0U; + r.x = __internal_float2half(a, sign, remainder); + if ((remainder > 0x80000000U) || ((remainder == 0x80000000U) && ((r.x & 0x1U) != 0U))) { + r.x++; + } + val = r; +#endif + return val; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half_rn(const float a) +{ + __half val; +#if defined(__CUDA_ARCH__) + asm("{ cvt.rn.f16.f32 %0, %1;}\n" : "=h"(__HALF_TO_US(val)) : "f"(a)); +#else + __half_raw r; + unsigned int sign = 0U; + unsigned int remainder = 0U; + r.x = __internal_float2half(a, sign, remainder); + if ((remainder > 0x80000000U) || ((remainder == 0x80000000U) && ((r.x & 0x1U) != 0U))) { + r.x++; + } + val = r; +#endif + return val; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half_rz(const float a) +{ + __half val; +#if defined(__CUDA_ARCH__) + asm("{ cvt.rz.f16.f32 %0, %1;}\n" : "=h"(__HALF_TO_US(val)) : "f"(a)); +#else + __half_raw r; + unsigned int sign = 0U; + unsigned int remainder = 0U; + r.x = __internal_float2half(a, sign, remainder); + val = r; +#endif + return val; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half_rd(const float a) +{ + __half val; +#if defined(__CUDA_ARCH__) + asm("{ cvt.rm.f16.f32 %0, %1;}\n" : "=h"(__HALF_TO_US(val)) : "f"(a)); +#else + __half_raw r; + unsigned int sign = 0U; + unsigned int remainder = 0U; + r.x = __internal_float2half(a, sign, remainder); + if ((remainder != 0U) && (sign != 0U)) { + r.x++; + } + val = r; +#endif + return val; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __float2half_ru(const float a) +{ + __half val; +#if defined(__CUDA_ARCH__) + asm("{ cvt.rp.f16.f32 %0, %1;}\n" : "=h"(__HALF_TO_US(val)) : "f"(a)); +#else + __half_raw r; + unsigned int sign = 0U; + unsigned int remainder = 0U; + r.x = __internal_float2half(a, sign, remainder); + if ((remainder != 0U) && (sign == 0U)) { + r.x++; + } + val = r; +#endif + return val; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half2 __float2half2_rn(const float a) +{ + __half2 val; +#if defined(__CUDA_ARCH__) + asm("{.reg .f16 low;\n" + " cvt.rn.f16.f32 low, %1;\n" + " mov.b32 %0, {low,low};}\n" : "=r"(__HALF2_TO_UI(val)) : "f"(a)); +#else + val = __half2(__float2half_rn(a), __float2half_rn(a)); +#endif + return val; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half2 __floats2half2_rn(const float a, const float b) +{ + __half2 val; +#if defined(__CUDA_ARCH__) + asm("{.reg .f16 low,high;\n" + " cvt.rn.f16.f32 low, %1;\n" + " cvt.rn.f16.f32 high, %2;\n" + " mov.b32 %0, {low,high};}\n" : "=r"(__HALF2_TO_UI(val)) : "f"(a), "f"(b)); +#else + val = __half2(__float2half_rn(a), __float2half_rn(b)); +#endif + return val; +} + +#ifndef __CUDACC_RTC__ /* no host functions in NVRTC mode */ +static inline float __internal_half2float(const unsigned short h) +{ + unsigned int sign = ((static_cast(h) >> 15U) & 1U); + unsigned int exponent = ((static_cast(h) >> 10U) & 0x1fU); + unsigned int mantissa = ((static_cast(h) & 0x3ffU) << 13U); + float f; + if (exponent == 0x1fU) { /* NaN or Inf */ + /* discard sign of a NaN */ + sign = ((mantissa != 0U) ? (sign >> 1U) : sign); + mantissa = ((mantissa != 0U) ? 0x7fffffU : 0U); + exponent = 0xffU; + } else if (exponent == 0U) { /* Denorm or Zero */ + if (mantissa != 0U) { + unsigned int msb; + exponent = 0x71U; + do { + msb = (mantissa & 0x400000U); + mantissa <<= 1U; /* normalize */ + --exponent; + } while (msb == 0U); + mantissa &= 0x7fffffU; /* 1.mantissa is implicit */ + } + } else { + exponent += 0x70U; + } + unsigned int u = ((sign << 31U) | (exponent << 23U) | mantissa); +#if defined(__CUDACC__) + (void)memcpy(&f, &u, sizeof(u)); +#else + (void)std::memcpy(&f, &u, sizeof(u)); +#endif + return f; +} +#endif /* !defined(__CUDACC_RTC__) */ + +__CUDA_HOSTDEVICE_FP16_DECL__ float __half2float(const __half a) +{ + float val; +#if defined(__CUDA_ARCH__) + asm("{ cvt.f32.f16 %0, %1;}\n" : "=f"(val) : "h"(__HALF_TO_CUS(a))); +#else + val = __internal_half2float(static_cast<__half_raw>(a).x); +#endif + return val; +} +__CUDA_HOSTDEVICE_FP16_DECL__ float __low2float(const __half2 a) +{ + float val; +#if defined(__CUDA_ARCH__) + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high},%1;\n" + " cvt.f32.f16 %0, low;}\n" : "=f"(val) : "r"(__HALF2_TO_CUI(a))); +#else + val = __internal_half2float(static_cast<__half2_raw>(a).x); +#endif + return val; +} +__CUDA_HOSTDEVICE_FP16_DECL__ float __high2float(const __half2 a) +{ + float val; +#if defined(__CUDA_ARCH__) + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high},%1;\n" + " cvt.f32.f16 %0, high;}\n" : "=f"(val) : "r"(__HALF2_TO_CUI(a))); +#else + val = __internal_half2float(static_cast<__half2_raw>(a).y); +#endif + return val; +} + +/* Intrinsic functions only available to nvcc compilers */ +#if defined(__CUDACC__) + +/* CUDA vector-types compatible vector creation function (note returns __half2, not half2) */ +__VECTOR_FUNCTIONS_DECL__ __half2 make_half2(const __half x, const __half y) +{ + __half2 t; t.x = x; t.y = y; return t; +} +#undef __VECTOR_FUNCTIONS_DECL__ + + +/* Definitions of intrinsics */ +__CUDA_HOSTDEVICE_FP16_DECL__ __half2 __float22half2_rn(const float2 a) +{ + const __half2 val = __floats2half2_rn(a.x, a.y); + return val; +} +__CUDA_HOSTDEVICE_FP16_DECL__ float2 __half22float2(const __half2 a) +{ + float hi_float; + float lo_float; +#if defined(__CUDA_ARCH__) + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high},%1;\n" + " cvt.f32.f16 %0, low;}\n" : "=f"(lo_float) : "r"(__HALF2_TO_CUI(a))); + + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high},%1;\n" + " cvt.f32.f16 %0, high;}\n" : "=f"(hi_float) : "r"(__HALF2_TO_CUI(a))); +#else + lo_float = __internal_half2float(((__half2_raw)a).x); + hi_float = __internal_half2float(((__half2_raw)a).y); +#endif + return make_float2(lo_float, hi_float); +} +__CUDA_FP16_DECL__ int __half2int_rn(const __half h) +{ + int i; + asm("cvt.rni.s32.f16 %0, %1;" : "=r"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ int __half2int_rz(const __half h) +{ + int i; +#if defined __CUDA_ARCH__ + asm("cvt.rzi.s32.f16 %0, %1;" : "=r"(i) : "h"(__HALF_TO_CUS(h))); +#else + const float f = __half2float(h); + i = static_cast(f); + const int max_val = (int)0x7fffffffU; + const int min_val = (int)0x80000000U; + // saturation fixup + if (f != f) { + // NaN + i = 0; + } else if (f > static_cast(max_val)) { + // saturate maximum + i = max_val; + } else if (f < static_cast(min_val)) { + // saturate minimum + i = min_val; + } +#endif + return i; +} +__CUDA_FP16_DECL__ int __half2int_rd(const __half h) +{ + int i; + asm("cvt.rmi.s32.f16 %0, %1;" : "=r"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_FP16_DECL__ int __half2int_ru(const __half h) +{ + int i; + asm("cvt.rpi.s32.f16 %0, %1;" : "=r"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __int2half_rn(const int i) +{ + __half h; +#if defined(__CUDA_ARCH__) + asm("cvt.rn.f16.s32 %0, %1;" : "=h"(__HALF_TO_US(h)) : "r"(i)); +#else + // double-rounding is not a problem here: if integer + // has more than 24 bits, it is already too large to + // be represented in half precision, and result will + // be infinity. + const float f = static_cast(i); + h = __float2half_rn(f); +#endif + return h; +} +__CUDA_FP16_DECL__ __half __int2half_rz(const int i) +{ + __half h; + asm("cvt.rz.f16.s32 %0, %1;" : "=h"(__HALF_TO_US(h)) : "r"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __int2half_rd(const int i) +{ + __half h; + asm("cvt.rm.f16.s32 %0, %1;" : "=h"(__HALF_TO_US(h)) : "r"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __int2half_ru(const int i) +{ + __half h; + asm("cvt.rp.f16.s32 %0, %1;" : "=h"(__HALF_TO_US(h)) : "r"(i)); + return h; +} + +__CUDA_FP16_DECL__ short int __half2short_rn(const __half h) +{ + short int i; + asm("cvt.rni.s16.f16 %0, %1;" : "=h"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ short int __half2short_rz(const __half h) +{ + short int i; +#if defined __CUDA_ARCH__ + asm("cvt.rzi.s16.f16 %0, %1;" : "=h"(i) : "h"(__HALF_TO_CUS(h))); +#else + const float f = __half2float(h); + i = static_cast(f); + const short int max_val = (short int)0x7fffU; + const short int min_val = (short int)0x8000U; + // saturation fixup + if (f != f) { + // NaN + i = 0; + } else if (f > static_cast(max_val)) { + // saturate maximum + i = max_val; + } else if (f < static_cast(min_val)) { + // saturate minimum + i = min_val; + } +#endif + return i; +} +__CUDA_FP16_DECL__ short int __half2short_rd(const __half h) +{ + short int i; + asm("cvt.rmi.s16.f16 %0, %1;" : "=h"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_FP16_DECL__ short int __half2short_ru(const __half h) +{ + short int i; + asm("cvt.rpi.s16.f16 %0, %1;" : "=h"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __short2half_rn(const short int i) +{ + __half h; +#if defined __CUDA_ARCH__ + asm("cvt.rn.f16.s16 %0, %1;" : "=h"(__HALF_TO_US(h)) : "h"(i)); +#else + const float f = static_cast(i); + h = __float2half_rn(f); +#endif + return h; +} +__CUDA_FP16_DECL__ __half __short2half_rz(const short int i) +{ + __half h; + asm("cvt.rz.f16.s16 %0, %1;" : "=h"(__HALF_TO_US(h)) : "h"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __short2half_rd(const short int i) +{ + __half h; + asm("cvt.rm.f16.s16 %0, %1;" : "=h"(__HALF_TO_US(h)) : "h"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __short2half_ru(const short int i) +{ + __half h; + asm("cvt.rp.f16.s16 %0, %1;" : "=h"(__HALF_TO_US(h)) : "h"(i)); + return h; +} + +__CUDA_FP16_DECL__ unsigned int __half2uint_rn(const __half h) +{ + unsigned int i; + asm("cvt.rni.u32.f16 %0, %1;" : "=r"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ unsigned int __half2uint_rz(const __half h) +{ + unsigned int i; +#if defined __CUDA_ARCH__ + asm("cvt.rzi.u32.f16 %0, %1;" : "=r"(i) : "h"(__HALF_TO_CUS(h))); +#else + const float f = __half2float(h); + i = static_cast(f); + const unsigned int max_val = 0xffffffffU; + const unsigned int min_val = 0U; + // saturation fixup + if (f != f) { + // NaN + i = 0U; + } else if (f > static_cast(max_val)) { + // saturate maximum + i = max_val; + } else if (f < static_cast(min_val)) { + // saturate minimum + i = min_val; + } +#endif + return i; +} +__CUDA_FP16_DECL__ unsigned int __half2uint_rd(const __half h) +{ + unsigned int i; + asm("cvt.rmi.u32.f16 %0, %1;" : "=r"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_FP16_DECL__ unsigned int __half2uint_ru(const __half h) +{ + unsigned int i; + asm("cvt.rpi.u32.f16 %0, %1;" : "=r"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __uint2half_rn(const unsigned int i) +{ + __half h; +#if defined __CUDA_ARCH__ + asm("cvt.rn.f16.u32 %0, %1;" : "=h"(__HALF_TO_US(h)) : "r"(i)); +#else + // double-rounding is not a problem here: if integer + // has more than 24 bits, it is already too large to + // be represented in half precision, and result will + // be infinity. + const float f = static_cast(i); + h = __float2half_rn(f); +#endif + return h; +} +__CUDA_FP16_DECL__ __half __uint2half_rz(const unsigned int i) +{ + __half h; + asm("cvt.rz.f16.u32 %0, %1;" : "=h"(__HALF_TO_US(h)) : "r"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __uint2half_rd(const unsigned int i) +{ + __half h; + asm("cvt.rm.f16.u32 %0, %1;" : "=h"(__HALF_TO_US(h)) : "r"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __uint2half_ru(const unsigned int i) +{ + __half h; + asm("cvt.rp.f16.u32 %0, %1;" : "=h"(__HALF_TO_US(h)) : "r"(i)); + return h; +} + +__CUDA_FP16_DECL__ unsigned short int __half2ushort_rn(const __half h) +{ + unsigned short int i; + asm("cvt.rni.u16.f16 %0, %1;" : "=h"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ unsigned short int __half2ushort_rz(const __half h) +{ + unsigned short int i; +#if defined __CUDA_ARCH__ + asm("cvt.rzi.u16.f16 %0, %1;" : "=h"(i) : "h"(__HALF_TO_CUS(h))); +#else + const float f = __half2float(h); + i = static_cast(f); + const unsigned short int max_val = 0xffffU; + const unsigned short int min_val = 0U; + // saturation fixup + if (f != f) { + // NaN + i = 0U; + } else if (f > static_cast(max_val)) { + // saturate maximum + i = max_val; + } else if (f < static_cast(min_val)) { + // saturate minimum + i = min_val; + } +#endif + return i; +} +__CUDA_FP16_DECL__ unsigned short int __half2ushort_rd(const __half h) +{ + unsigned short int i; + asm("cvt.rmi.u16.f16 %0, %1;" : "=h"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_FP16_DECL__ unsigned short int __half2ushort_ru(const __half h) +{ + unsigned short int i; + asm("cvt.rpi.u16.f16 %0, %1;" : "=h"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __ushort2half_rn(const unsigned short int i) +{ + __half h; +#if defined __CUDA_ARCH__ + asm("cvt.rn.f16.u16 %0, %1;" : "=h"(__HALF_TO_US(h)) : "h"(i)); +#else + const float f = static_cast(i); + h = __float2half_rn(f); +#endif + return h; +} +__CUDA_FP16_DECL__ __half __ushort2half_rz(const unsigned short int i) +{ + __half h; + asm("cvt.rz.f16.u16 %0, %1;" : "=h"(__HALF_TO_US(h)) : "h"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __ushort2half_rd(const unsigned short int i) +{ + __half h; + asm("cvt.rm.f16.u16 %0, %1;" : "=h"(__HALF_TO_US(h)) : "h"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __ushort2half_ru(const unsigned short int i) +{ + __half h; + asm("cvt.rp.f16.u16 %0, %1;" : "=h"(__HALF_TO_US(h)) : "h"(i)); + return h; +} + +__CUDA_FP16_DECL__ unsigned long long int __half2ull_rn(const __half h) +{ + unsigned long long int i; + asm("cvt.rni.u64.f16 %0, %1;" : "=l"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ unsigned long long int __half2ull_rz(const __half h) +{ + unsigned long long int i; +#if defined __CUDA_ARCH__ + asm("cvt.rzi.u64.f16 %0, %1;" : "=l"(i) : "h"(__HALF_TO_CUS(h))); +#else + const float f = __half2float(h); + i = static_cast(f); + const unsigned long long int max_val = 0xffffffffffffffffULL; + const unsigned long long int min_val = 0ULL; + // saturation fixup + if (f != f) { + // NaN + i = 0x8000000000000000ULL; + } else if (f > static_cast(max_val)) { + // saturate maximum + i = max_val; + } else if (f < static_cast(min_val)) { + // saturate minimum + i = min_val; + } +#endif + return i; +} +__CUDA_FP16_DECL__ unsigned long long int __half2ull_rd(const __half h) +{ + unsigned long long int i; + asm("cvt.rmi.u64.f16 %0, %1;" : "=l"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_FP16_DECL__ unsigned long long int __half2ull_ru(const __half h) +{ + unsigned long long int i; + asm("cvt.rpi.u64.f16 %0, %1;" : "=l"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __ull2half_rn(const unsigned long long int i) +{ + __half h; +#if defined(__CUDA_ARCH__) + asm("cvt.rn.f16.u64 %0, %1;" : "=h"(__HALF_TO_US(h)) : "l"(i)); +#else + // double-rounding is not a problem here: if integer + // has more than 24 bits, it is already too large to + // be represented in half precision, and result will + // be infinity. + const float f = static_cast(i); + h = __float2half_rn(f); +#endif + return h; +} +__CUDA_FP16_DECL__ __half __ull2half_rz(const unsigned long long int i) +{ + __half h; + asm("cvt.rz.f16.u64 %0, %1;" : "=h"(__HALF_TO_US(h)) : "l"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __ull2half_rd(const unsigned long long int i) +{ + __half h; + asm("cvt.rm.f16.u64 %0, %1;" : "=h"(__HALF_TO_US(h)) : "l"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __ull2half_ru(const unsigned long long int i) +{ + __half h; + asm("cvt.rp.f16.u64 %0, %1;" : "=h"(__HALF_TO_US(h)) : "l"(i)); + return h; +} + +__CUDA_FP16_DECL__ long long int __half2ll_rn(const __half h) +{ + long long int i; + asm("cvt.rni.s64.f16 %0, %1;" : "=l"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ long long int __half2ll_rz(const __half h) +{ + long long int i; +#if defined __CUDA_ARCH__ + asm("cvt.rzi.s64.f16 %0, %1;" : "=l"(i) : "h"(__HALF_TO_CUS(h))); +#else + const float f = __half2float(h); + i = static_cast(f); + const long long int max_val = (long long int)0x7fffffffffffffffULL; + const long long int min_val = (long long int)0x8000000000000000ULL; + // saturation fixup + if (f != f) { + // NaN + i = min_val; + } else if (f > static_cast(max_val)) { + // saturate maximum + i = max_val; + } else if (f < static_cast(min_val)) { + // saturate minimum + i = min_val; + } +#endif + return i; +} +__CUDA_FP16_DECL__ long long int __half2ll_rd(const __half h) +{ + long long int i; + asm("cvt.rmi.s64.f16 %0, %1;" : "=l"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_FP16_DECL__ long long int __half2ll_ru(const __half h) +{ + long long int i; + asm("cvt.rpi.s64.f16 %0, %1;" : "=l"(i) : "h"(__HALF_TO_CUS(h))); + return i; +} +__CUDA_HOSTDEVICE_FP16_DECL__ __half __ll2half_rn(const long long int i) +{ + __half h; +#if defined(__CUDA_ARCH__) + asm("cvt.rn.f16.s64 %0, %1;" : "=h"(__HALF_TO_US(h)) : "l"(i)); +#else + // double-rounding is not a problem here: if integer + // has more than 24 bits, it is already too large to + // be represented in half precision, and result will + // be infinity. + const float f = static_cast(i); + h = __float2half_rn(f); +#endif + return h; +} +__CUDA_FP16_DECL__ __half __ll2half_rz(const long long int i) +{ + __half h; + asm("cvt.rz.f16.s64 %0, %1;" : "=h"(__HALF_TO_US(h)) : "l"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __ll2half_rd(const long long int i) +{ + __half h; + asm("cvt.rm.f16.s64 %0, %1;" : "=h"(__HALF_TO_US(h)) : "l"(i)); + return h; +} +__CUDA_FP16_DECL__ __half __ll2half_ru(const long long int i) +{ + __half h; + asm("cvt.rp.f16.s64 %0, %1;" : "=h"(__HALF_TO_US(h)) : "l"(i)); + return h; +} + +__CUDA_FP16_DECL__ __half htrunc(const __half h) +{ + __half r; + asm("cvt.rzi.f16.f16 %0, %1;" : "=h"(__HALF_TO_US(r)) : "h"(__HALF_TO_CUS(h))); + return r; +} +__CUDA_FP16_DECL__ __half hceil(const __half h) +{ + __half r; + asm("cvt.rpi.f16.f16 %0, %1;" : "=h"(__HALF_TO_US(r)) : "h"(__HALF_TO_CUS(h))); + return r; +} +__CUDA_FP16_DECL__ __half hfloor(const __half h) +{ + __half r; + asm("cvt.rmi.f16.f16 %0, %1;" : "=h"(__HALF_TO_US(r)) : "h"(__HALF_TO_CUS(h))); + return r; +} +__CUDA_FP16_DECL__ __half hrint(const __half h) +{ + __half r; + asm("cvt.rni.f16.f16 %0, %1;" : "=h"(__HALF_TO_US(r)) : "h"(__HALF_TO_CUS(h))); + return r; +} + +__CUDA_FP16_DECL__ __half2 h2trunc(const __half2 h) +{ + __half2 val; + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high}, %1;\n" + " cvt.rzi.f16.f16 low, low;\n" + " cvt.rzi.f16.f16 high, high;\n" + " mov.b32 %0, {low,high};}\n" : "=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(h))); + return val; +} +__CUDA_FP16_DECL__ __half2 h2ceil(const __half2 h) +{ + __half2 val; + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high}, %1;\n" + " cvt.rpi.f16.f16 low, low;\n" + " cvt.rpi.f16.f16 high, high;\n" + " mov.b32 %0, {low,high};}\n" : "=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(h))); + return val; +} +__CUDA_FP16_DECL__ __half2 h2floor(const __half2 h) +{ + __half2 val; + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high}, %1;\n" + " cvt.rmi.f16.f16 low, low;\n" + " cvt.rmi.f16.f16 high, high;\n" + " mov.b32 %0, {low,high};}\n" : "=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(h))); + return val; +} +__CUDA_FP16_DECL__ __half2 h2rint(const __half2 h) +{ + __half2 val; + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high}, %1;\n" + " cvt.rni.f16.f16 low, low;\n" + " cvt.rni.f16.f16 high, high;\n" + " mov.b32 %0, {low,high};}\n" : "=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(h))); + return val; +} +__CUDA_FP16_DECL__ __half2 __lows2half2(const __half2 a, const __half2 b) +{ + __half2 val; + asm("{.reg .f16 alow,ahigh,blow,bhigh;\n" + " mov.b32 {alow,ahigh}, %1;\n" + " mov.b32 {blow,bhigh}, %2;\n" + " mov.b32 %0, {alow,blow};}\n" : "=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a)), "r"(__HALF2_TO_CUI(b))); + return val; +} +__CUDA_FP16_DECL__ __half2 __highs2half2(const __half2 a, const __half2 b) +{ + __half2 val; + asm("{.reg .f16 alow,ahigh,blow,bhigh;\n" + " mov.b32 {alow,ahigh}, %1;\n" + " mov.b32 {blow,bhigh}, %2;\n" + " mov.b32 %0, {ahigh,bhigh};}\n" : "=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a)), "r"(__HALF2_TO_CUI(b))); + return val; +} +__CUDA_FP16_DECL__ __half __low2half(const __half2 a) +{ + __half ret; + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high}, %1;\n" + " mov.b16 %0, low;}" : "=h"(__HALF_TO_US(ret)) : "r"(__HALF2_TO_CUI(a))); + return ret; +} +__CUDA_FP16_DECL__ int __hisinf(const __half a) +{ + int retval; + if (__HALF_TO_CUS(a) == 0xFC00U) { + retval = -1; + } else if (__HALF_TO_CUS(a) == 0x7C00U) { + retval = 1; + } else { + retval = 0; + } + return retval; +} +__CUDA_FP16_DECL__ __half2 __low2half2(const __half2 a) +{ + __half2 val; + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high}, %1;\n" + " mov.b32 %0, {low,low};}\n" : "=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); + return val; +} +__CUDA_FP16_DECL__ __half2 __high2half2(const __half2 a) +{ + __half2 val; + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high}, %1;\n" + " mov.b32 %0, {high,high};}\n" : "=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); + return val; +} +__CUDA_FP16_DECL__ __half __high2half(const __half2 a) +{ + __half ret; + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high}, %1;\n" + " mov.b16 %0, high;}" : "=h"(__HALF_TO_US(ret)) : "r"(__HALF2_TO_CUI(a))); + return ret; +} +__CUDA_FP16_DECL__ __half2 __halves2half2(const __half a, const __half b) +{ + __half2 val; + asm("{ mov.b32 %0, {%1,%2};}\n" + : "=r"(__HALF2_TO_UI(val)) : "h"(__HALF_TO_CUS(a)), "h"(__HALF_TO_CUS(b))); + return val; +} +__CUDA_FP16_DECL__ __half2 __half2half2(const __half a) +{ + __half2 val; + asm("{ mov.b32 %0, {%1,%1};}\n" + : "=r"(__HALF2_TO_UI(val)) : "h"(__HALF_TO_CUS(a))); + return val; +} +__CUDA_FP16_DECL__ __half2 __lowhigh2highlow(const __half2 a) +{ + __half2 val; + asm("{.reg .f16 low,high;\n" + " mov.b32 {low,high}, %1;\n" + " mov.b32 %0, {high,low};}\n" : "=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); + return val; +} +__CUDA_FP16_DECL__ short int __half_as_short(const __half h) +{ + return static_cast(__HALF_TO_CUS(h)); +} +__CUDA_FP16_DECL__ unsigned short int __half_as_ushort(const __half h) +{ + return __HALF_TO_CUS(h); +} +__CUDA_FP16_DECL__ __half __short_as_half(const short int i) +{ + __half h; + __HALF_TO_US(h) = static_cast(i); + return h; +} +__CUDA_FP16_DECL__ __half __ushort_as_half(const unsigned short int i) +{ + __half h; + __HALF_TO_US(h) = i; + return h; +} + +#if __CUDA_ARCH__ >= 300 || !defined(__CUDA_ARCH__) +/****************************************************************************** +* __half, __half2 warp shuffle * +******************************************************************************/ +#define __SHUFFLE_HALF2_MACRO(name) /* do */ {\ + __half2 r; \ + asm volatile ("{"#name" %0,%1,%2,%3;\n}" \ + :"=r"(__HALF2_TO_UI(r)): "r"(__HALF2_TO_CUI(var)), "r"(delta), "r"(c)); \ + return r; \ +} /* while(0) */ + +#define __SHUFFLE_SYNC_HALF2_MACRO(name) /* do */ {\ + __half2 r; \ + asm volatile ("{"#name" %0,%1,%2,%3,%4;\n}" \ + :"=r"(__HALF2_TO_UI(r)): "r"(__HALF2_TO_CUI(var)), "r"(delta), "r"(c), "r"(mask)); \ + return r; \ +} /* while(0) */ + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ < 700 + +__CUDA_FP16_DECL__ __half2 __shfl(const __half2 var, const int delta, const int width) +{ + unsigned int warp_size; + asm("{mov.u32 %0, WARP_SZ;\n}" : "=r"(warp_size)); + const unsigned int c = ((warp_size - static_cast(width)) << 8U) | 0x1fU; + __SHUFFLE_HALF2_MACRO(shfl.idx.b32) +} +__CUDA_FP16_DECL__ __half2 __shfl_up(const __half2 var, const unsigned int delta, const int width) +{ + unsigned int warp_size; + asm("{mov.u32 %0, WARP_SZ;\n}" : "=r"(warp_size)); + const unsigned int c = (warp_size - static_cast(width)) << 8U; + __SHUFFLE_HALF2_MACRO(shfl.up.b32) +} +__CUDA_FP16_DECL__ __half2 __shfl_down(const __half2 var, const unsigned int delta, const int width) +{ + unsigned int warp_size; + asm("{mov.u32 %0, WARP_SZ;\n}" : "=r"(warp_size)); + const unsigned int c = ((warp_size - static_cast(width)) << 8U) | 0x1fU; + __SHUFFLE_HALF2_MACRO(shfl.down.b32) +} +__CUDA_FP16_DECL__ __half2 __shfl_xor(const __half2 var, const int delta, const int width) +{ + unsigned int warp_size; + asm("{mov.u32 %0, WARP_SZ;\n}" : "=r"(warp_size)); + const unsigned int c = ((warp_size - static_cast(width)) << 8U) | 0x1fU; + __SHUFFLE_HALF2_MACRO(shfl.bfly.b32) +} + +#endif /* !defined(__CUDA_ARCH__) || __CUDA_ARCH__ < 700 */ + +__CUDA_FP16_DECL__ __half2 __shfl_sync(const unsigned mask, const __half2 var, const int delta, const int width) +{ + unsigned int warp_size; + asm("{mov.u32 %0, WARP_SZ;\n}" : "=r"(warp_size)); + const unsigned int c = ((warp_size - static_cast(width)) << 8U) | 0x1fU; + __SHUFFLE_SYNC_HALF2_MACRO(shfl.sync.idx.b32) +} +__CUDA_FP16_DECL__ __half2 __shfl_up_sync(const unsigned mask, const __half2 var, const unsigned int delta, const int width) +{ + unsigned int warp_size; + asm("{mov.u32 %0, WARP_SZ;\n}" : "=r"(warp_size)); + const unsigned int c = (warp_size - static_cast(width)) << 8U; + __SHUFFLE_SYNC_HALF2_MACRO(shfl.sync.up.b32) +} +__CUDA_FP16_DECL__ __half2 __shfl_down_sync(const unsigned mask, const __half2 var, const unsigned int delta, const int width) +{ + unsigned int warp_size; + asm("{mov.u32 %0, WARP_SZ;\n}" : "=r"(warp_size)); + const unsigned int c = ((warp_size - static_cast(width)) << 8U) | 0x1fU; + __SHUFFLE_SYNC_HALF2_MACRO(shfl.sync.down.b32) +} +__CUDA_FP16_DECL__ __half2 __shfl_xor_sync(const unsigned mask, const __half2 var, const int delta, const int width) +{ + unsigned int warp_size; + asm("{mov.u32 %0, WARP_SZ;\n}" : "=r"(warp_size)); + const unsigned int c = ((warp_size - static_cast(width)) << 8U) | 0x1fU; + __SHUFFLE_SYNC_HALF2_MACRO(shfl.sync.bfly.b32) +} + +#undef __SHUFFLE_HALF2_MACRO +#undef __SHUFFLE_SYNC_HALF2_MACRO + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ < 700 + +__CUDA_FP16_DECL__ __half __shfl(const __half var, const int delta, const int width) +{ + const __half2 temp1 = __halves2half2(var, var); + const __half2 temp2 = __shfl(temp1, delta, width); + return __low2half(temp2); +} +__CUDA_FP16_DECL__ __half __shfl_up(const __half var, const unsigned int delta, const int width) +{ + const __half2 temp1 = __halves2half2(var, var); + const __half2 temp2 = __shfl_up(temp1, delta, width); + return __low2half(temp2); +} +__CUDA_FP16_DECL__ __half __shfl_down(const __half var, const unsigned int delta, const int width) +{ + const __half2 temp1 = __halves2half2(var, var); + const __half2 temp2 = __shfl_down(temp1, delta, width); + return __low2half(temp2); +} +__CUDA_FP16_DECL__ __half __shfl_xor(const __half var, const int delta, const int width) +{ + const __half2 temp1 = __halves2half2(var, var); + const __half2 temp2 = __shfl_xor(temp1, delta, width); + return __low2half(temp2); +} + +#endif /* !defined(__CUDA_ARCH__) || __CUDA_ARCH__ < 700 */ + +__CUDA_FP16_DECL__ __half __shfl_sync(const unsigned mask, const __half var, const int delta, const int width) +{ + const __half2 temp1 = __halves2half2(var, var); + const __half2 temp2 = __shfl_sync(mask, temp1, delta, width); + return __low2half(temp2); +} +__CUDA_FP16_DECL__ __half __shfl_up_sync(const unsigned mask, const __half var, const unsigned int delta, const int width) +{ + const __half2 temp1 = __halves2half2(var, var); + const __half2 temp2 = __shfl_up_sync(mask, temp1, delta, width); + return __low2half(temp2); +} +__CUDA_FP16_DECL__ __half __shfl_down_sync(const unsigned mask, const __half var, const unsigned int delta, const int width) +{ + const __half2 temp1 = __halves2half2(var, var); + const __half2 temp2 = __shfl_down_sync(mask, temp1, delta, width); + return __low2half(temp2); +} +__CUDA_FP16_DECL__ __half __shfl_xor_sync(const unsigned mask, const __half var, const int delta, const int width) +{ + const __half2 temp1 = __halves2half2(var, var); + const __half2 temp2 = __shfl_xor_sync(mask, temp1, delta, width); + return __low2half(temp2); +} + +#endif /*__CUDA_ARCH__ >= 300 || !defined(__CUDA_ARCH__)*/ +/****************************************************************************** +* __half and __half2 __ldg,__ldcg,__ldca,__ldcs * +******************************************************************************/ + +#if defined(__cplusplus) && (__CUDA_ARCH__ >= 320 || !defined(__CUDA_ARCH__)) +#if (defined(_MSC_VER) && defined(_WIN64)) || defined(__LP64__) || defined(__CUDACC_RTC__) +#define __LDG_PTR "l" +#else +#define __LDG_PTR "r" +#endif /*(defined(_MSC_VER) && defined(_WIN64)) || defined(__LP64__) || defined(__CUDACC_RTC__)*/ +__CUDA_FP16_DECL__ __half2 __ldg(const __half2 *const ptr) +{ + __half2 ret; + asm ("ld.global.nc.b32 %0, [%1];" : "=r"(__HALF2_TO_UI(ret)) : __LDG_PTR(ptr)); + return ret; +} +__CUDA_FP16_DECL__ __half __ldg(const __half *const ptr) +{ + __half ret; + asm ("ld.global.nc.b16 %0, [%1];" : "=h"(__HALF_TO_US(ret)) : __LDG_PTR(ptr)); + return ret; +} +__CUDA_FP16_DECL__ __half2 __ldcg(const __half2 *const ptr) +{ + __half2 ret; + asm ("ld.global.cg.b32 %0, [%1];" : "=r"(__HALF2_TO_UI(ret)) : __LDG_PTR(ptr)); + return ret; +} +__CUDA_FP16_DECL__ __half __ldcg(const __half *const ptr) +{ + __half ret; + asm ("ld.global.cg.b16 %0, [%1];" : "=h"(__HALF_TO_US(ret)) : __LDG_PTR(ptr)); + return ret; +} +__CUDA_FP16_DECL__ __half2 __ldca(const __half2 *const ptr) +{ + __half2 ret; + asm ("ld.global.ca.b32 %0, [%1];" : "=r"(__HALF2_TO_UI(ret)) : __LDG_PTR(ptr)); + return ret; +} +__CUDA_FP16_DECL__ __half __ldca(const __half *const ptr) +{ + __half ret; + asm ("ld.global.ca.b16 %0, [%1];" : "=h"(__HALF_TO_US(ret)) : __LDG_PTR(ptr)); + return ret; +} +__CUDA_FP16_DECL__ __half2 __ldcs(const __half2 *const ptr) +{ + __half2 ret; + asm ("ld.global.cs.b32 %0, [%1];" : "=r"(__HALF2_TO_UI(ret)) : __LDG_PTR(ptr)); + return ret; +} +__CUDA_FP16_DECL__ __half __ldcs(const __half *const ptr) +{ + __half ret; + asm ("ld.global.cs.b16 %0, [%1];" : "=h"(__HALF_TO_US(ret)) : __LDG_PTR(ptr)); + return ret; +} +__CUDA_FP16_DECL__ __half2 __ldlu(const __half2 *const ptr) +{ + __half2 ret; + asm ("ld.global.lu.b32 %0, [%1];" : "=r"(__HALF2_TO_UI(ret)) : __LDG_PTR(ptr) : "memory"); + return ret; +} +__CUDA_FP16_DECL__ __half __ldlu(const __half *const ptr) +{ + __half ret; + asm ("ld.global.lu.b16 %0, [%1];" : "=h"(__HALF_TO_US(ret)) : __LDG_PTR(ptr) : "memory"); + return ret; +} +__CUDA_FP16_DECL__ __half2 __ldcv(const __half2 *const ptr) +{ + __half2 ret; + asm ("ld.global.cv.b32 %0, [%1];" : "=r"(__HALF2_TO_UI(ret)) : __LDG_PTR(ptr) : "memory"); + return ret; +} +__CUDA_FP16_DECL__ __half __ldcv(const __half *const ptr) +{ + __half ret; + asm ("ld.global.cv.b16 %0, [%1];" : "=h"(__HALF_TO_US(ret)) : __LDG_PTR(ptr) : "memory"); + return ret; +} +__CUDA_FP16_DECL__ void __stwb(__half2 *const ptr, const __half2 value) +{ + asm ("st.global.wb.b32 [%0], %1;" :: __LDG_PTR(ptr), "r"(__HALF2_TO_CUI(value)) : "memory"); +} +__CUDA_FP16_DECL__ void __stwb(__half *const ptr, const __half value) +{ + asm ("st.global.wb.b16 [%0], %1;" :: __LDG_PTR(ptr), "h"(__HALF_TO_CUS(value)) : "memory"); +} +__CUDA_FP16_DECL__ void __stcg(__half2 *const ptr, const __half2 value) +{ + asm ("st.global.cg.b32 [%0], %1;" :: __LDG_PTR(ptr), "r"(__HALF2_TO_CUI(value)) : "memory"); +} +__CUDA_FP16_DECL__ void __stcg(__half *const ptr, const __half value) +{ + asm ("st.global.cg.b16 [%0], %1;" :: __LDG_PTR(ptr), "h"(__HALF_TO_CUS(value)) : "memory"); +} +__CUDA_FP16_DECL__ void __stcs(__half2 *const ptr, const __half2 value) +{ + asm ("st.global.cs.b32 [%0], %1;" :: __LDG_PTR(ptr), "r"(__HALF2_TO_CUI(value)) : "memory"); +} +__CUDA_FP16_DECL__ void __stcs(__half *const ptr, const __half value) +{ + asm ("st.global.cs.b16 [%0], %1;" :: __LDG_PTR(ptr), "h"(__HALF_TO_CUS(value)) : "memory"); +} +__CUDA_FP16_DECL__ void __stwt(__half2 *const ptr, const __half2 value) +{ + asm ("st.global.wt.b32 [%0], %1;" :: __LDG_PTR(ptr), "r"(__HALF2_TO_CUI(value)) : "memory"); +} +__CUDA_FP16_DECL__ void __stwt(__half *const ptr, const __half value) +{ + asm ("st.global.wt.b16 [%0], %1;" :: __LDG_PTR(ptr), "h"(__HALF_TO_CUS(value)) : "memory"); +} +#undef __LDG_PTR +#endif /*defined(__cplusplus) && (__CUDA_ARCH__ >= 320 || !defined(__CUDA_ARCH__))*/ +#if __CUDA_ARCH__ >= 530 || !defined(__CUDA_ARCH__) +/****************************************************************************** +* __half2 comparison * +******************************************************************************/ +#define __COMPARISON_OP_HALF2_MACRO(name) /* do */ {\ + __half2 val; \ + asm( "{ "#name".f16x2.f16x2 %0,%1,%2;\n}" \ + :"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a)),"r"(__HALF2_TO_CUI(b))); \ + return val; \ +} /* while(0) */ +__CUDA_FP16_DECL__ __half2 __heq2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.eq) +} +__CUDA_FP16_DECL__ __half2 __hne2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.ne) +} +__CUDA_FP16_DECL__ __half2 __hle2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.le) +} +__CUDA_FP16_DECL__ __half2 __hge2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.ge) +} +__CUDA_FP16_DECL__ __half2 __hlt2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.lt) +} +__CUDA_FP16_DECL__ __half2 __hgt2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.gt) +} +__CUDA_FP16_DECL__ __half2 __hequ2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.equ) +} +__CUDA_FP16_DECL__ __half2 __hneu2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.neu) +} +__CUDA_FP16_DECL__ __half2 __hleu2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.leu) +} +__CUDA_FP16_DECL__ __half2 __hgeu2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.geu) +} +__CUDA_FP16_DECL__ __half2 __hltu2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.ltu) +} +__CUDA_FP16_DECL__ __half2 __hgtu2(const __half2 a, const __half2 b) +{ + __COMPARISON_OP_HALF2_MACRO(set.gtu) +} +#undef __COMPARISON_OP_HALF2_MACRO +#define __BOOL_COMPARISON_OP_HALF2_MACRO(name) /* do */ {\ + __half2 val; \ + bool retval; \ + asm( "{ "#name".f16x2.f16x2 %0,%1,%2;\n}" \ + :"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a)),"r"(__HALF2_TO_CUI(b))); \ + if (__HALF2_TO_CUI(val) == 0x3C003C00U) {\ + retval = true; \ + } else { \ + retval = false; \ + }\ + return retval;\ +} /* while(0) */ +__CUDA_FP16_DECL__ bool __hbeq2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.eq) +} +__CUDA_FP16_DECL__ bool __hbne2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.ne) +} +__CUDA_FP16_DECL__ bool __hble2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.le) +} +__CUDA_FP16_DECL__ bool __hbge2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.ge) +} +__CUDA_FP16_DECL__ bool __hblt2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.lt) +} +__CUDA_FP16_DECL__ bool __hbgt2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.gt) +} +__CUDA_FP16_DECL__ bool __hbequ2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.equ) +} +__CUDA_FP16_DECL__ bool __hbneu2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.neu) +} +__CUDA_FP16_DECL__ bool __hbleu2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.leu) +} +__CUDA_FP16_DECL__ bool __hbgeu2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.geu) +} +__CUDA_FP16_DECL__ bool __hbltu2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.ltu) +} +__CUDA_FP16_DECL__ bool __hbgtu2(const __half2 a, const __half2 b) +{ + __BOOL_COMPARISON_OP_HALF2_MACRO(set.gtu) +} +#undef __BOOL_COMPARISON_OP_HALF2_MACRO +/****************************************************************************** +* __half comparison * +******************************************************************************/ +#define __COMPARISON_OP_HALF_MACRO(name) /* do */ {\ + unsigned short val; \ + asm( "{ .reg .pred __$temp3;\n" \ + " setp."#name".f16 __$temp3, %1, %2;\n" \ + " selp.u16 %0, 1, 0, __$temp3;}" \ + : "=h"(val) : "h"(__HALF_TO_CUS(a)), "h"(__HALF_TO_CUS(b))); \ + return (val != 0U) ? true : false; \ +} /* while(0) */ +__CUDA_FP16_DECL__ bool __heq(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(eq) +} +__CUDA_FP16_DECL__ bool __hne(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(ne) +} +__CUDA_FP16_DECL__ bool __hle(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(le) +} +__CUDA_FP16_DECL__ bool __hge(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(ge) +} +__CUDA_FP16_DECL__ bool __hlt(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(lt) +} +__CUDA_FP16_DECL__ bool __hgt(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(gt) +} +__CUDA_FP16_DECL__ bool __hequ(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(equ) +} +__CUDA_FP16_DECL__ bool __hneu(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(neu) +} +__CUDA_FP16_DECL__ bool __hleu(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(leu) +} +__CUDA_FP16_DECL__ bool __hgeu(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(geu) +} +__CUDA_FP16_DECL__ bool __hltu(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(ltu) +} +__CUDA_FP16_DECL__ bool __hgtu(const __half a, const __half b) +{ + __COMPARISON_OP_HALF_MACRO(gtu) +} +#undef __COMPARISON_OP_HALF_MACRO +/****************************************************************************** +* __half2 arithmetic * +******************************************************************************/ +__CUDA_FP16_DECL__ __half2 __hadd2(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(add) +} +__CUDA_FP16_DECL__ __half2 __hsub2(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(sub) +} +__CUDA_FP16_DECL__ __half2 __hmul2(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(mul) +} +__CUDA_FP16_DECL__ __half2 __hadd2_sat(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(add.sat) +} +__CUDA_FP16_DECL__ __half2 __hsub2_sat(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(sub.sat) +} +__CUDA_FP16_DECL__ __half2 __hmul2_sat(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(mul.sat) +} +__CUDA_FP16_DECL__ __half2 __hfma2(const __half2 a, const __half2 b, const __half2 c) +{ + __TERNARY_OP_HALF2_MACRO(fma.rn) +} +__CUDA_FP16_DECL__ __half2 __hfma2_sat(const __half2 a, const __half2 b, const __half2 c) +{ + __TERNARY_OP_HALF2_MACRO(fma.rn.sat) +} +__CUDA_FP16_DECL__ __half2 __h2div(const __half2 a, const __half2 b) { + __half ha = __low2half(a); + __half hb = __low2half(b); + + const __half v1 = __hdiv(ha, hb); + + ha = __high2half(a); + hb = __high2half(b); + + const __half v2 = __hdiv(ha, hb); + + return __halves2half2(v1, v2); +} +/****************************************************************************** +* __half arithmetic * +******************************************************************************/ +__CUDA_FP16_DECL__ __half __hadd(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(add) +} +__CUDA_FP16_DECL__ __half __hsub(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(sub) +} +__CUDA_FP16_DECL__ __half __hmul(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(mul) +} +__CUDA_FP16_DECL__ __half __hadd_sat(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(add.sat) +} +__CUDA_FP16_DECL__ __half __hsub_sat(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(sub.sat) +} +__CUDA_FP16_DECL__ __half __hmul_sat(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(mul.sat) +} + +__CUDA_FP16_DECL__ __half __hfma(const __half a, const __half b, const __half c) +{ + __TERNARY_OP_HALF_MACRO(fma.rn) +} +__CUDA_FP16_DECL__ __half __hfma_sat(const __half a, const __half b, const __half c) +{ + __TERNARY_OP_HALF_MACRO(fma.rn.sat) +} +__CUDA_FP16_DECL__ __half __hdiv(const __half a, const __half b) { + __half v; + __half abs; + __half den; + __HALF_TO_US(den) = 0x008FU; + + float rcp; + const float fa = __half2float(a); + const float fb = __half2float(b); + + asm("{rcp.approx.ftz.f32 %0, %1;\n}" :"=f"(rcp) : "f"(fb)); + + float fv = rcp * fa; + + v = __float2half(fv); + __HALF_TO_US(abs) = static_cast(static_cast(__HALF_TO_CUS(v)) & 0x00007FFFU); + if (__hlt(abs, den) && (!(__HALF_TO_CUS(abs) == 0x0000U))) { + const float err = __fmaf_rn(-fb, fv, fa); + fv = __fmaf_rn(rcp, err, fv); + v = __float2half(fv); + } + return v; +} + +/****************************************************************************** +* __half2 functions * +******************************************************************************/ +#define __SPEC_CASE2(i,r, spc, ulp) \ + "{.reg.b32 spc, ulp, p;\n"\ + " mov.b32 spc,"#spc";\n"\ + " mov.b32 ulp,"#ulp";\n"\ + " set.eq.f16x2.f16x2 p,"#i", spc;\n"\ + " fma.rn.f16x2 "#r",p,ulp,"#r";\n}\n" +#define __SPEC_CASE(i,r, spc, ulp) \ + "{.reg.b16 spc, ulp, p;\n"\ + " mov.b16 spc,"#spc";\n"\ + " mov.b16 ulp,"#ulp";\n"\ + " set.eq.f16.f16 p,"#i", spc;\n"\ + " fma.rn.f16 "#r",p,ulp,"#r";\n}\n" +#define __APPROX_FCAST(fun) /* do */ {\ + __half val;\ + asm("{.reg.b32 f; \n"\ + " .reg.b16 r; \n"\ + " mov.b16 r,%1; \n"\ + " cvt.f32.f16 f,r; \n"\ + " "#fun".approx.f32 f,f; \n"\ + " cvt.rn.f16.f32 r,f; \n"\ + " mov.b16 %0,r; \n"\ + "}": "=h"(__HALF_TO_US(val)) : "h"(__HALF_TO_CUS(a)));\ + return val;\ +} /* while(0) */ +#define __APPROX_FCAST2(fun) /* do */ {\ + __half2 val;\ + asm("{.reg.b16 hl, hu; \n"\ + " .reg.b32 fl, fu; \n"\ + " mov.b32 {hl, hu}, %1; \n"\ + " cvt.f32.f16 fl, hl; \n"\ + " cvt.f32.f16 fu, hu; \n"\ + " "#fun".approx.f32 fl, fl; \n"\ + " "#fun".approx.f32 fu, fu; \n"\ + " cvt.rn.f16.f32 hl, fl; \n"\ + " cvt.rn.f16.f32 hu, fu; \n"\ + " mov.b32 %0, {hl, hu}; \n"\ + "}":"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); \ + return val;\ +} /* while(0) */ +static __device__ __forceinline__ float __float_simpl_sinf(float a); +static __device__ __forceinline__ float __float_simpl_cosf(float a); +__CUDA_FP16_DECL__ __half __hsin_internal(const __half a) { + float f = __half2float(a); + f = __float_simpl_sinf(f); + return __float2half_rn(f); +} +__CUDA_FP16_DECL__ __half hsin(const __half a) { + __half r = __hsin_internal(a); + asm("{\n\t" + " .reg.b16 i,r,t; \n\t" + " mov.b16 r, %0; \n\t" + " mov.b16 i, %1; \n\t" + " mov.b16 t, 0x8000U; \n\t" + " and.b16 t,r,t; \n\t" + __SPEC_CASE(i, r, 0X32B3U, 0x0800U) + __SPEC_CASE(i, r, 0X5CB0U, 0x1000U) + __SPEC_CASE(i, r, 0XB2B3U, 0x8800U) + __SPEC_CASE(i, r, 0XDCB0U, 0x9000U) + " or.b16 r,r,t; \n\t" + " mov.b16 %0, r; \n" + "}\n" : "+h"(__HALF_TO_US(r)) : "h"(__HALF_TO_CUS(a))); + return r; +} +__CUDA_FP16_DECL__ __half2 h2sin(const __half2 a) { + const __half l = __low2half(a); + const __half h = __high2half(a); + const __half sl = __hsin_internal(l); + const __half sh = __hsin_internal(h); + __half2 r = __halves2half2(sl, sh); + asm("{\n\t" + " .reg.b32 i,r,t; \n\t" + " mov.b32 r, %0; \n\t" + " mov.b32 i, %1; \n\t" + " and.b32 t, r, 0x80008000U; \n\t" + __SPEC_CASE2(i, r, 0X32B332B3U, 0x08000800U) + __SPEC_CASE2(i, r, 0X5CB05CB0U, 0x10001000U) + __SPEC_CASE2(i, r, 0XB2B3B2B3U, 0x88008800U) + __SPEC_CASE2(i, r, 0XDCB0DCB0U, 0x90009000U) + " or.b32 r, r, t; \n\t" + " mov.b32 %0, r; \n" + "}\n" : "+r"(__HALF2_TO_UI(r)) : "r"(__HALF2_TO_CUI(a))); + return r; +} +__CUDA_FP16_DECL__ __half __hcos_internal(const __half a) { + float f = __half2float(a); + f = __float_simpl_cosf(f); + return __float2half_rn(f); +} +__CUDA_FP16_DECL__ __half hcos(const __half a) { + __half r = __hcos_internal(a); + asm("{\n\t" + " .reg.b16 i,r; \n\t" + " mov.b16 r, %0; \n\t" + " mov.b16 i, %1; \n\t" + __SPEC_CASE(i, r, 0X2B7CU, 0x1000U) + __SPEC_CASE(i, r, 0XAB7CU, 0x1000U) + " mov.b16 %0, r; \n" + "}\n" : "+h"(__HALF_TO_US(r)) : "h"(__HALF_TO_CUS(a))); + return r; +} +__CUDA_FP16_DECL__ __half2 h2cos(const __half2 a) { + const __half l = __low2half(a); + const __half h = __high2half(a); + const __half cl = __hcos_internal(l); + const __half ch = __hcos_internal(h); + __half2 r = __halves2half2(cl, ch); + asm("{\n\t" + " .reg.b32 i,r; \n\t" + " mov.b32 r, %0; \n\t" + " mov.b32 i, %1; \n\t" + __SPEC_CASE2(i, r, 0X2B7C2B7CU, 0x10001000U) + __SPEC_CASE2(i, r, 0XAB7CAB7CU, 0x10001000U) + " mov.b32 %0, r; \n" + "}\n" : "+r"(__HALF2_TO_UI(r)) : "r"(__HALF2_TO_CUI(a))); + return r; +} +static __device__ __forceinline__ float __internal_trig_reduction_kernel(const float a, int *quadrant) +{ + const int q = __float2int_rn(a * 0.636619772F); + const float j = static_cast(q); + float t = __fmaf_rn(-j, 1.5707962512969971e+000F, a); + t = __fmaf_rn(-j, 7.5497894158615964e-008F, t); + *quadrant = q; + return t; +} +static __device__ __forceinline__ float __internal_sin_cos_kernel(float x, const int i) +{ + float z; + const float x2 = x*x; + + if ((static_cast(i) & 1U) != 0U) { + z = 2.44331571e-5F; + z = __fmaf_rn(z, x2, -1.38873163e-3F); + } + else { + z = -1.95152959e-4F; + z = __fmaf_rn(z, x2, 8.33216087e-3F); + } + if ((static_cast(i) & 1U) != 0U) { + z = __fmaf_rn(z, x2, 4.16666457e-2F); + z = __fmaf_rn(z, x2, -5.00000000e-1F); + } + else { + z = __fmaf_rn(z, x2, -1.66666546e-1F); + z = __fmaf_rn(z, x2, 0.0F); + } + if ((static_cast(i) & 1U) != 0U) { + x = __fmaf_rn(z, x2, 1.0F); + } + else { + x = __fmaf_rn(z, x, x); + } + if ((static_cast(i) & 2U) != 0U) { + x = __fmaf_rn(x, -1.0F, 0.0F); + } + return x; +} +static __device__ __forceinline__ float __float_simpl_sinf(float a) +{ + float z; + int i; + if (::isinf(a)) { + a = a * 0.0F; + } + a = __internal_trig_reduction_kernel(a, &i); + z = __internal_sin_cos_kernel(a, i); + return z; +} +static __device__ __forceinline__ float __float_simpl_cosf(float a) +{ + float z; + int i; + if (::isinf(a)) { + a = a * 0.0F; + } + a = __internal_trig_reduction_kernel(a, &i); + i++; + z = __internal_sin_cos_kernel(a, i); + return z; +} + +__CUDA_FP16_DECL__ __half hexp(const __half a) { + __half val; + asm("{.reg.b32 f, C; \n" + " .reg.b16 h,r; \n" + " mov.b16 h,%1; \n" + " cvt.f32.f16 f,h; \n" + " mov.b32 C, 0x3fb8aa3bU; \n" + " mul.f32 f,f,C; \n" + " ex2.approx.f32 f,f; \n" + " cvt.rn.f16.f32 r,f; \n" + __SPEC_CASE(h, r, 0X1F79U, 0x9400U) + __SPEC_CASE(h, r, 0X25CFU, 0x9400U) + __SPEC_CASE(h, r, 0XC13BU, 0x0400U) + __SPEC_CASE(h, r, 0XC1EFU, 0x0200U) + " mov.b16 %0,r; \n" + "}": "=h"(__HALF_TO_US(val)) : "h"(__HALF_TO_CUS(a))); + return val; +} +__CUDA_FP16_DECL__ __half2 h2exp(const __half2 a) { + __half2 val; + asm("{.reg.b16 hl, hu; \n" + " .reg.b32 h,r,fl,fu, C; \n" + " mov.b32 {hl, hu}, %1; \n" + " mov.b32 h, %1; \n" + " cvt.f32.f16 fl, hl; \n" + " cvt.f32.f16 fu, hu; \n" + " mov.b32 C, 0x3fb8aa3bU; \n" + " mul.f32 fl,fl,C; \n" + " mul.f32 fu,fu,C; \n" + " ex2.approx.f32 fl, fl; \n" + " ex2.approx.f32 fu, fu; \n" + " cvt.rn.f16.f32 hl, fl; \n" + " cvt.rn.f16.f32 hu, fu; \n" + " mov.b32 r, {hl, hu}; \n" + __SPEC_CASE2(h, r, 0X1F791F79U, 0x94009400U) + __SPEC_CASE2(h, r, 0X25CF25CFU, 0x94009400U) + __SPEC_CASE2(h, r, 0XC13BC13BU, 0x04000400U) + __SPEC_CASE2(h, r, 0XC1EFC1EFU, 0x02000200U) + " mov.b32 %0, r; \n" + "}":"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); + return val; +} +__CUDA_FP16_DECL__ __half hexp2(const __half a) { + __half val; + asm("{.reg.b32 f, ULP; \n" + " .reg.b16 r; \n" + " mov.b16 r,%1; \n" + " cvt.f32.f16 f,r; \n" + " ex2.approx.f32 f,f; \n" + " mov.b32 ULP, 0x33800000U;\n" + " fma.rn.f32 f,f,ULP,f; \n" + " cvt.rn.f16.f32 r,f; \n" + " mov.b16 %0,r; \n" + "}": "=h"(__HALF_TO_US(val)) : "h"(__HALF_TO_CUS(a))); + return val; +} +__CUDA_FP16_DECL__ __half2 h2exp2(const __half2 a) { + __half2 val; + asm("{.reg.b16 hl, hu; \n" + " .reg.b32 fl, fu, ULP; \n" + " mov.b32 {hl, hu}, %1; \n" + " cvt.f32.f16 fl, hl; \n" + " cvt.f32.f16 fu, hu; \n" + " ex2.approx.f32 fl, fl; \n" + " ex2.approx.f32 fu, fu; \n" + " mov.b32 ULP, 0x33800000U;\n" + " fma.rn.f32 fl,fl,ULP,fl; \n" + " fma.rn.f32 fu,fu,ULP,fu; \n" + " cvt.rn.f16.f32 hl, fl; \n" + " cvt.rn.f16.f32 hu, fu; \n" + " mov.b32 %0, {hl, hu}; \n" + "}":"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); + return val; +} +__CUDA_FP16_DECL__ __half hexp10(const __half a) { + __half val; + asm("{.reg.b16 h,r; \n" + " .reg.b32 f, C; \n" + " mov.b16 h, %1; \n" + " cvt.f32.f16 f, h; \n" + " mov.b32 C, 0x40549A78U; \n" + " mul.f32 f,f,C; \n" + " ex2.approx.f32 f, f; \n" + " cvt.rn.f16.f32 r, f; \n" + __SPEC_CASE(h, r, 0x34DEU, 0x9800U) + __SPEC_CASE(h, r, 0x9766U, 0x9000U) + __SPEC_CASE(h, r, 0x9972U, 0x1000U) + __SPEC_CASE(h, r, 0xA5C4U, 0x1000U) + __SPEC_CASE(h, r, 0xBF0AU, 0x8100U) + " mov.b16 %0, r; \n" + "}":"=h"(__HALF_TO_US(val)) : "h"(__HALF_TO_CUS(a))); + return val; +} +__CUDA_FP16_DECL__ __half2 h2exp10(const __half2 a) { + __half2 val; + asm("{.reg.b16 hl, hu; \n" + " .reg.b32 h,r,fl,fu, C; \n" + " mov.b32 {hl, hu}, %1; \n" + " mov.b32 h, %1; \n" + " cvt.f32.f16 fl, hl; \n" + " cvt.f32.f16 fu, hu; \n" + " mov.b32 C, 0x40549A78U; \n" + " mul.f32 fl,fl,C; \n" + " mul.f32 fu,fu,C; \n" + " ex2.approx.f32 fl, fl; \n" + " ex2.approx.f32 fu, fu; \n" + " cvt.rn.f16.f32 hl, fl; \n" + " cvt.rn.f16.f32 hu, fu; \n" + " mov.b32 r, {hl, hu}; \n" + __SPEC_CASE2(h, r, 0x34DE34DEU, 0x98009800U) + __SPEC_CASE2(h, r, 0x97669766U, 0x90009000U) + __SPEC_CASE2(h, r, 0x99729972U, 0x10001000U) + __SPEC_CASE2(h, r, 0xA5C4A5C4U, 0x10001000U) + __SPEC_CASE2(h, r, 0xBF0ABF0AU, 0x81008100U) + " mov.b32 %0, r; \n" + "}":"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); + return val; +} +__CUDA_FP16_DECL__ __half hlog2(const __half a) { + __half val; + asm("{.reg.b16 h, r; \n" + " .reg.b32 f; \n" + " mov.b16 h, %1; \n" + " cvt.f32.f16 f, h; \n" + " lg2.approx.f32 f, f; \n" + " cvt.rn.f16.f32 r, f; \n" + __SPEC_CASE(r, r, 0xA2E2U, 0x8080U) + __SPEC_CASE(r, r, 0xBF46U, 0x9400U) + " mov.b16 %0, r; \n" + "}":"=h"(__HALF_TO_US(val)) : "h"(__HALF_TO_CUS(a))); + return val; +} +__CUDA_FP16_DECL__ __half2 h2log2(const __half2 a) { + __half2 val; + asm("{.reg.b16 hl, hu; \n" + " .reg.b32 fl, fu, r, p; \n" + " mov.b32 {hl, hu}, %1; \n" + " cvt.f32.f16 fl, hl; \n" + " cvt.f32.f16 fu, hu; \n" + " lg2.approx.f32 fl, fl; \n" + " lg2.approx.f32 fu, fu; \n" + " cvt.rn.f16.f32 hl, fl; \n" + " cvt.rn.f16.f32 hu, fu; \n" + " mov.b32 r, {hl, hu}; \n" + __SPEC_CASE2(r, r, 0xA2E2A2E2U, 0x80808080U) + __SPEC_CASE2(r, r, 0xBF46BF46U, 0x94009400U) + " mov.b32 %0, r; \n" + "}":"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); + return val; +} +__CUDA_FP16_DECL__ __half hlog(const __half a) { + __half val; + asm("{.reg.b32 f, C; \n" + " .reg.b16 r,h; \n" + " mov.b16 h,%1; \n" + " cvt.f32.f16 f,h; \n" + " lg2.approx.f32 f,f; \n" + " mov.b32 C, 0x3f317218U; \n" + " mul.f32 f,f,C; \n" + " cvt.rn.f16.f32 r,f; \n" + __SPEC_CASE(h, r, 0X160DU, 0x9C00U) + __SPEC_CASE(h, r, 0X3BFEU, 0x8010U) + __SPEC_CASE(h, r, 0X3C0BU, 0x8080U) + __SPEC_CASE(h, r, 0X6051U, 0x1C00U) + " mov.b16 %0,r; \n" + "}": "=h"(__HALF_TO_US(val)) : "h"(__HALF_TO_CUS(a))); + return val; +} +__CUDA_FP16_DECL__ __half2 h2log(const __half2 a) { + __half2 val; + asm("{.reg.b16 hl, hu; \n" + " .reg.b32 r, fl, fu, C, h; \n" + " mov.b32 {hl, hu}, %1; \n" + " mov.b32 h, %1; \n" + " cvt.f32.f16 fl, hl; \n" + " cvt.f32.f16 fu, hu; \n" + " lg2.approx.f32 fl, fl; \n" + " lg2.approx.f32 fu, fu; \n" + " mov.b32 C, 0x3f317218U; \n" + " mul.f32 fl,fl,C; \n" + " mul.f32 fu,fu,C; \n" + " cvt.rn.f16.f32 hl, fl; \n" + " cvt.rn.f16.f32 hu, fu; \n" + " mov.b32 r, {hl, hu}; \n" + __SPEC_CASE2(h, r, 0X160D160DU, 0x9C009C00U) + __SPEC_CASE2(h, r, 0X3BFE3BFEU, 0x80108010U) + __SPEC_CASE2(h, r, 0X3C0B3C0BU, 0x80808080U) + __SPEC_CASE2(h, r, 0X60516051U, 0x1C001C00U) + " mov.b32 %0, r; \n" + "}":"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); + return val; +} +__CUDA_FP16_DECL__ __half hlog10(const __half a) { + __half val; + asm("{.reg.b16 h, r; \n" + " .reg.b32 f, C; \n" + " mov.b16 h, %1; \n" + " cvt.f32.f16 f, h; \n" + " lg2.approx.f32 f, f; \n" + " mov.b32 C, 0x3E9A209BU; \n" + " mul.f32 f,f,C; \n" + " cvt.rn.f16.f32 r, f; \n" + __SPEC_CASE(h, r, 0x338FU, 0x1000U) + __SPEC_CASE(h, r, 0x33F8U, 0x9000U) + __SPEC_CASE(h, r, 0x57E1U, 0x9800U) + __SPEC_CASE(h, r, 0x719DU, 0x9C00U) + " mov.b16 %0, r; \n" + "}":"=h"(__HALF_TO_US(val)) : "h"(__HALF_TO_CUS(a))); + return val; +} +__CUDA_FP16_DECL__ __half2 h2log10(const __half2 a) { + __half2 val; + asm("{.reg.b16 hl, hu; \n" + " .reg.b32 r, fl, fu, C, h; \n" + " mov.b32 {hl, hu}, %1; \n" + " mov.b32 h, %1; \n" + " cvt.f32.f16 fl, hl; \n" + " cvt.f32.f16 fu, hu; \n" + " lg2.approx.f32 fl, fl; \n" + " lg2.approx.f32 fu, fu; \n" + " mov.b32 C, 0x3E9A209BU; \n" + " mul.f32 fl,fl,C; \n" + " mul.f32 fu,fu,C; \n" + " cvt.rn.f16.f32 hl, fl; \n" + " cvt.rn.f16.f32 hu, fu; \n" + " mov.b32 r, {hl, hu}; \n" + __SPEC_CASE2(h, r, 0x338F338FU, 0x10001000U) + __SPEC_CASE2(h, r, 0x33F833F8U, 0x90009000U) + __SPEC_CASE2(h, r, 0x57E157E1U, 0x98009800U) + __SPEC_CASE2(h, r, 0x719D719DU, 0x9C009C00U) + " mov.b32 %0, r; \n" + "}":"=r"(__HALF2_TO_UI(val)) : "r"(__HALF2_TO_CUI(a))); + return val; +} +#undef __SPEC_CASE2 +#undef __SPEC_CASE +__CUDA_FP16_DECL__ __half2 h2rcp(const __half2 a) { + __APPROX_FCAST2(rcp) +} +__CUDA_FP16_DECL__ __half hrcp(const __half a) { + __APPROX_FCAST(rcp) +} +__CUDA_FP16_DECL__ __half2 h2rsqrt(const __half2 a) { + __APPROX_FCAST2(rsqrt) +} +__CUDA_FP16_DECL__ __half hrsqrt(const __half a) { + __APPROX_FCAST(rsqrt) +} +__CUDA_FP16_DECL__ __half2 h2sqrt(const __half2 a) { + __APPROX_FCAST2(sqrt) +} +__CUDA_FP16_DECL__ __half hsqrt(const __half a) { + __APPROX_FCAST(sqrt) +} +#undef __APPROX_FCAST +#undef __APPROX_FCAST2 +__CUDA_FP16_DECL__ __half2 __hisnan2(const __half2 a) +{ + __half2 r; + asm("{set.nan.f16x2.f16x2 %0,%1,%2;\n}" + :"=r"(__HALF2_TO_UI(r)) : "r"(__HALF2_TO_CUI(a)), "r"(__HALF2_TO_CUI(a))); + return r; +} +__CUDA_FP16_DECL__ bool __hisnan(const __half a) +{ + __half r; + asm("{set.nan.f16.f16 %0,%1,%2;\n}" + :"=h"(__HALF_TO_US(r)) : "h"(__HALF_TO_CUS(a)), "h"(__HALF_TO_CUS(a))); + return __HALF_TO_CUS(r) != 0U; +} +__CUDA_FP16_DECL__ __half2 __hneg2(const __half2 a) +{ + __half2 r; + asm("{neg.f16x2 %0,%1;\n}" + :"=r"(__HALF2_TO_UI(r)) : "r"(__HALF2_TO_CUI(a))); + return r; +} +__CUDA_FP16_DECL__ __half __hneg(const __half a) +{ + __half r; + asm("{neg.f16 %0,%1;\n}" + :"=h"(__HALF_TO_US(r)) : "h"(__HALF_TO_CUS(a))); + return r; +} +__CUDA_FP16_DECL__ __half2 __habs2(const __half2 a) +{ + __half2 r; + asm("{abs.f16x2 %0,%1;\n}" + :"=r"(__HALF2_TO_UI(r)) : "r"(__HALF2_TO_CUI(a))); + return r; +} +__CUDA_FP16_DECL__ __half __habs(const __half a) +{ + __half r; + asm("{abs.f16 %0,%1;\n}" + :"=h"(__HALF_TO_US(r)) : "h"(__HALF_TO_CUS(a))); + return r; +} + +__CUDA_FP16_DECL__ __half2 __hcmadd(const __half2 a, const __half2 b, const __half2 c) +{ + // fast version of complex multiply-accumulate + // (a.re, a.im) * (b.re, b.im) + (c.re, c.im) + // acc.re = (c.re + a.re*b.re) - a.im*b.im + // acc.im = (c.im + a.re*b.im) + a.im*b.re + const __half2 a_re = __half2half2(a.x); + __half2 acc = __hfma2(a_re, b, c); + const __half2 a_im = __half2half2(a.y); + const __half2 ib = __halves2half2(__hneg(b.y), b.x); + acc = __hfma2(a_im, ib, acc); + return acc; +} +#endif /*__CUDA_ARCH__ >= 530 || !defined(__CUDA_ARCH__)*/ + +#if __CUDA_ARCH__ >= 800 || !defined(__CUDA_ARCH__) +/****************************************************************************** +* __half arithmetic * +******************************************************************************/ +__CUDA_FP16_DECL__ __half __hmax(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(max) +} +__CUDA_FP16_DECL__ __half __hmin(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(min) +} +__CUDA_FP16_DECL__ __half __hmax_nan(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(max.NaN) +} +__CUDA_FP16_DECL__ __half __hmin_nan(const __half a, const __half b) +{ + __BINARY_OP_HALF_MACRO(min.NaN) +} +__CUDA_FP16_DECL__ __half __hfma_relu(const __half a, const __half b, const __half c) +{ + __TERNARY_OP_HALF_MACRO(fma.rn.relu) +} +/****************************************************************************** +* __half2 arithmetic * +******************************************************************************/ +__CUDA_FP16_DECL__ __half2 __hmax2(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(max) +} +__CUDA_FP16_DECL__ __half2 __hmin2(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(min) +} +__CUDA_FP16_DECL__ __half2 __hmax2_nan(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(max.NaN) +} +__CUDA_FP16_DECL__ __half2 __hmin2_nan(const __half2 a, const __half2 b) +{ + __BINARY_OP_HALF2_MACRO(min.NaN) +} +__CUDA_FP16_DECL__ __half2 __hfma2_relu(const __half2 a, const __half2 b, const __half2 c) +{ + __TERNARY_OP_HALF2_MACRO(fma.rn.relu) +} +#endif /*__CUDA_ARCH__ >= 800 || !defined(__CUDA_ARCH__)*/ + +/* Define __PTR for atomicAdd prototypes below, undef after done */ +#if (defined(_MSC_VER) && defined(_WIN64)) || defined(__LP64__) || defined(__CUDACC_RTC__) +#define __PTR "l" +#else +#define __PTR "r" +#endif /*(defined(_MSC_VER) && defined(_WIN64)) || defined(__LP64__) || defined(__CUDACC_RTC__)*/ + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600 + +__CUDA_FP16_DECL__ __half2 atomicAdd(__half2 *const address, const __half2 val) { + __half2 r; + asm volatile ("{ atom.add.noftz.f16x2 %0,[%1],%2; }\n" + : "=r"(__HALF2_TO_UI(r)) : __PTR(address), "r"(__HALF2_TO_CUI(val)) + : "memory"); + return r; +} + +#endif /*!defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600*/ + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 700 + +__CUDA_FP16_DECL__ __half atomicAdd(__half *const address, const __half val) { + __half r; + asm volatile ("{ atom.add.noftz.f16 %0,[%1],%2; }\n" + : "=h"(__HALF_TO_US(r)) + : __PTR(address), "h"(__HALF_TO_CUS(val)) + : "memory"); + return r; +} + +#endif /*!defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 700*/ + +#undef __PTR + +#undef __CUDA_FP16_DECL__ +#endif /* defined(__CUDACC__) */ +#endif /* defined(__cplusplus) */ + +#undef __TERNARY_OP_HALF2_MACRO +#undef __TERNARY_OP_HALF_MACRO +#undef __BINARY_OP_HALF2_MACRO +#undef __BINARY_OP_HALF_MACRO + +#undef __CUDA_HOSTDEVICE_FP16_DECL__ +#undef __CUDA_FP16_DECL__ + +/* Define first-class types "half" and "half2", unless user specifies otherwise via "#define CUDA_NO_HALF" */ +/* C cannot ever have these types defined here, because __half and __half2 are C++ classes */ +#if defined(__cplusplus) && !defined(CUDA_NO_HALF) +typedef __half half; +typedef __half2 half2; +// for consistency with __nv_bfloat16 +typedef __half __nv_half; +typedef __half2 __nv_half2; +typedef __half_raw __nv_half_raw; +typedef __half2_raw __nv_half2_raw; +typedef __half nv_half; +typedef __half2 nv_half2; +#endif /* defined(__cplusplus) && !defined(CUDA_NO_HALF) */ + +#if defined(__CPP_VERSION_AT_LEAST_11_FP16) +#undef __CPP_VERSION_AT_LEAST_11_FP16 +#endif /* defined(__CPP_VERSION_AT_LEAST_11_FP16) */ + +#endif /* end of include guard: __CUDA_FP16_HPP__ */ diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cuda_paths.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cuda_paths.py new file mode 100644 index 0000000000000000000000000000000000000000..8ff96640d16bab02679117b3df61c546717ced39 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cuda_paths.py @@ -0,0 +1,258 @@ +import sys +import re +import os +from collections import namedtuple + +from numba.core.config import IS_WIN32 +from numba.misc.findlib import find_lib, find_file + + +_env_path_tuple = namedtuple('_env_path_tuple', ['by', 'info']) + + +def _find_valid_path(options): + """Find valid path from *options*, which is a list of 2-tuple of + (name, path). Return first pair where *path* is not None. + If no valid path is found, return ('', None) + """ + for by, data in options: + if data is not None: + return by, data + else: + return '', None + + +def _get_libdevice_path_decision(): + options = [ + ('Conda environment', get_conda_ctk()), + ('Conda environment (NVIDIA package)', get_nvidia_libdevice_ctk()), + ('CUDA_HOME', get_cuda_home('nvvm', 'libdevice')), + ('System', get_system_ctk('nvvm', 'libdevice')), + ('Debian package', get_debian_pkg_libdevice()), + ] + by, libdir = _find_valid_path(options) + return by, libdir + + +def _nvvm_lib_dir(): + if IS_WIN32: + return 'nvvm', 'bin' + else: + return 'nvvm', 'lib64' + + +def _get_nvvm_path_decision(): + options = [ + ('Conda environment', get_conda_ctk()), + ('Conda environment (NVIDIA package)', get_nvidia_nvvm_ctk()), + ('CUDA_HOME', get_cuda_home(*_nvvm_lib_dir())), + ('System', get_system_ctk(*_nvvm_lib_dir())), + ] + by, path = _find_valid_path(options) + return by, path + + +def _get_libdevice_paths(): + by, libdir = _get_libdevice_path_decision() + # Search for pattern + pat = r'libdevice(\.\d+)*\.bc$' + candidates = find_file(re.compile(pat), libdir) + # Keep only the max (most recent version) of the bitcode files. + out = max(candidates, default=None) + return _env_path_tuple(by, out) + + +def _cudalib_path(): + if IS_WIN32: + return 'bin' + else: + return 'lib64' + + +def _cuda_home_static_cudalib_path(): + if IS_WIN32: + return ('lib', 'x64') + else: + return ('lib64',) + + +def _get_cudalib_dir_path_decision(): + options = [ + ('Conda environment', get_conda_ctk()), + ('Conda environment (NVIDIA package)', get_nvidia_cudalib_ctk()), + ('CUDA_HOME', get_cuda_home(_cudalib_path())), + ('System', get_system_ctk(_cudalib_path())), + ] + by, libdir = _find_valid_path(options) + return by, libdir + + +def _get_static_cudalib_dir_path_decision(): + options = [ + ('Conda environment', get_conda_ctk()), + ('Conda environment (NVIDIA package)', get_nvidia_static_cudalib_ctk()), + ('CUDA_HOME', get_cuda_home(*_cuda_home_static_cudalib_path())), + ('System', get_system_ctk(_cudalib_path())), + ] + by, libdir = _find_valid_path(options) + return by, libdir + + +def _get_cudalib_dir(): + by, libdir = _get_cudalib_dir_path_decision() + return _env_path_tuple(by, libdir) + + +def _get_static_cudalib_dir(): + by, libdir = _get_static_cudalib_dir_path_decision() + return _env_path_tuple(by, libdir) + + +def get_system_ctk(*subdirs): + """Return path to system-wide cudatoolkit; or, None if it doesn't exist. + """ + # Linux? + if sys.platform.startswith('linux'): + # Is cuda alias to /usr/local/cuda? + # We are intentionally not getting versioned cuda installation. + base = '/usr/local/cuda' + if os.path.exists(base): + return os.path.join(base, *subdirs) + + +def get_conda_ctk(): + """Return path to directory containing the shared libraries of cudatoolkit. + """ + is_conda_env = os.path.exists(os.path.join(sys.prefix, 'conda-meta')) + if not is_conda_env: + return + # Assume the existence of NVVM to imply cudatoolkit installed + paths = find_lib('nvvm') + if not paths: + return + # Use the directory name of the max path + return os.path.dirname(max(paths)) + + +def get_nvidia_nvvm_ctk(): + """Return path to directory containing the NVVM shared library. + """ + is_conda_env = os.path.exists(os.path.join(sys.prefix, 'conda-meta')) + if not is_conda_env: + return + + # Assume the existence of NVVM in the conda env implies that a CUDA toolkit + # conda package is installed. + + # First, try the location used on Linux and the Windows 11.x packages + libdir = os.path.join(sys.prefix, 'nvvm', _cudalib_path()) + if not os.path.exists(libdir) or not os.path.isdir(libdir): + # If that fails, try the location used for Windows 12.x packages + libdir = os.path.join(sys.prefix, 'Library', 'nvvm', _cudalib_path()) + if not os.path.exists(libdir) or not os.path.isdir(libdir): + # If that doesn't exist either, assume we don't have the NVIDIA + # conda package + return + + paths = find_lib('nvvm', libdir=libdir) + if not paths: + return + # Use the directory name of the max path + return os.path.dirname(max(paths)) + + +def get_nvidia_libdevice_ctk(): + """Return path to directory containing the libdevice library. + """ + nvvm_ctk = get_nvidia_nvvm_ctk() + if not nvvm_ctk: + return + nvvm_dir = os.path.dirname(nvvm_ctk) + return os.path.join(nvvm_dir, 'libdevice') + + +def get_nvidia_cudalib_ctk(): + """Return path to directory containing the shared libraries of cudatoolkit. + """ + nvvm_ctk = get_nvidia_nvvm_ctk() + if not nvvm_ctk: + return + env_dir = os.path.dirname(os.path.dirname(nvvm_ctk)) + subdir = 'bin' if IS_WIN32 else 'lib' + return os.path.join(env_dir, subdir) + + +def get_nvidia_static_cudalib_ctk(): + """Return path to directory containing the static libraries of cudatoolkit. + """ + nvvm_ctk = get_nvidia_nvvm_ctk() + if not nvvm_ctk: + return + + if IS_WIN32 and ("Library" not in nvvm_ctk): + # Location specific to CUDA 11.x packages on Windows + dirs = ('Lib', 'x64') + else: + # Linux, or Windows with CUDA 12.x packages + dirs = ('lib',) + + env_dir = os.path.dirname(os.path.dirname(nvvm_ctk)) + return os.path.join(env_dir, *dirs) + + +def get_cuda_home(*subdirs): + """Get paths of CUDA_HOME. + If *subdirs* are the subdirectory name to be appended in the resulting + path. + """ + cuda_home = os.environ.get('CUDA_HOME') + if cuda_home is None: + # Try Windows CUDA installation without Anaconda + cuda_home = os.environ.get('CUDA_PATH') + if cuda_home is not None: + return os.path.join(cuda_home, *subdirs) + + +def _get_nvvm_path(): + by, path = _get_nvvm_path_decision() + candidates = find_lib('nvvm', path) + path = max(candidates) if candidates else None + return _env_path_tuple(by, path) + + +def get_cuda_paths(): + """Returns a dictionary mapping component names to a 2-tuple + of (source_variable, info). + + The returned dictionary will have the following keys and infos: + - "nvvm": file_path + - "libdevice": List[Tuple[arch, file_path]] + - "cudalib_dir": directory_path + + Note: The result of the function is cached. + """ + # Check cache + if hasattr(get_cuda_paths, '_cached_result'): + return get_cuda_paths._cached_result + else: + # Not in cache + d = { + 'nvvm': _get_nvvm_path(), + 'libdevice': _get_libdevice_paths(), + 'cudalib_dir': _get_cudalib_dir(), + 'static_cudalib_dir': _get_static_cudalib_dir(), + } + # Cache result + get_cuda_paths._cached_result = d + return d + + +def get_debian_pkg_libdevice(): + """ + Return the Debian NVIDIA Maintainers-packaged libdevice location, if it + exists. + """ + pkg_libdevice_location = '/usr/lib/nvidia-cuda-toolkit/libdevice' + if not os.path.exists(pkg_libdevice_location): + return None + return pkg_libdevice_location diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cudadecl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cudadecl.py new file mode 100644 index 0000000000000000000000000000000000000000..dde8977936e79d90fb911268d767e9144d65aa9a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cudadecl.py @@ -0,0 +1,806 @@ +import operator +from numba.core import types +from numba.core.typing.npydecl import (parse_dtype, parse_shape, + register_number_classes, + register_numpy_ufunc, + trigonometric_functions, + comparison_functions, + math_operations, + bit_twiddling_functions) +from numba.core.typing.templates import (AttributeTemplate, ConcreteTemplate, + AbstractTemplate, CallableTemplate, + signature, Registry) +from numba.cuda.types import dim3 +from numba.core.typeconv import Conversion +from numba import cuda +from numba.cuda.compiler import declare_device_function_template + +registry = Registry() +register = registry.register +register_attr = registry.register_attr +register_global = registry.register_global + +register_number_classes(register_global) + + +class Cuda_array_decl(CallableTemplate): + def generic(self): + def typer(shape, dtype): + + # Only integer literals and tuples of integer literals are valid + # shapes + if isinstance(shape, types.Integer): + if not isinstance(shape, types.IntegerLiteral): + return None + elif isinstance(shape, (types.Tuple, types.UniTuple)): + if any([not isinstance(s, types.IntegerLiteral) + for s in shape]): + return None + else: + return None + + ndim = parse_shape(shape) + nb_dtype = parse_dtype(dtype) + if nb_dtype is not None and ndim is not None: + return types.Array(dtype=nb_dtype, ndim=ndim, layout='C') + + return typer + + +@register +class Cuda_shared_array(Cuda_array_decl): + key = cuda.shared.array + + +@register +class Cuda_local_array(Cuda_array_decl): + key = cuda.local.array + + +@register +class Cuda_const_array_like(CallableTemplate): + key = cuda.const.array_like + + def generic(self): + def typer(ndarray): + return ndarray + return typer + + +@register +class Cuda_threadfence_device(ConcreteTemplate): + key = cuda.threadfence + cases = [signature(types.none)] + + +@register +class Cuda_threadfence_block(ConcreteTemplate): + key = cuda.threadfence_block + cases = [signature(types.none)] + + +@register +class Cuda_threadfence_system(ConcreteTemplate): + key = cuda.threadfence_system + cases = [signature(types.none)] + + +@register +class Cuda_syncwarp(ConcreteTemplate): + key = cuda.syncwarp + cases = [signature(types.none), signature(types.none, types.i4)] + + +@register +class Cuda_shfl_sync_intrinsic(ConcreteTemplate): + key = cuda.shfl_sync_intrinsic + cases = [ + signature(types.Tuple((types.i4, types.b1)), + types.i4, types.i4, types.i4, types.i4, types.i4), + signature(types.Tuple((types.i8, types.b1)), + types.i4, types.i4, types.i8, types.i4, types.i4), + signature(types.Tuple((types.f4, types.b1)), + types.i4, types.i4, types.f4, types.i4, types.i4), + signature(types.Tuple((types.f8, types.b1)), + types.i4, types.i4, types.f8, types.i4, types.i4), + ] + + +@register +class Cuda_vote_sync_intrinsic(ConcreteTemplate): + key = cuda.vote_sync_intrinsic + cases = [signature(types.Tuple((types.i4, types.b1)), + types.i4, types.i4, types.b1)] + + +@register +class Cuda_match_any_sync(ConcreteTemplate): + key = cuda.match_any_sync + cases = [ + signature(types.i4, types.i4, types.i4), + signature(types.i4, types.i4, types.i8), + signature(types.i4, types.i4, types.f4), + signature(types.i4, types.i4, types.f8), + ] + + +@register +class Cuda_match_all_sync(ConcreteTemplate): + key = cuda.match_all_sync + cases = [ + signature(types.Tuple((types.i4, types.b1)), types.i4, types.i4), + signature(types.Tuple((types.i4, types.b1)), types.i4, types.i8), + signature(types.Tuple((types.i4, types.b1)), types.i4, types.f4), + signature(types.Tuple((types.i4, types.b1)), types.i4, types.f8), + ] + + +@register +class Cuda_activemask(ConcreteTemplate): + key = cuda.activemask + cases = [signature(types.uint32)] + + +@register +class Cuda_lanemask_lt(ConcreteTemplate): + key = cuda.lanemask_lt + cases = [signature(types.uint32)] + + +@register +class Cuda_popc(ConcreteTemplate): + """ + Supported types from `llvm.popc` + [here](http://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#bit-manipulations-intrinics) + """ + key = cuda.popc + cases = [ + signature(types.int8, types.int8), + signature(types.int16, types.int16), + signature(types.int32, types.int32), + signature(types.int64, types.int64), + signature(types.uint8, types.uint8), + signature(types.uint16, types.uint16), + signature(types.uint32, types.uint32), + signature(types.uint64, types.uint64), + ] + + +@register +class Cuda_fma(ConcreteTemplate): + """ + Supported types from `llvm.fma` + [here](https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#standard-c-library-intrinics) + """ + key = cuda.fma + cases = [ + signature(types.float32, types.float32, types.float32, types.float32), + signature(types.float64, types.float64, types.float64, types.float64), + ] + + +@register +class Cuda_hfma(ConcreteTemplate): + key = cuda.fp16.hfma + cases = [ + signature(types.float16, types.float16, types.float16, types.float16) + ] + + +@register +class Cuda_cbrt(ConcreteTemplate): + + key = cuda.cbrt + cases = [ + signature(types.float32, types.float32), + signature(types.float64, types.float64), + ] + + +@register +class Cuda_brev(ConcreteTemplate): + key = cuda.brev + cases = [ + signature(types.uint32, types.uint32), + signature(types.uint64, types.uint64), + ] + + +@register +class Cuda_clz(ConcreteTemplate): + """ + Supported types from `llvm.ctlz` + [here](http://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#bit-manipulations-intrinics) + """ + key = cuda.clz + cases = [ + signature(types.int8, types.int8), + signature(types.int16, types.int16), + signature(types.int32, types.int32), + signature(types.int64, types.int64), + signature(types.uint8, types.uint8), + signature(types.uint16, types.uint16), + signature(types.uint32, types.uint32), + signature(types.uint64, types.uint64), + ] + + +@register +class Cuda_ffs(ConcreteTemplate): + """ + Supported types from `llvm.cttz` + [here](http://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#bit-manipulations-intrinics) + """ + key = cuda.ffs + cases = [ + signature(types.uint32, types.int8), + signature(types.uint32, types.int16), + signature(types.uint32, types.int32), + signature(types.uint32, types.int64), + signature(types.uint32, types.uint8), + signature(types.uint32, types.uint16), + signature(types.uint32, types.uint32), + signature(types.uint32, types.uint64), + ] + + +@register +class Cuda_selp(AbstractTemplate): + key = cuda.selp + + def generic(self, args, kws): + assert not kws + test, a, b = args + + # per docs + # http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#comparison-and-selection-instructions-selp + supported_types = (types.float64, types.float32, + types.int16, types.uint16, + types.int32, types.uint32, + types.int64, types.uint64) + + if a != b or a not in supported_types: + return + + return signature(a, test, a, a) + + +def _genfp16_unary(l_key): + @register + class Cuda_fp16_unary(ConcreteTemplate): + key = l_key + cases = [signature(types.float16, types.float16)] + + return Cuda_fp16_unary + + +def _genfp16_unary_operator(l_key): + @register_global(l_key) + class Cuda_fp16_unary(AbstractTemplate): + key = l_key + + def generic(self, args, kws): + assert not kws + if len(args) == 1 and args[0] == types.float16: + return signature(types.float16, types.float16) + + return Cuda_fp16_unary + + +def _genfp16_binary(l_key): + @register + class Cuda_fp16_binary(ConcreteTemplate): + key = l_key + cases = [signature(types.float16, types.float16, types.float16)] + + return Cuda_fp16_binary + + +@register_global(float) +class Float(AbstractTemplate): + + def generic(self, args, kws): + assert not kws + + [arg] = args + + if arg == types.float16: + return signature(arg, arg) + + +def _genfp16_binary_comparison(l_key): + @register + class Cuda_fp16_cmp(ConcreteTemplate): + key = l_key + + cases = [ + signature(types.b1, types.float16, types.float16) + ] + return Cuda_fp16_cmp + +# If multiple ConcreteTemplates provide typing for a single function, then +# function resolution will pick the first compatible typing it finds even if it +# involves inserting a cast that would be considered undesirable (in this +# specific case, float16s could be cast to float32s for comparisons). +# +# To work around this, we instead use an AbstractTemplate that implements +# exactly the casting logic that we desire. The AbstractTemplate gets +# considered in preference to ConcreteTemplates during typing. +# +# This is tracked as Issue #7863 (https://github.com/numba/numba/issues/7863) - +# once this is resolved it should be possible to replace this AbstractTemplate +# with a ConcreteTemplate to simplify the logic. + + +def _fp16_binary_operator(l_key, retty): + @register_global(l_key) + class Cuda_fp16_operator(AbstractTemplate): + key = l_key + + def generic(self, args, kws): + assert not kws + + if len(args) == 2 and \ + (args[0] == types.float16 or args[1] == types.float16): + if (args[0] == types.float16): + convertible = self.context.can_convert(args[1], args[0]) + else: + convertible = self.context.can_convert(args[0], args[1]) + + # We allow three cases here: + # + # 1. fp16 to fp16 - Conversion.exact + # 2. fp16 to other types fp16 can be promoted to + # - Conversion.promote + # 3. fp16 to int8 (safe conversion) - + # - Conversion.safe + + if (convertible == Conversion.exact) or \ + (convertible == Conversion.promote) or \ + (convertible == Conversion.safe): + return signature(retty, types.float16, types.float16) + + return Cuda_fp16_operator + + +def _genfp16_comparison_operator(op): + return _fp16_binary_operator(op, types.b1) + + +def _genfp16_binary_operator(op): + return _fp16_binary_operator(op, types.float16) + + +Cuda_hadd = _genfp16_binary(cuda.fp16.hadd) +Cuda_add = _genfp16_binary_operator(operator.add) +Cuda_iadd = _genfp16_binary_operator(operator.iadd) +Cuda_hsub = _genfp16_binary(cuda.fp16.hsub) +Cuda_sub = _genfp16_binary_operator(operator.sub) +Cuda_isub = _genfp16_binary_operator(operator.isub) +Cuda_hmul = _genfp16_binary(cuda.fp16.hmul) +Cuda_mul = _genfp16_binary_operator(operator.mul) +Cuda_imul = _genfp16_binary_operator(operator.imul) +Cuda_hmax = _genfp16_binary(cuda.fp16.hmax) +Cuda_hmin = _genfp16_binary(cuda.fp16.hmin) +Cuda_hneg = _genfp16_unary(cuda.fp16.hneg) +Cuda_neg = _genfp16_unary_operator(operator.neg) +Cuda_habs = _genfp16_unary(cuda.fp16.habs) +Cuda_abs = _genfp16_unary_operator(abs) +Cuda_heq = _genfp16_binary_comparison(cuda.fp16.heq) +_genfp16_comparison_operator(operator.eq) +Cuda_hne = _genfp16_binary_comparison(cuda.fp16.hne) +_genfp16_comparison_operator(operator.ne) +Cuda_hge = _genfp16_binary_comparison(cuda.fp16.hge) +_genfp16_comparison_operator(operator.ge) +Cuda_hgt = _genfp16_binary_comparison(cuda.fp16.hgt) +_genfp16_comparison_operator(operator.gt) +Cuda_hle = _genfp16_binary_comparison(cuda.fp16.hle) +_genfp16_comparison_operator(operator.le) +Cuda_hlt = _genfp16_binary_comparison(cuda.fp16.hlt) +_genfp16_comparison_operator(operator.lt) +_genfp16_binary_operator(operator.truediv) +_genfp16_binary_operator(operator.itruediv) + + +def _resolve_wrapped_unary(fname): + decl = declare_device_function_template(f'__numba_wrapper_{fname}', + types.float16, + (types.float16,)) + return types.Function(decl) + + +def _resolve_wrapped_binary(fname): + decl = declare_device_function_template(f'__numba_wrapper_{fname}', + types.float16, + (types.float16, types.float16,)) + return types.Function(decl) + + +hsin_device = _resolve_wrapped_unary('hsin') +hcos_device = _resolve_wrapped_unary('hcos') +hlog_device = _resolve_wrapped_unary('hlog') +hlog10_device = _resolve_wrapped_unary('hlog10') +hlog2_device = _resolve_wrapped_unary('hlog2') +hexp_device = _resolve_wrapped_unary('hexp') +hexp10_device = _resolve_wrapped_unary('hexp10') +hexp2_device = _resolve_wrapped_unary('hexp2') +hsqrt_device = _resolve_wrapped_unary('hsqrt') +hrsqrt_device = _resolve_wrapped_unary('hrsqrt') +hfloor_device = _resolve_wrapped_unary('hfloor') +hceil_device = _resolve_wrapped_unary('hceil') +hrcp_device = _resolve_wrapped_unary('hrcp') +hrint_device = _resolve_wrapped_unary('hrint') +htrunc_device = _resolve_wrapped_unary('htrunc') +hdiv_device = _resolve_wrapped_binary('hdiv') + + +# generate atomic operations +def _gen(l_key, supported_types): + @register + class Cuda_atomic(AbstractTemplate): + key = l_key + + def generic(self, args, kws): + assert not kws + ary, idx, val = args + + if ary.dtype not in supported_types: + return + + if ary.ndim == 1: + return signature(ary.dtype, ary, types.intp, ary.dtype) + elif ary.ndim > 1: + return signature(ary.dtype, ary, idx, ary.dtype) + return Cuda_atomic + + +all_numba_types = (types.float64, types.float32, + types.int32, types.uint32, + types.int64, types.uint64) + +integer_numba_types = (types.int32, types.uint32, + types.int64, types.uint64) + +unsigned_int_numba_types = (types.uint32, types.uint64) + +Cuda_atomic_add = _gen(cuda.atomic.add, all_numba_types) +Cuda_atomic_sub = _gen(cuda.atomic.sub, all_numba_types) +Cuda_atomic_max = _gen(cuda.atomic.max, all_numba_types) +Cuda_atomic_min = _gen(cuda.atomic.min, all_numba_types) +Cuda_atomic_nanmax = _gen(cuda.atomic.nanmax, all_numba_types) +Cuda_atomic_nanmin = _gen(cuda.atomic.nanmin, all_numba_types) +Cuda_atomic_and = _gen(cuda.atomic.and_, integer_numba_types) +Cuda_atomic_or = _gen(cuda.atomic.or_, integer_numba_types) +Cuda_atomic_xor = _gen(cuda.atomic.xor, integer_numba_types) +Cuda_atomic_inc = _gen(cuda.atomic.inc, unsigned_int_numba_types) +Cuda_atomic_dec = _gen(cuda.atomic.dec, unsigned_int_numba_types) +Cuda_atomic_exch = _gen(cuda.atomic.exch, integer_numba_types) + + +@register +class Cuda_atomic_compare_and_swap(AbstractTemplate): + key = cuda.atomic.compare_and_swap + + def generic(self, args, kws): + assert not kws + ary, old, val = args + dty = ary.dtype + + if dty in integer_numba_types and ary.ndim == 1: + return signature(dty, ary, dty, dty) + + +@register +class Cuda_atomic_cas(AbstractTemplate): + key = cuda.atomic.cas + + def generic(self, args, kws): + assert not kws + ary, idx, old, val = args + dty = ary.dtype + + if dty not in integer_numba_types: + return + + if ary.ndim == 1: + return signature(dty, ary, types.intp, dty, dty) + elif ary.ndim > 1: + return signature(dty, ary, idx, dty, dty) + + +@register +class Cuda_nanosleep(ConcreteTemplate): + key = cuda.nanosleep + + cases = [signature(types.void, types.uint32)] + + +@register_attr +class Dim3_attrs(AttributeTemplate): + key = dim3 + + def resolve_x(self, mod): + return types.int32 + + def resolve_y(self, mod): + return types.int32 + + def resolve_z(self, mod): + return types.int32 + + +@register_attr +class CudaSharedModuleTemplate(AttributeTemplate): + key = types.Module(cuda.shared) + + def resolve_array(self, mod): + return types.Function(Cuda_shared_array) + + +@register_attr +class CudaConstModuleTemplate(AttributeTemplate): + key = types.Module(cuda.const) + + def resolve_array_like(self, mod): + return types.Function(Cuda_const_array_like) + + +@register_attr +class CudaLocalModuleTemplate(AttributeTemplate): + key = types.Module(cuda.local) + + def resolve_array(self, mod): + return types.Function(Cuda_local_array) + + +@register_attr +class CudaAtomicTemplate(AttributeTemplate): + key = types.Module(cuda.atomic) + + def resolve_add(self, mod): + return types.Function(Cuda_atomic_add) + + def resolve_sub(self, mod): + return types.Function(Cuda_atomic_sub) + + def resolve_and_(self, mod): + return types.Function(Cuda_atomic_and) + + def resolve_or_(self, mod): + return types.Function(Cuda_atomic_or) + + def resolve_xor(self, mod): + return types.Function(Cuda_atomic_xor) + + def resolve_inc(self, mod): + return types.Function(Cuda_atomic_inc) + + def resolve_dec(self, mod): + return types.Function(Cuda_atomic_dec) + + def resolve_exch(self, mod): + return types.Function(Cuda_atomic_exch) + + def resolve_max(self, mod): + return types.Function(Cuda_atomic_max) + + def resolve_min(self, mod): + return types.Function(Cuda_atomic_min) + + def resolve_nanmin(self, mod): + return types.Function(Cuda_atomic_nanmin) + + def resolve_nanmax(self, mod): + return types.Function(Cuda_atomic_nanmax) + + def resolve_compare_and_swap(self, mod): + return types.Function(Cuda_atomic_compare_and_swap) + + def resolve_cas(self, mod): + return types.Function(Cuda_atomic_cas) + + +@register_attr +class CudaFp16Template(AttributeTemplate): + key = types.Module(cuda.fp16) + + def resolve_hadd(self, mod): + return types.Function(Cuda_hadd) + + def resolve_hsub(self, mod): + return types.Function(Cuda_hsub) + + def resolve_hmul(self, mod): + return types.Function(Cuda_hmul) + + def resolve_hdiv(self, mod): + return hdiv_device + + def resolve_hneg(self, mod): + return types.Function(Cuda_hneg) + + def resolve_habs(self, mod): + return types.Function(Cuda_habs) + + def resolve_hfma(self, mod): + return types.Function(Cuda_hfma) + + def resolve_hsin(self, mod): + return hsin_device + + def resolve_hcos(self, mod): + return hcos_device + + def resolve_hlog(self, mod): + return hlog_device + + def resolve_hlog10(self, mod): + return hlog10_device + + def resolve_hlog2(self, mod): + return hlog2_device + + def resolve_hexp(self, mod): + return hexp_device + + def resolve_hexp10(self, mod): + return hexp10_device + + def resolve_hexp2(self, mod): + return hexp2_device + + def resolve_hfloor(self, mod): + return hfloor_device + + def resolve_hceil(self, mod): + return hceil_device + + def resolve_hsqrt(self, mod): + return hsqrt_device + + def resolve_hrsqrt(self, mod): + return hrsqrt_device + + def resolve_hrcp(self, mod): + return hrcp_device + + def resolve_hrint(self, mod): + return hrint_device + + def resolve_htrunc(self, mod): + return htrunc_device + + def resolve_heq(self, mod): + return types.Function(Cuda_heq) + + def resolve_hne(self, mod): + return types.Function(Cuda_hne) + + def resolve_hge(self, mod): + return types.Function(Cuda_hge) + + def resolve_hgt(self, mod): + return types.Function(Cuda_hgt) + + def resolve_hle(self, mod): + return types.Function(Cuda_hle) + + def resolve_hlt(self, mod): + return types.Function(Cuda_hlt) + + def resolve_hmax(self, mod): + return types.Function(Cuda_hmax) + + def resolve_hmin(self, mod): + return types.Function(Cuda_hmin) + + +@register_attr +class CudaModuleTemplate(AttributeTemplate): + key = types.Module(cuda) + + def resolve_cg(self, mod): + return types.Module(cuda.cg) + + def resolve_threadIdx(self, mod): + return dim3 + + def resolve_blockIdx(self, mod): + return dim3 + + def resolve_blockDim(self, mod): + return dim3 + + def resolve_gridDim(self, mod): + return dim3 + + def resolve_laneid(self, mod): + return types.int32 + + def resolve_shared(self, mod): + return types.Module(cuda.shared) + + def resolve_popc(self, mod): + return types.Function(Cuda_popc) + + def resolve_brev(self, mod): + return types.Function(Cuda_brev) + + def resolve_clz(self, mod): + return types.Function(Cuda_clz) + + def resolve_ffs(self, mod): + return types.Function(Cuda_ffs) + + def resolve_fma(self, mod): + return types.Function(Cuda_fma) + + def resolve_cbrt(self, mod): + return types.Function(Cuda_cbrt) + + def resolve_threadfence(self, mod): + return types.Function(Cuda_threadfence_device) + + def resolve_threadfence_block(self, mod): + return types.Function(Cuda_threadfence_block) + + def resolve_threadfence_system(self, mod): + return types.Function(Cuda_threadfence_system) + + def resolve_syncwarp(self, mod): + return types.Function(Cuda_syncwarp) + + def resolve_shfl_sync_intrinsic(self, mod): + return types.Function(Cuda_shfl_sync_intrinsic) + + def resolve_vote_sync_intrinsic(self, mod): + return types.Function(Cuda_vote_sync_intrinsic) + + def resolve_match_any_sync(self, mod): + return types.Function(Cuda_match_any_sync) + + def resolve_match_all_sync(self, mod): + return types.Function(Cuda_match_all_sync) + + def resolve_activemask(self, mod): + return types.Function(Cuda_activemask) + + def resolve_lanemask_lt(self, mod): + return types.Function(Cuda_lanemask_lt) + + def resolve_selp(self, mod): + return types.Function(Cuda_selp) + + def resolve_nanosleep(self, mod): + return types.Function(Cuda_nanosleep) + + def resolve_atomic(self, mod): + return types.Module(cuda.atomic) + + def resolve_fp16(self, mod): + return types.Module(cuda.fp16) + + def resolve_const(self, mod): + return types.Module(cuda.const) + + def resolve_local(self, mod): + return types.Module(cuda.local) + + +register_global(cuda, types.Module(cuda)) + + +# NumPy + +for func in trigonometric_functions: + register_numpy_ufunc(func, register_global) + +for func in comparison_functions: + register_numpy_ufunc(func, register_global) + +for func in bit_twiddling_functions: + register_numpy_ufunc(func, register_global) + +for func in math_operations: + if func in ('log', 'log2', 'log10'): + register_numpy_ufunc(func, register_global) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cudaimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cudaimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..5de024d1c9a6da9b4cf73f76d2ad7228045bd42b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cudaimpl.py @@ -0,0 +1,1055 @@ +from functools import reduce +import operator +import math + +from llvmlite import ir +import llvmlite.binding as ll + +from numba.core.imputils import Registry, lower_cast +from numba.core.typing.npydecl import parse_dtype +from numba.core.datamodel import models +from numba.core import types, cgutils +from numba.np import ufunc_db +from numba.np.npyimpl import register_ufuncs +from .cudadrv import nvvm +from numba import cuda +from numba.cuda import nvvmutils, stubs, errors +from numba.cuda.types import dim3, CUDADispatcher + +registry = Registry() +lower = registry.lower +lower_attr = registry.lower_getattr +lower_constant = registry.lower_constant + + +def initialize_dim3(builder, prefix): + x = nvvmutils.call_sreg(builder, "%s.x" % prefix) + y = nvvmutils.call_sreg(builder, "%s.y" % prefix) + z = nvvmutils.call_sreg(builder, "%s.z" % prefix) + return cgutils.pack_struct(builder, (x, y, z)) + + +@lower_attr(types.Module(cuda), 'threadIdx') +def cuda_threadIdx(context, builder, sig, args): + return initialize_dim3(builder, 'tid') + + +@lower_attr(types.Module(cuda), 'blockDim') +def cuda_blockDim(context, builder, sig, args): + return initialize_dim3(builder, 'ntid') + + +@lower_attr(types.Module(cuda), 'blockIdx') +def cuda_blockIdx(context, builder, sig, args): + return initialize_dim3(builder, 'ctaid') + + +@lower_attr(types.Module(cuda), 'gridDim') +def cuda_gridDim(context, builder, sig, args): + return initialize_dim3(builder, 'nctaid') + + +@lower_attr(types.Module(cuda), 'laneid') +def cuda_laneid(context, builder, sig, args): + return nvvmutils.call_sreg(builder, 'laneid') + + +@lower_attr(dim3, 'x') +def dim3_x(context, builder, sig, args): + return builder.extract_value(args, 0) + + +@lower_attr(dim3, 'y') +def dim3_y(context, builder, sig, args): + return builder.extract_value(args, 1) + + +@lower_attr(dim3, 'z') +def dim3_z(context, builder, sig, args): + return builder.extract_value(args, 2) + + +# ----------------------------------------------------------------------------- + +@lower(cuda.const.array_like, types.Array) +def cuda_const_array_like(context, builder, sig, args): + # This is a no-op because CUDATargetContext.make_constant_array already + # created the constant array. + return args[0] + + +_unique_smem_id = 0 + + +def _get_unique_smem_id(name): + """Due to bug with NVVM invalid internalizing of shared memory in the + PTX output. We can't mark shared memory to be internal. We have to + ensure unique name is generated for shared memory symbol. + """ + global _unique_smem_id + _unique_smem_id += 1 + return "{0}_{1}".format(name, _unique_smem_id) + + +@lower(cuda.shared.array, types.IntegerLiteral, types.Any) +def cuda_shared_array_integer(context, builder, sig, args): + length = sig.args[0].literal_value + dtype = parse_dtype(sig.args[1]) + return _generic_array(context, builder, shape=(length,), dtype=dtype, + symbol_name=_get_unique_smem_id('_cudapy_smem'), + addrspace=nvvm.ADDRSPACE_SHARED, + can_dynsized=True) + + +@lower(cuda.shared.array, types.Tuple, types.Any) +@lower(cuda.shared.array, types.UniTuple, types.Any) +def cuda_shared_array_tuple(context, builder, sig, args): + shape = [ s.literal_value for s in sig.args[0] ] + dtype = parse_dtype(sig.args[1]) + return _generic_array(context, builder, shape=shape, dtype=dtype, + symbol_name=_get_unique_smem_id('_cudapy_smem'), + addrspace=nvvm.ADDRSPACE_SHARED, + can_dynsized=True) + + +@lower(cuda.local.array, types.IntegerLiteral, types.Any) +def cuda_local_array_integer(context, builder, sig, args): + length = sig.args[0].literal_value + dtype = parse_dtype(sig.args[1]) + return _generic_array(context, builder, shape=(length,), dtype=dtype, + symbol_name='_cudapy_lmem', + addrspace=nvvm.ADDRSPACE_LOCAL, + can_dynsized=False) + + +@lower(cuda.local.array, types.Tuple, types.Any) +@lower(cuda.local.array, types.UniTuple, types.Any) +def ptx_lmem_alloc_array(context, builder, sig, args): + shape = [ s.literal_value for s in sig.args[0] ] + dtype = parse_dtype(sig.args[1]) + return _generic_array(context, builder, shape=shape, dtype=dtype, + symbol_name='_cudapy_lmem', + addrspace=nvvm.ADDRSPACE_LOCAL, + can_dynsized=False) + + +@lower(stubs.threadfence_block) +def ptx_threadfence_block(context, builder, sig, args): + assert not args + fname = 'llvm.nvvm.membar.cta' + lmod = builder.module + fnty = ir.FunctionType(ir.VoidType(), ()) + sync = cgutils.get_or_insert_function(lmod, fnty, fname) + builder.call(sync, ()) + return context.get_dummy_value() + + +@lower(stubs.threadfence_system) +def ptx_threadfence_system(context, builder, sig, args): + assert not args + fname = 'llvm.nvvm.membar.sys' + lmod = builder.module + fnty = ir.FunctionType(ir.VoidType(), ()) + sync = cgutils.get_or_insert_function(lmod, fnty, fname) + builder.call(sync, ()) + return context.get_dummy_value() + + +@lower(stubs.threadfence) +def ptx_threadfence_device(context, builder, sig, args): + assert not args + fname = 'llvm.nvvm.membar.gl' + lmod = builder.module + fnty = ir.FunctionType(ir.VoidType(), ()) + sync = cgutils.get_or_insert_function(lmod, fnty, fname) + builder.call(sync, ()) + return context.get_dummy_value() + + +@lower(stubs.syncwarp) +def ptx_syncwarp(context, builder, sig, args): + mask = context.get_constant(types.int32, 0xFFFFFFFF) + mask_sig = types.none(types.int32) + return ptx_syncwarp_mask(context, builder, mask_sig, [mask]) + + +@lower(stubs.syncwarp, types.i4) +def ptx_syncwarp_mask(context, builder, sig, args): + fname = 'llvm.nvvm.bar.warp.sync' + lmod = builder.module + fnty = ir.FunctionType(ir.VoidType(), (ir.IntType(32),)) + sync = cgutils.get_or_insert_function(lmod, fnty, fname) + builder.call(sync, args) + return context.get_dummy_value() + + +@lower(stubs.shfl_sync_intrinsic, types.i4, types.i4, types.i4, types.i4, + types.i4) +@lower(stubs.shfl_sync_intrinsic, types.i4, types.i4, types.i8, types.i4, + types.i4) +@lower(stubs.shfl_sync_intrinsic, types.i4, types.i4, types.f4, types.i4, + types.i4) +@lower(stubs.shfl_sync_intrinsic, types.i4, types.i4, types.f8, types.i4, + types.i4) +def ptx_shfl_sync_i32(context, builder, sig, args): + """ + The NVVM intrinsic for shfl only supports i32, but the cuda intrinsic + function supports both 32 and 64 bit ints and floats, so for feature parity, + i64, f32, and f64 are implemented. Floats by way of bitcasting the float to + an int, then shuffling, then bitcasting back. And 64-bit values by packing + them into 2 32bit values, shuffling thoose, and then packing back together. + """ + mask, mode, value, index, clamp = args + value_type = sig.args[2] + if value_type in types.real_domain: + value = builder.bitcast(value, ir.IntType(value_type.bitwidth)) + fname = 'llvm.nvvm.shfl.sync.i32' + lmod = builder.module + fnty = ir.FunctionType( + ir.LiteralStructType((ir.IntType(32), ir.IntType(1))), + (ir.IntType(32), ir.IntType(32), ir.IntType(32), + ir.IntType(32), ir.IntType(32)) + ) + func = cgutils.get_or_insert_function(lmod, fnty, fname) + if value_type.bitwidth == 32: + ret = builder.call(func, (mask, mode, value, index, clamp)) + if value_type == types.float32: + rv = builder.extract_value(ret, 0) + pred = builder.extract_value(ret, 1) + fv = builder.bitcast(rv, ir.FloatType()) + ret = cgutils.make_anonymous_struct(builder, (fv, pred)) + else: + value1 = builder.trunc(value, ir.IntType(32)) + value_lshr = builder.lshr(value, context.get_constant(types.i8, 32)) + value2 = builder.trunc(value_lshr, ir.IntType(32)) + ret1 = builder.call(func, (mask, mode, value1, index, clamp)) + ret2 = builder.call(func, (mask, mode, value2, index, clamp)) + rv1 = builder.extract_value(ret1, 0) + rv2 = builder.extract_value(ret2, 0) + pred = builder.extract_value(ret1, 1) + rv1_64 = builder.zext(rv1, ir.IntType(64)) + rv2_64 = builder.zext(rv2, ir.IntType(64)) + rv_shl = builder.shl(rv2_64, context.get_constant(types.i8, 32)) + rv = builder.or_(rv_shl, rv1_64) + if value_type == types.float64: + rv = builder.bitcast(rv, ir.DoubleType()) + ret = cgutils.make_anonymous_struct(builder, (rv, pred)) + return ret + + +@lower(stubs.vote_sync_intrinsic, types.i4, types.i4, types.boolean) +def ptx_vote_sync(context, builder, sig, args): + fname = 'llvm.nvvm.vote.sync' + lmod = builder.module + fnty = ir.FunctionType(ir.LiteralStructType((ir.IntType(32), + ir.IntType(1))), + (ir.IntType(32), ir.IntType(32), ir.IntType(1))) + func = cgutils.get_or_insert_function(lmod, fnty, fname) + return builder.call(func, args) + + +@lower(stubs.match_any_sync, types.i4, types.i4) +@lower(stubs.match_any_sync, types.i4, types.i8) +@lower(stubs.match_any_sync, types.i4, types.f4) +@lower(stubs.match_any_sync, types.i4, types.f8) +def ptx_match_any_sync(context, builder, sig, args): + mask, value = args + width = sig.args[1].bitwidth + if sig.args[1] in types.real_domain: + value = builder.bitcast(value, ir.IntType(width)) + fname = 'llvm.nvvm.match.any.sync.i{}'.format(width) + lmod = builder.module + fnty = ir.FunctionType(ir.IntType(32), (ir.IntType(32), ir.IntType(width))) + func = cgutils.get_or_insert_function(lmod, fnty, fname) + return builder.call(func, (mask, value)) + + +@lower(stubs.match_all_sync, types.i4, types.i4) +@lower(stubs.match_all_sync, types.i4, types.i8) +@lower(stubs.match_all_sync, types.i4, types.f4) +@lower(stubs.match_all_sync, types.i4, types.f8) +def ptx_match_all_sync(context, builder, sig, args): + mask, value = args + width = sig.args[1].bitwidth + if sig.args[1] in types.real_domain: + value = builder.bitcast(value, ir.IntType(width)) + fname = 'llvm.nvvm.match.all.sync.i{}'.format(width) + lmod = builder.module + fnty = ir.FunctionType(ir.LiteralStructType((ir.IntType(32), + ir.IntType(1))), + (ir.IntType(32), ir.IntType(width))) + func = cgutils.get_or_insert_function(lmod, fnty, fname) + return builder.call(func, (mask, value)) + + +@lower(stubs.activemask) +def ptx_activemask(context, builder, sig, args): + activemask = ir.InlineAsm(ir.FunctionType(ir.IntType(32), []), + "activemask.b32 $0;", '=r', side_effect=True) + return builder.call(activemask, []) + + +@lower(stubs.lanemask_lt) +def ptx_lanemask_lt(context, builder, sig, args): + activemask = ir.InlineAsm(ir.FunctionType(ir.IntType(32), []), + "mov.u32 $0, %lanemask_lt;", '=r', + side_effect=True) + return builder.call(activemask, []) + + +@lower(stubs.popc, types.Any) +def ptx_popc(context, builder, sig, args): + return builder.ctpop(args[0]) + + +@lower(stubs.fma, types.Any, types.Any, types.Any) +def ptx_fma(context, builder, sig, args): + return builder.fma(*args) + + +def float16_float_ty_constraint(bitwidth): + typemap = {32: ('f32', 'f'), 64: ('f64', 'd')} + + try: + return typemap[bitwidth] + except KeyError: + msg = f"Conversion between float16 and float{bitwidth} unsupported" + raise errors.CudaLoweringError(msg) + + +@lower_cast(types.float16, types.Float) +def float16_to_float_cast(context, builder, fromty, toty, val): + if fromty.bitwidth == toty.bitwidth: + return val + + ty, constraint = float16_float_ty_constraint(toty.bitwidth) + + fnty = ir.FunctionType(context.get_value_type(toty), [ir.IntType(16)]) + asm = ir.InlineAsm(fnty, f"cvt.{ty}.f16 $0, $1;", f"={constraint},h") + return builder.call(asm, [val]) + + +@lower_cast(types.Float, types.float16) +def float_to_float16_cast(context, builder, fromty, toty, val): + if fromty.bitwidth == toty.bitwidth: + return val + + ty, constraint = float16_float_ty_constraint(fromty.bitwidth) + + fnty = ir.FunctionType(ir.IntType(16), [context.get_value_type(fromty)]) + asm = ir.InlineAsm(fnty, f"cvt.rn.f16.{ty} $0, $1;", f"=h,{constraint}") + return builder.call(asm, [val]) + + +def float16_int_constraint(bitwidth): + typemap = { 8: 'c', 16: 'h', 32: 'r', 64: 'l' } + + try: + return typemap[bitwidth] + except KeyError: + msg = f"Conversion between float16 and int{bitwidth} unsupported" + raise errors.CudaLoweringError(msg) + + +@lower_cast(types.float16, types.Integer) +def float16_to_integer_cast(context, builder, fromty, toty, val): + bitwidth = toty.bitwidth + constraint = float16_int_constraint(bitwidth) + signedness = 's' if toty.signed else 'u' + + fnty = ir.FunctionType(context.get_value_type(toty), [ir.IntType(16)]) + asm = ir.InlineAsm(fnty, + f"cvt.rni.{signedness}{bitwidth}.f16 $0, $1;", + f"={constraint},h") + return builder.call(asm, [val]) + + +@lower_cast(types.Integer, types.float16) +@lower_cast(types.IntegerLiteral, types.float16) +def integer_to_float16_cast(context, builder, fromty, toty, val): + bitwidth = fromty.bitwidth + constraint = float16_int_constraint(bitwidth) + signedness = 's' if fromty.signed else 'u' + + fnty = ir.FunctionType(ir.IntType(16), + [context.get_value_type(fromty)]) + asm = ir.InlineAsm(fnty, + f"cvt.rn.f16.{signedness}{bitwidth} $0, $1;", + f"=h,{constraint}") + return builder.call(asm, [val]) + + +def lower_fp16_binary(fn, op): + @lower(fn, types.float16, types.float16) + def ptx_fp16_binary(context, builder, sig, args): + fnty = ir.FunctionType(ir.IntType(16), + [ir.IntType(16), ir.IntType(16)]) + asm = ir.InlineAsm(fnty, f'{op}.f16 $0,$1,$2;', '=h,h,h') + return builder.call(asm, args) + + +lower_fp16_binary(stubs.fp16.hadd, 'add') +lower_fp16_binary(operator.add, 'add') +lower_fp16_binary(operator.iadd, 'add') +lower_fp16_binary(stubs.fp16.hsub, 'sub') +lower_fp16_binary(operator.sub, 'sub') +lower_fp16_binary(operator.isub, 'sub') +lower_fp16_binary(stubs.fp16.hmul, 'mul') +lower_fp16_binary(operator.mul, 'mul') +lower_fp16_binary(operator.imul, 'mul') + + +@lower(stubs.fp16.hneg, types.float16) +def ptx_fp16_hneg(context, builder, sig, args): + fnty = ir.FunctionType(ir.IntType(16), [ir.IntType(16)]) + asm = ir.InlineAsm(fnty, 'neg.f16 $0, $1;', '=h,h') + return builder.call(asm, args) + + +@lower(operator.neg, types.float16) +def operator_hneg(context, builder, sig, args): + return ptx_fp16_hneg(context, builder, sig, args) + + +@lower(stubs.fp16.habs, types.float16) +def ptx_fp16_habs(context, builder, sig, args): + fnty = ir.FunctionType(ir.IntType(16), [ir.IntType(16)]) + asm = ir.InlineAsm(fnty, 'abs.f16 $0, $1;', '=h,h') + return builder.call(asm, args) + + +@lower(abs, types.float16) +def operator_habs(context, builder, sig, args): + return ptx_fp16_habs(context, builder, sig, args) + + +@lower(stubs.fp16.hfma, types.float16, types.float16, types.float16) +def ptx_hfma(context, builder, sig, args): + argtys = [ir.IntType(16), ir.IntType(16), ir.IntType(16)] + fnty = ir.FunctionType(ir.IntType(16), argtys) + asm = ir.InlineAsm(fnty, "fma.rn.f16 $0,$1,$2,$3;", "=h,h,h,h") + return builder.call(asm, args) + + +@lower(operator.truediv, types.float16, types.float16) +@lower(operator.itruediv, types.float16, types.float16) +def fp16_div_impl(context, builder, sig, args): + def fp16_div(x, y): + return cuda.fp16.hdiv(x, y) + + return context.compile_internal(builder, fp16_div, sig, args) + + +_fp16_cmp = """{{ + .reg .pred __$$f16_cmp_tmp; + setp.{op}.f16 __$$f16_cmp_tmp, $1, $2; + selp.u16 $0, 1, 0, __$$f16_cmp_tmp; + }}""" + + +def _gen_fp16_cmp(op): + def ptx_fp16_comparison(context, builder, sig, args): + fnty = ir.FunctionType(ir.IntType(16), [ir.IntType(16), ir.IntType(16)]) + asm = ir.InlineAsm(fnty, _fp16_cmp.format(op=op), '=h,h,h') + result = builder.call(asm, args) + + zero = context.get_constant(types.int16, 0) + int_result = builder.bitcast(result, ir.IntType(16)) + return builder.icmp_unsigned("!=", int_result, zero) + return ptx_fp16_comparison + + +lower(stubs.fp16.heq, types.float16, types.float16)(_gen_fp16_cmp('eq')) +lower(operator.eq, types.float16, types.float16)(_gen_fp16_cmp('eq')) +lower(stubs.fp16.hne, types.float16, types.float16)(_gen_fp16_cmp('ne')) +lower(operator.ne, types.float16, types.float16)(_gen_fp16_cmp('ne')) +lower(stubs.fp16.hge, types.float16, types.float16)(_gen_fp16_cmp('ge')) +lower(operator.ge, types.float16, types.float16)(_gen_fp16_cmp('ge')) +lower(stubs.fp16.hgt, types.float16, types.float16)(_gen_fp16_cmp('gt')) +lower(operator.gt, types.float16, types.float16)(_gen_fp16_cmp('gt')) +lower(stubs.fp16.hle, types.float16, types.float16)(_gen_fp16_cmp('le')) +lower(operator.le, types.float16, types.float16)(_gen_fp16_cmp('le')) +lower(stubs.fp16.hlt, types.float16, types.float16)(_gen_fp16_cmp('lt')) +lower(operator.lt, types.float16, types.float16)(_gen_fp16_cmp('lt')) + + +def lower_fp16_minmax(fn, fname, op): + @lower(fn, types.float16, types.float16) + def ptx_fp16_minmax(context, builder, sig, args): + choice = _gen_fp16_cmp(op)(context, builder, sig, args) + return builder.select(choice, args[0], args[1]) + + +lower_fp16_minmax(stubs.fp16.hmax, 'max', 'gt') +lower_fp16_minmax(stubs.fp16.hmin, 'min', 'lt') + +# See: +# https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_cbrt.html#__nv_cbrt +# https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_cbrtf.html#__nv_cbrtf + + +cbrt_funcs = { + types.float32: '__nv_cbrtf', + types.float64: '__nv_cbrt', +} + + +@lower(stubs.cbrt, types.float32) +@lower(stubs.cbrt, types.float64) +def ptx_cbrt(context, builder, sig, args): + ty = sig.return_type + fname = cbrt_funcs[ty] + fty = context.get_value_type(ty) + lmod = builder.module + fnty = ir.FunctionType(fty, [fty]) + fn = cgutils.get_or_insert_function(lmod, fnty, fname) + return builder.call(fn, args) + + +@lower(stubs.brev, types.u4) +def ptx_brev_u4(context, builder, sig, args): + # FIXME the llvm.bitreverse.i32 intrinsic isn't supported by nvcc + # return builder.bitreverse(args[0]) + + fn = cgutils.get_or_insert_function( + builder.module, + ir.FunctionType(ir.IntType(32), (ir.IntType(32),)), + '__nv_brev') + return builder.call(fn, args) + + +@lower(stubs.brev, types.u8) +def ptx_brev_u8(context, builder, sig, args): + # FIXME the llvm.bitreverse.i64 intrinsic isn't supported by nvcc + # return builder.bitreverse(args[0]) + + fn = cgutils.get_or_insert_function( + builder.module, + ir.FunctionType(ir.IntType(64), (ir.IntType(64),)), + '__nv_brevll') + return builder.call(fn, args) + + +@lower(stubs.clz, types.Any) +def ptx_clz(context, builder, sig, args): + return builder.ctlz( + args[0], + context.get_constant(types.boolean, 0)) + + +@lower(stubs.ffs, types.i4) +@lower(stubs.ffs, types.u4) +def ptx_ffs_32(context, builder, sig, args): + fn = cgutils.get_or_insert_function( + builder.module, + ir.FunctionType(ir.IntType(32), (ir.IntType(32),)), + '__nv_ffs') + return builder.call(fn, args) + + +@lower(stubs.ffs, types.i8) +@lower(stubs.ffs, types.u8) +def ptx_ffs_64(context, builder, sig, args): + fn = cgutils.get_or_insert_function( + builder.module, + ir.FunctionType(ir.IntType(32), (ir.IntType(64),)), + '__nv_ffsll') + return builder.call(fn, args) + + +@lower(stubs.selp, types.Any, types.Any, types.Any) +def ptx_selp(context, builder, sig, args): + test, a, b = args + return builder.select(test, a, b) + + +@lower(max, types.f4, types.f4) +def ptx_max_f4(context, builder, sig, args): + fn = cgutils.get_or_insert_function( + builder.module, + ir.FunctionType( + ir.FloatType(), + (ir.FloatType(), ir.FloatType())), + '__nv_fmaxf') + return builder.call(fn, args) + + +@lower(max, types.f8, types.f4) +@lower(max, types.f4, types.f8) +@lower(max, types.f8, types.f8) +def ptx_max_f8(context, builder, sig, args): + fn = cgutils.get_or_insert_function( + builder.module, + ir.FunctionType( + ir.DoubleType(), + (ir.DoubleType(), ir.DoubleType())), + '__nv_fmax') + + return builder.call(fn, [ + context.cast(builder, args[0], sig.args[0], types.double), + context.cast(builder, args[1], sig.args[1], types.double), + ]) + + +@lower(min, types.f4, types.f4) +def ptx_min_f4(context, builder, sig, args): + fn = cgutils.get_or_insert_function( + builder.module, + ir.FunctionType( + ir.FloatType(), + (ir.FloatType(), ir.FloatType())), + '__nv_fminf') + return builder.call(fn, args) + + +@lower(min, types.f8, types.f4) +@lower(min, types.f4, types.f8) +@lower(min, types.f8, types.f8) +def ptx_min_f8(context, builder, sig, args): + fn = cgutils.get_or_insert_function( + builder.module, + ir.FunctionType( + ir.DoubleType(), + (ir.DoubleType(), ir.DoubleType())), + '__nv_fmin') + + return builder.call(fn, [ + context.cast(builder, args[0], sig.args[0], types.double), + context.cast(builder, args[1], sig.args[1], types.double), + ]) + + +@lower(round, types.f4) +@lower(round, types.f8) +def ptx_round(context, builder, sig, args): + fn = cgutils.get_or_insert_function( + builder.module, + ir.FunctionType( + ir.IntType(64), + (ir.DoubleType(),)), + '__nv_llrint') + return builder.call(fn, [ + context.cast(builder, args[0], sig.args[0], types.double), + ]) + + +# This rounding implementation follows the algorithm used in the "fallback +# version" of double_round in CPython. +# https://github.com/python/cpython/blob/a755410e054e1e2390de5830befc08fe80706c66/Objects/floatobject.c#L964-L1007 + +@lower(round, types.f4, types.Integer) +@lower(round, types.f8, types.Integer) +def round_to_impl(context, builder, sig, args): + def round_ndigits(x, ndigits): + if math.isinf(x) or math.isnan(x): + return x + + if ndigits >= 0: + if ndigits > 22: + # pow1 and pow2 are each safe from overflow, but + # pow1*pow2 ~= pow(10.0, ndigits) might overflow. + pow1 = 10.0 ** (ndigits - 22) + pow2 = 1e22 + else: + pow1 = 10.0 ** ndigits + pow2 = 1.0 + y = (x * pow1) * pow2 + if math.isinf(y): + return x + + else: + pow1 = 10.0 ** (-ndigits) + y = x / pow1 + + z = round(y) + if (math.fabs(y - z) == 0.5): + # halfway between two integers; use round-half-even + z = 2.0 * round(y / 2.0) + + if ndigits >= 0: + z = (z / pow2) / pow1 + else: + z *= pow1 + + return z + + return context.compile_internal(builder, round_ndigits, sig, args, ) + + +def gen_deg_rad(const): + def impl(context, builder, sig, args): + argty, = sig.args + factor = context.get_constant(argty, const) + return builder.fmul(factor, args[0]) + return impl + + +_deg2rad = math.pi / 180. +_rad2deg = 180. / math.pi +lower(math.radians, types.f4)(gen_deg_rad(_deg2rad)) +lower(math.radians, types.f8)(gen_deg_rad(_deg2rad)) +lower(math.degrees, types.f4)(gen_deg_rad(_rad2deg)) +lower(math.degrees, types.f8)(gen_deg_rad(_rad2deg)) + + +def _normalize_indices(context, builder, indty, inds, aryty, valty): + """ + Convert integer indices into tuple of intp + """ + if indty in types.integer_domain: + indty = types.UniTuple(dtype=indty, count=1) + indices = [inds] + else: + indices = cgutils.unpack_tuple(builder, inds, count=len(indty)) + indices = [context.cast(builder, i, t, types.intp) + for t, i in zip(indty, indices)] + + dtype = aryty.dtype + if dtype != valty: + raise TypeError("expect %s but got %s" % (dtype, valty)) + + if aryty.ndim != len(indty): + raise TypeError("indexing %d-D array with %d-D index" % + (aryty.ndim, len(indty))) + + return indty, indices + + +def _atomic_dispatcher(dispatch_fn): + def imp(context, builder, sig, args): + # The common argument handling code + aryty, indty, valty = sig.args + ary, inds, val = args + dtype = aryty.dtype + + indty, indices = _normalize_indices(context, builder, indty, inds, + aryty, valty) + + lary = context.make_array(aryty)(context, builder, ary) + ptr = cgutils.get_item_pointer(context, builder, aryty, lary, indices, + wraparound=True) + # dispatcher to implementation base on dtype + return dispatch_fn(context, builder, dtype, ptr, val) + return imp + + +@lower(stubs.atomic.add, types.Array, types.intp, types.Any) +@lower(stubs.atomic.add, types.Array, types.UniTuple, types.Any) +@lower(stubs.atomic.add, types.Array, types.Tuple, types.Any) +@_atomic_dispatcher +def ptx_atomic_add_tuple(context, builder, dtype, ptr, val): + if dtype == types.float32: + lmod = builder.module + return builder.call(nvvmutils.declare_atomic_add_float32(lmod), + (ptr, val)) + elif dtype == types.float64: + lmod = builder.module + return builder.call(nvvmutils.declare_atomic_add_float64(lmod), + (ptr, val)) + else: + return builder.atomic_rmw('add', ptr, val, 'monotonic') + + +@lower(stubs.atomic.sub, types.Array, types.intp, types.Any) +@lower(stubs.atomic.sub, types.Array, types.UniTuple, types.Any) +@lower(stubs.atomic.sub, types.Array, types.Tuple, types.Any) +@_atomic_dispatcher +def ptx_atomic_sub(context, builder, dtype, ptr, val): + if dtype == types.float32: + lmod = builder.module + return builder.call(nvvmutils.declare_atomic_sub_float32(lmod), + (ptr, val)) + elif dtype == types.float64: + lmod = builder.module + return builder.call(nvvmutils.declare_atomic_sub_float64(lmod), + (ptr, val)) + else: + return builder.atomic_rmw('sub', ptr, val, 'monotonic') + + +@lower(stubs.atomic.inc, types.Array, types.intp, types.Any) +@lower(stubs.atomic.inc, types.Array, types.UniTuple, types.Any) +@lower(stubs.atomic.inc, types.Array, types.Tuple, types.Any) +@_atomic_dispatcher +def ptx_atomic_inc(context, builder, dtype, ptr, val): + if dtype in cuda.cudadecl.unsigned_int_numba_types: + bw = dtype.bitwidth + lmod = builder.module + fn = getattr(nvvmutils, f'declare_atomic_inc_int{bw}') + return builder.call(fn(lmod), (ptr, val)) + else: + raise TypeError(f'Unimplemented atomic inc with {dtype} array') + + +@lower(stubs.atomic.dec, types.Array, types.intp, types.Any) +@lower(stubs.atomic.dec, types.Array, types.UniTuple, types.Any) +@lower(stubs.atomic.dec, types.Array, types.Tuple, types.Any) +@_atomic_dispatcher +def ptx_atomic_dec(context, builder, dtype, ptr, val): + if dtype in cuda.cudadecl.unsigned_int_numba_types: + bw = dtype.bitwidth + lmod = builder.module + fn = getattr(nvvmutils, f'declare_atomic_dec_int{bw}') + return builder.call(fn(lmod), (ptr, val)) + else: + raise TypeError(f'Unimplemented atomic dec with {dtype} array') + + +def ptx_atomic_bitwise(stub, op): + @_atomic_dispatcher + def impl_ptx_atomic(context, builder, dtype, ptr, val): + if dtype in (cuda.cudadecl.integer_numba_types): + return builder.atomic_rmw(op, ptr, val, 'monotonic') + else: + raise TypeError(f'Unimplemented atomic {op} with {dtype} array') + + for ty in (types.intp, types.UniTuple, types.Tuple): + lower(stub, types.Array, ty, types.Any)(impl_ptx_atomic) + + +ptx_atomic_bitwise(stubs.atomic.and_, 'and') +ptx_atomic_bitwise(stubs.atomic.or_, 'or') +ptx_atomic_bitwise(stubs.atomic.xor, 'xor') + + +@lower(stubs.atomic.exch, types.Array, types.intp, types.Any) +@lower(stubs.atomic.exch, types.Array, types.UniTuple, types.Any) +@lower(stubs.atomic.exch, types.Array, types.Tuple, types.Any) +@_atomic_dispatcher +def ptx_atomic_exch(context, builder, dtype, ptr, val): + if dtype in (cuda.cudadecl.integer_numba_types): + return builder.atomic_rmw('xchg', ptr, val, 'monotonic') + else: + raise TypeError(f'Unimplemented atomic exch with {dtype} array') + + +@lower(stubs.atomic.max, types.Array, types.intp, types.Any) +@lower(stubs.atomic.max, types.Array, types.Tuple, types.Any) +@lower(stubs.atomic.max, types.Array, types.UniTuple, types.Any) +@_atomic_dispatcher +def ptx_atomic_max(context, builder, dtype, ptr, val): + lmod = builder.module + if dtype == types.float64: + return builder.call(nvvmutils.declare_atomic_max_float64(lmod), + (ptr, val)) + elif dtype == types.float32: + return builder.call(nvvmutils.declare_atomic_max_float32(lmod), + (ptr, val)) + elif dtype in (types.int32, types.int64): + return builder.atomic_rmw('max', ptr, val, ordering='monotonic') + elif dtype in (types.uint32, types.uint64): + return builder.atomic_rmw('umax', ptr, val, ordering='monotonic') + else: + raise TypeError('Unimplemented atomic max with %s array' % dtype) + + +@lower(stubs.atomic.min, types.Array, types.intp, types.Any) +@lower(stubs.atomic.min, types.Array, types.Tuple, types.Any) +@lower(stubs.atomic.min, types.Array, types.UniTuple, types.Any) +@_atomic_dispatcher +def ptx_atomic_min(context, builder, dtype, ptr, val): + lmod = builder.module + if dtype == types.float64: + return builder.call(nvvmutils.declare_atomic_min_float64(lmod), + (ptr, val)) + elif dtype == types.float32: + return builder.call(nvvmutils.declare_atomic_min_float32(lmod), + (ptr, val)) + elif dtype in (types.int32, types.int64): + return builder.atomic_rmw('min', ptr, val, ordering='monotonic') + elif dtype in (types.uint32, types.uint64): + return builder.atomic_rmw('umin', ptr, val, ordering='monotonic') + else: + raise TypeError('Unimplemented atomic min with %s array' % dtype) + + +@lower(stubs.atomic.nanmax, types.Array, types.intp, types.Any) +@lower(stubs.atomic.nanmax, types.Array, types.Tuple, types.Any) +@lower(stubs.atomic.nanmax, types.Array, types.UniTuple, types.Any) +@_atomic_dispatcher +def ptx_atomic_nanmax(context, builder, dtype, ptr, val): + lmod = builder.module + if dtype == types.float64: + return builder.call(nvvmutils.declare_atomic_nanmax_float64(lmod), + (ptr, val)) + elif dtype == types.float32: + return builder.call(nvvmutils.declare_atomic_nanmax_float32(lmod), + (ptr, val)) + elif dtype in (types.int32, types.int64): + return builder.atomic_rmw('max', ptr, val, ordering='monotonic') + elif dtype in (types.uint32, types.uint64): + return builder.atomic_rmw('umax', ptr, val, ordering='monotonic') + else: + raise TypeError('Unimplemented atomic max with %s array' % dtype) + + +@lower(stubs.atomic.nanmin, types.Array, types.intp, types.Any) +@lower(stubs.atomic.nanmin, types.Array, types.Tuple, types.Any) +@lower(stubs.atomic.nanmin, types.Array, types.UniTuple, types.Any) +@_atomic_dispatcher +def ptx_atomic_nanmin(context, builder, dtype, ptr, val): + lmod = builder.module + if dtype == types.float64: + return builder.call(nvvmutils.declare_atomic_nanmin_float64(lmod), + (ptr, val)) + elif dtype == types.float32: + return builder.call(nvvmutils.declare_atomic_nanmin_float32(lmod), + (ptr, val)) + elif dtype in (types.int32, types.int64): + return builder.atomic_rmw('min', ptr, val, ordering='monotonic') + elif dtype in (types.uint32, types.uint64): + return builder.atomic_rmw('umin', ptr, val, ordering='monotonic') + else: + raise TypeError('Unimplemented atomic min with %s array' % dtype) + + +@lower(stubs.atomic.compare_and_swap, types.Array, types.Any, types.Any) +def ptx_atomic_compare_and_swap(context, builder, sig, args): + sig = sig.return_type(sig.args[0], types.intp, sig.args[1], sig.args[2]) + args = (args[0], context.get_constant(types.intp, 0), args[1], args[2]) + return ptx_atomic_cas(context, builder, sig, args) + + +@lower(stubs.atomic.cas, types.Array, types.intp, types.Any, types.Any) +@lower(stubs.atomic.cas, types.Array, types.Tuple, types.Any, types.Any) +@lower(stubs.atomic.cas, types.Array, types.UniTuple, types.Any, types.Any) +def ptx_atomic_cas(context, builder, sig, args): + aryty, indty, oldty, valty = sig.args + ary, inds, old, val = args + + indty, indices = _normalize_indices(context, builder, indty, inds, aryty, + valty) + + lary = context.make_array(aryty)(context, builder, ary) + ptr = cgutils.get_item_pointer(context, builder, aryty, lary, indices, + wraparound=True) + + if aryty.dtype in (cuda.cudadecl.integer_numba_types): + lmod = builder.module + bitwidth = aryty.dtype.bitwidth + return nvvmutils.atomic_cmpxchg(builder, lmod, bitwidth, ptr, old, val) + else: + raise TypeError('Unimplemented atomic cas with %s array' % aryty.dtype) + + +# ----------------------------------------------------------------------------- + +@lower(stubs.nanosleep, types.uint32) +def ptx_nanosleep(context, builder, sig, args): + nanosleep = ir.InlineAsm(ir.FunctionType(ir.VoidType(), [ir.IntType(32)]), + "nanosleep.u32 $0;", 'r', side_effect=True) + ns = args[0] + builder.call(nanosleep, [ns]) + + +# ----------------------------------------------------------------------------- + + +def _generic_array(context, builder, shape, dtype, symbol_name, addrspace, + can_dynsized=False): + elemcount = reduce(operator.mul, shape, 1) + + # Check for valid shape for this type of allocation. + # Only 1d arrays can be dynamic. + dynamic_smem = elemcount <= 0 and can_dynsized and len(shape) == 1 + if elemcount <= 0 and not dynamic_smem: + raise ValueError("array length <= 0") + + # Check that we support the requested dtype + data_model = context.data_model_manager[dtype] + other_supported_type = ( + isinstance(dtype, (types.Record, types.Boolean)) + or isinstance(data_model, models.StructModel) + or dtype == types.float16 + ) + if dtype not in types.number_domain and not other_supported_type: + raise TypeError("unsupported type: %s" % dtype) + + lldtype = context.get_data_type(dtype) + laryty = ir.ArrayType(lldtype, elemcount) + + if addrspace == nvvm.ADDRSPACE_LOCAL: + # Special case local address space allocation to use alloca + # NVVM is smart enough to only use local memory if no register is + # available + dataptr = cgutils.alloca_once(builder, laryty, name=symbol_name) + else: + lmod = builder.module + + # Create global variable in the requested address space + gvmem = cgutils.add_global_variable(lmod, laryty, symbol_name, + addrspace) + # Specify alignment to avoid misalignment bug + align = context.get_abi_sizeof(lldtype) + # Alignment is required to be a power of 2 for shared memory. If it is + # not a power of 2 (e.g. for a Record array) then round up accordingly. + gvmem.align = 1 << (align - 1 ).bit_length() + + if dynamic_smem: + gvmem.linkage = 'external' + else: + ## Comment out the following line to workaround a NVVM bug + ## which generates a invalid symbol name when the linkage + ## is internal and in some situation. + ## See _get_unique_smem_id() + # gvmem.linkage = lc.LINKAGE_INTERNAL + + gvmem.initializer = ir.Constant(laryty, ir.Undefined) + + # Convert to generic address-space + dataptr = builder.addrspacecast(gvmem, ir.PointerType(ir.IntType(8)), + 'generic') + + targetdata = ll.create_target_data(nvvm.NVVM().data_layout) + lldtype = context.get_data_type(dtype) + itemsize = lldtype.get_abi_size(targetdata) + + # Compute strides + laststride = itemsize + rstrides = [] + for i, lastsize in enumerate(reversed(shape)): + rstrides.append(laststride) + laststride *= lastsize + strides = [s for s in reversed(rstrides)] + kstrides = [context.get_constant(types.intp, s) for s in strides] + + # Compute shape + if dynamic_smem: + # Compute the shape based on the dynamic shared memory configuration. + # Unfortunately NVVM does not provide an intrinsic for the + # %dynamic_smem_size register, so we must read it using inline + # assembly. + get_dynshared_size = ir.InlineAsm(ir.FunctionType(ir.IntType(32), []), + "mov.u32 $0, %dynamic_smem_size;", + '=r', side_effect=True) + dynsmem_size = builder.zext(builder.call(get_dynshared_size, []), + ir.IntType(64)) + # Only 1-D dynamic shared memory is supported so the following is a + # sufficient construction of the shape + kitemsize = context.get_constant(types.intp, itemsize) + kshape = [builder.udiv(dynsmem_size, kitemsize)] + else: + kshape = [context.get_constant(types.intp, s) for s in shape] + + # Create array object + ndim = len(shape) + aryty = types.Array(dtype=dtype, ndim=ndim, layout='C') + ary = context.make_array(aryty)(context, builder) + + context.populate_array(ary, + data=builder.bitcast(dataptr, ary.data.type), + shape=kshape, + strides=kstrides, + itemsize=context.get_constant(types.intp, itemsize), + meminfo=None) + return ary._getvalue() + + +@lower_constant(CUDADispatcher) +def cuda_dispatcher_const(context, builder, ty, pyval): + return context.get_dummy_value() + + +# NumPy + +register_ufuncs(ufunc_db.get_ufuncs(), lower) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cudamath.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cudamath.py new file mode 100644 index 0000000000000000000000000000000000000000..12d9715b62eb29b057d814748cf56b469b6a7bfc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/cudamath.py @@ -0,0 +1,140 @@ +import math +from numba.core import types +from numba.core.typing.templates import ConcreteTemplate, signature, Registry + + +registry = Registry() +infer_global = registry.register_global + + +@infer_global(math.acos) +@infer_global(math.acosh) +@infer_global(math.asin) +@infer_global(math.asinh) +@infer_global(math.atan) +@infer_global(math.atanh) +@infer_global(math.cosh) +@infer_global(math.degrees) +@infer_global(math.erf) +@infer_global(math.erfc) +@infer_global(math.expm1) +@infer_global(math.gamma) +@infer_global(math.lgamma) +@infer_global(math.log1p) +@infer_global(math.radians) +@infer_global(math.sinh) +@infer_global(math.tanh) +@infer_global(math.tan) +class Math_unary(ConcreteTemplate): + cases = [ + signature(types.float64, types.int64), + signature(types.float64, types.uint64), + signature(types.float32, types.float32), + signature(types.float64, types.float64), + ] + + +@infer_global(math.sin) +@infer_global(math.cos) +@infer_global(math.ceil) +@infer_global(math.floor) +@infer_global(math.sqrt) +@infer_global(math.log) +@infer_global(math.log2) +@infer_global(math.log10) +@infer_global(math.exp) +@infer_global(math.fabs) +@infer_global(math.trunc) +class Math_unary_with_fp16(ConcreteTemplate): + cases = [ + signature(types.float64, types.int64), + signature(types.float64, types.uint64), + signature(types.float32, types.float32), + signature(types.float64, types.float64), + signature(types.float16, types.float16), + ] + + +@infer_global(math.atan2) +class Math_atan2(ConcreteTemplate): + key = math.atan2 + cases = [ + signature(types.float64, types.int64, types.int64), + signature(types.float64, types.uint64, types.uint64), + signature(types.float32, types.float32, types.float32), + signature(types.float64, types.float64, types.float64), + ] + + +@infer_global(math.hypot) +class Math_hypot(ConcreteTemplate): + key = math.hypot + cases = [ + signature(types.float64, types.int64, types.int64), + signature(types.float64, types.uint64, types.uint64), + signature(types.float32, types.float32, types.float32), + signature(types.float64, types.float64, types.float64), + ] + + +@infer_global(math.copysign) +@infer_global(math.fmod) +class Math_binary(ConcreteTemplate): + cases = [ + signature(types.float32, types.float32, types.float32), + signature(types.float64, types.float64, types.float64), + ] + + +@infer_global(math.remainder) +class Math_remainder(ConcreteTemplate): + cases = [ + signature(types.float32, types.float32, types.float32), + signature(types.float64, types.float64, types.float64), + ] + + +@infer_global(math.pow) +class Math_pow(ConcreteTemplate): + cases = [ + signature(types.float32, types.float32, types.float32), + signature(types.float64, types.float64, types.float64), + signature(types.float32, types.float32, types.int32), + signature(types.float64, types.float64, types.int32), + ] + + +@infer_global(math.frexp) +class Math_frexp(ConcreteTemplate): + cases = [ + signature(types.Tuple([types.float32, types.int32]), types.float32), + signature(types.Tuple([types.float64, types.int32]), types.float64), + ] + + +@infer_global(math.ldexp) +class Math_ldexp(ConcreteTemplate): + cases = [ + signature(types.float32, types.float32, types.int32), + signature(types.float64, types.float64, types.int32), + ] + + +@infer_global(math.isinf) +@infer_global(math.isnan) +@infer_global(math.isfinite) +class Math_isnan(ConcreteTemplate): + cases = [ + signature(types.boolean, types.int64), + signature(types.boolean, types.uint64), + signature(types.boolean, types.float32), + signature(types.boolean, types.float64), + ] + + +@infer_global(math.modf) +class Math_modf(ConcreteTemplate): + cases = [ + signature(types.UniTuple(types.float64, 2), types.float64), + signature(types.UniTuple(types.float32, 2), types.float32) + ] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/decorators.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/decorators.py new file mode 100644 index 0000000000000000000000000000000000000000..0e2ae4e25d38e2d05929662742be0868f5c8770c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/decorators.py @@ -0,0 +1,189 @@ +from warnings import warn +from numba.core import types, config, sigutils +from numba.core.errors import DeprecationError, NumbaInvalidConfigWarning +from numba.cuda.compiler import declare_device_function +from numba.cuda.dispatcher import CUDADispatcher +from numba.cuda.simulator.kernel import FakeCUDAKernel + + +_msg_deprecated_signature_arg = ("Deprecated keyword argument `{0}`. " + "Signatures should be passed as the first " + "positional argument.") + + +def jit(func_or_sig=None, device=False, inline=False, link=[], debug=None, + opt=True, lineinfo=False, cache=False, **kws): + """ + JIT compile a Python function for CUDA GPUs. + + :param func_or_sig: A function to JIT compile, or *signatures* of a + function to compile. If a function is supplied, then a + :class:`Dispatcher ` is returned. + Otherwise, ``func_or_sig`` may be a signature or a list of signatures, + and a function is returned. The returned function accepts another + function, which it will compile and then return a :class:`Dispatcher + `. See :ref:`jit-decorator` for + more information about passing signatures. + + .. note:: A kernel cannot have any return value. + :param device: Indicates whether this is a device function. + :type device: bool + :param link: A list of files containing PTX or CUDA C/C++ source to link + with the function + :type link: list + :param debug: If True, check for exceptions thrown when executing the + kernel. Since this degrades performance, this should only be used for + debugging purposes. If set to True, then ``opt`` should be set to False. + Defaults to False. (The default value can be overridden by setting + environment variable ``NUMBA_CUDA_DEBUGINFO=1``.) + :param fastmath: When True, enables fastmath optimizations as outlined in + the :ref:`CUDA Fast Math documentation `. + :param max_registers: Request that the kernel is limited to using at most + this number of registers per thread. The limit may not be respected if + the ABI requires a greater number of registers than that requested. + Useful for increasing occupancy. + :param opt: Whether to compile from LLVM IR to PTX with optimization + enabled. When ``True``, ``-opt=3`` is passed to NVVM. When + ``False``, ``-opt=0`` is passed to NVVM. Defaults to ``True``. + :type opt: bool + :param lineinfo: If True, generate a line mapping between source code and + assembly code. This enables inspection of the source code in NVIDIA + profiling tools and correlation with program counter sampling. + :type lineinfo: bool + :param cache: If True, enables the file-based cache for this function. + :type cache: bool + """ + + if link and config.ENABLE_CUDASIM: + raise NotImplementedError('Cannot link PTX in the simulator') + + if kws.get('boundscheck'): + raise NotImplementedError("bounds checking is not supported for CUDA") + + if kws.get('argtypes') is not None: + msg = _msg_deprecated_signature_arg.format('argtypes') + raise DeprecationError(msg) + if kws.get('restype') is not None: + msg = _msg_deprecated_signature_arg.format('restype') + raise DeprecationError(msg) + if kws.get('bind') is not None: + msg = _msg_deprecated_signature_arg.format('bind') + raise DeprecationError(msg) + + debug = config.CUDA_DEBUGINFO_DEFAULT if debug is None else debug + fastmath = kws.get('fastmath', False) + extensions = kws.get('extensions', []) + + if debug and opt: + msg = ("debug=True with opt=True (the default) " + "is not supported by CUDA. This may result in a crash" + " - set debug=False or opt=False.") + warn(NumbaInvalidConfigWarning(msg)) + + if debug and lineinfo: + msg = ("debug and lineinfo are mutually exclusive. Use debug to get " + "full debug info (this disables some optimizations), or " + "lineinfo for line info only with code generation unaffected.") + warn(NumbaInvalidConfigWarning(msg)) + + if device and kws.get('link'): + raise ValueError("link keyword invalid for device function") + + if sigutils.is_signature(func_or_sig): + signatures = [func_or_sig] + specialized = True + elif isinstance(func_or_sig, list): + signatures = func_or_sig + specialized = False + else: + signatures = None + + if signatures is not None: + if config.ENABLE_CUDASIM: + def jitwrapper(func): + return FakeCUDAKernel(func, device=device, fastmath=fastmath) + return jitwrapper + + def _jit(func): + targetoptions = kws.copy() + targetoptions['debug'] = debug + targetoptions['lineinfo'] = lineinfo + targetoptions['link'] = link + targetoptions['opt'] = opt + targetoptions['fastmath'] = fastmath + targetoptions['device'] = device + targetoptions['extensions'] = extensions + + disp = CUDADispatcher(func, targetoptions=targetoptions) + + if cache: + disp.enable_caching() + + for sig in signatures: + argtypes, restype = sigutils.normalize_signature(sig) + + if restype and not device and restype != types.void: + raise TypeError("CUDA kernel must have void return type.") + + if device: + from numba.core import typeinfer + with typeinfer.register_dispatcher(disp): + disp.compile_device(argtypes, restype) + else: + disp.compile(argtypes) + + disp._specialized = specialized + disp.disable_compile() + + return disp + + return _jit + else: + if func_or_sig is None: + if config.ENABLE_CUDASIM: + def autojitwrapper(func): + return FakeCUDAKernel(func, device=device, + fastmath=fastmath) + else: + def autojitwrapper(func): + return jit(func, device=device, debug=debug, opt=opt, + lineinfo=lineinfo, link=link, cache=cache, **kws) + + return autojitwrapper + # func_or_sig is a function + else: + if config.ENABLE_CUDASIM: + return FakeCUDAKernel(func_or_sig, device=device, + fastmath=fastmath) + else: + targetoptions = kws.copy() + targetoptions['debug'] = debug + targetoptions['lineinfo'] = lineinfo + targetoptions['opt'] = opt + targetoptions['link'] = link + targetoptions['fastmath'] = fastmath + targetoptions['device'] = device + targetoptions['extensions'] = extensions + disp = CUDADispatcher(func_or_sig, targetoptions=targetoptions) + + if cache: + disp.enable_caching() + + return disp + + +def declare_device(name, sig): + """ + Declare the signature of a foreign function. Returns a descriptor that can + be used to call the function from a Python kernel. + + :param name: The name of the foreign function. + :type name: str + :param sig: The Numba signature of the function. + """ + argtypes, restype = sigutils.normalize_signature(sig) + if restype is None: + msg = 'Return type must be provided for device declarations' + raise TypeError(msg) + + return declare_device_function(name, restype, argtypes) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/descriptor.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/descriptor.py new file mode 100644 index 0000000000000000000000000000000000000000..b91ddf7a1b9b1fe5eca6b92162d68b155c34204c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/descriptor.py @@ -0,0 +1,33 @@ +from numba.core.descriptors import TargetDescriptor +from numba.core.options import TargetOptions +from .target import CUDATargetContext, CUDATypingContext + + +class CUDATargetOptions(TargetOptions): + pass + + +class CUDATarget(TargetDescriptor): + def __init__(self, name): + self.options = CUDATargetOptions + # The typing and target contexts are initialized only when needed - + # this prevents an attempt to load CUDA libraries at import time on + # systems that might not have them present. + self._typingctx = None + self._targetctx = None + super().__init__(name) + + @property + def typing_context(self): + if self._typingctx is None: + self._typingctx = CUDATypingContext() + return self._typingctx + + @property + def target_context(self): + if self._targetctx is None: + self._targetctx = CUDATargetContext(self._typingctx) + return self._targetctx + + +cuda_target = CUDATarget('cuda') diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/device_init.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/device_init.py new file mode 100644 index 0000000000000000000000000000000000000000..9df5ae99d8f5ad2a40a926a1e40343d9b8797fd6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/device_init.py @@ -0,0 +1,89 @@ +# Re export +import sys +from numba.cuda import cg +from .stubs import (threadIdx, blockIdx, blockDim, gridDim, laneid, warpsize, + syncwarp, shared, local, const, atomic, + shfl_sync_intrinsic, vote_sync_intrinsic, match_any_sync, + match_all_sync, threadfence_block, threadfence_system, + threadfence, selp, popc, brev, clz, ffs, fma, cbrt, + activemask, lanemask_lt, nanosleep, fp16, + _vector_type_stubs) +from .intrinsics import (grid, gridsize, syncthreads, syncthreads_and, + syncthreads_count, syncthreads_or) +from .cudadrv.error import CudaSupportError +from numba.cuda.cudadrv.driver import (BaseCUDAMemoryManager, + HostOnlyCUDAMemoryManager, + GetIpcHandleMixin, MemoryPointer, + MappedMemory, PinnedMemory, MemoryInfo, + IpcHandle, set_memory_manager) +from numba.cuda.cudadrv.runtime import runtime +from .cudadrv import nvvm +from numba.cuda import initialize +from .errors import KernelRuntimeError + +from .decorators import jit, declare_device +from .api import * +from .api import _auto_device +from .args import In, Out, InOut + +from .intrinsic_wrapper import (all_sync, any_sync, eq_sync, ballot_sync, + shfl_sync, shfl_up_sync, shfl_down_sync, + shfl_xor_sync) + +from .kernels import reduction + +reduce = Reduce = reduction.Reduce + +# Expose vector type constructors and aliases as module level attributes. +for vector_type_stub in _vector_type_stubs: + setattr(sys.modules[__name__], vector_type_stub.__name__, vector_type_stub) + for alias in vector_type_stub.aliases: + setattr(sys.modules[__name__], alias, vector_type_stub) +del vector_type_stub, _vector_type_stubs + + +def is_available(): + """Returns a boolean to indicate the availability of a CUDA GPU. + + This will initialize the driver if it hasn't been initialized. + """ + # whilst `driver.is_available` will init the driver itself, + # the driver initialization may raise and as a result break + # test discovery/orchestration as `cuda.is_available` is often + # used as a guard for whether to run a CUDA test, the try/except + # below is to handle this case. + driver_is_available = False + try: + driver_is_available = driver.driver.is_available + except CudaSupportError: + pass + + return driver_is_available and nvvm.is_available() + + +def is_supported_version(): + """Returns True if the CUDA Runtime is a supported version. + + Unsupported versions (e.g. newer versions than those known to Numba) + may still work; this function provides a facility to check whether the + current Numba version is tested and known to work with the current + runtime version. If the current version is unsupported, the caller can + decide how to act. Options include: + + - Continuing silently, + - Emitting a warning, + - Generating an error or otherwise preventing the use of CUDA. + """ + + return runtime.is_supported_version() + + +def cuda_error(): + """Returns None if there was no error initializing the CUDA driver. + If there was an error initializing the driver, a string describing the + error is returned. + """ + return driver.driver.initialization_error + + +initialize.initialize_all() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/deviceufunc.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/deviceufunc.py new file mode 100644 index 0000000000000000000000000000000000000000..c29335a91b6b810b2a4731901217c389867a8bbf --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/deviceufunc.py @@ -0,0 +1,908 @@ +""" +Implements custom ufunc dispatch mechanism for non-CPU devices. +""" + +from abc import ABCMeta, abstractmethod +from collections import OrderedDict +import operator +import warnings +from functools import reduce + +import numpy as np + +from numba.np.ufunc.ufuncbuilder import _BaseUFuncBuilder, parse_identity +from numba.core import types, sigutils +from numba.core.typing import signature +from numba.np.ufunc.sigparse import parse_signature + + +def _broadcast_axis(a, b): + """ + Raises + ------ + ValueError if broadcast fails + """ + if a == b: + return a + elif a == 1: + return b + elif b == 1: + return a + else: + raise ValueError("failed to broadcast {0} and {1}".format(a, b)) + + +def _pairwise_broadcast(shape1, shape2): + """ + Raises + ------ + ValueError if broadcast fails + """ + shape1, shape2 = map(tuple, [shape1, shape2]) + + while len(shape1) < len(shape2): + shape1 = (1,) + shape1 + + while len(shape1) > len(shape2): + shape2 = (1,) + shape2 + + return tuple(_broadcast_axis(a, b) for a, b in zip(shape1, shape2)) + + +def _multi_broadcast(*shapelist): + """ + Raises + ------ + ValueError if broadcast fails + """ + assert shapelist + + result = shapelist[0] + others = shapelist[1:] + try: + for i, each in enumerate(others, start=1): + result = _pairwise_broadcast(result, each) + except ValueError: + raise ValueError("failed to broadcast argument #{0}".format(i)) + else: + return result + + +class UFuncMechanism(object): + """ + Prepare ufunc arguments for vectorize. + """ + DEFAULT_STREAM = None + SUPPORT_DEVICE_SLICING = False + + def __init__(self, typemap, args): + """Never used directly by user. Invoke by UFuncMechanism.call(). + """ + self.typemap = typemap + self.args = args + nargs = len(self.args) + self.argtypes = [None] * nargs + self.scalarpos = [] + self.signature = None + self.arrays = [None] * nargs + + def _fill_arrays(self): + """ + Get all arguments in array form + """ + for i, arg in enumerate(self.args): + if self.is_device_array(arg): + self.arrays[i] = self.as_device_array(arg) + elif isinstance(arg, (int, float, complex, np.number)): + # Is scalar + self.scalarpos.append(i) + else: + self.arrays[i] = np.asarray(arg) + + def _fill_argtypes(self): + """ + Get dtypes + """ + for i, ary in enumerate(self.arrays): + if ary is not None: + dtype = getattr(ary, 'dtype') + if dtype is None: + dtype = np.asarray(ary).dtype + self.argtypes[i] = dtype + + def _resolve_signature(self): + """Resolve signature. + May have ambiguous case. + """ + matches = [] + # Resolve scalar args exact match first + if self.scalarpos: + # Try resolve scalar arguments + for formaltys in self.typemap: + match_map = [] + for i, (formal, actual) in enumerate(zip(formaltys, + self.argtypes)): + if actual is None: + actual = np.asarray(self.args[i]).dtype + + match_map.append(actual == formal) + + if all(match_map): + matches.append(formaltys) + + # No matching with exact match; try coercing the scalar arguments + if not matches: + matches = [] + for formaltys in self.typemap: + all_matches = all(actual is None or formal == actual + for formal, actual in + zip(formaltys, self.argtypes)) + if all_matches: + matches.append(formaltys) + + if not matches: + raise TypeError("No matching version. GPU ufunc requires array " + "arguments to have the exact types. This behaves " + "like regular ufunc with casting='no'.") + + if len(matches) > 1: + raise TypeError("Failed to resolve ufunc due to ambiguous " + "signature. Too many untyped scalars. " + "Use numpy dtype object to type tag.") + + # Try scalar arguments + self.argtypes = matches[0] + + def _get_actual_args(self): + """Return the actual arguments + Casts scalar arguments to np.array. + """ + for i in self.scalarpos: + self.arrays[i] = np.array([self.args[i]], dtype=self.argtypes[i]) + + return self.arrays + + def _broadcast(self, arys): + """Perform numpy ufunc broadcasting + """ + shapelist = [a.shape for a in arys] + shape = _multi_broadcast(*shapelist) + + for i, ary in enumerate(arys): + if ary.shape == shape: + pass + + else: + if self.is_device_array(ary): + arys[i] = self.broadcast_device(ary, shape) + + else: + ax_differs = [ax for ax in range(len(shape)) + if ax >= ary.ndim + or ary.shape[ax] != shape[ax]] + + missingdim = len(shape) - len(ary.shape) + strides = [0] * missingdim + list(ary.strides) + + for ax in ax_differs: + strides[ax] = 0 + + strided = np.lib.stride_tricks.as_strided(ary, + shape=shape, + strides=strides) + + arys[i] = self.force_array_layout(strided) + + return arys + + def get_arguments(self): + """Prepare and return the arguments for the ufunc. + Does not call to_device(). + """ + self._fill_arrays() + self._fill_argtypes() + self._resolve_signature() + arys = self._get_actual_args() + return self._broadcast(arys) + + def get_function(self): + """Returns (result_dtype, function) + """ + return self.typemap[self.argtypes] + + def is_device_array(self, obj): + """Is the `obj` a device array? + Override in subclass + """ + return False + + def as_device_array(self, obj): + """Convert the `obj` to a device array + Override in subclass + + Default implementation is an identity function + """ + return obj + + def broadcast_device(self, ary, shape): + """Handles ondevice broadcasting + + Override in subclass to add support. + """ + raise NotImplementedError("broadcasting on device is not supported") + + def force_array_layout(self, ary): + """Ensures array layout met device requirement. + + Override in sublcass + """ + return ary + + @classmethod + def call(cls, typemap, args, kws): + """Perform the entire ufunc call mechanism. + """ + # Handle keywords + stream = kws.pop('stream', cls.DEFAULT_STREAM) + out = kws.pop('out', None) + + if kws: + warnings.warn("unrecognized keywords: %s" % ', '.join(kws)) + + # Begin call resolution + cr = cls(typemap, args) + args = cr.get_arguments() + resty, func = cr.get_function() + + outshape = args[0].shape + + # Adjust output value + if out is not None and cr.is_device_array(out): + out = cr.as_device_array(out) + + def attempt_ravel(a): + if cr.SUPPORT_DEVICE_SLICING: + raise NotImplementedError + + try: + # Call the `.ravel()` method + return a.ravel() + except NotImplementedError: + # If it is not a device array + if not cr.is_device_array(a): + raise + # For device array, retry ravel on the host by first + # copying it back. + else: + hostary = cr.to_host(a, stream).ravel() + return cr.to_device(hostary, stream) + + if args[0].ndim > 1: + args = [attempt_ravel(a) for a in args] + + # Prepare argument on the device + devarys = [] + any_device = False + for a in args: + if cr.is_device_array(a): + devarys.append(a) + any_device = True + else: + dev_a = cr.to_device(a, stream=stream) + devarys.append(dev_a) + + # Launch + shape = args[0].shape + if out is None: + # No output is provided + devout = cr.allocate_device_array(shape, resty, stream=stream) + + devarys.extend([devout]) + cr.launch(func, shape[0], stream, devarys) + + if any_device: + # If any of the arguments are on device, + # Keep output on the device + return devout.reshape(outshape) + else: + # Otherwise, transfer output back to host + return devout.copy_to_host().reshape(outshape) + + elif cr.is_device_array(out): + # If output is provided and it is a device array, + # Return device array + if out.ndim > 1: + out = attempt_ravel(out) + devout = out + devarys.extend([devout]) + cr.launch(func, shape[0], stream, devarys) + return devout.reshape(outshape) + + else: + # If output is provided and it is a host array, + # Return host array + assert out.shape == shape + assert out.dtype == resty + devout = cr.allocate_device_array(shape, resty, stream=stream) + devarys.extend([devout]) + cr.launch(func, shape[0], stream, devarys) + return devout.copy_to_host(out, stream=stream).reshape(outshape) + + def to_device(self, hostary, stream): + """Implement to device transfer + Override in subclass + """ + raise NotImplementedError + + def to_host(self, devary, stream): + """Implement to host transfer + Override in subclass + """ + raise NotImplementedError + + def allocate_device_array(self, shape, dtype, stream): + """Implements device allocation + Override in subclass + """ + raise NotImplementedError + + def launch(self, func, count, stream, args): + """Implements device function invocation + Override in subclass + """ + raise NotImplementedError + + +def to_dtype(ty): + if isinstance(ty, types.EnumMember): + ty = ty.dtype + return np.dtype(str(ty)) + + +class DeviceVectorize(_BaseUFuncBuilder): + def __init__(self, func, identity=None, cache=False, targetoptions={}): + if cache: + raise TypeError("caching is not supported") + for opt in targetoptions: + if opt == 'nopython': + warnings.warn("nopython kwarg for cuda target is redundant", + RuntimeWarning) + else: + fmt = "Unrecognized options. " + fmt += "cuda vectorize target does not support option: '%s'" + raise KeyError(fmt % opt) + self.py_func = func + self.identity = parse_identity(identity) + # { arg_dtype: (return_dtype), cudakernel } + self.kernelmap = OrderedDict() + + @property + def pyfunc(self): + return self.py_func + + def add(self, sig=None): + # compile core as device function + args, return_type = sigutils.normalize_signature(sig) + devfnsig = signature(return_type, *args) + + funcname = self.pyfunc.__name__ + kernelsource = self._get_kernel_source(self._kernel_template, + devfnsig, funcname) + corefn, return_type = self._compile_core(devfnsig) + glbl = self._get_globals(corefn) + sig = signature(types.void, *([a[:] for a in args] + [return_type[:]])) + exec(kernelsource, glbl) + + stager = glbl['__vectorized_%s' % funcname] + kernel = self._compile_kernel(stager, sig) + + argdtypes = tuple(to_dtype(t) for t in devfnsig.args) + resdtype = to_dtype(return_type) + self.kernelmap[tuple(argdtypes)] = resdtype, kernel + + def build_ufunc(self): + raise NotImplementedError + + def _get_kernel_source(self, template, sig, funcname): + args = ['a%d' % i for i in range(len(sig.args))] + fmts = dict(name=funcname, + args=', '.join(args), + argitems=', '.join('%s[__tid__]' % i for i in args)) + return template.format(**fmts) + + def _compile_core(self, sig): + raise NotImplementedError + + def _get_globals(self, corefn): + raise NotImplementedError + + def _compile_kernel(self, fnobj, sig): + raise NotImplementedError + + +class DeviceGUFuncVectorize(_BaseUFuncBuilder): + def __init__(self, func, sig, identity=None, cache=False, targetoptions={}, + writable_args=()): + if cache: + raise TypeError("caching is not supported") + if writable_args: + raise TypeError("writable_args are not supported") + + # Allow nopython flag to be set. + if not targetoptions.pop('nopython', True): + raise TypeError("nopython flag must be True") + # Are there any more target options? + if targetoptions: + opts = ', '.join([repr(k) for k in targetoptions.keys()]) + fmt = "The following target options are not supported: {0}" + raise TypeError(fmt.format(opts)) + + self.py_func = func + self.identity = parse_identity(identity) + self.signature = sig + self.inputsig, self.outputsig = parse_signature(self.signature) + + # Maps from a tuple of input_dtypes to (output_dtypes, kernel) + self.kernelmap = OrderedDict() + + @property + def pyfunc(self): + return self.py_func + + def add(self, sig=None): + indims = [len(x) for x in self.inputsig] + outdims = [len(x) for x in self.outputsig] + args, return_type = sigutils.normalize_signature(sig) + + # It is only valid to specify types.none as a return type, or to not + # specify the return type (where the "Python None" is the return type) + valid_return_type = return_type in (types.none, None) + if not valid_return_type: + raise TypeError('guvectorized functions cannot return values: ' + f'signature {sig} specifies {return_type} return ' + 'type') + + funcname = self.py_func.__name__ + src = expand_gufunc_template(self._kernel_template, indims, + outdims, funcname, args) + + glbls = self._get_globals(sig) + + exec(src, glbls) + fnobj = glbls['__gufunc_{name}'.format(name=funcname)] + + outertys = list(_determine_gufunc_outer_types(args, indims + outdims)) + kernel = self._compile_kernel(fnobj, sig=tuple(outertys)) + + nout = len(outdims) + dtypes = [np.dtype(str(t.dtype)) for t in outertys] + indtypes = tuple(dtypes[:-nout]) + outdtypes = tuple(dtypes[-nout:]) + + self.kernelmap[indtypes] = outdtypes, kernel + + def _compile_kernel(self, fnobj, sig): + raise NotImplementedError + + def _get_globals(self, sig): + raise NotImplementedError + + +def _determine_gufunc_outer_types(argtys, dims): + for at, nd in zip(argtys, dims): + if isinstance(at, types.Array): + yield at.copy(ndim=nd + 1) + else: + if nd > 0: + raise ValueError("gufunc signature mismatch: ndim>0 for scalar") + yield types.Array(dtype=at, ndim=1, layout='A') + + +def expand_gufunc_template(template, indims, outdims, funcname, argtypes): + """Expand gufunc source template + """ + argdims = indims + outdims + argnames = ["arg{0}".format(i) for i in range(len(argdims))] + checkedarg = "min({0})".format(', '.join(["{0}.shape[0]".format(a) + for a in argnames])) + inputs = [_gen_src_for_indexing(aref, adims, atype) + for aref, adims, atype in zip(argnames, indims, argtypes)] + outputs = [_gen_src_for_indexing(aref, adims, atype) + for aref, adims, atype in zip(argnames[len(indims):], outdims, + argtypes[len(indims):])] + argitems = inputs + outputs + src = template.format(name=funcname, args=', '.join(argnames), + checkedarg=checkedarg, + argitems=', '.join(argitems)) + return src + + +def _gen_src_for_indexing(aref, adims, atype): + return "{aref}[{sliced}]".format(aref=aref, + sliced=_gen_src_index(adims, atype)) + + +def _gen_src_index(adims, atype): + if adims > 0: + return ','.join(['__tid__'] + [':'] * adims) + elif isinstance(atype, types.Array) and atype.ndim - 1 == adims: + # Special case for 0-nd in shape-signature but + # 1d array in type signature. + # Slice it so that the result has the same dimension. + return '__tid__:(__tid__ + 1)' + else: + return '__tid__' + + +class GUFuncEngine(object): + '''Determine how to broadcast and execute a gufunc + base on input shape and signature + ''' + + @classmethod + def from_signature(cls, signature): + return cls(*parse_signature(signature)) + + def __init__(self, inputsig, outputsig): + # signatures + self.sin = inputsig + self.sout = outputsig + # argument count + self.nin = len(self.sin) + self.nout = len(self.sout) + + def schedule(self, ishapes): + if len(ishapes) != self.nin: + raise TypeError('invalid number of input argument') + + # associate symbol values for input signature + symbolmap = {} + outer_shapes = [] + inner_shapes = [] + + for argn, (shape, symbols) in enumerate(zip(ishapes, self.sin)): + argn += 1 # start from 1 for human + inner_ndim = len(symbols) + if len(shape) < inner_ndim: + fmt = "arg #%d: insufficient inner dimension" + raise ValueError(fmt % (argn,)) + if inner_ndim: + inner_shape = shape[-inner_ndim:] + outer_shape = shape[:-inner_ndim] + else: + inner_shape = () + outer_shape = shape + + for axis, (dim, sym) in enumerate(zip(inner_shape, symbols)): + axis += len(outer_shape) + if sym in symbolmap: + if symbolmap[sym] != dim: + fmt = "arg #%d: shape[%d] mismatch argument" + raise ValueError(fmt % (argn, axis)) + symbolmap[sym] = dim + + outer_shapes.append(outer_shape) + inner_shapes.append(inner_shape) + + # solve output shape + oshapes = [] + for outsig in self.sout: + oshape = [] + for sym in outsig: + oshape.append(symbolmap[sym]) + oshapes.append(tuple(oshape)) + + # find the biggest outershape as looping dimension + sizes = [reduce(operator.mul, s, 1) for s in outer_shapes] + largest_i = np.argmax(sizes) + loopdims = outer_shapes[largest_i] + + pinned = [False] * self.nin # same argument for each iteration + for i, d in enumerate(outer_shapes): + if d != loopdims: + if d == (1,) or d == (): + pinned[i] = True + else: + fmt = "arg #%d: outer dimension mismatch" + raise ValueError(fmt % (i + 1,)) + + return GUFuncSchedule(self, inner_shapes, oshapes, loopdims, pinned) + + +class GUFuncSchedule(object): + def __init__(self, parent, ishapes, oshapes, loopdims, pinned): + self.parent = parent + # core shapes + self.ishapes = ishapes + self.oshapes = oshapes + # looping dimension + self.loopdims = loopdims + self.loopn = reduce(operator.mul, loopdims, 1) + # flags + self.pinned = pinned + + self.output_shapes = [loopdims + s for s in oshapes] + + def __str__(self): + import pprint + + attrs = 'ishapes', 'oshapes', 'loopdims', 'loopn', 'pinned' + values = [(k, getattr(self, k)) for k in attrs] + return pprint.pformat(dict(values)) + + +class GeneralizedUFunc(object): + def __init__(self, kernelmap, engine): + self.kernelmap = kernelmap + self.engine = engine + self.max_blocksize = 2 ** 30 + + def __call__(self, *args, **kws): + callsteps = self._call_steps(self.engine.nin, self.engine.nout, + args, kws) + indtypes, schedule, outdtypes, kernel = self._schedule( + callsteps.inputs, callsteps.outputs) + callsteps.adjust_input_types(indtypes) + + outputs = callsteps.prepare_outputs(schedule, outdtypes) + inputs = callsteps.prepare_inputs() + parameters = self._broadcast(schedule, inputs, outputs) + + callsteps.launch_kernel(kernel, schedule.loopn, parameters) + + return callsteps.post_process_outputs(outputs) + + def _schedule(self, inputs, outs): + input_shapes = [a.shape for a in inputs] + schedule = self.engine.schedule(input_shapes) + + # find kernel + indtypes = tuple(i.dtype for i in inputs) + try: + outdtypes, kernel = self.kernelmap[indtypes] + except KeyError: + # No exact match, then use the first compatible. + # This does not match the numpy dispatching exactly. + # Later, we may just jit a new version for the missing signature. + indtypes = self._search_matching_signature(indtypes) + # Select kernel + outdtypes, kernel = self.kernelmap[indtypes] + + # check output + for sched_shape, out in zip(schedule.output_shapes, outs): + if out is not None and sched_shape != out.shape: + raise ValueError('output shape mismatch') + + return indtypes, schedule, outdtypes, kernel + + def _search_matching_signature(self, idtypes): + """ + Given the input types in `idtypes`, return a compatible sequence of + types that is defined in `kernelmap`. + + Note: Ordering is guaranteed by `kernelmap` being a OrderedDict + """ + for sig in self.kernelmap.keys(): + if all(np.can_cast(actual, desired) + for actual, desired in zip(sig, idtypes)): + return sig + else: + raise TypeError("no matching signature") + + def _broadcast(self, schedule, params, retvals): + assert schedule.loopn > 0, "zero looping dimension" + + odim = 1 if not schedule.loopdims else schedule.loopn + newparams = [] + for p, cs in zip(params, schedule.ishapes): + if not cs and p.size == 1: + # Broadcast scalar input + devary = self._broadcast_scalar_input(p, odim) + newparams.append(devary) + else: + # Broadcast vector input + newparams.append(self._broadcast_array(p, odim, cs)) + + newretvals = [] + for retval, oshape in zip(retvals, schedule.oshapes): + newretvals.append(retval.reshape(odim, *oshape)) + return tuple(newparams) + tuple(newretvals) + + def _broadcast_array(self, ary, newdim, innerdim): + newshape = (newdim,) + innerdim + # No change in shape + if ary.shape == newshape: + return ary + + # Creating new dimension + elif len(ary.shape) < len(newshape): + assert newshape[-len(ary.shape):] == ary.shape, \ + "cannot add dim and reshape at the same time" + return self._broadcast_add_axis(ary, newshape) + + # Collapsing dimension + else: + return ary.reshape(*newshape) + + def _broadcast_add_axis(self, ary, newshape): + raise NotImplementedError("cannot add new axis") + + def _broadcast_scalar_input(self, ary, shape): + raise NotImplementedError + + +class GUFuncCallSteps(metaclass=ABCMeta): + """ + Implements memory management and kernel launch operations for GUFunc calls. + + One instance of this class is instantiated for each call, and the instance + is specific to the arguments given to the GUFunc call. + + The base class implements the overall logic; subclasses provide + target-specific implementations of individual functions. + """ + + # The base class uses these slots; subclasses may provide additional slots. + __slots__ = [ + 'outputs', + 'inputs', + '_copy_result_to_host', + ] + + @abstractmethod + def launch_kernel(self, kernel, nelem, args): + """Implement the kernel launch""" + + @abstractmethod + def is_device_array(self, obj): + """ + Return True if `obj` is a device array for this target, False + otherwise. + """ + + @abstractmethod + def as_device_array(self, obj): + """ + Return `obj` as a device array on this target. + + May return `obj` directly if it is already on the target. + """ + + @abstractmethod + def to_device(self, hostary): + """ + Copy `hostary` to the device and return the device array. + """ + + @abstractmethod + def allocate_device_array(self, shape, dtype): + """ + Allocate a new uninitialized device array with the given shape and + dtype. + """ + + def __init__(self, nin, nout, args, kwargs): + outputs = kwargs.get('out') + + # Ensure the user has passed a correct number of arguments + if outputs is None and len(args) not in (nin, (nin + nout)): + def pos_argn(n): + return f'{n} positional argument{"s" * (n != 1)}' + + msg = (f'This gufunc accepts {pos_argn(nin)} (when providing ' + f'input only) or {pos_argn(nin + nout)} (when providing ' + f'input and output). Got {pos_argn(len(args))}.') + raise TypeError(msg) + + if outputs is not None and len(args) > nin: + raise ValueError("cannot specify argument 'out' as both positional " + "and keyword") + else: + # If the user did not pass outputs either in the out kwarg or as + # positional arguments, then we need to generate an initial list of + # "placeholder" outputs using None as a sentry value + outputs = [outputs] * nout + + # Ensure all output device arrays are Numba device arrays - for + # example, any output passed in that supports the CUDA Array Interface + # is converted to a Numba CUDA device array; others are left untouched. + all_user_outputs_are_host = True + self.outputs = [] + for output in outputs: + if self.is_device_array(output): + self.outputs.append(self.as_device_array(output)) + all_user_outputs_are_host = False + else: + self.outputs.append(output) + + all_host_arrays = not any([self.is_device_array(a) for a in args]) + + # - If any of the arguments are device arrays, we leave the output on + # the device. + self._copy_result_to_host = (all_host_arrays and + all_user_outputs_are_host) + + # Normalize arguments - ensure they are either device- or host-side + # arrays (as opposed to lists, tuples, etc). + def normalize_arg(a): + if self.is_device_array(a): + convert = self.as_device_array + else: + convert = np.asarray + + return convert(a) + + normalized_args = [normalize_arg(a) for a in args] + self.inputs = normalized_args[:nin] + + # Check if there are extra arguments for outputs. + unused_inputs = normalized_args[nin:] + if unused_inputs: + self.outputs = unused_inputs + + def adjust_input_types(self, indtypes): + """ + Attempt to cast the inputs to the required types if necessary + and if they are not device arrays. + + Side effect: Only affects the elements of `inputs` that require + a type cast. + """ + for i, (ity, val) in enumerate(zip(indtypes, self.inputs)): + if ity != val.dtype: + if not hasattr(val, 'astype'): + msg = ("compatible signature is possible by casting but " + "{0} does not support .astype()").format(type(val)) + raise TypeError(msg) + # Cast types + self.inputs[i] = val.astype(ity) + + def prepare_outputs(self, schedule, outdtypes): + """ + Returns a list of output parameters that all reside on the target + device. + + Outputs that were passed-in to the GUFunc are used if they reside on the + device; other outputs are allocated as necessary. + """ + outputs = [] + for shape, dtype, output in zip(schedule.output_shapes, outdtypes, + self.outputs): + if output is None or self._copy_result_to_host: + output = self.allocate_device_array(shape, dtype) + outputs.append(output) + + return outputs + + def prepare_inputs(self): + """ + Returns a list of input parameters that all reside on the target device. + """ + def ensure_device(parameter): + if self.is_device_array(parameter): + convert = self.as_device_array + else: + convert = self.to_device + + return convert(parameter) + + return [ensure_device(p) for p in self.inputs] + + def post_process_outputs(self, outputs): + """ + Moves the given output(s) to the host if necessary. + + Returns a single value (e.g. an array) if there was one output, or a + tuple of arrays if there were multiple. Although this feels a little + jarring, it is consistent with the behavior of GUFuncs in general. + """ + if self._copy_result_to_host: + outputs = [self.to_host(output, self_output) + for output, self_output in zip(outputs, self.outputs)] + elif self.outputs[0] is not None: + outputs = self.outputs + + if len(outputs) == 1: + return outputs[0] + else: + return tuple(outputs) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/dispatcher.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/dispatcher.py new file mode 100644 index 0000000000000000000000000000000000000000..4a750a1aa4ce21935b7e305e89c5d7eee690465f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/dispatcher.py @@ -0,0 +1,1057 @@ +import numpy as np +import os +import sys +import ctypes +import functools + +from numba.core import config, serialize, sigutils, types, typing, utils +from numba.core.caching import Cache, CacheImpl +from numba.core.compiler_lock import global_compiler_lock +from numba.core.dispatcher import Dispatcher +from numba.core.errors import NumbaPerformanceWarning +from numba.core.typing.typeof import Purpose, typeof + +from numba.cuda.api import get_current_device +from numba.cuda.args import wrap_arg +from numba.cuda.compiler import compile_cuda, CUDACompiler +from numba.cuda.cudadrv import driver +from numba.cuda.cudadrv.devices import get_context +from numba.cuda.descriptor import cuda_target +from numba.cuda.errors import (missing_launch_config_msg, + normalize_kernel_dimensions) +from numba.cuda import types as cuda_types + +from numba import cuda +from numba import _dispatcher + +from warnings import warn + +cuda_fp16_math_funcs = ['hsin', 'hcos', + 'hlog', 'hlog10', + 'hlog2', + 'hexp', 'hexp10', + 'hexp2', + 'hsqrt', 'hrsqrt', + 'hfloor', 'hceil', + 'hrcp', 'hrint', + 'htrunc', 'hdiv'] + + +class _Kernel(serialize.ReduceMixin): + ''' + CUDA Kernel specialized for a given set of argument types. When called, this + object launches the kernel on the device. + ''' + + @global_compiler_lock + def __init__(self, py_func, argtypes, link=None, debug=False, + lineinfo=False, inline=False, fastmath=False, extensions=None, + max_registers=None, opt=True, device=False): + + if device: + raise RuntimeError('Cannot compile a device function as a kernel') + + super().__init__() + + # _DispatcherBase.nopython_signatures() expects this attribute to be + # present, because it assumes an overload is a CompileResult. In the + # CUDA target, _Kernel instances are stored instead, so we provide this + # attribute here to avoid duplicating nopython_signatures() in the CUDA + # target with slight modifications. + self.objectmode = False + + # The finalizer constructed by _DispatcherBase._make_finalizer also + # expects overloads to be a CompileResult. It uses the entry_point to + # remove a CompileResult from a target context. However, since we never + # insert kernels into a target context (there is no need because they + # cannot be called by other functions, only through the dispatcher) it + # suffices to pretend we have an entry point of None. + self.entry_point = None + + self.py_func = py_func + self.argtypes = argtypes + self.debug = debug + self.lineinfo = lineinfo + self.extensions = extensions or [] + + nvvm_options = { + 'fastmath': fastmath, + 'opt': 3 if opt else 0 + } + + cc = get_current_device().compute_capability + cres = compile_cuda(self.py_func, types.void, self.argtypes, + debug=self.debug, + lineinfo=lineinfo, + inline=inline, + fastmath=fastmath, + nvvm_options=nvvm_options, + cc=cc) + tgt_ctx = cres.target_context + code = self.py_func.__code__ + filename = code.co_filename + linenum = code.co_firstlineno + lib, kernel = tgt_ctx.prepare_cuda_kernel(cres.library, cres.fndesc, + debug, lineinfo, nvvm_options, + filename, linenum, + max_registers) + + if not link: + link = [] + + # A kernel needs cooperative launch if grid_sync is being used. + self.cooperative = 'cudaCGGetIntrinsicHandle' in lib.get_asm_str() + # We need to link against cudadevrt if grid sync is being used. + if self.cooperative: + lib.needs_cudadevrt = True + + res = [fn for fn in cuda_fp16_math_funcs + if (f'__numba_wrapper_{fn}' in lib.get_asm_str())] + + if res: + # Path to the source containing the foreign function + basedir = os.path.dirname(os.path.abspath(__file__)) + functions_cu_path = os.path.join(basedir, + 'cpp_function_wrappers.cu') + link.append(functions_cu_path) + + for filepath in link: + lib.add_linking_file(filepath) + + # populate members + self.entry_name = kernel.name + self.signature = cres.signature + self._type_annotation = cres.type_annotation + self._codelibrary = lib + self.call_helper = cres.call_helper + + # The following are referred to by the cache implementation. Note: + # - There are no referenced environments in CUDA. + # - Kernels don't have lifted code. + # - reload_init is only for parfors. + self.target_context = tgt_ctx + self.fndesc = cres.fndesc + self.environment = cres.environment + self._referenced_environments = [] + self.lifted = [] + self.reload_init = [] + + @property + def library(self): + return self._codelibrary + + @property + def type_annotation(self): + return self._type_annotation + + def _find_referenced_environments(self): + return self._referenced_environments + + @property + def codegen(self): + return self.target_context.codegen() + + @property + def argument_types(self): + return tuple(self.signature.args) + + @classmethod + def _rebuild(cls, cooperative, name, signature, codelibrary, + debug, lineinfo, call_helper, extensions): + """ + Rebuild an instance. + """ + instance = cls.__new__(cls) + # invoke parent constructor + super(cls, instance).__init__() + # populate members + instance.entry_point = None + instance.cooperative = cooperative + instance.entry_name = name + instance.signature = signature + instance._type_annotation = None + instance._codelibrary = codelibrary + instance.debug = debug + instance.lineinfo = lineinfo + instance.call_helper = call_helper + instance.extensions = extensions + return instance + + def _reduce_states(self): + """ + Reduce the instance for serialization. + Compiled definitions are serialized in PTX form. + Type annotation are discarded. + Thread, block and shared memory configuration are serialized. + Stream information is discarded. + """ + return dict(cooperative=self.cooperative, name=self.entry_name, + signature=self.signature, codelibrary=self._codelibrary, + debug=self.debug, lineinfo=self.lineinfo, + call_helper=self.call_helper, extensions=self.extensions) + + def bind(self): + """ + Force binding to current CUDA context + """ + self._codelibrary.get_cufunc() + + @property + def regs_per_thread(self): + ''' + The number of registers used by each thread for this kernel. + ''' + return self._codelibrary.get_cufunc().attrs.regs + + @property + def const_mem_size(self): + ''' + The amount of constant memory used by this kernel. + ''' + return self._codelibrary.get_cufunc().attrs.const + + @property + def shared_mem_per_block(self): + ''' + The amount of shared memory used per block for this kernel. + ''' + return self._codelibrary.get_cufunc().attrs.shared + + @property + def max_threads_per_block(self): + ''' + The maximum allowable threads per block. + ''' + return self._codelibrary.get_cufunc().attrs.maxthreads + + @property + def local_mem_per_thread(self): + ''' + The amount of local memory used per thread for this kernel. + ''' + return self._codelibrary.get_cufunc().attrs.local + + def inspect_llvm(self): + ''' + Returns the LLVM IR for this kernel. + ''' + return self._codelibrary.get_llvm_str() + + def inspect_asm(self, cc): + ''' + Returns the PTX code for this kernel. + ''' + return self._codelibrary.get_asm_str(cc=cc) + + def inspect_sass_cfg(self): + ''' + Returns the CFG of the SASS for this kernel. + + Requires nvdisasm to be available on the PATH. + ''' + return self._codelibrary.get_sass_cfg() + + def inspect_sass(self): + ''' + Returns the SASS code for this kernel. + + Requires nvdisasm to be available on the PATH. + ''' + return self._codelibrary.get_sass() + + def inspect_types(self, file=None): + ''' + Produce a dump of the Python source of this function annotated with the + corresponding Numba IR and type information. The dump is written to + *file*, or *sys.stdout* if *file* is *None*. + ''' + if self._type_annotation is None: + raise ValueError("Type annotation is not available") + + if file is None: + file = sys.stdout + + print("%s %s" % (self.entry_name, self.argument_types), file=file) + print('-' * 80, file=file) + print(self._type_annotation, file=file) + print('=' * 80, file=file) + + def max_cooperative_grid_blocks(self, blockdim, dynsmemsize=0): + ''' + Calculates the maximum number of blocks that can be launched for this + kernel in a cooperative grid in the current context, for the given block + and dynamic shared memory sizes. + + :param blockdim: Block dimensions, either as a scalar for a 1D block, or + a tuple for 2D or 3D blocks. + :param dynsmemsize: Dynamic shared memory size in bytes. + :return: The maximum number of blocks in the grid. + ''' + ctx = get_context() + cufunc = self._codelibrary.get_cufunc() + + if isinstance(blockdim, tuple): + blockdim = functools.reduce(lambda x, y: x * y, blockdim) + active_per_sm = ctx.get_active_blocks_per_multiprocessor(cufunc, + blockdim, + dynsmemsize) + sm_count = ctx.device.MULTIPROCESSOR_COUNT + return active_per_sm * sm_count + + def launch(self, args, griddim, blockdim, stream=0, sharedmem=0): + # Prepare kernel + cufunc = self._codelibrary.get_cufunc() + + if self.debug: + excname = cufunc.name + "__errcode__" + excmem, excsz = cufunc.module.get_global_symbol(excname) + assert excsz == ctypes.sizeof(ctypes.c_int) + excval = ctypes.c_int() + excmem.memset(0, stream=stream) + + # Prepare arguments + retr = [] # hold functors for writeback + + kernelargs = [] + for t, v in zip(self.argument_types, args): + self._prepare_args(t, v, stream, retr, kernelargs) + + if driver.USE_NV_BINDING: + zero_stream = driver.binding.CUstream(0) + else: + zero_stream = None + + stream_handle = stream and stream.handle or zero_stream + + # Invoke kernel + driver.launch_kernel(cufunc.handle, + *griddim, + *blockdim, + sharedmem, + stream_handle, + kernelargs, + cooperative=self.cooperative) + + if self.debug: + driver.device_to_host(ctypes.addressof(excval), excmem, excsz) + if excval.value != 0: + # An error occurred + def load_symbol(name): + mem, sz = cufunc.module.get_global_symbol("%s__%s__" % + (cufunc.name, + name)) + val = ctypes.c_int() + driver.device_to_host(ctypes.addressof(val), mem, sz) + return val.value + + tid = [load_symbol("tid" + i) for i in 'zyx'] + ctaid = [load_symbol("ctaid" + i) for i in 'zyx'] + code = excval.value + exccls, exc_args, loc = self.call_helper.get_exception(code) + # Prefix the exception message with the source location + if loc is None: + locinfo = '' + else: + sym, filepath, lineno = loc + filepath = os.path.abspath(filepath) + locinfo = 'In function %r, file %s, line %s, ' % (sym, + filepath, + lineno,) + # Prefix the exception message with the thread position + prefix = "%stid=%s ctaid=%s" % (locinfo, tid, ctaid) + if exc_args: + exc_args = ("%s: %s" % (prefix, exc_args[0]),) + \ + exc_args[1:] + else: + exc_args = prefix, + raise exccls(*exc_args) + + # retrieve auto converted arrays + for wb in retr: + wb() + + def _prepare_args(self, ty, val, stream, retr, kernelargs): + """ + Convert arguments to ctypes and append to kernelargs + """ + + # map the arguments using any extension you've registered + for extension in reversed(self.extensions): + ty, val = extension.prepare_args( + ty, + val, + stream=stream, + retr=retr) + + if isinstance(ty, types.Array): + devary = wrap_arg(val).to_device(retr, stream) + + c_intp = ctypes.c_ssize_t + + meminfo = ctypes.c_void_p(0) + parent = ctypes.c_void_p(0) + nitems = c_intp(devary.size) + itemsize = c_intp(devary.dtype.itemsize) + + ptr = driver.device_pointer(devary) + + if driver.USE_NV_BINDING: + ptr = int(ptr) + + data = ctypes.c_void_p(ptr) + + kernelargs.append(meminfo) + kernelargs.append(parent) + kernelargs.append(nitems) + kernelargs.append(itemsize) + kernelargs.append(data) + for ax in range(devary.ndim): + kernelargs.append(c_intp(devary.shape[ax])) + for ax in range(devary.ndim): + kernelargs.append(c_intp(devary.strides[ax])) + + elif isinstance(ty, types.Integer): + cval = getattr(ctypes, "c_%s" % ty)(val) + kernelargs.append(cval) + + elif ty == types.float16: + cval = ctypes.c_uint16(np.float16(val).view(np.uint16)) + kernelargs.append(cval) + + elif ty == types.float64: + cval = ctypes.c_double(val) + kernelargs.append(cval) + + elif ty == types.float32: + cval = ctypes.c_float(val) + kernelargs.append(cval) + + elif ty == types.boolean: + cval = ctypes.c_uint8(int(val)) + kernelargs.append(cval) + + elif ty == types.complex64: + kernelargs.append(ctypes.c_float(val.real)) + kernelargs.append(ctypes.c_float(val.imag)) + + elif ty == types.complex128: + kernelargs.append(ctypes.c_double(val.real)) + kernelargs.append(ctypes.c_double(val.imag)) + + elif isinstance(ty, (types.NPDatetime, types.NPTimedelta)): + kernelargs.append(ctypes.c_int64(val.view(np.int64))) + + elif isinstance(ty, types.Record): + devrec = wrap_arg(val).to_device(retr, stream) + ptr = devrec.device_ctypes_pointer + if driver.USE_NV_BINDING: + ptr = ctypes.c_void_p(int(ptr)) + kernelargs.append(ptr) + + elif isinstance(ty, types.BaseTuple): + assert len(ty) == len(val) + for t, v in zip(ty, val): + self._prepare_args(t, v, stream, retr, kernelargs) + + elif isinstance(ty, types.EnumMember): + try: + self._prepare_args( + ty.dtype, val.value, stream, retr, kernelargs + ) + except NotImplementedError: + raise NotImplementedError(ty, val) + + else: + raise NotImplementedError(ty, val) + + +class ForAll(object): + def __init__(self, dispatcher, ntasks, tpb, stream, sharedmem): + if ntasks < 0: + raise ValueError("Can't create ForAll with negative task count: %s" + % ntasks) + self.dispatcher = dispatcher + self.ntasks = ntasks + self.thread_per_block = tpb + self.stream = stream + self.sharedmem = sharedmem + + def __call__(self, *args): + if self.ntasks == 0: + return + + if self.dispatcher.specialized: + specialized = self.dispatcher + else: + specialized = self.dispatcher.specialize(*args) + blockdim = self._compute_thread_per_block(specialized) + griddim = (self.ntasks + blockdim - 1) // blockdim + + return specialized[griddim, blockdim, self.stream, + self.sharedmem](*args) + + def _compute_thread_per_block(self, dispatcher): + tpb = self.thread_per_block + # Prefer user-specified config + if tpb != 0: + return tpb + # Else, ask the driver to give a good config + else: + ctx = get_context() + # Dispatcher is specialized, so there's only one definition - get + # it so we can get the cufunc from the code library + kernel = next(iter(dispatcher.overloads.values())) + kwargs = dict( + func=kernel._codelibrary.get_cufunc(), + b2d_func=0, # dynamic-shared memory is constant to blksz + memsize=self.sharedmem, + blocksizelimit=1024, + ) + _, tpb = ctx.get_max_potential_block_size(**kwargs) + return tpb + + +class _LaunchConfiguration: + def __init__(self, dispatcher, griddim, blockdim, stream, sharedmem): + self.dispatcher = dispatcher + self.griddim = griddim + self.blockdim = blockdim + self.stream = stream + self.sharedmem = sharedmem + + if config.CUDA_LOW_OCCUPANCY_WARNINGS: + # Warn when the grid has fewer than 128 blocks. This number is + # chosen somewhat heuristically - ideally the minimum is 2 times + # the number of SMs, but the number of SMs varies between devices - + # some very small GPUs might only have 4 SMs, but an H100-SXM5 has + # 132. In general kernels should be launched with large grids + # (hundreds or thousands of blocks), so warning when fewer than 128 + # blocks are used will likely catch most beginner errors, where the + # grid tends to be very small (single-digit or low tens of blocks). + min_grid_size = 128 + grid_size = griddim[0] * griddim[1] * griddim[2] + if grid_size < min_grid_size: + msg = (f"Grid size {grid_size} will likely result in GPU " + "under-utilization due to low occupancy.") + warn(NumbaPerformanceWarning(msg)) + + def __call__(self, *args): + return self.dispatcher.call(args, self.griddim, self.blockdim, + self.stream, self.sharedmem) + + +class CUDACacheImpl(CacheImpl): + def reduce(self, kernel): + return kernel._reduce_states() + + def rebuild(self, target_context, payload): + return _Kernel._rebuild(**payload) + + def check_cachable(self, cres): + # CUDA Kernels are always cachable - the reasons for an entity not to + # be cachable are: + # + # - The presence of lifted loops, or + # - The presence of dynamic globals. + # + # neither of which apply to CUDA kernels. + return True + + +class CUDACache(Cache): + """ + Implements a cache that saves and loads CUDA kernels and compile results. + """ + _impl_class = CUDACacheImpl + + def load_overload(self, sig, target_context): + # Loading an overload refreshes the context to ensure it is + # initialized. To initialize the correct (i.e. CUDA) target, we need to + # enforce that the current target is the CUDA target. + from numba.core.target_extension import target_override + with target_override('cuda'): + return super().load_overload(sig, target_context) + + +class CUDADispatcher(Dispatcher, serialize.ReduceMixin): + ''' + CUDA Dispatcher object. When configured and called, the dispatcher will + specialize itself for the given arguments (if no suitable specialized + version already exists) & compute capability, and launch on the device + associated with the current context. + + Dispatcher objects are not to be constructed by the user, but instead are + created using the :func:`numba.cuda.jit` decorator. + ''' + + # Whether to fold named arguments and default values. Default values are + # presently unsupported on CUDA, so we can leave this as False in all + # cases. + _fold_args = False + + targetdescr = cuda_target + + def __init__(self, py_func, targetoptions, pipeline_class=CUDACompiler): + super().__init__(py_func, targetoptions=targetoptions, + pipeline_class=pipeline_class) + + # The following properties are for specialization of CUDADispatchers. A + # specialized CUDADispatcher is one that is compiled for exactly one + # set of argument types, and bypasses some argument type checking for + # faster kernel launches. + + # Is this a specialized dispatcher? + self._specialized = False + + # If we produced specialized dispatchers, we cache them for each set of + # argument types + self.specializations = {} + + @property + def _numba_type_(self): + return cuda_types.CUDADispatcher(self) + + def enable_caching(self): + self._cache = CUDACache(self.py_func) + + @functools.lru_cache(maxsize=128) + def configure(self, griddim, blockdim, stream=0, sharedmem=0): + griddim, blockdim = normalize_kernel_dimensions(griddim, blockdim) + return _LaunchConfiguration(self, griddim, blockdim, stream, sharedmem) + + def __getitem__(self, args): + if len(args) not in [2, 3, 4]: + raise ValueError('must specify at least the griddim and blockdim') + return self.configure(*args) + + def forall(self, ntasks, tpb=0, stream=0, sharedmem=0): + """Returns a 1D-configured dispatcher for a given number of tasks. + + This assumes that: + + - the kernel maps the Global Thread ID ``cuda.grid(1)`` to tasks on a + 1-1 basis. + - the kernel checks that the Global Thread ID is upper-bounded by + ``ntasks``, and does nothing if it is not. + + :param ntasks: The number of tasks. + :param tpb: The size of a block. An appropriate value is chosen if this + parameter is not supplied. + :param stream: The stream on which the configured dispatcher will be + launched. + :param sharedmem: The number of bytes of dynamic shared memory required + by the kernel. + :return: A configured dispatcher, ready to launch on a set of + arguments.""" + + return ForAll(self, ntasks, tpb=tpb, stream=stream, sharedmem=sharedmem) + + @property + def extensions(self): + ''' + A list of objects that must have a `prepare_args` function. When a + specialized kernel is called, each argument will be passed through + to the `prepare_args` (from the last object in this list to the + first). The arguments to `prepare_args` are: + + - `ty` the numba type of the argument + - `val` the argument value itself + - `stream` the CUDA stream used for the current call to the kernel + - `retr` a list of zero-arg functions that you may want to append + post-call cleanup work to. + + The `prepare_args` function must return a tuple `(ty, val)`, which + will be passed in turn to the next right-most `extension`. After all + the extensions have been called, the resulting `(ty, val)` will be + passed into Numba's default argument marshalling logic. + ''' + return self.targetoptions.get('extensions') + + def __call__(self, *args, **kwargs): + # An attempt to launch an unconfigured kernel + raise ValueError(missing_launch_config_msg) + + def call(self, args, griddim, blockdim, stream, sharedmem): + ''' + Compile if necessary and invoke this kernel with *args*. + ''' + if self.specialized: + kernel = next(iter(self.overloads.values())) + else: + kernel = _dispatcher.Dispatcher._cuda_call(self, *args) + + kernel.launch(args, griddim, blockdim, stream, sharedmem) + + def _compile_for_args(self, *args, **kws): + # Based on _DispatcherBase._compile_for_args. + assert not kws + argtypes = [self.typeof_pyval(a) for a in args] + return self.compile(tuple(argtypes)) + + def typeof_pyval(self, val): + # Based on _DispatcherBase.typeof_pyval, but differs from it to support + # the CUDA Array Interface. + try: + return typeof(val, Purpose.argument) + except ValueError: + if cuda.is_cuda_array(val): + # When typing, we don't need to synchronize on the array's + # stream - this is done when the kernel is launched. + return typeof(cuda.as_cuda_array(val, sync=False), + Purpose.argument) + else: + raise + + def specialize(self, *args): + ''' + Create a new instance of this dispatcher specialized for the given + *args*. + ''' + if self.specialized: + raise RuntimeError('Dispatcher already specialized') + + cc = get_current_device().compute_capability + argtypes = tuple(self.typeof_pyval(a) for a in args) + + specialization = self.specializations.get((cc, argtypes)) + if specialization: + return specialization + + targetoptions = self.targetoptions + specialization = CUDADispatcher(self.py_func, + targetoptions=targetoptions) + specialization.compile(argtypes) + specialization.disable_compile() + specialization._specialized = True + self.specializations[cc, argtypes] = specialization + return specialization + + @property + def specialized(self): + """ + True if the Dispatcher has been specialized. + """ + return self._specialized + + def get_regs_per_thread(self, signature=None): + ''' + Returns the number of registers used by each thread in this kernel for + the device in the current context. + + :param signature: The signature of the compiled kernel to get register + usage for. This may be omitted for a specialized + kernel. + :return: The number of registers used by the compiled variant of the + kernel for the given signature and current device. + ''' + if signature is not None: + return self.overloads[signature.args].regs_per_thread + if self.specialized: + return next(iter(self.overloads.values())).regs_per_thread + else: + return {sig: overload.regs_per_thread + for sig, overload in self.overloads.items()} + + def get_const_mem_size(self, signature=None): + ''' + Returns the size in bytes of constant memory used by this kernel for + the device in the current context. + + :param signature: The signature of the compiled kernel to get constant + memory usage for. This may be omitted for a + specialized kernel. + :return: The size in bytes of constant memory allocated by the + compiled variant of the kernel for the given signature and + current device. + ''' + if signature is not None: + return self.overloads[signature.args].const_mem_size + if self.specialized: + return next(iter(self.overloads.values())).const_mem_size + else: + return {sig: overload.const_mem_size + for sig, overload in self.overloads.items()} + + def get_shared_mem_per_block(self, signature=None): + ''' + Returns the size in bytes of statically allocated shared memory + for this kernel. + + :param signature: The signature of the compiled kernel to get shared + memory usage for. This may be omitted for a + specialized kernel. + :return: The amount of shared memory allocated by the compiled variant + of the kernel for the given signature and current device. + ''' + if signature is not None: + return self.overloads[signature.args].shared_mem_per_block + if self.specialized: + return next(iter(self.overloads.values())).shared_mem_per_block + else: + return {sig: overload.shared_mem_per_block + for sig, overload in self.overloads.items()} + + def get_max_threads_per_block(self, signature=None): + ''' + Returns the maximum allowable number of threads per block + for this kernel. Exceeding this threshold will result in + the kernel failing to launch. + + :param signature: The signature of the compiled kernel to get the max + threads per block for. This may be omitted for a + specialized kernel. + :return: The maximum allowable threads per block for the compiled + variant of the kernel for the given signature and current + device. + ''' + if signature is not None: + return self.overloads[signature.args].max_threads_per_block + if self.specialized: + return next(iter(self.overloads.values())).max_threads_per_block + else: + return {sig: overload.max_threads_per_block + for sig, overload in self.overloads.items()} + + def get_local_mem_per_thread(self, signature=None): + ''' + Returns the size in bytes of local memory per thread + for this kernel. + + :param signature: The signature of the compiled kernel to get local + memory usage for. This may be omitted for a + specialized kernel. + :return: The amount of local memory allocated by the compiled variant + of the kernel for the given signature and current device. + ''' + if signature is not None: + return self.overloads[signature.args].local_mem_per_thread + if self.specialized: + return next(iter(self.overloads.values())).local_mem_per_thread + else: + return {sig: overload.local_mem_per_thread + for sig, overload in self.overloads.items()} + + def get_call_template(self, args, kws): + # Originally copied from _DispatcherBase.get_call_template. This + # version deviates slightly from the _DispatcherBase version in order + # to force casts when calling device functions. See e.g. + # TestDeviceFunc.test_device_casting, added in PR #7496. + """ + Get a typing.ConcreteTemplate for this dispatcher and the given + *args* and *kws* types. This allows resolution of the return type. + + A (template, pysig, args, kws) tuple is returned. + """ + # Ensure an exactly-matching overload is available if we can + # compile. We proceed with the typing even if we can't compile + # because we may be able to force a cast on the caller side. + if self._can_compile: + self.compile_device(tuple(args)) + + # Create function type for typing + func_name = self.py_func.__name__ + name = "CallTemplate({0})".format(func_name) + + call_template = typing.make_concrete_template( + name, key=func_name, signatures=self.nopython_signatures) + pysig = utils.pysignature(self.py_func) + + return call_template, pysig, args, kws + + def compile_device(self, args, return_type=None): + """Compile the device function for the given argument types. + + Each signature is compiled once by caching the compiled function inside + this object. + + Returns the `CompileResult`. + """ + if args not in self.overloads: + with self._compiling_counter: + + debug = self.targetoptions.get('debug') + lineinfo = self.targetoptions.get('lineinfo') + inline = self.targetoptions.get('inline') + fastmath = self.targetoptions.get('fastmath') + + nvvm_options = { + 'opt': 3 if self.targetoptions.get('opt') else 0, + 'fastmath': fastmath + } + + cc = get_current_device().compute_capability + cres = compile_cuda(self.py_func, return_type, args, + debug=debug, + lineinfo=lineinfo, + inline=inline, + fastmath=fastmath, + nvvm_options=nvvm_options, + cc=cc) + self.overloads[args] = cres + + cres.target_context.insert_user_function(cres.entry_point, + cres.fndesc, + [cres.library]) + else: + cres = self.overloads[args] + + return cres + + def add_overload(self, kernel, argtypes): + c_sig = [a._code for a in argtypes] + self._insert(c_sig, kernel, cuda=True) + self.overloads[argtypes] = kernel + + def compile(self, sig): + ''' + Compile and bind to the current context a version of this kernel + specialized for the given signature. + ''' + argtypes, return_type = sigutils.normalize_signature(sig) + assert return_type is None or return_type == types.none + + # Do we already have an in-memory compiled kernel? + if self.specialized: + return next(iter(self.overloads.values())) + else: + kernel = self.overloads.get(argtypes) + if kernel is not None: + return kernel + + # Can we load from the disk cache? + kernel = self._cache.load_overload(sig, self.targetctx) + + if kernel is not None: + self._cache_hits[sig] += 1 + else: + # We need to compile a new kernel + self._cache_misses[sig] += 1 + if not self._can_compile: + raise RuntimeError("Compilation disabled") + + kernel = _Kernel(self.py_func, argtypes, **self.targetoptions) + # We call bind to force codegen, so that there is a cubin to cache + kernel.bind() + self._cache.save_overload(sig, kernel) + + self.add_overload(kernel, argtypes) + + return kernel + + def inspect_llvm(self, signature=None): + ''' + Return the LLVM IR for this kernel. + + :param signature: A tuple of argument types. + :return: The LLVM IR for the given signature, or a dict of LLVM IR + for all previously-encountered signatures. + + ''' + device = self.targetoptions.get('device') + if signature is not None: + if device: + return self.overloads[signature].library.get_llvm_str() + else: + return self.overloads[signature].inspect_llvm() + else: + if device: + return {sig: overload.library.get_llvm_str() + for sig, overload in self.overloads.items()} + else: + return {sig: overload.inspect_llvm() + for sig, overload in self.overloads.items()} + + def inspect_asm(self, signature=None): + ''' + Return this kernel's PTX assembly code for for the device in the + current context. + + :param signature: A tuple of argument types. + :return: The PTX code for the given signature, or a dict of PTX codes + for all previously-encountered signatures. + ''' + cc = get_current_device().compute_capability + device = self.targetoptions.get('device') + if signature is not None: + if device: + return self.overloads[signature].library.get_asm_str(cc) + else: + return self.overloads[signature].inspect_asm(cc) + else: + if device: + return {sig: overload.library.get_asm_str(cc) + for sig, overload in self.overloads.items()} + else: + return {sig: overload.inspect_asm(cc) + for sig, overload in self.overloads.items()} + + def inspect_sass_cfg(self, signature=None): + ''' + Return this kernel's CFG for the device in the current context. + + :param signature: A tuple of argument types. + :return: The CFG for the given signature, or a dict of CFGs + for all previously-encountered signatures. + + The CFG for the device in the current context is returned. + + Requires nvdisasm to be available on the PATH. + ''' + if self.targetoptions.get('device'): + raise RuntimeError('Cannot get the CFG of a device function') + + if signature is not None: + return self.overloads[signature].inspect_sass_cfg() + else: + return {sig: defn.inspect_sass_cfg() + for sig, defn in self.overloads.items()} + + def inspect_sass(self, signature=None): + ''' + Return this kernel's SASS assembly code for for the device in the + current context. + + :param signature: A tuple of argument types. + :return: The SASS code for the given signature, or a dict of SASS codes + for all previously-encountered signatures. + + SASS for the device in the current context is returned. + + Requires nvdisasm to be available on the PATH. + ''' + if self.targetoptions.get('device'): + raise RuntimeError('Cannot inspect SASS of a device function') + + if signature is not None: + return self.overloads[signature].inspect_sass() + else: + return {sig: defn.inspect_sass() + for sig, defn in self.overloads.items()} + + def inspect_types(self, file=None): + ''' + Produce a dump of the Python source of this function annotated with the + corresponding Numba IR and type information. The dump is written to + *file*, or *sys.stdout* if *file* is *None*. + ''' + if file is None: + file = sys.stdout + + for _, defn in self.overloads.items(): + defn.inspect_types(file=file) + + @classmethod + def _rebuild(cls, py_func, targetoptions): + """ + Rebuild an instance. + """ + instance = cls(py_func, targetoptions) + return instance + + def _reduce_states(self): + """ + Reduce the instance for serialization. + Compiled definitions are discarded. + """ + return dict(py_func=self.py_func, + targetoptions=self.targetoptions) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/errors.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/errors.py new file mode 100644 index 0000000000000000000000000000000000000000..653a0db6ef2f80e50aebc14c6c576fe3570606ee --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/errors.py @@ -0,0 +1,59 @@ +import numbers +from numba.core.errors import LoweringError + + +class KernelRuntimeError(RuntimeError): + def __init__(self, msg, tid=None, ctaid=None): + self.tid = tid + self.ctaid = ctaid + self.msg = msg + t = ("An exception was raised in thread=%s block=%s\n" + "\t%s") + msg = t % (self.tid, self.ctaid, self.msg) + super(KernelRuntimeError, self).__init__(msg) + + +class CudaLoweringError(LoweringError): + pass + + +_launch_help_url = ("https://numba.readthedocs.io/en/stable/cuda/" + "kernels.html#kernel-invocation") +missing_launch_config_msg = """ +Kernel launch configuration was not specified. Use the syntax: + +kernel_function[blockspergrid, threadsperblock](arg0, arg1, ..., argn) + +See {} for help. + +""".format(_launch_help_url) + + +def normalize_kernel_dimensions(griddim, blockdim): + """ + Normalize and validate the user-supplied kernel dimensions. + """ + + def check_dim(dim, name): + if not isinstance(dim, (tuple, list)): + dim = [dim] + else: + dim = list(dim) + if len(dim) > 3: + raise ValueError('%s must be a sequence of 1, 2 or 3 integers, ' + 'got %r' % (name, dim)) + for v in dim: + if not isinstance(v, numbers.Integral): + raise TypeError('%s must be a sequence of integers, got %r' + % (name, dim)) + while len(dim) < 3: + dim.append(1) + return tuple(dim) + + if None in (griddim, blockdim): + raise ValueError(missing_launch_config_msg) + + griddim = check_dim(griddim, 'griddim') + blockdim = check_dim(blockdim, 'blockdim') + + return griddim, blockdim diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/extending.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/extending.py new file mode 100644 index 0000000000000000000000000000000000000000..cbc482aaac40c6ec995466581a5079ef280f9595 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/extending.py @@ -0,0 +1,7 @@ +""" +Added for symmetry with the core API +""" + +from numba.core.extending import intrinsic as _intrinsic + +intrinsic = _intrinsic(target='cuda') diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/initialize.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/initialize.py new file mode 100644 index 0000000000000000000000000000000000000000..e90c95b3110c65387fdd8a7a1714109ce2d05aff --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/initialize.py @@ -0,0 +1,13 @@ +def initialize_all(): + # Import models to register them with the data model manager + import numba.cuda.models # noqa: F401 + + from numba.cuda.decorators import jit + from numba.cuda.dispatcher import CUDADispatcher + from numba.core.target_extension import (target_registry, + dispatcher_registry, + jit_registry) + + cuda_target = target_registry["cuda"] + jit_registry[cuda_target] = jit + dispatcher_registry[cuda_target] = CUDADispatcher diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/intrinsic_wrapper.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/intrinsic_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..e02639f2122e2d6ca2b0c6ceecf2de63b4cf5395 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/intrinsic_wrapper.py @@ -0,0 +1,77 @@ +from .decorators import jit +import numba + + +@jit(device=True) +def all_sync(mask, predicate): + """ + If for all threads in the masked warp the predicate is true, then + a non-zero value is returned, otherwise 0 is returned. + """ + return numba.cuda.vote_sync_intrinsic(mask, 0, predicate)[1] + + +@jit(device=True) +def any_sync(mask, predicate): + """ + If for any thread in the masked warp the predicate is true, then + a non-zero value is returned, otherwise 0 is returned. + """ + return numba.cuda.vote_sync_intrinsic(mask, 1, predicate)[1] + + +@jit(device=True) +def eq_sync(mask, predicate): + """ + If for all threads in the masked warp the boolean predicate is the same, + then a non-zero value is returned, otherwise 0 is returned. + """ + return numba.cuda.vote_sync_intrinsic(mask, 2, predicate)[1] + + +@jit(device=True) +def ballot_sync(mask, predicate): + """ + Returns a mask of all threads in the warp whose predicate is true, + and are within the given mask. + """ + return numba.cuda.vote_sync_intrinsic(mask, 3, predicate)[0] + + +@jit(device=True) +def shfl_sync(mask, value, src_lane): + """ + Shuffles value across the masked warp and returns the value + from src_lane. If this is outside the warp, then the + given value is returned. + """ + return numba.cuda.shfl_sync_intrinsic(mask, 0, value, src_lane, 0x1f)[0] + + +@jit(device=True) +def shfl_up_sync(mask, value, delta): + """ + Shuffles value across the masked warp and returns the value + from (laneid - delta). If this is outside the warp, then the + given value is returned. + """ + return numba.cuda.shfl_sync_intrinsic(mask, 1, value, delta, 0)[0] + + +@jit(device=True) +def shfl_down_sync(mask, value, delta): + """ + Shuffles value across the masked warp and returns the value + from (laneid + delta). If this is outside the warp, then the + given value is returned. + """ + return numba.cuda.shfl_sync_intrinsic(mask, 2, value, delta, 0x1f)[0] + + +@jit(device=True) +def shfl_xor_sync(mask, value, lane_mask): + """ + Shuffles value across the masked warp and returns the value + from (laneid ^ lane_mask). + """ + return numba.cuda.shfl_sync_intrinsic(mask, 3, value, lane_mask, 0x1f)[0] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/intrinsics.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/intrinsics.py new file mode 100644 index 0000000000000000000000000000000000000000..3bf0b59932c93e60e716bc4550a683dc0e53a983 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/intrinsics.py @@ -0,0 +1,198 @@ +from llvmlite import ir + +from numba import cuda, types +from numba.core import cgutils +from numba.core.errors import RequireLiteralValue, NumbaValueError +from numba.core.typing import signature +from numba.core.extending import overload_attribute +from numba.cuda import nvvmutils +from numba.cuda.extending import intrinsic + + +#------------------------------------------------------------------------------- +# Grid functions + +def _type_grid_function(ndim): + val = ndim.literal_value + if val == 1: + restype = types.int64 + elif val in (2, 3): + restype = types.UniTuple(types.int64, val) + else: + raise NumbaValueError('argument can only be 1, 2, 3') + + return signature(restype, types.int32) + + +@intrinsic +def grid(typingctx, ndim): + '''grid(ndim) + + Return the absolute position of the current thread in the entire grid of + blocks. *ndim* should correspond to the number of dimensions declared when + instantiating the kernel. If *ndim* is 1, a single integer is returned. + If *ndim* is 2 or 3, a tuple of the given number of integers is returned. + + Computation of the first integer is as follows:: + + cuda.threadIdx.x + cuda.blockIdx.x * cuda.blockDim.x + + and is similar for the other two indices, but using the ``y`` and ``z`` + attributes. + ''' + + if not isinstance(ndim, types.IntegerLiteral): + raise RequireLiteralValue(ndim) + + sig = _type_grid_function(ndim) + + def codegen(context, builder, sig, args): + restype = sig.return_type + if restype == types.int64: + return nvvmutils.get_global_id(builder, dim=1) + elif isinstance(restype, types.UniTuple): + ids = nvvmutils.get_global_id(builder, dim=restype.count) + return cgutils.pack_array(builder, ids) + + return sig, codegen + + +@intrinsic +def gridsize(typingctx, ndim): + '''gridsize(ndim) + + Return the absolute size (or shape) in threads of the entire grid of + blocks. *ndim* should correspond to the number of dimensions declared when + instantiating the kernel. If *ndim* is 1, a single integer is returned. + If *ndim* is 2 or 3, a tuple of the given number of integers is returned. + + Computation of the first integer is as follows:: + + cuda.blockDim.x * cuda.gridDim.x + + and is similar for the other two indices, but using the ``y`` and ``z`` + attributes. + ''' + + if not isinstance(ndim, types.IntegerLiteral): + raise RequireLiteralValue(ndim) + + sig = _type_grid_function(ndim) + + def _nthreads_for_dim(builder, dim): + i64 = ir.IntType(64) + ntid = nvvmutils.call_sreg(builder, f"ntid.{dim}") + nctaid = nvvmutils.call_sreg(builder, f"nctaid.{dim}") + return builder.mul(builder.sext(ntid, i64), builder.sext(nctaid, i64)) + + def codegen(context, builder, sig, args): + restype = sig.return_type + nx = _nthreads_for_dim(builder, 'x') + + if restype == types.int64: + return nx + elif isinstance(restype, types.UniTuple): + ny = _nthreads_for_dim(builder, 'y') + + if restype.count == 2: + return cgutils.pack_array(builder, (nx, ny)) + elif restype.count == 3: + nz = _nthreads_for_dim(builder, 'z') + return cgutils.pack_array(builder, (nx, ny, nz)) + + return sig, codegen + + +@intrinsic +def _warpsize(typingctx): + sig = signature(types.int32) + + def codegen(context, builder, sig, args): + return nvvmutils.call_sreg(builder, 'warpsize') + + return sig, codegen + + +@overload_attribute(types.Module(cuda), 'warpsize', target='cuda') +def cuda_warpsize(mod): + ''' + The size of a warp. All architectures implemented to date have a warp size + of 32. + ''' + def get(mod): + return _warpsize() + return get + + +#------------------------------------------------------------------------------- +# syncthreads + +@intrinsic +def syncthreads(typingctx): + ''' + Synchronize all threads in the same thread block. This function implements + the same pattern as barriers in traditional multi-threaded programming: this + function waits until all threads in the block call it, at which point it + returns control to all its callers. + ''' + sig = signature(types.none) + + def codegen(context, builder, sig, args): + fname = 'llvm.nvvm.barrier0' + lmod = builder.module + fnty = ir.FunctionType(ir.VoidType(), ()) + sync = cgutils.get_or_insert_function(lmod, fnty, fname) + builder.call(sync, ()) + return context.get_dummy_value() + + return sig, codegen + + +def _syncthreads_predicate(typingctx, predicate, fname): + if not isinstance(predicate, types.Integer): + return None + + sig = signature(types.i4, types.i4) + + def codegen(context, builder, sig, args): + fnty = ir.FunctionType(ir.IntType(32), (ir.IntType(32),)) + sync = cgutils.get_or_insert_function(builder.module, fnty, fname) + return builder.call(sync, args) + + return sig, codegen + + +@intrinsic +def syncthreads_count(typingctx, predicate): + ''' + syncthreads_count(predicate) + + An extension to numba.cuda.syncthreads where the return value is a count + of the threads where predicate is true. + ''' + fname = 'llvm.nvvm.barrier0.popc' + return _syncthreads_predicate(typingctx, predicate, fname) + + +@intrinsic +def syncthreads_and(typingctx, predicate): + ''' + syncthreads_and(predicate) + + An extension to numba.cuda.syncthreads where 1 is returned if predicate is + true for all threads or 0 otherwise. + ''' + fname = 'llvm.nvvm.barrier0.and' + return _syncthreads_predicate(typingctx, predicate, fname) + + +@intrinsic +def syncthreads_or(typingctx, predicate): + ''' + syncthreads_or(predicate) + + An extension to numba.cuda.syncthreads where 1 is returned if predicate is + true for any thread or 0 otherwise. + ''' + fname = 'llvm.nvvm.barrier0.or' + return _syncthreads_predicate(typingctx, predicate, fname) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdevice.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdevice.py new file mode 100644 index 0000000000000000000000000000000000000000..303ade74b650b6176cbd7f6590cddd5dc9c0278a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdevice.py @@ -0,0 +1,3382 @@ +def abs(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_abs.html + + :param x: Argument. + :type x: int32 + :rtype: int32 +""" + + +def acos(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_acos.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def acosf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_acosf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def acosh(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_acosh.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def acoshf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_acoshf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def asin(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_asin.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def asinf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_asinf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def asinh(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_asinh.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def asinhf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_asinhf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def atan(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_atan.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def atan2(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_atan2.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def atan2f(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_atan2f.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def atanf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_atanf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def atanh(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_atanh.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def atanhf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_atanhf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def brev(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_brev.html + + :param x: Argument. + :type x: int32 + :rtype: int32 +""" + + +def brevll(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_brevll.html + + :param x: Argument. + :type x: int64 + :rtype: int64 +""" + + +def byte_perm(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_byte_perm.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :param z: Argument. + :type z: int32 + :rtype: int32 +""" + + +def cbrt(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_cbrt.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def cbrtf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_cbrtf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def ceil(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ceil.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def ceilf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ceilf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def clz(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_clz.html + + :param x: Argument. + :type x: int32 + :rtype: int32 +""" + + +def clzll(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_clzll.html + + :param x: Argument. + :type x: int64 + :rtype: int32 +""" + + +def copysign(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_copysign.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def copysignf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_copysignf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def cos(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_cos.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def cosf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_cosf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def cosh(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_cosh.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def coshf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_coshf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def cospi(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_cospi.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def cospif(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_cospif.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def dadd_rd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dadd_rd.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def dadd_rn(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dadd_rn.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def dadd_ru(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dadd_ru.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def dadd_rz(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dadd_rz.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def ddiv_rd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ddiv_rd.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def ddiv_rn(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ddiv_rn.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def ddiv_ru(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ddiv_ru.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def ddiv_rz(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ddiv_rz.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def dmul_rd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dmul_rd.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def dmul_rn(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dmul_rn.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def dmul_ru(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dmul_ru.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def dmul_rz(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dmul_rz.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def double2float_rd(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2float_rd.html + + :param d: Argument. + :type d: float64 + :rtype: float32 +""" + + +def double2float_rn(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2float_rn.html + + :param d: Argument. + :type d: float64 + :rtype: float32 +""" + + +def double2float_ru(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2float_ru.html + + :param d: Argument. + :type d: float64 + :rtype: float32 +""" + + +def double2float_rz(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2float_rz.html + + :param d: Argument. + :type d: float64 + :rtype: float32 +""" + + +def double2hiint(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2hiint.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2int_rd(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2int_rd.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2int_rn(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2int_rn.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2int_ru(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2int_ru.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2int_rz(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2int_rz.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2ll_rd(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2ll_rd.html + + :param f: Argument. + :type f: float64 + :rtype: int64 +""" + + +def double2ll_rn(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2ll_rn.html + + :param f: Argument. + :type f: float64 + :rtype: int64 +""" + + +def double2ll_ru(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2ll_ru.html + + :param f: Argument. + :type f: float64 + :rtype: int64 +""" + + +def double2ll_rz(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2ll_rz.html + + :param f: Argument. + :type f: float64 + :rtype: int64 +""" + + +def double2loint(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2loint.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2uint_rd(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2uint_rd.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2uint_rn(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2uint_rn.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2uint_ru(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2uint_ru.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2uint_rz(d): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2uint_rz.html + + :param d: Argument. + :type d: float64 + :rtype: int32 +""" + + +def double2ull_rd(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2ull_rd.html + + :param f: Argument. + :type f: float64 + :rtype: int64 +""" + + +def double2ull_rn(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2ull_rn.html + + :param f: Argument. + :type f: float64 + :rtype: int64 +""" + + +def double2ull_ru(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2ull_ru.html + + :param f: Argument. + :type f: float64 + :rtype: int64 +""" + + +def double2ull_rz(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double2ull_rz.html + + :param f: Argument. + :type f: float64 + :rtype: int64 +""" + + +def double_as_longlong(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_double_as_longlong.html + + :param x: Argument. + :type x: float64 + :rtype: int64 +""" + + +def drcp_rd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_drcp_rd.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def drcp_rn(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_drcp_rn.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def drcp_ru(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_drcp_ru.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def drcp_rz(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_drcp_rz.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def dsqrt_rd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dsqrt_rd.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def dsqrt_rn(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dsqrt_rn.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def dsqrt_ru(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dsqrt_ru.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def dsqrt_rz(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_dsqrt_rz.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def erf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erf.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def erfc(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erfc.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def erfcf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erfcf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def erfcinv(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erfcinv.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def erfcinvf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erfcinvf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def erfcx(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erfcx.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def erfcxf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erfcxf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def erff(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erff.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def erfinv(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erfinv.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def erfinvf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_erfinvf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def exp(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_exp.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def exp10(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_exp10.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def exp10f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_exp10f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def exp2(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_exp2.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def exp2f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_exp2f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def expf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_expf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def expm1(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_expm1.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def expm1f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_expm1f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fabs(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fabs.html + + :param f: Argument. + :type f: float64 + :rtype: float64 +""" + + +def fabsf(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fabsf.html + + :param f: Argument. + :type f: float32 + :rtype: float32 +""" + + +def fadd_rd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fadd_rd.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fadd_rn(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fadd_rn.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fadd_ru(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fadd_ru.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fadd_rz(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fadd_rz.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fast_cosf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_cosf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fast_exp10f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_exp10f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fast_expf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_expf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fast_fdividef(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_fdividef.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fast_log10f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_log10f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fast_log2f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_log2f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fast_logf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_logf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fast_powf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_powf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fast_sincosf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_sincosf.html + + :param x: Argument. + :type x: float32 + :rtype: UniTuple(float32 x 2) +""" + + +def fast_sinf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_sinf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fast_tanf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fast_tanf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fdim(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fdim.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def fdimf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fdimf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fdiv_rd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fdiv_rd.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fdiv_rn(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fdiv_rn.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fdiv_ru(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fdiv_ru.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fdiv_rz(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fdiv_rz.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def ffs(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ffs.html + + :param x: Argument. + :type x: int32 + :rtype: int32 +""" + + +def ffsll(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ffsll.html + + :param x: Argument. + :type x: int64 + :rtype: int32 +""" + + +def finitef(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_finitef.html + + :param x: Argument. + :type x: float32 + :rtype: int32 +""" + + +def float2half_rn(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2half_rn.html + + :param f: Argument. + :type f: float32 + :rtype: int16 +""" + + +def float2int_rd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2int_rd.html + + :param in: Argument. + :type in: float32 + :rtype: int32 +""" + + +def float2int_rn(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2int_rn.html + + :param in: Argument. + :type in: float32 + :rtype: int32 +""" + + +def float2int_ru(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2int_ru.html + + :param in: Argument. + :type in: float32 + :rtype: int32 +""" + + +def float2int_rz(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2int_rz.html + + :param in: Argument. + :type in: float32 + :rtype: int32 +""" + + +def float2ll_rd(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2ll_rd.html + + :param f: Argument. + :type f: float32 + :rtype: int64 +""" + + +def float2ll_rn(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2ll_rn.html + + :param f: Argument. + :type f: float32 + :rtype: int64 +""" + + +def float2ll_ru(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2ll_ru.html + + :param f: Argument. + :type f: float32 + :rtype: int64 +""" + + +def float2ll_rz(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2ll_rz.html + + :param f: Argument. + :type f: float32 + :rtype: int64 +""" + + +def float2uint_rd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2uint_rd.html + + :param in: Argument. + :type in: float32 + :rtype: int32 +""" + + +def float2uint_rn(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2uint_rn.html + + :param in: Argument. + :type in: float32 + :rtype: int32 +""" + + +def float2uint_ru(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2uint_ru.html + + :param in: Argument. + :type in: float32 + :rtype: int32 +""" + + +def float2uint_rz(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2uint_rz.html + + :param in: Argument. + :type in: float32 + :rtype: int32 +""" + + +def float2ull_rd(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2ull_rd.html + + :param f: Argument. + :type f: float32 + :rtype: int64 +""" + + +def float2ull_rn(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2ull_rn.html + + :param f: Argument. + :type f: float32 + :rtype: int64 +""" + + +def float2ull_ru(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2ull_ru.html + + :param f: Argument. + :type f: float32 + :rtype: int64 +""" + + +def float2ull_rz(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float2ull_rz.html + + :param f: Argument. + :type f: float32 + :rtype: int64 +""" + + +def float_as_int(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_float_as_int.html + + :param x: Argument. + :type x: float32 + :rtype: int32 +""" + + +def floor(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_floor.html + + :param f: Argument. + :type f: float64 + :rtype: float64 +""" + + +def floorf(f): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_floorf.html + + :param f: Argument. + :type f: float32 + :rtype: float32 +""" + + +def fma(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fma.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :param z: Argument. + :type z: float64 + :rtype: float64 +""" + + +def fma_rd(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fma_rd.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :param z: Argument. + :type z: float64 + :rtype: float64 +""" + + +def fma_rn(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fma_rn.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :param z: Argument. + :type z: float64 + :rtype: float64 +""" + + +def fma_ru(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fma_ru.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :param z: Argument. + :type z: float64 + :rtype: float64 +""" + + +def fma_rz(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fma_rz.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :param z: Argument. + :type z: float64 + :rtype: float64 +""" + + +def fmaf(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmaf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :param z: Argument. + :type z: float32 + :rtype: float32 +""" + + +def fmaf_rd(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmaf_rd.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :param z: Argument. + :type z: float32 + :rtype: float32 +""" + + +def fmaf_rn(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmaf_rn.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :param z: Argument. + :type z: float32 + :rtype: float32 +""" + + +def fmaf_ru(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmaf_ru.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :param z: Argument. + :type z: float32 + :rtype: float32 +""" + + +def fmaf_rz(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmaf_rz.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :param z: Argument. + :type z: float32 + :rtype: float32 +""" + + +def fmax(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmax.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def fmaxf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmaxf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fmin(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmin.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def fminf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fminf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fmod(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmod.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def fmodf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmodf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fmul_rd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmul_rd.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fmul_rn(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmul_rn.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fmul_ru(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmul_ru.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fmul_rz(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fmul_rz.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def frcp_rd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_frcp_rd.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def frcp_rn(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_frcp_rn.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def frcp_ru(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_frcp_ru.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def frcp_rz(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_frcp_rz.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def frexp(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_frexp.html + + :param x: Argument. + :type x: float64 + :rtype: Tuple(float64, int32) +""" + + +def frexpf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_frexpf.html + + :param x: Argument. + :type x: float32 + :rtype: Tuple(float32, int32) +""" + + +def frsqrt_rn(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_frsqrt_rn.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fsqrt_rd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fsqrt_rd.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fsqrt_rn(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fsqrt_rn.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fsqrt_ru(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fsqrt_ru.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fsqrt_rz(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fsqrt_rz.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def fsub_rd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fsub_rd.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fsub_rn(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fsub_rn.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fsub_ru(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fsub_ru.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def fsub_rz(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_fsub_rz.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def hadd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_hadd.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def half2float(h): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_half2float.html + + :param h: Argument. + :type h: int16 + :rtype: float32 +""" + + +def hiloint2double(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_hiloint2double.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: float64 +""" + + +def hypot(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_hypot.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def hypotf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_hypotf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def ilogb(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ilogb.html + + :param x: Argument. + :type x: float64 + :rtype: int32 +""" + + +def ilogbf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ilogbf.html + + :param x: Argument. + :type x: float32 + :rtype: int32 +""" + + +def int2double_rn(i): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_int2double_rn.html + + :param i: Argument. + :type i: int32 + :rtype: float64 +""" + + +def int2float_rd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_int2float_rd.html + + :param in: Argument. + :type in: int32 + :rtype: float32 +""" + + +def int2float_rn(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_int2float_rn.html + + :param in: Argument. + :type in: int32 + :rtype: float32 +""" + + +def int2float_ru(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_int2float_ru.html + + :param in: Argument. + :type in: int32 + :rtype: float32 +""" + + +def int2float_rz(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_int2float_rz.html + + :param in: Argument. + :type in: int32 + :rtype: float32 +""" + + +def int_as_float(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_int_as_float.html + + :param x: Argument. + :type x: int32 + :rtype: float32 +""" + + +def isfinited(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_isfinited.html + + :param x: Argument. + :type x: float64 + :rtype: int32 +""" + + +def isinfd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_isinfd.html + + :param x: Argument. + :type x: float64 + :rtype: int32 +""" + + +def isinff(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_isinff.html + + :param x: Argument. + :type x: float32 + :rtype: int32 +""" + + +def isnand(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_isnand.html + + :param x: Argument. + :type x: float64 + :rtype: int32 +""" + + +def isnanf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_isnanf.html + + :param x: Argument. + :type x: float32 + :rtype: int32 +""" + + +def j0(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_j0.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def j0f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_j0f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def j1(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_j1.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def j1f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_j1f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def jn(n, x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_jn.html + + :param n: Argument. + :type n: int32 + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def jnf(n, x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_jnf.html + + :param n: Argument. + :type n: int32 + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def ldexp(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ldexp.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: int32 + :rtype: float64 +""" + + +def ldexpf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ldexpf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: int32 + :rtype: float32 +""" + + +def lgamma(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_lgamma.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def lgammaf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_lgammaf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def ll2double_rd(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ll2double_rd.html + + :param l: Argument. + :type l: int64 + :rtype: float64 +""" + + +def ll2double_rn(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ll2double_rn.html + + :param l: Argument. + :type l: int64 + :rtype: float64 +""" + + +def ll2double_ru(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ll2double_ru.html + + :param l: Argument. + :type l: int64 + :rtype: float64 +""" + + +def ll2double_rz(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ll2double_rz.html + + :param l: Argument. + :type l: int64 + :rtype: float64 +""" + + +def ll2float_rd(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ll2float_rd.html + + :param l: Argument. + :type l: int64 + :rtype: float32 +""" + + +def ll2float_rn(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ll2float_rn.html + + :param l: Argument. + :type l: int64 + :rtype: float32 +""" + + +def ll2float_ru(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ll2float_ru.html + + :param l: Argument. + :type l: int64 + :rtype: float32 +""" + + +def ll2float_rz(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ll2float_rz.html + + :param l: Argument. + :type l: int64 + :rtype: float32 +""" + + +def llabs(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_llabs.html + + :param x: Argument. + :type x: int64 + :rtype: int64 +""" + + +def llmax(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_llmax.html + + :param x: Argument. + :type x: int64 + :param y: Argument. + :type y: int64 + :rtype: int64 +""" + + +def llmin(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_llmin.html + + :param x: Argument. + :type x: int64 + :param y: Argument. + :type y: int64 + :rtype: int64 +""" + + +def llrint(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_llrint.html + + :param x: Argument. + :type x: float64 + :rtype: int64 +""" + + +def llrintf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_llrintf.html + + :param x: Argument. + :type x: float32 + :rtype: int64 +""" + + +def llround(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_llround.html + + :param x: Argument. + :type x: float64 + :rtype: int64 +""" + + +def llroundf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_llroundf.html + + :param x: Argument. + :type x: float32 + :rtype: int64 +""" + + +def log(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_log.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def log10(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_log10.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def log10f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_log10f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def log1p(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_log1p.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def log1pf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_log1pf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def log2(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_log2.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def log2f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_log2f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def logb(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_logb.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def logbf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_logbf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def logf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_logf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def longlong_as_double(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_longlong_as_double.html + + :param x: Argument. + :type x: int64 + :rtype: float64 +""" + + +def max(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_max.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def min(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_min.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def modf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_modf.html + + :param x: Argument. + :type x: float64 + :rtype: UniTuple(float64 x 2) +""" + + +def modff(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_modff.html + + :param x: Argument. + :type x: float32 + :rtype: UniTuple(float32 x 2) +""" + + +def mul24(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_mul24.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def mul64hi(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_mul64hi.html + + :param x: Argument. + :type x: int64 + :param y: Argument. + :type y: int64 + :rtype: int64 +""" + + +def mulhi(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_mulhi.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def nearbyint(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_nearbyint.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def nearbyintf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_nearbyintf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def nextafter(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_nextafter.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def nextafterf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_nextafterf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def normcdf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_normcdf.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def normcdff(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_normcdff.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def normcdfinv(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_normcdfinv.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def normcdfinvf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_normcdfinvf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def popc(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_popc.html + + :param x: Argument. + :type x: int32 + :rtype: int32 +""" + + +def popcll(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_popcll.html + + :param x: Argument. + :type x: int64 + :rtype: int32 +""" + + +def pow(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_pow.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def powf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_powf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def powi(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_powi.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: int32 + :rtype: float64 +""" + + +def powif(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_powif.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: int32 + :rtype: float32 +""" + + +def rcbrt(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_rcbrt.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def rcbrtf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_rcbrtf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def remainder(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_remainder.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: float64 +""" + + +def remainderf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_remainderf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: float32 +""" + + +def remquo(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_remquo.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: float64 + :rtype: Tuple(float64, int32) +""" + + +def remquof(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_remquof.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: float32 + :rtype: Tuple(float32, int32) +""" + + +def rhadd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_rhadd.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def rint(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_rint.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def rintf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_rintf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def round(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_round.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def roundf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_roundf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def rsqrt(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_rsqrt.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def rsqrtf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_rsqrtf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def sad(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sad.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :param z: Argument. + :type z: int32 + :rtype: int32 +""" + + +def saturatef(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_saturatef.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def scalbn(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_scalbn.html + + :param x: Argument. + :type x: float64 + :param y: Argument. + :type y: int32 + :rtype: float64 +""" + + +def scalbnf(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_scalbnf.html + + :param x: Argument. + :type x: float32 + :param y: Argument. + :type y: int32 + :rtype: float32 +""" + + +def signbitd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_signbitd.html + + :param x: Argument. + :type x: float64 + :rtype: int32 +""" + + +def signbitf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_signbitf.html + + :param x: Argument. + :type x: float32 + :rtype: int32 +""" + + +def sin(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sin.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def sincos(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sincos.html + + :param x: Argument. + :type x: float64 + :rtype: UniTuple(float64 x 2) +""" + + +def sincosf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sincosf.html + + :param x: Argument. + :type x: float32 + :rtype: UniTuple(float32 x 2) +""" + + +def sincospi(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sincospi.html + + :param x: Argument. + :type x: float64 + :rtype: UniTuple(float64 x 2) +""" + + +def sincospif(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sincospif.html + + :param x: Argument. + :type x: float32 + :rtype: UniTuple(float32 x 2) +""" + + +def sinf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sinf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def sinh(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sinh.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def sinhf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sinhf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def sinpi(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sinpi.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def sinpif(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sinpif.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def sqrt(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sqrt.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def sqrtf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_sqrtf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def tan(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_tan.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def tanf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_tanf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def tanh(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_tanh.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def tanhf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_tanhf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def tgamma(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_tgamma.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def tgammaf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_tgammaf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def trunc(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_trunc.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def truncf(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_truncf.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def uhadd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_uhadd.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def uint2double_rn(i): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_uint2double_rn.html + + :param i: Argument. + :type i: int32 + :rtype: float64 +""" + + +def uint2float_rd(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_uint2float_rd.html + + :param in: Argument. + :type in: int32 + :rtype: float32 +""" + + +def uint2float_rn(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_uint2float_rn.html + + :param in: Argument. + :type in: int32 + :rtype: float32 +""" + + +def uint2float_ru(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_uint2float_ru.html + + :param in: Argument. + :type in: int32 + :rtype: float32 +""" + + +def uint2float_rz(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_uint2float_rz.html + + :param in: Argument. + :type in: int32 + :rtype: float32 +""" + + +def ull2double_rd(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ull2double_rd.html + + :param l: Argument. + :type l: int64 + :rtype: float64 +""" + + +def ull2double_rn(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ull2double_rn.html + + :param l: Argument. + :type l: int64 + :rtype: float64 +""" + + +def ull2double_ru(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ull2double_ru.html + + :param l: Argument. + :type l: int64 + :rtype: float64 +""" + + +def ull2double_rz(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ull2double_rz.html + + :param l: Argument. + :type l: int64 + :rtype: float64 +""" + + +def ull2float_rd(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ull2float_rd.html + + :param l: Argument. + :type l: int64 + :rtype: float32 +""" + + +def ull2float_rn(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ull2float_rn.html + + :param l: Argument. + :type l: int64 + :rtype: float32 +""" + + +def ull2float_ru(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ull2float_ru.html + + :param l: Argument. + :type l: int64 + :rtype: float32 +""" + + +def ull2float_rz(l): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ull2float_rz.html + + :param l: Argument. + :type l: int64 + :rtype: float32 +""" + + +def ullmax(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ullmax.html + + :param x: Argument. + :type x: int64 + :param y: Argument. + :type y: int64 + :rtype: int64 +""" + + +def ullmin(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ullmin.html + + :param x: Argument. + :type x: int64 + :param y: Argument. + :type y: int64 + :rtype: int64 +""" + + +def umax(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_umax.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def umin(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_umin.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def umul24(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_umul24.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def umul64hi(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_umul64hi.html + + :param x: Argument. + :type x: int64 + :param y: Argument. + :type y: int64 + :rtype: int64 +""" + + +def umulhi(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_umulhi.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def urhadd(x, y): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_urhadd.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :rtype: int32 +""" + + +def usad(x, y, z): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_usad.html + + :param x: Argument. + :type x: int32 + :param y: Argument. + :type y: int32 + :param z: Argument. + :type z: int32 + :rtype: int32 +""" + + +def y0(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_y0.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def y0f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_y0f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def y1(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_y1.html + + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def y1f(x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_y1f.html + + :param x: Argument. + :type x: float32 + :rtype: float32 +""" + + +def yn(n, x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_yn.html + + :param n: Argument. + :type n: int32 + :param x: Argument. + :type x: float64 + :rtype: float64 +""" + + +def ynf(n, x): + """ + See https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_ynf.html + + :param n: Argument. + :type n: int32 + :param x: Argument. + :type x: float32 + :rtype: float32 +""" diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdevicedecl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdevicedecl.py new file mode 100644 index 0000000000000000000000000000000000000000..e82646dca585232ec86496875d5dc3e00a940ccc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdevicedecl.py @@ -0,0 +1,17 @@ +from numba.cuda import libdevice, libdevicefuncs +from numba.core.typing.templates import ConcreteTemplate, Registry + +registry = Registry() +register_global = registry.register_global + + +def libdevice_declare(func, retty, args): + class Libdevice_function(ConcreteTemplate): + cases = [libdevicefuncs.create_signature(retty, args)] + + pyfunc = getattr(libdevice, func[5:]) + register_global(pyfunc)(Libdevice_function) + + +for func, (retty, args) in libdevicefuncs.functions.items(): + libdevice_declare(func, retty, args) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdevicefuncs.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdevicefuncs.py new file mode 100644 index 0000000000000000000000000000000000000000..ba3bb5accaa55cb96bb369350eaf80bf356ddd89 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdevicefuncs.py @@ -0,0 +1,1057 @@ +from collections import namedtuple +from textwrap import indent + +from numba.types import float32, float64, int16, int32, int64, void, Tuple +from numba.core.typing.templates import signature + +arg = namedtuple("arg", ("name", "ty", "is_ptr")) + +functions = { + "__nv_abs": (int32, [arg(name="x", ty=int32, is_ptr=False)]), + "__nv_acos": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_acosf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_acosh": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_acoshf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_asin": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_asinf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_asinh": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_asinhf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_atan": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_atan2": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_atan2f": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_atanf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_atanh": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_atanhf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_brev": (int32, [arg(name="x", ty=int32, is_ptr=False)]), + "__nv_brevll": (int64, [arg(name="x", ty=int64, is_ptr=False)]), + "__nv_byte_perm": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + arg(name="z", ty=int32, is_ptr=False), + ], + ), + "__nv_cbrt": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_cbrtf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_ceil": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_ceilf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_clz": (int32, [arg(name="x", ty=int32, is_ptr=False)]), + "__nv_clzll": (int32, [arg(name="x", ty=int64, is_ptr=False)]), + "__nv_copysign": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_copysignf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_cos": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_cosf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_cosh": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_coshf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_cospi": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_cospif": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_dadd_rd": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_dadd_rn": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_dadd_ru": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_dadd_rz": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_ddiv_rd": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_ddiv_rn": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_ddiv_ru": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_ddiv_rz": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_dmul_rd": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_dmul_rn": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_dmul_ru": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_dmul_rz": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_double2float_rd": ( + float32, + [arg(name="d", ty=float64, is_ptr=False)], + ), + "__nv_double2float_rn": ( + float32, + [arg(name="d", ty=float64, is_ptr=False)], + ), + "__nv_double2float_ru": ( + float32, + [arg(name="d", ty=float64, is_ptr=False)], + ), + "__nv_double2float_rz": ( + float32, + [arg(name="d", ty=float64, is_ptr=False)], + ), + "__nv_double2hiint": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2int_rd": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2int_rn": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2int_ru": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2int_rz": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2ll_rd": (int64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_double2ll_rn": (int64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_double2ll_ru": (int64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_double2ll_rz": (int64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_double2loint": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2uint_rd": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2uint_rn": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2uint_ru": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2uint_rz": (int32, [arg(name="d", ty=float64, is_ptr=False)]), + "__nv_double2ull_rd": (int64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_double2ull_rn": (int64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_double2ull_ru": (int64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_double2ull_rz": (int64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_double_as_longlong": ( + int64, + [arg(name="x", ty=float64, is_ptr=False)], + ), + "__nv_drcp_rd": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_drcp_rn": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_drcp_ru": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_drcp_rz": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_dsqrt_rd": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_dsqrt_rn": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_dsqrt_ru": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_dsqrt_rz": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_erf": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_erfc": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_erfcf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_erfcinv": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_erfcinvf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_erfcx": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_erfcxf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_erff": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_erfinv": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_erfinvf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_exp": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_exp10": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_exp10f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_exp2": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_exp2f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_expf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_expm1": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_expm1f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fabs": (float64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_fabsf": (float32, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_fadd_rd": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fadd_rn": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fadd_ru": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fadd_rz": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fast_cosf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fast_exp10f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fast_expf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fast_fdividef": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fast_log10f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fast_log2f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fast_logf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fast_powf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fast_sincosf": ( + void, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="sptr", ty=float32, is_ptr=True), + arg(name="cptr", ty=float32, is_ptr=True), + ], + ), + "__nv_fast_sinf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fast_tanf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fdim": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_fdimf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fdiv_rd": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fdiv_rn": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fdiv_ru": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fdiv_rz": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_ffs": (int32, [arg(name="x", ty=int32, is_ptr=False)]), + "__nv_ffsll": (int32, [arg(name="x", ty=int64, is_ptr=False)]), + "__nv_finitef": (int32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_float2half_rn": (int16, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_float2int_rd": (int32, [arg(name="in", ty=float32, is_ptr=False)]), + "__nv_float2int_rn": (int32, [arg(name="in", ty=float32, is_ptr=False)]), + "__nv_float2int_ru": (int32, [arg(name="in", ty=float32, is_ptr=False)]), + "__nv_float2int_rz": (int32, [arg(name="in", ty=float32, is_ptr=False)]), + "__nv_float2ll_rd": (int64, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_float2ll_rn": (int64, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_float2ll_ru": (int64, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_float2ll_rz": (int64, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_float2uint_rd": (int32, [arg(name="in", ty=float32, is_ptr=False)]), + "__nv_float2uint_rn": (int32, [arg(name="in", ty=float32, is_ptr=False)]), + "__nv_float2uint_ru": (int32, [arg(name="in", ty=float32, is_ptr=False)]), + "__nv_float2uint_rz": (int32, [arg(name="in", ty=float32, is_ptr=False)]), + "__nv_float2ull_rd": (int64, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_float2ull_rn": (int64, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_float2ull_ru": (int64, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_float2ull_rz": (int64, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_float_as_int": (int32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_floor": (float64, [arg(name="f", ty=float64, is_ptr=False)]), + "__nv_floorf": (float32, [arg(name="f", ty=float32, is_ptr=False)]), + "__nv_fma": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + arg(name="z", ty=float64, is_ptr=False), + ], + ), + "__nv_fma_rd": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + arg(name="z", ty=float64, is_ptr=False), + ], + ), + "__nv_fma_rn": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + arg(name="z", ty=float64, is_ptr=False), + ], + ), + "__nv_fma_ru": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + arg(name="z", ty=float64, is_ptr=False), + ], + ), + "__nv_fma_rz": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + arg(name="z", ty=float64, is_ptr=False), + ], + ), + "__nv_fmaf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + arg(name="z", ty=float32, is_ptr=False), + ], + ), + "__nv_fmaf_rd": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + arg(name="z", ty=float32, is_ptr=False), + ], + ), + "__nv_fmaf_rn": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + arg(name="z", ty=float32, is_ptr=False), + ], + ), + "__nv_fmaf_ru": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + arg(name="z", ty=float32, is_ptr=False), + ], + ), + "__nv_fmaf_rz": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + arg(name="z", ty=float32, is_ptr=False), + ], + ), + "__nv_fmax": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_fmaxf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fmin": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_fminf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fmod": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_fmodf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fmul_rd": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fmul_rn": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fmul_ru": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fmul_rz": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_frcp_rd": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_frcp_rn": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_frcp_ru": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_frcp_rz": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_frexp": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="b", ty=int32, is_ptr=True), + ], + ), + "__nv_frexpf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="b", ty=int32, is_ptr=True), + ], + ), + "__nv_frsqrt_rn": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fsqrt_rd": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fsqrt_rn": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fsqrt_ru": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fsqrt_rz": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_fsub_rd": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fsub_rn": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fsub_ru": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_fsub_rz": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_hadd": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_half2float": (float32, [arg(name="h", ty=int16, is_ptr=False)]), + "__nv_hiloint2double": ( + float64, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_hypot": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_hypotf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_ilogb": (int32, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_ilogbf": (int32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_int2double_rn": (float64, [arg(name="i", ty=int32, is_ptr=False)]), + "__nv_int2float_rd": (float32, [arg(name="in", ty=int32, is_ptr=False)]), + "__nv_int2float_rn": (float32, [arg(name="in", ty=int32, is_ptr=False)]), + "__nv_int2float_ru": (float32, [arg(name="in", ty=int32, is_ptr=False)]), + "__nv_int2float_rz": (float32, [arg(name="in", ty=int32, is_ptr=False)]), + "__nv_int_as_float": (float32, [arg(name="x", ty=int32, is_ptr=False)]), + "__nv_isfinited": (int32, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_isinfd": (int32, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_isinff": (int32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_isnand": (int32, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_isnanf": (int32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_j0": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_j0f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_j1": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_j1f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_jn": ( + float64, + [ + arg(name="n", ty=int32, is_ptr=False), + arg(name="x", ty=float64, is_ptr=False), + ], + ), + "__nv_jnf": ( + float32, + [ + arg(name="n", ty=int32, is_ptr=False), + arg(name="x", ty=float32, is_ptr=False), + ], + ), + "__nv_ldexp": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_ldexpf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_lgamma": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_lgammaf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_ll2double_rd": (float64, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ll2double_rn": (float64, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ll2double_ru": (float64, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ll2double_rz": (float64, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ll2float_rd": (float32, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ll2float_rn": (float32, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ll2float_ru": (float32, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ll2float_rz": (float32, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_llabs": (int64, [arg(name="x", ty=int64, is_ptr=False)]), + "__nv_llmax": ( + int64, + [ + arg(name="x", ty=int64, is_ptr=False), + arg(name="y", ty=int64, is_ptr=False), + ], + ), + "__nv_llmin": ( + int64, + [ + arg(name="x", ty=int64, is_ptr=False), + arg(name="y", ty=int64, is_ptr=False), + ], + ), + "__nv_llrint": (int64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_llrintf": (int64, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_llround": (int64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_llroundf": (int64, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_log": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_log10": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_log10f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_log1p": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_log1pf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_log2": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_log2f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_logb": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_logbf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_logf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_longlong_as_double": ( + float64, + [arg(name="x", ty=int64, is_ptr=False)], + ), + "__nv_max": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_min": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_modf": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="b", ty=float64, is_ptr=True), + ], + ), + "__nv_modff": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="b", ty=float32, is_ptr=True), + ], + ), + "__nv_mul24": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_mul64hi": ( + int64, + [ + arg(name="x", ty=int64, is_ptr=False), + arg(name="y", ty=int64, is_ptr=False), + ], + ), + "__nv_mulhi": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + # __nv_nan and __nv_nanf are excluded - they return a representation of a + # quiet NaN, but the argument they take seems to be undocumented, and + # follows a strange form - it is not an output like every other pointer + # argument. If a NaN is required, one can be obtained in CUDA Python by + # other means, e.g. `math.nan`. They are left in this list for completeness + # / reference. + # "__nv_nan": (float64, [arg(name="tagp", ty=int8, is_ptr=True)]), + # "__nv_nanf": (float32, [arg(name="tagp", ty=int8, is_ptr=True)]), + "__nv_nearbyint": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_nearbyintf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_nextafter": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_nextafterf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_normcdf": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_normcdff": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_normcdfinv": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_normcdfinvf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_popc": (int32, [arg(name="x", ty=int32, is_ptr=False)]), + "__nv_popcll": (int32, [arg(name="x", ty=int64, is_ptr=False)]), + "__nv_pow": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_powf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_powi": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_powif": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_rcbrt": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_rcbrtf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_remainder": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + ], + ), + "__nv_remainderf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + ], + ), + "__nv_remquo": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=float64, is_ptr=False), + arg(name="c", ty=int32, is_ptr=True), + ], + ), + "__nv_remquof": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=float32, is_ptr=False), + arg(name="quo", ty=int32, is_ptr=True), + ], + ), + "__nv_rhadd": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_rint": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_rintf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_round": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_roundf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_rsqrt": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_rsqrtf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_sad": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + arg(name="z", ty=int32, is_ptr=False), + ], + ), + "__nv_saturatef": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_scalbn": ( + float64, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_scalbnf": ( + float32, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_signbitd": (int32, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_signbitf": (int32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_sin": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_sincos": ( + void, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="sptr", ty=float64, is_ptr=True), + arg(name="cptr", ty=float64, is_ptr=True), + ], + ), + "__nv_sincosf": ( + void, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="sptr", ty=float32, is_ptr=True), + arg(name="cptr", ty=float32, is_ptr=True), + ], + ), + "__nv_sincospi": ( + void, + [ + arg(name="x", ty=float64, is_ptr=False), + arg(name="sptr", ty=float64, is_ptr=True), + arg(name="cptr", ty=float64, is_ptr=True), + ], + ), + "__nv_sincospif": ( + void, + [ + arg(name="x", ty=float32, is_ptr=False), + arg(name="sptr", ty=float32, is_ptr=True), + arg(name="cptr", ty=float32, is_ptr=True), + ], + ), + "__nv_sinf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_sinh": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_sinhf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_sinpi": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_sinpif": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_sqrt": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_sqrtf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_tan": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_tanf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_tanh": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_tanhf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_tgamma": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_tgammaf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_trunc": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_truncf": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_uhadd": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_uint2double_rn": (float64, [arg(name="i", ty=int32, is_ptr=False)]), + "__nv_uint2float_rd": (float32, [arg(name="in", ty=int32, is_ptr=False)]), + "__nv_uint2float_rn": (float32, [arg(name="in", ty=int32, is_ptr=False)]), + "__nv_uint2float_ru": (float32, [arg(name="in", ty=int32, is_ptr=False)]), + "__nv_uint2float_rz": (float32, [arg(name="in", ty=int32, is_ptr=False)]), + "__nv_ull2double_rd": (float64, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ull2double_rn": (float64, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ull2double_ru": (float64, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ull2double_rz": (float64, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ull2float_rd": (float32, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ull2float_rn": (float32, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ull2float_ru": (float32, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ull2float_rz": (float32, [arg(name="l", ty=int64, is_ptr=False)]), + "__nv_ullmax": ( + int64, + [ + arg(name="x", ty=int64, is_ptr=False), + arg(name="y", ty=int64, is_ptr=False), + ], + ), + "__nv_ullmin": ( + int64, + [ + arg(name="x", ty=int64, is_ptr=False), + arg(name="y", ty=int64, is_ptr=False), + ], + ), + "__nv_umax": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_umin": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_umul24": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_umul64hi": ( + int64, + [ + arg(name="x", ty=int64, is_ptr=False), + arg(name="y", ty=int64, is_ptr=False), + ], + ), + "__nv_umulhi": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_urhadd": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + ], + ), + "__nv_usad": ( + int32, + [ + arg(name="x", ty=int32, is_ptr=False), + arg(name="y", ty=int32, is_ptr=False), + arg(name="z", ty=int32, is_ptr=False), + ], + ), + "__nv_y0": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_y0f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_y1": (float64, [arg(name="x", ty=float64, is_ptr=False)]), + "__nv_y1f": (float32, [arg(name="x", ty=float32, is_ptr=False)]), + "__nv_yn": ( + float64, + [ + arg(name="n", ty=int32, is_ptr=False), + arg(name="x", ty=float64, is_ptr=False), + ], + ), + "__nv_ynf": ( + float32, + [ + arg(name="n", ty=int32, is_ptr=False), + arg(name="x", ty=float32, is_ptr=False), + ], + ), +} + + +def create_signature(retty, args): + """ + Given the return type and arguments for a libdevice function, return the + signature of the stub function used to call it from CUDA Python. + """ + + # Any pointer arguments should be part of the return type. + return_types = [arg.ty for arg in args if arg.is_ptr] + # If the return type is void, there is no point adding it to the list of + # return types. + if retty != void: + return_types.insert(0, retty) + + if len(return_types) > 1: + retty = Tuple(return_types) + else: + retty = return_types[0] + + argtypes = [arg.ty for arg in args if not arg.is_ptr] + + return signature(retty, *argtypes) + + +# The following code generates the stubs for libdevice functions. +# +# Stubs can be regenerated (e.g. if the functions dict above is modified) with: +# +# python -c "from numba.cuda.libdevicefuncs import generate_stubs; \ +# generate_stubs()" > numba/cuda/libdevice.py + +docstring_template = """ +See https://docs.nvidia.com/cuda/libdevice-users-guide/{func}.html + +{param_types} +:rtype: {retty} +""" + +param_template = """\ +:param {a.name}: Argument. +:type {a.name}: {a.ty}""" + + +def generate_stubs(): + for name, (retty, args) in functions.items(): + # Some libdevice functions have arguments called `in`, which causes a + # syntax error in Python, so we rename these to `x`. + def argname(arg): + if arg.name == "in": + return "x" + else: + return arg.name + + argnames = [argname(a) for a in args if not a.is_ptr] + argstr = ", ".join(argnames) + signature = create_signature(retty, args) + + param_types = "\n".join( + [param_template.format(a=a) for a in args if not a.is_ptr] + ) + docstring = docstring_template.format( + param_types=param_types, retty=signature.return_type, func=name + ) + docstring = indent(docstring, " ") + print(f'def {name[5:]}({argstr}):\n """{docstring}"""\n\n') diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdeviceimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdeviceimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..4bb2e905e033d02cb74d1f83d9749387ce58954d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/libdeviceimpl.py @@ -0,0 +1,83 @@ +from llvmlite import ir +from numba.core import cgutils, types +from numba.core.imputils import Registry +from numba.cuda import libdevice, libdevicefuncs + +registry = Registry() +lower = registry.lower + + +def libdevice_implement(func, retty, nbargs): + def core(context, builder, sig, args): + lmod = builder.module + fretty = context.get_value_type(retty) + fargtys = [context.get_value_type(arg.ty) for arg in nbargs] + fnty = ir.FunctionType(fretty, fargtys) + fn = cgutils.get_or_insert_function(lmod, fnty, func) + return builder.call(fn, args) + + key = getattr(libdevice, func[5:]) + + argtys = [arg.ty for arg in args if not arg.is_ptr] + lower(key, *argtys)(core) + + +def libdevice_implement_multiple_returns(func, retty, prototype_args): + sig = libdevicefuncs.create_signature(retty, prototype_args) + nb_retty = sig.return_type + + def core(context, builder, sig, args): + lmod = builder.module + + fargtys = [] + for arg in prototype_args: + ty = context.get_value_type(arg.ty) + if arg.is_ptr: + ty = ty.as_pointer() + fargtys.append(ty) + + fretty = context.get_value_type(retty) + + fnty = ir.FunctionType(fretty, fargtys) + fn = cgutils.get_or_insert_function(lmod, fnty, func) + + # For returned values that are returned through a pointer, we need to + # allocate variables on the stack and pass a pointer to them. + actual_args = [] + virtual_args = [] + arg_idx = 0 + for arg in prototype_args: + if arg.is_ptr: + # Allocate space for return value and add to args + tmp_arg = cgutils.alloca_once(builder, + context.get_value_type(arg.ty)) + actual_args.append(tmp_arg) + virtual_args.append(tmp_arg) + else: + actual_args.append(args[arg_idx]) + arg_idx += 1 + + ret = builder.call(fn, actual_args) + + # Following the call, we need to assemble the returned values into a + # tuple for returning back to the caller. + tuple_args = [] + if retty != types.void: + tuple_args.append(ret) + for arg in virtual_args: + tuple_args.append(builder.load(arg)) + + if isinstance(nb_retty, types.UniTuple): + return cgutils.pack_array(builder, tuple_args) + else: + return cgutils.pack_struct(builder, tuple_args) + + key = getattr(libdevice, func[5:]) + lower(key, *sig.args)(core) + + +for func, (retty, args) in libdevicefuncs.functions.items(): + if any([arg.is_ptr for arg in args]): + libdevice_implement_multiple_returns(func, retty, args) + else: + libdevice_implement(func, retty, args) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/mathimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/mathimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..c22deb56470e553407c07d3820af0f31a584823b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/mathimpl.py @@ -0,0 +1,448 @@ +import math +import operator +from llvmlite import ir +from numba.core import types, typing, cgutils, targetconfig +from numba.core.imputils import Registry +from numba.types import float32, float64, int64, uint64 +from numba.cuda import libdevice +from numba import cuda + +registry = Registry() +lower = registry.lower + + +booleans = [] +booleans += [('isnand', 'isnanf', math.isnan)] +booleans += [('isinfd', 'isinff', math.isinf)] +booleans += [('isfinited', 'finitef', math.isfinite)] + +unarys = [] +unarys += [('ceil', 'ceilf', math.ceil)] +unarys += [('floor', 'floorf', math.floor)] +unarys += [('fabs', 'fabsf', math.fabs)] +unarys += [('exp', 'expf', math.exp)] +unarys += [('expm1', 'expm1f', math.expm1)] +unarys += [('erf', 'erff', math.erf)] +unarys += [('erfc', 'erfcf', math.erfc)] +unarys += [('tgamma', 'tgammaf', math.gamma)] +unarys += [('lgamma', 'lgammaf', math.lgamma)] +unarys += [('sqrt', 'sqrtf', math.sqrt)] +unarys += [('log', 'logf', math.log)] +unarys += [('log2', 'log2f', math.log2)] +unarys += [('log10', 'log10f', math.log10)] +unarys += [('log1p', 'log1pf', math.log1p)] +unarys += [('acosh', 'acoshf', math.acosh)] +unarys += [('acos', 'acosf', math.acos)] +unarys += [('cos', 'cosf', math.cos)] +unarys += [('cosh', 'coshf', math.cosh)] +unarys += [('asinh', 'asinhf', math.asinh)] +unarys += [('asin', 'asinf', math.asin)] +unarys += [('sin', 'sinf', math.sin)] +unarys += [('sinh', 'sinhf', math.sinh)] +unarys += [('atan', 'atanf', math.atan)] +unarys += [('atanh', 'atanhf', math.atanh)] +unarys += [('tan', 'tanf', math.tan)] +unarys += [('trunc', 'truncf', math.trunc)] + +unarys_fastmath = {} +unarys_fastmath['cosf'] = 'fast_cosf' +unarys_fastmath['sinf'] = 'fast_sinf' +unarys_fastmath['tanf'] = 'fast_tanf' +unarys_fastmath['expf'] = 'fast_expf' +unarys_fastmath['log2f'] = 'fast_log2f' +unarys_fastmath['log10f'] = 'fast_log10f' +unarys_fastmath['logf'] = 'fast_logf' + +binarys = [] +binarys += [('copysign', 'copysignf', math.copysign)] +binarys += [('atan2', 'atan2f', math.atan2)] +binarys += [('pow', 'powf', math.pow)] +binarys += [('fmod', 'fmodf', math.fmod)] +binarys += [('hypot', 'hypotf', math.hypot)] +binarys += [('remainder', 'remainderf', math.remainder)] + +binarys_fastmath = {} +binarys_fastmath['powf'] = 'fast_powf' + + +@lower(math.isinf, types.Integer) +@lower(math.isnan, types.Integer) +def math_isinf_isnan_int(context, builder, sig, args): + return context.get_constant(types.boolean, 0) + + +@lower(operator.truediv, types.float32, types.float32) +def maybe_fast_truediv(context, builder, sig, args): + if context.fastmath: + sig = typing.signature(float32, float32, float32) + impl = context.get_function(libdevice.fast_fdividef, sig) + return impl(builder, args) + else: + with cgutils.if_zero(builder, args[1]): + context.error_model.fp_zero_division(builder, ("division by zero",)) + res = builder.fdiv(*args) + return res + + +@lower(math.isfinite, types.Integer) +def math_isfinite_int(context, builder, sig, args): + return context.get_constant(types.boolean, 1) + + +@lower(math.sin, types.float16) +def fp16_sin_impl(context, builder, sig, args): + def fp16_sin(x): + return cuda.fp16.hsin(x) + + return context.compile_internal(builder, fp16_sin, sig, args) + + +@lower(math.cos, types.float16) +def fp16_cos_impl(context, builder, sig, args): + def fp16_cos(x): + return cuda.fp16.hcos(x) + + return context.compile_internal(builder, fp16_cos, sig, args) + + +@lower(math.log, types.float16) +def fp16_log_impl(context, builder, sig, args): + def fp16_log(x): + return cuda.fp16.hlog(x) + + return context.compile_internal(builder, fp16_log, sig, args) + + +@lower(math.log10, types.float16) +def fp16_log10_impl(context, builder, sig, args): + def fp16_log10(x): + return cuda.fp16.hlog10(x) + + return context.compile_internal(builder, fp16_log10, sig, args) + + +@lower(math.log2, types.float16) +def fp16_log2_impl(context, builder, sig, args): + def fp16_log2(x): + return cuda.fp16.hlog2(x) + + return context.compile_internal(builder, fp16_log2, sig, args) + + +@lower(math.exp, types.float16) +def fp16_exp_impl(context, builder, sig, args): + def fp16_exp(x): + return cuda.fp16.hexp(x) + + return context.compile_internal(builder, fp16_exp, sig, args) + + +@lower(math.floor, types.float16) +def fp16_floor_impl(context, builder, sig, args): + def fp16_floor(x): + return cuda.fp16.hfloor(x) + + return context.compile_internal(builder, fp16_floor, sig, args) + + +@lower(math.ceil, types.float16) +def fp16_ceil_impl(context, builder, sig, args): + def fp16_ceil(x): + return cuda.fp16.hceil(x) + + return context.compile_internal(builder, fp16_ceil, sig, args) + + +@lower(math.sqrt, types.float16) +def fp16_sqrt_impl(context, builder, sig, args): + def fp16_sqrt(x): + return cuda.fp16.hsqrt(x) + + return context.compile_internal(builder, fp16_sqrt, sig, args) + + +@lower(math.fabs, types.float16) +def fp16_fabs_impl(context, builder, sig, args): + def fp16_fabs(x): + return cuda.fp16.habs(x) + + return context.compile_internal(builder, fp16_fabs, sig, args) + + +@lower(math.trunc, types.float16) +def fp16_trunc_impl(context, builder, sig, args): + def fp16_trunc(x): + return cuda.fp16.htrunc(x) + + return context.compile_internal(builder, fp16_trunc, sig, args) + + +def impl_boolean(key, ty, libfunc): + def lower_boolean_impl(context, builder, sig, args): + libfunc_impl = context.get_function(libfunc, + typing.signature(types.int32, ty)) + result = libfunc_impl(builder, args) + return context.cast(builder, result, types.int32, types.boolean) + + lower(key, ty)(lower_boolean_impl) + + +def get_lower_unary_impl(key, ty, libfunc): + def lower_unary_impl(context, builder, sig, args): + actual_libfunc = libfunc + fast_replacement = None + if ty == float32 and context.fastmath: + fast_replacement = unarys_fastmath.get(libfunc.__name__) + + if fast_replacement is not None: + actual_libfunc = getattr(libdevice, fast_replacement) + + libfunc_impl = context.get_function(actual_libfunc, + typing.signature(ty, ty)) + return libfunc_impl(builder, args) + return lower_unary_impl + + +def get_unary_impl_for_fn_and_ty(fn, ty): + # tanh is a special case - because it is not registered like the other + # unary implementations, it does not appear in the unarys list. However, + # its implementation can be looked up by key like the other + # implementations, so we add it to the list we search here. + tanh_impls = ('tanh', 'tanhf', math.tanh) + for fname64, fname32, key in unarys + [tanh_impls]: + if fn == key: + if ty == float32: + impl = getattr(libdevice, fname32) + elif ty == float64: + impl = getattr(libdevice, fname64) + + return get_lower_unary_impl(key, ty, impl) + + raise RuntimeError(f"Implementation of {fn} for {ty} not found") + + +def impl_unary(key, ty, libfunc): + lower_unary_impl = get_lower_unary_impl(key, ty, libfunc) + lower(key, ty)(lower_unary_impl) + + +def impl_unary_int(key, ty, libfunc): + def lower_unary_int_impl(context, builder, sig, args): + if sig.args[0] == int64: + convert = builder.sitofp + elif sig.args[0] == uint64: + convert = builder.uitofp + else: + m = 'Only 64-bit integers are supported for generic unary int ops' + raise TypeError(m) + + arg = convert(args[0], ir.DoubleType()) + sig = typing.signature(float64, float64) + libfunc_impl = context.get_function(libfunc, sig) + return libfunc_impl(builder, [arg]) + + lower(key, ty)(lower_unary_int_impl) + + +def get_lower_binary_impl(key, ty, libfunc): + def lower_binary_impl(context, builder, sig, args): + actual_libfunc = libfunc + fast_replacement = None + if ty == float32 and context.fastmath: + fast_replacement = binarys_fastmath.get(libfunc.__name__) + + if fast_replacement is not None: + actual_libfunc = getattr(libdevice, fast_replacement) + + libfunc_impl = context.get_function(actual_libfunc, + typing.signature(ty, ty, ty)) + return libfunc_impl(builder, args) + return lower_binary_impl + + +def get_binary_impl_for_fn_and_ty(fn, ty): + for fname64, fname32, key in binarys: + if fn == key: + if ty == float32: + impl = getattr(libdevice, fname32) + elif ty == float64: + impl = getattr(libdevice, fname64) + + return get_lower_binary_impl(key, ty, impl) + + raise RuntimeError(f"Implementation of {fn} for {ty} not found") + + +def impl_binary(key, ty, libfunc): + lower_binary_impl = get_lower_binary_impl(key, ty, libfunc) + lower(key, ty, ty)(lower_binary_impl) + + +def impl_binary_int(key, ty, libfunc): + def lower_binary_int_impl(context, builder, sig, args): + if sig.args[0] == int64: + convert = builder.sitofp + elif sig.args[0] == uint64: + convert = builder.uitofp + else: + m = 'Only 64-bit integers are supported for generic binary int ops' + raise TypeError(m) + + args = [convert(arg, ir.DoubleType()) for arg in args] + sig = typing.signature(float64, float64, float64) + libfunc_impl = context.get_function(libfunc, sig) + return libfunc_impl(builder, args) + + lower(key, ty, ty)(lower_binary_int_impl) + + +for fname64, fname32, key in booleans: + impl32 = getattr(libdevice, fname32) + impl64 = getattr(libdevice, fname64) + impl_boolean(key, float32, impl32) + impl_boolean(key, float64, impl64) + + +for fname64, fname32, key in unarys: + impl32 = getattr(libdevice, fname32) + impl64 = getattr(libdevice, fname64) + impl_unary(key, float32, impl32) + impl_unary(key, float64, impl64) + impl_unary_int(key, int64, impl64) + impl_unary_int(key, uint64, impl64) + + +for fname64, fname32, key in binarys: + impl32 = getattr(libdevice, fname32) + impl64 = getattr(libdevice, fname64) + impl_binary(key, float32, impl32) + impl_binary(key, float64, impl64) + impl_binary_int(key, int64, impl64) + impl_binary_int(key, uint64, impl64) + + +def impl_pow_int(ty, libfunc): + def lower_pow_impl_int(context, builder, sig, args): + powi_sig = typing.signature(ty, ty, types.int32) + libfunc_impl = context.get_function(libfunc, powi_sig) + return libfunc_impl(builder, args) + + lower(math.pow, ty, types.int32)(lower_pow_impl_int) + + +impl_pow_int(types.float32, libdevice.powif) +impl_pow_int(types.float64, libdevice.powi) + + +def impl_modf(ty, libfunc): + retty = types.UniTuple(ty, 2) + + def lower_modf_impl(context, builder, sig, args): + modf_sig = typing.signature(retty, ty) + libfunc_impl = context.get_function(libfunc, modf_sig) + return libfunc_impl(builder, args) + + lower(math.modf, ty)(lower_modf_impl) + + +impl_modf(types.float32, libdevice.modff) +impl_modf(types.float64, libdevice.modf) + + +def impl_frexp(ty, libfunc): + retty = types.Tuple((ty, types.int32)) + + def lower_frexp_impl(context, builder, sig, args): + frexp_sig = typing.signature(retty, ty) + libfunc_impl = context.get_function(libfunc, frexp_sig) + return libfunc_impl(builder, args) + + lower(math.frexp, ty)(lower_frexp_impl) + + +impl_frexp(types.float32, libdevice.frexpf) +impl_frexp(types.float64, libdevice.frexp) + + +def impl_ldexp(ty, libfunc): + def lower_ldexp_impl(context, builder, sig, args): + ldexp_sig = typing.signature(ty, ty, types.int32) + libfunc_impl = context.get_function(libfunc, ldexp_sig) + return libfunc_impl(builder, args) + + lower(math.ldexp, ty, types.int32)(lower_ldexp_impl) + + +impl_ldexp(types.float32, libdevice.ldexpf) +impl_ldexp(types.float64, libdevice.ldexp) + + +def impl_tanh(ty, libfunc): + def lower_tanh_impl(context, builder, sig, args): + def get_compute_capability(): + flags = targetconfig.ConfigStack().top() + return flags.compute_capability + + def tanh_impl_libdevice(): + tanh_sig = typing.signature(ty, ty) + libfunc_impl = context.get_function(libfunc, tanh_sig) + return libfunc_impl(builder, args) + + def tanhf_impl_fastmath(): + fnty = ir.FunctionType(ir.FloatType(), [ir.FloatType()]) + asm = ir.InlineAsm(fnty, 'tanh.approx.f32 $0, $1;', '=f,f') + return builder.call(asm, args) + + if ty == float32 and context.fastmath: + cc = get_compute_capability() + if cc >= (7,5): + return tanhf_impl_fastmath() + + return tanh_impl_libdevice() + + lower(math.tanh, ty)(lower_tanh_impl) + + +impl_tanh(types.float32, libdevice.tanhf) +impl_tanh(types.float64, libdevice.tanh) + +impl_unary_int(math.tanh, int64, libdevice.tanh) +impl_unary_int(math.tanh, uint64, libdevice.tanh) + +# Complex power implementations - translations of _Py_c_pow from CPython +# https://github.com/python/cpython/blob/a755410e054e1e2390de5830befc08fe80706c66/Objects/complexobject.c#L123-L151 +# +# The complex64 variant casts all constants and some variables to ensure that +# as much computation is done in single precision as possible. A small number +# of operations are still done in 64-bit, but these come from libdevice code. + + +def cpow_implement(fty, cty): + def core(context, builder, sig, args): + def cpow_internal(a, b): + + if b.real == fty(0.0) and b.imag == fty(0.0): + return cty(1.0) + cty(0.0j) + elif a.real == fty(0.0) and b.real == fty(0.0): + return cty(0.0) + cty(0.0j) + + vabs = math.hypot(a.real, a.imag) + len = math.pow(vabs, b.real) + at = math.atan2(a.imag, a.real) + phase = at * b.real + if b.imag != fty(0.0): + len /= math.exp(at * b.imag) + phase += b.imag * math.log(vabs) + + return len * (cty(math.cos(phase)) + + cty(math.sin(phase) * cty(1.0j))) + + return context.compile_internal(builder, cpow_internal, sig, args) + + lower(operator.pow, cty, cty)(core) + lower(operator.ipow, cty, cty)(core) + lower(pow, cty, cty)(core) + + +cpow_implement(types.float32, types.complex64) +cpow_implement(types.float64, types.complex128) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/models.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/models.py new file mode 100644 index 0000000000000000000000000000000000000000..21d115125150a284f463a2c0c2ad2f52a78a434f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/models.py @@ -0,0 +1,48 @@ +import functools + +from llvmlite import ir + +from numba.core.datamodel.registry import DataModelManager, register +from numba.core.extending import models +from numba.core import types +from numba.cuda.types import Dim3, GridGroup, CUDADispatcher + + +cuda_data_manager = DataModelManager() + +register_model = functools.partial(register, cuda_data_manager) + + +@register_model(Dim3) +class Dim3Model(models.StructModel): + def __init__(self, dmm, fe_type): + members = [ + ('x', types.int32), + ('y', types.int32), + ('z', types.int32) + ] + super().__init__(dmm, fe_type, members) + + +@register_model(GridGroup) +class GridGroupModel(models.PrimitiveModel): + def __init__(self, dmm, fe_type): + be_type = ir.IntType(64) + super().__init__(dmm, fe_type, be_type) + + +@register_model(types.Float) +class FloatModel(models.PrimitiveModel): + def __init__(self, dmm, fe_type): + if fe_type == types.float16: + be_type = ir.IntType(16) + elif fe_type == types.float32: + be_type = ir.FloatType() + elif fe_type == types.float64: + be_type = ir.DoubleType() + else: + raise NotImplementedError(fe_type) + super(FloatModel, self).__init__(dmm, fe_type, be_type) + + +register_model(CUDADispatcher)(models.OpaqueModel) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/nvvmutils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/nvvmutils.py new file mode 100644 index 0000000000000000000000000000000000000000..9a7dcde02b4f15c8d0b15aa4501cd6efc278b81a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/nvvmutils.py @@ -0,0 +1,235 @@ +import itertools +from llvmlite import ir +from numba.core import cgutils, targetconfig +from .cudadrv import nvvm + + +def declare_atomic_cas_int(lmod, isize): + fname = '___numba_atomic_i' + str(isize) + '_cas_hack' + fnty = ir.FunctionType(ir.IntType(isize), + (ir.PointerType(ir.IntType(isize)), + ir.IntType(isize), + ir.IntType(isize))) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def atomic_cmpxchg(builder, lmod, isize, ptr, cmp, val): + out = builder.cmpxchg(ptr, cmp, val, 'monotonic', 'monotonic') + return builder.extract_value(out, 0) + + +def declare_atomic_add_float32(lmod): + fname = 'llvm.nvvm.atomic.load.add.f32.p0f32' + fnty = ir.FunctionType(ir.FloatType(), + (ir.PointerType(ir.FloatType(), 0), ir.FloatType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_add_float64(lmod): + flags = targetconfig.ConfigStack().top() + if flags.compute_capability >= (6, 0): + fname = 'llvm.nvvm.atomic.load.add.f64.p0f64' + else: + fname = '___numba_atomic_double_add' + fnty = ir.FunctionType(ir.DoubleType(), + (ir.PointerType(ir.DoubleType()), ir.DoubleType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_sub_float32(lmod): + fname = '___numba_atomic_float_sub' + fnty = ir.FunctionType(ir.FloatType(), + (ir.PointerType(ir.FloatType()), ir.FloatType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_sub_float64(lmod): + fname = '___numba_atomic_double_sub' + fnty = ir.FunctionType(ir.DoubleType(), + (ir.PointerType(ir.DoubleType()), ir.DoubleType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_inc_int32(lmod): + fname = 'llvm.nvvm.atomic.load.inc.32.p0i32' + fnty = ir.FunctionType(ir.IntType(32), + (ir.PointerType(ir.IntType(32)), ir.IntType(32))) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_inc_int64(lmod): + fname = '___numba_atomic_u64_inc' + fnty = ir.FunctionType(ir.IntType(64), + (ir.PointerType(ir.IntType(64)), ir.IntType(64))) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_dec_int32(lmod): + fname = 'llvm.nvvm.atomic.load.dec.32.p0i32' + fnty = ir.FunctionType(ir.IntType(32), + (ir.PointerType(ir.IntType(32)), ir.IntType(32))) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_dec_int64(lmod): + fname = '___numba_atomic_u64_dec' + fnty = ir.FunctionType(ir.IntType(64), + (ir.PointerType(ir.IntType(64)), ir.IntType(64))) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_max_float32(lmod): + fname = '___numba_atomic_float_max' + fnty = ir.FunctionType(ir.FloatType(), + (ir.PointerType(ir.FloatType()), ir.FloatType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_max_float64(lmod): + fname = '___numba_atomic_double_max' + fnty = ir.FunctionType(ir.DoubleType(), + (ir.PointerType(ir.DoubleType()), ir.DoubleType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_min_float32(lmod): + fname = '___numba_atomic_float_min' + fnty = ir.FunctionType(ir.FloatType(), + (ir.PointerType(ir.FloatType()), ir.FloatType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_min_float64(lmod): + fname = '___numba_atomic_double_min' + fnty = ir.FunctionType(ir.DoubleType(), + (ir.PointerType(ir.DoubleType()), ir.DoubleType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_nanmax_float32(lmod): + fname = '___numba_atomic_float_nanmax' + fnty = ir.FunctionType(ir.FloatType(), + (ir.PointerType(ir.FloatType()), ir.FloatType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_nanmax_float64(lmod): + fname = '___numba_atomic_double_nanmax' + fnty = ir.FunctionType(ir.DoubleType(), + (ir.PointerType(ir.DoubleType()), ir.DoubleType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_nanmin_float32(lmod): + fname = '___numba_atomic_float_nanmin' + fnty = ir.FunctionType(ir.FloatType(), + (ir.PointerType(ir.FloatType()), ir.FloatType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_atomic_nanmin_float64(lmod): + fname = '___numba_atomic_double_nanmin' + fnty = ir.FunctionType(ir.DoubleType(), + (ir.PointerType(ir.DoubleType()), ir.DoubleType())) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_cudaCGGetIntrinsicHandle(lmod): + fname = 'cudaCGGetIntrinsicHandle' + fnty = ir.FunctionType(ir.IntType(64), + (ir.IntType(32),)) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_cudaCGSynchronize(lmod): + fname = 'cudaCGSynchronize' + fnty = ir.FunctionType(ir.IntType(32), + (ir.IntType(64), ir.IntType(32))) + return cgutils.get_or_insert_function(lmod, fnty, fname) + + +def declare_string(builder, value): + lmod = builder.basic_block.function.module + cval = cgutils.make_bytearray(value.encode("utf-8") + b"\x00") + gl = cgutils.add_global_variable(lmod, cval.type, name="_str", + addrspace=nvvm.ADDRSPACE_CONSTANT) + gl.linkage = 'internal' + gl.global_constant = True + gl.initializer = cval + + return builder.addrspacecast(gl, ir.PointerType(ir.IntType(8)), 'generic') + + +def declare_vprint(lmod): + voidptrty = ir.PointerType(ir.IntType(8)) + # NOTE: the second argument to vprintf() points to the variable-length + # array of arguments (after the format) + vprintfty = ir.FunctionType(ir.IntType(32), [voidptrty, voidptrty]) + vprintf = cgutils.get_or_insert_function(lmod, vprintfty, "vprintf") + return vprintf + + +# ----------------------------------------------------------------------------- + +SREG_MAPPING = { + 'tid.x': 'llvm.nvvm.read.ptx.sreg.tid.x', + 'tid.y': 'llvm.nvvm.read.ptx.sreg.tid.y', + 'tid.z': 'llvm.nvvm.read.ptx.sreg.tid.z', + + 'ntid.x': 'llvm.nvvm.read.ptx.sreg.ntid.x', + 'ntid.y': 'llvm.nvvm.read.ptx.sreg.ntid.y', + 'ntid.z': 'llvm.nvvm.read.ptx.sreg.ntid.z', + + 'ctaid.x': 'llvm.nvvm.read.ptx.sreg.ctaid.x', + 'ctaid.y': 'llvm.nvvm.read.ptx.sreg.ctaid.y', + 'ctaid.z': 'llvm.nvvm.read.ptx.sreg.ctaid.z', + + 'nctaid.x': 'llvm.nvvm.read.ptx.sreg.nctaid.x', + 'nctaid.y': 'llvm.nvvm.read.ptx.sreg.nctaid.y', + 'nctaid.z': 'llvm.nvvm.read.ptx.sreg.nctaid.z', + + 'warpsize': 'llvm.nvvm.read.ptx.sreg.warpsize', + 'laneid': 'llvm.nvvm.read.ptx.sreg.laneid', +} + + +def call_sreg(builder, name): + module = builder.module + fnty = ir.FunctionType(ir.IntType(32), ()) + fn = cgutils.get_or_insert_function(module, fnty, SREG_MAPPING[name]) + return builder.call(fn, ()) + + +class SRegBuilder(object): + def __init__(self, builder): + self.builder = builder + + def tid(self, xyz): + return call_sreg(self.builder, 'tid.%s' % xyz) + + def ctaid(self, xyz): + return call_sreg(self.builder, 'ctaid.%s' % xyz) + + def ntid(self, xyz): + return call_sreg(self.builder, 'ntid.%s' % xyz) + + def nctaid(self, xyz): + return call_sreg(self.builder, 'nctaid.%s' % xyz) + + def getdim(self, xyz): + i64 = ir.IntType(64) + tid = self.builder.sext(self.tid(xyz), i64) + ntid = self.builder.sext(self.ntid(xyz), i64) + nctaid = self.builder.sext(self.ctaid(xyz), i64) + res = self.builder.add(self.builder.mul(ntid, nctaid), tid) + return res + + +def get_global_id(builder, dim): + sreg = SRegBuilder(builder) + it = (sreg.getdim(xyz) for xyz in 'xyz') + seq = list(itertools.islice(it, None, dim)) + if dim == 1: + return seq[0] + else: + return seq diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/printimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/printimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..dac1780706bb4fa512d66fa36ea18134b2e5d4c8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/printimpl.py @@ -0,0 +1,86 @@ +from functools import singledispatch +from llvmlite import ir +from numba.core import types, cgutils +from numba.core.errors import NumbaWarning +from numba.core.imputils import Registry +from numba.cuda import nvvmutils +from warnings import warn + +registry = Registry() +lower = registry.lower + +voidptr = ir.PointerType(ir.IntType(8)) + + +# NOTE: we don't use @lower here since print_item() doesn't return a LLVM value + +@singledispatch +def print_item(ty, context, builder, val): + """ + Handle printing of a single value of the given Numba type. + A (format string, [list of arguments]) is returned that will allow + forming the final printf()-like call. + """ + raise NotImplementedError("printing unimplemented for values of type %s" + % (ty,)) + + +@print_item.register(types.Integer) +@print_item.register(types.IntegerLiteral) +def int_print_impl(ty, context, builder, val): + if ty in types.unsigned_domain: + rawfmt = "%llu" + dsttype = types.uint64 + else: + rawfmt = "%lld" + dsttype = types.int64 + lld = context.cast(builder, val, ty, dsttype) + return rawfmt, [lld] + + +@print_item.register(types.Float) +def real_print_impl(ty, context, builder, val): + lld = context.cast(builder, val, ty, types.float64) + return "%f", [lld] + + +@print_item.register(types.StringLiteral) +def const_print_impl(ty, context, builder, sigval): + pyval = ty.literal_value + assert isinstance(pyval, str) # Ensured by lowering + rawfmt = "%s" + val = context.insert_string_const_addrspace(builder, pyval) + return rawfmt, [val] + + +@lower(print, types.VarArg(types.Any)) +def print_varargs(context, builder, sig, args): + """This function is a generic 'print' wrapper for arbitrary types. + It dispatches to the appropriate 'print' implementations above + depending on the detected real types in the signature.""" + + vprint = nvvmutils.declare_vprint(builder.module) + + formats = [] + values = [] + + for i, (argtype, argval) in enumerate(zip(sig.args, args)): + argfmt, argvals = print_item(argtype, context, builder, argval) + formats.append(argfmt) + values.extend(argvals) + + rawfmt = " ".join(formats) + "\n" + if len(args) > 32: + msg = ('CUDA print() cannot print more than 32 items. ' + 'The raw format string will be emitted by the kernel instead.') + warn(msg, NumbaWarning) + + rawfmt = rawfmt.replace('%', '%%') + fmt = context.insert_string_const_addrspace(builder, rawfmt) + array = cgutils.make_anonymous_struct(builder, values) + arrayptr = cgutils.alloca_once_value(builder, array) + + vprint = nvvmutils.declare_vprint(builder.module) + builder.call(vprint, (fmt, builder.bitcast(arrayptr, voidptr))) + + return context.get_dummy_value() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/random.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/random.py new file mode 100644 index 0000000000000000000000000000000000000000..460c7fc212077742e728e5c5c981ef2c1b1e6af0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/random.py @@ -0,0 +1,292 @@ +import math + +from numba import (config, cuda, float32, float64, uint32, int64, uint64, + from_dtype, jit) + +import numpy as np + +# This implementation is based upon the xoroshiro128+ and splitmix64 algorithms +# described at: +# +# http://xoroshiro.di.unimi.it/ +# +# and originally implemented by David Blackman and Sebastiano Vigna. +# +# The implementations below are based on the C source code: +# +# * http://xoroshiro.di.unimi.it/xoroshiro128plus.c +# * http://xoroshiro.di.unimi.it/splitmix64.c +# +# Splitmix64 is used to generate the initial state of the xoroshiro128+ +# generator to ensure that small seeds don't result in predictable output. + +# **WARNING**: There is a lot of verbose casting in this file to ensure that +# NumPy casting conventions (which cast uint64 [op] int32 to float64) don't +# turn integers into floats when using these functions in the CUDA simulator. +# +# There are also no function type signatures to ensure that compilation is +# deferred so that import is quick, and Sphinx autodoc works. We are also +# using the CPU @jit decorator everywhere to create functions that work as +# both CPU and CUDA device functions. + +xoroshiro128p_dtype = np.dtype([('s0', np.uint64), ('s1', np.uint64)], + align=True) +xoroshiro128p_type = from_dtype(xoroshiro128p_dtype) + +# When cudasim is enabled, Fake CUDA arrays are passed to some of the +# @jit-decorated functions. This required fallback to object mode. With +# Numba 0.59.0 object mode must be explicitly enabled. +# https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit +# In order to avoid the warning / future error, we explicitly specify that +# object mode with loop lifting is acceptable when using the simulator. +_forceobj = _looplift = config.ENABLE_CUDASIM +_nopython = not config.ENABLE_CUDASIM + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def init_xoroshiro128p_state(states, index, seed): + '''Use SplitMix64 to generate an xoroshiro128p state from 64-bit seed. + + This ensures that manually set small seeds don't result in a predictable + initial sequence from the random number generator. + + :type states: 1D array, dtype=xoroshiro128p_dtype + :param states: array of RNG states + :type index: uint64 + :param index: offset in states to update + :type seed: int64 + :param seed: seed value to use when initializing state + ''' + index = int64(index) + seed = uint64(seed) + + z = seed + uint64(0x9E3779B97F4A7C15) + z = (z ^ (z >> uint32(30))) * uint64(0xBF58476D1CE4E5B9) + z = (z ^ (z >> uint32(27))) * uint64(0x94D049BB133111EB) + z = z ^ (z >> uint32(31)) + + states[index]['s0'] = z + states[index]['s1'] = z + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def rotl(x, k): + '''Left rotate x by k bits.''' + x = uint64(x) + k = uint32(k) + return (x << k) | (x >> uint32(64 - k)) + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def xoroshiro128p_next(states, index): + '''Return the next random uint64 and advance the RNG in states[index]. + + :type states: 1D array, dtype=xoroshiro128p_dtype + :param states: array of RNG states + :type index: int64 + :param index: offset in states to update + :rtype: uint64 + ''' + index = int64(index) + s0 = states[index]['s0'] + s1 = states[index]['s1'] + result = s0 + s1 + + s1 ^= s0 + states[index]['s0'] = uint64(rotl(s0, uint32(55))) ^ s1 ^ (s1 << uint32(14)) + states[index]['s1'] = uint64(rotl(s1, uint32(36))) + + return result + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def xoroshiro128p_jump(states, index): + '''Advance the RNG in ``states[index]`` by 2**64 steps. + + :type states: 1D array, dtype=xoroshiro128p_dtype + :param states: array of RNG states + :type index: int64 + :param index: offset in states to update + ''' + index = int64(index) + + jump = (uint64(0xbeac0467eba5facb), uint64(0xd86b048b86aa9922)) + + s0 = uint64(0) + s1 = uint64(0) + + for i in range(2): + for b in range(64): + if jump[i] & (uint64(1) << uint32(b)): + s0 ^= states[index]['s0'] + s1 ^= states[index]['s1'] + xoroshiro128p_next(states, index) + + states[index]['s0'] = s0 + states[index]['s1'] = s1 + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def uint64_to_unit_float64(x): + '''Convert uint64 to float64 value in the range [0.0, 1.0)''' + x = uint64(x) + return (x >> uint32(11)) * (float64(1) / (uint64(1) << uint32(53))) + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def uint64_to_unit_float32(x): + '''Convert uint64 to float32 value in the range [0.0, 1.0)''' + x = uint64(x) + return float32(uint64_to_unit_float64(x)) + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def xoroshiro128p_uniform_float32(states, index): + '''Return a float32 in range [0.0, 1.0) and advance ``states[index]``. + + :type states: 1D array, dtype=xoroshiro128p_dtype + :param states: array of RNG states + :type index: int64 + :param index: offset in states to update + :rtype: float32 + ''' + index = int64(index) + return uint64_to_unit_float32(xoroshiro128p_next(states, index)) + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def xoroshiro128p_uniform_float64(states, index): + '''Return a float64 in range [0.0, 1.0) and advance ``states[index]``. + + :type states: 1D array, dtype=xoroshiro128p_dtype + :param states: array of RNG states + :type index: int64 + :param index: offset in states to update + :rtype: float64 + ''' + index = int64(index) + return uint64_to_unit_float64(xoroshiro128p_next(states, index)) + + +TWO_PI_FLOAT32 = np.float32(2 * math.pi) +TWO_PI_FLOAT64 = np.float64(2 * math.pi) + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def xoroshiro128p_normal_float32(states, index): + '''Return a normally distributed float32 and advance ``states[index]``. + + The return value is drawn from a Gaussian of mean=0 and sigma=1 using the + Box-Muller transform. This advances the RNG sequence by two steps. + + :type states: 1D array, dtype=xoroshiro128p_dtype + :param states: array of RNG states + :type index: int64 + :param index: offset in states to update + :rtype: float32 + ''' + index = int64(index) + + u1 = xoroshiro128p_uniform_float32(states, index) + u2 = xoroshiro128p_uniform_float32(states, index) + + z0 = math.sqrt(-float32(2.0) * math.log(u1)) * math.cos(TWO_PI_FLOAT32 * u2) + # discarding second normal value + # z1 = math.sqrt(-float32(2.0) * math.log(u1)) + # * math.sin(TWO_PI_FLOAT32 * u2) + return z0 + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def xoroshiro128p_normal_float64(states, index): + '''Return a normally distributed float32 and advance ``states[index]``. + + The return value is drawn from a Gaussian of mean=0 and sigma=1 using the + Box-Muller transform. This advances the RNG sequence by two steps. + + :type states: 1D array, dtype=xoroshiro128p_dtype + :param states: array of RNG states + :type index: int64 + :param index: offset in states to update + :rtype: float64 + ''' + index = int64(index) + + u1 = xoroshiro128p_uniform_float32(states, index) + u2 = xoroshiro128p_uniform_float32(states, index) + + z0 = math.sqrt(-float64(2.0) * math.log(u1)) * math.cos(TWO_PI_FLOAT64 * u2) + # discarding second normal value + # z1 = math.sqrt(-float64(2.0) * math.log(u1)) + # * math.sin(TWO_PI_FLOAT64 * u2) + return z0 + + +@jit(forceobj=_forceobj, looplift=_looplift, nopython=_nopython) +def init_xoroshiro128p_states_cpu(states, seed, subsequence_start): + n = states.shape[0] + seed = uint64(seed) + subsequence_start = uint64(subsequence_start) + + if n >= 1: + init_xoroshiro128p_state(states, 0, seed) + + # advance to starting subsequence number + for _ in range(subsequence_start): + xoroshiro128p_jump(states, 0) + + # populate the rest of the array + for i in range(1, n): + states[i] = states[i - 1] # take state of previous generator + xoroshiro128p_jump(states, i) # and jump forward 2**64 steps + + +def init_xoroshiro128p_states(states, seed, subsequence_start=0, stream=0): + '''Initialize RNG states on the GPU for parallel generators. + + This initializes the RNG states so that each state in the array corresponds + subsequences in the separated by 2**64 steps from each other in the main + sequence. Therefore, as long no CUDA thread requests more than 2**64 + random numbers, all of the RNG states produced by this function are + guaranteed to be independent. + + The subsequence_start parameter can be used to advance the first RNG state + by a multiple of 2**64 steps. + + :type states: 1D DeviceNDArray, dtype=xoroshiro128p_dtype + :param states: array of RNG states + :type seed: uint64 + :param seed: starting seed for list of generators + ''' + + # Initialization on CPU is much faster than the GPU + states_cpu = np.empty(shape=states.shape, dtype=xoroshiro128p_dtype) + init_xoroshiro128p_states_cpu(states_cpu, seed, subsequence_start) + + states.copy_to_device(states_cpu, stream=stream) + + +def create_xoroshiro128p_states(n, seed, subsequence_start=0, stream=0): + '''Returns a new device array initialized for n random number generators. + + This initializes the RNG states so that each state in the array corresponds + subsequences in the separated by 2**64 steps from each other in the main + sequence. Therefore, as long no CUDA thread requests more than 2**64 + random numbers, all of the RNG states produced by this function are + guaranteed to be independent. + + The subsequence_start parameter can be used to advance the first RNG state + by a multiple of 2**64 steps. + + :type n: int + :param n: number of RNG states to create + :type seed: uint64 + :param seed: starting seed for list of generators + :type subsequence_start: uint64 + :param subsequence_start: + :type stream: CUDA stream + :param stream: stream to run initialization kernel on + ''' + states = cuda.device_array(n, dtype=xoroshiro128p_dtype, stream=stream) + init_xoroshiro128p_states(states, seed, subsequence_start, stream) + return states diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/simulator_init.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/simulator_init.py new file mode 100644 index 0000000000000000000000000000000000000000..9d7dd124a9ef539a85545c017653a9fab9264261 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/simulator_init.py @@ -0,0 +1,17 @@ +# We import * from simulator here because * is imported from simulator_init by +# numba.cuda.__init__. +from .simulator import * # noqa: F403, F401 + + +def is_available(): + """Returns a boolean to indicate the availability of a CUDA GPU. + """ + # Simulator is always available + return True + + +def cuda_error(): + """Returns None or an exception if the CUDA driver fails to initialize. + """ + # Simulator never fails to initialize + return None diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/stubs.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/stubs.py new file mode 100644 index 0000000000000000000000000000000000000000..fb6979a448185945a8ce1e5dbad83f2f23cc36a3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/stubs.py @@ -0,0 +1,902 @@ +""" +This scripts specifies all PTX special objects. +""" +import numpy as np +from collections import defaultdict +import functools +import itertools +from inspect import Signature, Parameter + + +class Stub(object): + ''' + A stub object to represent special objects that are meaningless + outside the context of a CUDA kernel + ''' + _description_ = '' + __slots__ = () # don't allocate __dict__ + + def __new__(cls): + raise NotImplementedError("%s is not instantiable" % cls) + + def __repr__(self): + return self._description_ + + +def stub_function(fn): + ''' + A stub function to represent special functions that are meaningless + outside the context of a CUDA kernel + ''' + @functools.wraps(fn) + def wrapped(*args, **kwargs): + raise NotImplementedError("%s cannot be called from host code" % fn) + return wrapped + + +#------------------------------------------------------------------------------- +# Thread and grid indices and dimensions + + +class Dim3(Stub): + '''A triple, (x, y, z)''' + _description_ = '' + + @property + def x(self): + pass + + @property + def y(self): + pass + + @property + def z(self): + pass + + +class threadIdx(Dim3): + ''' + The thread indices in the current thread block. Each index is an integer + spanning the range from 0 inclusive to the corresponding value of the + attribute in :attr:`numba.cuda.blockDim` exclusive. + ''' + _description_ = '' + + +class blockIdx(Dim3): + ''' + The block indices in the grid of thread blocks. Each index is an integer + spanning the range from 0 inclusive to the corresponding value of the + attribute in :attr:`numba.cuda.gridDim` exclusive. + ''' + _description_ = '' + + +class blockDim(Dim3): + ''' + The shape of a block of threads, as declared when instantiating the kernel. + This value is the same for all threads in a given kernel launch, even if + they belong to different blocks (i.e. each block is "full"). + ''' + _description_ = '' + + +class gridDim(Dim3): + ''' + The shape of the grid of blocks. This value is the same for all threads in + a given kernel launch. + ''' + _description_ = '' + + +class warpsize(Stub): + ''' + The size of a warp. All architectures implemented to date have a warp size + of 32. + ''' + _description_ = '' + + +class laneid(Stub): + ''' + This thread's lane within a warp. Ranges from 0 to + :attr:`numba.cuda.warpsize` - 1. + ''' + _description_ = '' + + +#------------------------------------------------------------------------------- +# Array creation + +class shared(Stub): + ''' + Shared memory namespace + ''' + _description_ = '' + + @stub_function + def array(shape, dtype): + ''' + Allocate a shared array of the given *shape* and *type*. *shape* is + either an integer or a tuple of integers representing the array's + dimensions. *type* is a :ref:`Numba type ` of the + elements needing to be stored in the array. + + The returned array-like object can be read and written to like any + normal device array (e.g. through indexing). + ''' + + +class local(Stub): + ''' + Local memory namespace + ''' + _description_ = '' + + @stub_function + def array(shape, dtype): + ''' + Allocate a local array of the given *shape* and *type*. The array is + private to the current thread, and resides in global memory. An + array-like object is returned which can be read and written to like any + standard array (e.g. through indexing). + ''' + + +class const(Stub): + ''' + Constant memory namespace + ''' + + @stub_function + def array_like(ndarray): + ''' + Create a const array from *ndarry*. The resulting const array will have + the same shape, type, and values as *ndarray*. + ''' + + +# ------------------------------------------------------------------------------- +# warp level operations + +class syncwarp(Stub): + ''' + syncwarp(mask=0xFFFFFFFF) + + Synchronizes a masked subset of threads in a warp. + ''' + _description_ = '' + + +class shfl_sync_intrinsic(Stub): + ''' + shfl_sync_intrinsic(mask, mode, value, mode_offset, clamp) + + Nvvm intrinsic for shuffling data across a warp + docs.nvidia.com/cuda/nvvm-ir-spec/index.html#nvvm-intrin-warp-level-datamove + ''' + _description_ = '' + + +class vote_sync_intrinsic(Stub): + ''' + vote_sync_intrinsic(mask, mode, predictate) + + Nvvm intrinsic for performing a reduce and broadcast across a warp + docs.nvidia.com/cuda/nvvm-ir-spec/index.html#nvvm-intrin-warp-level-vote + ''' + _description_ = '' + + +class match_any_sync(Stub): + ''' + match_any_sync(mask, value) + + Nvvm intrinsic for performing a compare and broadcast across a warp. + Returns a mask of threads that have same value as the given value from + within the masked warp. + ''' + _description_ = '' + + +class match_all_sync(Stub): + ''' + match_all_sync(mask, value) + + Nvvm intrinsic for performing a compare and broadcast across a warp. + Returns a tuple of (mask, pred), where mask is a mask of threads that have + same value as the given value from within the masked warp, if they + all have the same value, otherwise it is 0. Pred is a boolean of whether + or not all threads in the mask warp have the same warp. + ''' + _description_ = '' + + +class activemask(Stub): + ''' + activemask() + + Returns a 32-bit integer mask of all currently active threads in the + calling warp. The Nth bit is set if the Nth lane in the warp is active when + activemask() is called. Inactive threads are represented by 0 bits in the + returned mask. Threads which have exited the kernel are always marked as + inactive. + ''' + _description_ = '' + + +class lanemask_lt(Stub): + ''' + lanemask_lt() + + Returns a 32-bit integer mask of all lanes (including inactive ones) with + ID less than the current lane. + ''' + _description_ = '' + + +# ------------------------------------------------------------------------------- +# memory fences + +class threadfence_block(Stub): + ''' + A memory fence at thread block level + ''' + _description_ = '' + + +class threadfence_system(Stub): + ''' + A memory fence at system level: across devices + ''' + _description_ = '' + + +class threadfence(Stub): + ''' + A memory fence at device level + ''' + _description_ = '' + + +#------------------------------------------------------------------------------- +# bit manipulation + +class popc(Stub): + """ + popc(x) + + Returns the number of set bits in x. + """ + + +class brev(Stub): + """ + brev(x) + + Returns the reverse of the bit pattern of x. For example, 0b10110110 + becomes 0b01101101. + """ + + +class clz(Stub): + """ + clz(x) + + Returns the number of leading zeros in z. + """ + + +class ffs(Stub): + """ + ffs(x) + + Returns the position of the first (least significant) bit set to 1 in x, + where the least significant bit position is 1. ffs(0) returns 0. + """ + + +#------------------------------------------------------------------------------- +# comparison and selection instructions + +class selp(Stub): + """ + selp(a, b, c) + + Select between source operands, based on the value of the predicate source + operand. + """ + + +#------------------------------------------------------------------------------- +# single / double precision arithmetic + +class fma(Stub): + """ + fma(a, b, c) + + Perform the fused multiply-add operation. + """ + + +class cbrt(Stub): + """" + cbrt(a) + + Perform the cube root operation. + """ + + +#------------------------------------------------------------------------------- +# atomic + +class atomic(Stub): + """Namespace for atomic operations + """ + _description_ = '' + + class add(Stub): + """add(ary, idx, val) + + Perform atomic ``ary[idx] += val``. Supported on int32, float32, and + float64 operands only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class sub(Stub): + """sub(ary, idx, val) + + Perform atomic ``ary[idx] -= val``. Supported on int32, float32, and + float64 operands only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class and_(Stub): + """and_(ary, idx, val) + + Perform atomic ``ary[idx] &= val``. Supported on int32, int64, uint32 + and uint64 operands only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class or_(Stub): + """or_(ary, idx, val) + + Perform atomic ``ary[idx] |= val``. Supported on int32, int64, uint32 + and uint64 operands only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class xor(Stub): + """xor(ary, idx, val) + + Perform atomic ``ary[idx] ^= val``. Supported on int32, int64, uint32 + and uint64 operands only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class inc(Stub): + """inc(ary, idx, val) + + Perform atomic ``ary[idx] += 1`` up to val, then reset to 0. Supported + on uint32, and uint64 operands only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class dec(Stub): + """dec(ary, idx, val) + + Performs:: + + ary[idx] = (value if (array[idx] == 0) or + (array[idx] > value) else array[idx] - 1) + + Supported on uint32, and uint64 operands only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class exch(Stub): + """exch(ary, idx, val) + + Perform atomic ``ary[idx] = val``. Supported on int32, int64, uint32 and + uint64 operands only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class max(Stub): + """max(ary, idx, val) + + Perform atomic ``ary[idx] = max(ary[idx], val)``. + + Supported on int32, int64, uint32, uint64, float32, float64 operands + only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class min(Stub): + """min(ary, idx, val) + + Perform atomic ``ary[idx] = min(ary[idx], val)``. + + Supported on int32, int64, uint32, uint64, float32, float64 operands + only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class nanmax(Stub): + """nanmax(ary, idx, val) + + Perform atomic ``ary[idx] = max(ary[idx], val)``. + + NOTE: NaN is treated as a missing value such that: + nanmax(NaN, n) == n, nanmax(n, NaN) == n + + Supported on int32, int64, uint32, uint64, float32, float64 operands + only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class nanmin(Stub): + """nanmin(ary, idx, val) + + Perform atomic ``ary[idx] = min(ary[idx], val)``. + + NOTE: NaN is treated as a missing value, such that: + nanmin(NaN, n) == n, nanmin(n, NaN) == n + + Supported on int32, int64, uint32, uint64, float32, float64 operands + only. + + Returns the old value at the index location as if it is loaded + atomically. + """ + + class compare_and_swap(Stub): + """compare_and_swap(ary, old, val) + + Conditionally assign ``val`` to the first element of an 1D array ``ary`` + if the current value matches ``old``. + + Supported on int32, int64, uint32, uint64 operands only. + + Returns the old value as if it is loaded atomically. + """ + + class cas(Stub): + """cas(ary, idx, old, val) + + Conditionally assign ``val`` to the element ``idx`` of an array + ``ary`` if the current value of ``ary[idx]`` matches ``old``. + + Supported on int32, int64, uint32, uint64 operands only. + + Returns the old value as if it is loaded atomically. + """ + + +#------------------------------------------------------------------------------- +# timers + +class nanosleep(Stub): + ''' + nanosleep(ns) + + Suspends the thread for a sleep duration approximately close to the delay + `ns`, specified in nanoseconds. + ''' + _description_ = '' + +#------------------------------------------------------------------------------- +# Floating point 16 + + +class fp16(Stub): + """Namespace for fp16 operations + """ + _description_ = '' + + class hadd(Stub): + """hadd(a, b) + + Perform fp16 addition, (a + b) in round to nearest mode. Supported + on fp16 operands only. + + Returns the fp16 result of the addition. + + """ + + class hsub(Stub): + """hsub(a, b) + + Perform fp16 subtraction, (a - b) in round to nearest mode. Supported + on fp16 operands only. + + Returns the fp16 result of the subtraction. + + """ + + class hmul(Stub): + """hmul(a, b) + + Perform fp16 multiplication, (a * b) in round to nearest mode. Supported + on fp16 operands only. + + Returns the fp16 result of the multiplication. + + """ + + class hdiv(Stub): + """hdiv(a, b) + + Perform fp16 division, (a / b) in round to nearest mode. Supported + on fp16 operands only. + + Returns the fp16 result of the division + + """ + + class hfma(Stub): + """hfma(a, b, c) + + Perform fp16 multiply and accumulate, (a * b) + c in round to nearest + mode. Supported on fp16 operands only. + + Returns the fp16 result of the multiplication. + + """ + + class hneg(Stub): + """hneg(a) + + Perform fp16 negation, -(a). Supported on fp16 operands only. + + Returns the fp16 result of the negation. + + """ + + class habs(Stub): + """habs(a) + + Perform fp16 absolute value, |a|. Supported on fp16 operands only. + + Returns the fp16 result of the absolute value. + + """ + + class hsin(Stub): + """hsin(a) + + Calculate sine in round to nearest even mode. Supported on fp16 + operands only. + + Returns the sine result. + + """ + + class hcos(Stub): + """hsin(a) + + Calculate cosine in round to nearest even mode. Supported on fp16 + operands only. + + Returns the cosine result. + + """ + + class hlog(Stub): + """hlog(a) + + Calculate natural logarithm in round to nearest even mode. Supported + on fp16 operands only. + + Returns the natural logarithm result. + + """ + + class hlog10(Stub): + """hlog10(a) + + Calculate logarithm base 10 in round to nearest even mode. Supported + on fp16 operands only. + + Returns the logarithm base 10 result. + + """ + + class hlog2(Stub): + """hlog2(a) + + Calculate logarithm base 2 in round to nearest even mode. Supported + on fp16 operands only. + + Returns the logarithm base 2 result. + + """ + + class hexp(Stub): + """hexp(a) + + Calculate natural exponential, exp(a), in round to nearest mode. + Supported on fp16 operands only. + + Returns the natural exponential result. + + """ + + class hexp10(Stub): + """hexp10(a) + + Calculate exponential base 10 (10 ** a) in round to nearest mode. + Supported on fp16 operands only. + + Returns the exponential base 10 result. + + """ + + class hexp2(Stub): + """hexp2(a) + + Calculate exponential base 2 (2 ** a) in round to nearest mode. + Supported on fp16 operands only. + + Returns the exponential base 2 result. + + """ + + class hfloor(Stub): + """hfloor(a) + + Calculate the floor, the largest integer less than or equal to 'a'. + Supported on fp16 operands only. + + Returns the floor result. + + """ + + class hceil(Stub): + """hceil(a) + + Calculate the ceil, the smallest integer greater than or equal to 'a'. + Supported on fp16 operands only. + + Returns the ceil result. + + """ + + class hsqrt(Stub): + """hsqrt(a) + + Calculate the square root of the input argument in round to nearest + mode. Supported on fp16 operands only. + + Returns the square root result. + + """ + + class hrsqrt(Stub): + """hrsqrt(a) + + Calculate the reciprocal square root of the input argument in round + to nearest even mode. Supported on fp16 operands only. + + Returns the reciprocal square root result. + + """ + + class hrcp(Stub): + """hrcp(a) + + Calculate the reciprocal of the input argument in round to nearest + even mode. Supported on fp16 operands only. + + Returns the reciprocal result. + + """ + + class hrint(Stub): + """hrint(a) + + Round the input argument to nearest integer value. Supported on fp16 + operands only. + + Returns the rounded result. + + """ + + class htrunc(Stub): + """htrunc(a) + + Truncate the input argument to its integer portion. Supported + on fp16 operands only. + + Returns the truncated result. + + """ + + class heq(Stub): + """heq(a, b) + + Perform fp16 comparison, (a == b). Supported + on fp16 operands only. + + Returns True if a and b are equal and False otherwise. + + """ + + class hne(Stub): + """hne(a, b) + + Perform fp16 comparison, (a != b). Supported + on fp16 operands only. + + Returns True if a and b are not equal and False otherwise. + + """ + + class hge(Stub): + """hge(a, b) + + Perform fp16 comparison, (a >= b). Supported + on fp16 operands only. + + Returns True if a is >= b and False otherwise. + + """ + + class hgt(Stub): + """hgt(a, b) + + Perform fp16 comparison, (a > b). Supported + on fp16 operands only. + + Returns True if a is > b and False otherwise. + + """ + + class hle(Stub): + """hle(a, b) + + Perform fp16 comparison, (a <= b). Supported + on fp16 operands only. + + Returns True if a is <= b and False otherwise. + + """ + + class hlt(Stub): + """hlt(a, b) + + Perform fp16 comparison, (a < b). Supported + on fp16 operands only. + + Returns True if a is < b and False otherwise. + + """ + + class hmax(Stub): + """hmax(a, b) + + Perform fp16 maximum operation, max(a,b) Supported + on fp16 operands only. + + Returns a if a is greater than b, returns b otherwise. + + """ + + class hmin(Stub): + """hmin(a, b) + + Perform fp16 minimum operation, min(a,b). Supported + on fp16 operands only. + + Returns a if a is less than b, returns b otherwise. + + """ + + +#------------------------------------------------------------------------------- +# vector types + +def make_vector_type_stubs(): + """Make user facing objects for vector types""" + vector_type_stubs = [] + vector_type_prefix = ( + "int8", + "int16", + "int32", + "int64", + "uint8", + "uint16", + "uint32", + "uint64", + "float32", + "float64" + ) + vector_type_element_counts = (1, 2, 3, 4) + vector_type_attribute_names = ("x", "y", "z", "w") + + for prefix, nelem in itertools.product( + vector_type_prefix, vector_type_element_counts + ): + type_name = f"{prefix}x{nelem}" + attr_names = vector_type_attribute_names[:nelem] + + vector_type_stub = type( + type_name, (Stub,), + { + **{attr: lambda self: None for attr in attr_names}, + **{ + "_description_": f"<{type_name}>", + "__signature__": Signature(parameters=[ + Parameter( + name=attr_name, kind=Parameter.POSITIONAL_ONLY + ) for attr_name in attr_names[:nelem] + ]), + "__doc__": f"A stub for {type_name} to be used in " + "CUDA kernels." + }, + **{"aliases": []} + } + ) + vector_type_stubs.append(vector_type_stub) + return vector_type_stubs + + +def map_vector_type_stubs_to_alias(vector_type_stubs): + """For each of the stubs, create its aliases. + + For example: float64x3 -> double3 + """ + # C-compatible type mapping, see: + # https://numpy.org/devdocs/reference/arrays.scalars.html#integer-types + base_type_to_alias = { + "char": f"int{np.dtype(np.byte).itemsize * 8}", + "short": f"int{np.dtype(np.short).itemsize * 8}", + "int": f"int{np.dtype(np.intc).itemsize * 8}", + "long": f"int{np.dtype(np.int_).itemsize * 8}", + "longlong": f"int{np.dtype(np.longlong).itemsize * 8}", + "uchar": f"uint{np.dtype(np.ubyte).itemsize * 8}", + "ushort": f"uint{np.dtype(np.ushort).itemsize * 8}", + "uint": f"uint{np.dtype(np.uintc).itemsize * 8}", + "ulong": f"uint{np.dtype(np.uint).itemsize * 8}", + "ulonglong": f"uint{np.dtype(np.ulonglong).itemsize * 8}", + "float": f"float{np.dtype(np.single).itemsize * 8}", + "double": f"float{np.dtype(np.double).itemsize * 8}" + } + + base_type_to_vector_type = defaultdict(list) + for stub in vector_type_stubs: + base_type_to_vector_type[stub.__name__[:-2]].append(stub) + + for alias, base_type in base_type_to_alias.items(): + vector_type_stubs = base_type_to_vector_type[base_type] + for stub in vector_type_stubs: + nelem = stub.__name__[-1] + stub.aliases.append(f"{alias}{nelem}") + + +_vector_type_stubs = make_vector_type_stubs() +map_vector_type_stubs_to_alias(_vector_type_stubs) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/target.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/target.py new file mode 100644 index 0000000000000000000000000000000000000000..6402ff3574abf3a4e17a0515c80e3ab703754ca9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/target.py @@ -0,0 +1,440 @@ +import re +from functools import cached_property +import llvmlite.binding as ll +from llvmlite import ir + +from numba.core import (cgutils, config, debuginfo, itanium_mangler, types, + typing, utils) +from numba.core.dispatcher import Dispatcher +from numba.core.base import BaseContext +from numba.core.callconv import BaseCallConv, MinimalCallConv +from numba.core.typing import cmathdecl +from numba.core import datamodel + +from .cudadrv import nvvm +from numba.cuda import codegen, nvvmutils, ufuncs +from numba.cuda.models import cuda_data_manager + +# ----------------------------------------------------------------------------- +# Typing + + +class CUDATypingContext(typing.BaseContext): + def load_additional_registries(self): + from . import cudadecl, cudamath, libdevicedecl, vector_types + from numba.core.typing import enumdecl, cffi_utils + + self.install_registry(cudadecl.registry) + self.install_registry(cffi_utils.registry) + self.install_registry(cudamath.registry) + self.install_registry(cmathdecl.registry) + self.install_registry(libdevicedecl.registry) + self.install_registry(enumdecl.registry) + self.install_registry(vector_types.typing_registry) + + def resolve_value_type(self, val): + # treat other dispatcher object as another device function + from numba.cuda.dispatcher import CUDADispatcher + if (isinstance(val, Dispatcher) and not + isinstance(val, CUDADispatcher)): + try: + # use cached device function + val = val.__dispatcher + except AttributeError: + if not val._can_compile: + raise ValueError('using cpu function on device ' + 'but its compilation is disabled') + targetoptions = val.targetoptions.copy() + targetoptions['device'] = True + targetoptions['debug'] = targetoptions.get('debug', False) + targetoptions['opt'] = targetoptions.get('opt', True) + disp = CUDADispatcher(val.py_func, targetoptions) + # cache the device function for future use and to avoid + # duplicated copy of the same function. + val.__dispatcher = disp + val = disp + + # continue with parent logic + return super(CUDATypingContext, self).resolve_value_type(val) + +# ----------------------------------------------------------------------------- +# Implementation + + +VALID_CHARS = re.compile(r'[^a-z0-9]', re.I) + + +class CUDATargetContext(BaseContext): + implement_powi_as_math_call = True + strict_alignment = True + + def __init__(self, typingctx, target='cuda'): + super().__init__(typingctx, target) + self.data_model_manager = cuda_data_manager.chain( + datamodel.default_manager + ) + + @property + def DIBuilder(self): + return debuginfo.DIBuilder + + @property + def enable_boundscheck(self): + # Unconditionally disabled + return False + + # Overrides + def create_module(self, name): + return self._internal_codegen._create_empty_module(name) + + def init(self): + self._internal_codegen = codegen.JITCUDACodegen("numba.cuda.jit") + self._target_data = None + + def load_additional_registries(self): + # side effect of import needed for numba.cpython.*, the builtins + # registry is updated at import time. + from numba.cpython import numbers, tupleobj, slicing # noqa: F401 + from numba.cpython import rangeobj, iterators, enumimpl # noqa: F401 + from numba.cpython import unicode, charseq # noqa: F401 + from numba.cpython import cmathimpl + from numba.misc import cffiimpl + from numba.np import arrayobj # noqa: F401 + from numba.np import npdatetime # noqa: F401 + from . import ( + cudaimpl, printimpl, libdeviceimpl, mathimpl, vector_types + ) + # fix for #8940 + from numba.np.unsafe import ndarray # noqa F401 + + self.install_registry(cudaimpl.registry) + self.install_registry(cffiimpl.registry) + self.install_registry(printimpl.registry) + self.install_registry(libdeviceimpl.registry) + self.install_registry(cmathimpl.registry) + self.install_registry(mathimpl.registry) + self.install_registry(vector_types.impl_registry) + + def codegen(self): + return self._internal_codegen + + @property + def target_data(self): + if self._target_data is None: + self._target_data = ll.create_target_data(nvvm.NVVM().data_layout) + return self._target_data + + @cached_property + def nonconst_module_attrs(self): + """ + Some CUDA intrinsics are at the module level, but cannot be treated as + constants, because they are loaded from a special register in the PTX. + These include threadIdx, blockDim, etc. + """ + from numba import cuda + nonconsts = ('threadIdx', 'blockDim', 'blockIdx', 'gridDim', 'laneid', + 'warpsize') + nonconsts_with_mod = tuple([(types.Module(cuda), nc) + for nc in nonconsts]) + return nonconsts_with_mod + + @cached_property + def call_conv(self): + return CUDACallConv(self) + + def mangler(self, name, argtypes, *, abi_tags=(), uid=None): + return itanium_mangler.mangle(name, argtypes, abi_tags=abi_tags, + uid=uid) + + def prepare_cuda_kernel(self, codelib, fndesc, debug, lineinfo, + nvvm_options, filename, linenum, + max_registers=None): + """ + Adapt a code library ``codelib`` with the numba compiled CUDA kernel + with name ``fname`` and arguments ``argtypes`` for NVVM. + A new library is created with a wrapper function that can be used as + the kernel entry point for the given kernel. + + Returns the new code library and the wrapper function. + + Parameters: + + codelib: The CodeLibrary containing the device function to wrap + in a kernel call. + fndesc: The FunctionDescriptor of the source function. + debug: Whether to compile with debug. + lineinfo: Whether to emit line info. + nvvm_options: Dict of NVVM options used when compiling the new library. + filename: The source filename that the function is contained in. + linenum: The source line that the function is on. + max_registers: The max_registers argument for the code library. + """ + kernel_name = itanium_mangler.prepend_namespace( + fndesc.llvm_func_name, ns='cudapy', + ) + library = self.codegen().create_library(f'{codelib.name}_kernel_', + entry_name=kernel_name, + nvvm_options=nvvm_options, + max_registers=max_registers) + library.add_linking_library(codelib) + wrapper = self.generate_kernel_wrapper(library, fndesc, kernel_name, + debug, lineinfo, filename, + linenum) + return library, wrapper + + def generate_kernel_wrapper(self, library, fndesc, kernel_name, debug, + lineinfo, filename, linenum): + """ + Generate the kernel wrapper in the given ``library``. + The function being wrapped is described by ``fndesc``. + The wrapper function is returned. + """ + + argtypes = fndesc.argtypes + arginfo = self.get_arg_packer(argtypes) + argtys = list(arginfo.argument_types) + wrapfnty = ir.FunctionType(ir.VoidType(), argtys) + wrapper_module = self.create_module("cuda.kernel.wrapper") + fnty = ir.FunctionType(ir.IntType(32), + [self.call_conv.get_return_type(types.pyobject)] + + argtys) + func = ir.Function(wrapper_module, fnty, fndesc.llvm_func_name) + + prefixed = itanium_mangler.prepend_namespace(func.name, ns='cudapy') + wrapfn = ir.Function(wrapper_module, wrapfnty, prefixed) + builder = ir.IRBuilder(wrapfn.append_basic_block('')) + + if debug or lineinfo: + directives_only = lineinfo and not debug + debuginfo = self.DIBuilder(module=wrapper_module, + filepath=filename, + cgctx=self, + directives_only=directives_only) + debuginfo.mark_subprogram( + wrapfn, kernel_name, fndesc.args, argtypes, linenum, + ) + debuginfo.mark_location(builder, linenum) + + # Define error handling variable + def define_error_gv(postfix): + name = wrapfn.name + postfix + gv = cgutils.add_global_variable(wrapper_module, ir.IntType(32), + name) + gv.initializer = ir.Constant(gv.type.pointee, None) + return gv + + gv_exc = define_error_gv("__errcode__") + gv_tid = [] + gv_ctaid = [] + for i in 'xyz': + gv_tid.append(define_error_gv("__tid%s__" % i)) + gv_ctaid.append(define_error_gv("__ctaid%s__" % i)) + + callargs = arginfo.from_arguments(builder, wrapfn.args) + status, _ = self.call_conv.call_function( + builder, func, types.void, argtypes, callargs) + + if debug: + # Check error status + with cgutils.if_likely(builder, status.is_ok): + builder.ret_void() + + with builder.if_then(builder.not_(status.is_python_exc)): + # User exception raised + old = ir.Constant(gv_exc.type.pointee, None) + + # Use atomic cmpxchg to prevent rewriting the error status + # Only the first error is recorded + + xchg = builder.cmpxchg(gv_exc, old, status.code, + 'monotonic', 'monotonic') + changed = builder.extract_value(xchg, 1) + + # If the xchange is successful, save the thread ID. + sreg = nvvmutils.SRegBuilder(builder) + with builder.if_then(changed): + for dim, ptr, in zip("xyz", gv_tid): + val = sreg.tid(dim) + builder.store(val, ptr) + + for dim, ptr, in zip("xyz", gv_ctaid): + val = sreg.ctaid(dim) + builder.store(val, ptr) + + builder.ret_void() + + nvvm.set_cuda_kernel(wrapfn) + library.add_ir_module(wrapper_module) + if debug or lineinfo: + debuginfo.finalize() + library.finalize() + + if config.DUMP_LLVM: + utils.dump_llvm(fndesc, wrapper_module) + + return library.get_function(wrapfn.name) + + def make_constant_array(self, builder, aryty, arr): + """ + Unlike the parent version. This returns a a pointer in the constant + addrspace. + """ + + lmod = builder.module + + constvals = [ + self.get_constant(types.byte, i) + for i in iter(arr.tobytes(order='A')) + ] + constaryty = ir.ArrayType(ir.IntType(8), len(constvals)) + constary = ir.Constant(constaryty, constvals) + + addrspace = nvvm.ADDRSPACE_CONSTANT + gv = cgutils.add_global_variable(lmod, constary.type, "_cudapy_cmem", + addrspace=addrspace) + gv.linkage = 'internal' + gv.global_constant = True + gv.initializer = constary + + # Preserve the underlying alignment + lldtype = self.get_data_type(aryty.dtype) + align = self.get_abi_sizeof(lldtype) + gv.align = 2 ** (align - 1).bit_length() + + # Convert to generic address-space + ptrty = ir.PointerType(ir.IntType(8)) + genptr = builder.addrspacecast(gv, ptrty, 'generic') + + # Create array object + ary = self.make_array(aryty)(self, builder) + kshape = [self.get_constant(types.intp, s) for s in arr.shape] + kstrides = [self.get_constant(types.intp, s) for s in arr.strides] + self.populate_array(ary, data=builder.bitcast(genptr, ary.data.type), + shape=kshape, + strides=kstrides, + itemsize=ary.itemsize, parent=ary.parent, + meminfo=None) + + return ary._getvalue() + + def insert_const_string(self, mod, string): + """ + Unlike the parent version. This returns a a pointer in the constant + addrspace. + """ + text = cgutils.make_bytearray(string.encode("utf-8") + b"\x00") + name = '$'.join(["__conststring__", + itanium_mangler.mangle_identifier(string)]) + # Try to reuse existing global + gv = mod.globals.get(name) + if gv is None: + # Not defined yet + gv = cgutils.add_global_variable(mod, text.type, name, + addrspace=nvvm.ADDRSPACE_CONSTANT) + gv.linkage = 'internal' + gv.global_constant = True + gv.initializer = text + + # Cast to a i8* pointer + charty = gv.type.pointee.element + return gv.bitcast(charty.as_pointer(nvvm.ADDRSPACE_CONSTANT)) + + def insert_string_const_addrspace(self, builder, string): + """ + Insert a constant string in the constant addresspace and return a + generic i8 pointer to the data. + + This function attempts to deduplicate. + """ + lmod = builder.module + gv = self.insert_const_string(lmod, string) + charptrty = ir.PointerType(ir.IntType(8)) + return builder.addrspacecast(gv, charptrty, 'generic') + + def optimize_function(self, func): + """Run O1 function passes + """ + pass + ## XXX skipped for now + # fpm = lp.FunctionPassManager.new(func.module) + # + # lp.PassManagerBuilder.new().populate(fpm) + # + # fpm.initialize() + # fpm.run(func) + # fpm.finalize() + + def get_ufunc_info(self, ufunc_key): + return ufuncs.get_ufunc_info(ufunc_key) + + +class CUDACallConv(MinimalCallConv): + pass + + +class CUDACABICallConv(BaseCallConv): + """ + Calling convention aimed at matching the CUDA C/C++ ABI. The implemented + function signature is: + + () + + Exceptions are unsupported in this convention. + """ + + def _make_call_helper(self, builder): + # Call helpers are used to help report exceptions back to Python, so + # none is required here. + return None + + def return_value(self, builder, retval): + return builder.ret(retval) + + def return_user_exc(self, builder, exc, exc_args=None, loc=None, + func_name=None): + msg = "Python exceptions are unsupported in the CUDA C/C++ ABI" + raise NotImplementedError(msg) + + def return_status_propagate(self, builder, status): + msg = "Return status is unsupported in the CUDA C/C++ ABI" + raise NotImplementedError(msg) + + def get_function_type(self, restype, argtypes): + """ + Get the LLVM IR Function type for *restype* and *argtypes*. + """ + arginfo = self._get_arg_packer(argtypes) + argtypes = list(arginfo.argument_types) + fnty = ir.FunctionType(self.get_return_type(restype), argtypes) + return fnty + + def decorate_function(self, fn, args, fe_argtypes, noalias=False): + """ + Set names and attributes of function arguments. + """ + assert not noalias + arginfo = self._get_arg_packer(fe_argtypes) + arginfo.assign_names(self.get_arguments(fn), + ['arg.' + a for a in args]) + + def get_arguments(self, func): + """ + Get the Python-level arguments of LLVM *func*. + """ + return func.args + + def call_function(self, builder, callee, resty, argtys, args): + """ + Call the Numba-compiled *callee*. + """ + arginfo = self._get_arg_packer(argtys) + realargs = arginfo.as_arguments(builder, args) + code = builder.call(callee, realargs) + # No status required as we don't support exceptions or a distinct None + # value in a C ABI. + status = None + out = self.context.get_returned_value(builder, resty, code) + return status, out + + def get_return_type(self, ty): + return self.context.data_model_manager[ty].get_return_type() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/testing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/testing.py new file mode 100644 index 0000000000000000000000000000000000000000..ae62d3368662c0f8ff43ee403845b66d29410c77 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/testing.py @@ -0,0 +1,202 @@ +import os +import platform +import shutil + +from numba.tests.support import SerialMixin +from numba.cuda.cuda_paths import get_conda_ctk +from numba.cuda.cudadrv import driver, devices, libs +from numba.core import config +from numba.tests.support import TestCase +from pathlib import Path +import unittest + +numba_cuda_dir = Path(__file__).parent +test_data_dir = numba_cuda_dir / 'tests' / 'data' + + +class CUDATestCase(SerialMixin, TestCase): + """ + For tests that use a CUDA device. Test methods in a CUDATestCase must not + be run out of module order, because the ContextResettingTestCase may reset + the context and destroy resources used by a normal CUDATestCase if any of + its tests are run between tests from a CUDATestCase. + """ + + def setUp(self): + self._low_occupancy_warnings = config.CUDA_LOW_OCCUPANCY_WARNINGS + self._warn_on_implicit_copy = config.CUDA_WARN_ON_IMPLICIT_COPY + + # Disable warnings about low gpu utilization in the test suite + config.CUDA_LOW_OCCUPANCY_WARNINGS = 0 + # Disable warnings about host arrays in the test suite + config.CUDA_WARN_ON_IMPLICIT_COPY = 0 + + def tearDown(self): + config.CUDA_LOW_OCCUPANCY_WARNINGS = self._low_occupancy_warnings + config.CUDA_WARN_ON_IMPLICIT_COPY = self._warn_on_implicit_copy + + def skip_if_lto(self, reason): + # Some linkers need the compute capability to be specified, so we + # always specify it here. + cc = devices.get_context().device.compute_capability + linker = driver.Linker.new(cc=cc) + if linker.lto: + self.skipTest(reason) + + +class ContextResettingTestCase(CUDATestCase): + """ + For tests where the context needs to be reset after each test. Typically + these inspect or modify parts of the context that would usually be expected + to be internal implementation details (such as the state of allocations and + deallocations, etc.). + """ + + def tearDown(self): + super().tearDown() + from numba.cuda.cudadrv.devices import reset + reset() + + +def ensure_supported_ccs_initialized(): + from numba.cuda import is_available as cuda_is_available + from numba.cuda.cudadrv import nvvm + + if cuda_is_available(): + # Ensure that cudart.so is loaded and the list of supported compute + # capabilities in the nvvm module is populated before a fork. This is + # needed because some compilation tests don't require a CUDA context, + # but do use NVVM, and it is required that libcudart.so should be + # loaded before a fork (note that the requirement is not explicitly + # documented). + nvvm.get_supported_ccs() + + +def skip_on_cudasim(reason): + """Skip this test if running on the CUDA simulator""" + return unittest.skipIf(config.ENABLE_CUDASIM, reason) + + +def skip_unless_cudasim(reason): + """Skip this test if running on CUDA hardware""" + return unittest.skipUnless(config.ENABLE_CUDASIM, reason) + + +def skip_unless_conda_cudatoolkit(reason): + """Skip test if the CUDA toolkit was not installed by Conda""" + return unittest.skipUnless(get_conda_ctk() is not None, reason) + + +def skip_if_external_memmgr(reason): + """Skip test if an EMM Plugin is in use""" + return unittest.skipIf(config.CUDA_MEMORY_MANAGER != 'default', reason) + + +def skip_under_cuda_memcheck(reason): + return unittest.skipIf(os.environ.get('CUDA_MEMCHECK') is not None, reason) + + +def skip_without_nvdisasm(reason): + nvdisasm_path = shutil.which('nvdisasm') + return unittest.skipIf(nvdisasm_path is None, reason) + + +def skip_with_nvdisasm(reason): + nvdisasm_path = shutil.which('nvdisasm') + return unittest.skipIf(nvdisasm_path is not None, reason) + + +def skip_on_arm(reason): + cpu = platform.processor() + is_arm = cpu.startswith('arm') or cpu.startswith('aarch') + return unittest.skipIf(is_arm, reason) + + +def skip_if_cuda_includes_missing(fn): + # Skip when cuda.h is not available - generally this should indicate + # whether the CUDA includes are available or not + cuda_h = os.path.join(config.CUDA_INCLUDE_PATH, 'cuda.h') + cuda_h_file = (os.path.exists(cuda_h) and os.path.isfile(cuda_h)) + reason = 'CUDA include dir not available on this system' + return unittest.skipUnless(cuda_h_file, reason)(fn) + + +def skip_if_mvc_enabled(reason): + """Skip a test if Minor Version Compatibility is enabled""" + return unittest.skipIf(config.CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY, + reason) + + +def skip_if_mvc_libraries_unavailable(fn): + libs_available = False + try: + import cubinlinker # noqa: F401 + import ptxcompiler # noqa: F401 + libs_available = True + except ImportError: + pass + + return unittest.skipUnless(libs_available, + "Requires cubinlinker and ptxcompiler")(fn) + + +def cc_X_or_above(major, minor): + if not config.ENABLE_CUDASIM: + cc = devices.get_context().device.compute_capability + return cc >= (major, minor) + else: + return True + + +def skip_unless_cc_50(fn): + return unittest.skipUnless(cc_X_or_above(5, 0), "requires cc >= 5.0")(fn) + + +def skip_unless_cc_53(fn): + return unittest.skipUnless(cc_X_or_above(5, 3), "requires cc >= 5.3")(fn) + + +def skip_unless_cc_60(fn): + return unittest.skipUnless(cc_X_or_above(6, 0), "requires cc >= 6.0")(fn) + + +def skip_unless_cc_75(fn): + return unittest.skipUnless(cc_X_or_above(7, 5), "requires cc >= 7.5")(fn) + + +def xfail_unless_cudasim(fn): + if config.ENABLE_CUDASIM: + return fn + else: + return unittest.expectedFailure(fn) + + +def skip_with_cuda_python(reason): + return unittest.skipIf(driver.USE_NV_BINDING, reason) + + +def cudadevrt_missing(): + if config.ENABLE_CUDASIM: + return False + try: + path = libs.get_cudalib('cudadevrt', static=True) + libs.check_static_lib(path) + except FileNotFoundError: + return True + return False + + +def skip_if_cudadevrt_missing(fn): + return unittest.skipIf(cudadevrt_missing(), 'cudadevrt missing')(fn) + + +class ForeignArray(object): + """ + Class for emulating an array coming from another library through the CUDA + Array interface. This just hides a DeviceNDArray so that it doesn't look + like a DeviceNDArray. + """ + + def __init__(self, arr): + self._arr = arr + self.__cuda_array_interface__ = arr.__cuda_array_interface__ diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/types.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/types.py new file mode 100644 index 0000000000000000000000000000000000000000..531dcb2ccb22abcfea9f103df4ddb616728b4ca5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/types.py @@ -0,0 +1,37 @@ +from numba.core import types + + +class Dim3(types.Type): + """ + A 3-tuple (x, y, z) representing the position of a block or thread. + """ + def __init__(self): + super().__init__(name='Dim3') + + +class GridGroup(types.Type): + """ + The grid of all threads in a cooperative kernel launch. + """ + def __init__(self): + super().__init__(name='GridGroup') + + +dim3 = Dim3() +grid_group = GridGroup() + + +class CUDADispatcher(types.Dispatcher): + """The type of CUDA dispatchers""" + # This type exists (instead of using types.Dispatcher as the type of CUDA + # dispatchers) so that we can have an alternative lowering for them to the + # lowering of CPU dispatchers - the CPU target lowers all dispatchers as a + # constant address, but we need to lower to a dummy value because it's not + # generally valid to use the address of CUDA kernels and functions. + # + # Notes: it may be a bug in the CPU target that it lowers all dispatchers to + # a constant address - it should perhaps only lower dispatchers acting as + # first-class functions to a constant address. Even if that bug is fixed, it + # is still probably a good idea to have a separate type for CUDA + # dispatchers, and this type might get other differentiation from the CPU + # dispatcher type in future. diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/ufuncs.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/ufuncs.py new file mode 100644 index 0000000000000000000000000000000000000000..f552370480e3df5d19095351b4cea8b3fc4069d6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/ufuncs.py @@ -0,0 +1,662 @@ +"""Contains information on how to translate different ufuncs for the CUDA +target. It is a database of different ufuncs and how each of its loops maps to +a function that implements the inner kernel of that ufunc (the inner kernel +being the per-element function). + +Use get_ufunc_info() to get the information related to a ufunc. +""" + +import math +import numpy as np +from functools import lru_cache +from numba.core import typing + + +def get_ufunc_info(ufunc_key): + return ufunc_db()[ufunc_key] + + +@lru_cache +def ufunc_db(): + # Imports here are at function scope to avoid circular imports + from numba.cpython import cmathimpl, mathimpl, numbers + from numba.np import npyfuncs + from numba.np.numpy_support import numpy_version + from numba.cuda.mathimpl import (get_unary_impl_for_fn_and_ty, + get_binary_impl_for_fn_and_ty) + + def np_unary_impl(fn, context, builder, sig, args): + npyfuncs._check_arity_and_homogeneity(sig, args, 1) + impl = get_unary_impl_for_fn_and_ty(fn, sig.args[0]) + return impl(context, builder, sig, args) + + def np_binary_impl(fn, context, builder, sig, args): + npyfuncs._check_arity_and_homogeneity(sig, args, 2) + impl = get_binary_impl_for_fn_and_ty(fn, sig.args[0]) + return impl(context, builder, sig, args) + + def np_real_log_impl(context, builder, sig, args): + return np_unary_impl(math.log, context, builder, sig, args) + + def np_real_log2_impl(context, builder, sig, args): + return np_unary_impl(math.log2, context, builder, sig, args) + + def np_real_log10_impl(context, builder, sig, args): + return np_unary_impl(math.log10, context, builder, sig, args) + + def np_real_sin_impl(context, builder, sig, args): + return np_unary_impl(math.sin, context, builder, sig, args) + + def np_real_cos_impl(context, builder, sig, args): + return np_unary_impl(math.cos, context, builder, sig, args) + + def np_real_tan_impl(context, builder, sig, args): + return np_unary_impl(math.tan, context, builder, sig, args) + + def np_real_asin_impl(context, builder, sig, args): + return np_unary_impl(math.asin, context, builder, sig, args) + + def np_real_acos_impl(context, builder, sig, args): + return np_unary_impl(math.acos, context, builder, sig, args) + + def np_real_atan_impl(context, builder, sig, args): + return np_unary_impl(math.atan, context, builder, sig, args) + + def np_real_atan2_impl(context, builder, sig, args): + return np_binary_impl(math.atan2, context, builder, sig, args) + + def np_real_hypot_impl(context, builder, sig, args): + return np_binary_impl(math.hypot, context, builder, sig, args) + + def np_real_sinh_impl(context, builder, sig, args): + return np_unary_impl(math.sinh, context, builder, sig, args) + + def np_complex_sinh_impl(context, builder, sig, args): + # npymath does not provide a complex sinh. The code in funcs.inc.src + # is translated here... + npyfuncs._check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + fty = ty.underlying_float + fsig1 = typing.signature(*[fty] * 2) + x = context.make_complex(builder, ty, args[0]) + out = context.make_complex(builder, ty) + xr = x.real + xi = x.imag + + sxi = np_real_sin_impl(context, builder, fsig1, [xi]) + shxr = np_real_sinh_impl(context, builder, fsig1, [xr]) + cxi = np_real_cos_impl(context, builder, fsig1, [xi]) + chxr = np_real_cosh_impl(context, builder, fsig1, [xr]) + + out.real = builder.fmul(cxi, shxr) + out.imag = builder.fmul(sxi, chxr) + + return out._getvalue() + + def np_real_cosh_impl(context, builder, sig, args): + return np_unary_impl(math.cosh, context, builder, sig, args) + + def np_complex_cosh_impl(context, builder, sig, args): + # npymath does not provide a complex cosh. The code in funcs.inc.src + # is translated here... + npyfuncs._check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + fty = ty.underlying_float + fsig1 = typing.signature(*[fty] * 2) + x = context.make_complex(builder, ty, args[0]) + out = context.make_complex(builder, ty) + xr = x.real + xi = x.imag + + cxi = np_real_cos_impl(context, builder, fsig1, [xi]) + chxr = np_real_cosh_impl(context, builder, fsig1, [xr]) + sxi = np_real_sin_impl(context, builder, fsig1, [xi]) + shxr = np_real_sinh_impl(context, builder, fsig1, [xr]) + + out.real = builder.fmul(cxi, chxr) + out.imag = builder.fmul(sxi, shxr) + + return out._getvalue() + + def np_real_tanh_impl(context, builder, sig, args): + return np_unary_impl(math.tanh, context, builder, sig, args) + + def np_complex_tanh_impl(context, builder, sig, args): + # npymath does not provide complex tan functions. The code + # in funcs.inc.src for tanh is translated here... + npyfuncs._check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + fty = ty.underlying_float + fsig1 = typing.signature(*[fty] * 2) + ONE = context.get_constant(fty, 1.0) + x = context.make_complex(builder, ty, args[0]) + out = context.make_complex(builder, ty) + + xr = x.real + xi = x.imag + si = np_real_sin_impl(context, builder, fsig1, [xi]) + ci = np_real_cos_impl(context, builder, fsig1, [xi]) + shr = np_real_sinh_impl(context, builder, fsig1, [xr]) + chr_ = np_real_cosh_impl(context, builder, fsig1, [xr]) + rs = builder.fmul(ci, shr) + is_ = builder.fmul(si, chr_) + rc = builder.fmul(ci, chr_) + # Note: opposite sign for `ic` from code in funcs.inc.src + ic = builder.fmul(si, shr) + sqr_rc = builder.fmul(rc, rc) + sqr_ic = builder.fmul(ic, ic) + d = builder.fadd(sqr_rc, sqr_ic) + inv_d = builder.fdiv(ONE, d) + rs_rc = builder.fmul(rs, rc) + is_ic = builder.fmul(is_, ic) + is_rc = builder.fmul(is_, rc) + rs_ic = builder.fmul(rs, ic) + numr = builder.fadd(rs_rc, is_ic) + numi = builder.fsub(is_rc, rs_ic) + out.real = builder.fmul(numr, inv_d) + out.imag = builder.fmul(numi, inv_d) + + return out._getvalue() + + def np_real_asinh_impl(context, builder, sig, args): + return np_unary_impl(math.asinh, context, builder, sig, args) + + def np_real_acosh_impl(context, builder, sig, args): + return np_unary_impl(math.acosh, context, builder, sig, args) + + def np_real_atanh_impl(context, builder, sig, args): + return np_unary_impl(math.atanh, context, builder, sig, args) + + db = {} + + db[np.sin] = { + 'f->f': np_real_sin_impl, + 'd->d': np_real_sin_impl, + 'F->F': npyfuncs.np_complex_sin_impl, + 'D->D': npyfuncs.np_complex_sin_impl, + } + + db[np.cos] = { + 'f->f': np_real_cos_impl, + 'd->d': np_real_cos_impl, + 'F->F': npyfuncs.np_complex_cos_impl, + 'D->D': npyfuncs.np_complex_cos_impl, + } + + db[np.tan] = { + 'f->f': np_real_tan_impl, + 'd->d': np_real_tan_impl, + 'F->F': cmathimpl.tan_impl, + 'D->D': cmathimpl.tan_impl, + } + + db[np.arcsin] = { + 'f->f': np_real_asin_impl, + 'd->d': np_real_asin_impl, + 'F->F': cmathimpl.asin_impl, + 'D->D': cmathimpl.asin_impl, + } + + db[np.arccos] = { + 'f->f': np_real_acos_impl, + 'd->d': np_real_acos_impl, + 'F->F': cmathimpl.acos_impl, + 'D->D': cmathimpl.acos_impl, + } + + db[np.arctan] = { + 'f->f': np_real_atan_impl, + 'd->d': np_real_atan_impl, + 'F->F': cmathimpl.atan_impl, + 'D->D': cmathimpl.atan_impl, + } + + db[np.arctan2] = { + 'ff->f': np_real_atan2_impl, + 'dd->d': np_real_atan2_impl, + } + + db[np.hypot] = { + 'ff->f': np_real_hypot_impl, + 'dd->d': np_real_hypot_impl, + } + + db[np.sinh] = { + 'f->f': np_real_sinh_impl, + 'd->d': np_real_sinh_impl, + 'F->F': np_complex_sinh_impl, + 'D->D': np_complex_sinh_impl, + } + + db[np.cosh] = { + 'f->f': np_real_cosh_impl, + 'd->d': np_real_cosh_impl, + 'F->F': np_complex_cosh_impl, + 'D->D': np_complex_cosh_impl, + } + + db[np.tanh] = { + 'f->f': np_real_tanh_impl, + 'd->d': np_real_tanh_impl, + 'F->F': np_complex_tanh_impl, + 'D->D': np_complex_tanh_impl, + } + + db[np.arcsinh] = { + 'f->f': np_real_asinh_impl, + 'd->d': np_real_asinh_impl, + 'F->F': cmathimpl.asinh_impl, + 'D->D': cmathimpl.asinh_impl, + } + + db[np.arccosh] = { + 'f->f': np_real_acosh_impl, + 'd->d': np_real_acosh_impl, + 'F->F': npyfuncs.np_complex_acosh_impl, + 'D->D': npyfuncs.np_complex_acosh_impl, + } + + db[np.arctanh] = { + 'f->f': np_real_atanh_impl, + 'd->d': np_real_atanh_impl, + 'F->F': cmathimpl.atanh_impl, + 'D->D': cmathimpl.atanh_impl, + } + + db[np.deg2rad] = { + 'f->f': mathimpl.radians_float_impl, + 'd->d': mathimpl.radians_float_impl, + } + + db[np.radians] = db[np.deg2rad] + + db[np.rad2deg] = { + 'f->f': mathimpl.degrees_float_impl, + 'd->d': mathimpl.degrees_float_impl, + } + + db[np.degrees] = db[np.rad2deg] + + db[np.greater] = { + '??->?': numbers.int_ugt_impl, + 'bb->?': numbers.int_sgt_impl, + 'BB->?': numbers.int_ugt_impl, + 'hh->?': numbers.int_sgt_impl, + 'HH->?': numbers.int_ugt_impl, + 'ii->?': numbers.int_sgt_impl, + 'II->?': numbers.int_ugt_impl, + 'll->?': numbers.int_sgt_impl, + 'LL->?': numbers.int_ugt_impl, + 'qq->?': numbers.int_sgt_impl, + 'QQ->?': numbers.int_ugt_impl, + 'ff->?': numbers.real_gt_impl, + 'dd->?': numbers.real_gt_impl, + 'FF->?': npyfuncs.np_complex_gt_impl, + 'DD->?': npyfuncs.np_complex_gt_impl, + } + if numpy_version >= (1, 25): + db[np.greater].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('>'), + 'Qq->?': numbers.int_unsigned_signed_cmp('>')}) + + db[np.greater_equal] = { + '??->?': numbers.int_uge_impl, + 'bb->?': numbers.int_sge_impl, + 'BB->?': numbers.int_uge_impl, + 'hh->?': numbers.int_sge_impl, + 'HH->?': numbers.int_uge_impl, + 'ii->?': numbers.int_sge_impl, + 'II->?': numbers.int_uge_impl, + 'll->?': numbers.int_sge_impl, + 'LL->?': numbers.int_uge_impl, + 'qq->?': numbers.int_sge_impl, + 'QQ->?': numbers.int_uge_impl, + 'ff->?': numbers.real_ge_impl, + 'dd->?': numbers.real_ge_impl, + 'FF->?': npyfuncs.np_complex_ge_impl, + 'DD->?': npyfuncs.np_complex_ge_impl, + } + if numpy_version >= (1, 25): + db[np.greater_equal].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('>='), + 'Qq->?': numbers.int_unsigned_signed_cmp('>=')}) + + db[np.less] = { + '??->?': numbers.int_ult_impl, + 'bb->?': numbers.int_slt_impl, + 'BB->?': numbers.int_ult_impl, + 'hh->?': numbers.int_slt_impl, + 'HH->?': numbers.int_ult_impl, + 'ii->?': numbers.int_slt_impl, + 'II->?': numbers.int_ult_impl, + 'll->?': numbers.int_slt_impl, + 'LL->?': numbers.int_ult_impl, + 'qq->?': numbers.int_slt_impl, + 'QQ->?': numbers.int_ult_impl, + 'ff->?': numbers.real_lt_impl, + 'dd->?': numbers.real_lt_impl, + 'FF->?': npyfuncs.np_complex_lt_impl, + 'DD->?': npyfuncs.np_complex_lt_impl, + } + if numpy_version >= (1, 25): + db[np.less].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('<'), + 'Qq->?': numbers.int_unsigned_signed_cmp('<')}) + + db[np.less_equal] = { + '??->?': numbers.int_ule_impl, + 'bb->?': numbers.int_sle_impl, + 'BB->?': numbers.int_ule_impl, + 'hh->?': numbers.int_sle_impl, + 'HH->?': numbers.int_ule_impl, + 'ii->?': numbers.int_sle_impl, + 'II->?': numbers.int_ule_impl, + 'll->?': numbers.int_sle_impl, + 'LL->?': numbers.int_ule_impl, + 'qq->?': numbers.int_sle_impl, + 'QQ->?': numbers.int_ule_impl, + 'ff->?': numbers.real_le_impl, + 'dd->?': numbers.real_le_impl, + 'FF->?': npyfuncs.np_complex_le_impl, + 'DD->?': npyfuncs.np_complex_le_impl, + } + if numpy_version >= (1, 25): + db[np.less_equal].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('<='), + 'Qq->?': numbers.int_unsigned_signed_cmp('<=')}) + + db[np.not_equal] = { + '??->?': numbers.int_ne_impl, + 'bb->?': numbers.int_ne_impl, + 'BB->?': numbers.int_ne_impl, + 'hh->?': numbers.int_ne_impl, + 'HH->?': numbers.int_ne_impl, + 'ii->?': numbers.int_ne_impl, + 'II->?': numbers.int_ne_impl, + 'll->?': numbers.int_ne_impl, + 'LL->?': numbers.int_ne_impl, + 'qq->?': numbers.int_ne_impl, + 'QQ->?': numbers.int_ne_impl, + 'ff->?': numbers.real_ne_impl, + 'dd->?': numbers.real_ne_impl, + 'FF->?': npyfuncs.np_complex_ne_impl, + 'DD->?': npyfuncs.np_complex_ne_impl, + } + if numpy_version >= (1, 25): + db[np.not_equal].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('!='), + 'Qq->?': numbers.int_unsigned_signed_cmp('!=')}) + + db[np.equal] = { + '??->?': numbers.int_eq_impl, + 'bb->?': numbers.int_eq_impl, + 'BB->?': numbers.int_eq_impl, + 'hh->?': numbers.int_eq_impl, + 'HH->?': numbers.int_eq_impl, + 'ii->?': numbers.int_eq_impl, + 'II->?': numbers.int_eq_impl, + 'll->?': numbers.int_eq_impl, + 'LL->?': numbers.int_eq_impl, + 'qq->?': numbers.int_eq_impl, + 'QQ->?': numbers.int_eq_impl, + 'ff->?': numbers.real_eq_impl, + 'dd->?': numbers.real_eq_impl, + 'FF->?': npyfuncs.np_complex_eq_impl, + 'DD->?': npyfuncs.np_complex_eq_impl, + } + if numpy_version >= (1, 25): + db[np.equal].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('=='), + 'Qq->?': numbers.int_unsigned_signed_cmp('==')}) + + db[np.logical_and] = { + '??->?': npyfuncs.np_logical_and_impl, + 'bb->?': npyfuncs.np_logical_and_impl, + 'BB->?': npyfuncs.np_logical_and_impl, + 'hh->?': npyfuncs.np_logical_and_impl, + 'HH->?': npyfuncs.np_logical_and_impl, + 'ii->?': npyfuncs.np_logical_and_impl, + 'II->?': npyfuncs.np_logical_and_impl, + 'll->?': npyfuncs.np_logical_and_impl, + 'LL->?': npyfuncs.np_logical_and_impl, + 'qq->?': npyfuncs.np_logical_and_impl, + 'QQ->?': npyfuncs.np_logical_and_impl, + 'ff->?': npyfuncs.np_logical_and_impl, + 'dd->?': npyfuncs.np_logical_and_impl, + 'FF->?': npyfuncs.np_complex_logical_and_impl, + 'DD->?': npyfuncs.np_complex_logical_and_impl, + } + + db[np.logical_or] = { + '??->?': npyfuncs.np_logical_or_impl, + 'bb->?': npyfuncs.np_logical_or_impl, + 'BB->?': npyfuncs.np_logical_or_impl, + 'hh->?': npyfuncs.np_logical_or_impl, + 'HH->?': npyfuncs.np_logical_or_impl, + 'ii->?': npyfuncs.np_logical_or_impl, + 'II->?': npyfuncs.np_logical_or_impl, + 'll->?': npyfuncs.np_logical_or_impl, + 'LL->?': npyfuncs.np_logical_or_impl, + 'qq->?': npyfuncs.np_logical_or_impl, + 'QQ->?': npyfuncs.np_logical_or_impl, + 'ff->?': npyfuncs.np_logical_or_impl, + 'dd->?': npyfuncs.np_logical_or_impl, + 'FF->?': npyfuncs.np_complex_logical_or_impl, + 'DD->?': npyfuncs.np_complex_logical_or_impl, + } + + db[np.logical_xor] = { + '??->?': npyfuncs.np_logical_xor_impl, + 'bb->?': npyfuncs.np_logical_xor_impl, + 'BB->?': npyfuncs.np_logical_xor_impl, + 'hh->?': npyfuncs.np_logical_xor_impl, + 'HH->?': npyfuncs.np_logical_xor_impl, + 'ii->?': npyfuncs.np_logical_xor_impl, + 'II->?': npyfuncs.np_logical_xor_impl, + 'll->?': npyfuncs.np_logical_xor_impl, + 'LL->?': npyfuncs.np_logical_xor_impl, + 'qq->?': npyfuncs.np_logical_xor_impl, + 'QQ->?': npyfuncs.np_logical_xor_impl, + 'ff->?': npyfuncs.np_logical_xor_impl, + 'dd->?': npyfuncs.np_logical_xor_impl, + 'FF->?': npyfuncs.np_complex_logical_xor_impl, + 'DD->?': npyfuncs.np_complex_logical_xor_impl, + } + + db[np.logical_not] = { + '?->?': npyfuncs.np_logical_not_impl, + 'b->?': npyfuncs.np_logical_not_impl, + 'B->?': npyfuncs.np_logical_not_impl, + 'h->?': npyfuncs.np_logical_not_impl, + 'H->?': npyfuncs.np_logical_not_impl, + 'i->?': npyfuncs.np_logical_not_impl, + 'I->?': npyfuncs.np_logical_not_impl, + 'l->?': npyfuncs.np_logical_not_impl, + 'L->?': npyfuncs.np_logical_not_impl, + 'q->?': npyfuncs.np_logical_not_impl, + 'Q->?': npyfuncs.np_logical_not_impl, + 'f->?': npyfuncs.np_logical_not_impl, + 'd->?': npyfuncs.np_logical_not_impl, + 'F->?': npyfuncs.np_complex_logical_not_impl, + 'D->?': npyfuncs.np_complex_logical_not_impl, + } + + db[np.maximum] = { + '??->?': npyfuncs.np_logical_or_impl, + 'bb->b': npyfuncs.np_int_smax_impl, + 'BB->B': npyfuncs.np_int_umax_impl, + 'hh->h': npyfuncs.np_int_smax_impl, + 'HH->H': npyfuncs.np_int_umax_impl, + 'ii->i': npyfuncs.np_int_smax_impl, + 'II->I': npyfuncs.np_int_umax_impl, + 'll->l': npyfuncs.np_int_smax_impl, + 'LL->L': npyfuncs.np_int_umax_impl, + 'qq->q': npyfuncs.np_int_smax_impl, + 'QQ->Q': npyfuncs.np_int_umax_impl, + 'ff->f': npyfuncs.np_real_maximum_impl, + 'dd->d': npyfuncs.np_real_maximum_impl, + 'FF->F': npyfuncs.np_complex_maximum_impl, + 'DD->D': npyfuncs.np_complex_maximum_impl, + } + + db[np.minimum] = { + '??->?': npyfuncs.np_logical_and_impl, + 'bb->b': npyfuncs.np_int_smin_impl, + 'BB->B': npyfuncs.np_int_umin_impl, + 'hh->h': npyfuncs.np_int_smin_impl, + 'HH->H': npyfuncs.np_int_umin_impl, + 'ii->i': npyfuncs.np_int_smin_impl, + 'II->I': npyfuncs.np_int_umin_impl, + 'll->l': npyfuncs.np_int_smin_impl, + 'LL->L': npyfuncs.np_int_umin_impl, + 'qq->q': npyfuncs.np_int_smin_impl, + 'QQ->Q': npyfuncs.np_int_umin_impl, + 'ff->f': npyfuncs.np_real_minimum_impl, + 'dd->d': npyfuncs.np_real_minimum_impl, + 'FF->F': npyfuncs.np_complex_minimum_impl, + 'DD->D': npyfuncs.np_complex_minimum_impl, + } + + db[np.fmax] = { + '??->?': npyfuncs.np_logical_or_impl, + 'bb->b': npyfuncs.np_int_smax_impl, + 'BB->B': npyfuncs.np_int_umax_impl, + 'hh->h': npyfuncs.np_int_smax_impl, + 'HH->H': npyfuncs.np_int_umax_impl, + 'ii->i': npyfuncs.np_int_smax_impl, + 'II->I': npyfuncs.np_int_umax_impl, + 'll->l': npyfuncs.np_int_smax_impl, + 'LL->L': npyfuncs.np_int_umax_impl, + 'qq->q': npyfuncs.np_int_smax_impl, + 'QQ->Q': npyfuncs.np_int_umax_impl, + 'ff->f': npyfuncs.np_real_fmax_impl, + 'dd->d': npyfuncs.np_real_fmax_impl, + 'FF->F': npyfuncs.np_complex_fmax_impl, + 'DD->D': npyfuncs.np_complex_fmax_impl, + } + + db[np.fmin] = { + '??->?': npyfuncs.np_logical_and_impl, + 'bb->b': npyfuncs.np_int_smin_impl, + 'BB->B': npyfuncs.np_int_umin_impl, + 'hh->h': npyfuncs.np_int_smin_impl, + 'HH->H': npyfuncs.np_int_umin_impl, + 'ii->i': npyfuncs.np_int_smin_impl, + 'II->I': npyfuncs.np_int_umin_impl, + 'll->l': npyfuncs.np_int_smin_impl, + 'LL->L': npyfuncs.np_int_umin_impl, + 'qq->q': npyfuncs.np_int_smin_impl, + 'QQ->Q': npyfuncs.np_int_umin_impl, + 'ff->f': npyfuncs.np_real_fmin_impl, + 'dd->d': npyfuncs.np_real_fmin_impl, + 'FF->F': npyfuncs.np_complex_fmin_impl, + 'DD->D': npyfuncs.np_complex_fmin_impl, + } + + db[np.bitwise_and] = { + '??->?': numbers.int_and_impl, + 'bb->b': numbers.int_and_impl, + 'BB->B': numbers.int_and_impl, + 'hh->h': numbers.int_and_impl, + 'HH->H': numbers.int_and_impl, + 'ii->i': numbers.int_and_impl, + 'II->I': numbers.int_and_impl, + 'll->l': numbers.int_and_impl, + 'LL->L': numbers.int_and_impl, + 'qq->q': numbers.int_and_impl, + 'QQ->Q': numbers.int_and_impl, + } + + db[np.bitwise_or] = { + '??->?': numbers.int_or_impl, + 'bb->b': numbers.int_or_impl, + 'BB->B': numbers.int_or_impl, + 'hh->h': numbers.int_or_impl, + 'HH->H': numbers.int_or_impl, + 'ii->i': numbers.int_or_impl, + 'II->I': numbers.int_or_impl, + 'll->l': numbers.int_or_impl, + 'LL->L': numbers.int_or_impl, + 'qq->q': numbers.int_or_impl, + 'QQ->Q': numbers.int_or_impl, + } + + db[np.bitwise_xor] = { + '??->?': numbers.int_xor_impl, + 'bb->b': numbers.int_xor_impl, + 'BB->B': numbers.int_xor_impl, + 'hh->h': numbers.int_xor_impl, + 'HH->H': numbers.int_xor_impl, + 'ii->i': numbers.int_xor_impl, + 'II->I': numbers.int_xor_impl, + 'll->l': numbers.int_xor_impl, + 'LL->L': numbers.int_xor_impl, + 'qq->q': numbers.int_xor_impl, + 'QQ->Q': numbers.int_xor_impl, + } + + db[np.invert] = { + '?->?': numbers.int_invert_impl, + 'b->b': numbers.int_invert_impl, + 'B->B': numbers.int_invert_impl, + 'h->h': numbers.int_invert_impl, + 'H->H': numbers.int_invert_impl, + 'i->i': numbers.int_invert_impl, + 'I->I': numbers.int_invert_impl, + 'l->l': numbers.int_invert_impl, + 'L->L': numbers.int_invert_impl, + 'q->q': numbers.int_invert_impl, + 'Q->Q': numbers.int_invert_impl, + } + + db[np.left_shift] = { + 'bb->b': numbers.int_shl_impl, + 'BB->B': numbers.int_shl_impl, + 'hh->h': numbers.int_shl_impl, + 'HH->H': numbers.int_shl_impl, + 'ii->i': numbers.int_shl_impl, + 'II->I': numbers.int_shl_impl, + 'll->l': numbers.int_shl_impl, + 'LL->L': numbers.int_shl_impl, + 'qq->q': numbers.int_shl_impl, + 'QQ->Q': numbers.int_shl_impl, + } + + db[np.right_shift] = { + 'bb->b': numbers.int_shr_impl, + 'BB->B': numbers.int_shr_impl, + 'hh->h': numbers.int_shr_impl, + 'HH->H': numbers.int_shr_impl, + 'ii->i': numbers.int_shr_impl, + 'II->I': numbers.int_shr_impl, + 'll->l': numbers.int_shr_impl, + 'LL->L': numbers.int_shr_impl, + 'qq->q': numbers.int_shr_impl, + 'QQ->Q': numbers.int_shr_impl, + } + + db[np.log] = { + 'f->f': np_real_log_impl, + 'd->d': np_real_log_impl, + 'F->F': npyfuncs.np_complex_log_impl, + 'D->D': npyfuncs.np_complex_log_impl, + } + + db[np.log2] = { + 'f->f': np_real_log2_impl, + 'd->d': np_real_log2_impl, + 'F->F': npyfuncs.np_complex_log2_impl, + 'D->D': npyfuncs.np_complex_log2_impl, + } + + db[np.log10] = { + 'f->f': np_real_log10_impl, + 'd->d': np_real_log10_impl, + 'F->F': npyfuncs.np_complex_log10_impl, + 'D->D': npyfuncs.np_complex_log10_impl, + } + + return db diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/vector_types.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/vector_types.py new file mode 100644 index 0000000000000000000000000000000000000000..5174e2b20d389be8e0b7a58534808a56ac742c35 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/vector_types.py @@ -0,0 +1,209 @@ +# CUDA built-in Vector Types +# https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#built-in-vector-types + +from typing import List, Tuple, Dict + +from numba import types +from numba.core import cgutils +from numba.core.extending import make_attribute_wrapper, models, register_model +from numba.core.imputils import Registry as ImplRegistry +from numba.core.typing.templates import ConcreteTemplate +from numba.core.typing.templates import Registry as TypingRegistry +from numba.core.typing.templates import signature +from numba.cuda import stubs +from numba.cuda.errors import CudaLoweringError + +typing_registry = TypingRegistry() +impl_registry = ImplRegistry() + +register = typing_registry.register +register_attr = typing_registry.register_attr +register_global = typing_registry.register_global +lower = impl_registry.lower + + +class VectorType(types.Type): + def __init__(self, name, base_type, attr_names, user_facing_object): + self._base_type = base_type + self._attr_names = attr_names + self._user_facing_object = user_facing_object + super().__init__(name=name) + + @property + def base_type(self): + return self._base_type + + @property + def attr_names(self): + return self._attr_names + + @property + def num_elements(self): + return len(self._attr_names) + + @property + def user_facing_object(self): + return self._user_facing_object + + +def make_vector_type( + name: str, + base_type: types.Type, + attr_names: Tuple[str, ...], + user_facing_object +) -> types.Type: + """Create a vector type. + + Parameters + ---------- + name: str + The name of the type. + base_type: numba.types.Type + The primitive type for each element in the vector. + attr_names: tuple of str + Name for each attribute. + user_facing_object: object + The handle to be used in cuda kernel. + """ + + class _VectorType(VectorType): + """Internal instantiation of VectorType.""" + + pass + + class VectorTypeModel(models.StructModel): + def __init__(self, dmm, fe_type): + members = [(attr_name, base_type) for attr_name in attr_names] + super().__init__(dmm, fe_type, members) + + vector_type = _VectorType(name, base_type, attr_names, user_facing_object) + register_model(_VectorType)(VectorTypeModel) + for attr_name in attr_names: + make_attribute_wrapper(_VectorType, attr_name, attr_name) + + return vector_type + + +def enable_vector_type_ctor( + vector_type: VectorType, overloads: List[List[types.Type]] +): + """Create typing and lowering for vector type constructor. + + Parameters + ---------- + vector_type: VectorType + The type whose constructor to type and lower. + overloads: List of argument types + A list containing different overloads of the constructor. Each base type + in the argument list should either be primitive type or VectorType. + """ + ctor = vector_type.user_facing_object + + @register + class CtorTemplate(ConcreteTemplate): + key = ctor + cases = [signature(vector_type, *arglist) for arglist in overloads] + + register_global(ctor, types.Function(CtorTemplate)) + + # Lowering + + def make_lowering(fml_arg_list): + """Meta function to create a lowering for the constructor. Flattens + the arguments by converting vector_type into load instructions for each + of its attributes. Such as float2 -> float2.x, float2.y. + """ + + def lowering(context, builder, sig, actual_args): + # A list of elements to assign from + source_list = [] + # Convert the list of argument types to a list of load IRs. + for argidx, fml_arg in enumerate(fml_arg_list): + if isinstance(fml_arg, VectorType): + pxy = cgutils.create_struct_proxy(fml_arg)( + context, builder, actual_args[argidx] + ) + source_list += [ + getattr(pxy, attr) for attr in fml_arg.attr_names + ] + else: + # assumed primitive type + source_list.append(actual_args[argidx]) + + if len(source_list) != vector_type.num_elements: + raise CudaLoweringError( + f"Unmatched number of source elements ({len(source_list)}) " + "and target elements ({vector_type.num_elements})." + ) + + out = cgutils.create_struct_proxy(vector_type)(context, builder) + + for attr_name, source in zip(vector_type.attr_names, source_list): + setattr(out, attr_name, source) + return out._getvalue() + + return lowering + + for arglist in overloads: + lowering = make_lowering(arglist) + lower(ctor, *arglist)(lowering) + + +vector_types : Dict[str, VectorType] = {} + + +def build_constructor_overloads(base_type, vty_name, num_elements, arglists, l): + """ + For a given vector type, build a list of overloads for its constructor. + """ + + # TODO: speed up with memoization + if num_elements == 0: + arglists.append(l[:]) + + for i in range(1, num_elements + 1): + if i == 1: + # For 1-element component, it can construct with either a + # primitive type or other 1-element component. + l.append(base_type) + build_constructor_overloads( + base_type, vty_name, num_elements - i, arglists, l + ) + l.pop(-1) + + l.append(vector_types[f"{vty_name[:-1]}1"]) + build_constructor_overloads( + base_type, vty_name, num_elements - i, arglists, l + ) + l.pop(-1) + else: + l.append(vector_types[f"{vty_name[:-1]}{i}"]) + build_constructor_overloads( + base_type, vty_name, num_elements - i, arglists, l + ) + l.pop(-1) + + +def _initialize(): + """ + Construct the vector types, populate `vector_types` dictionary, and + enable the constructors. + """ + vector_type_attribute_names = ("x", "y", "z", "w") + for stub in stubs._vector_type_stubs: + type_name = stub.__name__ + base_type = getattr(types, type_name[:-2]) + num_elements = int(type_name[-1]) + attributes = vector_type_attribute_names[:num_elements] + vector_type = make_vector_type(type_name, base_type, attributes, stub) + vector_types[type_name] = vector_type + + for vty in vector_types.values(): + arglists, l = [], [] + build_constructor_overloads( + vty.base_type, vty.name, vty.num_elements, arglists, l + ) + enable_vector_type_ctor(vty, arglists) + + +_initialize() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/vectorizers.py b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/vectorizers.py new file mode 100644 index 0000000000000000000000000000000000000000..b4c6bcf5d451f05d2d822beaaa1d740e5e91d460 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/cuda/vectorizers.py @@ -0,0 +1,252 @@ +from numba import cuda +from numpy import array as np_array +from numba.cuda import deviceufunc +from numba.cuda.deviceufunc import (UFuncMechanism, GeneralizedUFunc, + GUFuncCallSteps) + + +class CUDAUFuncDispatcher(object): + """ + Invoke the CUDA ufunc specialization for the given inputs. + """ + + def __init__(self, types_to_retty_kernels, pyfunc): + self.functions = types_to_retty_kernels + self.__name__ = pyfunc.__name__ + + def __call__(self, *args, **kws): + """ + *args: numpy arrays or DeviceArrayBase (created by cuda.to_device). + Cannot mix the two types in one call. + + **kws: + stream -- cuda stream; when defined, asynchronous mode is used. + out -- output array. Can be a numpy array or DeviceArrayBase + depending on the input arguments. Type must match + the input arguments. + """ + return CUDAUFuncMechanism.call(self.functions, args, kws) + + def reduce(self, arg, stream=0): + assert len(list(self.functions.keys())[0]) == 2, "must be a binary " \ + "ufunc" + assert arg.ndim == 1, "must use 1d array" + + n = arg.shape[0] + gpu_mems = [] + + if n == 0: + raise TypeError("Reduction on an empty array.") + elif n == 1: # nothing to do + return arg[0] + + # always use a stream + stream = stream or cuda.stream() + with stream.auto_synchronize(): + # transfer memory to device if necessary + if cuda.cudadrv.devicearray.is_cuda_ndarray(arg): + mem = arg + else: + mem = cuda.to_device(arg, stream) + # do reduction + out = self.__reduce(mem, gpu_mems, stream) + # use a small buffer to store the result element + buf = np_array((1,), dtype=arg.dtype) + out.copy_to_host(buf, stream=stream) + + return buf[0] + + def __reduce(self, mem, gpu_mems, stream): + n = mem.shape[0] + if n % 2 != 0: # odd? + fatcut, thincut = mem.split(n - 1) + # prevent freeing during async mode + gpu_mems.append(fatcut) + gpu_mems.append(thincut) + # execute the kernel + out = self.__reduce(fatcut, gpu_mems, stream) + gpu_mems.append(out) + return self(out, thincut, out=out, stream=stream) + else: # even? + left, right = mem.split(n // 2) + # prevent freeing during async mode + gpu_mems.append(left) + gpu_mems.append(right) + # execute the kernel + self(left, right, out=left, stream=stream) + if n // 2 > 1: + return self.__reduce(left, gpu_mems, stream) + else: + return left + + +class _CUDAGUFuncCallSteps(GUFuncCallSteps): + __slots__ = [ + '_stream', + ] + + def __init__(self, nin, nout, args, kwargs): + super().__init__(nin, nout, args, kwargs) + self._stream = kwargs.get('stream', 0) + + def is_device_array(self, obj): + return cuda.is_cuda_array(obj) + + def as_device_array(self, obj): + # We don't want to call as_cuda_array on objects that are already Numba + # device arrays, because this results in exporting the array as a + # Producer then importing it as a Consumer, which causes a + # synchronization on the array's stream (if it has one) by default. + # When we have a Numba device array, we can simply return it. + if cuda.cudadrv.devicearray.is_cuda_ndarray(obj): + return obj + return cuda.as_cuda_array(obj) + + def to_device(self, hostary): + return cuda.to_device(hostary, stream=self._stream) + + def to_host(self, devary, hostary): + out = devary.copy_to_host(hostary, stream=self._stream) + return out + + def allocate_device_array(self, shape, dtype): + return cuda.device_array(shape=shape, dtype=dtype, stream=self._stream) + + def launch_kernel(self, kernel, nelem, args): + kernel.forall(nelem, stream=self._stream)(*args) + + +class CUDAGeneralizedUFunc(GeneralizedUFunc): + def __init__(self, kernelmap, engine, pyfunc): + self.__name__ = pyfunc.__name__ + super().__init__(kernelmap, engine) + + @property + def _call_steps(self): + return _CUDAGUFuncCallSteps + + def _broadcast_scalar_input(self, ary, shape): + return cuda.cudadrv.devicearray.DeviceNDArray(shape=shape, + strides=(0,), + dtype=ary.dtype, + gpu_data=ary.gpu_data) + + def _broadcast_add_axis(self, ary, newshape): + newax = len(newshape) - len(ary.shape) + # Add 0 strides for missing dimension + newstrides = (0,) * newax + ary.strides + return cuda.cudadrv.devicearray.DeviceNDArray(shape=newshape, + strides=newstrides, + dtype=ary.dtype, + gpu_data=ary.gpu_data) + + +class CUDAUFuncMechanism(UFuncMechanism): + """ + Provide CUDA specialization + """ + DEFAULT_STREAM = 0 + + def launch(self, func, count, stream, args): + func.forall(count, stream=stream)(*args) + + def is_device_array(self, obj): + return cuda.is_cuda_array(obj) + + def as_device_array(self, obj): + # We don't want to call as_cuda_array on objects that are already Numba + # device arrays, because this results in exporting the array as a + # Producer then importing it as a Consumer, which causes a + # synchronization on the array's stream (if it has one) by default. + # When we have a Numba device array, we can simply return it. + if cuda.cudadrv.devicearray.is_cuda_ndarray(obj): + return obj + return cuda.as_cuda_array(obj) + + def to_device(self, hostary, stream): + return cuda.to_device(hostary, stream=stream) + + def to_host(self, devary, stream): + return devary.copy_to_host(stream=stream) + + def allocate_device_array(self, shape, dtype, stream): + return cuda.device_array(shape=shape, dtype=dtype, stream=stream) + + def broadcast_device(self, ary, shape): + ax_differs = [ax for ax in range(len(shape)) + if ax >= ary.ndim + or ary.shape[ax] != shape[ax]] + + missingdim = len(shape) - len(ary.shape) + strides = [0] * missingdim + list(ary.strides) + + for ax in ax_differs: + strides[ax] = 0 + + return cuda.cudadrv.devicearray.DeviceNDArray(shape=shape, + strides=strides, + dtype=ary.dtype, + gpu_data=ary.gpu_data) + + +vectorizer_stager_source = ''' +def __vectorized_{name}({args}, __out__): + __tid__ = __cuda__.grid(1) + if __tid__ < __out__.shape[0]: + __out__[__tid__] = __core__({argitems}) +''' + + +class CUDAVectorize(deviceufunc.DeviceVectorize): + def _compile_core(self, sig): + cudevfn = cuda.jit(sig, device=True, inline=True)(self.pyfunc) + return cudevfn, cudevfn.overloads[sig.args].signature.return_type + + def _get_globals(self, corefn): + glbl = self.pyfunc.__globals__.copy() + glbl.update({'__cuda__': cuda, + '__core__': corefn}) + return glbl + + def _compile_kernel(self, fnobj, sig): + return cuda.jit(fnobj) + + def build_ufunc(self): + return CUDAUFuncDispatcher(self.kernelmap, self.pyfunc) + + @property + def _kernel_template(self): + return vectorizer_stager_source + + +# ------------------------------------------------------------------------------ +# Generalized CUDA ufuncs + +_gufunc_stager_source = ''' +def __gufunc_{name}({args}): + __tid__ = __cuda__.grid(1) + if __tid__ < {checkedarg}: + __core__({argitems}) +''' + + +class CUDAGUFuncVectorize(deviceufunc.DeviceGUFuncVectorize): + def build_ufunc(self): + engine = deviceufunc.GUFuncEngine(self.inputsig, self.outputsig) + return CUDAGeneralizedUFunc(kernelmap=self.kernelmap, + engine=engine, + pyfunc=self.pyfunc) + + def _compile_kernel(self, fnobj, sig): + return cuda.jit(sig)(fnobj) + + @property + def _kernel_template(self): + return _gufunc_stager_source + + def _get_globals(self, sig): + corefn = cuda.jit(sig, device=True)(self.pyfunc) + glbls = self.py_func.__globals__.copy() + glbls.update({'__cuda__': cuda, + '__core__': corefn}) + return glbls diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/experimental/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3bc3359e90ec5403f4eb3fd6e4be121a1a7228ce --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/experimental/__init__.py @@ -0,0 +1 @@ +from .jitclass import jitclass \ No newline at end of file diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/experimental/function_type.py b/tool_server/.venv/lib/python3.12/site-packages/numba/experimental/function_type.py new file mode 100644 index 0000000000000000000000000000000000000000..8c8527865ef00afc793c22ebfd045f339ca60d40 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/experimental/function_type.py @@ -0,0 +1,332 @@ +"""Provides Numba type, FunctionType, that makes functions as +instances of a first-class function type. +""" +from functools import partial + +from numba.extending import typeof_impl +from numba.extending import models, register_model +from numba.extending import unbox, NativeValue, box +from numba.core.imputils import lower_constant, lower_cast +from numba.core.ccallback import CFunc +from numba.core import cgutils +from llvmlite import ir +from numba.core import types, errors +from numba.core.types import (FunctionType, UndefinedFunctionType, + FunctionPrototype, WrapperAddressProtocol) +from numba.core.dispatcher import Dispatcher + + +@typeof_impl.register(WrapperAddressProtocol) +@typeof_impl.register(CFunc) +def typeof_function_type(val, c): + if isinstance(val, CFunc): + sig = val._sig + elif isinstance(val, WrapperAddressProtocol): + sig = val.signature() + else: + raise NotImplementedError( + f'function type from {type(val).__name__}') + return FunctionType(sig) + + +@register_model(FunctionPrototype) +class FunctionProtoModel(models.PrimitiveModel): + """FunctionProtoModel describes the signatures of first-class functions + """ + def __init__(self, dmm, fe_type): + if isinstance(fe_type, FunctionType): + ftype = fe_type.ftype + elif isinstance(fe_type, FunctionPrototype): + ftype = fe_type + else: + raise NotImplementedError((type(fe_type))) + retty = dmm.lookup(ftype.rtype).get_value_type() + args = [dmm.lookup(t).get_value_type() for t in ftype.atypes] + be_type = ir.PointerType(ir.FunctionType(retty, args)) + super(FunctionProtoModel, self).__init__(dmm, fe_type, be_type) + + +@register_model(FunctionType) +@register_model(UndefinedFunctionType) +class FunctionModel(models.StructModel): + """FunctionModel holds addresses of function implementations + """ + def __init__(self, dmm, fe_type): + members = [ + # Address of cfunc wrapper function. + # This uses a C callconv and doesn't not support exceptions. + ('c_addr', types.voidptr), + # Address of PyObject* referencing the Python function + # object: + ('py_addr', types.voidptr), + # Address of the underlying function object. + # Calling through this function pointer supports all features of + # regular numba function as it follows the same Numba callconv. + ('jit_addr', types.voidptr), + ] + super(FunctionModel, self).__init__(dmm, fe_type, members) + + +@lower_constant(types.Dispatcher) +def lower_constant_dispatcher(context, builder, typ, pyval): + return context.add_dynamic_addr(builder, id(pyval), + info=type(pyval).__name__) + + +@lower_constant(FunctionType) +def lower_constant_function_type(context, builder, typ, pyval): + typ = typ.get_precise() + + if isinstance(pyval, CFunc): + addr = pyval._wrapper_address + sfunc = cgutils.create_struct_proxy(typ)(context, builder) + sfunc.c_addr = context.add_dynamic_addr(builder, addr, + info=str(typ)) + sfunc.py_addr = context.add_dynamic_addr(builder, id(pyval), + info=type(pyval).__name__) + return sfunc._getvalue() + + if isinstance(pyval, Dispatcher): + sfunc = cgutils.create_struct_proxy(typ)(context, builder) + sfunc.py_addr = context.add_dynamic_addr(builder, id(pyval), + info=type(pyval).__name__) + return sfunc._getvalue() + + if isinstance(pyval, WrapperAddressProtocol): + addr = pyval.__wrapper_address__() + assert typ.check_signature(pyval.signature()) + sfunc = cgutils.create_struct_proxy(typ)(context, builder) + sfunc.c_addr = context.add_dynamic_addr(builder, addr, + info=str(typ)) + sfunc.py_addr = context.add_dynamic_addr(builder, id(pyval), + info=type(pyval).__name__) + return sfunc._getvalue() + + # TODO: implement support for pytypes.FunctionType, ctypes.CFUNCTYPE + raise NotImplementedError( + 'lower_constant_struct_function_type({}, {}, {}, {})' + .format(context, builder, typ, pyval)) + + +def _get_wrapper_address(func, sig): + """Return the address of a compiled cfunc wrapper function of `func`. + + Warning: The compiled function must be compatible with the given + signature `sig`. If it is not, then result of calling the compiled + function is undefined. The compatibility is ensured when passing + in a first-class function to a Numba njit compiled function either + as an argument or via namespace scoping. + + Parameters + ---------- + func : object + A Numba cfunc or jit decoreated function or an object that + implements the wrapper address protocol (see note below). + sig : Signature + The expected function signature. + + Returns + ------- + addr : int + An address in memory (pointer value) of the compiled function + corresponding to the specified signature. + + Note: wrapper address protocol + ------------------------------ + + An object implements the wrapper address protocol iff the object + provides a callable attribute named __wrapper_address__ that takes + a Signature instance as the argument, and returns an integer + representing the address or pointer value of a compiled function + for the given signature. + + """ + if not sig.is_precise(): + # addr==-1 will indicate that no implementation is available + # for cases where type-inference did not identified the + # function type. For example, the type of an unused + # jit-decorated function argument will be undefined but also + # irrelevant. + addr = -1 + elif hasattr(func, '__wrapper_address__'): + # func can be any object that implements the + # __wrapper_address__ protocol. + addr = func.__wrapper_address__() + elif isinstance(func, CFunc): + assert sig == func._sig + addr = func.address + elif isinstance(func, Dispatcher): + cres = func.get_compile_result(sig) + wrapper_name = cres.fndesc.llvm_cfunc_wrapper_name + addr = cres.library.get_pointer_to_function(wrapper_name) + else: + raise NotImplementedError( + f'get wrapper address of {type(func)} instance with {sig!r}') + if not isinstance(addr, int): + raise TypeError( + f'wrapper address must be integer, got {type(addr)} instance') + if addr <= 0 and addr != -1: + raise ValueError(f'wrapper address of {type(func)} instance must be' + f' a positive integer but got {addr} [sig={sig}]') + # print(f'_get_wrapper_address[{func}]({sig=}) -> {addr}') + return addr + + +def _get_jit_address(func, sig): + """Similar to ``_get_wrapper_address()`` but get the `.jit_addr` instead. + """ + if isinstance(func, Dispatcher): + cres = func.get_compile_result(sig) + jit_name = cres.fndesc.llvm_func_name + addr = cres.library.get_pointer_to_function(jit_name) + else: + addr = 0 + if not isinstance(addr, int): + raise TypeError( + f'jit address must be integer, got {type(addr)} instance') + return addr + + +def _lower_get_address(context, builder, func, sig, failure_mode, + *, function_name): + """Low-level call to (func, sig). + + When calling this function, GIL must be acquired. + """ + pyapi = context.get_python_api(builder) + + # Get the cfunc wrapper address. The code below trusts that the + # function numba.function._get_wrapper_address exists and can be + # called with two arguments. However, if an exception is raised in + # the function, then it will be caught and propagated to the + # caller. + + modname = context.insert_const_string(builder.module, __name__) + numba_mod = pyapi.import_module(modname) + numba_func = pyapi.object_getattr_string(numba_mod, function_name) + pyapi.decref(numba_mod) + sig_obj = pyapi.unserialize(pyapi.serialize_object(sig)) + + addr = pyapi.call_function_objargs(numba_func, (func, sig_obj)) + + if failure_mode != 'ignore': + with builder.if_then(cgutils.is_null(builder, addr), likely=False): + # *function_name* has raised an exception, propagate it + # to the caller. + if failure_mode == 'return_exc': + context.call_conv.return_exc(builder) + elif failure_mode == 'return_null': + builder.ret(pyapi.get_null_object()) + else: + raise NotImplementedError(failure_mode) + # else the caller will handle addr == NULL + return addr # new reference or NULL + + +lower_get_wrapper_address = partial( + _lower_get_address, + function_name="_get_wrapper_address", +) + + +lower_get_jit_address = partial( + _lower_get_address, + function_name="_get_jit_address", +) + + +@unbox(FunctionType) +def unbox_function_type(typ, obj, c): + typ = typ.get_precise() + + sfunc = cgutils.create_struct_proxy(typ)(c.context, c.builder) + + addr = lower_get_wrapper_address( + c.context, c.builder, obj, typ.signature, failure_mode='return_null') + sfunc.c_addr = c.pyapi.long_as_voidptr(addr) + c.pyapi.decref(addr) + + llty = c.context.get_value_type(types.voidptr) + sfunc.py_addr = c.builder.ptrtoint(obj, llty) + + addr = lower_get_jit_address( + c.context, c.builder, obj, typ.signature, failure_mode='return_null') + sfunc.jit_addr = c.pyapi.long_as_voidptr(addr) + c.pyapi.decref(addr) + + return NativeValue(sfunc._getvalue()) + + +@box(FunctionType) +def box_function_type(typ, val, c): + typ = typ.get_precise() + + sfunc = cgutils.create_struct_proxy(typ)(c.context, c.builder, value=val) + pyaddr_ptr = cgutils.alloca_once(c.builder, c.pyapi.pyobj) + raw_ptr = c.builder.inttoptr(sfunc.py_addr, c.pyapi.pyobj) + with c.builder.if_then(cgutils.is_null(c.builder, raw_ptr), + likely=False): + cstr = f"first-class function {typ} parent object not set" + c.pyapi.err_set_string("PyExc_MemoryError", cstr) + c.builder.ret(c.pyapi.get_null_object()) + c.builder.store(raw_ptr, pyaddr_ptr) + cfunc = c.builder.load(pyaddr_ptr) + c.pyapi.incref(cfunc) + return cfunc + + +@lower_cast(UndefinedFunctionType, FunctionType) +def lower_cast_function_type_to_function_type( + context, builder, fromty, toty, val): + return val + + +@lower_cast(types.Dispatcher, FunctionType) +def lower_cast_dispatcher_to_function_type(context, builder, fromty, toty, val): + toty = toty.get_precise() + + sig = toty.signature + dispatcher = fromty.dispatcher + llvoidptr = context.get_value_type(types.voidptr) + sfunc = cgutils.create_struct_proxy(toty)(context, builder) + # Always store the python function + sfunc.py_addr = builder.ptrtoint(val, llvoidptr) + + # Attempt to compile the Dispatcher to the expected function type + try: + cres = dispatcher.get_compile_result(sig) + except errors.NumbaError: + cres = None + + # If compilation is successful, we can by-pass using GIL to get the cfunc + if cres is not None: + # Declare cfunc in the current module + wrapper_name = cres.fndesc.llvm_cfunc_wrapper_name + llfnptr = context.get_value_type(toty.ftype) + llfnty = llfnptr.pointee + fn = cgutils.get_or_insert_function( + builder.module, llfnty, wrapper_name, + ) + addr = builder.bitcast(fn, llvoidptr) + # Store the cfunc + sfunc.c_addr = addr + # Store the jit func + fn = context.declare_function(builder.module, cres.fndesc) + sfunc.jit_addr = builder.bitcast(fn, llvoidptr) + # Link-in the dispatcher library + context.active_code_library.add_linking_library(cres.library) + + else: + # Use lower_get_wrapper_address() to get the cfunc + lower_get_wrapper_address + pyapi = context.get_python_api(builder) + + gil_state = pyapi.gil_ensure() + addr = lower_get_wrapper_address( + context, builder, val, toty.signature, + failure_mode='return_exc') + sfunc.c_addr = pyapi.long_as_voidptr(addr) + pyapi.decref(addr) + pyapi.gil_release(gil_state) + + return sfunc._getvalue() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/experimental/structref.py b/tool_server/.venv/lib/python3.12/site-packages/numba/experimental/structref.py new file mode 100644 index 0000000000000000000000000000000000000000..4d63ff4f09e08b21bb0aa50d5840e3190015b6dc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/experimental/structref.py @@ -0,0 +1,384 @@ +"""Utilities for defining a mutable struct. + +A mutable struct is passed by reference; +hence, structref (a reference to a struct). + +""" +from numba import njit +from numba.core import types, imputils, cgutils +from numba.core.datamodel import default_manager, models +from numba.core.extending import ( + infer_getattr, + lower_getattr_generic, + lower_setattr_generic, + box, + unbox, + NativeValue, + intrinsic, + overload, +) +from numba.core.typing.templates import AttributeTemplate + + +class _Utils: + """Internal builder-code utils for structref definitions. + """ + def __init__(self, context, builder, struct_type): + """ + Parameters + ---------- + context : + a numba target context + builder : + a llvmlite IRBuilder + struct_type : numba.core.types.StructRef + """ + self.context = context + self.builder = builder + self.struct_type = struct_type + + def new_struct_ref(self, mi): + """Encapsulate the MemInfo from a `StructRefPayload` in a `StructRef` + """ + context = self.context + builder = self.builder + struct_type = self.struct_type + + st = cgutils.create_struct_proxy(struct_type)(context, builder) + st.meminfo = mi + return st + + def get_struct_ref(self, val): + """Return a helper for accessing a StructRefType + """ + context = self.context + builder = self.builder + struct_type = self.struct_type + + return cgutils.create_struct_proxy(struct_type)( + context, builder, value=val + ) + + def get_data_pointer(self, val): + """Get the data pointer to the payload from a `StructRefType`. + """ + context = self.context + builder = self.builder + struct_type = self.struct_type + + structval = self.get_struct_ref(val) + meminfo = structval.meminfo + data_ptr = context.nrt.meminfo_data(builder, meminfo) + + valtype = struct_type.get_data_type() + model = context.data_model_manager[valtype] + alloc_type = model.get_value_type() + data_ptr = builder.bitcast(data_ptr, alloc_type.as_pointer()) + return data_ptr + + def get_data_struct(self, val): + """Get a getter/setter helper for accessing a `StructRefPayload` + """ + context = self.context + builder = self.builder + struct_type = self.struct_type + + data_ptr = self.get_data_pointer(val) + valtype = struct_type.get_data_type() + dataval = cgutils.create_struct_proxy(valtype)( + context, builder, ref=data_ptr + ) + return dataval + + +def define_attributes(struct_typeclass): + """Define attributes on `struct_typeclass`. + + Defines both setters and getters in jit-code. + + This is called directly in `register()`. + """ + @infer_getattr + class StructAttribute(AttributeTemplate): + key = struct_typeclass + + def generic_resolve(self, typ, attr): + if attr in typ.field_dict: + attrty = typ.field_dict[attr] + return attrty + + @lower_getattr_generic(struct_typeclass) + def struct_getattr_impl(context, builder, typ, val, attr): + utils = _Utils(context, builder, typ) + dataval = utils.get_data_struct(val) + ret = getattr(dataval, attr) + fieldtype = typ.field_dict[attr] + return imputils.impl_ret_borrowed(context, builder, fieldtype, ret) + + @lower_setattr_generic(struct_typeclass) + def struct_setattr_impl(context, builder, sig, args, attr): + [inst_type, val_type] = sig.args + [instance, val] = args + utils = _Utils(context, builder, inst_type) + dataval = utils.get_data_struct(instance) + # cast val to the correct type + field_type = inst_type.field_dict[attr] + casted = context.cast(builder, val, val_type, field_type) + # read old + old_value = getattr(dataval, attr) + # incref new value + context.nrt.incref(builder, val_type, casted) + # decref old value (must be last in case new value is old value) + context.nrt.decref(builder, val_type, old_value) + # write new + setattr(dataval, attr, casted) + + +def define_boxing(struct_type, obj_class): + """Define the boxing & unboxing logic for `struct_type` to `obj_class`. + + Defines both boxing and unboxing. + + - boxing turns an instance of `struct_type` into a PyObject of `obj_class` + - unboxing turns an instance of `obj_class` into an instance of + `struct_type` in jit-code. + + + Use this directly instead of `define_proxy()` when the user does not + want any constructor to be defined. + """ + if struct_type is types.StructRef: + raise ValueError(f"cannot register {types.StructRef}") + + obj_ctor = obj_class._numba_box_ + + @box(struct_type) + def box_struct_ref(typ, val, c): + """ + Convert a raw pointer to a Python int. + """ + utils = _Utils(c.context, c.builder, typ) + struct_ref = utils.get_struct_ref(val) + meminfo = struct_ref.meminfo + + mip_type = types.MemInfoPointer(types.voidptr) + boxed_meminfo = c.box(mip_type, meminfo) + + ctor_pyfunc = c.pyapi.unserialize(c.pyapi.serialize_object(obj_ctor)) + ty_pyobj = c.pyapi.unserialize(c.pyapi.serialize_object(typ)) + + res = c.pyapi.call_function_objargs( + ctor_pyfunc, [ty_pyobj, boxed_meminfo], + ) + c.pyapi.decref(ctor_pyfunc) + c.pyapi.decref(ty_pyobj) + c.pyapi.decref(boxed_meminfo) + return res + + @unbox(struct_type) + def unbox_struct_ref(typ, obj, c): + mi_obj = c.pyapi.object_getattr_string(obj, "_meminfo") + + mip_type = types.MemInfoPointer(types.voidptr) + + mi = c.unbox(mip_type, mi_obj).value + + utils = _Utils(c.context, c.builder, typ) + struct_ref = utils.new_struct_ref(mi) + out = struct_ref._getvalue() + + c.pyapi.decref(mi_obj) + return NativeValue(out) + + +def define_constructor(py_class, struct_typeclass, fields): + """Define the jit-code constructor for `struct_typeclass` using the + Python type `py_class` and the required `fields`. + + Use this instead of `define_proxy()` if the user does not want boxing + logic defined. + """ + # Build source code for the constructor + params = ', '.join(fields) + indent = ' ' * 8 + init_fields_buf = [] + for k in fields: + init_fields_buf.append(f"st.{k} = {k}") + init_fields = f'\n{indent}'.join(init_fields_buf) + + source = f""" +def ctor({params}): + struct_type = struct_typeclass(list(zip({list(fields)}, [{params}]))) + def impl({params}): + st = new(struct_type) + {init_fields} + return st + return impl +""" + + glbs = dict(struct_typeclass=struct_typeclass, new=new) + exec(source, glbs) + ctor = glbs['ctor'] + # Make it an overload + overload(py_class)(ctor) + + +def define_proxy(py_class, struct_typeclass, fields): + """Defines a PyObject proxy for a structref. + + This makes `py_class` a valid constructor for creating a instance of + `struct_typeclass` that contains the members as defined by `fields`. + + Parameters + ---------- + py_class : type + The Python class for constructing an instance of `struct_typeclass`. + struct_typeclass : numba.core.types.Type + The structref type class to bind to. + fields : Sequence[str] + A sequence of field names. + + Returns + ------- + None + """ + define_constructor(py_class, struct_typeclass, fields) + define_boxing(struct_typeclass, py_class) + + +def register(struct_type): + """Register a `numba.core.types.StructRef` for use in jit-code. + + This defines the data-model for lowering an instance of `struct_type`. + This defines attributes accessor and mutator for an instance of + `struct_type`. + + Parameters + ---------- + struct_type : type + A subclass of `numba.core.types.StructRef`. + + Returns + ------- + struct_type : type + Returns the input argument so this can act like a decorator. + + Examples + -------- + + .. code-block:: + + class MyStruct(numba.core.types.StructRef): + ... # the simplest subclass can be empty + + numba.experimental.structref.register(MyStruct) + + """ + if struct_type is types.StructRef: + raise ValueError(f"cannot register {types.StructRef}") + default_manager.register(struct_type, models.StructRefModel) + define_attributes(struct_type) + return struct_type + + +@intrinsic +def new(typingctx, struct_type): + """new(struct_type) + + A jit-code only intrinsic. Used to allocate an **empty** mutable struct. + The fields are zero-initialized and must be set manually after calling + the function. + + Example: + + instance = new(MyStruct) + instance.field = field_value + """ + from numba.experimental.jitclass.base import imp_dtor + + inst_type = struct_type.instance_type + + def codegen(context, builder, signature, args): + # FIXME: mostly the same as jitclass ctor_impl() + model = context.data_model_manager[inst_type.get_data_type()] + alloc_type = model.get_value_type() + alloc_size = context.get_abi_sizeof(alloc_type) + + meminfo = context.nrt.meminfo_alloc_dtor( + builder, + context.get_constant(types.uintp, alloc_size), + imp_dtor(context, builder.module, inst_type), + ) + data_pointer = context.nrt.meminfo_data(builder, meminfo) + data_pointer = builder.bitcast(data_pointer, alloc_type.as_pointer()) + + # Nullify all data + builder.store(cgutils.get_null_value(alloc_type), data_pointer) + + inst_struct = context.make_helper(builder, inst_type) + inst_struct.meminfo = meminfo + + return inst_struct._getvalue() + + sig = inst_type(struct_type) + return sig, codegen + + +class StructRefProxy: + """A PyObject proxy to the Numba allocated structref data structure. + + Notes + ----- + + * Subclasses should not define ``__init__``. + * Subclasses can override ``__new__``. + """ + __slots__ = ('_type', '_meminfo') + + @classmethod + def _numba_box_(cls, ty, mi): + """Called by boxing logic, the conversion of Numba internal + representation into a PyObject. + + Parameters + ---------- + ty : + a Numba type instance. + mi : + a wrapped MemInfoPointer. + + Returns + ------- + instance : + a StructRefProxy instance. + """ + instance = super().__new__(cls) + instance._type = ty + instance._meminfo = mi + return instance + + def __new__(cls, *args): + """Construct a new instance of the structref. + + This takes positional-arguments only due to limitation of the compiler. + The arguments are mapped to ``cls(*args)`` in jit-code. + """ + try: + # use cached ctor if available + ctor = cls.__numba_ctor + except AttributeError: + # lazily define the ctor + @njit + def ctor(*args): + return cls(*args) + # cache it to attribute to avoid recompilation + cls.__numba_ctor = ctor + return ctor(*args) + + @property + def _numba_type_(self): + """Returns the Numba type instance for this structref instance. + + Subclasses should NOT override. + """ + return self._type diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/POST.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/POST.py new file mode 100644 index 0000000000000000000000000000000000000000..2f12e208765538f884123ccd27cd07ec86d1d31c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/POST.py @@ -0,0 +1,34 @@ +""" Numba's POWER ON SELF TEST script. Used by CI to check: +0. That Numba imports ok! +1. That Numba can find an appropriate number of its own tests to run. +2. That Numba can manage to correctly compile and execute at least one thing. +""" +from numba.tests import test_runtests +from numba import njit + + +def _check_runtests(): + test_inst = test_runtests.TestCase() + test_inst.test_default() # will raise an exception if there is a problem + + +def _check_cpu_compilation(): + @njit + def foo(x): + return x + 1 + + result = foo(1) + + if result != 2: + msg = ("Unexpected result from trial compilation. " + f"Expected: 2, Got: {result}.") + raise AssertionError(msg) + + +def check(): + _check_runtests() + _check_cpu_compilation() + + +if __name__ == "__main__": + check() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/appdirs.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/appdirs.py new file mode 100644 index 0000000000000000000000000000000000000000..e4ce1ab5b907cdb6bb0dc9ecc008204cc3749bf0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/appdirs.py @@ -0,0 +1,551 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2005-2010 ActiveState Software Inc. +# Copyright (c) 2013 Eddy Petrișor + +"""Utilities for determining application-specific dirs. + +See for details and usage. +""" +# Dev Notes: +# - MSDN on where to store app data files: +# http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH3194121123120121120120 +# - Mac OS X: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/index.html +# - XDG spec for Un*x: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html + +__version_info__ = (1, 4, 1) +__version__ = '.'.join(map(str, __version_info__)) + + +import sys +import os + +unicode = str + +if sys.platform.startswith('java'): + import platform + os_name = platform.java_ver()[3][0] + if os_name.startswith('Windows'): # "Windows XP", "Windows 7", etc. + system = 'win32' + elif os_name.startswith('Mac'): # "Mac OS X", etc. + system = 'darwin' + else: # "Linux", "SunOS", "FreeBSD", etc. + # Setting this to "linux2" is not ideal, but only Windows or Mac + # are actually checked for and the rest of the module expects + # *sys.platform* style strings. + system = 'linux2' +else: + system = sys.platform + + + +def user_data_dir(appname=None, appauthor=None, version=None, roaming=False): + r"""Return full path to the user-specific data dir for this application. + + "appname" is the name of application. + If None, just the system directory is returned. + "appauthor" (only used on Windows) is the name of the + appauthor or distributing body for this application. Typically + it is the owning company name. This falls back to appname. You may + pass False to disable it. + "version" is an optional version path element to append to the + path. You might want to use this if you want multiple versions + of your app to be able to run independently. If used, this + would typically be ".". + Only applied when appname is present. + "roaming" (boolean, default False) can be set True to use the Windows + roaming appdata directory. That means that for users on a Windows + network setup for roaming profiles, this user data will be + sync'd on login. See + + for a discussion of issues. + + Typical user data directories are: + Mac OS X: ~/Library/Application Support/ + Unix: ~/.local/share/ # or in $XDG_DATA_HOME, if defined + Win XP (not roaming): C:\Documents and Settings\\Application Data\\ + Win XP (roaming): C:\Documents and Settings\\Local Settings\Application Data\\ + Win 7 (not roaming): C:\Users\\AppData\Local\\ + Win 7 (roaming): C:\Users\\AppData\Roaming\\ + + For Unix, we follow the XDG spec and support $XDG_DATA_HOME. + That means, by default "~/.local/share/". + """ + if system == "win32": + if appauthor is None: + appauthor = appname + const = roaming and "CSIDL_APPDATA" or "CSIDL_LOCAL_APPDATA" + path = os.path.normpath(_get_win_folder(const)) + if appname: + if appauthor is not False: + path = os.path.join(path, appauthor, appname) + else: + path = os.path.join(path, appname) + elif system == 'darwin': + path = os.path.expanduser('~/Library/Application Support/') + if appname: + path = os.path.join(path, appname) + else: + path = os.getenv('XDG_DATA_HOME', os.path.expanduser("~/.local/share")) + if appname: + path = os.path.join(path, appname) + if appname and version: + path = os.path.join(path, version) + return path + + +def site_data_dir(appname=None, appauthor=None, version=None, multipath=False): + r"""Return full path to the user-shared data dir for this application. + + "appname" is the name of application. + If None, just the system directory is returned. + "appauthor" (only used on Windows) is the name of the + appauthor or distributing body for this application. Typically + it is the owning company name. This falls back to appname. You may + pass False to disable it. + "version" is an optional version path element to append to the + path. You might want to use this if you want multiple versions + of your app to be able to run independently. If used, this + would typically be ".". + Only applied when appname is present. + "multipath" is an optional parameter only applicable to *nix + which indicates that the entire list of data dirs should be + returned. By default, the first item from XDG_DATA_DIRS is + returned, or '/usr/local/share/', + if XDG_DATA_DIRS is not set + + Typical user data directories are: + Mac OS X: /Library/Application Support/ + Unix: /usr/local/share/ or /usr/share/ + Win XP: C:\Documents and Settings\All Users\Application Data\\ + Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) + Win 7: C:\ProgramData\\ # Hidden, but writeable on Win 7. + + For Unix, this is using the $XDG_DATA_DIRS[0] default. + + WARNING: Do not use this on Windows. See the Vista-Fail note above for why. + """ + if system == "win32": + if appauthor is None: + appauthor = appname + path = os.path.normpath(_get_win_folder("CSIDL_COMMON_APPDATA")) + if appname: + if appauthor is not False: + path = os.path.join(path, appauthor, appname) + else: + path = os.path.join(path, appname) + elif system == 'darwin': + path = os.path.expanduser('/Library/Application Support') + if appname: + path = os.path.join(path, appname) + else: + # XDG default for $XDG_DATA_DIRS + # only first, if multipath is False + path = os.getenv('XDG_DATA_DIRS', + os.pathsep.join(['/usr/local/share', '/usr/share'])) + pathlist = [os.path.expanduser(x.rstrip(os.sep)) for x in path.split(os.pathsep)] + if appname: + if version: + appname = os.path.join(appname, version) + pathlist = [os.sep.join([x, appname]) for x in pathlist] + + if multipath: + path = os.pathsep.join(pathlist) + else: + path = pathlist[0] + return path + + if appname and version: + path = os.path.join(path, version) + return path + + +def user_config_dir(appname=None, appauthor=None, version=None, roaming=False): + r"""Return full path to the user-specific config dir for this application. + + "appname" is the name of application. + If None, just the system directory is returned. + "appauthor" (only used on Windows) is the name of the + appauthor or distributing body for this application. Typically + it is the owning company name. This falls back to appname. You may + pass False to disable it. + "version" is an optional version path element to append to the + path. You might want to use this if you want multiple versions + of your app to be able to run independently. If used, this + would typically be ".". + Only applied when appname is present. + "roaming" (boolean, default False) can be set True to use the Windows + roaming appdata directory. That means that for users on a Windows + network setup for roaming profiles, this user data will be + sync'd on login. See + + for a discussion of issues. + + Typical user data directories are: + Mac OS X: same as user_data_dir + Unix: ~/.config/ # or in $XDG_CONFIG_HOME, if defined + Win *: same as user_data_dir + + For Unix, we follow the XDG spec and support $XDG_CONFIG_HOME. + That means, by default "~/.config/". + """ + if system in ["win32", "darwin"]: + path = user_data_dir(appname, appauthor, None, roaming) + else: + path = os.getenv('XDG_CONFIG_HOME', os.path.expanduser("~/.config")) + if appname: + path = os.path.join(path, appname) + if appname and version: + path = os.path.join(path, version) + return path + + +def site_config_dir(appname=None, appauthor=None, version=None, multipath=False): + r"""Return full path to the user-shared data dir for this application. + + "appname" is the name of application. + If None, just the system directory is returned. + "appauthor" (only used on Windows) is the name of the + appauthor or distributing body for this application. Typically + it is the owning company name. This falls back to appname. You may + pass False to disable it. + "version" is an optional version path element to append to the + path. You might want to use this if you want multiple versions + of your app to be able to run independently. If used, this + would typically be ".". + Only applied when appname is present. + "multipath" is an optional parameter only applicable to *nix + which indicates that the entire list of config dirs should be + returned. By default, the first item from XDG_CONFIG_DIRS is + returned, or '/etc/xdg/', if XDG_CONFIG_DIRS is not set + + Typical user data directories are: + Mac OS X: same as site_data_dir + Unix: /etc/xdg/ or $XDG_CONFIG_DIRS[i]/ for each value in + $XDG_CONFIG_DIRS + Win *: same as site_data_dir + Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) + + For Unix, this is using the $XDG_CONFIG_DIRS[0] default, if multipath=False + + WARNING: Do not use this on Windows. See the Vista-Fail note above for why. + """ + if system in ["win32", "darwin"]: + path = site_data_dir(appname, appauthor) + if appname and version: + path = os.path.join(path, version) + else: + # XDG default for $XDG_CONFIG_DIRS + # only first, if multipath is False + path = os.getenv('XDG_CONFIG_DIRS', '/etc/xdg') + pathlist = [os.path.expanduser(x.rstrip(os.sep)) for x in path.split(os.pathsep)] + if appname: + if version: + appname = os.path.join(appname, version) + pathlist = [os.sep.join([x, appname]) for x in pathlist] + + if multipath: + path = os.pathsep.join(pathlist) + else: + path = pathlist[0] + return path + + +def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True): + r"""Return full path to the user-specific cache dir for this application. + + "appname" is the name of application. + If None, just the system directory is returned. + "appauthor" (only used on Windows) is the name of the + appauthor or distributing body for this application. Typically + it is the owning company name. This falls back to appname. You may + pass False to disable it. + "version" is an optional version path element to append to the + path. You might want to use this if you want multiple versions + of your app to be able to run independently. If used, this + would typically be ".". + Only applied when appname is present. + "opinion" (boolean) can be False to disable the appending of + "Cache" to the base app data dir for Windows. See + discussion below. + + Typical user cache directories are: + Mac OS X: ~/Library/Caches/ + Unix: ~/.cache/ (XDG default) + Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Cache + Vista: C:\Users\\AppData\Local\\\Cache + + On Windows the only suggestion in the MSDN docs is that local settings go in + the `CSIDL_LOCAL_APPDATA` directory. This is identical to the non-roaming + app data dir (the default returned by `user_data_dir` above). Apps typically + put cache data somewhere *under* the given dir here. Some examples: + ...\Mozilla\Firefox\Profiles\\Cache + ...\Acme\SuperApp\Cache\1.0 + OPINION: This function appends "Cache" to the `CSIDL_LOCAL_APPDATA` value. + This can be disabled with the `opinion=False` option. + """ + if system == "win32": + if appauthor is None: + appauthor = appname + path = os.path.normpath(_get_win_folder("CSIDL_LOCAL_APPDATA")) + if appname: + if appauthor is not False: + path = os.path.join(path, appauthor, appname) + else: + path = os.path.join(path, appname) + if opinion: + path = os.path.join(path, "Cache") + elif system == 'darwin': + path = os.path.expanduser('~/Library/Caches') + if appname: + path = os.path.join(path, appname) + else: + path = os.getenv('XDG_CACHE_HOME', os.path.expanduser('~/.cache')) + if appname: + path = os.path.join(path, appname) + if appname and version: + path = os.path.join(path, version) + return path + + +def user_log_dir(appname=None, appauthor=None, version=None, opinion=True): + r"""Return full path to the user-specific log dir for this application. + + "appname" is the name of application. + If None, just the system directory is returned. + "appauthor" (only used on Windows) is the name of the + appauthor or distributing body for this application. Typically + it is the owning company name. This falls back to appname. You may + pass False to disable it. + "version" is an optional version path element to append to the + path. You might want to use this if you want multiple versions + of your app to be able to run independently. If used, this + would typically be ".". + Only applied when appname is present. + "opinion" (boolean) can be False to disable the appending of + "Logs" to the base app data dir for Windows, and "log" to the + base cache dir for Unix. See discussion below. + + Typical user cache directories are: + Mac OS X: ~/Library/Logs/ + Unix: ~/.cache//log # or under $XDG_CACHE_HOME if defined + Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Logs + Vista: C:\Users\\AppData\Local\\\Logs + + On Windows the only suggestion in the MSDN docs is that local settings + go in the `CSIDL_LOCAL_APPDATA` directory. (Note: I'm interested in + examples of what some windows apps use for a logs dir.) + + OPINION: This function appends "Logs" to the `CSIDL_LOCAL_APPDATA` + value for Windows and appends "log" to the user cache dir for Unix. + This can be disabled with the `opinion=False` option. + """ + if system == "darwin": + path = os.path.join( + os.path.expanduser('~/Library/Logs'), + appname) + elif system == "win32": + path = user_data_dir(appname, appauthor, version) + version = False + if opinion: + path = os.path.join(path, "Logs") + else: + path = user_cache_dir(appname, appauthor, version) + version = False + if opinion: + path = os.path.join(path, "log") + if appname and version: + path = os.path.join(path, version) + return path + + +class AppDirs(object): + """Convenience wrapper for getting application dirs.""" + def __init__(self, appname, appauthor=None, version=None, roaming=False, + multipath=False): + self.appname = appname + self.appauthor = appauthor + self.version = version + self.roaming = roaming + self.multipath = multipath + + @property + def user_data_dir(self): + return user_data_dir(self.appname, self.appauthor, + version=self.version, roaming=self.roaming) + + @property + def site_data_dir(self): + return site_data_dir(self.appname, self.appauthor, + version=self.version, multipath=self.multipath) + + @property + def user_config_dir(self): + return user_config_dir(self.appname, self.appauthor, + version=self.version, roaming=self.roaming) + + @property + def site_config_dir(self): + return site_config_dir(self.appname, self.appauthor, + version=self.version, multipath=self.multipath) + + @property + def user_cache_dir(self): + return user_cache_dir(self.appname, self.appauthor, + version=self.version) + + @property + def user_log_dir(self): + return user_log_dir(self.appname, self.appauthor, + version=self.version) + + +#---- internal support stuff + +def _get_win_folder_from_registry(csidl_name): + """This is a fallback technique at best. I'm not sure if using the + registry for this guarantees us the correct answer for all CSIDL_* + names. + """ + import winreg as _winreg + + shell_folder_name = { + "CSIDL_APPDATA": "AppData", + "CSIDL_COMMON_APPDATA": "Common AppData", + "CSIDL_LOCAL_APPDATA": "Local AppData", + }[csidl_name] + + key = _winreg.OpenKey( + _winreg.HKEY_CURRENT_USER, + r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" + ) + dir, type = _winreg.QueryValueEx(key, shell_folder_name) + return dir + + +def _get_win_folder_with_pywin32(csidl_name): + from win32com.shell import shellcon, shell + dir = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0) + # Try to make this a unicode path because SHGetFolderPath does + # not return unicode strings when there is unicode data in the + # path. + try: + dir = unicode(dir) + + # Downgrade to short path name if have highbit chars. See + # . + has_high_char = False + for c in dir: + if ord(c) > 255: + has_high_char = True + break + if has_high_char: + try: + import win32api + dir = win32api.GetShortPathName(dir) + except ImportError: + pass + except UnicodeError: + pass + return dir + + +def _get_win_folder_with_ctypes(csidl_name): + import ctypes + + csidl_const = { + "CSIDL_APPDATA": 26, + "CSIDL_COMMON_APPDATA": 35, + "CSIDL_LOCAL_APPDATA": 28, + }[csidl_name] + + buf = ctypes.create_unicode_buffer(1024) + ctypes.windll.shell32.SHGetFolderPathW(None, csidl_const, None, 0, buf) + + # Downgrade to short path name if have highbit chars. See + # . + has_high_char = False + for c in buf: + if ord(c) > 255: + has_high_char = True + break + if has_high_char: + buf2 = ctypes.create_unicode_buffer(1024) + if ctypes.windll.kernel32.GetShortPathNameW(buf.value, buf2, 1024): + buf = buf2 + + return buf.value + +def _get_win_folder_with_jna(csidl_name): + import array + from com.sun import jna + from com.sun.jna.platform import win32 + + buf_size = win32.WinDef.MAX_PATH * 2 + buf = array.zeros('c', buf_size) + shell = win32.Shell32.INSTANCE + shell.SHGetFolderPath(None, getattr(win32.ShlObj, csidl_name), None, win32.ShlObj.SHGFP_TYPE_CURRENT, buf) + dir = jna.Native.toString(buf.tostring()).rstrip("\0") + + # Downgrade to short path name if have highbit chars. See + # . + has_high_char = False + for c in dir: + if ord(c) > 255: + has_high_char = True + break + if has_high_char: + buf = array.zeros('c', buf_size) + kernel = win32.Kernel32.INSTANCE + if kernel.GetShortPathName(dir, buf, buf_size): + dir = jna.Native.toString(buf.tostring()).rstrip("\0") + + return dir + +if system == "win32": + try: + import win32com.shell + _get_win_folder = _get_win_folder_with_pywin32 + except ImportError: + try: + from ctypes import windll + _get_win_folder = _get_win_folder_with_ctypes + except ImportError: + try: + import com.sun.jna + _get_win_folder = _get_win_folder_with_jna + except ImportError: + _get_win_folder = _get_win_folder_from_registry + + +#---- self test code + +if __name__ == "__main__": + appname = "MyApp" + appauthor = "MyCompany" + + props = ("user_data_dir", "site_data_dir", + "user_config_dir", "site_config_dir", + "user_cache_dir", "user_log_dir") + + print("-- app dirs %s --" % __version__) + + print("-- app dirs (with optional 'version')") + dirs = AppDirs(appname, appauthor, version="1.0") + for prop in props: + print("%s: %s" % (prop, getattr(dirs, prop))) + + print("\n-- app dirs (without optional 'version')") + dirs = AppDirs(appname, appauthor) + for prop in props: + print("%s: %s" % (prop, getattr(dirs, prop))) + + print("\n-- app dirs (without optional 'appauthor')") + dirs = AppDirs(appname) + for prop in props: + print("%s: %s" % (prop, getattr(dirs, prop))) + + print("\n-- app dirs (with disabled 'appauthor')") + dirs = AppDirs(appname, appauthor=False) + for prop in props: + print("%s: %s" % (prop, getattr(dirs, prop))) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/cffiimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/cffiimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..2266465666fc490c970c76bd967feace6498549c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/cffiimpl.py @@ -0,0 +1,22 @@ +""" +Implementation of some CFFI functions +""" + + +from numba.core.imputils import Registry +from numba.core import types +from numba.np import arrayobj + +registry = Registry('cffiimpl') + +@registry.lower('ffi.from_buffer', types.Buffer) +def from_buffer(context, builder, sig, args): + assert len(sig.args) == 1 + assert len(args) == 1 + [fromty] = sig.args + [val] = args + # Type inference should have prevented passing a buffer from an + # array to a pointer of the wrong type + assert fromty.dtype == sig.return_type.dtype + ary = arrayobj.make_array(fromty)(context, builder, val) + return ary.data diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/cmdlang.gdb b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/cmdlang.gdb new file mode 100644 index 0000000000000000000000000000000000000000..f5c1eed2c015f6e8196aabb4fb478c1fabecd0e5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/cmdlang.gdb @@ -0,0 +1,5 @@ +# this file is used with the numba.gdb* functionality +break numba_gdb_breakpoint +commands +return +end diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/coverage_support.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/coverage_support.py new file mode 100644 index 0000000000000000000000000000000000000000..41f3c10e9e9132dc5d6d56c965ae8fb6a9963688 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/coverage_support.py @@ -0,0 +1,103 @@ +""" +Implement code coverage support. + +Currently contains logic to extend ``coverage`` with lines covered by the +compiler. +""" +from typing import Optional, Sequence, Callable, no_type_check +from collections import defaultdict +from abc import ABC, abstractmethod +import atexit +from functools import cache + +from numba.core import ir, config + + +try: + import coverage +except ImportError: + coverage_available = False +else: + coverage_available = True + + +@no_type_check +def get_active_coverage(): + """Get active coverage instance or return None if not found. + """ + cov = None + if coverage_available: + cov = coverage.Coverage.current() + return cov + + +_the_registry: Callable[[], Optional["NotifyLocBase"]] = [] + + +def get_registered_loc_notify() -> Sequence["NotifyLocBase"]: + """ + Returns a list of the registered NotifyLocBase instances. + """ + if not config.JIT_COVERAGE: + # Coverage disabled. + return [] + return list(filter(lambda x: x is not None, + (factory() for factory in _the_registry))) + + +@cache +def _get_coverage_data(): + """ + Make a singleton ``CoverageData``. + Avoid writing to disk. Other processes can corrupt the file. + """ + covdata = coverage.CoverageData(no_disk=True) + cov = get_active_coverage() + assert cov is not None, "no active Coverage instance" + + @atexit.register + def _finalize(): + # Update active coverage + cov.get_data().update(covdata) + + return covdata + + +class NotifyLocBase(ABC): + """Interface for notifying visiting of a ``numba.core.ir.Loc``. + """ + @abstractmethod + def notify(self, loc: ir.Loc) -> None: + pass + + @abstractmethod + def close(self) -> None: + pass + + +class NotifyCompilerCoverage(NotifyLocBase): + """ + Use to notify ``coverage`` about compiled lines. + + The compiled lines are under the "numba_compiled" context in the coverage + data. + """ + def __init__(self): + self._arcs_data = defaultdict(set) + + def notify(self, loc: ir.Loc): + if loc.filename.endswith(".py"): + # The compiler doesn't actually know about arc. + self._arcs_data[loc.filename].add((loc.line, loc.line)) + + def close(self): + covdata = _get_coverage_data() + with covdata._lock: + covdata.set_context("numba_compiled") + covdata.add_arcs(self._arcs_data) + + +@_the_registry.append +def _register_coverage_notifier(): + if get_active_coverage() is not None: + return NotifyCompilerCoverage() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/dump_style.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/dump_style.py new file mode 100644 index 0000000000000000000000000000000000000000..95b5ed5be5b126e6f4662e073f776c232a4e046c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/dump_style.py @@ -0,0 +1,84 @@ +try: + from pygments.styles.default import DefaultStyle +except ImportError: + msg = "Please install pygments to see highlighted dumps" + raise ImportError(msg) + +import numba.core.config +from pygments.styles.manni import ManniStyle +from pygments.styles.monokai import MonokaiStyle +from pygments.styles.native import NativeStyle + +from pygments.lexer import RegexLexer, include, bygroups, words +from pygments.token import Text, Name, String, Punctuation, Keyword, \ + Operator, Number + +from pygments.style import Style + + +class NumbaIRLexer(RegexLexer): + """ + Pygments style lexer for Numba IR (for use with highlighting etc). + """ + name = 'Numba_IR' + aliases = ['numba_ir'] + filenames = ['*.numba_ir'] + + identifier = r'\$[a-zA-Z0-9._]+' + fun_or_var = r'([a-zA-Z_]+[a-zA-Z0-9]*)' + + tokens = { + 'root' : [ + (r'(label)(\ [0-9]+)(:)$', + bygroups(Keyword, Name.Label, Punctuation)), + + (r' = ', Operator), + include('whitespace'), + include('keyword'), + + (identifier, Name.Variable), + (fun_or_var + r'(\()', + bygroups(Name.Function, Punctuation)), + (fun_or_var + r'(\=)', + bygroups(Name.Attribute, Punctuation)), + (fun_or_var, Name.Constant), + (r'[0-9]+', Number), + + # + (r'<[^>\n]*>', String), + + (r'[=<>{}\[\]()*.,!\':]|x\b', Punctuation) + ], + + 'keyword':[ + (words(( + 'del', 'jump', 'call', 'branch', + ), suffix=' '), Keyword), + ], + + 'whitespace': [ + (r'(\n|\s)', Text), + ], + } + + +def by_colorscheme(): + """ + Get appropriate style for highlighting according to + NUMBA_COLOR_SCHEME setting + """ + styles = DefaultStyle.styles.copy() + styles.update({ + Name.Variable: "#888888", + }) + custom_default = type('CustomDefaultStyle', (Style, ), {'styles': styles}) + + style_map = { + 'no_color' : custom_default, + 'dark_bg' : MonokaiStyle, + 'light_bg' : ManniStyle, + 'blue_bg' : NativeStyle, + 'jupyter_nb' : DefaultStyle, + } + + return style_map[numba.core.config.COLOR_SCHEME] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/findlib.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/findlib.py new file mode 100644 index 0000000000000000000000000000000000000000..3b48ab5706d69f57791c975e7288125bb24a7f8a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/findlib.py @@ -0,0 +1,63 @@ +import sys +import os +import re + + +def get_lib_dirs(): + """ + Anaconda specific + """ + if sys.platform == 'win32': + # on windows, historically `DLLs` has been used for CUDA libraries, + # since approximately CUDA 9.2, `Library\bin` has been used. + dirnames = ['DLLs', os.path.join('Library', 'bin')] + else: + dirnames = ['lib', ] + libdirs = [os.path.join(sys.prefix, x) for x in dirnames] + return libdirs + + +DLLNAMEMAP = { + 'linux': r'lib%(name)s\.so\.%(ver)s$', + 'linux2': r'lib%(name)s\.so\.%(ver)s$', + 'linux-static': r'lib%(name)s\.a$', + 'darwin': r'lib%(name)s\.%(ver)s\.dylib$', + 'win32': r'%(name)s%(ver)s\.dll$', + 'win32-static': r'%(name)s\.lib$', + 'bsd': r'lib%(name)s\.so\.%(ver)s$', +} + +RE_VER = r'[0-9]*([_\.][0-9]+)*' + + +def find_lib(libname, libdir=None, platform=None, static=False): + platform = platform or sys.platform + platform = 'bsd' if 'bsd' in platform else platform + if static: + platform = f"{platform}-static" + if platform not in DLLNAMEMAP: + # Return empty list if platform name is undefined. + # Not all platforms define their static library paths. + return [] + pat = DLLNAMEMAP[platform] % {"name": libname, "ver": RE_VER} + regex = re.compile(pat) + return find_file(regex, libdir) + + +def find_file(pat, libdir=None): + if libdir is None: + libdirs = get_lib_dirs() + elif isinstance(libdir, str): + libdirs = [libdir,] + else: + libdirs = list(libdir) + files = [] + for ldir in libdirs: + try: + entries = os.listdir(ldir) + except FileNotFoundError: + continue + candidates = [os.path.join(ldir, ent) + for ent in entries if pat.match(ent)] + files.extend([c for c in candidates if os.path.isfile(c)]) + return files diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/firstlinefinder.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/firstlinefinder.py new file mode 100644 index 0000000000000000000000000000000000000000..83558d58ee17fa2a300755b53c51ba34a72b4fb5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/firstlinefinder.py @@ -0,0 +1,92 @@ +""" +This module provides helper functions to find the first line of a function +body. +""" + +import ast + + +class FindDefFirstLine(ast.NodeVisitor): + """ + Attributes + ---------- + first_stmt_line : int or None + This stores the first statement line number if the definition is found. + Or, ``None`` if the definition is not found. + """ + + def __init__(self, code): + """ + Parameters + ---------- + code : + The function's code object. + """ + self._co_name = code.co_name + self._co_firstlineno = code.co_firstlineno + self.first_stmt_line = None + + def _visit_children(self, node): + for child in ast.iter_child_nodes(node): + super().visit(child) + + def visit_FunctionDef(self, node: ast.FunctionDef): + if node.name == self._co_name: + # Name of function matches. + + # The `def` line may match co_firstlineno. + possible_start_lines = set([node.lineno]) + if node.decorator_list: + # Has decorators. + # The first decorator line may match co_firstlineno. + first_decor = node.decorator_list[0] + possible_start_lines.add(first_decor.lineno) + # Does the first lineno match? + if self._co_firstlineno in possible_start_lines: + # Yes, we found the function. + # So, use the first statement line as the first line. + if node.body: + first_stmt = node.body[0] + if _is_docstring(first_stmt): + # Skip docstring + first_stmt = node.body[1] + self.first_stmt_line = first_stmt.lineno + return + else: + # This is probably unreachable. + # Function body cannot be bare. It must at least have + # A const string for docstring or a `pass`. + pass + self._visit_children(node) + + +def _is_docstring(node): + if isinstance(node, ast.Expr): + if (isinstance(node.value, ast.Constant) + and isinstance(node.value.value, str)): + return True + return False + + +def get_func_body_first_lineno(pyfunc): + """ + Look up the first line of function body using the file in + ``pyfunc.__code__.co_filename``. + + Returns + ------- + lineno : int; or None + The first line number of the function body; or ``None`` if the first + line cannot be determined. + """ + co = pyfunc.__code__ + try: + with open(co.co_filename) as fin: + file_content = fin.read() + except (FileNotFoundError, OSError): + return + else: + tree = ast.parse(file_content) + finder = FindDefFirstLine(co) + finder.visit(tree) + return finder.first_stmt_line diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/gdb_hook.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/gdb_hook.py new file mode 100644 index 0000000000000000000000000000000000000000..2ae877ec5d3f56ec8707fab6c81f6f248eb67484 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/gdb_hook.py @@ -0,0 +1,228 @@ +import os +import sys + +from llvmlite import ir + +from numba.core import types, utils, config, cgutils, errors +from numba import gdb, gdb_init, gdb_breakpoint +from numba.core.extending import overload, intrinsic + +_path = os.path.dirname(__file__) + +_platform = sys.platform +_unix_like = (_platform.startswith('linux') or + _platform.startswith('darwin') or + ('bsd' in _platform)) + + +def _confirm_gdb(need_ptrace_attach=True): + """ + Set need_ptrace_attach to True/False to indicate whether the ptrace attach + permission is needed for this gdb use case. Mode 0 (classic) or 1 + (restricted ptrace) is required if need_ptrace_attach is True. See: + https://www.kernel.org/doc/Documentation/admin-guide/LSM/Yama.rst + for details on the modes. + """ + if not _unix_like: + msg = 'gdb support is only available on unix-like systems' + raise errors.NumbaRuntimeError(msg) + gdbloc = config.GDB_BINARY + if not (os.path.exists(gdbloc) and os.path.isfile(gdbloc)): + msg = ('Is gdb present? Location specified (%s) does not exist. The gdb' + ' binary location can be set using Numba configuration, see: ' + 'https://numba.readthedocs.io/en/stable/reference/envvars.html' # noqa: E501 + ) + raise RuntimeError(msg % config.GDB_BINARY) + # Is Yama being used as a kernel security module and if so is ptrace_scope + # limited? In this case ptracing non-child processes requires special + # permission so raise an exception. + ptrace_scope_file = os.path.join(os.sep, 'proc', 'sys', 'kernel', 'yama', + 'ptrace_scope') + has_ptrace_scope = os.path.exists(ptrace_scope_file) + if has_ptrace_scope: + with open(ptrace_scope_file, 'rt') as f: + value = f.readline().strip() + if need_ptrace_attach and value not in ("0", "1"): + msg = ("gdb can launch but cannot attach to the executing program" + " because ptrace permissions have been restricted at the " + "system level by the Linux security module 'Yama'.\n\n" + "Documentation for this module and the security " + "implications of making changes to its behaviour can be " + "found in the Linux Kernel documentation " + "https://www.kernel.org/doc/Documentation/admin-guide/LSM/Yama.rst" # noqa: E501 + "\n\nDocumentation on how to adjust the behaviour of Yama " + "on Ubuntu Linux with regards to 'ptrace_scope' can be " + "found here " + "https://wiki.ubuntu.com/Security/Features#ptrace.") + raise RuntimeError(msg) + + +@overload(gdb) +def hook_gdb(*args): + _confirm_gdb() + gdbimpl = gen_gdb_impl(args, True) + + def impl(*args): + gdbimpl() + return impl + + +@overload(gdb_init) +def hook_gdb_init(*args): + _confirm_gdb() + gdbimpl = gen_gdb_impl(args, False) + + def impl(*args): + gdbimpl() + return impl + + +def init_gdb_codegen(cgctx, builder, signature, args, + const_args, do_break=False): + + int8_t = ir.IntType(8) + int32_t = ir.IntType(32) + intp_t = ir.IntType(utils.MACHINE_BITS) + char_ptr = ir.PointerType(ir.IntType(8)) + zero_i32t = int32_t(0) + + mod = builder.module + pid = cgutils.alloca_once(builder, int32_t, size=1) + + # 32bit pid, 11 char max + terminator + pidstr = cgutils.alloca_once(builder, int8_t, size=12) + + # str consts + intfmt = cgctx.insert_const_string(mod, '%d') + gdb_str = cgctx.insert_const_string(mod, config.GDB_BINARY) + attach_str = cgctx.insert_const_string(mod, 'attach') + + new_args = [] + # add break point command to known location + # this command file thing is due to commands attached to a breakpoint + # requiring an interactive prompt + # https://sourceware.org/bugzilla/show_bug.cgi?id=10079 + new_args.extend(['-x', os.path.join(_path, 'cmdlang.gdb')]) + # issue command to continue execution from sleep function + new_args.extend(['-ex', 'c']) + # then run the user defined args if any + if any([not isinstance(x, types.StringLiteral) for x in const_args]): + raise errors.RequireLiteralValue(const_args) + new_args.extend([x.literal_value for x in const_args]) + cmdlang = [cgctx.insert_const_string(mod, x) for x in new_args] + + # insert getpid, getpid is always successful, call without concern! + fnty = ir.FunctionType(int32_t, tuple()) + getpid = cgutils.get_or_insert_function(mod, fnty, "getpid") + + # insert snprintf + # int snprintf(char *str, size_t size, const char *format, ...); + fnty = ir.FunctionType( + int32_t, (char_ptr, intp_t, char_ptr), var_arg=True) + snprintf = cgutils.get_or_insert_function(mod, fnty, "snprintf") + + # insert fork + fnty = ir.FunctionType(int32_t, tuple()) + fork = cgutils.get_or_insert_function(mod, fnty, "fork") + + # insert execl + fnty = ir.FunctionType(int32_t, (char_ptr, char_ptr), var_arg=True) + execl = cgutils.get_or_insert_function(mod, fnty, "execl") + + # insert sleep + fnty = ir.FunctionType(int32_t, (int32_t,)) + sleep = cgutils.get_or_insert_function(mod, fnty, "sleep") + + # insert break point + fnty = ir.FunctionType(ir.VoidType(), tuple()) + breakpoint = cgutils.get_or_insert_function(mod, fnty, + "numba_gdb_breakpoint") + + # do the work + parent_pid = builder.call(getpid, tuple()) + builder.store(parent_pid, pid) + pidstr_ptr = builder.gep(pidstr, [zero_i32t], inbounds=True) + pid_val = builder.load(pid) + + # call snprintf to write the pid into a char * + stat = builder.call( + snprintf, (pidstr_ptr, intp_t(12), intfmt, pid_val)) + invalid_write = builder.icmp_signed('>', stat, int32_t(12)) + with builder.if_then(invalid_write, likely=False): + msg = "Internal error: `snprintf` buffer would have overflowed." + cgctx.call_conv.return_user_exc(builder, RuntimeError, (msg,)) + + # fork, check pids etc + child_pid = builder.call(fork, tuple()) + fork_failed = builder.icmp_signed('==', child_pid, int32_t(-1)) + with builder.if_then(fork_failed, likely=False): + msg = "Internal error: `fork` failed." + cgctx.call_conv.return_user_exc(builder, RuntimeError, (msg,)) + + is_child = builder.icmp_signed('==', child_pid, zero_i32t) + with builder.if_else(is_child) as (then, orelse): + with then: + # is child + nullptr = ir.Constant(char_ptr, None) + gdb_str_ptr = builder.gep( + gdb_str, [zero_i32t], inbounds=True) + attach_str_ptr = builder.gep( + attach_str, [zero_i32t], inbounds=True) + cgutils.printf( + builder, "Attaching to PID: %s\n", pidstr) + buf = ( + gdb_str_ptr, + gdb_str_ptr, + attach_str_ptr, + pidstr_ptr) + buf = buf + tuple(cmdlang) + (nullptr,) + builder.call(execl, buf) + with orelse: + # is parent + builder.call(sleep, (int32_t(10),)) + # if breaking is desired, break now + if do_break is True: + builder.call(breakpoint, tuple()) + + +def gen_gdb_impl(const_args, do_break): + @intrinsic + def gdb_internal(tyctx): + function_sig = types.void() + + def codegen(cgctx, builder, signature, args): + init_gdb_codegen(cgctx, builder, signature, args, const_args, + do_break=do_break) + return cgctx.get_constant(types.none, None) + return function_sig, codegen + return gdb_internal + + +@overload(gdb_breakpoint) +def hook_gdb_breakpoint(): + """ + Adds the Numba break point into the source + """ + if not sys.platform.startswith('linux'): + raise RuntimeError('gdb is only available on linux') + bp_impl = gen_bp_impl() + + def impl(): + bp_impl() + return impl + + +def gen_bp_impl(): + @intrinsic + def bp_internal(tyctx): + function_sig = types.void() + + def codegen(cgctx, builder, signature, args): + mod = builder.module + fnty = ir.FunctionType(ir.VoidType(), tuple()) + breakpoint = cgutils.get_or_insert_function(mod, fnty, + "numba_gdb_breakpoint") + builder.call(breakpoint, tuple()) + return cgctx.get_constant(types.none, None) + return function_sig, codegen + return bp_internal diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/gdb_print_extension.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/gdb_print_extension.py new file mode 100644 index 0000000000000000000000000000000000000000..982aacf26e55eb76b852e1fe4ce5ea95a432c45c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/gdb_print_extension.py @@ -0,0 +1,204 @@ +"""gdb printing extension for Numba types. +""" +import re + +try: + import gdb.printing + import gdb +except ImportError: + raise ImportError("GDB python support is not available.") + + +class NumbaArrayPrinter: + + def __init__(self, val): + self.val = val + + def to_string(self): + try: + import numpy as np + HAVE_NUMPY = True + except ImportError: + HAVE_NUMPY = False + + try: + NULL = 0x0 + + # Raw data references, these need unpacking/interpreting. + + # Member "data" is... + # DW_TAG_member of DIDerivedType, tag of DW_TAG_pointer_type + # encoding e.g. DW_ATE_float + data = self.val["data"] + + # Member "itemsize" is... + # DW_TAG_member of DIBasicType encoding DW_ATE_signed + itemsize = self.val["itemsize"] + + # Members "shape" and "strides" are... + # DW_TAG_member of DIDerivedType, the type is a DICompositeType + # (it's a Numba UniTuple) with tag: DW_TAG_array_type, i.e. it's an + # array repr, it has a basetype of e.g. DW_ATE_unsigned and also + # "elements" which are referenced with a DISubrange(count: ) + # to say how many elements are in the array. + rshp = self.val["shape"] + rstrides = self.val["strides"] + + # bool on whether the data is aligned. + is_aligned = False + + # type information decode, simple type: + ty_str = str(self.val.type) + if HAVE_NUMPY and ('aligned' in ty_str or 'Record' in ty_str): + ty_str = ty_str.replace('unaligned ','').strip() + matcher = re.compile(r"array\((Record.*), (.*), (.*)\)\ \(.*") + # NOTE: need to deal with "Alignment" else dtype size is wrong + arr_info = [x.strip() for x in matcher.match(ty_str).groups()] + dtype_str, ndim_str, order_str = arr_info + rstr = r'Record\((.*\[.*\]);([0-9]+);(True|False)' + rstr_match = re.match(rstr, dtype_str) + # balign is unused, it's the alignment + fields, balign, is_aligned_str = rstr_match.groups() + is_aligned = is_aligned_str == 'True' + field_dts = fields.split(',') + struct_entries = [] + for f in field_dts: + splitted = f.split('[') + name = splitted[0] + dt_part = splitted[1:] + if len(dt_part) > 1: + raise TypeError('Unsupported sub-type: %s' % f) + else: + dt_part = dt_part[0] + if "nestedarray" in dt_part: + raise TypeError('Unsupported sub-type: %s' % f) + dt_as_str = dt_part.split(';')[0].split('=')[1] + dtype = np.dtype(dt_as_str) + struct_entries.append((name, dtype)) + # The dtype is actually a record of some sort + dtype_str = struct_entries + else: # simple type + matcher = re.compile(r"array\((.*),(.*),(.*)\)\ \(.*") + arr_info = [x.strip() for x in matcher.match(ty_str).groups()] + dtype_str, ndim_str, order_str = arr_info + # fix up unichr dtype + if 'unichr x ' in dtype_str: + dtype_str = dtype_str[1:-1].replace('unichr x ', '= 1 else None + minor = try_int(parts[1]) if len(parts) >= 2 else None + patch = try_int(parts[2]) if len(parts) >= 3 else None + short = (major, minor) + full = (major, minor, patch) + string = version + tup = tuple(parts) + git_revision = tup[3] if len(tup) >= 4 else None + return version_info(major, minor, patch, short, full, string, tup, + git_revision) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/inspection.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/inspection.py new file mode 100644 index 0000000000000000000000000000000000000000..a92c9430805ae1d4e388a1ca3222075fe1330847 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/inspection.py @@ -0,0 +1,103 @@ +"""Miscellaneous inspection tools +""" +from tempfile import NamedTemporaryFile, TemporaryDirectory +import os +import warnings + +from numba.core.errors import NumbaWarning + + +def disassemble_elf_to_cfg(elf, mangled_symbol): + """ + Gets the CFG of the disassembly of an ELF object, elf, at mangled name, + mangled_symbol, and renders it appropriately depending on the execution + environment (terminal/notebook). + """ + try: + import r2pipe + except ImportError: + raise RuntimeError("r2pipe package needed for disasm CFG") + + def get_rendering(cmd=None): + from numba.pycc.platform import Toolchain # import local, circular ref + if cmd is None: + raise ValueError("No command given") + + with TemporaryDirectory() as tmpdir: + # Write ELF as a temporary file in the temporary dir, do not delete! + with NamedTemporaryFile(delete=False, dir=tmpdir) as f: + f.write(elf) + f.flush() # force write, radare2 needs a binary blob on disk + + # Now try and link the ELF, this helps radare2 _a lot_ + linked = False + try: + raw_dso_name = f'{os.path.basename(f.name)}.so' + linked_dso = os.path.join(tmpdir, raw_dso_name) + tc = Toolchain() + tc.link_shared(linked_dso, (f.name,)) + obj_to_analyse = linked_dso + linked = True + except Exception as e: + # link failed, mention it to user, radare2 will still be able to + # analyse the object, but things like dwarf won't appear in the + # asm as comments. + msg = ('Linking the ELF object with the distutils toolchain ' + f'failed with: {e}. Disassembly will still work but ' + 'might be less accurate and will not use DWARF ' + 'information.') + warnings.warn(NumbaWarning(msg)) + obj_to_analyse = f.name + + # catch if r2pipe can actually talk to radare2 + try: + flags = ['-2', # close stderr to hide warnings + '-e io.cache=true', # fix relocations in disassembly + '-e scr.color=1', # 16 bit ANSI colour terminal + '-e asm.dwarf=true', # DWARF decode + '-e scr.utf8=true', # UTF8 output looks better + ] + r = r2pipe.open(obj_to_analyse, flags=flags) + r.cmd('aaaaaa') # analyse as much as possible + # If the elf is linked then it's necessary to seek as the + # DSO ctor/dtor is at the default position + if linked: + # r2 only matches up to 61 chars?! found this by experiment! + mangled_symbol_61char = mangled_symbol[:61] + # switch off demangle, the seek is on a mangled symbol + r.cmd('e bin.demangle=false') + # seek to the mangled symbol address + r.cmd(f's `is~ {mangled_symbol_61char}[1]`') + # switch demangling back on for output purposes + r.cmd('e bin.demangle=true') + data = r.cmd('%s' % cmd) # print graph + r.quit() + except Exception as e: + if "radare2 in PATH" in str(e): + msg = ("This feature requires 'radare2' to be " + "installed and available on the system see: " + "https://github.com/radareorg/radare2. " + "Cannot find 'radare2' in $PATH.") + raise RuntimeError(msg) + else: + raise e + return data + + class DisasmCFG(object): + + def _repr_svg_(self): + try: + import graphviz + except ImportError: + raise RuntimeError("graphviz package needed for disasm CFG") + jupyter_rendering = get_rendering(cmd='agfd') + # this just makes it read slightly better in jupyter notebooks + jupyter_rendering.replace('fontname="Courier",', + 'fontname="Courier",fontsize=6,') + src = graphviz.Source(jupyter_rendering) + return src.pipe('svg').decode('UTF-8') + + def __repr__(self): + return get_rendering(cmd='agf') + + return DisasmCFG() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/literal.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/literal.py new file mode 100644 index 0000000000000000000000000000000000000000..2bc1225b7e4b8428854b5f39b26a1f0ab6766d30 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/literal.py @@ -0,0 +1,24 @@ +from numba.core.extending import overload +from numba.core import types +from numba.misc.special import literally, literal_unroll +from numba.core.errors import TypingError + + +@overload(literally) +def _ov_literally(obj): + if isinstance(obj, (types.Literal, types.InitialValue)): + return lambda obj: obj + else: + m = "Invalid use of non-Literal type in literally({})".format(obj) + raise TypingError(m) + + +@overload(literal_unroll) +def literal_unroll_impl(container): + if isinstance(container, types.Poison): + m = f"Invalid use of non-Literal type in literal_unroll({container})" + raise TypingError(m) + + def impl(container): + return container + return impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/llvm_pass_timings.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/llvm_pass_timings.py new file mode 100644 index 0000000000000000000000000000000000000000..17c52dbf48360f68e780c5207bb83b5d4c7d73ba --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/llvm_pass_timings.py @@ -0,0 +1,409 @@ +import re +import operator +import heapq +from collections import namedtuple +from collections.abc import Sequence +from contextlib import contextmanager +from functools import cached_property + +from numba.core import config + +import llvmlite.binding as llvm + + +class RecordLLVMPassTimings: + """A helper context manager to track LLVM pass timings. + """ + + __slots__ = ["_data"] + + def __enter__(self): + """Enables the pass timing in LLVM. + """ + llvm.set_time_passes(True) + return self + + def __exit__(self, exc_val, exc_type, exc_tb): + """Reset timings and save report internally. + """ + self._data = llvm.report_and_reset_timings() + llvm.set_time_passes(False) + return + + def get(self): + """Retrieve timing data for processing. + + Returns + ------- + timings: ProcessedPassTimings + """ + return ProcessedPassTimings(self._data) + + +PassTimingRecord = namedtuple( + "PassTimingRecord", + [ + "user_time", + "user_percent", + "system_time", + "system_percent", + "user_system_time", + "user_system_percent", + "wall_time", + "wall_percent", + "pass_name", + "instruction", + ], +) + + +def _adjust_timings(records): + """Adjust timing records because of truncated information. + + Details: The percent information can be used to improve the timing + information. + + Returns + ------- + res: List[PassTimingRecord] + """ + total_rec = records[-1] + assert total_rec.pass_name == "Total" # guard for implementation error + + def make_adjuster(attr): + time_attr = f"{attr}_time" + percent_attr = f"{attr}_percent" + time_getter = operator.attrgetter(time_attr) + + def adjust(d): + """Compute percent x total_time = adjusted""" + total = time_getter(total_rec) + adjusted = total * d[percent_attr] * 0.01 + d[time_attr] = adjusted + return d + + return adjust + + # Make adjustment functions for each field + adj_fns = [ + make_adjuster(x) for x in ["user", "system", "user_system", "wall"] + ] + + # Extract dictionaries from the namedtuples + dicts = map(lambda x: x._asdict(), records) + + def chained(d): + # Chain the adjustment functions + for fn in adj_fns: + d = fn(d) + # Reconstruct the namedtuple + return PassTimingRecord(**d) + + return list(map(chained, dicts)) + + +class ProcessedPassTimings: + """A class for processing raw timing report from LLVM. + + The processing is done lazily so we don't waste time processing unused + timing information. + """ + + def __init__(self, raw_data): + self._raw_data = raw_data + + def __bool__(self): + return bool(self._raw_data) + + def get_raw_data(self): + """Returns the raw string data. + + Returns + ------- + res: str + """ + return self._raw_data + + def get_total_time(self): + """Compute the total time spend in all passes. + + Returns + ------- + res: float + """ + return self.list_records()[-1].wall_time + + def list_records(self): + """Get the processed data for the timing report. + + Returns + ------- + res: List[PassTimingRecord] + """ + return self._processed + + def list_top(self, n): + """Returns the top(n) most time-consuming (by wall-time) passes. + + Parameters + ---------- + n: int + This limits the maximum number of items to show. + This function will show the ``n`` most time-consuming passes. + + Returns + ------- + res: List[PassTimingRecord] + Returns the top(n) most time-consuming passes in descending order. + """ + records = self.list_records() + key = operator.attrgetter("wall_time") + return heapq.nlargest(n, records[:-1], key) + + def summary(self, topn=5, indent=0): + """Return a string summarizing the timing information. + + Parameters + ---------- + topn: int; optional + This limits the maximum number of items to show. + This function will show the ``topn`` most time-consuming passes. + indent: int; optional + Set the indentation level. Defaults to 0 for no indentation. + + Returns + ------- + res: str + """ + buf = [] + prefix = " " * indent + + def ap(arg): + buf.append(f"{prefix}{arg}") + + ap(f"Total {self.get_total_time():.4f}s") + ap("Top timings:") + for p in self.list_top(topn): + ap(f" {p.wall_time:.4f}s ({p.wall_percent:5}%) {p.pass_name}") + return "\n".join(buf) + + @cached_property + def _processed(self): + """A cached property for lazily processing the data and returning it. + + See ``_process()`` for details. + """ + return self._process() + + def _process(self): + """Parses the raw string data from LLVM timing report and attempts + to improve the data by recomputing the times + (See `_adjust_timings()``). + """ + + def parse(raw_data): + """A generator that parses the raw_data line-by-line to extract + timing information for each pass. + """ + lines = raw_data.splitlines() + colheader = r"[a-zA-Z+ ]+" + # Take at least one column header. + multicolheaders = fr"(?:\s*-+{colheader}-+)+" + + line_iter = iter(lines) + # find column headers + header_map = { + "User Time": "user", + "System Time": "system", + "User+System": "user_system", + "Wall Time": "wall", + "Instr": "instruction", + "Name": "pass_name", + } + for ln in line_iter: + m = re.match(multicolheaders, ln) + if m: + # Get all the column headers + raw_headers = re.findall(r"[a-zA-Z][a-zA-Z+ ]+", ln) + headers = [header_map[k.strip()] for k in raw_headers] + break + + assert headers[-1] == 'pass_name' + # compute the list of available attributes from the column headers + attrs = [] + n = r"\s*((?:[0-9]+\.)?[0-9]+)" + pat = "" + for k in headers[:-1]: + if k == "instruction": + pat += n + else: + attrs.append(f"{k}_time") + attrs.append(f"{k}_percent") + pat += rf"\s+(?:{n}\s*\({n}%\)|-+)" + + # put default value 0.0 to all missing attributes + missing = {} + for k in PassTimingRecord._fields: + if k not in attrs and k != 'pass_name': + missing[k] = 0.0 + # parse timings + pat += r"\s*(.*)" + for ln in line_iter: + m = re.match(pat, ln) + if m is not None: + raw_data = list(m.groups()) + data = {k: float(v) if v is not None else 0.0 + for k, v in zip(attrs, raw_data)} + data.update(missing) + pass_name = raw_data[-1] + rec = PassTimingRecord( + pass_name=pass_name, **data, + ) + yield rec + if rec.pass_name == "Total": + # "Total" means the report has ended + break + # Check that we have reach the end of the report + remaining = '\n'.join(line_iter) + if remaining: + raise ValueError( + f"unexpected text after parser finished:\n{remaining}" + ) + + # Parse raw data + records = list(parse(self._raw_data)) + return _adjust_timings(records) + + +NamedTimings = namedtuple("NamedTimings", ["name", "timings"]) + + +class PassTimingsCollection(Sequence): + """A collection of pass timings. + + This class implements the ``Sequence`` protocol for accessing the + individual timing records. + """ + + def __init__(self, name): + self._name = name + self._records = [] + + @contextmanager + def record(self, name): + """Record new timings and append to this collection. + + Note: this is mainly for internal use inside the compiler pipeline. + + See also ``RecordLLVMPassTimings`` + + Parameters + ---------- + name: str + Name for the records. + """ + if config.LLVM_PASS_TIMINGS: + # Recording of pass timings is enabled + with RecordLLVMPassTimings() as timings: + yield + rec = timings.get() + # Only keep non-empty records + if rec: + self._append(name, rec) + else: + # Do nothing. Recording of pass timings is disabled. + yield + + def _append(self, name, timings): + """Append timing records + + Parameters + ---------- + name: str + Name for the records. + timings: ProcessedPassTimings + the timing records. + """ + self._records.append(NamedTimings(name, timings)) + + def get_total_time(self): + """Computes the sum of the total time across all contained timings. + + Returns + ------- + res: float or None + Returns the total number of seconds or None if no timings were + recorded + """ + if self._records: + return sum(r.timings.get_total_time() for r in self._records) + else: + return None + + def list_longest_first(self): + """Returns the timings in descending order of total time duration. + + Returns + ------- + res: List[ProcessedPassTimings] + """ + return sorted(self._records, + key=lambda x: x.timings.get_total_time(), + reverse=True) + + @property + def is_empty(self): + """ + """ + return not self._records + + def summary(self, topn=5): + """Return a string representing the summary of the timings. + + Parameters + ---------- + topn: int; optional, default=5. + This limits the maximum number of items to show. + This function will show the ``topn`` most time-consuming passes. + + Returns + ------- + res: str + + See also ``ProcessedPassTimings.summary()`` + """ + if self.is_empty: + return "No pass timings were recorded" + else: + buf = [] + ap = buf.append + ap(f"Printing pass timings for {self._name}") + overall_time = self.get_total_time() + ap(f"Total time: {overall_time:.4f}") + for i, r in enumerate(self._records): + ap(f"== #{i} {r.name}") + percent = r.timings.get_total_time() / overall_time * 100 + ap(f" Percent: {percent:.1f}%") + ap(r.timings.summary(topn=topn, indent=1)) + return "\n".join(buf) + + def __getitem__(self, i): + """Get the i-th timing record. + + Returns + ------- + res: (name, timings) + A named tuple with two fields: + + - name: str + - timings: ProcessedPassTimings + """ + return self._records[i] + + def __len__(self): + """Length of this collection. + """ + return len(self._records) + + def __str__(self): + return self.summary() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/mergesort.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/mergesort.py new file mode 100644 index 0000000000000000000000000000000000000000..cba5f3318b7ef55398df4f5e921e1f2c7a68aed3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/mergesort.py @@ -0,0 +1,126 @@ +""" +The same algorithm as translated from numpy. +See numpy/core/src/npysort/mergesort.c.src. +The high-level numba code is adding a little overhead comparing to +the pure-C implementation in numpy. +""" +import numpy as np +from collections import namedtuple + +# Array size smaller than this will be sorted by insertion sort +SMALL_MERGESORT = 20 + + +MergesortImplementation = namedtuple('MergesortImplementation', [ + 'run_mergesort', +]) + + +def make_mergesort_impl(wrap, lt=None, is_argsort=False): + kwargs_lite = dict(no_cpython_wrapper=True, _nrt=False) + + # The less than + if lt is None: + @wrap(**kwargs_lite) + def lt(a, b): + return a < b + else: + lt = wrap(**kwargs_lite)(lt) + + if is_argsort: + @wrap(**kwargs_lite) + def lessthan(a, b, vals): + return lt(vals[a], vals[b]) + else: + @wrap(**kwargs_lite) + def lessthan(a, b, vals): + return lt(a, b) + + @wrap(**kwargs_lite) + def argmergesort_inner(arr, vals, ws): + """The actual mergesort function + + Parameters + ---------- + arr : array [read+write] + The values being sorted inplace. For argsort, this is the + indices. + vals : array [readonly] + ``None`` for normal sort. In argsort, this is the actual array values. + ws : array [write] + The workspace. Must be of size ``arr.size // 2`` + """ + if arr.size > SMALL_MERGESORT: + # Merge sort + mid = arr.size // 2 + + argmergesort_inner(arr[:mid], vals, ws) + argmergesort_inner(arr[mid:], vals, ws) + + # Copy left half into workspace so we don't overwrite it + for i in range(mid): + ws[i] = arr[i] + + # Merge + left = ws[:mid] + right = arr[mid:] + out = arr + + i = j = k = 0 + while i < left.size and j < right.size: + if not lessthan(right[j], left[i], vals): + out[k] = left[i] + i += 1 + else: + out[k] = right[j] + j += 1 + k += 1 + + # Leftovers + while i < left.size: + out[k] = left[i] + i += 1 + k += 1 + + while j < right.size: + out[k] = right[j] + j += 1 + k += 1 + else: + # Insertion sort + i = 1 + while i < arr.size: + j = i + while j > 0 and lessthan(arr[j], arr[j - 1], vals): + arr[j - 1], arr[j] = arr[j], arr[j - 1] + j -= 1 + i += 1 + + # The top-level entry points + + @wrap(no_cpython_wrapper=True) + def mergesort(arr): + "Inplace" + ws = np.empty(arr.size // 2, dtype=arr.dtype) + argmergesort_inner(arr, None, ws) + return arr + + + @wrap(no_cpython_wrapper=True) + def argmergesort(arr): + "Out-of-place" + idxs = np.arange(arr.size) + ws = np.empty(arr.size // 2, dtype=idxs.dtype) + argmergesort_inner(idxs, arr, ws) + return idxs + + return MergesortImplementation( + run_mergesort=(argmergesort if is_argsort else mergesort) + ) + + +def make_jit_mergesort(*args, **kwargs): + from numba import njit + # NOTE: wrap with njit to allow recursion + # because @register_jitable => @overload doesn't support recursion + return make_mergesort_impl(njit, *args, **kwargs) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/numba_entry.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/numba_entry.py new file mode 100644 index 0000000000000000000000000000000000000000..b95f9dd06b44a23b84ac7efc508f41718eb40b92 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/numba_entry.py @@ -0,0 +1,72 @@ +import sys +import argparse +import os +import subprocess +import json + +from .numba_sysinfo import display_sysinfo, get_sysinfo +from .numba_gdbinfo import display_gdbinfo + + +def make_parser(): + parser = argparse.ArgumentParser() + parser.add_argument('--annotate', help='Annotate source', + action='store_true') + parser.add_argument('--dump-llvm', action="store_true", + help='Print generated llvm assembly') + parser.add_argument('--dump-optimized', action='store_true', + help='Dump the optimized llvm assembly') + parser.add_argument('--dump-assembly', action='store_true', + help='Dump the LLVM generated assembly') + parser.add_argument('--annotate-html', nargs=1, + help='Output source annotation as html') + parser.add_argument('-s', '--sysinfo', action="store_true", + help='Output system information for bug reporting') + parser.add_argument('-g', '--gdbinfo', action="store_true", + help='Output system information about gdb') + parser.add_argument('--sys-json', nargs=1, + help='Saves the system info dict as a json file') + parser.add_argument('filename', nargs='?', help='Python source filename') + return parser + + +def main(): + parser = make_parser() + args = parser.parse_args() + + if args.sysinfo: + print("System info:") + display_sysinfo() + + if args.gdbinfo: + print("GDB info:") + display_gdbinfo() + + if args.sysinfo or args.gdbinfo: + sys.exit(0) + + if args.sys_json: + info = get_sysinfo() + info.update({'Start': info['Start'].isoformat()}) + info.update({'Start UTC': info['Start UTC'].isoformat()}) + with open(args.sys_json[0], 'w') as f: + json.dump(info, f, indent=4) + sys.exit(0) + + os.environ['NUMBA_DUMP_ANNOTATION'] = str(int(args.annotate)) + if args.annotate_html is not None: + try: + from jinja2 import Template + except ImportError: + raise ImportError("Please install the 'jinja2' package") + os.environ['NUMBA_DUMP_HTML'] = str(args.annotate_html[0]) + os.environ['NUMBA_DUMP_LLVM'] = str(int(args.dump_llvm)) + os.environ['NUMBA_DUMP_OPTIMIZED'] = str(int(args.dump_optimized)) + os.environ['NUMBA_DUMP_ASSEMBLY'] = str(int(args.dump_assembly)) + + if args.filename: + cmd = [sys.executable, args.filename] + subprocess.call(cmd) + else: + print("numba: error: the following arguments are required: filename") + sys.exit(1) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/numba_gdbinfo.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/numba_gdbinfo.py new file mode 100644 index 0000000000000000000000000000000000000000..db92cd24b6c120368b0560497bd28d75bba5c37d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/numba_gdbinfo.py @@ -0,0 +1,161 @@ +"""Module for displaying information about Numba's gdb set up""" +from collections import namedtuple +import os +import re +import subprocess +from textwrap import dedent +from numba import config + +# Container for the output of the gdb info data collection +_fields = ('binary_loc, extension_loc, py_ver, np_ver, supported') +_gdb_info = namedtuple('_gdb_info', _fields) + + +class _GDBTestWrapper(): + """Wraps the gdb binary and has methods for checking what the gdb binary + has support for (Python and NumPy).""" + + def __init__(self,): + gdb_binary = config.GDB_BINARY + if gdb_binary is None: + msg = ("No valid binary could be found for gdb named: " + f"{config.GDB_BINARY}") + raise ValueError(msg) + self._gdb_binary = gdb_binary + + def _run_cmd(self, cmd=()): + gdb_call = [self.gdb_binary, '-q',] + for x in cmd: + gdb_call.append('-ex') + gdb_call.append(x) + gdb_call.extend(['-ex', 'q']) + return subprocess.run(gdb_call, capture_output=True, timeout=10, + text=True) + + @property + def gdb_binary(self): + return self._gdb_binary + + @classmethod + def success(cls, status): + return status.returncode == 0 + + def check_launch(self): + """Checks that gdb will launch ok""" + return self._run_cmd() + + def check_python(self): + cmd = ("python from __future__ import print_function; " + "import sys; print(sys.version_info[:2])") + return self._run_cmd((cmd,)) + + def check_numpy(self): + cmd = ("python from __future__ import print_function; " + "import types; import numpy; " + "print(isinstance(numpy, types.ModuleType))") + return self._run_cmd((cmd,)) + + def check_numpy_version(self): + cmd = ("python from __future__ import print_function; " + "import types; import numpy;" + "print(numpy.__version__)") + return self._run_cmd((cmd,)) + + +def collect_gdbinfo(): + """Prints information to stdout about the gdb setup that Numba has found""" + + # State flags: + gdb_state = None + gdb_has_python = False + gdb_has_numpy = False + gdb_python_version = 'No Python support' + gdb_python_numpy_version = "No NumPy support" + + # There are so many ways for gdb to not be working as expected. Surround + # the "is it working" tests with try/except and if there's an exception + # store it for processing later. + try: + # Check gdb exists + gdb_wrapper = _GDBTestWrapper() + + # Check gdb works + status = gdb_wrapper.check_launch() + if not gdb_wrapper.success(status): + msg = (f"gdb at '{gdb_wrapper.gdb_binary}' does not appear to work." + f"\nstdout: {status.stdout}\nstderr: {status.stderr}") + raise ValueError(msg) + gdb_state = gdb_wrapper.gdb_binary + except Exception as e: + gdb_state = f"Testing gdb binary failed. Reported Error: {e}" + else: + # Got this far, so gdb works, start checking what it supports + status = gdb_wrapper.check_python() + if gdb_wrapper.success(status): + version_match = re.match(r'\((\d+),\s+(\d+)\)', + status.stdout.strip()) + if version_match is not None: + pymajor, pyminor = version_match.groups() + gdb_python_version = f"{pymajor}.{pyminor}" + gdb_has_python = True + + status = gdb_wrapper.check_numpy() + if gdb_wrapper.success(status): + if "Traceback" not in status.stderr.strip(): + if status.stdout.strip() == 'True': + gdb_has_numpy = True + gdb_python_numpy_version = "Unknown" + # NumPy is present find the version + status = gdb_wrapper.check_numpy_version() + if gdb_wrapper.success(status): + if "Traceback" not in status.stderr.strip(): + gdb_python_numpy_version = \ + status.stdout.strip() + + # Work out what level of print-extension support is present in this gdb + if gdb_has_python: + if gdb_has_numpy: + print_ext_supported = "Full (Python and NumPy supported)" + else: + print_ext_supported = "Partial (Python only, no NumPy support)" + else: + print_ext_supported = "None" + + # Work out print ext location + print_ext_file = "gdb_print_extension.py" + print_ext_path = os.path.join(os.path.dirname(__file__), print_ext_file) + + # return! + return _gdb_info(gdb_state, print_ext_path, gdb_python_version, + gdb_python_numpy_version, print_ext_supported) + + +def display_gdbinfo(sep_pos=45): + """Displays the information collected by collect_gdbinfo. + """ + gdb_info = collect_gdbinfo() + print('-' * 80) + fmt = f'%-{sep_pos}s : %-s' + # Display the information + print(fmt % ("Binary location", gdb_info.binary_loc)) + print(fmt % ("Print extension location", gdb_info.extension_loc)) + print(fmt % ("Python version", gdb_info.py_ver)) + print(fmt % ("NumPy version", gdb_info.np_ver)) + print(fmt % ("Numba printing extension support", gdb_info.supported)) + + print("") + print("To load the Numba gdb printing extension, execute the following " + "from the gdb prompt:") + print(f"\nsource {gdb_info.extension_loc}\n") + print('-' * 80) + warn = """ + ============================================================= + IMPORTANT: Before sharing you should remove any information + in the above that you wish to keep private e.g. paths. + ============================================================= + """ + print(dedent(warn)) + + +if __name__ == '__main__': + display_gdbinfo() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/numba_sysinfo.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/numba_sysinfo.py new file mode 100644 index 0000000000000000000000000000000000000000..75ff27491edd39648d5d93545133824adaea1756 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/numba_sysinfo.py @@ -0,0 +1,698 @@ +import json +import locale +import multiprocessing +import os +import platform +import textwrap +import sys +from contextlib import redirect_stdout +from datetime import datetime +from io import StringIO +from subprocess import check_output, PIPE, CalledProcessError +import numpy as np +import llvmlite.binding as llvmbind +from llvmlite import __version__ as llvmlite_version +from numba import cuda as cu, __version__ as version_number +from numba.cuda import cudadrv +from numba.cuda.cudadrv.driver import driver as cudriver +from numba.cuda.cudadrv.runtime import runtime as curuntime +from numba.core import config + +_psutil_import = False +try: + import psutil +except ImportError: + pass +else: + _psutil_import = True + +__all__ = ['get_sysinfo', 'display_sysinfo'] + +# Keys of a `sysinfo` dictionary + +# Time info +_start, _start_utc, _runtime = 'Start', 'Start UTC', 'Runtime' +_numba_version = 'Numba Version' +# Hardware info +_machine = 'Machine' +_cpu_name, _cpu_count = 'CPU Name', 'CPU Count' +_cpus_allowed, _cpus_list = 'CPUs Allowed', 'List CPUs Allowed' +_cpu_features = 'CPU Features' +_cfs_quota, _cfs_period = 'CFS Quota', 'CFS Period', +_cfs_restrict = 'CFS Restriction' +_mem_total, _mem_available = 'Mem Total', 'Mem Available' +# OS info +_platform_name, _platform_release = 'Platform Name', 'Platform Release' +_os_name, _os_version = 'OS Name', 'OS Version' +_os_spec_version = 'OS Specific Version' +_libc_version = 'Libc Version' +# Python info +_python_comp = 'Python Compiler' +_python_impl = 'Python Implementation' +_python_version = 'Python Version' +_python_locale = 'Python Locale' +# LLVM info +_llvmlite_version = 'llvmlite Version' +_llvm_version = 'LLVM Version' +# CUDA info +_cu_target_impl = 'CUDA Target Impl' +_cu_dev_init = 'CUDA Device Init' +_cu_drv_ver = 'CUDA Driver Version' +_cu_rt_ver = 'CUDA Runtime Version' +_cu_nvidia_bindings = 'NVIDIA CUDA Bindings' +_cu_nvidia_bindings_used = 'NVIDIA CUDA Bindings In Use' +_cu_detect_out, _cu_lib_test = 'CUDA Detect Output', 'CUDA Lib Test' +_cu_mvc_available = 'NVIDIA CUDA Minor Version Compatibility Available' +_cu_mvc_needed = 'NVIDIA CUDA Minor Version Compatibility Needed' +_cu_mvc_in_use = 'NVIDIA CUDA Minor Version Compatibility In Use' +# NumPy info +_numpy_version = 'NumPy Version' +_numpy_supported_simd_features = 'NumPy Supported SIMD features' +_numpy_supported_simd_dispatch = 'NumPy Supported SIMD dispatch' +_numpy_supported_simd_baseline = 'NumPy Supported SIMD baseline' +_numpy_AVX512_SKX_detected = 'NumPy AVX512_SKX detected' +# SVML info +_svml_state, _svml_loaded = 'SVML State', 'SVML Lib Loaded' +_llvm_svml_patched = 'LLVM SVML Patched' +_svml_operational = 'SVML Operational' +# Threading layer info +_tbb_thread, _tbb_error = 'TBB Threading', 'TBB Threading Error' +_openmp_thread, _openmp_error = 'OpenMP Threading', 'OpenMP Threading Error' +_openmp_vendor = 'OpenMP vendor' +_wkq_thread, _wkq_error = 'Workqueue Threading', 'Workqueue Threading Error' +# Numba info +_numba_env_vars = 'Numba Env Vars' +# Conda info +_conda_build_ver, _conda_env_ver = 'Conda Build', 'Conda Env' +_conda_platform, _conda_python_ver = 'Conda Platform', 'Conda Python Version' +_conda_root_writable = 'Conda Root Writable' +# Packages info +_inst_pkg = 'Installed Packages' +# Psutil info +_psutil = 'Psutil Available' +# Errors and warnings +_errors = 'Errors' +_warnings = 'Warnings' + +# Error and warning log +_error_log = [] +_warning_log = [] + + +def get_os_spec_info(os_name): + # Linux man page for `/proc`: + # http://man7.org/linux/man-pages/man5/proc.5.html + + # Windows documentation for `wmic OS`: + # https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/cim-operatingsystem + + # MacOS man page for `sysctl`: + # https://www.unix.com/man-page/osx/3/sysctl/ + # MacOS man page for `vm_stat`: + # https://www.unix.com/man-page/osx/1/vm_stat/ + + class CmdBufferOut(tuple): + buffer_output_flag = True + + class CmdReadFile(tuple): + read_file_flag = True + + shell_params = { + 'Linux': { + 'cmd': ( + CmdReadFile(('/sys/fs/cgroup/cpuacct/cpu.cfs_quota_us',)), + CmdReadFile(('/sys/fs/cgroup/cpuacct/cpu.cfs_period_us',)), + ), + 'cmd_optional': ( + CmdReadFile(('/proc/meminfo',)), + CmdReadFile(('/proc/self/status',)), + ), + 'kwds': { + # output string fragment -> result dict key + 'MemTotal:': _mem_total, + 'MemAvailable:': _mem_available, + 'Cpus_allowed:': _cpus_allowed, + 'Cpus_allowed_list:': _cpus_list, + '/sys/fs/cgroup/cpuacct/cpu.cfs_quota_us': _cfs_quota, + '/sys/fs/cgroup/cpuacct/cpu.cfs_period_us': _cfs_period, + }, + }, + 'Windows': { + 'cmd': (), + 'cmd_optional': ( + CmdBufferOut(('wmic', 'OS', 'get', 'TotalVirtualMemorySize')), + CmdBufferOut(('wmic', 'OS', 'get', 'FreeVirtualMemory')), + ), + 'kwds': { + # output string fragment -> result dict key + 'TotalVirtualMemorySize': _mem_total, + 'FreeVirtualMemory': _mem_available, + }, + }, + 'Darwin': { + 'cmd': (), + 'cmd_optional': ( + ('sysctl', 'hw.memsize'), + ('vm_stat'), + ), + 'kwds': { + # output string fragment -> result dict key + 'hw.memsize:': _mem_total, + 'free:': _mem_available, + }, + 'units': { + _mem_total: 1, # Size is given in bytes. + _mem_available: 4096, # Size is given in 4kB pages. + }, + }, + } + + os_spec_info = {} + params = shell_params.get(os_name, {}) + cmd_selected = params.get('cmd', ()) + + if _psutil_import: + vm = psutil.virtual_memory() + os_spec_info.update({ + _mem_total: vm.total, + _mem_available: vm.available, + }) + p = psutil.Process() + cpus_allowed = p.cpu_affinity() if hasattr(p, 'cpu_affinity') else [] + if cpus_allowed: + os_spec_info[_cpus_allowed] = len(cpus_allowed) + os_spec_info[_cpus_list] = ' '.join(str(n) for n in cpus_allowed) + + else: + _warning_log.append( + "Warning (psutil): psutil cannot be imported. " + "For more accuracy, consider installing it.") + # Fallback to internal heuristics + cmd_selected += params.get('cmd_optional', ()) + + # Assuming the shell cmd returns a unique (k, v) pair per line + # or a unique (k, v) pair spread over several lines: + # Gather output in a list of strings containing a keyword and some value. + output = [] + for cmd in cmd_selected: + if hasattr(cmd, 'read_file_flag'): + # Open file within Python + if os.path.exists(cmd[0]): + try: + with open(cmd[0], 'r') as f: + out = f.readlines() + if out: + out[0] = ' '.join((cmd[0], out[0])) + output.extend(out) + except OSError as e: + _error_log.append(f'Error (file read): {e}') + continue + else: + _warning_log.append('Warning (no file): {}'.format(cmd[0])) + continue + else: + # Spawn a subprocess + try: + out = check_output(cmd, stderr=PIPE) + except (OSError, CalledProcessError) as e: + _error_log.append(f'Error (subprocess): {e}') + continue + if hasattr(cmd, 'buffer_output_flag'): + out = b' '.join(line for line in out.splitlines()) + b'\n' + output.extend(out.decode().splitlines()) + + # Extract (k, output) pairs by searching for keywords in output + kwds = params.get('kwds', {}) + for line in output: + match = kwds.keys() & line.split() + if match and len(match) == 1: + k = kwds[match.pop()] + os_spec_info[k] = line + elif len(match) > 1: + print(f'Ambiguous output: {line}') + + # Try to extract something meaningful from output string + def format(): + # CFS restrictions + split = os_spec_info.get(_cfs_quota, '').split() + if split: + os_spec_info[_cfs_quota] = float(split[-1]) + split = os_spec_info.get(_cfs_period, '').split() + if split: + os_spec_info[_cfs_period] = float(split[-1]) + if os_spec_info.get(_cfs_quota, -1) != -1: + cfs_quota = os_spec_info.get(_cfs_quota, '') + cfs_period = os_spec_info.get(_cfs_period, '') + runtime_amount = cfs_quota / cfs_period + os_spec_info[_cfs_restrict] = runtime_amount + + def format_optional(): + # Memory + units = {_mem_total: 1024, _mem_available: 1024} + units.update(params.get('units', {})) + for k in (_mem_total, _mem_available): + digits = ''.join(d for d in os_spec_info.get(k, '') if d.isdigit()) + os_spec_info[k] = int(digits or 0) * units[k] + # Accessible CPUs + split = os_spec_info.get(_cpus_allowed, '').split() + if split: + n = split[-1] + n = n.split(',')[-1] + os_spec_info[_cpus_allowed] = str(bin(int(n or 0, 16))).count('1') + split = os_spec_info.get(_cpus_list, '').split() + if split: + os_spec_info[_cpus_list] = split[-1] + + try: + format() + if not _psutil_import: + format_optional() + except Exception as e: + _error_log.append(f'Error (format shell output): {e}') + + # Call OS specific functions + os_specific_funcs = { + 'Linux': { + _libc_version: lambda: ' '.join(platform.libc_ver()) + }, + 'Windows': { + _os_spec_version: lambda: ' '.join( + s for s in platform.win32_ver()), + }, + 'Darwin': { + _os_spec_version: lambda: ''.join( + i or ' ' for s in tuple(platform.mac_ver()) for i in s), + }, + } + key_func = os_specific_funcs.get(os_name, {}) + os_spec_info.update({k: f() for k, f in key_func.items()}) + return os_spec_info + + +def get_sysinfo(): + + # Gather the information that shouldn't raise exceptions + sys_info = { + _start: datetime.now(), + _start_utc: datetime.utcnow(), + _machine: platform.machine(), + _cpu_name: llvmbind.get_host_cpu_name(), + _cpu_count: multiprocessing.cpu_count(), + _platform_name: platform.platform(aliased=True), + _platform_release: platform.release(), + _os_name: platform.system(), + _os_version: platform.version(), + _python_comp: platform.python_compiler(), + _python_impl: platform.python_implementation(), + _python_version: platform.python_version(), + _numba_env_vars: {k: v for (k, v) in os.environ.items() + if k.startswith('NUMBA_')}, + _numba_version: version_number, + _llvm_version: '.'.join(str(i) for i in llvmbind.llvm_version_info), + _llvmlite_version: llvmlite_version, + _psutil: _psutil_import, + } + + # CPU features + try: + feature_map = llvmbind.get_host_cpu_features() + except RuntimeError as e: + _error_log.append(f'Error (CPU features): {e}') + else: + features = sorted([key for key, value in feature_map.items() if value]) + sys_info[_cpu_features] = ' '.join(features) + + # Python locale + # On MacOSX, getdefaultlocale can raise. Check again if Py > 3.7.5 + try: + # If $LANG is unset, getdefaultlocale() can return (None, None), make + # sure we can encode this as strings by casting explicitly. + sys_info[_python_locale] = '.'.join([str(i) for i in + locale.getdefaultlocale()]) + except Exception as e: + _error_log.append(f'Error (locale): {e}') + + # CUDA information + try: + sys_info[_cu_target_impl] = cu.implementation + except AttributeError: + # On the offchance an out-of-tree target did not set the + # implementation, we can try to continue + pass + + try: + cu.list_devices()[0] # will a device initialise? + except Exception as e: + sys_info[_cu_dev_init] = False + msg_not_found = "CUDA driver library cannot be found" + msg_disabled_by_user = "CUDA is disabled" + msg_end = " or no CUDA enabled devices are present." + msg_generic_problem = "CUDA device initialisation problem." + msg = getattr(e, 'msg', None) + if msg is not None: + if msg_not_found in msg: + err_msg = msg_not_found + msg_end + elif msg_disabled_by_user in msg: + err_msg = msg_disabled_by_user + msg_end + else: + err_msg = msg_generic_problem + " Message:" + msg + else: + err_msg = msg_generic_problem + " " + str(e) + # Best effort error report + _warning_log.append("Warning (cuda): %s\nException class: %s" % + (err_msg, str(type(e)))) + else: + try: + sys_info[_cu_dev_init] = True + + output = StringIO() + with redirect_stdout(output): + cu.detect() + sys_info[_cu_detect_out] = output.getvalue() + output.close() + + cu_drv_ver = cudriver.get_version() + cu_rt_ver = curuntime.get_version() + sys_info[_cu_drv_ver] = '%s.%s' % cu_drv_ver + sys_info[_cu_rt_ver] = '%s.%s' % cu_rt_ver + + output = StringIO() + with redirect_stdout(output): + cudadrv.libs.test() + sys_info[_cu_lib_test] = output.getvalue() + output.close() + + try: + from cuda import cuda # noqa: F401 + nvidia_bindings_available = True + except ImportError: + nvidia_bindings_available = False + sys_info[_cu_nvidia_bindings] = nvidia_bindings_available + + nv_binding_used = bool(cudadrv.driver.USE_NV_BINDING) + sys_info[_cu_nvidia_bindings_used] = nv_binding_used + + try: + from ptxcompiler import compile_ptx # noqa: F401 + from cubinlinker import CubinLinker # noqa: F401 + sys_info[_cu_mvc_available] = True + except ImportError: + sys_info[_cu_mvc_available] = False + + sys_info[_cu_mvc_needed] = cu_rt_ver > cu_drv_ver + sys_info[_cu_mvc_in_use] = bool( + config.CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY) + except Exception as e: + _warning_log.append( + "Warning (cuda): Probing CUDA failed " + "(device and driver present, runtime problem?)\n" + f"(cuda) {type(e)}: {e}") + + # NumPy information + sys_info[_numpy_version] = np.version.full_version + try: + # NOTE: These consts were added in NumPy 1.20 + from numpy.core._multiarray_umath import (__cpu_features__, + __cpu_dispatch__, + __cpu_baseline__,) + except ImportError: + sys_info[_numpy_AVX512_SKX_detected] = False + else: + feat_filtered = [k for k, v in __cpu_features__.items() if v] + sys_info[_numpy_supported_simd_features] = feat_filtered + sys_info[_numpy_supported_simd_dispatch] = __cpu_dispatch__ + sys_info[_numpy_supported_simd_baseline] = __cpu_baseline__ + sys_info[_numpy_AVX512_SKX_detected] = \ + __cpu_features__.get("AVX512_SKX", False) + + # SVML information + # Replicate some SVML detection logic from numba.__init__ here. + # If SVML load fails in numba.__init__ the splitting of the logic + # here will help diagnosing the underlying issue. + svml_lib_loaded = True + try: + if sys.platform.startswith('linux'): + llvmbind.load_library_permanently("libsvml.so") + elif sys.platform.startswith('darwin'): + llvmbind.load_library_permanently("libsvml.dylib") + elif sys.platform.startswith('win'): + llvmbind.load_library_permanently("svml_dispmd") + else: + svml_lib_loaded = False + except Exception: + svml_lib_loaded = False + func = getattr(llvmbind.targets, "has_svml", None) + sys_info[_llvm_svml_patched] = func() if func else False + sys_info[_svml_state] = config.USING_SVML + sys_info[_svml_loaded] = svml_lib_loaded + sys_info[_svml_operational] = all(( + sys_info[_svml_state], + sys_info[_svml_loaded], + sys_info[_llvm_svml_patched], + )) + + # Check which threading backends are available. + def parse_error(e, backend): + # parses a linux based error message, this is to provide feedback + # and hide user paths etc + try: + path, problem, symbol = [x.strip() for x in e.msg.split(':')] + extn_dso = os.path.split(path)[1] + if backend in extn_dso: + return "%s: %s" % (problem, symbol) + except Exception: + pass + return "Unknown import problem." + + try: + # check import is ok, this means the DSO linkage is working + from numba.np.ufunc import tbbpool # NOQA + # check that the version is compatible, this is a check performed at + # runtime (well, compile time), it will also ImportError if there's + # a problem. + from numba.np.ufunc.parallel import _check_tbb_version_compatible + _check_tbb_version_compatible() + sys_info[_tbb_thread] = True + except ImportError as e: + # might be a missing symbol due to e.g. tbb libraries missing + sys_info[_tbb_thread] = False + sys_info[_tbb_error] = parse_error(e, 'tbbpool') + + try: + from numba.np.ufunc import omppool + sys_info[_openmp_thread] = True + sys_info[_openmp_vendor] = omppool.openmp_vendor + except ImportError as e: + sys_info[_openmp_thread] = False + sys_info[_openmp_error] = parse_error(e, 'omppool') + + try: + from numba.np.ufunc import workqueue # NOQA + sys_info[_wkq_thread] = True + except ImportError as e: + sys_info[_wkq_thread] = True + sys_info[_wkq_error] = parse_error(e, 'workqueue') + + # Look for conda and installed packages information + cmd = ('conda', 'info', '--json') + try: + conda_out = check_output(cmd) + except Exception as e: + _warning_log.append(f'Warning: Conda not available.\n Error was {e}\n') + # Conda is not available, try pip list to list installed packages + cmd = (sys.executable, '-m', 'pip', 'list') + try: + reqs = check_output(cmd) + except Exception as e: + _error_log.append(f'Error (pip): {e}') + else: + sys_info[_inst_pkg] = reqs.decode().splitlines() + + else: + jsond = json.loads(conda_out.decode()) + keys = { + 'conda_build_version': _conda_build_ver, + 'conda_env_version': _conda_env_ver, + 'platform': _conda_platform, + 'python_version': _conda_python_ver, + 'root_writable': _conda_root_writable, + } + for conda_k, sysinfo_k in keys.items(): + sys_info[sysinfo_k] = jsond.get(conda_k, 'N/A') + + # Get info about packages in current environment + cmd = ('conda', 'list') + try: + conda_out = check_output(cmd) + except CalledProcessError as e: + _error_log.append(f'Error (conda): {e}') + else: + data = conda_out.decode().splitlines() + sys_info[_inst_pkg] = [l for l in data if not l.startswith('#')] + + sys_info.update(get_os_spec_info(sys_info[_os_name])) + sys_info[_errors] = _error_log + sys_info[_warnings] = _warning_log + sys_info[_runtime] = (datetime.now() - sys_info[_start]).total_seconds() + return sys_info + + +def display_sysinfo(info=None, sep_pos=45): + class DisplayMap(dict): + display_map_flag = True + + class DisplaySeq(tuple): + display_seq_flag = True + + class DisplaySeqMaps(tuple): + display_seqmaps_flag = True + + if info is None: + info = get_sysinfo() + + fmt = f'%-{sep_pos}s : %-s' + MB = 1024**2 + template = ( + ("-" * 80,), + ("__Time Stamp__",), + ("Report started (local time)", info.get(_start, '?')), + ("UTC start time", info.get(_start_utc, '?')), + ("Running time (s)", info.get(_runtime, '?')), + ("",), + ("__Hardware Information__",), + ("Machine", info.get(_machine, '?')), + ("CPU Name", info.get(_cpu_name, '?')), + ("CPU Count", info.get(_cpu_count, '?')), + ("Number of accessible CPUs", info.get(_cpus_allowed, '?')), + ("List of accessible CPUs cores", info.get(_cpus_list, '?')), + ("CFS Restrictions (CPUs worth of runtime)", + info.get(_cfs_restrict, 'None')), + ("",), + ("CPU Features", '\n'.join( + ' ' * (sep_pos + 3) + l if i else l + for i, l in enumerate( + textwrap.wrap( + info.get(_cpu_features, '?'), + width=79 - sep_pos + ) + ) + )), + ("",), + ("Memory Total (MB)", info.get(_mem_total, 0) // MB or '?'), + ("Memory Available (MB)" + if info.get(_os_name, '') != 'Darwin' or info.get(_psutil, False) + else "Free Memory (MB)", info.get(_mem_available, 0) // MB or '?'), + ("",), + ("__OS Information__",), + ("Platform Name", info.get(_platform_name, '?')), + ("Platform Release", info.get(_platform_release, '?')), + ("OS Name", info.get(_os_name, '?')), + ("OS Version", info.get(_os_version, '?')), + ("OS Specific Version", info.get(_os_spec_version, '?')), + ("Libc Version", info.get(_libc_version, '?')), + ("",), + ("__Python Information__",), + DisplayMap({k: v for k, v in info.items() if k.startswith('Python')}), + ("",), + ("__Numba Toolchain Versions__",), + ("Numba Version", info.get(_numba_version, '?')), + ("llvmlite Version", info.get(_llvmlite_version, '?')), + ("",), + ("__LLVM Information__",), + ("LLVM Version", info.get(_llvm_version, '?')), + ("",), + ("__CUDA Information__",), + ("CUDA Target Implementation", info.get(_cu_target_impl, '?')), + ("CUDA Device Initialized", info.get(_cu_dev_init, '?')), + ("CUDA Driver Version", info.get(_cu_drv_ver, '?')), + ("CUDA Runtime Version", info.get(_cu_rt_ver, '?')), + ("CUDA NVIDIA Bindings Available", info.get(_cu_nvidia_bindings, '?')), + ("CUDA NVIDIA Bindings In Use", + info.get(_cu_nvidia_bindings_used, '?')), + ("CUDA Minor Version Compatibility Available", + info.get(_cu_mvc_available, '?')), + ("CUDA Minor Version Compatibility Needed", + info.get(_cu_mvc_needed, '?')), + ("CUDA Minor Version Compatibility In Use", + info.get(_cu_mvc_in_use, '?')), + ("CUDA Detect Output:",), + (info.get(_cu_detect_out, "None"),), + ("CUDA Libraries Test Output:",), + (info.get(_cu_lib_test, "None"),), + ("",), + ("__NumPy Information__",), + ("NumPy Version", info.get(_numpy_version, '?')), + ("NumPy Supported SIMD features", + DisplaySeq(info.get(_numpy_supported_simd_features, []) + or ('None found.',))), + ("NumPy Supported SIMD dispatch", + DisplaySeq(info.get(_numpy_supported_simd_dispatch, []) + or ('None found.',))), + ("NumPy Supported SIMD baseline", + DisplaySeq(info.get(_numpy_supported_simd_baseline, []) + or ('None found.',))), + ("NumPy AVX512_SKX support detected", + info.get(_numpy_AVX512_SKX_detected, '?')), + ("",), + ("__SVML Information__",), + ("SVML State, config.USING_SVML", info.get(_svml_state, '?')), + ("SVML Library Loaded", info.get(_svml_loaded, '?')), + ("llvmlite Using SVML Patched LLVM", info.get(_llvm_svml_patched, '?')), + ("SVML Operational", info.get(_svml_operational, '?')), + ("",), + ("__Threading Layer Information__",), + ("TBB Threading Layer Available", info.get(_tbb_thread, '?')), + ("+-->TBB imported successfully." if info.get(_tbb_thread, '?') + else f"+--> Disabled due to {info.get(_tbb_error, '?')}",), + ("OpenMP Threading Layer Available", info.get(_openmp_thread, '?')), + (f"+-->Vendor: {info.get(_openmp_vendor, '?')}" + if info.get(_openmp_thread, False) + else f"+--> Disabled due to {info.get(_openmp_error, '?')}",), + ("Workqueue Threading Layer Available", info.get(_wkq_thread, '?')), + ("+-->Workqueue imported successfully." if info.get(_wkq_thread, False) + else f"+--> Disabled due to {info.get(_wkq_error, '?')}",), + ("",), + ("__Numba Environment Variable Information__",), + (DisplayMap(info.get(_numba_env_vars, {})) or ('None found.',)), + ("",), + ("__Conda Information__",), + (DisplayMap({k: v for k, v in info.items() + if k.startswith('Conda')}) or ("Conda not available.",)), + ("",), + ("__Installed Packages__",), + DisplaySeq(info.get(_inst_pkg, ("Couldn't retrieve packages info.",))), + ("",), + ("__Error log__" if info.get(_errors, []) + else "No errors reported.",), + DisplaySeq(info.get(_errors, [])), + ("",), + ("__Warning log__" if info.get(_warnings, []) + else "No warnings reported.",), + DisplaySeq(info.get(_warnings, [])), + ("-" * 80,), + ("If requested, please copy and paste the information between\n" + "the dashed (----) lines, or from a given specific section as\n" + "appropriate.\n\n" + "=============================================================\n" + "IMPORTANT: Please ensure that you are happy with sharing the\n" + "contents of the information present, any information that you\n" + "wish to keep private you should remove before sharing.\n" + "=============================================================\n",), + ) + for t in template: + if hasattr(t, 'display_seq_flag'): + print(*t, sep='\n') + elif hasattr(t, 'display_map_flag'): + print(*tuple(fmt % (k, v) for (k, v) in t.items()), sep='\n') + elif hasattr(t, 'display_seqmaps_flag'): + for d in t: + print(*tuple(fmt % ('\t' + k, v) for (k, v) in d.items()), + sep='\n', end='\n') + elif len(t) == 2: + print(fmt % t) + else: + print(*t) + + +if __name__ == '__main__': + display_sysinfo() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/quicksort.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/quicksort.py new file mode 100644 index 0000000000000000000000000000000000000000..e54ca698416c0c269fe9bdbb770b13c42a8a2c46 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/quicksort.py @@ -0,0 +1,261 @@ +import collections + +import numpy as np + +from numba.core import types, config + + +QuicksortImplementation = collections.namedtuple( + 'QuicksortImplementation', + (# The compile function itself + 'compile', + # All subroutines exercised by test_sort + 'partition', 'partition3', 'insertion_sort', + # The top-level function + 'run_quicksort', + )) + + +Partition = collections.namedtuple('Partition', ('start', 'stop')) + +# Under this size, switch to a simple insertion sort +SMALL_QUICKSORT = 15 + +MAX_STACK = 100 + + +def make_quicksort_impl(wrap, lt=None, is_argsort=False, is_list=False, is_np_array=False): + + if config.USE_LEGACY_TYPE_SYSTEM: + intp = types.intp + else: + intp = types.py_int + zero = intp(0) + + # Two subroutines to make the core algorithm generic wrt. argsort + # or normal sorting. Note the genericity may make basic sort() + # slightly slower (~5%) + if is_argsort: + if is_list: + @wrap + def make_res(A): + return [x for x in range(len(A))] + else: + @wrap + def make_res(A): + return np.arange(A.size) + + @wrap + def GET(A, idx_or_val): + return A[idx_or_val] + + else: + @wrap + def make_res(A): + return A + + @wrap + def GET(A, idx_or_val): + return idx_or_val + + def default_lt(a, b): + """ + Trivial comparison function between two keys. + """ + return a < b + + LT = wrap(lt if lt is not None else default_lt) + + @wrap + def insertion_sort(A, R, low, high): + """ + Insertion sort A[low:high + 1]. Note the inclusive bounds. + """ + assert low >= 0 + if high <= low: + return + + for i in range(low + 1, high + 1): + k = R[i] + v = GET(A, k) + # Insert v into A[low:i] + j = i + while j > low and LT(v, GET(A, R[j - 1])): + # Make place for moving A[i] downwards + R[j] = R[j - 1] + j -= 1 + R[j] = k + + @wrap + def partition(A, R, low, high): + """ + Partition A[low:high + 1] around a chosen pivot. The pivot's index + is returned. + """ + assert low >= 0 + assert high > low + + mid = (low + high) >> 1 + # NOTE: the pattern of swaps below for the pivot choice and the + # partitioning gives good results (i.e. regular O(n log n)) + # on sorted, reverse-sorted, and uniform arrays. Subtle changes + # risk breaking this property. + + # median of three {low, middle, high} + if LT(GET(A, R[mid]), GET(A, R[low])): + R[low], R[mid] = R[mid], R[low] + if LT(GET(A, R[high]), GET(A, R[mid])): + R[high], R[mid] = R[mid], R[high] + if LT(GET(A, R[mid]), GET(A, R[low])): + R[low], R[mid] = R[mid], R[low] + pivot = GET(A, R[mid]) + + # Temporarily stash the pivot at the end + R[high], R[mid] = R[mid], R[high] + i = low + j = high - 1 + while True: + while i < high and LT(GET(A, R[i]), pivot): + i += 1 + while j >= low and LT(pivot, GET(A, R[j])): + j -= 1 + if i >= j: + break + R[i], R[j] = R[j], R[i] + i += 1 + j -= 1 + # Put the pivot back in its final place (all items before `i` + # are smaller than the pivot, all items at/after `i` are larger) + R[i], R[high] = R[high], R[i] + return i + + @wrap + def partition3(A, low, high): + """ + Three-way partition [low, high) around a chosen pivot. + A tuple (lt, gt) is returned such that: + - all elements in [low, lt) are < pivot + - all elements in [lt, gt] are == pivot + - all elements in (gt, high] are > pivot + """ + mid = (low + high) >> 1 + # median of three {low, middle, high} + if LT(A[mid], A[low]): + A[low], A[mid] = A[mid], A[low] + if LT(A[high], A[mid]): + A[high], A[mid] = A[mid], A[high] + if LT(A[mid], A[low]): + A[low], A[mid] = A[mid], A[low] + pivot = A[mid] + + A[low], A[mid] = A[mid], A[low] + lt = low + gt = high + i = low + 1 + while i <= gt: + if LT(A[i], pivot): + A[lt], A[i] = A[i], A[lt] + lt += 1 + i += 1 + elif LT(pivot, A[i]): + A[gt], A[i] = A[i], A[gt] + gt -= 1 + else: + i += 1 + return lt, gt + + @wrap + def run_quicksort1(A): + R = make_res(A) + + if len(A) < 2: + return R + + stack = [Partition(zero, zero)] * MAX_STACK + stack[0] = Partition(zero, len(A) - 1) + n = 1 + + while n > 0: + n -= 1 + low, high = stack[n] + # Partition until it becomes more efficient to do an insertion sort + while high - low >= SMALL_QUICKSORT: + assert n < MAX_STACK + i = partition(A, R, low, high) + # Push largest partition on the stack + if high - i > i - low: + # Right is larger + if high > i: + stack[n] = Partition(i + 1, high) + n += 1 + high = i - 1 + else: + if i > low: + stack[n] = Partition(low, i - 1) + n += 1 + low = i + 1 + + insertion_sort(A, R, low, high) + + return R + + if is_np_array: + @wrap + def run_quicksort(A): + if A.ndim == 1: + return run_quicksort1(A) + else: + for idx in np.ndindex(A.shape[:-1]): + run_quicksort1(A[idx]) + return A + else: + @wrap + def run_quicksort(A): + return run_quicksort1(A) + + # Unused quicksort implementation based on 3-way partitioning; the + # partitioning scheme turns out exhibiting bad behaviour on sorted arrays. + @wrap + def _run_quicksort(A): + stack = [Partition(zero, zero)] * 100 + stack[0] = Partition(zero, len(A) - 1) + n = 1 + + while n > 0: + n -= 1 + low, high = stack[n] + # Partition until it becomes more efficient to do an insertion sort + while high - low >= SMALL_QUICKSORT: + assert n < MAX_STACK + l, r = partition3(A, low, high) + # One trivial (empty) partition => iterate on the other + if r == high: + high = l - 1 + elif l == low: + low = r + 1 + # Push largest partition on the stack + elif high - r > l - low: + # Right is larger + stack[n] = Partition(r + 1, high) + n += 1 + high = l - 1 + else: + stack[n] = Partition(low, l - 1) + n += 1 + low = r + 1 + + insertion_sort(A, low, high) + + + return QuicksortImplementation(wrap, + partition, partition3, insertion_sort, + run_quicksort) + + +def make_py_quicksort(*args, **kwargs): + return make_quicksort_impl((lambda f: f), *args, **kwargs) + +def make_jit_quicksort(*args, **kwargs): + from numba.core.extending import register_jitable + return make_quicksort_impl((lambda f: register_jitable(f)), + *args, **kwargs) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/special.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/special.py new file mode 100644 index 0000000000000000000000000000000000000000..36a44cebe74ba00ab82b88150c2cd11b5ae9a25e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/special.py @@ -0,0 +1,104 @@ +import numpy as np + +from numba.core.typing.typeof import typeof +from numba.core.typing.asnumbatype import as_numba_type + + +def pndindex(*args): + """ Provides an n-dimensional parallel iterator that generates index tuples + for each iteration point. Sequentially, pndindex is identical to np.ndindex. + """ + return np.ndindex(*args) + + +class prange(object): + """ Provides a 1D parallel iterator that generates a sequence of integers. + In non-parallel contexts, prange is identical to range. + """ + def __new__(cls, *args): + return range(*args) + + +def _gdb_python_call_gen(func_name, *args): + # generates a call to a function containing a compiled in gdb command, + # this is to make `numba.gdb*` work in the interpreter. + import numba + fn = getattr(numba, func_name) + argstr = ','.join(['"%s"' for _ in args]) % args + defn = """def _gdb_func_injection():\n\t%s(%s)\n + """ % (func_name, argstr) + l = {} + exec(defn, {func_name: fn}, l) + return numba.njit(l['_gdb_func_injection']) + + +def gdb(*args): + """ + Calling this function will invoke gdb and attach it to the current process + at the call site. Arguments are strings in the gdb command language syntax + which will be executed by gdb once initialisation has occurred. + """ + _gdb_python_call_gen('gdb', *args)() + + +def gdb_breakpoint(): + """ + Calling this function will inject a breakpoint at the call site that is + recognised by both `gdb` and `gdb_init`, this is to allow breaking at + multiple points. gdb will stop in the user defined code just after the frame + employed by the breakpoint returns. + """ + _gdb_python_call_gen('gdb_breakpoint')() + + +def gdb_init(*args): + """ + Calling this function will invoke gdb and attach it to the current process + at the call site, then continue executing the process under gdb's control. + Arguments are strings in the gdb command language syntax which will be + executed by gdb once initialisation has occurred. + """ + _gdb_python_call_gen('gdb_init', *args)() + + +def literally(obj): + """Forces Numba to interpret *obj* as an Literal value. + + *obj* must be either a literal or an argument of the caller function, where + the argument must be bound to a literal. The literal requirement + propagates up the call stack. + + This function is intercepted by the compiler to alter the compilation + behavior to wrap the corresponding function parameters as ``Literal``. + It has **no effect** outside of nopython-mode (interpreter, and objectmode). + + The current implementation detects literal arguments in two ways: + + 1. Scans for uses of ``literally`` via a compiler pass. + 2. ``literally`` is overloaded to raise ``numba.errors.ForceLiteralArg`` + to signal the dispatcher to treat the corresponding parameter + differently. This mode is to support indirect use (via a function call). + + The execution semantic of this function is equivalent to an identity + function. + + See :ghfile:`numba/tests/test_literal_dispatch.py` for examples. + """ + return obj + + +def literal_unroll(container): + return container + + +__all__ = [ + 'typeof', + 'as_numba_type', + 'prange', + 'pndindex', + 'gdb', + 'gdb_breakpoint', + 'gdb_init', + 'literally', + 'literal_unroll', +] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/misc/timsort.py b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/timsort.py new file mode 100644 index 0000000000000000000000000000000000000000..ba1560e399ec73fbaad95c2060097a617b9415c7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/misc/timsort.py @@ -0,0 +1,943 @@ +""" +Timsort implementation. Mostly adapted from CPython's listobject.c. + +For more information, see listsort.txt in CPython's source tree. +""" + + +import collections + +from numba.core import types + + +TimsortImplementation = collections.namedtuple( + 'TimsortImplementation', + (# The compile function itself + 'compile', + # All subroutines exercised by test_sort + 'count_run', 'binarysort', 'gallop_left', 'gallop_right', + 'merge_init', 'merge_append', 'merge_pop', + 'merge_compute_minrun', 'merge_lo', 'merge_hi', 'merge_at', + 'merge_force_collapse', 'merge_collapse', + # The top-level functions + 'run_timsort', 'run_timsort_with_values' + )) + + +# The maximum number of entries in a MergeState's pending-runs stack. +# This is enough to sort arrays of size up to about +# 32 * phi ** MAX_MERGE_PENDING +# where phi ~= 1.618. 85 is ridiculously large enough, good for an array +# with 2**64 elements. +# NOTE this implementation doesn't depend on it (the stack is dynamically +# allocated), but it's still good to check as an invariant. +MAX_MERGE_PENDING = 85 + +# When we get into galloping mode, we stay there until both runs win less +# often than MIN_GALLOP consecutive times. See listsort.txt for more info. +MIN_GALLOP = 7 + +# Start size for temp arrays. +MERGESTATE_TEMP_SIZE = 256 + +# A mergestate is a named tuple with the following members: +# - *min_gallop* is an integer controlling when we get into galloping mode +# - *keys* is a temp list for merging keys +# - *values* is a temp list for merging values, if needed +# - *pending* is a stack of pending runs to be merged +# - *n* is the current stack length of *pending* + +MergeState = collections.namedtuple( + 'MergeState', ('min_gallop', 'keys', 'values', 'pending', 'n')) + + +MergeRun = collections.namedtuple('MergeRun', ('start', 'size')) + + +def make_timsort_impl(wrap, make_temp_area): + + make_temp_area = wrap(make_temp_area) + intp = types.intp + zero = intp(0) + + @wrap + def has_values(keys, values): + return values is not keys + + @wrap + def merge_init(keys): + """ + Initialize a MergeState for a non-keyed sort. + """ + temp_size = min(len(keys) // 2 + 1, MERGESTATE_TEMP_SIZE) + temp_keys = make_temp_area(keys, temp_size) + temp_values = temp_keys + pending = [MergeRun(zero, zero)] * MAX_MERGE_PENDING + return MergeState(intp(MIN_GALLOP), temp_keys, temp_values, pending, zero) + + @wrap + def merge_init_with_values(keys, values): + """ + Initialize a MergeState for a keyed sort. + """ + temp_size = min(len(keys) // 2 + 1, MERGESTATE_TEMP_SIZE) + temp_keys = make_temp_area(keys, temp_size) + temp_values = make_temp_area(values, temp_size) + pending = [MergeRun(zero, zero)] * MAX_MERGE_PENDING + return MergeState(intp(MIN_GALLOP), temp_keys, temp_values, pending, zero) + + @wrap + def merge_append(ms, run): + """ + Append a run on the merge stack. + """ + n = ms.n + assert n < MAX_MERGE_PENDING + ms.pending[n] = run + return MergeState(ms.min_gallop, ms.keys, ms.values, ms.pending, n + 1) + + @wrap + def merge_pop(ms): + """ + Pop the top run from the merge stack. + """ + return MergeState(ms.min_gallop, ms.keys, ms.values, ms.pending, ms.n - 1) + + @wrap + def merge_getmem(ms, need): + """ + Ensure enough temp memory for 'need' items is available. + """ + alloced = len(ms.keys) + if need <= alloced: + return ms + # Over-allocate + while alloced < need: + alloced = alloced << 1 + # Don't realloc! That can cost cycles to copy the old data, but + # we don't care what's in the block. + temp_keys = make_temp_area(ms.keys, alloced) + if has_values(ms.keys, ms.values): + temp_values = make_temp_area(ms.values, alloced) + else: + temp_values = temp_keys + return MergeState(ms.min_gallop, temp_keys, temp_values, ms.pending, ms.n) + + @wrap + def merge_adjust_gallop(ms, new_gallop): + """ + Modify the MergeState's min_gallop. + """ + return MergeState(intp(new_gallop), ms.keys, ms.values, ms.pending, ms.n) + + + @wrap + def LT(a, b): + """ + Trivial comparison function between two keys. This is factored out to + make it clear where comparisons occur. + """ + return a < b + + @wrap + def binarysort(keys, values, lo, hi, start): + """ + binarysort is the best method for sorting small arrays: it does + few compares, but can do data movement quadratic in the number of + elements. + [lo, hi) is a contiguous slice of a list, and is sorted via + binary insertion. This sort is stable. + On entry, must have lo <= start <= hi, and that [lo, start) is already + sorted (pass start == lo if you don't know!). + """ + assert lo <= start and start <= hi + _has_values = has_values(keys, values) + if lo == start: + start += 1 + while start < hi: + pivot = keys[start] + # Bisect to find where to insert `pivot` + # NOTE: bisection only wins over linear search if the comparison + # function is much more expensive than simply moving data. + l = lo + r = start + # Invariants: + # pivot >= all in [lo, l). + # pivot < all in [r, start). + # The second is vacuously true at the start. + while l < r: + p = l + ((r - l) >> 1) + if LT(pivot, keys[p]): + r = p + else: + l = p+1 + + # The invariants still hold, so pivot >= all in [lo, l) and + # pivot < all in [l, start), so pivot belongs at l. Note + # that if there are elements equal to pivot, l points to the + # first slot after them -- that's why this sort is stable. + # Slide over to make room (aka memmove()). + for p in range(start, l, -1): + keys[p] = keys[p - 1] + keys[l] = pivot + if _has_values: + pivot_val = values[start] + for p in range(start, l, -1): + values[p] = values[p - 1] + values[l] = pivot_val + + start += 1 + + + @wrap + def count_run(keys, lo, hi): + """ + Return the length of the run beginning at lo, in the slice [lo, hi). + lo < hi is required on entry. "A run" is the longest ascending sequence, with + + lo[0] <= lo[1] <= lo[2] <= ... + + or the longest descending sequence, with + + lo[0] > lo[1] > lo[2] > ... + + A tuple (length, descending) is returned, where boolean *descending* + is set to 0 in the former case, or to 1 in the latter. + For its intended use in a stable mergesort, the strictness of the defn of + "descending" is needed so that the caller can safely reverse a descending + sequence without violating stability (strict > ensures there are no equal + elements to get out of order). + """ + assert lo < hi + if lo + 1 == hi: + # Trivial 1-long run + return 1, False + if LT(keys[lo + 1], keys[lo]): + # Descending run + for k in range(lo + 2, hi): + if not LT(keys[k], keys[k - 1]): + return k - lo, True + return hi - lo, True + else: + # Ascending run + for k in range(lo + 2, hi): + if LT(keys[k], keys[k - 1]): + return k - lo, False + return hi - lo, False + + + @wrap + def gallop_left(key, a, start, stop, hint): + """ + Locate the proper position of key in a sorted vector; if the vector contains + an element equal to key, return the position immediately to the left of + the leftmost equal element. [gallop_right() does the same except returns + the position to the right of the rightmost equal element (if any).] + + "a" is a sorted vector with stop elements, starting at a[start]. + stop must be > start. + + "hint" is an index at which to begin the search, start <= hint < stop. + The closer hint is to the final result, the faster this runs. + + The return value is the int k in start..stop such that + + a[k-1] < key <= a[k] + + pretending that a[start-1] is minus infinity and a[stop] is plus infinity. + IOW, key belongs at index k; or, IOW, the first k elements of a should + precede key, and the last stop-start-k should follow key. + + See listsort.txt for info on the method. + """ + assert stop > start + assert hint >= start and hint < stop + n = stop - start + + # First, gallop from the hint to find a "good" subinterval for bisecting + lastofs = 0 + ofs = 1 + if LT(a[hint], key): + # a[hint] < key => gallop right, until + # a[hint + lastofs] < key <= a[hint + ofs] + maxofs = stop - hint + while ofs < maxofs: + if LT(a[hint + ofs], key): + lastofs = ofs + ofs = (ofs << 1) + 1 + if ofs <= 0: + # Int overflow + ofs = maxofs + else: + # key <= a[hint + ofs] + break + if ofs > maxofs: + ofs = maxofs + # Translate back to offsets relative to a[0] + lastofs += hint + ofs += hint + else: + # key <= a[hint] => gallop left, until + # a[hint - ofs] < key <= a[hint - lastofs] + maxofs = hint - start + 1 + while ofs < maxofs: + if LT(a[hint - ofs], key): + break + else: + # key <= a[hint - ofs] + lastofs = ofs + ofs = (ofs << 1) + 1 + if ofs <= 0: + # Int overflow + ofs = maxofs + if ofs > maxofs: + ofs = maxofs + # Translate back to positive offsets relative to a[0] + lastofs, ofs = hint - ofs, hint - lastofs + + assert start - 1 <= lastofs and lastofs < ofs and ofs <= stop + # Now a[lastofs] < key <= a[ofs], so key belongs somewhere to the + # right of lastofs but no farther right than ofs. Do a binary + # search, with invariant a[lastofs-1] < key <= a[ofs]. + lastofs += 1 + while lastofs < ofs: + m = lastofs + ((ofs - lastofs) >> 1) + if LT(a[m], key): + # a[m] < key + lastofs = m + 1 + else: + # key <= a[m] + ofs = m + # Now lastofs == ofs, so a[ofs - 1] < key <= a[ofs] + return ofs + + + @wrap + def gallop_right(key, a, start, stop, hint): + """ + Exactly like gallop_left(), except that if key already exists in a[start:stop], + finds the position immediately to the right of the rightmost equal value. + + The return value is the int k in start..stop such that + + a[k-1] <= key < a[k] + + The code duplication is massive, but this is enough different given that + we're sticking to "<" comparisons that it's much harder to follow if + written as one routine with yet another "left or right?" flag. + """ + assert stop > start + assert hint >= start and hint < stop + n = stop - start + + # First, gallop from the hint to find a "good" subinterval for bisecting + lastofs = 0 + ofs = 1 + if LT(key, a[hint]): + # key < a[hint] => gallop left, until + # a[hint - ofs] <= key < a[hint - lastofs] + maxofs = hint - start + 1 + while ofs < maxofs: + if LT(key, a[hint - ofs]): + lastofs = ofs + ofs = (ofs << 1) + 1 + if ofs <= 0: + # Int overflow + ofs = maxofs + else: + # a[hint - ofs] <= key + break + if ofs > maxofs: + ofs = maxofs + # Translate back to positive offsets relative to a[0] + lastofs, ofs = hint - ofs, hint - lastofs + else: + # a[hint] <= key -- gallop right, until + # a[hint + lastofs] <= key < a[hint + ofs] + maxofs = stop - hint + while ofs < maxofs: + if LT(key, a[hint + ofs]): + break + else: + # a[hint + ofs] <= key + lastofs = ofs + ofs = (ofs << 1) + 1 + if ofs <= 0: + # Int overflow + ofs = maxofs + if ofs > maxofs: + ofs = maxofs + # Translate back to offsets relative to a[0] + lastofs += hint + ofs += hint + + assert start - 1 <= lastofs and lastofs < ofs and ofs <= stop + # Now a[lastofs] <= key < a[ofs], so key belongs somewhere to the + # right of lastofs but no farther right than ofs. Do a binary + # search, with invariant a[lastofs-1] <= key < a[ofs]. + lastofs += 1 + while lastofs < ofs: + m = lastofs + ((ofs - lastofs) >> 1) + if LT(key, a[m]): + # key < a[m] + ofs = m + else: + # a[m] <= key + lastofs = m + 1 + # Now lastofs == ofs, so a[ofs - 1] <= key < a[ofs] + return ofs + + + @wrap + def merge_compute_minrun(n): + """ + Compute a good value for the minimum run length; natural runs shorter + than this are boosted artificially via binary insertion. + + If n < 64, return n (it's too small to bother with fancy stuff). + Else if n is an exact power of 2, return 32. + Else return an int k, 32 <= k <= 64, such that n/k is close to, but + strictly less than, an exact power of 2. + + See listsort.txt for more info. + """ + r = 0 + assert n >= 0 + while n >= 64: + r |= n & 1 + n >>= 1 + return n + r + + + @wrap + def sortslice_copy(dest_keys, dest_values, dest_start, + src_keys, src_values, src_start, + nitems): + """ + Upwards memcpy(). + """ + assert src_start >= 0 + assert dest_start >= 0 + for i in range(nitems): + dest_keys[dest_start + i] = src_keys[src_start + i] + if has_values(src_keys, src_values): + for i in range(nitems): + dest_values[dest_start + i] = src_values[src_start + i] + + @wrap + def sortslice_copy_down(dest_keys, dest_values, dest_start, + src_keys, src_values, src_start, + nitems): + """ + Downwards memcpy(). + """ + assert src_start >= 0 + assert dest_start >= 0 + for i in range(nitems): + dest_keys[dest_start - i] = src_keys[src_start - i] + if has_values(src_keys, src_values): + for i in range(nitems): + dest_values[dest_start - i] = src_values[src_start - i] + + + # Disable this for debug or perf comparison + DO_GALLOP = 1 + + @wrap + def merge_lo(ms, keys, values, ssa, na, ssb, nb): + """ + Merge the na elements starting at ssa with the nb elements starting at + ssb = ssa + na in a stable way, in-place. na and nb must be > 0, + and should have na <= nb. See listsort.txt for more info. + + An updated MergeState is returned (with possibly a different min_gallop + or larger temp arrays). + + NOTE: compared to CPython's timsort, the requirement that + "Must also have that keys[ssa + na - 1] belongs at the end of the merge" + + is removed. This makes the code a bit simpler and easier to reason about. + """ + assert na > 0 and nb > 0 and na <= nb + assert ssb == ssa + na + # First copy [ssa, ssa + na) into the temp space + ms = merge_getmem(ms, na) + sortslice_copy(ms.keys, ms.values, 0, + keys, values, ssa, + na) + a_keys = ms.keys + a_values = ms.values + b_keys = keys + b_values = values + dest = ssa + ssa = 0 + + _has_values = has_values(a_keys, a_values) + min_gallop = ms.min_gallop + + # Now start merging into the space left from [ssa, ...) + + while nb > 0 and na > 0: + # Do the straightforward thing until (if ever) one run + # appears to win consistently. + acount = 0 + bcount = 0 + + while True: + if LT(b_keys[ssb], a_keys[ssa]): + keys[dest] = b_keys[ssb] + if _has_values: + values[dest] = b_values[ssb] + dest += 1 + ssb += 1 + nb -= 1 + if nb == 0: + break + # It's a B run + bcount += 1 + acount = 0 + if bcount >= min_gallop: + break + else: + keys[dest] = a_keys[ssa] + if _has_values: + values[dest] = a_values[ssa] + dest += 1 + ssa += 1 + na -= 1 + if na == 0: + break + # It's a A run + acount += 1 + bcount = 0 + if acount >= min_gallop: + break + + # One run is winning so consistently that galloping may + # be a huge win. So try that, and continue galloping until + # (if ever) neither run appears to be winning consistently + # anymore. + if DO_GALLOP and na > 0 and nb > 0: + min_gallop += 1 + + while acount >= MIN_GALLOP or bcount >= MIN_GALLOP: + # As long as we gallop without leaving this loop, make + # the heuristic more likely + min_gallop -= min_gallop > 1 + + # Gallop in A to find where keys[ssb] should end up + k = gallop_right(b_keys[ssb], a_keys, ssa, ssa + na, ssa) + # k is an index, make it a size + k -= ssa + acount = k + if k > 0: + # Copy everything from A before k + sortslice_copy(keys, values, dest, + a_keys, a_values, ssa, + k) + dest += k + ssa += k + na -= k + if na == 0: + # Finished merging + break + # Copy keys[ssb] + keys[dest] = b_keys[ssb] + if _has_values: + values[dest] = b_values[ssb] + dest += 1 + ssb += 1 + nb -= 1 + if nb == 0: + # Finished merging + break + + # Gallop in B to find where keys[ssa] should end up + k = gallop_left(a_keys[ssa], b_keys, ssb, ssb + nb, ssb) + # k is an index, make it a size + k -= ssb + bcount = k + if k > 0: + # Copy everything from B before k + # NOTE: source and dest are the same buffer, but the + # destination index is below the source index + sortslice_copy(keys, values, dest, + b_keys, b_values, ssb, + k) + dest += k + ssb += k + nb -= k + if nb == 0: + # Finished merging + break + # Copy keys[ssa] + keys[dest] = a_keys[ssa] + if _has_values: + values[dest] = a_values[ssa] + dest += 1 + ssa += 1 + na -= 1 + if na == 0: + # Finished merging + break + + # Penalize it for leaving galloping mode + min_gallop += 1 + + # Merge finished, now handle the remaining areas + if nb == 0: + # Only A remaining to copy at the end of the destination area + sortslice_copy(keys, values, dest, + a_keys, a_values, ssa, + na) + else: + assert na == 0 + assert dest == ssb + # B's tail is already at the right place, do nothing + + return merge_adjust_gallop(ms, min_gallop) + + + @wrap + def merge_hi(ms, keys, values, ssa, na, ssb, nb): + """ + Merge the na elements starting at ssa with the nb elements starting at + ssb = ssa + na in a stable way, in-place. na and nb must be > 0, + and should have na >= nb. See listsort.txt for more info. + + An updated MergeState is returned (with possibly a different min_gallop + or larger temp arrays). + + NOTE: compared to CPython's timsort, the requirement that + "Must also have that keys[ssa + na - 1] belongs at the end of the merge" + + is removed. This makes the code a bit simpler and easier to reason about. + """ + assert na > 0 and nb > 0 and na >= nb + assert ssb == ssa + na + # First copy [ssb, ssb + nb) into the temp space + ms = merge_getmem(ms, nb) + sortslice_copy(ms.keys, ms.values, 0, + keys, values, ssb, + nb) + a_keys = keys + a_values = values + b_keys = ms.keys + b_values = ms.values + + # Now start merging *in descending order* into the space left + # from [..., ssb + nb). + dest = ssb + nb - 1 + ssb = nb - 1 + ssa = ssa + na - 1 + + _has_values = has_values(b_keys, b_values) + min_gallop = ms.min_gallop + + while nb > 0 and na > 0: + # Do the straightforward thing until (if ever) one run + # appears to win consistently. + acount = 0 + bcount = 0 + + while True: + if LT(b_keys[ssb], a_keys[ssa]): + # We merge in descending order, so copy the larger value + keys[dest] = a_keys[ssa] + if _has_values: + values[dest] = a_values[ssa] + dest -= 1 + ssa -= 1 + na -= 1 + if na == 0: + break + # It's a A run + acount += 1 + bcount = 0 + if acount >= min_gallop: + break + else: + keys[dest] = b_keys[ssb] + if _has_values: + values[dest] = b_values[ssb] + dest -= 1 + ssb -= 1 + nb -= 1 + if nb == 0: + break + # It's a B run + bcount += 1 + acount = 0 + if bcount >= min_gallop: + break + + # One run is winning so consistently that galloping may + # be a huge win. So try that, and continue galloping until + # (if ever) neither run appears to be winning consistently + # anymore. + if DO_GALLOP and na > 0 and nb > 0: + min_gallop += 1 + + while acount >= MIN_GALLOP or bcount >= MIN_GALLOP: + # As long as we gallop without leaving this loop, make + # the heuristic more likely + min_gallop -= min_gallop > 1 + + # Gallop in A to find where keys[ssb] should end up + k = gallop_right(b_keys[ssb], a_keys, ssa - na + 1, ssa + 1, ssa) + # k is an index, make it a size from the end + k = ssa + 1 - k + acount = k + if k > 0: + # Copy everything from A after k. + # Destination and source are the same buffer, and destination + # index is greater, so copy from the end to the start. + sortslice_copy_down(keys, values, dest, + a_keys, a_values, ssa, + k) + dest -= k + ssa -= k + na -= k + if na == 0: + # Finished merging + break + # Copy keys[ssb] + keys[dest] = b_keys[ssb] + if _has_values: + values[dest] = b_values[ssb] + dest -= 1 + ssb -= 1 + nb -= 1 + if nb == 0: + # Finished merging + break + + # Gallop in B to find where keys[ssa] should end up + k = gallop_left(a_keys[ssa], b_keys, ssb - nb + 1, ssb + 1, ssb) + # k is an index, make it a size from the end + k = ssb + 1 - k + bcount = k + if k > 0: + # Copy everything from B before k + sortslice_copy_down(keys, values, dest, + b_keys, b_values, ssb, + k) + dest -= k + ssb -= k + nb -= k + if nb == 0: + # Finished merging + break + # Copy keys[ssa] + keys[dest] = a_keys[ssa] + if _has_values: + values[dest] = a_values[ssa] + dest -= 1 + ssa -= 1 + na -= 1 + if na == 0: + # Finished merging + break + + # Penalize it for leaving galloping mode + min_gallop += 1 + + # Merge finished, now handle the remaining areas + if na == 0: + # Only B remaining to copy at the front of the destination area + sortslice_copy(keys, values, dest - nb + 1, + b_keys, b_values, ssb - nb + 1, + nb) + else: + assert nb == 0 + assert dest == ssa + # A's front is already at the right place, do nothing + + return merge_adjust_gallop(ms, min_gallop) + + + @wrap + def merge_at(ms, keys, values, i): + """ + Merge the two runs at stack indices i and i+1. + + An updated MergeState is returned. + """ + n = ms.n + assert n >= 2 + assert i >= 0 + assert i == n - 2 or i == n - 3 + + ssa, na = ms.pending[i] + ssb, nb = ms.pending[i + 1] + assert na > 0 and nb > 0 + assert ssa + na == ssb + + # Record the length of the combined runs; if i is the 3rd-last + # run now, also slide over the last run (which isn't involved + # in this merge). The current run i+1 goes away in any case. + ms.pending[i] = MergeRun(ssa, na + nb) + if i == n - 3: + ms.pending[i + 1] = ms.pending[i + 2] + ms = merge_pop(ms) + + # Where does b start in a? Elements in a before that can be + # ignored (already in place). + k = gallop_right(keys[ssb], keys, ssa, ssa + na, ssa) + # [k, ssa + na) remains to be merged + na -= k - ssa + ssa = k + if na == 0: + return ms + + # Where does a end in b? Elements in b after that can be + # ignored (already in place). + k = gallop_left(keys[ssa + na - 1], keys, ssb, ssb + nb, ssb + nb - 1) + # [ssb, k) remains to be merged + nb = k - ssb + + # Merge what remains of the runs, using a temp array with + # min(na, nb) elements. + if na <= nb: + return merge_lo(ms, keys, values, ssa, na, ssb, nb) + else: + return merge_hi(ms, keys, values, ssa, na, ssb, nb) + + + @wrap + def merge_collapse(ms, keys, values): + """ + Examine the stack of runs waiting to be merged, merging adjacent runs + until the stack invariants are re-established: + + 1. len[-3] > len[-2] + len[-1] + 2. len[-2] > len[-1] + + An updated MergeState is returned. + + See listsort.txt for more info. + """ + while ms.n > 1: + pending = ms.pending + n = ms.n - 2 + if ((n > 0 and pending[n-1].size <= pending[n].size + pending[n+1].size) or + (n > 1 and pending[n-2].size <= pending[n-1].size + pending[n].size)): + if pending[n - 1].size < pending[n + 1].size: + # Merge smaller one first + n -= 1 + ms = merge_at(ms, keys, values, n) + elif pending[n].size < pending[n + 1].size: + ms = merge_at(ms, keys, values, n) + else: + break + return ms + + @wrap + def merge_force_collapse(ms, keys, values): + """ + Regardless of invariants, merge all runs on the stack until only one + remains. This is used at the end of the mergesort. + + An updated MergeState is returned. + """ + while ms.n > 1: + pending = ms.pending + n = ms.n - 2 + if n > 0: + if pending[n - 1].size < pending[n + 1].size: + # Merge the smaller one first + n -= 1 + ms = merge_at(ms, keys, values, n) + return ms + + + @wrap + def reverse_slice(keys, values, start, stop): + """ + Reverse a slice, in-place. + """ + i = start + j = stop - 1 + while i < j: + keys[i], keys[j] = keys[j], keys[i] + i += 1 + j -= 1 + if has_values(keys, values): + i = start + j = stop - 1 + while i < j: + values[i], values[j] = values[j], values[i] + i += 1 + j -= 1 + + + @wrap + def run_timsort_with_mergestate(ms, keys, values): + """ + Run timsort with the mergestate. + """ + nremaining = len(keys) + if nremaining < 2: + return + + # March over the array once, left to right, finding natural runs, + # and extending short natural runs to minrun elements. + minrun = merge_compute_minrun(nremaining) + + lo = zero + while nremaining > 0: + n, desc = count_run(keys, lo, lo + nremaining) + if desc: + # Descending run => reverse + reverse_slice(keys, values, lo, lo + n) + # If short, extend to min(minrun, nremaining) + if n < minrun: + force = min(minrun, nremaining) + binarysort(keys, values, lo, lo + force, lo + n) + n = force + # Push run onto stack, and maybe merge. + ms = merge_append(ms, MergeRun(lo, n)) + ms = merge_collapse(ms, keys, values) + # Advance to find next run. + lo += n + nremaining -= n + + # All initial runs have been discovered, now finish merging. + ms = merge_force_collapse(ms, keys, values) + assert ms.n == 1 + assert ms.pending[0] == (0, len(keys)) + + + @wrap + def run_timsort(keys): + """ + Run timsort over the given keys. + """ + values = keys + run_timsort_with_mergestate(merge_init(keys), keys, values) + + + @wrap + def run_timsort_with_values(keys, values): + """ + Run timsort over the given keys and values. + """ + run_timsort_with_mergestate(merge_init_with_values(keys, values), + keys, values) + + return TimsortImplementation( + wrap, + count_run, binarysort, gallop_left, gallop_right, + merge_init, merge_append, merge_pop, + merge_compute_minrun, merge_lo, merge_hi, merge_at, + merge_force_collapse, merge_collapse, + run_timsort, run_timsort_with_values) + + +def make_py_timsort(*args): + return make_timsort_impl((lambda f: f), *args) + +def make_jit_timsort(*args): + from numba import jit + return make_timsort_impl((lambda f: jit(nopython=True)(f)), + *args) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/arraymath.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/arraymath.py new file mode 100644 index 0000000000000000000000000000000000000000..1d4d2ef15e8d106c407655027088d578ffc28c5a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/arraymath.py @@ -0,0 +1,10 @@ +import sys +from numba.core.utils import _RedirectSubpackage +from numba.core import config + +if config.USE_LEGACY_TYPE_SYSTEM: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.np.old_arraymath") +else: + sys.modules[__name__] = _RedirectSubpackage(locals(), + "numba.np.new_arraymath") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/arrayobj.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/arrayobj.py new file mode 100644 index 0000000000000000000000000000000000000000..712668fa8a995aa9000e05be75f1581e92e75a5e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/arrayobj.py @@ -0,0 +1,7034 @@ +""" +Implementation of operations on Array objects and objects supporting +the buffer protocol. +""" + +import functools +import math +import operator +import textwrap + +from llvmlite import ir +from llvmlite.ir import Constant + +import numpy as np + +from numba import pndindex, literal_unroll +from numba.core import types, typing, errors, cgutils, extending, config +from numba.np.numpy_support import (as_dtype, from_dtype, carray, farray, + is_contiguous, is_fortran, + check_is_integer, type_is_scalar, + lt_complex, lt_floats) +from numba.np.numpy_support import type_can_asarray, is_nonelike, numpy_version +from numba.core.imputils import (lower_builtin, lower_getattr, + lower_getattr_generic, + lower_setattr_generic, + lower_cast, lower_constant, + iternext_impl, impl_ret_borrowed, + impl_ret_new_ref, impl_ret_untracked, + RefType) +from numba.core.typing import signature +from numba.core.types import StringLiteral +from numba.core.extending import (register_jitable, overload, overload_method, + intrinsic, overload_attribute) +from numba.misc import quicksort, mergesort +from numba.cpython import slicing +from numba.cpython.unsafe.tuple import tuple_setitem, build_full_slice_tuple +from numba.core.extending import overload_classmethod +from numba.core.typing.npydecl import (parse_dtype as ty_parse_dtype, + parse_shape as ty_parse_shape, + _parse_nested_sequence, + _sequence_of_arrays, + _choose_concatenation_layout) + + +def set_range_metadata(builder, load, lower_bound, upper_bound): + """ + Set the "range" metadata on a load instruction. + Note the interval is in the form [lower_bound, upper_bound). + """ + range_operands = [Constant(load.type, lower_bound), + Constant(load.type, upper_bound)] + md = builder.module.add_metadata(range_operands) + load.set_metadata("range", md) + + +def mark_positive(builder, load): + """ + Mark the result of a load instruction as positive (or zero). + """ + upper_bound = (1 << (load.type.width - 1)) - 1 + set_range_metadata(builder, load, 0, upper_bound) + + +def make_array(array_type): + """ + Return the Structure representation of the given *array_type* + (an instance of types.ArrayCompatible). + + Note this does not call __array_wrap__ in case a new array structure + is being created (rather than populated). + """ + real_array_type = array_type.as_array + base = cgutils.create_struct_proxy(real_array_type) + ndim = real_array_type.ndim + + class ArrayStruct(base): + + def _make_refs(self, ref): + sig = signature(real_array_type, array_type) + try: + array_impl = self._context.get_function('__array__', sig) + except NotImplementedError: + return super(ArrayStruct, self)._make_refs(ref) + + # Return a wrapped structure and its unwrapped reference + datamodel = self._context.data_model_manager[array_type] + be_type = self._get_be_type(datamodel) + if ref is None: + outer_ref = cgutils.alloca_once(self._builder, be_type, + zfill=True) + else: + outer_ref = ref + # NOTE: __array__ is called with a pointer and expects a pointer + # in return! + ref = array_impl(self._builder, (outer_ref,)) + return outer_ref, ref + + @property + def shape(self): + """ + Override .shape to inform LLVM that its elements are all positive. + """ + builder = self._builder + if ndim == 0: + return base.__getattr__(self, "shape") + + # Unfortunately, we can't use llvm.assume as its presence can + # seriously pessimize performance, + # *and* the range metadata currently isn't improving anything here, + # see https://llvm.org/bugs/show_bug.cgi?id=23848 ! + ptr = self._get_ptr_by_name("shape") + dims = [] + for i in range(ndim): + dimptr = cgutils.gep_inbounds(builder, ptr, 0, i) + load = builder.load(dimptr) + dims.append(load) + mark_positive(builder, load) + + return cgutils.pack_array(builder, dims) + + return ArrayStruct + + +def get_itemsize(context, array_type): + """ + Return the item size for the given array or buffer type. + """ + llty = context.get_data_type(array_type.dtype) + return context.get_abi_sizeof(llty) + + +def load_item(context, builder, arrayty, ptr): + """ + Load the item at the given array pointer. + """ + align = None if arrayty.aligned else 1 + return context.unpack_value(builder, arrayty.dtype, ptr, + align=align) + + +def store_item(context, builder, arrayty, val, ptr): + """ + Store the item at the given array pointer. + """ + align = None if arrayty.aligned else 1 + return context.pack_value(builder, arrayty.dtype, val, ptr, align=align) + + +def fix_integer_index(context, builder, idxty, idx, size): + """ + Fix the integer index' type and value for the given dimension size. + """ + if idxty.signed: + ind = context.cast(builder, idx, idxty, types.intp) + ind = slicing.fix_index(builder, ind, size) + else: + ind = context.cast(builder, idx, idxty, types.uintp) + return ind + + +def normalize_index(context, builder, idxty, idx): + """ + Normalize the index type and value. 0-d arrays are converted to scalars. + """ + if isinstance(idxty, types.Array) and idxty.ndim == 0: + assert isinstance(idxty.dtype, types.Integer) + idxary = make_array(idxty)(context, builder, idx) + idxval = load_item(context, builder, idxty, idxary.data) + return idxty.dtype, idxval + else: + return idxty, idx + + +def normalize_indices(context, builder, index_types, indices): + """ + Same as normalize_index(), but operating on sequences of + index types and values. + """ + if len(indices): + index_types, indices = zip(*[normalize_index(context, builder, idxty, + idx) + for idxty, idx in zip(index_types, indices) + ]) + return index_types, indices + + +def populate_array(array, data, shape, strides, itemsize, meminfo, + parent=None): + """ + Helper function for populating array structures. + This avoids forgetting to set fields. + + *shape* and *strides* can be Python tuples or LLVM arrays. + """ + context = array._context + builder = array._builder + datamodel = array._datamodel + # doesn't matter what this array type instance is, it's just to get the + # fields for the datamodel of the standard array type in this context + standard_array = types.Array(types.float64, 1, 'C') + standard_array_type_datamodel = context.data_model_manager[standard_array] + required_fields = set(standard_array_type_datamodel._fields) + datamodel_fields = set(datamodel._fields) + # Make sure that the presented array object has a data model that is close + # enough to an array for this function to proceed. + if (required_fields & datamodel_fields) != required_fields: + missing = required_fields - datamodel_fields + msg = (f"The datamodel for type {array._fe_type} is missing " + f"field{'s' if len(missing) > 1 else ''} {missing}.") + raise ValueError(msg) + + if meminfo is None: + meminfo = Constant(context.get_value_type( + datamodel.get_type('meminfo')), None) + + intp_t = context.get_value_type(types.intp) + if isinstance(shape, (tuple, list)): + shape = cgutils.pack_array(builder, shape, intp_t) + if isinstance(strides, (tuple, list)): + strides = cgutils.pack_array(builder, strides, intp_t) + if isinstance(itemsize, int): + itemsize = intp_t(itemsize) + + attrs = dict(shape=shape, + strides=strides, + data=data, + itemsize=itemsize, + meminfo=meminfo,) + + # Set `parent` attribute + if parent is None: + attrs['parent'] = Constant(context.get_value_type( + datamodel.get_type('parent')), None) + else: + attrs['parent'] = parent + # Calc num of items from shape + nitems = context.get_constant(types.intp, 1) + unpacked_shape = cgutils.unpack_tuple(builder, shape, shape.type.count) + # (note empty shape => 0d array therefore nitems = 1) + for axlen in unpacked_shape: + nitems = builder.mul(nitems, axlen, flags=['nsw']) + attrs['nitems'] = nitems + + # Make sure that we have all the fields + got_fields = set(attrs.keys()) + if got_fields != required_fields: + raise ValueError("missing {0}".format(required_fields - got_fields)) + + # Set field value + for k, v in attrs.items(): + setattr(array, k, v) + + return array + + +def update_array_info(aryty, array): + """ + Update some auxiliary information in *array* after some of its fields + were changed. `itemsize` and `nitems` are updated. + """ + context = array._context + builder = array._builder + + # Calc num of items from shape + nitems = context.get_constant(types.intp, 1) + unpacked_shape = cgutils.unpack_tuple(builder, array.shape, aryty.ndim) + for axlen in unpacked_shape: + nitems = builder.mul(nitems, axlen, flags=['nsw']) + array.nitems = nitems + + array.itemsize = context.get_constant(types.intp, + get_itemsize(context, aryty)) + + +def normalize_axis(func_name, arg_name, ndim, axis): + """Constrain axis values to valid positive values.""" + raise NotImplementedError() + + +@overload(normalize_axis) +def normalize_axis_overloads(func_name, arg_name, ndim, axis): + if not isinstance(func_name, StringLiteral): + raise errors.TypingError("func_name must be a str literal.") + if not isinstance(arg_name, StringLiteral): + raise errors.TypingError("arg_name must be a str literal.") + + msg = ( + f"{func_name.literal_value}: Argument {arg_name.literal_value} " + "out of bounds for dimensions of the array" + ) + + def impl(func_name, arg_name, ndim, axis): + if axis < 0: + axis += ndim + if axis < 0 or axis >= ndim: + raise ValueError(msg) + + return axis + + return impl + + +@lower_builtin('getiter', types.Buffer) +def getiter_array(context, builder, sig, args): + [arrayty] = sig.args + [array] = args + + iterobj = context.make_helper(builder, sig.return_type) + + zero = context.get_constant(types.intp, 0) + indexptr = cgutils.alloca_once_value(builder, zero) + + iterobj.index = indexptr + iterobj.array = array + + # Incref array + if context.enable_nrt: + context.nrt.incref(builder, arrayty, array) + + res = iterobj._getvalue() + + # Note: a decref on the iterator will dereference all internal MemInfo* + out = impl_ret_new_ref(context, builder, sig.return_type, res) + return out + + +def _getitem_array_single_int(context, builder, return_type, aryty, ary, idx): + """ Evaluate `ary[idx]`, where idx is a single int. """ + # optimized form of _getitem_array_generic + shapes = cgutils.unpack_tuple(builder, ary.shape, count=aryty.ndim) + strides = cgutils.unpack_tuple(builder, ary.strides, count=aryty.ndim) + offset = builder.mul(strides[0], idx) + dataptr = cgutils.pointer_add(builder, ary.data, offset) + view_shapes = shapes[1:] + view_strides = strides[1:] + + if isinstance(return_type, types.Buffer): + # Build array view + retary = make_view(context, builder, aryty, ary, return_type, + dataptr, view_shapes, view_strides) + return retary._getvalue() + else: + # Load scalar from 0-d result + assert not view_shapes + return load_item(context, builder, aryty, dataptr) + + +@lower_builtin('iternext', types.ArrayIterator) +@iternext_impl(RefType.BORROWED) +def iternext_array(context, builder, sig, args, result): + [iterty] = sig.args + [iter] = args + arrayty = iterty.array_type + + iterobj = context.make_helper(builder, iterty, value=iter) + ary = make_array(arrayty)(context, builder, value=iterobj.array) + + nitems, = cgutils.unpack_tuple(builder, ary.shape, count=1) + + index = builder.load(iterobj.index) + is_valid = builder.icmp_signed('<', index, nitems) + result.set_valid(is_valid) + + with builder.if_then(is_valid): + value = _getitem_array_single_int( + context, builder, iterty.yield_type, arrayty, ary, index + ) + result.yield_(value) + nindex = cgutils.increment_index(builder, index) + builder.store(nindex, iterobj.index) + + +# ------------------------------------------------------------------------------ +# Basic indexing (with integers and slices only) + +def basic_indexing(context, builder, aryty, ary, index_types, indices, + boundscheck=None): + """ + Perform basic indexing on the given array. + A (data pointer, shapes, strides) tuple is returned describing + the corresponding view. + """ + zero = context.get_constant(types.intp, 0) + one = context.get_constant(types.intp, 1) + + shapes = cgutils.unpack_tuple(builder, ary.shape, aryty.ndim) + strides = cgutils.unpack_tuple(builder, ary.strides, aryty.ndim) + + output_indices = [] + output_shapes = [] + output_strides = [] + + num_newaxes = len([idx for idx in index_types if is_nonelike(idx)]) + ax = 0 + for indexval, idxty in zip(indices, index_types): + if idxty is types.ellipsis: + # Fill up missing dimensions at the middle + n_missing = aryty.ndim - len(indices) + 1 + num_newaxes + for i in range(n_missing): + output_indices.append(zero) + output_shapes.append(shapes[ax]) + output_strides.append(strides[ax]) + ax += 1 + continue + # Regular index value + if isinstance(idxty, types.SliceType): + slice = context.make_helper(builder, idxty, value=indexval) + slicing.guard_invalid_slice(context, builder, idxty, slice) + slicing.fix_slice(builder, slice, shapes[ax]) + output_indices.append(slice.start) + sh = slicing.get_slice_length(builder, slice) + st = slicing.fix_stride(builder, slice, strides[ax]) + output_shapes.append(sh) + output_strides.append(st) + elif isinstance(idxty, types.Integer): + ind = fix_integer_index(context, builder, idxty, indexval, + shapes[ax]) + if boundscheck: + cgutils.do_boundscheck(context, builder, ind, shapes[ax], ax) + output_indices.append(ind) + elif is_nonelike(idxty): + output_shapes.append(one) + output_strides.append(zero) + ax -= 1 + else: + raise NotImplementedError("unexpected index type: %s" % (idxty,)) + ax += 1 + + # Fill up missing dimensions at the end + assert ax <= aryty.ndim + while ax < aryty.ndim: + output_shapes.append(shapes[ax]) + output_strides.append(strides[ax]) + ax += 1 + + # No need to check wraparound, as negative indices were already + # fixed in the loop above. + dataptr = cgutils.get_item_pointer(context, builder, aryty, ary, + output_indices, + wraparound=False, boundscheck=False) + return (dataptr, output_shapes, output_strides) + + +def make_view(context, builder, aryty, ary, return_type, + data, shapes, strides): + """ + Build a view over the given array with the given parameters. + """ + retary = make_array(return_type)(context, builder) + populate_array(retary, + data=data, + shape=shapes, + strides=strides, + itemsize=ary.itemsize, + meminfo=ary.meminfo, + parent=ary.parent) + return retary + + +def _getitem_array_generic(context, builder, return_type, aryty, ary, + index_types, indices): + """ + Return the result of indexing *ary* with the given *indices*, + returning either a scalar or a view. + """ + dataptr, view_shapes, view_strides = \ + basic_indexing(context, builder, aryty, ary, index_types, indices, + boundscheck=context.enable_boundscheck) + + if isinstance(return_type, types.Buffer): + # Build array view + retary = make_view(context, builder, aryty, ary, return_type, + dataptr, view_shapes, view_strides) + return retary._getvalue() + else: + # Load scalar from 0-d result + assert not view_shapes + return load_item(context, builder, aryty, dataptr) + + +@lower_builtin(operator.getitem, types.Buffer, types.Integer) +@lower_builtin(operator.getitem, types.Buffer, types.SliceType) +def getitem_arraynd_intp(context, builder, sig, args): + """ + Basic indexing with an integer or a slice. + """ + aryty, idxty = sig.args + ary, idx = args + + assert aryty.ndim >= 1 + ary = make_array(aryty)(context, builder, ary) + + res = _getitem_array_generic(context, builder, sig.return_type, + aryty, ary, (idxty,), (idx,)) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(operator.getitem, types.Buffer, types.BaseTuple) +def getitem_array_tuple(context, builder, sig, args): + """ + Basic or advanced indexing with a tuple. + """ + aryty, tupty = sig.args + ary, tup = args + ary = make_array(aryty)(context, builder, ary) + + index_types = tupty.types + indices = cgutils.unpack_tuple(builder, tup, count=len(tupty)) + + index_types, indices = normalize_indices(context, builder, + index_types, indices) + + if any(isinstance(ty, types.Array) for ty in index_types): + # Advanced indexing + return fancy_getitem(context, builder, sig, args, + aryty, ary, index_types, indices) + + res = _getitem_array_generic(context, builder, sig.return_type, + aryty, ary, index_types, indices) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(operator.setitem, types.Buffer, types.Any, types.Any) +def setitem_array(context, builder, sig, args): + """ + array[a] = scalar_or_array + array[a,..,b] = scalar_or_array + """ + aryty, idxty, valty = sig.args + ary, idx, val = args + + if isinstance(idxty, types.BaseTuple): + index_types = idxty.types + indices = cgutils.unpack_tuple(builder, idx, count=len(idxty)) + else: + index_types = (idxty,) + indices = (idx,) + + ary = make_array(aryty)(context, builder, ary) + + # First try basic indexing to see if a single array location is denoted. + index_types, indices = normalize_indices(context, builder, + index_types, indices) + try: + dataptr, shapes, strides = \ + basic_indexing(context, builder, aryty, ary, index_types, indices, + boundscheck=context.enable_boundscheck) + except NotImplementedError: + use_fancy_indexing = True + else: + use_fancy_indexing = bool(shapes) + + if use_fancy_indexing: + # Index describes a non-trivial view => use generic slice assignment + # (NOTE: this also handles scalar broadcasting) + return fancy_setslice(context, builder, sig, args, + index_types, indices) + + # Store source value the given location + val = context.cast(builder, val, valty, aryty.dtype) + store_item(context, builder, aryty, val, dataptr) + + +@lower_builtin(len, types.Buffer) +def array_len(context, builder, sig, args): + (aryty,) = sig.args + (ary,) = args + arystty = make_array(aryty) + ary = arystty(context, builder, ary) + shapeary = ary.shape + res = builder.extract_value(shapeary, 0) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin("array.item", types.Array) +def array_item(context, builder, sig, args): + aryty, = sig.args + ary, = args + ary = make_array(aryty)(context, builder, ary) + + nitems = ary.nitems + with builder.if_then(builder.icmp_signed('!=', nitems, nitems.type(1)), + likely=False): + msg = "item(): can only convert an array of size 1 to a Python scalar" + context.call_conv.return_user_exc(builder, ValueError, (msg,)) + + return load_item(context, builder, aryty, ary.data) + + +if numpy_version < (2, 0): + @lower_builtin("array.itemset", types.Array, types.Any) + def array_itemset(context, builder, sig, args): + aryty, valty = sig.args + ary, val = args + assert valty == aryty.dtype + ary = make_array(aryty)(context, builder, ary) + + nitems = ary.nitems + with builder.if_then(builder.icmp_signed('!=', nitems, nitems.type(1)), + likely=False): + msg = "itemset(): can only write to an array of size 1" + context.call_conv.return_user_exc(builder, ValueError, (msg,)) + + store_item(context, builder, aryty, val, ary.data) + return context.get_dummy_value() + + +# ------------------------------------------------------------------------------ +# Advanced / fancy indexing + + +class Indexer(object): + """ + Generic indexer interface, for generating indices over a fancy indexed + array on a single dimension. + """ + + def prepare(self): + """ + Prepare the indexer by initializing any required variables, basic + blocks... + """ + raise NotImplementedError + + def get_size(self): + """ + Return this dimension's size as an integer. + """ + raise NotImplementedError + + def get_shape(self): + """ + Return this dimension's shape as a tuple. + """ + raise NotImplementedError + + def get_index_bounds(self): + """ + Return a half-open [lower, upper) range of indices this dimension + is guaranteed not to step out of. + """ + raise NotImplementedError + + def loop_head(self): + """ + Start indexation loop. Return a (index, count) tuple. + *index* is an integer LLVM value representing the index over this + dimension. + *count* is either an integer LLVM value representing the current + iteration count, or None if this dimension should be omitted from + the indexation result. + """ + raise NotImplementedError + + def loop_tail(self): + """ + Finish indexation loop. + """ + raise NotImplementedError + + +class EntireIndexer(Indexer): + """ + Compute indices along an entire array dimension. + """ + + def __init__(self, context, builder, aryty, ary, dim): + self.context = context + self.builder = builder + self.aryty = aryty + self.ary = ary + self.dim = dim + self.ll_intp = self.context.get_value_type(types.intp) + + def prepare(self): + builder = self.builder + self.size = builder.extract_value(self.ary.shape, self.dim) + self.index = cgutils.alloca_once(builder, self.ll_intp) + self.bb_start = builder.append_basic_block() + self.bb_end = builder.append_basic_block() + + def get_size(self): + return self.size + + def get_shape(self): + return (self.size,) + + def get_index_bounds(self): + # [0, size) + return (self.ll_intp(0), self.size) + + def loop_head(self): + builder = self.builder + # Initialize loop variable + self.builder.store(Constant(self.ll_intp, 0), self.index) + builder.branch(self.bb_start) + builder.position_at_end(self.bb_start) + cur_index = builder.load(self.index) + with builder.if_then(builder.icmp_signed('>=', cur_index, self.size), + likely=False): + builder.branch(self.bb_end) + return cur_index, cur_index + + def loop_tail(self): + builder = self.builder + next_index = cgutils.increment_index(builder, builder.load(self.index)) + builder.store(next_index, self.index) + builder.branch(self.bb_start) + builder.position_at_end(self.bb_end) + + +class IntegerIndexer(Indexer): + """ + Compute indices from a single integer. + """ + + def __init__(self, context, builder, idx): + self.context = context + self.builder = builder + self.idx = idx + self.ll_intp = self.context.get_value_type(types.intp) + + def prepare(self): + pass + + def get_size(self): + return Constant(self.ll_intp, 1) + + def get_shape(self): + return () + + def get_index_bounds(self): + # [idx, idx+1) + return (self.idx, self.builder.add(self.idx, self.get_size())) + + def loop_head(self): + return self.idx, None + + def loop_tail(self): + pass + + +class IntegerArrayIndexer(Indexer): + """ + Compute indices from an array of integer indices. + """ + + def __init__(self, context, builder, idxty, idxary, size): + self.context = context + self.builder = builder + self.idxty = idxty + self.idxary = idxary + self.size = size + assert idxty.ndim == 1 + self.ll_intp = self.context.get_value_type(types.intp) + + def prepare(self): + builder = self.builder + self.idx_size = cgutils.unpack_tuple(builder, self.idxary.shape)[0] + self.idx_index = cgutils.alloca_once(builder, self.ll_intp) + self.bb_start = builder.append_basic_block() + self.bb_end = builder.append_basic_block() + + def get_size(self): + return self.idx_size + + def get_shape(self): + return (self.idx_size,) + + def get_index_bounds(self): + # Pessimal heuristic, as we don't want to scan for the min and max + return (self.ll_intp(0), self.size) + + def loop_head(self): + builder = self.builder + # Initialize loop variable + self.builder.store(Constant(self.ll_intp, 0), self.idx_index) + builder.branch(self.bb_start) + builder.position_at_end(self.bb_start) + cur_index = builder.load(self.idx_index) + with builder.if_then( + builder.icmp_signed('>=', cur_index, self.idx_size), + likely=False + ): + builder.branch(self.bb_end) + # Load the actual index from the array of indices + index = _getitem_array_single_int( + self.context, builder, self.idxty.dtype, self.idxty, self.idxary, + cur_index + ) + index = fix_integer_index(self.context, builder, + self.idxty.dtype, index, self.size) + return index, cur_index + + def loop_tail(self): + builder = self.builder + next_index = cgutils.increment_index(builder, + builder.load(self.idx_index)) + builder.store(next_index, self.idx_index) + builder.branch(self.bb_start) + builder.position_at_end(self.bb_end) + + +class BooleanArrayIndexer(Indexer): + """ + Compute indices from an array of boolean predicates. + """ + + def __init__(self, context, builder, idxty, idxary): + self.context = context + self.builder = builder + self.idxty = idxty + self.idxary = idxary + assert idxty.ndim == 1 + self.ll_intp = self.context.get_value_type(types.intp) + self.zero = Constant(self.ll_intp, 0) + + def prepare(self): + builder = self.builder + self.size = cgutils.unpack_tuple(builder, self.idxary.shape)[0] + self.idx_index = cgutils.alloca_once(builder, self.ll_intp) + self.count = cgutils.alloca_once(builder, self.ll_intp) + self.bb_start = builder.append_basic_block() + self.bb_tail = builder.append_basic_block() + self.bb_end = builder.append_basic_block() + + def get_size(self): + builder = self.builder + count = cgutils.alloca_once_value(builder, self.zero) + # Sum all true values + with cgutils.for_range(builder, self.size) as loop: + c = builder.load(count) + pred = _getitem_array_single_int( + self.context, builder, self.idxty.dtype, + self.idxty, self.idxary, loop.index + ) + c = builder.add(c, builder.zext(pred, c.type)) + builder.store(c, count) + + return builder.load(count) + + def get_shape(self): + return (self.get_size(),) + + def get_index_bounds(self): + # Pessimal heuristic, as we don't want to scan for the + # first and last true items + return (self.ll_intp(0), self.size) + + def loop_head(self): + builder = self.builder + # Initialize loop variable + self.builder.store(self.zero, self.idx_index) + self.builder.store(self.zero, self.count) + builder.branch(self.bb_start) + builder.position_at_end(self.bb_start) + cur_index = builder.load(self.idx_index) + cur_count = builder.load(self.count) + with builder.if_then(builder.icmp_signed('>=', cur_index, self.size), + likely=False): + builder.branch(self.bb_end) + # Load the predicate and branch if false + pred = _getitem_array_single_int( + self.context, builder, self.idxty.dtype, self.idxty, self.idxary, + cur_index + ) + with builder.if_then(builder.not_(pred)): + builder.branch(self.bb_tail) + # Increment the count for next iteration + next_count = cgutils.increment_index(builder, cur_count) + builder.store(next_count, self.count) + return cur_index, cur_count + + def loop_tail(self): + builder = self.builder + builder.branch(self.bb_tail) + builder.position_at_end(self.bb_tail) + next_index = cgutils.increment_index(builder, + builder.load(self.idx_index)) + builder.store(next_index, self.idx_index) + builder.branch(self.bb_start) + builder.position_at_end(self.bb_end) + + +class SliceIndexer(Indexer): + """ + Compute indices along a slice. + """ + + def __init__(self, context, builder, aryty, ary, dim, idxty, slice): + self.context = context + self.builder = builder + self.aryty = aryty + self.ary = ary + self.dim = dim + self.idxty = idxty + self.slice = slice + self.ll_intp = self.context.get_value_type(types.intp) + self.zero = Constant(self.ll_intp, 0) + + def prepare(self): + builder = self.builder + # Fix slice for the dimension's size + self.dim_size = builder.extract_value(self.ary.shape, self.dim) + slicing.guard_invalid_slice(self.context, builder, self.idxty, + self.slice) + slicing.fix_slice(builder, self.slice, self.dim_size) + self.is_step_negative = cgutils.is_neg_int(builder, self.slice.step) + # Create loop entities + self.index = cgutils.alloca_once(builder, self.ll_intp) + self.count = cgutils.alloca_once(builder, self.ll_intp) + self.bb_start = builder.append_basic_block() + self.bb_end = builder.append_basic_block() + + def get_size(self): + return slicing.get_slice_length(self.builder, self.slice) + + def get_shape(self): + return (self.get_size(),) + + def get_index_bounds(self): + lower, upper = slicing.get_slice_bounds(self.builder, self.slice) + return lower, upper + + def loop_head(self): + builder = self.builder + # Initialize loop variable + self.builder.store(self.slice.start, self.index) + self.builder.store(self.zero, self.count) + builder.branch(self.bb_start) + builder.position_at_end(self.bb_start) + cur_index = builder.load(self.index) + cur_count = builder.load(self.count) + is_finished = builder.select(self.is_step_negative, + builder.icmp_signed('<=', cur_index, + self.slice.stop), + builder.icmp_signed('>=', cur_index, + self.slice.stop)) + with builder.if_then(is_finished, likely=False): + builder.branch(self.bb_end) + return cur_index, cur_count + + def loop_tail(self): + builder = self.builder + next_index = builder.add(builder.load(self.index), self.slice.step, + flags=['nsw']) + builder.store(next_index, self.index) + next_count = cgutils.increment_index(builder, builder.load(self.count)) + builder.store(next_count, self.count) + builder.branch(self.bb_start) + builder.position_at_end(self.bb_end) + + +class FancyIndexer(object): + """ + Perform fancy indexing on the given array. + """ + + def __init__(self, context, builder, aryty, ary, index_types, indices): + self.context = context + self.builder = builder + self.aryty = aryty + self.shapes = cgutils.unpack_tuple(builder, ary.shape, aryty.ndim) + self.strides = cgutils.unpack_tuple(builder, ary.strides, aryty.ndim) + self.ll_intp = self.context.get_value_type(types.intp) + self.newaxes = [] + + indexers = [] + num_newaxes = len([idx for idx in index_types if is_nonelike(idx)]) + + ax = 0 # keeps track of position of original axes + new_ax = 0 # keeps track of position for inserting new axes + for indexval, idxty in zip(indices, index_types): + if idxty is types.ellipsis: + # Fill up missing dimensions at the middle + n_missing = aryty.ndim - len(indices) + 1 + num_newaxes + for i in range(n_missing): + indexer = EntireIndexer(context, builder, aryty, ary, ax) + indexers.append(indexer) + ax += 1 + new_ax += 1 + continue + + # Regular index value + if isinstance(idxty, types.SliceType): + slice = context.make_helper(builder, idxty, indexval) + indexer = SliceIndexer(context, builder, aryty, ary, ax, + idxty, slice) + indexers.append(indexer) + elif isinstance(idxty, types.Integer): + ind = fix_integer_index(context, builder, idxty, indexval, + self.shapes[ax]) + indexer = IntegerIndexer(context, builder, ind) + indexers.append(indexer) + elif isinstance(idxty, types.Array): + idxary = make_array(idxty)(context, builder, indexval) + if isinstance(idxty.dtype, types.Integer): + indexer = IntegerArrayIndexer(context, builder, + idxty, idxary, + self.shapes[ax]) + elif isinstance(idxty.dtype, types.Boolean): + indexer = BooleanArrayIndexer(context, builder, + idxty, idxary) + else: + assert 0 + indexers.append(indexer) + elif is_nonelike(idxty): + self.newaxes.append(new_ax) + ax -= 1 + else: + raise AssertionError("unexpected index type: %s" % (idxty,)) + ax += 1 + new_ax += 1 + + # Fill up missing dimensions at the end + assert ax <= aryty.ndim, (ax, aryty.ndim) + while ax < aryty.ndim: + indexer = EntireIndexer(context, builder, aryty, ary, ax) + indexers.append(indexer) + ax += 1 + + assert len(indexers) == aryty.ndim, (len(indexers), aryty.ndim) + self.indexers = indexers + + def prepare(self): + for i in self.indexers: + i.prepare() + + one = self.context.get_constant(types.intp, 1) + + # Compute the resulting shape given by the indices + res_shape = [i.get_shape() for i in self.indexers] + + # At every position where newaxis/None is present insert + # one as a constant shape in the resulting list of shapes. + for i in self.newaxes: + res_shape.insert(i, (one,)) + + # Store the shape as a tuple, we can't do a simple + # tuple(res_shape) here since res_shape is a list + # of tuples which may be differently sized. + self.indexers_shape = sum(res_shape, ()) + + def get_shape(self): + """ + Get the resulting data shape as Python tuple. + """ + return self.indexers_shape + + def get_offset_bounds(self, strides, itemsize): + """ + Get a half-open [lower, upper) range of byte offsets spanned by + the indexer with the given strides and itemsize. The indexer is + guaranteed to not go past those bounds. + """ + assert len(strides) == self.aryty.ndim + builder = self.builder + is_empty = cgutils.false_bit + zero = self.ll_intp(0) + one = self.ll_intp(1) + lower = zero + upper = zero + for indexer, shape, stride in zip(self.indexers, self.indexers_shape, + strides): + is_empty = builder.or_(is_empty, + builder.icmp_unsigned('==', shape, zero)) + # Compute [lower, upper) indices on this dimension + lower_index, upper_index = indexer.get_index_bounds() + lower_offset = builder.mul(stride, lower_index) + upper_offset = builder.mul(stride, builder.sub(upper_index, one)) + # Adjust total interval + is_downwards = builder.icmp_signed('<', stride, zero) + lower = builder.add(lower, + builder.select(is_downwards, + upper_offset, + lower_offset)) + upper = builder.add(upper, + builder.select(is_downwards, + lower_offset, + upper_offset)) + # Make interval half-open + upper = builder.add(upper, itemsize) + # Adjust for empty shape + lower = builder.select(is_empty, zero, lower) + upper = builder.select(is_empty, zero, upper) + return lower, upper + + def begin_loops(self): + indices, counts = zip(*(i.loop_head() for i in self.indexers)) + return indices, counts + + def end_loops(self): + for i in reversed(self.indexers): + i.loop_tail() + + +def fancy_getitem(context, builder, sig, args, + aryty, ary, index_types, indices): + + shapes = cgutils.unpack_tuple(builder, ary.shape) + strides = cgutils.unpack_tuple(builder, ary.strides) + data = ary.data + + indexer = FancyIndexer(context, builder, aryty, ary, + index_types, indices) + indexer.prepare() + + # Construct output array + out_ty = sig.return_type + out_shapes = indexer.get_shape() + + out = _empty_nd_impl(context, builder, out_ty, out_shapes) + out_data = out.data + out_idx = cgutils.alloca_once_value(builder, + context.get_constant(types.intp, 0)) + + # Loop on source and copy to destination + indices, _ = indexer.begin_loops() + + # No need to check for wraparound, as the indexers all ensure + # a positive index is returned. + ptr = cgutils.get_item_pointer2(context, builder, data, shapes, strides, + aryty.layout, indices, wraparound=False, + boundscheck=context.enable_boundscheck) + val = load_item(context, builder, aryty, ptr) + + # Since the destination is C-contiguous, no need for multi-dimensional + # indexing. + cur = builder.load(out_idx) + ptr = builder.gep(out_data, [cur]) + store_item(context, builder, out_ty, val, ptr) + next_idx = cgutils.increment_index(builder, cur) + builder.store(next_idx, out_idx) + + indexer.end_loops() + + return impl_ret_new_ref(context, builder, out_ty, out._getvalue()) + + +@lower_builtin(operator.getitem, types.Buffer, types.Array) +def fancy_getitem_array(context, builder, sig, args): + """ + Advanced or basic indexing with an array. + """ + aryty, idxty = sig.args + ary, idx = args + ary = make_array(aryty)(context, builder, ary) + if idxty.ndim == 0: + # 0-d array index acts as a basic integer index + idxty, idx = normalize_index(context, builder, idxty, idx) + res = _getitem_array_generic(context, builder, sig.return_type, + aryty, ary, (idxty,), (idx,)) + return impl_ret_borrowed(context, builder, sig.return_type, res) + else: + # Advanced indexing + return fancy_getitem(context, builder, sig, args, + aryty, ary, (idxty,), (idx,)) + + +def offset_bounds_from_strides(context, builder, arrty, arr, shapes, strides): + """ + Compute a half-open range [lower, upper) of byte offsets from the + array's data pointer, that bound the in-memory extent of the array. + + This mimics offset_bounds_from_strides() from + numpy/core/src/private/mem_overlap.c + """ + itemsize = arr.itemsize + zero = itemsize.type(0) + one = zero.type(1) + if arrty.layout in 'CF': + # Array is contiguous: contents are laid out sequentially + # starting from arr.data and upwards + lower = zero + upper = builder.mul(itemsize, arr.nitems) + else: + # Non-contiguous array: need to examine strides + lower = zero + upper = zero + for i in range(arrty.ndim): + # Compute the largest byte offset on this dimension + # max_axis_offset = strides[i] * (shapes[i] - 1) + # (shapes[i] == 0 is catered for by the empty array case below) + max_axis_offset = builder.mul(strides[i], + builder.sub(shapes[i], one)) + is_upwards = builder.icmp_signed('>=', max_axis_offset, zero) + # Expand either upwards or downwards depending on stride + upper = builder.select(is_upwards, + builder.add(upper, max_axis_offset), upper) + lower = builder.select(is_upwards, + lower, builder.add(lower, max_axis_offset)) + # Return a half-open range + upper = builder.add(upper, itemsize) + # Adjust for empty arrays + is_empty = builder.icmp_signed('==', arr.nitems, zero) + upper = builder.select(is_empty, zero, upper) + lower = builder.select(is_empty, zero, lower) + + return lower, upper + + +def compute_memory_extents(context, builder, lower, upper, data): + """ + Given [lower, upper) byte offsets and a base data pointer, + compute the memory pointer bounds as pointer-sized integers. + """ + data_ptr_as_int = builder.ptrtoint(data, lower.type) + start = builder.add(data_ptr_as_int, lower) + end = builder.add(data_ptr_as_int, upper) + return start, end + + +def get_array_memory_extents(context, builder, arrty, arr, shapes, strides, + data): + """ + Compute a half-open range [start, end) of pointer-sized integers + which fully contain the array data. + """ + lower, upper = offset_bounds_from_strides(context, builder, arrty, arr, + shapes, strides) + return compute_memory_extents(context, builder, lower, upper, data) + + +def extents_may_overlap(context, builder, a_start, a_end, b_start, b_end): + """ + Whether two memory extents [a_start, a_end) and [b_start, b_end) + may overlap. + """ + # Comparisons are unsigned, since we are really comparing pointers + may_overlap = builder.and_( + builder.icmp_unsigned('<', a_start, b_end), + builder.icmp_unsigned('<', b_start, a_end), + ) + return may_overlap + + +def maybe_copy_source(context, builder, use_copy, + srcty, src, src_shapes, src_strides, src_data): + ptrty = src_data.type + + copy_layout = 'C' + copy_data = cgutils.alloca_once_value(builder, src_data) + copy_shapes = src_shapes + copy_strides = None # unneeded for contiguous arrays + + with builder.if_then(use_copy, likely=False): + # Allocate temporary scratchpad + # XXX: should we use a stack-allocated array for very small + # data sizes? + allocsize = builder.mul(src.itemsize, src.nitems) + data = context.nrt.allocate(builder, allocsize) + voidptrty = data.type + data = builder.bitcast(data, ptrty) + builder.store(data, copy_data) + + # Copy source data into scratchpad + intp_t = context.get_value_type(types.intp) + + with cgutils.loop_nest(builder, src_shapes, intp_t) as indices: + src_ptr = cgutils.get_item_pointer2(context, builder, src_data, + src_shapes, src_strides, + srcty.layout, indices) + dest_ptr = cgutils.get_item_pointer2(context, builder, data, + copy_shapes, copy_strides, + copy_layout, indices) + builder.store(builder.load(src_ptr), dest_ptr) + + def src_getitem(source_indices): + src_ptr = cgutils.alloca_once(builder, ptrty) + with builder.if_else(use_copy, likely=False) as (if_copy, otherwise): + with if_copy: + builder.store( + cgutils.get_item_pointer2(context, builder, + builder.load(copy_data), + copy_shapes, copy_strides, + copy_layout, source_indices, + wraparound=False), + src_ptr) + with otherwise: + builder.store( + cgutils.get_item_pointer2(context, builder, src_data, + src_shapes, src_strides, + srcty.layout, source_indices, + wraparound=False), + src_ptr) + return load_item(context, builder, srcty, builder.load(src_ptr)) + + def src_cleanup(): + # Deallocate memory + with builder.if_then(use_copy, likely=False): + data = builder.load(copy_data) + data = builder.bitcast(data, voidptrty) + context.nrt.free(builder, data) + + return src_getitem, src_cleanup + + +def _bc_adjust_dimension(context, builder, shapes, strides, target_shape): + """ + Preprocess dimension for broadcasting. + Returns (shapes, strides) such that the ndim match *target_shape*. + When expanding to higher ndim, the returning shapes and strides are + prepended with ones and zeros, respectively. + When truncating to lower ndim, the shapes are checked (in runtime). + All extra dimension must have size of 1. + """ + zero = context.get_constant(types.uintp, 0) + one = context.get_constant(types.uintp, 1) + + # Adjust for broadcasting to higher dimension + if len(target_shape) > len(shapes): + nd_diff = len(target_shape) - len(shapes) + # Fill missing shapes with one, strides with zeros + shapes = [one] * nd_diff + shapes + strides = [zero] * nd_diff + strides + # Adjust for broadcasting to lower dimension + elif len(target_shape) < len(shapes): + # Accepted if all extra dims has shape 1 + nd_diff = len(shapes) - len(target_shape) + dim_is_one = [builder.icmp_unsigned('==', sh, one) + for sh in shapes[:nd_diff]] + accepted = functools.reduce(builder.and_, dim_is_one, + cgutils.true_bit) + # Check error + with builder.if_then(builder.not_(accepted), likely=False): + msg = "cannot broadcast source array for assignment" + context.call_conv.return_user_exc(builder, ValueError, (msg,)) + # Truncate extra shapes, strides + shapes = shapes[nd_diff:] + strides = strides[nd_diff:] + + return shapes, strides + + +def _bc_adjust_shape_strides(context, builder, shapes, strides, target_shape): + """ + Broadcast shapes and strides to target_shape given that their ndim already + matches. For each location where the shape is 1 and does not match the + dim for target, it is set to the value at the target and the stride is + set to zero. + """ + bc_shapes = [] + bc_strides = [] + zero = context.get_constant(types.uintp, 0) + one = context.get_constant(types.uintp, 1) + # Adjust all mismatching ones in shape + mismatch = [builder.icmp_signed('!=', tar, old) + for tar, old in zip(target_shape, shapes)] + src_is_one = [builder.icmp_signed('==', old, one) for old in shapes] + preds = [builder.and_(x, y) for x, y in zip(mismatch, src_is_one)] + bc_shapes = [builder.select(p, tar, old) + for p, tar, old in zip(preds, target_shape, shapes)] + bc_strides = [builder.select(p, zero, old) + for p, old in zip(preds, strides)] + return bc_shapes, bc_strides + + +def _broadcast_to_shape(context, builder, arrtype, arr, target_shape): + """ + Broadcast the given array to the target_shape. + Returns (array_type, array) + """ + # Compute broadcasted shape and strides + shapes = cgutils.unpack_tuple(builder, arr.shape) + strides = cgutils.unpack_tuple(builder, arr.strides) + + shapes, strides = _bc_adjust_dimension(context, builder, shapes, strides, + target_shape) + shapes, strides = _bc_adjust_shape_strides(context, builder, shapes, + strides, target_shape) + new_arrtype = arrtype.copy(ndim=len(target_shape), layout='A') + # Create new view + new_arr = make_array(new_arrtype)(context, builder) + populate_array(new_arr, + data=arr.data, + shape=cgutils.pack_array(builder, shapes), + strides=cgutils.pack_array(builder, strides), + itemsize=arr.itemsize, + meminfo=arr.meminfo, + parent=arr.parent) + return new_arrtype, new_arr + + +@intrinsic +def _numpy_broadcast_to(typingctx, array, shape): + ret = array.copy(ndim=shape.count, layout='A', readonly=True) + sig = ret(array, shape) + + def codegen(context, builder, sig, args): + src, shape_ = args + srcty = sig.args[0] + + src = make_array(srcty)(context, builder, src) + shape_ = cgutils.unpack_tuple(builder, shape_) + _, dest = _broadcast_to_shape(context, builder, srcty, src, shape_,) + + # Hack to get np.broadcast_to to return a read-only array + setattr(dest, 'parent', Constant( + context.get_value_type(dest._datamodel.get_type('parent')), + None)) + + res = dest._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + return sig, codegen + + +@intrinsic +def get_readonly_array(typingctx, arr): + # returns a copy of arr which is readonly + ret = arr.copy(readonly=True) + sig = ret(arr) + + def codegen(context, builder, sig, args): + [src] = args + srcty = sig.args[0] + + dest = make_array(srcty)(context, builder, src) + # Hack to return a read-only array + dest.parent = cgutils.get_null_value(dest.parent.type) + res = dest._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + return sig, codegen + + +@register_jitable +def _can_broadcast(array, dest_shape): + src_shape = array.shape + src_ndim = len(src_shape) + dest_ndim = len(dest_shape) + if src_ndim > dest_ndim: + raise ValueError('input operand has more dimensions than allowed ' + 'by the axis remapping') + for size in dest_shape: + if size < 0: + raise ValueError('all elements of broadcast shape must be ' + 'non-negative') + + # based on _broadcast_onto function in numba/np/npyimpl.py + src_index = 0 + dest_index = dest_ndim - src_ndim + while src_index < src_ndim: + src_dim = src_shape[src_index] + dest_dim = dest_shape[dest_index] + # possible cases for (src_dim, dest_dim): + # * (1, 1) -> Ok + # * (>1, 1) -> Error! + # * (>1, >1) -> src_dim == dest_dim else error! + # * (1, >1) -> Ok + if src_dim == dest_dim or src_dim == 1: + src_index += 1 + dest_index += 1 + else: + raise ValueError('operands could not be broadcast together ' + 'with remapped shapes') + + +def _default_broadcast_to_impl(array, shape): + array = np.asarray(array) + _can_broadcast(array, shape) + return _numpy_broadcast_to(array, shape) + + +@overload(np.broadcast_to) +def numpy_broadcast_to(array, shape): + if not type_can_asarray(array): + raise errors.TypingError('The first argument "array" must ' + 'be array-like') + + if isinstance(shape, types.Integer): + def impl(array, shape): + return np.broadcast_to(array, (shape,)) + return impl + + elif isinstance(shape, types.UniTuple): + if not isinstance(shape.dtype, types.Integer): + msg = 'The second argument "shape" must be a tuple of integers' + raise errors.TypingError(msg) + return _default_broadcast_to_impl + + elif isinstance(shape, types.Tuple) and shape.count > 0: + # check if all types are integers + if not all([isinstance(typ, types.IntegerLiteral) for typ in shape]): + msg = f'"{shape}" object cannot be interpreted as an integer' + raise errors.TypingError(msg) + return _default_broadcast_to_impl + elif isinstance(shape, types.Tuple) and shape.count == 0: + is_scalar_array = isinstance(array, types.Array) and array.ndim == 0 + if type_is_scalar(array) or is_scalar_array: + + def impl(array, shape): # broadcast_to(array, ()) + # Array type must be supported by "type_can_asarray" + # Quick note that unicode types are not supported! + array = np.asarray(array) + return get_readonly_array(array) + return impl + + else: + msg = 'Cannot broadcast a non-scalar to a scalar array' + raise errors.TypingError(msg) + else: + msg = ('The argument "shape" must be a tuple or an integer. ' + 'Got %s' % shape) + raise errors.TypingError(msg) + + +@register_jitable +def numpy_broadcast_shapes_list(r, m, shape): + for i in range(len(shape)): + k = m - len(shape) + i + tmp = shape[i] + if tmp < 0: + raise ValueError("negative dimensions are not allowed") + if tmp == 1: + continue + if r[k] == 1: + r[k] = tmp + elif r[k] != tmp: + raise ValueError("shape mismatch: objects" + " cannot be broadcast" + " to a single shape") + + +@overload(np.broadcast_shapes) +def ol_numpy_broadcast_shapes(*args): + # Based on https://github.com/numpy/numpy/blob/f702b26fff3271ba6a6ba29a021fc19051d1f007/numpy/core/src/multiarray/iterators.c#L1129-L1212 # noqa + for idx, arg in enumerate(args): + is_int = isinstance(arg, types.Integer) + is_int_tuple = isinstance(arg, types.UniTuple) and \ + isinstance(arg.dtype, types.Integer) + is_empty_tuple = isinstance(arg, types.Tuple) and len(arg.types) == 0 + if not (is_int or is_int_tuple or is_empty_tuple): + msg = (f'Argument {idx} must be either an int or tuple[int]. ' + f'Got {arg}') + raise errors.TypingError(msg) + + # discover the number of dimensions + m = 0 + for arg in args: + if isinstance(arg, types.Integer): + m = max(m, 1) + elif isinstance(arg, types.BaseTuple): + m = max(m, len(arg)) + + if m == 0: + return lambda *args: () + else: + tup_init = (1,) * m + + def impl(*args): + # propagate args + r = [1] * m + tup = tup_init + for arg in literal_unroll(args): + if isinstance(arg, tuple) and len(arg) > 0: + numpy_broadcast_shapes_list(r, m, arg) + elif isinstance(arg, int): + numpy_broadcast_shapes_list(r, m, (arg,)) + for idx, elem in enumerate(r): + tup = tuple_setitem(tup, idx, elem) + return tup + return impl + + +@overload(np.broadcast_arrays) +def numpy_broadcast_arrays(*args): + + for idx, arg in enumerate(args): + if not type_can_asarray(arg): + raise errors.TypingError(f'Argument "{idx}" must ' + 'be array-like') + + unified_dtype = None + dt = None + for arg in args: + if isinstance(arg, (types.Array, types.BaseTuple)): + dt = arg.dtype + else: + dt = arg + + if unified_dtype is None: + unified_dtype = dt + elif unified_dtype != dt: + raise errors.TypingError('Mismatch of argument types. Numba cannot ' + 'broadcast arrays with different types. ' + f'Got {args}') + + # number of dimensions + m = 0 + for idx, arg in enumerate(args): + if isinstance(arg, types.ArrayCompatible): + m = max(m, arg.ndim) + elif isinstance(arg, (types.Number, types.Boolean, types.BaseTuple)): + m = max(m, 1) + else: + raise errors.TypingError(f'Unhandled type {arg}') + + tup_init = (0,) * m + + def impl(*args): + # find out the output shape + # we can't call np.broadcast_shapes here since args may have arrays + # with different shapes and it is not possible to create a list + # with those shapes dynamically + shape = [1] * m + for array in literal_unroll(args): + numpy_broadcast_shapes_list(shape, m, np.asarray(array).shape) + + tup = tup_init + + for i in range(m): + tup = tuple_setitem(tup, i, shape[i]) + + # numpy checks if the input arrays have the same shape as `shape` + outs = [] + for array in literal_unroll(args): + outs.append(np.broadcast_to(np.asarray(array), tup)) + return outs + + return impl + + +def raise_with_shape_context(src_shapes, index_shape): + """Targets should implement this if they wish to specialize the error + handling/messages. The overload implementation takes two tuples as arguments + and should raise a ValueError.""" + raise NotImplementedError + + +@overload(raise_with_shape_context, target="generic") +def ol_raise_with_shape_context_generic(src_shapes, index_shape): + # This overload is for a "generic" target, which makes no assumption about + # the NRT or string support, but does assume exceptions can be raised. + if (isinstance(src_shapes, types.UniTuple) and + isinstance(index_shape, types.UniTuple) and + src_shapes.dtype == index_shape.dtype and + isinstance(src_shapes.dtype, types.Integer)): + + def impl(src_shapes, index_shape): + raise ValueError("cannot assign slice from input of different size") + return impl + + +@overload(raise_with_shape_context, target="CPU") +def ol_raise_with_shape_context_cpu(src_shapes, index_shape): + if (isinstance(src_shapes, types.UniTuple) and + isinstance(index_shape, types.UniTuple) and + src_shapes.dtype == index_shape.dtype and + isinstance(src_shapes.dtype, types.Integer)): + + def impl(src_shapes, index_shape): + if len(src_shapes) == 1: + shape_str = f"({src_shapes[0]},)" + else: + shape_str = f"({', '.join([str(x) for x in src_shapes])})" + if len(index_shape) == 1: + index_str = f"({index_shape[0]},)" + else: + index_str = f"({', '.join([str(x) for x in index_shape])})" + msg = (f"cannot assign slice of shape {shape_str} from input of " + f"shape {index_str}") + raise ValueError(msg) + return impl + + +def fancy_setslice(context, builder, sig, args, index_types, indices): + """ + Implement slice assignment for arrays. This implementation works for + basic as well as fancy indexing, since there's no functional difference + between the two for indexed assignment. + """ + aryty, _, srcty = sig.args + ary, _, src = args + + ary = make_array(aryty)(context, builder, ary) + dest_shapes = cgutils.unpack_tuple(builder, ary.shape) + dest_strides = cgutils.unpack_tuple(builder, ary.strides) + dest_data = ary.data + + indexer = FancyIndexer(context, builder, aryty, ary, + index_types, indices) + indexer.prepare() + + def raise_shape_mismatch_error(context, builder, src_shapes, index_shape): + # This acts as the "trampoline" to raise a ValueError in the case + # of the source and destination shapes mismatch at runtime. It resolves + # the public overload stub `raise_with_shape_context` + fnty = context.typing_context.resolve_value_type( + raise_with_shape_context) + argtys = (types.UniTuple(types.int64, len(src_shapes)), + types.UniTuple(types.int64, len(index_shape))) + raise_sig = fnty.get_call_type(context.typing_context, argtys, {}) + func = context.get_function(fnty, raise_sig) + func(builder, (context.make_tuple(builder, raise_sig.args[0], + src_shapes), + context.make_tuple(builder, raise_sig.args[1], + index_shape))) + + if isinstance(srcty, types.Buffer): + # Source is an array + src_dtype = srcty.dtype + index_shape = indexer.get_shape() + src = make_array(srcty)(context, builder, src) + # Broadcast source array to shape + srcty, src = _broadcast_to_shape(context, builder, srcty, src, + index_shape) + src_shapes = cgutils.unpack_tuple(builder, src.shape) + src_strides = cgutils.unpack_tuple(builder, src.strides) + src_data = src.data + + # Check shapes are equal + shape_error = cgutils.false_bit + assert len(index_shape) == len(src_shapes) + + for u, v in zip(src_shapes, index_shape): + shape_error = builder.or_(shape_error, + builder.icmp_signed('!=', u, v)) + + with builder.if_then(shape_error, likely=False): + raise_shape_mismatch_error(context, builder, src_shapes, + index_shape) + + # Check for array overlap + src_start, src_end = get_array_memory_extents(context, builder, srcty, + src, src_shapes, + src_strides, src_data) + + dest_lower, dest_upper = indexer.get_offset_bounds(dest_strides, + ary.itemsize) + dest_start, dest_end = compute_memory_extents(context, builder, + dest_lower, dest_upper, + dest_data) + + use_copy = extents_may_overlap(context, builder, src_start, src_end, + dest_start, dest_end) + + src_getitem, src_cleanup = maybe_copy_source(context, builder, use_copy, + srcty, src, src_shapes, + src_strides, src_data) + + elif isinstance(srcty, types.Sequence): + src_dtype = srcty.dtype + + # Check shape is equal to sequence length + index_shape = indexer.get_shape() + assert len(index_shape) == 1 + len_impl = context.get_function(len, signature(types.intp, srcty)) + seq_len = len_impl(builder, (src,)) + + shape_error = builder.icmp_signed('!=', index_shape[0], seq_len) + + with builder.if_then(shape_error, likely=False): + raise_shape_mismatch_error(context, builder, (seq_len,), + (index_shape[0],)) + + def src_getitem(source_indices): + idx, = source_indices + getitem_impl = context.get_function( + operator.getitem, + signature(src_dtype, srcty, types.intp), + ) + return getitem_impl(builder, (src, idx)) + + def src_cleanup(): + pass + + else: + # Source is a scalar (broadcast or not, depending on destination + # shape). + src_dtype = srcty + + def src_getitem(source_indices): + return src + + def src_cleanup(): + pass + + zero = context.get_constant(types.uintp, 0) + # Loop on destination and copy from source to destination + dest_indices, counts = indexer.begin_loops() + + # Source is iterated in natural order + + # Counts represent a counter for the number of times a specified axis + # is being accessed, during setitem they are used as source + # indices + counts = list(counts) + + # We need to artifically introduce the index zero wherever a + # newaxis is present within the indexer. These always remain + # zero. + for i in indexer.newaxes: + counts.insert(i, zero) + + source_indices = [c for c in counts if c is not None] + + val = src_getitem(source_indices) + + # Cast to the destination dtype (cross-dtype slice assignment is allowed) + val = context.cast(builder, val, src_dtype, aryty.dtype) + + # No need to check for wraparound, as the indexers all ensure + # a positive index is returned. + dest_ptr = cgutils.get_item_pointer2(context, builder, dest_data, + dest_shapes, dest_strides, + aryty.layout, dest_indices, + wraparound=False, + boundscheck=context.enable_boundscheck) + store_item(context, builder, aryty, val, dest_ptr) + + indexer.end_loops() + + src_cleanup() + + return context.get_dummy_value() + + +# ------------------------------------------------------------------------------ +# Shape / layout altering + +def vararg_to_tuple(context, builder, sig, args): + aryty = sig.args[0] + dimtys = sig.args[1:] + # values + ary = args[0] + dims = args[1:] + # coerce all types to intp + dims = [context.cast(builder, val, ty, types.intp) + for ty, val in zip(dimtys, dims)] + # make a tuple + shape = cgutils.pack_array(builder, dims, dims[0].type) + + shapety = types.UniTuple(dtype=types.intp, count=len(dims)) + new_sig = typing.signature(sig.return_type, aryty, shapety) + new_args = ary, shape + + return new_sig, new_args + + +@lower_builtin('array.transpose', types.Array) +def array_transpose(context, builder, sig, args): + return array_T(context, builder, sig.args[0], args[0]) + + +def permute_arrays(axis, shape, strides): + if len(axis) != len(set(axis)): + raise ValueError("repeated axis in transpose") + dim = len(shape) + for x in axis: + if x >= dim or abs(x) > dim: + raise ValueError("axis is out of bounds for array of " + "given dimension") + + shape[:] = shape[axis] + strides[:] = strides[axis] + + +# Transposing an array involves permuting the shape and strides of the array +# based on the given axes. +@lower_builtin('array.transpose', types.Array, types.BaseTuple) +def array_transpose_tuple(context, builder, sig, args): + aryty = sig.args[0] + ary = make_array(aryty)(context, builder, args[0]) + + axisty, axis = sig.args[1], args[1] + num_axis, dtype = axisty.count, axisty.dtype + + ll_intp = context.get_value_type(types.intp) + ll_ary_size = ir.ArrayType(ll_intp, num_axis) + + # Allocate memory for axes, shapes, and strides arrays. + arys = [axis, ary.shape, ary.strides] + ll_arys = [cgutils.alloca_once(builder, ll_ary_size) for _ in arys] + + # Store axes, shapes, and strides arrays to the allocated memory. + for src, dst in zip(arys, ll_arys): + builder.store(src, dst) + + np_ary_ty = types.Array(dtype=dtype, ndim=1, layout='C') + np_itemsize = context.get_constant(types.intp, + context.get_abi_sizeof(ll_intp)) + + # Form NumPy arrays for axes, shapes, and strides arrays. + np_arys = [make_array(np_ary_ty)(context, builder) for _ in arys] + + # Roughly, `np_ary = np.array(ll_ary)` for each of axes, shapes, and strides + for np_ary, ll_ary in zip(np_arys, ll_arys): + populate_array(np_ary, + data=builder.bitcast(ll_ary, ll_intp.as_pointer()), + shape=[context.get_constant(types.intp, num_axis)], + strides=[np_itemsize], + itemsize=np_itemsize, + meminfo=None) + + # Pass NumPy arrays formed above to permute_arrays function that permutes + # shapes and strides based on axis contents. + context.compile_internal(builder, permute_arrays, + typing.signature(types.void, + np_ary_ty, np_ary_ty, np_ary_ty), + [a._getvalue() for a in np_arys]) + + # Make a new array based on permuted shape and strides and return it. + ret = make_array(sig.return_type)(context, builder) + populate_array(ret, + data=ary.data, + shape=builder.load(ll_arys[1]), + strides=builder.load(ll_arys[2]), + itemsize=ary.itemsize, + meminfo=ary.meminfo, + parent=ary.parent) + res = ret._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin('array.transpose', types.Array, types.VarArg(types.Any)) +def array_transpose_vararg(context, builder, sig, args): + new_sig, new_args = vararg_to_tuple(context, builder, sig, args) + return array_transpose_tuple(context, builder, new_sig, new_args) + + +@overload(np.transpose) +def numpy_transpose(a, axes=None): + if isinstance(a, types.BaseTuple): + raise errors.TypingError("np.transpose does not accept tuples") + + if axes is None: + def np_transpose_impl(a, axes=None): + return a.transpose() + else: + def np_transpose_impl(a, axes=None): + return a.transpose(axes) + + return np_transpose_impl + + +@lower_getattr(types.Array, 'T') +def array_T(context, builder, typ, value): + if typ.ndim <= 1: + res = value + else: + ary = make_array(typ)(context, builder, value) + ret = make_array(typ)(context, builder) + shapes = cgutils.unpack_tuple(builder, ary.shape, typ.ndim) + strides = cgutils.unpack_tuple(builder, ary.strides, typ.ndim) + populate_array(ret, + data=ary.data, + shape=cgutils.pack_array(builder, shapes[::-1]), + strides=cgutils.pack_array(builder, strides[::-1]), + itemsize=ary.itemsize, + meminfo=ary.meminfo, + parent=ary.parent) + res = ret._getvalue() + return impl_ret_borrowed(context, builder, typ, res) + + +@overload(np.logspace) +def numpy_logspace(start, stop, num=50): + if not isinstance(start, types.Number): + raise errors.TypingError('The first argument "start" must be a number') + if not isinstance(stop, types.Number): + raise errors.TypingError('The second argument "stop" must be a number') + if not isinstance(num, (int, types.Integer)): + raise errors.TypingError('The third argument "num" must be an integer') + + def impl(start, stop, num=50): + y = np.linspace(start, stop, num) + return np.power(10.0, y) + + return impl + + +@overload(np.geomspace) +def numpy_geomspace(start, stop, num=50): + if not isinstance(start, types.Number): + msg = 'The argument "start" must be a number' + raise errors.TypingError(msg) + + if not isinstance(stop, types.Number): + msg = 'The argument "stop" must be a number' + raise errors.TypingError(msg) + + if not isinstance(num, (int, types.Integer)): + msg = 'The argument "num" must be an integer' + raise errors.TypingError(msg) + + if any(isinstance(arg, types.Complex) for arg in [start, stop]): + result_dtype = from_dtype(np.result_type(as_dtype(start), + as_dtype(stop), None)) + + def impl(start, stop, num=50): + if start == 0 or stop == 0: + raise ValueError('Geometric sequence cannot include zero') + start = result_dtype(start) + stop = result_dtype(stop) + if numpy_version < (2, 0): + both_imaginary = (start.real == 0) & (stop.real == 0) + both_negative = (np.sign(start) == -1) & (np.sign(stop) == -1) + out_sign = 1 + if both_imaginary: + start = start.imag + stop = stop.imag + out_sign = 1j + if both_negative: + start = -start + stop = -stop + out_sign = -out_sign + else: + out_sign = np.sign(start) + start /= out_sign + stop /= out_sign + + logstart = np.log10(start) + logstop = np.log10(stop) + result = np.logspace(logstart, logstop, num) + # Make sure the endpoints match the start and stop arguments. + # This is necessary because np.exp(np.log(x)) is not necessarily + # equal to x. + if num > 0: + result[0] = start + if num > 1: + result[-1] = stop + return out_sign * result + + else: + def impl(start, stop, num=50): + if start == 0 or stop == 0: + raise ValueError('Geometric sequence cannot include zero') + both_negative = (np.sign(start) == -1) & (np.sign(stop) == -1) + out_sign = 1 + if both_negative: + start = -start + stop = -stop + out_sign = -out_sign + logstart = np.log10(start) + logstop = np.log10(stop) + result = np.logspace(logstart, logstop, num) + # Make sure the endpoints match the start and stop arguments. + # This is necessary because np.exp(np.log(x)) is not necessarily + # equal to x. + if num > 0: + result[0] = start + if num > 1: + result[-1] = stop + return out_sign * result + + return impl + + +@overload(np.rot90) +def numpy_rot90(m, k=1): + # supporting axes argument it needs to be included in np.flip + if not isinstance(k, (int, types.Integer)): + raise errors.TypingError('The second argument "k" must be an integer') + if not isinstance(m, types.Array): + raise errors.TypingError('The first argument "m" must be an array') + + if m.ndim < 2: + raise errors.NumbaValueError('Input must be >= 2-d.') + + def impl(m, k=1): + k = k % 4 + if k == 0: + return m[:] + elif k == 1: + return np.swapaxes(np.fliplr(m), 0, 1) + elif k == 2: + return np.flipud(np.fliplr(m)) + elif k == 3: + return np.fliplr(np.swapaxes(m, 0, 1)) + else: + raise AssertionError # unreachable + + return impl + + +def _attempt_nocopy_reshape(context, builder, aryty, ary, + newnd, newshape, newstrides): + """ + Call into Numba_attempt_nocopy_reshape() for the given array type + and instance, and the specified new shape. + + Return value is non-zero if successful, and the array pointed to + by *newstrides* will be filled up with the computed results. + """ + ll_intp = context.get_value_type(types.intp) + ll_intp_star = ll_intp.as_pointer() + ll_intc = context.get_value_type(types.intc) + fnty = ir.FunctionType(ll_intc, [ + # nd, *dims, *strides + ll_intp, ll_intp_star, ll_intp_star, + # newnd, *newdims, *newstrides + ll_intp, ll_intp_star, ll_intp_star, + # itemsize, is_f_order + ll_intp, ll_intc]) + fn = cgutils.get_or_insert_function(builder.module, fnty, + "numba_attempt_nocopy_reshape") + + nd = ll_intp(aryty.ndim) + shape = cgutils.gep_inbounds(builder, ary._get_ptr_by_name('shape'), 0, 0) + strides = cgutils.gep_inbounds(builder, ary._get_ptr_by_name('strides'), + 0, 0) + newnd = ll_intp(newnd) + newshape = cgutils.gep_inbounds(builder, newshape, 0, 0) + newstrides = cgutils.gep_inbounds(builder, newstrides, 0, 0) + is_f_order = ll_intc(0) + res = builder.call(fn, [nd, shape, strides, + newnd, newshape, newstrides, + ary.itemsize, is_f_order]) + return res + + +def normalize_reshape_value(origsize, shape): + num_neg_value = 0 + known_size = 1 + for ax, s in enumerate(shape): + if s < 0: + num_neg_value += 1 + neg_ax = ax + else: + known_size *= s + + if num_neg_value == 0: + if origsize != known_size: + raise ValueError("total size of new array must be unchanged") + + elif num_neg_value == 1: + # Infer negative dimension + if known_size == 0: + inferred = 0 + ok = origsize == 0 + else: + inferred = origsize // known_size + ok = origsize % known_size == 0 + if not ok: + raise ValueError("total size of new array must be unchanged") + shape[neg_ax] = inferred + + else: + raise ValueError("multiple negative shape values") + + +@lower_builtin('array.reshape', types.Array, types.BaseTuple) +def array_reshape(context, builder, sig, args): + aryty = sig.args[0] + retty = sig.return_type + + shapety = sig.args[1] + shape = args[1] + + ll_intp = context.get_value_type(types.intp) + ll_shape = ir.ArrayType(ll_intp, shapety.count) + + ary = make_array(aryty)(context, builder, args[0]) + + # We will change the target shape in this slot + # (see normalize_reshape_value() below) + newshape = cgutils.alloca_once(builder, ll_shape) + builder.store(shape, newshape) + + # Create a shape array pointing to the value of newshape. + # (roughly, `shape_ary = np.array(ary.shape)`) + shape_ary_ty = types.Array(dtype=shapety.dtype, ndim=1, layout='C') + shape_ary = make_array(shape_ary_ty)(context, builder) + shape_itemsize = context.get_constant(types.intp, + context.get_abi_sizeof(ll_intp)) + populate_array(shape_ary, + data=builder.bitcast(newshape, ll_intp.as_pointer()), + shape=[context.get_constant(types.intp, shapety.count)], + strides=[shape_itemsize], + itemsize=shape_itemsize, + meminfo=None) + + # Compute the original array size + size = ary.nitems + + # Call our normalizer which will fix the shape array in case of negative + # shape value + context.compile_internal(builder, normalize_reshape_value, + typing.signature(types.void, + types.uintp, shape_ary_ty), + [size, shape_ary._getvalue()]) + + # Perform reshape (nocopy) + newnd = shapety.count + newstrides = cgutils.alloca_once(builder, ll_shape) + + ok = _attempt_nocopy_reshape(context, builder, aryty, ary, newnd, + newshape, newstrides) + fail = builder.icmp_unsigned('==', ok, ok.type(0)) + + with builder.if_then(fail): + msg = "incompatible shape for array" + context.call_conv.return_user_exc(builder, NotImplementedError, (msg,)) + + ret = make_array(retty)(context, builder) + populate_array(ret, + data=ary.data, + shape=builder.load(newshape), + strides=builder.load(newstrides), + itemsize=ary.itemsize, + meminfo=ary.meminfo, + parent=ary.parent) + res = ret._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin('array.reshape', types.Array, types.VarArg(types.Any)) +def array_reshape_vararg(context, builder, sig, args): + new_sig, new_args = vararg_to_tuple(context, builder, sig, args) + return array_reshape(context, builder, new_sig, new_args) + + +if numpy_version < (2, 1): + @overload(np.reshape) + def np_reshape(a, newshape): + def np_reshape_impl(a, newshape): + return a.reshape(newshape) + return np_reshape_impl +else: + @overload(np.reshape) + def np_reshape(a, shape): + def np_reshape_impl(a, shape): + return a.reshape(shape) + return np_reshape_impl + + +@overload(np.resize) +def numpy_resize(a, new_shape): + + if not type_can_asarray(a): + msg = 'The argument "a" must be array-like' + raise errors.TypingError(msg) + + if not ((isinstance(new_shape, types.UniTuple) + and + isinstance(new_shape.dtype, types.Integer)) + or + isinstance(new_shape, types.Integer)): + msg = ('The argument "new_shape" must be an integer or ' + 'a tuple of integers') + raise errors.TypingError(msg) + + def impl(a, new_shape): + a = np.asarray(a) + a = np.ravel(a) + + if isinstance(new_shape, tuple): + new_size = 1 + for dim_length in np.asarray(new_shape): + new_size *= dim_length + if dim_length < 0: + msg = 'All elements of `new_shape` must be non-negative' + raise ValueError(msg) + else: + if new_shape < 0: + msg2 = 'All elements of `new_shape` must be non-negative' + raise ValueError(msg2) + new_size = new_shape + + if a.size == 0: + return np.zeros(new_shape).astype(a.dtype) + + repeats = -(-new_size // a.size) # ceil division + res = a + for i in range(repeats - 1): + res = np.concatenate((res, a)) + res = res[:new_size] + + return np.reshape(res, new_shape) + + return impl + + +@overload(np.append) +def np_append(arr, values, axis=None): + + if not type_can_asarray(arr): + raise errors.TypingError('The first argument "arr" must be array-like') + + if not type_can_asarray(values): + raise errors.TypingError('The second argument "values" must be ' + 'array-like') + + if is_nonelike(axis): + def impl(arr, values, axis=None): + arr = np.ravel(np.asarray(arr)) + values = np.ravel(np.asarray(values)) + return np.concatenate((arr, values)) + else: + + if not isinstance(axis, types.Integer): + raise errors.TypingError('The third argument "axis" must be an ' + 'integer') + + def impl(arr, values, axis=None): + return np.concatenate((arr, values), axis=axis) + return impl + + +@lower_builtin('array.ravel', types.Array) +def array_ravel(context, builder, sig, args): + # Only support no argument version (default order='C') + def imp_nocopy(ary): + """No copy version""" + return ary.reshape(ary.size) + + def imp_copy(ary): + """Copy version""" + return ary.flatten() + + # If the input array is C layout already, use the nocopy version + if sig.args[0].layout == 'C': + imp = imp_nocopy + # otherwise, use flatten under-the-hood + else: + imp = imp_copy + + res = context.compile_internal(builder, imp, sig, args) + res = impl_ret_new_ref(context, builder, sig.return_type, res) + return res + + +@lower_builtin(np.ravel, types.Array) +def np_ravel(context, builder, sig, args): + def np_ravel_impl(a): + return a.ravel() + + return context.compile_internal(builder, np_ravel_impl, sig, args) + + +@lower_builtin('array.flatten', types.Array) +def array_flatten(context, builder, sig, args): + # Only support flattening to C layout currently. + def imp(ary): + return ary.copy().reshape(ary.size) + + res = context.compile_internal(builder, imp, sig, args) + res = impl_ret_new_ref(context, builder, sig.return_type, res) + return res + + +@register_jitable +def _np_clip_impl(a, a_min, a_max, out): + # Both a_min and a_max are numpy arrays + ret = np.empty_like(a) if out is None else out + a_b, a_min_b, a_max_b = np.broadcast_arrays(a, a_min, a_max) + for index in np.ndindex(a_b.shape): + val_a = a_b[index] + val_a_min = a_min_b[index] + val_a_max = a_max_b[index] + ret[index] = min(max(val_a, val_a_min), val_a_max) + + return ret + + +@register_jitable +def _np_clip_impl_none(a, b, use_min, out): + for index in np.ndindex(a.shape): + val_a = a[index] + val_b = b[index] + if use_min: + out[index] = min(val_a, val_b) + else: + out[index] = max(val_a, val_b) + return out + + +@overload(np.clip) +def np_clip(a, a_min, a_max, out=None): + if not type_can_asarray(a): + raise errors.TypingError('The argument "a" must be array-like') + + if (not isinstance(a_min, types.NoneType) and + not type_can_asarray(a_min)): + raise errors.TypingError(('The argument "a_min" must be a number ' + 'or an array-like')) + + if (not isinstance(a_max, types.NoneType) and + not type_can_asarray(a_max)): + raise errors.TypingError('The argument "a_max" must be a number ' + 'or an array-like') + + if not (isinstance(out, types.Array) or is_nonelike(out)): + msg = 'The argument "out" must be an array if it is provided' + raise errors.TypingError(msg) + + # TODO: support scalar a (issue #3469) + a_min_is_none = a_min is None or isinstance(a_min, types.NoneType) + a_max_is_none = a_max is None or isinstance(a_max, types.NoneType) + + if a_min_is_none and a_max_is_none: + # Raises value error when both a_min and a_max are None + def np_clip_nn(a, a_min, a_max, out=None): + raise ValueError("array_clip: must set either max or min") + + return np_clip_nn + + a_min_is_scalar = isinstance(a_min, types.Number) + a_max_is_scalar = isinstance(a_max, types.Number) + + if a_min_is_scalar and a_max_is_scalar: + def np_clip_ss(a, a_min, a_max, out=None): + # a_min and a_max are scalars + # since their shape will be empty + # so broadcasting is not needed at all + ret = np.empty_like(a) if out is None else out + for index in np.ndindex(a.shape): + val_a = a[index] + ret[index] = min(max(val_a, a_min), a_max) + + return ret + + return np_clip_ss + elif a_min_is_scalar and not a_max_is_scalar: + if a_max_is_none: + def np_clip_sn(a, a_min, a_max, out=None): + # a_min is a scalar + # since its shape will be empty + # so broadcasting is not needed at all + ret = np.empty_like(a) if out is None else out + for index in np.ndindex(a.shape): + val_a = a[index] + ret[index] = max(val_a, a_min) + + return ret + + return np_clip_sn + else: + def np_clip_sa(a, a_min, a_max, out=None): + # a_min is a scalar + # since its shape will be empty + # broadcast it to shape of a + # by using np.full_like + a_min_full = np.full_like(a, a_min) + return _np_clip_impl(a, a_min_full, a_max, out) + + return np_clip_sa + elif not a_min_is_scalar and a_max_is_scalar: + if a_min_is_none: + def np_clip_ns(a, a_min, a_max, out=None): + # a_max is a scalar + # since its shape will be empty + # so broadcasting is not needed at all + ret = np.empty_like(a) if out is None else out + for index in np.ndindex(a.shape): + val_a = a[index] + ret[index] = min(val_a, a_max) + + return ret + + return np_clip_ns + else: + def np_clip_as(a, a_min, a_max, out=None): + # a_max is a scalar + # since its shape will be empty + # broadcast it to shape of a + # by using np.full_like + a_max_full = np.full_like(a, a_max) + return _np_clip_impl(a, a_min, a_max_full, out) + + return np_clip_as + else: + # Case where exactly one of a_min or a_max is None + if a_min_is_none: + def np_clip_na(a, a_min, a_max, out=None): + # a_max is a numpy array but a_min is None + ret = np.empty_like(a) if out is None else out + a_b, a_max_b = np.broadcast_arrays(a, a_max) + return _np_clip_impl_none(a_b, a_max_b, True, ret) + + return np_clip_na + elif a_max_is_none: + def np_clip_an(a, a_min, a_max, out=None): + # a_min is a numpy array but a_max is None + ret = np.empty_like(a) if out is None else out + a_b, a_min_b = np.broadcast_arrays(a, a_min) + return _np_clip_impl_none(a_b, a_min_b, False, ret) + + return np_clip_an + else: + def np_clip_aa(a, a_min, a_max, out=None): + # Both a_min and a_max are clearly arrays + # because none of the above branches + # returned + return _np_clip_impl(a, a_min, a_max, out) + + return np_clip_aa + + +@overload_method(types.Array, 'clip') +def array_clip(a, a_min=None, a_max=None, out=None): + def impl(a, a_min=None, a_max=None, out=None): + return np.clip(a, a_min, a_max, out) + return impl + + +def _change_dtype(context, builder, oldty, newty, ary): + """ + Attempt to fix up *ary* for switching from *oldty* to *newty*. + + See Numpy's array_descr_set() + (np/core/src/multiarray/getset.c). + Attempt to fix the array's shape and strides for a new dtype. + False is returned on failure, True on success. + """ + assert oldty.ndim == newty.ndim + assert oldty.layout == newty.layout + + new_layout = ord(newty.layout) + any_layout = ord('A') + c_layout = ord('C') + f_layout = ord('F') + + int8 = types.int8 + + def imp(nd, dims, strides, old_itemsize, new_itemsize, layout): + # Attempt to update the layout due to limitation of the numba + # type system. + if layout == any_layout: + # Test rightmost stride to be contiguous + if strides[-1] == old_itemsize: + # Process this as if it is C contiguous + layout = int8(c_layout) + # Test leftmost stride to be F contiguous + elif strides[0] == old_itemsize: + # Process this as if it is F contiguous + layout = int8(f_layout) + + if old_itemsize != new_itemsize and (layout == any_layout or nd == 0): + return False + + if layout == c_layout: + i = nd - 1 + else: + i = 0 + + if new_itemsize < old_itemsize: + # If it is compatible, increase the size of the dimension + # at the end (or at the front if F-contiguous) + if (old_itemsize % new_itemsize) != 0: + return False + + newdim = old_itemsize // new_itemsize + dims[i] *= newdim + strides[i] = new_itemsize + + elif new_itemsize > old_itemsize: + # Determine if last (or first if F-contiguous) dimension + # is compatible + bytelength = dims[i] * old_itemsize + if (bytelength % new_itemsize) != 0: + return False + + dims[i] = bytelength // new_itemsize + strides[i] = new_itemsize + + else: + # Same item size: nothing to do (this also works for + # non-contiguous arrays). + pass + + return True + + old_itemsize = context.get_constant(types.intp, + get_itemsize(context, oldty)) + new_itemsize = context.get_constant(types.intp, + get_itemsize(context, newty)) + + nd = context.get_constant(types.intp, newty.ndim) + shape_data = cgutils.gep_inbounds(builder, ary._get_ptr_by_name('shape'), + 0, 0) + strides_data = cgutils.gep_inbounds(builder, + ary._get_ptr_by_name('strides'), 0, 0) + + shape_strides_array_type = types.Array(dtype=types.intp, ndim=1, layout='C') + arycls = context.make_array(shape_strides_array_type) + + shape_constant = cgutils.pack_array(builder, + [context.get_constant(types.intp, + newty.ndim)]) + + sizeof_intp = context.get_abi_sizeof(context.get_data_type(types.intp)) + sizeof_intp = context.get_constant(types.intp, sizeof_intp) + strides_constant = cgutils.pack_array(builder, [sizeof_intp]) + + shape_ary = arycls(context, builder) + + populate_array(shape_ary, + data=shape_data, + shape=shape_constant, + strides=strides_constant, + itemsize=sizeof_intp, + meminfo=None) + + strides_ary = arycls(context, builder) + populate_array(strides_ary, + data=strides_data, + shape=shape_constant, + strides=strides_constant, + itemsize=sizeof_intp, + meminfo=None) + + shape = shape_ary._getvalue() + strides = strides_ary._getvalue() + args = [nd, shape, strides, old_itemsize, new_itemsize, + context.get_constant(types.int8, new_layout)] + + sig = signature(types.boolean, + types.intp, # nd + shape_strides_array_type, # dims + shape_strides_array_type, # strides + types.intp, # old_itemsize + types.intp, # new_itemsize + types.int8, # layout + ) + + res = context.compile_internal(builder, imp, sig, args) + update_array_info(newty, ary) + res = impl_ret_borrowed(context, builder, sig.return_type, res) + return res + + +@overload(np.shape) +def np_shape(a): + if not type_can_asarray(a): + raise errors.TypingError("The argument to np.shape must be array-like") + + def impl(a): + return np.asarray(a).shape + return impl + + +@overload(np.size) +def np_size(a): + if not type_can_asarray(a): + raise errors.TypingError("The argument to np.size must be array-like") + + def impl(a): + return np.asarray(a).size + return impl + +# ------------------------------------------------------------------------------ + + +@overload(np.unique) +def np_unique(ar): + def np_unique_impl(ar): + b = np.sort(ar.ravel()) + head = list(b[:1]) + tail = [x for i, x in enumerate(b[1:]) if b[i] != x] + return np.array(head + tail) + return np_unique_impl + + +@overload(np.repeat) +def np_repeat(a, repeats): + # Implementation for repeats being a scalar is a module global function + # (see below) because it might be called from the implementation below. + + def np_repeat_impl_repeats_array_like(a, repeats): + # implementation if repeats is an array like + repeats_array = np.asarray(repeats, dtype=np.int64) + # if it is a singleton array, invoke the scalar implementation + if repeats_array.shape[0] == 1: + return np_repeat_impl_repeats_scaler(a, repeats_array[0]) + if np.any(repeats_array < 0): + raise ValueError("negative dimensions are not allowed") + asa = np.asarray(a) + aravel = asa.ravel() + n = aravel.shape[0] + if aravel.shape != repeats_array.shape: + raise ValueError( + "operands could not be broadcast together") + to_return = np.empty(np.sum(repeats_array), dtype=asa.dtype) + pos = 0 + for i in range(n): + to_return[pos : pos + repeats_array[i]] = aravel[i] + pos += repeats_array[i] + return to_return + + # type checking + if isinstance(a, (types.Array, + types.List, + types.BaseTuple, + types.Number, + types.Boolean, + ) + ): + if isinstance(repeats, types.Integer): + return np_repeat_impl_repeats_scaler + elif isinstance(repeats, (types.Array, types.List)): + if isinstance(repeats.dtype, types.Integer): + return np_repeat_impl_repeats_array_like + + raise errors.TypingError( + "The repeats argument must be an integer " + "or an array-like of integer dtype") + + +@register_jitable +def np_repeat_impl_repeats_scaler(a, repeats): + if repeats < 0: + raise ValueError("negative dimensions are not allowed") + asa = np.asarray(a) + aravel = asa.ravel() + n = aravel.shape[0] + if repeats == 0: + return np.empty(0, dtype=asa.dtype) + elif repeats == 1: + return np.copy(aravel) + else: + to_return = np.empty(n * repeats, dtype=asa.dtype) + for i in range(n): + to_return[i * repeats : (i + 1) * repeats] = aravel[i] + return to_return + + +@extending.overload_method(types.Array, 'repeat') +def array_repeat(a, repeats): + def array_repeat_impl(a, repeats): + return np.repeat(a, repeats) + + return array_repeat_impl + + +@intrinsic +def _intrin_get_itemsize(tyctx, dtype): + """Computes the itemsize of the dtype""" + sig = types.intp(dtype) + + def codegen(cgctx, builder, sig, llargs): + llty = cgctx.get_data_type(sig.args[0].dtype) + llintp = cgctx.get_data_type(sig.return_type) + return llintp(cgctx.get_abi_sizeof(llty)) + return sig, codegen + + +def _compatible_view(a, dtype): + pass + + +@overload(_compatible_view, target='generic') +def ol_compatible_view(a, dtype): + """Determines if the array and dtype are compatible for forming a view.""" + # NOTE: NumPy 1.23+ uses this check. + # Code based on: + # https://github.com/numpy/numpy/blob/750ad21258cfc00663586d5a466e24f91b48edc7/numpy/core/src/multiarray/getset.c#L500-L555 # noqa: E501 + def impl(a, dtype): + dtype_size = _intrin_get_itemsize(dtype) + if dtype_size != a.itemsize: + # catch forbidden cases + if a.ndim == 0: + msg1 = ("Changing the dtype of a 0d array is only supported " + "if the itemsize is unchanged") + raise ValueError(msg1) + else: + # NumPy has a check here for subarray type conversion which + # Numba doesn't support + pass + + # Resize on last axis only + axis = a.ndim - 1 + p1 = a.shape[axis] != 1 + p2 = a.size != 0 + p3 = a.strides[axis] != a.itemsize + if (p1 and p2 and p3): + msg2 = ("To change to a dtype of a different size, the last " + "axis must be contiguous") + raise ValueError(msg2) + + if dtype_size < a.itemsize: + if dtype_size == 0 or a.itemsize % dtype_size != 0: + msg3 = ("When changing to a smaller dtype, its size must " + "be a divisor of the size of original dtype") + raise ValueError(msg3) + else: + newdim = a.shape[axis] * a.itemsize + if newdim % dtype_size != 0: + msg4 = ("When changing to a larger dtype, its size must be " + "a divisor of the total size in bytes of the last " + "axis of the array.") + raise ValueError(msg4) + return impl + + +@lower_builtin('array.view', types.Array, types.DTypeSpec) +def array_view(context, builder, sig, args): + aryty = sig.args[0] + retty = sig.return_type + + ary = make_array(aryty)(context, builder, args[0]) + ret = make_array(retty)(context, builder) + # Copy all fields, casting the "data" pointer appropriately + fields = set(ret._datamodel._fields) + for k in sorted(fields): + val = getattr(ary, k) + if k == 'data': + ptrty = ret.data.type + ret.data = builder.bitcast(val, ptrty) + else: + setattr(ret, k, val) + + tyctx = context.typing_context + fnty = tyctx.resolve_value_type(_compatible_view) + _compatible_view_sig = fnty.get_call_type(tyctx, (*sig.args,), {}) + impl = context.get_function(fnty, _compatible_view_sig) + impl(builder, args) + + ok = _change_dtype(context, builder, aryty, retty, ret) + fail = builder.icmp_unsigned('==', ok, Constant(ok.type, 0)) + + with builder.if_then(fail): + msg = "new type not compatible with array" + context.call_conv.return_user_exc(builder, ValueError, (msg,)) + + res = ret._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +# ------------------------------------------------------------------------------ +# Array attributes + +@lower_getattr(types.Array, "dtype") +def array_dtype(context, builder, typ, value): + res = context.get_dummy_value() + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.Array, "shape") +@lower_getattr(types.MemoryView, "shape") +def array_shape(context, builder, typ, value): + arrayty = make_array(typ) + array = arrayty(context, builder, value) + res = array.shape + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.Array, "strides") +@lower_getattr(types.MemoryView, "strides") +def array_strides(context, builder, typ, value): + arrayty = make_array(typ) + array = arrayty(context, builder, value) + res = array.strides + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.Array, "ndim") +@lower_getattr(types.MemoryView, "ndim") +def array_ndim(context, builder, typ, value): + res = context.get_constant(types.intp, typ.ndim) + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.Array, "size") +def array_size(context, builder, typ, value): + arrayty = make_array(typ) + array = arrayty(context, builder, value) + res = array.nitems + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.Array, "itemsize") +@lower_getattr(types.MemoryView, "itemsize") +def array_itemsize(context, builder, typ, value): + arrayty = make_array(typ) + array = arrayty(context, builder, value) + res = array.itemsize + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.Array, "nbytes") +@lower_getattr(types.MemoryView, "nbytes") +def array_nbytes(context, builder, typ, value): + """ + nbytes = size * itemsize + """ + arrayty = make_array(typ) + array = arrayty(context, builder, value) + res = builder.mul(array.nitems, array.itemsize) + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.MemoryView, "contiguous") +def array_contiguous(context, builder, typ, value): + res = context.get_constant(types.boolean, typ.is_contig) + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.MemoryView, "c_contiguous") +def array_c_contiguous(context, builder, typ, value): + res = context.get_constant(types.boolean, typ.is_c_contig) + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.MemoryView, "f_contiguous") +def array_f_contiguous(context, builder, typ, value): + res = context.get_constant(types.boolean, typ.is_f_contig) + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.MemoryView, "readonly") +def array_readonly(context, builder, typ, value): + res = context.get_constant(types.boolean, not typ.mutable) + return impl_ret_untracked(context, builder, typ, res) + + +# array.ctypes + +@lower_getattr(types.Array, "ctypes") +def array_ctypes(context, builder, typ, value): + arrayty = make_array(typ) + array = arrayty(context, builder, value) + # Create new ArrayCType structure + act = types.ArrayCTypes(typ) + ctinfo = context.make_helper(builder, act) + ctinfo.data = array.data + ctinfo.meminfo = array.meminfo + res = ctinfo._getvalue() + return impl_ret_borrowed(context, builder, act, res) + + +@lower_getattr(types.ArrayCTypes, "data") +def array_ctypes_data(context, builder, typ, value): + ctinfo = context.make_helper(builder, typ, value=value) + res = ctinfo.data + # Convert it to an integer + res = builder.ptrtoint(res, context.get_value_type(types.intp)) + return impl_ret_untracked(context, builder, typ, res) + + +@lower_cast(types.ArrayCTypes, types.CPointer) +@lower_cast(types.ArrayCTypes, types.voidptr) +def array_ctypes_to_pointer(context, builder, fromty, toty, val): + ctinfo = context.make_helper(builder, fromty, value=val) + res = ctinfo.data + res = builder.bitcast(res, context.get_value_type(toty)) + return impl_ret_untracked(context, builder, toty, res) + + +def _call_contiguous_check(checker, context, builder, aryty, ary): + """Helper to invoke the contiguous checker function on an array + + Args + ---- + checker : + ``numba.numpy_supports.is_contiguous``, or + ``numba.numpy_supports.is_fortran``. + context : target context + builder : llvm ir builder + aryty : numba type + ary : llvm value + """ + ary = make_array(aryty)(context, builder, value=ary) + tup_intp = types.UniTuple(types.intp, aryty.ndim) + itemsize = context.get_abi_sizeof(context.get_value_type(aryty.dtype)) + check_sig = signature(types.bool_, tup_intp, tup_intp, types.intp) + check_args = [ary.shape, ary.strides, + context.get_constant(types.intp, itemsize)] + is_contig = context.compile_internal(builder, checker, check_sig, + check_args) + return is_contig + + +# array.flags + +@lower_getattr(types.Array, "flags") +def array_flags(context, builder, typ, value): + flagsobj = context.make_helper(builder, types.ArrayFlags(typ)) + flagsobj.parent = value + res = flagsobj._getvalue() + context.nrt.incref(builder, typ, value) + return impl_ret_new_ref(context, builder, typ, res) + + +@lower_getattr(types.ArrayFlags, "contiguous") +@lower_getattr(types.ArrayFlags, "c_contiguous") +def array_flags_c_contiguous(context, builder, typ, value): + if typ.array_type.layout != 'C': + # any layout can still be contiguous + flagsobj = context.make_helper(builder, typ, value=value) + res = _call_contiguous_check(is_contiguous, context, builder, + typ.array_type, flagsobj.parent) + else: + val = typ.array_type.layout == 'C' + res = context.get_constant(types.boolean, val) + return impl_ret_untracked(context, builder, typ, res) + + +@lower_getattr(types.ArrayFlags, "f_contiguous") +def array_flags_f_contiguous(context, builder, typ, value): + if typ.array_type.layout != 'F': + # any layout can still be contiguous + flagsobj = context.make_helper(builder, typ, value=value) + res = _call_contiguous_check(is_fortran, context, builder, + typ.array_type, flagsobj.parent) + else: + layout = typ.array_type.layout + val = layout == 'F' if typ.array_type.ndim > 1 else layout in 'CF' + res = context.get_constant(types.boolean, val) + return impl_ret_untracked(context, builder, typ, res) + + +# ------------------------------------------------------------------------------ +# .real / .imag + +@lower_getattr(types.Array, "real") +def array_real_part(context, builder, typ, value): + if typ.dtype in types.complex_domain: + return array_complex_attr(context, builder, typ, value, attr='real') + elif typ.dtype in types.number_domain: + # as an identity function + return impl_ret_borrowed(context, builder, typ, value) + else: + raise NotImplementedError('unsupported .real for {}'.format(type.dtype)) + + +@lower_getattr(types.Array, "imag") +def array_imag_part(context, builder, typ, value): + if typ.dtype in types.complex_domain: + return array_complex_attr(context, builder, typ, value, attr='imag') + elif typ.dtype in types.number_domain: + # return a readonly zero array + sig = signature(typ.copy(readonly=True), typ) + arrtype, shapes = _parse_empty_like_args(context, builder, sig, [value]) + ary = _empty_nd_impl(context, builder, arrtype, shapes) + cgutils.memset(builder, ary.data, builder.mul(ary.itemsize, + ary.nitems), 0) + return impl_ret_new_ref(context, builder, sig.return_type, + ary._getvalue()) + else: + raise NotImplementedError('unsupported .imag for {}'.format(type.dtype)) + + +def array_complex_attr(context, builder, typ, value, attr): + """ + Given a complex array, it's memory layout is: + + R C R C R C + ^ ^ ^ + + (`R` indicates a float for the real part; + `C` indicates a float for the imaginary part; + the `^` indicates the start of each element) + + To get the real part, we can simply change the dtype and itemsize to that + of the underlying float type. The new layout is: + + R x R x R x + ^ ^ ^ + + (`x` indicates unused) + + A load operation will use the dtype to determine the number of bytes to + load. + + To get the imaginary part, we shift the pointer by 1 float offset and + change the dtype and itemsize. The new layout is: + + x C x C x C + ^ ^ ^ + """ + if attr not in ['real', 'imag'] or typ.dtype not in types.complex_domain: + raise NotImplementedError("cannot get attribute `{}`".format(attr)) + + arrayty = make_array(typ) + array = arrayty(context, builder, value) + + # sizeof underlying float type + flty = typ.dtype.underlying_float + sizeof_flty = context.get_abi_sizeof(context.get_data_type(flty)) + itemsize = array.itemsize.type(sizeof_flty) + + # cast data pointer to float type + llfltptrty = context.get_value_type(flty).as_pointer() + dataptr = builder.bitcast(array.data, llfltptrty) + + # add offset + if attr == 'imag': + dataptr = builder.gep(dataptr, [ir.IntType(32)(1)]) + + # make result + resultty = typ.copy(dtype=flty, layout='A') + result = make_array(resultty)(context, builder) + repl = dict(data=dataptr, itemsize=itemsize) + cgutils.copy_struct(result, array, repl) + return impl_ret_borrowed(context, builder, resultty, result._getvalue()) + + +@overload_method(types.Array, 'conj') +@overload_method(types.Array, 'conjugate') +def array_conj(arr): + def impl(arr): + return np.conj(arr) + return impl + +# ------------------------------------------------------------------------------ +# DType attribute + + +def dtype_type(context, builder, dtypety, dtypeval): + # Just return a dummy opaque value + return context.get_dummy_value() + + +lower_getattr(types.DType, 'type')(dtype_type) +lower_getattr(types.DType, 'kind')(dtype_type) + + +# ------------------------------------------------------------------------------ +# static_getitem on Numba numerical types to create "array" types + + +@lower_builtin('static_getitem', types.NumberClass, types.Any) +def static_getitem_number_clazz(context, builder, sig, args): + """This handles the "static_getitem" when a Numba type is subscripted e.g: + var = typed.List.empty_list(float64[::1, :]) + It only allows this on simple numerical types. Compound types, like + records, are not supported. + """ + retty = sig.return_type + if isinstance(retty, types.Array): + # This isn't used or practically accessible, but has to exist, so just + # put in a NULL of the right type. + res = context.get_value_type(retty)(None) + return impl_ret_untracked(context, builder, retty, res) + else: + # This should be unreachable unless the implementation on the Type + # metaclass is changed. + msg = ("Unreachable; the definition of __getitem__ on the " + "numba.types.abstract.Type metaclass should prevent access.") + raise errors.LoweringError(msg) + + +# ------------------------------------------------------------------------------ +# Structured / record lookup + +@lower_getattr_generic(types.Array) +def array_record_getattr(context, builder, typ, value, attr): + """ + Generic getattr() implementation for record arrays: fetch the given + record member, i.e. a subarray. + """ + arrayty = make_array(typ) + array = arrayty(context, builder, value) + + rectype = typ.dtype + if not isinstance(rectype, types.Record): + raise NotImplementedError("attribute %r of %s not defined" + % (attr, typ)) + dtype = rectype.typeof(attr) + offset = rectype.offset(attr) + + if isinstance(dtype, types.NestedArray): + resty = typ.copy( + dtype=dtype.dtype, ndim=typ.ndim + dtype.ndim, layout='A') + else: + resty = typ.copy(dtype=dtype, layout='A') + + raryty = make_array(resty) + + rary = raryty(context, builder) + + constoffset = context.get_constant(types.intp, offset) + + newdataptr = cgutils.pointer_add( + builder, array.data, constoffset, return_type=rary.data.type, + ) + if isinstance(dtype, types.NestedArray): + # new shape = recarray shape + inner dimension from nestedarray + shape = cgutils.unpack_tuple(builder, array.shape, typ.ndim) + shape += [context.get_constant(types.intp, i) for i in dtype.shape] + # new strides = recarray strides + strides of the inner nestedarray + strides = cgutils.unpack_tuple(builder, array.strides, typ.ndim) + strides += [context.get_constant(types.intp, i) for i in dtype.strides] + # New datasize = size of elements of the nestedarray + datasize = context.get_abi_sizeof(context.get_data_type(dtype.dtype)) + else: + # New shape, strides, and datasize match the underlying array + shape = array.shape + strides = array.strides + datasize = context.get_abi_sizeof(context.get_data_type(dtype)) + populate_array(rary, + data=newdataptr, + shape=shape, + strides=strides, + itemsize=context.get_constant(types.intp, datasize), + meminfo=array.meminfo, + parent=array.parent) + res = rary._getvalue() + return impl_ret_borrowed(context, builder, resty, res) + + +@lower_builtin('static_getitem', types.Array, types.StringLiteral) +def array_record_getitem(context, builder, sig, args): + index = args[1] + if not isinstance(index, str): + # This will fallback to normal getitem + raise NotImplementedError + return array_record_getattr(context, builder, sig.args[0], args[0], index) + + +@lower_getattr_generic(types.Record) +def record_getattr(context, builder, typ, value, attr): + """ + Generic getattr() implementation for records: get the given record member. + """ + context.sentry_record_alignment(typ, attr) + offset = typ.offset(attr) + elemty = typ.typeof(attr) + + if isinstance(elemty, types.NestedArray): + # Only a nested array's *data* is stored in a structured array, + # so we create an array structure to point to that data. + aryty = make_array(elemty) + ary = aryty(context, builder) + dtype = elemty.dtype + newshape = [context.get_constant(types.intp, s) for s in + elemty.shape] + newstrides = [context.get_constant(types.intp, s) for s in + elemty.strides] + newdata = cgutils.get_record_member(builder, value, offset, + context.get_data_type(dtype)) + populate_array( + ary, + data=newdata, + shape=cgutils.pack_array(builder, newshape), + strides=cgutils.pack_array(builder, newstrides), + itemsize=context.get_constant(types.intp, elemty.size), + meminfo=None, + parent=None, + ) + res = ary._getvalue() + return impl_ret_borrowed(context, builder, typ, res) + else: + dptr = cgutils.get_record_member(builder, value, offset, + context.get_data_type(elemty)) + align = None if typ.aligned else 1 + res = context.unpack_value(builder, elemty, dptr, align) + return impl_ret_borrowed(context, builder, typ, res) + + +@lower_setattr_generic(types.Record) +def record_setattr(context, builder, sig, args, attr): + """ + Generic setattr() implementation for records: set the given record member. + """ + typ, valty = sig.args + target, val = args + + context.sentry_record_alignment(typ, attr) + offset = typ.offset(attr) + elemty = typ.typeof(attr) + + if isinstance(elemty, types.NestedArray): + # Copy the data from the RHS into the nested array + val_struct = cgutils.create_struct_proxy(valty)(context, builder, + value=args[1]) + src = val_struct.data + dest = cgutils.get_record_member(builder, target, offset, + src.type.pointee) + cgutils.memcpy(builder, dest, src, + context.get_constant(types.intp, elemty.nitems)) + else: + # Set the given scalar record member + dptr = cgutils.get_record_member(builder, target, offset, + context.get_data_type(elemty)) + val = context.cast(builder, val, valty, elemty) + align = None if typ.aligned else 1 + context.pack_value(builder, elemty, val, dptr, align=align) + + +@lower_builtin('static_getitem', types.Record, types.StringLiteral) +def record_static_getitem_str(context, builder, sig, args): + """ + Record.__getitem__ redirects to getattr() + """ + impl = context.get_getattr(sig.args[0], args[1]) + return impl(context, builder, sig.args[0], args[0], args[1]) + + +@lower_builtin('static_getitem', types.Record, types.IntegerLiteral) +def record_static_getitem_int(context, builder, sig, args): + """ + Record.__getitem__ redirects to getattr() + """ + idx = sig.args[1].literal_value + fields = list(sig.args[0].fields) + ll_field = context.insert_const_string(builder.module, fields[idx]) + impl = context.get_getattr(sig.args[0], ll_field) + return impl(context, builder, sig.args[0], args[0], fields[idx]) + + +@lower_builtin('static_setitem', types.Record, types.StringLiteral, types.Any) +def record_static_setitem_str(context, builder, sig, args): + """ + Record.__setitem__ redirects to setattr() + """ + recty, _, valty = sig.args + rec, idx, val = args + getattr_sig = signature(sig.return_type, recty, valty) + impl = context.get_setattr(idx, getattr_sig) + assert impl is not None + return impl(builder, (rec, val)) + + +@lower_builtin('static_setitem', types.Record, types.IntegerLiteral, types.Any) +def record_static_setitem_int(context, builder, sig, args): + """ + Record.__setitem__ redirects to setattr() + """ + recty, _, valty = sig.args + rec, idx, val = args + getattr_sig = signature(sig.return_type, recty, valty) + fields = list(sig.args[0].fields) + impl = context.get_setattr(fields[idx], getattr_sig) + assert impl is not None + return impl(builder, (rec, val)) + + +# ------------------------------------------------------------------------------ +# Constant arrays and records + + +@lower_constant(types.Array) +def constant_array(context, builder, ty, pyval): + """ + Create a constant array (mechanism is target-dependent). + """ + return context.make_constant_array(builder, ty, pyval) + + +@lower_constant(types.Record) +def constant_record(context, builder, ty, pyval): + """ + Create a record constant as a stack-allocated array of bytes. + """ + lty = ir.ArrayType(ir.IntType(8), pyval.nbytes) + val = lty(bytearray(pyval.tostring())) + return cgutils.alloca_once_value(builder, val) + + +@lower_constant(types.Bytes) +def constant_bytes(context, builder, ty, pyval): + """ + Create a constant array from bytes (mechanism is target-dependent). + """ + buf = np.array(bytearray(pyval), dtype=np.uint8) + return context.make_constant_array(builder, ty, buf) + +# ------------------------------------------------------------------------------ +# Comparisons + + +@lower_builtin(operator.is_, types.Array, types.Array) +def array_is(context, builder, sig, args): + aty, bty = sig.args + if aty != bty: + return cgutils.false_bit + + def array_is_impl(a, b): + return (a.shape == b.shape and + a.strides == b.strides and + a.ctypes.data == b.ctypes.data) + + return context.compile_internal(builder, array_is_impl, sig, args) + +# ------------------------------------------------------------------------------ +# Hash + + +@overload_attribute(types.Array, "__hash__") +def ol_array_hash(arr): + return lambda arr: None + + +# ------------------------------------------------------------------------------ +# builtin `np.flat` implementation + +def make_array_flat_cls(flatiterty): + """ + Return the Structure representation of the given *flatiterty* (an + instance of types.NumpyFlatType). + """ + return _make_flattening_iter_cls(flatiterty, 'flat') + + +def make_array_ndenumerate_cls(nditerty): + """ + Return the Structure representation of the given *nditerty* (an + instance of types.NumpyNdEnumerateType). + """ + return _make_flattening_iter_cls(nditerty, 'ndenumerate') + + +def _increment_indices(context, builder, ndim, shape, indices, end_flag=None, + loop_continue=None, loop_break=None): + zero = context.get_constant(types.intp, 0) + + bbend = builder.append_basic_block('end_increment') + + if end_flag is not None: + builder.store(cgutils.false_byte, end_flag) + + for dim in reversed(range(ndim)): + idxptr = cgutils.gep_inbounds(builder, indices, dim) + idx = cgutils.increment_index(builder, builder.load(idxptr)) + + count = shape[dim] + in_bounds = builder.icmp_signed('<', idx, count) + with cgutils.if_likely(builder, in_bounds): + # New index is still in bounds + builder.store(idx, idxptr) + if loop_continue is not None: + loop_continue(dim) + builder.branch(bbend) + # Index out of bounds => reset it and proceed it to outer index + builder.store(zero, idxptr) + if loop_break is not None: + loop_break(dim) + + if end_flag is not None: + builder.store(cgutils.true_byte, end_flag) + builder.branch(bbend) + + builder.position_at_end(bbend) + + +def _increment_indices_array(context, builder, arrty, arr, indices, + end_flag=None): + shape = cgutils.unpack_tuple(builder, arr.shape, arrty.ndim) + _increment_indices(context, builder, arrty.ndim, shape, indices, end_flag) + + +def make_nditer_cls(nditerty): + """ + Return the Structure representation of the given *nditerty* (an + instance of types.NumpyNdIterType). + """ + ndim = nditerty.ndim + layout = nditerty.layout + narrays = len(nditerty.arrays) + nshapes = ndim if nditerty.need_shaped_indexing else 1 + + class BaseSubIter(object): + """ + Base class for sub-iterators of a nditer() instance. + """ + + def __init__(self, nditer, member_name, start_dim, end_dim): + self.nditer = nditer + self.member_name = member_name + self.start_dim = start_dim + self.end_dim = end_dim + self.ndim = end_dim - start_dim + + def set_member_ptr(self, ptr): + setattr(self.nditer, self.member_name, ptr) + + @functools.cached_property + def member_ptr(self): + return getattr(self.nditer, self.member_name) + + def init_specific(self, context, builder): + pass + + def loop_continue(self, context, builder, logical_dim): + pass + + def loop_break(self, context, builder, logical_dim): + pass + + class FlatSubIter(BaseSubIter): + """ + Sub-iterator walking a contiguous array in physical order, with + support for broadcasting (the index is reset on the outer dimension). + """ + + def init_specific(self, context, builder): + zero = context.get_constant(types.intp, 0) + self.set_member_ptr(cgutils.alloca_once_value(builder, zero)) + + def compute_pointer(self, context, builder, indices, arrty, arr): + index = builder.load(self.member_ptr) + return builder.gep(arr.data, [index]) + + def loop_continue(self, context, builder, logical_dim): + if logical_dim == self.ndim - 1: + # Only increment index inside innermost logical dimension + index = builder.load(self.member_ptr) + index = cgutils.increment_index(builder, index) + builder.store(index, self.member_ptr) + + def loop_break(self, context, builder, logical_dim): + if logical_dim == 0: + # At the exit of outermost logical dimension, reset index + zero = context.get_constant(types.intp, 0) + builder.store(zero, self.member_ptr) + elif logical_dim == self.ndim - 1: + # Inside innermost logical dimension, increment index + index = builder.load(self.member_ptr) + index = cgutils.increment_index(builder, index) + builder.store(index, self.member_ptr) + + class TrivialFlatSubIter(BaseSubIter): + """ + Sub-iterator walking a contiguous array in physical order, + *without* support for broadcasting. + """ + + def init_specific(self, context, builder): + assert not nditerty.need_shaped_indexing + + def compute_pointer(self, context, builder, indices, arrty, arr): + assert len(indices) <= 1, len(indices) + return builder.gep(arr.data, indices) + + class IndexedSubIter(BaseSubIter): + """ + Sub-iterator walking an array in logical order. + """ + + def compute_pointer(self, context, builder, indices, arrty, arr): + assert len(indices) == self.ndim + return cgutils.get_item_pointer(context, builder, arrty, arr, + indices, wraparound=False) + + class ZeroDimSubIter(BaseSubIter): + """ + Sub-iterator "walking" a 0-d array. + """ + + def compute_pointer(self, context, builder, indices, arrty, arr): + return arr.data + + class ScalarSubIter(BaseSubIter): + """ + Sub-iterator "walking" a scalar value. + """ + + def compute_pointer(self, context, builder, indices, arrty, arr): + return arr + + class NdIter(cgutils.create_struct_proxy(nditerty)): + """ + .nditer() implementation. + + Note: 'F' layout means the shape is iterated in reverse logical order, + so indices and shapes arrays have to be reversed as well. + """ + + @functools.cached_property + def subiters(self): + l = [] + factories = {'flat': FlatSubIter if nditerty.need_shaped_indexing + else TrivialFlatSubIter, + 'indexed': IndexedSubIter, + '0d': ZeroDimSubIter, + 'scalar': ScalarSubIter, + } + for i, sub in enumerate(nditerty.indexers): + kind, start_dim, end_dim, _ = sub + member_name = 'index%d' % i + factory = factories[kind] + l.append(factory(self, member_name, start_dim, end_dim)) + return l + + def init_specific(self, context, builder, arrtys, arrays): + """ + Initialize the nditer() instance for the specific array inputs. + """ + zero = context.get_constant(types.intp, 0) + + # Store inputs + self.arrays = context.make_tuple(builder, types.Tuple(arrtys), + arrays) + # Create slots for scalars + for i, ty in enumerate(arrtys): + if not isinstance(ty, types.Array): + member_name = 'scalar%d' % i + # XXX as_data()? + slot = cgutils.alloca_once_value(builder, arrays[i]) + setattr(self, member_name, slot) + + arrays = self._arrays_or_scalars(context, builder, arrtys, arrays) + + # Extract iterator shape (the shape of the most-dimensional input) + main_shape_ty = types.UniTuple(types.intp, ndim) + main_shape = None + main_nitems = None + for i, arrty in enumerate(arrtys): + if isinstance(arrty, types.Array) and arrty.ndim == ndim: + main_shape = arrays[i].shape + main_nitems = arrays[i].nitems + break + else: + # Only scalar inputs => synthesize a dummy shape + assert ndim == 0 + main_shape = context.make_tuple(builder, main_shape_ty, ()) + main_nitems = context.get_constant(types.intp, 1) + + # Validate shapes of array inputs + def check_shape(shape, main_shape): + n = len(shape) + for i in range(n): + if shape[i] != main_shape[len(main_shape) - n + i]: + raise ValueError("nditer(): operands could not be " + "broadcast together") + + for arrty, arr in zip(arrtys, arrays): + if isinstance(arrty, types.Array) and arrty.ndim > 0: + sig = signature(types.none, + types.UniTuple(types.intp, arrty.ndim), + main_shape_ty) + context.compile_internal(builder, check_shape, + sig, (arr.shape, main_shape)) + + # Compute shape and size + shapes = cgutils.unpack_tuple(builder, main_shape) + if layout == 'F': + shapes = shapes[::-1] + + # If shape is empty, mark iterator exhausted + shape_is_empty = builder.icmp_signed('==', main_nitems, zero) + exhausted = builder.select(shape_is_empty, cgutils.true_byte, + cgutils.false_byte) + + if not nditerty.need_shaped_indexing: + # Flatten shape to make iteration faster on small innermost + # dimensions (e.g. a (100000, 3) shape) + shapes = (main_nitems,) + assert len(shapes) == nshapes + + indices = cgutils.alloca_once(builder, zero.type, size=nshapes) + for dim in range(nshapes): + idxptr = cgutils.gep_inbounds(builder, indices, dim) + builder.store(zero, idxptr) + + self.indices = indices + self.shape = cgutils.pack_array(builder, shapes, zero.type) + self.exhausted = cgutils.alloca_once_value(builder, exhausted) + + # Initialize subiterators + for subiter in self.subiters: + subiter.init_specific(context, builder) + + def iternext_specific(self, context, builder, result): + """ + Compute next iteration of the nditer() instance. + """ + bbend = builder.append_basic_block('end') + + # Branch early if exhausted + exhausted = cgutils.as_bool_bit(builder, + builder.load(self.exhausted)) + with cgutils.if_unlikely(builder, exhausted): + result.set_valid(False) + builder.branch(bbend) + + arrtys = nditerty.arrays + arrays = cgutils.unpack_tuple(builder, self.arrays) + arrays = self._arrays_or_scalars(context, builder, arrtys, arrays) + indices = self.indices + + # Compute iterated results + result.set_valid(True) + views = self._make_views(context, builder, indices, arrtys, arrays) + views = [v._getvalue() for v in views] + if len(views) == 1: + result.yield_(views[0]) + else: + result.yield_(context.make_tuple(builder, nditerty.yield_type, + views)) + + shape = cgutils.unpack_tuple(builder, self.shape) + _increment_indices(context, builder, len(shape), shape, + indices, self.exhausted, + functools.partial(self._loop_continue, + context, + builder), + functools.partial(self._loop_break, + context, + builder), + ) + + builder.branch(bbend) + builder.position_at_end(bbend) + + def _loop_continue(self, context, builder, dim): + for sub in self.subiters: + if sub.start_dim <= dim < sub.end_dim: + sub.loop_continue(context, builder, dim - sub.start_dim) + + def _loop_break(self, context, builder, dim): + for sub in self.subiters: + if sub.start_dim <= dim < sub.end_dim: + sub.loop_break(context, builder, dim - sub.start_dim) + + def _make_views(self, context, builder, indices, arrtys, arrays): + """ + Compute the views to be yielded. + """ + views = [None] * narrays + indexers = nditerty.indexers + subiters = self.subiters + rettys = nditerty.yield_type + if isinstance(rettys, types.BaseTuple): + rettys = list(rettys) + else: + rettys = [rettys] + indices = [builder.load(cgutils.gep_inbounds(builder, indices, i)) + for i in range(nshapes)] + + for sub, subiter in zip(indexers, subiters): + _, _, _, array_indices = sub + sub_indices = indices[subiter.start_dim:subiter.end_dim] + if layout == 'F': + sub_indices = sub_indices[::-1] + for i in array_indices: + assert views[i] is None + views[i] = self._make_view(context, builder, sub_indices, + rettys[i], + arrtys[i], arrays[i], subiter) + assert all(v for v in views) + return views + + def _make_view(self, context, builder, indices, retty, arrty, arr, + subiter): + """ + Compute a 0d view for a given input array. + """ + assert isinstance(retty, types.Array) and retty.ndim == 0 + + ptr = subiter.compute_pointer(context, builder, indices, arrty, arr) + view = context.make_array(retty)(context, builder) + + itemsize = get_itemsize(context, retty) + shape = context.make_tuple(builder, types.UniTuple(types.intp, 0), + ()) + strides = context.make_tuple(builder, types.UniTuple(types.intp, 0), + ()) + # HACK: meminfo=None avoids expensive refcounting operations + # on ephemeral views + populate_array(view, ptr, shape, strides, itemsize, meminfo=None) + return view + + def _arrays_or_scalars(self, context, builder, arrtys, arrays): + # Return a list of either array structures or pointers to + # scalar slots + l = [] + for i, (arrty, arr) in enumerate(zip(arrtys, arrays)): + if isinstance(arrty, types.Array): + l.append(context.make_array(arrty)(context, + builder, + value=arr)) + else: + l.append(getattr(self, "scalar%d" % i)) + return l + + return NdIter + + +def make_ndindex_cls(nditerty): + """ + Return the Structure representation of the given *nditerty* (an + instance of types.NumpyNdIndexType). + """ + ndim = nditerty.ndim + + class NdIndexIter(cgutils.create_struct_proxy(nditerty)): + """ + .ndindex() implementation. + """ + + def init_specific(self, context, builder, shapes): + zero = context.get_constant(types.intp, 0) + indices = cgutils.alloca_once(builder, zero.type, + size=context.get_constant(types.intp, + ndim)) + exhausted = cgutils.alloca_once_value(builder, cgutils.false_byte) + + for dim in range(ndim): + idxptr = cgutils.gep_inbounds(builder, indices, dim) + builder.store(zero, idxptr) + # 0-sized dimensions really indicate an empty array, + # but we have to catch that condition early to avoid + # a bug inside the iteration logic. + dim_size = shapes[dim] + dim_is_empty = builder.icmp_unsigned('==', dim_size, zero) + with cgutils.if_unlikely(builder, dim_is_empty): + builder.store(cgutils.true_byte, exhausted) + + self.indices = indices + self.exhausted = exhausted + self.shape = cgutils.pack_array(builder, shapes, zero.type) + + def iternext_specific(self, context, builder, result): + zero = context.get_constant(types.intp, 0) + + bbend = builder.append_basic_block('end') + + exhausted = cgutils.as_bool_bit(builder, + builder.load(self.exhausted)) + with cgutils.if_unlikely(builder, exhausted): + result.set_valid(False) + builder.branch(bbend) + + indices = [builder.load(cgutils.gep_inbounds(builder, + self.indices, + dim)) + for dim in range(ndim)] + for load in indices: + mark_positive(builder, load) + + result.yield_(cgutils.pack_array(builder, indices, zero.type)) + result.set_valid(True) + + shape = cgutils.unpack_tuple(builder, self.shape, ndim) + _increment_indices(context, builder, ndim, shape, + self.indices, self.exhausted) + + builder.branch(bbend) + builder.position_at_end(bbend) + + return NdIndexIter + + +def _make_flattening_iter_cls(flatiterty, kind): + assert kind in ('flat', 'ndenumerate') + + array_type = flatiterty.array_type + + if array_type.layout == 'C': + class CContiguousFlatIter(cgutils.create_struct_proxy(flatiterty)): + """ + .flat() / .ndenumerate() implementation for C-contiguous arrays. + """ + + def init_specific(self, context, builder, arrty, arr): + zero = context.get_constant(types.intp, 0) + self.index = cgutils.alloca_once_value(builder, zero) + # We can't trust strides[-1] to always contain the right + # step value, see + # http://docs.scipy.org/doc/numpy-dev/release.html#npy-relaxed-strides-checking # noqa: E501 + self.stride = arr.itemsize + + if kind == 'ndenumerate': + # Zero-initialize the indices array. + indices = cgutils.alloca_once( + builder, zero.type, + size=context.get_constant(types.intp, arrty.ndim)) + + for dim in range(arrty.ndim): + idxptr = cgutils.gep_inbounds(builder, indices, dim) + builder.store(zero, idxptr) + + self.indices = indices + + # NOTE: Using gep() instead of explicit pointer addition helps + # LLVM vectorize the loop (since the stride is known and + # constant). This is not possible in the non-contiguous case, + # where the strides are unknown at compile-time. + + def iternext_specific(self, context, builder, arrty, arr, result): + ndim = arrty.ndim + nitems = arr.nitems + + index = builder.load(self.index) + is_valid = builder.icmp_signed('<', index, nitems) + result.set_valid(is_valid) + + with cgutils.if_likely(builder, is_valid): + ptr = builder.gep(arr.data, [index]) + value = load_item(context, builder, arrty, ptr) + if kind == 'flat': + result.yield_(value) + else: + # ndenumerate(): fetch and increment indices + indices = self.indices + idxvals = [builder.load(cgutils.gep_inbounds(builder, + indices, + dim)) + for dim in range(ndim)] + idxtuple = cgutils.pack_array(builder, idxvals) + result.yield_( + cgutils.make_anonymous_struct(builder, + [idxtuple, value])) + _increment_indices_array(context, builder, arrty, + arr, indices) + + index = cgutils.increment_index(builder, index) + builder.store(index, self.index) + + def getitem(self, context, builder, arrty, arr, index): + ptr = builder.gep(arr.data, [index]) + return load_item(context, builder, arrty, ptr) + + def setitem(self, context, builder, arrty, arr, index, value): + ptr = builder.gep(arr.data, [index]) + store_item(context, builder, arrty, value, ptr) + + return CContiguousFlatIter + + else: + class FlatIter(cgutils.create_struct_proxy(flatiterty)): + """ + Generic .flat() / .ndenumerate() implementation for + non-contiguous arrays. + It keeps track of pointers along each dimension in order to + minimize computations. + """ + + def init_specific(self, context, builder, arrty, arr): + zero = context.get_constant(types.intp, 0) + data = arr.data + ndim = arrty.ndim + shapes = cgutils.unpack_tuple(builder, arr.shape, ndim) + + indices = cgutils.alloca_once( + builder, zero.type, size=context.get_constant(types.intp, + arrty.ndim)) + pointers = cgutils.alloca_once( + builder, data.type, size=context.get_constant(types.intp, + arrty.ndim)) + exhausted = cgutils.alloca_once_value(builder, + cgutils.false_byte) + + # Initialize indices and pointers with their start values. + for dim in range(ndim): + idxptr = cgutils.gep_inbounds(builder, indices, dim) + ptrptr = cgutils.gep_inbounds(builder, pointers, dim) + builder.store(data, ptrptr) + builder.store(zero, idxptr) + # 0-sized dimensions really indicate an empty array, + # but we have to catch that condition early to avoid + # a bug inside the iteration logic (see issue #846). + dim_size = shapes[dim] + dim_is_empty = builder.icmp_unsigned('==', dim_size, zero) + with cgutils.if_unlikely(builder, dim_is_empty): + builder.store(cgutils.true_byte, exhausted) + + self.indices = indices + self.pointers = pointers + self.exhausted = exhausted + + def iternext_specific(self, context, builder, arrty, arr, result): + ndim = arrty.ndim + shapes = cgutils.unpack_tuple(builder, arr.shape, ndim) + strides = cgutils.unpack_tuple(builder, arr.strides, ndim) + indices = self.indices + pointers = self.pointers + + zero = context.get_constant(types.intp, 0) + + bbend = builder.append_basic_block('end') + + # Catch already computed iterator exhaustion + is_exhausted = cgutils.as_bool_bit( + builder, builder.load(self.exhausted)) + with cgutils.if_unlikely(builder, is_exhausted): + result.set_valid(False) + builder.branch(bbend) + result.set_valid(True) + + # Current pointer inside last dimension + last_ptr = cgutils.gep_inbounds(builder, pointers, ndim - 1) + ptr = builder.load(last_ptr) + value = load_item(context, builder, arrty, ptr) + if kind == 'flat': + result.yield_(value) + else: + # ndenumerate() => yield (indices, value) + idxvals = [builder.load(cgutils.gep_inbounds(builder, + indices, + dim)) + for dim in range(ndim)] + idxtuple = cgutils.pack_array(builder, idxvals) + result.yield_( + cgutils.make_anonymous_struct(builder, + [idxtuple, value])) + + # Update indices and pointers by walking from inner + # dimension to outer. + for dim in reversed(range(ndim)): + idxptr = cgutils.gep_inbounds(builder, indices, dim) + idx = cgutils.increment_index(builder, + builder.load(idxptr)) + + count = shapes[dim] + stride = strides[dim] + in_bounds = builder.icmp_signed('<', idx, count) + with cgutils.if_likely(builder, in_bounds): + # Index is valid => pointer can simply be incremented. + builder.store(idx, idxptr) + ptrptr = cgutils.gep_inbounds(builder, pointers, dim) + ptr = builder.load(ptrptr) + ptr = cgutils.pointer_add(builder, ptr, stride) + builder.store(ptr, ptrptr) + # Reset pointers in inner dimensions + for inner_dim in range(dim + 1, ndim): + ptrptr = cgutils.gep_inbounds(builder, + pointers, + inner_dim) + builder.store(ptr, ptrptr) + builder.branch(bbend) + # Reset index and continue with next dimension + builder.store(zero, idxptr) + + # End of array + builder.store(cgutils.true_byte, self.exhausted) + builder.branch(bbend) + + builder.position_at_end(bbend) + + def _ptr_for_index(self, context, builder, arrty, arr, index): + ndim = arrty.ndim + shapes = cgutils.unpack_tuple(builder, arr.shape, count=ndim) + strides = cgutils.unpack_tuple(builder, arr.strides, count=ndim) + + # First convert the flattened index into a regular n-dim index + indices = [] + for dim in reversed(range(ndim)): + indices.append(builder.urem(index, shapes[dim])) + index = builder.udiv(index, shapes[dim]) + indices.reverse() + + ptr = cgutils.get_item_pointer2(context, builder, arr.data, + shapes, strides, arrty.layout, + indices) + return ptr + + def getitem(self, context, builder, arrty, arr, index): + ptr = self._ptr_for_index(context, builder, arrty, arr, index) + return load_item(context, builder, arrty, ptr) + + def setitem(self, context, builder, arrty, arr, index, value): + ptr = self._ptr_for_index(context, builder, arrty, arr, index) + store_item(context, builder, arrty, value, ptr) + + return FlatIter + + +@lower_getattr(types.Array, "flat") +def make_array_flatiter(context, builder, arrty, arr): + flatitercls = make_array_flat_cls(types.NumpyFlatType(arrty)) + flatiter = flatitercls(context, builder) + + flatiter.array = arr + + arrcls = context.make_array(arrty) + arr = arrcls(context, builder, ref=flatiter._get_ptr_by_name('array')) + + flatiter.init_specific(context, builder, arrty, arr) + + res = flatiter._getvalue() + return impl_ret_borrowed(context, builder, types.NumpyFlatType(arrty), res) + + +@lower_builtin('iternext', types.NumpyFlatType) +@iternext_impl(RefType.BORROWED) +def iternext_numpy_flatiter(context, builder, sig, args, result): + [flatiterty] = sig.args + [flatiter] = args + + flatitercls = make_array_flat_cls(flatiterty) + flatiter = flatitercls(context, builder, value=flatiter) + + arrty = flatiterty.array_type + arrcls = context.make_array(arrty) + arr = arrcls(context, builder, value=flatiter.array) + + flatiter.iternext_specific(context, builder, arrty, arr, result) + + +@lower_builtin(operator.getitem, types.NumpyFlatType, types.Integer) +def iternext_numpy_getitem(context, builder, sig, args): + flatiterty = sig.args[0] + flatiter, index = args + + flatitercls = make_array_flat_cls(flatiterty) + flatiter = flatitercls(context, builder, value=flatiter) + + arrty = flatiterty.array_type + arrcls = context.make_array(arrty) + arr = arrcls(context, builder, value=flatiter.array) + + res = flatiter.getitem(context, builder, arrty, arr, index) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(operator.setitem, types.NumpyFlatType, types.Integer, + types.Any) +def iternext_numpy_getitem_any(context, builder, sig, args): + flatiterty = sig.args[0] + flatiter, index, value = args + + flatitercls = make_array_flat_cls(flatiterty) + flatiter = flatitercls(context, builder, value=flatiter) + + arrty = flatiterty.array_type + arrcls = context.make_array(arrty) + arr = arrcls(context, builder, value=flatiter.array) + + flatiter.setitem(context, builder, arrty, arr, index, value) + return context.get_dummy_value() + + +@lower_builtin(len, types.NumpyFlatType) +def iternext_numpy_getitem_flat(context, builder, sig, args): + flatiterty = sig.args[0] + flatitercls = make_array_flat_cls(flatiterty) + flatiter = flatitercls(context, builder, value=args[0]) + + arrcls = context.make_array(flatiterty.array_type) + arr = arrcls(context, builder, value=flatiter.array) + return arr.nitems + + +@lower_builtin(np.ndenumerate, types.Array) +def make_array_ndenumerate(context, builder, sig, args): + arrty, = sig.args + arr, = args + nditercls = make_array_ndenumerate_cls(types.NumpyNdEnumerateType(arrty)) + nditer = nditercls(context, builder) + + nditer.array = arr + + arrcls = context.make_array(arrty) + arr = arrcls(context, builder, ref=nditer._get_ptr_by_name('array')) + + nditer.init_specific(context, builder, arrty, arr) + + res = nditer._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin('iternext', types.NumpyNdEnumerateType) +@iternext_impl(RefType.BORROWED) +def iternext_numpy_nditer(context, builder, sig, args, result): + [nditerty] = sig.args + [nditer] = args + + nditercls = make_array_ndenumerate_cls(nditerty) + nditer = nditercls(context, builder, value=nditer) + + arrty = nditerty.array_type + arrcls = context.make_array(arrty) + arr = arrcls(context, builder, value=nditer.array) + + nditer.iternext_specific(context, builder, arrty, arr, result) + + +@lower_builtin(pndindex, types.VarArg(types.Integer)) +@lower_builtin(np.ndindex, types.VarArg(types.Integer)) +def make_array_ndindex(context, builder, sig, args): + """ndindex(*shape)""" + shape = [context.cast(builder, arg, argty, types.intp) + for argty, arg in zip(sig.args, args)] + + nditercls = make_ndindex_cls(types.NumpyNdIndexType(len(shape))) + nditer = nditercls(context, builder) + nditer.init_specific(context, builder, shape) + + res = nditer._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(pndindex, types.BaseTuple) +@lower_builtin(np.ndindex, types.BaseTuple) +def make_array_ndindex_tuple(context, builder, sig, args): + """ndindex(shape)""" + ndim = sig.return_type.ndim + if ndim > 0: + idxty = sig.args[0].dtype + tup = args[0] + + shape = cgutils.unpack_tuple(builder, tup, ndim) + shape = [context.cast(builder, idx, idxty, types.intp) + for idx in shape] + else: + shape = [] + + nditercls = make_ndindex_cls(types.NumpyNdIndexType(len(shape))) + nditer = nditercls(context, builder) + nditer.init_specific(context, builder, shape) + + res = nditer._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin('iternext', types.NumpyNdIndexType) +@iternext_impl(RefType.BORROWED) +def iternext_numpy_ndindex(context, builder, sig, args, result): + [nditerty] = sig.args + [nditer] = args + + nditercls = make_ndindex_cls(nditerty) + nditer = nditercls(context, builder, value=nditer) + + nditer.iternext_specific(context, builder, result) + + +@lower_builtin(np.nditer, types.Any) +def make_array_nditer(context, builder, sig, args): + """ + nditer(...) + """ + nditerty = sig.return_type + arrtys = nditerty.arrays + + if isinstance(sig.args[0], types.BaseTuple): + arrays = cgutils.unpack_tuple(builder, args[0]) + else: + arrays = [args[0]] + + nditer = make_nditer_cls(nditerty)(context, builder) + nditer.init_specific(context, builder, arrtys, arrays) + + res = nditer._getvalue() + return impl_ret_borrowed(context, builder, nditerty, res) + + +@lower_builtin('iternext', types.NumpyNdIterType) +@iternext_impl(RefType.BORROWED) +def iternext_numpy_nditer2(context, builder, sig, args, result): + [nditerty] = sig.args + [nditer] = args + + nditer = make_nditer_cls(nditerty)(context, builder, value=nditer) + nditer.iternext_specific(context, builder, result) + + +@lower_builtin(operator.eq, types.DType, types.DType) +def dtype_eq_impl(context, builder, sig, args): + arg1, arg2 = sig.args + res = ir.Constant(ir.IntType(1), int(arg1 == arg2)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +# ------------------------------------------------------------------------------ +# Numpy array constructors + +def _empty_nd_impl(context, builder, arrtype, shapes): + """Utility function used for allocating a new array during LLVM code + generation (lowering). Given a target context, builder, array + type, and a tuple or list of lowered dimension sizes, returns a + LLVM value pointing at a Numba runtime allocated array. + """ + arycls = make_array(arrtype) + ary = arycls(context, builder) + + datatype = context.get_data_type(arrtype.dtype) + itemsize = context.get_constant(types.intp, get_itemsize(context, arrtype)) + + # compute array length + arrlen = context.get_constant(types.intp, 1) + overflow = Constant(ir.IntType(1), 0) + for s in shapes: + arrlen_mult = builder.smul_with_overflow(arrlen, s) + arrlen = builder.extract_value(arrlen_mult, 0) + overflow = builder.or_( + overflow, builder.extract_value(arrlen_mult, 1) + ) + + if arrtype.ndim == 0: + strides = () + elif arrtype.layout == 'C': + strides = [itemsize] + for dimension_size in reversed(shapes[1:]): + strides.append(builder.mul(strides[-1], dimension_size)) + strides = tuple(reversed(strides)) + elif arrtype.layout == 'F': + strides = [itemsize] + for dimension_size in shapes[:-1]: + strides.append(builder.mul(strides[-1], dimension_size)) + strides = tuple(strides) + else: + raise NotImplementedError( + "Don't know how to allocate array with layout '{0}'.".format( + arrtype.layout)) + + # Check overflow, numpy also does this after checking order + allocsize_mult = builder.smul_with_overflow(arrlen, itemsize) + allocsize = builder.extract_value(allocsize_mult, 0) + overflow = builder.or_(overflow, builder.extract_value(allocsize_mult, 1)) + + with builder.if_then(overflow, likely=False): + # Raise same error as numpy, see: + # https://github.com/numpy/numpy/blob/2a488fe76a0f732dc418d03b452caace161673da/numpy/core/src/multiarray/ctors.c#L1095-L1101 # noqa: E501 + context.call_conv.return_user_exc( + builder, ValueError, + ("array is too big; `arr.size * arr.dtype.itemsize` is larger than" + " the maximum possible size.",) + ) + + dtype = arrtype.dtype + align_val = context.get_preferred_array_alignment(dtype) + align = context.get_constant(types.uint32, align_val) + args = (context.get_dummy_value(), allocsize, align) + + mip = types.MemInfoPointer(types.voidptr) + arytypeclass = types.TypeRef(type(arrtype)) + argtypes = signature(mip, arytypeclass, types.intp, types.uint32) + + meminfo = context.compile_internal(builder, _call_allocator, argtypes, args) + data = context.nrt.meminfo_data(builder, meminfo) + + intp_t = context.get_value_type(types.intp) + shape_array = cgutils.pack_array(builder, shapes, ty=intp_t) + strides_array = cgutils.pack_array(builder, strides, ty=intp_t) + + populate_array(ary, + data=builder.bitcast(data, datatype.as_pointer()), + shape=shape_array, + strides=strides_array, + itemsize=itemsize, + meminfo=meminfo) + + return ary + + +@overload_classmethod(types.Array, "_allocate") +def _ol_array_allocate(cls, allocsize, align): + """Implements a Numba-only default target (cpu) classmethod on the array + type. + """ + def impl(cls, allocsize, align): + return intrin_alloc(allocsize, align) + return impl + + +def _call_allocator(arrtype, size, align): + """Trampoline to call the intrinsic used for allocation + """ + return arrtype._allocate(size, align) + + +@intrinsic +def intrin_alloc(typingctx, allocsize, align): + """Intrinsic to call into the allocator for Array + """ + def codegen(context, builder, signature, args): + [allocsize, align] = args + meminfo = context.nrt.meminfo_alloc_aligned(builder, allocsize, align) + return meminfo + + mip = types.MemInfoPointer(types.voidptr) # return untyped pointer + sig = signature(mip, allocsize, align) + return sig, codegen + + +def _parse_shape(context, builder, ty, val): + """ + Parse the shape argument to an array constructor. + """ + def safecast_intp(context, builder, src_t, src): + """Cast src to intp only if value can be maintained""" + intp_t = context.get_value_type(types.intp) + intp_width = intp_t.width + intp_ir = ir.IntType(intp_width) + maxval = Constant(intp_ir, ((1 << intp_width - 1) - 1)) + if src_t.width < intp_width: + res = builder.sext(src, intp_ir) + elif src_t.width >= intp_width: + is_larger = builder.icmp_signed(">", src, maxval) + with builder.if_then(is_larger, likely=False): + context.call_conv.return_user_exc( + builder, ValueError, + ("Cannot safely convert value to intp",) + ) + if src_t.width > intp_width: + res = builder.trunc(src, intp_ir) + else: + res = src + return res + + if isinstance(ty, types.Integer): + ndim = 1 + passed_shapes = [context.cast(builder, val, ty, types.intp)] + else: + assert isinstance(ty, types.BaseTuple) + ndim = ty.count + passed_shapes = cgutils.unpack_tuple(builder, val, count=ndim) + + shapes = [] + for s in passed_shapes: + shapes.append(safecast_intp(context, builder, s.type, s)) + + zero = context.get_constant_generic(builder, types.intp, 0) + for dim in range(ndim): + is_neg = builder.icmp_signed('<', shapes[dim], zero) + with cgutils.if_unlikely(builder, is_neg): + context.call_conv.return_user_exc( + builder, ValueError, ("negative dimensions not allowed",) + ) + + return shapes + + +def _parse_empty_args(context, builder, sig, args): + """ + Parse the arguments of a np.empty(), np.zeros() or np.ones() call. + """ + arrshapetype = sig.args[0] + arrshape = args[0] + arrtype = sig.return_type + return arrtype, _parse_shape(context, builder, arrshapetype, arrshape) + + +def _parse_empty_like_args(context, builder, sig, args): + """ + Parse the arguments of a np.empty_like(), np.zeros_like() or + np.ones_like() call. + """ + arytype = sig.args[0] + if isinstance(arytype, types.Array): + ary = make_array(arytype)(context, builder, value=args[0]) + shapes = cgutils.unpack_tuple(builder, ary.shape, count=arytype.ndim) + return sig.return_type, shapes + else: + return sig.return_type, () + + +def _check_const_str_dtype(fname, dtype): + if isinstance(dtype, types.UnicodeType): + msg = f"If np.{fname} dtype is a string it must be a string constant." + raise errors.TypingError(msg) + + +@intrinsic +def numpy_empty_nd(tyctx, ty_shape, ty_dtype, ty_retty_ref): + ty_retty = ty_retty_ref.instance_type + sig = ty_retty(ty_shape, ty_dtype, ty_retty_ref) + + def codegen(cgctx, builder, sig, llargs): + arrtype, shapes = _parse_empty_args(cgctx, builder, sig, llargs) + ary = _empty_nd_impl(cgctx, builder, arrtype, shapes) + return ary._getvalue() + return sig, codegen + + +@overload(np.empty) +def ol_np_empty(shape, dtype=float): + _check_const_str_dtype("empty", dtype) + if (dtype is float or + (isinstance(dtype, types.Function) and dtype.typing_key is float) or + is_nonelike(dtype)): #default + nb_dtype = types.double + else: + nb_dtype = ty_parse_dtype(dtype) + + ndim = ty_parse_shape(shape) + if nb_dtype is not None and ndim is not None: + retty = types.Array(dtype=nb_dtype, ndim=ndim, layout='C') + + def impl(shape, dtype=float): + return numpy_empty_nd(shape, dtype, retty) + return impl + else: + msg = f"Cannot parse input types to function np.empty({shape}, {dtype})" + raise errors.TypingError(msg) + + +@intrinsic +def numpy_empty_like_nd(tyctx, ty_prototype, ty_dtype, ty_retty_ref): + ty_retty = ty_retty_ref.instance_type + sig = ty_retty(ty_prototype, ty_dtype, ty_retty_ref) + + def codegen(cgctx, builder, sig, llargs): + arrtype, shapes = _parse_empty_like_args(cgctx, builder, sig, llargs) + ary = _empty_nd_impl(cgctx, builder, arrtype, shapes) + return ary._getvalue() + return sig, codegen + + +@overload(np.empty_like) +def ol_np_empty_like(arr, dtype=None): + _check_const_str_dtype("empty_like", dtype) + if not is_nonelike(dtype): + nb_dtype = ty_parse_dtype(dtype) + elif isinstance(arr, types.Array): + nb_dtype = arr.dtype + else: + nb_dtype = arr + if nb_dtype is not None: + if isinstance(arr, types.Array): + layout = arr.layout if arr.layout != 'A' else 'C' + retty = arr.copy(dtype=nb_dtype, layout=layout, readonly=False) + else: + retty = types.Array(nb_dtype, 0, 'C') + else: + msg = ("Cannot parse input types to function " + f"np.empty_like({arr}, {dtype})") + raise errors.TypingError(msg) + + def impl(arr, dtype=None): + return numpy_empty_like_nd(arr, dtype, retty) + return impl + + +@intrinsic +def _zero_fill_array_method(tyctx, self): + sig = types.none(self) + + def codegen(cgctx, builder, sig, llargs): + ary = make_array(sig.args[0])(cgctx, builder, llargs[0]) + cgutils.memset(builder, ary.data, builder.mul(ary.itemsize, ary.nitems), + 0) + return sig, codegen + + +@overload_method(types.Array, '_zero_fill') +def ol_array_zero_fill(self): + """Adds a `._zero_fill` method to zero fill an array using memset.""" + def impl(self): + _zero_fill_array_method(self) + return impl + + +@overload(np.zeros) +def ol_np_zeros(shape, dtype=float): + _check_const_str_dtype("zeros", dtype) + + def impl(shape, dtype=float): + arr = np.empty(shape, dtype=dtype) + arr._zero_fill() + return arr + return impl + + +@overload(np.zeros_like) +def ol_np_zeros_like(a, dtype=None): + _check_const_str_dtype("zeros_like", dtype) + + # NumPy uses 'a' as the arg name for the array-like + def impl(a, dtype=None): + arr = np.empty_like(a, dtype=dtype) + arr._zero_fill() + return arr + return impl + + +@overload(np.ones_like) +def ol_np_ones_like(a, dtype=None): + _check_const_str_dtype("ones_like", dtype) + + # NumPy uses 'a' as the arg name for the array-like + def impl(a, dtype=None): + arr = np.empty_like(a, dtype=dtype) + arr_flat = arr.flat + for idx in range(len(arr_flat)): + arr_flat[idx] = 1 + return arr + return impl + + +@overload(np.full) +def impl_np_full(shape, fill_value, dtype=None): + _check_const_str_dtype("full", dtype) + if not is_nonelike(dtype): + nb_dtype = ty_parse_dtype(dtype) + else: + nb_dtype = fill_value + + def full(shape, fill_value, dtype=None): + arr = np.empty(shape, nb_dtype) + arr_flat = arr.flat + for idx in range(len(arr_flat)): + arr_flat[idx] = fill_value + return arr + return full + + +@overload(np.full_like) +def impl_np_full_like(a, fill_value, dtype=None): + _check_const_str_dtype("full_like", dtype) + + def full_like(a, fill_value, dtype=None): + arr = np.empty_like(a, dtype) + arr_flat = arr.flat + for idx in range(len(arr_flat)): + arr_flat[idx] = fill_value + return arr + + return full_like + + +@overload(np.ones) +def ol_np_ones(shape, dtype=None): + # for some reason the NumPy default for dtype is None in the source but + # ends up as np.float64 by definition. + _check_const_str_dtype("ones", dtype) + + def impl(shape, dtype=None): + arr = np.empty(shape, dtype=dtype) + arr_flat = arr.flat + for idx in range(len(arr_flat)): + arr_flat[idx] = 1 + return arr + return impl + + +@overload(np.identity) +def impl_np_identity(n, dtype=None): + _check_const_str_dtype("identity", dtype) + if not is_nonelike(dtype): + nb_dtype = ty_parse_dtype(dtype) + else: + nb_dtype = types.double + + def identity(n, dtype=None): + arr = np.zeros((n, n), nb_dtype) + for i in range(n): + arr[i, i] = 1 + return arr + return identity + + +def _eye_none_handler(N, M): + pass + + +@extending.overload(_eye_none_handler) +def _eye_none_handler_impl(N, M): + if isinstance(M, types.NoneType): + def impl(N, M): + return N + else: + def impl(N, M): + return M + return impl + + +@extending.overload(np.eye) +def numpy_eye(N, M=None, k=0, dtype=float): + + if dtype is None or isinstance(dtype, types.NoneType): + dt = np.dtype(float) + elif isinstance(dtype, (types.DTypeSpec, types.Number)): + # dtype or instance of dtype + dt = as_dtype(getattr(dtype, 'dtype', dtype)) + else: + dt = np.dtype(dtype) + + def impl(N, M=None, k=0, dtype=float): + _M = _eye_none_handler(N, M) + arr = np.zeros((N, _M), dt) + if k >= 0: + d = min(N, _M - k) + for i in range(d): + arr[i, i + k] = 1 + else: + d = min(N + k, _M) + for i in range(d): + arr[i - k, i] = 1 + return arr + return impl + + +@overload(np.diag) +def impl_np_diag(v, k=0): + if not type_can_asarray(v): + raise errors.TypingError('The argument "v" must be array-like') + + if isinstance(v, types.Array): + if v.ndim not in (1, 2): + raise errors.NumbaTypeError("Input must be 1- or 2-d.") + + def diag_impl(v, k=0): + if v.ndim == 1: + s = v.shape + n = s[0] + abs(k) + ret = np.zeros((n, n), v.dtype) + if k >= 0: + for i in range(n - k): + ret[i, k + i] = v[i] + else: + for i in range(n + k): + ret[i - k, i] = v[i] + return ret + else: # 2-d + rows, cols = v.shape + if k < 0: + rows = rows + k + if k > 0: + cols = cols - k + n = max(min(rows, cols), 0) + ret = np.empty(n, v.dtype) + if k >= 0: + for i in range(n): + ret[i] = v[i, k + i] + else: + for i in range(n): + ret[i] = v[i - k, i] + return ret + return diag_impl + + +@overload(np.indices) +def numpy_indices(dimensions): + if not isinstance(dimensions, types.UniTuple): + msg = 'The argument "dimensions" must be a tuple of integers' + raise errors.TypingError(msg) + + if not isinstance(dimensions.dtype, types.Integer): + msg = 'The argument "dimensions" must be a tuple of integers' + raise errors.TypingError(msg) + + N = len(dimensions) + shape = (1,) * N + + def impl(dimensions): + res = np.empty((N,) + dimensions, dtype=np.int64) + i = 0 + for dim in dimensions: + idx = np.arange(dim, dtype=np.int64).reshape( + tuple_setitem(shape, i, dim) + ) + res[i] = idx + i += 1 + + return res + + return impl + + +@overload(np.diagflat) +def numpy_diagflat(v, k=0): + if not type_can_asarray(v): + msg = 'The argument "v" must be array-like' + raise errors.TypingError(msg) + + if not isinstance(k, (int, types.Integer)): + msg = 'The argument "k" must be an integer' + raise errors.TypingError(msg) + + def impl(v, k=0): + v = np.asarray(v) + v = v.ravel() + s = len(v) + abs_k = abs(k) + n = s + abs_k + res = np.zeros((n, n), v.dtype) + i = np.maximum(0, -k) + j = np.maximum(0, k) + for t in range(s): + res[i + t, j + t] = v[t] + + return res + + return impl + + +def generate_getitem_setitem_with_axis(ndim, kind): + assert kind in ('getitem', 'setitem') + + if kind == 'getitem': + fn = ''' + def _getitem(a, idx, axis): + if axis == 0: + return a[idx, ...] + ''' + for i in range(1, ndim): + lst = (':',) * i + fn += f''' + elif axis == {i}: + return a[{", ".join(lst)}, idx, ...] + ''' + else: + fn = ''' + def _setitem(a, idx, axis, vals): + if axis == 0: + a[idx, ...] = vals + ''' + + for i in range(1, ndim): + lst = (':',) * i + fn += f''' + elif axis == {i}: + a[{", ".join(lst)}, idx, ...] = vals + ''' + + fn = textwrap.dedent(fn) + exec(fn, globals()) + fn = globals()[f'_{kind}'] + return register_jitable(fn) + + +@overload(np.take) +@overload_method(types.Array, 'take') +def numpy_take(a, indices, axis=None): + + if cgutils.is_nonelike(axis): + if isinstance(a, types.Array) and isinstance(indices, types.Integer): + def take_impl(a, indices, axis=None): + if indices > (a.size - 1) or indices < -a.size: + raise IndexError("Index out of bounds") + return a.ravel()[indices] + return take_impl + + if isinstance(a, types.Array) and isinstance(indices, types.Array): + F_order = indices.layout == 'F' + + def take_impl(a, indices, axis=None): + ret = np.empty(indices.size, dtype=a.dtype) + if F_order: + walker = indices.copy() # get C order + else: + walker = indices + it = np.nditer(walker) + i = 0 + flat = a.ravel() + for x in it: + if x > (a.size - 1) or x < -a.size: + raise IndexError("Index out of bounds") + ret[i] = flat[x] + i = i + 1 + return ret.reshape(indices.shape) + return take_impl + + if isinstance(a, types.Array) and \ + isinstance(indices, (types.List, types.BaseTuple)): + def take_impl(a, indices, axis=None): + convert = np.array(indices) + return np.take(a, convert) + return take_impl + else: + if isinstance(a, types.Array) and isinstance(indices, types.Integer): + t = (0,) * (a.ndim - 1) + + # np.squeeze is too hard to implement in Numba as the tuple "t" + # needs to be allocated beforehand we don't know it's size until + # code gets executed. + @register_jitable + def _squeeze(r, axis): + tup = tuple(t) + j = 0 + assert axis < len(r.shape) and r.shape[axis] == 1, r.shape + for idx in range(len(r.shape)): + s = r.shape[idx] + if idx != axis: + tup = tuple_setitem(tup, j, s) + j += 1 + return r.reshape(tup) + + def take_impl(a, indices, axis=None): + r = np.take(a, (indices,), axis=axis) + if a.ndim == 1: + return r[0] + if axis < 0: + axis += a.ndim + return _squeeze(r, axis) + return take_impl + + if isinstance(a, types.Array) and \ + isinstance(indices, (types.Array, types.List, types.BaseTuple)): + + ndim = a.ndim + + _getitem = generate_getitem_setitem_with_axis(ndim, 'getitem') + _setitem = generate_getitem_setitem_with_axis(ndim, 'setitem') + + def take_impl(a, indices, axis=None): + if axis < 0: + axis += a.ndim + + if axis < 0 or axis >= a.ndim: + msg = (f"axis {axis} is out of bounds for array " + f"of dimension {a.ndim}") + raise ValueError(msg) + + shape = tuple_setitem(a.shape, axis, len(indices)) + out = np.empty(shape, dtype=a.dtype) + for i in range(len(indices)): + y = _getitem(a, indices[i], axis) + _setitem(out, i, axis, y) + return out + return take_impl + + +def _arange_dtype(*args): + bounds = [a for a in args if not isinstance(a, types.NoneType)] + + if any(isinstance(a, types.Complex) for a in bounds): + dtype = types.complex128 + elif any(isinstance(a, types.Float) for a in bounds): + dtype = types.float64 + else: + # `np.arange(10).dtype` is always `np.dtype(int)`, aka `np.int_`, which + # in all released versions of numpy corresponds to the C `long` type. + # Windows 64 is broken by default here because Numba (as of 0.47) does + # not differentiate between Python and NumPy integers, so a `typeof(1)` + # on w64 is `int64`, i.e. `intp`. This means an arange() will + # be typed as arange(int64) and the following will yield int64 opposed + # to int32. Example: without a load of analysis to work out of the args + # were wrapped in NumPy int*() calls it's not possible to detect the + # difference between `np.arange(10)` and `np.arange(np.int64(10)`. + NPY_TY = getattr(types, "int%s" % (8 * np.dtype(int).itemsize)) + + # unliteral these types such that `max` works. + unliteral_bounds = [types.unliteral(x) for x in bounds] + dtype = max(unliteral_bounds + [NPY_TY,]) + + return dtype + + +@overload(np.arange) +def np_arange(start, / ,stop=None, step=None, dtype=None): + if isinstance(stop, types.Optional): + stop = stop.type + if isinstance(step, types.Optional): + step = step.type + if isinstance(dtype, types.Optional): + dtype = dtype.type + + if stop is None: + stop = types.none + if step is None: + step = types.none + if dtype is None: + dtype = types.none + + if (not isinstance(start, types.Number) or + not isinstance(stop, (types.NoneType, types.Number)) or + not isinstance(step, (types.NoneType, types.Number)) or + not isinstance(dtype, (types.NoneType, types.DTypeSpec))): + + return + + if isinstance(dtype, types.NoneType): + true_dtype = _arange_dtype(start, stop, step) + else: + true_dtype = dtype.dtype + + use_complex = any([isinstance(x, types.Complex) + for x in (start, stop, step)]) + + start_value = getattr(start, "literal_value", None) + stop_value = getattr(stop, "literal_value", None) + step_value = getattr(step, "literal_value", None) + + def impl(start, /, stop=None, step=None, dtype=None): + # Allow for improved performance if given literal arguments. + lit_start = start_value if start_value is not None else start + lit_stop = stop_value if stop_value is not None else stop + lit_step = step_value if step_value is not None else step + + _step = lit_step if lit_step is not None else 1 + if lit_stop is None: + _start, _stop = 0, lit_start + else: + _start, _stop = lit_start, lit_stop + + if _step == 0: + raise ValueError("Maximum allowed size exceeded") + + nitems_c = (_stop - _start) / _step + nitems_r = int(math.ceil(nitems_c.real)) + + # Binary operator needed for compiler branch pruning. + if use_complex is True: + nitems_i = int(math.ceil(nitems_c.imag)) + nitems = max(min(nitems_i, nitems_r), 0) + else: + nitems = max(nitems_r, 0) + arr = np.empty(nitems, true_dtype) + val = _start + for i in range(nitems): + arr[i] = val + (i * _step) + return arr + + return impl + + +@overload(np.linspace) +def numpy_linspace(start, stop, num=50): + if not all(isinstance(arg, types.Number) for arg in [start, stop]): + return + + if not isinstance(num, (int, types.Integer)): + msg = 'The argument "num" must be an integer' + raise errors.TypingError(msg) + + if any(isinstance(arg, types.Complex) for arg in [start, stop]): + if config.USE_LEGACY_TYPE_SYSTEM: + dtype = types.complex128 + else: + dtype = types.np_complex128 + else: + dtype = types.float64 + + # Implementation based on https://github.com/numpy/numpy/blob/v1.20.0/numpy/core/function_base.py#L24 # noqa: E501 + def linspace(start, stop, num=50): + arr = np.empty(num, dtype) + # The multiply by 1.0 mirrors + # https://github.com/numpy/numpy/blob/v1.20.0/numpy/core/function_base.py#L125-L128 # noqa: E501 + # the side effect of this is important... start and stop become the same + # type as `dtype` i.e. 64/128 bits wide (float/complex). This is + # important later when used in the `np.divide`. + start = start * 1.0 + stop = stop * 1.0 + if num == 0: + return arr + div = num - 1 + if div > 0: + delta = stop - start + step = np.divide(delta, div) + for i in range(0, num): + arr[i] = start + (i * step) + else: + arr[0] = start + if num > 1: + arr[-1] = stop + return arr + return linspace + + +def _array_copy(context, builder, sig, args): + """ + Array copy. + """ + arytype = sig.args[0] + ary = make_array(arytype)(context, builder, value=args[0]) + shapes = cgutils.unpack_tuple(builder, ary.shape) + + rettype = sig.return_type + ret = _empty_nd_impl(context, builder, rettype, shapes) + + src_data = ary.data + dest_data = ret.data + + assert rettype.layout in "CF" + if arytype.layout == rettype.layout: + # Fast path: memcpy + cgutils.raw_memcpy(builder, dest_data, src_data, ary.nitems, + ary.itemsize, align=1) + + else: + src_strides = cgutils.unpack_tuple(builder, ary.strides) + dest_strides = cgutils.unpack_tuple(builder, ret.strides) + intp_t = context.get_value_type(types.intp) + + with cgutils.loop_nest(builder, shapes, intp_t) as indices: + src_ptr = cgutils.get_item_pointer2(context, builder, src_data, + shapes, src_strides, + arytype.layout, indices) + dest_ptr = cgutils.get_item_pointer2(context, builder, dest_data, + shapes, dest_strides, + rettype.layout, indices) + builder.store(builder.load(src_ptr), dest_ptr) + + return impl_ret_new_ref(context, builder, sig.return_type, ret._getvalue()) + + +@intrinsic +def _array_copy_intrinsic(typingctx, a): + assert isinstance(a, types.Array) + layout = 'F' if a.layout == 'F' else 'C' + ret = a.copy(layout=layout, readonly=False) + sig = ret(a) + return sig, _array_copy + + +@lower_builtin("array.copy", types.Array) +def array_copy(context, builder, sig, args): + return _array_copy(context, builder, sig, args) + + +@overload(np.copy) +def impl_numpy_copy(a): + if isinstance(a, types.Array): + def numpy_copy(a): + return _array_copy_intrinsic(a) + return numpy_copy + + +def _as_layout_array(context, builder, sig, args, output_layout): + """ + Common logic for layout conversion function; + e.g. ascontiguousarray and asfortranarray + """ + retty = sig.return_type + aryty = sig.args[0] + assert retty.layout == output_layout, 'return-type has incorrect layout' + + if aryty.ndim == 0: + # 0-dim input => asfortranarray() returns a 1-dim array + assert retty.ndim == 1 + ary = make_array(aryty)(context, builder, value=args[0]) + ret = make_array(retty)(context, builder) + + shape = context.get_constant_generic( + builder, types.UniTuple(types.intp, 1), (1,), + ) + strides = context.make_tuple(builder, + types.UniTuple(types.intp, 1), + (ary.itemsize,)) + populate_array(ret, ary.data, shape, strides, ary.itemsize, + ary.meminfo, ary.parent) + return impl_ret_borrowed(context, builder, retty, ret._getvalue()) + + elif (retty.layout == aryty.layout + or (aryty.ndim == 1 and aryty.layout in 'CF')): + # 1-dim contiguous input => return the same array + return impl_ret_borrowed(context, builder, retty, args[0]) + + else: + if aryty.layout == 'A': + # There's still chance the array is in contiguous layout, + # just that we don't know at compile time. + # We can do a runtime check. + + # Prepare and call is_contiguous or is_fortran + assert output_layout in 'CF' + check_func = is_contiguous if output_layout == 'C' else is_fortran + is_contig = _call_contiguous_check(check_func, + context, + builder, + aryty, + args[0]) + with builder.if_else(is_contig) as (then, orelse): + # If the array is already contiguous, just return it + with then: + out_then = impl_ret_borrowed(context, builder, retty, + args[0]) + then_blk = builder.block + # Otherwise, copy to a new contiguous region + with orelse: + out_orelse = _array_copy(context, builder, sig, args) + orelse_blk = builder.block + # Phi node for the return value + ret_phi = builder.phi(out_then.type) + ret_phi.add_incoming(out_then, then_blk) + ret_phi.add_incoming(out_orelse, orelse_blk) + return ret_phi + + else: + # Return a copy with the right layout + return _array_copy(context, builder, sig, args) + + +@intrinsic +def _as_layout_array_intrinsic(typingctx, a, output_layout): + if not isinstance(output_layout, types.StringLiteral): + raise errors.RequireLiteralValue(output_layout) + + ret = a.copy(layout=output_layout.literal_value, ndim=max(a.ndim, 1)) + sig = ret(a, output_layout) + + return sig, lambda c, b, s, a: _as_layout_array( + c, b, s, a, output_layout=output_layout.literal_value) + + +@overload(np.ascontiguousarray) +def array_ascontiguousarray(a): + if not type_can_asarray(a): + raise errors.TypingError('The argument "a" must be array-like') + + if isinstance(a, (types.Number, types.Boolean,)): + def impl(a): + return np.ascontiguousarray(np.array(a)) + elif isinstance(a, types.Array): + def impl(a): + return _as_layout_array_intrinsic(a, 'C') + return impl + + +@overload(np.asfortranarray) +def array_asfortranarray(a): + if not type_can_asarray(a): + raise errors.TypingError('The argument "a" must be array-like') + + if isinstance(a, (types.Number, types.Boolean,)): + def impl(a): + return np.asfortranarray(np.array(a)) + return impl + elif isinstance(a, types.Array): + def impl(a): + return _as_layout_array_intrinsic(a, 'F') + return impl + + +@lower_builtin("array.astype", types.Array, types.DTypeSpec) +@lower_builtin("array.astype", types.Array, types.StringLiteral) +def array_astype(context, builder, sig, args): + arytype = sig.args[0] + ary = make_array(arytype)(context, builder, value=args[0]) + shapes = cgutils.unpack_tuple(builder, ary.shape) + + rettype = sig.return_type + ret = _empty_nd_impl(context, builder, rettype, shapes) + + src_data = ary.data + dest_data = ret.data + + src_strides = cgutils.unpack_tuple(builder, ary.strides) + dest_strides = cgutils.unpack_tuple(builder, ret.strides) + intp_t = context.get_value_type(types.intp) + + with cgutils.loop_nest(builder, shapes, intp_t) as indices: + src_ptr = cgutils.get_item_pointer2(context, builder, src_data, + shapes, src_strides, + arytype.layout, indices) + dest_ptr = cgutils.get_item_pointer2(context, builder, dest_data, + shapes, dest_strides, + rettype.layout, indices) + item = load_item(context, builder, arytype, src_ptr) + item = context.cast(builder, item, arytype.dtype, rettype.dtype) + store_item(context, builder, rettype, item, dest_ptr) + + return impl_ret_new_ref(context, builder, sig.return_type, ret._getvalue()) + + +@intrinsic +def np_frombuffer(typingctx, buffer, dtype, retty): + ty = retty.instance_type + sig = ty(buffer, dtype, retty) + + def codegen(context, builder, sig, args): + bufty = sig.args[0] + aryty = sig.return_type + + buf = make_array(bufty)(context, builder, value=args[0]) + out_ary_ty = make_array(aryty) + out_ary = out_ary_ty(context, builder) + out_datamodel = out_ary._datamodel + + itemsize = get_itemsize(context, aryty) + ll_itemsize = Constant(buf.itemsize.type, itemsize) + nbytes = builder.mul(buf.nitems, buf.itemsize) + + # Check that the buffer size is compatible + rem = builder.srem(nbytes, ll_itemsize) + is_incompatible = cgutils.is_not_null(builder, rem) + with builder.if_then(is_incompatible, likely=False): + msg = "buffer size must be a multiple of element size" + context.call_conv.return_user_exc(builder, ValueError, (msg,)) + + shape = cgutils.pack_array(builder, [builder.sdiv(nbytes, ll_itemsize)]) + strides = cgutils.pack_array(builder, [ll_itemsize]) + data = builder.bitcast( + buf.data, context.get_value_type(out_datamodel.get_type('data')) + ) + + populate_array(out_ary, + data=data, + shape=shape, + strides=strides, + itemsize=ll_itemsize, + meminfo=buf.meminfo, + parent=buf.parent,) + + res = out_ary._getvalue() + return impl_ret_borrowed(context, builder, sig.return_type, res) + return sig, codegen + + +@overload(np.frombuffer) +def impl_np_frombuffer(buffer, dtype=float): + _check_const_str_dtype("frombuffer", dtype) + + if not isinstance(buffer, types.Buffer) or buffer.layout != 'C': + msg = f'Argument "buffer" must be buffer-like. Got {buffer}' + raise errors.TypingError(msg) + + if (dtype is float or + (isinstance(dtype, types.Function) and dtype.typing_key is float) or + is_nonelike(dtype)): #default + nb_dtype = types.double + else: + nb_dtype = ty_parse_dtype(dtype) + + if nb_dtype is not None: + retty = types.Array(dtype=nb_dtype, ndim=1, layout='C', + readonly=not buffer.mutable) + else: + msg = ("Cannot parse input types to function " + f"np.frombuffer({buffer}, {dtype})") + raise errors.TypingError(msg) + + def impl(buffer, dtype=float): + return np_frombuffer(buffer, dtype, retty) + return impl + + +@overload(carray) +def impl_carray(ptr, shape, dtype=None): + if is_nonelike(dtype): + intrinsic_cfarray = get_cfarray_intrinsic('C', None) + + def impl(ptr, shape, dtype=None): + return intrinsic_cfarray(ptr, shape) + return impl + elif isinstance(dtype, types.DTypeSpec): + intrinsic_cfarray = get_cfarray_intrinsic('C', dtype) + + def impl(ptr, shape, dtype=None): + return intrinsic_cfarray(ptr, shape) + return impl + + +@overload(farray) +def impl_farray(ptr, shape, dtype=None): + if is_nonelike(dtype): + intrinsic_cfarray = get_cfarray_intrinsic('F', None) + + def impl(ptr, shape, dtype=None): + return intrinsic_cfarray(ptr, shape) + return impl + elif isinstance(dtype, types.DTypeSpec): + intrinsic_cfarray = get_cfarray_intrinsic('F', dtype) + + def impl(ptr, shape, dtype=None): + return intrinsic_cfarray(ptr, shape) + return impl + + +def get_cfarray_intrinsic(layout, dtype_): + @intrinsic + def intrinsic_cfarray(typingctx, ptr, shape): + if ptr is types.voidptr: + ptr_dtype = None + elif isinstance(ptr, types.CPointer): + ptr_dtype = ptr.dtype + else: + msg = f"pointer argument expected, got '{ptr}'" + raise errors.NumbaTypeError(msg) + + if dtype_ is None: + if ptr_dtype is None: + msg = "explicit dtype required for void* argument" + raise errors.NumbaTypeError(msg) + dtype = ptr_dtype + elif isinstance(dtype_, types.DTypeSpec): + dtype = dtype_.dtype + if ptr_dtype is not None and dtype != ptr_dtype: + msg = f"mismatching dtype '{dtype}' for pointer type '{ptr}'" + raise errors.NumbaTypeError(msg) + else: + msg = f"invalid dtype spec '{dtype_}'" + raise errors.NumbaTypeError(msg) + + ndim = ty_parse_shape(shape) + if ndim is None: + msg = f"invalid shape '{shape}'" + raise errors.NumbaTypeError(msg) + + retty = types.Array(dtype, ndim, layout) + sig = signature(retty, ptr, shape) + return sig, np_cfarray + return intrinsic_cfarray + + +def np_cfarray(context, builder, sig, args): + """ + numba.numpy_support.carray(...) and + numba.numpy_support.farray(...). + """ + ptrty, shapety = sig.args[:2] + ptr, shape = args[:2] + + aryty = sig.return_type + assert aryty.layout in 'CF' + + out_ary = make_array(aryty)(context, builder) + + itemsize = get_itemsize(context, aryty) + ll_itemsize = cgutils.intp_t(itemsize) + + if isinstance(shapety, types.BaseTuple): + shapes = cgutils.unpack_tuple(builder, shape) + else: + shapety = (shapety,) + shapes = (shape,) + shapes = [context.cast(builder, value, fromty, types.intp) + for fromty, value in zip(shapety, shapes)] + + off = ll_itemsize + strides = [] + if aryty.layout == 'F': + for s in shapes: + strides.append(off) + off = builder.mul(off, s) + else: + for s in reversed(shapes): + strides.append(off) + off = builder.mul(off, s) + strides.reverse() + + data = builder.bitcast(ptr, + context.get_data_type(aryty.dtype).as_pointer()) + + populate_array(out_ary, + data=data, + shape=shapes, + strides=strides, + itemsize=ll_itemsize, + # Array is not memory-managed + meminfo=None, + ) + + res = out_ary._getvalue() + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +def _get_seq_size(context, builder, seqty, seq): + if isinstance(seqty, types.BaseTuple): + return context.get_constant(types.intp, len(seqty)) + elif isinstance(seqty, types.Sequence): + len_impl = context.get_function(len, signature(types.intp, seqty,)) + return len_impl(builder, (seq,)) + else: + assert 0 + + +def _get_borrowing_getitem(context, seqty): + """ + Return a getitem() implementation that doesn't incref its result. + """ + retty = seqty.dtype + getitem_impl = context.get_function(operator.getitem, + signature(retty, seqty, types.intp)) + + def wrap(builder, args): + ret = getitem_impl(builder, args) + if context.enable_nrt: + context.nrt.decref(builder, retty, ret) + return ret + + return wrap + + +def compute_sequence_shape(context, builder, ndim, seqty, seq): + """ + Compute the likely shape of a nested sequence (possibly 0d). + """ + intp_t = context.get_value_type(types.intp) + zero = Constant(intp_t, 0) + + def get_first_item(seqty, seq): + if isinstance(seqty, types.BaseTuple): + if len(seqty) == 0: + return None, None + else: + return seqty[0], builder.extract_value(seq, 0) + else: + getitem_impl = _get_borrowing_getitem(context, seqty) + return seqty.dtype, getitem_impl(builder, (seq, zero)) + + # Compute shape by traversing the first element of each nested + # sequence + shapes = [] + innerty, inner = seqty, seq + + for i in range(ndim): + if i > 0: + innerty, inner = get_first_item(innerty, inner) + shapes.append(_get_seq_size(context, builder, innerty, inner)) + + return tuple(shapes) + + +def check_sequence_shape(context, builder, seqty, seq, shapes): + """ + Check the nested sequence matches the given *shapes*. + """ + + def _fail(): + context.call_conv.return_user_exc(builder, ValueError, + ("incompatible sequence shape",)) + + def check_seq_size(seqty, seq, shapes): + if len(shapes) == 0: + return + + size = _get_seq_size(context, builder, seqty, seq) + expected = shapes[0] + mismatch = builder.icmp_signed('!=', size, expected) + with builder.if_then(mismatch, likely=False): + _fail() + + if len(shapes) == 1: + return + + if isinstance(seqty, types.Sequence): + getitem_impl = _get_borrowing_getitem(context, seqty) + with cgutils.for_range(builder, size) as loop: + innerty = seqty.dtype + inner = getitem_impl(builder, (seq, loop.index)) + check_seq_size(innerty, inner, shapes[1:]) + + elif isinstance(seqty, types.BaseTuple): + for i in range(len(seqty)): + innerty = seqty[i] + inner = builder.extract_value(seq, i) + check_seq_size(innerty, inner, shapes[1:]) + + else: + assert 0, seqty + + check_seq_size(seqty, seq, shapes) + + +def assign_sequence_to_array(context, builder, data, shapes, strides, + arrty, seqty, seq): + """ + Assign a nested sequence contents to an array. The shape must match + the sequence's structure. + """ + + def assign_item(indices, valty, val): + ptr = cgutils.get_item_pointer2(context, builder, data, shapes, strides, + arrty.layout, indices, wraparound=False) + val = context.cast(builder, val, valty, arrty.dtype) + store_item(context, builder, arrty, val, ptr) + + def assign(seqty, seq, shapes, indices): + if len(shapes) == 0: + assert not isinstance(seqty, (types.Sequence, types.BaseTuple)) + assign_item(indices, seqty, seq) + return + + size = shapes[0] + + if isinstance(seqty, types.Sequence): + getitem_impl = _get_borrowing_getitem(context, seqty) + with cgutils.for_range(builder, size) as loop: + innerty = seqty.dtype + inner = getitem_impl(builder, (seq, loop.index)) + assign(innerty, inner, shapes[1:], indices + (loop.index,)) + + elif isinstance(seqty, types.BaseTuple): + for i in range(len(seqty)): + innerty = seqty[i] + inner = builder.extract_value(seq, i) + index = context.get_constant(types.intp, i) + assign(innerty, inner, shapes[1:], indices + (index,)) + + else: + assert 0, seqty + + assign(seqty, seq, shapes, ()) + + +def np_array_typer(typingctx, object, dtype): + ndim, seq_dtype = _parse_nested_sequence(typingctx, object) + if is_nonelike(dtype): + dtype = seq_dtype + else: + dtype = ty_parse_dtype(dtype) + if dtype is None: + return + return types.Array(dtype, ndim, 'C') + + +@intrinsic +def np_array(typingctx, obj, dtype): + _check_const_str_dtype("array", dtype) + ret = np_array_typer(typingctx, obj, dtype) + sig = ret(obj, dtype) + + def codegen(context, builder, sig, args): + arrty = sig.return_type + ndim = arrty.ndim + seqty = sig.args[0] + seq = args[0] + + shapes = compute_sequence_shape(context, builder, ndim, seqty, seq) + assert len(shapes) == ndim + + check_sequence_shape(context, builder, seqty, seq, shapes) + arr = _empty_nd_impl(context, builder, arrty, shapes) + assign_sequence_to_array(context, builder, arr.data, shapes, + arr.strides, arrty, seqty, seq) + + return impl_ret_new_ref(context, builder, sig.return_type, + arr._getvalue()) + + return sig, codegen + + +@overload(np.array) +def impl_np_array(object, dtype=None): + _check_const_str_dtype("array", dtype) + if not type_can_asarray(object): + raise errors.TypingError('The argument "object" must ' + 'be array-like') + if not is_nonelike(dtype) and ty_parse_dtype(dtype) is None: + msg = 'The argument "dtype" must be a data-type if it is provided' + raise errors.TypingError(msg) + + def impl(object, dtype=None): + return np_array(object, dtype) + return impl + + +def _normalize_axis(context, builder, func_name, ndim, axis): + zero = axis.type(0) + ll_ndim = axis.type(ndim) + + # Normalize negative axis + is_neg_axis = builder.icmp_signed('<', axis, zero) + axis = builder.select(is_neg_axis, builder.add(axis, ll_ndim), axis) + + # Check axis for bounds + axis_out_of_bounds = builder.or_( + builder.icmp_signed('<', axis, zero), + builder.icmp_signed('>=', axis, ll_ndim)) + with builder.if_then(axis_out_of_bounds, likely=False): + msg = "%s(): axis out of bounds" % func_name + context.call_conv.return_user_exc(builder, IndexError, (msg,)) + + return axis + + +def _insert_axis_in_shape(context, builder, orig_shape, ndim, axis): + """ + Compute shape with the new axis inserted + e.g. given original shape (2, 3, 4) and axis=2, + the returned new shape is (2, 3, 1, 4). + """ + assert len(orig_shape) == ndim - 1 + + ll_shty = ir.ArrayType(cgutils.intp_t, ndim) + shapes = cgutils.alloca_once(builder, ll_shty) + + one = cgutils.intp_t(1) + + # 1. copy original sizes at appropriate places + for dim in range(ndim - 1): + ll_dim = cgutils.intp_t(dim) + after_axis = builder.icmp_signed('>=', ll_dim, axis) + sh = orig_shape[dim] + idx = builder.select(after_axis, + builder.add(ll_dim, one), + ll_dim) + builder.store(sh, cgutils.gep_inbounds(builder, shapes, 0, idx)) + + # 2. insert new size (1) at axis dimension + builder.store(one, cgutils.gep_inbounds(builder, shapes, 0, axis)) + + return cgutils.unpack_tuple(builder, builder.load(shapes)) + + +def _insert_axis_in_strides(context, builder, orig_strides, ndim, axis): + """ + Same as _insert_axis_in_shape(), but with a strides array. + """ + assert len(orig_strides) == ndim - 1 + + ll_shty = ir.ArrayType(cgutils.intp_t, ndim) + strides = cgutils.alloca_once(builder, ll_shty) + + one = cgutils.intp_t(1) + zero = cgutils.intp_t(0) + + # 1. copy original strides at appropriate places + for dim in range(ndim - 1): + ll_dim = cgutils.intp_t(dim) + after_axis = builder.icmp_signed('>=', ll_dim, axis) + idx = builder.select(after_axis, + builder.add(ll_dim, one), + ll_dim) + builder.store(orig_strides[dim], + cgutils.gep_inbounds(builder, strides, 0, idx)) + + # 2. insert new stride at axis dimension + # (the value is indifferent for a 1-sized dimension, we use 0) + builder.store(zero, cgutils.gep_inbounds(builder, strides, 0, axis)) + + return cgutils.unpack_tuple(builder, builder.load(strides)) + + +def expand_dims(context, builder, sig, args, axis): + """ + np.expand_dims() with the given axis. + """ + retty = sig.return_type + ndim = retty.ndim + arrty = sig.args[0] + + arr = make_array(arrty)(context, builder, value=args[0]) + ret = make_array(retty)(context, builder) + + shapes = cgutils.unpack_tuple(builder, arr.shape) + strides = cgutils.unpack_tuple(builder, arr.strides) + + new_shapes = _insert_axis_in_shape(context, builder, shapes, ndim, axis) + new_strides = _insert_axis_in_strides(context, builder, strides, ndim, axis) + + populate_array(ret, + data=arr.data, + shape=new_shapes, + strides=new_strides, + itemsize=arr.itemsize, + meminfo=arr.meminfo, + parent=arr.parent) + + return ret._getvalue() + + +@intrinsic +def np_expand_dims(typingctx, a, axis): + layout = a.layout if a.ndim <= 1 else 'A' + ret = a.copy(ndim=a.ndim + 1, layout=layout) + sig = ret(a, axis) + + def codegen(context, builder, sig, args): + axis = context.cast(builder, args[1], sig.args[1], types.intp) + axis = _normalize_axis(context, builder, "np.expand_dims", + sig.return_type.ndim, axis) + + ret = expand_dims(context, builder, sig, args, axis) + return impl_ret_borrowed(context, builder, sig.return_type, ret) + + return sig, codegen + + +@overload(np.expand_dims) +def impl_np_expand_dims(a, axis): + if not isinstance(a, types.Array): + msg = f'First argument "a" must be an array. Got {a}' + raise errors.TypingError(msg) + + if not isinstance(axis, types.Integer): + msg = f'Argument "axis" must be an integer. Got {axis}' + raise errors.TypingError(msg) + + def impl(a, axis): + return np_expand_dims(a, axis) + return impl + + +def _atleast_nd(minimum, axes): + @intrinsic + def impl(typingcontext, *args): + arrtys = args + rettys = [arg.copy(ndim=max(arg.ndim, minimum)) for arg in args] + + def codegen(context, builder, sig, args): + transform = _atleast_nd_transform(minimum, axes) + arrs = cgutils.unpack_tuple(builder, args[0]) + + rets = [transform(context, builder, arr, arrty, retty) + for arr, arrty, retty in zip(arrs, arrtys, rettys)] + + if len(rets) > 1: + ret = context.make_tuple(builder, sig.return_type, rets) + else: + ret = rets[0] + return impl_ret_borrowed(context, builder, sig.return_type, ret) + + return signature(types.Tuple(rettys) if len(rettys) > 1 else rettys[0], + types.StarArgTuple.from_types(args)), codegen + + return lambda *args: impl(*args) + + +def _atleast_nd_transform(min_ndim, axes): + """ + Return a callback successively inserting 1-sized dimensions at the + following axes. + """ + assert min_ndim == len(axes) + + def transform(context, builder, arr, arrty, retty): + for i in range(min_ndim): + ndim = i + 1 + if arrty.ndim < ndim: + axis = cgutils.intp_t(axes[i]) + newarrty = arrty.copy(ndim=arrty.ndim + 1) + arr = expand_dims(context, builder, + typing.signature(newarrty, arrty), (arr,), + axis) + arrty = newarrty + + return arr + + return transform + + +@overload(np.atleast_1d) +def np_atleast_1d(*args): + if all(isinstance(arg, types.Array) for arg in args): + return _atleast_nd(1, [0]) + + +@overload(np.atleast_2d) +def np_atleast_2d(*args): + if all(isinstance(arg, types.Array) for arg in args): + return _atleast_nd(2, [0, 0]) + + +@overload(np.atleast_3d) +def np_atleast_3d(*args): + if all(isinstance(arg, types.Array) for arg in args): + return _atleast_nd(3, [0, 0, 2]) + + +def _do_concatenate(context, builder, axis, + arrtys, arrs, arr_shapes, arr_strides, + retty, ret_shapes): + """ + Concatenate arrays along the given axis. + """ + assert len(arrtys) == len(arrs) == len(arr_shapes) == len(arr_strides) + + zero = cgutils.intp_t(0) + + # Allocate return array + ret = _empty_nd_impl(context, builder, retty, ret_shapes) + ret_strides = cgutils.unpack_tuple(builder, ret.strides) + + # Compute the offset by which to bump the destination pointer + # after copying each input array. + # Morally, we need to copy each input array at different start indices + # into the destination array; bumping the destination pointer + # is simply easier than offsetting all destination indices. + copy_offsets = [] + + for arr_sh in arr_shapes: + # offset = ret_strides[axis] * input_shape[axis] + offset = zero + for dim, (size, stride) in enumerate(zip(arr_sh, ret_strides)): + is_axis = builder.icmp_signed('==', axis.type(dim), axis) + addend = builder.mul(size, stride) + offset = builder.select(is_axis, + builder.add(offset, addend), + offset) + copy_offsets.append(offset) + + # Copy input arrays into the return array + ret_data = ret.data + + for arrty, arr, arr_sh, arr_st, offset in zip(arrtys, arrs, arr_shapes, + arr_strides, copy_offsets): + arr_data = arr.data + + # Do the copy loop + # Note the loop nesting is optimized for the destination layout + loop_nest = cgutils.loop_nest(builder, arr_sh, cgutils.intp_t, + order=retty.layout) + + with loop_nest as indices: + src_ptr = cgutils.get_item_pointer2(context, builder, arr_data, + arr_sh, arr_st, + arrty.layout, indices) + val = load_item(context, builder, arrty, src_ptr) + val = context.cast(builder, val, arrty.dtype, retty.dtype) + dest_ptr = cgutils.get_item_pointer2(context, builder, ret_data, + ret_shapes, ret_strides, + retty.layout, indices) + store_item(context, builder, retty, val, dest_ptr) + + # Bump destination pointer + ret_data = cgutils.pointer_add(builder, ret_data, offset) + + return ret + + +def _np_concatenate(context, builder, arrtys, arrs, retty, axis): + ndim = retty.ndim + + arrs = [make_array(aty)(context, builder, value=a) + for aty, a in zip(arrtys, arrs)] + + axis = _normalize_axis(context, builder, "np.concatenate", ndim, axis) + + # Get input shapes + arr_shapes = [cgutils.unpack_tuple(builder, arr.shape) for arr in arrs] + arr_strides = [cgutils.unpack_tuple(builder, arr.strides) for arr in arrs] + + # Compute return shape: + # - the dimension for the concatenation axis is summed over all inputs + # - other dimensions must match exactly for each input + ret_shapes = [cgutils.alloca_once_value(builder, sh) + for sh in arr_shapes[0]] + + for dim in range(ndim): + is_axis = builder.icmp_signed('==', axis.type(dim), axis) + ret_shape_ptr = ret_shapes[dim] + ret_sh = builder.load(ret_shape_ptr) + other_shapes = [sh[dim] for sh in arr_shapes[1:]] + + with builder.if_else(is_axis) as (on_axis, on_other_dim): + with on_axis: + sh = functools.reduce( + builder.add, + other_shapes + [ret_sh]) + builder.store(sh, ret_shape_ptr) + + with on_other_dim: + is_ok = cgutils.true_bit + for sh in other_shapes: + is_ok = builder.and_(is_ok, + builder.icmp_signed('==', sh, ret_sh)) + with builder.if_then(builder.not_(is_ok), likely=False): + context.call_conv.return_user_exc( + builder, ValueError, + ("np.concatenate(): input sizes over " + "dimension %d do not match" % dim,)) + + ret_shapes = [builder.load(sh) for sh in ret_shapes] + + ret = _do_concatenate(context, builder, axis, + arrtys, arrs, arr_shapes, arr_strides, + retty, ret_shapes) + return impl_ret_new_ref(context, builder, retty, ret._getvalue()) + + +def _np_stack(context, builder, arrtys, arrs, retty, axis): + ndim = retty.ndim + + zero = cgutils.intp_t(0) + one = cgutils.intp_t(1) + ll_narrays = cgutils.intp_t(len(arrs)) + + arrs = [make_array(aty)(context, builder, value=a) + for aty, a in zip(arrtys, arrs)] + + axis = _normalize_axis(context, builder, "np.stack", ndim, axis) + + # Check input arrays have the same shape + orig_shape = cgutils.unpack_tuple(builder, arrs[0].shape) + + for arr in arrs[1:]: + is_ok = cgutils.true_bit + for sh, orig_sh in zip(cgutils.unpack_tuple(builder, arr.shape), + orig_shape): + is_ok = builder.and_(is_ok, builder.icmp_signed('==', sh, orig_sh)) + with builder.if_then(builder.not_(is_ok), likely=False): + context.call_conv.return_user_exc( + builder, ValueError, + ("np.stack(): all input arrays must have the same shape",)) + + orig_strides = [cgutils.unpack_tuple(builder, arr.strides) for arr in arrs] + + # Compute input shapes and return shape with the new axis inserted + # e.g. given 5 input arrays of shape (2, 3, 4) and axis=1, + # corrected input shape is (2, 1, 3, 4) and return shape is (2, 5, 3, 4). + ll_shty = ir.ArrayType(cgutils.intp_t, ndim) + + input_shapes = cgutils.alloca_once(builder, ll_shty) + ret_shapes = cgutils.alloca_once(builder, ll_shty) + + # 1. copy original sizes at appropriate places + for dim in range(ndim - 1): + ll_dim = cgutils.intp_t(dim) + after_axis = builder.icmp_signed('>=', ll_dim, axis) + sh = orig_shape[dim] + idx = builder.select(after_axis, + builder.add(ll_dim, one), + ll_dim) + builder.store(sh, cgutils.gep_inbounds(builder, input_shapes, 0, idx)) + builder.store(sh, cgutils.gep_inbounds(builder, ret_shapes, 0, idx)) + + # 2. insert new size at axis dimension + builder.store(one, cgutils.gep_inbounds(builder, input_shapes, 0, axis)) + builder.store(ll_narrays, cgutils.gep_inbounds(builder, + ret_shapes, + 0, + axis)) + + input_shapes = cgutils.unpack_tuple(builder, builder.load(input_shapes)) + input_shapes = [input_shapes] * len(arrs) + ret_shapes = cgutils.unpack_tuple(builder, builder.load(ret_shapes)) + + # Compute input strides for each array with the new axis inserted + input_strides = [cgutils.alloca_once(builder, ll_shty) + for i in range(len(arrs))] + + # 1. copy original strides at appropriate places + for dim in range(ndim - 1): + ll_dim = cgutils.intp_t(dim) + after_axis = builder.icmp_signed('>=', ll_dim, axis) + idx = builder.select(after_axis, + builder.add(ll_dim, one), + ll_dim) + for i in range(len(arrs)): + builder.store(orig_strides[i][dim], + cgutils.gep_inbounds(builder, input_strides[i], 0, + idx)) + + # 2. insert new stride at axis dimension + # (the value is indifferent for a 1-sized dimension, we put 0) + for i in range(len(arrs)): + builder.store(zero, cgutils.gep_inbounds(builder, input_strides[i], 0, + axis)) + + input_strides = [cgutils.unpack_tuple(builder, builder.load(st)) + for st in input_strides] + + # Create concatenated array + ret = _do_concatenate(context, builder, axis, + arrtys, arrs, input_shapes, input_strides, + retty, ret_shapes) + return impl_ret_new_ref(context, builder, retty, ret._getvalue()) + + +def np_concatenate_typer(typingctx, arrays, axis): + if axis is not None and not isinstance(axis, types.Integer): + # Note Numpy allows axis=None, but it isn't documented: + # https://github.com/numpy/numpy/issues/7968 + return + + # does type checking + dtype, ndim = _sequence_of_arrays(typingctx, + "np.concatenate", arrays) + if ndim == 0: + msg = "zero-dimensional arrays cannot be concatenated" + raise errors.NumbaTypeError(msg) + + layout = _choose_concatenation_layout(arrays) + + return types.Array(dtype, ndim, layout) + + +@intrinsic +def np_concatenate(typingctx, arrays, axis): + ret = np_concatenate_typer(typingctx, arrays, axis) + assert isinstance(ret, types.Array) + sig = ret(arrays, axis) + + def codegen(context, builder, sig, args): + axis = context.cast(builder, args[1], sig.args[1], types.intp) + return _np_concatenate(context, builder, + list(sig.args[0]), + cgutils.unpack_tuple(builder, args[0]), + sig.return_type, + axis) + + return sig, codegen + + +@overload(np.concatenate) +def impl_np_concatenate(arrays, axis=0): + if isinstance(arrays, types.BaseTuple): + def impl(arrays, axis=0): + return np_concatenate(arrays, axis) + return impl + + +def _column_stack_dims(context, func_name, arrays): + # column_stack() allows stacking 1-d and 2-d arrays together + for a in arrays: + if a.ndim < 1 or a.ndim > 2: + msg = "np.column_stack() is only defined on 1-d and 2-d arrays" + raise errors.NumbaTypeError(msg) + return 2 + + +@intrinsic +def np_column_stack(typingctx, tup): + dtype, ndim = _sequence_of_arrays(typingctx, + "np.column_stack", tup, + dim_chooser=_column_stack_dims) + layout = _choose_concatenation_layout(tup) + ret = types.Array(dtype, ndim, layout) + sig = ret(tup) + + def codegen(context, builder, sig, args): + orig_arrtys = list(sig.args[0]) + orig_arrs = cgutils.unpack_tuple(builder, args[0]) + + arrtys = [] + arrs = [] + + axis = context.get_constant(types.intp, 1) + + for arrty, arr in zip(orig_arrtys, orig_arrs): + if arrty.ndim == 2: + arrtys.append(arrty) + arrs.append(arr) + else: + # Convert 1d array to 2d column array: np.expand_dims(a, 1) + assert arrty.ndim == 1 + newty = arrty.copy(ndim=2) + expand_sig = typing.signature(newty, arrty) + newarr = expand_dims(context, builder, expand_sig, (arr,), axis) + + arrtys.append(newty) + arrs.append(newarr) + + return _np_concatenate(context, builder, arrtys, arrs, + sig.return_type, axis) + + return sig, codegen + + +@overload(np.column_stack) +def impl_column_stack(tup): + if isinstance(tup, types.BaseTuple): + def impl(tup): + return np_column_stack(tup) + return impl + + +def _np_stack_common(context, builder, sig, args, axis): + """ + np.stack() with the given axis value. + """ + return _np_stack(context, builder, + list(sig.args[0]), + cgutils.unpack_tuple(builder, args[0]), + sig.return_type, + axis) + + +@intrinsic +def np_stack_common(typingctx, arrays, axis): + # does type checking + dtype, ndim = _sequence_of_arrays(typingctx, + "np.stack", arrays) + layout = 'F' if all(a.layout == 'F' for a in arrays) else 'C' + ret = types.Array(dtype, ndim + 1, layout) + sig = ret(arrays, axis) + + def codegen(context, builder, sig, args): + axis = context.cast(builder, args[1], sig.args[1], types.intp) + return _np_stack_common(context, builder, sig, args, axis) + + return sig, codegen + + +@overload(np.stack) +def impl_np_stack(arrays, axis=0): + if isinstance(arrays, types.BaseTuple): + def impl(arrays, axis=0): + return np_stack_common(arrays, axis) + return impl + + +def NdStack_typer(typingctx, func_name, arrays, ndim_min): + # does type checking + dtype, ndim = _sequence_of_arrays(typingctx, func_name, arrays) + ndim = max(ndim, ndim_min) + layout = _choose_concatenation_layout(arrays) + ret = types.Array(dtype, ndim, layout) + return ret + + +@intrinsic +def _np_hstack(typingctx, tup): + ret = NdStack_typer(typingctx, "np.hstack", tup, 1) + sig = ret(tup) + + def codegen(context, builder, sig, args): + tupty = sig.args[0] + ndim = tupty[0].ndim + + if ndim == 0: + # hstack() on 0-d arrays returns a 1-d array + axis = context.get_constant(types.intp, 0) + return _np_stack_common(context, builder, sig, args, axis) + + else: + # As a special case, dimension 0 of 1-dimensional arrays + # is "horizontal" + axis = 0 if ndim == 1 else 1 + + def np_hstack_impl(arrays): + return np.concatenate(arrays, axis=axis) + + return context.compile_internal(builder, np_hstack_impl, sig, args) + + return sig, codegen + + +@overload(np.hstack) +def impl_np_hstack(tup): + if isinstance(tup, types.BaseTuple): + def impl(tup): + return _np_hstack(tup) + return impl + + +@intrinsic +def _np_vstack(typingctx, tup): + ret = NdStack_typer(typingctx, "np.vstack", tup, 2) + sig = ret(tup) + + def codegen(context, builder, sig, args): + tupty = sig.args[0] + ndim = tupty[0].ndim + + if ndim == 0: + def np_vstack_impl(arrays): + return np.expand_dims(np.hstack(arrays), 1) + + elif ndim == 1: + # np.stack(arrays, axis=0) + axis = context.get_constant(types.intp, 0) + return _np_stack_common(context, builder, sig, args, axis) + + else: + def np_vstack_impl(arrays): + return np.concatenate(arrays, axis=0) + + return context.compile_internal(builder, np_vstack_impl, sig, args) + + return sig, codegen + + +@overload(np.vstack) +def impl_np_vstack(tup): + if isinstance(tup, types.BaseTuple): + def impl(tup): + return _np_vstack(tup) + return impl + + +if numpy_version >= (2, 0): + overload(np.row_stack)(impl_np_vstack) + + +@intrinsic +def _np_dstack(typingctx, tup): + ret = NdStack_typer(typingctx, "np.dstack", tup, 3) + sig = ret(tup) + + def codegen(context, builder, sig, args): + tupty = sig.args[0] + retty = sig.return_type + ndim = tupty[0].ndim + + if ndim == 0: + def np_vstack_impl(arrays): + return np.hstack(arrays).reshape(1, 1, -1) + + return context.compile_internal(builder, np_vstack_impl, sig, args) + + elif ndim == 1: + # np.expand_dims(np.stack(arrays, axis=1), axis=0) + axis = context.get_constant(types.intp, 1) + stack_retty = retty.copy(ndim=retty.ndim - 1) + stack_sig = typing.signature(stack_retty, *sig.args) + stack_ret = _np_stack_common(context, builder, stack_sig, args, + axis) + + axis = context.get_constant(types.intp, 0) + expand_sig = typing.signature(retty, stack_retty) + return expand_dims(context, builder, expand_sig, (stack_ret,), axis) + + elif ndim == 2: + # np.stack(arrays, axis=2) + axis = context.get_constant(types.intp, 2) + return _np_stack_common(context, builder, sig, args, axis) + + else: + def np_vstack_impl(arrays): + return np.concatenate(arrays, axis=2) + + return context.compile_internal(builder, np_vstack_impl, sig, args) + + return sig, codegen + + +@overload(np.dstack) +def impl_np_dstack(tup): + if isinstance(tup, types.BaseTuple): + def impl(tup): + return _np_dstack(tup) + return impl + + +@extending.overload_method(types.Array, 'fill') +def arr_fill(arr, val): + + def fill_impl(arr, val): + arr[:] = val + return None + + return fill_impl + + +@extending.overload_method(types.Array, 'dot') +def array_dot(arr, other): + def dot_impl(arr, other): + return np.dot(arr, other) + + return dot_impl + + +@overload(np.fliplr) +def np_flip_lr(m): + + if not type_can_asarray(m): + raise errors.TypingError("Cannot np.fliplr on %s type" % m) + + def impl(m): + A = np.asarray(m) + # this handling is superfluous/dead as < 2d array cannot be indexed as + # present below and so typing fails. If the typing doesn't fail due to + # some future change, this will catch it. + if A.ndim < 2: + raise ValueError('Input must be >= 2-d.') + return A[::, ::-1, ...] + return impl + + +@overload(np.flipud) +def np_flip_ud(m): + + if not type_can_asarray(m): + raise errors.TypingError("Cannot np.flipud on %s type" % m) + + def impl(m): + A = np.asarray(m) + # this handling is superfluous/dead as a 0d array cannot be indexed as + # present below and so typing fails. If the typing doesn't fail due to + # some future change, this will catch it. + if A.ndim < 1: + raise ValueError('Input must be >= 1-d.') + return A[::-1, ...] + return impl + + +@intrinsic +def _build_flip_slice_tuple(tyctx, sz): + """ Creates a tuple of slices for np.flip indexing like + `(slice(None, None, -1),) * sz` """ + if not isinstance(sz, types.IntegerLiteral): + raise errors.RequireLiteralValue(sz) + size = int(sz.literal_value) + tuple_type = types.UniTuple(dtype=types.slice3_type, count=size) + sig = tuple_type(sz) + + def codegen(context, builder, signature, args): + def impl(length, empty_tuple): + out = empty_tuple + for i in range(length): + out = tuple_setitem(out, i, slice(None, None, -1)) + return out + + inner_argtypes = [types.intp, tuple_type] + inner_sig = typing.signature(tuple_type, *inner_argtypes) + ll_idx_type = context.get_value_type(types.intp) + # Allocate an empty tuple + empty_tuple = context.get_constant_undef(tuple_type) + inner_args = [ll_idx_type(size), empty_tuple] + + res = context.compile_internal(builder, impl, inner_sig, inner_args) + return res + + return sig, codegen + + +@overload(np.flip) +def np_flip(m): + # a constant value is needed for the tuple slice, types.Array.ndim can + # provide this and so at presnet only type.Array is support + if not isinstance(m, types.Array): + raise errors.TypingError("Cannot np.flip on %s type" % m) + + def impl(m): + sl = _build_flip_slice_tuple(m.ndim) + return m[sl] + + return impl + + +@overload(np.array_split) +def np_array_split(ary, indices_or_sections, axis=0): + if isinstance(ary, (types.UniTuple, types.ListType, types.List)): + def impl(ary, indices_or_sections, axis=0): + return np.array_split( + np.asarray(ary), + indices_or_sections, + axis=axis + ) + + return impl + + if isinstance(indices_or_sections, types.Integer): + def impl(ary, indices_or_sections, axis=0): + l, rem = divmod(ary.shape[axis], indices_or_sections) + indices = np.cumsum(np.array( + [l + 1] * rem + + [l] * (indices_or_sections - rem - 1) + )) + return np.array_split(ary, indices, axis=axis) + + return impl + + elif ( + isinstance(indices_or_sections, types.IterableType) + and isinstance( + indices_or_sections.iterator_type.yield_type, + types.Integer + ) + ): + def impl(ary, indices_or_sections, axis=0): + slice_tup = build_full_slice_tuple(ary.ndim) + axis = normalize_axis("np.split", "axis", ary.ndim, axis) + out = [] + prev = 0 + for cur in indices_or_sections: + idx = tuple_setitem(slice_tup, axis, slice(prev, cur)) + out.append(ary[idx]) + prev = cur + out.append(ary[tuple_setitem(slice_tup, axis, slice(cur, None))]) + return out + + return impl + + elif ( + isinstance(indices_or_sections, types.Tuple) + and all(isinstance(t, types.Integer) for t in indices_or_sections.types) + ): + def impl(ary, indices_or_sections, axis=0): + slice_tup = build_full_slice_tuple(ary.ndim) + axis = normalize_axis("np.split", "axis", ary.ndim, axis) + out = [] + prev = 0 + for cur in literal_unroll(indices_or_sections): + idx = tuple_setitem(slice_tup, axis, slice(prev, cur)) + out.append(ary[idx]) + prev = cur + out.append(ary[tuple_setitem(slice_tup, axis, slice(cur, None))]) + return out + + return impl + + +@overload(np.split) +def np_split(ary, indices_or_sections, axis=0): + # This is just a wrapper of array_split, but with an extra error if + # indices is an int. + if isinstance(ary, (types.UniTuple, types.ListType, types.List)): + def impl(ary, indices_or_sections, axis=0): + return np.split(np.asarray(ary), indices_or_sections, axis=axis) + + return impl + + if isinstance(indices_or_sections, types.Integer): + def impl(ary, indices_or_sections, axis=0): + _, rem = divmod(ary.shape[axis], indices_or_sections) + if rem != 0: + raise ValueError( + "array split does not result in an equal division" + ) + return np.array_split( + ary, indices_or_sections, axis=axis + ) + + return impl + + else: + return np_array_split(ary, indices_or_sections, axis=axis) + + +@overload(np.vsplit) +def numpy_vsplit(ary, indices_or_sections): + if not isinstance(ary, types.Array): + msg = 'The argument "ary" must be an array' + raise errors.TypingError(msg) + + if not isinstance(indices_or_sections, (types.Integer, types.Array, + types.List, types.UniTuple)): + msg = ('The argument "indices_or_sections" must be int or 1d-array') + raise errors.TypingError(msg) + + def impl(ary, indices_or_sections): + if ary.ndim < 2: + raise ValueError(('vsplit only works on ' + 'arrays of 2 or more dimensions')) + return np.split(ary, indices_or_sections, axis=0) + + return impl + + +@overload(np.hsplit) +def numpy_hsplit(ary, indices_or_sections): + if not isinstance(ary, types.Array): + msg = 'The argument "ary" must be an array' + raise errors.TypingError(msg) + + if not isinstance(indices_or_sections, (types.Integer, types.Array, + types.List, types.UniTuple)): + msg = ('The argument "indices_or_sections" must be int or 1d-array') + raise errors.TypingError(msg) + + def impl(ary, indices_or_sections): + if ary.ndim == 0: + raise ValueError(('hsplit only works on ' + 'arrays of 1 or more dimensions')) + if ary.ndim > 1: + return np.split(ary, indices_or_sections, axis=1) + return np.split(ary, indices_or_sections, axis=0) + + return impl + + +@overload(np.dsplit) +def numpy_dsplit(ary, indices_or_sections): + if not isinstance(ary, types.Array): + msg = 'The argument "ary" must be an array' + raise errors.TypingError(msg) + + if not isinstance(indices_or_sections, (types.Integer, types.Array, + types.List, types.UniTuple)): + msg = ('The argument "indices_or_sections" must be int or 1d-array') + raise errors.TypingError(msg) + + def impl(ary, indices_or_sections): + if ary.ndim < 3: + raise ValueError('dsplit only works on arrays of 3 or more ' + 'dimensions') + return np.split(ary, indices_or_sections, axis=2) + + return impl + + +# ----------------------------------------------------------------------------- +# Sorting + +_sorts = {} + + +def default_lt(a, b): + """ + Trivial comparison function between two keys. + """ + return a < b + + +def get_sort_func(kind, lt_impl, is_argsort=False): + """ + Get a sort implementation of the given kind. + """ + key = kind, lt_impl.__name__, is_argsort + + try: + return _sorts[key] + except KeyError: + if kind == 'quicksort': + sort = quicksort.make_jit_quicksort( + lt=lt_impl, + is_argsort=is_argsort, + is_np_array=True) + func = sort.run_quicksort + elif kind == 'mergesort': + sort = mergesort.make_jit_mergesort( + lt=lt_impl, + is_argsort=is_argsort) + func = sort.run_mergesort + _sorts[key] = func + return func + + +def lt_implementation(dtype): + if isinstance(dtype, types.Float): + return lt_floats + elif isinstance(dtype, types.Complex): + return lt_complex + else: + return default_lt + + +@lower_builtin("array.sort", types.Array) +def array_sort(context, builder, sig, args): + arytype = sig.args[0] + + sort_func = get_sort_func(kind='quicksort', + lt_impl=lt_implementation(arytype.dtype)) + + def array_sort_impl(arr): + # Note we clobber the return value + sort_func(arr) + + return context.compile_internal(builder, array_sort_impl, sig, args) + + +@overload(np.sort) +def impl_np_sort(a): + if not type_can_asarray(a): + raise errors.TypingError('Argument "a" must ' + 'be array-like') + + def np_sort_impl(a): + res = a.copy() + res.sort() + return res + return np_sort_impl + + +@lower_builtin("array.argsort", types.Array, types.StringLiteral) +@lower_builtin(np.argsort, types.Array, types.StringLiteral) +def array_argsort(context, builder, sig, args): + arytype, kind = sig.args + + sort_func = get_sort_func(kind=kind.literal_value, + lt_impl=lt_implementation(arytype.dtype), + is_argsort=True) + + def array_argsort_impl(arr): + return sort_func(arr) + + innersig = sig.replace(args=sig.args[:1]) + innerargs = args[:1] + return context.compile_internal(builder, array_argsort_impl, + innersig, innerargs) + + +# ------------------------------------------------------------------------------ +# Implicit cast + +@lower_cast(types.Array, types.Array) +def array_to_array(context, builder, fromty, toty, val): + # Type inference should have prevented illegal array casting. + assert fromty.mutable != toty.mutable or toty.layout == 'A' + return val + + +@lower_cast(types.Array, types.UnicodeCharSeq) +@lower_cast(types.Array, types.Float) +@lower_cast(types.Array, types.Integer) +@lower_cast(types.Array, types.Complex) +@lower_cast(types.Array, types.Boolean) +@lower_cast(types.Array, types.NPTimedelta) +@lower_cast(types.Array, types.NPDatetime) +def array0d_to_scalar(context, builder, fromty, toty, val): + def impl(a): + # a is an array(T, 0d, O), T is type, O is order + return a.take(0) + + sig = signature(toty, fromty) + res = context.compile_internal(builder, impl, sig, [val]) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_cast(types.Array, types.UnicodeCharSeq) +def array_to_unichrseq(context, builder, fromty, toty, val): + def impl(a): + return str(a[()]) + + sig = signature(toty, fromty) + res = context.compile_internal(builder, impl, sig, [val]) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +# ------------------------------------------------------------------------------ +# Stride tricks + +def reshape_unchecked(a, shape, strides): + """ + An intrinsic returning a derived array with the given shape and strides. + """ + raise NotImplementedError + + +@extending.type_callable(reshape_unchecked) +def type_reshape_unchecked(context): + def check_shape(shape): + return (isinstance(shape, types.BaseTuple) and + all(isinstance(v, types.Integer) for v in shape)) + + def typer(a, shape, strides): + if not isinstance(a, types.Array): + return + if not check_shape(shape) or not check_shape(strides): + return + if len(shape) != len(strides): + return + return a.copy(ndim=len(shape), layout='A') + + return typer + + +@lower_builtin(reshape_unchecked, types.Array, types.BaseTuple, types.BaseTuple) +def impl_shape_unchecked(context, builder, sig, args): + aryty = sig.args[0] + retty = sig.return_type + + ary = make_array(aryty)(context, builder, args[0]) + out = make_array(retty)(context, builder) + shape = cgutils.unpack_tuple(builder, args[1]) + strides = cgutils.unpack_tuple(builder, args[2]) + + populate_array(out, + data=ary.data, + shape=shape, + strides=strides, + itemsize=ary.itemsize, + meminfo=ary.meminfo, + ) + + res = out._getvalue() + return impl_ret_borrowed(context, builder, retty, res) + + +@extending.overload(np.lib.stride_tricks.as_strided) +def as_strided(x, shape=None, strides=None): + if shape in (None, types.none): + @register_jitable + def get_shape(x, shape): + return x.shape + else: + @register_jitable + def get_shape(x, shape): + return shape + + if strides in (None, types.none): + # When *strides* is not passed, as_strided() does a non-size-checking + # reshape(), possibly changing the original strides. This is too + # cumbersome to support right now, and a Web search shows all example + # use cases of as_strided() pass explicit *strides*. + raise errors.TypingError("as_strided() strides argument cannot be None") + else: + @register_jitable + def get_strides(x, strides): + return strides + + def as_strided_impl(x, shape=None, strides=None): + x = reshape_unchecked(x, get_shape(x, shape), get_strides(x, strides)) + return x + + return as_strided_impl + + +@extending.overload(np.lib.stride_tricks.sliding_window_view) +def sliding_window_view(x, window_shape, axis=None): + + # Window shape must be given as either an integer or tuple of integers. + # We also need to generate buffer tuples we can modify to contain the + # final shape and strides (reshape_unchecked does not accept lists). + if isinstance(window_shape, types.Integer): + shape_buffer = tuple(range(x.ndim + 1)) + stride_buffer = tuple(range(x.ndim + 1)) + + @register_jitable + def get_window_shape(window_shape): + return (window_shape,) + + elif (isinstance(window_shape, types.UniTuple) and + isinstance(window_shape.dtype, types.Integer)): + shape_buffer = tuple(range(x.ndim + len(window_shape))) + stride_buffer = tuple(range(x.ndim + len(window_shape))) + + @register_jitable + def get_window_shape(window_shape): + return window_shape + + else: + raise errors.TypingError( + "window_shape must be an integer or tuple of integers" + ) + + # Axis must be integer, tuple of integers, or None for all axes. + if is_nonelike(axis): + @register_jitable + def get_axis(window_shape, axis, ndim): + return list(range(ndim)) + + elif isinstance(axis, types.Integer): + @register_jitable + def get_axis(window_shape, axis, ndim): + return [ + normalize_axis("sliding_window_view", "axis", ndim, axis) + ] + + elif (isinstance(axis, types.UniTuple) and + isinstance(axis.dtype, types.Integer)): + @register_jitable + def get_axis(window_shape, axis, ndim): + return [normalize_axis("sliding_window_view", "axis", ndim, a) + for a in axis] + + else: + raise errors.TypingError( + "axis must be None, an integer or tuple of integers" + ) + + def sliding_window_view_impl(x, window_shape, axis=None): + window_shape = get_window_shape(window_shape) + axis = get_axis(window_shape, axis, x.ndim) + if len(window_shape) != len(axis): + raise ValueError( + "Must provide matching length window_shape and axis" + ) + + # Initialise view details with shape and strides of x. + out_shape = shape_buffer + out_strides = stride_buffer + for i in range(x.ndim): + out_shape = tuple_setitem(out_shape, i, x.shape[i]) + out_strides = tuple_setitem(out_strides, i, x.strides[i]) + + # Trim the dimensions being windowed and set the window shape and + # strides. Note: the same axis can be windowed repeatedly. + i = x.ndim + for ax, dim in zip(axis, window_shape): + if dim < 0: + raise ValueError( + "`window_shape` cannot contain negative values" + ) + if out_shape[ax] < dim: + raise ValueError( + "window_shape cannot be larger than input array shape" + ) + + trimmed = out_shape[ax] - dim + 1 + out_shape = tuple_setitem(out_shape, ax, trimmed) + out_shape = tuple_setitem(out_shape, i, dim) + out_strides = tuple_setitem(out_strides, i, x.strides[ax]) + i += 1 + + # The NumPy version calls as_strided, but our implementation of + # as_strided is effectively a wrapper for reshape_unchecked. + view = reshape_unchecked(x, out_shape, out_strides) + return view + + return sliding_window_view_impl + + +@overload(bool) +def ol_bool(arr): + if isinstance(arr, types.Array): + def impl(arr): + if arr.size == 0: + if numpy_version < (2, 2): + return False # this is deprecated + else: + raise ValueError(("The truth value of an empty array is " + "ambiguous. Use `array.size > 0` to " + "check that an array is not empty.")) + elif arr.size == 1: + return bool(arr.take(0)) + else: + raise ValueError(("The truth value of an array with more than" + " one element is ambiguous. Use a.any() or" + " a.all()")) + return impl + + +@overload(np.swapaxes) +def numpy_swapaxes(a, axis1, axis2): + if not isinstance(axis1, (int, types.Integer)): + raise errors.TypingError('The second argument "axis1" must be an ' + 'integer') + if not isinstance(axis2, (int, types.Integer)): + raise errors.TypingError('The third argument "axis2" must be an ' + 'integer') + if not isinstance(a, types.Array): + raise errors.TypingError('The first argument "a" must be an array') + + # create tuple list for transpose + ndim = a.ndim + axes_list = tuple(range(ndim)) + + def impl(a, axis1, axis2): + axis1 = normalize_axis("np.swapaxes", "axis1", ndim, axis1) + axis2 = normalize_axis("np.swapaxes", "axis2", ndim, axis2) + + # to ensure tuple_setitem support of negative values + if axis1 < 0: + axis1 += ndim + if axis2 < 0: + axis2 += ndim + + axes_tuple = tuple_setitem(axes_list, axis1, axis2) + axes_tuple = tuple_setitem(axes_tuple, axis2, axis1) + return np.transpose(a, axes_tuple) + + return impl + + +@register_jitable +def _take_along_axis_impl( + arr, indices, axis, Ni_orig, Nk_orig, indices_broadcast_shape +): + # Based on example code in + # https://github.com/numpy/numpy/blob/623bc1fae1d47df24e7f1e29321d0c0ba2771ce0/numpy/lib/shape_base.py#L90-L103 + # With addition of pre-broadcasting: + # https://github.com/numpy/numpy/issues/19704 + + # Wrap axis, it's used in tuple_setitem so must be (axis >= 0) to ensure + # the GEP is in bounds. + axis = normalize_axis("np.take_along_axis", "axis", arr.ndim, axis) + + # Broadcast the two arrays to matching shapes: + arr_shape = list(arr.shape) + arr_shape[axis] = 1 + for i, (d1, d2) in enumerate(zip(arr_shape, indices.shape)): + if d1 == 1: + new_val = d2 + elif d2 == 1: + new_val = d1 + else: + if d1 != d2: + raise ValueError( + "`arr` and `indices` dimensions don't match" + ) + new_val = d1 + indices_broadcast_shape = tuple_setitem( + indices_broadcast_shape, i, new_val + ) + arr_broadcast_shape = tuple_setitem( + indices_broadcast_shape, axis, arr.shape[axis] + ) + arr = np.broadcast_to(arr, arr_broadcast_shape) + indices = np.broadcast_to(indices, indices_broadcast_shape) + + Ni = Ni_orig + if len(Ni_orig) > 0: + for i in range(len(Ni)): + Ni = tuple_setitem(Ni, i, arr.shape[i]) + Nk = Nk_orig + if len(Nk_orig) > 0: + for i in range(len(Nk)): + Nk = tuple_setitem(Nk, i, arr.shape[axis + 1 + i]) + + J = indices.shape[axis] # Need not equal M + out = np.empty(Ni + (J,) + Nk, arr.dtype) + + np_s_ = (slice(None, None, None),) + + for ii in np.ndindex(Ni): + for kk in np.ndindex(Nk): + a_1d = arr[ii + np_s_ + kk] + indices_1d = indices[ii + np_s_ + kk] + out_1d = out[ii + np_s_ + kk] + for j in range(J): + out_1d[j] = a_1d[indices_1d[j]] + return out + + +@overload(np.take_along_axis) +def arr_take_along_axis(arr, indices, axis): + if not isinstance(arr, types.Array): + raise errors.TypingError('The first argument "arr" must be an array') + if not isinstance(indices, types.Array): + raise errors.TypingError( + 'The second argument "indices" must be an array') + if not isinstance(indices.dtype, types.Integer): + raise errors.TypingError('The indices array must contain integers') + if is_nonelike(axis): + arr_ndim = 1 + else: + arr_ndim = arr.ndim + if arr_ndim != indices.ndim: + # Matches NumPy error: + raise errors.TypingError( + "`indices` and `arr` must have the same number of dimensions" + ) + + indices_broadcast_shape = tuple(range(indices.ndim)) + if is_nonelike(axis): + def take_along_axis_impl(arr, indices, axis): + return _take_along_axis_impl(arr.flatten(), indices, 0, (), (), + indices_broadcast_shape) + else: + check_is_integer(axis, "axis") + if not isinstance(axis, types.IntegerLiteral): + raise errors.NumbaValueError("axis must be a literal value") + axis = axis.literal_value + if axis < 0: + axis = arr.ndim + axis + + if axis < 0 or axis >= arr.ndim: + raise errors.NumbaValueError("axis is out of bounds") + + Ni = tuple(range(axis)) + Nk = tuple(range(axis + 1, arr.ndim)) + + def take_along_axis_impl(arr, indices, axis): + return _take_along_axis_impl(arr, indices, axis, Ni, Nk, + indices_broadcast_shape) + return take_along_axis_impl + + +@overload(np.nan_to_num) +def nan_to_num_impl(x, copy=True, nan=0.0): + if isinstance(x, types.Number): + if isinstance(x, types.Integer): + # Integers do not have nans or infs + def impl(x, copy=True, nan=0.0): + return x + + elif isinstance(x, types.Float): + def impl(x, copy=True, nan=0.0): + if np.isnan(x): + return nan + elif np.isneginf(x): + return np.finfo(type(x)).min + elif np.isposinf(x): + return np.finfo(type(x)).max + return x + elif isinstance(x, types.Complex): + def impl(x, copy=True, nan=0.0): + r = np.nan_to_num(x.real, nan=nan) + c = np.nan_to_num(x.imag, nan=nan) + return complex(r, c) + else: + raise errors.TypingError( + "Only Integer, Float, and Complex values are accepted" + ) + + elif type_can_asarray(x): + if isinstance(x.dtype, types.Integer): + # Integers do not have nans or infs + def impl(x, copy=True, nan=0.0): + return x + elif isinstance(x.dtype, types.Float): + def impl(x, copy=True, nan=0.0): + min_inf = np.finfo(x.dtype).min + max_inf = np.finfo(x.dtype).max + + x_ = np.asarray(x) + output = np.copy(x_) if copy else x_ + + output_flat = output.flat + for i in range(output.size): + if np.isnan(output_flat[i]): + output_flat[i] = nan + elif np.isneginf(output_flat[i]): + output_flat[i] = min_inf + elif np.isposinf(output_flat[i]): + output_flat[i] = max_inf + return output + elif isinstance(x.dtype, types.Complex): + def impl(x, copy=True, nan=0.0): + x_ = np.asarray(x) + output = np.copy(x_) if copy else x_ + + np.nan_to_num(output.real, copy=False, nan=nan) + np.nan_to_num(output.imag, copy=False, nan=nan) + return output + else: + raise errors.TypingError( + "Only Integer, Float, and Complex values are accepted" + ) + else: + raise errors.TypingError("The first argument must be a scalar or an " + "array-like") + return impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/extensions.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/extensions.py new file mode 100644 index 0000000000000000000000000000000000000000..e0051a1fc18a24df57dfc337838c37d170b22521 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/extensions.py @@ -0,0 +1,10 @@ +""" +NumPy extensions. +""" + +from numba.np.arraymath import cross2d + + +__all__ = [ + 'cross2d' +] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/linalg.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/linalg.py new file mode 100644 index 0000000000000000000000000000000000000000..b25b2c6110c9a756eb9438b8daa49f51f9f0497d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/linalg.py @@ -0,0 +1,2853 @@ +""" +Implementation of linear algebra operations. +""" + + +import contextlib +import warnings + +from llvmlite import ir + +import numpy as np +import operator + +from numba.core.imputils import (lower_builtin, impl_ret_borrowed, + impl_ret_new_ref, impl_ret_untracked) +from numba.core.typing import signature +from numba.core.extending import intrinsic, overload, register_jitable +from numba.core import types, cgutils, config +from numba.core.errors import TypingError, NumbaTypeError, \ + NumbaPerformanceWarning +from .arrayobj import make_array, _empty_nd_impl, array_copy +from numba.np import numpy_support as np_support + +ll_char = ir.IntType(8) +ll_char_p = ll_char.as_pointer() +ll_void_p = ll_char_p +ll_intc = ir.IntType(32) +ll_intc_p = ll_intc.as_pointer() +intp_t = cgutils.intp_t +ll_intp_p = intp_t.as_pointer() + + +# fortran int type, this needs to match the F_INT C declaration in +# _lapack.c and is present to accommodate potential future 64bit int +# based LAPACK use. +F_INT_nptype = np.int32 +if config.USE_LEGACY_TYPE_SYSTEM: + F_INT_nbtype = types.int32 + + # BLAS kinds as letters + _blas_kinds = { + types.float32: 's', + types.float64: 'd', + types.complex64: 'c', + types.complex128: 'z', + } +else: + F_INT_nbtype = types.np_int32 + + # BLAS kinds as letters + _blas_kinds = { + types.np_float32: 's', + types.np_float64: 'd', + types.np_complex64: 'c', + types.np_complex128: 'z', + } + + +def get_blas_kind(dtype, func_name=""): + kind = _blas_kinds.get(dtype) + if kind is None: + raise NumbaTypeError("unsupported dtype for %s()" % (func_name,)) + return kind + + +def ensure_blas(): + try: + import scipy.linalg.cython_blas + except ImportError: + raise ImportError("scipy 0.16+ is required for linear algebra") + + +def ensure_lapack(): + try: + import scipy.linalg.cython_lapack + except ImportError: + raise ImportError("scipy 0.16+ is required for linear algebra") + + +def make_constant_slot(context, builder, ty, val): + const = context.get_constant_generic(builder, ty, val) + return cgutils.alloca_once_value(builder, const) + + +class _BLAS: + """ + Functions to return type signatures for wrapped + BLAS functions. + """ + + def __init__(self): + ensure_blas() + + @classmethod + def numba_xxnrm2(cls, dtype): + rtype = getattr(dtype, "underlying_float", dtype) + sig = types.intc(types.char, # kind + types.intp, # n + types.CPointer(dtype), # x + types.intp, # incx + types.CPointer(rtype)) # returned + + return types.ExternalFunction("numba_xxnrm2", sig) + + @classmethod + def numba_xxgemm(cls, dtype): + sig = types.intc( + types.char, # kind + types.char, # transa + types.char, # transb + types.intp, # m + types.intp, # n + types.intp, # k + types.CPointer(dtype), # alpha + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(dtype), # b + types.intp, # ldb + types.CPointer(dtype), # beta + types.CPointer(dtype), # c + types.intp # ldc + ) + return types.ExternalFunction("numba_xxgemm", sig) + + +class _LAPACK: + """ + Functions to return type signatures for wrapped + LAPACK functions. + """ + + def __init__(self): + ensure_lapack() + + @classmethod + def numba_xxgetrf(cls, dtype): + sig = types.intc(types.char, # kind + types.intp, # m + types.intp, # n + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(F_INT_nbtype) # ipiv + ) + return types.ExternalFunction("numba_xxgetrf", sig) + + @classmethod + def numba_ez_xxgetri(cls, dtype): + sig = types.intc(types.char, # kind + types.intp, # n + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(F_INT_nbtype) # ipiv + ) + return types.ExternalFunction("numba_ez_xxgetri", sig) + + @classmethod + def numba_ez_rgeev(cls, dtype): + sig = types.intc(types.char, # kind + types.char, # jobvl + types.char, # jobvr + types.intp, # n + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(dtype), # wr + types.CPointer(dtype), # wi + types.CPointer(dtype), # vl + types.intp, # ldvl + types.CPointer(dtype), # vr + types.intp # ldvr + ) + return types.ExternalFunction("numba_ez_rgeev", sig) + + @classmethod + def numba_ez_cgeev(cls, dtype): + sig = types.intc(types.char, # kind + types.char, # jobvl + types.char, # jobvr + types.intp, # n + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(dtype), # w + types.CPointer(dtype), # vl + types.intp, # ldvl + types.CPointer(dtype), # vr + types.intp # ldvr + ) + return types.ExternalFunction("numba_ez_cgeev", sig) + + @classmethod + def numba_ez_xxxevd(cls, dtype): + wtype = getattr(dtype, "underlying_float", dtype) + sig = types.intc(types.char, # kind + types.char, # jobz + types.char, # uplo + types.intp, # n + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(wtype), # w + ) + return types.ExternalFunction("numba_ez_xxxevd", sig) + + @classmethod + def numba_xxpotrf(cls, dtype): + sig = types.intc(types.char, # kind + types.char, # uplo + types.intp, # n + types.CPointer(dtype), # a + types.intp # lda + ) + return types.ExternalFunction("numba_xxpotrf", sig) + + @classmethod + def numba_ez_gesdd(cls, dtype): + stype = getattr(dtype, "underlying_float", dtype) + sig = types.intc( + types.char, # kind + types.char, # jobz + types.intp, # m + types.intp, # n + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(stype), # s + types.CPointer(dtype), # u + types.intp, # ldu + types.CPointer(dtype), # vt + types.intp # ldvt + ) + + return types.ExternalFunction("numba_ez_gesdd", sig) + + @classmethod + def numba_ez_geqrf(cls, dtype): + sig = types.intc( + types.char, # kind + types.intp, # m + types.intp, # n + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(dtype), # tau + ) + return types.ExternalFunction("numba_ez_geqrf", sig) + + @classmethod + def numba_ez_xxgqr(cls, dtype): + sig = types.intc( + types.char, # kind + types.intp, # m + types.intp, # n + types.intp, # k + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(dtype), # tau + ) + return types.ExternalFunction("numba_ez_xxgqr", sig) + + @classmethod + def numba_ez_gelsd(cls, dtype): + rtype = getattr(dtype, "underlying_float", dtype) + sig = types.intc( + types.char, # kind + types.intp, # m + types.intp, # n + types.intp, # nrhs + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(dtype), # b + types.intp, # ldb + types.CPointer(rtype), # S + types.float64, # rcond + types.CPointer(types.intc) # rank + ) + return types.ExternalFunction("numba_ez_gelsd", sig) + + @classmethod + def numba_xgesv(cls, dtype): + sig = types.intc( + types.char, # kind + types.intp, # n + types.intp, # nhrs + types.CPointer(dtype), # a + types.intp, # lda + types.CPointer(F_INT_nbtype), # ipiv + types.CPointer(dtype), # b + types.intp # ldb + ) + return types.ExternalFunction("numba_xgesv", sig) + + +@contextlib.contextmanager +def make_contiguous(context, builder, sig, args): + """ + Ensure that all array arguments are contiguous, if necessary by + copying them. + A new (sig, args) tuple is yielded. + """ + newtys = [] + newargs = [] + copies = [] + for ty, val in zip(sig.args, args): + if not isinstance(ty, types.Array) or ty.layout in 'CF': + newty, newval = ty, val + else: + newty = ty.copy(layout='C') + copysig = signature(newty, ty) + newval = array_copy(context, builder, copysig, (val,)) + copies.append((newty, newval)) + newtys.append(newty) + newargs.append(newval) + yield signature(sig.return_type, *newtys), tuple(newargs) + for ty, val in copies: + context.nrt.decref(builder, ty, val) + + +def check_c_int(context, builder, n): + """ + Check whether *n* fits in a C `int`. + """ + _maxint = 2**31 - 1 + + def impl(n): + if n > _maxint: + raise OverflowError("array size too large to fit in C int") + + context.compile_internal(builder, impl, + signature(types.none, types.intp), (n,)) + + +def check_blas_return(context, builder, res): + """ + Check the integer error return from one of the BLAS wrappers in + _helperlib.c. + """ + with builder.if_then(cgutils.is_not_null(builder, res), likely=False): + # Those errors shouldn't happen, it's easier to just abort the process + pyapi = context.get_python_api(builder) + pyapi.gil_ensure() + pyapi.fatal_error("BLAS wrapper returned with an error") + + +def check_lapack_return(context, builder, res): + """ + Check the integer error return from one of the LAPACK wrappers in + _helperlib.c. + """ + with builder.if_then(cgutils.is_not_null(builder, res), likely=False): + # Those errors shouldn't happen, it's easier to just abort the process + pyapi = context.get_python_api(builder) + pyapi.gil_ensure() + pyapi.fatal_error("LAPACK wrapper returned with an error") + + +def call_xxdot(context, builder, conjugate, dtype, + n, a_data, b_data, out_data): + """ + Call the BLAS vector * vector product function for the given arguments. + """ + fnty = ir.FunctionType(ir.IntType(32), + [ll_char, ll_char, intp_t, # kind, conjugate, n + ll_void_p, ll_void_p, ll_void_p, # a, b, out + ]) + fn = cgutils.get_or_insert_function(builder.module, fnty, "numba_xxdot") + + kind = get_blas_kind(dtype) + kind_val = ir.Constant(ll_char, ord(kind)) + conjugate = ir.Constant(ll_char, int(conjugate)) + + res = builder.call(fn, (kind_val, conjugate, n, + builder.bitcast(a_data, ll_void_p), + builder.bitcast(b_data, ll_void_p), + builder.bitcast(out_data, ll_void_p))) + check_blas_return(context, builder, res) + + +def call_xxgemv(context, builder, do_trans, + m_type, m_shapes, m_data, v_data, out_data): + """ + Call the BLAS matrix * vector product function for the given arguments. + """ + fnty = ir.FunctionType(ir.IntType(32), + [ll_char, ll_char, # kind, trans + intp_t, intp_t, # m, n + ll_void_p, ll_void_p, intp_t, # alpha, a, lda + ll_void_p, ll_void_p, ll_void_p, # x, beta, y + ]) + fn = cgutils.get_or_insert_function(builder.module, fnty, "numba_xxgemv") + + dtype = m_type.dtype + alpha = make_constant_slot(context, builder, dtype, 1.0) + beta = make_constant_slot(context, builder, dtype, 0.0) + + if m_type.layout == 'F': + m, n = m_shapes + lda = m_shapes[0] + else: + n, m = m_shapes + lda = m_shapes[1] + + kind = get_blas_kind(dtype) + kind_val = ir.Constant(ll_char, ord(kind)) + trans = ir.Constant(ll_char, ord('t') if do_trans else ord('n')) + + res = builder.call(fn, (kind_val, trans, m, n, + builder.bitcast(alpha, ll_void_p), + builder.bitcast(m_data, ll_void_p), lda, + builder.bitcast(v_data, ll_void_p), + builder.bitcast(beta, ll_void_p), + builder.bitcast(out_data, ll_void_p))) + check_blas_return(context, builder, res) + + +def call_xxgemm(context, builder, + x_type, x_shapes, x_data, + y_type, y_shapes, y_data, + out_type, out_shapes, out_data): + """ + Call the BLAS matrix * matrix product function for the given arguments. + """ + fnty = ir.FunctionType(ir.IntType(32), + [ll_char, # kind + ll_char, ll_char, # transa, transb + intp_t, intp_t, intp_t, # m, n, k + ll_void_p, ll_void_p, intp_t, # alpha, a, lda + ll_void_p, intp_t, ll_void_p, # b, ldb, beta + ll_void_p, intp_t, # c, ldc + ]) + fn = cgutils.get_or_insert_function(builder.module, fnty, "numba_xxgemm") + + m, k = x_shapes + _k, n = y_shapes + dtype = x_type.dtype + alpha = make_constant_slot(context, builder, dtype, 1.0) + beta = make_constant_slot(context, builder, dtype, 0.0) + + trans = ir.Constant(ll_char, ord('t')) + notrans = ir.Constant(ll_char, ord('n')) + + def get_array_param(ty, shapes, data): + return ( + # Transpose if layout different from result's + notrans if ty.layout == out_type.layout else trans, + # Size of the inner dimension in physical array order + shapes[1] if ty.layout == 'C' else shapes[0], + # The data pointer, unit-less + builder.bitcast(data, ll_void_p), + ) + + transa, lda, data_a = get_array_param(y_type, y_shapes, y_data) + transb, ldb, data_b = get_array_param(x_type, x_shapes, x_data) + _, ldc, data_c = get_array_param(out_type, out_shapes, out_data) + + kind = get_blas_kind(dtype) + kind_val = ir.Constant(ll_char, ord(kind)) + + res = builder.call(fn, (kind_val, transa, transb, n, m, k, + builder.bitcast(alpha, ll_void_p), data_a, lda, + data_b, ldb, builder.bitcast(beta, ll_void_p), + data_c, ldc)) + check_blas_return(context, builder, res) + + +def dot_2_mm(context, builder, sig, args): + """ + np.dot(matrix, matrix) + """ + def dot_impl(a, b): + m, k = a.shape + _k, n = b.shape + if k == 0: + return np.zeros((m, n), a.dtype) + out = np.empty((m, n), a.dtype) + return np.dot(a, b, out) + + res = context.compile_internal(builder, dot_impl, sig, args) + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +def dot_2_vm(context, builder, sig, args): + """ + np.dot(vector, matrix) + """ + def dot_impl(a, b): + m, = a.shape + _m, n = b.shape + if m == 0: + return np.zeros((n, ), a.dtype) + out = np.empty((n, ), a.dtype) + return np.dot(a, b, out) + + res = context.compile_internal(builder, dot_impl, sig, args) + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +def dot_2_mv(context, builder, sig, args): + """ + np.dot(matrix, vector) + """ + def dot_impl(a, b): + m, n = a.shape + _n, = b.shape + if n == 0: + return np.zeros((m, ), a.dtype) + out = np.empty((m, ), a.dtype) + return np.dot(a, b, out) + + res = context.compile_internal(builder, dot_impl, sig, args) + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +def dot_2_vv(context, builder, sig, args, conjugate=False): + """ + np.dot(vector, vector) + np.vdot(vector, vector) + """ + aty, bty = sig.args + dtype = sig.return_type + a = make_array(aty)(context, builder, args[0]) + b = make_array(bty)(context, builder, args[1]) + n, = cgutils.unpack_tuple(builder, a.shape) + + def check_args(a, b): + m, = a.shape + n, = b.shape + if m != n: + raise ValueError("incompatible array sizes for np.dot(a, b) " + "(vector * vector)") + + context.compile_internal(builder, check_args, + signature(types.none, *sig.args), args) + check_c_int(context, builder, n) + + out = cgutils.alloca_once(builder, context.get_value_type(dtype)) + call_xxdot(context, builder, conjugate, dtype, n, a.data, b.data, out) + return builder.load(out) + + +@overload(np.dot) +def dot_2(left, right): + """ + np.dot(a, b) + """ + return dot_2_impl('np.dot()', left, right) + + +@overload(operator.matmul) +def matmul_2(left, right): + """ + a @ b + """ + return dot_2_impl("'@'", left, right) + + +def dot_2_impl(name, left, right): + if isinstance(left, types.Array) and isinstance(right, types.Array): + @intrinsic + def _impl(typingcontext, left, right): + ndims = (left.ndim, right.ndim) + + def _dot2_codegen(context, builder, sig, args): + ensure_blas() + + with make_contiguous(context, builder, sig, args) as (sig, args): + if ndims == (2, 2): + return dot_2_mm(context, builder, sig, args) + elif ndims == (2, 1): + return dot_2_mv(context, builder, sig, args) + elif ndims == (1, 2): + return dot_2_vm(context, builder, sig, args) + elif ndims == (1, 1): + return dot_2_vv(context, builder, sig, args) + else: + raise AssertionError('unreachable') + + if left.dtype != right.dtype: + raise TypingError( + "%s arguments must all have the same dtype" % name) + + if ndims == (2, 2): + return_type = types.Array(left.dtype, 2, 'C') + elif ndims == (2, 1) or ndims == (1, 2): + return_type = types.Array(left.dtype, 1, 'C') + elif ndims == (1, 1): + return_type = left.dtype + else: + raise TypingError(("%s: inputs must have compatible " + "dimensions") % name) + return signature(return_type, left, right), _dot2_codegen + + if left.layout not in 'CF' or right.layout not in 'CF': + warnings.warn( + "%s is faster on contiguous arrays, called on %s" % ( + name, (left, right),), NumbaPerformanceWarning) + + return lambda left, right: _impl(left, right) + + +@overload(np.vdot) +def vdot(left, right): + """ + np.vdot(a, b) + """ + if isinstance(left, types.Array) and isinstance(right, types.Array): + @intrinsic + def _impl(typingcontext, left, right): + def codegen(context, builder, sig, args): + ensure_blas() + + with make_contiguous(context, builder, sig, args) as\ + (sig, args): + return dot_2_vv(context, builder, sig, args, conjugate=True) + + if left.ndim != 1 or right.ndim != 1: + raise TypingError("np.vdot() only supported on 1-D arrays") + + if left.dtype != right.dtype: + raise TypingError( + "np.vdot() arguments must all have the same dtype") + return signature(left.dtype, left, right), codegen + + if left.layout not in 'CF' or right.layout not in 'CF': + warnings.warn( + "np.vdot() is faster on contiguous arrays, called on %s" + % ((left, right),), NumbaPerformanceWarning) + + return lambda left, right: _impl(left, right) + + +def dot_3_vm_check_args(a, b, out): + m, = a.shape + _m, n = b.shape + if m != _m: + raise ValueError("incompatible array sizes for " + "np.dot(a, b) (vector * matrix)") + if out.shape != (n,): + raise ValueError("incompatible output array size for " + "np.dot(a, b, out) (vector * matrix)") + + +def dot_3_mv_check_args(a, b, out): + m, _n = a.shape + n, = b.shape + if n != _n: + raise ValueError("incompatible array sizes for np.dot(a, b) " + "(matrix * vector)") + if out.shape != (m,): + raise ValueError("incompatible output array size for " + "np.dot(a, b, out) (matrix * vector)") + + +def dot_3_vm(context, builder, sig, args): + """ + np.dot(vector, matrix, out) + np.dot(matrix, vector, out) + """ + xty, yty, outty = sig.args + assert outty == sig.return_type + dtype = xty.dtype + + x = make_array(xty)(context, builder, args[0]) + y = make_array(yty)(context, builder, args[1]) + out = make_array(outty)(context, builder, args[2]) + x_shapes = cgutils.unpack_tuple(builder, x.shape) + y_shapes = cgutils.unpack_tuple(builder, y.shape) + out_shapes = cgutils.unpack_tuple(builder, out.shape) + if xty.ndim < yty.ndim: + # Vector * matrix + # Asked for x * y, we will compute y.T * x + mty = yty + m_shapes = y_shapes + v_shape = x_shapes[0] + lda = m_shapes[1] + do_trans = yty.layout == 'F' + m_data, v_data = y.data, x.data + check_args = dot_3_vm_check_args + else: + # Matrix * vector + # We will compute x * y + mty = xty + m_shapes = x_shapes + v_shape = y_shapes[0] + lda = m_shapes[0] + do_trans = xty.layout == 'C' + m_data, v_data = x.data, y.data + check_args = dot_3_mv_check_args + + context.compile_internal(builder, check_args, + signature(types.none, *sig.args), args) + for val in m_shapes: + check_c_int(context, builder, val) + + zero = context.get_constant(types.intp, 0) + both_empty = builder.icmp_signed('==', v_shape, zero) + matrix_empty = builder.icmp_signed('==', lda, zero) + is_empty = builder.or_(both_empty, matrix_empty) + with builder.if_else(is_empty, likely=False) as (empty, nonempty): + with empty: + cgutils.memset(builder, out.data, + builder.mul(out.itemsize, out.nitems), 0) + with nonempty: + call_xxgemv(context, builder, do_trans, mty, m_shapes, m_data, + v_data, out.data) + + return impl_ret_borrowed(context, builder, sig.return_type, + out._getvalue()) + + +def dot_3_mm(context, builder, sig, args): + """ + np.dot(matrix, matrix, out) + """ + xty, yty, outty = sig.args + assert outty == sig.return_type + dtype = xty.dtype + + x = make_array(xty)(context, builder, args[0]) + y = make_array(yty)(context, builder, args[1]) + out = make_array(outty)(context, builder, args[2]) + x_shapes = cgutils.unpack_tuple(builder, x.shape) + y_shapes = cgutils.unpack_tuple(builder, y.shape) + out_shapes = cgutils.unpack_tuple(builder, out.shape) + m, k = x_shapes + _k, n = y_shapes + + # The only case Numpy supports + assert outty.layout == 'C' + + def check_args(a, b, out): + m, k = a.shape + _k, n = b.shape + if k != _k: + raise ValueError("incompatible array sizes for np.dot(a, b) " + "(matrix * matrix)") + if out.shape != (m, n): + raise ValueError("incompatible output array size for " + "np.dot(a, b, out) (matrix * matrix)") + + context.compile_internal(builder, check_args, + signature(types.none, *sig.args), args) + + check_c_int(context, builder, m) + check_c_int(context, builder, k) + check_c_int(context, builder, n) + + x_data = x.data + y_data = y.data + out_data = out.data + + # If eliminated dimension is zero, set all entries to zero and return + zero = context.get_constant(types.intp, 0) + both_empty = builder.icmp_signed('==', k, zero) + x_empty = builder.icmp_signed('==', m, zero) + y_empty = builder.icmp_signed('==', n, zero) + is_empty = builder.or_(both_empty, builder.or_(x_empty, y_empty)) + with builder.if_else(is_empty, likely=False) as (empty, nonempty): + with empty: + cgutils.memset(builder, out.data, + builder.mul(out.itemsize, out.nitems), 0) + with nonempty: + # Check if any of the operands is really a 1-d vector represented + # as a (1, k) or (k, 1) 2-d array. In those cases, it is pessimal + # to call the generic matrix * matrix product BLAS function. + one = context.get_constant(types.intp, 1) + is_left_vec = builder.icmp_signed('==', m, one) + is_right_vec = builder.icmp_signed('==', n, one) + + with builder.if_else(is_right_vec) as (r_vec, r_mat): + with r_vec: + with builder.if_else(is_left_vec) as (v_v, m_v): + with v_v: + # V * V + call_xxdot(context, builder, False, dtype, + k, x_data, y_data, out_data) + with m_v: + # M * V + do_trans = xty.layout == outty.layout + call_xxgemv(context, builder, do_trans, + xty, x_shapes, x_data, y_data, out_data) + with r_mat: + with builder.if_else(is_left_vec) as (v_m, m_m): + with v_m: + # V * M + do_trans = yty.layout != outty.layout + call_xxgemv(context, builder, do_trans, + yty, y_shapes, y_data, x_data, out_data) + with m_m: + # M * M + call_xxgemm(context, builder, + xty, x_shapes, x_data, + yty, y_shapes, y_data, + outty, out_shapes, out_data) + + return impl_ret_borrowed(context, builder, sig.return_type, + out._getvalue()) + + +@overload(np.dot) +def dot_3(left, right, out): + """ + np.dot(a, b, out) + """ + if (isinstance(left, types.Array) and isinstance(right, types.Array) and + isinstance(out, types.Array)): + @intrinsic + def _impl(typingcontext, left, right, out): + def codegen(context, builder, sig, args): + ensure_blas() + + with make_contiguous(context, builder, sig, args) as (sig, + args): + ndims = set(x.ndim for x in sig.args[:2]) + if ndims == {2}: + return dot_3_mm(context, builder, sig, args) + elif ndims == {1, 2}: + return dot_3_vm(context, builder, sig, args) + else: + raise AssertionError('unreachable') + if left.dtype != right.dtype or left.dtype != out.dtype: + raise TypingError( + "np.dot() arguments must all have the same dtype") + + return signature(out, left, right, out), codegen + + if left.layout not in 'CF' or right.layout not in 'CF' or out.layout\ + not in 'CF': + warnings.warn( + "np.vdot() is faster on contiguous arrays, called on %s" + % ((left, right),), NumbaPerformanceWarning) + + return lambda left, right, out: _impl(left, right, out) + + +if config.USE_LEGACY_TYPE_SYSTEM: + fatal_error_func = types.ExternalFunction("numba_fatal_error", types.intc()) +else: + fatal_error_func = types.ExternalFunction("numba_fatal_error", types.c_intp()) + + +@register_jitable +def _check_finite_matrix(a): + for v in np.nditer(a): + if not np.isfinite(v.item()): + raise np.linalg.LinAlgError( + "Array must not contain infs or NaNs.") + + +def _check_linalg_matrix(a, func_name, la_prefix=True): + # la_prefix is present as some functions, e.g. np.trace() + # are documented under "linear algebra" but aren't in the + # module + prefix = "np.linalg" if la_prefix else "np" + interp = (prefix, func_name) + # Unpack optional type + if isinstance(a, types.Optional): + a = a.type + if not isinstance(a, types.Array): + msg = "%s.%s() only supported for array types" % interp + raise TypingError(msg, highlighting=False) + if not a.ndim == 2: + msg = "%s.%s() only supported on 2-D arrays." % interp + raise TypingError(msg, highlighting=False) + if not isinstance(a.dtype, (types.Float, types.Complex)): + msg = "%s.%s() only supported on "\ + "float and complex arrays." % interp + raise TypingError(msg, highlighting=False) + + +def _check_homogeneous_types(func_name, *types): + t0 = types[0].dtype + for t in types[1:]: + if t.dtype != t0: + msg = "np.linalg.%s() only supports inputs that have homogeneous dtypes." % func_name + raise TypingError(msg, highlighting=False) + + +def _copy_to_fortran_order(): + pass + + +@overload(_copy_to_fortran_order) +def ol_copy_to_fortran_order(a): + # This function copies the array 'a' into a new array with fortran order. + # This exists because the copy routines don't take order flags yet. + F_layout = a.layout == 'F' + A_layout = a.layout == 'A' + def impl(a): + if F_layout: + # it's F ordered at compile time, just copy + acpy = np.copy(a) + elif A_layout: + # decide based on runtime value + flag_f = a.flags.f_contiguous + if flag_f: + # it's already F ordered, so copy but in a round about way to + # ensure that the copy is also F ordered + acpy = np.copy(a.T).T + else: + # it's something else ordered, so let asfortranarray deal with + # copying and making it fortran ordered + acpy = np.asfortranarray(a) + else: + # it's C ordered at compile time, asfortranarray it. + acpy = np.asfortranarray(a) + return acpy + return impl + + +@register_jitable +def _inv_err_handler(r): + if r != 0: + if r < 0: + fatal_error_func() + assert 0 # unreachable + if r > 0: + raise np.linalg.LinAlgError( + "Matrix is singular to machine precision.") + +@register_jitable +def _dummy_liveness_func(a): + """pass a list of variables to be preserved through dead code elimination""" + return a[0] + + +@overload(np.linalg.inv) +def inv_impl(a): + ensure_lapack() + + _check_linalg_matrix(a, "inv") + + numba_xxgetrf = _LAPACK().numba_xxgetrf(a.dtype) + + numba_xxgetri = _LAPACK().numba_ez_xxgetri(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "inv")) + + def inv_impl(a): + n = a.shape[-1] + if a.shape[-2] != n: + msg = "Last 2 dimensions of the array must be square." + raise np.linalg.LinAlgError(msg) + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + if n == 0: + return acpy + + ipiv = np.empty(n, dtype=F_INT_nptype) + + r = numba_xxgetrf(kind, n, n, acpy.ctypes, n, ipiv.ctypes) + _inv_err_handler(r) + + r = numba_xxgetri(kind, n, acpy.ctypes, n, ipiv.ctypes) + _inv_err_handler(r) + + # help liveness analysis + _dummy_liveness_func([acpy.size, ipiv.size]) + return acpy + + return inv_impl + + +@register_jitable +def _handle_err_maybe_convergence_problem(r): + if r != 0: + if r < 0: + fatal_error_func() + assert 0 # unreachable + if r > 0: + raise ValueError("Internal algorithm failed to converge.") + + +def _check_linalg_1_or_2d_matrix(a, func_name, la_prefix=True): + # la_prefix is present as some functions, e.g. np.trace() + # are documented under "linear algebra" but aren't in the + # module + prefix = "np.linalg" if la_prefix else "np" + interp = (prefix, func_name) + # checks that a matrix is 1 or 2D + if not isinstance(a, types.Array): + raise TypingError("%s.%s() only supported for array types " + % interp) + if not a.ndim <= 2: + raise TypingError("%s.%s() only supported on 1 and 2-D arrays " + % interp) + if not isinstance(a.dtype, (types.Float, types.Complex)): + raise TypingError("%s.%s() only supported on " + "float and complex arrays." % interp) + + +@overload(np.linalg.cholesky) +def cho_impl(a): + ensure_lapack() + + _check_linalg_matrix(a, "cholesky") + + numba_xxpotrf = _LAPACK().numba_xxpotrf(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "cholesky")) + UP = ord('U') + LO = ord('L') + + def cho_impl(a): + n = a.shape[-1] + if a.shape[-2] != n: + msg = "Last 2 dimensions of the array must be square." + raise np.linalg.LinAlgError(msg) + + # The output is allocated in C order + out = a.copy() + + if n == 0: + return out + + # Pass UP since xxpotrf() operates in F order + # The semantics ensure this works fine + # (out is really its Hermitian in F order, but UP instructs + # xxpotrf to compute the Hermitian of the upper triangle + # => they cancel each other) + r = numba_xxpotrf(kind, UP, n, out.ctypes, n) + if r != 0: + if r < 0: + fatal_error_func() + assert 0 # unreachable + if r > 0: + raise np.linalg.LinAlgError( + "Matrix is not positive definite.") + # Zero out upper triangle, in F order + for col in range(n): + out[:col, col] = 0 + return out + + return cho_impl + +@overload(np.linalg.eig) +def eig_impl(a): + ensure_lapack() + + _check_linalg_matrix(a, "eig") + + numba_ez_rgeev = _LAPACK().numba_ez_rgeev(a.dtype) + numba_ez_cgeev = _LAPACK().numba_ez_cgeev(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "eig")) + + JOBVL = ord('N') + JOBVR = ord('V') + + def real_eig_impl(a): + """ + eig() implementation for real arrays. + """ + n = a.shape[-1] + if a.shape[-2] != n: + msg = "Last 2 dimensions of the array must be square." + raise np.linalg.LinAlgError(msg) + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + ldvl = 1 + ldvr = n + wr = np.empty(n, dtype=a.dtype) + wi = np.empty(n, dtype=a.dtype) + vl = np.empty((n, ldvl), dtype=a.dtype) + vr = np.empty((n, ldvr), dtype=a.dtype) + + if n == 0: + return (wr, vr.T) + + r = numba_ez_rgeev(kind, + JOBVL, + JOBVR, + n, + acpy.ctypes, + n, + wr.ctypes, + wi.ctypes, + vl.ctypes, + ldvl, + vr.ctypes, + ldvr) + _handle_err_maybe_convergence_problem(r) + + # By design numba does not support dynamic return types, however, + # Numpy does. Numpy uses this ability in the case of returning + # eigenvalues/vectors of a real matrix. The return type of + # np.linalg.eig(), when operating on a matrix in real space + # depends on the values present in the matrix itself (recalling + # that eigenvalues are the roots of the characteristic polynomial + # of the system matrix, which will by construction depend on the + # values present in the system matrix). As numba cannot handle + # the case of a runtime decision based domain change relative to + # the input type, if it is required numba raises as below. + if np.any(wi): + raise ValueError( + "eig() argument must not cause a domain change.") + + # put these in to help with liveness analysis, + # `.ctypes` doesn't keep the vars alive + _dummy_liveness_func([acpy.size, vl.size, vr.size, wr.size, wi.size]) + return (wr, vr.T) + + def cmplx_eig_impl(a): + """ + eig() implementation for complex arrays. + """ + n = a.shape[-1] + if a.shape[-2] != n: + msg = "Last 2 dimensions of the array must be square." + raise np.linalg.LinAlgError(msg) + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + ldvl = 1 + ldvr = n + w = np.empty(n, dtype=a.dtype) + vl = np.empty((n, ldvl), dtype=a.dtype) + vr = np.empty((n, ldvr), dtype=a.dtype) + + if n == 0: + return (w, vr.T) + + r = numba_ez_cgeev(kind, + JOBVL, + JOBVR, + n, + acpy.ctypes, + n, + w.ctypes, + vl.ctypes, + ldvl, + vr.ctypes, + ldvr) + _handle_err_maybe_convergence_problem(r) + + # put these in to help with liveness analysis, + # `.ctypes` doesn't keep the vars alive + _dummy_liveness_func([acpy.size, vl.size, vr.size, w.size]) + return (w, vr.T) + + if isinstance(a.dtype, types.scalars.Complex): + return cmplx_eig_impl + else: + return real_eig_impl + +@overload(np.linalg.eigvals) +def eigvals_impl(a): + ensure_lapack() + + _check_linalg_matrix(a, "eigvals") + + numba_ez_rgeev = _LAPACK().numba_ez_rgeev(a.dtype) + numba_ez_cgeev = _LAPACK().numba_ez_cgeev(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "eigvals")) + + JOBVL = ord('N') + JOBVR = ord('N') + + def real_eigvals_impl(a): + """ + eigvals() implementation for real arrays. + """ + n = a.shape[-1] + if a.shape[-2] != n: + msg = "Last 2 dimensions of the array must be square." + raise np.linalg.LinAlgError(msg) + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + ldvl = 1 + ldvr = 1 + wr = np.empty(n, dtype=a.dtype) + + if n == 0: + return wr + + wi = np.empty(n, dtype=a.dtype) + + # not referenced but need setting for MKL null check + vl = np.empty((1), dtype=a.dtype) + vr = np.empty((1), dtype=a.dtype) + + r = numba_ez_rgeev(kind, + JOBVL, + JOBVR, + n, + acpy.ctypes, + n, + wr.ctypes, + wi.ctypes, + vl.ctypes, + ldvl, + vr.ctypes, + ldvr) + _handle_err_maybe_convergence_problem(r) + + # By design numba does not support dynamic return types, however, + # Numpy does. Numpy uses this ability in the case of returning + # eigenvalues/vectors of a real matrix. The return type of + # np.linalg.eigvals(), when operating on a matrix in real space + # depends on the values present in the matrix itself (recalling + # that eigenvalues are the roots of the characteristic polynomial + # of the system matrix, which will by construction depend on the + # values present in the system matrix). As numba cannot handle + # the case of a runtime decision based domain change relative to + # the input type, if it is required numba raises as below. + if np.any(wi): + raise ValueError( + "eigvals() argument must not cause a domain change.") + + # put these in to help with liveness analysis, + # `.ctypes` doesn't keep the vars alive + _dummy_liveness_func([acpy.size, vl.size, vr.size, wr.size, wi.size]) + return wr + + def cmplx_eigvals_impl(a): + """ + eigvals() implementation for complex arrays. + """ + n = a.shape[-1] + if a.shape[-2] != n: + msg = "Last 2 dimensions of the array must be square." + raise np.linalg.LinAlgError(msg) + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + ldvl = 1 + ldvr = 1 + w = np.empty(n, dtype=a.dtype) + + if n == 0: + return w + + vl = np.empty((1), dtype=a.dtype) + vr = np.empty((1), dtype=a.dtype) + + r = numba_ez_cgeev(kind, + JOBVL, + JOBVR, + n, + acpy.ctypes, + n, + w.ctypes, + vl.ctypes, + ldvl, + vr.ctypes, + ldvr) + _handle_err_maybe_convergence_problem(r) + + # put these in to help with liveness analysis, + # `.ctypes` doesn't keep the vars alive + _dummy_liveness_func([acpy.size, vl.size, vr.size, w.size]) + return w + + if isinstance(a.dtype, types.scalars.Complex): + return cmplx_eigvals_impl + else: + return real_eigvals_impl + +@overload(np.linalg.eigh) +def eigh_impl(a): + ensure_lapack() + + _check_linalg_matrix(a, "eigh") + + # convert typing floats to numpy floats for use in the impl + w_type = getattr(a.dtype, "underlying_float", a.dtype) + w_dtype = np_support.as_dtype(w_type) + + numba_ez_xxxevd = _LAPACK().numba_ez_xxxevd(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "eigh")) + + JOBZ = ord('V') + UPLO = ord('L') + + def eigh_impl(a): + n = a.shape[-1] + + if a.shape[-2] != n: + msg = "Last 2 dimensions of the array must be square." + raise np.linalg.LinAlgError(msg) + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + w = np.empty(n, dtype=w_dtype) + + if n == 0: + return (w, acpy) + + r = numba_ez_xxxevd(kind, # kind + JOBZ, # jobz + UPLO, # uplo + n, # n + acpy.ctypes, # a + n, # lda + w.ctypes # w + ) + _handle_err_maybe_convergence_problem(r) + + # help liveness analysis + _dummy_liveness_func([acpy.size, w.size]) + return (w, acpy) + + return eigh_impl + +@overload(np.linalg.eigvalsh) +def eigvalsh_impl(a): + ensure_lapack() + + _check_linalg_matrix(a, "eigvalsh") + + # convert typing floats to numpy floats for use in the impl + w_type = getattr(a.dtype, "underlying_float", a.dtype) + w_dtype = np_support.as_dtype(w_type) + + numba_ez_xxxevd = _LAPACK().numba_ez_xxxevd(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "eigvalsh")) + + JOBZ = ord('N') + UPLO = ord('L') + + def eigvalsh_impl(a): + n = a.shape[-1] + + if a.shape[-2] != n: + msg = "Last 2 dimensions of the array must be square." + raise np.linalg.LinAlgError(msg) + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + w = np.empty(n, dtype=w_dtype) + + if n == 0: + return w + + r = numba_ez_xxxevd(kind, # kind + JOBZ, # jobz + UPLO, # uplo + n, # n + acpy.ctypes, # a + n, # lda + w.ctypes # w + ) + _handle_err_maybe_convergence_problem(r) + + # help liveness analysis + _dummy_liveness_func([acpy.size, w.size]) + return w + + return eigvalsh_impl + +@overload(np.linalg.svd) +def svd_impl(a, full_matrices=1): + ensure_lapack() + + _check_linalg_matrix(a, "svd") + + # convert typing floats to numpy floats for use in the impl + s_type = getattr(a.dtype, "underlying_float", a.dtype) + s_dtype = np_support.as_dtype(s_type) + + numba_ez_gesdd = _LAPACK().numba_ez_gesdd(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "svd")) + + JOBZ_A = ord('A') + JOBZ_S = ord('S') + + def svd_impl(a, full_matrices=1): + n = a.shape[-1] + m = a.shape[-2] + + if n == 0 or m == 0: + raise np.linalg.LinAlgError("Arrays cannot be empty") + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + ldu = m + minmn = min(m, n) + + if full_matrices: + JOBZ = JOBZ_A + ucol = m + ldvt = n + else: + JOBZ = JOBZ_S + ucol = minmn + ldvt = minmn + + u = np.empty((ucol, ldu), dtype=a.dtype) + s = np.empty(minmn, dtype=s_dtype) + vt = np.empty((n, ldvt), dtype=a.dtype) + + r = numba_ez_gesdd( + kind, # kind + JOBZ, # jobz + m, # m + n, # n + acpy.ctypes, # a + m, # lda + s.ctypes, # s + u.ctypes, # u + ldu, # ldu + vt.ctypes, # vt + ldvt # ldvt + ) + _handle_err_maybe_convergence_problem(r) + + # help liveness analysis + _dummy_liveness_func([acpy.size, vt.size, u.size, s.size]) + return (u.T, s, vt.T) + + return svd_impl + + +@overload(np.linalg.qr) +def qr_impl(a): + ensure_lapack() + + _check_linalg_matrix(a, "qr") + + # Need two functions, the first computes R, storing it in the upper + # triangle of A with the below diagonal part of A containing elementary + # reflectors needed to construct Q. The second turns the below diagonal + # entries of A into Q, storing Q in A (creates orthonormal columns from + # the elementary reflectors). + + numba_ez_geqrf = _LAPACK().numba_ez_geqrf(a.dtype) + numba_ez_xxgqr = _LAPACK().numba_ez_xxgqr(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "qr")) + + def qr_impl(a): + n = a.shape[-1] + m = a.shape[-2] + + if n == 0 or m == 0: + raise np.linalg.LinAlgError("Arrays cannot be empty") + + _check_finite_matrix(a) + + # copy A as it will be destroyed + q = _copy_to_fortran_order(a) + + lda = m + + minmn = min(m, n) + tau = np.empty((minmn), dtype=a.dtype) + + ret = numba_ez_geqrf( + kind, # kind + m, # m + n, # n + q.ctypes, # a + m, # lda + tau.ctypes # tau + ) + if ret < 0: + fatal_error_func() + assert 0 # unreachable + + # pull out R, this is transposed because of Fortran + r = np.zeros((n, minmn), dtype=a.dtype).T + + # the triangle in R + for i in range(minmn): + for j in range(i + 1): + r[j, i] = q[j, i] + + # and the possible square in R + for i in range(minmn, n): + for j in range(minmn): + r[j, i] = q[j, i] + + ret = numba_ez_xxgqr( + kind, # kind + m, # m + minmn, # n + minmn, # k + q.ctypes, # a + m, # lda + tau.ctypes # tau + ) + _handle_err_maybe_convergence_problem(ret) + + # help liveness analysis + _dummy_liveness_func([tau.size, q.size]) + return (q[:, :minmn], r) + + return qr_impl + + +# helpers and jitted specialisations required for np.linalg.lstsq +# and np.linalg.solve. These functions have "system" in their name +# as a differentiator. + +def _system_copy_in_b(bcpy, b, nrhs): + """ + Correctly copy 'b' into the 'bcpy' scratch space. + """ + raise NotImplementedError + + +@overload(_system_copy_in_b) +def _system_copy_in_b_impl(bcpy, b, nrhs): + if b.ndim == 1: + def oneD_impl(bcpy, b, nrhs): + bcpy[:b.shape[-1], 0] = b + return oneD_impl + else: + def twoD_impl(bcpy, b, nrhs): + bcpy[:b.shape[-2], :nrhs] = b + return twoD_impl + + +def _system_compute_nrhs(b): + """ + Compute the number of right hand sides in the system of equations + """ + raise NotImplementedError + + +@overload(_system_compute_nrhs) +def _system_compute_nrhs_impl(b): + if b.ndim == 1: + def oneD_impl(b): + return 1 + return oneD_impl + else: + def twoD_impl(b): + return b.shape[-1] + return twoD_impl + + +def _system_check_dimensionally_valid(a, b): + """ + Check that AX=B style system input is dimensionally valid. + """ + raise NotImplementedError + + +@overload(_system_check_dimensionally_valid) +def _system_check_dimensionally_valid_impl(a, b): + ndim = b.ndim + if ndim == 1: + def oneD_impl(a, b): + am = a.shape[-2] + bm = b.shape[-1] + if am != bm: + raise np.linalg.LinAlgError( + "Incompatible array sizes, system is not dimensionally valid.") + return oneD_impl + else: + def twoD_impl(a, b): + am = a.shape[-2] + bm = b.shape[-2] + if am != bm: + raise np.linalg.LinAlgError( + "Incompatible array sizes, system is not dimensionally valid.") + return twoD_impl + + +def _system_check_non_empty(a, b): + """ + Check that AX=B style system input is not empty. + """ + raise NotImplementedError + + +@overload(_system_check_non_empty) +def _system_check_non_empty_impl(a, b): + ndim = b.ndim + if ndim == 1: + def oneD_impl(a, b): + am = a.shape[-2] + an = a.shape[-1] + bm = b.shape[-1] + if am == 0 or bm == 0 or an == 0: + raise np.linalg.LinAlgError('Arrays cannot be empty') + return oneD_impl + else: + def twoD_impl(a, b): + am = a.shape[-2] + an = a.shape[-1] + bm = b.shape[-2] + bn = b.shape[-1] + if am == 0 or bm == 0 or an == 0 or bn == 0: + raise np.linalg.LinAlgError('Arrays cannot be empty') + return twoD_impl + + +def _lstsq_residual(b, n, nrhs): + """ + Compute the residual from the 'b' scratch space. + """ + raise NotImplementedError + + +@overload(_lstsq_residual) +def _lstsq_residual_impl(b, n, nrhs): + ndim = b.ndim + dtype = b.dtype + real_dtype = np_support.as_dtype(getattr(dtype, "underlying_float", dtype)) + + if ndim == 1: + if isinstance(dtype, (types.Complex)): + def cmplx_impl(b, n, nrhs): + res = np.empty((1,), dtype=real_dtype) + res[0] = np.sum(np.abs(b[n:, 0])**2) + return res + return cmplx_impl + else: + def real_impl(b, n, nrhs): + res = np.empty((1,), dtype=real_dtype) + res[0] = np.sum(b[n:, 0]**2) + return res + return real_impl + else: + assert ndim == 2 + if isinstance(dtype, (types.Complex)): + def cmplx_impl(b, n, nrhs): + res = np.empty((nrhs), dtype=real_dtype) + for k in range(nrhs): + res[k] = np.sum(np.abs(b[n:, k])**2) + return res + return cmplx_impl + else: + def real_impl(b, n, nrhs): + res = np.empty((nrhs), dtype=real_dtype) + for k in range(nrhs): + res[k] = np.sum(b[n:, k]**2) + return res + return real_impl + + +def _lstsq_solution(b, bcpy, n): + """ + Extract 'x' (the lstsq solution) from the 'bcpy' scratch space. + Note 'b' is only used to check the system input dimension... + """ + raise NotImplementedError + + +@overload(_lstsq_solution) +def _lstsq_solution_impl(b, bcpy, n): + if b.ndim == 1: + def oneD_impl(b, bcpy, n): + return bcpy.T.ravel()[:n] + return oneD_impl + else: + def twoD_impl(b, bcpy, n): + return bcpy[:n, :].copy() + return twoD_impl + + +@overload(np.linalg.lstsq) +def lstsq_impl(a, b, rcond=-1.0): + ensure_lapack() + + _check_linalg_matrix(a, "lstsq") + + # B can be 1D or 2D. + _check_linalg_1_or_2d_matrix(b, "lstsq") + + _check_homogeneous_types("lstsq", a, b) + + np_dt = np_support.as_dtype(a.dtype) + nb_dt = a.dtype + + # convert typing floats to np floats for use in the impl + r_type = getattr(nb_dt, "underlying_float", nb_dt) + real_dtype = np_support.as_dtype(r_type) + + # lapack solver + numba_ez_gelsd = _LAPACK().numba_ez_gelsd(a.dtype) + + kind = ord(get_blas_kind(nb_dt, "lstsq")) + + # The following functions select specialisations based on + # information around 'b', a lot of this effort is required + # as 'b' can be either 1D or 2D, and then there are + # some optimisations available depending on real or complex + # space. + + def lstsq_impl(a, b, rcond=-1.0): + n = a.shape[-1] + m = a.shape[-2] + nrhs = _system_compute_nrhs(b) + + # check the systems have no inf or NaN + _check_finite_matrix(a) + _check_finite_matrix(b) + + # check the system is not empty + _system_check_non_empty(a, b) + + # check the systems are dimensionally valid + _system_check_dimensionally_valid(a, b) + + minmn = min(m, n) + maxmn = max(m, n) + + # a is destroyed on exit, copy it + acpy = _copy_to_fortran_order(a) + + # b is overwritten on exit with the solution, copy allocate + bcpy = np.empty((nrhs, maxmn), dtype=np_dt).T + # specialised copy in due to b being 1 or 2D + _system_copy_in_b(bcpy, b, nrhs) + + # Allocate returns + s = np.empty(minmn, dtype=real_dtype) + rank_ptr = np.empty(1, dtype=np.int32) + + r = numba_ez_gelsd( + kind, # kind + m, # m + n, # n + nrhs, # nrhs + acpy.ctypes, # a + m, # lda + bcpy.ctypes, # a + maxmn, # ldb + s.ctypes, # s + rcond, # rcond + rank_ptr.ctypes # rank + ) + _handle_err_maybe_convergence_problem(r) + + # set rank to that which was computed + rank = rank_ptr[0] + + # compute residuals + if rank < n or m <= n: + res = np.empty((0), dtype=real_dtype) + else: + # this requires additional dispatch as there's a faster + # impl if the result is in the real domain (no abs() required) + res = _lstsq_residual(bcpy, n, nrhs) + + # extract 'x', the solution + x = _lstsq_solution(b, bcpy, n) + + # help liveness analysis + _dummy_liveness_func([acpy.size, bcpy.size, s.size, rank_ptr.size]) + return (x, res, rank, s[:minmn]) + + return lstsq_impl + + +def _solve_compute_return(b, bcpy): + """ + Extract 'x' (the solution) from the 'bcpy' scratch space. + Note 'b' is only used to check the system input dimension... + """ + raise NotImplementedError + + +@overload(_solve_compute_return) +def _solve_compute_return_impl(b, bcpy): + if b.ndim == 1: + def oneD_impl(b, bcpy): + return bcpy.T.ravel() + return oneD_impl + else: + def twoD_impl(b, bcpy): + return bcpy + return twoD_impl + + +@overload(np.linalg.solve) +def solve_impl(a, b): + ensure_lapack() + + _check_linalg_matrix(a, "solve") + _check_linalg_1_or_2d_matrix(b, "solve") + + _check_homogeneous_types("solve", a, b) + + np_dt = np_support.as_dtype(a.dtype) + nb_dt = a.dtype + + # the lapack solver + numba_xgesv = _LAPACK().numba_xgesv(a.dtype) + + kind = ord(get_blas_kind(nb_dt, "solve")) + + def solve_impl(a, b): + n = a.shape[-1] + nrhs = _system_compute_nrhs(b) + + # check the systems have no inf or NaN + _check_finite_matrix(a) + _check_finite_matrix(b) + + # check the systems are dimensionally valid + _system_check_dimensionally_valid(a, b) + + # a is destroyed on exit, copy it + acpy = _copy_to_fortran_order(a) + + # b is overwritten on exit with the solution, copy allocate + bcpy = np.empty((nrhs, n), dtype=np_dt).T + if n == 0: + return _solve_compute_return(b, bcpy) + + # specialised copy in due to b being 1 or 2D + _system_copy_in_b(bcpy, b, nrhs) + + # allocate pivot array (needs to be fortran int size) + ipiv = np.empty(n, dtype=F_INT_nptype) + + r = numba_xgesv( + kind, # kind + n, # n + nrhs, # nhrs + acpy.ctypes, # a + n, # lda + ipiv.ctypes, # ipiv + bcpy.ctypes, # b + n # ldb + ) + _inv_err_handler(r) + + # help liveness analysis + _dummy_liveness_func([acpy.size, bcpy.size, ipiv.size]) + return _solve_compute_return(b, bcpy) + + return solve_impl + + +@overload(np.linalg.pinv) +def pinv_impl(a, rcond=1.e-15): + ensure_lapack() + + _check_linalg_matrix(a, "pinv") + + # convert typing floats to numpy floats for use in the impl + s_type = getattr(a.dtype, "underlying_float", a.dtype) + s_dtype = np_support.as_dtype(s_type) + + numba_ez_gesdd = _LAPACK().numba_ez_gesdd(a.dtype) + + numba_xxgemm = _BLAS().numba_xxgemm(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "pinv")) + JOB = ord('S') + + # need conjugate transposes + TRANSA = ord('C') + TRANSB = ord('C') + + # scalar constants + dt = np_support.as_dtype(a.dtype) + zero = np.array([0.], dtype=dt) + one = np.array([1.], dtype=dt) + + def pinv_impl(a, rcond=1.e-15): + + # The idea is to build the pseudo-inverse via inverting the singular + # value decomposition of a matrix `A`. Mathematically, this is roughly + # A = U*S*V^H [The SV decomposition of A] + # A^+ = V*(S^+)*U^H [The inverted SV decomposition of A] + # where ^+ is pseudo inversion and ^H is Hermitian transpose. + # As V and U are unitary, their inverses are simply their Hermitian + # transpose. S has singular values on its diagonal and zero elsewhere, + # it is inverted trivially by reciprocal of the diagonal values with + # the exception that zero singular values remain as zero. + # + # The practical implementation can take advantage of a few things to + # gain a few % performance increase: + # * A is destroyed by the SVD algorithm from LAPACK so a copy is + # required, this memory is exactly the right size in which to return + # the pseudo-inverse and so can be reused for this purpose. + # * The pseudo-inverse of S can be applied to either V or U^H, this + # then leaves a GEMM operation to compute the inverse via either: + # A^+ = (V*(S^+))*U^H + # or + # A^+ = V*((S^+)*U^H) + # however application of S^+ to V^H or U is more convenient as they + # are the result of the SVD algorithm. The application of the + # diagonal system is just a matrix multiplication which results in a + # row/column scaling (direction depending). To save effort, this + # "matrix multiplication" is applied to the smallest of U or V^H and + # only up to the point of "cut-off" (see next note) just as a direct + # scaling. + # * The cut-off level for application of S^+ can be used to reduce + # total effort, this cut-off can come via rcond or may just naturally + # be present as a result of zeros in the singular values. Regardless + # there's no need to multiply by zeros in the application of S^+ to + # V^H or U as above. Further, the GEMM operation can be shrunk in + # effort by noting that the possible zero block generated by the + # presence of zeros in S^+ has no effect apart from wasting cycles as + # it is all fmadd()s where one operand is zero. The inner dimension + # of the GEMM operation can therefore be set as shrunk accordingly! + + n = a.shape[-1] + m = a.shape[-2] + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + if m == 0 or n == 0: + return acpy.T.ravel().reshape(a.shape).T + + minmn = min(m, n) + + u = np.empty((minmn, m), dtype=a.dtype) + s = np.empty(minmn, dtype=s_dtype) + vt = np.empty((n, minmn), dtype=a.dtype) + + r = numba_ez_gesdd( + kind, # kind + JOB, # job + m, # m + n, # n + acpy.ctypes, # a + m, # lda + s.ctypes, # s + u.ctypes, # u + m, # ldu + vt.ctypes, # vt + minmn # ldvt + ) + _handle_err_maybe_convergence_problem(r) + + # Invert singular values under threshold. Also find the index of + # the threshold value as this is the upper limit for the application + # of the inverted singular values. Finding this value saves + # multiplication by a block of zeros that would be created by the + # application of these values to either U or V^H ahead of multiplying + # them together. This is done by simply in BLAS parlance via + # restricting the `k` dimension to `cut_idx` in `xgemm` whilst keeping + # the leading dimensions correct. + + cut_at = s[0] * rcond + cut_idx = 0 + for k in range(minmn): + if s[k] > cut_at: + s[k] = 1. / s[k] + cut_idx = k + cut_idx += 1 + + # Use cut_idx so there's no scaling by 0. + if m >= n: + # U is largest so apply S^+ to V^H. + for i in range(n): + for j in range(cut_idx): + vt[i, j] = vt[i, j] * s[j] + else: + # V^H is largest so apply S^+ to U. + for i in range(cut_idx): + s_local = s[i] + for j in range(minmn): + u[i, j] = u[i, j] * s_local + + # Do (v^H)^H*U^H (obviously one of the matrices includes the S^+ + # scaling) and write back to acpy. Note the innner dimension of cut_idx + # taking account of the possible zero block. + # We can store the result in acpy, given we had to create it + # for use in the SVD, and it is now redundant and the right size + # but wrong shape. + + r = numba_xxgemm( + kind, + TRANSA, # TRANSA + TRANSB, # TRANSB + n, # M + m, # N + cut_idx, # K + one.ctypes, # ALPHA + vt.ctypes, # A + minmn, # LDA + u.ctypes, # B + m, # LDB + zero.ctypes, # BETA + acpy.ctypes, # C + n # LDC + ) + + # help liveness analysis + #acpy.size + #vt.size + #u.size + #s.size + #one.size + #zero.size + _dummy_liveness_func([acpy.size, vt.size, u.size, s.size, one.size, + zero.size]) + return acpy.T.ravel().reshape(a.shape).T + + return pinv_impl + + +def _get_slogdet_diag_walker(a): + """ + Walks the diag of a LUP decomposed matrix + uses that det(A) = prod(diag(lup(A))) + and also that log(a)+log(b) = log(a*b) + The return sign is adjusted based on the values found + such that the log(value) stays in the real domain. + """ + if isinstance(a.dtype, types.Complex): + @register_jitable + def cmplx_diag_walker(n, a, sgn): + # walk diagonal + csgn = sgn + 0.j + acc = 0. + for k in range(n): + absel = np.abs(a[k, k]) + csgn = csgn * (a[k, k] / absel) + acc = acc + np.log(absel) + return (csgn, acc) + return cmplx_diag_walker + else: + @register_jitable + def real_diag_walker(n, a, sgn): + # walk diagonal + acc = 0. + for k in range(n): + v = a[k, k] + if v < 0.: + sgn = -sgn + v = -v + acc = acc + np.log(v) + # sgn is a float dtype + return (sgn + 0., acc) + return real_diag_walker + + +@overload(np.linalg.slogdet) +def slogdet_impl(a): + ensure_lapack() + + _check_linalg_matrix(a, "slogdet") + + numba_xxgetrf = _LAPACK().numba_xxgetrf(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "slogdet")) + + diag_walker = _get_slogdet_diag_walker(a) + + ONE = a.dtype(1) + ZERO = getattr(a.dtype, "underlying_float", a.dtype)(0) + + def slogdet_impl(a): + n = a.shape[-1] + if a.shape[-2] != n: + msg = "Last 2 dimensions of the array must be square." + raise np.linalg.LinAlgError(msg) + + if n == 0: + return (ONE, ZERO) + + _check_finite_matrix(a) + + acpy = _copy_to_fortran_order(a) + + ipiv = np.empty(n, dtype=F_INT_nptype) + + r = numba_xxgetrf(kind, n, n, acpy.ctypes, n, ipiv.ctypes) + + if r > 0: + # factorisation failed, return same defaults as np + return (0., -np.inf) + _inv_err_handler(r) # catch input-to-lapack problem + + # The following, prior to the call to diag_walker, is present + # to account for the effect of possible permutations to the + # sign of the determinant. + # This is the same idea as in numpy: + # File name `umath_linalg.c.src` e.g. + # https://github.com/numpy/numpy/blob/master/numpy/linalg/umath_linalg.c.src + # in function `@TYPE@_slogdet_single_element`. + sgn = 1 + for k in range(n): + sgn = sgn + (ipiv[k] != (k + 1)) + + sgn = sgn & 1 + if sgn == 0: + sgn = -1 + + # help liveness analysis + _dummy_liveness_func([ipiv.size]) + return diag_walker(n, acpy, sgn) + + return slogdet_impl + + +@overload(np.linalg.det) +def det_impl(a): + + ensure_lapack() + + _check_linalg_matrix(a, "det") + + def det_impl(a): + (sgn, slogdet) = np.linalg.slogdet(a) + return sgn * np.exp(slogdet) + + return det_impl + + +def _compute_singular_values(a): + """ + Compute singular values of *a*. + """ + raise NotImplementedError + + +@overload(_compute_singular_values) +def _compute_singular_values_impl(a): + """ + Returns a function to compute singular values of `a` + """ + numba_ez_gesdd = _LAPACK().numba_ez_gesdd(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "svd")) + + # Flag for "only compute `S`" to give to xgesdd + JOBZ_N = ord('N') + + nb_ret_type = getattr(a.dtype, "underlying_float", a.dtype) + np_ret_type = np_support.as_dtype(nb_ret_type) + np_dtype = np_support.as_dtype(a.dtype) + + # These are not referenced in the computation but must be set + # for MKL. + u = np.empty((1, 1), dtype=np_dtype) + vt = np.empty((1, 1), dtype=np_dtype) + + def sv_function(a): + """ + Computes singular values. + """ + # Don't use the np.linalg.svd impl instead + # call LAPACK to shortcut doing the "reconstruct + # singular vectors from reflectors" step and just + # get back the singular values. + n = a.shape[-1] + m = a.shape[-2] + if m == 0 or n == 0: + raise np.linalg.LinAlgError('Arrays cannot be empty') + _check_finite_matrix(a) + + ldu = m + minmn = min(m, n) + + # need to be >=1 but aren't referenced + ucol = 1 + ldvt = 1 + + acpy = _copy_to_fortran_order(a) + + # u and vt are not referenced however need to be + # allocated (as done above) for MKL as it + # checks for ref is nullptr. + s = np.empty(minmn, dtype=np_ret_type) + + r = numba_ez_gesdd( + kind, # kind + JOBZ_N, # jobz + m, # m + n, # n + acpy.ctypes, # a + m, # lda + s.ctypes, # s + u.ctypes, # u + ldu, # ldu + vt.ctypes, # vt + ldvt # ldvt + ) + _handle_err_maybe_convergence_problem(r) + + # help liveness analysis + _dummy_liveness_func([acpy.size, vt.size, u.size, s.size]) + return s + + return sv_function + + +def _oneD_norm_2(a): + """ + Compute the L2-norm of 1D-array *a*. + """ + raise NotImplementedError + + +@overload(_oneD_norm_2) +def _oneD_norm_2_impl(a): + nb_ret_type = getattr(a.dtype, "underlying_float", a.dtype) + np_ret_type = np_support.as_dtype(nb_ret_type) + + xxnrm2 = _BLAS().numba_xxnrm2(a.dtype) + + kind = ord(get_blas_kind(a.dtype, "norm")) + + def impl(a): + # Just ignore order, calls are guarded to only come + # from cases where order=None or order=2. + n = len(a) + # Call L2-norm routine from BLAS + ret = np.empty((1,), dtype=np_ret_type) + jmp = int(a.strides[0] / a.itemsize) + r = xxnrm2( + kind, # kind + n, # n + a.ctypes, # x + jmp, # incx + ret.ctypes # result + ) + if r < 0: + fatal_error_func() + assert 0 # unreachable + + # help liveness analysis + #ret.size + #a.size + _dummy_liveness_func([ret.size, a.size]) + return ret[0] + + return impl + + +def _get_norm_impl(x, ord_flag): + # This function is quite involved as norm supports a large + # range of values to select different norm types via kwarg `ord`. + # The implementation below branches on dimension of the input + # (1D or 2D). The default for `ord` is `None` which requires + # special handling in numba, this is dealt with first in each of + # the dimension branches. Following this the various norms are + # computed via code that is in most cases simply a loop version + # of a ufunc based version as found in numpy. + + # The following is common to both 1D and 2D cases. + # Convert typing floats to numpy floats for use in the impl. + # The return type is always a float, numba differs from numpy in + # that it returns an input precision specific value whereas numpy + # always returns np.float64. + nb_ret_type = getattr(x.dtype, "underlying_float", x.dtype) + np_ret_type = np_support.as_dtype(nb_ret_type) + + np_dtype = np_support.as_dtype(x.dtype) + + xxnrm2 = _BLAS().numba_xxnrm2(x.dtype) + + kind = ord(get_blas_kind(x.dtype, "norm")) + + if x.ndim == 1: + # 1D cases + + # handle "ord" being "None", must be done separately + if ord_flag in (None, types.none): + def oneD_impl(x, ord=None): + return _oneD_norm_2(x) + else: + def oneD_impl(x, ord=None): + n = len(x) + + # Shortcut to handle zero length arrays + # this differs slightly to numpy in that + # numpy raises a ValueError for kwarg ord= + # +/-np.inf as the reduction operations like + # max() and min() don't accept zero length + # arrays + if n == 0: + return 0.0 + + # Note: on order == 2 + # This is the same as for ord=="None" but because + # we have to handle "None" specially this condition + # is separated + if ord == 2: + return _oneD_norm_2(x) + elif ord == np.inf: + # max(abs(x)) + ret = abs(x[0]) + for k in range(1, n): + val = abs(x[k]) + if val > ret: + ret = val + return ret + + elif ord == -np.inf: + # min(abs(x)) + ret = abs(x[0]) + for k in range(1, n): + val = abs(x[k]) + if val < ret: + ret = val + return ret + + elif ord == 0: + # sum(x != 0) + ret = 0.0 + for k in range(n): + if x[k] != 0.: + ret += 1. + return ret + + elif ord == 1: + # sum(abs(x)) + ret = 0.0 + for k in range(n): + ret += abs(x[k]) + return ret + + else: + # sum(abs(x)**ord)**(1./ord) + ret = 0.0 + for k in range(n): + ret += abs(x[k])**ord + return ret**(1. / ord) + return oneD_impl + + elif x.ndim == 2: + # 2D cases + + # handle "ord" being "None" + if ord_flag in (None, types.none): + # Force `x` to be C-order, so that we can take a contiguous + # 1D view. + if x.layout == 'C': + @register_jitable + def array_prepare(x): + return x + elif x.layout == 'F': + @register_jitable + def array_prepare(x): + # Legal since L2(x) == L2(x.T) + return x.T + else: + @register_jitable + def array_prepare(x): + return x.copy() + + # Compute the Frobenius norm, this is the L2,2 induced norm of `x` + # which is the L2-norm of x.ravel() and so can be computed via BLAS + def twoD_impl(x, ord=None): + n = x.size + if n == 0: + # reshape() currently doesn't support zero-sized arrays + return 0.0 + x_c = array_prepare(x) + return _oneD_norm_2(x_c.reshape(n)) + else: + # max value for this dtype + max_val = np.finfo(np_ret_type.type).max + + def twoD_impl(x, ord=None): + n = x.shape[-1] + m = x.shape[-2] + + # Shortcut to handle zero size arrays + # this differs slightly to numpy in that + # numpy raises errors for some ord values + # and in other cases returns zero. + if x.size == 0: + return 0.0 + + if ord == np.inf: + # max of sum of abs across rows + # max(sum(abs(x)), axis=1) + global_max = 0. + for ii in range(m): + tmp = 0. + for jj in range(n): + tmp += abs(x[ii, jj]) + if tmp > global_max: + global_max = tmp + return global_max + + elif ord == -np.inf: + # min of sum of abs across rows + # min(sum(abs(x)), axis=1) + global_min = max_val + for ii in range(m): + tmp = 0. + for jj in range(n): + tmp += abs(x[ii, jj]) + if tmp < global_min: + global_min = tmp + return global_min + elif ord == 1: + # max of sum of abs across cols + # max(sum(abs(x)), axis=0) + global_max = 0. + for ii in range(n): + tmp = 0. + for jj in range(m): + tmp += abs(x[jj, ii]) + if tmp > global_max: + global_max = tmp + return global_max + + elif ord == -1: + # min of sum of abs across cols + # min(sum(abs(x)), axis=0) + global_min = max_val + for ii in range(n): + tmp = 0. + for jj in range(m): + tmp += abs(x[jj, ii]) + if tmp < global_min: + global_min = tmp + return global_min + + # Results via SVD, singular values are sorted on return + # by definition. + elif ord == 2: + # max SV + return _compute_singular_values(x)[0] + elif ord == -2: + # min SV + return _compute_singular_values(x)[-1] + else: + # replicate numpy error + raise ValueError("Invalid norm order for matrices.") + return twoD_impl + else: + assert 0 # unreachable + + +@overload(np.linalg.norm) +def norm_impl(x, ord=None): + ensure_lapack() + + _check_linalg_1_or_2d_matrix(x, "norm") + + return _get_norm_impl(x, ord) + + +@overload(np.linalg.cond) +def cond_impl(x, p=None): + ensure_lapack() + + _check_linalg_matrix(x, "cond") + + def impl(x, p=None): + # This is extracted for performance, numpy does approximately: + # `condition = norm(x) * norm(inv(x))` + # in the cases of `p == 2` or `p ==-2` singular values are used + # for computing norms. This costs numpy an svd of `x` then an + # inversion of `x` and another svd of `x`. + # Below is a different approach, which also gives a more + # accurate answer as there is no inversion involved. + # Recall that the singular values of an inverted matrix are the + # reciprocal of singular values of the original matrix. + # Therefore calling `svd(x)` once yields all the information + # needed about both `x` and `inv(x)` without the cost or + # potential loss of accuracy incurred through inversion. + # For the case of `p == 2`, the result is just the ratio of + # `largest singular value/smallest singular value`, and for the + # case of `p==-2` the result is simply the + # `smallest singular value/largest singular value`. + # As a result of this, numba accepts non-square matrices as + # input when p==+/-2 as well as when p==None. + if p == 2 or p == -2 or p is None: + s = _compute_singular_values(x) + if p == 2 or p is None: + r = np.divide(s[0], s[-1]) + else: + r = np.divide(s[-1], s[0]) + else: # cases np.inf, -np.inf, 1, -1 + norm_x = np.linalg.norm(x, p) + norm_inv_x = np.linalg.norm(np.linalg.inv(x), p) + r = norm_x * norm_inv_x + # NumPy uses a NaN mask, if the input has a NaN, it will return NaN, + # Numba calls ban NaN through the use of _check_finite_matrix but this + # catches cases where NaN occurs through floating point use + if np.isnan(r): + return np.inf + else: + return r + return impl + + +@register_jitable +def _get_rank_from_singular_values(sv, t): + """ + Gets rank from singular values with cut-off at a given tolerance + """ + rank = 0 + for k in range(len(sv)): + if sv[k] > t: + rank = rank + 1 + else: # sv is ordered big->small so break on condition not met + break + return rank + + +@overload(np.linalg.matrix_rank) +def matrix_rank_impl(A, tol=None): + """ + Computes rank for matrices and vectors. + The only issue that may arise is that because numpy uses double + precision lapack calls whereas numba uses type specific lapack + calls, some singular values may differ and therefore counting the + number of them above a tolerance may lead to different counts, + and therefore rank, in some cases. + """ + ensure_lapack() + + _check_linalg_1_or_2d_matrix(A, "matrix_rank") + + def _2d_matrix_rank_impl(A, tol): + + # handle the tol==None case separately for type inference to work + if tol in (None, types.none): + nb_type = getattr(A.dtype, "underlying_float", A.dtype) + np_type = np_support.as_dtype(nb_type) + eps_val = np.finfo(np_type).eps + + def _2d_tol_none_impl(A, tol=None): + s = _compute_singular_values(A) + # replicate numpy default tolerance calculation + r = A.shape[0] + c = A.shape[1] + l = max(r, c) + t = s[0] * l * eps_val + return _get_rank_from_singular_values(s, t) + return _2d_tol_none_impl + else: + def _2d_tol_not_none_impl(A, tol=None): + s = _compute_singular_values(A) + return _get_rank_from_singular_values(s, tol) + return _2d_tol_not_none_impl + + def _get_matrix_rank_impl(A, tol): + ndim = A.ndim + if ndim == 1: + # NOTE: Technically, the numpy implementation could be argued as + # incorrect for the case of a vector (1D matrix). If a tolerance + # is provided and a vector with a singular value below tolerance is + # encountered this should report a rank of zero, the numpy + # implementation does not do this and instead elects to report that + # if any value in the vector is nonzero then the rank is 1. + # An example would be [0, 1e-15, 0, 2e-15] which numpy reports as + # rank 1 invariant of `tol`. The singular value for this vector is + # obviously sqrt(5)*1e-15 and so a tol of e.g. sqrt(6)*1e-15 should + # lead to a reported rank of 0 whereas a tol of 1e-15 should lead + # to a reported rank of 1, numpy reports 1 regardless. + # The code below replicates the numpy behaviour. + def _1d_matrix_rank_impl(A, tol=None): + for k in range(len(A)): + if A[k] != 0.: + return 1 + return 0 + return _1d_matrix_rank_impl + elif ndim == 2: + return _2d_matrix_rank_impl(A, tol) + else: + assert 0 # unreachable + + return _get_matrix_rank_impl(A, tol) + + +@overload(np.linalg.matrix_power) +def matrix_power_impl(a, n): + """ + Computes matrix power. Only integer powers are supported in numpy. + """ + + _check_linalg_matrix(a, "matrix_power") + np_dtype = np_support.as_dtype(a.dtype) + + nt = getattr(n, 'dtype', n) + if not isinstance(nt, types.Integer): + raise NumbaTypeError("Exponent must be an integer.") + + def matrix_power_impl(a, n): + + if n == 0: + # this should be eye() but it doesn't support + # the dtype kwarg yet so do it manually to save + # the copy required by eye(a.shape[0]).asdtype() + A = np.zeros(a.shape, dtype=np_dtype) + for k in range(a.shape[0]): + A[k, k] = 1. + return A + + am, an = a.shape[-1], a.shape[-2] + if am != an: + raise ValueError('input must be a square array') + + # empty, return a copy + if am == 0: + return a.copy() + + # note: to be consistent over contiguousness, C order is + # returned as that is what dot() produces and the most common + # paths through matrix_power will involve that. Therefore + # copies are made here to ensure the data ordering is + # correct for paths not going via dot(). + + if n < 0: + A = np.linalg.inv(a).copy() + if n == -1: # return now + return A + n = -n + else: + if n == 1: # return a copy now + return a.copy() + A = a # this is safe, `a` is only read + + if n < 4: + if n == 2: + return np.dot(A, A) + if n == 3: + return np.dot(np.dot(A, A), A) + else: + + acc = A + exp = n + + # Initialise ret, SSA cannot see the loop will execute, without this + # it appears as uninitialised. + ret = acc + # tried a loop split and branchless using identity matrix as + # input but it seems like having a "first entry" flag is quicker + flag = True + while exp != 0: + if exp & 1: + if flag: + ret = acc + flag = False + else: + ret = np.dot(ret, acc) + acc = np.dot(acc, acc) + exp = exp >> 1 + + return ret + + return matrix_power_impl + +# This is documented under linalg despite not being in the module + + +@overload(np.trace) +def matrix_trace_impl(a, offset=0): + """ + Computes the trace of an array. + """ + + _check_linalg_matrix(a, "trace", la_prefix=False) + + if not isinstance(offset, (int, types.Integer)): + raise NumbaTypeError("integer argument expected, got %s" % offset) + + def matrix_trace_impl(a, offset=0): + rows, cols = a.shape + k = offset + if k < 0: + rows = rows + k + if k > 0: + cols = cols - k + n = max(min(rows, cols), 0) + ret = 0 + if k >= 0: + for i in range(n): + ret += a[i, k + i] + else: + for i in range(n): + ret += a[i - k, i] + return ret + + return matrix_trace_impl + + +def _check_scalar_or_lt_2d_mat(a, func_name, la_prefix=True): + prefix = "np.linalg" if la_prefix else "np" + interp = (prefix, func_name) + # checks that a matrix is 1 or 2D + if isinstance(a, types.Array): + if not a.ndim <= 2: + raise TypingError("%s.%s() only supported on 1 and 2-D arrays " + % interp, highlighting=False) + + +@register_jitable +def outer_impl_none(a, b, out): + aa = np.asarray(a) + bb = np.asarray(b) + return np.multiply(aa.ravel().reshape((aa.size, 1)), + bb.ravel().reshape((1, bb.size))) + + +@register_jitable +def outer_impl_arr(a, b, out): + aa = np.asarray(a) + bb = np.asarray(b) + np.multiply(aa.ravel().reshape((aa.size, 1)), + bb.ravel().reshape((1, bb.size)), + out) + return out + + +def _get_outer_impl(a, b, out): + if out in (None, types.none): + return outer_impl_none + else: + return outer_impl_arr + + +@overload(np.outer) +def outer_impl(a, b, out=None): + + _check_scalar_or_lt_2d_mat(a, "outer", la_prefix=False) + _check_scalar_or_lt_2d_mat(b, "outer", la_prefix=False) + + impl = _get_outer_impl(a, b, out) + + def outer_impl(a, b, out=None): + return impl(a, b, out) + + return outer_impl + + +def _kron_normaliser_impl(x): + # makes x into a 2d array + if isinstance(x, types.Array): + if x.layout not in ('C', 'F'): + raise TypingError("np.linalg.kron only supports 'C' or 'F' layout " + "input arrays. Received an input of " + "layout '{}'.".format(x.layout)) + elif x.ndim == 2: + @register_jitable + def nrm_shape(x): + xn = x.shape[-1] + xm = x.shape[-2] + return x.reshape(xm, xn) + return nrm_shape + else: + @register_jitable + def nrm_shape(x): + xn = x.shape[-1] + return x.reshape(1, xn) + return nrm_shape + else: # assume its a scalar + @register_jitable + def nrm_shape(x): + a = np.empty((1, 1), type(x)) + a[0] = x + return a + return nrm_shape + + +def _kron_return(a, b): + # transforms c into something that kron would return + # based on the shapes of a and b + a_is_arr = isinstance(a, types.Array) + b_is_arr = isinstance(b, types.Array) + if a_is_arr and b_is_arr: + if a.ndim == 2 or b.ndim == 2: + @register_jitable + def ret(a, b, c): + return c + return ret + else: + @register_jitable + def ret(a, b, c): + return c.reshape(c.size) + return ret + else: # at least one of (a, b) is a scalar + if a_is_arr: + @register_jitable + def ret(a, b, c): + return c.reshape(a.shape) + return ret + elif b_is_arr: + @register_jitable + def ret(a, b, c): + return c.reshape(b.shape) + return ret + else: # both scalars + @register_jitable + def ret(a, b, c): + return c[0] + return ret + + +@overload(np.kron) +def kron_impl(a, b): + + _check_scalar_or_lt_2d_mat(a, "kron", la_prefix=False) + _check_scalar_or_lt_2d_mat(b, "kron", la_prefix=False) + + fix_a = _kron_normaliser_impl(a) + fix_b = _kron_normaliser_impl(b) + ret_c = _kron_return(a, b) + + # this is fine because the ufunc for the Hadamard product + # will reject differing dtypes in a and b. + dt = getattr(a, 'dtype', a) + + def kron_impl(a, b): + + aa = fix_a(a) + bb = fix_b(b) + + am = aa.shape[-2] + an = aa.shape[-1] + bm = bb.shape[-2] + bn = bb.shape[-1] + + cm = am * bm + cn = an * bn + + # allocate c + C = np.empty((cm, cn), dtype=dt) + + # In practice this is runs quicker than the more obvious + # `each element of A multiplied by B and assigned to + # a block in C` like alg. + + # loop over rows of A + for i in range(am): + # compute the column offset into C + rjmp = i * bm + # loop over rows of B + for k in range(bm): + # compute row the offset into C + irjmp = rjmp + k + # slice a given row of B + slc = bb[k, :] + # loop over columns of A + for j in range(an): + # vectorized assignment of an element of A + # multiplied by the current row of B into + # a slice of a row of C + cjmp = j * bn + C[irjmp, cjmp:cjmp + bn] = aa[i, j] * slc + + return ret_c(a, b, C) + + return kron_impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/new_arraymath.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/new_arraymath.py new file mode 100644 index 0000000000000000000000000000000000000000..dac520649afd0d3eb32288a2e5c51a2ca0213a5c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/new_arraymath.py @@ -0,0 +1,4983 @@ +""" +Implementation of math operations on Array objects. +""" + + +import math +from collections import namedtuple +import operator + +import llvmlite.ir +import numpy as np + +from numba.core import types, cgutils +from numba.core.extending import overload, overload_method, register_jitable +from numba.np.numpy_support import (as_dtype, type_can_asarray, type_is_scalar, + numpy_version, is_nonelike, + check_is_integer, lt_floats, lt_complex) +from numba.core.imputils import (lower_builtin, impl_ret_borrowed, + impl_ret_new_ref, impl_ret_untracked) +from numba.np.arrayobj import (make_array, load_item, store_item, + _empty_nd_impl) +from numba.np.linalg import ensure_blas + +from numba.core.extending import intrinsic +from numba.core.errors import (RequireLiteralValue, TypingError, + NumbaValueError, NumbaNotImplementedError, + NumbaTypeError) +from numba.cpython.unsafe.tuple import tuple_setitem + + +def _check_blas(): + # Checks if a BLAS is available so e.g. dot will work + try: + ensure_blas() + except ImportError: + return False + return True + + +_HAVE_BLAS = _check_blas() + + +@intrinsic +def _create_tuple_result_shape(tyctx, shape_list, shape_tuple): + """ + This routine converts shape list where the axis dimension has already + been popped to a tuple for indexing of the same size. The original shape + tuple is also required because it contains a length field at compile time + whereas the shape list does not. + """ + + # The new tuple's size is one less than the original tuple since axis + # dimension removed. + nd = len(shape_tuple) - 1 + # The return type of this intrinsic is an int tuple of length nd. + tupty = types.UniTuple(types.intp, nd) + # The function signature for this intrinsic. + function_sig = tupty(shape_list, shape_tuple) + + def codegen(cgctx, builder, signature, args): + lltupty = cgctx.get_value_type(tupty) + # Create an empty int tuple. + tup = cgutils.get_null_value(lltupty) + + # Get the shape list from the args and we don't need shape tuple. + [in_shape, _] = args + + def array_indexer(a, i): + return a[i] + + # loop to fill the tuple + for i in range(nd): + dataidx = cgctx.get_constant(types.intp, i) + # compile and call array_indexer + data = cgctx.compile_internal(builder, array_indexer, + types.intp(shape_list, types.intp), + [in_shape, dataidx]) + tup = builder.insert_value(tup, data, i) + return tup + + return function_sig, codegen + + +@intrinsic +def _gen_index_tuple(tyctx, shape_tuple, value, axis): + """ + Generates a tuple that can be used to index a specific slice from an + array for sum with axis. shape_tuple is the size of the dimensions of + the input array. 'value' is the value to put in the indexing tuple + in the axis dimension and 'axis' is that dimension. For this to work, + axis has to be a const. + """ + if not isinstance(axis, types.Literal): + raise RequireLiteralValue('axis argument must be a constant') + # Get the value of the axis constant. + axis_value = axis.literal_value + # The length of the indexing tuple to be output. + nd = len(shape_tuple) + + # If the axis value is impossible for the given size array then + # just fake it like it was for axis 0. This will stop compile errors + # when it looks like it could be called from array_sum_axis but really + # can't because that routine checks the axis mismatch and raise an + # exception. + if axis_value >= nd: + axis_value = 0 + + # Calculate the type of the indexing tuple. All the non-axis + # dimensions have slice2 type and the axis dimension has int type. + before = axis_value + after = nd - before - 1 + + types_list = [] + types_list += [types.slice2_type] * before + types_list += [types.intp] + types_list += [types.slice2_type] * after + + # Creates the output type of the function. + tupty = types.Tuple(types_list) + # Defines the signature of the intrinsic. + function_sig = tupty(shape_tuple, value, axis) + + def codegen(cgctx, builder, signature, args): + lltupty = cgctx.get_value_type(tupty) + # Create an empty indexing tuple. + tup = cgutils.get_null_value(lltupty) + + # We only need value of the axis dimension here. + # The rest are constants defined above. + [_, value_arg, _] = args + + def create_full_slice(): + return slice(None, None) + + # loop to fill the tuple with slice(None,None) before + # the axis dimension. + + # compile and call create_full_slice + slice_data = cgctx.compile_internal(builder, create_full_slice, + types.slice2_type(), + []) + for i in range(0, axis_value): + tup = builder.insert_value(tup, slice_data, i) + + # Add the axis dimension 'value'. + tup = builder.insert_value(tup, value_arg, axis_value) + + # loop to fill the tuple with slice(None,None) after + # the axis dimension. + for i in range(axis_value + 1, nd): + tup = builder.insert_value(tup, slice_data, i) + return tup + + return function_sig, codegen + + +#---------------------------------------------------------------------------- +# Basic stats and aggregates + +@lower_builtin(np.sum, types.Array) +@lower_builtin("array.sum", types.Array) +def array_sum(context, builder, sig, args): + zero = sig.return_type(0) + + def array_sum_impl(arr): + c = zero + for v in np.nditer(arr): + c += v.item() + return c + + res = context.compile_internal(builder, array_sum_impl, sig, args, + locals=dict(c=sig.return_type)) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@register_jitable +def _array_sum_axis_nop(arr, v): + return arr + + +def gen_sum_axis_impl(is_axis_const, const_axis_val, op, zero): + def inner(arr, axis): + """ + function that performs sums over one specific axis + + The third parameter to gen_index_tuple that generates the indexing + tuples has to be a const so we can't just pass "axis" through since + that isn't const. We can check for specific values and have + different instances that do take consts. Supporting axis summation + only up to the fourth dimension for now. + + typing/arraydecl.py:sum_expand defines the return type for sum with + axis. It is one dimension less than the input array. + """ + ndim = arr.ndim + + if not is_axis_const: + # Catch where axis is negative or greater than 3. + if axis < 0 or axis > 3: + raise ValueError("Numba does not support sum with axis " + "parameter outside the range 0 to 3.") + + # Catch the case where the user misspecifies the axis to be + # more than the number of the array's dimensions. + if axis >= ndim: + raise ValueError("axis is out of bounds for array") + + # Convert the shape of the input array to a list. + ashape = list(arr.shape) + # Get the length of the axis dimension. + axis_len = ashape[axis] + # Remove the axis dimension from the list of dimensional lengths. + ashape.pop(axis) + # Convert this shape list back to a tuple using above intrinsic. + ashape_without_axis = _create_tuple_result_shape(ashape, arr.shape) + # Tuple needed here to create output array with correct size. + result = np.full(ashape_without_axis, zero, type(zero)) + + # Iterate through the axis dimension. + for axis_index in range(axis_len): + if is_axis_const: + # constant specialized version works for any valid axis value + index_tuple_generic = _gen_index_tuple(arr.shape, axis_index, + const_axis_val) + result += arr[index_tuple_generic] + else: + # Generate a tuple used to index the input array. + # The tuple is ":" in all dimensions except the axis + # dimension where it is "axis_index". + if axis == 0: + index_tuple1 = _gen_index_tuple(arr.shape, axis_index, 0) + result += arr[index_tuple1] + elif axis == 1: + index_tuple2 = _gen_index_tuple(arr.shape, axis_index, 1) + result += arr[index_tuple2] + elif axis == 2: + index_tuple3 = _gen_index_tuple(arr.shape, axis_index, 2) + result += arr[index_tuple3] + elif axis == 3: + index_tuple4 = _gen_index_tuple(arr.shape, axis_index, 3) + result += arr[index_tuple4] + return op(result, 0) + return inner + + +@lower_builtin(np.sum, types.Array, types.np_intp, types.DTypeSpec) +@lower_builtin(np.sum, types.Array, types.IntegerLiteral, types.DTypeSpec) +@lower_builtin("array.sum", types.Array, types.np_intp, types.DTypeSpec) +@lower_builtin("array.sum", types.Array, types.IntegerLiteral, types.DTypeSpec) +def array_sum_axis_dtype(context, builder, sig, args): + retty = sig.return_type + zero = getattr(retty, 'dtype', retty)(0) + # if the return is scalar in type then "take" the 0th element of the + # 0d array accumulator as the return value + if getattr(retty, 'ndim', None) is None: + op = np.take + else: + op = _array_sum_axis_nop + [ty_array, ty_axis, ty_dtype] = sig.args + is_axis_const = False + const_axis_val = 0 + if isinstance(ty_axis, types.Literal): + # this special-cases for constant axis + const_axis_val = ty_axis.literal_value + # fix negative axis + if const_axis_val < 0: + const_axis_val = ty_array.ndim + const_axis_val + if const_axis_val < 0 or const_axis_val > ty_array.ndim: + raise ValueError("'axis' entry is out of bounds") + + ty_axis = context.typing_context.resolve_value_type(const_axis_val) + axis_val = context.get_constant(ty_axis, const_axis_val) + # rewrite arguments + args = args[0], axis_val, args[2] + # rewrite sig + sig = sig.replace(args=[ty_array, ty_axis, ty_dtype]) + is_axis_const = True + + gen_impl = gen_sum_axis_impl(is_axis_const, const_axis_val, op, zero) + compiled = register_jitable(gen_impl) + + def array_sum_impl_axis(arr, axis, dtype): + return compiled(arr, axis) + + res = context.compile_internal(builder, array_sum_impl_axis, sig, args) + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +@lower_builtin(np.sum, types.Array, types.DTypeSpec) +@lower_builtin("array.sum", types.Array, types.DTypeSpec) +def array_sum_dtype(context, builder, sig, args): + zero = sig.return_type(0) + + def array_sum_impl(arr, dtype): + c = zero + for v in np.nditer(arr): + c += v.item() + return c + + res = context.compile_internal(builder, array_sum_impl, sig, args, + locals=dict(c=sig.return_type)) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(np.sum, types.Array, types.np_intp) +@lower_builtin(np.sum, types.Array, types.IntegerLiteral) +@lower_builtin("array.sum", types.Array, types.np_intp) +@lower_builtin("array.sum", types.Array, types.IntegerLiteral) +def array_sum_axis(context, builder, sig, args): + retty = sig.return_type + zero = getattr(retty, 'dtype', retty)(0) + # if the return is scalar in type then "take" the 0th element of the + # 0d array accumulator as the return value + if getattr(retty, 'ndim', None) is None: + op = np.take + else: + op = _array_sum_axis_nop + [ty_array, ty_axis] = sig.args + is_axis_const = False + const_axis_val = 0 + if isinstance(ty_axis, types.Literal): + # this special-cases for constant axis + const_axis_val = ty_axis.literal_value + # fix negative axis + if const_axis_val < 0: + const_axis_val = ty_array.ndim + const_axis_val + if const_axis_val < 0 or const_axis_val > ty_array.ndim: + msg = f"'axis' entry ({const_axis_val}) is out of bounds" + raise NumbaValueError(msg) + + ty_axis = context.typing_context.resolve_value_type(const_axis_val) + axis_val = context.get_constant(ty_axis, const_axis_val) + # rewrite arguments + args = args[0], axis_val + # rewrite sig + sig = sig.replace(args=[ty_array, ty_axis]) + is_axis_const = True + + gen_impl = gen_sum_axis_impl(is_axis_const, const_axis_val, op, zero) + compiled = register_jitable(gen_impl) + + def array_sum_impl_axis(arr, axis): + return compiled(arr, axis) + + res = context.compile_internal(builder, array_sum_impl_axis, sig, args) + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +def get_accumulator(dtype, value): + if dtype.type == np.timedelta64: + acc_init = np.int64(value).view(dtype) + else: + acc_init = dtype.type(value) + return acc_init + + +@overload(np.prod) +@overload_method(types.Array, "prod") +def array_prod(a): + if isinstance(a, types.Array): + dtype = as_dtype(a.dtype) + + acc_init = get_accumulator(dtype, 1) + + def array_prod_impl(a): + c = acc_init + for v in np.nditer(a): + c *= v.item() + return c + + return array_prod_impl + + +@overload(np.cumsum) +@overload_method(types.Array, "cumsum") +def array_cumsum(a): + if isinstance(a, types.Array): + is_integer = a.dtype in types.signed_domain + is_bool = a.dtype == types.bool_ + if (is_integer and a.dtype.bitwidth < types.intp.bitwidth)\ + or is_bool: + dtype = as_dtype(types.intp) + else: + dtype = as_dtype(a.dtype) + + acc_init = get_accumulator(dtype, 0) + + def array_cumsum_impl(a): + out = np.empty(a.size, dtype) + c = acc_init + for idx, v in enumerate(a.flat): + c += v + out[idx] = c + return out + + return array_cumsum_impl + + +@overload(np.cumprod) +@overload_method(types.Array, "cumprod") +def array_cumprod(a): + if isinstance(a, types.Array): + is_integer = a.dtype in types.signed_domain + is_bool = a.dtype == types.bool_ + if (is_integer and a.dtype.bitwidth < types.intp.bitwidth)\ + or is_bool: + dtype = as_dtype(types.intp) + else: + dtype = as_dtype(a.dtype) + + acc_init = get_accumulator(dtype, 1) + + def array_cumprod_impl(a): + out = np.empty(a.size, dtype) + c = acc_init + for idx, v in enumerate(a.flat): + c *= v + out[idx] = c + return out + + return array_cumprod_impl + + +@overload(np.mean) +@overload_method(types.Array, "mean") +def array_mean(a): + if isinstance(a, types.Array): + is_number = a.dtype in types.integer_domain | frozenset([types.bool_]) + if is_number: + dtype = as_dtype(types.float64) + else: + dtype = as_dtype(a.dtype) + + acc_init = get_accumulator(dtype, 0) + + def array_mean_impl(a): + # Can't use the naive `arr.sum() / arr.size`, as it would return + # a wrong result on integer sum overflow. + c = acc_init + for v in np.nditer(a): + c += v.item() + return c / a.size + + return array_mean_impl + + +@overload(np.var) +@overload_method(types.Array, "var") +def array_var(a): + if isinstance(a, types.Array): + def array_var_impl(a): + # Compute the mean + m = a.mean() + + # Compute the sum of square diffs + ssd = 0 + for v in np.nditer(a): + val = (v.item() - m) + ssd += np.real(val * np.conj(val)) + return ssd / a.size + + return array_var_impl + + +@overload(np.std) +@overload_method(types.Array, "std") +def array_std(a): + if isinstance(a, types.Array): + def array_std_impl(a): + return a.var() ** 0.5 + + return array_std_impl + + +@register_jitable +def min_comparator(a, min_val): + return a < min_val + + +@register_jitable +def max_comparator(a, min_val): + return a > min_val + + +@register_jitable +def return_false(a): + return False + + +@overload(np.min) +@overload(np.amin) +@overload_method(types.Array, "min") +def npy_min(a): + if not isinstance(a, types.Array): + return + + if isinstance(a.dtype, (types.NPDatetime, types.NPTimedelta)): + pre_return_func = np.isnat + comparator = min_comparator + elif isinstance(a.dtype, types.Complex): + pre_return_func = return_false + + def comp_func(a, min_val): + if a.real < min_val.real: + return True + elif a.real == min_val.real: + if a.imag < min_val.imag: + return True + return False + + comparator = register_jitable(comp_func) + elif isinstance(a.dtype, types.Float): + pre_return_func = np.isnan + comparator = min_comparator + else: + pre_return_func = return_false + comparator = min_comparator + + def impl_min(a): + if a.size == 0: + raise ValueError("zero-size array to reduction operation " + "minimum which has no identity") + + it = np.nditer(a) + min_value = next(it).take(0) + if pre_return_func(min_value): + return min_value + + for view in it: + v = view.item() + if pre_return_func(v): + return v + if comparator(v, min_value): + min_value = v + return min_value + + return impl_min + + +@overload(np.max) +@overload(np.amax) +@overload_method(types.Array, "max") +def npy_max(a): + if not isinstance(a, types.Array): + return + + if isinstance(a.dtype, (types.NPDatetime, types.NPTimedelta)): + pre_return_func = np.isnat + comparator = max_comparator + elif isinstance(a.dtype, types.Complex): + pre_return_func = return_false + + def comp_func(a, max_val): + if a.real > max_val.real: + return True + elif a.real == max_val.real: + if a.imag > max_val.imag: + return True + return False + + comparator = register_jitable(comp_func) + elif isinstance(a.dtype, types.Float): + pre_return_func = np.isnan + comparator = max_comparator + else: + pre_return_func = return_false + comparator = max_comparator + + def impl_max(a): + if a.size == 0: + raise ValueError("zero-size array to reduction operation " + "maximum which has no identity") + + it = np.nditer(a) + max_value = next(it).take(0) + if pre_return_func(max_value): + return max_value + + for view in it: + v = view.item() + if pre_return_func(v): + return v + if comparator(v, max_value): + max_value = v + return max_value + + return impl_max + + +@register_jitable +def array_argmin_impl_datetime(arry): + if arry.size == 0: + raise ValueError("attempt to get argmin of an empty sequence") + it = np.nditer(arry) + min_value = next(it).take(0) + min_idx = 0 + if np.isnat(min_value): + return min_idx + + idx = 1 + for view in it: + v = view.item() + if np.isnat(v): + return idx + if v < min_value: + min_value = v + min_idx = idx + idx += 1 + return min_idx + + +@register_jitable +def array_argmin_impl_float(arry): + if arry.size == 0: + raise ValueError("attempt to get argmin of an empty sequence") + for v in arry.flat: + min_value = v + min_idx = 0 + break + if np.isnan(min_value): + return min_idx + + idx = 0 + for v in arry.flat: + if np.isnan(v): + return idx + if v < min_value: + min_value = v + min_idx = idx + idx += 1 + return min_idx + + +@register_jitable +def array_argmin_impl_generic(arry): + if arry.size == 0: + raise ValueError("attempt to get argmin of an empty sequence") + for v in arry.flat: + min_value = v + min_idx = 0 + break + else: + raise RuntimeError('unreachable') + + idx = 0 + for v in arry.flat: + if v < min_value: + min_value = v + min_idx = idx + idx += 1 + return min_idx + + +@overload(np.argmin) +@overload_method(types.Array, "argmin") +def array_argmin(a, axis=None): + if isinstance(a.dtype, (types.NPDatetime, types.NPTimedelta)): + flatten_impl = array_argmin_impl_datetime + elif isinstance(a.dtype, types.Float): + flatten_impl = array_argmin_impl_float + else: + flatten_impl = array_argmin_impl_generic + + if is_nonelike(axis): + def array_argmin_impl(a, axis=None): + return flatten_impl(a) + else: + array_argmin_impl = build_argmax_or_argmin_with_axis_impl( + a, axis, flatten_impl + ) + return array_argmin_impl + + +@register_jitable +def array_argmax_impl_datetime(arry): + if arry.size == 0: + raise ValueError("attempt to get argmax of an empty sequence") + it = np.nditer(arry) + max_value = next(it).take(0) + max_idx = 0 + if np.isnat(max_value): + return max_idx + + idx = 1 + for view in it: + v = view.item() + if np.isnat(v): + return idx + if v > max_value: + max_value = v + max_idx = idx + idx += 1 + return max_idx + + +@register_jitable +def array_argmax_impl_float(arry): + if arry.size == 0: + raise ValueError("attempt to get argmax of an empty sequence") + for v in arry.flat: + max_value = v + max_idx = 0 + break + if np.isnan(max_value): + return max_idx + + idx = 0 + for v in arry.flat: + if np.isnan(v): + return idx + if v > max_value: + max_value = v + max_idx = idx + idx += 1 + return max_idx + + +@register_jitable +def array_argmax_impl_generic(arry): + if arry.size == 0: + raise ValueError("attempt to get argmax of an empty sequence") + for v in arry.flat: + max_value = v + max_idx = 0 + break + + idx = 0 + for v in arry.flat: + if v > max_value: + max_value = v + max_idx = idx + idx += 1 + return max_idx + + +def build_argmax_or_argmin_with_axis_impl(a, axis, flatten_impl): + """ + Given a function that implements the logic for handling a flattened + array, return the implementation function. + """ + check_is_integer(axis, "axis") + retty = types.intp + + tuple_buffer = tuple(range(a.ndim)) + + def impl(a, axis=None): + if axis < 0: + axis = a.ndim + axis + + if axis < 0 or axis >= a.ndim: + raise ValueError("axis is out of bounds") + + # Short circuit 1-dimensional arrays: + if a.ndim == 1: + return flatten_impl(a) + + # Make chosen axis the last axis: + tmp = tuple_buffer + for i in range(axis, a.ndim - 1): + tmp = tuple_setitem(tmp, i, i + 1) + transpose_index = tuple_setitem(tmp, a.ndim - 1, axis) + transposed_arr = a.transpose(transpose_index) + + # Flatten along that axis; since we've transposed, we can just get + # batches off the overall flattened array. + m = transposed_arr.shape[-1] + raveled = transposed_arr.ravel() + assert raveled.size == a.size + assert transposed_arr.size % m == 0 + out = np.empty(transposed_arr.size // m, retty) + for i in range(out.size): + out[i] = flatten_impl(raveled[i * m:(i + 1) * m]) + + # Reshape based on axis we didn't flatten over: + return out.reshape(transposed_arr.shape[:-1]) + + return impl + + +@overload(np.argmax) +@overload_method(types.Array, "argmax") +def array_argmax(a, axis=None): + if isinstance(a.dtype, (types.NPDatetime, types.NPTimedelta)): + flatten_impl = array_argmax_impl_datetime + elif isinstance(a.dtype, types.Float): + flatten_impl = array_argmax_impl_float + else: + flatten_impl = array_argmax_impl_generic + + if is_nonelike(axis): + def array_argmax_impl(a, axis=None): + return flatten_impl(a) + else: + array_argmax_impl = build_argmax_or_argmin_with_axis_impl( + a, axis, flatten_impl + ) + return array_argmax_impl + + +@overload(np.all) +@overload_method(types.Array, "all") +def np_all(a): + def flat_all(a): + for v in np.nditer(a): + if not v.item(): + return False + return True + + return flat_all + + +@register_jitable +def _allclose_scalars(a_v, b_v, rtol=1e-05, atol=1e-08, equal_nan=False): + a_v_isnan = np.isnan(a_v) + b_v_isnan = np.isnan(b_v) + + # only one of the values is NaN and the + # other is not. + if ( (not a_v_isnan and b_v_isnan) or + (a_v_isnan and not b_v_isnan) ): + return False + + # either both of the values are NaN + # or both are numbers + if a_v_isnan and b_v_isnan: + if not equal_nan: + return False + else: + if np.isinf(a_v) or np.isinf(b_v): + return a_v == b_v + + if np.abs(a_v - b_v) > atol + rtol * np.abs(b_v * 1.0): + return False + + return True + + +@overload(np.allclose) +@overload_method(types.Array, "allclose") +def np_allclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + + if not type_can_asarray(a): + raise TypingError('The first argument "a" must be array-like') + + if not type_can_asarray(b): + raise TypingError('The second argument "b" must be array-like') + + if not isinstance(rtol, (float, types.Float)): + raise TypingError('The third argument "rtol" must be a ' + 'floating point') + + if not isinstance(atol, (float, types.Float)): + raise TypingError('The fourth argument "atol" must be a ' + 'floating point') + + if not isinstance(equal_nan, (bool, types.Boolean)): + raise TypingError('The fifth argument "equal_nan" must be a ' + 'boolean') + + is_a_scalar = isinstance(a, types.Number) + is_b_scalar = isinstance(b, types.Number) + + if is_a_scalar and is_b_scalar: + def np_allclose_impl_scalar_scalar(a, b, rtol=1e-05, atol=1e-08, + equal_nan=False): + return _allclose_scalars(a, b, rtol=rtol, atol=atol, + equal_nan=equal_nan) + return np_allclose_impl_scalar_scalar + elif is_a_scalar and not is_b_scalar: + def np_allclose_impl_scalar_array(a, b, rtol=1e-05, atol=1e-08, + equal_nan=False): + b = np.asarray(b) + for bv in np.nditer(b): + if not _allclose_scalars(a, bv.item(), rtol=rtol, atol=atol, + equal_nan=equal_nan): + return False + return True + return np_allclose_impl_scalar_array + elif not is_a_scalar and is_b_scalar: + def np_allclose_impl_array_scalar(a, b, rtol=1e-05, atol=1e-08, + equal_nan=False): + a = np.asarray(a) + for av in np.nditer(a): + if not _allclose_scalars(av.item(), b, rtol=rtol, atol=atol, + equal_nan=equal_nan): + return False + return True + return np_allclose_impl_array_scalar + elif not is_a_scalar and not is_b_scalar: + def np_allclose_impl_array_array(a, b, rtol=1e-05, atol=1e-08, + equal_nan=False): + a = np.asarray(a) + b = np.asarray(b) + a_a, b_b = np.broadcast_arrays(a, b) + + for av, bv in np.nditer((a_a, b_b)): + if not _allclose_scalars(av.item(), bv.item(), rtol=rtol, + atol=atol, equal_nan=equal_nan): + return False + + return True + + return np_allclose_impl_array_array + + +@overload(np.any) +@overload_method(types.Array, "any") +def np_any(a): + def flat_any(a): + for v in np.nditer(a): + if v.item(): + return True + return False + + return flat_any + + +@overload(np.average) +def np_average(a, axis=None, weights=None): + + if weights is None or isinstance(weights, types.NoneType): + def np_average_impl(a, axis=None, weights=None): + arr = np.asarray(a) + return np.mean(arr) + else: + if axis is None or isinstance(axis, types.NoneType): + def np_average_impl(a, axis=None, weights=None): + arr = np.asarray(a) + weights = np.asarray(weights) + + if arr.shape != weights.shape: + if axis is None: + raise TypeError( + "Numba does not support average when shapes of " + "a and weights differ.") + if weights.ndim != 1: + raise TypeError( + "1D weights expected when shapes of " + "a and weights differ.") + + scl = np.sum(weights) + if scl == 0.0: + raise ZeroDivisionError( + "Weights sum to zero, can't be normalized.") + + avg = np.sum(np.multiply(arr, weights)) / scl + return avg + else: + def np_average_impl(a, axis=None, weights=None): + raise TypeError("Numba does not support average with axis.") + + return np_average_impl + + +def get_isnan(dtype): + """ + A generic isnan() function + """ + if isinstance(dtype, (types.Float, types.Complex)): + return np.isnan + else: + @register_jitable + def _trivial_isnan(x): + return False + return _trivial_isnan + + +@overload(np.iscomplex) +def np_iscomplex(x): + if type_can_asarray(x): + # NumPy uses asanyarray here! + return lambda x: np.asarray(x).imag != 0 + return None + + +@overload(np.isreal) +def np_isreal(x): + if type_can_asarray(x): + # NumPy uses asanyarray here! + return lambda x: np.asarray(x).imag == 0 + return None + + +@overload(np.iscomplexobj) +def iscomplexobj(x): + # Implementation based on NumPy + # https://github.com/numpy/numpy/blob/d9b1e32cb8ef90d6b4a47853241db2a28146a57d/numpy/lib/type_check.py#L282-L320 + dt = determine_dtype(x) + if isinstance(x, types.Optional): + dt = determine_dtype(x.type) + iscmplx = np.issubdtype(dt, np.complexfloating) + + if isinstance(x, types.Optional): + def impl(x): + if x is None: + return False + return iscmplx + else: + def impl(x): + return iscmplx + return impl + + +@overload(np.isrealobj) +def isrealobj(x): + # Return True if x is not a complex type. + # Implementation based on NumPy + # https://github.com/numpy/numpy/blob/ccfbcc1cd9a4035a467f2e982a565ab27de25b6b/numpy/lib/type_check.py#L290-L322 + def impl(x): + return not np.iscomplexobj(x) + return impl + + +@overload(np.isscalar) +def np_isscalar(element): + res = type_is_scalar(element) + + def impl(element): + return res + return impl + + +def is_np_inf_impl(x, out, fn): + + # if/else branch should be unified after PR #5606 is merged + if is_nonelike(out): + def impl(x, out=None): + return np.logical_and(np.isinf(x), fn(np.signbit(x))) + else: + def impl(x, out=None): + return np.logical_and(np.isinf(x), fn(np.signbit(x)), out) + + return impl + + +@overload(np.isneginf) +def isneginf(x, out=None): + fn = register_jitable(lambda x: x) + return is_np_inf_impl(x, out, fn) + + +@overload(np.isposinf) +def isposinf(x, out=None): + fn = register_jitable(lambda x: ~x) + return is_np_inf_impl(x, out, fn) + + +@register_jitable +def less_than(a, b): + return a < b + + +@register_jitable +def greater_than(a, b): + return a > b + + +@register_jitable +def check_array(a): + if a.size == 0: + raise ValueError('zero-size array to reduction operation not possible') + + +def nan_min_max_factory(comparison_op, is_complex_dtype): + if is_complex_dtype: + def impl(a): + arr = np.asarray(a) + check_array(arr) + it = np.nditer(arr) + return_val = next(it).take(0) + for view in it: + v = view.item() + if np.isnan(return_val.real) and not np.isnan(v.real): + return_val = v + else: + if comparison_op(v.real, return_val.real): + return_val = v + elif v.real == return_val.real: + if comparison_op(v.imag, return_val.imag): + return_val = v + return return_val + else: + def impl(a): + arr = np.asarray(a) + check_array(arr) + it = np.nditer(arr) + return_val = next(it).take(0) + for view in it: + v = view.item() + if not np.isnan(v): + if not comparison_op(return_val, v): + return_val = v + return return_val + + return impl + + +real_nanmin = register_jitable( + nan_min_max_factory(less_than, is_complex_dtype=False) +) +real_nanmax = register_jitable( + nan_min_max_factory(greater_than, is_complex_dtype=False) +) +complex_nanmin = register_jitable( + nan_min_max_factory(less_than, is_complex_dtype=True) +) +complex_nanmax = register_jitable( + nan_min_max_factory(greater_than, is_complex_dtype=True) +) + + +@register_jitable +def _isclose_item(x, y, rtol, atol, equal_nan): + if np.isnan(x) and np.isnan(y): + return equal_nan + elif np.isinf(x) and np.isinf(y): + return (x > 0) == (y > 0) + elif np.isinf(x) or np.isinf(y): + return False + else: + return abs(x - y) <= atol + rtol * abs(y) + + +@overload(np.isclose) +def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + if not type_can_asarray(a): + raise TypingError('The first argument "a" must be array-like') + + if not type_can_asarray(b): + raise TypingError('The second argument "b" must be array-like') + + if not isinstance(rtol, (float, types.Float)): + raise TypingError('The third argument "rtol" must be a ' + 'floating point') + + if not isinstance(atol, (float, types.Float)): + raise TypingError('The fourth argument "atol" must be a ' + 'floating point') + + if not isinstance(equal_nan, (bool, types.Boolean)): + raise TypingError('The fifth argument "equal_nan" must be a ' + 'boolean') + + if isinstance(a, types.Array) and isinstance(b, types.Number): + def isclose_impl(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + x = a.reshape(-1) + y = b + out = np.zeros(len(x), np.bool_) + for i in range(len(out)): + out[i] = _isclose_item(x[i], y, rtol, atol, equal_nan) + return out.reshape(a.shape) + + elif isinstance(a, types.Number) and isinstance(b, types.Array): + def isclose_impl(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + x = a + y = b.reshape(-1) + out = np.zeros(len(y), np.bool_) + for i in range(len(out)): + out[i] = _isclose_item(x, y[i], rtol, atol, equal_nan) + return out.reshape(b.shape) + + elif isinstance(a, types.Array) and isinstance(b, types.Array): + def isclose_impl(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + shape = np.broadcast_shapes(a.shape, b.shape) + a_ = np.broadcast_to(a, shape) + b_ = np.broadcast_to(b, shape) + + out = np.zeros(len(a_), dtype=np.bool_) + for i, (av, bv) in enumerate(np.nditer((a_, b_))): + out[i] = _isclose_item(av.item(), bv.item(), rtol, atol, + equal_nan) + return np.broadcast_to(out, shape) + + else: + def isclose_impl(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + return _isclose_item(a, b, rtol, atol, equal_nan) + + return isclose_impl + + +@overload(np.nanmin) +def np_nanmin(a): + dt = determine_dtype(a) + if np.issubdtype(dt, np.complexfloating): + return complex_nanmin + else: + return real_nanmin + + +@overload(np.nanmax) +def np_nanmax(a): + dt = determine_dtype(a) + if np.issubdtype(dt, np.complexfloating): + return complex_nanmax + else: + return real_nanmax + + +@overload(np.nanmean) +def np_nanmean(a): + if not isinstance(a, types.Array): + return + isnan = get_isnan(a.dtype) + + def nanmean_impl(a): + c = 0.0 + count = 0 + for view in np.nditer(a): + v = view.item() + if not isnan(v): + c += v.item() + count += 1 + # np.divide() doesn't raise ZeroDivisionError + return np.divide(c, count) + + return nanmean_impl + + +@overload(np.nanvar) +def np_nanvar(a): + if not isinstance(a, types.Array): + return + isnan = get_isnan(a.dtype) + + def nanvar_impl(a): + # Compute the mean + m = np.nanmean(a) + + # Compute the sum of square diffs + ssd = 0.0 + count = 0 + for view in np.nditer(a): + v = view.item() + if not isnan(v): + val = (v.item() - m) + ssd += np.real(val * np.conj(val)) + count += 1 + # np.divide() doesn't raise ZeroDivisionError + return np.divide(ssd, count) + + return nanvar_impl + + +@overload(np.nanstd) +def np_nanstd(a): + if not isinstance(a, types.Array): + return + + def nanstd_impl(a): + return np.nanvar(a) ** 0.5 + + return nanstd_impl + + +@overload(np.nansum) +def np_nansum(a): + if not isinstance(a, types.Array): + return + if isinstance(a.dtype, types.Integer): + retty = types.intp + else: + retty = a.dtype + zero = retty(0) + isnan = get_isnan(a.dtype) + + def nansum_impl(a): + c = zero + for view in np.nditer(a): + v = view.item() + if not isnan(v): + c += v + return c + + return nansum_impl + + +@overload(np.nanprod) +def np_nanprod(a): + if not isinstance(a, types.Array): + return + if isinstance(a.dtype, types.Integer): + retty = types.intp + else: + retty = a.dtype + one = retty(1) + isnan = get_isnan(a.dtype) + + def nanprod_impl(a): + c = one + for view in np.nditer(a): + v = view.item() + if not isnan(v): + c *= v + return c + + return nanprod_impl + + +@overload(np.nancumprod) +def np_nancumprod(a): + if not isinstance(a, types.Array): + return + + if isinstance(a.dtype, (types.Boolean, types.Integer)): + # dtype cannot possibly contain NaN + return lambda a: np.cumprod(a) + else: + retty = a.dtype + is_nan = get_isnan(retty) + one = retty(1) + + def nancumprod_impl(a): + out = np.empty(a.size, retty) + c = one + for idx, v in enumerate(a.flat): + if ~is_nan(v): + c *= v + out[idx] = c + return out + + return nancumprod_impl + + +@overload(np.nancumsum) +def np_nancumsum(a): + if not isinstance(a, types.Array): + return + + if isinstance(a.dtype, (types.Boolean, types.Integer)): + # dtype cannot possibly contain NaN + return lambda a: np.cumsum(a) + else: + retty = a.dtype + is_nan = get_isnan(retty) + zero = retty(0) + + def nancumsum_impl(a): + out = np.empty(a.size, retty) + c = zero + for idx, v in enumerate(a.flat): + if ~is_nan(v): + c += v + out[idx] = c + return out + + return nancumsum_impl + + +@register_jitable +def prepare_ptp_input(a): + arr = _asarray(a) + if len(arr) == 0: + raise ValueError('zero-size array reduction not possible') + else: + return arr + + +def _compute_current_val_impl_gen(op, current_val, val): + if isinstance(current_val, types.Complex): + # The sort order for complex numbers is lexicographic. If both the + # real and imaginary parts are non-nan then the order is determined + # by the real parts except when they are equal, in which case the + # order is determined by the imaginary parts. + # https://github.com/numpy/numpy/blob/577a86e/numpy/core/fromnumeric.py#L874-L877 # noqa: E501 + def impl(current_val, val): + if op(val.real, current_val.real): + return val + elif (val.real == current_val.real + and op(val.imag, current_val.imag)): + return val + return current_val + else: + def impl(current_val, val): + return val if op(val, current_val) else current_val + return impl + + +def _compute_a_max(current_val, val): + pass + + +def _compute_a_min(current_val, val): + pass + + +@overload(_compute_a_max) +def _compute_a_max_impl(current_val, val): + return _compute_current_val_impl_gen(operator.gt, current_val, val) + + +@overload(_compute_a_min) +def _compute_a_min_impl(current_val, val): + return _compute_current_val_impl_gen(operator.lt, current_val, val) + + +def _early_return(val): + pass + + +@overload(_early_return) +def _early_return_impl(val): + UNUSED = 0 + if isinstance(val, types.Complex): + def impl(val): + if np.isnan(val.real): + if np.isnan(val.imag): + return True, np.nan + np.nan * 1j + else: + return True, np.nan + 0j + else: + return False, UNUSED + elif isinstance(val, types.Float): + def impl(val): + if np.isnan(val): + return True, np.nan + else: + return False, UNUSED + else: + def impl(val): + return False, UNUSED + return impl + + +@overload(np.ptp) +def np_ptp(a): + + if hasattr(a, 'dtype'): + if isinstance(a.dtype, types.Boolean): + raise TypingError("Boolean dtype is unsupported (as per NumPy)") + # Numpy raises a TypeError + + def np_ptp_impl(a): + arr = prepare_ptp_input(a) + + a_flat = arr.flat + a_min = a_flat[0] + a_max = a_flat[0] + + for i in range(arr.size): + val = a_flat[i] + take_branch, retval = _early_return(val) + if take_branch: + return retval + a_max = _compute_a_max(a_max, val) + a_min = _compute_a_min(a_min, val) + + return a_max - a_min + + return np_ptp_impl + + +if numpy_version < (2, 0): + overload_method(types.Array, 'ptp')(np_ptp) + +#---------------------------------------------------------------------------- +# Median and partitioning + + +@register_jitable +def nan_aware_less_than(a, b): + if np.isnan(a): + return False + else: + if np.isnan(b): + return True + else: + return a < b + + +def _partition_factory(pivotimpl, argpartition=False): + def _partition(A, low, high, I=None): + mid = (low + high) >> 1 + # NOTE: the pattern of swaps below for the pivot choice and the + # partitioning gives good results (i.e. regular O(n log n)) + # on sorted, reverse-sorted, and uniform arrays. Subtle changes + # risk breaking this property. + + # Use median of three {low, middle, high} as the pivot + if pivotimpl(A[mid], A[low]): + A[low], A[mid] = A[mid], A[low] + if argpartition: + I[low], I[mid] = I[mid], I[low] + if pivotimpl(A[high], A[mid]): + A[high], A[mid] = A[mid], A[high] + if argpartition: + I[high], I[mid] = I[mid], I[high] + if pivotimpl(A[mid], A[low]): + A[low], A[mid] = A[mid], A[low] + if argpartition: + I[low], I[mid] = I[mid], I[low] + pivot = A[mid] + + A[high], A[mid] = A[mid], A[high] + if argpartition: + I[high], I[mid] = I[mid], I[high] + i = low + j = high - 1 + while True: + while i < high and pivotimpl(A[i], pivot): + i += 1 + while j >= low and pivotimpl(pivot, A[j]): + j -= 1 + if i >= j: + break + A[i], A[j] = A[j], A[i] + if argpartition: + I[i], I[j] = I[j], I[i] + i += 1 + j -= 1 + # Put the pivot back in its final place (all items before `i` + # are smaller than the pivot, all items at/after `i` are larger) + A[i], A[high] = A[high], A[i] + if argpartition: + I[i], I[high] = I[high], I[i] + return i + return _partition + + +_partition = register_jitable(_partition_factory(less_than)) +_partition_w_nan = register_jitable(_partition_factory(nan_aware_less_than)) +_argpartition_w_nan = register_jitable(_partition_factory( + nan_aware_less_than, + argpartition=True) +) + + +def _select_factory(partitionimpl): + def _select(arry, k, low, high, idx=None): + """ + Select the k'th smallest element in array[low:high + 1]. + """ + i = partitionimpl(arry, low, high, idx) + while i != k: + if i < k: + low = i + 1 + i = partitionimpl(arry, low, high, idx) + else: + high = i - 1 + i = partitionimpl(arry, low, high, idx) + return arry[k] + return _select + + +_select = register_jitable(_select_factory(_partition)) +_select_w_nan = register_jitable(_select_factory(_partition_w_nan)) +_arg_select_w_nan = register_jitable(_select_factory(_argpartition_w_nan)) + + +@register_jitable +def _select_two(arry, k, low, high): + """ + Select the k'th and k+1'th smallest elements in array[low:high + 1]. + + This is significantly faster than doing two independent selections + for k and k+1. + """ + while True: + assert high > low # by construction + i = _partition(arry, low, high) + if i < k: + low = i + 1 + elif i > k + 1: + high = i - 1 + elif i == k: + _select(arry, k + 1, i + 1, high) + break + else: # i == k + 1 + _select(arry, k, low, i - 1) + break + + return arry[k], arry[k + 1] + + +@register_jitable +def _median_inner(temp_arry, n): + """ + The main logic of the median() call. *temp_arry* must be disposable, + as this function will mutate it. + """ + low = 0 + high = n - 1 + half = n >> 1 + if n & 1 == 0: + a, b = _select_two(temp_arry, half - 1, low, high) + return (a + b) / 2 + else: + return _select(temp_arry, half, low, high) + + +@overload(np.median) +def np_median(a): + if not isinstance(a, types.Array): + return + + def median_impl(a): + # np.median() works on the flattened array, and we need a temporary + # workspace anyway + temp_arry = a.flatten() + n = temp_arry.shape[0] + return _median_inner(temp_arry, n) + + return median_impl + + +@register_jitable +def _collect_percentiles_inner(a, q): + #TODO: This needs rewriting to be closer to NumPy, particularly the nan/inf + # handling which is generally subject to algorithmic changes. + n = len(a) + + if n == 1: + # single element array; output same for all percentiles + out = np.full(len(q), a[0], dtype=np.float64) + else: + out = np.empty(len(q), dtype=np.float64) + for i in range(len(q)): + percentile = q[i] + + # bypass pivoting where requested percentile is 100 + if percentile == 100: + val = np.max(a) + # heuristics to handle infinite values a la NumPy + if ~np.all(np.isfinite(a)): + if ~np.isfinite(val): + val = np.nan + + # bypass pivoting where requested percentile is 0 + elif percentile == 0: + val = np.min(a) + # convoluted heuristics to handle infinite values a la NumPy + if ~np.all(np.isfinite(a)): + num_pos_inf = np.sum(a == np.inf) + num_neg_inf = np.sum(a == -np.inf) + num_finite = n - (num_neg_inf + num_pos_inf) + if num_finite == 0: + val = np.nan + if num_pos_inf == 1 and n == 2: + val = np.nan + if num_neg_inf > 1: + val = np.nan + if num_finite == 1: + if num_pos_inf > 1: + if num_neg_inf != 1: + val = np.nan + + else: + # linear interp between closest ranks + rank = 1 + (n - 1) * np.true_divide(percentile, 100.0) + f = math.floor(rank) + m = rank - f + lower, upper = _select_two(a, k=int(f - 1), low=0, high=(n - 1)) + val = lower * (1 - m) + upper * m + out[i] = val + + return out + + +@register_jitable +def _can_collect_percentiles(a, nan_mask, skip_nan): + if skip_nan: + a = a[~nan_mask] + if len(a) == 0: + return False # told to skip nan, but no elements remain + else: + if np.any(nan_mask): + return False # told *not* to skip nan, but nan encountered + + if len(a) == 1: # single element array + val = a[0] + return np.isfinite(val) # can collect percentiles if element is finite + else: + return True + + +@register_jitable +def check_valid(q, q_upper_bound): + valid = True + + # avoid expensive reductions where possible + if q.ndim == 1 and q.size < 10: + for i in range(q.size): + if q[i] < 0.0 or q[i] > q_upper_bound or np.isnan(q[i]): + valid = False + break + else: + if np.any(np.isnan(q)) or np.any(q < 0.0) or np.any(q > q_upper_bound): + valid = False + + return valid + + +@register_jitable +def percentile_is_valid(q): + if not check_valid(q, q_upper_bound=100.0): + raise ValueError('Percentiles must be in the range [0, 100]') + + +@register_jitable +def quantile_is_valid(q): + if not check_valid(q, q_upper_bound=1.0): + raise ValueError('Quantiles must be in the range [0, 1]') + + +@register_jitable +def _collect_percentiles(a, q, check_q, factor, skip_nan): + q = np.asarray(q, dtype=np.float64).flatten() + check_q(q) + q = q * factor + + temp_arry = np.asarray(a, dtype=np.float64).flatten() + nan_mask = np.isnan(temp_arry) + + if _can_collect_percentiles(temp_arry, nan_mask, skip_nan): + temp_arry = temp_arry[~nan_mask] + out = _collect_percentiles_inner(temp_arry, q) + else: + out = np.full(len(q), np.nan) + + return out + + +def _percentile_quantile_inner(a, q, skip_nan, factor, check_q): + """ + The underlying algorithm to find percentiles and quantiles + is the same, hence we converge onto the same code paths + in this inner function implementation + """ + dt = determine_dtype(a) + if np.issubdtype(dt, np.complexfloating): + raise TypingError('Not supported for complex dtype') + # this could be supported, but would require a + # lexicographic comparison + + def np_percentile_q_scalar_impl(a, q): + return _collect_percentiles(a, q, check_q, factor, skip_nan)[0] + + def np_percentile_impl(a, q): + return _collect_percentiles(a, q, check_q, factor, skip_nan) + + if isinstance(q, (types.Number, types.Boolean)): + return np_percentile_q_scalar_impl + elif isinstance(q, types.Array) and q.ndim == 0: + return np_percentile_q_scalar_impl + else: + return np_percentile_impl + + +@overload(np.percentile) +def np_percentile(a, q): + return _percentile_quantile_inner( + a, q, skip_nan=False, factor=1.0, check_q=percentile_is_valid + ) + + +@overload(np.nanpercentile) +def np_nanpercentile(a, q): + return _percentile_quantile_inner( + a, q, skip_nan=True, factor=1.0, check_q=percentile_is_valid + ) + + +@overload(np.quantile) +def np_quantile(a, q): + return _percentile_quantile_inner( + a, q, skip_nan=False, factor=100.0, check_q=quantile_is_valid + ) + + +@overload(np.nanquantile) +def np_nanquantile(a, q): + return _percentile_quantile_inner( + a, q, skip_nan=True, factor=100.0, check_q=quantile_is_valid + ) + + +@overload(np.nanmedian) +def np_nanmedian(a): + if not isinstance(a, types.Array): + return + isnan = get_isnan(a.dtype) + + def nanmedian_impl(a): + # Create a temporary workspace with only non-NaN values + temp_arry = np.empty(a.size, a.dtype) + n = 0 + for view in np.nditer(a): + v = view.item() + if not isnan(v): + temp_arry[n] = v + n += 1 + + # all NaNs + if n == 0: + return np.nan + + return _median_inner(temp_arry, n) + + return nanmedian_impl + + +@register_jitable +def np_partition_impl_inner(a, kth_array): + + # allocate and fill empty array rather than copy a and mutate in place + # as the latter approach fails to preserve strides + out = np.empty_like(a) + + idx = np.ndindex(a.shape[:-1]) # Numpy default partition axis is -1 + for s in idx: + arry = a[s].copy() + low = 0 + high = len(arry) - 1 + + for kth in kth_array: + _select_w_nan(arry, kth, low, high) + low = kth # narrow span of subsequent partition + + out[s] = arry + return out + + +@register_jitable +def np_argpartition_impl_inner(a, kth_array): + + # allocate and fill empty array rather than copy a and mutate in place + # as the latter approach fails to preserve strides + out = np.empty_like(a, dtype=np.intp) + + idx = np.ndindex(a.shape[:-1]) # Numpy default partition axis is -1 + for s in idx: + arry = a[s].copy() + idx_arry = np.arange(len(arry)) + low = 0 + high = len(arry) - 1 + + for kth in kth_array: + _arg_select_w_nan(arry, kth, low, high, idx_arry) + low = kth # narrow span of subsequent partition + + out[s] = idx_arry + return out + + +@register_jitable +def valid_kths(a, kth): + """ + Returns a sorted, unique array of kth values which serve + as indexers for partitioning the input array, a. + + If the absolute value of any of the provided values + is greater than a.shape[-1] an exception is raised since + we are partitioning along the last axis (per Numpy default + behaviour). + + Values less than 0 are transformed to equivalent positive + index values. + """ + # cast boolean to int, where relevant + kth_array = _asarray(kth).astype(np.int64) + + if kth_array.ndim != 1: + raise ValueError('kth must be scalar or 1-D') + # numpy raises ValueError: object too deep for desired array + + if np.any(np.abs(kth_array) >= a.shape[-1]): + raise ValueError("kth out of bounds") + + out = np.empty_like(kth_array) + + for index, val in np.ndenumerate(kth_array): + if val < 0: + out[index] = val + a.shape[-1] # equivalent positive index + else: + out[index] = val + + return np.unique(out) + + +@overload(np.partition) +def np_partition(a, kth): + + if not isinstance(a, (types.Array, types.Sequence, types.Tuple)): + raise NumbaTypeError('The first argument must be an array-like') + + if isinstance(a, types.Array) and a.ndim == 0: + msg = 'The first argument must be at least 1-D (found 0-D)' + raise NumbaTypeError(msg) + + kthdt = getattr(kth, 'dtype', kth) + if not isinstance(kthdt, (types.Boolean, types.Integer)): + # bool gets cast to int subsequently + raise NumbaTypeError('Partition index must be integer') + + def np_partition_impl(a, kth): + a_tmp = _asarray(a) + if a_tmp.size == 0: + return a_tmp.copy() + else: + kth_array = valid_kths(a_tmp, kth) + return np_partition_impl_inner(a_tmp, kth_array) + + return np_partition_impl + + +@overload(np.argpartition) +def np_argpartition(a, kth): + + if not isinstance(a, (types.Array, types.Sequence, types.Tuple)): + raise NumbaTypeError('The first argument must be an array-like') + + if isinstance(a, types.Array) and a.ndim == 0: + msg = 'The first argument must be at least 1-D (found 0-D)' + raise NumbaTypeError(msg) + + kthdt = getattr(kth, 'dtype', kth) + if not isinstance(kthdt, (types.Boolean, types.Integer)): + # bool gets cast to int subsequently + raise NumbaTypeError('Partition index must be integer') + + def np_argpartition_impl(a, kth): + a_tmp = _asarray(a) + if a_tmp.size == 0: + return a_tmp.copy().astype('intp') + else: + kth_array = valid_kths(a_tmp, kth) + return np_argpartition_impl_inner(a_tmp, kth_array) + + return np_argpartition_impl + + +#---------------------------------------------------------------------------- +# Building matrices + +@register_jitable +def _tri_impl(N, M, k): + shape = max(0, N), max(0, M) # numpy floors each dimension at 0 + out = np.empty(shape, dtype=np.float64) # numpy default dtype + + for i in range(shape[0]): + m_max = min(max(0, i + k + 1), shape[1]) + out[i, :m_max] = 1 + out[i, m_max:] = 0 + + return out + + +@overload(np.tri) +def np_tri(N, M=None, k=0): + + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + def tri_impl(N, M=None, k=0): + if M is None: + M = N + return _tri_impl(N, M, k) + + return tri_impl + + +@register_jitable +def _make_square(m): + """ + Takes a 1d array and tiles it to form a square matrix + - i.e. a facsimile of np.tile(m, (len(m), 1)) + """ + assert m.ndim == 1 + + len_m = len(m) + out = np.empty((len_m, len_m), dtype=m.dtype) + + for i in range(len_m): + out[i] = m + + return out + + +@register_jitable +def np_tril_impl_2d(m, k=0): + mask = np.tri(m.shape[-2], M=m.shape[-1], k=k).astype(np.uint) + return np.where(mask, m, np.zeros_like(m, dtype=m.dtype)) + + +@overload(np.tril) +def my_tril(m, k=0): + + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + def np_tril_impl_1d(m, k=0): + m_2d = _make_square(m) + return np_tril_impl_2d(m_2d, k) + + def np_tril_impl_multi(m, k=0): + mask = np.tri(m.shape[-2], M=m.shape[-1], k=k).astype(np.uint) + idx = np.ndindex(m.shape[:-2]) + z = np.empty_like(m) + zero_opt = np.zeros_like(mask, dtype=m.dtype) + for sel in idx: + z[sel] = np.where(mask, m[sel], zero_opt) + return z + + if m.ndim == 1: + return np_tril_impl_1d + elif m.ndim == 2: + return np_tril_impl_2d + else: + return np_tril_impl_multi + + +@overload(np.tril_indices) +def np_tril_indices(n, k=0, m=None): + + # we require integer arguments, unlike numpy + check_is_integer(n, 'n') + check_is_integer(k, 'k') + if not is_nonelike(m): + check_is_integer(m, 'm') + + def np_tril_indices_impl(n, k=0, m=None): + return np.nonzero(np.tri(n, m, k=k)) + return np_tril_indices_impl + + +@overload(np.tril_indices_from) +def np_tril_indices_from(arr, k=0): + + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + if arr.ndim != 2: + raise TypingError("input array must be 2-d") + + def np_tril_indices_from_impl(arr, k=0): + return np.tril_indices(arr.shape[0], k=k, m=arr.shape[1]) + return np_tril_indices_from_impl + + +@register_jitable +def np_triu_impl_2d(m, k=0): + mask = np.tri(m.shape[-2], M=m.shape[-1], k=k - 1).astype(np.uint) + return np.where(mask, np.zeros_like(m, dtype=m.dtype), m) + + +@overload(np.triu) +def my_triu(m, k=0): + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + def np_triu_impl_1d(m, k=0): + m_2d = _make_square(m) + return np_triu_impl_2d(m_2d, k) + + def np_triu_impl_multi(m, k=0): + mask = np.tri(m.shape[-2], M=m.shape[-1], k=k - 1).astype(np.uint) + idx = np.ndindex(m.shape[:-2]) + z = np.empty_like(m) + zero_opt = np.zeros_like(mask, dtype=m.dtype) + for sel in idx: + z[sel] = np.where(mask, zero_opt, m[sel]) + return z + + if m.ndim == 1: + return np_triu_impl_1d + elif m.ndim == 2: + return np_triu_impl_2d + else: + return np_triu_impl_multi + + +@overload(np.triu_indices) +def np_triu_indices(n, k=0, m=None): + + # we require integer arguments, unlike numpy + check_is_integer(n, 'n') + check_is_integer(k, 'k') + if not is_nonelike(m): + check_is_integer(m, 'm') + + def np_triu_indices_impl(n, k=0, m=None): + return np.nonzero(1 - np.tri(n, m, k=k - 1)) + return np_triu_indices_impl + + +@overload(np.triu_indices_from) +def np_triu_indices_from(arr, k=0): + + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + if arr.ndim != 2: + raise TypingError("input array must be 2-d") + + def np_triu_indices_from_impl(arr, k=0): + return np.triu_indices(arr.shape[0], k=k, m=arr.shape[1]) + return np_triu_indices_from_impl + + +def _prepare_array(arr): + pass + + +@overload(_prepare_array) +def _prepare_array_impl(arr): + if arr in (None, types.none): + return lambda arr: np.array(()) + else: + return lambda arr: _asarray(arr).ravel() + + +def _dtype_of_compound(inobj): + obj = inobj + while True: + if isinstance(obj, (types.Number, types.Boolean)): + return as_dtype(obj) + l = getattr(obj, '__len__', None) + if l is not None and l() == 0: # empty tuple or similar + return np.float64 + dt = getattr(obj, 'dtype', None) + if dt is None: + raise NumbaTypeError("type has no dtype attr") + if isinstance(obj, types.Sequence): + obj = obj.dtype + else: + return as_dtype(dt) + + +@overload(np.ediff1d) +def np_ediff1d(ary, to_end=None, to_begin=None): + + if isinstance(ary, types.Array): + if isinstance(ary.dtype, types.Boolean): + raise NumbaTypeError("Boolean dtype is unsupported (as per NumPy)") + # Numpy tries to do this: return ary[1:] - ary[:-1] which + # results in a TypeError exception being raised + + # Check that to_end and to_begin are compatible with ary + ary_dt = _dtype_of_compound(ary) + to_begin_dt = None + if not (is_nonelike(to_begin)): + to_begin_dt = _dtype_of_compound(to_begin) + to_end_dt = None + if not (is_nonelike(to_end)): + to_end_dt = _dtype_of_compound(to_end) + + if to_begin_dt is not None and not np.can_cast(to_begin_dt, ary_dt): + msg = "dtype of to_begin must be compatible with input ary" + raise NumbaTypeError(msg) + + if to_end_dt is not None and not np.can_cast(to_end_dt, ary_dt): + msg = "dtype of to_end must be compatible with input ary" + raise NumbaTypeError(msg) + + def np_ediff1d_impl(ary, to_end=None, to_begin=None): + # transform each input into an equivalent 1d array + start = _prepare_array(to_begin) + mid = _prepare_array(ary) + end = _prepare_array(to_end) + + out_dtype = mid.dtype + # output array dtype determined by ary dtype, per NumPy + # (for the most part); an exception to the rule is a zero length + # array-like, where NumPy falls back to np.float64; this behaviour + # is *not* replicated + + if len(mid) > 0: + out = np.empty((len(start) + len(mid) + len(end) - 1), + dtype=out_dtype) + start_idx = len(start) + mid_idx = len(start) + len(mid) - 1 + out[:start_idx] = start + out[start_idx:mid_idx] = np.diff(mid) + out[mid_idx:] = end + else: + out = np.empty((len(start) + len(end)), dtype=out_dtype) + start_idx = len(start) + out[:start_idx] = start + out[start_idx:] = end + return out + + return np_ediff1d_impl + + +def _select_element(arr): + pass + + +@overload(_select_element) +def _select_element_impl(arr): + zerod = getattr(arr, 'ndim', None) == 0 + if zerod: + def impl(arr): + x = np.array((1,), dtype=arr.dtype) + x[:] = arr + return x[0] + return impl + else: + def impl(arr): + return arr + return impl + + +def _get_d(dx, x): + pass + + +@overload(_get_d) +def get_d_impl(x, dx): + if is_nonelike(x): + def impl(x, dx): + return np.asarray(dx) + else: + def impl(x, dx): + return np.diff(np.asarray(x)) + return impl + + +@overload(np.trapz) +def np_trapz(y, x=None, dx=1.0): + + if isinstance(y, (types.Number, types.Boolean)): + raise TypingError('y cannot be a scalar') + elif isinstance(y, types.Array) and y.ndim == 0: + raise TypingError('y cannot be 0D') + # NumPy raises IndexError: list assignment index out of range + + # inspired by: + # https://github.com/numpy/numpy/blob/7ee52003/numpy/lib/function_base.py#L4040-L4065 # noqa: E501 + def impl(y, x=None, dx=1.0): + yarr = np.asarray(y) + d = _get_d(x, dx) + y_ave = (yarr[..., slice(1, None)] + yarr[..., slice(None, -1)]) / 2.0 + ret = np.sum(d * y_ave, -1) + processed = _select_element(ret) + return processed + + return impl + + +# numpy 2.0 rename np.trapz to np.trapezoid +if numpy_version >= (2, 0): + overload(np.trapezoid)(np_trapz) + + +@register_jitable +def _np_vander(x, N, increasing, out): + """ + Generate an N-column Vandermonde matrix from a supplied 1-dimensional + array, x. Store results in an output matrix, out, which is assumed to + be of the required dtype. + + Values are accumulated using np.multiply to match the floating point + precision behaviour of numpy.vander. + """ + m, n = out.shape + assert m == len(x) + assert n == N + + if increasing: + for i in range(N): + if i == 0: + out[:, i] = 1 + else: + out[:, i] = np.multiply(x, out[:, (i - 1)]) + else: + for i in range(N - 1, -1, -1): + if i == N - 1: + out[:, i] = 1 + else: + out[:, i] = np.multiply(x, out[:, (i + 1)]) + + +@register_jitable +def _check_vander_params(x, N): + if x.ndim > 1: + raise ValueError('x must be a one-dimensional array or sequence.') + if N < 0: + raise ValueError('Negative dimensions are not allowed') + + +@overload(np.vander) +def np_vander(x, N=None, increasing=False): + if N not in (None, types.none): + if not isinstance(N, types.Integer): + raise TypingError('Second argument N must be None or an integer') + + def np_vander_impl(x, N=None, increasing=False): + if N is None: + N = len(x) + + _check_vander_params(x, N) + + # allocate output matrix using dtype determined in closure + out = np.empty((len(x), int(N)), dtype=dtype) + + _np_vander(x, N, increasing, out) + return out + + def np_vander_seq_impl(x, N=None, increasing=False): + if N is None: + N = len(x) + + x_arr = np.array(x) + _check_vander_params(x_arr, N) + + # allocate output matrix using dtype inferred when x_arr was created + out = np.empty((len(x), int(N)), dtype=x_arr.dtype) + + _np_vander(x_arr, N, increasing, out) + return out + + if isinstance(x, types.Array): + x_dt = as_dtype(x.dtype) + # replicate numpy behaviour w.r.t.type promotion + dtype = np.promote_types(x_dt, int) + return np_vander_impl + elif isinstance(x, (types.Tuple, types.Sequence)): + return np_vander_seq_impl + + +@overload(np.roll) +def np_roll(a, shift): + if not isinstance(shift, (types.Integer, types.Boolean)): + raise TypingError('shift must be an integer') + + def np_roll_impl(a, shift): + arr = np.asarray(a) + out = np.empty(arr.shape, dtype=arr.dtype) + # empty_like might result in different contiguity vs NumPy + + arr_flat = arr.flat + for i in range(arr.size): + idx = (i + shift) % arr.size + out.flat[idx] = arr_flat[i] + + return out + + if isinstance(a, (types.Number, types.Boolean)): + return lambda a, shift: np.asarray(a) + else: + return np_roll_impl + + +#---------------------------------------------------------------------------- +# Mathematical functions + +LIKELY_IN_CACHE_SIZE = 8 + + +@register_jitable +def binary_search_with_guess(key, arr, length, guess): + # NOTE: Do not refactor... see note in np_interp function impl below + # this is a facsimile of binary_search_with_guess prior to 1.15: + # https://github.com/numpy/numpy/blob/maintenance/1.15.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/3430d78c01a3b9a19adad75f1acb5ae18286da73/numpy/core/src/multiarray/compiled_base.c#L447 # noqa: E501 + imin = 0 + imax = length + + # Handle keys outside of the arr range first + if key > arr[length - 1]: + return length + elif key < arr[0]: + return -1 + + # If len <= 4 use linear search. + # From above we know key >= arr[0] when we start. + if length <= 4: + i = 1 + while i < length and key >= arr[i]: + i += 1 + return i - 1 + + if guess > length - 3: + guess = length - 3 + + if guess < 1: + guess = 1 + + # check most likely values: guess - 1, guess, guess + 1 + if key < arr[guess]: + if key < arr[guess - 1]: + imax = guess - 1 + + # last attempt to restrict search to items in cache + if guess > LIKELY_IN_CACHE_SIZE and \ + key >= arr[guess - LIKELY_IN_CACHE_SIZE]: + imin = guess - LIKELY_IN_CACHE_SIZE + else: + # key >= arr[guess - 1] + return guess - 1 + else: + # key >= arr[guess] + if key < arr[guess + 1]: + return guess + else: + # key >= arr[guess + 1] + if key < arr[guess + 2]: + return guess + 1 + else: + # key >= arr[guess + 2] + imin = guess + 2 + # last attempt to restrict search to items in cache + if (guess < (length - LIKELY_IN_CACHE_SIZE - 1)) and \ + (key < arr[guess + LIKELY_IN_CACHE_SIZE]): + imax = guess + LIKELY_IN_CACHE_SIZE + + # finally, find index by bisection + while imin < imax: + imid = imin + ((imax - imin) >> 1) + if key >= arr[imid]: + imin = imid + 1 + else: + imax = imid + + return imin - 1 + + +@register_jitable +def np_interp_impl_complex_inner(x, xp, fp, dtype): + # NOTE: Do not refactor... see note in np_interp function impl below + # this is a facsimile of arr_interp_complex post 1.16 with added + # branching to support np1.17 style NaN handling. + # https://github.com/numpy/numpy/blob/maintenance/1.16.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/971e2e89d08deeae0139d3011d15646fdac13c92/numpy/core/src/multiarray/compiled_base.c#L628 # noqa: E501 + dz = np.asarray(x) + dx = np.asarray(xp) + dy = np.asarray(fp) + + if len(dx) == 0: + raise ValueError('array of sample points is empty') + + if len(dx) != len(dy): + raise ValueError('fp and xp are not of the same size.') + + if dx.size == 1: + return np.full(dz.shape, fill_value=dy[0], dtype=dtype) + + dres = np.empty(dz.shape, dtype=dtype) + + lenx = dz.size + lenxp = len(dx) + lval = dy[0] + rval = dy[lenxp - 1] + + if lenxp == 1: + xp_val = dx[0] + fp_val = dy[0] + + for i in range(lenx): + x_val = dz.flat[i] + if x_val < xp_val: + dres.flat[i] = lval + elif x_val > xp_val: + dres.flat[i] = rval + else: + dres.flat[i] = fp_val + + else: + j = 0 + + # only pre-calculate slopes if there are relatively few of them. + if lenxp <= lenx: + slopes = np.empty((lenxp - 1), dtype=dtype) + else: + slopes = np.empty(0, dtype=dtype) + + if slopes.size: + for i in range(lenxp - 1): + inv_dx = 1 / (dx[i + 1] - dx[i]) + real = (dy[i + 1].real - dy[i].real) * inv_dx + imag = (dy[i + 1].imag - dy[i].imag) * inv_dx + slopes[i] = real + 1j * imag + + for i in range(lenx): + x_val = dz.flat[i] + + if np.isnan(x_val): + real = x_val + imag = 0.0 + dres.flat[i] = real + 1j * imag + continue + + j = binary_search_with_guess(x_val, dx, lenxp, j) + + if j == -1: + dres.flat[i] = lval + elif j == lenxp: + dres.flat[i] = rval + elif j == lenxp - 1: + dres.flat[i] = dy[j] + elif dx[j] == x_val: + # Avoid potential non-finite interpolation + dres.flat[i] = dy[j] + else: + if slopes.size: + slope = slopes[j] + else: + inv_dx = 1 / (dx[j + 1] - dx[j]) + real = (dy[j + 1].real - dy[j].real) * inv_dx + imag = (dy[j + 1].imag - dy[j].imag) * inv_dx + slope = real + 1j * imag + + # NumPy 1.17 handles NaN correctly - this is a copy of + # innermost part of arr_interp_complex post 1.17: + # https://github.com/numpy/numpy/blob/maintenance/1.17.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/91fbe4dde246559fa5b085ebf4bc268e2b89eea8/numpy/core/src/multiarray/compiled_base.c#L798-L812 # noqa: E501 + + # If we get NaN in one direction, try the other + real = slope.real * (x_val - dx[j]) + dy[j].real + if np.isnan(real): + real = slope.real * (x_val - dx[j + 1]) + dy[j + 1].real + if np.isnan(real) and dy[j].real == dy[j + 1].real: + real = dy[j].real + + imag = slope.imag * (x_val - dx[j]) + dy[j].imag + if np.isnan(imag): + imag = slope.imag * (x_val - dx[j + 1]) + dy[j + 1].imag + if np.isnan(imag) and dy[j].imag == dy[j + 1].imag: + imag = dy[j].imag + + dres.flat[i] = real + 1j * imag + + return dres + + +@register_jitable +def np_interp_impl_inner(x, xp, fp, dtype): + # NOTE: Do not refactor... see note in np_interp function impl below + # this is a facsimile of arr_interp post 1.16: + # https://github.com/numpy/numpy/blob/maintenance/1.16.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/971e2e89d08deeae0139d3011d15646fdac13c92/numpy/core/src/multiarray/compiled_base.c#L473 # noqa: E501 + dz = np.asarray(x, dtype=np.float64) + dx = np.asarray(xp, dtype=np.float64) + dy = np.asarray(fp, dtype=np.float64) + + if len(dx) == 0: + raise ValueError('array of sample points is empty') + + if len(dx) != len(dy): + raise ValueError('fp and xp are not of the same size.') + + if dx.size == 1: + return np.full(dz.shape, fill_value=dy[0], dtype=dtype) + + dres = np.empty(dz.shape, dtype=dtype) + + lenx = dz.size + lenxp = len(dx) + lval = dy[0] + rval = dy[lenxp - 1] + + if lenxp == 1: + xp_val = dx[0] + fp_val = dy[0] + + for i in range(lenx): + x_val = dz.flat[i] + if x_val < xp_val: + dres.flat[i] = lval + elif x_val > xp_val: + dres.flat[i] = rval + else: + dres.flat[i] = fp_val + + else: + j = 0 + + # only pre-calculate slopes if there are relatively few of them. + if lenxp <= lenx: + slopes = (dy[1:] - dy[:-1]) / (dx[1:] - dx[:-1]) + else: + slopes = np.empty(0, dtype=dtype) + + for i in range(lenx): + x_val = dz.flat[i] + + if np.isnan(x_val): + dres.flat[i] = x_val + continue + + j = binary_search_with_guess(x_val, dx, lenxp, j) + + if j == -1: + dres.flat[i] = lval + elif j == lenxp: + dres.flat[i] = rval + elif j == lenxp - 1: + dres.flat[i] = dy[j] + elif dx[j] == x_val: + # Avoid potential non-finite interpolation + dres.flat[i] = dy[j] + else: + if slopes.size: + slope = slopes[j] + else: + slope = (dy[j + 1] - dy[j]) / (dx[j + 1] - dx[j]) + + dres.flat[i] = slope * (x_val - dx[j]) + dy[j] + + # NOTE: this is in np1.17 + # https://github.com/numpy/numpy/blob/maintenance/1.17.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/91fbe4dde246559fa5b085ebf4bc268e2b89eea8/numpy/core/src/multiarray/compiled_base.c#L610-L616 # noqa: E501 + # + # If we get nan in one direction, try the other + if np.isnan(dres.flat[i]): + dres.flat[i] = slope * (x_val - dx[j + 1]) + dy[j + 1] # noqa: E501 + if np.isnan(dres.flat[i]) and dy[j] == dy[j + 1]: + dres.flat[i] = dy[j] + + return dres + + +@overload(np.interp) +def np_interp(x, xp, fp): + # Replicating basic interp is relatively simple, but matching the behaviour + # of NumPy for edge cases is really quite hard. After a couple of attempts + # to avoid translation of the C source it was deemed necessary. + + if hasattr(xp, 'ndim') and xp.ndim > 1: + raise TypingError('xp must be 1D') + if hasattr(fp, 'ndim') and fp.ndim > 1: + raise TypingError('fp must be 1D') + + complex_dtype_msg = ( + "Cannot cast array data from complex dtype to float64 dtype" + ) + + xp_dt = determine_dtype(xp) + if np.issubdtype(xp_dt, np.complexfloating): + raise TypingError(complex_dtype_msg) + + fp_dt = determine_dtype(fp) + dtype = np.result_type(fp_dt, np.float64) + + if np.issubdtype(dtype, np.complexfloating): + inner = np_interp_impl_complex_inner + else: + inner = np_interp_impl_inner + + def np_interp_impl(x, xp, fp): + return inner(x, xp, fp, dtype) + + def np_interp_scalar_impl(x, xp, fp): + return inner(x, xp, fp, dtype).flat[0] + + if isinstance(x, types.Number): + if isinstance(x, types.Complex): + raise TypingError(complex_dtype_msg) + return np_interp_scalar_impl + + return np_interp_impl + + +#---------------------------------------------------------------------------- +# Statistics + +@register_jitable +def row_wise_average(a): + assert a.ndim == 2 + + m, n = a.shape + out = np.empty((m, 1), dtype=a.dtype) + + for i in range(m): + out[i, 0] = np.sum(a[i, :]) / n + + return out + + +@register_jitable +def np_cov_impl_inner(X, bias, ddof): + + # determine degrees of freedom + if ddof is None: + if bias: + ddof = 0 + else: + ddof = 1 + + # determine the normalization factor + fact = X.shape[1] - ddof + + # numpy warns if less than 0 and floors at 0 + fact = max(fact, 0.0) + + # de-mean + X -= row_wise_average(X) + + # calculate result - requires blas + c = np.dot(X, np.conj(X.T)) + c *= np.true_divide(1, fact) + return c + + +def _prepare_cov_input_inner(): + pass + + +@overload(_prepare_cov_input_inner) +def _prepare_cov_input_impl(m, y, rowvar, dtype): + if y in (None, types.none): + def _prepare_cov_input_inner(m, y, rowvar, dtype): + m_arr = np.atleast_2d(_asarray(m)) + + if not rowvar: + m_arr = m_arr.T + + return m_arr + else: + def _prepare_cov_input_inner(m, y, rowvar, dtype): + m_arr = np.atleast_2d(_asarray(m)) + y_arr = np.atleast_2d(_asarray(y)) + + # transpose if asked to and not a (1, n) vector - this looks + # wrong as you might end up transposing one and not the other, + # but it's what numpy does + if not rowvar: + if m_arr.shape[0] != 1: + m_arr = m_arr.T + if y_arr.shape[0] != 1: + y_arr = y_arr.T + + m_rows, m_cols = m_arr.shape + y_rows, y_cols = y_arr.shape + + if m_cols != y_cols: + raise ValueError("m and y have incompatible dimensions") + + # allocate and fill output array + out = np.empty((m_rows + y_rows, m_cols), dtype=dtype) + out[:m_rows, :] = m_arr + out[-y_rows:, :] = y_arr + + return out + + return _prepare_cov_input_inner + + +@register_jitable +def _handle_m_dim_change(m): + if m.ndim == 2 and m.shape[0] == 1: + msg = ("2D array containing a single row is unsupported due to " + "ambiguity in type inference. To use numpy.cov in this case " + "simply pass the row as a 1D array, i.e. m[0].") + raise RuntimeError(msg) + + +_handle_m_dim_nop = register_jitable(lambda x: x) + + +def determine_dtype(array_like): + array_like_dt = np.float64 + if isinstance(array_like, types.Array): + array_like_dt = as_dtype(array_like.dtype) + elif isinstance(array_like, (types.Number, types.Boolean)): + array_like_dt = as_dtype(array_like) + elif isinstance(array_like, (types.UniTuple, types.Tuple)): + coltypes = set() + for val in array_like: + if hasattr(val, 'count'): + [coltypes.add(v) for v in val] + else: + coltypes.add(val) + if len(coltypes) > 1: + array_like_dt = np.promote_types(*[as_dtype(ty) for ty in coltypes]) + elif len(coltypes) == 1: + array_like_dt = as_dtype(coltypes.pop()) + + return array_like_dt + + +def check_dimensions(array_like, name): + if isinstance(array_like, types.Array): + if array_like.ndim > 2: + raise NumbaTypeError("{0} has more than 2 dimensions".format(name)) + elif isinstance(array_like, types.Sequence): + if isinstance(array_like.key[0], types.Sequence): + if isinstance(array_like.key[0].key[0], types.Sequence): + msg = "{0} has more than 2 dimensions".format(name) + raise NumbaTypeError(msg) + + +@register_jitable +def _handle_ddof(ddof): + if not np.isfinite(ddof): + raise ValueError('Cannot convert non-finite ddof to integer') + if ddof - int(ddof) != 0: + raise ValueError('ddof must be integral value') + + +_handle_ddof_nop = register_jitable(lambda x: x) + + +@register_jitable +def _prepare_cov_input(m, y, rowvar, dtype, ddof, _DDOF_HANDLER, + _M_DIM_HANDLER): + _M_DIM_HANDLER(m) + _DDOF_HANDLER(ddof) + return _prepare_cov_input_inner(m, y, rowvar, dtype) + + +def scalar_result_expected(mandatory_input, optional_input): + opt_is_none = optional_input in (None, types.none) + + if isinstance(mandatory_input, types.Array) and mandatory_input.ndim == 1: + return opt_is_none + + if isinstance(mandatory_input, types.BaseTuple): + if all(isinstance(x, (types.Number, types.Boolean)) + for x in mandatory_input.types): + return opt_is_none + else: + if (len(mandatory_input.types) == 1 and + isinstance(mandatory_input.types[0], types.BaseTuple)): + return opt_is_none + + if isinstance(mandatory_input, (types.Number, types.Boolean)): + return opt_is_none + + if isinstance(mandatory_input, types.Sequence): + if (not isinstance(mandatory_input.key[0], types.Sequence) and + opt_is_none): + return True + + return False + + +@register_jitable +def _clip_corr(x): + return np.where(np.fabs(x) > 1, np.sign(x), x) + + +@register_jitable +def _clip_complex(x): + real = _clip_corr(x.real) + imag = _clip_corr(x.imag) + return real + 1j * imag + + +@overload(np.cov) +def np_cov(m, y=None, rowvar=True, bias=False, ddof=None): + + # reject problem if m and / or y are more than 2D + check_dimensions(m, 'm') + check_dimensions(y, 'y') + + # reject problem if ddof invalid (either upfront if type is + # obviously invalid, or later if value found to be non-integral) + if ddof in (None, types.none): + _DDOF_HANDLER = _handle_ddof_nop + else: + if isinstance(ddof, (types.Integer, types.Boolean)): + _DDOF_HANDLER = _handle_ddof_nop + elif isinstance(ddof, types.Float): + _DDOF_HANDLER = _handle_ddof + else: + raise TypingError('ddof must be a real numerical scalar type') + + # special case for 2D array input with 1 row of data - select + # handler function which we'll call later when we have access + # to the shape of the input array + _M_DIM_HANDLER = _handle_m_dim_nop + if isinstance(m, types.Array): + _M_DIM_HANDLER = _handle_m_dim_change + + # infer result dtype + m_dt = determine_dtype(m) + y_dt = determine_dtype(y) + dtype = np.result_type(m_dt, y_dt, np.float64) + + def np_cov_impl(m, y=None, rowvar=True, bias=False, ddof=None): + X = _prepare_cov_input(m, y, rowvar, dtype, ddof, _DDOF_HANDLER, + _M_DIM_HANDLER).astype(dtype) + + if np.any(np.array(X.shape) == 0): + return np.full((X.shape[0], X.shape[0]), fill_value=np.nan, + dtype=dtype) + else: + return np_cov_impl_inner(X, bias, ddof) + + def np_cov_impl_single_variable(m, y=None, rowvar=True, bias=False, + ddof=None): + X = _prepare_cov_input(m, y, rowvar, ddof, dtype, _DDOF_HANDLER, + _M_DIM_HANDLER).astype(dtype) + + if np.any(np.array(X.shape) == 0): + variance = np.nan + else: + variance = np_cov_impl_inner(X, bias, ddof).flat[0] + + return np.array(variance) + + if scalar_result_expected(m, y): + return np_cov_impl_single_variable + else: + return np_cov_impl + + +@overload(np.corrcoef) +def np_corrcoef(x, y=None, rowvar=True): + + x_dt = determine_dtype(x) + y_dt = determine_dtype(y) + dtype = np.result_type(x_dt, y_dt, np.float64) + + if dtype == np.complex128: + clip_fn = _clip_complex + else: + clip_fn = _clip_corr + + def np_corrcoef_impl(x, y=None, rowvar=True): + c = np.cov(x, y, rowvar) + d = np.diag(c) + stddev = np.sqrt(d.real) + + for i in range(c.shape[0]): + c[i, :] /= stddev + c[:, i] /= stddev + + return clip_fn(c) + + def np_corrcoef_impl_single_variable(x, y=None, rowvar=True): + c = np.cov(x, y, rowvar) + return c / c + + if scalar_result_expected(x, y): + return np_corrcoef_impl_single_variable + else: + return np_corrcoef_impl + + +#---------------------------------------------------------------------------- +# Element-wise computations + + +@overload(np.argwhere) +def np_argwhere(a): + # needs to be much more array-like for the array impl to work, Numba bug + # in one of the underlying function calls? + + use_scalar = isinstance(a, (types.Number, types.Boolean)) + if type_can_asarray(a) and not use_scalar: + def impl(a): + arr = np.asarray(a) + if arr.shape == (): + return np.zeros((0, 1), dtype=types.intp) + return np.transpose(np.vstack(np.nonzero(arr))) + else: + falseish = (0, 0) + trueish = (1, 0) + + def impl(a): + if a is not None and bool(a): + return np.zeros(trueish, dtype=types.intp) + else: + return np.zeros(falseish, dtype=types.intp) + + return impl + + +@overload(np.flatnonzero) +def np_flatnonzero(a): + + if type_can_asarray(a): + def impl(a): + arr = np.asarray(a) + return np.nonzero(np.ravel(arr))[0] + else: + def impl(a): + if a is not None and bool(a): + data = [0] + else: + data = [x for x in range(0)] + return np.array(data, dtype=types.intp) + + return impl + + +@register_jitable +def _fill_diagonal_params(a, wrap): + if a.ndim == 2: + m = a.shape[0] + n = a.shape[1] + step = 1 + n + if wrap: + end = n * m + else: + end = n * min(m, n) + else: + shape = np.array(a.shape) + + if not np.all(np.diff(shape) == 0): + raise ValueError("All dimensions of input must be of equal length") + + step = 1 + (np.cumprod(shape[:-1])).sum() + end = shape.prod() + + return end, step + + +@register_jitable +def _fill_diagonal_scalar(a, val, wrap): + end, step = _fill_diagonal_params(a, wrap) + + for i in range(0, end, step): + a.flat[i] = val + + +@register_jitable +def _fill_diagonal(a, val, wrap): + end, step = _fill_diagonal_params(a, wrap) + ctr = 0 + v_len = len(val) + + for i in range(0, end, step): + a.flat[i] = val[ctr] + ctr += 1 + ctr = ctr % v_len + + +@register_jitable +def _check_val_int(a, val): + iinfo = np.iinfo(a.dtype) + v_min = iinfo.min + v_max = iinfo.max + + # check finite values are within bounds + if np.any(~np.isfinite(val)) or np.any(val < v_min) or np.any(val > v_max): + raise ValueError('Unable to safely conform val to a.dtype') + + +@register_jitable +def _check_val_float(a, val): + finfo = np.finfo(a.dtype) + v_min = finfo.min + v_max = finfo.max + + # check finite values are within bounds + finite_vals = val[np.isfinite(val)] + if np.any(finite_vals < v_min) or np.any(finite_vals > v_max): + raise ValueError('Unable to safely conform val to a.dtype') + + +# no check performed, needed for pathway where no check is required +_check_nop = register_jitable(lambda x, y: x) + + +def _asarray(x): + pass + + +@overload(_asarray) +def _asarray_impl(x): + if isinstance(x, types.Array): + return lambda x: x + elif isinstance(x, (types.Sequence, types.Tuple)): + return lambda x: np.array(x) + elif isinstance(x, (types.Number, types.Boolean)): + ty = as_dtype(x) + return lambda x: np.array([x], dtype=ty) + + +@overload(np.fill_diagonal) +def np_fill_diagonal(a, val, wrap=False): + + if a.ndim > 1: + # the following can be simplified after #3088; until then, employ + # a basic mechanism for catching cases where val is of a type/value + # which cannot safely be cast to a.dtype + if isinstance(a.dtype, types.Integer): + checker = _check_val_int + elif isinstance(a.dtype, types.Float): + checker = _check_val_float + else: + checker = _check_nop + + def scalar_impl(a, val, wrap=False): + tmpval = _asarray(val).flatten() + checker(a, tmpval) + _fill_diagonal_scalar(a, val, wrap) + + def non_scalar_impl(a, val, wrap=False): + tmpval = _asarray(val).flatten() + checker(a, tmpval) + _fill_diagonal(a, tmpval, wrap) + + if isinstance(val, (types.Float, types.Integer, types.Boolean)): + return scalar_impl + elif isinstance(val, (types.Tuple, types.Sequence, types.Array)): + return non_scalar_impl + else: + msg = "The first argument must be at least 2-D (found %s-D)" % a.ndim + raise TypingError(msg) + + +def _np_round_intrinsic(tp): + # np.round() always rounds half to even + return "llvm.rint.f%d" % (tp.bitwidth,) + + +@intrinsic +def _np_round_float(typingctx, val): + sig = val(val) + + def codegen(context, builder, sig, args): + [val] = args + tp = sig.args[0] + llty = context.get_value_type(tp) + module = builder.module + fnty = llvmlite.ir.FunctionType(llty, [llty]) + fn = cgutils.get_or_insert_function(module, fnty, + _np_round_intrinsic(tp)) + res = builder.call(fn, (val,)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + return sig, codegen + + +@register_jitable +def round_ndigits(x, ndigits): + if math.isinf(x) or math.isnan(x): + return x + + # NOTE: this is CPython's algorithm, but perhaps this is overkill + # when emulating Numpy's behaviour. + if ndigits >= 0: + if ndigits > 22: + # pow1 and pow2 are each safe from overflow, but + # pow1*pow2 ~= pow(10.0, ndigits) might overflow. + pow1 = 10.0 ** (ndigits - 22) + pow2 = 1e22 + else: + pow1 = 10.0 ** ndigits + pow2 = 1.0 + y = (x * pow1) * pow2 + if math.isinf(y): + return x + return (_np_round_float(y) / pow2) / pow1 + + else: + pow1 = 10.0 ** (-ndigits) + y = x / pow1 + return _np_round_float(y) * pow1 + + +@overload(np.around) +@overload(np.round) +def impl_np_round(a, decimals=0, out=None): + if not type_can_asarray(a): + raise TypingError('The argument "a" must be array-like') + + if not (isinstance(out, types.Array) or is_nonelike(out)): + msg = 'The argument "out" must be an array if it is provided' + raise TypingError(msg) + + if isinstance(a, (types.Float, types.Integer, types.Complex)): + if is_nonelike(out): + if isinstance(a, types.Float): + def impl(a, decimals=0, out=None): + if decimals == 0: + return _np_round_float(a) + else: + return round_ndigits(a, decimals) + return impl + elif isinstance(a, types.Integer): + def impl(a, decimals=0, out=None): + if decimals == 0: + return a + else: + return int(round_ndigits(a, decimals)) + return impl + elif isinstance(a, types.Complex): + def impl(a, decimals=0, out=None): + if decimals == 0: + real = _np_round_float(a.real) + imag = _np_round_float(a.imag) + else: + real = round_ndigits(a.real, decimals) + imag = round_ndigits(a.imag, decimals) + return complex(real, imag) + return impl + else: + def impl(a, decimals=0, out=None): + out[0] = np.round(a, decimals) + return out + return impl + elif isinstance(a, types.Array): + if is_nonelike(out): + def impl(a, decimals=0, out=None): + out = np.empty_like(a) + return np.round(a, decimals, out) + return impl + else: + def impl(a, decimals=0, out=None): + if a.shape != out.shape: + raise ValueError("invalid output shape") + for index, val in np.ndenumerate(a): + out[index] = np.round(val, decimals) + return out + return impl + + +if numpy_version < (2, 0): + overload(np.round_)(impl_np_round) + + +@overload(np.sinc) +def impl_np_sinc(x): + if isinstance(x, types.Number): + def impl(x): + if x == 0.e0: # to match np impl + x = 1e-20 + x *= np.pi # np sinc is the normalised variant + return np.sin(x) / x + return impl + elif isinstance(x, types.Array): + def impl(x): + out = np.zeros_like(x) + for index, val in np.ndenumerate(x): + out[index] = np.sinc(val) + return out + return impl + else: + raise NumbaTypeError('Argument "x" must be a Number or array-like.') + + +@overload(np.angle) +def ov_np_angle(z, deg=False): + deg_mult = float(180 / np.pi) + + # non-complex scalar values are accepted as well + if isinstance(z, types.Number): + def impl(z, deg=False): + if deg: + return np.arctan2(z.imag, z.real) * deg_mult + else: + return np.arctan2(z.imag, z.real) + return impl + elif isinstance(z, types.Array): + dtype = z.dtype + + if isinstance(dtype, types.Complex): + ret_dtype = dtype.underlying_float + elif isinstance(dtype, types.Float): + ret_dtype = dtype + else: + return + + def impl(z, deg=False): + out = np.zeros_like(z, dtype=ret_dtype) + for index, val in np.ndenumerate(z): + out[index] = np.angle(val, deg) + return out + return impl + else: + raise NumbaTypeError('Argument "z" must be a complex ' + f'or Array[complex]. Got {z}') + + +@lower_builtin(np.nonzero, types.Array) +@lower_builtin("array.nonzero", types.Array) +def array_nonzero(context, builder, sig, args): + aryty = sig.args[0] + # Return type is a N-tuple of 1D C-contiguous arrays + retty = sig.return_type + outaryty = retty.dtype + nouts = retty.count + + ary = make_array(aryty)(context, builder, args[0]) + shape = cgutils.unpack_tuple(builder, ary.shape) + strides = cgutils.unpack_tuple(builder, ary.strides) + data = ary.data + layout = aryty.layout + + # First count the number of non-zero elements + zero = context.get_constant(types.intp, 0) + one = context.get_constant(types.intp, 1) + count = cgutils.alloca_once_value(builder, zero) + with cgutils.loop_nest(builder, shape, zero.type) as indices: + ptr = cgutils.get_item_pointer2(context, builder, data, shape, strides, + layout, indices) + val = load_item(context, builder, aryty, ptr) + nz = context.is_true(builder, aryty.dtype, val) + with builder.if_then(nz): + builder.store(builder.add(builder.load(count), one), count) + + # Then allocate output arrays of the right size + out_shape = (builder.load(count),) + outs = [_empty_nd_impl(context, builder, outaryty, out_shape)._getvalue() + for i in range(nouts)] + outarys = [make_array(outaryty)(context, builder, out) for out in outs] + out_datas = [out.data for out in outarys] + + # And fill them up + index = cgutils.alloca_once_value(builder, zero) + with cgutils.loop_nest(builder, shape, zero.type) as indices: + ptr = cgutils.get_item_pointer2(context, builder, data, shape, strides, + layout, indices) + val = load_item(context, builder, aryty, ptr) + nz = context.is_true(builder, aryty.dtype, val) + with builder.if_then(nz): + # Store element indices in output arrays + if not indices: + # For a 0-d array, store 0 in the unique output array + indices = (zero,) + cur = builder.load(index) + for i in range(nouts): + ptr = cgutils.get_item_pointer2(context, builder, out_datas[i], + out_shape, (), + 'C', [cur]) + store_item(context, builder, outaryty, indices[i], ptr) + builder.store(builder.add(cur, one), index) + + tup = context.make_tuple(builder, sig.return_type, outs) + return impl_ret_new_ref(context, builder, sig.return_type, tup) + + +def _where_zero_size_array_impl(dtype): + def impl(condition, x, y): + x_ = np.asarray(x).astype(dtype) + y_ = np.asarray(y).astype(dtype) + return x_ if condition else y_ + return impl + + +@register_jitable +def _where_generic_inner_impl(cond, x, y, res): + for idx, c in np.ndenumerate(cond): + res[idx] = x[idx] if c else y[idx] + return res + + +@register_jitable +def _where_fast_inner_impl(cond, x, y, res): + cf = cond.flat + xf = x.flat + yf = y.flat + rf = res.flat + for i in range(cond.size): + rf[i] = xf[i] if cf[i] else yf[i] + return res + + +def _where_generic_impl(dtype, layout): + use_faster_impl = layout in [{'C'}, {'F'}] + + def impl(condition, x, y): + cond1, x1, y1 = np.asarray(condition), np.asarray(x), np.asarray(y) + shape = np.broadcast_shapes(cond1.shape, x1.shape, y1.shape) + cond_ = np.broadcast_to(cond1, shape) + x_ = np.broadcast_to(x1, shape) + y_ = np.broadcast_to(y1, shape) + + if layout == 'F': + res = np.empty(shape[::-1], dtype=dtype).T + else: + res = np.empty(shape, dtype=dtype) + + if use_faster_impl: + return _where_fast_inner_impl(cond_, x_, y_, res) + else: + return _where_generic_inner_impl(cond_, x_, y_, res) + + return impl + + +@overload(np.where) +def ov_np_where(condition): + if not type_can_asarray(condition): + msg = 'The argument "condition" must be array-like' + raise NumbaTypeError(msg) + + def where_cond_none_none(condition): + return np.asarray(condition).nonzero() + return where_cond_none_none + + +@overload(np.where) +def ov_np_where_x_y(condition, x, y): + if not type_can_asarray(condition): + msg = 'The argument "condition" must be array-like' + raise NumbaTypeError(msg) + + # corner case: None is a valid value for np.where: + # >>> np.where([0, 1], None, 2) + # array([None, 2]) + # + # >>> np.where([0, 1], 2, None) + # array([2, None]) + # + # >>> np.where([0, 1], None, None) + # array([None, None]) + if is_nonelike(x) or is_nonelike(y): + # skip it for now as np.asarray(None) is not supported + raise NumbaTypeError('Argument "x" or "y" cannot be None') + + for arg, name in zip((x, y), ('x', 'y')): + if not type_can_asarray(arg): + msg = 'The argument "{}" must be array-like if provided' + raise NumbaTypeError(msg.format(name)) + + cond_arr = isinstance(condition, types.Array) + x_arr = isinstance(x, types.Array) + y_arr = isinstance(y, types.Array) + + if cond_arr: + x_dt = determine_dtype(x) + y_dt = determine_dtype(y) + dtype = np.promote_types(x_dt, y_dt) + + # corner case - 0 dim values + def check_0_dim(arg): + return isinstance(arg, types.Number) or ( + isinstance(arg, types.Array) and arg.ndim == 0) + special_0_case = all([check_0_dim(a) for a in (condition, x, y)]) + if special_0_case: + return _where_zero_size_array_impl(dtype) + + layout = condition.layout + if x_arr and y_arr: + if x.layout == y.layout == condition.layout: + layout = x.layout + else: + layout = 'A' + return _where_generic_impl(dtype, layout) + else: + def impl(condition, x, y): + return np.where(np.asarray(condition), np.asarray(x), np.asarray(y)) + return impl + + +@overload(np.real) +def np_real(val): + def np_real_impl(val): + return val.real + + return np_real_impl + + +@overload(np.imag) +def np_imag(val): + def np_imag_impl(val): + return val.imag + + return np_imag_impl + + +#---------------------------------------------------------------------------- +# Misc functions + +@overload(operator.contains) +def np_contains(arr, key): + if not isinstance(arr, types.Array): + return + + def np_contains_impl(arr, key): + for x in np.nditer(arr): + if x == key: + return True + return False + + return np_contains_impl + + +@overload(np.count_nonzero) +def np_count_nonzero(a, axis=None): + if not type_can_asarray(a): + raise TypingError("The argument to np.count_nonzero must be array-like") + + if is_nonelike(axis): + def impl(a, axis=None): + arr2 = np.ravel(a) + return np.sum(arr2 != 0) + return impl + else: + def impl(a, axis=None): + arr2 = a.astype(np.bool_) + return np.sum(arr2, axis=axis) + return impl + + +np_delete_handler_isslice = register_jitable(lambda x : x) +np_delete_handler_isarray = register_jitable(lambda x : np.asarray(x)) + + +@overload(np.delete) +def np_delete(arr, obj): + # Implementation based on numpy + # https://github.com/numpy/numpy/blob/af66e487a57bfd4850f4306e3b85d1dac3c70412/numpy/lib/function_base.py#L4065-L4267 # noqa: E501 + + if not isinstance(arr, (types.Array, types.Sequence)): + raise TypingError("arr must be either an Array or a Sequence") + + if isinstance(obj, (types.Array, types.Sequence, types.SliceType)): + if isinstance(obj, (types.SliceType)): + handler = np_delete_handler_isslice + else: + if not isinstance(obj.dtype, types.Integer): + raise TypingError('obj should be of Integer dtype') + handler = np_delete_handler_isarray + + def np_delete_impl(arr, obj): + arr = np.ravel(np.asarray(arr)) + N = arr.size + + keep = np.ones(N, dtype=np.bool_) + obj = handler(obj) + keep[obj] = False + return arr[keep] + return np_delete_impl + + else: # scalar value + if not isinstance(obj, types.Integer): + raise TypingError('obj should be of Integer dtype') + + def np_delete_scalar_impl(arr, obj): + arr = np.ravel(np.asarray(arr)) + N = arr.size + pos = obj + + if (pos < -N or pos >= N): + raise IndexError('obj must be less than the len(arr)') + # NumPy raises IndexError: index 'i' is out of + # bounds for axis 'x' with size 'n' + + if (pos < 0): + pos += N + + return np.concatenate((arr[:pos], arr[pos + 1:])) + return np_delete_scalar_impl + + +@overload(np.diff) +def np_diff_impl(a, n=1): + if not isinstance(a, types.Array) or a.ndim == 0: + return + + def diff_impl(a, n=1): + if n == 0: + return a.copy() + if n < 0: + raise ValueError("diff(): order must be non-negative") + size = a.shape[-1] + out_shape = a.shape[:-1] + (max(size - n, 0),) + out = np.empty(out_shape, a.dtype) + if out.size == 0: + return out + + # np.diff() works on each last dimension subarray independently. + # To make things easier, normalize input and output into 2d arrays + a2 = a.reshape((-1, size)) + out2 = out.reshape((-1, out.shape[-1])) + # A scratchpad for subarrays + work = np.empty(size, a.dtype) + + for major in range(a2.shape[0]): + # First iteration: diff a2 into work + for i in range(size - 1): + work[i] = a2[major, i + 1] - a2[major, i] + # Other iterations: diff work into itself + for niter in range(1, n): + for i in range(size - niter - 1): + work[i] = work[i + 1] - work[i] + # Copy final diff into out2 + out2[major] = work[:size - n] + + return out + + return diff_impl + + +@overload(np.array_equal) +def np_array_equal(a1, a2): + + if not (type_can_asarray(a1) and type_can_asarray(a2)): + raise TypingError('Both arguments to "array_equals" must be array-like') + + accepted = (types.Boolean, types.Number) + if isinstance(a1, accepted) and isinstance(a2, accepted): + # special case + def impl(a1, a2): + return a1 == a2 + else: + def impl(a1, a2): + a = np.asarray(a1) + b = np.asarray(a2) + if a.shape == b.shape: + return np.all(a == b) + return False + + return impl + + +@overload(np.intersect1d) +def jit_np_intersect1d(ar1, ar2, assume_unique=False): + # Not implemented to support return_indices + # https://github.com/numpy/numpy/blob/v1.19.0/numpy/lib + # /arraysetops.py#L347-L441 + if not (type_can_asarray(ar1) or type_can_asarray(ar2)): + raise TypingError('intersect1d: first two args must be array-like') + if not isinstance(assume_unique, (types.Boolean, bool)): + raise TypingError('intersect1d: ' + 'argument "assume_unique" must be boolean') + + def np_intersects1d_impl(ar1, ar2, assume_unique=False): + ar1 = np.asarray(ar1) + ar2 = np.asarray(ar2) + + if not assume_unique: + ar1 = np.unique(ar1) + ar2 = np.unique(ar2) + else: + ar1 = ar1.ravel() + ar2 = ar2.ravel() + + aux = np.concatenate((ar1, ar2)) + aux.sort() + mask = aux[1:] == aux[:-1] + int1d = aux[:-1][mask] + return int1d + return np_intersects1d_impl + + +def validate_1d_array_like(func_name, seq): + if isinstance(seq, types.Array): + if seq.ndim != 1: + raise NumbaTypeError("{0}(): input should have dimension 1" + .format(func_name)) + elif not isinstance(seq, types.Sequence): + raise NumbaTypeError("{0}(): input should be an array or sequence" + .format(func_name)) + + +@overload(np.bincount) +def np_bincount(a, weights=None, minlength=0): + validate_1d_array_like("bincount", a) + + if not isinstance(a.dtype, types.Integer): + return + + check_is_integer(minlength, 'minlength') + + if weights not in (None, types.none): + validate_1d_array_like("bincount", weights) + # weights is promoted to double in C impl + # https://github.com/numpy/numpy/blob/maintenance/1.16.x/numpy/core/src/multiarray/compiled_base.c#L93-L95 # noqa: E501 + out_dtype = np.float64 + + @register_jitable + def validate_inputs(a, weights, minlength): + if len(a) != len(weights): + raise ValueError("bincount(): weights and list don't have " + "the same length") + + @register_jitable + def count_item(out, idx, val, weights): + out[val] += weights[idx] + + else: + out_dtype = types.intp + + @register_jitable + def validate_inputs(a, weights, minlength): + pass + + @register_jitable + def count_item(out, idx, val, weights): + out[val] += 1 + + def bincount_impl(a, weights=None, minlength=0): + validate_inputs(a, weights, minlength) + if minlength < 0: + raise ValueError("'minlength' must not be negative") + + n = len(a) + a_max = a[0] if n > 0 else -1 + for i in range(1, n): + if a[i] < 0: + raise ValueError("bincount(): first argument must be " + "non-negative") + a_max = max(a_max, a[i]) + + out_length = max(a_max + 1, minlength) + out = np.zeros(out_length, out_dtype) + for i in range(n): + count_item(out, i, a[i], weights) + return out + + return bincount_impl + + +less_than_float = register_jitable(lt_floats) +less_than_complex = register_jitable(lt_complex) + + +@register_jitable +def less_than_or_equal_complex(a, b): + if np.isnan(a.real): + if np.isnan(b.real): + if np.isnan(a.imag): + return np.isnan(b.imag) + else: + if np.isnan(b.imag): + return True + else: + return a.imag <= b.imag + else: + return False + + else: + if np.isnan(b.real): + return True + else: + if np.isnan(a.imag): + if np.isnan(b.imag): + return a.real <= b.real + else: + return False + else: + if np.isnan(b.imag): + return True + else: + if a.real < b.real: + return True + elif a.real == b.real: + return a.imag <= b.imag + return False + + +@register_jitable +def _less_than_or_equal(a, b): + if isinstance(a, complex) or isinstance(b, complex): + return less_than_or_equal_complex(a, b) + + elif isinstance(b, float): + if np.isnan(b): + return True + + return a <= b + + +@register_jitable +def _less_than(a, b): + if isinstance(a, complex) or isinstance(b, complex): + return less_than_complex(a, b) + + elif isinstance(b, float): + return less_than_float(a, b) + + return a < b + + +@register_jitable +def _less_then_datetime64(a, b): + # Original numpy code is at: + # https://github.com/numpy/numpy/blob/3dad50936a8dc534a81a545365f69ee9ab162ffe/numpy/_core/src/npysort/npysort_common.h#L334-L346 + if np.isnat(a): + return 0 + + if np.isnat(b): + return 1 + + return a < b + + +@register_jitable +def _less_then_or_equal_datetime64(a, b): + return not _less_then_datetime64(b, a) + + +def _searchsorted(cmp): + # a facsimile of: + # https://github.com/numpy/numpy/blob/4f84d719657eb455a35fcdf9e75b83eb1f97024a/numpy/core/src/npysort/binsearch.cpp#L61 # noqa: E501 + + def impl(a, key_val, min_idx, max_idx): + while min_idx < max_idx: + # to avoid overflow + mid_idx = min_idx + ((max_idx - min_idx) >> 1) + mid_val = a[mid_idx] + if cmp(mid_val, key_val): + min_idx = mid_idx + 1 + else: + max_idx = mid_idx + return min_idx, max_idx + + return impl + + +VALID_SEARCHSORTED_SIDES = frozenset({'left', 'right'}) + + +def make_searchsorted_implementation(np_dtype, side): + assert side in VALID_SEARCHSORTED_SIDES + + if np_dtype.char in 'mM': + # is datetime + lt = _less_then_datetime64 + le = _less_then_or_equal_datetime64 + else: + lt = _less_than + le = _less_than_or_equal + + if side == 'left': + _impl = _searchsorted(lt) + _cmp = lt + else: + _impl = _searchsorted(le) + _cmp = le + + return register_jitable(_impl), register_jitable(_cmp) + + +@overload(np.searchsorted) +def searchsorted(a, v, side='left'): + side_val = getattr(side, 'literal_value', side) + + if side_val not in VALID_SEARCHSORTED_SIDES: + # could change this so that side doesn't need to be + # a compile-time constant + raise NumbaValueError(f"Invalid value given for 'side': {side_val}") + + if isinstance(v, (types.Array, types.Sequence)): + v_dt = as_dtype(v.dtype) + else: + v_dt = as_dtype(v) + + np_dt = np.promote_types(as_dtype(a.dtype), v_dt) + _impl, _cmp = make_searchsorted_implementation(np_dt, side_val) + + if isinstance(v, types.Array): + def impl(a, v, side='left'): + out = np.empty(v.size, dtype=np.intp) + last_key_val = v.flat[0] + min_idx = 0 + max_idx = len(a) + + for i in range(v.size): + key_val = v.flat[i] + + if _cmp(last_key_val, key_val): + max_idx = len(a) + else: + min_idx = 0 + if max_idx < len(a): + max_idx += 1 + else: + max_idx = len(a) + + last_key_val = key_val + min_idx, max_idx = _impl(a, key_val, min_idx, max_idx) + out[i] = min_idx + + return out.reshape(v.shape) + elif isinstance(v, types.Sequence): + def impl(a, v, side='left'): + v = np.asarray(v) + return np.searchsorted(a, v, side=side) + else: # presumably `v` is scalar + def impl(a, v, side='left'): + r, _ = _impl(a, v, 0, len(a)) + return r + return impl + + +@overload(np.digitize) +def np_digitize(x, bins, right=False): + + if isinstance(x, types.Array) and x.dtype in types.complex_domain: + raise TypingError('x may not be complex') + + @register_jitable + def _monotonicity(bins): + + # all bin edges hold the same value + if len(bins) == 0: + return 1 + + # Skip repeated values at the beginning of the array + last_value = bins[0] + i = 1 + while i < len(bins) and bins[i] == last_value: + i += 1 + + # all bin edges hold the same value + if i == len(bins): + return 1 + + next_value = bins[i] + + if last_value < next_value: + # Possibly monotonic increasing + for i in range(i + 1, len(bins)): + last_value = next_value + next_value = bins[i] + if last_value > next_value: + return 0 + return 1 + + else: + # last > next, possibly monotonic decreasing + for i in range(i + 1, len(bins)): + last_value = next_value + next_value = bins[i] + if last_value < next_value: + return 0 + return -1 + + def digitize_impl(x, bins, right=False): + + mono = _monotonicity(bins) + + if mono == 0: + raise ValueError( + "bins must be monotonically increasing or decreasing" + ) + + # this is backwards because the arguments below are swapped + if right: + if mono == -1: + # reverse the bins, and invert the results + return len(bins) - np.searchsorted(bins[::-1], x, side='left') + else: + return np.searchsorted(bins, x, side='left') + else: + if mono == -1: + # reverse the bins, and invert the results + return len(bins) - np.searchsorted(bins[::-1], x, side='right') + else: + return np.searchsorted(bins, x, side='right') + + return digitize_impl + + +_range = range + + +@overload(np.histogram) +def np_histogram(a, bins=10, range=None): + if isinstance(bins, (int, types.Integer)): + # With a uniform distribution of bins, use a fast algorithm + # independent of the number of bins + + if range in (None, types.none): + inf = float('inf') + + def histogram_impl(a, bins=10, range=None): + bin_min = inf + bin_max = -inf + for view in np.nditer(a): + v = view.item() + if bin_min > v: + bin_min = v + if bin_max < v: + bin_max = v + return np.histogram(a, bins, (bin_min, bin_max)) + + else: + def histogram_impl(a, bins=10, range=None): + if bins <= 0: + raise ValueError("histogram(): `bins` should be a " + "positive integer") + bin_min, bin_max = range + if not bin_min <= bin_max: + raise ValueError("histogram(): max must be larger than " + "min in range parameter") + + hist = np.zeros(bins, np.intp) + if bin_max > bin_min: + bin_ratio = bins / (bin_max - bin_min) + for view in np.nditer(a): + v = view.item() + b = math.floor((v - bin_min) * bin_ratio) + if 0 <= b < bins: + hist[int(b)] += 1 + elif v == bin_max: + hist[bins - 1] += 1 + + bins_array = np.linspace(bin_min, bin_max, bins + 1) + return hist, bins_array + + else: + # With a custom bins array, use a bisection search + + def histogram_impl(a, bins=10, range=None): + nbins = len(bins) - 1 + for i in _range(nbins): + # Note this also catches NaNs + if not bins[i] <= bins[i + 1]: + raise ValueError("histogram(): bins must increase " + "monotonically") + + bin_min = bins[0] + bin_max = bins[nbins] + hist = np.zeros(nbins, np.intp) + + if nbins > 0: + for view in np.nditer(a): + v = view.item() + if not bin_min <= v <= bin_max: + # Value is out of bounds, ignore (also catches NaNs) + continue + # Bisect in bins[:-1] + lo = 0 + hi = nbins - 1 + while lo < hi: + # Note the `+ 1` is necessary to avoid an infinite + # loop where mid = lo => lo = mid + mid = (lo + hi + 1) >> 1 + if v < bins[mid]: + hi = mid - 1 + else: + lo = mid + hist[lo] += 1 + + return hist, bins + + return histogram_impl + + +# Create np.finfo, np.iinfo and np.MachAr +# machar +_mach_ar_supported = ('ibeta', 'it', 'machep', 'eps', 'negep', 'epsneg', + 'iexp', 'minexp', 'xmin', 'maxexp', 'xmax', 'irnd', + 'ngrd', 'epsilon', 'tiny', 'huge', 'precision', + 'resolution',) +MachAr = namedtuple('MachAr', _mach_ar_supported) + +# Do not support MachAr field +# finfo +_finfo_supported = ('eps', 'epsneg', 'iexp', 'machep', 'max', 'maxexp', 'min', + 'minexp', 'negep', 'nexp', 'nmant', 'precision', + 'resolution', 'tiny', 'bits',) + + +finfo = namedtuple('finfo', _finfo_supported) + +# iinfo +_iinfo_supported = ('min', 'max', 'bits',) + +iinfo = namedtuple('iinfo', _iinfo_supported) + + +def generate_xinfo_body(arg, np_func, container, attr): + nbty = getattr(arg, 'dtype', arg) + np_dtype = as_dtype(nbty) + try: + f = np_func(np_dtype) + except ValueError: # This exception instance comes from NumPy + # The np function might not support the dtype + return None + data = tuple([getattr(f, x) for x in attr]) + + @register_jitable + def impl(arg): + return container(*data) + return impl + + +@overload(np.finfo) +def ol_np_finfo(dtype): + fn = generate_xinfo_body(dtype, np.finfo, finfo, _finfo_supported) + + def impl(dtype): + return fn(dtype) + return impl + + +@overload(np.iinfo) +def ol_np_iinfo(int_type): + fn = generate_xinfo_body(int_type, np.iinfo, iinfo, _iinfo_supported) + + def impl(int_type): + return fn(int_type) + return impl + + +def _get_inner_prod(dta, dtb): + # gets an inner product implementation, if both types are float then + # BLAS is used else a local function + + @register_jitable + def _innerprod(a, b): + acc = 0 + for i in range(len(a)): + acc = acc + a[i] * b[i] + return acc + + # no BLAS... use local function regardless + if not _HAVE_BLAS: + return _innerprod + + flty = types.real_domain | types.complex_domain + floats = dta in flty and dtb in flty + if not floats: + return _innerprod + else: + a_dt = as_dtype(dta) + b_dt = as_dtype(dtb) + dt = np.promote_types(a_dt, b_dt) + + @register_jitable + def _dot_wrap(a, b): + return np.dot(a.astype(dt), b.astype(dt)) + return _dot_wrap + + +def _assert_1d(a, func_name): + if isinstance(a, types.Array): + if not a.ndim <= 1: + raise TypingError("%s() only supported on 1D arrays " % func_name) + + +def _np_correlate_core(ap1, ap2, mode, direction): + pass + + +@overload(_np_correlate_core) +def _np_correlate_core_impl(ap1, ap2, mode, direction): + a_dt = as_dtype(ap1.dtype) + b_dt = as_dtype(ap2.dtype) + dt = np.promote_types(a_dt, b_dt) + innerprod = _get_inner_prod(ap1.dtype, ap2.dtype) + + def impl(ap1, ap2, mode, direction): + # Implementation loosely based on `_pyarray_correlate` from + # https://github.com/numpy/numpy/blob/3bce2be74f228684ca2895ad02b63953f37e2a9d/numpy/core/src/multiarray/multiarraymodule.c#L1191 # noqa: E501 + # For "mode": + # Convolve uses 'full' by default. + # Correlate uses 'valid' by default. + # For "direction", +1 to write the return values out in order 0->N + # -1 to write them out N->0. + + n1 = len(ap1) + n2 = len(ap2) + + if n1 < n2: + # This should never occur when called by np.convolve because + # _np_correlate.impl swaps arguments based on length. + # The same applies for np.correlate. + raise ValueError("'len(ap1)' must greater than 'len(ap2)'") + + length = n1 + n = n2 + if mode == "valid": + length = length - n + 1 + n_left = 0 + n_right = 0 + elif mode == "full": + n_right = n - 1 + n_left = n - 1 + length = length + n - 1 + elif mode == "same": + n_left = n // 2 + n_right = n - n_left - 1 + else: + raise ValueError( + "Invalid 'mode', " + "valid are 'full', 'same', 'valid'" + ) + + ret = np.zeros(length, dt) + + if direction == 1: + idx = 0 + inc = 1 + elif direction == -1: + idx = length - 1 + inc = -1 + else: + raise ValueError("Invalid direction") + + for i in range(n_left): + k = i + n - n_left + ret[idx] = innerprod(ap1[:k], ap2[-k:]) + idx = idx + inc + + for i in range(n1 - n2 + 1): + ret[idx] = innerprod(ap1[i : i + n2], ap2) + idx = idx + inc + + for i in range(n_right): + k = n - i - 1 + ret[idx] = innerprod(ap1[-k:], ap2[:k]) + idx = idx + inc + + return ret + + return impl + + +@overload(np.correlate) +def _np_correlate(a, v, mode="valid"): + _assert_1d(a, 'np.correlate') + _assert_1d(v, 'np.correlate') + + @register_jitable + def op_conj(x): + return np.conj(x) + + @register_jitable + def op_nop(x): + return x + + if a.dtype in types.complex_domain: + if v.dtype in types.complex_domain: + a_op = op_nop + b_op = op_conj + else: + a_op = op_nop + b_op = op_nop + else: + if v.dtype in types.complex_domain: + a_op = op_nop + b_op = op_conj + else: + a_op = op_conj + b_op = op_nop + + def impl(a, v, mode="valid"): + la = len(a) + lv = len(v) + + if la == 0: + raise ValueError("'a' cannot be empty") + if lv == 0: + raise ValueError("'v' cannot be empty") + + if la < lv: + return _np_correlate_core(b_op(v), a_op(a), mode, -1) + else: + return _np_correlate_core(a_op(a), b_op(v), mode, 1) + + return impl + + +@overload(np.convolve) +def np_convolve(a, v, mode="full"): + _assert_1d(a, 'np.convolve') + _assert_1d(v, 'np.convolve') + + def impl(a, v, mode="full"): + la = len(a) + lv = len(v) + + if la == 0: + raise ValueError("'a' cannot be empty") + if lv == 0: + raise ValueError("'v' cannot be empty") + + if la < lv: + return _np_correlate_core(v, a[::-1], mode, 1) + else: + return _np_correlate_core(a, v[::-1], mode, 1) + + return impl + + +@overload(np.asarray) +def np_asarray(a, dtype=None): + + # developer note... keep this function (type_can_asarray) in sync with the + # accepted types implementations below! + if not type_can_asarray(a): + return None + + if isinstance(a, types.Array): + if is_nonelike(dtype) or a.dtype == dtype.dtype: + def impl(a, dtype=None): + return a + else: + def impl(a, dtype=None): + return a.astype(dtype) + elif isinstance(a, (types.Sequence, types.Tuple)): + # Nested lists cannot be unpacked, therefore only single lists are + # permitted and these conform to Sequence and can be unpacked along on + # the same path as Tuple. + if is_nonelike(dtype): + def impl(a, dtype=None): + return np.array(a) + else: + def impl(a, dtype=None): + return np.array(a, dtype) + elif isinstance(a, (types.Number, types.Boolean)): + dt_conv = a if is_nonelike(dtype) else dtype + ty = as_dtype(dt_conv) + + def impl(a, dtype=None): + return np.array(a, ty) + elif isinstance(a, types.containers.ListType): + if not isinstance(a.dtype, (types.Number, types.Boolean)): + raise TypingError( + "asarray support for List is limited " + "to Boolean and Number types") + + target_dtype = a.dtype if is_nonelike(dtype) else dtype + + def impl(a, dtype=None): + l = len(a) + ret = np.empty(l, dtype=target_dtype) + for i, v in enumerate(a): + ret[i] = v + return ret + elif isinstance(a, types.StringLiteral): + arr = np.asarray(a.literal_value) + + def impl(a, dtype=None): + return arr.copy() + else: + impl = None + + return impl + + +if numpy_version < (2, 0): + @overload(np.asfarray) + def np_asfarray(a, dtype=np.float64): + # convert numba dtype types into NumPy dtype + if isinstance(dtype, types.Type): + dtype = as_dtype(dtype) + if not np.issubdtype(dtype, np.inexact): + dx = types.float64 + else: + dx = dtype + + def impl(a, dtype=np.float64): + return np.asarray(a, dx) + return impl + + +@overload(np.extract) +def np_extract(condition, arr): + + def np_extract_impl(condition, arr): + cond = np.asarray(condition).flatten() + a = np.asarray(arr) + + if a.size == 0: + raise ValueError('Cannot extract from an empty array') + + # the following looks odd but replicates NumPy... + # https://github.com/numpy/numpy/issues/12859 + if np.any(cond[a.size:]) and cond.size > a.size: + msg = 'condition shape inconsistent with arr shape' + raise ValueError(msg) + # NumPy raises IndexError: index 'm' is out of + # bounds for size 'n' + + max_len = min(a.size, cond.size) + out = [a.flat[idx] for idx in range(max_len) if cond[idx]] + + return np.array(out) + + return np_extract_impl + + +@overload(np.select) +def np_select(condlist, choicelist, default=0): + + def np_select_arr_impl(condlist, choicelist, default=0): + if len(condlist) != len(choicelist): + raise ValueError('list of cases must be same length as list ' + 'of conditions') + out = default * np.ones(choicelist[0].shape, choicelist[0].dtype) + # should use reversed+zip, but reversed is not available + for i in range(len(condlist) - 1, -1, -1): + cond = condlist[i] + choice = choicelist[i] + out = np.where(cond, choice, out) + return out + + # first we check the types of the input parameters + if not isinstance(condlist, (types.List, types.UniTuple)): + raise NumbaTypeError('condlist must be a List or a Tuple') + if not isinstance(choicelist, (types.List, types.UniTuple)): + raise NumbaTypeError('choicelist must be a List or a Tuple') + if not isinstance(default, (int, types.Number, types.Boolean)): + raise NumbaTypeError('default must be a scalar (number or boolean)') + # the types of the parameters have been checked, now we test the types + # of the content of the parameters + # implementation note: if in the future numba's np.where accepts tuples + # as elements of condlist, then the check below should be extended to + # accept tuples + if not isinstance(condlist[0], types.Array): + raise NumbaTypeError('items of condlist must be arrays') + if not isinstance(choicelist[0], types.Array): + raise NumbaTypeError('items of choicelist must be arrays') + # the types of the parameters and their contents have been checked, + # now we test the dtypes of the content of parameters + if isinstance(condlist[0], types.Array): + if not isinstance(condlist[0].dtype, types.Boolean): + raise NumbaTypeError('condlist arrays must contain booleans') + if isinstance(condlist[0], types.UniTuple): + if not (isinstance(condlist[0], types.UniTuple) + and isinstance(condlist[0][0], types.Boolean)): + raise NumbaTypeError('condlist tuples must only contain booleans') + # the input types are correct, now we perform checks on the dimensions + if (isinstance(condlist[0], types.Array) and + condlist[0].ndim != choicelist[0].ndim): + raise NumbaTypeError('condlist and choicelist elements must have the ' + 'same number of dimensions') + if isinstance(condlist[0], types.Array) and condlist[0].ndim < 1: + raise NumbaTypeError('condlist arrays must be of at least dimension 1') + + return np_select_arr_impl + + +@overload(np.union1d) +def np_union1d(ar1, ar2): + if not type_can_asarray(ar1) or not type_can_asarray(ar2): + raise TypingError("The arguments to np.union1d must be array-like") + if (('unichr' in ar1.dtype.name or 'unichr' in ar2.dtype.name) and + ar1.dtype.name != ar2.dtype.name): + raise TypingError("For Unicode arrays, arrays must have same dtype") + + def union_impl(ar1, ar2): + a = np.ravel(np.asarray(ar1)) + b = np.ravel(np.asarray(ar2)) + return np.unique(np.concatenate((a, b))) + + return union_impl + + +@overload(np.asarray_chkfinite) +def np_asarray_chkfinite(a, dtype=None): + + msg = "The argument to np.asarray_chkfinite must be array-like" + if not isinstance(a, (types.Array, types.Sequence, types.Tuple)): + raise TypingError(msg) + + if is_nonelike(dtype): + dt = a.dtype + else: + try: + dt = as_dtype(dtype) + except NumbaNotImplementedError: + raise TypingError('dtype must be a valid Numpy dtype') + + def impl(a, dtype=None): + a = np.asarray(a, dtype=dt) + for i in np.nditer(a): + if not np.isfinite(i): + raise ValueError("array must not contain infs or NaNs") + return a + + return impl + + +@overload(np.unwrap) +def numpy_unwrap(p, discont=None, axis=-1, period=6.283185307179586): + if not isinstance(axis, (int, types.Integer)): + msg = 'The argument "axis" must be an integer' + raise TypingError(msg) + + if not type_can_asarray(p): + msg = 'The argument "p" must be array-like' + raise TypingError(msg) + + if (not isinstance(discont, (types.Integer, types.Float)) + and not cgutils.is_nonelike(discont)): + msg = 'The argument "discont" must be a scalar' + raise TypingError(msg) + + if not isinstance(period, (float, types.Number)): + msg = 'The argument "period" must be a scalar' + raise TypingError(msg) + + slice1 = (slice(1, None, None),) + if isinstance(period, types.Number): + dtype = np.result_type(as_dtype(p.dtype), as_dtype(period)) + else: + dtype = np.result_type(as_dtype(p.dtype), np.float64) + + integer_input = np.issubdtype(dtype, np.integer) + + def impl(p, discont=None, axis=-1, period=6.283185307179586): + if axis != -1: + msg = 'Value for argument "axis" is not supported' + raise ValueError(msg) + # Flatten to a 2D array, keeping axis -1 + p_init = np.asarray(p).astype(dtype) + init_shape = p_init.shape + last_axis = init_shape[-1] + p_new = p_init.reshape((p_init.size // last_axis, last_axis)) + # Manipulate discont and period + if discont is None: + discont = period / 2 + if integer_input: + interval_high, rem = divmod(period, 2) + boundary_ambiguous = rem == 0 + else: + interval_high = period / 2 + boundary_ambiguous = True + interval_low = -interval_high + + # Work on each row separately + for i in range(p_init.size // last_axis): + row = p_new[i] + dd = np.diff(row) + ddmod = np.mod(dd - interval_low, period) + interval_low + if boundary_ambiguous: + ddmod = np.where((ddmod == interval_low) & (dd > 0), + interval_high, ddmod) + ph_correct = ddmod - dd + + ph_correct = np.where(np.array([abs(x) for x in dd]) < discont, 0, + ph_correct) + ph_ravel = np.where(np.array([abs(x) for x in dd]) < discont, 0, + ph_correct) + ph_correct = np.reshape(ph_ravel, ph_correct.shape) + up = np.copy(row) + up[slice1] = row[slice1] + ph_correct.cumsum() + p_new[i] = up + + return p_new.reshape(init_shape) + + return impl + +#---------------------------------------------------------------------------- +# Windowing functions +# - translated from the numpy implementations found in: +# https://github.com/numpy/numpy/blob/v1.16.1/numpy/lib/function_base.py#L2543-L3233 # noqa: E501 +# at commit: f1c4c758e1c24881560dd8ab1e64ae750 +# - and also, for NumPy >= 1.20, translated from implementations in +# https://github.com/numpy/numpy/blob/156cd054e007b05d4ac4829e10a369d19dd2b0b1/numpy/lib/function_base.py#L2655-L3065 # noqa: E501 + + +@register_jitable +def np_bartlett_impl(M): + n = np.arange(1. - M, M, 2) + return np.where(np.less_equal(n, 0), 1 + n / (M - 1), 1 - n / (M - 1)) + + +@register_jitable +def np_blackman_impl(M): + n = np.arange(1. - M, M, 2) + return (0.42 + 0.5 * np.cos(np.pi * n / (M - 1)) + + 0.08 * np.cos(2.0 * np.pi * n / (M - 1))) + + +@register_jitable +def np_hamming_impl(M): + n = np.arange(1 - M, M, 2) + return 0.54 + 0.46 * np.cos(np.pi * n / (M - 1)) + + +@register_jitable +def np_hanning_impl(M): + n = np.arange(1 - M, M, 2) + return 0.5 + 0.5 * np.cos(np.pi * n / (M - 1)) + + +def window_generator(func): + def window_overload(M): + if not isinstance(M, types.Integer): + raise TypingError('M must be an integer') + + def window_impl(M): + + if M < 1: + return np.array((), dtype=np.float64) + if M == 1: + return np.ones(1, dtype=np.float64) + return func(M) + + return window_impl + return window_overload + + +overload(np.bartlett)(window_generator(np_bartlett_impl)) +overload(np.blackman)(window_generator(np_blackman_impl)) +overload(np.hamming)(window_generator(np_hamming_impl)) +overload(np.hanning)(window_generator(np_hanning_impl)) + + +_i0A = np.array([ + -4.41534164647933937950E-18, + 3.33079451882223809783E-17, + -2.43127984654795469359E-16, + 1.71539128555513303061E-15, + -1.16853328779934516808E-14, + 7.67618549860493561688E-14, + -4.85644678311192946090E-13, + 2.95505266312963983461E-12, + -1.72682629144155570723E-11, + 9.67580903537323691224E-11, + -5.18979560163526290666E-10, + 2.65982372468238665035E-9, + -1.30002500998624804212E-8, + 6.04699502254191894932E-8, + -2.67079385394061173391E-7, + 1.11738753912010371815E-6, + -4.41673835845875056359E-6, + 1.64484480707288970893E-5, + -5.75419501008210370398E-5, + 1.88502885095841655729E-4, + -5.76375574538582365885E-4, + 1.63947561694133579842E-3, + -4.32430999505057594430E-3, + 1.05464603945949983183E-2, + -2.37374148058994688156E-2, + 4.93052842396707084878E-2, + -9.49010970480476444210E-2, + 1.71620901522208775349E-1, + -3.04682672343198398683E-1, + 6.76795274409476084995E-1, +]) + +_i0B = np.array([ + -7.23318048787475395456E-18, + -4.83050448594418207126E-18, + 4.46562142029675999901E-17, + 3.46122286769746109310E-17, + -2.82762398051658348494E-16, + -3.42548561967721913462E-16, + 1.77256013305652638360E-15, + 3.81168066935262242075E-15, + -9.55484669882830764870E-15, + -4.15056934728722208663E-14, + 1.54008621752140982691E-14, + 3.85277838274214270114E-13, + 7.18012445138366623367E-13, + -1.79417853150680611778E-12, + -1.32158118404477131188E-11, + -3.14991652796324136454E-11, + 1.18891471078464383424E-11, + 4.94060238822496958910E-10, + 3.39623202570838634515E-9, + 2.26666899049817806459E-8, + 2.04891858946906374183E-7, + 2.89137052083475648297E-6, + 6.88975834691682398426E-5, + 3.36911647825569408990E-3, + 8.04490411014108831608E-1, +]) + + +@register_jitable +def _chbevl(x, vals): + b0 = vals[0] + b1 = 0.0 + + for i in range(1, len(vals)): + b2 = b1 + b1 = b0 + b0 = x * b1 - b2 + vals[i] + + return 0.5 * (b0 - b2) + + +@register_jitable +def _i0(x): + if x < 0: + x = -x + if x <= 8.0: + y = (0.5 * x) - 2.0 + return np.exp(x) * _chbevl(y, _i0A) + + return np.exp(x) * _chbevl(32.0 / x - 2.0, _i0B) / np.sqrt(x) + + +@register_jitable +def _i0n(n, alpha, beta): + y = np.empty_like(n, dtype=np.float64) + t = _i0(np.float64(beta)) + for i in range(len(y)): + y[i] = _i0(beta * np.sqrt(1 - ((n[i] - alpha) / alpha)**2.0)) / t + + return y + + +@overload(np.kaiser) +def np_kaiser(M, beta): + if not isinstance(M, types.Integer): + raise TypingError('M must be an integer') + + if not isinstance(beta, (types.Integer, types.Float)): + raise TypingError('beta must be an integer or float') + + def np_kaiser_impl(M, beta): + if M < 1: + return np.array((), dtype=np.float64) + if M == 1: + return np.ones(1, dtype=np.float64) + + n = np.arange(0, M) + alpha = (M - 1) / 2.0 + + return _i0n(n, alpha, beta) + + return np_kaiser_impl + + +@register_jitable +def _cross_operation(a, b, out): + + def _cross_preprocessing(x): + x0 = x[..., 0] + x1 = x[..., 1] + if x.shape[-1] == 3: + x2 = x[..., 2] + else: + x2 = np.multiply(x.dtype.type(0), x0) + return x0, x1, x2 + + a0, a1, a2 = _cross_preprocessing(a) + b0, b1, b2 = _cross_preprocessing(b) + + cp0 = np.multiply(a1, b2) - np.multiply(a2, b1) + cp1 = np.multiply(a2, b0) - np.multiply(a0, b2) + cp2 = np.multiply(a0, b1) - np.multiply(a1, b0) + + out[..., 0] = cp0 + out[..., 1] = cp1 + out[..., 2] = cp2 + + +def _cross(a, b): + pass + + +@overload(_cross) +def _cross_impl(a, b): + dtype = np.promote_types(as_dtype(a.dtype), as_dtype(b.dtype)) + if a.ndim == 1 and b.ndim == 1: + def impl(a, b): + cp = np.empty((3,), dtype) + _cross_operation(a, b, cp) + return cp + else: + def impl(a, b): + shape = np.add(a[..., 0], b[..., 0]).shape + cp = np.empty(shape + (3,), dtype) + _cross_operation(a, b, cp) + return cp + return impl + + +@overload(np.cross) +def np_cross(a, b): + if not type_can_asarray(a) or not type_can_asarray(b): + raise TypingError("Inputs must be array-like.") + + def impl(a, b): + a_ = np.asarray(a) + b_ = np.asarray(b) + if a_.shape[-1] not in (2, 3) or b_.shape[-1] not in (2, 3): + raise ValueError(( + "Incompatible dimensions for cross product\n" + "(dimension must be 2 or 3)" + )) + + if a_.shape[-1] == 3 or b_.shape[-1] == 3: + return _cross(a_, b_) + else: + raise ValueError(( + "Dimensions for both inputs is 2.\n" + "Please replace your numpy.cross(a, b) call with " + "a call to `cross2d(a, b)` from `numba.np.extensions`." + )) + return impl + + +@register_jitable +def _cross2d_operation(a, b): + + def _cross_preprocessing(x): + x0 = x[..., 0] + x1 = x[..., 1] + return x0, x1 + + a0, a1 = _cross_preprocessing(a) + b0, b1 = _cross_preprocessing(b) + + cp = np.multiply(a0, b1) - np.multiply(a1, b0) + # If ndim of a and b is 1, cp is a scalar. + # In this case np.cross returns a 0-D array, containing the scalar. + # np.asarray is used to reconcile this case, without introducing + # overhead in the case where cp is an actual N-D array. + # (recall that np.asarray does not copy existing arrays) + return np.asarray(cp) + + +def cross2d(a, b): + pass + + +@overload(cross2d) +def cross2d_impl(a, b): + if not type_can_asarray(a) or not type_can_asarray(b): + raise TypingError("Inputs must be array-like.") + + def impl(a, b): + a_ = np.asarray(a) + b_ = np.asarray(b) + if a_.shape[-1] != 2 or b_.shape[-1] != 2: + raise ValueError(( + "Incompatible dimensions for 2D cross product\n" + "(dimension must be 2 for both inputs)" + )) + return _cross2d_operation(a_, b_) + + return impl + + +@overload(np.trim_zeros) +def np_trim_zeros(filt, trim='fb'): + if not isinstance(filt, types.Array): + raise NumbaTypeError('The first argument must be an array') + + if filt.ndim > 1: + raise NumbaTypeError('array must be 1D') + + if not isinstance(trim, (str, types.UnicodeType)): + raise NumbaTypeError('The second argument must be a string') + + def impl(filt, trim='fb'): + a_ = np.asarray(filt) + first = 0 + trim = trim.lower() + if 'f' in trim: + for i in a_: + if i != 0: + break + else: + first = first + 1 + last = len(filt) + if 'b' in trim: + for i in a_[::-1]: + if i != 0: + break + else: + last = last - 1 + return a_[first:last] + + return impl + + +@overload(np.setxor1d) +def jit_np_setxor1d(ar1, ar2, assume_unique=False): + if not (type_can_asarray(ar1) or type_can_asarray(ar2)): + raise TypingError('setxor1d: first two args must be array-like') + if not (isinstance(assume_unique, (types.Boolean, bool))): + raise TypingError('setxor1d: Argument "assume_unique" must be boolean') + + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L477 # noqa: E501 + def np_setxor1d_impl(ar1, ar2, assume_unique=False): + a = np.asarray(ar1) + b = np.asarray(ar2) + + if not assume_unique: + a = np.unique(a) + b = np.unique(b) + else: + a = a.ravel() + b = b.ravel() + + # Implementation very similar to np_intersect1d_impl: + # We want union minus the intersect + aux = np.concatenate((a, b)) + aux.sort() + + flag = np.empty(aux.shape[0] + 1, dtype=np.bool_) + flag[0] = True + flag[-1] = True + flag[1:-1] = aux[1:] != aux[:-1] + return aux[flag[1:] & flag[:-1]] + + return np_setxor1d_impl + + +@overload(np.setdiff1d) +def jit_np_setdiff1d(ar1, ar2, assume_unique=False): + if not (type_can_asarray(ar1) or type_can_asarray(ar2)): + raise TypingError('setdiff1d: first two args must be array-like') + if not (isinstance(assume_unique, (types.Boolean, bool))): + raise TypingError('setdiff1d: Argument "assume_unique" must be boolean') + + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L940 # noqa: E501 + def np_setdiff1d_impl(ar1, ar2, assume_unique=False): + ar1 = np.asarray(ar1) + ar2 = np.asarray(ar2) + if assume_unique: + ar1 = ar1.ravel() + ar2 = ar2.ravel() + else: + ar1 = np.unique(ar1) + ar2 = np.unique(ar2) + return ar1[np.in1d(ar1, ar2, assume_unique=True, invert=True)] + + return np_setdiff1d_impl + + +@overload(np.in1d) +def jit_np_in1d(ar1, ar2, assume_unique=False, invert=False): + if not (type_can_asarray(ar1) or type_can_asarray(ar2)): + raise TypingError('in1d: first two args must be array-like') + if not isinstance(assume_unique, (types.Boolean, bool)): + raise TypingError('in1d: Argument "assume_unique" must be boolean') + if not isinstance(invert, (types.Boolean, bool)): + raise TypingError('in1d: Argument "invert" must be boolean') + + def np_in1d_impl(ar1, ar2, assume_unique=False, invert=False): + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L525 # noqa: E501 + + # Ravel both arrays, behavior for the first array could be different + ar1 = np.asarray(ar1).ravel() + ar2 = np.asarray(ar2).ravel() + + # This code is run when it would make the code significantly faster + # Sorting is also not guaranteed to work on objects but numba does + # not support object arrays. + if len(ar2) < 10 * len(ar1) ** 0.145: + if invert: + mask = np.ones(len(ar1), dtype=np.bool_) + for a in ar2: + mask &= (ar1 != a) + else: + mask = np.zeros(len(ar1), dtype=np.bool_) + for a in ar2: + mask |= (ar1 == a) + return mask + + # Otherwise use sorting + if not assume_unique: + # Equivalent to ar1, inv_idx = np.unique(ar1, return_inverse=True) + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L358C8-L358C8 # noqa: E501 + order1 = np.argsort(ar1) + aux = ar1[order1] + mask = np.empty(aux.shape, dtype=np.bool_) + mask[:1] = True + mask[1:] = aux[1:] != aux[:-1] + ar1 = aux[mask] + imask = np.cumsum(mask) - 1 + inv_idx = np.empty(mask.shape, dtype=np.intp) + inv_idx[order1] = imask + ar2 = np.unique(ar2) + + ar = np.concatenate((ar1, ar2)) + # We need this to be a stable sort, so always use 'mergesort' + # here. The values from the first array should always come before + # the values from the second array. + order = ar.argsort(kind='mergesort') + sar = ar[order] + flag = np.empty(sar.size, np.bool_) + if invert: + flag[:-1] = (sar[1:] != sar[:-1]) + else: + flag[:-1] = (sar[1:] == sar[:-1]) + flag[-1:] = invert + ret = np.empty(ar.shape, dtype=np.bool_) + ret[order] = flag + + # return ret[:len(ar1)] + if assume_unique: + return ret[:len(ar1)] + else: + return ret[inv_idx] + + return np_in1d_impl + + +@overload(np.isin) +def jit_np_isin(element, test_elements, assume_unique=False, invert=False): + if not (type_can_asarray(element) or type_can_asarray(test_elements)): + raise TypingError('isin: first two args must be array-like') + if not (isinstance(assume_unique, (types.Boolean, bool))): + raise TypingError('isin: Argument "assume_unique" must be boolean') + if not (isinstance(invert, (types.Boolean, bool))): + raise TypingError('isin: Argument "invert" must be boolean') + + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L889 # noqa: E501 + def np_isin_impl(element, test_elements, assume_unique=False, invert=False): + + element = np.asarray(element) + return np.in1d(element, test_elements, assume_unique=assume_unique, + invert=invert).reshape(element.shape) + + return np_isin_impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/npdatetime.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/npdatetime.py new file mode 100644 index 0000000000000000000000000000000000000000..ba29542e92064297ca1ed8860248fa0e7ca918db --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/npdatetime.py @@ -0,0 +1,840 @@ +""" +Implementation of operations on numpy timedelta64. +""" + +import numpy as np +import operator + +import llvmlite.ir +from llvmlite.ir import Constant + +from numba.core import types, cgutils +from numba.core.cgutils import create_constant_array +from numba.core.imputils import (lower_builtin, lower_constant, + impl_ret_untracked, lower_cast) +from numba.np import npdatetime_helpers, numpy_support, npyfuncs +from numba.extending import overload_method +from numba.core.config import IS_32BITS +from numba.core.errors import LoweringError + +# datetime64 and timedelta64 use the same internal representation +DATETIME64 = TIMEDELTA64 = llvmlite.ir.IntType(64) +NAT = Constant(TIMEDELTA64, npdatetime_helpers.NAT) + +TIMEDELTA_BINOP_SIG = (types.NPTimedelta,) * 2 + + +def scale_by_constant(builder, val, factor): + """ + Multiply *val* by the constant *factor*. + """ + return builder.mul(val, Constant(TIMEDELTA64, factor)) + + +def unscale_by_constant(builder, val, factor): + """ + Divide *val* by the constant *factor*. + """ + return builder.sdiv(val, Constant(TIMEDELTA64, factor)) + + +def add_constant(builder, val, const): + """ + Add constant *const* to *val*. + """ + return builder.add(val, Constant(TIMEDELTA64, const)) + + +def scale_timedelta(context, builder, val, srcty, destty): + """ + Scale the timedelta64 *val* from *srcty* to *destty* + (both numba.types.NPTimedelta instances) + """ + factor = npdatetime_helpers.get_timedelta_conversion_factor( + srcty.unit, destty.unit) + if factor is None: + # This can happen when using explicit output in a ufunc. + msg = f"cannot convert timedelta64 from {srcty.unit} to {destty.unit}" + raise LoweringError(msg) + return scale_by_constant(builder, val, factor) + + +def normalize_timedeltas(context, builder, left, right, leftty, rightty): + """ + Scale either *left* or *right* to the other's unit, in order to have + homogeneous units. + """ + factor = npdatetime_helpers.get_timedelta_conversion_factor( + leftty.unit, rightty.unit) + if factor is not None: + return scale_by_constant(builder, left, factor), right + factor = npdatetime_helpers.get_timedelta_conversion_factor( + rightty.unit, leftty.unit) + if factor is not None: + return left, scale_by_constant(builder, right, factor) + # Typing should not let this happen, except on == and != operators + raise RuntimeError("cannot normalize %r and %r" % (leftty, rightty)) + + +def alloc_timedelta_result(builder, name='ret'): + """ + Allocate a NaT-initialized datetime64 (or timedelta64) result slot. + """ + ret = cgutils.alloca_once(builder, TIMEDELTA64, name=name) + builder.store(NAT, ret) + return ret + + +def alloc_boolean_result(builder, name='ret'): + """ + Allocate an uninitialized boolean result slot. + """ + ret = cgutils.alloca_once(builder, llvmlite.ir.IntType(1), name=name) + return ret + + +def is_not_nat(builder, val): + """ + Return a predicate which is true if *val* is not NaT. + """ + return builder.icmp_unsigned('!=', val, NAT) + + +def are_not_nat(builder, vals): + """ + Return a predicate which is true if all of *vals* are not NaT. + """ + assert len(vals) >= 1 + pred = is_not_nat(builder, vals[0]) + for val in vals[1:]: + pred = builder.and_(pred, is_not_nat(builder, val)) + return pred + + +normal_year_months = create_constant_array( + TIMEDELTA64, + [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]) +leap_year_months = create_constant_array( + TIMEDELTA64, + [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]) +normal_year_months_acc = create_constant_array( + TIMEDELTA64, + [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]) +leap_year_months_acc = create_constant_array( + TIMEDELTA64, + [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]) + + +@lower_constant(types.NPDatetime) +@lower_constant(types.NPTimedelta) +def datetime_constant(context, builder, ty, pyval): + return DATETIME64(pyval.astype(np.int64)) + + +# Arithmetic operators on timedelta64 + +@lower_builtin(operator.pos, types.NPTimedelta) +def timedelta_pos_impl(context, builder, sig, args): + res = args[0] + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.neg, types.NPTimedelta) +def timedelta_neg_impl(context, builder, sig, args): + res = builder.neg(args[0]) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(abs, types.NPTimedelta) +def timedelta_abs_impl(context, builder, sig, args): + val, = args + ret = alloc_timedelta_result(builder) + with builder.if_else(cgutils.is_scalar_neg(builder, val)) as (then, otherwise): + with then: + builder.store(builder.neg(val), ret) + with otherwise: + builder.store(val, ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def timedelta_sign_impl(context, builder, sig, args): + """ + np.sign(timedelta64) + """ + val, = args + ret = alloc_timedelta_result(builder) + zero = Constant(TIMEDELTA64, 0) + with builder.if_else(builder.icmp_signed('>', val, zero) + ) as (gt_zero, le_zero): + with gt_zero: + builder.store(Constant(TIMEDELTA64, 1), ret) + with le_zero: + with builder.if_else(builder.icmp_unsigned('==', val, zero) + ) as (eq_zero, lt_zero): + with eq_zero: + builder.store(Constant(TIMEDELTA64, 0), ret) + with lt_zero: + builder.store(Constant(TIMEDELTA64, -1), ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.add, *TIMEDELTA_BINOP_SIG) +@lower_builtin(operator.iadd, *TIMEDELTA_BINOP_SIG) +def timedelta_add_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + ret = alloc_timedelta_result(builder) + with cgutils.if_likely(builder, are_not_nat(builder, [va, vb])): + va = scale_timedelta(context, builder, va, ta, sig.return_type) + vb = scale_timedelta(context, builder, vb, tb, sig.return_type) + builder.store(builder.add(va, vb), ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.sub, *TIMEDELTA_BINOP_SIG) +@lower_builtin(operator.isub, *TIMEDELTA_BINOP_SIG) +def timedelta_sub_impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + ret = alloc_timedelta_result(builder) + with cgutils.if_likely(builder, are_not_nat(builder, [va, vb])): + va = scale_timedelta(context, builder, va, ta, sig.return_type) + vb = scale_timedelta(context, builder, vb, tb, sig.return_type) + builder.store(builder.sub(va, vb), ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +def _timedelta_times_number(context, builder, td_arg, td_type, + number_arg, number_type, return_type): + ret = alloc_timedelta_result(builder) + with cgutils.if_likely(builder, is_not_nat(builder, td_arg)): + if isinstance(number_type, types.Float): + val = builder.sitofp(td_arg, number_arg.type) + val = builder.fmul(val, number_arg) + val = _cast_to_timedelta(context, builder, val) + else: + val = builder.mul(td_arg, number_arg) + # The scaling is required for ufunc np.multiply() with an explicit + # output in a different unit. + val = scale_timedelta(context, builder, val, td_type, return_type) + builder.store(val, ret) + return builder.load(ret) + + +@lower_builtin(operator.mul, types.NPTimedelta, types.Integer) +@lower_builtin(operator.imul, types.NPTimedelta, types.Integer) +@lower_builtin(operator.mul, types.NPTimedelta, types.Float) +@lower_builtin(operator.imul, types.NPTimedelta, types.Float) +def timedelta_times_number(context, builder, sig, args): + res = _timedelta_times_number(context, builder, + args[0], sig.args[0], args[1], sig.args[1], + sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.mul, types.Integer, types.NPTimedelta) +@lower_builtin(operator.imul, types.Integer, types.NPTimedelta) +@lower_builtin(operator.mul, types.Float, types.NPTimedelta) +@lower_builtin(operator.imul, types.Float, types.NPTimedelta) +def number_times_timedelta(context, builder, sig, args): + res = _timedelta_times_number(context, builder, + args[1], sig.args[1], args[0], sig.args[0], + sig.return_type) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.truediv, types.NPTimedelta, types.Integer) +@lower_builtin(operator.itruediv, types.NPTimedelta, types.Integer) +@lower_builtin(operator.floordiv, types.NPTimedelta, types.Integer) +@lower_builtin(operator.ifloordiv, types.NPTimedelta, types.Integer) +@lower_builtin(operator.truediv, types.NPTimedelta, types.Float) +@lower_builtin(operator.itruediv, types.NPTimedelta, types.Float) +@lower_builtin(operator.floordiv, types.NPTimedelta, types.Float) +@lower_builtin(operator.ifloordiv, types.NPTimedelta, types.Float) +def timedelta_over_number(context, builder, sig, args): + td_arg, number_arg = args + number_type = sig.args[1] + ret = alloc_timedelta_result(builder) + ok = builder.and_(is_not_nat(builder, td_arg), + builder.not_(cgutils.is_scalar_zero_or_nan(builder, number_arg))) + with cgutils.if_likely(builder, ok): + # Denominator is non-zero, non-NaN + if isinstance(number_type, types.Float): + val = builder.sitofp(td_arg, number_arg.type) + val = builder.fdiv(val, number_arg) + val = _cast_to_timedelta(context, builder, val) + else: + val = builder.sdiv(td_arg, number_arg) + # The scaling is required for ufuncs np.*divide() with an explicit + # output in a different unit. + val = scale_timedelta(context, builder, val, + sig.args[0], sig.return_type) + builder.store(val, ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.truediv, *TIMEDELTA_BINOP_SIG) +@lower_builtin(operator.itruediv, *TIMEDELTA_BINOP_SIG) +def timedelta_over_timedelta(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + not_nan = are_not_nat(builder, [va, vb]) + ll_ret_type = context.get_value_type(sig.return_type) + ret = cgutils.alloca_once(builder, ll_ret_type, name='ret') + builder.store(Constant(ll_ret_type, float('nan')), ret) + with cgutils.if_likely(builder, not_nan): + va, vb = normalize_timedeltas(context, builder, va, vb, ta, tb) + va = builder.sitofp(va, ll_ret_type) + vb = builder.sitofp(vb, ll_ret_type) + builder.store(builder.fdiv(va, vb), ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.floordiv, *TIMEDELTA_BINOP_SIG) +def timedelta_floor_div_timedelta(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + ll_ret_type = context.get_value_type(sig.return_type) + not_nan = are_not_nat(builder, [va, vb]) + ret = cgutils.alloca_once(builder, ll_ret_type, name='ret') + zero = Constant(ll_ret_type, 0) + one = Constant(ll_ret_type, 1) + builder.store(zero, ret) + with cgutils.if_likely(builder, not_nan): + va, vb = normalize_timedeltas(context, builder, va, vb, ta, tb) + # is the denominator zero or NaT? + denom_ok = builder.not_(builder.icmp_signed('==', vb, zero)) + with cgutils.if_likely(builder, denom_ok): + # is either arg negative? + vaneg = builder.icmp_signed('<', va, zero) + neg = builder.or_(vaneg, builder.icmp_signed('<', vb, zero)) + with builder.if_else(neg) as (then, otherwise): + with then: # one or more value negative + with builder.if_else(vaneg) as (negthen, negotherwise): + with negthen: + top = builder.sub(va, one) + div = builder.sdiv(top, vb) + builder.store(div, ret) + with negotherwise: + top = builder.add(va, one) + div = builder.sdiv(top, vb) + builder.store(div, ret) + with otherwise: + div = builder.sdiv(va, vb) + builder.store(div, ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + +def timedelta_mod_timedelta(context, builder, sig, args): + # inspired by https://github.com/numpy/numpy/blob/fe8072a12d65e43bd2e0b0f9ad67ab0108cc54b3/numpy/core/src/umath/loops.c.src#L1424 + # alg is basically as `a % b`: + # if a or b is NaT return NaT + # elseif b is 0 return NaT + # else pretend a and b are int and do pythonic int modulus + + [va, vb] = args + [ta, tb] = sig.args + not_nan = are_not_nat(builder, [va, vb]) + ll_ret_type = context.get_value_type(sig.return_type) + ret = alloc_timedelta_result(builder) + builder.store(NAT, ret) + zero = Constant(ll_ret_type, 0) + with cgutils.if_likely(builder, not_nan): + va, vb = normalize_timedeltas(context, builder, va, vb, ta, tb) + # is the denominator zero or NaT? + denom_ok = builder.not_(builder.icmp_signed('==', vb, zero)) + with cgutils.if_likely(builder, denom_ok): + # is either arg negative? + vapos = builder.icmp_signed('>', va, zero) + vbpos = builder.icmp_signed('>', vb, zero) + rem = builder.srem(va, vb) + cond = builder.or_(builder.and_(vapos, vbpos), + builder.icmp_signed('==', rem, zero)) + with builder.if_else(cond) as (then, otherwise): + with then: + builder.store(rem, ret) + with otherwise: + builder.store(builder.add(rem, vb), ret) + + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + +# Comparison operators on timedelta64 + + +def _create_timedelta_comparison_impl(ll_op, default_value): + def impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + ret = alloc_boolean_result(builder) + with builder.if_else(are_not_nat(builder, [va, vb])) as (then, otherwise): + with then: + try: + norm_a, norm_b = normalize_timedeltas( + context, builder, va, vb, ta, tb) + except RuntimeError: + # Cannot normalize units => the values are unequal (except if NaT) + builder.store(default_value, ret) + else: + builder.store(builder.icmp_unsigned(ll_op, norm_a, norm_b), ret) + with otherwise: + # NaT ==/>=/>/ is True + if ll_op == '!=': + builder.store(cgutils.true_bit, ret) + else: + builder.store(cgutils.false_bit, ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + + return impl + + +def _create_timedelta_ordering_impl(ll_op): + def impl(context, builder, sig, args): + [va, vb] = args + [ta, tb] = sig.args + ret = alloc_boolean_result(builder) + with builder.if_else(are_not_nat(builder, [va, vb])) as (then, otherwise): + with then: + norm_a, norm_b = normalize_timedeltas( + context, builder, va, vb, ta, tb) + builder.store(builder.icmp_signed(ll_op, norm_a, norm_b), ret) + with otherwise: + # NaT >=/>/') +timedelta_ge_timedelta_impl = _create_timedelta_ordering_impl('>=') + +for op_, func in [(operator.eq, timedelta_eq_timedelta_impl), + (operator.ne, timedelta_ne_timedelta_impl), + (operator.lt, timedelta_lt_timedelta_impl), + (operator.le, timedelta_le_timedelta_impl), + (operator.gt, timedelta_gt_timedelta_impl), + (operator.ge, timedelta_ge_timedelta_impl)]: + lower_builtin(op_, *TIMEDELTA_BINOP_SIG)(func) + + +# Arithmetic on datetime64 + +def is_leap_year(builder, year_val): + """ + Return a predicate indicating whether *year_val* (offset by 1970) is a + leap year. + """ + actual_year = builder.add(year_val, Constant(DATETIME64, 1970)) + multiple_of_4 = cgutils.is_null( + builder, builder.and_(actual_year, Constant(DATETIME64, 3))) + not_multiple_of_100 = cgutils.is_not_null( + builder, builder.srem(actual_year, Constant(DATETIME64, 100))) + multiple_of_400 = cgutils.is_null( + builder, builder.srem(actual_year, Constant(DATETIME64, 400))) + return builder.and_(multiple_of_4, + builder.or_(not_multiple_of_100, multiple_of_400)) + + +def year_to_days(builder, year_val): + """ + Given a year *year_val* (offset to 1970), return the number of days + since the 1970 epoch. + """ + # The algorithm below is copied from Numpy's get_datetimestruct_days() + # (src/multiarray/datetime.c) + ret = cgutils.alloca_once(builder, TIMEDELTA64) + # First approximation + days = scale_by_constant(builder, year_val, 365) + # Adjust for leap years + with builder.if_else(cgutils.is_neg_int(builder, year_val)) \ + as (if_neg, if_pos): + with if_pos: + # At or after 1970: + # 1968 is the closest leap year before 1970. + # Exclude the current year, so add 1. + from_1968 = add_constant(builder, year_val, 1) + # Add one day for each 4 years + p_days = builder.add(days, + unscale_by_constant(builder, from_1968, 4)) + # 1900 is the closest previous year divisible by 100 + from_1900 = add_constant(builder, from_1968, 68) + # Subtract one day for each 100 years + p_days = builder.sub(p_days, + unscale_by_constant(builder, from_1900, 100)) + # 1600 is the closest previous year divisible by 400 + from_1600 = add_constant(builder, from_1900, 300) + # Add one day for each 400 years + p_days = builder.add(p_days, + unscale_by_constant(builder, from_1600, 400)) + builder.store(p_days, ret) + with if_neg: + # Before 1970: + # NOTE `year_val` is negative, and so will be `from_1972` and `from_2000`. + # 1972 is the closest later year after 1970. + # Include the current year, so subtract 2. + from_1972 = add_constant(builder, year_val, -2) + # Subtract one day for each 4 years (`from_1972` is negative) + n_days = builder.add(days, + unscale_by_constant(builder, from_1972, 4)) + # 2000 is the closest later year divisible by 100 + from_2000 = add_constant(builder, from_1972, -28) + # Add one day for each 100 years + n_days = builder.sub(n_days, + unscale_by_constant(builder, from_2000, 100)) + # 2000 is also the closest later year divisible by 400 + # Subtract one day for each 400 years + n_days = builder.add(n_days, + unscale_by_constant(builder, from_2000, 400)) + builder.store(n_days, ret) + return builder.load(ret) + + +def reduce_datetime_for_unit(builder, dt_val, src_unit, dest_unit): + dest_unit_code = npdatetime_helpers.DATETIME_UNITS[dest_unit] + src_unit_code = npdatetime_helpers.DATETIME_UNITS[src_unit] + if dest_unit_code < 2 or src_unit_code >= 2: + return dt_val, src_unit + # Need to compute the day ordinal for *dt_val* + if src_unit_code == 0: + # Years to days + year_val = dt_val + days_val = year_to_days(builder, year_val) + + else: + # Months to days + leap_array = cgutils.global_constant(builder, "leap_year_months_acc", + leap_year_months_acc) + normal_array = cgutils.global_constant(builder, "normal_year_months_acc", + normal_year_months_acc) + + days = cgutils.alloca_once(builder, TIMEDELTA64) + + # First compute year number and month number + year, month = cgutils.divmod_by_constant(builder, dt_val, 12) + + # Then deduce the number of days + with builder.if_else(is_leap_year(builder, year)) as (then, otherwise): + with then: + addend = builder.load(cgutils.gep(builder, leap_array, + 0, month, inbounds=True)) + builder.store(addend, days) + with otherwise: + addend = builder.load(cgutils.gep(builder, normal_array, + 0, month, inbounds=True)) + builder.store(addend, days) + + days_val = year_to_days(builder, year) + days_val = builder.add(days_val, builder.load(days)) + + if dest_unit_code == 2: + # Need to scale back to weeks + weeks, _ = cgutils.divmod_by_constant(builder, days_val, 7) + return weeks, 'W' + else: + return days_val, 'D' + + +def convert_datetime_for_arith(builder, dt_val, src_unit, dest_unit): + """ + Convert datetime *dt_val* from *src_unit* to *dest_unit*. + """ + # First partial conversion to days or weeks, if necessary. + dt_val, dt_unit = reduce_datetime_for_unit( + builder, dt_val, src_unit, dest_unit) + # Then multiply by the remaining constant factor. + dt_factor = npdatetime_helpers.get_timedelta_conversion_factor(dt_unit, dest_unit) + if dt_factor is None: + # This can happen when using explicit output in a ufunc. + raise LoweringError("cannot convert datetime64 from %r to %r" + % (src_unit, dest_unit)) + return scale_by_constant(builder, dt_val, dt_factor) + + +def _datetime_timedelta_arith(ll_op_name): + def impl(context, builder, dt_arg, dt_unit, + td_arg, td_unit, ret_unit): + ret = alloc_timedelta_result(builder) + with cgutils.if_likely(builder, are_not_nat(builder, [dt_arg, td_arg])): + dt_arg = convert_datetime_for_arith(builder, dt_arg, + dt_unit, ret_unit) + td_factor = npdatetime_helpers.get_timedelta_conversion_factor( + td_unit, ret_unit) + td_arg = scale_by_constant(builder, td_arg, td_factor) + ret_val = getattr(builder, ll_op_name)(dt_arg, td_arg) + builder.store(ret_val, ret) + return builder.load(ret) + return impl + + +_datetime_plus_timedelta = _datetime_timedelta_arith('add') +_datetime_minus_timedelta = _datetime_timedelta_arith('sub') + +# datetime64 + timedelta64 + + +@lower_builtin(operator.add, types.NPDatetime, types.NPTimedelta) +@lower_builtin(operator.iadd, types.NPDatetime, types.NPTimedelta) +def datetime_plus_timedelta(context, builder, sig, args): + dt_arg, td_arg = args + dt_type, td_type = sig.args + res = _datetime_plus_timedelta(context, builder, + dt_arg, dt_type.unit, + td_arg, td_type.unit, + sig.return_type.unit) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.add, types.NPTimedelta, types.NPDatetime) +@lower_builtin(operator.iadd, types.NPTimedelta, types.NPDatetime) +def timedelta_plus_datetime(context, builder, sig, args): + td_arg, dt_arg = args + td_type, dt_type = sig.args + res = _datetime_plus_timedelta(context, builder, + dt_arg, dt_type.unit, + td_arg, td_type.unit, + sig.return_type.unit) + return impl_ret_untracked(context, builder, sig.return_type, res) + +# datetime64 - timedelta64 + + +@lower_builtin(operator.sub, types.NPDatetime, types.NPTimedelta) +@lower_builtin(operator.isub, types.NPDatetime, types.NPTimedelta) +def datetime_minus_timedelta(context, builder, sig, args): + dt_arg, td_arg = args + dt_type, td_type = sig.args + res = _datetime_minus_timedelta(context, builder, + dt_arg, dt_type.unit, + td_arg, td_type.unit, + sig.return_type.unit) + return impl_ret_untracked(context, builder, sig.return_type, res) + +# datetime64 - datetime64 + + +@lower_builtin(operator.sub, types.NPDatetime, types.NPDatetime) +def datetime_minus_datetime(context, builder, sig, args): + va, vb = args + ta, tb = sig.args + unit_a = ta.unit + unit_b = tb.unit + ret_unit = sig.return_type.unit + ret = alloc_timedelta_result(builder) + with cgutils.if_likely(builder, are_not_nat(builder, [va, vb])): + va = convert_datetime_for_arith(builder, va, unit_a, ret_unit) + vb = convert_datetime_for_arith(builder, vb, unit_b, ret_unit) + ret_val = builder.sub(va, vb) + builder.store(ret_val, ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + +# datetime64 comparisons + + +def _create_datetime_comparison_impl(ll_op): + def impl(context, builder, sig, args): + va, vb = args + ta, tb = sig.args + unit_a = ta.unit + unit_b = tb.unit + ret_unit = npdatetime_helpers.get_best_unit(unit_a, unit_b) + ret = alloc_boolean_result(builder) + with builder.if_else(are_not_nat(builder, [va, vb])) as (then, otherwise): + with then: + norm_a = convert_datetime_for_arith( + builder, va, unit_a, ret_unit) + norm_b = convert_datetime_for_arith( + builder, vb, unit_b, ret_unit) + ret_val = builder.icmp_signed(ll_op, norm_a, norm_b) + builder.store(ret_val, ret) + with otherwise: + if ll_op == '!=': + ret_val = cgutils.true_bit + else: + ret_val = cgutils.false_bit + builder.store(ret_val, ret) + res = builder.load(ret) + return impl_ret_untracked(context, builder, sig.return_type, res) + + return impl + + +datetime_eq_datetime_impl = _create_datetime_comparison_impl('==') +datetime_ne_datetime_impl = _create_datetime_comparison_impl('!=') +datetime_lt_datetime_impl = _create_datetime_comparison_impl('<') +datetime_le_datetime_impl = _create_datetime_comparison_impl('<=') +datetime_gt_datetime_impl = _create_datetime_comparison_impl('>') +datetime_ge_datetime_impl = _create_datetime_comparison_impl('>=') + +for op, func in [(operator.eq, datetime_eq_datetime_impl), + (operator.ne, datetime_ne_datetime_impl), + (operator.lt, datetime_lt_datetime_impl), + (operator.le, datetime_le_datetime_impl), + (operator.gt, datetime_gt_datetime_impl), + (operator.ge, datetime_ge_datetime_impl)]: + lower_builtin(op, *[types.NPDatetime]*2)(func) + + +######################################################################## +# datetime/timedelta fmax/fmin maximum/minimum support + +def _gen_datetime_max_impl(NAT_DOMINATES): + def datetime_max_impl(context, builder, sig, args): + # note this could be optimizing relying on the actual value of NAT + # but as NumPy doesn't rely on this, this seems more resilient + in1, in2 = args + in1_not_nat = is_not_nat(builder, in1) + in2_not_nat = is_not_nat(builder, in2) + in1_ge_in2 = builder.icmp_signed('>=', in1, in2) + res = builder.select(in1_ge_in2, in1, in2) + if NAT_DOMINATES: + # NaT now dominates, like NaN + in1, in2 = in2, in1 + res = builder.select(in1_not_nat, res, in2) + res = builder.select(in2_not_nat, res, in1) + + return impl_ret_untracked(context, builder, sig.return_type, res) + return datetime_max_impl + +datetime_maximum_impl = _gen_datetime_max_impl(True) +datetime_fmax_impl = _gen_datetime_max_impl(False) + +def _gen_datetime_min_impl(NAT_DOMINATES): + def datetime_min_impl(context, builder, sig, args): + # note this could be optimizing relying on the actual value of NAT + # but as NumPy doesn't rely on this, this seems more resilient + in1, in2 = args + in1_not_nat = is_not_nat(builder, in1) + in2_not_nat = is_not_nat(builder, in2) + in1_le_in2 = builder.icmp_signed('<=', in1, in2) + res = builder.select(in1_le_in2, in1, in2) + if NAT_DOMINATES: + # NaT now dominates, like NaN + in1, in2 = in2, in1 + res = builder.select(in1_not_nat, res, in2) + res = builder.select(in2_not_nat, res, in1) + + return impl_ret_untracked(context, builder, sig.return_type, res) + return datetime_min_impl + +datetime_minimum_impl = _gen_datetime_min_impl(True) +datetime_fmin_impl = _gen_datetime_min_impl(False) + +def _gen_timedelta_max_impl(NAT_DOMINATES): + def timedelta_max_impl(context, builder, sig, args): + # note this could be optimizing relying on the actual value of NAT + # but as NumPy doesn't rely on this, this seems more resilient + in1, in2 = args + in1_not_nat = is_not_nat(builder, in1) + in2_not_nat = is_not_nat(builder, in2) + in1_ge_in2 = builder.icmp_signed('>=', in1, in2) + res = builder.select(in1_ge_in2, in1, in2) + if NAT_DOMINATES: + # NaT now dominates, like NaN + in1, in2 = in2, in1 + res = builder.select(in1_not_nat, res, in2) + res = builder.select(in2_not_nat, res, in1) + + return impl_ret_untracked(context, builder, sig.return_type, res) + return timedelta_max_impl + +timedelta_maximum_impl = _gen_timedelta_max_impl(True) +timedelta_fmax_impl = _gen_timedelta_max_impl(False) + +def _gen_timedelta_min_impl(NAT_DOMINATES): + def timedelta_min_impl(context, builder, sig, args): + # note this could be optimizing relying on the actual value of NAT + # but as NumPy doesn't rely on this, this seems more resilient + in1, in2 = args + in1_not_nat = is_not_nat(builder, in1) + in2_not_nat = is_not_nat(builder, in2) + in1_le_in2 = builder.icmp_signed('<=', in1, in2) + res = builder.select(in1_le_in2, in1, in2) + if NAT_DOMINATES: + # NaT now dominates, like NaN + in1, in2 = in2, in1 + res = builder.select(in1_not_nat, res, in2) + res = builder.select(in2_not_nat, res, in1) + + return impl_ret_untracked(context, builder, sig.return_type, res) + return timedelta_min_impl + +timedelta_minimum_impl = _gen_timedelta_min_impl(True) +timedelta_fmin_impl = _gen_timedelta_min_impl(False) + +def _cast_to_timedelta(context, builder, val): + temp = builder.alloca(TIMEDELTA64) + val_is_nan = builder.fcmp_unordered('uno', val, val) + with builder.if_else(val_is_nan) as ( + then, els): + with then: + # NaN does not guarantee to cast to NAT. + # We should store NAT explicitly. + builder.store(NAT, temp) + with els: + builder.store(builder.fptosi(val, TIMEDELTA64), temp) + return builder.load(temp) + + +@lower_builtin(np.isnat, types.NPDatetime) +@lower_builtin(np.isnat, types.NPTimedelta) +def _np_isnat_impl(context, builder, sig, args): + return npyfuncs.np_datetime_isnat_impl(context, builder, sig, args) + + +@lower_cast(types.NPDatetime, types.Integer) +@lower_cast(types.NPTimedelta, types.Integer) +def _cast_npdatetime_int64(context, builder, fromty, toty, val): + if toty.bitwidth != 64: # all date time types are 64 bit + msg = f"Cannot cast {fromty} to {toty} as {toty} is not 64 bits wide." + raise ValueError(msg) + return val + + +@overload_method(types.NPTimedelta, '__hash__') +@overload_method(types.NPDatetime, '__hash__') +def ol_hash_npdatetime(x): + if numpy_support.numpy_version >= (2, 2)\ + and isinstance(x, types.NPTimedelta) and not x.unit: + raise ValueError("Can't hash generic timedelta64") + + if IS_32BITS: + def impl(x): + x = np.int64(x) + if x < 2**31 - 1: # x < LONG_MAX + y = np.int32(x) + else: + hi = (np.int64(x) & 0xffffffff00000000) >> 32 + lo = (np.int64(x) & 0x00000000ffffffff) + y = np.int32(lo + (1000003) * hi) + if y == -1: + y = np.int32(-2) + return y + else: + def impl(x): + if np.int64(x) == -1: + return np.int64(-2) + return np.int64(x) + return impl + + +lower_builtin(npdatetime_helpers.datetime_minimum, types.NPDatetime, types.NPDatetime)(datetime_minimum_impl) +lower_builtin(npdatetime_helpers.datetime_minimum, types.NPTimedelta, types.NPTimedelta)(datetime_minimum_impl) +lower_builtin(npdatetime_helpers.datetime_maximum, types.NPDatetime, types.NPDatetime)(datetime_maximum_impl) +lower_builtin(npdatetime_helpers.datetime_maximum, types.NPTimedelta, types.NPTimedelta)(datetime_maximum_impl) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/npdatetime_helpers.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/npdatetime_helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..4abb671b91ddea0c32fc1571dc2f9dc88a5335b5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/npdatetime_helpers.py @@ -0,0 +1,212 @@ +""" +Helper functions for np.timedelta64 and np.datetime64. +For now, multiples-of-units (for example timedeltas expressed in tens +of seconds) are not supported. +""" + + +import numpy as np + + +DATETIME_UNITS = { + 'Y': 0, # Years + 'M': 1, # Months + 'W': 2, # Weeks + # Yes, there's a gap here + 'D': 4, # Days + 'h': 5, # Hours + 'm': 6, # Minutes + 's': 7, # Seconds + 'ms': 8, # Milliseconds + 'us': 9, # Microseconds + 'ns': 10, # Nanoseconds + 'ps': 11, # Picoseconds + 'fs': 12, # Femtoseconds + 'as': 13, # Attoseconds + '': 14, # "generic", i.e. unit-less +} + +NAT = np.timedelta64('nat').astype(np.int64) + +# NOTE: numpy has several inconsistent functions for timedelta casting: +# - can_cast_timedelta64_{metadata,units}() disallows "safe" casting +# to and from generic units +# - cast_timedelta_to_timedelta() allows casting from (but not to) +# generic units +# - compute_datetime_metadata_greatest_common_divisor() allows casting from +# generic units (used for promotion) + + +def same_kind(src, dest): + """ + Whether the *src* and *dest* units are of the same kind. + """ + return (DATETIME_UNITS[src] < 5) == (DATETIME_UNITS[dest] < 5) + + +def can_cast_timedelta_units(src, dest): + # Mimic NumPy's "safe" casting and promotion + # `dest` must be more precise than `src` and they must be compatible + # for conversion. + # XXX should we switch to enforcing "same-kind" for Numpy 1.10+ ? + src = DATETIME_UNITS[src] + dest = DATETIME_UNITS[dest] + if src == dest: + return True + if src == 14: + return True + if src > dest: + return False + if dest == 14: + # unit-less timedelta64 is not compatible with anything else + return False + if src <= 1 and dest > 1: + # Cannot convert between months or years and other units + return False + return True + + +# Exact conversion factors from one unit to the immediately more precise one +_factors = { + 0: (1, 12), # Years -> Months + 2: (4, 7), # Weeks -> Days + 4: (5, 24), # Days -> Hours + 5: (6, 60), # Hours -> Minutes + 6: (7, 60), # Minutes -> Seconds + 7: (8, 1000), + 8: (9, 1000), + 9: (10, 1000), + 10: (11, 1000), + 11: (12, 1000), + 12: (13, 1000), +} + + +def _get_conversion_multiplier(big_unit_code, small_unit_code): + """ + Return an integer multiplier allowing to convert from *big_unit_code* + to *small_unit_code*. + None is returned if the conversion is not possible through a + simple integer multiplication. + """ + # Mimics get_datetime_units_factor() in NumPy's datetime.c, + # with a twist to allow no-op conversion from generic units. + if big_unit_code == 14: + return 1 + c = big_unit_code + factor = 1 + while c < small_unit_code: + try: + c, mult = _factors[c] + except KeyError: + # No possible conversion + return None + factor *= mult + if c == small_unit_code: + return factor + else: + return None + + +def get_timedelta_conversion_factor(src_unit, dest_unit): + """ + Return an integer multiplier allowing to convert from timedeltas + of *src_unit* to *dest_unit*. + """ + return _get_conversion_multiplier(DATETIME_UNITS[src_unit], + DATETIME_UNITS[dest_unit]) + + +def get_datetime_timedelta_conversion(datetime_unit, timedelta_unit): + """ + Compute a possible conversion for combining *datetime_unit* and + *timedelta_unit* (presumably for adding or subtracting). + Return (result unit, integer datetime multiplier, integer timedelta + multiplier). RuntimeError is raised if the combination is impossible. + """ + # XXX now unused (I don't know where / how Numpy uses this) + dt_unit_code = DATETIME_UNITS[datetime_unit] + td_unit_code = DATETIME_UNITS[timedelta_unit] + if td_unit_code == 14 or dt_unit_code == 14: + return datetime_unit, 1, 1 + if td_unit_code < 2 and dt_unit_code >= 2: + # Cannot combine Y or M timedelta64 with a finer-grained datetime64 + raise RuntimeError("cannot combine datetime64(%r) and timedelta64(%r)" + % (datetime_unit, timedelta_unit)) + dt_factor, td_factor = 1, 1 + + # If years or months, the datetime unit is first scaled to weeks or days, + # then conversion continues below. This is the same algorithm as used + # in Numpy's get_datetime_conversion_factor() (src/multiarray/datetime.c): + # """Conversions between years/months and other units use + # the factor averaged over the 400 year leap year cycle.""" + if dt_unit_code == 0: + if td_unit_code >= 4: + dt_factor = 97 + 400 * 365 + td_factor = 400 + dt_unit_code = 4 + elif td_unit_code == 2: + dt_factor = 97 + 400 * 365 + td_factor = 400 * 7 + dt_unit_code = 2 + elif dt_unit_code == 1: + if td_unit_code >= 4: + dt_factor = 97 + 400 * 365 + td_factor = 400 * 12 + dt_unit_code = 4 + elif td_unit_code == 2: + dt_factor = 97 + 400 * 365 + td_factor = 400 * 12 * 7 + dt_unit_code = 2 + + if td_unit_code >= dt_unit_code: + factor = _get_conversion_multiplier(dt_unit_code, td_unit_code) + assert factor is not None, (dt_unit_code, td_unit_code) + return timedelta_unit, dt_factor * factor, td_factor + else: + factor = _get_conversion_multiplier(td_unit_code, dt_unit_code) + assert factor is not None, (dt_unit_code, td_unit_code) + return datetime_unit, dt_factor, td_factor * factor + + +def combine_datetime_timedelta_units(datetime_unit, timedelta_unit): + """ + Return the unit result of combining *datetime_unit* with *timedelta_unit* + (e.g. by adding or subtracting). None is returned if combining + those units is forbidden. + """ + dt_unit_code = DATETIME_UNITS[datetime_unit] + td_unit_code = DATETIME_UNITS[timedelta_unit] + if dt_unit_code == 14: + return timedelta_unit + elif td_unit_code == 14: + return datetime_unit + if td_unit_code < 2 and dt_unit_code >= 2: + return None + if dt_unit_code > td_unit_code: + return datetime_unit + else: + return timedelta_unit + + +def get_best_unit(unit_a, unit_b): + """ + Get the best (i.e. finer-grained) of two units. + """ + a = DATETIME_UNITS[unit_a] + b = DATETIME_UNITS[unit_b] + if a == 14: + return unit_b + if b == 14: + return unit_a + if b > a: + return unit_b + return unit_a + + +def datetime_minimum(a, b): + pass + + +def datetime_maximum(a, b): + pass diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/npyfuncs.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/npyfuncs.py new file mode 100644 index 0000000000000000000000000000000000000000..de50317a1a32346c0eddbde76e5cccf26cffc1b0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/npyfuncs.py @@ -0,0 +1,1707 @@ +"""Codegen for functions used as kernels in NumPy functions + +Typically, the kernels of several ufuncs that can't map directly to +Python builtins +""" + + +import math + +import llvmlite.ir +import numpy as np + +from numba.core.extending import overload +from numba.core.imputils import impl_ret_untracked +from numba.core import typing, types, errors, lowering, cgutils, config +from numba.core.extending import register_jitable +from numba.np import npdatetime +from numba.np.math import cmathimpl, mathimpl, numbers +from numba.np.numpy_support import numpy_version + +# some NumPy constants. Note that we could generate some of them using +# the math library, but having the values copied from npy_math seems to +# yield more accurate results +_NPY_LOG2E = 1.442695040888963407359924681001892137 # math.log(math.e, 2) +_NPY_LOG10E = 0.434294481903251827651128918916605082 # math.log(math.e, 10) +_NPY_LOGE2 = 0.693147180559945309417232121458176568 # math.log(2) + + +def _check_arity_and_homogeneity(sig, args, arity, return_type = None): + """checks that the following are true: + - args and sig.args have arg_count elements + - all input types are homogeneous + - return type is 'return_type' if provided, otherwise it must be + homogeneous with the input types. + """ + assert len(args) == arity + assert len(sig.args) == arity + ty = sig.args[0] + if return_type is None: + return_type = ty + # must have homogeneous args + if not( all(arg==ty for arg in sig.args) and sig.return_type == return_type): + import inspect + fname = inspect.currentframe().f_back.f_code.co_name + msg = '{0} called with invalid types: {1}'.format(fname, sig) + assert False, msg + +if config.USE_LEGACY_TYPE_SYSTEM: + cast_arg_ty = types.float64 +else: + cast_arg_ty = types.np_float64 + +def _call_func_by_name_with_cast(context, builder, sig, args, + func_name, ty=cast_arg_ty): + # it is quite common in NumPy to have loops implemented as a call + # to the double version of the function, wrapped in casts. This + # helper function facilitates that. + mod = builder.module + lty = context.get_argument_type(ty) + fnty = llvmlite.ir.FunctionType(lty, [lty]*len(sig.args)) + fn = cgutils.insert_pure_function(mod, fnty, name=func_name) + cast_args = [context.cast(builder, arg, argty, ty) + for arg, argty in zip(args, sig.args) ] + + result = builder.call(fn, cast_args) + return context.cast(builder, result, types.float64, sig.return_type) + + +def _dispatch_func_by_name_type(context, builder, sig, args, table, user_name): + # for most cases the functions are homogeneous on all their types. + # this code dispatches on the first argument type as it is the most useful + # for our uses (all cases but ldexp are homogeneous in all types, and + # dispatching on the first argument type works of ldexp as well) + # + # assumes that the function pointed by func_name has the type + # signature sig (but needs translation to llvm types). + + ty = sig.args[0] + try: + func_name = table[ty] + except KeyError as e: + msg = "No {0} function for real type {1}".format(user_name, str(e)) + raise errors.LoweringError(msg) + + mod = builder.module + if ty in types.complex_domain: + # In numba struct types are always passed by pointer. So the call has to + # be transformed from "result = func(ops...)" to "func(&result, ops...). + # note that the result value pointer as first argument is the convention + # used by numba. + + # First, prepare the return value + out = context.make_complex(builder, ty) + ptrargs = [cgutils.alloca_once_value(builder, arg) + for arg in args] + call_args = [out._getpointer()] + ptrargs + # get_value_as_argument for struct types like complex allocate stack space + # and initialize with the value, the return value is the pointer to that + # allocated space (ie: pointer to a copy of the value in the stack). + # get_argument_type returns a pointer to the struct type in consonance. + call_argtys = [ty] + list(sig.args) + call_argltys = [context.get_value_type(ty).as_pointer() + for ty in call_argtys] + fnty = llvmlite.ir.FunctionType(llvmlite.ir.VoidType(), call_argltys) + # Note: the function isn't pure here (it writes to its pointer args) + fn = cgutils.get_or_insert_function(mod, fnty, func_name) + builder.call(fn, call_args) + retval = builder.load(call_args[0]) + else: + argtypes = [context.get_argument_type(aty) for aty in sig.args] + restype = context.get_argument_type(sig.return_type) + fnty = llvmlite.ir.FunctionType(restype, argtypes) + fn = cgutils.insert_pure_function(mod, fnty, name=func_name) + retval = context.call_external_function(builder, fn, sig.args, args) + return retval + + + +######################################################################## +# Division kernels inspired by NumPy loops.c.src code +# +# The builtins are not applicable as they rely on a test for zero in the +# denominator. If it is zero the appropriate exception is raised. +# In NumPy, a division by zero does not raise an exception, but instead +# generated a known value. Note that a division by zero in any of the +# operations of a vector may raise an exception or issue a warning +# depending on the np.seterr configuration. This is not supported +# right now (and in any case, it won't be handled by these functions +# either) + +def np_int_sdiv_impl(context, builder, sig, args): + # based on the actual code in NumPy loops.c.src for signed integer types + _check_arity_and_homogeneity(sig, args, 2) + + num, den = args + ty = sig.args[0] # any arg type will do, homogeneous + + ZERO = context.get_constant(ty, 0) + MINUS_ONE = context.get_constant(ty, -1) + MIN_INT = context.get_constant(ty, 1 << (den.type.width-1)) + den_is_zero = builder.icmp_unsigned('==', ZERO, den) + den_is_minus_one = builder.icmp_unsigned('==', MINUS_ONE, den) + num_is_min_int = builder.icmp_unsigned('==', MIN_INT, num) + could_cause_sigfpe = builder.and_(den_is_minus_one, num_is_min_int) + force_zero = builder.or_(den_is_zero, could_cause_sigfpe) + with builder.if_else(force_zero, likely=False) as (then, otherwise): + with then: + bb_then = builder.basic_block + with otherwise: + bb_otherwise = builder.basic_block + div = builder.sdiv(num, den) + mod = builder.srem(num, den) + num_gt_zero = builder.icmp_signed('>', num, ZERO) + den_gt_zero = builder.icmp_signed('>', den, ZERO) + not_same_sign = builder.xor(num_gt_zero, den_gt_zero) + mod_not_zero = builder.icmp_unsigned('!=', mod, ZERO) + needs_fixing = builder.and_(not_same_sign, mod_not_zero) + fix_value = builder.select(needs_fixing, MINUS_ONE, ZERO) + result_otherwise = builder.add(div, fix_value) + + result = builder.phi(ZERO.type) + result.add_incoming(ZERO, bb_then) + result.add_incoming(result_otherwise, bb_otherwise) + + return result + + +def np_int_srem_impl(context, builder, sig, args): + # based on the actual code in NumPy loops.c.src for signed integers + _check_arity_and_homogeneity(sig, args, 2) + + num, den = args + ty = sig.args[0] # any arg type will do, homogeneous + + ZERO = context.get_constant(ty, 0) + den_not_zero = builder.icmp_unsigned('!=', ZERO, den) + bb_no_if = builder.basic_block + with cgutils.if_unlikely(builder, den_not_zero): + bb_if = builder.basic_block + mod = builder.srem(num,den) + num_gt_zero = builder.icmp_signed('>', num, ZERO) + den_gt_zero = builder.icmp_signed('>', den, ZERO) + not_same_sign = builder.xor(num_gt_zero, den_gt_zero) + mod_not_zero = builder.icmp_unsigned('!=', mod, ZERO) + needs_fixing = builder.and_(not_same_sign, mod_not_zero) + fix_value = builder.select(needs_fixing, den, ZERO) + final_mod = builder.add(fix_value, mod) + + result = builder.phi(ZERO.type) + result.add_incoming(ZERO, bb_no_if) + result.add_incoming(final_mod, bb_if) + + return result + + +def np_int_sdivrem_impl(context, builder, sig, args): + div = np_int_sdiv_impl(context, builder, sig.return_type[0](*sig.args), args) + rem = np_int_srem_impl(context, builder, sig.return_type[1](*sig.args), args) + return context.make_tuple(builder, sig.return_type, [div, rem]) + + +def np_int_udiv_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + + num, den = args + ty = sig.args[0] # any arg type will do, homogeneous + + ZERO = context.get_constant(ty, 0) + div_by_zero = builder.icmp_unsigned('==', ZERO, den) + with builder.if_else(div_by_zero, likely=False) as (then, otherwise): + with then: + # division by zero + bb_then = builder.basic_block + with otherwise: + # divide! + div = builder.udiv(num, den) + bb_otherwise = builder.basic_block + + result = builder.phi(ZERO.type) + result.add_incoming(ZERO, bb_then) + result.add_incoming(div, bb_otherwise) + return result + + +def np_int_urem_impl(context, builder, sig, args): + # based on the actual code in NumPy loops.c.src for signed integers + _check_arity_and_homogeneity(sig, args, 2) + + num, den = args + ty = sig.args[0] # any arg type will do, homogeneous + + ZERO = context.get_constant(ty, 0) + den_not_zero = builder.icmp_unsigned('!=', ZERO, den) + bb_no_if = builder.basic_block + with cgutils.if_unlikely(builder, den_not_zero): + bb_if = builder.basic_block + mod = builder.urem(num,den) + + result = builder.phi(ZERO.type) + result.add_incoming(ZERO, bb_no_if) + result.add_incoming(mod, bb_if) + + return result + + +def np_int_udivrem_impl(context, builder, sig, args): + div = np_int_udiv_impl(context, builder, sig.return_type[0](*sig.args), args) + rem = np_int_urem_impl(context, builder, sig.return_type[1](*sig.args), args) + return context.make_tuple(builder, sig.return_type, [div, rem]) + + +# implementation of int_fmod is in fact the same as the unsigned remainder, +# that is: srem with a special case returning 0 when the denominator is 0. +np_int_fmod_impl = np_int_urem_impl + + +def np_real_div_impl(context, builder, sig, args): + # in NumPy real div has the same semantics as an fdiv for generating + # NANs, INF and NINF + _check_arity_and_homogeneity(sig, args, 2) + return builder.fdiv(*args) + + +def np_real_mod_impl(context, builder, sig, args): + # note: this maps to NumPy remainder, which has the same semantics as Python + # based on code in loops.c.src + _check_arity_and_homogeneity(sig, args, 2) + in1, in2 = args + ty = sig.args[0] + + ZERO = context.get_constant(ty, 0.0) + res = builder.frem(in1, in2) + res_ne_zero = builder.fcmp_ordered('!=', res, ZERO) + den_lt_zero = builder.fcmp_ordered('<', in2, ZERO) + res_lt_zero = builder.fcmp_ordered('<', res, ZERO) + needs_fixing = builder.and_(res_ne_zero, + builder.xor(den_lt_zero, res_lt_zero)) + fix_value = builder.select(needs_fixing, in2, ZERO) + + return builder.fadd(res, fix_value) + + +def np_real_fmod_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + return builder.frem(*args) + + +def _fabs(context, builder, arg): + ZERO = llvmlite.ir.Constant(arg.type, 0.0) + arg_negated = builder.fsub(ZERO, arg) + arg_is_negative = builder.fcmp_ordered('<', arg, ZERO) + return builder.select(arg_is_negative, arg_negated, arg) + + +def np_complex_div_impl(context, builder, sig, args): + # Extracted from numpy/core/src/umath/loops.c.src, + # inspired by complex_div_impl + # variables named coherent with loops.c.src + # This is implemented using the approach described in + # R.L. Smith. Algorithm 116: Complex division. + # Communications of the ACM, 5(8):435, 1962 + + in1, in2 = [context.make_complex(builder, sig.args[0], value=arg) + for arg in args] + + in1r = in1.real # numerator.real + in1i = in1.imag # numerator.imag + in2r = in2.real # denominator.real + in2i = in2.imag # denominator.imag + ftype = in1r.type + assert all([i.type==ftype for i in [in1r, in1i, in2r, in2i]]), "mismatched types" + out = context.make_helper(builder, sig.return_type) + + ZERO = llvmlite.ir.Constant(ftype, 0.0) + ONE = llvmlite.ir.Constant(ftype, 1.0) + + # if abs(denominator.real) >= abs(denominator.imag) + in2r_abs = _fabs(context, builder, in2r) + in2i_abs = _fabs(context, builder, in2i) + in2r_abs_ge_in2i_abs = builder.fcmp_ordered('>=', in2r_abs, in2i_abs) + with builder.if_else(in2r_abs_ge_in2i_abs) as (then, otherwise): + with then: + # if abs(denominator.real) == 0 and abs(denominator.imag) == 0 + in2r_is_zero = builder.fcmp_ordered('==', in2r_abs, ZERO) + in2i_is_zero = builder.fcmp_ordered('==', in2i_abs, ZERO) + in2_is_zero = builder.and_(in2r_is_zero, in2i_is_zero) + with builder.if_else(in2_is_zero) as (inn_then, inn_otherwise): + with inn_then: + # division by 0. + # fdiv generates the appropriate NAN/INF/NINF + out.real = builder.fdiv(in1r, in2r_abs) + out.imag = builder.fdiv(in1i, in2i_abs) + with inn_otherwise: + # general case for: + # abs(denominator.real) > abs(denominator.imag) + rat = builder.fdiv(in2i, in2r) + # scl = 1.0/(in2r + in2i*rat) + tmp1 = builder.fmul(in2i, rat) + tmp2 = builder.fadd(in2r, tmp1) + scl = builder.fdiv(ONE, tmp2) + # out.real = (in1r + in1i*rat)*scl + # out.imag = (in1i - in1r*rat)*scl + tmp3 = builder.fmul(in1i, rat) + tmp4 = builder.fmul(in1r, rat) + tmp5 = builder.fadd(in1r, tmp3) + tmp6 = builder.fsub(in1i, tmp4) + out.real = builder.fmul(tmp5, scl) + out.imag = builder.fmul(tmp6, scl) + with otherwise: + # general case for: + # abs(denominator.imag) > abs(denominator.real) + rat = builder.fdiv(in2r, in2i) + # scl = 1.0/(in2i + in2r*rat) + tmp1 = builder.fmul(in2r, rat) + tmp2 = builder.fadd(in2i, tmp1) + scl = builder.fdiv(ONE, tmp2) + # out.real = (in1r*rat + in1i)*scl + # out.imag = (in1i*rat - in1r)*scl + tmp3 = builder.fmul(in1r, rat) + tmp4 = builder.fmul(in1i, rat) + tmp5 = builder.fadd(tmp3, in1i) + tmp6 = builder.fsub(tmp4, in1r) + out.real = builder.fmul(tmp5, scl) + out.imag = builder.fmul(tmp6, scl) + + return out._getvalue() + + +######################################################################## +# NumPy logaddexp + +def _npy_logaddexp(x1, x2): + pass + +def _generate_logaddexp(fnoverload, const, log1pfn, expfn): + # Code generation for logaddexp and logaddexp2 is based on: + # https://github.com/numpy/numpy/blob/12c2b7dd62fc0c14b81c8892ed5f4f59cc94d09c/numpy/core/src/npymath/npy_math_internal.h.src#L467-L507 + + @overload(fnoverload, target='generic') + def ol_npy_logaddexp(x1, x2): + if x1 != x2: + return + shift = x1(const) + def impl(x1, x2): + x, y = x1, x2 + if (x == y): + # Handles infinities of the same sign without warnings + return x + shift + else: + tmp = x - y + if (tmp > 0): + return x + log1pfn(expfn(-tmp)) + elif (tmp <= 0): + return y + log1pfn(expfn(tmp)) + else: + # NaN + return tmp + return impl + +def _npy_logaddexp(x1, x2): + pass + + +_generate_logaddexp(_npy_logaddexp, _NPY_LOGE2, np.log1p, np.exp) + + +def np_real_logaddexp_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + + fnty = context.typing_context.resolve_value_type(_npy_logaddexp) + sig = fnty.get_call_type(context.typing_context, (*sig.args,), {}) + impl = context.get_function(fnty, sig) + return impl(builder, args) + +######################################################################## +# NumPy logaddexp2 +def _npy_logaddexp2(x1, x2): + pass + +def npy_log2_1p(x): + pass + +# The following npy_log2_1p function is a translation of: +# https://github.com/numpy/numpy/blob/12c2b7dd62fc0c14b81c8892ed5f4f59cc94d09c/numpy/core/src/npymath/npy_math_internal.h.src#L457-L460 + +@overload(npy_log2_1p, target='generic') +def ol_npy_log2_1p(x): + LOG2E = x(_NPY_LOG2E) + def impl(x): + return LOG2E * np.log1p(x) + return impl + + +_generate_logaddexp(_npy_logaddexp2, 1.0, npy_log2_1p, np.exp2) + + +def np_real_logaddexp2_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + + fnty = context.typing_context.resolve_value_type(_npy_logaddexp2) + sig = fnty.get_call_type(context.typing_context, (*sig.args,), {}) + impl = context.get_function(fnty, sig) + return impl(builder, args) + + +######################################################################## +# true div kernels + +def np_int_truediv_impl(context, builder, sig, args): + # in NumPy we don't check for 0 denominator... fdiv handles div by + # 0 in the way NumPy expects.. + # integer truediv always yields double + num, den = args + lltype = num.type + assert all(i.type==lltype for i in args), "must have homogeneous types" + numty, denty = sig.args + + num = context.cast(builder, num, numty, types.float64) + den = context.cast(builder, den, denty, types.float64) + + return builder.fdiv(num,den) + + +######################################################################## +# floor div kernels + +def np_real_floor_div_impl(context, builder, sig, args): + res = np_real_div_impl(context, builder, sig, args) + s = typing.signature(sig.return_type, sig.return_type) + return np_real_floor_impl(context, builder, s, (res,)) + + +def np_real_divmod_impl(context, builder, sig, args): + div = np_real_floor_div_impl(context, builder, sig.return_type[0](*sig.args), args) + rem = np_real_mod_impl(context, builder, sig.return_type[1](*sig.args), args) + return context.make_tuple(builder, sig.return_type, [div, rem]) + + +def np_complex_floor_div_impl(context, builder, sig, args): + # this is based on the complex floor divide in Numpy's loops.c.src + # This is basically a full complex division with a complex floor + # applied. + # The complex floor seems to be defined as the real floor applied + # with the real part and zero in the imaginary part. Fully developed + # so it avoids computing anything related to the imaginary result. + float_kind = sig.args[0].underlying_float + floor_sig = typing.signature(float_kind, float_kind) + + in1, in2 = [context.make_complex(builder, sig.args[0], value=arg) + for arg in args] + + in1r = in1.real + in1i = in1.imag + in2r = in2.real + in2i = in2.imag + ftype = in1r.type + assert all([i.type==ftype for i in [in1r, in1i, in2r, in2i]]), "mismatched types" + + ZERO = llvmlite.ir.Constant(ftype, 0.0) + + out = context.make_helper(builder, sig.return_type) + out.imag = ZERO + + in2r_abs = _fabs(context, builder, in2r) + in2i_abs = _fabs(context, builder, in2i) + in2r_abs_ge_in2i_abs = builder.fcmp_ordered('>=', in2r_abs, in2i_abs) + + with builder.if_else(in2r_abs_ge_in2i_abs) as (then, otherwise): + with then: + rat = builder.fdiv(in2i, in2r) + # out.real = floor((in1r+in1i*rat)/(in2r + in2i*rat)) + tmp1 = builder.fmul(in1i, rat) + tmp2 = builder.fmul(in2i, rat) + tmp3 = builder.fadd(in1r, tmp1) + tmp4 = builder.fadd(in2r, tmp2) + tmp5 = builder.fdiv(tmp3, tmp4) + out.real = np_real_floor_impl(context, builder, floor_sig, (tmp5,)) + with otherwise: + rat = builder.fdiv(in2r, in2i) + # out.real = floor((in1i + in1r*rat)/(in2i + in2r*rat)) + tmp1 = builder.fmul(in1r, rat) + tmp2 = builder.fmul(in2r, rat) + tmp3 = builder.fadd(in1i, tmp1) + tmp4 = builder.fadd(in2i, tmp2) + tmp5 = builder.fdiv(tmp3, tmp4) + out.real = np_real_floor_impl(context, builder, floor_sig, (tmp5,)) + return out._getvalue() + + +######################################################################## +# numpy power funcs + +def np_complex_power_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + + return numbers.complex_power_impl(context, builder, sig, args) + + +######################################################################## +# numpy float power funcs + +def real_float_power_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + + return numbers.real_power_impl(context, builder, sig, args) + + +def np_complex_float_power_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + + return numbers.complex_power_impl(context, builder, sig, args) + + +######################################################################## +# numpy greatest common denominator + +def np_gcd_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + return mathimpl.gcd_impl(context, builder, sig, args) + + +######################################################################## +# numpy lowest common multiple + +def np_lcm_impl(context, builder, sig, args): + + xty, yty = sig.args + assert xty == yty == sig.return_type + x, y = args + + def lcm(a, b): + """ + Like gcd, heavily cribbed from Julia. + """ + return 0 if a == 0 else abs(a * (b // np.gcd(b, a))) + + res = context.compile_internal(builder, lcm, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +######################################################################## +# Numpy style complex sign + +def np_complex_sign_impl(context, builder, sig, args): + # equivalent to complex sign in NumPy's sign + # but implemented via selects, balancing the 4 cases. + _check_arity_and_homogeneity(sig, args, 1) + + if numpy_version >= (2, 0): + # NumPy >= 2.0.0 + def complex_sign(z): + abs = math.hypot(z.real, z.imag) + if abs == 0: + return 0 + 0j + else: + return z / abs + + res = context.compile_internal(builder, complex_sign, sig, args) + return impl_ret_untracked(context, builder, sig.return_type, res) + else: + op = args[0] + ty = sig.args[0] + result = context.make_complex(builder, ty) + float_ty = ty.underlying_float + + ZERO = context.get_constant(float_ty, 0.0) + ONE = context.get_constant(float_ty, 1.0) + MINUS_ONE = context.get_constant(float_ty, -1.0) + NAN = context.get_constant(float_ty, float('nan')) + + result.real = ZERO + result.imag = ZERO + cmp_sig = typing.signature(types.boolean, *[ty] * 2) + cmp_args = [op, result._getvalue()] + arg1_ge_arg2 = np_complex_ge_impl(context, builder, cmp_sig, cmp_args) + arg1_eq_arg2 = np_complex_eq_impl(context, builder, cmp_sig, cmp_args) + arg1_lt_arg2 = np_complex_lt_impl(context, builder, cmp_sig, cmp_args) + + real_when_ge = builder.select(arg1_eq_arg2, ZERO, ONE) + real_when_nge = builder.select(arg1_lt_arg2, MINUS_ONE, NAN) + result.real = builder.select(arg1_ge_arg2, real_when_ge, real_when_nge) + + return result._getvalue() + + +######################################################################## +# Numpy rint + +def np_real_rint_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + return mathimpl.call_fp_intrinsic(builder, 'llvm.rint', args) + + +def np_complex_rint_impl(context, builder, sig, args): + # based on code in NumPy's funcs.inc.src + # rint of a complex number defined as rint of its real and imag + # parts + _check_arity_and_homogeneity(sig, args, 1) + ty = sig.args[0] + float_ty = ty.underlying_float + in1 = context.make_complex(builder, ty, value=args[0]) + out = context.make_complex(builder, ty) + + inner_sig = typing.signature(*[float_ty]*2) + out.real = np_real_rint_impl(context, builder, inner_sig, [in1.real]) + out.imag = np_real_rint_impl(context, builder, inner_sig, [in1.imag]) + return out._getvalue() + + +######################################################################## +# NumPy exp + +def np_real_exp_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.exp_impl(context, builder, sig, args) + + +def np_complex_exp_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return cmathimpl.exp_impl(context, builder, sig, args) + +######################################################################## +# NumPy exp2 + +def np_real_exp2_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + ll_ty = args[0].type + fnty = llvmlite.ir.FunctionType(ll_ty, [ll_ty,]) + fn = cgutils.insert_pure_function(builder.module, fnty, + name='llvm.exp2') + return builder.call(fn, [args[0]]) + + +def np_complex_exp2_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + ty = sig.args[0] + float_ty = ty.underlying_float + in1 = context.make_complex(builder, ty, value=args[0]) + tmp = context.make_complex(builder, ty) + loge2 = context.get_constant(float_ty, _NPY_LOGE2) + tmp.real = builder.fmul(loge2, in1.real) + tmp.imag = builder.fmul(loge2, in1.imag) + return np_complex_exp_impl(context, builder, sig, [tmp._getvalue()]) + + +######################################################################## +# NumPy log + +def np_real_log_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.log_impl(context, builder, sig, args) + + +def np_complex_log_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return cmathimpl.log_impl(context, builder, sig, args) + +######################################################################## +# NumPy log2 + +def np_real_log2_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + ll_ty = args[0].type + fnty = llvmlite.ir.FunctionType(ll_ty, [ll_ty,]) + fn = cgutils.insert_pure_function(builder.module, fnty, + name='llvm.log2') + return builder.call(fn, [args[0]]) + +def np_complex_log2_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + float_ty = ty.underlying_float + tmp = np_complex_log_impl(context, builder, sig, args) + tmp = context.make_complex(builder, ty, value=tmp) + log2e = context.get_constant(float_ty, _NPY_LOG2E) + tmp.real = builder.fmul(log2e, tmp.real) + tmp.imag = builder.fmul(log2e, tmp.imag) + return tmp._getvalue() + + +######################################################################## +# NumPy log10 + +def np_real_log10_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.log10_impl(context, builder, sig, args) + + +def np_complex_log10_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + float_ty = ty.underlying_float + tmp = np_complex_log_impl(context, builder, sig, args) + tmp = context.make_complex(builder, ty, value=tmp) + log10e = context.get_constant(float_ty, _NPY_LOG10E) + tmp.real = builder.fmul(log10e, tmp.real) + tmp.imag = builder.fmul(log10e, tmp.imag) + return tmp._getvalue() + + +######################################################################## +# NumPy expm1 + +def np_real_expm1_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.expm1_impl(context, builder, sig, args) + +def np_complex_expm1_impl(context, builder, sig, args): + # this is based on nc_expm1 in funcs.inc.src + _check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + float_ty = ty.underlying_float + float_unary_sig = typing.signature(*[float_ty]*2) + + MINUS_ONE = context.get_constant(float_ty, -1.0) + in1 = context.make_complex(builder, ty, value=args[0]) + a = np_real_exp_impl(context, builder, float_unary_sig, [in1.real]) + out = context.make_complex(builder, ty) + cos_imag = np_real_cos_impl(context, builder, float_unary_sig, [in1.imag]) + sin_imag = np_real_sin_impl(context, builder, float_unary_sig, [in1.imag]) + tmp = builder.fmul(a, cos_imag) + out.imag = builder.fmul(a, sin_imag) + out.real = builder.fadd(tmp, MINUS_ONE) + + return out._getvalue() + + +######################################################################## +# NumPy log1p + +def np_real_log1p_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.log1p_impl(context, builder, sig, args) + +def np_complex_log1p_impl(context, builder, sig, args): + # base on NumPy's nc_log1p in funcs.inc.src + _check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + float_ty = ty.underlying_float + float_unary_sig = typing.signature(*[float_ty]*2) + float_binary_sig = typing.signature(*[float_ty]*3) + + ONE = context.get_constant(float_ty, 1.0) + in1 = context.make_complex(builder, ty, value=args[0]) + out = context.make_complex(builder, ty) + real_plus_one = builder.fadd(in1.real, ONE) + l = np_real_hypot_impl(context, builder, float_binary_sig, + [real_plus_one, in1.imag]) + out.imag = np_real_atan2_impl(context, builder, float_binary_sig, + [in1.imag, real_plus_one]) + out.real = np_real_log_impl(context, builder, float_unary_sig, [l]) + + return out._getvalue() + + +######################################################################## +# NumPy sqrt + +def np_real_sqrt_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.sqrt_impl(context, builder, sig, args) + + +def np_complex_sqrt_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return cmathimpl.sqrt_impl(context, builder, sig, args) + + +######################################################################## +# NumPy square + +def np_int_square_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return builder.mul(args[0], args[0]) + + +def np_real_square_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return builder.fmul(args[0], args[0]) + +def np_complex_square_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + binary_sig = typing.signature(*[sig.return_type]*3) + return numbers.complex_mul_impl(context, builder, binary_sig, + [args[0], args[0]]) + + +######################################################################## +# NumPy cbrt + +def np_real_cbrt_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + # We enable fastmath here to force np.power(x, 1/3) to generate a + # call to libm cbrt function + @register_jitable(fastmath=True) + def cbrt(x): + if x < 0: + return -np.power(-x, 1.0 / 3.0) + else: + return np.power(x, 1.0 / 3.0) + + def _cbrt(x): + if np.isnan(x): + return np.nan + return cbrt(x) + + return context.compile_internal(builder, _cbrt, sig, args) + + +######################################################################## +# NumPy reciprocal + +def np_int_reciprocal_impl(context, builder, sig, args): + # based on the implementation in loops.c.src + # integer versions for reciprocal are performed via promotion + # using double, and then converted back to the type + _check_arity_and_homogeneity(sig, args, 1) + ty = sig.return_type + + binary_sig = typing.signature(*[ty]*3) + in_as_float = context.cast(builder, args[0], ty, types.float64) + ONE = context.get_constant(types.float64, 1) + result_as_float = builder.fdiv(ONE, in_as_float) + return context.cast(builder, result_as_float, types.float64, ty) + + +def np_real_reciprocal_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + ONE = context.get_constant(sig.return_type, 1.0) + return builder.fdiv(ONE, args[0]) + + +def np_complex_reciprocal_impl(context, builder, sig, args): + # based on the implementation in loops.c.src + # Basically the same Smith method used for division, but with + # the numerator substituted by 1.0 + _check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + float_ty = ty.underlying_float + + ZERO = context.get_constant(float_ty, 0.0) + ONE = context.get_constant(float_ty, 1.0) + in1 = context.make_complex(builder, ty, value=args[0]) + out = context.make_complex(builder, ty) + in1r = in1.real + in1i = in1.imag + in1r_abs = _fabs(context, builder, in1r) + in1i_abs = _fabs(context, builder, in1i) + in1i_abs_le_in1r_abs = builder.fcmp_ordered('<=', in1i_abs, in1r_abs) + + with builder.if_else(in1i_abs_le_in1r_abs) as (then, otherwise): + with then: + r = builder.fdiv(in1i, in1r) + tmp0 = builder.fmul(in1i, r) + d = builder.fadd(in1r, tmp0) + inv_d = builder.fdiv(ONE, d) + minus_r = builder.fsub(ZERO, r) + out.real = inv_d + out.imag = builder.fmul(minus_r, inv_d) + with otherwise: + r = builder.fdiv(in1r, in1i) + tmp0 = builder.fmul(in1r, r) + d = builder.fadd(tmp0, in1i) + inv_d = builder.fdiv(ONE, d) + out.real = builder.fmul(r, inv_d) + out.imag = builder.fsub(ZERO, inv_d) + + return out._getvalue() + + +######################################################################## +# NumPy sin + +def np_real_sin_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.sin_impl(context, builder, sig, args) + + +def np_complex_sin_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return cmathimpl.sin_impl(context, builder, sig, args) + + +######################################################################## +# NumPy cos + +def np_real_cos_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.cos_impl(context, builder, sig, args) + + +def np_complex_cos_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return cmathimpl.cos_impl(context, builder, sig, args) + + +######################################################################## +# NumPy tan + +def np_real_tan_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.tan_impl(context, builder, sig, args) + + +######################################################################## +# NumPy asin + +def np_real_asin_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.asin_impl(context, builder, sig, args) + + +######################################################################## +# NumPy acos + +def np_real_acos_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.acos_impl(context, builder, sig, args) + + +######################################################################## +# NumPy atan + +def np_real_atan_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.atan_impl(context, builder, sig, args) + + +######################################################################## +# NumPy atan2 + +def np_real_atan2_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + return mathimpl.atan2_float_impl(context, builder, sig, args) + + +######################################################################## +# NumPy hypot + +def np_real_hypot_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + return mathimpl.hypot_float_impl(context, builder, sig, args) + + +######################################################################## +# NumPy sinh + +def np_real_sinh_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.sinh_impl(context, builder, sig, args) + + +def np_complex_sinh_impl(context, builder, sig, args): + # npymath does not provide a complex sinh. The code in funcs.inc.src + # is translated here... + _check_arity_and_homogeneity(sig, args, 1) + + + ty = sig.args[0] + fty = ty.underlying_float + fsig1 = typing.signature(*[fty]*2) + x = context.make_complex(builder, ty, args[0]) + out = context.make_complex(builder, ty) + xr = x.real + xi = x.imag + + sxi = np_real_sin_impl(context, builder, fsig1, [xi]) + shxr = np_real_sinh_impl(context, builder, fsig1, [xr]) + cxi = np_real_cos_impl(context, builder, fsig1, [xi]) + chxr = np_real_cosh_impl(context, builder, fsig1, [xr]) + + out.real = builder.fmul(cxi, shxr) + out.imag = builder.fmul(sxi, chxr) + + return out._getvalue() + + +######################################################################## +# NumPy cosh + +def np_real_cosh_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.cosh_impl(context, builder, sig, args) + + +def np_complex_cosh_impl(context, builder, sig, args): + # npymath does not provide a complex cosh. The code in funcs.inc.src + # is translated here... + _check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + fty = ty.underlying_float + fsig1 = typing.signature(*[fty]*2) + x = context.make_complex(builder, ty, args[0]) + out = context.make_complex(builder, ty) + xr = x.real + xi = x.imag + + cxi = np_real_cos_impl(context, builder, fsig1, [xi]) + chxr = np_real_cosh_impl(context, builder, fsig1, [xr]) + sxi = np_real_sin_impl(context, builder, fsig1, [xi]) + shxr = np_real_sinh_impl(context, builder, fsig1, [xr]) + + out.real = builder.fmul(cxi, chxr) + out.imag = builder.fmul(sxi, shxr) + + return out._getvalue() + + +######################################################################## +# NumPy tanh + +def np_real_tanh_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.tanh_impl(context, builder, sig, args) + + +def np_complex_tanh_impl(context, builder, sig, args): + # npymath does not provide complex tan functions. The code + # in funcs.inc.src for tanh is translated here... + _check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + fty = ty.underlying_float + fsig1 = typing.signature(*[fty]*2) + ONE = context.get_constant(fty, 1.0) + x = context.make_complex(builder, ty, args[0]) + out = context.make_complex(builder, ty) + + xr = x.real + xi = x.imag + si = np_real_sin_impl(context, builder, fsig1, [xi]) + ci = np_real_cos_impl(context, builder, fsig1, [xi]) + shr = np_real_sinh_impl(context, builder, fsig1, [xr]) + chr_ = np_real_cosh_impl(context, builder, fsig1, [xr]) + rs = builder.fmul(ci, shr) + is_ = builder.fmul(si, chr_) + rc = builder.fmul(ci, chr_) + ic = builder.fmul(si, shr) # note: opposite sign from code in funcs.inc.src + sqr_rc = builder.fmul(rc, rc) + sqr_ic = builder.fmul(ic, ic) + d = builder.fadd(sqr_rc, sqr_ic) + inv_d = builder.fdiv(ONE, d) + rs_rc = builder.fmul(rs, rc) + is_ic = builder.fmul(is_, ic) + is_rc = builder.fmul(is_, rc) + rs_ic = builder.fmul(rs, ic) + numr = builder.fadd(rs_rc, is_ic) + numi = builder.fsub(is_rc, rs_ic) + out.real = builder.fmul(numr, inv_d) + out.imag = builder.fmul(numi, inv_d) + + return out._getvalue() + + +######################################################################## +# NumPy asinh + +def np_real_asinh_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.asinh_impl(context, builder, sig, args) + + +######################################################################## +# NumPy acosh + +def np_real_acosh_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.acosh_impl(context, builder, sig, args) + + +def np_complex_acosh_impl(context, builder, sig, args): + # npymath does not provide a complex acosh. The code in funcs.inc.src + # is translated here... + # log(x + sqrt(x+1) * sqrt(x-1)) + _check_arity_and_homogeneity(sig, args, 1) + + ty = sig.args[0] + csig2 = typing.signature(*[ty]*3) + + ONE = context.get_constant_generic(builder, ty, 1.0 + 0.0j) + x = args[0] + + x_plus_one = numbers.complex_add_impl(context, builder, csig2, [x, + ONE]) + x_minus_one = numbers.complex_sub_impl(context, builder, csig2, [x, + ONE]) + sqrt_x_plus_one = np_complex_sqrt_impl(context, builder, sig, [x_plus_one]) + sqrt_x_minus_one = np_complex_sqrt_impl(context, builder, sig, [x_minus_one]) + prod_sqrt = numbers.complex_mul_impl(context, builder, csig2, + [sqrt_x_plus_one, + sqrt_x_minus_one]) + log_arg = numbers.complex_add_impl(context, builder, csig2, [x, + prod_sqrt]) + + return np_complex_log_impl(context, builder, sig, [log_arg]) + + +######################################################################## +# NumPy atanh + +def np_real_atanh_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + return mathimpl.atanh_impl(context, builder, sig, args) + + +######################################################################## +# NumPy floor + +def np_real_floor_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + return mathimpl.call_fp_intrinsic(builder, 'llvm.floor', args) + + +######################################################################## +# NumPy ceil + +def np_real_ceil_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + return mathimpl.call_fp_intrinsic(builder, 'llvm.ceil', args) + + +######################################################################## +# NumPy trunc + +def np_real_trunc_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + return mathimpl.call_fp_intrinsic(builder, 'llvm.trunc', args) + + +######################################################################## +# NumPy fabs + +def np_real_fabs_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1) + + return mathimpl.call_fp_intrinsic(builder, 'llvm.fabs', args) + + +######################################################################## +# NumPy style predicates + +# For real and integer types rely on numbers... but complex ordering in +# NumPy is lexicographic (while Python does not provide ordering). +def np_complex_ge_impl(context, builder, sig, args): + # equivalent to macro CGE in NumPy's loops.c.src + # ((xr > yr && !npy_isnan(xi) && !npy_isnan(yi)) || (xr == yr && xi >= yi)) + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + + ty = sig.args[0] + in1, in2 = [context.make_complex(builder, ty, value=arg) for arg in args] + xr = in1.real + xi = in1.imag + yr = in2.real + yi = in2.imag + + xr_gt_yr = builder.fcmp_ordered('>', xr, yr) + no_nan_xi_yi = builder.fcmp_ordered('ord', xi, yi) + xr_eq_yr = builder.fcmp_ordered('==', xr, yr) + xi_ge_yi = builder.fcmp_ordered('>=', xi, yi) + first_term = builder.and_(xr_gt_yr, no_nan_xi_yi) + second_term = builder.and_(xr_eq_yr, xi_ge_yi) + return builder.or_(first_term, second_term) + + +def np_complex_le_impl(context, builder, sig, args): + # equivalent to macro CLE in NumPy's loops.c.src + # ((xr < yr && !npy_isnan(xi) && !npy_isnan(yi)) || (xr == yr && xi <= yi)) + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + + ty = sig.args[0] + in1, in2 = [context.make_complex(builder, ty, value=arg) for arg in args] + xr = in1.real + xi = in1.imag + yr = in2.real + yi = in2.imag + + xr_lt_yr = builder.fcmp_ordered('<', xr, yr) + no_nan_xi_yi = builder.fcmp_ordered('ord', xi, yi) + xr_eq_yr = builder.fcmp_ordered('==', xr, yr) + xi_le_yi = builder.fcmp_ordered('<=', xi, yi) + first_term = builder.and_(xr_lt_yr, no_nan_xi_yi) + second_term = builder.and_(xr_eq_yr, xi_le_yi) + return builder.or_(first_term, second_term) + + +def np_complex_gt_impl(context, builder, sig, args): + # equivalent to macro CGT in NumPy's loops.c.src + # ((xr > yr && !npy_isnan(xi) && !npy_isnan(yi)) || (xr == yr && xi > yi)) + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + + ty = sig.args[0] + in1, in2 = [context.make_complex(builder, ty, value=arg) for arg in args] + xr = in1.real + xi = in1.imag + yr = in2.real + yi = in2.imag + + xr_gt_yr = builder.fcmp_ordered('>', xr, yr) + no_nan_xi_yi = builder.fcmp_ordered('ord', xi, yi) + xr_eq_yr = builder.fcmp_ordered('==', xr, yr) + xi_gt_yi = builder.fcmp_ordered('>', xi, yi) + first_term = builder.and_(xr_gt_yr, no_nan_xi_yi) + second_term = builder.and_(xr_eq_yr, xi_gt_yi) + return builder.or_(first_term, second_term) + + +def np_complex_lt_impl(context, builder, sig, args): + # equivalent to macro CLT in NumPy's loops.c.src + # ((xr < yr && !npy_isnan(xi) && !npy_isnan(yi)) || (xr == yr && xi < yi)) + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + + ty = sig.args[0] + in1, in2 = [context.make_complex(builder, ty, value=arg) for arg in args] + xr = in1.real + xi = in1.imag + yr = in2.real + yi = in2.imag + + xr_lt_yr = builder.fcmp_ordered('<', xr, yr) + no_nan_xi_yi = builder.fcmp_ordered('ord', xi, yi) + xr_eq_yr = builder.fcmp_ordered('==', xr, yr) + xi_lt_yi = builder.fcmp_ordered('<', xi, yi) + first_term = builder.and_(xr_lt_yr, no_nan_xi_yi) + second_term = builder.and_(xr_eq_yr, xi_lt_yi) + return builder.or_(first_term, second_term) + + +def np_complex_eq_impl(context, builder, sig, args): + # equivalent to macro CEQ in NumPy's loops.c.src + # (xr == yr && xi == yi) + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + + ty = sig.args[0] + in1, in2 = [context.make_complex(builder, ty, value=arg) for arg in args] + xr = in1.real + xi = in1.imag + yr = in2.real + yi = in2.imag + + xr_eq_yr = builder.fcmp_ordered('==', xr, yr) + xi_eq_yi = builder.fcmp_ordered('==', xi, yi) + return builder.and_(xr_eq_yr, xi_eq_yi) + + +def np_complex_ne_impl(context, builder, sig, args): + # equivalent to macro CNE in NumPy's loops.c.src + # (xr != yr || xi != yi) + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + + ty = sig.args[0] + in1, in2 = [context.make_complex(builder, ty, value=arg) for arg in args] + xr = in1.real + xi = in1.imag + yr = in2.real + yi = in2.imag + + xr_ne_yr = builder.fcmp_unordered('!=', xr, yr) + xi_ne_yi = builder.fcmp_unordered('!=', xi, yi) + return builder.or_(xr_ne_yr, xi_ne_yi) + + +######################################################################## +# NumPy logical algebra + +# these are made generic for all types for now, assuming that +# cgutils.is_true works in the underlying types. + +def _complex_is_true(context, builder, ty, val): + complex_val = context.make_complex(builder, ty, value=val) + re_true = cgutils.is_true(builder, complex_val.real) + im_true = cgutils.is_true(builder, complex_val.imag) + return builder.or_(re_true, im_true) + + +def np_logical_and_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + a = cgutils.is_true(builder, args[0]) + b = cgutils.is_true(builder, args[1]) + return builder.and_(a, b) + + +def np_complex_logical_and_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + a = _complex_is_true(context, builder, sig.args[0], args[0]) + b = _complex_is_true(context, builder, sig.args[1], args[1]) + return builder.and_(a, b) + + +def np_logical_or_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + a = cgutils.is_true(builder, args[0]) + b = cgutils.is_true(builder, args[1]) + return builder.or_(a, b) + + +def np_complex_logical_or_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + a = _complex_is_true(context, builder, sig.args[0], args[0]) + b = _complex_is_true(context, builder, sig.args[1], args[1]) + return builder.or_(a, b) + + +def np_logical_xor_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + a = cgutils.is_true(builder, args[0]) + b = cgutils.is_true(builder, args[1]) + return builder.xor(a, b) + + +def np_complex_logical_xor_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2, return_type=types.boolean) + a = _complex_is_true(context, builder, sig.args[0], args[0]) + b = _complex_is_true(context, builder, sig.args[1], args[1]) + return builder.xor(a, b) + + +def np_logical_not_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + return cgutils.is_false(builder, args[0]) + + +def np_complex_logical_not_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + a = _complex_is_true(context, builder, sig.args[0], args[0]) + return builder.not_(a) + +######################################################################## +# NumPy style max/min +# +# There are 2 different sets of functions to perform max and min in +# NumPy: maximum/minimum and fmax/fmin. +# Both differ in the way NaNs are handled, so the actual differences +# come in action only on float/complex numbers. The functions used for +# integers is shared. For booleans maximum is equivalent to or, and +# minimum is equivalent to and. Datetime support will go elsewhere. + +def np_int_smax_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + arg1, arg2 = args + arg1_sge_arg2 = builder.icmp_signed('>=', arg1, arg2) + return builder.select(arg1_sge_arg2, arg1, arg2) + + +def np_int_umax_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + arg1, arg2 = args + arg1_uge_arg2 = builder.icmp_unsigned('>=', arg1, arg2) + return builder.select(arg1_uge_arg2, arg1, arg2) + + +def np_real_maximum_impl(context, builder, sig, args): + # maximum prefers nan (tries to return a nan). + _check_arity_and_homogeneity(sig, args, 2) + + arg1, arg2 = args + arg1_nan = builder.fcmp_unordered('uno', arg1, arg1) + any_nan = builder.fcmp_unordered('uno', arg1, arg2) + nan_result = builder.select(arg1_nan, arg1, arg2) + + arg1_ge_arg2 = builder.fcmp_ordered('>=', arg1, arg2) + non_nan_result = builder.select(arg1_ge_arg2, arg1, arg2) + + return builder.select(any_nan, nan_result, non_nan_result) + + +def np_real_fmax_impl(context, builder, sig, args): + # fmax prefers non-nan (tries to return a non-nan). + _check_arity_and_homogeneity(sig, args, 2) + + arg1, arg2 = args + arg2_nan = builder.fcmp_unordered('uno', arg2, arg2) + any_nan = builder.fcmp_unordered('uno', arg1, arg2) + nan_result = builder.select(arg2_nan, arg1, arg2) + + arg1_ge_arg2 = builder.fcmp_ordered('>=', arg1, arg2) + non_nan_result = builder.select(arg1_ge_arg2, arg1, arg2) + + return builder.select(any_nan, nan_result, non_nan_result) + + +def np_complex_maximum_impl(context, builder, sig, args): + # maximum prefers nan (tries to return a nan). + # There is an extra caveat with complex numbers, as there is more + # than one type of nan. NumPy's docs state that the nan in the + # first argument is returned when both arguments are nans. + # If only one nan is found, that nan is returned. + _check_arity_and_homogeneity(sig, args, 2) + ty = sig.args[0] + bc_sig = typing.signature(types.boolean, ty) + bcc_sig = typing.signature(types.boolean, *[ty]*2) + arg1, arg2 = args + arg1_nan = np_complex_isnan_impl(context, builder, bc_sig, [arg1]) + arg2_nan = np_complex_isnan_impl(context, builder, bc_sig, [arg2]) + any_nan = builder.or_(arg1_nan, arg2_nan) + nan_result = builder.select(arg1_nan, arg1, arg2) + + arg1_ge_arg2 = np_complex_ge_impl(context, builder, bcc_sig, args) + non_nan_result = builder.select(arg1_ge_arg2, arg1, arg2) + + return builder.select(any_nan, nan_result, non_nan_result) + + +def np_complex_fmax_impl(context, builder, sig, args): + # fmax prefers non-nan (tries to return a non-nan). + # There is an extra caveat with complex numbers, as there is more + # than one type of nan. NumPy's docs state that the nan in the + # first argument is returned when both arguments are nans. + _check_arity_and_homogeneity(sig, args, 2) + ty = sig.args[0] + bc_sig = typing.signature(types.boolean, ty) + bcc_sig = typing.signature(types.boolean, *[ty]*2) + arg1, arg2 = args + arg1_nan = np_complex_isnan_impl(context, builder, bc_sig, [arg1]) + arg2_nan = np_complex_isnan_impl(context, builder, bc_sig, [arg2]) + any_nan = builder.or_(arg1_nan, arg2_nan) + nan_result = builder.select(arg2_nan, arg1, arg2) + + arg1_ge_arg2 = np_complex_ge_impl(context, builder, bcc_sig, args) + non_nan_result = builder.select(arg1_ge_arg2, arg1, arg2) + + return builder.select(any_nan, nan_result, non_nan_result) + + +def np_int_smin_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + arg1, arg2 = args + arg1_sle_arg2 = builder.icmp_signed('<=', arg1, arg2) + return builder.select(arg1_sle_arg2, arg1, arg2) + + +def np_int_umin_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + arg1, arg2 = args + arg1_ule_arg2 = builder.icmp_unsigned('<=', arg1, arg2) + return builder.select(arg1_ule_arg2, arg1, arg2) + + +def np_real_minimum_impl(context, builder, sig, args): + # minimum prefers nan (tries to return a nan). + _check_arity_and_homogeneity(sig, args, 2) + + arg1, arg2 = args + arg1_nan = builder.fcmp_unordered('uno', arg1, arg1) + any_nan = builder.fcmp_unordered('uno', arg1, arg2) + nan_result = builder.select(arg1_nan, arg1, arg2) + + arg1_le_arg2 = builder.fcmp_ordered('<=', arg1, arg2) + non_nan_result = builder.select(arg1_le_arg2, arg1, arg2) + + return builder.select(any_nan, nan_result, non_nan_result) + + +def np_real_fmin_impl(context, builder, sig, args): + # fmin prefers non-nan (tries to return a non-nan). + _check_arity_and_homogeneity(sig, args, 2) + + arg1, arg2 = args + arg1_nan = builder.fcmp_unordered('uno', arg1, arg1) + any_nan = builder.fcmp_unordered('uno', arg1, arg2) + nan_result = builder.select(arg1_nan, arg2, arg1) + + arg1_le_arg2 = builder.fcmp_ordered('<=', arg1, arg2) + non_nan_result = builder.select(arg1_le_arg2, arg1, arg2) + + return builder.select(any_nan, nan_result, non_nan_result) + + +def np_complex_minimum_impl(context, builder, sig, args): + # minimum prefers nan (tries to return a nan). + # There is an extra caveat with complex numbers, as there is more + # than one type of nan. NumPy's docs state that the nan in the + # first argument is returned when both arguments are nans. + # If only one nan is found, that nan is returned. + _check_arity_and_homogeneity(sig, args, 2) + ty = sig.args[0] + bc_sig = typing.signature(types.boolean, ty) + bcc_sig = typing.signature(types.boolean, *[ty]*2) + arg1, arg2 = args + arg1_nan = np_complex_isnan_impl(context, builder, bc_sig, [arg1]) + arg2_nan = np_complex_isnan_impl(context, builder, bc_sig, [arg2]) + any_nan = builder.or_(arg1_nan, arg2_nan) + nan_result = builder.select(arg1_nan, arg1, arg2) + + arg1_le_arg2 = np_complex_le_impl(context, builder, bcc_sig, args) + non_nan_result = builder.select(arg1_le_arg2, arg1, arg2) + + return builder.select(any_nan, nan_result, non_nan_result) + + +def np_complex_fmin_impl(context, builder, sig, args): + # fmin prefers non-nan (tries to return a non-nan). + # There is an extra caveat with complex numbers, as there is more + # than one type of nan. NumPy's docs state that the nan in the + # first argument is returned when both arguments are nans. + _check_arity_and_homogeneity(sig, args, 2) + ty = sig.args[0] + bc_sig = typing.signature(types.boolean, ty) + bcc_sig = typing.signature(types.boolean, *[ty]*2) + arg1, arg2 = args + arg1_nan = np_complex_isnan_impl(context, builder, bc_sig, [arg1]) + arg2_nan = np_complex_isnan_impl(context, builder, bc_sig, [arg2]) + any_nan = builder.or_(arg1_nan, arg2_nan) + nan_result = builder.select(arg2_nan, arg1, arg2) + + arg1_le_arg2 = np_complex_le_impl(context, builder, bcc_sig, args) + non_nan_result = builder.select(arg1_le_arg2, arg1, arg2) + + return builder.select(any_nan, nan_result, non_nan_result) + + +######################################################################## +# NumPy floating point misc + +def np_int_isnan_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + return cgutils.false_bit + + +def np_real_isnan_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + return mathimpl.is_nan(builder, args[0]) + + +def np_complex_isnan_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + + x, = args + ty, = sig.args + complex_val = context.make_complex(builder, ty, value=x) + return cmathimpl.is_nan(builder, complex_val) + + +def np_int_isfinite_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + return cgutils.true_bit + + +def np_datetime_isfinite_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + return builder.icmp_unsigned('!=', args[0], npdatetime.NAT) + + +def np_datetime_isnat_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + return builder.icmp_signed('==', args[0], npdatetime.NAT) + + +def np_real_isfinite_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + return mathimpl.is_finite(builder, args[0]) + + +def np_complex_isfinite_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + x, = args + ty, = sig.args + complex_val = context.make_complex(builder, ty, value=x) + return cmathimpl.is_finite(builder, complex_val) + + +def np_int_isinf_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + return cgutils.false_bit + + +def np_real_isinf_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + return mathimpl.is_inf(builder, args[0]) + + +def np_complex_isinf_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + x, = args + ty, = sig.args + complex_val = context.make_complex(builder, ty, value=x) + return cmathimpl.is_inf(builder, complex_val) + + +def np_real_signbit_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 1, return_type=types.boolean) + # there's no signbit intrinsic in LLVM, so just bitcast as int, mask the + # signbit and cmp against 0. + masks = { + types.float16: context.get_constant(types.uint16, 0x8000), + types.float32: context.get_constant(types.uint32, 0x80000000), + types.float64: context.get_constant(types.uint64, 0x8000000000000000), + } + arg_ty = sig.args[0] + arg_int_ty = getattr(types, f'uint{arg_ty.bitwidth}') + arg_ll_int_ty = context.get_value_type(arg_int_ty) + int_res = builder.and_(builder.bitcast(args[0], arg_ll_int_ty), + masks[arg_ty]) + bool_res = builder.icmp_unsigned('!=', int_res, int_res.type(0)) + return bool_res + + +def np_real_copysign_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + + return mathimpl.copysign_float_impl(context, builder, sig, args) + +def np_real_nextafter_impl(context, builder, sig, args): + _check_arity_and_homogeneity(sig, args, 2) + + dispatch_table = { + types.float32: 'numba_nextafterf', + types.float64: 'numba_nextafter', + } + + return _dispatch_func_by_name_type(context, builder, sig, args, + dispatch_table, 'nextafter') + +def np_real_spacing_impl(context, builder, sig, args): + # This is different to how NumPy does it, NumPy has a specialisation of + # nextafter called _next, which is used. See: + # https://github.com/numpy/numpy/blob/12c2b7dd62fc0c14b81c8892ed5f4f59cc94d09c/numpy/core/src/npymath/ieee754.c.src#L32-L38 + # Numba elects to use `nextafter` for a similar behaviour to save + # translating this very involved function. Further, the NumPy comments note + # that there is a lot of redundancy present between the two. + _check_arity_and_homogeneity(sig, args, 1) + + dispatch_table = { + types.float32: 'numba_nextafterf', + types.float64: 'numba_nextafter', + } + + [ty] = sig.args + inner_sig = typing.signature(sig.return_type, ty, ty) + ll_ty = args[0].type + ll_inf = ll_ty(np.inf) + fnty = llvmlite.ir.FunctionType(ll_ty, [ll_ty, ll_ty]) + fn = cgutils.insert_pure_function(builder.module, fnty, + name='llvm.copysign') + ll_sinf = builder.call(fn, [ll_inf, args[0]]) + inner_args = args + [ll_sinf,] + nextafter = _dispatch_func_by_name_type(context, builder, inner_sig, + inner_args, dispatch_table, + 'nextafter') + return builder.fsub(nextafter, args[0]) + + +def np_real_ldexp_impl(context, builder, sig, args): + # this one is slightly different to other ufuncs. + # arguments are not homogeneous and second arg may come as + # an 'i' or an 'l'. + + # the function expects the second argument to be have a C int type + x1, x2 = args + ty1, ty2 = sig.args + # note that types.intc should be equivalent to int_ that is + # 'NumPy's default int') + x2 = context.cast(builder, x2, ty2, types.intc) + f_fi_sig = typing.signature(ty1, ty1, types.intc) + return mathimpl.ldexp_impl(context, builder, f_fi_sig, (x1, x2)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/npyimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/npyimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..78768ecf62c5f8560486491c3aaace1c33edd270 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/npyimpl.py @@ -0,0 +1,878 @@ +""" +Implementation of functions in the Numpy package. +""" + + +import math +import sys +import itertools +from collections import namedtuple + +import llvmlite.ir as ir + +import numpy as np +import operator + +from numba.np import arrayobj, ufunc_db, numpy_support +from numba.np.ufunc.sigparse import parse_signature +from numba.core.imputils import (Registry, impl_ret_new_ref, force_error_model, + impl_ret_borrowed) +from numba.core import typing, types, utils, cgutils, callconv, config +from numba.np.numpy_support import ( + ufunc_find_matching_loop, select_array_wrapper, from_dtype, _ufunc_loop_sig +) +from numba.np.arrayobj import _getitem_array_generic +from numba.core.typing import npydecl +from numba.core.extending import overload, intrinsic + +from numba.core import errors + +registry = Registry('npyimpl') + + +######################################################################## + +# In the way we generate code, ufuncs work with scalar as well as +# with array arguments. The following helper classes help dealing +# with scalar and array arguments in a regular way. +# +# In short, the classes provide a uniform interface. The interface +# handles the indexing of as many dimensions as the array may have. +# For scalars, all indexing is ignored and when the value is read, +# the scalar is returned. For arrays code for actual indexing is +# generated and reading performs the appropriate indirection. + +class _ScalarIndexingHelper(object): + def update_indices(self, loop_indices, name): + pass + + def as_values(self): + pass + + +class _ScalarHelper(object): + """Helper class to handle scalar arguments (and result). + Note that store_data is only used when generating code for + a scalar ufunc and to write the output value. + + For loading, the value is directly used without having any + kind of indexing nor memory backing it up. This is the use + for input arguments. + + For storing, a variable is created in the stack where the + value will be written. + + Note that it is not supported (as it is unneeded for our + current use-cases) reading back a stored value. This class + will always "load" the original value it got at its creation. + """ + def __init__(self, ctxt, bld, val, ty): + self.context = ctxt + self.builder = bld + self.val = val + self.base_type = ty + intpty = ctxt.get_value_type(types.intp) + self.shape = [ir.Constant(intpty, 1)] + + lty = ctxt.get_data_type(ty) if ty != types.boolean else ir.IntType(1) + self._ptr = cgutils.alloca_once(bld, lty) + + def create_iter_indices(self): + return _ScalarIndexingHelper() + + def load_data(self, indices): + return self.val + + def store_data(self, indices, val): + self.builder.store(val, self._ptr) + + @property + def return_val(self): + return self.builder.load(self._ptr) + + +class _ArrayIndexingHelper(namedtuple('_ArrayIndexingHelper', + ('array', 'indices'))): + def update_indices(self, loop_indices, name): + bld = self.array.builder + intpty = self.array.context.get_value_type(types.intp) + ONE = ir.Constant(ir.IntType(intpty.width), 1) + + # we are only interested in as many inner dimensions as dimensions + # the indexed array has (the outer dimensions are broadcast, so + # ignoring the outer indices produces the desired result. + indices = loop_indices[len(loop_indices) - len(self.indices):] + for src, dst, dim in zip(indices, self.indices, self.array.shape): + cond = bld.icmp_unsigned('>', dim, ONE) + with bld.if_then(cond): + bld.store(src, dst) + + def as_values(self): + """ + The indexing helper is built using alloca for each value, so it + actually contains pointers to the actual indices to load. Note + that update_indices assumes the same. This method returns the + indices as values + """ + bld = self.array.builder + return [bld.load(index) for index in self.indices] + + +class _ArrayHelper(namedtuple('_ArrayHelper', ('context', 'builder', + 'shape', 'strides', 'data', + 'layout', 'base_type', 'ndim', + 'return_val'))): + """Helper class to handle array arguments/result. + It provides methods to generate code loading/storing specific + items as well as support code for handling indices. + """ + def create_iter_indices(self): + intpty = self.context.get_value_type(types.intp) + ZERO = ir.Constant(ir.IntType(intpty.width), 0) + + indices = [] + for i in range(self.ndim): + x = cgutils.alloca_once(self.builder, ir.IntType(intpty.width)) + self.builder.store(ZERO, x) + indices.append(x) + return _ArrayIndexingHelper(self, indices) + + def _load_effective_address(self, indices): + return cgutils.get_item_pointer2(self.context, + self.builder, + data=self.data, + shape=self.shape, + strides=self.strides, + layout=self.layout, + inds=indices) + + def load_data(self, indices): + model = self.context.data_model_manager[self.base_type] + ptr = self._load_effective_address(indices) + return model.load_from_data_pointer(self.builder, ptr) + + def store_data(self, indices, value): + ctx = self.context + bld = self.builder + store_value = ctx.get_value_as_data(bld, self.base_type, value) + assert ctx.get_data_type(self.base_type) == store_value.type + bld.store(store_value, self._load_effective_address(indices)) + + +class _ArrayGUHelper(namedtuple('_ArrayHelper', ('context', 'builder', + 'shape', 'strides', 'data', + 'layout', 'base_type', 'ndim', + 'inner_arr_ty', 'is_input_arg'))): + """Helper class to handle array arguments/result. + It provides methods to generate code loading/storing specific + items as well as support code for handling indices. + + Contrary to _ArrayHelper, this class can create a view to a subarray + """ + def create_iter_indices(self): + intpty = self.context.get_value_type(types.intp) + ZERO = ir.Constant(ir.IntType(intpty.width), 0) + + indices = [] + for i in range(self.ndim - self.inner_arr_ty.ndim): + x = cgutils.alloca_once(self.builder, ir.IntType(intpty.width)) + self.builder.store(ZERO, x) + indices.append(x) + return _ArrayIndexingHelper(self, indices) + + def _load_effective_address(self, indices): + context = self.context + builder = self.builder + arr_ty = types.Array(self.base_type, self.ndim, self.layout) + arr = context.make_array(arr_ty)(context, builder, self.data) + + return cgutils.get_item_pointer2(context, + builder, + data=arr.data, + shape=self.shape, + strides=self.strides, + layout=self.layout, + inds=indices) + + def load_data(self, indices): + context, builder = self.context, self.builder + + if self.inner_arr_ty.ndim == 0 and self.is_input_arg: + # scalar case for input arguments + model = context.data_model_manager[self.base_type] + ptr = self._load_effective_address(indices) + return model.load_from_data_pointer(builder, ptr) + elif self.inner_arr_ty.ndim == 0 and not self.is_input_arg: + # Output arrays are handled as 1d with shape=(1,) when its + # signature represents a scalar. For instance: "(n),(m) -> ()" + intpty = context.get_value_type(types.intp) + one = intpty(1) + + fromty = types.Array(self.base_type, self.ndim, self.layout) + toty = types.Array(self.base_type, 1, self.layout) + itemsize = intpty(arrayobj.get_itemsize(context, fromty)) + + # create a view from the original ndarray to a 1d array + arr_from = self.context.make_array(fromty)(context, + builder, + self.data) + arr_to = self.context.make_array(toty)(context, builder) + arrayobj.populate_array( + arr_to, + data=self._load_effective_address(indices), + shape=cgutils.pack_array(builder, [one]), + strides=cgutils.pack_array(builder, [itemsize]), + itemsize=arr_from.itemsize, + meminfo=arr_from.meminfo, + parent=arr_from.parent) + return arr_to._getvalue() + else: + # generic case + # getitem n-dim array -> m-dim array, where N > M + index_types = (types.int64,) * (self.ndim - self.inner_arr_ty.ndim) + arrty = types.Array(self.base_type, self.ndim, self.layout) + arr = self.context.make_array(arrty)(context, builder, self.data) + res = _getitem_array_generic(context, builder, + self.inner_arr_ty, arrty, arr, + index_types, indices) + return impl_ret_borrowed(context, builder, self.inner_arr_ty, res) + + def guard_shape(self, loopshape): + inner_ndim = self.inner_arr_ty.ndim + def raise_impl(loop_shape, array_shape): + # This would in fact be a test for broadcasting. + # Broadcast would fail if, ignoring the core dimensions, the + # remaining ones are different than indices given by loop shape. + + remaining = len(array_shape) - inner_ndim + _raise = (remaining > len(loop_shape)) + if not _raise: + for i in range(remaining): + _raise |= (array_shape[i] != loop_shape[i]) + if _raise: + # Ideally we should call `np.broadcast_shapes` with loop and + # array shapes. But since broadcasting is not supported here, + # we just raise an error + # TODO: check why raising a dynamic exception here fails + raise ValueError('Loop and array shapes are incompatible') + + context, builder = self.context, self.builder + sig = types.none( + types.UniTuple(types.intp, len(loopshape)), + types.UniTuple(types.intp, len(self.shape)), + ) + tup = (context.make_tuple(builder, sig.args[0], loopshape), + context.make_tuple(builder, sig.args[1], self.shape)) + context.compile_internal(builder, raise_impl, sig, tup) + + def guard_match_core_dims(self, other: '_ArrayGUHelper', ndims: int): + # arguments with the same signature should match their core dimensions + # + # @guvectorize('(n,m), (n,m) -> (n)') + # def foo(x, y, res): + # ... + # + # x and y should have the same core (2D) dimensions + def raise_impl(self_shape, other_shape): + same = True + a, b = len(self_shape) - ndims, len(other_shape) - ndims + for i in range(ndims): + same &= self_shape[a + i] == other_shape[b + i] + if not same: + # NumPy raises the following: + # ValueError: gufunc: Input operand 1 has a mismatch in its + # core dimension 0, with gufunc signature (n),(n) -> () + # (size 3 is different from 2) + # But since we cannot raise a dynamic exception here, we just + # (try) something meaninful + msg = ('Operand has a mismatch in one of its core dimensions. ' + 'Please, check if all arguments to a @guvectorize ' + 'function have the same core dimensions.') + raise ValueError(msg) + + context, builder = self.context, self.builder + sig = types.none( + types.UniTuple(types.intp, len(self.shape)), + types.UniTuple(types.intp, len(other.shape)), + ) + tup = (context.make_tuple(builder, sig.args[0], self.shape), + context.make_tuple(builder, sig.args[1], other.shape),) + context.compile_internal(builder, raise_impl, sig, tup) + + +def _prepare_argument(ctxt, bld, inp, tyinp, where='input operand'): + """returns an instance of the appropriate Helper (either + _ScalarHelper or _ArrayHelper) class to handle the argument. + using the polymorphic interface of the Helper classes, scalar + and array cases can be handled with the same code""" + + # first un-Optional Optionals + if isinstance(tyinp, types.Optional): + oty = tyinp + tyinp = tyinp.type + inp = ctxt.cast(bld, inp, oty, tyinp) + + # then prepare the arg for a concrete instance + if isinstance(tyinp, types.ArrayCompatible): + ary = ctxt.make_array(tyinp)(ctxt, bld, inp) + shape = cgutils.unpack_tuple(bld, ary.shape, tyinp.ndim) + strides = cgutils.unpack_tuple(bld, ary.strides, tyinp.ndim) + return _ArrayHelper(ctxt, bld, shape, strides, ary.data, + tyinp.layout, tyinp.dtype, tyinp.ndim, inp) + elif (types.unliteral(tyinp) in types.number_domain | {types.boolean} + or isinstance(tyinp, types.scalars._NPDatetimeBase)): + return _ScalarHelper(ctxt, bld, inp, tyinp) + else: + raise NotImplementedError('unsupported type for {0}: {1}'.format(where, + str(tyinp))) + + +if config.USE_LEGACY_TYPE_SYSTEM: + _broadcast_onto_sig = types.intp(types.intp, types.CPointer(types.intp), + types.intp, types.CPointer(types.intp)) +else: + _broadcast_onto_sig = types.np_intp(types.np_intp, types.CPointer(types.np_intp), + types.np_intp, types.CPointer(types.np_intp)) + +def _broadcast_onto(src_ndim, src_shape, dest_ndim, dest_shape): + '''Low-level utility function used in calculating a shape for + an implicit output array. This function assumes that the + destination shape is an LLVM pointer to a C-style array that was + already initialized to a size of one along all axes. + + Returns an integer value: + >= 1 : Succeeded. Return value should equal the number of dimensions in + the destination shape. + 0 : Failed to broadcast because source shape is larger than the + destination shape (this case should be weeded out at type + checking). + < 0 : Failed to broadcast onto destination axis, at axis number == + -(return_value + 1). + ''' + if src_ndim > dest_ndim: + # This check should have been done during type checking, but + # let's be defensive anyway... + return 0 + else: + src_index = 0 + dest_index = dest_ndim - src_ndim + while src_index < src_ndim: + src_dim_size = src_shape[src_index] + dest_dim_size = dest_shape[dest_index] + # Check to see if we've already mutated the destination + # shape along this axis. + if dest_dim_size != 1: + # If we have mutated the destination shape already, + # then the source axis size must either be one, + # or the destination axis size. + if src_dim_size != dest_dim_size and src_dim_size != 1: + return -(dest_index + 1) + elif src_dim_size != 1: + # If the destination size is still its initial + dest_shape[dest_index] = src_dim_size + src_index += 1 + dest_index += 1 + return dest_index + +def _build_array(context, builder, array_ty, input_types, inputs): + """Utility function to handle allocation of an implicit output array + given the target context, builder, output array type, and a list of + _ArrayHelper instances. + """ + # First, strip optional types, ufunc loops are typed on concrete types + input_types = [x.type if isinstance(x, types.Optional) else x + for x in input_types] + + intp_ty = context.get_value_type(types.intp) + def make_intp_const(val): + return context.get_constant(types.intp, val) + + ZERO = make_intp_const(0) + ONE = make_intp_const(1) + + src_shape = cgutils.alloca_once(builder, intp_ty, array_ty.ndim, + "src_shape") + dest_ndim = make_intp_const(array_ty.ndim) + dest_shape = cgutils.alloca_once(builder, intp_ty, array_ty.ndim, + "dest_shape") + dest_shape_addrs = tuple(cgutils.gep_inbounds(builder, dest_shape, index) + for index in range(array_ty.ndim)) + + # Initialize the destination shape with all ones. + for dest_shape_addr in dest_shape_addrs: + builder.store(ONE, dest_shape_addr) + + # For each argument, try to broadcast onto the destination shape, + # mutating along any axis where the argument shape is not one and + # the destination shape is one. + for arg_number, arg in enumerate(inputs): + if not hasattr(arg, "ndim"): # Skip scalar arguments + continue + arg_ndim = make_intp_const(arg.ndim) + for index in range(arg.ndim): + builder.store(arg.shape[index], + cgutils.gep_inbounds(builder, src_shape, index)) + arg_result = context.compile_internal( + builder, _broadcast_onto, _broadcast_onto_sig, + [arg_ndim, src_shape, dest_ndim, dest_shape]) + with cgutils.if_unlikely(builder, + builder.icmp_signed('<', arg_result, ONE)): + msg = "unable to broadcast argument %d to output array" % ( + arg_number,) + + loc = errors.loc_info.get('loc', None) + if loc is not None: + msg += '\nFile "%s", line %d, ' % (loc.filename, loc.line) + + context.call_conv.return_user_exc(builder, ValueError, (msg,)) + + real_array_ty = array_ty.as_array + + dest_shape_tup = tuple(builder.load(dest_shape_addr) + for dest_shape_addr in dest_shape_addrs) + array_val = arrayobj._empty_nd_impl(context, builder, real_array_ty, + dest_shape_tup) + + # Get the best argument to call __array_wrap__ on + array_wrapper_index = select_array_wrapper(input_types) + array_wrapper_ty = input_types[array_wrapper_index] + try: + # __array_wrap__(source wrapped array, out array) -> out wrapped array + array_wrap = context.get_function('__array_wrap__', + array_ty(array_wrapper_ty, real_array_ty)) + except NotImplementedError: + # If it's the same priority as a regular array, assume we + # should use the allocated array unchanged. + if array_wrapper_ty.array_priority != types.Array.array_priority: + raise + out_val = array_val._getvalue() + else: + wrap_args = (inputs[array_wrapper_index].return_val, array_val._getvalue()) + out_val = array_wrap(builder, wrap_args) + + ndim = array_ty.ndim + shape = cgutils.unpack_tuple(builder, array_val.shape, ndim) + strides = cgutils.unpack_tuple(builder, array_val.strides, ndim) + return _ArrayHelper(context, builder, shape, strides, array_val.data, + array_ty.layout, array_ty.dtype, ndim, + out_val) + +# ufuncs either return a single result when nout == 1, else a tuple of results + +def _unpack_output_types(ufunc, sig): + if ufunc.nout == 1: + return [sig.return_type] + else: + return list(sig.return_type) + + +def _unpack_output_values(ufunc, builder, values): + if ufunc.nout == 1: + return [values] + else: + return cgutils.unpack_tuple(builder, values) + + +def _pack_output_values(ufunc, context, builder, typ, values): + if ufunc.nout == 1: + return values[0] + else: + return context.make_tuple(builder, typ, values) + + +def numpy_ufunc_kernel(context, builder, sig, args, ufunc, kernel_class): + # This is the code generator that builds all the looping needed + # to execute a numpy functions over several dimensions (including + # scalar cases). + # + # context - the code generation context + # builder - the code emitter + # sig - signature of the ufunc + # args - the args to the ufunc + # ufunc - the ufunc itself + # kernel_class - a code generating subclass of _Kernel that provides + + arguments = [_prepare_argument(context, builder, arg, tyarg) + for arg, tyarg in zip(args, sig.args)] + + if len(arguments) < ufunc.nin: + raise RuntimeError( + "Not enough inputs to {}, expected {} got {}" + .format(ufunc.__name__, ufunc.nin, len(arguments))) + + for out_i, ret_ty in enumerate(_unpack_output_types(ufunc, sig)): + if ufunc.nin + out_i >= len(arguments): + # this out argument is not provided + if isinstance(ret_ty, types.ArrayCompatible): + output = _build_array(context, builder, ret_ty, sig.args, arguments) + else: + output = _prepare_argument( + context, builder, + ir.Constant(context.get_value_type(ret_ty), None), ret_ty) + arguments.append(output) + elif context.enable_nrt: + # Incref the output + context.nrt.incref(builder, ret_ty, args[ufunc.nin + out_i]) + + inputs = arguments[:ufunc.nin] + outputs = arguments[ufunc.nin:] + assert len(outputs) == ufunc.nout + + outer_sig = _ufunc_loop_sig( + [a.base_type for a in outputs], + [a.base_type for a in inputs] + ) + kernel = kernel_class(context, builder, outer_sig) + intpty = context.get_value_type(types.intp) + + indices = [inp.create_iter_indices() for inp in inputs] + + # assume outputs are all the same size, which numpy requires + + loopshape = outputs[0].shape + + # count the number of C and F layout arrays, respectively + input_layouts = [inp.layout for inp in inputs + if isinstance(inp, _ArrayHelper)] + num_c_layout = len([x for x in input_layouts if x == 'C']) + num_f_layout = len([x for x in input_layouts if x == 'F']) + + # Only choose F iteration order if more arrays are in F layout. + # Default to C order otherwise. + # This is a best effort for performance. NumPy has more fancy logic that + # uses array iterators in non-trivial cases. + if num_f_layout > num_c_layout: + order = 'F' + else: + order = 'C' + + with cgutils.loop_nest(builder, loopshape, intp=intpty, order=order) as loop_indices: + vals_in = [] + for i, (index, arg) in enumerate(zip(indices, inputs)): + index.update_indices(loop_indices, i) + vals_in.append(arg.load_data(index.as_values())) + + vals_out = _unpack_output_values(ufunc, builder, kernel.generate(*vals_in)) + for val_out, output in zip(vals_out, outputs): + output.store_data(loop_indices, val_out) + + out = _pack_output_values(ufunc, context, builder, sig.return_type, [o.return_val for o in outputs]) + return impl_ret_new_ref(context, builder, sig.return_type, out) + + +def numpy_gufunc_kernel(context, builder, sig, args, ufunc, kernel_class): + arguments = [] + expected_ndims = kernel_class.dufunc.expected_ndims() + expected_ndims = expected_ndims[0] + expected_ndims[1] + is_input = [True] * ufunc.nin + [False] * ufunc.nout + for arg, ty, exp_ndim, is_inp in zip(args, sig.args, expected_ndims, is_input): # noqa: E501 + if isinstance(ty, types.ArrayCompatible): + # Create an array helper that iteration returns a subarray + # with ndim specified by "exp_ndim" + arr = context.make_array(ty)(context, builder, arg) + shape = cgutils.unpack_tuple(builder, arr.shape, ty.ndim) + strides = cgutils.unpack_tuple(builder, arr.strides, ty.ndim) + inner_arr_ty = ty.copy(ndim=exp_ndim) + ndim = ty.ndim + layout = ty.layout + base_type = ty.dtype + array_helper = _ArrayGUHelper(context, builder, + shape, strides, arg, + layout, base_type, ndim, + inner_arr_ty, is_inp) + arguments.append(array_helper) + else: + scalar_helper = _ScalarHelper(context, builder, arg, ty) + arguments.append(scalar_helper) + kernel = kernel_class(context, builder, sig) + + layouts = [arg.layout for arg in arguments + if isinstance(arg, _ArrayGUHelper)] + num_c_layout = len([x for x in layouts if x == 'C']) + num_f_layout = len([x for x in layouts if x == 'F']) + + # Only choose F iteration order if more arrays are in F layout. + # Default to C order otherwise. + # This is a best effort for performance. NumPy has more fancy logic that + # uses array iterators in non-trivial cases. + if num_f_layout > num_c_layout: + order = 'F' + else: + order = 'C' + + outputs = arguments[ufunc.nin:] + intpty = context.get_value_type(types.intp) + indices = [inp.create_iter_indices() for inp in arguments] + loopshape_ndim = outputs[0].ndim - outputs[0].inner_arr_ty.ndim + loopshape = outputs[0].shape[ : loopshape_ndim] + + _sig = parse_signature(ufunc.gufunc_builder.signature) + for (idx_a, sig_a), (idx_b, sig_b) in itertools.combinations( + zip(range(len(arguments)), + _sig[0] + _sig[1]), + r = 2 + ): + # For each pair of arguments, both inputs and outputs, must match their + # inner dimensions if their signatures are the same. + arg_a, arg_b = arguments[idx_a], arguments[idx_b] + if sig_a == sig_b and \ + all(isinstance(x, _ArrayGUHelper) for x in (arg_a, arg_b)): + arg_a, arg_b = arguments[idx_a], arguments[idx_b] + arg_a.guard_match_core_dims(arg_b, len(sig_a)) + + for arg in arguments[:ufunc.nin]: + if isinstance(arg, _ArrayGUHelper): + arg.guard_shape(loopshape) + + with cgutils.loop_nest(builder, + loopshape, + intp=intpty, + order=order) as loop_indices: + vals_in = [] + for i, (index, arg) in enumerate(zip(indices, arguments)): + index.update_indices(loop_indices, i) + vals_in.append(arg.load_data(index.as_values())) + + kernel.generate(*vals_in) + + +# Kernels are the code to be executed inside the multidimensional loop. +class _Kernel(object): + def __init__(self, context, builder, outer_sig): + self.context = context + self.builder = builder + self.outer_sig = outer_sig + + def cast(self, val, fromty, toty): + """Numpy uses cast semantics that are different from standard Python + (for example, it does allow casting from complex to float). + + This method acts as a patch to context.cast so that it allows + complex to real/int casts. + + """ + if (isinstance(fromty, types.Complex) and + not isinstance(toty, types.Complex)): + # attempt conversion of the real part to the specified type. + # note that NumPy issues a warning in this kind of conversions + newty = fromty.underlying_float + attr = self.context.get_getattr(fromty, 'real') + val = attr(self.context, self.builder, fromty, val, 'real') + fromty = newty + # let the regular cast do the rest... + + return self.context.cast(self.builder, val, fromty, toty) + + def generate(self, *args): + isig = self.inner_sig + osig = self.outer_sig + cast_args = [self.cast(val, inty, outty) + for val, inty, outty in + zip(args, osig.args, isig.args)] + if self.cres.objectmode: + func_type = self.context.call_conv.get_function_type( + types.pyobject, [types.pyobject] * len(isig.args)) + else: + func_type = self.context.call_conv.get_function_type( + isig.return_type, isig.args) + module = self.builder.block.function.module + entry_point = cgutils.get_or_insert_function( + module, func_type, + self.cres.fndesc.llvm_func_name) + entry_point.attributes.add("alwaysinline") + + _, res = self.context.call_conv.call_function( + self.builder, entry_point, isig.return_type, isig.args, + cast_args) + return self.cast(res, isig.return_type, osig.return_type) + + +def _ufunc_db_function(ufunc): + """Use the ufunc loop type information to select the code generation + function from the table provided by the dict_of_kernels. The dict + of kernels maps the loop identifier to a function with the + following signature: (context, builder, signature, args). + + The loop type information has the form 'AB->C'. The letters to the + left of '->' are the input types (specified as NumPy letter + types). The letters to the right of '->' are the output + types. There must be 'ufunc.nin' letters to the left of '->', and + 'ufunc.nout' letters to the right. + + For example, a binary float loop resulting in a float, will have + the following signature: 'ff->f'. + + A given ufunc implements many loops. The list of loops implemented + for a given ufunc can be accessed using the 'types' attribute in + the ufunc object. The NumPy machinery selects the first loop that + fits a given calling signature (in our case, what we call the + outer_sig). This logic is mimicked by 'ufunc_find_matching_loop'. + """ + + class _KernelImpl(_Kernel): + def __init__(self, context, builder, outer_sig): + super(_KernelImpl, self).__init__(context, builder, outer_sig) + loop = ufunc_find_matching_loop( + ufunc, outer_sig.args + tuple(_unpack_output_types(ufunc, outer_sig))) + self.fn = context.get_ufunc_info(ufunc).get(loop.ufunc_sig) + self.inner_sig = _ufunc_loop_sig(loop.outputs, loop.inputs) + + if self.fn is None: + msg = "Don't know how to lower ufunc '{0}' for loop '{1}'" + raise NotImplementedError(msg.format(ufunc.__name__, loop)) + + def generate(self, *args): + isig = self.inner_sig + osig = self.outer_sig + + cast_args = [self.cast(val, inty, outty) + for val, inty, outty in zip(args, osig.args, + isig.args)] + with force_error_model(self.context, 'numpy'): + res = self.fn(self.context, self.builder, isig, cast_args) + dmm = self.context.data_model_manager + res = dmm[isig.return_type].from_return(self.builder, res) + return self.cast(res, isig.return_type, osig.return_type) + + return _KernelImpl + + +################################################################################ +# Helper functions that register the ufuncs + +def register_ufunc_kernel(ufunc, kernel, lower): + def do_ufunc(context, builder, sig, args): + return numpy_ufunc_kernel(context, builder, sig, args, ufunc, kernel) + + _any = types.Any + in_args = (_any,) * ufunc.nin + + # Add a lowering for each out argument that is missing. + for n_explicit_out in range(ufunc.nout + 1): + out_args = (types.Array,) * n_explicit_out + lower(ufunc, *in_args, *out_args)(do_ufunc) + + return kernel + + +def register_unary_operator_kernel(operator, ufunc, kernel, lower, + inplace=False): + assert not inplace # are there any inplace unary operators? + def lower_unary_operator(context, builder, sig, args): + return numpy_ufunc_kernel(context, builder, sig, args, ufunc, kernel) + _arr_kind = types.Array + lower(operator, _arr_kind)(lower_unary_operator) + + +def register_binary_operator_kernel(op, ufunc, kernel, lower, inplace=False): + def lower_binary_operator(context, builder, sig, args): + return numpy_ufunc_kernel(context, builder, sig, args, ufunc, kernel) + + def lower_inplace_operator(context, builder, sig, args): + # The visible signature is (A, B) -> A + # The implementation's signature (with explicit output) + # is (A, B, A) -> A + args = tuple(args) + (args[0],) + sig = typing.signature(sig.return_type, *sig.args + (sig.args[0],)) + return numpy_ufunc_kernel(context, builder, sig, args, ufunc, kernel) + + _any = types.Any + _arr_kind = types.Array + formal_sigs = [(_arr_kind, _arr_kind), (_any, _arr_kind), (_arr_kind, _any)] + for sig in formal_sigs: + if not inplace: + lower(op, *sig)(lower_binary_operator) + else: + lower(op, *sig)(lower_inplace_operator) + + +################################################################################ +# Use the contents of ufunc_db to initialize the supported ufuncs + +@registry.lower(operator.pos, types.Array) +def array_positive_impl(context, builder, sig, args): + '''Lowering function for +(array) expressions. Defined here + (numba.targets.npyimpl) since the remaining array-operator + lowering functions are also registered in this module. + ''' + class _UnaryPositiveKernel(_Kernel): + def generate(self, *args): + [val] = args + return val + + return numpy_ufunc_kernel(context, builder, sig, args, np.positive, + _UnaryPositiveKernel) + + +def register_ufuncs(ufuncs, lower): + kernels = {} + for ufunc in ufuncs: + db_func = _ufunc_db_function(ufunc) + kernels[ufunc] = register_ufunc_kernel(ufunc, db_func, lower) + + for _op_map in (npydecl.NumpyRulesUnaryArrayOperator._op_map, + npydecl.NumpyRulesArrayOperator._op_map, + ): + for operator, ufunc_name in _op_map.items(): + ufunc = getattr(np, ufunc_name) + kernel = kernels[ufunc] + if ufunc.nin == 1: + register_unary_operator_kernel(operator, ufunc, kernel, lower) + elif ufunc.nin == 2: + register_binary_operator_kernel(operator, ufunc, kernel, lower) + else: + raise RuntimeError("There shouldn't be any non-unary or binary operators") + + for _op_map in (npydecl.NumpyRulesInplaceArrayOperator._op_map, + ): + for operator, ufunc_name in _op_map.items(): + ufunc = getattr(np, ufunc_name) + kernel = kernels[ufunc] + if ufunc.nin == 1: + register_unary_operator_kernel(operator, ufunc, kernel, lower, + inplace=True) + elif ufunc.nin == 2: + register_binary_operator_kernel(operator, ufunc, kernel, lower, + inplace=True) + else: + raise RuntimeError("There shouldn't be any non-unary or binary operators") + + +register_ufuncs(ufunc_db.get_ufuncs(), registry.lower) + + +@intrinsic +def _make_dtype_object(typingctx, desc): + """Given a string or NumberClass description *desc*, returns the dtype object. + """ + def from_nb_type(nb_type): + return_type = types.DType(nb_type) + sig = return_type(desc) + + def codegen(context, builder, signature, args): + # All dtype objects are dummy values in LLVM. + # They only exist in the type level. + return context.get_dummy_value() + + return sig, codegen + + if isinstance(desc, types.Literal): + # Convert the str description into np.dtype then to numba type. + nb_type = from_dtype(np.dtype(desc.literal_value)) + return from_nb_type(nb_type) + elif isinstance(desc, types.functions.NumberClass): + thestr = str(desc.dtype) + # Convert the str description into np.dtype then to numba type. + nb_type = from_dtype(np.dtype(thestr)) + return from_nb_type(nb_type) + +@overload(np.dtype) +def numpy_dtype(desc): + """Provide an implementation so that numpy.dtype function can be lowered. + """ + if isinstance(desc, (types.Literal, types.functions.NumberClass)): + def imp(desc): + return _make_dtype_object(desc) + return imp + else: + raise errors.NumbaTypeError('unknown dtype descriptor: {}'.format(desc)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/numpy_support.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/numpy_support.py new file mode 100644 index 0000000000000000000000000000000000000000..e8de393a6e1622c996cb443a9b78bfe2080258a4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/numpy_support.py @@ -0,0 +1,796 @@ +import collections +import ctypes +import re + +import numpy as np + +from numba.core import errors, types, config +from numba.core.typing.templates import signature +from numba.np import npdatetime_helpers +from numba.core.errors import TypingError + +# re-export +from numba.core.cgutils import is_nonelike # noqa: F401 + + +numpy_version = tuple(map(int, np.__version__.split('.')[:2])) + + +if config.USE_LEGACY_TYPE_SYSTEM: + FROM_DTYPE = { + np.dtype('bool'): types.boolean, + np.dtype('int8'): types.int8, + np.dtype('int16'): types.int16, + np.dtype('int32'): types.int32, + np.dtype('int64'): types.int64, + + np.dtype('uint8'): types.uint8, + np.dtype('uint16'): types.uint16, + np.dtype('uint32'): types.uint32, + np.dtype('uint64'): types.uint64, + + np.dtype('float32'): types.float32, + np.dtype('float64'): types.float64, + np.dtype('float16'): types.float16, + np.dtype('complex64'): types.complex64, + np.dtype('complex128'): types.complex128, + + np.dtype(object): types.pyobject, + } +else: + FROM_DTYPE = { + np.dtype('bool'): types.np_bool_, + np.dtype('int8'): types.np_int8, + np.dtype('int16'): types.np_int16, + np.dtype('int32'): types.np_int32, + np.dtype('int64'): types.np_int64, + + np.dtype('uint8'): types.np_uint8, + np.dtype('uint16'): types.np_uint16, + np.dtype('uint32'): types.np_uint32, + np.dtype('uint64'): types.np_uint64, + + np.dtype('float32'): types.np_float32, + np.dtype('float64'): types.np_float64, + np.dtype('float16'): types.np_float16, + np.dtype('complex64'): types.np_complex64, + np.dtype('complex128'): types.np_complex128, + + np.dtype(object): types.pyobject, + } + + +re_typestr = re.compile(r'[<>=\|]([a-z])(\d+)?$', re.I) +re_datetimestr = re.compile(r'[<>=\|]([mM])8?(\[([a-z]+)\])?$', re.I) + +sizeof_unicode_char = np.dtype('U1').itemsize + + +def _from_str_dtype(dtype): + m = re_typestr.match(dtype.str) + if not m: + raise errors.NumbaNotImplementedError(dtype) + groups = m.groups() + typecode = groups[0] + if typecode == 'U': + # unicode + if dtype.byteorder not in '=|': + raise errors.NumbaNotImplementedError("Does not support non-native " + "byteorder") + count = dtype.itemsize // sizeof_unicode_char + assert count == int(groups[1]), "Unicode char size mismatch" + return types.UnicodeCharSeq(count) + + elif typecode == 'S': + # char + count = dtype.itemsize + assert count == int(groups[1]), "Char size mismatch" + return types.CharSeq(count) + + else: + raise errors.NumbaNotImplementedError(dtype) + + +def _from_datetime_dtype(dtype): + m = re_datetimestr.match(dtype.str) + if not m: + raise errors.NumbaNotImplementedError(dtype) + groups = m.groups() + typecode = groups[0] + unit = groups[2] or '' + if typecode == 'm': + return types.NPTimedelta(unit) + elif typecode == 'M': + return types.NPDatetime(unit) + else: + raise errors.NumbaNotImplementedError(dtype) + + +def from_dtype(dtype): + """ + Return a Numba Type instance corresponding to the given Numpy *dtype*. + NumbaNotImplementedError is raised on unsupported Numpy dtypes. + """ + if type(dtype) is type and issubclass(dtype, np.generic): + dtype = np.dtype(dtype) + elif getattr(dtype, "fields", None) is not None: + return from_struct_dtype(dtype) + + try: + return FROM_DTYPE[dtype] + except KeyError: + pass + + try: + char = dtype.char + except AttributeError: + pass + else: + if char in 'SU': + return _from_str_dtype(dtype) + if char in 'mM': + return _from_datetime_dtype(dtype) + if char in 'V' and dtype.subdtype is not None: + subtype = from_dtype(dtype.subdtype[0]) + return types.NestedArray(subtype, dtype.shape) + + raise errors.NumbaNotImplementedError(dtype) + + +_as_dtype_letters = { + types.NPDatetime: 'M8', + types.NPTimedelta: 'm8', + types.CharSeq: 'S', + types.UnicodeCharSeq: 'U', +} + + +def as_dtype(nbtype): + """ + Return a numpy dtype instance corresponding to the given Numba type. + NotImplementedError is if no correspondence is known. + """ + nbtype = types.unliteral(nbtype) + if isinstance(nbtype, (types.Complex, types.Integer, types.Float)): + return np.dtype(str(nbtype)) + if isinstance(nbtype, (types.Boolean)): + return np.dtype('?') + if isinstance(nbtype, (types.NPDatetime, types.NPTimedelta)): + letter = _as_dtype_letters[type(nbtype)] + if nbtype.unit: + return np.dtype('%s[%s]' % (letter, nbtype.unit)) + else: + return np.dtype(letter) + if isinstance(nbtype, (types.CharSeq, types.UnicodeCharSeq)): + letter = _as_dtype_letters[type(nbtype)] + return np.dtype('%s%d' % (letter, nbtype.count)) + if isinstance(nbtype, types.Record): + return as_struct_dtype(nbtype) + if isinstance(nbtype, types.EnumMember): + return as_dtype(nbtype.dtype) + if isinstance(nbtype, types.npytypes.DType): + return as_dtype(nbtype.dtype) + if isinstance(nbtype, types.NumberClass): + return as_dtype(nbtype.dtype) + if isinstance(nbtype, types.NestedArray): + spec = (as_dtype(nbtype.dtype), tuple(nbtype.shape)) + return np.dtype(spec) + if isinstance(nbtype, types.PyObject): + return np.dtype(object) + + msg = f"{nbtype} cannot be represented as a NumPy dtype" + raise errors.NumbaNotImplementedError(msg) + + +def as_struct_dtype(rec): + """Convert Numba Record type to NumPy structured dtype + """ + assert isinstance(rec, types.Record) + names = [] + formats = [] + offsets = [] + titles = [] + # Fill the fields if they are not a title. + for k, t in rec.members: + if not rec.is_title(k): + names.append(k) + formats.append(as_dtype(t)) + offsets.append(rec.offset(k)) + titles.append(rec.fields[k].title) + + fields = { + 'names': names, + 'formats': formats, + 'offsets': offsets, + 'itemsize': rec.size, + 'titles': titles, + } + _check_struct_alignment(rec, fields) + return np.dtype(fields, align=rec.aligned) + + +def _check_struct_alignment(rec, fields): + """Check alignment compatibility with Numpy""" + if rec.aligned: + for k, dt in zip(fields['names'], fields['formats']): + llvm_align = rec.alignof(k) + npy_align = dt.alignment + if llvm_align is not None and npy_align != llvm_align: + msg = ( + 'NumPy is using a different alignment ({}) ' + 'than Numba/LLVM ({}) for {}. ' + 'This is likely a NumPy bug.' + ) + raise ValueError(msg.format(npy_align, llvm_align, dt)) + + +def map_arrayscalar_type(val): + if isinstance(val, np.generic): + # We can't blindly call np.dtype() as it loses information + # on some types, e.g. datetime64 and timedelta64. + dtype = val.dtype + else: + try: + dtype = np.dtype(type(val)) + except TypeError: + raise errors.NumbaNotImplementedError("no corresponding numpy " + "dtype for %r" % type(val)) + return from_dtype(dtype) + + +def is_array(val): + return isinstance(val, np.ndarray) + + +def map_layout(val): + if val.flags['C_CONTIGUOUS']: + layout = 'C' + elif val.flags['F_CONTIGUOUS']: + layout = 'F' + else: + layout = 'A' + return layout + + +def select_array_wrapper(inputs): + """ + Given the array-compatible input types to an operation (e.g. ufunc), + select the appropriate input for wrapping the operation output, + according to each input's __array_priority__. + + An index into *inputs* is returned. + """ + max_prio = float('-inf') + selected_index = None + for index, ty in enumerate(inputs): + # Ties are broken by choosing the first winner, as in Numpy + if (isinstance(ty, types.ArrayCompatible) and + ty.array_priority > max_prio): + selected_index = index + max_prio = ty.array_priority + + assert selected_index is not None + return selected_index + + +def resolve_output_type(context, inputs, formal_output): + """ + Given the array-compatible input types to an operation (e.g. ufunc), + and the operation's formal output type (a types.Array instance), + resolve the actual output type using the typing *context*. + + This uses a mechanism compatible with Numpy's __array_priority__ / + __array_wrap__. + """ + selected_input = inputs[select_array_wrapper(inputs)] + args = selected_input, formal_output + sig = context.resolve_function_type('__array_wrap__', args, {}) + if sig is None: + if selected_input.array_priority == types.Array.array_priority: + # If it's the same priority as a regular array, assume we + # should return the output unchanged. + # (we can't define __array_wrap__ explicitly for types.Buffer, + # as that would be inherited by most array-compatible objects) + return formal_output + raise errors.TypingError("__array_wrap__ failed for %s" % (args,)) + return sig.return_type + + +def supported_ufunc_loop(ufunc, loop): + """Return whether the *loop* for the *ufunc* is supported -in nopython-. + + *loop* should be a UFuncLoopSpec instance, and *ufunc* a numpy ufunc. + + For ufuncs implemented using the ufunc_db, it is supported if the ufunc_db + contains a lowering definition for 'loop' in the 'ufunc' entry. + + For other ufuncs, it is type based. The loop will be considered valid if it + only contains the following letter types: '?bBhHiIlLqQfd'. Note this is + legacy and when implementing new ufuncs the ufunc_db should be preferred, + as it allows for a more fine-grained incremental support. + """ + # NOTE: Assuming ufunc for the CPUContext + from numba.np import ufunc_db + loop_sig = loop.ufunc_sig + try: + # check if the loop has a codegen description in the + # ufunc_db. If so, we can proceed. + + # note that as of now not all ufuncs have an entry in the + # ufunc_db + supported_loop = loop_sig in ufunc_db.get_ufunc_info(ufunc) + except KeyError: + # for ufuncs not in ufunc_db, base the decision of whether the + # loop is supported on its types + loop_types = [x.char for x in loop.numpy_inputs + loop.numpy_outputs] + supported_types = '?bBhHiIlLqQfd' + # check if all the types involved in the ufunc loop are + # supported in this mode + supported_loop = all(t in supported_types for t in loop_types) + + return supported_loop + + +class UFuncLoopSpec(collections.namedtuple('_UFuncLoopSpec', + ('inputs', 'outputs', 'ufunc_sig'))): + """ + An object describing a ufunc loop's inner types. Properties: + - inputs: the inputs' Numba types + - outputs: the outputs' Numba types + - ufunc_sig: the string representing the ufunc's type signature, in + Numpy format (e.g. "ii->i") + """ + + __slots__ = () + + @property + def numpy_inputs(self): + return [as_dtype(x) for x in self.inputs] + + @property + def numpy_outputs(self): + return [as_dtype(x) for x in self.outputs] + + +def _ufunc_loop_sig(out_tys, in_tys): + if len(out_tys) == 1: + return signature(out_tys[0], *in_tys) + else: + return signature(types.Tuple(out_tys), *in_tys) + + +def ufunc_can_cast(from_, to, has_mixed_inputs, casting='safe'): + """ + A variant of np.can_cast() that can allow casting any integer to + any real or complex type, in case the operation has mixed-kind + inputs. + + For example we want `np.power(float32, int32)` to be computed using + SP arithmetic and return `float32`. + However, `np.sqrt(int32)` should use DP arithmetic and return `float64`. + """ + from_ = np.dtype(from_) + to = np.dtype(to) + if has_mixed_inputs and from_.kind in 'iu' and to.kind in 'cf': + # Decide that all integers can cast to any real or complex type. + return True + return np.can_cast(from_, to, casting) + + +def ufunc_find_matching_loop(ufunc, arg_types): + """Find the appropriate loop to be used for a ufunc based on the types + of the operands + + ufunc - The ufunc we want to check + arg_types - The tuple of arguments to the ufunc, including any + explicit output(s). + return value - A UFuncLoopSpec identifying the loop, or None + if no matching loop is found. + """ + + # Separate logical input from explicit output arguments + input_types = arg_types[:ufunc.nin] + output_types = arg_types[ufunc.nin:] + assert (len(input_types) == ufunc.nin) + + try: + np_input_types = [as_dtype(x) for x in input_types] + except errors.NumbaNotImplementedError: + return None + try: + np_output_types = [as_dtype(x) for x in output_types] + except errors.NumbaNotImplementedError: + return None + + # Whether the inputs are mixed integer / floating-point + has_mixed_inputs = ( + any(dt.kind in 'iu' for dt in np_input_types) and + any(dt.kind in 'cf' for dt in np_input_types)) + + def choose_types(numba_types, ufunc_letters): + """ + Return a list of Numba types representing *ufunc_letters*, + except when the letter designates a datetime64 or timedelta64, + in which case the type is taken from *numba_types*. + """ + assert len(ufunc_letters) >= len(numba_types) + types = [tp if letter in 'mM' else from_dtype(np.dtype(letter)) + for tp, letter in zip(numba_types, ufunc_letters)] + # Add missing types (presumably implicit outputs) + types += [from_dtype(np.dtype(letter)) + for letter in ufunc_letters[len(numba_types):]] + return types + + def set_output_dt_units(inputs, outputs, ufunc_inputs, ufunc_name): + """ + Sets the output unit of a datetime type based on the input units + + Timedelta is a special dtype that requires the time unit to be + specified (day, month, etc). Not every operation with timedelta inputs + leads to an output of timedelta output. However, for those that do, + the unit of output must be inferred based on the units of the inputs. + + At the moment this function takes care of two cases: + a) where all inputs are timedelta with the same unit (mm), and + therefore the output has the same unit. + This case is used for arr.sum, and for arr1+arr2 where all arrays + are timedeltas. + If in the future this needs to be extended to a case with mixed units, + the rules should be implemented in `npdatetime_helpers` and called + from this function to set the correct output unit. + b) where left operand is a timedelta, i.e. the "m?" case. This case + is used for division, eg timedelta / int. + + At the time of writing, Numba does not support addition of timedelta + and other types, so this function does not consider the case "?m", + i.e. where timedelta is the right operand to a non-timedelta left + operand. To extend it in the future, just add another elif clause. + """ + def make_specific(outputs, unit): + new_outputs = [] + for out in outputs: + if isinstance(out, types.NPTimedelta) and out.unit == "": + new_outputs.append(types.NPTimedelta(unit)) + else: + new_outputs.append(out) + return new_outputs + + def make_datetime_specific(outputs, dt_unit, td_unit): + new_outputs = [] + for out in outputs: + if isinstance(out, types.NPDatetime) and out.unit == "": + unit = npdatetime_helpers.combine_datetime_timedelta_units( + dt_unit, td_unit) + if unit is None: + raise TypingError(f"ufunc '{ufunc_name}' is not " + + "supported between " + + f"datetime64[{dt_unit}] " + + f"and timedelta64[{td_unit}]" + ) + new_outputs.append(types.NPDatetime(unit)) + else: + new_outputs.append(out) + return new_outputs + + if ufunc_inputs == 'mm': + if all(inp.unit == inputs[0].unit for inp in inputs): + # Case with operation on same units. Operations on different + # units not adjusted for now but might need to be + # added in the future + unit = inputs[0].unit + new_outputs = make_specific(outputs, unit) + else: + return outputs + return new_outputs + elif ufunc_inputs == 'mM': + # case where the left operand has timedelta type + # and the right operand has datetime + td_unit = inputs[0].unit + dt_unit = inputs[1].unit + return make_datetime_specific(outputs, dt_unit, td_unit) + + elif ufunc_inputs == 'Mm': + # case where the right operand has timedelta type + # and the left operand has datetime + dt_unit = inputs[0].unit + td_unit = inputs[1].unit + return make_datetime_specific(outputs, dt_unit, td_unit) + + elif ufunc_inputs[0] == 'm': + # case where the left operand has timedelta type + unit = inputs[0].unit + new_outputs = make_specific(outputs, unit) + return new_outputs + + # In NumPy, the loops are evaluated from first to last. The first one + # that is viable is the one used. One loop is viable if it is possible + # to cast every input operand to the one expected by the ufunc. + # Also under NumPy 1.10+ the output must be able to be cast back + # to a close enough type ("same_kind"). + + for candidate in ufunc.types: + ufunc_inputs = candidate[:ufunc.nin] + ufunc_outputs = candidate[-ufunc.nout:] if ufunc.nout else [] + + if 'e' in ufunc_inputs: + # Skip float16 arrays since we don't have implementation for them + continue + if 'O' in ufunc_inputs: + # Skip object arrays + continue + found = True + # Skip if any input or output argument is mismatching + for outer, inner in zip(np_input_types, ufunc_inputs): + # (outer is a dtype instance, inner is a type char) + if outer.char in 'mM' or inner in 'mM': + # For datetime64 and timedelta64, we want to retain + # precise typing (i.e. the units); therefore we look for + # an exact match. + if outer.char != inner: + found = False + break + elif not ufunc_can_cast(outer.char, inner, + has_mixed_inputs, 'safe'): + found = False + break + if found: + # Can we cast the inner result to the outer result type? + for outer, inner in zip(np_output_types, ufunc_outputs): + if (outer.char not in 'mM' and not + ufunc_can_cast(inner, outer.char, + has_mixed_inputs, 'same_kind')): + found = False + break + if found: + # Found: determine the Numba types for the loop's inputs and + # outputs. + try: + inputs = choose_types(input_types, ufunc_inputs) + outputs = choose_types(output_types, ufunc_outputs) + # if the left operand or both are timedeltas, or the first + # argument is datetime and the second argument is timedelta, + # then the output units need to be determined. + if ufunc_inputs[0] == 'm' or ufunc_inputs == 'Mm': + outputs = set_output_dt_units(inputs, outputs, + ufunc_inputs, ufunc.__name__) + + except errors.NumbaNotImplementedError: + # One of the selected dtypes isn't supported by Numba + # (e.g. float16), try other candidates + continue + else: + return UFuncLoopSpec(inputs, outputs, candidate) + + return None + + +def _is_aligned_struct(struct): + return struct.isalignedstruct + + +def from_struct_dtype(dtype): + """Convert a NumPy structured dtype to Numba Record type + """ + if dtype.hasobject: + msg = "dtypes that contain object are not supported." + raise errors.NumbaNotImplementedError(msg) + + fields = [] + for name, info in dtype.fields.items(): + # *info* may have 3 element + [elemdtype, offset] = info[:2] + title = info[2] if len(info) == 3 else None + + ty = from_dtype(elemdtype) + infos = { + 'type': ty, + 'offset': offset, + 'title': title, + } + fields.append((name, infos)) + + # Note: dtype.alignment is not consistent. + # It is different after passing into a recarray. + # recarray(N, dtype=mydtype).dtype.alignment != mydtype.alignment + size = dtype.itemsize + aligned = _is_aligned_struct(dtype) + + return types.Record(fields, size, aligned) + + +def _get_bytes_buffer(ptr, nbytes): + """ + Get a ctypes array of *nbytes* starting at *ptr*. + """ + if isinstance(ptr, ctypes.c_void_p): + ptr = ptr.value + arrty = ctypes.c_byte * nbytes + return arrty.from_address(ptr) + + +def _get_array_from_ptr(ptr, nbytes, dtype): + return np.frombuffer(_get_bytes_buffer(ptr, nbytes), dtype) + + +def carray(ptr, shape, dtype=None): + """ + Return a Numpy array view over the data pointed to by *ptr* with the + given *shape*, in C order. If *dtype* is given, it is used as the + array's dtype, otherwise the array's dtype is inferred from *ptr*'s type. + """ + from numba.core.typing.ctypes_utils import from_ctypes + + try: + # Use ctypes parameter protocol if available + ptr = ptr._as_parameter_ + except AttributeError: + pass + + # Normalize dtype, to accept e.g. "int64" or np.int64 + if dtype is not None: + dtype = np.dtype(dtype) + + if isinstance(ptr, ctypes.c_void_p): + if dtype is None: + raise TypeError("explicit dtype required for void* argument") + p = ptr + elif isinstance(ptr, ctypes._Pointer): + ptrty = from_ctypes(ptr.__class__) + assert isinstance(ptrty, types.CPointer) + ptr_dtype = as_dtype(ptrty.dtype) + if dtype is not None and dtype != ptr_dtype: + raise TypeError("mismatching dtype '%s' for pointer %s" + % (dtype, ptr)) + dtype = ptr_dtype + p = ctypes.cast(ptr, ctypes.c_void_p) + else: + raise TypeError("expected a ctypes pointer, got %r" % (ptr,)) + + nbytes = dtype.itemsize * np.prod(shape, dtype=np.intp) + return _get_array_from_ptr(p, nbytes, dtype).reshape(shape) + + +def farray(ptr, shape, dtype=None): + """ + Return a Numpy array view over the data pointed to by *ptr* with the + given *shape*, in Fortran order. If *dtype* is given, it is used as the + array's dtype, otherwise the array's dtype is inferred from *ptr*'s type. + """ + if not isinstance(shape, int): + shape = shape[::-1] + return carray(ptr, shape, dtype).T + + +def is_contiguous(dims, strides, itemsize): + """Is the given shape, strides, and itemsize of C layout? + + Note: The code is usable as a numba-compiled function + """ + nd = len(dims) + # Check and skip 1s or 0s in inner dims + innerax = nd - 1 + while innerax > -1 and dims[innerax] <= 1: + innerax -= 1 + + # Early exit if all axis are 1s or 0s + if innerax < 0: + return True + + # Check itemsize matches innermost stride + if itemsize != strides[innerax]: + return False + + # Check and skip 1s or 0s in outer dims + outerax = 0 + while outerax < innerax and dims[outerax] <= 1: + outerax += 1 + + # Check remaining strides to be contiguous + ax = innerax + while ax > outerax: + if strides[ax] * dims[ax] != strides[ax - 1]: + return False + ax -= 1 + return True + + +def is_fortran(dims, strides, itemsize): + """Is the given shape, strides, and itemsize of F layout? + + Note: The code is usable as a numba-compiled function + """ + nd = len(dims) + # Check and skip 1s or 0s in inner dims + firstax = 0 + while firstax < nd and dims[firstax] <= 1: + firstax += 1 + + # Early exit if all axis are 1s or 0s + if firstax >= nd: + return True + + # Check itemsize matches innermost stride + if itemsize != strides[firstax]: + return False + + # Check and skip 1s or 0s in outer dims + lastax = nd - 1 + while lastax > firstax and dims[lastax] <= 1: + lastax -= 1 + + # Check remaining strides to be contiguous + ax = firstax + while ax < lastax: + if strides[ax] * dims[ax] != strides[ax + 1]: + return False + ax += 1 + return True + + +def type_can_asarray(arr): + """ Returns True if the type of 'arr' is supported by the Numba `np.asarray` + implementation, False otherwise. + """ + + ok = (types.Array, types.Sequence, types.Tuple, types.StringLiteral, + types.Number, types.Boolean, types.containers.ListType) + + return isinstance(arr, ok) + + +def type_is_scalar(typ): + """ Returns True if the type of 'typ' is a scalar type, according to + NumPy rules. False otherwise. + https://numpy.org/doc/stable/reference/arrays.scalars.html#built-in-scalar-types + """ + + ok = (types.Boolean, types.Number, types.UnicodeType, types.StringLiteral, + types.NPTimedelta, types.NPDatetime) + return isinstance(typ, ok) + + +def check_is_integer(v, name): + """Raises TypingError if the value is not an integer.""" + if not isinstance(v, (int, types.Integer)): + raise TypingError('{} must be an integer'.format(name)) + + +def lt_floats(a, b): + # Adapted from NumPy commit 717c7acf which introduced the behavior of + # putting NaNs at the end. + # The code is later moved to numpy/core/src/npysort/npysort_common.h + # This info is gathered as of NumPy commit d8c09c50 + return a < b or (np.isnan(b) and not np.isnan(a)) + + +def lt_complex(a, b): + if np.isnan(a.real): + if np.isnan(b.real): + if np.isnan(a.imag): + return False + else: + if np.isnan(b.imag): + return True + else: + return a.imag < b.imag + else: + return False + + else: + if np.isnan(b.real): + return True + else: + if np.isnan(a.imag): + if np.isnan(b.imag): + return a.real < b.real + else: + return False + else: + if np.isnan(b.imag): + return True + else: + if a.real < b.real: + return True + elif a.real == b.real: + return a.imag < b.imag + return False diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/old_arraymath.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/old_arraymath.py new file mode 100644 index 0000000000000000000000000000000000000000..5f75519ecb1e4a956102401b97df4fb6f9bbb72a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/old_arraymath.py @@ -0,0 +1,4985 @@ +""" +Implementation of math operations on Array objects. +""" + + +import math +from collections import namedtuple +import operator + +import llvmlite.ir +import numpy as np + +from numba.core import types, cgutils +from numba.core.extending import overload, overload_method, register_jitable +from numba.np.numpy_support import (as_dtype, type_can_asarray, type_is_scalar, + numpy_version, is_nonelike, + check_is_integer, lt_floats, lt_complex) +from numba.core.imputils import (lower_builtin, impl_ret_borrowed, + impl_ret_new_ref, impl_ret_untracked) +from numba.np.arrayobj import (make_array, load_item, store_item, + _empty_nd_impl) +from numba.np.linalg import ensure_blas + +from numba.core.extending import intrinsic +from numba.core.errors import (RequireLiteralValue, TypingError, + NumbaValueError, NumbaNotImplementedError, + NumbaTypeError) +from numba.cpython.unsafe.tuple import tuple_setitem + + +def _check_blas(): + # Checks if a BLAS is available so e.g. dot will work + try: + ensure_blas() + except ImportError: + return False + return True + + +_HAVE_BLAS = _check_blas() + + +@intrinsic +def _create_tuple_result_shape(tyctx, shape_list, shape_tuple): + """ + This routine converts shape list where the axis dimension has already + been popped to a tuple for indexing of the same size. The original shape + tuple is also required because it contains a length field at compile time + whereas the shape list does not. + """ + + # The new tuple's size is one less than the original tuple since axis + # dimension removed. + nd = len(shape_tuple) - 1 + # The return type of this intrinsic is an int tuple of length nd. + tupty = types.UniTuple(types.intp, nd) + # The function signature for this intrinsic. + function_sig = tupty(shape_list, shape_tuple) + + def codegen(cgctx, builder, signature, args): + lltupty = cgctx.get_value_type(tupty) + # Create an empty int tuple. + tup = cgutils.get_null_value(lltupty) + + # Get the shape list from the args and we don't need shape tuple. + [in_shape, _] = args + + def array_indexer(a, i): + return a[i] + + # loop to fill the tuple + for i in range(nd): + dataidx = cgctx.get_constant(types.intp, i) + # compile and call array_indexer + data = cgctx.compile_internal(builder, array_indexer, + types.intp(shape_list, types.intp), + [in_shape, dataidx]) + tup = builder.insert_value(tup, data, i) + return tup + + return function_sig, codegen + + +@intrinsic +def _gen_index_tuple(tyctx, shape_tuple, value, axis): + """ + Generates a tuple that can be used to index a specific slice from an + array for sum with axis. shape_tuple is the size of the dimensions of + the input array. 'value' is the value to put in the indexing tuple + in the axis dimension and 'axis' is that dimension. For this to work, + axis has to be a const. + """ + if not isinstance(axis, types.Literal): + raise RequireLiteralValue('axis argument must be a constant') + # Get the value of the axis constant. + axis_value = axis.literal_value + # The length of the indexing tuple to be output. + nd = len(shape_tuple) + + # If the axis value is impossible for the given size array then + # just fake it like it was for axis 0. This will stop compile errors + # when it looks like it could be called from array_sum_axis but really + # can't because that routine checks the axis mismatch and raise an + # exception. + if axis_value >= nd: + axis_value = 0 + + # Calculate the type of the indexing tuple. All the non-axis + # dimensions have slice2 type and the axis dimension has int type. + before = axis_value + after = nd - before - 1 + + types_list = [] + types_list += [types.slice2_type] * before + types_list += [types.intp] + types_list += [types.slice2_type] * after + + # Creates the output type of the function. + tupty = types.Tuple(types_list) + # Defines the signature of the intrinsic. + function_sig = tupty(shape_tuple, value, axis) + + def codegen(cgctx, builder, signature, args): + lltupty = cgctx.get_value_type(tupty) + # Create an empty indexing tuple. + tup = cgutils.get_null_value(lltupty) + + # We only need value of the axis dimension here. + # The rest are constants defined above. + [_, value_arg, _] = args + + def create_full_slice(): + return slice(None, None) + + # loop to fill the tuple with slice(None,None) before + # the axis dimension. + + # compile and call create_full_slice + slice_data = cgctx.compile_internal(builder, create_full_slice, + types.slice2_type(), + []) + for i in range(0, axis_value): + tup = builder.insert_value(tup, slice_data, i) + + # Add the axis dimension 'value'. + tup = builder.insert_value(tup, value_arg, axis_value) + + # loop to fill the tuple with slice(None,None) after + # the axis dimension. + for i in range(axis_value + 1, nd): + tup = builder.insert_value(tup, slice_data, i) + return tup + + return function_sig, codegen + + +#---------------------------------------------------------------------------- +# Basic stats and aggregates + +@lower_builtin(np.sum, types.Array) +@lower_builtin("array.sum", types.Array) +def array_sum(context, builder, sig, args): + zero = sig.return_type(0) + + def array_sum_impl(arr): + c = zero + for v in np.nditer(arr): + c += v.item() + return c + + res = context.compile_internal(builder, array_sum_impl, sig, args, + locals=dict(c=sig.return_type)) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@register_jitable +def _array_sum_axis_nop(arr, v): + return arr + + +def gen_sum_axis_impl(is_axis_const, const_axis_val, op, zero): + def inner(arr, axis): + """ + function that performs sums over one specific axis + + The third parameter to gen_index_tuple that generates the indexing + tuples has to be a const so we can't just pass "axis" through since + that isn't const. We can check for specific values and have + different instances that do take consts. Supporting axis summation + only up to the fourth dimension for now. + + typing/arraydecl.py:sum_expand defines the return type for sum with + axis. It is one dimension less than the input array. + """ + ndim = arr.ndim + + if not is_axis_const: + # Catch where axis is negative or greater than 3. + if axis < 0 or axis > 3: + raise ValueError("Numba does not support sum with axis " + "parameter outside the range 0 to 3.") + + # Catch the case where the user misspecifies the axis to be + # more than the number of the array's dimensions. + if axis >= ndim: + raise ValueError("axis is out of bounds for array") + + # Convert the shape of the input array to a list. + ashape = list(arr.shape) + # Get the length of the axis dimension. + axis_len = ashape[axis] + # Remove the axis dimension from the list of dimensional lengths. + ashape.pop(axis) + # Convert this shape list back to a tuple using above intrinsic. + ashape_without_axis = _create_tuple_result_shape(ashape, arr.shape) + # Tuple needed here to create output array with correct size. + result = np.full(ashape_without_axis, zero, type(zero)) + + # Iterate through the axis dimension. + for axis_index in range(axis_len): + if is_axis_const: + # constant specialized version works for any valid axis value + index_tuple_generic = _gen_index_tuple(arr.shape, axis_index, + const_axis_val) + result += arr[index_tuple_generic] + else: + # Generate a tuple used to index the input array. + # The tuple is ":" in all dimensions except the axis + # dimension where it is "axis_index". + if axis == 0: + index_tuple1 = _gen_index_tuple(arr.shape, axis_index, 0) + result += arr[index_tuple1] + elif axis == 1: + index_tuple2 = _gen_index_tuple(arr.shape, axis_index, 1) + result += arr[index_tuple2] + elif axis == 2: + index_tuple3 = _gen_index_tuple(arr.shape, axis_index, 2) + result += arr[index_tuple3] + elif axis == 3: + index_tuple4 = _gen_index_tuple(arr.shape, axis_index, 3) + result += arr[index_tuple4] + return op(result, 0) + return inner + + +@lower_builtin(np.sum, types.Array, types.intp, types.DTypeSpec) +@lower_builtin(np.sum, types.Array, types.IntegerLiteral, types.DTypeSpec) +@lower_builtin("array.sum", types.Array, types.intp, types.DTypeSpec) +@lower_builtin("array.sum", types.Array, types.IntegerLiteral, types.DTypeSpec) +def array_sum_axis_dtype(context, builder, sig, args): + retty = sig.return_type + zero = getattr(retty, 'dtype', retty)(0) + # if the return is scalar in type then "take" the 0th element of the + # 0d array accumulator as the return value + if getattr(retty, 'ndim', None) is None: + op = np.take + else: + op = _array_sum_axis_nop + [ty_array, ty_axis, ty_dtype] = sig.args + is_axis_const = False + const_axis_val = 0 + if isinstance(ty_axis, types.Literal): + # this special-cases for constant axis + const_axis_val = ty_axis.literal_value + # fix negative axis + if const_axis_val < 0: + const_axis_val = ty_array.ndim + const_axis_val + if const_axis_val < 0 or const_axis_val > ty_array.ndim: + raise ValueError("'axis' entry is out of bounds") + + ty_axis = context.typing_context.resolve_value_type(const_axis_val) + axis_val = context.get_constant(ty_axis, const_axis_val) + # rewrite arguments + args = args[0], axis_val, args[2] + # rewrite sig + sig = sig.replace(args=[ty_array, ty_axis, ty_dtype]) + is_axis_const = True + + gen_impl = gen_sum_axis_impl(is_axis_const, const_axis_val, op, zero) + compiled = register_jitable(gen_impl) + + def array_sum_impl_axis(arr, axis, dtype): + return compiled(arr, axis) + + res = context.compile_internal(builder, array_sum_impl_axis, sig, args) + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +@lower_builtin(np.sum, types.Array, types.DTypeSpec) +@lower_builtin("array.sum", types.Array, types.DTypeSpec) +def array_sum_dtype(context, builder, sig, args): + zero = sig.return_type(0) + + def array_sum_impl(arr, dtype): + c = zero + for v in np.nditer(arr): + c += v.item() + return c + + res = context.compile_internal(builder, array_sum_impl, sig, args, + locals=dict(c=sig.return_type)) + return impl_ret_borrowed(context, builder, sig.return_type, res) + + +@lower_builtin(np.sum, types.Array, types.intp) +@lower_builtin(np.sum, types.Array, types.IntegerLiteral) +@lower_builtin("array.sum", types.Array, types.intp) +@lower_builtin("array.sum", types.Array, types.IntegerLiteral) +def array_sum_axis(context, builder, sig, args): + retty = sig.return_type + zero = getattr(retty, 'dtype', retty)(0) + # if the return is scalar in type then "take" the 0th element of the + # 0d array accumulator as the return value + if getattr(retty, 'ndim', None) is None: + op = np.take + else: + op = _array_sum_axis_nop + [ty_array, ty_axis] = sig.args + is_axis_const = False + const_axis_val = 0 + if isinstance(ty_axis, types.Literal): + # this special-cases for constant axis + const_axis_val = ty_axis.literal_value + # fix negative axis + if const_axis_val < 0: + const_axis_val = ty_array.ndim + const_axis_val + if const_axis_val < 0 or const_axis_val > ty_array.ndim: + msg = f"'axis' entry ({const_axis_val}) is out of bounds" + raise NumbaValueError(msg) + + ty_axis = context.typing_context.resolve_value_type(const_axis_val) + axis_val = context.get_constant(ty_axis, const_axis_val) + # rewrite arguments + args = args[0], axis_val + # rewrite sig + sig = sig.replace(args=[ty_array, ty_axis]) + is_axis_const = True + + gen_impl = gen_sum_axis_impl(is_axis_const, const_axis_val, op, zero) + compiled = register_jitable(gen_impl) + + def array_sum_impl_axis(arr, axis): + return compiled(arr, axis) + + res = context.compile_internal(builder, array_sum_impl_axis, sig, args) + return impl_ret_new_ref(context, builder, sig.return_type, res) + + +def get_accumulator(dtype, value): + if dtype.type == np.timedelta64: + acc_init = np.int64(value).view(dtype) + else: + acc_init = dtype.type(value) + return acc_init + + +@overload(np.prod) +@overload_method(types.Array, "prod") +def array_prod(a): + if isinstance(a, types.Array): + dtype = as_dtype(a.dtype) + + acc_init = get_accumulator(dtype, 1) + + def array_prod_impl(a): + c = acc_init + for v in np.nditer(a): + c *= v.item() + return c + + return array_prod_impl + + +@overload(np.cumsum) +@overload_method(types.Array, "cumsum") +def array_cumsum(a): + if isinstance(a, types.Array): + is_integer = a.dtype in types.signed_domain + is_bool = a.dtype == types.bool_ + if (is_integer and a.dtype.bitwidth < types.intp.bitwidth)\ + or is_bool: + dtype = as_dtype(types.intp) + else: + dtype = as_dtype(a.dtype) + + acc_init = get_accumulator(dtype, 0) + + def array_cumsum_impl(a): + out = np.empty(a.size, dtype) + c = acc_init + for idx, v in enumerate(a.flat): + c += v + out[idx] = c + return out + + return array_cumsum_impl + + +@overload(np.cumprod) +@overload_method(types.Array, "cumprod") +def array_cumprod(a): + if isinstance(a, types.Array): + is_integer = a.dtype in types.signed_domain + is_bool = a.dtype == types.bool_ + if (is_integer and a.dtype.bitwidth < types.intp.bitwidth)\ + or is_bool: + dtype = as_dtype(types.intp) + else: + dtype = as_dtype(a.dtype) + + acc_init = get_accumulator(dtype, 1) + + def array_cumprod_impl(a): + out = np.empty(a.size, dtype) + c = acc_init + for idx, v in enumerate(a.flat): + c *= v + out[idx] = c + return out + + return array_cumprod_impl + + +@overload(np.mean) +@overload_method(types.Array, "mean") +def array_mean(a): + if isinstance(a, types.Array): + is_number = a.dtype in types.integer_domain | frozenset([types.bool_]) + if is_number: + dtype = as_dtype(types.float64) + else: + dtype = as_dtype(a.dtype) + + acc_init = get_accumulator(dtype, 0) + + def array_mean_impl(a): + # Can't use the naive `arr.sum() / arr.size`, as it would return + # a wrong result on integer sum overflow. + c = acc_init + for v in np.nditer(a): + c += v.item() + return c / a.size + + return array_mean_impl + + +@overload(np.var) +@overload_method(types.Array, "var") +def array_var(a): + if isinstance(a, types.Array): + def array_var_impl(a): + # Compute the mean + m = a.mean() + + # Compute the sum of square diffs + ssd = 0 + for v in np.nditer(a): + val = (v.item() - m) + ssd += np.real(val * np.conj(val)) + return ssd / a.size + + return array_var_impl + + +@overload(np.std) +@overload_method(types.Array, "std") +def array_std(a): + if isinstance(a, types.Array): + def array_std_impl(a): + return a.var() ** 0.5 + + return array_std_impl + + +@register_jitable +def min_comparator(a, min_val): + return a < min_val + + +@register_jitable +def max_comparator(a, min_val): + return a > min_val + + +@register_jitable +def return_false(a): + return False + + +@overload(np.min) +@overload(np.amin) +@overload_method(types.Array, "min") +def npy_min(a): + if not isinstance(a, types.Array): + return + + if isinstance(a.dtype, (types.NPDatetime, types.NPTimedelta)): + pre_return_func = np.isnat + comparator = min_comparator + elif isinstance(a.dtype, types.Complex): + pre_return_func = return_false + + def comp_func(a, min_val): + if a.real < min_val.real: + return True + elif a.real == min_val.real: + if a.imag < min_val.imag: + return True + return False + + comparator = register_jitable(comp_func) + elif isinstance(a.dtype, types.Float): + pre_return_func = np.isnan + comparator = min_comparator + else: + pre_return_func = return_false + comparator = min_comparator + + def impl_min(a): + if a.size == 0: + raise ValueError("zero-size array to reduction operation " + "minimum which has no identity") + + it = np.nditer(a) + min_value = next(it).take(0) + if pre_return_func(min_value): + return min_value + + for view in it: + v = view.item() + if pre_return_func(v): + return v + if comparator(v, min_value): + min_value = v + return min_value + + return impl_min + + +@overload(np.max) +@overload(np.amax) +@overload_method(types.Array, "max") +def npy_max(a): + if not isinstance(a, types.Array): + return + + if isinstance(a.dtype, (types.NPDatetime, types.NPTimedelta)): + pre_return_func = np.isnat + comparator = max_comparator + elif isinstance(a.dtype, types.Complex): + pre_return_func = return_false + + def comp_func(a, max_val): + if a.real > max_val.real: + return True + elif a.real == max_val.real: + if a.imag > max_val.imag: + return True + return False + + comparator = register_jitable(comp_func) + elif isinstance(a.dtype, types.Float): + pre_return_func = np.isnan + comparator = max_comparator + else: + pre_return_func = return_false + comparator = max_comparator + + def impl_max(a): + if a.size == 0: + raise ValueError("zero-size array to reduction operation " + "maximum which has no identity") + + it = np.nditer(a) + max_value = next(it).take(0) + if pre_return_func(max_value): + return max_value + + for view in it: + v = view.item() + if pre_return_func(v): + return v + if comparator(v, max_value): + max_value = v + return max_value + + return impl_max + + +@register_jitable +def array_argmin_impl_datetime(arry): + if arry.size == 0: + raise ValueError("attempt to get argmin of an empty sequence") + it = np.nditer(arry) + min_value = next(it).take(0) + min_idx = 0 + if np.isnat(min_value): + return min_idx + + idx = 1 + for view in it: + v = view.item() + if np.isnat(v): + return idx + if v < min_value: + min_value = v + min_idx = idx + idx += 1 + return min_idx + + +@register_jitable +def array_argmin_impl_float(arry): + if arry.size == 0: + raise ValueError("attempt to get argmin of an empty sequence") + for v in arry.flat: + min_value = v + min_idx = 0 + break + if np.isnan(min_value): + return min_idx + + idx = 0 + for v in arry.flat: + if np.isnan(v): + return idx + if v < min_value: + min_value = v + min_idx = idx + idx += 1 + return min_idx + + +@register_jitable +def array_argmin_impl_generic(arry): + if arry.size == 0: + raise ValueError("attempt to get argmin of an empty sequence") + for v in arry.flat: + min_value = v + min_idx = 0 + break + else: + raise RuntimeError('unreachable') + + idx = 0 + for v in arry.flat: + if v < min_value: + min_value = v + min_idx = idx + idx += 1 + return min_idx + + +@overload(np.argmin) +@overload_method(types.Array, "argmin") +def array_argmin(a, axis=None): + if isinstance(a.dtype, (types.NPDatetime, types.NPTimedelta)): + flatten_impl = array_argmin_impl_datetime + elif isinstance(a.dtype, types.Float): + flatten_impl = array_argmin_impl_float + else: + flatten_impl = array_argmin_impl_generic + + if is_nonelike(axis): + def array_argmin_impl(a, axis=None): + return flatten_impl(a) + else: + array_argmin_impl = build_argmax_or_argmin_with_axis_impl( + a, axis, flatten_impl + ) + return array_argmin_impl + + +@register_jitable +def array_argmax_impl_datetime(arry): + if arry.size == 0: + raise ValueError("attempt to get argmax of an empty sequence") + it = np.nditer(arry) + max_value = next(it).take(0) + max_idx = 0 + if np.isnat(max_value): + return max_idx + + idx = 1 + for view in it: + v = view.item() + if np.isnat(v): + return idx + if v > max_value: + max_value = v + max_idx = idx + idx += 1 + return max_idx + + +@register_jitable +def array_argmax_impl_float(arry): + if arry.size == 0: + raise ValueError("attempt to get argmax of an empty sequence") + for v in arry.flat: + max_value = v + max_idx = 0 + break + if np.isnan(max_value): + return max_idx + + idx = 0 + for v in arry.flat: + if np.isnan(v): + return idx + if v > max_value: + max_value = v + max_idx = idx + idx += 1 + return max_idx + + +@register_jitable +def array_argmax_impl_generic(arry): + if arry.size == 0: + raise ValueError("attempt to get argmax of an empty sequence") + for v in arry.flat: + max_value = v + max_idx = 0 + break + + idx = 0 + for v in arry.flat: + if v > max_value: + max_value = v + max_idx = idx + idx += 1 + return max_idx + + +def build_argmax_or_argmin_with_axis_impl(a, axis, flatten_impl): + """ + Given a function that implements the logic for handling a flattened + array, return the implementation function. + """ + check_is_integer(axis, "axis") + retty = types.intp + + tuple_buffer = tuple(range(a.ndim)) + + def impl(a, axis=None): + if axis < 0: + axis = a.ndim + axis + + if axis < 0 or axis >= a.ndim: + raise ValueError("axis is out of bounds") + + # Short circuit 1-dimensional arrays: + if a.ndim == 1: + return flatten_impl(a) + + # Make chosen axis the last axis: + tmp = tuple_buffer + for i in range(axis, a.ndim - 1): + tmp = tuple_setitem(tmp, i, i + 1) + transpose_index = tuple_setitem(tmp, a.ndim - 1, axis) + transposed_arr = a.transpose(transpose_index) + + # Flatten along that axis; since we've transposed, we can just get + # batches off the overall flattened array. + m = transposed_arr.shape[-1] + raveled = transposed_arr.ravel() + assert raveled.size == a.size + assert transposed_arr.size % m == 0 + out = np.empty(transposed_arr.size // m, retty) + for i in range(out.size): + out[i] = flatten_impl(raveled[i * m:(i + 1) * m]) + + # Reshape based on axis we didn't flatten over: + return out.reshape(transposed_arr.shape[:-1]) + + return impl + + +@overload(np.argmax) +@overload_method(types.Array, "argmax") +def array_argmax(a, axis=None): + if isinstance(a.dtype, (types.NPDatetime, types.NPTimedelta)): + flatten_impl = array_argmax_impl_datetime + elif isinstance(a.dtype, types.Float): + flatten_impl = array_argmax_impl_float + else: + flatten_impl = array_argmax_impl_generic + + if is_nonelike(axis): + def array_argmax_impl(a, axis=None): + return flatten_impl(a) + else: + array_argmax_impl = build_argmax_or_argmin_with_axis_impl( + a, axis, flatten_impl + ) + return array_argmax_impl + + +@overload(np.all) +@overload_method(types.Array, "all") +def np_all(a): + def flat_all(a): + for v in np.nditer(a): + if not v.item(): + return False + return True + + return flat_all + + +@register_jitable +def _allclose_scalars(a_v, b_v, rtol=1e-05, atol=1e-08, equal_nan=False): + a_v_isnan = np.isnan(a_v) + b_v_isnan = np.isnan(b_v) + + # only one of the values is NaN and the + # other is not. + if ( (not a_v_isnan and b_v_isnan) or + (a_v_isnan and not b_v_isnan) ): + return False + + # either both of the values are NaN + # or both are numbers + if a_v_isnan and b_v_isnan: + if not equal_nan: + return False + else: + if np.isinf(a_v) or np.isinf(b_v): + return a_v == b_v + + if np.abs(a_v - b_v) > atol + rtol * np.abs(b_v * 1.0): + return False + + return True + + +@overload(np.allclose) +@overload_method(types.Array, "allclose") +def np_allclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + + if not type_can_asarray(a): + raise TypingError('The first argument "a" must be array-like') + + if not type_can_asarray(b): + raise TypingError('The second argument "b" must be array-like') + + if not isinstance(rtol, (float, types.Float)): + raise TypingError('The third argument "rtol" must be a ' + 'floating point') + + if not isinstance(atol, (float, types.Float)): + raise TypingError('The fourth argument "atol" must be a ' + 'floating point') + + if not isinstance(equal_nan, (bool, types.Boolean)): + raise TypingError('The fifth argument "equal_nan" must be a ' + 'boolean') + + is_a_scalar = isinstance(a, types.Number) + is_b_scalar = isinstance(b, types.Number) + + if is_a_scalar and is_b_scalar: + def np_allclose_impl_scalar_scalar(a, b, rtol=1e-05, atol=1e-08, + equal_nan=False): + return _allclose_scalars(a, b, rtol=rtol, atol=atol, + equal_nan=equal_nan) + return np_allclose_impl_scalar_scalar + elif is_a_scalar and not is_b_scalar: + def np_allclose_impl_scalar_array(a, b, rtol=1e-05, atol=1e-08, + equal_nan=False): + b = np.asarray(b) + for bv in np.nditer(b): + if not _allclose_scalars(a, bv.item(), rtol=rtol, atol=atol, + equal_nan=equal_nan): + return False + return True + return np_allclose_impl_scalar_array + elif not is_a_scalar and is_b_scalar: + def np_allclose_impl_array_scalar(a, b, rtol=1e-05, atol=1e-08, + equal_nan=False): + a = np.asarray(a) + for av in np.nditer(a): + if not _allclose_scalars(av.item(), b, rtol=rtol, atol=atol, + equal_nan=equal_nan): + return False + return True + return np_allclose_impl_array_scalar + elif not is_a_scalar and not is_b_scalar: + def np_allclose_impl_array_array(a, b, rtol=1e-05, atol=1e-08, + equal_nan=False): + a = np.asarray(a) + b = np.asarray(b) + a_a, b_b = np.broadcast_arrays(a, b) + + for av, bv in np.nditer((a_a, b_b)): + if not _allclose_scalars(av.item(), bv.item(), rtol=rtol, + atol=atol, equal_nan=equal_nan): + return False + + return True + + return np_allclose_impl_array_array + + +@overload(np.any) +@overload_method(types.Array, "any") +def np_any(a): + def flat_any(a): + for v in np.nditer(a): + if v.item(): + return True + return False + + return flat_any + + +@overload(np.average) +def np_average(a, axis=None, weights=None): + + if weights is None or isinstance(weights, types.NoneType): + def np_average_impl(a, axis=None, weights=None): + arr = np.asarray(a) + return np.mean(arr) + else: + if axis is None or isinstance(axis, types.NoneType): + def np_average_impl(a, axis=None, weights=None): + arr = np.asarray(a) + weights = np.asarray(weights) + + if arr.shape != weights.shape: + if axis is None: + raise TypeError( + "Numba does not support average when shapes of " + "a and weights differ.") + if weights.ndim != 1: + raise TypeError( + "1D weights expected when shapes of " + "a and weights differ.") + + scl = np.sum(weights) + if scl == 0.0: + raise ZeroDivisionError( + "Weights sum to zero, can't be normalized.") + + avg = np.sum(np.multiply(arr, weights)) / scl + return avg + else: + def np_average_impl(a, axis=None, weights=None): + raise TypeError("Numba does not support average with axis.") + + return np_average_impl + + +def get_isnan(dtype): + """ + A generic isnan() function + """ + if isinstance(dtype, (types.Float, types.Complex)): + return np.isnan + else: + @register_jitable + def _trivial_isnan(x): + return False + return _trivial_isnan + + +@overload(np.iscomplex) +def np_iscomplex(x): + if type_can_asarray(x): + # NumPy uses asanyarray here! + return lambda x: np.asarray(x).imag != 0 + return None + + +@overload(np.isreal) +def np_isreal(x): + if type_can_asarray(x): + # NumPy uses asanyarray here! + return lambda x: np.asarray(x).imag == 0 + return None + + +@overload(np.iscomplexobj) +def iscomplexobj(x): + # Implementation based on NumPy + # https://github.com/numpy/numpy/blob/d9b1e32cb8ef90d6b4a47853241db2a28146a57d/numpy/lib/type_check.py#L282-L320 + dt = determine_dtype(x) + if isinstance(x, types.Optional): + dt = determine_dtype(x.type) + iscmplx = np.issubdtype(dt, np.complexfloating) + + if isinstance(x, types.Optional): + def impl(x): + if x is None: + return False + return iscmplx + else: + def impl(x): + return iscmplx + return impl + + +@overload(np.isrealobj) +def isrealobj(x): + # Return True if x is not a complex type. + # Implementation based on NumPy + # https://github.com/numpy/numpy/blob/ccfbcc1cd9a4035a467f2e982a565ab27de25b6b/numpy/lib/type_check.py#L290-L322 + def impl(x): + return not np.iscomplexobj(x) + return impl + + +@overload(np.isscalar) +def np_isscalar(element): + res = type_is_scalar(element) + + def impl(element): + return res + return impl + + +def is_np_inf_impl(x, out, fn): + + # if/else branch should be unified after PR #5606 is merged + if is_nonelike(out): + def impl(x, out=None): + return np.logical_and(np.isinf(x), fn(np.signbit(x))) + else: + def impl(x, out=None): + return np.logical_and(np.isinf(x), fn(np.signbit(x)), out) + + return impl + + +@overload(np.isneginf) +def isneginf(x, out=None): + fn = register_jitable(lambda x: x) + return is_np_inf_impl(x, out, fn) + + +@overload(np.isposinf) +def isposinf(x, out=None): + fn = register_jitable(lambda x: ~x) + return is_np_inf_impl(x, out, fn) + + +@register_jitable +def less_than(a, b): + return a < b + + +@register_jitable +def greater_than(a, b): + return a > b + + +@register_jitable +def check_array(a): + if a.size == 0: + raise ValueError('zero-size array to reduction operation not possible') + + +def nan_min_max_factory(comparison_op, is_complex_dtype): + if is_complex_dtype: + def impl(a): + arr = np.asarray(a) + check_array(arr) + it = np.nditer(arr) + return_val = next(it).take(0) + for view in it: + v = view.item() + if np.isnan(return_val.real) and not np.isnan(v.real): + return_val = v + else: + if comparison_op(v.real, return_val.real): + return_val = v + elif v.real == return_val.real: + if comparison_op(v.imag, return_val.imag): + return_val = v + return return_val + else: + def impl(a): + arr = np.asarray(a) + check_array(arr) + it = np.nditer(arr) + return_val = next(it).take(0) + for view in it: + v = view.item() + if not np.isnan(v): + if not comparison_op(return_val, v): + return_val = v + return return_val + + return impl + + +real_nanmin = register_jitable( + nan_min_max_factory(less_than, is_complex_dtype=False) +) +real_nanmax = register_jitable( + nan_min_max_factory(greater_than, is_complex_dtype=False) +) +complex_nanmin = register_jitable( + nan_min_max_factory(less_than, is_complex_dtype=True) +) +complex_nanmax = register_jitable( + nan_min_max_factory(greater_than, is_complex_dtype=True) +) + + +@register_jitable +def _isclose_item(x, y, rtol, atol, equal_nan): + if np.isnan(x) and np.isnan(y): + return equal_nan + elif np.isinf(x) and np.isinf(y): + return (x > 0) == (y > 0) + elif np.isinf(x) or np.isinf(y): + return False + else: + return abs(x - y) <= atol + rtol * abs(y) + + +@overload(np.isclose) +def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + if not type_can_asarray(a): + raise TypingError('The first argument "a" must be array-like') + + if not type_can_asarray(b): + raise TypingError('The second argument "b" must be array-like') + + if not isinstance(rtol, (float, types.Float)): + raise TypingError('The third argument "rtol" must be a ' + 'floating point') + + if not isinstance(atol, (float, types.Float)): + raise TypingError('The fourth argument "atol" must be a ' + 'floating point') + + if not isinstance(equal_nan, (bool, types.Boolean)): + raise TypingError('The fifth argument "equal_nan" must be a ' + 'boolean') + + if isinstance(a, types.Array) and isinstance(b, types.Number): + def isclose_impl(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + x = a.reshape(-1) + y = b + out = np.zeros(len(x), np.bool_) + for i in range(len(out)): + out[i] = _isclose_item(x[i], y, rtol, atol, equal_nan) + return out.reshape(a.shape) + + elif isinstance(a, types.Number) and isinstance(b, types.Array): + def isclose_impl(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + x = a + y = b.reshape(-1) + out = np.zeros(len(y), np.bool_) + for i in range(len(out)): + out[i] = _isclose_item(x, y[i], rtol, atol, equal_nan) + return out.reshape(b.shape) + + elif isinstance(a, types.Array) and isinstance(b, types.Array): + def isclose_impl(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + shape = np.broadcast_shapes(a.shape, b.shape) + a_ = np.broadcast_to(a, shape) + b_ = np.broadcast_to(b, shape) + + out = np.zeros(len(a_), dtype=np.bool_) + for i, (av, bv) in enumerate(np.nditer((a_, b_))): + out[i] = _isclose_item(av.item(), bv.item(), rtol, atol, + equal_nan) + return np.broadcast_to(out, shape) + + else: + def isclose_impl(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + return _isclose_item(a, b, rtol, atol, equal_nan) + + return isclose_impl + + +@overload(np.nanmin) +def np_nanmin(a): + dt = determine_dtype(a) + if np.issubdtype(dt, np.complexfloating): + return complex_nanmin + else: + return real_nanmin + + +@overload(np.nanmax) +def np_nanmax(a): + dt = determine_dtype(a) + if np.issubdtype(dt, np.complexfloating): + return complex_nanmax + else: + return real_nanmax + + +@overload(np.nanmean) +def np_nanmean(a): + if not isinstance(a, types.Array): + return + isnan = get_isnan(a.dtype) + + def nanmean_impl(a): + c = 0.0 + count = 0 + for view in np.nditer(a): + v = view.item() + if not isnan(v): + c += v.item() + count += 1 + # np.divide() doesn't raise ZeroDivisionError + return np.divide(c, count) + + return nanmean_impl + + +@overload(np.nanvar) +def np_nanvar(a): + if not isinstance(a, types.Array): + return + isnan = get_isnan(a.dtype) + + def nanvar_impl(a): + # Compute the mean + m = np.nanmean(a) + + # Compute the sum of square diffs + ssd = 0.0 + count = 0 + for view in np.nditer(a): + v = view.item() + if not isnan(v): + val = (v.item() - m) + ssd += np.real(val * np.conj(val)) + count += 1 + # np.divide() doesn't raise ZeroDivisionError + return np.divide(ssd, count) + + return nanvar_impl + + +@overload(np.nanstd) +def np_nanstd(a): + if not isinstance(a, types.Array): + return + + def nanstd_impl(a): + return np.nanvar(a) ** 0.5 + + return nanstd_impl + + +@overload(np.nansum) +def np_nansum(a): + if not isinstance(a, types.Array): + return + if isinstance(a.dtype, types.Integer): + retty = types.intp + else: + retty = a.dtype + zero = retty(0) + isnan = get_isnan(a.dtype) + + def nansum_impl(a): + c = zero + for view in np.nditer(a): + v = view.item() + if not isnan(v): + c += v + return c + + return nansum_impl + + +@overload(np.nanprod) +def np_nanprod(a): + if not isinstance(a, types.Array): + return + if isinstance(a.dtype, types.Integer): + retty = types.intp + else: + retty = a.dtype + one = retty(1) + isnan = get_isnan(a.dtype) + + def nanprod_impl(a): + c = one + for view in np.nditer(a): + v = view.item() + if not isnan(v): + c *= v + return c + + return nanprod_impl + + +@overload(np.nancumprod) +def np_nancumprod(a): + if not isinstance(a, types.Array): + return + + if isinstance(a.dtype, (types.Boolean, types.Integer)): + # dtype cannot possibly contain NaN + return lambda a: np.cumprod(a) + else: + retty = a.dtype + is_nan = get_isnan(retty) + one = retty(1) + + def nancumprod_impl(a): + out = np.empty(a.size, retty) + c = one + for idx, v in enumerate(a.flat): + if ~is_nan(v): + c *= v + out[idx] = c + return out + + return nancumprod_impl + + +@overload(np.nancumsum) +def np_nancumsum(a): + if not isinstance(a, types.Array): + return + + if isinstance(a.dtype, (types.Boolean, types.Integer)): + # dtype cannot possibly contain NaN + return lambda a: np.cumsum(a) + else: + retty = a.dtype + is_nan = get_isnan(retty) + zero = retty(0) + + def nancumsum_impl(a): + out = np.empty(a.size, retty) + c = zero + for idx, v in enumerate(a.flat): + if ~is_nan(v): + c += v + out[idx] = c + return out + + return nancumsum_impl + + +@register_jitable +def prepare_ptp_input(a): + arr = _asarray(a) + if len(arr) == 0: + raise ValueError('zero-size array reduction not possible') + else: + return arr + + +def _compute_current_val_impl_gen(op, current_val, val): + if isinstance(current_val, types.Complex): + # The sort order for complex numbers is lexicographic. If both the + # real and imaginary parts are non-nan then the order is determined + # by the real parts except when they are equal, in which case the + # order is determined by the imaginary parts. + # https://github.com/numpy/numpy/blob/577a86e/numpy/core/fromnumeric.py#L874-L877 # noqa: E501 + def impl(current_val, val): + if op(val.real, current_val.real): + return val + elif (val.real == current_val.real + and op(val.imag, current_val.imag)): + return val + return current_val + else: + def impl(current_val, val): + return val if op(val, current_val) else current_val + return impl + + +def _compute_a_max(current_val, val): + pass + + +def _compute_a_min(current_val, val): + pass + + +@overload(_compute_a_max) +def _compute_a_max_impl(current_val, val): + return _compute_current_val_impl_gen(operator.gt, current_val, val) + + +@overload(_compute_a_min) +def _compute_a_min_impl(current_val, val): + return _compute_current_val_impl_gen(operator.lt, current_val, val) + + +def _early_return(val): + pass + + +@overload(_early_return) +def _early_return_impl(val): + UNUSED = 0 + if isinstance(val, types.Complex): + def impl(val): + if np.isnan(val.real): + if np.isnan(val.imag): + return True, np.nan + np.nan * 1j + else: + return True, np.nan + 0j + else: + return False, UNUSED + elif isinstance(val, types.Float): + def impl(val): + if np.isnan(val): + return True, np.nan + else: + return False, UNUSED + else: + def impl(val): + return False, UNUSED + return impl + + +@overload(np.ptp) +def np_ptp(a): + + if hasattr(a, 'dtype'): + if isinstance(a.dtype, types.Boolean): + raise TypingError("Boolean dtype is unsupported (as per NumPy)") + # Numpy raises a TypeError + + def np_ptp_impl(a): + arr = prepare_ptp_input(a) + + a_flat = arr.flat + a_min = a_flat[0] + a_max = a_flat[0] + + for i in range(arr.size): + val = a_flat[i] + take_branch, retval = _early_return(val) + if take_branch: + return retval + a_max = _compute_a_max(a_max, val) + a_min = _compute_a_min(a_min, val) + + return a_max - a_min + + return np_ptp_impl + + +if numpy_version < (2, 0): + overload_method(types.Array, 'ptp')(np_ptp) + +#---------------------------------------------------------------------------- +# Median and partitioning + + +@register_jitable +def nan_aware_less_than(a, b): + if np.isnan(a): + return False + else: + if np.isnan(b): + return True + else: + return a < b + + +def _partition_factory(pivotimpl, argpartition=False): + def _partition(A, low, high, I=None): + mid = (low + high) >> 1 + # NOTE: the pattern of swaps below for the pivot choice and the + # partitioning gives good results (i.e. regular O(n log n)) + # on sorted, reverse-sorted, and uniform arrays. Subtle changes + # risk breaking this property. + + # Use median of three {low, middle, high} as the pivot + if pivotimpl(A[mid], A[low]): + A[low], A[mid] = A[mid], A[low] + if argpartition: + I[low], I[mid] = I[mid], I[low] + if pivotimpl(A[high], A[mid]): + A[high], A[mid] = A[mid], A[high] + if argpartition: + I[high], I[mid] = I[mid], I[high] + if pivotimpl(A[mid], A[low]): + A[low], A[mid] = A[mid], A[low] + if argpartition: + I[low], I[mid] = I[mid], I[low] + pivot = A[mid] + + A[high], A[mid] = A[mid], A[high] + if argpartition: + I[high], I[mid] = I[mid], I[high] + i = low + j = high - 1 + while True: + while i < high and pivotimpl(A[i], pivot): + i += 1 + while j >= low and pivotimpl(pivot, A[j]): + j -= 1 + if i >= j: + break + A[i], A[j] = A[j], A[i] + if argpartition: + I[i], I[j] = I[j], I[i] + i += 1 + j -= 1 + # Put the pivot back in its final place (all items before `i` + # are smaller than the pivot, all items at/after `i` are larger) + A[i], A[high] = A[high], A[i] + if argpartition: + I[i], I[high] = I[high], I[i] + return i + return _partition + + +_partition = register_jitable(_partition_factory(less_than)) +_partition_w_nan = register_jitable(_partition_factory(nan_aware_less_than)) +_argpartition_w_nan = register_jitable(_partition_factory( + nan_aware_less_than, + argpartition=True) +) + + +def _select_factory(partitionimpl): + def _select(arry, k, low, high, idx=None): + """ + Select the k'th smallest element in array[low:high + 1]. + """ + i = partitionimpl(arry, low, high, idx) + while i != k: + if i < k: + low = i + 1 + i = partitionimpl(arry, low, high, idx) + else: + high = i - 1 + i = partitionimpl(arry, low, high, idx) + return arry[k] + return _select + + +_select = register_jitable(_select_factory(_partition)) +_select_w_nan = register_jitable(_select_factory(_partition_w_nan)) +_arg_select_w_nan = register_jitable(_select_factory(_argpartition_w_nan)) + + +@register_jitable +def _select_two(arry, k, low, high): + """ + Select the k'th and k+1'th smallest elements in array[low:high + 1]. + + This is significantly faster than doing two independent selections + for k and k+1. + """ + while True: + assert high > low # by construction + i = _partition(arry, low, high) + if i < k: + low = i + 1 + elif i > k + 1: + high = i - 1 + elif i == k: + _select(arry, k + 1, i + 1, high) + break + else: # i == k + 1 + _select(arry, k, low, i - 1) + break + + return arry[k], arry[k + 1] + + +@register_jitable +def _median_inner(temp_arry, n): + """ + The main logic of the median() call. *temp_arry* must be disposable, + as this function will mutate it. + """ + low = 0 + high = n - 1 + half = n >> 1 + if n & 1 == 0: + a, b = _select_two(temp_arry, half - 1, low, high) + return (a + b) / 2 + else: + return _select(temp_arry, half, low, high) + + +@overload(np.median) +def np_median(a): + if not isinstance(a, types.Array): + return + + def median_impl(a): + # np.median() works on the flattened array, and we need a temporary + # workspace anyway + temp_arry = a.flatten() + n = temp_arry.shape[0] + return _median_inner(temp_arry, n) + + return median_impl + + +@register_jitable +def _collect_percentiles_inner(a, q): + #TODO: This needs rewriting to be closer to NumPy, particularly the nan/inf + # handling which is generally subject to algorithmic changes. + n = len(a) + + if n == 1: + # single element array; output same for all percentiles + out = np.full(len(q), a[0], dtype=np.float64) + else: + out = np.empty(len(q), dtype=np.float64) + for i in range(len(q)): + percentile = q[i] + + # bypass pivoting where requested percentile is 100 + if percentile == 100: + val = np.max(a) + # heuristics to handle infinite values a la NumPy + if ~np.all(np.isfinite(a)): + if ~np.isfinite(val): + val = np.nan + + # bypass pivoting where requested percentile is 0 + elif percentile == 0: + val = np.min(a) + # convoluted heuristics to handle infinite values a la NumPy + if ~np.all(np.isfinite(a)): + num_pos_inf = np.sum(a == np.inf) + num_neg_inf = np.sum(a == -np.inf) + num_finite = n - (num_neg_inf + num_pos_inf) + if num_finite == 0: + val = np.nan + if num_pos_inf == 1 and n == 2: + val = np.nan + if num_neg_inf > 1: + val = np.nan + if num_finite == 1: + if num_pos_inf > 1: + if num_neg_inf != 1: + val = np.nan + + else: + # linear interp between closest ranks + rank = 1 + (n - 1) * np.true_divide(percentile, 100.0) + f = math.floor(rank) + m = rank - f + lower, upper = _select_two(a, k=int(f - 1), low=0, high=(n - 1)) + val = lower * (1 - m) + upper * m + out[i] = val + + return out + + +@register_jitable +def _can_collect_percentiles(a, nan_mask, skip_nan): + if skip_nan: + a = a[~nan_mask] + if len(a) == 0: + return False # told to skip nan, but no elements remain + else: + if np.any(nan_mask): + return False # told *not* to skip nan, but nan encountered + + if len(a) == 1: # single element array + val = a[0] + return np.isfinite(val) # can collect percentiles if element is finite + else: + return True + + +@register_jitable +def check_valid(q, q_upper_bound): + valid = True + + # avoid expensive reductions where possible + if q.ndim == 1 and q.size < 10: + for i in range(q.size): + if q[i] < 0.0 or q[i] > q_upper_bound or np.isnan(q[i]): + valid = False + break + else: + if np.any(np.isnan(q)) or np.any(q < 0.0) or np.any(q > q_upper_bound): + valid = False + + return valid + + +@register_jitable +def percentile_is_valid(q): + if not check_valid(q, q_upper_bound=100.0): + raise ValueError('Percentiles must be in the range [0, 100]') + + +@register_jitable +def quantile_is_valid(q): + if not check_valid(q, q_upper_bound=1.0): + raise ValueError('Quantiles must be in the range [0, 1]') + + +@register_jitable +def _collect_percentiles(a, q, check_q, factor, skip_nan): + q = np.asarray(q, dtype=np.float64).flatten() + check_q(q) + q = q * factor + + temp_arry = np.asarray(a, dtype=np.float64).flatten() + nan_mask = np.isnan(temp_arry) + + if _can_collect_percentiles(temp_arry, nan_mask, skip_nan): + temp_arry = temp_arry[~nan_mask] + out = _collect_percentiles_inner(temp_arry, q) + else: + out = np.full(len(q), np.nan) + + return out + + +def _percentile_quantile_inner(a, q, skip_nan, factor, check_q): + """ + The underlying algorithm to find percentiles and quantiles + is the same, hence we converge onto the same code paths + in this inner function implementation + """ + dt = determine_dtype(a) + if np.issubdtype(dt, np.complexfloating): + raise TypingError('Not supported for complex dtype') + # this could be supported, but would require a + # lexicographic comparison + + def np_percentile_q_scalar_impl(a, q): + return _collect_percentiles(a, q, check_q, factor, skip_nan)[0] + + def np_percentile_impl(a, q): + return _collect_percentiles(a, q, check_q, factor, skip_nan) + + if isinstance(q, (types.Number, types.Boolean)): + return np_percentile_q_scalar_impl + elif isinstance(q, types.Array) and q.ndim == 0: + return np_percentile_q_scalar_impl + else: + return np_percentile_impl + + +@overload(np.percentile) +def np_percentile(a, q): + return _percentile_quantile_inner( + a, q, skip_nan=False, factor=1.0, check_q=percentile_is_valid + ) + + +@overload(np.nanpercentile) +def np_nanpercentile(a, q): + return _percentile_quantile_inner( + a, q, skip_nan=True, factor=1.0, check_q=percentile_is_valid + ) + + +@overload(np.quantile) +def np_quantile(a, q): + return _percentile_quantile_inner( + a, q, skip_nan=False, factor=100.0, check_q=quantile_is_valid + ) + + +@overload(np.nanquantile) +def np_nanquantile(a, q): + return _percentile_quantile_inner( + a, q, skip_nan=True, factor=100.0, check_q=quantile_is_valid + ) + + +@overload(np.nanmedian) +def np_nanmedian(a): + if not isinstance(a, types.Array): + return + isnan = get_isnan(a.dtype) + + def nanmedian_impl(a): + # Create a temporary workspace with only non-NaN values + temp_arry = np.empty(a.size, a.dtype) + n = 0 + for view in np.nditer(a): + v = view.item() + if not isnan(v): + temp_arry[n] = v + n += 1 + + # all NaNs + if n == 0: + return np.nan + + return _median_inner(temp_arry, n) + + return nanmedian_impl + + +@register_jitable +def np_partition_impl_inner(a, kth_array): + + # allocate and fill empty array rather than copy a and mutate in place + # as the latter approach fails to preserve strides + out = np.empty_like(a) + + idx = np.ndindex(a.shape[:-1]) # Numpy default partition axis is -1 + for s in idx: + arry = a[s].copy() + low = 0 + high = len(arry) - 1 + + for kth in kth_array: + _select_w_nan(arry, kth, low, high) + low = kth # narrow span of subsequent partition + + out[s] = arry + return out + + +@register_jitable +def np_argpartition_impl_inner(a, kth_array): + + # allocate and fill empty array rather than copy a and mutate in place + # as the latter approach fails to preserve strides + out = np.empty_like(a, dtype=np.intp) + + idx = np.ndindex(a.shape[:-1]) # Numpy default partition axis is -1 + for s in idx: + arry = a[s].copy() + idx_arry = np.arange(len(arry)) + low = 0 + high = len(arry) - 1 + + for kth in kth_array: + _arg_select_w_nan(arry, kth, low, high, idx_arry) + low = kth # narrow span of subsequent partition + + out[s] = idx_arry + return out + + +@register_jitable +def valid_kths(a, kth): + """ + Returns a sorted, unique array of kth values which serve + as indexers for partitioning the input array, a. + + If the absolute value of any of the provided values + is greater than a.shape[-1] an exception is raised since + we are partitioning along the last axis (per Numpy default + behaviour). + + Values less than 0 are transformed to equivalent positive + index values. + """ + # cast boolean to int, where relevant + kth_array = _asarray(kth).astype(np.int64) + + if kth_array.ndim != 1: + raise ValueError('kth must be scalar or 1-D') + # numpy raises ValueError: object too deep for desired array + + if np.any(np.abs(kth_array) >= a.shape[-1]): + raise ValueError("kth out of bounds") + + out = np.empty_like(kth_array) + + for index, val in np.ndenumerate(kth_array): + if val < 0: + out[index] = val + a.shape[-1] # equivalent positive index + else: + out[index] = val + + return np.unique(out) + + +@overload(np.partition) +def np_partition(a, kth): + + if not isinstance(a, (types.Array, types.Sequence, types.Tuple)): + raise NumbaTypeError('The first argument must be an array-like') + + if isinstance(a, types.Array) and a.ndim == 0: + msg = 'The first argument must be at least 1-D (found 0-D)' + raise NumbaTypeError(msg) + + kthdt = getattr(kth, 'dtype', kth) + if not isinstance(kthdt, (types.Boolean, types.Integer)): + # bool gets cast to int subsequently + raise NumbaTypeError('Partition index must be integer') + + def np_partition_impl(a, kth): + a_tmp = _asarray(a) + if a_tmp.size == 0: + return a_tmp.copy() + else: + kth_array = valid_kths(a_tmp, kth) + return np_partition_impl_inner(a_tmp, kth_array) + + return np_partition_impl + + +@overload(np.argpartition) +def np_argpartition(a, kth): + + if not isinstance(a, (types.Array, types.Sequence, types.Tuple)): + raise NumbaTypeError('The first argument must be an array-like') + + if isinstance(a, types.Array) and a.ndim == 0: + msg = 'The first argument must be at least 1-D (found 0-D)' + raise NumbaTypeError(msg) + + kthdt = getattr(kth, 'dtype', kth) + if not isinstance(kthdt, (types.Boolean, types.Integer)): + # bool gets cast to int subsequently + raise NumbaTypeError('Partition index must be integer') + + def np_argpartition_impl(a, kth): + a_tmp = _asarray(a) + if a_tmp.size == 0: + return a_tmp.copy().astype('intp') + else: + kth_array = valid_kths(a_tmp, kth) + return np_argpartition_impl_inner(a_tmp, kth_array) + + return np_argpartition_impl + + +#---------------------------------------------------------------------------- +# Building matrices + +@register_jitable +def _tri_impl(N, M, k): + shape = max(0, N), max(0, M) # numpy floors each dimension at 0 + out = np.empty(shape, dtype=np.float64) # numpy default dtype + + for i in range(shape[0]): + m_max = min(max(0, i + k + 1), shape[1]) + out[i, :m_max] = 1 + out[i, m_max:] = 0 + + return out + + +@overload(np.tri) +def np_tri(N, M=None, k=0): + + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + def tri_impl(N, M=None, k=0): + if M is None: + M = N + return _tri_impl(N, M, k) + + return tri_impl + + +@register_jitable +def _make_square(m): + """ + Takes a 1d array and tiles it to form a square matrix + - i.e. a facsimile of np.tile(m, (len(m), 1)) + """ + assert m.ndim == 1 + + len_m = len(m) + out = np.empty((len_m, len_m), dtype=m.dtype) + + for i in range(len_m): + out[i] = m + + return out + + +@register_jitable +def np_tril_impl_2d(m, k=0): + mask = np.tri(m.shape[-2], M=m.shape[-1], k=k).astype(np.uint) + return np.where(mask, m, np.zeros_like(m, dtype=m.dtype)) + + +@overload(np.tril) +def my_tril(m, k=0): + + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + def np_tril_impl_1d(m, k=0): + m_2d = _make_square(m) + return np_tril_impl_2d(m_2d, k) + + def np_tril_impl_multi(m, k=0): + mask = np.tri(m.shape[-2], M=m.shape[-1], k=k).astype(np.uint) + idx = np.ndindex(m.shape[:-2]) + z = np.empty_like(m) + zero_opt = np.zeros_like(mask, dtype=m.dtype) + for sel in idx: + z[sel] = np.where(mask, m[sel], zero_opt) + return z + + if m.ndim == 1: + return np_tril_impl_1d + elif m.ndim == 2: + return np_tril_impl_2d + else: + return np_tril_impl_multi + + +@overload(np.tril_indices) +def np_tril_indices(n, k=0, m=None): + + # we require integer arguments, unlike numpy + check_is_integer(n, 'n') + check_is_integer(k, 'k') + if not is_nonelike(m): + check_is_integer(m, 'm') + + def np_tril_indices_impl(n, k=0, m=None): + return np.nonzero(np.tri(n, m, k=k)) + return np_tril_indices_impl + + +@overload(np.tril_indices_from) +def np_tril_indices_from(arr, k=0): + + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + if arr.ndim != 2: + raise TypingError("input array must be 2-d") + + def np_tril_indices_from_impl(arr, k=0): + return np.tril_indices(arr.shape[0], k=k, m=arr.shape[1]) + return np_tril_indices_from_impl + + +@register_jitable +def np_triu_impl_2d(m, k=0): + mask = np.tri(m.shape[-2], M=m.shape[-1], k=k - 1).astype(np.uint) + return np.where(mask, np.zeros_like(m, dtype=m.dtype), m) + + +@overload(np.triu) +def my_triu(m, k=0): + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + def np_triu_impl_1d(m, k=0): + m_2d = _make_square(m) + return np_triu_impl_2d(m_2d, k) + + def np_triu_impl_multi(m, k=0): + mask = np.tri(m.shape[-2], M=m.shape[-1], k=k - 1).astype(np.uint) + idx = np.ndindex(m.shape[:-2]) + z = np.empty_like(m) + zero_opt = np.zeros_like(mask, dtype=m.dtype) + for sel in idx: + z[sel] = np.where(mask, zero_opt, m[sel]) + return z + + if m.ndim == 1: + return np_triu_impl_1d + elif m.ndim == 2: + return np_triu_impl_2d + else: + return np_triu_impl_multi + + +@overload(np.triu_indices) +def np_triu_indices(n, k=0, m=None): + + # we require integer arguments, unlike numpy + check_is_integer(n, 'n') + check_is_integer(k, 'k') + if not is_nonelike(m): + check_is_integer(m, 'm') + + def np_triu_indices_impl(n, k=0, m=None): + return np.nonzero(1 - np.tri(n, m, k=k - 1)) + return np_triu_indices_impl + + +@overload(np.triu_indices_from) +def np_triu_indices_from(arr, k=0): + + # we require k to be integer, unlike numpy + check_is_integer(k, 'k') + + if arr.ndim != 2: + raise TypingError("input array must be 2-d") + + def np_triu_indices_from_impl(arr, k=0): + return np.triu_indices(arr.shape[0], k=k, m=arr.shape[1]) + return np_triu_indices_from_impl + + +def _prepare_array(arr): + pass + + +@overload(_prepare_array) +def _prepare_array_impl(arr): + if arr in (None, types.none): + return lambda arr: np.array(()) + else: + return lambda arr: _asarray(arr).ravel() + + +def _dtype_of_compound(inobj): + obj = inobj + while True: + if isinstance(obj, (types.Number, types.Boolean)): + return as_dtype(obj) + l = getattr(obj, '__len__', None) + if l is not None and l() == 0: # empty tuple or similar + return np.float64 + dt = getattr(obj, 'dtype', None) + if dt is None: + raise NumbaTypeError("type has no dtype attr") + if isinstance(obj, types.Sequence): + obj = obj.dtype + else: + return as_dtype(dt) + + +@overload(np.ediff1d) +def np_ediff1d(ary, to_end=None, to_begin=None): + + if isinstance(ary, types.Array): + if isinstance(ary.dtype, types.Boolean): + raise NumbaTypeError("Boolean dtype is unsupported (as per NumPy)") + # Numpy tries to do this: return ary[1:] - ary[:-1] which + # results in a TypeError exception being raised + + # Check that to_end and to_begin are compatible with ary + ary_dt = _dtype_of_compound(ary) + to_begin_dt = None + if not (is_nonelike(to_begin)): + to_begin_dt = _dtype_of_compound(to_begin) + to_end_dt = None + if not (is_nonelike(to_end)): + to_end_dt = _dtype_of_compound(to_end) + + if to_begin_dt is not None and not np.can_cast(to_begin_dt, ary_dt): + msg = "dtype of to_begin must be compatible with input ary" + raise NumbaTypeError(msg) + + if to_end_dt is not None and not np.can_cast(to_end_dt, ary_dt): + msg = "dtype of to_end must be compatible with input ary" + raise NumbaTypeError(msg) + + def np_ediff1d_impl(ary, to_end=None, to_begin=None): + # transform each input into an equivalent 1d array + start = _prepare_array(to_begin) + mid = _prepare_array(ary) + end = _prepare_array(to_end) + + out_dtype = mid.dtype + # output array dtype determined by ary dtype, per NumPy + # (for the most part); an exception to the rule is a zero length + # array-like, where NumPy falls back to np.float64; this behaviour + # is *not* replicated + + if len(mid) > 0: + out = np.empty((len(start) + len(mid) + len(end) - 1), + dtype=out_dtype) + start_idx = len(start) + mid_idx = len(start) + len(mid) - 1 + out[:start_idx] = start + out[start_idx:mid_idx] = np.diff(mid) + out[mid_idx:] = end + else: + out = np.empty((len(start) + len(end)), dtype=out_dtype) + start_idx = len(start) + out[:start_idx] = start + out[start_idx:] = end + return out + + return np_ediff1d_impl + + +def _select_element(arr): + pass + + +@overload(_select_element) +def _select_element_impl(arr): + zerod = getattr(arr, 'ndim', None) == 0 + if zerod: + def impl(arr): + x = np.array((1,), dtype=arr.dtype) + x[:] = arr + return x[0] + return impl + else: + def impl(arr): + return arr + return impl + + +def _get_d(dx, x): + pass + + +@overload(_get_d) +def get_d_impl(x, dx): + if is_nonelike(x): + def impl(x, dx): + return np.asarray(dx) + else: + def impl(x, dx): + return np.diff(np.asarray(x)) + return impl + + +@overload(np.trapz) +def np_trapz(y, x=None, dx=1.0): + + if isinstance(y, (types.Number, types.Boolean)): + raise TypingError('y cannot be a scalar') + elif isinstance(y, types.Array) and y.ndim == 0: + raise TypingError('y cannot be 0D') + # NumPy raises IndexError: list assignment index out of range + + # inspired by: + # https://github.com/numpy/numpy/blob/7ee52003/numpy/lib/function_base.py#L4040-L4065 # noqa: E501 + def impl(y, x=None, dx=1.0): + yarr = np.asarray(y) + d = _get_d(x, dx) + y_ave = (yarr[..., slice(1, None)] + yarr[..., slice(None, -1)]) / 2.0 + ret = np.sum(d * y_ave, -1) + processed = _select_element(ret) + return processed + + return impl + + +# numpy 2.0 rename np.trapz to np.trapezoid +if numpy_version >= (2, 0): + overload(np.trapezoid)(np_trapz) + + +@register_jitable +def _np_vander(x, N, increasing, out): + """ + Generate an N-column Vandermonde matrix from a supplied 1-dimensional + array, x. Store results in an output matrix, out, which is assumed to + be of the required dtype. + + Values are accumulated using np.multiply to match the floating point + precision behaviour of numpy.vander. + """ + m, n = out.shape + assert m == len(x) + assert n == N + + if increasing: + for i in range(N): + if i == 0: + out[:, i] = 1 + else: + out[:, i] = np.multiply(x, out[:, (i - 1)]) + else: + for i in range(N - 1, -1, -1): + if i == N - 1: + out[:, i] = 1 + else: + out[:, i] = np.multiply(x, out[:, (i + 1)]) + + +@register_jitable +def _check_vander_params(x, N): + if x.ndim > 1: + raise ValueError('x must be a one-dimensional array or sequence.') + if N < 0: + raise ValueError('Negative dimensions are not allowed') + + +@overload(np.vander) +def np_vander(x, N=None, increasing=False): + if N not in (None, types.none): + if not isinstance(N, types.Integer): + raise TypingError('Second argument N must be None or an integer') + + def np_vander_impl(x, N=None, increasing=False): + if N is None: + N = len(x) + + _check_vander_params(x, N) + + # allocate output matrix using dtype determined in closure + out = np.empty((len(x), int(N)), dtype=dtype) + + _np_vander(x, N, increasing, out) + return out + + def np_vander_seq_impl(x, N=None, increasing=False): + if N is None: + N = len(x) + + x_arr = np.array(x) + _check_vander_params(x_arr, N) + + # allocate output matrix using dtype inferred when x_arr was created + out = np.empty((len(x), int(N)), dtype=x_arr.dtype) + + _np_vander(x_arr, N, increasing, out) + return out + + if isinstance(x, types.Array): + x_dt = as_dtype(x.dtype) + # replicate numpy behaviour w.r.t.type promotion + dtype = np.promote_types(x_dt, int) + return np_vander_impl + elif isinstance(x, (types.Tuple, types.Sequence)): + return np_vander_seq_impl + + +@overload(np.roll) +def np_roll(a, shift): + if not isinstance(shift, (types.Integer, types.Boolean)): + raise TypingError('shift must be an integer') + + def np_roll_impl(a, shift): + arr = np.asarray(a) + out = np.empty(arr.shape, dtype=arr.dtype) + # empty_like might result in different contiguity vs NumPy + + arr_flat = arr.flat + for i in range(arr.size): + idx = (i + shift) % arr.size + out.flat[idx] = arr_flat[i] + + return out + + if isinstance(a, (types.Number, types.Boolean)): + return lambda a, shift: np.asarray(a) + else: + return np_roll_impl + + +#---------------------------------------------------------------------------- +# Mathematical functions + +LIKELY_IN_CACHE_SIZE = 8 + + +@register_jitable +def binary_search_with_guess(key, arr, length, guess): + # NOTE: Do not refactor... see note in np_interp function impl below + # this is a facsimile of binary_search_with_guess prior to 1.15: + # https://github.com/numpy/numpy/blob/maintenance/1.15.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/3430d78c01a3b9a19adad75f1acb5ae18286da73/numpy/core/src/multiarray/compiled_base.c#L447 # noqa: E501 + imin = 0 + imax = length + + # Handle keys outside of the arr range first + if key > arr[length - 1]: + return length + elif key < arr[0]: + return -1 + + # If len <= 4 use linear search. + # From above we know key >= arr[0] when we start. + if length <= 4: + i = 1 + while i < length and key >= arr[i]: + i += 1 + return i - 1 + + if guess > length - 3: + guess = length - 3 + + if guess < 1: + guess = 1 + + # check most likely values: guess - 1, guess, guess + 1 + if key < arr[guess]: + if key < arr[guess - 1]: + imax = guess - 1 + + # last attempt to restrict search to items in cache + if guess > LIKELY_IN_CACHE_SIZE and \ + key >= arr[guess - LIKELY_IN_CACHE_SIZE]: + imin = guess - LIKELY_IN_CACHE_SIZE + else: + # key >= arr[guess - 1] + return guess - 1 + else: + # key >= arr[guess] + if key < arr[guess + 1]: + return guess + else: + # key >= arr[guess + 1] + if key < arr[guess + 2]: + return guess + 1 + else: + # key >= arr[guess + 2] + imin = guess + 2 + # last attempt to restrict search to items in cache + if (guess < (length - LIKELY_IN_CACHE_SIZE - 1)) and \ + (key < arr[guess + LIKELY_IN_CACHE_SIZE]): + imax = guess + LIKELY_IN_CACHE_SIZE + + # finally, find index by bisection + while imin < imax: + imid = imin + ((imax - imin) >> 1) + if key >= arr[imid]: + imin = imid + 1 + else: + imax = imid + + return imin - 1 + + +@register_jitable +def np_interp_impl_complex_inner(x, xp, fp, dtype): + # NOTE: Do not refactor... see note in np_interp function impl below + # this is a facsimile of arr_interp_complex post 1.16 with added + # branching to support np1.17 style NaN handling. + # https://github.com/numpy/numpy/blob/maintenance/1.16.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/971e2e89d08deeae0139d3011d15646fdac13c92/numpy/core/src/multiarray/compiled_base.c#L628 # noqa: E501 + dz = np.asarray(x) + dx = np.asarray(xp) + dy = np.asarray(fp) + + if len(dx) == 0: + raise ValueError('array of sample points is empty') + + if len(dx) != len(dy): + raise ValueError('fp and xp are not of the same size.') + + if dx.size == 1: + return np.full(dz.shape, fill_value=dy[0], dtype=dtype) + + dres = np.empty(dz.shape, dtype=dtype) + + lenx = dz.size + lenxp = len(dx) + lval = dy[0] + rval = dy[lenxp - 1] + + if lenxp == 1: + xp_val = dx[0] + fp_val = dy[0] + + for i in range(lenx): + x_val = dz.flat[i] + if x_val < xp_val: + dres.flat[i] = lval + elif x_val > xp_val: + dres.flat[i] = rval + else: + dres.flat[i] = fp_val + + else: + j = 0 + + # only pre-calculate slopes if there are relatively few of them. + if lenxp <= lenx: + slopes = np.empty((lenxp - 1), dtype=dtype) + else: + slopes = np.empty(0, dtype=dtype) + + if slopes.size: + for i in range(lenxp - 1): + inv_dx = 1 / (dx[i + 1] - dx[i]) + real = (dy[i + 1].real - dy[i].real) * inv_dx + imag = (dy[i + 1].imag - dy[i].imag) * inv_dx + slopes[i] = real + 1j * imag + + for i in range(lenx): + x_val = dz.flat[i] + + if np.isnan(x_val): + real = x_val + imag = 0.0 + dres.flat[i] = real + 1j * imag + continue + + j = binary_search_with_guess(x_val, dx, lenxp, j) + + if j == -1: + dres.flat[i] = lval + elif j == lenxp: + dres.flat[i] = rval + elif j == lenxp - 1: + dres.flat[i] = dy[j] + elif dx[j] == x_val: + # Avoid potential non-finite interpolation + dres.flat[i] = dy[j] + else: + if slopes.size: + slope = slopes[j] + else: + inv_dx = 1 / (dx[j + 1] - dx[j]) + real = (dy[j + 1].real - dy[j].real) * inv_dx + imag = (dy[j + 1].imag - dy[j].imag) * inv_dx + slope = real + 1j * imag + + # NumPy 1.17 handles NaN correctly - this is a copy of + # innermost part of arr_interp_complex post 1.17: + # https://github.com/numpy/numpy/blob/maintenance/1.17.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/91fbe4dde246559fa5b085ebf4bc268e2b89eea8/numpy/core/src/multiarray/compiled_base.c#L798-L812 # noqa: E501 + + # If we get NaN in one direction, try the other + real = slope.real * (x_val - dx[j]) + dy[j].real + if np.isnan(real): + real = slope.real * (x_val - dx[j + 1]) + dy[j + 1].real + if np.isnan(real) and dy[j].real == dy[j + 1].real: + real = dy[j].real + + imag = slope.imag * (x_val - dx[j]) + dy[j].imag + if np.isnan(imag): + imag = slope.imag * (x_val - dx[j + 1]) + dy[j + 1].imag + if np.isnan(imag) and dy[j].imag == dy[j + 1].imag: + imag = dy[j].imag + + dres.flat[i] = real + 1j * imag + + return dres + + +@register_jitable +def np_interp_impl_inner(x, xp, fp, dtype): + # NOTE: Do not refactor... see note in np_interp function impl below + # this is a facsimile of arr_interp post 1.16: + # https://github.com/numpy/numpy/blob/maintenance/1.16.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/971e2e89d08deeae0139d3011d15646fdac13c92/numpy/core/src/multiarray/compiled_base.c#L473 # noqa: E501 + dz = np.asarray(x, dtype=np.float64) + dx = np.asarray(xp, dtype=np.float64) + dy = np.asarray(fp, dtype=np.float64) + + if len(dx) == 0: + raise ValueError('array of sample points is empty') + + if len(dx) != len(dy): + raise ValueError('fp and xp are not of the same size.') + + if dx.size == 1: + return np.full(dz.shape, fill_value=dy[0], dtype=dtype) + + dres = np.empty(dz.shape, dtype=dtype) + + lenx = dz.size + lenxp = len(dx) + lval = dy[0] + rval = dy[lenxp - 1] + + if lenxp == 1: + xp_val = dx[0] + fp_val = dy[0] + + for i in range(lenx): + x_val = dz.flat[i] + if x_val < xp_val: + dres.flat[i] = lval + elif x_val > xp_val: + dres.flat[i] = rval + else: + dres.flat[i] = fp_val + + else: + j = 0 + + # only pre-calculate slopes if there are relatively few of them. + if lenxp <= lenx: + slopes = (dy[1:] - dy[:-1]) / (dx[1:] - dx[:-1]) + else: + slopes = np.empty(0, dtype=dtype) + + for i in range(lenx): + x_val = dz.flat[i] + + if np.isnan(x_val): + dres.flat[i] = x_val + continue + + j = binary_search_with_guess(x_val, dx, lenxp, j) + + if j == -1: + dres.flat[i] = lval + elif j == lenxp: + dres.flat[i] = rval + elif j == lenxp - 1: + dres.flat[i] = dy[j] + elif dx[j] == x_val: + # Avoid potential non-finite interpolation + dres.flat[i] = dy[j] + else: + if slopes.size: + slope = slopes[j] + else: + slope = (dy[j + 1] - dy[j]) / (dx[j + 1] - dx[j]) + + dres.flat[i] = slope * (x_val - dx[j]) + dy[j] + + # NOTE: this is in np1.17 + # https://github.com/numpy/numpy/blob/maintenance/1.17.x/numpy/core/src/multiarray/compiled_base.c # noqa: E501 + # Permanent reference: + # https://github.com/numpy/numpy/blob/91fbe4dde246559fa5b085ebf4bc268e2b89eea8/numpy/core/src/multiarray/compiled_base.c#L610-L616 # noqa: E501 + # + # If we get nan in one direction, try the other + if np.isnan(dres.flat[i]): + dres.flat[i] = slope * (x_val - dx[j + 1]) + dy[j + 1] # noqa: E501 + if np.isnan(dres.flat[i]) and dy[j] == dy[j + 1]: + dres.flat[i] = dy[j] + + return dres + + +@overload(np.interp) +def np_interp(x, xp, fp): + # Replicating basic interp is relatively simple, but matching the behaviour + # of NumPy for edge cases is really quite hard. After a couple of attempts + # to avoid translation of the C source it was deemed necessary. + + if hasattr(xp, 'ndim') and xp.ndim > 1: + raise TypingError('xp must be 1D') + if hasattr(fp, 'ndim') and fp.ndim > 1: + raise TypingError('fp must be 1D') + + complex_dtype_msg = ( + "Cannot cast array data from complex dtype to float64 dtype" + ) + + xp_dt = determine_dtype(xp) + if np.issubdtype(xp_dt, np.complexfloating): + raise TypingError(complex_dtype_msg) + + fp_dt = determine_dtype(fp) + dtype = np.result_type(fp_dt, np.float64) + + if np.issubdtype(dtype, np.complexfloating): + inner = np_interp_impl_complex_inner + else: + inner = np_interp_impl_inner + + def np_interp_impl(x, xp, fp): + return inner(x, xp, fp, dtype) + + def np_interp_scalar_impl(x, xp, fp): + return inner(x, xp, fp, dtype).flat[0] + + if isinstance(x, types.Number): + if isinstance(x, types.Complex): + raise TypingError(complex_dtype_msg) + return np_interp_scalar_impl + + return np_interp_impl + + +#---------------------------------------------------------------------------- +# Statistics + +@register_jitable +def row_wise_average(a): + assert a.ndim == 2 + + m, n = a.shape + out = np.empty((m, 1), dtype=a.dtype) + + for i in range(m): + out[i, 0] = np.sum(a[i, :]) / n + + return out + + +@register_jitable +def np_cov_impl_inner(X, bias, ddof): + + # determine degrees of freedom + if ddof is None: + if bias: + ddof = 0 + else: + ddof = 1 + + # determine the normalization factor + fact = X.shape[1] - ddof + + # numpy warns if less than 0 and floors at 0 + fact = max(fact, 0.0) + + # de-mean + X -= row_wise_average(X) + + # calculate result - requires blas + c = np.dot(X, np.conj(X.T)) + c *= np.true_divide(1, fact) + return c + + +def _prepare_cov_input_inner(): + pass + + +@overload(_prepare_cov_input_inner) +def _prepare_cov_input_impl(m, y, rowvar, dtype): + if y in (None, types.none): + def _prepare_cov_input_inner(m, y, rowvar, dtype): + m_arr = np.atleast_2d(_asarray(m)) + + if not rowvar: + m_arr = m_arr.T + + return m_arr + else: + def _prepare_cov_input_inner(m, y, rowvar, dtype): + m_arr = np.atleast_2d(_asarray(m)) + y_arr = np.atleast_2d(_asarray(y)) + + # transpose if asked to and not a (1, n) vector - this looks + # wrong as you might end up transposing one and not the other, + # but it's what numpy does + if not rowvar: + if m_arr.shape[0] != 1: + m_arr = m_arr.T + if y_arr.shape[0] != 1: + y_arr = y_arr.T + + m_rows, m_cols = m_arr.shape + y_rows, y_cols = y_arr.shape + + if m_cols != y_cols: + raise ValueError("m and y have incompatible dimensions") + + # allocate and fill output array + out = np.empty((m_rows + y_rows, m_cols), dtype=dtype) + out[:m_rows, :] = m_arr + out[-y_rows:, :] = y_arr + + return out + + return _prepare_cov_input_inner + + +@register_jitable +def _handle_m_dim_change(m): + if m.ndim == 2 and m.shape[0] == 1: + msg = ("2D array containing a single row is unsupported due to " + "ambiguity in type inference. To use numpy.cov in this case " + "simply pass the row as a 1D array, i.e. m[0].") + raise RuntimeError(msg) + + +_handle_m_dim_nop = register_jitable(lambda x: x) + + +def determine_dtype(array_like): + array_like_dt = np.float64 + if isinstance(array_like, types.Array): + array_like_dt = as_dtype(array_like.dtype) + elif isinstance(array_like, (types.Number, types.Boolean)): + array_like_dt = as_dtype(array_like) + elif isinstance(array_like, (types.UniTuple, types.Tuple)): + coltypes = set() + for val in array_like: + if hasattr(val, 'count'): + [coltypes.add(v) for v in val] + else: + coltypes.add(val) + if len(coltypes) > 1: + array_like_dt = np.promote_types(*[as_dtype(ty) for ty in coltypes]) + elif len(coltypes) == 1: + array_like_dt = as_dtype(coltypes.pop()) + + return array_like_dt + + +def check_dimensions(array_like, name): + if isinstance(array_like, types.Array): + if array_like.ndim > 2: + raise NumbaTypeError("{0} has more than 2 dimensions".format(name)) + elif isinstance(array_like, types.Sequence): + if isinstance(array_like.key[0], types.Sequence): + if isinstance(array_like.key[0].key[0], types.Sequence): + msg = "{0} has more than 2 dimensions".format(name) + raise NumbaTypeError(msg) + + +@register_jitable +def _handle_ddof(ddof): + if not np.isfinite(ddof): + raise ValueError('Cannot convert non-finite ddof to integer') + if ddof - int(ddof) != 0: + raise ValueError('ddof must be integral value') + + +_handle_ddof_nop = register_jitable(lambda x: x) + + +@register_jitable +def _prepare_cov_input(m, y, rowvar, dtype, ddof, _DDOF_HANDLER, + _M_DIM_HANDLER): + _M_DIM_HANDLER(m) + _DDOF_HANDLER(ddof) + return _prepare_cov_input_inner(m, y, rowvar, dtype) + + +def scalar_result_expected(mandatory_input, optional_input): + opt_is_none = optional_input in (None, types.none) + + if isinstance(mandatory_input, types.Array) and mandatory_input.ndim == 1: + return opt_is_none + + if isinstance(mandatory_input, types.BaseTuple): + if all(isinstance(x, (types.Number, types.Boolean)) + for x in mandatory_input.types): + return opt_is_none + else: + if (len(mandatory_input.types) == 1 and + isinstance(mandatory_input.types[0], types.BaseTuple)): + return opt_is_none + + if isinstance(mandatory_input, (types.Number, types.Boolean)): + return opt_is_none + + if isinstance(mandatory_input, types.Sequence): + if (not isinstance(mandatory_input.key[0], types.Sequence) and + opt_is_none): + return True + + return False + + +@register_jitable +def _clip_corr(x): + return np.where(np.fabs(x) > 1, np.sign(x), x) + + +@register_jitable +def _clip_complex(x): + real = _clip_corr(x.real) + imag = _clip_corr(x.imag) + return real + 1j * imag + + +@overload(np.cov) +def np_cov(m, y=None, rowvar=True, bias=False, ddof=None): + + # reject problem if m and / or y are more than 2D + check_dimensions(m, 'm') + check_dimensions(y, 'y') + + # reject problem if ddof invalid (either upfront if type is + # obviously invalid, or later if value found to be non-integral) + if ddof in (None, types.none): + _DDOF_HANDLER = _handle_ddof_nop + else: + if isinstance(ddof, (types.Integer, types.Boolean)): + _DDOF_HANDLER = _handle_ddof_nop + elif isinstance(ddof, types.Float): + _DDOF_HANDLER = _handle_ddof + else: + raise TypingError('ddof must be a real numerical scalar type') + + # special case for 2D array input with 1 row of data - select + # handler function which we'll call later when we have access + # to the shape of the input array + _M_DIM_HANDLER = _handle_m_dim_nop + if isinstance(m, types.Array): + _M_DIM_HANDLER = _handle_m_dim_change + + # infer result dtype + m_dt = determine_dtype(m) + y_dt = determine_dtype(y) + dtype = np.result_type(m_dt, y_dt, np.float64) + + def np_cov_impl(m, y=None, rowvar=True, bias=False, ddof=None): + X = _prepare_cov_input(m, y, rowvar, dtype, ddof, _DDOF_HANDLER, + _M_DIM_HANDLER).astype(dtype) + + if np.any(np.array(X.shape) == 0): + return np.full((X.shape[0], X.shape[0]), fill_value=np.nan, + dtype=dtype) + else: + return np_cov_impl_inner(X, bias, ddof) + + def np_cov_impl_single_variable(m, y=None, rowvar=True, bias=False, + ddof=None): + X = _prepare_cov_input(m, y, rowvar, ddof, dtype, _DDOF_HANDLER, + _M_DIM_HANDLER).astype(dtype) + + if np.any(np.array(X.shape) == 0): + variance = np.nan + else: + variance = np_cov_impl_inner(X, bias, ddof).flat[0] + + return np.array(variance) + + if scalar_result_expected(m, y): + return np_cov_impl_single_variable + else: + return np_cov_impl + + +@overload(np.corrcoef) +def np_corrcoef(x, y=None, rowvar=True): + + x_dt = determine_dtype(x) + y_dt = determine_dtype(y) + dtype = np.result_type(x_dt, y_dt, np.float64) + + if dtype == np.complex128: + clip_fn = _clip_complex + else: + clip_fn = _clip_corr + + def np_corrcoef_impl(x, y=None, rowvar=True): + c = np.cov(x, y, rowvar) + d = np.diag(c) + stddev = np.sqrt(d.real) + + for i in range(c.shape[0]): + c[i, :] /= stddev + c[:, i] /= stddev + + return clip_fn(c) + + def np_corrcoef_impl_single_variable(x, y=None, rowvar=True): + c = np.cov(x, y, rowvar) + return c / c + + if scalar_result_expected(x, y): + return np_corrcoef_impl_single_variable + else: + return np_corrcoef_impl + + +#---------------------------------------------------------------------------- +# Element-wise computations + + +@overload(np.argwhere) +def np_argwhere(a): + # needs to be much more array-like for the array impl to work, Numba bug + # in one of the underlying function calls? + + use_scalar = isinstance(a, (types.Number, types.Boolean)) + if type_can_asarray(a) and not use_scalar: + def impl(a): + arr = np.asarray(a) + if arr.shape == (): + return np.zeros((0, 1), dtype=types.intp) + return np.transpose(np.vstack(np.nonzero(arr))) + else: + falseish = (0, 0) + trueish = (1, 0) + + def impl(a): + if a is not None and bool(a): + return np.zeros(trueish, dtype=types.intp) + else: + return np.zeros(falseish, dtype=types.intp) + + return impl + + +@overload(np.flatnonzero) +def np_flatnonzero(a): + + if type_can_asarray(a): + def impl(a): + arr = np.asarray(a) + return np.nonzero(np.ravel(arr))[0] + else: + def impl(a): + if a is not None and bool(a): + data = [0] + else: + data = [x for x in range(0)] + return np.array(data, dtype=types.intp) + + return impl + + +@register_jitable +def _fill_diagonal_params(a, wrap): + if a.ndim == 2: + m = a.shape[0] + n = a.shape[1] + step = 1 + n + if wrap: + end = n * m + else: + end = n * min(m, n) + else: + shape = np.array(a.shape) + + if not np.all(np.diff(shape) == 0): + raise ValueError("All dimensions of input must be of equal length") + + step = 1 + (np.cumprod(shape[:-1])).sum() + end = shape.prod() + + return end, step + + +@register_jitable +def _fill_diagonal_scalar(a, val, wrap): + end, step = _fill_diagonal_params(a, wrap) + + for i in range(0, end, step): + a.flat[i] = val + + +@register_jitable +def _fill_diagonal(a, val, wrap): + end, step = _fill_diagonal_params(a, wrap) + ctr = 0 + v_len = len(val) + + for i in range(0, end, step): + a.flat[i] = val[ctr] + ctr += 1 + ctr = ctr % v_len + + +@register_jitable +def _check_val_int(a, val): + iinfo = np.iinfo(a.dtype) + v_min = iinfo.min + v_max = iinfo.max + + # check finite values are within bounds + if np.any(~np.isfinite(val)) or np.any(val < v_min) or np.any(val > v_max): + raise ValueError('Unable to safely conform val to a.dtype') + + +@register_jitable +def _check_val_float(a, val): + finfo = np.finfo(a.dtype) + v_min = finfo.min + v_max = finfo.max + + # check finite values are within bounds + finite_vals = val[np.isfinite(val)] + if np.any(finite_vals < v_min) or np.any(finite_vals > v_max): + raise ValueError('Unable to safely conform val to a.dtype') + + +# no check performed, needed for pathway where no check is required +_check_nop = register_jitable(lambda x, y: x) + + +def _asarray(x): + pass + + +@overload(_asarray) +def _asarray_impl(x): + if isinstance(x, types.Array): + return lambda x: x + elif isinstance(x, (types.Sequence, types.Tuple)): + return lambda x: np.array(x) + elif isinstance(x, (types.Number, types.Boolean)): + ty = as_dtype(x) + return lambda x: np.array([x], dtype=ty) + + +@overload(np.fill_diagonal) +def np_fill_diagonal(a, val, wrap=False): + + if a.ndim > 1: + # the following can be simplified after #3088; until then, employ + # a basic mechanism for catching cases where val is of a type/value + # which cannot safely be cast to a.dtype + if isinstance(a.dtype, types.Integer): + checker = _check_val_int + elif isinstance(a.dtype, types.Float): + checker = _check_val_float + else: + checker = _check_nop + + def scalar_impl(a, val, wrap=False): + tmpval = _asarray(val).flatten() + checker(a, tmpval) + _fill_diagonal_scalar(a, val, wrap) + + def non_scalar_impl(a, val, wrap=False): + tmpval = _asarray(val).flatten() + checker(a, tmpval) + _fill_diagonal(a, tmpval, wrap) + + if isinstance(val, (types.Float, types.Integer, types.Boolean)): + return scalar_impl + elif isinstance(val, (types.Tuple, types.Sequence, types.Array)): + return non_scalar_impl + else: + msg = "The first argument must be at least 2-D (found %s-D)" % a.ndim + raise TypingError(msg) + + +def _np_round_intrinsic(tp): + # np.round() always rounds half to even + return "llvm.rint.f%d" % (tp.bitwidth,) + + +@intrinsic +def _np_round_float(typingctx, val): + sig = val(val) + + def codegen(context, builder, sig, args): + [val] = args + tp = sig.args[0] + llty = context.get_value_type(tp) + module = builder.module + fnty = llvmlite.ir.FunctionType(llty, [llty]) + fn = cgutils.get_or_insert_function(module, fnty, + _np_round_intrinsic(tp)) + res = builder.call(fn, (val,)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + return sig, codegen + + +@register_jitable +def round_ndigits(x, ndigits): + if math.isinf(x) or math.isnan(x): + return x + + # NOTE: this is CPython's algorithm, but perhaps this is overkill + # when emulating Numpy's behaviour. + if ndigits >= 0: + if ndigits > 22: + # pow1 and pow2 are each safe from overflow, but + # pow1*pow2 ~= pow(10.0, ndigits) might overflow. + pow1 = 10.0 ** (ndigits - 22) + pow2 = 1e22 + else: + pow1 = 10.0 ** ndigits + pow2 = 1.0 + y = (x * pow1) * pow2 + if math.isinf(y): + return x + return (_np_round_float(y) / pow2) / pow1 + + else: + pow1 = 10.0 ** (-ndigits) + y = x / pow1 + return _np_round_float(y) * pow1 + + +@overload(np.around) +@overload(np.round) +def impl_np_round(a, decimals=0, out=None): + if not type_can_asarray(a): + raise TypingError('The argument "a" must be array-like') + + if not (isinstance(out, types.Array) or is_nonelike(out)): + msg = 'The argument "out" must be an array if it is provided' + raise TypingError(msg) + + if isinstance(a, (types.Float, types.Integer, types.Complex)): + if is_nonelike(out): + if isinstance(a, types.Float): + def impl(a, decimals=0, out=None): + if decimals == 0: + return _np_round_float(a) + else: + return round_ndigits(a, decimals) + return impl + elif isinstance(a, types.Integer): + def impl(a, decimals=0, out=None): + if decimals == 0: + return a + else: + return int(round_ndigits(a, decimals)) + return impl + elif isinstance(a, types.Complex): + def impl(a, decimals=0, out=None): + if decimals == 0: + real = _np_round_float(a.real) + imag = _np_round_float(a.imag) + else: + real = round_ndigits(a.real, decimals) + imag = round_ndigits(a.imag, decimals) + return complex(real, imag) + return impl + else: + def impl(a, decimals=0, out=None): + out[0] = np.round(a, decimals) + return out + return impl + elif isinstance(a, types.Array): + if is_nonelike(out): + def impl(a, decimals=0, out=None): + out = np.empty_like(a) + return np.round(a, decimals, out) + return impl + else: + def impl(a, decimals=0, out=None): + if a.shape != out.shape: + raise ValueError("invalid output shape") + for index, val in np.ndenumerate(a): + out[index] = np.round(val, decimals) + return out + return impl + + +if numpy_version < (2, 0): + overload(np.round_)(impl_np_round) + + +@overload(np.sinc) +def impl_np_sinc(x): + if isinstance(x, types.Number): + def impl(x): + if x == 0.e0: # to match np impl + x = 1e-20 + x *= np.pi # np sinc is the normalised variant + return np.sin(x) / x + return impl + elif isinstance(x, types.Array): + def impl(x): + out = np.zeros_like(x) + for index, val in np.ndenumerate(x): + out[index] = np.sinc(val) + return out + return impl + else: + raise NumbaTypeError('Argument "x" must be a Number or array-like.') + + +@overload(np.angle) +def ov_np_angle(z, deg=False): + deg_mult = float(180 / np.pi) + + # non-complex scalar values are accepted as well + if isinstance(z, types.Number): + def impl(z, deg=False): + if deg: + return np.arctan2(z.imag, z.real) * deg_mult + else: + return np.arctan2(z.imag, z.real) + return impl + elif isinstance(z, types.Array): + dtype = z.dtype + + if isinstance(dtype, types.Complex): + ret_dtype = dtype.underlying_float + elif isinstance(dtype, types.Float): + ret_dtype = dtype + else: + return + + def impl(z, deg=False): + out = np.zeros_like(z, dtype=ret_dtype) + for index, val in np.ndenumerate(z): + out[index] = np.angle(val, deg) + return out + return impl + else: + raise NumbaTypeError('Argument "z" must be a complex ' + f'or Array[complex]. Got {z}') + + +@lower_builtin(np.nonzero, types.Array) +@lower_builtin("array.nonzero", types.Array) +def array_nonzero(context, builder, sig, args): + aryty = sig.args[0] + # Return type is a N-tuple of 1D C-contiguous arrays + retty = sig.return_type + outaryty = retty.dtype + nouts = retty.count + + ary = make_array(aryty)(context, builder, args[0]) + shape = cgutils.unpack_tuple(builder, ary.shape) + strides = cgutils.unpack_tuple(builder, ary.strides) + data = ary.data + layout = aryty.layout + + # First count the number of non-zero elements + zero = context.get_constant(types.intp, 0) + one = context.get_constant(types.intp, 1) + count = cgutils.alloca_once_value(builder, zero) + with cgutils.loop_nest(builder, shape, zero.type) as indices: + ptr = cgutils.get_item_pointer2(context, builder, data, shape, strides, + layout, indices) + val = load_item(context, builder, aryty, ptr) + nz = context.is_true(builder, aryty.dtype, val) + with builder.if_then(nz): + builder.store(builder.add(builder.load(count), one), count) + + # Then allocate output arrays of the right size + out_shape = (builder.load(count),) + outs = [_empty_nd_impl(context, builder, outaryty, out_shape)._getvalue() + for i in range(nouts)] + outarys = [make_array(outaryty)(context, builder, out) for out in outs] + out_datas = [out.data for out in outarys] + + # And fill them up + index = cgutils.alloca_once_value(builder, zero) + with cgutils.loop_nest(builder, shape, zero.type) as indices: + ptr = cgutils.get_item_pointer2(context, builder, data, shape, strides, + layout, indices) + val = load_item(context, builder, aryty, ptr) + nz = context.is_true(builder, aryty.dtype, val) + with builder.if_then(nz): + # Store element indices in output arrays + if not indices: + # For a 0-d array, store 0 in the unique output array + indices = (zero,) + cur = builder.load(index) + for i in range(nouts): + ptr = cgutils.get_item_pointer2(context, builder, out_datas[i], + out_shape, (), + 'C', [cur]) + store_item(context, builder, outaryty, indices[i], ptr) + builder.store(builder.add(cur, one), index) + + tup = context.make_tuple(builder, sig.return_type, outs) + return impl_ret_new_ref(context, builder, sig.return_type, tup) + + +def _where_zero_size_array_impl(dtype): + def impl(condition, x, y): + x_ = np.asarray(x).astype(dtype) + y_ = np.asarray(y).astype(dtype) + return x_ if condition else y_ + return impl + + +@register_jitable +def _where_generic_inner_impl(cond, x, y, res): + for idx, c in np.ndenumerate(cond): + res[idx] = x[idx] if c else y[idx] + return res + + +@register_jitable +def _where_fast_inner_impl(cond, x, y, res): + cf = cond.flat + xf = x.flat + yf = y.flat + rf = res.flat + for i in range(cond.size): + rf[i] = xf[i] if cf[i] else yf[i] + return res + + +def _where_generic_impl(dtype, layout): + use_faster_impl = layout in [{'C'}, {'F'}] + + def impl(condition, x, y): + cond1, x1, y1 = np.asarray(condition), np.asarray(x), np.asarray(y) + shape = np.broadcast_shapes(cond1.shape, x1.shape, y1.shape) + cond_ = np.broadcast_to(cond1, shape) + x_ = np.broadcast_to(x1, shape) + y_ = np.broadcast_to(y1, shape) + + if layout == 'F': + res = np.empty(shape[::-1], dtype=dtype).T + else: + res = np.empty(shape, dtype=dtype) + + if use_faster_impl: + return _where_fast_inner_impl(cond_, x_, y_, res) + else: + return _where_generic_inner_impl(cond_, x_, y_, res) + + return impl + + +@overload(np.where) +def ov_np_where(condition): + if not type_can_asarray(condition): + msg = 'The argument "condition" must be array-like' + raise NumbaTypeError(msg) + + def where_cond_none_none(condition): + return np.asarray(condition).nonzero() + return where_cond_none_none + + +@overload(np.where) +def ov_np_where_x_y(condition, x, y): + if not type_can_asarray(condition): + msg = 'The argument "condition" must be array-like' + raise NumbaTypeError(msg) + + # corner case: None is a valid value for np.where: + # >>> np.where([0, 1], None, 2) + # array([None, 2]) + # + # >>> np.where([0, 1], 2, None) + # array([2, None]) + # + # >>> np.where([0, 1], None, None) + # array([None, None]) + if is_nonelike(x) or is_nonelike(y): + # skip it for now as np.asarray(None) is not supported + raise NumbaTypeError('Argument "x" or "y" cannot be None') + + for arg, name in zip((x, y), ('x', 'y')): + if not type_can_asarray(arg): + msg = 'The argument "{}" must be array-like if provided' + raise NumbaTypeError(msg.format(name)) + + cond_arr = isinstance(condition, types.Array) + x_arr = isinstance(x, types.Array) + y_arr = isinstance(y, types.Array) + + if cond_arr: + x_dt = determine_dtype(x) + y_dt = determine_dtype(y) + dtype = np.promote_types(x_dt, y_dt) + + # corner case - 0 dim values + def check_0_dim(arg): + return isinstance(arg, types.Number) or ( + isinstance(arg, types.Array) and arg.ndim == 0) + special_0_case = all([check_0_dim(a) for a in (condition, x, y)]) + if special_0_case: + return _where_zero_size_array_impl(dtype) + + layout = condition.layout + if x_arr and y_arr: + if x.layout == y.layout == condition.layout: + layout = x.layout + else: + layout = 'A' + return _where_generic_impl(dtype, layout) + else: + def impl(condition, x, y): + return np.where(np.asarray(condition), np.asarray(x), np.asarray(y)) + return impl + + +@overload(np.real) +def np_real(val): + def np_real_impl(val): + return val.real + + return np_real_impl + + +@overload(np.imag) +def np_imag(val): + def np_imag_impl(val): + return val.imag + + return np_imag_impl + + +#---------------------------------------------------------------------------- +# Misc functions + +@overload(operator.contains) +def np_contains(arr, key): + if not isinstance(arr, types.Array): + return + + def np_contains_impl(arr, key): + for x in np.nditer(arr): + if x == key: + return True + return False + + return np_contains_impl + + +@overload(np.count_nonzero) +def np_count_nonzero(a, axis=None): + if not type_can_asarray(a): + raise TypingError("The argument to np.count_nonzero must be array-like") + + if is_nonelike(axis): + def impl(a, axis=None): + arr2 = np.ravel(a) + return np.sum(arr2 != 0) + return impl + else: + def impl(a, axis=None): + arr2 = a.astype(np.bool_) + return np.sum(arr2, axis=axis) + return impl + + +np_delete_handler_isslice = register_jitable(lambda x : x) +np_delete_handler_isarray = register_jitable(lambda x : np.asarray(x)) + + +@overload(np.delete) +def np_delete(arr, obj): + # Implementation based on numpy + # https://github.com/numpy/numpy/blob/af66e487a57bfd4850f4306e3b85d1dac3c70412/numpy/lib/function_base.py#L4065-L4267 # noqa: E501 + + if not isinstance(arr, (types.Array, types.Sequence)): + raise TypingError("arr must be either an Array or a Sequence") + + if isinstance(obj, (types.Array, types.Sequence, types.SliceType)): + if isinstance(obj, (types.SliceType)): + handler = np_delete_handler_isslice + else: + if not isinstance(obj.dtype, types.Integer): + raise TypingError('obj should be of Integer dtype') + handler = np_delete_handler_isarray + + def np_delete_impl(arr, obj): + arr = np.ravel(np.asarray(arr)) + N = arr.size + + keep = np.ones(N, dtype=np.bool_) + obj = handler(obj) + keep[obj] = False + return arr[keep] + return np_delete_impl + + else: # scalar value + if not isinstance(obj, types.Integer): + raise TypingError('obj should be of Integer dtype') + + def np_delete_scalar_impl(arr, obj): + arr = np.ravel(np.asarray(arr)) + N = arr.size + pos = obj + + if (pos < -N or pos >= N): + raise IndexError('obj must be less than the len(arr)') + # NumPy raises IndexError: index 'i' is out of + # bounds for axis 'x' with size 'n' + + if (pos < 0): + pos += N + + return np.concatenate((arr[:pos], arr[pos + 1:])) + return np_delete_scalar_impl + + +@overload(np.diff) +def np_diff_impl(a, n=1): + if not isinstance(a, types.Array) or a.ndim == 0: + return + + def diff_impl(a, n=1): + if n == 0: + return a.copy() + if n < 0: + raise ValueError("diff(): order must be non-negative") + size = a.shape[-1] + out_shape = a.shape[:-1] + (max(size - n, 0),) + out = np.empty(out_shape, a.dtype) + if out.size == 0: + return out + + # np.diff() works on each last dimension subarray independently. + # To make things easier, normalize input and output into 2d arrays + a2 = a.reshape((-1, size)) + out2 = out.reshape((-1, out.shape[-1])) + # A scratchpad for subarrays + work = np.empty(size, a.dtype) + + for major in range(a2.shape[0]): + # First iteration: diff a2 into work + for i in range(size - 1): + work[i] = a2[major, i + 1] - a2[major, i] + # Other iterations: diff work into itself + for niter in range(1, n): + for i in range(size - niter - 1): + work[i] = work[i + 1] - work[i] + # Copy final diff into out2 + out2[major] = work[:size - n] + + return out + + return diff_impl + + +@overload(np.array_equal) +def np_array_equal(a1, a2): + + if not (type_can_asarray(a1) and type_can_asarray(a2)): + raise TypingError('Both arguments to "array_equals" must be array-like') + + accepted = (types.Boolean, types.Number) + if isinstance(a1, accepted) and isinstance(a2, accepted): + # special case + def impl(a1, a2): + return a1 == a2 + else: + def impl(a1, a2): + a = np.asarray(a1) + b = np.asarray(a2) + if a.shape == b.shape: + return np.all(a == b) + return False + + return impl + + +@overload(np.intersect1d) +def jit_np_intersect1d(ar1, ar2, assume_unique=False): + # Not implemented to support return_indices + # https://github.com/numpy/numpy/blob/v1.19.0/numpy/lib + # /arraysetops.py#L347-L441 + if not (type_can_asarray(ar1) or type_can_asarray(ar2)): + raise TypingError('intersect1d: first two args must be array-like') + if not isinstance(assume_unique, (types.Boolean, bool)): + raise TypingError('intersect1d: ' + 'argument "assume_unique" must be boolean') + + def np_intersects1d_impl(ar1, ar2, assume_unique=False): + ar1 = np.asarray(ar1) + ar2 = np.asarray(ar2) + + if not assume_unique: + ar1 = np.unique(ar1) + ar2 = np.unique(ar2) + else: + ar1 = ar1.ravel() + ar2 = ar2.ravel() + + aux = np.concatenate((ar1, ar2)) + aux.sort() + mask = aux[1:] == aux[:-1] + int1d = aux[:-1][mask] + return int1d + return np_intersects1d_impl + + +def validate_1d_array_like(func_name, seq): + if isinstance(seq, types.Array): + if seq.ndim != 1: + raise NumbaTypeError("{0}(): input should have dimension 1" + .format(func_name)) + elif not isinstance(seq, types.Sequence): + raise NumbaTypeError("{0}(): input should be an array or sequence" + .format(func_name)) + + +@overload(np.bincount) +def np_bincount(a, weights=None, minlength=0): + validate_1d_array_like("bincount", a) + + if not isinstance(a.dtype, types.Integer): + return + + check_is_integer(minlength, 'minlength') + + if weights not in (None, types.none): + validate_1d_array_like("bincount", weights) + # weights is promoted to double in C impl + # https://github.com/numpy/numpy/blob/maintenance/1.16.x/numpy/core/src/multiarray/compiled_base.c#L93-L95 # noqa: E501 + out_dtype = np.float64 + + @register_jitable + def validate_inputs(a, weights, minlength): + if len(a) != len(weights): + raise ValueError("bincount(): weights and list don't have " + "the same length") + + @register_jitable + def count_item(out, idx, val, weights): + out[val] += weights[idx] + + else: + out_dtype = types.intp + + @register_jitable + def validate_inputs(a, weights, minlength): + pass + + @register_jitable + def count_item(out, idx, val, weights): + out[val] += 1 + + def bincount_impl(a, weights=None, minlength=0): + validate_inputs(a, weights, minlength) + if minlength < 0: + raise ValueError("'minlength' must not be negative") + + n = len(a) + a_max = a[0] if n > 0 else -1 + for i in range(1, n): + if a[i] < 0: + raise ValueError("bincount(): first argument must be " + "non-negative") + a_max = max(a_max, a[i]) + + out_length = max(a_max + 1, minlength) + out = np.zeros(out_length, out_dtype) + for i in range(n): + count_item(out, i, a[i], weights) + return out + + return bincount_impl + + +less_than_float = register_jitable(lt_floats) +less_than_complex = register_jitable(lt_complex) + + +@register_jitable +def less_than_or_equal_complex(a, b): + if np.isnan(a.real): + if np.isnan(b.real): + if np.isnan(a.imag): + return np.isnan(b.imag) + else: + if np.isnan(b.imag): + return True + else: + return a.imag <= b.imag + else: + return False + + else: + if np.isnan(b.real): + return True + else: + if np.isnan(a.imag): + if np.isnan(b.imag): + return a.real <= b.real + else: + return False + else: + if np.isnan(b.imag): + return True + else: + if a.real < b.real: + return True + elif a.real == b.real: + return a.imag <= b.imag + return False + + +@register_jitable +def _less_than_or_equal(a, b): + if isinstance(a, complex) or isinstance(b, complex): + return less_than_or_equal_complex(a, b) + + elif isinstance(b, float): + if np.isnan(b): + return True + + return a <= b + + +@register_jitable +def _less_than(a, b): + if isinstance(a, complex) or isinstance(b, complex): + return less_than_complex(a, b) + + elif isinstance(b, float): + return less_than_float(a, b) + + return a < b + + +@register_jitable +def _less_then_datetime64(a, b): + # Original numpy code is at: + # https://github.com/numpy/numpy/blob/3dad50936a8dc534a81a545365f69ee9ab162ffe/numpy/_core/src/npysort/npysort_common.h#L334-L346 + if np.isnat(a): + return 0 + + if np.isnat(b): + return 1 + + return a < b + + +@register_jitable +def _less_then_or_equal_datetime64(a, b): + return not _less_then_datetime64(b, a) + + +def _searchsorted(cmp): + # a facsimile of: + # https://github.com/numpy/numpy/blob/4f84d719657eb455a35fcdf9e75b83eb1f97024a/numpy/core/src/npysort/binsearch.cpp#L61 # noqa: E501 + + def impl(a, key_val, min_idx, max_idx): + while min_idx < max_idx: + # to avoid overflow + mid_idx = min_idx + ((max_idx - min_idx) >> 1) + mid_val = a[mid_idx] + if cmp(mid_val, key_val): + min_idx = mid_idx + 1 + else: + max_idx = mid_idx + return min_idx, max_idx + + return impl + + +VALID_SEARCHSORTED_SIDES = frozenset({'left', 'right'}) + + +def make_searchsorted_implementation(np_dtype, side): + assert side in VALID_SEARCHSORTED_SIDES + + if np_dtype.char in 'mM': + # is datetime + lt = _less_then_datetime64 + le = _less_then_or_equal_datetime64 + else: + lt = _less_than + le = _less_than_or_equal + + if side == 'left': + _impl = _searchsorted(lt) + _cmp = lt + else: + _impl = _searchsorted(le) + _cmp = le + + return register_jitable(_impl), register_jitable(_cmp) + + +@overload(np.searchsorted) +def searchsorted(a, v, side='left'): + side_val = getattr(side, 'literal_value', side) + + if side_val not in VALID_SEARCHSORTED_SIDES: + # could change this so that side doesn't need to be + # a compile-time constant + raise NumbaValueError(f"Invalid value given for 'side': {side_val}") + + if isinstance(v, (types.Array, types.Sequence)): + v_dt = as_dtype(v.dtype) + else: + v_dt = as_dtype(v) + + np_dt = np.promote_types(as_dtype(a.dtype), v_dt) + _impl, _cmp = make_searchsorted_implementation(np_dt, side_val) + + if isinstance(v, types.Array): + def impl(a, v, side='left'): + out = np.empty(v.size, dtype=np.intp) + last_key_val = v.flat[0] + min_idx = 0 + max_idx = len(a) + + for i in range(v.size): + key_val = v.flat[i] + + if _cmp(last_key_val, key_val): + max_idx = len(a) + else: + min_idx = 0 + if max_idx < len(a): + max_idx += 1 + else: + max_idx = len(a) + + last_key_val = key_val + min_idx, max_idx = _impl(a, key_val, min_idx, max_idx) + out[i] = min_idx + + return out.reshape(v.shape) + elif isinstance(v, types.Sequence): + def impl(a, v, side='left'): + v = np.asarray(v) + return np.searchsorted(a, v, side=side) + else: # presumably `v` is scalar + def impl(a, v, side='left'): + r, _ = _impl(a, v, 0, len(a)) + return r + return impl + + +@overload(np.digitize) +def np_digitize(x, bins, right=False): + + if isinstance(x, types.Array) and x.dtype in types.complex_domain: + raise TypingError('x may not be complex') + + @register_jitable + def _monotonicity(bins): + + # all bin edges hold the same value + if len(bins) == 0: + return 1 + + # Skip repeated values at the beginning of the array + last_value = bins[0] + i = 1 + while i < len(bins) and bins[i] == last_value: + i += 1 + + # all bin edges hold the same value + if i == len(bins): + return 1 + + next_value = bins[i] + + if last_value < next_value: + # Possibly monotonic increasing + for i in range(i + 1, len(bins)): + last_value = next_value + next_value = bins[i] + if last_value > next_value: + return 0 + return 1 + + else: + # last > next, possibly monotonic decreasing + for i in range(i + 1, len(bins)): + last_value = next_value + next_value = bins[i] + if last_value < next_value: + return 0 + return -1 + + def digitize_impl(x, bins, right=False): + + mono = _monotonicity(bins) + + if mono == 0: + raise ValueError( + "bins must be monotonically increasing or decreasing" + ) + + # this is backwards because the arguments below are swapped + if right: + if mono == -1: + # reverse the bins, and invert the results + return len(bins) - np.searchsorted(bins[::-1], x, side='left') + else: + return np.searchsorted(bins, x, side='left') + else: + if mono == -1: + # reverse the bins, and invert the results + return len(bins) - np.searchsorted(bins[::-1], x, side='right') + else: + return np.searchsorted(bins, x, side='right') + + return digitize_impl + + +_range = range + + +@overload(np.histogram) +def np_histogram(a, bins=10, range=None): + if isinstance(bins, (int, types.Integer)): + # With a uniform distribution of bins, use a fast algorithm + # independent of the number of bins + + if range in (None, types.none): + inf = float('inf') + + def histogram_impl(a, bins=10, range=None): + bin_min = inf + bin_max = -inf + for view in np.nditer(a): + v = view.item() + if bin_min > v: + bin_min = v + if bin_max < v: + bin_max = v + return np.histogram(a, bins, (bin_min, bin_max)) + + else: + def histogram_impl(a, bins=10, range=None): + if bins <= 0: + raise ValueError("histogram(): `bins` should be a " + "positive integer") + bin_min, bin_max = range + if not bin_min <= bin_max: + raise ValueError("histogram(): max must be larger than " + "min in range parameter") + + hist = np.zeros(bins, np.intp) + if bin_max > bin_min: + bin_ratio = bins / (bin_max - bin_min) + for view in np.nditer(a): + v = view.item() + b = math.floor((v - bin_min) * bin_ratio) + if 0 <= b < bins: + hist[int(b)] += 1 + elif v == bin_max: + hist[bins - 1] += 1 + + bins_array = np.linspace(bin_min, bin_max, bins + 1) + return hist, bins_array + + else: + # With a custom bins array, use a bisection search + + def histogram_impl(a, bins=10, range=None): + nbins = len(bins) - 1 + for i in _range(nbins): + # Note this also catches NaNs + if not bins[i] <= bins[i + 1]: + raise ValueError("histogram(): bins must increase " + "monotonically") + + bin_min = bins[0] + bin_max = bins[nbins] + hist = np.zeros(nbins, np.intp) + + if nbins > 0: + for view in np.nditer(a): + v = view.item() + if not bin_min <= v <= bin_max: + # Value is out of bounds, ignore (also catches NaNs) + continue + # Bisect in bins[:-1] + lo = 0 + hi = nbins - 1 + while lo < hi: + # Note the `+ 1` is necessary to avoid an infinite + # loop where mid = lo => lo = mid + mid = (lo + hi + 1) >> 1 + if v < bins[mid]: + hi = mid - 1 + else: + lo = mid + hist[lo] += 1 + + return hist, bins + + return histogram_impl + + +# Create np.finfo, np.iinfo and np.MachAr +# machar +_mach_ar_supported = ('ibeta', 'it', 'machep', 'eps', 'negep', 'epsneg', + 'iexp', 'minexp', 'xmin', 'maxexp', 'xmax', 'irnd', + 'ngrd', 'epsilon', 'tiny', 'huge', 'precision', + 'resolution',) +MachAr = namedtuple('MachAr', _mach_ar_supported) + +# Do not support MachAr field +# finfo +_finfo_supported = ('eps', 'epsneg', 'iexp', 'machep', 'max', 'maxexp', 'min', + 'minexp', 'negep', 'nexp', 'nmant', 'precision', + 'resolution', 'tiny', 'bits',) + + +finfo = namedtuple('finfo', _finfo_supported) + +# iinfo +_iinfo_supported = ('min', 'max', 'bits',) + +iinfo = namedtuple('iinfo', _iinfo_supported) + + +def generate_xinfo_body(arg, np_func, container, attr): + nbty = getattr(arg, 'dtype', arg) + np_dtype = as_dtype(nbty) + try: + f = np_func(np_dtype) + except ValueError: # This exception instance comes from NumPy + # The np function might not support the dtype + return None + data = tuple([getattr(f, x) for x in attr]) + + @register_jitable + def impl(arg): + return container(*data) + return impl + + +@overload(np.finfo) +def ol_np_finfo(dtype): + fn = generate_xinfo_body(dtype, np.finfo, finfo, _finfo_supported) + + def impl(dtype): + return fn(dtype) + return impl + + +@overload(np.iinfo) +def ol_np_iinfo(int_type): + fn = generate_xinfo_body(int_type, np.iinfo, iinfo, _iinfo_supported) + + def impl(int_type): + return fn(int_type) + return impl + + +def _get_inner_prod(dta, dtb): + # gets an inner product implementation, if both types are float then + # BLAS is used else a local function + + @register_jitable + def _innerprod(a, b): + acc = 0 + for i in range(len(a)): + acc = acc + a[i] * b[i] + return acc + + # no BLAS... use local function regardless + if not _HAVE_BLAS: + return _innerprod + + flty = types.real_domain | types.complex_domain + floats = dta in flty and dtb in flty + if not floats: + return _innerprod + else: + a_dt = as_dtype(dta) + b_dt = as_dtype(dtb) + dt = np.promote_types(a_dt, b_dt) + + @register_jitable + def _dot_wrap(a, b): + return np.dot(a.astype(dt), b.astype(dt)) + return _dot_wrap + + +def _assert_1d(a, func_name): + if isinstance(a, types.Array): + if not a.ndim <= 1: + raise TypingError("%s() only supported on 1D arrays " % func_name) + + +def _np_correlate_core(ap1, ap2, mode, direction): + pass + + +@overload(_np_correlate_core) +def _np_correlate_core_impl(ap1, ap2, mode, direction): + a_dt = as_dtype(ap1.dtype) + b_dt = as_dtype(ap2.dtype) + dt = np.promote_types(a_dt, b_dt) + innerprod = _get_inner_prod(ap1.dtype, ap2.dtype) + + def impl(ap1, ap2, mode, direction): + # Implementation loosely based on `_pyarray_correlate` from + # https://github.com/numpy/numpy/blob/3bce2be74f228684ca2895ad02b63953f37e2a9d/numpy/core/src/multiarray/multiarraymodule.c#L1191 # noqa: E501 + # For "mode": + # Convolve uses 'full' by default. + # Correlate uses 'valid' by default. + # For "direction", +1 to write the return values out in order 0->N + # -1 to write them out N->0. + + n1 = len(ap1) + n2 = len(ap2) + + if n1 < n2: + # This should never occur when called by np.convolve because + # _np_correlate.impl swaps arguments based on length. + # The same applies for np.correlate. + raise ValueError("'len(ap1)' must greater than 'len(ap2)'") + + length = n1 + n = n2 + if mode == "valid": + length = length - n + 1 + n_left = 0 + n_right = 0 + elif mode == "full": + n_right = n - 1 + n_left = n - 1 + length = length + n - 1 + elif mode == "same": + n_left = n // 2 + n_right = n - n_left - 1 + else: + raise ValueError( + "Invalid 'mode', " + "valid are 'full', 'same', 'valid'" + ) + + ret = np.zeros(length, dt) + + if direction == 1: + idx = 0 + inc = 1 + elif direction == -1: + idx = length - 1 + inc = -1 + else: + raise ValueError("Invalid direction") + + for i in range(n_left): + k = i + n - n_left + ret[idx] = innerprod(ap1[:k], ap2[-k:]) + idx = idx + inc + + for i in range(n1 - n2 + 1): + ret[idx] = innerprod(ap1[i : i + n2], ap2) + idx = idx + inc + + for i in range(n_right): + k = n - i - 1 + ret[idx] = innerprod(ap1[-k:], ap2[:k]) + idx = idx + inc + + return ret + + return impl + + +@overload(np.correlate) +def _np_correlate(a, v, mode="valid"): + _assert_1d(a, 'np.correlate') + _assert_1d(v, 'np.correlate') + + @register_jitable + def op_conj(x): + return np.conj(x) + + @register_jitable + def op_nop(x): + return x + + if a.dtype in types.complex_domain: + if v.dtype in types.complex_domain: + a_op = op_nop + b_op = op_conj + else: + a_op = op_nop + b_op = op_nop + else: + if v.dtype in types.complex_domain: + a_op = op_nop + b_op = op_conj + else: + a_op = op_conj + b_op = op_nop + + def impl(a, v, mode="valid"): + la = len(a) + lv = len(v) + + if la == 0: + raise ValueError("'a' cannot be empty") + if lv == 0: + raise ValueError("'v' cannot be empty") + + if la < lv: + return _np_correlate_core(b_op(v), a_op(a), mode, -1) + else: + return _np_correlate_core(a_op(a), b_op(v), mode, 1) + + return impl + + +@overload(np.convolve) +def np_convolve(a, v, mode="full"): + _assert_1d(a, 'np.convolve') + _assert_1d(v, 'np.convolve') + + def impl(a, v, mode="full"): + la = len(a) + lv = len(v) + + if la == 0: + raise ValueError("'a' cannot be empty") + if lv == 0: + raise ValueError("'v' cannot be empty") + + if la < lv: + return _np_correlate_core(v, a[::-1], mode, 1) + else: + return _np_correlate_core(a, v[::-1], mode, 1) + + return impl + + +@overload(np.asarray) +def np_asarray(a, dtype=None): + + # developer note... keep this function (type_can_asarray) in sync with the + # accepted types implementations below! + if not type_can_asarray(a): + return None + + if isinstance(a, types.Array): + if is_nonelike(dtype) or a.dtype == dtype.dtype: + def impl(a, dtype=None): + return a + else: + def impl(a, dtype=None): + return a.astype(dtype) + elif isinstance(a, (types.Sequence, types.Tuple)): + # Nested lists cannot be unpacked, therefore only single lists are + # permitted and these conform to Sequence and can be unpacked along on + # the same path as Tuple. + if is_nonelike(dtype): + def impl(a, dtype=None): + return np.array(a) + else: + def impl(a, dtype=None): + return np.array(a, dtype) + elif isinstance(a, (types.Number, types.Boolean)): + dt_conv = a if is_nonelike(dtype) else dtype + ty = as_dtype(dt_conv) + + def impl(a, dtype=None): + return np.array(a, ty) + elif isinstance(a, types.containers.ListType): + if not isinstance(a.dtype, (types.Number, types.Boolean)): + raise TypingError( + "asarray support for List is limited " + "to Boolean and Number types") + + target_dtype = a.dtype if is_nonelike(dtype) else dtype + + def impl(a, dtype=None): + l = len(a) + ret = np.empty(l, dtype=target_dtype) + for i, v in enumerate(a): + ret[i] = v + return ret + elif isinstance(a, types.StringLiteral): + arr = np.asarray(a.literal_value) + + def impl(a, dtype=None): + return arr.copy() + else: + impl = None + + return impl + + +if numpy_version < (2, 0): + @overload(np.asfarray) + def np_asfarray(a, dtype=np.float64): + # convert numba dtype types into NumPy dtype + if isinstance(dtype, types.Type): + dtype = as_dtype(dtype) + if not np.issubdtype(dtype, np.inexact): + dx = types.float64 + else: + dx = dtype + + def impl(a, dtype=np.float64): + return np.asarray(a, dx) + return impl + + +@overload(np.extract) +def np_extract(condition, arr): + + def np_extract_impl(condition, arr): + cond = np.asarray(condition).flatten() + a = np.asarray(arr) + + if a.size == 0: + raise ValueError('Cannot extract from an empty array') + + # the following looks odd but replicates NumPy... + # https://github.com/numpy/numpy/issues/12859 + if np.any(cond[a.size:]) and cond.size > a.size: + msg = 'condition shape inconsistent with arr shape' + raise ValueError(msg) + # NumPy raises IndexError: index 'm' is out of + # bounds for size 'n' + + max_len = min(a.size, cond.size) + out = [a.flat[idx] for idx in range(max_len) if cond[idx]] + + return np.array(out) + + return np_extract_impl + + +@overload(np.select) +def np_select(condlist, choicelist, default=0): + + def np_select_arr_impl(condlist, choicelist, default=0): + if len(condlist) != len(choicelist): + raise ValueError('list of cases must be same length as list ' + 'of conditions') + out = default * np.ones(choicelist[0].shape, choicelist[0].dtype) + # should use reversed+zip, but reversed is not available + for i in range(len(condlist) - 1, -1, -1): + cond = condlist[i] + choice = choicelist[i] + out = np.where(cond, choice, out) + return out + + # first we check the types of the input parameters + if not isinstance(condlist, (types.List, types.UniTuple)): + raise NumbaTypeError('condlist must be a List or a Tuple') + if not isinstance(choicelist, (types.List, types.UniTuple)): + raise NumbaTypeError('choicelist must be a List or a Tuple') + if not isinstance(default, (int, types.Number, types.Boolean)): + raise NumbaTypeError('default must be a scalar (number or boolean)') + # the types of the parameters have been checked, now we test the types + # of the content of the parameters + # implementation note: if in the future numba's np.where accepts tuples + # as elements of condlist, then the check below should be extended to + # accept tuples + if not isinstance(condlist[0], types.Array): + raise NumbaTypeError('items of condlist must be arrays') + if not isinstance(choicelist[0], types.Array): + raise NumbaTypeError('items of choicelist must be arrays') + # the types of the parameters and their contents have been checked, + # now we test the dtypes of the content of parameters + if isinstance(condlist[0], types.Array): + if not isinstance(condlist[0].dtype, types.Boolean): + raise NumbaTypeError('condlist arrays must contain booleans') + if isinstance(condlist[0], types.UniTuple): + if not (isinstance(condlist[0], types.UniTuple) + and isinstance(condlist[0][0], types.Boolean)): + raise NumbaTypeError('condlist tuples must only contain booleans') + # the input types are correct, now we perform checks on the dimensions + if (isinstance(condlist[0], types.Array) and + condlist[0].ndim != choicelist[0].ndim): + raise NumbaTypeError('condlist and choicelist elements must have the ' + 'same number of dimensions') + if isinstance(condlist[0], types.Array) and condlist[0].ndim < 1: + raise NumbaTypeError('condlist arrays must be of at least dimension 1') + + return np_select_arr_impl + + +@overload(np.union1d) +def np_union1d(ar1, ar2): + if not type_can_asarray(ar1) or not type_can_asarray(ar2): + raise TypingError("The arguments to np.union1d must be array-like") + if (('unichr' in ar1.dtype.name or 'unichr' in ar2.dtype.name) and + ar1.dtype.name != ar2.dtype.name): + raise TypingError("For Unicode arrays, arrays must have same dtype") + + def union_impl(ar1, ar2): + a = np.ravel(np.asarray(ar1)) + b = np.ravel(np.asarray(ar2)) + return np.unique(np.concatenate((a, b))) + + return union_impl + + +@overload(np.asarray_chkfinite) +def np_asarray_chkfinite(a, dtype=None): + + msg = "The argument to np.asarray_chkfinite must be array-like" + if not isinstance(a, (types.Array, types.Sequence, types.Tuple)): + raise TypingError(msg) + + if is_nonelike(dtype): + dt = a.dtype + else: + try: + dt = as_dtype(dtype) + except NumbaNotImplementedError: + raise TypingError('dtype must be a valid Numpy dtype') + + def impl(a, dtype=None): + a = np.asarray(a, dtype=dt) + for i in np.nditer(a): + if not np.isfinite(i): + raise ValueError("array must not contain infs or NaNs") + return a + + return impl + + +@overload(np.unwrap) +def numpy_unwrap(p, discont=None, axis=-1, period=6.283185307179586): + if not isinstance(axis, (int, types.Integer)): + msg = 'The argument "axis" must be an integer' + raise TypingError(msg) + + if not type_can_asarray(p): + msg = 'The argument "p" must be array-like' + raise TypingError(msg) + + if (not isinstance(discont, (types.Integer, types.Float)) + and not cgutils.is_nonelike(discont)): + msg = 'The argument "discont" must be a scalar' + raise TypingError(msg) + + if not isinstance(period, (float, types.Number)): + msg = 'The argument "period" must be a scalar' + raise TypingError(msg) + + slice1 = (slice(1, None, None),) + if isinstance(period, types.Number): + dtype = np.result_type(as_dtype(p.dtype), as_dtype(period)) + else: + dtype = np.result_type(as_dtype(p.dtype), np.float64) + + integer_input = np.issubdtype(dtype, np.integer) + + def impl(p, discont=None, axis=-1, period=6.283185307179586): + if axis != -1: + msg = 'Value for argument "axis" is not supported' + raise ValueError(msg) + # Flatten to a 2D array, keeping axis -1 + p_init = np.asarray(p).astype(dtype) + init_shape = p_init.shape + last_axis = init_shape[-1] + p_new = p_init.reshape((p_init.size // last_axis, last_axis)) + # Manipulate discont and period + if discont is None: + discont = period / 2 + if integer_input: + interval_high, rem = divmod(period, 2) + boundary_ambiguous = rem == 0 + else: + interval_high = period / 2 + boundary_ambiguous = True + interval_low = -interval_high + + # Work on each row separately + for i in range(p_init.size // last_axis): + row = p_new[i] + dd = np.diff(row) + ddmod = np.mod(dd - interval_low, period) + interval_low + if boundary_ambiguous: + ddmod = np.where((ddmod == interval_low) & (dd > 0), + interval_high, ddmod) + ph_correct = ddmod - dd + + ph_correct = np.where(np.array([abs(x) for x in dd]) < discont, 0, + ph_correct) + ph_ravel = np.where(np.array([abs(x) for x in dd]) < discont, 0, + ph_correct) + ph_correct = np.reshape(ph_ravel, ph_correct.shape) + up = np.copy(row) + up[slice1] = row[slice1] + ph_correct.cumsum() + p_new[i] = up + + return p_new.reshape(init_shape) + + return impl + +#---------------------------------------------------------------------------- +# Windowing functions +# - translated from the numpy implementations found in: +# https://github.com/numpy/numpy/blob/v1.16.1/numpy/lib/function_base.py#L2543-L3233 # noqa: E501 +# at commit: f1c4c758e1c24881560dd8ab1e64ae750 +# - and also, for NumPy >= 1.20, translated from implementations in +# https://github.com/numpy/numpy/blob/156cd054e007b05d4ac4829e10a369d19dd2b0b1/numpy/lib/function_base.py#L2655-L3065 # noqa: E501 + + +@register_jitable +def np_bartlett_impl(M): + n = np.arange(1. - M, M, 2) + return np.where(np.less_equal(n, 0), 1 + n / (M - 1), 1 - n / (M - 1)) + + +@register_jitable +def np_blackman_impl(M): + n = np.arange(1. - M, M, 2) + return (0.42 + 0.5 * np.cos(np.pi * n / (M - 1)) + + 0.08 * np.cos(2.0 * np.pi * n / (M - 1))) + + +@register_jitable +def np_hamming_impl(M): + n = np.arange(1 - M, M, 2) + return 0.54 + 0.46 * np.cos(np.pi * n / (M - 1)) + + +@register_jitable +def np_hanning_impl(M): + n = np.arange(1 - M, M, 2) + return 0.5 + 0.5 * np.cos(np.pi * n / (M - 1)) + + +def window_generator(func): + def window_overload(M): + if not isinstance(M, types.Integer): + raise TypingError('M must be an integer') + + def window_impl(M): + + if M < 1: + return np.array((), dtype=np.float64) + if M == 1: + return np.ones(1, dtype=np.float64) + return func(M) + + return window_impl + return window_overload + + +overload(np.bartlett)(window_generator(np_bartlett_impl)) +overload(np.blackman)(window_generator(np_blackman_impl)) +overload(np.hamming)(window_generator(np_hamming_impl)) +overload(np.hanning)(window_generator(np_hanning_impl)) + + +_i0A = np.array([ + -4.41534164647933937950E-18, + 3.33079451882223809783E-17, + -2.43127984654795469359E-16, + 1.71539128555513303061E-15, + -1.16853328779934516808E-14, + 7.67618549860493561688E-14, + -4.85644678311192946090E-13, + 2.95505266312963983461E-12, + -1.72682629144155570723E-11, + 9.67580903537323691224E-11, + -5.18979560163526290666E-10, + 2.65982372468238665035E-9, + -1.30002500998624804212E-8, + 6.04699502254191894932E-8, + -2.67079385394061173391E-7, + 1.11738753912010371815E-6, + -4.41673835845875056359E-6, + 1.64484480707288970893E-5, + -5.75419501008210370398E-5, + 1.88502885095841655729E-4, + -5.76375574538582365885E-4, + 1.63947561694133579842E-3, + -4.32430999505057594430E-3, + 1.05464603945949983183E-2, + -2.37374148058994688156E-2, + 4.93052842396707084878E-2, + -9.49010970480476444210E-2, + 1.71620901522208775349E-1, + -3.04682672343198398683E-1, + 6.76795274409476084995E-1, +]) + +_i0B = np.array([ + -7.23318048787475395456E-18, + -4.83050448594418207126E-18, + 4.46562142029675999901E-17, + 3.46122286769746109310E-17, + -2.82762398051658348494E-16, + -3.42548561967721913462E-16, + 1.77256013305652638360E-15, + 3.81168066935262242075E-15, + -9.55484669882830764870E-15, + -4.15056934728722208663E-14, + 1.54008621752140982691E-14, + 3.85277838274214270114E-13, + 7.18012445138366623367E-13, + -1.79417853150680611778E-12, + -1.32158118404477131188E-11, + -3.14991652796324136454E-11, + 1.18891471078464383424E-11, + 4.94060238822496958910E-10, + 3.39623202570838634515E-9, + 2.26666899049817806459E-8, + 2.04891858946906374183E-7, + 2.89137052083475648297E-6, + 6.88975834691682398426E-5, + 3.36911647825569408990E-3, + 8.04490411014108831608E-1, +]) + + +@register_jitable +def _chbevl(x, vals): + b0 = vals[0] + b1 = 0.0 + + for i in range(1, len(vals)): + b2 = b1 + b1 = b0 + b0 = x * b1 - b2 + vals[i] + + return 0.5 * (b0 - b2) + + +@register_jitable +def _i0(x): + if x < 0: + x = -x + if x <= 8.0: + y = (0.5 * x) - 2.0 + return np.exp(x) * _chbevl(y, _i0A) + + return np.exp(x) * _chbevl(32.0 / x - 2.0, _i0B) / np.sqrt(x) + + +@register_jitable +def _i0n(n, alpha, beta): + y = np.empty_like(n, dtype=np.float64) + t = _i0(np.float64(beta)) + for i in range(len(y)): + y[i] = _i0(beta * np.sqrt(1 - ((n[i] - alpha) / alpha)**2.0)) / t + + return y + + +@overload(np.kaiser) +def np_kaiser(M, beta): + if not isinstance(M, types.Integer): + raise TypingError('M must be an integer') + + if not isinstance(beta, (types.Integer, types.Float)): + raise TypingError('beta must be an integer or float') + + def np_kaiser_impl(M, beta): + if M < 1: + return np.array((), dtype=np.float64) + if M == 1: + return np.ones(1, dtype=np.float64) + + n = np.arange(0, M) + alpha = (M - 1) / 2.0 + + return _i0n(n, alpha, beta) + + return np_kaiser_impl + + +@register_jitable +def _cross_operation(a, b, out): + + def _cross_preprocessing(x): + x0 = x[..., 0] + x1 = x[..., 1] + if x.shape[-1] == 3: + x2 = x[..., 2] + else: + x2 = np.multiply(x.dtype.type(0), x0) + return x0, x1, x2 + + a0, a1, a2 = _cross_preprocessing(a) + b0, b1, b2 = _cross_preprocessing(b) + + cp0 = np.multiply(a1, b2) - np.multiply(a2, b1) + cp1 = np.multiply(a2, b0) - np.multiply(a0, b2) + cp2 = np.multiply(a0, b1) - np.multiply(a1, b0) + + out[..., 0] = cp0 + out[..., 1] = cp1 + out[..., 2] = cp2 + + +def _cross(a, b): + pass + + +@overload(_cross) +def _cross_impl(a, b): + dtype = np.promote_types(as_dtype(a.dtype), as_dtype(b.dtype)) + if a.ndim == 1 and b.ndim == 1: + def impl(a, b): + cp = np.empty((3,), dtype) + _cross_operation(a, b, cp) + return cp + else: + def impl(a, b): + shape = np.add(a[..., 0], b[..., 0]).shape + cp = np.empty(shape + (3,), dtype) + _cross_operation(a, b, cp) + return cp + return impl + + +@overload(np.cross) +def np_cross(a, b): + if not type_can_asarray(a) or not type_can_asarray(b): + raise TypingError("Inputs must be array-like.") + + def impl(a, b): + a_ = np.asarray(a) + b_ = np.asarray(b) + if a_.shape[-1] not in (2, 3) or b_.shape[-1] not in (2, 3): + raise ValueError(( + "Incompatible dimensions for cross product\n" + "(dimension must be 2 or 3)" + )) + + if a_.shape[-1] == 3 or b_.shape[-1] == 3: + return _cross(a_, b_) + else: + raise ValueError(( + "Dimensions for both inputs is 2.\n" + "Please replace your numpy.cross(a, b) call with " + "a call to `cross2d(a, b)` from `numba.np.extensions`." + )) + return impl + + +@register_jitable +def _cross2d_operation(a, b): + + def _cross_preprocessing(x): + x0 = x[..., 0] + x1 = x[..., 1] + return x0, x1 + + a0, a1 = _cross_preprocessing(a) + b0, b1 = _cross_preprocessing(b) + + cp = np.multiply(a0, b1) - np.multiply(a1, b0) + # If ndim of a and b is 1, cp is a scalar. + # In this case np.cross returns a 0-D array, containing the scalar. + # np.asarray is used to reconcile this case, without introducing + # overhead in the case where cp is an actual N-D array. + # (recall that np.asarray does not copy existing arrays) + return np.asarray(cp) + + +def cross2d(a, b): + pass + + +@overload(cross2d) +def cross2d_impl(a, b): + if not type_can_asarray(a) or not type_can_asarray(b): + raise TypingError("Inputs must be array-like.") + + def impl(a, b): + a_ = np.asarray(a) + b_ = np.asarray(b) + if a_.shape[-1] != 2 or b_.shape[-1] != 2: + raise ValueError(( + "Incompatible dimensions for 2D cross product\n" + "(dimension must be 2 for both inputs)" + )) + return _cross2d_operation(a_, b_) + + return impl + + +@overload(np.trim_zeros) +def np_trim_zeros(filt, trim='fb'): + if not isinstance(filt, types.Array): + raise NumbaTypeError('The first argument must be an array') + + if filt.ndim > 1: + raise NumbaTypeError('array must be 1D') + + if not isinstance(trim, (str, types.UnicodeType)): + raise NumbaTypeError('The second argument must be a string') + + trim_escapes = numpy_version >= (2, 2) + + def impl(filt, trim='fb'): + a_ = np.asarray(filt) + first = 0 + trim = trim.lower() + if 'f' in trim: + for i in a_: + if i == 0 or (trim_escapes and i == ''): + first = first + 1 + else: + break + last = len(filt) + if 'b' in trim: + for i in a_[::-1]: + if i == 0 or (trim_escapes and i == ''): + last = last - 1 + else: + break + return a_[first:last] + + return impl + + +@overload(np.setxor1d) +def jit_np_setxor1d(ar1, ar2, assume_unique=False): + if not (type_can_asarray(ar1) or type_can_asarray(ar2)): + raise TypingError('setxor1d: first two args must be array-like') + if not (isinstance(assume_unique, (types.Boolean, bool))): + raise TypingError('setxor1d: Argument "assume_unique" must be boolean') + + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L477 # noqa: E501 + def np_setxor1d_impl(ar1, ar2, assume_unique=False): + a = np.asarray(ar1) + b = np.asarray(ar2) + + if not assume_unique: + a = np.unique(a) + b = np.unique(b) + else: + a = a.ravel() + b = b.ravel() + + # Implementation very similar to np_intersect1d_impl: + # We want union minus the intersect + aux = np.concatenate((a, b)) + aux.sort() + + flag = np.empty(aux.shape[0] + 1, dtype=np.bool_) + flag[0] = True + flag[-1] = True + flag[1:-1] = aux[1:] != aux[:-1] + return aux[flag[1:] & flag[:-1]] + + return np_setxor1d_impl + + +@overload(np.setdiff1d) +def jit_np_setdiff1d(ar1, ar2, assume_unique=False): + if not (type_can_asarray(ar1) or type_can_asarray(ar2)): + raise TypingError('setdiff1d: first two args must be array-like') + if not (isinstance(assume_unique, (types.Boolean, bool))): + raise TypingError('setdiff1d: Argument "assume_unique" must be boolean') + + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L940 # noqa: E501 + def np_setdiff1d_impl(ar1, ar2, assume_unique=False): + ar1 = np.asarray(ar1) + ar2 = np.asarray(ar2) + if assume_unique: + ar1 = ar1.ravel() + ar2 = ar2.ravel() + else: + ar1 = np.unique(ar1) + ar2 = np.unique(ar2) + return ar1[np.in1d(ar1, ar2, assume_unique=True, invert=True)] + + return np_setdiff1d_impl + + +@overload(np.in1d) +def jit_np_in1d(ar1, ar2, assume_unique=False, invert=False): + if not (type_can_asarray(ar1) or type_can_asarray(ar2)): + raise TypingError('in1d: first two args must be array-like') + if not isinstance(assume_unique, (types.Boolean, bool)): + raise TypingError('in1d: Argument "assume_unique" must be boolean') + if not isinstance(invert, (types.Boolean, bool)): + raise TypingError('in1d: Argument "invert" must be boolean') + + def np_in1d_impl(ar1, ar2, assume_unique=False, invert=False): + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L525 # noqa: E501 + + # Ravel both arrays, behavior for the first array could be different + ar1 = np.asarray(ar1).ravel() + ar2 = np.asarray(ar2).ravel() + + # This code is run when it would make the code significantly faster + # Sorting is also not guaranteed to work on objects but numba does + # not support object arrays. + if len(ar2) < 10 * len(ar1) ** 0.145: + if invert: + mask = np.ones(len(ar1), dtype=np.bool_) + for a in ar2: + mask &= (ar1 != a) + else: + mask = np.zeros(len(ar1), dtype=np.bool_) + for a in ar2: + mask |= (ar1 == a) + return mask + + # Otherwise use sorting + if not assume_unique: + # Equivalent to ar1, inv_idx = np.unique(ar1, return_inverse=True) + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L358C8-L358C8 # noqa: E501 + order1 = np.argsort(ar1) + aux = ar1[order1] + mask = np.empty(aux.shape, dtype=np.bool_) + mask[:1] = True + mask[1:] = aux[1:] != aux[:-1] + ar1 = aux[mask] + imask = np.cumsum(mask) - 1 + inv_idx = np.empty(mask.shape, dtype=np.intp) + inv_idx[order1] = imask + ar2 = np.unique(ar2) + + ar = np.concatenate((ar1, ar2)) + # We need this to be a stable sort, so always use 'mergesort' + # here. The values from the first array should always come before + # the values from the second array. + order = ar.argsort(kind='mergesort') + sar = ar[order] + flag = np.empty(sar.size, np.bool_) + if invert: + flag[:-1] = (sar[1:] != sar[:-1]) + else: + flag[:-1] = (sar[1:] == sar[:-1]) + flag[-1:] = invert + ret = np.empty(ar.shape, dtype=np.bool_) + ret[order] = flag + + # return ret[:len(ar1)] + if assume_unique: + return ret[:len(ar1)] + else: + return ret[inv_idx] + + return np_in1d_impl + + +@overload(np.isin) +def jit_np_isin(element, test_elements, assume_unique=False, invert=False): + if not (type_can_asarray(element) or type_can_asarray(test_elements)): + raise TypingError('isin: first two args must be array-like') + if not (isinstance(assume_unique, (types.Boolean, bool))): + raise TypingError('isin: Argument "assume_unique" must be boolean') + if not (isinstance(invert, (types.Boolean, bool))): + raise TypingError('isin: Argument "invert" must be boolean') + + # https://github.com/numpy/numpy/blob/03b62604eead0f7d279a5a4c094743eb29647368/numpy/lib/arraysetops.py#L889 # noqa: E501 + def np_isin_impl(element, test_elements, assume_unique=False, invert=False): + + element = np.asarray(element) + return np.in1d(element, test_elements, assume_unique=assume_unique, + invert=invert).reshape(element.shape) + + return np_isin_impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/np/ufunc_db.py b/tool_server/.venv/lib/python3.12/site-packages/numba/np/ufunc_db.py new file mode 100644 index 0000000000000000000000000000000000000000..a72642432ff7c041d9a8f5b6028b142548d03a2b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/np/ufunc_db.py @@ -0,0 +1,1211 @@ +"""This file contains information on how to translate different ufuncs +into numba. It is a database of different ufuncs and how each of its +loops maps to a function that implements the inner kernel of that ufunc +(the inner kernel being the per-element function). + +Use the function get_ufunc_info to get the information related to the +ufunc +""" + + +import numpy as np +import sys + +# this is lazily initialized to avoid circular imports +IS_WIN32 = sys.platform.startswith('win32') +numpy_version = tuple(map(int, np.__version__.split('.')[:2])) +_ufunc_db = None + + +def _lazy_init_db(): + global _ufunc_db + + if _ufunc_db is None: + _ufunc_db = {} + _fill_ufunc_db(_ufunc_db) + + +def get_ufuncs(): + """obtain a list of supported ufuncs in the db""" + _lazy_init_db() + return _ufunc_db.keys() + + +def get_ufunc_info(ufunc_key): + """get the lowering information for the ufunc with key ufunc_key. + + The lowering information is a dictionary that maps from a numpy + loop string (as given by the ufunc types attribute) to a function + that handles code generation for a scalar version of the ufunc + (that is, generates the "per element" operation"). + + raises a KeyError if the ufunc is not in the ufunc_db + """ + _lazy_init_db() + return _ufunc_db[ufunc_key] + + +def _fill_ufunc_db(ufunc_db): + # some of these imports would cause a problem of circular + # imports if done at global scope when importing the numba + # module. + from numba.np import npyfuncs + from numba.np.math import cmathimpl, mathimpl, numbers + from numba.np.numpy_support import numpy_version + + ufunc_db[np.isnat] = { + # datetime & timedelta + 'M->?': npyfuncs.np_datetime_isnat_impl, + 'm->?': npyfuncs.np_datetime_isnat_impl, + } + + ufunc_db[np.negative] = { + '?->?': numbers.int_invert_impl, + 'b->b': numbers.int_negate_impl, + 'B->B': numbers.int_negate_impl, + 'h->h': numbers.int_negate_impl, + 'H->H': numbers.int_negate_impl, + 'i->i': numbers.int_negate_impl, + 'I->I': numbers.int_negate_impl, + 'l->l': numbers.int_negate_impl, + 'L->L': numbers.int_negate_impl, + 'q->q': numbers.int_negate_impl, + 'Q->Q': numbers.int_negate_impl, + 'f->f': numbers.real_negate_impl, + 'd->d': numbers.real_negate_impl, + 'F->F': numbers.complex_negate_impl, + 'D->D': numbers.complex_negate_impl, + } + + ufunc_db[np.positive] = { + '?->?': numbers.int_positive_impl, + 'b->b': numbers.int_positive_impl, + 'B->B': numbers.int_positive_impl, + 'h->h': numbers.int_positive_impl, + 'H->H': numbers.int_positive_impl, + 'i->i': numbers.int_positive_impl, + 'I->I': numbers.int_positive_impl, + 'l->l': numbers.int_positive_impl, + 'L->L': numbers.int_positive_impl, + 'q->q': numbers.int_positive_impl, + 'Q->Q': numbers.int_positive_impl, + 'f->f': numbers.real_positive_impl, + 'd->d': numbers.real_positive_impl, + 'F->F': numbers.complex_positive_impl, + 'D->D': numbers.complex_positive_impl, + } + + ufunc_db[np.absolute] = { + '?->?': numbers.int_abs_impl, + 'b->b': numbers.int_abs_impl, + 'B->B': numbers.uint_abs_impl, + 'h->h': numbers.int_abs_impl, + 'H->H': numbers.uint_abs_impl, + 'i->i': numbers.int_abs_impl, + 'I->I': numbers.uint_abs_impl, + 'l->l': numbers.int_abs_impl, + 'L->L': numbers.uint_abs_impl, + 'q->q': numbers.int_abs_impl, + 'Q->Q': numbers.uint_abs_impl, + 'f->f': numbers.real_abs_impl, + 'd->d': numbers.real_abs_impl, + 'F->f': numbers.complex_abs_impl, + 'D->d': numbers.complex_abs_impl, + } + + ufunc_db[np.sign] = { + 'b->b': numbers.int_sign_impl, + 'B->B': numbers.int_sign_impl, + 'h->h': numbers.int_sign_impl, + 'H->H': numbers.int_sign_impl, + 'i->i': numbers.int_sign_impl, + 'I->I': numbers.int_sign_impl, + 'l->l': numbers.int_sign_impl, + 'L->L': numbers.int_sign_impl, + 'q->q': numbers.int_sign_impl, + 'Q->Q': numbers.int_sign_impl, + 'f->f': numbers.real_sign_impl, + 'd->d': numbers.real_sign_impl, + 'F->F': npyfuncs.np_complex_sign_impl, + 'D->D': npyfuncs.np_complex_sign_impl, + } + + ufunc_db[np.add] = { + '??->?': numbers.int_or_impl, + 'bb->b': numbers.int_add_impl, + 'BB->B': numbers.int_add_impl, + 'hh->h': numbers.int_add_impl, + 'HH->H': numbers.int_add_impl, + 'ii->i': numbers.int_add_impl, + 'II->I': numbers.int_add_impl, + 'll->l': numbers.int_add_impl, + 'LL->L': numbers.int_add_impl, + 'qq->q': numbers.int_add_impl, + 'QQ->Q': numbers.int_add_impl, + 'ff->f': numbers.real_add_impl, + 'dd->d': numbers.real_add_impl, + 'FF->F': numbers.complex_add_impl, + 'DD->D': numbers.complex_add_impl, + } + + ufunc_db[np.subtract] = { + '??->?': numbers.int_xor_impl, + 'bb->b': numbers.int_sub_impl, + 'BB->B': numbers.int_sub_impl, + 'hh->h': numbers.int_sub_impl, + 'HH->H': numbers.int_sub_impl, + 'ii->i': numbers.int_sub_impl, + 'II->I': numbers.int_sub_impl, + 'll->l': numbers.int_sub_impl, + 'LL->L': numbers.int_sub_impl, + 'qq->q': numbers.int_sub_impl, + 'QQ->Q': numbers.int_sub_impl, + 'ff->f': numbers.real_sub_impl, + 'dd->d': numbers.real_sub_impl, + 'FF->F': numbers.complex_sub_impl, + 'DD->D': numbers.complex_sub_impl, + } + + ufunc_db[np.multiply] = { + '??->?': numbers.int_and_impl, + 'bb->b': numbers.int_mul_impl, + 'BB->B': numbers.int_mul_impl, + 'hh->h': numbers.int_mul_impl, + 'HH->H': numbers.int_mul_impl, + 'ii->i': numbers.int_mul_impl, + 'II->I': numbers.int_mul_impl, + 'll->l': numbers.int_mul_impl, + 'LL->L': numbers.int_mul_impl, + 'qq->q': numbers.int_mul_impl, + 'QQ->Q': numbers.int_mul_impl, + 'ff->f': numbers.real_mul_impl, + 'dd->d': numbers.real_mul_impl, + 'FF->F': numbers.complex_mul_impl, + 'DD->D': numbers.complex_mul_impl, + } + + if np.divide != np.true_divide: + ufunc_db[np.divide] = { + 'bb->b': npyfuncs.np_int_sdiv_impl, + 'BB->B': npyfuncs.np_int_udiv_impl, + 'hh->h': npyfuncs.np_int_sdiv_impl, + 'HH->H': npyfuncs.np_int_udiv_impl, + 'ii->i': npyfuncs.np_int_sdiv_impl, + 'II->I': npyfuncs.np_int_udiv_impl, + 'll->l': npyfuncs.np_int_sdiv_impl, + 'LL->L': npyfuncs.np_int_udiv_impl, + 'qq->q': npyfuncs.np_int_sdiv_impl, + 'QQ->Q': npyfuncs.np_int_udiv_impl, + 'ff->f': npyfuncs.np_real_div_impl, + 'dd->d': npyfuncs.np_real_div_impl, + 'FF->F': npyfuncs.np_complex_div_impl, + 'DD->D': npyfuncs.np_complex_div_impl, + } + + ufunc_db[np.true_divide] = { + 'bb->d': npyfuncs.np_int_truediv_impl, + 'BB->d': npyfuncs.np_int_truediv_impl, + 'hh->d': npyfuncs.np_int_truediv_impl, + 'HH->d': npyfuncs.np_int_truediv_impl, + 'ii->d': npyfuncs.np_int_truediv_impl, + 'II->d': npyfuncs.np_int_truediv_impl, + 'll->d': npyfuncs.np_int_truediv_impl, + 'LL->d': npyfuncs.np_int_truediv_impl, + 'qq->d': npyfuncs.np_int_truediv_impl, + 'QQ->d': npyfuncs.np_int_truediv_impl, + 'ff->f': npyfuncs.np_real_div_impl, + 'dd->d': npyfuncs.np_real_div_impl, + 'FF->F': npyfuncs.np_complex_div_impl, + 'DD->D': npyfuncs.np_complex_div_impl, + } + + ufunc_db[np.floor_divide] = { + 'bb->b': npyfuncs.np_int_sdiv_impl, + 'BB->B': npyfuncs.np_int_udiv_impl, + 'hh->h': npyfuncs.np_int_sdiv_impl, + 'HH->H': npyfuncs.np_int_udiv_impl, + 'ii->i': npyfuncs.np_int_sdiv_impl, + 'II->I': npyfuncs.np_int_udiv_impl, + 'll->l': npyfuncs.np_int_sdiv_impl, + 'LL->L': npyfuncs.np_int_udiv_impl, + 'qq->q': npyfuncs.np_int_sdiv_impl, + 'QQ->Q': npyfuncs.np_int_udiv_impl, + 'ff->f': npyfuncs.np_real_floor_div_impl, + 'dd->d': npyfuncs.np_real_floor_div_impl, + } + + ufunc_db[np.remainder] = { + 'bb->b': npyfuncs.np_int_srem_impl, + 'BB->B': npyfuncs.np_int_urem_impl, + 'hh->h': npyfuncs.np_int_srem_impl, + 'HH->H': npyfuncs.np_int_urem_impl, + 'ii->i': npyfuncs.np_int_srem_impl, + 'II->I': npyfuncs.np_int_urem_impl, + 'll->l': npyfuncs.np_int_srem_impl, + 'LL->L': npyfuncs.np_int_urem_impl, + 'qq->q': npyfuncs.np_int_srem_impl, + 'QQ->Q': npyfuncs.np_int_urem_impl, + 'ff->f': npyfuncs.np_real_mod_impl, + 'dd->d': npyfuncs.np_real_mod_impl, + } + + ufunc_db[np.divmod] = { + 'bb->bb': npyfuncs.np_int_sdivrem_impl, + 'BB->BB': npyfuncs.np_int_udivrem_impl, + 'hh->hh': npyfuncs.np_int_sdivrem_impl, + 'HH->HH': npyfuncs.np_int_udivrem_impl, + 'ii->ii': npyfuncs.np_int_sdivrem_impl, + 'II->II': npyfuncs.np_int_udivrem_impl, + 'll->ll': npyfuncs.np_int_sdivrem_impl, + 'LL->LL': npyfuncs.np_int_udivrem_impl, + 'qq->qq': npyfuncs.np_int_sdivrem_impl, + 'QQ->QQ': npyfuncs.np_int_udivrem_impl, + 'ff->ff': npyfuncs.np_real_divmod_impl, + 'dd->dd': npyfuncs.np_real_divmod_impl, + } + + ufunc_db[np.fmod] = { + 'bb->b': npyfuncs.np_int_fmod_impl, + 'BB->B': npyfuncs.np_int_fmod_impl, + 'hh->h': npyfuncs.np_int_fmod_impl, + 'HH->H': npyfuncs.np_int_fmod_impl, + 'ii->i': npyfuncs.np_int_fmod_impl, + 'II->I': npyfuncs.np_int_fmod_impl, + 'll->l': npyfuncs.np_int_fmod_impl, + 'LL->L': npyfuncs.np_int_fmod_impl, + 'qq->q': npyfuncs.np_int_fmod_impl, + 'QQ->Q': npyfuncs.np_int_fmod_impl, + 'ff->f': npyfuncs.np_real_fmod_impl, + 'dd->d': npyfuncs.np_real_fmod_impl, + } + + ufunc_db[np.logaddexp] = { + 'ff->f': npyfuncs.np_real_logaddexp_impl, + 'dd->d': npyfuncs.np_real_logaddexp_impl, + } + + ufunc_db[np.logaddexp2] = { + 'ff->f': npyfuncs.np_real_logaddexp2_impl, + 'dd->d': npyfuncs.np_real_logaddexp2_impl, + } + + ufunc_db[np.power] = { + 'bb->b': numbers.int_power_impl, + 'BB->B': numbers.int_power_impl, + 'hh->h': numbers.int_power_impl, + 'HH->H': numbers.int_power_impl, + 'ii->i': numbers.int_power_impl, + 'II->I': numbers.int_power_impl, + 'll->l': numbers.int_power_impl, + 'LL->L': numbers.int_power_impl, + 'qq->q': numbers.int_power_impl, + 'QQ->Q': numbers.int_power_impl, + # XXX we would like to use `int_power_impl` for real ** integer + # as well (for better performance), but the current ufunc typing + # rules forbid that + 'ff->f': numbers.real_power_impl, + 'dd->d': numbers.real_power_impl, + 'FF->F': npyfuncs.np_complex_power_impl, + 'DD->D': npyfuncs.np_complex_power_impl, + } + + ufunc_db[np.float_power] = { + 'ff->f': npyfuncs.real_float_power_impl, + 'dd->d': npyfuncs.real_float_power_impl, + 'FF->F': npyfuncs.np_complex_float_power_impl, + 'DD->D': npyfuncs.np_complex_float_power_impl, + } + + ufunc_db[np.gcd] = { + 'bb->b': npyfuncs.np_gcd_impl, + 'BB->B': npyfuncs.np_gcd_impl, + 'hh->h': npyfuncs.np_gcd_impl, + 'HH->H': npyfuncs.np_gcd_impl, + 'ii->i': npyfuncs.np_gcd_impl, + 'II->I': npyfuncs.np_gcd_impl, + 'll->l': npyfuncs.np_gcd_impl, + 'LL->L': npyfuncs.np_gcd_impl, + 'qq->q': npyfuncs.np_gcd_impl, + 'QQ->Q': npyfuncs.np_gcd_impl, + } + + ufunc_db[np.lcm] = { + 'bb->b': npyfuncs.np_lcm_impl, + 'BB->B': npyfuncs.np_lcm_impl, + 'hh->h': npyfuncs.np_lcm_impl, + 'HH->H': npyfuncs.np_lcm_impl, + 'ii->i': npyfuncs.np_lcm_impl, + 'II->I': npyfuncs.np_lcm_impl, + 'll->l': npyfuncs.np_lcm_impl, + 'LL->L': npyfuncs.np_lcm_impl, + 'qq->q': npyfuncs.np_lcm_impl, + 'QQ->Q': npyfuncs.np_lcm_impl, + } + + ufunc_db[np.rint] = { + 'f->f': npyfuncs.np_real_rint_impl, + 'd->d': npyfuncs.np_real_rint_impl, + 'F->F': npyfuncs.np_complex_rint_impl, + 'D->D': npyfuncs.np_complex_rint_impl, + } + + ufunc_db[np.conjugate] = { + 'b->b': numbers.real_conjugate_impl, + 'B->B': numbers.real_conjugate_impl, + 'h->h': numbers.real_conjugate_impl, + 'H->H': numbers.real_conjugate_impl, + 'i->i': numbers.real_conjugate_impl, + 'I->I': numbers.real_conjugate_impl, + 'l->l': numbers.real_conjugate_impl, + 'L->L': numbers.real_conjugate_impl, + 'q->q': numbers.real_conjugate_impl, + 'Q->Q': numbers.real_conjugate_impl, + 'f->f': numbers.real_conjugate_impl, + 'd->d': numbers.real_conjugate_impl, + 'F->F': numbers.complex_conjugate_impl, + 'D->D': numbers.complex_conjugate_impl, + } + + ufunc_db[np.exp] = { + 'f->f': npyfuncs.np_real_exp_impl, + 'd->d': npyfuncs.np_real_exp_impl, + 'F->F': npyfuncs.np_complex_exp_impl, + 'D->D': npyfuncs.np_complex_exp_impl, + } + + ufunc_db[np.exp2] = { + 'f->f': npyfuncs.np_real_exp2_impl, + 'd->d': npyfuncs.np_real_exp2_impl, + 'F->F': npyfuncs.np_complex_exp2_impl, + 'D->D': npyfuncs.np_complex_exp2_impl, + } + + ufunc_db[np.log] = { + 'f->f': npyfuncs.np_real_log_impl, + 'd->d': npyfuncs.np_real_log_impl, + 'F->F': npyfuncs.np_complex_log_impl, + 'D->D': npyfuncs.np_complex_log_impl, + } + + ufunc_db[np.log2] = { + 'f->f': npyfuncs.np_real_log2_impl, + 'd->d': npyfuncs.np_real_log2_impl, + 'F->F': npyfuncs.np_complex_log2_impl, + 'D->D': npyfuncs.np_complex_log2_impl, + } + + ufunc_db[np.log10] = { + 'f->f': npyfuncs.np_real_log10_impl, + 'd->d': npyfuncs.np_real_log10_impl, + 'F->F': npyfuncs.np_complex_log10_impl, + 'D->D': npyfuncs.np_complex_log10_impl, + } + + ufunc_db[np.expm1] = { + 'f->f': npyfuncs.np_real_expm1_impl, + 'd->d': npyfuncs.np_real_expm1_impl, + 'F->F': npyfuncs.np_complex_expm1_impl, + 'D->D': npyfuncs.np_complex_expm1_impl, + } + + ufunc_db[np.log1p] = { + 'f->f': npyfuncs.np_real_log1p_impl, + 'd->d': npyfuncs.np_real_log1p_impl, + 'F->F': npyfuncs.np_complex_log1p_impl, + 'D->D': npyfuncs.np_complex_log1p_impl, + } + + ufunc_db[np.sqrt] = { + 'f->f': npyfuncs.np_real_sqrt_impl, + 'd->d': npyfuncs.np_real_sqrt_impl, + 'F->F': npyfuncs.np_complex_sqrt_impl, + 'D->D': npyfuncs.np_complex_sqrt_impl, + } + + ufunc_db[np.square] = { + 'b->b': npyfuncs.np_int_square_impl, + 'B->B': npyfuncs.np_int_square_impl, + 'h->h': npyfuncs.np_int_square_impl, + 'H->H': npyfuncs.np_int_square_impl, + 'i->i': npyfuncs.np_int_square_impl, + 'I->I': npyfuncs.np_int_square_impl, + 'l->l': npyfuncs.np_int_square_impl, + 'L->L': npyfuncs.np_int_square_impl, + 'q->q': npyfuncs.np_int_square_impl, + 'Q->Q': npyfuncs.np_int_square_impl, + 'f->f': npyfuncs.np_real_square_impl, + 'd->d': npyfuncs.np_real_square_impl, + 'F->F': npyfuncs.np_complex_square_impl, + 'D->D': npyfuncs.np_complex_square_impl, + } + + ufunc_db[np.cbrt] = { + 'f->f': npyfuncs.np_real_cbrt_impl, + 'd->d': npyfuncs.np_real_cbrt_impl, + } + + ufunc_db[np.reciprocal] = { + 'b->b': npyfuncs.np_int_reciprocal_impl, + 'B->B': npyfuncs.np_int_reciprocal_impl, + 'h->h': npyfuncs.np_int_reciprocal_impl, + 'H->H': npyfuncs.np_int_reciprocal_impl, + 'i->i': npyfuncs.np_int_reciprocal_impl, + 'I->I': npyfuncs.np_int_reciprocal_impl, + 'l->l': npyfuncs.np_int_reciprocal_impl, + 'L->L': npyfuncs.np_int_reciprocal_impl, + 'q->q': npyfuncs.np_int_reciprocal_impl, + 'Q->Q': npyfuncs.np_int_reciprocal_impl, + 'f->f': npyfuncs.np_real_reciprocal_impl, + 'd->d': npyfuncs.np_real_reciprocal_impl, + 'F->F': npyfuncs.np_complex_reciprocal_impl, + 'D->D': npyfuncs.np_complex_reciprocal_impl, + } + + ufunc_db[np.sin] = { + 'f->f': npyfuncs.np_real_sin_impl, + 'd->d': npyfuncs.np_real_sin_impl, + 'F->F': npyfuncs.np_complex_sin_impl, + 'D->D': npyfuncs.np_complex_sin_impl, + } + + ufunc_db[np.cos] = { + 'f->f': npyfuncs.np_real_cos_impl, + 'd->d': npyfuncs.np_real_cos_impl, + 'F->F': npyfuncs.np_complex_cos_impl, + 'D->D': npyfuncs.np_complex_cos_impl, + } + + tan_impl = cmathimpl.tan_impl + + ufunc_db[np.tan] = { + 'f->f': npyfuncs.np_real_tan_impl, + 'd->d': npyfuncs.np_real_tan_impl, + 'F->F': tan_impl, + 'D->D': tan_impl, + } + + arcsin_impl = cmathimpl.asin_impl + + ufunc_db[np.arcsin] = { + 'f->f': npyfuncs.np_real_asin_impl, + 'd->d': npyfuncs.np_real_asin_impl, + 'F->F': arcsin_impl, + 'D->D': arcsin_impl, + } + + ufunc_db[np.arccos] = { + 'f->f': npyfuncs.np_real_acos_impl, + 'd->d': npyfuncs.np_real_acos_impl, + 'F->F': cmathimpl.acos_impl, + 'D->D': cmathimpl.acos_impl, + } + + arctan_impl = cmathimpl.atan_impl + + ufunc_db[np.arctan] = { + 'f->f': npyfuncs.np_real_atan_impl, + 'd->d': npyfuncs.np_real_atan_impl, + 'F->F': arctan_impl, + 'D->D': arctan_impl, + } + + ufunc_db[np.arctan2] = { + 'ff->f': npyfuncs.np_real_atan2_impl, + 'dd->d': npyfuncs.np_real_atan2_impl, + } + + ufunc_db[np.hypot] = { + 'ff->f': npyfuncs.np_real_hypot_impl, + 'dd->d': npyfuncs.np_real_hypot_impl, + } + + ufunc_db[np.sinh] = { + 'f->f': npyfuncs.np_real_sinh_impl, + 'd->d': npyfuncs.np_real_sinh_impl, + 'F->F': npyfuncs.np_complex_sinh_impl, + 'D->D': npyfuncs.np_complex_sinh_impl, + } + + ufunc_db[np.cosh] = { + 'f->f': npyfuncs.np_real_cosh_impl, + 'd->d': npyfuncs.np_real_cosh_impl, + 'F->F': npyfuncs.np_complex_cosh_impl, + 'D->D': npyfuncs.np_complex_cosh_impl, + } + + ufunc_db[np.tanh] = { + 'f->f': npyfuncs.np_real_tanh_impl, + 'd->d': npyfuncs.np_real_tanh_impl, + 'F->F': npyfuncs.np_complex_tanh_impl, + 'D->D': npyfuncs.np_complex_tanh_impl, + } + + arcsinh_impl = cmathimpl.asinh_impl + + ufunc_db[np.arcsinh] = { + 'f->f': npyfuncs.np_real_asinh_impl, + 'd->d': npyfuncs.np_real_asinh_impl, + 'F->F': arcsinh_impl, + 'D->D': arcsinh_impl, + } + + ufunc_db[np.arccosh] = { + 'f->f': npyfuncs.np_real_acosh_impl, + 'd->d': npyfuncs.np_real_acosh_impl, + 'F->F': npyfuncs.np_complex_acosh_impl, + 'D->D': npyfuncs.np_complex_acosh_impl, + } + + arctanh_impl = cmathimpl.atanh_impl + + ufunc_db[np.arctanh] = { + 'f->f': npyfuncs.np_real_atanh_impl, + 'd->d': npyfuncs.np_real_atanh_impl, + 'F->F': arctanh_impl, + 'D->D': arctanh_impl, + } + + ufunc_db[np.deg2rad] = { + 'f->f': mathimpl.radians_float_impl, + 'd->d': mathimpl.radians_float_impl, + } + + ufunc_db[np.radians] = ufunc_db[np.deg2rad] + + ufunc_db[np.rad2deg] = { + 'f->f': mathimpl.degrees_float_impl, + 'd->d': mathimpl.degrees_float_impl, + } + + ufunc_db[np.degrees] = ufunc_db[np.rad2deg] + + ufunc_db[np.floor] = { + 'f->f': npyfuncs.np_real_floor_impl, + 'd->d': npyfuncs.np_real_floor_impl, + } + if numpy_version >= (2, 1): + ufunc_db[np.floor].update({ + '?->?': numbers.identity_impl, + 'b->b': numbers.identity_impl, + 'B->B': numbers.identity_impl, + 'h->h': numbers.identity_impl, + 'H->H': numbers.identity_impl, + 'i->i': numbers.identity_impl, + 'I->I': numbers.identity_impl, + 'l->l': numbers.identity_impl, + 'L->L': numbers.identity_impl, + 'q->q': numbers.identity_impl, + 'Q->Q': numbers.identity_impl, + }) + + ufunc_db[np.ceil] = { + 'f->f': npyfuncs.np_real_ceil_impl, + 'd->d': npyfuncs.np_real_ceil_impl, + } + if numpy_version >= (2, 1): + ufunc_db[np.ceil].update({ + '?->?': numbers.identity_impl, + 'b->b': numbers.identity_impl, + 'B->B': numbers.identity_impl, + 'h->h': numbers.identity_impl, + 'H->H': numbers.identity_impl, + 'i->i': numbers.identity_impl, + 'I->I': numbers.identity_impl, + 'l->l': numbers.identity_impl, + 'L->L': numbers.identity_impl, + 'q->q': numbers.identity_impl, + 'Q->Q': numbers.identity_impl, + }) + + ufunc_db[np.trunc] = { + 'f->f': npyfuncs.np_real_trunc_impl, + 'd->d': npyfuncs.np_real_trunc_impl, + } + if numpy_version >= (2, 1): + ufunc_db[np.trunc].update({ + '?->?': numbers.identity_impl, + 'b->b': numbers.identity_impl, + 'B->B': numbers.identity_impl, + 'h->h': numbers.identity_impl, + 'H->H': numbers.identity_impl, + 'i->i': numbers.identity_impl, + 'I->I': numbers.identity_impl, + 'l->l': numbers.identity_impl, + 'L->L': numbers.identity_impl, + 'q->q': numbers.identity_impl, + 'Q->Q': numbers.identity_impl, + }) + + ufunc_db[np.fabs] = { + 'f->f': npyfuncs.np_real_fabs_impl, + 'd->d': npyfuncs.np_real_fabs_impl, + } + + # logical ufuncs + ufunc_db[np.greater] = { + '??->?': numbers.int_ugt_impl, + 'bb->?': numbers.int_sgt_impl, + 'BB->?': numbers.int_ugt_impl, + 'hh->?': numbers.int_sgt_impl, + 'HH->?': numbers.int_ugt_impl, + 'ii->?': numbers.int_sgt_impl, + 'II->?': numbers.int_ugt_impl, + 'll->?': numbers.int_sgt_impl, + 'LL->?': numbers.int_ugt_impl, + 'qq->?': numbers.int_sgt_impl, + 'QQ->?': numbers.int_ugt_impl, + 'ff->?': numbers.real_gt_impl, + 'dd->?': numbers.real_gt_impl, + 'FF->?': npyfuncs.np_complex_gt_impl, + 'DD->?': npyfuncs.np_complex_gt_impl, + } + if numpy_version >= (1, 25): + ufunc_db[np.greater].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('>'), + 'Qq->?': numbers.int_unsigned_signed_cmp('>')}) + + ufunc_db[np.greater_equal] = { + '??->?': numbers.int_uge_impl, + 'bb->?': numbers.int_sge_impl, + 'BB->?': numbers.int_uge_impl, + 'hh->?': numbers.int_sge_impl, + 'HH->?': numbers.int_uge_impl, + 'ii->?': numbers.int_sge_impl, + 'II->?': numbers.int_uge_impl, + 'll->?': numbers.int_sge_impl, + 'LL->?': numbers.int_uge_impl, + 'qq->?': numbers.int_sge_impl, + 'QQ->?': numbers.int_uge_impl, + 'ff->?': numbers.real_ge_impl, + 'dd->?': numbers.real_ge_impl, + 'FF->?': npyfuncs.np_complex_ge_impl, + 'DD->?': npyfuncs.np_complex_ge_impl, + } + if numpy_version >= (1, 25): + ufunc_db[np.greater_equal].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('>='), + 'Qq->?': numbers.int_unsigned_signed_cmp('>=')}) + + ufunc_db[np.less] = { + '??->?': numbers.int_ult_impl, + 'bb->?': numbers.int_slt_impl, + 'BB->?': numbers.int_ult_impl, + 'hh->?': numbers.int_slt_impl, + 'HH->?': numbers.int_ult_impl, + 'ii->?': numbers.int_slt_impl, + 'II->?': numbers.int_ult_impl, + 'll->?': numbers.int_slt_impl, + 'LL->?': numbers.int_ult_impl, + 'qq->?': numbers.int_slt_impl, + 'QQ->?': numbers.int_ult_impl, + 'ff->?': numbers.real_lt_impl, + 'dd->?': numbers.real_lt_impl, + 'FF->?': npyfuncs.np_complex_lt_impl, + 'DD->?': npyfuncs.np_complex_lt_impl, + } + if numpy_version >= (1, 25): + ufunc_db[np.less].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('<'), + 'Qq->?': numbers.int_unsigned_signed_cmp('<')}) + + ufunc_db[np.less_equal] = { + '??->?': numbers.int_ule_impl, + 'bb->?': numbers.int_sle_impl, + 'BB->?': numbers.int_ule_impl, + 'hh->?': numbers.int_sle_impl, + 'HH->?': numbers.int_ule_impl, + 'ii->?': numbers.int_sle_impl, + 'II->?': numbers.int_ule_impl, + 'll->?': numbers.int_sle_impl, + 'LL->?': numbers.int_ule_impl, + 'qq->?': numbers.int_sle_impl, + 'QQ->?': numbers.int_ule_impl, + 'ff->?': numbers.real_le_impl, + 'dd->?': numbers.real_le_impl, + 'FF->?': npyfuncs.np_complex_le_impl, + 'DD->?': npyfuncs.np_complex_le_impl, + } + if numpy_version >= (1, 25): + ufunc_db[np.less_equal].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('<='), + 'Qq->?': numbers.int_unsigned_signed_cmp('<=')}) + + ufunc_db[np.not_equal] = { + '??->?': numbers.int_ne_impl, + 'bb->?': numbers.int_ne_impl, + 'BB->?': numbers.int_ne_impl, + 'hh->?': numbers.int_ne_impl, + 'HH->?': numbers.int_ne_impl, + 'ii->?': numbers.int_ne_impl, + 'II->?': numbers.int_ne_impl, + 'll->?': numbers.int_ne_impl, + 'LL->?': numbers.int_ne_impl, + 'qq->?': numbers.int_ne_impl, + 'QQ->?': numbers.int_ne_impl, + 'ff->?': numbers.real_ne_impl, + 'dd->?': numbers.real_ne_impl, + 'FF->?': npyfuncs.np_complex_ne_impl, + 'DD->?': npyfuncs.np_complex_ne_impl, + } + if numpy_version >= (1, 25): + ufunc_db[np.not_equal].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('!='), + 'Qq->?': numbers.int_unsigned_signed_cmp('!=')}) + + ufunc_db[np.equal] = { + '??->?': numbers.int_eq_impl, + 'bb->?': numbers.int_eq_impl, + 'BB->?': numbers.int_eq_impl, + 'hh->?': numbers.int_eq_impl, + 'HH->?': numbers.int_eq_impl, + 'ii->?': numbers.int_eq_impl, + 'II->?': numbers.int_eq_impl, + 'll->?': numbers.int_eq_impl, + 'LL->?': numbers.int_eq_impl, + 'qq->?': numbers.int_eq_impl, + 'QQ->?': numbers.int_eq_impl, + 'ff->?': numbers.real_eq_impl, + 'dd->?': numbers.real_eq_impl, + 'FF->?': npyfuncs.np_complex_eq_impl, + 'DD->?': npyfuncs.np_complex_eq_impl, + } + if numpy_version >= (1, 25): + ufunc_db[np.equal].update({ + 'qQ->?': numbers.int_signed_unsigned_cmp('=='), + 'Qq->?': numbers.int_unsigned_signed_cmp('==')}) + + ufunc_db[np.logical_and] = { + '??->?': npyfuncs.np_logical_and_impl, + 'bb->?': npyfuncs.np_logical_and_impl, + 'BB->?': npyfuncs.np_logical_and_impl, + 'hh->?': npyfuncs.np_logical_and_impl, + 'HH->?': npyfuncs.np_logical_and_impl, + 'ii->?': npyfuncs.np_logical_and_impl, + 'II->?': npyfuncs.np_logical_and_impl, + 'll->?': npyfuncs.np_logical_and_impl, + 'LL->?': npyfuncs.np_logical_and_impl, + 'qq->?': npyfuncs.np_logical_and_impl, + 'QQ->?': npyfuncs.np_logical_and_impl, + 'ff->?': npyfuncs.np_logical_and_impl, + 'dd->?': npyfuncs.np_logical_and_impl, + 'FF->?': npyfuncs.np_complex_logical_and_impl, + 'DD->?': npyfuncs.np_complex_logical_and_impl, + } + + ufunc_db[np.logical_or] = { + '??->?': npyfuncs.np_logical_or_impl, + 'bb->?': npyfuncs.np_logical_or_impl, + 'BB->?': npyfuncs.np_logical_or_impl, + 'hh->?': npyfuncs.np_logical_or_impl, + 'HH->?': npyfuncs.np_logical_or_impl, + 'ii->?': npyfuncs.np_logical_or_impl, + 'II->?': npyfuncs.np_logical_or_impl, + 'll->?': npyfuncs.np_logical_or_impl, + 'LL->?': npyfuncs.np_logical_or_impl, + 'qq->?': npyfuncs.np_logical_or_impl, + 'QQ->?': npyfuncs.np_logical_or_impl, + 'ff->?': npyfuncs.np_logical_or_impl, + 'dd->?': npyfuncs.np_logical_or_impl, + 'FF->?': npyfuncs.np_complex_logical_or_impl, + 'DD->?': npyfuncs.np_complex_logical_or_impl, + } + + ufunc_db[np.logical_xor] = { + '??->?': npyfuncs.np_logical_xor_impl, + 'bb->?': npyfuncs.np_logical_xor_impl, + 'BB->?': npyfuncs.np_logical_xor_impl, + 'hh->?': npyfuncs.np_logical_xor_impl, + 'HH->?': npyfuncs.np_logical_xor_impl, + 'ii->?': npyfuncs.np_logical_xor_impl, + 'II->?': npyfuncs.np_logical_xor_impl, + 'll->?': npyfuncs.np_logical_xor_impl, + 'LL->?': npyfuncs.np_logical_xor_impl, + 'qq->?': npyfuncs.np_logical_xor_impl, + 'QQ->?': npyfuncs.np_logical_xor_impl, + 'ff->?': npyfuncs.np_logical_xor_impl, + 'dd->?': npyfuncs.np_logical_xor_impl, + 'FF->?': npyfuncs.np_complex_logical_xor_impl, + 'DD->?': npyfuncs.np_complex_logical_xor_impl, + } + + ufunc_db[np.logical_not] = { + '?->?': npyfuncs.np_logical_not_impl, + 'b->?': npyfuncs.np_logical_not_impl, + 'B->?': npyfuncs.np_logical_not_impl, + 'h->?': npyfuncs.np_logical_not_impl, + 'H->?': npyfuncs.np_logical_not_impl, + 'i->?': npyfuncs.np_logical_not_impl, + 'I->?': npyfuncs.np_logical_not_impl, + 'l->?': npyfuncs.np_logical_not_impl, + 'L->?': npyfuncs.np_logical_not_impl, + 'q->?': npyfuncs.np_logical_not_impl, + 'Q->?': npyfuncs.np_logical_not_impl, + 'f->?': npyfuncs.np_logical_not_impl, + 'd->?': npyfuncs.np_logical_not_impl, + 'F->?': npyfuncs.np_complex_logical_not_impl, + 'D->?': npyfuncs.np_complex_logical_not_impl, + } + + ufunc_db[np.maximum] = { + '??->?': npyfuncs.np_logical_or_impl, + 'bb->b': npyfuncs.np_int_smax_impl, + 'BB->B': npyfuncs.np_int_umax_impl, + 'hh->h': npyfuncs.np_int_smax_impl, + 'HH->H': npyfuncs.np_int_umax_impl, + 'ii->i': npyfuncs.np_int_smax_impl, + 'II->I': npyfuncs.np_int_umax_impl, + 'll->l': npyfuncs.np_int_smax_impl, + 'LL->L': npyfuncs.np_int_umax_impl, + 'qq->q': npyfuncs.np_int_smax_impl, + 'QQ->Q': npyfuncs.np_int_umax_impl, + 'ff->f': npyfuncs.np_real_maximum_impl, + 'dd->d': npyfuncs.np_real_maximum_impl, + 'FF->F': npyfuncs.np_complex_maximum_impl, + 'DD->D': npyfuncs.np_complex_maximum_impl, + } + + ufunc_db[np.minimum] = { + '??->?': npyfuncs.np_logical_and_impl, + 'bb->b': npyfuncs.np_int_smin_impl, + 'BB->B': npyfuncs.np_int_umin_impl, + 'hh->h': npyfuncs.np_int_smin_impl, + 'HH->H': npyfuncs.np_int_umin_impl, + 'ii->i': npyfuncs.np_int_smin_impl, + 'II->I': npyfuncs.np_int_umin_impl, + 'll->l': npyfuncs.np_int_smin_impl, + 'LL->L': npyfuncs.np_int_umin_impl, + 'qq->q': npyfuncs.np_int_smin_impl, + 'QQ->Q': npyfuncs.np_int_umin_impl, + 'ff->f': npyfuncs.np_real_minimum_impl, + 'dd->d': npyfuncs.np_real_minimum_impl, + 'FF->F': npyfuncs.np_complex_minimum_impl, + 'DD->D': npyfuncs.np_complex_minimum_impl, + } + + ufunc_db[np.fmax] = { + '??->?': npyfuncs.np_logical_or_impl, + 'bb->b': npyfuncs.np_int_smax_impl, + 'BB->B': npyfuncs.np_int_umax_impl, + 'hh->h': npyfuncs.np_int_smax_impl, + 'HH->H': npyfuncs.np_int_umax_impl, + 'ii->i': npyfuncs.np_int_smax_impl, + 'II->I': npyfuncs.np_int_umax_impl, + 'll->l': npyfuncs.np_int_smax_impl, + 'LL->L': npyfuncs.np_int_umax_impl, + 'qq->q': npyfuncs.np_int_smax_impl, + 'QQ->Q': npyfuncs.np_int_umax_impl, + 'ff->f': npyfuncs.np_real_fmax_impl, + 'dd->d': npyfuncs.np_real_fmax_impl, + 'FF->F': npyfuncs.np_complex_fmax_impl, + 'DD->D': npyfuncs.np_complex_fmax_impl, + } + + ufunc_db[np.fmin] = { + '??->?': npyfuncs.np_logical_and_impl, + 'bb->b': npyfuncs.np_int_smin_impl, + 'BB->B': npyfuncs.np_int_umin_impl, + 'hh->h': npyfuncs.np_int_smin_impl, + 'HH->H': npyfuncs.np_int_umin_impl, + 'ii->i': npyfuncs.np_int_smin_impl, + 'II->I': npyfuncs.np_int_umin_impl, + 'll->l': npyfuncs.np_int_smin_impl, + 'LL->L': npyfuncs.np_int_umin_impl, + 'qq->q': npyfuncs.np_int_smin_impl, + 'QQ->Q': npyfuncs.np_int_umin_impl, + 'ff->f': npyfuncs.np_real_fmin_impl, + 'dd->d': npyfuncs.np_real_fmin_impl, + 'FF->F': npyfuncs.np_complex_fmin_impl, + 'DD->D': npyfuncs.np_complex_fmin_impl, + } + + # misc floating functions + ufunc_db[np.isnan] = { + 'f->?': npyfuncs.np_real_isnan_impl, + 'd->?': npyfuncs.np_real_isnan_impl, + 'F->?': npyfuncs.np_complex_isnan_impl, + 'D->?': npyfuncs.np_complex_isnan_impl, + # int8 + 'b->?': npyfuncs.np_int_isnan_impl, + 'B->?': npyfuncs.np_int_isnan_impl, + # int16 + 'h->?': npyfuncs.np_int_isnan_impl, + 'H->?': npyfuncs.np_int_isnan_impl, + # int32 + 'i->?': npyfuncs.np_int_isnan_impl, + 'I->?': npyfuncs.np_int_isnan_impl, + # int64 + 'l->?': npyfuncs.np_int_isnan_impl, + 'L->?': npyfuncs.np_int_isnan_impl, + # intp + 'q->?': npyfuncs.np_int_isnan_impl, + 'Q->?': npyfuncs.np_int_isnan_impl, + # boolean + '?->?': npyfuncs.np_int_isnan_impl, + # datetime & timedelta + 'm->?': npyfuncs.np_datetime_isnat_impl, + 'M->?': npyfuncs.np_datetime_isnat_impl, + } + + ufunc_db[np.isinf] = { + 'f->?': npyfuncs.np_real_isinf_impl, + 'd->?': npyfuncs.np_real_isinf_impl, + 'F->?': npyfuncs.np_complex_isinf_impl, + 'D->?': npyfuncs.np_complex_isinf_impl, + # int8 + 'b->?': npyfuncs.np_int_isinf_impl, + 'B->?': npyfuncs.np_int_isinf_impl, + # int16 + 'h->?': npyfuncs.np_int_isinf_impl, + 'H->?': npyfuncs.np_int_isinf_impl, + # int32 + 'i->?': npyfuncs.np_int_isinf_impl, + 'I->?': npyfuncs.np_int_isinf_impl, + # int64 + 'l->?': npyfuncs.np_int_isinf_impl, + 'L->?': npyfuncs.np_int_isinf_impl, + # intp + 'q->?': npyfuncs.np_int_isinf_impl, + 'Q->?': npyfuncs.np_int_isinf_impl, + # boolean + '?->?': npyfuncs.np_int_isinf_impl, + # datetime & timedelta + 'm->?': npyfuncs.np_int_isinf_impl, + 'M->?': npyfuncs.np_int_isinf_impl, + } + + ufunc_db[np.isfinite] = { + 'f->?': npyfuncs.np_real_isfinite_impl, + 'd->?': npyfuncs.np_real_isfinite_impl, + 'F->?': npyfuncs.np_complex_isfinite_impl, + 'D->?': npyfuncs.np_complex_isfinite_impl, + # int8 + 'b->?': npyfuncs.np_int_isfinite_impl, + 'B->?': npyfuncs.np_int_isfinite_impl, + # int16 + 'h->?': npyfuncs.np_int_isfinite_impl, + 'H->?': npyfuncs.np_int_isfinite_impl, + # int32 + 'i->?': npyfuncs.np_int_isfinite_impl, + 'I->?': npyfuncs.np_int_isfinite_impl, + # int64 + 'l->?': npyfuncs.np_int_isfinite_impl, + 'L->?': npyfuncs.np_int_isfinite_impl, + # intp + 'q->?': npyfuncs.np_int_isfinite_impl, + 'Q->?': npyfuncs.np_int_isfinite_impl, + # boolean + '?->?': npyfuncs.np_int_isfinite_impl, + # datetime & timedelta + 'M->?': npyfuncs.np_datetime_isfinite_impl, + 'm->?': npyfuncs.np_datetime_isfinite_impl, + } + + ufunc_db[np.signbit] = { + 'f->?': npyfuncs.np_real_signbit_impl, + 'd->?': npyfuncs.np_real_signbit_impl, + } + + ufunc_db[np.copysign] = { + 'ff->f': npyfuncs.np_real_copysign_impl, + 'dd->d': npyfuncs.np_real_copysign_impl, + } + + ufunc_db[np.nextafter] = { + 'ff->f': npyfuncs.np_real_nextafter_impl, + 'dd->d': npyfuncs.np_real_nextafter_impl, + } + + ufunc_db[np.spacing] = { + 'f->f': npyfuncs.np_real_spacing_impl, + 'd->d': npyfuncs.np_real_spacing_impl, + } + + ufunc_db[np.ldexp] = { + 'fi->f': npyfuncs.np_real_ldexp_impl, + 'fl->f': npyfuncs.np_real_ldexp_impl, + 'di->d': npyfuncs.np_real_ldexp_impl, + 'dl->d': npyfuncs.np_real_ldexp_impl, + } + if numpy_version >= (2, 0) and IS_WIN32: + ufunc_db[np.ldexp]['fq->f'] = ufunc_db[np.ldexp].pop('fl->f') + ufunc_db[np.ldexp]['dq->d'] = ufunc_db[np.ldexp].pop('dl->d') + + # bit twiddling functions + ufunc_db[np.bitwise_and] = { + '??->?': numbers.int_and_impl, + 'bb->b': numbers.int_and_impl, + 'BB->B': numbers.int_and_impl, + 'hh->h': numbers.int_and_impl, + 'HH->H': numbers.int_and_impl, + 'ii->i': numbers.int_and_impl, + 'II->I': numbers.int_and_impl, + 'll->l': numbers.int_and_impl, + 'LL->L': numbers.int_and_impl, + 'qq->q': numbers.int_and_impl, + 'QQ->Q': numbers.int_and_impl, + } + + ufunc_db[np.bitwise_or] = { + '??->?': numbers.int_or_impl, + 'bb->b': numbers.int_or_impl, + 'BB->B': numbers.int_or_impl, + 'hh->h': numbers.int_or_impl, + 'HH->H': numbers.int_or_impl, + 'ii->i': numbers.int_or_impl, + 'II->I': numbers.int_or_impl, + 'll->l': numbers.int_or_impl, + 'LL->L': numbers.int_or_impl, + 'qq->q': numbers.int_or_impl, + 'QQ->Q': numbers.int_or_impl, + } + + ufunc_db[np.bitwise_xor] = { + '??->?': numbers.int_xor_impl, + 'bb->b': numbers.int_xor_impl, + 'BB->B': numbers.int_xor_impl, + 'hh->h': numbers.int_xor_impl, + 'HH->H': numbers.int_xor_impl, + 'ii->i': numbers.int_xor_impl, + 'II->I': numbers.int_xor_impl, + 'll->l': numbers.int_xor_impl, + 'LL->L': numbers.int_xor_impl, + 'qq->q': numbers.int_xor_impl, + 'QQ->Q': numbers.int_xor_impl, + } + + ufunc_db[np.invert] = { # aka np.bitwise_not + '?->?': numbers.int_invert_impl, + 'b->b': numbers.int_invert_impl, + 'B->B': numbers.int_invert_impl, + 'h->h': numbers.int_invert_impl, + 'H->H': numbers.int_invert_impl, + 'i->i': numbers.int_invert_impl, + 'I->I': numbers.int_invert_impl, + 'l->l': numbers.int_invert_impl, + 'L->L': numbers.int_invert_impl, + 'q->q': numbers.int_invert_impl, + 'Q->Q': numbers.int_invert_impl, + } + + ufunc_db[np.left_shift] = { + 'bb->b': numbers.int_shl_impl, + 'BB->B': numbers.int_shl_impl, + 'hh->h': numbers.int_shl_impl, + 'HH->H': numbers.int_shl_impl, + 'ii->i': numbers.int_shl_impl, + 'II->I': numbers.int_shl_impl, + 'll->l': numbers.int_shl_impl, + 'LL->L': numbers.int_shl_impl, + 'qq->q': numbers.int_shl_impl, + 'QQ->Q': numbers.int_shl_impl, + } + + ufunc_db[np.right_shift] = { + 'bb->b': numbers.int_shr_impl, + 'BB->B': numbers.int_shr_impl, + 'hh->h': numbers.int_shr_impl, + 'HH->H': numbers.int_shr_impl, + 'ii->i': numbers.int_shr_impl, + 'II->I': numbers.int_shr_impl, + 'll->l': numbers.int_shr_impl, + 'LL->L': numbers.int_shr_impl, + 'qq->q': numbers.int_shr_impl, + 'QQ->Q': numbers.int_shr_impl, + } + + # Inject datetime64 support + from numba.np import npdatetime + ufunc_db[np.negative].update({ + 'm->m': npdatetime.timedelta_neg_impl, + }) + ufunc_db[np.positive].update({ + 'm->m': npdatetime.timedelta_pos_impl, + }) + ufunc_db[np.absolute].update({ + 'm->m': npdatetime.timedelta_abs_impl, + }) + ufunc_db[np.sign].update({ + 'm->m': npdatetime.timedelta_sign_impl, + }) + ufunc_db[np.add].update({ + 'mm->m': npdatetime.timedelta_add_impl, + 'Mm->M': npdatetime.datetime_plus_timedelta, + 'mM->M': npdatetime.timedelta_plus_datetime, + }) + ufunc_db[np.subtract].update({ + 'mm->m': npdatetime.timedelta_sub_impl, + 'Mm->M': npdatetime.datetime_minus_timedelta, + 'MM->m': npdatetime.datetime_minus_datetime, + }) + ufunc_db[np.multiply].update({ + 'mq->m': npdatetime.timedelta_times_number, + 'md->m': npdatetime.timedelta_times_number, + 'qm->m': npdatetime.number_times_timedelta, + 'dm->m': npdatetime.number_times_timedelta, + }) + if np.divide != np.true_divide: + ufunc_db[np.divide].update({ + 'mq->m': npdatetime.timedelta_over_number, + 'md->m': npdatetime.timedelta_over_number, + 'mm->d': npdatetime.timedelta_over_timedelta, + }) + ufunc_db[np.true_divide].update({ + 'mq->m': npdatetime.timedelta_over_number, + 'md->m': npdatetime.timedelta_over_number, + 'mm->d': npdatetime.timedelta_over_timedelta, + }) + ufunc_db[np.floor_divide].update({ + 'mq->m': npdatetime.timedelta_over_number, + 'md->m': npdatetime.timedelta_over_number, + }) + + ufunc_db[np.floor_divide].update({ + 'mm->q': npdatetime.timedelta_floor_div_timedelta, + }) + + ufunc_db[np.equal].update({ + 'MM->?': npdatetime.datetime_eq_datetime_impl, + 'mm->?': npdatetime.timedelta_eq_timedelta_impl, + }) + ufunc_db[np.not_equal].update({ + 'MM->?': npdatetime.datetime_ne_datetime_impl, + 'mm->?': npdatetime.timedelta_ne_timedelta_impl, + }) + ufunc_db[np.less].update({ + 'MM->?': npdatetime.datetime_lt_datetime_impl, + 'mm->?': npdatetime.timedelta_lt_timedelta_impl, + }) + ufunc_db[np.less_equal].update({ + 'MM->?': npdatetime.datetime_le_datetime_impl, + 'mm->?': npdatetime.timedelta_le_timedelta_impl, + }) + ufunc_db[np.greater].update({ + 'MM->?': npdatetime.datetime_gt_datetime_impl, + 'mm->?': npdatetime.timedelta_gt_timedelta_impl, + }) + ufunc_db[np.greater_equal].update({ + 'MM->?': npdatetime.datetime_ge_datetime_impl, + 'mm->?': npdatetime.timedelta_ge_timedelta_impl, + }) + ufunc_db[np.maximum].update({ + 'MM->M': npdatetime.datetime_maximum_impl, + 'mm->m': npdatetime.timedelta_maximum_impl, + }) + ufunc_db[np.minimum].update({ + 'MM->M': npdatetime.datetime_minimum_impl, + 'mm->m': npdatetime.timedelta_minimum_impl, + }) + # there is no difference for datetime/timedelta in maximum/fmax + # and minimum/fmin + ufunc_db[np.fmax].update({ + 'MM->M': npdatetime.datetime_fmax_impl, + 'mm->m': npdatetime.timedelta_fmax_impl, + }) + ufunc_db[np.fmin].update({ + 'MM->M': npdatetime.datetime_fmin_impl, + 'mm->m': npdatetime.timedelta_fmin_impl, + }) + + ufunc_db[np.remainder].update({ + 'mm->m': npdatetime.timedelta_mod_timedelta, + }) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f2acbe3396926a249aff5bb6560735e8139cda9a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/__init__.py @@ -0,0 +1 @@ +from numba.parfors import parfor_lowering diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/array_analysis.py b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/array_analysis.py new file mode 100644 index 0000000000000000000000000000000000000000..c931c81861cd74fd714d7af2d18b69b5efddecbf --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/array_analysis.py @@ -0,0 +1,3207 @@ +# +# Copyright (c) 2017 Intel Corporation +# SPDX-License-Identifier: BSD-2-Clause +# + +import numpy +import operator +from numba.core import types, ir, config, cgutils, errors +from numba.core.ir_utils import ( + mk_unique_var, + find_topo_order, + dprint_func_ir, + get_global_func_typ, + guard, + require, + get_definition, + find_callname, + find_build_sequence, + find_const, + is_namedtuple_class, + build_definitions, + find_potential_aliases, + get_canonical_alias, + GuardException, +) +from numba.core.analysis import compute_cfg_from_blocks +from numba.core.typing import npydecl, signature +import copy +from numba.core.extending import intrinsic +import llvmlite + +UNKNOWN_CLASS = -1 +CONST_CLASS = 0 +MAP_TYPES = [numpy.ufunc] + +array_analysis_extensions = {} + +# declaring call classes +array_creation = ["empty", "zeros", "ones", "full"] + +random_int_args = ["rand", "randn"] + +random_1arg_size = [ + "ranf", + "random_sample", + "sample", + "random", + "standard_normal", +] + +random_2arg_sizelast = [ + "chisquare", + "weibull", + "power", + "geometric", + "exponential", + "poisson", + "rayleigh", +] + +random_3arg_sizelast = [ + "normal", + "uniform", + "beta", + "binomial", + "f", + "gamma", + "lognormal", + "laplace", +] + +random_calls = ( + random_int_args + + random_1arg_size + + random_2arg_sizelast + + random_3arg_sizelast + + ["randint", "triangular"] +) + + +@intrinsic +def wrap_index(typingctx, idx, size): + """ + Calculate index value "idx" relative to a size "size" value as + (idx % size), where "size" is known to be positive. + Note that we use the mod(%) operation here instead of + (idx < 0 ? idx + size : idx) because we may have situations + where idx > size due to the way indices are calculated + during slice/range analysis. + + Both idx and size have to be Integer types. + size should be from the array size vars that array_analysis + adds and the bitwidth should match the platform maximum. + """ + require(isinstance(idx, types.scalars.Integer)) + require(isinstance(size, types.scalars.Integer)) + + # We need both idx and size to be platform size so that we can compare. + unified_ty = types.intp if size.signed else types.uintp + idx_unified = types.intp if idx.signed else types.uintp + + def codegen(context, builder, sig, args): + ll_idx_unified_ty = context.get_data_type(idx_unified) + ll_unified_ty = context.get_data_type(unified_ty) + if idx_unified.signed: + idx = builder.sext(args[0], ll_idx_unified_ty) + else: + idx = builder.zext(args[0], ll_idx_unified_ty) + if unified_ty.signed: + size = builder.sext(args[1], ll_unified_ty) + else: + size = builder.zext(args[1], ll_unified_ty) + neg_size = builder.neg(size) + zero = llvmlite.ir.Constant(ll_unified_ty, 0) + # If idx is unsigned then these signed comparisons will fail in those + # cases where the idx has the highest bit set, namely more than 2**63 + # on 64-bit platforms. + idx_negative = builder.icmp_signed("<", idx, zero) + pos_oversize = builder.icmp_signed(">=", idx, size) + neg_oversize = builder.icmp_signed("<=", idx, neg_size) + pos_res = builder.select(pos_oversize, size, idx) + neg_res = builder.select(neg_oversize, zero, builder.add(idx, size)) + mod = builder.select(idx_negative, neg_res, pos_res) + return mod + + return signature(unified_ty, idx, size), codegen + + +def wrap_index_literal(idx, size): + if idx < 0: + if idx <= -size: + return 0 + else: + return idx + size + else: + if idx >= size: + return size + else: + return idx + + +@intrinsic +def assert_equiv(typingctx, *val): + """ + A function that asserts the inputs are of equivalent size, + and throws runtime error when they are not. The input is + a vararg that contains an error message, followed by a set + of objects of either array, tuple or integer. + """ + if len(val) > 1: + # Make sure argument is a single tuple type. Note that this only + # happens when IR containing assert_equiv call is being compiled + # (and going through type inference) again. + val = (types.StarArgTuple(val),) + + assert len(val[0]) > 1 + # Arguments must be either array, tuple, or integer + assert all( + isinstance(a, ( + types.ArrayCompatible, + types.BaseTuple, + types.SliceType, + types.Integer + )) + for a in val[0][1:] + ) + if not isinstance(val[0][0], types.StringLiteral): + raise errors.TypingError('first argument must be a StringLiteral') + + def codegen(context, builder, sig, args): + assert len(args) == 1 # it is a vararg tuple + tup = cgutils.unpack_tuple(builder, args[0]) + tup_type = sig.args[0] + msg = sig.args[0][0].literal_value + + def unpack_shapes(a, aty): + if isinstance(aty, types.ArrayCompatible): + ary = context.make_array(aty)(context, builder, a) + return cgutils.unpack_tuple(builder, ary.shape) + elif isinstance(aty, types.BaseTuple): + return cgutils.unpack_tuple(builder, a) + else: # otherwise it is a single integer + return [a] + + def pairwise(a, aty, b, bty): + ashapes = unpack_shapes(a, aty) + bshapes = unpack_shapes(b, bty) + assert len(ashapes) == len(bshapes) + for (m, n) in zip(ashapes, bshapes): + m_eq_n = builder.icmp_unsigned('==', m, n) + with builder.if_else(m_eq_n) as (then, orelse): + with then: + pass + with orelse: + context.call_conv.return_user_exc( + builder, AssertionError, (msg,) + ) + + for i in range(1, len(tup_type) - 1): + pairwise(tup[i], tup_type[i], tup[i + 1], tup_type[i + 1]) + r = context.get_constant_generic(builder, types.NoneType, None) + return r + + return signature(types.none, *val), codegen + + +class EquivSet(object): + + """EquivSet keeps track of equivalence relations between + a set of objects. + """ + + def __init__(self, obj_to_ind=None, ind_to_obj=None, next_ind=0): + """Create a new EquivSet object. Optional keyword arguments are for + internal use only. + """ + # obj_to_ind maps object to equivalence index (sometimes also called + # equivalence class) is a non-negative number that uniquely identifies + # a set of objects that are equivalent. + self.obj_to_ind = obj_to_ind if obj_to_ind else {} + # ind_to_obj maps equivalence index to a list of objects. + self.ind_to_obj = ind_to_obj if ind_to_obj else {} + # next index number that is incremented each time a new equivalence + # relation is created. + self.next_ind = next_ind + + def empty(self): + """Return an empty EquivSet object. + """ + return EquivSet() + + def clone(self): + """Return a new copy. + """ + return EquivSet( + obj_to_ind=copy.deepcopy(self.obj_to_ind), + ind_to_obj=copy.deepcopy(self.ind_to_obj), + next_id=self.next_ind, + ) + + def __repr__(self): + return "EquivSet({})".format(self.ind_to_obj) + + def is_empty(self): + """Return true if the set is empty, or false otherwise. + """ + return self.obj_to_ind == {} + + def _get_ind(self, x): + """Return the internal index (greater or equal to 0) of the given + object, or -1 if not found. + """ + return self.obj_to_ind.get(x, -1) + + def _get_or_add_ind(self, x): + """Return the internal index (greater or equal to 0) of the given + object, or create a new one if not found. + """ + if x in self.obj_to_ind: + i = self.obj_to_ind[x] + else: + i = self.next_ind + self.next_ind += 1 + return i + + def _insert(self, objs): + """Base method that inserts a set of equivalent objects by modifying + self. + """ + assert len(objs) > 1 + + inds = tuple(self._get_or_add_ind(x) for x in objs) + ind = min(inds) + + if config.DEBUG_ARRAY_OPT >= 2: + print("_insert:", objs, inds) + + if not (ind in self.ind_to_obj): + self.ind_to_obj[ind] = [] + + for i, obj in zip(inds, objs): + if i == ind: + if not (obj in self.ind_to_obj[ind]): + self.ind_to_obj[ind].append(obj) + self.obj_to_ind[obj] = ind + else: + if i in self.ind_to_obj: + # those already existing are reassigned + for x in self.ind_to_obj[i]: + self.obj_to_ind[x] = ind + self.ind_to_obj[ind].append(x) + del self.ind_to_obj[i] + else: + # those that are new are assigned. + self.obj_to_ind[obj] = ind + self.ind_to_obj[ind].append(obj) + + def is_equiv(self, *objs): + """Try to derive if given objects are equivalent, return true + if so, or false otherwise. + """ + inds = [self._get_ind(x) for x in objs] + ind = max(inds) + if ind != -1: + return all(i == ind for i in inds) + else: + return all([x == objs[0] for x in objs]) + + def get_equiv_const(self, obj): + """Check if obj is equivalent to some int constant, and return + the constant if found, or None otherwise. + """ + ind = self._get_ind(obj) + if ind >= 0: + objs = self.ind_to_obj[ind] + for x in objs: + if isinstance(x, int): + return x + return None + + def get_equiv_set(self, obj): + """Return the set of equivalent objects. + """ + ind = self._get_ind(obj) + if ind >= 0: + return set(self.ind_to_obj[ind]) + return set() + + def insert_equiv(self, *objs): + """Insert a set of equivalent objects by modifying self. This + method can be overloaded to transform object type before insertion. + """ + return self._insert(objs) + + def intersect(self, equiv_set): + """ Return the intersection of self and the given equiv_set, + without modifying either of them. The result will also keep + old equivalence indices unchanged. + """ + new_set = self.empty() + new_set.next_ind = self.next_ind + + for objs in equiv_set.ind_to_obj.values(): + inds = tuple(self._get_ind(x) for x in objs) + ind_to_obj = {} + + for i, x in zip(inds, objs): + if i in ind_to_obj: + ind_to_obj[i].append(x) + elif i >= 0: + ind_to_obj[i] = [x] + + for v in ind_to_obj.values(): + if len(v) > 1: + new_set._insert(v) + + return new_set + + +class ShapeEquivSet(EquivSet): + + """Just like EquivSet, except that it accepts only numba IR variables + and constants as objects, guided by their types. Arrays are considered + equivalent as long as their shapes are equivalent. Scalars are + equivalent only when they are equal in value. Tuples are equivalent + when they are of the same size, and their elements are equivalent. + """ + + def __init__( + self, + typemap, + defs=None, + ind_to_var=None, + obj_to_ind=None, + ind_to_obj=None, + next_id=0, + ind_to_const=None, + ): + """Create a new ShapeEquivSet object, where typemap is a dictionary + that maps variable names to their types, and it will not be modified. + Optional keyword arguments are for internal use only. + """ + self.typemap = typemap + # defs maps variable name to an int, where + # 1 means the variable is defined only once, and numbers greater + # than 1 means defined more than once. + self.defs = defs if defs else {} + # ind_to_var maps index number to a list of variables (of ir.Var type). + # It is used to retrieve defined shape variables given an equivalence + # index. + self.ind_to_var = ind_to_var if ind_to_var else {} + # ind_to_const maps index number to a constant, if known. + self.ind_to_const = ind_to_const if ind_to_const else {} + + super(ShapeEquivSet, self).__init__(obj_to_ind, ind_to_obj, next_id) + + def empty(self): + """Return an empty ShapeEquivSet. + """ + return ShapeEquivSet(self.typemap, {}) + + def clone(self): + """Return a new copy. + """ + return ShapeEquivSet( + self.typemap, + defs=copy.copy(self.defs), + ind_to_var=copy.copy(self.ind_to_var), + obj_to_ind=copy.deepcopy(self.obj_to_ind), + ind_to_obj=copy.deepcopy(self.ind_to_obj), + next_id=self.next_ind, + ind_to_const=copy.deepcopy(self.ind_toconst), + ) + + def __repr__(self): + return "ShapeEquivSet({}, ind_to_var={}, ind_to_const={})".format( + self.ind_to_obj, self.ind_to_var, self.ind_to_const + ) + + def _get_names(self, obj): + """Return a set of names for the given obj, where array and tuples + are broken down to their individual shapes or elements. This is + safe because both Numba array shapes and Python tuples are immutable. + """ + if isinstance(obj, ir.Var) or isinstance(obj, str): + name = obj if isinstance(obj, str) else obj.name + if name not in self.typemap: + return (name,) + + typ = self.typemap[name] + if isinstance(typ, (types.BaseTuple, types.ArrayCompatible)): + ndim = (typ.ndim + if isinstance(typ, types.ArrayCompatible) + else len(typ)) + # Treat 0d array as if it were a scalar. + if ndim == 0: + return (name,) + else: + return tuple("{}#{}".format(name, i) for i in range(ndim)) + else: + return (name,) + elif isinstance(obj, ir.Const): + if isinstance(obj.value, tuple): + return obj.value + else: + return (obj.value,) + elif isinstance(obj, tuple): + + def get_names(x): + names = self._get_names(x) + if len(names) != 0: + return names[0] + return names + + return tuple(get_names(x) for x in obj) + elif isinstance(obj, int): + return (obj,) + if config.DEBUG_ARRAY_OPT >= 1: + print( + f"Ignoring untracked object type {type(obj)} in ShapeEquivSet") + return () + + def is_equiv(self, *objs): + """Overload EquivSet.is_equiv to handle Numba IR variables and + constants. + """ + assert len(objs) > 1 + obj_names = [self._get_names(x) for x in objs] + obj_names = [x for x in obj_names if x != ()] # rule out 0d shape + if len(obj_names) <= 1: + return False + ndims = [len(names) for names in obj_names] + ndim = ndims[0] + if not all(ndim == x for x in ndims): + if config.DEBUG_ARRAY_OPT >= 1: + print("is_equiv: Dimension mismatch for {}".format(objs)) + return False + for i in range(ndim): + names = [obj_name[i] for obj_name in obj_names] + if not super(ShapeEquivSet, self).is_equiv(*names): + return False + return True + + def get_equiv_const(self, obj): + """If the given object is equivalent to a constant scalar, + return the scalar value, or None otherwise. + """ + names = self._get_names(obj) + if len(names) != 1: + return None + return super(ShapeEquivSet, self).get_equiv_const(names[0]) + + def get_equiv_var(self, obj): + """If the given object is equivalent to some defined variable, + return the variable, or None otherwise. + """ + names = self._get_names(obj) + if len(names) != 1: + return None + ind = self._get_ind(names[0]) + vs = self.ind_to_var.get(ind, []) + return vs[0] if vs != [] else None + + def get_equiv_set(self, obj): + """Return the set of equivalent objects. + """ + names = self._get_names(obj) + if len(names) != 1: + return None + return super(ShapeEquivSet, self).get_equiv_set(names[0]) + + def _insert(self, objs): + """Overload EquivSet._insert to manage ind_to_var dictionary. + """ + inds = [] + for obj in objs: + if obj in self.obj_to_ind: + inds.append(self.obj_to_ind[obj]) + varlist = [] + constval = None + names = set() + for i in sorted(inds): + if i in self.ind_to_var: + for x in self.ind_to_var[i]: + if not (x.name in names): + varlist.append(x) + names.add(x.name) + if i in self.ind_to_const: + assert constval is None + constval = self.ind_to_const[i] + super(ShapeEquivSet, self)._insert(objs) + new_ind = self.obj_to_ind[objs[0]] + for i in set(inds): + if i in self.ind_to_var: + del self.ind_to_var[i] + self.ind_to_var[new_ind] = varlist + if constval is not None: + self.ind_to_const[new_ind] = constval + + def insert_equiv(self, *objs): + """Overload EquivSet.insert_equiv to handle Numba IR variables and + constants. Input objs are either variable or constant, and at least + one of them must be variable. + """ + assert len(objs) > 1 + obj_names = [self._get_names(x) for x in objs] + obj_names = [x for x in obj_names if x != ()] # rule out 0d shape + if len(obj_names) <= 1: + return + names = sum([list(x) for x in obj_names], []) + ndims = [len(x) for x in obj_names] + ndim = ndims[0] + assert all( + ndim == x for x in ndims + ), "Dimension mismatch for {}".format(objs) + varlist = [] + constlist = [] + for obj in objs: + if not isinstance(obj, tuple): + obj = (obj,) + for var in obj: + if isinstance(var, ir.Var) and not (var.name in varlist): + # favor those already defined, move to front of varlist + if var.name in self.defs: + varlist.insert(0, var) + else: + varlist.append(var) + if isinstance(var, ir.Const) and not (var.value in constlist): + constlist.append(var.value) + + # try to populate ind_to_var if variables are present + for obj in varlist: + name = obj.name + if name in names and not (name in self.obj_to_ind): + self.ind_to_obj[self.next_ind] = [name] + self.obj_to_ind[name] = self.next_ind + self.ind_to_var[self.next_ind] = [obj] + self.next_ind += 1 + + # create equivalence classes for previously unseen constants + for const in constlist: + if const in names and not (const in self.obj_to_ind): + self.ind_to_obj[self.next_ind] = [const] + self.obj_to_ind[const] = self.next_ind + self.ind_to_const[self.next_ind] = const + self.next_ind += 1 + + some_change = False + + for i in range(ndim): + names = [obj_name[i] for obj_name in obj_names] + ie_res = super(ShapeEquivSet, self).insert_equiv(*names) + some_change = some_change or ie_res + + return some_change + + def has_shape(self, name): + """Return true if the shape of the given variable is available. + """ + return self.get_shape(name) is not None + + def get_shape(self, name): + """Return a tuple of variables that corresponds to the shape + of the given array, or None if not found. + """ + return guard(self._get_shape, name) + + def _get_shape(self, name): + """Return a tuple of variables that corresponds to the shape + of the given array, or raise GuardException if not found. + """ + inds = self.get_shape_classes(name) + require(inds != ()) + shape = [] + for i in inds: + require(i in self.ind_to_var) + vs = self.ind_to_var[i] + if vs != []: + shape.append(vs[0]) + else: + require(i in self.ind_to_const) + vs = self.ind_to_const[i] + shape.append(vs) + return tuple(shape) + + def get_shape_classes(self, name): + """Instead of the shape tuple, return tuple of int, where + each int is the corresponding class index of the size object. + Unknown shapes are given class index -1. Return empty tuple + if the input name is a scalar variable. + """ + if isinstance(name, ir.Var): + name = name.name + typ = self.typemap[name] if name in self.typemap else None + if not ( + isinstance(typ, ( + types.BaseTuple, types.SliceType, types.ArrayCompatible + )) + ): + return [] + # Treat 0d arrays like scalars. + if isinstance(typ, types.ArrayCompatible) and typ.ndim == 0: + return [] + names = self._get_names(name) + inds = tuple(self._get_ind(name) for name in names) + return inds + + def intersect(self, equiv_set): + """Overload the intersect method to handle ind_to_var. + """ + newset = super(ShapeEquivSet, self).intersect(equiv_set) + ind_to_var = {} + for i, objs in newset.ind_to_obj.items(): + assert len(objs) > 0 + obj = objs[0] + assert obj in self.obj_to_ind + assert obj in equiv_set.obj_to_ind + j = self.obj_to_ind[obj] + k = equiv_set.obj_to_ind[obj] + assert j in self.ind_to_var + assert k in equiv_set.ind_to_var + varlist = [] + names = [x.name for x in equiv_set.ind_to_var[k]] + for x in self.ind_to_var[j]: + if x.name in names: + varlist.append(x) + ind_to_var[i] = varlist + newset.ind_to_var = ind_to_var + return newset + + def define(self, name, redefined): + """Increment the internal count of how many times a variable is being + defined. Most variables in Numba IR are SSA, i.e., defined only once, + but not all of them. When a variable is being re-defined, it must + be removed from the equivalence relation and added to the redefined + set but only if that redefinition is not known to have the same + equivalence classes. Those variables redefined are removed from all + the blocks' equivalence sets later. + + Arrays passed to define() use their whole name but these do not + appear in the equivalence sets since they are stored there per + dimension. Calling _get_names() here converts array names to + dimensional names. + + This function would previously invalidate if there were any multiple + definitions of a variable. However, we realized that this behavior + is overly restrictive. You need only invalidate on multiple + definitions if they are not known to be equivalent. So, the + equivalence insertion functions now return True if some change was + made (meaning the definition was not equivalent) and False + otherwise. If no change was made, then define() need not be + called. For no change to have been made, the variable must + already be present. If the new definition of the var has the + case where lhs and rhs are in the same equivalence class then + again, no change will be made and define() need not be called + or the variable invalidated. + """ + if isinstance(name, ir.Var): + name = name.name + if name in self.defs: + self.defs[name] += 1 + name_res = list(self._get_names(name)) + for one_name in name_res: + # NOTE: variable being redefined, must invalidate previous + # equivalences. Believe it is a rare case, and only happens to + # scalar accumuators. + if one_name in self.obj_to_ind: + redefined.add( + one_name + ) # remove this var from all equiv sets + i = self.obj_to_ind[one_name] + del self.obj_to_ind[one_name] + self.ind_to_obj[i].remove(one_name) + if self.ind_to_obj[i] == []: + del self.ind_to_obj[i] + assert i in self.ind_to_var + names = [x.name for x in self.ind_to_var[i]] + if name in names: + j = names.index(name) + del self.ind_to_var[i][j] + if self.ind_to_var[i] == []: + del self.ind_to_var[i] + # no more size variables, remove equivalence too + if i in self.ind_to_obj: + for obj in self.ind_to_obj[i]: + del self.obj_to_ind[obj] + del self.ind_to_obj[i] + else: + self.defs[name] = 1 + + def union_defs(self, defs, redefined): + """Union with the given defs dictionary. This is meant to handle + branch join-point, where a variable may have been defined in more + than one branches. + """ + for k, v in defs.items(): + if v > 0: + self.define(k, redefined) + + +class SymbolicEquivSet(ShapeEquivSet): + + """Just like ShapeEquivSet, except that it also reasons about variable + equivalence symbolically by using their arithmetic definitions. + The goal is to automatically derive the equivalence of array ranges + (slicing). For instance, a[1:m] and a[0:m-1] shall be considered + size-equivalence. + """ + + def __init__( + self, + typemap, + def_by=None, + ref_by=None, + ext_shapes=None, + defs=None, + ind_to_var=None, + obj_to_ind=None, + ind_to_obj=None, + next_id=0, + ): + """Create a new SymbolicEquivSet object, where typemap is a dictionary + that maps variable names to their types, and it will not be modified. + Optional keyword arguments are for internal use only. + """ + # A "defined-by" table that maps A to a tuple of (B, i), which + # means A is defined as: A = B + i, where A,B are variable names, + # and i is an integer constants. + self.def_by = def_by if def_by else {} + # A "referred-by" table that maps A to a list of [(B, i), (C, j) ...], + # which implies a sequence of definitions: B = A - i, C = A - j, and + # so on, where A,B,C,... are variable names, and i,j,... are + # integer constants. + self.ref_by = ref_by if ref_by else {} + # A extended shape table that can map an arbitrary object to a shape, + # currently used to remember shapes for SetItem IR node, and wrapped + # indices for Slice objects. + self.ext_shapes = ext_shapes if ext_shapes else {} + # rel_map keeps a map of relative sizes that we have seen so + # that if we compute the same relative sizes different times + # in different ways we can associate those two instances + # of the same relative size to the same equivalence class. + self.rel_map = {} + # wrap_index() computes the effectual index given a slice and a + # dimension's size. We need to be able to know that two wrap_index + # calls are equivalent. They are known to be equivalent if the slice + # and dimension sizes of the two wrap_index calls are equivalent. + # wrap_map maps from a tuple of equivalence class ids for a slice and + # a dimension size to some new equivalence class id for the output size. + self.wrap_map = {} + super(SymbolicEquivSet, self).__init__( + typemap, defs, ind_to_var, obj_to_ind, ind_to_obj, next_id + ) + + def empty(self): + """Return an empty SymbolicEquivSet. + """ + return SymbolicEquivSet(self.typemap) + + def __repr__(self): + return ( + "SymbolicEquivSet({}, ind_to_var={}, def_by={}, " + "ref_by={}, ext_shapes={})".format( + self.ind_to_obj, + self.ind_to_var, + self.def_by, + self.ref_by, + self.ext_shapes, + ) + ) + + def clone(self): + """Return a new copy. + """ + return SymbolicEquivSet( + self.typemap, + def_by=copy.copy(self.def_by), + ref_by=copy.copy(self.ref_by), + ext_shapes=copy.copy(self.ext_shapes), + defs=copy.copy(self.defs), + ind_to_var=copy.copy(self.ind_to_var), + obj_to_ind=copy.deepcopy(self.obj_to_ind), + ind_to_obj=copy.deepcopy(self.ind_to_obj), + next_id=self.next_ind, + ) + + def get_rel(self, name): + """Retrieve a definition pair for the given variable, + or return None if it is not available. + """ + return guard(self._get_or_set_rel, name) + + def _get_or_set_rel(self, name, func_ir=None): + """Retrieve a definition pair for the given variable, + and if it is not already available, try to look it up + in the given func_ir, and remember it for future use. + """ + if isinstance(name, ir.Var): + name = name.name + require(self.defs.get(name, 0) == 1) + if name in self.def_by: + return self.def_by[name] + else: + require(func_ir is not None) + + def plus(x, y): + x_is_const = isinstance(x, int) + y_is_const = isinstance(y, int) + if x_is_const: + if y_is_const: + return x + y + else: + (var, offset) = y + return (var, x + offset) + else: + (var, offset) = x + if y_is_const: + return (var, y + offset) + else: + return None + + def minus(x, y): + if isinstance(y, int): + return plus(x, -y) + elif ( + isinstance(x, tuple) + and isinstance(y, tuple) + and x[0] == y[0] + ): + return minus(x[1], y[1]) + else: + return None + + expr = get_definition(func_ir, name) + value = (name, 0) # default to its own name + if isinstance(expr, ir.Expr): + if expr.op == "call": + fname, mod_name = find_callname( + func_ir, expr, typemap=self.typemap + ) + if ( + fname == "wrap_index" + and mod_name == "numba.parfors.array_analysis" + ): + index = tuple( + self.obj_to_ind.get(x.name, -1) for x in expr.args + ) + # If wrap_index for a slice works on a variable + # that is not analyzable (e.g., multiple definitions) + # then we have to return None here since we can't know + # how that size will compare to others if we can't + # analyze some part of the slice. + if -1 in index: + return None + names = self.ext_shapes.get(index, []) + names.append(name) + if len(names) > 0: + self._insert(names) + self.ext_shapes[index] = names + elif expr.op == "binop": + lhs = self._get_or_set_rel(expr.lhs, func_ir) + rhs = self._get_or_set_rel(expr.rhs, func_ir) + # If either the lhs or rhs is not analyzable + # then don't try to record information this var. + if lhs is None or rhs is None: + return None + elif expr.fn == operator.add: + value = plus(lhs, rhs) + elif expr.fn == operator.sub: + value = minus(lhs, rhs) + elif isinstance(expr, ir.Const) and isinstance(expr.value, int): + value = expr.value + require(value is not None) + # update def_by table + self.def_by[name] = value + if isinstance(value, int) or ( + isinstance(value, tuple) + and (value[0] != name or value[1] != 0) + ): + # update ref_by table too + if isinstance(value, tuple): + (var, offset) = value + if not (var in self.ref_by): + self.ref_by[var] = [] + self.ref_by[var].append((name, -offset)) + # insert new equivalence if found + ind = self._get_ind(var) + if ind >= 0: + objs = self.ind_to_obj[ind] + names = [] + for obj in objs: + if obj in self.ref_by: + names += [ + x + for (x, i) in self.ref_by[obj] + if i == -offset + ] + if len(names) > 1: + super(SymbolicEquivSet, self)._insert(names) + return value + + def define(self, var, redefined, func_ir=None, typ=None): + """Besides incrementing the definition count of the given variable + name, it will also retrieve and simplify its definition from func_ir, + and remember the result for later equivalence comparison. Supported + operations are: + 1. arithmetic plus and minus with constants + 2. wrap_index (relative to some given size) + """ + if isinstance(var, ir.Var): + name = var.name + else: + name = var + super(SymbolicEquivSet, self).define(name, redefined) + if ( + func_ir + and self.defs.get(name, 0) == 1 + and isinstance(typ, types.Number) + ): + value = guard(self._get_or_set_rel, name, func_ir) + # turn constant definition into equivalence + if isinstance(value, int): + self._insert([name, value]) + if isinstance(var, ir.Var): + ind = self._get_or_add_ind(name) + if not (ind in self.ind_to_obj): + self.ind_to_obj[ind] = [name] + self.obj_to_ind[name] = ind + if ind in self.ind_to_var: + self.ind_to_var[ind].append(var) + else: + self.ind_to_var[ind] = [var] + return True + + def _insert(self, objs): + """Overload _insert method to handle ind changes between relative + objects. Returns True if some change is made, false otherwise. + """ + indset = set() + uniqs = set() + for obj in objs: + ind = self._get_ind(obj) + if ind == -1: + uniqs.add(obj) + elif not (ind in indset): + uniqs.add(obj) + indset.add(ind) + if len(uniqs) <= 1: + return False + uniqs = list(uniqs) + super(SymbolicEquivSet, self)._insert(uniqs) + objs = self.ind_to_obj[self._get_ind(uniqs[0])] + + # New equivalence guided by def_by and ref_by + offset_dict = {} + + def get_or_set(d, k): + if k in d: + v = d[k] + else: + v = [] + d[k] = v + return v + + for obj in objs: + if obj in self.def_by: + value = self.def_by[obj] + if isinstance(value, tuple): + (name, offset) = value + get_or_set(offset_dict, -offset).append(name) + if name in self.ref_by: # relative to name + for (v, i) in self.ref_by[name]: + get_or_set(offset_dict, -(offset + i)).append(v) + if obj in self.ref_by: + for (name, offset) in self.ref_by[obj]: + get_or_set(offset_dict, offset).append(name) + for names in offset_dict.values(): + self._insert(names) + return True + + def set_shape_setitem(self, obj, shape): + """remember shapes of SetItem IR nodes. + """ + assert isinstance(obj, (ir.StaticSetItem, ir.SetItem)) + self.ext_shapes[obj] = shape + + def _get_shape(self, obj): + """Overload _get_shape to retrieve the shape of SetItem IR nodes. + """ + if isinstance(obj, (ir.StaticSetItem, ir.SetItem)): + require(obj in self.ext_shapes) + return self.ext_shapes[obj] + else: + assert isinstance(obj, ir.Var) + typ = self.typemap[obj.name] + # for slice type, return the shape variable itself + if isinstance(typ, types.SliceType): + return (obj,) + else: + return super(SymbolicEquivSet, self)._get_shape(obj) + + +class WrapIndexMeta(object): + """ + Array analysis should be able to analyze all the function + calls that it adds to the IR. That way, array analysis can + be run as often as needed and you should get the same + equivalencies. One modification to the IR that array analysis + makes is the insertion of wrap_index calls. Thus, repeated + array analysis passes should be able to analyze these wrap_index + calls. The difficulty of these calls is that the equivalence + class of the left-hand side of the assignment is not present in + the arguments to wrap_index in the right-hand side. Instead, + the equivalence class of the wrap_index output is a combination + of the wrap_index args. The important thing to + note is that if the equivalence classes of the slice size + and the dimension's size are the same for two wrap index + calls then we can be assured of the answer being the same. + So, we maintain the wrap_map dict that maps from a tuple + of equivalence class ids for the slice and dimension size + to some new equivalence class id for the output size. + However, when we are analyzing the first such wrap_index + call we don't have a variable there to associate to the + size since we're in the process of analyzing the instruction + that creates that mapping. So, instead we return an object + of this special class and analyze_inst will establish the + connection between a tuple of the parts of this object + below and the left-hand side variable. + """ + + def __init__(self, slice_size, dim_size): + self.slice_size = slice_size + self.dim_size = dim_size + + +class ArrayAnalysis(object): + aa_count = 0 + + """Analyzes Numpy array computations for properties such as + shape/size equivalence, and keeps track of them on a per-block + basis. The analysis should only be run once because it modifies + the incoming IR by inserting assertion statements that safeguard + parfor optimizations. + """ + + def __init__(self, context, func_ir, typemap, calltypes): + self.context = context + self.func_ir = func_ir + self.typemap = typemap + self.calltypes = calltypes + + # EquivSet of variables, indexed by block number + self.equiv_sets = {} + # keep attr calls to arrays like t=A.sum() as {t:('sum',A)} + self.array_attr_calls = {} + # keep attrs of objects (value,attr)->shape_var + self.object_attrs = {} + # keep prepended instructions from conditional branch + self.prepends = {} + # keep track of pruned precessors when branch degenerates to jump + self.pruned_predecessors = {} + + def get_equiv_set(self, block_label): + """Return the equiv_set object of an block given its label. + """ + return self.equiv_sets[block_label] + + def remove_redefineds(self, redefineds): + """Take a set of variables in redefineds and go through all + the currently existing equivalence sets (created in topo order) + and remove that variable from all of them since it is multiply + defined within the function. + """ + unused = set() + for r in redefineds: + for eslabel in self.equiv_sets: + es = self.equiv_sets[eslabel] + es.define(r, unused) + + def run(self, blocks=None, equiv_set=None): + """run array shape analysis on the given IR blocks, resulting in + modified IR and finalized EquivSet for each block. + """ + if blocks is None: + blocks = self.func_ir.blocks + + self.func_ir._definitions = build_definitions(self.func_ir.blocks) + + if equiv_set is None: + init_equiv_set = SymbolicEquivSet(self.typemap) + else: + init_equiv_set = equiv_set + + self.alias_map, self.arg_aliases = find_potential_aliases( + blocks, + self.func_ir.arg_names, + self.typemap, + self.func_ir + ) + + aa_count_save = ArrayAnalysis.aa_count + ArrayAnalysis.aa_count += 1 + if config.DEBUG_ARRAY_OPT >= 1: + print("Starting ArrayAnalysis:", aa_count_save) + dprint_func_ir(self.func_ir, "before array analysis", blocks) + + if config.DEBUG_ARRAY_OPT >= 1: + print( + "ArrayAnalysis variable types: ", sorted(self.typemap.items()) + ) + print("ArrayAnalysis call types: ", self.calltypes) + + cfg = compute_cfg_from_blocks(blocks) + topo_order = find_topo_order(blocks, cfg=cfg) + # Traverse blocks in topological order + self._run_on_blocks(topo_order, blocks, cfg, init_equiv_set) + + if config.DEBUG_ARRAY_OPT >= 1: + self.dump() + print( + "ArrayAnalysis post variable types: ", + sorted(self.typemap.items()), + ) + print("ArrayAnalysis post call types: ", self.calltypes) + + dprint_func_ir(self.func_ir, "after array analysis", blocks) + if config.DEBUG_ARRAY_OPT >= 1: + print("Ending ArrayAnalysis:", aa_count_save) + + def _run_on_blocks(self, topo_order, blocks, cfg, init_equiv_set): + for label in topo_order: + if config.DEBUG_ARRAY_OPT >= 2: + print("Processing block:", label) + block = blocks[label] + scope = block.scope + pending_transforms = self._determine_transform( + cfg, block, label, scope, init_equiv_set + ) + self._combine_to_new_block(block, pending_transforms) + + def _combine_to_new_block(self, block, pending_transforms): + """Combine the new instructions from previous pass into a new block + body. + """ + new_body = [] + for inst, pre, post in pending_transforms: + for instr in pre: + new_body.append(instr) + new_body.append(inst) + for instr in post: + new_body.append(instr) + block.body = new_body + + def _determine_transform(self, cfg, block, label, scope, init_equiv_set): + """Determine the transformation for each instruction in the block + """ + equiv_set = None + # equiv_set is the intersection of predecessors + preds = cfg.predecessors(label) + # some incoming edge may be pruned due to prior analysis + if label in self.pruned_predecessors: + pruned = self.pruned_predecessors[label] + else: + pruned = [] + # Go through each incoming edge, process prepended instructions and + # calculate beginning equiv_set of current block as an intersection + # of incoming ones. + if config.DEBUG_ARRAY_OPT >= 2: + print("preds:", preds) + for (p, q) in preds: + if config.DEBUG_ARRAY_OPT >= 2: + print("p, q:", p, q) + if p in pruned: + continue + if p in self.equiv_sets: + from_set = self.equiv_sets[p].clone() + if config.DEBUG_ARRAY_OPT >= 2: + print("p in equiv_sets", from_set) + if (p, label) in self.prepends: + instrs = self.prepends[(p, label)] + for inst in instrs: + redefined = set() + self._analyze_inst( + label, scope, from_set, inst, redefined + ) + # Remove anything multiply defined in this block + # from every block equivs. + # NOTE: necessary? can't observe effect in testsuite + self.remove_redefineds(redefined) + if equiv_set is None: + equiv_set = from_set + else: + equiv_set = equiv_set.intersect(from_set) + redefined = set() + equiv_set.union_defs(from_set.defs, redefined) + # Remove anything multiply defined in this block + # from every block equivs. + # NOTE: necessary? can't observe effect in testsuite + self.remove_redefineds(redefined) + + # Start with a new equiv_set if none is computed + if equiv_set is None: + equiv_set = init_equiv_set + self.equiv_sets[label] = equiv_set + + # Go through instructions in a block, and insert pre/post + # instructions as we analyze them. + pending_transforms = [] + for inst in block.body: + redefined = set() + pre, post = self._analyze_inst( + label, scope, equiv_set, inst, redefined + ) + # Remove anything multiply defined in this block from every block + # equivs. + if len(redefined) > 0: + self.remove_redefineds(redefined) + + pending_transforms.append((inst, pre, post)) + return pending_transforms + + def dump(self): + """dump per-block equivalence sets for debugging purposes. + """ + print("Array Analysis: ", self.equiv_sets) + + def _define(self, equiv_set, var, typ, value): + self.typemap[var.name] = typ + self.func_ir._definitions[var.name] = [value] + redefineds = set() + equiv_set.define(var, redefineds, self.func_ir, typ) + + class AnalyzeResult(object): + def __init__(self, **kwargs): + self.kwargs = kwargs + + def _analyze_inst(self, label, scope, equiv_set, inst, redefined): + pre = [] + post = [] + if config.DEBUG_ARRAY_OPT >= 2: + print("analyze_inst:", inst) + if isinstance(inst, ir.Assign): + lhs = inst.target + typ = self.typemap[lhs.name] + shape = None + if isinstance(typ, types.ArrayCompatible) and typ.ndim == 0: + shape = () + elif isinstance(inst.value, ir.Expr): + result = self._analyze_expr(scope, equiv_set, inst.value, lhs) + if result: + require(isinstance(result, ArrayAnalysis.AnalyzeResult)) + if 'shape' in result.kwargs: + shape = result.kwargs['shape'] + if 'pre' in result.kwargs: + pre.extend(result.kwargs['pre']) + if 'post' in result.kwargs: + post.extend(result.kwargs['post']) + if 'rhs' in result.kwargs: + inst.value = result.kwargs['rhs'] + elif isinstance(inst.value, (ir.Var, ir.Const)): + shape = inst.value + elif isinstance(inst.value, ir.Global): + gvalue = inst.value.value + # only integer values can be part of shape + # TODO: support cases with some but not all integer values or + # nested tuples + if (isinstance(gvalue, tuple) + and all(isinstance(v, int) for v in gvalue)): + shape = gvalue + elif isinstance(gvalue, int): + shape = (gvalue,) + elif isinstance(inst.value, ir.Arg): + if ( + isinstance(typ, types.containers.UniTuple) + and isinstance(typ.dtype, types.Integer) + ): + shape = inst.value + elif ( + isinstance(typ, types.containers.Tuple) + and all([isinstance(x, + (types.Integer, types.IntegerLiteral)) + for x in typ.types] + ) + ): + shape = inst.value + + if isinstance(shape, ir.Const): + if isinstance(shape.value, tuple): + loc = shape.loc + shape = tuple(ir.Const(x, loc) for x in shape.value) + elif isinstance(shape.value, int): + shape = (shape,) + else: + shape = None + elif isinstance(shape, ir.Var) and isinstance( + self.typemap[shape.name], types.Integer + ): + shape = (shape,) + elif isinstance(shape, WrapIndexMeta): + """ Here we've got the special WrapIndexMeta object + back from analyzing a wrap_index call. We define + the lhs and then get it's equivalence class then + add the mapping from the tuple of slice size and + dimensional size equivalence ids to the lhs + equivalence id. + """ + equiv_set.define(lhs, redefined, self.func_ir, typ) + lhs_ind = equiv_set._get_ind(lhs.name) + if lhs_ind != -1: + equiv_set.wrap_map[ + (shape.slice_size, shape.dim_size) + ] = lhs_ind + return pre, post + + if isinstance(typ, types.ArrayCompatible): + if ( + shape is not None + and isinstance(shape, ir.Var) + and isinstance( + self.typemap[shape.name], types.containers.BaseTuple + ) + ): + pass + elif ( + shape is None + or isinstance(shape, tuple) + or ( + isinstance(shape, ir.Var) + and not equiv_set.has_shape(shape) + ) + ): + shape = self._gen_shape_call( + equiv_set, lhs, typ.ndim, shape, post + ) + elif isinstance(typ, types.UniTuple): + if shape and isinstance(typ.dtype, types.Integer): + shape = self._gen_shape_call( + equiv_set, lhs, len(typ), shape, post + ) + elif ( + isinstance(typ, types.containers.Tuple) + and all([isinstance(x, + (types.Integer, types.IntegerLiteral)) + for x in typ.types] + ) + ): + shape = self._gen_shape_call( + equiv_set, lhs, len(typ), shape, post + ) + + """ See the comment on the define() function. + + We need only call define(), which will invalidate a variable + from being in the equivalence sets on multiple definitions, + if the variable was not previously defined or if the new + definition would be in a conflicting equivalence class to the + original equivalence class for the variable. + + insert_equiv() returns True if either of these conditions are + True and then we call define() in those cases. + If insert_equiv() returns False then no changes were made and + all equivalence classes are consistent upon a redefinition so + no invalidation is needed and we don't call define(). + """ + needs_define = True + if shape is not None: + needs_define = equiv_set.insert_equiv(lhs, shape) + if needs_define: + equiv_set.define(lhs, redefined, self.func_ir, typ) + elif isinstance(inst, (ir.StaticSetItem, ir.SetItem)): + index = ( + inst.index if isinstance(inst, ir.SetItem) else inst.index_var + ) + result = guard( + self._index_to_shape, scope, equiv_set, inst.target, index + ) + if not result: + return [], [] + if result[0] is not None: + assert isinstance(inst, (ir.StaticSetItem, ir.SetItem)) + inst.index = result[0] + result = result[1] + target_shape = result.kwargs['shape'] + if 'pre' in result.kwargs: + pre = result.kwargs['pre'] + value_shape = equiv_set.get_shape(inst.value) + if value_shape == (): # constant + equiv_set.set_shape_setitem(inst, target_shape) + return pre, [] + elif value_shape is not None: + target_typ = self.typemap[inst.target.name] + require(isinstance(target_typ, types.ArrayCompatible)) + target_ndim = target_typ.ndim + shapes = [target_shape, value_shape] + names = [inst.target.name, inst.value.name] + broadcast_result = self._broadcast_assert_shapes( + scope, equiv_set, inst.loc, shapes, names + ) + require('shape' in broadcast_result.kwargs) + require('pre' in broadcast_result.kwargs) + shape = broadcast_result.kwargs['shape'] + asserts = broadcast_result.kwargs['pre'] + n = len(shape) + # shape dimension must be within target dimension + assert target_ndim >= n + equiv_set.set_shape_setitem(inst, shape) + return pre + asserts, [] + else: + return pre, [] + elif isinstance(inst, ir.Branch): + + def handle_call_binop(cond_def): + br = None + if cond_def.fn == operator.eq: + br = inst.truebr + otherbr = inst.falsebr + cond_val = 1 + elif cond_def.fn == operator.ne: + br = inst.falsebr + otherbr = inst.truebr + cond_val = 0 + lhs_typ = self.typemap[cond_def.lhs.name] + rhs_typ = self.typemap[cond_def.rhs.name] + if br is not None and ( + ( + isinstance(lhs_typ, types.Integer) + and isinstance(rhs_typ, types.Integer) + ) + or ( + isinstance(lhs_typ, types.BaseTuple) + and isinstance(rhs_typ, types.BaseTuple) + ) + ): + loc = inst.loc + args = (cond_def.lhs, cond_def.rhs) + asserts = self._make_assert_equiv( + scope, loc, equiv_set, args + ) + asserts.append( + ir.Assign(ir.Const(cond_val, loc), cond_var, loc) + ) + self.prepends[(label, br)] = asserts + self.prepends[(label, otherbr)] = [ + ir.Assign(ir.Const(1 - cond_val, loc), cond_var, loc) + ] + + cond_var = inst.cond + cond_def = guard(get_definition, self.func_ir, cond_var) + if not cond_def: # phi variable has no single definition + # We'll use equiv_set to try to find a cond_def instead + equivs = equiv_set.get_equiv_set(cond_var) + defs = [] + for name in equivs: + if isinstance(name, str) and name in self.typemap: + var_def = guard( + get_definition, self.func_ir, name, lhs_only=True + ) + if isinstance(var_def, ir.Var): + var_def = var_def.name + if var_def: + defs.append(var_def) + else: + defs.append(name) + defvars = set(filter(lambda x: isinstance(x, str), defs)) + defconsts = set(defs).difference(defvars) + if len(defconsts) == 1: + cond_def = list(defconsts)[0] + elif len(defvars) == 1: + cond_def = guard( + get_definition, self.func_ir, list(defvars)[0] + ) + if isinstance(cond_def, ir.Expr) and cond_def.op == 'binop': + handle_call_binop(cond_def) + elif isinstance(cond_def, ir.Expr) and cond_def.op == 'call': + # this handles bool(predicate) + glbl_bool = guard(get_definition, self.func_ir, cond_def.func) + if glbl_bool is not None and glbl_bool.value is bool: + if len(cond_def.args) == 1: + condition = guard(get_definition, self.func_ir, + cond_def.args[0]) + if (condition is not None and + isinstance(condition, ir.Expr) and + condition.op == 'binop'): + handle_call_binop(condition) + else: + if isinstance(cond_def, ir.Const): + cond_def = cond_def.value + if isinstance(cond_def, int) or isinstance(cond_def, bool): + # condition is always true/false, prune the outgoing edge + pruned_br = inst.falsebr if cond_def else inst.truebr + if pruned_br in self.pruned_predecessors: + self.pruned_predecessors[pruned_br].append(label) + else: + self.pruned_predecessors[pruned_br] = [label] + + elif type(inst) in array_analysis_extensions: + # let external calls handle stmt if type matches + f = array_analysis_extensions[type(inst)] + pre, post = f(inst, equiv_set, self.typemap, self) + + return pre, post + + def _analyze_expr(self, scope, equiv_set, expr, lhs): + fname = "_analyze_op_{}".format(expr.op) + try: + fn = getattr(self, fname) + except AttributeError: + return None + return guard(fn, scope, equiv_set, expr, lhs) + + def _analyze_op_getattr(self, scope, equiv_set, expr, lhs): + # TODO: getattr of npytypes.Record + if expr.attr == "T" and self._isarray(expr.value.name): + return self._analyze_op_call_numpy_transpose( + scope, equiv_set, expr.loc, [expr.value], {} + ) + elif expr.attr == "shape": + shape = equiv_set.get_shape(expr.value) + return ArrayAnalysis.AnalyzeResult(shape=shape) + elif expr.attr in ("real", "imag") and self._isarray(expr.value.name): + # Shape of real or imag attr is the same as the shape of the array + # itself. + return ArrayAnalysis.AnalyzeResult(shape=expr.value) + elif self._isarray(lhs.name): + canonical_value = get_canonical_alias( + expr.value.name, self.alias_map + ) + if (canonical_value, expr.attr) in self.object_attrs: + return ArrayAnalysis.AnalyzeResult( + shape=self.object_attrs[(canonical_value, expr.attr)] + ) + else: + typ = self.typemap[lhs.name] + post = [] + shape = self._gen_shape_call( + equiv_set, lhs, typ.ndim, None, post + ) + self.object_attrs[(canonical_value, expr.attr)] = shape + return ArrayAnalysis.AnalyzeResult(shape=shape, post=post) + + return None + + def _analyze_op_cast(self, scope, equiv_set, expr, lhs): + return ArrayAnalysis.AnalyzeResult(shape=expr.value) + + def _analyze_op_exhaust_iter(self, scope, equiv_set, expr, lhs): + var = expr.value + typ = self.typemap[var.name] + if isinstance(typ, types.BaseTuple): + require(len(typ) == expr.count) + require(equiv_set.has_shape(var)) + return ArrayAnalysis.AnalyzeResult(shape=var) + return None + + def gen_literal_slice_part( + self, + arg_val, + loc, + scope, + stmts, + equiv_set, + name="static_literal_slice_part", + ): + # Create var to hold the calculated slice size. + static_literal_slice_part_var = ir.Var(scope, mk_unique_var(name), loc) + static_literal_slice_part_val = ir.Const(arg_val, loc) + static_literal_slice_part_typ = types.IntegerLiteral(arg_val) + # We'll prepend this slice size calculation to the get/setitem. + stmts.append( + ir.Assign( + value=static_literal_slice_part_val, + target=static_literal_slice_part_var, + loc=loc, + ) + ) + self._define( + equiv_set, + static_literal_slice_part_var, + static_literal_slice_part_typ, + static_literal_slice_part_val, + ) + return static_literal_slice_part_var, static_literal_slice_part_typ + + def gen_static_slice_size( + self, lhs_rel, rhs_rel, loc, scope, stmts, equiv_set + ): + the_var, *_ = self.gen_literal_slice_part( + rhs_rel - lhs_rel, + loc, + scope, + stmts, + equiv_set, + name="static_slice_size", + ) + return the_var + + def gen_explicit_neg( + self, + arg, + arg_rel, + arg_typ, + size_typ, + loc, + scope, + dsize, + stmts, + equiv_set, + ): + assert not isinstance(size_typ, int) + # Create var to hold the calculated slice size. + explicit_neg_var = ir.Var(scope, mk_unique_var("explicit_neg"), loc) + explicit_neg_val = ir.Expr.binop(operator.add, dsize, arg, loc=loc) + # Determine the type of that var. Can be literal if we know the + # literal size of the dimension. + explicit_neg_typ = types.intp + self.calltypes[explicit_neg_val] = signature( + explicit_neg_typ, size_typ, arg_typ + ) + # We'll prepend this slice size calculation to the get/setitem. + stmts.append( + ir.Assign(value=explicit_neg_val, target=explicit_neg_var, loc=loc) + ) + self._define( + equiv_set, explicit_neg_var, explicit_neg_typ, explicit_neg_val + ) + return explicit_neg_var, explicit_neg_typ + + def update_replacement_slice( + self, + lhs, + lhs_typ, + lhs_rel, + dsize_rel, + replacement_slice, + slice_index, + need_replacement, + loc, + scope, + stmts, + equiv_set, + size_typ, + dsize, + ): + # Do compile-time calculation of real index value if both the given + # index value and the array length are known at compile time. + known = False + if isinstance(lhs_rel, int): + # If the index and the array size are known then the real index + # can be calculated at compile time. + if lhs_rel == 0: + # Special-case 0 as nothing needing to be done. + known = True + elif isinstance(dsize_rel, int): + known = True + # Calculate the real index. + wil = wrap_index_literal(lhs_rel, dsize_rel) + # If the given index value is between 0 and dsize then + # there's no need to rewrite anything. + if wil != lhs_rel: + if config.DEBUG_ARRAY_OPT >= 2: + print("Replacing slice to hard-code known slice size.") + # Indicate we will need to replace the slice var. + need_replacement = True + literal_var, literal_typ = self.gen_literal_slice_part( + wil, loc, scope, stmts, equiv_set + ) + assert slice_index == 0 or slice_index == 1 + if slice_index == 0: + replacement_slice.args = ( + literal_var, + replacement_slice.args[1], + ) + else: + replacement_slice.args = ( + replacement_slice.args[0], + literal_var, + ) + # Update lhs information with the negative removed. + lhs = replacement_slice.args[slice_index] + lhs_typ = literal_typ + lhs_rel = equiv_set.get_rel(lhs) + elif lhs_rel < 0: + # Indicate we will need to replace the slice var. + need_replacement = True + if config.DEBUG_ARRAY_OPT >= 2: + print("Replacing slice due to known negative index.") + explicit_neg_var, explicit_neg_typ = self.gen_explicit_neg( + lhs, + lhs_rel, + lhs_typ, + size_typ, + loc, + scope, + dsize, + stmts, + equiv_set, + ) + if slice_index == 0: + replacement_slice.args = ( + explicit_neg_var, + replacement_slice.args[1], + ) + else: + replacement_slice.args = ( + replacement_slice.args[0], + explicit_neg_var, + ) + # Update lhs information with the negative removed. + lhs = replacement_slice.args[slice_index] + lhs_typ = explicit_neg_typ + lhs_rel = equiv_set.get_rel(lhs) + return ( + lhs, + lhs_typ, + lhs_rel, + replacement_slice, + need_replacement, + known, + ) + + def slice_size(self, index, dsize, equiv_set, scope, stmts): + """Reason about the size of a slice represented by the "index" + variable, and return a variable that has this size data, or + raise GuardException if it cannot reason about it. + + The computation takes care of negative values used in the slice + with respect to the given dimensional size ("dsize"). + + Extra statements required to produce the result are appended + to parent function's stmts list. + """ + loc = index.loc + # Get the definition of the index variable. + index_def = get_definition(self.func_ir, index) + fname, mod_name = find_callname( + self.func_ir, index_def, typemap=self.typemap + ) + require(fname == 'slice' and mod_name in ('builtins')) + require(len(index_def.args) == 2) + lhs = index_def.args[0] + rhs = index_def.args[1] + size_typ = self.typemap[dsize.name] + lhs_typ = self.typemap[lhs.name] + rhs_typ = self.typemap[rhs.name] + + if config.DEBUG_ARRAY_OPT >= 2: + print(f"slice_size index={index} dsize={dsize} " + f"index_def={index_def} lhs={lhs} rhs={rhs} " + f"size_typ={size_typ} lhs_typ={lhs_typ} rhs_typ={rhs_typ}") + + # Make a deepcopy of the original slice to use as the + # replacement slice, which we will modify as necessary + # below to convert all negative constants in the slice + # to be relative to the dimension size. + replacement_slice = copy.deepcopy(index_def) + need_replacement = False + + # Fill in the left side of the slice's ":" with 0 if it wasn't + # specified. + if isinstance(lhs_typ, types.NoneType): + zero_var = ir.Var(scope, mk_unique_var("zero"), loc) + zero = ir.Const(0, loc) + stmts.append(ir.Assign(value=zero, target=zero_var, loc=loc)) + self._define(equiv_set, zero_var, types.IntegerLiteral(0), zero) + lhs = zero_var + lhs_typ = types.IntegerLiteral(0) + replacement_slice.args = (lhs, replacement_slice.args[1]) + need_replacement = True + if config.DEBUG_ARRAY_OPT >= 2: + print("Replacing slice because lhs is None.") + + # Fill in the right side of the slice's ":" with the array + # length if it wasn't specified. + if isinstance(rhs_typ, types.NoneType): + rhs = dsize + rhs_typ = size_typ + replacement_slice.args = (replacement_slice.args[0], rhs) + need_replacement = True + if config.DEBUG_ARRAY_OPT >= 2: + print("Replacing slice because lhs is None.") + + lhs_rel = equiv_set.get_rel(lhs) + rhs_rel = equiv_set.get_rel(rhs) + dsize_rel = equiv_set.get_rel(dsize) + if config.DEBUG_ARRAY_OPT >= 2: + print( + "lhs_rel", lhs_rel, "rhs_rel", rhs_rel, "dsize_rel", dsize_rel + ) + + # Update replacement slice with the real index value if we can + # compute it at compile time. + [ + lhs, + lhs_typ, + lhs_rel, + replacement_slice, + need_replacement, + lhs_known, + ] = self.update_replacement_slice( + lhs, + lhs_typ, + lhs_rel, + dsize_rel, + replacement_slice, + 0, + need_replacement, + loc, + scope, + stmts, + equiv_set, + size_typ, + dsize, + ) + [ + rhs, + rhs_typ, + rhs_rel, + replacement_slice, + need_replacement, + rhs_known, + ] = self.update_replacement_slice( + rhs, + rhs_typ, + rhs_rel, + dsize_rel, + replacement_slice, + 1, + need_replacement, + loc, + scope, + stmts, + equiv_set, + size_typ, + dsize, + ) + if config.DEBUG_ARRAY_OPT >= 2: + print("lhs_known:", lhs_known) + print("rhs_known:", rhs_known) + + # If neither of the parts of the slice were negative constants + # then we don't need to do slice replacement in the IR. + if not need_replacement: + replacement_slice_var = None + else: + # Create a new var for the replacement slice. + replacement_slice_var = ir.Var( + scope, mk_unique_var("replacement_slice"), loc + ) + # Create a deepcopy of slice calltype so that when we change it + # below the original isn't changed. Make the types of the parts of + # the slice intp. + new_arg_typs = (types.intp, types.intp) + rs_calltype = self.typemap[index_def.func.name].get_call_type( + self.context, new_arg_typs, {} + ) + self.calltypes[replacement_slice] = rs_calltype + stmts.append( + ir.Assign( + value=replacement_slice, + target=replacement_slice_var, + loc=loc, + ) + ) + # The type of the replacement slice is the same type as the + # original. + self.typemap[replacement_slice_var.name] = self.typemap[index.name] + + if config.DEBUG_ARRAY_OPT >= 2: + print( + "after rewriting negatives", + "lhs_rel", + lhs_rel, + "rhs_rel", + rhs_rel, + ) + + if lhs_known and rhs_known: + if config.DEBUG_ARRAY_OPT >= 2: + print("lhs and rhs known so return static size") + return ( + self.gen_static_slice_size( + lhs_rel, rhs_rel, loc, scope, stmts, equiv_set + ), + replacement_slice_var, + ) + + if ( + lhs_rel == 0 + and isinstance(rhs_rel, tuple) + and equiv_set.is_equiv(dsize, rhs_rel[0]) + and rhs_rel[1] == 0 + ): + return dsize, None + + slice_typ = types.intp + orig_slice_typ = slice_typ + + size_var = ir.Var(scope, mk_unique_var("slice_size"), loc) + size_val = ir.Expr.binop(operator.sub, rhs, lhs, loc=loc) + self.calltypes[size_val] = signature(slice_typ, rhs_typ, lhs_typ) + self._define(equiv_set, size_var, slice_typ, size_val) + size_rel = equiv_set.get_rel(size_var) + if config.DEBUG_ARRAY_OPT >= 2: + print("size_rel", size_rel, type(size_rel)) + + wrap_var = ir.Var(scope, mk_unique_var("wrap"), loc) + wrap_def = ir.Global("wrap_index", wrap_index, loc=loc) + fnty = get_global_func_typ(wrap_index) + sig = self.context.resolve_function_type( + fnty, (orig_slice_typ, size_typ), {} + ) + self._define(equiv_set, wrap_var, fnty, wrap_def) + + def gen_wrap_if_not_known(val, val_typ, known): + if not known: + var = ir.Var(scope, mk_unique_var("var"), loc) + var_typ = types.intp + new_value = ir.Expr.call(wrap_var, [val, dsize], {}, loc) + # def_res will be False if there is something unanalyzable + # that prevents a size association from being created. + self._define(equiv_set, var, var_typ, new_value) + self.calltypes[new_value] = sig + return (var, var_typ, new_value) + else: + return (val, val_typ, None) + + var1, var1_typ, value1 = gen_wrap_if_not_known(lhs, lhs_typ, lhs_known) + var2, var2_typ, value2 = gen_wrap_if_not_known(rhs, rhs_typ, rhs_known) + + stmts.append(ir.Assign(value=size_val, target=size_var, loc=loc)) + stmts.append(ir.Assign(value=wrap_def, target=wrap_var, loc=loc)) + if value1 is not None: + stmts.append(ir.Assign(value=value1, target=var1, loc=loc)) + if value2 is not None: + stmts.append(ir.Assign(value=value2, target=var2, loc=loc)) + + post_wrap_size_var = ir.Var( + scope, mk_unique_var("post_wrap_slice_size"), loc + ) + post_wrap_size_val = ir.Expr.binop(operator.sub, + var2, + var1, + loc=loc) + self.calltypes[post_wrap_size_val] = signature( + slice_typ, var2_typ, var1_typ + ) + self._define( + equiv_set, post_wrap_size_var, slice_typ, post_wrap_size_val + ) + + stmts.append( + ir.Assign( + value=post_wrap_size_val, target=post_wrap_size_var, loc=loc + ) + ) + + # rel_map keeps a map of relative sizes that we have seen so + # that if we compute the same relative sizes different times + # in different ways we can associate those two instances + # of the same relative size to the same equivalence class. + if isinstance(size_rel, tuple): + if config.DEBUG_ARRAY_OPT >= 2: + print("size_rel is tuple", equiv_set.rel_map) + rel_map_entry = None + for rme, rme_tuple in equiv_set.rel_map.items(): + if rme[1] == size_rel[1] and equiv_set.is_equiv( + rme[0], size_rel[0] + ): + rel_map_entry = rme_tuple + break + + if rel_map_entry is not None: + # We have seen this relative size before so establish + # equivalence to the previous variable. + if config.DEBUG_ARRAY_OPT >= 2: + print("establishing equivalence to", rel_map_entry) + equiv_set.insert_equiv(size_var, rel_map_entry[0]) + equiv_set.insert_equiv(post_wrap_size_var, rel_map_entry[1]) + else: + # The first time we've seen this relative size so + # remember the variable defining that size. + equiv_set.rel_map[size_rel] = (size_var, post_wrap_size_var) + + return post_wrap_size_var, replacement_slice_var + + def _index_to_shape(self, scope, equiv_set, var, ind_var): + """For indexing like var[index] (either write or read), see if + the index corresponds to a range/slice shape. + Returns a 2-tuple where the first item is either None or a ir.Var + to be used to replace the index variable in the outer getitem or + setitem instruction. The second item is also a tuple returning + the shape and prepending instructions. + """ + typ = self.typemap[var.name] + require(isinstance(typ, types.ArrayCompatible)) + ind_typ = self.typemap[ind_var.name] + ind_shape = equiv_set._get_shape(ind_var) + var_shape = equiv_set._get_shape(var) + if isinstance(ind_typ, types.SliceType): + seq_typs = (ind_typ,) + seq = (ind_var,) + else: + require(isinstance(ind_typ, types.BaseTuple)) + seq, op = find_build_sequence(self.func_ir, ind_var) + require(op == "build_tuple") + seq_typs = tuple(self.typemap[x.name] for x in seq) + require(len(ind_shape) == len(seq_typs) == len(var_shape)) + stmts = [] + + def to_shape(typ, index, dsize): + if isinstance(typ, types.SliceType): + return self.slice_size(index, dsize, equiv_set, scope, stmts) + elif isinstance(typ, types.Number): + return None, None + else: + # unknown dimension size for this index, + # so we'll raise GuardException + require(False) + + shape_list = [] + index_var_list = [] + replace_index = False + for (typ, size, dsize, orig_ind) in zip(seq_typs, + ind_shape, + var_shape, + seq): + # Convert the given dimension of the get/setitem index expr. + shape_part, index_var_part = to_shape(typ, size, dsize) + shape_list.append(shape_part) + + # to_shape will return index_var_part as not None if a + # replacement of the slice is required to convert from + # negative indices to positive relative indices. + if index_var_part is not None: + # Remember that we need to replace the build_tuple. + replace_index = True + index_var_list.append(index_var_part) + else: + index_var_list.append(orig_ind) + + # If at least one of the dimensions required a new slice variable + # then we'll need to replace the build_tuple for this get/setitem. + if replace_index: + # Multi-dimensional array access needs a replacement tuple built. + if len(index_var_list) > 1: + # Make a variable to hold the new build_tuple. + replacement_build_tuple_var = ir.Var( + scope, + mk_unique_var("replacement_build_tuple"), + ind_shape[0].loc, + ) + # Create the build tuple from the accumulated index vars above. + new_build_tuple = ir.Expr.build_tuple( + index_var_list, ind_shape[0].loc + ) + stmts.append( + ir.Assign( + value=new_build_tuple, + target=replacement_build_tuple_var, + loc=ind_shape[0].loc, + ) + ) + # New build_tuple has same type as the original one. + self.typemap[replacement_build_tuple_var.name] = ind_typ + else: + replacement_build_tuple_var = index_var_list[0] + else: + replacement_build_tuple_var = None + + shape = tuple(shape_list) + require(not all(x is None for x in shape)) + shape = tuple(x for x in shape if x is not None) + return (replacement_build_tuple_var, + ArrayAnalysis.AnalyzeResult(shape=shape, pre=stmts)) + + def _analyze_op_getitem(self, scope, equiv_set, expr, lhs): + result = self._index_to_shape(scope, equiv_set, expr.value, expr.index) + if result[0] is not None: + expr.index = result[0] + return result[1] + + def _analyze_op_static_getitem(self, scope, equiv_set, expr, lhs): + var = expr.value + typ = self.typemap[var.name] + if not isinstance(typ, types.BaseTuple): + result = self._index_to_shape( + scope, equiv_set, expr.value, expr.index_var + ) + if result[0] is not None: + expr.index_var = result[0] + return result[1] + shape = equiv_set._get_shape(var) + if isinstance(expr.index, int): + require(expr.index < len(shape)) + return ArrayAnalysis.AnalyzeResult(shape=shape[expr.index]) + elif isinstance(expr.index, slice): + return ArrayAnalysis.AnalyzeResult(shape=shape[expr.index]) + require(False) + + def _analyze_op_unary(self, scope, equiv_set, expr, lhs): + require(expr.fn in UNARY_MAP_OP) + # for scalars, only + operator results in equivalence + # for example, if "m = -n", m and n are not equivalent + if self._isarray(expr.value.name) or expr.fn == operator.add: + return ArrayAnalysis.AnalyzeResult(shape=expr.value) + return None + + def _analyze_op_binop(self, scope, equiv_set, expr, lhs): + require(expr.fn in BINARY_MAP_OP) + return self._analyze_broadcast( + scope, equiv_set, expr.loc, [expr.lhs, expr.rhs], expr.fn + ) + + def _analyze_op_inplace_binop(self, scope, equiv_set, expr, lhs): + require(expr.fn in INPLACE_BINARY_MAP_OP) + return self._analyze_broadcast( + scope, equiv_set, expr.loc, [expr.lhs, expr.rhs], expr.fn + ) + + def _analyze_op_arrayexpr(self, scope, equiv_set, expr, lhs): + return self._analyze_broadcast( + scope, equiv_set, expr.loc, expr.list_vars(), None + ) + + def _analyze_op_build_tuple(self, scope, equiv_set, expr, lhs): + # For the moment, we can't do anything with tuples that + # contain multi-dimensional arrays, compared to array dimensions. + # Return None to say we won't track this tuple if a part of it + # is an array. + for x in expr.items: + if ( + isinstance(x, ir.Var) + and isinstance(self.typemap[x.name], types.ArrayCompatible) + and self.typemap[x.name].ndim > 1 + ): + return None + + consts = [] + for var in expr.items: + x = guard(find_const, self.func_ir, var) + if x is not None: + consts.append(x) + else: + break + else: + out = tuple([ir.Const(x, expr.loc) for x in consts]) + return ArrayAnalysis.AnalyzeResult( + shape=out, + rhs=ir.Const(tuple(consts), expr.loc) + ) + # default return for non-const + return ArrayAnalysis.AnalyzeResult(shape=tuple(expr.items)) + + def _analyze_op_call(self, scope, equiv_set, expr, lhs): + from numba.stencils.stencil import StencilFunc + + callee = expr.func + callee_def = get_definition(self.func_ir, callee) + if isinstance( + callee_def, (ir.Global, ir.FreeVar) + ) and is_namedtuple_class(callee_def.value): + return ArrayAnalysis.AnalyzeResult(shape=tuple(expr.args)) + if isinstance(callee_def, (ir.Global, ir.FreeVar)) and isinstance( + callee_def.value, StencilFunc + ): + args = expr.args + return self._analyze_stencil( + scope, + equiv_set, + callee_def.value, + expr.loc, + args, + dict(expr.kws), + ) + + fname, mod_name = find_callname( + self.func_ir, expr, typemap=self.typemap + ) + added_mod_name = False + # call via attribute (i.e. array.func) + if isinstance(mod_name, ir.Var) and isinstance( + self.typemap[mod_name.name], types.ArrayCompatible + ): + args = [mod_name] + expr.args + mod_name = "numpy" + # Remember that args and expr.args don't alias. + added_mod_name = True + else: + args = expr.args + fname = "_analyze_op_call_{}_{}".format(mod_name, fname).replace( + ".", "_" + ) + if fname in UFUNC_MAP_OP: # known numpy ufuncs + return self._analyze_broadcast(scope, equiv_set, + expr.loc, args, None) + else: + try: + fn = getattr(self, fname) + except AttributeError: + return None + result = guard( + fn, + scope=scope, + equiv_set=equiv_set, + loc=expr.loc, + args=args, + kws=dict(expr.kws), + ) + # We want the ability for function fn to modify arguments. + # If args and expr.args don't alias then we need the extra + # step of assigning back into expr.args from the args that + # was passed to fn. + if added_mod_name: + expr.args = args[1:] + return result + + def _analyze_op_call_builtins_len(self, scope, equiv_set, loc, args, kws): + # python 3 version of len() + require(len(args) == 1) + var = args[0] + typ = self.typemap[var.name] + require(isinstance(typ, types.ArrayCompatible)) + shape = equiv_set._get_shape(var) + return ArrayAnalysis.AnalyzeResult(shape=shape[0], rhs=shape[0]) + + def _analyze_op_call_numba_parfors_array_analysis_assert_equiv( + self, scope, equiv_set, loc, args, kws + ): + equiv_set.insert_equiv(*args[1:]) + return None + + def _analyze_op_call_numba_parfors_array_analysis_wrap_index( + self, scope, equiv_set, loc, args, kws + ): + """ Analyze wrap_index calls added by a previous run of + Array Analysis + """ + require(len(args) == 2) + # Two parts to wrap index, the specified slice size... + slice_size = args[0].name + # ...and the size of the dimension. + dim_size = args[1].name + # Get the equivalence class ids for both. + slice_eq = equiv_set._get_or_add_ind(slice_size) + dim_eq = equiv_set._get_or_add_ind(dim_size) + # See if a previous wrap_index calls we've analyzed maps from + # the same pair of equivalence class ids for slice and dim size. + if (slice_eq, dim_eq) in equiv_set.wrap_map: + wrap_ind = equiv_set.wrap_map[(slice_eq, dim_eq)] + require(wrap_ind in equiv_set.ind_to_var) + vs = equiv_set.ind_to_var[wrap_ind] + require(vs != []) + # Return the shape of the variable from the previous wrap_index. + return ArrayAnalysis.AnalyzeResult(shape=(vs[0],)) + else: + # We haven't seen this combination of slice and dim + # equivalence class ids so return a WrapIndexMeta so that + # _analyze_inst can establish the connection to the lhs var. + return ArrayAnalysis.AnalyzeResult( + shape=WrapIndexMeta(slice_eq, dim_eq) + ) + + def _analyze_numpy_create_array(self, scope, equiv_set, loc, args, kws): + shape_var = None + if len(args) > 0: + shape_var = args[0] + elif "shape" in kws: + shape_var = kws["shape"] + if shape_var: + return ArrayAnalysis.AnalyzeResult(shape=shape_var) + raise errors.UnsupportedRewriteError( + "Must specify a shape for array creation", + loc=loc, + ) + + def _analyze_op_call_numpy_empty(self, scope, equiv_set, loc, args, kws): + return self._analyze_numpy_create_array( + scope, equiv_set, loc, args, kws + ) + + def _analyze_op_call_numba_np_unsafe_ndarray_empty_inferred( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_numpy_create_array( + scope, equiv_set, loc, args, kws + ) + + def _analyze_op_call_numpy_zeros(self, scope, equiv_set, loc, args, kws): + return self._analyze_numpy_create_array( + scope, equiv_set, loc, args, kws + ) + + def _analyze_op_call_numpy_ones(self, scope, equiv_set, loc, args, kws): + return self._analyze_numpy_create_array( + scope, equiv_set, loc, args, kws + ) + + def _analyze_op_call_numpy_eye(self, scope, equiv_set, loc, args, kws): + if len(args) > 0: + N = args[0] + elif "N" in kws: + N = kws["N"] + else: + raise errors.UnsupportedRewriteError( + "Expect one argument (or 'N') to eye function", + loc=loc, + ) + if "M" in kws: + M = kws["M"] + else: + M = N + return ArrayAnalysis.AnalyzeResult(shape=(N, M)) + + def _analyze_op_call_numpy_identity( + self, scope, equiv_set, loc, args, kws + ): + assert len(args) > 0 + N = args[0] + return ArrayAnalysis.AnalyzeResult(shape=(N, N)) + + def _analyze_op_call_numpy_diag(self, scope, equiv_set, loc, args, kws): + # We can only reason about the output shape when the input is 1D or + # square 2D. + assert len(args) > 0 + a = args[0] + assert isinstance(a, ir.Var) + atyp = self.typemap[a.name] + if isinstance(atyp, types.ArrayCompatible): + if atyp.ndim == 2: + if "k" in kws: # will proceed only when k = 0 or absent + k = kws["k"] + if not equiv_set.is_equiv(k, 0): + return None + (m, n) = equiv_set._get_shape(a) + if equiv_set.is_equiv(m, n): + return ArrayAnalysis.AnalyzeResult(shape=(m,)) + elif atyp.ndim == 1: + (m,) = equiv_set._get_shape(a) + return ArrayAnalysis.AnalyzeResult(shape=(m, m)) + return None + + def _analyze_numpy_array_like(self, scope, equiv_set, args, kws): + assert len(args) > 0 + var = args[0] + typ = self.typemap[var.name] + if isinstance(typ, types.Integer): + return ArrayAnalysis.AnalyzeResult(shape=(1,)) + elif isinstance(typ, types.ArrayCompatible) and equiv_set.has_shape( + var + ): + return ArrayAnalysis.AnalyzeResult(shape=var) + return None + + def _analyze_op_call_numpy_ravel(self, scope, equiv_set, loc, args, kws): + assert len(args) == 1 + var = args[0] + typ = self.typemap[var.name] + assert isinstance(typ, types.ArrayCompatible) + # output array is same shape as input if input is 1D + if typ.ndim == 1 and equiv_set.has_shape(var): + if typ.layout == "C": + # output is the same as input (no copy) for 'C' layout + # optimize out the call + return ArrayAnalysis.AnalyzeResult(shape=var, rhs=var) + else: + return ArrayAnalysis.AnalyzeResult(shape=var) + # TODO: handle multi-D input arrays (calc array size) + return None + + def _analyze_op_call_numpy_copy(self, scope, equiv_set, loc, args, kws): + return self._analyze_numpy_array_like(scope, equiv_set, args, kws) + + def _analyze_op_call_numpy_empty_like( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_numpy_array_like(scope, equiv_set, args, kws) + + def _analyze_op_call_numpy_zeros_like( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_numpy_array_like(scope, equiv_set, args, kws) + + def _analyze_op_call_numpy_ones_like( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_numpy_array_like(scope, equiv_set, args, kws) + + def _analyze_op_call_numpy_full_like( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_numpy_array_like(scope, equiv_set, args, kws) + + def _analyze_op_call_numpy_asfortranarray( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_numpy_array_like(scope, equiv_set, args, kws) + + def _analyze_op_call_numpy_reshape(self, scope, equiv_set, loc, args, kws): + n = len(args) + assert n > 1 + if n == 2: + typ = self.typemap[args[1].name] + if isinstance(typ, types.BaseTuple): + return ArrayAnalysis.AnalyzeResult(shape=args[1]) + + # Reshape is allowed to take one argument that has the value <0. + # This means that the size of that dimension should be inferred from + # the size of the array being reshaped and the other dimensions + # specified. Our general approach here is to see if the reshape + # has any <0 arguments. If it has more than one then throw a + # ValueError. If exactly one <0 argument is found, remember its + # argument index. + stmts = [] + neg_one_index = -1 + for arg_index in range(1, len(args)): + reshape_arg = args[arg_index] + reshape_arg_def = guard(get_definition, self.func_ir, reshape_arg) + if isinstance(reshape_arg_def, ir.Const): + if reshape_arg_def.value < 0: + if neg_one_index == -1: + neg_one_index = arg_index + else: + msg = ("The reshape API may only include one negative" + " argument.") + raise errors.UnsupportedRewriteError( + msg, loc=reshape_arg.loc + ) + + if neg_one_index >= 0: + # If exactly one <0 argument to reshape was found, then we are + # going to insert code to calculate the missing dimension and then + # replace the negative with the calculated size. We do this + # because we can't let array equivalence analysis think that some + # array has a negative dimension size. + loc = args[0].loc + # Create a variable to hold the size of the array being reshaped. + calc_size_var = ir.Var(scope, mk_unique_var("calc_size_var"), loc) + self.typemap[calc_size_var.name] = types.intp + # Assign the size of the array calc_size_var. + init_calc_var = ir.Assign( + ir.Expr.getattr(args[0], "size", loc), calc_size_var, loc + ) + stmts.append(init_calc_var) + # For each other dimension, divide the current size by the + # specified dimension size. Once all such dimensions have been + # done then what is left is the size of the negative dimension. + for arg_index in range(1, len(args)): + # Skip the negative dimension. + if arg_index == neg_one_index: + continue + div_calc_size_var = ir.Var( + scope, mk_unique_var("calc_size_var"), loc + ) + self.typemap[div_calc_size_var.name] = types.intp + # Calculate the next size as current size // the current arg's + # dimension size. + new_binop = ir.Expr.binop( + operator.floordiv, calc_size_var, args[arg_index], loc + ) + div_calc = ir.Assign(new_binop, div_calc_size_var, loc) + self.calltypes[new_binop] = signature( + types.intp, types.intp, types.intp + ) + stmts.append(div_calc) + calc_size_var = div_calc_size_var + # Put the calculated value back into the reshape arguments, + # replacing the negative. + args[neg_one_index] = calc_size_var + + return ArrayAnalysis.AnalyzeResult(shape=tuple(args[1:]), pre=stmts) + + def _analyze_op_call_numpy_transpose( + self, scope, equiv_set, loc, args, kws + ): + in_arr = args[0] + typ = self.typemap[in_arr.name] + assert isinstance( + typ, types.ArrayCompatible + ), "Invalid np.transpose argument" + shape = equiv_set._get_shape(in_arr) + if len(args) == 1: + return ArrayAnalysis.AnalyzeResult(shape=tuple(reversed(shape))) + axes = [guard(find_const, self.func_ir, a) for a in args[1:]] + if isinstance(axes[0], tuple): + axes = list(axes[0]) + if None in axes: + return None + ret = [shape[i] for i in axes] + return ArrayAnalysis.AnalyzeResult(shape=tuple(ret)) + + def _analyze_op_call_numpy_random_rand( + self, scope, equiv_set, loc, args, kws + ): + if len(args) > 0: + return ArrayAnalysis.AnalyzeResult(shape=tuple(args)) + return None + + def _analyze_op_call_numpy_random_randn( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_call_numpy_random_rand( + scope, equiv_set, loc, args, kws + ) + + def _analyze_op_numpy_random_with_size( + self, pos, scope, equiv_set, args, kws + ): + if "size" in kws: + return ArrayAnalysis.AnalyzeResult(shape=kws["size"]) + if len(args) > pos: + return ArrayAnalysis.AnalyzeResult(shape=args[pos]) + return None + + def _analyze_op_call_numpy_random_ranf( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 0, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_random_sample( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 0, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_sample( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 0, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_random( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 0, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_standard_normal( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 0, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_chisquare( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 1, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_weibull( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 1, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_power( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 1, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_geometric( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 1, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_exponential( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 1, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_poisson( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 1, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_rayleigh( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 1, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_normal( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 2, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_uniform( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 2, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_beta( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 2, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_binomial( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 2, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_f( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 2, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_gamma( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 2, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_lognormal( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 2, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_laplace( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 2, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_randint( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 2, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_random_triangular( + self, scope, equiv_set, loc, args, kws + ): + return self._analyze_op_numpy_random_with_size( + 3, scope, equiv_set, args, kws + ) + + def _analyze_op_call_numpy_concatenate( + self, scope, equiv_set, loc, args, kws + ): + assert len(args) > 0 + loc = args[0].loc + seq, op = find_build_sequence(self.func_ir, args[0]) + n = len(seq) + require(n > 0) + axis = 0 + if "axis" in kws: + if isinstance(kws["axis"], int): # internal use only + axis = kws["axis"] + else: + axis = find_const(self.func_ir, kws["axis"]) + elif len(args) > 1: + axis = find_const(self.func_ir, args[1]) + require(isinstance(axis, int)) + require(op == "build_tuple") + shapes = [equiv_set._get_shape(x) for x in seq] + if axis < 0: + axis = len(shapes[0]) + axis + require(0 <= axis < len(shapes[0])) + asserts = [] + new_shape = [] + if n == 1: # from one array N-dimension to (N-1)-dimension + shape = shapes[0] + # first size is the count, pop it out of shapes + n = equiv_set.get_equiv_const(shapes[0]) + shape.pop(0) + for i in range(len(shape)): + if i == axis: + m = equiv_set.get_equiv_const(shape[i]) + size = m * n if (m and n) else None + else: + size = self._sum_size(equiv_set, shapes[0]) + new_shape.append(size) + else: # from n arrays N-dimension to N-dimension + for i in range(len(shapes[0])): + if i == axis: + size = self._sum_size( + equiv_set, [shape[i] for shape in shapes] + ) + else: + sizes = [shape[i] for shape in shapes] + asserts.append( + self._call_assert_equiv(scope, loc, equiv_set, sizes) + ) + size = sizes[0] + new_shape.append(size) + return ArrayAnalysis.AnalyzeResult( + shape=tuple(new_shape), + pre=sum(asserts, []) + ) + + def _analyze_op_call_numpy_stack(self, scope, equiv_set, loc, args, kws): + assert len(args) > 0 + loc = args[0].loc + seq, op = find_build_sequence(self.func_ir, args[0]) + n = len(seq) + require(n > 0) + axis = 0 + if "axis" in kws: + if isinstance(kws["axis"], int): # internal use only + axis = kws["axis"] + else: + axis = find_const(self.func_ir, kws["axis"]) + elif len(args) > 1: + axis = find_const(self.func_ir, args[1]) + require(isinstance(axis, int)) + # only build_tuple can give reliable count + require(op == "build_tuple") + shapes = [equiv_set._get_shape(x) for x in seq] + asserts = self._call_assert_equiv(scope, loc, equiv_set, seq) + shape = shapes[0] + if axis < 0: + axis = len(shape) + axis + 1 + require(0 <= axis <= len(shape)) + new_shape = list(shape[0:axis]) + [n] + list(shape[axis:]) + return ArrayAnalysis.AnalyzeResult(shape=tuple(new_shape), pre=asserts) + + def _analyze_op_call_numpy_vstack(self, scope, equiv_set, loc, args, kws): + assert len(args) == 1 + seq, op = find_build_sequence(self.func_ir, args[0]) + n = len(seq) + require(n > 0) + typ = self.typemap[seq[0].name] + require(isinstance(typ, types.ArrayCompatible)) + if typ.ndim < 2: + return self._analyze_op_call_numpy_stack( + scope, equiv_set, loc, args, kws + ) + else: + kws["axis"] = 0 + return self._analyze_op_call_numpy_concatenate( + scope, equiv_set, loc, args, kws + ) + + def _analyze_op_call_numpy_hstack(self, scope, equiv_set, loc, args, kws): + assert len(args) == 1 + seq, op = find_build_sequence(self.func_ir, args[0]) + n = len(seq) + require(n > 0) + typ = self.typemap[seq[0].name] + require(isinstance(typ, types.ArrayCompatible)) + if typ.ndim < 2: + kws["axis"] = 0 + else: + kws["axis"] = 1 + return self._analyze_op_call_numpy_concatenate( + scope, equiv_set, loc, args, kws + ) + + def _analyze_op_call_numpy_dstack(self, scope, equiv_set, loc, args, kws): + assert len(args) == 1 + seq, op = find_build_sequence(self.func_ir, args[0]) + n = len(seq) + require(n > 0) + typ = self.typemap[seq[0].name] + require(isinstance(typ, types.ArrayCompatible)) + if typ.ndim == 1: + kws["axis"] = 1 + result = self._analyze_op_call_numpy_stack( + scope, equiv_set, loc, args, kws + ) + require(result) + result.kwargs['shape'] = tuple([1] + list(result.kwargs['shape'])) + return result + elif typ.ndim == 2: + kws["axis"] = 2 + return self._analyze_op_call_numpy_stack( + scope, equiv_set, loc, args, kws + ) + else: + kws["axis"] = 2 + return self._analyze_op_call_numpy_concatenate( + scope, equiv_set, loc, args, kws + ) + + def _analyze_op_call_numpy_cumsum(self, scope, equiv_set, loc, args, kws): + # TODO + return None + + def _analyze_op_call_numpy_cumprod(self, scope, equiv_set, loc, args, kws): + # TODO + return None + + def _analyze_op_call_numpy_linspace( + self, scope, equiv_set, loc, args, kws + ): + n = len(args) + num = 50 + if n > 2: + num = args[2] + elif "num" in kws: + num = kws["num"] + return ArrayAnalysis.AnalyzeResult(shape=(num,)) + + def _analyze_op_call_numpy_dot(self, scope, equiv_set, loc, args, kws): + n = len(args) + assert n >= 2 + loc = args[0].loc + require(all([self._isarray(x.name) for x in args])) + typs = [self.typemap[x.name] for x in args] + dims = [ty.ndim for ty in typs] + require(all(x > 0 for x in dims)) + if dims[0] == 1 and dims[1] == 1: + return None + shapes = [equiv_set._get_shape(x) for x in args] + if dims[0] == 1: + asserts = self._call_assert_equiv( + scope, loc, equiv_set, [shapes[0][0], shapes[1][-2]] + ) + return ArrayAnalysis.AnalyzeResult( + shape=tuple(shapes[1][0:-2] + shapes[1][-1:]), + pre=asserts + ) + if dims[1] == 1: + asserts = self._call_assert_equiv( + scope, loc, equiv_set, [shapes[0][-1], shapes[1][0]] + ) + return ArrayAnalysis.AnalyzeResult( + shape=tuple(shapes[0][0:-1]), + pre=asserts + ) + if dims[0] == 2 and dims[1] == 2: + asserts = self._call_assert_equiv( + scope, loc, equiv_set, [shapes[0][1], shapes[1][0]] + ) + return ArrayAnalysis.AnalyzeResult( + shape=(shapes[0][0], shapes[1][1]), + pre=asserts + ) + if dims[0] > 2: # TODO: handle higher dimension cases + pass + return None + + def _analyze_stencil(self, scope, equiv_set, stencil_func, loc, args, kws): + # stencil requires that all relatively indexed array arguments are + # of same size + std_idx_arrs = stencil_func.options.get("standard_indexing", ()) + kernel_arg_names = stencil_func.kernel_ir.arg_names + if isinstance(std_idx_arrs, str): + std_idx_arrs = (std_idx_arrs,) + rel_idx_arrs = [] + assert len(args) > 0 and len(args) == len(kernel_arg_names) + for arg, var in zip(kernel_arg_names, args): + typ = self.typemap[var.name] + if isinstance(typ, types.ArrayCompatible) and not ( + arg in std_idx_arrs + ): + rel_idx_arrs.append(var) + n = len(rel_idx_arrs) + require(n > 0) + asserts = self._call_assert_equiv(scope, loc, equiv_set, rel_idx_arrs) + shape = equiv_set.get_shape(rel_idx_arrs[0]) + return ArrayAnalysis.AnalyzeResult(shape=shape, pre=asserts) + + def _analyze_op_call_numpy_linalg_inv( + self, scope, equiv_set, loc, args, kws + ): + require(len(args) >= 1) + return ArrayAnalysis.AnalyzeResult(shape=equiv_set._get_shape(args[0])) + + def _analyze_broadcast(self, scope, equiv_set, loc, args, fn): + """Infer shape equivalence of arguments based on Numpy broadcast rules + and return shape of output + https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html + """ + tups = list(filter(lambda a: self._istuple(a.name), args)) + # Here we have a tuple concatenation. + if len(tups) == 2 and fn.__name__ == 'add': + # If either of the tuples is empty then the resulting shape + # is just the other tuple. + tup0typ = self.typemap[tups[0].name] + tup1typ = self.typemap[tups[1].name] + if tup0typ.count == 0: + return ArrayAnalysis.AnalyzeResult( + shape=equiv_set.get_shape(tups[1]) + ) + if tup1typ.count == 0: + return ArrayAnalysis.AnalyzeResult( + shape=equiv_set.get_shape(tups[0]) + ) + + try: + shapes = [equiv_set.get_shape(x) for x in tups] + if None in shapes: + return None + concat_shapes = sum(shapes, ()) + return ArrayAnalysis.AnalyzeResult( + shape=concat_shapes + ) + except GuardException: + return None + + # else arrays + arrs = list(filter(lambda a: self._isarray(a.name), args)) + require(len(arrs) > 0) + names = [x.name for x in arrs] + dims = [self.typemap[x.name].ndim for x in arrs] + max_dim = max(dims) + require(max_dim > 0) + try: + shapes = [equiv_set.get_shape(x) for x in arrs] + except GuardException: + return ArrayAnalysis.AnalyzeResult( + shape=arrs[0], + pre=self._call_assert_equiv(scope, loc, equiv_set, arrs) + ) + pre = [] + if None in shapes: + # There is at least 1 shape that we don't know, + # so we need to generate that shape now. + new_shapes = [] + for i, s in enumerate(shapes): + if s is None: + var = arrs[i] + typ = self.typemap[var.name] + shape = self._gen_shape_call( + equiv_set, var, typ.ndim, None, pre + ) + new_shapes.append(shape) + else: + new_shapes.append(s) + shapes = new_shapes + + result = self._broadcast_assert_shapes( + scope, equiv_set, loc, shapes, names + ) + if pre: + # If we had to generate a shape we have to insert + # that code before the broadcast assertion. + if 'pre' in result.kwargs: + prev_pre = result.kwargs['pre'] + else: + prev_pre = [] + result.kwargs['pre'] = pre + prev_pre + return result + + def _broadcast_assert_shapes(self, scope, equiv_set, loc, shapes, names): + """Produce assert_equiv for sizes in each dimension, taking into + account of dimension coercion and constant size of 1. + """ + asserts = [] + new_shape = [] + max_dim = max([len(shape) for shape in shapes]) + const_size_one = None + for i in range(max_dim): + sizes = [] + size_names = [] + for name, shape in zip(names, shapes): + if i < len(shape): + size = shape[len(shape) - 1 - i] + const_size = equiv_set.get_equiv_const(size) + if const_size == 1: + const_size_one = size + else: + sizes.append(size) # non-1 size to front + size_names.append(name) + if sizes == []: + assert const_size_one is not None + sizes.append(const_size_one) + size_names.append("1") + asserts.append( + self._call_assert_equiv( + scope, loc, equiv_set, sizes, names=size_names + ) + ) + new_shape.append(sizes[0]) + return ArrayAnalysis.AnalyzeResult( + shape=tuple(reversed(new_shape)), + pre=sum(asserts, []) + ) + + def _call_assert_equiv(self, scope, loc, equiv_set, args, names=None): + insts = self._make_assert_equiv( + scope, loc, equiv_set, args, names=names + ) + if len(args) > 1: + equiv_set.insert_equiv(*args) + return insts + + def _make_assert_equiv(self, scope, loc, equiv_set, _args, names=None): + # filter out those that are already equivalent + if config.DEBUG_ARRAY_OPT >= 2: + print("make_assert_equiv:", _args, names) + if names is None: + names = [x.name for x in _args] + args = [] + arg_names = [] + for name, x in zip(names, _args): + if config.DEBUG_ARRAY_OPT >= 2: + print("name, x:", name, x) + seen = False + for y in args: + if config.DEBUG_ARRAY_OPT >= 2: + print("is equiv to?", y, equiv_set.is_equiv(x, y)) + if equiv_set.is_equiv(x, y): + seen = True + break + if not seen: + args.append(x) + arg_names.append(name) + + # no assertion necessary if there are less than two + if len(args) < 2: + if config.DEBUG_ARRAY_OPT >= 2: + print( + "Will not insert assert_equiv as args are known to be " + "equivalent." + ) + return [] + + msg = "Sizes of {} do not match on {}".format( + ", ".join(arg_names), loc + ) + msg_val = ir.Const(msg, loc) + msg_typ = types.StringLiteral(msg) + msg_var = ir.Var(scope, mk_unique_var("msg"), loc) + self.typemap[msg_var.name] = msg_typ + argtyps = tuple([msg_typ] + [self.typemap[x.name] for x in args]) + + # assert_equiv takes vararg, which requires a tuple as argument type + tup_typ = types.StarArgTuple.from_types(argtyps) + + # prepare function variable whose type may vary since it takes vararg + assert_var = ir.Var(scope, mk_unique_var("assert"), loc) + assert_def = ir.Global("assert_equiv", assert_equiv, loc=loc) + fnty = get_global_func_typ(assert_equiv) + sig = self.context.resolve_function_type(fnty, (tup_typ,), {}) + self._define(equiv_set, assert_var, fnty, assert_def) + + # The return value from assert_equiv is always of none type. + var = ir.Var(scope, mk_unique_var("ret"), loc) + value = ir.Expr.call(assert_var, [msg_var] + args, {}, loc=loc) + self._define(equiv_set, var, types.none, value) + self.calltypes[value] = sig + + return [ + ir.Assign(value=msg_val, target=msg_var, loc=loc), + ir.Assign(value=assert_def, target=assert_var, loc=loc), + ir.Assign(value=value, target=var, loc=loc), + ] + + def _gen_shape_call(self, equiv_set, var, ndims, shape, post): + # attr call: A_sh_attr = getattr(A, shape) + if isinstance(shape, ir.Var): + shape = equiv_set.get_shape(shape) + + # already a tuple variable that contains size + if isinstance(shape, ir.Var): + attr_var = shape + shape_attr_call = None + shape = None + elif isinstance(shape, ir.Arg): + attr_var = var + shape_attr_call = None + shape = None + else: + shape_attr_call = ir.Expr.getattr(var, "shape", var.loc) + attr_var = ir.Var( + var.scope, mk_unique_var("{}_shape".format(var.name)), var.loc + ) + shape_attr_typ = types.containers.UniTuple(types.intp, ndims) + size_vars = [] + use_attr_var = False + # trim shape tuple if it is more than ndim + if shape: + nshapes = len(shape) + if ndims < nshapes: + shape = shape[(nshapes - ndims) :] + for i in range(ndims): + skip = False + if shape and shape[i]: + if isinstance(shape[i], ir.Var): + typ = self.typemap[shape[i].name] + if isinstance(typ, (types.Number, types.SliceType)): + size_var = shape[i] + skip = True + else: + if isinstance(shape[i], int): + size_val = ir.Const(shape[i], var.loc) + else: + size_val = shape[i] + assert isinstance(size_val, ir.Const) + size_var = ir.Var( + var.scope, + mk_unique_var("{}_size{}".format(var.name, i)), + var.loc, + ) + post.append(ir.Assign(size_val, size_var, var.loc)) + self._define(equiv_set, size_var, types.intp, size_val) + skip = True + if not skip: + # get size: Asize0 = A_sh_attr[0] + size_var = ir.Var( + var.scope, + mk_unique_var("{}_size{}".format(var.name, i)), + var.loc, + ) + getitem = ir.Expr.static_getitem(attr_var, i, None, var.loc) + use_attr_var = True + self.calltypes[getitem] = None + post.append(ir.Assign(getitem, size_var, var.loc)) + self._define(equiv_set, size_var, types.intp, getitem) + size_vars.append(size_var) + if use_attr_var and shape_attr_call: + # only insert shape call if there is any getitem call + post.insert(0, ir.Assign(shape_attr_call, attr_var, var.loc)) + self._define(equiv_set, attr_var, shape_attr_typ, shape_attr_call) + return tuple(size_vars) + + def _isarray(self, varname): + typ = self.typemap[varname] + return isinstance(typ, types.npytypes.Array) and typ.ndim > 0 + + def _istuple(self, varname): + typ = self.typemap[varname] + return isinstance(typ, types.BaseTuple) + + def _sum_size(self, equiv_set, sizes): + """Return the sum of the given list of sizes if they are all equivalent + to some constant, or None otherwise. + """ + s = 0 + for size in sizes: + n = equiv_set.get_equiv_const(size) + if n is None: + return None + else: + s += n + return s + + +UNARY_MAP_OP = list(npydecl.NumpyRulesUnaryArrayOperator._op_map.keys()) + [ + operator.pos +] +BINARY_MAP_OP = npydecl.NumpyRulesArrayOperator._op_map.keys() +INPLACE_BINARY_MAP_OP = npydecl.NumpyRulesInplaceArrayOperator._op_map.keys() +UFUNC_MAP_OP = [f.__name__ for f in npydecl.supported_ufuncs] diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/parfor.py b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/parfor.py new file mode 100644 index 0000000000000000000000000000000000000000..3c71d4c3f201980b743181cc7d39f1a70739b28e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/parfor.py @@ -0,0 +1,5249 @@ +# +# Copyright (c) 2017 Intel Corporation +# SPDX-License-Identifier: BSD-2-Clause +# + +""" +This module transforms data-parallel operations such as Numpy calls into +'Parfor' nodes, which are nested loops that can be parallelized. +It also implements optimizations such as loop fusion, and extends the rest of +compiler analysis and optimizations to support Parfors. +This is similar to ParallelAccelerator package in Julia: +https://github.com/IntelLabs/ParallelAccelerator.jl +'Parallelizing Julia with a Non-invasive DSL', T. Anderson et al., ECOOP'17. +""" +import types as pytypes # avoid confusion with numba.types +import sys, math +import os +import textwrap +import copy +import inspect +import linecache +from functools import reduce +from collections import defaultdict, OrderedDict, namedtuple +from contextlib import contextmanager +import operator +from dataclasses import make_dataclass +import warnings + +from llvmlite import ir as lir +from numba.core.imputils import impl_ret_untracked +import numba.core.ir +from numba.core import types, typing, utils, errors, ir, analysis, postproc, rewrites, typeinfer, config, ir_utils +from numba import prange, pndindex +from numba.np.npdatetime_helpers import datetime_minimum, datetime_maximum +from numba.np.numpy_support import as_dtype, numpy_version +from numba.core.typing.templates import infer_global, AbstractTemplate +from numba.stencils.stencilparfor import StencilPass +from numba.core.extending import register_jitable, lower_builtin + +from numba.core.ir_utils import ( + mk_unique_var, + next_label, + mk_alloc, + get_np_ufunc_typ, + mk_range_block, + mk_loop_header, + get_name_var_table, + replace_vars, + replace_vars_inner, + visit_vars, + visit_vars_inner, + remove_dead, + copy_propagate, + get_block_copies, + apply_copy_propagate, + dprint_func_ir, + find_topo_order, + get_stmt_writes, + rename_labels, + get_call_table, + simplify, + simplify_CFG, + has_no_side_effect, + canonicalize_array_math, + add_offset_to_labels, + find_callname, + find_build_sequence, + guard, + require, + GuardException, + compile_to_numba_ir, + get_definition, + build_definitions, + replace_arg_nodes, + replace_returns, + is_getitem, + is_setitem, + is_get_setitem, + index_var_of_get_setitem, + set_index_var_of_get_setitem, + find_potential_aliases, + replace_var_names, + transfer_scope, +) + +from numba.core.analysis import (compute_use_defs, compute_live_map, + compute_dead_maps, compute_cfg_from_blocks) +from numba.core.controlflow import CFGraph +from numba.core.typing import npydecl, signature +from numba.core.types.functions import Function +from numba.parfors.array_analysis import (random_int_args, random_1arg_size, + random_2arg_sizelast, random_3arg_sizelast, + random_calls, assert_equiv) +from numba.core.extending import overload +import copy +import numpy +import numpy as np +from numba.parfors import array_analysis +import numba.cpython.builtins +from numba.stencils import stencilparfor +# circular dependency: import numba.npyufunc.dufunc.DUFunc + +# wrapped pretty print +_termwidth = 80 +_txtwrapper = textwrap.TextWrapper(width=_termwidth, drop_whitespace=False) +def print_wrapped(x): + for l in x.splitlines(): + [print(y) for y in _txtwrapper.wrap(l)] + +sequential_parfor_lowering = False + +# init_prange is a sentinel call that specifies the start of the initialization +# code for the computation in the upcoming prange call +# This lets the prange pass to put the code in the generated parfor's init_block +def init_prange(): + return + +@overload(init_prange) +def init_prange_overload(): + def no_op(): + return + return no_op + +class internal_prange(object): + + def __new__(cls, *args): + return range(*args) + + +def min_parallel_impl(return_type, arg): + # XXX: use prange for 1D arrays since pndindex returns a 1-tuple instead of + # integer. This causes type and fusion issues. + if arg.ndim == 0: + def min_1(in_arr): + return in_arr[()] + elif arg.ndim == 1: + if isinstance(arg.dtype, (types.NPDatetime, types.NPTimedelta)): + # NaT is always returned if it is in the array + def min_1(in_arr): + numba.parfors.parfor.init_prange() + min_checker(len(in_arr)) + val = numba.cpython.builtins.get_type_max_value(in_arr.dtype) + for i in numba.parfors.parfor.internal_prange(len(in_arr)): + val = datetime_minimum(val, in_arr[i]) + return val + else: + def min_1(in_arr): + numba.parfors.parfor.init_prange() + min_checker(len(in_arr)) + val = numba.cpython.builtins.get_type_max_value(in_arr.dtype) + for i in numba.parfors.parfor.internal_prange(len(in_arr)): + val = min(val, in_arr[i]) + return val + else: + def min_1(in_arr): + numba.parfors.parfor.init_prange() + min_checker(len(in_arr)) + val = numba.cpython.builtins.get_type_max_value(in_arr.dtype) + for i in numba.pndindex(in_arr.shape): + val = min(val, in_arr[i]) + return val + return min_1 + +def max_parallel_impl(return_type, arg): + if arg.ndim == 0: + def max_1(in_arr): + return in_arr[()] + elif arg.ndim == 1: + if isinstance(arg.dtype, (types.NPDatetime, types.NPTimedelta)): + # NaT is always returned if it is in the array + def max_1(in_arr): + numba.parfors.parfor.init_prange() + max_checker(len(in_arr)) + val = numba.cpython.builtins.get_type_min_value(in_arr.dtype) + for i in numba.parfors.parfor.internal_prange(len(in_arr)): + val = datetime_maximum(val, in_arr[i]) + return val + else: + def max_1(in_arr): + numba.parfors.parfor.init_prange() + max_checker(len(in_arr)) + val = numba.cpython.builtins.get_type_min_value(in_arr.dtype) + for i in numba.parfors.parfor.internal_prange(len(in_arr)): + val = max(val, in_arr[i]) + return val + else: + def max_1(in_arr): + numba.parfors.parfor.init_prange() + max_checker(len(in_arr)) + val = numba.cpython.builtins.get_type_min_value(in_arr.dtype) + for i in numba.pndindex(in_arr.shape): + val = max(val, in_arr[i]) + return val + return max_1 + +def argmin_parallel_impl(in_arr): + numba.parfors.parfor.init_prange() + argmin_checker(len(in_arr)) + A = in_arr.ravel() + init_val = numba.cpython.builtins.get_type_max_value(A.dtype) + ival = typing.builtins.IndexValue(0, init_val) + for i in numba.parfors.parfor.internal_prange(len(A)): + curr_ival = typing.builtins.IndexValue(i, A[i]) + ival = min(ival, curr_ival) + return ival.index + +def argmax_parallel_impl(in_arr): + numba.parfors.parfor.init_prange() + argmax_checker(len(in_arr)) + A = in_arr.ravel() + init_val = numba.cpython.builtins.get_type_min_value(A.dtype) + ival = typing.builtins.IndexValue(0, init_val) + for i in numba.parfors.parfor.internal_prange(len(A)): + curr_ival = typing.builtins.IndexValue(i, A[i]) + ival = max(ival, curr_ival) + return ival.index + +def dotvv_parallel_impl(a, b): + numba.parfors.parfor.init_prange() + l = a.shape[0] + m = b.shape[0] + # TODO: investigate assert_equiv + #assert_equiv("sizes of l, m do not match", l, m) + s = 0 + for i in numba.parfors.parfor.internal_prange(l): + s += a[i] * b[i] + return s + +def dotvm_parallel_impl(a, b): + numba.parfors.parfor.init_prange() + l = a.shape + m, n = b.shape + # TODO: investigate assert_equiv + #assert_equiv("Sizes of l, m do not match", l, m) + c = np.zeros(n, a.dtype) + # TODO: evaluate dotvm implementation options + #for i in prange(n): + # s = 0 + # for j in range(m): + # s += a[j] * b[j, i] + # c[i] = s + for i in numba.parfors.parfor.internal_prange(m): + c += a[i] * b[i, :] + return c + +def dotmv_parallel_impl(a, b): + numba.parfors.parfor.init_prange() + m, n = a.shape + l = b.shape + # TODO: investigate assert_equiv + #assert_equiv("sizes of n, l do not match", n, l) + c = np.empty(m, a.dtype) + for i in numba.parfors.parfor.internal_prange(m): + s = 0 + for j in range(n): + s += a[i, j] * b[j] + c[i] = s + return c + +def dot_parallel_impl(return_type, atyp, btyp): + # Note that matrix matrix multiply is not translated. + if (isinstance(atyp, types.npytypes.Array) and + isinstance(btyp, types.npytypes.Array)): + if atyp.ndim == btyp.ndim == 1: + return dotvv_parallel_impl + # TODO: evaluate support for dotvm and enable + #elif atyp.ndim == 1 and btyp.ndim == 2: + # return dotvm_parallel_impl + elif atyp.ndim == 2 and btyp.ndim == 1: + return dotmv_parallel_impl + +def sum_parallel_impl(return_type, arg): + zero = return_type(0) + + if arg.ndim == 0: + def sum_1(in_arr): + return in_arr[()] + elif arg.ndim == 1: + def sum_1(in_arr): + numba.parfors.parfor.init_prange() + val = zero + for i in numba.parfors.parfor.internal_prange(len(in_arr)): + val += in_arr[i] + return val + else: + def sum_1(in_arr): + numba.parfors.parfor.init_prange() + val = zero + for i in numba.pndindex(in_arr.shape): + val += in_arr[i] + return val + return sum_1 + +def prod_parallel_impl(return_type, arg): + one = return_type(1) + + if arg.ndim == 0: + def prod_1(in_arr): + return in_arr[()] + elif arg.ndim == 1: + def prod_1(in_arr): + numba.parfors.parfor.init_prange() + val = one + for i in numba.parfors.parfor.internal_prange(len(in_arr)): + val *= in_arr[i] + return val + else: + def prod_1(in_arr): + numba.parfors.parfor.init_prange() + val = one + for i in numba.pndindex(in_arr.shape): + val *= in_arr[i] + return val + return prod_1 + + +def mean_parallel_impl(return_type, arg): + # can't reuse sum since output type is different + zero = return_type(0) + + if arg.ndim == 0: + def mean_1(in_arr): + return in_arr[()] + elif arg.ndim == 1: + def mean_1(in_arr): + numba.parfors.parfor.init_prange() + val = zero + for i in numba.parfors.parfor.internal_prange(len(in_arr)): + val += in_arr[i] + return val/len(in_arr) + else: + def mean_1(in_arr): + numba.parfors.parfor.init_prange() + val = zero + for i in numba.pndindex(in_arr.shape): + val += in_arr[i] + return val/in_arr.size + return mean_1 + +def var_parallel_impl(return_type, arg): + if arg.ndim == 0: + def var_1(in_arr): + return 0 + elif arg.ndim == 1: + def var_1(in_arr): + # Compute the mean + m = in_arr.mean() + # Compute the sum of square diffs + numba.parfors.parfor.init_prange() + ssd = 0 + for i in numba.parfors.parfor.internal_prange(len(in_arr)): + val = in_arr[i] - m + ssd += np.real(val * np.conj(val)) + return ssd / len(in_arr) + else: + def var_1(in_arr): + # Compute the mean + m = in_arr.mean() + # Compute the sum of square diffs + numba.parfors.parfor.init_prange() + ssd = 0 + for i in numba.pndindex(in_arr.shape): + val = in_arr[i] - m + ssd += np.real(val * np.conj(val)) + return ssd / in_arr.size + return var_1 + +def std_parallel_impl(return_type, arg): + def std_1(in_arr): + return in_arr.var() ** 0.5 + return std_1 + +def arange_parallel_impl(return_type, *args, dtype=None): + inferred_dtype = as_dtype(return_type.dtype) + + def arange_1(stop): + return np.arange(0, stop, 1, inferred_dtype) + + def arange_1_dtype(stop, dtype): + return np.arange(0, stop, 1, dtype) + + def arange_2(start, stop): + return np.arange(start, stop, 1, inferred_dtype) + + def arange_2_dtype(start, stop, dtype): + return np.arange(start, stop, 1, dtype) + + def arange_3(start, stop, step): + return np.arange(start, stop, step, inferred_dtype) + + def arange_3_dtype(start, stop, step, dtype): + return np.arange(start, stop, step, dtype) + + if any(isinstance(a, types.Complex) for a in args): + def arange_4(start, stop, step, dtype): + numba.parfors.parfor.init_prange() + nitems_c = (stop - start) / step + nitems_r = math.ceil(nitems_c.real) + nitems_i = math.ceil(nitems_c.imag) + nitems = int(max(min(nitems_i, nitems_r), 0)) + arr = np.empty(nitems, dtype) + for i in numba.parfors.parfor.internal_prange(nitems): + arr[i] = start + i * step + return arr + else: + def arange_4(start, stop, step, dtype): + numba.parfors.parfor.init_prange() + nitems_r = math.ceil((stop - start) / step) + nitems = int(max(nitems_r, 0)) + arr = np.empty(nitems, dtype) + val = start + for i in numba.parfors.parfor.internal_prange(nitems): + arr[i] = start + i * step + return arr + + if len(args) == 1: + return arange_1 if dtype is None else arange_1_dtype + elif len(args) == 2: + return arange_2 if dtype is None else arange_2_dtype + elif len(args) == 3: + return arange_3 if dtype is None else arange_3_dtype + elif len(args) == 4: + return arange_4 + else: + raise ValueError("parallel arange with types {}".format(args)) + +def linspace_parallel_impl(return_type, *args): + dtype = as_dtype(return_type.dtype) + + def linspace_2(start, stop): + return np.linspace(start, stop, 50) + + def linspace_3(start, stop, num): + numba.parfors.parfor.init_prange() + arr = np.empty(num, dtype) + div = num - 1 + delta = stop - start + arr[0] = start + for i in numba.parfors.parfor.internal_prange(num): + arr[i] = start + delta * (i / div) + return arr + + if len(args) == 2: + return linspace_2 + elif len(args) == 3: + return linspace_3 + else: + raise ValueError("parallel linspace with types {}".format(args)) + +swap_functions_map = { + ('argmin', 'numpy'): lambda r,a: argmin_parallel_impl, + ('argmax', 'numpy'): lambda r,a: argmax_parallel_impl, + ('min', 'numpy'): min_parallel_impl, + ('max', 'numpy'): max_parallel_impl, + ('amin', 'numpy'): min_parallel_impl, + ('amax', 'numpy'): max_parallel_impl, + ('sum', 'numpy'): sum_parallel_impl, + ('prod', 'numpy'): prod_parallel_impl, + ('mean', 'numpy'): mean_parallel_impl, + ('var', 'numpy'): var_parallel_impl, + ('std', 'numpy'): std_parallel_impl, + ('dot', 'numpy'): dot_parallel_impl, + ('arange', 'numpy'): arange_parallel_impl, + ('linspace', 'numpy'): linspace_parallel_impl, +} + +def fill_parallel_impl(return_type, arr, val): + """Parallel implementation of ndarray.fill. The array on + which to operate is retrieved from get_call_name and + is passed along with the value to fill. + """ + if arr.ndim == 1: + def fill_1(in_arr, val): + numba.parfors.parfor.init_prange() + for i in numba.parfors.parfor.internal_prange(len(in_arr)): + in_arr[i] = val + return None + else: + def fill_1(in_arr, val): + numba.parfors.parfor.init_prange() + for i in numba.pndindex(in_arr.shape): + in_arr[i] = val + return None + return fill_1 + +replace_functions_ndarray = { + 'fill': fill_parallel_impl, +} + +@register_jitable +def max_checker(arr_size): + if arr_size == 0: + raise ValueError(("zero-size array to reduction operation " + "maximum which has no identity")) + +@register_jitable +def min_checker(arr_size): + if arr_size == 0: + raise ValueError(("zero-size array to reduction operation " + "minimum which has no identity")) + +@register_jitable +def argmin_checker(arr_size): + if arr_size == 0: + raise ValueError("attempt to get argmin of an empty sequence") + +@register_jitable +def argmax_checker(arr_size): + if arr_size == 0: + raise ValueError("attempt to get argmax of an empty sequence") + +checker_impl = namedtuple('checker_impl', ['name', 'func']) + +replace_functions_checkers_map = { + ('argmin', 'numpy') : checker_impl('argmin_checker', argmin_checker), + ('argmax', 'numpy') : checker_impl('argmax_checker', argmax_checker), + ('min', 'numpy') : checker_impl('min_checker', min_checker), + ('max', 'numpy') : checker_impl('max_checker', max_checker), + ('amin', 'numpy') : checker_impl('min_checker', min_checker), + ('amax', 'numpy') : checker_impl('max_checker', max_checker), +} + + +class LoopNest(object): + + '''The LoopNest class holds information of a single loop including + the index variable (of a non-negative integer value), and the + range variable, e.g. range(r) is 0 to r-1 with step size 1. + ''' + + def __init__(self, index_variable, start, stop, step): + self.index_variable = index_variable + self.start = start + self.stop = stop + self.step = step + + + def __repr__(self): + return ("LoopNest(index_variable = {}, range = ({}, {}, {}))". + format(self.index_variable, self.start, self.stop, self.step)) + + def list_vars(self): + all_uses = [] + all_uses.append(self.index_variable) + if isinstance(self.start, ir.Var): + all_uses.append(self.start) + if isinstance(self.stop, ir.Var): + all_uses.append(self.stop) + if isinstance(self.step, ir.Var): + all_uses.append(self.step) + return all_uses + +class Parfor(ir.Expr, ir.Stmt): + + id_counter = 0 + + def __init__( + self, + loop_nests, + init_block, + loop_body, + loc, + index_var, + equiv_set, + pattern, + flags, + *, #only specify the options below by keyword + no_sequential_lowering=False, + races=set()): + super(Parfor, self).__init__( + op='parfor', + loc=loc + ) + + self.id = type(self).id_counter + type(self).id_counter += 1 + #self.input_info = input_info + #self.output_info = output_info + self.loop_nests = loop_nests + self.init_block = init_block + self.loop_body = loop_body + self.index_var = index_var + self.params = None # filled right before parallel lowering + self.equiv_set = equiv_set + # The parallel patterns this parfor was generated from and their options + # for example, a parfor could be from the stencil pattern with + # the neighborhood option + assert len(pattern) > 1 + self.patterns = [pattern] + self.flags = flags + # if True, this parfor shouldn't be lowered sequentially even with the + # sequential lowering option + self.no_sequential_lowering = no_sequential_lowering + self.races = races + self.redvars = [] + self.reddict = {} + # If the lowerer is None then the standard lowerer will be used. + # This can be set to a function to have that function act as the lowerer + # for this parfor. This lowerer field will also prevent parfors from + # being fused unless they have use the same lowerer. + self.lowerer = None + if config.DEBUG_ARRAY_OPT_STATS: + fmt = 'Parallel for-loop #{} is produced from pattern \'{}\' at {}' + print(fmt.format( + self.id, pattern, loc)) + + def __repr__(self): + return "id=" + str(self.id) + repr(self.loop_nests) + \ + repr(self.loop_body) + repr(self.index_var) + + def get_loop_nest_vars(self): + return [x.index_variable for x in self.loop_nests] + + def list_vars(self): + """list variables used (read/written) in this parfor by + traversing the body and combining block uses. + """ + all_uses = [] + for l, b in self.loop_body.items(): + for stmt in b.body: + all_uses += stmt.list_vars() + + for loop in self.loop_nests: + all_uses += loop.list_vars() + + for stmt in self.init_block.body: + all_uses += stmt.list_vars() + + return all_uses + + def get_shape_classes(self, var, typemap=None): + """get the shape classes for a given variable. + If a typemap is specified then use it for type resolution + """ + # We get shape classes from the equivalence set but that + # keeps its own typemap at a time prior to lowering. So + # if something is added during lowering then we can pass + # in a type map to use. We temporarily replace the + # equivalence set typemap, do the work and then restore + # the original on the way out. + if typemap is not None: + save_typemap = self.equiv_set.typemap + self.equiv_set.typemap = typemap + res = self.equiv_set.get_shape_classes(var) + if typemap is not None: + self.equiv_set.typemap = save_typemap + return res + + def dump(self, file=None): + file = file or sys.stdout + print(("begin parfor {}".format(self.id)).center(20, '-'), file=file) + print("index_var = ", self.index_var, file=file) + print("params = ", self.params, file=file) + print("races = ", self.races, file=file) + for loopnest in self.loop_nests: + print(loopnest, file=file) + print("init block:", file=file) + self.init_block.dump(file) + for offset, block in sorted(self.loop_body.items()): + print('label %s:' % (offset,), file=file) + block.dump(file) + print(("end parfor {}".format(self.id)).center(20, '-'), file=file) + + def validate_params(self, typemap): + """ + Check that Parfors params are of valid types. + """ + if self.params is None: + msg = ("Cannot run parameter validation on a Parfor with params " + "not set") + raise ValueError(msg) + for p in self.params: + ty = typemap.get(p) + if ty is None: + msg = ("Cannot validate parameter %s, there is no type " + "information available") + raise ValueError(msg) + if isinstance(ty, types.BaseTuple): + if ty.count > config.PARFOR_MAX_TUPLE_SIZE: + msg = ("Use of a tuple (%s) of length %d in a parallel region " + "exceeds the maximum supported tuple size. Since " + "Generalized Universal Functions back parallel regions " + "and those do not support tuples, tuples passed to " + "parallel regions are unpacked if their size is below " + "a certain threshold, currently configured to be %d. " + "This threshold can be modified using the Numba " + "environment variable NUMBA_PARFOR_MAX_TUPLE_SIZE.") + raise errors.UnsupportedParforsError(msg % + (p, ty.count, config.PARFOR_MAX_TUPLE_SIZE), + self.loc) + + +def _analyze_parfor(parfor, equiv_set, typemap, array_analysis): + """Recursive array analysis for parfor nodes. + """ + func_ir = array_analysis.func_ir + parfor_blocks = wrap_parfor_blocks(parfor) + # Since init_block get label 0 after wrap, we need to save + # the equivset for the real block label 0. + backup_equivset = array_analysis.equiv_sets.get(0, None) + array_analysis.run(parfor_blocks, equiv_set) + unwrap_parfor_blocks(parfor, parfor_blocks) + parfor.equiv_set = array_analysis.equiv_sets[0] + # Restore equivset for block 0 after parfor is unwrapped + if backup_equivset: + array_analysis.equiv_sets[0] = backup_equivset + return [], [] + +array_analysis.array_analysis_extensions[Parfor] = _analyze_parfor + +class ParforDiagnostics(object): + """Holds parfor diagnostic info, this is accumulated throughout the + PreParforPass and ParforPass, also in the closure inlining! + """ + def __init__(self): + # holds ref to the function for which this is providing diagnostics + self.func = None + # holds a map of the replaced functions + self.replaced_fns = dict() + # used to identify "internal" parfor functions + self.internal_name = '__numba_parfor_gufunc' + self.fusion_info = defaultdict(list) + self.nested_fusion_info = defaultdict(list) + self.fusion_reports = [] + self.hoist_info = {} + self.has_setup = False + + def setup(self, func_ir, fusion_enabled): + self.func_ir = func_ir + self.name = self.func_ir.func_id.func_qualname + self.line = self.func_ir.loc + self.fusion_enabled = fusion_enabled + if self.internal_name in self.name: + self.purpose = 'Internal parallel function' + else: + self.purpose = 'Function %s, %s' % (self.name, self.line) + # we store a reference to the parfors prior to fusion etc, the parfors + # do get mangled in the fusion process but in a predetermined manner + # and by holding a reference here the "before" state can be printed + self.initial_parfors = self.get_parfors() + self.has_setup = True + + @property + def has_setup(self): + return self._has_setup + + @has_setup.setter + def has_setup(self, state): + self._has_setup = state + + def count_parfors(self, blocks=None): + return len(self.get_parfors()) + + def _get_nested_parfors(self, parfor, parfors_list): + blocks = wrap_parfor_blocks(parfor) + self._get_parfors(blocks, parfors_list) + unwrap_parfor_blocks(parfor) + + def _get_parfors(self, blocks, parfors_list): + for label, blk in blocks.items(): + for stmt in blk.body: + if isinstance(stmt, Parfor): + parfors_list.append(stmt) + self._get_nested_parfors(stmt, parfors_list) + + def get_parfors(self): + parfors_list = [] + self._get_parfors(self.func_ir.blocks, parfors_list) + return parfors_list + + def hoisted_allocations(self): + allocs = [] + for pf_id, data in self.hoist_info.items(): + stmt = data.get('hoisted', []) + for inst in stmt: + if isinstance(inst.value, ir.Expr): + if inst.value.op == 'call': + call = guard(find_callname, self.func_ir, inst.value) + if call is not None and call == ('empty', 'numpy'): + allocs.append(inst) + return allocs + + def compute_graph_info(self, _a): + """ + compute adjacency list of the fused loops + and find the roots in of the lists + """ + a = copy.deepcopy(_a) + if a == {}: + return [], set() + + vtx = set() + for v in a.values(): + for x in v: + vtx.add(x) + + # find roots + potential_roots = set(a.keys()) + roots = potential_roots - vtx + if roots is None: + roots = set() + + # populate rest of adjacency list + not_roots = set() + for x in range(max(set(a.keys()).union(vtx)) + 1): + val = a.get(x) + if val is not None: + a[x] = val + elif val == []: + not_roots.add(x) # debug only + else: + a[x] = [] + + + # fold adjacency list into an actual list ordered + # by vtx + l = [] + for x in sorted(a.keys()): + l.append(a[x]) + + return l, roots #, not_roots + + def get_stats(self, fadj, nadj, root): + """ + Computes the number of fused and serialized loops + based on a fusion adjacency list `fadj` and a nested + parfors adjacency list `nadj` for the root, `root` + """ + def count_root(fadj, nadj, root, nfused, nserial): + for k in nadj[root]: + nserial += 1 + if nadj[k] == []: + nfused += len(fadj[k]) + else: + nf, ns = count_root(fadj, nadj, k, nfused, nserial) + nfused += nf + nserial = ns + return nfused, nserial + nfused, nserial = count_root(fadj, nadj, root, 0, 0) + return nfused, nserial + + def reachable_nodes(self, adj, root): + """ + returns a list of nodes reachable in an adjacency list from a + specified root + """ + fusers = [] + fusers.extend(adj[root]) + for k in adj[root]: + if adj[k] != []: + fusers.extend(self.reachable_nodes(adj, k)) + return fusers + + def sort_pf_by_line(self, pf_id, parfors_simple): + """ + pd_id - the parfors id + parfors_simple - the simple parfors map + """ + # this sorts parfors by source line number + pf = parfors_simple[pf_id][0] + pattern = pf.patterns[0] + line = max(0, pf.loc.line - 1) # why are these out by 1 ?! + filename = self.func_ir.loc.filename + nadj, nroots = self.compute_graph_info(self.nested_fusion_info) + fadj, froots = self.compute_graph_info(self.fusion_info) + graphs = [nadj, fadj] + + # If the parfor is internal, like internal prange, then the + # default line number is from its location in the numba source + # To get a more accurate line number, this first checks the + # adjacency graph for fused parfors that might not be internal + # and uses the minimum line number from there. If that fails + # (case where there's just a single internal parfor) the IR + # is walked backwards from the parfor location and the first non + # parfor statement line number is used. + if isinstance(pattern, tuple): + if pattern[1] == 'internal': + reported_loc = pattern[2][1] + if reported_loc.filename == filename: + return max(0, reported_loc.line - 1) + else: + # first recurse and check the adjacency list for + # something that is not an in internal parfor + tmp = [] + for adj in graphs: + if adj: # graph may be empty, e.g. no nesting + for k in adj[pf_id]: + tmp.append(self.sort_pf_by_line(k, parfors_simple)) + if tmp: + return max(0, min(tmp) - 1) + # second run through the parfor block to see if there's + # and reference to a line number in the user source + for blk in pf.loop_body.values(): + for stmt in blk.body: + if stmt.loc.filename == filename: + return max(0, stmt.loc.line - 1) + # finally run through the func_ir and look for the + # first non-parfor statement prior to this one and + # grab the line from that + for blk in self.func_ir.blocks.values(): + try: + idx = blk.body.index(pf) + for i in range(idx - 1, 0, -1): + stmt = blk.body[i] + if not isinstance(stmt, Parfor): + line = max(0, stmt.loc.line - 1) + break + except ValueError: + pass + return line + + def get_parfors_simple(self, print_loop_search): + parfors_simple = dict() + + # print in line order, parfors loop id is based on discovery order + for pf in sorted(self.initial_parfors, key=lambda x: x.loc.line): + # use 0 here, the parfors are mutated by the time this routine + # is called, however, fusion appends the patterns so we can just + # pull in the first as a "before fusion" emulation + r_pattern = pf.patterns[0] + pattern = pf.patterns[0] + loc = pf.loc + if isinstance(pattern, tuple): + if pattern[0] == 'prange': + if pattern[1] == 'internal': + replfn = '.'.join(reversed(list(pattern[2][0]))) + loc = pattern[2][1] + r_pattern = '%s %s' % (replfn, '(internal parallel version)') + elif pattern[1] == 'user': + r_pattern = "user defined prange" + elif pattern[1] == 'pndindex': + r_pattern = "internal pndindex" #FIXME: trace this! + else: + assert 0 + fmt = 'Parallel for-loop #%s: is produced from %s:\n %s\n \n' + if print_loop_search: + print_wrapped(fmt % (pf.id, loc, r_pattern)) + parfors_simple[pf.id] = (pf, loc, r_pattern) + return parfors_simple + + def get_all_lines(self, parfors_simple): + # ensure adjacency lists are the same size for both sets of info + # (nests and fusion may not traverse the same space, for + # convenience [] is used as a condition to halt recursion) + fadj, froots = self.compute_graph_info(self.fusion_info) + nadj, _nroots = self.compute_graph_info(self.nested_fusion_info) + + if len(fadj) > len(nadj): + lim = len(fadj) + tmp = nadj + else: + lim = len(nadj) + tmp = fadj + for x in range(len(tmp), lim): + tmp.append([]) + + # This computes the roots of true loop nests (i.e. loops containing + # loops opposed to just a loop that's a root). + nroots = set() + if _nroots: + for r in _nroots: + if nadj[r] != []: + nroots.add(r) + all_roots = froots ^ nroots + + # This computes all the parfors at the top level that are either: + # - roots of loop fusion + # - roots of true loop nests + # it then combines these based on source line number for ease of + # producing output ordered in a manner similar to the code structure + froots_lines = {} + for x in froots: + line = self.sort_pf_by_line(x, parfors_simple) + froots_lines[line] = 'fuse', x, fadj + + nroots_lines = {} + for x in nroots: + line = self.sort_pf_by_line(x, parfors_simple) + nroots_lines[line] = 'nest', x, nadj + + all_lines = froots_lines.copy() + all_lines.update(nroots_lines) + return all_lines + + def source_listing(self, parfors_simple, purpose_str): + filename = self.func_ir.loc.filename + count = self.count_parfors() + func_name = self.func_ir.func_id.func + try: + lines = inspect.getsource(func_name).splitlines() + except OSError: # generated function + lines = None + if lines and parfors_simple: + src_width = max([len(x) for x in lines]) + map_line_to_pf = defaultdict(list) # parfors can alias lines + for k, v in parfors_simple.items(): + # TODO: do a better job of tracking parfors that are not in + # this file but are referred to, e.g. np.arange() + if parfors_simple[k][1].filename == filename: + match_line = self.sort_pf_by_line(k, parfors_simple) + map_line_to_pf[match_line].append(str(k)) + + max_pf_per_line = max([1] + [len(x) for x in map_line_to_pf.values()]) + width = src_width + (1 + max_pf_per_line * (len(str(count)) + 2)) + newlines = [] + newlines.append('\n') + newlines.append('Parallel loop listing for %s' % purpose_str) + newlines.append(width * '-' + '|loop #ID') + fmt = '{0:{1}}| {2}' + # why are these off by 1? + lstart = max(0, self.func_ir.loc.line - 1) + for no, line in enumerate(lines, lstart): + pf_ids = map_line_to_pf.get(no, None) + if pf_ids is not None: + pfstr = '#' + ', '.join(pf_ids) + else: + pfstr = '' + stripped = line.strip('\n') + srclen = len(stripped) + if pf_ids: + l = fmt.format(width * '-', width, pfstr) + else: + l = fmt.format(width * ' ', width, pfstr) + newlines.append(stripped + l[srclen:]) + print('\n'.join(newlines)) + else: + print("No source available") + + def print_unoptimised(self, lines): + # This prints the unoptimised parfors state + sword = '+--' + fac = len(sword) + fadj, froots = self.compute_graph_info(self.fusion_info) + nadj, _nroots = self.compute_graph_info(self.nested_fusion_info) + + if len(fadj) > len(nadj): + lim = len(fadj) + tmp = nadj + else: + lim = len(nadj) + tmp = fadj + for x in range(len(tmp), lim): + tmp.append([]) + + def print_nest(fadj_, nadj_, theroot, reported, region_id): + def print_g(fadj_, nadj_, nroot, depth): + print_wrapped(fac * depth * ' ' + '%s%s %s' % (sword, nroot, '(parallel)')) + for k in nadj_[nroot]: + if nadj_[k] == []: + msg = [] + msg.append(fac * (depth + 1) * ' ' + '%s%s %s' % (sword, k, '(parallel)')) + if fadj_[k] != [] and k not in reported: + fused = self.reachable_nodes(fadj_, k) + for i in fused: + msg.append(fac * (depth + 1) * ' ' + '%s%s %s' % (sword, i, '(parallel)')) + reported.append(k) + print_wrapped('\n'.join(msg)) + else: + print_g(fadj_, nadj_, k, depth + 1) + + if nadj_[theroot] != []: + print_wrapped("Parallel region %s:" % region_id) + print_g(fadj_, nadj_, theroot, 0) + print("\n") + region_id = region_id + 1 + return region_id + + def print_fuse(ty, pf_id, adj, depth, region_id): + msg = [] + print_wrapped("Parallel region %s:" % region_id) + msg.append(fac * depth * ' ' + '%s%s %s' % (sword, pf_id, '(parallel)')) + if adj[pf_id] != []: + fused = sorted(self.reachable_nodes(adj, pf_id)) + for k in fused: + msg.append(fac * depth * ' ' + '%s%s %s' % (sword, k, '(parallel)')) + region_id = region_id + 1 + print_wrapped('\n'.join(msg)) + print("\n") + return region_id + + # Walk the parfors by src line and print optimised structure + region_id = 0 + reported = [] + for line, info in sorted(lines.items()): + opt_ty, pf_id, adj = info + if opt_ty == 'fuse': + if pf_id not in reported: + region_id = print_fuse('f', pf_id, adj, 0, region_id) + elif opt_ty == 'nest': + region_id = print_nest(fadj, nadj, pf_id, reported, region_id) + else: + assert 0 + + def print_optimised(self, lines): + # This prints the optimised output based on the transforms that + # occurred during loop fusion and rewriting of loop nests + sword = '+--' + fac = len(sword) + fadj, froots = self.compute_graph_info(self.fusion_info) + nadj, _nroots = self.compute_graph_info(self.nested_fusion_info) + + if len(fadj) > len(nadj): + lim = len(fadj) + tmp = nadj + else: + lim = len(nadj) + tmp = fadj + for x in range(len(tmp), lim): + tmp.append([]) + + summary = dict() + # region : {fused, serialized} + + def print_nest(fadj_, nadj_, theroot, reported, region_id): + def print_g(fadj_, nadj_, nroot, depth): + for k in nadj_[nroot]: + msg = fac * depth * ' ' + '%s%s %s' % (sword, k, '(serial') + if nadj_[k] == []: + fused = [] + if fadj_[k] != [] and k not in reported: + fused = sorted(self.reachable_nodes(fadj_, k)) + msg += ", fused with loop(s): " + msg += ', '.join([str(x) for x in fused]) + msg += ')' + reported.append(k) + print_wrapped(msg) + summary[region_id]['fused'] += len(fused) + else: + print_wrapped(msg + ')') + print_g(fadj_, nadj_, k, depth + 1) + summary[region_id]['serialized'] += 1 + + if nadj_[theroot] != []: + print_wrapped("Parallel region %s:" % region_id) + print_wrapped('%s%s %s' % (sword, theroot, '(parallel)')) + summary[region_id] = {'root': theroot, 'fused': 0, 'serialized': 0} + print_g(fadj_, nadj_, theroot, 1) + print("\n") + region_id = region_id + 1 + return region_id + + def print_fuse(ty, pf_id, adj, depth, region_id): + print_wrapped("Parallel region %s:" % region_id) + msg = fac * depth * ' ' + '%s%s %s' % (sword, pf_id, '(parallel') + fused = [] + if adj[pf_id] != []: + fused = sorted(self.reachable_nodes(adj, pf_id)) + msg += ", fused with loop(s): " + msg += ', '.join([str(x) for x in fused]) + + summary[region_id] = {'root': pf_id, 'fused': len(fused), 'serialized': 0} + msg += ')' + print_wrapped(msg) + print("\n") + region_id = region_id + 1 + return region_id + + # Walk the parfors by src line and print optimised structure + region_id = 0 + reported = [] + for line, info in sorted(lines.items()): + opt_ty, pf_id, adj = info + if opt_ty == 'fuse': + if pf_id not in reported: + region_id = print_fuse('f', pf_id, adj, 0, region_id) + elif opt_ty == 'nest': + region_id = print_nest(fadj, nadj, pf_id, reported, region_id) + else: + assert 0 + + # print the summary of the fuse/serialize rewrite + if summary: + for k, v in sorted(summary.items()): + msg = ('\n \nParallel region %s (loop #%s) had %s ' + 'loop(s) fused') + root = v['root'] + fused = v['fused'] + serialized = v['serialized'] + if serialized != 0: + msg += (' and %s loop(s) ' + 'serialized as part of the larger ' + 'parallel loop (#%s).') + print_wrapped(msg % (k, root, fused, serialized, root)) + else: + msg += '.' + print_wrapped(msg % (k, root, fused)) + else: + print_wrapped("Parallel structure is already optimal.") + + def allocation_hoist(self): + found = False + print('Allocation hoisting:') + for pf_id, data in self.hoist_info.items(): + stmt = data.get('hoisted', []) + for inst in stmt: + if isinstance(inst.value, ir.Expr): + try: + attr = inst.value.attr + if attr == 'empty': + msg = ("The memory allocation derived from the " + "instruction at %s is hoisted out of the " + "parallel loop labelled #%s (it will be " + "performed before the loop is executed and " + "reused inside the loop):") + loc = inst.loc + print_wrapped(msg % (loc, pf_id)) + try: + path = os.path.relpath(loc.filename) + except ValueError: + path = os.path.abspath(loc.filename) + lines = linecache.getlines(path) + if lines and loc.line: + print_wrapped(" Allocation:: " + lines[0 if loc.line < 2 else loc.line - 1].strip()) + print_wrapped(" - numpy.empty() is used for the allocation.\n") + found = True + except (KeyError, AttributeError): + pass + if not found: + print_wrapped('No allocation hoisting found') + + def instruction_hoist(self): + print("") + print('Instruction hoisting:') + hoist_info_printed = False + if self.hoist_info: + for pf_id, data in self.hoist_info.items(): + hoisted = data.get('hoisted', None) + not_hoisted = data.get('not_hoisted', None) + if not hoisted and not not_hoisted: + print("loop #%s has nothing to hoist." % pf_id) + continue + + print("loop #%s:" % pf_id) + if hoisted: + print(" Has the following hoisted:") + [print(" %s" % y) for y in hoisted] + hoist_info_printed = True + if not_hoisted: + print(" Failed to hoist the following:") + [print(" %s: %s" % (y, x)) for x, y in not_hoisted] + hoist_info_printed = True + if not hoist_info_printed: + print_wrapped('No instruction hoisting found') + print_wrapped(80 * '-') + + def dump(self, level=1): + if not self.has_setup: + raise RuntimeError("self.setup has not been called") + name = self.func_ir.func_id.func_qualname + line = self.func_ir.loc + if self.internal_name in name: + purpose_str = 'Internal parallel functions ' + purpose = 'internal' + else: + purpose_str = ' Function %s, %s ' % (name, line) + purpose = 'user' + + print_loop_search = False + print_source_listing = False + print_fusion_search = False + print_fusion_summary = False + print_loopnest_rewrite = False + print_pre_optimised = False + print_post_optimised = False + print_allocation_hoist = False + print_instruction_hoist = False + print_internal = False + + # each level switches on progressively more output + if level in (1, 2, 3, 4): + print_source_listing = True + print_post_optimised = True + else: + raise ValueError("Report level unknown, should be one of 1, 2, 3, 4") + + if level in (2, 3, 4): + print_pre_optimised = True + + if level in (3, 4): + print_allocation_hoist = True + + if level == 3: + print_fusion_summary = True + print_loopnest_rewrite = True + + if level == 4: + print_fusion_search = True + print_instruction_hoist = True + print_internal = True + + if purpose == 'internal' and not print_internal: + return + + print_wrapped('\n ') + print_wrapped(_termwidth * "=") + print_wrapped((" Parallel Accelerator Optimizing: %s " % purpose_str).center(_termwidth, '=')) + print_wrapped(_termwidth * "=") + print_wrapped("") + +#----------- search section + if print_loop_search: + print_wrapped('Looking for parallel loops'.center(_termwidth, '-')) + parfors_simple = self.get_parfors_simple(print_loop_search) + + count = self.count_parfors() + if print_loop_search: + print_wrapped("\nFound %s parallel loops." % count) + print_wrapped('-' * _termwidth) + +#----------- augmented source section + filename = self.func_ir.loc.filename + try: + # Try to get a relative path + # ipython/jupyter input just returns as filename + path = os.path.relpath(filename) + except ValueError: + # Fallback to absolute path if error occurred in getting the + # relative path. + # This may happen on windows if the drive is different + path = os.path.abspath(filename) + + if print_source_listing: + self.source_listing(parfors_simple, purpose_str) + +#---------- these are used a lot here on in + sword = '+--' + parfors = self.get_parfors() # this is the mutated parfors + parfor_ids = [x.id for x in parfors] + n_parfors = len(parfor_ids) + +#----------- loop fusion section + if print_fusion_search or print_fusion_summary: + if not sequential_parfor_lowering: + print_wrapped(' Fusing loops '.center(_termwidth, '-')) + msg = ("Attempting fusion of parallel loops (combines loops " + "with similar properties)...\n") + print_wrapped(msg) + else: + msg = "Performing sequential lowering of loops...\n" + print_wrapped(msg) + print_wrapped(_termwidth * '-') + # if there are some parfors, print information about them! + if n_parfors > -1: + def dump_graph_indented(a, root_msg, node_msg): + fac = len(sword) + def print_graph(adj, roots): + def print_g(adj, root, depth): + for k in adj[root]: + print_wrapped(fac * depth * ' ' + '%s%s %s' % (sword, k, node_msg)) + if adj[k] != []: + print_g(adj, k, depth + 1) + for r in roots: + print_wrapped('%s%s %s' % (sword, r, root_msg)) + print_g(l, r, 1) + print_wrapped("") + l, roots = self.compute_graph_info(a) + print_graph(l, roots) + + if print_fusion_search: + for report in self.fusion_reports: + l1, l2, msg = report + print_wrapped(" Trying to fuse loops #%s and #%s:" % (l1, l2)) + print_wrapped(" %s" % msg) + + if self.fusion_info != {}: + if print_fusion_summary: + print_wrapped("\n \nFused loop summary:\n") + + dump_graph_indented(self.fusion_info, 'has the following loops fused into it:', '(fused)') + + if print_fusion_summary: + if self.fusion_enabled: + after_fusion = "Following the attempted fusion of parallel for-loops" + else: + after_fusion = "With fusion disabled" + + print_wrapped(('\n{} there are {} parallel for-loop(s) (originating from loops labelled: {}).').format( + after_fusion, n_parfors, ', '.join(['#%s' % x for x in parfor_ids]))) + print_wrapped(_termwidth * '-') + print_wrapped("") + +#----------- loop nest section + if print_loopnest_rewrite: + if self.nested_fusion_info != {}: + print_wrapped((" Optimising loop nests ").center(_termwidth, '-')) + print_wrapped("Attempting loop nest rewrites (optimising for the largest parallel loops)...\n ") + root_msg = 'is a parallel loop' + node_msg = '--> rewritten as a serial loop' + dump_graph_indented(self.nested_fusion_info, root_msg, node_msg) + print_wrapped(_termwidth * '-') + print_wrapped("") + +#---------- compute various properties and orderings in the data for subsequent use + all_lines = self.get_all_lines(parfors_simple) + + if print_pre_optimised: + print(' Before Optimisation '.center(_termwidth,'-')) + self.print_unoptimised(all_lines) + print(_termwidth * '-') + + if print_post_optimised: + print(' After Optimisation '.center(_termwidth,'-')) + self.print_optimised(all_lines) + print(_termwidth * '-') + print_wrapped("") + print_wrapped(_termwidth * '-') + print_wrapped("\n ") + +#----------- LICM section + if print_allocation_hoist or print_instruction_hoist: + print_wrapped('Loop invariant code motion'.center(80, '-')) + + if print_allocation_hoist: + self.allocation_hoist() + + if print_instruction_hoist: + self.instruction_hoist() + + else: # there are no parfors + print_wrapped('Function %s, %s, has no parallel for-loops.'.format(name, line)) + + def __str__(self): + r = "ParforDiagnostics:\n" + r += repr(self.replaced_fns) + return r + + def __repr__(self): + r = "ParforDiagnostics" + return r + + +class PreParforPass(object): + """Preprocessing for the Parfor pass. It mostly inlines parallel + implementations of numpy functions if available. + """ + def __init__(self, func_ir, typemap, calltypes, typingctx, targetctx, + options, swapped={}, replace_functions_map=None): + self.func_ir = func_ir + self.typemap = typemap + self.calltypes = calltypes + self.typingctx = typingctx + self.targetctx = targetctx + self.options = options + # diagnostics + self.swapped = swapped + if replace_functions_map is None: + replace_functions_map = swap_functions_map + self.replace_functions_map = replace_functions_map + self.stats = { + 'replaced_func': 0, + 'replaced_dtype': 0, + } + + def run(self): + """Run pre-parfor processing pass. + """ + # e.g. convert A.sum() to np.sum(A) for easier match and optimization + canonicalize_array_math(self.func_ir, self.typemap, + self.calltypes, self.typingctx) + if self.options.numpy: + self._replace_parallel_functions(self.func_ir.blocks) + self.func_ir.blocks = simplify_CFG(self.func_ir.blocks) + + def _replace_parallel_functions(self, blocks): + """ + Replace functions with their parallel implementation in + replace_functions_map if available. + The implementation code is inlined to enable more optimization. + """ + swapped = self.swapped + from numba.core.inline_closurecall import inline_closure_call + work_list = list(blocks.items()) + while work_list: + label, block = work_list.pop() + for i, instr in enumerate(block.body): + if isinstance(instr, ir.Assign): + lhs = instr.target + lhs_typ = self.typemap[lhs.name] + expr = instr.value + if isinstance(expr, ir.Expr) and expr.op == 'call': + # Try and inline known calls with their parallel implementations + def replace_func(): + func_def = get_definition(self.func_ir, expr.func) + callname = find_callname(self.func_ir, expr) + repl_func = self.replace_functions_map.get(callname, None) + # Handle method on array type + if (repl_func is None and + len(callname) == 2 and + isinstance(callname[1], ir.Var) and + isinstance(self.typemap[callname[1].name], + types.npytypes.Array)): + repl_func = replace_functions_ndarray.get(callname[0], None) + if repl_func is not None: + # Add the array that the method is on to the arg list. + expr.args.insert(0, callname[1]) + + require(repl_func is not None) + typs = tuple(self.typemap[x.name] for x in expr.args) + kws_typs = {k: self.typemap[x.name] for k, x in expr.kws} + try: + new_func = repl_func(lhs_typ, *typs, **kws_typs) + except: + new_func = None + require(new_func is not None) + # bind arguments to the new_func + typs = utils.pysignature(new_func).bind(*typs, **kws_typs).args + + g = copy.copy(self.func_ir.func_id.func.__globals__) + g['numba'] = numba + g['np'] = numpy + g['math'] = math + # if the function being inlined has a function + # checking the inputs, find it and add it to globals + check = replace_functions_checkers_map.get(callname, + None) + if check is not None: + g[check.name] = check.func + # inline the parallel implementation + new_blocks, _ = inline_closure_call(self.func_ir, g, + block, i, new_func, self.typingctx, self.targetctx, + typs, self.typemap, self.calltypes, work_list) + call_table = get_call_table(new_blocks, topological_ordering=False) + + # find the prange in the new blocks and record it for use in diagnostics + for call in call_table: + for k, v in call.items(): + if v[0] == 'internal_prange': + swapped[k] = [callname, repl_func.__name__, func_def, block.body[i].loc] + break + return True + if guard(replace_func): + self.stats['replaced_func'] += 1 + break + elif (isinstance(expr, ir.Expr) and expr.op == 'getattr' and + expr.attr == 'dtype'): + # Replace getattr call "A.dtype" with numpy.dtype(). + # This helps remove superfluous dependencies from parfor. + typ = self.typemap[expr.value.name] + if isinstance(typ, types.npytypes.Array): + # Convert A.dtype to four statements. + # 1) Get numpy global. + # 2) Create var for known type of array as string + # constant. e.g. 'float64' + # 3) Get dtype function from numpy module. + # 4) Create var for numpy.dtype(var from #2). + + # Create var for numpy module. + dtype = typ.dtype + scope = block.scope + loc = instr.loc + g_np_var = ir.Var(scope, mk_unique_var("$np_g_var"), loc) + self.typemap[g_np_var.name] = types.misc.Module(numpy) + g_np = ir.Global('np', numpy, loc) + g_np_assign = ir.Assign(g_np, g_np_var, loc) + + # Create var for the inferred type of the array + # e.g., 'float64' + dtype_str = str(dtype) + if dtype_str == 'bool': + dtype_str = 'bool_' + typ_var = ir.Var( + scope, mk_unique_var("$np_typ_var"), loc) + self.typemap[typ_var.name] = types.StringLiteral( + dtype_str) + typ_var_assign = ir.Assign( + ir.Const(dtype_str, loc), typ_var, loc) + + # Get the dtype function from the numpy module. + dtype_attr_var = ir.Var(scope, mk_unique_var("$dtype_attr_var"), loc) + temp = find_template(numpy.dtype) + tfunc = numba.core.types.Function(temp) + tfunc.get_call_type(self.typingctx, (self.typemap[typ_var.name],), {}) + self.typemap[dtype_attr_var.name] = types.functions.Function(temp) + dtype_attr_getattr = ir.Expr.getattr(g_np_var, 'dtype', loc) + dtype_attr_assign = ir.Assign(dtype_attr_getattr, dtype_attr_var, loc) + + # Call numpy.dtype on the statically coded type two steps above. + dtype_var = ir.Var(scope, mk_unique_var("$dtype_var"), loc) + self.typemap[dtype_var.name] = types.npytypes.DType(dtype) + dtype_getattr = ir.Expr.call(dtype_attr_var, [typ_var], (), loc) + dtype_assign = ir.Assign(dtype_getattr, dtype_var, loc) + self.calltypes[dtype_getattr] = signature( + self.typemap[dtype_var.name], self.typemap[typ_var.name]) + + # The original A.dtype rhs is replaced with result of this call. + instr.value = dtype_var + # Add statements to body of the code. + block.body.insert(0, dtype_assign) + block.body.insert(0, dtype_attr_assign) + block.body.insert(0, typ_var_assign) + block.body.insert(0, g_np_assign) + self.stats['replaced_dtype'] += 1 + break + +def find_template(op): + for ft in numba.core.typing.templates.builtin_registry.functions: + if ft.key == op: + return ft + + +class ParforPassStates: + """This class encapsulates all internal states of the ParforPass. + """ + + def __init__(self, func_ir, typemap, calltypes, return_type, typingctx, + targetctx, options, flags, metadata, + diagnostics=ParforDiagnostics()): + self.func_ir = func_ir + self.typemap = typemap + self.calltypes = calltypes + self.typingctx = typingctx + self.targetctx = targetctx + self.return_type = return_type + self.options = options + self.diagnostics = diagnostics + self.swapped_fns = diagnostics.replaced_fns + self.fusion_info = diagnostics.fusion_info + self.nested_fusion_info = diagnostics.nested_fusion_info + + self.array_analysis = array_analysis.ArrayAnalysis( + self.typingctx, self.func_ir, self.typemap, self.calltypes, + ) + + ir_utils._the_max_label.update(max(func_ir.blocks.keys())) + self.flags = flags + self.metadata = metadata + if "parfors" not in metadata: + metadata["parfors"] = {} + + +class ConvertInplaceBinop: + """Parfor subpass to convert setitem on Arrays + """ + def __init__(self, pass_states): + """ + Parameters + ---------- + pass_states : ParforPassStates + """ + self.pass_states = pass_states + self.rewritten = [] + + def run(self, blocks): + pass_states = self.pass_states + # convert expressions like A += ... where A is an array. + topo_order = find_topo_order(blocks) + # variables available in the program so far (used for finding map + # functions in array_expr lowering) + for label in topo_order: + block = blocks[label] + new_body = [] + equiv_set = pass_states.array_analysis.get_equiv_set(label) + for instr in block.body: + if isinstance(instr, ir.Assign): + lhs = instr.target + expr = instr.value + if isinstance(expr, ir.Expr) and expr.op == 'inplace_binop': + loc = expr.loc + target = expr.lhs + value = expr.rhs + target_typ = pass_states.typemap[target.name] + value_typ = pass_states.typemap[value.name] + # Handle A op= ... + if isinstance(target_typ, types.npytypes.Array): + # RHS is an array + if isinstance(value_typ, types.npytypes.Array): + new_instr = self._inplace_binop_to_parfor(equiv_set, + loc, expr.immutable_fn, target, value) + self.rewritten.append( + dict(old=instr, new=new_instr, + reason='inplace_binop'), + ) + instr = [new_instr, ir.Assign(target, lhs, loc)] + if isinstance(instr, list): + new_body.extend(instr) + else: + new_body.append(instr) + block.body = new_body + + def _inplace_binop_to_parfor(self, equiv_set, loc, op, target, value): + """generate parfor from setitem node with a boolean or slice array indices. + The value can be either a scalar or an array variable, and if a boolean index + is used for the latter case, the same index must be used for the value too. + """ + pass_states = self.pass_states + scope = target.scope + arr_typ = pass_states.typemap[target.name] + el_typ = arr_typ.dtype + init_block = ir.Block(scope, loc) + value_typ = pass_states.typemap[value.name] + + size_vars = equiv_set.get_shape(target) + + # generate loopnests and size variables from target correlations + index_vars, loopnests = _mk_parfor_loops(pass_states.typemap, size_vars, scope, loc) + + # generate body + body_label = next_label() + body_block = ir.Block(scope, loc) + index_var, index_var_typ = _make_index_var( + pass_states.typemap, scope, index_vars, body_block) + + # Read value. + value_var = ir.Var(scope, mk_unique_var("$value_var"), loc) + pass_states.typemap[value_var.name] = value_typ.dtype + getitem_call = ir.Expr.getitem(value, index_var, loc) + pass_states.calltypes[getitem_call] = signature( + value_typ.dtype, value_typ, index_var_typ) + body_block.body.append(ir.Assign(getitem_call, value_var, loc)) + + # Read target + target_var = ir.Var(scope, mk_unique_var("$target_var"), loc) + pass_states.typemap[target_var.name] = el_typ + getitem_call = ir.Expr.getitem(target, index_var, loc) + pass_states.calltypes[getitem_call] = signature( + el_typ, arr_typ, index_var_typ) + body_block.body.append(ir.Assign(getitem_call, target_var, loc)) + + # Create temp to hold result. + expr_out_var = ir.Var(scope, mk_unique_var("$expr_out_var"), loc) + pass_states.typemap[expr_out_var.name] = el_typ + + # Create binop and assign result to temporary. + binop_expr = ir.Expr.binop(op, target_var, value_var, loc) + body_block.body.append(ir.Assign(binop_expr, expr_out_var, loc)) + unified_type = self.pass_states.typingctx.unify_pairs(el_typ, value_typ.dtype) + pass_states.calltypes[binop_expr] = signature( + unified_type, unified_type, unified_type) + + # Write to target + setitem_node = ir.SetItem(target, index_var, expr_out_var, loc) + pass_states.calltypes[setitem_node] = signature( + types.none, arr_typ, index_var_typ, el_typ) + body_block.body.append(setitem_node) + + parfor = Parfor(loopnests, init_block, {}, loc, index_var, equiv_set, + ('inplace_binop', ''), pass_states.flags) + parfor.loop_body = {body_label: body_block} + if config.DEBUG_ARRAY_OPT >= 1: + print("parfor from inplace_binop") + parfor.dump() + return parfor + + def _type_getitem(self, args): + fnty = operator.getitem + return self.pass_states.typingctx.resolve_function_type(fnty, tuple(args), {}) + + +def get_index_var(x): + return x.index if isinstance(x, ir.SetItem) else x.index_var + + +class ConvertSetItemPass: + """Parfor subpass to convert setitem on Arrays + """ + def __init__(self, pass_states): + """ + Parameters + ---------- + pass_states : ParforPassStates + """ + self.pass_states = pass_states + self.rewritten = [] + + def run(self, blocks): + pass_states = self.pass_states + # convert setitem expressions like A[C] = c or A[C] = B[C] to parfor, + # where C is a boolean array. + topo_order = find_topo_order(blocks) + # variables available in the program so far (used for finding map + # functions in array_expr lowering) + for label in topo_order: + block = blocks[label] + new_body = [] + equiv_set = pass_states.array_analysis.get_equiv_set(label) + for instr in block.body: + if isinstance(instr, (ir.StaticSetItem, ir.SetItem)): + loc = instr.loc + target = instr.target + index = get_index_var(instr) + value = instr.value + target_typ = pass_states.typemap[target.name] + index_typ = pass_states.typemap[index.name] + value_typ = pass_states.typemap[value.name] + # Handle A[boolean_array] = + if isinstance(target_typ, types.npytypes.Array): + if (isinstance(index_typ, types.npytypes.Array) and + isinstance(index_typ.dtype, types.Boolean) and + target_typ.ndim == index_typ.ndim): + # RHS is a scalar number + if isinstance(value_typ, types.Number): + new_instr = self._setitem_to_parfor(equiv_set, + loc, target, index, value) + self.rewritten.append( + dict(old=instr, new=new_instr, + reason='masked_assign_broadcast_scalar'), + ) + instr = new_instr + # RHS is an array + elif isinstance(value_typ, types.npytypes.Array): + val_def = guard(get_definition, pass_states.func_ir, + value.name) + if (isinstance(val_def, ir.Expr) and + val_def.op == 'getitem' and + val_def.index.name == index.name): + new_instr = self._setitem_to_parfor(equiv_set, + loc, target, index, val_def.value) + self.rewritten.append( + dict(old=instr, new=new_instr, + reason='masked_assign_array'), + ) + instr = new_instr + else: + # Handle A[:] = x + shape = equiv_set.get_shape(instr) + # Don't converted broadcasted setitems into parfors. + if isinstance(index_typ, types.BaseTuple): + # The sliced dims are those in the index that + # are made of slices. Count the numbers of slices + # in the index tuple. + sliced_dims = len(list(filter( + lambda x: isinstance(x, types.misc.SliceType), + index_typ.types))) + elif isinstance(index_typ, types.misc.SliceType): + # For singular indices there can be a bare slice + # and if so there is one dimension being set. + sliced_dims = 1 + else: + sliced_dims = 0 + + # Only create a parfor for this setitem if we know the + # shape of the output and number of dimensions set is + # equal to the number of dimensions on the right side. + if (shape is not None and + (not isinstance(value_typ, types.npytypes.Array) or + sliced_dims == value_typ.ndim)): + new_instr = self._setitem_to_parfor(equiv_set, + loc, target, index, value, shape=shape) + self.rewritten.append( + dict(old=instr, new=new_instr, + reason='slice'), + ) + instr = new_instr + new_body.append(instr) + block.body = new_body + + def _setitem_to_parfor(self, equiv_set, loc, target, index, value, shape=None): + """generate parfor from setitem node with a boolean or slice array indices. + The value can be either a scalar or an array variable, and if a boolean index + is used for the latter case, the same index must be used for the value too. + """ + pass_states = self.pass_states + scope = target.scope + arr_typ = pass_states.typemap[target.name] + el_typ = arr_typ.dtype + index_typ = pass_states.typemap[index.name] + init_block = ir.Block(scope, loc) + + if shape: + # Slice index is being used on the target array, we'll have to create + # a sub-array so that the target dimension matches the given shape. + assert(isinstance(index_typ, types.BaseTuple) or + isinstance(index_typ, types.SliceType)) + # setitem has a custom target shape + size_vars = shape + # create a new target array via getitem + subarr_var = ir.Var(scope, mk_unique_var("$subarr"), loc) + getitem_call = ir.Expr.getitem(target, index, loc) + subarr_typ = typing.arraydecl.get_array_index_type( arr_typ, index_typ).result + pass_states.typemap[subarr_var.name] = subarr_typ + pass_states.calltypes[getitem_call] = self._type_getitem((arr_typ, index_typ)) + init_block.append(ir.Assign(getitem_call, subarr_var, loc)) + target = subarr_var + else: + # Otherwise it is a boolean array that is used as index. + assert(isinstance(index_typ, types.ArrayCompatible)) + size_vars = equiv_set.get_shape(target) + bool_typ = index_typ.dtype + + # generate loopnests and size variables from lhs correlations + loopnests = [] + index_vars = [] + for size_var in size_vars: + index_var = ir.Var(scope, mk_unique_var("parfor_index"), loc) + index_vars.append(index_var) + pass_states.typemap[index_var.name] = types.uintp + loopnests.append(LoopNest(index_var, 0, size_var, 1)) + + # generate body + body_label = next_label() + body_block = ir.Block(scope, loc) + index_var, index_var_typ = _make_index_var( + pass_states.typemap, scope, index_vars, body_block) + parfor = Parfor(loopnests, init_block, {}, loc, index_var, equiv_set, + ('setitem', ''), pass_states.flags) + if shape: + # slice subarray + parfor.loop_body = {body_label: body_block} + true_block = body_block + end_label = None + else: + # boolean mask + true_label = next_label() + true_block = ir.Block(scope, loc) + end_label = next_label() + end_block = ir.Block(scope, loc) + parfor.loop_body = {body_label: body_block, + true_label: true_block, + end_label: end_block, + } + mask_var = ir.Var(scope, mk_unique_var("$mask_var"), loc) + pass_states.typemap[mask_var.name] = bool_typ + mask_val = ir.Expr.getitem(index, index_var, loc) + body_block.body.extend([ + ir.Assign(mask_val, mask_var, loc), + ir.Branch(mask_var, true_label, end_label, loc) + ]) + + value_typ = pass_states.typemap[value.name] + if isinstance(value_typ, types.npytypes.Array): + value_var = ir.Var(scope, mk_unique_var("$value_var"), loc) + pass_states.typemap[value_var.name] = value_typ.dtype + getitem_call = ir.Expr.getitem(value, index_var, loc) + pass_states.calltypes[getitem_call] = signature( + value_typ.dtype, value_typ, index_var_typ) + true_block.body.append(ir.Assign(getitem_call, value_var, loc)) + else: + value_var = value + setitem_node = ir.SetItem(target, index_var, value_var, loc) + pass_states.calltypes[setitem_node] = signature( + types.none, pass_states.typemap[target.name], index_var_typ, el_typ) + true_block.body.append(setitem_node) + if end_label: + true_block.body.append(ir.Jump(end_label, loc)) + + if config.DEBUG_ARRAY_OPT >= 1: + print("parfor from setitem") + parfor.dump() + return parfor + + def _type_getitem(self, args): + fnty = operator.getitem + return self.pass_states.typingctx.resolve_function_type(fnty, tuple(args), {}) + + +def _make_index_var(typemap, scope, index_vars, body_block, force_tuple=False): + """ When generating a SetItem call to an array in a parfor, the general + strategy is to generate a tuple if the array is more than 1 dimension. + If it is 1 dimensional then you can use a simple variable. This routine + is also used when converting pndindex to parfor but pndindex requires a + tuple even if the iteration space is 1 dimensional. The pndindex use of + this function will use force_tuple to make the output index a tuple even + if it is one dimensional. + """ + ndims = len(index_vars) + loc = body_block.loc + if ndims > 1 or force_tuple: + tuple_var = ir.Var(scope, mk_unique_var( + "$parfor_index_tuple_var"), loc) + typemap[tuple_var.name] = types.containers.UniTuple( + types.uintp, ndims) + tuple_call = ir.Expr.build_tuple(list(index_vars), loc) + tuple_assign = ir.Assign(tuple_call, tuple_var, loc) + body_block.body.append(tuple_assign) + return tuple_var, types.containers.UniTuple(types.uintp, ndims) + elif ndims == 1: + return index_vars[0], types.uintp + else: + raise errors.UnsupportedRewriteError( + "Parfor does not handle arrays of dimension 0", + loc=loc, + ) + + +def _mk_parfor_loops(typemap, size_vars, scope, loc): + """ + Create loop index variables and build LoopNest objects for a parfor. + """ + loopnests = [] + index_vars = [] + for size_var in size_vars: + index_var = ir.Var(scope, mk_unique_var("parfor_index"), loc) + index_vars.append(index_var) + typemap[index_var.name] = types.uintp + loopnests.append(LoopNest(index_var, 0, size_var, 1)) + return index_vars, loopnests + +class ConvertNumpyPass: + """ + Convert supported Numpy functions, as well as arrayexpr nodes, to + parfor nodes. + """ + def __init__(self, pass_states): + self.pass_states = pass_states + self.rewritten = [] + + def run(self, blocks): + pass_states = self.pass_states + topo_order = find_topo_order(blocks) + # variables available in the program so far (used for finding map + # functions in array_expr lowering) + avail_vars = [] + for label in topo_order: + block = blocks[label] + new_body = [] + equiv_set = pass_states.array_analysis.get_equiv_set(label) + for instr in block.body: + if isinstance(instr, ir.Assign): + expr = instr.value + lhs = instr.target + lhs_typ = self.pass_states.typemap[lhs.name] + if self._is_C_or_F_order(lhs_typ): + if guard(self._is_supported_npycall, expr): + new_instr = self._numpy_to_parfor(equiv_set, lhs, expr) + if new_instr is not None: + self.rewritten.append(dict( + old=instr, + new=new_instr, + reason='numpy_allocator', + )) + instr = new_instr + elif isinstance(expr, ir.Expr) and expr.op == 'arrayexpr': + new_instr = self._arrayexpr_to_parfor( + equiv_set, lhs, expr, avail_vars) + self.rewritten.append(dict( + old=instr, + new=new_instr, + reason='arrayexpr', + )) + instr = new_instr + avail_vars.append(lhs.name) + new_body.append(instr) + block.body = new_body + + def _is_C_order(self, arr_name): + if isinstance(arr_name, types.npytypes.Array): + return arr_name.layout == 'C' and arr_name.ndim > 0 + elif arr_name is str: + typ = self.pass_states.typemap[arr_name] + return (isinstance(typ, types.npytypes.Array) and + typ.layout == 'C' and + typ.ndim > 0) + else: + return False + + def _is_C_or_F_order(self, arr_name): + if isinstance(arr_name, types.npytypes.Array): + return (arr_name.layout == 'C' or arr_name.layout == 'F') and arr_name.ndim > 0 + elif arr_name is str: + typ = self.pass_states.typemap[arr_name] + return (isinstance(typ, types.npytypes.Array) and + (typ.layout == 'C' or typ.layout == 'F') and + typ.ndim > 0) + else: + return False + + def _arrayexpr_to_parfor(self, equiv_set, lhs, arrayexpr, avail_vars): + """generate parfor from arrayexpr node, which is essentially a + map with recursive tree. + """ + pass_states = self.pass_states + scope = lhs.scope + loc = lhs.loc + expr = arrayexpr.expr + arr_typ = pass_states.typemap[lhs.name] + el_typ = arr_typ.dtype + + # generate loopnests and size variables from lhs correlations + size_vars = equiv_set.get_shape(lhs) + index_vars, loopnests = _mk_parfor_loops(pass_states.typemap, size_vars, scope, loc) + + # generate init block and body + init_block = ir.Block(scope, loc) + init_block.body = mk_alloc( + pass_states.typingctx, + pass_states.typemap, pass_states.calltypes, lhs, + tuple(size_vars), el_typ, scope, loc, + pass_states.typemap[lhs.name]) + body_label = next_label() + body_block = ir.Block(scope, loc) + expr_out_var = ir.Var(scope, mk_unique_var("$expr_out_var"), loc) + pass_states.typemap[expr_out_var.name] = el_typ + + index_var, index_var_typ = _make_index_var( + pass_states.typemap, scope, index_vars, body_block) + + body_block.body.extend( + _arrayexpr_tree_to_ir( + pass_states.func_ir, + pass_states.typingctx, + pass_states.typemap, + pass_states.calltypes, + equiv_set, + init_block, + expr_out_var, + expr, + index_var, + index_vars, + avail_vars)) + + pat = ('array expression {}'.format(repr_arrayexpr(arrayexpr.expr)),) + + parfor = Parfor(loopnests, init_block, {}, loc, index_var, equiv_set, pat[0], pass_states.flags) + + setitem_node = ir.SetItem(lhs, index_var, expr_out_var, loc) + pass_states.calltypes[setitem_node] = signature( + types.none, pass_states.typemap[lhs.name], index_var_typ, el_typ) + body_block.body.append(setitem_node) + parfor.loop_body = {body_label: body_block} + if config.DEBUG_ARRAY_OPT >= 1: + print("parfor from arrayexpr") + parfor.dump() + return parfor + + def _is_supported_npycall(self, expr): + """check if we support parfor translation for + this Numpy call. + """ + call_name, mod_name = find_callname(self.pass_states.func_ir, expr) + if not (isinstance(mod_name, str) and mod_name.startswith('numpy')): + return False + if call_name in ['zeros', 'ones']: + return True + if mod_name == 'numpy.random' and call_name in random_calls: + return True + # TODO: add more calls + return False + + def _numpy_to_parfor(self, equiv_set, lhs, expr): + call_name, mod_name = find_callname(self.pass_states.func_ir, expr) + args = expr.args + kws = dict(expr.kws) + if call_name in ['zeros', 'ones'] or mod_name == 'numpy.random': + return self._numpy_map_to_parfor(equiv_set, call_name, lhs, args, kws, expr) + # return error if we couldn't handle it (avoid rewrite infinite loop) + raise errors.UnsupportedRewriteError( + f"parfor translation failed for {expr}", loc=expr.loc, + ) + + def _numpy_map_to_parfor(self, equiv_set, call_name, lhs, args, kws, expr): + """generate parfor from Numpy calls that are maps. + """ + pass_states = self.pass_states + scope = lhs.scope + loc = lhs.loc + arr_typ = pass_states.typemap[lhs.name] + el_typ = arr_typ.dtype + + # generate loopnests and size variables from lhs correlations + size_vars = equiv_set.get_shape(lhs) + if size_vars is None: + if config.DEBUG_ARRAY_OPT >= 1: + print("Could not convert numpy map to parfor, unknown size") + return None + + index_vars, loopnests = _mk_parfor_loops(pass_states.typemap, size_vars, scope, loc) + + # generate init block and body + init_block = ir.Block(scope, loc) + init_block.body = mk_alloc( + pass_states.typingctx, + pass_states.typemap, pass_states.calltypes, lhs, + tuple(size_vars), el_typ, scope, loc, + pass_states.typemap[lhs.name]) + body_label = next_label() + body_block = ir.Block(scope, loc) + expr_out_var = ir.Var(scope, mk_unique_var("$expr_out_var"), loc) + pass_states.typemap[expr_out_var.name] = el_typ + + index_var, index_var_typ = _make_index_var( + pass_states.typemap, scope, index_vars, body_block) + + if call_name == 'zeros': + value = ir.Const(el_typ(0), loc) + elif call_name == 'ones': + value = ir.Const(el_typ(1), loc) + elif call_name in random_calls: + # remove size arg to reuse the call expr for single value + _remove_size_arg(call_name, expr) + # update expr type + new_arg_typs, new_kw_types = _get_call_arg_types( + expr, pass_states.typemap) + pass_states.calltypes.pop(expr) + pass_states.calltypes[expr] = pass_states.typemap[expr.func.name].get_call_type( + typing.Context(), new_arg_typs, new_kw_types) + value = expr + else: + raise NotImplementedError( + "Map of numpy.{} to parfor is not implemented".format(call_name)) + + value_assign = ir.Assign(value, expr_out_var, loc) + body_block.body.append(value_assign) + + setitem_node = ir.SetItem(lhs, index_var, expr_out_var, loc) + pass_states.calltypes[setitem_node] = signature( + types.none, pass_states.typemap[lhs.name], index_var_typ, el_typ) + body_block.body.append(setitem_node) + + parfor = Parfor(loopnests, init_block, {}, loc, index_var, equiv_set, + ('{} function'.format(call_name,), 'NumPy mapping'), + pass_states.flags) + parfor.loop_body = {body_label: body_block} + if config.DEBUG_ARRAY_OPT >= 1: + print("generated parfor for numpy map:") + parfor.dump() + return parfor + + +class ConvertReducePass: + """ + Find reduce() calls and convert them to parfors. + """ + def __init__(self, pass_states): + self.pass_states = pass_states + self.rewritten = [] + + def run(self, blocks): + pass_states = self.pass_states + + topo_order = find_topo_order(blocks) + for label in topo_order: + block = blocks[label] + new_body = [] + equiv_set = pass_states.array_analysis.get_equiv_set(label) + for instr in block.body: + parfor = None + if isinstance(instr, ir.Assign): + loc = instr.loc + lhs = instr.target + expr = instr.value + callname = guard(find_callname, pass_states.func_ir, expr) + if (callname == ('reduce', 'builtins') + or callname == ('reduce', '_functools')): + # reduce function with generic function + parfor = guard(self._reduce_to_parfor, equiv_set, lhs, + expr.args, loc) + if parfor: + self.rewritten.append(dict( + new=parfor, + old=instr, + reason='reduce', + )) + instr = parfor + new_body.append(instr) + block.body = new_body + return + + def _reduce_to_parfor(self, equiv_set, lhs, args, loc): + """ + Convert a reduce call to a parfor. + The call arguments should be (call_name, array, init_value). + """ + pass_states = self.pass_states + + scope = lhs.scope + call_name = args[0] + in_arr = args[1] + arr_def = get_definition(pass_states.func_ir, in_arr.name) + + mask_var = None + mask_indices = None + + # Search for array[boolean_mask] + mask_query_result = guard(_find_mask, pass_states.typemap, pass_states.func_ir, arr_def) + if mask_query_result: + in_arr, mask_var, mask_typ, mask_indices = mask_query_result + + init_val = args[2] + size_vars = equiv_set.get_shape(in_arr if mask_indices is None else mask_var) + if size_vars is None: + return None + + index_vars, loopnests = _mk_parfor_loops(pass_states.typemap, size_vars, scope, loc) + mask_index = index_vars + if mask_indices: + # the following is never tested + raise AssertionError("unreachable") + index_vars = tuple(x if x else index_vars[0] for x in mask_indices) + acc_var = lhs + + # init block has to init the reduction variable + init_block = ir.Block(scope, loc) + init_block.body.append(ir.Assign(init_val, acc_var, loc)) + + # produce loop body + body_label = next_label() + index_var, loop_body = self._mk_reduction_body(call_name, + scope, loc, index_vars, in_arr, acc_var) + if mask_indices: + # the following is never tested + raise AssertionError("unreachable") + index_var = mask_index[0] + + if mask_var is not None: + true_label = min(loop_body.keys()) + false_label = max(loop_body.keys()) + body_block = ir.Block(scope, loc) + loop_body[body_label] = body_block + mask = ir.Var(scope, mk_unique_var("$mask_val"), loc) + pass_states.typemap[mask.name] = mask_typ + mask_val = ir.Expr.getitem(mask_var, index_var, loc) + body_block.body.extend([ + ir.Assign(mask_val, mask, loc), + ir.Branch(mask, true_label, false_label, loc) + ]) + + parfor = Parfor(loopnests, init_block, loop_body, loc, index_var, + equiv_set, ('{} function'.format(call_name), + 'reduction'), pass_states.flags) + if config.DEBUG_ARRAY_OPT >= 1: + print("parfor from reduction") + parfor.dump() + return parfor + + def _mk_reduction_body(self, call_name, scope, loc, + index_vars, in_arr, acc_var): + """ + Produce the body blocks for a reduction function indicated by call_name. + """ + from numba.core.inline_closurecall import check_reduce_func + + pass_states = self.pass_states + reduce_func = get_definition(pass_states.func_ir, call_name) + fcode = check_reduce_func(pass_states.func_ir, reduce_func) + + arr_typ = pass_states.typemap[in_arr.name] + in_typ = arr_typ.dtype + body_block = ir.Block(scope, loc) + index_var, index_var_type = _make_index_var( + pass_states.typemap, scope, index_vars, body_block) + + tmp_var = ir.Var(scope, mk_unique_var("$val"), loc) + pass_states.typemap[tmp_var.name] = in_typ + getitem_call = ir.Expr.getitem(in_arr, index_var, loc) + pass_states.calltypes[getitem_call] = signature( + in_typ, arr_typ, index_var_type) + body_block.append(ir.Assign(getitem_call, tmp_var, loc)) + + reduce_f_ir = compile_to_numba_ir(fcode, + pass_states.func_ir.func_id.func.__globals__, + pass_states.typingctx, + pass_states.targetctx, + (in_typ, in_typ), + pass_states.typemap, + pass_states.calltypes) + loop_body = reduce_f_ir.blocks + end_label = next_label() + end_block = ir.Block(scope, loc) + loop_body[end_label] = end_block + first_reduce_label = min(reduce_f_ir.blocks.keys()) + first_reduce_block = reduce_f_ir.blocks[first_reduce_label] + body_block.body.extend(first_reduce_block.body) + first_reduce_block.body = body_block.body + replace_arg_nodes(first_reduce_block, [acc_var, tmp_var]) + replace_returns(loop_body, acc_var, end_label) + return index_var, loop_body + + +class ConvertLoopPass: + """Build Parfor nodes from prange loops. + """ + def __init__(self, pass_states): + self.pass_states = pass_states + self.rewritten = [] + + def run(self, blocks): + pass_states = self.pass_states + + call_table, _ = get_call_table(blocks) + cfg = compute_cfg_from_blocks(blocks) + usedefs = compute_use_defs(blocks) + live_map = compute_live_map(cfg, blocks, usedefs.usemap, usedefs.defmap) + loops = cfg.loops() + sized_loops = [(loops[k], len(loops[k].body)) for k in loops.keys()] + moved_blocks = [] + # We go over all loops, smaller loops first (inner first) + for loop, s in sorted(sized_loops, key=lambda tup: tup[1]): + if len(loop.entries) != 1 or len(loop.exits) != 1: + if not config.DISABLE_PERFORMANCE_WARNINGS: + for entry in loop.entries: + for inst in blocks[entry].body: + # if prange or pndindex call + if ( + isinstance(inst, ir.Assign) + and isinstance(inst.value, ir.Expr) + and inst.value.op == "call" + and self._is_parallel_loop( + inst.value.func.name, call_table) + ): + msg = "\nprange or pndindex loop " \ + "will not be executed in " \ + "parallel due to there being more than one " \ + "entry to or exit from the loop (e.g., an " \ + "assertion)." + warnings.warn( + errors.NumbaPerformanceWarning( + msg, inst.loc)) + continue + + entry = list(loop.entries)[0] + for inst in blocks[entry].body: + # if prange or pndindex call + if (isinstance(inst, ir.Assign) + and isinstance(inst.value, ir.Expr) + and inst.value.op == 'call' + and self._is_parallel_loop(inst.value.func.name, call_table)): + # Here we've found a parallel loop, either prange or pndindex. + # We create a parfor from this loop and then overwrite the contents + # of the original loop header block to contain this parfor and then + # a jump to the original loop exit block. Other blocks in the + # original loop are discarded. + body_labels = [ l for l in loop.body if + l in blocks and l != loop.header ] + args = inst.value.args + loop_kind, loop_replacing = self._get_loop_kind(inst.value.func.name, + call_table) + # Get the body of the header of the loops minus the branch terminator + # The general approach is to prepend the header block to the first + # body block and then let dead code removal handle removing unneeded + # statements. Not all statements in the header block are unnecessary. + header_body = blocks[loop.header].body[:-1] + # find loop index variable (pair_first in header block) + loop_index = None + for hbi, stmt in enumerate(header_body): + if (isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == 'pair_first'): + loop_index = stmt.target.name + li_index = hbi + break + assert(loop_index is not None) + # Remove pair_first from header. + # We have to remove the pair_first by hand since it causes problems + # for some code below if we don't. + header_body = header_body[:li_index] + header_body[li_index+1:] + + # loop_index may be assigned to other vars + # get header copies to find all of them + cps, _ = get_block_copies({0: blocks[loop.header]}, + pass_states.typemap) + cps = cps[0] + loop_index_vars = set(t for t, v in cps if v == loop_index) + loop_index_vars.add(loop_index) + + scope = blocks[entry].scope + loc = inst.loc + equiv_set = pass_states.array_analysis.get_equiv_set(loop.header) + init_block = ir.Block(scope, loc) + init_block.body = self._get_prange_init_block(blocks[entry], + call_table, args) + loop_body = {l: blocks[l] for l in body_labels} + # Add an empty block to the end of loop body + end_label = next_label() + loop_body[end_label] = ir.Block(scope, loc) + + # Detect races in the prange. + # Races are defs in the parfor body that are live at the exit block. + bodydefs = set() + for bl in body_labels: + bodydefs = bodydefs.union(usedefs.defmap[bl]) + exit_lives = set() + for bl in loop.exits: + exit_lives = exit_lives.union(live_map[bl]) + races = bodydefs.intersection(exit_lives) + # It is possible for the result of an ir.Global to be flagged + # as a race if it is defined in this Parfor and then used in + # a subsequent Parfor. push_call_vars() in the Parfor pass + # copies such ir.Global nodes into the Parfors in which they + # are used so no need to treat things of type Module as a race. + races = races.intersection({x for x in races + if not isinstance(pass_states.typemap[x], types.misc.Module)}) + + # replace jumps to header block with the end block + for l in body_labels: + last_inst = loop_body[l].body[-1] + if (isinstance(last_inst, ir.Jump) and + last_inst.target == loop.header): + last_inst.target = end_label + + def find_indexed_arrays(): + """find expressions that involve getitem using the + index variable. Return both the arrays and expressions. + """ + indices = copy.copy(loop_index_vars) + for block in loop_body.values(): + for inst in block.find_insts(ir.Assign): + if (isinstance(inst.value, ir.Var) and + inst.value.name in indices): + indices.add(inst.target.name) + arrs = [] + exprs = [] + for block in loop_body.values(): + for inst in block.body: + lv = set(x.name for x in inst.list_vars()) + if lv & indices: + if lv.issubset(indices): + continue + require(isinstance(inst, ir.Assign)) + expr = inst.value + require(isinstance(expr, ir.Expr) and + expr.op in ['getitem', 'static_getitem']) + arrs.append(expr.value.name) + exprs.append(expr) + return arrs, exprs + + mask_var = None + mask_indices = None + def find_mask_from_size(size_var): + """Find the case where size_var is defined by A[M].shape, + where M is a boolean array. + """ + size_def = get_definition(pass_states.func_ir, size_var) + require(size_def and isinstance(size_def, ir.Expr) and + size_def.op == 'getattr' and size_def.attr == 'shape') + arr_var = size_def.value + live_vars = set.union(*[live_map[l] for l in loop.exits]) + index_arrs, index_exprs = find_indexed_arrays() + require([arr_var.name] == list(index_arrs)) + # input array has to be dead after loop + require(arr_var.name not in live_vars) + # loop for arr's definition, where size = arr.shape + arr_def = get_definition(pass_states.func_ir, size_def.value) + result = _find_mask(pass_states.typemap, pass_states.func_ir, arr_def) + + # The following is never tested. + raise AssertionError("unreachable") + # Found the mask. + # Replace B[i] with A[i], where B = A[M] + for expr in index_exprs: + expr.value = result[0] + return result + + # pndindex and prange are provably positive except when + # user provides negative start to prange() + unsigned_index = True + # TODO: support array mask optimization for prange + # TODO: refactor and simplify array mask optimization + if loop_kind == 'pndindex': + assert(equiv_set.has_shape(args[0])) + # see if input array to pndindex is output of array + # mask like B = A[M] + result = guard(find_mask_from_size, args[0]) + if result: + in_arr, mask_var, mask_typ, mask_indices = result + else: + in_arr = args[0] + assert(isinstance(in_arr, ir.Var)) + in_arr_typ = pass_states.typemap[in_arr.name] + if isinstance(in_arr_typ, types.Integer): + index_var = ir.Var(scope, mk_unique_var("parfor_index"), loc) + pass_states.typemap[index_var.name] = types.uintp + loops = [LoopNest(index_var, 0, in_arr, 1)] + index_vars = [index_var] + else: + size_vars = equiv_set.get_shape(in_arr + if mask_indices is None else mask_var) + index_vars, loops = _mk_parfor_loops( + pass_states.typemap, size_vars, scope, loc, + ) + assert(len(loops) > 0) + orig_index = index_vars + if mask_indices: + # replace mask indices if required; + # integer indices of original array should be used + # instead of parfor indices + index_vars = tuple(x if x else index_vars[0] + for x in mask_indices) + first_body_block = loop_body[min(loop_body.keys())] + body_block = ir.Block(scope, loc) + index_var, index_var_typ = _make_index_var( + pass_states.typemap, scope, index_vars, body_block, + force_tuple=True + ) + body = body_block.body + first_body_block.body + first_body_block.body = body + if mask_indices: + orig_index_var = orig_index[0] + else: + orig_index_var = index_var + + # if masked array optimization is being applied, create + # the branch for array selection + if mask_var is not None: + # The following code are not tested + raise AssertionError("unreachable") + body_label = next_label() + # loop_body needs new labels greater than body_label + loop_body = add_offset_to_labels(loop_body, + body_label - min(loop_body.keys()) + 1) + labels = loop_body.keys() + true_label = min(labels) + false_label = max(labels) + body_block = ir.Block(scope, loc) + loop_body[body_label] = body_block + mask = ir.Var(scope, mk_unique_var("$mask_val"), loc) + pass_states.typemap[mask.name] = mask_typ + mask_val = ir.Expr.getitem(mask_var, orig_index_var, loc) + body_block.body.extend([ + ir.Assign(mask_val, mask, loc), + ir.Branch(mask, true_label, false_label, loc) + ]) + else: # prange + start = 0 + step = 1 + size_var = args[0] + if len(args) == 2: + start = args[0] + size_var = args[1] + if len(args) == 3: + start = args[0] + size_var = args[1] + try: + step = pass_states.func_ir.get_definition(args[2]) + except KeyError: + raise errors.UnsupportedRewriteError( + "Only known step size is supported for prange", + loc=inst.loc, + ) + if not isinstance(step, ir.Const): + raise errors.UnsupportedRewriteError( + "Only constant step size is supported for prange", + loc=inst.loc, + ) + step = step.value + if step != 1: + raise errors.UnsupportedRewriteError( + "Only constant step size of 1 is supported for prange", + loc=inst.loc, + ) + index_var = ir.Var(scope, mk_unique_var("parfor_index"), loc) + # assume user-provided start to prange can be negative + # this is the only case parfor can have negative index + if isinstance(start, int) and start >= 0: + index_var_typ = types.uintp + else: + index_var_typ = types.intp + unsigned_index = False + loops = [LoopNest(index_var, start, size_var, step)] + pass_states.typemap[index_var.name] = index_var_typ + + # We can't just drop the header block since there can be things + # in there other than the prange looping infrastructure. + # So we just add the header to the first loop body block (minus the + # branch) and let dead code elimination remove the unnecessary parts. + first_body_label = min(loop_body.keys()) + loop_body[first_body_label].body = header_body + loop_body[first_body_label].body + + index_var_map = {v: index_var for v in loop_index_vars} + replace_vars(loop_body, index_var_map) + if unsigned_index: + # need to replace signed array access indices to enable + # optimizations (see #2846) + self._replace_loop_access_indices( + loop_body, loop_index_vars, index_var) + parfor = Parfor(loops, init_block, loop_body, loc, + orig_index_var if mask_indices else index_var, + equiv_set, + ("prange", loop_kind, loop_replacing), + pass_states.flags, races=races) + + blocks[loop.header].body = [parfor] + # We have to insert the header_body after the parfor because in + # a Numba loop this will be executed one more times before the + # branch and may contain instructions such as variable renamings + # that are relied upon later. + blocks[loop.header].body.extend(header_body) + blocks[loop.header].body.append(ir.Jump(list(loop.exits)[0], loc)) + self.rewritten.append(dict( + old_loop=loop, + new=parfor, + reason='loop', + )) + # remove loop blocks from top level dict + for l in body_labels: + if l != loop.header: + blocks.pop(l) + if config.DEBUG_ARRAY_OPT >= 1: + print("parfor from loop") + parfor.dump() + + def _is_parallel_loop(self, func_var, call_table): + # prange can be either getattr (numba.prange) or global (prange) + if func_var not in call_table: + return False + call = call_table[func_var] + return len(call) > 0 and (call[0] == 'prange' or call[0] == prange + or call[0] == 'internal_prange' or call[0] == internal_prange + or call[0] == 'pndindex' or call[0] == pndindex) + + def _get_loop_kind(self, func_var, call_table): + """see if prange is user prange or internal""" + pass_states = self.pass_states + # prange can be either getattr (numba.prange) or global (prange) + assert func_var in call_table + call = call_table[func_var] + assert len(call) > 0 + kind = 'user', '' + if call[0] == 'internal_prange' or call[0] == internal_prange: + try: + kind = 'internal', (pass_states.swapped_fns[func_var][0], pass_states.swapped_fns[func_var][-1]) + except KeyError: + # FIXME: Fix this issue... the code didn't manage to trace the + # swapout for func_var so set the kind as internal so that the + # transform can occur, it's just not tracked + kind = 'internal', ('', '') + elif call[0] == 'pndindex' or call[0] == pndindex: + kind = 'pndindex', '' + return kind + + def _get_prange_init_block(self, entry_block, call_table, prange_args): + """ + If there is init_prange, find the code between init_prange and prange + calls. Remove the code from entry_block and return it. + """ + init_call_ind = -1 + prange_call_ind = -1 + init_body = [] + for i, inst in enumerate(entry_block.body): + # if init_prange call + if (isinstance(inst, ir.Assign) and isinstance(inst.value, ir.Expr) + and inst.value.op == 'call' + and self._is_prange_init(inst.value.func.name, call_table)): + init_call_ind = i + if (isinstance(inst, ir.Assign) and isinstance(inst.value, ir.Expr) + and inst.value.op == 'call' + and self._is_parallel_loop(inst.value.func.name, call_table)): + prange_call_ind = i + if init_call_ind != -1 and prange_call_ind != -1: + # we save instructions that are used to calculate prange call args + # in the entry block. The rest go to parfor init_block + arg_related_vars = {v.name for v in prange_args} + saved_nodes = [] + for i in reversed(range(init_call_ind+1, prange_call_ind)): + inst = entry_block.body[i] + inst_vars = {v.name for v in inst.list_vars()} + if arg_related_vars & inst_vars: + arg_related_vars |= inst_vars + saved_nodes.append(inst) + else: + init_body.append(inst) + + init_body.reverse() + saved_nodes.reverse() + entry_block.body = (entry_block.body[:init_call_ind] + + saved_nodes + entry_block.body[prange_call_ind+1:]) + + return init_body + + def _is_prange_init(self, func_var, call_table): + if func_var not in call_table: + return False + call = call_table[func_var] + return len(call) > 0 and (call[0] == 'init_prange' or call[0] == init_prange) + + def _replace_loop_access_indices(self, loop_body, index_set, new_index): + """ + Replace array access indices in a loop body with a new index. + index_set has all the variables that are equivalent to loop index. + """ + # treat new index like others since replacing it with itself is ok + index_set.add(new_index.name) + + with dummy_return_in_loop_body(loop_body): + labels = find_topo_order(loop_body) + + first_label = labels[0] + added_indices = set() + + # traverse loop body and replace indices in getitem/setitem with + # new_index if possible. + # also, find equivalent indices defined in first block. + for l in labels: + block = loop_body[l] + for stmt in block.body: + if (isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Var)): + # the first block dominates others so we can use copies + # of indices safely + if (l == first_label and stmt.value.name in index_set + and stmt.target.name not in index_set): + index_set.add(stmt.target.name) + added_indices.add(stmt.target.name) + # make sure parallel index is not overwritten + else: + scope = block.scope + + def unver(name): + from numba.core import errors + try: + return scope.get_exact(name).unversioned_name + except errors.NotDefinedError: + return name + + if unver(stmt.target.name) in map(unver, index_set) and unver(stmt.target.name) != unver(stmt.value.name): + raise errors.UnsupportedRewriteError( + "Overwrite of parallel loop index", + loc=stmt.target.loc, + ) + + + + if is_get_setitem(stmt): + index = index_var_of_get_setitem(stmt) + # statics can have none indices + if index is None: + continue + ind_def = guard(get_definition, self.pass_states.func_ir, + index, lhs_only=True) + if (index.name in index_set + or (ind_def is not None + and ind_def.name in index_set)): + set_index_var_of_get_setitem(stmt, new_index) + # corner case where one dimension of a multi-dim access + # should be replaced + guard(self._replace_multi_dim_ind, ind_def, index_set, + new_index) + + if isinstance(stmt, Parfor): + self._replace_loop_access_indices(stmt.loop_body, index_set, new_index) + + # remove added indices for correct recursive parfor handling + index_set -= added_indices + return + + def _replace_multi_dim_ind(self, ind_var, index_set, new_index): + """ + replace individual indices in multi-dimensional access variable, which + is a build_tuple + """ + pass_states = self.pass_states + require(ind_var is not None) + # check for Tuple instead of UniTuple since some dims could be slices + require(isinstance(pass_states.typemap[ind_var.name], + (types.Tuple, types.UniTuple))) + ind_def_node = get_definition(pass_states.func_ir, ind_var) + require(isinstance(ind_def_node, ir.Expr) + and ind_def_node.op == 'build_tuple') + ind_def_node.items = [new_index if v.name in index_set else v + for v in ind_def_node.items] + + +def _find_mask(typemap, func_ir, arr_def): + """check if an array is of B[...M...], where M is a + boolean array, and other indices (if available) are ints. + If found, return B, M, M's type, and a tuple representing mask indices. + Otherwise, raise GuardException. + """ + require(isinstance(arr_def, ir.Expr) and arr_def.op == 'getitem') + value = arr_def.value + index = arr_def.index + value_typ = typemap[value.name] + index_typ = typemap[index.name] + ndim = value_typ.ndim + require(isinstance(value_typ, types.npytypes.Array)) + if (isinstance(index_typ, types.npytypes.Array) and + isinstance(index_typ.dtype, types.Boolean) and + ndim == index_typ.ndim): + return value, index, index_typ.dtype, None + elif isinstance(index_typ, types.BaseTuple): + # Handle multi-dimension differently by requiring + # all indices to be constant except the one for mask. + seq, op = find_build_sequence(func_ir, index) + require(op == 'build_tuple' and len(seq) == ndim) + count_consts = 0 + mask_indices = [] + mask_var = None + for ind in seq: + index_typ = typemap[ind.name] + # Handle boolean mask + if (isinstance(index_typ, types.npytypes.Array) and + isinstance(index_typ.dtype, types.Boolean)): + mask_var = ind + mask_typ = index_typ.dtype + mask_indices.append(None) + # Handle integer array selector + elif (isinstance(index_typ, types.npytypes.Array) and + isinstance(index_typ.dtype, types.Integer)): + mask_var = ind + mask_typ = index_typ.dtype + mask_indices.append(None) + # Handle integer index + elif isinstance(index_typ, types.Integer): + count_consts += 1 + mask_indices.append(ind) + + require(mask_var and count_consts == ndim - 1) + return value, mask_var, mask_typ, mask_indices + raise GuardException + + +class ParforPass(ParforPassStates): + + """ParforPass class is responsible for converting NumPy + calls in Numba intermediate representation to Parfors, which + will lower into either sequential or parallel loops during lowering + stage. + """ + + def _pre_run(self): + # run array analysis, a pre-requisite for parfor translation + self.array_analysis.run(self.func_ir.blocks) + # NOTE: Prepare _the_max_label. See #6102 + ir_utils._the_max_label.update( + ir_utils.find_max_label(self.func_ir.blocks)) + + def run(self): + """run parfor conversion pass: replace Numpy calls + with Parfors when possible and optimize the IR.""" + self._pre_run() + # run stencil translation to parfor + if self.options.stencil: + stencil_pass = StencilPass(self.func_ir, self.typemap, + self.calltypes, self.array_analysis, + self.typingctx, self.targetctx, + self.flags) + stencil_pass.run() + if self.options.setitem: + ConvertSetItemPass(self).run(self.func_ir.blocks) + if self.options.numpy: + ConvertNumpyPass(self).run(self.func_ir.blocks) + if self.options.reduction: + ConvertReducePass(self).run(self.func_ir.blocks) + if self.options.prange: + ConvertLoopPass(self).run(self.func_ir.blocks) + if self.options.inplace_binop: + ConvertInplaceBinop(self).run(self.func_ir.blocks) + + # setup diagnostics now parfors are found + self.diagnostics.setup(self.func_ir, self.options.fusion) + + dprint_func_ir(self.func_ir, "after parfor pass") + + def _find_mask(self, arr_def): + """check if an array is of B[...M...], where M is a + boolean array, and other indices (if available) are ints. + If found, return B, M, M's type, and a tuple representing mask indices. + Otherwise, raise GuardException. + """ + return _find_mask(self.typemap, self.func_ir, arr_def) + + def _mk_parfor_loops(self, size_vars, scope, loc): + """ + Create loop index variables and build LoopNest objects for a parfor. + """ + return _mk_parfor_loops(self.typemap, size_vars, scope, loc) + + +class ParforFusionPass(ParforPassStates): + + """ParforFusionPass class is responsible for fusing parfors + """ + + def run(self): + """run parfor fusion pass""" + + # simplify CFG of parfor body loops since nested parfors with extra + # jumps can be created with prange conversion + n_parfors = simplify_parfor_body_CFG(self.func_ir.blocks) + # simplify before fusion + simplify(self.func_ir, self.typemap, self.calltypes, self.metadata["parfors"]) + # need two rounds of copy propagation to enable fusion of long sequences + # of parfors like test_fuse_argmin (some PYTHONHASHSEED values since + # apply_copies_parfor depends on set order for creating dummy assigns) + simplify(self.func_ir, self.typemap, self.calltypes, self.metadata["parfors"]) + + if self.options.fusion and n_parfors >= 2: + self.func_ir._definitions = build_definitions(self.func_ir.blocks) + self.array_analysis.equiv_sets = dict() + self.array_analysis.run(self.func_ir.blocks) + + # Get parfor params to calculate reductions below. + _, parfors = get_parfor_params(self.func_ir.blocks, + self.options.fusion, + self.nested_fusion_info) + + # Find reductions so that fusion can be disallowed if a + # subsequent parfor read a reduction variable. + for p in parfors: + p.redvars, p.reddict = get_parfor_reductions(self.func_ir, + p, + p.params, + self.calltypes) + + # reorder statements to maximize fusion + # push non-parfors down + maximize_fusion(self.func_ir, self.func_ir.blocks, self.typemap, + up_direction=False) + dprint_func_ir(self.func_ir, "after maximize fusion down") + self.fuse_parfors(self.array_analysis, + self.func_ir.blocks, + self.func_ir, + self.typemap) + dprint_func_ir(self.func_ir, "after first fuse") + # push non-parfors up + maximize_fusion(self.func_ir, self.func_ir.blocks, self.typemap) + dprint_func_ir(self.func_ir, "after maximize fusion up") + # try fuse again after maximize + self.fuse_parfors(self.array_analysis, + self.func_ir.blocks, + self.func_ir, + self.typemap) + dprint_func_ir(self.func_ir, "after fusion") + # remove dead code after fusion to remove extra arrays and variables + simplify(self.func_ir, self.typemap, self.calltypes, self.metadata["parfors"]) + + def fuse_parfors(self, array_analysis, blocks, func_ir, typemap): + for label, block in blocks.items(): + equiv_set = array_analysis.get_equiv_set(label) + fusion_happened = True + while fusion_happened: + fusion_happened = False + new_body = [] + i = 0 + while i < len(block.body) - 1: + stmt = block.body[i] + next_stmt = block.body[i + 1] + if isinstance(stmt, Parfor) and isinstance(next_stmt, Parfor): + # we have to update equiv_set since they have changed due to + # variables being renamed before fusion. + equiv_set = array_analysis.get_equiv_set(label) + stmt.equiv_set = equiv_set + next_stmt.equiv_set = equiv_set + fused_node, fuse_report = try_fuse(equiv_set, stmt, next_stmt, + self.metadata["parfors"], func_ir, typemap) + # accumulate fusion reports + self.diagnostics.fusion_reports.append(fuse_report) + if fused_node is not None: + fusion_happened = True + self.diagnostics.fusion_info[stmt.id].extend([next_stmt.id]) + new_body.append(fused_node) + self.fuse_recursive_parfor(fused_node, equiv_set, func_ir, typemap) + i += 2 + continue + new_body.append(stmt) + if isinstance(stmt, Parfor): + self.fuse_recursive_parfor(stmt, equiv_set, func_ir, typemap) + i += 1 + new_body.append(block.body[-1]) + block.body = new_body + return + + def fuse_recursive_parfor(self, parfor, equiv_set, func_ir, typemap): + blocks = wrap_parfor_blocks(parfor) + maximize_fusion(self.func_ir, blocks, self.typemap) + dprint_func_ir(self.func_ir, "after recursive maximize fusion down", blocks) + arr_analysis = array_analysis.ArrayAnalysis(self.typingctx, self.func_ir, + self.typemap, self.calltypes) + arr_analysis.run(blocks, equiv_set) + self.fuse_parfors(arr_analysis, blocks, func_ir, typemap) + unwrap_parfor_blocks(parfor) + + +class ParforPreLoweringPass(ParforPassStates): + + """ParforPreLoweringPass class is responsible for preparing parfors for lowering. + """ + + def run(self): + """run parfor prelowering pass""" + + # push function call variables inside parfors so gufunc function + # wouldn't need function variables as argument + push_call_vars(self.func_ir.blocks, {}, {}, self.typemap) + dprint_func_ir(self.func_ir, "after push call vars") + # simplify again + simplify(self.func_ir, self.typemap, self.calltypes, self.metadata["parfors"]) + dprint_func_ir(self.func_ir, "after optimization") + if config.DEBUG_ARRAY_OPT >= 1: + print("variable types: ", sorted(self.typemap.items())) + print("call types: ", self.calltypes) + + if config.DEBUG_ARRAY_OPT >= 3: + for(block_label, block) in self.func_ir.blocks.items(): + new_block = [] + scope = block.scope + for stmt in block.body: + new_block.append(stmt) + if isinstance(stmt, ir.Assign): + loc = stmt.loc + lhs = stmt.target + rhs = stmt.value + lhs_typ = self.typemap[lhs.name] + print("Adding print for assignment to ", lhs.name, lhs_typ, type(lhs_typ)) + if lhs_typ in types.number_domain or isinstance(lhs_typ, types.Literal): + str_var = ir.Var(scope, mk_unique_var("str_var"), loc) + self.typemap[str_var.name] = types.StringLiteral(lhs.name) + lhs_const = ir.Const(lhs.name, loc) + str_assign = ir.Assign(lhs_const, str_var, loc) + new_block.append(str_assign) + str_print = ir.Print([str_var], None, loc) + self.calltypes[str_print] = signature(types.none, self.typemap[str_var.name]) + new_block.append(str_print) + ir_print = ir.Print([lhs], None, loc) + self.calltypes[ir_print] = signature(types.none, lhs_typ) + new_block.append(ir_print) + block.body = new_block + + if self.func_ir.is_generator: + fix_generator_types(self.func_ir.generator_info, self.return_type, + self.typemap) + if sequential_parfor_lowering: + lower_parfor_sequential( + self.typingctx, self.func_ir, self.typemap, self.calltypes, self.metadata) + else: + # prepare for parallel lowering + # add parfor params to parfors here since lowering is destructive + # changing the IR after this is not allowed + parfor_ids, parfors = get_parfor_params(self.func_ir.blocks, + self.options.fusion, + self.nested_fusion_info) + + # Validate reduction in parfors. + for p in parfors: + p.redvars, p.reddict = get_parfor_reductions(self.func_ir, + p, + p.params, + self.calltypes) + + # Validate parameters: + for p in parfors: + p.validate_params(self.typemap) + + if config.DEBUG_ARRAY_OPT_STATS: + name = self.func_ir.func_id.func_qualname + n_parfors = len(parfor_ids) + if n_parfors > 0: + after_fusion = ("After fusion" if self.options.fusion + else "With fusion disabled") + print(('{}, function {} has ' + '{} parallel for-loop(s) #{}.').format( + after_fusion, name, n_parfors, parfor_ids)) + else: + print('Function {} has no Parfor.'.format(name)) + + +def _remove_size_arg(call_name, expr): + "remove size argument from args or kws" + # remove size kwarg + kws = dict(expr.kws) + kws.pop('size', '') + expr.kws = tuple(kws.items()) + + # remove size arg if available + if call_name in random_1arg_size + random_int_args: + # these calls have only a "size" argument or list of ints + # so remove all args + expr.args = [] + + if call_name in random_3arg_sizelast: + # normal, uniform, ... have 3 args, last one is size + if len(expr.args) == 3: + expr.args.pop() + + if call_name in random_2arg_sizelast: + # have 2 args, last one is size + if len(expr.args) == 2: + expr.args.pop() + + if call_name == 'randint': + # has 4 args, 3rd one is size + if len(expr.args) == 3: + expr.args.pop() + if len(expr.args) == 4: + dt_arg = expr.args.pop() + expr.args.pop() # remove size + expr.args.append(dt_arg) + + if call_name == 'triangular': + # has 4 args, last one is size + if len(expr.args) == 4: + expr.args.pop() + + return + + +def _get_call_arg_types(expr, typemap): + new_arg_typs = [] + for arg in expr.args: + new_arg_typs.append(typemap[arg.name]) + + new_kw_types = {} + for name, arg in expr.kws: + new_kw_types[name] = typemap[arg.name] + + return tuple(new_arg_typs), new_kw_types + + +def _arrayexpr_tree_to_ir( + func_ir, + typingctx, + typemap, + calltypes, + equiv_set, + init_block, + expr_out_var, + expr, + parfor_index_tuple_var, + all_parfor_indices, + avail_vars): + """generate IR from array_expr's expr tree recursively. Assign output to + expr_out_var and returns the whole IR as a list of Assign nodes. + """ + el_typ = typemap[expr_out_var.name] + scope = expr_out_var.scope + loc = expr_out_var.loc + out_ir = [] + + if isinstance(expr, tuple): + op, arr_expr_args = expr + arg_vars = [] + for arg in arr_expr_args: + arg_out_var = ir.Var(scope, mk_unique_var("$arg_out_var"), loc) + typemap[arg_out_var.name] = el_typ + out_ir += _arrayexpr_tree_to_ir(func_ir, + typingctx, + typemap, + calltypes, + equiv_set, + init_block, + arg_out_var, + arg, + parfor_index_tuple_var, + all_parfor_indices, + avail_vars) + arg_vars.append(arg_out_var) + if op in npydecl.supported_array_operators: + el_typ1 = typemap[arg_vars[0].name] + if len(arg_vars) == 2: + el_typ2 = typemap[arg_vars[1].name] + func_typ = typingctx.resolve_function_type(op, (el_typ1, + el_typ2), {}) + ir_expr = ir.Expr.binop(op, arg_vars[0], arg_vars[1], loc) + if op == operator.truediv: + func_typ, ir_expr = _gen_np_divide( + arg_vars[0], arg_vars[1], out_ir, typemap) + else: + func_typ = typingctx.resolve_function_type(op, (el_typ1,), {}) + ir_expr = ir.Expr.unary(op, arg_vars[0], loc) + calltypes[ir_expr] = func_typ + el_typ = func_typ.return_type + out_ir.append(ir.Assign(ir_expr, expr_out_var, loc)) + for T in array_analysis.MAP_TYPES: + if isinstance(op, T): + # elif isinstance(op, (np.ufunc, DUFunc)): + # function calls are stored in variables which are not removed + # op is typing_key to the variables type + func_var_name = _find_func_var(typemap, op, avail_vars, loc=loc) + func_var = ir.Var(scope, mk_unique_var(func_var_name), loc) + typemap[func_var.name] = typemap[func_var_name] + func_var_def = copy.deepcopy(func_ir.get_definition(func_var_name)) + if isinstance(func_var_def, ir.Expr) and func_var_def.op == 'getattr' and func_var_def.attr == 'sqrt': + g_math_var = ir.Var(scope, mk_unique_var("$math_g_var"), loc) + typemap[g_math_var.name] = types.misc.Module(math) + g_math = ir.Global('math', math, loc) + g_math_assign = ir.Assign(g_math, g_math_var, loc) + func_var_def = ir.Expr.getattr(g_math_var, 'sqrt', loc) + out_ir.append(g_math_assign) +# out_ir.append(func_var_def) + ir_expr = ir.Expr.call(func_var, arg_vars, (), loc) + call_typ = typemap[func_var.name].get_call_type( + typingctx, tuple(typemap[a.name] for a in arg_vars), {}) + calltypes[ir_expr] = call_typ + el_typ = call_typ.return_type + #signature(el_typ, el_typ) + out_ir.append(ir.Assign(func_var_def, func_var, loc)) + out_ir.append(ir.Assign(ir_expr, expr_out_var, loc)) + elif isinstance(expr, ir.Var): + var_typ = typemap[expr.name] + if isinstance(var_typ, types.Array): + el_typ = var_typ.dtype + ir_expr = _gen_arrayexpr_getitem( + equiv_set, + expr, + parfor_index_tuple_var, + all_parfor_indices, + el_typ, + calltypes, + typingctx, + typemap, + init_block, + out_ir) + else: + # assert typemap[expr.name]==el_typ + el_typ = var_typ + ir_expr = expr + out_ir.append(ir.Assign(ir_expr, expr_out_var, loc)) + elif isinstance(expr, ir.Const): + el_typ = typing.Context().resolve_value_type(expr.value) + out_ir.append(ir.Assign(expr, expr_out_var, loc)) + + if len(out_ir) == 0: + raise errors.UnsupportedRewriteError( + f"Don't know how to translate array expression '{expr:r}'", + loc=expr.loc, + ) + typemap.pop(expr_out_var.name, None) + typemap[expr_out_var.name] = el_typ + return out_ir + + +def _gen_np_divide(arg1, arg2, out_ir, typemap): + """generate np.divide() instead of / for array_expr to get numpy error model + like inf for division by zero (test_division_by_zero). + """ + scope = arg1.scope + loc = arg1.loc + # g_np_var = Global(numpy) + g_np_var = ir.Var(scope, mk_unique_var("$np_g_var"), loc) + typemap[g_np_var.name] = types.misc.Module(numpy) + g_np = ir.Global('np', numpy, loc) + g_np_assign = ir.Assign(g_np, g_np_var, loc) + # attr call: div_attr = getattr(g_np_var, divide) + div_attr_call = ir.Expr.getattr(g_np_var, "divide", loc) + attr_var = ir.Var(scope, mk_unique_var("$div_attr"), loc) + func_var_typ = get_np_ufunc_typ(numpy.divide) + typemap[attr_var.name] = func_var_typ + attr_assign = ir.Assign(div_attr_call, attr_var, loc) + # divide call: div_attr(arg1, arg2) + div_call = ir.Expr.call(attr_var, [arg1, arg2], (), loc) + func_typ = func_var_typ.get_call_type( + typing.Context(), [typemap[arg1.name], typemap[arg2.name]], {}) + out_ir.extend([g_np_assign, attr_assign]) + return func_typ, div_call + + +def _gen_arrayexpr_getitem( + equiv_set, + var, + parfor_index_tuple_var, + all_parfor_indices, + el_typ, + calltypes, + typingctx, + typemap, + init_block, + out_ir): + """if there is implicit dimension broadcast, generate proper access variable + for getitem. For example, if indices are (i1,i2,i3) but shape is (c1,0,c3), + generate a tuple with (i1,0,i3) for access. Another example: for (i1,i2,i3) + and (c1,c2) generate (i2,i3). + """ + loc = var.loc + index_var = parfor_index_tuple_var + var_typ = typemap[var.name] + ndims = typemap[var.name].ndim + num_indices = len(all_parfor_indices) + size_vars = equiv_set.get_shape(var) or [] + size_consts = [equiv_set.get_equiv_const(x) for x in size_vars] + # Handle array-scalar + if ndims == 0: + # call np.ravel + ravel_var = ir.Var(var.scope, mk_unique_var("$ravel"), loc) + ravel_typ = types.npytypes.Array(dtype=var_typ.dtype, ndim=1, layout='C') + typemap[ravel_var.name] = ravel_typ + stmts = ir_utils.gen_np_call('ravel', numpy.ravel, ravel_var, [var], typingctx, typemap, calltypes) + init_block.body.extend(stmts) + var = ravel_var + # Const(0) + const_node = ir.Const(0, var.loc) + const_var = ir.Var(var.scope, mk_unique_var("$const_ind_0"), loc) + typemap[const_var.name] = types.uintp + const_assign = ir.Assign(const_node, const_var, loc) + out_ir.append(const_assign) + index_var = const_var + # Handle 1d array + elif ndims == 1: + # Use last index for 1D arrays + index_var = all_parfor_indices[-1] + # Handle known constant size + elif any([x is not None for x in size_consts]): + # Need a tuple as index + ind_offset = num_indices - ndims + tuple_var = ir.Var(var.scope, mk_unique_var( + "$parfor_index_tuple_var_bcast"), loc) + typemap[tuple_var.name] = types.containers.UniTuple(types.uintp, ndims) + # Just in case, const var for size 1 dim access index: $const0 = + # Const(0) + const_node = ir.Const(0, var.loc) + const_var = ir.Var(var.scope, mk_unique_var("$const_ind_0"), loc) + typemap[const_var.name] = types.uintp + const_assign = ir.Assign(const_node, const_var, loc) + out_ir.append(const_assign) + index_vars = [] + for i in reversed(range(ndims)): + size_var = size_vars[i] + size_const = size_consts[i] + if size_const == 1: + index_vars.append(const_var) + else: + index_vars.append(all_parfor_indices[ind_offset + i]) + index_vars = list(reversed(index_vars)) + tuple_call = ir.Expr.build_tuple(index_vars, loc) + tuple_assign = ir.Assign(tuple_call, tuple_var, loc) + out_ir.append(tuple_assign) + index_var = tuple_var + + ir_expr = ir.Expr.getitem(var, index_var, loc) + calltypes[ir_expr] = signature(el_typ, typemap[var.name], + typemap[index_var.name]) + return ir_expr + + +def _find_func_var(typemap, func, avail_vars, loc): + """find variable in typemap which represents the function func. + """ + for v in avail_vars: + t = typemap[v] + # Function types store actual functions in typing_key. + if isinstance(t, Function) and t.typing_key == func: + return v + raise errors.UnsupportedRewriteError("ufunc call variable not found", loc=loc) + + +def lower_parfor_sequential(typingctx, func_ir, typemap, calltypes, metadata): + ir_utils._the_max_label.update(ir_utils.find_max_label(func_ir.blocks)) + parfor_found = False + new_blocks = {} + scope = next(iter(func_ir.blocks.values())).scope + for (block_label, block) in func_ir.blocks.items(): + block_label, parfor_found = _lower_parfor_sequential_block( + block_label, block, new_blocks, typemap, calltypes, parfor_found, + scope=scope) + # old block stays either way + new_blocks[block_label] = block + func_ir.blocks = new_blocks + # rename only if parfor found and replaced (avoid test_flow_control error) + if parfor_found: + func_ir.blocks = rename_labels(func_ir.blocks) + dprint_func_ir(func_ir, "after parfor sequential lowering") + simplify(func_ir, typemap, calltypes, metadata["parfors"]) + dprint_func_ir(func_ir, "after parfor sequential simplify") + + +def _lower_parfor_sequential_block( + block_label, + block, + new_blocks, + typemap, + calltypes, + parfor_found, + scope): + i = _find_first_parfor(block.body) + while i != -1: + parfor_found = True + inst = block.body[i] + loc = inst.init_block.loc + # split block across parfor + prev_block = ir.Block(scope, loc) + prev_block.body = block.body[:i] + block.body = block.body[i + 1:] + # previous block jump to parfor init block + init_label = next_label() + prev_block.body.append(ir.Jump(init_label, loc)) + new_blocks[init_label] = transfer_scope(inst.init_block, scope) + new_blocks[block_label] = prev_block + block_label = next_label() + + ndims = len(inst.loop_nests) + for i in range(ndims): + loopnest = inst.loop_nests[i] + # create range block for loop + range_label = next_label() + header_label = next_label() + range_block = mk_range_block( + typemap, + loopnest.start, + loopnest.stop, + loopnest.step, + calltypes, + scope, + loc) + range_block.body[-1].target = header_label # fix jump target + phi_var = range_block.body[-2].target + new_blocks[range_label] = range_block + header_block = mk_loop_header(typemap, phi_var, calltypes, + scope, loc) + header_block.body[-2].target = loopnest.index_variable + new_blocks[header_label] = header_block + # jump to this new inner loop + if i == 0: + inst.init_block.body.append(ir.Jump(range_label, loc)) + header_block.body[-1].falsebr = block_label + else: + new_blocks[prev_header_label].body[-1].truebr = range_label + header_block.body[-1].falsebr = prev_header_label + prev_header_label = header_label # to set truebr next loop + + # last body block jump to inner most header + body_last_label = max(inst.loop_body.keys()) + inst.loop_body[body_last_label].body.append( + ir.Jump(header_label, loc)) + # inner most header jumps to first body block + body_first_label = min(inst.loop_body.keys()) + header_block.body[-1].truebr = body_first_label + # add parfor body to blocks + for (l, b) in inst.loop_body.items(): + l, parfor_found = _lower_parfor_sequential_block( + l, b, new_blocks, typemap, calltypes, parfor_found, + scope=scope) + new_blocks[l] = transfer_scope(b, scope) + i = _find_first_parfor(block.body) + return block_label, parfor_found + + +def _find_first_parfor(body): + for (i, inst) in enumerate(body): + if isinstance(inst, Parfor) and not inst.no_sequential_lowering: + return i + return -1 + + +def get_parfor_params(blocks, options_fusion, fusion_info): + """find variables used in body of parfors from outside and save them. + computed as live variables at entry of first block. + """ + + # since parfor wrap creates a back-edge to first non-init basic block, + # live_map[first_non_init_block] contains variables defined in parfor body + # that could be undefined before. So we only consider variables that are + # actually defined before the parfor body in the program. + parfor_ids = set() + parfors = [] + pre_defs = set() + _, all_defs = compute_use_defs(blocks) + topo_order = find_topo_order(blocks) + for label in topo_order: + block = blocks[label] + for i, parfor in _find_parfors(block.body): + # find variable defs before the parfor in the same block + dummy_block = ir.Block(block.scope, block.loc) + dummy_block.body = block.body[:i] + before_defs = compute_use_defs({0: dummy_block}).defmap[0] + pre_defs |= before_defs + params = get_parfor_params_inner( + parfor, pre_defs, options_fusion, fusion_info, + ) + parfor.params, parfor.races = _combine_params_races_for_ssa_names( + block.scope, params, parfor.races, + ) + parfor_ids.add(parfor.id) + parfors.append(parfor) + + pre_defs |= all_defs[label] + return parfor_ids, parfors + + +def _combine_params_races_for_ssa_names(scope, params, races): + """Returns `(params|races1, races1)`, where `races1` contains all variables + in `races` are NOT referring to the same unversioned (SSA) variables in + `params`. + """ + def unversion(k): + try: + return scope.get_exact(k).unversioned_name + except ir.NotDefinedError: + # XXX: it's a bug that something references an undefined name + return k + + races1 = set(races) + unver_params = list(map(unversion, params)) + + for rv in races: + if any(unversion(rv) == pv for pv in unver_params): + races1.discard(rv) + else: + break + + return params | races1, races1 + + +def get_parfor_params_inner(parfor, pre_defs, options_fusion, fusion_info): + blocks = wrap_parfor_blocks(parfor) + cfg = compute_cfg_from_blocks(blocks) + usedefs = compute_use_defs(blocks) + live_map = compute_live_map(cfg, blocks, usedefs.usemap, usedefs.defmap) + parfor_ids, _ = get_parfor_params(blocks, options_fusion, fusion_info) + n_parfors = len(parfor_ids) + if n_parfors > 0: + if config.DEBUG_ARRAY_OPT_STATS: + after_fusion = ("After fusion" if options_fusion + else "With fusion disabled") + print(('{}, parallel for-loop {} has ' + 'nested Parfor(s) #{}.').format( + after_fusion, parfor.id, n_parfors, parfor_ids)) + fusion_info[parfor.id] = list(parfor_ids) + + unwrap_parfor_blocks(parfor) + keylist = sorted(live_map.keys()) + init_block = keylist[0] + first_non_init_block = keylist[1] + + before_defs = usedefs.defmap[init_block] | pre_defs + params = live_map[first_non_init_block] & before_defs + return params + + +def _find_parfors(body): + for i, inst in enumerate(body): + if isinstance(inst, Parfor): + yield i, inst + + +def _is_indirect_index(func_ir, index, nest_indices): + index_def = guard(get_definition, func_ir, index.name) + if isinstance(index_def, ir.Expr) and index_def.op == 'build_tuple': + if [x.name for x in index_def.items] == [x.name for x in nest_indices]: + return True + + return False + + +def get_array_indexed_with_parfor_index_internal(loop_body, + index, + ret_indexed, + ret_not_indexed, + nest_indices, + func_ir): + for blk in loop_body: + for stmt in blk.body: + if isinstance(stmt, (ir.StaticSetItem, ir.SetItem)): + setarray_index = get_index_var(stmt) + if (isinstance(setarray_index, ir.Var) and + (setarray_index.name == index or + _is_indirect_index( + func_ir, + setarray_index, + nest_indices))): + ret_indexed.add(stmt.target.name) + else: + ret_not_indexed.add(stmt.target.name) + elif (isinstance(stmt, ir.Assign) and + isinstance(stmt.value, ir.Expr) and + stmt.value.op in ['getitem', 'static_getitem']): + getarray_index = stmt.value.index + getarray_name = stmt.value.value.name + if (isinstance(getarray_index, ir.Var) and + (getarray_index.name == index or + _is_indirect_index( + func_ir, + getarray_index, + nest_indices))): + ret_indexed.add(getarray_name) + else: + ret_not_indexed.add(getarray_name) + elif isinstance(stmt, Parfor): + get_array_indexed_with_parfor_index_internal( + stmt.loop_body.values(), + index, + ret_indexed, + ret_not_indexed, + nest_indices, + func_ir) + + +def get_array_indexed_with_parfor_index(loop_body, + index, + nest_indices, + func_ir): + ret_indexed = set() + ret_not_indexed = set() + get_array_indexed_with_parfor_index_internal( + loop_body, + index, + ret_indexed, + ret_not_indexed, + nest_indices, + func_ir) + return ret_indexed, ret_not_indexed + + +def get_parfor_outputs(parfor, parfor_params): + """get arrays that are written to inside the parfor and need to be passed + as parameters to gufunc. + """ + # FIXME: The following assumes the target of all SetItem are outputs, + # which is wrong! + last_label = max(parfor.loop_body.keys()) + outputs = [] + for blk in parfor.loop_body.values(): + for stmt in blk.body: + if (isinstance(stmt, (ir.StaticSetItem, ir.SetItem)) and + get_index_var(stmt).name == parfor.index_var.name): + outputs.append(stmt.target.name) + # make sure these written arrays are in parfor parameters (live coming in) + outputs = list(set(outputs) & set(parfor_params)) + return sorted(outputs) + + +_RedVarInfo = make_dataclass( + "_RedVarInfo", + ["init_val", "reduce_nodes", "redop"], + frozen=True, +) + + +def get_parfor_reductions(func_ir, parfor, parfor_params, calltypes, reductions=None, + reduce_varnames=None, param_uses=None, param_nodes=None, + var_to_param=None): + """find variables that are updated using their previous values and an array + item accessed with parfor index, e.g. s = s+A[i] + """ + if reductions is None: + reductions = {} + if reduce_varnames is None: + reduce_varnames = [] + + # for each param variable, find what other variables are used to update it + # also, keep the related nodes + if param_uses is None: + param_uses = defaultdict(list) + if param_nodes is None: + param_nodes = defaultdict(list) + if var_to_param is None: + var_to_param = {} + + blocks = wrap_parfor_blocks(parfor) + topo_order = find_topo_order(blocks) + topo_order = topo_order[1:] # ignore init block + unwrap_parfor_blocks(parfor) + + for label in reversed(topo_order): + for stmt in reversed(parfor.loop_body[label].body): + if (isinstance(stmt, ir.Assign) + and (stmt.target.name in parfor_params + or stmt.target.name in var_to_param)): + lhs = stmt.target + rhs = stmt.value + cur_param = lhs if lhs.name in parfor_params else var_to_param[lhs.name] + used_vars = [] + if isinstance(rhs, ir.Var): + used_vars = [rhs.name] + elif isinstance(rhs, ir.Expr): + used_vars = [v.name for v in stmt.value.list_vars()] + param_uses[cur_param].extend(used_vars) + for v in used_vars: + var_to_param[v] = cur_param + # save copy of dependent stmt + stmt_cp = copy.deepcopy(stmt) + if stmt.value in calltypes: + calltypes[stmt_cp.value] = calltypes[stmt.value] + param_nodes[cur_param].append(stmt_cp) + if isinstance(stmt, Parfor): + # recursive parfors can have reductions like test_prange8 + get_parfor_reductions(func_ir, stmt, parfor_params, calltypes, + reductions, reduce_varnames, None, param_nodes, var_to_param) + + for param, used_vars in param_uses.items(): + # a parameter is a reduction variable if its value is used to update it + # check reduce_varnames since recursive parfors might have processed + # param already + param_name = param.name + if param_name in used_vars and param_name not in reduce_varnames: + param_nodes[param].reverse() + reduce_nodes = get_reduce_nodes(param, param_nodes[param], func_ir) + # Certain kinds of ill-formed Python (like potentially undefined + # variables) in combination with SSA can make things look like + # reductions except that they don't have reduction operators. + # If we get to this point but don't find a reduction operator + # then assume it is this situation and just don't treat this + # variable as a reduction. + if reduce_nodes is not None: + reduce_varnames.append(param_name) + check_conflicting_reduction_operators(param, reduce_nodes) + gri_out = guard(get_reduction_init, reduce_nodes) + if gri_out is not None: + init_val, redop = gri_out + else: + init_val = None + redop = None + reductions[param_name] = _RedVarInfo( + init_val=init_val, + reduce_nodes=reduce_nodes, + redop=redop, + ) + + return reduce_varnames, reductions + +def check_conflicting_reduction_operators(param, nodes): + """In prange, a user could theoretically specify conflicting + reduction operators. For example, in one spot it is += and + another spot *=. Here, we raise an exception if multiple + different reduction operators are used in one prange. + """ + first_red_func = None + for node in nodes: + if (isinstance(node, ir.Assign) and + isinstance(node.value, ir.Expr) and + node.value.op=='inplace_binop'): + if first_red_func is None: + first_red_func = node.value.fn + else: + if first_red_func != node.value.fn: + msg = ("Reduction variable %s has multiple conflicting " + "reduction operators." % param.unversioned_name) + raise errors.UnsupportedRewriteError(msg, node.loc) + +def get_reduction_init(nodes): + """ + Get initial value for known reductions. + Currently, only += and *= are supported. + """ + require(len(nodes) >= 1) + # there could be multiple extra assignments after the reduce node + # See: test_reduction_var_reuse + acc_expr = list(filter(lambda x: isinstance(x.value, ir.Expr), nodes))[-1].value + require(isinstance(acc_expr, ir.Expr) and acc_expr.op in ['inplace_binop', 'binop']) + acc_expr_fn = acc_expr.fn + if acc_expr.op == 'binop': + if acc_expr_fn == operator.add: + acc_expr_fn = operator.iadd + elif acc_expr_fn == operator.sub: + acc_expr_fn = operator.isub + elif acc_expr_fn == operator.mul: + acc_expr_fn = operator.imul + elif acc_expr_fn == operator.truediv: + acc_expr_fn = operator.itruediv + if acc_expr_fn == operator.iadd or acc_expr_fn == operator.isub: + return 0, acc_expr_fn + if ( acc_expr_fn == operator.imul + or acc_expr_fn == operator.itruediv ): + return 1, acc_expr_fn + return None, None + +def supported_reduction(x, func_ir): + if x.op == 'inplace_binop' or x.op == 'binop': + if x.fn == operator.ifloordiv or x.fn == operator.floordiv: + raise errors.NumbaValueError(("Parallel floordiv reductions are not supported. " + "If all divisors are integers then a floordiv " + "reduction can in some cases be parallelized as " + "a multiply reduction followed by a floordiv of " + "the resulting product."), x.loc) + supps = [operator.iadd, + operator.isub, + operator.imul, + operator.itruediv, + operator.add, + operator.sub, + operator.mul, + operator.truediv] + return x.fn in supps + if x.op == 'call': + callname = guard(find_callname, func_ir, x) + if callname in [ + ('max', 'builtins'), + ('min', 'builtins'), + ('datetime_minimum', 'numba.np.npdatetime_helpers'), + ('datetime_maximum', 'numba.np.npdatetime_helpers'), + ]: + return True + return False + +def get_reduce_nodes(reduction_node, nodes, func_ir): + """ + Get nodes that combine the reduction variable with a sentinel variable. + Recognizes the first node that combines the reduction variable with another + variable. + """ + reduce_nodes = None + defs = {} + + def cyclic_lookup(var, varonly=True, start=None): + """Lookup definition of ``var``. + Returns ``None`` if variable definition forms a cycle. + """ + lookedup_var = defs.get(var.name, None) + if isinstance(lookedup_var, ir.Var): + if start is None: + start = lookedup_var + elif start == lookedup_var: + # cycle detected + return None + return cyclic_lookup(lookedup_var, start=start) + else: + return var if (varonly or lookedup_var is None) else lookedup_var + + def noncyclic_lookup(*args, **kwargs): + """Similar to cyclic_lookup but raise AssertionError if a cycle is + detected. + """ + res = cyclic_lookup(*args, **kwargs) + if res is None: + raise AssertionError("unexpected cycle in lookup()") + return res + + name = reduction_node.name + unversioned_name = reduction_node.unversioned_name + for i, stmt in enumerate(nodes): + lhs = stmt.target + rhs = stmt.value + defs[lhs.name] = rhs + if isinstance(rhs, ir.Var) and rhs.name in defs: + rhs = cyclic_lookup(rhs) + if isinstance(rhs, ir.Expr): + in_vars = set(noncyclic_lookup(v, True).name + for v in rhs.list_vars()) + if name in in_vars: + # reductions like sum have an assignment afterwards + # e.g. $2 = a + $1; a = $2 + # reductions that are functions calls like max() don't have an + # extra assignment afterwards + + # This code was created when Numba had an IR generation strategy + # where a binop for a reduction would be followed by an + # assignment as follows: + #$c.4.15 = inplace_binop(fn=, ...>, lhs=c.3, rhs=$const20) + #c.4 = $c.4.15 + + # With Python 3.12 changes, Numba may separate that assignment + # to a new basic block. The code below looks and sees if an + # assignment to the reduction var follows the reduction operator + # and if not it searches the rest of the reduction nodes to find + # the assignment that should follow the reduction operator + # and then reorders the reduction nodes so that assignment + # follows the reduction operator. + if (i + 1 < len(nodes) and + ((not isinstance(nodes[i + 1], ir.Assign)) or + nodes[i + 1].target.unversioned_name != unversioned_name)): + foundj = None + # Iterate through the rest of the reduction nodes. + for j, jstmt in enumerate(nodes[i + 1:]): + # If this stmt is an assignment where the right-hand + # side of the assignment is the output of the reduction + # operator. + if isinstance(jstmt, ir.Assign) and jstmt.value == lhs: + # Remember the index of this node. Because of + # nodes[i+1] above, we have to add i + 1 to j below + # to get the index in the original nodes list. + foundj = i + j + 1 + break + if foundj is not None: + # If we found the correct assignment then move it to + # after the reduction operator. + nodes = (nodes[:i + 1] + # nodes up to operator + nodes[foundj:foundj + 1] + # assignment node + nodes[i + 1:foundj] + # between op and assign + nodes[foundj + 1:]) # after assignment node + + if (not (i+1 < len(nodes) and isinstance(nodes[i+1], ir.Assign) + and nodes[i+1].target.unversioned_name == unversioned_name) + and lhs.unversioned_name != unversioned_name): + raise ValueError( + f"Use of reduction variable {unversioned_name!r} other " + "than in a supported reduction function is not " + "permitted." + ) + + if not supported_reduction(rhs, func_ir): + raise ValueError(("Use of reduction variable " + unversioned_name + + " in an unsupported reduction function.")) + args = [(x.name, noncyclic_lookup(x, True)) + for x in get_expr_args(rhs) ] + non_red_args = [ x for (x, y) in args if y.name != name ] + assert len(non_red_args) == 1 + args = [ (x, y) for (x, y) in args if x != y.name ] + replace_dict = dict(args) + replace_dict[non_red_args[0]] = ir.Var(lhs.scope, name+"#init", lhs.loc) + replace_vars_inner(rhs, replace_dict) + reduce_nodes = nodes[i:] + break + return reduce_nodes + +def get_expr_args(expr): + """ + Get arguments of an expression node + """ + if expr.op in ['binop', 'inplace_binop']: + return [expr.lhs, expr.rhs] + if expr.op == 'call': + return [v for v in expr.args] + raise NotImplementedError("get arguments for expression {}".format(expr)) + +def visit_parfor_pattern_vars(parfor, callback, cbdata): + # currently, only stencil pattern has variables + for pattern in parfor.patterns: + if pattern[0] == 'stencil': + left_lengths = pattern[1][0] + for i in range(len(left_lengths)): + if isinstance(left_lengths[i], ir.Var): + left_lengths[i] = visit_vars_inner(left_lengths[i], + callback, cbdata) + right_lengths = pattern[1][1] + for i in range(len(right_lengths)): + if isinstance(right_lengths[i], ir.Var): + right_lengths[i] = visit_vars_inner(right_lengths[i], + callback, cbdata) + +def visit_vars_parfor(parfor, callback, cbdata): + if config.DEBUG_ARRAY_OPT >= 1: + print("visiting parfor vars for:", parfor) + print("cbdata: ", sorted(cbdata.items())) + for l in parfor.loop_nests: + l.index_variable = visit_vars_inner(l.index_variable, callback, cbdata) + if isinstance(l.start, ir.Var): + l.start = visit_vars_inner(l.start, callback, cbdata) + if isinstance(l.stop, ir.Var): + l.stop = visit_vars_inner(l.stop, callback, cbdata) + if isinstance(l.step, ir.Var): + l.step = visit_vars_inner(l.step, callback, cbdata) + visit_vars({-1: parfor.init_block}, callback, cbdata) + visit_parfor_pattern_vars(parfor, callback, cbdata) + visit_vars(parfor.loop_body, callback, cbdata) + return + + +# add call to visit parfor variable +ir_utils.visit_vars_extensions[Parfor] = visit_vars_parfor + + +def parfor_defs(parfor, use_set=None, def_set=None): + """list variables written in this parfor by recursively + calling compute_use_defs() on body and combining block defs. + """ + if use_set is None: + use_set = set() + if def_set is None: + def_set = set() + blocks = wrap_parfor_blocks(parfor) + uses, defs = compute_use_defs(blocks) + cfg = compute_cfg_from_blocks(blocks) + last_label = max(blocks.keys()) + unwrap_parfor_blocks(parfor) + + # Conservatively, only add defs for blocks that are definitely executed + # Go through blocks in order, as if they are statements of the block that + # includes the parfor, and update uses/defs. + + # no need for topo order of ir_utils + topo_order = cfg.topo_order() + # blocks that dominate last block are definitely executed + definitely_executed = cfg.dominators()[last_label] + # except loop bodies that might not execute + for loop in cfg.loops().values(): + definitely_executed -= loop.body + for label in topo_order: + if label in definitely_executed: + # see compute_use_defs() in analysis.py + # variables defined in the block that includes the parfor are not + # uses of that block (are not potentially live in the beginning of + # the block) + use_set.update(uses[label] - def_set) + def_set.update(defs[label]) + else: + use_set.update(uses[label] - def_set) + + # treat loop variables and size variables as use + loop_vars = { + l.start.name for l in parfor.loop_nests if isinstance( + l.start, ir.Var)} + loop_vars |= { + l.stop.name for l in parfor.loop_nests if isinstance( + l.stop, ir.Var)} + loop_vars |= { + l.step.name for l in parfor.loop_nests if isinstance( + l.step, ir.Var)} + use_set.update(loop_vars - def_set) + use_set |= get_parfor_pattern_vars(parfor) + + return analysis._use_defs_result(usemap=use_set, defmap=def_set) + + +analysis.ir_extension_usedefs[Parfor] = parfor_defs + + +def _parfor_use_alloca(parfor, alloca_set): + """ + Reduction variables for parfors and the reduction variables within + nested parfors must be stack allocated. + """ + alloca_set |= set(parfor.redvars) + + blocks = wrap_parfor_blocks(parfor) + alloca_set |= analysis.must_use_alloca(blocks) + + unwrap_parfor_blocks(parfor) + + +analysis.ir_extension_use_alloca[Parfor] = _parfor_use_alloca + + +def parfor_insert_dels(parfor, curr_dead_set): + """insert dels in parfor. input: dead variable set right after parfor. + returns the variables for which del was inserted. + """ + blocks = wrap_parfor_blocks(parfor) + cfg = compute_cfg_from_blocks(blocks) + usedefs = compute_use_defs(blocks) + live_map = compute_live_map(cfg, blocks, usedefs.usemap, usedefs.defmap) + dead_map = compute_dead_maps(cfg, blocks, live_map, usedefs.defmap) + + # treat loop variables and size variables as live + loop_vars = { + l.start.name for l in parfor.loop_nests if isinstance( + l.start, ir.Var)} + loop_vars |= { + l.stop.name for l in parfor.loop_nests if isinstance( + l.stop, ir.Var)} + loop_vars |= { + l.step.name for l in parfor.loop_nests if isinstance( + l.step, ir.Var)} + loop_vars |= {l.index_variable.name for l in parfor.loop_nests} + # for var_list in parfor.array_analysis.array_size_vars.values(): + # loop_vars |= {v.name for v in var_list if isinstance(v, ir.Var)} + + dead_set = set() + for label in blocks.keys(): + # only kill vars that are actually dead at the parfor's block + dead_map.internal[label] &= curr_dead_set + dead_map.internal[label] -= loop_vars + dead_set |= dead_map.internal[label] + dead_map.escaping[label] &= curr_dead_set + dead_map.escaping[label] -= loop_vars + dead_set |= dead_map.escaping[label] + + # dummy class to replace func_ir. _patch_var_dels only accesses blocks + class DummyFuncIR(object): + + def __init__(self, blocks): + self.blocks = blocks + post_proc = postproc.PostProcessor(DummyFuncIR(blocks)) + post_proc._patch_var_dels(dead_map.internal, dead_map.escaping) + unwrap_parfor_blocks(parfor) + + return dead_set | loop_vars + + +postproc.ir_extension_insert_dels[Parfor] = parfor_insert_dels + + +def maximize_fusion(func_ir, blocks, typemap, up_direction=True): + """ + Reorder statements to maximize parfor fusion. Push all parfors up or down + so they are adjacent. + """ + call_table, _ = get_call_table(blocks) + alias_map, arg_aliases = find_potential_aliases( + blocks, + func_ir.arg_names, + typemap, + func_ir + ) + for block in blocks.values(): + order_changed = True + while order_changed: + order_changed = maximize_fusion_inner( + func_ir, + block, + call_table, + alias_map, + arg_aliases, + up_direction + ) + +def maximize_fusion_inner(func_ir, block, call_table, alias_map, + arg_aliases, up_direction=True): + order_changed = False + i = 0 + # i goes to body[-3] (i+1 to body[-2]) since body[-1] is terminator and + # shouldn't be reordered + while i < len(block.body) - 2: + stmt = block.body[i] + next_stmt = block.body[i+1] + can_reorder = (_can_reorder_stmts(stmt, next_stmt, func_ir, + call_table, alias_map, arg_aliases) + if up_direction else _can_reorder_stmts(next_stmt, stmt, + func_ir, call_table, alias_map, arg_aliases)) + if can_reorder: + block.body[i] = next_stmt + block.body[i+1] = stmt + order_changed = True + i += 1 + return order_changed + +def expand_aliases(the_set, alias_map, arg_aliases): + ret = set() + for i in the_set: + if i in alias_map: + ret = ret.union(alias_map[i]) + if i in arg_aliases: + ret = ret.union(arg_aliases) + ret.add(i) + return ret + +def _can_reorder_stmts(stmt, next_stmt, func_ir, call_table, + alias_map, arg_aliases): + """ + Check dependencies to determine if a parfor can be reordered in the IR block + with a non-parfor statement. + """ + # swap only parfors with non-parfors + # don't reorder calls with side effects (e.g. file close) + # only read-read dependencies are OK + # make sure there is no write-write, write-read dependencies + if (isinstance(stmt, Parfor) + and not isinstance(next_stmt, Parfor) + and not isinstance(next_stmt, ir.Print) + and (not isinstance(next_stmt, ir.Assign) + or has_no_side_effect(next_stmt.value, set(), call_table) + or guard(is_assert_equiv, func_ir, next_stmt.value))): + stmt_accesses = expand_aliases({v.name for v in stmt.list_vars()}, + alias_map, arg_aliases) + stmt_writes = expand_aliases(get_parfor_writes(stmt), + alias_map, arg_aliases) + next_accesses = expand_aliases({v.name for v in next_stmt.list_vars()}, + alias_map, arg_aliases) + next_writes = expand_aliases(get_stmt_writes(next_stmt), + alias_map, arg_aliases) + if len((stmt_writes & next_accesses) + | (next_writes & stmt_accesses)) == 0: + return True + return False + +def is_assert_equiv(func_ir, expr): + func_name, mod_name = find_callname(func_ir, expr) + return func_name == 'assert_equiv' + + +def get_parfor_writes(parfor): + assert isinstance(parfor, Parfor) + writes = set() + blocks = parfor.loop_body.copy() + blocks[-1] = parfor.init_block + for block in blocks.values(): + for stmt in block.body: + writes.update(get_stmt_writes(stmt)) + if isinstance(stmt, Parfor): + writes.update(get_parfor_writes(stmt)) + return writes + +FusionReport = namedtuple('FusionReport', ['first', 'second', 'message']) + +def try_fuse(equiv_set, parfor1, parfor2, metadata, func_ir, typemap): + """try to fuse parfors and return a fused parfor, otherwise return None + """ + dprint("try_fuse: trying to fuse \n", parfor1, "\n", parfor2) + + # default report is None + report = None + + # fusion of parfors with different lowerers is not possible + if parfor1.lowerer != parfor2.lowerer: + dprint("try_fuse: parfors different lowerers") + msg = "- fusion failed: lowerer mismatch" + report = FusionReport(parfor1.id, parfor2.id, msg) + return None, report + + # fusion of parfors with different dimensions not supported yet + if len(parfor1.loop_nests) != len(parfor2.loop_nests): + dprint("try_fuse: parfors number of dimensions mismatch") + msg = "- fusion failed: number of loops mismatched, %s, %s." + fmt = "parallel loop #%s has a nest of %s loops" + l1 = fmt % (parfor1.id, len(parfor1.loop_nests)) + l2 = fmt % (parfor2.id, len(parfor2.loop_nests)) + report = FusionReport(parfor1.id, parfor2.id, msg % (l1, l2)) + return None, report + + ndims = len(parfor1.loop_nests) + # all loops should be equal length + + def is_equiv(x, y): + return x == y or equiv_set.is_equiv(x, y) + + def get_user_varname(v): + """get original variable name by user if possible""" + if not isinstance(v, ir.Var): + return v + v = v.name + if "var_rename_map" in metadata and v in metadata["var_rename_map"]: + user_varname = metadata["var_rename_map"][v] + return user_varname + return v + + for i in range(ndims): + nest1 = parfor1.loop_nests[i] + nest2 = parfor2.loop_nests[i] + if not (is_equiv(nest1.start, nest2.start) and + is_equiv(nest1.stop, nest2.stop) and + is_equiv(nest1.step, nest2.step)): + dprint("try_fuse: parfor dimension correlation mismatch", i) + msg = "- fusion failed: loop dimension mismatched in axis %s. " + msg += "slice(%s, %s, %s) != " % (get_user_varname(nest1.start), + get_user_varname(nest1.stop), get_user_varname(nest1.step)) + msg += "slice(%s, %s, %s)" % (get_user_varname(nest2.start), + get_user_varname(nest2.stop), get_user_varname(nest2.step)) + report = FusionReport(parfor1.id, parfor2.id, msg % i) + return None, report + + func_ir._definitions = build_definitions(func_ir.blocks) + p1_cross_dep, p1_ip, p1_ia, p1_non_ia = has_cross_iter_dep(parfor1, func_ir, typemap) + if not p1_cross_dep: + p2_cross_dep = has_cross_iter_dep(parfor2, func_ir, typemap, p1_ip, p1_ia, p1_non_ia)[0] + else: + p2_cross_dep = True + + if p1_cross_dep or p2_cross_dep: + dprint("try_fuse: parfor cross iteration dependency found") + msg = ("- fusion failed: cross iteration dependency found " + "between loops #%s and #%s") + report = FusionReport(parfor1.id, parfor2.id, + msg % (parfor1.id, parfor2.id)) + return None, report + + + # find parfor1's defs, only body is considered since init_block will run + # first after fusion as well + p1_body_usedefs = compute_use_defs(parfor1.loop_body) + p1_body_defs = set() + for defs in p1_body_usedefs.defmap.values(): + p1_body_defs |= defs + p1_body_defs |= get_parfor_writes(parfor1) + # Add reduction variables from parfor1 to the set of body defs + # so that if parfor2 reads the reduction variable it won't fuse. + p1_body_defs |= set(parfor1.redvars) + + p2_usedefs = compute_use_defs(parfor2.loop_body) + p2_uses = compute_use_defs({0: parfor2.init_block}).usemap[0] + for uses in p2_usedefs.usemap.values(): + p2_uses |= uses + + overlap = p1_body_defs.intersection(p2_uses) + # overlap are those variable defined in first parfor and used in the second + if len(overlap) != 0: + # Get all the arrays + _, p2arraynotindexed = get_array_indexed_with_parfor_index( + parfor2.loop_body.values(), + parfor2.index_var.name, + parfor2.get_loop_nest_vars(), + func_ir) + + unsafe_var = (not isinstance(typemap[x], types.ArrayCompatible) or x in p2arraynotindexed for x in overlap) + + if any(unsafe_var): + dprint("try_fuse: parfor2 depends on parfor1 body") + msg = ("- fusion failed: parallel loop %s has a dependency on the " + "body of parallel loop %s. ") + report = FusionReport(parfor1.id, parfor2.id, + msg % (parfor1.id, parfor2.id)) + return None, report + + return fuse_parfors_inner(parfor1, parfor2) + + +def fuse_parfors_inner(parfor1, parfor2): + # fuse parfor2 into parfor1 + # append parfor2's init block on parfor1's + parfor1.init_block.body.extend(parfor2.init_block.body) + + # append parfor2's first block to parfor1's last block + parfor2_first_label = min(parfor2.loop_body.keys()) + parfor2_first_block = parfor2.loop_body[parfor2_first_label].body + parfor1_first_label = min(parfor1.loop_body.keys()) + parfor1_last_label = max(parfor1.loop_body.keys()) + parfor1.loop_body[parfor1_last_label].body.extend(parfor2_first_block) + + # add parfor2 body blocks to parfor1's except first + parfor1.loop_body.update(parfor2.loop_body) + parfor1.loop_body.pop(parfor2_first_label) + + # replace parfor2 indices with parfor1's + ndims = len(parfor1.loop_nests) + index_dict = {parfor2.index_var.name: parfor1.index_var} + for i in range(ndims): + index_dict[parfor2.loop_nests[i].index_variable.name] = parfor1.loop_nests[ + i].index_variable + replace_vars(parfor1.loop_body, index_dict) + + # re-order labels from min to max + blocks = wrap_parfor_blocks(parfor1, entry_label=parfor1_first_label) + blocks = rename_labels(blocks) + unwrap_parfor_blocks(parfor1, blocks) + + nameset = set(x.name for x in index_dict.values()) + remove_duplicate_definitions(parfor1.loop_body, nameset) + parfor1.patterns.extend(parfor2.patterns) + if config.DEBUG_ARRAY_OPT_STATS: + print('Parallel for-loop #{} is fused into for-loop #{}.'.format( + parfor2.id, parfor1.id)) + + msg = '- fusion succeeded: parallel for-loop #{} is fused into for-loop #{}.' + msg = msg.format(parfor2.id, parfor1.id) + report = FusionReport(parfor1.id, parfor2.id, msg) + + return parfor1, report + + +def remove_duplicate_definitions(blocks, nameset): + """Remove duplicated definition for variables in the given nameset, which + is often a result of parfor fusion. + """ + for label, block in blocks.items(): + body = block.body + new_body = [] + defined = set() + for inst in body: + if isinstance(inst, ir.Assign): + name = inst.target.name + if name in nameset: + if name in defined: + continue + defined.add(name) + new_body.append(inst) + block.body = new_body + return + + +def has_cross_iter_dep( + parfor, + func_ir, + typemap, + index_positions=None, + indexed_arrays=None, + non_indexed_arrays=None): + # We should assume there is cross iteration dependency unless we can + # prove otherwise. Return True if there is a cross-iter dependency + # that should prevent fusion, False if fusion is okay. + # Also returns index_positions, indexed_arrays, and non_indexed_arrays + # who purpose is described below so that subsequent additional + # has_cross_iter_dep calls for other parfors can build on the same + # data structures to make sure that the array accesses generate no + # cross-iter dependencies both within a parfor but also across parfors. + + # TODO: make it more accurate using ud-chains + + # Get the index variable used by this parfor. + # This will hold other variables with equivalent value, e.g., a = index_var + indices = {l.index_variable.name for l in parfor.loop_nests} + # This set will store variables that are (potentially recursively) + # defined in relation to an index variable, e.g., a = index_var + 1. + # A getitem that uses an index variable from this set will be considered + # as potentially having a cross-iter dependency and so won't fuse. + derived_from_indices = set() + # For the first parfor considered for fusion, the latter 3 args will be None + # and initialized to empty. For the second parfor, the structures from the + # previous parfor are passed in so that cross-parfor violations of the + # below comments can prevent fusion. + # + # index_positions keeps track of which index positions have had an index + # variable used for them and which ones haven't for each possible array + # dimensionality. After the first array access is seen, if subsequent + # ones use a parfor index for a different dimension then we conservatively + # say that we can't fuse. For example, if a 2D array is accessed with + # a[parfor_index, 0] then index_positions[2] will be (True, False) and + # if a[0, parfor_index] happens later which is (False, True) then this + # conflicts with the previous value and will prevent fusion. + # + # indexed_arrays records arrays that are accessed with at least one + # parfor index. If such an array is later accessed with indices that + # don't include a parfor index then conservatively assume we can't fuse. + # + # non_indexed_arrays holds arrays that are indexed without a parfor index. + # If an array first accessed without a parfor index is later indexed + # with one then conservatively assume we can't fuse. + if index_positions is None: + index_positions = {} + if indexed_arrays is None: + indexed_arrays = set() + if non_indexed_arrays is None: + non_indexed_arrays = set() + + def add_check_position(new_position, + array_accessed, + index_positions, + indexed_arrays, + non_indexed_arrays): + """Returns True if there is a reason to prevent fusion based + on the rules described above. + new_position will be a list or tuple of booleans that + says whether the index in that spot is a parfor index + or not. array_accessed is the array on which the access + is occurring.""" + + # Convert list indices to tuple for generality. + if isinstance(new_position, list): + new_position = tuple(new_position) + + # If none of the indices are based on a parfor index. + if True not in new_position: + # See if this array has been accessed before with a + # a parfor index and if so say that we can't fuse. + if array_accessed in indexed_arrays: + return True + else: + # Either array is already in non_indexed arrays or we + # will add it. Either way, this index usage can fuse. + non_indexed_arrays.add(array_accessed) + return False + + # Fallthrough for cases where one of the indices is a parfor index. + # If this array was previously accessed without a parfor index then + # conservatively say we can't fuse. + if array_accessed in non_indexed_arrays: + return True + + indexed_arrays.add(array_accessed) + + npsize = len(new_position) + # See if we have not seen a npsize dimensioned array accessed before. + if npsize not in index_positions: + # If not then add current set of parfor/non-parfor indices and + # indicate it is safe as it is the first usage. + index_positions[npsize] = new_position + return False + + # Here we have a subsequent access to a npsize-dimensioned array. + # Make sure we see the same combination of parfor/non-parfor index + # indices that we've seen before. If not then return True saying + # that we can't fuse. + return index_positions[npsize] != new_position + + def check_index(stmt_index, + array_accessed, + index_positions, + indexed_arrays, + non_indexed_arrays, + derived_from_indices): + """Looks at the indices of a getitem or setitem to see if there + is a reason that they would prevent fusion. + Returns True if fusion should be prohibited, False otherwise. + """ + if isinstance(stmt_index, ir.Var): + # If the array is 2+ dimensions then the index should be a tuple. + if isinstance(typemap[stmt_index.name], types.BaseTuple): + # Get how the index tuple is constructed. + fbs_res = guard(find_build_sequence, func_ir, stmt_index) + if fbs_res is not None: + ind_seq, _ = fbs_res + # If any indices are derived from an index is used then + # return True to say we can't fuse. + if (all([x.name in indices or + x.name not in derived_from_indices for x in ind_seq])): + # Get position in index tuple where parfor indices used. + new_index_positions = [x.name in indices for x in ind_seq] + # Make sure that we aren't accessing a given array with + # different indices in a different order. + return add_check_position(new_index_positions, + array_accessed, + index_positions, + indexed_arrays, + non_indexed_arrays) + else: + # index derived from a parfor index used so no fusion + return True + else: + # Don't know how the index tuple is built so + # have to assume fusion can't happen. + return True + else: + # Should be for 1D arrays. + if stmt_index.name in indices: + # Array indexed by a parfor index variable. + # Make sure this 1D access is consistent with prior ones. + return add_check_position((True,), + array_accessed, + index_positions, + indexed_arrays, + non_indexed_arrays) + elif stmt_index.name in derived_from_indices: + # If we ever index an array with something calculated + # from an index then no fusion. + return True + else: + # Some kind of index that isn't a parfor index or + # one derived from one, e.g., a constant. Make sure + # this is consistent with prior accessed of this array. + return add_check_position((False,), + array_accessed, + index_positions, + indexed_arrays, + non_indexed_arrays) + else: + # We don't know how to handle non-Var indices so no fusion. + return True + + # All branches above should cover all the cases and each should + # return so we should never get here. + raise errors.InternalError("Some code path in the parfor fusion " + "cross-iteration dependency checker " + "check_index didn't return a result.") + + # Iterate through all the statements in the parfor. + for b in parfor.loop_body.values(): + for stmt in b.body: + # Make sure SetItem accesses are fusion safe. + if isinstance(stmt, (ir.SetItem, ir.StaticSetItem)): + if isinstance(typemap[stmt.target.name], types.npytypes.Array): + # Check index safety with prior array accesses. + if check_index(stmt.index, + stmt.target.name, + index_positions, + indexed_arrays, + non_indexed_arrays, + derived_from_indices): + return True, index_positions, indexed_arrays, non_indexed_arrays + # Fusion safe so go to next statement. + continue + elif isinstance(stmt, ir.Assign): + # If stmt of form a = parfor_index then add "a" to set of + # parfor indices. + if isinstance(stmt.value, ir.Var): + if stmt.value.name in indices: + indices.add(stmt.target.name) + continue + elif isinstance(stmt.value, ir.Expr): + op = stmt.value.op + # Make sure getitem accesses are fusion safe. + if op in ['getitem', 'static_getitem']: + if isinstance(typemap[stmt.value.value.name], types.npytypes.Array): + # Check index safety with prior array accesses. + if check_index(stmt.value.index, + stmt.value.value.name, + index_positions, + indexed_arrays, + non_indexed_arrays, + derived_from_indices): + return True, index_positions, indexed_arrays, non_indexed_arrays + # Fusion safe so go to next statement. + continue + elif op == 'call': + # If there is a call in the parfor body that takes some + # array parameter then we have no way to analyze what + # that call is doing so presume it is unsafe for fusion. + if (any([isinstance(typemap[x.name], types.npytypes.Array) + for x in stmt.value.list_vars()])): + return True, index_positions, indexed_arrays, non_indexed_arrays + + # Get the vars used by this non-setitem/getitem statement. + rhs_vars = [x.name for x in stmt.value.list_vars()] + # If a parfor index is used as part of this statement or + # something previous determined to be derived from a parfor + # index then add the target variable to the set of + # variables that are derived from parfors and so should + # prevent fusion if used as an index. + if (not indices.isdisjoint(rhs_vars) or + not derived_from_indices.isdisjoint(rhs_vars)): + derived_from_indices.add(stmt.target.name) + + return False, index_positions, indexed_arrays, non_indexed_arrays + + +def dprint(*s): + if config.DEBUG_ARRAY_OPT >= 1: + print(*s) + +def get_parfor_pattern_vars(parfor): + """ get the variables used in parfor pattern information + """ + out = set() + # currently, only stencil pattern has variables + for pattern in parfor.patterns: + if pattern[0] == 'stencil': + left_lengths = pattern[1][0] + right_lengths = pattern[1][1] + for v in left_lengths+right_lengths: + if isinstance(v, ir.Var): + out.add(v.name) + return out + +def remove_dead_parfor(parfor, lives, lives_n_aliases, arg_aliases, alias_map, func_ir, typemap): + """ remove dead code inside parfor including get/sets + """ + + with dummy_return_in_loop_body(parfor.loop_body): + labels = find_topo_order(parfor.loop_body) + + # get/setitem replacement should ideally use dataflow to propagate setitem + # saved values, but for simplicity we handle the common case of propagating + # setitems in the first block (which is dominant) if the array is not + # potentially changed in any way + first_label = labels[0] + first_block_saved_values = {} + _update_parfor_get_setitems( + parfor.loop_body[first_label].body, + parfor.index_var, alias_map, + first_block_saved_values, + lives_n_aliases + ) + + # remove saved first block setitems if array potentially changed later + saved_arrs = set(first_block_saved_values.keys()) + for l in labels: + if l == first_label: + continue + for stmt in parfor.loop_body[l].body: + if (isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Expr) + and stmt.value.op == 'getitem' + and stmt.value.index.name == parfor.index_var.name): + continue + varnames = set(v.name for v in stmt.list_vars()) + rm_arrs = varnames & saved_arrs + for a in rm_arrs: + first_block_saved_values.pop(a, None) + + + # replace getitems with available value + # e.g. A[i] = v; ... s = A[i] -> s = v + for l in labels: + if l == first_label: + continue + block = parfor.loop_body[l] + saved_values = first_block_saved_values.copy() + _update_parfor_get_setitems(block.body, parfor.index_var, alias_map, + saved_values, lives_n_aliases) + + + # after getitem replacement, remove extra setitems + blocks = parfor.loop_body.copy() # shallow copy is enough + last_label = max(blocks.keys()) + return_label, tuple_var = _add_liveness_return_block(blocks, lives_n_aliases, typemap) + # jump to return label + jump = ir.Jump(return_label, ir.Loc("parfors_dummy", -1)) + blocks[last_label].body.append(jump) + cfg = compute_cfg_from_blocks(blocks) + usedefs = compute_use_defs(blocks) + live_map = compute_live_map(cfg, blocks, usedefs.usemap, usedefs.defmap) + alias_set = set(alias_map.keys()) + + for label, block in blocks.items(): + new_body = [] + in_lives = {v.name for v in block.terminator.list_vars()} + # find live variables at the end of block + for out_blk, _data in cfg.successors(label): + in_lives |= live_map[out_blk] + for stmt in reversed(block.body): + # aliases of lives are also live for setitems + alias_lives = in_lives & alias_set + for v in alias_lives: + in_lives |= alias_map[v] + if (isinstance(stmt, (ir.StaticSetItem, ir.SetItem)) and + get_index_var(stmt).name == parfor.index_var.name and + stmt.target.name not in in_lives and + stmt.target.name not in arg_aliases): + continue + in_lives |= {v.name for v in stmt.list_vars()} + new_body.append(stmt) + new_body.reverse() + block.body = new_body + + typemap.pop(tuple_var.name) # remove dummy tuple type + blocks[last_label].body.pop() # remove jump + + """ + Process parfor body recursively. + Note that this is the only place in this function that uses the + argument lives instead of lives_n_aliases. The former does not + include the aliases of live variables but only the live variable + names themselves. See a comment in this function for how that + is used. + """ + remove_dead_parfor_recursive( + parfor, lives, arg_aliases, alias_map, func_ir, typemap) + + # remove parfor if empty + is_empty = len(parfor.init_block.body) == 0 + for block in parfor.loop_body.values(): + is_empty &= len(block.body) == 0 + if is_empty: + return None + return parfor + +def _update_parfor_get_setitems(block_body, index_var, alias_map, + saved_values, lives): + """ + replace getitems of a previously set array in a block of parfor loop body + """ + for stmt in block_body: + if (isinstance(stmt, (ir.StaticSetItem, ir.SetItem)) and + get_index_var(stmt).name == index_var.name and + stmt.target.name not in lives): + # saved values of aliases of SetItem target array are invalid + for w in alias_map.get(stmt.target.name, []): + saved_values.pop(w, None) + # set saved value after invalidation since alias_map may + # contain the array itself (e.g. pi example) + saved_values[stmt.target.name] = stmt.value + continue + if isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Expr): + rhs = stmt.value + if rhs.op == 'getitem' and isinstance(rhs.index, ir.Var): + if rhs.index.name == index_var.name: + # replace getitem if value saved + stmt.value = saved_values.get(rhs.value.name, rhs) + continue + # conservative assumption: array is modified if referenced + # remove all referenced arrays + for v in stmt.list_vars(): + saved_values.pop(v.name, None) + # aliases are potentially modified as well + for w in alias_map.get(v.name, []): + saved_values.pop(w, None) + + return + +ir_utils.remove_dead_extensions[Parfor] = remove_dead_parfor + + +def remove_dead_parfor_recursive(parfor, lives, arg_aliases, alias_map, + func_ir, typemap): + """create a dummy function from parfor and call remove dead recursively + """ + blocks = parfor.loop_body.copy() # shallow copy is enough + first_body_block = min(blocks.keys()) + assert first_body_block > 0 # we are using 0 for init block here + last_label = max(blocks.keys()) + + """ + Previously, this statement used lives_n_aliases. That had the effect of + keeping variables in the init_block alive if they aliased an array that + was later written to. By using just lives to indicate which variables + names are live at exit of the parfor but then using alias_map for the + actual recursive dead code removal, we keep any writes to aliased arrays + alive but also allow aliasing assignments (i.e., a = b) to be eliminated + so long as 'b' is not written to through the variable 'a' later on. + This makes assignment handling of remove_dead_block work properly since + it allows distinguishing between live variables and their aliases. + """ + return_label, tuple_var = _add_liveness_return_block(blocks, lives, typemap) + + # branch back to first body label to simulate loop + scope = blocks[last_label].scope + + branchcond = ir.Var(scope, mk_unique_var("$branchcond"), ir.Loc("parfors_dummy", -1)) + typemap[branchcond.name] = types.boolean + + branch = ir.Branch(branchcond, first_body_block, return_label, ir.Loc("parfors_dummy", -1)) + blocks[last_label].body.append(branch) + + # add dummy jump in init_block for CFG to work + blocks[0] = parfor.init_block + blocks[0].body.append(ir.Jump(first_body_block, ir.Loc("parfors_dummy", -1))) + + # args var including aliases is ok + remove_dead(blocks, arg_aliases, func_ir, typemap, alias_map, arg_aliases) + typemap.pop(tuple_var.name) # remove dummy tuple type + blocks[0].body.pop() # remove dummy jump + blocks[last_label].body.pop() # remove branch + return + +def _add_liveness_return_block(blocks, lives, typemap): + last_label = max(blocks.keys()) + return_label = last_label + 1 + + loc = blocks[last_label].loc + scope = blocks[last_label].scope + blocks[return_label] = ir.Block(scope, loc) + + # add lives in a dummpy return to last block to avoid their removal + tuple_var = ir.Var(scope, mk_unique_var("$tuple_var"), loc) + # dummy type for tuple_var + typemap[tuple_var.name] = types.containers.UniTuple( + types.uintp, 2) + live_vars = [ir.Var(scope, v, loc) for v in lives] + tuple_call = ir.Expr.build_tuple(live_vars, loc) + blocks[return_label].body.append(ir.Assign(tuple_call, tuple_var, loc)) + blocks[return_label].body.append(ir.Return(tuple_var, loc)) + return return_label, tuple_var + + +def find_potential_aliases_parfor(parfor, args, typemap, func_ir, alias_map, arg_aliases): + blocks = wrap_parfor_blocks(parfor) + ir_utils.find_potential_aliases( + blocks, args, typemap, func_ir, alias_map, arg_aliases) + unwrap_parfor_blocks(parfor) + return + +ir_utils.alias_analysis_extensions[Parfor] = find_potential_aliases_parfor + +def simplify_parfor_body_CFG(blocks): + """simplify CFG of body loops in parfors""" + n_parfors = 0 + for block in blocks.values(): + for stmt in block.body: + if isinstance(stmt, Parfor): + n_parfors += 1 + parfor = stmt + # add dummy return to enable CFG creation + # can't use dummy_return_in_loop_body since body changes + last_block = parfor.loop_body[max(parfor.loop_body.keys())] + scope = last_block.scope + loc = ir.Loc("parfors_dummy", -1) + const = ir.Var(scope, mk_unique_var("$const"), loc) + last_block.body.append(ir.Assign(ir.Const(0, loc), const, loc)) + last_block.body.append(ir.Return(const, loc)) + parfor.loop_body = simplify_CFG(parfor.loop_body) + last_block = parfor.loop_body[max(parfor.loop_body.keys())] + last_block.body.pop() + # call on body recursively + simplify_parfor_body_CFG(parfor.loop_body) + return n_parfors + + +def wrap_parfor_blocks(parfor, entry_label = None): + """wrap parfor blocks for analysis/optimization like CFG""" + blocks = parfor.loop_body.copy() # shallow copy is enough + if entry_label is None: + entry_label = min(blocks.keys()) + assert entry_label > 0 # we are using 0 for init block here + + # add dummy jump in init_block for CFG to work + blocks[0] = parfor.init_block + blocks[0].body.append(ir.Jump(entry_label, blocks[0].loc)) + for block in blocks.values(): + if len(block.body) == 0 or (not block.body[-1].is_terminator): + block.body.append(ir.Jump(entry_label, block.loc)) + return blocks + + +def unwrap_parfor_blocks(parfor, blocks=None): + """ + unwrap parfor blocks after analysis/optimization. + Allows changes to the parfor loop. + """ + if blocks is not None: + # make sure init block isn't removed + init_block_label = min(blocks.keys()) + # update loop body blocks + blocks.pop(init_block_label) + parfor.loop_body = blocks + + # make sure dummy jump to loop body isn't altered + first_body_label = min(parfor.loop_body.keys()) + assert isinstance(parfor.init_block.body[-1], ir.Jump) + + # remove dummy jump to loop body + parfor.init_block.body.pop() + + # make sure dummy jump back to loop body isn't altered + for block in parfor.loop_body.values(): + if (isinstance(block.body[-1], ir.Jump) and + block.body[-1].target == first_body_label): + # remove dummy jump back to loop + block.body.pop() + return + + +def get_copies_parfor(parfor, typemap): + """find copies generated/killed by parfor""" + blocks = wrap_parfor_blocks(parfor) + in_copies_parfor, out_copies_parfor = copy_propagate(blocks, typemap) + in_gen_copies, in_extra_kill = get_block_copies(blocks, typemap) + unwrap_parfor_blocks(parfor) + + # parfor's extra kill is kills of its init block, + # and all possible gens and kills of it's body loop. + # body doesn't gen and only kills since it may or may not run + # TODO: save copies that are repeated in parfor + kill_set = in_extra_kill[0] + for label in parfor.loop_body.keys(): + kill_set |= {l for l, r in in_gen_copies[label]} + kill_set |= in_extra_kill[label] + + # gen copies is copies generated by init that are not killed by body + last_label = max(parfor.loop_body.keys()) + gens = out_copies_parfor[last_label] & in_gen_copies[0] + + if config.DEBUG_ARRAY_OPT >= 1: + print("copy propagate parfor gens:", gens, "kill_set", kill_set) + return gens, kill_set + + +ir_utils.copy_propagate_extensions[Parfor] = get_copies_parfor + + +def apply_copies_parfor(parfor, var_dict, name_var_table, + typemap, calltypes, save_copies): + """apply copy propagate recursively in parfor""" + # replace variables in pattern metadata like stencil neighborhood + for i, pattern in enumerate(parfor.patterns): + if pattern[0] == 'stencil': + parfor.patterns[i] = ('stencil', + replace_vars_inner(pattern[1], var_dict)) + + # replace loop boundary variables + for l in parfor.loop_nests: + l.start = replace_vars_inner(l.start, var_dict) + l.stop = replace_vars_inner(l.stop, var_dict) + l.step = replace_vars_inner(l.step, var_dict) + + blocks = wrap_parfor_blocks(parfor) + # add dummy assigns for each copy + assign_list = [] + for lhs_name, rhs in var_dict.items(): + assign_list.append(ir.Assign(rhs, name_var_table[lhs_name], + ir.Loc("dummy", -1))) + blocks[0].body = assign_list + blocks[0].body + in_copies_parfor, out_copies_parfor = copy_propagate(blocks, typemap) + apply_copy_propagate(blocks, in_copies_parfor, name_var_table, typemap, + calltypes, save_copies) + unwrap_parfor_blocks(parfor) + # remove dummy assignments + blocks[0].body = blocks[0].body[len(assign_list):] + return + + +ir_utils.apply_copy_propagate_extensions[Parfor] = apply_copies_parfor + + +def push_call_vars(blocks, saved_globals, saved_getattrs, typemap, nested=False): + """push call variables to right before their call site. + assuming one global/getattr is created for each call site and control flow + doesn't change it. + """ + for block in blocks.values(): + new_body = [] + # global/attr variables that are defined in this block already, + # no need to reassign them + block_defs = set() + # Some definitions are copied right before the call but then we + # need to rename that symbol in that block so that typing won't + # generate an error trying to lock the save var twice. + # In rename_dict, we collect the symbols that must be renamed in + # this block. We collect them then apply the renaming at the end. + rename_dict = {} + for stmt in block.body: + def process_assign(stmt): + if isinstance(stmt, ir.Assign): + rhs = stmt.value + lhs = stmt.target + if (isinstance(rhs, ir.Global)): + saved_globals[lhs.name] = stmt + block_defs.add(lhs.name) + elif isinstance(rhs, ir.Expr) and rhs.op == 'getattr': + if (rhs.value.name in saved_globals + or rhs.value.name in saved_getattrs): + saved_getattrs[lhs.name] = stmt + block_defs.add(lhs.name) + + if not nested and isinstance(stmt, Parfor): + for s in stmt.init_block.body: + process_assign(s) + pblocks = stmt.loop_body.copy() + push_call_vars(pblocks, saved_globals, saved_getattrs, typemap, nested=True) + new_body.append(stmt) + continue + else: + process_assign(stmt) + for v in stmt.list_vars(): + new_body += _get_saved_call_nodes(v.name, saved_globals, + saved_getattrs, block_defs, rename_dict) + new_body.append(stmt) + block.body = new_body + # If there is anything to rename then apply the renaming here. + if len(rename_dict) > 0: + # Fix-up the typing for the renamed vars. + for k, v in rename_dict.items(): + typemap[v] = typemap[k] + # This is only to call replace_var_names which takes a dict. + temp_blocks = {0: block} + replace_var_names(temp_blocks, rename_dict) + + return + + +def _get_saved_call_nodes(fname, saved_globals, saved_getattrs, block_defs, rename_dict): + """ Implement the copying of globals or getattrs for the purposes noted in + push_call_vars. We make a new var and assign to it a copy of the + global or getattr. We remember this new assignment node and add an + entry in the renaming dictionary so that for this block the original + var name is replaced by the new var name we created. + """ + nodes = [] + while (fname not in block_defs and (fname in saved_globals + or fname in saved_getattrs)): + def rename_global_or_getattr(obj, var_base, nodes, block_defs, rename_dict): + assert(isinstance(obj, ir.Assign)) + renamed_var = ir.Var(obj.target.scope, + mk_unique_var(var_base), + obj.target.loc) + renamed_assign = ir.Assign(copy.deepcopy(obj.value), + renamed_var, + obj.loc) + nodes.append(renamed_assign) + block_defs.add(obj.target.name) + rename_dict[obj.target.name] = renamed_assign.target.name + + if fname in saved_globals: + rename_global_or_getattr(saved_globals[fname], "$push_global_to_block", + nodes, block_defs, rename_dict) + fname = '_PA_DONE' + elif fname in saved_getattrs: + rename_global_or_getattr(saved_getattrs[fname], "$push_getattr_to_block", + nodes, block_defs, rename_dict) + fname = saved_getattrs[fname].value.value.name + nodes.reverse() + return nodes + +def repr_arrayexpr(arrayexpr): + """Extract operators from arrayexpr to represent it abstractly as a string. + """ + if isinstance(arrayexpr, tuple): + opr = arrayexpr[0] + # sometimes opr is not string like '+', but is a ufunc object + if not isinstance(opr, str): + if hasattr(opr, '__name__'): + opr = opr.__name__ + else: + opr = '_' # can return dummy since repr is not critical + args = arrayexpr[1] + if len(args) == 1: + return '({}({}))'.format(opr, repr_arrayexpr(args[0])) + else: + opr = ' ' + opr + ' ' + return '({})'.format(opr.join([ repr_arrayexpr(x) for x in args ])) + elif isinstance(arrayexpr, numba.core.ir.Var): + name = arrayexpr.name + if name.startswith('$'): + return '\'%s\' (temporary variable)' % name + else: + return name + elif isinstance(arrayexpr, numba.core.ir.Const): + return repr(arrayexpr.value) + else: + return '_' + +def fix_generator_types(generator_info, return_type, typemap): + """postproc updates generator_info with live variables after transformations + but generator variables have types in return_type that are updated here. + """ + new_state_types = [] + for v in generator_info.state_vars: + new_state_types.append(typemap[v]) + return_type.state_types = tuple(new_state_types) + return + + +def get_parfor_call_table(parfor, call_table=None, reverse_call_table=None): + if call_table is None: + call_table = {} + if reverse_call_table is None: + reverse_call_table = {} + blocks = wrap_parfor_blocks(parfor) + call_table, reverse_call_table = get_call_table(blocks, call_table, + reverse_call_table) + unwrap_parfor_blocks(parfor) + return call_table, reverse_call_table + + +ir_utils.call_table_extensions[Parfor] = get_parfor_call_table + + +def get_parfor_tuple_table(parfor, tuple_table=None): + if tuple_table is None: + tuple_table = {} + blocks = wrap_parfor_blocks(parfor) + tuple_table = ir_utils.get_tuple_table(blocks, tuple_table) + unwrap_parfor_blocks(parfor) + return tuple_table + + +ir_utils.tuple_table_extensions[Parfor] = get_parfor_tuple_table + + +def get_parfor_array_accesses(parfor, accesses=None): + if accesses is None: + accesses = set() + blocks = wrap_parfor_blocks(parfor) + accesses = ir_utils.get_array_accesses(blocks, accesses) + unwrap_parfor_blocks(parfor) + return accesses + + +# parfor handler is same as +ir_utils.array_accesses_extensions[Parfor] = get_parfor_array_accesses + + +def parfor_add_offset_to_labels(parfor, offset): + blocks = wrap_parfor_blocks(parfor) + blocks = add_offset_to_labels(blocks, offset) + blocks[0] = blocks[offset] + blocks.pop(offset) + unwrap_parfor_blocks(parfor, blocks) + return + + +ir_utils.add_offset_to_labels_extensions[Parfor] = parfor_add_offset_to_labels + + +def parfor_find_max_label(parfor): + blocks = wrap_parfor_blocks(parfor) + max_label = ir_utils.find_max_label(blocks) + unwrap_parfor_blocks(parfor) + return max_label + +ir_utils.find_max_label_extensions[Parfor] = parfor_find_max_label + + +def parfor_typeinfer(parfor, typeinferer): + save_blocks = typeinferer.blocks + blocks = wrap_parfor_blocks(parfor) + index_vars = [l.index_variable for l in parfor.loop_nests] + # no need to handle parfor.index_var (tuple of variables), since it will be + # assigned to a tuple from individual indices + first_block = min(blocks.keys()) + loc = blocks[first_block].loc + # XXX + index_assigns = [ir.Assign(ir.Const(1, loc=loc, use_literal_type=False), v, loc) for v in index_vars] + save_first_block_body = blocks[first_block].body + blocks[first_block].body = index_assigns + blocks[first_block].body + typeinferer.blocks = blocks + typeinferer.build_constraint() + typeinferer.blocks = save_blocks + blocks[first_block].body = save_first_block_body + unwrap_parfor_blocks(parfor) + + +typeinfer.typeinfer_extensions[Parfor] = parfor_typeinfer + +def build_parfor_definitions(parfor, definitions=None): + """get variable definition table for parfors""" + if definitions is None: + definitions = defaultdict(list) + + # avoid wrap_parfor_blocks() since build_definitions is called inside + # find_potential_aliases_parfor where the parfor is already wrapped + build_definitions(parfor.loop_body, definitions) + build_definitions({0: parfor.init_block}, definitions) + return definitions + +ir_utils.build_defs_extensions[Parfor] = build_parfor_definitions + +@contextmanager +def dummy_return_in_loop_body(loop_body): + """adds dummy return to last block of parfor loop body for CFG computation + """ + # max is last block since we add it manually for prange + last_label = max(loop_body.keys()) + scope = loop_body[last_label].scope + const = ir.Var(scope, mk_unique_var("$const"), ir.Loc("parfors_dummy", -1)) + loop_body[last_label].body.append( + ir.Return(const, ir.Loc("parfors_dummy", -1))) + yield + # remove dummy return + loop_body[last_label].body.pop() + +@infer_global(reduce) +class ReduceInfer(AbstractTemplate): + def generic(self, args, kws): + assert not kws + if len(args) != 3: + raise errors.NumbaAssertionError("len(args) != 3") + assert isinstance(args[1], types.Array) + return signature(args[1].dtype, *args) + + +def ensure_parallel_support(): + """Check if the platform supports parallel=True and raise if it does not. + """ + if config.IS_32BITS: + msg = ("The 'parallel' target is not currently supported on 32 bit " + "hardware.") + raise errors.UnsupportedParforsError(msg) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/parfor_lowering.py b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/parfor_lowering.py new file mode 100644 index 0000000000000000000000000000000000000000..38e40a889b24caf5e98aeeab75adfb9e5a4ba2b1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/parfor_lowering.py @@ -0,0 +1,2068 @@ +import copy +import operator + +import types as pytypes +import operator +import warnings +from dataclasses import make_dataclass + +import llvmlite.ir +import numpy as np + +import numba +from numba.parfors import parfor +from numba.core import types, ir, config, compiler, sigutils, cgutils +from numba.core.ir_utils import ( + add_offset_to_labels, + replace_var_names, + remove_dels, + legalize_names, + rename_labels, + get_name_var_table, + visit_vars_inner, + get_definition, + guard, + get_call_table, + is_pure, + get_np_ufunc_typ, + get_unused_var_name, + is_const_call, + fixup_var_define_in_scope, + transfer_scope, + find_max_label, + get_global_func_typ, + find_topo_order, +) +from numba.core.typing import signature +from numba.core import lowering +from numba.parfors.parfor import ensure_parallel_support +from numba.core.errors import ( + NumbaParallelSafetyWarning, NotDefinedError, CompilerError, InternalError, +) +from numba.parfors.parfor_lowering_utils import ParforLoweringBuilder + + +class ParforLower(lowering.Lower): + """This is a custom lowering class that extends standard lowering so as + to accommodate parfor.Parfor nodes.""" + + # custom instruction lowering to handle parfor nodes + def lower_inst(self, inst): + if isinstance(inst, parfor.Parfor): + _lower_parfor_parallel(self, inst) + else: + super().lower_inst(inst) + + @property + def _disable_sroa_like_opt(self): + """ + Force disable this because Parfor use-defs is incompatible---it only + considers use-defs in blocks that must be executing. + See https://github.com/numba/numba/commit/017e2ff9db87fc34149b49dd5367ecbf0bb45268 + """ + return True + + +def _lower_parfor_parallel(lowerer, parfor): + if parfor.lowerer is None: + return _lower_parfor_parallel_std(lowerer, parfor) + else: + return parfor.lowerer(lowerer, parfor) + + +def _lower_parfor_parallel_std(lowerer, parfor): + """Lowerer that handles LLVM code generation for parfor. + This function lowers a parfor IR node to LLVM. + The general approach is as follows: + 1) The code from the parfor's init block is lowered normally + in the context of the current function. + 2) The body of the parfor is transformed into a gufunc function. + 3) Code is inserted into the main function that calls do_scheduling + to divide the iteration space for each thread, allocates + reduction arrays, calls the gufunc function, and then invokes + the reduction function across the reduction arrays to produce + the final reduction values. + """ + from numba.np.ufunc.parallel import get_thread_count + + ensure_parallel_support() + typingctx = lowerer.context.typing_context + targetctx = lowerer.context + builder = lowerer.builder + # We copy the typemap here because for race condition variable we'll + # update their type to array so they can be updated by the gufunc. + orig_typemap = lowerer.fndesc.typemap + # replace original typemap with copy and restore the original at the end. + lowerer.fndesc.typemap = copy.copy(orig_typemap) + if config.DEBUG_ARRAY_OPT: + print("lowerer.fndesc", lowerer.fndesc, type(lowerer.fndesc)) + typemap = lowerer.fndesc.typemap + varmap = lowerer.varmap + + if config.DEBUG_ARRAY_OPT: + print("_lower_parfor_parallel") + parfor.dump() + + loc = parfor.init_block.loc + scope = parfor.init_block.scope + + # produce instructions for init_block + if config.DEBUG_ARRAY_OPT: + print("init_block = ", parfor.init_block, " ", type(parfor.init_block)) + for instr in parfor.init_block.body: + if config.DEBUG_ARRAY_OPT: + print("lower init_block instr = ", instr) + lowerer.lower_inst(instr) + + for racevar in parfor.races: + if racevar not in varmap: + rvtyp = typemap[racevar] + rv = ir.Var(scope, racevar, loc) + lowerer._alloca_var(rv.name, rvtyp) + + alias_map = {} + arg_aliases = {} + numba.parfors.parfor.find_potential_aliases_parfor(parfor, parfor.params, typemap, + lowerer.func_ir, alias_map, arg_aliases) + if config.DEBUG_ARRAY_OPT: + print("alias_map", alias_map) + print("arg_aliases", arg_aliases) + + # run get_parfor_outputs() and get_parfor_reductions() before gufunc creation + # since Jumps are modified so CFG of loop_body dict will become invalid + assert parfor.params is not None + + parfor_output_arrays = numba.parfors.parfor.get_parfor_outputs( + parfor, parfor.params) + parfor_redvars, parfor_reddict = parfor.redvars, parfor.reddict + if config.DEBUG_ARRAY_OPT: + print("parfor_redvars:", parfor_redvars) + print("parfor_reddict:", parfor_reddict) + + # init reduction array allocation here. + nredvars = len(parfor_redvars) + redarrs = {} + to_cleanup = [] + if nredvars > 0: + # reduction arrays outer dimension equal to thread count + scope = parfor.init_block.scope + loc = parfor.init_block.loc + pfbdr = ParforLoweringBuilder(lowerer=lowerer, scope=scope, loc=loc) + + # Get the Numba internal function to call to get the thread count. + get_num_threads = pfbdr.bind_global_function( + fobj=numba.np.ufunc.parallel._iget_num_threads, + ftype=get_global_func_typ(numba.np.ufunc.parallel._iget_num_threads), + args=() + ) + + # Insert the call to assign the thread count to a variable. + num_threads_var = pfbdr.assign( + rhs=pfbdr.call(get_num_threads, args=[]), + typ=types.intp, + name="num_threads_var") + + # For each reduction variable... + for i in range(nredvars): + red_name = parfor_redvars[i] + # Get the type of the reduction variable. + redvar_typ = lowerer.fndesc.typemap[red_name] + # Get the ir.Var for the reduction variable. + redvar = ir.Var(scope, red_name, loc) + # Get the type of the array that holds the per-thread + # reduction variables. + redarrvar_typ = redtyp_to_redarraytype(redvar_typ) + reddtype = redarrvar_typ.dtype + if config.DEBUG_ARRAY_OPT: + print( + "reduction_info", + red_name, + redvar_typ, + redarrvar_typ, + reddtype, + types.DType(reddtype), + num_threads_var, + type(num_threads_var) + ) + + # If this is reduction over an array, + # the reduction array has just one added per-worker dimension. + if isinstance(redvar_typ, types.npytypes.Array): + redarrdim = redvar_typ.ndim + 1 + else: + redarrdim = 1 + + # Reduction array is created and initialized to the initial reduction value. + + # First create a var for the numpy empty ufunc. + glbl_np_empty = pfbdr.bind_global_function( + fobj=np.empty, + ftype=get_np_ufunc_typ(np.empty), + args=( + types.UniTuple(types.intp, redarrdim), + ), + kws={'dtype': types.DType(reddtype)} + ) + + size_var_list = [num_threads_var] + + # If this is a reduction over an array... + if isinstance(redvar_typ, types.npytypes.Array): + # Add code to get the shape of the array being reduced over. + redshape_var = pfbdr.assign( + rhs=ir.Expr.getattr(redvar, "shape", loc), + typ=types.UniTuple(types.intp, redvar_typ.ndim), + name="redarr_shape", + ) + + # Add the dimension sizes of the array being reduced over to the tuple of sizes pass to empty. + for j in range(redvar_typ.ndim): + onedimvar = pfbdr.assign( + rhs=ir.Expr.static_getitem(redshape_var, j, None, loc), + typ=types.intp, + name="redshapeonedim", + ) + size_var_list.append(onedimvar) + + # Empty call takes tuple of sizes. Create here and fill in outer dimension (num threads). + size_var = pfbdr.make_tuple_variable( + size_var_list, name='tuple_size_var', + ) + + # Resolve dtype + cval = pfbdr._typingctx.resolve_value_type(reddtype) + dt = pfbdr.make_const_variable(cval=cval, typ=types.DType(reddtype)) + # Add call to empty passing the size var tuple. + empty_call = pfbdr.call(glbl_np_empty, args=[size_var, dt]) + + redarr_var = pfbdr.assign( + rhs=empty_call, typ=redarrvar_typ, name="redarr", + ) + + # Remember mapping of original reduction array to the newly created per-worker reduction array. + redarrs[redvar.name] = redarr_var + to_cleanup.append(redarr_var) + + init_val = parfor_reddict[red_name].init_val + + if init_val is not None: + if isinstance(redvar_typ, types.npytypes.Array): + # Create an array of identity values for the reduction. + # First, create a variable for np.full. + full_func_node = pfbdr.bind_global_function( + fobj=np.full, + ftype=get_np_ufunc_typ(np.full), + args=( + types.UniTuple(types.intp, redvar_typ.ndim), + reddtype, + ), + kws={'dtype': types.DType(reddtype)}, + ) + + # Then create a var with the identify value. + init_val_var = pfbdr.make_const_variable( + cval=init_val, + typ=reddtype, + name="init_val", + ) + + # Then, call np.full with the shape of the reduction array and the identity value. + full_call = pfbdr.call( + full_func_node, args=[redshape_var, init_val_var, dt], + ) + + redtoset = pfbdr.assign( + rhs=full_call, + typ=redvar_typ, + name="redtoset", + ) + # rettoset is an array from np.full() and must be released + to_cleanup.append(redtoset) + else: + redtoset = pfbdr.make_const_variable( + cval=init_val, + typ=reddtype, + name="redtoset", + ) + else: + redtoset = redvar + + if config.DEBUG_ARRAY_OPT_RUNTIME: + res_print_str = "res_print1 for redvar " + str(redvar) + ":" + strconsttyp = types.StringLiteral(res_print_str) + + lhs = pfbdr.make_const_variable( + cval=res_print_str, + typ=strconsttyp, + name="str_const", + ) + + res_print = ir.Print(args=[lhs, redvar], + vararg=None, loc=loc) + lowerer.fndesc.calltypes[res_print] = signature(types.none, + typemap[lhs.name], + typemap[redvar.name]) + print("res_print_redvar", res_print) + lowerer.lower_inst(res_print) + + + # For each thread, initialize the per-worker reduction array to + # the current reduction array value. + + # Get the Numba type of the variable that holds the thread count. + num_thread_type = typemap[num_threads_var.name] + # Get the LLVM type of the thread count variable. + ntllvm_type = targetctx.get_value_type(num_thread_type) + # Create a LLVM variable to hold the loop index. + alloc_loop_var = cgutils.alloca_once(builder, ntllvm_type) + # Associate this LLVM variable to a Numba IR variable so that + # we can use setitem IR builder. + # Create a Numba IR variable. + numba_ir_loop_index_var = scope.redefine("$loop_index", loc) + # Give that variable the right type. + typemap[numba_ir_loop_index_var.name] = num_thread_type + # Associate this Numba variable to the LLVM variable in the + # lowerer's varmap. + lowerer.varmap[numba_ir_loop_index_var.name] = alloc_loop_var + # Insert a loop into the outputed LLVM that goes from 0 to + # the current thread count. + with cgutils.for_range(builder, lowerer.loadvar(num_threads_var.name), intp=ntllvm_type) as loop: + # Store the loop index into the alloca'd LLVM loop index variable. + builder.store(loop.index, alloc_loop_var) + # Initialize one element of the reduction array using the Numba + # IR variable associated with this loop's index. + pfbdr.setitem(obj=redarr_var, index=numba_ir_loop_index_var, val=redtoset) + + # compile parfor body as a separate function to be used with GUFuncWrapper + flags = parfor.flags.copy() + flags.error_model = "numpy" + # Can't get here unless flags.auto_parallel == ParallelOptions(True) + index_var_typ = typemap[parfor.loop_nests[0].index_variable.name] + # index variables should have the same type, check rest of indices + for l in parfor.loop_nests[1:]: + assert typemap[l.index_variable.name] == index_var_typ + numba.parfors.parfor.sequential_parfor_lowering = True + try: + (func, + func_args, + func_sig, + func_arg_types, + exp_name_to_tuple_var) = _create_gufunc_for_parfor_body( + lowerer, parfor, typemap, typingctx, targetctx, flags, {}, + bool(alias_map), index_var_typ, parfor.races) + finally: + numba.parfors.parfor.sequential_parfor_lowering = False + + # get the shape signature + func_args = ['sched'] + func_args + num_reductions = len(parfor_redvars) + num_inputs = len(func_args) - len(parfor_output_arrays) - num_reductions + if config.DEBUG_ARRAY_OPT: + print("func_args = ", func_args) + print("num_inputs = ", num_inputs) + print("parfor_outputs = ", parfor_output_arrays) + print("parfor_redvars = ", parfor_redvars) + print("num_reductions = ", num_reductions) + gu_signature = _create_shape_signature( + parfor.get_shape_classes, + num_inputs, + num_reductions, + func_args, + func_sig, + parfor.races, + typemap) + if config.DEBUG_ARRAY_OPT: + print("gu_signature = ", gu_signature) + + # call the func in parallel by wrapping it with ParallelGUFuncBuilder + loop_ranges = [(l.start, l.stop, l.step) for l in parfor.loop_nests] + if config.DEBUG_ARRAY_OPT: + print("loop_nests = ", parfor.loop_nests) + print("loop_ranges = ", loop_ranges) + call_parallel_gufunc( + lowerer, + func, + gu_signature, + func_sig, + func_args, + func_arg_types, + loop_ranges, + parfor_redvars, + parfor_reddict, + redarrs, + parfor.init_block, + index_var_typ, + parfor.races, + exp_name_to_tuple_var) + + if nredvars > 0: + _parfor_lowering_finalize_reduction( + parfor, redarrs, lowerer, parfor_reddict, num_threads_var, + ) + + # Cleanup reduction variable + for v in to_cleanup: + lowerer.lower_inst(ir.Del(v.name, loc=loc)) + # Restore the original typemap of the function that was replaced temporarily at the + # Beginning of this function. + lowerer.fndesc.typemap = orig_typemap + + if config.DEBUG_ARRAY_OPT: + print("_lower_parfor_parallel done") + + +_ReductionInfo = make_dataclass( + "_ReductionInfo", + [ + "redvar_info", + "redvar_name", + "redvar_typ", + "redarr_var", + "redarr_typ", + "init_val", + ], + frozen=True, +) + + +def _parfor_lowering_finalize_reduction( + parfor, + redarrs, + lowerer, + parfor_reddict, + thread_count_var, + ): + """Emit code to finalize the reduction from the intermediate values of + each thread. + """ + # For each reduction variable + for redvar_name, redarr_var in redarrs.items(): + # Pseudo-code for this loop body: + # tmp = redarr[0] + # for i in range(1, thread_count): + # tmp = reduce_op(redarr[i], tmp) + # reduction_result = tmp + redvar_typ = lowerer.fndesc.typemap[redvar_name] + redarr_typ = lowerer.fndesc.typemap[redarr_var.name] + init_val = lowerer.loadvar(redvar_name) + + reduce_info = _ReductionInfo( + redvar_info = parfor_reddict[redvar_name], + redvar_name=redvar_name, + redvar_typ=redvar_typ, + redarr_var=redarr_var, + redarr_typ=redarr_typ, + init_val=init_val, + ) + # generate code for combining reduction variable with thread output + handler = (_lower_trivial_inplace_binops + if reduce_info.redvar_info.redop is not None + else _lower_non_trivial_reduce) + handler(parfor, lowerer, thread_count_var, reduce_info) + + +class ParforsUnexpectedReduceNodeError(InternalError): + def __init__(self, inst): + super().__init__(f"Unknown reduce instruction node: {inst}") + + +def _lower_trivial_inplace_binops(parfor, lowerer, thread_count_var, reduce_info): + """Lower trivial inplace-binop reduction. + """ + for inst in reduce_info.redvar_info.reduce_nodes: + # Var assigns to Var? + if _lower_var_to_var_assign(lowerer, inst): + pass + # Is inplace-binop for the reduction? + elif _is_right_op_and_rhs_is_init(inst, reduce_info.redvar_name, "inplace_binop"): + fn = inst.value.fn + redvar_result = _emit_binop_reduce_call( + fn, lowerer, thread_count_var, reduce_info, + ) + lowerer.storevar(redvar_result, name=inst.target.name) + # Is binop for the reduction? + elif _is_right_op_and_rhs_is_init(inst, reduce_info.redvar_name, "binop"): + fn = inst.value.fn + redvar_result = _emit_binop_reduce_call( + fn, lowerer, thread_count_var, reduce_info, + ) + lowerer.storevar(redvar_result, name=inst.target.name) + # Otherwise? + else: + raise ParforsUnexpectedReduceNodeError(inst) + + # XXX: This seems like a hack to stop the loop with this condition. + if _fix_redvar_name_ssa_mismatch(parfor, lowerer, inst, + reduce_info.redvar_name): + break + if config.DEBUG_ARRAY_OPT_RUNTIME: + varname = reduce_info.redvar_name + lowerer.print_variable( + f"{parfor.loc}: parfor {fn.__name__} reduction {varname} =", + varname, + ) + + +def _lower_non_trivial_reduce(parfor, lowerer, thread_count_var, reduce_info): + """Lower non-trivial reduction such as call to `functools.reduce()`. + """ + init_name = f"{reduce_info.redvar_name}#init" + # The init_name variable is not defined at this point. + lowerer.fndesc.typemap.setdefault(init_name, reduce_info.redvar_typ) + # Emit a sequence of the reduction operation for each intermediate result + # of each thread. + num_thread_llval = lowerer.loadvar(thread_count_var.name) + with cgutils.for_range(lowerer.builder, num_thread_llval) as loop: + tid = loop.index + for inst in reduce_info.redvar_info.reduce_nodes: + # Var assigns to Var? + if _lower_var_to_var_assign(lowerer, inst): + pass + # The reduction operation? + elif (isinstance(inst, ir.Assign) + and any(var.name == init_name for var in inst.list_vars())): + elem = _emit_getitem_call(tid, lowerer, reduce_info) + lowerer.storevar(elem, init_name) + lowerer.lower_inst(inst) + + # Otherwise? + else: + raise ParforsUnexpectedReduceNodeError(inst) + + # XXX: This seems like a hack to stop the loop with this condition. + if _fix_redvar_name_ssa_mismatch(parfor, lowerer, inst, + reduce_info.redvar_name): + break + + if config.DEBUG_ARRAY_OPT_RUNTIME: + varname = reduce_info.redvar_name + lowerer.print_variable( + f"{parfor.loc}: parfor non-trivial reduction {varname} =", + varname, + ) + +def _lower_var_to_var_assign(lowerer, inst): + """Lower Var->Var assignment. + + Returns True if-and-only-if `inst` is a Var->Var assignment. + """ + if isinstance(inst, ir.Assign) and isinstance(inst.value, ir.Var): + loaded = lowerer.loadvar(inst.value.name) + lowerer.storevar(loaded, name=inst.target.name) + return True + return False + +def _emit_getitem_call(idx, lowerer, reduce_info): + """Emit call to ``redarr_var[idx]`` + """ + def reducer_getitem(redarr, index): + return redarr[index] + + builder = lowerer.builder + ctx = lowerer.context + redarr_typ = reduce_info.redarr_typ + arg_arr = lowerer.loadvar(reduce_info.redarr_var.name) + args = (arg_arr, idx) + sig = signature(reduce_info.redvar_typ, redarr_typ, types.intp) + elem = ctx.compile_internal(builder, reducer_getitem, sig, args) + return elem + + +def _emit_binop_reduce_call(binop, lowerer, thread_count_var, reduce_info): + """Emit call to the ``binop`` for the reduction variable. + """ + + def reduction_add(thread_count, redarr, init): + c = init + for i in range(thread_count): + c += redarr[i] + return c + + def reduction_mul(thread_count, redarr, init): + c = init + for i in range(thread_count): + c *= redarr[i] + return c + + kernel = { + operator.iadd: reduction_add, + operator.isub: reduction_add, + operator.add: reduction_add, + operator.sub: reduction_add, + operator.imul: reduction_mul, + operator.ifloordiv: reduction_mul, + operator.itruediv: reduction_mul, + operator.mul: reduction_mul, + operator.floordiv: reduction_mul, + operator.truediv: reduction_mul, + }[binop] + + ctx = lowerer.context + builder = lowerer.builder + redarr_typ = reduce_info.redarr_typ + arg_arr = lowerer.loadvar(reduce_info.redarr_var.name) + + if config.DEBUG_ARRAY_OPT_RUNTIME: + init_var = reduce_info.redarr_var.scope.get(reduce_info.redvar_name) + res_print = ir.Print( + args=[reduce_info.redarr_var, init_var], vararg=None, + loc=lowerer.loc, + ) + typemap = lowerer.fndesc.typemap + lowerer.fndesc.calltypes[res_print] = signature( + types.none, typemap[reduce_info.redarr_var.name], + typemap[init_var.name], + ) + lowerer.lower_inst(res_print) + + arg_thread_count = lowerer.loadvar(thread_count_var.name) + args = (arg_thread_count, arg_arr, reduce_info.init_val) + sig = signature( + reduce_info.redvar_typ, types.uintp, redarr_typ, reduce_info.redvar_typ, + ) + + redvar_result = ctx.compile_internal(builder, kernel, sig, args) + return redvar_result + + +def _is_right_op_and_rhs_is_init(inst, redvar_name, op): + """Is ``inst`` an inplace-binop and the RHS is the reduction init? + """ + if not isinstance(inst, ir.Assign): + return False + rhs = inst.value + if not isinstance(rhs, ir.Expr): + return False + if rhs.op != op: + return False + if rhs.rhs.name != f"{redvar_name}#init": + return False + return True + + +def _fix_redvar_name_ssa_mismatch(parfor, lowerer, inst, redvar_name): + """Fix reduction variable name mismatch due to SSA. + """ + # Only process reduction statements post-gufunc execution + # until we see an assignment with a left-hand side to the + # reduction variable's name. This fixes problems with + # cases where there are multiple assignments to the + # reduction variable in the parfor. + scope = parfor.init_block.scope + if isinstance(inst, ir.Assign): + try: + reduction_var = scope.get_exact(redvar_name) + except NotDefinedError: + # Ideally, this shouldn't happen. The redvar name + # missing from scope indicates an error from + # other rewrite passes. + is_same_source_var = redvar_name == inst.target.name + else: + # Because of SSA, the redvar and target var of + # the current assignment would be different even + # though they refer to the same source-level var. + redvar_unver_name = reduction_var.unversioned_name + target_unver_name = inst.target.unversioned_name + is_same_source_var = redvar_unver_name == target_unver_name + + if is_same_source_var: + # If redvar is different from target var, add an + # assignment to put target var into redvar. + if redvar_name != inst.target.name: + val = lowerer.loadvar(inst.target.name) + lowerer.storevar(val, name=redvar_name) + return True + + return False + +def _create_shape_signature( + get_shape_classes, + num_inputs, + num_reductions, + args, + func_sig, + races, + typemap): + '''Create shape signature for GUFunc + ''' + if config.DEBUG_ARRAY_OPT: + print("_create_shape_signature", num_inputs, num_reductions, args, races) + for i in args[1:]: + print("argument", i, type(i), get_shape_classes(i, typemap=typemap)) + + num_inouts = len(args) - num_reductions + # maximum class number for array shapes + classes = [get_shape_classes(var, typemap=typemap) if var not in races else (-1,) for var in args[1:]] + class_set = set() + for _class in classes: + if _class: + for i in _class: + class_set.add(i) + max_class = max(class_set) + 1 if class_set else 0 + classes.insert(0, (max_class,)) # force set the class of 'sched' argument + class_set.add(max_class) + thread_num_class = max_class + 1 + class_set.add(thread_num_class) + class_map = {} + # TODO: use prefix + class number instead of single char + alphabet = ord('a') + for n in class_set: + if n >= 0: + class_map[n] = chr(alphabet) + alphabet += 1 + threadcount_ordinal = chr(alphabet) + + alpha_dict = {'latest_alpha' : alphabet} + + def bump_alpha(c, class_map): + if c >= 0: + return class_map[c] + else: + alpha_dict['latest_alpha'] += 1 + return chr(alpha_dict['latest_alpha']) + + gu_sin = [] + gu_sout = [] + count = 0 + syms_sin = () + if config.DEBUG_ARRAY_OPT: + print("args", args) + print("classes", classes) + print("threadcount_ordinal", threadcount_ordinal) + for cls, arg in zip(classes, args): + count = count + 1 + if cls: + dim_syms = tuple(bump_alpha(c, class_map) for c in cls) + else: + dim_syms = () + if (count > num_inouts): + # Add the threadcount_ordinal to represent the thread count + # to the start of the reduction array. + gu_sin.append(tuple([threadcount_ordinal] + list(dim_syms[1:]))) + else: + gu_sin.append(dim_syms) + syms_sin += dim_syms + return (gu_sin, gu_sout) + +def _print_block(block): + for i, inst in enumerate(block.body): + print(" ", i, " ", inst) + +def _print_body(body_dict): + '''Pretty-print a set of IR blocks. + ''' + topo_order = wrap_find_topo(body_dict) + for label in topo_order: + block = body_dict[label] + print("label: ", label) + _print_block(block) + + +def wrap_loop_body(loop_body): + blocks = loop_body.copy() # shallow copy is enough + first_label = min(blocks.keys()) + last_label = max(blocks.keys()) + loc = blocks[last_label].loc + blocks[last_label].body.append(ir.Jump(first_label, loc)) + return blocks + +def unwrap_loop_body(loop_body): + last_label = max(loop_body.keys()) + loop_body[last_label].body = loop_body[last_label].body[:-1] + +def add_to_def_once_sets(a_def, def_once, def_more): + '''If the variable is already defined more than once, do nothing. + Else if defined exactly once previously then transition this + variable to the defined more than once set (remove it from + def_once set and add to def_more set). + Else this must be the first time we've seen this variable defined + so add to def_once set. + ''' + if a_def in def_more: + pass + elif a_def in def_once: + def_more.add(a_def) + def_once.remove(a_def) + else: + def_once.add(a_def) + +def compute_def_once_block(block, def_once, def_more, getattr_taken, typemap, module_assigns): + '''Effect changes to the set of variables defined once or more than once + for a single block. + block - the block to process + def_once - set of variable names known to be defined exactly once + def_more - set of variable names known to be defined more than once + getattr_taken - dict mapping variable name to tuple of object and attribute taken + module_assigns - dict mapping variable name to the Global that they came from + ''' + # The only "defs" occur in assignments, so find such instructions. + assignments = block.find_insts(ir.Assign) + # For each assignment... + for one_assign in assignments: + # Get the LHS/target of the assignment. + a_def = one_assign.target.name + # Add variable to def sets. + add_to_def_once_sets(a_def, def_once, def_more) + + rhs = one_assign.value + if isinstance(rhs, ir.Global): + # Remember assignments of the form "a = Global(...)" + # Is this a module? + if isinstance(rhs.value, pytypes.ModuleType): + module_assigns[a_def] = rhs.value.__name__ + if isinstance(rhs, ir.Expr) and rhs.op == 'getattr' and rhs.value.name in def_once: + # Remember assignments of the form "a = b.c" + getattr_taken[a_def] = (rhs.value.name, rhs.attr) + if isinstance(rhs, ir.Expr) and rhs.op == 'call' and rhs.func.name in getattr_taken: + # If "a" is being called then lookup the getattr definition of "a" + # as above, getting the module variable "b" (base_obj) + # and the attribute "c" (base_attr). + base_obj, base_attr = getattr_taken[rhs.func.name] + if base_obj in module_assigns: + # If we know the definition of the module variable then get the module + # name from module_assigns. + base_mod_name = module_assigns[base_obj] + if not is_const_call(base_mod_name, base_attr): + # Calling a method on an object could modify the object and is thus + # like a def of that object. We call is_const_call to see if this module/attribute + # combination is known to not modify the module state. If we don't know that + # the combination is safe then we have to assume there could be a modification to + # the module and thus add the module variable as defined more than once. + add_to_def_once_sets(base_obj, def_once, def_more) + else: + # Assume the worst and say that base_obj could be modified by the call. + add_to_def_once_sets(base_obj, def_once, def_more) + if isinstance(rhs, ir.Expr) and rhs.op == 'call': + # If a mutable object is passed to a function, then it may be changed and + # therefore can't be hoisted. + # For each argument to the function... + for argvar in rhs.args: + # Get the argument's type. + if isinstance(argvar, ir.Var): + argvar = argvar.name + avtype = typemap[argvar] + # If that type doesn't have a mutable attribute or it does and it's set to + # not mutable then this usage is safe for hoisting. + if getattr(avtype, 'mutable', False): + # Here we have a mutable variable passed to a function so add this variable + # to the def lists. + add_to_def_once_sets(argvar, def_once, def_more) + +def wrap_find_topo(loop_body): + blocks = wrap_loop_body(loop_body) + topo_order = find_topo_order(blocks) + unwrap_loop_body(loop_body) + return topo_order + +def compute_def_once_internal(loop_body, def_once, def_more, getattr_taken, typemap, module_assigns): + '''Compute the set of variables defined exactly once in the given set of blocks + and use the given sets for storing which variables are defined once, more than + once and which have had a getattr call on them. + ''' + # For each block in topological order... + topo_order = wrap_find_topo(loop_body) + for label in topo_order: + block = loop_body[label] + # Scan this block and effect changes to def_once, def_more, and getattr_taken + # based on the instructions in that block. + compute_def_once_block(block, def_once, def_more, getattr_taken, typemap, module_assigns) + # Have to recursively process parfors manually here. + for inst in block.body: + if isinstance(inst, parfor.Parfor): + # Recursively compute for the parfor's init block. + compute_def_once_block(inst.init_block, def_once, def_more, getattr_taken, typemap, module_assigns) + # Recursively compute for the parfor's loop body. + compute_def_once_internal(inst.loop_body, def_once, def_more, getattr_taken, typemap, module_assigns) + +def compute_def_once(loop_body, typemap): + '''Compute the set of variables defined exactly once in the given set of blocks. + ''' + def_once = set() # set to hold variables defined exactly once + def_more = set() # set to hold variables defined more than once + getattr_taken = {} + module_assigns = {} + compute_def_once_internal(loop_body, def_once, def_more, getattr_taken, typemap, module_assigns) + return def_once, def_more + +def find_vars(var, varset): + assert isinstance(var, ir.Var) + varset.add(var.name) + return var + +def _hoist_internal(inst, dep_on_param, call_table, hoisted, not_hoisted, + typemap, stored_arrays): + if inst.target.name in stored_arrays: + not_hoisted.append((inst, "stored array")) + if config.DEBUG_ARRAY_OPT >= 1: + print("Instruction", inst, "could not be hoisted because the created array is stored.") + return False + + target_type = typemap[inst.target.name] + + uses = set() + # Get vars used by this statement. + visit_vars_inner(inst.value, find_vars, uses) + # Filter out input parameters from the set of variable usages. + unhoistable = {assgn.target.name for assgn, _ in not_hoisted} + use_unhoist = uses & unhoistable + diff = uses.difference(dep_on_param) + diff |= use_unhoist + if config.DEBUG_ARRAY_OPT >= 1: + print("_hoist_internal:", inst, "uses:", uses, "diff:", diff) + if len(diff) == 0 and is_pure(inst.value, None, call_table): + if config.DEBUG_ARRAY_OPT >= 1: + print("Will hoist instruction", inst, target_type) + hoisted.append(inst) + if not isinstance(target_type, types.npytypes.Array): + dep_on_param += [inst.target.name] + return True + else: + if len(diff) > 0: + not_hoisted.append((inst, "dependency")) + if config.DEBUG_ARRAY_OPT >= 1: + print("Instruction", inst, "could not be hoisted because of a dependency.") + else: + not_hoisted.append((inst, "not pure")) + if config.DEBUG_ARRAY_OPT >= 1: + print("Instruction", inst, "could not be hoisted because it isn't pure.") + return False + +def find_setitems_block(setitems, itemsset, block, typemap): + for inst in block.body: + if isinstance(inst, (ir.StaticSetItem, ir.SetItem)): + setitems.add(inst.target.name) + # If we store a non-mutable object into an array then that is safe to hoist. + # If the stored object is mutable and you hoist then multiple entries in the + # outer array could reference the same object and changing one index would then + # change other indices. + if getattr(typemap[inst.value.name], "mutable", False): + itemsset.add(inst.value.name) + elif isinstance(inst, parfor.Parfor): + find_setitems_block(setitems, itemsset, inst.init_block, typemap) + find_setitems_body(setitems, itemsset, inst.loop_body, typemap) + elif isinstance(inst, ir.Assign): + # If something of mutable type is given to a build_tuple or + # used in a call then consider it unanalyzable and so + # unavailable for hoisting. + rhs = inst.value + def add_to_itemset(item): + assert isinstance(item, ir.Var), rhs + if getattr(typemap[item.name], "mutable", False): + itemsset.add(item.name) + + if isinstance(rhs, ir.Expr): + if rhs.op in ["build_tuple", "build_list", "build_set"]: + for item in rhs.items: + add_to_itemset(item) + elif rhs.op == "build_map": + for pair in rhs.items: + for item in pair: + add_to_itemset(item) + elif rhs.op == "call": + for item in list(rhs.args) + [x[1] for x in rhs.kws]: + add_to_itemset(item) + +def find_setitems_body(setitems, itemsset, loop_body, typemap): + """ + Find the arrays that are written into (goes into setitems) and the + mutable objects (mostly arrays) that are written into other arrays + (goes into itemsset). + """ + for label, block in loop_body.items(): + find_setitems_block(setitems, itemsset, block, typemap) + +def empty_container_allocator_hoist(inst, dep_on_param, call_table, hoisted, + not_hoisted, typemap, stored_arrays): + if (isinstance(inst, ir.Assign) and + isinstance(inst.value, ir.Expr) and + inst.value.op == 'call' and + inst.value.func.name in call_table): + call_list = call_table[inst.value.func.name] + if call_list == ['empty', np]: + return _hoist_internal(inst, dep_on_param, call_table, hoisted, + not_hoisted, typemap, stored_arrays) + return False + +def hoist(parfor_params, loop_body, typemap, wrapped_blocks): + dep_on_param = copy.copy(parfor_params) + hoisted = [] + not_hoisted = [] + + # Compute the set of variable defined exactly once in the loop body. + def_once, def_more = compute_def_once(loop_body, typemap) + (call_table, reverse_call_table) = get_call_table(wrapped_blocks) + + setitems = set() + itemsset = set() + find_setitems_body(setitems, itemsset, loop_body, typemap) + dep_on_param = list(set(dep_on_param).difference(setitems)) + if config.DEBUG_ARRAY_OPT >= 1: + print("hoist - def_once:", def_once, "setitems:", setitems, "itemsset:", itemsset, "dep_on_param:", dep_on_param, "parfor_params:", parfor_params) + for si in setitems: + add_to_def_once_sets(si, def_once, def_more) + + for label, block in loop_body.items(): + new_block = [] + for inst in block.body: + if empty_container_allocator_hoist(inst, dep_on_param, call_table, + hoisted, not_hoisted, typemap, itemsset): + continue + elif isinstance(inst, ir.Assign) and inst.target.name in def_once: + if _hoist_internal(inst, dep_on_param, call_table, + hoisted, not_hoisted, typemap, itemsset): + # don't add this instruction to the block since it is + # hoisted + continue + elif isinstance(inst, parfor.Parfor): + new_init_block = [] + if config.DEBUG_ARRAY_OPT >= 1: + print("parfor") + inst.dump() + for ib_inst in inst.init_block.body: + if empty_container_allocator_hoist(ib_inst, dep_on_param, + call_table, hoisted, not_hoisted, typemap, itemsset): + continue + elif (isinstance(ib_inst, ir.Assign) and + ib_inst.target.name in def_once): + if _hoist_internal(ib_inst, dep_on_param, call_table, + hoisted, not_hoisted, typemap, + itemsset): + # don't add this instruction to the block since it is hoisted + continue + new_init_block.append(ib_inst) + inst.init_block.body = new_init_block + + new_block.append(inst) + block.body = new_block + return hoisted, not_hoisted + +def redtyp_is_scalar(redtype): + return not isinstance(redtype, types.npytypes.Array) + +def redtyp_to_redarraytype(redtyp): + """Go from a reducation variable type to a reduction array type used to hold + per-worker results. + """ + redarrdim = 1 + # If the reduction type is an array then allocate reduction array with ndim+1 dimensions. + if isinstance(redtyp, types.npytypes.Array): + redarrdim += redtyp.ndim + # We don't create array of array but multi-dimensional reduction array with same dtype. + redtyp = redtyp.dtype + return types.npytypes.Array(redtyp, redarrdim, "C") + +def redarraytype_to_sig(redarraytyp): + """Given a reduction array type, find the type of the reduction argument to the gufunc. + """ + assert isinstance(redarraytyp, types.npytypes.Array) + return types.npytypes.Array(redarraytyp.dtype, redarraytyp.ndim, redarraytyp.layout) + +def legalize_names_with_typemap(names, typemap): + """ We use ir_utils.legalize_names to replace internal IR variable names + containing illegal characters (e.g. period) with a legal character + (underscore) so as to create legal variable names. + The original variable names are in the typemap so we also + need to add the legalized name to the typemap as well. + """ + outdict = legalize_names(names) + # For each pair in the dict of legalized names... + for x, y in outdict.items(): + # If the name had some legalization change to it... + if x != y: + # Set the type of the new name the same as the type of the old name. + typemap[y] = typemap[x] + return outdict + +def to_scalar_from_0d(x): + if isinstance(x, types.ArrayCompatible): + if x.ndim == 0: + return x.dtype + return x + +def _create_gufunc_for_parfor_body( + lowerer, + parfor, + typemap, + typingctx, + targetctx, + flags, + locals, + has_aliases, + index_var_typ, + races): + ''' + Takes a parfor and creates a gufunc function for its body. + There are two parts to this function. + 1) Code to iterate across the iteration space as defined by the schedule. + 2) The parfor body that does the work for a single point in the iteration space. + Part 1 is created as Python text for simplicity with a sentinel assignment to mark the point + in the IR where the parfor body should be added. + This Python text is 'exec'ed into existence and its IR retrieved with run_frontend. + The IR is scanned for the sentinel assignment where that basic block is split and the IR + for the parfor body inserted. + ''' + if config.DEBUG_ARRAY_OPT >= 1: + print("starting _create_gufunc_for_parfor_body") + + loc = parfor.init_block.loc + + # The parfor body and the main function body share ir.Var nodes. + # We have to do some replacements of Var names in the parfor body to make them + # legal parameter names. If we don't copy then the Vars in the main function also + # would incorrectly change their name. + loop_body = copy.copy(parfor.loop_body) + remove_dels(loop_body) + + parfor_dim = len(parfor.loop_nests) + loop_indices = [l.index_variable.name for l in parfor.loop_nests] + + # Get all the parfor params. + parfor_params = parfor.params + # Get just the outputs of the parfor. + parfor_outputs = numba.parfors.parfor.get_parfor_outputs(parfor, parfor_params) + # Get all parfor reduction vars, and operators. + typemap = lowerer.fndesc.typemap + parfor_redvars, parfor_reddict = numba.parfors.parfor.get_parfor_reductions( + lowerer.func_ir, parfor, parfor_params, lowerer.fndesc.calltypes) + # Compute just the parfor inputs as a set difference. + parfor_inputs = sorted( + list( + set(parfor_params) - + set(parfor_outputs) - + set(parfor_redvars))) + + if config.DEBUG_ARRAY_OPT >= 1: + print("parfor_params = ", parfor_params, " ", type(parfor_params)) + print("parfor_outputs = ", parfor_outputs, " ", type(parfor_outputs)) + print("parfor_inputs = ", parfor_inputs, " ", type(parfor_inputs)) + print("parfor_redvars = ", parfor_redvars, " ", type(parfor_redvars)) + + # ------------------------------------------------------------------------- + # Convert tuples to individual parameters. + tuple_expanded_parfor_inputs = [] + tuple_var_to_expanded_names = {} + expanded_name_to_tuple_var = {} + next_expanded_tuple_var = 0 + parfor_tuple_params = [] + # For each input to the parfor. + for pi in parfor_inputs: + # Get the type of the input. + pi_type = typemap[pi] + # If it is a UniTuple or Tuple we will do the conversion. + if isinstance(pi_type, types.UniTuple) or isinstance(pi_type, types.NamedUniTuple): + # Get the size and dtype of the tuple. + tuple_count = pi_type.count + tuple_dtype = pi_type.dtype + # Only do tuples up to config.PARFOR_MAX_TUPLE_SIZE length. + assert(tuple_count <= config.PARFOR_MAX_TUPLE_SIZE) + this_var_expansion = [] + for i in range(tuple_count): + # Generate a new name for the individual part of the tuple var. + expanded_name = "expanded_tuple_var_" + str(next_expanded_tuple_var) + # Add that name to the new list of inputs to the gufunc. + tuple_expanded_parfor_inputs.append(expanded_name) + this_var_expansion.append(expanded_name) + # Remember a mapping from new param name to original tuple + # var and the index within the tuple. + expanded_name_to_tuple_var[expanded_name] = (pi, i) + next_expanded_tuple_var += 1 + # Set the type of the new parameter. + typemap[expanded_name] = tuple_dtype + # Remember a mapping from the original tuple var to the + # individual parts. + tuple_var_to_expanded_names[pi] = this_var_expansion + parfor_tuple_params.append(pi) + elif isinstance(pi_type, types.Tuple) or isinstance(pi_type, types.NamedTuple): + # This is the same as above for UniTuple except that each part of + # the tuple can have a different type and we fetch that type with + # pi_type.types[offset]. + tuple_count = pi_type.count + tuple_types = pi_type.types + # Only do tuples up to config.PARFOR_MAX_TUPLE_SIZE length. + assert(tuple_count <= config.PARFOR_MAX_TUPLE_SIZE) + this_var_expansion = [] + for i in range(tuple_count): + expanded_name = "expanded_tuple_var_" + str(next_expanded_tuple_var) + tuple_expanded_parfor_inputs.append(expanded_name) + this_var_expansion.append(expanded_name) + expanded_name_to_tuple_var[expanded_name] = (pi, i) + next_expanded_tuple_var += 1 + typemap[expanded_name] = tuple_types[i] + tuple_var_to_expanded_names[pi] = this_var_expansion + parfor_tuple_params.append(pi) + else: + tuple_expanded_parfor_inputs.append(pi) + parfor_inputs = tuple_expanded_parfor_inputs + if config.DEBUG_ARRAY_OPT >= 1: + print("parfor_inputs post tuple handling = ", parfor_inputs, " ", type(parfor_inputs)) + # ------------------------------------------------------------------------- + + races = races.difference(set(parfor_redvars)) + for race in races: + msg = ("Variable %s used in parallel loop may be written " + "to simultaneously by multiple workers and may result " + "in non-deterministic or unintended results." % race) + warnings.warn(NumbaParallelSafetyWarning(msg, loc)) + replace_var_with_array(races, loop_body, typemap, lowerer.fndesc.calltypes) + + # Reduction variables are represented as arrays, so they go under + # different names. + parfor_redarrs = [] + parfor_red_arg_types = [] + for var in parfor_redvars: + arr = var + "_arr" + parfor_redarrs.append(arr) + redarraytype = redtyp_to_redarraytype(typemap[var]) + parfor_red_arg_types.append(redarraytype) + redarrsig = redarraytype_to_sig(redarraytype) + if arr in typemap: + assert(typemap[arr] == redarrsig) + else: + typemap[arr] = redarrsig + + # Reorder all the params so that inputs go first then outputs. + parfor_params = parfor_inputs + parfor_outputs + parfor_redarrs + + if config.DEBUG_ARRAY_OPT >= 1: + print("parfor_params = ", parfor_params, " ", type(parfor_params)) + print("loop_indices = ", loop_indices, " ", type(loop_indices)) + print("loop_body = ", loop_body, " ", type(loop_body)) + _print_body(loop_body) + + # Some Var are not legal parameter names so create a dict of potentially illegal + # param name to guaranteed legal name. + param_dict = legalize_names_with_typemap(parfor_params + parfor_redvars + parfor_tuple_params, typemap) + if config.DEBUG_ARRAY_OPT >= 1: + print( + "param_dict = ", + sorted( + param_dict.items()), + " ", + type(param_dict)) + + # Some loop_indices are not legal parameter names so create a dict of potentially illegal + # loop index to guaranteed legal name. + ind_dict = legalize_names_with_typemap(loop_indices, typemap) + # Compute a new list of legal loop index names. + legal_loop_indices = [ind_dict[v] for v in loop_indices] + if config.DEBUG_ARRAY_OPT >= 1: + print("ind_dict = ", sorted(ind_dict.items()), " ", type(ind_dict)) + print( + "legal_loop_indices = ", + legal_loop_indices, + " ", + type(legal_loop_indices)) + for pd in parfor_params: + print("pd = ", pd) + print("pd type = ", typemap[pd], " ", type(typemap[pd])) + + # Get the types of each parameter. + param_types = [to_scalar_from_0d(typemap[v]) for v in parfor_params] + # Calculate types of args passed to gufunc. + func_arg_types = [typemap[v] for v in (parfor_inputs + parfor_outputs)] + parfor_red_arg_types + if config.DEBUG_ARRAY_OPT >= 1: + print("new param_types:", param_types) + print("new func_arg_types:", func_arg_types) + + # Replace illegal parameter names in the loop body with legal ones. + replace_var_names(loop_body, param_dict) + # remember the name before legalizing as the actual arguments + parfor_args = parfor_params + # Change parfor_params to be legal names. + parfor_params = [param_dict[v] for v in parfor_params] + parfor_params_orig = parfor_params + + parfor_params = [] + ascontig = False + for pindex in range(len(parfor_params_orig)): + if (ascontig and + pindex < len(parfor_inputs) and + isinstance(param_types[pindex], types.npytypes.Array)): + parfor_params.append(parfor_params_orig[pindex]+"param") + else: + parfor_params.append(parfor_params_orig[pindex]) + + # Change parfor body to replace illegal loop index vars with legal ones. + replace_var_names(loop_body, ind_dict) + loop_body_var_table = get_name_var_table(loop_body) + sentinel_name = get_unused_var_name("__sentinel__", loop_body_var_table) + + if config.DEBUG_ARRAY_OPT >= 1: + print( + "legal parfor_params = ", + parfor_params, + " ", + type(parfor_params)) + + # Determine the unique names of the scheduling and gufunc functions. + # sched_func_name = "__numba_parfor_sched_%s" % (hex(hash(parfor)).replace("-", "_")) + gufunc_name = "__numba_parfor_gufunc_%s" % ( + hex(hash(parfor)).replace("-", "_")) + if config.DEBUG_ARRAY_OPT: + # print("sched_func_name ", type(sched_func_name), " ", sched_func_name) + print("gufunc_name ", type(gufunc_name), " ", gufunc_name) + + gufunc_txt = "" + + # Create the gufunc function. + gufunc_txt += "def " + gufunc_name + \ + "(sched, " + (", ".join(parfor_params)) + "):\n" + + globls = {"np": np, "numba": numba} + + # First thing in the gufunc, we reconstruct tuples from their + # individual parts, e.g., orig_tup_name = (part1, part2,). + # The rest of the code of the function will use the original tuple name. + for tup_var, exp_names in tuple_var_to_expanded_names.items(): + tup_type = typemap[tup_var] + gufunc_txt += " " + param_dict[tup_var] + # Determine if the tuple is a named tuple. + if (isinstance(tup_type, types.NamedTuple) or + isinstance(tup_type, types.NamedUniTuple)): + named_tup = True + else: + named_tup = False + + if named_tup: + # It is a named tuple so try to find the global that defines the + # named tuple. + func_def = guard(get_definition, lowerer.func_ir, tup_var) + named_tuple_def = None + if config.DEBUG_ARRAY_OPT: + print("func_def:", func_def, type(func_def)) + if func_def is not None: + if (isinstance(func_def, ir.Expr) and + func_def.op == 'call'): + named_tuple_def = guard(get_definition, lowerer.func_ir, func_def.func) + if config.DEBUG_ARRAY_OPT: + print("named_tuple_def:", named_tuple_def, type(named_tuple_def)) + elif isinstance(func_def, ir.Arg): + named_tuple_def = typemap[func_def.name] + if config.DEBUG_ARRAY_OPT: + print("named_tuple_def:", named_tuple_def, + type(named_tuple_def), named_tuple_def.name) + if named_tuple_def is not None: + if (isinstance(named_tuple_def, ir.Global) or + isinstance(named_tuple_def, ir.FreeVar)): + gval = named_tuple_def.value + if config.DEBUG_ARRAY_OPT: + print("gval:", gval, type(gval)) + globls[named_tuple_def.name] = gval + elif isinstance(named_tuple_def, types.containers.BaseNamedTuple): + named_tuple_name = named_tuple_def.name.split('(')[0] + if config.DEBUG_ARRAY_OPT: + print("name:", named_tuple_name, + named_tuple_def.instance_class, + type(named_tuple_def.instance_class)) + globls[named_tuple_name] = named_tuple_def.instance_class + else: + if config.DEBUG_ARRAY_OPT: + print("Didn't find definition of namedtuple for globls.") + raise CompilerError("Could not find definition of " + str(tup_var), + tup_var.loc) + gufunc_txt += " = " + tup_type.instance_class.__name__ + "(" + for name, field_name in zip(exp_names, tup_type.fields): + gufunc_txt += field_name + "=" + param_dict[name] + "," + else: + # Just a regular tuple so use (part0, part1, ...) + gufunc_txt += " = (" + ", ".join([param_dict[x] for x in exp_names]) + if len(exp_names) == 1: + # Add comma for tuples with singular values. We can't unilaterally + # add a comma always because (,) isn't valid. + gufunc_txt += "," + + gufunc_txt += ")\n" + + for pindex in range(len(parfor_inputs)): + if ascontig and isinstance(param_types[pindex], types.npytypes.Array): + gufunc_txt += (" " + parfor_params_orig[pindex] + + " = np.ascontiguousarray(" + parfor_params[pindex] + ")\n") + + gufunc_thread_id_var = "ParallelAcceleratorGufuncThreadId" + + if len(parfor_redarrs) > 0: + gufunc_txt += " " + gufunc_thread_id_var + " = " + gufunc_txt += "numba.np.ufunc.parallel._iget_thread_id()\n" + + # Add initialization of reduction variables + for arr, var in zip(parfor_redarrs, parfor_redvars): + gufunc_txt += " " + param_dict[var] + \ + "=" + param_dict[arr] + "[" + gufunc_thread_id_var + "]\n" + if config.DEBUG_ARRAY_OPT_RUNTIME: + gufunc_txt += " print(\"thread id =\", ParallelAcceleratorGufuncThreadId)\n" + gufunc_txt += " print(\"initial reduction value\",ParallelAcceleratorGufuncThreadId," + param_dict[var] + "," + param_dict[var] + ".shape)\n" + gufunc_txt += " print(\"reduction array\",ParallelAcceleratorGufuncThreadId," + param_dict[arr] + "," + param_dict[arr] + ".shape)\n" + + # For each dimension of the parfor, create a for loop in the generated gufunc function. + # Iterate across the proper values extracted from the schedule. + # The form of the schedule is start_dim0, start_dim1, ..., start_dimN, end_dim0, + # end_dim1, ..., end_dimN + for eachdim in range(parfor_dim): + for indent in range(eachdim + 1): + gufunc_txt += " " + sched_dim = eachdim + gufunc_txt += ("for " + + legal_loop_indices[eachdim] + + " in range(sched[" + + str(sched_dim) + + "], sched[" + + str(sched_dim + + parfor_dim) + + "] + np.uint8(1)):\n") + + if config.DEBUG_ARRAY_OPT_RUNTIME: + for indent in range(parfor_dim + 1): + gufunc_txt += " " + gufunc_txt += "print(" + for eachdim in range(parfor_dim): + gufunc_txt += "\"" + legal_loop_indices[eachdim] + "\"," + legal_loop_indices[eachdim] + "," + gufunc_txt += ")\n" + + # Add the sentinel assignment so that we can find the loop body position + # in the IR. + for indent in range(parfor_dim + 1): + gufunc_txt += " " + gufunc_txt += sentinel_name + " = 0\n" + # Add assignments of reduction variables (for returning the value) + for arr, var in zip(parfor_redarrs, parfor_redvars): + if config.DEBUG_ARRAY_OPT_RUNTIME: + gufunc_txt += " print(\"final reduction value\",ParallelAcceleratorGufuncThreadId," + param_dict[var] + ")\n" + gufunc_txt += " print(\"final reduction array\",ParallelAcceleratorGufuncThreadId," + param_dict[arr] + ")\n" + # After the gufunc loops, copy the accumulated temp value back to reduction array. + gufunc_txt += " " + param_dict[arr] + \ + "[" + gufunc_thread_id_var + "] = " + param_dict[var] + "\n" + gufunc_txt += " return None\n" + + if config.DEBUG_ARRAY_OPT: + print("gufunc_txt = ", type(gufunc_txt), "\n", gufunc_txt) + print("globls:", globls, type(globls)) + # Force gufunc outline into existence. + locls = {} + exec(gufunc_txt, globls, locls) + gufunc_func = locls[gufunc_name] + + if config.DEBUG_ARRAY_OPT: + print("gufunc_func = ", type(gufunc_func), "\n", gufunc_func) + # Get the IR for the gufunc outline. + gufunc_ir = compiler.run_frontend(gufunc_func) + if config.DEBUG_ARRAY_OPT: + print("gufunc_ir dump ", type(gufunc_ir)) + gufunc_ir.dump() + print("loop_body dump ", type(loop_body)) + _print_body(loop_body) + + # rename all variables in gufunc_ir afresh + var_table = get_name_var_table(gufunc_ir.blocks) + new_var_dict = {} + reserved_names = [sentinel_name] + \ + list(param_dict.values()) + legal_loop_indices + for name, var in var_table.items(): + if not (name in reserved_names): + new_var_dict[name] = parfor.init_block.scope.redefine(name, loc).name + replace_var_names(gufunc_ir.blocks, new_var_dict) + if config.DEBUG_ARRAY_OPT: + print("gufunc_ir dump after renaming ") + gufunc_ir.dump() + gufunc_param_types = [types.npytypes.Array( + index_var_typ, 1, "C")] + param_types + if config.DEBUG_ARRAY_OPT: + print( + "gufunc_param_types = ", + type(gufunc_param_types), + "\n", + gufunc_param_types) + + gufunc_stub_last_label = find_max_label(gufunc_ir.blocks) + 1 + + # Add gufunc stub last label to each parfor.loop_body label to prevent + # label conflicts. + loop_body = add_offset_to_labels(loop_body, gufunc_stub_last_label) + # new label for splitting sentinel block + new_label = find_max_label(loop_body) + 1 + + # If enabled, add a print statement after every assignment. + if config.DEBUG_ARRAY_OPT_RUNTIME: + for label, block in loop_body.items(): + new_block = block.copy() + new_block.clear() + loc = block.loc + scope = block.scope + for inst in block.body: + new_block.append(inst) + # Append print after assignment + if isinstance(inst, ir.Assign): + # Only apply to numbers + if typemap[inst.target.name] not in types.number_domain: + continue + + # Make constant string + strval = "{} =".format(inst.target.name) + strconsttyp = types.StringLiteral(strval) + + lhs = scope.redefine("str_const", loc) + # lhs = ir.Var(scope, mk_unique_var("str_const"), loc) + assign_lhs = ir.Assign(value=ir.Const(value=strval, loc=loc), + target=lhs, loc=loc) + typemap[lhs.name] = strconsttyp + new_block.append(assign_lhs) + + # Make print node + print_node = ir.Print(args=[lhs, inst.target], vararg=None, loc=loc) + new_block.append(print_node) + sig = numba.core.typing.signature(types.none, + typemap[lhs.name], + typemap[inst.target.name]) + lowerer.fndesc.calltypes[print_node] = sig + loop_body[label] = new_block + + if config.DEBUG_ARRAY_OPT: + print("parfor loop body") + _print_body(loop_body) + + wrapped_blocks = wrap_loop_body(loop_body) + hoisted, not_hoisted = hoist(parfor_params, loop_body, typemap, wrapped_blocks) + start_block = gufunc_ir.blocks[min(gufunc_ir.blocks.keys())] + start_block.body = start_block.body[:-1] + hoisted + [start_block.body[-1]] + unwrap_loop_body(loop_body) + + # store hoisted into diagnostics + diagnostics = lowerer.metadata['parfor_diagnostics'] + diagnostics.hoist_info[parfor.id] = {'hoisted': hoisted, + 'not_hoisted': not_hoisted} + + if config.DEBUG_ARRAY_OPT: + print("After hoisting") + _print_body(loop_body) + + # Search all the block in the gufunc outline for the sentinel assignment. + for label, block in gufunc_ir.blocks.items(): + for i, inst in enumerate(block.body): + if isinstance( + inst, + ir.Assign) and inst.target.name == sentinel_name: + # We found the sentinel assignment. + loc = inst.loc + scope = block.scope + # split block across __sentinel__ + # A new block is allocated for the statements prior to the sentinel + # but the new block maintains the current block label. + prev_block = ir.Block(scope, loc) + prev_block.body = block.body[:i] + # The current block is used for statements after the sentinel. + block.body = block.body[i + 1:] + # But the current block gets a new label. + body_first_label = min(loop_body.keys()) + + # The previous block jumps to the minimum labelled block of the + # parfor body. + prev_block.append(ir.Jump(body_first_label, loc)) + # Add all the parfor loop body blocks to the gufunc function's + # IR. + for (l, b) in loop_body.items(): + gufunc_ir.blocks[l] = transfer_scope(b, scope) + body_last_label = max(loop_body.keys()) + gufunc_ir.blocks[new_label] = block + gufunc_ir.blocks[label] = prev_block + # Add a jump from the last parfor body block to the block containing + # statements after the sentinel. + gufunc_ir.blocks[body_last_label].append( + ir.Jump(new_label, loc)) + break + else: + continue + break + + if config.DEBUG_ARRAY_OPT: + print("gufunc_ir last dump before renaming") + gufunc_ir.dump() + + gufunc_ir.blocks = rename_labels(gufunc_ir.blocks) + remove_dels(gufunc_ir.blocks) + + if config.DEBUG_ARRAY_OPT: + print("gufunc_ir last dump") + gufunc_ir.dump() + print("flags", flags) + print("typemap", typemap) + + old_alias = flags.noalias + if not has_aliases: + if config.DEBUG_ARRAY_OPT: + print("No aliases found so adding noalias flag.") + flags.noalias = True + + fixup_var_define_in_scope(gufunc_ir.blocks) + + class ParforGufuncCompiler(compiler.CompilerBase): + def define_pipelines(self): + from numba.core.compiler_machinery import PassManager + dpb = compiler.DefaultPassBuilder + pm = PassManager("full_parfor_gufunc") + parfor_gufunc_passes = dpb.define_parfor_gufunc_pipeline(self.state) + pm.passes.extend(parfor_gufunc_passes.passes) + lowering_passes = dpb.define_parfor_gufunc_nopython_lowering_pipeline(self.state) + pm.passes.extend(lowering_passes.passes) + + pm.finalize() + return [pm] + + kernel_func = compiler.compile_ir( + typingctx, + targetctx, + gufunc_ir, + gufunc_param_types, + types.none, + flags, + locals, + pipeline_class=ParforGufuncCompiler) + + flags.noalias = old_alias + + kernel_sig = signature(types.none, *gufunc_param_types) + if config.DEBUG_ARRAY_OPT: + print("finished create_gufunc_for_parfor_body. kernel_sig = ", kernel_sig) + + return kernel_func, parfor_args, kernel_sig, func_arg_types, expanded_name_to_tuple_var + +def replace_var_with_array_in_block(vars, block, typemap, calltypes): + new_block = [] + for inst in block.body: + if isinstance(inst, ir.Assign) and inst.target.name in vars: + loc = inst.loc + scope = inst.target.scope + + const_node = ir.Const(0, loc) + const_var = scope.redefine("$const_ind_0", loc) + typemap[const_var.name] = types.uintp + const_assign = ir.Assign(const_node, const_var, loc) + new_block.append(const_assign) + + val_var = scope.redefine("$val", loc) + typemap[val_var.name] = typemap[inst.target.name] + new_block.append(ir.Assign(inst.value, val_var, loc)) + setitem_node = ir.SetItem(inst.target, const_var, val_var, loc) + calltypes[setitem_node] = signature( + types.none, types.npytypes.Array(typemap[inst.target.name], 1, "C"), types.intp, typemap[inst.target.name]) + new_block.append(setitem_node) + continue + elif isinstance(inst, parfor.Parfor): + replace_var_with_array_internal(vars, {0: inst.init_block}, typemap, calltypes) + replace_var_with_array_internal(vars, inst.loop_body, typemap, calltypes) + + new_block.append(inst) + return new_block + +def replace_var_with_array_internal(vars, loop_body, typemap, calltypes): + for label, block in loop_body.items(): + block.body = replace_var_with_array_in_block(vars, block, typemap, calltypes) + +def replace_var_with_array(vars, loop_body, typemap, calltypes): + replace_var_with_array_internal(vars, loop_body, typemap, calltypes) + for v in vars: + el_typ = typemap[v] + typemap.pop(v, None) + typemap[v] = types.npytypes.Array(el_typ, 1, "C") + +def call_parallel_gufunc(lowerer, cres, gu_signature, outer_sig, expr_args, expr_arg_types, + loop_ranges, redvars, reddict, redarrdict, init_block, index_var_typ, races, + exp_name_to_tuple_var): + ''' + Adds the call to the gufunc function from the main function. + ''' + context = lowerer.context + builder = lowerer.builder + + from numba.np.ufunc.parallel import (build_gufunc_wrapper, + _launch_threads) + + if config.DEBUG_ARRAY_OPT: + print("make_parallel_loop") + print("outer_sig = ", outer_sig.args, outer_sig.return_type, + outer_sig.recvr, outer_sig.pysig) + print("loop_ranges = ", loop_ranges) + print("expr_args", expr_args) + print("expr_arg_types", expr_arg_types) + print("gu_signature", gu_signature) + + # Build the wrapper for GUFunc + args, return_type = sigutils.normalize_signature(outer_sig) + llvm_func = cres.library.get_function(cres.fndesc.llvm_func_name) + sin, sout = gu_signature + + # These are necessary for build_gufunc_wrapper to find external symbols + _launch_threads() + + info = build_gufunc_wrapper(llvm_func, cres, sin, sout, + cache=False, is_parfors=True) + wrapper_name = info.name + cres.library._ensure_finalized() + + if config.DEBUG_ARRAY_OPT: + print("parallel function = ", wrapper_name, cres) + + # loadvars for loop_ranges + def load_range(v): + if isinstance(v, ir.Var): + return lowerer.loadvar(v.name) + else: + return context.get_constant(types.uintp, v) + + num_dim = len(loop_ranges) + for i in range(num_dim): + start, stop, step = loop_ranges[i] + start = load_range(start) + stop = load_range(stop) + assert(step == 1) # We do not support loop steps other than 1 + step = load_range(step) + loop_ranges[i] = (start, stop, step) + + if config.DEBUG_ARRAY_OPT: + print("call_parallel_gufunc loop_ranges[{}] = ".format(i), start, + stop, step) + cgutils.printf(builder, "loop range[{}]: %d %d (%d)\n".format(i), + start, stop, step) + + # Commonly used LLVM types and constants + byte_t = llvmlite.ir.IntType(8) + byte_ptr_t = llvmlite.ir.PointerType(byte_t) + byte_ptr_ptr_t = llvmlite.ir.PointerType(byte_ptr_t) + intp_t = context.get_value_type(types.intp) + uintp_t = context.get_value_type(types.uintp) + intp_ptr_t = llvmlite.ir.PointerType(intp_t) + intp_ptr_ptr_t = llvmlite.ir.PointerType(intp_ptr_t) + uintp_ptr_t = llvmlite.ir.PointerType(uintp_t) + uintp_ptr_ptr_t = llvmlite.ir.PointerType(uintp_ptr_t) + zero = context.get_constant(types.uintp, 0) + one = context.get_constant(types.uintp, 1) + one_type = one.type + sizeof_intp = context.get_abi_sizeof(intp_t) + + # Prepare sched, first pop it out of expr_args, outer_sig, and gu_signature + expr_args.pop(0) + sched_sig = sin.pop(0) + + if config.DEBUG_ARRAY_OPT: + print("Parfor has potentially negative start", index_var_typ.signed) + + if index_var_typ.signed: + sched_type = intp_t + sched_ptr_type = intp_ptr_t + sched_ptr_ptr_type = intp_ptr_ptr_t + else: + sched_type = uintp_t + sched_ptr_type = uintp_ptr_t + sched_ptr_ptr_type = uintp_ptr_ptr_t + + # Call do_scheduling with appropriate arguments + dim_starts = cgutils.alloca_once( + builder, sched_type, size=context.get_constant( + types.uintp, num_dim), name="dim_starts") + dim_stops = cgutils.alloca_once( + builder, sched_type, size=context.get_constant( + types.uintp, num_dim), name="dim_stops") + for i in range(num_dim): + start, stop, step = loop_ranges[i] + if start.type != one_type: + start = builder.sext(start, one_type) + if stop.type != one_type: + stop = builder.sext(stop, one_type) + if step.type != one_type: + step = builder.sext(step, one_type) + # substract 1 because do-scheduling takes inclusive ranges + stop = builder.sub(stop, one) + builder.store( + start, builder.gep( + dim_starts, [ + context.get_constant( + types.uintp, i)])) + builder.store(stop, builder.gep(dim_stops, + [context.get_constant(types.uintp, i)])) + + # Prepare to call get/set parallel_chunksize and get the number of threads. + get_chunksize = cgutils.get_or_insert_function( + builder.module, + llvmlite.ir.FunctionType(uintp_t, []), + name="get_parallel_chunksize") + + set_chunksize = cgutils.get_or_insert_function( + builder.module, + llvmlite.ir.FunctionType(llvmlite.ir.VoidType(), [uintp_t]), + name="set_parallel_chunksize") + + get_num_threads = cgutils.get_or_insert_function( + builder.module, + llvmlite.ir.FunctionType(llvmlite.ir.IntType(types.intp.bitwidth), []), + "get_num_threads") + + # Get the current number of threads. + num_threads = builder.call(get_num_threads, []) + # Get the current chunksize so we can use it and restore the value later. + current_chunksize = builder.call(get_chunksize, []) + + with cgutils.if_unlikely(builder, builder.icmp_signed('<=', num_threads, + num_threads.type(0))): + cgutils.printf(builder, "num_threads: %d\n", num_threads) + context.call_conv.return_user_exc(builder, RuntimeError, + ("Invalid number of threads. " + "This likely indicates a bug in Numba.",)) + + # Call get_sched_size from gufunc_scheduler.cpp that incorporates the size of the work, + # the number of threads and the selected chunk size. This will tell us how many entries + # in the schedule we will need. + get_sched_size_fnty = llvmlite.ir.FunctionType(uintp_t, [uintp_t, uintp_t, intp_ptr_t, intp_ptr_t]) + get_sched_size = cgutils.get_or_insert_function( + builder.module, + get_sched_size_fnty, + name="get_sched_size") + num_divisions = builder.call(get_sched_size, [num_threads, + context.get_constant(types.uintp, num_dim), + dim_starts, + dim_stops]) + # Set the chunksize to zero so that any nested calls get the default chunk size behavior. + builder.call(set_chunksize, [zero]) + + # Each entry in the schedule is 2 times the number of dimensions long. + multiplier = context.get_constant(types.uintp, num_dim * 2) + # Compute the total number of entries in the schedule. + sched_size = builder.mul(num_divisions, multiplier) + + # Prepare to dynamically allocate memory to hold the schedule. + alloc_sched_fnty = llvmlite.ir.FunctionType(sched_ptr_type, [uintp_t]) + alloc_sched_func = cgutils.get_or_insert_function( + builder.module, + alloc_sched_fnty, + name="allocate_sched") + # Call gufunc_scheduler.cpp to allocate the schedule. + # This may or may not do pooling. + alloc_space = builder.call(alloc_sched_func, [sched_size]) + # Allocate a slot in the entry block to store the schedule pointer. + sched = cgutils.alloca_once(builder, sched_ptr_type) + # Store the schedule pointer into that slot. + builder.store(alloc_space, sched) + + debug_flag = 1 if config.DEBUG_ARRAY_OPT else 0 + scheduling_fnty = llvmlite.ir.FunctionType( + intp_ptr_t, [uintp_t, intp_ptr_t, intp_ptr_t, uintp_t, sched_ptr_type, intp_t]) + if index_var_typ.signed: + do_scheduling = cgutils.get_or_insert_function(builder.module, + scheduling_fnty, + name="do_scheduling_signed") + else: + do_scheduling = cgutils.get_or_insert_function(builder.module, + scheduling_fnty, + name="do_scheduling_unsigned") + + # Call the scheduling routine that decides how to break up the work. + builder.call( + do_scheduling, [ + context.get_constant( + types.uintp, num_dim), dim_starts, dim_stops, num_divisions, + builder.load(sched), context.get_constant( + types.intp, debug_flag)]) + + # Get the LLVM vars for the Numba IR reduction array vars. + redarrs = [lowerer.loadvar(redarrdict[x].name) for x in redvars] + + nredvars = len(redvars) + ninouts = len(expr_args) - nredvars + + def load_potential_tuple_var(x): + """Given a variable name, if that variable is not a new name + introduced as the extracted part of a tuple then just return + the variable loaded from its name. However, if the variable + does represent part of a tuple, as recognized by the name of + the variable being present in the exp_name_to_tuple_var dict, + then we load the original tuple var instead that we get from + the dict and then extract the corresponding element of the + tuple, also stored and returned to use in the dict (i.e., offset). + """ + if x in exp_name_to_tuple_var: + orig_tup, offset = exp_name_to_tuple_var[x] + tup_var = lowerer.loadvar(orig_tup) + res = builder.extract_value(tup_var, offset) + return res + else: + return lowerer.loadvar(x) + + # ---------------------------------------------------------------------------- + # Prepare arguments: args, shapes, steps, data + all_args = [load_potential_tuple_var(x) for x in expr_args[:ninouts]] + redarrs + num_args = len(all_args) + num_inps = len(sin) + 1 + args = cgutils.alloca_once( + builder, + byte_ptr_t, + size=context.get_constant( + types.intp, + 1 + num_args), + name="pargs") + array_strides = [] + # sched goes first + builder.store(builder.bitcast(builder.load(sched), byte_ptr_t), args) + array_strides.append(context.get_constant(types.intp, sizeof_intp)) + rv_to_arg_dict = {} + # followed by other arguments + for i in range(num_args): + arg = all_args[i] + var = expr_args[i] + aty = expr_arg_types[i] + dst = builder.gep(args, [context.get_constant(types.intp, i + 1)]) + if i >= ninouts: # reduction variables + ary = context.make_array(aty)(context, builder, arg) + strides = cgutils.unpack_tuple(builder, ary.strides, aty.ndim) + # Start from 1 because we skip the first dimension of length num_threads just like sched. + for j in range(len(strides)): + array_strides.append(strides[j]) + builder.store(builder.bitcast(ary.data, byte_ptr_t), dst) + elif isinstance(aty, types.ArrayCompatible): + if var in races: + typ = (context.get_data_type(aty.dtype) + if aty.dtype != types.boolean + else llvmlite.ir.IntType(1)) + + rv_arg = cgutils.alloca_once(builder, typ) + builder.store(arg, rv_arg) + builder.store(builder.bitcast(rv_arg, byte_ptr_t), dst) + rv_to_arg_dict[var] = (arg, rv_arg) + + array_strides.append(context.get_constant(types.intp, context.get_abi_sizeof(typ))) + else: + ary = context.make_array(aty)(context, builder, arg) + strides = cgutils.unpack_tuple(builder, ary.strides, aty.ndim) + for j in range(len(strides)): + array_strides.append(strides[j]) + builder.store(builder.bitcast(ary.data, byte_ptr_t), dst) + else: + if i < num_inps: + # Scalar input, need to store the value in an array of size 1 + if isinstance(aty, types.Optional): + # Unpack optional type + unpacked_aty = aty.type + arg = context.cast(builder, arg, aty, unpacked_aty) + else: + unpacked_aty = aty + typ = (context.get_data_type(unpacked_aty) + if not isinstance(unpacked_aty, types.Boolean) + else llvmlite.ir.IntType(1)) + ptr = cgutils.alloca_once(builder, typ) + builder.store(arg, ptr) + else: + # Scalar output, must allocate + typ = (context.get_data_type(aty) + if not isinstance(aty, types.Boolean) + else llvmlite.ir.IntType(1)) + ptr = cgutils.alloca_once(builder, typ) + builder.store(builder.bitcast(ptr, byte_ptr_t), dst) + + # ---------------------------------------------------------------------------- + # Next, we prepare the individual dimension info recorded in gu_signature + sig_dim_dict = {} + occurrences = [] + occurrences = [sched_sig[0]] + sig_dim_dict[sched_sig[0]] = context.get_constant(types.intp, 2 * num_dim) + assert len(expr_args) == len(all_args) + assert len(expr_args) == len(expr_arg_types) + assert len(expr_args) == len(sin + sout) + assert len(expr_args) == len(outer_sig.args[1:]) + for var, arg, aty, gu_sig in zip(expr_args, all_args, + expr_arg_types, sin + sout): + if isinstance(aty, types.npytypes.Array): + i = aty.ndim - len(gu_sig) + else: + i = 0 + if config.DEBUG_ARRAY_OPT: + print("var =", var, "gu_sig =", gu_sig, "type =", aty, "i =", i) + + for dim_sym in gu_sig: + if config.DEBUG_ARRAY_OPT: + print("var = ", var, " type = ", aty) + if var in races: + sig_dim_dict[dim_sym] = context.get_constant(types.intp, 1) + else: + ary = context.make_array(aty)(context, builder, arg) + shapes = cgutils.unpack_tuple(builder, ary.shape, aty.ndim) + sig_dim_dict[dim_sym] = shapes[i] + + if not (dim_sym in occurrences): + if config.DEBUG_ARRAY_OPT: + print("dim_sym = ", dim_sym, ", i = ", i) + cgutils.printf(builder, dim_sym + " = %d\n", sig_dim_dict[dim_sym]) + occurrences.append(dim_sym) + i = i + 1 + + # ---------------------------------------------------------------------------- + # Prepare shapes, which is a single number (outer loop size), followed by + # the size of individual shape variables. + nshapes = len(sig_dim_dict) + 1 + shapes = cgutils.alloca_once(builder, intp_t, size=nshapes, name="pshape") + # For now, outer loop size is the same as number of threads + builder.store(num_divisions, shapes) + # Individual shape variables go next + i = 1 + for dim_sym in occurrences: + if config.DEBUG_ARRAY_OPT: + cgutils.printf(builder, dim_sym + " = %d\n", sig_dim_dict[dim_sym]) + builder.store( + sig_dim_dict[dim_sym], builder.gep( + shapes, [ + context.get_constant( + types.intp, i)])) + i = i + 1 + + # ---------------------------------------------------------------------------- + # Prepare steps for each argument. Note that all steps are counted in + # bytes. + num_steps = num_args + 1 + len(array_strides) + steps = cgutils.alloca_once( + builder, intp_t, size=context.get_constant( + types.intp, num_steps), name="psteps") + # First goes the step size for sched, which is 2 * num_dim + builder.store(context.get_constant(types.intp, 2 * num_dim * sizeof_intp), + steps) + # The steps for all others are 0, except for reduction results. + for i in range(num_args): + # steps are strides from one thread to the next + stepsize = zero + + dst = builder.gep(steps, [context.get_constant(types.intp, 1 + i)]) + builder.store(stepsize, dst) + for j in range(len(array_strides)): + dst = builder.gep( + steps, [ + context.get_constant( + types.intp, 1 + num_args + j)]) + builder.store(array_strides[j], dst) + + # ---------------------------------------------------------------------------- + # prepare data + data = cgutils.get_null_value(byte_ptr_t) + + fnty = llvmlite.ir.FunctionType(llvmlite.ir.VoidType(), + [byte_ptr_ptr_t, intp_ptr_t, + intp_ptr_t, byte_ptr_t]) + + fn = cgutils.get_or_insert_function(builder.module, fnty, wrapper_name) + context.active_code_library.add_linking_library(info.library) + + if config.DEBUG_ARRAY_OPT: + cgutils.printf(builder, "before calling kernel %p\n", fn) + builder.call(fn, [args, shapes, steps, data]) + if config.DEBUG_ARRAY_OPT: + cgutils.printf(builder, "after calling kernel %p\n", fn) + + builder.call(set_chunksize, [current_chunksize]) + + # Deallocate the schedule's memory. + dealloc_sched_fnty = llvmlite.ir.FunctionType(llvmlite.ir.VoidType(), [sched_ptr_type]) + dealloc_sched_func = cgutils.get_or_insert_function( + builder.module, + dealloc_sched_fnty, + name="deallocate_sched") + builder.call(dealloc_sched_func, [builder.load(sched)]) + + for k, v in rv_to_arg_dict.items(): + arg, rv_arg = v + only_elem_ptr = builder.gep(rv_arg, [context.get_constant(types.intp, 0)]) + builder.store(builder.load(only_elem_ptr), lowerer.getvar(k)) + + context.active_code_library.add_linking_library(cres.library) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/parfor_lowering_utils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/parfor_lowering_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..f7b30b81b64be9e2eee86e1ad9ffd06ac7f00dd4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/parfors/parfor_lowering_utils.py @@ -0,0 +1,212 @@ +from collections import namedtuple + +from numba.core import types, ir +from numba.core.typing import signature + + +_CallableNode = namedtuple("BoundFunc", ["func", "sig"]) + + +class ParforLoweringBuilder: + """Helper class for building Numba-IR and lowering for Parfor. + """ + def __init__(self, lowerer, scope, loc): + self._lowerer = lowerer + self._scope = scope + self._loc = loc + + @property + def _context(self): + return self._lowerer.context + + @property + def _typingctx(self): + return self._context.typing_context + + @property + def _typemap(self): + return self._lowerer.fndesc.typemap + + @property + def _calltypes(self): + return self._lowerer.fndesc.calltypes + + def bind_global_function(self, fobj, ftype, args, kws={}): + """Binds a global function to a variable. + + Parameters + ---------- + fobj : object + The function to be bound. + ftype : types.Type + args : Sequence[types.Type] + kws : Mapping[str, types.Type] + + Returns + ------- + callable: _CallableNode + """ + loc = self._loc + varname = f"{fobj.__name__}_func" + gvname = f"{fobj.__name__}" + + func_sig = self._typingctx.resolve_function_type(ftype, args, kws) + func_var = self.assign( + rhs=ir.Global(gvname, fobj, loc=loc), typ=ftype, name=varname + ) + return _CallableNode(func=func_var, sig=func_sig) + + def make_const_variable(self, cval, typ, name="pf_const") -> ir.Var: + """Makes a constant variable + + Parameters + ---------- + cval : object + The constant value + typ : types.Type + type of the value + name : str + variable name to store to + + Returns + ------- + res : ir.Var + """ + return self.assign( + rhs=ir.Const(cval, loc=self._loc), typ=typ, name=name + ) + + def make_tuple_variable(self, varlist, name="pf_tuple") -> ir.Var: + """Makes a tuple variable + + Parameters + ---------- + varlist : Sequence[ir.Var] + Variables containing the values to be stored. + name : str + variable name to store to + + Returns + ------- + res : ir.Var + """ + loc = self._loc + vartys = [self._typemap[x.name] for x in varlist] + tupty = types.Tuple.from_types(vartys) + return self.assign( + rhs=ir.Expr.build_tuple(varlist, loc), typ=tupty, name=name + ) + + def assign(self, rhs, typ, name="pf_assign") -> ir.Var: + """Assign a value to a new variable + + Parameters + ---------- + rhs : object + The value + typ : types.Type + type of the value + name : str + variable name to store to + + Returns + ------- + res : ir.Var + """ + loc = self._loc + var = self._scope.redefine(name, loc) + self._typemap[var.name] = typ + assign = ir.Assign(rhs, var, loc) + self._lowerer.lower_inst(assign) + return var + + def assign_inplace(self, rhs, typ, name) -> ir.Var: + """Assign a value to a new variable or inplace if it already exist + + Parameters + ---------- + rhs : object + The value + typ : types.Type + type of the value + name : str + variable name to store to + + Returns + ------- + res : ir.Var + """ + loc = self._loc + var = ir.Var(self._scope, name, loc) + assign = ir.Assign(rhs, var, loc) + self._typemap.setdefault(var.name, typ) + self._lowerer.lower_inst(assign) + return var + + def call(self, callable_node, args, kws={}) -> ir.Expr: + """Call a bound callable + + Parameters + ---------- + callable_node : _CallableNode + The callee + args : Sequence[ir.Var] + kws : Mapping[str, ir.Var] + + Returns + ------- + res : ir.Expr + The expression node for the return value of the call + """ + call = ir.Expr.call(callable_node.func, args, kws, loc=self._loc) + self._calltypes[call] = callable_node.sig + return call + + def setitem(self, obj, index, val) -> ir.SetItem: + """Makes a setitem call + + Parameters + ---------- + obj : ir.Var + the object being indexed + index : ir.Var + the index + val : ir.Var + the value to be stored + + Returns + ------- + res : ir.SetItem + """ + loc = self._loc + tm = self._typemap + setitem = ir.SetItem(obj, index, val, loc=loc) + self._lowerer.fndesc.calltypes[setitem] = signature( + types.none, tm[obj.name], tm[index.name], tm[val.name] + ) + self._lowerer.lower_inst(setitem) + return setitem + + def getitem(self, obj, index, typ) -> ir.Expr: + """Makes a getitem call + + Parameters + ---------- + obj : ir.Var + the object being indexed + index : ir.Var + the index + val : ir.Var + the ty + + Returns + ------- + res : ir.Expr + the retrieved value + """ + tm = self._typemap + getitem = ir.Expr.getitem(obj, index, loc=self._loc) + self._lowerer.fndesc.calltypes[getitem] = signature( + typ, tm[obj.name], tm[index.name], + ) + return getitem diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c797fecd1c3863e7e26375aa69835dc82f297e25 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/__init__.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +import warnings +from numba.core.errors import NumbaPendingDeprecationWarning +# The pycc module requires setuptools. +try: + import setuptools +except ImportError: + msg = "The 'setuptools' package is required at runtime for pycc support." + raise ImportError(msg) + +# Public API +from .cc import CC +from .decorators import export, exportmany + +# If use of anything is attempted through the `pycc` import path this warning +# will be shown. +__pycc_deprecation_doc_url = ("https://numba.readthedocs.io/en/stable/" + "reference/deprecation.html" + "#deprecation-of-the-numba-pycc-module") +__pycc_pending_deprecation_message = ("The 'pycc' module is pending " + "deprecation. Replacement technology is " + "being developed.\n\n" + "Pending Deprecation in Numba 0.57.0. " + "For more information please see: " + f"{__pycc_deprecation_doc_url}") + +_pend_dep = NumbaPendingDeprecationWarning(__pycc_pending_deprecation_message) +warnings.warn(_pend_dep, stacklevel=2) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/cc.py b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/cc.py new file mode 100644 index 0000000000000000000000000000000000000000..15a27c1bb156c415ee1b176fbe416c676bf3a243 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/cc.py @@ -0,0 +1,309 @@ +from setuptools import distutils as dutils +from setuptools.command import build_ext +from setuptools.extension import Extension + +import os +import shutil +import sys +import tempfile + +from numba.core import typing, sigutils +from numba.core.compiler_lock import global_compiler_lock +from numba.pycc.compiler import ModuleCompiler, ExportEntry +from numba.pycc.platform import Toolchain +from numba import cext + + +dir_util = dutils.dir_util +log = dutils.log +extension_libs = cext.get_extension_libs() + + +class CC(object): + """ + An ahead-of-time compiler to create extension modules that don't + depend on Numba. + """ + + # NOTE: using ccache can speed up repetitive builds + # (especially for the mixin modules) + + _mixin_sources = ['modulemixin.c',] + extension_libs + + # -flto strips all unused helper functions, which 1) makes the + # produced output much smaller and 2) can make the linking step faster. + # (the Windows linker seems to do this by default, judging by the results) + + _extra_cflags = { + # Comment out due to odd behavior with GCC 4.9+ with LTO + # 'posix': ['-flto'], + } + + _extra_ldflags = { + # Comment out due to odd behavior with GCC 4.9+ with LTO + # 'posix': ['-flto'], + } + + def __init__(self, extension_name, source_module=None): + if '.' in extension_name: + raise ValueError("basename should be a simple module name, not " + "qualified name") + + self._basename = extension_name + self._init_function = 'pycc_init_' + extension_name + self._exported_functions = {} + # Resolve source module name and directory + f = sys._getframe(1) + if source_module is None: + dct = f.f_globals + source_module = dct['__name__'] + elif hasattr(source_module, '__name__'): + dct = source_module.__dict__ + source_module = source_module.__name__ + else: + dct = sys.modules[source_module].__dict__ + + self._source_path = dct.get('__file__', '') + self._source_module = source_module + self._toolchain = Toolchain() + self._verbose = False + # By default, output in directory of caller module + self._output_dir = os.path.dirname(self._source_path) + self._output_file = self._toolchain.get_ext_filename(extension_name) + self._use_nrt = True + self._target_cpu = '' + + @property + def name(self): + """ + The name of the extension module to create. + """ + return self._basename + + @property + def output_file(self): + """ + The specific output file (a DLL) that will be generated. + """ + return self._output_file + + @output_file.setter + def output_file(self, value): + self._output_file = value + + @property + def output_dir(self): + """ + The directory the output file will be put in. + """ + return self._output_dir + + @output_dir.setter + def output_dir(self, value): + self._output_dir = value + + @property + def use_nrt(self): + return self._use_nrt + + @use_nrt.setter + def use_nrt(self, value): + self._use_nrt = value + + @property + def target_cpu(self): + """ + The target CPU model for code generation. + """ + return self._target_cpu + + @target_cpu.setter + def target_cpu(self, value): + self._target_cpu = value + + @property + def verbose(self): + """ + Whether to display detailed information when compiling. + """ + return self._verbose + + @verbose.setter + def verbose(self, value): + self._verbose = value + + def export(self, exported_name, sig): + """ + Mark a function for exporting in the extension module. + """ + fn_args, fn_retty = sigutils.normalize_signature(sig) + sig = typing.signature(fn_retty, *fn_args) + if exported_name in self._exported_functions: + raise KeyError("duplicated export symbol %s" % (exported_name)) + + def decorator(func): + entry = ExportEntry(exported_name, sig, func) + self._exported_functions[exported_name] = entry + return func + + return decorator + + @property + def _export_entries(self): + return sorted(self._exported_functions.values(), + key=lambda entry: entry.symbol) + + def _get_mixin_sources(self): + here = os.path.dirname(__file__) + mixin_sources = self._mixin_sources[:] + if self._use_nrt: + mixin_sources.append('../core/runtime/nrt.cpp') + return [os.path.join(here, f) for f in mixin_sources] + + def _get_mixin_defines(self): + # Macro definitions required by modulemixin.c + return [ + ('PYCC_MODULE_NAME', self._basename), + ('PYCC_USE_NRT', int(self._use_nrt)), + ] + + def _get_extra_cflags(self): + extra_cflags = self._extra_cflags.get(sys.platform, []) + if not extra_cflags: + extra_cflags = self._extra_cflags.get(os.name, []) + return extra_cflags + + def _get_extra_ldflags(self): + extra_ldflags = self._extra_ldflags.get(sys.platform, []) + if not extra_ldflags: + extra_ldflags = self._extra_ldflags.get(os.name, []) + # helperlib uses pthread on linux. make sure we are linking to it. + if sys.platform.startswith("linux"): + if "-pthread" not in extra_ldflags: + extra_ldflags.append('-pthread') + return extra_ldflags + + def _compile_mixins(self, build_dir): + sources = self._get_mixin_sources() + macros = self._get_mixin_defines() + include_dirs = self._toolchain.get_python_include_dirs() + + extra_cflags = self._get_extra_cflags() + # XXX distutils creates a whole subtree inside build_dir, + # e.g. /tmp/test_pycc/home/antoine/numba/numba/pycc/modulemixin.o + objects = self._toolchain.compile_objects(sources, build_dir, + include_dirs=include_dirs, + macros=macros, + extra_cflags=extra_cflags) + return objects + + @global_compiler_lock + def _compile_object_files(self, build_dir): + compiler = ModuleCompiler(self._export_entries, self._basename, + self._use_nrt, cpu_name=self._target_cpu) + compiler.external_init_function = self._init_function + temp_obj = os.path.join(build_dir, + os.path.splitext(self._output_file)[0] + '.o') + log.info("generating LLVM code for '%s' into %s", + self._basename, temp_obj) + compiler.write_native_object(temp_obj, wrap=True) + return [temp_obj], compiler.dll_exports + + @global_compiler_lock + def compile(self): + """ + Compile the extension module. + """ + self._toolchain.verbose = self.verbose + build_dir = tempfile.mkdtemp(prefix='pycc-build-%s-' % self._basename) + + # Compile object file + objects, dll_exports = self._compile_object_files(build_dir) + + # Compile mixins + objects += self._compile_mixins(build_dir) + + # Then create shared library + extra_ldflags = self._get_extra_ldflags() + output_dll = os.path.join(self._output_dir, self._output_file) + libraries = self._toolchain.get_python_libraries() + library_dirs = self._toolchain.get_python_library_dirs() + self._toolchain.link_shared(output_dll, objects, + libraries, library_dirs, + export_symbols=dll_exports, + extra_ldflags=extra_ldflags) + + shutil.rmtree(build_dir) + + def distutils_extension(self, **kwargs): + """ + Create a distutils extension object that can be used in your + setup.py. + """ + macros = kwargs.pop('macros', []) + self._get_mixin_defines() + depends = kwargs.pop('depends', []) + [self._source_path] + extra_compile_args = (kwargs.pop('extra_compile_args', []) + + self._get_extra_cflags()) + extra_link_args = (kwargs.pop('extra_link_args', []) + + self._get_extra_ldflags()) + include_dirs = (kwargs.pop('include_dirs', []) + + self._toolchain.get_python_include_dirs()) + libraries = (kwargs.pop('libraries', []) + + self._toolchain.get_python_libraries()) + library_dirs = (kwargs.pop('library_dirs', []) + + self._toolchain.get_python_library_dirs()) + python_package_path = self._source_module[:self._source_module.rfind('.')+1] + + ext = _CCExtension(name=python_package_path + self._basename, + sources=self._get_mixin_sources(), + depends=depends, + define_macros=macros, + include_dirs=include_dirs, + libraries=libraries, + library_dirs=library_dirs, + extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, + **kwargs) + ext.monkey_patch_distutils() + ext._cc = self + return ext + + +class _CCExtension(Extension): + """ + A Numba-specific Extension subclass to LLVM-compile pure Python code + to an extension module. + """ + + _cc = None + _distutils_monkey_patched = False + + def _prepare_object_files(self, build_ext): + cc = self._cc + dir_util.mkpath(os.path.join(build_ext.build_temp, *self.name.split('.')[:-1])) + objects, _ = cc._compile_object_files(build_ext.build_temp) + # Add generated object files for linking + self.extra_objects = objects + + @classmethod + def monkey_patch_distutils(cls): + """ + Monkey-patch distutils with our own build_ext class knowing + about pycc-compiled extensions modules. + """ + if cls._distutils_monkey_patched: + return + + _orig_build_ext = build_ext.build_ext + + class _CC_build_ext(_orig_build_ext): + + def build_extension(self, ext): + if isinstance(ext, _CCExtension): + ext._prepare_object_files(self) + + _orig_build_ext.build_extension(self, ext) + + build_ext.build_ext = _CC_build_ext + + cls._distutils_monkey_patched = True diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/compiler.py b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/compiler.py new file mode 100644 index 0000000000000000000000000000000000000000..a9ad60943fcb3807ae3339db41ee78de1ec905c9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/compiler.py @@ -0,0 +1,477 @@ +# -*- coding: utf-8 -*- + +import logging +import os +import sys + +from llvmlite import ir +from llvmlite.binding import Linkage + +from numba.pycc import llvm_types as lt +from numba.core.cgutils import create_constant_array +from numba.core.compiler import compile_extra, Flags +from numba.core.compiler_lock import global_compiler_lock + +from numba.core.registry import cpu_target +from numba.core.runtime import nrtdynmod +from numba.core import cgutils + + +logger = logging.getLogger(__name__) + +__all__ = ['Compiler'] + +NULL = ir.Constant(lt._void_star, None) +ZERO = ir.Constant(lt._int32, 0) +ONE = ir.Constant(lt._int32, 1) +METH_VARARGS_AND_KEYWORDS = ir.Constant(lt._int32, 1|2) + + +def get_header(): + import numpy + import textwrap + + return textwrap.dedent("""\ + #include + + #ifndef HAVE_LONGDOUBLE + #define HAVE_LONGDOUBLE %d + #endif + + typedef struct { + float real; + float imag; + } complex64; + + typedef struct { + double real; + double imag; + } complex128; + + #if HAVE_LONGDOUBLE + typedef struct { + long double real; + long double imag; + } complex256; + #endif + + typedef float float32; + typedef double float64; + #if HAVE_LONGDOUBLE + typedef long double float128; + #endif + """ % hasattr(numpy, 'complex256')) + + +class ExportEntry(object): + """ + A simple record for exporting symbols. + """ + + def __init__(self, symbol, signature, function): + self.symbol = symbol + self.signature = signature + self.function = function + + def __repr__(self): + return "ExportEntry(%r, %r)" % (self.symbol, self.signature) + + +class _ModuleCompiler(object): + """A base class to compile Python modules to a single shared library or + extension module. + + :param export_entries: a list of ExportEntry instances. + :param module_name: the name of the exported module. + """ + + #: Structure used to describe a method of an extension type. + #: struct PyMethodDef { + #: const char *ml_name; /* The name of the built-in function/method */ + #: PyCFunction ml_meth; /* The C function that implements it */ + #: int ml_flags; /* Combination of METH_xxx flags, which mostly + #: describe the args expected by the C func */ + #: const char *ml_doc; /* The __doc__ attribute, or NULL */ + #: }; + method_def_ty = ir.LiteralStructType((lt._int8_star, + lt._void_star, + lt._int32, + lt._int8_star)) + + method_def_ptr = ir.PointerType(method_def_ty) + # The structure type constructed by PythonAPI.serialize_uncached() + # when updating this, also make sure to update `env_def_t` struct in + # numba/pycc/modulemixin.c + env_def_ty = ir.LiteralStructType((lt._void_star, + lt._int32, + lt._void_star, + lt._void_star, + lt._int32)) + env_def_ptr = ir.PointerType(env_def_ty) + + def __init__(self, export_entries, module_name, use_nrt=False, + **aot_options): + self.module_name = module_name + self.export_python_wrap = False + self.dll_exports = [] + self.export_entries = export_entries + # Used by the CC API but not the legacy API + self.external_init_function = None + self.use_nrt = use_nrt + + self.typing_context = cpu_target.typing_context + self.context = cpu_target.target_context.with_aot_codegen( + self.module_name, **aot_options) + + def _mangle_method_symbol(self, func_name): + return "._pycc_method_%s" % (func_name,) + + def _emit_python_wrapper(self, llvm_module): + """Emit generated Python wrapper and extension module code. + """ + raise NotImplementedError + + @global_compiler_lock + def _cull_exports(self): + """Read all the exported functions/modules in the translator + environment, and join them into a single LLVM module. + """ + self.exported_function_types = {} + self.function_environments = {} + self.environment_gvs = {} + + codegen = self.context.codegen() + library = codegen.create_library(self.module_name) + + # Generate IR for all exported functions + flags = Flags() + flags.no_compile = True + if not self.export_python_wrap: + flags.no_cpython_wrapper = True + flags.no_cfunc_wrapper = True + if self.use_nrt: + flags.nrt = True + # Compile NRT helpers + nrt_module, _ = nrtdynmod.create_nrt_module(self.context) + library.add_ir_module(nrt_module) + + for entry in self.export_entries: + cres = compile_extra(self.typing_context, self.context, + entry.function, + entry.signature.args, + entry.signature.return_type, flags, + locals={}, library=library) + + func_name = cres.fndesc.llvm_func_name + llvm_func = cres.library.get_function(func_name) + + if self.export_python_wrap: + llvm_func.linkage = 'internal' + wrappername = cres.fndesc.llvm_cpython_wrapper_name + wrapper = cres.library.get_function(wrappername) + wrapper.name = self._mangle_method_symbol(entry.symbol) + wrapper.linkage = 'external' + fnty = cres.target_context.call_conv.get_function_type( + cres.fndesc.restype, cres.fndesc.argtypes) + self.exported_function_types[entry] = fnty + self.function_environments[entry] = cres.environment + self.environment_gvs[entry] = cres.fndesc.env_name + else: + llvm_func.name = entry.symbol + self.dll_exports.append(entry.symbol) + + if self.export_python_wrap: + wrapper_module = library.create_ir_module("wrapper") + self._emit_python_wrapper(wrapper_module) + library.add_ir_module(wrapper_module) + + # Hide all functions in the DLL except those explicitly exported + library.finalize() + for fn in library.get_defined_functions(): + if fn.name not in self.dll_exports: + if fn.linkage in {Linkage.private, Linkage.internal}: + # Private/Internal linkage must have "default" visibility + fn.visibility = "default" + else: + fn.visibility = 'hidden' + return library + + def write_llvm_bitcode(self, output, wrap=False, **kws): + self.export_python_wrap = wrap + library = self._cull_exports() + with open(output, 'wb') as fout: + fout.write(library.emit_bitcode()) + + def write_native_object(self, output, wrap=False, **kws): + self.export_python_wrap = wrap + library = self._cull_exports() + with open(output, 'wb') as fout: + fout.write(library.emit_native_object()) + + def emit_type(self, tyobj): + ret_val = str(tyobj) + if 'int' in ret_val: + if ret_val.endswith(('8', '16', '32', '64')): + ret_val += "_t" + return ret_val + + def emit_header(self, output): + fname, ext = os.path.splitext(output) + with open(fname + '.h', 'w') as fout: + fout.write(get_header()) + fout.write("\n/* Prototypes */\n") + for export_entry in self.export_entries: + name = export_entry.symbol + restype = self.emit_type(export_entry.signature.return_type) + args = ", ".join(self.emit_type(argtype) + for argtype in export_entry.signature.args) + fout.write("extern %s %s(%s);\n" % (restype, name, args)) + + def _emit_method_array(self, llvm_module): + """ + Collect exported methods and emit a PyMethodDef array. + + :returns: a pointer to the PyMethodDef array. + """ + method_defs = [] + for entry in self.export_entries: + name = entry.symbol + llvm_func_name = self._mangle_method_symbol(name) + fnty = self.exported_function_types[entry] + lfunc = ir.Function(llvm_module, fnty, llvm_func_name) + + method_name = self.context.insert_const_string(llvm_module, name) + method_def_const = ir.Constant.literal_struct( + (method_name, + ir.Constant.bitcast(lfunc, lt._void_star), + METH_VARARGS_AND_KEYWORDS, + NULL)) + method_defs.append(method_def_const) + + sentinel = ir.Constant.literal_struct([NULL, NULL, ZERO, NULL]) + method_defs.append(sentinel) + method_array_init = create_constant_array(self.method_def_ty, method_defs) + method_array = cgutils.add_global_variable(llvm_module, + method_array_init.type, + '.module_methods') + method_array.initializer = method_array_init + method_array.linkage = 'internal' + method_array_ptr = ir.Constant.gep(method_array, [ZERO, ZERO]) + return method_array_ptr + + def _emit_environment_array(self, llvm_module, builder, pyapi): + """ + Emit an array of env_def_t structures (see modulemixin.c) + storing the pickled environment constants for each of the + exported functions. + """ + env_defs = [] + for entry in self.export_entries: + env = self.function_environments[entry] + # Constants may be unhashable so avoid trying to cache them + env_def = pyapi.serialize_uncached(env.consts) + env_defs.append(env_def) + env_defs_init = create_constant_array(self.env_def_ty, env_defs) + gv = self.context.insert_unique_const(llvm_module, + '.module_environments', + env_defs_init) + return gv.gep([ZERO, ZERO]) + + def _emit_envgvs_array(self, llvm_module, builder, pyapi): + """ + Emit an array of Environment pointers that needs to be filled at + initialization. + """ + env_setters = [] + for entry in self.export_entries: + envgv_name = self.environment_gvs[entry] + gv = self.context.declare_env_global(llvm_module, envgv_name) + envgv = gv.bitcast(lt._void_star) + env_setters.append(envgv) + + env_setters_init = create_constant_array(lt._void_star, env_setters) + gv = self.context.insert_unique_const(llvm_module, + '.module_envgvs', + env_setters_init) + return gv.gep([ZERO, ZERO]) + + def _emit_module_init_code(self, llvm_module, builder, modobj, + method_array, env_array, envgv_array): + """ + Emit call to "external" init function, if any. + """ + if self.external_init_function: + fnty = ir.FunctionType(lt._int32, + [modobj.type, self.method_def_ptr, + self.env_def_ptr, envgv_array.type]) + fn = ir.Function(llvm_module, fnty, self.external_init_function) + return builder.call(fn, [modobj, method_array, env_array, + envgv_array]) + else: + return None + + +class ModuleCompiler(_ModuleCompiler): + + _ptr_fun = lambda ret, *args: ir.PointerType(ir.FunctionType(ret, args)) + + #: typedef int (*visitproc)(PyObject *, void *); + visitproc_ty = _ptr_fun(lt._int8, + lt._pyobject_head_p) + + #: typedef int (*inquiry)(PyObject *); + inquiry_ty = _ptr_fun(lt._int8, + lt._pyobject_head_p) + + #: typedef int (*traverseproc)(PyObject *, visitproc, void *); + traverseproc_ty = _ptr_fun(lt._int8, + lt._pyobject_head_p, + visitproc_ty, + lt._void_star) + + # typedef void (*freefunc)(void *) + freefunc_ty = _ptr_fun(lt._int8, + lt._void_star) + + # PyObject* (*m_init)(void); + m_init_ty = _ptr_fun(lt._int8) + + _char_star = lt._int8_star + + #: typedef struct PyModuleDef_Base { + #: PyObject_HEAD + #: PyObject* (*m_init)(void); + #: Py_ssize_t m_index; + #: PyObject* m_copy; + #: } PyModuleDef_Base; + module_def_base_ty = ir.LiteralStructType( + ( + lt._pyobject_head, + m_init_ty, + lt._llvm_py_ssize_t, + lt._pyobject_head_p + )) + + #: This struct holds all information that is needed to create a module object. + #: typedef struct PyModuleDef{ + #: PyModuleDef_Base m_base; + #: const char* m_name; + #: const char* m_doc; + #: Py_ssize_t m_size; + #: PyMethodDef *m_methods; + #: inquiry m_reload; + #: traverseproc m_traverse; + #: inquiry m_clear; + #: freefunc m_free; + #: }PyModuleDef; + module_def_ty = ir.LiteralStructType( + ( + module_def_base_ty, + _char_star, + _char_star, + lt._llvm_py_ssize_t, + _ModuleCompiler.method_def_ptr, + inquiry_ty, + traverseproc_ty, + inquiry_ty, + freefunc_ty + )) + + @property + def module_create_definition(self): + """ + Return the signature and name of the Python C API function to + initialize the module. + """ + signature = ir.FunctionType(lt._pyobject_head_p, + (ir.PointerType(self.module_def_ty), + lt._int32)) + + name = "PyModule_Create2" + if lt._trace_refs_: + name += "TraceRefs" + + return signature, name + + @property + def module_init_definition(self): + """ + Return the name and signature of the module's initialization function. + """ + signature = ir.FunctionType(lt._pyobject_head_p, ()) + + return signature, "PyInit_" + self.module_name + + def _emit_python_wrapper(self, llvm_module): + # Figure out the Python C API module creation function, and + # get a LLVM function for it. + create_module_fn = ir.Function(llvm_module, *self.module_create_definition) + create_module_fn.linkage = 'external' + + # Define a constant string for the module name. + mod_name_const = self.context.insert_const_string(llvm_module, + self.module_name) + + mod_def_base_init = ir.Constant.literal_struct( + (lt._pyobject_head_init, # PyObject_HEAD + ir.Constant(self.m_init_ty, None), # m_init + ir.Constant(lt._llvm_py_ssize_t, None), # m_index + ir.Constant(lt._pyobject_head_p, None), # m_copy + ) + ) + mod_def_base = cgutils.add_global_variable(llvm_module, + mod_def_base_init.type, + '.module_def_base') + mod_def_base.initializer = mod_def_base_init + mod_def_base.linkage = 'internal' + + method_array = self._emit_method_array(llvm_module) + + mod_def_init = ir.Constant.literal_struct( + (mod_def_base_init, # m_base + mod_name_const, # m_name + ir.Constant(self._char_star, None), # m_doc + ir.Constant(lt._llvm_py_ssize_t, -1), # m_size + method_array, # m_methods + ir.Constant(self.inquiry_ty, None), # m_reload + ir.Constant(self.traverseproc_ty, None), # m_traverse + ir.Constant(self.inquiry_ty, None), # m_clear + ir.Constant(self.freefunc_ty, None) # m_free + ) + ) + + # Define a constant string for the module name. + mod_def = cgutils.add_global_variable(llvm_module, mod_def_init.type, + '.module_def') + mod_def.initializer = mod_def_init + mod_def.linkage = 'internal' + + # Define the module initialization function. + mod_init_fn = ir.Function(llvm_module, *self.module_init_definition) + entry = mod_init_fn.append_basic_block('Entry') + builder = ir.IRBuilder(entry) + pyapi = self.context.get_python_api(builder) + + mod = builder.call(create_module_fn, + (mod_def, + ir.Constant(lt._int32, sys.api_version))) + + # Test if module has been created correctly. + # (XXX for some reason comparing with the NULL constant fails llvm + # with an assertion in pydebug mode) + with builder.if_then(cgutils.is_null(builder, mod)): + builder.ret(NULL.bitcast(mod_init_fn.type.pointee.return_type)) + + env_array = self._emit_environment_array(llvm_module, builder, pyapi) + envgv_array = self._emit_envgvs_array(llvm_module, builder, pyapi) + ret = self._emit_module_init_code(llvm_module, builder, mod, + method_array, env_array, envgv_array) + if ret is not None: + with builder.if_then(cgutils.is_not_null(builder, ret)): + # Init function errored out + builder.ret(ir.Constant(mod.type, None)) + + builder.ret(mod) + + self.dll_exports.append(mod_init_fn.name) + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/decorators.py b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/decorators.py new file mode 100644 index 0000000000000000000000000000000000000000..34278903dec5335b0aaa37063a19afc0e5f65865 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/decorators.py @@ -0,0 +1,72 @@ +import re +import warnings + +from numba.core import typing, sigutils +from numba.pycc.compiler import ExportEntry + +# Registry is okay to be a global because we are using pycc as a standalone +# commandline tool. +export_registry = [] + + +def export(prototype): + warnings.warn("export() is deprecated, use the numba.pycc.CC API instead", + DeprecationWarning, stacklevel=2) + + sym, sig = parse_prototype(prototype) + + def wrappped(func): + fn_argtys, fn_retty = sigutils.normalize_signature(sig) + signature = typing.signature(fn_retty, *fn_argtys) + entry = ExportEntry(symbol=sym, signature=signature, function=func) + export_registry.append(entry) + + return wrappped + + +def exportmany(prototypes): + warnings.warn("exportmany() is deprecated, use the numba.pycc.CC API instead", + DeprecationWarning, stacklevel=2) + + def wrapped(func): + for proto in prototypes: + export(proto)(func) + return wrapped + + +def process_input_files(inputs): + """ + Read input source files for execution of legacy @export / @exportmany + decorators. + """ + for ifile in inputs: + with open(ifile) as fin: + exec(compile(fin.read(), ifile, 'exec')) + + +def clear_export_registry(): + export_registry[:] = [] + + +# --------------------------------- Internal --------------------------------- + +re_symbol = re.compile(r'[_a-z][_a-z0-9]*', re.I) + + +def parse_prototype(text): + """Separate the symbol and function-type in a a string with + "symbol function-type" (e.g. "mult float(float, float)") + + Returns + --------- + (symbol_string, functype_string) + """ + m = re_symbol.match(text) + if not m: + raise ValueError("Invalid function name for export prototype") + s = m.start(0) + e = m.end(0) + symbol = text[s:e] + functype = text[e + 1:] + return symbol, functype + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/llvm_types.py b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/llvm_types.py new file mode 100644 index 0000000000000000000000000000000000000000..4259ced6e6f696425530c250aba947043aa852ca --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/llvm_types.py @@ -0,0 +1,37 @@ +import sys +import ctypes +import struct as struct_ +import llvmlite.ir +from llvmlite.ir import Constant + +_trace_refs_ = hasattr(sys, 'getobjects') +_plat_bits = struct_.calcsize('@P') * 8 + +_int8 = llvmlite.ir.IntType(8) +_int32 = llvmlite.ir.IntType(32) + +_void_star = llvmlite.ir.PointerType(_int8) + +_int8_star = _void_star + +_sizeof_py_ssize_t = ctypes.sizeof(getattr(ctypes, 'c_size_t')) +_llvm_py_ssize_t = llvmlite.ir.IntType(_sizeof_py_ssize_t * 8) + +if _trace_refs_: + _pyobject_head = llvmlite.ir.LiteralStructType([_void_star, _void_star, + _llvm_py_ssize_t, _void_star]) + _pyobject_head_init = Constant.literal_struct([ + Constant(_void_star, None), # _ob_next + Constant(_void_star, None), # _ob_prev + Constant(_llvm_py_ssize_t, 1), # ob_refcnt + Constant(_void_star, None), # ob_type + ]) + +else: + _pyobject_head = llvmlite.ir.LiteralStructType([_llvm_py_ssize_t, _void_star]) + _pyobject_head_init = Constant.literal_struct([ + Constant(_llvm_py_ssize_t, 1), # ob_refcnt + Constant(_void_star, None), # ob_type + ]) + +_pyobject_head_p = llvmlite.ir.PointerType(_pyobject_head) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/modulemixin.c b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/modulemixin.c new file mode 100644 index 0000000000000000000000000000000000000000..5e03133d8391918bf1c58c5b04c981cba17a7f9d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/modulemixin.c @@ -0,0 +1,208 @@ +/* + * This C file is compiled and linked into pycc-generated shared objects. + * It provides the Numba helper functions for runtime use in pycc-compiled + * functions. + */ + +#include "../_numba_common.h" +#include "../_pymodule.h" + +/* Define all runtime-required symbols in this C module, but do not + export them outside the shared library if possible. */ + +#define NUMBA_EXPORT_FUNC(_rettype) VISIBILITY_HIDDEN _rettype +#define NUMBA_EXPORT_DATA(_vartype) VISIBILITY_HIDDEN _vartype + +#define PYCC_COMPILING + +#include "../_helperlib.c" +#include "../_dynfunc.c" + +#if PYCC_USE_NRT +#include "../core/runtime/_nrt_python.c" +#include "../core/runtime/nrt.h" +#endif + +#if (PY_MAJOR_VERSION == 3) && (PY_MINOR_VERSION >= 12) + #define Py_BUILD_CORE 1 + #include "internal/pycore_pyhash.h" + #undef Py_BUILD_CORE +#endif + +/* Defines hashsecret variables (see issue #6386) */ +int64_t _numba_hashsecret_siphash_k0; +int64_t _numba_hashsecret_siphash_k1; +int64_t _numba_hashsecret_djbx33a_suffix; + +/* NOTE: import_array() is macro, not a function. It returns NULL on + failure */ +static void * +wrap_import_array(void) { + import_array(); + return (void *) 1; +} + + +static int +init_numpy(void) { + return wrap_import_array() != NULL; +} + + +#ifndef PYCC_MODULE_NAME +#error PYCC_MODULE_NAME must be defined +#endif + +/* Preprocessor trick: need to use two levels of macros otherwise + PYCC_MODULE_NAME would not get expanded */ +#define __PYCC(prefix, modname) prefix ## modname +#define _PYCC(prefix, modname) __PYCC(prefix, modname) +#define PYCC(prefix) _PYCC(prefix, PYCC_MODULE_NAME) + +/* Silence warnings about unused functions */ +VISIBILITY_HIDDEN void **PYCC(_unused_) = { + (void *) Numba_make_generator, +}; + +/* The structure type constructed by PythonAPI.serialize_uncached() */ +typedef struct { + const char *data; + int len; + const char *hashbuf; + const char *func_ptr; // pointer to unwrap dyn args function + int alloc_flag; +} env_def_t; + +/* Environment GlobalVariable address type */ +typedef void **env_gv_t; + +/* + * Recreate an environment object from a env_def_t structure. + */ +static EnvironmentObject * +recreate_environment(PyObject *module, env_def_t env) +{ + EnvironmentObject *envobj; + PyObject *env_consts; + + env_consts = numba_unpickle(env.data, env.len, env.hashbuf); + if (env_consts == NULL) + return NULL; + if (!PyList_Check(env_consts)) { + PyErr_Format(PyExc_TypeError, + "environment constants should be a list, got '%s'", + Py_TYPE(env_consts)->tp_name); + Py_DECREF(env_consts); + return NULL; + } + + envobj = env_new_empty(&EnvironmentType); + if (envobj == NULL) { + Py_DECREF(env_consts); + return NULL; + } + envobj->consts = env_consts; + envobj->globals = PyModule_GetDict(module); + if (envobj->globals == NULL) { + Py_DECREF(envobj); + return NULL; + } + Py_INCREF(envobj->globals); + return envobj; +} + +/* + * Subroutine to initialize all resources required for running the + * pycc-compiled functions. + */ + +int +PYCC(pycc_init_) (PyObject *module, PyMethodDef *defs, + env_def_t *envs, + env_gv_t *envgvs) +{ + /* Aligns hashsecret with values in current python process so that + * hashes computed inside the pycc module are correct if imported + * by the current process. Imports in a new process get the right + * hash secret through: + * `numba.cpython.hashing._load_hashsecret`. + */ + _numba_hashsecret_siphash_k0 = _Py_HashSecret.siphash.k0; + _numba_hashsecret_siphash_k1 = _Py_HashSecret.siphash.k1; + _numba_hashsecret_djbx33a_suffix = _Py_HashSecret.djbx33a.suffix; + + PyMethodDef *fdef; + PyObject *modname = NULL; + PyObject *docobj = NULL; + int i; + + if (!init_numpy()) { + goto error; + } + if (init_dynfunc_module(module)) { + goto error; + } + /* Initialize random generation. */ + numba_rnd_ensure_global_init(); + +#if PYCC_USE_NRT + NRT_MemSys_init(); + if (init_nrt_python_module(module)) { + goto error; + } +#endif + + modname = PyObject_GetAttrString(module, "__name__"); + if (modname == NULL) { + goto error; + } + + /* Empty docstring for all compiled functions */ + docobj = PyString_FromString(""); + if (docobj == NULL) { + goto error; + } + + /* Overwrite C method objects with our own Closure objects, in order + * to make their environments available to the compiled functions. + */ + for (i = 0, fdef = defs; fdef->ml_name != NULL; i++, fdef++) { + PyObject *func; + PyObject *nameobj; + EnvironmentObject *envobj; + + envobj = recreate_environment(module, envs[i]); + if (envobj == NULL) { + goto error; + } + nameobj = PyString_FromString(fdef->ml_name); + if (nameobj == NULL) { + Py_DECREF(envobj); + goto error; + } + // Store the environment pointer into the global + *envgvs[i] = envobj; + + func = pycfunction_new(module, nameobj, docobj, + fdef->ml_meth, envobj, NULL); + Py_DECREF(envobj); + Py_DECREF(nameobj); + + if (func == NULL) { + goto error; + } + if (PyObject_SetAttrString(module, fdef->ml_name, func)) { + Py_DECREF(func); + goto error; + } + Py_DECREF(func); + } + Py_DECREF(docobj); + Py_DECREF(modname); + return 0; + +error: + Py_XDECREF(docobj); + Py_XDECREF(modname); + return -1; +} diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/platform.py b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/platform.py new file mode 100644 index 0000000000000000000000000000000000000000..6f490d7ef6a397472110801a81b213dcbab5cd3c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/pycc/platform.py @@ -0,0 +1,218 @@ +import setuptools +from setuptools.command.build_ext import build_ext +from setuptools.dist import Distribution +import numpy as np + +import functools +import os +import subprocess +import sys +from tempfile import mkdtemp +from contextlib import contextmanager +from pathlib import Path + +# Wire in distutils components from setuptools +CCompiler = setuptools.distutils.ccompiler.CCompiler +new_compiler = setuptools.distutils.ccompiler.new_compiler +customize_compiler = setuptools.distutils.sysconfig.customize_compiler +log = setuptools.distutils.log + + +_configs = { + # DLL suffix, Python C extension suffix + 'win': ('.dll', '.pyd'), + 'default': ('.so', '.so'), +} + + +def get_configs(arg): + return _configs.get(sys.platform[:3], _configs['default'])[arg] + + +find_shared_ending = functools.partial(get_configs, 0) +find_pyext_ending = functools.partial(get_configs, 1) + +@contextmanager +def _gentmpfile(suffix): + # windows locks the tempfile so use a tempdir + file, see + # https://github.com/numba/numba/issues/3304 + try: + tmpdir = mkdtemp() + ntf = open(os.path.join(tmpdir, "temp%s" % suffix), 'wt') + yield ntf + finally: + try: + ntf.close() + os.remove(ntf) + except: + pass + else: + os.rmdir(tmpdir) + + +@functools.lru_cache(maxsize=1) +def external_compiler_works(): + """ + Returns True if the "external compiler" bound in numpy.distutil is present + and working, False otherwise. + """ + compiler = new_compiler() + customize_compiler(compiler) + for suffix in ['.c', '.cxx']: + try: + with _gentmpfile(suffix) as ntf: + simple_c = "int main(void) { return 0; }" + ntf.write(simple_c) + ntf.flush() + ntf.close() + # *output_dir* is set to avoid the compiler putting temp files + # in the current directory. + compiler.compile([ntf.name], output_dir=Path(ntf.name).anchor) + except Exception: # likely CompileError or file system issue + return False + return True + + +class _DummyExtension(object): + libraries = [] + + +class Toolchain(object): + + def __init__(self): + if not external_compiler_works(): + self._raise_external_compiler_error() + + self._verbose = False + self._compiler = new_compiler() + customize_compiler(self._compiler) + self._build_ext = build_ext(Distribution()) + self._build_ext.finalize_options() + self._py_lib_dirs = self._build_ext.library_dirs + self._py_include_dirs = self._build_ext.include_dirs + np_compile_args = {'include_dirs': [np.get_include(),],} + if sys.platform == 'win32': + np_compile_args['libraries'] = [] + else: + np_compile_args['libraries'] = ['m',] + self._math_info = np_compile_args + + @property + def verbose(self): + return self._verbose + + @verbose.setter + def verbose(self, value): + self._verbose = value + # DEBUG will let Numpy spew many messages, so stick to INFO + # to print commands executed by distutils + log.set_threshold(log.INFO if value else log.WARN) + + def _raise_external_compiler_error(self): + basemsg = ("Attempted to compile AOT function without the " + "compiler used by `numpy.distutils` present.") + conda_msg = "If using conda try:\n\n#> conda install %s" + plt = sys.platform + if plt.startswith('linux'): + if sys.maxsize <= 2 ** 32: + compilers = ['gcc_linux-32', 'gxx_linux-32'] + else: + compilers = ['gcc_linux-64', 'gxx_linux-64'] + msg = "%s %s" % (basemsg, conda_msg % ' '.join(compilers)) + elif plt.startswith('darwin'): + compilers = ['clang_osx-64', 'clangxx_osx-64'] + msg = "%s %s" % (basemsg, conda_msg % ' '.join(compilers)) + elif plt.startswith('win32'): + winmsg = "Cannot find suitable msvc." + msg = "%s %s" % (basemsg, winmsg) + else: + msg = "Unknown platform %s" % plt + raise RuntimeError(msg) + + def compile_objects(self, sources, output_dir, + include_dirs=(), depends=(), macros=(), + extra_cflags=None): + """ + Compile the given source files into a separate object file each, + all beneath the *output_dir*. A list of paths to object files + is returned. + + *macros* has the same format as in distutils: a list of 1- or 2-tuples. + If a 1-tuple (name,), the given name is considered undefined by + the C preprocessor. + If a 2-tuple (name, value), the given name is expanded into the + given value by the C preprocessor. + """ + objects = self._compiler.compile(sources, + output_dir=output_dir, + include_dirs=include_dirs, + depends=depends, + macros=macros or [], + extra_preargs=extra_cflags) + return objects + + def link_shared(self, output, objects, libraries=(), + library_dirs=(), export_symbols=(), + extra_ldflags=None): + """ + Create a shared library *output* linking the given *objects* + and *libraries* (all strings). + """ + output_dir, output_filename = os.path.split(output) + self._compiler.link(CCompiler.SHARED_OBJECT, objects, + output_filename, output_dir, + libraries, library_dirs, + export_symbols=export_symbols, + extra_preargs=extra_ldflags) + + def get_python_libraries(self): + """ + Get the library arguments necessary to link with Python. + """ + libs = self._build_ext.get_libraries(_DummyExtension()) + if sys.platform == 'win32': + # Under Windows, need to link explicitly against the CRT, + # as the MSVC compiler would implicitly do. + # (XXX msvcrtd in pydebug mode?) + libs = libs + ['msvcrt'] + return libs + self._math_info['libraries'] + + def get_python_library_dirs(self): + """ + Get the library directories necessary to link with Python. + """ + return list(self._py_lib_dirs) + + def get_python_include_dirs(self): + """ + Get the include directories necessary to compile against the Python + and Numpy C APIs. + """ + return list(self._py_include_dirs) + self._math_info['include_dirs'] + + def get_ext_filename(self, ext_name): + """ + Given a C extension's module name, return its intended filename. + """ + return self._build_ext.get_ext_filename(ext_name) + + +def _quote_arg(arg): + """ + Quote the argument for safe use in a shell command line. + """ + # If there is a quote in the string, assume relevants parts of the + # string are already quoted (e.g. '-I"C:\\Program Files\\..."') + if '"' not in arg and ' ' in arg: + return '"%s"' % arg + return arg + + +def _is_sequence(arg): + if isinstance(arg, (str, bytes)): + return False + try: + len(arg) + return True + except Exception: + return False diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/scripts/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/scripts/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/scripts/generate_lower_listing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/scripts/generate_lower_listing.py new file mode 100644 index 0000000000000000000000000000000000000000..1a93e7a3d0f48007c181ba2ab44439883c749995 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/scripts/generate_lower_listing.py @@ -0,0 +1,169 @@ +""" +Generate documentation for all registered implementation for lowering +using reStructured text. +""" + + +from subprocess import check_output + +import os.path +try: + from StringIO import StringIO # py2 +except ImportError: + from io import StringIO +from collections import defaultdict +import inspect +from functools import partial + +import numba +from numba.core.registry import cpu_target + + +def git_hash(): + out = check_output(['git', 'log', "--pretty=format:'%H'", '-n', '1']) + return out.decode('ascii').strip("'\"") + + +def get_func_name(fn): + return getattr(fn, '__qualname__', fn.__name__) + + +def gather_function_info(backend): + fninfos = defaultdict(list) + basepath = os.path.dirname(os.path.dirname(numba.__file__)) + for fn, osel in backend._defns.items(): + for sig, impl in osel.versions: + info = {} + fninfos[fn].append(info) + info['fn'] = fn + info['sig'] = sig + code, firstlineno = inspect.getsourcelines(impl) + path = inspect.getsourcefile(impl) + info['impl'] = { + 'name': get_func_name(impl), + 'filename': os.path.relpath(path, start=basepath), + 'lines': (firstlineno, firstlineno + len(code) - 1), + 'docstring': impl.__doc__ + } + + return fninfos + + +def bind_file_to_print(fobj): + return partial(print, file=fobj) + + +def format_signature(sig): + def fmt(c): + try: + return c.__name__ + except AttributeError: + return repr(c).strip('\'"') + out = tuple(map(fmt, sig)) + return '`({0})`'.format(', '.join(out)) + + +github_url = ('https://github.com/numba/numba/blob/' + '{commit}/{path}#L{firstline}-L{lastline}') + +description = """ +This lists all lowering definition registered to the CPU target. +Each subsection corresponds to a Python function that is supported by numba +nopython mode. These functions have one or more lower implementation with +different signatures. The compiler chooses the most specific implementation +from all overloads. +""" + + +def format_function_infos(fninfos): + buf = StringIO() + try: + print = bind_file_to_print(buf) + + title_line = "Lowering Listing" + print(title_line) + print('=' * len(title_line)) + + print(description) + + commit = git_hash() + + def format_fname(fn): + try: + fname = "{0}.{1}".format(fn.__module__, get_func_name(fn)) + except AttributeError: + fname = repr(fn) + return fn, fname + + for fn, fname in sorted(map(format_fname, fninfos), key=lambda x: x[1]): + impinfos = fninfos[fn] + header_line = "``{0}``".format(fname) + print(header_line) + print('-' * len(header_line)) + print() + + formatted_sigs = map( + lambda x: format_signature(x['sig']), impinfos) + sorted_impinfos = sorted(zip(formatted_sigs, impinfos), + key=lambda x: x[0]) + + col_signatures = ['Signature'] + col_urls = ['Definition'] + + for fmtsig, info in sorted_impinfos: + impl = info['impl'] + + filename = impl['filename'] + lines = impl['lines'] + fname = impl['name'] + + source = '{0} lines {1}-{2}'.format(filename, *lines) + link = github_url.format(commit=commit, path=filename, + firstline=lines[0], lastline=lines[1]) + url = '``{0}`` `{1} <{2}>`_'.format(fname, source, link) + + col_signatures.append(fmtsig) + col_urls.append(url) + + # table formatting + max_width_col_sig = max(map(len, col_signatures)) + max_width_col_url = max(map(len, col_urls)) + padding = 2 + width_col_sig = padding * 2 + max_width_col_sig + width_col_url = padding * 2 + max_width_col_url + line_format = "{{0:^{0}}} {{1:^{1}}}".format(width_col_sig, + width_col_url) + print(line_format.format('=' * width_col_sig, '=' * width_col_url)) + print(line_format.format(col_signatures[0], col_urls[0])) + print(line_format.format('=' * width_col_sig, '=' * width_col_url)) + for sig, url in zip(col_signatures[1:], col_urls[1:]): + print(line_format.format(sig, url)) + print(line_format.format('=' * width_col_sig, '=' * width_col_url)) + print() + + return buf.getvalue() + finally: + buf.close() + + +# Main routine for this module: + +def gen_lower_listing(path=None): + """ + Generate lowering listing to ``path`` or (if None) to stdout. + """ + cpu_backend = cpu_target.target_context + cpu_backend.refresh() + + fninfos = gather_function_info(cpu_backend) + out = format_function_infos(fninfos) + + if path is None: + print(out) + else: + with open(path, 'w') as fobj: + print(out, file=fobj) + + +if __name__ == '__main__': + gen_lower_listing() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/stencils/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/stencils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/stencils/stencil.py b/tool_server/.venv/lib/python3.12/site-packages/numba/stencils/stencil.py new file mode 100644 index 0000000000000000000000000000000000000000..61df4e0b61cc80068b3d4f729d1ad59b3da3413f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/stencils/stencil.py @@ -0,0 +1,836 @@ +# +# Copyright (c) 2017 Intel Corporation +# SPDX-License-Identifier: BSD-2-Clause +# + +import copy + +import numpy as np +from llvmlite import ir as lir + +from numba.core import types, typing, utils, ir, config, ir_utils, registry +from numba.core.typing.templates import (CallableTemplate, signature, + infer_global, AbstractTemplate) +from numba.core.imputils import lower_builtin +from numba.core.extending import register_jitable +from numba.core.errors import NumbaValueError +from numba.misc.special import literal_unroll +import numba + +import operator +from numba.np import numpy_support + +class StencilFuncLowerer(object): + '''Callable class responsible for lowering calls to a specific StencilFunc. + ''' + def __init__(self, sf): + self.stencilFunc = sf + + def __call__(self, context, builder, sig, args): + cres = self.stencilFunc.compile_for_argtys(sig.args, {}, + sig.return_type, None) + res = context.call_internal(builder, cres.fndesc, sig, args) + context.add_linking_libs([cres.library]) + return res + +@register_jitable +def raise_if_incompatible_array_sizes(a, *args): + ashape = a.shape + + # We need literal_unroll here because the stencil might take + # multiple input arrays with different types that are not compatible + # (e.g. values as float[:] and flags as bool[:]) + # When more than three total arrays are given, the second and third + # are iterated over in the loop below. Without literal_unroll, their + # types have to match. + # An example failing signature without literal_unroll might be + # (float[:], float[:], bool[:]) (Just (float[:], bool[:]) wouldn't fail) + for arg in literal_unroll(args): + if a.ndim != arg.ndim: + raise ValueError("Secondary stencil array does not have same number " + " of dimensions as the first stencil input.") + argshape = arg.shape + for i in range(len(ashape)): + if ashape[i] > argshape[i]: + raise ValueError("Secondary stencil array has some dimension " + "smaller the same dimension in the first " + "stencil input.") + +def slice_addition(the_slice, addend): + """ Called by stencil in Python mode to add the loop index to a + user-specified slice. + """ + return slice(the_slice.start + addend, the_slice.stop + addend) + +class StencilFunc(object): + """ + A special type to hold stencil information for the IR. + """ + + id_counter = 0 + + def __init__(self, kernel_ir, mode, options): + self.id = type(self).id_counter + type(self).id_counter += 1 + self.kernel_ir = kernel_ir + self.mode = mode + self.options = options + self.kws = [] # remember original kws arguments + + # stencils only supported for CPU context currently + self._typingctx = registry.cpu_target.typing_context + self._targetctx = registry.cpu_target.target_context + self._install_type(self._typingctx) + self.neighborhood = self.options.get("neighborhood") + self._type_cache = {} + self._lower_me = StencilFuncLowerer(self) + + def replace_return_with_setitem(self, blocks, index_vars, out_name): + """ + Find return statements in the IR and replace them with a SetItem + call of the value "returned" by the kernel into the result array. + Returns the block labels that contained return statements. + """ + ret_blocks = [] + + for label, block in blocks.items(): + scope = block.scope + loc = block.loc + new_body = [] + for stmt in block.body: + if isinstance(stmt, ir.Return): + ret_blocks.append(label) + # If 1D array then avoid the tuple construction. + if len(index_vars) == 1: + rvar = ir.Var(scope, out_name, loc) + ivar = ir.Var(scope, index_vars[0], loc) + new_body.append(ir.SetItem(rvar, ivar, stmt.value, loc)) + else: + # Convert the string names of the index variables into + # ir.Var's. + var_index_vars = [] + for one_var in index_vars: + index_var = ir.Var(scope, one_var, loc) + var_index_vars += [index_var] + + s_index_var = scope.redefine("stencil_index", loc) + # Build a tuple from the index ir.Var's. + tuple_call = ir.Expr.build_tuple(var_index_vars, loc) + new_body.append(ir.Assign(tuple_call, s_index_var, loc)) + rvar = ir.Var(scope, out_name, loc) + # Write the return statements original value into + # the array using the tuple index. + si = ir.SetItem(rvar, s_index_var, stmt.value, loc) + new_body.append(si) + else: + new_body.append(stmt) + block.body = new_body + return ret_blocks + + def add_indices_to_kernel(self, kernel, index_names, ndim, + neighborhood, standard_indexed, typemap, calltypes): + """ + Transforms the stencil kernel as specified by the user into one + that includes each dimension's index variable as part of the getitem + calls. So, in effect array[-1] becomes array[index0-1]. + """ + const_dict = {} + kernel_consts = [] + + if config.DEBUG_ARRAY_OPT >= 1: + print("add_indices_to_kernel", ndim, neighborhood) + ir_utils.dump_blocks(kernel.blocks) + + if neighborhood is None: + need_to_calc_kernel = True + else: + need_to_calc_kernel = False + if len(neighborhood) != ndim: + raise NumbaValueError("%d dimensional neighborhood specified " + "for %d dimensional input array" % + (len(neighborhood), ndim)) + + tuple_table = ir_utils.get_tuple_table(kernel.blocks) + + relatively_indexed = set() + + for block in kernel.blocks.values(): + scope = block.scope + loc = block.loc + new_body = [] + for stmt in block.body: + if (isinstance(stmt, ir.Assign) and + isinstance(stmt.value, ir.Const)): + if config.DEBUG_ARRAY_OPT >= 1: + print("remembering in const_dict", stmt.target.name, + stmt.value.value) + # Remember consts for use later. + const_dict[stmt.target.name] = stmt.value.value + if ((isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op in ['setitem', 'static_setitem'] + and stmt.value.value.name in kernel.arg_names) or + (isinstance(stmt, ir.SetItem) + and stmt.target.name in kernel.arg_names)): + raise NumbaValueError("Assignments to arrays passed to " \ + "stencil kernels is not allowed.") + if (isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op in ['getitem', 'static_getitem'] + and stmt.value.value.name in kernel.arg_names + and stmt.value.value.name not in standard_indexed): + # We found a getitem from the input array. + if stmt.value.op == 'getitem': + stmt_index_var = stmt.value.index + else: + stmt_index_var = stmt.value.index_var + # allow static_getitem since rewrite passes are applied + #raise ValueError("Unexpected static_getitem in add_indices_to_kernel.") + + relatively_indexed.add(stmt.value.value.name) + + # Store the index used after looking up the variable in + # the const dictionary. + if need_to_calc_kernel: + assert hasattr(stmt_index_var, 'name') + + if stmt_index_var.name in tuple_table: + kernel_consts += [tuple_table[stmt_index_var.name]] + elif stmt_index_var.name in const_dict: + kernel_consts += [const_dict[stmt_index_var.name]] + else: + raise NumbaValueError("stencil kernel index is not " + "constant, 'neighborhood' option required") + + if ndim == 1: + # Single dimension always has index variable 'index0'. + # tmpvar will hold the real index and is computed by + # adding the relative offset in stmt.value.index to + # the current absolute location in index0. + index_var = ir.Var(scope, index_names[0], loc) + tmpvar = scope.redefine("stencil_index", loc) + stmt_index_var_typ = typemap[stmt_index_var.name] + # If the array is indexed with a slice then we + # have to add the index value with a call to + # slice_addition. + if isinstance(stmt_index_var_typ, types.misc.SliceType): + sa_var = scope.redefine("slice_addition", loc) + sa_func = numba.njit(slice_addition) + sa_func_typ = types.functions.Dispatcher(sa_func) + typemap[sa_var.name] = sa_func_typ + g_sa = ir.Global("slice_addition", sa_func, loc) + new_body.append(ir.Assign(g_sa, sa_var, loc)) + slice_addition_call = ir.Expr.call(sa_var, [stmt_index_var, index_var], (), loc) + calltypes[slice_addition_call] = sa_func_typ.get_call_type(self._typingctx, [stmt_index_var_typ, types.intp], {}) + new_body.append(ir.Assign(slice_addition_call, tmpvar, loc)) + new_body.append(ir.Assign( + ir.Expr.getitem(stmt.value.value, tmpvar, loc), + stmt.target, loc)) + else: + acc_call = ir.Expr.binop(operator.add, stmt_index_var, + index_var, loc) + new_body.append(ir.Assign(acc_call, tmpvar, loc)) + new_body.append(ir.Assign( + ir.Expr.getitem(stmt.value.value, tmpvar, loc), + stmt.target, loc)) + else: + index_vars = [] + sum_results = [] + s_index_var = scope.redefine("stencil_index", loc) + const_index_vars = [] + ind_stencils = [] + + stmt_index_var_typ = typemap[stmt_index_var.name] + # Same idea as above but you have to extract + # individual elements out of the tuple indexing + # expression and add the corresponding index variable + # to them and then reconstitute as a tuple that can + # index the array. + for dim in range(ndim): + tmpvar = scope.redefine("const_index", loc) + new_body.append(ir.Assign(ir.Const(dim, loc), + tmpvar, loc)) + const_index_vars += [tmpvar] + index_var = ir.Var(scope, index_names[dim], loc) + index_vars += [index_var] + + tmpvar = scope.redefine("ind_stencil_index", loc) + ind_stencils += [tmpvar] + getitemvar = scope.redefine("getitem", loc) + getitemcall = ir.Expr.getitem(stmt_index_var, + const_index_vars[dim], loc) + new_body.append(ir.Assign(getitemcall, getitemvar, loc)) + # Get the type of this particular part of the index tuple. + if isinstance(stmt_index_var_typ, types.ConstSized): + one_index_typ = stmt_index_var_typ[dim] + else: + one_index_typ = stmt_index_var_typ[:] + # If the array is indexed with a slice then we + # have to add the index value with a call to + # slice_addition. + if isinstance(one_index_typ, types.misc.SliceType): + sa_var = scope.redefine("slice_addition", loc) + sa_func = numba.njit(slice_addition) + sa_func_typ = types.functions.Dispatcher(sa_func) + typemap[sa_var.name] = sa_func_typ + g_sa = ir.Global("slice_addition", sa_func, loc) + new_body.append(ir.Assign(g_sa, sa_var, loc)) + slice_addition_call = ir.Expr.call(sa_var, [getitemvar, index_vars[dim]], (), loc) + calltypes[slice_addition_call] = sa_func_typ.get_call_type(self._typingctx, [one_index_typ, types.intp], {}) + new_body.append(ir.Assign(slice_addition_call, tmpvar, loc)) + else: + acc_call = ir.Expr.binop(operator.add, getitemvar, + index_vars[dim], loc) + new_body.append(ir.Assign(acc_call, tmpvar, loc)) + + tuple_call = ir.Expr.build_tuple(ind_stencils, loc) + new_body.append(ir.Assign(tuple_call, s_index_var, loc)) + new_body.append(ir.Assign( + ir.Expr.getitem(stmt.value.value,s_index_var,loc), + stmt.target,loc)) + else: + new_body.append(stmt) + block.body = new_body + + if need_to_calc_kernel: + # Find the size of the kernel by finding the maximum absolute value + # index used in the kernel specification. + neighborhood = [[0,0] for _ in range(ndim)] + if len(kernel_consts) == 0: + raise NumbaValueError("Stencil kernel with no accesses to " + "relatively indexed arrays.") + + for index in kernel_consts: + if isinstance(index, tuple) or isinstance(index, list): + for i in range(len(index)): + te = index[i] + if isinstance(te, ir.Var) and te.name in const_dict: + te = const_dict[te.name] + if isinstance(te, int): + neighborhood[i][0] = min(neighborhood[i][0], te) + neighborhood[i][1] = max(neighborhood[i][1], te) + else: + raise NumbaValueError( + "stencil kernel index is not constant," + "'neighborhood' option required") + index_len = len(index) + elif isinstance(index, int): + neighborhood[0][0] = min(neighborhood[0][0], index) + neighborhood[0][1] = max(neighborhood[0][1], index) + index_len = 1 + else: + raise NumbaValueError( + "Non-tuple or non-integer used as stencil index.") + if index_len != ndim: + raise NumbaValueError( + "Stencil index does not match array dimensionality.") + + return (neighborhood, relatively_indexed) + + + def get_return_type(self, argtys): + if config.DEBUG_ARRAY_OPT >= 1: + print("get_return_type", argtys) + ir_utils.dump_blocks(self.kernel_ir.blocks) + + if not isinstance(argtys[0], types.npytypes.Array): + raise NumbaValueError("The first argument to a stencil kernel must " + "be the primary input array.") + + from numba.core import typed_passes + typemap, return_type, calltypes, _ = typed_passes.type_inference_stage( + self._typingctx, + self._targetctx, + self.kernel_ir, + argtys, + None, + {}) + if isinstance(return_type, types.npytypes.Array): + raise NumbaValueError( + "Stencil kernel must return a scalar and not a numpy array.") + + real_ret = types.npytypes.Array(return_type, argtys[0].ndim, + argtys[0].layout) + return (real_ret, typemap, calltypes) + + def _install_type(self, typingctx): + """Constructs and installs a typing class for a StencilFunc object in + the input typing context. + """ + _ty_cls = type('StencilFuncTyping_' + + str(self.id), + (AbstractTemplate,), + dict(key=self, generic=self._type_me)) + typingctx.insert_user_function(self, _ty_cls) + + def compile_for_argtys(self, argtys, kwtys, return_type, sigret): + # look in the type cache to find if result array is passed + (_, result, typemap, calltypes) = self._type_cache[argtys] + new_func = self._stencil_wrapper(result, sigret, return_type, + typemap, calltypes, *argtys) + return new_func + + def _type_me(self, argtys, kwtys): + """ + Implement AbstractTemplate.generic() for the typing class + built by StencilFunc._install_type(). + Return the call-site signature. + """ + if (self.neighborhood is not None and + len(self.neighborhood) != argtys[0].ndim): + raise NumbaValueError("%d dimensional neighborhood specified " + "for %d dimensional input array" % + (len(self.neighborhood), argtys[0].ndim)) + + argtys_extra = argtys + sig_extra = "" + result = None + if 'out' in kwtys: + argtys_extra += (kwtys['out'],) + sig_extra += ", out=None" + result = kwtys['out'] + + if 'neighborhood' in kwtys: + argtys_extra += (kwtys['neighborhood'],) + sig_extra += ", neighborhood=None" + + # look in the type cache first + if argtys_extra in self._type_cache: + (_sig, _, _, _) = self._type_cache[argtys_extra] + return _sig + + (real_ret, typemap, calltypes) = self.get_return_type(argtys) + sig = signature(real_ret, *argtys_extra) + dummy_text = ("def __numba_dummy_stencil({}{}):\n pass\n".format( + ",".join(self.kernel_ir.arg_names), sig_extra)) + dct = {} + exec(dummy_text, dct) + dummy_func = dct["__numba_dummy_stencil"] + sig = sig.replace(pysig=utils.pysignature(dummy_func)) + self._targetctx.insert_func_defn([(self._lower_me, self, argtys_extra)]) + self._type_cache[argtys_extra] = (sig, result, typemap, calltypes) + return sig + + def copy_ir_with_calltypes(self, ir, calltypes): + """ + Create a copy of a given IR along with its calltype information. + We need a copy of the calltypes because copy propagation applied + to the copied IR will change the calltypes and make subsequent + uses of the original IR invalid. + """ + copy_calltypes = {} + kernel_copy = ir.copy() + kernel_copy.blocks = {} + # For each block... + for (block_label, block) in ir.blocks.items(): + new_block = copy.deepcopy(ir.blocks[block_label]) + new_block.body = [] + # For each statement in each block... + for stmt in ir.blocks[block_label].body: + # Copy the statement to the new copy of the kernel + # and if the original statement is in the original + # calltypes then add the type associated with this + # statement to the calltypes copy. + scopy = copy.deepcopy(stmt) + new_block.body.append(scopy) + if stmt in calltypes: + copy_calltypes[scopy] = calltypes[stmt] + kernel_copy.blocks[block_label] = new_block + return (kernel_copy, copy_calltypes) + + def _stencil_wrapper(self, result, sigret, return_type, typemap, calltypes, *args): + # Overall approach: + # 1) Construct a string containing a function definition for the stencil function + # that will execute the stencil kernel. This function definition includes a + # unique stencil function name, the parameters to the stencil kernel, loop + # nests across the dimensions of the input array. Those loop nests use the + # computed stencil kernel size so as not to try to compute elements where + # elements outside the bounds of the input array would be needed. + # 2) The but of the loop nest in this new function is a special sentinel + # assignment. + # 3) Get the IR of this new function. + # 4) Split the block containing the sentinel assignment and remove the sentinel + # assignment. Insert the stencil kernel IR into the stencil function IR + # after label and variable renaming of the stencil kernel IR to prevent + # conflicts with the stencil function IR. + # 5) Compile the combined stencil function IR + stencil kernel IR into existence. + + # Copy the kernel so that our changes for this callsite + # won't effect other callsites. + (kernel_copy, copy_calltypes) = self.copy_ir_with_calltypes( + self.kernel_ir, calltypes) + # The stencil kernel body becomes the body of a loop, for which args aren't needed. + ir_utils.remove_args(kernel_copy.blocks) + first_arg = kernel_copy.arg_names[0] + + in_cps, out_cps = ir_utils.copy_propagate(kernel_copy.blocks, typemap) + name_var_table = ir_utils.get_name_var_table(kernel_copy.blocks) + ir_utils.apply_copy_propagate( + kernel_copy.blocks, + in_cps, + name_var_table, + typemap, + copy_calltypes) + + if "out" in name_var_table: + raise NumbaValueError("Cannot use the reserved word 'out' in stencil kernels.") + + sentinel_name = ir_utils.get_unused_var_name("__sentinel__", name_var_table) + if config.DEBUG_ARRAY_OPT >= 1: + print("name_var_table", name_var_table, sentinel_name) + + the_array = args[0] + + if config.DEBUG_ARRAY_OPT >= 1: + print("_stencil_wrapper", return_type, return_type.dtype, + type(return_type.dtype), args) + ir_utils.dump_blocks(kernel_copy.blocks) + + # We generate a Numba function to execute this stencil and here + # create the unique name of this function. + stencil_func_name = "__numba_stencil_%s_%s" % ( + hex(id(the_array)).replace("-", "_"), + self.id) + + # We will put a loop nest in the generated function for each + # dimension in the input array. Here we create the name for + # the index variable for each dimension. index0, index1, ... + index_vars = [] + for i in range(the_array.ndim): + index_var_name = ir_utils.get_unused_var_name("index" + str(i), + name_var_table) + index_vars += [index_var_name] + + # Create extra signature for out and neighborhood. + out_name = ir_utils.get_unused_var_name("out", name_var_table) + neighborhood_name = ir_utils.get_unused_var_name("neighborhood", + name_var_table) + sig_extra = "" + if result is not None: + sig_extra += ", {}=None".format(out_name) + if "neighborhood" in dict(self.kws): + sig_extra += ", {}=None".format(neighborhood_name) + + # Get a list of the standard indexed array names. + standard_indexed = self.options.get("standard_indexing", []) + + if first_arg in standard_indexed: + raise NumbaValueError("The first argument to a stencil kernel must " + "use relative indexing, not standard indexing.") + + if len(set(standard_indexed) - set(kernel_copy.arg_names)) != 0: + raise NumbaValueError("Standard indexing requested for an array name " + "not present in the stencil kernel definition.") + + # Add index variables to getitems in the IR to transition the accesses + # in the kernel from relative to regular Python indexing. Returns the + # computed size of the stencil kernel and a list of the relatively indexed + # arrays. + kernel_size, relatively_indexed = self.add_indices_to_kernel( + kernel_copy, index_vars, the_array.ndim, + self.neighborhood, standard_indexed, typemap, copy_calltypes) + if self.neighborhood is None: + self.neighborhood = kernel_size + + if config.DEBUG_ARRAY_OPT >= 1: + print("After add_indices_to_kernel") + ir_utils.dump_blocks(kernel_copy.blocks) + + # The return in the stencil kernel becomes a setitem for that + # particular point in the iteration space. + ret_blocks = self.replace_return_with_setitem(kernel_copy.blocks, + index_vars, out_name) + + if config.DEBUG_ARRAY_OPT >= 1: + print("After replace_return_with_setitem", ret_blocks) + ir_utils.dump_blocks(kernel_copy.blocks) + + # Start to form the new function to execute the stencil kernel. + func_text = "def {}({}{}):\n".format(stencil_func_name, + ",".join(kernel_copy.arg_names), sig_extra) + + # Get loop ranges for each dimension, which could be either int + # or variable. In the latter case we'll use the extra neighborhood + # argument to the function. + ranges = [] + for i in range(the_array.ndim): + if isinstance(kernel_size[i][0], int): + lo = kernel_size[i][0] + hi = kernel_size[i][1] + else: + lo = "{}[{}][0]".format(neighborhood_name, i) + hi = "{}[{}][1]".format(neighborhood_name, i) + ranges.append((lo, hi)) + + # If there are more than one relatively indexed arrays, add a call to + # a function that will raise an error if any of the relatively indexed + # arrays are of different size than the first input array. + if len(relatively_indexed) > 1: + func_text += " raise_if_incompatible_array_sizes(" + first_arg + for other_array in relatively_indexed: + if other_array != first_arg: + func_text += "," + other_array + func_text += ")\n" + + # Get the shape of the first input array. + shape_name = ir_utils.get_unused_var_name("full_shape", name_var_table) + func_text += " {} = {}.shape\n".format(shape_name, first_arg) + + # Converts cval to a string constant + def cval_as_str(cval): + if not np.isfinite(cval): + # See if this is a string-repr numerical const, issue #7286 + if np.isnan(cval): + return "np.nan" + elif np.isinf(cval): + if cval < 0: + return "-np.inf" + else: + return "np.inf" + else: + return str(cval) + + # If we have to allocate the output array (the out argument was not used) + # then us numpy.full if the user specified a cval stencil decorator option + # or np.zeros if they didn't to allocate the array. + if result is None: + return_type_name = numpy_support.as_dtype( + return_type.dtype).type.__name__ + out_init ="{} = np.empty({}, dtype=np.{})\n".format( + out_name, shape_name, return_type_name) + + if "cval" in self.options: + cval = self.options["cval"] + cval_ty = typing.typeof.typeof(cval) + if not self._typingctx.can_convert(cval_ty, return_type.dtype): + msg = "cval type does not match stencil return type." + raise NumbaValueError(msg) + else: + cval = 0 + func_text += " " + out_init + for dim in range(the_array.ndim): + start_items = [":"] * the_array.ndim + end_items = [":"] * the_array.ndim + start_items[dim] = ":-{}".format(self.neighborhood[dim][0]) + end_items[dim] = "-{}:".format(self.neighborhood[dim][1]) + func_text += " " + "{}[{}] = {}\n".format(out_name, ",".join(start_items), cval_as_str(cval)) + func_text += " " + "{}[{}] = {}\n".format(out_name, ",".join(end_items), cval_as_str(cval)) + else: # result is present, if cval is set then use it + if "cval" in self.options: + cval = self.options["cval"] + cval_ty = typing.typeof.typeof(cval) + if not self._typingctx.can_convert(cval_ty, return_type.dtype): + msg = "cval type does not match stencil return type." + raise NumbaValueError(msg) + out_init = "{}[:] = {}\n".format(out_name, cval_as_str(cval)) + func_text += " " + out_init + + offset = 1 + # Add the loop nests to the new function. + for i in range(the_array.ndim): + for j in range(offset): + func_text += " " + # ranges[i][0] is the minimum index used in the i'th dimension + # but minimum's greater than 0 don't preclude any entry in the array. + # So, take the minimum of 0 and the minimum index found in the kernel + # and this will be a negative number (potentially -0). Then, we do + # unary - on that to get the positive offset in this dimension whose + # use is precluded. + # ranges[i][1] is the maximum of 0 and the observed maximum index + # in this dimension because negative maximums would not cause us to + # preclude any entry in the array from being used. + func_text += ("for {} in range(-min(0,{})," + "{}[{}]-max(0,{})):\n").format( + index_vars[i], + ranges[i][0], + shape_name, + i, + ranges[i][1]) + offset += 1 + + for j in range(offset): + func_text += " " + # Put a sentinel in the code so we can locate it in the IR. We will + # remove this sentinel assignment and replace it with the IR for the + # stencil kernel body. + func_text += "{} = 0\n".format(sentinel_name) + func_text += " return {}\n".format(out_name) + + if config.DEBUG_ARRAY_OPT >= 1: + print("new stencil func text") + print(func_text) + + # Force the new stencil function into existence. + dct = {} + dct.update(globals()) + exec(func_text, dct) + stencil_func = dct[stencil_func_name] + if sigret is not None: + pysig = utils.pysignature(stencil_func) + sigret.pysig = pysig + # Get the IR for the newly created stencil function. + from numba.core import compiler + stencil_ir = compiler.run_frontend(stencil_func) + ir_utils.remove_dels(stencil_ir.blocks) + + # rename all variables in stencil_ir afresh + var_table = ir_utils.get_name_var_table(stencil_ir.blocks) + new_var_dict = {} + reserved_names = ([sentinel_name, out_name, neighborhood_name, + shape_name] + kernel_copy.arg_names + index_vars) + for name, var in var_table.items(): + if not name in reserved_names: + assert isinstance(var, ir.Var) + new_var = var.scope.redefine(var.name, var.loc) + new_var_dict[name] = new_var.name + ir_utils.replace_var_names(stencil_ir.blocks, new_var_dict) + + stencil_stub_last_label = max(stencil_ir.blocks.keys()) + 1 + + # Shift labels in the kernel copy so they are guaranteed unique + # and don't conflict with any labels in the stencil_ir. + kernel_copy.blocks = ir_utils.add_offset_to_labels( + kernel_copy.blocks, stencil_stub_last_label) + new_label = max(kernel_copy.blocks.keys()) + 1 + # Adjust ret_blocks to account for addition of the offset. + ret_blocks = [x + stencil_stub_last_label for x in ret_blocks] + + if config.DEBUG_ARRAY_OPT >= 1: + print("ret_blocks w/ offsets", ret_blocks, stencil_stub_last_label) + print("before replace sentinel stencil_ir") + ir_utils.dump_blocks(stencil_ir.blocks) + print("before replace sentinel kernel_copy") + ir_utils.dump_blocks(kernel_copy.blocks) + + # Search all the block in the stencil outline for the sentinel. + for label, block in stencil_ir.blocks.items(): + for i, inst in enumerate(block.body): + if (isinstance( inst, ir.Assign) and + inst.target.name == sentinel_name): + # We found the sentinel assignment. + loc = inst.loc + scope = block.scope + # split block across __sentinel__ + # A new block is allocated for the statements prior to the + # sentinel but the new block maintains the current block + # label. + prev_block = ir.Block(scope, loc) + prev_block.body = block.body[:i] + # The current block is used for statements after sentinel. + block.body = block.body[i + 1:] + # But the current block gets a new label. + body_first_label = min(kernel_copy.blocks.keys()) + + # The previous block jumps to the minimum labelled block of + # the parfor body. + prev_block.append(ir.Jump(body_first_label, loc)) + # Add all the parfor loop body blocks to the gufunc + # function's IR. + for (l, b) in kernel_copy.blocks.items(): + stencil_ir.blocks[l] = b + + stencil_ir.blocks[new_label] = block + stencil_ir.blocks[label] = prev_block + # Add a jump from all the blocks that previously contained + # a return in the stencil kernel to the block + # containing statements after the sentinel. + for ret_block in ret_blocks: + stencil_ir.blocks[ret_block].append( + ir.Jump(new_label, loc)) + break + else: + continue + break + + stencil_ir.blocks = ir_utils.rename_labels(stencil_ir.blocks) + ir_utils.remove_dels(stencil_ir.blocks) + + assert(isinstance(the_array, types.Type)) + array_types = args + + new_stencil_param_types = list(array_types) + + if config.DEBUG_ARRAY_OPT >= 1: + print("new_stencil_param_types", new_stencil_param_types) + ir_utils.dump_blocks(stencil_ir.blocks) + + # Compile the combined stencil function with the replaced loop + # body in it. + ir_utils.fixup_var_define_in_scope(stencil_ir.blocks) + new_func = compiler.compile_ir( + self._typingctx, + self._targetctx, + stencil_ir, + new_stencil_param_types, + None, + compiler.DEFAULT_FLAGS, + {}) + return new_func + + def __call__(self, *args, **kwargs): + self._typingctx.refresh() + if (self.neighborhood is not None and + len(self.neighborhood) != args[0].ndim): + raise NumbaValueError("{} dimensional neighborhood specified for " + "{} dimensional input array".format( + len(self.neighborhood), args[0].ndim)) + + if 'out' in kwargs: + result = kwargs['out'] + rdtype = result.dtype + rttype = numpy_support.from_dtype(rdtype) + result_type = types.npytypes.Array(rttype, result.ndim, + numpy_support.map_layout(result)) + array_types = tuple([typing.typeof.typeof(x) for x in args]) + array_types_full = tuple([typing.typeof.typeof(x) for x in args] + + [result_type]) + else: + result = None + array_types = tuple([typing.typeof.typeof(x) for x in args]) + array_types_full = array_types + + if config.DEBUG_ARRAY_OPT >= 1: + print("__call__", array_types, args, kwargs) + + (real_ret, typemap, calltypes) = self.get_return_type(array_types) + new_func = self._stencil_wrapper(result, None, real_ret, typemap, + calltypes, *array_types_full) + + if result is None: + return new_func.entry_point(*args) + else: + return new_func.entry_point(*(args+(result,))) + +def stencil(func_or_mode='constant', **options): + # called on function without specifying mode style + if not isinstance(func_or_mode, str): + mode = 'constant' # default style + func = func_or_mode + else: + mode = func_or_mode + func = None + + for option in options: + if option not in ["cval", "standard_indexing", "neighborhood"]: + raise NumbaValueError("Unknown stencil option " + option) + + wrapper = _stencil(mode, options) + if func is not None: + return wrapper(func) + return wrapper + +def _stencil(mode, options): + if mode != 'constant': + raise NumbaValueError("Unsupported mode style " + mode) + + def decorated(func): + from numba.core import compiler + kernel_ir = compiler.run_frontend(func) + return StencilFunc(kernel_ir, mode, options) + + return decorated + +@lower_builtin(stencil) +def stencil_dummy_lower(context, builder, sig, args): + "lowering for dummy stencil calls" + return lir.Constant(lir.IntType(types.intp.bitwidth), 0) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/stencils/stencilparfor.py b/tool_server/.venv/lib/python3.12/site-packages/numba/stencils/stencilparfor.py new file mode 100644 index 0000000000000000000000000000000000000000..3b80635d7586135b170c080fe396581ca014f75d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/stencils/stencilparfor.py @@ -0,0 +1,957 @@ +# +# Copyright (c) 2017 Intel Corporation +# SPDX-License-Identifier: BSD-2-Clause +# + +import numbers +import copy +import types as pytypes +from operator import add +import operator + +import numpy as np + +import numba.parfors.parfor +from numba.core import types, ir, rewrites, config, ir_utils +from numba.core.typing.templates import infer_global, AbstractTemplate +from numba.core.typing import signature +from numba.core import utils, typing +from numba.core.ir_utils import (get_call_table, mk_unique_var, + compile_to_numba_ir, replace_arg_nodes, guard, + find_callname, require, find_const, GuardException) +from numba.core.errors import NumbaValueError +from numba.core.utils import OPERATORS_TO_BUILTINS +from numba.np import numpy_support + + +def _compute_last_ind(dim_size, index_const): + if index_const > 0: + return dim_size - index_const + else: + return dim_size + +class StencilPass(object): + def __init__(self, func_ir, typemap, calltypes, array_analysis, typingctx, + targetctx, flags): + self.func_ir = func_ir + self.typemap = typemap + self.calltypes = calltypes + self.array_analysis = array_analysis + self.typingctx = typingctx + self.targetctx = targetctx + self.flags = flags + + def run(self): + """ Finds all calls to StencilFuncs in the IR and converts them to parfor. + """ + from numba.stencils.stencil import StencilFunc + + # Get all the calls in the function IR. + call_table, _ = get_call_table(self.func_ir.blocks) + stencil_calls = [] + stencil_dict = {} + for call_varname, call_list in call_table.items(): + for one_call in call_list: + if isinstance(one_call, StencilFunc): + # Remember all calls to StencilFuncs. + stencil_calls.append(call_varname) + stencil_dict[call_varname] = one_call + if not stencil_calls: + return # return early if no stencil calls found + + # find and transform stencil calls + for label, block in self.func_ir.blocks.items(): + for i, stmt in reversed(list(enumerate(block.body))): + # Found a call to a StencilFunc. + if (isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == 'call' + and stmt.value.func.name in stencil_calls): + kws = dict(stmt.value.kws) + # Create dictionary of input argument number to + # the argument itself. + input_dict = {i: stmt.value.args[i] for i in + range(len(stmt.value.args))} + in_args = stmt.value.args + arg_typemap = tuple(self.typemap[i.name] for i in in_args) + for arg_type in arg_typemap: + if isinstance(arg_type, types.BaseTuple): + raise NumbaValueError("Tuple parameters not " \ + "supported for stencil " \ + "kernels in parallel=True " \ + "mode.") + + out_arr = kws.get('out') + + # Get the StencilFunc object corresponding to this call. + sf = stencil_dict[stmt.value.func.name] + stencil_ir, rt, arg_to_arr_dict = get_stencil_ir(sf, + self.typingctx, arg_typemap, + block.scope, block.loc, input_dict, + self.typemap, self.calltypes) + index_offsets = sf.options.get('index_offsets', None) + gen_nodes = self._mk_stencil_parfor(label, in_args, out_arr, + stencil_ir, index_offsets, stmt.target, rt, sf, + arg_to_arr_dict) + block.body = block.body[:i] + gen_nodes + block.body[i+1:] + # Found a call to a stencil via numba.stencil(). + elif (isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == 'call' + and guard(find_callname, self.func_ir, stmt.value) + == ('stencil', 'numba')): + # remove dummy stencil() call + stmt.value = ir.Const(0, stmt.loc) + + def replace_return_with_setitem(self, blocks, exit_value_var, + parfor_body_exit_label): + """ + Find return statements in the IR and replace them with a SetItem + call of the value "returned" by the kernel into the result array. + Returns the block labels that contained return statements. + """ + for label, block in blocks.items(): + scope = block.scope + loc = block.loc + new_body = [] + for stmt in block.body: + if isinstance(stmt, ir.Return): + # previous stmt should have been a cast + prev_stmt = new_body.pop() + assert (isinstance(prev_stmt, ir.Assign) + and isinstance(prev_stmt.value, ir.Expr) + and prev_stmt.value.op == 'cast') + + new_body.append(ir.Assign(prev_stmt.value.value, exit_value_var, loc)) + new_body.append(ir.Jump(parfor_body_exit_label, loc)) + else: + new_body.append(stmt) + block.body = new_body + + def _mk_stencil_parfor(self, label, in_args, out_arr, stencil_ir, + index_offsets, target, return_type, stencil_func, + arg_to_arr_dict): + """ Converts a set of stencil kernel blocks to a parfor. + """ + gen_nodes = [] + stencil_blocks = stencil_ir.blocks + + if config.DEBUG_ARRAY_OPT >= 1: + print("_mk_stencil_parfor", label, in_args, out_arr, index_offsets, + return_type, stencil_func, stencil_blocks) + ir_utils.dump_blocks(stencil_blocks) + + in_arr = in_args[0] + # run copy propagate to replace in_args copies (e.g. a = A) + in_arr_typ = self.typemap[in_arr.name] + in_cps, out_cps = ir_utils.copy_propagate(stencil_blocks, self.typemap) + name_var_table = ir_utils.get_name_var_table(stencil_blocks) + + ir_utils.apply_copy_propagate( + stencil_blocks, + in_cps, + name_var_table, + self.typemap, + self.calltypes) + if config.DEBUG_ARRAY_OPT >= 1: + print("stencil_blocks after copy_propagate") + ir_utils.dump_blocks(stencil_blocks) + ir_utils.remove_dead(stencil_blocks, self.func_ir.arg_names, stencil_ir, + self.typemap) + if config.DEBUG_ARRAY_OPT >= 1: + print("stencil_blocks after removing dead code") + ir_utils.dump_blocks(stencil_blocks) + + # create parfor vars + ndims = self.typemap[in_arr.name].ndim + scope = in_arr.scope + loc = in_arr.loc + parfor_vars = [] + for i in range(ndims): + parfor_var = ir.Var(scope, mk_unique_var( + "$parfor_index_var"), loc) + self.typemap[parfor_var.name] = types.intp + parfor_vars.append(parfor_var) + + start_lengths, end_lengths = self._replace_stencil_accesses( + stencil_ir, parfor_vars, in_args, index_offsets, stencil_func, + arg_to_arr_dict) + + if config.DEBUG_ARRAY_OPT >= 1: + print("stencil_blocks after replace stencil accesses") + print("start_lengths:", start_lengths) + print("end_lengths:", end_lengths) + ir_utils.dump_blocks(stencil_blocks) + + # create parfor loop nests + loopnests = [] + equiv_set = self.array_analysis.get_equiv_set(label) + in_arr_dim_sizes = equiv_set.get_shape(in_arr) + + assert ndims == len(in_arr_dim_sizes) + start_inds = [] + last_inds = [] + for i in range(ndims): + last_ind = self._get_stencil_last_ind(in_arr_dim_sizes[i], + end_lengths[i], gen_nodes, scope, loc) + start_ind = self._get_stencil_start_ind( + start_lengths[i], gen_nodes, scope, loc) + start_inds.append(start_ind) + last_inds.append(last_ind) + # start from stencil size to avoid invalid array access + loopnests.append(numba.parfors.parfor.LoopNest(parfor_vars[i], + start_ind, last_ind, 1)) + + # We have to guarantee that the exit block has maximum label and that + # there's only one exit block for the parfor body. + # So, all return statements will change to jump to the parfor exit block. + parfor_body_exit_label = max(stencil_blocks.keys()) + 1 + stencil_blocks[parfor_body_exit_label] = ir.Block(scope, loc) + exit_value_var = ir.Var(scope, mk_unique_var("$parfor_exit_value"), loc) + self.typemap[exit_value_var.name] = return_type.dtype + + # create parfor index var + for_replacing_ret = [] + if ndims == 1: + parfor_ind_var = parfor_vars[0] + else: + parfor_ind_var = ir.Var(scope, mk_unique_var( + "$parfor_index_tuple_var"), loc) + self.typemap[parfor_ind_var.name] = types.containers.UniTuple( + types.intp, ndims) + tuple_call = ir.Expr.build_tuple(parfor_vars, loc) + tuple_assign = ir.Assign(tuple_call, parfor_ind_var, loc) + for_replacing_ret.append(tuple_assign) + + if config.DEBUG_ARRAY_OPT >= 1: + print("stencil_blocks after creating parfor index var") + ir_utils.dump_blocks(stencil_blocks) + + # empty init block + init_block = ir.Block(scope, loc) + if out_arr is None: + in_arr_typ = self.typemap[in_arr.name] + + shape_name = ir_utils.mk_unique_var("in_arr_shape") + shape_var = ir.Var(scope, shape_name, loc) + shape_getattr = ir.Expr.getattr(in_arr, "shape", loc) + self.typemap[shape_name] = types.containers.UniTuple(types.intp, + in_arr_typ.ndim) + init_block.body.extend([ir.Assign(shape_getattr, shape_var, loc)]) + + zero_name = ir_utils.mk_unique_var("zero_val") + zero_var = ir.Var(scope, zero_name, loc) + if "cval" in stencil_func.options: + cval = stencil_func.options["cval"] + # TODO: Loosen this restriction to adhere to casting rules. + cval_ty = typing.typeof.typeof(cval) + if not self.typingctx.can_convert(cval_ty, return_type.dtype): + raise NumbaValueError("cval type does not match stencil " \ + "return type.") + + temp2 = return_type.dtype(cval) + else: + temp2 = return_type.dtype(0) + full_const = ir.Const(temp2, loc) + self.typemap[zero_name] = return_type.dtype + init_block.body.extend([ir.Assign(full_const, zero_var, loc)]) + + so_name = ir_utils.mk_unique_var("stencil_output") + out_arr = ir.Var(scope, so_name, loc) + self.typemap[out_arr.name] = numba.core.types.npytypes.Array( + return_type.dtype, + in_arr_typ.ndim, + in_arr_typ.layout) + dtype_g_np_var = ir.Var(scope, mk_unique_var("$np_g_var"), loc) + self.typemap[dtype_g_np_var.name] = types.misc.Module(np) + dtype_g_np = ir.Global('np', np, loc) + dtype_g_np_assign = ir.Assign(dtype_g_np, dtype_g_np_var, loc) + init_block.body.append(dtype_g_np_assign) + + return_type_name = numpy_support.as_dtype( + return_type.dtype).type.__name__ + if return_type_name == 'bool': + return_type_name = 'bool_' + dtype_np_attr_call = ir.Expr.getattr(dtype_g_np_var, return_type_name, loc) + dtype_attr_var = ir.Var(scope, mk_unique_var("$np_attr_attr"), loc) + self.typemap[dtype_attr_var.name] = types.functions.NumberClass(return_type.dtype) + dtype_attr_assign = ir.Assign(dtype_np_attr_call, dtype_attr_var, loc) + init_block.body.append(dtype_attr_assign) + + stmts = ir_utils.gen_np_call("empty", + np.empty, + out_arr, + [shape_var, dtype_attr_var], + self.typingctx, + self.typemap, + self.calltypes) + # ------------------ + # Generate the code to fill just the border with zero_var. + + # Generate a none var to use in slicing. + none_var = ir.Var(scope, mk_unique_var("$none_var"), loc) + none_assign = ir.Assign(ir.Const(None, loc), none_var, loc) + stmts.append(none_assign) + self.typemap[none_var.name] = types.none + # Generate a zero var to use in slicing. + zero_index_var = ir.Var(scope, mk_unique_var("$zero_index_var"), loc) + zero_index_assign = ir.Assign(ir.Const(0, loc), zero_index_var, loc) + stmts.append(zero_index_assign) + self.typemap[zero_index_var.name] = types.intp + # Generate generic ":" slice. + # ---- Generate var to hold slice func var. + slice_func_var = ir.Var(scope, mk_unique_var("$slice_func_var"), loc) + slice_fn_ty = self.typingctx.resolve_value_type(slice) + self.typemap[slice_func_var.name] = slice_fn_ty + slice_g = ir.Global('slice', slice, loc) + slice_assign = ir.Assign(slice_g, slice_func_var, loc) + stmts.append(slice_assign) + # ---- Generate call to slice func. + sig = self.typingctx.resolve_function_type(slice_fn_ty, + (types.none,) * 2, + {}) + slice_callexpr = ir.Expr.call(func=slice_func_var, + args=(none_var, none_var), + kws=(), + loc=loc) + self.calltypes[slice_callexpr] = sig + # ---- Generate slice var + slice_var = ir.Var(scope, mk_unique_var("$slice"), loc) + self.typemap[slice_var.name] = types.slice2_type + slice_assign = ir.Assign(slice_callexpr, slice_var, loc) + stmts.append(slice_assign) + + def handle_border(slice_fn_ty, + dim, + scope, + loc, + slice_func_var, + stmts, + border_inds, + border_tuple_items, + other_arg, + other_first): + # Handle the border for start or end of the index range. + # ---- Generate call to slice func. + sig = self.typingctx.resolve_function_type( + slice_fn_ty, + (types.intp,) * 2, + {}) + si = border_inds[dim] + assert(isinstance(si, (int, ir.Var))) + si_var = ir.Var(scope, mk_unique_var("$border_ind"), loc) + self.typemap[si_var.name] = types.intp + if isinstance(si, int): + si_assign = ir.Assign(ir.Const(si, loc), si_var, loc) + else: + si_assign = ir.Assign(si, si_var, loc) + stmts.append(si_assign) + + slice_callexpr = ir.Expr.call( + func=slice_func_var, + args=(other_arg, si_var) if other_first else (si_var, other_arg), + kws=(), + loc=loc) + self.calltypes[slice_callexpr] = sig + # ---- Generate slice var + border_slice_var = ir.Var(scope, mk_unique_var("$slice"), loc) + self.typemap[border_slice_var.name] = types.slice2_type + slice_assign = ir.Assign(slice_callexpr, border_slice_var, loc) + stmts.append(slice_assign) + + border_tuple_items[dim] = border_slice_var + border_ind_var = ir.Var(scope, mk_unique_var( + "$border_index_tuple_var"), loc) + self.typemap[border_ind_var.name] = types.containers.UniTuple( + types.slice2_type, ndims) + tuple_call = ir.Expr.build_tuple(border_tuple_items, loc) + tuple_assign = ir.Assign(tuple_call, border_ind_var, loc) + stmts.append(tuple_assign) + + setitem_call = ir.SetItem(out_arr, border_ind_var, zero_var, loc) + self.calltypes[setitem_call] = signature( + types.none, self.typemap[out_arr.name], + self.typemap[border_ind_var.name], + self.typemap[out_arr.name].dtype + ) + stmts.append(setitem_call) + + # For each dimension, add setitem to set border values. + for dim in range(in_arr_typ.ndim): + # First, fill all entries with ":". + start_tuple_items = [slice_var] * in_arr_typ.ndim + last_tuple_items = [slice_var] * in_arr_typ.ndim + + handle_border(slice_fn_ty, + dim, + scope, + loc, + slice_func_var, + stmts, + start_inds, + start_tuple_items, + zero_index_var, + True) + handle_border(slice_fn_ty, + dim, + scope, + loc, + slice_func_var, + stmts, + last_inds, + last_tuple_items, + in_arr_dim_sizes[dim], + False) + + # ------------------ + + equiv_set.insert_equiv(out_arr, in_arr_dim_sizes) + init_block.body.extend(stmts) + else: # out is present + if "cval" in stencil_func.options: # do out[:] = cval + cval = stencil_func.options["cval"] + # TODO: Loosen this restriction to adhere to casting rules. + cval_ty = typing.typeof.typeof(cval) + if not self.typingctx.can_convert(cval_ty, return_type.dtype): + msg = "cval type does not match stencil return type." + raise NumbaValueError(msg) + + # get slice ref + slice_var = ir.Var(scope, mk_unique_var("$py_g_var"), loc) + slice_fn_ty = self.typingctx.resolve_value_type(slice) + self.typemap[slice_var.name] = slice_fn_ty + slice_g = ir.Global('slice', slice, loc) + slice_assigned = ir.Assign(slice_g, slice_var, loc) + init_block.body.append(slice_assigned) + + sig = self.typingctx.resolve_function_type(slice_fn_ty, + (types.none,) * 2, + {}) + + callexpr = ir.Expr.call(func=slice_var, args=(), kws=(), + loc=loc) + + self.calltypes[callexpr] = sig + slice_inst_var = ir.Var(scope, mk_unique_var("$slice_inst"), + loc) + self.typemap[slice_inst_var.name] = types.slice2_type + slice_assign = ir.Assign(callexpr, slice_inst_var, loc) + init_block.body.append(slice_assign) + + # get const val for cval + cval_const_val = ir.Const(return_type.dtype(cval), loc) + cval_const_var = ir.Var(scope, mk_unique_var("$cval_const"), + loc) + self.typemap[cval_const_var.name] = return_type.dtype + cval_const_assign = ir.Assign(cval_const_val, + cval_const_var, loc) + init_block.body.append(cval_const_assign) + + # do setitem on `out` array + setitemexpr = ir.StaticSetItem(out_arr, slice(None, None), + slice_inst_var, cval_const_var, + loc) + init_block.body.append(setitemexpr) + sig = signature(types.none, self.typemap[out_arr.name], + self.typemap[slice_inst_var.name], + self.typemap[out_arr.name].dtype) + self.calltypes[setitemexpr] = sig + + + self.replace_return_with_setitem(stencil_blocks, exit_value_var, + parfor_body_exit_label) + + if config.DEBUG_ARRAY_OPT >= 1: + print("stencil_blocks after replacing return") + ir_utils.dump_blocks(stencil_blocks) + + setitem_call = ir.SetItem(out_arr, parfor_ind_var, exit_value_var, loc) + self.calltypes[setitem_call] = signature( + types.none, self.typemap[out_arr.name], + self.typemap[parfor_ind_var.name], + self.typemap[out_arr.name].dtype + ) + stencil_blocks[parfor_body_exit_label].body.extend(for_replacing_ret) + stencil_blocks[parfor_body_exit_label].body.append(setitem_call) + + # simplify CFG of parfor body (exit block could be simplified often) + # add dummy return to enable CFG + dummy_loc = ir.Loc("stencilparfor_dummy", -1) + ret_const_var = ir.Var(scope, mk_unique_var("$cval_const"), dummy_loc) + cval_const_assign = ir.Assign(ir.Const(0, loc=dummy_loc), ret_const_var, dummy_loc) + stencil_blocks[parfor_body_exit_label].body.append(cval_const_assign) + + stencil_blocks[parfor_body_exit_label].body.append( + ir.Return(ret_const_var, dummy_loc), + ) + stencil_blocks = ir_utils.simplify_CFG(stencil_blocks) + stencil_blocks[max(stencil_blocks.keys())].body.pop() + + if config.DEBUG_ARRAY_OPT >= 1: + print("stencil_blocks after adding SetItem") + ir_utils.dump_blocks(stencil_blocks) + + pattern = ('stencil', [start_lengths, end_lengths]) + parfor = numba.parfors.parfor.Parfor(loopnests, init_block, stencil_blocks, + loc, parfor_ind_var, equiv_set, pattern, self.flags) + gen_nodes.append(parfor) + gen_nodes.append(ir.Assign(out_arr, target, loc)) + return gen_nodes + + def _get_stencil_last_ind(self, dim_size, end_length, gen_nodes, scope, + loc): + last_ind = dim_size + if end_length != 0: + # set last index to size minus stencil size to avoid invalid + # memory access + index_const = ir.Var(scope, mk_unique_var("stencil_const_var"), + loc) + self.typemap[index_const.name] = types.intp + if isinstance(end_length, numbers.Number): + const_assign = ir.Assign(ir.Const(end_length, loc), + index_const, loc) + else: + const_assign = ir.Assign(end_length, index_const, loc) + + gen_nodes.append(const_assign) + last_ind = ir.Var(scope, mk_unique_var("last_ind"), loc) + self.typemap[last_ind.name] = types.intp + + g_var = ir.Var(scope, mk_unique_var("compute_last_ind_var"), loc) + check_func = numba.njit(_compute_last_ind) + func_typ = types.functions.Dispatcher(check_func) + self.typemap[g_var.name] = func_typ + g_obj = ir.Global("_compute_last_ind", check_func, loc) + g_assign = ir.Assign(g_obj, g_var, loc) + gen_nodes.append(g_assign) + index_call = ir.Expr.call(g_var, [dim_size, index_const], (), loc) + self.calltypes[index_call] = func_typ.get_call_type( + self.typingctx, [types.intp, types.intp], {}) + index_assign = ir.Assign(index_call, last_ind, loc) + gen_nodes.append(index_assign) + + return last_ind + + def _get_stencil_start_ind(self, start_length, gen_nodes, scope, loc): + if isinstance(start_length, int): + return abs(min(start_length, 0)) + def get_start_ind(s_length): + return abs(min(s_length, 0)) + f_ir = compile_to_numba_ir(get_start_ind, {}, self.typingctx, + self.targetctx, (types.intp,), self.typemap, + self.calltypes) + assert len(f_ir.blocks) == 1 + block = f_ir.blocks.popitem()[1] + replace_arg_nodes(block, [start_length]) + gen_nodes += block.body[:-2] + ret_var = block.body[-2].value.value + return ret_var + + def _replace_stencil_accesses(self, stencil_ir, parfor_vars, in_args, + index_offsets, stencil_func, arg_to_arr_dict): + """ Convert relative indexing in the stencil kernel to standard indexing + by adding the loop index variables to the corresponding dimensions + of the array index tuples. + """ + stencil_blocks = stencil_ir.blocks + in_arr = in_args[0] + in_arg_names = [x.name for x in in_args] + + if "standard_indexing" in stencil_func.options: + for x in stencil_func.options["standard_indexing"]: + if x not in arg_to_arr_dict: + raise NumbaValueError("Standard indexing requested for " \ + "an array name not present in the " \ + "stencil kernel definition.") + standard_indexed = [arg_to_arr_dict[x] for x in + stencil_func.options["standard_indexing"]] + else: + standard_indexed = [] + + if in_arr.name in standard_indexed: + raise NumbaValueError("The first argument to a stencil kernel " \ + "must use relative indexing, not standard " \ + "indexing.") + + ndims = self.typemap[in_arr.name].ndim + scope = in_arr.scope + loc = in_arr.loc + # replace access indices, find access lengths in each dimension + need_to_calc_kernel = stencil_func.neighborhood is None + + # If we need to infer the kernel size then initialize the minimum and + # maximum seen indices for each dimension to 0. If we already have + # the neighborhood calculated then just convert from neighborhood format + # to the separate start and end lengths format used here. + if need_to_calc_kernel: + start_lengths = ndims*[0] + end_lengths = ndims*[0] + else: + start_lengths = [x[0] for x in stencil_func.neighborhood] + end_lengths = [x[1] for x in stencil_func.neighborhood] + + # Get all the tuples defined in the stencil blocks. + tuple_table = ir_utils.get_tuple_table(stencil_blocks) + + found_relative_index = False + + # For all blocks in the stencil kernel... + for label, block in stencil_blocks.items(): + new_body = [] + # For all statements in those blocks... + for stmt in block.body: + # Reject assignments to input arrays. + if ((isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op in ['setitem', 'static_setitem'] + and stmt.value.value.name in in_arg_names) or + ((isinstance(stmt, ir.SetItem) or + isinstance(stmt, ir.StaticSetItem)) + and stmt.target.name in in_arg_names)): + raise NumbaValueError("Assignments to arrays passed to " \ + "stencil kernels is not allowed.") + # We found a getitem for some array. If that array is an input + # array and isn't in the list of standard indexed arrays then + # update min and max seen indices if we are inferring the + # kernel size and create a new tuple where the relative offsets + # are added to loop index vars to get standard indexing. + if (isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op in ['static_getitem', 'getitem'] + and stmt.value.value.name in in_arg_names + and stmt.value.value.name not in standard_indexed): + index_list = stmt.value.index + # handle 1D case + if ndims == 1: + index_list = [index_list] + else: + if hasattr(index_list, 'name') and index_list.name in tuple_table: + index_list = tuple_table[index_list.name] + # indices can be inferred as constant in simple expressions + # like -c where c is constant + # handled here since this is a common stencil index pattern + stencil_ir._definitions = ir_utils.build_definitions(stencil_blocks) + index_list = [_get_const_index_expr( + stencil_ir, self.func_ir, v) for v in index_list] + if index_offsets: + index_list = self._add_index_offsets(index_list, + list(index_offsets), new_body, scope, loc) + + # update min and max indices + if need_to_calc_kernel: + # all indices should be integer to be able to calculate + # neighborhood automatically + if (isinstance(index_list, ir.Var) or + any([not isinstance(v, int) for v in index_list])): + raise NumbaValueError("Variable stencil index " \ + "only possible with known " \ + "neighborhood") + start_lengths = list(map(min, start_lengths, + index_list)) + end_lengths = list(map(max, end_lengths, index_list)) + found_relative_index = True + + # update access indices + index_vars = self._add_index_offsets(parfor_vars, + list(index_list), new_body, scope, loc) + + # new access index tuple + if ndims == 1: + ind_var = index_vars[0] + else: + ind_var = ir.Var(scope, mk_unique_var( + "$parfor_index_ind_var"), loc) + self.typemap[ind_var.name] = types.containers.UniTuple( + types.intp, ndims) + tuple_call = ir.Expr.build_tuple(index_vars, loc) + tuple_assign = ir.Assign(tuple_call, ind_var, loc) + new_body.append(tuple_assign) + + # getitem return type is scalar if all indices are integer + if all([self.typemap[v.name] == types.intp + for v in index_vars]): + getitem_return_typ = self.typemap[ + stmt.value.value.name].dtype + else: + # getitem returns an array + getitem_return_typ = self.typemap[stmt.value.value.name] + # new getitem with the new index var + getitem_call = ir.Expr.getitem(stmt.value.value, ind_var, + loc) + self.calltypes[getitem_call] = signature( + getitem_return_typ, + self.typemap[stmt.value.value.name], + self.typemap[ind_var.name]) + stmt.value = getitem_call + + new_body.append(stmt) + block.body = new_body + if need_to_calc_kernel and not found_relative_index: + raise NumbaValueError("Stencil kernel with no accesses to " \ + "relatively indexed arrays.") + + return start_lengths, end_lengths + + def _add_index_offsets(self, index_list, index_offsets, new_body, + scope, loc): + """ Does the actual work of adding loop index variables to the + relative index constants or variables. + """ + assert len(index_list) == len(index_offsets) + + # shortcut if all values are integer + if all([isinstance(v, int) for v in index_list+index_offsets]): + # add offsets in all dimensions + return list(map(add, index_list, index_offsets)) + + out_nodes = [] + index_vars = [] + for i in range(len(index_list)): + # new_index = old_index + offset + old_index_var = index_list[i] + if isinstance(old_index_var, int): + old_index_var = ir.Var(scope, + mk_unique_var("old_index_var"), loc) + self.typemap[old_index_var.name] = types.intp + const_assign = ir.Assign(ir.Const(index_list[i], loc), + old_index_var, loc) + out_nodes.append(const_assign) + + offset_var = index_offsets[i] + if isinstance(offset_var, int): + offset_var = ir.Var(scope, + mk_unique_var("offset_var"), loc) + self.typemap[offset_var.name] = types.intp + const_assign = ir.Assign(ir.Const(index_offsets[i], loc), + offset_var, loc) + out_nodes.append(const_assign) + + if (isinstance(old_index_var, slice) + or isinstance(self.typemap[old_index_var.name], + types.misc.SliceType)): + # only one arg can be slice + assert self.typemap[offset_var.name] == types.intp + index_var = self._add_offset_to_slice(old_index_var, offset_var, + out_nodes, scope, loc) + index_vars.append(index_var) + continue + + if (isinstance(offset_var, slice) + or isinstance(self.typemap[offset_var.name], + types.misc.SliceType)): + # only one arg can be slice + assert self.typemap[old_index_var.name] == types.intp + index_var = self._add_offset_to_slice(offset_var, old_index_var, + out_nodes, scope, loc) + index_vars.append(index_var) + continue + + index_var = ir.Var(scope, + mk_unique_var("offset_stencil_index"), loc) + self.typemap[index_var.name] = types.intp + index_call = ir.Expr.binop(operator.add, old_index_var, + offset_var, loc) + self.calltypes[index_call] = self.typingctx.resolve_function_type( + operator.add, (types.intp, types.intp), {}) + index_assign = ir.Assign(index_call, index_var, loc) + out_nodes.append(index_assign) + index_vars.append(index_var) + + new_body.extend(out_nodes) + return index_vars + + def _add_offset_to_slice(self, slice_var, offset_var, out_nodes, scope, + loc): + if isinstance(slice_var, slice): + f_text = """def f(offset): + return slice({} + offset, {} + offset) + """.format(slice_var.start, slice_var.stop) + loc = {} + exec(f_text, {}, loc) + f = loc['f'] + args = [offset_var] + arg_typs = (types.intp,) + else: + def f(old_slice, offset): + return slice(old_slice.start + offset, old_slice.stop + offset) + args = [slice_var, offset_var] + slice_type = self.typemap[slice_var.name] + arg_typs = (slice_type, types.intp,) + _globals = self.func_ir.func_id.func.__globals__ + f_ir = compile_to_numba_ir(f, _globals, self.typingctx, self.targetctx, + arg_typs, self.typemap, self.calltypes) + _, block = f_ir.blocks.popitem() + replace_arg_nodes(block, args) + new_index = block.body[-2].value.value + out_nodes.extend(block.body[:-2]) # ignore return nodes + return new_index + +def get_stencil_ir(sf, typingctx, args, scope, loc, input_dict, typemap, + calltypes): + """get typed IR from stencil bytecode + """ + from numba.core.cpu import CPUContext + from numba.core.registry import cpu_target + from numba.core.annotations import type_annotations + from numba.core.typed_passes import type_inference_stage + + # get untyped IR + stencil_func_ir = sf.kernel_ir.copy() + # copy the IR nodes to avoid changing IR in the StencilFunc object + stencil_blocks = copy.deepcopy(stencil_func_ir.blocks) + stencil_func_ir.blocks = stencil_blocks + + name_var_table = ir_utils.get_name_var_table(stencil_func_ir.blocks) + if "out" in name_var_table: + raise NumbaValueError("Cannot use the reserved word 'out' in stencil " \ + "kernels.") + + # get typed IR with a dummy pipeline (similar to test_parfors.py) + from numba.core.registry import cpu_target + targetctx = cpu_target.target_context + + tp = DummyPipeline(typingctx, targetctx, args, stencil_func_ir) + + rewrites.rewrite_registry.apply('before-inference', tp.state) + + tp.state.typemap, tp.state.return_type, tp.state.calltypes, _ = type_inference_stage( + tp.state.typingctx, tp.state.targetctx, tp.state.func_ir, + tp.state.args, None) + + type_annotations.TypeAnnotation( + func_ir=tp.state.func_ir, + typemap=tp.state.typemap, + calltypes=tp.state.calltypes, + lifted=(), + lifted_from=None, + args=tp.state.args, + return_type=tp.state.return_type, + html_output=config.HTML) + + # make block labels unique + stencil_blocks = ir_utils.add_offset_to_labels(stencil_blocks, + ir_utils.next_label()) + min_label = min(stencil_blocks.keys()) + max_label = max(stencil_blocks.keys()) + ir_utils._the_max_label.update(max_label) + + if config.DEBUG_ARRAY_OPT >= 1: + print("Initial stencil_blocks") + ir_utils.dump_blocks(stencil_blocks) + + # rename variables, + var_dict = {} + for v, typ in tp.state.typemap.items(): + new_var = ir.Var(scope, mk_unique_var(v), loc) + var_dict[v] = new_var + typemap[new_var.name] = typ # add new var type for overall function + ir_utils.replace_vars(stencil_blocks, var_dict) + + if config.DEBUG_ARRAY_OPT >= 1: + print("After replace_vars") + ir_utils.dump_blocks(stencil_blocks) + + # add call types to overall function + for call, call_typ in tp.state.calltypes.items(): + calltypes[call] = call_typ + + arg_to_arr_dict = {} + # replace arg with arr + for block in stencil_blocks.values(): + for stmt in block.body: + if isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Arg): + if config.DEBUG_ARRAY_OPT >= 1: + print("input_dict", input_dict, stmt.value.index, + stmt.value.name, stmt.value.index in input_dict) + arg_to_arr_dict[stmt.value.name] = input_dict[stmt.value.index].name + stmt.value = input_dict[stmt.value.index] + + if config.DEBUG_ARRAY_OPT >= 1: + print("arg_to_arr_dict", arg_to_arr_dict) + print("After replace arg with arr") + ir_utils.dump_blocks(stencil_blocks) + + ir_utils.remove_dels(stencil_blocks) + stencil_func_ir.blocks = stencil_blocks + return stencil_func_ir, sf.get_return_type(args)[0], arg_to_arr_dict + +class DummyPipeline(object): + def __init__(self, typingctx, targetctx, args, f_ir): + from numba.core.compiler import StateDict + self.state = StateDict() + self.state.typingctx = typingctx + self.state.targetctx = targetctx + self.state.args = args + self.state.func_ir = f_ir + self.state.typemap = None + self.state.return_type = None + self.state.calltypes = None + + +def _get_const_index_expr(stencil_ir, func_ir, index_var): + """ + infer index_var as constant if it is of a expression form like c-1 where c + is a constant in the outer function. + index_var is assumed to be inside stencil kernel + """ + const_val = guard( + _get_const_index_expr_inner, stencil_ir, func_ir, index_var) + if const_val is not None: + return const_val + return index_var + +def _get_const_index_expr_inner(stencil_ir, func_ir, index_var): + """inner constant inference function that calls constant, unary and binary + cases. + """ + require(isinstance(index_var, ir.Var)) + # case where the index is a const itself in outer function + var_const = guard(_get_const_two_irs, stencil_ir, func_ir, index_var) + if var_const is not None: + return var_const + # get index definition + index_def = ir_utils.get_definition(stencil_ir, index_var) + # match inner_var = unary(index_var) + var_const = guard( + _get_const_unary_expr, stencil_ir, func_ir, index_def) + if var_const is not None: + return var_const + # match inner_var = arg1 + arg2 + var_const = guard( + _get_const_binary_expr, stencil_ir, func_ir, index_def) + if var_const is not None: + return var_const + raise GuardException + +def _get_const_two_irs(ir1, ir2, var): + """get constant in either of two IRs if available + otherwise, throw GuardException + """ + var_const = guard(find_const, ir1, var) + if var_const is not None: + return var_const + var_const = guard(find_const, ir2, var) + if var_const is not None: + return var_const + raise GuardException + +def _get_const_unary_expr(stencil_ir, func_ir, index_def): + """evaluate constant unary expr if possible + otherwise, raise GuardException + """ + require(isinstance(index_def, ir.Expr) and index_def.op == 'unary') + inner_var = index_def.value + # return -c as constant + const_val = _get_const_index_expr_inner(stencil_ir, func_ir, inner_var) + op = OPERATORS_TO_BUILTINS[index_def.fn] + return eval("{}{}".format(op, const_val)) + +def _get_const_binary_expr(stencil_ir, func_ir, index_def): + """evaluate constant binary expr if possible + otherwise, raise GuardException + """ + require(isinstance(index_def, ir.Expr) and index_def.op == 'binop') + arg1 = _get_const_index_expr_inner(stencil_ir, func_ir, index_def.lhs) + arg2 = _get_const_index_expr_inner(stencil_ir, func_ir, index_def.rhs) + op = OPERATORS_TO_BUILTINS[index_def.fn] + return eval("{}{}{}".format(arg1, op, arg2)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/testing/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4eb89a92fcb80765a6f54b11bebde867ced37aa4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/__init__.py @@ -0,0 +1,61 @@ +import os +import sys +import functools +import unittest +import traceback +from fnmatch import fnmatch +from os.path import join, isfile, relpath, normpath, splitext + +from .main import NumbaTestProgram, SerialSuite, make_tag_decorator +from numba.core import config + + +def load_testsuite(loader, dir): + """Find tests in 'dir'.""" + try: + suite = unittest.TestSuite() + files = [] + for f in os.listdir(dir): + path = join(dir, f) + if isfile(path) and fnmatch(f, 'test_*.py'): + files.append(f) + elif isfile(join(path, '__init__.py')): + suite.addTests(loader.discover(path)) + for f in files: + # turn 'f' into a filename relative to the toplevel dir... + f = relpath(join(dir, f), loader._top_level_dir) + # ...and translate it to a module name. + f = splitext(normpath(f.replace(os.path.sep, '.')))[0] + suite.addTests(loader.loadTestsFromName(f)) + return suite + except Exception: + traceback.print_exc(file=sys.stderr) + sys.exit(-1) + + +def run_tests(argv=None, defaultTest=None, topleveldir=None, + xmloutput=None, verbosity=1, nomultiproc=False): + """ + args + ---- + - xmloutput [str or None] + Path of XML output directory (optional) + - verbosity [int] + Verbosity level of tests output + + Returns the TestResult object after running the test *suite*. + """ + + if xmloutput is not None: + import xmlrunner + runner = xmlrunner.XMLTestRunner(output=xmloutput) + else: + runner = None + prog = NumbaTestProgram(argv=argv, + module=None, + defaultTest=defaultTest, + topleveldir=topleveldir, + testRunner=runner, exit=False, + verbosity=verbosity, + nomultiproc=nomultiproc) + return prog.result diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/testing/__main__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..964b0ce910f027dfb48790b49e2360dcd806ad7c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/__main__.py @@ -0,0 +1,4 @@ +import sys +from numba.testing import run_tests + +sys.exit(0 if run_tests(sys.argv).wasSuccessful() else 1) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/testing/_runtests.py b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/_runtests.py new file mode 100644 index 0000000000000000000000000000000000000000..7df2bd7435897ec837b188eb857302d47ea6942b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/_runtests.py @@ -0,0 +1,114 @@ +import json +import re +import logging + + +def _main(argv, **kwds): + from numba.testing import run_tests + # This helper function assumes the first element of argv + # is the name of the calling program. + # The 'main' API function is invoked in-process, and thus + # will synthesize that name. + + if '--log' in argv: + logging.basicConfig(level=logging.DEBUG) + argv.remove('--log') + + if '--failed-first' in argv: + # Failed first + argv.remove('--failed-first') + return _FailedFirstRunner().main(argv, kwds) + elif '--last-failed' in argv: + argv.remove('--last-failed') + return _FailedFirstRunner(last_failed=True).main(argv, kwds) + else: + return run_tests(argv, defaultTest='numba.tests', + **kwds).wasSuccessful() + + +def main(*argv, **kwds): + """keyword arguments are accepted for backward compatibility only. + See `numba.testing.run_tests()` documentation for details.""" + return _main(['
'] + list(argv), **kwds) + + +class _FailedFirstRunner(object): + """ + Test Runner to handle the failed-first (--failed-first) option. + """ + cache_filename = '.runtests_lastfailed' + + def __init__(self, last_failed=False): + self.last_failed = last_failed + + def main(self, argv, kwds): + from numba.testing import run_tests + prog = argv[0] + argv = argv[1:] + flags = [a for a in argv if a.startswith('-')] + + all_tests, failed_tests = self.find_last_failed(argv) + # Prepare tests to run + if failed_tests: + ft = "There were {} previously failed tests" + print(ft.format(len(failed_tests))) + remaing_tests = [t for t in all_tests + if t not in failed_tests] + if self.last_failed: + tests = list(failed_tests) + else: + tests = failed_tests + remaing_tests + else: + if self.last_failed: + tests = [] + else: + tests = list(all_tests) + + if not tests: + print("No tests to run") + return True + # Run the testsuite + print("Running {} tests".format(len(tests))) + print('Flags', flags) + result = run_tests([prog] + flags + tests, **kwds) + # Update failed tests records only if we have run the all the tests + # last failed. + if len(tests) == result.testsRun: + self.save_failed_tests(result, all_tests) + return result.wasSuccessful() + + def save_failed_tests(self, result, all_tests): + print("Saving failed tests to {}".format(self.cache_filename)) + cache = [] + # Find failed tests + failed = set() + for case in result.errors + result.failures: + failed.add(case[0].id()) + # Build cache + for t in all_tests: + if t in failed: + cache.append(t) + # Write cache + with open(self.cache_filename, 'w') as fout: + json.dump(cache, fout) + + def find_last_failed(self, argv): + from numba.tests.support import captured_output + + # Find all tests + listargv = ['-l'] + [a for a in argv if not a.startswith('-')] + with captured_output("stdout") as stream: + main(*listargv) + + pat = re.compile(r"^(\w+\.)+\w+$") + lines = stream.getvalue().splitlines() + all_tests = [x for x in lines if pat.match(x) is not None] + + try: + fobj = open(self.cache_filename) + except OSError: + failed_tests = [] + else: + with fobj as fin: + failed_tests = json.load(fin) + return all_tests, failed_tests diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/testing/loader.py b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/loader.py new file mode 100644 index 0000000000000000000000000000000000000000..66ba417d62b2bf7e7789c8a54eba972c8d7b7624 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/loader.py @@ -0,0 +1,26 @@ +from unittest import loader, case +from os.path import isdir, isfile, join, dirname, basename + + +class TestLoader(loader.TestLoader): + + def __init__(self, topleveldir=None): + super(TestLoader, self).__init__() + self._top_level_dir = topleveldir or dirname(dirname(dirname(__file__))) + + def _find_tests(self, start_dir, pattern, namespace=False): + # Upstream doesn't look for 'load_tests' in start_dir. + + if isdir(start_dir) and not namespace and isfile(join(start_dir, '__init__.py')): + name = self._get_name_from_path(start_dir) + package = self._get_module_from_name(name) + load_tests = getattr(package, 'load_tests', None) + tests = self.loadTestsFromModule(package) + if load_tests is not None: + try: + yield load_tests(self, tests, pattern) + except Exception as e: + yield loader._make_failed_load_tests(package.__name__, e, self.suiteClass) + else: + for t in super(TestLoader, self)._find_tests(start_dir, pattern): + yield t diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/testing/main.py b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/main.py new file mode 100644 index 0000000000000000000000000000000000000000..6a7a2e01a70818d6c53713efd2def8461ec987ad --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/main.py @@ -0,0 +1,830 @@ +import collections +import contextlib +import cProfile +import inspect +import gc +import multiprocessing +import os +import random +import sys +import time +import unittest +import warnings +import zlib + +from functools import lru_cache +from io import StringIO +from unittest import result, runner, signals, suite, loader, case + +from .loader import TestLoader +from numba.core import config + +try: + from multiprocessing import TimeoutError +except ImportError: + from Queue import Empty as TimeoutError + + +def make_tag_decorator(known_tags): + """ + Create a decorator allowing tests to be tagged with the *known_tags*. + """ + + def tag(*tags): + """ + Tag a test method with the given tags. + Can be used in conjunction with the --tags command-line argument + for runtests.py. + """ + for t in tags: + if t not in known_tags: + raise ValueError("unknown tag: %r" % (t,)) + + def decorate(func): + if (not callable(func) or isinstance(func, type) + or not func.__name__.startswith('test_')): + raise TypeError("@tag(...) should be used on test methods") + try: + s = func.tags + except AttributeError: + s = func.tags = set() + s.update(tags) + return func + return decorate + + return tag + + +# Chances are the next queried class is the same as the previous, locally 128 +# entries seems to be fastest. +# Current number of test classes can be found with: +# $ ./runtests.py -l|sed -e 's/\(.*\)\..*/\1/'|grep ^numba|sort|uniq|wc -l +# as of writing it's 658. +@lru_cache(maxsize=128) +def _get_mtime(cls): + """ + Gets the mtime of the file in which a test class is defined. + """ + return str(os.path.getmtime(inspect.getfile(cls))) + + +def cuda_sensitive_mtime(x): + """ + Return a key for sorting tests bases on mtime and test name. For CUDA + tests, interleaving tests from different classes is dangerous as the CUDA + context might get reset unexpectedly between methods of a class, so for + CUDA tests the key prioritises the test module and class ahead of the + mtime. + """ + cls = x.__class__ + key = _get_mtime(cls) + str(x) + + from numba.cuda.testing import CUDATestCase + if CUDATestCase in cls.mro(): + key = "%s.%s %s" % (str(cls.__module__), str(cls.__name__), key) + + return key + + +def parse_slice(useslice): + """Parses the argument string "useslice" as a shard index and number and + returns a function that filters on those arguments. i.e. input + useslice="1:3" leads to output something like `lambda x: zlib.crc32(x) % 3 + == 1`. + """ + if callable(useslice): + return useslice + if not useslice: + return lambda x: True + try: + (index, count) = useslice.split(":") + index = int(index) + count = int(count) + except Exception: + msg = ( + "Expected arguments shard index and count to follow " + "option `-j i:t`, where i is the shard number and t " + "is the total number of shards, found '%s'" % useslice) + raise ValueError(msg) + if count == 0: + return lambda x: True + elif count < 0 or index < 0 or index >= count: + raise ValueError("Sharding out of range") + else: + def decide(test): + func = getattr(test, test._testMethodName) + if "always_test" in getattr(func, 'tags', {}): + return True + return abs(zlib.crc32(test.id().encode('utf-8'))) % count == index + return decide + + +class TestLister(object): + """Simply list available tests rather than running them.""" + def __init__(self, useslice): + self.useslice = parse_slice(useslice) + + def run(self, test): + result = runner.TextTestResult(sys.stderr, descriptions=True, + verbosity=1) + self._test_list = _flatten_suite(test) + masked_list = list(filter(self.useslice, self._test_list)) + self._test_list.sort(key=cuda_sensitive_mtime) + for t in masked_list: + print(t.id()) + print('%d tests found. %s selected' % (len(self._test_list), + len(masked_list))) + return result + + +class SerialSuite(unittest.TestSuite): + """A simple marker to make sure tests in this suite are run serially. + + Note: As the suite is going through internals of unittest, + it may get unpacked and stuffed into a plain TestSuite. + We need to set an attribute on the TestCase objects to + remember they should not be run in parallel. + """ + + def addTest(self, test): + if not isinstance(test, unittest.TestCase): + # It's a sub-suite, recurse + for t in test: + self.addTest(t) + else: + # It's a test case, mark it serial + test._numba_parallel_test_ = False + super(SerialSuite, self).addTest(test) + + +class BasicTestRunner(runner.TextTestRunner): + def __init__(self, useslice, **kwargs): + runner.TextTestRunner.__init__(self, **kwargs) + self.useslice = parse_slice(useslice) + + def run(self, test): + run = list(filter(self.useslice, _flatten_suite(test))) + run.sort(key=cuda_sensitive_mtime) + wrapped = unittest.TestSuite(run) + return super(BasicTestRunner, self).run(wrapped) + + +# "unittest.main" is really the TestProgram class! +# (defined in a module named itself "unittest.main"...) + +class NumbaTestProgram(unittest.main): + """ + A TestProgram subclass adding the following options: + * a -R option to enable reference leak detection + * a --profile option to enable profiling of the test run + * a -m option for parallel execution + * a -l option to (only) list tests + + Currently the options are only added in 3.4+. + """ + + refleak = False + profile = False + multiprocess = False + useslice = None + list = False + tags = None + exclude_tags = None + random_select = None + random_seed = 42 + + def __init__(self, *args, **kwargs): + topleveldir = kwargs.pop('topleveldir', None) + kwargs['testLoader'] = TestLoader(topleveldir) + + # HACK to force unittest not to change warning display options + # (so that NumbaWarnings don't appear all over the place) + sys.warnoptions.append(':x') + self.nomultiproc = kwargs.pop('nomultiproc', False) + super(NumbaTestProgram, self).__init__(*args, **kwargs) + + def _getParentArgParser(self): + # NOTE: this hook only exists on Python 3.4+. The options won't be + # added in earlier versions (which use optparse - 3.3 - or getopt() + # - 2.x). + parser = super(NumbaTestProgram, self)._getParentArgParser() + if self.testRunner is None: + parser.add_argument('-R', '--refleak', dest='refleak', + action='store_true', + help='Detect reference / memory leaks') + parser.add_argument('-m', '--multiprocess', dest='multiprocess', + nargs='?', + type=int, + const=multiprocessing.cpu_count(), + help='Parallelize tests') + parser.add_argument('-l', '--list', dest='list', + action='store_true', + help='List tests without running them') + parser.add_argument('--tags', dest='tags', type=str, + help='Comma-separated list of tags to select ' + 'a subset of the test suite') + parser.add_argument('--exclude-tags', dest='exclude_tags', type=str, + help='Comma-separated list of tags to de-select ' + 'a subset of the test suite') + parser.add_argument('--random', dest='random_select', type=float, + help='Random proportion of tests to select') + parser.add_argument('--profile', dest='profile', + action='store_true', + help='Profile the test run') + parser.add_argument('-j', '--slice', dest='useslice', nargs='?', + type=str, const="None", + help='Shard the test sequence') + + def git_diff_str(x): + if x != 'ancestor': + raise ValueError("invalid option for --gitdiff") + return x + + parser.add_argument('-g', '--gitdiff', dest='gitdiff', type=git_diff_str, + default=False, nargs='?', + help=('Run tests from changes made against ' + 'origin/release0.61 as identified by `git diff`. ' + 'If set to "ancestor", the diff compares ' + 'against the common ancestor.')) + return parser + + def _handle_tags(self, argv, tagstr): + found = None + for x in argv: + if tagstr in x: + if found is None: + found = x + else: + raise ValueError("argument %s supplied repeatedly" % tagstr) + + if found is not None: + posn = argv.index(found) + try: + if found == tagstr: # --tagstr + tag_args = argv[posn + 1].strip() + argv.remove(tag_args) + else: # --tagstr= + if '=' in found: + tag_args = found.split('=')[1].strip() + else: + raise AssertionError('unreachable') + except IndexError: + # at end of arg list, raise + msg = "%s requires at least one tag to be specified" + raise ValueError(msg % tagstr) + # see if next arg is "end options" or some other flag + if tag_args.startswith('-'): + raise ValueError("tag starts with '-', probably a syntax error") + # see if tag is something like "=" which is likely a syntax + # error of form `--tags =`, note the space prior to `=`. + if '=' in tag_args: + msg = "%s argument contains '=', probably a syntax error" + raise ValueError(msg % tagstr) + attr = tagstr[2:].replace('-', '_') + setattr(self, attr, tag_args) + argv.remove(found) + + + def parseArgs(self, argv): + if '-l' in argv: + argv.remove('-l') + self.list = True + + super(NumbaTestProgram, self).parseArgs(argv) + + # If at this point self.test doesn't exist, it is because + # no test ID was given in argv. Use the default instead. + if not hasattr(self, 'test') or not self.test.countTestCases(): + self.testNames = (self.defaultTest,) + self.createTests() + + if self.tags: + tags = [s.strip() for s in self.tags.split(',')] + self.test = _choose_tagged_tests(self.test, tags, mode='include') + + if self.exclude_tags: + tags = [s.strip() for s in self.exclude_tags.split(',')] + self.test = _choose_tagged_tests(self.test, tags, mode='exclude') + + if self.random_select: + self.test = _choose_random_tests(self.test, self.random_select, + self.random_seed) + + if self.gitdiff is not False: + self.test = _choose_gitdiff_tests( + self.test, + use_common_ancestor=(self.gitdiff == 'ancestor'), + ) + + if self.verbosity <= 0: + # We aren't interested in informational messages / warnings when + # running with '-q'. + self.buffer = True + + def _do_discovery(self, argv, Loader=None): + # Disable unittest's implicit test discovery when parsing + # CLI arguments, as it can select other tests than Numba's + # (e.g. some test_xxx module that may happen to be directly + # reachable from sys.path) + return + + def runTests(self): + if self.refleak: + self.testRunner = RefleakTestRunner + + if not hasattr(sys, "gettotalrefcount"): + warnings.warn("detecting reference leaks requires a debug build " + "of Python, only memory leaks will be detected") + + elif self.list: + self.testRunner = TestLister(self.useslice) + + elif self.testRunner is None: + self.testRunner = BasicTestRunner(self.useslice, + verbosity=self.verbosity, + failfast=self.failfast, + buffer=self.buffer) + + if self.multiprocess and not self.nomultiproc: + if self.multiprocess < 1: + msg = ("Value specified for the number of processes to use in " + "running the suite must be > 0") + raise ValueError(msg) + self.testRunner = ParallelTestRunner(runner.TextTestRunner, + self.multiprocess, + self.useslice, + verbosity=self.verbosity, + failfast=self.failfast, + buffer=self.buffer) + + def run_tests_real(): + super(NumbaTestProgram, self).runTests() + + if self.profile: + filename = os.path.splitext( + os.path.basename(sys.modules['__main__'].__file__) + )[0] + '.prof' + p = cProfile.Profile(timer=time.perf_counter) # 3.3+ + p.enable() + try: + p.runcall(run_tests_real) + finally: + p.disable() + print("Writing test profile data into %r" % (filename,)) + p.dump_stats(filename) + else: + run_tests_real() + + +# These are tests which are generated and injected into the test suite, what +# gets injected depends on features of the test environment, e.g. TBB presence +# it's important for doing the CI "slice tests" that these are run at the end +# See notes in `_flatten_suite` for why. Simple substring matching is used to +# determine a match. +_GENERATED = ( + "numba.cuda.tests.cudapy.test_libdevice.TestLibdeviceCompilation", + "numba.tests.test_num_threads", + "numba.tests.test_parallel_backend", + "numba.tests.test_svml", + "numba.tests.test_ufuncs", +) + + +def _flatten_suite_inner(test): + """ + Workhorse for _flatten_suite + """ + tests = [] + if isinstance(test, (unittest.TestSuite, list, tuple)): + for x in test: + tests.extend(_flatten_suite_inner(x)) + else: + tests.append(test) + return tests + + +def _flatten_suite(test): + """ + Expand nested suite into list of test cases. + """ + tests = _flatten_suite_inner(test) + # Strip out generated tests and stick them at the end, this is to make sure + # that tests appear in a consistent order regardless of features available. + # This is so that a slice through the test suite e.g. (1::N) would likely be + # consistent up to the point of the generated tests, which rely on specific + # features. + generated = set() + for t in tests: + for g in _GENERATED: + if g in str(t): + generated.add(t) + normal = set(tests) - generated + def key(x): + return x.__module__, type(x).__name__, x._testMethodName + tests = sorted(normal, key=key) + tests.extend(sorted(list(generated), key=key)) + return tests + + +def _choose_gitdiff_tests(tests, *, use_common_ancestor=False): + try: + from git import Repo + except ImportError: + raise ValueError("gitpython needed for git functionality") + repo = Repo('.') + path = os.path.join('numba', 'tests') + if use_common_ancestor: + print(f"Git diff by common ancestor") + target = 'origin/release0.61...HEAD' + else: + target = 'origin/release0.61..HEAD' + gdiff_paths = repo.git.diff(target, path, name_only=True).split() + # normalise the paths as they are unix style from repo.git.diff + gdiff_paths = [os.path.normpath(x) for x in gdiff_paths] + selected = [] + gdiff_paths = [os.path.join(repo.working_dir, x) for x in gdiff_paths] + for test in _flatten_suite(tests): + assert isinstance(test, unittest.TestCase) + fname = inspect.getsourcefile(test.__class__) + if fname in gdiff_paths: + selected.append(test) + print("Git diff identified %s tests" % len(selected)) + return unittest.TestSuite(selected) + +def _choose_tagged_tests(tests, tags, mode='include'): + """ + Select tests that are tagged/not tagged with at least one of the given tags. + Set mode to 'include' to include the tests with tags, or 'exclude' to + exclude the tests with the tags. + """ + selected = [] + tags = set(tags) + for test in _flatten_suite(tests): + assert isinstance(test, unittest.TestCase) + func = getattr(test, test._testMethodName) + try: + # Look up the method's underlying function (Python 2) + func = func.im_func + except AttributeError: + pass + + found_tags = getattr(func, 'tags', None) + # only include the test if the tags *are* present + if mode == 'include': + if found_tags is not None and found_tags & tags: + selected.append(test) + elif mode == 'exclude': + # only include the test if the tags *are not* present + if found_tags is None or not (found_tags & tags): + selected.append(test) + else: + raise ValueError("Invalid 'mode' supplied: %s." % mode) + return unittest.TestSuite(selected) + + +def _choose_random_tests(tests, ratio, seed): + """ + Choose a given proportion of tests at random. + """ + rnd = random.Random() + rnd.seed(seed) + if isinstance(tests, unittest.TestSuite): + tests = _flatten_suite(tests) + tests = rnd.sample(tests, int(len(tests) * ratio)) + tests = sorted(tests, key=lambda case: case.id()) + return unittest.TestSuite(tests) + + +# The reference leak detection code is liberally taken and adapted from +# Python's own Lib/test/regrtest.py. + +def _refleak_cleanup(): + # Collect cyclic trash and read memory statistics immediately after. + func1 = sys.getallocatedblocks + try: + func2 = sys.gettotalrefcount + except AttributeError: + func2 = lambda: 42 + + # Flush standard output, so that buffered data is sent to the OS and + # associated Python objects are reclaimed. + for stream in (sys.stdout, sys.stderr, sys.__stdout__, sys.__stderr__): + if stream is not None: + stream.flush() + + sys._clear_type_cache() + # This also clears the various internal CPython freelists. + gc.collect() + return func1(), func2() + + +class ReferenceLeakError(RuntimeError): + pass + + +class IntPool(collections.defaultdict): + + def __missing__(self, key): + return key + + +class RefleakTestResult(runner.TextTestResult): + + warmup = 3 + repetitions = 6 + + def _huntLeaks(self, test): + self.stream.flush() + + repcount = self.repetitions + nwarmup = self.warmup + rc_deltas = [0] * (repcount - nwarmup) + alloc_deltas = [0] * (repcount - nwarmup) + # Preallocate ints likely to be stored in rc_deltas and alloc_deltas, + # to make sys.getallocatedblocks() less flaky. + _int_pool = IntPool() + for i in range(-200, 200): + _int_pool[i] + + for i in range(repcount): + # Use a pristine, silent result object to avoid recursion + res = result.TestResult() + test.run(res) + # Poorly-written tests may fail when run several times. + # In this case, abort the refleak run and report the failure. + if not res.wasSuccessful(): + self.failures.extend(res.failures) + self.errors.extend(res.errors) + raise AssertionError + del res + alloc_after, rc_after = _refleak_cleanup() + if i >= nwarmup: + rc_deltas[i - nwarmup] = _int_pool[rc_after - rc_before] + alloc_deltas[i - nwarmup] = _int_pool[alloc_after - alloc_before] + alloc_before, rc_before = alloc_after, rc_after + return rc_deltas, alloc_deltas + + def addSuccess(self, test): + try: + rc_deltas, alloc_deltas = self._huntLeaks(test) + except AssertionError: + # Test failed when repeated + assert not self.wasSuccessful() + return + + # These checkers return False on success, True on failure + def check_rc_deltas(deltas): + return any(deltas) + + def check_alloc_deltas(deltas): + # At least 1/3rd of 0s + if 3 * deltas.count(0) < len(deltas): + return True + # Nothing else than 1s, 0s and -1s + if not set(deltas) <= set((1, 0, -1)): + return True + return False + + failed = False + + for deltas, item_name, checker in [ + (rc_deltas, 'references', check_rc_deltas), + (alloc_deltas, 'memory blocks', check_alloc_deltas)]: + if checker(deltas): + msg = '%s leaked %s %s, sum=%s' % ( + test, deltas, item_name, sum(deltas)) + failed = True + try: + raise ReferenceLeakError(msg) + except Exception: + exc_info = sys.exc_info() + if self.showAll: + self.stream.write("%s = %r " % (item_name, deltas)) + self.addFailure(test, exc_info) + + if not failed: + super(RefleakTestResult, self).addSuccess(test) + + +class RefleakTestRunner(runner.TextTestRunner): + resultclass = RefleakTestResult + + +class ParallelTestResult(runner.TextTestResult): + """ + A TestResult able to inject results from other results. + """ + + def add_results(self, result): + """ + Add the results from the other *result* to this result. + """ + self.stream.write(result.stream.getvalue()) + self.stream.flush() + self.testsRun += result.testsRun + self.failures.extend(result.failures) + self.errors.extend(result.errors) + self.skipped.extend(result.skipped) + self.expectedFailures.extend(result.expectedFailures) + self.unexpectedSuccesses.extend(result.unexpectedSuccesses) + + +class _MinimalResult(object): + """ + A minimal, picklable TestResult-alike object. + """ + + __slots__ = ( + 'failures', 'errors', 'skipped', 'expectedFailures', + 'unexpectedSuccesses', 'stream', 'shouldStop', 'testsRun', + 'test_id') + + def fixup_case(self, case): + """ + Remove any unpicklable attributes from TestCase instance *case*. + """ + # Python 3.3 doesn't reset this one. + case._outcomeForDoCleanups = None + + def __init__(self, original_result, test_id=None): + for attr in self.__slots__: + setattr(self, attr, getattr(original_result, attr, None)) + for case, _ in self.expectedFailures: + self.fixup_case(case) + for case, _ in self.errors: + self.fixup_case(case) + for case, _ in self.failures: + self.fixup_case(case) + self.test_id = test_id + + +class _FakeStringIO(object): + """ + A trivial picklable StringIO-alike for Python 2. + """ + + def __init__(self, value): + self._value = value + + def getvalue(self): + return self._value + + +class _MinimalRunner(object): + """ + A minimal picklable object able to instantiate a runner in a + child process and run a test case with it. + """ + + def __init__(self, runner_cls, runner_args): + self.runner_cls = runner_cls + self.runner_args = runner_args + + # Python 2 doesn't know how to pickle instance methods, so we use __call__ + # instead. + + def __call__(self, test): + # Executed in child process + kwargs = self.runner_args + # Force recording of output in a buffer (it will be printed out + # by the parent). + kwargs['stream'] = StringIO() + runner = self.runner_cls(**kwargs) + result = runner._makeResult() + # Avoid child tracebacks when Ctrl-C is pressed. + signals.installHandler() + signals.registerResult(result) + result.failfast = runner.failfast + result.buffer = runner.buffer + with self.cleanup_object(test): + test(result) + # HACK as cStringIO.StringIO isn't picklable in 2.x + result.stream = _FakeStringIO(result.stream.getvalue()) + return _MinimalResult(result, test.id()) + + @contextlib.contextmanager + def cleanup_object(self, test): + """ + A context manager which cleans up unwanted attributes on a test case + (or any other object). + """ + vanilla_attrs = set(test.__dict__) + try: + yield test + finally: + spurious_attrs = set(test.__dict__) - vanilla_attrs + for name in spurious_attrs: + del test.__dict__[name] + + +def _split_nonparallel_tests(test, sliced): + """ + Split test suite into parallel and serial tests. + """ + ptests = [] + stests = [] + + flat = [*filter(sliced, _flatten_suite(test))] + + def is_parallelizable_test_case(test): + # Guard for the fake test case created by unittest when test + # discovery fails, as it isn't picklable (e.g. "LoadTestsFailure") + method_name = test._testMethodName + method = getattr(test, method_name) + if method.__name__ != method_name and method.__name__ == "testFailure": + return False + # Was parallel execution explicitly disabled? + return getattr(test, "_numba_parallel_test_", True) + + for t in flat: + if is_parallelizable_test_case(t): + ptests.append(t) + else: + stests.append(t) + + return ptests, stests + +# A test can't run longer than 10 minutes +_TIMEOUT = 1200 + +class ParallelTestRunner(runner.TextTestRunner): + """ + A test runner which delegates the actual running to a pool of child + processes. + """ + + resultclass = ParallelTestResult + timeout = _TIMEOUT + + def __init__(self, runner_cls, nprocs, useslice, **kwargs): + runner.TextTestRunner.__init__(self, **kwargs) + self.runner_cls = runner_cls + self.nprocs = nprocs + self.useslice = parse_slice(useslice) + self.runner_args = kwargs + + def _run_inner(self, result): + # We hijack TextTestRunner.run()'s inner logic by passing this + # method as if it were a test case. + child_runner = _MinimalRunner(self.runner_cls, self.runner_args) + + # Split the tests and recycle the worker process to tame memory usage. + chunk_size = 100 + splitted_tests = [self._ptests[i:i + chunk_size] + for i in range(0, len(self._ptests), chunk_size)] + + for tests in splitted_tests: + pool = multiprocessing.Pool(self.nprocs) + try: + self._run_parallel_tests(result, pool, child_runner, tests) + except: + # On exception, kill still active workers immediately + pool.terminate() + # Make sure exception is reported and not ignored + raise + else: + # Close the pool cleanly unless asked to early out + if result.shouldStop: + pool.terminate() + break + else: + pool.close() + finally: + # Always join the pool (this is necessary for coverage.py) + pool.join() + if not result.shouldStop: + stests = SerialSuite(self._stests) + stests.run(result) + return result + + def _run_parallel_tests(self, result, pool, child_runner, tests): + remaining_ids = set(t.id() for t in tests) + tests.sort(key=cuda_sensitive_mtime) + it = pool.imap_unordered(child_runner, tests) + while True: + try: + child_result = it.__next__(self.timeout) + except StopIteration: + return + except TimeoutError as e: + # Diagnose the names of unfinished tests + msg = ("Tests didn't finish before timeout (or crashed):\n%s" + % "".join("- %r\n" % tid for tid in sorted(remaining_ids)) + ) + e.args = (msg,) + e.args[1:] + raise e + else: + result.add_results(child_result) + remaining_ids.discard(child_result.test_id) + if child_result.shouldStop: + result.shouldStop = True + return + + def run(self, test): + self._ptests, self._stests = _split_nonparallel_tests(test, + self.useslice) + print("Parallel: %s. Serial: %s" % (len(self._ptests), + len(self._stests))) + # This will call self._run_inner() on the created result object, + # and print out the detailed test results at the end. + return super(ParallelTestRunner, self).run(self._run_inner) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/testing/notebook.py b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/notebook.py new file mode 100644 index 0000000000000000000000000000000000000000..646a92d739c755f91efc42b6591d3d07ed1e3af8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/testing/notebook.py @@ -0,0 +1,171 @@ +from unittest import TestCase + +from ipykernel.tests import utils +from nbformat.converter import convert +from nbformat.reader import reads + +import re +import json +from copy import copy +import unittest + +try: + # py3 + from queue import Empty + + def isstr(s): + return isinstance(s, str) +except ImportError: + # py2 + from Queue import Empty + + def isstr(s): + return isinstance(s, basestring) # noqa + +class NotebookTest(TestCase): + """Validate a notebook. All code cells are executed in order. The output is either checked + for errors (if no reference output is present), or is compared against expected output. + + + Useful references: + http://nbformat.readthedocs.org/en/latest/format_description.html + http://jupyter-client.readthedocs.org/en/latest/messaging.html +""" + + + IGNORE_TYPES = ["execute_request", "execute_input", "status", "pyin"] + STRIP_KEYS = ["execution_count", "traceback", "prompt_number", "source"] + NBFORMAT_VERSION = 4 + + def _test_notebook(self, notebook, test): + + with open(notebook) as f: + nb = convert(reads(f.read()), self.NBFORMAT_VERSION) + _, kernel = utils.start_new_kernel() + for i, c in enumerate([c for c in nb.cells if c.cell_type == 'code']): + self._test_notebook_cell(self.sanitize_cell(c), i, kernel, test) + + def _test_notebook_cell(self, cell, i, kernel, test): + + if hasattr(cell, 'source'): # nbformat 4.0 and later + code = cell.source + else: + code = cell.input + iopub = kernel.iopub_channel + kernel.execute(code) + outputs = [] + msg = None + no_error = True + first_error = -1 + error_msg = '' + while self.should_continue(msg): + try: + msg = iopub.get_msg(block=True, timeout=1) + except Empty: + continue + if msg['msg_type'] not in self.IGNORE_TYPES: + if msg['msg_type'] == 'error': + error_msg = ' ' + msg['content']['ename'] + '\n ' + msg['content']['evalue'] + no_error = False + if first_error == -1: + first_error = i + i = len(outputs) + expected = i < len(cell.outputs) and cell.outputs[i] or [] + o = self.transform_message(msg, expected) + outputs.append(o) + + if (test == 'check_error'): + self.assertTrue(no_error, 'Executing cell %d resulted in an error:\n%s'%(first_error, error_msg)) + else: + # Compare computed output against stored output. + # TODO: This doesn't work right now as the generated output is too diverse to + # be verifiable. + scrub = lambda x: self.dump_canonical(list(self.scrub_outputs(x))) + scrubbed = scrub(outputs) + expected = scrub(cell.outputs) + #print('output=%s'%outputs) + #print('expected=%s'%expected) + #self.assertEqual(scrubbed, expected, "\n{}\n\n{}".format(scrubbed, expected)) + + def dump_canonical(self, obj): + return json.dumps(obj, indent=2, sort_keys=True) + + def scrub_outputs(self, outputs): + """ + remove all scrubs from output data and text + """ + for output in outputs: + out = copy(output) + + for scrub, sub in []:#self.scrubs.items(): + def _scrubLines(lines): + if isstr(lines): + return re.sub(scrub, sub, lines) + else: + return [re.sub(scrub, sub, line) for line in lines] + + if "text" in out: + out["text"] = _scrubLines(out["text"]) + + if "data" in out: + if isinstance(out["data"], dict): + for mime, data in out["data"].items(): + out["data"][mime] = _scrubLines(data) + else: + out["data"] = _scrubLines(out["data"]) + yield out + + def strip_keys(self, d): + """ + remove keys from STRIP_KEYS to ensure comparability + """ + for key in self.STRIP_KEYS: + d.pop(key, None) + return d + + def sanitize_cell(self, cell): + """ + remove non-reproducible things + """ + for output in cell.outputs: + self.strip_keys(output) + return cell + + def transform_message(self, msg, expected): + """ + transform a message into something like the notebook + """ + SWAP_KEYS = { + "output_type": { + "pyout": "execute_result", + "pyerr": "error" + } + } + + output = { + u"output_type": msg["msg_type"] + } + output.update(msg["content"]) + + output = self.strip_keys(output) + for key, swaps in SWAP_KEYS.items(): + if key in output and output[key] in swaps: + output[key] = swaps[output[key]] + + if "data" in output and "data" not in expected: + output["text"] = output["data"] + del output["data"] + + return output + + def should_continue(self, msg): + """ + determine whether the current message is the last for this cell + """ + if msg is None: + return True + + return not (msg["msg_type"] == "status" and + msg["content"]["execution_state"] == "idle") + + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d2a38c69038c9ed68838f08b0a7014d2728b5855 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/__init__.py @@ -0,0 +1,33 @@ +import gc +from os.path import dirname, join +import multiprocessing +import sys +import time +import unittest +import warnings + +from unittest.suite import TestSuite +from numba.testing import load_testsuite + + +try: + import faulthandler +except ImportError: + faulthandler = None +else: + try: + # May fail in IPython Notebook with UnsupportedOperation + faulthandler.enable() + except Exception as e: + msg = "Failed to enable faulthandler due to:\n{err}" + warnings.warn(msg.format(err=e)) + +def load_tests(loader, tests, pattern): + suite = TestSuite() + suite.addTests(load_testsuite(loader, dirname(__file__))) + # Numba CUDA tests are located in a separate directory: + cuda_dir = join(dirname(dirname(__file__)), 'cuda/tests') + suite.addTests(loader.discover(cuda_dir)) + + return suite + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/annotation_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/annotation_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..a249ccbd5614ada1ddb035e929c5a2627539d319 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/annotation_usecases.py @@ -0,0 +1,16 @@ +""" +Usecases with Python 3 function annotations. This is a separate module +in order to avoid syntax errors with Python 2. +""" + + +class AnnotatedClass: + """ + A class with annotated methods. + """ + + def __init__(self, v: int): + self.x = v + + def add(self, v: int) -> int: + return self.x + v diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cache_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cache_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..372311777526d160603e862a6c1d2d58eb316b1a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cache_usecases.py @@ -0,0 +1,172 @@ +""" +This file will be copied to a temporary directory in order to +exercise caching compiled Numba functions. + +See test_dispatcher.py. +""" + +import sys + +import numpy as np + +from numba import jit, prange +from numba.core import types + +from numba.tests.ctypes_usecases import c_sin +from numba.tests.support import TestCase, captured_stderr + + +@jit(cache=True, nopython=True) +def simple_usecase(x): + return x + +def simple_usecase_caller(x): + return simple_usecase(x) + + +@jit(cache=True, nopython=True) +def add_usecase(x, y): + return x + y + Z + + +@jit(cache=True, forceobj=True) +def add_objmode_usecase(x, y): + object() + return x + y + Z + + +@jit(nopython=True) +def add_nocache_usecase(x, y): + return x + y + Z + + +@jit(cache=True, nopython=True) +def inner(x, y): + return x + y + Z + +@jit(cache=True, nopython=True) +def outer(x, y): + return inner(-y, x) + +@jit(cache=False, nopython=True) +def outer_uncached(x, y): + return inner(-y, x) + + +@jit(cache=True, forceobj=True) +def looplifted(n): + object() + res = 0 + for i in range(n): + res = res + i + return res + + +@jit(cache=True, nopython=True) +def use_c_sin(x): + return c_sin(x) + +@jit(cache=True, nopython=True) +def use_c_sin_nest1(x): + return use_c_sin(x) + +@jit(cache=True, nopython=True) +def use_c_sin_nest2(x): + return use_c_sin_nest1(x) + + +@jit(cache=True, nopython=True) +def ambiguous_function(x): + return x + 2 + +renamed_function1 = ambiguous_function + +@jit(cache=True, nopython=True) +def ambiguous_function(x): + return x + 6 + +renamed_function2 = ambiguous_function + + +def make_closure(x): + @jit(cache=True, nopython=True) + def closure(y): + return x + y + + return closure + +closure1 = make_closure(3) +closure2 = make_closure(5) +closure3 = make_closure(7) +closure4 = make_closure(9) + + +biggie = np.arange(10**6) + +@jit(cache=True, nopython=True) +def use_big_array(): + return biggie + + +Z = 1 + +# Exercise returning a record instance. This used to hardcode the dtype +# pointer's value in the bitcode. + +packed_record_type = np.dtype([('a', np.int8), ('b', np.float64)]) +aligned_record_type = np.dtype([('a', np.int8), ('b', np.float64)], align=True) + +packed_arr = np.empty(2, dtype=packed_record_type) +for i in range(packed_arr.size): + packed_arr[i]['a'] = i + 1 + packed_arr[i]['b'] = i + 42.5 + +aligned_arr = np.array(packed_arr, dtype=aligned_record_type) + +@jit(cache=True, nopython=True) +def record_return(ary, i): + return ary[i] + + +class _TestModule(TestCase): + """ + Tests for functionality of this module's functions. + Note this does not define any "test_*" method, instead check_module() + should be called by hand. + """ + + def check_module(self, mod): + self.assertPreciseEqual(mod.add_usecase(2, 3), 6) + self.assertPreciseEqual(mod.add_objmode_usecase(2, 3), 6) + self.assertPreciseEqual(mod.outer_uncached(3, 2), 2) + self.assertPreciseEqual(mod.outer(3, 2), 2) + + packed_rec = mod.record_return(mod.packed_arr, 1) + self.assertPreciseEqual(tuple(packed_rec), (2, 43.5)) + aligned_rec = mod.record_return(mod.aligned_arr, 1) + self.assertPreciseEqual(tuple(aligned_rec), (2, 43.5)) + + +@jit(cache=True) +def first_class_function_mul(x): + return x * x + + +@jit(cache=True) +def first_class_function_add(x): + return x + x + + +@jit(cache=True) +def first_class_function_usecase(f, x): + return f(x) + + +def self_test(): + mod = sys.modules[__name__] + _TestModule().check_module(mod) + + +@jit(parallel=True, cache=True, nopython=True) +def parfor_usecase(ary): + return ary * ary + ary diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cffi_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cffi_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..a101b977d8895846abba5cd96157380afe2d6926 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cffi_usecases.py @@ -0,0 +1,197 @@ +import sys + +import numpy as np + +import numba.core.typing.cffi_utils as cffi_support +from numba.tests.support import import_dynamic, temp_directory +from numba.core.types import complex128 + + +def load_inline_module(): + """ + Create an inline module, return the corresponding ffi and dll objects. + """ + from cffi import FFI + + # We can't rely on libc availability on Windows anymore, so we use our + # own compiled wrappers (see https://bugs.python.org/issue23606). + + defs = """ + double _numba_test_sin(double x); + double _numba_test_cos(double x); + double _numba_test_funcptr(double (*func)(double)); + bool _numba_test_boolean(void); + """ + + ffi = FFI() + ffi.cdef(defs) + # Load the _helperlib namespace + from numba import _helperlib + return ffi, ffi.dlopen(_helperlib.__file__) + + +def load_ool_module(): + """ + Compile an out-of-line module, return the corresponding ffi and + module objects. + """ + from cffi import FFI + + numba_complex = """ + typedef struct _numba_complex { + double real; + double imag; + } numba_complex; + """ + + bool_define = """ + #ifdef _MSC_VER + #define false 0 + #define true 1 + #define bool int + #else + #include + #endif + """ + + defs = numba_complex + """ + bool boolean(void); + double sin(double x); + double cos(double x); + int foo(int a, int b, int c); + void vsSin(int n, float* x, float* y); + void vdSin(int n, double* x, double* y); + void vector_real(numba_complex *c, double *real, int n); + void vector_imag(numba_complex *c, double *imag, int n); + """ + + source = numba_complex + bool_define + """ + static bool boolean(void) + { + return true; + } + + static int foo(int a, int b, int c) + { + return a + b * c; + } + + void vsSin(int n, float* x, float* y) { + int i; + for (i=0; i 0: + return fa(x) + else: + return fb(x) + +def use_user_defined_symbols(): + return cffi_foo(1, 2, 3) + +# The from_buffer method is member of cffi.FFI, and also of CompiledFFI objects +# (cffi_usecases_ool.ffi is a CompiledFFI object) so we use both in these +# functions. + +def vector_sin_float32(x, y): + vsSin(len(x), ffi.from_buffer(x), ffi_ool.from_buffer(y)) + +def vector_sin_float64(x, y): + vdSin(len(x), ffi.from_buffer(x), ffi_ool.from_buffer(y)) + + +# For testing pointer to structs from buffers + +def vector_extract_real(x, y): + vector_real(ffi.from_buffer(x), ffi.from_buffer(y), len(x)) + +def vector_extract_imag(x, y): + vector_imag(ffi.from_buffer(x), ffi.from_buffer(y), len(x)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cfunc_cache_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cfunc_cache_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..24c3079ceaa1ee74463d40ff57ed68cf9a1ae9a8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cfunc_cache_usecases.py @@ -0,0 +1,70 @@ +""" +This file will be copied to a temporary directory in order to +exercise caching compiled C callbacks. + +See test_cfunc.py. +""" + +import sys + +from numba import cfunc, jit +from numba.tests.support import TestCase, captured_stderr + + +Z = 1 + +add_sig = "float64(float64, float64)" + +div_sig = "float64(int64, int64)" + + +@cfunc(add_sig, cache=True, nopython=True) +def add_usecase(x, y): + return x + y + Z + +@cfunc(add_sig, nopython=True) +def add_nocache_usecase(x, y): + return x + y + Z + +@cfunc(div_sig, cache=True, nopython=True) +def div_usecase(a, b): + return a / b + + +@jit(nopython=True) +def inner(x, y): + return x + y + Z + +@cfunc(add_sig, cache=True, nopython=True) +def outer(x, y): + return inner(-y, x) + + +class _TestModule(TestCase): + """ + Tests for functionality of this module's cfuncs. + Note this does not define any "test_*" method, instead check_module() + should be called by hand. + """ + + def check_module(self, mod): + f = mod.add_usecase + self.assertPreciseEqual(f.ctypes(2.0, 3.0), 6.0) + f = mod.add_nocache_usecase + self.assertPreciseEqual(f.ctypes(2.0, 3.0), 6.0) + f = mod.outer + self.assertPreciseEqual(f.ctypes(5.0, 2.0), 4.0) + + f = mod.div_usecase + with captured_stderr() as err: + self.assertPreciseEqual(f.ctypes(7, 2), 3.5) + self.assertEqual(err.getvalue(), "") + with captured_stderr() as err: + f.ctypes(7, 0) + err = err.getvalue() + self.assertIn("ZeroDivisionError", err) + + +def self_test(): + mod = sys.modules[__name__] + _TestModule().check_module(mod) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/chained_assign_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/chained_assign_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..7f3232d9ed043cb98a72e2e425dd18d4046c6e15 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/chained_assign_usecases.py @@ -0,0 +1,69 @@ +from numba import jit +import numpy as np + + +@jit +def inc(a): + for i in range(len(a)): + a[i] += 1 + return a + + +@jit +def inc1(a): + a[0] += 1 + return a[0] + + +@jit +def inc2(a): + a[0] += 1 + return a[0], a[0] + 1 + + +def chain1(a): + x = y = z = inc(a) + return x + y + z + + +def chain2(v): + a = np.zeros(2) + a[0] = x = a[1] = v + return a[0] + a[1] + (x / 2) + + +def unpack1(x, y): + a, b = x, y + return a + b / 2 + + +def unpack2(x, y): + a, b = c, d = inc1(x), inc1(y) + return a + c / 2, b + d / 2 + + +def chain3(x, y): + a = (b, c) = (inc1(x), inc1(y)) + (d, e) = f = (inc1(x), inc1(y)) + return (a[0] + b / 2 + d + f[0]), (a[1] + c + e / 2 + f[1]) + + +def unpack3(x): + a, b = inc2(x) + return a + b / 2 + + +def unpack4(x): + a, b = c, d = inc2(x) + return a + c / 2, b + d / 2 + + +def unpack5(x): + a = b, c = inc2(x) + d, e = f = inc2(x) + return (a[0] + b / 2 + d + f[0]), (a[1] + c + e / 2 + f[1]) + + +def unpack6(x, y): + (a, b), (c, d) = (x, y), (y + 1, x + 1) + return a + c / 2, b / 2 + d diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cloudpickle_main_class.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cloudpickle_main_class.py new file mode 100644 index 0000000000000000000000000000000000000000..0e29315b37219aa23e9d59051538bf6d311cbd14 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/cloudpickle_main_class.py @@ -0,0 +1,6 @@ +# Expected to run this module as __main__ + + +# Cloudpickle will think this is a dynamic class when this module is __main__ +class Klass: + classvar = None diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/compile_with_pycc.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/compile_with_pycc.py new file mode 100644 index 0000000000000000000000000000000000000000..3f3ae500d3e3520f56160c4512910b4a7c58e7e3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/compile_with_pycc.py @@ -0,0 +1,134 @@ +import cmath + +import numpy as np + +from numba import float32 +from numba.types import unicode_type, i8 +from numba.pycc import CC, exportmany, export +from numba.tests.support import has_blas +from numba import typed + + +# +# New API +# + +cc = CC('pycc_test_simple') +cc.use_nrt = False + +# Note the first signature omits the return type +@cc.export('multf', (float32, float32)) +@cc.export('multi', 'i4(i4, i4)') +def mult(a, b): + return a * b + +# Test imported C globals such as Py_None, PyExc_ZeroDivisionError +@cc.export('get_none', 'none()') +def get_none(): + return None + +@cc.export('div', 'f8(f8, f8)') +def div(x, y): + return x / y + +_two = 2 + +# This one can't be compiled by the legacy API as it doesn't execute +# the script in a proper module. +@cc.export('square', 'i8(i8)') +def square(u): + return u ** _two + +# These ones need helperlib +cc_helperlib = CC('pycc_test_helperlib') +cc_helperlib.use_nrt = False + +@cc_helperlib.export('power', 'i8(i8, i8)') +def power(u, v): + return u ** v + +@cc_helperlib.export('sqrt', 'c16(c16)') +def sqrt(u): + return cmath.sqrt(u) + +@cc_helperlib.export('size', 'i8(f8[:])') +def size(arr): + return arr.size + +# Exercise linking to Numpy math functions +@cc_helperlib.export('np_sqrt', 'f8(f8)') +def np_sqrt(u): + return np.sqrt(u) + +@cc_helperlib.export('spacing', 'f8(f8)') +def np_spacing(u): + return np.spacing(u) + + +# This one clashes with libc random() unless pycc is careful with naming. +@cc_helperlib.export('random', 'f8(i4)') +def random_impl(seed): + if seed != -1: + np.random.seed(seed) + return np.random.random() + +# These ones need NRT +cc_nrt = CC('pycc_test_nrt') + +@cc_nrt.export('zero_scalar', 'f8(i4)') +def zero_scalar(n): + arr = np.zeros(n) + return arr[-1] + +if has_blas: + # This one also needs BLAS + @cc_nrt.export('vector_dot', 'f8(i4)') + def vector_dot(n): + a = np.linspace(1, n, n) + return np.dot(a, a) + +# This one needs an environment +@cc_nrt.export('zeros', 'f8[:](i4)') +def zeros(n): + return np.zeros(n) + +# requires list dtor, #issue3535 +@cc_nrt.export('np_argsort', 'intp[:](float64[:])') +def np_argsort(arr): + return np.argsort(arr) + +# +# Legacy API +# + +exportmany(['multf f4(f4,f4)', 'multi i4(i4,i4)'])(mult) +# Needs to link to helperlib to due with complex arguments +# export('multc c16(c16,c16)')(mult) +export('mult f8(f8, f8)')(mult) + + +@cc_nrt.export('dict_usecase', 'intp[:](intp[:])') +def dict_usecase(arr): + d = typed.Dict() + for i in range(arr.size): + d[i] = arr[i] + out = np.zeros_like(arr) + for k, v in d.items(): + out[k] = k * v + return out + +# checks for issue #6386 +@cc_nrt.export('internal_str_dict', i8(unicode_type)) +def internal_str_dict(x): + d = typed.Dict.empty(unicode_type,i8) + if(x not in d): + d[x] = len(d) + return len(d) + +@cc_nrt.export('hash_str', i8(unicode_type)) +def internal_str_dict(x): + return hash(x) + +@cc_nrt.export('hash_literal_str_A', i8()) +def internal_str_dict(): + return hash("A") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/complex_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/complex_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..113cd69217adacc21dcdba1d9a27155e376625e5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/complex_usecases.py @@ -0,0 +1,93 @@ +import cmath + + +def div_usecase(x, y): + return x / y + + +def real_usecase(x): + return x.real + +def imag_usecase(x): + return x.imag + +def conjugate_usecase(x): + return x.conjugate() + + +def acos_usecase(x): + return cmath.acos(x) + +def cos_usecase(x): + return cmath.cos(x) + +def asin_usecase(x): + return cmath.asin(x) + +def sin_usecase(x): + return cmath.sin(x) + +def atan_usecase(x): + return cmath.atan(x) + +def tan_usecase(x): + return cmath.tan(x) + +def acosh_usecase(x): + return cmath.acosh(x) + +def cosh_usecase(x): + return cmath.cosh(x) + +def asinh_usecase(x): + return cmath.asinh(x) + +def sinh_usecase(x): + return cmath.sinh(x) + +def atanh_usecase(x): + return cmath.atanh(x) + +def tanh_usecase(x): + return cmath.tanh(x) + +def exp_usecase(x): + return cmath.exp(x) + +def isfinite_usecase(x): + return cmath.isfinite(x) + +def isinf_usecase(x): + return cmath.isinf(x) + +def isnan_usecase(x): + return cmath.isnan(x) + +def log_usecase(x): + return cmath.log(x) + +def log_base_usecase(x, base): + return cmath.log(x, base) + +def log10_usecase(x): + return cmath.log10(x) + +def phase_usecase(x): + return cmath.phase(x) + +def polar_usecase(x): + return cmath.polar(x) + +_two = 2.0 + +def polar_as_complex_usecase(x): + # HACK: clear errno by invoking float.__pow__ + # (workaround for http://bugs.python.org/issue24489) + _two ** _two + return complex(*cmath.polar(x)) + +def rect_usecase(r, phi): + return cmath.rect(r, phi) + +def sqrt_usecase(x): + return cmath.sqrt(x) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/ctypes_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/ctypes_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..5ed8d3ab8e1a480bd1f0f82127b176eca648686f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/ctypes_usecases.py @@ -0,0 +1,114 @@ +from ctypes import * +import sys + +import numpy as np + + +is_windows = sys.platform.startswith('win32') + +# We can't rely on libc availability on Windows anymore, so we use our +# own compiled wrappers (see https://bugs.python.org/issue23606). + +from numba import _helperlib +libnumba = CDLL(_helperlib.__file__) +del _helperlib + +# A typed C function (cdecl under Windows) + +c_sin = libnumba._numba_test_sin +c_sin.argtypes = [c_double] +c_sin.restype = c_double + +def use_c_sin(x): + return c_sin(x) + +c_cos = libnumba._numba_test_cos +c_cos.argtypes = [c_double] +c_cos.restype = c_double + +def use_two_funcs(x): + return c_sin(x) - c_cos(x) + +# Typed C functions accepting an array pointer +# (either as a "void *" or as a typed pointer) + +c_vsquare = libnumba._numba_test_vsquare +c_vsquare.argtypes = [c_int, c_void_p, c_void_p] + +c_vcube = libnumba._numba_test_vsquare +c_vcube.argtypes = [c_int, POINTER(c_double), POINTER(c_double)] + +def use_c_vsquare(x): + out = np.empty_like(x) + c_vsquare(x.size, x.ctypes, out.ctypes) + return out + +def use_c_vcube(x): + out = np.empty_like(x) + c_vcube(x.size, x.ctypes, out.ctypes) + return out + +# An untyped C function + +c_untyped = libnumba._numba_test_exp + +def use_c_untyped(x): + return c_untyped(x) + +# A C function wrapped in a CFUNCTYPE + +ctype_wrapping = CFUNCTYPE(c_double, c_double)(use_c_sin) + +def use_ctype_wrapping(x): + return ctype_wrapping(x) + +# A Python API function + +savethread = pythonapi.PyEval_SaveThread +savethread.argtypes = [] +savethread.restype = c_void_p + +restorethread = pythonapi.PyEval_RestoreThread +restorethread.argtypes = [c_void_p] +restorethread.restype = None + +if is_windows: + # A function with the stdcall calling convention + c_sleep = windll.kernel32.Sleep + c_sleep.argtypes = [c_uint] + c_sleep.restype = None + + def use_c_sleep(x): + c_sleep(x) + + +def use_c_pointer(x): + """ + Running in Python will cause a segfault. + """ + threadstate = savethread() + x += 1 + restorethread(threadstate) + return x + + +def use_func_pointer(fa, fb, x): + if x > 0: + return fa(x) + else: + return fb(x) + + +mydct = {'what': 1232121} + +def call_me_maybe(arr): + return mydct[arr[0].decode('ascii')] + +# Create a callback into the python interpreter +py_call_back = CFUNCTYPE(c_int, py_object)(call_me_maybe) + + +def take_array_ptr(ptr): + return ptr + +c_take_array_ptr = CFUNCTYPE(c_void_p, c_void_p)(take_array_ptr) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/doctest_usecase.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/doctest_usecase.py new file mode 100644 index 0000000000000000000000000000000000000000..1761ba08a47ff67b7285b081659e0e474e81b0a2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/doctest_usecase.py @@ -0,0 +1,31 @@ +""" +Test that all docstrings are the same: + +>>> len({f.__doc__ for f in (a, b, c, d)}) +1 +""" +from numba import guvectorize, int64, njit, vectorize + + +def a(): + """>>> x = 1""" + return 1 + + +@njit +def b(): + """>>> x = 1""" + return 1 + + +@guvectorize([(int64[:], int64, int64[:])], "(n),()->(n)") +def c(x, y, res): + """>>> x = 1""" + for i in range(x.shape[0]): + res[i] = x[i] + y + + +@vectorize([int64(int64, int64)]) +def d(x, y): + """>>> x = 1""" + return x + y diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/dummy_module.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/dummy_module.py new file mode 100644 index 0000000000000000000000000000000000000000..4152f3ff502021c9ed80bf147ca7bfe89a1f11ab --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/dummy_module.py @@ -0,0 +1,4 @@ +'''Dummy module''' + +def function(): + '''Do nothing''' diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/enum_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/enum_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..995dbd917afb0abb2e48185ecb14adef692e2489 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/enum_usecases.py @@ -0,0 +1,55 @@ +from enum import Enum, IntEnum + + +class Color(Enum): + red = 1 + green = 2 + blue = 3 + + +class Shake(Enum): + vanilla = 7 + chocolate = 4 + cookies = 9 + # Same as Color.blue + mint = 3 + + +class Planet(Enum): + MERCURY = (3.303e+23, 2.4397e6) + VENUS = (4.869e+24, 6.0518e6) + EARTH = (5.976e+24, 6.37814e6) + MARS = (6.421e+23, 3.3972e6) + JUPITER = (1.9e+27, 7.1492e7) + SATURN = (5.688e+26, 6.0268e7) + URANUS = (8.686e+25, 2.5559e7) + NEPTUNE = (1.024e+26, 2.4746e7) + + +class HeterogeneousEnum(Enum): + red = 1.0 + green = 2.0 + blue = 3j + + +class Shape(IntEnum): + # Same as Color.green + circle = 2 + # Same as RequestError.internal_error + square = 500 + + +class RequestError(IntEnum): + dummy = 2 + not_found = 404 + internal_error = 500 + +class IntEnumWithNegatives(IntEnum): + # Used for testing of hash, need to make sure -1 -> -2 to comply with CPy + one = 1 + two = 2 + too = 2 + three = 3 + negone = -1 + negtwo = -2 + negthree = -3 diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/error_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/error_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..c504a11c7fde9486a7aef5f2e38346e33750cbcf --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/error_usecases.py @@ -0,0 +1,6 @@ +import numba as nb + + +@nb.jit(nopython=True, parallel=True) +def foo(): + pass diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/errorhandling_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/errorhandling_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..24e9c3fbc47f1a5722a9d9680fbf4694f0efdbba --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/errorhandling_usecases.py @@ -0,0 +1,14 @@ +from numba import typed, int64 + +# used in TestMiscErrorHandling::test_handling_of_write_to_*_global +_global_list = [1, 2, 3, 4] + +_global_dict = typed.Dict.empty(int64, int64) + + +def global_reflected_write(): + _global_list[0] = 10 + + +def global_dict_write(): + _global_dict[0] = 10 diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/gdb_support.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/gdb_support.py new file mode 100644 index 0000000000000000000000000000000000000000..7a40bea0388a1468becd36474efede4f800bd790 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/gdb_support.py @@ -0,0 +1,197 @@ +"""Helpers for running gdb related testing""" +import os +import re +import sys +import unittest +from numba.core import config +from numba.misc.gdb_hook import _confirm_gdb +from numba.misc.numba_gdbinfo import collect_gdbinfo + +# check if gdb is present and working +try: + _confirm_gdb(need_ptrace_attach=False) # The driver launches as `gdb EXE`. + _HAVE_GDB = True + _gdb_info = collect_gdbinfo() + _GDB_HAS_PY3 = _gdb_info.py_ver.startswith('3') +except Exception: + _HAVE_GDB = False + _GDB_HAS_PY3 = False + +_msg = "functioning gdb with correct ptrace permissions is required" +needs_gdb = unittest.skipUnless(_HAVE_GDB, _msg) + +_msg = "gdb with python 3 support needed" +needs_gdb_py3 = unittest.skipUnless(_GDB_HAS_PY3, _msg) + + +try: + import pexpect + _HAVE_PEXPECT = True +except ImportError: + _HAVE_PEXPECT = False + + +_msg = "pexpect module needed for test" +skip_unless_pexpect = unittest.skipUnless(_HAVE_PEXPECT, _msg) + + +class GdbMIDriver(object): + """ + Driver class for the GDB machine interface: + https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html + """ + def __init__(self, file_name, debug=False, timeout=120, init_cmds=None): + if not _HAVE_PEXPECT: + msg = ("This driver requires the pexpect module. This can be " + "obtained via:\n\n$ conda install pexpect") + raise RuntimeError(msg) + if not _HAVE_GDB: + msg = ("This driver requires a gdb binary. This can be " + "obtained via the system package manager.") + raise RuntimeError(msg) + self._gdb_binary = config.GDB_BINARY + self._python = sys.executable + self._debug = debug + self._file_name = file_name + self._timeout = timeout + self._init_cmds = init_cmds + self._drive() + + def _drive(self): + """This function sets up the caputured gdb instance""" + assert os.path.isfile(self._file_name) + cmd = [self._gdb_binary, '--interpreter', 'mi'] + if self._init_cmds is not None: + cmd += list(self._init_cmds) + cmd += ['--args', self._python, self._file_name] + self._captured = pexpect.spawn(' '.join(cmd)) + if self._debug: + self._captured.logfile = sys.stdout.buffer + + def supports_python(self): + """Returns True if the underlying gdb implementation has python support + False otherwise""" + return "python" in self.list_features() + + def supports_numpy(self): + """Returns True if the underlying gdb implementation has NumPy support + (and by extension Python support) False otherwise""" + if not self.supports_python(): + return False + # Some gdb's have python 2! + cmd = ('python from __future__ import print_function;' + 'import numpy; print(numpy)') + self.interpreter_exec('console', cmd) + return "module \'numpy\' from" in self._captured.before.decode() + + def _captured_expect(self, expect): + try: + self._captured.expect(expect, timeout=self._timeout) + except pexpect.exceptions.TIMEOUT as e: + msg = f"Expected value did not arrive: {expect}." + raise ValueError(msg) from e + + def assert_output(self, expected): + """Asserts that the current output string contains the expected.""" + output = self._captured.after + decoded = output.decode('utf-8') + assert expected in decoded, f'decoded={decoded}\nexpected={expected})' + + def assert_regex_output(self, expected): + """Asserts that the current output string contains the expected + regex.""" + output = self._captured.after + decoded = output.decode('utf-8') + done_str = decoded.splitlines()[0] + found = re.match(expected, done_str) + assert found, f'decoded={decoded}\nexpected={expected})' + + def _run_command(self, command, expect=''): + self._captured.sendline(command) + self._captured_expect(expect) + + def run(self): + """gdb command ~= 'run'""" + self._run_command('-exec-run', expect=r'\^running.*\r\n') + + def cont(self): + """gdb command ~= 'continue'""" + self._run_command('-exec-continue', expect=r'\^running.*\r\n') + + def quit(self): + """gdb command ~= 'quit'""" + self._run_command('-gdb-exit', expect=r'-gdb-exit') + self._captured.terminate() + + def next(self): + """gdb command ~= 'next'""" + self._run_command('-exec-next', expect=r'\*stopped,.*\r\n') + + def step(self): + """gdb command ~= 'step'""" + self._run_command('-exec-step', expect=r'\*stopped,.*\r\n') + + def set_breakpoint(self, line=None, symbol=None, condition=None): + """gdb command ~= 'break'""" + if line is not None and symbol is not None: + raise ValueError("Can only supply one of line or symbol") + bp = '-break-insert ' + if condition is not None: + bp += f'-c "{condition}" ' + if line is not None: + assert isinstance(line, int) + bp += f'-f {self._file_name}:{line} ' + if symbol is not None: + assert isinstance(symbol, str) + bp += f'-f {symbol} ' + self._run_command(bp, expect=r'\^done') + + def check_hit_breakpoint(self, number=None, line=None): + """Checks that a breakpoint has been hit""" + self._captured_expect(r'\*stopped,.*\r\n') + self.assert_output('*stopped,reason="breakpoint-hit",') + if number is not None: + assert isinstance(number, int) + self.assert_output(f'bkptno="{number}"') + if line is not None: + assert isinstance(line, int) + self.assert_output(f'line="{line}"') + + def stack_list_arguments(self, print_values=1, low_frame=0, high_frame=0): + """gdb command ~= 'info args'""" + for x in (print_values, low_frame, high_frame): + assert isinstance(x, int) and x in (0, 1, 2) + cmd = f'-stack-list-arguments {print_values} {low_frame} {high_frame}' + self._run_command(cmd, expect=r'\^done,.*\r\n') + + def stack_list_variables(self, print_values=1): + """gdb command ~= 'info locals'""" + assert isinstance(print_values, int) and print_values in (0, 1, 2) + cmd = f'-stack-list-variables {print_values}' + self._run_command(cmd, expect=r'\^done,.*\r\n') + + def interpreter_exec(self, interpreter=None, command=None): + """gdb command ~= 'interpreter-exec'""" + if interpreter is None: + raise ValueError("interpreter cannot be None") + if command is None: + raise ValueError("command cannot be None") + cmd = f'-interpreter-exec {interpreter} "{command}"' + self._run_command(cmd, expect=r'\^(done|error).*\r\n') # NOTE no `,` + + def _list_features_raw(self): + cmd = '-list-features' + self._run_command(cmd, expect=r'\^done,.*\r\n') + + def list_features(self): + """No equivalent gdb command? Returns a list of supported gdb + features. + """ + self._list_features_raw() + output = self._captured.after + decoded = output.decode('utf-8') + m = re.match('.*features=\\[(.*)\\].*', decoded) + assert m is not None, "No match found for features string" + g = m.groups() + assert len(g) == 1, "Invalid number of match groups found" + return g[0].replace('"', '').split(',') diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/inlining_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/inlining_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..663b7d3c4798a2add0689a3d52a3c82e034c81e4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/inlining_usecases.py @@ -0,0 +1,69 @@ +""" Test cases for inlining IR from another module """ +from numba import jit, njit +from numba.core import types +from numba.core.extending import overload + +_GLOBAL1 = 100 + + +@njit(inline='always') +def bar(): + return _GLOBAL1 + 10 + + +def baz_factory(a): + b = 17 + a + + @njit(inline='always') + def baz(): + return _GLOBAL1 + a - b + return baz + + +def baz(): + return _GLOBAL1 + 10 + + +@overload(baz, inline='always') +def baz_ol(): + def impl(): + return _GLOBAL1 + 10 + return impl + + +def bop_factory(a): + b = 17 + a + + def bop(): + return _GLOBAL1 + a - b + + @overload(bop, inline='always') + def baz(): + def impl(): + return _GLOBAL1 + a - b + return impl + + return bop + + +@jit((types.int32,), nopython=True) +def inner(a): + return a + 1 + + +@jit((types.int32,), nopython=True) +def more(a): + return inner(inner(a)) + + +def outer_simple(a): + return inner(a) * 2 + + +def outer_multiple(a): + return inner(a) * more(a) + + +@njit +def __dummy__(): + return diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/matmul_usecase.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/matmul_usecase.py new file mode 100644 index 0000000000000000000000000000000000000000..84af4ef308e67c07190325e22fc1ca01b3c9d874 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/matmul_usecase.py @@ -0,0 +1,24 @@ +"""Use cases for testing matmul (@) +""" +def matmul_usecase(x, y): + return x @ y + +def imatmul_usecase(x, y): + x @= y + return x + +class DumbMatrix(object): + + def __init__(self, value): + self.value = value + + def __matmul__(self, other): + if isinstance(other, DumbMatrix): + return DumbMatrix(self.value * other.value) + return NotImplemented + + def __imatmul__(self, other): + if isinstance(other, DumbMatrix): + self.value *= other.value + return self + return NotImplemented diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/orphaned_semaphore_usecase.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/orphaned_semaphore_usecase.py new file mode 100644 index 0000000000000000000000000000000000000000..e9101e2f2b541b55a91a24d62031f29bcf114af0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/orphaned_semaphore_usecase.py @@ -0,0 +1,24 @@ +# See issue: https://github.com/numba/numba/issues/4348 +# this file must be run in isolation to replicate, test: +# numba.tests.test_parallel_backend.TestInitSafetyIssues.test_orphaned_semaphore +# does this to check semaphores are not leaking. + +import multiprocessing as mp + +import numba # noqa, deliberately unused, here to test import is safe + + +def w(): + pass + + +def main(): + ps = [mp.Process(target=w) for _ in range(4)] + [p.start() for p in ps] + [p.join() for p in ps] + + +if __name__ == '__main__': + p = mp.get_context('spawn').Process(target=main) + p.start() + p.join() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/overload_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/overload_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..fe1ca5799e847dbb37c63b2706e6477cd3ba8947 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/overload_usecases.py @@ -0,0 +1,28 @@ +# Python 3 syntax only use cases, used in test_extending.py + +# arg name is different, and there's no arg name to match before *args + + +def impl4(z, *args, kw=None): + if z > 10: + return 1 + else: + return -1 + +# arg name is different but at a detectable location, with *args + + +def impl5(z, b, *args, kw=None): + if z > 10: + return 1 + else: + return -1 + + +def var_positional_impl(a, *star_args_token, kw=None, kw1=12): + def impl(a, b, f, kw=None, kw1=12): + if a > 10: + return 1 + else: + return -1 + return impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/parfor_iss9490_usecase.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/parfor_iss9490_usecase.py new file mode 100644 index 0000000000000000000000000000000000000000..15e5d41130e48ea6c7c6540a5bac335c5d8002b6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/parfor_iss9490_usecase.py @@ -0,0 +1,78 @@ +""" +This is a testcase for https://github.com/numba/numba/issues/9490. +The bug is very sensitive to the control-flow and variable uses. +It is impossible to shrink the reproducer in any meaningful way. + +The test is also sensitive to PYTHONHASHSEED. +PYTHONHASHSEED=1 will trigger the bug. + +Example of traceback: + + File "/numba/parfors/parfor.py", line 2070, in _arrayexpr_to_parfor + index_vars, loopnests = _mk_parfor_loops(pass_states.typemap, size_vars, + scope, loc) + File "/numba/parfors/parfor.py", line 1981, in _mk_parfor_loops + for size_var in size_vars: +TypeError: Failed in nopython mode pipeline (step: convert to parfors) +'NoneType' object is not iterable +""" + +import numba +import numpy as np + + +@numba.jit(nopython=True, parallel=True) +def stable_fit(X, y, threshold=3): + min_obs = int(X.shape[1] * 1.5) + beta = np.zeros((X.shape[1], y.shape[1]), dtype=np.float64) + residuals = np.full_like(y, np.nan) + stable = np.empty((y.shape[1])) + for idx in numba.prange(y.shape[1]): + y_sub = y[:, idx] + isna = np.isnan(y_sub) + X_sub = X[~isna] + y_sub = y_sub[~isna] + is_stable = False + + # Run until minimum observations + # or until stability is reached + for jdx in range(len(y_sub), min_obs - 1, -2): + # Timeseries gets reduced by two elements + # each iteration + y_ = y_sub[-jdx:] + X_ = X_sub[-jdx:] + beta_sub = np.linalg.solve(np.dot(X_.T, X_), np.dot(X_.T, y_)) + resid_sub = np.dot(X_, beta_sub) - y_ + # Check for stability + rmse = np.sqrt(np.mean(resid_sub ** 2)) + first = np.fabs(resid_sub[0]) / rmse < threshold + last = np.fabs(resid_sub[-1]) / rmse < threshold + slope = np.fabs(beta_sub[1]) / rmse < threshold + # Break if stability is reached + is_stable = slope & first & last + if is_stable: + break + + beta[:, idx] = beta_sub + residuals[-jdx:, idx] = resid_sub + stable[idx] = is_stable + return beta, residuals, stable.astype(np.bool_) + + +def check(): + np.random.seed(0) + X_shape = (10, 4) + y_shape = (10, 5) + X = np.random.random(X_shape) + y = np.random.random(y_shape) + + got_beta, got_residuals, got_stable = stable_fit(X, y) + exp_beta, exp_residuals, exp_stable = stable_fit.py_func(X, y) + + np.testing.assert_allclose(got_beta, exp_beta) + np.testing.assert_allclose(got_residuals, exp_residuals) + np.testing.assert_allclose(got_stable, exp_stable) + + +if __name__ == "__main__": + check() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/parfors_cache_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/parfors_cache_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..b650bcf5e0f2da3445e251ba972244066a323b7e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/parfors_cache_usecases.py @@ -0,0 +1,66 @@ +import sys + +import numpy as np + +from numba import njit +from numba.tests.support import TestCase + + +@njit(parallel=True, cache=True) +def arrayexprs_case(arr): + return arr / arr.sum() + + +@njit(parallel=True, cache=True) +def prange_case(arr): + out = np.zeros_like(arr) + c = 1 / arr.sum() + for i in range(arr.size): + out[i] = arr[i] * c + return out + + +@njit(cache=True) +def caller_case(arr): + return prange_case(arrayexprs_case(arr)) + + +class _TestModule(TestCase): + """ + Tests for functionality of this module's functions. + Note this does not define any "test_*" method, instead check_module() + should be called by hand. + """ + def check_module(self, mod): + total_cache_hits = 0 + for fn in [mod.arrayexprs_case, mod.prange_case, mod.caller_case]: + arr = np.ones(20) + np.testing.assert_allclose( + fn(arr), fn.py_func(arr), + ) + # Accumulate cache hits + total_cache_hits += len(fn.stats.cache_hits) + self.assertGreater( + total_cache_hits, 0, + msg="At least one dispatcher has used the cache", + ) + + def run_module(self, mod): + # This just executes the module's functionality without asserting + # anything about the cache, it's used in tests that ensure that + # properties such as thread count aren't baked in to the cached object. + for fn in [mod.arrayexprs_case, mod.prange_case, mod.caller_case]: + arr = np.ones(20) + np.testing.assert_allclose( + fn(arr), fn.py_func(arr), + ) + + +def self_test(): + mod = sys.modules[__name__] + _TestModule().check_module(mod) + + +def self_run(): + mod = sys.modules[__name__] + _TestModule().run_module(mod) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/pdlike_usecase.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/pdlike_usecase.py new file mode 100644 index 0000000000000000000000000000000000000000..75ac00b6ffa199e236dfe09d8af2628da393e850 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/pdlike_usecase.py @@ -0,0 +1,306 @@ +""" +Implementation of a minimal Pandas-like API. +""" + +import numpy as np + +from numba.core import types, cgutils +from numba.core.datamodel import models +from numba.core.extending import ( + typeof_impl, type_callable, register_model, + lower_builtin, box, unbox, NativeValue, + overload, overload_attribute, overload_method, make_attribute_wrapper) +from numba.core.imputils import impl_ret_borrowed + + +class Index(object): + """ + A minimal pandas.Index-like object. + """ + + def __init__(self, data): + assert isinstance(data, np.ndarray) + assert data.ndim == 1 + self._data = data + + def __iter__(self): + return iter(self._data) + + @property + def dtype(self): + return self._data.dtype + + @property + def flags(self): + return self._data.flags + + +class IndexType(types.Buffer): + """ + The type class for Index objects. + """ + array_priority = 1000 + + def __init__(self, dtype, layout, pyclass): + self.pyclass = pyclass + super(IndexType, self).__init__(dtype, 1, layout) + + @property + def key(self): + return self.pyclass, self.dtype, self.layout + + @property + def as_array(self): + return types.Array(self.dtype, 1, self.layout) + + def copy(self, dtype=None, ndim=1, layout=None): + assert ndim == 1 + if dtype is None: + dtype = self.dtype + layout = layout or self.layout + return type(self)(dtype, layout, self.pyclass) + + +class Series(object): + """ + A minimal pandas.Series-like object. + """ + + def __init__(self, data, index): + assert isinstance(data, np.ndarray) + assert isinstance(index, Index) + assert data.ndim == 1 + self._values = data + self._index = index + + def __iter__(self): + return iter(self._values) + + @property + def dtype(self): + return self._values.dtype + + @property + def flags(self): + return self._values.flags + + +class SeriesType(types.ArrayCompatible): + """ + The type class for Series objects. + """ + array_priority = 1000 + + def __init__(self, dtype, index): + assert isinstance(index, IndexType) + self.dtype = dtype + self.index = index + self.values = types.Array(self.dtype, 1, 'C') + name = "series(%s, %s)" % (dtype, index) + super(SeriesType, self).__init__(name) + + @property + def key(self): + return self.dtype, self.index + + @property + def as_array(self): + return self.values + + def copy(self, dtype=None, ndim=1, layout='C'): + assert ndim == 1 + assert layout == 'C' + if dtype is None: + dtype = self.dtype + return type(self)(dtype, self.index) + + +@typeof_impl.register(Index) +def typeof_index(val, c): + arrty = typeof_impl(val._data, c) + assert arrty.ndim == 1 + return IndexType(arrty.dtype, arrty.layout, type(val)) + +@typeof_impl.register(Series) +def typeof_series(val, c): + index = typeof_impl(val._index, c) + arrty = typeof_impl(val._values, c) + assert arrty.ndim == 1 + assert arrty.layout == 'C' + return SeriesType(arrty.dtype, index) + +@type_callable('__array_wrap__') +def type_array_wrap(context): + def typer(input_type, result): + if isinstance(input_type, (IndexType, SeriesType)): + return input_type.copy(dtype=result.dtype, + ndim=result.ndim, + layout=result.layout) + + return typer + +@type_callable(Series) +def type_series_constructor(context): + def typer(data, index): + if isinstance(index, IndexType) and isinstance(data, types.Array): + assert data.layout == 'C' + assert data.ndim == 1 + return SeriesType(data.dtype, index) + + return typer + + +# Backend extensions for Index and Series + +@register_model(IndexType) +class IndexModel(models.StructModel): + def __init__(self, dmm, fe_type): + members = [('data', fe_type.as_array)] + models.StructModel.__init__(self, dmm, fe_type, members) + +@register_model(SeriesType) +class SeriesModel(models.StructModel): + def __init__(self, dmm, fe_type): + members = [ + ('index', fe_type.index), + ('values', fe_type.as_array), + ] + models.StructModel.__init__(self, dmm, fe_type, members) + +make_attribute_wrapper(IndexType, 'data', '_data') +make_attribute_wrapper(SeriesType, 'index', '_index') +make_attribute_wrapper(SeriesType, 'values', '_values') + +def make_index(context, builder, typ, **kwargs): + return cgutils.create_struct_proxy(typ)(context, builder, **kwargs) + +def make_series(context, builder, typ, **kwargs): + return cgutils.create_struct_proxy(typ)(context, builder, **kwargs) + +@lower_builtin('__array__', IndexType) +def index_as_array(context, builder, sig, args): + val = make_index(context, builder, sig.args[0], ref=args[0]) + return val._get_ptr_by_name('data') + +@lower_builtin('__array__', SeriesType) +def series_as_array(context, builder, sig, args): + val = make_series(context, builder, sig.args[0], ref=args[0]) + return val._get_ptr_by_name('values') + +@lower_builtin('__array_wrap__', IndexType, types.Array) +def index_wrap_array(context, builder, sig, args): + dest = make_index(context, builder, sig.return_type) + dest.data = args[1] + return impl_ret_borrowed(context, builder, sig.return_type, dest._getvalue()) + +@lower_builtin('__array_wrap__', SeriesType, types.Array) +def series_wrap_array(context, builder, sig, args): + src = make_series(context, builder, sig.args[0], value=args[0]) + dest = make_series(context, builder, sig.return_type) + dest.values = args[1] + dest.index = src.index + return impl_ret_borrowed(context, builder, sig.return_type, dest._getvalue()) + +@lower_builtin(Series, types.Array, IndexType) +def pdseries_constructor(context, builder, sig, args): + data, index = args + series = make_series(context, builder, sig.return_type) + series.index = index + series.values = data + return impl_ret_borrowed(context, builder, sig.return_type, series._getvalue()) + + +@unbox(IndexType) +def unbox_index(typ, obj, c): + """ + Convert a Index object to a native structure. + """ + data = c.pyapi.object_getattr_string(obj, "_data") + index = make_index(c.context, c.builder, typ) + index.data = c.unbox(typ.as_array, data).value + + return NativeValue(index._getvalue()) + +@unbox(SeriesType) +def unbox_series(typ, obj, c): + """ + Convert a Series object to a native structure. + """ + index = c.pyapi.object_getattr_string(obj, "_index") + values = c.pyapi.object_getattr_string(obj, "_values") + series = make_series(c.context, c.builder, typ) + series.index = c.unbox(typ.index, index).value + series.values = c.unbox(typ.values, values).value + + return NativeValue(series._getvalue()) + + +@box(IndexType) +def box_index(typ, val, c): + """ + Convert a native index structure to a Index object. + """ + # First build a Numpy array object, then wrap it in a Index + index = make_index(c.context, c.builder, typ, value=val) + classobj = c.pyapi.unserialize(c.pyapi.serialize_object(typ.pyclass)) + arrayobj = c.box(typ.as_array, index.data) + indexobj = c.pyapi.call_function_objargs(classobj, (arrayobj,)) + return indexobj + +@box(SeriesType) +def box_series(typ, val, c): + """ + Convert a native series structure to a Series object. + """ + series = make_series(c.context, c.builder, typ, value=val) + classobj = c.pyapi.unserialize(c.pyapi.serialize_object(Series)) + indexobj = c.box(typ.index, series.index) + arrayobj = c.box(typ.as_array, series.values) + seriesobj = c.pyapi.call_function_objargs(classobj, (arrayobj, indexobj)) + return seriesobj + + +@overload_attribute(IndexType, 'is_monotonic_increasing') +def index_is_monotonic_increasing(index): + """ + Index.is_monotonic_increasing + """ + def getter(index): + data = index._data + if len(data) == 0: + return True + u = data[0] + for v in data: + if v < u: + return False + v = u + return True + + return getter + +@overload(len) +def series_len(series): + """ + len(Series) + """ + if isinstance(series, SeriesType): + def len_impl(series): + return len(series._values) + return len_impl + +@overload_method(SeriesType, 'clip') +def series_clip(series, lower, upper): + """ + Series.clip(...) + """ + def clip_impl(series, lower, upper): + data = series._values.copy() + for i in range(len(data)): + v = data[i] + if v < lower: + data[i] = lower + elif v > upper: + data[i] = upper + return Series(data, series._index) + + return clip_impl diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/recursion_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/recursion_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..7fa987c425584d4f4222394a8ebe8c5c2b876831 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/recursion_usecases.py @@ -0,0 +1,228 @@ +""" +Usecases of recursive functions. + +Some functions are compiled at import time, hence a separate module. +""" + +from numba import jit + + +@jit("i8(i8)", nopython=True) +def fib1(n): + if n < 2: + return n + # Note the second call uses a named argument + return fib1(n - 1) + fib1(n=n - 2) + + +def make_fib2(): + @jit("i8(i8)", nopython=True) + def fib2(n): + if n < 2: + return n + return fib2(n - 1) + fib2(n=n - 2) + + return fib2 + +fib2 = make_fib2() + + +def make_type_change_self(jit=lambda x: x): + @jit + def type_change_self(x, y): + if x > 1 and y > 0: + return x + type_change_self(x - y, y) + else: + return y + return type_change_self + + +# Implicit signature +@jit(nopython=True) +def fib3(n): + if n < 2: + return n + return fib3(n - 1) + fib3(n - 2) + + +# Run-away self recursion +@jit(nopython=True) +def runaway_self(x): + return runaway_self(x) + + +@jit(nopython=True) +def raise_self(x): + if x == 1: + raise ValueError("raise_self") + elif x > 0: + return raise_self(x - 1) + else: + return 1 + + +# Mutual recursion +@jit(nopython=True) +def outer_fac(n): + if n < 1: + return 1 + return n * inner_fac(n - 1) + + +@jit(nopython=True) +def inner_fac(n): + if n < 1: + return 1 + return n * outer_fac(n - 1) + + +# Mutual recursion with different arg names +def make_mutual2(jit=lambda x: x): + @jit + def foo(x): + if x > 0: + return 2 * bar(z=1, y=x) + return 1 + x + + @jit + def bar(y, z): + return foo(x=y - z) + + return foo, bar + + +# Mutual runaway recursion + +@jit(nopython=True) +def runaway_mutual(x): + return runaway_mutual_inner(x) + + +@jit(nopython=True) +def runaway_mutual_inner(x): + return runaway_mutual(x) + + +# Mutual type changing recursion + +def make_type_change_mutual(jit=lambda x: x): + @jit + def foo(x, y): + if x > 1 and y > 0: + # call bar first to exercise partial type inference. + # typeinferer suspended at the call to bar() and haven't determined + # the potential return type from the else-branch + return x + bar(x - y, y) + else: + return y + + @jit + def bar(x, y): + if x > 1 and y > 0: + return x + foo(x - y, y) + else: + return y + + return foo + + +# Indirect mutual recursion +def make_four_level(jit=lambda x: x): + @jit + def first(x): + # The recursing call must have a path that is non-recursing. + if x > 0: + return second(x) * 2 + else: + return 1 + + @jit + def second(x): + return third(x) * 3 + + @jit + def third(x): + return fourth(x) * 4 + + @jit + def fourth(x): + return first(x / 2 - 1) + + return first + + +def make_inner_error(jit=lambda x: x): + @jit + def outer(x): + if x > 0: + return inner(x) + + else: + return 1 + + @jit + def inner(x): + if x > 0: + return outer(x - 1) + else: + # this branch is actually never executed + return error_fun(x) + + @jit + def error_fun(x): + # to trigger an untyped attribute error + return x.ndim + + return outer + + +def make_raise_mutual(jit=lambda x: x): + @jit + def outer(x): + if x > 0: + return inner(x) + else: + return 1 + + @jit + def inner(x): + if x == 1: + raise ValueError('raise_mutual') + elif x > 0: + return outer(x - 1) + else: + return 1 + + return outer + + +def make_optional_return_case(jit=lambda x: x): + @jit + def foo(x): + if x > 5: + return x - 1 + else: + return + + @jit + def bar(x): + out = foo(x) + if out is None: + return out + elif out < 8: + return out + else: + return x * bar(out) + + return bar + + +def make_growing_tuple_case(jit=lambda x: x): + # From issue #4387 + @jit + def make_list(n): + if n <= 0: + return None + + return (n, make_list(n - 1)) + return make_list diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/serialize_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/serialize_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..af465ed4fe51c9f0b49a143a5972b2ac550e30eb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/serialize_usecases.py @@ -0,0 +1,97 @@ +""" +Separate module with function samples for serialization tests, +to avoid issues with __main__. +""" + +import math + +from numba import jit +from numba.core import types + + +@jit((types.int32, types.int32)) +def add_with_sig(a, b): + return a + b + +@jit +def add_without_sig(a, b): + return a + b + +@jit(nopython=True) +def add_nopython(a, b): + return a + b + +@jit(nopython=True) +def add_nopython_fail(a, b): + object() + return a + b + +def closure(a): + @jit(nopython=True) + def inner(b, c): + return a + b + c + return inner + +K = 3.0 + +from math import sqrt + +def closure_with_globals(x, **jit_args): + @jit(**jit_args) + def inner(y): + # Exercise a builtin function and a module-level constant + k = max(K, K + 1) + # Exercise two functions from another module, one accessed with + # dotted notation, one imported explicitly. + return math.hypot(x, y) + sqrt(k) + return inner + +@jit(nopython=True) +def other_function(x, y): + return math.hypot(x, y) + +@jit(forceobj=True) +def get_global_objmode(x): + return K * x + +import numpy as np +import numpy.random as nprand + +@jit(nopython=True) +def get_renamed_module(x): + nprand.seed(42) + return np.cos(x), nprand.random() + + +def closure_calling_other_function(x): + @jit(nopython=True) + def inner(y, z): + return other_function(x, y) + z + return inner + +def closure_calling_other_closure(x): + @jit(nopython=True) + def other_inner(y): + return math.hypot(x, y) + + @jit(nopython=True) + def inner(y): + return other_inner(y) + x + return inner + + +# A dynamic function calling a builtin function +def _get_dyn_func(**jit_args): + code = """ + def dyn_func(x): + res = 0 + for i in range(x): + res += x + return res + """ + ns = {} + exec(code.strip(), ns) + return jit(**jit_args)(ns['dyn_func']) + +dyn_func = _get_dyn_func(nopython=True) +dyn_func_objmode = _get_dyn_func(forceobj=True) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/support.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/support.py new file mode 100644 index 0000000000000000000000000000000000000000..412fa176707a631709bb40779aa18dbb926c3ec8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/support.py @@ -0,0 +1,1301 @@ +""" +Assorted utilities for use in tests. +""" + +import cmath +import contextlib +from collections import defaultdict +import enum +import gc +import math +import platform +import os +import signal +import shutil +import subprocess +import sys +import tempfile +import threading +import time +import io +import ctypes +import multiprocessing as mp +import warnings +import traceback +from contextlib import contextmanager +import uuid +import importlib +import types as pytypes +from functools import cached_property + +import numpy as np + +from numba import testing, types +from numba.core import errors, typing, utils, config, cpu +from numba.core.typing import cffi_utils +from numba.core.compiler import (compile_extra, Flags, + DEFAULT_FLAGS, CompilerBase, + DefaultPassBuilder) +from numba.core.typed_passes import IRLegalization +from numba.core.untyped_passes import PreserveIR +import unittest +from numba.core.runtime import rtsys +from numba.np import numpy_support +from numba.core.runtime import _nrt_python as _nrt +from numba.core.extending import ( + overload_method, + typeof_impl, + register_model, + unbox, + NativeValue, + models, +) +from numba.core.datamodel.models import OpaqueModel + +try: + import scipy +except ImportError: + scipy = None + +# Make sure that coverage is set up. +try: + import coverage +except ImportError: + pass +else: + coverage.process_startup() + +enable_pyobj_flags = Flags() +enable_pyobj_flags.enable_pyobject = True + +force_pyobj_flags = Flags() +force_pyobj_flags.force_pyobject = True + +no_pyobj_flags = Flags() + +nrt_flags = Flags() +nrt_flags.nrt = True + + +tag = testing.make_tag_decorator(['important', 'long_running', 'always_test']) + +# Use to mark a test as a test that must always run when sharded +always_test = tag('always_test') + +_32bit = sys.maxsize <= 2 ** 32 +is_parfors_unsupported = _32bit +skip_parfors_unsupported = unittest.skipIf( + is_parfors_unsupported, + 'parfors not supported', +) + +skip_unless_py10_or_later = unittest.skipUnless( + utils.PYVERSION >= (3, 10), + "needs Python 3.10 or later" +) + +skip_unless_py10 = unittest.skipUnless( + utils.PYVERSION == (3, 10), + "needs Python 3.10" +) + +skip_unless_py312 = unittest.skipUnless( + utils.PYVERSION == (3, 12), + "needs Python 3.12" +) + +skip_if_py313_on_windows = unittest.skipIf( + utils.PYVERSION == (3, 13) and sys.platform.startswith('win'), + "Not supported on Python 3.13 on Windows" + ) + +skip_if_32bit = unittest.skipIf(_32bit, "Not supported on 32 bit") + +IS_NUMPY_2 = numpy_support.numpy_version >= (2, 0) +skip_if_numpy_2 = unittest.skipIf(IS_NUMPY_2, + "Not supported on numpy 2.0+") + +def expected_failure_py311(fn): + if utils.PYVERSION == (3, 11): + return unittest.expectedFailure(fn) + else: + return fn + + +def expected_failure_py312(fn): + if utils.PYVERSION == (3, 12): + return unittest.expectedFailure(fn) + else: + return fn + + +def expected_failure_py313(fn): + if utils.PYVERSION == (3, 13): + return unittest.expectedFailure(fn) + else: + return fn + + +def expected_failure_np2(fn): + if numpy_support.numpy_version == (2, 0): + return unittest.expectedFailure(fn) + else: + return fn + +_msg = "SciPy needed for test" +skip_unless_scipy = unittest.skipIf(scipy is None, _msg) + +skip_unless_cffi = unittest.skipUnless(cffi_utils.SUPPORTED, 'requires cffi') + +_lnx_reason = 'linux only test' +linux_only = unittest.skipIf(not sys.platform.startswith('linux'), _lnx_reason) + +_win_reason = 'Windows-only test' +windows_only = unittest.skipIf(not sys.platform.startswith('win'), _win_reason) + +_is_armv7l = platform.machine() == 'armv7l' + +disabled_test = unittest.skipIf(True, 'Test disabled') + +# See issue #4563, PPC64LE LLVM bug +skip_ppc64le_issue4563 = unittest.skipIf(platform.machine() == 'ppc64le', + ("Hits: 'Parameter area must exist " + "to pass an argument in memory'")) + +# Typeguard +has_typeguard = bool(os.environ.get('NUMBA_USE_TYPEGUARD', 0)) + +skip_unless_typeguard = unittest.skipUnless( + has_typeguard, "Typeguard is not enabled", +) + +skip_if_typeguard = unittest.skipIf( + has_typeguard, "Broken if Typeguard is enabled", +) + +# See issue #6465, PPC64LE LLVM bug +skip_ppc64le_issue6465 = unittest.skipIf(platform.machine() == 'ppc64le', + ("Hits: 'mismatch in size of " + "parameter area' in " + "LowerCall_64SVR4")) + +# LLVM PPC issue. +# Sample error message: +# Invalid PPC CTR loop! +# UNREACHABLE executed at /llvm/lib/Target/PowerPC/PPCCTRLoops.cpp:179! +skip_ppc64le_invalid_ctr_loop = unittest.skipIf( + platform.machine() == 'ppc64le', + "Invalid PPC CTR loop") + +# fenv.h on M1 may have various issues: +# https://github.com/numba/numba/issues/7822#issuecomment-1065356758 +_uname = platform.uname() +IS_MACOS = _uname.system == 'Darwin' +skip_macos_fenv_errors = unittest.skipIf(IS_MACOS, + "fenv.h-like functionality unreliable on macOS") +IS_MACOS_ARM64 = IS_MACOS and _uname.machine == 'arm64' + +try: + import scipy.linalg.cython_lapack + has_lapack = True +except ImportError: + has_lapack = False + +needs_lapack = unittest.skipUnless(has_lapack, + "LAPACK needs SciPy 1.0+") + +try: + import scipy.linalg.cython_blas + has_blas = True +except ImportError: + has_blas = False + +needs_blas = unittest.skipUnless(has_blas, "BLAS needs SciPy 1.0+") + +# Decorate a test with @needs_subprocess to ensure it doesn't run unless the +# `SUBPROC_TEST` environment variable is set. Use this in conjunction with: +# TestCase::subprocess_test_runner which will execute a given test in subprocess +# with this environment variable set. +_exec_cond = os.environ.get('SUBPROC_TEST', None) == '1' +needs_subprocess = unittest.skipUnless(_exec_cond, "needs subprocess harness") + + +try: + import setuptools + has_setuptools = True +except ImportError: + has_setuptools = False + + +# decorator for a test that need setuptools +needs_setuptools = unittest.skipUnless(has_setuptools, 'Test needs setuptools') + + +def ignore_internal_warnings(): + """Use in testing within a ` warnings.catch_warnings` block to filter out + warnings that are unrelated/internally generated by Numba. + """ + # Filter out warnings from typeguard + warnings.filterwarnings('ignore', module="typeguard") + # Filter out warnings about TBB interface mismatch + warnings.filterwarnings(action='ignore', + message=r".*TBB_INTERFACE_VERSION.*", + category=errors.NumbaWarning, + module=r'numba\.np\.ufunc\.parallel.*') + + +class TestCase(unittest.TestCase): + + longMessage = True + + # A random state yielding the same random numbers for any test case. + # Use as `self.random.` + @cached_property + def random(self): + return np.random.RandomState(42) + + def reset_module_warnings(self, module): + """ + Reset the warnings registry of a module. This can be necessary + as the warnings module is buggy in that regard. + See http://bugs.python.org/issue4180 + """ + if isinstance(module, str): + module = sys.modules[module] + try: + del module.__warningregistry__ + except AttributeError: + pass + + @contextlib.contextmanager + def assertTypingError(self): + """ + A context manager that asserts the enclosed code block fails + compiling in nopython mode. + """ + _accepted_errors = (errors.LoweringError, errors.TypingError, + TypeError, NotImplementedError) + with self.assertRaises(_accepted_errors) as cm: + yield cm + + @contextlib.contextmanager + def assertRefCount(self, *objects): + """ + A context manager that asserts the given objects have the + same reference counts before and after executing the + enclosed block. + """ + old_refcounts = [sys.getrefcount(x) for x in objects] + yield + gc.collect() + new_refcounts = [sys.getrefcount(x) for x in objects] + for old, new, obj in zip(old_refcounts, new_refcounts, objects): + if old != new: + self.fail("Refcount changed from %d to %d for object: %r" + % (old, new, obj)) + + def assertRefCountEqual(self, *objects): + gc.collect() + rc = [sys.getrefcount(x) for x in objects] + rc_0 = rc[0] + for i in range(len(objects))[1:]: + rc_i = rc[i] + if rc_0 != rc_i: + self.fail(f"Refcount for objects does not match. " + f"#0({rc_0}) != #{i}({rc_i}) does not match.") + + @contextlib.contextmanager + def assertNoNRTLeak(self): + """ + A context manager that asserts no NRT leak was created during + the execution of the enclosed block. + """ + old = rtsys.get_allocation_stats() + yield + new = rtsys.get_allocation_stats() + total_alloc = new.alloc - old.alloc + total_free = new.free - old.free + total_mi_alloc = new.mi_alloc - old.mi_alloc + total_mi_free = new.mi_free - old.mi_free + self.assertEqual(total_alloc, total_free, + "number of data allocs != number of data frees") + self.assertEqual(total_mi_alloc, total_mi_free, + "number of meminfo allocs != number of meminfo frees") + + + _bool_types = (bool, np.bool_) + _exact_typesets = [_bool_types, (int,), (str,), (np.integer,), + (bytes, np.bytes_)] + _approx_typesets = [(float,), (complex,), (np.inexact)] + _sequence_typesets = [(tuple, list)] + _float_types = (float, np.floating) + _complex_types = (complex, np.complexfloating) + + def _detect_family(self, numeric_object): + """ + This function returns a string description of the type family + that the object in question belongs to. Possible return values + are: "exact", "complex", "approximate", "sequence", and "unknown" + """ + if isinstance(numeric_object, np.ndarray): + return "ndarray" + + if isinstance(numeric_object, enum.Enum): + return "enum" + + for tp in self._sequence_typesets: + if isinstance(numeric_object, tp): + return "sequence" + + for tp in self._exact_typesets: + if isinstance(numeric_object, tp): + return "exact" + + for tp in self._complex_types: + if isinstance(numeric_object, tp): + return "complex" + + for tp in self._approx_typesets: + if isinstance(numeric_object, tp): + return "approximate" + + return "unknown" + + def _fix_dtype(self, dtype): + """ + Fix the given *dtype* for comparison. + """ + # Under 64-bit Windows, Numpy may return either int32 or int64 + # arrays depending on the function. + if (sys.platform == 'win32' and sys.maxsize > 2**32 and + dtype == np.dtype('int32')): + return np.dtype('int64') + else: + return dtype + + def _fix_strides(self, arr): + """ + Return the strides of the given array, fixed for comparison. + Strides for 0- or 1-sized dimensions are ignored. + """ + if arr.size == 0: + return [0] * arr.ndim + else: + return [stride / arr.itemsize + for (stride, shape) in zip(arr.strides, arr.shape) + if shape > 1] + + def assertStridesEqual(self, first, second): + """ + Test that two arrays have the same shape and strides. + """ + self.assertEqual(first.shape, second.shape, "shapes differ") + self.assertEqual(first.itemsize, second.itemsize, "itemsizes differ") + self.assertEqual(self._fix_strides(first), self._fix_strides(second), + "strides differ") + + def assertPreciseEqual(self, first, second, prec='exact', ulps=1, + msg=None, ignore_sign_on_zero=False, + abs_tol=None + ): + """ + Versatile equality testing function with more built-in checks than + standard assertEqual(). + + For arrays, test that layout, dtype, shape are identical, and + recursively call assertPreciseEqual() on the contents. + + For other sequences, recursively call assertPreciseEqual() on + the contents. + + For scalars, test that two scalars or have similar types and are + equal up to a computed precision. + If the scalars are instances of exact types or if *prec* is + 'exact', they are compared exactly. + If the scalars are instances of inexact types (float, complex) + and *prec* is not 'exact', then the number of significant bits + is computed according to the value of *prec*: 53 bits if *prec* + is 'double', 24 bits if *prec* is single. This number of bits + can be lowered by raising the *ulps* value. + ignore_sign_on_zero can be set to True if zeros are to be considered + equal regardless of their sign bit. + abs_tol if this is set to a float value its value is used in the + following. If, however, this is set to the string "eps" then machine + precision of the type(first) is used in the following instead. This + kwarg is used to check if the absolute difference in value between first + and second is less than the value set, if so the numbers being compared + are considered equal. (This is to handle small numbers typically of + magnitude less than machine precision). + + Any value of *prec* other than 'exact', 'single' or 'double' + will raise an error. + """ + try: + self._assertPreciseEqual(first, second, prec, ulps, msg, + ignore_sign_on_zero, abs_tol) + except AssertionError as exc: + failure_msg = str(exc) + # Fall off of the 'except' scope to avoid Python 3 exception + # chaining. + else: + return + # Decorate the failure message with more information + self.fail("when comparing %s and %s: %s" % (first, second, failure_msg)) + + def _assertPreciseEqual(self, first, second, prec='exact', ulps=1, + msg=None, ignore_sign_on_zero=False, + abs_tol=None): + """Recursive workhorse for assertPreciseEqual().""" + + def _assertNumberEqual(first, second, delta=None): + if (delta is None or first == second == 0.0 + or math.isinf(first) or math.isinf(second)): + self.assertEqual(first, second, msg=msg) + # For signed zeros + if not ignore_sign_on_zero: + try: + if math.copysign(1, first) != math.copysign(1, second): + self.fail( + self._formatMessage(msg, + "%s != %s" % + (first, second))) + except TypeError: + pass + else: + self.assertAlmostEqual(first, second, delta=delta, msg=msg) + + first_family = self._detect_family(first) + second_family = self._detect_family(second) + + assertion_message = "Type Family mismatch. (%s != %s)" % (first_family, + second_family) + if msg: + assertion_message += ': %s' % (msg,) + self.assertEqual(first_family, second_family, msg=assertion_message) + + # We now know they are in the same comparison family + compare_family = first_family + + # For recognized sequences, recurse + if compare_family == "ndarray": + dtype = self._fix_dtype(first.dtype) + self.assertEqual(dtype, self._fix_dtype(second.dtype)) + self.assertEqual(first.ndim, second.ndim, + "different number of dimensions") + self.assertEqual(first.shape, second.shape, + "different shapes") + self.assertEqual(first.flags.writeable, second.flags.writeable, + "different mutability") + # itemsize is already checked by the dtype test above + self.assertEqual(self._fix_strides(first), + self._fix_strides(second), "different strides") + if first.dtype != dtype: + first = first.astype(dtype) + if second.dtype != dtype: + second = second.astype(dtype) + for a, b in zip(first.flat, second.flat): + self._assertPreciseEqual(a, b, prec, ulps, msg, + ignore_sign_on_zero, abs_tol) + return + + elif compare_family == "sequence": + self.assertEqual(len(first), len(second), msg=msg) + for a, b in zip(first, second): + self._assertPreciseEqual(a, b, prec, ulps, msg, + ignore_sign_on_zero, abs_tol) + return + + elif compare_family == "exact": + exact_comparison = True + + elif compare_family in ["complex", "approximate"]: + exact_comparison = False + + elif compare_family == "enum": + self.assertIs(first.__class__, second.__class__) + self._assertPreciseEqual(first.value, second.value, + prec, ulps, msg, + ignore_sign_on_zero, abs_tol) + return + + elif compare_family == "unknown": + # Assume these are non-numeric types: we will fall back + # on regular unittest comparison. + self.assertIs(first.__class__, second.__class__) + exact_comparison = True + + else: + assert 0, "unexpected family" + + # If a Numpy scalar, check the dtype is exactly the same too + # (required for datetime64 and timedelta64). + if hasattr(first, 'dtype') and hasattr(second, 'dtype'): + self.assertEqual(first.dtype, second.dtype) + + # Mixing bools and non-bools should always fail + if (isinstance(first, self._bool_types) != + isinstance(second, self._bool_types)): + assertion_message = ("Mismatching return types (%s vs. %s)" + % (first.__class__, second.__class__)) + if msg: + assertion_message += ': %s' % (msg,) + self.fail(assertion_message) + + try: + if cmath.isnan(first) and cmath.isnan(second): + # The NaNs will compare unequal, skip regular comparison + return + except TypeError: + # Not floats. + pass + + # if absolute comparison is set, use it + if abs_tol is not None: + if abs_tol == "eps": + rtol = np.finfo(type(first)).eps + elif isinstance(abs_tol, float): + rtol = abs_tol + else: + raise ValueError("abs_tol is not \"eps\" or a float, found %s" + % abs_tol) + if abs(first - second) < rtol: + return + + exact_comparison = exact_comparison or prec == 'exact' + + if not exact_comparison and prec != 'exact': + if prec == 'single': + bits = 24 + elif prec == 'double': + bits = 53 + else: + raise ValueError("unsupported precision %r" % (prec,)) + k = 2 ** (ulps - bits - 1) + delta = k * (abs(first) + abs(second)) + else: + delta = None + if isinstance(first, self._complex_types): + _assertNumberEqual(first.real, second.real, delta) + _assertNumberEqual(first.imag, second.imag, delta) + elif isinstance(first, (np.timedelta64, np.datetime64)): + # Since Np 1.16 NaT == NaT is False, so special comparison needed + if np.isnat(first): + self.assertEqual(np.isnat(first), np.isnat(second)) + else: + _assertNumberEqual(first, second, delta) + else: + _assertNumberEqual(first, second, delta) + + def subprocess_test_runner(self, test_module, test_class=None, + test_name=None, envvars=None, timeout=60, + flags=None, _subproc_test_env="1"): + """ + Runs named unit test(s) as specified in the arguments as: + test_module.test_class.test_name. test_module must always be supplied + and if no further refinement is made with test_class and test_name then + all tests in the module will be run. The tests will be run in a + subprocess with environment variables specified in `envvars`. + If given, envvars must be a map of form: + environment variable name (str) -> value (str) + If given, flags must be a map of form: + flag including the `-` (str) -> value (str) + It is most convenient to use this method in conjunction with + @needs_subprocess as the decorator will cause the decorated test to be + skipped unless the `SUBPROC_TEST` environment variable is set to + the same value of ``_subproc_test_env`` + (this special environment variable is set by this method such that the + specified test(s) will not be skipped in the subprocess). + + + Following execution in the subprocess this method will check the test(s) + executed without error. The timeout kwarg can be used to allow more time + for longer running tests, it defaults to 60 seconds. + """ + themod = self.__module__ + thecls = type(self).__name__ + parts = (test_module, test_class, test_name) + fully_qualified_test = '.'.join(x for x in parts if x is not None) + flags_args = [] + if flags is not None: + for flag, value in flags.items(): + flags_args.append(f'{flag}') + flags_args.append(f'{value}') + cmd = [sys.executable, *flags_args, '-m', 'numba.runtests', + fully_qualified_test] + env_copy = os.environ.copy() + env_copy['SUBPROC_TEST'] = _subproc_test_env + try: + env_copy['COVERAGE_PROCESS_START'] = os.environ['COVERAGE_RCFILE'] + except KeyError: + pass # ignored + envvars = pytypes.MappingProxyType({} if envvars is None else envvars) + env_copy.update(envvars) + status = subprocess.run(cmd, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, timeout=timeout, + env=env_copy, universal_newlines=True) + streams = (f'\ncaptured stdout: {status.stdout}\n' + f'captured stderr: {status.stderr}') + self.assertEqual(status.returncode, 0, streams) + # Python 3.12.1 report + no_tests_ran = "NO TESTS RAN" + if no_tests_ran in status.stderr: + self.skipTest(no_tests_ran) + else: + self.assertIn('OK', status.stderr) + return status + + def run_test_in_subprocess(maybefunc=None, timeout=60, envvars=None): + """Runs the decorated test in a subprocess via invoking numba's test + runner. kwargs timeout and envvars are passed through to + subprocess_test_runner.""" + def wrapper(func): + def inner(self, *args, **kwargs): + if os.environ.get("SUBPROC_TEST", None) != func.__name__: + # Not in a subprocess test env, so stage the call to run the + # test in a subprocess which will set the env var. + class_name = self.__class__.__name__ + self.subprocess_test_runner( + test_module=self.__module__, + test_class=class_name, + test_name=func.__name__, + timeout=timeout, + envvars=envvars, + _subproc_test_env=func.__name__, + ) + else: + # env var is set, so we're in the subprocess, run the + # actual test. + func(self) + return inner + + if isinstance(maybefunc, pytypes.FunctionType): + return wrapper(maybefunc) + else: + return wrapper + + def make_dummy_type(self): + """Use to generate a dummy type unique to this test. Returns a python + Dummy class and a corresponding Numba type DummyType.""" + + # Use test_id to make sure no collision is possible. + test_id = self.id() + DummyType = type('DummyTypeFor{}'.format(test_id), (types.Opaque,), {}) + + dummy_type = DummyType("my_dummy") + register_model(DummyType)(OpaqueModel) + + class Dummy(object): + pass + + @typeof_impl.register(Dummy) + def typeof_dummy(val, c): + return dummy_type + + @unbox(DummyType) + def unbox_dummy(typ, obj, c): + return NativeValue(c.context.get_dummy_value()) + + return Dummy, DummyType + + def skip_if_no_external_compiler(self): + """ + Call this to ensure the test is skipped if no suitable external compiler + is found. This is a method on the TestCase opposed to a stand-alone + decorator so as to make it "lazy" via runtime evaluation opposed to + running at test-discovery time. + """ + # This is a local import to avoid deprecation warnings being generated + # through the use of the numba.pycc module. + from numba.pycc.platform import external_compiler_works + if not external_compiler_works(): + self.skipTest("No suitable external compiler was found.") + + +class SerialMixin(object): + """Mixin to mark test for serial execution. + """ + _numba_parallel_test_ = False + + +# Various helpers + +@contextlib.contextmanager +def override_config(name, value): + """ + Return a context manager that temporarily sets Numba config variable + *name* to *value*. *name* must be the name of an existing variable + in numba.config. + """ + old_value = getattr(config, name) + setattr(config, name, value) + try: + yield + finally: + setattr(config, name, old_value) + + +@contextlib.contextmanager +def override_env_config(name, value): + """ + Return a context manager that temporarily sets an Numba config environment + *name* to *value*. + """ + old = os.environ.get(name) + os.environ[name] = value + config.reload_config() + + try: + yield + finally: + if old is None: + # If it wasn't set originally, delete the environ var + del os.environ[name] + else: + # Otherwise, restore to the old value + os.environ[name] = old + # Always reload config + config.reload_config() + + +def compile_function(name, code, globs): + """ + Given a *code* string, compile it with globals *globs* and return + the function named *name*. + """ + co = compile(code.rstrip(), "", "single") + ns = {} + eval(co, globs, ns) + return ns[name] + + +_trashcan_dir = 'numba-tests' + +if os.name == 'nt': + # Under Windows, gettempdir() points to the user-local temp dir + _trashcan_dir = os.path.join(tempfile.gettempdir(), _trashcan_dir) +else: + # Mix the UID into the directory name to allow different users to + # run the test suite without permission errors (issue #1586) + _trashcan_dir = os.path.join(tempfile.gettempdir(), + "%s.%s" % (_trashcan_dir, os.getuid())) + +# Stale temporary directories are deleted after they are older than this value. +# The test suite probably won't ever take longer than this... +_trashcan_timeout = 24 * 3600 # 1 day + +def _create_trashcan_dir(): + try: + os.mkdir(_trashcan_dir) + except FileExistsError: + pass + +def _purge_trashcan_dir(): + freshness_threshold = time.time() - _trashcan_timeout + for fn in sorted(os.listdir(_trashcan_dir)): + fn = os.path.join(_trashcan_dir, fn) + try: + st = os.stat(fn) + if st.st_mtime < freshness_threshold: + shutil.rmtree(fn, ignore_errors=True) + except OSError as e: + # In parallel testing, several processes can attempt to + # remove the same entry at once, ignore. + pass + +def _create_trashcan_subdir(prefix): + _purge_trashcan_dir() + path = tempfile.mkdtemp(prefix=prefix + '-', dir=_trashcan_dir) + return path + +def temp_directory(prefix): + """ + Create a temporary directory with the given *prefix* that will survive + at least as long as this process invocation. The temporary directory + will be eventually deleted when it becomes stale enough. + + This is necessary because a DLL file can't be deleted while in use + under Windows. + + An interesting side-effect is to be able to inspect the test files + shortly after a test suite run. + """ + _create_trashcan_dir() + return _create_trashcan_subdir(prefix) + + +def import_dynamic(modname): + """ + Import and return a module of the given name. Care is taken to + avoid issues due to Python's internal directory caching. + """ + import importlib + importlib.invalidate_caches() + __import__(modname) + return sys.modules[modname] + + +# From CPython + +@contextlib.contextmanager +def captured_output(stream_name): + """Return a context manager used by captured_stdout/stdin/stderr + that temporarily replaces the sys stream *stream_name* with a StringIO.""" + orig_stdout = getattr(sys, stream_name) + setattr(sys, stream_name, io.StringIO()) + try: + yield getattr(sys, stream_name) + finally: + setattr(sys, stream_name, orig_stdout) + +def captured_stdout(): + """Capture the output of sys.stdout: + + with captured_stdout() as stdout: + print("hello") + self.assertEqual(stdout.getvalue(), "hello\n") + """ + return captured_output("stdout") + +def captured_stderr(): + """Capture the output of sys.stderr: + + with captured_stderr() as stderr: + print("hello", file=sys.stderr) + self.assertEqual(stderr.getvalue(), "hello\n") + """ + return captured_output("stderr") + + +@contextlib.contextmanager +def capture_cache_log(): + with captured_stdout() as out: + with override_config('DEBUG_CACHE', True): + yield out + + +class EnableNRTStatsMixin(object): + """Mixin to enable the NRT statistics counters.""" + + def setUp(self): + _nrt.memsys_enable_stats() + + def tearDown(self): + _nrt.memsys_disable_stats() + + +class MemoryLeak(object): + + __enable_leak_check = True + + def memory_leak_setup(self): + # Clean up any NRT-backed objects hanging in a dead reference cycle + gc.collect() + self.__init_stats = rtsys.get_allocation_stats() + + def memory_leak_teardown(self): + if self.__enable_leak_check: + self.assert_no_memory_leak() + + def assert_no_memory_leak(self): + old = self.__init_stats + new = rtsys.get_allocation_stats() + total_alloc = new.alloc - old.alloc + total_free = new.free - old.free + total_mi_alloc = new.mi_alloc - old.mi_alloc + total_mi_free = new.mi_free - old.mi_free + self.assertEqual(total_alloc, total_free) + self.assertEqual(total_mi_alloc, total_mi_free) + + def disable_leak_check(self): + # For per-test use when MemoryLeakMixin is injected into a TestCase + self.__enable_leak_check = False + + +class MemoryLeakMixin(EnableNRTStatsMixin, MemoryLeak): + + def setUp(self): + super(MemoryLeakMixin, self).setUp() + self.memory_leak_setup() + + def tearDown(self): + gc.collect() + self.memory_leak_teardown() + super(MemoryLeakMixin, self).tearDown() + + +@contextlib.contextmanager +def forbid_codegen(): + """ + Forbid LLVM code generation during the execution of the context + manager's enclosed block. + + If code generation is invoked, a RuntimeError is raised. + """ + from numba.core import codegen + patchpoints = ['CPUCodeLibrary._finalize_final_module'] + + old = {} + def fail(*args, **kwargs): + raise RuntimeError("codegen forbidden by test case") + try: + # XXX use the mock library instead? + for name in patchpoints: + parts = name.split('.') + obj = codegen + for attrname in parts[:-1]: + obj = getattr(obj, attrname) + attrname = parts[-1] + value = getattr(obj, attrname) + assert callable(value), ("%r should be callable" % name) + old[obj, attrname] = value + setattr(obj, attrname, fail) + yield + finally: + for (obj, attrname), value in old.items(): + setattr(obj, attrname, value) + + +# For details about redirection of file-descriptor, read +# https://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/ + +@contextlib.contextmanager +def redirect_fd(fd): + """ + Temporarily redirect *fd* to a pipe's write end and return a file object + wrapping the pipe's read end. + """ + + from numba import _helperlib + libnumba = ctypes.CDLL(_helperlib.__file__) + + libnumba._numba_flush_stdout() + save = os.dup(fd) + r, w = os.pipe() + try: + os.dup2(w, fd) + yield io.open(r, "r") + finally: + libnumba._numba_flush_stdout() + os.close(w) + os.dup2(save, fd) + os.close(save) + + +def redirect_c_stdout(): + """Redirect C stdout + """ + fd = sys.__stdout__.fileno() + return redirect_fd(fd) + + +def redirect_c_stderr(): + """Redirect C stderr + """ + fd = sys.__stderr__.fileno() + return redirect_fd(fd) + + +def run_in_new_process_caching(func, cache_dir_prefix=__name__, verbose=True): + """Spawn a new process to run `func` with a temporary cache directory. + + The childprocess's stdout and stderr will be captured and redirected to + the current process's stdout and stderr. + + Returns + ------- + ret : dict + exitcode: 0 for success. 1 for exception-raised. + stdout: str + stderr: str + """ + cache_dir = temp_directory(cache_dir_prefix) + return run_in_new_process_in_cache_dir(func, cache_dir, verbose=verbose) + + +def run_in_new_process_in_cache_dir(func, cache_dir, verbose=True): + """Spawn a new process to run `func` with a temporary cache directory. + + The childprocess's stdout and stderr will be captured and redirected to + the current process's stdout and stderr. + + Similar to ``run_in_new_process_caching()`` but the ``cache_dir`` is a + directory path instead of a name prefix for the directory path. + + Returns + ------- + ret : dict + exitcode: 0 for success. 1 for exception-raised. + stdout: str + stderr: str + """ + ctx = mp.get_context('spawn') + qout = ctx.Queue() + with override_env_config('NUMBA_CACHE_DIR', cache_dir): + proc = ctx.Process(target=_remote_runner, args=[func, qout]) + proc.start() + proc.join() + stdout = qout.get_nowait() + stderr = qout.get_nowait() + if verbose and stdout.strip(): + print() + print('STDOUT'.center(80, '-')) + print(stdout) + if verbose and stderr.strip(): + print(file=sys.stderr) + print('STDERR'.center(80, '-'), file=sys.stderr) + print(stderr, file=sys.stderr) + return { + 'exitcode': proc.exitcode, + 'stdout': stdout, + 'stderr': stderr, + } + + +def _remote_runner(fn, qout): + """Used by `run_in_new_process_caching()` + """ + with captured_stderr() as stderr: + with captured_stdout() as stdout: + try: + fn() + except Exception: + traceback.print_exc() + exitcode = 1 + else: + exitcode = 0 + qout.put(stdout.getvalue()) + qout.put(stderr.getvalue()) + sys.exit(exitcode) + +class CheckWarningsMixin(object): + @contextlib.contextmanager + def check_warnings(self, messages, category=RuntimeWarning): + with warnings.catch_warnings(record=True) as catch: + warnings.simplefilter("always") + yield + found = 0 + for w in catch: + for m in messages: + if m in str(w.message): + self.assertEqual(w.category, category) + found += 1 + self.assertEqual(found, len(messages)) + + +def _format_jit_options(**jit_options): + if not jit_options: + return '' + out = [] + for key, value in jit_options.items(): + if isinstance(value, str): + value = '"{}"'.format(value) + out.append('{}={}'.format(key, value)) + return ', '.join(out) + + +@contextlib.contextmanager +def create_temp_module(source_lines, **jit_options): + """A context manager that creates and imports a temporary module + from sources provided in ``source_lines``. + + Optionally it is possible to provide jit options for ``jit_module`` if it + is explicitly used in ``source_lines`` like ``jit_module({jit_options})``. + """ + # Use try/finally so cleanup happens even when an exception is raised + try: + tempdir = temp_directory('test_temp_module') + # Generate random module name + temp_module_name = 'test_temp_module_{}'.format( + str(uuid.uuid4()).replace('-', '_')) + temp_module_path = os.path.join(tempdir, temp_module_name + '.py') + + jit_options = _format_jit_options(**jit_options) + with open(temp_module_path, 'w') as f: + lines = source_lines.format(jit_options=jit_options) + f.write(lines) + # Add test_module to sys.path so it can be imported + sys.path.insert(0, tempdir) + test_module = importlib.import_module(temp_module_name) + yield test_module + finally: + sys.modules.pop(temp_module_name, None) + sys.path.remove(tempdir) + shutil.rmtree(tempdir) + + +def run_in_subprocess(code, flags=None, env=None, timeout=30): + """Run a snippet of Python code in a subprocess with flags, if any are + given. 'env' is passed to subprocess.Popen(). 'timeout' is passed to + popen.communicate(). + + Returns the stdout and stderr of the subprocess after its termination. + """ + if flags is None: + flags = [] + cmd = [sys.executable,] + flags + ["-c", code] + popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, env=env) + out, err = popen.communicate(timeout=timeout) + if popen.returncode != 0: + msg = "process failed with code %s: stderr follows\n%s\n" + raise AssertionError(msg % (popen.returncode, err.decode())) + return out, err + + +def strace(work, syscalls, timeout=10): + """Runs strace whilst executing the function work() in the current process, + captures the listed syscalls (list of strings). Takes an optional timeout in + seconds, default is 10, if this is exceeded the process will be sent a + SIGKILL. Returns a list of lines that are output by strace. + """ + + # Open a tmpfile for strace to write into. + with tempfile.NamedTemporaryFile('w+t') as ntf: + + parent_pid = os.getpid() + strace_binary = shutil.which('strace') + if strace_binary is None: + raise ValueError("No valid 'strace' binary could be found") + cmd = [strace_binary, # strace + '-q', # quietly (no attach/detach print out) + '-p', str(parent_pid), # this PID + '-e', ','.join(syscalls), # these syscalls + '-o', ntf.name] # put output into this file + + # redirect stdout, stderr is handled by the `-o` flag to strace. + popen = subprocess.Popen(cmd, stdout=subprocess.PIPE,) + strace_pid = popen.pid + thread_timeout = threading.Timer(timeout, popen.kill) + thread_timeout.start() + + def check_return(problem=''): + ret = popen.returncode + if ret != 0: + msg = ("strace exited non-zero, process return code was:" + f"{ret}. {problem}") + raise RuntimeError(msg) + try: + # push the communication onto a thread so it doesn't block. + # start comms thread + thread_comms = threading.Thread(target=popen.communicate) + thread_comms.start() + + # do work + work() + # Flush the output buffer file + ntf.flush() + # interrupt the strace process to stop it if it's still running + if popen.poll() is None: + os.kill(strace_pid, signal.SIGINT) + else: + # it's not running, probably an issue, raise + problem="If this is SIGKILL, increase the timeout?" + check_return(problem) + # Make sure the return code is 0, SIGINT to detach is considered + # a successful exit. + popen.wait() + check_return() + # collect the data + strace_data = ntf.readlines() + finally: + # join communication, should be stopped now as process has + # exited + thread_comms.join() + # should be stopped already + thread_timeout.cancel() + + return strace_data + + +def strace_supported(): + """Checks if strace is supported and working""" + + # Only support this on linux where the `strace` binary is likely to be the + # strace needed. + if not sys.platform.startswith('linux'): + return False + + def force_clone(): # subprocess triggers a clone + subprocess.run([sys.executable, '-c', 'exit()']) + + syscall = 'clone' + try: + trace = strace(force_clone, [syscall,]) + except Exception: + return False + return syscall in ''.join(trace) + + +class IRPreservingTestPipeline(CompilerBase): + """ Same as the standard pipeline, but preserves the func_ir into the + metadata store after legalisation, useful for testing IR changes""" + + def define_pipelines(self): + pipeline = DefaultPassBuilder.define_nopython_pipeline( + self.state, "ir_preserving_custom_pipe") + # mangle the default pipeline and inject DCE and IR preservation ahead + # of legalisation + + # TODO: add a way to not do this! un-finalizing is not a good idea + pipeline._finalized = False + pipeline.add_pass_after(PreserveIR, IRLegalization) + + pipeline.finalize() + return [pipeline] + + +def print_azure_matrix(): + """This is a utility function that prints out the map of NumPy to Python + versions and how many of that combination are being tested across all the + declared config for azure-pipelines. It is useful to run when updating the + azure-pipelines config to be able to quickly see what the coverage is.""" + import yaml + from yaml import Loader + base_path = os.path.dirname(os.path.abspath(__file__)) + azure_pipe = os.path.join(base_path, '..', '..', 'azure-pipelines.yml') + if not os.path.isfile(azure_pipe): + raise RuntimeError("'azure-pipelines.yml' is not available") + with open(os.path.abspath(azure_pipe), 'rt') as f: + data = f.read() + pipe_yml = yaml.load(data, Loader=Loader) + + templates = pipe_yml['jobs'] + # first look at the items in the first two templates, this is osx/linux + py2np_map = defaultdict(lambda: defaultdict(int)) + for tmplt in templates[:2]: + matrix = tmplt['parameters']['matrix'] + for setup in matrix.values(): + py2np_map[setup['NUMPY']][setup['PYTHON']]+=1 + + # next look at the items in the windows only template + winpath = ['..', '..', 'buildscripts', 'azure', 'azure-windows.yml'] + azure_windows = os.path.join(base_path, *winpath) + if not os.path.isfile(azure_windows): + raise RuntimeError("'azure-windows.yml' is not available") + with open(os.path.abspath(azure_windows), 'rt') as f: + data = f.read() + windows_yml = yaml.load(data, Loader=Loader) + + # There's only one template in windows and its keyed differently to the + # above, get its matrix. + matrix = windows_yml['jobs'][0]['strategy']['matrix'] + for setup in matrix.values(): + py2np_map[setup['NUMPY']][setup['PYTHON']]+=1 + + print("NumPy | Python | Count") + print("-----------------------") + for npver, pys in sorted(py2np_map.items()): + for pyver, count in pys.items(): + print(f" {npver} | {pyver:<4} | {count}") + + # print the "reverse" map + rev_map = defaultdict(lambda: defaultdict(int)) + for npver, pys in sorted(py2np_map.items()): + for pyver, count in pys.items(): + rev_map[pyver][npver] = count + print("\nPython | NumPy | Count") + print("-----------------------") + sorter = lambda x: int(x[0].split('.')[1]) + for pyver, nps in sorted(rev_map.items(), key=sorter): + for npver, count in nps.items(): + print(f" {pyver:<4} | {npver} | {count}") diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_alignment.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_alignment.py new file mode 100644 index 0000000000000000000000000000000000000000..77eee17b26e1ee10985b99a5d192907cc890534d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_alignment.py @@ -0,0 +1,40 @@ +# See also numba.cuda.tests.test_alignment + +import numpy as np +from numba import from_dtype, njit, void +from numba.tests.support import TestCase + + +class TestAlignment(TestCase): + + def test_record_alignment(self): + rec_dtype = np.dtype([('a', 'int32'), ('b', 'float64')], align=True) + rec = from_dtype(rec_dtype) + + @njit((rec[:],)) + def foo(a): + for i in range(a.size): + a[i].a = a[i].b + + a_recarray = np.recarray(3, dtype=rec_dtype) + for i in range(a_recarray.size): + a_rec = a_recarray[i] + a_rec.a = 0 + a_rec.b = (i + 1) * 123 + + foo(a_recarray) + np.testing.assert_equal(a_recarray.a, a_recarray.b) + + def test_record_misaligned(self): + rec_dtype = np.dtype([('a', 'int32'), ('b', 'float64')]) + rec = from_dtype(rec_dtype) + + # Unlike the CUDA target, this will not generate an error + @njit((rec[:],)) + def foo(a): + for i in range(a.size): + a[i].a = a[i].b + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_analysis.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_analysis.py new file mode 100644 index 0000000000000000000000000000000000000000..c50defe335e09a0af1e4e7a2ba5a97dd4e85fc6c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_analysis.py @@ -0,0 +1,1007 @@ +# Tests numba.analysis functions +import collections +import types as pytypes + +import numpy as np +from numba.core.compiler import run_frontend, Flags, StateDict +from numba import jit, njit, literal_unroll +from numba.core import types, errors, ir, rewrites, ir_utils, cpu +from numba.core import postproc +from numba.core.inline_closurecall import InlineClosureCallPass +from numba.tests.support import (TestCase, MemoryLeakMixin, SerialMixin, + IRPreservingTestPipeline) +from numba.core.analysis import dead_branch_prune, rewrite_semantic_constants +from numba.core.untyped_passes import (ReconstructSSA, TranslateByteCode, + IRProcessing, DeadBranchPrune, + PreserveIR) +from numba.core.compiler import DefaultPassBuilder, CompilerBase, PassManager + + +_GLOBAL = 123 + +enable_pyobj_flags = Flags() +enable_pyobj_flags.enable_pyobject = True + + +def compile_to_ir(func): + func_ir = run_frontend(func) + state = StateDict() + state.func_ir = func_ir + state.typemap = None + state.calltypes = None + # Transform to SSA + ReconstructSSA().run_pass(state) + # call this to get print etc rewrites + rewrites.rewrite_registry.apply('before-inference', state) + return func_ir + + +class TestBranchPruneBase(MemoryLeakMixin, TestCase): + """ + Tests branch pruning + """ + _DEBUG = False + + # find *all* branches + def find_branches(self, the_ir): + branches = [] + for blk in the_ir.blocks.values(): + tmp = [_ for _ in blk.find_insts(cls=ir.Branch)] + branches.extend(tmp) + return branches + + def assert_prune(self, func, args_tys, prune, *args, **kwargs): + # This checks that the expected pruned branches have indeed been pruned. + # func is a python function to assess + # args_tys is the numba types arguments tuple + # prune arg is a list, one entry per branch. The value in the entry is + # encoded as follows: + # True: using constant inference only, the True branch will be pruned + # False: using constant inference only, the False branch will be pruned + # None: under no circumstances should this branch be pruned + # *args: the argument instances to pass to the function to check + # execution is still valid post transform + # **kwargs: + # - flags: args to pass to `jit` default is `nopython=True`, + # e.g. permits use of e.g. object mode. + + func_ir = compile_to_ir(func) + before = func_ir.copy() + if self._DEBUG: + print("=" * 80) + print("before inline") + func_ir.dump() + + # run closure inlining to ensure that nonlocals in closures are visible + inline_pass = InlineClosureCallPass(func_ir, + cpu.ParallelOptions(False),) + inline_pass.run() + + # Remove all Dels, and re-run postproc + post_proc = postproc.PostProcessor(func_ir) + post_proc.run() + + rewrite_semantic_constants(func_ir, args_tys) + if self._DEBUG: + print("=" * 80) + print("before prune") + func_ir.dump() + + dead_branch_prune(func_ir, args_tys) + + after = func_ir + if self._DEBUG: + print("after prune") + func_ir.dump() + + before_branches = self.find_branches(before) + self.assertEqual(len(before_branches), len(prune)) + + # what is expected to be pruned + expect_removed = [] + for idx, prune in enumerate(prune): + branch = before_branches[idx] + if prune is True: + expect_removed.append(branch.truebr) + elif prune is False: + expect_removed.append(branch.falsebr) + elif prune is None: + pass # nothing should be removed! + elif prune == 'both': + expect_removed.append(branch.falsebr) + expect_removed.append(branch.truebr) + else: + assert 0, "unreachable" + + # compare labels + original_labels = set([_ for _ in before.blocks.keys()]) + new_labels = set([_ for _ in after.blocks.keys()]) + # assert that the new labels are precisely the original less the + # expected pruned labels + try: + self.assertEqual(new_labels, original_labels - set(expect_removed)) + except AssertionError as e: + print("new_labels", sorted(new_labels)) + print("original_labels", sorted(original_labels)) + print("expect_removed", sorted(expect_removed)) + raise e + + supplied_flags = kwargs.pop('flags', {'nopython': True}) + # NOTE: original testing used `compile_isolated` hence use of `cres`. + cres = jit(args_tys, **supplied_flags)(func).overloads[args_tys] + if args is None: + res = cres.entry_point() + expected = func() + else: + res = cres.entry_point(*args) + expected = func(*args) + self.assertEqual(res, expected) + + +class TestBranchPrune(TestBranchPruneBase, SerialMixin): + + def test_single_if(self): + + def impl(x): + if 1 == 0: + return 3.14159 + + self.assert_prune(impl, (types.NoneType('none'),), [True], None) + + def impl(x): + if 1 == 1: + return 3.14159 + + self.assert_prune(impl, (types.NoneType('none'),), [False], None) + + def impl(x): + if x is None: + return 3.14159 + + self.assert_prune(impl, (types.NoneType('none'),), [False], None) + self.assert_prune(impl, (types.IntegerLiteral(10),), [True], 10) + + def impl(x): + if x == 10: + return 3.14159 + + self.assert_prune(impl, (types.NoneType('none'),), [True], None) + self.assert_prune(impl, (types.IntegerLiteral(10),), [None], 10) + + def impl(x): + if x == 10: + z = 3.14159 # noqa: F841 # no effect + + self.assert_prune(impl, (types.NoneType('none'),), [True], None) + self.assert_prune(impl, (types.IntegerLiteral(10),), [None], 10) + + def impl(x): + z = None + y = z + if x == y: + return 100 + + self.assert_prune(impl, (types.NoneType('none'),), [False], None) + self.assert_prune(impl, (types.IntegerLiteral(10),), [True], 10) + + def test_single_if_else(self): + + def impl(x): + if x is None: + return 3.14159 + else: + return 1.61803 + + self.assert_prune(impl, (types.NoneType('none'),), [False], None) + self.assert_prune(impl, (types.IntegerLiteral(10),), [True], 10) + + def test_single_if_const_val(self): + + def impl(x): + if x == 100: + return 3.14159 + + self.assert_prune(impl, (types.NoneType('none'),), [True], None) + self.assert_prune(impl, (types.IntegerLiteral(100),), [None], 100) + + def impl(x): + # switch the condition order + if 100 == x: + return 3.14159 + + self.assert_prune(impl, (types.NoneType('none'),), [True], None) + self.assert_prune(impl, (types.IntegerLiteral(100),), [None], 100) + + def test_single_if_else_two_const_val(self): + + def impl(x, y): + if x == y: + return 3.14159 + else: + return 1.61803 + + self.assert_prune(impl, (types.IntegerLiteral(100),) * 2, [None], 100, + 100) + self.assert_prune(impl, (types.NoneType('none'),) * 2, [False], None, + None) + self.assert_prune(impl, (types.IntegerLiteral(100), + types.NoneType('none'),), [True], 100, None) + self.assert_prune(impl, (types.IntegerLiteral(100), + types.IntegerLiteral(1000)), [None], 100, 1000) + + def test_single_if_else_w_following_undetermined(self): + + def impl(x): + x_is_none_work = False + if x is None: + x_is_none_work = True + else: + dead = 7 # noqa: F841 # no effect + + if x_is_none_work: + y = 10 + else: + y = -3 + return y + + self.assert_prune(impl, (types.NoneType('none'),), [False, None], None) + self.assert_prune(impl, (types.IntegerLiteral(10),), [True, None], 10) + + def impl(x): + x_is_none_work = False + if x is None: + x_is_none_work = True + else: + pass + + if x_is_none_work: + y = 10 + else: + y = -3 + return y + + # Python 3.10 creates a block with a NOP in it for the `pass` which + # means it gets pruned. + self.assert_prune(impl, (types.NoneType('none'),), [False, None], + None) + + self.assert_prune(impl, (types.IntegerLiteral(10),), [True, None], 10) + + def test_double_if_else_rt_const(self): + + def impl(x): + one_hundred = 100 + x_is_none_work = 4 + if x is None: + x_is_none_work = 100 + else: + dead = 7 # noqa: F841 # no effect + + if x_is_none_work == one_hundred: + y = 10 + else: + y = -3 + + return y, x_is_none_work + + self.assert_prune(impl, (types.NoneType('none'),), [False, None], None) + self.assert_prune(impl, (types.IntegerLiteral(10),), [True, None], 10) + + def test_double_if_else_non_literal_const(self): + + def impl(x): + one_hundred = 100 + if x == one_hundred: + y = 3.14159 + else: + y = 1.61803 + return y + + # no prune as compilation specialization on literal value not permitted + self.assert_prune(impl, (types.IntegerLiteral(10),), [None], 10) + self.assert_prune(impl, (types.IntegerLiteral(100),), [None], 100) + + def test_single_two_branches_same_cond(self): + + def impl(x): + if x is None: + y = 10 + else: + y = 40 + + if x is not None: + z = 100 + else: + z = 400 + + return z, y + + self.assert_prune(impl, (types.NoneType('none'),), [False, True], None) + self.assert_prune(impl, (types.IntegerLiteral(10),), [True, False], 10) + + def test_cond_is_kwarg_none(self): + + def impl(x=None): + if x is None: + y = 10 + else: + y = 40 + + if x is not None: + z = 100 + else: + z = 400 + + return z, y + + self.assert_prune(impl, (types.Omitted(None),), + [False, True], None) + self.assert_prune(impl, (types.NoneType('none'),), [False, True], None) + self.assert_prune(impl, (types.IntegerLiteral(10),), [True, False], 10) + + def test_cond_is_kwarg_value(self): + + def impl(x=1000): + if x == 1000: + y = 10 + else: + y = 40 + + if x != 1000: + z = 100 + else: + z = 400 + + return z, y + + self.assert_prune(impl, (types.Omitted(1000),), [None, None], 1000) + self.assert_prune(impl, (types.IntegerLiteral(1000),), [None, None], + 1000) + self.assert_prune(impl, (types.IntegerLiteral(0),), [None, None], 0) + self.assert_prune(impl, (types.NoneType('none'),), [True, False], None) + + def test_cond_rewrite_is_correct(self): + # this checks that when a condition is replaced, it is replace by a + # true/false bit that correctly represents the evaluated condition + def fn(x): + if x is None: + return 10 + return 12 + + def check(func, arg_tys, bit_val): + func_ir = compile_to_ir(func) + + # check there is 1 branch + before_branches = self.find_branches(func_ir) + self.assertEqual(len(before_branches), 1) + + # check the condition in the branch is a binop + pred_var = before_branches[0].cond + pred_defn = ir_utils.get_definition(func_ir, pred_var) + self.assertEqual(pred_defn.op, 'call') + condition_var = pred_defn.args[0] + condition_op = ir_utils.get_definition(func_ir, condition_var) + self.assertEqual(condition_op.op, 'binop') + + # do the prune, this should kill the dead branch and rewrite the + #'condition to a true/false const bit + if self._DEBUG: + print("=" * 80) + print("before prune") + func_ir.dump() + dead_branch_prune(func_ir, arg_tys) + if self._DEBUG: + print("=" * 80) + print("after prune") + func_ir.dump() + + # after mutation, the condition should be a const value `bit_val` + new_condition_defn = ir_utils.get_definition(func_ir, condition_var) + self.assertTrue(isinstance(new_condition_defn, ir.Const)) + self.assertEqual(new_condition_defn.value, bit_val) + + check(fn, (types.NoneType('none'),), 1) + check(fn, (types.IntegerLiteral(10),), 0) + + def test_global_bake_in(self): + + def impl(x): + if _GLOBAL == 123: + return x + else: + return x + 10 + + self.assert_prune(impl, (types.IntegerLiteral(1),), [False], 1) + + global _GLOBAL + tmp = _GLOBAL + + try: + _GLOBAL = 5 + + def impl(x): + if _GLOBAL == 123: + return x + else: + return x + 10 + + self.assert_prune(impl, (types.IntegerLiteral(1),), [True], 1) + finally: + _GLOBAL = tmp + + def test_freevar_bake_in(self): + + _FREEVAR = 123 + + def impl(x): + if _FREEVAR == 123: + return x + else: + return x + 10 + + self.assert_prune(impl, (types.IntegerLiteral(1),), [False], 1) + + _FREEVAR = 12 + + def impl(x): + if _FREEVAR == 123: + return x + else: + return x + 10 + + self.assert_prune(impl, (types.IntegerLiteral(1),), [True], 1) + + def test_redefined_variables_are_not_considered_in_prune(self): + # see issue #4163, checks that if a variable that is an argument is + # redefined in the user code it is not considered const + + def impl(array, a=None): + if a is None: + a = 0 + if a < 0: + return 10 + return 30 + + self.assert_prune(impl, + (types.Array(types.float64, 2, 'C'), + types.NoneType('none'),), + [None, None], + np.zeros((2, 3)), None) + + def test_comparison_operators(self): + # see issue #4163, checks that a variable that is an argument and has + # value None survives TypeError from invalid comparison which should be + # dead + + def impl(array, a=None): + x = 0 + if a is None: + return 10 # dynamic exec would return here + # static analysis requires that this is executed with a=None, + # hence TypeError + if a < 0: + return 20 + return x + + self.assert_prune(impl, + (types.Array(types.float64, 2, 'C'), + types.NoneType('none'),), + [False, 'both'], + np.zeros((2, 3)), None) + + self.assert_prune(impl, + (types.Array(types.float64, 2, 'C'), + types.float64,), + [None, None], + np.zeros((2, 3)), 12.) + + def test_redefinition_analysis_same_block(self): + # checks that a redefinition in a block with prunable potential doesn't + # break + + def impl(array, x, a=None): + b = 2 + if x < 4: + b = 12 + if a is None: # known true + a = 7 # live + else: + b = 15 # dead + if a < 0: # valid as a result of the redefinition of 'a' + return 10 + return 30 + b + a + + self.assert_prune(impl, + (types.Array(types.float64, 2, 'C'), + types.float64, types.NoneType('none'),), + [None, False, None], + np.zeros((2, 3)), 1., None) + + def test_redefinition_analysis_different_block_can_exec(self): + # checks that a redefinition in a block that may be executed prevents + # pruning + + def impl(array, x, a=None): + b = 0 + if x > 5: + a = 11 # a redefined, cannot tell statically if this will exec + if x < 4: + b = 12 + if a is None: # cannot prune, cannot determine if re-defn occurred + b += 5 + else: + b += 7 + if a < 0: + return 10 + return 30 + b + + self.assert_prune(impl, + (types.Array(types.float64, 2, 'C'), + types.float64, types.NoneType('none'),), + [None, None, None, None], + np.zeros((2, 3)), 1., None) + + def test_redefinition_analysis_different_block_cannot_exec(self): + # checks that a redefinition in a block guarded by something that + # has prune potential + + def impl(array, x=None, a=None): + b = 0 + if x is not None: + a = 11 + if a is None: + b += 5 + else: + b += 7 + return 30 + b + + self.assert_prune(impl, + (types.Array(types.float64, 2, 'C'), + types.NoneType('none'), types.NoneType('none')), + [True, None], + np.zeros((2, 3)), None, None) + + self.assert_prune(impl, + (types.Array(types.float64, 2, 'C'), + types.NoneType('none'), types.float64), + [True, None], + np.zeros((2, 3)), None, 1.2) + + self.assert_prune(impl, + (types.Array(types.float64, 2, 'C'), + types.float64, types.NoneType('none')), + [None, None], + np.zeros((2, 3)), 1.2, None) + + def test_closure_and_nonlocal_can_prune(self): + # Closures must be inlined ahead of branch pruning in case nonlocal + # is used. See issue #6585. + def impl(): + x = 1000 + + def closure(): + nonlocal x + x = 0 + + closure() + + if x == 0: + return True + else: + return False + + self.assert_prune(impl, (), [False,],) + + def test_closure_and_nonlocal_cannot_prune(self): + # Closures must be inlined ahead of branch pruning in case nonlocal + # is used. See issue #6585. + def impl(n): + x = 1000 + + def closure(t): + nonlocal x + x = t + + closure(n) + + if x == 0: + return True + else: + return False + + self.assert_prune(impl, (types.int64,), [None,], 1) + + +class TestBranchPrunePredicates(TestBranchPruneBase, SerialMixin): + # Really important thing to remember... the branch on predicates end up as + # POP_JUMP_IF_ and the targets are backwards compared to normal, i.e. + # the true condition is far jump and the false the near i.e. `if x` would + # end up in Numba IR as e.g. `branch x 10, 6`. + + _TRUTHY = (1, "String", True, 7.4, 3j) + _FALSEY = (0, "", False, 0.0, 0j, None) + + def _literal_const_sample_generator(self, pyfunc, consts): + """ + This takes a python function, pyfunc, and manipulates its co_const + __code__ member to create a new function with different co_consts as + supplied in argument consts. + + consts is a dict {index: value} of co_const tuple index to constant + value used to update a pyfunc clone's co_const. + """ + pyfunc_code = pyfunc.__code__ + + # translate consts spec to update the constants + co_consts = {k: v for k, v in enumerate(pyfunc_code.co_consts)} + for k, v in consts.items(): + co_consts[k] = v + new_consts = tuple([v for _, v in sorted(co_consts.items())]) + + # create code object with mutation + new_code = pyfunc_code.replace(co_consts=new_consts) + + # get function + return pytypes.FunctionType(new_code, globals()) + + def test_literal_const_code_gen(self): + def impl(x): + _CONST1 = "PLACEHOLDER1" + if _CONST1: + return 3.14159 + else: + _CONST2 = "PLACEHOLDER2" + return _CONST2 + 4 + + new = self._literal_const_sample_generator(impl, {1:0, 3:20}) + iconst = impl.__code__.co_consts + nconst = new.__code__.co_consts + self.assertEqual(iconst, (None, "PLACEHOLDER1", 3.14159, + "PLACEHOLDER2", 4)) + self.assertEqual(nconst, (None, 0, 3.14159, 20, 4)) + self.assertEqual(impl(None), 3.14159) + self.assertEqual(new(None), 24) + + def test_single_if_const(self): + + def impl(x): + _CONST1 = "PLACEHOLDER1" + if _CONST1: + return 3.14159 + + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for const in c_inp: + func = self._literal_const_sample_generator(impl, {1: const}) + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_negate_const(self): + + def impl(x): + _CONST1 = "PLACEHOLDER1" + if not _CONST1: + return 3.14159 + + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for const in c_inp: + func = self._literal_const_sample_generator(impl, {1: const}) + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_else_const(self): + + def impl(x): + _CONST1 = "PLACEHOLDER1" + if _CONST1: + return 3.14159 + else: + return 1.61803 + + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for const in c_inp: + func = self._literal_const_sample_generator(impl, {1: const}) + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_else_negate_const(self): + + def impl(x): + _CONST1 = "PLACEHOLDER1" + if not _CONST1: + return 3.14159 + else: + return 1.61803 + + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for const in c_inp: + func = self._literal_const_sample_generator(impl, {1: const}) + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_freevar(self): + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for const in c_inp: + + def func(x): + if const: + return 3.14159, const + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_negate_freevar(self): + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for const in c_inp: + + def func(x): + if not const: + return 3.14159, const + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_else_freevar(self): + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for const in c_inp: + + def func(x): + if const: + return 3.14159, const + else: + return 1.61803, const + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_else_negate_freevar(self): + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for const in c_inp: + + def func(x): + if not const: + return 3.14159, const + else: + return 1.61803, const + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + # globals in this section have absurd names after their test usecase names + # so as to prevent collisions and permit tests to run in parallel + def test_single_if_global(self): + global c_test_single_if_global + + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for c in c_inp: + c_test_single_if_global = c + + def func(x): + if c_test_single_if_global: + return 3.14159, c_test_single_if_global + + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_negate_global(self): + global c_test_single_if_negate_global + + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for c in c_inp: + c_test_single_if_negate_global = c + + def func(x): + if c_test_single_if_negate_global: + return 3.14159, c_test_single_if_negate_global + + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_else_global(self): + global c_test_single_if_else_global + + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for c in c_inp: + c_test_single_if_else_global = c + + def func(x): + if c_test_single_if_else_global: + return 3.14159, c_test_single_if_else_global + else: + return 1.61803, c_test_single_if_else_global + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_single_if_else_negate_global(self): + global c_test_single_if_else_negate_global + + for c_inp, prune in (self._TRUTHY, False), (self._FALSEY, True): + for c in c_inp: + c_test_single_if_else_negate_global = c + + def func(x): + if not c_test_single_if_else_negate_global: + return 3.14159, c_test_single_if_else_negate_global + else: + return 1.61803, c_test_single_if_else_negate_global + self.assert_prune(func, (types.NoneType('none'),), [prune], + None) + + def test_issue_5618(self): + + @njit + def foo(): + values = np.zeros(1) + tmp = 666 + if tmp: + values[0] = tmp + return values + + self.assertPreciseEqual(foo.py_func()[0], 666.) + self.assertPreciseEqual(foo()[0], 666.) + + +class TestBranchPruneSSA(MemoryLeakMixin, TestCase): + # Tests SSA rewiring of phi nodes after branch pruning. + + class SSAPrunerCompiler(CompilerBase): + def define_pipelines(self): + # This is a simple pipeline that does branch pruning on IR in SSA + # form, then types and lowers as per the standard nopython pipeline. + pm = PassManager("testing pm") + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(IRProcessing, "processing IR") + # SSA early + pm.add_pass(ReconstructSSA, "ssa") + pm.add_pass(DeadBranchPrune, "dead branch pruning") + # type and then lower as usual + pm.add_pass(PreserveIR, "preserves the IR as metadata") + dpb = DefaultPassBuilder + typed_passes = dpb.define_typed_pipeline(self.state) + pm.passes.extend(typed_passes.passes) + lowering_passes = dpb.define_nopython_lowering_pipeline(self.state) + pm.passes.extend(lowering_passes.passes) + pm.finalize() + return [pm] + + def test_ssa_update_phi(self): + # This checks that dead branch pruning is rewiring phi nodes correctly + # after a block containing an incoming for a phi is removed. + + @njit(pipeline_class=self.SSAPrunerCompiler) + def impl(p=None, q=None): + z = 1 + r = False + if p is None: + r = True # live + + if r and q is not None: + z = 20 # dead + + # one of the incoming blocks for z is dead, the phi needs an update + # were this not done, it would refer to variables that do not exist + # and result in a lowering error. + return z, r + + self.assertPreciseEqual(impl(), impl.py_func()) + + def test_ssa_replace_phi(self): + # This checks that when a phi only has one incoming, because the other + # has been pruned, that a direct assignment is used instead. + + @njit(pipeline_class=self.SSAPrunerCompiler) + def impl(p=None): + z = 0 + if p is None: + z = 10 + else: + z = 20 + + return z + + self.assertPreciseEqual(impl(), impl.py_func()) + func_ir = impl.overloads[impl.signatures[0]].metadata['preserved_ir'] + + # check the func_ir, make sure there's no phi nodes + for blk in func_ir.blocks.values(): + self.assertFalse([*blk.find_exprs('phi')]) + + +class TestBranchPrunePostSemanticConstRewrites(TestBranchPruneBase): + # Tests that semantic constants rewriting works by virtue of branch pruning + + def test_array_ndim_attr(self): + + def impl(array): + if array.ndim == 2: + if array.shape[1] == 2: + return 1 + else: + return 10 + + self.assert_prune(impl, (types.Array(types.float64, 2, 'C'),), [False, + None], + np.zeros((2, 3))) + self.assert_prune(impl, (types.Array(types.float64, 1, 'C'),), [True, + 'both'], + np.zeros((2,))) + + def test_tuple_len(self): + + def impl(tup): + if len(tup) == 3: + if tup[2] == 2: + return 1 + else: + return 0 + + self.assert_prune(impl, (types.UniTuple(types.int64, 3),), [False, + None], + tuple([1, 2, 3])) + self.assert_prune(impl, (types.UniTuple(types.int64, 2),), [True, + 'both'], + tuple([1, 2])) + + def test_attr_not_len(self): + # The purpose of this test is to make sure that the conditions guarding + # the rewrite part do not themselves raise exceptions. + # This produces an `ir.Expr` call node for `float.as_integer_ratio`, + # which is a getattr() on `float`. + + @njit + def test(): + float.as_integer_ratio(1.23) + + # this should raise a TypingError + with self.assertRaises(errors.TypingError) as e: + test() + + self.assertIn("Unknown attribute 'as_integer_ratio'", str(e.exception)) + + def test_ndim_not_on_array(self): + + FakeArray = collections.namedtuple('FakeArray', ['ndim']) + fa = FakeArray(ndim=2) + + def impl(fa): + if fa.ndim == 2: + return fa.ndim + else: + object() + + # check prune works for array ndim + self.assert_prune(impl, (types.Array(types.float64, 2, 'C'),), [False], + np.zeros((2, 3))) + + # check prune fails for something with `ndim` attr that is not array + FakeArrayType = types.NamedUniTuple(types.int64, 1, FakeArray) + self.assert_prune(impl, (FakeArrayType,), [None], fa, + flags={'nopython':False, 'forceobj':True}) + + def test_semantic_const_propagates_before_static_rewrites(self): + # see issue #5015, the ndim needs writing in as a const before + # the rewrite passes run to make e.g. getitems static where possible + @njit + def impl(a, b): + return a.shape[:b.ndim] + + args = (np.zeros((5, 4, 3, 2)), np.zeros((1, 1))) + + self.assertPreciseEqual(impl(*args), impl.py_func(*args)) + + def test_tuple_const_propagation(self): + @njit(pipeline_class=IRPreservingTestPipeline) + def impl(*args): + s = 0 + for arg in literal_unroll(args): + s += len(arg) + return s + + inp = ((), (1, 2, 3), ()) + self.assertPreciseEqual(impl(*inp), impl.py_func(*inp)) + + ol = impl.overloads[impl.signatures[0]] + func_ir = ol.metadata['preserved_ir'] + # make sure one of the inplace binop args is a Const + binop_consts = set() + for blk in func_ir.blocks.values(): + for expr in blk.find_exprs('inplace_binop'): + inst = blk.find_variable_assignment(expr.rhs.name) + self.assertIsInstance(inst.value, ir.Const) + binop_consts.add(inst.value.value) + self.assertEqual(binop_consts, {len(x) for x in inp}) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_annotations.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_annotations.py new file mode 100644 index 0000000000000000000000000000000000000000..90e70eac808722d4b156c7ed36bb8ddd09bf9000 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_annotations.py @@ -0,0 +1,252 @@ +import re +from io import StringIO + +import numba +from numba.core import types +from numba import jit, njit +from numba.tests.support import override_config, TestCase +import unittest + +try: + import jinja2 +except ImportError: + jinja2 = None + +try: + import pygments +except ImportError: + pygments = None + + +@unittest.skipIf(jinja2 is None, "please install the 'jinja2' package") +class TestAnnotation(TestCase): + + @TestCase.run_test_in_subprocess # annotations compound per module + def test_exercise_code_path(self): + """ + Ensures template.html is available + """ + + def foo(n, a): + s = a + for i in range(n): + s += i + return s + + cfunc = njit((types.int32, types.int32))(foo) + cres = cfunc.overloads[cfunc.signatures[0]] + ta = cres.type_annotation + + buf = StringIO() + ta.html_annotate(buf) + output = buf.getvalue() + buf.close() + self.assertIn("foo", output) + + @TestCase.run_test_in_subprocess # annotations compound per module + def test_exercise_code_path_with_lifted_loop(self): + """ + Ensures that lifted loops are handled correctly in obj mode + """ + # the functions to jit + def bar(x): + return x + + def foo(x): + h = 0. + for i in range(x): # py 38 needs two loops for one to lift?! + h = h + i + for k in range(x): + h = h + k + if x: + h = h - bar(x) + return h + + # compile into an isolated context + cfunc = jit((types.intp,), forceobj=True, looplift=True)(foo) + cres = cfunc.overloads[cfunc.signatures[0]] + + ta = cres.type_annotation + + buf = StringIO() + ta.html_annotate(buf) + output = buf.getvalue() + buf.close() + self.assertIn("bar", output) + self.assertIn("foo", output) + self.assertIn("LiftedLoop", output) + + @TestCase.run_test_in_subprocess # annotations compound per module + def test_html_output_with_lifted_loop(self): + """ + Test some format and behavior of the html annotation with lifted loop + """ + @numba.jit(forceobj=True) + def udt(x): + object() # to force object mode + z = 0 + for i in range(x): # this line is tagged + z += i + return z + + # Regex pattern to check for the "lifted_tag" in the line of the loop + re_lifted_tag = re.compile( + r'\s*' + r'\s*
' + r'\s*' + r'\s*' + r'\s*[0-9]+:' + r'\s*[ ]+for i in range\(x\): # this line is tagged\s*', + re.MULTILINE) + + # Compile int64 version + sig_i64 = (types.int64,) + udt.compile(sig_i64) # compile with lifted loop + cres = udt.overloads[sig_i64] + + # Make html output + buf = StringIO() + cres.type_annotation.html_annotate(buf) + output = buf.getvalue() + buf.close() + + # There should be only one function output. + self.assertEqual(output.count("Function name: udt"), 1) + + sigfmt = "with signature: {} -> pyobject" + self.assertEqual(output.count(sigfmt.format(sig_i64)), 1) + # Ensure the loop is tagged + self.assertEqual(len(re.findall(re_lifted_tag, output)), 1, + msg='%s not found in %s' % (re_lifted_tag, output)) + + # Compile float64 version + sig_f64 = (types.float64,) + udt.compile(sig_f64) + cres = udt.overloads[sig_f64] + + # Make html output + buf = StringIO() + cres.type_annotation.html_annotate(buf) + output = buf.getvalue() + buf.close() + + # There should be two function output + self.assertEqual(output.count("Function name: udt"), 2) + self.assertEqual(output.count(sigfmt.format(sig_i64)), 1) + self.assertEqual(output.count(sigfmt.format(sig_f64)), 1) + # Ensure the loop is tagged in both output + self.assertEqual(len(re.findall(re_lifted_tag, output)), 2) + + @unittest.skipIf(pygments is None, "please install the 'pygments' package") + def test_pretty_print(self): + + @numba.njit + def foo(x, y): + return x, y + + foo(1, 2) + # Exercise the method + foo.inspect_types(pretty=True) + + # Exercise but supply a not None file kwarg, this is invalid + with self.assertRaises(ValueError) as raises: + foo.inspect_types(pretty=True, file='should be None') + self.assertIn('`file` must be None if `pretty=True`', + str(raises.exception)) + + +class TestTypeAnnotation(unittest.TestCase): + + def findpatloc(self, lines, pat): + for i, ln in enumerate(lines): + if pat in ln: + return i + raise ValueError("can't find {!r}".format(pat)) + + def getlines(self, func): + strbuf = StringIO() + func.inspect_types(strbuf) + return strbuf.getvalue().splitlines() + + def test_delete(self): + @numba.njit + def foo(appleorange, berrycherry): + return appleorange + berrycherry + + foo(1, 2) + + lines = self.getlines(foo) + + # Ensure deletion show up after their use + sa = self.findpatloc(lines, 'appleorange = arg(0, name=appleorange)') + sb = self.findpatloc(lines, 'berrycherry = arg(1, name=berrycherry)') + + ea = self.findpatloc(lines, 'del appleorange') + eb = self.findpatloc(lines, 'del berrycherry') + + self.assertLess(sa, ea) + self.assertLess(sb, eb) + + def _lifetimes_impl(self, extend): + with override_config('EXTEND_VARIABLE_LIFETIMES', extend): + @njit + def foo(a): + b = a + return b + x = 10 + b = foo(x) + self.assertEqual(b, x) + + lines = self.getlines(foo) + + sa = self.findpatloc(lines, 'a = arg(0, name=a)') + sb = self.findpatloc(lines, 'b = a') + + cast_ret = self.findpatloc(lines, 'cast(value=b)') + + dela = self.findpatloc(lines, 'del a') + delb = self.findpatloc(lines, 'del b') + + return sa, sb, cast_ret, dela, delb + + def test_delete_standard_lifetimes(self): + # without extended lifetimes, dels occur as soon as dead + # + # label 0 + # a = arg(0, name=a) :: int64 + # b = a :: int64 + # del a + # $8return_value.2 = cast(value=b) :: int64 + # del b + # return $8return_value.2 + + sa, sb, cast_ret, dela, delb = self._lifetimes_impl(extend=0) + + self.assertLess(sa, dela) + self.assertLess(sb, delb) + # del a is before cast and del b is after + self.assertLess(dela, cast_ret) + self.assertGreater(delb, cast_ret) + + def test_delete_extended_lifetimes(self): + # with extended lifetimes, dels are last in block: + # + # label 0 + # a = arg(0, name=a) :: int64 + # b = a :: int64 + # $8return_value.2 = cast(value=b) :: int64 + # del a + # del b + # return $8return_value.2 + + sa, sb, cast_ret, dela, delb = self._lifetimes_impl(extend=1) + + self.assertLess(sa, dela) + self.assertLess(sb, delb) + # dels are after the cast + self.assertGreater(dela, cast_ret) + self.assertGreater(delb, cast_ret) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_api.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_api.py new file mode 100644 index 0000000000000000000000000000000000000000..adc67315459012812de11b7a631f2b80c1e4fe5f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_api.py @@ -0,0 +1,91 @@ +import warnings + +import numba +from numba import jit, njit + +from numba.tests.support import TestCase, always_test +import unittest + + +class TestNumbaModule(TestCase): + """ + Test the APIs exposed by the top-level `numba` module. + """ + + def check_member(self, name): + self.assertTrue(hasattr(numba, name), name) + self.assertIn(name, numba.__all__) + + @always_test + def test_numba_module(self): + # jit + self.check_member("jit") + self.check_member("vectorize") + self.check_member("guvectorize") + self.check_member("njit") + # errors + self.check_member("NumbaError") + self.check_member("TypingError") + # types + self.check_member("int32") + # misc + numba.__version__ # not in __all__ + + +class TestJitDecorator(TestCase): + """ + Test the jit and njit decorators + """ + def test_jit_nopython_forceobj(self): + with self.assertRaises(ValueError) as cm: + jit(nopython=True, forceobj=True) + self.assertIn( + "Only one of 'nopython' or 'forceobj' can be True.", + str(cm.exception) + ) + + def py_func(x): + return x + + jit_func = jit(nopython=True)(py_func) + jit_func(1) + # Check length of nopython_signatures to check + # which mode the function was compiled in + self.assertEqual(len(jit_func.nopython_signatures), 1) + + jit_func = jit(forceobj=True)(py_func) + jit_func(1) + self.assertEqual(len(jit_func.nopython_signatures), 0) + + def test_njit_nopython_forceobj(self): + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', RuntimeWarning) + njit(forceobj=True) + self.assertEqual(len(w), 1) + self.assertIn( + 'forceobj is set for njit and is ignored', str(w[0].message) + ) + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', RuntimeWarning) + njit(nopython=True) + self.assertEqual(len(w), 1) + self.assertIn( + 'nopython is set for njit and is ignored', str(w[0].message) + ) + + def py_func(x): + return x + + jit_func = njit(nopython=True)(py_func) + jit_func(1) + self.assertEqual(len(jit_func.nopython_signatures), 1) + + jit_func = njit(forceobj=True)(py_func) + jit_func(1) + # Since forceobj is ignored this has to compile in nopython mode + self.assertEqual(len(jit_func.nopython_signatures), 1) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_analysis.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_analysis.py new file mode 100644 index 0000000000000000000000000000000000000000..27bcbb30365851791f495f0a20706102a000a35f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_analysis.py @@ -0,0 +1,1140 @@ +import itertools + +import numpy as np +import sys +from collections import namedtuple +from io import StringIO + +from numba import njit, typeof, prange +from numba.core import ( + types, + typing, + ir, + bytecode, + postproc, + cpu, + registry, + utils, +) +from numba.tests.support import (TestCase, tag, skip_parfors_unsupported, + skip_unless_scipy) +from numba.parfors.array_analysis import EquivSet, ArrayAnalysis +from numba.core.compiler import Compiler, Flags, PassManager +from numba.core.ir_utils import remove_dead +from numba.core.untyped_passes import (ExtractByteCode, TranslateByteCode, FixupArgs, + IRProcessing, DeadBranchPrune, + RewriteSemanticConstants, GenericRewrites, + WithLifting, PreserveIR, InlineClosureLikes) + +from numba.core.typed_passes import (NopythonTypeInference, AnnotateTypes, + NopythonRewrites, IRLegalization) + +from numba.core.compiler_machinery import FunctionPass, PassManager, register_pass +from numba.experimental import jitclass +import unittest + + +skip_unsupported = skip_parfors_unsupported + + +# test class for #3700 +@jitclass([('L', types.int32), ('T', types.int32)]) +class ExampleClass3700(object): + def __init__(self, n): + self.L = n + self.T = n + 1 + + +# test value for test_global_tuple +GVAL = (1.2,) +GVAL2 = (3, 4) + + +class TestEquivSet(TestCase): + + """ + Test array_analysis.EquivSet. + """ + def test_insert_equiv(self): + s1 = EquivSet() + s1.insert_equiv('a', 'b') + self.assertTrue(s1.is_equiv('a', 'b')) + self.assertTrue(s1.is_equiv('b', 'a')) + s1.insert_equiv('c', 'd') + self.assertTrue(s1.is_equiv('c', 'd')) + self.assertFalse(s1.is_equiv('c', 'a')) + s1.insert_equiv('a', 'c') + self.assertTrue(s1.is_equiv('a', 'b', 'c', 'd')) + self.assertFalse(s1.is_equiv('a', 'e')) + + def test_intersect(self): + s1 = EquivSet() + s2 = EquivSet() + r = s1.intersect(s2) + self.assertTrue(r.is_empty()) + s1.insert_equiv('a', 'b') + r = s1.intersect(s2) + self.assertTrue(r.is_empty()) + s2.insert_equiv('b', 'c') + r = s1.intersect(s2) + self.assertTrue(r.is_empty()) + s2.insert_equiv('d', 'a') + r = s1.intersect(s2) + self.assertTrue(r.is_empty()) + s1.insert_equiv('a', 'e') + s2.insert_equiv('c', 'd') + r = s1.intersect(s2) + self.assertTrue(r.is_equiv('a', 'b')) + self.assertFalse(r.is_equiv('a', 'e')) + self.assertFalse(r.is_equiv('c', 'd')) + + +@register_pass(analysis_only=False, mutates_CFG=True) +class ArrayAnalysisPass(FunctionPass): + _name = "array_analysis_pass" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + state.array_analysis = ArrayAnalysis(state.typingctx, state.func_ir, + state.typemap, state.calltypes) + state.array_analysis.run(state.func_ir.blocks) + post_proc = postproc.PostProcessor(state.func_ir) + post_proc.run() + state.func_ir_copies.append(state.func_ir.copy()) + if state.test_idempotence and len(state.func_ir_copies) > 1: + state.test_idempotence(state.func_ir_copies) + return False + + +class ArrayAnalysisTester(Compiler): + + @classmethod + def mk_pipeline(cls, args, return_type=None, flags=None, locals={}, + library=None, typing_context=None, target_context=None): + if not flags: + flags = Flags() + flags.nrt = True + if typing_context is None: + typing_context = registry.cpu_target.typing_context + if target_context is None: + target_context = registry.cpu_target.target_context + return cls(typing_context, target_context, library, args, return_type, + flags, locals) + + def compile_to_ir(self, func, test_idempotence=None): + """ + Populate and run compiler pipeline + """ + self.state.func_id = bytecode.FunctionIdentity.from_function(func) + ExtractByteCode().run_pass(self.state) + + self.state.lifted = () + self.state.lifted_from = None + state = self.state + state.func_ir_copies = [] + state.test_idempotence = test_idempotence + + name = 'array_analysis_testing' + pm = PassManager(name) + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(FixupArgs, "fix up args") + pm.add_pass(IRProcessing, "processing IR") + # pre typing + if not state.flags.no_rewrites: + pm.add_pass(GenericRewrites, "nopython rewrites") + pm.add_pass(RewriteSemanticConstants, "rewrite semantic constants") + pm.add_pass(DeadBranchPrune, "dead branch pruning") + pm.add_pass(InlineClosureLikes, + "inline calls to locally defined closures") + # typing + pm.add_pass(NopythonTypeInference, "nopython frontend") + + if not state.flags.no_rewrites: + pm.add_pass(NopythonRewrites, "nopython rewrites") + + # Array Analysis pass + pm.add_pass(ArrayAnalysisPass, "array analysis") + if test_idempotence: + # Do another pass of array analysis to test idempotence + pm.add_pass(ArrayAnalysisPass, "idempotence array analysis") + # legalise + pm.add_pass(IRLegalization, "ensure IR is legal prior to lowering") + pm.add_pass(AnnotateTypes, "annotate types") + + # partial compile + pm.finalize() + pm.run(state) + return state.array_analysis + + +class TestArrayAnalysis(TestCase): + + def compare_ir(self, ir_list): + outputs = [] + for func_ir in ir_list: + remove_dead(func_ir.blocks, func_ir.arg_names, func_ir) + output = StringIO() + func_ir.dump(file=output) + outputs.append(output.getvalue()) + self.assertTrue(len(set(outputs)) == 1) # assert all outputs are equal + + def _compile_and_test(self, fn, arg_tys, asserts=[], equivs=[], idempotent=True): + """ + Compile the given function and get its IR. + """ + test_pipeline = ArrayAnalysisTester.mk_pipeline(arg_tys) + test_idempotence = self.compare_ir if idempotent else lambda x:() + analysis = test_pipeline.compile_to_ir(fn, test_idempotence) + if equivs: + for func in equivs: + # only test the equiv_set of the first block + func(analysis.equiv_sets[0]) + if asserts is None: + self.assertTrue(self._has_no_assertcall(analysis.func_ir)) + else: + for func in asserts: + func(analysis.func_ir, analysis.typemap) + + def _has_assertcall(self, func_ir, typemap, args): + msg = "Sizes of {} do not match".format(', '.join(args)) + for label, block in func_ir.blocks.items(): + for expr in block.find_exprs(op='call'): + fn = func_ir.get_definition(expr.func.name) + if isinstance(fn, ir.Global) and fn.name == 'assert_equiv': + typ = typemap[expr.args[0].name] + if typ.literal_value.startswith(msg): + return True + return False + + def _has_shapecall(self, func_ir, x): + for label, block in func_ir.blocks.items(): + for expr in block.find_exprs(op='getattr'): + if expr.attr == 'shape': + y = func_ir.get_definition(expr.value, lhs_only=True) + z = func_ir.get_definition(x, lhs_only=True) + y = y.name if isinstance(y, ir.Var) else y + z = z.name if isinstance(z, ir.Var) else z + if y == z: + return True + return False + + def _has_no_assertcall(self, func_ir): + for label, block in func_ir.blocks.items(): + for expr in block.find_exprs(op='call'): + fn = func_ir.get_definition(expr.func.name) + if isinstance(fn, ir.Global) and fn.name == 'assert_equiv': + return False + return True + + def with_assert(self, *args): + return lambda func_ir, typemap: self.assertTrue( + self._has_assertcall(func_ir, typemap, args)) + + def without_assert(self, *args): + return lambda func_ir, typemap: self.assertFalse( + self._has_assertcall(func_ir, typemap, args)) + + def with_equiv(self, *args): + def check(equiv_set): + n = len(args) + for i in range(n - 1): + if not equiv_set.is_equiv(args[i], args[n - 1]): + return False + return True + return lambda equiv_set: self.assertTrue(check(equiv_set)) + + def without_equiv(self, *args): + def check(equiv_set): + n = len(args) + for i in range(n - 1): + if equiv_set.is_equiv(args[i], args[n - 1]): + return False + return True + return lambda equiv_set: self.assertTrue(check(equiv_set)) + + def with_shapecall(self, x): + return lambda func_ir, s: self.assertTrue(self._has_shapecall(func_ir, x)) + + def without_shapecall(self, x): + return lambda func_ir, s: self.assertFalse(self._has_shapecall(func_ir, x)) + + def test_base_cases(self): + def test_0(): + a = np.zeros(0) + b = np.zeros(1) + m = 0 + n = 1 + c = np.zeros((m, n)) + return + self._compile_and_test(test_0, (), + equivs=[self.with_equiv('a', (0,)), + self.with_equiv('b', (1,)), + self.with_equiv('c', (0, 1))]) + + def test_1(n): + a = np.zeros(n) + b = np.zeros(n) + return a + b + self._compile_and_test(test_1, (types.intp,), asserts=None) + + def test_2(m, n): + a = np.zeros(n) + b = np.zeros(m) + return a + b + self._compile_and_test(test_2, (types.intp, types.intp), + asserts=[self.with_assert('a', 'b')]) + + def test_3(n): + a = np.zeros(n) + return a + n + self._compile_and_test(test_3, (types.intp,), asserts=None) + + def test_4(n): + a = np.zeros(n) + b = a + 1 + c = a + 2 + return a + c + self._compile_and_test(test_4, (types.intp,), asserts=None) + + def test_5(n): + a = np.zeros((n, n)) + m = n + b = np.zeros((m, n)) + return a + b + self._compile_and_test(test_5, (types.intp,), asserts=None) + + def test_6(m, n): + a = np.zeros(n) + b = np.zeros(m) + d = a + b + e = a - b + return d + e + self._compile_and_test(test_6, (types.intp, types.intp), + asserts=[self.with_assert('a', 'b'), + self.without_assert('d', 'e')]) + + def test_7(m, n): + a = np.zeros(n) + b = np.zeros(m) + if m == 10: + d = a + b + else: + d = a - b + return d + a + self._compile_and_test(test_7, (types.intp, types.intp), + asserts=[self.with_assert('a', 'b'), + self.without_assert('d', 'a')]) + + def test_8(m, n): + a = np.zeros(n) + b = np.zeros(m) + if m == 10: + d = b + a + else: + d = a + a + return b + d + self._compile_and_test(test_8, (types.intp, types.intp), + asserts=[self.with_assert('b', 'a'), + self.with_assert('b', 'd')]) + + def test_9(m): + A = np.ones(m) + s = 0 + while m < 2: + m += 1 + B = np.ones(m) + s += np.sum(A + B) + return s + self._compile_and_test(test_9, (types.intp,), + asserts=[self.with_assert('A', 'B')]) + + def test_10(m, n): + p = m - 1 + q = n + 1 + r = q + 1 + A = np.zeros(p) + B = np.zeros(q) + C = np.zeros(r) + D = np.zeros(m) + s = np.sum(A + B) + t = np.sum(C + D) + return s + t + self._compile_and_test(test_10, (types.intp,types.intp,), + asserts=[self.with_assert('A', 'B'), + self.without_assert('C', 'D')]) + + def test_11(): + a = np.ones(5) + b = np.ones(5) + c = a[1:] + d = b[:-1] + e = len(c) + f = len(d) + return e == f + self._compile_and_test(test_11, (), + equivs=[self.with_equiv('e', 'f')]) + + def test_12(): + a = np.ones(25).reshape((5,5)) + b = np.ones(25).reshape((5,5)) + c = a[1:,:] + d = b[:-1,:] + e = c.shape[0] + f = d.shape[0] + g = len(d) + return e == f + self._compile_and_test(test_12, (), + equivs=[self.with_equiv('e', 'f', 'g')]) + + def test_tup_arg(T): + T2 = T + return T2[0] + + int_arr_typ = types.Array(types.intp, 1, 'C') + self._compile_and_test(test_tup_arg, + (types.Tuple((int_arr_typ, int_arr_typ)),), asserts=None) + + def test_arr_in_tup(m): + A = np.ones(m) + S = (A,) + B = np.ones(len(S[0])) + return B + + self._compile_and_test(test_arr_in_tup, (types.intp,), + equivs=[self.with_equiv("A", "B")]) + + T = namedtuple("T", ['a','b']) + def test_namedtuple(n): + r = T(n, n) + return r[0] + self._compile_and_test(test_namedtuple, (types.intp,), + equivs=[self.with_equiv('r', ('n', 'n'))],) + + # np.where is tricky since it returns tuple of arrays + def test_np_where_tup_return(A): + c = np.where(A) + return len(c[0]) + + self._compile_and_test(test_np_where_tup_return, + (types.Array(types.intp, 1, 'C'),), asserts=None) + + def test_shape(A): + (m, n) = A.shape + B = np.ones((m, n)) + return A + B + self._compile_and_test(test_shape, (types.Array(types.intp, 2, 'C'),), + asserts=None) + + def test_cond(l, m, n): + A = np.ones(l) + B = np.ones(m) + C = np.ones(n) + if l == m: + r = np.sum(A + B) + else: + r = 0 + if m != n: + s = 0 + else: + s = np.sum(B + C) + t = 0 + if l == m: + if m == n: + t = np.sum(A + B + C) + return r + s + t + self._compile_and_test(test_cond, (types.intp, types.intp, types.intp), + asserts=None) + + def test_assert_1(m, n): + assert(m == n) + A = np.ones(m) + B = np.ones(n) + return np.sum(A + B) + self._compile_and_test(test_assert_1, (types.intp, types.intp), + asserts=None) + + def test_assert_2(A, B): + assert(A.shape == B.shape) + return np.sum(A + B) + + self._compile_and_test(test_assert_2, (types.Array(types.intp, 1, 'C'), + types.Array(types.intp, 1, 'C'),), + asserts=None) + self._compile_and_test(test_assert_2, (types.Array(types.intp, 2, 'C'), + types.Array(types.intp, 2, 'C'),), + asserts=None) + # expected failure + with self.assertRaises(AssertionError) as raises: + self._compile_and_test(test_assert_2, (types.Array(types.intp, 1, 'C'), + types.Array(types.intp, 2, 'C'),), + asserts=None) + msg = "Dimension mismatch" + self.assertIn(msg, str(raises.exception)) + + + def test_stencilcall(self): + from numba.stencils.stencil import stencil + @stencil + def kernel_1(a): + return 0.25 * (a[0,1] + a[1,0] + a[0,-1] + a[-1,0]) + + def test_1(n): + a = np.ones((n,n)) + b = kernel_1(a) + return a + b + + self._compile_and_test(test_1, (types.intp,), + equivs=[self.with_equiv('a', 'b')], + asserts=[self.without_assert('a', 'b')]) + + def test_2(n): + a = np.ones((n,n)) + b = np.ones((n+1,n+1)) + kernel_1(a, out=b) + return a + + self._compile_and_test(test_2, (types.intp,), + equivs=[self.without_equiv('a', 'b')]) + + @stencil(standard_indexing=('c',)) + def kernel_2(a, b, c): + return a[0,1,0] + b[0,-1,0] + c[0] + + def test_3(n): + a = np.arange(64).reshape(4,8,2) + b = np.arange(64).reshape(n,8,2) + u = np.zeros(1) + v = kernel_2(a, b, u) + return v + + # standard indexed arrays are not considered in size equivalence + self._compile_and_test(test_3, (types.intp,), + equivs=[self.with_equiv('a', 'b', 'v'), + self.without_equiv('a', 'u')], + asserts=[self.with_assert('a', 'b')]) + + def test_slice(self): + def test_1(m, n): + A = np.zeros(m) + B = np.zeros(n) + s = np.sum(A + B) + C = A[1:m-1] + D = B[1:n-1] + t = np.sum(C + D) + return s + t + self._compile_and_test(test_1, (types.intp,types.intp,), + asserts=[self.with_assert('A', 'B'), + self.without_assert('C', 'D')], + idempotent=False) + + def test_2(m): + A = np.zeros(m) + B = A[0:m-3] + C = A[1:m-2] + D = A[2:m-1] + E = B + C + return D + E + self._compile_and_test(test_2, (types.intp,), + asserts=[self.without_assert('B', 'C'), + self.without_assert('D', 'E')], + idempotent=False) + + def test_3(m): + A = np.zeros((m,m)) + B = A[0:m-2,0:m-2] + C = A[1:m-1,1:m-1] + E = B + C + return E + self._compile_and_test(test_3, (types.intp,), + asserts=[self.without_assert('B', 'C')], + idempotent=False) + + def test_4(m): + A = np.zeros((m,m)) + B = A[0:m-2,:] + C = A[1:m-1,:] + E = B + C + return E + self._compile_and_test(test_4, (types.intp,), + asserts=[self.without_assert('B', 'C')], + idempotent=False) + + def test_5(m,n): + A = np.zeros(m) + B = np.zeros(m) + B[0:m-2] = A[1:m-1] + C = np.zeros(n) + D = A[1:m-1] + C[0:n-2] = D + # B and C are not necessarily of the same size because we can't + # derive m == n from (m-2) % m == (n-2) % n + return B + C + self._compile_and_test(test_5, (types.intp,types.intp), + asserts=[self.without_assert('B', 'A'), + self.with_assert('C', 'D'), + self.with_assert('B', 'C')], + idempotent=False) + + def test_6(m): + A = np.zeros((m,m)) + B = A[0:m-2,:-1] + C = A[1:m-1,:-1] + E = B + C + return E + self._compile_and_test(test_6, (types.intp,), + asserts=[self.without_assert('B', 'C')], + idempotent=False) + + def test_7(m): + A = np.zeros((m,m)) + B = A[0:m-2,-3:-1] + C = A[1:m-1,-4:-2] + E = B + C + return E + self._compile_and_test(test_7, (types.intp,), + asserts=[self.with_assert('B', 'C')], + idempotent=False) + + def test_8(m): + A = np.zeros((m,m)) + B = A[:m-2,0:] + C = A[1:-1,:] + E = B + C + return E + self._compile_and_test(test_8, (types.intp,), + asserts=[self.without_assert('B', 'C')], + idempotent=False) + + def test_9(m): + # issues #3461 and #3554, checks equivalence on empty slices + # and across binop + A = np.zeros((m)) + B = A[:0] # B = array([], dtype=int64) + C = A[1:] + D = A[:-1:-1] # D = array([], dtype=int64) + E = B + D + F = E + F += 1 # F = array([], dtype=int64) + return A, C, F + self._compile_and_test(test_9, (types.intp,), + equivs=[self.without_equiv('B', 'C'), + self.with_equiv('A', 'm'), + self.with_equiv('B', 'D'), + self.with_equiv('F', 'D'),], + idempotent=False) + + @skip_unless_scipy + def test_numpy_calls(self): + def test_zeros(n): + a = np.zeros(n) + b = np.zeros((n, n)) + c = np.zeros(shape=(n, n)) + self._compile_and_test(test_zeros, (types.intp,), + equivs=[self.with_equiv('a', 'n'), + self.with_equiv('b', ('n', 'n')), + self.with_equiv('b', 'c')]) + + def test_0d_array(n): + a = np.array(1) + b = np.ones(2) + return a + b + self._compile_and_test(test_0d_array, (types.intp,), + equivs=[self.without_equiv('a', 'b')], + asserts=[self.without_shapecall('a')]) + + def test_ones(n): + a = np.ones(n) + b = np.ones((n, n)) + c = np.ones(shape=(n, n)) + self._compile_and_test(test_ones, (types.intp,), + equivs=[self.with_equiv('a', 'n'), + self.with_equiv('b', ('n', 'n')), + self.with_equiv('b', 'c')]) + + def test_empty(n): + a = np.empty(n) + b = np.empty((n, n)) + c = np.empty(shape=(n, n)) + self._compile_and_test(test_empty, (types.intp,), + equivs=[self.with_equiv('a', 'n'), + self.with_equiv('b', ('n', 'n')), + self.with_equiv('b', 'c')]) + + def test_eye(n): + a = np.eye(n) + b = np.eye(N=n) + c = np.eye(N=n, M=n) + d = np.eye(N=n, M=n + 1) + self._compile_and_test(test_eye, (types.intp,), + equivs=[self.with_equiv('a', ('n', 'n')), + self.with_equiv('b', ('n', 'n')), + self.with_equiv('b', 'c'), + self.without_equiv('b', 'd')]) + + def test_identity(n): + a = np.identity(n) + self._compile_and_test(test_identity, (types.intp,), + equivs=[self.with_equiv('a', ('n', 'n'))]) + + def test_diag(n): + a = np.identity(n) + b = np.diag(a) + c = np.diag(b) + d = np.diag(a, k=1) + self._compile_and_test(test_diag, (types.intp,), + equivs=[self.with_equiv('b', ('n',)), + self.with_equiv('c', ('n', 'n'))], + asserts=[self.with_shapecall('d'), + self.without_shapecall('c')]) + + def test_array_like(a): + b = np.empty_like(a) + c = np.zeros_like(a) + d = np.ones_like(a) + e = np.full_like(a, 1) + f = np.asfortranarray(a) + + self._compile_and_test(test_array_like, (types.Array(types.intp, 2, 'C'),), + equivs=[ + self.with_equiv('a', 'b', 'd', 'e', 'f')], + asserts=[self.with_shapecall('a'), + self.without_shapecall('b')]) + + def test_reshape(n): + a = np.ones(n * n) + b = a.reshape((n, n)) + return a.sum() + b.sum() + self._compile_and_test(test_reshape, (types.intp,), + equivs=[self.with_equiv('b', ('n', 'n'))], + asserts=[self.without_shapecall('b')]) + + + def test_transpose(m, n): + a = np.ones((m, n)) + b = a.T + c = a.transpose() + # Numba njit cannot compile explicit transpose call! + # c = np.transpose(b) + self._compile_and_test(test_transpose, (types.intp, types.intp), + equivs=[self.with_equiv('a', ('m', 'n')), + self.with_equiv('b', ('n', 'm')), + self.with_equiv('c', ('n', 'm'))]) + + + def test_transpose_3d(m, n, k): + a = np.ones((m, n, k)) + b = a.T + c = a.transpose() + d = a.transpose(2,0,1) + dt = a.transpose((2,0,1)) + e = a.transpose(0,2,1) + et = a.transpose((0,2,1)) + # Numba njit cannot compile explicit transpose call! + # c = np.transpose(b) + self._compile_and_test(test_transpose_3d, (types.intp, types.intp, types.intp), + equivs=[self.with_equiv('a', ('m', 'n', 'k')), + self.with_equiv('b', ('k', 'n', 'm')), + self.with_equiv('c', ('k', 'n', 'm')), + self.with_equiv('d', ('k', 'm', 'n')), + self.with_equiv('dt', ('k', 'm', 'n')), + self.with_equiv('e', ('m', 'k', 'n')), + self.with_equiv('et', ('m', 'k', 'n'))]) + + def test_real_imag_attr(m, n): + a = np.ones((m, n)) + b = a.real + c = a.imag + + self._compile_and_test(test_real_imag_attr, (types.intp, types.intp), + equivs=[self.with_equiv('a', ('m', 'n')), + self.with_equiv('b', ('m', 'n')), + self.with_equiv('c', ('m', 'n')), + ]) + + def test_random(n): + a0 = np.random.rand(n) + a1 = np.random.rand(n, n) + b0 = np.random.randn(n) + b1 = np.random.randn(n, n) + c0 = np.random.ranf(n) + c1 = np.random.ranf((n, n)) + c2 = np.random.ranf(size=(n, n)) + d0 = np.random.random_sample(n) + d1 = np.random.random_sample((n, n)) + d2 = np.random.random_sample(size=(n, n)) + e0 = np.random.sample(n) + e1 = np.random.sample((n, n)) + e2 = np.random.sample(size=(n, n)) + f0 = np.random.random(n) + f1 = np.random.random((n, n)) + f2 = np.random.random(size=(n, n)) + g0 = np.random.standard_normal(n) + g1 = np.random.standard_normal((n, n)) + g2 = np.random.standard_normal(size=(n, n)) + h0 = np.random.chisquare(10, n) + h1 = np.random.chisquare(10, (n, n)) + h2 = np.random.chisquare(10, size=(n, n)) + i0 = np.random.weibull(10, n) + i1 = np.random.weibull(10, (n, n)) + i2 = np.random.weibull(10, size=(n, n)) + j0 = np.random.power(10, n) + j1 = np.random.power(10, (n, n)) + j2 = np.random.power(10, size=(n, n)) + k0 = np.random.geometric(0.1, n) + k1 = np.random.geometric(0.1, (n, n)) + k2 = np.random.geometric(0.1, size=(n, n)) + l0 = np.random.exponential(10, n) + l1 = np.random.exponential(10, (n, n)) + l2 = np.random.exponential(10, size=(n, n)) + m0 = np.random.poisson(10, n) + m1 = np.random.poisson(10, (n, n)) + m2 = np.random.poisson(10, size=(n, n)) + n0 = np.random.rayleigh(10, n) + n1 = np.random.rayleigh(10, (n, n)) + n2 = np.random.rayleigh(10, size=(n, n)) + o0 = np.random.normal(0, 1, n) + o1 = np.random.normal(0, 1, (n, n)) + o2 = np.random.normal(0, 1, size=(n, n)) + p0 = np.random.uniform(0, 1, n) + p1 = np.random.uniform(0, 1, (n, n)) + p2 = np.random.uniform(0, 1, size=(n, n)) + q0 = np.random.beta(0.1, 1, n) + q1 = np.random.beta(0.1, 1, (n, n)) + q2 = np.random.beta(0.1, 1, size=(n, n)) + r0 = np.random.binomial(0, 1, n) + r1 = np.random.binomial(0, 1, (n, n)) + r2 = np.random.binomial(0, 1, size=(n, n)) + s0 = np.random.f(0.1, 1, n) + s1 = np.random.f(0.1, 1, (n, n)) + s2 = np.random.f(0.1, 1, size=(n, n)) + t0 = np.random.gamma(0.1, 1, n) + t1 = np.random.gamma(0.1, 1, (n, n)) + t2 = np.random.gamma(0.1, 1, size=(n, n)) + u0 = np.random.lognormal(0, 1, n) + u1 = np.random.lognormal(0, 1, (n, n)) + u2 = np.random.lognormal(0, 1, size=(n, n)) + v0 = np.random.laplace(0, 1, n) + v1 = np.random.laplace(0, 1, (n, n)) + v2 = np.random.laplace(0, 1, size=(n, n)) + w0 = np.random.randint(0, 10, n) + w1 = np.random.randint(0, 10, (n, n)) + w2 = np.random.randint(0, 10, size=(n, n)) + x0 = np.random.triangular(-3, 0, 10, n) + x1 = np.random.triangular(-3, 0, 10, (n, n)) + x2 = np.random.triangular(-3, 0, 10, size=(n, n)) + + last = ord('x') + 1 + vars1d = [('n',)] + [chr(x) + '0' for x in range(ord('a'), last)] + vars2d = [('n', 'n')] + [chr(x) + '1' for x in range(ord('a'), last)] + vars2d += [chr(x) + '1' for x in range(ord('c'), last)] + self._compile_and_test(test_random, (types.intp,), + equivs=[self.with_equiv(*vars1d), + self.with_equiv(*vars2d)]) + + def test_concatenate(m, n): + a = np.ones(m) + b = np.ones(n) + c = np.concatenate((a, b)) + d = np.ones((2, n)) + e = np.ones((3, n)) + f = np.concatenate((d, e)) + # Numba njit cannot compile concatenate with single array! + # g = np.ones((3,4,5)) + # h = np.concatenate(g) + i = np.ones((m, 2)) + j = np.ones((m, 3)) + k = np.concatenate((i, j), axis=1) + l = np.ones((m, n)) + o = np.ones((m, n)) + p = np.concatenate((l, o)) + # Numba njit cannot support list argument! + # q = np.concatenate([d, e]) + self._compile_and_test(test_concatenate, (types.intp, types.intp), + equivs=[self.with_equiv('f', (5, 'n')), + #self.with_equiv('h', (3 + 4 + 5, )), + self.with_equiv('k', ('m', 5))], + asserts=[self.with_shapecall('c'), + self.without_shapecall('f'), + self.without_shapecall('k'), + self.with_shapecall('p')]) + + def test_vsd_stack(): + k = np.ones((2,)) + l = np.ones((2, 3)) + o = np.ones((2, 3, 4)) + p = np.vstack((k, k)) + q = np.vstack((l, l)) + r = np.hstack((k, k)) + s = np.hstack((l, l)) + t = np.dstack((k, k)) + u = np.dstack((l, l)) + v = np.dstack((o, o)) + + self._compile_and_test(test_vsd_stack, (), + equivs=[self.with_equiv('p', (2, 2)), + self.with_equiv('q', (4, 3)), + self.with_equiv('r', (4,)), + self.with_equiv('s', (2, 6)), + self.with_equiv('t', (1, 2, 2)), + self.with_equiv('u', (2, 3, 2)), + self.with_equiv('v', (2, 3, 8)), + ]) + + def test_stack(m, n): + a = np.ones(m) + b = np.ones(n) + c = np.stack((a, b)) + d = np.ones((m, n)) + e = np.ones((m, n)) + f = np.stack((d, e)) + g = np.stack((d, e), axis=0) + h = np.stack((d, e), axis=1) + i = np.stack((d, e), axis=2) + j = np.stack((d, e), axis=-1) + + self._compile_and_test(test_stack, (types.intp, types.intp), + equivs=[self.with_equiv('m', 'n'), + self.with_equiv('c', (2, 'm')), + self.with_equiv( + 'f', 'g', (2, 'm', 'n')), + self.with_equiv( + 'h', ('m', 2, 'n')), + self.with_equiv( + 'i', 'j', ('m', 'n', 2)), + ]) + + def test_linspace(m, n): + a = np.linspace(m, n) + b = np.linspace(m, n, 10) + # Numba njit does not support num keyword to linspace call! + # c = np.linspace(m,n,num=10) + self._compile_and_test(test_linspace, (types.float64, types.float64), + equivs=[self.with_equiv('a', (50,)), + self.with_equiv('b', (10,))]) + + def test_dot(l, m, n): + a = np.dot(np.ones(1), np.ones(1)) + b = np.dot(np.ones(2), np.ones((2, 3))) + # Numba njit does not support higher dimensional inputs + #c = np.dot(np.ones(2),np.ones((3,2,4))) + #d = np.dot(np.ones(2),np.ones((3,5,2,4))) + e = np.dot(np.ones((1, 2)), np.ones(2,)) + #f = np.dot(np.ones((1,2,3)),np.ones(3,)) + #g = np.dot(np.ones((1,2,3,4)),np.ones(4,)) + h = np.dot(np.ones((2, 3)), np.ones((3, 4))) + i = np.dot(np.ones((m, n)), np.ones((n, m))) + j = np.dot(np.ones((m, m)), np.ones((l, l))) + + self._compile_and_test(test_dot, (types.intp, types.intp, types.intp), + equivs=[self.without_equiv('a', (1,)), # not array + self.with_equiv('b', (3,)), + self.with_equiv('e', (1,)), + self.with_equiv('h', (2, 4)), + self.with_equiv('i', ('m', 'm')), + self.with_equiv('j', ('m', 'm')), + ], + asserts=[self.with_assert('m', 'l')]) + + def test_broadcast(m, n): + a = np.ones((m, n)) + b = np.ones(n) + c = a + b + d = np.ones((1, n)) + e = a + c - d + self._compile_and_test(test_broadcast, (types.intp, types.intp), + equivs=[self.with_equiv('a', 'c', 'e')], + asserts=None) + + # make sure shape of a global tuple of ints is handled properly + def test_global_tuple(): + a = np.ones(GVAL2) + b = np.ones(GVAL2) + + self._compile_and_test(test_global_tuple, (), + equivs=[self.with_equiv('a', 'b')], + asserts=None) + + +class TestArrayAnalysisParallelRequired(TestCase): + """This is to just split out tests that need the parallel backend and + therefore serialised execution. + """ + + _numba_parallel_test_ = False + + @skip_unsupported + def test_misc(self): + + @njit + def swap(x, y): + return(y, x) + + def test_bug2537(m): + a = np.ones(m) + b = np.ones(m) + for i in range(m): + a[i], b[i] = swap(a[i], b[i]) + + try: + njit(test_bug2537, parallel=True)(10) + except IndexError: + self.fail("test_bug2537 raised IndexError!") + + @skip_unsupported + def test_global_namedtuple(self): + Row = namedtuple('Row', ['A']) + row = Row(3) + + def test_impl(): + rr = row + res = rr.A + if res == 2: + res = 3 + return res + + self.assertEqual(njit(test_impl, parallel=True)(), test_impl()) + + @skip_unsupported + def test_array_T_issue_3700(self): + + def test_impl(t_obj, X): + for i in prange(t_obj.T): + X[i] = i + return X.sum() + + n = 5 + t_obj = ExampleClass3700(n) + X1 = np.zeros(t_obj.T) + X2 = np.zeros(t_obj.T) + self.assertEqual( + njit(test_impl, parallel=True)(t_obj, X1), test_impl(t_obj, X2)) + + @skip_unsupported + def test_slice_shape_issue_3380(self): + # these tests shouldn't throw error in array analysis + def test_impl1(): + a = slice(None, None) + return True + + self.assertEqual(njit(test_impl1, parallel=True)(), test_impl1()) + + def test_impl2(A, a): + b = a + return A[b] + + A = np.arange(10) + a = slice(None) + np.testing.assert_array_equal( + njit(test_impl2, parallel=True)(A, a), test_impl2(A, a)) + + @skip_unsupported + def test_slice_dtype_issue_5056(self): + # see issue 5056 + + @njit(parallel=True) + def test_impl(data): + N = data.shape[0] + sums = np.zeros(N) + for i in prange(N): + sums[i] = np.sum(data[np.int32(0):np.int32(1)]) + return sums + + data = np.arange(10.) + np.testing.assert_array_equal(test_impl(data), test_impl.py_func(data)) + + @skip_unsupported + def test_global_tuple(self): + """make sure a global tuple with non-integer values does not cause errors + (test for #6726). + """ + + def test_impl(): + d = GVAL[0] + return d + + self.assertEqual(njit(test_impl, parallel=True)(), test_impl()) + + +class TestArrayAnalysisInterface(TestCase): + def test_analyze_op_call_interface(self): + # gather _analyze_op_call_* + aoc = {} + for fname in dir(ArrayAnalysis): + if fname.startswith('_analyze_op_call_'): + aoc[fname] = getattr(ArrayAnalysis, fname) + # check interface + def iface_stub(self, scope, equiv_set, loc, args, kws): + pass + expected = utils.pysignature(iface_stub) + for k, v in aoc.items(): + got = utils.pysignature(v) + with self.subTest(fname=k, sig=got): + self.assertEqual(got, expected) + + @skip_unsupported + def test_array_analysis_extensions(self): + # Test that the `array_analysis` object in `array_analysis_extensions` + # can perform analysis on the scope using `equiv_sets`. + from numba.parfors.parfor import Parfor + from numba.parfors import array_analysis + + orig_parfor = array_analysis.array_analysis_extensions[Parfor] + + shared = {'counter': 0} + + def testcode(array_analysis): + # Find call node corresponding to the ``A = empty(n)`` + func_ir = array_analysis.func_ir + for call in func_ir.blocks[0].find_exprs('call'): + callee = func_ir.get_definition(call.func) + if getattr(callee, "value", None) is empty: + if getattr(call.args[0], 'name', None) == 'n': + break + else: + return + + variable_A = func_ir.get_assignee(call) + # n must be equiv to + es = array_analysis.equiv_sets[0] + self.assertTrue(es.is_equiv('n', variable_A.name)) + shared['counter'] += 1 + + def new_parfor(parfor, equiv_set, typemap, array_analysis): + """Recursive array analysis for parfor nodes. + """ + testcode(array_analysis) + # Call original + return orig_parfor( + parfor, equiv_set, typemap, array_analysis, + ) + + try: + # Replace the array-analysis extension for Parfor node + array_analysis.array_analysis_extensions[Parfor] = new_parfor + + empty = np.empty # avoid scanning a getattr in the IR + def f(n): + A = empty(n) + for i in prange(n): + S = np.arange(i) + A[i] = S.sum() + return A + 1 + + got = njit(parallel=True)(f)(10) + executed_count = shared['counter'] + self.assertGreater(executed_count, 0) + finally: + # Re-install the original handler + array_analysis.array_analysis_extensions[Parfor] = orig_parfor + + # Check normal execution + expected = njit(parallel=True)(f)(10) + self.assertPreciseEqual(got, expected) + # Make sure we have uninstalled the handler + self.assertEqual(executed_count, shared['counter']) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_attr.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_attr.py new file mode 100644 index 0000000000000000000000000000000000000000..28e19458630384d59bf59150c1bfaf4ca7ec2902 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_attr.py @@ -0,0 +1,410 @@ +import numpy as np + +import unittest +from numba.np.numpy_support import from_dtype +from numba import njit, typeof +from numba.core import types +from numba.tests.support import (TestCase, MemoryLeakMixin, + skip_parfors_unsupported) +from numba.core.errors import TypingError +from numba.experimental import jitclass + + +def array_dtype(a): + return a.dtype + + +def use_dtype(a, b): + return a.view(b.dtype) + + +def dtype_eq_int64(a): + return a.dtype == np.dtype('int64') + + +def array_itemsize(a): + return a.itemsize + + +def array_nbytes(a): + return a.nbytes + + +def array_shape(a, i): + return a.shape[i] + + +def array_strides(a, i): + return a.strides[i] + + +def array_ndim(a): + return a.ndim + + +def array_size(a): + return a.size + + +def array_flags_contiguous(a): + return a.flags.contiguous + +def array_flags_c_contiguous(a): + return a.flags.c_contiguous + +def array_flags_f_contiguous(a): + return a.flags.f_contiguous + + +def nested_array_itemsize(a): + return a.f.itemsize + +def nested_array_nbytes(a): + return a.f.nbytes + +def nested_array_shape(a): + return a.f.shape + + +def nested_array_strides(a): + return a.f.strides + + +def nested_array_ndim(a): + return a.f.ndim + + +def nested_array_size(a): + return a.f.size + + +def size_after_slicing_usecase(buf, i): + sliced = buf[i] + # Make sure size attribute is not lost + return sliced.size + + +def array_ctypes_data(arr): + return arr.ctypes.data + + +def array_real(arr): + return arr.real + + +def array_imag(arr): + return arr.imag + + +class TestArrayAttr(MemoryLeakMixin, TestCase): + + def setUp(self): + super(TestArrayAttr, self).setUp() + self.a = np.arange(20, dtype=np.int32).reshape(4, 5) + + def check_unary(self, pyfunc, arr): + aryty = typeof(arr) + cfunc = self.get_cfunc(pyfunc, (aryty,)) + expected = pyfunc(arr) + self.assertPreciseEqual(cfunc(arr), expected) + # Retry with forced any layout + cfunc = self.get_cfunc(pyfunc, (aryty.copy(layout='A'),)) + self.assertPreciseEqual(cfunc(arr), expected) + + def check_unary_with_arrays(self, pyfunc,): + self.check_unary(pyfunc, self.a) + self.check_unary(pyfunc, self.a.T) + self.check_unary(pyfunc, self.a[::2]) + # 0-d array + arr = np.array([42]).reshape(()) + self.check_unary(pyfunc, arr) + # array with an empty dimension + arr = np.zeros(0) + self.check_unary(pyfunc, arr) + + # check with reshape + self.check_unary(pyfunc, arr.reshape((1, 0, 2))) + + def get_cfunc(self, pyfunc, argspec): + return njit(argspec)(pyfunc) + + def test_shape(self): + pyfunc = array_shape + cfunc = self.get_cfunc(pyfunc, (types.int32[:,:], types.int32)) + + for i in range(self.a.ndim): + self.assertEqual(pyfunc(self.a, i), cfunc(self.a, i)) + + def test_strides(self): + pyfunc = array_strides + cfunc = self.get_cfunc(pyfunc, (types.int32[:,:], types.int32)) + + for i in range(self.a.ndim): + self.assertEqual(pyfunc(self.a, i), cfunc(self.a, i)) + + def test_ndim(self): + self.check_unary_with_arrays(array_ndim) + + def test_size(self): + self.check_unary_with_arrays(array_size) + + def test_itemsize(self): + self.check_unary_with_arrays(array_itemsize) + + def test_nbytes(self): + self.check_unary_with_arrays(array_nbytes) + + def test_dtype(self): + pyfunc = array_dtype + self.check_unary(pyfunc, self.a) + dtype = np.dtype([('x', np.int8), ('y', np.int8)]) + arr = np.zeros(4, dtype=dtype) + self.check_unary(pyfunc, arr) + + def test_use_dtype(self): + # Test using the dtype attribute inside the Numba function itself + b = np.empty(1, dtype=np.int16) + pyfunc = use_dtype + cfunc = self.get_cfunc(pyfunc, (typeof(self.a), typeof(b))) + expected = pyfunc(self.a, b) + self.assertPreciseEqual(cfunc(self.a, b), expected) + + def test_dtype_equal(self): + # Test checking if a dtype is equal to another dtype + pyfunc = dtype_eq_int64 + self.check_unary(pyfunc, np.empty(1, dtype=np.int16)) + self.check_unary(pyfunc, np.empty(1, dtype=np.int64)) + + def test_flags_contiguous(self): + self.check_unary_with_arrays(array_flags_contiguous) + + def test_flags_c_contiguous(self): + self.check_unary_with_arrays(array_flags_c_contiguous) + + def test_flags_f_contiguous(self): + self.check_unary_with_arrays(array_flags_f_contiguous) + + +class TestNestedArrayAttr(MemoryLeakMixin, unittest.TestCase): + def setUp(self): + super(TestNestedArrayAttr, self).setUp() + dtype = np.dtype([('a', np.int32), ('f', np.int32, (2, 5))]) + self.a = np.recarray(1, dtype)[0] + self.nbrecord = from_dtype(self.a.dtype) + + def get_cfunc(self, pyfunc): + return njit((self.nbrecord,))(pyfunc) + + def test_shape(self): + pyfunc = nested_array_shape + cfunc = self.get_cfunc(pyfunc) + + self.assertEqual(pyfunc(self.a), cfunc(self.a)) + + def test_strides(self): + pyfunc = nested_array_strides + cfunc = self.get_cfunc(pyfunc) + + self.assertEqual(pyfunc(self.a), cfunc(self.a)) + + def test_ndim(self): + pyfunc = nested_array_ndim + cfunc = self.get_cfunc(pyfunc) + + self.assertEqual(pyfunc(self.a), cfunc(self.a)) + + def test_nbytes(self): + pyfunc = nested_array_nbytes + cfunc = self.get_cfunc(pyfunc) + + self.assertEqual(pyfunc(self.a), cfunc(self.a)) + + def test_size(self): + pyfunc = nested_array_size + cfunc = self.get_cfunc(pyfunc) + + self.assertEqual(pyfunc(self.a), cfunc(self.a)) + + def test_itemsize(self): + pyfunc = nested_array_itemsize + cfunc = self.get_cfunc(pyfunc) + + self.assertEqual(pyfunc(self.a), cfunc(self.a)) + + +class TestSlicedArrayAttr(MemoryLeakMixin, unittest.TestCase): + def test_size_after_slicing(self): + pyfunc = size_after_slicing_usecase + cfunc = njit(pyfunc) + arr = np.arange(2 * 5).reshape(2, 5) + for i in range(arr.shape[0]): + self.assertEqual(pyfunc(arr, i), cfunc(arr, i)) + arr = np.arange(2 * 5 * 3).reshape(2, 5, 3) + for i in range(arr.shape[0]): + self.assertEqual(pyfunc(arr, i), cfunc(arr, i)) + + +class TestArrayCTypes(MemoryLeakMixin, TestCase): + + _numba_parallel_test_ = False + + def test_array_ctypes_data(self): + pyfunc = array_ctypes_data + cfunc = njit(pyfunc) + arr = np.arange(3) + self.assertEqual(pyfunc(arr), cfunc(arr)) + + @skip_parfors_unsupported + def test_array_ctypes_ref_error_in_parallel(self): + # Issue #2887 + from ctypes import CFUNCTYPE, c_void_p, c_int32, c_double, c_bool + + @CFUNCTYPE(c_bool, c_void_p, c_int32, c_void_p) + def callback(inptr, size, outptr): + # A ctypes callback that manipulate the incoming pointers. + try: + inbuf = (c_double * size).from_address(inptr) + outbuf = (c_double * 1).from_address(outptr) + a = np.ndarray(size, buffer=inbuf, dtype=np.float64) + b = np.ndarray(1, buffer=outbuf, dtype=np.float64) + b[0] = (a + a.size)[0] + return True + except: + import traceback + traceback.print_exception() + return False + + + # parallel=True is required to reproduce the error. + @njit(parallel=True) + def foo(size): + arr = np.ones(size) + out = np.empty(1) + # Exercise array.ctypes + inct = arr.ctypes + outct = out.ctypes + # The reference to `arr` is dead by now + status = callback(inct.data, size, outct.data) + return status, out[0] + + size = 3 + status, got = foo(size) + self.assertTrue(status) + self.assertPreciseEqual(got, (np.ones(size) + size)[0]) + + +class TestRealImagAttr(MemoryLeakMixin, TestCase): + def check_complex(self, pyfunc): + cfunc = njit(pyfunc) + # test 1D + size = 10 + arr = np.arange(size) + np.arange(size) * 10j + self.assertPreciseEqual(pyfunc(arr), cfunc(arr)) + # test 2D + arr = arr.reshape(2, 5) + self.assertPreciseEqual(pyfunc(arr), cfunc(arr)) + + def test_complex_real(self): + self.check_complex(array_real) + + def test_complex_imag(self): + self.check_complex(array_imag) + + def check_number_real(self, dtype): + pyfunc = array_real + cfunc = njit(pyfunc) + # test 1D + size = 10 + arr = np.arange(size, dtype=dtype) + self.assertPreciseEqual(pyfunc(arr), cfunc(arr)) + # test 2D + arr = arr.reshape(2, 5) + self.assertPreciseEqual(pyfunc(arr), cfunc(arr)) + # test identity + self.assertEqual(arr.data, pyfunc(arr).data) + self.assertEqual(arr.data, cfunc(arr).data) + # test writable + real = cfunc(arr) + self.assertNotEqual(arr[0, 0], 5) + real[0, 0] = 5 + self.assertEqual(arr[0, 0], 5) + + def test_number_real(self): + """ + Testing .real of non-complex dtypes + """ + for dtype in [np.uint8, np.int32, np.float32, np.float64]: + self.check_number_real(dtype) + + def check_number_imag(self, dtype): + pyfunc = array_imag + cfunc = njit(pyfunc) + # test 1D + size = 10 + arr = np.arange(size, dtype=dtype) + self.assertPreciseEqual(pyfunc(arr), cfunc(arr)) + # test 2D + arr = arr.reshape(2, 5) + self.assertPreciseEqual(pyfunc(arr), cfunc(arr)) + # test are zeros + self.assertEqual(cfunc(arr).tolist(), np.zeros_like(arr).tolist()) + # test readonly + imag = cfunc(arr) + with self.assertRaises(ValueError) as raises: + imag[0] = 1 + self.assertEqual('assignment destination is read-only', + str(raises.exception)) + + def test_number_imag(self): + """ + Testing .imag of non-complex dtypes + """ + for dtype in [np.uint8, np.int32, np.float32, np.float64]: + self.check_number_imag(dtype) + + def test_record_real(self): + rectyp = np.dtype([('real', np.float32), ('imag', np.complex64)]) + arr = np.zeros(3, dtype=rectyp) + arr['real'] = np.random.random(arr.size) + arr['imag'] = np.random.random(arr.size) * 1.3j + + # check numpy behavior + # .real is identity + self.assertIs(array_real(arr), arr) + # .imag is zero_like + self.assertEqual(array_imag(arr).tolist(), np.zeros_like(arr).tolist()) + + # check numba behavior + # it's most likely a user error, anyway + jit_array_real = njit(array_real) + jit_array_imag = njit(array_imag) + + with self.assertRaises(TypingError) as raises: + jit_array_real(arr) + self.assertIn("cannot access .real of array of Record", + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + jit_array_imag(arr) + self.assertIn("cannot access .imag of array of Record", + str(raises.exception)) + +class TestJitclassFlagsSegfault(MemoryLeakMixin, TestCase): + """Regression test for: https://github.com/numba/numba/issues/4775 """ + + def test(self): + + @jitclass(dict()) + class B(object): + + def __init__(self): + pass + + def foo(self, X): + X.flags + + Z = B() + Z.foo(np.ones(4)) + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_constants.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_constants.py new file mode 100644 index 0000000000000000000000000000000000000000..944786fc15168b096e7e0cbdcf511eac8b3df5ff --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_constants.py @@ -0,0 +1,190 @@ +import numpy as np + +import unittest +from numba import njit +from numba.core.errors import TypingError +from numba import jit, typeof +from numba.core import types +from numba.tests.support import TestCase + + +a0 = np.array(42) + +s1 = np.int32(64) + +a1 = np.arange(12) +a2 = a1[::2] +a3 = a1.reshape((3, 4)).T + +dt = np.dtype([('x', np.int8), ('y', 'S3')]) + +a4 = np.arange(32, dtype=np.int8).view(dt) +a5 = a4[::-2] + +# A recognizable data string +a6 = np.frombuffer(b"XXXX_array_contents_XXXX", dtype=np.float32) + + +myarray = np.array([1, ]) + + +def getitem0(i): + return a0[()] + + +def getitem1(i): + return a1[i] + + +def getitem2(i): + return a2[i] + + +def getitem3(i): + return a3[i] + + +def getitem4(i): + return a4[i] + + +def getitem5(i): + return a5[i] + + +def getitem6(i): + return a6[i] + + +def use_arrayscalar_const(): + return s1 + + +def write_to_global_array(): + myarray[0] = 1 + + +def bytes_as_const_array(): + return np.frombuffer(b'foo', dtype=np.uint8) + + +class TestConstantArray(TestCase): + """ + Test array constants. + """ + + def check_array_const(self, pyfunc): + cfunc = njit((types.int32,))(pyfunc) + for i in [0, 1, 2]: + np.testing.assert_array_equal(pyfunc(i), cfunc(i)) + + def test_array_const_0d(self): + self.check_array_const(getitem0) + + def test_array_const_1d_contig(self): + self.check_array_const(getitem1) + + def test_array_const_1d_noncontig(self): + self.check_array_const(getitem2) + + def test_array_const_2d(self): + self.check_array_const(getitem3) + + def test_record_array_const_contig(self): + self.check_array_const(getitem4) + + def test_record_array_const_noncontig(self): + self.check_array_const(getitem5) + + def test_array_const_alignment(self): + """ + Issue #1933: the array declaration in the LLVM IR must have + the right alignment specified. + """ + sig = (types.intp,) + cfunc = jit(sig, nopython=True)(getitem6) + ir = cfunc.inspect_llvm(sig) + for line in ir.splitlines(): + if 'XXXX_array_contents_XXXX' in line: + self.assertIn("constant [24 x i8]", line) # sanity check + # Should be the ABI-required alignment for float32 + # on most platforms... + self.assertIn(", align 4", line) + break + else: + self.fail("could not find array declaration in LLVM IR") + + def test_arrayscalar_const(self): + pyfunc = use_arrayscalar_const + cfunc = njit((),)(pyfunc) + self.assertEqual(pyfunc(), cfunc()) + + def test_write_to_global_array(self): + pyfunc = write_to_global_array + with self.assertRaises(TypingError): + njit((),)(pyfunc) + + def test_issue_1850(self): + """ + This issue is caused by an unresolved bug in numpy since version 1.6. + See numpy GH issue #3147. + """ + constarr = np.array([86]) + + def pyfunc(): + return constarr[0] + + cfunc = njit((),)(pyfunc) + out = cfunc() + self.assertEqual(out, 86) + + @TestCase.run_test_in_subprocess # isolate MCJIT use + def test_too_big_to_freeze(self): + """ + Test issue https://github.com/numba/numba/issues/2188 where freezing + a constant array into the code that's prohibitively long and consumes + too much RAM. + """ + def test(biggie): + expect = np.copy(biggie) + self.assertEqual(typeof(biggie), typeof(expect)) + + def pyfunc(): + return biggie + + cfunc = njit((),)(pyfunc) + # Check that the array is not frozen into the LLVM IR. + # LLVM size must be less than the array size. + self.assertLess(len(cfunc.inspect_llvm((),)), biggie.nbytes) + # Run and test result + out = cfunc() + self.assertIs(biggie, out) + # Remove all local references to biggie + del out + biggie = None # del biggie is syntax error in py2 + # Run again and verify result + out = cfunc() + np.testing.assert_equal(expect, out) + self.assertEqual(typeof(expect), typeof(out)) + + nelem = 10**7 # 10 million items + + c_array = np.arange(nelem).reshape(nelem) + f_array = np.asfortranarray(np.random.random((2, nelem // 2))) + self.assertEqual(typeof(c_array).layout, 'C') + self.assertEqual(typeof(f_array).layout, 'F') + # Test C contig + test(c_array) + # Test F contig + test(f_array) + + +class TestConstantBytes(TestCase): + def test_constant_bytes(self): + pyfunc = bytes_as_const_array + cfunc = njit((),)(pyfunc) + np.testing.assert_array_equal(pyfunc(), cfunc()) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_exprs.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_exprs.py new file mode 100644 index 0000000000000000000000000000000000000000..090bbd5ad483dde698299ac7f02d81812e11a0ee --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_exprs.py @@ -0,0 +1,742 @@ +import gc +from io import StringIO + +import numpy as np + +from numba import njit, vectorize +from numba import typeof +from numba.core import utils, types, typing, ir, compiler, cpu, cgutils +from numba.core.compiler import Compiler, Flags +from numba.core.registry import cpu_target +from numba.tests.support import (MemoryLeakMixin, TestCase, temp_directory, + create_temp_module) +from numba.extending import ( + overload, + models, + lower_builtin, + register_model, + make_attribute_wrapper, + type_callable, + typeof_impl +) +import operator +import textwrap + +import unittest + + +class Namespace(dict): + def __getattr__(s, k): + return s[k] if k in s else super(Namespace, s).__getattr__(k) + +def axy(a, x, y): + return a * x + y + +def ax2(a, x, y): + return a * x + y + +def pos_root(As, Bs, Cs): + return (-Bs + (((Bs ** 2.) - (4. * As * Cs)) ** 0.5)) / (2. * As) + +def neg_root_common_subexpr(As, Bs, Cs): + _2As = 2. * As + _4AsCs = 2. * _2As * Cs + _Bs2_4AsCs = (Bs ** 2. - _4AsCs) + return (-Bs - (_Bs2_4AsCs ** 0.5)) / _2As + +def neg_root_complex_subexpr(As, Bs, Cs): + _2As = 2. * As + _4AsCs = 2. * _2As * Cs + _Bs2_4AsCs = (Bs ** 2. - _4AsCs) + 0j # Force into the complex domain. + return (-Bs - (_Bs2_4AsCs ** 0.5)) / _2As + +vaxy = vectorize(axy) + +def call_stuff(a0, a1): + return np.cos(vaxy(a0, np.sin(a1) - 1., 1.)) + +def are_roots_imaginary(As, Bs, Cs): + return (Bs ** 2 - 4 * As * Cs) < 0 + +def div_add(As, Bs, Cs): + return As / Bs + Cs + +def cube(As): + return As ** 3 + +def explicit_output(a, b, out): + np.cos(a, out) + return np.add(out, b, out) + +def variable_name_reuse(a, b, c, d): + u = a + b + u = u - a * b + u = u * c + d + return u + + +# From issue #1264 +def distance_matrix(vectors): + n_vectors = vectors.shape[0] + result = np.empty((n_vectors, n_vectors), dtype=np.float64) + + for i in range(n_vectors): + for j in range(i, n_vectors): + result[i,j] = result[j,i] = np.sum( + (vectors[i] - vectors[j]) ** 2) ** 0.5 + + return result + + +class RewritesTester(Compiler): + @classmethod + def mk_pipeline(cls, args, return_type=None, flags=None, locals={}, + library=None, typing_context=None, target_context=None): + if not flags: + flags = Flags() + flags.nrt = True + if typing_context is None: + typing_context = cpu_target.typing_context + if target_context is None: + target_context = cpu_target.target_context + return cls(typing_context, target_context, library, args, return_type, + flags, locals) + + @classmethod + def mk_no_rw_pipeline(cls, args, return_type=None, flags=None, locals={}, + library=None, **kws): + if not flags: + flags = Flags() + flags.no_rewrites = True + return cls.mk_pipeline(args, return_type, flags, locals, library, **kws) + + +class TestArrayExpressions(MemoryLeakMixin, TestCase): + + def _compile_function(self, fn, arg_tys): + """ + Compile the given function both without and with rewrites enabled. + """ + control_pipeline = RewritesTester.mk_no_rw_pipeline(arg_tys) + cres_0 = control_pipeline.compile_extra(fn) + control_cfunc = cres_0.entry_point + + test_pipeline = RewritesTester.mk_pipeline(arg_tys) + cres_1 = test_pipeline.compile_extra(fn) + test_cfunc = cres_1.entry_point + + return control_pipeline, control_cfunc, test_pipeline, test_cfunc + + def test_simple_expr(self): + ''' + Using a simple array expression, verify that rewriting is taking + place, and is fusing loops. + ''' + A = np.linspace(0,1,10) + X = np.linspace(2,1,10) + Y = np.linspace(1,2,10) + arg_tys = [typeof(arg) for arg in (A, X, Y)] + + control_pipeline, nb_axy_0, test_pipeline, nb_axy_1 = \ + self._compile_function(axy, arg_tys) + + control_pipeline2 = RewritesTester.mk_no_rw_pipeline(arg_tys) + cres_2 = control_pipeline2.compile_extra(ax2) + nb_ctl = cres_2.entry_point + + expected = nb_axy_0(A, X, Y) + actual = nb_axy_1(A, X, Y) + control = nb_ctl(A, X, Y) + np.testing.assert_array_equal(expected, actual) + np.testing.assert_array_equal(control, actual) + + ir0 = control_pipeline.state.func_ir.blocks + ir1 = test_pipeline.state.func_ir.blocks + ir2 = control_pipeline2.state.func_ir.blocks + self.assertEqual(len(ir0), len(ir1)) + self.assertEqual(len(ir0), len(ir2)) + # The rewritten IR should be smaller than the original. + self.assertGreater(len(ir0[0].body), len(ir1[0].body)) + self.assertEqual(len(ir0[0].body), len(ir2[0].body)) + + def _get_array_exprs(self, block): + for instr in block: + if isinstance(instr, ir.Assign): + if isinstance(instr.value, ir.Expr): + if instr.value.op == 'arrayexpr': + yield instr + + def _array_expr_to_set(self, expr, out=None): + ''' + Convert an array expression tree into a set of operators. + ''' + if out is None: + out = set() + if not isinstance(expr, tuple): + raise ValueError("{0} not a tuple".format(expr)) + operation, operands = expr + processed_operands = [] + for operand in operands: + if isinstance(operand, tuple): + operand, _ = self._array_expr_to_set(operand, out) + processed_operands.append(operand) + processed_expr = operation, tuple(processed_operands) + out.add(processed_expr) + return processed_expr, out + + def _test_root_function(self, fn=pos_root): + A = np.random.random(10) + B = np.random.random(10) + 1. # Increase likelihood of real + # root (could add 2 to force all + # roots to be real). + C = np.random.random(10) + arg_tys = [typeof(arg) for arg in (A, B, C)] + + control_pipeline = RewritesTester.mk_no_rw_pipeline(arg_tys) + control_cres = control_pipeline.compile_extra(fn) + nb_fn_0 = control_cres.entry_point + + test_pipeline = RewritesTester.mk_pipeline(arg_tys) + test_cres = test_pipeline.compile_extra(fn) + nb_fn_1 = test_cres.entry_point + + np_result = fn(A, B, C) + nb_result_0 = nb_fn_0(A, B, C) + nb_result_1 = nb_fn_1(A, B, C) + np.testing.assert_array_almost_equal(np_result, nb_result_0) + np.testing.assert_array_almost_equal(nb_result_0, nb_result_1) + + return Namespace(locals()) + + def _test_cube_function(self, fn=cube): + A = np.arange(10, dtype=np.float64) + arg_tys = (typeof(A),) + + control_pipeline = RewritesTester.mk_no_rw_pipeline(arg_tys) + control_cres = control_pipeline.compile_extra(fn) + nb_fn_0 = control_cres.entry_point + + test_pipeline = RewritesTester.mk_pipeline(arg_tys) + test_cres = test_pipeline.compile_extra(fn) + nb_fn_1 = test_cres.entry_point + + expected = A ** 3 + self.assertPreciseEqual(expected, nb_fn_0(A)) + self.assertPreciseEqual(expected, nb_fn_1(A)) + + return Namespace(locals()) + + def _test_explicit_output_function(self, fn): + """ + Test function having a (a, b, out) signature where *out* is + an output array the function writes into. + """ + A = np.arange(10, dtype=np.float64) + B = A + 1 + arg_tys = (typeof(A),) * 3 + + control_pipeline, control_cfunc, test_pipeline, test_cfunc = \ + self._compile_function(fn, arg_tys) + + def run_func(fn): + out = np.zeros_like(A) + fn(A, B, out) + return out + + expected = run_func(fn) + self.assertPreciseEqual(expected, run_func(control_cfunc)) + self.assertPreciseEqual(expected, run_func(test_cfunc)) + + return Namespace(locals()) + + def _assert_array_exprs(self, block, expected_count): + """ + Assert the *block* has the expected number of array expressions + in it. + """ + rewrite_count = len(list(self._get_array_exprs(block))) + self.assertEqual(rewrite_count, expected_count) + + def _assert_total_rewrite(self, control_ir, test_ir, trivial=False): + """ + Given two dictionaries of Numba IR blocks, check to make sure the + control IR has no array expressions, while the test IR + contains one and only one. + """ + # Both IRs have the same number of blocks (presumably 1) + self.assertEqual(len(control_ir), len(test_ir)) + control_block = control_ir[0].body + test_block = test_ir[0].body + self._assert_array_exprs(control_block, 0) + self._assert_array_exprs(test_block, 1) + if not trivial: + # If the expression wasn't trivial, the block length should + # have decreased (since a sequence of exprs was replaced + # with a single nested array expr). + self.assertGreater(len(control_block), len(test_block)) + + def _assert_no_rewrite(self, control_ir, test_ir): + """ + Given two dictionaries of Numba IR blocks, check to make sure + the control IR and the test IR both have no array expressions. + """ + self.assertEqual(len(control_ir), len(test_ir)) + # All blocks should be identical, and not rewritten + for k, v in control_ir.items(): + control_block = v.body + test_block = test_ir[k].body + self.assertEqual(len(control_block), len(test_block)) + self._assert_array_exprs(control_block, 0) + self._assert_array_exprs(test_block, 0) + + def test_trivial_expr(self): + """ + Ensure even a non-nested expression is rewritten, as it can enable + scalar optimizations such as rewriting `x ** 2`. + """ + ns = self._test_cube_function() + self._assert_total_rewrite(ns.control_pipeline.state.func_ir.blocks, + ns.test_pipeline.state.func_ir.blocks, + trivial=True) + + def test_complicated_expr(self): + ''' + Using the polynomial root function, ensure the full expression is + being put in the same kernel with no remnants of intermediate + array expressions. + ''' + ns = self._test_root_function() + self._assert_total_rewrite(ns.control_pipeline.state.func_ir.blocks, + ns.test_pipeline.state.func_ir.blocks) + + def test_common_subexpressions(self, fn=neg_root_common_subexpr): + ''' + Attempt to verify that rewriting will incorporate user common + subexpressions properly. + ''' + ns = self._test_root_function(fn) + ir0 = ns.control_pipeline.state.func_ir.blocks + ir1 = ns.test_pipeline.state.func_ir.blocks + self.assertEqual(len(ir0), len(ir1)) + self.assertGreater(len(ir0[0].body), len(ir1[0].body)) + self.assertEqual(len(list(self._get_array_exprs(ir0[0].body))), 0) + # Verify that we didn't rewrite everything into a monolithic + # array expression since we stored temporary values in + # variables that might be used later (from the optimization's + # point of view). + array_expr_instrs = list(self._get_array_exprs(ir1[0].body)) + self.assertGreater(len(array_expr_instrs), 1) + # Now check that we haven't duplicated any subexpressions in + # the rewritten code. + array_sets = list(self._array_expr_to_set(instr.value.expr)[1] + for instr in array_expr_instrs) + for expr_set_0, expr_set_1 in zip(array_sets[:-1], array_sets[1:]): + intersections = expr_set_0.intersection(expr_set_1) + if intersections: + self.fail("Common subexpressions detected in array " + "expressions ({0})".format(intersections)) + + def test_complex_subexpression(self): + return self.test_common_subexpressions(neg_root_complex_subexpr) + + def test_ufunc_and_dufunc_calls(self): + ''' + Verify that ufunc and DUFunc calls are being properly included in + array expressions. + ''' + A = np.random.random(10) + B = np.random.random(10) + arg_tys = [typeof(arg) for arg in (A, B)] + + vaxy_descr = vaxy._dispatcher.targetdescr + control_pipeline = RewritesTester.mk_no_rw_pipeline( + arg_tys, + typing_context=vaxy_descr.typing_context, + target_context=vaxy_descr.target_context) + cres_0 = control_pipeline.compile_extra(call_stuff) + nb_call_stuff_0 = cres_0.entry_point + + test_pipeline = RewritesTester.mk_pipeline( + arg_tys, + typing_context=vaxy_descr.typing_context, + target_context=vaxy_descr.target_context) + cres_1 = test_pipeline.compile_extra(call_stuff) + nb_call_stuff_1 = cres_1.entry_point + + expected = call_stuff(A, B) + control = nb_call_stuff_0(A, B) + actual = nb_call_stuff_1(A, B) + np.testing.assert_array_almost_equal(expected, control) + np.testing.assert_array_almost_equal(expected, actual) + + self._assert_total_rewrite(control_pipeline.state.func_ir.blocks, + test_pipeline.state.func_ir.blocks) + + def test_cmp_op(self): + ''' + Verify that comparison operators are supported by the rewriter. + ''' + ns = self._test_root_function(are_roots_imaginary) + self._assert_total_rewrite(ns.control_pipeline.state.func_ir.blocks, + ns.test_pipeline.state.func_ir.blocks) + + def test_explicit_output(self): + """ + Check that ufunc calls with explicit outputs are not rewritten. + """ + ns = self._test_explicit_output_function(explicit_output) + self._assert_no_rewrite(ns.control_pipeline.state.func_ir.blocks, + ns.test_pipeline.state.func_ir.blocks) + + +class TestRewriteIssues(MemoryLeakMixin, TestCase): + + def test_issue_1184(self): + from numba import jit + import numpy as np + + @jit(nopython=True) + def foo(arr): + return arr + + @jit(nopython=True) + def bar(arr): + c = foo(arr) + d = foo(arr) # two calls to trigger rewrite + return c, d + + arr = np.arange(10) + out_c, out_d = bar(arr) + self.assertIs(out_c, out_d) + self.assertIs(out_c, arr) + + def test_issue_1264(self): + n = 100 + x = np.random.uniform(size=n*3).reshape((n,3)) + expected = distance_matrix(x) + actual = njit(distance_matrix)(x) + np.testing.assert_array_almost_equal(expected, actual) + # Avoid sporadic failures in MemoryLeakMixin.tearDown() + gc.collect() + + def test_issue_1372(self): + """Test array expression with duplicated term""" + from numba import njit + + @njit + def foo(a, b): + b = np.sin(b) + return b + b + a + + a = np.random.uniform(10) + b = np.random.uniform(10) + expect = foo.py_func(a, b) + got = foo(a, b) + np.testing.assert_allclose(got, expect) + + def test_unary_arrayexpr(self): + """ + Typing of unary array expression (np.negate) can be incorrect. + """ + @njit + def foo(a, b): + return b - a + -a + + b = 1.5 + a = np.arange(10, dtype=np.int32) + + expect = foo.py_func(a, b) + got = foo(a, b) + self.assertPreciseEqual(got, expect) + + def test_bitwise_arrayexpr(self): + """ + Typing of bitwise boolean array expression can be incorrect + (issue #1813). + """ + @njit + def foo(a, b): + return ~(a & (~b)) + + a = np.array([True, True, False, False]) + b = np.array([False, True, False, True]) + + expect = foo.py_func(a, b) + got = foo(a, b) + self.assertPreciseEqual(got, expect) + + def test_annotations(self): + """ + Type annotation of array expressions with disambiguated + variable names (issue #1466). + """ + cfunc = njit(variable_name_reuse) + + a = np.linspace(0, 1, 10) + cfunc(a, a, a, a) + + buf = StringIO() + cfunc.inspect_types(buf) + res = buf.getvalue() + self.assertIn("# u.1 = ", res) + self.assertIn("# u.2 = ", res) + + def test_issue_5599_name_collision(self): + # The original error will fail in lowering of the array_expr + @njit + def f(x): + arr = np.ones(x) + + for _ in range(2): + val = arr * arr + arr = arr.copy() + return arr + + got = f(5) + expect = f.py_func(5) + np.testing.assert_array_equal(got, expect) + + +class TestSemantics(MemoryLeakMixin, unittest.TestCase): + + def test_division_by_zero(self): + # Array expressions should follow the Numpy error model + # i.e. 1./0. returns +inf instead of raising ZeroDivisionError + pyfunc = div_add + cfunc = njit(pyfunc) + + a = np.float64([0.0, 1.0, float('inf')]) + b = np.float64([0.0, 0.0, 1.0]) + c = np.ones_like(a) + + expect = pyfunc(a, b, c) + got = cfunc(a, b, c) + np.testing.assert_array_equal(expect, got) + + +class TestOptionals(MemoryLeakMixin, unittest.TestCase): + """ Tests the arrival and correct lowering of Optional types at a arrayexpr + derived ufunc, see #3972""" + + def test_optional_scalar_type(self): + + @njit + def arr_expr(x, y): + return x + y + + @njit + def do_call(x, y): + if y > 0: + z = None + else: + z = y + return arr_expr(x, z) + + args = (np.arange(5), -1.2) + + # check result + res = do_call(*args) + expected = do_call.py_func(*args) + np.testing.assert_allclose(res, expected) + + # check type + s = arr_expr.signatures + oty = s[0][1] + self.assertTrue(isinstance(oty, types.Optional)) + self.assertTrue(isinstance(oty.type, types.Float)) + + def test_optional_array_type(self): + + @njit + def arr_expr(x, y): + return x + y + + @njit + def do_call(x, y): + if y[0] > 0: + z = None + else: + z = y + return arr_expr(x, z) + + args = (np.arange(5), np.arange(5.)) + + # check result + res = do_call(*args) + expected = do_call.py_func(*args) + np.testing.assert_allclose(res, expected) + + # check type + s = arr_expr.signatures + oty = s[0][1] + self.assertTrue(isinstance(oty, types.Optional)) + self.assertTrue(isinstance(oty.type, types.Array)) + self.assertTrue(isinstance(oty.type.dtype, types.Float)) + + +class TestOptionalsExceptions(MemoryLeakMixin, unittest.TestCase): + # same as above, but the Optional resolves to None and TypeError's + + def test_optional_scalar_type_exception_on_none(self): + + self.disable_leak_check() + + @njit + def arr_expr(x, y): + return x + y + + @njit + def do_call(x, y): + if y > 0: + z = None + else: + z = y + return arr_expr(x, z) + + args = (np.arange(5), 1.0) + + # check result + with self.assertRaises(TypeError) as raises: + do_call(*args) + + self.assertIn("expected float64, got None", str(raises.exception)) + + # check type + s = arr_expr.signatures + oty = s[0][1] + self.assertTrue(isinstance(oty, types.Optional)) + self.assertTrue(isinstance(oty.type, types.Float)) + + def test_optional_array_type_exception_on_none(self): + + self.disable_leak_check() + + @njit + def arr_expr(x, y): + return x + y + + @njit + def do_call(x, y): + if y[0] > 0: + z = None + else: + z = y + return arr_expr(x, z) + + args = (np.arange(5), np.arange(1., 5.)) + + # check result + with self.assertRaises(TypeError) as raises: + do_call(*args) + + excstr = str(raises.exception) + self.assertIn("expected array(float64,", excstr) + self.assertIn("got None", excstr) + + # check type + s = arr_expr.signatures + oty = s[0][1] + self.assertTrue(isinstance(oty, types.Optional)) + self.assertTrue(isinstance(oty.type, types.Array)) + self.assertTrue(isinstance(oty.type.dtype, types.Float)) + + +class TestExternalTypes(MemoryLeakMixin, unittest.TestCase): + """ Tests RewriteArrayExprs with external (user defined) types, + see #5157""" + + source_lines = textwrap.dedent(""" + from numba.core import types + + class FooType(types.Type): + def __init__(self): + super(FooType, self).__init__(name='Foo') + """) + + def make_foo_type(self, FooType): + class Foo(object): + def __init__(self, value): + self.value = value + + @register_model(FooType) + class FooModel(models.StructModel): + def __init__(self, dmm, fe_type): + members = [("value", types.intp)] + models.StructModel.__init__(self, dmm, fe_type, members) + + make_attribute_wrapper(FooType, "value", "value") + + @type_callable(Foo) + def type_foo(context): + def typer(value): + return FooType() + + return typer + + @lower_builtin(Foo, types.intp) + def impl_foo(context, builder, sig, args): + typ = sig.return_type + [value] = args + foo = cgutils.create_struct_proxy(typ)(context, builder) + foo.value = value + return foo._getvalue() + + @typeof_impl.register(Foo) + def typeof_foo(val, c): + return FooType() + + return Foo, FooType + + def test_external_type(self): + with create_temp_module(self.source_lines) as test_module: + Foo, FooType = self.make_foo_type(test_module.FooType) + + # sum of foo class instance and array return an array + # binary operation with foo class instance as one of args + @overload(operator.add) + def overload_foo_add(lhs, rhs): + if isinstance(lhs, FooType) and isinstance(rhs, types.Array): + def imp(lhs, rhs): + return np.array([lhs.value, rhs[0]]) + + return imp + + # sum of 2 foo class instances return an array + # binary operation with 2 foo class instances as args + @overload(operator.add) + def overload_foo_add(lhs, rhs): + if isinstance(lhs, FooType) and isinstance(rhs, FooType): + def imp(lhs, rhs): + return np.array([lhs.value, rhs.value]) + + return imp + + # neg of foo class instance return an array + # unary operation with foo class instance arg + @overload(operator.neg) + def overload_foo_neg(x): + if isinstance(x, FooType): + def imp(x): + return np.array([-x.value]) + + return imp + + @njit + def arr_expr_sum1(x, y): + return Foo(x) + np.array([y]) + + @njit + def arr_expr_sum2(x, y): + return Foo(x) + Foo(y) + + @njit + def arr_expr_neg(x): + return -Foo(x) + + np.testing.assert_array_equal(arr_expr_sum1(0, 1), np.array([0, 1])) + np.testing.assert_array_equal(arr_expr_sum2(2, 3), np.array([2, 3])) + np.testing.assert_array_equal(arr_expr_neg(4), np.array([-4])) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_iterators.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_iterators.py new file mode 100644 index 0000000000000000000000000000000000000000..40e273b35d752c27a24e38d109c87a7d7b6d5f5d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_iterators.py @@ -0,0 +1,555 @@ +import itertools + +import numpy as np + +from numba import jit, njit, typeof +from numba.core import types +from numba.tests.support import TestCase, MemoryLeakMixin +import unittest + + +def array_iter(arr): + total = 0 + for i, v in enumerate(arr): + total += i * v + return total + +def array_iter_items(arr): + return list(iter(arr)) + +def array_view_iter(arr, idx): + total = 0 + for i, v in enumerate(arr[idx]): + total += i * v + return total + +def array_flat(arr, out): + for i, v in enumerate(arr.flat): + out[i] = v + +def array_flat_getitem(arr, ind): + return arr.flat[ind] + +def array_flat_setitem(arr, ind, val): + arr.flat[ind] = val + +def array_flat_sum(arr): + s = 0 + for i, v in enumerate(arr.flat): + s = s + (i + 1) * v + return s + +def array_flat_len(arr): + return len(arr.flat) + +def array_ndenumerate_sum(arr): + s = 0 + for (i, j), v in np.ndenumerate(arr): + s = s + (i + 1) * (j + 1) * v + return s + +def np_ndindex_empty(): + s = 0 + for ind in np.ndindex(()): + s += s + len(ind) + 1 + return s + +def np_ndindex(x, y): + s = 0 + n = 0 + for i, j in np.ndindex(x, y): + s = s + (i + 1) * (j + 1) + return s + +def np_ndindex_array(arr): + s = 0 + n = 0 + for indices in np.ndindex(arr.shape): + for i, j in enumerate(indices): + s = s + (i + 1) * (j + 1) + return s + +def np_nditer1(a): + res = [] + for u in np.nditer(a): + res.append(u.item()) + return res + +def np_nditer2(a, b): + res = [] + for u, v in np.nditer((a, b)): + res.append((u.item(), v.item())) + return res + +def np_nditer3(a, b, c): + res = [] + for u, v, w in np.nditer((a, b, c)): + res.append((u.item(), v.item(), w.item())) + return res + +def iter_next(arr): + it = iter(arr) + it2 = iter(arr) + return next(it), next(it), next(it2) + + +# +# Test premature free (see issue #2112). +# The following test allocates an array ``x`` inside the body. +# The compiler will put a ``del x`` right after the last use of ``x``, +# which is right after the creation of the array iterator and +# before the loop is entered. If the iterator does not incref the array, +# the iterator will be reading garbage data of free'ed memory. +# + +def array_flat_premature_free(size): + x = np.arange(size) + res = np.zeros_like(x, dtype=np.intp) + for i, v in enumerate(x.flat): + res[i] = v + return res + +def array_ndenumerate_premature_free(size): + x = np.arange(size) + res = np.zeros_like(x, dtype=np.intp) + for i, v in np.ndenumerate(x): + res[i] = v + return res + + +class TestArrayIterators(MemoryLeakMixin, TestCase): + """ + Test array.flat, np.ndenumerate(), etc. + """ + + def setUp(self): + super(TestArrayIterators, self).setUp() + + def check_array_iter_1d(self, arr): + pyfunc = array_iter + cfunc = njit((typeof(arr),))(pyfunc) + expected = pyfunc(arr) + self.assertPreciseEqual(cfunc(arr), expected) + + def check_array_iter_items(self, arr): + pyfunc = array_iter_items + cfunc = njit((typeof(arr),))(pyfunc) + expected = pyfunc(arr) + self.assertPreciseEqual(cfunc(arr), expected) + + def check_array_view_iter(self, arr, index): + pyfunc = array_view_iter + cfunc = njit((typeof(arr), typeof(index),))(pyfunc) + expected = pyfunc(arr, index) + self.assertPreciseEqual(cfunc(arr, index), expected) + + def check_array_flat(self, arr, arrty=None): + out = np.zeros(arr.size, dtype=arr.dtype) + nb_out = out.copy() + if arrty is None: + arrty = typeof(arr) + + cfunc = njit((arrty, typeof(out),))(array_flat) + + array_flat(arr, out) + cfunc(arr, nb_out) + + self.assertPreciseEqual(out, nb_out) + + def check_array_unary(self, arr, arrty, func): + cfunc = njit((arrty,))(func) + self.assertPreciseEqual(cfunc(arr), func(arr)) + + def check_array_ndenumerate_sum(self, arr, arrty): + self.check_array_unary(arr, arrty, array_ndenumerate_sum) + + def test_array_iter(self): + # Test iterating over arrays + arr = np.arange(6) + self.check_array_iter_1d(arr) + self.check_array_iter_items(arr) + arr = arr[::2] + self.assertFalse(arr.flags.c_contiguous) + self.assertFalse(arr.flags.f_contiguous) + self.check_array_iter_1d(arr) + self.check_array_iter_items(arr) + arr = np.bool_([1, 0, 0, 1]) + self.check_array_iter_1d(arr) + self.check_array_iter_items(arr) + arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) + self.check_array_iter_items(arr) + self.check_array_iter_items(arr.T) + + def test_array_iter_yielded_order(self): + # See issue #5692 + @jit(nopython=True) + def foo(arr): + t = [] + for y1 in arr: + for y2 in y1: + t.append(y2.ravel()) + return t + + # 'F' ordered + arr = np.arange(24).reshape((2, 3, 4), order='F') + expected = foo.py_func(arr) + got = foo(arr) + self.assertPreciseEqual(expected, got) + + # 'A' ordered, outer strided + arr = np.arange(64).reshape((4, 8, 2), order='F')[::2, :, :] + expected = foo.py_func(arr) + got = foo(arr) + self.assertPreciseEqual(expected, got) + + # 'A' ordered, middle strided + arr = np.arange(64).reshape((4, 8, 2), order='F')[:, ::2, :] + expected = foo.py_func(arr) + got = foo(arr) + self.assertPreciseEqual(expected, got) + + # 'A' ordered, inner strided + arr = np.arange(64).reshape((4, 8, 2), order='F')[:, :, ::2] + expected = foo.py_func(arr) + got = foo(arr) + self.assertPreciseEqual(expected, got) + + @jit(nopython=True) + def flag_check(arr): + out = [] + for sub in arr: + out.append((sub, sub.flags.c_contiguous, + sub.flags.f_contiguous)) + return out + + arr = np.arange(10).reshape((2, 5), order='F') + expected = flag_check.py_func(arr) + got = flag_check(arr) + + self.assertEqual(len(expected), len(got)) + ex_arr, e_flag_c, e_flag_f = expected[0] + go_arr, g_flag_c, g_flag_f = got[0] + np.testing.assert_allclose(ex_arr, go_arr) + self.assertEqual(e_flag_c, g_flag_c) + self.assertEqual(e_flag_f, g_flag_f) + + def test_array_view_iter(self): + # Test iterating over a 1d view over a 2d array + arr = np.arange(12).reshape((3, 4)) + self.check_array_view_iter(arr, 1) + self.check_array_view_iter(arr.T, 1) + arr = arr[::2] + self.check_array_view_iter(arr, 1) + arr = np.bool_([1, 0, 0, 1]).reshape((2, 2)) + self.check_array_view_iter(arr, 1) + + def test_array_flat_3d(self): + arr = np.arange(24).reshape(4, 2, 3) + + arrty = typeof(arr) + self.assertEqual(arrty.ndim, 3) + self.assertEqual(arrty.layout, 'C') + self.assertTrue(arr.flags.c_contiguous) + # Test with C-contiguous array + self.check_array_flat(arr) + # Test with Fortran-contiguous array + arr = arr.transpose() + self.assertFalse(arr.flags.c_contiguous) + self.assertTrue(arr.flags.f_contiguous) + self.assertEqual(typeof(arr).layout, 'F') + self.check_array_flat(arr) + # Test with non-contiguous array + arr = arr[::2] + self.assertFalse(arr.flags.c_contiguous) + self.assertFalse(arr.flags.f_contiguous) + self.assertEqual(typeof(arr).layout, 'A') + self.check_array_flat(arr) + # Boolean array + arr = np.bool_([1, 0, 0, 1] * 2).reshape((2, 2, 2)) + self.check_array_flat(arr) + + def test_array_flat_empty(self): + # Test .flat with various shapes of empty arrays, contiguous + # and non-contiguous (see issue #846). + + # Define a local checking function, Numba's `typeof` ends up aliasing + # 0d C and F ordered arrays, so the check needs to go via the compile + # result entry point to bypass type checking. + def check(arr, arrty): + cfunc = njit((arrty,))(array_flat_sum) + cres = cfunc.overloads[(arrty,)] + got = cres.entry_point(arr) + expected = cfunc.py_func(arr) + self.assertPreciseEqual(expected, got) + + arr = np.zeros(0, dtype=np.int32) + arr = arr.reshape(0, 2) + arrty = types.Array(types.int32, 2, layout='C') + check(arr, arrty) + arrty = types.Array(types.int32, 2, layout='F') + check(arr, arrty) + arrty = types.Array(types.int32, 2, layout='A') + check(arr, arrty) + arr = arr.reshape(2, 0) + arrty = types.Array(types.int32, 2, layout='C') + check(arr, arrty) + arrty = types.Array(types.int32, 2, layout='F') + check(arr, arrty) + arrty = types.Array(types.int32, 2, layout='A') + check(arr, arrty) + + def test_array_flat_getitem(self): + # Test indexing of array.flat object + pyfunc = array_flat_getitem + cfunc = njit(pyfunc) + def check(arr, ind): + expected = pyfunc(arr, ind) + self.assertEqual(cfunc(arr, ind), expected) + + arr = np.arange(24).reshape(4, 2, 3) + for i in range(arr.size): + check(arr, i) + arr = arr.T + for i in range(arr.size): + check(arr, i) + arr = arr[::2] + for i in range(arr.size): + check(arr, i) + arr = np.array([42]).reshape(()) + for i in range(arr.size): + check(arr, i) + # Boolean array + arr = np.bool_([1, 0, 0, 1]) + for i in range(arr.size): + check(arr, i) + arr = arr[::2] + for i in range(arr.size): + check(arr, i) + + def test_array_flat_setitem(self): + # Test indexing of array.flat object + pyfunc = array_flat_setitem + cfunc = njit(pyfunc) + def check(arr, ind): + # Use np.copy() to keep the layout + expected = np.copy(arr) + got = np.copy(arr) + pyfunc(expected, ind, 123) + cfunc(got, ind, 123) + self.assertPreciseEqual(got, expected) + + arr = np.arange(24).reshape(4, 2, 3) + for i in range(arr.size): + check(arr, i) + arr = arr.T + for i in range(arr.size): + check(arr, i) + arr = arr[::2] + for i in range(arr.size): + check(arr, i) + arr = np.array([42]).reshape(()) + for i in range(arr.size): + check(arr, i) + # Boolean array + arr = np.bool_([1, 0, 0, 1]) + for i in range(arr.size): + check(arr, i) + arr = arr[::2] + for i in range(arr.size): + check(arr, i) + + def test_array_flat_len(self): + # Test len(array.flat) + pyfunc = array_flat_len + cfunc = njit(array_flat_len) + def check(arr): + expected = pyfunc(arr) + self.assertPreciseEqual(cfunc(arr), expected) + + arr = np.arange(24).reshape(4, 2, 3) + check(arr) + arr = arr.T + check(arr) + arr = arr[::2] + check(arr) + arr = np.array([42]).reshape(()) + check(arr) + + def test_array_flat_premature_free(self): + cfunc = njit((types.intp,))(array_flat_premature_free) + expect = array_flat_premature_free(6) + got = cfunc(6) + self.assertTrue(got.sum()) + self.assertPreciseEqual(expect, got) + + def test_array_ndenumerate_2d(self): + arr = np.arange(12).reshape(4, 3) + arrty = typeof(arr) + self.assertEqual(arrty.ndim, 2) + self.assertEqual(arrty.layout, 'C') + self.assertTrue(arr.flags.c_contiguous) + # Test with C-contiguous array + self.check_array_ndenumerate_sum(arr, arrty) + # Test with Fortran-contiguous array + arr = arr.transpose() + self.assertFalse(arr.flags.c_contiguous) + self.assertTrue(arr.flags.f_contiguous) + arrty = typeof(arr) + self.assertEqual(arrty.layout, 'F') + self.check_array_ndenumerate_sum(arr, arrty) + # Test with non-contiguous array + arr = arr[::2] + self.assertFalse(arr.flags.c_contiguous) + self.assertFalse(arr.flags.f_contiguous) + arrty = typeof(arr) + self.assertEqual(arrty.layout, 'A') + self.check_array_ndenumerate_sum(arr, arrty) + # Boolean array + arr = np.bool_([1, 0, 0, 1]).reshape((2, 2)) + self.check_array_ndenumerate_sum(arr, typeof(arr)) + + def test_array_ndenumerate_empty(self): + # Define a local checking function, Numba's `typeof` ends up aliasing + # 0d C and F ordered arrays, so the check needs to go via the compile + # result entry point to bypass type checking. + def check(arr, arrty): + cfunc = njit((arrty,))(array_ndenumerate_sum) + cres = cfunc.overloads[(arrty,)] + got = cres.entry_point(arr) + expected = cfunc.py_func(arr) + np.testing.assert_allclose(expected, got) + + arr = np.zeros(0, dtype=np.int32) + arr = arr.reshape(0, 2) + arrty = types.Array(types.int32, 2, layout='C') + check(arr, arrty) + arrty = types.Array(types.int32, 2, layout='F') + check(arr, arrty) + arrty = types.Array(types.int32, 2, layout='A') + check(arr, arrty) + arr = arr.reshape(2, 0) + arrty = types.Array(types.int32, 2, layout='C') + check(arr, arrty) + arrty = types.Array(types.int32, 2, layout='F') + check(arr, arrty) + arrty = types.Array(types.int32, 2, layout='A') + check(arr, arrty) + + def test_array_ndenumerate_premature_free(self): + cfunc = njit((types.intp,))(array_ndenumerate_premature_free) + expect = array_ndenumerate_premature_free(6) + got = cfunc(6) + self.assertTrue(got.sum()) + self.assertPreciseEqual(expect, got) + + def test_np_ndindex(self): + func = np_ndindex + cfunc = njit((types.int32, types.int32,))(func) + self.assertPreciseEqual(cfunc(3, 4), func(3, 4)) + self.assertPreciseEqual(cfunc(3, 0), func(3, 0)) + self.assertPreciseEqual(cfunc(0, 3), func(0, 3)) + self.assertPreciseEqual(cfunc(0, 0), func(0, 0)) + + def test_np_ndindex_array(self): + func = np_ndindex_array + arr = np.arange(12, dtype=np.int32) + 10 + self.check_array_unary(arr, typeof(arr), func) + arr = arr.reshape((4, 3)) + self.check_array_unary(arr, typeof(arr), func) + arr = arr.reshape((2, 2, 3)) + self.check_array_unary(arr, typeof(arr), func) + + def test_np_ndindex_empty(self): + func = np_ndindex_empty + cfunc = njit((),)(func) + self.assertPreciseEqual(cfunc(), func()) + + def test_iter_next(self): + # This also checks memory management with iter() and next() + func = iter_next + arr = np.arange(12, dtype=np.int32) + 10 + self.check_array_unary(arr, typeof(arr), func) + + +class TestNdIter(MemoryLeakMixin, TestCase): + """ + Test np.nditer() + """ + + def inputs(self): + # All those inputs are compatible with a (3, 4) main shape + + # scalars + yield np.float32(100) + + # 0-d arrays + yield np.array(102, dtype=np.int16) + + # 1-d arrays + yield np.arange(4).astype(np.complex64) + yield np.arange(8)[::2] + + # 2-d arrays + a = np.arange(12).reshape((3, 4)) + yield a + yield a.copy(order='F') + a = np.arange(24).reshape((6, 4))[::2] + yield a + + def basic_inputs(self): + yield np.arange(4).astype(np.complex64) + yield np.arange(8)[::2] + a = np.arange(12).reshape((3, 4)) + yield a + yield a.copy(order='F') + + def check_result(self, got, expected): + self.assertEqual(set(got), set(expected), (got, expected)) + + def test_nditer1(self): + pyfunc = np_nditer1 + cfunc = jit(nopython=True)(pyfunc) + for a in self.inputs(): + expected = pyfunc(a) + got = cfunc(a) + self.check_result(got, expected) + + def test_nditer2(self): + pyfunc = np_nditer2 + cfunc = jit(nopython=True)(pyfunc) + for a, b in itertools.product(self.inputs(), self.inputs()): + expected = pyfunc(a, b) + got = cfunc(a, b) + self.check_result(got, expected) + + def test_nditer3(self): + pyfunc = np_nditer3 + cfunc = jit(nopython=True)(pyfunc) + # Use a restricted set of inputs, to shorten test time + inputs = self.basic_inputs + for a, b, c in itertools.product(inputs(), inputs(), inputs()): + expected = pyfunc(a, b, c) + got = cfunc(a, b, c) + self.check_result(got, expected) + + def test_errors(self): + # Incompatible shapes + pyfunc = np_nditer2 + cfunc = jit(nopython=True)(pyfunc) + + self.disable_leak_check() + + def check_incompatible(a, b): + with self.assertRaises(ValueError) as raises: + cfunc(a, b) + self.assertIn("operands could not be broadcast together", + str(raises.exception)) + + check_incompatible(np.arange(2), np.arange(3)) + a = np.arange(12).reshape((3, 4)) + b = np.arange(3) + check_incompatible(a, b) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_manipulation.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_manipulation.py new file mode 100644 index 0000000000000000000000000000000000000000..2539319fd560a759004484e715c31b9ed076a68e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_manipulation.py @@ -0,0 +1,1588 @@ +from functools import partial +from itertools import permutations + +import numpy as np + +import unittest +from numba import jit, njit, from_dtype, typeof +from numba.core.errors import TypingError +from numba.core import types, errors +from numba.tests.support import TestCase, MemoryLeakMixin + +enable_pyobj_flags = {'forceobj': True} + +no_pyobj_flags = {'_nrt': True, 'nopython': True} + + +def from_generic(pyfuncs_to_use): + """Decorator for generic check functions. + Iterates over 'pyfuncs_to_use', calling 'func' with the iterated + item as first argument. Example: + + @from_generic(numpy_array_reshape, array_reshape) + def check_only_shape(pyfunc, arr, shape, expected_shape): + # Only check Numba result to avoid Numpy bugs + self.memory_leak_setup() + got = generic_run(pyfunc, arr, shape) + self.assertEqual(got.shape, expected_shape) + self.assertEqual(got.size, arr.size) + del got + self.memory_leak_teardown() + """ + def decorator(func): + def result(*args, **kwargs): + return [func(pyfunc, *args, **kwargs) for pyfunc in pyfuncs_to_use] + return result + return decorator + + +@njit +def array_reshape(arr, newshape): + return arr.reshape(newshape) + +@njit +def numpy_array_reshape(arr, newshape): + return np.reshape(arr, newshape) + + +def numpy_broadcast_to(arr, shape): + return np.broadcast_to(arr, shape) + + +def numpy_broadcast_shapes(*args): + return np.broadcast_shapes(*args) + + +def numpy_broadcast_arrays(*args): + return np.broadcast_arrays(*args) + + +def numpy_broadcast_to_indexing(arr, shape, idx): + return np.broadcast_to(arr, shape)[idx] + + +def flatten_array(a): + return a.flatten() + + +def ravel_array(a): + return a.ravel() + + +def ravel_array_size(a): + return a.ravel().size + + +def numpy_ravel_array(a): + return np.ravel(a) + + +def transpose_array(a): + return a.transpose() + + +def numpy_transpose_array(a): + return np.transpose(a) + + +@njit +def numpy_transpose_array_axes_kwarg(arr, axes): + return np.transpose(arr, axes=axes) + + +@njit +def numpy_transpose_array_axes_kwarg_copy(arr, axes): + return np.transpose(arr, axes=axes).copy() + + +@njit +def array_transpose_axes(arr, axes): + return arr.transpose(axes) + + +@njit +def array_transpose_axes_copy(arr, axes): + return arr.transpose(axes).copy() + + +@njit +def transpose_issue_4708(m, n): + r1 = np.reshape(np.arange(m * n * 3), (m, 3, n)) + r2 = np.reshape(np.arange(n * 3), (n, 3)) + r_dif = (r1 - r2.T).T + r_dif = np.transpose(r_dif, (2, 0, 1)) + z = r_dif + 1 + return z + + +def squeeze_array(a): + return a.squeeze() + + +def expand_dims(a, axis): + return np.expand_dims(a, axis) + + +def atleast_1d(*args): + return np.atleast_1d(*args) + + +def atleast_2d(*args): + return np.atleast_2d(*args) + + +def atleast_3d(*args): + return np.atleast_3d(*args) + + +def as_strided1(a): + # as_strided() with implicit shape + strides = (a.strides[0] // 2,) + a.strides[1:] + return np.lib.stride_tricks.as_strided(a, strides=strides) + + +def as_strided2(a): + # Rolling window example as in https://github.com/numba/numba/issues/1884 + window = 3 + shape = a.shape[:-1] + (a.shape[-1] - window + 1, window) + strides = a.strides + (a.strides[-1],) + return np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides) + + +@njit +def sliding_window_view(x, window_shape, axis=None): + return np.lib.stride_tricks.sliding_window_view(x, window_shape, axis=axis) + + +def bad_index(arr, arr2d): + x = arr.x, + y = arr.y + # note that `x` is a tuple, which causes a new axis to be created. + arr2d[x, y] = 1.0 + + +def bad_float_index(arr): + # 2D index required for this function because 1D index + # fails typing + return arr[1, 2.0] + + +def numpy_fill_diagonal(arr, val, wrap=False): + return np.fill_diagonal(arr, val, wrap) + + +def numpy_shape(arr): + return np.shape(arr) + +def numpy_size(arr): + return np.size(arr) + + +def numpy_flatnonzero(a): + return np.flatnonzero(a) + + +def numpy_argwhere(a): + return np.argwhere(a) + +def numpy_resize(a, new_shape): + return np.resize(a, new_shape) + + +class TestArrayManipulation(MemoryLeakMixin, TestCase): + """ + Check shape-changing operations on arrays. + """ + def test_array_reshape(self): + pyfuncs_to_use = [array_reshape, numpy_array_reshape] + + def generic_run(pyfunc, arr, shape): + return pyfunc(arr, shape) + + @from_generic(pyfuncs_to_use) + def check(pyfunc, arr, shape): + expected = pyfunc.py_func(arr, shape) + self.memory_leak_setup() + got = generic_run(pyfunc, arr, shape) + self.assertPreciseEqual(got, expected) + del got + self.memory_leak_teardown() + + @from_generic(pyfuncs_to_use) + def check_only_shape(pyfunc, arr, shape, expected_shape): + # Only check Numba result to avoid Numpy bugs + self.memory_leak_setup() + got = generic_run(pyfunc, arr, shape) + self.assertEqual(got.shape, expected_shape) + self.assertEqual(got.size, arr.size) + del got + self.memory_leak_teardown() + + @from_generic(pyfuncs_to_use) + def check_err_shape(pyfunc, arr, shape): + with self.assertRaises(NotImplementedError) as raises: + generic_run(pyfunc, arr, shape) + self.assertEqual(str(raises.exception), + "incompatible shape for array") + + @from_generic(pyfuncs_to_use) + def check_err_size(pyfunc, arr, shape): + with self.assertRaises(ValueError) as raises: + generic_run(pyfunc, arr, shape) + self.assertEqual(str(raises.exception), + "total size of new array must be unchanged") + + @from_generic(pyfuncs_to_use) + def check_err_multiple_negative(pyfunc, arr, shape): + with self.assertRaises(ValueError) as raises: + generic_run(pyfunc, arr, shape) + self.assertEqual(str(raises.exception), + "multiple negative shape values") + + + # C-contiguous + arr = np.arange(24) + check(arr, (24,)) + check(arr, (4, 6)) + check(arr, (8, 3)) + check(arr, (8, 1, 3)) + check(arr, (1, 8, 1, 1, 3, 1)) + arr = np.arange(24).reshape((2, 3, 4)) + check(arr, (24,)) + check(arr, (4, 6)) + check(arr, (8, 3)) + check(arr, (8, 1, 3)) + check(arr, (1, 8, 1, 1, 3, 1)) + check_err_size(arr, ()) + check_err_size(arr, (25,)) + check_err_size(arr, (8, 4)) + arr = np.arange(24).reshape((1, 8, 1, 1, 3, 1)) + check(arr, (24,)) + check(arr, (4, 6)) + check(arr, (8, 3)) + check(arr, (8, 1, 3)) + + # F-contiguous + arr = np.arange(24).reshape((2, 3, 4)).T + check(arr, (4, 3, 2)) + check(arr, (1, 4, 1, 3, 1, 2, 1)) + check_err_shape(arr, (2, 3, 4)) + check_err_shape(arr, (6, 4)) + check_err_shape(arr, (2, 12)) + + # Test negative shape value + arr = np.arange(25).reshape(5,5) + check(arr, -1) + check(arr, (-1,)) + check(arr, (-1, 5)) + check(arr, (5, -1, 5)) + check(arr, (5, 5, -1)) + check_err_size(arr, (-1, 4)) + check_err_multiple_negative(arr, (-1, -2, 5, 5)) + check_err_multiple_negative(arr, (5, 5, -1, -1)) + + # 0-sized arrays + def check_empty(arr): + check(arr, 0) + check(arr, (0,)) + check(arr, (1, 0, 2)) + check(arr, (0, 55, 1, 0, 2)) + # -1 is buggy in Numpy with 0-sized arrays + check_only_shape(arr, -1, (0,)) + check_only_shape(arr, (-1,), (0,)) + check_only_shape(arr, (0, -1), (0, 0)) + check_only_shape(arr, (4, -1), (4, 0)) + check_only_shape(arr, (-1, 0, 4), (0, 0, 4)) + check_err_size(arr, ()) + check_err_size(arr, 1) + check_err_size(arr, (1, 2)) + + arr = np.array([]) + check_empty(arr) + check_empty(arr.reshape((3, 2, 0))) + + # Exceptions leak references + self.disable_leak_check() + + def test_array_transpose_axes(self): + pyfuncs_to_use = [numpy_transpose_array_axes_kwarg, + numpy_transpose_array_axes_kwarg_copy, + array_transpose_axes, + array_transpose_axes_copy] + + @from_generic(pyfuncs_to_use) + def check(pyfunc, arr, axes): + expected = pyfunc.py_func(arr, axes) + got = pyfunc(arr, axes) + self.assertPreciseEqual(got, expected) + self.assertEqual(got.flags.f_contiguous, + expected.flags.f_contiguous) + self.assertEqual(got.flags.c_contiguous, + expected.flags.c_contiguous) + + @from_generic(pyfuncs_to_use) + def check_err_axis_repeated(pyfunc, arr, axes): + with self.assertRaises(ValueError) as raises: + pyfunc(arr, axes) + self.assertEqual(str(raises.exception), + "repeated axis in transpose") + + @from_generic(pyfuncs_to_use) + def check_err_axis_oob(pyfunc, arr, axes): + with self.assertRaises(ValueError) as raises: + pyfunc(arr, axes) + self.assertEqual(str(raises.exception), + "axis is out of bounds for array of given dimension") + + @from_generic(pyfuncs_to_use) + def check_err_invalid_args(pyfunc, arr, axes): + with self.assertRaises((TypeError, TypingError)): + pyfunc(arr, axes) + + arrs = [np.arange(24), + np.arange(24).reshape(4, 6), + np.arange(24).reshape(2, 3, 4), + np.arange(24).reshape(1, 2, 3, 4), + np.arange(64).reshape(8, 4, 2)[::3,::2,:]] + + for i in range(len(arrs)): + # First check `None`, the default, which is to reverse dims + check(arrs[i], None) + # Check supplied axis permutations + for axes in permutations(tuple(range(arrs[i].ndim))): + ndim = len(axes) + neg_axes = tuple([x - ndim for x in axes]) + check(arrs[i], axes) + check(arrs[i], neg_axes) + + @from_generic([transpose_issue_4708]) + def check_issue_4708(pyfunc, m, n): + expected = pyfunc.py_func(m, n) + got = pyfunc(m, n) + # values in arrays are equals, + # but stronger assertions not hold (layout and strides equality) + np.testing.assert_equal(got, expected) + + check_issue_4708(3, 2) + check_issue_4708(2, 3) + check_issue_4708(5, 4) + + # Exceptions leak references + self.disable_leak_check() + + check_err_invalid_args(arrs[1], "foo") + check_err_invalid_args(arrs[1], ("foo",)) + check_err_invalid_args(arrs[1], 5.3) + check_err_invalid_args(arrs[2], (1.2, 5)) + + check_err_axis_repeated(arrs[1], (0, 0)) + check_err_axis_repeated(arrs[2], (2, 0, 0)) + check_err_axis_repeated(arrs[3], (3, 2, 1, 1)) + + check_err_axis_oob(arrs[0], (1,)) + check_err_axis_oob(arrs[0], (-2,)) + check_err_axis_oob(arrs[1], (0, 2)) + check_err_axis_oob(arrs[1], (-3, 2)) + check_err_axis_oob(arrs[1], (0, -3)) + check_err_axis_oob(arrs[2], (3, 1, 2)) + check_err_axis_oob(arrs[2], (-4, 1, 2)) + check_err_axis_oob(arrs[3], (3, 1, 2, 5)) + check_err_axis_oob(arrs[3], (3, 1, 2, -5)) + + with self.assertRaises(TypingError) as e: + jit(nopython=True)(numpy_transpose_array)((np.array([0, 1]),)) + self.assertIn("np.transpose does not accept tuples", + str(e.exception)) + + def test_numpy_resize_basic(self): + pyfunc = numpy_resize + cfunc = njit(pyfunc) + def inputs(): + # Taken from https://github.com/numpy/numpy/blob/f0b2fca91a1f5f50ff696895072f6fe9e69c1466/numpy/core/tests/test_numeric.py#L24-L64 noqa: E501 + yield np.array([[1, 2], [3, 4]]), (2, 4) + yield np.array([[1, 2], [3, 4]]), (4, 2) + yield np.array([[1, 2], [3, 4]]), (4, 3) + yield np.array([[1, 2], [3, 4]]), (0,) + yield np.array([[1, 2], [3, 4]]), (0, 2) + yield np.array([[1, 2], [3, 4]]), (2, 0) + yield np.zeros(0, dtype = float), (2, 1) + # other + yield np.array([[1, 2], [3, 4]]), (4,) + yield np.array([[1, 2], [3, 4]]), 4 + yield np.zeros((1, 3), dtype = int), (2, 1) + yield np.array([], dtype = float), (4, 2) + yield [0, 1, 2, 3], (2, 3) + yield 4, (2, 3) + + for a, new_shape in inputs(): + self.assertPreciseEqual(pyfunc(a, new_shape), cfunc(a, new_shape)) + + def test_numpy_resize_exception(self): + # Exceptions leak references + self.disable_leak_check() + + cfunc = njit(numpy_resize) + + with self.assertRaises(TypingError) as raises: + cfunc("abc", (2, 3)) + self.assertIn(('The argument "a" must be array-like'), + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(np.array([[0,1],[2,3]]), "abc") + self.assertIn(('The argument "new_shape" must be an integer or ' + 'a tuple of integers'), + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc(np.array([[0,1],[2,3]]), (-2, 3)) + self.assertIn(('All elements of `new_shape` must be non-negative'), + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc(np.array([[0,1],[2,3]]), -4) + self.assertIn(('All elements of `new_shape` must be non-negative'), + str(raises.exception)) + + def test_expand_dims(self): + pyfunc = expand_dims + cfunc = njit(pyfunc) + + def check(arr, axis): + expected = pyfunc(arr, axis) + self.memory_leak_setup() + got = cfunc(arr, axis) + self.assertPreciseEqual(got, expected) + del got + self.memory_leak_teardown() + + def check_all_axes(arr): + for axis in range(-arr.ndim - 1, arr.ndim + 1): + check(arr, axis) + + # 1d + arr = np.arange(5) + check_all_axes(arr) + # 3d (C, F, A) + arr = np.arange(24).reshape((2, 3, 4)) + check_all_axes(arr) + check_all_axes(arr.T) + check_all_axes(arr[::-1]) + # 0d + arr = np.array(42) + check_all_axes(arr) + + def test_expand_dims_exceptions(self): + pyfunc = expand_dims + cfunc = jit(nopython=True)(pyfunc) + arr = np.arange(5) + + with self.assertTypingError() as raises: + cfunc('hello', 3) + self.assertIn('First argument "a" must be an array', str(raises.exception)) + + with self.assertTypingError() as raises: + cfunc(arr, 'hello') + self.assertIn('Argument "axis" must be an integer', str(raises.exception)) + + + def check_atleast_nd(self, pyfunc, cfunc): + def check_result(got, expected): + # We would like to check the result has the same contiguity, + # but we can't rely on the "flags" attribute when there are + # 1-sized dimensions. + self.assertStridesEqual(got, expected) + self.assertPreciseEqual(got.flatten(), expected.flatten()) + + def check_single(arg): + check_result(cfunc(arg), pyfunc(arg)) + + def check_tuple(*args): + expected_tuple = pyfunc(*args) + got_tuple = cfunc(*args) + self.assertEqual(len(got_tuple), len(expected_tuple)) + for got, expected in zip(got_tuple, expected_tuple): + check_result(got, expected) + + # 0d + a1 = np.array(42) + a2 = np.array(5j) + check_single(a1) + check_tuple(a1, a2) + # 1d + b1 = np.arange(5) + b2 = np.arange(6) + 1j + b3 = b1[::-1] + check_single(b1) + check_tuple(b1, b2, b3) + # 2d + c1 = np.arange(6).reshape((2, 3)) + c2 = c1.T + c3 = c1[::-1] + check_single(c1) + check_tuple(c1, c2, c3) + # 3d + d1 = np.arange(24).reshape((2, 3, 4)) + d2 = d1.T + d3 = d1[::-1] + check_single(d1) + check_tuple(d1, d2, d3) + # 4d + e = np.arange(16).reshape((2, 2, 2, 2)) + check_single(e) + # mixed dimensions + check_tuple(a1, b2, c3, d2) + + def test_atleast_1d(self): + pyfunc = atleast_1d + cfunc = jit(nopython=True)(pyfunc) + self.check_atleast_nd(pyfunc, cfunc) + + def test_atleast_2d(self): + pyfunc = atleast_2d + cfunc = jit(nopython=True)(pyfunc) + self.check_atleast_nd(pyfunc, cfunc) + + def test_atleast_3d(self): + pyfunc = atleast_3d + cfunc = jit(nopython=True)(pyfunc) + self.check_atleast_nd(pyfunc, cfunc) + + def check_as_strided(self, pyfunc): + cfunc = njit(pyfunc) + + def check(arr): + expected = pyfunc(arr) + got = cfunc(arr) + self.assertPreciseEqual(got, expected) + + arr = np.arange(24) + check(arr) + check(arr.reshape((6, 4))) + check(arr.reshape((4, 1, 6))) + + def test_as_strided(self): + self.check_as_strided(as_strided1) + self.check_as_strided(as_strided2) + + def test_as_strided_stride_none(self): + + @jit + def foo(): + arr = np.arange(24).reshape((6, 4)) + return np.lib.stride_tricks.as_strided(arr, strides=None) + + with self.assertRaises(errors.TypingError) as raises: + foo() + + msg = "strides argument cannot be None" + self.assertIn(msg, str(raises.exception)) + + def test_sliding_window_view(self): + def check(arr, window_shape, axis): + # Our version is always writeable (NumPy default is False). + expected = np.lib.stride_tricks.sliding_window_view( + arr, window_shape, axis, writeable=True + ) + got = sliding_window_view(arr, window_shape, axis) + self.assertPreciseEqual(got, expected) + + # 1d array, different ways of specifying the axis. + arr1 = np.arange(24) + for axis in [None, 0, -1, (0,)]: + with self.subTest(f"1d array, axis={axis}"): + check(arr1, 5, axis) + + # 2d array, 1d window. + arr2 = np.arange(200).reshape(10, 20) + for axis in [0, -1]: + with self.subTest(f"2d array, axis={axis}"): + check(arr2, 5, axis) + + # 2d array, 2d window. + for axis in [None, (0, 1), (1, 0), (1, -2)]: + with self.subTest(f"2d array, axis={axis}"): + check(arr2, (5, 8), axis) + + # 4d array, 2d window. + arr4 = np.arange(200).reshape(4, 5, 5, 2) + for axis in [(1, 2), (-2, -3)]: + with self.subTest(f"4d array, axis={axis}"): + check(arr4, (3, 2), axis) + + # Repeated axis. + with self.subTest("2d array, repeated axes"): + check(arr2, (5, 3, 3), (0, 1, 0)) + + def test_sliding_window_view_errors(self): + def _raises(msg, *args): + with self.assertRaises(ValueError) as raises: + sliding_window_view(*args) + self.assertIn(msg, str(raises.exception)) + + def _typing_error(msg, *args): + with self.assertRaises(errors.TypingError) as raises: + sliding_window_view(*args) + self.assertIn(msg, str(raises.exception)) + + # Exceptions leak references + self.disable_leak_check() + + arr1 = np.arange(24) + arr2 = np.arange(200).reshape(10, 20) + + # Window shape cannot be larger than dimension or negative. + with self.subTest("1d window shape too large"): + _raises("window_shape cannot be larger", arr1, 25, None) + with self.subTest("2d window shape too large"): + _raises("window_shape cannot be larger", arr2, (4, 21), None) + with self.subTest("1d window negative size"): + _raises("`window_shape` cannot contain negative", arr1, -1, None) + with self.subTest("2d window with a negative size"): + _raises("`window_shape` cannot contain negative", arr2, (4, -3), None) + + # window_shape and axis parameters must be compatible. + with self.subTest("1d array, 2d window shape"): + _raises("matching length window_shape and axis", arr1, (10, 2), None) + with self.subTest("2d window shape, only one axis given"): + _raises("matching length window_shape and axis", arr2, (10, 2), 1) + with self.subTest("1d window shape, 2 axes given"): + _raises("matching length window_shape and axis", arr1, 5, (0, 0)) + + # Axis values out of bounds. + with self.subTest("1d array, second axis"): + _raises("Argument axis out of bounds", arr1, 4, 1) + with self.subTest("1d array, axis -2"): + _raises("Argument axis out of bounds", arr1, 4, -2) + with self.subTest("2d array, fourth axis"): + _raises("Argument axis out of bounds", arr2, (4, 4), (0, 3)) + with self.subTest("2d array, axis -3"): + _raises("Argument axis out of bounds", arr2, (4, 4), (0, -3)) + + # Useful messages for unsupported types. + with self.subTest("window_shape=None"): + _typing_error( + "window_shape must be an integer or tuple of integer", arr1, None + ) + with self.subTest("window_shape=float"): + _typing_error( + "window_shape must be an integer or tuple of integer", arr1, 3.1 + ) + with self.subTest("window_shape=tuple(float)"): + _typing_error( + "window_shape must be an integer or tuple of integer", arr1, (3.1,) + ) + with self.subTest("axis=float"): + _typing_error( + "axis must be None, an integer or tuple of integer", arr1, 4, 3.1 + ) + with self.subTest("axis=tuple(float)"): + _typing_error( + "axis must be None, an integer or tuple of integer", arr1, 4, (3.1,) + ) + + + def test_flatten_array(self, flags=enable_pyobj_flags, layout='C'): + a = np.arange(9).reshape(3, 3) + if layout == 'F': + a = a.T + + pyfunc = flatten_array + arraytype1 = typeof(a) + if layout == 'A': + # Force A layout + arraytype1 = arraytype1.copy(layout='A') + + self.assertEqual(arraytype1.layout, layout) + cfunc = jit((arraytype1,), **flags)(pyfunc) + + expected = pyfunc(a) + got = cfunc(a) + np.testing.assert_equal(expected, got) + + def test_flatten_array_npm(self): + self.test_flatten_array(flags=no_pyobj_flags) + self.test_flatten_array(flags=no_pyobj_flags, layout='F') + self.test_flatten_array(flags=no_pyobj_flags, layout='A') + + def test_ravel_array(self, flags=enable_pyobj_flags): + def generic_check(pyfunc, a, assume_layout): + # compile + arraytype1 = typeof(a) + self.assertEqual(arraytype1.layout, assume_layout) + cfunc = jit((arraytype1,), **flags)(pyfunc) + + expected = pyfunc(a) + got = cfunc(a) + # Check result matches + np.testing.assert_equal(expected, got) + # Check copying behavior + py_copied = (a.ctypes.data != expected.ctypes.data) + nb_copied = (a.ctypes.data != got.ctypes.data) + self.assertEqual(py_copied, assume_layout != 'C') + self.assertEqual(py_copied, nb_copied) + + check_method = partial(generic_check, ravel_array) + check_function = partial(generic_check, numpy_ravel_array) + + def check(*args, **kwargs): + check_method(*args, **kwargs) + check_function(*args, **kwargs) + + # Check 2D + check(np.arange(9).reshape(3, 3), assume_layout='C') + check(np.arange(9).reshape(3, 3, order='F'), assume_layout='F') + check(np.arange(18).reshape(3, 3, 2)[:, :, 0], assume_layout='A') + + # Check 3D + check(np.arange(18).reshape(2, 3, 3), assume_layout='C') + check(np.arange(18).reshape(2, 3, 3, order='F'), assume_layout='F') + check(np.arange(36).reshape(2, 3, 3, 2)[:, :, :, 0], assume_layout='A') + + def test_ravel_array_size(self, flags=enable_pyobj_flags): + a = np.arange(9).reshape(3, 3) + + pyfunc = ravel_array_size + arraytype1 = typeof(a) + cfunc = jit((arraytype1,), **flags)(pyfunc) + + expected = pyfunc(a) + got = cfunc(a) + np.testing.assert_equal(expected, got) + + def test_ravel_array_npm(self): + self.test_ravel_array(flags=no_pyobj_flags) + + def test_ravel_array_size_npm(self): + self.test_ravel_array_size(flags=no_pyobj_flags) + + def test_transpose_array(self, flags=enable_pyobj_flags): + @from_generic([transpose_array, numpy_transpose_array]) + def check(pyfunc): + a = np.arange(9).reshape(3, 3) + + arraytype1 = typeof(a) + cfunc = jit((arraytype1,), **flags)(pyfunc) + + expected = pyfunc(a) + got = cfunc(a) + np.testing.assert_equal(expected, got) + + check() + + def test_transpose_array_npm(self): + self.test_transpose_array(flags=no_pyobj_flags) + + def test_squeeze_array(self, flags=enable_pyobj_flags): + a = np.arange(2 * 1 * 3 * 1 * 4).reshape(2, 1, 3, 1, 4) + + pyfunc = squeeze_array + arraytype1 = typeof(a) + cfunc = jit((arraytype1,), **flags)(pyfunc) + + expected = pyfunc(a) + got = cfunc(a) + np.testing.assert_equal(expected, got) + + def test_squeeze_array_npm(self): + with self.assertRaises(errors.TypingError) as raises: + self.test_squeeze_array(flags=no_pyobj_flags) + + self.assertIn("squeeze", str(raises.exception)) + + def test_add_axis(self): + @njit + def np_new_axis_getitem(a, idx): + return a[idx] + + @njit + def np_new_axis_setitem(a, idx, item): + a[idx] = item + return a + + a = np.arange(4 * 5 * 6 * 7).reshape((4, 5, 6, 7)) + idx_cases = [ + (slice(None), np.newaxis), + (np.newaxis, slice(None)), + (slice(1), np.newaxis, 1), + (np.newaxis, 2, slice(None)), + (slice(1), Ellipsis, np.newaxis, 1), + (1, np.newaxis, Ellipsis), + (np.newaxis, slice(1), np.newaxis, 1), + (1, Ellipsis, None, np.newaxis), + (np.newaxis, slice(1), Ellipsis, np.newaxis, 1), + (1, np.newaxis, np.newaxis, Ellipsis), + (np.newaxis, 1, np.newaxis, Ellipsis), + (slice(3), 1, np.newaxis, None), + (np.newaxis, 1, Ellipsis, None), + ] + pyfunc_getitem = np_new_axis_getitem.py_func + cfunc_getitem = np_new_axis_getitem + + pyfunc_setitem = np_new_axis_setitem.py_func + cfunc_setitem = np_new_axis_setitem + + for idx in idx_cases: + expected = pyfunc_getitem(a, idx) + got = cfunc_getitem(a, idx) + np.testing.assert_equal(expected, got) + + a_empty = np.zeros_like(a) + item = a[idx] + + expected = pyfunc_setitem(a_empty.copy(), idx, item) + got = cfunc_setitem(a_empty.copy(), idx, item) + np.testing.assert_equal(expected, got) + + def test_bad_index_npm(self): + with self.assertTypingError() as raises: + arraytype1 = from_dtype(np.dtype([('x', np.int32), + ('y', np.int32)])) + arraytype2 = types.Array(types.int32, 2, 'C') + njit((arraytype1, arraytype2))(bad_index) + self.assertIn('Unsupported array index type', str(raises.exception)) + + def test_bad_float_index_npm(self): + with self.assertTypingError() as raises: + njit((types.Array(types.float64, 2, 'C'),))(bad_float_index) + self.assertIn('Unsupported array index type float64', + str(raises.exception)) + + def test_fill_diagonal_basic(self): + pyfunc = numpy_fill_diagonal + cfunc = jit(nopython=True)(pyfunc) + + def _shape_variations(n): + # square + yield (n, n) + # tall and thin + yield (2 * n, n) + # short and fat + yield (n, 2 * n) + # a bit taller than wide; odd numbers of rows and cols + yield ((2 * n + 1), (2 * n - 1)) + # 4d, all dimensions same + yield (n, n, n, n) + # weird edge case + yield (1, 1, 1) + + def _val_variations(): + yield 1 + yield 3.142 + yield np.nan + yield -np.inf + yield True + yield np.arange(4) + yield (4,) + yield [8, 9] + yield np.arange(54).reshape(9, 3, 2, 1) # contiguous C + yield np.asfortranarray(np.arange(9).reshape(3, 3)) # contiguous F + yield np.arange(9).reshape(3, 3)[::-1] # non-contiguous + + # contiguous arrays + def _multi_dimensional_array_variations(n): + for shape in _shape_variations(n): + yield np.zeros(shape, dtype=np.float64) + yield np.asfortranarray(np.ones(shape, dtype=np.float64)) + + # non-contiguous arrays + def _multi_dimensional_array_variations_strided(n): + for shape in _shape_variations(n): + tmp = np.zeros(tuple([x * 2 for x in shape]), dtype=np.float64) + slicer = tuple(slice(0, x * 2, 2) for x in shape) + yield tmp[slicer] + + def _check_fill_diagonal(arr, val): + for wrap in None, True, False: + a = arr.copy() + b = arr.copy() + + if wrap is None: + params = {} + else: + params = {'wrap': wrap} + + pyfunc(a, val, **params) + cfunc(b, val, **params) + self.assertPreciseEqual(a, b) + + for arr in _multi_dimensional_array_variations(3): + for val in _val_variations(): + _check_fill_diagonal(arr, val) + + for arr in _multi_dimensional_array_variations_strided(3): + for val in _val_variations(): + _check_fill_diagonal(arr, val) + + # non-numeric input arrays + arr = np.array([True] * 9).reshape(3, 3) + _check_fill_diagonal(arr, False) + _check_fill_diagonal(arr, [False, True, False]) + _check_fill_diagonal(arr, np.array([True, False, True])) + + def test_fill_diagonal_exception_cases(self): + pyfunc = numpy_fill_diagonal + cfunc = jit(nopython=True)(pyfunc) + val = 1 + + # Exceptions leak references + self.disable_leak_check() + + # first argument unsupported number of dimensions + for a in np.array([]), np.ones(5): + with self.assertRaises(TypingError) as raises: + cfunc(a, val) + assert "The first argument must be at least 2-D" in str(raises.exception) + + # multi-dimensional input where dimensions are not all equal + with self.assertRaises(ValueError) as raises: + a = np.zeros((3, 3, 4)) + cfunc(a, val) + self.assertEqual("All dimensions of input must be of equal length", str(raises.exception)) + + # cases where val has incompatible type / value + def _assert_raises(arr, val): + with self.assertRaises(ValueError) as raises: + cfunc(arr, val) + self.assertEqual("Unable to safely conform val to a.dtype", str(raises.exception)) + + arr = np.zeros((3, 3), dtype=np.int32) + val = np.nan + _assert_raises(arr, val) + + val = [3.3, np.inf] + _assert_raises(arr, val) + + val = np.array([1, 2, 1e10], dtype=np.int64) + _assert_raises(arr, val) + + arr = np.zeros((3, 3), dtype=np.float32) + val = [1.4, 2.6, -1e100] + _assert_raises(arr, val) + + val = 1.1e100 + _assert_raises(arr, val) + + val = np.array([-1e100]) + _assert_raises(arr, val) + + def test_broadcast_to(self): + pyfunc = numpy_broadcast_to + cfunc = jit(nopython=True)(pyfunc) + + # Tests taken from + # https://github.com/numpy/numpy/blob/75f852edf94a7293e7982ad516bee314d7187c2d/numpy/lib/tests/test_stride_tricks.py#L234-L257 # noqa: E501 + data = [ + [np.array(0), (0,)], + [np.array(0), (1,)], + [np.array(0), (3,)], + [np.ones(1), (1,)], + [np.ones(1), (2,)], + [np.ones(1), (1, 2, 3)], + [np.arange(3), (3,)], + [np.arange(3), (1, 3)], + [np.arange(3), (2, 3)], + # test if shape is not a tuple + [np.ones(0), 0], + [np.ones(1), 1], + [np.ones(1), 2], + # these cases with size 0 are strange, but they reproduce the behavior + # of broadcasting with ufuncs + [np.ones(1), (0,)], + [np.ones((1, 2)), (0, 2)], + [np.ones((2, 1)), (2, 0)], + # numpy accepts scalar values as first argument to np.broadcast_to + [2, (2, 2)], + # tuple input + [(1, 2), (2, 2)], + ] + for input_array, shape in data: + expected = pyfunc(input_array, shape) + got = cfunc(input_array, shape) + self.assertPreciseEqual(got, expected) + + def test_broadcast_to_0d_array(self): + pyfunc = numpy_broadcast_to + cfunc = jit(nopython=True)(pyfunc) + + inputs = [ + np.array(123), + 123, + True, + # can't do np.asarray() on the types below + # 'hello', + # np.timedelta64(10, 'Y'), + # np.datetime64(10, 'Y'), + ] + + shape = () + for arr in inputs: + expected = pyfunc(arr, shape) + got = cfunc(arr, shape) + self.assertPreciseEqual(expected, got) + # ensure that np.broadcast_to returned a read-only array + self.assertFalse(got.flags['WRITEABLE']) + + def test_broadcast_to_raises(self): + pyfunc = numpy_broadcast_to + cfunc = jit(nopython=True)(pyfunc) + + # Tests taken from + # https://github.com/numpy/numpy/blob/75f852edf94a7293e7982ad516bee314d7187c2d/numpy/lib/tests/test_stride_tricks.py#L260-L276 # noqa: E501 + data = [ + [np.zeros((0,)), (), TypingError, + 'Cannot broadcast a non-scalar to a scalar array'], + [np.zeros((1,)), (), TypingError, + 'Cannot broadcast a non-scalar to a scalar array'], + [np.zeros((3,)), (), TypingError, + 'Cannot broadcast a non-scalar to a scalar array'], + [(), (), TypingError, + 'Cannot broadcast a non-scalar to a scalar array'], + [(123,), (), TypingError, + 'Cannot broadcast a non-scalar to a scalar array'], + [np.zeros((3,)), (1,), ValueError, + 'operands could not be broadcast together with remapped shapes'], + [np.zeros((3,)), (2,), ValueError, + 'operands could not be broadcast together with remapped shapes'], + [np.zeros((3,)), (4,), ValueError, + 'operands could not be broadcast together with remapped shapes'], + [np.zeros((1, 2)), (2, 1), ValueError, + 'operands could not be broadcast together with remapped shapes'], + [np.zeros((1, 1)), (1,), ValueError, + 'input operand has more dimensions than allowed by the axis remapping'], + [np.zeros((2, 2)), (3,), ValueError, + 'input operand has more dimensions than allowed by the axis remapping'], + [np.zeros((1,)), -1, ValueError, + 'all elements of broadcast shape must be non-negative'], + [np.zeros((1,)), (-1,), ValueError, + 'all elements of broadcast shape must be non-negative'], + [np.zeros((1, 2)), (-1, 2), ValueError, + 'all elements of broadcast shape must be non-negative'], + [np.zeros((1, 2)), (1.1, 2.2), TypingError, + 'The second argument "shape" must be a tuple of integers'], + ['hello', (3,), TypingError, + 'The first argument "array" must be array-like'], + [3, (2, 'a'), TypingError, + 'object cannot be interpreted as an integer'], + ] + self.disable_leak_check() + for arr, target_shape, err, msg in data: + with self.assertRaises(err) as raises: + cfunc(arr, target_shape) + self.assertIn(msg, str(raises.exception)) + + def test_broadcast_to_corner_cases(self): + @njit + def _broadcast_to_1(): + return np.broadcast_to('a', (2, 3)) + + expected = _broadcast_to_1.py_func() + got = _broadcast_to_1() + self.assertPreciseEqual(expected, got) + + def test_broadcast_to_change_view(self): + pyfunc = numpy_broadcast_to + cfunc = jit(nopython=True)(pyfunc) + input_array = np.zeros(2, dtype=np.int32) + shape = (2, 2) + view = cfunc(input_array, shape) + input_array[0] = 10 + + self.assertEqual(input_array.sum(), 10) + self.assertEqual(view.sum(), 20) + + def test_broadcast_to_indexing(self): + pyfunc = numpy_broadcast_to_indexing + cfunc = jit(nopython=True)(pyfunc) + data = [ + [np.ones(2), (2, 2), (1,)], + ] + for input_array, shape, idx in data: + expected = pyfunc(input_array, shape, idx) + got = cfunc(input_array, shape, idx) + self.assertPreciseEqual(got, expected) + + def test_broadcast_to_array_attrs(self): + # See issue #8534. This tests that broadcast array attributes have the + # correct value when accessed. + @njit + def foo(arr): + ret = np.broadcast_to(arr, (2, 3)) + return ret, ret.size, ret.shape, ret.strides + + arr = np.arange(3) + + expected = foo.py_func(arr) + got = foo(arr) + self.assertPreciseEqual(expected, got) + + def test_broadcast_shapes(self): + pyfunc = numpy_broadcast_shapes + cfunc = jit(nopython=True)(pyfunc) + + # Tests taken from + # https://github.com/numpy/numpy/blob/623bc1fae1d47df24e7f1e29321d0c0ba2771ce0/numpy/lib/tests/test_stride_tricks.py#L296-L334 + data = [ + # [[], ()], # cannot compute fingerprint of empty list + [()], + [(), ()], + [(7,)], + [(1, 2),], + [(1, 1)], + [(1, 1), (3, 4)], + [(6, 7), (5, 6, 1), (7,), (5, 1, 7)], + [(5, 6, 1)], + [(1, 3), (3, 1)], + [(1, 0), (0, 0)], + [(0, 1), (0, 0)], + [(1, 0), (0, 1)], + [(1, 1), (0, 0)], + [(1, 1), (1, 0)], + [(1, 1), (0, 1)], + [(), (0,)], + [(0,), (0, 0)], + [(0,), (0, 1)], + [(1,), (0, 0)], + [(), (0, 0)], + [(1, 1), (0,)], + [(1,), (0, 1)], + [(1,), (1, 0)], + [(), (1, 0)], + [(), (0, 1)], + [(1,), (3,)], + [2, (3, 2)], + ] + for input_shape in data: + expected = pyfunc(*input_shape) + got = cfunc(*input_shape) + self.assertIsInstance(got, tuple) + self.assertPreciseEqual(expected, got) + + def test_broadcast_shapes_raises(self): + pyfunc = numpy_broadcast_shapes + cfunc = jit(nopython=True)(pyfunc) + + self.disable_leak_check() + + # Tests taken from + # https://github.com/numpy/numpy/blob/623bc1fae1d47df24e7f1e29321d0c0ba2771ce0/numpy/lib/tests/test_stride_tricks.py#L337-L351 + data = [ + [(3,), (4,)], + [(2, 3), (2,)], + [(3,), (3,), (4,)], + [(1, 3, 4), (2, 3, 3)], + [(1, 2), (3, 1), (3, 2), (10, 5)], + [2, (2, 3)], + ] + for input_shape in data: + with self.assertRaises(ValueError) as raises: + cfunc(*input_shape) + + self.assertIn("shape mismatch: objects cannot be broadcast to a single shape", + str(raises.exception)) + + def test_broadcast_shapes_negative_dimension(self): + pyfunc = numpy_broadcast_shapes + cfunc = jit(nopython=True)(pyfunc) + + self.disable_leak_check() + with self.assertRaises(ValueError) as raises: + cfunc((1, 2), (2), (-2)) + + self.assertIn("negative dimensions are not allowed", str(raises.exception)) + + def test_broadcast_shapes_invalid_type(self): + pyfunc = numpy_broadcast_shapes + cfunc = jit(nopython=True)(pyfunc) + + self.disable_leak_check() + + inps = [ + ((1, 2), ('hello',)), + (3.4,), + ('string',), + ((1.2, 'a')), + (1, ((1.2, 'a'))), + ] + + for inp in inps: + with self.assertRaises(TypingError) as raises: + cfunc(*inp) + + self.assertIn("must be either an int or tuple[int]", str(raises.exception)) + + def test_shape(self): + pyfunc = numpy_shape + cfunc = jit(nopython=True)(pyfunc) + + def check(x): + expected = pyfunc(x) + got = cfunc(x) + self.assertPreciseEqual(got, expected) + + # check arrays + for t in [(), (1,), (2, 3,), (4, 5, 6)]: + arr = np.empty(t) + check(arr) + + # check some types that go via asarray + for t in [1, False, [1,], [[1, 2,],[3, 4]], (1,), (1, 2, 3)]: + check(arr) + + with self.assertRaises(TypingError) as raises: + cfunc('a') + + self.assertIn("The argument to np.shape must be array-like", + str(raises.exception)) + + def test_size(self): + pyfunc = numpy_size + cfunc = jit(nopython=True)(pyfunc) + + def check(x): + expected = pyfunc(x) + got = cfunc(x) + self.assertPreciseEqual(got, expected) + + # check arrays + for t in [(), (1,), (2, 3,), (4, 5, 6)]: + arr = np.empty(t) + check(arr) + + # check scalar values + for t in [1, False, 3.14, np.int8(4), np.float32(2.718)]: + check(t) + + with self.assertRaises(TypingError) as raises: + cfunc('a') + + self.assertIn("The argument to np.size must be array-like", + str(raises.exception)) + + def test_flatnonzero_basic(self): + pyfunc = numpy_flatnonzero + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield np.arange(-5, 5) + yield np.full(5, fill_value=0) + yield np.array([]) + a = self.random.randn(100) + a[np.abs(a) > 0.2] = 0.0 + yield a + yield a.reshape(5, 5, 4) + yield a.reshape(50, 2, order='F') + yield a.reshape(25, 4)[1::2] + yield a * 1j + + for a in a_variations(): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + def test_argwhere_basic(self): + pyfunc = numpy_argwhere + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield np.arange(-5, 5) > 2 + yield np.full(5, fill_value=0) + yield np.full(5, fill_value=1) + yield np.array([]) + yield np.array([-1.0, 0.0, 1.0]) + a = self.random.randn(100) + yield a > 0.2 + yield a.reshape(5, 5, 4) > 0.5 + yield a.reshape(50, 2, order='F') > 0.5 + yield a.reshape(25, 4)[1::2] > 0.5 + yield a == a - 1 + yield a > -a + + for a in a_variations(): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + @staticmethod + def array_like_variations(): + yield ((1.1, 2.2), (3.3, 4.4), (5.5, 6.6)) + yield (0.0, 1.0, 0.0, -6.0) + yield ([0, 1], [2, 3]) + yield () + yield np.nan + yield 0 + yield 1 + yield False + yield True + yield (True, False, True) + yield 2 + 1j + # the following are not array-like, but NumPy does not raise + yield None + yield 'a_string' + yield '' + + + def test_flatnonzero_array_like(self): + pyfunc = numpy_flatnonzero + cfunc = jit(nopython=True)(pyfunc) + + for a in self.array_like_variations(): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + def test_argwhere_array_like(self): + pyfunc = numpy_argwhere + cfunc = jit(nopython=True)(pyfunc) + for a in self.array_like_variations(): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + def broadcast_arrays_assert_correct_shape(self, input_shapes, expected_shape): + # Broadcast a list of arrays with the given input shapes and check the + # common output shape. + pyfunc = numpy_broadcast_arrays + cfunc = jit(nopython=True)(pyfunc) + + inarrays = [np.zeros(s) for s in input_shapes] + outarrays = cfunc(*inarrays) + expected = [expected_shape] * len(inarrays) + got = [a.shape for a in outarrays] + self.assertPreciseEqual(expected, got) + + def test_broadcast_arrays_same_input_shapes(self): + # Tests taken from + # https://github.com/numpy/numpy/blob/623bc1fae1d47df24e7f1e29321d0c0ba2771ce0/numpy/lib/tests/test_stride_tricks.py#L83-L107 # noqa: E501 + # Check that the final shape is just the input shape. + pyfunc = numpy_broadcast_arrays + cfunc = jit(nopython=True)(pyfunc) + + data = [ + # (), + (1,), + (3,), + (0, 1), + (0, 3), + (1, 0), + (3, 0), + (1, 3), + (3, 1), + (3, 3), + ] + for shape in data: + input_shapes = [shape] + # Single input. + self.broadcast_arrays_assert_correct_shape(input_shapes, shape) + # Double input. + input_shapes2 = [shape, shape] + self.broadcast_arrays_assert_correct_shape(input_shapes2, shape) + # Triple input. + input_shapes3 = [shape, shape, shape] + self.broadcast_arrays_assert_correct_shape(input_shapes3, shape) + + def test_broadcast_arrays_two_compatible_by_ones_input_shapes(self): + # Tests taken from + # https://github.com/numpy/numpy/blob/623bc1fae1d47df24e7f1e29321d0c0ba2771ce0/numpy/lib/tests/test_stride_tricks.py#L110-L132 + # Check that two different input shapes of the same length, but some have + # ones, broadcast to the correct shape. + + data = [ + [[(1,), (3,)], (3,)], + [[(1, 3), (3, 3)], (3, 3)], + [[(3, 1), (3, 3)], (3, 3)], + [[(1, 3), (3, 1)], (3, 3)], + [[(1, 1), (3, 3)], (3, 3)], + [[(1, 1), (1, 3)], (1, 3)], + [[(1, 1), (3, 1)], (3, 1)], + [[(1, 0), (0, 0)], (0, 0)], + [[(0, 1), (0, 0)], (0, 0)], + [[(1, 0), (0, 1)], (0, 0)], + [[(1, 1), (0, 0)], (0, 0)], + [[(1, 1), (1, 0)], (1, 0)], + [[(1, 1), (0, 1)], (0, 1)], + ] + for input_shapes, expected_shape in data: + self.broadcast_arrays_assert_correct_shape(input_shapes, expected_shape) + # Reverse the input shapes since broadcasting should be symmetric. + self.broadcast_arrays_assert_correct_shape(input_shapes[::-1], expected_shape) + + def test_broadcast_arrays_two_compatible_by_prepending_ones_input_shapes(self): + # Tests taken from + # https://github.com/numpy/numpy/blob/623bc1fae1d47df24e7f1e29321d0c0ba2771ce0/numpy/lib/tests/test_stride_tricks.py#L135-L164 + # Check that two different input shapes (of different lengths) broadcast + # to the correct shape. + + data = [ + [[(), (3,)], (3,)], + [[(3,), (3, 3)], (3, 3)], + [[(3,), (3, 1)], (3, 3)], + [[(1,), (3, 3)], (3, 3)], + [[(), (3, 3)], (3, 3)], + [[(1, 1), (3,)], (1, 3)], + [[(1,), (3, 1)], (3, 1)], + [[(1,), (1, 3)], (1, 3)], + [[(), (1, 3)], (1, 3)], + [[(), (3, 1)], (3, 1)], + [[(), (0,)], (0,)], + [[(0,), (0, 0)], (0, 0)], + [[(0,), (0, 1)], (0, 0)], + [[(1,), (0, 0)], (0, 0)], + [[(), (0, 0)], (0, 0)], + [[(1, 1), (0,)], (1, 0)], + [[(1,), (0, 1)], (0, 1)], + [[(1,), (1, 0)], (1, 0)], + [[(), (1, 0)], (1, 0)], + [[(), (0, 1)], (0, 1)], + ] + for input_shapes, expected_shape in data: + self.broadcast_arrays_assert_correct_shape(input_shapes, expected_shape) + # Reverse the input shapes since broadcasting should be symmetric. + self.broadcast_arrays_assert_correct_shape(input_shapes[::-1], expected_shape) + + def test_broadcast_arrays_scalar_input(self): + pyfunc = numpy_broadcast_arrays + cfunc = jit(nopython=True)(pyfunc) + data = [ + [[True, False], (1,)], + [[1, 2], (1,)], + [[(1, 2), 2], (2,)], + ] + for inarrays, expected_shape in data: + outarrays = cfunc(*inarrays) + got = [a.shape for a in outarrays] + expected = [expected_shape] * len(inarrays) + self.assertPreciseEqual(expected, got) + + def test_broadcast_arrays_tuple_input(self): + pyfunc = numpy_broadcast_arrays + cfunc = jit(nopython=True)(pyfunc) + outarrays = cfunc((123, 456), (789,)) + expected = [(2,), (2,)] + got = [a.shape for a in outarrays] + self.assertPreciseEqual(expected, got) + + def test_broadcast_arrays_non_array_input(self): + pyfunc = numpy_broadcast_arrays + cfunc = jit(nopython=True)(pyfunc) + outarrays = cfunc(np.intp(2), np.zeros((1, 3), dtype=np.intp)) + expected = [(1, 3), (1, 3)] + got = [a.shape for a in outarrays] + self.assertPreciseEqual(expected, got) + + def test_broadcast_arrays_invalid_mixed_input_types(self): + pyfunc = numpy_broadcast_arrays + cfunc = jit(nopython=True)(pyfunc) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + arr = np.arange(6).reshape((2, 3)) + b = True + cfunc(arr, b) + self.assertIn('Mismatch of argument types', str(raises.exception)) + + def test_broadcast_arrays_invalid_input(self): + pyfunc = numpy_broadcast_arrays + cfunc = jit(nopython=True)(pyfunc) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + arr = np.zeros(3, dtype=np.int64) + s = 'hello world' + cfunc(arr, s) + self.assertIn('Argument "1" must be array-like', str(raises.exception)) + + def test_broadcast_arrays_incompatible_shapes_raise_valueerror(self): + # Check that a ValueError is raised for incompatible shapes. + pyfunc = numpy_broadcast_arrays + cfunc = jit(nopython=True)(pyfunc) + + self.disable_leak_check() + + data = [ + [(3,), (4,)], + [(2, 3), (2,)], + [(3,), (3,), (4,)], + [(1, 3, 4), (2, 3, 3)], + ] + for input_shapes in data: + for shape in [input_shapes, input_shapes[::-1]]: + # Reverse the input shapes since broadcasting should be symmetric. + with self.assertRaises(ValueError) as raises: + inarrays = [np.zeros(s) for s in shape] + cfunc(*inarrays) + self.assertIn("shape mismatch: objects cannot be broadcast to a single shape", + str(raises.exception)) + + def test_readonly_after_flatten(self): + # Reproduces Issue #8370 + def unfold_flatten(x, y): + r, c = x.shape + a = np.broadcast_to(x, (y, r, c)) + b = np.swapaxes(a, 0, 1) + cc = b.flatten() + d = np.reshape(cc, (-1, c)) + d[y - 1:, :] = d[: 1 - y] + return d + + pyfunc = unfold_flatten + cfunc = jit(nopython=True)(pyfunc) + + # If issue #8370 is not fixed: This will fail. + res_nb = cfunc(np.array([[1, 1, 1], [2, 2, 2], [3, 3, 3]]), 2) + res_py = pyfunc(np.array([[1, 1, 1], [2, 2, 2], [3, 3, 3]]), 2) + + np.testing.assert_array_equal(res_py, res_nb) + + def test_readonly_after_ravel(self): + # Reproduces another suggested problem in Issue #8370 + def unfold_ravel(x, y): + r, c = x.shape + a = np.broadcast_to(x, (y, r, c)) + b = np.swapaxes(a, 0, 1) + cc = b.ravel() + d = np.reshape(cc, (-1, c)) + d[y - 1:, :] = d[: 1 - y] + return d + + pyfunc = unfold_ravel + cfunc = jit(nopython=True)(pyfunc) + + # If issue #8370 is not fixed: This will fail. + res_nb = cfunc(np.array([[1, 1, 1], [2, 2, 2], [3, 3, 3]]), 2) + res_py = pyfunc(np.array([[1, 1, 1], [2, 2, 2], [3, 3, 3]]), 2) + + np.testing.assert_array_equal(res_py, res_nb) + + def test_mutability_after_ravel(self): + # Reproduces another suggested problem in Issue #8370 + # Namely that ravel should only return a writable array + # if a copy took place... otherwise leave it as it is. + self.disable_leak_check() + a_c = np.arange(9).reshape((3, 3)).copy() + a_f = a_c.copy(order='F') + a_c.flags.writeable = False + a_f.flags.writeable = False + + def try_ravel_w_copy(a): + result = a.ravel() + return result + + pyfunc = try_ravel_w_copy + cfunc = jit(nopython=True)(pyfunc) + + ret_c = cfunc(a_c) + ret_f = cfunc(a_f) + + msg = 'No copy was performed, so the ' \ + 'resulting array must not be writeable' + self.assertTrue(not ret_c.flags.writeable, msg) + + msg = 'A copy was performed, yet the resulting array is not modifiable' + self.assertTrue(ret_f.flags.writeable, msg) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_methods.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_methods.py new file mode 100644 index 0000000000000000000000000000000000000000..84074a77f753b38ec4bf42337ac7a9b5605af9bd --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_methods.py @@ -0,0 +1,1817 @@ +from itertools import product, cycle +import gc +import sys +import unittest +import warnings + +import numpy as np + +from numba import jit, njit, typeof +from numba.core import types +from numba.core.errors import TypingError, NumbaValueError +from numba.np.numpy_support import as_dtype, numpy_version +from numba.tests.support import (TestCase, MemoryLeakMixin, + needs_blas, skip_if_numpy_2, + expected_failure_np2) + +TIMEDELTA_M = 'timedelta64[M]' +TIMEDELTA_Y = 'timedelta64[Y]' + + +def np_around_array(arr, decimals, out): + np.around(arr, decimals, out) + +def np_around_binary(val, decimals): + return np.around(val, decimals) + +def np_around_unary(val): + return np.around(val) + +def np_round_array(arr, decimals, out): + np.round(arr, decimals, out) + +def np_round__array(arr, decimals, out): + np.round_(arr, decimals, out) + +def np_round_binary(val, decimals): + return np.round(val, decimals) + +def np_round_unary(val): + return np.round(val) + +def _fixed_np_round(arr, decimals=0, out=None): + """ + A slightly bugfixed version of np.round(). + """ + if out is not None and arr.dtype.kind == 'c': + # workaround for https://github.com/numpy/numpy/issues/5779 + _fixed_np_round(arr.real, decimals, out.real) + _fixed_np_round(arr.imag, decimals, out.imag) + return out + else: + res = np.round(arr, decimals, out) + if out is None: + # workaround for https://github.com/numpy/numpy/issues/5780 + def fixup_signed_zero(arg, res): + if res == 0.0 and arg < 0: + return -np.abs(res) + else: + return res + if isinstance(arr, (complex, np.complexfloating)): + res = complex(fixup_signed_zero(arr.real, res.real), + fixup_signed_zero(arr.imag, res.imag)) + else: + res = fixup_signed_zero(arr, res) + return res + + +def array_T(arr): + return arr.T + +def array_transpose(arr): + return arr.transpose() + +def array_copy(arr): + return arr.copy() + +def np_copy(arr): + return np.copy(arr) + +def np_asfortranarray(arr): + return np.asfortranarray(arr) + +def np_ascontiguousarray(arr): + return np.ascontiguousarray(arr) + +def array_view(arr, newtype): + return arr.view(newtype) + +def array_take(arr, indices): + return arr.take(indices) + +def array_take_kws(arr, indices, axis): + return arr.take(indices, axis=axis) + +def np_arange_1(arg0): + return np.arange(arg0) + +def np_arange_2(arg0, arg1): + return np.arange(arg0, arg1) + +def np_arange_3(arg0, arg1, arg2): + return np.arange(arg0, arg1, arg2) + +def np_arange_4(arg0, arg1, arg2, arg3): + return np.arange(arg0, arg1, arg2, arg3) + +def np_arange_1_stop(arg0, stop): + return np.arange(arg0, stop=stop) + +def np_arange_1_step(arg0, step): + return np.arange(arg0, step=step) + +def np_arange_1_dtype(arg0, dtype): + return np.arange(arg0, dtype=dtype) + +def np_arange_2_step(arg0, arg1, step): + return np.arange(arg0, arg1, step=step) + +def np_arange_2_dtype(arg0, arg1, dtype): + return np.arange(arg0, arg1, dtype=dtype) + +def np_arange_start_stop(start, stop): + return np.arange(start, stop=stop) + +def np_arange_start_stop_step(start, stop, step): + return np.arange(start, stop=stop, step=step) + +def np_arange_start_stop_step_dtype(start, stop, step, dtype): + return np.arange(start, stop=stop, step=step, dtype=dtype) + +def array_fill(arr, val): + return arr.fill(val) + +# XXX Can't pass a dtype as a Dispatcher argument for now +def make_array_view(newtype): + def array_view(arr): + return arr.view(newtype) + return array_view + +def array_sliced_view(arr, ): + return arr[0:4].view(np.float32)[0] + +def make_array_astype(newtype): + def array_astype(arr): + return arr.astype(newtype) + return array_astype + + +def np_frombuffer(b): + """ + np.frombuffer() on a Python-allocated buffer. + """ + return np.frombuffer(b) + +def np_frombuffer_dtype(b): + return np.frombuffer(b, dtype=np.complex64) + +def np_frombuffer_dtype_str(b): + return np.frombuffer(b, dtype='complex64') + +def np_frombuffer_allocated(shape): + """ + np.frombuffer() on a Numba-allocated buffer. + """ + arr = np.ones(shape, dtype=np.int32) + return np.frombuffer(arr) + +def np_frombuffer_allocated_dtype(shape): + arr = np.ones(shape, dtype=np.int32) + return np.frombuffer(arr, dtype=np.complex64) + +def identity_usecase(a, b): + return (a is b), (a is not b) + +def array_nonzero(a): + return a.nonzero() + +def np_nonzero(a): + return np.nonzero(a) + +def np_where_1(c): + return np.where(c) + +def np_where_3(c, x, y): + return np.where(c, x, y) + +def array_item(a): + return a.item() + +def array_itemset(a, v): + a.itemset(v) + +def array_sum(a, *args): + return a.sum(*args) + +def array_sum_axis_kws(a, axis): + return a.sum(axis=axis) + +def array_sum_dtype_kws(a, dtype): + return a.sum(dtype=dtype) + +def array_sum_axis_dtype_kws(a, dtype, axis): + return a.sum(axis=axis, dtype=dtype) + +def array_sum_axis_dtype_pos(a, a1, a2): + return a.sum(a1, a2) + +def array_sum_const_multi(arr, axis): + # use np.sum with different constant args multiple times to check + # for internal compile cache to see if constant-specialization is + # applied properly. + a = np.sum(arr, axis=4) + b = np.sum(arr, 3) + # the last invocation uses runtime-variable + c = np.sum(arr, axis) + # as method + d = arr.sum(axis=5) + # negative const axis + e = np.sum(arr, axis=-1) + return a, b, c, d, e + +def array_sum_const_axis_neg_one(a, axis): + # use .sum with -1 axis, this is for use with 1D arrays where the above + # "const_multi" variant would raise errors + return a.sum(axis=-1) + +def array_cumsum(a, *args): + return a.cumsum(*args) + +def array_cumsum_kws(a, axis): + return a.cumsum(axis=axis) + +def array_real(a): + return np.real(a) + +def array_imag(a): + return np.imag(a) + +def np_clip_no_out(a, a_min, a_max): + return np.clip(a, a_min, a_max) + +def np_clip(a, a_min, a_max, out=None): + return np.clip(a, a_min, a_max, out) + +def np_clip_kwargs(a, a_min, a_max, out=None): + return np.clip(a, a_min, a_max, out=out) + +def array_clip(a, a_min=None, a_max=None, out=None): + return a.clip(a_min, a_max, out) + +def array_clip_kwargs(a, a_min=None, a_max=None, out=None): + return a.clip(a_min, a_max, out=out) + +def array_clip_no_out(a, a_min, a_max): + return a.clip(a_min, a_max) + +def array_conj(a): + return a.conj() + +def array_conjugate(a): + return a.conjugate() + +def np_unique(a): + return np.unique(a) + + +def array_dot(a, b): + return a.dot(b) + +def array_dot_chain(a, b): + return a.dot(b).dot(b) + +def array_ctor(n, dtype): + return np.ones(n, dtype=dtype) + +class TestArrayMethods(MemoryLeakMixin, TestCase): + """ + Test various array methods and array-related functions. + """ + + def setUp(self): + super(TestArrayMethods, self).setUp() + + def check_round_scalar(self, unary_pyfunc, binary_pyfunc): + base_values = [-3.0, -2.5, -2.25, -1.5, 1.5, 2.25, 2.5, 2.75] + complex_values = [x * (1 - 1j) for x in base_values] + int_values = [int(x) for x in base_values] + argtypes = (types.float64, types.float32, types.int32, + types.complex64, types.complex128) + argvalues = [base_values, base_values, int_values, + complex_values, complex_values] + + pyfunc = binary_pyfunc + for ty, values in zip(argtypes, argvalues): + cfunc = njit((ty, types.int32))(pyfunc) + for decimals in (1, 0, -1): + for v in values: + if decimals > 0: + v *= 10 + expected = _fixed_np_round(v, decimals) + got = cfunc(v, decimals) + self.assertPreciseEqual(got, expected) + + pyfunc = unary_pyfunc + for ty, values in zip(argtypes, argvalues): + cfunc = njit((ty,))(pyfunc) + for v in values: + expected = _fixed_np_round(v) + got = cfunc(v) + self.assertPreciseEqual(got, expected) + + def test_round_scalar(self): + self.check_round_scalar(np_round_unary, np_round_binary) + + def test_around_scalar(self): + self.check_round_scalar(np_around_unary, np_around_binary) + + def check_round_array(self, pyfunc): + def check_round(cfunc, values, inty, outty, decimals): + # Create input and output arrays of the right type + arr = values.astype(as_dtype(inty)) + out = np.zeros_like(arr).astype(as_dtype(outty)) + pyout = out.copy() + _fixed_np_round(arr, decimals, pyout) + self.memory_leak_setup() + cfunc(arr, decimals, out) + self.memory_leak_teardown() + np.testing.assert_allclose(out, pyout) + # Output shape mismatch + with self.assertRaises(ValueError) as raises: + cfunc(arr, decimals, out[1:]) + self.assertEqual(str(raises.exception), + "invalid output shape") + + def check_types(argtypes, outtypes, values): + for inty, outty in product(argtypes, outtypes): + argtys = (types.Array(inty, 1, 'A'), types.int32, + types.Array(outty, 1, 'A')) + cfunc = njit(argtys)(pyfunc) + check_round(cfunc, values, inty, outty, 0) + check_round(cfunc, values, inty, outty, 1) + if not isinstance(outty, types.Integer): + check_round(cfunc, values * 10, inty, outty, -1) + else: + # Avoid Numpy bug when output is an int: + # https://github.com/numpy/numpy/issues/5777 + pass + + values = np.array([-3.0, -2.5, -2.25, -1.5, 1.5, 2.25, 2.5, 2.75]) + + argtypes = (types.float64, types.float32) + check_types(argtypes, argtypes, values) + + argtypes = (types.complex64, types.complex128) + check_types(argtypes, argtypes, values * (1 - 1j)) + + # Exceptions leak references + self.disable_leak_check() + + def test_round_array(self): + self.check_round_array(np_round_array) + + def test_around_array(self): + self.check_round_array(np_around_array) + + @skip_if_numpy_2 + def test_round__array(self): + self.check_round_array(np_round__array) + + def test_around_bad_array(self): + for pyfunc in (np_round_unary, np_around_unary): + cfunc = jit(nopython=True)(pyfunc) + msg = '.*The argument "a" must be array-like.*' + with self.assertRaisesRegex(TypingError, msg): + cfunc(None) + + def test_around_bad_out(self): + funcs = [np_round_array, np_around_array] + if numpy_version < (2, 0): + funcs.append(np_round__array) + for py_func in funcs: + cfunc = jit(nopython=True)(py_func) + msg = '.*The argument "out" must be an array if it is provided.*' + with self.assertRaisesRegex(TypingError, msg): + cfunc(5, 0, out=6) + + def test_array_view(self): + + def run(arr, dtype): + pyfunc = make_array_view(dtype) + return njit(pyfunc)(arr) + + def check(arr, dtype): + expected = arr.view(dtype) + self.memory_leak_setup() + got = run(arr, dtype) + self.assertPreciseEqual(got, expected) + del got + self.memory_leak_teardown() + + def check_err(arr, dtype): + with self.assertRaises(ValueError) as raises: + run(arr, dtype) + self.assertEqual(str(raises.exception), + "new type not compatible with array") + + def check_err_noncontig_last_axis(arr, dtype): + # check NumPy interpreted version raises + msg = ("To change to a dtype of a different size, the last axis " + "must be contiguous") + with self.assertRaises(ValueError) as raises: + make_array_view(dtype)(arr) + self.assertEqual(str(raises.exception), msg) + # check Numba version raises + with self.assertRaises(ValueError) as raises: + run(arr, dtype) + self.assertEqual(str(raises.exception), msg) + + def check_err_0d(arr, dtype): + # check NumPy interpreted version raises + msg = ("Changing the dtype of a 0d array is only supported " + "if the itemsize is unchanged") + with self.assertRaises(ValueError) as raises: + make_array_view(dtype)(arr) + self.assertEqual(str(raises.exception), msg) + # check Numba version raises + with self.assertRaises(ValueError) as raises: + run(arr, dtype) + self.assertEqual(str(raises.exception), msg) + + def check_err_smaller_dtype(arr, dtype): + # check NumPy interpreted version raises + msg = ("When changing to a smaller dtype, its size must be a " + "divisor of the size of original dtype") + with self.assertRaises(ValueError) as raises: + make_array_view(dtype)(arr) + self.assertEqual(str(raises.exception), msg) + # check Numba version raises + with self.assertRaises(ValueError) as raises: + run(arr, dtype) + self.assertEqual(str(raises.exception), msg) + + def check_err_larger_dtype(arr, dtype): + # check NumPy interpreted version raises + msg = ("When changing to a larger dtype, its size must be a " + "divisor of the total size in bytes of the last axis " + "of the array.") + with self.assertRaises(ValueError) as raises: + make_array_view(dtype)(arr) + self.assertEqual(str(raises.exception), msg) + # check Numba version raises + with self.assertRaises(ValueError) as raises: + run(arr, dtype) + self.assertEqual(str(raises.exception), msg) + + dt1 = np.dtype([('a', np.int8), ('b', np.int8)]) + dt2 = np.dtype([('u', np.int16), ('v', np.int8)]) + dt3 = np.dtype([('x', np.int16), ('y', np.int16)]) + + check_error_larger_dt = check_err_larger_dtype + check_error_smaller_dt = check_err_smaller_dtype + check_error_noncontig = check_err_noncontig_last_axis + check_error_0d = check_err_0d + + # C-contiguous + arr = np.arange(24, dtype=np.int8) + check(arr, np.dtype('int16')) + check(arr, np.int16) + check(arr, np.int8) + check(arr, np.float32) + check(arr, np.complex64) + check(arr, dt1) + check(arr, dt2) + check_error_larger_dt(arr, np.complex128) + + # Last dimension must have a compatible size + arr = arr.reshape((3, 8)) + check(arr, np.int8) + check(arr, np.float32) + check(arr, np.complex64) + check(arr, dt1) + check_error_larger_dt(arr, dt2) + check_error_larger_dt(arr, np.complex128) + + # F-contiguous + f_arr = np.arange(24, dtype=np.int8).reshape((3, 8)).T + # neither F or C contiguous + not_f_or_c_arr = np.zeros((4, 4)).T[::2, ::2] + + check_maybe_error = check_err_noncontig_last_axis + + check(f_arr, np.int8) + check(not_f_or_c_arr, np.uint64) + check_maybe_error(f_arr, np.float32) + check_maybe_error(f_arr, np.complex64) + check_maybe_error(f_arr, dt1) + + check_error_noncontig(f_arr, dt2) + check_error_noncontig(f_arr, np.complex128) + check_error_noncontig(not_f_or_c_arr, np.int8) + + # Non-contiguous: only a type with the same itemsize can be used + arr = np.arange(16, dtype=np.int32)[::2] + check(arr, np.uint32) + check(arr, np.float32) + check(arr, dt3) + check_error_noncontig(arr, np.int8) + check_error_noncontig(arr, np.int16) + check_error_noncontig(arr, np.int64) + check_error_noncontig(arr, dt1) + check_error_noncontig(arr, dt2) + + ## Zero-dim array: only a type with the same itemsize can be used + arr = np.array([42], dtype=np.int32).reshape(()) + check(arr, np.uint32) + check(arr, np.float32) + check(arr, dt3) + check_error_0d(arr, np.int8) + check_error_0d(arr, np.int16) + check_error_0d(arr, np.int64) + check_error_0d(arr, dt1) + check_error_0d(arr, dt2) + + # Changing to smaller dtype + arr = np.array(['abcdef']) + check_error_smaller_dt(arr, np.complex128) + + # Exceptions leak references + self.disable_leak_check() + + def test_array_sliced_view(self): + """ + Test .view() on A layout array but has contiguous innermost dimension. + """ + pyfunc = array_sliced_view + cfunc = njit((types.uint8[:],))(pyfunc) + + orig = np.array([1.5, 2], dtype=np.float32) + byteary = orig.view(np.uint8) + + expect = pyfunc(byteary) + got = cfunc(byteary) + + self.assertEqual(expect, got) + + def test_array_astype(self): + + def run(arr, dtype): + pyfunc = make_array_astype(dtype) + return njit(pyfunc)(arr) + + def check(arr, dtype): + expected = arr.astype(dtype).copy(order='A') + got = run(arr, dtype) + self.assertPreciseEqual(got, expected) + + # C-contiguous + arr = np.arange(24, dtype=np.int8) + check(arr, np.dtype('int16')) + check(arr, np.int32) + check(arr, np.float32) + check(arr, np.complex128) + check(arr, "float32") + + # F-contiguous + arr = np.arange(24, dtype=np.int8).reshape((3, 8)).T + check(arr, np.float32) + + # Non-contiguous + arr = np.arange(16, dtype=np.int32)[::2] + check(arr, np.uint64) + + # check read only attr does not get copied + arr = np.arange(16, dtype=np.int32) + arr.flags.writeable = False + check(arr, np.int32) + + # Invalid conversion + dt = np.dtype([('x', np.int8)]) + with self.assertTypingError() as raises: + check(arr, dt) + self.assertIn('cannot convert from int32 to Record', + str(raises.exception)) + # Check non-Literal string raises + unicode_val = "float32" + with self.assertTypingError() as raises: + @jit(nopython=True) + def foo(dtype): + np.array([1]).astype(dtype) + foo(unicode_val) + self.assertIn('array.astype if dtype is a string it must be constant', + str(raises.exception)) + + def check_np_frombuffer(self, pyfunc): + + cfunc = njit(pyfunc) + + def check(buf): + old_refcnt = sys.getrefcount(buf) + expected = pyfunc(buf) + self.memory_leak_setup() + got = cfunc(buf) + self.assertPreciseEqual(got, expected) + del expected + # Note gc.collect is due to references in `except ... as e` that + # aren't immediately cleared + gc.collect() + self.assertEqual(sys.getrefcount(buf), old_refcnt + 1) + del got + gc.collect() + self.assertEqual(sys.getrefcount(buf), old_refcnt) + self.memory_leak_teardown() + + b = bytearray(range(16)) + check(b) + check(bytes(b)) + check(memoryview(b)) + check(np.arange(12)) + b = np.arange(12).reshape((3, 4)) + check(b) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertRaises(ValueError) as raises: + cfunc(bytearray(b"xxx")) + self.assertEqual("buffer size must be a multiple of element size", + str(raises.exception)) + + def test_np_frombuffer(self): + self.check_np_frombuffer(np_frombuffer) + + def test_np_frombuffer_dtype(self): + self.check_np_frombuffer(np_frombuffer_dtype) + + def test_np_frombuffer_dtype_str(self): + self.check_np_frombuffer(np_frombuffer_dtype_str) + + def test_np_frombuffer_dtype_non_const_str(self): + @jit(nopython=True) + def func(buf, dt): + np.frombuffer(buf, dtype=dt) + + with self.assertRaises(TypingError) as raises: + func(bytearray(range(16)), 'int32') + + excstr = str(raises.exception) + msg = ("If np.frombuffer dtype is a string it must be a " + "string constant.") + self.assertIn(msg, excstr) + + def test_np_frombuffer_bad_buffer(self): + @jit(nopython=True) + def func(buf): + return np.frombuffer(buf) + + msg = '.*Argument "buffer" must be buffer-like.*' + with self.assertRaisesRegex(TypingError, msg) as raises: + func(None) + + def check_layout_dependent_func(self, pyfunc, fac=np.arange): + def is_same(a, b): + return a.ctypes.data == b.ctypes.data + def check_arr(arr): + cfunc = njit((typeof(arr),))(pyfunc) + expected = pyfunc(arr) + got = cfunc(arr) + self.assertPreciseEqual(expected, got) + self.assertEqual(is_same(expected, arr), is_same(got, arr)) + arr = fac(24) + check_arr(arr) + check_arr(arr.reshape((3, 8))) + check_arr(arr.reshape((3, 8)).T) + check_arr(arr.reshape((3, 8))[::2]) + check_arr(arr.reshape((2, 3, 4))) + check_arr(arr.reshape((2, 3, 4)).T) + check_arr(arr.reshape((2, 3, 4))[::2]) + arr = np.array([0]).reshape(()) + check_arr(arr) + + def test_array_transpose(self): + self.check_layout_dependent_func(array_transpose) + + def test_array_T(self): + self.check_layout_dependent_func(array_T) + + def test_array_copy(self): + self.check_layout_dependent_func(array_copy) + + def test_np_copy(self): + self.check_layout_dependent_func(np_copy) + + def check_ascontiguousarray_scalar(self, pyfunc): + def check_scalar(x): + cfunc = njit((typeof(x),))(pyfunc) + expected = pyfunc(x) + got = cfunc(x) + self.assertPreciseEqual(expected, got) + for x in [42, 42.0, 42j, np.float32(42), np.float64(42), True]: + check_scalar(x) + + def check_bad_array(self, pyfunc): + msg = '.*The argument "a" must be array-like.*' + with self.assertRaisesRegex(TypingError, msg) as raises: + njit((typeof('hello'), ))(pyfunc) + + def test_np_asfortranarray(self): + self.check_layout_dependent_func(np_asfortranarray) + self.check_bad_array(np_asfortranarray) + self.check_ascontiguousarray_scalar(np_asfortranarray) + + def test_np_ascontiguousarray(self): + self.check_layout_dependent_func(np_ascontiguousarray) + self.check_bad_array(np_asfortranarray) + self.check_ascontiguousarray_scalar(np_ascontiguousarray) + + def check_np_frombuffer_allocated(self, pyfunc): + + cfunc = njit(pyfunc) + + def check(shape): + expected = pyfunc(shape) + got = cfunc(shape) + self.assertPreciseEqual(got, expected) + + check((16,)) + check((4, 4)) + check((1, 0, 1)) + + def test_np_frombuffer_allocated(self): + self.check_np_frombuffer_allocated(np_frombuffer_allocated) + + def test_np_frombuffer_allocated2(self): + self.check_np_frombuffer_allocated(np_frombuffer_allocated_dtype) + + def check_nonzero(self, pyfunc): + def fac(N): + np.random.seed(42) + arr = np.random.random(N) + arr[arr < 0.3] = 0.0 + arr[arr > 0.7] = float('nan') + return arr + + def check_arr(arr): + cfunc = njit((typeof(arr),))(pyfunc) + expected = pyfunc(arr) + expected = [a.copy() for a in expected] + self.assertPreciseEqual(cfunc(arr), expected) + + arr = np.int16([1, 0, -1, 0]) + check_arr(arr) + arr = np.bool_([1, 0, 1]) + check_arr(arr) + + arr = fac(24) + check_arr(arr) + check_arr(arr.reshape((3, 8))) + check_arr(arr.reshape((3, 8)).T) + check_arr(arr.reshape((3, 8))[::2]) + check_arr(arr.reshape((2, 3, 4))) + check_arr(arr.reshape((2, 3, 4)).T) + check_arr(arr.reshape((2, 3, 4))[::2]) + + arr = np.array(["Hello", "", "world"]) + check_arr(arr) + + for v in (0.0, 1.5, float('nan')): + arr = np.array([v]).reshape(()) + if numpy_version < (2, 1): + check_arr(arr) + else: + with self.assertRaises((ValueError, TypingError)) as raises: + njit((typeof(arr),))(pyfunc) + msg = "Calling nonzero on 0d arrays is not allowed. Use " \ + "np.atleast_1d(scalar).nonzero() instead." + self.assertIn(msg, str(raises.exception)) + + def test_array_nonzero(self): + self.check_nonzero(array_nonzero) + + def test_np_nonzero(self): + self.check_nonzero(np_nonzero) + + def test_np_where_1(self): + self.check_nonzero(np_where_1) + + def test_np_where_3(self): + pyfunc = np_where_3 + def fac(N): + np.random.seed(42) + arr = np.random.random(N) + arr[arr < 0.3] = 0.0 + arr[arr > 0.7] = float('nan') + return arr + + layouts = cycle(['C', 'F', 'A']) + _types = [np.int32, np.int64, np.float32, np.float64, np.complex64, + np.complex128] + + np.random.seed(42) + + def check_arr(arr, layout=False): + np.random.shuffle(_types) + if layout != False: + x = np.zeros_like(arr, dtype=_types[0], order=layout) + y = np.zeros_like(arr, dtype=_types[1], order=layout) + arr = arr.copy(order=layout) + else: + x = np.zeros_like(arr, dtype=_types[0], order=next(layouts)) + y = np.zeros_like(arr, dtype=_types[1], order=next(layouts)) + x.fill(4) + y.fill(9) + cfunc = njit((typeof(arr), typeof(x), typeof(y)))(pyfunc) + expected = pyfunc(arr, x, y) + got = cfunc(arr, x, y) + self.assertPreciseEqual(got, expected) + + def check_scal(scal): + x = 4 + y = 5 + np.random.shuffle(_types) + x = _types[0](4) + y = _types[1](5) + cfunc = njit((typeof(scal), typeof(x), typeof(y)))(pyfunc) + expected = pyfunc(scal, x, y) + got = cfunc(scal, x, y) + self.assertPreciseEqual(got, expected) + + arr = np.int16([1, 0, -1, 0]) + check_arr(arr) + arr = np.bool_([1, 0, 1]) + check_arr(arr) + + arr = fac(24) + check_arr(arr) + check_arr(arr.reshape((3, 8))) + check_arr(arr.reshape((3, 8)).T) + check_arr(arr.reshape((3, 8))[::2]) + check_arr(arr.reshape((2, 3, 4))) + check_arr(arr.reshape((2, 3, 4)).T) + check_arr(arr.reshape((2, 3, 4))[::2]) + + check_arr(arr.reshape((2, 3, 4)), layout='F') + check_arr(arr.reshape((2, 3, 4)).T, layout='F') + check_arr(arr.reshape((2, 3, 4))[::2], layout='F') + + for v in (0.0, 1.5, float('nan')): + arr = np.array([v]).reshape(()) + check_arr(arr) + + for x in (0, 1, True, False, 2.5, 0j): + check_scal(x) + + def test_np_where_3_broadcast_x_y_scalar(self): + pyfunc = np_where_3 + cfunc = jit(nopython=True)(pyfunc) + + def check_ok(args): + expected = pyfunc(*args) + got = cfunc(*args) + self.assertPreciseEqual(got, expected) + + def a_variations(): + a = np.linspace(-2, 4, 20) + self.random.shuffle(a) + yield a + yield a.reshape(2, 5, 2) + yield a.reshape(4, 5, order='F') + yield a.reshape(2, 5, 2)[::-1] + + for a in a_variations(): + params = (a > 0, 0, 1) + check_ok(params) + + params = (a < 0, np.nan, 1 + 4j) + check_ok(params) + + params = (a > 1, True, False) + check_ok(params) + + def test_np_where_3_broadcast_x_or_y_scalar(self): + pyfunc = np_where_3 + cfunc = jit(nopython=True)(pyfunc) + + def check_ok(args): + condition, x, y = args + + expected = pyfunc(condition, x, y) + got = cfunc(condition, x, y) + self.assertPreciseEqual(got, expected) + + # swap x and y + expected = pyfunc(condition, y, x) + got = cfunc(condition, y, x) + self.assertPreciseEqual(got, expected) + + def array_permutations(): + x = np.arange(9).reshape(3, 3) + yield x + yield x * 1.1 + yield np.asfortranarray(x) + yield x[::-1] + yield np.linspace(-10, 10, 60).reshape(3, 4, 5) * 1j + + def scalar_permutations(): + yield 0 + yield 4.3 + yield np.nan + yield True + yield 8 + 4j + + for x in array_permutations(): + for y in scalar_permutations(): + x_mean = np.mean(x) + condition = x > x_mean + params = (condition, x, y) + check_ok(params) + + def test_np_where_numpy_basic(self): + # https://github.com/numpy/numpy/blob/fe2bb380fd9a084b622ff3f00cb6f245e8c1a10e/numpy/core/tests/test_multiarray.py#L8670-L8694 + pyfunc = np_where_3 + cfunc = jit(nopython=True)(pyfunc) + + # skipping unsupported dtypes: + # np.longdouble, np.clongdouble + dts = [bool, np.int16, np.int32, np.int64, np.double, np.complex128] + for dt in dts: + c = np.ones(53, dtype=bool) + np.testing.assert_equal(cfunc( c, dt(0), dt(1)), dt(0)) + np.testing.assert_equal(cfunc(~c, dt(0), dt(1)), dt(1)) + np.testing.assert_equal(cfunc(True, dt(0), dt(1)), dt(0)) + np.testing.assert_equal(cfunc(False, dt(0), dt(1)), dt(1)) + d = np.ones_like(c).astype(dt) + e = np.zeros_like(d) + r = d.astype(dt) + c[7] = False + r[7] = e[7] + np.testing.assert_equal(cfunc(c, e, e), e) + np.testing.assert_equal(cfunc(c, d, e), r) + np.testing.assert_equal(cfunc(c, d, e[0]), r) + np.testing.assert_equal(cfunc(c, d[0], e), r) + np.testing.assert_equal(cfunc(c[::2], d[::2], e[::2]), r[::2]) + np.testing.assert_equal(cfunc(c[1::2], d[1::2], e[1::2]), r[1::2]) + np.testing.assert_equal(cfunc(c[::3], d[::3], e[::3]), r[::3]) + np.testing.assert_equal(cfunc(c[1::3], d[1::3], e[1::3]), r[1::3]) + np.testing.assert_equal(cfunc(c[::-2], d[::-2], e[::-2]), r[::-2]) + np.testing.assert_equal(cfunc(c[::-3], d[::-3], e[::-3]), r[::-3]) + np.testing.assert_equal(cfunc(c[1::-3], d[1::-3], e[1::-3]), r[1::-3]) + + def test_np_where_numpy_ndim(self): + # https://github.com/numpy/numpy/blob/fe2bb380fd9a084b622ff3f00cb6f245e8c1a10e/numpy/core/tests/test_multiarray.py#L8737-L8749 + pyfunc = np_where_3 + cfunc = jit(nopython=True)(pyfunc) + + c = [True, False] + a = np.zeros((2, 25)) + b = np.ones((2, 25)) + r = cfunc(np.array(c)[:,np.newaxis], a, b) + np.testing.assert_array_equal(r[0], a[0]) + np.testing.assert_array_equal(r[1], b[0]) + + a = a.T + b = b.T + r = cfunc(c, a, b) + np.testing.assert_array_equal(r[:,0], a[:,0]) + np.testing.assert_array_equal(r[:,1], b[:,0]) + + def test_np_where_numpy_dtype_mix(self): + # https://github.com/numpy/numpy/blob/fe2bb380fd9a084b622ff3f00cb6f245e8c1a10e/numpy/core/tests/test_multiarray.py#L8751-L8773 + pyfunc = np_where_3 + cfunc = jit(nopython=True)(pyfunc) + + c = np.array([False, True, False, False, False, False, True, False, + False, False, True, False]) + a = np.uint32(1) + b = np.array([5., 0., 3., 2., -1., -4., 0., -10., 10., 1., 0., 3.], + dtype=np.float64) + r = np.array([5., 1., 3., 2., -1., -4., 1., -10., 10., 1., 1., 3.], + dtype=np.float64) + np.testing.assert_equal(cfunc(c, a, b), r) + + a = a.astype(np.float32) + b = b.astype(np.int64) + np.testing.assert_equal(cfunc(c, a, b), r) + + # non bool mask + c = c.astype(int) + c[c != 0] = 34242324 + np.testing.assert_equal(cfunc(c, a, b), r) + # invert + tmpmask = c != 0 + c[c == 0] = 41247212 + c[tmpmask] = 0 + np.testing.assert_equal(cfunc(c, b, a), r) + + def test_np_where_numpy_test_error(self): + # https://github.com/numpy/numpy/blob/fe2bb380fd9a084b622ff3f00cb6f245e8c1a10e/numpy/core/tests/test_multiarray.py#L8794-L8799 + pyfunc = np_where_3 + cfunc = jit(nopython=True)(pyfunc) + + c = [True, True] + a = np.ones((4, 5)) + b = np.ones((5, 5)) + + self.disable_leak_check() + with self.assertRaisesRegex(ValueError, "objects cannot be broadcast"): + cfunc(c, a, b) + + with self.assertRaisesRegex(ValueError, "objects cannot be broadcast"): + cfunc(c[0], a, b) + + def test_np_where_invalid_inputs(self): + pyfunc = np_where_3 + cfunc = jit(nopython=True)(pyfunc) + + msg = 'The argument "condition" must be array-like' + with self.assertRaisesRegex(TypingError, msg): + cfunc(None, 2, 3) + + msg = 'The argument "x" must be array-like if provided' + with self.assertRaisesRegex(TypingError, msg): + cfunc(1, 'hello', 3) + + msg = 'The argument "y" must be array-like if provided' + with self.assertRaisesRegex(TypingError, msg): + cfunc(1, 2, 'world') + + # None values are not yet supported in np.where + msg = 'Argument "x" or "y" cannot be None' + with self.assertRaisesRegex(TypingError, msg): + cfunc(1, None, None) + + def test_arange_1_arg(self): + + all_pyfuncs = ( + np_arange_1, + lambda x: np.arange(x, 10), + lambda x: np.arange(7, step=max(1, abs(x))) + ) + + for pyfunc in all_pyfuncs: + cfunc = jit(nopython=True)(pyfunc) + + def check_ok(arg0): + expected = pyfunc(arg0) + got = cfunc(arg0) + np.testing.assert_allclose(expected, got) + + check_ok(0) + check_ok(1) + check_ok(4) + check_ok(5.5) + check_ok(-3) + check_ok(complex(4, 4)) + check_ok(np.int8(0)) + + def test_arange_2_arg(self): + def check_ok(arg0, arg1, pyfunc, cfunc): + expected = pyfunc(arg0, arg1) + got = cfunc(arg0, arg1) + np.testing.assert_allclose(expected, got) + + all_pyfuncs = ( + np_arange_2, + np_arange_start_stop, + np_arange_1_stop, + np_arange_1_step, + lambda x, y: np.arange(x, y, 5), + lambda x, y: np.arange(2, y, step=x), + ) + + for pyfunc in all_pyfuncs: + cfunc = jit(nopython=True)(pyfunc) + + check_ok(-1, 5, pyfunc, cfunc) + check_ok(-8, -1, pyfunc, cfunc) + check_ok(4, 0.5, pyfunc, cfunc) + check_ok(0.5, 4, pyfunc, cfunc) + check_ok(3, None, pyfunc, cfunc) + if numpy_version < (2, 0): + check_ok(complex(1, 1), complex(4, 4), pyfunc, cfunc) + check_ok(complex(4, 4), complex(1, 1), pyfunc, cfunc) + + pyfunc = np_arange_1_dtype + cfunc = jit(nopython=True)(pyfunc) + + check_ok(5, np.float32, pyfunc, cfunc) + check_ok(2.0, np.int32, pyfunc, cfunc) + check_ok(7, None, pyfunc, cfunc) + check_ok(np.int8(0), None, pyfunc, cfunc) + + if numpy_version < (2, 0): + check_ok(10, np.complex128, pyfunc, cfunc) + check_ok(np.complex64(10), np.complex128, pyfunc, cfunc) + + def test_arange_3_arg(self): + windows64 = sys.platform.startswith('win32') and sys.maxsize > 2 ** 32 + + def check_ok(arg0, arg1, arg2, pyfunc, cfunc, check_dtype=False): + expected = pyfunc(arg0, arg1, arg2) + got = cfunc(arg0, arg1, arg2) + np.testing.assert_allclose(expected, got) + # windows 64 cannot differentiate between a python int and a + # np.int64 which means the result from numba is int64 more often + # than in NumPy. + if not windows64: + self.assertEqual(expected.dtype, got.dtype) + + for pyfunc in (np_arange_3, np_arange_2_step, np_arange_start_stop_step): + cfunc = jit(nopython=True)(pyfunc) + + check_ok(0, 5, 1, pyfunc, cfunc) + check_ok(-8, -1, 3, pyfunc, cfunc) + check_ok(0, -10, -2, pyfunc, cfunc) + check_ok(0.5, 4, 2, pyfunc, cfunc) + check_ok(0, 1, 0.1, pyfunc, cfunc) + check_ok(3, 6, None, pyfunc, cfunc) + check_ok(3, None, None, pyfunc, cfunc) + check_ok(np.int8(0), np.int8(5), np.int8(1), pyfunc, cfunc) + check_ok(np.int8(0), np.int16(5), np.int32(1), pyfunc, cfunc) + # check upcasting logic, this matters most on windows + i8 = np.int8 + check_ok(i8(0), i8(5), i8(1), pyfunc, cfunc, True) # C int + check_ok(np.int64(0), i8(5), i8(1), pyfunc, cfunc, True) # int64 + if numpy_version < (2, 0): + check_ok(0, complex(4, 4), complex(1, 1), pyfunc, cfunc) + + pyfunc = np_arange_2_dtype + cfunc = jit(nopython=True)(pyfunc) + + check_ok(1, 5, np.float32, pyfunc, cfunc) + check_ok(2.0, 8, np.int32, pyfunc, cfunc) + check_ok(1, 7, None, pyfunc, cfunc) + check_ok(np.int8(0), np.int32(5), None, pyfunc, cfunc, True) + if numpy_version < (2, 0): + check_ok(-2, 10, np.complex128, pyfunc, cfunc) + check_ok(3, np.complex64(10), np.complex128, pyfunc, cfunc) + + def test_arange_4_arg(self): + for pyfunc in (np_arange_4, np_arange_start_stop_step_dtype): + cfunc = jit(nopython=True)(pyfunc) + + def check_ok(arg0, arg1, arg2, arg3): + expected = pyfunc(arg0, arg1, arg2, arg3) + got = cfunc(arg0, arg1, arg2, arg3) + np.testing.assert_allclose(expected, got) + + check_ok(0, 5, 1, np.float64) + check_ok(-8, -1, 3, np.int32) + check_ok(0, -10, -2, np.float32) + check_ok(0.5, 4, 2, None) + check_ok(3, 6, None, None) + check_ok(3, None, None, None) + if numpy_version < (2, 0): + check_ok(0, 1, 0.1, np.complex128) + check_ok(0, complex(4, 4), complex(1, 1), np.complex128) + + def test_arange_throws(self): + # Exceptions leak references + self.disable_leak_check() + + bad_funcs_1 = [ + lambda x: np.arange(stop=x), + lambda x: np.arange(step=x), + lambda x: np.arange(dtype=x), + ] + bad_funcs_2 = [ + lambda x, y: np.arange(stop=x, step=y), + lambda x, y: np.arange(stop=x, dtype=y), + ] + + for pyfunc in bad_funcs_1: + with self.assertRaises(TypingError) as raises: + cfunc = jit(nopython=True)(pyfunc) + cfunc(2) + for pyfunc in bad_funcs_2: + with self.assertRaises(TypingError) as raises: + cfunc = jit(nopython=True)(pyfunc) + cfunc(2, 6) + + # check step size = 0, this is nonsense + pyfunc = np_arange_3 + cfunc = jit(nopython=True)(pyfunc) + for f in (pyfunc, cfunc,): + for inputs in [(1, np.int16(2), 0), (1, 2, 0)]: + # there's a different error depending on whether any of the + # input values are np scalars + permitted_errors = (ZeroDivisionError, ValueError) + with self.assertRaises(permitted_errors) as raises: + # this will raise RuntimeWarning's about zero division + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + f(*inputs) + self.assertIn("Maximum allowed size exceeded", + str(raises.exception)) + + def test_arange_accuracy(self): + # Checking arange reasonably replicates NumPy's algorithm + # see https://github.com/numba/numba/issues/6768 + @jit(nopython=True) + def foo(step): + return np.arange(0, 1 + step, step) + + x = 0.010101010101010102 + self.assertPreciseEqual(foo(x), foo.py_func(x)) + + def test_item(self): + pyfunc = array_item + cfunc = jit(nopython=True)(pyfunc) + + def check_ok(arg): + expected = pyfunc(arg) + got = cfunc(arg) + self.assertPreciseEqual(got, expected) + + def check_err(arg): + with self.assertRaises(ValueError) as raises: + cfunc(arg) + self.assertIn("item(): can only convert an array of size 1 to a Python scalar", + str(raises.exception)) + + # Exceptions leak references + self.disable_leak_check() + + # Test on different kinds of scalars and 1-item arrays + check_ok(np.float32([1.5])) + check_ok(np.complex128([[1.5j]])) + check_ok(np.array(1.5)) + check_ok(np.bool_(True)) + check_ok(np.float32(1.5)) + + check_err(np.array([1, 2])) + check_err(np.array([])) + + @skip_if_numpy_2 + def test_itemset(self): + pyfunc = array_itemset + cfunc = jit(nopython=True)(pyfunc) + + def check_ok(a, v): + expected = a.copy() + got = a.copy() + pyfunc(expected, v) + cfunc(got, v) + self.assertPreciseEqual(got, expected) + + def check_err(a): + with self.assertRaises(ValueError) as raises: + cfunc(a, 42) + self.assertIn("itemset(): can only write to an array of size 1", + str(raises.exception)) + + # Exceptions leak references + self.disable_leak_check() + + # Test on different kinds of 1-item arrays + check_ok(np.float32([1.5]), 42) + check_ok(np.complex128([[1.5j]]), 42) + check_ok(np.array(1.5), 42) + + check_err(np.array([1, 2])) + check_err(np.array([])) + + def test_sum(self): + """ test sum over a whole range of dtypes, no axis or dtype parameter + """ + pyfunc = array_sum + cfunc = jit(nopython=True)(pyfunc) + all_dtypes = [np.float64, np.float32, np.int64, np.int32, + np.complex64, np.complex128, np.timedelta64] + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype), + np.ones((7, 3), arr_dtype) * -5] + for arr_dtype in all_dtypes] + + unsigned_dtypes = [np.uint32, np.uint64, np.bool_] + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype)] + for arr_dtype in unsigned_dtypes] + + for arr_list in all_test_arrays: + for arr in arr_list: + with self.subTest("Test np.sum with {} input ".format(arr.dtype)): + self.assertPreciseEqual(pyfunc(arr), cfunc(arr)) + + def test_sum_axis_kws1(self): + """ test sum with axis parameter over a whole range of dtypes """ + pyfunc = array_sum_axis_kws + cfunc = jit(nopython=True)(pyfunc) + all_dtypes = [np.float64, np.float32, np.int64, np.complex64, + np.complex128, TIMEDELTA_M] + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype), + np.ones((7, 3), arr_dtype) * -5] + for arr_dtype in all_dtypes] + + unsigned_dtypes = [np.uint64, np.bool_] + all_test_arrays += [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype)] + for arr_dtype in unsigned_dtypes] + + for arr_list in all_test_arrays: + for arr in arr_list: + for axis in (0, 1, 2): + if axis > len(arr.shape)-1: + continue + with self.subTest("Testing np.sum(axis) with {} " + "input ".format(arr.dtype)): + self.assertPreciseEqual(pyfunc(arr, axis=axis), + cfunc(arr, axis=axis)) + + def test_sum_axis_kws2(self): + """ testing uint32 and int32 separately + + uint32 and int32 must be tested separately because Numpy's current + behaviour is different in 64bits Windows (accumulates as int32) + and 64bits Linux (accumulates as int64), while Numba has decided to always + accumulate as int64, when the OS is 64bits. No testing has been done + for behaviours in 32 bits platforms. + """ + pyfunc = array_sum_axis_kws + cfunc = jit(nopython=True)(pyfunc) + all_dtypes = [np.int32] + # expected return dtypes in Numba + out_dtypes = {np.dtype('int32'): np.int64, np.dtype('uint32'): np.uint64, + np.dtype('int64'): np.int64, + np.dtype(TIMEDELTA_M): np.dtype(TIMEDELTA_M)} + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype), + np.ones((7, 3), arr_dtype) * -5] + for arr_dtype in all_dtypes] + + unsigned_dtypes = [np.uint32] + all_test_arrays += [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype)] + for arr_dtype in unsigned_dtypes] + + for arr_list in all_test_arrays: + for arr in arr_list: + for axis in (0, 1, 2): + if axis > len(arr.shape)-1: + continue + with self.subTest("Testing np.sum(axis) with {} " + "input ".format(arr.dtype)): + npy_res = pyfunc(arr, axis=axis) + numba_res = cfunc(arr, axis=axis) + if isinstance(numba_res, np.ndarray): + self.assertPreciseEqual( + npy_res.astype(out_dtypes[arr.dtype]), + numba_res.astype(out_dtypes[arr.dtype])) + else: + # the results are scalars + self.assertEqual(npy_res, numba_res) + + def test_sum_dtype_kws(self): + """ test sum with dtype parameter over a whole range of dtypes """ + pyfunc = array_sum_dtype_kws + cfunc = jit(nopython=True)(pyfunc) + all_dtypes = [np.float64, np.float32, np.int64, np.int32, + np.complex64, np.complex128] + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype), + np.ones((7, 3), arr_dtype) * -5] + for arr_dtype in all_dtypes] + + unsigned_dtypes = [np.uint32, np.uint64, np.bool_] + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype)] + for arr_dtype in unsigned_dtypes] + + out_dtypes = {np.dtype('float64'): [np.float64], + np.dtype('float32'): [np.float64, np.float32], + np.dtype('int64'): [np.float64, np.int64, np.float32], + np.dtype('int32'): [np.float64, np.int64, np.float32, np.int32], + np.dtype('uint32'): [np.float64, np.int64, np.float32], + np.dtype('uint64'): [np.float64, np.int64], + np.dtype('bool'): [np.float64, np.int64, np.float32, np.int32, np.bool_], + np.dtype('complex64'): [np.complex64, np.complex128], + np.dtype('complex128'): [np.complex128]} + + for arr_list in all_test_arrays: + for arr in arr_list: + for out_dtype in out_dtypes[arr.dtype]: + subtest_str = ("Testing np.sum with {} input and {} output" + .format(arr.dtype, out_dtype)) + with self.subTest(subtest_str): + self.assertPreciseEqual(pyfunc(arr, dtype=out_dtype), + cfunc(arr, dtype=out_dtype)) + + def test_sum_axis_dtype_kws(self): + """ test sum with axis and dtype parameters over a whole range of dtypes """ + pyfunc = array_sum_axis_dtype_kws + cfunc = jit(nopython=True)(pyfunc) + all_dtypes = [np.float64, np.float32, np.int64, np.int32, + np.complex64, np.complex128] + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype), + np.ones((7, 3), arr_dtype) * -5] + for arr_dtype in all_dtypes] + + unsigned_dtypes = [np.uint32, np.uint64, np.bool_] + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype)] + for arr_dtype in unsigned_dtypes] + + out_dtypes = {np.dtype('float64'): [np.float64], + np.dtype('float32'): [np.float64, np.float32], + np.dtype('int64'): [np.float64, np.int64, np.float32], + np.dtype('int32'): [np.float64, np.int64, np.float32, np.int32], + np.dtype('uint32'): [np.float64, np.int64, np.float32], + np.dtype('uint64'): [np.float64, np.uint64], + np.dtype('bool'): [np.float64, np.int64, np.float32, np.int32, np.bool_], + np.dtype('complex64'): [np.complex64, np.complex128], + np.dtype('complex128'): [np.complex128]} + + for arr_list in all_test_arrays: + for arr in arr_list: + for out_dtype in out_dtypes[arr.dtype]: + for axis in (0, 1, 2): + if axis > len(arr.shape) - 1: + continue + subtest_str = ("Testing np.sum with {} input and {} output " + .format(arr.dtype, out_dtype)) + with self.subTest(subtest_str): + py_res = pyfunc(arr, axis=axis, dtype=out_dtype) + nb_res = cfunc(arr, axis=axis, dtype=out_dtype) + self.assertPreciseEqual(py_res, nb_res) + + def test_sum_axis_dtype_pos_arg(self): + """ testing that axis and dtype inputs work when passed as positional """ + pyfunc = array_sum_axis_dtype_pos + cfunc = jit(nopython=True)(pyfunc) + dtype = np.float64 + # OK + a = np.ones((7, 6, 5, 4, 3)) + self.assertPreciseEqual(pyfunc(a, 1, dtype), + cfunc(a, 1, dtype)) + + self.assertPreciseEqual(pyfunc(a, 2, dtype), + cfunc(a, 2, dtype)) + + def test_sum_1d_kws(self): + # check 1d reduces to scalar + pyfunc = array_sum_axis_kws + cfunc = jit(nopython=True)(pyfunc) + a = np.arange(10.) + self.assertPreciseEqual(pyfunc(a, axis=0), cfunc(a, axis=0)) + pyfunc = array_sum_const_axis_neg_one + cfunc = jit(nopython=True)(pyfunc) + a = np.arange(10.) + self.assertPreciseEqual(pyfunc(a, axis=-1), cfunc(a, axis=-1)) + + def test_sum_const(self): + pyfunc = array_sum_const_multi + cfunc = jit(nopython=True)(pyfunc) + + arr = np.ones((3, 4, 5, 6, 7, 8)) + axis = 1 + self.assertPreciseEqual(pyfunc(arr, axis), cfunc(arr, axis)) + axis = 2 + self.assertPreciseEqual(pyfunc(arr, axis), cfunc(arr, axis)) + + def test_sum_exceptions(self): + # Exceptions leak references + self.disable_leak_check() + pyfunc = array_sum + cfunc = jit(nopython=True)(pyfunc) + + a = np.ones((7, 6, 5, 4, 3)) + b = np.ones((4, 3)) + # BAD: axis > dimensions + with self.assertRaises(ValueError): + cfunc(b, 2) + # BAD: negative axis + with self.assertRaises(ValueError): + cfunc(a, -1) + # BAD: axis greater than 3 + with self.assertRaises(ValueError): + cfunc(a, 4) + + def test_sum_const_negative(self): + # Exceptions leak references + self.disable_leak_check() + + @jit(nopython=True) + def foo(arr): + return arr.sum(axis=-3) + + # ndim == 4, axis == -3, OK + a = np.ones((1, 2, 3, 4)) + self.assertPreciseEqual(foo(a), foo.py_func(a)) + # ndim == 3, axis == -3, OK + a = np.ones((1, 2, 3)) + self.assertPreciseEqual(foo(a), foo.py_func(a)) + # ndim == 2, axis == -3, BAD + a = np.ones((1, 2)) + with self.assertRaises(NumbaValueError) as raises: + foo(a) + errmsg = "'axis' entry (-1) is out of bounds" + self.assertIn(errmsg, str(raises.exception)) + with self.assertRaises(ValueError) as raises: + foo.py_func(a) + self.assertIn("out of bounds", str(raises.exception)) + + def test_cumsum(self): + pyfunc = array_cumsum + cfunc = jit(nopython=True)(pyfunc) + # OK + a = np.ones((2, 3)) + self.assertPreciseEqual(pyfunc(a), cfunc(a)) + # BAD: with axis + with self.assertRaises(TypingError): + cfunc(a, 1) + # BAD: with kw axis + pyfunc = array_cumsum_kws + cfunc = jit(nopython=True)(pyfunc) + with self.assertRaises(TypingError): + cfunc(a, axis=1) + + def test_take(self): + pyfunc = array_take + cfunc = jit(nopython=True)(pyfunc) + + def check(arr, ind): + expected = pyfunc(arr, ind) + got = cfunc(arr, ind) + self.assertPreciseEqual(expected, got) + if hasattr(expected, 'order'): + self.assertEqual(expected.order == got.order) + + # need to check: + # 1. scalar index + # 2. 1d array index + # 3. nd array index, >2d and F order + # 4. reflected list + # 5. tuples + + test_indices = [] + test_indices.append(1) + test_indices.append(5) + test_indices.append(11) + test_indices.append(-2) + test_indices.append(np.array([1, 5, 1, 11, 3])) + test_indices.append(np.array([[1, 5, 1], [11, 3, 0]], order='F')) + test_indices.append(np.array([[[1, 5, 1], [11, 3, 0]]])) + test_indices.append(np.array([[[[1, 5]], [[11, 0]], [[1, 2]]]])) + test_indices.append([1, 5, 1, 11, 3]) + test_indices.append((1, 5, 1)) + test_indices.append(((1, 5, 1), (11, 3, 2))) + test_indices.append((((1,), (5,), (1,)), ((11,), (3,), (2,)))) + + layouts = cycle(['C', 'F', 'A']) + + for dt in [np.float64, np.int64, np.complex128]: + A = np.arange(12, dtype=dt).reshape((4, 3), order=next(layouts)) + for ind in test_indices: + check(A, ind) + + #check illegal access raises + A = np.arange(12, dtype=dt).reshape((4, 3), order=next(layouts)) + szA = A.size + illegal_indices = [szA, -szA - 1, np.array(szA), np.array(-szA - 1), + [szA], [-szA - 1]] + for x in illegal_indices: + with self.assertRaises(IndexError): + cfunc(A, x) # oob raises + + # check float indexing raises + with self.assertRaises(TypingError): + cfunc(A, [1.7]) + + #exceptions leak refs + self.disable_leak_check() + + def test_fill(self): + pyfunc = array_fill + cfunc = jit(nopython=True)(pyfunc) + def check(arr, val): + expected = np.copy(arr) + erv = pyfunc(expected, val) + self.assertTrue(erv is None) + got = np.copy(arr) + grv = cfunc(got, val) + self.assertTrue(grv is None) + # check mutation is the same + self.assertPreciseEqual(expected, got) + + # scalar + A = np.arange(1) + for x in [np.float64, np.bool_]: + check(A, x(10)) + + # 2d + A = np.arange(12).reshape(3, 4) + for x in [np.float64, np.bool_]: + check(A, x(10)) + + # 4d + A = np.arange(48, dtype=np.complex64).reshape(2, 3, 4, 2) + for x in [np.float64, np.complex128, np.bool_]: + check(A, x(10)) + + def test_real(self): + pyfunc = array_real + cfunc = jit(nopython=True)(pyfunc) + + x = np.linspace(-10, 10) + np.testing.assert_equal(pyfunc(x), cfunc(x)) + + x, y = np.meshgrid(x, x) + z = x + 1j*y + np.testing.assert_equal(pyfunc(z), cfunc(z)) + + def test_imag(self): + pyfunc = array_imag + cfunc = jit(nopython=True)(pyfunc) + + x = np.linspace(-10, 10) + np.testing.assert_equal(pyfunc(x), cfunc(x)) + + x, y = np.meshgrid(x, x) + z = x + 1j*y + np.testing.assert_equal(pyfunc(z), cfunc(z)) + + def _lower_clip_result_test_util(self, func, a, a_min, a_max): + # verifies that type-inference is working on the return value + # this used to trigger issue #3489 + def lower_clip_result(a): + return np.expm1(func(a, a_min, a_max)) + + np.testing.assert_almost_equal( + lower_clip_result(a), + jit(nopython=True)(lower_clip_result)(a)) + + def test_clip(self): + has_out = (np_clip, np_clip_kwargs, array_clip, array_clip_kwargs) + has_no_out = (np_clip_no_out, array_clip_no_out) + # TODO: scalars are not tested (issue #3469) + for a in (np.linspace(-10, 10, 101), + np.linspace(-10, 10, 40).reshape(5, 2, 4)): + for pyfunc in has_out + has_no_out: + cfunc = jit(nopython=True)(pyfunc) + + msg = "array_clip: must set either max or min" + with self.assertRaisesRegex(ValueError, msg): + cfunc(a, None, None) + + np.testing.assert_equal(pyfunc(a, 0, None), cfunc(a, 0, None)) + np.testing.assert_equal(pyfunc(a, None, 0), cfunc(a, None, 0)) + + np.testing.assert_equal(pyfunc(a, -5, 5), cfunc(a, -5, 5)) + + if pyfunc in has_out: + pyout = np.empty_like(a) + cout = np.empty_like(a) + np.testing.assert_equal(pyfunc(a, -5, 5, pyout), + cfunc(a, -5, 5, cout)) + np.testing.assert_equal(pyout, cout) + + self._lower_clip_result_test_util(cfunc, a, -5, 5) + + def test_clip_array_min_max(self): + has_out = (np_clip, np_clip_kwargs, array_clip, array_clip_kwargs) + has_no_out = (np_clip_no_out, array_clip_no_out) + # TODO: scalars are not tested (issue #3469) + a = np.linspace(-10, 10, 40).reshape(5, 2, 4) + a_min_arr = np.arange(-8, 0).astype(a.dtype).reshape(2, 4) + a_max_arr = np.arange(0, 8).astype(a.dtype).reshape(2, 4) + mins = [0, -5, a_min_arr, None] + maxs = [0, 5, a_max_arr, None] + for pyfunc in has_out + has_no_out: + cfunc = jit(nopython=True)(pyfunc) + + for a_min in mins: + for a_max in maxs: + + if a_min is None and a_max is None: + msg = "array_clip: must set either max or min" + with self.assertRaisesRegex(ValueError, msg): + cfunc(a, None, None) + continue + + np.testing.assert_equal(pyfunc(a, a_min, a_max), cfunc(a, a_min, a_max)) + + if pyfunc in has_out: + pyout = np.empty_like(a) + cout = np.empty_like(a) + np.testing.assert_equal(pyfunc(a, a_min, a_max, pyout), + cfunc(a, a_min, a_max, cout)) + np.testing.assert_equal(pyout, cout) + + self._lower_clip_result_test_util(cfunc, a, a_min, a_max) + + def test_clip_bad_array(self): + cfunc = jit(nopython=True)(np_clip) + msg = '.*The argument "a" must be array-like.*' + with self.assertRaisesRegex(TypingError, msg): + cfunc(None, 0, 10) + + def test_clip_bad_min(self): + cfunc = jit(nopython=True)(np_clip) + msg = '.*The argument "a_min" must be a number.*' + with self.assertRaisesRegex(TypingError, msg): + cfunc(1, 'a', 10) + + def test_clip_bad_max(self): + cfunc = jit(nopython=True)(np_clip) + msg = '.*The argument "a_max" must be a number.*' + with self.assertRaisesRegex(TypingError, msg): + cfunc(1, 1, 'b') + + def test_clip_bad_out(self): + cfunc = jit(nopython=True)(np_clip) + msg = '.*The argument "out" must be an array if it is provided.*' + with self.assertRaisesRegex(TypingError, msg): + cfunc(5, 1, 10, out=6) + + def test_clip_no_broadcast(self): + self.disable_leak_check() + cfunc = jit(nopython=True)(np_clip) + msg = ".*shape mismatch: objects cannot be broadcast to a single shape.*" + a = np.linspace(-10, 10, 40).reshape(5, 2, 4) + a_min_arr = np.arange(-5, 0).astype(a.dtype).reshape(5, 1) + a_max_arr = np.arange(0, 5).astype(a.dtype).reshape(5, 1) + min_max = [(0, a_max_arr), (-5, a_max_arr), + (a_min_arr, a_max_arr), + (a_min_arr, 0), (a_min_arr, 5)] + for a_min, a_max in min_max: + with self.assertRaisesRegex(ValueError, msg): + cfunc(a, a_min, a_max) + + def test_conj(self): + for pyfunc in [array_conj, array_conjugate]: + cfunc = jit(nopython=True)(pyfunc) + + x = np.linspace(-10, 10) + np.testing.assert_equal(pyfunc(x), cfunc(x)) + + x, y = np.meshgrid(x, x) + z = x + 1j*y + np.testing.assert_equal(pyfunc(z), cfunc(z)) + + def test_unique(self): + pyfunc = np_unique + cfunc = jit(nopython=True)(pyfunc) + + def check(a): + np.testing.assert_equal(pyfunc(a), cfunc(a)) + + check(np.array([[1, 1, 3], [3, 4, 5]])) + check(np.array(np.zeros(5))) + check(np.array([[3.1, 3.1], [1.7, 2.29], [3.3, 1.7]])) + check(np.array([])) + + @needs_blas + def test_array_dot(self): + # just ensure that the dot impl dispatches correctly, do + # not test dot itself, this is done in test_linalg. + pyfunc = array_dot + cfunc = jit(nopython=True)(pyfunc) + a = np.arange(20.).reshape(4, 5) + b = np.arange(5.) + np.testing.assert_equal(pyfunc(a, b), cfunc(a, b)) + + # check that chaining works + pyfunc = array_dot_chain + cfunc = jit(nopython=True)(pyfunc) + a = np.arange(16.).reshape(4, 4) + np.testing.assert_equal(pyfunc(a, a), cfunc(a, a)) + + def test_array_ctor_with_dtype_arg(self): + # Test using np.dtype and np.generic (i.e. np.dtype.type) has args + pyfunc = array_ctor + cfunc = jit(nopython=True)(pyfunc) + n = 2 + args = n, np.int32 + np.testing.assert_array_equal(pyfunc(*args), cfunc(*args)) + args = n, np.dtype('int32') + np.testing.assert_array_equal(pyfunc(*args), cfunc(*args)) + args = n, np.float32 + np.testing.assert_array_equal(pyfunc(*args), cfunc(*args)) + args = n, np.dtype('f4') + np.testing.assert_array_equal(pyfunc(*args), cfunc(*args)) + +class TestArrayComparisons(TestCase): + + def test_identity(self): + def check(a, b, expected): + cfunc = njit((typeof(a), typeof(b)))(pyfunc) + self.assertPreciseEqual(cfunc(a, b), + (expected, not expected)) + + pyfunc = identity_usecase + + arr = np.zeros(10, dtype=np.int32).reshape((2, 5)) + check(arr, arr, True) + check(arr, arr[:], True) + check(arr, arr.copy(), False) + check(arr, arr.view('uint32'), False) + check(arr, arr.T, False) + check(arr, arr[:-1], False) + + # Other comparison operators ('==', etc.) are tested in test_ufuncs + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_reductions.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_reductions.py new file mode 100644 index 0000000000000000000000000000000000000000..e25fb43ce241e06c97e16e22a9fd8a51b74575bb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_reductions.py @@ -0,0 +1,1201 @@ +from itertools import product, combinations_with_replacement + +import numpy as np + +from numba import jit, njit, typeof +from numba.np.numpy_support import numpy_version +from numba.tests.support import TestCase, MemoryLeakMixin, tag, skip_if_numpy_2 +import unittest + + +def array_all(arr): + return arr.all() + +def array_all_global(arr): + return np.all(arr) + +def array_any(arr): + return arr.any() + +def array_any_global(arr): + return np.any(arr) + +def array_cumprod(arr): + return arr.cumprod() + +def array_cumprod_global(arr): + return np.cumprod(arr) + +def array_nancumprod(arr): + return np.nancumprod(arr) + +def array_cumsum(arr): + return arr.cumsum() + +def array_cumsum_global(arr): + return np.cumsum(arr) + +def array_nancumsum(arr): + return np.nancumsum(arr) + +def array_sum(arr): + return arr.sum() + +def array_sum_global(arr): + return np.sum(arr) + +def array_prod(arr): + return arr.prod() + +def array_prod_global(arr): + return np.prod(arr) + +def array_mean(arr): + return arr.mean() + +def array_mean_global(arr): + return np.mean(arr) + +def array_var(arr): + return arr.var() + +def array_var_global(arr): + return np.var(arr) + +def array_std(arr): + return arr.std() + +def array_std_global(arr): + return np.std(arr) + +def array_min(arr): + return arr.min() + +def array_min_global(arr): + return np.min(arr) + +def array_amin(arr): + return np.amin(arr) + +def array_max(arr): + return arr.max() + +def array_max_global(arr): + return np.max(arr) + +def array_amax(arr): + return np.amax(arr) + +def array_argmin(arr): + return arr.argmin() + +def array_argmin_global(arr): + return np.argmin(arr) + +def array_argmax(arr): + return arr.argmax() + +def array_argmax_global(arr): + return np.argmax(arr) + +def array_median_global(arr): + return np.median(arr) + +def array_nanmin(arr): + return np.nanmin(arr) + +def array_nanmax(arr): + return np.nanmax(arr) + +def array_nanmean(arr): + return np.nanmean(arr) + +def array_nansum(arr): + return np.nansum(arr) + +def array_nanprod(arr): + return np.nanprod(arr) + +def array_nanstd(arr): + return np.nanstd(arr) + +def array_nanvar(arr): + return np.nanvar(arr) + +def array_nanmedian_global(arr): + return np.nanmedian(arr) + +def array_percentile_global(arr, q): + return np.percentile(arr, q) + +def array_nanpercentile_global(arr, q): + return np.nanpercentile(arr, q) + +def array_ptp_global(a): + return np.ptp(a) + +def array_ptp(a): + return a.ptp() + +def array_quantile_global(arr, q): + return np.quantile(arr, q) + +def array_nanquantile_global(arr, q): + return np.nanquantile(arr, q) + +def base_test_arrays(dtype): + if dtype == np.bool_: + def factory(n): + assert n % 2 == 0 + return np.bool_([0, 1] * (n // 2)) + else: + def factory(n): + return np.arange(n, dtype=dtype) + 1 + + a1 = factory(10) + a2 = factory(10).reshape(2, 5) + # The prod() of this array fits in a 32-bit int + a3 = (factory(12))[::-1].reshape((2, 3, 2), order='A') + assert not (a3.flags.c_contiguous or a3.flags.f_contiguous) + + return [a1, a2, a3] + +def full_test_arrays(dtype): + array_list = base_test_arrays(dtype) + + # Add floats with some mantissa + if dtype == np.float32: + array_list += [a / 10 for a in array_list] + + # add imaginary part + if dtype == np.complex64: + acc = [] + for a in array_list: + tmp = a / 10 + 1j * a / 11 + tmp[::2] = np.conj(tmp[::2]) + acc.append(tmp) + array_list.extend(acc) + + for a in array_list: + assert a.dtype == np.dtype(dtype) + return array_list + +def run_comparative(compare_func, test_array): + cfunc = njit(compare_func) + numpy_result = compare_func(test_array) + numba_result = cfunc(test_array) + + return numpy_result, numba_result + + +class TestArrayReductions(MemoryLeakMixin, TestCase): + """ + Test array reduction methods and functions such as .sum(), .max(), etc. + """ + + def setUp(self): + super(TestArrayReductions, self).setUp() + np.random.seed(42) + + def check_reduction_basic(self, pyfunc, **kwargs): + # Basic reduction checks on 1-d float64 arrays + cfunc = jit(nopython=True)(pyfunc) + def check(arr): + self.assertPreciseEqual(pyfunc(arr), cfunc(arr), **kwargs) + + arr = np.float64([1.0, 2.0, 0.0, -0.0, 1.0, -1.5]) + check(arr) + arr = np.float64([-0.0, -1.5]) + check(arr) + arr = np.float64([-1.5, 2.5, 'inf']) + check(arr) + arr = np.float64([-1.5, 2.5, '-inf']) + check(arr) + arr = np.float64([-1.5, 2.5, 'inf', '-inf']) + check(arr) + arr = np.float64(['nan', -1.5, 2.5, 'nan', 3.0]) + check(arr) + arr = np.float64(['nan', -1.5, 2.5, 'nan', 'inf', '-inf', 3.0]) + check(arr) + arr = np.float64([5.0, 'nan', -1.5, 'nan']) + check(arr) + # Only NaNs + arr = np.float64(['nan', 'nan']) + check(arr) + + def test_all_basic(self, pyfunc=array_all): + cfunc = jit(nopython=True)(pyfunc) + def check(arr): + self.assertPreciseEqual(pyfunc(arr), cfunc(arr)) + + arr = np.float64([1.0, 0.0, float('inf'), float('nan')]) + check(arr) + arr[1] = -0.0 + check(arr) + arr[1] = 1.5 + check(arr) + arr = arr.reshape((2, 2)) + check(arr) + check(arr[::-1]) + + def test_any_basic(self, pyfunc=array_any): + cfunc = jit(nopython=True)(pyfunc) + def check(arr): + self.assertPreciseEqual(pyfunc(arr), cfunc(arr)) + + arr = np.float64([0.0, -0.0, 0.0, 0.0]) + check(arr) + arr[2] = float('nan') + check(arr) + arr[2] = float('inf') + check(arr) + arr[2] = 1.5 + check(arr) + arr = arr.reshape((2, 2)) + check(arr) + check(arr[::-1]) + + def test_sum_basic(self): + self.check_reduction_basic(array_sum) + + def test_mean_basic(self): + self.check_reduction_basic(array_mean) + + def test_var_basic(self): + self.check_reduction_basic(array_var, prec='double') + + def test_std_basic(self): + self.check_reduction_basic(array_std) + + def test_min_basic(self): + self.check_reduction_basic(array_min) + + def test_max_basic(self): + self.check_reduction_basic(array_max) + + def test_argmin_basic(self): + self.check_reduction_basic(array_argmin) + + def test_argmax_basic(self): + self.check_reduction_basic(array_argmax) + + def test_nanmin_basic(self): + self.check_reduction_basic(array_nanmin) + + def test_nanmax_basic(self): + self.check_reduction_basic(array_nanmax) + + def test_nanmean_basic(self): + self.check_reduction_basic(array_nanmean) + + def test_nansum_basic(self): + self.check_reduction_basic(array_nansum) + + def test_nanprod_basic(self): + self.check_reduction_basic(array_nanprod) + + def test_nanstd_basic(self): + self.check_reduction_basic(array_nanstd) + + def test_nanvar_basic(self): + self.check_reduction_basic(array_nanvar, prec='double') + + def check_median_basic(self, pyfunc, array_variations): + cfunc = jit(nopython=True)(pyfunc) + def check(arr): + expected = pyfunc(arr) + got = cfunc(arr) + self.assertPreciseEqual(got, expected) + + # Odd sizes + def check_odd(a): + check(a) + a = a.reshape((9, 7)) + check(a) + check(a.T) + for a in array_variations(np.arange(63) + 10.5): + check_odd(a) + + # Even sizes + def check_even(a): + check(a) + a = a.reshape((4, 16)) + check(a) + check(a.T) + for a in array_variations(np.arange(64) + 10.5): + check_even(a) + + @staticmethod + def _array_variations(a): + # Sorted, reversed, random, many duplicates, many NaNs, all NaNs + yield a + a = a[::-1].copy() + yield a + np.random.shuffle(a) + yield a + a[a % 4 >= 1] = 3.5 + yield a + a[a % 4 >= 2] = np.nan + yield a + a[:] = np.nan + yield a + + def test_median_basic(self): + pyfunc = array_median_global + + def variations(a): + # Sorted, reversed, random, many duplicates + yield a + a = a[::-1].copy() + yield a + np.random.shuffle(a) + yield a + a[a % 4 >= 1] = 3.5 + yield a + + self.check_median_basic(pyfunc, variations) + + def check_percentile_and_quantile(self, pyfunc, q_upper_bound): + cfunc = jit(nopython=True)(pyfunc) + + def check(a, q, abs_tol=1e-12): + expected = pyfunc(a, q) + got = cfunc(a, q) + # NOTE: inf/nan is not checked, seems to be susceptible to upstream + # changes + finite = np.isfinite(expected) + if np.all(finite): + self.assertPreciseEqual(got, expected, abs_tol=abs_tol) + else: + self.assertPreciseEqual(got[finite], expected[finite], + abs_tol=abs_tol) + + a = self.random.randn(27).reshape(3, 3, 3) + q = np.linspace(0, q_upper_bound, 14)[::-1] + check(a, q) + check(a, 0) + check(a, q_upper_bound / 2) + check(a, q_upper_bound) + + not_finite = [np.nan, -np.inf, np.inf] + a.flat[:10] = self.random.choice(not_finite, 10) + self.random.shuffle(a) + self.random.shuffle(q) + check(a, q) + + a = a.flatten().tolist() + q = q.flatten().tolist() + check(a, q) + check(tuple(a), tuple(q)) + + a = self.random.choice([1, 2, 3, 4], 10) + q = np.linspace(0, q_upper_bound, 5) + check(a, q) + + # tests inspired by + # https://github.com/numpy/numpy/blob/345b2f6e/numpy/lib/tests/test_function_base.py + x = np.arange(8) * 0.5 + np.testing.assert_equal(cfunc(x, 0), 0.) + np.testing.assert_equal(cfunc(x, q_upper_bound), 3.5) + np.testing.assert_equal(cfunc(x, q_upper_bound / 2), 1.75) + + x = np.arange(12).reshape(3, 4) + q = np.array((0.25, 0.5, 1.0)) * q_upper_bound + np.testing.assert_equal(cfunc(x, q), [2.75, 5.5, 11.0]) + + x = np.arange(3 * 4 * 5 * 6).reshape(3, 4, 5, 6) + q = np.array((0.25, 0.50)) * q_upper_bound + np.testing.assert_equal(cfunc(x, q).shape, (2,)) + + q = np.array((0.25, 0.50, 0.75)) * q_upper_bound + np.testing.assert_equal(cfunc(x, q).shape, (3,)) + + x = np.arange(12).reshape(3, 4) + np.testing.assert_equal(cfunc(x, q_upper_bound / 2), 5.5) + self.assertTrue(np.isscalar(cfunc(x, q_upper_bound / 2))) + + np.testing.assert_equal(cfunc([1, 2, 3], 0), 1) + + a = np.array([2, 3, 4, 1]) + cfunc(a, [q_upper_bound / 2]) + np.testing.assert_equal(a, np.array([2, 3, 4, 1])) + + def check_percentile_edge_cases(self, pyfunc, q_upper_bound=100): + cfunc = jit(nopython=True)(pyfunc) + + def check(a, q, abs_tol=1e-14): + expected = pyfunc(a, q) + got = cfunc(a, q) + # NOTE: inf/nan is not checked, seems to be susceptible to upstream + # changes + finite = np.isfinite(expected) + if np.all(finite): + self.assertPreciseEqual(got, expected, abs_tol=abs_tol) + else: + self.assertPreciseEqual(got[finite], expected[finite], + abs_tol=abs_tol) + + def convert_to_float_and_check(a, q, abs_tol=1e-14): + expected = pyfunc(a, q).astype(np.float64) + got = cfunc(a, q) + self.assertPreciseEqual(got, expected, abs_tol=abs_tol) + + def _array_combinations(elements): + for i in range(1, 10): + for comb in combinations_with_replacement(elements, i): + yield np.array(comb) + + # high number of combinations, many including non-finite values + q = (0, 0.1 * q_upper_bound, 0.2 * q_upper_bound, q_upper_bound) + element_pool = (1, -1, np.nan, np.inf, -np.inf) + for a in _array_combinations(element_pool): + check(a, q) + + # edge cases - numpy exhibits behavioural differences across + # platforms, see: https://github.com/numpy/numpy/issues/13272 + if q_upper_bound == 1: + _check = convert_to_float_and_check + else: + _check = check + + a = np.array(5) + q = np.array(1) + _check(a, q) + + a = 5 + q = q_upper_bound / 2 + _check(a, q) + + def check_percentile_exceptions(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + def check_err(a, q): + with self.assertRaises(ValueError) as raises: + cfunc(a, q) + self.assertEqual( + "Percentiles must be in the range [0, 100]", + str(raises.exception) + ) + + # Exceptions leak references + self.disable_leak_check() + + a = np.arange(5) + check_err(a, -5) # q less than 0 + check_err(a, (1, 10, 105)) # q contains value greater than 100 + check_err(a, (1, 10, np.nan)) # q contains nan + + with self.assertTypingError() as e: + a = np.arange(5) * 1j + q = 0.1 + cfunc(a, q) + + self.assertIn('Not supported for complex dtype', str(e.exception)) + + def check_quantile_exceptions(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + def check_err(a, q): + with self.assertRaises(ValueError) as raises: + cfunc(a, q) + self.assertEqual( + "Quantiles must be in the range [0, 1]", + str(raises.exception) + ) + + # Exceptions leak references + self.disable_leak_check() + + a = np.arange(5) + check_err(a, -0.5) # q less than 0 + check_err(a, (0.1, 0.10, 1.05)) # q contains value greater than 1 + check_err(a, (0.1, 0.10, np.nan)) # q contains nan + + with self.assertTypingError() as e: + a = np.arange(5) * 1j + q = 0.1 + cfunc(a, q) + + self.assertIn('Not supported for complex dtype', str(e.exception)) + + def test_percentile_basic(self): + pyfunc = array_percentile_global + self.check_percentile_and_quantile(pyfunc, q_upper_bound=100) + self.check_percentile_edge_cases(pyfunc, q_upper_bound=100) + self.check_percentile_exceptions(pyfunc) + + def test_nanpercentile_basic(self): + pyfunc = array_nanpercentile_global + self.check_percentile_and_quantile(pyfunc, q_upper_bound=100) + self.check_percentile_edge_cases(pyfunc, q_upper_bound=100) + self.check_percentile_exceptions(pyfunc) + + def test_quantile_basic(self): + pyfunc = array_quantile_global + self.check_percentile_and_quantile(pyfunc, q_upper_bound=1) + self.check_percentile_edge_cases(pyfunc, q_upper_bound=1) + self.check_quantile_exceptions(pyfunc) + + def test_nanquantile_basic(self): + pyfunc = array_nanquantile_global + self.check_percentile_and_quantile(pyfunc, q_upper_bound=1) + self.check_percentile_edge_cases(pyfunc, q_upper_bound=1) + self.check_quantile_exceptions(pyfunc) + + def test_nanmedian_basic(self): + pyfunc = array_nanmedian_global + self.check_median_basic(pyfunc, self._array_variations) + + def test_array_sum_global(self): + arr = np.arange(10, dtype=np.int32) + arrty = typeof(arr) + self.assertEqual(arrty.ndim, 1) + self.assertEqual(arrty.layout, 'C') + + cfunc = njit((arrty,),)(array_sum_global) + self.assertEqual(np.sum(arr), cfunc(arr)) + + def test_array_prod_int_1d(self): + arr = np.arange(10, dtype=np.int32) + 1 + arrty = typeof(arr) + self.assertEqual(arrty.ndim, 1) + self.assertEqual(arrty.layout, 'C') + + cfunc = njit((arrty,))(array_prod) + self.assertEqual(arr.prod(), cfunc(arr)) + + def test_array_prod_float_1d(self): + arr = np.arange(10, dtype=np.float32) + 1 / 10 + arrty = typeof(arr) + self.assertEqual(arrty.ndim, 1) + self.assertEqual(arrty.layout, 'C') + + cfunc = njit((arrty,))(array_prod) + np.testing.assert_allclose(arr.prod(), cfunc(arr)) + + def test_array_prod_global(self): + arr = np.arange(10, dtype=np.int32) + arrty = typeof(arr) + self.assertEqual(arrty.ndim, 1) + self.assertEqual(arrty.layout, 'C') + + cfunc = njit((arrty,))(array_prod_global) + np.testing.assert_allclose(np.prod(arr), cfunc(arr)) + + def check_cumulative(self, pyfunc): + arr = np.arange(2, 10, dtype=np.int16) + expected, got = run_comparative(pyfunc, arr) + self.assertPreciseEqual(got, expected) + arr = np.linspace(2, 8, 6) + expected, got = run_comparative(pyfunc, arr) + self.assertPreciseEqual(got, expected) + arr = arr.reshape((3, 2)) + expected, got = run_comparative(pyfunc, arr) + self.assertPreciseEqual(got, expected) + + def test_array_cumsum(self): + self.check_cumulative(array_cumsum) + + def test_array_cumsum_global(self): + self.check_cumulative(array_cumsum_global) + + def test_array_cumprod(self): + self.check_cumulative(array_cumprod) + + def test_array_cumprod_global(self): + self.check_cumulative(array_cumprod_global) + + def check_aggregation_magnitude(self, pyfunc, is_prod=False): + """ + Check that integer overflows are avoided (issue #931). + """ + # Overflows are avoided here (ints are cast either to intp + # or float64). + n_items = 2 if is_prod else 10 # avoid overflow on prod() + arr = (np.arange(n_items) + 40000).astype('int16') + npr, nbr = run_comparative(pyfunc, arr) + self.assertPreciseEqual(npr, nbr) + # Overflows are avoided for functions returning floats here. + # Other functions may wrap around. + arr = (np.arange(10) + 2**60).astype('int64') + npr, nbr = run_comparative(pyfunc, arr) + self.assertPreciseEqual(npr, nbr) + arr = arr.astype('uint64') + npr, nbr = run_comparative(pyfunc, arr) + self.assertPreciseEqual(npr, nbr) + + def test_sum_magnitude(self): + self.check_aggregation_magnitude(array_sum) + self.check_aggregation_magnitude(array_sum_global) + + def test_cumsum_magnitude(self): + self.check_aggregation_magnitude(array_cumsum) + self.check_aggregation_magnitude(array_cumsum_global) + + def test_nancumsum_magnitude(self): + self.check_aggregation_magnitude(array_nancumsum, is_prod=True) + + def test_prod_magnitude(self): + self.check_aggregation_magnitude(array_prod, is_prod=True) + self.check_aggregation_magnitude(array_prod_global, is_prod=True) + + def test_cumprod_magnitude(self): + self.check_aggregation_magnitude(array_cumprod, is_prod=True) + self.check_aggregation_magnitude(array_cumprod_global, is_prod=True) + + def test_nancumprod_magnitude(self): + self.check_aggregation_magnitude(array_nancumprod, is_prod=True) + + def test_mean_magnitude(self): + self.check_aggregation_magnitude(array_mean) + self.check_aggregation_magnitude(array_mean_global) + + def test_var_magnitude(self): + self.check_aggregation_magnitude(array_var) + self.check_aggregation_magnitude(array_var_global) + + def test_std_magnitude(self): + self.check_aggregation_magnitude(array_std) + self.check_aggregation_magnitude(array_std_global) + + def _do_check_nptimedelta(self, pyfunc, arr): + arrty = typeof(arr) + cfunc = jit(nopython=True)(pyfunc) + + self.assertPreciseEqual(cfunc(arr), pyfunc(arr)) + # Even vs. odd size, for np.median + self.assertPreciseEqual(cfunc(arr[:-1]), pyfunc(arr[:-1])) + # Test with different orders, for np.median + arr = arr[::-1].copy() # Keep 'C' layout + self.assertPreciseEqual(cfunc(arr), pyfunc(arr)) + np.random.shuffle(arr) + self.assertPreciseEqual(cfunc(arr), pyfunc(arr)) + # Test with a NaT + if 'median' not in pyfunc.__name__: + # Test with (val, NaT)^N (and with the random NaT from above) + # use a loop, there's some weird thing/bug with arr[1::2] = 'NaT' + + # Further Numba has bug(s) relating to NaN/NaT handling in anything + # using a partition such as np.median + for x in range(1, len(arr), 2): + arr[x] = 'NaT' + self.assertPreciseEqual(cfunc(arr), pyfunc(arr)) + # Test with all NaTs + arr.fill(arrty.dtype('NaT')) + self.assertPreciseEqual(cfunc(arr), pyfunc(arr)) + + def check_npdatetime(self, pyfunc): + arr = np.arange(10).astype(dtype='M8[Y]') + self._do_check_nptimedelta(pyfunc, arr) + + def check_nptimedelta(self, pyfunc): + arr = np.arange(10).astype(dtype='m8[s]') + self._do_check_nptimedelta(pyfunc, arr) + + def test_min_npdatetime(self): + self.check_npdatetime(array_min) + self.check_nptimedelta(array_min) + + def test_max_npdatetime(self): + self.check_npdatetime(array_max) + self.check_nptimedelta(array_max) + + def test_argmin_npdatetime(self): + self.check_npdatetime(array_argmin) + self.check_nptimedelta(array_argmin) + + def test_argmax_npdatetime(self): + self.check_npdatetime(array_argmax) + self.check_nptimedelta(array_argmax) + + def test_median_npdatetime(self): + self.check_nptimedelta(array_median_global) + + def test_sum_npdatetime(self): + self.check_nptimedelta(array_sum) + + def test_cumsum_npdatetime(self): + self.check_nptimedelta(array_cumsum) + + def test_mean_npdatetime(self): + self.check_nptimedelta(array_mean) + + def check_nan_cumulative(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + def check(a): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + def _set_some_values_to_nan(a): + p = a.size // 2 # set approx half elements to NaN + np.put(a, np.random.choice(range(a.size), p, replace=False), np.nan) + return a + + def a_variations(): + yield np.linspace(-1, 3, 60).reshape(3, 4, 5) + yield np.array([np.inf, 3, 4]) + yield np.array([True, True, True, False]) + yield np.arange(1, 10) + yield np.asfortranarray(np.arange(1, 64) - 33.3) + yield np.arange(1, 10, dtype=np.float32)[::-1] + + for a in a_variations(): + check(a) # no nans + check(_set_some_values_to_nan(a.astype(np.float64))) # about 50% nans + + # edge cases + check(np.array([])) + check(np.full(10, np.nan)) + + parts = np.array([np.nan, 2, np.nan, 4, 5, 6, 7, 8, 9]) + + a = parts + 1j * parts[::-1] + a = a.reshape(3, 3) + check(a) + + def test_nancumprod_basic(self): + self.check_cumulative(array_nancumprod) + self.check_nan_cumulative(array_nancumprod) + + def test_nancumsum_basic(self): + self.check_cumulative(array_nancumsum) + self.check_nan_cumulative(array_nancumsum) + + def test_ptp_basic(self): + pyfunc = array_ptp_global + cfunc = jit(nopython=True)(pyfunc) + + def check(a): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + def a_variations(): + yield np.arange(10) + yield np.array([-1.1, np.nan, 2.2]) + yield np.array([-np.inf, 5]) + yield (4, 2, 5) + yield (1,) + yield np.full(5, 5) + yield [2.2, -2.3, 0.1] + a = np.linspace(-10, 10, 16).reshape(4, 2, 2) + yield a + yield np.asfortranarray(a) + yield a[::-1] + np.random.RandomState(0).shuffle(a) + yield a + yield 6 + yield 6.5 + yield -np.inf + yield 1 + 4j + yield [2.2, np.nan] + yield [2.2, np.inf] + yield ((4.1, 2.0, -7.6), (4.3, 2.7, 5.2)) + yield np.full(5, np.nan) + yield 1 + np.nan * 1j + yield np.nan + np.nan * 1j + yield np.nan + + for a in a_variations(): + check(a) + + @skip_if_numpy_2 + def test_ptp_method(self): + # checks wiring of np.ndarray.ptp() only, `np.ptp` test above checks + # the actual alg + pyfunc = array_ptp + cfunc = jit(nopython=True)(pyfunc) + + a = np.arange(10) + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + def test_ptp_complex(self): + pyfunc = array_ptp_global + cfunc = jit(nopython=True)(pyfunc) + + def check(a): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + def make_array(real_nan=False, imag_nan=False): + real = np.linspace(-4, 4, 25) + if real_nan: + real[4:9] = np.nan + imag = np.linspace(-5, 5, 25) + if imag_nan: + imag[7:12] = np.nan + return (real + 1j * imag).reshape(5, 5) + + for real_nan, imag_nan in product([True, False], repeat=2): + comp = make_array(real_nan, imag_nan) + check(comp) + + real = np.ones(8) + imag = np.arange(-4, 4) + comp = real + 1j * imag + check(comp) + comp = real - 1j * imag + check(comp) + + comp = np.full((4, 4), fill_value=(1 - 1j)) + check(comp) + + def test_ptp_exceptions(self): + pyfunc = array_ptp_global + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertTypingError() as e: + cfunc(np.array((True, True, False))) + + msg = "Boolean dtype is unsupported (as per NumPy)" + self.assertIn(msg, str(e.exception)) + + with self.assertRaises(ValueError) as e: + cfunc(np.array([])) + + msg = "zero-size array reduction not possible" + self.assertIn(msg, str(e.exception)) + + def test_min_max_complex_basic(self): + pyfuncs = array_min_global, array_max_global + + for pyfunc in pyfuncs: + cfunc = jit(nopython=True)(pyfunc) + + def check(a): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + real = np.linspace(-10, 10, 40) + real[:4] = real[-1] + imag = real * 2 + a = real - imag * 1j + check(a) + + for _ in range(10): + self.random.shuffle(real) + self.random.shuffle(imag) + dtype = self.random.choice([np.complex64, np.complex128]) + a = real - imag * 1j + a[:4] = a[-1] + check(a.astype(dtype)) + + def test_nanmin_nanmax_complex_basic(self): + pyfuncs = array_nanmin, array_nanmax + + for pyfunc in pyfuncs: + cfunc = jit(nopython=True)(pyfunc) + + def check(a): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + real = np.linspace(-10, 10, 40) + real[:4] = real[-1] + real[5:9] = np.nan + imag = real * 2 + imag[7:12] = np.nan + a = real - imag * 1j + check(a) + + for _ in range(10): + self.random.shuffle(real) + self.random.shuffle(imag) + a = real - imag * 1j + a[:4] = a[-1] + check(a) + + def test_nanmin_nanmax_non_array_inputs(self): + pyfuncs = array_nanmin, array_nanmax + + def check(a): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + def a_variations(): + yield [1, 6, 4, 2] + yield ((-10, 4, -12), (5, 200, -30)) + yield np.array(3) + yield (2,) + yield 3.142 + yield False + yield (np.nan, 3.142, -5.2, 3.0) + yield [np.inf, np.nan, -np.inf] + yield [(np.nan, 1.1), (-4.4, 8.7)] + + for pyfunc in pyfuncs: + cfunc = jit(nopython=True)(pyfunc) + + for a in a_variations(): + check(a) + + def test_argmax_axis_1d_2d_4d(self): + arr1d = np.array([0, 20, 3, 4]) + arr2d = np.arange(6).reshape(2, 3) + arr2d[0,1] += 100 + + arr4d = np.arange(120).reshape(2, 3, 4, 5) + 10 + arr4d[0, 1, 1, 2] += 100 + arr4d[1, 0, 0, 0] -= 51 + + for arr in [arr1d, arr2d, arr4d]: + axes = list(range(arr.ndim)) + [ + -(i+1) for i in range(arr.ndim) + ] + py_functions = [ + lambda a, _axis=axis: np.argmax(a, axis=_axis) + for axis in axes + ] + c_functions = [ + jit(nopython=True)(pyfunc) for pyfunc in py_functions + ] + for cfunc in c_functions: + self.assertPreciseEqual(cfunc.py_func(arr), cfunc(arr)) + + def test_argmax_axis_out_of_range(self): + arr1d = np.arange(6) + arr2d = np.arange(6).reshape(2, 3) + + @jit(nopython=True) + def jitargmax(arr, axis): + return np.argmax(arr, axis) + + def assert_raises(arr, axis): + with self.assertRaisesRegex(ValueError, "axis.*out of bounds"): + jitargmax.py_func(arr, axis) + with self.assertRaisesRegex(ValueError, "axis.*out of bounds"): + jitargmax(arr, axis) + + assert_raises(arr1d, 1) + assert_raises(arr1d, -2) + assert_raises(arr2d, -3) + assert_raises(arr2d, 2) + # Exceptions leak references + self.disable_leak_check() + + def test_argmax_axis_must_be_integer(self): + arr = np.arange(6) + + @jit(nopython=True) + def jitargmax(arr, axis): + return np.argmax(arr, axis) + + with self.assertTypingError() as e: + jitargmax(arr, "foo") + self.assertIn("axis must be an integer", str(e.exception)) + + def test_argmax_method_axis(self): + arr2d = np.arange(6).reshape(2, 3) + + def argmax(arr): + return arr2d.argmax(axis=0) + + self.assertPreciseEqual(argmax(arr2d), + jit(nopython=True)(argmax)(arr2d)) + + def test_argmax_return_type(self): + # See issue #7853, return type should be intp not based on input type + arr2d = np.arange(6, dtype=np.uint8).reshape(2, 3) + + def argmax(arr): + return arr2d.argmax(axis=0) + + self.assertPreciseEqual(argmax(arr2d), + jit(nopython=True)(argmax)(arr2d)) + + def test_argmin_axis_1d_2d_4d(self): + arr1d = np.array([0, 20, 3, 4]) + arr2d = np.arange(6).reshape(2, 3) + arr2d[0,1] += 100 + + arr4d = np.arange(120).reshape(2, 3, 4, 5) + 10 + arr4d[0, 1, 1, 2] += 100 + arr4d[1, 0, 0, 0] -= 51 + + for arr in [arr1d, arr2d, arr4d]: + axes = list(range(arr.ndim)) + [ + -(i+1) for i in range(arr.ndim) + ] + py_functions = [ + lambda a, _axis=axis: np.argmin(a, axis=_axis) + for axis in axes + ] + c_functions = [ + jit(nopython=True)(pyfunc) for pyfunc in py_functions + ] + for cfunc in c_functions: + self.assertPreciseEqual(cfunc.py_func(arr), cfunc(arr)) + + def test_argmin_axis_out_of_range(self): + arr1d = np.arange(6) + arr2d = np.arange(6).reshape(2, 3) + + @jit(nopython=True) + def jitargmin(arr, axis): + return np.argmin(arr, axis) + + def assert_raises(arr, axis): + with self.assertRaisesRegex(ValueError, "axis.*out of bounds"): + jitargmin.py_func(arr, axis) + with self.assertRaisesRegex(ValueError, "axis.*out of bounds"): + jitargmin(arr, axis) + + assert_raises(arr1d, 1) + assert_raises(arr1d, -2) + assert_raises(arr2d, -3) + assert_raises(arr2d, 2) + + # Exceptions leak references + self.disable_leak_check() + + def test_argmin_axis_must_be_integer(self): + arr = np.arange(6) + + @jit(nopython=True) + def jitargmin(arr, axis): + return np.argmin(arr, axis) + + with self.assertTypingError() as e: + jitargmin(arr, "foo") + self.assertIn("axis must be an integer", str(e.exception)) + + def test_argmin_method_axis(self): + arr2d = np.arange(6).reshape(2, 3) + + def argmin(arr): + return arr2d.argmin(axis=0) + + self.assertPreciseEqual(argmin(arr2d), + jit(nopython=True)(argmin)(arr2d)) + + def test_argmin_return_type(self): + # See issue #7853, return type should be intp not based on input type + arr2d = np.arange(6, dtype=np.uint8).reshape(2, 3) + + def argmin(arr): + return arr2d.argmin(axis=0) + + self.assertPreciseEqual(argmin(arr2d), + jit(nopython=True)(argmin)(arr2d)) + + @classmethod + def install_generated_tests(cls): + # These form a testing product where each of the combinations are tested + + # these function are tested in real and complex space + reduction_funcs = [array_sum, array_sum_global, + array_prod, array_prod_global, + array_mean, array_mean_global, + array_var, array_var_global, + array_std, array_std_global, + array_all, array_all_global, + array_any, array_any_global, + array_min, array_min_global, + array_amax, array_amin, + array_max, array_max_global, + array_nanmax, array_nanmin, + array_nansum, + ] + + # these functions only work in real space as no complex comparison + # operator is implemented + reduction_funcs_rspace = [array_argmin, array_argmin_global, + array_argmax, array_argmax_global] + + reduction_funcs += [array_nanmean, array_nanstd, array_nanvar] + reduction_funcs += [array_nanprod] + + dtypes_to_test = [np.int32, np.float32, np.bool_, np.complex64] + + def install_tests(dtypes, funcs): + # Install tests on class + for dt in dtypes: + test_arrays = full_test_arrays(dt) + for red_func, test_array in product(funcs, test_arrays): + # Create the name for the test function + test_name = "test_{0}_{1}_{2}d" + test_name = test_name.format(red_func.__name__, + test_array.dtype.name, + test_array.ndim) + + def new_test_function(self, redFunc=red_func, + testArray=test_array, + testName=test_name): + ulps = 1 + if 'prod' in red_func.__name__ and \ + np.iscomplexobj(testArray): + # prod family accumulate slightly more error on + # some architectures (power, 32bit) for complex input + ulps = 3 + npr, nbr = run_comparative(redFunc, testArray) + self.assertPreciseEqual(npr, nbr, msg=testName, + prec="single", ulps=ulps) + + # Install it into the class + setattr(cls, test_name, new_test_function) + + # install tests for reduction functions that only work in real space + install_tests(dtypes_to_test[:-1], reduction_funcs_rspace) + + # install tests for reduction functions + install_tests(dtypes_to_test, reduction_funcs) + + +TestArrayReductions.install_generated_tests() + + +class TestArrayReductionsExceptions(MemoryLeakMixin, TestCase): + + # int64, size 0 + zero_size = np.arange(0) + + def check_exception(self, pyfunc, msg): + cfunc = jit(nopython=True)(pyfunc) + # make sure NumPy raises consistently/no behaviour change + with self.assertRaises(BaseException): + pyfunc(self.zero_size) + # check numba impl raises expected + with self.assertRaises(ValueError) as e: + cfunc(self.zero_size) + self.assertIn(msg, str(e.exception)) + + @classmethod + def install(cls): + + fn_to_msg = dict() + empty_seq = "attempt to get {0} of an empty sequence" + op_no_ident = ("zero-size array to reduction operation " + "{0}") + for x in [array_argmax, array_argmax_global, array_argmin, + array_argmin_global]: + fn_to_msg[x] = empty_seq + for x in [array_max, array_max, array_min, array_min]: + fn_to_msg[x] = op_no_ident + + name_template = "test_zero_size_array_{0}" + for fn, msg in fn_to_msg.items(): + test_name = name_template.format(fn.__name__) + + lmsg = msg.format(fn.__name__) + lmsg = lmsg.replace('array_','').replace('_global','') + def test_fn(self, func=fn, message=lmsg): + self.check_exception(func, message) + + setattr(cls, test_name, test_fn) + +TestArrayReductionsExceptions.install() + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_return.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_return.py new file mode 100644 index 0000000000000000000000000000000000000000..bab7160404ca27a0160880268610f84f66a71a9f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_array_return.py @@ -0,0 +1,38 @@ +import numpy as np + +from numba import typeof, njit +from numba.tests.support import MemoryLeakMixin +import unittest + + +def array_return(a, i): + a[i] = 123 + return a + + +def array_return_start_with_loop(a): + for i in range(a.size): + a[i] += 1 + return a + + +class TestArrayReturn(MemoryLeakMixin, unittest.TestCase): + def test_array_return(self): + a = np.arange(10) + i = 2 + at, it = typeof(a), typeof(i) + cfunc = njit((at, it))(array_return) + self.assertIs(a, cfunc(a, i)) + + def test_array_return_start_with_loop(self): + """ + A bug breaks array return if the function starts with a loop + """ + a = np.arange(10) + at = typeof(a) + cfunc = njit((at,))(array_return_start_with_loop) + self.assertIs(a, cfunc(a)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_asnumbatype.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_asnumbatype.py new file mode 100644 index 0000000000000000000000000000000000000000..8684874608ee3c4ec0eb1fcbe0e6a16ce09cee5c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_asnumbatype.py @@ -0,0 +1,170 @@ +""" +Tests for the as_numba_type() machinery. +""" +import typing as py_typing + + +import unittest + +from numba.core import types +from numba.core.errors import TypingError +from numba.core.typing.typeof import typeof +from numba.core.typing.asnumbatype import as_numba_type, AsNumbaTypeRegistry +from numba.experimental.jitclass import jitclass +from numba.tests.support import TestCase + + +class TestAsNumbaType(TestCase): + + int_nb_type = typeof(0) + float_nb_type = typeof(0.0) + complex_nb_type = typeof(complex(0)) + str_nb_type = typeof("numba") + bool_nb_type = typeof(True) + none_nb_type = typeof(None) + + def test_simple_types(self): + self.assertEqual(as_numba_type(int), self.int_nb_type) + self.assertEqual(as_numba_type(float), self.float_nb_type) + self.assertEqual(as_numba_type(complex), self.complex_nb_type) + self.assertEqual(as_numba_type(str), self.str_nb_type) + self.assertEqual(as_numba_type(bool), self.bool_nb_type) + self.assertEqual(as_numba_type(type(None)), self.none_nb_type) + + def test_numba_types(self): + numba_types = [ + types.intp, + types.boolean, + types.ListType(types.float64), + types.DictType( + types.intp, types.Tuple([types.float32, types.float32]) + ), + ] + + for ty in numba_types: + self.assertEqual(as_numba_type(ty), ty) + + def test_single_containers(self): + self.assertEqual( + as_numba_type(py_typing.List[float]), + types.ListType(self.float_nb_type), + ) + self.assertEqual( + as_numba_type(py_typing.Dict[float, str]), + types.DictType(self.float_nb_type, self.str_nb_type), + ) + self.assertEqual( + as_numba_type(py_typing.Set[complex]), + types.Set(self.complex_nb_type), + ) + self.assertEqual( + as_numba_type(py_typing.Tuple[float, float]), + types.Tuple([self.float_nb_type, self.float_nb_type]), + ) + self.assertEqual( + as_numba_type(py_typing.Tuple[float, complex]), + types.Tuple([self.float_nb_type, self.complex_nb_type]), + ) + + def test_optional(self): + self.assertEqual( + as_numba_type(py_typing.Optional[float]), + types.Optional(self.float_nb_type), + ) + self.assertEqual( + as_numba_type(py_typing.Union[str, None]), + types.Optional(self.str_nb_type), + ) + self.assertEqual( + as_numba_type(py_typing.Union[None, bool]), + types.Optional(self.bool_nb_type), + ) + + # Optional[x] is a special case of Union[x, None]. We raise a + # TypingError if the right type is not NoneType. + with self.assertRaises(TypingError) as raises: + as_numba_type(py_typing.Union[int, float]) + self.assertIn("Cannot type Union that is not an Optional", + str(raises.exception)) + + def test_nested_containers(self): + IntList = py_typing.List[int] + self.assertEqual( + as_numba_type(py_typing.List[IntList]), + types.ListType(types.ListType(self.int_nb_type)), + ) + self.assertEqual( + as_numba_type(py_typing.List[py_typing.Dict[float, bool]]), + types.ListType( + types.DictType(self.float_nb_type, self.bool_nb_type) + ), + ) + self.assertEqual( + as_numba_type( + py_typing.Set[py_typing.Tuple[py_typing.Optional[int], float]]), + types.Set(types.Tuple( + [types.Optional(self.int_nb_type), self.float_nb_type])), + ) + + def test_jitclass_registers(self): + + @jitclass + class MyInt: + x: int + + def __init__(self, value): + self.x = value + + self.assertEqual(as_numba_type(MyInt), MyInt.class_type.instance_type) + + def test_type_alias(self): + Pair = py_typing.Tuple[int, int] + ListOfPairs = py_typing.List[Pair] + + pair_nb_type = types.Tuple((self.int_nb_type, self.int_nb_type)) + self.assertEqual(as_numba_type(Pair), pair_nb_type) + self.assertEqual( + as_numba_type(ListOfPairs), types.ListType(pair_nb_type) + ) + + def test_overwrite_type(self): + as_numba_type = AsNumbaTypeRegistry() + self.assertEqual(as_numba_type(float), self.float_nb_type) + as_numba_type.register(float, types.float32) + self.assertEqual(as_numba_type(float), types.float32) + self.assertNotEqual(as_numba_type(float), self.float_nb_type) + + def test_any_throws(self): + Any = py_typing.Any + + any_types = [ + py_typing.Optional[Any], + py_typing.List[Any], + py_typing.Set[Any], + py_typing.Dict[float, Any], + py_typing.Dict[Any, float], + py_typing.Tuple[int, Any], + ] + + for bad_py_type in any_types: + with self.assertRaises(TypingError) as raises: + as_numba_type(bad_py_type) + self.assertIn( + "Cannot infer numba type of python type", + str(raises.exception), + ) + + def test_bad_union_throws(self): + bad_unions = [ + py_typing.Union[str, int], + py_typing.Union[int, type(None), py_typing.Tuple[bool, bool]], + ] + + for bad_py_type in bad_unions: + with self.assertRaises(TypingError) as raises: + as_numba_type(bad_py_type) + self.assertIn("Cannot type Union", str(raises.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_auto_constants.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_auto_constants.py new file mode 100644 index 0000000000000000000000000000000000000000..e58c8a1947be711b32e6369002e992ca66d839f5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_auto_constants.py @@ -0,0 +1,38 @@ +import math +import sys + +import numpy as np + +from numba import njit +import numba.tests.usecases as uc +import unittest + + +class TestAutoConstants(unittest.TestCase): + def test_numpy_nan(self): + + @njit + def f(): + return np.nan + + self.assertTrue(math.isnan(f())) + self.assertTrue(math.isnan(f.py_func())) + + def test_sys_constant(self): + + @njit + def f(): + return sys.hexversion + + self.assertEqual(f(), f.py_func()) + + def test_module_string_constant(self): + + @njit + def f(): + return uc._GLOBAL_STR + self.assertEqual(f(), f.py_func()) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_blackscholes.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_blackscholes.py new file mode 100644 index 0000000000000000000000000000000000000000..d12846117ff793d4af3fd833187849747bf44663 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_blackscholes.py @@ -0,0 +1,125 @@ +import math + +import numpy as np + +import unittest +from numba import njit +from numba.extending import register_jitable +from numba.tests.support import TestCase + + +RISKFREE = 0.02 +VOLATILITY = 0.30 + + +A1 = 0.31938153 +A2 = -0.356563782 +A3 = 1.781477937 +A4 = -1.821255978 +A5 = 1.330274429 +RSQRT2PI = 0.39894228040143267793994605993438 + + +@register_jitable +def cnd_array(d): + K = 1.0 / (1.0 + 0.2316419 * np.abs(d)) + ret_val = (RSQRT2PI * np.exp(-0.5 * d * d) * + (K * (A1 + K * (A2 + K * (A3 + K * (A4 + K * A5)))))) + return np.where(d > 0, 1.0 - ret_val, ret_val) + + +@register_jitable +def cnd(d): + K = 1.0 / (1.0 + 0.2316419 * math.fabs(d)) + ret_val = (RSQRT2PI * math.exp(-0.5 * d * d) * + (K * (A1 + K * (A2 + K * (A3 + K * (A4 + K * A5)))))) + if d > 0: + ret_val = 1.0 - ret_val + return ret_val + + +@njit +def blackscholes_arrayexpr(stockPrice, optionStrike, optionYears, Riskfree, + Volatility): + S = stockPrice + X = optionStrike + T = optionYears + R = Riskfree + V = Volatility + sqrtT = np.sqrt(T) + d1 = (np.log(S / X) + (R + 0.5 * V * V) * T) / (V * sqrtT) + d2 = d1 - V * sqrtT + cndd1 = cnd_array(d1) + cndd2 = cnd_array(d2) + + expRT = np.exp(- R * T) + + callResult = (S * cndd1 - X * expRT * cndd2) + putResult = (X * expRT * (1.0 - cndd2) - S * (1.0 - cndd1)) + return callResult, putResult + + +@njit +def blackscholes_scalar(callResult, putResult, stockPrice, optionStrike, + optionYears, Riskfree, Volatility): + S = stockPrice + X = optionStrike + T = optionYears + R = Riskfree + V = Volatility + for i in range(len(S)): + sqrtT = math.sqrt(T[i]) + d1 = (math.log(S[i] / X[i]) + (R + 0.5 * V * V) * T[i]) / (V * sqrtT) + d2 = d1 - V * sqrtT + cndd1 = cnd(d1) + cndd2 = cnd(d2) + + expRT = math.exp((-1. * R) * T[i]) + callResult[i] = (S[i] * cndd1 - X[i] * expRT * cndd2) + putResult[i] = (X[i] * expRT * (1.0 - cndd2) - S[i] * (1.0 - cndd1)) + + +def randfloat(rand_var, low, high): + return (1.0 - rand_var) * low + rand_var * high + + +class TestBlackScholes(TestCase): + def test_array_expr(self): + OPT_N = 400 + + stockPrice = randfloat(self.random.random_sample(OPT_N), 5.0, 30.0) + optionStrike = randfloat(self.random.random_sample(OPT_N), 1.0, 100.0) + optionYears = randfloat(self.random.random_sample(OPT_N), 0.25, 10.0) + + args = stockPrice, optionStrike, optionYears, RISKFREE, VOLATILITY + + callResultGold, putResultGold = blackscholes_arrayexpr.py_func(*args) + callResultNumba, putResultNumba = blackscholes_arrayexpr(*args) + + delta = np.abs(callResultGold - callResultNumba) + self.assertAlmostEqual(delta.max(), 0) + + def test_scalar(self): + OPT_N = 400 + + callResultGold = np.zeros(OPT_N) + putResultGold = np.zeros(OPT_N) + + callResultNumba = np.zeros(OPT_N) + putResultNumba = np.zeros(OPT_N) + + stockPrice = randfloat(self.random.random_sample(OPT_N), 5.0, 30.0) + optionStrike = randfloat(self.random.random_sample(OPT_N), 1.0, 100.0) + optionYears = randfloat(self.random.random_sample(OPT_N), 0.25, 10.0) + + args = stockPrice, optionStrike, optionYears, RISKFREE, VOLATILITY + + blackscholes_scalar.py_func(callResultGold, putResultGold, *args) + blackscholes_scalar(callResultNumba, putResultNumba, *args) + + delta = np.abs(callResultGold - callResultNumba) + self.assertAlmostEqual(delta.max(), 0) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_boundscheck.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_boundscheck.py new file mode 100644 index 0000000000000000000000000000000000000000..f6f904298d95106d0d6d796764168d049ee74d22 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_boundscheck.py @@ -0,0 +1,268 @@ +import numpy as np + +from numba.cuda.testing import SerialMixin +from numba import typeof, cuda, njit +from numba.core.types import float64 +from numba.tests.support import TestCase, MemoryLeakMixin +from numba.core import config +import unittest + + +def basic_array_access(a): + return a[10] + + +def slice_array_access(a): + # The first index (slice) is not bounds checked + return a[10:, 10] + + +def fancy_array_access(x): + a = np.array([1, 2, 3]) + return x[a] + + +def fancy_array_modify(x): + a = np.array([1, 2, 3]) + x[a] = 0 + return x + + +class TestBoundsCheckNoError(MemoryLeakMixin, TestCase): + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': ''}) + def test_basic_array_boundscheck(self): + self.assertIsNone(config.BOUNDSCHECK) + + a = np.arange(5) + # Check the numpy behavior to make sure the test is correct + with self.assertRaises(IndexError): + # TODO: When we raise the same error message as numpy, test that + # they are the same + basic_array_access(a) + + at = typeof(a) + noboundscheck = njit((at,))(basic_array_access) + # Check that the default flag doesn't raise + noboundscheck(a) + # boundscheck(a) is tested in TestBoundsCheckError below + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': ''}) + def test_slice_array_boundscheck(self): + self.assertIsNone(config.BOUNDSCHECK) + + a = np.ones((5, 5)) + b = np.ones((5, 20)) + with self.assertRaises(IndexError): + # TODO: When we raise the same error message as numpy, test that + # they are the same + slice_array_access(a) + # Out of bounds on a slice doesn't raise + slice_array_access(b) + + at = typeof(a) + rt = float64[:] + noboundscheck = njit(rt(at))(slice_array_access) + boundscheck = njit(rt(at), boundscheck=True)(slice_array_access) + # Check that the default flag doesn't raise + noboundscheck(a) + noboundscheck(b) + # boundscheck(a) is tested in TestBoundsCheckError below + + # Doesn't raise + boundscheck(b) + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': ''}) + def test_fancy_indexing_boundscheck(self): + self.assertIsNone(config.BOUNDSCHECK) + + a = np.arange(3) + b = np.arange(4) + + # Check the numpy behavior to ensure the test is correct. + with self.assertRaises(IndexError): + # TODO: When we raise the same error message as numpy, test that + # they are the same + fancy_array_access(a) + fancy_array_access(b) + + at = typeof(a) + rt = at.dtype[:] + noboundscheck = njit(rt(at))(fancy_array_access) + boundscheck = njit(rt(at), boundscheck=True)(fancy_array_access) + # Check that the default flag doesn't raise + noboundscheck(a) + noboundscheck(b) + # boundscheck(a) is tested in TestBoundsCheckError below + + # Doesn't raise + boundscheck(b) + + +class TestNoCudaBoundsCheck(SerialMixin, TestCase): + @unittest.skipIf(not cuda.is_available(), "NO CUDA") + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': '1'}) + def test_no_cuda_boundscheck(self): + self.assertTrue(config.BOUNDSCHECK) + with self.assertRaises(NotImplementedError): + @cuda.jit(boundscheck=True) + def func(): + pass + + # Make sure we aren't raising "not supported" error if we aren't + # requesting bounds checking anyway. Related pull request: #5257 + @cuda.jit(boundscheck=False) + def func3(): + pass + + @cuda.jit + def func2(x, a): + a[1] = x[1] + + a = np.ones((1,)) + x = np.zeros((1,)) + # Out of bounds but doesn't raise (it does raise in the simulator, + # so skip there) + if not config.ENABLE_CUDASIM: + func2[1, 1](x, a) + + +# This is a separate test because the jitted functions that raise exceptions +# have memory leaks. +class TestBoundsCheckError(TestCase): + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': ''}) + def test_basic_array_boundscheck(self): + self.assertIsNone(config.BOUNDSCHECK) + + a = np.arange(5) + # Check the numpy behavior to make sure the test is correct + with self.assertRaises(IndexError): + # TODO: When we raise the same error message as numpy, test that + # they are the same + basic_array_access(a) + + at = typeof(a) + boundscheck = njit((at,), boundscheck=True)(basic_array_access) + + with self.assertRaises(IndexError): + boundscheck(a) + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': ''}) + def test_slice_array_boundscheck(self): + self.assertIsNone(config.BOUNDSCHECK) + + a = np.ones((5, 5)) + b = np.ones((5, 20)) + with self.assertRaises(IndexError): + # TODO: When we raise the same error message as numpy, test that + # they are the same + slice_array_access(a) + # Out of bounds on a slice doesn't raise + slice_array_access(b) + + at = typeof(a) + rt = float64[:] + boundscheck = njit(rt(at), boundscheck=True)(slice_array_access) + + with self.assertRaises(IndexError): + boundscheck(a) + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': ''}) + def test_fancy_indexing_boundscheck(self): + self.assertIsNone(config.BOUNDSCHECK) + + a = np.arange(3) + b = np.arange(4) + + # Check the numpy behavior to ensure the test is correct. + with self.assertRaises(IndexError): + # TODO: When we raise the same error message as numpy, test that + # they are the same + fancy_array_access(a) + fancy_array_access(b) + + at = typeof(a) + rt = at.dtype[:] + boundscheck = njit(rt(at), boundscheck=True)(fancy_array_access) + + with self.assertRaises(IndexError): + boundscheck(a) + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': ''}) + def test_fancy_indexing_with_modification_boundscheck(self): + self.assertIsNone(config.BOUNDSCHECK) + + a = np.arange(3) + b = np.arange(4) + + # Check the numpy behavior to ensure the test is correct. + with self.assertRaises(IndexError): + # TODO: When we raise the same error message as numpy, test that + # they are the same + fancy_array_modify(a) + fancy_array_modify(b) + + at = typeof(a) + rt = at.dtype[:] + boundscheck = njit(rt(at), boundscheck=True)(fancy_array_modify) + + with self.assertRaises(IndexError): + boundscheck(a) + + +class TestBoundsEnvironmentVariable(TestCase): + def setUp(self): + @njit + def default(x): + return x[1] + + @njit(boundscheck=False) + def off(x): + return x[1] + + @njit(boundscheck=True) + def on(x): + return x[1] + + self.default = default + self.off = off + self.on = on + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': ''}) + def test_boundscheck_unset(self): + self.assertIsNone(config.BOUNDSCHECK) + + a = np.array([1]) + + # Doesn't raise + self.default(a) + self.off(a) + + with self.assertRaises(IndexError): + self.on(a) + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': '1'}) + def test_boundscheck_enabled(self): + self.assertTrue(config.BOUNDSCHECK) + + a = np.array([1]) + + with self.assertRaises(IndexError): + self.default(a) + self.off(a) + self.on(a) + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': '0'}) + def test_boundscheck_disabled(self): + self.assertFalse(config.BOUNDSCHECK) + + a = np.array([1]) + + # Doesn't raise + self.default(a) + self.off(a) + self.on(a) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_buffer_protocol.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_buffer_protocol.py new file mode 100644 index 0000000000000000000000000000000000000000..b680d819e72e48e983405c3bf969d13544eb73a7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_buffer_protocol.py @@ -0,0 +1,289 @@ +import array + +import numpy as np + +from numba import jit +from numba.tests.support import TestCase, compile_function, MemoryLeakMixin +import unittest + + +@jit(nopython=True) +def len_usecase(buf): + return len(buf) + + +@jit(nopython=True) +def getitem_usecase(buf, i): + return buf[i] + + +@jit(nopython=True) +def getslice_usecase(buf, i, j): + s = buf[i:j] + return s[0] + 2 * s[-1] + + +@jit(nopython=True) +def setitem_usecase(buf, i, v): + buf[i] = v + + +@jit(nopython=True) +def iter_usecase(buf): + res = 0.0 + for i, x in enumerate(buf): + res += x + res *= i + 1 + return res + + +def attrgetter(attr): + code = """def func(x): + return x.%(attr)s +""" % locals() + pyfunc = compile_function("func", code, globals()) + return jit(nopython=True)(pyfunc) + + +contiguous_usecase = attrgetter("contiguous") +c_contiguous_usecase = attrgetter("c_contiguous") +f_contiguous_usecase = attrgetter("f_contiguous") +itemsize_usecase = attrgetter("itemsize") +nbytes_usecase = attrgetter("nbytes") +ndim_usecase = attrgetter("ndim") +readonly_usecase = attrgetter("readonly") +shape_usecase = attrgetter("shape") +strides_usecase = attrgetter("strides") + + +class TestBufferProtocol(MemoryLeakMixin, TestCase): + """ + Test operations on buffer-providing objects. + """ + + def _arrays(self): + n = 10 + for letter, offset in [ + ('b', -3), + ('B', 0), + ('h', -5000), + ('H', 40000), + ('i', -100000), + ('I', 1000000), + ('l', -100000), + ('L', 1000000), + ('q', -2**60), + ('Q', 2**63 + 1), + ('f', 1.5), + ('d', -1.5), + ]: + yield array.array(letter, [i + offset for i in range(n)]) + + def _memoryviews(self): + n = 10 + yield memoryview(bytearray(b"abcdefghi")) + yield memoryview(b"abcdefghi") + # Different item types + for dtype, start, stop in [ + ('int8', -10, 10), + ('uint8', 0, 10), + ('int16', -5000, 1000), + ('uint16', 40000, 50000), + ('int32', -100000, 100000), + ('uint32', 0, 1000000), + ('int64', -2**60, 10), + ('uint64', 0, 2**64 - 10), + ('float32', 1.5, 3.5), + ('float64', 1.5, 3.5), + ('complex64', -8j, 12 + 5j), + ('complex128', -8j, 12 + 5j), + ]: + yield memoryview(np.linspace(start, stop, n).astype(dtype)) + # Different layouts + arr = np.arange(12).reshape((3, 4)) + assert arr.flags.c_contiguous and not arr.flags.f_contiguous + yield memoryview(arr) + arr = arr.T + assert arr.flags.f_contiguous and not arr.flags.c_contiguous + yield memoryview(arr) + arr = arr[::2] + assert not arr.flags.f_contiguous and not arr.flags.c_contiguous + yield memoryview(arr) + + def _readonlies(self): + yield b"xyz" + yield memoryview(b"abcdefghi") + arr = np.arange(5) + arr.setflags(write=False) + yield memoryview(arr) + + def _check_unary(self, jitfunc, *args): + pyfunc = jitfunc.py_func + self.assertPreciseEqual(jitfunc(*args), pyfunc(*args)) + + def check_len(self, obj): + self._check_unary(len_usecase, obj) + + def check_iter(self, obj): + self._check_unary(iter_usecase, obj) + + def check_getitem(self, obj): + # Be careful to index all dimensions, since we don't support + # partial indexing yet. + def yield_indices(obj): + try: + shape = obj.shape + except AttributeError: + shape = len(obj), + for tup in np.ndindex(shape): + # Simple 1d buffer-providing objects usually don't support + # tuple indexing. + if len(tup) == 1: + yield tup[0] + else: + yield tup + + for i in yield_indices(obj): + try: + expected = obj[i] + except (NotImplementedError, TypeError): + if isinstance(obj, memoryview): + # The memoryview object doesn't support all codes yet, + # fall back on the underlying object. + expected = obj.obj[i] + else: + raise + self.assertPreciseEqual(getitem_usecase(obj, i), expected) + + def check_setitem(self, obj): + for i in range(len(obj)): + orig = list(obj) + val = obj[i] // 2 + 1 + setitem_usecase(obj, i, val) + self.assertEqual(obj[i], val) + for j, val in enumerate(orig): + if j != i: + self.assertEqual(obj[j], val) + + def check_getslice(self, obj): + self._check_unary(getslice_usecase, obj, 1, len(obj) - 1) + + def test_len(self): + self.check_len(bytearray(5)) + self.check_len(b"xyz") + for mem in self._memoryviews(): + self.check_len(mem) + for arr in self._arrays(): + self.check_len(arr) + for buf in self._readonlies(): + self.check_getitem(buf) + + def test_getitem(self): + self.check_getitem(bytearray(b"abc")) + self.check_getitem(b"xyz") + for mem in self._memoryviews(): + self.check_getitem(mem) + for arr in self._arrays(): + self.check_getitem(arr) + for buf in self._readonlies(): + self.check_getitem(buf) + + def test_getslice(self): + with self.assertTypingError(): + self.check_getslice(bytearray(b"abcde")) + self.check_getslice(b"xyzuvw") + self.check_getslice(memoryview(b"xyzuvw")) + with self.assertTypingError(): + self.check_getslice(array.array('i', range(10))) + for buf in self._readonlies(): + self.check_getitem(buf) + + def test_setitem(self): + self.check_setitem(bytearray(b"abcdefghi")) + for arr in self._arrays(): + self.check_setitem(arr) + for mem in self._memoryviews(): + self.check_getitem(mem) + # Read-only buffers + for buf in self._readonlies(): + with self.assertTypingError(): + self.check_setitem(buf) + + def test_iter(self): + self.check_iter(bytearray(b"abc")) + self.check_iter(b"xyz") + self.check_iter(memoryview(b"xyz")) + for arr in self._arrays(): + self.check_iter(arr) + for buf in self._readonlies(): + self.check_getitem(buf) + + +class TestMemoryView(MemoryLeakMixin, TestCase): + """ + Test memoryview-specific attributes and operations. + """ + + def _arrays(self): + arr = np.arange(12) + yield arr + arr = arr.reshape((3, 4)) + yield arr + yield arr.T + yield arr[::2] + arr.setflags(write=False) + yield arr + arr = np.zeros(()) + assert arr.ndim == 0 + yield arr + + def test_ndim(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(ndim_usecase(m), arr.ndim) + + def test_shape(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(shape_usecase(m), arr.shape) + + def test_strides(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(strides_usecase(m), arr.strides) + + def test_itemsize(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(itemsize_usecase(m), arr.itemsize) + + def test_nbytes(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertPreciseEqual(nbytes_usecase(m), arr.size * arr.itemsize) + + def test_readonly(self): + for arr in self._arrays(): + m = memoryview(arr) + self.assertIs(readonly_usecase(m), not arr.flags.writeable) + m = memoryview(b"xyz") + self.assertIs(readonly_usecase(m), True) + m = memoryview(bytearray(b"xyz")) + self.assertIs(readonly_usecase(m), False) + + def test_contiguous(self): + m = memoryview(bytearray(b"xyz")) + self.assertIs(contiguous_usecase(m), True) + self.assertIs(c_contiguous_usecase(m), True) + self.assertIs(f_contiguous_usecase(m), True) + for arr in self._arrays(): + m = memoryview(arr) + # Note `arr.flags.contiguous` is wrong (it mimics c_contiguous) + self.assertIs(contiguous_usecase(m), + arr.flags.f_contiguous or arr.flags.c_contiguous) + self.assertIs(c_contiguous_usecase(m), arr.flags.c_contiguous) + self.assertIs(f_contiguous_usecase(m), arr.flags.f_contiguous) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_builtins.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..11689b245a13abe4f0c40c71da5e87cd7c937721 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_builtins.py @@ -0,0 +1,1682 @@ +import itertools +import functools +import sys +import operator +from collections import namedtuple + +import numpy as np + +import unittest +import warnings + +from numba import jit, typeof, njit, typed +from numba.core import errors, types, config +from numba.tests.support import (TestCase, tag, ignore_internal_warnings, + MemoryLeakMixin) +from numba.core.extending import overload_method, box, register_jitable + + +forceobj_flags = {'forceobj': True} + +no_pyobj_flags = {'nopython': True, '_nrt': False} + +nrt_no_pyobj_flags = {'nopython': True} + + +def abs_usecase(x): + return abs(x) + +def all_usecase(x, y): + if x == None and y == None: + return all([]) + elif x == None: + return all([y]) + elif y == None: + return all([x]) + else: + return all([x, y]) + +def any_usecase(x, y): + if x == None and y == None: + return any([]) + elif x == None: + return any([y]) + elif y == None: + return any([x]) + else: + return any([x, y]) + +def bool_usecase(x): + return bool(x) + +def complex_usecase(x, y): + return complex(x, y) + +def divmod_usecase(x, y): + return divmod(x, y) + +def enumerate_usecase(): + result = 0 + for i, j in enumerate((1., 2.5, 3.)): + result += i * j + return result + +def enumerate_start_usecase(): + result = 0 + for i, j in enumerate((1., 2.5, 3.), 42): + result += i * j + return result + +def enumerate_invalid_start_usecase(): + result = 0 + for i, j in enumerate((1., 2.5, 3.), 3.14159): + result += i * j + return result + +def filter_usecase(x, filter_func): + return filter(filter_func, x) + +def float_usecase(x): + return float(x) + +def float_inf_usecase(x): + d = { + 0: float('inf'), + 1: float('INF'), + 2: float('-inf'), + 3: float('-INF'), + 4: float('\r\nINF\r '), + 5: float(' \r\n\t-INF'), + 6: float('1234.45'), + 7: float('\n-123.4\r'), + } + return d.get(x) + +def format_usecase(x, y): + return x.format(y) + +def globals_usecase(): + return globals() + +# NOTE: hash() is tested in test_hashing + +def hex_usecase(x): + return hex(x) + +def str_usecase(x): + return str(x) + +def int_usecase(x, base): + return int(x, base=base) + +def iter_next_usecase(x): + it = iter(x) + return next(it), next(it) + +def locals_usecase(x): + y = 5 + return locals()['y'] + +def long_usecase(x, base): + return long(x, base=base) + +def map_usecase(x, map_func): + return map(map_func, x) + + +def max_usecase1(x, y): + return max(x, y) + +def max_usecase2(x, y): + return max([x, y]) + +def max_usecase3(x): + return max(x) + +def max_usecase4(): + return max(()) + + +def min_usecase1(x, y): + return min(x, y) + +def min_usecase2(x, y): + return min([x, y]) + +def min_usecase3(x): + return min(x) + +def min_usecase4(): + return min(()) + +def oct_usecase(x): + return oct(x) + +def reduce_usecase(reduce_func, x): + return functools.reduce(reduce_func, x) + +def round_usecase1(x): + return round(x) + +def round_usecase2(x, n): + return round(x, n) + +def sum_usecase(x): + return sum(x) + +def type_unary_usecase(a, b): + return type(a)(b) + +def truth_usecase(p): + return operator.truth(p) + +def unichr_usecase(x): + return unichr(x) + +def zip_usecase(): + result = 0 + for i, j in zip((1, 2, 3), (4.5, 6.7)): + result += i * j + return result + +def zip_0_usecase(): + result = 0 + for i in zip(): + result += 1 + return result + +def zip_1_usecase(): + result = 0 + for i, in zip((1, 2)): + result += i + return result + + +def zip_3_usecase(): + result = 0 + for i, j, k in zip((1, 2), (3, 4, 5), (6.7, 8.9)): + result += i * j * k + return result + + +def zip_first_exhausted(): + iterable = range(7) + n = 3 + it = iter(iterable) + # 1st iterator is shorter + front = list(zip(range(n), it)) + # Make sure that we didn't skip one in `it` + back = list(it) + return front, back + + +def pow_op_usecase(x, y): + return x ** y + + +def pow_usecase(x, y): + return pow(x, y) + + +def sum_usecase(x): + return sum(x) + + +def sum_kwarg_usecase(x, start=0): + ret = sum(x, start) + return sum(x, start=start), ret + + +def isinstance_usecase(a): + if isinstance(a, (int, float)): + if isinstance(a, int): + return a + 1, 'int' + if isinstance(a, float): + return a + 2.0, 'float' + elif isinstance(a, str): + return a + ", world!", 'str' + elif isinstance(a, complex): + return a.imag, 'complex' + elif isinstance(a, (tuple, list)): + if isinstance(a, tuple): + return 'tuple' + else: + return 'list' + elif isinstance(a, set): + return 'set' + elif isinstance(a, bytes): + return 'bytes' + return 'no match' + + +def isinstance_dict(): + a = {1: 2, 3: 4} + b = {'a': 10, 'b': np.zeros(3)} + if isinstance(a, dict) and isinstance(b, dict): + return 'dict' + else: + return 'not dict' + + +def isinstance_usecase_numba_types(a): + if isinstance(a, typed.List): + return 'typed list' + elif isinstance(a, (types.int32, types.int64)): + if isinstance(a, types.int32): + return 'int32' + else: + return 'int64' + elif isinstance(a, (types.float32, types.float64)): + if isinstance(a, types.float32): + return 'float32' + elif isinstance(a, types.float64): + return 'float64' + elif isinstance(a, typed.Dict): + return 'typed dict' + else: + return 'no match' + + +def isinstance_usecase_numba_types_2(): + # some types cannot be passed as argument to njit functions + a = b'hello' + b = range(1, 2) + c = dict() + c[2] = 3 + if isinstance(a, bytes) and \ + isinstance(b, range) and \ + isinstance(c, dict): + return True + return False + + +def invalid_isinstance_usecase(x): + if isinstance(x, ('foo',)): + return 'true branch' + else: + return 'false branch' + + +def isinstance_usecase_invalid_type(x): + # this should be a valid call when x := float + if isinstance(x, (float, 'not a type')): + return True + else: + return False + + +def invalid_isinstance_usecase_phi_nopropagate(x): + if x > 4: + z = 10 + else: + z = 'a' + if isinstance(z, int): + return True + else: + return False + + +def invalid_isinstance_usecase_phi_nopropagate2(a): + # Numba issue #9125 + x = 0 + if isinstance(a, int): + a = (a, a) + + for i in range(len(a)): + x += i + return x + + +def invalid_isinstance_optional_usecase(x): + if x > 4: + z = 10 + else: + z = None + if isinstance(z, int): + return True + else: + return False + +def invalid_isinstance_unsupported_type_usecase(): + ntpl = namedtuple('ntpl', ['a', 'b']) + inst = ntpl(1, 2) + def impl(x): + return isinstance(inst, ntpl) + return impl + +class TestBuiltins(TestCase): + + def run_nullary_func(self, pyfunc, flags): + cfunc = jit((), **flags)(pyfunc) + expected = pyfunc() + self.assertPreciseEqual(cfunc(), expected) + + def test_abs(self, flags=forceobj_flags): + pyfunc = abs_usecase + + cfunc = jit((types.int32,), **flags)(pyfunc) + for x in [-1, 0, 1]: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + cfunc = jit((types.float32,), **flags)(pyfunc) + for x in [-1.1, 0.0, 1.1]: + self.assertPreciseEqual(cfunc(x), pyfunc(x), prec='single') + + complex_values = [-1.1 + 0.5j, 0.0 + 0j, 1.1 + 3j, + float('inf') + 1j * float('nan'), + float('nan') - 1j * float('inf')] + cfunc = jit((types.complex64,), **flags)(pyfunc) + for x in complex_values: + self.assertPreciseEqual(cfunc(x), pyfunc(x), prec='single') + cfunc = jit((types.complex128,), **flags)(pyfunc) + for x in complex_values: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + for unsigned_type in types.unsigned_domain: + unsigned_values = [0, 10, 2, 2 ** unsigned_type.bitwidth - 1] + cfunc = jit((unsigned_type,), **flags)(pyfunc) + for x in unsigned_values: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + def test_abs_npm(self): + self.test_abs(flags=no_pyobj_flags) + + def test_all(self, flags=forceobj_flags): + pyfunc = all_usecase + + cfunc = jit((types.int32,types.int32), **flags)(pyfunc) + x_operands = [-1, 0, 1, None] + y_operands = [-1, 0, 1, None] + for x, y in itertools.product(x_operands, y_operands): + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + def test_all_npm(self): + with self.assertTypingError(): + self.test_all(flags=no_pyobj_flags) + + def test_any(self, flags=forceobj_flags): + pyfunc = any_usecase + + cfunc = jit((types.int32,types.int32), **flags)(pyfunc) + x_operands = [-1, 0, 1, None] + y_operands = [-1, 0, 1, None] + for x, y in itertools.product(x_operands, y_operands): + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + def test_any_npm(self): + with self.assertTypingError(): + self.test_any(flags=no_pyobj_flags) + + def test_bool(self, flags=forceobj_flags): + pyfunc = bool_usecase + + cfunc = jit((types.int32,), **flags)(pyfunc) + for x in [-1, 0, 1]: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + cfunc = jit((types.float64,), **flags)(pyfunc) + for x in [0.0, -0.0, 1.5, float('inf'), float('nan')]: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + cfunc = jit((types.complex128,), **flags)(pyfunc) + for x in [complex(0, float('inf')), complex(0, float('nan'))]: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + def test_bool_npm(self): + self.test_bool(flags=no_pyobj_flags) + + def test_bool_nonnumber(self, flags=forceobj_flags): + pyfunc = bool_usecase + + cfunc = jit((types.string,), **flags)(pyfunc) + for x in ['x', '']: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + cfunc = jit((types.Dummy('list'),), **flags)(pyfunc) + for x in [[1], []]: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + def test_bool_nonnumber_npm(self): + with self.assertTypingError(): + self.test_bool_nonnumber(flags=no_pyobj_flags) + + def test_complex(self, flags=forceobj_flags): + pyfunc = complex_usecase + + cfunc = jit((types.int32, types.int32), **flags)(pyfunc) + + x_operands = [-1, 0, 1] + y_operands = [-1, 0, 1] + for x, y in itertools.product(x_operands, y_operands): + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + def test_complex_npm(self): + self.test_complex(flags=no_pyobj_flags) + + def test_divmod_ints(self, flags=forceobj_flags): + pyfunc = divmod_usecase + + cfunc = jit((types.int64, types.int64), **flags)(pyfunc) + + def truncate_result(x, bits=64): + # Remove any extraneous bits (since Numba will return + # a 64-bit result by definition) + if x >= 0: + x &= (1 << (bits - 1)) - 1 + return x + + denominators = [1, 3, 7, 15, -1, -3, -7, -15, 2**63 - 1, -2**63] + numerators = denominators + [0] + for x, y, in itertools.product(numerators, denominators): + expected_quot, expected_rem = pyfunc(x, y) + quot, rem = cfunc(x, y) + f = truncate_result + self.assertPreciseEqual((f(quot), f(rem)), + (f(expected_quot), f(expected_rem))) + + for x in numerators: + with self.assertRaises(ZeroDivisionError): + cfunc(x, 0) + + def test_divmod_ints_npm(self): + self.test_divmod_ints(flags=no_pyobj_flags) + + def test_divmod_floats(self, flags=forceobj_flags): + pyfunc = divmod_usecase + + cfunc = jit((types.float64, types.float64), **flags)(pyfunc) + + denominators = [1., 3.5, 1e100, -2., -7.5, -1e101, + np.inf, -np.inf, np.nan] + numerators = denominators + [-0.0, 0.0] + for x, y, in itertools.product(numerators, denominators): + expected_quot, expected_rem = pyfunc(x, y) + quot, rem = cfunc(x, y) + self.assertPreciseEqual((quot, rem), (expected_quot, expected_rem)) + + for x in numerators: + with self.assertRaises(ZeroDivisionError): + cfunc(x, 0.0) + + def test_divmod_floats_npm(self): + self.test_divmod_floats(flags=no_pyobj_flags) + + def test_enumerate(self, flags=forceobj_flags): + self.run_nullary_func(enumerate_usecase, flags) + + def test_enumerate_npm(self): + self.test_enumerate(flags=no_pyobj_flags) + + def test_enumerate_start(self, flags=forceobj_flags): + self.run_nullary_func(enumerate_start_usecase, flags) + + def test_enumerate_start_npm(self): + self.test_enumerate_start(flags=no_pyobj_flags) + + def test_enumerate_start_invalid_start_type(self): + pyfunc = enumerate_invalid_start_usecase + + cfunc = jit((), **forceobj_flags)(pyfunc) + + with self.assertRaises(TypeError) as raises: + cfunc() + + msg = "'float' object cannot be interpreted as an integer" + self.assertIn(msg, str(raises.exception)) + + def test_enumerate_start_invalid_start_type_npm(self): + pyfunc = enumerate_invalid_start_usecase + with self.assertRaises(errors.TypingError) as raises: + jit((), **no_pyobj_flags)(pyfunc) + msg = "Only integers supported as start value in enumerate" + self.assertIn(msg, str(raises.exception)) + + def test_filter(self, flags=forceobj_flags): + pyfunc = filter_usecase + argtys = (types.Dummy('list'), types.Dummy('function_ptr')) + cfunc = jit(argtys, **flags)(pyfunc) + + filter_func = lambda x: x % 2 + x = [0, 1, 2, 3, 4] + self.assertSequenceEqual(list(cfunc(x, filter_func)), + list(pyfunc(x, filter_func))) + + def test_filter_npm(self): + with self.assertTypingError(): + self.test_filter(flags=no_pyobj_flags) + + def test_float(self, flags=forceobj_flags): + pyfunc = float_usecase + + cfunc = jit((types.int32,), **flags)(pyfunc) + for x in [-1, 0, 1]: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + cfunc = jit((types.float32,), **flags)(pyfunc) + for x in [-1.1, 0.0, 1.1]: + self.assertPreciseEqual(cfunc(x), pyfunc(x), prec='single') + + cfunc = jit((types.string,), **flags)(pyfunc) + for x in ['-1.1', '0.0', '1.1', 'inf', '-inf', 'INF', '-INF']: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + def test_float_npm(self): + with self.assertTypingError(): + self.test_float(flags=no_pyobj_flags) + + def test_float_string_literal(self): + pyfunc = float_inf_usecase + cfunc = njit(pyfunc) + for x in range(8): + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + def test_format(self, flags=forceobj_flags): + pyfunc = format_usecase + + cfunc = jit((types.string, types.int32,), **flags)(pyfunc) + x = '{0}' + for y in [-1, 0, 1]: + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + cfunc = jit((types.string, types.float32,), **flags)(pyfunc) + x = '{0}' + for y in [-1.1, 0.0, 1.1]: + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + cfunc = jit((types.string, types.string,), **flags)(pyfunc) + x = '{0}' + for y in ['a', 'b', 'c']: + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + def test_format_npm(self): + with self.assertTypingError(): + self.test_format(flags=no_pyobj_flags) + + def test_globals(self, flags=forceobj_flags): + pyfunc = globals_usecase + cfunc = jit((), **flags)(pyfunc) + g = cfunc() + self.assertIs(g, globals()) + + def test_globals_npm(self): + with self.assertTypingError(): + self.test_globals(flags=no_pyobj_flags) + + def test_globals_jit(self, flags=forceobj_flags): + # Issue #416: weird behaviour of globals() in combination with + # the @jit decorator. + pyfunc = globals_usecase + jitted = jit(**flags)(pyfunc) + self.assertIs(jitted(), globals()) + self.assertIs(jitted(), globals()) + + def test_globals_jit_npm(self): + with self.assertTypingError(): + self.test_globals_jit(nopython=True) + + def test_hex(self, flags=forceobj_flags): + pyfunc = hex_usecase + + cfunc = jit((types.int32,), **flags)(pyfunc) + for x in [-1, 0, 1]: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + def test_hex_npm(self): + with self.assertTypingError(): + self.test_hex(flags=no_pyobj_flags) + + def test_int_str(self): + pyfunc = str_usecase + + small_inputs = [ + 1234, + 1, + 0, + 10, + 1000, + ] + + large_inputs = [ + 123456789, + 2222222, + 1000000, + ~0x0 + ] + + args = [*small_inputs, *large_inputs] + + typs = [ + types.int8, + types.int16, + types.int32, + types.int64, + types.uint, + types.uint8, + types.uint16, + types.uint32, + types.uint64, + ] + + for typ in typs: + cfunc = jit((typ,), **nrt_no_pyobj_flags)(pyfunc) + for v in args: + tp_info = np.iinfo(typ.key) + if not (tp_info.min <= v <= tp_info.max): + continue + self.assertPreciseEqual(cfunc(typ(v)), pyfunc(typ(v))) + + if typ.signed: + self.assertPreciseEqual(cfunc(typ(-v)), pyfunc(typ(-v))) + + def test_int(self, flags=forceobj_flags): + pyfunc = int_usecase + + cfunc = jit((types.string, types.int32,), **flags)(pyfunc) + + x_operands = ['-1', '0', '1', '10'] + y_operands = [2, 8, 10, 16] + for x, y in itertools.product(x_operands, y_operands): + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + def test_int_npm(self): + with self.assertTypingError(): + self.test_int(flags=no_pyobj_flags) + + def test_iter_next(self, flags=forceobj_flags): + pyfunc = iter_next_usecase + cfunc = jit((types.UniTuple(types.int32, 3),), **flags)(pyfunc) + self.assertPreciseEqual(cfunc((1, 42, 5)), (1, 42)) + + cfunc = jit((types.UniTuple(types.int32, 1),), **flags)(pyfunc) + with self.assertRaises(StopIteration): + cfunc((1,)) + + def test_iter_next_npm(self): + self.test_iter_next(flags=no_pyobj_flags) + + def test_locals(self, flags=forceobj_flags): + pyfunc = locals_usecase + with self.assertRaises(errors.ForbiddenConstruct): + jit((types.int64,), **flags)(pyfunc) + + def test_locals_forceobj(self): + self.test_locals(flags=forceobj_flags) + + def test_locals_npm(self): + with self.assertTypingError(): + self.test_locals(flags=no_pyobj_flags) + + def test_map(self, flags=forceobj_flags): + pyfunc = map_usecase + argtys = (types.Dummy('list'), types.Dummy('function_ptr')) + cfunc = jit(argtys, **flags)(pyfunc) + + map_func = lambda x: x * 2 + x = [0, 1, 2, 3, 4] + self.assertSequenceEqual(list(cfunc(x, map_func)), + list(pyfunc(x, map_func))) + + def test_map_npm(self): + with self.assertTypingError(): + self.test_map(flags=no_pyobj_flags) + + # + # min() and max() + # + + def check_minmax_1(self, pyfunc, flags): + cfunc = jit((types.int32, types.int32), **flags)(pyfunc) + + x_operands = [-1, 0, 1] + y_operands = [-1, 0, 1] + for x, y in itertools.product(x_operands, y_operands): + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + def test_max_1(self, flags=forceobj_flags): + """ + max(*args) + """ + self.check_minmax_1(max_usecase1, flags) + + def test_min_1(self, flags=forceobj_flags): + """ + min(*args) + """ + self.check_minmax_1(min_usecase1, flags) + + def test_max_npm_1(self): + self.test_max_1(flags=no_pyobj_flags) + + def test_min_npm_1(self): + self.test_min_1(flags=no_pyobj_flags) + + def check_minmax_2(self, pyfunc, flags): + cfunc = jit((types.int32, types.int32), **flags)(pyfunc) + + x_operands = [-1, 0, 1] + y_operands = [-1, 0, 1] + for x, y in itertools.product(x_operands, y_operands): + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + def test_max_2(self, flags=forceobj_flags): + """ + max(list) + """ + self.check_minmax_2(max_usecase2, flags) + + def test_min_2(self, flags=forceobj_flags): + """ + min(list) + """ + self.check_minmax_2(min_usecase2, flags) + + def test_max_npm_2(self): + with self.assertTypingError(): + self.test_max_2(flags=no_pyobj_flags) + + def test_min_npm_2(self): + with self.assertTypingError(): + self.test_min_2(flags=no_pyobj_flags) + + def check_minmax_3(self, pyfunc, flags): + def check(argty): + cfunc = jit((argty,), **flags)(pyfunc) + # Check that the algorithm matches Python's with a non-total order + tup = (1.5, float('nan'), 2.5) + for val in [tup, tup[::-1]]: + self.assertPreciseEqual(cfunc(val), pyfunc(val)) + + check(types.UniTuple(types.float64, 3)) + check(types.Tuple((types.float32, types.float64, types.float32))) + + def test_max_3(self, flags=forceobj_flags): + """ + max(tuple) + """ + self.check_minmax_3(max_usecase3, flags) + + def test_min_3(self, flags=forceobj_flags): + """ + min(tuple) + """ + self.check_minmax_3(min_usecase3, flags) + + def test_max_npm_3(self): + self.test_max_3(flags=no_pyobj_flags) + + def test_min_npm_3(self): + self.test_min_3(flags=no_pyobj_flags) + + def check_min_max_invalid_types(self, pyfunc, flags=forceobj_flags): + cfunc = jit((types.int32, types.Dummy('list'),), **flags)(pyfunc) + cfunc(1, [1]) + + def test_max_1_invalid_types(self): + with self.assertRaises(TypeError): + self.check_min_max_invalid_types(max_usecase1) + + def test_max_1_invalid_types_npm(self): + with self.assertTypingError(): + self.check_min_max_invalid_types(max_usecase1, flags=no_pyobj_flags) + + def test_min_1_invalid_types(self): + with self.assertRaises(TypeError): + self.check_min_max_invalid_types(min_usecase1) + + def test_min_1_invalid_types_npm(self): + with self.assertTypingError(): + self.check_min_max_invalid_types(min_usecase1, flags=no_pyobj_flags) + + def check_minmax_bool1(self, pyfunc, flags): + cfunc = jit((types.bool_, types.bool_), **flags)(pyfunc) + + operands = (False, True) + for x, y in itertools.product(operands, operands): + self.assertPreciseEqual(cfunc(x, y), pyfunc(x, y)) + + def test_max_bool1(self, flags=forceobj_flags): + # tests max() + self.check_minmax_bool1(max_usecase1, flags) + + def test_min_bool1(self, flags=forceobj_flags): + # tests min() + self.check_minmax_bool1(min_usecase1, flags) + + # Test that max(1) and min(1) fail + + def check_min_max_unary_non_iterable(self, pyfunc, flags=forceobj_flags): + cfunc = jit((types.int32,), **flags)(pyfunc) + cfunc(1) + + def test_max_unary_non_iterable(self): + with self.assertRaises(TypeError): + self.check_min_max_unary_non_iterable(max_usecase3) + + def test_max_unary_non_iterable_npm(self): + with self.assertTypingError(): + self.check_min_max_unary_non_iterable(max_usecase3) + + def test_min_unary_non_iterable(self): + with self.assertRaises(TypeError): + self.check_min_max_unary_non_iterable(min_usecase3) + + def test_min_unary_non_iterable_npm(self): + with self.assertTypingError(): + self.check_min_max_unary_non_iterable(min_usecase3) + + # Test that max(()) and min(()) fail + + def check_min_max_empty_tuple(self, pyfunc, func_name): + with self.assertTypingError() as raises: + jit((), **no_pyobj_flags)(pyfunc) + self.assertIn("%s() argument is an empty tuple" % func_name, + str(raises.exception)) + + def test_max_empty_tuple(self): + self.check_min_max_empty_tuple(max_usecase4, "max") + + def test_min_empty_tuple(self): + self.check_min_max_empty_tuple(min_usecase4, "min") + + + def test_oct(self, flags=forceobj_flags): + pyfunc = oct_usecase + + cfunc = jit((types.int32,), **flags)(pyfunc) + for x in [-8, -1, 0, 1, 8]: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + def test_oct_npm(self): + with self.assertTypingError(): + self.test_oct(flags=no_pyobj_flags) + + def test_reduce(self, flags=forceobj_flags): + pyfunc = reduce_usecase + argtys = (types.Dummy('function_ptr'), types.Dummy('list')) + cfunc = jit(argtys, **flags)(pyfunc) + + reduce_func = lambda x, y: x + y + + x = range(10) + self.assertPreciseEqual(cfunc(reduce_func, x), pyfunc(reduce_func, x)) + + x = [x + x/10.0 for x in range(10)] + self.assertPreciseEqual(cfunc(reduce_func, x), pyfunc(reduce_func, x)) + + x = [complex(x, x) for x in range(10)] + self.assertPreciseEqual(cfunc(reduce_func, x), pyfunc(reduce_func, x)) + + def test_reduce_npm(self): + with self.assertTypingError(): + self.test_reduce(flags=no_pyobj_flags) + + def test_round1(self, flags=forceobj_flags): + pyfunc = round_usecase1 + + for tp in (types.float64, types.float32): + cfunc = jit((tp,), **flags)(pyfunc) + values = [-1.6, -1.5, -1.4, -0.5, 0.0, 0.1, 0.5, 0.6, 1.4, 1.5, 5.0] + values += [-0.1, -0.0] + for x in values: + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + def test_round1_npm(self): + self.test_round1(flags=no_pyobj_flags) + + def test_round2(self, flags=forceobj_flags): + pyfunc = round_usecase2 + + for tp in (types.float64, types.float32): + prec = 'single' if tp is types.float32 else 'exact' + cfunc = jit((tp, types.int32), **flags)(pyfunc) + for x in [0.0, 0.1, 0.125, 0.25, 0.5, 0.75, 1.25, + 1.5, 1.75, 2.25, 2.5, 2.75, 12.5, 15.0, 22.5]: + for n in (-1, 0, 1, 2): + self.assertPreciseEqual(cfunc(x, n), pyfunc(x, n), + prec=prec) + expected = pyfunc(-x, n) + self.assertPreciseEqual(cfunc(-x, n), pyfunc(-x, n), + prec=prec) + + def test_round2_npm(self): + self.test_round2(flags=no_pyobj_flags) + + def test_sum_objmode(self, flags=forceobj_flags): + pyfunc = sum_usecase + + cfunc = jit((types.Dummy('list'),), **flags)(pyfunc) + + x = range(10) + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + x = [x + x/10.0 for x in range(10)] + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + x = [complex(x, x) for x in range(10)] + self.assertPreciseEqual(cfunc(x), pyfunc(x)) + + def test_sum(self): + # In Python 3.8+ "start" can be specified as a kwarg, so test that too + sum_default = njit(sum_usecase) + sum_kwarg = njit(sum_kwarg_usecase) + + @njit + def sum_range(sz, start=0): + tmp = range(sz) + ret = sum(tmp, start) + return sum(tmp, start=start), ret + + ntpl = namedtuple('ntpl', ['a', 'b']) + + # check call with default kwarg, start=0 + def args(): + yield [*range(10)] + yield [x + x/10.0 for x in range(10)] + yield [x * 1j for x in range(10)] + yield (1, 2, 3) + yield (1, 2, 3j) + # uints will likely end up as floats as `start` is signed, so just + # test mixed signed ints + yield (np.int64(32), np.int32(2), np.int8(3)) + tl = typed.List(range(5)) + yield tl + yield np.ones(5) + yield ntpl(100, 200) + yield ntpl(100, 200j) + + for x in args(): + self.assertPreciseEqual(sum_default(x), sum_default.py_func(x)) + + # Check the uint use case, as start is signed, NumPy will end up with + # a float result whereas Numba will end up with an int (see integer + # typing NBEP). + x = (np.uint64(32), np.uint32(2), np.uint8(3)) + self.assertEqual(sum_default(x), sum_default.py_func(x)) + + # check call with changing default kwarg, start + def args_kws(): + yield [*range(10)], 12 + yield [x + x/10.0 for x in range(10)], 19j + yield [x * 1j for x in range(10)], -2 + yield (1, 2, 3), 9 + yield (1, 2, 3j), -0 + # uints will likely end up as floats as `start` is signed, so just + # test mixed signed ints + yield (np.int64(32), np.int32(2), np.int8(3)), np.uint32(7) + tl = typed.List(range(5)) + yield tl, 100 + yield np.ones((5, 5)), 10 * np.ones((5,)) + yield ntpl(100, 200), -50 + yield ntpl(100, 200j), 9 + + for x, start in args_kws(): + self.assertPreciseEqual(sum_kwarg(x, start=start), + sum_kwarg.py_func(x, start=start)) + + # check call with range() + for start in range(-3, 4): + for sz in range(-3, 4): + self.assertPreciseEqual(sum_range(sz, start=start), + sum_range.py_func(sz, start=start)) + + def test_sum_exceptions(self): + sum_default = njit(sum_usecase) + sum_kwarg = njit(sum_kwarg_usecase) + + # check start as string/bytes/bytearray is error + msg = "sum() can't sum {}" + + with self.assertRaises(errors.TypingError) as raises: + sum_kwarg((1, 2, 3), 'a') + + self.assertIn(msg.format('strings'), str(raises.exception)) + + with self.assertRaises(errors.TypingError) as raises: + sum_kwarg((1, 2, 3), b'123') + + self.assertIn(msg.format('bytes'), str(raises.exception)) + + with self.assertRaises(errors.TypingError) as raises: + sum_kwarg((1, 2, 3), bytearray(b'123')) + + self.assertIn(msg.format('bytearray'), str(raises.exception)) + + # check invalid type has no impl + with self.assertRaises(errors.TypingError) as raises: + sum_default('abcd') + + self.assertIn('No implementation', str(raises.exception)) + + def test_truth(self): + pyfunc = truth_usecase + cfunc = jit(nopython=True)(pyfunc) + + self.assertEqual(pyfunc(True), cfunc(True)) + self.assertEqual(pyfunc(False), cfunc(False)) + + def test_type_unary(self): + # Test type(val) and type(val)(other_val) + pyfunc = type_unary_usecase + cfunc = jit(nopython=True)(pyfunc) + + def check(*args): + expected = pyfunc(*args) + self.assertPreciseEqual(cfunc(*args), expected) + + check(1.5, 2) + check(1, 2.5) + check(1.5j, 2) + check(True, 2) + check(2.5j, False) + + def test_zip(self, flags=forceobj_flags): + self.run_nullary_func(zip_usecase, flags) + + def test_zip_npm(self): + self.test_zip(flags=no_pyobj_flags) + + def test_zip_1(self, flags=forceobj_flags): + self.run_nullary_func(zip_1_usecase, flags) + + def test_zip_1_npm(self): + self.test_zip_1(flags=no_pyobj_flags) + + def test_zip_3(self, flags=forceobj_flags): + self.run_nullary_func(zip_3_usecase, flags) + + def test_zip_3_npm(self): + self.test_zip_3(flags=no_pyobj_flags) + + def test_zip_0(self, flags=forceobj_flags): + self.run_nullary_func(zip_0_usecase, flags) + + def test_zip_0_npm(self): + self.test_zip_0(flags=no_pyobj_flags) + + def test_zip_first_exhausted(self, flags=forceobj_flags): + """ + Test side effect to the input iterators when a left iterator has been + exhausted before the ones on the right. + """ + self.run_nullary_func(zip_first_exhausted, flags) + + def test_zip_first_exhausted_npm(self): + self.test_zip_first_exhausted(flags=nrt_no_pyobj_flags) + + def test_pow_op_usecase(self): + args = [ + (2, 3), + (2.0, 3), + (2, 3.0), + (2j, 3.0j), + ] + + for x, y in args: + argtys = (typeof(x), typeof(y)) + cfunc = jit(argtys, **no_pyobj_flags)(pow_op_usecase) + r = cfunc(x, y) + self.assertPreciseEqual(r, pow_op_usecase(x, y)) + + def test_pow_usecase(self): + args = [ + (2, 3), + (2.0, 3), + (2, 3.0), + (2j, 3.0j), + ] + + for x, y in args: + argtys = (typeof(x), typeof(y)) + cfunc = jit(argtys, **no_pyobj_flags)(pow_usecase) + r = cfunc(x, y) + self.assertPreciseEqual(r, pow_usecase(x, y)) + + def _check_min_max(self, pyfunc): + cfunc = njit()(pyfunc) + expected = pyfunc() + got = cfunc() + self.assertPreciseEqual(expected, got) + + def test_min_max_iterable_input(self): + + @njit + def frange(start, stop, step): + i = start + while i < stop: + yield i + i += step + + def sample_functions(op): + yield lambda: op(range(10)) + yield lambda: op(range(4, 12)) + yield lambda: op(range(-4, -15, -1)) + yield lambda: op([6.6, 5.5, 7.7]) + yield lambda: op([(3, 4), (1, 2)]) + yield lambda: op(frange(1.1, 3.3, 0.1)) + yield lambda: op([np.nan, -np.inf, np.inf, np.nan]) + yield lambda: op([(3,), (1,), (2,)]) + + for fn in sample_functions(op=min): + self._check_min_max(fn) + + for fn in sample_functions(op=max): + self._check_min_max(fn) + + +class TestOperatorMixedTypes(TestCase): + + def test_eq_ne(self): + for opstr in ('eq', 'ne'): + op = getattr(operator, opstr) + + @njit + def func(a, b): + return op(a, b) + + # all these things should evaluate to being equal or not, all should + # survive typing. + things = (1, 0, True, False, 1.0, 2.0, 1.1, 1j, None, "", "1") + for x, y in itertools.product(things, things): + self.assertPreciseEqual(func.py_func(x, y), func(x, y)) + + def test_cmp(self): + for opstr in ('gt', 'lt', 'ge', 'le', 'eq', 'ne'): + op = getattr(operator, opstr) + @njit + def func(a, b): + return op(a, b) + + # numerical things should all be comparable + things = (1, 0, True, False, 1.0, 0.0, 1.1) + for x, y in itertools.product(things, things): + expected = func.py_func(x, y) + got = func(x, y) + message = ("%s %s %s does not match between Python and Numba" + % (x, opstr, y)) + self.assertEqual(expected, got, message) + + +class TestIsinstanceBuiltin(TestCase): + def test_isinstance(self): + pyfunc = isinstance_usecase + cfunc = jit(nopython=True)(pyfunc) + + inputs = ( + 3, # int + 5.0, # float + "Hello", # string + b'world', # bytes + 1j, # complex + [1, 2, 3], # list + (1, 3, 3, 3), # UniTuple + set([1, 2]), # set + (1, 'nba', 2), # Heterogeneous Tuple + # {'hello': 2}, # dict - doesn't work as input + None, + ) + + for inpt in inputs: + expected = pyfunc(inpt) + got = cfunc(inpt) + self.assertEqual(expected, got) + + def test_isinstance_dict(self): + # Tests typed.Dict and LiteralStrKeyDict + pyfunc = isinstance_dict + cfunc = jit(nopython=True)(pyfunc) + self.assertEqual(pyfunc(), cfunc()) + + def test_isinstance_issue9125(self): + pyfunc = invalid_isinstance_usecase_phi_nopropagate2 + cfunc = jit(nopython=True)(pyfunc) + self.assertEqual(pyfunc(3), cfunc(3)) + + def test_isinstance_numba_types(self): + # This makes use of type aliasing between python scalars and NumPy + # scalars, see also test_numba_types() + pyfunc = isinstance_usecase_numba_types + cfunc = jit(nopython=True)(pyfunc) + + inputs = ( + (types.int32(1), 'int32'), + (types.int64(2), 'int64'), + (types.float32(3.0), 'float32'), + (types.float64(4.0), 'float64'), + (types.complex64(5j), 'no match'), + (typed.List([1, 2]), 'typed list'), + (typed.Dict.empty(types.int64, types.int64), 'typed dict') + ) + + for inpt, expected in inputs: + got = cfunc(inpt) + self.assertEqual(expected, got) + + def test_isinstance_numba_types_2(self): + pyfunc = isinstance_usecase_numba_types_2 + cfunc = jit(nopython=True)(pyfunc) + self.assertEqual(pyfunc(), cfunc()) + + def test_isinstance_invalid_type(self): + pyfunc = isinstance_usecase_invalid_type + cfunc = jit(nopython=True)(pyfunc) + + # valid type + self.assertTrue(cfunc(3.4)) + + # invalid type + msg = 'Cannot infer numba type of python type' + + with self.assertRaises(errors.TypingError) as raises: + cfunc(100) + + self.assertIn(msg, str(raises.exception)) + + def test_isinstance_exceptions(self): + fns = [ + (invalid_isinstance_usecase, + 'Cannot infer numba type of python type'), + (invalid_isinstance_usecase_phi_nopropagate, + ('isinstance() cannot determine the type of variable "z" due to a ' + 'branch.')), + (invalid_isinstance_optional_usecase, + ('isinstance() cannot determine the type of variable "z" due to a ' + 'branch.')), + (invalid_isinstance_unsupported_type_usecase(), + ('isinstance() does not support variables of type "ntpl(')), + ] + + for fn, msg in fns: + fn = njit(fn) + + with self.assertRaises(errors.TypingError) as raises: + fn(100) + + self.assertIn(msg, str(raises.exception)) + + def test_combinations(self): + # Combinatorically test common classes and instances + def gen_w_arg(clazz_type): + def impl(x): + return isinstance(x, clazz_type) + return impl + + clazz_types = (int, float, complex, str, list, tuple, bytes, set, range, + np.int8, np.float32,) + instances = (1, 2.3, 4j, '5', [6,], (7,), b'8', {9,}, None, + (10, 11, 12), (13, 'a', 14j), np.array([15, 16, 17]), + np.int8(18), np.float32(19), + typed.Dict.empty(types.unicode_type, types.float64), + typed.List.empty_list(types.complex128), np.ones(4)) + + for ct in clazz_types: + fn = njit(gen_w_arg(ct)) + for x in instances: + expected = fn.py_func(x) + got = fn(x) + self.assertEqual(got, expected) + + def test_numba_types(self): + # Check types which are Numba types, this would break without the jit + # decorator in all cases except numba.typed containers. + def gen_w_arg(clazz_type): + def impl(): + return isinstance(1, clazz_type) + return impl + + clazz_types = (types.Integer, types.Float, types.Array,) + + msg = "Numba type classes.*are not supported" + for ct in clazz_types: + fn = njit(gen_w_arg(ct)) + with self.assertRaises(errors.TypingError) as raises: + fn() + self.assertRegex(str(raises.exception), msg) + + def test_python_numpy_scalar_alias_problem(self): + # There's a problem due to Python and NumPy scalars being aliased in the + # type system. This is because e.g. int scalar values and NumPy np.intp + # type alias to types.intp. This test merely records this fact. + + @njit + def foo(): + return isinstance(np.intp(10), int) + + self.assertEqual(foo(), True) + self.assertEqual(foo.py_func(), False) + + @njit + def bar(): + return isinstance(1, np.intp) + + self.assertEqual(bar(), True) + self.assertEqual(bar.py_func(), False) + + def test_branch_prune(self): + # Check that isinstance branches are pruned allowing otherwise + # impossible type specific specialisation. + + @njit + def foo(x): + if isinstance(x, str): + return x + 'some_string' + elif isinstance(x, complex): + return np.imag(x) + elif isinstance(x, tuple): + return len(x) + else: + assert 0 + + for x in ('string', 1 + 2j, ('a', 3, 4j)): + expected = foo.py_func(x) + got = foo(x) + self.assertEqual(got, expected) + + def test_branch_prune_and_bind_to_sig(self): + # see issue 9795 + @register_jitable + def f(x, y): + return x + y + + @njit + def call_f(x): + if isinstance(x, tuple): + return f(*x) + else: + return f(x) + + # The issue is that without isinstance and branch pruning working + # correctly, an attempt will be made to bind the function `f` with + # argument `x`. If `x` is a Tuple type, this will fail on the `else` + # branch as `f` takes two arguments opposed to one. + x = (1, 2) + self.assertEqual(call_f(x), call_f.py_func(x)) + + + # This should raise as partial type inference and branch pruning will + # remove the `f(*x)` branch and just leave `f(x)`, which then won't + # bind because `f` takes two arguments and only one is supplied. + with self.assertRaises(errors.TypingError) as raises: + call_f(1) + + msg = str(raises.exception) + self.assertIn("Cannot bind", msg) + self.assertIn("TypeError: missing a required argument: 'y'", msg) + + def test_branch_prune_non_tuples_as_star_arg(self): + + # see issue 9795 + @register_jitable + def f(x, y): + return x + y + + @register_jitable + def g(x): + return x + + @njit + def call_f(x): + if isinstance(x, tuple): + return f(*x) + else: + return g(x) + + # The issue is that without isinstance and branch pruning working + # correctly, an attempt will be made to bind the function `f` with + # argument `x`. If `x` is a non-tuple type `*x` will not bind to the + # signature of `f`. + x = 1 + self.assertEqual(call_f(x), call_f.py_func(x)) + + def test_branch_prune_literal_as_star_arg(self): + + # see issue 9795 + @register_jitable + def f(x, y): + return x + y + + @register_jitable + def g(x): + return x + + one = 1 + @njit + def call_f(): + x = one + if isinstance(x, tuple): + return f(*x) + else: + return g(x) + + # The issue is that without isinstance and branch pruning working + # correctly, an attempt will be made to bind the function `f` with + # argument `x`. If `x` is a non-tuple const value type `*x` will not + # bind to the signature of `f`. + self.assertEqual(call_f(), call_f.py_func()) + + +class TestGetattrBuiltin(MemoryLeakMixin, TestCase): + # Tests the getattr() builtin + + def test_getattr_func_retty(self): + + @njit + def foo(x): + attr = getattr(x, '__hash__') + return attr() + + for x in (1, 2.34, (5, 6, 7)): + self.assertPreciseEqual(foo(x), foo.py_func(x)) + + def test_getattr_value_retty(self): + + @njit + def foo(x): + return getattr(x, 'ndim') + + for x in range(3): + tmp = np.empty((1, ) * x) + self.assertPreciseEqual(foo(tmp), foo.py_func(tmp)) + + def test_getattr_module_obj(self): + # Consts on modules work ok + + @njit + def foo(): + return getattr(np, 'pi') + + self.assertPreciseEqual(foo(), foo.py_func()) + + def test_getattr_module_obj_not_implemented(self): + # Functions on modules do not work at present + + @njit + def foo(): + return getattr(np, 'cos')(1) + + with self.assertRaises(errors.TypingError) as raises: + foo() + + msg = "Returning function objects is not implemented" + self.assertIn(msg, str(raises.exception)) + + def test_getattr_raises_attribute_error(self): + + invalid_attr = '__not_a_valid_attr__' + + @njit + def foo(x): + return getattr(x, invalid_attr) + + with self.assertRaises(AttributeError) as raises: + foo(1.23) + + self.assertIn(f"'float64' has no attribute '{invalid_attr}'", + str(raises.exception)) + + def test_getattr_with_default(self): + # Checks returning a default works + + @njit + def foo(x, default): + return getattr(x, '__not_a_valid_attr__', default) + + for x, y in zip((1, 2.34, (5, 6, 7),), (None, 20, 'some_string')): + self.assertPreciseEqual(foo(x, y), foo.py_func(x, y)) + + def test_getattr_non_literal_str(self): + + @njit + def foo(x, nonliteral_str): + return getattr(x, nonliteral_str) + + with self.assertRaises(errors.TypingError) as raises: + foo(1, '__hash__') + + msg = "argument 'name' must be a literal string" + self.assertIn(msg, str(raises.exception)) + + def test_getattr_no_optional_type_generated(self): + + @njit + def default_hash(): + return 12345 + + @njit + def foo(): + hash_func = getattr(np.ones(1), "__not_a_valid_attr__", + default_hash) + return hash_func() # Optionals have no call support + + self.assertPreciseEqual(foo(), foo.py_func()) + + +class TestHasattrBuiltin(MemoryLeakMixin, TestCase): + # Tests the hasattr() builtin + + def test_hasattr(self): + + @njit + def foo(x): + return hasattr(x, '__hash__'), hasattr(x, '__not_a_valid_attr__') + + ty = types.int64 + for x in (1, 2.34, (5, 6, 7), typed.Dict.empty(ty, ty), + typed.List.empty_list(ty), np.ones(4), 'ABC'): + self.assertPreciseEqual(foo(x), foo.py_func(x)) + + def test_hasattr_non_const_attr(self): + # This tests that an error is raised in the case that a hasattr() call + # is made on an attribute that cannot be resolved as a compile time + # constant (there's a phi in the way!). + + @njit + def foo(pred): + if pred > 3: + attr = "__hash__" + else: + attr = "__str__" + + hasattr(1, attr) + + with self.assertRaises(errors.NumbaTypeError) as raises: + foo(6) + + msg = ('hasattr() cannot determine the type of variable ' + '"attr" due to a branch.') + self.assertIn(msg, str(raises.exception)) + + +class TestStrAndReprBuiltin(MemoryLeakMixin, TestCase): + + def test_str_default(self): + + @njit + def foo(): + return str() + + self.assertEqual(foo(), foo.py_func()) + + def test_str_object_kwarg(self): + + @njit + def foo(x): + return str(object=x) + + value = "a string" + self.assertEqual(foo(value), foo.py_func(value)) + + def test_str_calls_dunder_str(self): + + @njit + def foo(x): + return str(x) + + Dummy, DummyType = self.make_dummy_type() + dummy = Dummy() + string_repr = "this is the dummy object str" + Dummy.__str__= lambda inst: string_repr + + @overload_method(DummyType, "__str__") + def ol_dummy_string(dummy): + def impl(dummy): + return string_repr + return impl + + @overload_method(DummyType, "__repr__") + def ol_dummy_repr(dummy): + def impl(dummy): + return "SHOULD NOT BE CALLED" + return impl + + self.assertEqual(foo(dummy), foo.py_func(dummy)) + + def test_str_falls_back_to_repr(self): + + @njit + def foo(x): + return str(x) + + Dummy, DummyType = self.make_dummy_type() + dummy = Dummy() + string_repr = "this is the dummy object repr" + Dummy.__repr__= lambda inst: string_repr + + @overload_method(DummyType, "__repr__") + def ol_dummy_repr(dummy): + def impl(dummy): + return string_repr + return impl + + self.assertEqual(foo(dummy), foo.py_func(dummy)) + + def test_repr(self): + @njit + def foo(x): + return repr(x), x + + for x in ("abc", False, 123): + self.assertEqual(foo(x), foo.py_func(x)) + + def test_repr_fallback(self): + # checks str/repr fallback, there's no overloaded __str__ or __repr__ + # for the dummy type so it has to use generic '' + # string for the `repr` call. + + Dummy, DummyType = self.make_dummy_type() + dummy = Dummy() + string_repr = f"" + Dummy.__repr__= lambda inst: string_repr + + @box(DummyType) + def box_dummy(typ, obj, c): + clazobj = c.pyapi.unserialize(c.pyapi.serialize_object(Dummy)) + return c.pyapi.call_function_objargs(clazobj, ()) + + @njit + def foo(x): + return str(x) + + self.assertEqual(foo(dummy), foo.py_func(dummy)) + + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_byteflow.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_byteflow.py new file mode 100644 index 0000000000000000000000000000000000000000..041e1d65b20f7fcdc49857903748727cecc29a16 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_byteflow.py @@ -0,0 +1,94 @@ +""" +Test byteflow.py specific issues +""" +import unittest + +from numba.tests.support import TestCase +from numba.core.compiler import run_frontend + + +class TestByteFlowIssues(TestCase): + def test_issue_5087(self): + # This is an odd issue. The exact number of print below is + # necessary to trigger it. Too many or too few will alter the behavior. + # Also note that the function below will not be executed. The problem + # occurs at compilation. The definition below is invalid for execution. + # The problem occurs in the bytecode analysis. + def udt(): + print + print + print + + for i in range: + print + print + print + print + print + print + print + print + print + print + print + print + print + print + print + print + print + print + + for j in range: + print + print + print + print + print + print + print + for k in range: + for l in range: + print + + print + print + print + print + print + print + print + print + print + if print: + for n in range: + print + else: + print + + run_frontend(udt) + + def test_issue_5097(self): + # Inspired by https://github.com/numba/numba/issues/5097 + def udt(): + for i in range(0): + if i > 0: + pass + a = None # noqa: F841 + + run_frontend(udt) + + def test_issue_5680(self): + # From https://github.com/numba/numba/issues/5680#issuecomment-625351336 + def udt(): + for k in range(0): + if 1 == 1: + ... + if 'a' == 'a': + ... + + run_frontend(udt) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_caching.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_caching.py new file mode 100644 index 0000000000000000000000000000000000000000..57c8a4dcc591fe2ae58f9e5ae54d58f845d3ec19 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_caching.py @@ -0,0 +1,1166 @@ +import importlib +import inspect +import multiprocessing +import os +import shutil +import stat +import subprocess +import sys +import traceback +import unittest +import warnings +import zipfile +from pathlib import Path + +import llvmlite.binding as ll +import numpy as np + +from numba import njit +from numba.core import codegen +from numba.core.caching import _UserWideCacheLocator, _ZipCacheLocator +from numba.core.errors import NumbaWarning +from numba.parfors import parfor +from numba.tests.support import ( + SerialMixin, + TestCase, + capture_cache_log, + import_dynamic, + override_config, + run_in_new_process_caching, + skip_if_typeguard, + skip_parfors_unsupported, + temp_directory, +) + +try: + import ipykernel +except ImportError: + ipykernel = None + + +def check_access_is_preventable(): + # This exists to check whether it is possible to prevent access to + # a file/directory through the use of `chmod 500`. If a user has + # elevated rights (e.g. root) then writes are likely to be possible + # anyway. Tests that require functioning access prevention are + # therefore skipped based on the result of this check. + tempdir = temp_directory('test_cache') + test_dir = (os.path.join(tempdir, 'writable_test')) + os.mkdir(test_dir) + # check a write is possible + with open(os.path.join(test_dir, 'write_ok'), 'wt') as f: + f.write('check1') + # now forbid access + os.chmod(test_dir, 0o500) + try: + with open(os.path.join(test_dir, 'write_forbidden'), 'wt') as f: + f.write('check2') + # access prevention is not possible + return False + except PermissionError: + # Check that the cause of the exception is due to access/permission + # as per + # https://github.com/conda/conda/blob/4.5.0/conda/gateways/disk/permissions.py#L35-L37 # noqa: E501 + # errno reports access/perm fail so access prevention via + # `chmod 500` works for this user. + return True + finally: + os.chmod(test_dir, 0o775) + shutil.rmtree(test_dir) + + +_access_preventable = check_access_is_preventable() +_access_msg = "Cannot create a directory to which writes are preventable" +skip_bad_access = unittest.skipUnless(_access_preventable, _access_msg) + + +def constant_unicode_cache(): + c = "abcd" + return hash(c), c + + +def check_constant_unicode_cache(): + pyfunc = constant_unicode_cache + cfunc = njit(cache=True)(pyfunc) + exp_hv, exp_str = pyfunc() + got_hv, got_str = cfunc() + assert exp_hv == got_hv + assert exp_str == got_str + + +def dict_cache(): + return {'a': 1, 'b': 2} + + +def check_dict_cache(): + pyfunc = dict_cache + cfunc = njit(cache=True)(pyfunc) + exp = pyfunc() + got = cfunc() + assert exp == got + + +def generator_cache(): + for v in (1, 2, 3): + yield v + + +def check_generator_cache(): + pyfunc = generator_cache + cfunc = njit(cache=True)(pyfunc) + exp = list(pyfunc()) + got = list(cfunc()) + assert exp == got + + +class TestCaching(SerialMixin, TestCase): + def run_test(self, func): + func() + res = run_in_new_process_caching(func) + self.assertEqual(res['exitcode'], 0) + + def test_constant_unicode_cache(self): + self.run_test(check_constant_unicode_cache) + + def test_dict_cache(self): + self.run_test(check_dict_cache) + + def test_generator_cache(self): + self.run_test(check_generator_cache) + + def test_omitted(self): + + # Test in a new directory + cache_dir = temp_directory(self.__class__.__name__) + ctx = multiprocessing.get_context() + result_queue = ctx.Queue() + proc = ctx.Process( + target=omitted_child_test_wrapper, + args=(result_queue, cache_dir, False), + ) + proc.start() + proc.join() + success, output = result_queue.get() + + # Ensure the child process is completed before checking its output + if not success: + self.fail(output) + + self.assertEqual( + output, + 1000, + "Omitted function returned an incorrect output" + ) + + proc = ctx.Process( + target=omitted_child_test_wrapper, + args=(result_queue, cache_dir, True) + ) + proc.start() + proc.join() + success, output = result_queue.get() + + # Ensure the child process is completed before checking its output + if not success: + self.fail(output) + + self.assertEqual( + output, + 1000, + "Omitted function returned an incorrect output" + ) + + +def omitted_child_test_wrapper(result_queue, cache_dir, second_call): + with override_config("CACHE_DIR", cache_dir): + @njit(cache=True) + def test(num=1000): + return num + + try: + output = test() + # If we have a second call, we should have a cache hit. + # Otherwise, we expect a cache miss. + if second_call: + assert test._cache_hits[test.signatures[0]] == 1, \ + "Cache did not hit as expected" + assert test._cache_misses[test.signatures[0]] == 0, \ + "Cache has an unexpected miss" + else: + assert test._cache_misses[test.signatures[0]] == 1, \ + "Cache did not miss as expected" + assert test._cache_hits[test.signatures[0]] == 0, \ + "Cache has an unexpected hit" + success = True + # Catch anything raised so it can be propagated + except: # noqa: E722 + output = traceback.format_exc() + success = False + result_queue.put((success, output)) + + +class BaseCacheTest(TestCase): + # The source file that will be copied + usecases_file = None + # Make sure this doesn't conflict with another module + modname = None + + def setUp(self): + self.tempdir = temp_directory('test_cache') + sys.path.insert(0, self.tempdir) + self.modfile = os.path.join(self.tempdir, self.modname + ".py") + self.cache_dir = os.path.join(self.tempdir, "__pycache__") + shutil.copy(self.usecases_file, self.modfile) + os.chmod(self.modfile, stat.S_IREAD | stat.S_IWRITE) + self.maxDiff = None + + def tearDown(self): + sys.modules.pop(self.modname, None) + sys.path.remove(self.tempdir) + + def import_module(self): + # Import a fresh version of the test module. All jitted functions + # in the test module will start anew and load overloads from + # the on-disk cache if possible. + old = sys.modules.pop(self.modname, None) + if old is not None: + # Make sure cached bytecode is removed + cached = [old.__cached__] + for fn in cached: + try: + os.unlink(fn) + except FileNotFoundError: + pass + mod = import_dynamic(self.modname) + self.assertEqual(mod.__file__.rstrip('co'), self.modfile) + return mod + + def cache_contents(self): + try: + return [fn for fn in os.listdir(self.cache_dir) + if not fn.endswith(('.pyc', ".pyo"))] + except FileNotFoundError: + return [] + + def get_cache_mtimes(self): + return dict((fn, os.path.getmtime(os.path.join(self.cache_dir, fn))) + for fn in sorted(self.cache_contents())) + + def check_pycache(self, n): + c = self.cache_contents() + self.assertEqual(len(c), n, c) + + def dummy_test(self): + pass + + +class DispatcherCacheUsecasesTest(BaseCacheTest): + here = os.path.dirname(__file__) + usecases_file = os.path.join(here, "cache_usecases.py") + modname = "dispatcher_caching_test_fodder" + + def run_in_separate_process(self, *, envvars={}): + # Cached functions can be run from a distinct process. + # Also stresses issue #1603: uncached function calling cached function + # shouldn't fail compiling. + code = """if 1: + import sys + + sys.path.insert(0, %(tempdir)r) + mod = __import__(%(modname)r) + mod.self_test() + """ % dict(tempdir=self.tempdir, modname=self.modname) + + subp_env = os.environ.copy() + subp_env.update(envvars) + popen = subprocess.Popen([sys.executable, "-c", code], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + env=subp_env) + out, err = popen.communicate() + if popen.returncode != 0: + raise AssertionError( + "process failed with code %s: \n" + "stdout follows\n%s\n" + "stderr follows\n%s\n" + % (popen.returncode, out.decode(), err.decode()), + ) + + def check_hits(self, func, hits, misses=None): + st = func.stats + self.assertEqual(sum(st.cache_hits.values()), hits, st.cache_hits) + if misses is not None: + self.assertEqual(sum(st.cache_misses.values()), misses, + st.cache_misses) + + +class TestCache(DispatcherCacheUsecasesTest): + + def test_caching(self): + self.check_pycache(0) + mod = self.import_module() + self.check_pycache(0) + + f = mod.add_usecase + self.assertPreciseEqual(f(2, 3), 6) + self.check_pycache(2) # 1 index, 1 data + self.assertPreciseEqual(f(2.5, 3), 6.5) + self.check_pycache(3) # 1 index, 2 data + self.check_hits(f, 0, 2) + + f = mod.add_objmode_usecase + self.assertPreciseEqual(f(2, 3), 6) + self.check_pycache(5) # 2 index, 3 data + self.assertPreciseEqual(f(2.5, 3), 6.5) + self.check_pycache(6) # 2 index, 4 data + self.check_hits(f, 0, 2) + + f = mod.record_return + rec = f(mod.aligned_arr, 1) + self.assertPreciseEqual(tuple(rec), (2, 43.5)) + rec = f(mod.packed_arr, 1) + self.assertPreciseEqual(tuple(rec), (2, 43.5)) + self.check_pycache(9) # 3 index, 6 data + self.check_hits(f, 0, 2) + + # Check the code runs ok from another process + self.run_in_separate_process() + + def test_caching_nrt_pruned(self): + self.check_pycache(0) + mod = self.import_module() + self.check_pycache(0) + + f = mod.add_usecase + self.assertPreciseEqual(f(2, 3), 6) + self.check_pycache(2) # 1 index, 1 data + # NRT pruning may affect cache + self.assertPreciseEqual(f(2, np.arange(3)), 2 + np.arange(3) + 1) + self.check_pycache(3) # 1 index, 2 data + self.check_hits(f, 0, 2) + + def test_inner_then_outer(self): + # Caching inner then outer function is ok + mod = self.import_module() + self.assertPreciseEqual(mod.inner(3, 2), 6) + self.check_pycache(2) # 1 index, 1 data + # Uncached outer function shouldn't fail (issue #1603) + f = mod.outer_uncached + self.assertPreciseEqual(f(3, 2), 2) + self.check_pycache(2) # 1 index, 1 data + mod = self.import_module() + f = mod.outer_uncached + self.assertPreciseEqual(f(3, 2), 2) + self.check_pycache(2) # 1 index, 1 data + # Cached outer will create new cache entries + f = mod.outer + self.assertPreciseEqual(f(3, 2), 2) + self.check_pycache(4) # 2 index, 2 data + self.assertPreciseEqual(f(3.5, 2), 2.5) + self.check_pycache(6) # 2 index, 4 data + + def test_outer_then_inner(self): + # Caching outer then inner function is ok + mod = self.import_module() + self.assertPreciseEqual(mod.outer(3, 2), 2) + self.check_pycache(4) # 2 index, 2 data + self.assertPreciseEqual(mod.outer_uncached(3, 2), 2) + self.check_pycache(4) # same + mod = self.import_module() + f = mod.inner + self.assertPreciseEqual(f(3, 2), 6) + self.check_pycache(4) # same + self.assertPreciseEqual(f(3.5, 2), 6.5) + self.check_pycache(5) # 2 index, 3 data + + def test_no_caching(self): + mod = self.import_module() + + f = mod.add_nocache_usecase + self.assertPreciseEqual(f(2, 3), 6) + self.check_pycache(0) + + def test_looplifted(self): + # Loop-lifted functions can't be cached and raise a warning + mod = self.import_module() + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', NumbaWarning) + + f = mod.looplifted + self.assertPreciseEqual(f(4), 6) + self.check_pycache(0) + + self.assertEqual(len(w), 1) + self.assertIn('Cannot cache compiled function "looplifted" ' + 'as it uses lifted code', str(w[0].message)) + + def test_big_array(self): + # Code references big array globals cannot be cached + mod = self.import_module() + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', NumbaWarning) + + f = mod.use_big_array + np.testing.assert_equal(f(), mod.biggie) + self.check_pycache(0) + + self.assertEqual(len(w), 1) + self.assertIn('Cannot cache compiled function "use_big_array" ' + 'as it uses dynamic globals', str(w[0].message)) + + def test_ctypes(self): + # Functions using a ctypes pointer can't be cached and raise + # a warning. + mod = self.import_module() + + for f in [mod.use_c_sin, mod.use_c_sin_nest1, mod.use_c_sin_nest2]: + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', NumbaWarning) + + self.assertPreciseEqual(f(0.0), 0.0) + self.check_pycache(0) + + self.assertEqual(len(w), 1) + self.assertIn( + 'Cannot cache compiled function "{}"'.format(f.__name__), + str(w[0].message), + ) + + def test_closure(self): + mod = self.import_module() + + with warnings.catch_warnings(): + warnings.simplefilter('error', NumbaWarning) + + f = mod.closure1 + self.assertPreciseEqual(f(3), 6) # 3 + 3 = 6 + f = mod.closure2 + self.assertPreciseEqual(f(3), 8) # 3 + 5 = 8 + f = mod.closure3 + self.assertPreciseEqual(f(3), 10) # 3 + 7 = 10 + f = mod.closure4 + self.assertPreciseEqual(f(3), 12) # 3 + 9 = 12 + self.check_pycache(5) # 1 nbi, 4 nbc + + def test_first_class_function(self): + mod = self.import_module() + f = mod.first_class_function_usecase + self.assertEqual(f(mod.first_class_function_mul, 1), 1) + self.assertEqual(f(mod.first_class_function_mul, 10), 100) + self.assertEqual(f(mod.first_class_function_add, 1), 2) + self.assertEqual(f(mod.first_class_function_add, 10), 20) + # 1 + 1 + 1 nbi, 1 + 1 + 2 nbc - a separate cache for each call to `f` + # with a different callback. + self.check_pycache(7) + + def test_cache_reuse(self): + mod = self.import_module() + mod.add_usecase(2, 3) + mod.add_usecase(2.5, 3.5) + mod.add_objmode_usecase(2, 3) + mod.outer_uncached(2, 3) + mod.outer(2, 3) + mod.record_return(mod.packed_arr, 0) + mod.record_return(mod.aligned_arr, 1) + mtimes = self.get_cache_mtimes() + # Two signatures compiled + self.check_hits(mod.add_usecase, 0, 2) + + mod2 = self.import_module() + self.assertIsNot(mod, mod2) + f = mod2.add_usecase + f(2, 3) + self.check_hits(f, 1, 0) + f(2.5, 3.5) + self.check_hits(f, 2, 0) + f = mod2.add_objmode_usecase + f(2, 3) + self.check_hits(f, 1, 0) + + # The files haven't changed + self.assertEqual(self.get_cache_mtimes(), mtimes) + + self.run_in_separate_process() + self.assertEqual(self.get_cache_mtimes(), mtimes) + + def test_cache_invalidate(self): + mod = self.import_module() + f = mod.add_usecase + self.assertPreciseEqual(f(2, 3), 6) + + # This should change the functions' results + with open(self.modfile, "a") as f: + f.write("\nZ = 10\n") + + mod = self.import_module() + f = mod.add_usecase + self.assertPreciseEqual(f(2, 3), 15) + f = mod.add_objmode_usecase + self.assertPreciseEqual(f(2, 3), 15) + + def test_recompile(self): + # Explicit call to recompile() should overwrite the cache + mod = self.import_module() + f = mod.add_usecase + self.assertPreciseEqual(f(2, 3), 6) + + mod = self.import_module() + f = mod.add_usecase + mod.Z = 10 + self.assertPreciseEqual(f(2, 3), 6) + f.recompile() + self.assertPreciseEqual(f(2, 3), 15) + + # Freshly recompiled version is re-used from other imports + mod = self.import_module() + f = mod.add_usecase + self.assertPreciseEqual(f(2, 3), 15) + + def test_same_names(self): + # Function with the same names should still disambiguate + mod = self.import_module() + f = mod.renamed_function1 + self.assertPreciseEqual(f(2), 4) + f = mod.renamed_function2 + self.assertPreciseEqual(f(2), 8) + + def test_frozen(self): + from .dummy_module import function + old_code = function.__code__ + code_obj = compile('pass', 'tests/dummy_module.py', 'exec') + try: + function.__code__ = code_obj + + source = inspect.getfile(function) + # doesn't return anything, since it cannot find the module + # fails unless the executable is frozen + locator = _UserWideCacheLocator.from_function(function, source) + self.assertIsNone(locator) + + sys.frozen = True + # returns a cache locator object, only works when the executable + # is frozen + locator = _UserWideCacheLocator.from_function(function, source) + self.assertIsInstance(locator, _UserWideCacheLocator) + + finally: + function.__code__ = old_code + del sys.frozen + + def _test_pycache_fallback(self): + """ + With a disabled __pycache__, test there is a working fallback + (e.g. on the user-wide cache dir) + """ + mod = self.import_module() + f = mod.add_usecase + # Remove this function's cache files at the end, to avoid accumulation + # across test calls. + self.addCleanup(shutil.rmtree, f.stats.cache_path, ignore_errors=True) + + self.assertPreciseEqual(f(2, 3), 6) + # It's a cache miss since the file was copied to a new temp location + self.check_hits(f, 0, 1) + + # Test re-use + mod2 = self.import_module() + f = mod2.add_usecase + self.assertPreciseEqual(f(2, 3), 6) + self.check_hits(f, 1, 0) + + # The __pycache__ is empty (otherwise the test's preconditions + # wouldn't be met) + self.check_pycache(0) + + @skip_bad_access + @unittest.skipIf(os.name == "nt", + "cannot easily make a directory read-only on Windows") + def test_non_creatable_pycache(self): + # Make it impossible to create the __pycache__ directory + old_perms = os.stat(self.tempdir).st_mode + os.chmod(self.tempdir, 0o500) + self.addCleanup(os.chmod, self.tempdir, old_perms) + + self._test_pycache_fallback() + + @skip_bad_access + @unittest.skipIf(os.name == "nt", + "cannot easily make a directory read-only on Windows") + def test_non_writable_pycache(self): + # Make it impossible to write to the __pycache__ directory + pycache = os.path.join(self.tempdir, '__pycache__') + os.mkdir(pycache) + old_perms = os.stat(pycache).st_mode + os.chmod(pycache, 0o500) + self.addCleanup(os.chmod, pycache, old_perms) + + self._test_pycache_fallback() + + def test_ipython(self): + # Test caching in an IPython session + base_cmd = [sys.executable, '-m', 'IPython'] + base_cmd += ['--quiet', '--quick', '--no-banner', '--colors=NoColor'] + try: + ver = subprocess.check_output(base_cmd + ['--version']) + except subprocess.CalledProcessError as e: + self.skipTest("ipython not available: return code %d" + % e.returncode) + ver = ver.strip().decode() + # Create test input + inputfn = os.path.join(self.tempdir, "ipython_cache_usecase.txt") + with open(inputfn, "w") as f: + f.write(r""" + import os + import sys + + from numba import jit + + # IPython 5 does not support multiline input if stdin isn't + # a tty (https://github.com/ipython/ipython/issues/9752) + f = jit(cache=True)(lambda: 42) + + res = f() + # IPython writes on stdout, so use stderr instead + sys.stderr.write(u"cache hits = %d\n" % f.stats.cache_hits[()]) + + # IPython hijacks sys.exit(), bypass it + sys.stdout.flush() + sys.stderr.flush() + os._exit(res) + """) + + def execute_with_input(): + # Feed the test input as stdin, to execute it in REPL context + with open(inputfn, "rb") as stdin: + p = subprocess.Popen(base_cmd, stdin=stdin, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True) + out, err = p.communicate() + if p.returncode != 42: + self.fail("unexpected return code %d\n" + "-- stdout:\n%s\n" + "-- stderr:\n%s\n" + % (p.returncode, out, err)) + return err + + execute_with_input() + # Run a second time and check caching + err = execute_with_input() + self.assertIn("cache hits = 1", err.strip()) + + @unittest.skipIf((ipykernel is None) or (ipykernel.version_info[0] < 6), + "requires ipykernel >= 6") + def test_ipykernel(self): + # Test caching in an IPython session using ipykernel + + base_cmd = [sys.executable, '-m', 'IPython'] + base_cmd += ['--quiet', '--quick', '--no-banner', '--colors=NoColor'] + try: + ver = subprocess.check_output(base_cmd + ['--version']) + except subprocess.CalledProcessError as e: + self.skipTest("ipython not available: return code %d" + % e.returncode) + ver = ver.strip().decode() + # Create test input + from ipykernel import compiler + inputfn = compiler.get_tmp_directory() + with open(inputfn, "w") as f: + f.write(r""" + import os + import sys + + from numba import jit + + # IPython 5 does not support multiline input if stdin isn't + # a tty (https://github.com/ipython/ipython/issues/9752) + f = jit(cache=True)(lambda: 42) + + res = f() + # IPython writes on stdout, so use stderr instead + sys.stderr.write(u"cache hits = %d\n" % f.stats.cache_hits[()]) + + # IPython hijacks sys.exit(), bypass it + sys.stdout.flush() + sys.stderr.flush() + os._exit(res) + """) + + def execute_with_input(): + # Feed the test input as stdin, to execute it in REPL context + with open(inputfn, "rb") as stdin: + p = subprocess.Popen(base_cmd, stdin=stdin, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True) + out, err = p.communicate() + if p.returncode != 42: + self.fail("unexpected return code %d\n" + "-- stdout:\n%s\n" + "-- stderr:\n%s\n" + % (p.returncode, out, err)) + return err + + execute_with_input() + # Run a second time and check caching + err = execute_with_input() + self.assertIn("cache hits = 1", err.strip()) + + +class TestCacheZip(DispatcherCacheUsecasesTest): + + def setUp(self): + super().setUp() + + # Create a simple Python module to be zipped + mod_content = """ +from numba import jit + +@jit(cache=True) +def add(x, y): + return x + y +""" + mod_filename = "test_module.py" + zip_filename = "test_archive.zip" + + # Create a zip file containing the module + zip_path = os.path.join(self.tempdir, zip_filename) + with zipfile.ZipFile(zip_path, "w") as zf: + zf.writestr(mod_filename, mod_content) + + # Add the zip file to sys.path + sys.path.insert(0, zip_path) + self.modname = "test_module" + + def tearDown(self): + # Clean up: remove the zip file from sys.path + sys.path.pop(0) + # Remove the module from sys.modules to clean up + sys.modules.pop("test_module", None) + + def test_zip_caching(self): + # (note that `self.import_module()` fails because its checks are + # incompatible + # with the zip file, so we just use normal imports here) + + # First import and call + import test_module # type: ignore + + result1 = test_module.add(2, 3) + self.assertEqual(result1, 5) + self.check_hits(test_module.add, 0, 1) + + # Record the initial cache hits + self.check_hits(test_module.add, 0) + + # Remove the module and reimport + del sys.modules["test_module"] + importlib.invalidate_caches() + import test_module # type: ignore + + # Second call: should use the cache + result2 = test_module.add(2, 3) + self.assertEqual(result2, 5) + + # Check if the cache was hit + self.check_hits(test_module.add, 1) + + +class TestCacheZipLib(DispatcherCacheUsecasesTest): + """ + ZipCache tests that don't require the setup/teardown from `TestCacheZip` + """ + def test_zip_locator_creation(self): + + def mock_func(): + pass + + zip_path = "/path/to/archive.zip/module.py" + + locator = _ZipCacheLocator.from_function(mock_func, zip_path) + self.assertIsNotNone(locator) + self.assertEqual(locator._zip_path, str(Path("/path/to/archive.zip"))) + self.assertEqual(locator._internal_path, "module.py") + + def test_zip_locator_non_zip_path(self): + + def mock_func(): + pass + + non_zip_path = "/path/to/module.py" + + locator = _ZipCacheLocator.from_function(mock_func, non_zip_path) + self.assertIsNone(locator) + + +@skip_parfors_unsupported +class TestSequentialParForsCache(DispatcherCacheUsecasesTest): + def setUp(self): + super(TestSequentialParForsCache, self).setUp() + # Turn on sequential parfor lowering + parfor.sequential_parfor_lowering = True + + def tearDown(self): + super(TestSequentialParForsCache, self).tearDown() + # Turn off sequential parfor lowering + parfor.sequential_parfor_lowering = False + + def test_caching(self): + mod = self.import_module() + self.check_pycache(0) + f = mod.parfor_usecase + ary = np.ones(10) + self.assertPreciseEqual(f(ary), ary * ary + ary) + dynamic_globals = [cres.library.has_dynamic_globals + for cres in f.overloads.values()] + self.assertEqual(dynamic_globals, [False]) + self.check_pycache(2) # 1 index, 1 data + + +class TestCacheWithCpuSetting(DispatcherCacheUsecasesTest): + # Disable parallel testing due to envvars modification + _numba_parallel_test_ = False + + def check_later_mtimes(self, mtimes_old): + match_count = 0 + for k, v in self.get_cache_mtimes().items(): + if k in mtimes_old: + self.assertGreaterEqual(v, mtimes_old[k]) + match_count += 1 + self.assertGreater(match_count, 0, + msg='nothing to compare') + + def test_user_set_cpu_name(self): + self.check_pycache(0) + mod = self.import_module() + mod.self_test() + cache_size = len(self.cache_contents()) + + mtimes = self.get_cache_mtimes() + # Change CPU name to generic + self.run_in_separate_process(envvars={'NUMBA_CPU_NAME': 'generic'}) + + self.check_later_mtimes(mtimes) + self.assertGreater(len(self.cache_contents()), cache_size) + # Check cache index + cache = mod.add_usecase._cache + cache_file = cache._cache_file + cache_index = cache_file._load_index() + self.assertEqual(len(cache_index), 2) + [key_a, key_b] = cache_index.keys() + if key_a[1][1] == ll.get_host_cpu_name(): + key_host, key_generic = key_a, key_b + else: + key_host, key_generic = key_b, key_a + self.assertEqual(key_host[1][1], ll.get_host_cpu_name()) + self.assertEqual(key_host[1][2], codegen.get_host_cpu_features()) + self.assertEqual(key_generic[1][1], 'generic') + self.assertEqual(key_generic[1][2], '') + + def test_user_set_cpu_features(self): + self.check_pycache(0) + mod = self.import_module() + mod.self_test() + cache_size = len(self.cache_contents()) + + mtimes = self.get_cache_mtimes() + # Change CPU feature + my_cpu_features = '-sse;-avx' + + system_features = codegen.get_host_cpu_features() + + self.assertNotEqual(system_features, my_cpu_features) + self.run_in_separate_process( + envvars={'NUMBA_CPU_FEATURES': my_cpu_features}, + ) + self.check_later_mtimes(mtimes) + self.assertGreater(len(self.cache_contents()), cache_size) + # Check cache index + cache = mod.add_usecase._cache + cache_file = cache._cache_file + cache_index = cache_file._load_index() + self.assertEqual(len(cache_index), 2) + [key_a, key_b] = cache_index.keys() + + if key_a[1][2] == system_features: + key_host, key_generic = key_a, key_b + else: + key_host, key_generic = key_b, key_a + + self.assertEqual(key_host[1][1], ll.get_host_cpu_name()) + self.assertEqual(key_host[1][2], system_features) + self.assertEqual(key_generic[1][1], ll.get_host_cpu_name()) + self.assertEqual(key_generic[1][2], my_cpu_features) + + +class TestMultiprocessCache(BaseCacheTest): + + # Nested multiprocessing.Pool raises AssertionError: + # "daemonic processes are not allowed to have children" + _numba_parallel_test_ = False + + here = os.path.dirname(__file__) + usecases_file = os.path.join(here, "cache_usecases.py") + modname = "dispatcher_caching_test_fodder" + + def test_multiprocessing(self): + # Check caching works from multiple processes at once (#2028) + mod = self.import_module() + # Calling a pure Python caller of the JIT-compiled function is + # necessary to reproduce the issue. + f = mod.simple_usecase_caller + n = 3 + try: + ctx = multiprocessing.get_context('spawn') + except AttributeError: + ctx = multiprocessing + pool = ctx.Pool(n) + try: + res = sum(pool.imap(f, range(n))) + finally: + pool.close() + self.assertEqual(res, n * (n - 1) // 2) + + +@skip_if_typeguard +class TestCacheFileCollision(unittest.TestCase): + _numba_parallel_test_ = False + + here = os.path.dirname(__file__) + usecases_file = os.path.join(here, "cache_usecases.py") + modname = "caching_file_loc_fodder" + source_text_1 = """ +from numba import njit +@njit(cache=True) +def bar(): + return 123 +""" + source_text_2 = """ +from numba import njit +@njit(cache=True) +def bar(): + return 321 +""" + + def setUp(self): + self.tempdir = temp_directory('test_cache_file_loc') + sys.path.insert(0, self.tempdir) + self.modname = 'module_name_that_is_unlikely' + self.assertNotIn(self.modname, sys.modules) + self.modname_bar1 = self.modname + self.modname_bar2 = '.'.join([self.modname, 'foo']) + foomod = os.path.join(self.tempdir, self.modname) + os.mkdir(foomod) + with open(os.path.join(foomod, '__init__.py'), 'w') as fout: + print(self.source_text_1, file=fout) + with open(os.path.join(foomod, 'foo.py'), 'w') as fout: + print(self.source_text_2, file=fout) + + def tearDown(self): + sys.modules.pop(self.modname_bar1, None) + sys.modules.pop(self.modname_bar2, None) + sys.path.remove(self.tempdir) + + def import_bar1(self): + return import_dynamic(self.modname_bar1).bar + + def import_bar2(self): + return import_dynamic(self.modname_bar2).bar + + def test_file_location(self): + bar1 = self.import_bar1() + bar2 = self.import_bar2() + # Check that the cache file is named correctly + idxname1 = bar1._cache._cache_file._index_name + idxname2 = bar2._cache._cache_file._index_name + self.assertNotEqual(idxname1, idxname2) + self.assertTrue(idxname1.startswith("__init__.bar-3.py")) + self.assertTrue(idxname2.startswith("foo.bar-3.py")) + + @unittest.skipUnless(hasattr(multiprocessing, 'get_context'), + 'Test requires multiprocessing.get_context') + def test_no_collision(self): + bar1 = self.import_bar1() + bar2 = self.import_bar2() + with capture_cache_log() as buf: + res1 = bar1() + cachelog = buf.getvalue() + # bar1 should save new index and data + self.assertEqual(cachelog.count('index saved'), 1) + self.assertEqual(cachelog.count('data saved'), 1) + self.assertEqual(cachelog.count('index loaded'), 0) + self.assertEqual(cachelog.count('data loaded'), 0) + with capture_cache_log() as buf: + res2 = bar2() + cachelog = buf.getvalue() + # bar2 should save new index and data + self.assertEqual(cachelog.count('index saved'), 1) + self.assertEqual(cachelog.count('data saved'), 1) + self.assertEqual(cachelog.count('index loaded'), 0) + self.assertEqual(cachelog.count('data loaded'), 0) + self.assertNotEqual(res1, res2) + + try: + # Make sure we can spawn new process without inheriting + # the parent context. + mp = multiprocessing.get_context('spawn') + except ValueError: + print("missing spawn context") + + q = mp.Queue() + # Start new process that calls `cache_file_collision_tester` + proc = mp.Process(target=cache_file_collision_tester, + args=(q, self.tempdir, + self.modname_bar1, + self.modname_bar2)) + proc.start() + # Get results from the process + log1 = q.get() + got1 = q.get() + log2 = q.get() + got2 = q.get() + proc.join() + + # The remote execution result of bar1() and bar2() should match + # the one executed locally. + self.assertEqual(got1, res1) + self.assertEqual(got2, res2) + + # The remote should have loaded bar1 from cache + self.assertEqual(log1.count('index saved'), 0) + self.assertEqual(log1.count('data saved'), 0) + self.assertEqual(log1.count('index loaded'), 1) + self.assertEqual(log1.count('data loaded'), 1) + + # The remote should have loaded bar2 from cache + self.assertEqual(log2.count('index saved'), 0) + self.assertEqual(log2.count('data saved'), 0) + self.assertEqual(log2.count('index loaded'), 1) + self.assertEqual(log2.count('data loaded'), 1) + + +def cache_file_collision_tester(q, tempdir, modname_bar1, modname_bar2): + sys.path.insert(0, tempdir) + bar1 = import_dynamic(modname_bar1).bar + bar2 = import_dynamic(modname_bar2).bar + with capture_cache_log() as buf: + r1 = bar1() + q.put(buf.getvalue()) + q.put(r1) + with capture_cache_log() as buf: + r2 = bar2() + q.put(buf.getvalue()) + q.put(r2) + + +class TestCacheMultipleFilesWithSignature(unittest.TestCase): + # Regression test for https://github.com/numba/numba/issues/3658 + + _numba_parallel_test_ = False + + source_text_file1 = """ +from file2 import function2 +""" + source_text_file2 = """ +from numba import njit + +@njit('float64(float64)', cache=True) +def function1(x): + return x + +@njit('float64(float64)', cache=True) +def function2(x): + return x +""" + + def setUp(self): + self.tempdir = temp_directory('test_cache_file_loc') + + self.file1 = os.path.join(self.tempdir, 'file1.py') + with open(self.file1, 'w') as fout: + print(self.source_text_file1, file=fout) + + self.file2 = os.path.join(self.tempdir, 'file2.py') + with open(self.file2, 'w') as fout: + print(self.source_text_file2, file=fout) + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def test_caching_mutliple_files_with_signature(self): + # Execute file1.py + popen = subprocess.Popen([sys.executable, self.file1], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + out, err = popen.communicate() + msg = f"stdout:\n{out.decode()}\n\nstderr:\n{err.decode()}" + self.assertEqual(popen.returncode, 0, msg=msg) + + # Execute file2.py + popen = subprocess.Popen([sys.executable, self.file2], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + out, err = popen.communicate() + msg = f"stdout:\n{out.decode()}\n\nstderr:\n{err.decode()}" + self.assertEqual(popen.returncode, 0, msg) + + +class TestCFuncCache(BaseCacheTest): + + here = os.path.dirname(__file__) + usecases_file = os.path.join(here, "cfunc_cache_usecases.py") + modname = "cfunc_caching_test_fodder" + + def run_in_separate_process(self): + # Cached functions can be run from a distinct process. + code = """if 1: + import sys + + sys.path.insert(0, %(tempdir)r) + mod = __import__(%(modname)r) + mod.self_test() + + f = mod.add_usecase + assert f.cache_hits == 1 + f = mod.outer + assert f.cache_hits == 1 + f = mod.div_usecase + assert f.cache_hits == 1 + """ % dict(tempdir=self.tempdir, modname=self.modname) + + popen = subprocess.Popen([sys.executable, "-c", code], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = popen.communicate() + if popen.returncode != 0: + raise AssertionError(f"process failed with code {popen.returncode}:" + f"stderr follows\n{err.decode()}\n") + + def check_module(self, mod): + mod.self_test() + + def test_caching(self): + self.check_pycache(0) + mod = self.import_module() + self.check_pycache(6) # 3 index, 3 data + + self.assertEqual(mod.add_usecase.cache_hits, 0) + self.assertEqual(mod.outer.cache_hits, 0) + self.assertEqual(mod.add_nocache_usecase.cache_hits, 0) + self.assertEqual(mod.div_usecase.cache_hits, 0) + self.check_module(mod) + + # Reload module to hit the cache + mod = self.import_module() + self.check_pycache(6) # 3 index, 3 data + + self.assertEqual(mod.add_usecase.cache_hits, 1) + self.assertEqual(mod.outer.cache_hits, 1) + self.assertEqual(mod.add_nocache_usecase.cache_hits, 0) + self.assertEqual(mod.div_usecase.cache_hits, 1) + self.check_module(mod) + + self.run_in_separate_process() + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_casting.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_casting.py new file mode 100644 index 0000000000000000000000000000000000000000..bd1225347e4ada483861317c8d8c3b406b03837d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_casting.py @@ -0,0 +1,137 @@ +import numpy as np +from numba.core.errors import TypingError +from numba import njit +from numba.core import types +import struct +import unittest + + +def float_to_int(x): + return types.int32(x) + + +def int_to_float(x): + return types.float64(x) / 2 + + +def float_to_unsigned(x): + return types.uint32(x) + + +def float_to_complex(x): + return types.complex128(x) + + +def numpy_scalar_cast_error(): + np.int32(np.zeros((4,))) + +class TestCasting(unittest.TestCase): + def test_float_to_int(self): + pyfunc = float_to_int + cfunc = njit((types.float32,))(pyfunc) + + self.assertEqual(cfunc.nopython_signatures[0].return_type, types.int32) + self.assertEqual(cfunc(12.3), pyfunc(12.3)) + self.assertEqual(cfunc(12.3), int(12.3)) + self.assertEqual(cfunc(-12.3), pyfunc(-12.3)) + self.assertEqual(cfunc(-12.3), int(-12.3)) + + def test_int_to_float(self): + pyfunc = int_to_float + cfunc = njit((types.int64,))(pyfunc) + + self.assertEqual(cfunc.nopython_signatures[0].return_type, + types.float64) + self.assertEqual(cfunc(321), pyfunc(321)) + self.assertEqual(cfunc(321), 321. / 2) + + def test_float_to_unsigned(self): + pyfunc = float_to_unsigned + cfunc = njit((types.float32,))(pyfunc) + + self.assertEqual(cfunc.nopython_signatures[0].return_type, types.uint32) + self.assertEqual(cfunc(3.21), pyfunc(3.21)) + self.assertEqual(cfunc(3.21), struct.unpack('I', struct.pack('i', + 3))[0]) + + def test_float_to_complex(self): + pyfunc = float_to_complex + cfunc = njit((types.float64,))(pyfunc) + self.assertEqual(cfunc.nopython_signatures[0].return_type, + types.complex128) + self.assertEqual(cfunc(-3.21), pyfunc(-3.21)) + self.assertEqual(cfunc(-3.21), -3.21 + 0j) + + def test_array_to_array(self): + """Make sure this compiles. + + Cast C to A array + """ + @njit("f8(f8[:])") + def inner(x): + return x[0] + + inner.disable_compile() + + @njit("f8(f8[::1])") + def driver(x): + return inner(x) + + x = np.array([1234], dtype=np.float64) + self.assertEqual(driver(x), x[0]) + self.assertEqual(len(inner.overloads), 1) + + def test_0darrayT_to_T(self): + @njit + def inner(x): + return x.dtype.type(x) + + inputs = [ + (np.bool_, True), + (np.float32, 12.3), + (np.float64, 12.3), + (np.int64, 12), + (np.complex64, 2j+3), + (np.complex128, 2j+3), + (np.timedelta64, np.timedelta64(3, 'h')), + (np.datetime64, np.datetime64('2016-01-01')), + (' 3 else y for y in x] + return z + + def list25(x): + # See issue #6260. Old style inline_closure_call uses get_ir_of_code + # for the closure->IR transform, without SSA there's multiply + # defined labels, the unary negation is self referent and DCE runs + # eliminating the duplicated labels. + included = np.array([1, 2, 6, 8]) + not_included = [i for i in range(10) if i not in list(included)] + return not_included + + # functions to test that are expected to pass + f = [list1, list2, list3, list4, + list6, list7, list8, list9, list10, list11, + list12, list13, list14, list15, + list16, list17, list18, list19, list20, + list21, list22, list23, list24, list25] + + var = [1, 2, 3, 4, 5] + for ref in f: + try: + cfunc = jit(nopython=True)(ref) + self.assertEqual(cfunc(var), ref(var)) + except ValueError: # likely np array returned + try: + np.testing.assert_allclose(cfunc(var), ref(var)) + except Exception: + raise + + # test functions that are expected to fail + with self.assertRaises(TypingError) as raises: + cfunc = jit(nopython=True)(list5) + cfunc(var) + # TODO: we can't really assert the error message for the above + # Also, test_nested_array is a similar case (but without list) that works. + + if sys.maxsize > 2 ** 32: + bits = 64 + else: + bits = 32 + + def test_objmode_inlining(self): + def objmode_func(y): + z = object() + inlined = [x for x in y] + return inlined + + cfunc = jit(forceobj=True)(objmode_func) + t = [1, 2, 3] + expected = objmode_func(t) + got = cfunc(t) + self.assertPreciseEqual(expected, got) + + +class TestArrayComprehension(unittest.TestCase): + + _numba_parallel_test_ = False + + def check(self, pyfunc, *args, **kwargs): + """A generic check function that run both pyfunc, and jitted pyfunc, + and compare results.""" + run_parallel = kwargs.get('run_parallel', False) + assert_allocate_list = kwargs.get('assert_allocate_list', False) + assert_dtype = kwargs.get('assert_dtype', False) + cfunc = jit(nopython=True,parallel=run_parallel)(pyfunc) + pyres = pyfunc(*args) + cres = cfunc(*args) + np.testing.assert_array_equal(pyres, cres) + if assert_dtype: + self.assertEqual(cres[1].dtype, assert_dtype) + if assert_allocate_list: + self.assertIn('allocate list', cfunc.inspect_llvm(cfunc.signatures[0])) + else: + self.assertNotIn('allocate list', cfunc.inspect_llvm(cfunc.signatures[0])) + if run_parallel: + self.assertIn('@do_scheduling', cfunc.inspect_llvm(cfunc.signatures[0])) + + def test_comp_with_array_1(self): + def comp_with_array_1(n): + m = n * 2 + l = np.array([i + m for i in range(n)]) + return l + + self.check(comp_with_array_1, 5) + if PARALLEL_SUPPORTED: + self.check(comp_with_array_1, 5, run_parallel=True) + + def test_comp_with_array_2(self): + def comp_with_array_2(n, threshold): + A = np.arange(-n, n) + return np.array([ x * x if x < threshold else x * 2 for x in A ]) + + self.check(comp_with_array_2, 5, 0) + + def test_comp_with_array_noinline(self): + def comp_with_array_noinline(n): + m = n * 2 + l = np.array([i + m for i in range(n)]) + return l + + import numba.core.inline_closurecall as ic + try: + ic.enable_inline_arraycall = False + self.check(comp_with_array_noinline, 5, assert_allocate_list=True) + finally: + ic.enable_inline_arraycall = True + + def test_comp_with_array_noinline_issue_6053(self): + def comp_with_array_noinline(n): + lst = [0] + for i in range(n): + lst.append(i) + l = np.array(lst) + return l + + self.check(comp_with_array_noinline, 5, assert_allocate_list=True) + + def test_comp_nest_with_array(self): + def comp_nest_with_array(n): + l = np.array([[i * j for j in range(n)] for i in range(n)]) + return l + + self.check(comp_nest_with_array, 5) + if PARALLEL_SUPPORTED: + self.check(comp_nest_with_array, 5, run_parallel=True) + + def test_comp_nest_with_array_3(self): + def comp_nest_with_array_3(n): + l = np.array([[[i * j * k for k in range(n)] for j in range(n)] for i in range(n)]) + return l + + self.check(comp_nest_with_array_3, 5) + if PARALLEL_SUPPORTED: + self.check(comp_nest_with_array_3, 5, run_parallel=True) + + def test_comp_nest_with_array_noinline(self): + def comp_nest_with_array_noinline(n): + l = np.array([[i * j for j in range(n)] for i in range(n)]) + return l + + import numba.core.inline_closurecall as ic + try: + ic.enable_inline_arraycall = False + self.check(comp_nest_with_array_noinline, 5, + assert_allocate_list=True) + finally: + ic.enable_inline_arraycall = True + + def test_comp_with_array_range(self): + def comp_with_array_range(m, n): + l = np.array([i for i in range(m, n)]) + return l + + self.check(comp_with_array_range, 5, 10) + + def test_comp_with_array_range_and_step(self): + def comp_with_array_range_and_step(m, n): + l = np.array([i for i in range(m, n, 2)]) + return l + + self.check(comp_with_array_range_and_step, 5, 10) + + def test_comp_with_array_conditional(self): + def comp_with_array_conditional(n): + l = np.array([i for i in range(n) if i % 2 == 1]) + return l + # arraycall inline would not happen when conditional is present + self.check(comp_with_array_conditional, 10, assert_allocate_list=True) + + def test_comp_nest_with_array_conditional(self): + def comp_nest_with_array_conditional(n): + l = np.array([[i * j for j in range(n)] for i in range(n) if i % 2 == 1]) + return l + self.check(comp_nest_with_array_conditional, 5, + assert_allocate_list=True) + + def test_comp_unsupported_iter(self): + def comp_unsupported_iter(): + val = zip([1, 2, 3], [4, 5, 6]) + return np.array([a for a, b in val]) + with self.assertRaises(TypingError) as raises: + self.check(comp_unsupported_iter) + self.assertIn(_header_lead, str(raises.exception)) + self.assertIn('Unsupported iterator found in array comprehension', + str(raises.exception)) + + def test_no_array_comp(self): + def no_array_comp1(n): + l = [1,2,3,4] + a = np.array(l) + return a + # const 1D array is actually inlined + self.check(no_array_comp1, 10, assert_allocate_list=False) + def no_array_comp2(n): + l = [1,2,3,4] + a = np.array(l) + l.append(5) + return a + self.check(no_array_comp2, 10, assert_allocate_list=True) + + def test_nested_array(self): + def nested_array(n): + l = np.array([ np.array([x for x in range(n)]) for y in range(n)]) + return l + + self.check(nested_array, 10) + + def test_nested_array_with_const(self): + def nested_array(n): + l = np.array([ np.array([x for x in range(3)]) for y in range(4)]) + return l + + self.check(nested_array, 0) + + def test_array_comp_with_iter(self): + def array_comp(a): + l = np.array([ x * x for x in a ]) + return l + # with list iterator + l = [1,2,3,4,5] + self.check(array_comp, l) + # with array iterator + self.check(array_comp, np.array(l)) + # with tuple iterator (issue #7394) + self.check(array_comp, tuple(l)) + # with typed.List iterator (issue #6550) + self.check(array_comp, typed.List(l)) + + def test_array_comp_with_dtype(self): + def array_comp(n): + l = np.array([i for i in range(n)], dtype=np.complex64) + return l + + self.check(array_comp, 10, assert_dtype=np.complex64) + + def test_array_comp_inferred_dtype(self): + def array_comp(n): + l = np.array([i * 1j for i in range(n)]) + return l + + self.check(array_comp, 10) + + def test_array_comp_inferred_dtype_nested(self): + def array_comp(n): + l = np.array([[i * j for j in range(n)] for i in range(n)]) + return l + + self.check(array_comp, 10) + + def test_array_comp_inferred_dtype_nested_sum(self): + def array_comp(n): + l = np.array([[i * j for j in range(n)] for i in range(n)]) + # checks that operations on the inferred array + return l + + self.check(array_comp, 10) + + def test_array_comp_inferred_dtype_outside_setitem(self): + def array_comp(n, v): + arr = np.array([i for i in range(n)]) + # the following should not change the dtype + arr[0] = v + return arr + + # float to int cast is valid + v = 1.2 + self.check(array_comp, 10, v, assert_dtype=np.intp) + # complex to int cast is invalid + with self.assertRaises(TypingError) as raises: + cfunc = jit(nopython=True)(array_comp) + cfunc(10, 2.3j) + self.assertIn( + _header_lead + " Function({})".format(operator.setitem), + str(raises.exception), + ) + self.assertIn( + "(array({}, 1d, C), Literal[int](0), complex128)".format(types.intp), + str(raises.exception), + ) + + def test_array_comp_shuffle_sideeffect(self): + nelem = 100 + + @jit(nopython=True) + def foo(): + numbers = np.array([i for i in range(nelem)]) + np.random.shuffle(numbers) + print(numbers) + + with captured_stdout() as gotbuf: + foo() + got = gotbuf.getvalue().strip() + + with captured_stdout() as expectbuf: + print(np.array([i for i in range(nelem)])) + expect = expectbuf.getvalue().strip() + + # For a large enough array, the chances of shuffle to not move any + # element is tiny enough. + self.assertNotEqual(got, expect) + self.assertRegex(got, r'\[(\s*\d+)+\]') + + def test_empty_list_not_removed(self): + # see issue #3724 + def f(x): + t = [] + myList = np.array([1]) + a = np.random.choice(myList, 1) + t.append(x + a) + return a + self.check(f, 5, assert_allocate_list=True) + + def test_reuse_of_array_var(self): + """ Test issue 3742 """ + # redefinition of z breaks array comp as there's multiple defn + def foo(n): + # doesn't matter where this is in the code, it's just to ensure a + # `make_function` opcode exists + [i for i in range(1)] + z = np.empty(n) + for i in range(n): + z = np.zeros(n) + z[i] = i # write is required to trip the bug + + return z + + self.check(foo, 10, assert_allocate_list=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_conditions_as_predicates.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_conditions_as_predicates.py new file mode 100644 index 0000000000000000000000000000000000000000..030b48a04ac1df7689ce3b8b9fd64cfc441a426c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_conditions_as_predicates.py @@ -0,0 +1,200 @@ +from numba.tests.support import TestCase, numpy_support +from numba import njit, types +from numba.typed import List, Dict +import numpy as np + + +class TestConditionsAsPredicates(TestCase): + + def test_scalars(self): + # checks that scalar types can be used as predicates + dts = [np.int8, np.uint16, np.int64, np.float32, np.float64, + np.complex128, int, float, complex, str, bool] + for dt in dts: + for c in 1, 0: + x = dt(c) + + @njit + def foo(): + if x: + return 10 + else: + return 20 + self.assertEqual(foo(), foo.py_func()) + self.assertEqual(foo(), 10 if c == 1 or dt is str else 20) + + # empty string + @njit + def foo(x): + if x: + return 10 + else: + return 20 + s = "" + self.assertEqual(foo(s), foo.py_func(s)) + + def test_typed_list(self): + @njit + def foo(x): + if x: + return 10 + else: + return 20 + + # empty list + z = List.empty_list(types.int64) + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 20) + + # non-empty list + z.append(1) + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 10) + + def test_reflected_list(self): + # non-empty + @njit + def foo(x): + if x: + return 10 + else: + return 20 + + z = [1] + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 10) + + # non-empty local + @njit + def foo(): + y = [1, 2] + if y: + return 10 + else: + return 20 + + self.assertEqual(foo(), foo.py_func()) + self.assertEqual(foo.py_func(), 10) + + # empty local + @njit + def foo(): + y = [1, 2] + y.pop() + y.pop() + assert len(y) == 0 + if y: + return 10 + else: + return 20 + + self.assertEqual(foo(), foo.py_func()) + self.assertEqual(foo.py_func(), 20) + + def test_reflected_set(self): + # non-empty + @njit + def foo(x): + if x: + return 10 + else: + return 20 + + z = {1} + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 10) + + # non-empty local + @njit + def foo(): + y = {1, 2} + if y: + return 10 + else: + return 20 + + self.assertEqual(foo(), foo.py_func()) + self.assertEqual(foo.py_func(), 10) + + # empty local + @njit + def foo(): + y = {1, 2} + y.pop() + y.pop() + assert len(y) == 0 + if y: + return 10 + else: + return 20 + + self.assertEqual(foo(), foo.py_func()) + self.assertEqual(foo.py_func(), 20) + + def test_typed_dict(self): + @njit + def foo(x): + if x: + return 10 + else: + return 20 + + # empty + z = Dict.empty(types.int64, types.int64) + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 20) + + # non-empty + z[2] = 3 + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 10) + + def test_arrays(self): + @njit + def foo(x): + if x: + return 10 + else: + return 20 + + # non-empty 0d, True + z = np.array(1) + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 10) + + # non-empty 0d, False + z = np.array(0) + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 20) + # non-empty nd True + z = np.array([[[1]]]) + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 10) + + # non-empty nd False + z = np.array([[[0]]]) + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 20) + + # various problems: + + # empty, NumPy warns or raises if NumPy >= 2.2 + z = np.empty(0) + if numpy_support.numpy_version >= (2, 2): + with self.assertRaises(ValueError) as raises: + foo(z) + msg = ("The truth value of an empty array is ambiguous." + " Use `array.size > 0` to check that an array is not empty.") + self.assertIn(msg, str(raises.exception)) + else: + self.assertEqual(foo(z), foo.py_func(z)) + self.assertEqual(foo.py_func(z), 20) + + # nd, NumPy raises + z = np.array([1, 2]) + with self.assertRaises(ValueError) as raises: + foo(z) + + msg = ("The truth value of an array with more than one element " + "is ambiguous. Use a.any() or a.all()") + self.assertIn(msg, str(raises.exception)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_config.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_config.py new file mode 100644 index 0000000000000000000000000000000000000000..d4efb07a9d9f77bad5c4f2428d361f24cae011c3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_config.py @@ -0,0 +1,218 @@ +import os +import tempfile +from textwrap import dedent +import unittest +from unittest import mock +from numba.tests.support import (TestCase, temp_directory, override_env_config, + run_in_subprocess) +from numba.core import config + +try: + import yaml + _HAVE_YAML = True +except ImportError: + _HAVE_YAML = False + +_skip_msg = "pyyaml needed for configuration file tests" +needs_yaml = unittest.skipIf(not _HAVE_YAML, _skip_msg) + + +@needs_yaml +class TestConfig(TestCase): + + # Disable parallel testing due to envvars modification + _numba_parallel_test_ = False + + def setUp(self): + # use support.temp_directory, it can do the clean up + self.tmppath = temp_directory('config_tmp') + self.maxDiff = 2500 + super(TestConfig, self).setUp() + + def mock_cfg_location(self): + """ + Creates a mock launch location. + Returns the location path. + """ + return tempfile.mkdtemp(dir=self.tmppath) + + def inject_mock_cfg(self, location, cfg): + """ + Injects a mock configuration at 'location' + """ + tmpcfg = os.path.join(location, config._config_fname) + with open(tmpcfg, 'wt') as f: + yaml.dump(cfg, f, default_flow_style=False) + + def get_settings(self): + """ + Gets the current numba config settings + """ + store = dict() + for x in dir(config): + if x.isupper(): + store[x] = getattr(config, x) + return store + + def create_config_effect(self, cfg): + """ + Returns a config "original" from a location with no config file + and then the impact of applying the supplied cfg dictionary as + a config file at a location in the returned "current". + """ + + # store original cwd + original_cwd = os.getcwd() + + # create mock launch location + launch_dir = self.mock_cfg_location() + + # switch cwd to the mock launch location, get and store settings + os.chdir(launch_dir) + # use override to ensure that the config is zero'd out with respect + # to any existing settings + with override_env_config('_', '_'): + original = self.get_settings() + + # inject new config into a file in the mock launch location + self.inject_mock_cfg(launch_dir, cfg) + + try: + # override something but don't change the value, this is to refresh + # the config and make sure the injected config file is read + with override_env_config('_', '_'): + current = self.get_settings() + finally: + # switch back to original dir with no new config + os.chdir(original_cwd) + return original, current + + def test_config(self): + # ensure a non empty settings file does impact config and that the + # case of the key makes no difference + key = 'COLOR_SCHEME' + for case in [str.upper, str.lower]: + orig, curr = self.create_config_effect({case(key): 'light_bg'}) + self.assertTrue(orig != curr) + self.assertTrue(orig[key] != curr[key]) + self.assertEqual(curr[key], 'light_bg') + # check that just the color scheme is the cause of difference + orig.pop(key) + curr.pop(key) + self.assertEqual(orig, curr) + + def test_empty_config(self): + # ensure an empty settings file does not impact config + orig, curr = self.create_config_effect({}) + self.assertEqual(orig, curr) + + @unittest.skipUnless(config.ENABLE_AVX, + "test expects NUMBA_ENABLE_AVX==True") + def test_nocona_disables_avx(self): + # test with nocona + new_env = os.environ.copy() + new_env.pop('NUMBA_ENABLE_AVX', None) # clear NUMBA_ENABLE_AVX + + new_env['NUMBA_CPU_NAME'] = 'nocona' + code = ("from numba.core import config\n" + "print('---->', bool(config.ENABLE_AVX))\n" + "assert not config.ENABLE_AVX") + out, err = run_in_subprocess(dedent(code), env=new_env) + err_msg = err.decode('utf-8') + out_msg = out.decode('utf-8') + ex_expected = "----> False" + self.assertIn(ex_expected, out_msg, msg=err_msg) + + # test with skylake-avx512 + new_env['NUMBA_CPU_NAME'] = 'skylake-avx512' + code = ("from numba.core import config\n" + "print('---->', bool(config.ENABLE_AVX))\n" + "assert config.ENABLE_AVX") + out, err = run_in_subprocess(dedent(code), env=new_env) + err_msg = err.decode('utf-8') + out_msg = out.decode('utf-8') + ex_expected = "----> True" + self.assertIn(ex_expected, out_msg, msg=err_msg) + + +class TestNumbaOptLevel(TestCase): + # Tests that the setting of NUMBA_OPT influences the "cheap" module pass. + # Spot checks NUMBA_OPT={'max', '3', '0'} + + def check(self, expected, opt_value, raw_value): + # local imports for state-safety + from numba import config, njit + + # check opt value and its raw_value + self.assertEqual(config.OPT, opt_value) + self.assertEqual(config.OPT._raw_value, raw_value) + + # Patch the CPUCodegen to make capture calls to the + # `_module_pass_manager` through a `side_effect` function that asserts + # that the kwargs being passed are as expected per the "NUMBA_OPT" + # level. The `side_effect` function immediately raises with a knwon + # message to abort further stages compilation once the check is + # complete. + from numba.core.codegen import CPUCodegen + side_effect_message = "expected side effect" + + def side_effect(*args, **kwargs): + self.assertEqual(kwargs, expected) + raise RuntimeError(side_effect_message) + + with mock.patch.object(CPUCodegen, '_module_pass_manager', + side_effect=side_effect): + with self.assertRaises(RuntimeError) as raises: + njit(lambda : ...)() + + self.assertIn(side_effect_message, str(raises.exception)) + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_OPT': 'max'}) + def test_opt_max(self): + # NUMBA_OPT='max' should set opt to 3 and enable loop_vectorize + expected = {'loop_vectorize': True, + 'slp_vectorize': False, + 'opt': 3, + 'cost': 'cheap'} + self.check(expected, 3, 'max') + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_OPT': '3'}) + def test_opt_3(self): + # NUMBA_OPT='3' should not impact opt or loop_vectorize + expected = {'loop_vectorize': False, + 'slp_vectorize': False, + 'opt': 0, + 'cost': 'cheap'} + self.check(expected, 3, 3) + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_OPT': '0'}) + def test_opt_0(self): + # NUMBA_OPT='0' should not impact opt or loop_vectorize + expected = {'loop_vectorize': False, + 'slp_vectorize': False, + 'opt': 0, + 'cost': 'cheap'} + self.check(expected, 0, 0) + + @TestCase.run_test_in_subprocess() + def test_opt_default(self): + # NUMBA_OPT is not set, the default should not impact opt or + # loop_vectorize + expected = {'loop_vectorize': False, + 'slp_vectorize': False, + 'opt': 0, + 'cost': 'cheap'} + self.check(expected, 3, 3) + + @TestCase.run_test_in_subprocess(envvars={'NUMBA_OPT': 'invalid'}) + def test_opt_invalid(self): + # NUMBA_OPT='invalid' should just proceed as default case + expected = {'loop_vectorize': False, + 'slp_vectorize': False, + 'opt': 0, + 'cost': 'cheap'} + self.check(expected, 3, 3) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_conversion.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_conversion.py new file mode 100644 index 0000000000000000000000000000000000000000..54bb94ca78f66c00ebc9fe0b8f535cf2b0cd8f98 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_conversion.py @@ -0,0 +1,223 @@ +import gc +import itertools + +import numpy as np + +import unittest +from numba import jit, njit +from numba.core import types +from numba.tests.support import TestCase +from numba.np import numpy_support + + +def identity(x): + return x + +def addition(x, y): + return x + y + +def equality(x, y): + return x == y + +def foobar(x, y, z): + return x + + +class TestConversion(TestCase): + """ + Testing Python to Native conversion + """ + + def test_complex_identity(self): + pyfunc = identity + cfunc = njit(types.complex64(types.complex64))(pyfunc) + + xs = [1.0j, (1+1j), (-1-1j), (1+0j)] + for x in xs: + self.assertEqual(cfunc(x), x) + for x in np.complex64(xs): + self.assertEqual(cfunc(x), x) + + cfunc = njit(types.complex128(types.complex128))(pyfunc) + + xs = [1.0j, (1+1j), (-1-1j), (1+0j)] + for x in xs: + self.assertEqual(cfunc(x), x) + for x in np.complex128(xs): + self.assertEqual(cfunc(x), x) + + def test_complex_addition(self): + pyfunc = addition + cfunc = njit(types.complex64(types.complex64, types.complex64))(pyfunc) + + xs = [1.0j, (1+1j), (-1-1j), (1+0j)] + for x in xs: + y = x + self.assertEqual(cfunc(x, y), x + y) + for x in np.complex64(xs): + y = x + self.assertEqual(cfunc(x, y), x + y) + + + cfunc = njit(types.complex128(types.complex128, + types.complex128))(pyfunc) + + xs = [1.0j, (1+1j), (-1-1j), (1+0j)] + for x in xs: + y = x + self.assertEqual(cfunc(x, y), x + y) + for x in np.complex128(xs): + y = x + self.assertEqual(cfunc(x, y), x + y) + + def test_boolean_as_int(self): + pyfunc = equality + cfunc = njit((types.boolean, types.intp))(pyfunc) + + xs = True, False + ys = -1, 0, 1 + + for xs, ys in itertools.product(xs, ys): + self.assertEqual(pyfunc(xs, ys), cfunc(xs, ys)) + + def test_boolean_as_float(self): + pyfunc = equality + cfunc = njit((types.boolean, types.float64))(pyfunc) + + xs = True, False + ys = -1, 0, 1 + + for xs, ys in itertools.product(xs, ys): + self.assertEqual(pyfunc(xs, ys), cfunc(xs, ys)) + + def test_boolean_eq_boolean(self): + pyfunc = equality + cfunc = njit((types.boolean, types.boolean))(pyfunc) + + xs = True, False + ys = True, False + + for xs, ys in itertools.product(xs, ys): + self.assertEqual(pyfunc(xs, ys), cfunc(xs, ys)) + + # test when a function parameters are jitted as unsigned types + # the function is called with negative parameters the Python error + # that it generates is correctly handled -- a Python error is returned to the user + # For more info, see the comment in Include/longobject.h for _PyArray_AsByteArray + # which PyLong_AsUnsignedLongLong calls + def test_negative_to_unsigned(self): + def f(x): + return x + with self.assertRaises(OverflowError): + jit('uintp(uintp)', nopython=True)(f)(-5) + + # test the switch logic in callwraper.py:build_wrapper() works for more than one argument + # and where the error occurs + def test_multiple_args_negative_to_unsigned(self): + pyfunc = foobar + cfunc = njit(types.uint64(types.uint64, types.uint64, + types.uint64),)(pyfunc) + + test_fail_args = ((-1, 0, 1), (0, -1, 1), (0, 1, -1)) + with self.assertRaises(OverflowError): + for a, b, c in test_fail_args: + cfunc(a, b, c) + + # test switch logic of callwraper.py:build_wrapper() with records as function parameters + def test_multiple_args_records(self): + pyfunc = foobar + + mystruct_dt = np.dtype([('p', np.float64), + ('row', np.float64), + ('col', np.float64)]) + mystruct = numpy_support.from_dtype(mystruct_dt) + + cfunc = njit(mystruct[:](mystruct[:], types.uint64, + types.uint64),)(pyfunc) + + st1 = np.recarray(3, dtype=mystruct_dt) + + st1.p = np.arange(st1.size) + 1 + st1.row = np.arange(st1.size) + 1 + st1.col = np.arange(st1.size) + 1 + + with self.assertRefCount(st1): + test_fail_args = ((st1, -1, 1), (st1, 1, -1)) + + for a, b, c in test_fail_args: + with self.assertRaises(OverflowError): + cfunc(a, b, c) + + del test_fail_args, a, b, c + gc.collect() + + # test switch logic of callwraper.py:build_wrapper() with no function parameters + def test_with_no_parameters(self): + def f(): + pass + self.assertEqual(f(), jit('()', nopython=True)(f)()) + + def check_argument_cleanup(self, typ, obj): + """ + Check that argument cleanup doesn't leak references. + """ + def f(x, y): + pass + + def _objects(obj): + objs = [obj] + if isinstance(obj, tuple): + for v in obj: + objs += _objects(v) + return objs + + objects = _objects(obj) + + cfunc = njit((typ, types.uint32))(f) + with self.assertRefCount(*objects): + cfunc(obj, 1) + with self.assertRefCount(*objects): + with self.assertRaises(OverflowError): + cfunc(obj, -1) + + cfunc = njit((types.uint32, typ))(f) + with self.assertRefCount(*objects): + cfunc(1, obj) + with self.assertRefCount(*objects): + with self.assertRaises(OverflowError): + cfunc(-1, obj) + + def test_cleanup_buffer(self): + mem = memoryview(bytearray(b"xyz")) + self.check_argument_cleanup(types.MemoryView(types.byte, 1, 'C'), mem) + + def test_cleanup_record(self): + dtype = np.dtype([('x', np.float64), ('y', np.float64)]) + recarr = np.zeros(1, dtype=dtype) + self.check_argument_cleanup(numpy_support.from_dtype(dtype), recarr[0]) + + def test_cleanup_tuple(self): + mem = memoryview(bytearray(b"xyz")) + tp = types.UniTuple(types.MemoryView(types.byte, 1, 'C'), 2) + self.check_argument_cleanup(tp, (mem, mem)) + + def test_cleanup_optional(self): + mem = memoryview(bytearray(b"xyz")) + tp = types.Optional(types.MemoryView(types.byte, 1, 'C')) + self.check_argument_cleanup(tp, mem) + + def test_stringliteral_to_unicode(self): + # See issue #6907, explicit signature on bar() takes a unicode_type but + # the call to bar() in foo() is with a StringLiteral + + @jit(types.void(types.unicode_type), nopython=True) + def bar(string): + pass + + @jit(types.void(), nopython=True) + def foo2(): + bar("literal string") + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_copy_propagate.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_copy_propagate.py new file mode 100644 index 0000000000000000000000000000000000000000..ca410fedaf4c8f40f26bee8143457f5e596c3f14 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_copy_propagate.py @@ -0,0 +1,169 @@ +# +# Copyright (c) 2017 Intel Corporation +# SPDX-License-Identifier: BSD-2-Clause +# + +from numba import jit, njit +from numba.core import types, ir, config, compiler +from numba.core.registry import cpu_target +from numba.core.annotations import type_annotations +from numba.core.ir_utils import (copy_propagate, apply_copy_propagate, + get_name_var_table) +from numba.core.typed_passes import type_inference_stage +from numba.tests.support import IRPreservingTestPipeline +import numpy as np +import unittest + + +def test_will_propagate(b, z, w): + x = 3 + x1 = x + if b > 0: + y = z + w + else: + y = 0 + a = 2 * x1 + return a < b + + +def test_wont_propagate(b, z, w): + x = 3 + if b > 0: + y = z + w + x = 1 + else: + y = 0 + a = 2 * x + return a < b + + +def null_func(a,b,c,d): + False + + +def inListVar(list_var, var): + for i in list_var: + if i.name == var: + return True + return False + + +def findAssign(func_ir, var): + for label, block in func_ir.blocks.items(): + for i, inst in enumerate(block.body): + if isinstance(inst, ir.Assign) and inst.target.name!=var: + all_var = inst.list_vars() + if inListVar(all_var, var): + return True + + return False + + +class TestCopyPropagate(unittest.TestCase): + def test1(self): + typingctx = cpu_target.typing_context + targetctx = cpu_target.target_context + test_ir = compiler.run_frontend(test_will_propagate) + typingctx.refresh() + targetctx.refresh() + args = (types.int64, types.int64, types.int64) + typemap, return_type, calltypes, _ = type_inference_stage(typingctx, + targetctx, + test_ir, + args, + None) + type_annotation = type_annotations.TypeAnnotation( + func_ir=test_ir, + typemap=typemap, + calltypes=calltypes, + lifted=(), + lifted_from=None, + args=args, + return_type=return_type, + html_output=config.HTML) + in_cps, out_cps = copy_propagate(test_ir.blocks, typemap) + apply_copy_propagate(test_ir.blocks, in_cps, + get_name_var_table(test_ir.blocks), typemap, + calltypes) + + self.assertFalse(findAssign(test_ir, "x1")) + + def test2(self): + typingctx = cpu_target.typing_context + targetctx = cpu_target.target_context + test_ir = compiler.run_frontend(test_wont_propagate) + typingctx.refresh() + targetctx.refresh() + args = (types.int64, types.int64, types.int64) + typemap, return_type, calltypes, _ = type_inference_stage(typingctx, + targetctx, + test_ir, + args, + None) + type_annotation = type_annotations.TypeAnnotation( + func_ir=test_ir, + typemap=typemap, + calltypes=calltypes, + lifted=(), + lifted_from=None, + args=args, + return_type=return_type, + html_output=config.HTML) + in_cps, out_cps = copy_propagate(test_ir.blocks, typemap) + apply_copy_propagate(test_ir.blocks, in_cps, get_name_var_table(test_ir.blocks), typemap, calltypes) + + self.assertTrue(findAssign(test_ir, "x")) + + def test_input_ir_extra_copies(self): + """make sure Interpreter._remove_unused_temporaries() has removed extra copies + in the IR in simple cases so copy propagation is faster + """ + def test_impl(a): + b = a + 3 + return b + + j_func = njit(pipeline_class=IRPreservingTestPipeline)(test_impl) + self.assertEqual(test_impl(5), j_func(5)) + + # make sure b is the target of the expression assignment, not a temporary + fir = j_func.overloads[j_func.signatures[0]].metadata['preserved_ir'] + self.assertTrue(len(fir.blocks) == 1) + block = next(iter(fir.blocks.values())) + b_found = False + for stmt in block.body: + if isinstance(stmt, ir.Assign) and stmt.target.name == "b": + b_found = True + self.assertTrue(isinstance(stmt.value, ir.Expr) + and stmt.value.op == "binop" and stmt.value.lhs.name == "a") + + self.assertTrue(b_found) + + def test_input_ir_copy_remove_transform(self): + """make sure Interpreter._remove_unused_temporaries() does not generate + invalid code for rare chained assignment cases + """ + # regular chained assignment + def impl1(a): + b = c = a + 1 + return (b, c) + + # chained assignment with setitem + def impl2(A, i, a): + b = A[i] = a + 1 + return b, A[i] + 2 + + # chained assignment with setattr + def impl3(A, a): + b = A.a = a + 1 + return b, A.a + 2 + + class C: + pass + + self.assertEqual(impl1(5), njit(impl1)(5)) + self.assertEqual(impl2(np.ones(3), 0, 5), njit(impl2)(np.ones(3), 0, 5)) + self.assertEqual(impl3(C(), 5), jit(forceobj=True)(impl3)(C(), 5)) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ctypes.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ctypes.py new file mode 100644 index 0000000000000000000000000000000000000000..c1a7edf5099f6415576dda54faa52f8d18f150e5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ctypes.py @@ -0,0 +1,255 @@ +from ctypes import * +import sys +import threading + +import numpy as np + + +from numba import jit, njit +from numba.core import types, errors +from numba.core.typing import ctypes_utils +from numba.tests.support import MemoryLeakMixin, tag, TestCase +from numba.tests.ctypes_usecases import * +import unittest + + +class TestCTypesTypes(TestCase): + + def _conversion_tests(self, check): + check(c_double, types.float64) + check(c_int, types.intc) + check(c_uint16, types.uint16) + check(c_size_t, types.size_t) + check(c_ssize_t, types.ssize_t) + + check(c_void_p, types.voidptr) + check(POINTER(c_float), types.CPointer(types.float32)) + check(POINTER(POINTER(c_float)), + types.CPointer(types.CPointer(types.float32))) + + check(None, types.void) + + def test_from_ctypes(self): + """ + Test converting a ctypes type to a Numba type. + """ + def check(cty, ty): + got = ctypes_utils.from_ctypes(cty) + self.assertEqual(got, ty) + + self._conversion_tests(check) + + # An unsupported type + with self.assertRaises(TypeError) as raises: + ctypes_utils.from_ctypes(c_wchar_p) + self.assertIn("Unsupported ctypes type", str(raises.exception)) + + def test_to_ctypes(self): + """ + Test converting a Numba type to a ctypes type. + """ + def check(cty, ty): + got = ctypes_utils.to_ctypes(ty) + self.assertEqual(got, cty) + + self._conversion_tests(check) + + # An unsupported type + with self.assertRaises(TypeError) as raises: + ctypes_utils.to_ctypes(types.ellipsis) + self.assertIn("Cannot convert Numba type '...' to ctypes type", + str(raises.exception)) + + +class TestCTypesUseCases(MemoryLeakMixin, TestCase): + + def test_c_sin(self): + pyfunc = use_c_sin + cfunc = njit((types.double,))(pyfunc) + x = 3.14 + self.assertEqual(pyfunc(x), cfunc(x)) + + def test_two_funcs(self): + # Check that two constant functions don't get mixed up. + pyfunc = use_two_funcs + cfunc = njit((types.double,))(pyfunc) + x = 3.14 + self.assertEqual(pyfunc(x), cfunc(x)) + + @unittest.skipUnless(is_windows, "Windows-specific test") + def test_stdcall(self): + # Just check that it doesn't crash + cfunc = njit((types.uintc,))(use_c_sleep) + + cfunc(1) + + def test_ctype_wrapping(self): + pyfunc = use_ctype_wrapping + cfunc = njit((types.double,))(pyfunc) + x = 3.14 + self.assertEqual(pyfunc(x), cfunc(x)) + + def test_ctype_voidptr(self): + pyfunc = use_c_pointer + # pyfunc will segfault if called + cfunc = njit((types.int32,))(pyfunc) + x = 123 + self.assertEqual(cfunc(x), x + 1) + + def test_function_pointer(self): + pyfunc = use_func_pointer + cfunc = jit(nopython=True)(pyfunc) + for (fa, fb, x) in [ + (c_sin, c_cos, 1.0), + (c_sin, c_cos, -1.0), + (c_cos, c_sin, 1.0), + (c_cos, c_sin, -1.0)]: + expected = pyfunc(fa, fb, x) + got = cfunc(fa, fb, x) + self.assertEqual(got, expected) + # A single specialization was compiled for all calls + self.assertEqual(len(cfunc.overloads), 1, cfunc.overloads) + + def test_untyped_function(self): + with self.assertRaises(TypeError) as raises: + njit((types.double,))(use_c_untyped) + self.assertIn("ctypes function '_numba_test_exp' doesn't define its argument types", + str(raises.exception)) + + def test_python_call_back(self): + mydct = {'what': 1232121} + + def call_me_maybe(arr): + return mydct[arr[0].decode('ascii')] + + # Create a callback into the python interpreter + py_call_back = CFUNCTYPE(c_int, py_object)(call_me_maybe) + + def pyfunc(a): + what = py_call_back(a) + return what + + cfunc = jit(nopython=True, nogil=True)(pyfunc) + arr = np.array(["what"], dtype='S10') + self.assertEqual(pyfunc(arr), cfunc(arr)) + + def test_python_call_back_threaded(self): + def pyfunc(a, repeat): + out = 0 + for _ in range(repeat): + out += py_call_back(a) + return out + + cfunc = jit(nopython=True, nogil=True)(pyfunc) + + arr = np.array(["what"], dtype='S10') + repeat = 1000 + + expected = pyfunc(arr, repeat) + outputs = [] + + # Warm up + cfunc(arr, repeat) + + # Test the function in multiple threads to exercise the + # GIL ensure/release code + + def run(func, arr, repeat): + outputs.append(func(arr, repeat)) + + threads = [threading.Thread(target=run, args=(cfunc, arr, repeat)) + for _ in range(10)] + + # Start threads + for th in threads: + th.start() + + # End threads + for th in threads: + th.join() + + # Check results + for got in outputs: + self.assertEqual(expected, got) + + def test_passing_array_ctypes_data(self): + """ + Test the ".ctypes.data" attribute of an array can be passed + as a "void *" parameter. + """ + def pyfunc(arr): + return c_take_array_ptr(arr.ctypes.data) + + cfunc = jit(nopython=True, nogil=True)(pyfunc) + + arr = np.arange(5) + + expected = pyfunc(arr) + got = cfunc(arr) + + self.assertEqual(expected, got) + + def check_array_ctypes(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + arr = np.linspace(0, 10, 5) + expected = arr ** 2.0 + got = cfunc(arr) + self.assertPreciseEqual(expected, got) + return cfunc + + def test_passing_array_ctypes_voidptr(self): + """ + Test the ".ctypes" attribute of an array can be passed + as a "void *" parameter. + """ + self.check_array_ctypes(use_c_vsquare) + + def test_passing_array_ctypes_voidptr_pass_ptr(self): + """ + Test the ".ctypes" attribute of an array can be passed + as a pointer parameter of the right type. + """ + cfunc = self.check_array_ctypes(use_c_vcube) + + # Non-compatible pointers are not accepted (here float32* vs. float64*) + with self.assertRaises(errors.TypingError) as raises: + cfunc(np.float32([0.0])) + + self.assertIn("No implementation of function ExternalFunctionPointer", + str(raises.exception)) + + def test_storing_voidptr_to_int_array(self): + # Make C callback that returns a void* + cproto = CFUNCTYPE(c_void_p) + + @cproto + def get_voidstar(): + return 0xdeadbeef + + # Make python functions that use the C callback + def pyfunc(a): + ptr = get_voidstar() + a[0] = ptr + return ptr + + # Compile it + cfunc = njit((types.uintp[::1],))(pyfunc) + + # Setup inputs + arr_got = np.zeros(1, dtype=np.uintp) + arr_expect = arr_got.copy() + + # Run functions + ret_got = cfunc(arr_got) + ret_expect = pyfunc(arr_expect) + + # Check + self.assertEqual(ret_expect, 0xdeadbeef) + self.assertPreciseEqual(ret_got, ret_expect) + self.assertPreciseEqual(arr_got, arr_expect) + + +if __name__ == '__main__': + unittest.main() + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dataflow.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dataflow.py new file mode 100644 index 0000000000000000000000000000000000000000..1659ad2bda25df82a2d1704b26837b38a34ea359 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dataflow.py @@ -0,0 +1,170 @@ +import unittest +from numba import jit, njit +from numba.core import types +from numba.tests.support import TestCase + + +force_pyobj_jit_opt = {'forceobj': True} +no_pyobj_jit_opt = {'nopython': True} + + +def assignments(a): + b = c = str(a) + return b + c + + +def assignments2(a): + b = c = d = str(a) + return b + c + d + + +# Use cases for issue #503 + +def var_propagate1(a, b): + c = (a if a > b else b) + 5 + return c + + +def var_propagate2(a, b): + c = 5 + (a if a > b else b + 12) / 2.0 + return c + + +def var_propagate3(a, b): + c = 5 + (a > b and a or b) + return c + + +def var_propagate4(a, b): + c = 5 + (a - 1 and b + 1) or (a + 1 and b - 1) + return c + + +# Issue #480 +def chained_compare(a): + return 1 < a < 3 + + +# Issue #591 +def stack_effect_error(x): + i = 2 + c = 1 + if i == x: + for i in range(3): + c = i + return i + c + +# Some more issues with stack effect and blocks +def for_break(n, x): + for i in range(n): + n = 0 + if i == x: + break + else: + n = i + return i, n + +# Issue #571 +def var_swapping(a, b, c, d, e): + a, b = b, a + c, d, e = e, c, d + a, b, c, d = b, c, d, a + return a + b + c + d +e + +class TestDataFlow(TestCase): + + def test_assignments(self, flags=force_pyobj_jit_opt): + pyfunc = assignments + cfunc = jit((types.int32,), **flags)(pyfunc) + for x in [-1, 0, 1]: + self.assertPreciseEqual(pyfunc(x), cfunc(x)) + + def test_assignments2(self, flags=force_pyobj_jit_opt): + pyfunc = assignments2 + cfunc = jit((types.int32,), **flags)(pyfunc) + for x in [-1, 0, 1]: + self.assertPreciseEqual(pyfunc(x), cfunc(x)) + + if flags is force_pyobj_jit_opt: + cfunc("a") + + # The dataflow analysis must be good enough for native mode + # compilation to succeed, hence the use of njit in the following tests. + + def run_propagate_func(self, func, args): + self.assertPreciseEqual(func(*args), func.py_func(*args)) + + def test_var_propagate1(self): + cfunc = njit((types.intp, types.intp))(var_propagate1) + self.run_propagate_func(cfunc, (2, 3)) + self.run_propagate_func(cfunc, (3, 2)) + + def test_var_propagate2(self): + cfunc = njit((types.intp, types.intp))(var_propagate2) + self.run_propagate_func(cfunc, (2, 3)) + self.run_propagate_func(cfunc, (3, 2)) + + def test_var_propagate3(self): + cfunc = njit((types.intp, types.intp))(var_propagate3) + self.run_propagate_func(cfunc, (2, 3)) + self.run_propagate_func(cfunc, (3, 2)) + self.run_propagate_func(cfunc, (2, 0)) + self.run_propagate_func(cfunc, (-1, 0)) + self.run_propagate_func(cfunc, (0, 2)) + self.run_propagate_func(cfunc, (0, -1)) + + def test_var_propagate4(self): + cfunc = njit((types.intp, types.intp))(var_propagate4) + self.run_propagate_func(cfunc, (1, 1)) + self.run_propagate_func(cfunc, (1, 0)) + self.run_propagate_func(cfunc, (1, -1)) + self.run_propagate_func(cfunc, (0, 1)) + self.run_propagate_func(cfunc, (0, 0)) + self.run_propagate_func(cfunc, (0, -1)) + self.run_propagate_func(cfunc, (-1, 1)) + self.run_propagate_func(cfunc, (-1, 0)) + self.run_propagate_func(cfunc, (-1, -1)) + + def test_chained_compare(self, flags=force_pyobj_jit_opt): + pyfunc = chained_compare + cfunc = jit((types.int32,), **flags)(pyfunc) + for x in [0, 1, 2, 3, 4]: + self.assertPreciseEqual(pyfunc(x), cfunc(x)) + + def test_chained_compare_npm(self): + self.test_chained_compare(no_pyobj_jit_opt) + + def test_stack_effect_error(self, flags=force_pyobj_jit_opt): + # Issue #591: POP_BLOCK must undo all stack pushes done inside + # the block. + pyfunc = stack_effect_error + cfunc = jit((types.int32,), **flags)(pyfunc) + for x in (0, 1, 2, 3): + self.assertPreciseEqual(pyfunc(x), cfunc(x)) + + def test_stack_effect_error_npm(self): + self.test_stack_effect_error(no_pyobj_jit_opt) + + def test_var_swapping(self, flags=force_pyobj_jit_opt): + pyfunc = var_swapping + cfunc = jit((types.int32,) * 5, **flags)(pyfunc) + args = tuple(range(0, 10, 2)) + self.assertPreciseEqual(pyfunc(*args), cfunc(*args)) + + def test_var_swapping_npm(self): + self.test_var_swapping(no_pyobj_jit_opt) + + def test_for_break(self, flags=force_pyobj_jit_opt): + # BREAK_LOOP must unwind the current inner syntax block. + pyfunc = for_break + cfunc = jit((types.intp, types.intp), **flags)(pyfunc) + for (n, x) in [(4, 2), (4, 6)]: + self.assertPreciseEqual(pyfunc(n, x), cfunc(n, x)) + + def test_for_break_npm(self): + self.test_for_break(no_pyobj_jit_opt) + + +if __name__ == '__main__': + unittest.main() + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_datamodel.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_datamodel.py new file mode 100644 index 0000000000000000000000000000000000000000..03a0179fa74ca84e673b72ca28bfc36499d1cfe5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_datamodel.py @@ -0,0 +1,257 @@ +from llvmlite import ir, binding as ll + +from numba.core import types, datamodel +from numba.core.datamodel.testing import test_factory +from numba.core.datamodel.manager import DataModelManager +from numba.core.datamodel.models import OpaqueModel +import unittest + + +class TestBool(test_factory()): + fe_type = types.boolean + + +class TestPyObject(test_factory()): + fe_type = types.pyobject + + +class TestInt8(test_factory()): + fe_type = types.int8 + + +class TestInt16(test_factory()): + fe_type = types.int16 + + +class TestInt32(test_factory()): + fe_type = types.int32 + + +class TestInt64(test_factory()): + fe_type = types.int64 + + +class TestUInt8(test_factory()): + fe_type = types.uint8 + + +class TestUInt16(test_factory()): + fe_type = types.uint16 + + +class TestUInt32(test_factory()): + fe_type = types.uint32 + + +class TestUInt64(test_factory()): + fe_type = types.uint64 + + +class TestFloat(test_factory()): + fe_type = types.float32 + + +class TestDouble(test_factory()): + fe_type = types.float64 + + +class TestComplex(test_factory()): + fe_type = types.complex64 + + +class TestDoubleComplex(test_factory()): + fe_type = types.complex128 + + +class TestPointerOfInt32(test_factory()): + fe_type = types.CPointer(types.int32) + + +class TestUniTupleOf2xInt32(test_factory()): + fe_type = types.UniTuple(types.int32, 2) + + +class TestUniTupleEmpty(test_factory()): + fe_type = types.UniTuple(types.int32, 0) + + +class TestTupleInt32Float32(test_factory()): + fe_type = types.Tuple([types.int32, types.float32]) + + +class TestTupleEmpty(test_factory()): + fe_type = types.Tuple([]) + + +class Test1DArrayOfInt32(test_factory()): + fe_type = types.Array(types.int32, 1, 'C') + + +class Test2DArrayOfComplex128(test_factory()): + fe_type = types.Array(types.complex128, 2, 'C') + + +class Test0DArrayOfInt32(test_factory()): + fe_type = types.Array(types.int32, 0, 'C') + + +class TestArgInfo(unittest.TestCase): + + def _test_as_arguments(self, fe_args): + """ + Test round-tripping types *fe_args* through the default data model's + argument conversion and unpacking logic. + """ + dmm = datamodel.default_manager + fi = datamodel.ArgPacker(dmm, fe_args) + + module = ir.Module() + fnty = ir.FunctionType(ir.VoidType(), []) + function = ir.Function(module, fnty, name="test_arguments") + builder = ir.IRBuilder() + builder.position_at_end(function.append_basic_block()) + + args = [ir.Constant(dmm.lookup(t).get_value_type(), None) + for t in fe_args] + + # Roundtrip + values = fi.as_arguments(builder, args) + asargs = fi.from_arguments(builder, values) + + self.assertEqual(len(asargs), len(fe_args)) + valtys = tuple([v.type for v in values]) + self.assertEqual(valtys, fi.argument_types) + + expect_types = [a.type for a in args] + got_types = [a.type for a in asargs] + + self.assertEqual(expect_types, got_types) + + # Assign names (check this doesn't raise) + fi.assign_names(values, ["arg%i" for i in range(len(fe_args))]) + + builder.ret_void() + + ll.parse_assembly(str(module)) + + def test_int32_array_complex(self): + fe_args = [types.int32, + types.Array(types.int32, 1, 'C'), + types.complex64] + self._test_as_arguments(fe_args) + + def test_two_arrays(self): + fe_args = [types.Array(types.int32, 1, 'C')] * 2 + self._test_as_arguments(fe_args) + + def test_two_0d_arrays(self): + fe_args = [types.Array(types.int32, 0, 'C')] * 2 + self._test_as_arguments(fe_args) + + def test_tuples(self): + fe_args = [types.UniTuple(types.int32, 2), + types.UniTuple(types.int32, 3)] + self._test_as_arguments(fe_args) + # Tuple of struct-likes + arrty = types.Array(types.int32, 1, 'C') + fe_args = [types.UniTuple(arrty, 2), + types.UniTuple(arrty, 3)] + self._test_as_arguments(fe_args) + # Nested tuple + fe_args = [types.UniTuple(types.UniTuple(types.int32, 2), 3)] + self._test_as_arguments(fe_args) + + def test_empty_tuples(self): + # Empty tuple + fe_args = [types.UniTuple(types.int16, 0), + types.Tuple(()), + types.int32] + self._test_as_arguments(fe_args) + + def test_nested_empty_tuples(self): + fe_args = [types.int32, + types.UniTuple(types.Tuple(()), 2), + types.int64] + self._test_as_arguments(fe_args) + + +class TestMemInfo(unittest.TestCase): + def setUp(self): + self.dmm = datamodel.default_manager + + def test_number(self): + ty = types.int32 + dm = self.dmm[ty] + self.assertFalse(dm.contains_nrt_meminfo()) + + def test_array(self): + ty = types.int32[:] + dm = self.dmm[ty] + self.assertTrue(dm.contains_nrt_meminfo()) + + def test_tuple_of_number(self): + ty = types.UniTuple(dtype=types.int32, count=2) + dm = self.dmm[ty] + self.assertFalse(dm.contains_nrt_meminfo()) + + def test_tuple_of_array(self): + ty = types.UniTuple(dtype=types.int32[:], count=2) + dm = self.dmm[ty] + self.assertTrue(dm.contains_nrt_meminfo()) + + +class TestMisc(unittest.TestCase): + + def test_issue2921(self): + import numpy as np + from numba import njit + + @njit + def copy(a, b): + for i in range(a.shape[0]): + a[i] = b[i] + + b = np.arange(5, dtype=np.uint8).view(np.bool_) + a = np.zeros_like(b) + copy(a, b) + np.testing.assert_equal(a, np.array((False,) + (True,) * 4)) + + +class TestDMMChaining(unittest.TestCase): + def test_basic(self): + dmm = DataModelManager() + + class int_handler(OpaqueModel): + pass + + class float_handler(OpaqueModel): + pass + + dmm.register(types.Integer, int_handler) + dmm.register(types.Float, float_handler) + + inter_dmm = DataModelManager() + + class new_int_handler(OpaqueModel): + pass + + inter_dmm.register(types.Integer, new_int_handler) + chained_dmm = inter_dmm.chain(dmm) + + # Check that the chained DMM has the new handler + self.assertIsInstance(chained_dmm.lookup(types.intp), new_int_handler) + # and not the old handler + self.assertNotIsInstance(chained_dmm.lookup(types.intp), int_handler) + # Check that the base DMM has the old handler + self.assertIsInstance(dmm.lookup(types.intp), int_handler) + # Check that float goes to the float_handler + self.assertIsInstance(chained_dmm.lookup(types.float32), float_handler) + self.assertIsInstance(dmm.lookup(types.float32), float_handler) + # Check the intermediate DMM + self.assertIsInstance(inter_dmm.lookup(types.intp), new_int_handler) + with self.assertRaises(KeyError): + inter_dmm.lookup(types.float32) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_debug.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_debug.py new file mode 100644 index 0000000000000000000000000000000000000000..57d6a3f09b2c44c964af67b881444bf7eb118508 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_debug.py @@ -0,0 +1,340 @@ +import os +import platform +import re +import textwrap +import warnings + +import numpy as np + +from numba.tests.support import (TestCase, override_config, override_env_config, + captured_stdout, forbid_codegen, skip_parfors_unsupported, + needs_blas) +from numba import jit, njit +from numba.core import types, compiler, utils +from numba.core.errors import NumbaPerformanceWarning +from numba import prange +from numba.experimental import jitclass +import unittest + + +def simple_nopython(somearg): + retval = somearg + 1 + return retval + +def simple_gen(x, y): + yield x + yield y + + +class SimpleClass(object): + def __init__(self): + self.h = 5 + +simple_class_spec = [('h', types.int32)] + +def simple_class_user(obj): + return obj.h + +def unsupported_parfor(a, b): + return np.dot(a, b) # dot as gemm unsupported + +def supported_parfor(n): + a = np.ones(n) + for i in prange(n): + a[i] = a[i] + np.sin(i) + return a + +def unsupported_prange(n): + a = np.ones(n) + for i in prange(n): + a[i] = a[i] + np.sin(i) + assert i + 13 < 100000 + return a + + +class DebugTestBase(TestCase): + + all_dumps = set(['bytecode', 'cfg', 'ir', 'typeinfer', 'llvm', + 'func_opt_llvm', 'optimized_llvm', 'assembly']) + + def assert_fails(self, *args, **kwargs): + self.assertRaises(AssertionError, *args, **kwargs) + + def check_debug_output(self, out, dump_names): + enabled_dumps = dict.fromkeys(self.all_dumps, False) + for name in dump_names: + assert name in enabled_dumps + enabled_dumps[name] = True + for name, enabled in sorted(enabled_dumps.items()): + check_meth = getattr(self, '_check_dump_%s' % name) + if enabled: + check_meth(out) + else: + self.assert_fails(check_meth, out) + + def _check_dump_bytecode(self, out): + if utils.PYVERSION in ((3, 11), (3, 12), (3, 13)): + self.assertIn('BINARY_OP', out) + elif utils.PYVERSION in ((3, 10),): + self.assertIn('BINARY_ADD', out) + else: + raise NotImplementedError(utils.PYVERSION) + + def _check_dump_cfg(self, out): + self.assertIn('CFG dominators', out) + + def _check_dump_ir(self, out): + self.assertIn('--IR DUMP: %s--' % self.func_name, out) + + def _check_dump_typeinfer(self, out): + self.assertIn('--propagate--', out) + + def _check_dump_llvm(self, out): + self.assertIn('--LLVM DUMP', out) + if compiler.Flags.options["auto_parallel"].default.enabled == False: + self.assertRegex(out, r'store i64 %\"\.\d", i64\* %"retptr"', out) + + def _check_dump_func_opt_llvm(self, out): + self.assertIn('--FUNCTION OPTIMIZED DUMP %s' % self.func_name, out) + # allocas have been optimized away + self.assertIn('add nsw i64 %arg.somearg, 1', out) + + def _check_dump_optimized_llvm(self, out): + self.assertIn('--OPTIMIZED DUMP %s' % self.func_name, out) + self.assertIn('add nsw i64 %arg.somearg, 1', out) + + def _check_dump_assembly(self, out): + self.assertIn('--ASSEMBLY %s' % self.func_name, out) + if platform.machine() in ('x86_64', 'AMD64', 'i386', 'i686'): + self.assertIn('xorl', out) + + +class FunctionDebugTestBase(DebugTestBase): + + func_name = 'simple_nopython' + + def compile_simple_nopython(self): + with captured_stdout() as out: + cfunc = njit((types.int64,))(simple_nopython) + # Sanity check compiled function + self.assertPreciseEqual(cfunc(2), 3) + return out.getvalue() + + +class TestFunctionDebugOutput(FunctionDebugTestBase): + + def test_dump_bytecode(self): + with override_config('DUMP_BYTECODE', True): + out = self.compile_simple_nopython() + self.check_debug_output(out, ['bytecode']) + + def test_dump_ir(self): + with override_config('DUMP_IR', True): + out = self.compile_simple_nopython() + self.check_debug_output(out, ['ir']) + + def test_dump_cfg(self): + with override_config('DUMP_CFG', True): + out = self.compile_simple_nopython() + self.check_debug_output(out, ['cfg']) + + def test_dump_llvm(self): + with override_config('DUMP_LLVM', True): + out = self.compile_simple_nopython() + self.check_debug_output(out, ['llvm']) + + def test_dump_func_opt_llvm(self): + with override_config('DUMP_FUNC_OPT', True): + out = self.compile_simple_nopython() + self.check_debug_output(out, ['func_opt_llvm']) + + def test_dump_optimized_llvm(self): + with override_config('DUMP_OPTIMIZED', True): + out = self.compile_simple_nopython() + self.check_debug_output(out, ['optimized_llvm']) + + def test_dump_assembly(self): + with override_config('DUMP_ASSEMBLY', True): + out = self.compile_simple_nopython() + self.check_debug_output(out, ['assembly']) + + +class TestGeneratorDebugOutput(DebugTestBase): + + func_name = 'simple_gen' + + def compile_simple_gen(self): + with captured_stdout() as out: + cfunc = njit((types.int64, types.int64))(simple_gen) + # Sanity check compiled function + self.assertPreciseEqual(list(cfunc(2, 5)), [2, 5]) + return out.getvalue() + + def test_dump_ir_generator(self): + with override_config('DUMP_IR', True): + out = self.compile_simple_gen() + self.check_debug_output(out, ['ir']) + self.assertIn('--GENERATOR INFO: %s' % self.func_name, out) + expected_gen_info = textwrap.dedent(""" + generator state variables: ['x', 'y'] + yield point #1: live variables = ['y'], weak live variables = ['x'] + yield point #2: live variables = [], weak live variables = ['y'] + """) + self.assertIn(expected_gen_info, out) + + +class TestDisableJIT(DebugTestBase): + """ + Test the NUMBA_DISABLE_JIT environment variable. + """ + + def test_jit(self): + with override_config('DISABLE_JIT', True): + with forbid_codegen(): + cfunc = jit(nopython=True)(simple_nopython) + self.assertPreciseEqual(cfunc(2), 3) + + def test_jitclass(self): + with override_config('DISABLE_JIT', True): + with forbid_codegen(): + SimpleJITClass = jitclass(simple_class_spec)(SimpleClass) + + obj = SimpleJITClass() + self.assertPreciseEqual(obj.h, 5) + + cfunc = jit(nopython=True)(simple_class_user) + self.assertPreciseEqual(cfunc(obj), 5) + + +class TestEnvironmentOverride(FunctionDebugTestBase): + """ + Test that environment variables are reloaded by Numba when modified. + """ + + # mutates env with os.environ so must be run serially + _numba_parallel_test_ = False + + def test_debug(self): + out = self.compile_simple_nopython() + self.assertFalse(out) + with override_env_config('NUMBA_DEBUG', '1'): + out = self.compile_simple_nopython() + # Note that all variables dependent on NUMBA_DEBUG are + # updated too. + self.check_debug_output(out, ['ir', 'typeinfer', + 'llvm', 'func_opt_llvm', + 'optimized_llvm', 'assembly']) + out = self.compile_simple_nopython() + self.assertFalse(out) + +class TestParforsDebug(TestCase): + """ + Tests debug options associated with parfors + """ + + # mutates env with os.environ so must be run serially + _numba_parallel_test_ = False + + def check_parfors_warning(self, warn_list): + msg = ("'parallel=True' was specified but no transformation for " + "parallel execution was possible.") + warning_found = False + for w in warn_list: + if msg in str(w.message): + warning_found = True + break + self.assertTrue(warning_found, "Warning message should be found.") + + def check_parfors_unsupported_prange_warning(self, warn_list): + msg = ("prange or pndindex loop will not be executed in parallel " + "due to there being more than one entry to or exit from the " + "loop (e.g., an assertion).") + warning_found = False + for w in warn_list: + if msg in str(w.message): + warning_found = True + break + self.assertTrue(warning_found, "Warning message should be found.") + + @needs_blas + @skip_parfors_unsupported + def test_warns(self): + """ + Test that using parallel=True on a function that does not have parallel + semantics warns. + """ + arr_ty = types.Array(types.float64, 2, "C") + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always", NumbaPerformanceWarning) + njit((arr_ty, arr_ty), parallel=True)(unsupported_parfor) + self.check_parfors_warning(w) + + @needs_blas + @skip_parfors_unsupported + def test_unsupported_prange_warns(self): + """ + Test that prange with multiple exits issues a warning + """ + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always", NumbaPerformanceWarning) + njit((types.int64,), parallel=True)(unsupported_prange) + self.check_parfors_unsupported_prange_warning(w) + + @skip_parfors_unsupported + def test_array_debug_opt_stats(self): + """ + Test that NUMBA_DEBUG_ARRAY_OPT_STATS produces valid output + """ + # deliberately trigger a compilation loop to increment the + # Parfor class state, this is to ensure the test works based + # on indices computed based on this state and not hard coded + # indices. + njit((types.int64,), parallel=True)(supported_parfor) + + with override_env_config('NUMBA_DEBUG_ARRAY_OPT_STATS', '1'): + with captured_stdout() as out: + njit((types.int64,), parallel=True)(supported_parfor) + + # grab the various parts out the output + output = out.getvalue().split('\n') + parallel_loop_output = \ + [x for x in output if 'is produced from pattern' in x] + fuse_output = \ + [x for x in output if 'is fused into' in x] + after_fusion_output = \ + [x for x in output if 'After fusion, function' in x] + + # Parfor's have a shared state index, grab the current value + # as it will be used as an offset for all loop messages + parfor_state = int(re.compile(r'#([0-9]+)').search( + parallel_loop_output[0]).group(1)) + bounds = range(parfor_state, + parfor_state + len(parallel_loop_output)) + + # Check the Parallel for-loop is produced from + # works first + pattern = ("('ones function', 'NumPy mapping')", + ('prange', 'user', '')) + fmt = 'Parallel for-loop #{} is produced from pattern \'{}\' at' + for i, trials, lpattern in zip(bounds, parallel_loop_output, + pattern): + to_match = fmt.format(i, lpattern) + self.assertIn(to_match, trials) + + # Check the fusion statements are correct + pattern = (parfor_state + 1, parfor_state + 0) + fmt = 'Parallel for-loop #{} is fused into for-loop #{}.' + for trials in fuse_output: + to_match = fmt.format(*pattern) + self.assertIn(to_match, trials) + + # Check the post fusion statements are correct + pattern = (supported_parfor.__name__, 1, set([parfor_state])) + fmt = 'After fusion, function {} has {} parallel for-loop(s) #{}.' + for trials in after_fusion_output: + to_match = fmt.format(*pattern) + self.assertIn(to_match, trials) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_debuginfo.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_debuginfo.py new file mode 100644 index 0000000000000000000000000000000000000000..720c7f48cf77f28f37c5cadd104af61e8759c21c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_debuginfo.py @@ -0,0 +1,759 @@ +from collections import namedtuple +import inspect +import re +import numpy as np +import math +from textwrap import dedent +import unittest +import warnings + +from numba.tests.support import (TestCase, override_config, + ignore_internal_warnings) +from numba import jit, njit +from numba.core import types +from numba.core.datamodel import default_manager +from numba.core.errors import NumbaDebugInfoWarning +import llvmlite.binding as llvm + +#NOTE: These tests are potentially sensitive to changes in SSA or lowering +# behaviour and may need updating should changes be made to the corresponding +# algorithms. + + +class TestDebugInfo(TestCase): + """ + These tests only checks the compiled assembly for debuginfo. + """ + + def _getasm(self, fn, sig): + fn.compile(sig) + return fn.inspect_asm(sig) + + def _check(self, fn, sig, expect): + asm = self._getasm(fn, sig=sig) + m = re.search(r"\.section.+debug", asm, re.I) + got = m is not None + self.assertEqual(expect, got, msg='debug info not found in:\n%s' % asm) + + def test_no_debuginfo_in_asm(self): + @jit(nopython=True, debug=False) + def foo(x): + return x + + self._check(foo, sig=(types.int32,), expect=False) + + def test_debuginfo_in_asm(self): + @jit(nopython=True, debug=True) + def foo(x): + return x + + self._check(foo, sig=(types.int32,), expect=True) + + def test_environment_override(self): + with override_config('DEBUGINFO_DEFAULT', 1): + # Using default value + @jit(nopython=True) + def foo(x): + return x + self._check(foo, sig=(types.int32,), expect=True) + + # User override default + @jit(nopython=True, debug=False) + def bar(x): + return x + self._check(bar, sig=(types.int32,), expect=False) + + def test_llvm_inliner_flag_conflict(self): + # bar will be marked as 'alwaysinline', but when DEBUGINFO_DEFAULT is + # set functions are marked as 'noinline' this results in a conflict. + # baz will be marked as 'noinline' as a result of DEBUGINFO_DEFAULT + + @njit(forceinline=True) + def bar(x): + return math.sin(x) + + @njit(forceinline=False) + def baz(x): + return math.cos(x) + + @njit + def foo(x): + a = bar(x) + b = baz(x) + return a, b + + # check it compiles + with override_config('DEBUGINFO_DEFAULT', 1): + result = foo(np.pi) + + self.assertPreciseEqual(result, foo.py_func(np.pi)) + + # check the LLVM IR has bar marked as 'alwaysinline' and baz as noinline + full_ir = foo.inspect_llvm(foo.signatures[0]) + module = llvm.parse_assembly(full_ir) + name = foo.overloads[foo.signatures[0]].fndesc.mangled_name + funcs = [x for x in module.functions if x.name == name] + self.assertEqual(len(funcs), 1) + func = funcs[0] + + # find the function calls and save the associated statements + f_names = [] + for blk in func.blocks: + for stmt in blk.instructions: + if stmt.opcode == 'call': + # stmt.function.name This is the function being called + f_names.append(str(stmt).strip()) + + # Need to check there's two specific things in the calls in the IR + # 1. a call to the llvm.sin.f64 intrinsic, this is from the inlined bar + # 2. a call to the baz function, this is from the noinline baz + found_sin = False + found_baz = False + baz_name = baz.overloads[baz.signatures[0]].fndesc.mangled_name + for x in f_names: + if not found_sin and re.match('.*llvm.sin.f64.*', x): + found_sin = True + if not found_baz and re.match(f'.*{baz_name}.*', x): + found_baz = True + + self.assertTrue(found_sin) + self.assertTrue(found_baz) + + +class TestDebugInfoEmission(TestCase): + """ Tests that debug info is emitted correctly. + """ + + _NUMBA_OPT_0_ENV = {'NUMBA_OPT': '0'} + + def _get_llvmir(self, fn, sig): + with override_config('OPT', 0): + fn.compile(sig) + return fn.inspect_llvm(sig) + + def _get_metadata(self, fn, sig): + ll = self._get_llvmir(fn, sig).splitlines() + meta_re = re.compile(r'![0-9]+ =.*') + metadata = [] + for line in ll: + if meta_re.match(line): + metadata.append(line) + return metadata + + def _get_metadata_map(self, metadata): + """Gets the map of DI label to md, e.g. + '!33' -> '!{!"branch_weights", i32 1, i32 99}' + """ + metadata_definition_map = dict() + meta_definition_split = re.compile(r'(![0-9]+) = (.*)') + for line in metadata: + matched = meta_definition_split.match(line) + if matched: + dbg_val, info = matched.groups() + metadata_definition_map[dbg_val] = info + return metadata_definition_map + + def _get_lines_from_debuginfo(self, metadata): + # Get the lines contained in the debug info + md_def_map = self._get_metadata_map(metadata) + + lines = set() + for md in md_def_map.values(): + m = re.match(r"!DILocation\(line: (\d+),", md) + if m: + ln = int(m.group(1)) + lines.add(ln) + return lines + + def test_DW_LANG(self): + + @njit(debug=True) + def foo(): + pass + + metadata = self._get_metadata(foo, sig=()) + DICompileUnit = metadata[0] + self.assertEqual('!0', DICompileUnit[:2]) + self.assertIn('!DICompileUnit(language: DW_LANG_C_plus_plus', + DICompileUnit) + self.assertIn('producer: "clang (Numba)"', DICompileUnit) + + def test_DILocation(self): + """ Tests that DILocation information is reasonable. + """ + @njit(debug=True, error_model='numpy') + def foo(a): + b = a + 1.23 + c = b * 2.34 + d = b / c + print(d) + return d + + # the above produces LLVM like: + # define function() { + # entry: + # alloca + # store 0 to alloca + # + # setup for print + # branch + # other_labels: + # ... + # } + # + # The following checks that: + # * the alloca and store have no !dbg + # * the arithmetic occurs in the order defined and with !dbg + # * that the !dbg entries are monotonically increasing in value with + # source line number + + sig = (types.float64,) + metadata = self._get_metadata(foo, sig=sig) + full_ir = self._get_llvmir(foo, sig=sig) + + module = llvm.parse_assembly(full_ir) + + name = foo.overloads[foo.signatures[0]].fndesc.mangled_name + funcs = [x for x in module.functions if x.name == name] + self.assertEqual(len(funcs), 1) + func = funcs[0] + blocks = [x for x in func.blocks] + self.assertGreater(len(blocks), 1) + block = blocks[0] + + # Find non-call/non-memory instr and check the sequence is as expected + instrs = [x for x in block.instructions if x.opcode not in + ['call', 'load', 'store']] + op_expect = {'fadd', 'fmul', 'fdiv'} + started = False + for x in instrs: + if x.opcode in op_expect: + op_expect.remove(x.opcode) + if not started: + started = True + elif op_expect and started: + self.fail("Math opcodes are not contiguous") + self.assertFalse(op_expect, "Math opcodes were not found") + + # Parse out metadata from end of each line, check it monotonically + # ascends with LLVM source line. Also store all the dbg references, + # these will be checked later. + line2dbg = set() + re_dbg_ref = re.compile(r'.*!dbg (![0-9]+).*$') + found = -1 + for instr in instrs: + inst_as_str = str(instr) + matched = re_dbg_ref.match(inst_as_str) + if not matched: + # if there's no match, ensure it is one of alloca or store, + # it's important that the zero init/alloca instructions have + # no dbg data + accepted = ('alloca ', 'store ') + self.assertTrue(any([x in inst_as_str for x in accepted])) + continue + groups = matched.groups() + self.assertEqual(len(groups), 1) + dbg_val = groups[0] + int_dbg_val = int(dbg_val[1:]) + if found >= 0: + self.assertTrue(int_dbg_val >= found) + found = int_dbg_val + # some lines will alias dbg info, this is fine, it's only used to + # make sure that the line numbers are correct WRT python + line2dbg.add(dbg_val) + + pysrc, pysrc_line_start = inspect.getsourcelines(foo) + + # build a map of dbg reference to DI* information + metadata_definition_map = self._get_metadata_map(metadata) + + # Pull out metadata entries referred to by the llvm line end !dbg + # check they match the python source, the +2 is for the @njit decorator + # and the function definition line. + offsets = [0, # b = a + 1 + 1, # a * 2.34 + 2, # d = b / c + 3, # print(d) + ] + pyln_range = [pysrc_line_start + 2 + x for x in offsets] + + # do the check + for (k, line_no) in zip(sorted(line2dbg, key=lambda x: int(x[1:])), + pyln_range): + dilocation_info = metadata_definition_map[k] + self.assertIn(f'line: {line_no}', dilocation_info) + + # Check that variable "a" is declared as on the same line as function + # definition. + expr = r'.*!DILocalVariable\(name: "a",.*line: ([0-9]+),.*' + match_local_var_a = re.compile(expr) + for entry in metadata_definition_map.values(): + matched = match_local_var_a.match(entry) + if matched: + groups = matched.groups() + self.assertEqual(len(groups), 1) + dbg_line = int(groups[0]) + # +1 for the decorator. + # Recall that Numba's DWARF refers to the "def" line, but + # `inspect` uses the decorator as the first line. + defline = pysrc_line_start + 1 + self.assertEqual(dbg_line, defline) + break + else: + self.fail('Assertion on DILocalVariable not made') + + @TestCase.run_test_in_subprocess(envvars=_NUMBA_OPT_0_ENV) + def test_DILocation_entry_blk(self): + # Needs a subprocess as jitting literally anything at any point in the + # lifetime of the process ends up with a codegen at opt 3. This is not + # amenable to this test! + # This test relies on the CFG not being simplified as it checks the jump + # from the entry block to the first basic block. Force OPT as 0, if set + # via the env var the targetmachine and various pass managers all end up + # at OPT 0 and the IR is minimally transformed prior to lowering to ELF. + # + # This tests that the unconditional jump emitted at the tail of + # the entry block has no debug metadata associated with it. In practice, + # if debug metadata is associated with it, it manifests as the + # prologue_end being associated with the end_sequence or similar (due to + # the way code gen works for the entry block). + + @njit(debug=True) + def foo(a): + return a + 1 + foo(123) + + full_ir = foo.inspect_llvm(foo.signatures[0]) + # The above produces LLVM like: + # + # define function() { + # entry: + # alloca + # store 0 to alloca + # unconditional jump to body: + # + # body: + # ... + # } + + module = llvm.parse_assembly(full_ir) + name = foo.overloads[foo.signatures[0]].fndesc.mangled_name + funcs = [x for x in module.functions if x.name == name] + self.assertEqual(len(funcs), 1) + func = funcs[0] + blocks = [x for x in func.blocks] + self.assertEqual(len(blocks), 2) + entry_block, body_block = blocks + + # Assert that the tail of the entry block is an unconditional jump to + # the body block and that the jump has no associated debug info. + entry_instr = [x for x in entry_block.instructions] + ujmp = entry_instr[-1] + self.assertEqual(ujmp.opcode, 'br') + ujmp_operands = [x for x in ujmp.operands] + self.assertEqual(len(ujmp_operands), 1) + target_data = ujmp_operands[0] + target = str(target_data).split(':')[0].strip() + # check the unconditional jump target is to the body block + self.assertEqual(target, body_block.name) + # check the uncondition jump instr itself has no metadata + self.assertTrue(str(ujmp).endswith(target)) + + @TestCase.run_test_in_subprocess(envvars=_NUMBA_OPT_0_ENV) + def test_DILocation_decref(self): + """ This tests that decref's generated from `ir.Del`s as variables go + out of scope do not have debuginfo associated with them (the location of + `ir.Del` is an implementation detail). + """ + + @njit(debug=True) + def sink(*x): + pass + + # This function has many decrefs! + @njit(debug=True) + def foo(a): + x = (a, a) + if a[0] == 0: + sink(x) + return 12 + z = x[0][0] + return z + + sig = (types.float64[::1],) + full_ir = self._get_llvmir(foo, sig=sig) + + # make sure decref lines end with `meminfo.)` without !dbg info. + count = 0 + for line in full_ir.splitlines(): + line_stripped = line.strip() + if line_stripped.startswith('call void @NRT_decref'): + self.assertRegex(line, r'.*meminfo\.[0-9]+\)$') + count += 1 + self.assertGreater(count, 0) # make sure there were some decrefs! + + def test_DILocation_undefined(self): + """ Tests that DILocation information for undefined vars is associated + with the line of the function definition (so it ends up in the prologue) + """ + @njit(debug=True) + def foo(n): + if n: + if n > 0: + c = 0 + return c + else: + # variable c is not defined in this branch + c += 1 + return c + + sig = (types.intp,) + metadata = self._get_metadata(foo, sig=sig) + pysrc, pysrc_line_start = inspect.getsourcelines(foo) + # Looks for versions of variable "c" and captures the line number + expr = r'.*!DILocalVariable\(name: "c\$?[0-9]?",.*line: ([0-9]+),.*' + matcher = re.compile(expr) + associated_lines = set() + for md in metadata: + match = matcher.match(md) + if match: + groups = match.groups() + self.assertEqual(len(groups), 1) + associated_lines.add(int(groups[0])) + # 3 versions of 'c': `c = 0`, `return c`, `c+=1` + self.assertEqual(len(associated_lines), 3) + self.assertIn(pysrc_line_start, associated_lines) + + def test_DILocation_versioned_variables(self): + """ Tests that DILocation information for versions of variables matches + up to their definition site.""" + # Note: there's still something wrong in the DI/SSA naming, the ret c is + # associated with the logically first definition. + + @njit(debug=True) + def foo(n): + if n: + c = 5 + else: + c = 1 + # prevents inline of return on py310 + py310_defeat1 = 1 # noqa + py310_defeat2 = 2 # noqa + py310_defeat3 = 3 # noqa + py310_defeat4 = 4 # noqa + return c + + sig = (types.intp,) + metadata = self._get_metadata(foo, sig=sig) + pysrc, pysrc_line_start = inspect.getsourcelines(foo) + + # Looks for SSA versioned names i.e. $ of the + # variable 'c' and captures the line + expr = r'.*!DILocalVariable\(name: "c\$[0-9]?",.*line: ([0-9]+),.*' + matcher = re.compile(expr) + associated_lines = set() + for md in metadata: + match = matcher.match(md) + if match: + groups = match.groups() + self.assertEqual(len(groups), 1) + associated_lines.add(int(groups[0])) + self.assertEqual(len(associated_lines), 2) # 2 SSA versioned names 'c' + + # Now find the `c = ` lines in the python source + py_lines = set() + for ix, pyln in enumerate(pysrc): + if 'c = ' in pyln: + py_lines.add(ix + pysrc_line_start) + self.assertEqual(len(py_lines), 2) # 2 assignments to c + + # check that the DILocation from the DI for `c` matches the python src + self.assertEqual(associated_lines, py_lines) + + def test_numeric_scalars(self): + """ Tests that dwarf info is correctly emitted for numeric scalars.""" + + DI = namedtuple('DI', 'name bits encoding') + + type_infos = {np.float32: DI("float32", 32, "DW_ATE_float"), + np.float64: DI("float64", 64, "DW_ATE_float"), + np.int8: DI("int8", 8, "DW_ATE_signed"), + np.int16: DI("int16", 16, "DW_ATE_signed"), + np.int32: DI("int32", 32, "DW_ATE_signed"), + np.int64: DI("int64", 64, "DW_ATE_signed"), + np.uint8: DI("uint8", 8, "DW_ATE_unsigned"), + np.uint16: DI("uint16", 16, "DW_ATE_unsigned"), + np.uint32: DI("uint32", 32, "DW_ATE_unsigned"), + np.uint64: DI("uint64", 64, "DW_ATE_unsigned"), + np.complex64: DI("complex64", 64, + "DW_TAG_structure_type"), + np.complex128: DI("complex128", 128, + "DW_TAG_structure_type"),} + + for ty, dwarf_info in type_infos.items(): + + @njit(debug=True) + def foo(): + a = ty(10) + return a + + metadata = self._get_metadata(foo, sig=()) + metadata_definition_map = self._get_metadata_map(metadata) + + for k, v in metadata_definition_map.items(): + if 'DILocalVariable(name: "a"' in v: + lvar = metadata_definition_map[k] + break + else: + assert 0, "missing DILocalVariable 'a'" + + type_marker = re.match('.*type: (![0-9]+).*', lvar).groups()[0] + type_decl = metadata_definition_map[type_marker] + + if 'DW_ATE' in dwarf_info.encoding: + expected = (f'!DIBasicType(name: "{dwarf_info.name}", ' + f'size: {dwarf_info.bits}, ' + f'encoding: {dwarf_info.encoding})') + self.assertEqual(type_decl, expected) + else: # numerical complex type + # Don't match the whole string, just the known parts + raw_flt = 'float' if dwarf_info.bits == 64 else 'double' + expected = (f'distinct !DICompositeType(' + f'tag: {dwarf_info.encoding}, ' + f'name: "{dwarf_info.name} ' + f'({{{raw_flt}, {raw_flt}}})", ' + f'size: {dwarf_info.bits}') + self.assertIn(expected, type_decl) + + def test_arrays(self): + + @njit(debug=True) + def foo(): + a = np.ones((2, 3), dtype=np.float64) + return a + + metadata = self._get_metadata(foo, sig=()) + metadata_definition_map = self._get_metadata_map(metadata) + + for k, v in metadata_definition_map.items(): + if 'DILocalVariable(name: "a"' in v: + lvar = metadata_definition_map[k] + break + else: + assert 0, "missing DILocalVariable 'a'" + + type_marker = re.match('.*type: (![0-9]+).*', lvar).groups()[0] + type_decl = metadata_definition_map[type_marker] + + # check type + self.assertIn("!DICompositeType(tag: DW_TAG_structure_type", type_decl) + # check name encoding + self.assertIn(f'name: "{str(types.float64[:, ::1])}', type_decl) + + # pop out the "elements" of the composite type + match_elements = re.compile(r'.*elements: (![0-9]+),.*') + elem_matches = match_elements.match(type_decl).groups() + self.assertEqual(len(elem_matches), 1) + elem_match = elem_matches[0] + # The match should be something like, it's the elements from an array + # data model. + # !{!35, !36, !37, !39, !40, !43, !45}' + struct_markers = metadata_definition_map[elem_match] + struct_pattern = '!{' + '(![0-9]+), ' * 6 + '(![0-9]+)}' + match_struct = re.compile(struct_pattern) + struct_member_matches = match_struct.match(struct_markers).groups() + self.assertIsNotNone(struct_member_matches is not None) + data_model = default_manager.lookup(types.float64[:, ::1]) + self.assertEqual(len(struct_member_matches), len(data_model._fields)) + + ptr_size = types.intp.bitwidth + ptr_re = (r'!DIDerivedType\(tag: DW_TAG_pointer_type, ' + rf'baseType: ![0-9]+, size: {ptr_size}\)') + int_re = (rf'!DIBasicType\(name: "int{ptr_size}", size: {ptr_size}, ' + r'encoding: DW_ATE_signed\)') + utuple_re = (r'!DICompositeType\(tag: DW_TAG_array_type, ' + rf'name: "UniTuple\(int{ptr_size} x 2\) ' + rf'\(\[2 x i{ptr_size}\]\)", baseType: ![0-9]+, ' + rf'size: {2 * ptr_size}, elements: ![0-9]+, ' + rf'identifier: "\[2 x i{ptr_size}\]"\)') + expected = {'meminfo': ptr_re, + 'parent': ptr_re, + 'nitems': int_re, + 'itemsize': int_re, + 'data': ptr_re, + 'shape': utuple_re, + 'strides': utuple_re} + + # look for `baseType: <>` for the type + base_type_pattern = r'!DIDerivedType\(.*, baseType: (![0-9]+),.*' + base_type_matcher = re.compile(base_type_pattern) + + for ix, field in enumerate(data_model._fields): + derived_type = metadata_definition_map[struct_member_matches[ix]] + self.assertIn("DIDerivedType", derived_type) + self.assertIn(f'name: "{field}"', derived_type) + base_type_match = base_type_matcher.match(derived_type) + base_type_matches = base_type_match.groups() + self.assertEqual(len(base_type_matches), 1) + base_type_marker = base_type_matches[0] + data_type = metadata_definition_map[base_type_marker] + self.assertRegex(data_type, expected[field]) + + def test_debug_optnone(self): + def get_debug_lines(fn): + metadata = self._get_metadata(fn, fn.signatures[0]) + lines = self._get_lines_from_debuginfo(metadata) + return lines + + def get_func_attrs(fn): + cres = fn.overloads[fn.signatures[0]] + lib = cres.library + fn = lib._final_module.get_function(cres.fndesc.mangled_name) + attrs = set(b' '.join(fn.attributes).split()) + return attrs + + def foo(): + n = 10 + c = 0 + for i in range(n): + c += i + return c + + foo_debug = njit(debug=True)(foo) + foo_debug_optnone = njit(debug=True, _dbg_optnone=True)(foo) + foo_debug_optnone_inline = njit(debug=True, _dbg_optnone=True, + forceinline=True)(foo) + + firstline = foo.__code__.co_firstlineno + + expected_info = {} + expected_info[foo_debug] = dict( + # just the dummy line-0 and the line of the return statement + lines={0, firstline + 5}, + must_have_attrs=set(), + must_not_have_attrs=set([b"optnone"]), + ) + expected_info[foo_debug_optnone] = dict( + # all the lines should be included + lines=set(range(firstline + 1, firstline + 6)), + must_have_attrs=set([b"optnone"]), + must_not_have_attrs=set(), + ) + expected_info[foo_debug_optnone_inline] = dict( + # optnone=True is overridden by forceinline, so this looks like the + # foo_debug version + lines={0, firstline + 5}, + must_have_attrs=set([b"alwaysinline"]), + must_not_have_attrs=set([b"optnone"]), + ) + + expected_ret = foo() + + for udt, expected in expected_info.items(): + with self.subTest(udt.targetoptions): + got = udt() + self.assertEqual(got, expected_ret) + + # Compare the line locations in the debug info. + self.assertEqual(get_debug_lines(udt), expected["lines"]) + + # Check for attributes on the LLVM function + attrs = get_func_attrs(udt) + must_have = expected["must_have_attrs"] + self.assertEqual(attrs & must_have, must_have) + must_not_have = expected["must_not_have_attrs"] + self.assertFalse(attrs & must_not_have) + + def test_omitted_arg(self): + # See issue 7726 + @njit(debug=True) + def foo(missing=None): + pass + + # check that it will actually compile (verifies DI emission is ok) + with override_config('DEBUGINFO_DEFAULT', 1): + foo() + + metadata = self._get_metadata(foo, sig=(types.Omitted(None),)) + metadata_definition_map = self._get_metadata_map(metadata) + + # Find DISubroutineType + tmp_disubr = [] + for md in metadata: + if "DISubroutineType" in md: + tmp_disubr.append(md) + self.assertEqual(len(tmp_disubr), 1) + disubr = tmp_disubr.pop() + + disubr_matched = re.match(r'.*!DISubroutineType\(types: ([!0-9]+)\)$', + disubr) + self.assertIsNotNone(disubr_matched) + disubr_groups = disubr_matched.groups() + self.assertEqual(len(disubr_groups), 1) + disubr_meta = disubr_groups[0] + + # Find the types in the DISubroutineType arg list + disubr_types = metadata_definition_map[disubr_meta] + disubr_types_matched = re.match(r'!{(.*)}', disubr_types) + self.assertIsNotNone(disubr_matched) + disubr_types_groups = disubr_types_matched.groups() + self.assertEqual(len(disubr_types_groups), 1) + + # fetch out and assert the last argument type, should be void * + md_fn_arg = [x.strip() for x in disubr_types_groups[0].split(',')][-1] + arg_ty = metadata_definition_map[md_fn_arg] + expected_arg_ty = (r'^.*!DICompositeType\(tag: DW_TAG_structure_type, ' + r'name: "Anonymous struct \({}\)", elements: ' + r'(![0-9]+), identifier: "{}"\)') + self.assertRegex(arg_ty, expected_arg_ty) + md_base_ty = re.match(expected_arg_ty, arg_ty).groups()[0] + base_ty = metadata_definition_map[md_base_ty] + # expect ir.LiteralStructType([]) + self.assertEqual(base_ty, ('!{}')) + + def test_missing_source(self): + strsrc = """ + def foo(): + return 1 + """ + l = dict() + exec(dedent(strsrc), {}, l) + foo = njit(debug=True)(l['foo']) + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', NumbaDebugInfoWarning) + ignore_internal_warnings() + foo() + + self.assertEqual(len(w), 1) + found = w[0] + self.assertEqual(found.category, NumbaDebugInfoWarning) + msg = str(found.message) + # make sure the warning contains the right message + self.assertIn('Could not find source for function', msg) + # and refers to the offending function + self.assertIn(str(foo.py_func), msg) + + def test_irregularly_indented_source(self): + + @njit(debug=True) + def foo(): +# NOTE: THIS COMMENT MUST START AT COLUMN 0 FOR THIS SAMPLE CODE TO BE VALID # noqa: E115, E501 + return 1 + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', NumbaDebugInfoWarning) + ignore_internal_warnings() + foo() + + # No warnings + self.assertEqual(len(w), 0) + + metadata = self._get_metadata(foo, foo.signatures[0]) + lines = self._get_lines_from_debuginfo(metadata) + # Only one line + self.assertEqual(len(lines), 1) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_deprecations.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_deprecations.py new file mode 100644 index 0000000000000000000000000000000000000000..48b5a36aec59b9bc15c672486d947d13ca595870 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_deprecations.py @@ -0,0 +1,262 @@ +import warnings +import unittest +from contextlib import contextmanager + +from numba import jit, vectorize, guvectorize +from numba.core.errors import (NumbaDeprecationWarning, + NumbaPendingDeprecationWarning, NumbaWarning) +from numba.tests.support import TestCase, needs_setuptools + + +@contextmanager +def _catch_numba_deprecation_warnings(): + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("ignore", category=NumbaWarning) + warnings.simplefilter("always", category=NumbaDeprecationWarning) + yield w + + +class TestDeprecation(TestCase): + + def check_warning(self, warnings, expected_str, category, check_rtd=True): + self.assertEqual(len(warnings), 1) + self.assertEqual(warnings[0].category, category) + self.assertIn(expected_str, str(warnings[0].message)) + if check_rtd: + self.assertIn("https://numba.readthedocs.io", + str(warnings[0].message)) + + @TestCase.run_test_in_subprocess + def test_explicit_false_nopython_kwarg(self): + # tests that explicitly setting `nopython=False` in @jit raises a + # warning about it doing nothing. + with _catch_numba_deprecation_warnings() as w: + + @jit(nopython=False) + def foo(): + pass + + foo() + + msg = "The keyword argument 'nopython=False' was supplied" + self.check_warning(w, msg, NumbaDeprecationWarning, check_rtd=False) + + @TestCase.run_test_in_subprocess + def test_vectorize_missing_nopython_kwarg_not_reported(self): + # Checks that use of @vectorize without a nopython kwarg doesn't raise + # a warning about lack of said kwarg. + + with _catch_numba_deprecation_warnings() as w: + # This compiles via nopython mode directly + @vectorize('float64(float64)') + def foo(a): + return a + 1 + + self.assertFalse(w) + + @TestCase.run_test_in_subprocess + def test_vectorize_nopython_false_is_reported(self): + # Checks that use of @vectorize with nopython=False raises a warning + # about supplying it. + + with _catch_numba_deprecation_warnings() as w: + # This compiles via nopython mode directly + @vectorize('float64(float64)', nopython=False) + def foo(a): + return a + 1 + + msg = "The keyword argument 'nopython=False' was supplied" + self.check_warning(w, msg, NumbaDeprecationWarning, check_rtd=False) + + @TestCase.run_test_in_subprocess + def test_vectorize_objmode_direct_compilation_no_warnings(self): + # Checks that use of @vectorize with forceobj=True raises no warnings. + + with _catch_numba_deprecation_warnings() as w: + # Compiles via objmode directly with no warnings raised + @vectorize('float64(float64)', forceobj=True) + def foo(a): + object() + return a + 1 + + self.assertFalse(w) + + @TestCase.run_test_in_subprocess + def test_vectorize_objmode_compilation_nopython_false_warns(self): + # Checks that use of @vectorize with forceobj set and nopython set as + # False raises no warnings. + + with _catch_numba_deprecation_warnings() as w: + # Compiles via objmode directly with no warnings raised + @vectorize('float64(float64)', forceobj=True, nopython=False) + def foo(a): + object() + return a + 1 + + msg = "The keyword argument 'nopython=False' was supplied" + self.check_warning(w, msg, NumbaDeprecationWarning, check_rtd=False) + + @TestCase.run_test_in_subprocess + def test_vectorize_parallel_true_no_warnings(self): + # Checks that use of @vectorize with the parallel target doesn't + # raise warnings about nopython kwarg, the parallel target doesn't + # support objmode so nopython=True is implicit. + with _catch_numba_deprecation_warnings() as w: + @vectorize('float64(float64)', target='parallel') + def foo(x): + return x + 1 + + self.assertFalse(w) + + @TestCase.run_test_in_subprocess + def test_vectorize_parallel_true_nopython_true_no_warnings(self): + # Checks that use of @vectorize with the parallel target and + # nopython=True doesn't raise warnings about nopython kwarg. + with _catch_numba_deprecation_warnings() as w: + @vectorize('float64(float64)', target='parallel', nopython=True) + def foo(x): + return x + 1 + + self.assertFalse(w) + + @TestCase.run_test_in_subprocess + def test_vectorize_parallel_true_nopython_false_warns(self): + # Checks that use of @vectorize with the parallel target and + # nopython=False raises a warning about the nopython kwarg being False. + with _catch_numba_deprecation_warnings() as w: + @vectorize('float64(float64)', target='parallel', nopython=False) + def foo(x): + return x + 1 + + msg = "The keyword argument 'nopython=False' was supplied" + self.check_warning(w, msg, NumbaDeprecationWarning, check_rtd=False) + + @TestCase.run_test_in_subprocess + def test_vectorize_calling_jit_with_nopython_false_warns_from_jit(self): + # Checks the scope of the suppression of deprecation warnings that are + # present in e.g. vectorize. The function `bar` should raise a + # deprecation warning, the `@vectorize`d `foo` function should not, + # even though both don't have a nopython kwarg. + + # First check that the @vectorize call doesn't raise anything + with _catch_numba_deprecation_warnings() as w: + @vectorize('float64(float64)', forceobj=True) + def foo(x): + return bar(x + 1) + + def bar(*args): + pass + + self.assertFalse(w) + + @TestCase.run_test_in_subprocess + def test_guvectorize_implicit_nopython_no_warnings(self): + # Checks that use of @guvectorize with implicit nopython compilation + # does not warn on compilation. + with _catch_numba_deprecation_warnings() as w: + + @guvectorize('void(float64[::1], float64[::1])', '(n)->(n)') + def bar(a, b): + a += 1 + + self.assertFalse(w) + + @TestCase.run_test_in_subprocess + def test_guvectorize_forceobj_no_warnings(self): + # Checks that use of @guvectorize with direct objmode compilation does + # not warn. + with _catch_numba_deprecation_warnings() as w: + + @guvectorize('void(float64[::1], float64[::1])', '(n)->(n)', + forceobj=True) + def bar(a, b): + object() + a += 1 + + self.assertFalse(w) + + @TestCase.run_test_in_subprocess + def test_guvectorize_parallel_implicit_nopython_no_warnings(self): + # Checks that use of @guvectorize with parallel target and implicit + # nopython mode compilation does not warn. + with _catch_numba_deprecation_warnings() as w: + + @guvectorize('void(float64[::1], float64[::1])', '(n)->(n)', + target='parallel') + def bar(a, b): + a += 1 + + self.assertFalse(w) + + @TestCase.run_test_in_subprocess + def test_guvectorize_parallel_forceobj_no_warnings(self): + # Checks that use of @guvectorize with parallel target and direct + # objmode compilation does not warn. + with _catch_numba_deprecation_warnings() as w: + + # This compiles somewhat surprisingly for the parallel target using + # object mode?! + @guvectorize('void(float64[::1], float64[::1])', '(n)->(n)', + target='parallel', forceobj=True) + def bar(a, b): + object() + a += 1 + + self.assertFalse(w) + + @TestCase.run_test_in_subprocess + def test_reflection_of_mutable_container(self): + # tests that reflection in list/set warns + def foo_list(a): + return a.append(1) + + def foo_set(a): + return a.add(1) + + for f in [foo_list, foo_set]: + container = f.__name__.strip('foo_') + inp = eval(container)([10, ]) + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("ignore", category=NumbaWarning) + warnings.simplefilter("always", + category=NumbaPendingDeprecationWarning) + jit(nopython=True)(f)(inp) + self.assertEqual(len(w), 1) + self.assertEqual(w[0].category, NumbaPendingDeprecationWarning) + warn_msg = str(w[0].message) + msg = ("Encountered the use of a type that is scheduled for " + "deprecation") + self.assertIn(msg, warn_msg) + msg = ("\'reflected %s\' found for argument" % container) + self.assertIn(msg, warn_msg) + self.assertIn("https://numba.readthedocs.io", warn_msg) + + @needs_setuptools + @TestCase.run_test_in_subprocess + def test_pycc_module(self): + # checks import of module warns + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always", + category=NumbaPendingDeprecationWarning) + import numba.pycc # noqa: F401 + + expected_str = ("The 'pycc' module is pending deprecation.") + self.check_warning(w, expected_str, NumbaPendingDeprecationWarning) + + @needs_setuptools + @TestCase.run_test_in_subprocess + def test_pycc_CC(self): + # check the most commonly used functionality (CC) warns + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always", + category=NumbaPendingDeprecationWarning) + from numba.pycc import CC # noqa: F401 + + expected_str = ("The 'pycc' module is pending deprecation.") + self.check_warning(w, expected_str, NumbaPendingDeprecationWarning) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dictimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dictimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..4814e843610a7d53c9d6edf6598f19e3bd43113d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dictimpl.py @@ -0,0 +1,656 @@ +""" +Testing C implementation of the numba dictionary +""" + +import ctypes +import random + +from numba.tests.support import TestCase +from numba import _helperlib, jit, typed, types +from numba.core.config import IS_32BITS +from numba.core.datamodel.models import UniTupleModel +from numba.extending import register_model, typeof_impl, unbox, overload + + +DKIX_EMPTY = -1 + + +ALIGN = 4 if IS_32BITS else 8 + + +class Dict(object): + """A wrapper around the C-API to provide a minimal dictionary object for + testing. + """ + def __init__(self, tc, keysize, valsize): + """ + Parameters + ---------- + tc : TestCase instance + keysize : int + byte size for the key + valsize : int + byte size for the value + """ + self.tc = tc + self.keysize = keysize + self.valsize = valsize + self.dp = self.dict_new_minsize(keysize, valsize) + + def __del__(self): + self.tc.numba_dict_free(self.dp) + + def __len__(self): + return self.dict_length() + + def __setitem__(self, k, v): + bk = bytes(k.encode()) + bv = bytes(v.encode()) + self.tc.assertEqual(len(bk), self.keysize) + self.tc.assertEqual(len(bv), self.valsize) + self.dict_insert(bk, bv) + + def __getitem__(self, k): + bk = bytes(k.encode()) + self.tc.assertEqual(len(bk), self.keysize) + ix, old = self.dict_lookup(bk) + if ix == DKIX_EMPTY: + raise KeyError + else: + return old.decode() + + def __delitem__(self, k): + bk = bytes(k.encode()) + self.tc.assertEqual(len(bk), self.keysize) + if not self.dict_delitem(bk): + raise KeyError(k) + + def get(self, k): + try: + return self[k] + except KeyError: + return + + def items(self): + return DictIter(self) + + def popitem(self): + k, v = self.dict_popitem() + return k.decode(), v.decode() + + # + # The methods below are higher-level wrappers for the C-API + # + + def dict_new_minsize(self, key_size, val_size): + dp = ctypes.c_void_p() + status = self.tc.numba_dict_new_sized( + ctypes.byref(dp), 0, key_size, val_size, + ) + self.tc.assertEqual(status, 0) + return dp + + def dict_length(self): + return self.tc.numba_dict_length(self.dp) + + def dict_insert(self, key_bytes, val_bytes): + hashval = hash(key_bytes) + status = self.tc.numba_dict_insert_ez( + self.dp, key_bytes, hashval, val_bytes, + ) + self.tc.assertGreaterEqual(status, 0) + + def dict_lookup(self, key_bytes): + hashval = hash(key_bytes) + oldval_bytes = ctypes.create_string_buffer(self.valsize) + ix = self.tc.numba_dict_lookup( + self.dp, key_bytes, hashval, oldval_bytes, + ) + self.tc.assertGreaterEqual(ix, DKIX_EMPTY) + return ix, oldval_bytes.value + + def dict_delitem(self, key_bytes): + ix, oldval = self.dict_lookup(key_bytes) + if ix == DKIX_EMPTY: + return False + hashval = hash(key_bytes) + status = self.tc.numba_dict_delitem(self.dp, hashval, ix) + self.tc.assertEqual(status, 0) + return True + + def dict_popitem(self): + key_bytes = ctypes.create_string_buffer(self.keysize) + val_bytes = ctypes.create_string_buffer(self.valsize) + status = self.tc.numba_dict_popitem(self.dp, key_bytes, val_bytes) + if status != 0: + if status == -4: + raise KeyError('popitem(): dictionary is empty') + else: + self.tc._fail('Unknown') + return key_bytes.value, val_bytes.value + + def dict_iter(self, itptr): + self.tc.numba_dict_iter(itptr, self.dp) + + def dict_iter_next(self, itptr): + bk = ctypes.c_void_p(0) + bv = ctypes.c_void_p(0) + status = self.tc.numba_dict_iter_next( + itptr, ctypes.byref(bk), ctypes.byref(bv), + ) + if status == -2: + raise ValueError('dictionary mutated') + elif status == -3: + return + else: + self.tc.assertGreaterEqual(status, 0) + + # Check the alignment of the key-value in the entries. + # We know we are getting the pointers to data in the entries. + + self.tc.assertEqual(bk.value % ALIGN, 0, msg='key not aligned') + self.tc.assertEqual(bv.value % ALIGN, 0, msg='val not aligned') + + key = (ctypes.c_char * self.keysize).from_address(bk.value) + val = (ctypes.c_char * self.valsize).from_address(bv.value) + return key.value, val.value + + +class DictIter(object): + """A iterator for the `Dict.items()`. + + Only the `.items()` is needed. `.keys` and `.values` can be trivially + implemented on the `.items` iterator. + """ + def __init__(self, parent): + self.parent = parent + itsize = self.parent.tc.numba_dict_iter_sizeof() + self.it_state_buf = (ctypes.c_char_p * itsize)(0) + self.it = ctypes.cast(self.it_state_buf, ctypes.c_void_p) + self.parent.dict_iter(self.it) + + def __iter__(self): + return self + + def __next__(self): + out = self.parent.dict_iter_next(self.it) + if out is None: + raise StopIteration + else: + k, v = out + return k.decode(), v.decode() + + next = __next__ # needed for py2 only + + +class Parametrized(tuple): + """supporting type for TestDictImpl.test_parametrized_types + needs to be global to be cacheable""" + def __init__(self, tup): + assert all(isinstance(v, str) for v in tup) + + +class ParametrizedType(types.Type): + """this is essentially UniTuple(unicode_type, n) + BUT type name is the same for all n""" + + def __init__(self, value): + super(ParametrizedType, self).__init__('ParametrizedType') + self.dtype = types.unicode_type + self.n = len(value) + + @property + def key(self): + return self.n + + def __len__(self): + return self.n + + +class TestDictImpl(TestCase): + def setUp(self): + """Bind to the c_helper library and provide the ctypes wrapper. + """ + dict_t = ctypes.c_void_p + iter_t = ctypes.c_void_p + hash_t = ctypes.c_ssize_t + + def wrap(name, restype, argtypes=()): + proto = ctypes.CFUNCTYPE(restype, *argtypes) + return proto(_helperlib.c_helpers[name]) + + # numba_test_dict() + self.numba_test_dict = wrap( + 'test_dict', + ctypes.c_int, + ) + # numba_dict_new_sized( + # NB_Dict **out, + # Py_ssize_t n_keys, + # Py_ssize_t key_size, + # Py_ssize_t val_size + # ) + self.numba_dict_new_sized = wrap( + 'dict_new_sized', + ctypes.c_int, + [ + ctypes.POINTER(dict_t), # out + ctypes.c_ssize_t, # n_keys + ctypes.c_ssize_t, # key_size + ctypes.c_ssize_t, # val_size + ], + ) + # numba_dict_free(NB_Dict *d) + self.numba_dict_free = wrap( + 'dict_free', + None, + [dict_t], + ) + # numba_dict_length(NB_Dict *d) + self.numba_dict_length = wrap( + 'dict_length', + ctypes.c_ssize_t, + [dict_t], + ) + # numba_dict_insert_ez( + # NB_Dict *d, + # const char *key_bytes, + # Py_hash_t hash, + # const char *val_bytes, + # ) + self.numba_dict_insert_ez = wrap( + 'dict_insert_ez', + ctypes.c_int, + [ + dict_t, # d + ctypes.c_char_p, # key_bytes + hash_t, # hash + ctypes.c_char_p, # val_bytes + ], + ) + # numba_dict_lookup( + # NB_Dict *d, + # const char *key_bytes, + # Py_hash_t hash, + # char *oldval_bytes + # ) + self.numba_dict_lookup = wrap( + 'dict_lookup', + ctypes.c_ssize_t, + [ + dict_t, # d + ctypes.c_char_p, # key_bytes + hash_t, # hash + ctypes.c_char_p, # oldval_bytes + ], + ) + # numba_dict_delitem( + # NB_Dict *d, + # Py_hash_t hash, + # Py_ssize_t ix + # ) + self.numba_dict_delitem = wrap( + 'dict_delitem', + ctypes.c_int, + [ + dict_t, # d + hash_t, # hash + ctypes.c_ssize_t, # ix + ], + ) + # numba_dict_popitem( + # NB_Dict *d, + # char *key_bytes, + # char *val_bytes + # ) + self.numba_dict_popitem = wrap( + 'dict_popitem', + ctypes.c_int, + [ + dict_t, # d + ctypes.c_char_p, # key_bytes + ctypes.c_char_p, # val_bytes + ], + ) + # numba_dict_iter_sizeof() + self.numba_dict_iter_sizeof = wrap( + 'dict_iter_sizeof', + ctypes.c_size_t, + ) + # numba_dict_iter( + # NB_DictIter *it, + # NB_Dict *d + # ) + self.numba_dict_iter = wrap( + 'dict_iter', + None, + [ + iter_t, + dict_t, + ], + ) + # numba_dict_iter_next( + # NB_DictIter *it, + # const char **key_ptr, + # const char **val_ptr + # ) + self.numba_dict_iter_next = wrap( + 'dict_iter_next', + ctypes.c_int, + [ + iter_t, # it + ctypes.POINTER(ctypes.c_void_p), # key_ptr + ctypes.POINTER(ctypes.c_void_p), # val_ptr + ], + ) + + def test_simple_c_test(self): + # Runs the basic test in C. + ret = self.numba_test_dict() + self.assertEqual(ret, 0) + + def test_insertion_small(self): + # Tests insertion and lookup for a small dict. + d = Dict(self, 4, 8) + self.assertEqual(len(d), 0) + self.assertIsNone(d.get('abcd')) + + # First key + d['abcd'] = 'beefcafe' + self.assertEqual(len(d), 1) + self.assertIsNotNone(d.get('abcd')) + self.assertEqual(d['abcd'], 'beefcafe') + + # Duplicated key replaces + d['abcd'] = 'cafe0000' + self.assertEqual(len(d), 1) + self.assertEqual(d['abcd'], 'cafe0000') + + # Second key + d['abce'] = 'cafe0001' + self.assertEqual(len(d), 2) + self.assertEqual(d['abcd'], 'cafe0000') + self.assertEqual(d['abce'], 'cafe0001') + + # Third key + d['abcf'] = 'cafe0002' + self.assertEqual(len(d), 3) + self.assertEqual(d['abcd'], 'cafe0000') + self.assertEqual(d['abce'], 'cafe0001') + self.assertEqual(d['abcf'], 'cafe0002') + + def check_insertion_many(self, nmax): + # Helper to test insertion/lookup/resize + d = Dict(self, 8, 8) + + def make_key(v): + return "key_{:04}".format(v) + + def make_val(v): + return "val_{:04}".format(v) + + # Check insert + for i in range(nmax): + d[make_key(i)] = make_val(i) + self.assertEqual(len(d), i + 1) + + # Check lookup + for i in range(nmax): + self.assertEqual(d[make_key(i)], make_val(i)) + + def test_insertion_many(self): + # Test insertion for differently sized dict + # Around minsize + self.check_insertion_many(nmax=7) + self.check_insertion_many(nmax=8) + self.check_insertion_many(nmax=9) + # Around nmax = 32 + self.check_insertion_many(nmax=31) + self.check_insertion_many(nmax=32) + self.check_insertion_many(nmax=33) + # Around nmax = 1024 + self.check_insertion_many(nmax=1023) + self.check_insertion_many(nmax=1024) + self.check_insertion_many(nmax=1025) + # Around nmax = 4096 + self.check_insertion_many(nmax=4095) + self.check_insertion_many(nmax=4096) + self.check_insertion_many(nmax=4097) + + def test_deletion_small(self): + # Test deletion + d = Dict(self, 4, 8) + self.assertEqual(len(d), 0) + self.assertIsNone(d.get('abcd')) + + d['abcd'] = 'cafe0000' + d['abce'] = 'cafe0001' + d['abcf'] = 'cafe0002' + + self.assertEqual(len(d), 3) + self.assertEqual(d['abcd'], 'cafe0000') + self.assertEqual(d['abce'], 'cafe0001') + self.assertEqual(d['abcf'], 'cafe0002') + self.assertEqual(len(d), 3) + + # Delete first item + del d['abcd'] + self.assertIsNone(d.get('abcd')) + self.assertEqual(d['abce'], 'cafe0001') + self.assertEqual(d['abcf'], 'cafe0002') + self.assertEqual(len(d), 2) + + # Delete first item again + with self.assertRaises(KeyError): + del d['abcd'] + + # Delete third + del d['abcf'] + self.assertIsNone(d.get('abcd')) + self.assertEqual(d['abce'], 'cafe0001') + self.assertIsNone(d.get('abcf')) + self.assertEqual(len(d), 1) + + # Delete second + del d['abce'] + self.assertIsNone(d.get('abcd')) + self.assertIsNone(d.get('abce')) + self.assertIsNone(d.get('abcf')) + self.assertEqual(len(d), 0) + + def check_delete_randomly(self, nmax, ndrop, nrefill, seed=0): + # Helper to test deletion + random.seed(seed) + + d = Dict(self, 8, 8) + keys = {} + + def make_key(v): + return "k_{:06x}".format(v) + + def make_val(v): + return "v_{:06x}".format(v) + + for i in range(nmax): + d[make_key(i)] = make_val(i) + + # Fill to nmax + for i in range(nmax): + k = make_key(i) + v = make_val(i) + keys[k] = v + self.assertEqual(d[k], v) + + self.assertEqual(len(d), nmax) + + # Randomly drop + droplist = random.sample(list(keys), ndrop) + remain = keys.copy() + for i, k in enumerate(droplist, start=1): + del d[k] + del remain[k] + self.assertEqual(len(d), nmax - i) + self.assertEqual(len(d), nmax - ndrop) + + # Make sure everything dropped is gone + for k in droplist: + self.assertIsNone(d.get(k)) + + # Make sure everything else is still here + for k in remain: + self.assertEqual(d[k], remain[k]) + + # Refill + for i in range(nrefill): + k = make_key(nmax + i) + v = make_val(nmax + i) + remain[k] = v + d[k] = v + + self.assertEqual(len(remain), len(d)) + + # Make sure everything is here + for k in remain: + self.assertEqual(d[k], remain[k]) + + def test_delete_randomly(self): + # Test deletion for differently sized dict + self.check_delete_randomly(nmax=8, ndrop=2, nrefill=2) + self.check_delete_randomly(nmax=13, ndrop=10, nrefill=31) + self.check_delete_randomly(nmax=100, ndrop=50, nrefill=200) + self.check_delete_randomly(nmax=100, ndrop=99, nrefill=100) + self.check_delete_randomly(nmax=100, ndrop=100, nrefill=100) + self.check_delete_randomly(nmax=1024, ndrop=999, nrefill=1) + self.check_delete_randomly(nmax=1024, ndrop=999, nrefill=2048) + + def test_delete_randomly_large(self): + # Go beyond 2^16 to exercise large indices. + # Internally, size of index changes as the hashtable size changes. + # Size of index can be 8, 16, 32 or 64 bytes (on 64-bit). + # We are not inserting >2^32 elements because of limitation of time. + self.check_delete_randomly(nmax=2**17, ndrop=2**16, nrefill=2**10) + + def test_popitem(self): + nmax = 10 + d = Dict(self, 8, 8) + + def make_key(v): + return "k_{:06x}".format(v) + + def make_val(v): + return "v_{:06x}".format(v) + + for i in range(nmax): + d[make_key(i)] = make_val(i) + + self.assertEqual(len(d), nmax) + k, v = d.popitem() + self.assertEqual(len(d), nmax - 1) + self.assertEqual(k, make_key(len(d))) + self.assertEqual(v, make_val(len(d))) + + while len(d): + n = len(d) + k, v = d.popitem() + self.assertEqual(len(d), n - 1) + self.assertEqual(k, make_key(len(d))) + self.assertEqual(v, make_val(len(d))) + + self.assertEqual(len(d), 0) + with self.assertRaises(KeyError) as raises: + d.popitem() + self.assertIn( + 'popitem(): dictionary is empty', + str(raises.exception), + ) + + def test_iter_items(self): + # Test .items iteration + d = Dict(self, 4, 4) + nmax = 1000 + + def make_key(v): + return "{:04}".format(v) + + def make_val(v): + return "{:04}".format(v + nmax) + + for i in range(nmax): + d[make_key(i)] = make_val(i) + + # Check that the everything is ordered + for i, (k, v) in enumerate(d.items()): + self.assertEqual(make_key(i), k) + self.assertEqual(make_val(i), v) + + def check_sizing(self, key_size, val_size, nmax): + # Helper to verify different key/value sizes. + d = Dict(self, key_size, val_size) + + def make_key(v): + return "{:0{}}".format(v, key_size)[:key_size] + + def make_val(v): + return "{:0{}}".format(nmax - v - 1, val_size)[:val_size] + + for i in range(nmax): + d[make_key(i)] = make_val(i) + + # Check that the everything is ordered + for i, (k, v) in enumerate(d.items()): + self.assertEqual(make_key(i), k) + self.assertEqual(make_val(i), v) + + def test_sizing(self): + # Check different sizes of the key & value. + for i in range(1, 8): + self.check_sizing(key_size=i, val_size=i, nmax=2**i) + + def test_parameterized_types(self): + """https://github.com/numba/numba/issues/6401""" + + register_model(ParametrizedType)(UniTupleModel) + + @typeof_impl.register(Parametrized) + def typeof_unit(val, c): + return ParametrizedType(val) + + @unbox(ParametrizedType) + def unbox_parametrized(typ, obj, context): + return context.unbox(types.UniTuple(typ.dtype, len(typ)), obj) + + def dict_vs_cache_vs_parametrized(v): + assert 0 + + @overload(dict_vs_cache_vs_parametrized) + def ol_dict_vs_cache_vs_parametrized(v): + typ = v + + def objmode_vs_cache_vs_parametrized_impl(v): + # typed.List shows same behaviour after fix for #6397 + d = typed.Dict.empty(types.unicode_type, typ) + d['data'] = v + + return objmode_vs_cache_vs_parametrized_impl + + @jit(nopython=True, cache=True) + def set_parametrized_data(x, y): + # Has had a tendency to segfault when the compiled function + # was loaded from cache in a different process than the one + # it was originally compiled in. + # The new process is simulated below by resetting the dispatchers + # and the target context + dict_vs_cache_vs_parametrized(x) + dict_vs_cache_vs_parametrized(y) + + x, y = Parametrized(('a', 'b')), Parametrized(('a',)) + set_parametrized_data(x, y) + + # reset dispatchers and targetctx to force re-load from cache as if a + # new process would jit the function + set_parametrized_data._make_finalizer()() + set_parametrized_data._reset_overloads() + set_parametrized_data.targetctx.init() + + for ii in range(50): # <- sometimes works a few times + self.assertIsNone(set_parametrized_data(x, y)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dictobject.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dictobject.py new file mode 100644 index 0000000000000000000000000000000000000000..6b91bfeb33c8a604b6f7739ec2e42a904fadcd7f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dictobject.py @@ -0,0 +1,2561 @@ +""" +Testing numba implementation of the numba dictionary. + +The tests here only check that the numba typing and codegen are working +correctly. Detailed testing of the underlying dictionary operations is done +in test_dictimpl.py. +""" + +import sys +import warnings + +import numpy as np + +from numba import njit, literally +from numba import int32, int64, float32, float64 +from numba import typeof +from numba.typed import Dict, dictobject, List +from numba.typed.typedobjectutils import _sentry_safe_cast +from numba.core.errors import TypingError +from numba.core import types +from numba.tests.support import (TestCase, MemoryLeakMixin, unittest, + override_config, forbid_codegen) +from numba.experimental import jitclass +from numba.extending import overload + + +class TestDictObject(MemoryLeakMixin, TestCase): + def test_dict_bool(self): + """ + Exercise bool(dict) + """ + @njit + def foo(n): + d = dictobject.new_dict(int32, float32) + for i in range(n): + d[i] = i + 1 + return bool(d) + + # Insert nothing + self.assertEqual(foo(n=0), False) + # Insert 1 entry + self.assertEqual(foo(n=1), True) + # Insert 2 entries + self.assertEqual(foo(n=2), True) + # Insert 100 entries + self.assertEqual(foo(n=100), True) + + def test_dict_create(self): + """ + Exercise dictionary creation, insertion and len + """ + @njit + def foo(n): + d = dictobject.new_dict(int32, float32) + for i in range(n): + d[i] = i + 1 + return len(d) + + # Insert nothing + self.assertEqual(foo(n=0), 0) + # Insert 1 entry + self.assertEqual(foo(n=1), 1) + # Insert 2 entries + self.assertEqual(foo(n=2), 2) + # Insert 100 entries + self.assertEqual(foo(n=100), 100) + + def test_dict_get(self): + """ + Exercise dictionary creation, insertion and get + """ + @njit + def foo(n, targets): + d = dictobject.new_dict(int32, float64) + # insertion loop + for i in range(n): + d[i] = i + # retrieval loop + output = [] + for t in targets: + output.append(d.get(t)) + return output + + self.assertEqual(foo(5, [0, 1, 9]), [0, 1, None]) + self.assertEqual(foo(10, [0, 1, 9]), [0, 1, 9]) + self.assertEqual(foo(10, [-1, 9, 1]), [None, 9, 1]) + + def test_dict_get_with_default(self): + """ + Exercise dict.get(k, d) where d is set + """ + @njit + def foo(n, target, default): + d = dictobject.new_dict(int32, float64) + # insertion loop + for i in range(n): + d[i] = i + # retrieval loop + return d.get(target, default) + + self.assertEqual(foo(5, 3, -1), 3) + self.assertEqual(foo(5, 5, -1), -1) + + def test_dict_getitem(self): + """ + Exercise dictionary __getitem__ + """ + @njit + def foo(keys, vals, target): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + + # lookup + return d[target] + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + self.assertEqual(foo(keys, vals, 1), 0.1) + self.assertEqual(foo(keys, vals, 2), 0.2) + self.assertEqual(foo(keys, vals, 3), 0.3) + # check no leak so far + self.assert_no_memory_leak() + # disable leak check for exception test + self.disable_leak_check() + with self.assertRaises(KeyError): + foo(keys, vals, 0) + with self.assertRaises(KeyError): + foo(keys, vals, 4) + + def test_dict_popitem(self): + """ + Exercise dictionary .popitem + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + + # popitem + return d.popitem() + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + for i in range(1, len(keys)): + self.assertEqual( + foo(keys[:i], vals[:i]), + (keys[i - 1], vals[i - 1]), + ) + + def test_dict_popitem_many(self): + """ + Exercise dictionary .popitem + """ + + @njit + def core(d, npop): + # popitem + keysum, valsum = 0, 0 + for _ in range(npop): + k, v = d.popitem() + keysum += k + valsum -= v + return keysum, valsum + + @njit + def foo(keys, vals, npop): + d = dictobject.new_dict(int32, int32) + # insertion + for k, v in zip(keys, vals): + d[k] = v + + return core(d, npop) + + keys = [1, 2, 3] + vals = [10, 20, 30] + + for i in range(len(keys)): + self.assertEqual( + foo(keys, vals, npop=3), + core.py_func(dict(zip(keys, vals)), npop=3), + ) + + # check no leak so far + self.assert_no_memory_leak() + # disable leak check for exception test + self.disable_leak_check() + + with self.assertRaises(KeyError): + foo(keys, vals, npop=4) + + def test_dict_pop(self): + """ + Exercise dictionary .pop + """ + @njit + def foo(keys, vals, target): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + + # popitem + return d.pop(target, None), len(d) + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + + self.assertEqual(foo(keys, vals, 1), (0.1, 2)) + self.assertEqual(foo(keys, vals, 2), (0.2, 2)) + self.assertEqual(foo(keys, vals, 3), (0.3, 2)) + self.assertEqual(foo(keys, vals, 0), (None, 3)) + + # check no leak so far + self.assert_no_memory_leak() + # disable leak check for exception test + self.disable_leak_check() + + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + # popitem + return d.pop(0) + + with self.assertRaises(KeyError): + foo() + + def test_dict_pop_many(self): + """ + Exercise dictionary .pop + """ + + @njit + def core(d, pops): + total = 0 + for k in pops: + total += k + d.pop(k, 0.123) + len(d) + total *= 2 + return total + + @njit + def foo(keys, vals, pops): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + # popitem + return core(d, pops) + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + pops = [2, 3, 3, 1, 0, 2, 1, 0, -1] + + self.assertEqual( + foo(keys, vals, pops), + core.py_func(dict(zip(keys, vals)), pops), + ) + + def test_dict_delitem(self): + @njit + def foo(keys, vals, target): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + del d[target] + return len(d), d.get(target) + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + self.assertEqual(foo(keys, vals, 1), (2, None)) + self.assertEqual(foo(keys, vals, 2), (2, None)) + self.assertEqual(foo(keys, vals, 3), (2, None)) + # check no leak so far + self.assert_no_memory_leak() + # disable leak check for exception test + self.disable_leak_check() + with self.assertRaises(KeyError): + foo(keys, vals, 0) + + def test_dict_clear(self): + """ + Exercise dict.clear + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + b4 = len(d) + # clear + d.clear() + return b4, len(d) + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + self.assertEqual(foo(keys, vals), (3, 0)) + + def test_dict_items(self): + """ + Exercise dict.items + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + out = [] + for kv in d.items(): + out.append(kv) + return out + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + + self.assertEqual( + foo(keys, vals), + list(zip(keys, vals)), + ) + + # Test .items() on empty dict + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + out = [] + for kv in d.items(): + out.append(kv) + return out + + self.assertEqual(foo(), []) + + def test_dict_keys(self): + """ + Exercise dict.keys + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + out = [] + for k in d.keys(): + out.append(k) + return out + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + + self.assertEqual( + foo(keys, vals), + keys, + ) + + def test_dict_keys_len(self): + """ + Exercise len(dict.keys()) + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + return len(d.keys()) + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + + self.assertEqual( + foo(keys, vals), + len(keys), + ) + + def test_dict_values(self): + """ + Exercise dict.values + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + out = [] + for v in d.values(): + out.append(v) + return out + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + + self.assertEqual( + foo(keys, vals), + vals, + ) + + def test_dict_values_len(self): + """ + Exercise len(dict.values()) + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + return len(d.values()) + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + + self.assertEqual( + foo(keys, vals), + len(vals), + ) + + def test_dict_items_len(self): + """ + Exercise len(dict.items()) + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + return len(d.items()) + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + self.assertPreciseEqual( + foo(keys, vals), + len(vals), + ) + + def test_dict_iter(self): + """ + Exercise iter(dict) + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + out = [] + for k in d: + out.append(k) + return out + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + + self.assertEqual( + foo(keys, vals), + [1, 2, 3] + ) + + def test_dict_contains(self): + """ + Exercise operator.contains + """ + @njit + def foo(keys, vals, checklist): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + out = [] + for k in checklist: + out.append(k in d) + return out + + keys = [1, 2, 3] + vals = [0.1, 0.2, 0.3] + + self.assertEqual( + foo(keys, vals, [2, 3, 4, 1, 0]), + [True, True, False, True, False], + ) + + def test_dict_copy(self): + """ + Exercise dict.copy + """ + @njit + def foo(keys, vals): + d = dictobject.new_dict(int32, float64) + # insertion + for k, v in zip(keys, vals): + d[k] = v + return list(d.copy().items()) + + keys = list(range(20)) + vals = [x + i / 100 for i, x in enumerate(keys)] + out = foo(keys, vals) + self.assertEqual(out, list(zip(keys, vals))) + + def test_dict_setdefault(self): + """ + Exercise dict.setdefault + """ + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + d.setdefault(1, 1.2) # used because key is not in + a = d.get(1) + d[1] = 2.3 + b = d.get(1) + d[2] = 3.4 + d.setdefault(2, 4.5) # not used because key is in + c = d.get(2) + return a, b, c + + self.assertEqual(foo(), (1.2, 2.3, 3.4)) + + def test_dict_equality(self): + """ + Exercise dict.__eq__ and .__ne__ + """ + @njit + def foo(na, nb, fa, fb): + da = dictobject.new_dict(int32, float64) + db = dictobject.new_dict(int32, float64) + for i in range(na): + da[i] = i * fa + for i in range(nb): + db[i] = i * fb + return da == db, da != db + + # Same keys and values + self.assertEqual(foo(10, 10, 3, 3), (True, False)) + # Same keys and diff values + self.assertEqual(foo(10, 10, 3, 3.1), (False, True)) + # LHS has more keys + self.assertEqual(foo(11, 10, 3, 3), (False, True)) + # RHS has more keys + self.assertEqual(foo(10, 11, 3, 3), (False, True)) + + def test_dict_equality_more(self): + """ + Exercise dict.__eq__ + """ + @njit + def foo(ak, av, bk, bv): + # The key-value types are different in the two dictionaries + da = dictobject.new_dict(int32, float64) + db = dictobject.new_dict(int64, float32) + for i in range(len(ak)): + da[ak[i]] = av[i] + for i in range(len(bk)): + db[bk[i]] = bv[i] + return da == db + + # Simple equal case + ak = [1, 2, 3] + av = [2, 3, 4] + bk = [1, 2, 3] + bv = [2, 3, 4] + self.assertTrue(foo(ak, av, bk, bv)) + + # Equal with replacement + ak = [1, 2, 3] + av = [2, 3, 4] + bk = [1, 2, 2, 3] + bv = [2, 1, 3, 4] + self.assertTrue(foo(ak, av, bk, bv)) + + # Diff values + ak = [1, 2, 3] + av = [2, 3, 4] + bk = [1, 2, 3] + bv = [2, 1, 4] + self.assertFalse(foo(ak, av, bk, bv)) + + # Diff keys + ak = [0, 2, 3] + av = [2, 3, 4] + bk = [1, 2, 3] + bv = [2, 3, 4] + self.assertFalse(foo(ak, av, bk, bv)) + + def test_dict_equality_diff_type(self): + """ + Exercise dict.__eq__ + """ + @njit + def foo(na, b): + da = dictobject.new_dict(int32, float64) + for i in range(na): + da[i] = i + return da == b + + # dict != int + self.assertFalse(foo(10, 1)) + # dict != tuple[int] + self.assertFalse(foo(10, (1,))) + + def test_dict_to_from_meminfo(self): + """ + Exercise dictobject.{_as_meminfo, _from_meminfo} + """ + @njit + def make_content(nelem): + for i in range(nelem): + yield i, i + (i + 1) / 100 + + @njit + def boxer(nelem): + d = dictobject.new_dict(int32, float64) + for k, v in make_content(nelem): + d[k] = v + return dictobject._as_meminfo(d) + + dcttype = types.DictType(int32, float64) + + @njit + def unboxer(mi): + d = dictobject._from_meminfo(mi, dcttype) + return list(d.items()) + + mi = boxer(10) + self.assertEqual(mi.refcount, 1) + + got = unboxer(mi) + expected = list(make_content.py_func(10)) + self.assertEqual(got, expected) + + def test_001_cannot_downcast_key(self): + @njit + def foo(n): + d = dictobject.new_dict(int32, float64) + for i in range(n): + d[i] = i + 1 + # bad key type + z = d.get(1j) + return z + + with self.assertRaises(TypingError) as raises: + foo(10) + self.assertIn( + 'cannot safely cast complex128 to int32', + str(raises.exception), + ) + + def test_002_cannot_downcast_default(self): + @njit + def foo(n): + d = dictobject.new_dict(int32, float64) + for i in range(n): + d[i] = i + 1 + # bad default type + z = d.get(2 * n, 1j) + return z + + with self.assertRaises(TypingError) as raises: + foo(10) + self.assertIn( + 'cannot safely cast complex128 to float64', + str(raises.exception), + ) + + def test_003_cannot_downcast_key(self): + @njit + def foo(n): + d = dictobject.new_dict(int32, float64) + for i in range(n): + d[i] = i + 1 + # bad cast!? + z = d.get(2.4) + return z + + # should raise + with self.assertRaises(TypingError) as raises: + foo(10) + self.assertIn( + 'cannot safely cast float64 to int32', + str(raises.exception), + ) + + def test_004_cannot_downcast_key(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + # should raise TypingError + d[1j] = 7. + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + 'cannot safely cast complex128 to int32', + str(raises.exception), + ) + + def test_005_cannot_downcast_value(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + # should raise TypingError + d[1] = 1j + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + 'cannot safely cast complex128 to float64', + str(raises.exception), + ) + + def test_006_cannot_downcast_key(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + # raise TypingError + d[11.5] + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + 'cannot safely cast float64 to int32', + str(raises.exception), + ) + + @unittest.skipUnless(sys.maxsize > 2 ** 32, "64 bit test only") + def test_007_collision_checks(self): + # this checks collisions in real life for 64bit systems + @njit + def foo(v1, v2): + d = dictobject.new_dict(int64, float64) + c1 = np.uint64(2 ** 61 - 1) + c2 = np.uint64(0) + assert hash(c1) == hash(c2) + d[c1] = v1 + d[c2] = v2 + return (d[c1], d[c2]) + + a, b = 10., 20. + x, y = foo(a, b) + self.assertEqual(x, a) + self.assertEqual(y, b) + + def test_008_lifo_popitem(self): + # check that (keys, vals) are LIFO .popitem() + @njit + def foo(n): + d = dictobject.new_dict(int32, float64) + for i in range(n): + d[i] = i + 1 + keys = [] + vals = [] + for i in range(n): + tmp = d.popitem() + keys.append(tmp[0]) + vals.append(tmp[1]) + return keys, vals + + z = 10 + gk, gv = foo(z) + + self.assertEqual(gk, [x for x in reversed(range(z))]) + self.assertEqual(gv, [x + 1 for x in reversed(range(z))]) + + def test_010_cannot_downcast_default(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + d[0] = 6. + d[1] = 7. + # pop'd default must have same type as value + d.pop(11, 12j) + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "cannot safely cast complex128 to float64", + str(raises.exception), + ) + + def test_011_cannot_downcast_key(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + d[0] = 6. + d[1] = 7. + # pop'd key must have same type as key + d.pop(11j) + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "cannot safely cast complex128 to int32", + str(raises.exception), + ) + + def test_012_cannot_downcast_key(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + d[0] = 6. + # invalid key type + return 1j in d + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "cannot safely cast complex128 to int32", + str(raises.exception), + ) + + def test_013_contains_empty_dict(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + # contains on empty dict + return 1 in d + + self.assertFalse(foo()) + + def test_014_not_contains_empty_dict(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + # not contains empty dict + return 1 not in d + + self.assertTrue(foo()) + + def test_015_dict_clear(self): + @njit + def foo(n): + d = dictobject.new_dict(int32, float64) + for i in range(n): + d[i] = i + 1 + x = len(d) + d.clear() + y = len(d) + return x, y + + m = 10 + self.assertEqual(foo(m), (m, 0)) + + def test_016_cannot_downcast_key(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + # key is wrong type + d.setdefault(1j, 12.) + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "cannot safely cast complex128 to int32", + str(raises.exception), + ) + + def test_017_cannot_downcast_default(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + # default value is wrong type + d.setdefault(1, 12.j) + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "cannot safely cast complex128 to float64", + str(raises.exception), + ) + + def test_018_keys_iter_are_views(self): + # this is broken somewhere in llvmlite, intent of test is to check if + # keys behaves like a view or not + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + d[11] = 12. + k1 = d.keys() + d[22] = 9. + k2 = d.keys() + rk1 = [x for x in k1] + rk2 = [x for x in k2] + return rk1, rk2 + + a, b = foo() + self.assertEqual(a, b) + self.assertEqual(a, [11, 22]) + + # Not implemented yet + @unittest.expectedFailure + def test_019(self): + # should keys/vals be set-like? + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + d[11] = 12. + d[22] = 9. + k2 = d.keys() & {12, } + return k2 + + print(foo()) + + def test_020_string_key(self): + @njit + def foo(): + d = dictobject.new_dict(types.unicode_type, float64) + d['a'] = 1. + d['b'] = 2. + d['c'] = 3. + d['d'] = 4. + out = [] + for x in d.items(): + out.append(x) + return out, d['a'] + + items, da = foo() + self.assertEqual(items, [('a', 1.), ('b', 2.), ('c', 3.), ('d', 4)]) + self.assertEqual(da, 1.) + + def test_021_long_str_key(self): + @njit + def foo(): + d = dictobject.new_dict(types.unicode_type, float64) + tmp = [] + for i in range(10000): + tmp.append('a') + s = ''.join(tmp) + d[s] = 1. + out = list(d.items()) + return out + self.assertEqual(foo(), [('a' * 10000, 1)]) + + def test_022_references_juggle(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + e = d + d[1] = 12. + e[2] = 14. + e = dictobject.new_dict(int32, float64) + e[1] = 100. + e[2] = 1000. + f = d + d = e + + k1 = [x for x in d.items()] + k2 = [x for x in e.items()] + k3 = [x for x in f.items()] + + return k1, k2, k3 + + k1, k2, k3 = foo() + self.assertEqual(k1, [(1, 100.0), (2, 1000.0)]) + self.assertEqual(k2, [(1, 100.0), (2, 1000.0)]) + self.assertEqual(k3, [(1, 12), (2, 14)]) + + def test_023_closure(self): + @njit + def foo(): + d = dictobject.new_dict(int32, float64) + + def bar(): + d[1] = 12. + d[2] = 14. + bar() + return [x for x in d.keys()] + + self.assertEqual(foo(), [1, 2]) + + def test_024_unicode_getitem_keys(self): + # See issue #6135 + @njit + def foo(): + s = 'a\u1234' + d = {s[0] : 1} + return d['a'] + + self.assertEqual(foo(), foo.py_func()) + + @njit + def foo(): + s = 'abc\u1234' + d = {s[:1] : 1} + return d['a'] + + self.assertEqual(foo(), foo.py_func()) + + def test_issue6570_alignment_padding(self): + # Create a key type that is 12-bytes long on a 8-byte aligned system + # so that the a 4-byte padding is needed. + # If the 4-byte padding is not zero-filled, it will have garbage data + # that affects key matching in the lookup. + keyty = types.Tuple([types.uint64, types.float32]) + + @njit + def foo(): + d = dictobject.new_dict(keyty, float64) + t1 = np.array([3], dtype=np.uint64) + t2 = np.array([5.67], dtype=np.float32) + v1 = np.array([10.23], dtype=np.float32) + d[(t1[0], t2[0])] = v1[0] + return (t1[0], t2[0]) in d + + self.assertTrue(foo()) + + def test_dict_update(self): + """ + Tests dict.update works with various dictionaries. + """ + n = 10 + + def f1(n): + """ + Test update with a regular dictionary. + """ + d1 = {i: i + 1 for i in range(n)} + d2 = {3 * i: i for i in range(n)} + d1.update(d2) + return d1 + + py_func = f1 + cfunc = njit()(f1) + a = py_func(n) + b = cfunc(n) + self.assertEqual(a, b) + + def f2(n): + """ + Test update where one of the dictionaries + is created as a Python literal. + """ + d1 = { + 1: 2, + 3: 4, + 5: 6 + } + d2 = {3 * i: i for i in range(n)} + d1.update(d2) + return d1 + + py_func = f2 + cfunc = njit()(f2) + a = py_func(n) + b = cfunc(n) + self.assertEqual(a, b) + + +class TestDictTypeCasting(TestCase): + def check_good(self, fromty, toty): + _sentry_safe_cast(fromty, toty) + + def check_bad(self, fromty, toty): + with self.assertRaises(TypingError) as raises: + _sentry_safe_cast(fromty, toty) + self.assertIn( + 'cannot safely cast {fromty} to {toty}'.format(**locals()), + str(raises.exception), + ) + + def test_cast_int_to(self): + self.check_good(types.int32, types.float32) + self.check_good(types.int32, types.float64) + self.check_good(types.int32, types.complex128) + self.check_good(types.int64, types.complex128) + self.check_bad(types.int32, types.complex64) + self.check_good(types.int8, types.complex64) + + def test_cast_float_to(self): + self.check_good(types.float32, types.float64) + self.check_good(types.float32, types.complex64) + self.check_good(types.float64, types.complex128) + + def test_cast_bool_to(self): + self.check_good(types.boolean, types.int32) + self.check_good(types.boolean, types.float64) + self.check_good(types.boolean, types.complex128) + + +class TestTypedDict(MemoryLeakMixin, TestCase): + def test_basic(self): + d = Dict.empty(int32, float32) + # len + self.assertEqual(len(d), 0) + # setitems + d[1] = 1 + d[2] = 2.3 + d[3] = 3.4 + self.assertEqual(len(d), 3) + # keys + self.assertEqual(list(d.keys()), [1, 2, 3]) + # values + for x, y in zip(list(d.values()), [1, 2.3, 3.4]): + self.assertAlmostEqual(x, y, places=4) + # getitem + self.assertAlmostEqual(d[1], 1) + self.assertAlmostEqual(d[2], 2.3, places=4) + self.assertAlmostEqual(d[3], 3.4, places=4) + # deltiem + del d[2] + self.assertEqual(len(d), 2) + # get + self.assertIsNone(d.get(2)) + # setdefault + d.setdefault(2, 100) + d.setdefault(3, 200) + self.assertEqual(d[2], 100) + self.assertAlmostEqual(d[3], 3.4, places=4) + # update + d.update({4: 5, 5: 6}) + self.assertAlmostEqual(d[4], 5) + self.assertAlmostEqual(d[5], 6) + # contains + self.assertTrue(4 in d) + # items + pyd = dict(d.items()) + self.assertEqual(len(pyd), len(d)) + # pop + self.assertAlmostEqual(d.pop(4), 5) + # popitem + nelem = len(d) + k, v = d.popitem() + self.assertEqual(len(d), nelem - 1) + self.assertTrue(k not in d) + # __eq__ & copy + copied = d.copy() + self.assertEqual(copied, d) + self.assertEqual(list(copied.items()), list(d.items())) + + def test_copy_from_dict(self): + expect = {k: float(v) for k, v in zip(range(10), range(10, 20))} + nbd = Dict.empty(int32, float64) + for k, v in expect.items(): + nbd[k] = v + got = dict(nbd) + self.assertEqual(got, expect) + + def test_compiled(self): + @njit + def producer(): + d = Dict.empty(int32, float64) + d[1] = 1.23 + return d + + @njit + def consumer(d): + return d[1] + + d = producer() + val = consumer(d) + self.assertEqual(val, 1.23) + + def test_gh7908(self): + d = Dict.empty( + key_type=types.Tuple([types.uint32, + types.uint32]), + value_type=int64) + + d[(1, 1)] = 12345 + self.assertEqual(d[(1, 1)], d.get((1, 1))) + + def check_stringify(self, strfn, prefix=False): + nbd = Dict.empty(int32, int32) + d = {} + nbd[1] = 2 + d[1] = 2 + checker = self.assertIn if prefix else self.assertEqual + checker(strfn(d), strfn(nbd)) + nbd[2] = 3 + d[2] = 3 + checker(strfn(d), strfn(nbd)) + for i in range(10, 20): + nbd[i] = i + 1 + d[i] = i + 1 + checker(strfn(d), strfn(nbd)) + if prefix: + self.assertTrue(strfn(nbd).startswith('DictType')) + + def test_repr(self): + self.check_stringify(repr, prefix=True) + + def test_str(self): + self.check_stringify(str) + + +class DictIterableCtor: + + def test_iterable_type_constructor(self): + # https://docs.python.org/3/library/stdtypes.html#dict + @njit + def func1(a, b): + d = Dict(zip(a, b)) + return d + + @njit + def func2(a_, b): + a = range(3) + return Dict(zip(a, b)) + + @njit + def func3(a_, b): + a = [0, 1, 2] + return Dict(zip(a, b)) + + @njit + def func4(a, b): + c = zip(a, b) + return Dict(zip(a, zip(c, a))) + + @njit + def func5(a, b): + return Dict(zip(zip(a, b), b)) + + @njit + def func6(items): + return Dict(items) + + @njit + def func7(k, v): + return Dict({k: v}) # mapping - not supported + + @njit + def func8(k, v): + d = Dict() + d[k] = v + return d + + def _get_dict(py_dict): + d = Dict() + for k, v in py_dict.items(): + d[k] = v + return d + + vals = ( + (func1, [(0, 1, 2), 'abc'], _get_dict({0: 'a', 1: 'b', 2: 'c'})), + (func2, [(0, 1, 2), 'abc'], _get_dict({0: 'a', 1: 'b', 2: 'c'})), + (func3, [(0, 1, 2), 'abc'], _get_dict({0: 'a', 1: 'b', 2: 'c'})), + (func4, [(0, 1, 2), 'abc'], _get_dict( + {0: ((0, 'a'), 0), 1: ((1, 'b'), 1), 2: ((2, 'c'), 2)})), + (func5, [(0, 1, 2), 'abc'], _get_dict( + {(0, 'a'): 'a', (1, 'b'): 'b', (2, 'c'): 'c'})), + # (func6, [(),], Dict({})), + (func6, [((1, 'a'), (3, 'b')),], _get_dict({1: 'a', 3: 'b'})), + (func1, ['key', _get_dict({1: 'abc'})], _get_dict({'k': 1})), + (func8, ['key', _get_dict({1: 'abc'})], _get_dict( + {'key': _get_dict({1: 'abc'})})), + (func8, ['key', List([1, 2, 3])], _get_dict( + {'key': List([1, 2, 3])})), + ) + + for func, args, expected in vals: + if self.jit_enabled: + got = func(*args) + else: + got = func.py_func(*args) + self.assertPreciseEqual(expected, got) + + +class TestDictIterableCtorJit(TestCase, DictIterableCtor): + + def setUp(self): + self.jit_enabled = True + + def test_exception_no_iterable_arg(self): + @njit + def ctor(): + return Dict(3) + + msg = ".*No implementation of function.*" + with self.assertRaisesRegex(TypingError, msg): + ctor() + + def test_exception_dict_mapping(self): + @njit + def ctor(): + return Dict({1: 2, 3: 4}) + + msg = ".*No implementation of function.*" + with self.assertRaisesRegex(TypingError, msg): + ctor() + + def test_exception_setitem(self): + @njit + def ctor(): + return Dict(((1, 'a'), (2, 'b', 3))) + + msg = ".*No implementation of function.*" + with self.assertRaisesRegex(TypingError, msg): + ctor() + + +class TestDictIterableCtorNoJit(TestCase, DictIterableCtor): + + def setUp(self): + self.jit_enabled = False + + def test_exception_nargs(self): + msg = 'Dict expect at most 1 argument, got 2' + with self.assertRaisesRegex(TypingError, msg): + Dict(1, 2) + + def test_exception_mapping_ctor(self): + msg = r'.*dict\(mapping\) is not supported.*' # noqa: W605 + with self.assertRaisesRegex(TypingError, msg): + Dict({1: 2}) + + def test_exception_non_iterable_arg(self): + msg = '.*object is not iterable.*' + with self.assertRaisesRegex(TypingError, msg): + Dict(3) + + def test_exception_setitem(self): + msg = ".*dictionary update sequence element #1 has length 3.*" + with self.assertRaisesRegex(ValueError, msg): + Dict(((1, 'a'), (2, 'b', 3))) + + +class TestDictRefctTypes(MemoryLeakMixin, TestCase): + + def test_str_key(self): + @njit + def foo(): + d = Dict.empty( + key_type=types.unicode_type, + value_type=types.int32, + ) + d["123"] = 123 + d["321"] = 321 + return d + + d = foo() + self.assertEqual(d['123'], 123) + self.assertEqual(d['321'], 321) + expect = {'123': 123, '321': 321} + self.assertEqual(dict(d), expect) + # Test insert replacement + d['123'] = 231 + expect['123'] = 231 + self.assertEqual(d['123'], 231) + self.assertEqual(dict(d), expect) + # Test dictionary growth + nelem = 100 + for i in range(nelem): + d[str(i)] = i + expect[str(i)] = i + for i in range(nelem): + self.assertEqual(d[str(i)], i) + self.assertEqual(dict(d), expect) + + def test_str_val(self): + @njit + def foo(): + d = Dict.empty( + key_type=types.int32, + value_type=types.unicode_type, + ) + d[123] = "123" + d[321] = "321" + return d + + d = foo() + self.assertEqual(d[123], '123') + self.assertEqual(d[321], '321') + expect = {123: '123', 321: '321'} + self.assertEqual(dict(d), expect) + # Test insert replacement + d[123] = "231" + expect[123] = "231" + self.assertEqual(dict(d), expect) + # Test dictionary growth + nelem = 1 + for i in range(nelem): + d[i] = str(i) + expect[i] = str(i) + for i in range(nelem): + self.assertEqual(d[i], str(i)) + self.assertEqual(dict(d), expect) + + def test_str_key_array_value(self): + np.random.seed(123) + d = Dict.empty( + key_type=types.unicode_type, + value_type=types.float64[:], + ) + expect = [] + expect.append(np.random.random(10)) + d['mass'] = expect[-1] + expect.append(np.random.random(20)) + d['velocity'] = expect[-1] + for i in range(100): + expect.append(np.random.random(i)) + d[str(i)] = expect[-1] + self.assertEqual(len(d), len(expect)) + self.assertPreciseEqual(d['mass'], expect[0]) + self.assertPreciseEqual(d['velocity'], expect[1]) + # Ordering is kept + for got, exp in zip(d.values(), expect): + self.assertPreciseEqual(got, exp) + + # Try deleting + self.assertTrue('mass' in d) + self.assertTrue('velocity' in d) + del d['mass'] + self.assertFalse('mass' in d) + del d['velocity'] + self.assertFalse('velocity' in d) + del expect[0:2] + + for i in range(90): + k, v = d.popitem() + w = expect.pop() + self.assertPreciseEqual(v, w) + + # Trigger a resize + expect.append(np.random.random(10)) + d["last"] = expect[-1] + + # Ordering is kept + for got, exp in zip(d.values(), expect): + self.assertPreciseEqual(got, exp) + + def test_dict_of_dict_int_keyval(self): + def inner_numba_dict(): + d = Dict.empty( + key_type=types.intp, + value_type=types.intp, + ) + return d + + d = Dict.empty( + key_type=types.intp, + value_type=types.DictType(types.intp, types.intp), + ) + + def usecase(d, make_inner_dict): + for i in range(100): + mid = make_inner_dict() + for j in range(i + 1): + mid[j] = j * 10000 + d[i] = mid + return d + + got = usecase(d, inner_numba_dict) + expect = usecase({}, dict) + + self.assertIsInstance(expect, dict) + + self.assertEqual(dict(got), expect) + + # Delete items + for where in [12, 3, 6, 8, 10]: + del got[where] + del expect[where] + self.assertEqual(dict(got), expect) + + def test_dict_of_dict_npm(self): + inner_dict_ty = types.DictType(types.intp, types.intp) + + @njit + def inner_numba_dict(): + d = Dict.empty( + key_type=types.intp, + value_type=types.intp, + ) + return d + + @njit + def foo(count): + d = Dict.empty( + key_type=types.intp, + value_type=inner_dict_ty, + ) + for i in range(count): + d[i] = inner_numba_dict() + for j in range(i + 1): + d[i][j] = j + + return d + + d = foo(100) + ct = 0 + for k, dd in d.items(): + ct += 1 + self.assertEqual(len(dd), k + 1) + for kk, vv in dd.items(): + self.assertEqual(kk, vv) + + self.assertEqual(ct, 100) + + def test_delitem(self): + d = Dict.empty(types.int64, types.unicode_type) + d[1] = 'apple' + + @njit + def foo(x, k): + del x[1] + + foo(d, 1) + self.assertEqual(len(d), 0) + self.assertFalse(d) + + def test_getitem_return_type(self): + # Dict.__getitem__ must return non-optional type. + d = Dict.empty(types.int64, types.int64[:]) + d[1] = np.arange(10, dtype=np.int64) + + @njit + def foo(d): + d[1] += 100 + return d[1] + + foo(d) + # Return type is an array, not optional + retty = foo.nopython_signatures[0].return_type + self.assertIsInstance(retty, types.Array) + self.assertNotIsInstance(retty, types.Optional) + # Value is correctly updated + self.assertPreciseEqual(d[1], np.arange(10, dtype=np.int64) + 100) + + def test_storage_model_mismatch(self): + # https://github.com/numba/numba/issues/4520 + # check for storage model mismatch in refcount ops generation + dct = Dict() + ref = [ + ("a", True, "a"), + ("b", False, "b"), + ("c", False, "c"), + ] + # populate + for x in ref: + dct[x] = x + # test + for i, x in enumerate(ref): + self.assertEqual(dct[x], x) + + +class TestDictForbiddenTypes(TestCase): + def assert_disallow(self, expect, callable): + with self.assertRaises(TypingError) as raises: + callable() + msg = str(raises.exception) + self.assertIn(expect, msg) + + def assert_disallow_key(self, ty): + msg = '{} as key is forbidden'.format(ty) + self.assert_disallow(msg, lambda: Dict.empty(ty, types.intp)) + + @njit + def foo(): + Dict.empty(ty, types.intp) + self.assert_disallow(msg, foo) + + def assert_disallow_value(self, ty): + msg = '{} as value is forbidden'.format(ty) + self.assert_disallow(msg, lambda: Dict.empty(types.intp, ty)) + + @njit + def foo(): + Dict.empty(types.intp, ty) + self.assert_disallow(msg, foo) + + def test_disallow_list(self): + self.assert_disallow_key(types.List(types.intp)) + self.assert_disallow_value(types.List(types.intp)) + + def test_disallow_set(self): + self.assert_disallow_key(types.Set(types.intp)) + self.assert_disallow_value(types.Set(types.intp)) + + +class TestDictInferred(TestCase): + def test_simple_literal(self): + @njit + def foo(): + d = Dict() + d[123] = 321 + return d + + k, v = 123, 321 + d = foo() + self.assertEqual(dict(d), {k: v}) + self.assertEqual(typeof(d).key_type, typeof(k)) + self.assertEqual(typeof(d).value_type, typeof(v)) + + def test_simple_args(self): + @njit + def foo(k, v): + d = Dict() + d[k] = v + return d + + k, v = 123, 321 + d = foo(k, v) + self.assertEqual(dict(d), {k: v}) + self.assertEqual(typeof(d).key_type, typeof(k)) + self.assertEqual(typeof(d).value_type, typeof(v)) + + def test_simple_upcast(self): + @njit + def foo(k, v, w): + d = Dict() + d[k] = v + d[k] = w + return d + + k, v, w = 123, 32.1, 321 + d = foo(k, v, w) + self.assertEqual(dict(d), {k: w}) + self.assertEqual(typeof(d).key_type, typeof(k)) + self.assertEqual(typeof(d).value_type, typeof(v)) + + def test_conflicting_value_type(self): + @njit + def foo(k, v, w): + d = Dict() + d[k] = v + d[k] = w + return d + + k, v, w = 123, 321, 32.1 + with self.assertRaises(TypingError) as raises: + foo(k, v, w) + self.assertIn( + 'cannot safely cast float64 to {}'.format(typeof(v)), + str(raises.exception), + ) + + def test_conflicting_key_type(self): + @njit + def foo(k, h, v): + d = Dict() + d[k] = v + d[h] = v + return d + + k, h, v = 123, 123.1, 321 + with self.assertRaises(TypingError) as raises: + foo(k, h, v) + self.assertIn( + 'cannot safely cast float64 to {}'.format(typeof(v)), + str(raises.exception), + ) + + def test_conflict_key_type_non_number(self): + # Allow non-number types to cast unsafely + @njit + def foo(k1, v1, k2): + d = Dict() + d[k1] = v1 + return d, d[k2] + + # k2 will unsafely downcast typeof(k1) + k1 = (np.int8(1), np.int8(2)) + k2 = (np.int32(1), np.int32(2)) + v1 = np.intp(123) + + with warnings.catch_warnings(record=True) as w: + d, dk2 = foo(k1, v1, k2) + self.assertEqual(len(w), 1) + # Make sure the warning is about unsafe cast + msg = 'unsafe cast from UniTuple(int32 x 2) to UniTuple(int8 x 2)' + self.assertIn(msg, str(w[0])) + + keys = list(d.keys()) + self.assertEqual(keys[0], (1, 2)) + self.assertEqual(dk2, d[(np.int32(1), np.int32(2))]) + + def test_ifelse_filled_both_branches(self): + @njit + def foo(k, v): + d = Dict() + if k: + d[k] = v + else: + d[0xdead] = v + 1 + + return d + + k, v = 123, 321 + d = foo(k, v) + self.assertEqual(dict(d), {k: v}) + k, v = 0, 0 + d = foo(k, v) + self.assertEqual(dict(d), {0xdead: v + 1}) + + def test_ifelse_empty_one_branch(self): + @njit + def foo(k, v): + d = Dict() + if k: + d[k] = v + + return d + + k, v = 123, 321 + d = foo(k, v) + self.assertEqual(dict(d), {k: v}) + k, v = 0, 0 + d = foo(k, v) + self.assertEqual(dict(d), {}) + self.assertEqual(typeof(d).key_type, typeof(k)) + self.assertEqual(typeof(d).value_type, typeof(v)) + + def test_loop(self): + @njit + def foo(ks, vs): + d = Dict() + for k, v in zip(ks, vs): + d[k] = v + return d + + vs = list(range(4)) + ks = list(map(lambda x : x + 100, vs)) + d = foo(ks, vs) + self.assertEqual(dict(d), dict(zip(ks, vs))) + + def test_unused(self): + @njit + def foo(): + d = Dict() + return d + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "imprecise type", + str(raises.exception) + ) + + def test_define_after_use(self): + @njit + def foo(define): + d = Dict() + ct = len(d) + for k, v in d.items(): + ct += v + + if define: + # This will set the type + d[1] = 2 + return ct, d, len(d) + + ct, d, n = foo(True) + self.assertEqual(ct, 0) + self.assertEqual(n, 1) + self.assertEqual(dict(d), {1: 2}) + + ct, d, n = foo(False) + self.assertEqual(ct, 0) + self.assertEqual(dict(d), {}) + self.assertEqual(n, 0) + + def test_dict_of_dict(self): + @njit + def foo(k1, k2, v): + d = Dict() + z1 = Dict() + z1[k1 + 1] = v + k1 + z2 = Dict() + z2[k2 + 2] = v + k2 + d[k1] = z1 + d[k2] = z2 + return d + + k1, k2, v = 100, 200, 321 + d = foo(k1, k2, v) + self.assertEqual( + dict(d), + { + k1: {k1 + 1: k1 + v}, + k2: {k2 + 2: k2 + v}, + }, + ) + + def test_comprehension_basic(self): + @njit + def foo(): + return {i: 2 * i for i in range(10)} + + self.assertEqual(foo(), foo.py_func()) + + def test_comprehension_basic_mixed_type(self): + @njit + def foo(): + return {i: float(j) for i, j in zip(range(10), range(10, 0, -1))} + + self.assertEqual(foo(), foo.py_func()) + + def test_comprehension_involved(self): + @njit + def foo(): + a = {0: 'A', 1: 'B', 2: 'C'} + return {3 + i: a[i] for i in range(3)} + + self.assertEqual(foo(), foo.py_func()) + + def test_comprehension_fail_mixed_type(self): + @njit + def foo(): + a = {0: 'A', 1: 'B', 2: 1j} + return {3 + i: a[i] for i in range(3)} + + with self.assertRaises(TypingError) as e: + foo() + + excstr = str(e.exception) + self.assertIn("Cannot cast complex128 to unicode_type", excstr) + + +class TestNonCompiledInfer(TestCase): + def test_check_untyped_dict_ops(self): + # Check operation on untyped dictionary + d = Dict() + self.assertFalse(d._typed) + self.assertEqual(len(d), 0) + self.assertEqual(str(d), str({})) + self.assertEqual(list(iter(d)), []) + # Test __getitem__ + with self.assertRaises(KeyError) as raises: + d[1] + self.assertEqual(str(raises.exception), str(KeyError(1))) + # Test __delitem__ + with self.assertRaises(KeyError) as raises: + del d[1] + self.assertEqual(str(raises.exception), str(KeyError(1))) + # Test .pop + with self.assertRaises(KeyError): + d.pop(1) + self.assertEqual(str(raises.exception), str(KeyError(1))) + # Test .pop + self.assertIs(d.pop(1, None), None) + # Test .get + self.assertIs(d.get(1), None) + # Test .popitem + with self.assertRaises(KeyError) as raises: + d.popitem() + self.assertEqual(str(raises.exception), + str(KeyError('dictionary is empty'))) + # Test setdefault(k) + with self.assertRaises(TypeError) as raises: + d.setdefault(1) + self.assertEqual( + str(raises.exception), + str(TypeError('invalid operation on untyped dictionary')), + ) + # Test __contains__ + self.assertFalse(1 in d) + # It's untyped + self.assertFalse(d._typed) + + def test_getitem(self): + # Test __getitem__ + d = Dict() + d[1] = 2 + # It's typed now + self.assertTrue(d._typed) + self.assertEqual(d[1], 2) + + def test_setdefault(self): + # Test setdefault(k, d) + d = Dict() + d.setdefault(1, 2) + # It's typed now + self.assertTrue(d._typed) + self.assertEqual(d[1], 2) + + +@jitclass(spec=[('a', types.intp)]) +class Bag(object): + def __init__(self, a): + self.a = a + + def __hash__(self): + return hash(self.a) + + +class TestDictWithJitclass(TestCase): + def test_jitclass_as_value(self): + @njit + def foo(x): + d = Dict() + d[0] = x + d[1] = Bag(101) + return d + + d = foo(Bag(a=100)) + self.assertEqual(d[0].a, 100) + self.assertEqual(d[1].a, 101) + + +class TestNoJit(TestCase): + """Exercise dictionary creation with JIT disabled. """ + + def test_dict_create_no_jit_using_new_dict(self): + with override_config('DISABLE_JIT', True): + with forbid_codegen(): + d = dictobject.new_dict(int32, float32) + self.assertEqual(type(d), dict) + + def test_dict_create_no_jit_using_Dict(self): + with override_config('DISABLE_JIT', True): + with forbid_codegen(): + d = Dict() + self.assertEqual(type(d), dict) + + def test_dict_create_no_jit_using_empty(self): + with override_config('DISABLE_JIT', True): + with forbid_codegen(): + d = Dict.empty(types.int32, types.float32) + self.assertEqual(type(d), dict) + + +class TestDictIterator(TestCase): + def test_dict_iterator(self): + @njit + def fun1(): + dd = Dict.empty(key_type=types.intp, + value_type=types.intp) + dd[0] = 10 + dd[1] = 20 + dd[2] = 30 + + return list(dd.keys()), list(dd.values()) + + @njit + def fun2(): + dd = Dict.empty(key_type=types.intp, + value_type=types.intp) + dd[4] = 77 + dd[5] = 88 + dd[6] = 99 + + return list(dd.keys()), list(dd.values()) + res1 = fun1() + res2 = fun2() + + self.assertEqual([0,1,2], res1[0]) + self.assertEqual([10,20,30], res1[1]) + self.assertEqual([4,5,6], res2[0]) + self.assertEqual([77,88,99], res2[1]) + + +class TestTypedDictInitialValues(MemoryLeakMixin, TestCase): + """Tests that typed dictionaries carry their initial value if present""" + + def test_homogeneous_and_literal(self): + def bar(d): + ... + + @overload(bar) + def ol_bar(d): + if d.initial_value is None: + return lambda d: literally(d) + self.assertTrue(isinstance(d, types.DictType)) + self.assertEqual(d.initial_value, {'a': 1, 'b': 2, 'c': 3}) + self.assertEqual(hasattr(d, 'literal_value'), False) + return lambda d: d + + @njit + def foo(): + # keys and values all have literal representation + x = {'a': 1, 'b': 2, 'c': 3} + bar(x) + + foo() + + def test_heterogeneous_but_castable_to_homogeneous(self): + def bar(d): + ... + + @overload(bar) + def ol_bar(d): + self.assertTrue(isinstance(d, types.DictType)) + self.assertEqual(d.initial_value, None) + self.assertEqual(hasattr(d, 'literal_value'), False) + return lambda d: d + + @njit + def foo(): + # This dictionary will be typed based on 1j, i.e. complex128 + # as the values are not all literals, there's no "initial_value" + # available irrespective of whether it's possible to rip this + # information out of the bytecode. + x = {'a': 1j, 'b': 2, 'c': 3} + bar(x) + + foo() + + def test_heterogeneous_but_not_castable_to_homogeneous(self): + def bar(d): + ... + + @overload(bar) + def ol_bar(d): + a = {'a': 1, 'b': 2j, 'c': 3} + + def specific_ty(z): + return types.literal(z) if types.maybe_literal(z) else typeof(z) + expected = {types.literal(x): specific_ty(y) for x, y in a.items()} + self.assertTrue(isinstance(d, types.LiteralStrKeyDict)) + self.assertEqual(d.literal_value, expected) + self.assertEqual(hasattr(d, 'initial_value'), False) + return lambda d: d + + @njit + def foo(): + # This dictionary will be typed based on 1, i.e. intp, as the values + # cannot all be cast to this type, but the keys are literal strings + # this is a LiteralStrKey[Dict], there's no initial_value but there + # is a literal_value. + x = {'a': 1, 'b': 2j, 'c': 3} + bar(x) + + foo() + + def test_mutation_not_carried(self): + def bar(d): + ... + + @overload(bar) + def ol_bar(d): + if d.initial_value is None: + return lambda d: literally(d) + self.assertTrue(isinstance(d, types.DictType)) + self.assertEqual(d.initial_value, {'a': 1, 'b': 2, 'c': 3}) + return lambda d: d + + @njit + def foo(): + # This dictionary is mutated, check the initial_value carries + # correctly and is not mutated + x = {'a': 1, 'b': 2, 'c': 3} + x['d'] = 4 + bar(x) + + foo() + + def test_mutation_not_carried_single_function(self): + # this is another pattern for using literally + + @njit + def nop(*args): + pass + + for fn, iv in (nop, None), (literally, {'a': 1, 'b': 2, 'c': 3}): + @njit + def baz(x): + pass + + def bar(z): + pass + + @overload(bar) + def ol_bar(z): + def impl(z): + fn(z) + baz(z) + return impl + + @njit + def foo(): + x = {'a': 1, 'b': 2, 'c': 3} + bar(x) + x['d'] = 4 + return x + + foo() + # baz should be specialised based on literally being invoked and + # the literal/unliteral arriving at the call site + larg = baz.signatures[0][0] + self.assertEqual(larg.initial_value, iv) + + def test_unify_across_function_call(self): + + @njit + def bar(x): + o = {1: 2} + if x: + o = {2: 3} + return o + + @njit + def foo(x): + if x: + d = {3: 4} + else: + d = bar(x) + return d + + e1 = Dict() + e1[3] = 4 + e2 = Dict() + e2[1] = 2 + self.assertEqual(foo(True), e1) + self.assertEqual(foo(False), e2) + + +class TestLiteralStrKeyDict(MemoryLeakMixin, TestCase): + """ Tests for dictionaries with string keys that can map to anything!""" + + def test_basic_const_lowering_boxing(self): + @njit + def foo(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + return (ld['a'], ld['b'], ld['c']) + + self.assertEqual(foo(), (1, 2j, 'd')) + + def test_basic_nonconst_in_scope(self): + @njit + def foo(x): + y = x + 5 + e = True if y > 2 else False + ld = {'a': 1, 'b': 2j, 'c': 'd', 'non_const': e} + return ld['non_const'] + + # Recall that key non_const has a value of a known type, bool, and it's + # value is stuffed in at run time, this is permitted as the dictionary + # is immutable in type + self.assertTrue(foo(34)) + self.assertFalse(foo(-100)) + + def test_basic_nonconst_freevar(self): + e = 5 + + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + self.assertEqual(x.literal_value, + {types.literal('a'): types.literal(1), + types.literal('b'): typeof(2j), + types.literal('c'): types.literal('d'), + types.literal('d'): types.literal(5)}) + + def impl(x): + pass + return impl + + @njit + def foo(): + ld = {'a': 1, 'b': 2j, 'c': 'd', 'd': e} + bar(ld) + + foo() + + def test_literal_value(self): + + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + self.assertEqual(x.literal_value, + {types.literal('a'): types.literal(1), + types.literal('b'): typeof(2j), + types.literal('c'): types.literal('d')}) + + def impl(x): + pass + return impl + + @njit + def foo(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + bar(ld) + + foo() + + def test_list_and_array_as_value(self): + + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + self.assertEqual(x.literal_value, + {types.literal('a'): types.literal(1), + types.literal('b'): + types.List(types.intp, initial_value=[1,2,3]), + types.literal('c'): typeof(np.zeros(5))}) + + def impl(x): + pass + return impl + + @njit + def foo(): + b = [1, 2, 3] + ld = {'a': 1, 'b': b, 'c': np.zeros(5)} + bar(ld) + + foo() + + def test_repeated_key_literal_value(self): + + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + # order is important, 'a' was seen first, but updated later + self.assertEqual(x.literal_value, + {types.literal('a'): types.literal('aaaa'), + types.literal('b'): typeof(2j), + types.literal('c'): types.literal('d')}) + + def impl(x): + pass + return impl + + @njit + def foo(): + ld = {'a': 1, 'a': 10, 'b': 2j, 'c': 'd', 'a': 'aaaa'} # noqa #F601 + bar(ld) + + foo() + + def test_read_only(self): + + def _len(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + return len(ld) + + def static_getitem(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + return ld['b'] + + def contains(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + return 'b' in ld, 'f' in ld + + def copy(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + new = ld.copy() + return ld == new + + rdonlys = (_len, static_getitem, contains, copy) + + for test in rdonlys: + with self.subTest(test.__name__): + self.assertPreciseEqual(njit(test)(), test()) + + def test_mutation_failure(self): + + def setitem(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + ld['a'] = 12 + + def delitem(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + del ld['a'] + + def popitem(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + ld.popitem() + + def pop(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + ld.pop() + + def clear(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + ld.clear() + + def setdefault(): + ld = {'a': 1, 'b': 2j, 'c': 'd'} + ld.setdefault('f', 1) + + illegals = (setitem, delitem, popitem, pop, clear, setdefault) + + for test in illegals: + with self.subTest(test.__name__): + with self.assertRaises(TypingError) as raises: + njit(test)() + expect = "Cannot mutate a literal dictionary" + self.assertIn(expect, str(raises.exception)) + + def test_get(self): + + @njit + def get(x): + ld = {'a': 2j, 'c': 'd'} + return ld.get(x) + + @njit + def getitem(x): + ld = {'a': 2j, 'c': 'd'} + return ld[x] + + for test in (get, getitem): + with self.subTest(test.__name__): + with self.assertRaises(TypingError) as raises: + test('a') + expect = "Cannot get{item}() on a literal dictionary" + self.assertIn(expect, str(raises.exception)) + + def test_dict_keys(self): + + @njit + def foo(): + ld = {'a': 2j, 'c': 'd'} + return [x for x in ld.keys()] + + self.assertEqual(foo(), ['a', 'c']) + + def test_dict_values(self): + + @njit + def foo(): + ld = {'a': 2j, 'c': 'd'} + return ld.values() + + self.assertEqual(foo(), (2j, 'd')) + + def test_dict_items(self): + @njit + def foo(): + ld = {'a': 2j, 'c': 'd', 'f': np.zeros((5))} + return ld.items() + + self.assertPreciseEqual(foo(), + (('a', 2j), ('c', 'd'), ('f', np.zeros((5))))) + + def test_dict_return(self): + + @njit + def foo(): + ld = {'a': 2j, 'c': 'd'} + return ld + + # escaping heterogeneous dictionary is not supported + with self.assertRaises(TypeError) as raises: + foo() + + excstr = str(raises.exception) + self.assertIn("cannot convert native LiteralStrKey", excstr) + + def test_dict_unify(self): + @njit + def foo(x): + if x + 7 > 4: + a = {'a': 2j, 'c': 'd', 'e': np.zeros(4)} + else: + # Note the use of a different literal str for key 'c' + a = {'a': 5j, 'c': 'CAT', 'e': np.zeros((5,))} + return a['c'] + + self.assertEqual(foo(100), 'd') + self.assertEqual(foo(-100), 'CAT') + self.assertEqual(foo(100), foo.py_func(100)) + self.assertEqual(foo(-100), foo.py_func(-100)) + + def test_dict_not_unify(self): + + @njit + def key_mismatch(x): + if x + 7 > 4: + a = {'BAD_KEY': 2j, 'c': 'd', 'e': np.zeros(4)} + else: + a = {'a': 5j, 'c': 'CAT', 'e': np.zeros((5,))} + # prevents inline of return on py310 + py310_defeat1 = 1 # noqa + py310_defeat2 = 2 # noqa + py310_defeat3 = 3 # noqa + py310_defeat4 = 4 # noqa + return a['a'] + + with self.assertRaises(TypingError) as raises: + key_mismatch(100) + + self.assertIn("Cannot unify LiteralStrKey", str(raises.exception)) + + @njit + def value_type_mismatch(x): + if x + 7 > 4: + a = {'a': 2j, 'c': 'd', 'e': np.zeros((4, 3))} + else: + a = {'a': 5j, 'c': 'CAT', 'e': np.zeros((5,))} + # prevents inline of return on py310 + py310_defeat1 = 1 # noqa + py310_defeat2 = 2 # noqa + py310_defeat3 = 3 # noqa + py310_defeat4 = 4 # noqa + return a['a'] + + with self.assertRaises(TypingError) as raises: + value_type_mismatch(100) + + self.assertIn("Cannot unify LiteralStrKey", str(raises.exception)) + + def test_dict_value_coercion(self): + # checks that things coerce or not! + + p = {# safe and no conversion: TypedDict + (np.int32, np.int32): types.DictType, + # safe and convertible: TypedDict + (np.int32, np.int8): types.DictType, + # safe convertible: TypedDict + (np.complex128, np.int32): types.DictType, + # unsafe not convertible: LiteralStrKey + (np.int32, np.complex128): types.LiteralStrKeyDict, + # unsafe not convertible: LiteralStrKey + (np.int32, np.array): types.LiteralStrKeyDict, + # unsafe not convertible: LiteralStrKey + (np.array, np.int32): types.LiteralStrKeyDict, + # unsafe not convertible: LiteralStrKey + (np.int8, np.int32): types.LiteralStrKeyDict, + # unsafe not convertible: LiteralStrKey (issue #6420 case) + (np.int64, np.float64): types.LiteralStrKeyDict,} + + def bar(x): + pass + + for dts, container in p.items(): + @overload(bar) + def ol_bar(x): + self.assertTrue(isinstance(x, container)) + + def impl(x): + pass + return impl + + ty1, ty2 = dts + + @njit + def foo(): + d = {'a': ty1(1), 'b': ty2(2)} + bar(d) + + foo() + + def test_build_map_op_code(self): + # tests building dictionaries via `build_map`, which, for statically + # determinable str key->things cases is just a single key:value + # any other build_map would either end up as being non-const str keys + # or keys of some non-string type and therefore not considered. + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + def impl(x): + pass + return impl + + @njit + def foo(): + a = {'a': {'b1': 10, 'b2': 'string'}} + bar(a) + + foo() + + def test_dict_as_arg(self): + @njit + def bar(fake_kwargs=None): + if fake_kwargs is not None: + # Add 10 to array in key 'd' + fake_kwargs['d'][:] += 10 + + @njit + def foo(): + a = 1 + b = 2j + c = 'string' + d = np.zeros(3) + e = {'a': a, 'b': b, 'c': c, 'd': d} + bar(fake_kwargs=e) + return e['d'] + + np.testing.assert_allclose(foo(), np.ones(3) * 10) + + def test_dict_with_single_literallist_value(self): + #see issue #6094 + @njit + def foo(): + z = {"A": [lambda a: 2 * a, "B"]} + return z["A"][0](5) + + self.assertPreciseEqual(foo(), foo.py_func()) + + def test_tuple_not_in_mro(self): + # Related to #6094, make sure that LiteralStrKey does not inherit from + # types.BaseTuple as this breaks isinstance checks. + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + self.assertFalse(isinstance(x, types.BaseTuple)) + self.assertTrue(isinstance(x, types.LiteralStrKeyDict)) + return lambda x: ... + + @njit + def foo(): + d = {'a': 1, 'b': 'c'} + bar(d) + + foo() + + def test_const_key_not_in_dict(self): + + @njit + def foo(): + a = {'not_a': 2j, 'c': 'd', 'e': np.zeros(4)} + return a['a'] + + with self.assertRaises(TypingError) as raises: + foo() + + self.assertIn("Key 'a' is not in dict.", str(raises.exception)) + + def test_uncommon_identifiers(self): + # Tests uncommon identifiers like numerical values and operators in + # the key fields. See #6518 and #7416. + + # Numerical values in keys + @njit + def foo(): + d = {'0': np.ones(5), '1': 4} + return len(d) + + self.assertPreciseEqual(foo(), foo.py_func()) + + # operators in keys + @njit + def bar(): + d = {'+': np.ones(5), 'x--': 4} + return len(d) + + self.assertPreciseEqual(bar(), bar.py_func()) + + def test_update_error(self): + # Tests that dict.update produces a reasonable + # error with a LiteralStrKeyDict input. + @njit + def foo(): + + d1 = { + 'a': 2, + 'b': 4, + 'c': 'a' + } + d1.update({'x': 3}) + return d1 + + with self.assertRaises(TypingError) as raises: + foo() + + self.assertIn( + "Cannot mutate a literal dictionary", + str(raises.exception) + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dicts.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dicts.py new file mode 100644 index 0000000000000000000000000000000000000000..7327bc90837528e45e7a6bfc33e4f332d6b09cdf --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dicts.py @@ -0,0 +1,233 @@ +import numpy as np +from numba import njit, jit +from numba.core.errors import TypingError +import unittest +from numba.tests.support import TestCase + + +def build_map(): + return {0: 1, 2: 3} + +def build_map_from_local_vars(): + # There used to be a crash due to wrong IR generation for STORE_MAP + x = TestCase + return {0: x, x: 1} + + +class DictTestCase(TestCase): + + def check(self, pyfunc): + cfunc = jit(forceobj=True)(pyfunc) + self.assertPreciseEqual(pyfunc(), cfunc()) + + def test_build_map(self): + self.check(build_map) + + def test_build_map_from_local_vars(self): + self.check(build_map_from_local_vars) + + +class TestCompiledDict(TestCase): + """Testing `dict()` and `{}` usage that are redirected to + `numba.typed.Dict`. + """ + def test_use_dict(self): + # Test dict() + @njit + def foo(): + d = dict() + d[1] = 2 + return d + + d = foo() + self.assertEqual(d, {1: 2}) + + def test_use_dict_iterable_args(self): + # Test dict(iterable) + @njit + def dict_iterable_1(a, b): + d = dict(zip(a, b)) + return d + + @njit + def dict_iterable_2(): + # from python docs + return dict([('sape', 4139), ('guido', 4127), ('jack', 4098)]) + + inps = ( + ([1, 2, 3], [4, 5, 6]), + (np.arange(4), np.arange(4)), + ([1, 2, 3], 'abc'), + ([1, 2, 3, 4], 'abc'), + ) + for a, b in inps: + d = dict_iterable_1(a, b) + self.assertEqual(d, dict(zip(a, b))) + + self.assertEqual(dict_iterable_2(), dict_iterable_2.py_func()) + + def test_ctor_iterable_tuple(self): + @njit + def ctor(): + return dict(((1, 2), (1, 2))) + + expected = dict({1: 2}) + got = ctor() + self.assertEqual(expected, got) + + def test_unsupported_dict_usage(self): + # Test dict(dict()) + from numba.core.typing.dictdecl import _message_dict_support + + @njit + def ctor1(): + d = dict() + d[1] = 2 + return dict(d) + + @njit + def ctor2(): + return dict(((1, 2), (3, 'a'))) + + @njit + def ctor3(): + return dict((('a', 'b', 'c'), ('d', 'e', 'f'))) + + @njit + def ctor4(): + return dict((({}, 1), ({}, 2))) + + _non_iter_args = "Non-iterable args used in dict(iterable)" + _dict_upd_item_len = "dictionary update sequence element has length 3;" + _unhashable_type = "Unhashable type" + + inputs = [ + (ctor1, TypingError, _message_dict_support), + (ctor2, TypingError, _non_iter_args), + (ctor3, TypingError, _dict_upd_item_len), + (ctor4, TypingError, _unhashable_type), + ] + + for func, exc, msg in inputs: + with self.assertRaises(exc) as raises: + func() + + self.assertIn(msg, str(raises.exception)) + + def test_use_curlybraces(self): + # Test {} with empty args + @njit + def foo(): + d = {} + d[1] = 2 + return d + + d = foo() + self.assertEqual(d, {1: 2}) + + def test_use_curlybraces_with_init1(self): + # Test {} with 1 item + @njit + def foo(): + return {1: 2} + + d = foo() + self.assertEqual(d, {1: 2}) + + def test_use_curlybraces_with_initmany(self): + # Test {} with many items + @njit + def foo(): + return {1: 2.2, 3: 4.4, 5: 6.6} + + d = foo() + self.assertEqual(d, {1: 2.2, 3: 4.4, 5: 6.6}) + + def test_curlybraces_init_with_coercion(self): + # Type coercion at dict init is tested + @njit + def foo(): + return {1: 2.2, 3: 4, 5: 6} + + self.assertEqual(foo(), foo.py_func()) + + def test_use_curlybraces_with_manyvar(self): + # Test using variable in {} + @njit + def foo(x, y): + return {x: 1, y: x + y} + + x, y = 10, 20 + self.assertEqual(foo(x, y), foo.py_func(x, y)) + + def test_mixed_curlybraces_and_dict(self): + # Test mixed use of {} and dict() + @njit + def foo(): + k = dict() + k[1] = {1: 3} + k[2] = {4: 2} + return k + + self.assertEqual(foo(), foo.py_func()) + + def test_dict_use_with_none_value(self): + # Test that NoneType cannot be used as value for Dict + @njit + def foo(): + k = {1: None} + return k + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "Dict.value_type cannot be of type none", + str(raises.exception), + ) + + + def test_dict_use_with_optional_value(self): + # Test that Optional cannot be used as value for Dict + @njit + def foo(choice): + optional = 2.5 if choice else None + k = {1: optional} + return k + + with self.assertRaises(TypingError) as raises: + foo(True) + self.assertIn( + "Dict.value_type cannot be of type OptionalType(float64)", + str(raises.exception), + ) + + def test_dict_use_with_optional_key(self): + # Test that Optional cannot be used as a key for Dict + @njit + def foo(choice): + k = {2.5 if choice else None: 1} + return k + + with self.assertRaises(TypingError) as raises: + foo(True) + self.assertIn( + "Dict.key_type cannot be of type OptionalType(float64)", + str(raises.exception), + ) + + def test_dict_use_with_none_key(self): + # Test that NoneType cannot be used as a key for Dict + @njit + def foo(): + k = {None: 1} + return k + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "Dict.key_type cannot be of type none", + str(raises.exception), + ) + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dispatcher.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dispatcher.py new file mode 100644 index 0000000000000000000000000000000000000000..1aa5e9232dba1bc08fd4b962a86ca5265264c388 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dispatcher.py @@ -0,0 +1,1193 @@ +import multiprocessing +import platform +import threading +import pickle +import weakref +from itertools import chain +from io import StringIO + +import numpy as np + +from numba import njit, jit, typeof, vectorize +from numba.core import types, errors +from numba import _dispatcher +from numba.tests.support import TestCase, captured_stdout +from numba.np.numpy_support import as_dtype +from numba.core.dispatcher import Dispatcher +from numba.extending import overload +from numba.tests.support import needs_lapack, SerialMixin +from numba.testing.main import _TIMEOUT as _RUNNER_TIMEOUT +import unittest + + +_TEST_TIMEOUT = _RUNNER_TIMEOUT - 60. + + +try: + import jinja2 +except ImportError: + jinja2 = None + +try: + import pygments +except ImportError: + pygments = None + +_is_armv7l = platform.machine() == 'armv7l' + + +def dummy(x): + return x + + +def add(x, y): + return x + y + + +def addsub(x, y, z): + return x - y + z + + +def addsub_defaults(x, y=2, z=3): + return x - y + z + + +def star_defaults(x, y=2, *z): + return x, y, z + + +def generated_usecase(x, y=5): + if isinstance(x, types.Complex): + def impl(x, y): + return x + y + else: + def impl(x, y): + return x - y + return impl + + +def bad_generated_usecase(x, y=5): + if isinstance(x, types.Complex): + def impl(x): + return x + else: + def impl(x, y=6): + return x - y + return impl + + +def dtype_generated_usecase(a, b, dtype=None): + if isinstance(dtype, (types.misc.NoneType, types.misc.Omitted)): + out_dtype = np.result_type(*(np.dtype(ary.dtype.name) + for ary in (a, b))) + elif isinstance(dtype, (types.DType, types.NumberClass)): + out_dtype = as_dtype(dtype) + else: + raise TypeError("Unhandled Type %s" % type(dtype)) + + def _fn(a, b, dtype=None): + return np.ones(a.shape, dtype=out_dtype) + + return _fn + + +class BaseTest(TestCase): + + jit_args = dict(nopython=True) + + def compile_func(self, pyfunc): + def check(*args, **kwargs): + expected = pyfunc(*args, **kwargs) + result = f(*args, **kwargs) + self.assertPreciseEqual(result, expected) + f = jit(**self.jit_args)(pyfunc) + return f, check + + +class TestDispatcher(BaseTest): + + def test_equality(self): + @jit + def foo(x): + return x + + @jit + def bar(x): + return x + + # Written this way to verify `==` returns a bool (gh-5838). Using + # `assertTrue(foo == foo)` or `assertEqual(foo, foo)` would defeat the + # purpose of this test. + self.assertEqual(foo == foo, True) + self.assertEqual(foo == bar, False) + self.assertEqual(foo == None, False) # noqa: E711 + + def test_dyn_pyfunc(self): + @jit + def foo(x): + return x + + foo(1) + [cr] = foo.overloads.values() + # __module__ must be match that of foo + self.assertEqual(cr.entry_point.__module__, foo.py_func.__module__) + + def test_no_argument(self): + @jit + def foo(): + return 1 + + # Just make sure this doesn't crash + foo() + + def test_coerce_input_types(self): + # Issue #486: do not allow unsafe conversions if we can still + # compile other specializations. + c_add = jit(nopython=True)(add) + self.assertPreciseEqual(c_add(123, 456), add(123, 456)) + self.assertPreciseEqual(c_add(12.3, 45.6), add(12.3, 45.6)) + self.assertPreciseEqual(c_add(12.3, 45.6j), add(12.3, 45.6j)) + self.assertPreciseEqual(c_add(12300000000, 456), add(12300000000, 456)) + + # Now force compilation of only a single specialization + c_add = jit('(i4, i4)', nopython=True)(add) + self.assertPreciseEqual(c_add(123, 456), add(123, 456)) + # Implicit (unsafe) conversion of float to int + self.assertPreciseEqual(c_add(12.3, 45.6), add(12, 45)) + with self.assertRaises(TypeError): + # Implicit conversion of complex to int disallowed + c_add(12.3, 45.6j) + + def test_ambiguous_new_version(self): + """Test compiling new version in an ambiguous case + """ + @jit + def foo(a, b): + return a + b + + INT = 1 + FLT = 1.5 + self.assertAlmostEqual(foo(INT, FLT), INT + FLT) + self.assertEqual(len(foo.overloads), 1) + self.assertAlmostEqual(foo(FLT, INT), FLT + INT) + self.assertEqual(len(foo.overloads), 2) + self.assertAlmostEqual(foo(FLT, FLT), FLT + FLT) + self.assertEqual(len(foo.overloads), 3) + # The following call is ambiguous because (int, int) can resolve + # to (float, int) or (int, float) with equal weight. + self.assertAlmostEqual(foo(1, 1), INT + INT) + self.assertEqual(len(foo.overloads), 4, "didn't compile a new " + "version") + + def test_lock(self): + """ + Test that (lazy) compiling from several threads at once doesn't + produce errors (see issue #908). + """ + errors = [] + + @jit + def foo(x): + return x + 1 + + def wrapper(): + try: + self.assertEqual(foo(1), 2) + except Exception as e: + errors.append(e) + + threads = [threading.Thread(target=wrapper) for i in range(16)] + for t in threads: + t.start() + for t in threads: + t.join() + self.assertFalse(errors) + + def test_explicit_signatures(self): + f = jit("(int64,int64)")(add) + # Approximate match (unsafe conversion) + self.assertPreciseEqual(f(1.5, 2.5), 3) + self.assertEqual(len(f.overloads), 1, f.overloads) + f = jit(["(int64,int64)", "(float64,float64)"])(add) + # Exact signature matches + self.assertPreciseEqual(f(1, 2), 3) + self.assertPreciseEqual(f(1.5, 2.5), 4.0) + # Approximate match (int32 -> float64 is a safe conversion) + self.assertPreciseEqual(f(np.int32(1), 2.5), 3.5) + # No conversion + with self.assertRaises(TypeError) as cm: + f(1j, 1j) + self.assertIn("No matching definition", str(cm.exception)) + self.assertEqual(len(f.overloads), 2, f.overloads) + # A more interesting one... + f = jit(["(float32,float32)", "(float64,float64)"])(add) + self.assertPreciseEqual(f(np.float32(1), np.float32(2**-25)), 1.0) + self.assertPreciseEqual(f(1, 2**-25), 1.0000000298023224) + # Fail to resolve ambiguity between the two best overloads + f = jit(["(float32,float64)", + "(float64,float32)", + "(int64,int64)"])(add) + with self.assertRaises(TypeError) as cm: + f(1.0, 2.0) + # The two best matches are output in the error message, as well + # as the actual argument types. + self.assertRegex( + str(cm.exception), + r"Ambiguous overloading for ]*> " + r"\(float64, float64\):\n" + r"\(float32, float64\) -> float64\n" + r"\(float64, float32\) -> float64" + ) + # The integer signature is not part of the best matches + self.assertNotIn("int64", str(cm.exception)) + + def test_signature_mismatch(self): + tmpl = ("Signature mismatch: %d argument types given, but function " + "takes 2 arguments") + with self.assertRaises(TypeError) as cm: + jit("()")(add) + self.assertIn(tmpl % 0, str(cm.exception)) + with self.assertRaises(TypeError) as cm: + jit("(intc,)")(add) + self.assertIn(tmpl % 1, str(cm.exception)) + with self.assertRaises(TypeError) as cm: + jit("(intc,intc,intc)")(add) + self.assertIn(tmpl % 3, str(cm.exception)) + # With forceobj=True, an empty tuple is accepted + jit("()", forceobj=True)(add) + with self.assertRaises(TypeError) as cm: + jit("(intc,)", forceobj=True)(add) + self.assertIn(tmpl % 1, str(cm.exception)) + + def test_matching_error_message(self): + f = jit("(intc,intc)")(add) + with self.assertRaises(TypeError) as cm: + f(1j, 1j) + self.assertEqual(str(cm.exception), + "No matching definition for argument type(s) " + "complex128, complex128") + + def test_disabled_compilation(self): + @jit + def foo(a): + return a + + foo.compile("(float32,)") + foo.disable_compile() + with self.assertRaises(RuntimeError) as raises: + foo.compile("(int32,)") + self.assertEqual(str(raises.exception), "compilation disabled") + self.assertEqual(len(foo.signatures), 1) + + def test_disabled_compilation_through_list(self): + @jit(["(float32,)", "(int32,)"]) + def foo(a): + return a + + with self.assertRaises(RuntimeError) as raises: + foo.compile("(complex64,)") + self.assertEqual(str(raises.exception), "compilation disabled") + self.assertEqual(len(foo.signatures), 2) + + def test_disabled_compilation_nested_call(self): + @jit(["(intp,)"]) + def foo(a): + return a + + @jit + def bar(): + foo(1) + foo(np.ones(1)) # no matching definition + + with self.assertRaises(errors.TypingError) as raises: + bar() + + m = r".*Invalid use of.*with parameters \(array\(float64, 1d, C\)\).*" + self.assertRegex(str(raises.exception), m) + + def test_fingerprint_failure(self): + """ + Failure in computing the fingerprint cannot affect a nopython=False + function. On the other hand, with nopython=True, a ValueError should + be raised to report the failure with fingerprint. + """ + def foo(x): + return x + + # Empty list will trigger failure in compile_fingerprint + errmsg = 'cannot compute fingerprint of empty list' + with self.assertRaises(ValueError) as raises: + _dispatcher.compute_fingerprint([]) + self.assertIn(errmsg, str(raises.exception)) + # It should work in objmode + objmode_foo = jit(forceobj=True)(foo) + self.assertEqual(objmode_foo([]), []) + # But, not in nopython=True + strict_foo = jit(nopython=True)(foo) + with self.assertRaises(ValueError) as raises: + strict_foo([]) + self.assertIn(errmsg, str(raises.exception)) + + # Test in loop lifting context + @jit(forceobj=True) + def bar(): + object() # force looplifting + x = [] + for i in range(10): + x = objmode_foo(x) + return x + + self.assertEqual(bar(), []) + # Make sure it was looplifted + [cr] = bar.overloads.values() + self.assertEqual(len(cr.lifted), 1) + + def test_serialization(self): + """ + Test serialization of Dispatcher objects + """ + @jit(nopython=True) + def foo(x): + return x + 1 + + self.assertEqual(foo(1), 2) + + # get serialization memo + memo = Dispatcher._memo + Dispatcher._recent.clear() + memo_size = len(memo) + + # pickle foo and check memo size + serialized_foo = pickle.dumps(foo) + # increases the memo size + self.assertEqual(memo_size + 1, len(memo)) + + # unpickle + foo_rebuilt = pickle.loads(serialized_foo) + self.assertEqual(memo_size + 1, len(memo)) + + self.assertIs(foo, foo_rebuilt) + + # do we get the same object even if we delete all the explicit + # references? + id_orig = id(foo_rebuilt) + del foo + del foo_rebuilt + self.assertEqual(memo_size + 1, len(memo)) + new_foo = pickle.loads(serialized_foo) + self.assertEqual(id_orig, id(new_foo)) + + # now clear the recent cache + ref = weakref.ref(new_foo) + del new_foo + Dispatcher._recent.clear() + self.assertEqual(memo_size, len(memo)) + + # show that deserializing creates a new object + pickle.loads(serialized_foo) + self.assertIs(ref(), None) + + @needs_lapack + @unittest.skipIf(_is_armv7l, "Unaligned loads unsupported") + def test_misaligned_array_dispatch(self): + # for context see issue #2937 + def foo(a): + return np.linalg.matrix_power(a, 1) + + jitfoo = jit(nopython=True)(foo) + + n = 64 + r = int(np.sqrt(n)) + dt = np.int8 + count = np.complex128().itemsize // dt().itemsize + + tmp = np.arange(n * count + 1, dtype=dt) + + # create some arrays as Cartesian production of: + # [F/C] x [aligned/misaligned] + C_contig_aligned = tmp[:-1].view(np.complex128).reshape(r, r) + C_contig_misaligned = tmp[1:].view(np.complex128).reshape(r, r) + F_contig_aligned = C_contig_aligned.T + F_contig_misaligned = C_contig_misaligned.T + + # checking routine + def check(name, a): + a[:, :] = np.arange(n, dtype=np.complex128).reshape(r, r) + expected = foo(a) + got = jitfoo(a) + np.testing.assert_allclose(expected, got) + + # The checks must be run in this order to create the dispatch key + # sequence that causes invalid dispatch noted in #2937. + # The first two should hit the cache as they are aligned, supported + # order and under 5 dimensions. The second two should end up in the + # fallback path as they are misaligned. + check("C_contig_aligned", C_contig_aligned) + check("F_contig_aligned", F_contig_aligned) + check("C_contig_misaligned", C_contig_misaligned) + check("F_contig_misaligned", F_contig_misaligned) + + @unittest.skipIf(_is_armv7l, "Unaligned loads unsupported") + def test_immutability_in_array_dispatch(self): + + # RO operation in function + def foo(a): + return np.sum(a) + + jitfoo = jit(nopython=True)(foo) + + n = 64 + r = int(np.sqrt(n)) + dt = np.int8 + count = np.complex128().itemsize // dt().itemsize + + tmp = np.arange(n * count + 1, dtype=dt) + + # create some arrays as Cartesian production of: + # [F/C] x [aligned/misaligned] + C_contig_aligned = tmp[:-1].view(np.complex128).reshape(r, r) + C_contig_misaligned = tmp[1:].view(np.complex128).reshape(r, r) + F_contig_aligned = C_contig_aligned.T + F_contig_misaligned = C_contig_misaligned.T + + # checking routine + def check(name, a, disable_write_bit=False): + a[:, :] = np.arange(n, dtype=np.complex128).reshape(r, r) + if disable_write_bit: + a.flags.writeable = False + expected = foo(a) + got = jitfoo(a) + np.testing.assert_allclose(expected, got) + + # all of these should end up in the fallback path as they have no write + # bit set + check("C_contig_aligned", C_contig_aligned, disable_write_bit=True) + check("F_contig_aligned", F_contig_aligned, disable_write_bit=True) + check("C_contig_misaligned", C_contig_misaligned, + disable_write_bit=True) + check("F_contig_misaligned", F_contig_misaligned, + disable_write_bit=True) + + @needs_lapack + @unittest.skipIf(_is_armv7l, "Unaligned loads unsupported") + def test_misaligned_high_dimension_array_dispatch(self): + + def foo(a): + return np.linalg.matrix_power(a[0, 0, 0, 0, :, :], 1) + + jitfoo = jit(nopython=True)(foo) + + def check_properties(arr, layout, aligned): + self.assertEqual(arr.flags.aligned, aligned) + if layout == "C": + self.assertEqual(arr.flags.c_contiguous, True) + if layout == "F": + self.assertEqual(arr.flags.f_contiguous, True) + + n = 729 + r = 3 + dt = np.int8 + count = np.complex128().itemsize // dt().itemsize + + tmp = np.arange(n * count + 1, dtype=dt) + + # create some arrays as Cartesian production of: + # [F/C] x [aligned/misaligned] + C_contig_aligned = tmp[:-1].view(np.complex128).\ + reshape(r, r, r, r, r, r) + check_properties(C_contig_aligned, 'C', True) + C_contig_misaligned = tmp[1:].view(np.complex128).\ + reshape(r, r, r, r, r, r) + check_properties(C_contig_misaligned, 'C', False) + F_contig_aligned = C_contig_aligned.T + check_properties(F_contig_aligned, 'F', True) + F_contig_misaligned = C_contig_misaligned.T + check_properties(F_contig_misaligned, 'F', False) + + # checking routine + def check(name, a): + a[:, :] = np.arange(n, dtype=np.complex128).\ + reshape(r, r, r, r, r, r) + expected = foo(a) + got = jitfoo(a) + np.testing.assert_allclose(expected, got) + + # these should all hit the fallback path as the cache is only for up to + # 5 dimensions + check("F_contig_misaligned", F_contig_misaligned) + check("C_contig_aligned", C_contig_aligned) + check("F_contig_aligned", F_contig_aligned) + check("C_contig_misaligned", C_contig_misaligned) + + def test_dispatch_recompiles_for_scalars(self): + # for context #3612, essentially, compiling a lambda x:x for a + # numerically wide type (everything can be converted to a complex128) + # and then calling again with e.g. an int32 would lead to the int32 + # being converted to a complex128 whereas it ought to compile an int32 + # specialization. + def foo(x): + return x + + # jit and compile on dispatch for 3 scalar types, expect 3 signatures + jitfoo = jit(nopython=True)(foo) + jitfoo(np.complex128(1 + 2j)) + jitfoo(np.int32(10)) + jitfoo(np.bool_(False)) + self.assertEqual(len(jitfoo.signatures), 3) + expected_sigs = [(types.complex128,), (types.int32,), (types.bool_,)] + self.assertEqual(jitfoo.signatures, expected_sigs) + + # now jit with signatures so recompilation is forbidden + # expect 1 signature and type conversion + jitfoo = jit([(types.complex128,)], nopython=True)(foo) + jitfoo(np.complex128(1 + 2j)) + jitfoo(np.int32(10)) + jitfoo(np.bool_(False)) + self.assertEqual(len(jitfoo.signatures), 1) + expected_sigs = [(types.complex128,)] + self.assertEqual(jitfoo.signatures, expected_sigs) + + def test_dispatcher_raises_for_invalid_decoration(self): + # For context see https://github.com/numba/numba/issues/4750. + + @jit(nopython=True) + def foo(x): + return x + + with self.assertRaises(TypeError) as raises: + jit(foo) + err_msg = str(raises.exception) + self.assertIn( + "A jit decorator was called on an already jitted function", err_msg) + self.assertIn("foo", err_msg) + self.assertIn(".py_func", err_msg) + + with self.assertRaises(TypeError) as raises: + jit(BaseTest) + err_msg = str(raises.exception) + self.assertIn("The decorated object is not a function", err_msg) + self.assertIn(f"{type(BaseTest)}", err_msg) + + +class TestSignatureHandling(BaseTest): + """ + Test support for various parameter passing styles. + """ + + def test_named_args(self): + """ + Test passing named arguments to a dispatcher. + """ + f, check = self.compile_func(addsub) + check(3, z=10, y=4) + check(3, 4, 10) + check(x=3, y=4, z=10) + # All calls above fall under the same specialization + self.assertEqual(len(f.overloads), 1) + # Errors + with self.assertRaises(TypeError) as cm: + f(3, 4, y=6, z=7) + self.assertIn("too many arguments: expected 3, got 4", + str(cm.exception)) + with self.assertRaises(TypeError) as cm: + f() + self.assertIn("not enough arguments: expected 3, got 0", + str(cm.exception)) + with self.assertRaises(TypeError) as cm: + f(3, 4, y=6) + self.assertIn("missing argument 'z'", str(cm.exception)) + + def test_default_args(self): + """ + Test omitting arguments with a default value. + """ + f, check = self.compile_func(addsub_defaults) + check(3, z=10, y=4) + check(3, 4, 10) + check(x=3, y=4, z=10) + # Now omitting some values + check(3, z=10) + check(3, 4) + check(x=3, y=4) + check(3) + check(x=3) + # Errors + with self.assertRaises(TypeError) as cm: + f(3, 4, y=6, z=7) + self.assertIn("too many arguments: expected 3, got 4", + str(cm.exception)) + with self.assertRaises(TypeError) as cm: + f() + self.assertIn("not enough arguments: expected at least 1, got 0", + str(cm.exception)) + with self.assertRaises(TypeError) as cm: + f(y=6, z=7) + self.assertIn("missing argument 'x'", str(cm.exception)) + + def test_star_args(self): + """ + Test a compiled function with starargs in the signature. + """ + f, check = self.compile_func(star_defaults) + check(4) + check(4, 5) + check(4, 5, 6) + check(4, 5, 6, 7) + check(4, 5, 6, 7, 8) + check(x=4) + check(x=4, y=5) + check(4, y=5) + with self.assertRaises(TypeError) as cm: + f(4, 5, y=6) + self.assertIn("some keyword arguments unexpected", str(cm.exception)) + with self.assertRaises(TypeError) as cm: + f(4, 5, z=6) + self.assertIn("some keyword arguments unexpected", str(cm.exception)) + with self.assertRaises(TypeError) as cm: + f(4, x=6) + self.assertIn("some keyword arguments unexpected", str(cm.exception)) + + +class TestSignatureHandlingObjectMode(TestSignatureHandling): + """ + Sams as TestSignatureHandling, but in object mode. + """ + + jit_args = dict(forceobj=True) + + +class TestDispatcherMethods(TestCase): + + def test_recompile(self): + closure = 1 + + @jit + def foo(x): + return x + closure + self.assertPreciseEqual(foo(1), 2) + self.assertPreciseEqual(foo(1.5), 2.5) + self.assertEqual(len(foo.signatures), 2) + closure = 2 + self.assertPreciseEqual(foo(1), 2) + # Recompiling takes the new closure into account. + foo.recompile() + # Everything was recompiled + self.assertEqual(len(foo.signatures), 2) + self.assertPreciseEqual(foo(1), 3) + self.assertPreciseEqual(foo(1.5), 3.5) + + def test_recompile_signatures(self): + # Same as above, but with an explicit signature on @jit. + closure = 1 + + @jit("int32(int32)") + def foo(x): + return x + closure + self.assertPreciseEqual(foo(1), 2) + self.assertPreciseEqual(foo(1.5), 2) + closure = 2 + self.assertPreciseEqual(foo(1), 2) + # Recompiling takes the new closure into account. + foo.recompile() + self.assertPreciseEqual(foo(1), 3) + self.assertPreciseEqual(foo(1.5), 3) + + def test_inspect_llvm(self): + # Create a jited function + @jit + def foo(explicit_arg1, explicit_arg2): + return explicit_arg1 + explicit_arg2 + + # Call it in a way to create 3 signatures + foo(1, 1) + foo(1.0, 1) + foo(1.0, 1.0) + + # base call to get all llvm in a dict + llvms = foo.inspect_llvm() + self.assertEqual(len(llvms), 3) + + # make sure the function name shows up in the llvm + for llvm_bc in llvms.values(): + # Look for the function name + self.assertIn("foo", llvm_bc) + + # Look for the argument names + self.assertIn("explicit_arg1", llvm_bc) + self.assertIn("explicit_arg2", llvm_bc) + + def test_inspect_asm(self): + # Create a jited function + @jit + def foo(explicit_arg1, explicit_arg2): + return explicit_arg1 + explicit_arg2 + + # Call it in a way to create 3 signatures + foo(1, 1) + foo(1.0, 1) + foo(1.0, 1.0) + + # base call to get all llvm in a dict + asms = foo.inspect_asm() + self.assertEqual(len(asms), 3) + + # make sure the function name shows up in the llvm + for asm in asms.values(): + # Look for the function name + self.assertTrue("foo" in asm) + + def _check_cfg_display(self, cfg, wrapper=''): + # simple stringify test + if wrapper: + wrapper = "{}{}".format(len(wrapper), wrapper) + module_name = __name__.split('.', 1)[0] + module_len = len(module_name) + prefix = r'^digraph "CFG for \'_ZN{}{}{}'.format(wrapper, + module_len, + module_name) + self.assertRegex(str(cfg), prefix) + # .display() requires an optional dependency on `graphviz`. + # just test for the attribute without running it. + self.assertTrue(callable(cfg.display)) + + def test_inspect_cfg(self): + # Exercise the .inspect_cfg(). These are minimal tests and do not fully + # check the correctness of the function. + @jit + def foo(the_array): + return the_array.sum() + + # Generate 3 overloads + a1 = np.ones(1) + a2 = np.ones((1, 1)) + a3 = np.ones((1, 1, 1)) + foo(a1) + foo(a2) + foo(a3) + + # Call inspect_cfg() without arguments + cfgs = foo.inspect_cfg() + + # Correct count of overloads + self.assertEqual(len(cfgs), 3) + + # Makes sure all the signatures are correct + [s1, s2, s3] = cfgs.keys() + self.assertEqual(set([s1, s2, s3]), + set(map(lambda x: (typeof(x),), [a1, a2, a3]))) + + for cfg in cfgs.values(): + self._check_cfg_display(cfg) + self.assertEqual(len(list(cfgs.values())), 3) + + # Call inspect_cfg(signature) + cfg = foo.inspect_cfg(signature=foo.signatures[0]) + self._check_cfg_display(cfg) + + def test_inspect_cfg_with_python_wrapper(self): + # Exercise the .inspect_cfg() including the python wrapper. + # These are minimal tests and do not fully check the correctness of + # the function. + @jit + def foo(the_array): + return the_array.sum() + + # Generate 3 overloads + a1 = np.ones(1) + a2 = np.ones((1, 1)) + a3 = np.ones((1, 1, 1)) + foo(a1) + foo(a2) + foo(a3) + + # Call inspect_cfg(signature, show_wrapper="python") + cfg = foo.inspect_cfg(signature=foo.signatures[0], + show_wrapper="python") + self._check_cfg_display(cfg, wrapper='cpython') + + def test_inspect_types(self): + @jit + def foo(a, b): + return a + b + + foo(1, 2) + # Exercise the method + foo.inspect_types(StringIO()) + + # Test output + expected = str(foo.overloads[foo.signatures[0]].type_annotation) + with captured_stdout() as out: + foo.inspect_types() + assert expected in out.getvalue() + + def test_inspect_types_with_signature(self): + @jit + def foo(a): + return a + 1 + + foo(1) + foo(1.0) + # Inspect all signatures + with captured_stdout() as total: + foo.inspect_types() + # Inspect first signature + with captured_stdout() as first: + foo.inspect_types(signature=foo.signatures[0]) + # Inspect second signature + with captured_stdout() as second: + foo.inspect_types(signature=foo.signatures[1]) + + self.assertEqual(total.getvalue(), first.getvalue() + second.getvalue()) + + @unittest.skipIf(jinja2 is None, "please install the 'jinja2' package") + @unittest.skipIf(pygments is None, "please install the 'pygments' package") + def test_inspect_types_pretty(self): + @jit + def foo(a, b): + return a + b + + foo(1, 2) + + # Exercise the method, dump the output + with captured_stdout(): + ann = foo.inspect_types(pretty=True) + + # ensure HTML is found in the annotation output + for k, v in ann.ann.items(): + span_found = False + for line in v['pygments_lines']: + if 'span' in line[2]: + span_found = True + self.assertTrue(span_found) + + # check that file+pretty kwarg combo raises + with self.assertRaises(ValueError) as raises: + foo.inspect_types(file=StringIO(), pretty=True) + + self.assertIn("`file` must be None if `pretty=True`", + str(raises.exception)) + + def test_get_annotation_info(self): + @jit + def foo(a): + return a + 1 + + foo(1) + foo(1.3) + + expected = dict(chain.from_iterable(foo.get_annotation_info(i).items() + for i in foo.signatures)) + result = foo.get_annotation_info() + self.assertEqual(expected, result) + + def test_issue_with_array_layout_conflict(self): + """ + This test an issue with the dispatcher when an array that is both + C and F contiguous is supplied as the first signature. + The dispatcher checks for F contiguous first but the compiler checks + for C contiguous first. This results in an C contiguous code inserted + as F contiguous function. + """ + def pyfunc(A, i, j): + return A[i, j] + + cfunc = jit(pyfunc) + + ary_c_and_f = np.array([[1.]]) + ary_c = np.array([[0., 1.], [2., 3.]], order='C') + ary_f = np.array([[0., 1.], [2., 3.]], order='F') + + exp_c = pyfunc(ary_c, 1, 0) + exp_f = pyfunc(ary_f, 1, 0) + + self.assertEqual(1., cfunc(ary_c_and_f, 0, 0)) + got_c = cfunc(ary_c, 1, 0) + got_f = cfunc(ary_f, 1, 0) + + self.assertEqual(exp_c, got_c) + self.assertEqual(exp_f, got_f) + + +class TestDispatcherFunctionBoundaries(TestCase): + def test_pass_dispatcher_as_arg(self): + # Test that a Dispatcher object can be pass as argument + @jit(nopython=True) + def add1(x): + return x + 1 + + @jit(nopython=True) + def bar(fn, x): + return fn(x) + + @jit(nopython=True) + def foo(x): + return bar(add1, x) + + # Check dispatcher as argument inside NPM + inputs = [1, 11.1, np.arange(10)] + expected_results = [x + 1 for x in inputs] + + for arg, expect in zip(inputs, expected_results): + self.assertPreciseEqual(foo(arg), expect) + + # Check dispatcher as argument from python + for arg, expect in zip(inputs, expected_results): + self.assertPreciseEqual(bar(add1, arg), expect) + + def test_dispatcher_as_arg_usecase(self): + @jit(nopython=True) + def maximum(seq, cmpfn): + tmp = seq[0] + for each in seq[1:]: + cmpval = cmpfn(tmp, each) + if cmpval < 0: + tmp = each + return tmp + + got = maximum([1, 2, 3, 4], cmpfn=jit(lambda x, y: x - y)) + self.assertEqual(got, 4) + got = maximum(list(zip(range(5), range(5)[::-1])), + cmpfn=jit(lambda x, y: x[0] - y[0])) + self.assertEqual(got, (4, 0)) + got = maximum(list(zip(range(5), range(5)[::-1])), + cmpfn=jit(lambda x, y: x[1] - y[1])) + self.assertEqual(got, (0, 4)) + + def test_dispatcher_can_return_to_python(self): + @jit(nopython=True) + def foo(fn): + return fn + + fn = jit(lambda x: x) + + self.assertEqual(foo(fn), fn) + + def test_dispatcher_in_sequence_arg(self): + @jit(nopython=True) + def one(x): + return x + 1 + + @jit(nopython=True) + def two(x): + return one(one(x)) + + @jit(nopython=True) + def three(x): + return one(one(one(x))) + + @jit(nopython=True) + def choose(fns, x): + return fns[0](x), fns[1](x), fns[2](x) + + # Tuple case + self.assertEqual(choose((one, two, three), 1), (2, 3, 4)) + # List case + self.assertEqual(choose([one, one, one], 1), (2, 2, 2)) + + +class TestBoxingDefaultError(unittest.TestCase): + # Testing default error at boxing/unboxing + def test_unbox_runtime_error(self): + # Dummy type has no unbox support + def foo(x): + pass + argtys = (types.Dummy("dummy_type"),) + # This needs `compile_isolated`-like behaviour so as to bypass + # dispatcher type checking logic + cres = njit(argtys)(foo).overloads[argtys] + with self.assertRaises(TypeError) as raises: + # Can pass in whatever and the unbox logic will always raise + # without checking the input value. + cres.entry_point(None) + self.assertEqual(str(raises.exception), "can't unbox dummy_type type") + + def test_box_runtime_error(self): + @njit + def foo(): + return unittest # Module type has no boxing logic + with self.assertRaises(TypeError) as raises: + foo() + pat = "cannot convert native Module.* to Python object" + self.assertRegex(str(raises.exception), pat) + + +class TestNoRetryFailedSignature(unittest.TestCase): + """Test that failed-to-compile signatures are not recompiled. + """ + + def run_test(self, func): + fcom = func._compiler + self.assertEqual(len(fcom._failed_cache), 0) + # expected failure because `int` has no `__getitem__` + with self.assertRaises(errors.TypingError): + func(1) + self.assertEqual(len(fcom._failed_cache), 1) + # retry + with self.assertRaises(errors.TypingError): + func(1) + self.assertEqual(len(fcom._failed_cache), 1) + # retry with double + with self.assertRaises(errors.TypingError): + func(1.0) + self.assertEqual(len(fcom._failed_cache), 2) + + def test_direct_call(self): + @jit(nopython=True) + def foo(x): + return x[0] + + self.run_test(foo) + + def test_nested_call(self): + @jit(nopython=True) + def bar(x): + return x[0] + + @jit(nopython=True) + def foobar(x): + bar(x) + + @jit(nopython=True) + def foo(x): + return bar(x) + foobar(x) + + self.run_test(foo) + + @unittest.expectedFailure + # NOTE: @overload does not have an error cache. See PR #9259 for this + # feature and remove the xfail once this is merged. + def test_error_count(self): + def check(field, would_fail): + # Slightly modified from the reproducer in issue #4117. + # Before the patch, the compilation time of the failing case is + # much longer than of the successful case. This can be detected + # by the number of times `trigger()` is visited. + k = 10 + counter = {'c': 0} + + def trigger(x): + assert 0, "unreachable" + + @overload(trigger) + def ol_trigger(x): + # Keep track of every visit + counter['c'] += 1 + if would_fail: + raise errors.TypingError("invoke_failed") + return lambda x: x + + @jit(nopython=True) + def ident(out, x): + pass + + def chain_assign(fs, inner=ident): + tab_head, tab_tail = fs[-1], fs[:-1] + + @jit(nopython=True) + def assign(out, x): + inner(out, x) + out[0] += tab_head(x) + + if tab_tail: + return chain_assign(tab_tail, assign) + else: + return assign + + chain = chain_assign((trigger,) * k) + out = np.ones(2) + if would_fail: + with self.assertRaises(errors.TypingError) as raises: + chain(out, 1) + self.assertIn('invoke_failed', str(raises.exception)) + else: + chain(out, 1) + + # Returns the visit counts + return counter['c'] + + ct_ok = check('a', False) + ct_bad = check('c', True) + # `trigger()` is visited exactly once for both successful and failed + # compilation. + self.assertEqual(ct_ok, 1) + self.assertEqual(ct_bad, 1) + + +@njit +def add_y1(x, y=1): + return x + y + + +@njit +def add_ynone(x, y=None): + return x + (1 if y else 2) + + +@njit +def mult(x, y): + return x * y + + +@njit +def add_func(x, func=mult): + return x + func(x, x) + + +def _checker(f1, arg): + assert f1(arg) == f1.py_func(arg) + + +class TestMultiprocessingDefaultParameters(SerialMixin, unittest.TestCase): + def run_fc_multiproc(self, fc): + try: + ctx = multiprocessing.get_context('spawn') + except AttributeError: + ctx = multiprocessing + + # RE: issue #5973, this doesn't use multiprocessing.Pool.map as doing so + # causes the TBB library to segfault under certain conditions. It's not + # clear whether the cause is something in the complexity of the Pool + # itself, e.g. watcher threads etc, or if it's a problem synonymous with + # a "timing attack". + for a in [1, 2, 3]: + p = ctx.Process(target=_checker, args=(fc, a,)) + p.start() + p.join(_TEST_TIMEOUT) + self.assertEqual(p.exitcode, 0) + + def test_int_def_param(self): + """ Tests issue #4888""" + + self.run_fc_multiproc(add_y1) + + def test_none_def_param(self): + """ Tests None as a default parameter""" + + self.run_fc_multiproc(add_func) + + def test_function_def_param(self): + """ Tests a function as a default parameter""" + + self.run_fc_multiproc(add_func) + + +class TestVectorizeDifferentTargets(unittest.TestCase): + """Test that vectorize can be reapplied if the target is different + """ + + def test_cpu_vs_parallel(self): + @jit + def add(x, y): + return x + y + + custom_vectorize = vectorize([], identity=None, target='cpu') + + custom_vectorize(add) + + custom_vectorize_2 = vectorize([], identity=None, target='parallel') + + custom_vectorize_2(add) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_doctest.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_doctest.py new file mode 100644 index 0000000000000000000000000000000000000000..53771dc4d6c1cf542f62314dadbf6a670e9a99da --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_doctest.py @@ -0,0 +1,28 @@ +import doctest +import unittest +from numba.tests.support import TestCase + + +class TestDocTest(TestCase): + def test_basic_decorators(self): + from . import doctest_usecase + + # Make sure the finder see all the doctest + finder = doctest.DocTestFinder() + tests = finder.find(doctest_usecase) + testnames = {x.name for x in tests} + expected = { + 'numba.tests.doctest_usecase', + 'numba.tests.doctest_usecase.a', + 'numba.tests.doctest_usecase.b', + 'numba.tests.doctest_usecase.c', + 'numba.tests.doctest_usecase.d', + } + self.assertEqual(testnames, expected) + + # Execute the doctest in the module + doctest.testmod(doctest_usecase) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dyn_array.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dyn_array.py new file mode 100644 index 0000000000000000000000000000000000000000..1349e66cdad0aa2e14169411faa0d07776fb8a07 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dyn_array.py @@ -0,0 +1,1850 @@ +import contextlib +import sys +import numpy as np +import random +import re +import threading +import gc + +from numba.core.errors import TypingError +from numba import njit +from numba.core import types, utils, config +from numba.tests.support import MemoryLeakMixin, TestCase, tag, skip_if_32bit +import unittest + + +nrtjit = njit(_nrt=True, nogil=True) + + +def np_concatenate1(a, b, c): + return np.concatenate((a, b, c)) + +def np_concatenate2(a, b, c, axis): + return np.concatenate((a, b, c), axis=axis) + +def np_stack1(a, b, c): + return np.stack((a, b, c)) + +def np_stack2(a, b, c, axis): + return np.stack((a, b, c), axis=axis) + +def np_hstack(a, b, c): + return np.hstack((a, b, c)) + +def np_vstack(a, b, c): + return np.vstack((a, b, c)) + +def np_row_stack(a, b, c): + return np.row_stack((a, b, c)) + +def np_dstack(a, b, c): + return np.dstack((a, b, c)) + +def np_column_stack(a, b, c): + return np.column_stack((a, b, c)) + + +class BaseTest(TestCase): + + def check_outputs(self, pyfunc, argslist, exact=True): + cfunc = nrtjit(pyfunc) + for args in argslist: + expected = pyfunc(*args) + ret = cfunc(*args) + self.assertEqual(ret.size, expected.size) + self.assertEqual(ret.dtype, expected.dtype) + self.assertStridesEqual(ret, expected) + if exact: + np.testing.assert_equal(expected, ret) + else: + np.testing.assert_allclose(expected, ret) + + +class NrtRefCtTest(MemoryLeakMixin): + def assert_array_nrt_refct(self, arr, expect): + self.assertEqual(arr.base.refcount, expect) + + +class TestDynArray(NrtRefCtTest, TestCase): + + def test_empty_0d(self): + @nrtjit + def foo(): + arr = np.empty(()) + arr[()] = 42 + return arr + + arr = foo() + self.assert_array_nrt_refct(arr, 1) + np.testing.assert_equal(42, arr) + self.assertEqual(arr.size, 1) + self.assertEqual(arr.shape, ()) + self.assertEqual(arr.dtype, np.dtype(np.float64)) + self.assertEqual(arr.strides, ()) + arr.fill(123) # test writability + np.testing.assert_equal(123, arr) + del arr + + def test_empty_1d(self): + @nrtjit + def foo(n): + arr = np.empty(n) + for i in range(n): + arr[i] = i + + return arr + + n = 3 + arr = foo(n) + self.assert_array_nrt_refct(arr, 1) + np.testing.assert_equal(np.arange(n), arr) + self.assertEqual(arr.size, n) + self.assertEqual(arr.shape, (n,)) + self.assertEqual(arr.dtype, np.dtype(np.float64)) + self.assertEqual(arr.strides, (np.dtype(np.float64).itemsize,)) + arr.fill(123) # test writability + np.testing.assert_equal(123, arr) + del arr + + def test_empty_2d(self): + def pyfunc(m, n): + arr = np.empty((m, n), np.int32) + for i in range(m): + for j in range(n): + arr[i, j] = i + j + + return arr + + cfunc = nrtjit(pyfunc) + m = 4 + n = 3 + expected_arr = pyfunc(m, n) + got_arr = cfunc(m, n) + self.assert_array_nrt_refct(got_arr, 1) + np.testing.assert_equal(expected_arr, got_arr) + + self.assertEqual(expected_arr.size, got_arr.size) + self.assertEqual(expected_arr.shape, got_arr.shape) + self.assertEqual(expected_arr.strides, got_arr.strides) + + del got_arr + + def test_empty_3d(self): + def pyfunc(m, n, p): + arr = np.empty((m, n, p), np.int32) + for i in range(m): + for j in range(n): + for k in range(p): + arr[i, j, k] = i + j + k + + return arr + + cfunc = nrtjit(pyfunc) + m = 4 + n = 3 + p = 2 + expected_arr = pyfunc(m, n, p) + got_arr = cfunc(m, n, p) + self.assert_array_nrt_refct(got_arr, 1) + np.testing.assert_equal(expected_arr, got_arr) + + self.assertEqual(expected_arr.size, got_arr.size) + self.assertEqual(expected_arr.shape, got_arr.shape) + self.assertEqual(expected_arr.strides, got_arr.strides) + + del got_arr + + def test_empty_2d_sliced(self): + def pyfunc(m, n, p): + arr = np.empty((m, n), np.int32) + for i in range(m): + for j in range(n): + arr[i, j] = i + j + + return arr[p] + + cfunc = nrtjit(pyfunc) + m = 4 + n = 3 + p = 2 + expected_arr = pyfunc(m, n, p) + got_arr = cfunc(m, n, p) + self.assert_array_nrt_refct(got_arr, 1) + np.testing.assert_equal(expected_arr, got_arr) + + self.assertEqual(expected_arr.size, got_arr.size) + self.assertEqual(expected_arr.shape, got_arr.shape) + self.assertEqual(expected_arr.strides, got_arr.strides) + + del got_arr + + def test_return_global_array(self): + y = np.ones(4, dtype=np.float32) + initrefct = sys.getrefcount(y) + + def return_external_array(): + return y + + cfunc = nrtjit(return_external_array) + out = cfunc() + + # out reference by cfunc + self.assertEqual(initrefct + 1, sys.getrefcount(y)) + + np.testing.assert_equal(y, out) + np.testing.assert_equal(y, np.ones(4, dtype=np.float32)) + np.testing.assert_equal(out, np.ones(4, dtype=np.float32)) + + del out + gc.collect() + # out is only referenced by cfunc + self.assertEqual(initrefct + 1, sys.getrefcount(y)) + + del cfunc + gc.collect() + # y is no longer referenced by cfunc + self.assertEqual(initrefct, sys.getrefcount(y)) + + def test_return_global_array_sliced(self): + y = np.ones(4, dtype=np.float32) + + def return_external_array(): + return y[2:] + + cfunc = nrtjit(return_external_array) + out = cfunc() + self.assertIsNone(out.base) + + yy = y[2:] + np.testing.assert_equal(yy, out) + np.testing.assert_equal(yy, np.ones(2, dtype=np.float32)) + np.testing.assert_equal(out, np.ones(2, dtype=np.float32)) + + def test_array_pass_through(self): + def pyfunc(y): + return y + + arr = np.ones(4, dtype=np.float32) + + cfunc = nrtjit(pyfunc) + expected = cfunc(arr) + got = pyfunc(arr) + + np.testing.assert_equal(expected, arr) + np.testing.assert_equal(expected, got) + self.assertIs(expected, arr) + self.assertIs(expected, got) + + def test_array_pass_through_sliced(self): + def pyfunc(y): + return y[y.size // 2:] + + arr = np.ones(4, dtype=np.float32) + + initrefct = sys.getrefcount(arr) + + cfunc = nrtjit(pyfunc) + got = cfunc(arr) + self.assertEqual(initrefct + 1, sys.getrefcount(arr)) + expected = pyfunc(arr) + self.assertEqual(initrefct + 2, sys.getrefcount(arr)) + + np.testing.assert_equal(expected, arr[arr.size // 2]) + np.testing.assert_equal(expected, got) + + del expected + self.assertEqual(initrefct + 1, sys.getrefcount(arr)) + del got + self.assertEqual(initrefct, sys.getrefcount(arr)) + + def test_ufunc_with_allocated_output(self): + + def pyfunc(a, b): + out = np.empty(a.shape) + np.add(a, b, out) + return out + + cfunc = nrtjit(pyfunc) + + # 1D case + arr_a = np.random.random(10) + arr_b = np.random.random(10) + + np.testing.assert_equal(pyfunc(arr_a, arr_b), + cfunc(arr_a, arr_b)) + + self.assert_array_nrt_refct(cfunc(arr_a, arr_b), 1) + + # 2D case + arr_a = np.random.random(10).reshape(2, 5) + arr_b = np.random.random(10).reshape(2, 5) + + np.testing.assert_equal(pyfunc(arr_a, arr_b), + cfunc(arr_a, arr_b)) + + self.assert_array_nrt_refct(cfunc(arr_a, arr_b), 1) + + # 3D case + arr_a = np.random.random(70).reshape(2, 5, 7) + arr_b = np.random.random(70).reshape(2, 5, 7) + + np.testing.assert_equal(pyfunc(arr_a, arr_b), + cfunc(arr_a, arr_b)) + + self.assert_array_nrt_refct(cfunc(arr_a, arr_b), 1) + + def test_allocation_mt(self): + """ + This test exercises the array allocation in multithreaded usecase. + This stress the freelist inside NRT. + """ + + def pyfunc(inp): + out = np.empty(inp.size) + + # Zero fill + for i in range(out.size): + out[i] = 0 + + for i in range(inp[0]): + # Allocate inside a loop + tmp = np.empty(inp.size) + # Write to tmp + for j in range(tmp.size): + tmp[j] = inp[j] + # out = tmp + i + for j in range(tmp.size): + out[j] += tmp[j] + i + + return out + + cfunc = nrtjit(pyfunc) + size = 10 # small array size so that the computation is short + arr = np.random.randint(1, 10, size) + frozen_arr = arr.copy() + + np.testing.assert_equal(pyfunc(arr), cfunc(arr)) + # Ensure we did not modify the input + np.testing.assert_equal(frozen_arr, arr) + + workers = [] + inputs = [] + outputs = [] + + # Make wrapper to store the output + def wrapped(inp, out): + out[:] = cfunc(inp) + + # Create a lot of worker threads to create contention + for i in range(100): + arr = np.random.randint(1, 10, size) + out = np.empty_like(arr) + thread = threading.Thread(target=wrapped, + args=(arr, out), + name="worker{0}".format(i)) + workers.append(thread) + inputs.append(arr) + outputs.append(out) + + # Launch worker threads + for thread in workers: + thread.start() + + # Join worker threads + for thread in workers: + thread.join() + + # Check result + for inp, out in zip(inputs, outputs): + np.testing.assert_equal(pyfunc(inp), out) + + def test_refct_mt(self): + """ + This test exercises the refct in multithreaded code + """ + + def pyfunc(n, inp): + out = np.empty(inp.size) + for i in range(out.size): + out[i] = inp[i] + 1 + # Use swap to trigger many refct ops + for i in range(n): + out, inp = inp, out + return out + + cfunc = nrtjit(pyfunc) + size = 10 + input = np.arange(size, dtype=float) + expected_refct = sys.getrefcount(input) + swapct = random.randrange(1000) + expected = pyfunc(swapct, input) + np.testing.assert_equal(expected, cfunc(swapct, input)) + # The following checks can discover a reference count error + del expected + self.assertEqual(expected_refct, sys.getrefcount(input)) + + workers = [] + outputs = [] + swapcts = [] + + # Make wrapper to store the output + def wrapped(n, input, out): + out[:] = cfunc(n, input) + + # Create worker threads + for i in range(100): + out = np.empty(size) + # All thread shares the same input + swapct = random.randrange(1000) + thread = threading.Thread(target=wrapped, + args=(swapct, input, out), + name="worker{0}".format(i)) + workers.append(thread) + outputs.append(out) + swapcts.append(swapct) + + # Launch worker threads + for thread in workers: + thread.start() + + # Join worker threads + for thread in workers: + thread.join() + + # Check result + for swapct, out in zip(swapcts, outputs): + np.testing.assert_equal(pyfunc(swapct, input), out) + + del outputs, workers + # The following checks can discover a reference count error + self.assertEqual(expected_refct, sys.getrefcount(input)) + + @skip_if_32bit + def test_invalid_size_array(self): + + @njit + def foo(x): + np.empty(x) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertRaises(MemoryError) as raises: + foo(types.size_t.maxval // 8 // 2) + + self.assertIn("Allocation failed", str(raises.exception)) + + def test_swap(self): + + def pyfunc(x, y, t): + """Swap array x and y for t number of times + """ + for i in range(t): + x, y = y, x + + return x, y + + + cfunc = nrtjit(pyfunc) + + x = np.random.random(100) + y = np.random.random(100) + + t = 100 + + initrefct = sys.getrefcount(x), sys.getrefcount(y) + expect, got = pyfunc(x, y, t), cfunc(x, y, t) + self.assertIsNone(got[0].base) + self.assertIsNone(got[1].base) + np.testing.assert_equal(expect, got) + del expect, got + self.assertEqual(initrefct, (sys.getrefcount(x), sys.getrefcount(y))) + + def test_return_tuple_of_array(self): + + def pyfunc(x): + y = np.empty(x.size) + for i in range(y.size): + y[i] = x[i] + 1 + return x, y + + cfunc = nrtjit(pyfunc) + + x = np.random.random(5) + initrefct = sys.getrefcount(x) + expected_x, expected_y = pyfunc(x) + got_x, got_y = cfunc(x) + self.assertIs(x, expected_x) + self.assertIs(x, got_x) + np.testing.assert_equal(expected_x, got_x) + np.testing.assert_equal(expected_y, got_y) + del expected_x, got_x + self.assertEqual(initrefct, sys.getrefcount(x)) + + self.assertEqual(sys.getrefcount(expected_y), sys.getrefcount(got_y)) + + def test_return_tuple_of_array_created(self): + + def pyfunc(x): + y = np.empty(x.size) + for i in range(y.size): + y[i] = x[i] + 1 + out = y, y + return out + + cfunc = nrtjit(pyfunc) + + x = np.random.random(5) + expected_x, expected_y = pyfunc(x) + got_x, got_y = cfunc(x) + np.testing.assert_equal(expected_x, got_x) + np.testing.assert_equal(expected_y, got_y) + # getrefcount owns 1, got_y owns 1 + self.assertEqual(2, sys.getrefcount(got_y)) + # getrefcount owns 1, got_y owns 1 + self.assertEqual(2, sys.getrefcount(got_y)) + + def test_issue_with_return_leak(self): + """ + Dispatcher returns a new reference. + It need to workaround it for now. + """ + @nrtjit + def inner(out): + return out + + def pyfunc(x): + return inner(x) + + cfunc = nrtjit(pyfunc) + + arr = np.arange(10) + old_refct = sys.getrefcount(arr) + + self.assertEqual(old_refct, sys.getrefcount(pyfunc(arr))) + self.assertEqual(old_refct, sys.getrefcount(cfunc(arr))) + self.assertEqual(old_refct, sys.getrefcount(arr)) + + +class ConstructorBaseTest(NrtRefCtTest): + + def check_0d(self, pyfunc): + cfunc = nrtjit(pyfunc) + expected = pyfunc() + ret = cfunc() + self.assert_array_nrt_refct(ret, 1) + self.assertEqual(ret.size, expected.size) + self.assertEqual(ret.shape, expected.shape) + self.assertEqual(ret.dtype, expected.dtype) + self.assertEqual(ret.strides, expected.strides) + self.check_result_value(ret, expected) + # test writability + expected = np.empty_like(ret) # np.full_like was not added until Numpy 1.8 + expected.fill(123) + ret.fill(123) + np.testing.assert_equal(ret, expected) + + def check_1d(self, pyfunc): + cfunc = nrtjit(pyfunc) + n = 3 + expected = pyfunc(n) + ret = cfunc(n) + self.assert_array_nrt_refct(ret, 1) + self.assertEqual(ret.size, expected.size) + self.assertEqual(ret.shape, expected.shape) + self.assertEqual(ret.dtype, expected.dtype) + self.assertEqual(ret.strides, expected.strides) + self.check_result_value(ret, expected) + # test writability + expected = np.empty_like(ret) # np.full_like was not added until Numpy 1.8 + expected.fill(123) + ret.fill(123) + np.testing.assert_equal(ret, expected) + # errors + with self.assertRaises(ValueError) as cm: + cfunc(-1) + self.assertEqual(str(cm.exception), "negative dimensions not allowed") + + def check_2d(self, pyfunc): + cfunc = nrtjit(pyfunc) + m, n = 2, 3 + expected = pyfunc(m, n) + ret = cfunc(m, n) + self.assert_array_nrt_refct(ret, 1) + self.assertEqual(ret.size, expected.size) + self.assertEqual(ret.shape, expected.shape) + self.assertEqual(ret.dtype, expected.dtype) + self.assertEqual(ret.strides, expected.strides) + self.check_result_value(ret, expected) + # test writability + expected = np.empty_like(ret) # np.full_like was not added until Numpy 1.8 + expected.fill(123) + ret.fill(123) + np.testing.assert_equal(ret, expected) + # errors + with self.assertRaises(ValueError) as cm: + cfunc(2, -1) + self.assertEqual(str(cm.exception), "negative dimensions not allowed") + + def check_alloc_size(self, pyfunc): + """Checks that pyfunc will error, not segfaulting due to array size.""" + cfunc = nrtjit(pyfunc) + with self.assertRaises(ValueError) as e: + cfunc() + self.assertIn( + "array is too big", + str(e.exception) + ) + + +class TestNdZeros(ConstructorBaseTest, TestCase): + + def setUp(self): + super(TestNdZeros, self).setUp() + self.pyfunc = np.zeros + + def check_result_value(self, ret, expected): + np.testing.assert_equal(ret, expected) + + def test_0d(self): + pyfunc = self.pyfunc + def func(): + return pyfunc(()) + self.check_0d(func) + + def test_1d(self): + pyfunc = self.pyfunc + def func(n): + return pyfunc(n) + self.check_1d(func) + + def test_1d_dtype(self): + pyfunc = self.pyfunc + def func(n): + return pyfunc(n, np.int32) + self.check_1d(func) + + def test_1d_dtype_instance(self): + # dtype as numpy dtype, not as scalar class + pyfunc = self.pyfunc + _dtype = np.dtype('int32') + def func(n): + return pyfunc(n, _dtype) + self.check_1d(func) + + def test_1d_dtype_str(self): + pyfunc = self.pyfunc + _dtype = 'int32' + def func(n): + return pyfunc(n, _dtype) + self.check_1d(func) + + def func(n): + return pyfunc(n, 'complex128') + self.check_1d(func) + + def test_1d_dtype_str_alternative_spelling(self): + # like test_1d_dtype_str but using the shorthand type spellings + pyfunc = self.pyfunc + _dtype = 'i4' + def func(n): + return pyfunc(n, _dtype) + self.check_1d(func) + + def func(n): + return pyfunc(n, 'c8') + self.check_1d(func) + + def test_1d_dtype_str_structured_dtype(self): + # test_1d_dtype_str but using a structured dtype + pyfunc = self.pyfunc + _dtype = "i4, (2,3)f8" + def func(n): + return pyfunc(n, _dtype) + self.check_1d(func) + + def test_1d_dtype_non_const_str(self): + pyfunc = self.pyfunc + + @njit + def func(n, dt): + return pyfunc(n, dt) + + with self.assertRaises(TypingError) as raises: + func(5, 'int32') + + excstr = str(raises.exception) + msg = (f"If np.{self.pyfunc.__name__} dtype is a string it must be a " + "string constant.") + self.assertIn(msg, excstr) + + def test_1d_dtype_invalid_str(self): + pyfunc = self.pyfunc + + @njit + def func(n): + return pyfunc(n, 'ABCDEF') + + with self.assertRaises(TypingError) as raises: + func(5) + + excstr = str(raises.exception) + self.assertIn("Invalid NumPy dtype specified: 'ABCDEF'", excstr) + + def test_2d(self): + pyfunc = self.pyfunc + def func(m, n): + return pyfunc((m, n)) + self.check_2d(func) + + def test_2d_shape_dtypes(self): + # Test for issue #4575 + pyfunc = self.pyfunc + def func1(m, n): + return pyfunc((np.int16(m), np.int32(n))) + self.check_2d(func1) + # Using a 64-bit value checks that 32 bit systems will downcast to intp + def func2(m, n): + return pyfunc((np.int64(m), np.int8(n))) + self.check_2d(func2) + # Make sure an error is thrown if we can't downcast safely + if config.IS_32BITS: + cfunc = nrtjit(lambda m, n: pyfunc((m, n))) + with self.assertRaises(ValueError): + cfunc(np.int64(1 << (32 - 1)), 1) + + def test_2d_dtype_kwarg(self): + pyfunc = self.pyfunc + def func(m, n): + return pyfunc((m, n), dtype=np.complex64) + self.check_2d(func) + + def test_2d_dtype_str_kwarg(self): + pyfunc = self.pyfunc + def func(m, n): + return pyfunc((m, n), dtype='complex64') + self.check_2d(func) + + def test_2d_dtype_str_kwarg_alternative_spelling(self): + # as test_2d_dtype_str_kwarg but with the numpy shorthand type spelling + pyfunc = self.pyfunc + def func(m, n): + return pyfunc((m, n), dtype='c8') + self.check_2d(func) + + def test_alloc_size(self): + pyfunc = self.pyfunc + width = types.intp.bitwidth + def gen_func(shape, dtype): + return lambda : pyfunc(shape, dtype) + # Under these values numba will segfault, but that's another issue + self.check_alloc_size(gen_func(1 << width - 2, np.intp)) + self.check_alloc_size(gen_func((1 << width - 8, 64), np.intp)) + + +class TestNdOnes(TestNdZeros): + + def setUp(self): + super(TestNdOnes, self).setUp() + self.pyfunc = np.ones + + @unittest.expectedFailure + def test_1d_dtype_str_structured_dtype(self): + super().test_1d_dtype_str_structured_dtype() + + +class TestNdFull(ConstructorBaseTest, TestCase): + + def check_result_value(self, ret, expected): + np.testing.assert_equal(ret, expected) + + def test_0d(self): + def func(): + return np.full((), 4.5) + self.check_0d(func) + + def test_1d(self): + def func(n): + return np.full(n, 4.5) + self.check_1d(func) + + def test_1d_dtype(self): + def func(n): + return np.full(n, 4.5, np.bool_) + self.check_1d(func) + + def test_1d_dtype_instance(self): + dtype = np.dtype('bool') + def func(n): + return np.full(n, 4.5, dtype) + self.check_1d(func) + + def test_1d_dtype_str(self): + def func(n): + return np.full(n, 4.5, 'bool_') + self.check_1d(func) + + def test_1d_dtype_str_alternative_spelling(self): + # like test_1d_dtype_str but using the shorthand type spelling + def func(n): + return np.full(n, 4.5, '?') + self.check_1d(func) + + def test_1d_dtype_non_const_str(self): + + @njit + def func(n, fv, dt): + return np.full(n, fv, dt) + + with self.assertRaises(TypingError) as raises: + func((5,), 4.5, 'int32') + + excstr = str(raises.exception) + msg = ("If np.full dtype is a string it must be a " + "string constant.") + self.assertIn(msg, excstr) + + def test_1d_dtype_invalid_str(self): + + @njit + def func(n, fv): + return np.full(n, fv, 'ABCDEF') + + with self.assertRaises(TypingError) as raises: + func((5,), 4.5) + + excstr = str(raises.exception) + self.assertIn("Invalid NumPy dtype specified: 'ABCDEF'", excstr) + + def test_2d(self): + def func(m, n): + return np.full((m, n), 4.5) + self.check_2d(func) + + def test_2d_dtype_kwarg(self): + def func(m, n): + return np.full((m, n), 1 + 4.5j, dtype=np.complex64) + self.check_2d(func) + + def test_2d_dtype_from_type(self): + # tests issue #2862 + def func(m, n): + return np.full((m, n), np.int32(1)) + self.check_2d(func) + + # Complex uses `.real`, imaginary part dropped + def func(m, n): + return np.full((m, n), np.complex128(1)) + self.check_2d(func) + + # and that if a dtype is specified, this influences the return type + def func(m, n): + return np.full((m, n), 1, dtype=np.int8) + self.check_2d(func) + + def test_2d_shape_dtypes(self): + # Test for issue #4575 + def func1(m, n): + return np.full((np.int16(m), np.int32(n)), 4.5) + self.check_2d(func1) + # Using a 64-bit value checks that 32 bit systems will downcast to intp + def func2(m, n): + return np.full((np.int64(m), np.int8(n)), 4.5) + self.check_2d(func2) + # Make sure an error is thrown if we can't downcast safely + if config.IS_32BITS: + cfunc = nrtjit(lambda m, n: np.full((m, n), 4.5)) + with self.assertRaises(ValueError): + cfunc(np.int64(1 << (32 - 1)), 1) + + def test_alloc_size(self): + width = types.intp.bitwidth + def gen_func(shape, value): + return lambda : np.full(shape, value) + # Under these values numba will segfault, but that's another issue + self.check_alloc_size(gen_func(1 << width - 2, 1)) + self.check_alloc_size(gen_func((1 << width - 8, 64), 1)) + + +class ConstructorLikeBaseTest(object): + + def mutate_array(self, arr): + try: + arr.fill(42) + except (TypeError, ValueError): + # Try something else (e.g. Numpy 1.6 with structured dtypes) + fill_value = b'x' * arr.dtype.itemsize + arr.fill(fill_value) + + def check_like(self, pyfunc, dtype): + def check_arr(arr): + expected = pyfunc(arr) + ret = cfunc(arr) + self.assertEqual(ret.size, expected.size) + self.assertEqual(ret.dtype, expected.dtype) + self.assertStridesEqual(ret, expected) + self.check_result_value(ret, expected) + # test writability + self.mutate_array(ret) + self.mutate_array(expected) + np.testing.assert_equal(ret, expected) + + orig = np.linspace(0, 5, 6).astype(dtype) + cfunc = nrtjit(pyfunc) + + for shape in (6, (2, 3), (1, 2, 3), (3, 1, 2), ()): + if shape == (): + arr = orig[-1:].reshape(()) + else: + arr = orig.reshape(shape) + check_arr(arr) + # Non-contiguous array + if arr.ndim > 0: + check_arr(arr[::2]) + # Check new array doesn't inherit readonly flag + arr.flags['WRITEABLE'] = False + # verify read-only + with self.assertRaises(ValueError): + arr[0] = 1 + check_arr(arr) + + # Scalar argument => should produce a 0-d array + check_arr(orig[0]) + + +class TestNdEmptyLike(ConstructorLikeBaseTest, TestCase): + + def setUp(self): + super(TestNdEmptyLike, self).setUp() + self.pyfunc = np.empty_like + + def check_result_value(self, ret, expected): + pass + + def test_like(self): + pyfunc = self.pyfunc + def func(arr): + return pyfunc(arr) + self.check_like(func, np.float64) + + def test_like_structured(self): + dtype = np.dtype([('a', np.int16), ('b', np.float32)]) + pyfunc = self.pyfunc + def func(arr): + return pyfunc(arr) + self.check_like(func, dtype) + + def test_like_dtype(self): + pyfunc = self.pyfunc + def func(arr): + return pyfunc(arr, np.int32) + self.check_like(func, np.float64) + + def test_like_dtype_instance(self): + dtype = np.dtype('int32') + pyfunc = self.pyfunc + def func(arr): + return pyfunc(arr, dtype) + self.check_like(func, np.float64) + + def test_like_dtype_structured(self): + dtype = np.dtype([('a', np.int16), ('b', np.float32)]) + pyfunc = self.pyfunc + def func(arr): + return pyfunc(arr, dtype) + self.check_like(func, np.float64) + + def test_like_dtype_kwarg(self): + pyfunc = self.pyfunc + def func(arr): + return pyfunc(arr, dtype=np.int32) + self.check_like(func, np.float64) + + def test_like_dtype_str_kwarg(self): + pyfunc = self.pyfunc + def func(arr): + return pyfunc(arr, dtype='int32') + self.check_like(func, np.float64) + + def test_like_dtype_str_kwarg_alternative_spelling(self): + pyfunc = self.pyfunc + def func(arr): + return pyfunc(arr, dtype='i4') + self.check_like(func, np.float64) + + def test_like_dtype_non_const_str(self): + pyfunc = self.pyfunc + + @njit + def func(n, dt): + return pyfunc(n, dt) + + with self.assertRaises(TypingError) as raises: + func(np.ones(4), 'int32') + + excstr = str(raises.exception) + msg = (f"If np.{self.pyfunc.__name__} dtype is a string it must be a " + "string constant.") + self.assertIn(msg, excstr) + self.assertIn( + '{}(array(float64, 1d, C), unicode_type)'.format(pyfunc.__name__), + excstr) + + def test_like_dtype_invalid_str(self): + pyfunc = self.pyfunc + + @njit + def func(n): + return pyfunc(n, 'ABCDEF') + + with self.assertRaises(TypingError) as raises: + func(np.ones(4)) + + excstr = str(raises.exception) + self.assertIn("Invalid NumPy dtype specified: 'ABCDEF'", excstr) + + +class TestNdZerosLike(TestNdEmptyLike): + + def setUp(self): + super(TestNdZerosLike, self).setUp() + self.pyfunc = np.zeros_like + + def check_result_value(self, ret, expected): + np.testing.assert_equal(ret, expected) + + def test_like_structured(self): + super(TestNdZerosLike, self).test_like_structured() + + def test_like_dtype_structured(self): + super(TestNdZerosLike, self).test_like_dtype_structured() + + +class TestNdOnesLike(TestNdZerosLike): + + def setUp(self): + super(TestNdOnesLike, self).setUp() + self.pyfunc = np.ones_like + self.expected_value = 1 + + # Not supported yet. + + @unittest.expectedFailure + def test_like_structured(self): + super(TestNdOnesLike, self).test_like_structured() + + @unittest.expectedFailure + def test_like_dtype_structured(self): + super(TestNdOnesLike, self).test_like_dtype_structured() + + +class TestNdFullLike(ConstructorLikeBaseTest, TestCase): + + def check_result_value(self, ret, expected): + np.testing.assert_equal(ret, expected) + + def test_like(self): + def func(arr): + return np.full_like(arr, 3.5) + self.check_like(func, np.float64) + + # Not supported yet. + @unittest.expectedFailure + def test_like_structured(self): + dtype = np.dtype([('a', np.int16), ('b', np.float32)]) + def func(arr): + return np.full_like(arr, 4.5) + self.check_like(func, dtype) + + def test_like_dtype(self): + def func(arr): + return np.full_like(arr, 4.5, np.bool_) + self.check_like(func, np.float64) + + def test_like_dtype_instance(self): + dtype = np.dtype('bool') + def func(arr): + return np.full_like(arr, 4.5, dtype) + self.check_like(func, np.float64) + + def test_like_dtype_kwarg(self): + def func(arr): + return np.full_like(arr, 4.5, dtype=np.bool_) + self.check_like(func, np.float64) + + def test_like_dtype_str_kwarg(self): + def func(arr): + return np.full_like(arr, 4.5, 'bool_') + self.check_like(func, np.float64) + + def test_like_dtype_str_kwarg_alternative_spelling(self): + def func(arr): + return np.full_like(arr, 4.5, dtype='?') + self.check_like(func, np.float64) + + def test_like_dtype_non_const_str_kwarg(self): + + @njit + def func(arr, fv, dt): + return np.full_like(arr, fv, dt) + + with self.assertRaises(TypingError) as raises: + func(np.ones(3,), 4.5, 'int32') + + excstr = str(raises.exception) + msg = ("If np.full_like dtype is a string it must be a " + "string constant.") + self.assertIn(msg, excstr) + + def test_like_dtype_invalid_str(self): + + @njit + def func(arr, fv): + return np.full_like(arr, fv, "ABCDEF") + + with self.assertRaises(TypingError) as raises: + func(np.ones(4), 3.4) + + excstr = str(raises.exception) + self.assertIn("Invalid NumPy dtype specified: 'ABCDEF'", excstr) + + +class TestNdIdentity(BaseTest): + + def check_identity(self, pyfunc): + self.check_outputs(pyfunc, [(3,)]) + + def test_identity(self): + def func(n): + return np.identity(n) + self.check_identity(func) + + def test_identity_dtype(self): + for dtype in (np.complex64, np.int16, np.bool_, np.dtype('bool'), + 'bool_'): + def func(n): + return np.identity(n, dtype) + self.check_identity(func) + + def test_like_dtype_non_const_str_kwarg(self): + + @njit + def func(n, dt): + return np.identity(n, dt) + + with self.assertRaises(TypingError) as raises: + func(4, 'int32') + + excstr = str(raises.exception) + msg = ("If np.identity dtype is a string it must be a " + "string constant.") + self.assertIn(msg, excstr) + + + +class TestNdEye(BaseTest): + + def test_eye_n(self): + def func(n): + return np.eye(n) + self.check_outputs(func, [(1,), (3,)]) + + def test_eye_n_dtype(self): + # check None option, dtype class, instance of dtype class + for dt in (None, np.complex128, np.complex64(1)): + def func(n, dtype=dt): + return np.eye(n, dtype=dtype) + self.check_outputs(func, [(1,), (3,)]) + + def test_eye_n_m(self): + def func(n, m): + return np.eye(n, m) + self.check_outputs(func, [(1, 2), (3, 2), (0, 3)]) + + def check_eye_n_m_k(self, func): + self.check_outputs(func, [(1, 2, 0), + (3, 4, 1), + (3, 4, -1), + (4, 3, -2), + (4, 3, -5), + (4, 3, 5)]) + + def test_eye_n_m_k(self): + def func(n, m, k): + return np.eye(n, m, k) + self.check_eye_n_m_k(func) + + def test_eye_n_m_k_dtype(self): + def func(n, m, k): + return np.eye(N=n, M=m, k=k, dtype=np.int16) + self.check_eye_n_m_k(func) + + def test_eye_n_m_k_dtype_instance(self): + dtype = np.dtype('int16') + def func(n, m, k): + return np.eye(N=n, M=m, k=k, dtype=dtype) + self.check_eye_n_m_k(func) + + +class TestNdDiag(TestCase): + + def setUp(self): + v = np.array([1, 2, 3]) + hv = np.array([[1, 2, 3]]) + vv = np.transpose(hv) + self.vectors = [v, hv, vv] + a3x4 = np.arange(12).reshape(3, 4) + a4x3 = np.arange(12).reshape(4, 3) + self.matricies = [a3x4, a4x3] + def func(q): + return np.diag(q) + self.py = func + self.jit = nrtjit(func) + + def func_kwarg(q, k=0): + return np.diag(q, k=k) + self.py_kw = func_kwarg + self.jit_kw = nrtjit(func_kwarg) + + def check_diag(self, pyfunc, nrtfunc, *args, **kwargs): + expected = pyfunc(*args, **kwargs) + computed = nrtfunc(*args, **kwargs) + self.assertEqual(computed.size, expected.size) + self.assertEqual(computed.dtype, expected.dtype) + # NOTE: stride not tested as np returns a RO view, nb returns new data + np.testing.assert_equal(expected, computed) + + # create a diag matrix from a vector + def test_diag_vect_create(self): + for d in self.vectors: + self.check_diag(self.py, self.jit, d) + + # create a diag matrix from a vector at a given offset + def test_diag_vect_create_kwarg(self): + for k in range(-10, 10): + for d in self.vectors: + self.check_diag(self.py_kw, self.jit_kw, d, k=k) + + # extract the diagonal + def test_diag_extract(self): + for d in self.matricies: + self.check_diag(self.py, self.jit, d) + + # extract a diagonal at a given offset + def test_diag_extract_kwarg(self): + for k in range(-4, 4): + for d in self.matricies: + self.check_diag(self.py_kw, self.jit_kw, d, k=k) + + # check error handling + def test_error_handling(self): + d = np.array([[[1.]]]) + cfunc = nrtjit(self.py) + + # missing arg + with self.assertRaises(TypeError): + cfunc() + + # > 2d + with self.assertRaises(TypingError): + cfunc(d) + with self.assertRaises(TypingError): + dfunc = nrtjit(self.py_kw) + dfunc(d, k=3) + + def test_bad_shape(self): + cfunc = nrtjit(self.py) + msg = '.*The argument "v" must be array-like.*' + with self.assertRaisesRegex(TypingError, msg) as raises: + cfunc(None) + +class TestLinspace(BaseTest): + + def test_linspace_2(self): + def pyfunc(n, m): + return np.linspace(n, m) + self.check_outputs(pyfunc, + [(0, 4), (1, 100), (-3.5, 2.5), (-3j, 2+3j), + (2, 1), (1+0.5j, 1.5j)]) + + def test_linspace_3(self): + def pyfunc(n, m, p): + return np.linspace(n, m, p) + self.check_outputs(pyfunc, + [(0, 4, 9), (1, 4, 3), (-3.5, 2.5, 8), + (-3j, 2+3j, 7), (2, 1, 0), + (1+0.5j, 1.5j, 5), (1, 1e100, 1)]) + + def test_linspace_accuracy(self): + # Checking linspace reasonably replicates NumPy's algorithm + # see https://github.com/numba/numba/issues/6768 + @nrtjit + def foo(n, m, p): + return np.linspace(n, m, p) + + n, m, p = 0.0, 1.0, 100 + self.assertPreciseEqual(foo(n, m, p), foo.py_func(n, m, p)) + + +class TestNpyEmptyKeyword(TestCase): + def _test_with_dtype_kw(self, dtype): + def pyfunc(shape): + return np.empty(shape, dtype=dtype) + + shapes = [1, 5, 9] + + cfunc = nrtjit(pyfunc) + for s in shapes: + expected = pyfunc(s) + got = cfunc(s) + self.assertEqual(expected.dtype, got.dtype) + self.assertEqual(expected.shape, got.shape) + + def test_with_dtype_kws(self): + for dtype in [np.int32, np.float32, np.complex64, np.dtype('complex64')]: + self._test_with_dtype_kw(dtype) + + def _test_with_shape_and_dtype_kw(self, dtype): + def pyfunc(shape): + return np.empty(shape=shape, dtype=dtype) + + shapes = [1, 5, 9] + + cfunc = nrtjit(pyfunc) + for s in shapes: + expected = pyfunc(s) + got = cfunc(s) + self.assertEqual(expected.dtype, got.dtype) + self.assertEqual(expected.shape, got.shape) + + def test_with_shape_and_dtype_kws(self): + for dtype in [np.int32, np.float32, np.complex64, np.dtype('complex64')]: + self._test_with_shape_and_dtype_kw(dtype) + + def test_empty_no_args(self): + + def pyfunc(): + return np.empty() + + cfunc = nrtjit(pyfunc) + + # Trigger the compilation + # That will cause a TypingError due to missing shape argument + with self.assertRaises(TypingError): + cfunc() + + +class TestNpArray(MemoryLeakMixin, BaseTest): + + def test_0d(self): + def pyfunc(arg): + return np.array(arg) + + cfunc = nrtjit(pyfunc) + got = cfunc(42) + self.assertPreciseEqual(got, np.array(42, dtype=np.intp)) + got = cfunc(2.5) + self.assertPreciseEqual(got, np.array(2.5)) + + def test_0d_with_dtype(self): + def pyfunc(arg): + return np.array(arg, dtype=np.int16) + + self.check_outputs(pyfunc, [(42,), (3.5,)]) + + def test_1d(self): + def pyfunc(arg): + return np.array(arg) + + cfunc = nrtjit(pyfunc) + # A list + got = cfunc([2, 3, 42]) + self.assertPreciseEqual(got, np.intp([2, 3, 42])) + # A heterogeneous tuple + got = cfunc((1.0, 2.5j, 42)) + self.assertPreciseEqual(got, np.array([1.0, 2.5j, 42])) + # An empty tuple + got = cfunc(()) + self.assertPreciseEqual(got, np.float64(())) + + def test_1d_with_dtype(self): + def pyfunc(arg): + return np.array(arg, dtype=np.float32) + + self.check_outputs(pyfunc, + [([2, 42],), + ([3.5, 1.0],), + ((1, 3.5, 42),), + ((),), + ]) + + def test_1d_with_str_dtype(self): + def pyfunc(arg): + return np.array(arg, dtype='float32') + + self.check_outputs(pyfunc, + [([2, 42],), + ([3.5, 1.0],), + ((1, 3.5, 42),), + ((),), + ]) + + def test_1d_with_non_const_str_dtype(self): + + @njit + def func(arg, dt): + return np.array(arg, dtype=dt) + + with self.assertRaises(TypingError) as raises: + func((5, 3), 'int32') + + excstr = str(raises.exception) + msg = (f"If np.array dtype is a string it must be a " + "string constant.") + self.assertIn(msg, excstr) + + def test_2d(self): + def pyfunc(arg): + return np.array(arg) + + cfunc = nrtjit(pyfunc) + # A list of tuples + got = cfunc([(1, 2), (3, 4)]) + self.assertPreciseEqual(got, np.intp([[1, 2], [3, 4]])) + got = cfunc([(1, 2.5), (3, 4.5)]) + self.assertPreciseEqual(got, np.float64([[1, 2.5], [3, 4.5]])) + # A tuple of lists + got = cfunc(([1, 2], [3, 4])) + self.assertPreciseEqual(got, np.intp([[1, 2], [3, 4]])) + got = cfunc(([1, 2], [3.5, 4.5])) + self.assertPreciseEqual(got, np.float64([[1, 2], [3.5, 4.5]])) + # A tuple of tuples + got = cfunc(((1.5, 2), (3.5, 4.5))) + self.assertPreciseEqual(got, np.float64([[1.5, 2], [3.5, 4.5]])) + got = cfunc(((), ())) + self.assertPreciseEqual(got, np.float64(((), ()))) + + def test_2d_with_dtype(self): + def pyfunc(arg): + return np.array(arg, dtype=np.int32) + + cfunc = nrtjit(pyfunc) + got = cfunc([(1, 2.5), (3, 4.5)]) + self.assertPreciseEqual(got, np.int32([[1, 2], [3, 4]])) + + def test_raises(self): + + def pyfunc(arg): + return np.array(arg) + + cfunc = nrtjit(pyfunc) + + @contextlib.contextmanager + def check_raises(msg): + with self.assertRaises(TypingError) as raises: + yield + self.assertIn(msg, str(raises.exception)) + + with check_raises(('array(float64, 1d, C) not allowed in a ' + 'homogeneous sequence')): + cfunc(np.array([1.])) + + with check_raises(('type Tuple(int64, reflected list(int64)) ' + 'does not have a regular shape')): + cfunc((np.int64(1), [np.int64(2)])) + + with check_raises( + "cannot convert Tuple(int64, Record(a[type=int32;offset=0]," + "b[type=float32;offset=4];8;False)) to a homogeneous type", + ): + st = np.dtype([('a', 'i4'), ('b', 'f4')]) + val = np.zeros(1, dtype=st)[0] + cfunc(((1, 2), (np.int64(1), val))) + + def test_bad_array(self): + @njit + def func(obj): + return np.array(obj) + + msg = '.*The argument "object" must be array-like.*' + with self.assertRaisesRegex(TypingError, msg) as raises: + func(None) + + def test_bad_dtype(self): + @njit + def func(obj, dt): + return np.array(obj, dt) + + msg = '.*The argument "dtype" must be a data-type if it is provided.*' + with self.assertRaisesRegex(TypingError, msg) as raises: + func(5, 4) + + +class TestNpConcatenate(MemoryLeakMixin, TestCase): + """ + Tests for np.concatenate(). + """ + + def _3d_arrays(self): + a = np.arange(24).reshape((4, 3, 2)) + b = a + 10 + c = (b + 10).copy(order='F') + d = (c + 10)[::-1] + e = (d + 10)[...,::-1] + return a, b, c, d, e + + @contextlib.contextmanager + def assert_invalid_sizes_over_dim(self, axis): + with self.assertRaises(ValueError) as raises: + yield + self.assertIn("input sizes over dimension %d do not match" % axis, + str(raises.exception)) + + def test_3d(self): + pyfunc = np_concatenate2 + cfunc = nrtjit(pyfunc) + + def check(a, b, c, axis): + for ax in (axis, -3 + axis): + expected = pyfunc(a, b, c, axis=ax) + got = cfunc(a, b, c, axis=ax) + self.assertPreciseEqual(got, expected) + + def check_all_axes(a, b, c): + for axis in range(3): + check(a, b, c, axis) + + a, b, c, d, e = self._3d_arrays() + + # Inputs with equal sizes + # C, C, C + check_all_axes(a, b, b) + # C, C, F + check_all_axes(a, b, c) + # F, F, F + check_all_axes(a.T, b.T, a.T) + # F, F, C + check_all_axes(a.T, b.T, c.T) + # F, F, A + check_all_axes(a.T, b.T, d.T) + # A, A, A + # (note Numpy may select the layout differently for other inputs) + check_all_axes(d.T, e.T, d.T) + + # Inputs with compatible sizes + check(a[1:], b, c[::-1], axis=0) + check(a, b[:,1:], c, axis=1) + check(a, b, c[:,:,1:], axis=2) + + # Different but compatible dtypes + check_all_axes(a, b.astype(np.float64), b) + + # Exceptions leak references + self.disable_leak_check() + + # Incompatible sizes + for axis in (1, 2, -2, -1): + with self.assert_invalid_sizes_over_dim(0): + cfunc(a[1:], b, b, axis) + for axis in (0, 2, -3, -1): + with self.assert_invalid_sizes_over_dim(1): + cfunc(a, b[:,1:], b, axis) + + def test_3d_no_axis(self): + pyfunc = np_concatenate1 + cfunc = nrtjit(pyfunc) + + def check(a, b, c): + expected = pyfunc(a, b, c) + got = cfunc(a, b, c) + self.assertPreciseEqual(got, expected) + + a, b, c, d, e = self._3d_arrays() + + # Inputs with equal sizes + # C, C, C + check(a, b, b) + # C, C, F + check(a, b, c) + # F, F, F + check(a.T, b.T, a.T) + # F, F, C + check(a.T, b.T, c.T) + # F, F, A + check(a.T, b.T, d.T) + # A, A, A + # (note Numpy may select the layout differently for other inputs) + check(d.T, e.T, d.T) + + # Inputs with compatible sizes + check(a[1:], b, c[::-1]) + + # Exceptions leak references + self.disable_leak_check() + + # Incompatible sizes + with self.assert_invalid_sizes_over_dim(1): + cfunc(a, b[:,1:], b) + + def test_typing_errors(self): + pyfunc = np_concatenate1 + cfunc = nrtjit(pyfunc) + + a = np.arange(15) + b = a.reshape((3, 5)) + c = a.astype(np.dtype([('x', np.int8)])) + d = np.array(42) + + # Different dimensionalities + with self.assertTypingError() as raises: + cfunc(a, b, b) + self.assertIn("all the input arrays must have same number of dimensions", + str(raises.exception)) + + # Incompatible dtypes + with self.assertTypingError() as raises: + cfunc(a, c, c) + self.assertIn("input arrays must have compatible dtypes", + str(raises.exception)) + + # 0-d arrays + with self.assertTypingError() as raises: + cfunc(d, d, d) + self.assertIn("zero-dimensional arrays cannot be concatenated", + str(raises.exception)) + + # non-tuple input + with self.assertTypingError() as raises: + cfunc(c, 1, c) + self.assertIn('expecting a non-empty tuple of arrays', str(raises.exception)) + + +@unittest.skipUnless(hasattr(np, "stack"), "this Numpy doesn't have np.stack()") +class TestNpStack(MemoryLeakMixin, TestCase): + """ + Tests for np.stack(). + """ + + def _3d_arrays(self): + a = np.arange(24).reshape((4, 3, 2)) + b = a + 10 + c = (b + 10).copy(order='F') + d = (c + 10)[::-1] + e = (d + 10)[...,::-1] + return a, b, c, d, e + + @contextlib.contextmanager + def assert_invalid_sizes(self): + with self.assertRaises(ValueError) as raises: + yield + self.assertIn("all input arrays must have the same shape", + str(raises.exception)) + + def check_stack(self, pyfunc, cfunc, args): + expected = pyfunc(*args) + got = cfunc(*args) + # Numba doesn't choose the same layout as Numpy. + # We would like to check the result is contiguous, but we can't + # rely on the "flags" attribute when there are 1-sized + # dimensions. + self.assertEqual(got.shape, expected.shape) + self.assertPreciseEqual(got.flatten(), expected.flatten()) + + def check_3d(self, pyfunc, cfunc, generate_starargs): + def check(a, b, c, args): + self.check_stack(pyfunc, cfunc, (a, b, c) + args) + + def check_all_axes(a, b, c): + for args in generate_starargs(): + check(a, b, c, args) + + a, b, c, d, e = self._3d_arrays() + + # C, C, C + check_all_axes(a, b, b) + # C, C, F + check_all_axes(a, b, c) + # F, F, F + check_all_axes(a.T, b.T, a.T) + # F, F, C + check_all_axes(a.T, b.T, c.T) + # F, F, A + check_all_axes(a.T, b.T, d.T) + # A, A, A + check_all_axes(d.T, e.T, d.T) + + # Different but compatible dtypes + check_all_axes(a, b.astype(np.float64), b) + + def check_runtime_errors(self, cfunc, generate_starargs): + # Exceptions leak references + self.assert_no_memory_leak() + self.disable_leak_check() + + # Inputs have different shapes + a, b, c, d, e = self._3d_arrays() + with self.assert_invalid_sizes(): + args = next(generate_starargs()) + cfunc(a[:-1], b, c, *args) + + def test_3d(self): + """ + stack(3d arrays, axis) + """ + pyfunc = np_stack2 + cfunc = nrtjit(pyfunc) + + def generate_starargs(): + for axis in range(3): + yield (axis,) + yield (-3 + axis,) + + self.check_3d(pyfunc, cfunc, generate_starargs) + self.check_runtime_errors(cfunc, generate_starargs) + + def test_3d_no_axis(self): + """ + stack(3d arrays) + """ + pyfunc = np_stack1 + cfunc = nrtjit(pyfunc) + + def generate_starargs(): + yield() + + self.check_3d(pyfunc, cfunc, generate_starargs) + self.check_runtime_errors(cfunc, generate_starargs) + + def test_0d(self): + """ + stack(0d arrays) + """ + pyfunc = np_stack1 + cfunc = nrtjit(pyfunc) + + a = np.array(42) + b = np.array(-5j) + c = np.array(True) + + self.check_stack(pyfunc, cfunc, (a, b, c)) + + def check_xxstack(self, pyfunc, cfunc): + """ + 3d and 0d tests for hstack(), vstack(), dstack(). + """ + def generate_starargs(): + yield() + + self.check_3d(pyfunc, cfunc, generate_starargs) + # 0d + a = np.array(42) + b = np.array(-5j) + c = np.array(True) + self.check_stack(pyfunc, cfunc, (a, b, a)) + + def test_hstack(self): + pyfunc = np_hstack + cfunc = nrtjit(pyfunc) + + self.check_xxstack(pyfunc, cfunc) + # 1d + a = np.arange(5) + b = np.arange(6) + 10 + self.check_stack(pyfunc, cfunc, (a, b, b)) + # 2d + a = np.arange(6).reshape((2, 3)) + b = np.arange(8).reshape((2, 4)) + 100 + self.check_stack(pyfunc, cfunc, (a, b, a)) + + def test_vstack(self): + # Since np.row_stack is an alias for np.vstack, it does not need a + # separate Numba implementation. For every test for np.vstack, the same + # test for np.row_stack has been added. + functions = [np_vstack, np_row_stack] + for pyfunc in functions: + cfunc = nrtjit(pyfunc) + + self.check_xxstack(pyfunc, cfunc) + # 1d + a = np.arange(5) + b = a + 10 + self.check_stack(pyfunc, cfunc, (a, b, b)) + # 2d + a = np.arange(6).reshape((3, 2)) + b = np.arange(8).reshape((4, 2)) + 100 + self.check_stack(pyfunc, cfunc, (a, b, b)) + + def test_dstack(self): + pyfunc = np_dstack + cfunc = nrtjit(pyfunc) + + self.check_xxstack(pyfunc, cfunc) + # 1d + a = np.arange(5) + b = a + 10 + self.check_stack(pyfunc, cfunc, (a, b, b)) + # 2d + a = np.arange(12).reshape((3, 4)) + b = a + 100 + self.check_stack(pyfunc, cfunc, (a, b, b)) + + def test_column_stack(self): + pyfunc = np_column_stack + cfunc = nrtjit(pyfunc) + + a = np.arange(4) + b = a + 10 + c = np.arange(12).reshape((4, 3)) + self.check_stack(pyfunc, cfunc, (a, b, c)) + + # Exceptions leak references + self.assert_no_memory_leak() + self.disable_leak_check() + + # Invalid dims + a = np.array(42) + with self.assertTypingError(): + cfunc((a, a, a)) + a = a.reshape((1, 1, 1)) + with self.assertTypingError(): + cfunc((a, a, a)) + + def test_bad_arrays(self): + for pyfunc in (np_stack1, np_hstack, np_vstack, np_dstack, np_column_stack): + cfunc = nrtjit(pyfunc) + c = np.arange(12).reshape((4, 3)) + + # non-tuple input + with self.assertTypingError() as raises: + cfunc(c, 1, c) + self.assertIn('expecting a non-empty tuple of arrays', str(raises.exception)) + + +def benchmark_refct_speed(): + def pyfunc(x, y, t): + """Swap array x and y for t number of times + """ + for i in range(t): + x, y = y, x + return x, y + + cfunc = nrtjit(pyfunc) + + x = np.random.random(100) + y = np.random.random(100) + t = 10000 + + def bench_pyfunc(): + pyfunc(x, y, t) + + def bench_cfunc(): + cfunc(x, y, t) + + python_time = utils.benchmark(bench_pyfunc) + numba_time = utils.benchmark(bench_cfunc) + print(python_time) + print(numba_time) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dyn_func.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dyn_func.py new file mode 100644 index 0000000000000000000000000000000000000000..df3b7aac1c1401a4d6ca9c205b2e002167003c08 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_dyn_func.py @@ -0,0 +1,43 @@ +import numpy as np + +import numba +from numba.tests.support import TestCase + + +class Issue455(object): + """ + Test code from issue 455. + """ + + def __init__(self): + self.f = [] + + def create_f(self): + code = """ + def f(x): + n = x.shape[0] + for i in range(n): + x[i] = 1. + """ + d = {} + exec(code.strip(), d) + self.f.append(numba.jit("void(f8[:])", nopython=True)(d['f'])) + + def call_f(self): + a = np.zeros(10) + for f in self.f: + f(a) + return a + + +class TestDynFunc(TestCase): + + def test_issue_455(self): + inst = Issue455() + inst.create_f() + a = inst.call_f() + self.assertPreciseEqual(a, np.ones_like(a)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_entrypoints.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_entrypoints.py new file mode 100644 index 0000000000000000000000000000000000000000..7391972af8954108e48696efd69459d7fc665264 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_entrypoints.py @@ -0,0 +1,227 @@ +import sys +from unittest import mock + +import types +import warnings +import unittest +import os +import subprocess +import threading + +from numba import njit +from numba.tests.support import TestCase +from numba.testing.main import _TIMEOUT as _RUNNER_TIMEOUT + +from importlib import metadata as importlib_metadata + +_TEST_TIMEOUT = _RUNNER_TIMEOUT - 60. + + +class _DummyClass(object): + def __init__(self, value): + self.value = value + + def __repr__(self): + return '_DummyClass(%f, %f)' % self.value + + +class TestEntrypoints(TestCase): + """ + Test registration of init() functions from Numba extensions + """ + + def test_init_entrypoint(self): + # loosely based on Pandas test from: + # https://github.com/pandas-dev/pandas/pull/27488 + + mod = mock.Mock(__name__='_test_numba_extension') + + try: + # will remove this module at the end of the test + sys.modules[mod.__name__] = mod + + my_entrypoint = importlib_metadata.EntryPoint( + 'init', '_test_numba_extension:init_func', 'numba_extensions', + ) + + with mock.patch.object( + importlib_metadata, + 'entry_points', + return_value={'numba_extensions': (my_entrypoint,)}, + ): + + from numba.core import entrypoints + + # Allow reinitialization + entrypoints._already_initialized = False + + entrypoints.init_all() + + # was our init function called? + mod.init_func.assert_called_once() + + # ensure we do not initialize twice + entrypoints.init_all() + mod.init_func.assert_called_once() + finally: + # remove fake module + if mod.__name__ in sys.modules: + del sys.modules[mod.__name__] + + def test_entrypoint_tolerance(self): + # loosely based on Pandas test from: + # https://github.com/pandas-dev/pandas/pull/27488 + + mod = mock.Mock(__name__='_test_numba_bad_extension') + mod.configure_mock(**{'init_func.side_effect': ValueError('broken')}) + + try: + # will remove this module at the end of the test + sys.modules[mod.__name__] = mod + + my_entrypoint = importlib_metadata.EntryPoint( + 'init', + '_test_numba_bad_extension:init_func', + 'numba_extensions', + ) + + with mock.patch.object( + importlib_metadata, + 'entry_points', + return_value={'numba_extensions': (my_entrypoint,)}, + ): + + from numba.core import entrypoints + # Allow reinitialization + entrypoints._already_initialized = False + + with warnings.catch_warnings(record=True) as w: + entrypoints.init_all() + + bad_str = "Numba extension module '_test_numba_bad_extension'" + for x in w: + if bad_str in str(x): + break + else: + raise ValueError("Expected warning message not found") + + # was our init function called? + mod.init_func.assert_called_once() + + finally: + # remove fake module + if mod.__name__ in sys.modules: + del sys.modules[mod.__name__] + + _EP_MAGIC_TOKEN = 'RUN_ENTRY' + + @unittest.skipIf(os.environ.get('_EP_MAGIC_TOKEN', None) != _EP_MAGIC_TOKEN, + "needs token") + def test_entrypoint_handles_type_extensions(self): + # loosely based on Pandas test from: + # https://github.com/pandas-dev/pandas/pull/27488 + import numba + + def init_function(): + # This init function would normally just call a module init via + # import or similar, for the sake of testing, inline registration + # of how to handle the global "_DummyClass". + class DummyType(numba.types.Type): + def __init__(self): + super(DummyType, self).__init__(name='DummyType') + + @numba.extending.typeof_impl.register(_DummyClass) + def typer_DummyClass(val, c): + return DummyType() + + @numba.extending.register_model(DummyType) + class DummyModel(numba.extending.models.StructModel): + def __init__(self, dmm, fe_type): + members = [ + ('value', numba.types.float64), ] + super(DummyModel, self).__init__(dmm, fe_type, members) + + @numba.extending.unbox(DummyType) + def unbox_dummy(typ, obj, c): + value_obj = c.pyapi.object_getattr_string(obj, "value") + dummy_struct_proxy = numba.core.cgutils.create_struct_proxy(typ) + dummy_struct = dummy_struct_proxy(c.context, c.builder) + dummy_struct.value = c.pyapi.float_as_double(value_obj) + c.pyapi.decref(value_obj) + err_flag = c.pyapi.err_occurred() + is_error = numba.core.cgutils.is_not_null(c.builder, err_flag) + return numba.extending.NativeValue(dummy_struct._getvalue(), + is_error=is_error) + + @numba.extending.box(DummyType) + def box_dummy(typ, val, c): + dummy_struct_proxy = numba.core.cgutils.create_struct_proxy(typ) + dummy_struct = dummy_struct_proxy(c.context, c.builder) + value_obj = c.pyapi.float_from_double(dummy_struct.value) + serialized_clazz = c.pyapi.serialize_object(_DummyClass) + class_obj = c.pyapi.unserialize(serialized_clazz) + res = c.pyapi.call_function_objargs(class_obj, (value_obj,)) + c.pyapi.decref(value_obj) + c.pyapi.decref(class_obj) + return res + + mod = types.ModuleType("_test_numba_init_sequence") + mod.init_func = init_function + + try: + # will remove this module at the end of the test + sys.modules[mod.__name__] = mod + + my_entrypoint = importlib_metadata.EntryPoint( + 'init', + '_test_numba_init_sequence:init_func', + 'numba_extensions', + ) + + with mock.patch.object( + importlib_metadata, + 'entry_points', + return_value={'numba_extensions': (my_entrypoint,)}, + ): + @njit + def foo(x): + return x + + ival = _DummyClass(10) + foo(ival) + finally: + # remove fake module + if mod.__name__ in sys.modules: + del sys.modules[mod.__name__] + + def run_cmd(self, cmdline, env): + popen = subprocess.Popen(cmdline, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=env) + # finish in _TEST_TIMEOUT seconds or kill it + timeout = threading.Timer(_TEST_TIMEOUT, popen.kill) + try: + timeout.start() + out, err = popen.communicate() + if popen.returncode != 0: + raise AssertionError( + "process failed with code %s: stderr follows\n%s\n" % + (popen.returncode, err.decode())) + return out.decode(), err.decode() + finally: + timeout.cancel() + return None, None + + def test_entrypoint_extension_sequence(self): + env_copy = os.environ.copy() + env_copy['_EP_MAGIC_TOKEN'] = str(self._EP_MAGIC_TOKEN) + themod = self.__module__ + thecls = type(self).__name__ + methname = 'test_entrypoint_handles_type_extensions' + injected_method = '%s.%s.%s' % (themod, thecls, methname) + cmdline = [sys.executable, "-m", "numba.runtests", injected_method] + out, err = self.run_cmd(cmdline, env_copy) + _DEBUG = False + if _DEBUG: + print(out, err) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_enums.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_enums.py new file mode 100644 index 0000000000000000000000000000000000000000..68734dcff595fd0126138838e4f78f33720033b2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_enums.py @@ -0,0 +1,181 @@ +""" +Tests for enum support. +""" + + +import numpy as np +import unittest +from numba import jit, vectorize, int8, int16, int32 + +from numba.tests.support import TestCase +from numba.tests.enum_usecases import (Color, Shape, Shake, + Planet, RequestError, + IntEnumWithNegatives) + + +def compare_usecase(a, b): + return a == b, a != b, a is b, a is not b + + +def getattr_usecase(a): + # Lookup of a enum member on its class + return a is Color.red + + +def getitem_usecase(a): + """Lookup enum member by string name""" + return a is Color['red'] + + +def identity_usecase(a, b, c): + return (a is Shake.mint, + b is Shape.circle, + c is RequestError.internal_error, + ) + + +def make_constant_usecase(const): + def constant_usecase(a): + return a is const + return constant_usecase + + +def return_usecase(a, b, pred): + return a if pred else b + + +def int_coerce_usecase(x): + # Implicit coercion of intenums to ints + if x > RequestError.internal_error: + return x - RequestError.not_found + else: + return x + Shape.circle + +def int_cast_usecase(x): + # Explicit coercion of intenums to ints + if x > int16(RequestError.internal_error): + return x - int32(RequestError.not_found) + else: + return x + int16(Shape.circle) + + +def vectorize_usecase(x): + if x != RequestError.not_found: + return RequestError['internal_error'] + else: + return RequestError.dummy + + +class BaseEnumTest(object): + + def test_compare(self): + pyfunc = compare_usecase + cfunc = jit(nopython=True)(pyfunc) + + for args in self.pairs: + self.assertPreciseEqual(pyfunc(*args), cfunc(*args)) + + def test_return(self): + """ + Passing and returning enum members. + """ + pyfunc = return_usecase + cfunc = jit(nopython=True)(pyfunc) + + for pair in self.pairs: + for pred in (True, False): + args = pair + (pred,) + self.assertIs(pyfunc(*args), cfunc(*args)) + + def check_constant_usecase(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + for arg in self.values: + self.assertPreciseEqual(pyfunc(arg), cfunc(arg)) + + def test_constant(self): + self.check_constant_usecase(getattr_usecase) + self.check_constant_usecase(getitem_usecase) + self.check_constant_usecase(make_constant_usecase(self.values[0])) + + +class TestEnum(BaseEnumTest, TestCase): + """ + Tests for Enum classes and members. + """ + values = [Color.red, Color.green] + + pairs = [ + (Color.red, Color.red), + (Color.red, Color.green), + (Shake.mint, Shake.vanilla), + (Planet.VENUS, Planet.MARS), + (Planet.EARTH, Planet.EARTH), + ] + + def test_identity(self): + """ + Enum with equal values should not compare identical + """ + pyfunc = identity_usecase + cfunc = jit(nopython=True)(pyfunc) + args = (Color.blue, Color.green, Shape.square) + self.assertPreciseEqual(pyfunc(*args), cfunc(*args)) + + +class TestIntEnum(BaseEnumTest, TestCase): + """ + Tests for IntEnum classes and members. + """ + values = [Shape.circle, Shape.square] + + pairs = [ + (Shape.circle, Shape.circle), + (Shape.circle, Shape.square), + (RequestError.not_found, RequestError.not_found), + (RequestError.internal_error, RequestError.not_found), + ] + + def test_int_coerce(self): + pyfunc = int_coerce_usecase + cfunc = jit(nopython=True)(pyfunc) + + for arg in [300, 450, 550]: + self.assertPreciseEqual(pyfunc(arg), cfunc(arg)) + + def test_int_cast(self): + pyfunc = int_cast_usecase + cfunc = jit(nopython=True)(pyfunc) + + for arg in [300, 450, 550]: + self.assertPreciseEqual(pyfunc(arg), cfunc(arg)) + + def test_vectorize(self): + cfunc = vectorize(nopython=True)(vectorize_usecase) + arg = np.array([2, 404, 500, 404]) + sol = np.array([vectorize_usecase(i) for i in arg], dtype=arg.dtype) + self.assertPreciseEqual(sol, cfunc(arg)) + + def test_hash(self): + def pyfun(x): + return hash(x) + cfunc = jit(nopython=True)(pyfun) + for member in IntEnumWithNegatives: + self.assertPreciseEqual(pyfun(member), cfunc(member)) + + def test_int_shape_cast(self): + def pyfun_empty(x): + return np.empty((x, x), dtype='int64').fill(-1) + def pyfun_zeros(x): + return np.zeros((x, x), dtype='int64') + def pyfun_ones(x): + return np.ones((x, x), dtype='int64') + for pyfun in [pyfun_empty, pyfun_zeros, pyfun_ones]: + cfunc = jit(nopython=True)(pyfun) + for member in IntEnumWithNegatives: + if member >= 0: + self.assertPreciseEqual(pyfun(member), cfunc(member)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_errorhandling.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_errorhandling.py new file mode 100644 index 0000000000000000000000000000000000000000..3d8f0091c571793c0281ef9ff07c1ac448038f0d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_errorhandling.py @@ -0,0 +1,469 @@ +""" +Unspecified error handling tests +""" + +import numpy as np +import os +import warnings + +from numba import jit, njit, types +from numba.core import errors +from numba.experimental import structref +from numba.extending import (overload, intrinsic, overload_method, + overload_attribute) +from numba.core.compiler import CompilerBase +from numba.core.untyped_passes import (TranslateByteCode, FixupArgs, + IRProcessing,) +from numba.core.typed_passes import (NopythonTypeInference, DeadCodeElimination, + NoPythonBackend, NativeLowering) +from numba.core.compiler_machinery import PassManager +from numba.core.types.functions import _err_reasons as error_reasons + +from numba.tests.support import (skip_parfors_unsupported, override_config, + SerialMixin, skip_unless_cffi, + skip_unless_scipy, TestCase) +import unittest + + +class TestErrorHandlingBeforeLowering(unittest.TestCase): + + def test_unsupported_make_function_return_inner_func(self): + def func(x): + """ return the closure """ + z = x + 1 + + def inner(x): + return x + z + return inner + + for pipeline in jit, njit: + with self.assertRaises(errors.TypingError) as raises: + pipeline(func)(1) + + expected = "Cannot capture the non-constant value" + self.assertIn(expected, str(raises.exception)) + + +class TestUnsupportedReporting(unittest.TestCase): + + def test_unsupported_numpy_function(self): + # np.asanyarray(list) currently unsupported + @njit + def func(): + np.asanyarray([1,2,3]) + + with self.assertRaises(errors.TypingError) as raises: + func() + + expected = "Use of unsupported NumPy function 'numpy.asanyarray'" + self.assertIn(expected, str(raises.exception)) + + +class TestMiscErrorHandling(unittest.TestCase): + + def test_use_of_exception_for_flow_control(self): + # constant inference uses exceptions with no Loc specified to determine + # flow control, this asserts that the construction of the lowering + # error context handler works in the case of an exception with no Loc + # specified. See issue #3135. + @njit + def fn(x): + return 10**x + + a = np.array([1.0],dtype=np.float64) + fn(a) # should not raise + + def test_commented_func_definition_is_not_a_definition(self): + # See issue #4056, the commented def should not be found as the + # definition for reporting purposes when creating the synthetic + # traceback because it is commented! Use of def in docstring would also + # cause this issue hence is tested. + + def foo_commented(): + #def commented_definition() + raise Exception('test_string') + + def foo_docstring(): + """ def docstring containing def might match function definition!""" + raise Exception('test_string') + + for func in (foo_commented, foo_docstring): + with self.assertRaises(Exception) as raises: + func() + + self.assertIn("test_string", str(raises.exception)) + + def test_use_of_ir_unknown_loc(self): + # for context see # 3390 + class TestPipeline(CompilerBase): + def define_pipelines(self): + name = 'bad_DCE_pipeline' + pm = PassManager(name) + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(FixupArgs, "fix up args") + pm.add_pass(IRProcessing, "processing IR") + # remove dead before type inference so that the Arg node is + # removed and the location of the arg cannot be found + pm.add_pass(DeadCodeElimination, "DCE") + # typing + pm.add_pass(NopythonTypeInference, "nopython frontend") + pm.add_pass(NativeLowering, "native lowering") + pm.add_pass(NoPythonBackend, "nopython mode backend") + pm.finalize() + return [pm] + + @njit(pipeline_class=TestPipeline) + def f(a): + return 0 + + with self.assertRaises(errors.TypingError) as raises: + f(iter([1,2])) # use a type that Numba doesn't recognize + + expected = 'File "unknown location", line 0:' + self.assertIn(expected, str(raises.exception)) + + def check_write_to_globals(self, func): + with self.assertRaises(errors.TypingError) as raises: + func() + + expected = ["The use of a", "in globals, is not supported as globals"] + for ex in expected: + self.assertIn(ex, str(raises.exception)) + + def test_handling_of_write_to_reflected_global(self): + from numba.tests.errorhandling_usecases import global_reflected_write + self.check_write_to_globals(njit(global_reflected_write)) + + def test_handling_of_write_to_typed_dict_global(self): + from numba.tests.errorhandling_usecases import global_dict_write + self.check_write_to_globals(njit(global_dict_write)) + + @skip_parfors_unsupported + def test_handling_forgotten_numba_internal_import(self): + @njit(parallel=True) + def foo(): + for i in prange(10): # noqa: F821 prange is not imported + pass + + with self.assertRaises(errors.TypingError) as raises: + foo() + + expected = ("'prange' looks like a Numba internal function, " + "has it been imported") + self.assertIn(expected, str(raises.exception)) + + def test_handling_unsupported_generator_expression(self): + def foo(): + (x for x in range(10)) + + expected = "The use of yield in a closure is unsupported." + + for dec in jit(forceobj=True), njit: + with self.assertRaises(errors.UnsupportedError) as raises: + dec(foo)() + self.assertIn(expected, str(raises.exception)) + + def test_handling_undefined_variable(self): + @njit + def foo(): + return a # noqa: F821 + + expected = "NameError: name 'a' is not defined" + + with self.assertRaises(errors.TypingError) as raises: + foo() + self.assertIn(expected, str(raises.exception)) + + +class TestErrorMessages(unittest.TestCase): + + def test_specific_error(self): + + given_reason = "specific_reason" + + def foo(): + pass + + @overload(foo) + def ol_foo(): + raise errors.NumbaValueError(given_reason) + + @njit + def call_foo(): + foo() + + with self.assertRaises(errors.TypingError) as raises: + call_foo() + + excstr = str(raises.exception) + self.assertIn(error_reasons['specific_error'].splitlines()[0], excstr) + self.assertIn(given_reason, excstr) + + def test_no_match_error(self): + + def foo(): + pass + + @overload(foo) + def ol_foo(): + return None # emulate no impl available for type + + @njit + def call_foo(): + foo() + + with self.assertRaises(errors.TypingError) as raises: + call_foo() + + excstr = str(raises.exception) + self.assertIn("No match", excstr) + + @skip_unless_scipy + def test_error_function_source_is_correct(self): + """ Checks that the reported source location for an overload is the + overload implementation source, not the actual function source from the + target library.""" + + @njit + def foo(): + np.linalg.svd("chars") + + with self.assertRaises(errors.TypingError) as raises: + foo() + + excstr = str(raises.exception) + self.assertIn(error_reasons['specific_error'].splitlines()[0], excstr) + expected_file = os.path.join("numba", "np", "linalg.py") + expected = f"Overload in function 'svd_impl': File: {expected_file}:" + self.assertIn(expected.format(expected_file), excstr) + + def test_concrete_template_source(self): + # hits ConcreteTemplate + @njit + def foo(): + return 'a' + 1 + + with self.assertRaises(errors.TypingError) as raises: + foo() + + excstr = str(raises.exception) + + self.assertIn("Overload of function 'add'", excstr) + # there'll be numerous matched templates that don't work but as they + # are mostly "overload"s they'll just appear as "No match". + self.assertIn("No match.", excstr) + + def test_abstract_template_source(self): + # hits AbstractTemplate + @njit + def foo(): + return len(1) + + with self.assertRaises(errors.TypingError) as raises: + foo() + + excstr = str(raises.exception) + self.assertIn("Overload of function 'len'", excstr) + + def test_callable_template_source(self): + # hits CallableTemplate + @njit + def foo(): + return np.angle(None) + + with self.assertRaises(errors.TypingError) as raises: + foo() + + excstr = str(raises.exception) + self.assertIn("No implementation of function Function(", excstr) + expected_file = os.path.join("numba", "tests", + "test_errorhandling.py") + expected_ol = f"Overload of function 'bar': File: {expected_file}:" + self.assertIn(expected_ol.format(expected_file), excstr) + self.assertIn("No match.", excstr) + + def test_intrinsic_template_source(self): + # hits _IntrinsicTemplate + given_reason1 = "x must be literal" + given_reason2 = "array.ndim must be 1" + + @intrinsic + def myintrin(typingctx, x, arr): + if not isinstance(x, types.IntegerLiteral): + raise errors.RequireLiteralValue(given_reason1) + + if arr.ndim != 1: + raise errors.NumbaValueError(given_reason2) + + sig = types.intp(x, arr) + + def codegen(context, builder, signature, args): + pass + return sig, codegen + + @njit + def call_intrin(): + arr = np.zeros((2, 2)) + myintrin(1, arr) + + with self.assertRaises(errors.TypingError) as raises: + call_intrin() + + excstr = str(raises.exception) + self.assertIn(error_reasons['specific_error'].splitlines()[0], excstr) + self.assertIn(given_reason1, excstr) + self.assertIn(given_reason2, excstr) + self.assertIn("Intrinsic in function", excstr) + + def test_overloadmethod_template_source(self): + # doesn't hit _OverloadMethodTemplate for source as it's a nested + # exception + @overload_method(types.UnicodeType, 'isnonsense') + def ol_unicode_isnonsense(self): + pass + + @njit + def foo(): + "abc".isnonsense() + + with self.assertRaises(errors.TypingError) as raises: + foo() + + excstr = str(raises.exception) + self.assertIn("Overload of function 'ol_unicode_isnonsense'", excstr) + + def test_overloadattribute_template_source(self): + # doesn't hit _OverloadMethodTemplate for source as it's a nested + # exception + @overload_attribute(types.UnicodeType, 'isnonsense') + def ol_unicode_isnonsense(self): + pass + + @njit + def foo(): + "abc".isnonsense + + with self.assertRaises(errors.TypingError) as raises: + foo() + + excstr = str(raises.exception) + self.assertIn("Overload of function 'ol_unicode_isnonsense'", excstr) + + def test_external_function_pointer_template_source(self): + from numba.tests.ctypes_usecases import c_cos + + @njit + def foo(): + c_cos('a') + + with self.assertRaises(errors.TypingError) as raises: + foo() + + excstr = str(raises.exception) + self.assertIn("Type Restricted Function in function 'unknown'", excstr) + + @skip_unless_cffi + def test_cffi_function_pointer_template_source(self): + from numba.tests import cffi_usecases as mod + mod.init() + func = mod.cffi_cos + + @njit + def foo(): + func('a') + + with self.assertRaises(errors.TypingError) as raises: + foo() + + excstr = str(raises.exception) + self.assertIn("Type Restricted Function in function 'unknown'", excstr) + + def test_missing_source(self): + + @structref.register + class ParticleType(types.StructRef): + pass + + class Particle(structref.StructRefProxy): + def __new__(cls, pos, mass): + return structref.StructRefProxy.__new__(cls, pos) + # didn't provide the required mass argument ----^ + + structref.define_proxy(Particle, ParticleType, ["pos", "mass"]) + + with self.assertRaises(errors.TypingError) as raises: + Particle(pos=1, mass=2) + + excstr = str(raises.exception) + self.assertIn("missing a required argument: 'mass'", excstr) + + +class TestDeveloperSpecificErrorMessages(SerialMixin, unittest.TestCase): + + def test_bound_function_error_string(self): + # See PR #5952 + def foo(x): + x.max(-1) + + with override_config('DEVELOPER_MODE', 1): + with self.assertRaises(errors.TypingError) as raises: + njit("void(int64[:,:])")(foo) + + excstr = str(raises.exception) + self.assertIn("too many positional arguments", excstr) + + +class TestCapturedErrorHandling(SerialMixin, TestCase): + """Checks that the way errors are captured. + """ + + def test_error_in_overload(self): + + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + x.some_invalid_attr # doesn't exist! + + def impl(x): + pass + return impl + + with warnings.catch_warnings(): + # Suppress error going into stdout + warnings.simplefilter("ignore", + errors.NumbaPendingDeprecationWarning) + + with self.assertRaises(AttributeError) as raises: + @njit('void(int64)') + def foo(x): + bar(x) + expected = "object has no attribute 'some_invalid_attr'" + self.assertIn(expected, str(raises.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_errormodels.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_errormodels.py new file mode 100644 index 0000000000000000000000000000000000000000..9635da294e0c52eca4ae55284160e01ea0ee5b6d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_errormodels.py @@ -0,0 +1,28 @@ +""" +Test setting/overriding error models +""" + +from numba import jit +import unittest + + +class TestErrorModel(unittest.TestCase): + + def test_div_by_zero_python(self): + @jit # python model is the default + def model_python(val): + return 1 / val + + with self.assertRaises(ZeroDivisionError): + model_python(0) + + def test_div_by_zero_numpy(self): + @jit(error_model='numpy') + def model_numpy(val): + return 1 / val + + self.assertEqual(model_numpy(0), float('inf')) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_event.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_event.py new file mode 100644 index 0000000000000000000000000000000000000000..dce8b01226fe7f0fb4e48a442e91bbfc0098a0a4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_event.py @@ -0,0 +1,218 @@ +import unittest +import string + +import numpy as np + +from numba import njit, jit, literal_unroll +from numba.core import event as ev +from numba.tests.support import TestCase, override_config +from numba.core.utils import _lazy_pformat + + +class TestEvent(TestCase): + + def setUp(self): + # Trigger compilation to ensure all listeners are initialized + njit(lambda: None)() + self.__registered_listeners = len(ev._registered) + + def tearDown(self): + # Check there is no lingering listeners + self.assertEqual(len(ev._registered), self.__registered_listeners) + + def test_recording_listener(self): + @njit + def foo(x): + return x + x + + with ev.install_recorder("numba:compile") as rec: + foo(1) + + self.assertIsInstance(rec, ev.RecordingListener) + # Check there must be at least two events. + # Because there must be a START and END for the compilation of foo() + self.assertGreaterEqual(len(rec.buffer), 2) + + def test_compiler_lock_event(self): + @njit + def foo(x): + return x + x + + foo(1) + md = foo.get_metadata(foo.signatures[0]) + lock_duration = md['timers']['compiler_lock'] + self.assertIsInstance(lock_duration, float) + self.assertGreater(lock_duration, 0) + + def test_llvm_lock_event(self): + @njit + def foo(x): + return x + x + + foo(1) + md = foo.get_metadata(foo.signatures[0]) + lock_duration = md['timers']['llvm_lock'] + self.assertIsInstance(lock_duration, float) + self.assertGreater(lock_duration, 0) + + def test_run_pass_event(self): + @njit + def foo(x): + return x + x + + with ev.install_recorder("numba:run_pass") as recorder: + foo(2) + + self.assertGreater(len(recorder.buffer), 0) + for _, event in recorder.buffer: + # Check that all fields are there + data = event.data + self.assertIsInstance(data['name'], str) + self.assertIsInstance(data['qualname'], str) + self.assertIsInstance(data['module'], str) + self.assertIsInstance(data['flags'], _lazy_pformat) + self.assertIsInstance(data['args'], str) + self.assertIsInstance(data['return_type'], str) + + def test_install_listener(self): + ut = self + + class MyListener(ev.Listener): + def on_start(self, event): + ut.assertEqual(event.status, ev.EventStatus.START) + ut.assertEqual(event.kind, "numba:compile") + ut.assertIs(event.data["dispatcher"], foo) + dispatcher = event.data["dispatcher"] + ut.assertIs(dispatcher, foo) + # Check that the compiling signature is NOT in the overloads + ut.assertNotIn(event.data["args"], dispatcher.overloads) + + def on_end(self, event): + ut.assertEqual(event.status, ev.EventStatus.END) + ut.assertEqual(event.kind, "numba:compile") + dispatcher = event.data["dispatcher"] + ut.assertIs(dispatcher, foo) + # Check that the compiling signature is in the overloads + ut.assertIn(event.data["args"], dispatcher.overloads) + + @njit + def foo(x): + return x + + listener = MyListener() + with ev.install_listener("numba:compile", listener) as yielded: + foo(1) + + # Check that the yielded value is the same listener + self.assertIs(listener, yielded) + + def test_global_register(self): + ut = self + + class MyListener(ev.Listener): + def on_start(self, event): + ut.assertEqual(event.status, ev.EventStatus.START) + ut.assertEqual(event.kind, "numba:compile") + # Check it is the same dispatcher + dispatcher = event.data["dispatcher"] + ut.assertIs(dispatcher, foo) + # Check that the compiling signature is NOT in the overloads + ut.assertNotIn(event.data["args"], dispatcher.overloads) + + def on_end(self, event): + ut.assertEqual(event.status, ev.EventStatus.END) + ut.assertEqual(event.kind, "numba:compile") + # Check it is the same dispatcher + dispatcher = event.data["dispatcher"] + ut.assertIs(dispatcher, foo) + # Check that the compiling signature is in the overloads + ut.assertIn(event.data["args"], dispatcher.overloads) + + @njit + def foo(x): + return x + + listener = MyListener() + ev.register("numba:compile", listener) + foo(1) + ev.unregister("numba:compile", listener) + + def test_lifted_dispatcher(self): + @jit(forceobj=True) + def foo(): + object() # to trigger loop-lifting + c = 0 + for i in range(10): + c += i + return c + + with ev.install_recorder("numba:compile") as rec: + foo() + + # Check that there are 4 events. + # Two for `foo()` and two for the lifted loop. + self.assertGreaterEqual(len(rec.buffer), 4) + + cres = foo.overloads[foo.signatures[0]] + [ldisp] = cres.lifted + + lifted_cres = ldisp.overloads[ldisp.signatures[0]] + self.assertIsInstance( + lifted_cres.metadata["timers"]["compiler_lock"], + float, + ) + self.assertIsInstance( + lifted_cres.metadata["timers"]["llvm_lock"], + float, + ) + + def test_timing_properties(self): + a = tuple(string.ascii_lowercase) + + @njit + def bar(x): + acc = 0 + for i in literal_unroll(a): + if i in {'1': x}: + acc += 1 + else: + acc += np.sqrt(x[0, 0]) + return np.sin(x), acc + + @njit + def foo(x): + return bar(np.zeros((x, x))) + + with override_config('LLVM_PASS_TIMINGS', True): + foo(1) + + def get_timers(fn, prop): + md = fn.get_metadata(fn.signatures[0]) + return md[prop] + + foo_timers = get_timers(foo, 'timers') + bar_timers = get_timers(bar, 'timers') + foo_llvm_timer = get_timers(foo, 'llvm_pass_timings') + bar_llvm_timer = get_timers(bar, 'llvm_pass_timings') + + # Check: time spent in bar() must be longer than in foo() + self.assertLess(bar_timers['llvm_lock'], + foo_timers['llvm_lock']) + self.assertLess(bar_timers['compiler_lock'], + foo_timers['compiler_lock']) + + # Check: time spent in LLVM itself must be less than in the LLVM lock + self.assertLess(foo_llvm_timer.get_total_time(), + foo_timers['llvm_lock']) + self.assertLess(bar_llvm_timer.get_total_time(), + bar_timers['llvm_lock']) + + # Check: time spent in LLVM lock must be less than in compiler + self.assertLess(foo_timers['llvm_lock'], + foo_timers['compiler_lock']) + self.assertLess(bar_timers['llvm_lock'], + bar_timers['compiler_lock']) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_exceptions.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..195c963e7af5e3c71f67e9c51bf6aaf5bb253956 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_exceptions.py @@ -0,0 +1,475 @@ +import numpy as np +import sys +import traceback + +from numba import jit, njit +from numba.core import types, errors, utils +from numba.tests.support import (TestCase, expected_failure_py311, + expected_failure_py312, + expected_failure_py313, + ) +import unittest + + +force_pyobj_flags = {'nopython': False, 'forceobj': True} +no_pyobj_flags = {'nopython': True, '_nrt': False} +no_pyobj_flags_w_nrt = {'nopython': True, '_nrt': True} +no_gil_flags = {'nopython': True, 'nogil': True, '_nrt': True} + + +class MyError(Exception): + pass + + +class OtherError(Exception): + pass + + +class UDEArgsToSuper(Exception): + def __init__(self, arg, value0): + super(UDEArgsToSuper, self).__init__(arg) + self.value0 = value0 + + def __eq__(self, other): + if not isinstance(other, self.__class__): + return False + same = True + same |= self.args == other.args + same |= self.value0 == other.value0 + return same + + def __hash__(self): + return hash((super(UDEArgsToSuper).__hash__(), self.value0)) + + +class UDENoArgSuper(Exception): + def __init__(self, arg, value0): + super(UDENoArgSuper, self).__init__() + self.deferarg = arg + self.value0 = value0 + + def __eq__(self, other): + if not isinstance(other, self.__class__): + return False + same = True + same |= self.args == other.args + same |= self.deferarg == other.deferarg + same |= self.value0 == other.value0 + return same + + def __hash__(self): + return hash((super(UDENoArgSuper).__hash__(), self.deferarg, + self.value0)) + + +def raise_class(exc): + def raiser(i): + if i == 1: + raise exc + elif i == 2: + raise ValueError + elif i == 3: + # The exception type is looked up on a module (issue #1624) + raise np.linalg.LinAlgError + return i + return raiser + + +def raise_instance(exc, arg): + def raiser(i): + if i == 1: + raise exc(arg, 1) + elif i == 2: + raise ValueError(arg, 2) + elif i == 3: + raise np.linalg.LinAlgError(arg, 3) + return i + return raiser + + +def raise_instance_runtime_args(exc): + def raiser(i, arg): + if i == 1: + raise exc(arg, 1) + elif i == 2: + raise ValueError(arg, 2) + elif i == 3: + raise np.linalg.LinAlgError(arg, 3) + return i + return raiser + + +def reraise(): + raise + + +def outer_function(inner): + def outer(i): + if i == 3: + raise OtherError("bar", 3) + return inner(i) + return outer + + +def assert_usecase(i): + assert i == 1, "bar" + + +def ude_bug_usecase(): + raise UDEArgsToSuper() # oops user forgot args to exception ctor + + +def raise_runtime_value(arg): + raise ValueError(arg) + + +class TestRaising(TestCase): + + def test_unituple_index_error(self): + def pyfunc(a, i): + return a.shape[i] + + cfunc = njit((types.Array(types.int32, 1, 'A'), types.int32),)(pyfunc) + + a = np.empty(2, dtype=np.int32) + + self.assertEqual(cfunc(a, 0), pyfunc(a, 0)) + + with self.assertRaises(IndexError) as cm: + cfunc(a, 2) + self.assertEqual(str(cm.exception), "tuple index out of range") + + def check_against_python(self, exec_mode, pyfunc, cfunc, + expected_error_class, *args): + + assert exec_mode in (force_pyobj_flags, no_pyobj_flags, + no_pyobj_flags_w_nrt, no_gil_flags) + + # invariant of mode, check the error class and args are the same + with self.assertRaises(expected_error_class) as pyerr: + pyfunc(*args) + with self.assertRaises(expected_error_class) as jiterr: + cfunc(*args) + self.assertEqual(pyerr.exception.args, jiterr.exception.args) + + # special equality check for UDEs + if isinstance(pyerr.exception, (UDEArgsToSuper, UDENoArgSuper)): + self.assertTrue(pyerr.exception == jiterr.exception) + + # in npm check bottom of traceback matches as frame injection with + # location info should ensure this + if exec_mode is no_pyobj_flags: + + # we only care about the bottom two frames, the error and the + # location it was raised. + try: + pyfunc(*args) + except Exception: + py_frames = traceback.format_exception(*sys.exc_info()) + expected_frames = py_frames[-2:] + + try: + cfunc(*args) + except Exception: + c_frames = traceback.format_exception(*sys.exc_info()) + got_frames = c_frames[-2:] + + # check exception and the injected frame are the same + for expf, gotf in zip(expected_frames, got_frames): + # Note use of assertIn not assertEqual, Py 3.11 has markers (^) + # that point to the variable causing the problem, Numba doesn't + # do this so only the start of the string will match. + self.assertIn(gotf, expf) + + def check_raise_class(self, flags): + pyfunc = raise_class(MyError) + cfunc = jit((types.int32,), **flags)(pyfunc) + self.assertEqual(cfunc(0), 0) + self.check_against_python(flags, pyfunc, cfunc, MyError, 1) + self.check_against_python(flags, pyfunc, cfunc, ValueError, 2) + self.check_against_python(flags, pyfunc, cfunc, + np.linalg.linalg.LinAlgError, 3) + + def test_raise_class_nopython(self): + self.check_raise_class(flags=no_pyobj_flags) + + def test_raise_class_objmode(self): + self.check_raise_class(flags=force_pyobj_flags) + + def check_raise_instance(self, flags): + for clazz in [MyError, UDEArgsToSuper, + UDENoArgSuper]: + pyfunc = raise_instance(clazz, "some message") + cfunc = jit((types.int32,), **flags)(pyfunc) + + self.assertEqual(cfunc(0), 0) + self.check_against_python(flags, pyfunc, cfunc, clazz, 1) + self.check_against_python(flags, pyfunc, cfunc, ValueError, 2) + self.check_against_python(flags, pyfunc, cfunc, + np.linalg.linalg.LinAlgError, 3) + + def test_raise_instance_objmode(self): + self.check_raise_instance(flags=force_pyobj_flags) + + def test_raise_instance_nopython(self): + self.check_raise_instance(flags=no_pyobj_flags) + + def check_raise_nested(self, flags, **jit_args): + """ + Check exception propagation from nested functions. + """ + for clazz in [MyError, UDEArgsToSuper, + UDENoArgSuper]: + inner_pyfunc = raise_instance(clazz, "some message") + pyfunc = outer_function(inner_pyfunc) + inner_cfunc = jit(**jit_args)(inner_pyfunc) + cfunc = jit(**jit_args)(outer_function(inner_cfunc)) + + self.check_against_python(flags, pyfunc, cfunc, clazz, 1) + self.check_against_python(flags, pyfunc, cfunc, ValueError, 2) + self.check_against_python(flags, pyfunc, cfunc, OtherError, 3) + + def test_raise_nested_objmode(self): + self.check_raise_nested(force_pyobj_flags, forceobj=True) + + def test_raise_nested_nopython(self): + self.check_raise_nested(no_pyobj_flags, nopython=True) + + def check_reraise(self, flags): + def raise_exc(exc): + raise exc + pyfunc = reraise + cfunc = jit((), **flags)(pyfunc) + for op, err in [(lambda : raise_exc(ZeroDivisionError), + ZeroDivisionError), + (lambda : raise_exc(UDEArgsToSuper("msg", 1)), + UDEArgsToSuper), + (lambda : raise_exc(UDENoArgSuper("msg", 1)), + UDENoArgSuper)]: + def gen_impl(fn): + def impl(): + try: + op() + except err: + fn() + return impl + pybased = gen_impl(pyfunc) + cbased = gen_impl(cfunc) + self.check_against_python(flags, pybased, cbased, err,) + + def test_reraise_objmode(self): + self.check_reraise(flags=force_pyobj_flags) + + def test_reraise_nopython(self): + self.check_reraise(flags=no_pyobj_flags) + + def check_raise_invalid_class(self, cls, flags): + pyfunc = raise_class(cls) + cfunc = jit((types.int32,), **flags)(pyfunc) + with self.assertRaises(TypeError) as cm: + cfunc(1) + self.assertEqual(str(cm.exception), + "exceptions must derive from BaseException") + + def test_raise_invalid_class_objmode(self): + self.check_raise_invalid_class(int, flags=force_pyobj_flags) + self.check_raise_invalid_class(1, flags=force_pyobj_flags) + + def test_raise_invalid_class_nopython(self): + msg = "Encountered unsupported constant type used for exception" + with self.assertRaises(errors.UnsupportedError) as raises: + self.check_raise_invalid_class(int, flags=no_pyobj_flags) + self.assertIn(msg, str(raises.exception)) + with self.assertRaises(errors.UnsupportedError) as raises: + self.check_raise_invalid_class(1, flags=no_pyobj_flags) + self.assertIn(msg, str(raises.exception)) + + def test_raise_bare_string_nopython(self): + @njit + def foo(): + raise "illegal" + msg = ("Directly raising a string constant as an exception is not " + "supported") + with self.assertRaises(errors.UnsupportedError) as raises: + foo() + self.assertIn(msg, str(raises.exception)) + + def check_assert_statement(self, flags): + pyfunc = assert_usecase + cfunc = jit((types.int32,), **flags)(pyfunc) + cfunc(1) + self.check_against_python(flags, pyfunc, cfunc, AssertionError, 2) + + def test_assert_statement_objmode(self): + self.check_assert_statement(flags=force_pyobj_flags) + + def test_assert_statement_nopython(self): + self.check_assert_statement(flags=no_pyobj_flags) + + def check_raise_from_exec_string(self, flags): + # issue #3428 + simple_raise = "def f(a):\n raise exc('msg', 10)" + assert_raise = "def f(a):\n assert a != 1" + py312_pep695_raise = "def f[T: int](a: T) -> T:\n assert a != 1" + py312_pep695_raise_2 = "def f[T: int\n](a: T) -> T:\n assert a != 1" + test_cases = [ + (assert_raise, AssertionError), + (simple_raise, UDEArgsToSuper), + (simple_raise, UDENoArgSuper), + ] + if utils.PYVERSION >= (3, 12): + # Added for https://github.com/numba/numba/issues/9443 + test_cases.append((py312_pep695_raise, AssertionError)) + test_cases.append((py312_pep695_raise_2, AssertionError)) + for f_text, exc in test_cases: + loc = {} + exec(f_text, {'exc': exc}, loc) + pyfunc = loc['f'] + cfunc = jit((types.int32,), **flags)(pyfunc) + self.check_against_python(flags, pyfunc, cfunc, exc, 1) + + def test_assert_from_exec_string_objmode(self): + self.check_raise_from_exec_string(flags=force_pyobj_flags) + + def test_assert_from_exec_string_nopython(self): + self.check_raise_from_exec_string(flags=no_pyobj_flags) + + def check_user_code_error_traceback(self, flags): + # this test checks that if a user tries to compile code that contains + # a bug in exception initialisation (e.g. missing arg) then this also + # has a frame injected with the location information. + pyfunc = ude_bug_usecase + cfunc = jit((), **flags)(pyfunc) + self.check_against_python(flags, pyfunc, cfunc, TypeError) + + def test_user_code_error_traceback_objmode(self): + self.check_user_code_error_traceback(flags=force_pyobj_flags) + + def test_user_code_error_traceback_nopython(self): + self.check_user_code_error_traceback(flags=no_pyobj_flags) + + def check_raise_runtime_value(self, flags): + pyfunc = raise_runtime_value + cfunc = jit((types.string,), **flags)(pyfunc) + self.check_against_python(flags, pyfunc, cfunc, ValueError, 'hello') + + def test_raise_runtime_value_objmode(self): + self.check_raise_runtime_value(flags=force_pyobj_flags) + + def test_raise_runtime_value_nopython(self): + self.check_raise_runtime_value(flags=no_pyobj_flags_w_nrt) + + def test_raise_runtime_value_nogil(self): + self.check_raise_runtime_value(flags=no_gil_flags) + + def check_raise_instance_with_runtime_args(self, flags): + for clazz in [MyError, UDEArgsToSuper, + UDENoArgSuper]: + pyfunc = raise_instance_runtime_args(clazz) + cfunc = jit((types.int32, types.string), **flags)(pyfunc) + + self.assertEqual(cfunc(0, 'test'), 0) + self.check_against_python(flags, pyfunc, cfunc, clazz, 1, 'hello') + self.check_against_python(flags, pyfunc, cfunc, ValueError, 2, + 'world') + self.check_against_python(flags, pyfunc, cfunc, + np.linalg.linalg.LinAlgError, 3, 'linalg') + + def test_raise_instance_with_runtime_args_objmode(self): + self.check_raise_instance_with_runtime_args(flags=force_pyobj_flags) + + def test_raise_instance_with_runtime_args_nopython(self): + self.check_raise_instance_with_runtime_args(flags=no_pyobj_flags_w_nrt) + + def test_raise_instance_with_runtime_args_nogil(self): + self.check_raise_instance_with_runtime_args(flags=no_gil_flags) + + def test_dynamic_raise_bad_args(self): + def raise_literal_dict(): + raise ValueError({'a': 1, 'b': np.ones(4)}) + + def raise_range(): + raise ValueError(range(3)) + + def raise_rng(rng): + raise ValueError(rng.bit_generator) + + funcs = [ + (raise_literal_dict, ()), + (raise_range, ()), + (raise_rng, (types.npy_rng,)), + ] + + for pyfunc, argtypes in funcs: + msg = '.*Cannot convert native .* to a Python object.*' + with self.assertRaisesRegex(errors.TypingError, msg): + njit(argtypes)(pyfunc) + + def test_dynamic_raise_dict(self): + @njit + def raise_literal_dict2(): + raise ValueError({'a': 1, 'b': 3}) + + msg = "{a: 1, b: 3}" + with self.assertRaisesRegex(ValueError, msg): + raise_literal_dict2() + + def test_disable_nrt(self): + @njit(_nrt=False) + def raise_with_no_nrt(i): + raise ValueError(i) + + msg = 'NRT required but not enabled' + with self.assertRaisesRegex(errors.NumbaRuntimeError, msg): + raise_with_no_nrt(123) + + def test_try_raise(self): + + @njit + def raise_(a): + raise ValueError(a) + + @njit + def try_raise(a): + try: + raise_(a) + except Exception: + pass + return a + 1 + + self.assertEqual(try_raise.py_func(3), try_raise(3)) + + @expected_failure_py311 + @expected_failure_py312 + @expected_failure_py313 + def test_dynamic_raise(self): + + @njit + def raise_(a): + raise ValueError(a) + + @njit + def try_raise_(a): + try: + raise_(a) + except Exception: + raise ValueError(a) + + args = [ + 1, + 1.1, + 'hello', + np.ones(3), + [1, 2], + (1, 2), + set([1, 2]), + ] + for fn in (raise_, try_raise_): + for arg in args: + with self.assertRaises(ValueError) as e: + fn(arg) + self.assertEqual((arg,), e.exception.args) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_extended_arg.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_extended_arg.py new file mode 100644 index 0000000000000000000000000000000000000000..535d8f89d1b0660da9502f14c99017bf8bd3ed01 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_extended_arg.py @@ -0,0 +1,51 @@ +import unittest + +import dis +import struct + +from numba import jit +from numba.core import utils +from numba.tests.support import TestCase + + +class TestExtendedArg(TestCase): + """ + Test support for the EXTENDED_ARG opcode. + """ + bytecode_len = 0xff + + def get_extended_arg_load_const(self): + """ + Get a function with a EXTENDED_ARG opcode before a LOAD_CONST opcode. + """ + def f(): + x = 5 + return x + + b = bytearray(f.__code__.co_code) + consts = f.__code__.co_consts + bytecode_format = "= (3, 11): + # Python 3.11 has a RESUME op code at the start of a function, need + # to inject the EXTENDED_ARG after this to influence the LOAD_CONST + offset = 2 # 2 byte op code + else: + offset = 0 + + packed_extend_arg = struct.pack(bytecode_format, dis.EXTENDED_ARG, 1) + b[:] = b[:offset] + packed_extend_arg + b[offset:] + f.__code__ = f.__code__.replace(co_code=bytes(b), co_consts=consts) + return f + + def test_extended_arg_load_const(self): + pyfunc = self.get_extended_arg_load_const() + # make sure that the pyfunc contains the expected modification + self.assertGreater(len(pyfunc.__code__.co_consts), self.bytecode_len) + self.assertPreciseEqual(pyfunc(), 42) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(), 42) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_extending.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_extending.py new file mode 100644 index 0000000000000000000000000000000000000000..323e98367c5cec5183bf0484a613971be3b97a78 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_extending.py @@ -0,0 +1,2248 @@ +import inspect +import math +import operator +import sys +import pickle +import multiprocessing +import ctypes +import warnings +import re + +import numpy as np +from llvmlite import ir + +import numba +from numba import njit, jit, vectorize, guvectorize, objmode +from numba.core import types, errors, typing, compiler, cgutils +from numba.core.typed_passes import type_inference_stage +from numba.core.registry import cpu_target +from numba.core.imputils import lower_constant +from numba.tests.support import ( + TestCase, + captured_stdout, + temp_directory, + override_config, + run_in_new_process_in_cache_dir, + skip_if_typeguard, +) +from numba.core.errors import LoweringError +import unittest + +from numba.extending import ( + typeof_impl, + type_callable, + lower_builtin, + lower_cast, + overload, + overload_attribute, + overload_method, + models, + register_model, + box, + unbox, + NativeValue, + intrinsic, + _Intrinsic, + register_jitable, + get_cython_function_address, + is_jitted, + overload_classmethod, +) +from numba.core.typing.templates import ( + ConcreteTemplate, + signature, + infer, + infer_global, + AbstractTemplate, +) + + +# Pandas-like API implementation +from .pdlike_usecase import Index, Series + + +try: + import scipy.special.cython_special as sc +except ImportError: + sc = None + + +# ----------------------------------------------------------------------- +# Define a custom type and an implicit cast on it + + +class MyDummy(object): + pass + + +class MyDummyType(types.Opaque): + def can_convert_to(self, context, toty): + if isinstance(toty, types.Number): + from numba.core.typeconv import Conversion + + return Conversion.safe + + +mydummy_type = MyDummyType("mydummy") +mydummy = MyDummy() + + +@typeof_impl.register(MyDummy) +def typeof_mydummy(val, c): + return mydummy_type + + +@lower_cast(MyDummyType, types.Number) +def mydummy_to_number(context, builder, fromty, toty, val): + """ + Implicit conversion from MyDummy to int. + """ + return context.get_constant(toty, 42) + + +def get_dummy(): + return mydummy + + +register_model(MyDummyType)(models.OpaqueModel) + + +@unbox(MyDummyType) +def unbox_index(typ, obj, c): + return NativeValue(c.context.get_dummy_value()) + + +# ----------------------------------------------------------------------- +# Define a second custom type but w/o implicit cast to Number + + +def base_dummy_type_factory(name): + class DynType(object): + pass + + class DynTypeType(types.Opaque): + pass + + dyn_type_type = DynTypeType(name) + + @typeof_impl.register(DynType) + def typeof_mydummy(val, c): + return dyn_type_type + + register_model(DynTypeType)(models.OpaqueModel) + return DynTypeType, DynType, dyn_type_type + + +MyDummyType2, MyDummy2, mydummy_type_2 = base_dummy_type_factory("mydummy2") + + +@unbox(MyDummyType2) +def unbox_index2(typ, obj, c): + return NativeValue(c.context.get_dummy_value()) + + +# ----------------------------------------------------------------------- +# Define a function's typing and implementation using the classical +# two-step API + + +def func1(x=None): + raise NotImplementedError + + +def type_func1_(context): + def typer(x=None): + if x in (None, types.none): + # 0-arg or 1-arg with None + return types.int32 + elif isinstance(x, types.Float): + # 1-arg with float + return x + + return typer + + +type_func1 = type_callable(func1)(type_func1_) + + +@lower_builtin(func1) +@lower_builtin(func1, types.none) +def func1_nullary(context, builder, sig, args): + return context.get_constant(sig.return_type, 42) + + +@lower_builtin(func1, types.Float) +def func1_unary(context, builder, sig, args): + def func1_impl(x): + return math.sqrt(2 * x) + + return context.compile_internal(builder, func1_impl, sig, args) + + +# We can do the same for a known internal operation, here "print_item" +# which we extend to support MyDummyType. + + +@infer +class PrintDummy(ConcreteTemplate): + key = "print_item" + cases = [signature(types.none, mydummy_type)] + + +@lower_builtin("print_item", MyDummyType) +def print_dummy(context, builder, sig, args): + [x] = args + pyapi = context.get_python_api(builder) + strobj = pyapi.unserialize(pyapi.serialize_object("hello!")) + pyapi.print_object(strobj) + pyapi.decref(strobj) + return context.get_dummy_value() + + +# ----------------------------------------------------------------------- +# Define an overloaded function (combined API) + + +def where(cond, x, y): + raise NotImplementedError + + +def np_where(cond, x, y): + """ + Wrap np.where() to allow for keyword arguments + """ + return np.where(cond, x, y) + + +def call_where(cond, x, y): + return where(cond, y=y, x=x) + + +@overload(where) +def overload_where_arrays(cond, x, y): + """ + Implement where() for arrays. + """ + # Choose implementation based on argument types. + if isinstance(cond, types.Array): + if x.dtype != y.dtype: + raise errors.TypingError("x and y should have the same dtype") + + # Array where() => return an array of the same shape + if all(ty.layout == "C" for ty in (cond, x, y)): + + def where_impl(cond, x, y): + """ + Fast implementation for C-contiguous arrays + """ + shape = cond.shape + if x.shape != shape or y.shape != shape: + raise ValueError("all inputs should have the same shape") + res = np.empty_like(x) + cf = cond.flat + xf = x.flat + yf = y.flat + rf = res.flat + for i in range(cond.size): + rf[i] = xf[i] if cf[i] else yf[i] + return res + + else: + + def where_impl(cond, x, y): + """ + Generic implementation for other arrays + """ + shape = cond.shape + if x.shape != shape or y.shape != shape: + raise ValueError("all inputs should have the same shape") + res = np.empty_like(x) + for idx, c in np.ndenumerate(cond): + res[idx] = x[idx] if c else y[idx] + return res + + return where_impl + + +# We can define another overload function for the same function, they +# will be tried in turn until one succeeds. + + +@overload(where) +def overload_where_scalars(cond, x, y): + """ + Implement where() for scalars. + """ + if not isinstance(cond, types.Array): + if x != y: + raise errors.TypingError("x and y should have the same type") + + def where_impl(cond, x, y): + """ + Scalar where() => return a 0-dim array + """ + scal = x if cond else y + # Can't use full_like() on Numpy < 1.8 + arr = np.empty_like(scal) + arr[()] = scal + return arr + + return where_impl + + +# ----------------------------------------------------------------------- +# Overload an already defined built-in function, extending it for new types. + + +@overload(len) +def overload_len_dummy(arg): + if isinstance(arg, MyDummyType): + + def len_impl(arg): + return 13 + + return len_impl + + +@overload(operator.add) +def overload_add_dummy(arg1, arg2): + if isinstance(arg1, (MyDummyType, MyDummyType2)) and isinstance( + arg2, (MyDummyType, MyDummyType2) + ): + + def dummy_add_impl(arg1, arg2): + return 42 + + return dummy_add_impl + + +@overload(operator.delitem) +def overload_dummy_delitem(obj, idx): + if isinstance(obj, MyDummyType) and isinstance(idx, types.Integer): + + def dummy_delitem_impl(obj, idx): + print("del", obj, idx) + + return dummy_delitem_impl + + +@overload(operator.getitem) +def overload_dummy_getitem(obj, idx): + if isinstance(obj, MyDummyType) and isinstance(idx, types.Integer): + + def dummy_getitem_impl(obj, idx): + return idx + 123 + + return dummy_getitem_impl + + +@overload(operator.setitem) +def overload_dummy_setitem(obj, idx, val): + if all( + [ + isinstance(obj, MyDummyType), + isinstance(idx, types.Integer), + isinstance(val, types.Integer), + ] + ): + + def dummy_setitem_impl(obj, idx, val): + print(idx, val) + + return dummy_setitem_impl + + +def call_add_operator(arg1, arg2): + return operator.add(arg1, arg2) + + +def call_add_binop(arg1, arg2): + return arg1 + arg2 + + +@overload(operator.iadd) +def overload_iadd_dummy(arg1, arg2): + if isinstance(arg1, (MyDummyType, MyDummyType2)) and isinstance( + arg2, (MyDummyType, MyDummyType2) + ): + + def dummy_iadd_impl(arg1, arg2): + return 42 + + return dummy_iadd_impl + + +def call_iadd_operator(arg1, arg2): + return operator.add(arg1, arg2) + + +def call_iadd_binop(arg1, arg2): + arg1 += arg2 + + return arg1 + + +def call_delitem(obj, idx): + del obj[idx] + + +def call_getitem(obj, idx): + return obj[idx] + + +def call_setitem(obj, idx, val): + obj[idx] = val + + +@overload_method(MyDummyType, "length") +def overload_method_length(arg): + def imp(arg): + return len(arg) + + return imp + + +def cache_overload_method_usecase(x): + return x.length() + + +def call_func1_nullary(): + return func1() + + +def call_func1_unary(x): + return func1(x) + + +def len_usecase(x): + return len(x) + + +def print_usecase(x): + print(x) + + +def getitem_usecase(x, key): + return x[key] + + +def npyufunc_usecase(x): + return np.cos(np.sin(x)) + + +def get_data_usecase(x): + return x._data + + +def get_index_usecase(x): + return x._index + + +def is_monotonic_usecase(x): + return x.is_monotonic_increasing + + +def make_series_usecase(data, index): + return Series(data, index) + + +def clip_usecase(x, lo, hi): + return x.clip(lo, hi) + + +# ----------------------------------------------------------------------- + + +def return_non_boxable(): + return np + + +@overload(return_non_boxable) +def overload_return_non_boxable(): + def imp(): + return np + + return imp + + +def non_boxable_ok_usecase(sz): + mod = return_non_boxable() + return mod.arange(sz) + + +def non_boxable_bad_usecase(): + return return_non_boxable() + + +def mk_func_input(f): + pass + + +@infer_global(mk_func_input) +class MkFuncTyping(AbstractTemplate): + def generic(self, args, kws): + assert isinstance(args[0], types.MakeFunctionLiteral) + return signature(types.none, *args) + + +def mk_func_test_impl(): + mk_func_input(lambda a: a) + + +# ----------------------------------------------------------------------- +# Define a types derived from types.Callable and overloads for them + + +class MyClass(object): + pass + + +class CallableTypeRef(types.Callable): + + def __init__(self, instance_type): + self.instance_type = instance_type + self.sig_to_impl_key = {} + self.compiled_templates = [] + super(CallableTypeRef, self).__init__('callable_type_ref' + '[{}]'.format(self.instance_type)) + + def get_call_type(self, context, args, kws): + + res_sig = None + for template in context._functions[type(self)]: + try: + res_sig = template.apply(args, kws) + except Exception: + pass # for simplicity assume args must match exactly + else: + compiled_ovlds = getattr(template, '_compiled_overloads', {}) + if args in compiled_ovlds: + self.sig_to_impl_key[res_sig] = compiled_ovlds[args] + self.compiled_templates.append(template) + break + + return res_sig + + def get_call_signatures(self): + sigs = list(self.sig_to_impl_key.keys()) + return sigs, True + + def get_impl_key(self, sig): + return self.sig_to_impl_key[sig] + + +@register_model(CallableTypeRef) +class CallableTypeModel(models.OpaqueModel): + + def __init__(self, dmm, fe_type): + + models.OpaqueModel.__init__(self, dmm, fe_type) + + +infer_global(MyClass, CallableTypeRef(MyClass)) + + +@lower_constant(CallableTypeRef) +def constant_callable_typeref(context, builder, ty, pyval): + return context.get_dummy_value() + + +# ----------------------------------------------------------------------- + + +@overload(np.exp) +def overload_np_exp(obj): + if isinstance(obj, MyDummyType): + + def imp(obj): + # Returns a constant if a MyDummyType is seen + return 0xDEADBEEF + + return imp + + +class TestLowLevelExtending(TestCase): + """ + Test the low-level two-tier extension API. + """ + + # Check with `@jit` from within the test process and also in a new test + # process so as to check the registration mechanism. + + def test_func1(self): + pyfunc = call_func1_nullary + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(), 42) + pyfunc = call_func1_unary + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(None), 42) + self.assertPreciseEqual(cfunc(18.0), 6.0) + + @TestCase.run_test_in_subprocess + def test_func1_isolated(self): + self.test_func1() + + def test_type_callable_keeps_function(self): + self.assertIs(type_func1, type_func1_) + self.assertIsNotNone(type_func1) + + @TestCase.run_test_in_subprocess + def test_cast_mydummy(self): + pyfunc = get_dummy + cfunc = njit(types.float64(),)(pyfunc) + self.assertPreciseEqual(cfunc(), 42.0) + + def test_mk_func_literal(self): + """make sure make_function is passed to typer class as a literal + """ + test_ir = compiler.run_frontend(mk_func_test_impl) + typingctx = cpu_target.typing_context + targetctx = cpu_target.target_context + typingctx.refresh() + targetctx.refresh() + typing_res = type_inference_stage(typingctx, targetctx, test_ir, (), + None) + self.assertTrue( + any( + isinstance(a, types.MakeFunctionLiteral) + for a in typing_res.typemap.values() + ) + ) + + +class TestPandasLike(TestCase): + """ + Test implementing a pandas-like Index object. + Also stresses most of the high-level API. + """ + + def test_index_len(self): + i = Index(np.arange(3)) + cfunc = jit(nopython=True)(len_usecase) + self.assertPreciseEqual(cfunc(i), 3) + + def test_index_getitem(self): + i = Index(np.int32([42, 8, -5])) + cfunc = jit(nopython=True)(getitem_usecase) + self.assertPreciseEqual(cfunc(i, 1), 8) + ii = cfunc(i, slice(1, None)) + self.assertIsInstance(ii, Index) + self.assertEqual(list(ii), [8, -5]) + + def test_index_ufunc(self): + """ + Check Numpy ufunc on an Index object. + """ + i = Index(np.int32([42, 8, -5])) + cfunc = jit(nopython=True)(npyufunc_usecase) + ii = cfunc(i) + self.assertIsInstance(ii, Index) + self.assertPreciseEqual(ii._data, np.cos(np.sin(i._data))) + + def test_index_get_data(self): + # The _data attribute is exposed with make_attribute_wrapper() + i = Index(np.int32([42, 8, -5])) + cfunc = jit(nopython=True)(get_data_usecase) + data = cfunc(i) + self.assertIs(data, i._data) + + def test_index_is_monotonic(self): + # The is_monotonic_increasing attribute is exposed with + # overload_attribute() + cfunc = jit(nopython=True)(is_monotonic_usecase) + for values, expected in [ + ([8, 42, 5], False), + ([5, 8, 42], True), + ([], True), + ]: + i = Index(np.int32(values)) + got = cfunc(i) + self.assertEqual(got, expected) + + def test_series_len(self): + i = Index(np.int32([2, 4, 3])) + s = Series(np.float64([1.5, 4.0, 2.5]), i) + cfunc = jit(nopython=True)(len_usecase) + self.assertPreciseEqual(cfunc(s), 3) + + def test_series_get_index(self): + i = Index(np.int32([2, 4, 3])) + s = Series(np.float64([1.5, 4.0, 2.5]), i) + cfunc = jit(nopython=True)(get_index_usecase) + got = cfunc(s) + self.assertIsInstance(got, Index) + self.assertIs(got._data, i._data) + + def test_series_ufunc(self): + """ + Check Numpy ufunc on an Series object. + """ + i = Index(np.int32([42, 8, -5])) + s = Series(np.int64([1, 2, 3]), i) + cfunc = jit(nopython=True)(npyufunc_usecase) + ss = cfunc(s) + self.assertIsInstance(ss, Series) + self.assertIsInstance(ss._index, Index) + self.assertIs(ss._index._data, i._data) + self.assertPreciseEqual(ss._values, np.cos(np.sin(s._values))) + + def test_series_constructor(self): + i = Index(np.int32([42, 8, -5])) + d = np.float64([1.5, 4.0, 2.5]) + cfunc = jit(nopython=True)(make_series_usecase) + got = cfunc(d, i) + self.assertIsInstance(got, Series) + self.assertIsInstance(got._index, Index) + self.assertIs(got._index._data, i._data) + self.assertIs(got._values, d) + + def test_series_clip(self): + i = Index(np.int32([42, 8, -5])) + s = Series(np.float64([1.5, 4.0, 2.5]), i) + cfunc = jit(nopython=True)(clip_usecase) + ss = cfunc(s, 1.6, 3.0) + self.assertIsInstance(ss, Series) + self.assertIsInstance(ss._index, Index) + self.assertIs(ss._index._data, i._data) + self.assertPreciseEqual(ss._values, np.float64([1.6, 3.0, 2.5])) + + +class TestHighLevelExtending(TestCase): + """ + Test the high-level combined API. + """ + + def test_where(self): + """ + Test implementing a function with @overload. + """ + pyfunc = call_where + cfunc = jit(nopython=True)(pyfunc) + + def check(*args, **kwargs): + expected = np_where(*args, **kwargs) + got = cfunc(*args, **kwargs) + self.assertPreciseEqual(expected, got) + + check(x=3, cond=True, y=8) + check(True, 3, 8) + check( + np.bool_([True, False, True]), + np.int32([1, 2, 3]), + np.int32([4, 5, 5]), + ) + + # The typing error is propagated + with self.assertRaises(errors.TypingError) as raises: + cfunc(np.bool_([]), np.int32([]), np.int64([])) + self.assertIn( + "x and y should have the same dtype", str(raises.exception) + ) + + def test_len(self): + """ + Test re-implementing len() for a custom type with @overload. + """ + cfunc = jit(nopython=True)(len_usecase) + self.assertPreciseEqual(cfunc(MyDummy()), 13) + self.assertPreciseEqual(cfunc([4, 5]), 2) + + def test_print(self): + """ + Test re-implementing print() for a custom type with @overload. + """ + cfunc = jit(nopython=True)(print_usecase) + with captured_stdout(): + cfunc(MyDummy()) + self.assertEqual(sys.stdout.getvalue(), "hello!\n") + + def test_add_operator(self): + """ + Test re-implementing operator.add() for a custom type with @overload. + """ + pyfunc = call_add_operator + cfunc = jit(nopython=True)(pyfunc) + + self.assertPreciseEqual(cfunc(1, 2), 3) + self.assertPreciseEqual(cfunc(MyDummy2(), MyDummy2()), 42) + + # this will call add(Number, Number) as MyDummy implicitly casts to + # Number + self.assertPreciseEqual(cfunc(MyDummy(), MyDummy()), 84) + + def test_add_binop(self): + """ + Test re-implementing '+' for a custom type via @overload(operator.add). + """ + pyfunc = call_add_binop + cfunc = jit(nopython=True)(pyfunc) + + self.assertPreciseEqual(cfunc(1, 2), 3) + self.assertPreciseEqual(cfunc(MyDummy2(), MyDummy2()), 42) + + # this will call add(Number, Number) as MyDummy implicitly casts to + # Number + self.assertPreciseEqual(cfunc(MyDummy(), MyDummy()), 84) + + def test_iadd_operator(self): + """ + Test re-implementing operator.add() for a custom type with @overload. + """ + pyfunc = call_iadd_operator + cfunc = jit(nopython=True)(pyfunc) + + self.assertPreciseEqual(cfunc(1, 2), 3) + self.assertPreciseEqual(cfunc(MyDummy2(), MyDummy2()), 42) + + # this will call add(Number, Number) as MyDummy implicitly casts to + # Number + self.assertPreciseEqual(cfunc(MyDummy(), MyDummy()), 84) + + def test_iadd_binop(self): + """ + Test re-implementing '+' for a custom type via @overload(operator.add). + """ + pyfunc = call_iadd_binop + cfunc = jit(nopython=True)(pyfunc) + + self.assertPreciseEqual(cfunc(1, 2), 3) + self.assertPreciseEqual(cfunc(MyDummy2(), MyDummy2()), 42) + + # this will call add(Number, Number) as MyDummy implicitly casts to + # Number + self.assertPreciseEqual(cfunc(MyDummy(), MyDummy()), 84) + + def test_delitem(self): + pyfunc = call_delitem + cfunc = jit(nopython=True)(pyfunc) + obj = MyDummy() + e = None + + with captured_stdout() as out: + try: + cfunc(obj, 321) + except Exception as exc: + e = exc + + if e is not None: + raise e + self.assertEqual(out.getvalue(), "del hello! 321\n") + + def test_getitem(self): + pyfunc = call_getitem + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(MyDummy(), 321), 321 + 123) + + def test_setitem(self): + pyfunc = call_setitem + cfunc = jit(nopython=True)(pyfunc) + obj = MyDummy() + e = None + + with captured_stdout() as out: + try: + cfunc(obj, 321, 123) + except Exception as exc: + e = exc + + if e is not None: + raise e + self.assertEqual(out.getvalue(), "321 123\n") + + def test_no_cpython_wrapper(self): + """ + Test overloading whose return value cannot be represented in CPython. + """ + # Test passing Module type from a @overload implementation to ensure + # that the *no_cpython_wrapper* flag works + ok_cfunc = jit(nopython=True)(non_boxable_ok_usecase) + n = 10 + got = ok_cfunc(n) + expect = non_boxable_ok_usecase(n) + np.testing.assert_equal(expect, got) + # Verify that the Module type cannot be returned to CPython + bad_cfunc = jit(nopython=True)(non_boxable_bad_usecase) + with self.assertRaises(TypeError) as raises: + bad_cfunc() + errmsg = str(raises.exception) + expectmsg = "cannot convert native Module" + self.assertIn(expectmsg, errmsg) + + def test_typing_vs_impl_signature_mismatch_handling(self): + """ + Tests that an overload which has a differing typing and implementing + signature raises an exception. + """ + + def gen_ol(impl=None): + def myoverload(a, b, c, kw=None): + pass + + @overload(myoverload) + def _myoverload_impl(a, b, c, kw=None): + return impl + + @jit(nopython=True) + def foo(a, b, c, d): + myoverload(a, b, c, kw=d) + + return foo + + sentinel = "Typing and implementation arguments differ in" + + # kwarg value is different + def impl1(a, b, c, kw=12): + if a > 10: + return 1 + else: + return -1 + + with self.assertRaises(errors.TypingError) as e: + gen_ol(impl1)(1, 2, 3, 4) + msg = str(e.exception) + self.assertIn(sentinel, msg) + self.assertIn("keyword argument default values", msg) + self.assertIn('', msg) + self.assertIn('', msg) + + # kwarg name is different + def impl2(a, b, c, kwarg=None): + if a > 10: + return 1 + else: + return -1 + + with self.assertRaises(errors.TypingError) as e: + gen_ol(impl2)(1, 2, 3, 4) + msg = str(e.exception) + self.assertIn(sentinel, msg) + self.assertIn("keyword argument names", msg) + self.assertIn('', msg) + self.assertIn('', msg) + + # arg name is different + def impl3(z, b, c, kw=None): + if a > 10: # noqa: F821 + return 1 + else: + return -1 + + with self.assertRaises(errors.TypingError) as e: + gen_ol(impl3)(1, 2, 3, 4) + msg = str(e.exception) + self.assertIn(sentinel, msg) + self.assertIn("argument names", msg) + self.assertFalse("keyword" in msg) + self.assertIn('', msg) + self.assertIn('', msg) + + from .overload_usecases import impl4, impl5 + + with self.assertRaises(errors.TypingError) as e: + gen_ol(impl4)(1, 2, 3, 4) + msg = str(e.exception) + self.assertIn(sentinel, msg) + self.assertIn("argument names", msg) + self.assertFalse("keyword" in msg) + self.assertIn("First difference: 'z'", msg) + + with self.assertRaises(errors.TypingError) as e: + gen_ol(impl5)(1, 2, 3, 4) + msg = str(e.exception) + self.assertIn(sentinel, msg) + self.assertIn("argument names", msg) + self.assertFalse("keyword" in msg) + self.assertIn('', msg) + self.assertIn('', msg) + + # too many args + def impl6(a, b, c, d, e, kw=None): + if a > 10: + return 1 + else: + return -1 + + with self.assertRaises(errors.TypingError) as e: + gen_ol(impl6)(1, 2, 3, 4) + msg = str(e.exception) + self.assertIn(sentinel, msg) + self.assertIn("argument names", msg) + self.assertFalse("keyword" in msg) + self.assertIn('', msg) + self.assertIn('', msg) + + # too few args + def impl7(a, b, kw=None): + if a > 10: + return 1 + else: + return -1 + + with self.assertRaises(errors.TypingError) as e: + gen_ol(impl7)(1, 2, 3, 4) + msg = str(e.exception) + self.assertIn(sentinel, msg) + self.assertIn("argument names", msg) + self.assertFalse("keyword" in msg) + self.assertIn('', msg) + + # too many kwargs + def impl8(a, b, c, kw=None, extra_kwarg=None): + if a > 10: + return 1 + else: + return -1 + + with self.assertRaises(errors.TypingError) as e: + gen_ol(impl8)(1, 2, 3, 4) + msg = str(e.exception) + self.assertIn(sentinel, msg) + self.assertIn("keyword argument names", msg) + self.assertIn('', msg) + + # too few kwargs + def impl9(a, b, c): + if a > 10: + return 1 + else: + return -1 + + with self.assertRaises(errors.TypingError) as e: + gen_ol(impl9)(1, 2, 3, 4) + msg = str(e.exception) + self.assertIn(sentinel, msg) + self.assertIn("keyword argument names", msg) + self.assertIn('', msg) + + def test_typing_vs_impl_signature_mismatch_handling_var_positional(self): + """ + Tests that an overload which has a differing typing and implementing + signature raises an exception and uses VAR_POSITIONAL (*args) in typing + """ + + def myoverload(a, kw=None): + pass + + from .overload_usecases import var_positional_impl + + overload(myoverload)(var_positional_impl) + + @jit(nopython=True) + def foo(a, b): + return myoverload(a, b, 9, kw=11) + + with self.assertRaises(errors.TypingError) as e: + foo(1, 5) + msg = str(e.exception) + self.assertIn("VAR_POSITIONAL (e.g. *args) argument kind", msg) + self.assertIn("offending argument name is '*star_args_token'", msg) + + def test_typing_vs_impl_signature_mismatch_handling_var_keyword(self): + """ + Tests that an overload which uses **kwargs (VAR_KEYWORD) + """ + + def gen_ol(impl, strict=True): + def myoverload(a, kw=None): + pass + + overload(myoverload, strict=strict)(impl) + + @jit(nopython=True) + def foo(a, b): + return myoverload(a, kw=11) + + return foo + + # **kwargs in typing + def ol1(a, **kws): + def impl(a, kw=10): + return a + + return impl + + gen_ol(ol1, False)(1, 2) # no error if strictness not enforced + with self.assertRaises(errors.TypingError) as e: + gen_ol(ol1)(1, 2) + msg = str(e.exception) + self.assertIn("use of VAR_KEYWORD (e.g. **kwargs) is unsupported", msg) + self.assertIn("offending argument name is '**kws'", msg) + + # **kwargs in implementation + def ol2(a, kw=0): + def impl(a, **kws): + return a + + return impl + + with self.assertRaises(errors.TypingError) as e: + gen_ol(ol2)(1, 2) + msg = str(e.exception) + self.assertIn("use of VAR_KEYWORD (e.g. **kwargs) is unsupported", msg) + self.assertIn("offending argument name is '**kws'", msg) + + def test_overload_method_kwargs(self): + # Issue #3489 + @overload_method(types.Array, "foo") + def fooimpl(arr, a_kwarg=10): + def impl(arr, a_kwarg=10): + return a_kwarg + + return impl + + @njit + def bar(A): + return A.foo(), A.foo(20), A.foo(a_kwarg=30) + + Z = np.arange(5) + + self.assertEqual(bar(Z), (10, 20, 30)) + + def test_overload_method_literal_unpack(self): + # Issue #3683 + @overload_method(types.Array, "litfoo") + def litfoo(arr, val): + # Must be an integer + if isinstance(val, types.Integer): + # Must not be literal + if not isinstance(val, types.Literal): + + def impl(arr, val): + return val + + return impl + + @njit + def bar(A): + return A.litfoo(0xCAFE) + + A = np.zeros(1) + bar(A) + self.assertEqual(bar(A), 0xCAFE) + + def test_overload_ufunc(self): + # Issue #4133. + # Use an extended type (MyDummyType) to use with a customized + # ufunc (np.exp). + @njit + def test(): + return np.exp(mydummy) + + self.assertEqual(test(), 0xDEADBEEF) + + def test_overload_method_stararg(self): + @overload_method(MyDummyType, "method_stararg") + def _ov_method_stararg(obj, val, val2, *args): + def get(obj, val, val2, *args): + return (val, val2, args) + + return get + + @njit + def foo(obj, *args): + # Test with expanding stararg + return obj.method_stararg(*args) + + obj = MyDummy() + self.assertEqual(foo(obj, 1, 2), (1, 2, ())) + self.assertEqual(foo(obj, 1, 2, 3), (1, 2, (3,))) + self.assertEqual(foo(obj, 1, 2, 3, 4), (1, 2, (3, 4))) + + @njit + def bar(obj): + # Test with explicit argument + return ( + obj.method_stararg(1, 2), + obj.method_stararg(1, 2, 3), + obj.method_stararg(1, 2, 3, 4), + ) + + self.assertEqual( + bar(obj), ((1, 2, ()), (1, 2, (3,)), (1, 2, (3, 4))), + ) + + # Check cases that put tuple type into stararg + # NOTE: the expected result has an extra tuple because of stararg. + self.assertEqual( + foo(obj, 1, 2, (3,)), (1, 2, ((3,),)), + ) + self.assertEqual( + foo(obj, 1, 2, (3, 4)), (1, 2, ((3, 4),)), + ) + self.assertEqual( + foo(obj, 1, 2, (3, (4, 5))), (1, 2, ((3, (4, 5)),)), + ) + + def test_overload_classmethod(self): + # Add classmethod to a subclass of Array + class MyArray(types.Array): + pass + + @overload_classmethod(MyArray, "array_alloc") + def ol_array_alloc(cls, nitems): + def impl(cls, nitems): + arr = np.arange(nitems) + return arr + return impl + + @njit + def foo(nitems): + return MyArray.array_alloc(nitems) + + nitems = 13 + self.assertPreciseEqual(foo(nitems), np.arange(nitems)) + + # Check that the base type doesn't get the classmethod + + @njit + def no_classmethod_in_base(nitems): + return types.Array.array_alloc(nitems) + + with self.assertRaises(errors.TypingError) as raises: + no_classmethod_in_base(nitems) + self.assertIn( + "Unknown attribute 'array_alloc' of", + str(raises.exception), + ) + + def test_overload_callable_typeref(self): + + @overload(CallableTypeRef) + def callable_type_call_ovld1(x): + if isinstance(x, types.Integer): + def impl(x): + return 42.5 + x + return impl + + @overload(CallableTypeRef) + def callable_type_call_ovld2(x): + if isinstance(x, types.UnicodeType): + def impl(x): + return '42.5' + x + + return impl + + @njit + def foo(a, b): + return MyClass(a), MyClass(b) + + args = (4, '4') + expected = (42.5 + args[0], '42.5' + args[1]) + self.assertPreciseEqual(foo(*args), expected) + + +def _assert_cache_stats(cfunc, expect_hit, expect_misses): + hit = cfunc._cache_hits[cfunc.signatures[0]] + if hit != expect_hit: + raise AssertionError("cache not used") + miss = cfunc._cache_misses[cfunc.signatures[0]] + if miss != expect_misses: + raise AssertionError("cache not used") + + +@skip_if_typeguard +class TestOverloadMethodCaching(TestCase): + # Nested multiprocessing.Pool raises AssertionError: + # "daemonic processes are not allowed to have children" + _numba_parallel_test_ = False + + def test_caching_overload_method(self): + self._cache_dir = temp_directory(self.__class__.__name__) + with override_config("CACHE_DIR", self._cache_dir): + self.run_caching_overload_method() + + def run_caching_overload_method(self): + cfunc = jit(nopython=True, cache=True)(cache_overload_method_usecase) + self.assertPreciseEqual(cfunc(MyDummy()), 13) + _assert_cache_stats(cfunc, 0, 1) + llvmir = cfunc.inspect_llvm((mydummy_type,)) + # Ensure the inner method is not a declaration + decls = [ + ln + for ln in llvmir.splitlines() + if ln.startswith("declare") and "overload_method_length" in ln + ] + self.assertEqual(len(decls), 0) + # Test in a separate process + try: + ctx = multiprocessing.get_context("spawn") + except AttributeError: + ctx = multiprocessing + q = ctx.Queue() + p = ctx.Process( + target=run_caching_overload_method, args=(q, self._cache_dir) + ) + p.start() + q.put(MyDummy()) + p.join() + # Ensure subprocess exited normally + self.assertEqual(p.exitcode, 0) + res = q.get(timeout=1) + self.assertEqual(res, 13) + + +def run_caching_overload_method(q, cache_dir): + """ + Used by TestOverloadMethodCaching.test_caching_overload_method + """ + with override_config("CACHE_DIR", cache_dir): + arg = q.get() + cfunc = jit(nopython=True, cache=True)(cache_overload_method_usecase) + res = cfunc(arg) + q.put(res) + # Check cache stat + _assert_cache_stats(cfunc, 1, 0) + + +class TestIntrinsic(TestCase): + def test_void_return(self): + """ + Verify that returning a None from codegen function is handled + automatically for void functions, otherwise raise exception. + """ + + @intrinsic + def void_func(typingctx, a): + sig = types.void(types.int32) + + def codegen(context, builder, signature, args): + pass # do nothing, return None, should be turned into + # dummy value + + return sig, codegen + + @intrinsic + def non_void_func(typingctx, a): + sig = types.int32(types.int32) + + def codegen(context, builder, signature, args): + pass # oops, should be returning a value here, raise exception + + return sig, codegen + + @jit(nopython=True) + def call_void_func(): + void_func(1) + return 0 + + @jit(nopython=True) + def call_non_void_func(): + non_void_func(1) + return 0 + + # void func should work + self.assertEqual(call_void_func(), 0) + # not void function should raise exception + with self.assertRaises(LoweringError) as e: + call_non_void_func() + self.assertIn("non-void function returns None", e.exception.msg) + + def test_ll_pointer_cast(self): + """ + Usecase test: custom reinterpret cast to turn int values to pointers + """ + from ctypes import CFUNCTYPE, POINTER, c_float, c_int + + # Use intrinsic to make a reinterpret_cast operation + def unsafe_caster(result_type): + assert isinstance(result_type, types.CPointer) + + @intrinsic + def unsafe_cast(typingctx, src): + self.assertIsInstance(typingctx, typing.Context) + if isinstance(src, types.Integer): + sig = result_type(types.uintp) + + # defines the custom code generation + def codegen(context, builder, signature, args): + [src] = args + rtype = signature.return_type + llrtype = context.get_value_type(rtype) + return builder.inttoptr(src, llrtype) + + return sig, codegen + + return unsafe_cast + + # make a nopython function to use our cast op. + # this is not usable from cpython due to the returning of a pointer. + def unsafe_get_ctypes_pointer(src): + raise NotImplementedError("not callable from python") + + @overload(unsafe_get_ctypes_pointer, strict=False) + def array_impl_unsafe_get_ctypes_pointer(arrtype): + if isinstance(arrtype, types.Array): + unsafe_cast = unsafe_caster(types.CPointer(arrtype.dtype)) + + def array_impl(arr): + return unsafe_cast(src=arr.ctypes.data) + + return array_impl + + # the ctype wrapped function for use in nopython mode + def my_c_fun_raw(ptr, n): + for i in range(n): + print(ptr[i]) + + prototype = CFUNCTYPE(None, POINTER(c_float), c_int) + my_c_fun = prototype(my_c_fun_raw) + + # Call our pointer-cast in a @jit compiled function and use + # the pointer in a ctypes function + @jit(nopython=True) + def foo(arr): + ptr = unsafe_get_ctypes_pointer(arr) + my_c_fun(ptr, arr.size) + + # Test + arr = np.arange(10, dtype=np.float32) + with captured_stdout() as buf: + foo(arr) + got = buf.getvalue().splitlines() + buf.close() + expect = list(map(str, arr)) + self.assertEqual(expect, got) + + def test_serialization(self): + """ + Test serialization of intrinsic objects + """ + # define a intrinsic + @intrinsic + def identity(context, x): + def codegen(context, builder, signature, args): + return args[0] + + sig = x(x) + return sig, codegen + + # use in a jit function + @jit(nopython=True) + def foo(x): + return identity(x) + + self.assertEqual(foo(1), 1) + + # get serialization memo + memo = _Intrinsic._memo + memo_size = len(memo) + + # pickle foo and check memo size + serialized_foo = pickle.dumps(foo) + # increases the memo size + memo_size += 1 + self.assertEqual(memo_size, len(memo)) + # unpickle + foo_rebuilt = pickle.loads(serialized_foo) + self.assertEqual(memo_size, len(memo)) + # check rebuilt foo + self.assertEqual(foo(1), foo_rebuilt(1)) + + # pickle identity directly + serialized_identity = pickle.dumps(identity) + # memo size unchanged + self.assertEqual(memo_size, len(memo)) + # unpickle + identity_rebuilt = pickle.loads(serialized_identity) + # must be the same object + self.assertIs(identity, identity_rebuilt) + # memo size unchanged + self.assertEqual(memo_size, len(memo)) + + def test_deserialization(self): + """ + Test deserialization of intrinsic + """ + + def defn(context, x): + def codegen(context, builder, signature, args): + return args[0] + + return x(x), codegen + + memo = _Intrinsic._memo + memo_size = len(memo) + # invoke _Intrinsic indirectly to avoid registration which keeps an + # internal reference inside the compiler + original = _Intrinsic("foo", defn) + self.assertIs(original._defn, defn) + pickled = pickle.dumps(original) + # by pickling, a new memo entry is created + memo_size += 1 + self.assertEqual(memo_size, len(memo)) + del original # remove original before unpickling + + # by deleting, the memo entry is NOT removed due to recent + # function queue + self.assertEqual(memo_size, len(memo)) + + # Manually force clear of _recent queue + _Intrinsic._recent.clear() + memo_size -= 1 + self.assertEqual(memo_size, len(memo)) + + rebuilt = pickle.loads(pickled) + # verify that the rebuilt object is different + self.assertIsNot(rebuilt._defn, defn) + + # the second rebuilt object is the same as the first + second = pickle.loads(pickled) + self.assertIs(rebuilt._defn, second._defn) + + def test_docstring(self): + + @intrinsic + def void_func(typingctx, a: int): + """void_func docstring""" + sig = types.void(types.int32) + + def codegen(context, builder, signature, args): + pass # do nothing, return None, should be turned into + # dummy value + + return sig, codegen + + self.assertEqual("numba.tests.test_extending", void_func.__module__) + self.assertEqual("void_func", void_func.__name__) + self.assertEqual("TestIntrinsic.test_docstring..void_func", + void_func.__qualname__) + self.assertDictEqual({'a': int}, void_func.__annotations__) + self.assertEqual("void_func docstring", void_func.__doc__) + + +class TestRegisterJitable(unittest.TestCase): + def test_no_flags(self): + @register_jitable + def foo(x, y): + return x + y + + def bar(x, y): + return foo(x, y) + + cbar = jit(nopython=True)(bar) + + expect = bar(1, 2) + got = cbar(1, 2) + self.assertEqual(expect, got) + + def test_flags_no_nrt(self): + @register_jitable(_nrt=False) + def foo(n): + return np.arange(n) + + def bar(n): + return foo(n) + + self.assertEqual(bar(3).tolist(), [0, 1, 2]) + + cbar = jit(nopython=True)(bar) + with self.assertRaises(errors.TypingError) as raises: + cbar(2) + msg = ( + "Only accept returning of array passed into the function as " + "argument" + ) + self.assertIn(msg, str(raises.exception)) + + +class TestImportCythonFunction(unittest.TestCase): + @unittest.skipIf(sc is None, "Only run if SciPy >= 0.19 is installed") + def test_getting_function(self): + addr = get_cython_function_address( + "scipy.special.cython_special", "j0" + ) + functype = ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_double) + _j0 = functype(addr) + j0 = jit(nopython=True)(lambda x: _j0(x)) + self.assertEqual(j0(0), 1) + + def test_missing_module(self): + with self.assertRaises(ImportError) as raises: + get_cython_function_address("fakemodule", "fakefunction") + # The quotes are not there in Python 2 + msg = "No module named '?fakemodule'?" + match = re.match(msg, str(raises.exception)) + self.assertIsNotNone(match) + + @unittest.skipIf(sc is None, "Only run if SciPy >= 0.19 is installed") + def test_missing_function(self): + with self.assertRaises(ValueError) as raises: + get_cython_function_address( + "scipy.special.cython_special", "foo" + ) + msg = ( + "No function 'foo' found in __pyx_capi__ of " + "'scipy.special.cython_special'" + ) + self.assertEqual(msg, str(raises.exception)) + + +@overload_method( + MyDummyType, "method_jit_option_check_nrt", jit_options={"_nrt": True} +) +def ov_method_jit_option_check_nrt(obj): + def imp(obj): + return np.arange(10) + + return imp + + +@overload_method( + MyDummyType, "method_jit_option_check_no_nrt", jit_options={"_nrt": False} +) +def ov_method_jit_option_check_no_nrt(obj): + def imp(obj): + return np.arange(10) + + return imp + + +@overload_attribute( + MyDummyType, "attr_jit_option_check_nrt", jit_options={"_nrt": True} +) +def ov_attr_jit_option_check_nrt(obj): + def imp(obj): + return np.arange(10) + + return imp + + +@overload_attribute( + MyDummyType, "attr_jit_option_check_no_nrt", jit_options={"_nrt": False} +) +def ov_attr_jit_option_check_no_nrt(obj): + def imp(obj): + return np.arange(10) + + return imp + + +class TestJitOptionsNoNRT(TestCase): + # Test overload*(jit_options={...}) by turning off _nrt + + def check_error_no_nrt(self, func, *args, **kwargs): + # Check that the compilation fails with a complaint about dynamic array + msg = ( + "Only accept returning of array passed into " + "the function as argument" + ) + with self.assertRaises(errors.TypingError) as raises: + func(*args, **kwargs) + self.assertIn(msg, str(raises.exception)) + + def no_nrt_overload_check(self, flag): + def dummy(): + return np.arange(10) + + @overload(dummy, jit_options={"_nrt": flag}) + def ov_dummy(): + def dummy(): + return np.arange(10) + + return dummy + + @njit + def foo(): + return dummy() + + if flag: + self.assertPreciseEqual(foo(), np.arange(10)) + else: + self.check_error_no_nrt(foo) + + def test_overload_no_nrt(self): + self.no_nrt_overload_check(True) + self.no_nrt_overload_check(False) + + def test_overload_method_no_nrt(self): + @njit + def udt(x): + return x.method_jit_option_check_nrt() + + self.assertPreciseEqual(udt(mydummy), np.arange(10)) + + @njit + def udt(x): + return x.method_jit_option_check_no_nrt() + + self.check_error_no_nrt(udt, mydummy) + + def test_overload_attribute_no_nrt(self): + @njit + def udt(x): + return x.attr_jit_option_check_nrt + + self.assertPreciseEqual(udt(mydummy), np.arange(10)) + + @njit + def udt(x): + return x.attr_jit_option_check_no_nrt + + self.check_error_no_nrt(udt, mydummy) + + +class TestBoxingCallingJIT(TestCase): + def setUp(self): + super().setUp() + many = base_dummy_type_factory("mydummy2") + self.DynTypeType, self.DynType, self.dyn_type_type = many + self.dyn_type = self.DynType() + + def test_unboxer_basic(self): + # Implements an unboxer on DynType that calls an intrinsic into the + # unboxer code. + magic_token = 0xCAFE + magic_offset = 123 + + @intrinsic + def my_intrinsic(typingctx, val): + # An intrinsic that returns `val + magic_offset` + def impl(context, builder, sig, args): + [val] = args + return builder.add(val, val.type(magic_offset)) + + sig = signature(val, val) + return sig, impl + + @unbox(self.DynTypeType) + def unboxer(typ, obj, c): + # The unboxer that calls some jitcode + def bridge(x): + # proof that this is a jit'ed context by calling jit only + # intrinsic + return my_intrinsic(x) + + args = [c.context.get_constant(types.intp, magic_token)] + sig = signature(types.voidptr, types.intp) + is_error, res = c.pyapi.call_jit_code(bridge, sig, args) + return NativeValue(res, is_error=is_error) + + @box(self.DynTypeType) + def boxer(typ, val, c): + # The boxer that returns an integer representation + res = c.builder.ptrtoint(val, cgutils.intp_t) + return c.pyapi.long_from_ssize_t(res) + + @njit + def passthru(x): + return x + + out = passthru(self.dyn_type) + self.assertEqual(out, magic_token + magic_offset) + + def test_unboxer_raise(self): + # Testing exception raising in jitcode called from unboxing. + @unbox(self.DynTypeType) + def unboxer(typ, obj, c): + # The unboxer that calls some jitcode + def bridge(x): + if x > 0: + raise ValueError("cannot be x > 0") + return x + + args = [c.context.get_constant(types.intp, 1)] + sig = signature(types.voidptr, types.intp) + is_error, res = c.pyapi.call_jit_code(bridge, sig, args) + return NativeValue(res, is_error=is_error) + + @box(self.DynTypeType) + def boxer(typ, val, c): + # The boxer that returns an integer representation + res = c.builder.ptrtoint(val, cgutils.intp_t) + return c.pyapi.long_from_ssize_t(res) + + @njit + def passthru(x): + return x + + with self.assertRaises(ValueError) as raises: + passthru(self.dyn_type) + self.assertIn( + "cannot be x > 0", str(raises.exception), + ) + + def test_boxer(self): + # Call jitcode inside the boxer + magic_token = 0xCAFE + magic_offset = 312 + + @intrinsic + def my_intrinsic(typingctx, val): + # An intrinsic that returns `val + magic_offset` + def impl(context, builder, sig, args): + [val] = args + return builder.add(val, val.type(magic_offset)) + + sig = signature(val, val) + return sig, impl + + @unbox(self.DynTypeType) + def unboxer(typ, obj, c): + return NativeValue(c.context.get_dummy_value()) + + @box(self.DynTypeType) + def boxer(typ, val, c): + # Note: this doesn't do proper error handling + def bridge(x): + return my_intrinsic(x) + + args = [c.context.get_constant(types.intp, magic_token)] + sig = signature(types.intp, types.intp) + is_error, res = c.pyapi.call_jit_code(bridge, sig, args) + return c.pyapi.long_from_ssize_t(res) + + @njit + def passthru(x): + return x + + r = passthru(self.dyn_type) + self.assertEqual(r, magic_token + magic_offset) + + def test_boxer_raise(self): + # Call jitcode inside the boxer + @unbox(self.DynTypeType) + def unboxer(typ, obj, c): + return NativeValue(c.context.get_dummy_value()) + + @box(self.DynTypeType) + def boxer(typ, val, c): + def bridge(x): + if x > 0: + raise ValueError("cannot do x > 0") + return x + + args = [c.context.get_constant(types.intp, 1)] + sig = signature(types.intp, types.intp) + is_error, res = c.pyapi.call_jit_code(bridge, sig, args) + # The error handling + retval = cgutils.alloca_once(c.builder, c.pyapi.pyobj, zfill=True) + with c.builder.if_then(c.builder.not_(is_error)): + obj = c.pyapi.long_from_ssize_t(res) + c.builder.store(obj, retval) + return c.builder.load(retval) + + @njit + def passthru(x): + return x + + with self.assertRaises(ValueError) as raises: + passthru(self.dyn_type) + self.assertIn( + "cannot do x > 0", str(raises.exception), + ) + + +def with_objmode_cache_ov_example(x): + # This is the function stub for overloading inside + # TestCachingOverloadObjmode.test_caching_overload_objmode + pass + + +@skip_if_typeguard +class TestCachingOverloadObjmode(TestCase): + """Test caching of the use of overload implementations that use + `with objmode` + """ + _numba_parallel_test_ = False + + def setUp(self): + warnings.simplefilter("error", errors.NumbaWarning) + + def tearDown(self): + warnings.resetwarnings() + + def test_caching_overload_objmode(self): + cache_dir = temp_directory(self.__class__.__name__) + with override_config("CACHE_DIR", cache_dir): + + def realwork(x): + # uses numpy code + arr = np.arange(x) / x + return np.linalg.norm(arr) + + def python_code(x): + # create indirections + return realwork(x) + + @overload(with_objmode_cache_ov_example) + def _ov_with_objmode_cache_ov_example(x): + def impl(x): + with objmode(y="float64"): + y = python_code(x) + return y + + return impl + + @njit(cache=True) + def testcase(x): + return with_objmode_cache_ov_example(x) + + expect = realwork(123) + got = testcase(123) + self.assertEqual(got, expect) + + testcase_cached = njit(cache=True)(testcase.py_func) + got = testcase_cached(123) + self.assertEqual(got, expect) + + @classmethod + def check_objmode_cache_ndarray(cls): + def do_this(a, b): + return np.sum(a + b) + + def do_something(a, b): + return np.sum(a + b) + + @overload(do_something) + def overload_do_something(a, b): + def _do_something_impl(a, b): + with objmode(y='float64'): + y = do_this(a, b) + return y + return _do_something_impl + + @njit(cache=True) + def test_caching(): + a = np.arange(20) + b = np.arange(20) + return do_something(a, b) + + got = test_caching() + expect = test_caching.py_func() + + # Check result + if got != expect: + raise AssertionError("incorrect result") + return test_caching + + @classmethod + def populate_objmode_cache_ndarray_check_cache(cls): + cls.check_objmode_cache_ndarray() + + @classmethod + def check_objmode_cache_ndarray_check_cache(cls): + disp = cls.check_objmode_cache_ndarray() + if len(disp.stats.cache_misses) != 0: + raise AssertionError('unexpected cache miss') + if len(disp.stats.cache_hits) <= 0: + raise AssertionError("unexpected missing cache hit") + + def test_check_objmode_cache_ndarray(self): + # See issue #6130. + # Env is missing after cache load. + cache_dir = temp_directory(self.__class__.__name__) + with override_config("CACHE_DIR", cache_dir): + # Run in new process to populate the cache + run_in_new_process_in_cache_dir( + self.populate_objmode_cache_ndarray_check_cache, cache_dir + ) + # Run in new process to use the cache in a fresh process. + res = run_in_new_process_in_cache_dir( + self.check_objmode_cache_ndarray_check_cache, cache_dir + ) + self.assertEqual(res['exitcode'], 0) + + +class TestMisc(TestCase): + def test_is_jitted(self): + def foo(x): + pass + + self.assertFalse(is_jitted(foo)) + self.assertTrue(is_jitted(njit(foo))) + self.assertFalse(is_jitted(vectorize(foo))) + self.assertFalse(is_jitted(vectorize(parallel=True)(foo))) + self.assertFalse( + is_jitted(guvectorize("void(float64[:])", "(m)")(foo)) + ) + + def test_overload_arg_binding(self): + # See issue #7982, checks that calling a function with named args works + # correctly irrespective of the order in which the names are supplied. + @njit + def standard_order(): + return np.full(shape=123, fill_value=456).shape + + @njit + def reversed_order(): + return np.full(fill_value=456, shape=123).shape + + self.assertPreciseEqual(standard_order(), standard_order.py_func()) + self.assertPreciseEqual(reversed_order(), reversed_order.py_func()) + + +class TestOverloadPreferLiteral(TestCase): + def test_overload(self): + def prefer_lit(x): + pass + + def non_lit(x): + pass + + def ov(x): + if isinstance(x, types.IntegerLiteral): + # With prefer_literal=False, this branch will not be reached. + if x.literal_value == 1: + def impl(x): + return 0xcafe + return impl + else: + raise errors.TypingError('literal value') + else: + def impl(x): + return x * 100 + return impl + + overload(prefer_lit, prefer_literal=True)(ov) + overload(non_lit)(ov) + + @njit + def check_prefer_lit(x): + return prefer_lit(1), prefer_lit(2), prefer_lit(x) + + a, b, c = check_prefer_lit(3) + self.assertEqual(a, 0xcafe) + self.assertEqual(b, 200) + self.assertEqual(c, 300) + + @njit + def check_non_lit(x): + return non_lit(1), non_lit(2), non_lit(x) + + a, b, c = check_non_lit(3) + self.assertEqual(a, 100) + self.assertEqual(b, 200) + self.assertEqual(c, 300) + + def test_overload_method(self): + def ov(self, x): + if isinstance(x, types.IntegerLiteral): + # With prefer_literal=False, this branch will not be reached. + if x.literal_value == 1: + def impl(self, x): + return 0xcafe + return impl + else: + raise errors.TypingError('literal value') + else: + def impl(self, x): + return x * 100 + return impl + + overload_method( + MyDummyType, "method_prefer_literal", + prefer_literal=True, + )(ov) + + overload_method( + MyDummyType, "method_non_literal", + prefer_literal=False, + )(ov) + + @njit + def check_prefer_lit(dummy, x): + return ( + dummy.method_prefer_literal(1), + dummy.method_prefer_literal(2), + dummy.method_prefer_literal(x), + ) + + a, b, c = check_prefer_lit(MyDummy(), 3) + self.assertEqual(a, 0xcafe) + self.assertEqual(b, 200) + self.assertEqual(c, 300) + + @njit + def check_non_lit(dummy, x): + return ( + dummy.method_non_literal(1), + dummy.method_non_literal(2), + dummy.method_non_literal(x), + ) + + a, b, c = check_non_lit(MyDummy(), 3) + self.assertEqual(a, 100) + self.assertEqual(b, 200) + self.assertEqual(c, 300) + + +class TestIntrinsicPreferLiteral(TestCase): + def test_intrinsic(self): + def intrin(context, x): + # This intrinsic will return 0xcafe if `x` is a literal `1`. + sig = signature(types.intp, x) + if isinstance(x, types.IntegerLiteral): + # With prefer_literal=False, this branch will not be reached + if x.literal_value == 1: + def codegen(context, builder, signature, args): + atype = signature.args[0] + llrtype = context.get_value_type(atype) + return ir.Constant(llrtype, 0xcafe) + return sig, codegen + else: + raise errors.TypingError('literal value') + else: + def codegen(context, builder, signature, args): + atype = signature.return_type + llrtype = context.get_value_type(atype) + int_100 = ir.Constant(llrtype, 100) + return builder.mul(args[0], int_100) + return sig, codegen + + prefer_lit = intrinsic(prefer_literal=True)(intrin) + non_lit = intrinsic(prefer_literal=False)(intrin) + + @njit + def check_prefer_lit(x): + return prefer_lit(1), prefer_lit(2), prefer_lit(x) + + a, b, c = check_prefer_lit(3) + self.assertEqual(a, 0xcafe) + self.assertEqual(b, 200) + self.assertEqual(c, 300) + + @njit + def check_non_lit(x): + return non_lit(1), non_lit(2), non_lit(x) + + a, b, c = check_non_lit(3) + self.assertEqual(a, 100) + self.assertEqual(b, 200) + self.assertEqual(c, 300) + + +class TestNumbaInternalOverloads(TestCase): + + def test_signatures_match_overloaded_api(self): + # This is a "best-effort" test to try and ensure that Numba's internal + # overload declarations have signatures with argument names that match + # the API they are overloading. The purpose of ensuring there is a + # match is so that users can use call-by-name for positional arguments. + + # Set this to: + # 0 to make violations raise a ValueError (default). + # 1 to get violations reported to STDOUT + # 2 to get a verbose output of everything that was checked and its state + # reported to STDOUT. + DEBUG = 0 + + # np.random.* does not have a signature exposed to `inspect`... so + # custom parse the docstrings. + def sig_from_np_random(x): + if not x.startswith('_'): + thing = getattr(np.random, x) + if inspect.isbuiltin(thing): + docstr = thing.__doc__.splitlines() + for l in docstr: + if l: + sl = l.strip() + if sl.startswith(x): # its the signature + # special case np.random.seed, it has `self` in + # the signature whereas all the other functions + # do not!? + if x == "seed": + sl = "seed(seed)" + + fake_impl = f"def {sl}:\n\tpass" + l = {} + try: + exec(fake_impl, {}, l) + except SyntaxError: + # likely elipsis, e.g. rand(d0, d1, ..., dn) + if DEBUG == 2: + print("... skipped as cannot parse " + "signature") + return None + else: + fn = l.get(x) + return inspect.signature(fn) + + def checker(func, overload_func): + if DEBUG == 2: + print(f"Checking: {func}") + + def create_message(func, overload_func, func_sig, ol_sig): + msg = [] + s = (f"{func} from module '{getattr(func, '__module__')}' " + "has mismatched sig.") + msg.append(s) + msg.append(f" - expected: {func_sig}") + msg.append(f" - got: {ol_sig}") + lineno = inspect.getsourcelines(overload_func)[1] + tmpsrcfile = inspect.getfile(overload_func) + srcfile = tmpsrcfile.replace(numba.__path__[0], '') + msg.append(f"from {srcfile}:{lineno}") + msgstr = '\n' + '\n'.join(msg) + return msgstr + + func_sig = None + try: + func_sig = inspect.signature(func) + except ValueError: + # probably a built-in/C code, see if it's a np.random function + if fname := getattr(func, '__name__', False): + if maybe_func := getattr(np.random, fname, False): + if maybe_func == func: + # it's a built-in from np.random + func_sig = sig_from_np_random(fname) + + if func_sig is not None: + ol_sig = inspect.signature(overload_func) + x = list(func_sig.parameters.keys()) + y = list(ol_sig.parameters.keys()) + for a, b in zip(x[:len(y)], y): + if a != b: + p = func_sig.parameters[a] + if p.kind == p.POSITIONAL_ONLY: + # probably a built-in/C code + if DEBUG == 2: + print("... skipped as positional only " + "arguments found") + break + elif '*' in str(p): # probably *args or similar + if DEBUG == 2: + print("... skipped as contains *args") + break + else: + # Only error/report on functions that have a module + # or are from somewhere other than Numba. + if (not func.__module__ or + not func.__module__.startswith("numba")): + msgstr = create_message(func, overload_func, + func_sig, ol_sig) + if DEBUG != 0: + if DEBUG == 2: + print("... INVALID") + if msgstr: + print(msgstr) + break + else: + raise ValueError(msgstr) + else: + if DEBUG == 2: + if not func.__module__: + print("... skipped as no __module__ " + "present") + else: + print("... skipped as Numba internal") + break + else: + if DEBUG == 2: + print("... OK") + + # Compile something to make sure that the typing context registries + # are populated with everything from the CPU target. + njit(lambda : None).compile(()) + tyctx = numba.core.typing.context.Context() + tyctx.refresh() + + # Walk the registries and check each function that is an overload + regs = tyctx._registries + for k, v in regs.items(): + for item in k.functions: + if getattr(item, '_overload_func', False): + checker(item.key, item._overload_func) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_extending_types.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_extending_types.py new file mode 100644 index 0000000000000000000000000000000000000000..540472e37a01d799f7a7e318c63ed69be167ea54 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_extending_types.py @@ -0,0 +1,170 @@ +""" +Test extending types via the numba.extending.* API. +""" +import operator + +from numba import njit, literally +from numba.core import types, cgutils +from numba.core.errors import TypingError, NumbaTypeError +from numba.core.extending import lower_builtin +from numba.core.extending import models, register_model +from numba.core.extending import make_attribute_wrapper +from numba.core.extending import type_callable +from numba.core.extending import overload +from numba.core.extending import typeof_impl + +import unittest + + +def gen_mock_float(): + # Stub to overload, pretending to be `float`. The real `float` function is + # not used as multiple registrations can collide. + def mock_float(x): + pass + return mock_float + + +class TestExtTypDummy(unittest.TestCase): + + def setUp(self): + class Dummy(object): + def __init__(self, value): + self.value = value + + class DummyType(types.Type): + def __init__(self): + super(DummyType, self).__init__(name='Dummy') + + dummy_type = DummyType() + + @register_model(DummyType) + class DummyModel(models.StructModel): + def __init__(self, dmm, fe_type): + members = [ + ('value', types.intp), + ] + models.StructModel.__init__(self, dmm, fe_type, members) + + make_attribute_wrapper(DummyType, 'value', 'value') + + @type_callable(Dummy) + def type_dummy(context): + def typer(value): + return dummy_type + return typer + + @lower_builtin(Dummy, types.intp) + def impl_dummy(context, builder, sig, args): + typ = sig.return_type + [value] = args + dummy = cgutils.create_struct_proxy(typ)(context, builder) + dummy.value = value + return dummy._getvalue() + + @typeof_impl.register(Dummy) + def typeof_dummy(val, c): + return DummyType() + + # Store attributes + self.Dummy = Dummy + self.DummyType = DummyType + + def _add_float_overload(self, mock_float_inst): + @overload(mock_float_inst) + def dummy_to_float(x): + if isinstance(x, self.DummyType): + def codegen(x): + return float(x.value) + return codegen + else: + raise NumbaTypeError('cannot type float({})'.format(x)) + + def test_overload_float(self): + mock_float = gen_mock_float() + self._add_float_overload(mock_float) + Dummy = self.Dummy + + @njit + def foo(x): + return mock_float(Dummy(x)) + + self.assertEqual(foo(123), float(123)) + + def test_overload_float_error_msg(self): + mock_float = gen_mock_float() + self._add_float_overload(mock_float) + + @njit + def foo(x): + return mock_float(x) + + with self.assertRaises(TypingError) as raises: + foo(1j) + + self.assertIn("cannot type float(complex128)", + str(raises.exception)) + + def test_unboxing(self): + """A test for the unboxing logic on unknown type + """ + Dummy = self.Dummy + + @njit + def foo(x): + # pass a dummy object into another function + bar(Dummy(x)) + + # make sure a cpython wrapper is created + @njit(no_cpython_wrapper=False) + def bar(dummy_obj): + pass + + foo(123) + with self.assertRaises(TypeError) as raises: + bar(Dummy(123)) + self.assertIn("can't unbox Dummy type", str(raises.exception)) + + def test_boxing(self): + """A test for the boxing logic on unknown type + """ + Dummy = self.Dummy + + @njit + def foo(x): + return Dummy(x) + + with self.assertRaises(TypeError) as raises: + foo(123) + self.assertIn("cannot convert native Dummy to Python object", + str(raises.exception)) + + def test_issue5565_literal_getitem(self): + # the following test is adapted from + # https://github.com/numba/numba/issues/5565 + Dummy, DummyType = self.Dummy, self.DummyType + + MAGIC_NUMBER = 12321 + + @overload(operator.getitem) + def dummy_getitem_ovld(self, idx): + if not isinstance(self, DummyType): + return None + # suppose we can only support idx as literal argument + if isinstance(idx, types.StringLiteral): + def dummy_getitem_impl(self, idx): + return MAGIC_NUMBER + return dummy_getitem_impl + + if isinstance(idx, types.UnicodeType): + def dummy_getitem_impl(self, idx): + return literally(idx) + return dummy_getitem_impl + + return None + + @njit + def test_impl(x, y): + return Dummy(x)[y] + + var = 'abc' + self.assertEqual(test_impl(1, var), MAGIC_NUMBER) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_fancy_indexing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_fancy_indexing.py new file mode 100644 index 0000000000000000000000000000000000000000..aad68349e8b058ab9285eec5a05893a80471d52d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_fancy_indexing.py @@ -0,0 +1,547 @@ +import collections +import itertools + +import numpy as np + +import unittest +from numba import jit, typeof, njit +from numba.core import types +from numba.core.errors import TypingError +from numba.tests.support import MemoryLeakMixin, TestCase + + +def getitem_usecase(a, b): + return a[b] + +def setitem_usecase(a, idx, b): + a[idx] = b + +def np_take(A, indices): + return np.take(A, indices) + +def np_take_kws(A, indices, axis): + return np.take(A, indices, axis=axis) + +class TestFancyIndexing(MemoryLeakMixin, TestCase): + + def generate_advanced_indices(self, N, many=True): + choices = [np.int16([0, N - 1, -2])] + if many: + choices += [np.uint16([0, 1, N - 1]), + np.bool_([0, 1, 1, 0])] + return choices + + def generate_basic_index_tuples(self, N, maxdim, many=True): + """ + Generate basic index tuples with 0 to *maxdim* items. + """ + # Note integers can be considered advanced indices in certain + # cases, so we avoid them here. + # See "Combining advanced and basic indexing" + # in http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html + if many: + choices = [slice(None, None, None), + slice(1, N - 1, None), + slice(0, None, 2), + slice(N - 1, None, -2), + slice(-N + 1, -1, None), + slice(-1, -N, -2), + ] + else: + choices = [slice(0, N - 1, None), + slice(-1, -N, -2)] + for ndim in range(maxdim + 1): + for tup in itertools.product(choices, repeat=ndim): + yield tup + + def generate_advanced_index_tuples(self, N, maxdim, many=True): + """ + Generate advanced index tuples by generating basic index tuples + and adding a single advanced index item. + """ + # (Note Numba doesn't support advanced indices with more than + # one advanced index array at the moment) + choices = list(self.generate_advanced_indices(N, many=many)) + for i in range(maxdim + 1): + for tup in self.generate_basic_index_tuples(N, maxdim - 1, many): + for adv in choices: + yield tup[:i] + (adv,) + tup[i:] + + def generate_advanced_index_tuples_with_ellipsis(self, N, maxdim, many=True): + """ + Same as generate_advanced_index_tuples(), but also insert an + ellipsis at various points. + """ + for tup in self.generate_advanced_index_tuples(N, maxdim, many): + for i in range(len(tup) + 1): + yield tup[:i] + (Ellipsis,) + tup[i:] + + def check_getitem_indices(self, arr, indices): + pyfunc = getitem_usecase + cfunc = jit(nopython=True)(pyfunc) + orig = arr.copy() + orig_base = arr.base or arr + + for index in indices: + expected = pyfunc(arr, index) + # Sanity check: if a copy wasn't made, this wasn't advanced + # but basic indexing, and shouldn't be tested here. + assert expected.base is not orig_base + got = cfunc(arr, index) + # Note Numba may not return the same array strides and + # contiguity as Numpy + self.assertEqual(got.shape, expected.shape) + self.assertEqual(got.dtype, expected.dtype) + np.testing.assert_equal(got, expected) + # Check a copy was *really* returned by Numba + if got.size: + got.fill(42) + np.testing.assert_equal(arr, orig) + + def test_getitem_tuple(self): + # Test many variations of advanced indexing with a tuple index + N = 4 + ndim = 3 + arr = np.arange(N ** ndim).reshape((N,) * ndim).astype(np.int32) + indices = self.generate_advanced_index_tuples(N, ndim) + + self.check_getitem_indices(arr, indices) + + def test_getitem_tuple_and_ellipsis(self): + # Same, but also insert an ellipsis at a random point + N = 4 + ndim = 3 + arr = np.arange(N ** ndim).reshape((N,) * ndim).astype(np.int32) + indices = self.generate_advanced_index_tuples_with_ellipsis(N, ndim, + many=False) + + self.check_getitem_indices(arr, indices) + + def test_ellipsis_getsetitem(self): + # See https://github.com/numba/numba/issues/3225 + @jit(nopython=True) + def foo(arr, v): + arr[..., 0] = arr[..., 1] + + arr = np.arange(2) + foo(arr, 1) + self.assertEqual(arr[0], arr[1]) + + def test_getitem_array(self): + # Test advanced indexing with a single array index + N = 4 + ndim = 3 + arr = np.arange(N ** ndim).reshape((N,) * ndim).astype(np.int32) + indices = self.generate_advanced_indices(N) + self.check_getitem_indices(arr, indices) + + def check_setitem_indices(self, arr, indices): + pyfunc = setitem_usecase + cfunc = jit(nopython=True)(pyfunc) + + for index in indices: + src = arr[index] + expected = np.zeros_like(arr) + got = np.zeros_like(arr) + pyfunc(expected, index, src) + cfunc(got, index, src) + # Note Numba may not return the same array strides and + # contiguity as Numpy + self.assertEqual(got.shape, expected.shape) + self.assertEqual(got.dtype, expected.dtype) + np.testing.assert_equal(got, expected) + + def test_setitem_tuple(self): + # Test many variations of advanced indexing with a tuple index + N = 4 + ndim = 3 + arr = np.arange(N ** ndim).reshape((N,) * ndim).astype(np.int32) + indices = self.generate_advanced_index_tuples(N, ndim) + self.check_setitem_indices(arr, indices) + + def test_setitem_tuple_and_ellipsis(self): + # Same, but also insert an ellipsis at a random point + N = 4 + ndim = 3 + arr = np.arange(N ** ndim).reshape((N,) * ndim).astype(np.int32) + indices = self.generate_advanced_index_tuples_with_ellipsis(N, ndim, + many=False) + + self.check_setitem_indices(arr, indices) + + def test_setitem_array(self): + # Test advanced indexing with a single array index + N = 4 + ndim = 3 + arr = np.arange(N ** ndim).reshape((N,) * ndim).astype(np.int32) + 10 + indices = self.generate_advanced_indices(N) + self.check_setitem_indices(arr, indices) + + def test_setitem_0d(self): + # Test setitem with a 0d-array + pyfunc = setitem_usecase + cfunc = jit(nopython=True)(pyfunc) + + inps = [ + (np.zeros(3), np.array(3.14)), + (np.zeros(2), np.array(2)), + (np.zeros(3, dtype=np.int64), np.array(3, dtype=np.int64)), + (np.zeros(3, dtype=np.float64), np.array(1, dtype=np.int64)), + (np.zeros(5, dtype=' y: + break + return result + + +def for_loop_usecase6(x, y): + result = 0 + for i in range(x): + if i > y: + continue + result += 1 + return result + + +def for_loop_usecase7(x, y): + for i in range(x): + x = 0 + for j in range(x): + return 1 + else: + pass + return 0 + + +def for_loop_usecase8(x, y): + result = 0 + for i in range(x, y, y - x + 1): + result += 1 + return result + + +def for_loop_usecase9(x, y): + z = 0 + for i in range(x): + x = 0 + for j in range(x): + if j == x / 2: + z += j + break + else: + z += y + + return z + + +def for_loop_usecase10(x, y): + for i in range(x): + if i == y: + z = y + break + else: + z = i * 2 + return z + + +def while_loop_usecase1(x, y): + result = 0 + i = 0 + while i < x: + result += i + i += 1 + return result + + +def while_loop_usecase2(x, y): + result = 0 + while result != x: + result += 1 + return result + + +def while_loop_usecase3(x, y): + result = 0 + i = 0 + j = 0 + while i < x: + while j < y: + result += i + j + i += 1 + j += 1 + return result + + +def while_loop_usecase4(x, y): + result = 0 + while True: + result += 1 + if result > x: + break + return result + + +def while_loop_usecase5(x, y): + result = 0 + while result < x: + if result > y: + result += 2 + continue + result += 1 + return result + + +def ifelse_usecase1(x, y): + if x > 0: + pass + elif y > 0: + pass + else: + pass + return True + + +def ifelse_usecase2(x, y): + if x > y: + return 1 + elif x == 0 or y == 0: + return 2 + else: + return 3 + + +def ifelse_usecase3(x, y): + if x > 0: + if y > 0: + return 1 + elif y < 0: + return 1 + else: + return 0 + elif x < 0: + return 1 + else: + return 0 + + +def ifelse_usecase4(x, y): + if x == y: + return 1 + + +def ternary_ifelse_usecase1(x, y): + return True if x > y else False + + +def double_infinite_loop(x, y): + L = x + i = y + + while True: + while True: + if i == L - 1: + break + i += 1 + i += 1 + if i >= L: + break + + return i, L + + +def try_except_usecase(): + try: + pass + except Exception: + pass + + +class TestFlowControl(TestCase): + + def run_test(self, pyfunc, x_operands, y_operands, + flags=enable_pyobj_flags): + cfunc = jit((types.intp, types.intp), **flags)(pyfunc) + for x, y in itertools.product(x_operands, y_operands): + pyerr = None + cerr = None + try: + pyres = pyfunc(x, y) + except Exception as e: + pyerr = e + + try: + cres = cfunc(x, y) + except Exception as e: + if pyerr is None: + raise + cerr = e + self.assertEqual(type(pyerr), type(cerr)) + else: + if pyerr is not None: + self.fail("Invalid for pure-python but numba works\n" + + pyerr) + self.assertEqual(pyres, cres) + + def test_for_loop1(self, flags=enable_pyobj_flags): + self.run_test(for_loop_usecase1, [-10, 0, 10], [0], flags=flags) + + def test_for_loop1_npm(self): + self.test_for_loop1(flags=no_pyobj_flags) + + def test_for_loop2(self, flags=enable_pyobj_flags): + self.run_test(for_loop_usecase2, [-10, 0, 10], [-10, 0, 10], + flags=flags) + + def test_for_loop2_npm(self): + self.test_for_loop2(flags=no_pyobj_flags) + + def test_for_loop3(self, flags=enable_pyobj_flags): + """ + List requires pyobject + """ + self.run_test(for_loop_usecase3, [1], [2], + flags=flags) + + def test_for_loop3_npm(self): + self.test_for_loop3(flags=no_pyobj_flags) + + def test_for_loop4(self, flags=enable_pyobj_flags): + self.run_test(for_loop_usecase4, [10], [10], flags=flags) + + def test_for_loop4_npm(self): + self.test_for_loop4(flags=no_pyobj_flags) + + def test_for_loop5(self, flags=enable_pyobj_flags): + self.run_test(for_loop_usecase5, [100], [50], flags=flags) + + def test_for_loop5_npm(self): + self.test_for_loop5(flags=no_pyobj_flags) + + def test_for_loop6(self, flags=enable_pyobj_flags): + self.run_test(for_loop_usecase6, [100], [50], flags=flags) + + def test_for_loop6_npm(self): + self.test_for_loop6(flags=no_pyobj_flags) + + def test_for_loop7(self, flags=enable_pyobj_flags): + self.run_test(for_loop_usecase7, [5], [0], flags=flags) + + def test_for_loop7_npm(self): + self.test_for_loop7(flags=no_pyobj_flags) + + def test_for_loop8(self, flags=enable_pyobj_flags): + self.run_test(for_loop_usecase8, [0, 1], [0, 2, 10], flags=flags) + + def test_for_loop8_npm(self): + self.test_for_loop8(flags=no_pyobj_flags) + + def test_for_loop9(self, flags=enable_pyobj_flags): + self.run_test(for_loop_usecase9, [0, 1], [0, 2, 10], flags=flags) + + def test_for_loop9_npm(self): + self.test_for_loop9(flags=no_pyobj_flags) + + def test_for_loop10(self, flags=enable_pyobj_flags): + self.run_test(for_loop_usecase10, [5], [2, 7], flags=flags) + + def test_for_loop10_npm(self): + self.test_for_loop10(flags=no_pyobj_flags) + + def test_while_loop1(self, flags=enable_pyobj_flags): + self.run_test(while_loop_usecase1, [10], [0], flags=flags) + + def test_while_loop1_npm(self): + self.test_while_loop1(flags=no_pyobj_flags) + + def test_while_loop2(self, flags=enable_pyobj_flags): + self.run_test(while_loop_usecase2, [10], [0], flags=flags) + + def test_while_loop2_npm(self): + self.test_while_loop2(flags=no_pyobj_flags) + + def test_while_loop3(self, flags=enable_pyobj_flags): + self.run_test(while_loop_usecase3, [10], [10], flags=flags) + + def test_while_loop3_npm(self): + self.test_while_loop3(flags=no_pyobj_flags) + + def test_while_loop4(self, flags=enable_pyobj_flags): + self.run_test(while_loop_usecase4, [10], [0], flags=flags) + + def test_while_loop4_npm(self): + self.test_while_loop4(flags=no_pyobj_flags) + + def test_while_loop5(self, flags=enable_pyobj_flags): + self.run_test(while_loop_usecase5, [0, 5, 10], [0, 5, 10], flags=flags) + + def test_while_loop5_npm(self): + self.test_while_loop5(flags=no_pyobj_flags) + + def test_ifelse1(self, flags=enable_pyobj_flags): + self.run_test(ifelse_usecase1, [-1, 0, 1], [-1, 0, 1], flags=flags) + + def test_ifelse1_npm(self): + self.test_ifelse1(flags=no_pyobj_flags) + + def test_ifelse2(self, flags=enable_pyobj_flags): + self.run_test(ifelse_usecase2, [-1, 0, 1], [-1, 0, 1], flags=flags) + + def test_ifelse2_npm(self): + self.test_ifelse2(flags=no_pyobj_flags) + + def test_ifelse3(self, flags=enable_pyobj_flags): + self.run_test(ifelse_usecase3, [-1, 0, 1], [-1, 0, 1], flags=flags) + + def test_ifelse3_npm(self): + self.test_ifelse3(flags=no_pyobj_flags) + + def test_ifelse4(self, flags=enable_pyobj_flags): + self.run_test(ifelse_usecase4, [-1, 0, 1], [-1, 0, 1], flags=flags) + + def test_ifelse4_npm(self): + self.test_ifelse4(flags=no_pyobj_flags) + + def test_ternary_ifelse1(self, flags=enable_pyobj_flags): + self.run_test(ternary_ifelse_usecase1, [-1, 0, 1], [-1, 0, 1], + flags=flags) + + def test_ternary_ifelse1_npm(self): + self.test_ternary_ifelse1(flags=no_pyobj_flags) + + def test_double_infinite_loop(self, flags=enable_pyobj_flags): + self.run_test(double_infinite_loop, [10], [0], + flags=flags) + + def test_double_infinite_loop_npm(self): + self.test_double_infinite_loop(flags=no_pyobj_flags) + + +class TestCFGraph(TestCase): + """ + Test the numba.controlflow.CFGraph class. + """ + + def from_adj_list(self, d, entry_point=0): + """ + Build a CFGraph class from a dict of adjacency lists. + """ + g = CFGraph() + # Need to add all nodes before adding edges + for node in d: + g.add_node(node) + for node, dests in d.items(): + for dest in dests: + g.add_edge(node, dest) + return g + + def loopless1(self): + """ + A simple CFG corresponding to the following code structure: + + c = (... if ... else ...) + ... + return b + c + """ + g = self.from_adj_list({0: [18, 12], 12: [21], 18: [21], 21: []}) + g.set_entry_point(0) + g.process() + return g + + def loopless1_dead_nodes(self): + """ + Same as loopless1(), but with added dead blocks (some of them + in a loop). + """ + g = self.from_adj_list( + {0: [18, 12], + 12: [21], + 18: [21], + 21: [], + 91: [12, 0], + 92: [91, 93], + 93: [92], + 94: [], + }) + g.set_entry_point(0) + g.process() + return g + + def loopless2(self): + """ + A loopless CFG corresponding to the following code structure: + + c = (... if ... else ...) + ... + if c: + return ... + else: + return ... + + Note there are two exit points, and the entry point has been + changed to a non-zero value. + """ + g = self.from_adj_list( + {99: [18, 12], 12: [21], 18: [21], 21: [42, 34], 34: [], 42: []}) + g.set_entry_point(99) + g.process() + return g + + def multiple_loops(self): + """ + A CFG with multiple nested loops: + + for y in b: + for x in a: + # This loop has two back edges + if b: + continue + else: + continue + for z in c: + if z: + return ... + """ + g = self.from_adj_list({0: [7], + 7: [10, 60], + 10: [13], + 13: [20], + 20: [56, 23], + 23: [32, 44], + 32: [20], + 44: [20], + 56: [57], + 57: [7], + 60: [61], + 61: [68], + 68: [87, 71], + 71: [80, 68], + 80: [], + 87: [88], + 88: []} + ) + g.set_entry_point(0) + g.process() + return g + + def multiple_exits(self): + """ + A CFG with three loop exits, one of which is also a function + exit point, and another function exit point: + + for x in a: + if a: + return b + elif b: + break + return c + """ + g = self.from_adj_list( + {0: [7], + 7: [10, 36], + 10: [19, 23], + 19: [], + 23: [29, 7], + 29: [37], + 36: [37], + 37: [] + }) + g.set_entry_point(0) + g.process() + return g + + def infinite_loop1(self): + """ + A CFG with a infinite loop and an alternate exit point: + + if c: + return + while True: + if a: + ... + else: + ... + """ + g = self.from_adj_list( + {0: [10, 6], 6: [], 10: [13], 13: [26, 19], 19: [13], 26: [13]}) + g.set_entry_point(0) + g.process() + return g + + def infinite_loop2(self): + """ + A CFG with no exit point at all: + + while True: + if a: + ... + else: + ... + """ + g = self.from_adj_list({0: [3], 3: [16, 9], 9: [3], 16: [3]}) + g.set_entry_point(0) + g.process() + return g + + def test_simple_properties(self): + g = self.loopless1() + self.assertEqual(sorted(g.successors(0)), [(12, None), (18, None)]) + self.assertEqual(sorted(g.successors(21)), []) + self.assertEqual(sorted(g.predecessors(0)), []) + self.assertEqual(sorted(g.predecessors(21)), [(12, None), (18, None)]) + + def test_exit_points(self): + g = self.loopless1() + self.assertEqual(sorted(g.exit_points()), [21]) + g = self.loopless1_dead_nodes() + self.assertEqual(sorted(g.exit_points()), [21]) + g = self.loopless2() + self.assertEqual(sorted(g.exit_points()), [34, 42]) + g = self.multiple_loops() + self.assertEqual(sorted(g.exit_points()), [80, 88]) + g = self.infinite_loop1() + self.assertEqual(sorted(g.exit_points()), [6]) + g = self.infinite_loop2() + self.assertEqual(sorted(g.exit_points()), []) + g = self.multiple_exits() + self.assertEqual(sorted(g.exit_points()), [19, 37]) + + def test_dead_nodes(self): + g = self.loopless1() + self.assertEqual(len(g.dead_nodes()), 0) + self.assertEqual(sorted(g.nodes()), + [0, 12, 18, 21]) + g = self.loopless2() + self.assertEqual(len(g.dead_nodes()), 0) + self.assertEqual(sorted(g.nodes()), + [12, 18, 21, 34, 42, 99]) + g = self.multiple_loops() + self.assertEqual(len(g.dead_nodes()), 0) + g = self.infinite_loop1() + self.assertEqual(len(g.dead_nodes()), 0) + g = self.multiple_exits() + self.assertEqual(len(g.dead_nodes()), 0) + # Only this example has dead nodes + g = self.loopless1_dead_nodes() + self.assertEqual(sorted(g.dead_nodes()), + [91, 92, 93, 94]) + self.assertEqual(sorted(g.nodes()), + [0, 12, 18, 21]) + + def test_descendents(self): + g = self.loopless2() + d = g.descendents(34) + self.assertEqual(sorted(d), []) + d = g.descendents(42) + self.assertEqual(sorted(d), []) + d = g.descendents(21) + self.assertEqual(sorted(d), [34, 42]) + d = g.descendents(99) + self.assertEqual(sorted(d), [12, 18, 21, 34, 42]) + g = self.infinite_loop1() + d = g.descendents(26) + self.assertEqual(sorted(d), []) + d = g.descendents(19) + self.assertEqual(sorted(d), []) + d = g.descendents(13) + self.assertEqual(sorted(d), [19, 26]) + d = g.descendents(10) + self.assertEqual(sorted(d), [13, 19, 26]) + d = g.descendents(6) + self.assertEqual(sorted(d), []) + d = g.descendents(0) + self.assertEqual(sorted(d), [6, 10, 13, 19, 26]) + + def test_topo_order(self): + g = self.loopless1() + self.assertIn(g.topo_order(), + ([0, 12, 18, 21], [0, 18, 12, 21])) + g = self.loopless2() + self.assertIn(g.topo_order(), + ([99, 18, 12, 21, 34, 42], [99, 12, 18, 21, 34, 42])) + g = self.infinite_loop2() + self.assertIn(g.topo_order(), + ([0, 3, 9, 16], [0, 3, 16, 9])) + g = self.infinite_loop1() + self.assertIn(g.topo_order(), + ([0, 6, 10, 13, 19, 26], [0, 6, 10, 13, 26, 19], + [0, 10, 13, 19, 26, 6], [0, 10, 13, 26, 19, 6])) + + def test_topo_sort(self): + def check_topo_sort(nodes, expected): + self.assertIn(list(g.topo_sort(nodes)), expected) + self.assertIn(list(g.topo_sort(nodes[::-1])), expected) + self.assertIn(list(g.topo_sort(nodes, reverse=True))[::-1], + expected) + self.assertIn(list(g.topo_sort(nodes[::-1], reverse=True))[::-1], + expected) + self.random.shuffle(nodes) + self.assertIn(list(g.topo_sort(nodes)), expected) + self.assertIn(list(g.topo_sort(nodes, reverse=True))[::-1], + expected) + + g = self.loopless2() + check_topo_sort([21, 99, 12, 34], ([99, 12, 21, 34],)) + # NOTE: topo_sort() is not stable + check_topo_sort([18, 12, 42, 99], + ([99, 12, 18, 42], [99, 18, 12, 42])) + g = self.multiple_exits() + check_topo_sort([19, 10, 7, 36], + ([7, 10, 19, 36], [7, 10, 36, 19], [7, 36, 10, 19])) + + def check_dominators(self, got, expected): + self.assertEqual(sorted(got), sorted(expected)) + for node in sorted(got): + self.assertEqual(sorted(got[node]), sorted(expected[node]), + "mismatch for %r" % (node,)) + + def test_dominators_loopless(self): + def eq_(d, l): + self.assertEqual(sorted(doms[d]), l) + for g in [self.loopless1(), self.loopless1_dead_nodes()]: + doms = g.dominators() + eq_(0, [0]) + eq_(12, [0, 12]) + eq_(18, [0, 18]) + eq_(21, [0, 21]) + g = self.loopless2() + doms = g.dominators() + eq_(99, [99]) + eq_(12, [12, 99]) + eq_(18, [18, 99]) + eq_(21, [21, 99]) + eq_(34, [21, 34, 99]) + eq_(42, [21, 42, 99]) + + def test_dominators_loops(self): + g = self.multiple_exits() + doms = g.dominators() + self.check_dominators(doms, + {0: [0], + 7: [0, 7], + 10: [0, 7, 10], + 19: [0, 7, 10, 19], + 23: [0, 7, 10, 23], + 29: [0, 7, 10, 23, 29], + 36: [0, 7, 36], + 37: [0, 7, 37], + }) + g = self.multiple_loops() + doms = g.dominators() + self.check_dominators(doms, + {0: [0], + 7: [0, 7], + 10: [0, 10, 7], + 13: [0, 10, 13, 7], + 20: [0, 10, 20, 13, 7], + 23: [0, 20, 23, 7, 10, 13], + 32: [32, 0, 20, 23, 7, 10, 13], + 44: [0, 20, 23, 7, 10, 44, 13], + 56: [0, 20, 7, 56, 10, 13], + 57: [0, 20, 7, 56, 57, 10, 13], + 60: [0, 60, 7], + 61: [0, 60, 61, 7], + 68: [0, 68, 60, 61, 7], + 71: [0, 68, 71, 7, 60, 61], + 80: [80, 0, 68, 71, 7, 60, 61], + 87: [0, 68, 87, 7, 60, 61], + 88: [0, 68, 87, 88, 7, 60, 61] + }) + g = self.infinite_loop1() + doms = g.dominators() + self.check_dominators(doms, + {0: [0], + 6: [0, 6], + 10: [0, 10], + 13: [0, 10, 13], + 19: [0, 10, 19, 13], + 26: [0, 10, 13, 26], + }) + + def test_post_dominators_loopless(self): + def eq_(d, l): + self.assertEqual(sorted(doms[d]), l) + for g in [self.loopless1(), self.loopless1_dead_nodes()]: + doms = g.post_dominators() + eq_(0, [0, 21]) + eq_(12, [12, 21]) + eq_(18, [18, 21]) + eq_(21, [21]) + g = self.loopless2() + doms = g.post_dominators() + eq_(34, [34]) + eq_(42, [42]) + eq_(21, [21]) + eq_(18, [18, 21]) + eq_(12, [12, 21]) + eq_(99, [21, 99]) + + def test_post_dominators_loops(self): + g = self.multiple_exits() + doms = g.post_dominators() + self.check_dominators(doms, + {0: [0, 7], + 7: [7], + 10: [10], + 19: [19], + 23: [23], + 29: [29, 37], + 36: [36, 37], + 37: [37], + }) + g = self.multiple_loops() + doms = g.post_dominators() + self.check_dominators(doms, + {0: [0, 60, 68, 61, 7], + 7: [60, 68, 61, 7], + 10: [68, 7, 10, 13, 20, 56, 57, 60, 61], + 13: [68, 7, 13, 20, 56, 57, 60, 61], + 20: [20, 68, 7, 56, 57, 60, 61], + 23: [68, 7, 20, 23, 56, 57, 60, 61], + 32: [32, 68, 7, 20, 56, 57, 60, 61], + 44: [68, 7, 44, 20, 56, 57, 60, 61], + 56: [68, 7, 56, 57, 60, 61], + 57: [57, 60, 68, 61, 7], + 60: [60, 68, 61], + 61: [68, 61], + 68: [68], + 71: [71], + 80: [80], + 87: [88, 87], + 88: [88] + }) + + def test_post_dominators_infinite_loops(self): + # Post-dominators with infinite loops need special care + # (the ordinary algorithm won't work). + g = self.infinite_loop1() + doms = g.post_dominators() + self.check_dominators(doms, + {0: [0], + 6: [6], + 10: [10, 13], + 13: [13], + 19: [19], + 26: [26], + }) + g = self.infinite_loop2() + doms = g.post_dominators() + self.check_dominators(doms, + {0: [0, 3], + 3: [3], + 9: [9], + 16: [16], + }) + + def test_dominator_tree(self): + def check(graph, expected): + domtree = graph.dominator_tree() + self.assertEqual(domtree, expected) + + check(self.loopless1(), + {0: {12, 18, 21}, 12: set(), 18: set(), 21: set()}) + check(self.loopless2(), + {12: set(), 18: set(), 21: {34, 42}, 34: set(), 42: set(), + 99: {18, 12, 21}}) + check(self.loopless1_dead_nodes(), + {0: {12, 18, 21}, 12: set(), 18: set(), 21: set()}) + check(self.multiple_loops(), + {0: {7}, 7: {10, 60}, 60: {61}, 61: {68}, 68: {71, 87}, + 87: {88}, 88: set(), 71: {80}, 80: set(), 10: {13}, + 13: {20}, 20: {56, 23}, 23: {32, 44}, 44: set(), + 32: set(), 56: {57}, 57: set()}) + check(self.multiple_exits(), + {0: {7}, 7: {10, 36, 37}, 36: set(), 10: {19, 23}, + 23: {29}, 29: set(), 37: set(), 19: set()}) + check(self.infinite_loop1(), + {0: {10, 6}, 6: set(), 10: {13}, 13: {26, 19}, 19: set(), + 26: set()}) + check(self.infinite_loop2(), + {0: {3}, 3: {16, 9}, 9: set(), 16: set()}) + + def test_immediate_dominators(self): + def check(graph, expected): + idoms = graph.immediate_dominators() + self.assertEqual(idoms, expected) + + check(self.loopless1(), + {0: 0, 12: 0, 18: 0, 21: 0}) + check(self.loopless2(), + {18: 99, 12: 99, 21: 99, 42: 21, 34: 21, 99: 99}) + check(self.loopless1_dead_nodes(), + {0: 0, 12: 0, 18: 0, 21: 0}) + check(self.multiple_loops(), + {0: 0, 7: 0, 10: 7, 13: 10, 20: 13, 23: 20, + 32: 23, 44: 23, 56: 20, 57: 56, 60: 7, 61: 60, + 68: 61, 71: 68, 80: 71, 87: 68, 88: 87}) + check(self.multiple_exits(), + {0:0, 7: 0, 10: 7, 19: 10, 23: 10, 29: 23, 36: 7, 37: 7}) + check(self.infinite_loop1(), + {0: 0, 6: 0, 10: 0, 13: 10, 19: 13, 26: 13}) + check(self.infinite_loop2(), + {0: 0, 3: 0, 9: 3, 16: 3}) + + def test_dominance_frontier(self): + def check(graph, expected): + df = graph.dominance_frontier() + self.assertEqual(df, expected) + + check(self.loopless1(), + {0: set(), 12: {21}, 18: {21}, 21: set()}) + check(self.loopless2(), + {18: {21}, 12: {21}, 21: set(), 42: set(), 34: set(), 99: set()}) + check(self.loopless1_dead_nodes(), + {0: set(), 12: {21}, 18: {21}, 21: set()}) + check(self.multiple_loops(), + {0: set(), 7: {7}, 10: {7}, 13: {7}, 20: {20, 7}, 23: {20}, + 32: {20}, 44: {20}, 56: {7}, 57: {7}, 60: set(), 61: set(), + 68: {68}, 71: {68}, 80: set(), 87: set(), 88: set()}) + check(self.multiple_exits(), + {0: set(), 7: {7}, 10: {37, 7}, 19: set(), + 23: {37, 7}, 29: {37}, 36: {37}, 37: set()}) + check(self.infinite_loop1(), + {0: set(), 6: set(), 10: set(), 13: {13}, 19: {13}, 26: {13}}) + check(self.infinite_loop2(), + {0: set(), 3: {3}, 9: {3}, 16: {3}}) + + def test_backbone_loopless(self): + for g in [self.loopless1(), self.loopless1_dead_nodes()]: + self.assertEqual(sorted(g.backbone()), [0, 21]) + g = self.loopless2() + self.assertEqual(sorted(g.backbone()), [21, 99]) + + def test_backbone_loops(self): + g = self.multiple_loops() + self.assertEqual(sorted(g.backbone()), [0, 7, 60, 61, 68]) + g = self.infinite_loop1() + self.assertEqual(sorted(g.backbone()), [0]) + g = self.infinite_loop2() + self.assertEqual(sorted(g.backbone()), [0, 3]) + + def test_loops(self): + for g in [self.loopless1(), self.loopless1_dead_nodes(), + self.loopless2()]: + self.assertEqual(len(g.loops()), 0) + + g = self.multiple_loops() + # Loop headers + self.assertEqual(sorted(g.loops()), [7, 20, 68]) + outer1 = g.loops()[7] + inner1 = g.loops()[20] + outer2 = g.loops()[68] + self.assertEqual(outer1.header, 7) + self.assertEqual(sorted(outer1.entries), [0]) + self.assertEqual(sorted(outer1.exits), [60]) + self.assertEqual(sorted(outer1.body), + [7, 10, 13, 20, 23, 32, 44, 56, 57]) + self.assertEqual(inner1.header, 20) + self.assertEqual(sorted(inner1.entries), [13]) + self.assertEqual(sorted(inner1.exits), [56]) + self.assertEqual(sorted(inner1.body), [20, 23, 32, 44]) + self.assertEqual(outer2.header, 68) + self.assertEqual(sorted(outer2.entries), [61]) + self.assertEqual(sorted(outer2.exits), [80, 87]) + self.assertEqual(sorted(outer2.body), [68, 71]) + for node in [0, 60, 61, 80, 87, 88]: + self.assertEqual(g.in_loops(node), []) + for node in [7, 10, 13, 56, 57]: + self.assertEqual(g.in_loops(node), [outer1]) + for node in [20, 23, 32, 44]: + self.assertEqual(g.in_loops(node), [inner1, outer1]) + for node in [68, 71]: + self.assertEqual(g.in_loops(node), [outer2]) + + g = self.infinite_loop1() + # Loop headers + self.assertEqual(sorted(g.loops()), [13]) + loop = g.loops()[13] + self.assertEqual(loop.header, 13) + self.assertEqual(sorted(loop.entries), [10]) + self.assertEqual(sorted(loop.exits), []) + self.assertEqual(sorted(loop.body), [13, 19, 26]) + for node in [0, 6, 10]: + self.assertEqual(g.in_loops(node), []) + for node in [13, 19, 26]: + self.assertEqual(g.in_loops(node), [loop]) + + g = self.infinite_loop2() + # Loop headers + self.assertEqual(sorted(g.loops()), [3]) + loop = g.loops()[3] + self.assertEqual(loop.header, 3) + self.assertEqual(sorted(loop.entries), [0]) + self.assertEqual(sorted(loop.exits), []) + self.assertEqual(sorted(loop.body), [3, 9, 16]) + for node in [0]: + self.assertEqual(g.in_loops(node), []) + for node in [3, 9, 16]: + self.assertEqual(g.in_loops(node), [loop]) + + g = self.multiple_exits() + # Loop headers + self.assertEqual(sorted(g.loops()), [7]) + loop = g.loops()[7] + self.assertEqual(loop.header, 7) + self.assertEqual(sorted(loop.entries), [0]) + self.assertEqual(sorted(loop.exits), [19, 29, 36]) + self.assertEqual(sorted(loop.body), [7, 10, 23]) + for node in [0, 19, 29, 36]: + self.assertEqual(g.in_loops(node), []) + for node in [7, 10, 23]: + self.assertEqual(g.in_loops(node), [loop]) + + def test_loop_dfs_pathological(self): + # The follow adjlist is an export from the reproducer in #6186 + g = self.from_adj_list({ + 0: {38, 14}, + 14: {38, 22}, + 22: {38, 30}, + 30: {42, 38}, + 38: {42}, + 42: {64, 50}, + 50: {64, 58}, + 58: {128}, + 64: {72, 86}, + 72: {80, 86}, + 80: {128}, + 86: {108, 94}, + 94: {108, 102}, + 102: {128}, + 108: {128, 116}, + 116: {128, 124}, + 124: {128}, + 128: {178, 174}, + 174: {178}, + 178: {210, 206}, + 206: {210}, + 210: {248, 252}, + 248: {252}, + 252: {282, 286}, + 282: {286}, + 286: {296, 326}, + 296: {330}, + 326: {330}, + 330: {370, 340}, + 340: {374}, + 370: {374}, + 374: {380, 382}, + 380: {382}, + 382: {818, 390}, + 390: {456, 458}, + 456: {458}, + 458: {538, 566}, + 538: {548, 566}, + 548: set(), + 566: {586, 572}, + 572: {586}, + 586: {708, 596}, + 596: {608}, + 608: {610}, + 610: {704, 620}, + 620: {666, 630}, + 630: {636, 646}, + 636: {666, 646}, + 646: {666}, + 666: {610}, + 704: {706}, + 706: {818}, + 708: {720}, + 720: {722}, + 722: {816, 732}, + 732: {778, 742}, + 742: {748, 758}, + 748: {778, 758}, + 758: {778}, + 778: {722}, + 816: {818}, + 818: set(), + }) + g.set_entry_point(0) + g.process() + stats = {} + # Compute backedges and store the iteration count for testing + back_edges = g._find_back_edges(stats=stats) + self.assertEqual(back_edges, {(666, 610), (778, 722)}) + self.assertEqual(stats['iteration_count'], 155) + + def test_equals(self): + + def get_new(): + g = self.from_adj_list({0: [18, 12], 12: [21], 18: [21], 21: []}) + g.set_entry_point(0) + g.process() + return g + + x = get_new() + y = get_new() + + # identical + self.assertEqual(x, y) + + # identical but defined in a different order + g = self.from_adj_list({0: [12, 18], 18: [21], 21: [], 12: [21]}) + g.set_entry_point(0) + g.process() + self.assertEqual(x, g) + + # different entry point + z = get_new() + z.set_entry_point(18) + z.process() + self.assertNotEqual(x, z) + + # extra node/edge, same entry point + z = self.from_adj_list({0: [18, 12], 12: [21], 18: [21], 21: [22], + 22: []}) + z.set_entry_point(0) + z.process() + self.assertNotEqual(x, z) + + # same nodes, different edges + a = self.from_adj_list({0: [18, 12], 12: [0], 18: []}) + a.set_entry_point(0) + a.process() + z = self.from_adj_list({0: [18, 12], 12: [18], 18: []}) + z.set_entry_point(0) + z.process() + self.assertNotEqual(a, z) + + +class TestRealCodeDomFront(TestCase): + """Test IDOM and DOMFRONT computation on real python bytecode. + Note: there will be less testing on IDOM (esp in loop) because of + the extra blocks inserted by the interpreter. But, testing on DOMFRONT + (which depends on IDOM) is easier. + + Testing is done by associating names to basicblock by using globals of + the pattern "SET_BLOCK_", which are scanned by + `.get_cfa_and_namedblocks` into *namedblocks* dictionary. That way, we + can check that a block of a certain name is a IDOM or DOMFRONT of another + named block. + """ + def cfa(self, bc): + cfa = ControlFlowAnalysis(bc) + cfa.run() + return cfa + + def get_cfa_and_namedblocks(self, fn): + fid = FunctionIdentity.from_function(fn) + bc = ByteCode(func_id=fid) + cfa = self.cfa(bc) + namedblocks = self._scan_namedblocks(bc, cfa) + + #### To debug, uncomment below + # print(bc.dump()) + # print("IDOMS") + # for k, v in sorted(cfa.graph.immediate_dominators().items()): + # print('{} -> {}'.format(k, v)) + # print("DOMFRONT") + # for k, vs in sorted(cfa.graph.dominance_frontier().items()): + # print('{} -> {}'.format(k, vs)) + # print(namedblocks) + # cfa.graph.render_dot().view() + + return cfa, namedblocks + + def _scan_namedblocks(self, bc, cfa): + """Scan namedblocks as denoted by a LOAD_GLOBAL bytecode referring + to global variables with the pattern "SET_BLOCK_", where "" + would be the name for the current block. + """ + namedblocks = {} + blocks = sorted([x.offset for x in cfa.iterblocks()]) + prefix = 'SET_BLOCK_' + + for inst in bc: + # Find LOAD_GLOBAL that refers to "SET_BLOCK_" + if inst.opname == 'LOAD_GLOBAL': + gv = bc.co_names[_fix_LOAD_GLOBAL_arg(inst.arg)] + if gv.startswith(prefix): + name = gv[len(prefix):] + # Find the block where this instruction resides + for s, e in zip(blocks, blocks[1:] + [blocks[-1] + 1]): + if s <= inst.offset < e: + break + else: + raise AssertionError('unreachable loop') + blkno = s + namedblocks[name] = blkno + return namedblocks + + def test_loop(self): + def foo(n): + c = 0 + SET_BLOCK_A # noqa: F821 + i = 0 + while SET_BLOCK_B0: # noqa: F821 + SET_BLOCK_B1 # noqa: F821 + c += 1 + i += 1 + SET_BLOCK_C # noqa: F821 + return c + + cfa, blkpts = self.get_cfa_and_namedblocks(foo) + + # Py3.10 turns while loop into if(...) { do {...} while(...) }. + # Also, `SET_BLOCK_B0` is duplicated. As a result, the second B0 + # is picked up by `blkpts`. + domfront = cfa.graph.dominance_frontier() + self.assertFalse(domfront[blkpts['A']]) + self.assertFalse(domfront[blkpts['C']]) + + def test_loop_nested_and_break(self): + def foo(n): + SET_BLOCK_A # noqa: F821 + while SET_BLOCK_B0: # noqa: F821 + SET_BLOCK_B1 # noqa: F821 + while SET_BLOCK_C0: # noqa: F821 + SET_BLOCK_C1 # noqa: F821 + if SET_BLOCK_D0: # noqa: F821 + SET_BLOCK_D1 # noqa: F821 + break + elif n: + SET_BLOCK_D2 # noqa: F821 + SET_BLOCK_E # noqa: F821 + SET_BLOCK_F # noqa: F821 + SET_BLOCK_G # noqa: F821 + + cfa, blkpts = self.get_cfa_and_namedblocks(foo) + self.assertEqual(blkpts['D0'], blkpts['C1']) + + # Py3.10 changes while loop into if-do-while + domfront = cfa.graph.dominance_frontier() + self.assertFalse(domfront[blkpts['A']]) + self.assertFalse(domfront[blkpts['G']]) + # 2 domfront members for C1 + # C0 because of the loop; F because of the break. + self.assertEqual({blkpts['F']}, domfront[blkpts['D1']]) + self.assertEqual({blkpts['E']}, domfront[blkpts['D2']]) + + def test_if_else(self): + def foo(a, b): + c = 0 + SET_BLOCK_A # noqa: F821 + if a < b: + SET_BLOCK_B # noqa: F821 + c = 1 + elif SET_BLOCK_C0: # noqa: F821 + SET_BLOCK_C1 # noqa: F821 + c = 2 + else: + SET_BLOCK_D # noqa: F821 + c = 3 + + SET_BLOCK_E # noqa: F821 + if a % b == 0: + SET_BLOCK_F # noqa: F821 + c += 1 + SET_BLOCK_G # noqa: F821 + return c + + cfa, blkpts = self.get_cfa_and_namedblocks(foo) + + idoms = cfa.graph.immediate_dominators() + self.assertEqual(blkpts['A'], idoms[blkpts['B']]) + self.assertEqual(blkpts['A'], idoms[blkpts['C0']]) + self.assertEqual(blkpts['C0'], idoms[blkpts['C1']]) + self.assertEqual(blkpts['C0'], idoms[blkpts['D']]) + self.assertEqual(blkpts['A'], idoms[blkpts['E']]) + self.assertEqual(blkpts['E'], idoms[blkpts['F']]) + self.assertEqual(blkpts['E'], idoms[blkpts['G']]) + + domfront = cfa.graph.dominance_frontier() + self.assertFalse(domfront[blkpts['A']]) + self.assertFalse(domfront[blkpts['E']]) + self.assertFalse(domfront[blkpts['G']]) + self.assertEqual({blkpts['E']}, domfront[blkpts['B']]) + self.assertEqual({blkpts['E']}, domfront[blkpts['C0']]) + self.assertEqual({blkpts['E']}, domfront[blkpts['C1']]) + self.assertEqual({blkpts['E']}, domfront[blkpts['D']]) + self.assertEqual({blkpts['G']}, domfront[blkpts['F']]) + + def test_if_else_nested(self): + def foo(): + if SET_BLOCK_A0: # noqa: F821 + SET_BLOCK_A1 # noqa: F821 + if SET_BLOCK_B0: # noqa: F821 + SET_BLOCK_B1 # noqa: F821 + a = 0 + else: + if SET_BLOCK_C0: # noqa: F821 + SET_BLOCK_C1 # noqa: F821 + a = 1 + else: + SET_BLOCK_C2 # noqa: F821 + a = 2 + SET_BLOCK_D # noqa: F821 + SET_BLOCK_E # noqa: F821 + SET_BLOCK_F # noqa: F821 + return a + + cfa, blkpts = self.get_cfa_and_namedblocks(foo) + + idoms = cfa.graph.immediate_dominators() + self.assertEqual(blkpts['A0'], idoms[blkpts['A1']]) + self.assertEqual(blkpts['A1'], idoms[blkpts['B1']]) + self.assertEqual(blkpts['A1'], idoms[blkpts['C0']]) + self.assertEqual(blkpts['C0'], idoms[blkpts['D']]) + self.assertEqual(blkpts['A1'], idoms[blkpts['E']]) + self.assertEqual(blkpts['A0'], idoms[blkpts['F']]) + + domfront = cfa.graph.dominance_frontier() + self.assertFalse(domfront[blkpts['A0']]) + self.assertFalse(domfront[blkpts['F']]) + self.assertEqual({blkpts['E']}, domfront[blkpts['B1']]) + self.assertEqual({blkpts['D']}, domfront[blkpts['C1']]) + self.assertEqual({blkpts['E']}, domfront[blkpts['D']]) + self.assertEqual({blkpts['F']}, domfront[blkpts['E']]) + + def test_infinite_loop(self): + def foo(): + SET_BLOCK_A # noqa: F821 + while True: # infinite loop + if SET_BLOCK_B: # noqa: F821 + SET_BLOCK_C # noqa: F821 + return + SET_BLOCK_D # noqa: F821 + SET_BLOCK_E # noqa: F821 + + cfa, blkpts = self.get_cfa_and_namedblocks(foo) + + idoms = cfa.graph.immediate_dominators() + # Py3.10 optimizes away the infinite loop and removes SET_BLOCK_E from + # the bytecode. + self.assertNotIn('E', blkpts) + self.assertEqual(blkpts['B'], idoms[blkpts['C']]) + self.assertEqual(blkpts['B'], idoms[blkpts['D']]) + + domfront = cfa.graph.dominance_frontier() + self.assertFalse(domfront[blkpts['A']]) + self.assertFalse(domfront[blkpts['C']]) + self.assertEqual({blkpts['B']}, domfront[blkpts['B']]) + self.assertEqual({blkpts['B']}, domfront[blkpts['D']]) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_func_interface.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_func_interface.py new file mode 100644 index 0000000000000000000000000000000000000000..546862858c4a9a0e6febb8fcbc6da881bdf1cb7f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_func_interface.py @@ -0,0 +1,43 @@ +import unittest +from numba import jit + + +class TestFuncInterface(unittest.TestCase): + def test_jit_function_docstring(self): + + def add(x, y): + '''Return sum of two numbers''' + return x + y + + c_add = jit(add) + self.assertEqual(c_add.__doc__, 'Return sum of two numbers') + + def test_jit_function_name(self): + + def add(x, y): + return x + y + + c_add = jit(add) + self.assertEqual(c_add.__name__, 'add') + + def test_jit_function_module(self): + + def add(x, y): + return x + y + + c_add = jit(add) + # Expected answer depends on how you run this test. + # Compare to python function instead. + self.assertEqual(c_add.__module__, add.__module__) + + def test_jit_function_code_object(self): + def add(x, y): + return x + y + + c_add = jit(add) + self.assertEqual(c_add.__code__, add.__code__) + self.assertEqual(c_add.func_code, add.__code__) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_func_lifetime.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_func_lifetime.py new file mode 100644 index 0000000000000000000000000000000000000000..5624b57047bda17d17f21db4335d7691f2f0c0ad --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_func_lifetime.py @@ -0,0 +1,164 @@ +import gc +import weakref + +from numba import jit +from numba.core import types +from numba.tests.support import TestCase +import unittest + + +class Dummy(object): + + def __add__(self, other): + return other + 5 + + +def global_usecase1(x): + return x + 1 + +def global_usecase2(): + return global_obj + 1 + + +class TestFuncLifetime(TestCase): + """ + Test the lifetime of compiled function objects and their dependencies. + """ + + def get_impl(self, dispatcher): + """ + Get the single implementation (a C function object) of a dispatcher. + """ + self.assertEqual(len(dispatcher.overloads), 1) + cres = list(dispatcher.overloads.values())[0] + return cres.entry_point + + def check_local_func_lifetime(self, **jitargs): + def f(x): + return x + 1 + + c_f = jit('int32(int32)', **jitargs)(f) + self.assertPreciseEqual(c_f(1), 2) + + cfunc = self.get_impl(c_f) + + # Since we can't take a weakref to a C function object + # (see http://bugs.python.org/issue22116), ensure it's + # collected by taking a weakref to its __self__ instead + # (a _dynfunc._Closure object). + refs = [weakref.ref(obj) for obj in (f, c_f, cfunc.__self__)] + obj = f = c_f = cfunc = None + gc.collect() + self.assertEqual([wr() for wr in refs], [None] * len(refs)) + + def test_local_func_lifetime(self): + self.check_local_func_lifetime(forceobj=True) + + def test_local_func_lifetime_npm(self): + self.check_local_func_lifetime(nopython=True) + + def check_global_func_lifetime(self, **jitargs): + c_f = jit(**jitargs)(global_usecase1) + self.assertPreciseEqual(c_f(1), 2) + + cfunc = self.get_impl(c_f) + + wr = weakref.ref(c_f) + refs = [weakref.ref(obj) for obj in (c_f, cfunc.__self__)] + obj = c_f = cfunc = None + gc.collect() + self.assertEqual([wr() for wr in refs], [None] * len(refs)) + + def test_global_func_lifetime(self): + self.check_global_func_lifetime(forceobj=True) + + def test_global_func_lifetime_npm(self): + self.check_global_func_lifetime(nopython=True) + + def check_global_obj_lifetime(self, **jitargs): + # Since global objects can be recorded for typing purposes, + # check that they are not kept around after they are removed + # from the globals. + global global_obj + global_obj = Dummy() + + c_f = jit(**jitargs)(global_usecase2) + self.assertPreciseEqual(c_f(), 6) + + refs = [weakref.ref(obj) for obj in (c_f, global_obj)] + obj = c_f = global_obj = None + gc.collect() + self.assertEqual([wr() for wr in refs], [None] * len(refs)) + + def test_global_obj_lifetime(self): + self.check_global_obj_lifetime(forceobj=True) + + def check_inner_function_lifetime(self, **jitargs): + """ + When a jitted function calls into another jitted function, check + that everything is collected as desired. + """ + def mult_10(a): + return a * 10 + + c_mult_10 = jit('intp(intp)', **jitargs)(mult_10) + c_mult_10.disable_compile() + + def do_math(x): + return c_mult_10(x + 4) + + c_do_math = jit('intp(intp)', **jitargs)(do_math) + c_do_math.disable_compile() + + self.assertEqual(c_do_math(1), 50) + + wrs = [weakref.ref(obj) for obj in + (mult_10, c_mult_10, do_math, c_do_math, + self.get_impl(c_mult_10).__self__, + self.get_impl(c_do_math).__self__, + )] + obj = mult_10 = c_mult_10 = do_math = c_do_math = None + gc.collect() + self.assertEqual([w() for w in wrs], [None] * len(wrs)) + + def test_inner_function_lifetime(self): + self.check_inner_function_lifetime(forceobj=True) + + def test_inner_function_lifetime_npm(self): + self.check_inner_function_lifetime(nopython=True) + + +class TestLifeTimeIssue(TestCase): + def test_double_free(self): + from numba import njit + import numpy as np + + # This is the function that causes the crash + + @njit + def is_point_in_polygons(point, polygons): + num_polygons = polygons.shape[0] + if num_polygons != 0: + # An extra decref is inserted in this block + intentionally_unused_variable = polygons[0] + return 0 + + # This function creates some NRT objects for the previous function + # to corrupt. + + @njit + def dummy(): + return np.empty(10, dtype=np.int64) + + polygons = np.array([[[0, 1]]]) + points = np.array([[-1.5, 0.5]]) + a = dummy() + is_point_in_polygons(points[0], polygons) + b = dummy() + # Crash happens at second call + is_point_in_polygons(points[0], polygons) + c = dummy() + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_funcdesc.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_funcdesc.py new file mode 100644 index 0000000000000000000000000000000000000000..e5e899bfe45fb22df60c2037332c67d1fa004199 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_funcdesc.py @@ -0,0 +1,61 @@ + +import unittest + +from numba import njit +from numba.core.funcdesc import PythonFunctionDescriptor, default_mangler +from numba.core.compiler import run_frontend +from numba.core.itanium_mangler import mangle_abi_tag + + +class TestModule(unittest.TestCase): + def test_module_not_in_namespace(self): + """ Test of trying to run a compiled function + where the module from which the function is being compiled + doesn't exist in the namespace. + """ + filename = 'test.py' + name = 'mypackage' + code = """ +def f(x): + return x +""" + + objs = dict(__file__=filename, __name__=name) + compiled = compile(code, filename, 'exec') + exec(compiled, objs) + + compiled_f = njit(objs['f']) + self.assertEqual(compiled_f(3), 3) + + +class TestFuncDescMangledName(unittest.TestCase): + def test_mangling_abi_tags(self): + """ + This is a minimal test for the abi-tags support in the mangler. + """ + def udt(): + pass + + # run minimal frontend to create a function descriptor + func_ir = run_frontend(udt) + typemap = {} + restype = None + calltypes = () + mangler = default_mangler + inline = False + noalias = False + + abi_tags = ("Shrubbery", "Herring") + + fd = PythonFunctionDescriptor.from_specialized_function( + func_ir, typemap, restype, calltypes, mangler, inline, noalias, + abi_tags=abi_tags, + ) + + # mangled tag must exist in the mangled name + self.assertIn("".join([mangle_abi_tag(x) for x in abi_tags]), + fd.mangled_name) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_function_type.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_function_type.py new file mode 100644 index 0000000000000000000000000000000000000000..dce78c2e701a643d273ab4370f16272f87b31cb2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_function_type.py @@ -0,0 +1,1408 @@ +import re +import sys +import unittest +import types as pytypes +from numba import jit, njit, cfunc, types, int64, float64, float32, errors +from numba import literal_unroll, typeof +from numba.core.config import IS_WIN32 +import ctypes +import warnings + +from .support import TestCase, MemoryLeakMixin +from .support import redirect_c_stderr, captured_stderr + +import numpy as np + + +def dump(foo): # FOR DEBUGGING, TO BE REMOVED + from numba.core import function + foo_type = function.fromobject(foo) + foo_sig = foo_type.signature() + foo.compile(foo_sig) + print('{" LLVM IR OF "+foo.__name__+" ":*^70}') + print(foo.inspect_llvm(foo_sig.args)) + print('{"":*^70}') + + +# Decorators for transforming a Python function to different kinds of +# functions: + +def mk_cfunc_func(sig): + def cfunc_func(func): + assert isinstance(func, pytypes.FunctionType), repr(func) + f = cfunc(sig)(func) + f.pyfunc = func + return f + return cfunc_func + + +def njit_func(func): + assert isinstance(func, pytypes.FunctionType), repr(func) + f = jit(nopython=True)(func) + f.pyfunc = func + return f + + +def mk_njit_with_sig_func(sig): + def njit_with_sig_func(func): + assert isinstance(func, pytypes.FunctionType), repr(func) + f = jit(sig, nopython=True)(func) + f.pyfunc = func + return f + return njit_with_sig_func + + +def mk_ctypes_func(sig): + def ctypes_func(func, sig=int64(int64)): + assert isinstance(func, pytypes.FunctionType), repr(func) + cfunc = mk_cfunc_func(sig)(func) + addr = cfunc._wrapper_address + if sig == int64(int64): + f = ctypes.CFUNCTYPE(ctypes.c_int64)(addr) + f.pyfunc = func + return f + raise NotImplementedError( + f'ctypes decorator for {func} with signature {sig}') + return ctypes_func + + +class WAP(types.WrapperAddressProtocol): + """An example implementation of wrapper address protocol. + + """ + def __init__(self, func, sig): + self.pyfunc = func + self.cfunc = cfunc(sig)(func) + self.sig = sig + + def __wrapper_address__(self): + return self.cfunc._wrapper_address + + def signature(self): + return self.sig + + def __call__(self, *args, **kwargs): + return self.pyfunc(*args, **kwargs) + + +def mk_wap_func(sig): + def wap_func(func): + return WAP(func, sig) + return wap_func + + +class TestFunctionType(TestCase): + """Test first-class functions in the context of a Numba jit compiled + function. + + """ + + def test_in__(self): + """Function is passed in as an argument. + """ + + def a(i): + return i + 1 + + def foo(f): + return 0 + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), + njit_func, + mk_njit_with_sig_func(sig), + mk_ctypes_func(sig), + mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__, jit=jit_opts): + a_ = decor(a) + self.assertEqual(jit_(foo)(a_), foo(a)) + + def test_in_call__(self): + """Function is passed in as an argument and called. + Also test different return values. + """ + + def a_i64(i): + return i + 1234567 + + def a_f64(i): + return i + 1.5 + + def a_str(i): + return "abc" + + def foo(f): + return f(123) + + for f, sig in [(a_i64, int64(int64)), (a_f64, float64(int64))]: + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), + mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest( + sig=sig, decor=decor.__name__, jit=jit_opts): + f_ = decor(f) + self.assertEqual(jit_(foo)(f_), foo(f)) + + def test_in_call_out(self): + """Function is passed in as an argument, called, and returned. + """ + + def a(i): + return i + 1 + + def foo(f): + f(123) + return f + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + r1 = jit_(foo)(a_).pyfunc + r2 = foo(a) + self.assertEqual(r1, r2) + + def test_in_seq_call(self): + """Functions are passed in as arguments, used as tuple items, and + called. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(f, g): + r = 0 + for f_ in (f, g): + r = r + f_(r) + return r + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), mk_wap_func(sig), + mk_njit_with_sig_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)(a_, b_), foo(a, b)) + + def test_in_ns_seq_call(self): + """Functions are passed in as an argument and via namespace scoping + (mixed pathways), used as tuple items, and called. + + """ + + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def mkfoo(b_): + def foo(f): + r = 0 + for f_ in (f, b_): + r = r + f_(r) + return r + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), + mk_njit_with_sig_func(sig), mk_wap_func(sig), + mk_ctypes_func(sig)][:-1]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(mkfoo(b_))(a_), mkfoo(b)(a)) + + def test_ns_call(self): + """Function is passed in via namespace scoping and called. + + """ + + def a(i): + return i + 1 + + def mkfoo(a_): + def foo(): + return a_(123) + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(mkfoo(a_))(), mkfoo(a)()) + + def test_ns_out(self): + """Function is passed in via namespace scoping and returned. + + """ + def a(i): + return i + 1 + + def mkfoo(a_): + def foo(): + return a_ + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig), + mk_ctypes_func(sig)][:-1]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(mkfoo(a_))().pyfunc, mkfoo(a)()) + + def test_ns_call_out(self): + """Function is passed in via namespace scoping, called, and then + returned. + + """ + def a(i): + return i + 1 + + def mkfoo(a_): + def foo(): + a_(123) + return a_ + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig), + mk_ctypes_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(mkfoo(a_))().pyfunc, mkfoo(a)()) + + def test_in_overload(self): + """Function is passed in as an argument and called with different + argument types. + + """ + def a(i): + return i + 1 + + def foo(f): + r1 = f(123) + r2 = f(123.45) + return (r1, r2) + + for decor in [njit_func]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(foo)(a_), foo(a)) + + def test_ns_overload(self): + """Function is passed in via namespace scoping and called with + different argument types. + + """ + def a(i): + return i + 1 + + def mkfoo(a_): + def foo(): + r1 = a_(123) + r2 = a_(123.45) + return (r1, r2) + return foo + + for decor in [njit_func]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + self.assertEqual(jit_(mkfoo(a_))(), mkfoo(a)()) + + def test_in_choose(self): + """Functions are passed in as arguments and called conditionally. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(a, b, choose_left): + if choose_left: + r = a(1) + else: + r = b(2) + return r + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)(a_, b_, True), foo(a, b, True)) + self.assertEqual(jit_(foo)(a_, b_, False), + foo(a, b, False)) + self.assertNotEqual(jit_(foo)(a_, b_, True), + foo(a, b, False)) + + def test_ns_choose(self): + """Functions are passed in via namespace scoping and called + conditionally. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def mkfoo(a_, b_): + def foo(choose_left): + if choose_left: + r = a_(1) + else: + r = b_(2) + return r + return foo + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(mkfoo(a_, b_))(True), + mkfoo(a, b)(True)) + self.assertEqual(jit_(mkfoo(a_, b_))(False), + mkfoo(a, b)(False)) + self.assertNotEqual(jit_(mkfoo(a_, b_))(True), + mkfoo(a, b)(False)) + + def test_in_choose_out(self): + """Functions are passed in as arguments and returned conditionally. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(a, b, choose_left): + if choose_left: + return a + else: + return b + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), njit_func, + mk_njit_with_sig_func(sig), mk_wap_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)(a_, b_, True).pyfunc, + foo(a, b, True)) + self.assertEqual(jit_(foo)(a_, b_, False).pyfunc, + foo(a, b, False)) + self.assertNotEqual(jit_(foo)(a_, b_, True).pyfunc, + foo(a, b, False)) + + def test_in_choose_func_value(self): + """Functions are passed in as arguments, selected conditionally and + called. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(a, b, choose_left): + if choose_left: + f = a + else: + f = b + return f(1) + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), mk_wap_func(sig), njit_func, + mk_njit_with_sig_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)(a_, b_, True), foo(a, b, True)) + self.assertEqual(jit_(foo)(a_, b_, False), + foo(a, b, False)) + self.assertNotEqual(jit_(foo)(a_, b_, True), + foo(a, b, False)) + + def test_in_pick_func_call(self): + """Functions are passed in as items of tuple argument, retrieved via + indexing, and called. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(funcs, i): + f = funcs[i] + r = f(123) + return r + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), mk_wap_func(sig), + mk_njit_with_sig_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)((a_, b_), 0), foo((a, b), 0)) + self.assertEqual(jit_(foo)((a_, b_), 1), foo((a, b), 1)) + self.assertNotEqual(jit_(foo)((a_, b_), 0), foo((a, b), 1)) + + def test_in_iter_func_call(self): + """Functions are passed in as items of tuple argument, retrieved via + indexing, and called within a variable for-loop. + + """ + def a(i): + return i + 1 + + def b(i): + return i + 2 + + def foo(funcs, n): + r = 0 + for i in range(n): + f = funcs[i] + r = r + f(r) + return r + + sig = int64(int64) + + for decor in [mk_cfunc_func(sig), mk_wap_func(sig), + mk_njit_with_sig_func(sig)]: + for jit_opts in [dict(nopython=True), dict(forceobj=True)]: + jit_ = jit(**jit_opts) + with self.subTest(decor=decor.__name__): + a_ = decor(a) + b_ = decor(b) + self.assertEqual(jit_(foo)((a_, b_), 2), foo((a, b), 2)) + + def test_experimental_feature_warning(self): + @jit(nopython=True) + def more(x): + return x + 1 + + @jit(nopython=True) + def less(x): + return x - 1 + + @jit(nopython=True) + def foo(sel, x): + fn = more if sel else less + return fn(x) + + with warnings.catch_warnings(record=True) as ws: + warnings.simplefilter("always") + res = foo(True, 10) + + self.assertEqual(res, 11) + self.assertEqual(foo(False, 10), 9) + + self.assertGreaterEqual(len(ws), 1) + pat = "First-class function type feature is experimental" + for w in ws: + if pat in str(w.message): + break + else: + self.fail("missing warning") + + +class TestFunctionTypeExtensions(TestCase): + """Test calling external library functions within Numba jit compiled + functions. + + """ + + def test_wrapper_address_protocol_libm(self): + """Call cos and sinf from standard math library. + + """ + import ctypes.util + + class LibM(types.WrapperAddressProtocol): + + def __init__(self, fname): + if IS_WIN32: + lib = ctypes.cdll.msvcrt + else: + libpath = ctypes.util.find_library('m') + lib = ctypes.cdll.LoadLibrary(libpath) + self.lib = lib + self._name = fname + if fname == 'cos': + # test for double-precision math function + addr = ctypes.cast(self.lib.cos, ctypes.c_voidp).value + signature = float64(float64) + elif fname == 'sinf': + # test for single-precision math function + # Other 32/64 bit platforms define sinf as the + # single-precision sin function + addr = ctypes.cast(self.lib.sinf, ctypes.c_voidp).value + signature = float32(float32) + else: + raise NotImplementedError( + f'wrapper address of `{fname}`' + f' with signature `{signature}`') + self._signature = signature + self._address = addr + + def __repr__(self): + return f'{type(self).__name__}({self._name!r})' + + def __wrapper_address__(self): + return self._address + + def signature(self): + return self._signature + + mycos = LibM('cos') + mysin = LibM('sinf') + + def myeval(f, x): + return f(x) + + # Not testing forceobj=True as it requires implementing + # LibM.__call__ using ctypes which would be out-of-scope here. + for jit_opts in [dict(nopython=True)]: + jit_ = jit(**jit_opts) + with self.subTest(jit=jit_opts): + if mycos.signature() is not None: + self.assertEqual(jit_(myeval)(mycos, 0.0), 1.0) + if mysin.signature() is not None: + self.assertEqual(jit_(myeval)(mysin, float32(0.0)), 0.0) + + def test_compilation_results(self): + """Turn the existing compilation results of a dispatcher instance to + first-class functions with precise types. + """ + + @jit(nopython=True) + def add_template(x, y): + return x + y + + # Trigger compilations + self.assertEqual(add_template(1, 2), 3) + self.assertEqual(add_template(1.2, 3.4), 4.6) + + cres1, cres2 = add_template.overloads.values() + + # Turn compilation results into first-class functions + iadd = types.CompileResultWAP(cres1) + fadd = types.CompileResultWAP(cres2) + + @jit(nopython=True) + def foo(add, x, y): + return add(x, y) + + @jit(forceobj=True) + def foo_obj(add, x, y): + return add(x, y) + + self.assertEqual(foo(iadd, 3, 4), 7) + self.assertEqual(foo(fadd, 3.4, 4.5), 7.9) + + self.assertEqual(foo_obj(iadd, 3, 4), 7) + self.assertEqual(foo_obj(fadd, 3.4, 4.5), 7.9) + + +class TestMiscIssues(TestCase): + """Test issues of using first-class functions in the context of Numba + jit compiled functions. + + """ + + def test_issue_3405_using_cfunc(self): + + @cfunc('int64()') + def a(): + return 2 + + @cfunc('int64()') + def b(): + return 3 + + def g(arg): + if arg: + f = a + else: + f = b + return f() + + self.assertEqual(jit(nopython=True)(g)(True), 2) + self.assertEqual(jit(nopython=True)(g)(False), 3) + + def test_issue_3405_using_njit(self): + + @jit(nopython=True) + def a(): + return 2 + + @jit(nopython=True) + def b(): + return 3 + + def g(arg): + if not arg: + f = b + else: + f = a + return f() + + self.assertEqual(jit(nopython=True)(g)(True), 2) + self.assertEqual(jit(nopython=True)(g)(False), 3) + + def test_pr4967_example(self): + + @cfunc('int64(int64)') + def a(i): + return i + 1 + + @cfunc('int64(int64)') + def b(i): + return i + 2 + + @jit(nopython=True) + def foo(f, g): + i = f(2) + seq = (f, g) + for fun in seq: + i += fun(i) + return i + + a_ = a._pyfunc + b_ = b._pyfunc + self.assertEqual(foo(a, b), + a_(2) + a_(a_(2)) + b_(a_(2) + a_(a_(2)))) + + def test_pr4967_array(self): + import numpy as np + + @cfunc("intp(intp[:], float64[:])") + def foo1(x, y): + return x[0] + y[0] + + @cfunc("intp(intp[:], float64[:])") + def foo2(x, y): + return x[0] - y[0] + + def bar(fx, fy, i): + a = np.array([10], dtype=np.intp) + b = np.array([12], dtype=np.float64) + if i == 0: + f = fx + elif i == 1: + f = fy + else: + return + return f(a, b) + + r = jit(nopython=True, no_cfunc_wrapper=True)(bar)(foo1, foo2, 0) + self.assertEqual(r, bar(foo1, foo2, 0)) + self.assertNotEqual(r, bar(foo1, foo2, 1)) + + def test_reference_example(self): + import numba + + @numba.njit + def composition(funcs, x): + r = x + for f in funcs[::-1]: + r = f(r) + return r + + @numba.cfunc("double(double)") + def a(x): + return x + 1.0 + + @numba.njit() + def b(x): + return x * x + + r = composition((a, b, b, a), 0.5) + self.assertEqual(r, (0.5 + 1.0) ** 4 + 1.0) + + r = composition((b, a, b, b, a), 0.5) + self.assertEqual(r, ((0.5 + 1.0) ** 4 + 1.0) ** 2) + + def test_apply_function_in_function(self): + + def foo(f, f_inner): + return f(f_inner) + + @cfunc('int64(float64)') + def f_inner(i): + return int64(i * 3) + + @cfunc(int64(types.FunctionType(f_inner._sig))) + def f(f_inner): + return f_inner(123.4) + + self.assertEqual(jit(nopython=True)(foo)(f, f_inner), + foo(f._pyfunc, f_inner._pyfunc)) + + def test_function_with_none_argument(self): + + @cfunc(int64(types.none)) + def a(i): + return 1 + + @jit(nopython=True) + def foo(f): + return f(None) + + self.assertEqual(foo(a), 1) + + def test_constant_functions(self): + + @jit(nopython=True) + def a(): + return 123 + + @jit(nopython=True) + def b(): + return 456 + + @jit(nopython=True) + def foo(): + return a() + b() + + r = foo() + if r != 123 + 456: + print(foo.overloads[()].library.get_llvm_str()) + self.assertEqual(r, 123 + 456) + + def test_generators(self): + + @jit(forceobj=True) + def gen(xs): + for x in xs: + x += 1 + yield x + + @jit(forceobj=True) + def con(gen_fn, xs): + return [it for it in gen_fn(xs)] + + self.assertEqual(con(gen, (1, 2, 3)), [2, 3, 4]) + + @jit(nopython=True) + def gen_(xs): + for x in xs: + x += 1 + yield x + self.assertEqual(con(gen_, (1, 2, 3)), [2, 3, 4]) + + def test_jit_support(self): + + @jit(nopython=True) + def foo(f, x): + return f(x) + + @jit() + def a(x): + return x + 1 + + @jit() + def a2(x): + return x - 1 + + @jit() + def b(x): + return x + 1.5 + + self.assertEqual(foo(a, 1), 2) + a2(5) # pre-compile + self.assertEqual(foo(a2, 2), 1) + self.assertEqual(foo(a2, 3), 2) + self.assertEqual(foo(a, 2), 3) + self.assertEqual(foo(a, 1.5), 2.5) + self.assertEqual(foo(a2, 1), 0) + self.assertEqual(foo(a, 2.5), 3.5) + self.assertEqual(foo(b, 1.5), 3.0) + self.assertEqual(foo(b, 1), 2.5) + + def test_signature_mismatch(self): + @jit(nopython=True) + def f1(x): + return x + + @jit(nopython=True) + def f2(x): + return x + + @jit(nopython=True) + def foo(disp1, disp2, sel): + if sel == 1: + fn = disp1 + else: + fn = disp2 + return fn([1]), fn(2) + + with self.assertRaises(errors.UnsupportedError) as cm: + foo(f1, f2, sel=1) + self.assertRegex( + str(cm.exception), 'mismatch of function types:') + + # this works because `sel == 1` condition is optimized away: + self.assertEqual(foo(f1, f1, sel=1), ([1], 2)) + + def test_unique_dispatcher(self): + # In general, the type of a dispatcher instance is imprecise + # and when used as an input to type-inference, the typing will + # likely fail. However, if a dispatcher instance contains + # exactly one overload and compilation is disabled for the dispatcher, + # then the type of dispatcher instance is interpreted as precise + # and is transformed to a FunctionType instance with the defined + # signature of the single overload. + + def foo_template(funcs, x): + r = x + for f in funcs: + r = f(r) + return r + + a = jit(nopython=True)(lambda x: x + 1) + b = jit(nopython=True)(lambda x: x + 2) + foo = jit(nopython=True)(foo_template) + + # compiling and disabling compilation for `a` is sufficient, + # `b` will inherit its type from the container Tuple type + a(0) + a.disable_compile() + + r = foo((a, b), 0) + self.assertEqual(r, 3) + # the Tuple type of foo's first argument is a precise FunctionType: + self.assertEqual(foo.signatures[0][0].dtype.is_precise(), True) + + def test_zero_address(self): + + sig = int64() + + @cfunc(sig) + def test(): + return 123 + + class Good(types.WrapperAddressProtocol): + """A first-class function type with valid address. + """ + + def __wrapper_address__(self): + return test.address + + def signature(self): + return sig + + class Bad(types.WrapperAddressProtocol): + """A first-class function type with invalid 0 address. + """ + + def __wrapper_address__(self): + return 0 + + def signature(self): + return sig + + class BadToGood(types.WrapperAddressProtocol): + """A first-class function type with invalid address that is + recovered to a valid address. + """ + + counter = -1 + + def __wrapper_address__(self): + self.counter += 1 + return test.address * min(1, self.counter) + + def signature(self): + return sig + + good = Good() + bad = Bad() + bad2good = BadToGood() + + @jit(int64(sig.as_type())) + def foo(func): + return func() + + @jit(int64()) + def foo_good(): + return good() + + @jit(int64()) + def foo_bad(): + return bad() + + @jit(int64()) + def foo_bad2good(): + return bad2good() + + self.assertEqual(foo(good), 123) + + self.assertEqual(foo_good(), 123) + + with self.assertRaises(ValueError) as cm: + foo(bad) + self.assertRegex( + str(cm.exception), + 'wrapper address of <.*> instance must be a positive') + + with self.assertRaises(RuntimeError) as cm: + foo_bad() + self.assertRegex( + str(cm.exception), r'.* function address is null') + + self.assertEqual(foo_bad2good(), 123) + + def test_issue_5470(self): + + @njit() + def foo1(): + return 10 + + @njit() + def foo2(): + return 20 + + formulae_foo = (foo1, foo1) + + @njit() + def bar_scalar(f1, f2): + return f1() + f2() + + @njit() + def bar(): + return bar_scalar(*formulae_foo) + + self.assertEqual(bar(), 20) + + formulae_foo = (foo1, foo2) + + @njit() + def bar(): + return bar_scalar(*formulae_foo) + + self.assertEqual(bar(), 30) + + def test_issue_5540(self): + + @njit(types.int64(types.int64)) + def foo(x): + return x + 1 + + @njit + def bar_bad(foos): + f = foos[0] + return f(x=1) + + @njit + def bar_good(foos): + f = foos[0] + return f(1) + + self.assertEqual(bar_good((foo, )), 2) + + # new/old style error handling + with self.assertRaises((errors.UnsupportedError, + errors.TypingError)) as cm: + bar_bad((foo, )) + + self.assertRegex( + str(cm.exception), + r'.*first-class function call cannot use keyword arguments') + + def test_issue_5615(self): + + @njit + def foo1(x): + return x + 1 + + @njit + def foo2(x): + return x + 2 + + @njit + def bar(fcs): + x = 0 + a = 10 + i, j = fcs[0] + x += i(j(a)) + for t in literal_unroll(fcs): + i, j = t + x += i(j(a)) + return x + + tup = ((foo1, foo2), (foo2, foo1)) + + self.assertEqual(bar(tup), 39) + + def test_issue_5685(self): + + @njit + def foo1(): + return 1 + + @njit + def foo2(x): + return x + 1 + + @njit + def foo3(x): + return x + 2 + + @njit + def bar(fcs): + r = 0 + for pair in literal_unroll(fcs): + f1, f2 = pair + r += f1() + f2(2) + return r + + self.assertEqual(bar(((foo1, foo2),)), 4) + self.assertEqual(bar(((foo1, foo2), (foo1, foo3))), 9) # reproducer + + +class TestBasicSubtyping(TestCase): + def test_basic(self): + """ + Test that a dispatcher object *with* a pre-compiled overload + can be used as input to another function with locked-down signature + """ + a = 1 + + @njit + def foo(x): + return x + 1 + + foo(a) + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + @njit(types.int64(int_int_fc)) + def bar(fc): + return fc(a) + + self.assertEqual(bar(foo), foo(a)) + + def test_basic2(self): + """ + Test that a dispatcher object *without* a pre-compiled overload + can be used as input to another function with locked-down signature + """ + a = 1 + + @njit + def foo(x): + return x + 1 + + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + @njit(types.int64(int_int_fc)) + def bar(fc): + return fc(a) + + self.assertEqual(bar(foo), foo(a)) + + def test_basic3(self): + """ + Test that a dispatcher object *without* a pre-compiled overload + can be used as input to another function with locked-down signature and + that it behaves as a truly generic function (foo1 does not get locked) + """ + a = 1 + + @njit + def foo1(x): + return x + 1 + + @njit + def foo2(x): + return x + 2 + + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + @njit(types.int64(int_int_fc)) + def bar(fc): + return fc(a) + + self.assertEqual(bar(foo1) + 1, bar(foo2)) + + def test_basic4(self): + """ + Test that a dispatcher object can be used as input to another + function with signature as part of a tuple + """ + a = 1 + + @njit + def foo1(x): + return x + 1 + + @njit + def foo2(x): + return x + 2 + + tup = (foo1, foo2) + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + @njit(types.int64(types.UniTuple(int_int_fc, 2))) + def bar(fcs): + x = 0 + for i in range(2): + x += fcs[i](a) + return x + self.assertEqual(bar(tup), foo1(a) + foo2(a)) + + def test_basic5(self): + a = 1 + + @njit + def foo1(x): + return x + 1 + + @njit + def foo2(x): + return x + 2 + + @njit + def bar1(x): + return x / 10 + + @njit + def bar2(x): + return x / 1000 + + tup = (foo1, foo2) + tup_bar = (bar1, bar2) + int_int_fc = types.FunctionType(types.int64(types.int64,)) + + flt_flt_fc = types.FunctionType(types.float64(types.float64,)) + + @njit((types.UniTuple(int_int_fc, 2), types.UniTuple(flt_flt_fc, 2))) + def bar(fcs, ffs): + x = 0 + for i in range(2): + x += fcs[i](a) + for fn in ffs: + x += fn(a) + return x + + got = bar(tup, tup_bar) + expected = foo1(a) + foo2(a) + bar1(a) + bar2(a) + self.assertEqual(got, expected) + + +class TestMultiFunctionType(MemoryLeakMixin, TestCase): + + def test_base(self): + # The test is adapted from https://github.com/numba/numba/issues/9071 + nb_array = typeof(np.ones(2)) + callee_int_type = types.FunctionType(int64(int64)) + sig_int = int64(callee_int_type, int64) + callee_array_type = types.FunctionType(float64(nb_array)) + sig_array = float64(callee_array_type, nb_array) + + @njit([sig_int, sig_array]) + def caller(callee, a): + return callee(a) + + @njit + def callee_int(b): + return b + + @njit + def callee_array(c): + return c.sum() + + b = 1 + c = np.ones(2) + + self.assertEqual(caller(callee_int, b), b) + self.assertEqual(caller(callee_array, c), c.sum()) + + +class TestInliningFunctionType(MemoryLeakMixin, TestCase): + def count_num_bb_in_cfg(self, dispatcher): + dot = dispatcher.inspect_cfg(dispatcher.signatures[0]).dot + num_of_nodes = re.findall(r"Node0x[0-9a-z]+", dot) + return len(num_of_nodes) + + def test_inlining_global_dispatcher(self): + @njit + def add(x, y): + return x + y + + fnty = types.FunctionType(int64(int64, int64)) + + @njit(int64(fnty, int64, int64)) + def callme(fn, x, y): + c = 0 + for i in range(100): + c += fn(x, y) + return c + + @njit + def bar(x, y): + return callme(add, x, y) + + res = bar(123, 321) + self.assertEqual(100 * (123 + 321), res) + # There's only one BB because LLVM will be able to fully optimize + # the reduce-add loop if add() is properly inlined. + self.assertEqual(self.count_num_bb_in_cfg(bar), 1) + + def test_not_inlining_dispatcher_args(self): + @njit + def add(x, y): + return x + y + + fnty = types.FunctionType(int64(int64, int64)) + + @njit(int64(fnty, int64, int64)) + def callme(fn, x, y): + c = 0 + for i in range(100): + c += fn(x, y) + return c + + res = callme(add, 123, 321) + + self.assertEqual(100 * (123 + 321), res) + # Since add() is not inline-able. The number of BB will be greater + # than 1. See test_inlining_global_dispatcher(). + self.assertGreater(self.count_num_bb_in_cfg(callme), 1) + + +class TestExceptionInFunctionType(MemoryLeakMixin, TestCase): + def test_exception_raising(self): + class MyError(Exception): + pass + + @njit + def add(x, y): + res = x + y + if res > 100: + raise MyError(res) + return res + + fnty = types.FunctionType(int64(int64, int64)) + + @njit(int64(fnty)) + def callme(fn): + c = 0 + for i in range(100): + c = fn(c, i) + return c + + @njit + def bar(): + return callme(add) + + # Pass Dispatcher as a global reference + with self.assertRaises(MyError) as exc: + bar() + self.assertEqual(exc.exception.args, (105,)) + + # Pass Dispatcher by argument + with self.assertRaises(MyError) as exc: + callme(add) + self.assertEqual(exc.exception.args, (105,)) + + def test_exception_ignored_in_cfunc(self): + class MyError(Exception): + pass + + @njit + def add(x, y): + res = x + y + if res > 100: + raise MyError(res) + return res + + fnty = types.FunctionType(int64(int64, int64)) + + @njit(int64(fnty, int64, int64)) + def callme(fn, x, y): + return fn(x, y) + + # Cfunc as argument will ignore raised exception + @cfunc(int64(int64, int64)) + def c_add(x, y): + return add(x, y) + + self.assertEqual(callme(c_add, 12, 32), 44) + + # If unittest is buffering (-b), the message goes to Python level stderr + # otherwise, it goes to C stderr. + with redirect_c_stderr() as c_stderr, captured_stderr() as stderr: + # raise ignored and result is garbage + callme(c_add, 100, 1) + sys.stderr.flush() + + err = c_stderr.read() + if not err: + err = stderr.getvalue() + + self.assertIn("Exception ignored in:", err) + self.assertIn(str(MyError(101)), err) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_gdb_bindings.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_gdb_bindings.py new file mode 100644 index 0000000000000000000000000000000000000000..16d6afc4a301d08c20b129069892f8ff71cafba3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_gdb_bindings.py @@ -0,0 +1,277 @@ +""" +Tests gdb bindings +""" +import os +import platform +import re +import subprocess +import sys +import threading +from itertools import permutations + +from numba import njit, gdb, gdb_init, gdb_breakpoint, prange +from numba.core import errors +from numba import jit + +from numba.tests.support import (TestCase, captured_stdout, tag, + skip_parfors_unsupported) +from numba.tests.gdb_support import needs_gdb +import unittest + + +_platform = sys.platform + +_unix_like = (_platform.startswith('linux') + or _platform.startswith('darwin') + or ('bsd' in _platform)) + +unix_only = unittest.skipUnless(_unix_like, "unix-like OS is required") +not_unix = unittest.skipIf(_unix_like, "non unix-like OS is required") + +_arch_name = platform.machine() +_is_arm = _arch_name in {'aarch64', 'armv7l'} +not_arm = unittest.skipIf(_is_arm, "testing disabled on ARM") + +_gdb_cond = os.environ.get('GDB_TEST', None) == '1' +needs_gdb_harness = unittest.skipUnless(_gdb_cond, "needs gdb harness") + +long_running = tag('long_running') + +_dbg_njit = njit(debug=True) +_dbg_jit = jit(forceobj=True, debug=True) + + +def impl_gdb_call(a): + gdb('-ex', 'set confirm off', '-ex', 'c', '-ex', 'q') + b = a + 1 + c = a * 2.34 + d = (a, b, c) + print(a, b, c, d) + + +def impl_gdb_call_w_bp(a): + gdb_init('-ex', 'set confirm off', '-ex', 'c', '-ex', 'q') + b = a + 1 + c = a * 2.34 + d = (a, b, c) + gdb_breakpoint() + print(a, b, c, d) + + +def impl_gdb_split_init_and_break_w_parallel(a): + gdb_init('-ex', 'set confirm off', '-ex', 'c', '-ex', 'q') + a += 3 + for i in prange(4): + b = a + 1 + c = a * 2.34 + d = (a, b, c) + gdb_breakpoint() + print(a, b, c, d) + + +@not_arm +@unix_only +class TestGdbBindImpls(TestCase): + """ + Contains unit test implementations for gdb binding testing. Test must be + decorated with `@needs_gdb_harness` to prevent their running under normal + test conditions, the test methods must also end with `_impl` to be + considered for execution. The tests themselves are invoked by the + `TestGdbBinding` test class through the parsing of this class for test + methods and then running the discovered tests in a separate process. Test + names not including the word `quick` will be tagged as @tag('long_running') + """ + + @needs_gdb_harness + def test_gdb_cmd_lang_cpython_quick_impl(self): + with captured_stdout(): + impl_gdb_call(10) + + @needs_gdb_harness + def test_gdb_cmd_lang_nopython_quick_impl(self): + with captured_stdout(): + _dbg_njit(impl_gdb_call)(10) + + @needs_gdb_harness + def test_gdb_cmd_lang_objmode_quick_impl(self): + with captured_stdout(): + _dbg_jit(impl_gdb_call)(10) + + @needs_gdb_harness + def test_gdb_split_init_and_break_cpython_impl(self): + with captured_stdout(): + impl_gdb_call_w_bp(10) + + @needs_gdb_harness + def test_gdb_split_init_and_break_nopython_impl(self): + with captured_stdout(): + _dbg_njit(impl_gdb_call_w_bp)(10) + + @needs_gdb_harness + def test_gdb_split_init_and_break_objmode_impl(self): + with captured_stdout(): + _dbg_jit(impl_gdb_call_w_bp)(10) + + @skip_parfors_unsupported + @needs_gdb_harness + def test_gdb_split_init_and_break_w_parallel_cpython_impl(self): + with captured_stdout(): + impl_gdb_split_init_and_break_w_parallel(10) + + @skip_parfors_unsupported + @needs_gdb_harness + def test_gdb_split_init_and_break_w_parallel_nopython_impl(self): + with captured_stdout(): + _dbg_njit(impl_gdb_split_init_and_break_w_parallel)(10) + + @skip_parfors_unsupported + @needs_gdb_harness + def test_gdb_split_init_and_break_w_parallel_objmode_impl(self): + with captured_stdout(): + _dbg_jit(impl_gdb_split_init_and_break_w_parallel)(10) + + +@not_arm +@unix_only +@needs_gdb +class TestGdbBinding(TestCase): + """ + This test class is used to generate tests which will run the test cases + defined in TestGdbBindImpls in isolated subprocesses, this is for safety + in case something goes awry. + """ + + # test mutates env + _numba_parallel_test_ = False + + _DEBUG = True + + def run_cmd(self, cmdline, env, kill_is_ok=False): + popen = subprocess.Popen(cmdline, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=env, + shell=True) + # finish in 20s or kill it, there's no work being done + + def kill(): + popen.stdout.flush() + popen.stderr.flush() + popen.kill() + timeout = threading.Timer(20., kill) + try: + timeout.start() + out, err = popen.communicate() + retcode = popen.returncode + if retcode != 0: + raise AssertionError( + "process failed with code %s: " + "stderr follows\n%s\n" + "stdout :%s" % (retcode, err.decode(), out.decode())) + return out.decode(), err.decode() + finally: + timeout.cancel() + return None, None + + def run_test_in_separate_process(self, test, **kwargs): + env_copy = os.environ.copy() + env_copy['NUMBA_OPT'] = '1' + # Set GDB_TEST to permit the execution of tests decorated with + # @needs_gdb_harness + env_copy['GDB_TEST'] = '1' + cmdline = [sys.executable, "-m", "numba.runtests", test] + return self.run_cmd(' '.join(cmdline), env_copy, **kwargs) + + @classmethod + def _inject(cls, name): + themod = TestGdbBindImpls.__module__ + thecls = TestGdbBindImpls.__name__ + # strip impl + assert name.endswith('_impl') + methname = name.replace('_impl', '') + injected_method = '%s.%s.%s' % (themod, thecls, name) + + def test_template(self): + o, e = self.run_test_in_separate_process(injected_method) + dbgmsg = f'\nSTDOUT={o}\nSTDERR={e}\n' + # If the test was skipped in the subprocess, then mark this as a + # skipped test. + m = re.search(r"\.\.\. skipped '(.*?)'", e) + if m is not None: + self.skipTest(m.group(1)) + self.assertIn('GNU gdb', o, msg=dbgmsg) + self.assertIn('OK', e, msg=dbgmsg) + self.assertNotIn('FAIL', e, msg=dbgmsg) + self.assertNotIn('ERROR', e, msg=dbgmsg) + if 'quick' in name: + setattr(cls, methname, test_template) + else: + setattr(cls, methname, long_running(test_template)) + + @classmethod + def generate(cls): + for name in dir(TestGdbBindImpls): + if name.startswith('test_gdb'): + cls._inject(name) + + +TestGdbBinding.generate() + + +@not_arm +@unix_only +@needs_gdb +class TestGdbMisc(TestCase): + + @long_running + def test_call_gdb_twice(self): + def gen(f1, f2): + @njit + def impl(): + a = 1 + f1() + b = 2 + f2() + return a + b + return impl + + msg_head = "Calling either numba.gdb() or numba.gdb_init() more than" + + def check(func): + with self.assertRaises(errors.UnsupportedError) as raises: + func() + self.assertIn(msg_head, str(raises.exception)) + + for g1, g2 in permutations([gdb, gdb_init]): + func = gen(g1, g2) + check(func) + + @njit + def use_globals(): + a = 1 + gdb() + b = 2 + gdb_init() + return a + b + + check(use_globals) + + +@not_unix +class TestGdbExceptions(TestCase): + + def test_call_gdb(self): + def nop_compiler(x): + return x + for compiler in [nop_compiler, jit(forceobj=True), njit]: + for meth in [gdb, gdb_init]: + def python_func(): + meth() + with self.assertRaises(errors.TypingError) as raises: + compiler(python_func)() + msg = "gdb support is only available on unix-like systems" + self.assertIn(msg, str(raises.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_gdb_dwarf.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_gdb_dwarf.py new file mode 100644 index 0000000000000000000000000000000000000000..07aecbf40e368db8b2df96128d19955337300cc2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_gdb_dwarf.py @@ -0,0 +1,261 @@ +"""Tests for gdb interacting with the DWARF numba generates""" +from numba.tests.support import TestCase, linux_only +from numba.tests.gdb_support import needs_gdb, skip_unless_pexpect, GdbMIDriver +from unittest.mock import patch, Mock +from numba.core import datamodel +import numpy as np +from numba import typeof +import ctypes as ct +import unittest + + +@linux_only +@needs_gdb +@skip_unless_pexpect +class TestGDBDwarf(TestCase): + # This runs the tests in numba.tests.gdb, each submodule must contain one + # test class called "Test" and it must contain one test called "test". + # Variation is provided by the module name. The reason this convention exits + # is because gdb tests tend to be line number sensitive (breakpoints etc + # care about this) and doing this prevents constant churn and permits the + # reuse of the existing subprocess_test_runner harness. + _NUMBA_OPT_0_ENV = {'NUMBA_OPT': '0'} + + def _gdb_has_numpy(self): + """Returns True if gdb has NumPy support, False otherwise""" + driver = GdbMIDriver(__file__, debug=False,) + has_numpy = driver.supports_numpy() + driver.quit() + return has_numpy + + def _subprocess_test_runner(self, test_mod): + themod = f'numba.tests.gdb.{test_mod}' + self.subprocess_test_runner(test_module=themod, + test_class='Test', + test_name='test', + envvars=self._NUMBA_OPT_0_ENV) + + def test_basic(self): + self._subprocess_test_runner('test_basic') + + def test_array_arg(self): + self._subprocess_test_runner('test_array_arg') + + def test_conditional_breakpoint(self): + self._subprocess_test_runner('test_conditional_breakpoint') + + def test_break_on_symbol(self): + self._subprocess_test_runner('test_break_on_symbol') + + def test_break_on_symbol_version(self): + self._subprocess_test_runner('test_break_on_symbol_version') + + def test_pretty_print(self): + if not self._gdb_has_numpy(): + _msg = "Cannot find gdb with NumPy support" + self.skipTest(_msg) + + self._subprocess_test_runner('test_pretty_print') + + +class TestGDBPrettyPrinterLogic(TestCase): + # Tests the logic in numba.misc.gdb_print_extension.NumbaArrayPrinter + # it's quite involved and susceptible to changes to the string + # representation of Numba array and dtypes as it parses these + # representations and recreates NumPy array/dtypes based on them! + + def setUp(self): + # Patch sys.modules with mock gdb modules such that the + # numba.misc.gdb_print_extension can import ok, the rest of the gdb + # classes etc are implemented later + + mock_modules = {'gdb': Mock(), + 'gdb.printing': Mock()} + self.patched_sys = patch.dict('sys.modules', mock_modules) + self.patched_sys.start() + + # Now sys.modules has a gdb in it, patch the gdb.selected_inferior. + # This function should return a process wrapping object that has a + # read_memory method that can read a memory region from a given address + # in the process' address space. + + import gdb + + class SelectedInferior(): + + def read_memory(self, data, extent): + buf = (ct.c_char * extent).from_address(data) + return buf.raw # this is bytes + + si = SelectedInferior() + gdb.configure_mock(**{'selected_inferior': lambda :si}) + + def tearDown(self): + # drop the sys.modules patch + self.patched_sys.stop() + + def get_gdb_repr(self, array): + # Returns the gdb repr of an array as reconstructed via the + # gdb_print_extension (should be the same as NumPy!). + + # This is the module being tested, it uses gdb and gdb.printing, both + # of which are mocked in self.setUp() + from numba.misc import gdb_print_extension + + # The following classes are ducks for the gdb classes (which are not + # easily/guaranteed importable from the test suite). They implement the + # absolute bare minimum necessary to test the gdb_print_extension. + + class DISubrange(): + def __init__(self, lo, hi): + self._lo = lo + self._hi = hi + + @property + def type(self): + return self + + def range(self): + return self._lo, self._hi + + class DW_TAG_array_type(): + def __init__(self, lo, hi): + self._lo, self._hi = lo, hi + + def fields(self): + return [DISubrange(self._lo, self._hi),] + + class DIDerivedType_tuple(): + def __init__(self, the_tuple): + self._type = DW_TAG_array_type(0, len(the_tuple) - 1) + self._tuple = the_tuple + + @property + def type(self): + return self._type + + def __getitem__(self, item): + return self._tuple[item] + + class DICompositeType_Array(): + def __init__(self, arr, type_str): + self._arr = arr + self._type_str = type_str + + def __getitem__(self, item): + return getattr(self, item) + + @property + def data(self): + return self._arr.ctypes.data + + @property + def itemsize(self): + return self._arr.itemsize + + @property + def shape(self): + return DIDerivedType_tuple(self._arr.shape) + + @property + def strides(self): + return DIDerivedType_tuple(self._arr.strides) + + @property + def type(self): + return self._type_str + + # The type string encoded into the DWARF is the string repr of the Numba + # type followed by the LLVM repr of the data model in brackets. + dmm = datamodel.default_manager + array_model = datamodel.models.ArrayModel(dmm, typeof(array)) + data_type = array_model.get_data_type() + type_str = f"{typeof(array)} ({data_type.structure_repr()})" + fake_gdb_arr = DICompositeType_Array(array, type_str) + + printer = gdb_print_extension.NumbaArrayPrinter(fake_gdb_arr) + + return printer.to_string().strip() # strip, there's new lines + + def check(self, array): + gdb_printed = self.get_gdb_repr(array) + self.assertEqual(str(gdb_printed), str(array)) + + def test_np_array_printer_simple_numeric_types(self): + # Tests printer over a selection of basic types + n = 4 + m = 3 + + for dt in (np.int8, np.uint16, np.int64, np.float32, np.complex128): + arr = np.arange(m * n, dtype=dt).reshape(m, n) + self.check(arr) + + def test_np_array_printer_simple_numeric_types_strided(self): + # Tests printer over randomized strided arrays + n_tests = 30 + np.random.seed(0) + + for _ in range(n_tests): + + shape = np.random.randint(1, high=12, size=np.random.randint(1, 5)) + tmp = np.arange(np.prod(shape)).reshape(shape) + + slices = [] + for x in shape: + start = np.random.randint(0, x) + # x + 3 is to ensure that sometimes the stop is beyond the + # end of the size in a given dimension + stop = np.random.randint(start + 1, max(start + 1, x + 3)) + step = np.random.randint(1, 3) # step as 1, 2 + strd = slice(start, stop, step) + slices.append(strd) + + arr = tmp[tuple(slices)] + self.check(arr) + + def test_np_array_printer_simple_structured_dtype(self): + # Tests printer over a selection of basic types + n = 4 + m = 3 + + aligned = np.dtype([("x", np.int16), ("y", np.float64)], align=True) + unaligned = np.dtype([("x", np.int16), ("y", np.float64)], align=False) + + for dt in (aligned, unaligned): + arr = np.empty(m * n, dtype=dt).reshape(m, n) + arr['x'] = np.arange(m * n, dtype=dt['x']).reshape(m, n) + arr['y'] = 100 * np.arange(m * n, dtype=dt['y']).reshape(m, n) + self.check(arr) + + def test_np_array_printer_chr_array(self): + # Test unichr array + arr = np.array(['abcde']) + self.check(arr) + + def test_np_array_printer_unichr_structured_dtype(self): + # Not supported yet + n = 4 + m = 3 + + dt = np.dtype([("x", ' C order + noncontig, # 1d non-contig -> A order + (noncontig, contig), # 2d C order + (contig, noncontig), # 2d F order + (noncontig, noncontig), # 2d A order + (noncontig, noncontig, contig), # 3d C order + (contig, noncontig, noncontig), # 3d F order + (noncontig, noncontig, noncontig), # 3d A order + ) + + for ty, idx in product(tys, indexes): + compilable = njit(gen(ty, idx)) + # check the type of the typed list returned matches the type + # as constructed in the interpreter + expected = ty[idx] + # check execution + self.assertEqual(compilable()._dtype, expected) + got = compilable.nopython_signatures[0].return_type.dtype + # check sig + self.assertEqual(got, expected) + + def test_shorthand_syntax(self): + # tests a couple of shorthand syntax examples + # (test_static_getitem_on_type is a more extensive test of the + # functionality but it uses slices directly). + + @njit + def foo1(): + ty = types.float32[::1, :] # 2d F order + return typed.List.empty_list(ty) + + self.assertEqual(foo1()._dtype, types.float32[::1, :]) + + @njit + def foo2(): + ty = types.complex64[:, :, :] # 3d A order + return typed.List.empty_list(ty) + + self.assertEqual(foo2()._dtype, types.complex64[:, :, :]) + + def test_static_getitem_on_invalid_type(self): + # check that an unsupported type cannot be instantiated in njit code + + # check this executes in the interpreter: + types.void[:] + + # check the same fails in compilation as it's not supported + # it'll fall back to a generic getitem + with self.assertRaises(errors.TypingError) as raises: + @njit + def foo(): + types.void[:] + + foo() + + msg = ("No implementation", + "getitem(typeref[none], slice)") + + excstr = str(raises.exception) + for m in msg: + self.assertIn(m, excstr) + + def test_standard_getitem_on_type(self): + # not supported at present, should be doable if the slice is a literal + # though. + + # check using a non-static arg to the getitem raises + with self.assertRaises(errors.TypingError) as raises: + @njit + def foo(not_static): + types.float64[not_static] + + foo(slice(None, None, 1)) + + msg = ("No implementation", + "getitem(class(float64), slice)") + + excstr = str(raises.exception) + for m in msg: + self.assertIn(m, excstr) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_gil.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_gil.py new file mode 100644 index 0000000000000000000000000000000000000000..639ef06eaa4dbcfcce00de02a10a8cfc62807b61 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_gil.py @@ -0,0 +1,182 @@ +import ctypes +import ctypes.util +import os +import sys +import threading +import warnings + +import numpy as np + +import unittest +from numba import jit +from numba.core import errors +from numba.tests.support import TestCase, tag + + +# This CPython API function is a portable way to get the current thread id. +PyThread_get_thread_ident = ctypes.pythonapi.PyThread_get_thread_ident +PyThread_get_thread_ident.restype = ctypes.c_long +PyThread_get_thread_ident.argtypes = [] + +# A way of sleeping from nopython code +if os.name == 'nt': + sleep = ctypes.windll.kernel32.Sleep + sleep.argtypes = [ctypes.c_uint] + sleep.restype = None + sleep_factor = 1 # milliseconds +else: + sleep = ctypes.CDLL(ctypes.util.find_library("c")).usleep + sleep.argtypes = [ctypes.c_uint] + sleep.restype = ctypes.c_int + sleep_factor = 1000 # microseconds + + +def f(a, indices): + # If run from one thread at a time, the function will always fill the + # array with identical values. + # If run from several threads at a time, the function will probably + # fill the array with differing values. + for idx in indices: + # Let another thread run + sleep(10 * sleep_factor) + a[idx] = PyThread_get_thread_ident() + +f_sig = "void(int64[:], intp[:])" + +def lifted_f(a, indices): + """ + Same as f(), but inside a lifted loop + """ + object() # Force object mode + for idx in indices: + # Let another thread run + sleep(10 * sleep_factor) + a[idx] = PyThread_get_thread_ident() + +def object_f(a, indices): + """ + Same as f(), but in object mode + """ + for idx in indices: + # Let another thread run + sleep(10 * sleep_factor) + object() # Force object mode + a[idx] = PyThread_get_thread_ident() + + +class TestGILRelease(TestCase): + + def make_test_array(self, n_members): + return np.arange(n_members, dtype=np.int64) + + def run_in_threads(self, func, n_threads): + # Run the function in parallel over an array and collect results. + threads = [] + # Warm up compilation, since we don't want that to interfere with + # the test proper. + func(self.make_test_array(1), np.arange(1, dtype=np.intp)) + arr = self.make_test_array(50) + for i in range(n_threads): + # Ensure different threads write into the array in different + # orders. + indices = np.arange(arr.size, dtype=np.intp) + np.random.shuffle(indices) + t = threading.Thread(target=func, args=(arr, indices)) + threads.append(t) + for t in threads: + t.start() + for t in threads: + t.join() + return arr + + def check_gil_held(self, func): + arr = self.run_in_threads(func, n_threads=4) + distinct = set(arr) + self.assertEqual(len(distinct), 1, distinct) + + def check_gil_released(self, func): + for n_threads in (4, 12, 32): + # Try harder each time. On an empty machine 4 threads seems + # sufficient, but in some contexts (e.g. Travis CI) we need more. + arr = self.run_in_threads(func, n_threads) + distinct = set(arr) + try: + self.assertGreater(len(distinct), 1, distinct) + except AssertionError as e: + failure = e + else: + return + raise failure + + def test_gil_held(self): + """ + Test the GIL is held by default, by checking serialized runs + produce deterministic results. + """ + cfunc = jit(f_sig, nopython=True)(f) + self.check_gil_held(cfunc) + + def test_gil_released(self): + """ + Test releasing the GIL, by checking parallel runs produce + unpredictable results. + """ + cfunc = jit(f_sig, nopython=True, nogil=True)(f) + self.check_gil_released(cfunc) + + def test_gil_released_inside_lifted_loop(self): + """ + Test the GIL can by released by a lifted loop even though the + surrounding code uses object mode. + """ + cfunc = jit(f_sig, forceobj=True, nogil=True)(lifted_f) + self.check_gil_released(cfunc) + + def test_gil_released_by_caller(self): + """ + Releasing the GIL in the caller is sufficient to have it + released in a callee. + """ + compiled_f = jit(f_sig, nopython=True)(f) + @jit(f_sig, nopython=True, nogil=True) + def caller(a, i): + compiled_f(a, i) + self.check_gil_released(caller) + + def test_gil_released_by_caller_and_callee(self): + """ + Same, but with both caller and callee asking to release the GIL. + """ + compiled_f = jit(f_sig, nopython=True, nogil=True)(f) + @jit(f_sig, nopython=True, nogil=True) + def caller(a, i): + compiled_f(a, i) + self.check_gil_released(caller) + + def test_gil_ignored_by_callee(self): + """ + When only the callee asks to release the GIL, it gets ignored. + """ + compiled_f = jit(f_sig, nopython=True, nogil=True)(f) + @jit(f_sig, nopython=True) + def caller(a, i): + compiled_f(a, i) + self.check_gil_held(caller) + + def test_object_mode(self): + """ + When the function is compiled in object mode, a warning is + printed out. + """ + with warnings.catch_warnings(record=True) as wlist: + warnings.simplefilter('always', errors.NumbaWarning) + cfunc = jit(f_sig, forceobj=True, nogil=True)(object_f) + self.assertTrue(any(w.category is errors.NumbaWarning + and "Code running in object mode won't allow parallel execution" in str(w.message) + for w in wlist), wlist) + # Just check it doesn't crash. + self.run_in_threads(cfunc, 2) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_globals.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_globals.py new file mode 100644 index 0000000000000000000000000000000000000000..6cdcb8605aef1c55cea37ea8c8dd0f25f493ff45 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_globals.py @@ -0,0 +1,266 @@ +import numpy as np +from numba import jit, njit, errors +from numba.extending import register_jitable +from numba.tests import usecases +import unittest + +X = np.arange(10) + + +def global_ndarray_func(x): + y = x + X.shape[0] + return y + + +# Create complex array with real and imaginary parts of distinct value +cplx_X = np.arange(10, dtype=np.complex128) +tmp = np.arange(10, dtype=np.complex128) +cplx_X += (tmp+10)*1j + + +def global_cplx_arr_copy(a): + for i in range(len(a)): + a[i] = cplx_X[i] + + +# Create a recarray with fields of distinct value +x_dt = np.dtype([('a', np.int32), ('b', np.float32)]) +rec_X = np.recarray(10, dtype=x_dt) +for i in range(len(rec_X)): + rec_X[i].a = i + rec_X[i].b = i + 0.5 + + +def global_rec_arr_copy(a): + for i in range(len(a)): + a[i] = rec_X[i] + + +def global_rec_arr_extract_fields(a, b): + for i in range(len(a)): + a[i] = rec_X[i].a + b[i] = rec_X[i].b + + +# Create additional global recarray +y_dt = np.dtype([('c', np.int16), ('d', np.float64)]) +rec_Y = np.recarray(10, dtype=y_dt) +for i in range(len(rec_Y)): + rec_Y[i].c = i + 10 + rec_Y[i].d = i + 10.5 + + +def global_two_rec_arrs(a, b, c, d): + for i in range(len(a)): + a[i] = rec_X[i].a + b[i] = rec_X[i].b + c[i] = rec_Y[i].c + d[i] = rec_Y[i].d + + +# Test a global record +record_only_X = np.recarray(1, dtype=x_dt)[0] +record_only_X.a = 1 +record_only_X.b = 1.5 + +@jit(nopython=True) +def global_record_func(x): + return x.a == record_only_X.a + + +@jit(nopython=True) +def global_module_func(x, y): + return usecases.andornopython(x, y) + +# Test a global tuple +tup_int = (1, 2) +tup_str = ('a', 'b') +tup_mixed = (1, 'a') +tup_float = (1.2, 3.5) +tup_npy_ints = (np.uint64(12), np.int8(3)) +tup_tup_array = ((np.ones(5),),) +mixed_tup_tup_array = (('Z', np.ones(5),), 2j, 'A') + +def global_int_tuple(): + return tup_int[0] + tup_int[1] + + +def global_str_tuple(): + return tup_str[0] + tup_str[1] + + +def global_mixed_tuple(): + idx = tup_mixed[0] + field = tup_mixed[1] + return rec_X[idx][field] + + +def global_float_tuple(): + return tup_float[0] + tup_float[1] + + +def global_npy_int_tuple(): + return tup_npy_ints[0] + tup_npy_ints[1] + + +def global_write_to_arr_in_tuple(): + tup_tup_array[0][0][0] = 10. + + +def global_write_to_arr_in_mixed_tuple(): + mixed_tup_tup_array[0][1][0] = 10. + + +_glbl_np_bool_T = np.bool_(True) +_glbl_np_bool_F = np.bool_(False) + + +@register_jitable # consumer function +def _sink(*args): + pass + +def global_npy_bool(): + _sink(_glbl_np_bool_T, _glbl_np_bool_F) + return _glbl_np_bool_T, _glbl_np_bool_F + + +class TestGlobals(unittest.TestCase): + + def check_global_ndarray(self, **jitargs): + # (see github issue #448) + ctestfunc = jit(**jitargs)(global_ndarray_func) + self.assertEqual(ctestfunc(1), 11) + + def test_global_ndarray(self): + # This also checks we can access an unhashable global value + # (see issue #697) + self.check_global_ndarray(forceobj=True) + + def test_global_ndarray_npm(self): + self.check_global_ndarray(nopython=True) + + + def check_global_complex_arr(self, **jitargs): + # (see github issue #897) + ctestfunc = jit(**jitargs)(global_cplx_arr_copy) + arr = np.zeros(len(cplx_X), dtype=np.complex128) + ctestfunc(arr) + np.testing.assert_equal(arr, cplx_X) + + def test_global_complex_arr(self): + self.check_global_complex_arr(forceobj=True) + + def test_global_complex_arr_npm(self): + self.check_global_complex_arr(nopython=True) + + + def check_global_rec_arr(self, **jitargs): + # (see github issue #897) + ctestfunc = jit(**jitargs)(global_rec_arr_copy) + arr = np.zeros(rec_X.shape, dtype=x_dt) + ctestfunc(arr) + np.testing.assert_equal(arr, rec_X) + + def test_global_rec_arr(self): + self.check_global_rec_arr(forceobj=True) + + def test_global_rec_arr_npm(self): + self.check_global_rec_arr(nopython=True) + + + def check_global_rec_arr_extract(self, **jitargs): + # (see github issue #897) + ctestfunc = jit(**jitargs)(global_rec_arr_extract_fields) + arr1 = np.zeros(rec_X.shape, dtype=np.int32) + arr2 = np.zeros(rec_X.shape, dtype=np.float32) + ctestfunc(arr1, arr2) + np.testing.assert_equal(arr1, rec_X.a) + np.testing.assert_equal(arr2, rec_X.b) + + def test_global_rec_arr_extract(self): + self.check_global_rec_arr_extract(forceobj=True) + + def test_global_rec_arr_extract_npm(self): + self.check_global_rec_arr_extract(nopython=True) + + + def check_two_global_rec_arrs(self, **jitargs): + # (see github issue #897) + ctestfunc = jit(**jitargs)(global_two_rec_arrs) + arr1 = np.zeros(rec_X.shape, dtype=np.int32) + arr2 = np.zeros(rec_X.shape, dtype=np.float32) + arr3 = np.zeros(rec_Y.shape, dtype=np.int16) + arr4 = np.zeros(rec_Y.shape, dtype=np.float64) + ctestfunc(arr1, arr2, arr3, arr4) + np.testing.assert_equal(arr1, rec_X.a) + np.testing.assert_equal(arr2, rec_X.b) + np.testing.assert_equal(arr3, rec_Y.c) + np.testing.assert_equal(arr4, rec_Y.d) + + def test_two_global_rec_arrs(self): + self.check_two_global_rec_arrs(forceobj=True) + + def test_two_global_rec_arrs_npm(self): + self.check_two_global_rec_arrs(nopython=True) + + def test_global_module(self): + # (see github issue #1059) + res = global_module_func(5, 6) + self.assertEqual(True, res) + + def test_global_record(self): + # (see github issue #1081) + x = np.recarray(1, dtype=x_dt)[0] + x.a = 1 + res = global_record_func(x) + self.assertEqual(True, res) + x.a = 2 + res = global_record_func(x) + self.assertEqual(False, res) + + def test_global_int_tuple(self): + pyfunc = global_int_tuple + jitfunc = njit(pyfunc) + self.assertEqual(pyfunc(), jitfunc()) + + def test_global_str_tuple(self): + pyfunc = global_str_tuple + jitfunc = njit(pyfunc) + self.assertEqual(pyfunc(), jitfunc()) + + def test_global_mixed_tuple(self): + pyfunc = global_mixed_tuple + jitfunc = njit(pyfunc) + self.assertEqual(pyfunc(), jitfunc()) + + def test_global_float_tuple(self): + pyfunc = global_float_tuple + jitfunc = njit(pyfunc) + self.assertEqual(pyfunc(), jitfunc()) + + def test_global_npy_int_tuple(self): + pyfunc = global_npy_int_tuple + jitfunc = njit(pyfunc) + self.assertEqual(pyfunc(), jitfunc()) + + def test_global_write_to_arr_in_tuple(self): + # Test writing to an array in a global tuple + # See issue https://github.com/numba/numba/issues/7120 + for func in (global_write_to_arr_in_tuple, + global_write_to_arr_in_mixed_tuple): + jitfunc = njit(func) + with self.assertRaises(errors.TypingError) as e: + jitfunc() + msg = "Cannot modify readonly array of type:" + self.assertIn(msg, str(e.exception)) + + def test_global_npy_bool(self): + # Test global NumPy bool + # See issue https://github.com/numba/numba/issues/6979 + pyfunc = global_npy_bool + jitfunc = njit(pyfunc) + self.assertEqual(pyfunc(), jitfunc()) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_hashing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_hashing.py new file mode 100644 index 0000000000000000000000000000000000000000..ca2cd1a945b5f16a20f7911d7d1385644afd8d8f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_hashing.py @@ -0,0 +1,532 @@ +# -*- coding: utf-8 -*- +""" +Test hashing of various supported types. +""" + +import unittest + +import os +import sys +import subprocess +from collections import defaultdict +from textwrap import dedent + +import numpy as np + +from numba import jit, config, typed, typeof +from numba.core import types, utils +import unittest +from numba.tests.support import (TestCase, skip_unless_py10_or_later, + run_in_subprocess) + +from numba.cpython.unicode import compile_time_get_string_data +from numba.cpython import hashing +from numba.np.numpy_support import numpy_version + + +def hash_usecase(x): + return hash(x) + + +class TestHashingSetup(TestCase): + + def test_warn_on_fnv(self): + # FNV hash alg variant is not supported, check Numba warns + work = """ + import sys + import warnings + from collections import namedtuple + + # hash_info is a StructSequence, mock as a named tuple + fields = ["width", "modulus", "inf", "nan", "imag", "algorithm", + "hash_bits", "seed_bits", "cutoff"] + + hinfo = sys.hash_info + FAKE_HASHINFO = namedtuple('FAKE_HASHINFO', fields) + + fd = dict() + for f in fields: + fd[f] = getattr(hinfo, f) + + fd['algorithm'] = 'fnv' + + fake_hashinfo = FAKE_HASHINFO(**fd) + + # replace the hashinfo with the fnv version + sys.hash_info = fake_hashinfo + with warnings.catch_warnings(record=True) as warns: + # Cause all warnings to always be triggered. + warnings.simplefilter("always") + from numba import njit + @njit + def foo(): + hash(1) + foo() + assert len(warns) > 0 + expect = "FNV hashing is not implemented in Numba. See PEP 456" + for w in warns: + if expect in str(w.message): + break + else: + raise RuntimeError("Expected warning not found") + """ + subprocess.check_call([sys.executable, '-c', dedent(work)]) + + +class TestHashAlgs(TestCase): + # This tests Numba hashing replication against cPython "gold", i.e. the + # actual hash values for given inputs, algs and PYTHONHASHSEEDs + # Test adapted from: + # https://github.com/python/cpython/blob/9dda9020abcf0d51d59b283a89c58c8e1fb0f574/Lib/test/test_hash.py#L197-L264 + # and + # https://github.com/python/cpython/blob/9dda9020abcf0d51d59b283a89c58c8e1fb0f574/Lib/test/test_hash.py#L174-L189 + + # 32bit little, 64bit little, 32bit big, 64bit big + known_hashes = { + 'djba33x': [ # only used for small strings + # seed 0, 'abc' + [193485960, 193485960, 193485960, 193485960], + # seed 42, 'abc' + [-678966196, 573763426263223372, -820489388, -4282905804826039665], + ], + 'siphash13': [ + # NOTE: PyUCS2 layout depends on endianness + # seed 0, 'abc' + [69611762, -4594863902769663758, 69611762, -4594863902769663758], + # seed 42, 'abc' + [-975800855, 3869580338025362921, -975800855, 3869580338025362921], + # seed 42, 'abcdefghijk' + [-595844228, 7764564197781545852, -595844228, 7764564197781545852], + # seed 0, 'äú∑ℇ' + [-1093288643, -2810468059467891395, -1041341092, 4925090034378237276], + # seed 42, 'äú∑ℇ' + [-585999602, -2845126246016066802, -817336969, -2219421378907968137], + ], + 'siphash24': [ + # NOTE: PyUCS2 layout depends on endianness + # seed 0, 'abc' + [1198583518, 4596069200710135518, 1198583518, 4596069200710135518], + # seed 42, 'abc' + [273876886, -4501618152524544106, 273876886, -4501618152524544106], + # seed 42, 'abcdefghijk' + [-1745215313, 4436719588892876975, -1745215313, 4436719588892876975], + # seed 0, 'äú∑ℇ' + [493570806, 5749986484189612790, -1006381564, -5915111450199468540], + # seed 42, 'äú∑ℇ' + [-1677110816, -2947981342227738144, -1860207793, -4296699217652516017], + ], + } + + def get_expected_hash(self, position, length): + if length < sys.hash_info.cutoff: + algorithm = "djba33x" + else: + algorithm = sys.hash_info.algorithm + IS_64BIT = not config.IS_32BITS + if sys.byteorder == 'little': + platform = 1 if IS_64BIT else 0 + else: + assert(sys.byteorder == 'big') + platform = 3 if IS_64BIT else 2 + return self.known_hashes[algorithm][position][platform] + + def get_hash_command(self, repr_): + return 'print(hash(eval(%a)))' % repr_ + + def get_hash(self, repr_, seed=None): + env = os.environ.copy() + if seed is not None: + env['PYTHONHASHSEED'] = str(seed) + else: + env.pop('PYTHONHASHSEED', None) + out, _ = run_in_subprocess(code=self.get_hash_command(repr_), + env=env) + stdout = out.decode().strip() + return int(stdout) + + def test_against_cpython_gold(self): + + args = (('abc', 0, 0), ('abc', 42, 1), ('abcdefghijk', 42, 2), + ('äú∑ℇ', 0, 3), ('äú∑ℇ', 42, 4),) + + for input_str, seed, position in args: + with self.subTest(input_str=input_str, seed=seed): + got = self.get_hash(repr(input_str), seed=seed) + expected = self.get_expected_hash(position, len(input_str)) + self.assertEqual(got, expected) + + +class BaseTest(TestCase): + + def setUp(self): + self.cfunc = jit(nopython=True)(hash_usecase) + + def check_hash_values(self, values): + cfunc = self.cfunc + for val in list(values): + nb_hash = cfunc(val) + self.assertIsInstance(nb_hash, int) + try: + self.assertEqual(nb_hash, hash(val)) + except AssertionError as e: + print("val, nb_hash, hash(val)") + print(val, nb_hash, hash(val)) + print("abs(val), hashing._PyHASH_MODULUS - 1") + print(abs(val), hashing._PyHASH_MODULUS - 1) + raise e + + def int_samples(self, typ=np.int64): + for start in (0, -50, 60000, 1 << 32): + info = np.iinfo(typ) + if not info.min <= start <= info.max: + continue + n = 100 + yield range(start, start + n) + yield range(start, start + 100 * n, 100) + yield range(start, start + 128 * n, 128) + yield [-1] + + def safe_construct(self, typ, value): + return getattr(np, 'int' + str(np.iinfo(typ).bits))(value).view(typ) + + def float_samples(self, typ): + info = np.finfo(typ) + + for start in (0, 10, info.max ** 0.5, info.max / 1000.0): + n = 100 + min_step = max(info.tiny, start * info.resolution) + for step in (1.2, min_step ** 0.5, min_step): + if step < min_step: + continue + a = np.linspace(start, start + n * step, n) + a = a.astype(typ) + yield a + yield -a + yield a + a.mean() + + # Infs, nans, zeros, magic -1 + a = [0.0, 0.5, -0.0, -1.0, float('inf'), -float('inf'),] + + # Python 3.10 has a hash for nan based on the pointer to the PyObject + # containing the nan, skip this input and use explicit test instead. + + yield typ(a) + + def complex_samples(self, typ, float_ty): + for real in self.float_samples(float_ty): + for imag in self.float_samples(float_ty): + # Ensure equal sizes + real = real[:len(imag)] + imag = imag[:len(real)] + a = real + typ(1j) * imag + # Python 3.10 has a hash for nan based on the pointer to the + # PyObject containing the nan, skip input that ends up as nan + if not np.any(np.isnan(a)): + yield a + + +class TestNumberHashing(BaseTest): + """ + Test hashing of number types. + """ + + def setUp(self): + if numpy_version >= (2, 0) and numpy_version <= (2, 1): + # Temporarily set promotions state to legacy, + # to ensure overflow logic works + self.initial_state = np._get_promotion_state() + np._set_promotion_state("legacy") + + return super().setUp() + + def tearDown(self) -> None: + if numpy_version >= (2, 0) and numpy_version <= (2, 1): + # Reset numpy promotion state to initial state + # since the setting is global + np._set_promotion_state(self.initial_state) + + return super().tearDown() + + def check_floats(self, typ): + for a in self.float_samples(typ): + self.assertEqual(a.dtype, np.dtype(typ)) + self.check_hash_values(a) + + def check_complex(self, typ, float_ty): + for a in self.complex_samples(typ, float_ty): + self.assertEqual(a.dtype, np.dtype(typ)) + self.check_hash_values(a) + + def test_floats(self): + self.check_floats(np.float32) + self.check_floats(np.float64) + + def test_complex(self): + self.check_complex(np.complex64, np.float32) + self.check_complex(np.complex128, np.float64) + + def test_bool(self): + self.check_hash_values([False, True]) + + def test_ints(self): + minmax = [] + + for ty in [np.int8, np.uint8, np.int16, np.uint16, + np.int32, np.uint32, np.int64, np.uint64]: + for a in self.int_samples(ty): + self.check_hash_values(a) + info = np.iinfo(ty) + # check hash(-1) = -2 + # check hash(0) = 0 + self.check_hash_values([self.safe_construct(ty, -1)]) + self.check_hash_values([ty(0)]) + signed = 'uint' not in str(ty) + # check bit shifting patterns from min through to max + sz = ty().itemsize + for x in [info.min, info.max]: + shifts = 8 * sz + # x is a python int, do shifts etc as a python int and init + # numpy type from that to avoid numpy type rules + y = x + for i in range(shifts): + twiddle1 = 0xaaaaaaaaaaaaaaaa + twiddle2 = 0x5555555555555555 + vals = [y] + for tw in [twiddle1, twiddle2]: + val = y & twiddle1 + if val < sys.maxsize: + vals.append(val) + for v in vals: + self.check_hash_values([ty(v)]) + if signed: # try the same with flipped signs + # negated signed INT_MIN will overflow + for v in vals: + if v != info.min: + self.check_hash_values([ty(-v)]) + if x == 0: # unsigned min is 0, shift up + y = (y | 1) << 1 + else: # everything else shift down + y = y >> 1 + + # these straddle the branch between returning the int as the hash and + # doing the PyLong hash alg + self.check_hash_values([np.int64(0x1ffffffffffffffe)]) + self.check_hash_values([np.int64(0x1fffffffffffffff)]) + self.check_hash_values([np.uint64(0x1ffffffffffffffe)]) + self.check_hash_values([np.uint64(0x1fffffffffffffff)]) + + # check some values near sys int mins + self.check_hash_values([np.int64(-0x7fffffffffffffff)]) + self.check_hash_values([np.int64(-0x7ffffffffffffff6)]) + self.check_hash_values([np.int64(-0x7fffffffffffff9c)]) + self.check_hash_values([np.int32(-0x7fffffff)]) + self.check_hash_values([np.int32(-0x7ffffff6)]) + self.check_hash_values([np.int32(-0x7fffff9c)]) + + @skip_unless_py10_or_later + def test_py310_nan_hash(self): + # On Python 3.10+ nan's hash to a value which is based on the pointer to + # the PyObject containing the nan. Numba cannot replicate as there's no + # object, it instead produces equivalent behaviour, i.e. hashes to + # something "unique". + + # Run 10 hashes, make sure that the "uniqueness" is sufficient that + # there's more than one hash value. Not much more can be done! + x = [float('nan') for i in range(10)] + out = set([self.cfunc(z) for z in x]) + self.assertGreater(len(out), 1) + + +class TestTupleHashing(BaseTest): + """ + Test hashing of tuples. + """ + + def setUp(self): + if numpy_version >= (2, 0) and numpy_version <= (2, 1): + # Temporarily set promotions state to legacy, + # to ensure overflow logic works + self.initial_state = np._get_promotion_state() + np._set_promotion_state("legacy") + + return super().setUp() + + def tearDown(self) -> None: + if numpy_version >= (2, 0) and numpy_version <= (2, 1): + # Reset numpy promotion state to initial state + # since the setting is global + np._set_promotion_state(self.initial_state) + + return super().tearDown() + + def check_tuples(self, value_generator, split): + for values in value_generator: + tuples = [split(a) for a in values] + self.check_hash_values(tuples) + + def test_homogeneous_tuples(self): + typ = np.uint64 + + def split2(i): + """ + Split i's bits into 2 integers. + """ + i = self.safe_construct(typ, i) + return (i & typ(0x5555555555555555), + i & typ(0xaaaaaaaaaaaaaaaa), + ) + + def split3(i): + """ + Split i's bits into 3 integers. + """ + i = self.safe_construct(typ, i) + return (i & typ(0x2492492492492492), + i & typ(0x4924924924924924), + i & typ(0x9249249249249249), + ) + + self.check_tuples(self.int_samples(), split2) + self.check_tuples(self.int_samples(), split3) + + # Check exact. Sample values from: + # https://github.com/python/cpython/blob/b738237d6792acba85b1f6e6c8993a812c7fd815/Lib/test/test_tuple.py#L80-L93 + # Untypable empty tuples are replaced with (7,). + self.check_hash_values([(7,), (0,), (0, 0), (0.5,), + (0.5, (7,), (-2, 3, (4, 6)))]) + + def test_heterogeneous_tuples(self): + modulo = 2**63 + + def split(i): + a = i & 0x5555555555555555 + b = (i & 0xaaaaaaaa) ^ ((i >> 32) & 0xaaaaaaaa) + return np.int64(a), np.float64(b * 0.0001) + + self.check_tuples(self.int_samples(), split) + + +class TestUnicodeHashing(BaseTest): + + def test_basic_unicode(self): + kind1_string = "abcdefghijklmnopqrstuvwxyz" + for i in range(len(kind1_string)): + self.check_hash_values([kind1_string[:i]]) + + sep = "眼" + kind2_string = sep.join(list(kind1_string)) + for i in range(len(kind2_string)): + self.check_hash_values([kind2_string[:i]]) + + sep = "🐍⚡" + kind4_string = sep.join(list(kind1_string)) + for i in range(len(kind4_string)): + self.check_hash_values([kind4_string[:i]]) + + empty_string = "" + self.check_hash_values(empty_string) + + def test_hash_passthrough(self): + # no `hash` call made, this just checks that `._hash` is correctly + # passed through from an already existing string + kind1_string = "abcdefghijklmnopqrstuvwxyz" + + @jit(nopython=True) + def fn(x): + return x._hash + + hash_value = compile_time_get_string_data(kind1_string)[-1] + self.assertTrue(hash_value != -1) + self.assertEqual(fn(kind1_string), hash_value) + + def test_hash_passthrough_call(self): + # check `x._hash` and hash(x) are the same + kind1_string = "abcdefghijklmnopqrstuvwxyz" + + @jit(nopython=True) + def fn(x): + return x._hash, hash(x) + + hash_value = compile_time_get_string_data(kind1_string)[-1] + self.assertTrue(hash_value != -1) + self.assertEqual(fn(kind1_string), (hash_value, hash_value)) + + @unittest.skip("Needs hash computation at const unpickling time") + def test_hash_literal(self): + # a strconst always seem to have an associated hash value so the hash + # member of the returned value should contain the correct hash + @jit(nopython=True) + def fn(): + x = "abcdefghijklmnopqrstuvwxyz" + return x + val = fn() + tmp = hash("abcdefghijklmnopqrstuvwxyz") + self.assertEqual(tmp, (compile_time_get_string_data(val)[-1])) + + def test_hash_on_str_creation(self): + # In cPython some? new strings do not have a cached hash until hash() is + # called + def impl(do_hash): + const1 = "aaaa" + const2 = "眼眼眼眼" + new = const1 + const2 + if do_hash: + hash(new) + return new + + jitted = jit(nopython=True)(impl) + + # do not compute the hash, cPython will have no cached hash, but Numba + # will + compute_hash = False + expected = impl(compute_hash) + got = jitted(compute_hash) + a = (compile_time_get_string_data(expected)) + b = (compile_time_get_string_data(got)) + self.assertEqual(a[:-1], b[:-1]) + self.assertTrue(a[-1] != b[-1]) + + # now with compute hash enabled, cPython will have a cached hash as will + # Numba + compute_hash = True + expected = impl(compute_hash) + got = jitted(compute_hash) + a = (compile_time_get_string_data(expected)) + b = (compile_time_get_string_data(got)) + self.assertEqual(a, b) + + +class TestUnhashable(TestCase): + # Tests that unhashable types behave correctly and raise a TypeError at + # runtime. + + def test_hash_unhashable(self): + unhashables = (typed.Dict().empty(types.int64, types.int64), + typed.List().empty_list(types.int64), + np.ones(4)) + cfunc = jit(nopython=True)(hash_usecase) + for ty in unhashables: + with self.assertRaises(TypeError) as raises: + cfunc(ty) + expected = f"unhashable type: '{str(typeof(ty))}'" + self.assertIn(expected, str(raises.exception)) + + def test_no_generic_hash(self): + # In CPython, if there's no attr `__hash__` on an object, a hash of the + # object's pointer is returned (see: _Py_HashPointer in the CPython + # source). Numba has no access to such objects and can't create them + # either, so it catches this case and raises an exception. + + @jit(nopython=True) + def foo(): + hash(np.cos) + + with self.assertRaises(TypeError) as raises: + foo() + + expected = ("No __hash__ is defined for object ") + self.assertIn(expected, str(raises.exception)) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_heapq.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_heapq.py new file mode 100644 index 0000000000000000000000000000000000000000..232fd60121ecd8bd3f7e05b58beeb5ee30d0cf14 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_heapq.py @@ -0,0 +1,484 @@ +import heapq as hq +import itertools + +import numpy as np + +from numba import jit, typed +from numba.tests.support import TestCase, MemoryLeakMixin + + +def heapify(x): + return hq.heapify(x) + + +def heappop(heap): + return hq.heappop(heap) + + +def heappush(heap, item): + return hq.heappush(heap, item) + + +def heappushpop(heap, item): + return hq.heappushpop(heap, item) + + +def heapreplace(heap, item): + return hq.heapreplace(heap, item) + + +def nsmallest(n, iterable): + return hq.nsmallest(n, iterable) + + +def nlargest(n, iterable): + return hq.nlargest(n, iterable) + + +class _TestHeapq(MemoryLeakMixin): + + def setUp(self): + super(_TestHeapq, self).setUp() + self.rnd = np.random.RandomState(42) + + def test_heapify_basic_sanity(self): + pyfunc = heapify + cfunc = jit(nopython=True)(pyfunc) + + a = [1, 3, 5, 7, 9, 2, 4, 6, 8, 0] + b = self.listimpl(a) + + pyfunc(a) + cfunc(b) + self.assertPreciseEqual(a, list(b)) + + # includes non-finite elements + element_pool = [3.142, -10.0, 5.5, np.nan, -np.inf, np.inf] + + # list which may contain duplicate elements + for x in itertools.combinations_with_replacement(element_pool, 6): + a = list(x) + b = self.listimpl(a) + + pyfunc(a) + cfunc(b) + self.assertPreciseEqual(a, list(b)) + + # single element list + for i in range(len(element_pool)): + a = [element_pool[i]] + b = self.listimpl(a) + + pyfunc(a) + cfunc(b) + self.assertPreciseEqual(a, list(b)) + + # elements are tuples + a = [(3, 33), (1, 11), (2, 22)] + b = self.listimpl(a) + pyfunc(a) + cfunc(b) + self.assertPreciseEqual(a, list(b)) + + def check_invariant(self, heap): + for pos, item in enumerate(heap): + if pos: + parentpos = (pos - 1) >> 1 + self.assertTrue(heap[parentpos] <= item) + + def test_push_pop(self): + # inspired by + # https://github.com/python/cpython/blob/e42b7051/Lib/test/test_heapq.py + pyfunc_heappush = heappush + cfunc_heappush = jit(nopython=True)(pyfunc_heappush) + + pyfunc_heappop = heappop + cfunc_heappop = jit(nopython=True)(pyfunc_heappop) + + heap = self.listimpl([-1.0]) + data = self.listimpl([-1.0]) + self.check_invariant(heap) + for i in range(256): + item = self.rnd.randn(1).item(0) + data.append(item) + cfunc_heappush(heap, item) + self.check_invariant(heap) + results = [] + while heap: + item = cfunc_heappop(heap) + self.check_invariant(heap) + results.append(item) + data_sorted = data[:] + data_sorted.sort() + self.assertPreciseEqual(list(data_sorted), results) + self.check_invariant(results) + + def test_heapify(self): + # inspired by + # https://github.com/python/cpython/blob/e42b7051/Lib/test/test_heapq.py + pyfunc = heapify + cfunc = jit(nopython=True)(pyfunc) + + for size in list(range(1, 30)) + [20000]: + heap = self.listimpl(self.rnd.random_sample(size)) + cfunc(heap) + self.check_invariant(heap) + + def test_heapify_exceptions(self): + pyfunc = heapify + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertTypingError() as e: + cfunc((1, 5, 4)) + + msg = 'heap argument must be a list' + self.assertIn(msg, str(e.exception)) + + with self.assertTypingError() as e: + cfunc(self.listimpl([1 + 1j, 2 - 3j])) + + msg = ("'<' not supported between instances " + "of 'complex' and 'complex'") + self.assertIn(msg, str(e.exception)) + + def test_heappop_basic_sanity(self): + pyfunc = heappop + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield [1, 3, 5, 7, 9, 2, 4, 6, 8, 0] + yield [(3, 33), (1, 111), (2, 2222)] + yield np.full(5, fill_value=np.nan).tolist() + yield np.linspace(-10, -5, 100).tolist() + + for a in a_variations(): + heapify(a) + b = self.listimpl(a) + + for i in range(len(a)): + val_py = pyfunc(a) + val_c = cfunc(b) + self.assertPreciseEqual(a, list(b)) + self.assertPreciseEqual(val_py, val_c) + + def test_heappop_exceptions(self): + pyfunc = heappop + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertTypingError() as e: + cfunc((1, 5, 4)) + + msg = 'heap argument must be a list' + self.assertIn(msg, str(e.exception)) + + def iterables(self): + yield self.listimpl([1, 3, 5, 7, 9, 2, 4, 6, 8, 0]) + a = np.linspace(-10, 2, 23) + yield self.listimpl(a) + yield self.listimpl(a[::-1]) + self.rnd.shuffle(a) + yield self.listimpl(a) + + def test_heappush_basic(self): + pyfunc_push = heappush + cfunc_push = jit(nopython=True)(pyfunc_push) + + pyfunc_pop = heappop + cfunc_pop = jit(nopython=True)(pyfunc_pop) + + for iterable in self.iterables(): + expected = sorted(iterable) + heap = self.listimpl([iterable.pop(0)]) # must initialise heap + + for value in iterable: + cfunc_push(heap, value) + + got = [cfunc_pop(heap) for _ in range(len(heap))] + self.assertPreciseEqual(expected, got) + + def test_heappush_exceptions(self): + pyfunc = heappush + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertTypingError() as e: + cfunc((1, 5, 4), 6) + + msg = 'heap argument must be a list' + self.assertIn(msg, str(e.exception)) + + with self.assertTypingError() as e: + cfunc(self.listimpl([1, 5, 4]), 6.0) + + msg = 'heap type must be the same as item type' + self.assertIn(msg, str(e.exception)) + + def test_nsmallest_basic(self): + pyfunc = nsmallest + cfunc = jit(nopython=True)(pyfunc) + + for iterable in self.iterables(): + for n in range(-5, len(iterable) + 3): + expected = pyfunc(1, iterable) + got = cfunc(1, iterable) + self.assertPreciseEqual(expected, got) + + # n is boolean + out = cfunc(False, self.listimpl([3, 2, 1])) + self.assertPreciseEqual(out, []) + + out = cfunc(True, self.listimpl([3, 2, 1])) + self.assertPreciseEqual(out, [1]) + + # iterable is not a list + out = cfunc(2, (6, 5, 4, 3, 2, 1)) + self.assertPreciseEqual(out, [1, 2]) + + out = cfunc(3, np.arange(6)) + self.assertPreciseEqual(out, [0, 1, 2]) + + def test_nlargest_basic(self): + pyfunc = nlargest + cfunc = jit(nopython=True)(pyfunc) + + for iterable in self.iterables(): + for n in range(-5, len(iterable) + 3): + expected = pyfunc(1, iterable) + got = cfunc(1, iterable) + self.assertPreciseEqual(expected, got) + + # n is boolean + out = cfunc(False, self.listimpl([3, 2, 1])) + self.assertPreciseEqual(out, []) + + out = cfunc(True, self.listimpl([3, 2, 1])) + self.assertPreciseEqual(out, [3]) + + # iterable is not a list + out = cfunc(2, (6, 5, 4, 3, 2, 1)) + self.assertPreciseEqual(out, [6, 5]) + + out = cfunc(3, np.arange(6)) + self.assertPreciseEqual(out, [5, 4, 3]) + + def _assert_typing_error(self, cfunc): + + # Exceptions leak references + self.disable_leak_check() + + with self.assertTypingError() as e: + cfunc(2.2, self.listimpl([3, 2, 1])) + + msg = "First argument 'n' must be an integer" + self.assertIn(msg, str(e.exception)) + + with self.assertTypingError() as e: + cfunc(2, 100) + + msg = "Second argument 'iterable' must be iterable" + self.assertIn(msg, str(e.exception)) + + def test_nsmallest_exceptions(self): + pyfunc = nsmallest + cfunc = jit(nopython=True)(pyfunc) + self._assert_typing_error(cfunc) + + def test_nlargest_exceptions(self): + pyfunc = nlargest + cfunc = jit(nopython=True)(pyfunc) + self._assert_typing_error(cfunc) + + def test_heapreplace_basic(self): + pyfunc = heapreplace + cfunc = jit(nopython=True)(pyfunc) + + a = [1, 3, 5, 7, 9, 2, 4, 6, 8, 0] + + heapify(a) + b = self.listimpl(a) + + for item in [-4, 4, 14]: + pyfunc(a, item) + cfunc(b, item) + self.assertPreciseEqual(a, list(b)) + + a = np.linspace(-3, 13, 20) + a[4] = np.nan + a[-1] = np.inf + a = a.tolist() + + heapify(a) + b = self.listimpl(a) + + for item in [-4.0, 3.142, -np.inf, np.inf]: + pyfunc(a, item) + cfunc(b, item) + self.assertPreciseEqual(a, list(b)) + + def test_heapreplace_exceptions(self): + pyfunc = heapreplace + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertTypingError() as e: + cfunc((1, 5, 4), -1) + + msg = 'heap argument must be a list' + self.assertIn(msg, str(e.exception)) + + with self.assertTypingError() as e: + cfunc(self.listimpl([1, 5, 4]), -1.0) + + msg = 'heap type must be the same as item type' + self.assertIn(msg, str(e.exception)) + + def heapiter(self, heap): + try: + while 1: + yield heappop(heap) + except IndexError: + pass + + def test_nbest(self): + # inspired by + # https://github.com/python/cpython/blob/e42b7051/Lib/test/test_heapq.py + cfunc_heapify = jit(nopython=True)(heapify) + cfunc_heapreplace = jit(nopython=True)(heapreplace) + + data = self.rnd.choice(range(2000), 1000).tolist() + heap = self.listimpl(data[:10]) + cfunc_heapify(heap) + + for item in data[10:]: + if item > heap[0]: + cfunc_heapreplace(heap, item) + + self.assertPreciseEqual(list(self.heapiter(list(heap))), + sorted(data)[-10:]) + + def test_heapsort(self): + # inspired by + # https://github.com/python/cpython/blob/e42b7051/Lib/test/test_heapq.py + cfunc_heapify = jit(nopython=True)(heapify) + cfunc_heappush = jit(nopython=True)(heappush) + cfunc_heappop = jit(nopython=True)(heappop) + + for trial in range(100): + # Ensure consistency of typing, use float64 as it's double + # everywhere + values = np.arange(5, dtype=np.float64) + data = self.listimpl(self.rnd.choice(values, 10)) + if trial & 1: + heap = data[:] + cfunc_heapify(heap) + else: + heap = self.listimpl([data[0]]) + for item in data[1:]: + cfunc_heappush(heap, item) + heap_sorted = [cfunc_heappop(heap) for _ in range(10)] + self.assertPreciseEqual(heap_sorted, sorted(data)) + + def test_nsmallest(self): + # inspired by + # https://github.com/python/cpython/blob/e42b7051/Lib/test/test_heapq.py + pyfunc = nsmallest + cfunc = jit(nopython=True)(pyfunc) + + data = self.listimpl(self.rnd.choice(range(2000), 1000)) + + for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100): + self.assertPreciseEqual(list(cfunc(n, data)), sorted(data)[:n]) + + def test_nlargest(self): + # inspired by + # https://github.com/python/cpython/blob/e42b7051/Lib/test/test_heapq.py + pyfunc = nlargest + cfunc = jit(nopython=True)(pyfunc) + + data = self.listimpl(self.rnd.choice(range(2000), 1000)) + + for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100): + self.assertPreciseEqual(list(cfunc(n, data)), + sorted(data, reverse=True)[:n]) + + def test_nbest_with_pushpop(self): + # inspired by + # https://github.com/python/cpython/blob/e42b7051/Lib/test/test_heapq.py + pyfunc_heappushpop = heappushpop + cfunc_heappushpop = jit(nopython=True)(pyfunc_heappushpop) + + pyfunc_heapify = heapify + cfunc_heapify = jit(nopython=True)(pyfunc_heapify) + + # Ensure consistency of typing, use float64 as it's double everywhere + values = np.arange(2000, dtype=np.float64) + data = self.listimpl(self.rnd.choice(values, 1000)) + heap = data[:10] + cfunc_heapify(heap) + + for item in data[10:]: + cfunc_heappushpop(heap, item) + + self.assertPreciseEqual(list(self.heapiter(list(heap))), + sorted(data)[-10:]) + + def test_heappushpop(self): + # inspired by + # https://github.com/python/cpython/blob/e42b7051/Lib/test/test_heapq.py + pyfunc = heappushpop + cfunc = jit(nopython=True)(pyfunc) + + h = self.listimpl([1.0]) + x = cfunc(h, 10.0) + self.assertPreciseEqual((list(h), x), ([10.0], 1.0)) + self.assertPreciseEqual(type(h[0]), float) + self.assertPreciseEqual(type(x), float) + + h = self.listimpl([10]) + x = cfunc(h, 9) + self.assertPreciseEqual((list(h), x), ([10], 9)) + + h = self.listimpl([10]) + x = cfunc(h, 11) + self.assertPreciseEqual((list(h), x), ([11], 10)) + + def test_heappushpop_exceptions(self): + pyfunc = heappushpop + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertTypingError() as e: + cfunc((1, 5, 4), -1) + + msg = 'heap argument must be a list' + self.assertIn(msg, str(e.exception)) + + with self.assertTypingError() as e: + cfunc(self.listimpl([1, 5, 4]), False) + + msg = 'heap type must be the same as item type' + self.assertIn(msg, str(e.exception)) + + +class TestHeapqReflectedList(_TestHeapq, TestCase): + """Test heapq with reflected lists""" + + listimpl = list + + +class TestHeapqTypedList(_TestHeapq, TestCase): + """Test heapq with typed lists""" + + listimpl = typed.List diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_help.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_help.py new file mode 100644 index 0000000000000000000000000000000000000000..8199d4c93c4b6969f9437e8b28cc05a4948d9c5e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_help.py @@ -0,0 +1,92 @@ +import sys +import subprocess +import types as pytypes +import os.path + +import numpy as np + +import builtins +from numba.core import types +from numba.tests.support import TestCase, temp_directory +from numba.misc.help.inspector import inspect_function, inspect_module + + +class TestInspector(TestCase): + def check_function_descriptor(self, info, must_be_defined=False): + self.assertIsInstance(info, dict) + self.assertIn('numba_type', info) + numba_type = info['numba_type'] + if numba_type is None: + self.assertFalse(must_be_defined) + else: + self.assertIsInstance(numba_type, types.Type) + self.assertIn('explained', info) + self.assertIsInstance(info['explained'], str) + self.assertIn('source_infos', info) + self.assertIsInstance(info['source_infos'], dict) + + def test_inspect_function_on_range(self): + info = inspect_function(range) + self.check_function_descriptor(info, must_be_defined=True) + + def test_inspect_function_on_np_all(self): + info = inspect_function(np.all) + self.check_function_descriptor(info, must_be_defined=True) + source_infos = info['source_infos'] + self.assertGreater(len(source_infos), 0) + c = 0 + for srcinfo in source_infos.values(): + self.assertIsInstance(srcinfo['kind'], str) + self.assertIsInstance(srcinfo['name'], str) + self.assertIsInstance(srcinfo['sig'], str) + self.assertIsInstance(srcinfo['filename'], str) + self.assertIsInstance(srcinfo['lines'], tuple) + self.assertIn('docstring', srcinfo) + c += 1 + self.assertEqual(c, len(source_infos)) + + def test_inspect_module(self): + c = 0 + for it in inspect_module(builtins): + self.assertIsInstance(it['module'], pytypes.ModuleType) + self.assertIsInstance(it['name'], str) + self.assertTrue(callable(it['obj'])) + self.check_function_descriptor(it) + c += 1 + self.assertGreater(c, 0) + + def test_inspect_cli(self): + # Try CLI on math module + cmdbase = [sys.executable, '-m', 'numba.misc.help.inspector'] + + dirpath = temp_directory('{}.{}'.format(__name__, + self.__class__.__name__)) + filename = os.path.join(dirpath, 'out') + + # Try default format "html" + expected_file = filename + '.html' + cmds = cmdbase + ['--file', filename, 'math'] + # File shouldn't exist yet + self.assertFalse(os.path.isfile(expected_file)) + # Run CLI + subprocess.check_output(cmds) + # File should exist now + self.assertTrue(os.path.isfile(expected_file)) + + # Try changing the format to "rst" + cmds = cmdbase + ['--file', filename, '--format', 'rst', 'math'] + expected_file = filename + '.rst' + # File shouldn't exist yet + self.assertFalse(os.path.isfile(expected_file)) + # Run CLI + subprocess.check_output(cmds) + # File should exist now + self.assertTrue(os.path.isfile(expected_file)) + + # Try unsupported format + cmds = cmdbase + ['--file', filename, '--format', 'foo', 'math'] + # Run CLI + with self.assertRaises(subprocess.CalledProcessError) as raises: + subprocess.check_output(cmds, stderr=subprocess.STDOUT) + self.assertIn("\'foo\' is not supported", + raises.exception.stdout.decode()) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_import.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_import.py new file mode 100644 index 0000000000000000000000000000000000000000..6f1c931dfae65e1e5e2feda1f2d8fae182d5188c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_import.py @@ -0,0 +1,112 @@ +import unittest +from numba.tests.support import TestCase, run_in_subprocess + + +class TestNumbaImport(TestCase): + """ + Test behaviour of importing Numba. + """ + + def test_laziness(self): + """ + Importing top-level numba features should not import too many modules. + """ + # A heuristic set of modules that shouldn't be imported immediately + banlist = ['cffi', + 'distutils', + 'numba.cuda', + 'numba.cpython.mathimpl', + 'numba.cpython.randomimpl', + 'numba.tests', + 'numba.core.typing.collections', + 'numba.core.typing.listdecl', + 'numba.core.typing.npdatetime', + ] + # Sanity check the modules still exist... + for mod in banlist: + if mod not in ('cffi',): + __import__(mod) + + code = """if 1: + from numba import jit, vectorize + from numba.core import types + import sys + print(list(sys.modules)) + """ + + out, _ = run_in_subprocess(code) + modlist = set(eval(out.strip())) + unexpected = set(banlist) & set(modlist) + self.assertFalse(unexpected, "some modules unexpectedly imported") + + def test_no_impl_import(self): + """ + Tests that importing jit does not trigger import of modules containing + lowering implementations that would likely install things in the + builtins registry and have side effects impacting other targets + """ + # None of these modules should be imported through the process of + # doing 'import numba' or 'from numba import njit' + banlist = ['numba.cpython.slicing', + 'numba.cpython.tupleobj', + 'numba.cpython.enumimpl', + 'numba.cpython.hashing', + 'numba.cpython.heapq', + 'numba.cpython.iterators', + 'numba.cpython.numbers', + 'numba.cpython.rangeobj', + 'numba.cpython.cmathimpl', + 'numba.cpython.mathimpl', + 'numba.cpython.printimpl', + 'numba.cpython.randomimpl', + 'numba.core.optional', + 'numba.misc.gdb_hook', + 'numba.misc.literal', + 'numba.misc.cffiimpl', + 'numba.np.linalg', + 'numba.np.polynomial', + 'numba.np.arraymath', + 'numba.np.npdatetime', + 'numba.np.npyimpl', + 'numba.typed.typeddict', + 'numba.typed.typedlist', + 'numba.experimental.jitclass.base',] + + code1 = """if 1: + import sys + import numba + print(list(sys.modules)) + """ + + code2 = """if 1: + import sys + from numba import njit + @njit + def foo(): + pass + print(list(sys.modules)) + """ + + for code in (code1, code2): + out, _ = run_in_subprocess(code) + modlist = set(eval(out.strip())) + unexpected = set(banlist) & set(modlist) + self.assertFalse(unexpected, "some modules unexpectedly imported") + + def test_no_accidental_warnings(self): + # checks that importing Numba isn't accidentally triggering warnings due + # to e.g. deprecated use of import locations from Python's stdlib + code = "import numba" + # See: https://github.com/numba/numba/issues/6831 + # bug in setuptools/packaging causing a deprecation warning + flags = ["-Werror", "-Wignore::DeprecationWarning:packaging.version:"] + run_in_subprocess(code, flags) + + def test_import_star(self): + # checks that "from numba import *" works. + code = "from numba import *" + run_in_subprocess(code) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_indexing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_indexing.py new file mode 100644 index 0000000000000000000000000000000000000000..500ea46f761ec6d43e88431ff964ede0347000c8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_indexing.py @@ -0,0 +1,1119 @@ +import decimal +import itertools + +import numpy as np + +import unittest +from numba import jit, njit, typeof +from numba.core import utils, types, errors +from numba.tests.support import TestCase, tag +from numba.core.typing import arraydecl +from numba.core.types import intp, ellipsis, slice2_type, slice3_type + + +enable_pyobj_flags = {'forceobj': True} + +Noflags = {'nopython': True} + + +def slicing_1d_usecase(a, start, stop, step): + return a[start:stop:step] + +def slicing_1d_usecase2(a, start, stop, step): + b = a[start:stop:step] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + +def slicing_1d_usecase3(a, start, stop): + b = a[start:stop] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + +def slicing_1d_usecase4(a): + b = a[:] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + +def slicing_1d_usecase5(a, start): + b = a[start:] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + +def slicing_1d_usecase6(a, stop): + b = a[:stop] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + +def slicing_1d_usecase7(a, start): + # Omitted stop with negative step (issue #1690) + b = a[start::-2] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + +def slicing_1d_usecase8(a, start): + # Omitted start with negative step + b = a[::-2] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + + +def slicing_2d_usecase(a, start1, stop1, step1, start2, stop2, step2): + # The index is a homogeneous tuple of slices + return a[start1:stop1:step1, start2:stop2:step2] + +def slicing_2d_usecase3(a, start1, stop1, step1, index): + # The index is a heterogeneous tuple + return a[start1:stop1:step1, index] + +def slicing_3d_usecase(a, index0, start1, index2): + b = a[index0, start1:, index2] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + +def slicing_3d_usecase2(a, index0, stop1, index2): + b = a[index0, :stop1, index2] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + +def partial_1d_usecase(a, index): + b = a[index] + total = 0 + for i in range(b.shape[0]): + total += b[i] * (i + 1) + return total + +def integer_indexing_1d_usecase(a, i): + return a[i] + +def integer_indexing_2d_usecase(a, i1, i2): + return a[i1,i2] + +def integer_indexing_2d_usecase2(a, i1, i2): + return a[i1][i2] + +def ellipsis_usecase1(a, i, j): + return a[i:j, ...] + +def ellipsis_usecase2(a, i, j): + return a[..., i:j] + +def ellipsis_usecase3(a, i, j): + return a[i, ..., j] + +def none_index_usecase(a): + return a[None] + +def empty_tuple_usecase(a): + return a[()] + + +@njit +def setitem_usecase(a, index, value): + a[index] = value + + +@njit +def setitem_broadcast_usecase(a, value): + a[:] = value + + +def slicing_1d_usecase_set(a, b, start, stop, step): + a[start:stop:step] = b + return a + +def slicing_1d_usecase_add(a, b, start, stop): + # NOTE: uses the ROT_FOUR opcode on Python 2, only on the [start:stop] + # with inplace operator form. + a[start:stop] += b + return a + +def slicing_2d_usecase_set(a, b, start, stop, step, start2, stop2, step2): + a[start:stop:step,start2:stop2:step2] = b + return a + + +class TestGetItem(TestCase): + """ + Test basic indexed load from an array (returning a view or a scalar). + Note fancy indexing is tested in test_fancy_indexing. + """ + + def test_1d_slicing(self, flags=enable_pyobj_flags): + pyfunc = slicing_1d_usecase + arraytype = types.Array(types.int32, 1, 'C') + argtys = (arraytype, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(10, dtype='i4') + for indices in [(0, 10, 1), + (2, 3, 1), + (10, 0, 1), + (0, 10, -1), + (0, 10, 2), + (9, 0, -1), + (-5, -2, 1), + (0, -1, 1), + ]: + expected = pyfunc(a, *indices) + self.assertPreciseEqual(cfunc(a, *indices), expected) + + def test_1d_slicing_npm(self): + self.test_1d_slicing(flags=Noflags) + + def test_1d_slicing2(self, flags=enable_pyobj_flags): + pyfunc = slicing_1d_usecase2 + arraytype = types.Array(types.int32, 1, 'C') + argtys = (arraytype, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(10, dtype='i4') + + args = [(0, 10, 1), + (2, 3, 1), + (10, 0, 1), + (0, 10, -1), + (0, 10, 2)] + + for arg in args: + self.assertEqual(pyfunc(a, *arg), cfunc(a, *arg)) + + + # Any + arraytype = types.Array(types.int32, 1, 'A') + argtys = (arraytype, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(20, dtype='i4')[::2] + self.assertFalse(a.flags['C_CONTIGUOUS']) + self.assertFalse(a.flags['F_CONTIGUOUS']) + + args = [(0, 10, 1), + (2, 3, 1), + (10, 0, 1), + (0, 10, -1), + (0, 10, 2)] + + for arg in args: + self.assertEqual(pyfunc(a, *arg), cfunc(a, *arg)) + + def test_1d_slicing2_npm(self): + self.test_1d_slicing2(flags=Noflags) + + def test_1d_slicing3(self, flags=enable_pyobj_flags): + pyfunc = slicing_1d_usecase3 + arraytype = types.Array(types.int32, 1, 'C') + argtys = (arraytype, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(10, dtype='i4') + + args = [(3, 10), + (2, 3), + (10, 0), + (0, 10), + (5, 10)] + + for arg in args: + self.assertEqual(pyfunc(a, *arg), cfunc(a, *arg)) + + + # Any + arraytype = types.Array(types.int32, 1, 'A') + argtys = (arraytype, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(20, dtype='i4')[::2] + self.assertFalse(a.flags['C_CONTIGUOUS']) + self.assertFalse(a.flags['F_CONTIGUOUS']) + + for arg in args: + self.assertEqual(pyfunc(a, *arg), cfunc(a, *arg)) + + def test_1d_slicing3_npm(self): + self.test_1d_slicing3(flags=Noflags) + + def test_1d_slicing4(self, flags=enable_pyobj_flags): + pyfunc = slicing_1d_usecase4 + arraytype = types.Array(types.int32, 1, 'C') + argtys = (arraytype,) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(10, dtype='i4') + self.assertEqual(pyfunc(a), cfunc(a)) + + # Any + arraytype = types.Array(types.int32, 1, 'A') + argtys = (arraytype,) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(20, dtype='i4')[::2] + self.assertFalse(a.flags['C_CONTIGUOUS']) + self.assertFalse(a.flags['F_CONTIGUOUS']) + self.assertEqual(pyfunc(a), cfunc(a)) + + def test_1d_slicing4_npm(self): + self.test_1d_slicing4(flags=Noflags) + + def check_1d_slicing_with_arg(self, pyfunc, flags): + args = list(range(-9, 10)) + + arraytype = types.Array(types.int32, 1, 'C') + argtys = (arraytype, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(10, dtype='i4') + for arg in args: + self.assertEqual(pyfunc(a, arg), cfunc(a, arg)) + + # Any + arraytype = types.Array(types.int32, 1, 'A') + argtys = (arraytype, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(20, dtype='i4')[::2] + self.assertFalse(a.flags['C_CONTIGUOUS']) + self.assertFalse(a.flags['F_CONTIGUOUS']) + for arg in args: + self.assertEqual(pyfunc(a, arg), cfunc(a, arg)) + + def test_1d_slicing5(self, flags=enable_pyobj_flags): + pyfunc = slicing_1d_usecase5 + self.check_1d_slicing_with_arg(pyfunc, flags) + + def test_1d_slicing5_npm(self): + self.test_1d_slicing5(flags=Noflags) + + def test_1d_slicing6(self, flags=enable_pyobj_flags): + pyfunc = slicing_1d_usecase6 + self.check_1d_slicing_with_arg(pyfunc, flags) + + def test_1d_slicing6_npm(self): + self.test_1d_slicing6(flags=Noflags) + + def test_1d_slicing7(self, flags=enable_pyobj_flags): + pyfunc = slicing_1d_usecase7 + self.check_1d_slicing_with_arg(pyfunc, flags) + + def test_1d_slicing7_npm(self): + self.test_1d_slicing7(flags=Noflags) + + def test_1d_slicing8(self, flags=enable_pyobj_flags): + pyfunc = slicing_1d_usecase8 + self.check_1d_slicing_with_arg(pyfunc, flags) + + def test_1d_slicing8_npm(self): + self.test_1d_slicing8(flags=Noflags) + + def test_2d_slicing(self, flags=enable_pyobj_flags): + """ + arr_2d[a:b:c] + """ + pyfunc = slicing_1d_usecase + arraytype = types.Array(types.int32, 2, 'C') + argtys = (arraytype, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(100, dtype='i4').reshape(10, 10) + for args in [(0, 10, 1), (2, 3, 1), (10, 0, 1), + (0, 10, -1), (0, 10, 2)]: + self.assertPreciseEqual(pyfunc(a, *args), cfunc(a, *args), + msg="for args %s" % (args,)) + + def test_2d_slicing_npm(self): + self.test_2d_slicing(flags=Noflags) + + def test_2d_slicing2(self, flags=enable_pyobj_flags): + """ + arr_2d[a:b:c, d:e:f] + """ + # C layout + pyfunc = slicing_2d_usecase + arraytype = types.Array(types.int32, 2, 'C') + argtys = (arraytype, types.int32, types.int32, types.int32, + types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(100, dtype='i4').reshape(10, 10) + + indices = [(0, 10, 1), + (2, 3, 1), + (10, 0, 1), + (0, 10, -1), + (0, 10, 2), + (10, 0, -1), + (9, 0, -2), + (-5, -2, 1), + (0, -1, 1), + ] + args = [tup1 + tup2 + for (tup1, tup2) in itertools.product(indices, indices)] + for arg in args: + expected = pyfunc(a, *arg) + self.assertPreciseEqual(cfunc(a, *arg), expected) + + # Any layout + arraytype = types.Array(types.int32, 2, 'A') + argtys = (arraytype, types.int32, types.int32, types.int32, + types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(400, dtype='i4').reshape(20, 20)[::2, ::2] + + for arg in args: + expected = pyfunc(a, *arg) + self.assertPreciseEqual(cfunc(a, *arg), expected) + + def test_2d_slicing2_npm(self): + self.test_2d_slicing2(flags=Noflags) + + def test_2d_slicing3(self, flags=enable_pyobj_flags): + """ + arr_2d[a:b:c, d] + """ + # C layout + pyfunc = slicing_2d_usecase3 + arraytype = types.Array(types.int32, 2, 'C') + argtys = (arraytype, types.int32, types.int32, types.int32, + types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(100, dtype='i4').reshape(10, 10) + + args = [ + (0, 10, 1, 0), + (2, 3, 1, 1), + (10, 0, -1, 8), + (9, 0, -2, 4), + (0, 10, 2, 3), + (0, -1, 3, 1), + ] + for arg in args: + expected = pyfunc(a, *arg) + self.assertPreciseEqual(cfunc(a, *arg), expected) + + # Any layout + arraytype = types.Array(types.int32, 2, 'A') + argtys = (arraytype, types.int32, types.int32, types.int32, + types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(400, dtype='i4').reshape(20, 20)[::2, ::2] + + for arg in args: + expected = pyfunc(a, *arg) + self.assertPreciseEqual(cfunc(a, *arg), expected) + + def test_2d_slicing3_npm(self): + self.test_2d_slicing3(flags=Noflags) + + def test_3d_slicing(self, flags=enable_pyobj_flags): + # C layout + pyfunc = slicing_3d_usecase + arraytype = types.Array(types.int32, 3, 'C') + argtys = (arraytype, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(1000, dtype='i4').reshape(10, 10, 10) + + args = [ + (0, 9, 1), + (2, 3, 1), + (9, 0, 1), + (0, 9, -1), + (0, 9, 2), + ] + for arg in args: + self.assertEqual(pyfunc(a, *arg), cfunc(a, *arg)) + + # Any layout + arraytype = types.Array(types.int32, 3, 'A') + argtys = (arraytype, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(2000, dtype='i4')[::2].reshape(10, 10, 10) + + for arg in args: + self.assertEqual(pyfunc(a, *arg), cfunc(a, *arg)) + + def test_3d_slicing_npm(self): + self.test_3d_slicing(flags=Noflags) + + def test_3d_slicing2(self, flags=enable_pyobj_flags): + # C layout + pyfunc = slicing_3d_usecase2 + arraytype = types.Array(types.int32, 3, 'C') + argtys = (arraytype, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(1000, dtype='i4').reshape(10, 10, 10) + + args = [ + (0, 9, 1), + (2, 3, 1), + (9, 0, 1), + (0, 9, -1), + (0, 9, 2), + ] + for arg in args: + self.assertEqual(pyfunc(a, *arg), cfunc(a, *arg)) + + # Any layout + arraytype = types.Array(types.int32, 3, 'A') + argtys = (arraytype, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(2000, dtype='i4')[::2].reshape(10, 10, 10) + + for arg in args: + self.assertEqual(pyfunc(a, *arg), cfunc(a, *arg)) + + def test_3d_slicing2_npm(self): + self.test_3d_slicing2(flags=Noflags) + + def test_1d_integer_indexing(self, flags=enable_pyobj_flags): + # C layout + pyfunc = integer_indexing_1d_usecase + arraytype = types.Array(types.int32, 1, 'C') + argtys = (arraytype, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(10, dtype='i4') + self.assertEqual(pyfunc(a, 0), cfunc(a, 0)) + self.assertEqual(pyfunc(a, 9), cfunc(a, 9)) + self.assertEqual(pyfunc(a, -1), cfunc(a, -1)) + + # Any layout + arraytype = types.Array(types.int32, 1, 'A') + argtys = (arraytype, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(10, dtype='i4')[::2] + self.assertFalse(a.flags['C_CONTIGUOUS']) + self.assertFalse(a.flags['F_CONTIGUOUS']) + self.assertEqual(pyfunc(a, 0), cfunc(a, 0)) + self.assertEqual(pyfunc(a, 2), cfunc(a, 2)) + self.assertEqual(pyfunc(a, -1), cfunc(a, -1)) + + # Using a 0-d array as integer index + arraytype = types.Array(types.int32, 1, 'C') + indextype = types.Array(types.int16, 0, 'C') + argtys = (arraytype, indextype) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(3, 13, dtype=np.int32) + for i in (0, 9, -2): + idx = np.array(i).astype(np.int16) + assert idx.ndim == 0 + self.assertEqual(pyfunc(a, idx), cfunc(a, idx)) + + def test_1d_integer_indexing_npm(self): + self.test_1d_integer_indexing(flags=Noflags) + + def test_integer_indexing_1d_for_2d(self, flags=enable_pyobj_flags): + # Test partial (1d) indexing of a 2d array + pyfunc = integer_indexing_1d_usecase + arraytype = types.Array(types.int32, 2, 'C') + argtys = (arraytype, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(100, dtype='i4').reshape(10, 10) + self.assertPreciseEqual(pyfunc(a, 0), cfunc(a, 0)) + self.assertPreciseEqual(pyfunc(a, 9), cfunc(a, 9)) + self.assertPreciseEqual(pyfunc(a, -1), cfunc(a, -1)) + + arraytype = types.Array(types.int32, 2, 'A') + argtys = (arraytype, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(20, dtype='i4').reshape(5, 4)[::2] + self.assertPreciseEqual(pyfunc(a, 0), cfunc(a, 0)) + + def test_integer_indexing_1d_for_2d_npm(self): + self.test_integer_indexing_1d_for_2d(flags=Noflags) + + def test_2d_integer_indexing(self, flags=enable_pyobj_flags, + pyfunc=integer_indexing_2d_usecase): + # C layout + a = np.arange(100, dtype='i4').reshape(10, 10) + arraytype = types.Array(types.int32, 2, 'C') + argtys = (arraytype, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + self.assertEqual(pyfunc(a, 0, 3), cfunc(a, 0, 3)) + self.assertEqual(pyfunc(a, 9, 9), cfunc(a, 9, 9)) + self.assertEqual(pyfunc(a, -2, -1), cfunc(a, -2, -1)) + + # Any layout + a = np.arange(100, dtype='i4').reshape(10, 10)[::2, ::2] + self.assertFalse(a.flags['C_CONTIGUOUS']) + self.assertFalse(a.flags['F_CONTIGUOUS']) + + arraytype = types.Array(types.int32, 2, 'A') + argtys = (arraytype, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + self.assertEqual(pyfunc(a, 0, 1), cfunc(a, 0, 1)) + self.assertEqual(pyfunc(a, 2, 2), cfunc(a, 2, 2)) + self.assertEqual(pyfunc(a, -2, -1), cfunc(a, -2, -1)) + + # With 0-d arrays as integer indices + a = np.arange(100, dtype='i4').reshape(10, 10) + arraytype = types.Array(types.int32, 2, 'C') + indextype = types.Array(types.int32, 0, 'C') + argtys = (arraytype, indextype, indextype) + cfunc = jit(argtys, **flags)(pyfunc) + + for i, j in [(0, 3), (8, 9), (-2, -1)]: + i = np.array(i).astype(np.int32) + j = np.array(j).astype(np.int32) + self.assertEqual(pyfunc(a, i, j), cfunc(a, i, j)) + + def test_2d_integer_indexing_npm(self): + self.test_2d_integer_indexing(flags=Noflags) + + def test_2d_integer_indexing2(self): + self.test_2d_integer_indexing(pyfunc=integer_indexing_2d_usecase2) + self.test_2d_integer_indexing(flags=Noflags, + pyfunc=integer_indexing_2d_usecase2) + + def test_2d_integer_indexing_via_call(self): + @njit + def index1(X, i0): + return X[i0] + @njit + def index2(X, i0, i1): + return index1(X[i0], i1) + a = np.arange(10).reshape(2, 5) + self.assertEqual(index2(a, 0, 0), a[0][0]) + self.assertEqual(index2(a, 1, 1), a[1][1]) + self.assertEqual(index2(a, -1, -1), a[-1][-1]) + + def test_2d_float_indexing(self, flags=enable_pyobj_flags): + a = np.arange(100, dtype='i4').reshape(10, 10) + pyfunc = integer_indexing_2d_usecase + arraytype = types.Array(types.int32, 2, 'C') + argtys = (arraytype, types.float32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + self.assertEqual(pyfunc(a, 0, 0), cfunc(a, 0, 0)) + self.assertEqual(pyfunc(a, 9, 9), cfunc(a, 9, 9)) + self.assertEqual(pyfunc(a, -1, -1), cfunc(a, -1, -1)) + + def test_partial_1d_indexing(self, flags=enable_pyobj_flags): + pyfunc = partial_1d_usecase + + def check(arr, arraytype): + argtys = (arraytype, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + self.assertEqual(pyfunc(arr, 0), cfunc(arr, 0)) + n = arr.shape[0] - 1 + self.assertEqual(pyfunc(arr, n), cfunc(arr, n)) + self.assertEqual(pyfunc(arr, -1), cfunc(arr, -1)) + + a = np.arange(12, dtype='i4').reshape((4, 3)) + arraytype = types.Array(types.int32, 2, 'C') + check(a, arraytype) + + a = np.arange(12, dtype='i4').reshape((3, 4)).T + arraytype = types.Array(types.int32, 2, 'F') + check(a, arraytype) + + a = np.arange(12, dtype='i4').reshape((3, 4))[::2] + arraytype = types.Array(types.int32, 2, 'A') + check(a, arraytype) + + def check_ellipsis(self, pyfunc, flags): + def compile_func(arr): + argtys = (typeof(arr), types.intp, types.intp) + return jit(argtys, **flags)(pyfunc) + + def run(a): + bounds = (0, 1, 2, -1, -2) + cfunc = compile_func(a) + for i, j in itertools.product(bounds, bounds): + x = cfunc(a, i, j) + np.testing.assert_equal(pyfunc(a, i, j), cfunc(a, i, j)) + + run(np.arange(16, dtype='i4').reshape(4, 4)) + run(np.arange(27, dtype='i4').reshape(3, 3, 3)) + + def test_ellipsis1(self, flags=enable_pyobj_flags): + self.check_ellipsis(ellipsis_usecase1, flags) + + def test_ellipsis1_npm(self): + self.test_ellipsis1(flags=Noflags) + + def test_ellipsis2(self, flags=enable_pyobj_flags): + self.check_ellipsis(ellipsis_usecase2, flags) + + def test_ellipsis2_npm(self): + self.test_ellipsis2(flags=Noflags) + + def test_ellipsis3(self, flags=enable_pyobj_flags): + self.check_ellipsis(ellipsis_usecase3, flags) + + def test_ellipsis3_npm(self): + self.test_ellipsis3(flags=Noflags) + + def test_ellipsis_issue1498(self): + # This is an issue due to incorrect layout inferred for when + # ellpsis is used and ndenumerate is specializing on the layout. + @njit + def udt(arr): + out = np.zeros_like(arr) + i = 0 + for index, val in np.ndenumerate(arr[..., i]): + out[index][i] = val + + return out + + py_func = udt.py_func + + outersize = 4 + innersize = 4 + arr = np.arange(outersize * innersize).reshape(outersize, innersize) + got = udt(arr) + expected = py_func(arr) + np.testing.assert_equal(got, expected) + + def test_ellipsis_issue1499(self): + # This tests an issue when ndarray.__getitem__ recv a tuple of + # constants. The lowering is mishandling the constant value creation. + @njit + def udt(arr): + return arr[..., 0] + + arr = np.arange(3) + got = udt(arr) + expected = udt.py_func(arr) + np.testing.assert_equal(got, expected) + + def test_none_index(self, flags=enable_pyobj_flags): + pyfunc = none_index_usecase + arraytype = types.Array(types.int32, 2, 'C') + # TODO should be enable to handle this in NoPython mode + argtys = (arraytype,) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(100, dtype='i4').reshape(10, 10) + self.assertPreciseEqual(pyfunc(a), cfunc(a)) + + def test_none_index_npm(self): + with self.assertTypingError(): + self.test_none_index(flags=Noflags) + + def test_empty_tuple_indexing(self, flags=enable_pyobj_flags): + pyfunc = empty_tuple_usecase + arraytype = types.Array(types.int32, 0, 'C') + argtys = (arraytype,) + cfunc = jit(argtys, **flags)(pyfunc) + + a = np.arange(1, dtype='i4').reshape(()) + self.assertPreciseEqual(pyfunc(a), cfunc(a)) + + def test_empty_tuple_indexing_npm(self): + self.test_empty_tuple_indexing(flags=Noflags) + + +class TestSetItem(TestCase): + """ + Test basic indexed store into an array. + Note fancy indexing is tested in test_fancy_indexing. + """ + + def test_conversion_setitem(self, flags=enable_pyobj_flags): + """ this used to work, and was used in one of the tutorials """ + from numba import jit + + def pyfunc(array): + for index in range(len(array)): + array[index] = index % decimal.Decimal(100) + + cfunc = jit("void(i8[:])", **flags)(pyfunc) + + udt = np.arange(100, dtype='i1') + control = udt.copy() + pyfunc(control) + cfunc(udt) + self.assertPreciseEqual(udt, control) + + def test_1d_slicing_set(self, flags=enable_pyobj_flags): + """ + 1d to 1d slice assignment + """ + pyfunc = slicing_1d_usecase_set + # Note heterogeneous types for the source and destination arrays + # (int16[:] -> int32[:]) + dest_type = types.Array(types.int32, 1, 'C') + src_type = types.Array(types.int16, 1, 'A') + argtys = (dest_type, src_type, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + N = 10 + arg = np.arange(N, dtype='i2') + 40 + bounds = [0, 2, N - 2, N, N + 1, N + 3, + -2, -N + 2, -N, -N - 1, -N - 3] + def make_dest(): + return np.zeros_like(arg, dtype='i4') + for start, stop in itertools.product(bounds, bounds): + for step in (1, 2, -1, -2): + args = start, stop, step + index = slice(*args) + pyleft = pyfunc(make_dest(), arg[index], *args) + cleft = cfunc(make_dest(), arg[index], *args) + self.assertPreciseEqual(pyleft, cleft) + + # Mismatching input size and slice length + with self.assertRaises(ValueError): + cfunc(np.zeros_like(arg, dtype=np.int32), arg, 0, 0, 1) + + def check_1d_slicing_set_sequence(self, flags, seqty, seq): + """ + Generic sequence to 1d slice assignment + """ + pyfunc = slicing_1d_usecase_set + dest_type = types.Array(types.int32, 1, 'C') + argtys = (dest_type, seqty, types.int32, types.int32, types.int32) + # This emulates the use of `compile_result`. The args that are passed + # into this checking function are not as advertised in argtys and + # implicit casting is required. + cfunc = jit(argtys, **flags)(pyfunc).overloads[argtys].entry_point + + N = 10 + k = len(seq) + arg = np.arange(N, dtype=np.int32) + args = (seq, 1, -N + k + 1, 1) + expected = pyfunc(arg.copy(), *args) + got = cfunc(arg.copy(), *args) + self.assertPreciseEqual(expected, got) + + args = (seq, 1, -N + k, 1) + with self.assertRaises(ValueError) as raises: + cfunc(arg.copy(), *args) + + if flags.get('nopython', False): + # if in nopython mode, check the error message from Numba + slice_size = len(arg[slice(1, -N + k, 1)]) + msg = (f"cannot assign slice of shape ({k},) from input of shape " + f"({slice_size},)") + self.assertIn(msg, str(raises.exception)) + + def test_1d_slicing_set_tuple(self, flags=enable_pyobj_flags): + """ + Tuple to 1d slice assignment + """ + self.check_1d_slicing_set_sequence( + flags, types.UniTuple(types.int16, 2), (8, -42)) + + def test_1d_slicing_set_list(self, flags=enable_pyobj_flags): + """ + List to 1d slice assignment + """ + self.check_1d_slicing_set_sequence( + flags, types.List(types.int16), [8, -42]) + + def test_1d_slicing_broadcast(self, flags=enable_pyobj_flags): + """ + scalar to 1d slice assignment + """ + pyfunc = slicing_1d_usecase_set + arraytype = types.Array(types.int32, 1, 'C') + # Note heterogeneous types for the source scalar and the destination + # array (int16 -> int32[:]) + argtys = (arraytype, types.int16, types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + N = 10 + arg = np.arange(N, dtype='i4') + val = 42 + bounds = [0, 2, N - 2, N, N + 1, N + 3, + -2, -N + 2, -N, -N - 1, -N - 3] + for start, stop in itertools.product(bounds, bounds): + for step in (1, 2, -1, -2): + args = val, start, stop, step + pyleft = pyfunc(arg.copy(), *args) + cleft = cfunc(arg.copy(), *args) + self.assertPreciseEqual(pyleft, cleft) + + def test_1d_slicing_add(self, flags=enable_pyobj_flags): + pyfunc = slicing_1d_usecase_add + arraytype = types.Array(types.int32, 1, 'C') + argtys = (arraytype, arraytype, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + arg = np.arange(10, dtype='i4') + for test in ((0, 10), (2, 5)): + pyleft = pyfunc(np.zeros_like(arg), arg[slice(*test)], *test) + cleft = cfunc(np.zeros_like(arg), arg[slice(*test)], *test) + self.assertPreciseEqual(pyleft, cleft) + + def test_1d_slicing_set_npm(self): + self.test_1d_slicing_set(flags=Noflags) + + def test_1d_slicing_set_list_npm(self): + self.test_1d_slicing_set_list(flags=Noflags) + + def test_1d_slicing_set_tuple_npm(self): + self.test_1d_slicing_set_tuple(flags=Noflags) + + def test_1d_slicing_broadcast_npm(self): + self.test_1d_slicing_broadcast(flags=Noflags) + + def test_1d_slicing_add_npm(self): + self.test_1d_slicing_add(flags=Noflags) + + def test_2d_slicing_set(self, flags=enable_pyobj_flags): + """ + 2d to 2d slice assignment + """ + pyfunc = slicing_2d_usecase_set + arraytype = types.Array(types.int32, 2, 'A') + argtys = (arraytype, arraytype, types.int32, types.int32, types.int32, + types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + arg = np.arange(10*10, dtype='i4').reshape(10,10) + tests = [ + (0, 10, 1, 0, 10, 1), + (2, 3, 1, 2, 3, 1), + (10, 0, 1, 10, 0, 1), + (0, 10, -1, 0, 10, -1), + (0, 10, 2, 0, 10, 2), + ] + for test in tests: + pyleft = pyfunc(np.zeros_like(arg), arg[slice(*test[0:3]), slice(*test[3:6])], *test) + cleft = cfunc(np.zeros_like(arg), arg[slice(*test[0:3]), slice(*test[3:6])], *test) + self.assertPreciseEqual(cleft, pyleft) + + def test_2d_slicing_broadcast(self, flags=enable_pyobj_flags): + """ + scalar to 2d slice assignment + """ + pyfunc = slicing_2d_usecase_set + arraytype = types.Array(types.int32, 2, 'C') + # Note heterogeneous types for the source scalar and the destination + # array (int16 -> int32[:]) + argtys = (arraytype, types.int16, types.int32, types.int32, types.int32, + types.int32, types.int32, types.int32) + cfunc = jit(argtys, **flags)(pyfunc) + + arg = np.arange(10*10, dtype='i4').reshape(10,10) + val = 42 + tests = [ + (0, 10, 1, 0, 10, 1), + (2, 3, 1, 2, 3, 1), + (10, 0, 1, 10, 0, 1), + (0, 10, -1, 0, 10, -1), + (0, 10, 2, 0, 10, 2), + ] + for test in tests: + pyleft = pyfunc(arg.copy(), val, *test) + cleft = cfunc(arg.copy(), val, *test) + self.assertPreciseEqual(cleft, pyleft) + + def test_2d_slicing_set_npm(self): + self.test_2d_slicing_set(flags=Noflags) + + def test_2d_slicing_broadcast_npm(self): + self.test_2d_slicing_broadcast(flags=Noflags) + + def test_setitem(self): + """ + scalar indexed assignment + """ + arr = np.arange(5) + setitem_usecase(arr, 1, 42) + self.assertEqual(arr.tolist(), [0, 42, 2, 3, 4]) + # Using a 0-d array as scalar index + setitem_usecase(arr, np.array(3).astype(np.uint16), 8) + self.assertEqual(arr.tolist(), [0, 42, 2, 8, 4]) + # Scalar Broadcasting + arr = np.arange(9).reshape(3, 3) + setitem_usecase(arr, 1, 42) + self.assertEqual(arr.tolist(), [[0, 1, 2], [42, 42, 42], [6, 7, 8]]) + + def test_setitem_broadcast(self): + """ + broadcasted array assignment + """ + # Scalar Broadcasting + dst = np.arange(5) + setitem_broadcast_usecase(dst, 42) + self.assertEqual(dst.tolist(), [42] * 5) + # 1D -> 2D Array Broadcasting + dst = np.arange(6).reshape(2, 3) + setitem_broadcast_usecase(dst, np.arange(1, 4)) + self.assertEqual(dst.tolist(), [[1, 2, 3], [1, 2, 3]]) + # 2D -> 2D Array Broadcasting + dst = np.arange(6).reshape(2, 3) + setitem_broadcast_usecase(dst, np.arange(1, 4).reshape(1, 3)) + self.assertEqual(dst.tolist(), [[1, 2, 3], [1, 2, 3]]) + # 2D -> 4D Array Broadcasting + dst = np.arange(12).reshape(2, 1, 2, 3) + setitem_broadcast_usecase(dst, np.arange(1, 4).reshape(1, 3)) + inner2 = [[1, 2, 3], [1, 2, 3]] + self.assertEqual(dst.tolist(), [[inner2]] * 2) + # 2D -> 1D Array Broadcasting + dst = np.arange(5) + setitem_broadcast_usecase(dst, np.arange(1, 6).reshape(1, 5)) + self.assertEqual(dst.tolist(), [1, 2, 3, 4, 5]) + # 4D -> 2D Array Broadcasting + dst = np.arange(6).reshape(2, 3) + setitem_broadcast_usecase(dst, np.arange(1, 1 + dst.size).reshape(1, 1, 2, 3)) + self.assertEqual(dst.tolist(), [[1, 2, 3], [4, 5, 6]]) + + def test_setitem_broadcast_error(self): + # higher dim assigned into lower dim + # 2D -> 1D + dst = np.arange(5) + src = np.arange(10).reshape(2, 5) + with self.assertRaises(ValueError) as raises: + setitem_broadcast_usecase(dst, src) + errmsg = str(raises.exception) + self.assertEqual('cannot broadcast source array for assignment', + errmsg) + # 3D -> 2D + dst = np.arange(5).reshape(1, 5) + src = np.arange(10).reshape(1, 2, 5) + with self.assertRaises(ValueError) as raises: + setitem_broadcast_usecase(dst, src) + errmsg = str(raises.exception) + self.assertEqual(('cannot assign slice of shape (2, 5) from input of' + + ' shape (1, 5)'), + errmsg) + # lower to higher + # 1D -> 2D + dst = np.arange(10).reshape(2, 5) + src = np.arange(4) + with self.assertRaises(ValueError) as raises: + setitem_broadcast_usecase(dst, src) + errmsg = str(raises.exception) + self.assertEqual(('cannot assign slice of shape (2, 4) from input of' + + ' shape (2, 5)'), + errmsg) + + def test_slicing_1d_broadcast(self): + # 1D -> 2D sliced (1) + dst = np.arange(6).reshape(3, 2) + src = np.arange(1, 3) + slicing_1d_usecase_set(dst, src, 0, 2, 1) + self.assertEqual(dst.tolist(), [[1, 2], [1, 2], [4, 5]]) + # 1D -> 2D sliced (2) + dst = np.arange(6).reshape(3, 2) + src = np.arange(1, 3) + slicing_1d_usecase_set(dst, src, 0, None, 2) + self.assertEqual(dst.tolist(), [[1, 2], [2, 3], [1, 2]]) + # 2D -> 2D sliced (3) + dst = np.arange(6).reshape(3, 2) + src = np.arange(1, 5).reshape(2, 2) + slicing_1d_usecase_set(dst, src, None, 2, 1) + self.assertEqual(dst.tolist(), [[1, 2], [3, 4], [4, 5]]) + + def test_setitem_readonly(self): + arr = np.arange(5) + arr.flags.writeable = False + with self.assertRaises((TypeError, errors.TypingError)) as raises: + setitem_usecase(arr, 1, 42) + self.assertIn("Cannot modify readonly array of type:", + str(raises.exception)) + + +class TestTyping(TestCase): + """ + Check typing of basic indexing operations + """ + + def test_layout(self): + """ + Check an appropriate layout is inferred for the result of array + indexing. + """ + + func = arraydecl.get_array_index_type + + cty = types.Array(types.float64, 3, 'C') + fty = types.Array(types.float64, 3, 'F') + aty = types.Array(types.float64, 3, 'A') + + indices = [ + # Tuples of (indexing arguments, keeps "C" layout, keeps "F" layout) + ((), True, True), + ((ellipsis,), True, True), + + # Indexing from the left => can sometimes keep "C" layout + ((intp,), True, False), + ((slice2_type,), True, False), + ((intp, slice2_type), True, False), + ((slice2_type, intp), False, False), + ((slice2_type, slice2_type), False, False), + # Strided slices = > "A" layout + ((intp, slice3_type), False, False), + ((slice3_type,), False, False), + + # Indexing from the right => can sometimes keep "F" layout + ((ellipsis, intp,), False, True), + ((ellipsis, slice2_type,), False, True), + ((ellipsis, intp, slice2_type,), False, False), + ((ellipsis, slice2_type, intp,), False, True), + ((ellipsis, slice2_type, slice2_type,), False, False), + # Strided slices = > "A" layout + ((ellipsis, slice3_type,), False, False), + ((ellipsis, slice3_type, intp,), False, False), + + # Indexing from both sides => only if all dimensions are indexed + ((intp, ellipsis, intp,), False, False), + ((slice2_type, ellipsis, slice2_type,), False, False), + ((intp, intp, slice2_type,), True, False), + ((intp, ellipsis, intp, slice2_type,), True, False), + ((slice2_type, intp, intp,), False, True), + ((slice2_type, intp, ellipsis, intp,), False, True), + ((intp, slice2_type, intp,), False, False), + # Strided slices = > "A" layout + ((slice3_type, intp, intp,), False, False), + ((intp, intp, slice3_type,), False, False), + ] + + for index_tuple, keep_c, _ in indices: + index = types.Tuple(index_tuple) + r = func(cty, index) + self.assertEqual(tuple(r.index), index_tuple) + self.assertEqual(r.result.layout, 'C' if keep_c else 'A', + index_tuple) + self.assertFalse(r.advanced) + + for index_tuple, _, keep_f in indices: + index = types.Tuple(index_tuple) + r = func(fty, index) + self.assertEqual(tuple(r.index), index_tuple) + self.assertEqual(r.result.layout, 'F' if keep_f else 'A', + index_tuple) + self.assertFalse(r.advanced) + + for index_tuple, _, _ in indices: + index = types.Tuple(index_tuple) + r = func(aty, index) + self.assertEqual(tuple(r.index), index_tuple) + self.assertEqual(r.result.layout, 'A') + self.assertFalse(r.advanced) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_init_utils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_init_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..cff483c5eefc3be2b924afeb733450edc2c4a320 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_init_utils.py @@ -0,0 +1,42 @@ +import unittest + +from numba.tests.support import TestCase + +from numba.misc.init_utils import version_info, generate_version_info + + +class TestGenerateVersionInfo(TestCase): + + def test_major_minor_patch(self): + expected = version_info(0, 1, 0, + (0, 1), (0, 1, 0), + "0.1.0", ('0', '1', '0'), None) + received = generate_version_info("0.1.0") + self.assertEqual(received, expected) + + def test_unknown(self): + expected = version_info(None, None, None, + (None, None), (None, None, None), + '0+unknown', ('0+unknown',), None) + received = generate_version_info('0+unknown') + self.assertEqual(received, expected) + + def test_dev(self): + expected = version_info(0, 1, None, + (0, 1), (0, 1, None), + '0.1.0dev0', ('0', '1', '0dev0'), None) + received = generate_version_info('0.1.0dev0') + self.assertEqual(received, expected) + + def test_full_rev(self): + expected = version_info(0, 1, None, + (0, 1), (0, 1, None), + '0.1.0dev0+1.g0123456789abcdef', + ('0', '1', '0dev0+1', 'g0123456789abcdef'), + 'g0123456789abcdef') + received = generate_version_info('0.1.0dev0+1.g0123456789abcdef') + self.assertEqual(received, expected) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_inlining.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_inlining.py new file mode 100644 index 0000000000000000000000000000000000000000..45376a483d515974481212c6454ff5ec1f193136 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_inlining.py @@ -0,0 +1,279 @@ +import re +import numpy as np + +from numba.tests.support import (TestCase, override_config, captured_stdout, + skip_parfors_unsupported) +from numba import jit, njit +from numba.core import types, ir, postproc, compiler +from numba.core.ir_utils import (guard, find_callname, find_const, + get_definition, simplify_CFG) +from numba.core.registry import CPUDispatcher +from numba.core.inline_closurecall import inline_closure_call + +from numba.core.untyped_passes import (ExtractByteCode, TranslateByteCode, FixupArgs, + IRProcessing, DeadBranchPrune, + RewriteSemanticConstants, GenericRewrites, + WithLifting, PreserveIR, InlineClosureLikes) + +from numba.core.typed_passes import (NopythonTypeInference, AnnotateTypes, + NopythonRewrites, PreParforPass, ParforPass, + DumpParforDiagnostics, NativeLowering, + NativeParforLowering, IRLegalization, + NoPythonBackend, NativeLowering, + ParforFusionPass, ParforPreLoweringPass) + +from numba.core.compiler_machinery import FunctionPass, PassManager, register_pass +import unittest + +@register_pass(analysis_only=False, mutates_CFG=True) +class InlineTestPass(FunctionPass): + _name = "inline_test_pass" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + # assuming the function has one block with one call inside + assert len(state.func_ir.blocks) == 1 + block = list(state.func_ir.blocks.values())[0] + for i, stmt in enumerate(block.body): + if guard(find_callname,state.func_ir, stmt.value) is not None: + inline_closure_call(state.func_ir, {}, block, i, lambda: None, + state.typingctx, state.targetctx, (), + state.typemap, state.calltypes) + break + # also fix up the IR + post_proc = postproc.PostProcessor(state.func_ir) + post_proc.run() + post_proc.remove_dels() + return True + + +def gen_pipeline(state, test_pass): + name = 'inline_test' + pm = PassManager(name) + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(FixupArgs, "fix up args") + pm.add_pass(IRProcessing, "processing IR") + pm.add_pass(WithLifting, "Handle with contexts") + # pre typing + if not state.flags.no_rewrites: + pm.add_pass(GenericRewrites, "nopython rewrites") + pm.add_pass(RewriteSemanticConstants, "rewrite semantic constants") + pm.add_pass(DeadBranchPrune, "dead branch pruning") + pm.add_pass(InlineClosureLikes, + "inline calls to locally defined closures") + # typing + pm.add_pass(NopythonTypeInference, "nopython frontend") + + if state.flags.auto_parallel.enabled: + pm.add_pass(PreParforPass, "Preprocessing for parfors") + if not state.flags.no_rewrites: + pm.add_pass(NopythonRewrites, "nopython rewrites") + if state.flags.auto_parallel.enabled: + pm.add_pass(ParforPass, "convert to parfors") + pm.add_pass(ParforFusionPass, "fuse parfors") + pm.add_pass(ParforPreLoweringPass, "parfor prelowering") + + pm.add_pass(test_pass, "inline test") + + # legalise + pm.add_pass(IRLegalization, "ensure IR is legal prior to lowering") + pm.add_pass(AnnotateTypes, "annotate types") + pm.add_pass(PreserveIR, "preserve IR") + + # lower + if state.flags.auto_parallel.enabled: + pm.add_pass(NativeParforLowering, "native parfor lowering") + else: + pm.add_pass(NativeLowering, "native lowering") + pm.add_pass(NoPythonBackend, "nopython mode backend") + pm.add_pass(DumpParforDiagnostics, "dump parfor diagnostics") + return pm + +class InlineTestPipeline(compiler.CompilerBase): + """compiler pipeline for testing inlining after optimization + """ + def define_pipelines(self): + pm = gen_pipeline(self.state, InlineTestPass) + pm.finalize() + return [pm] + +class TestInlining(TestCase): + """ + Check that jitted inner functions are inlined into outer functions, + in nopython mode. + Note that not all inner functions are guaranteed to be inlined. + We just trust LLVM's inlining heuristics. + """ + + def make_pattern(self, fullname): + """ + Make regexpr to match mangled name + """ + parts = fullname.split('.') + return r'_ZN?' + r''.join([r'\d+{}'.format(p) for p in parts]) + + def assert_has_pattern(self, fullname, text): + pat = self.make_pattern(fullname) + self.assertIsNotNone(re.search(pat, text), + msg='expected {}'.format(pat)) + + def assert_not_has_pattern(self, fullname, text): + pat = self.make_pattern(fullname) + self.assertIsNone(re.search(pat, text), + msg='unexpected {}'.format(pat)) + + def test_inner_function(self): + from numba.tests.inlining_usecases import outer_simple, \ + __name__ as prefix + + with override_config('DUMP_ASSEMBLY', True): + with captured_stdout() as out: + cfunc = jit((types.int32,), nopython=True)(outer_simple) + self.assertPreciseEqual(cfunc(1), 4) + # Check the inner function was elided from the output (which also + # guarantees it was inlined into the outer function). + asm = out.getvalue() + self.assert_has_pattern('%s.outer_simple' % prefix, asm) + self.assert_not_has_pattern('%s.inner' % prefix, asm) + + def test_multiple_inner_functions(self): + from numba.tests.inlining_usecases import outer_multiple, \ + __name__ as prefix + # Same with multiple inner functions, and multiple calls to + # the same inner function (inner()). This checks that linking in + # the same library/module twice doesn't produce linker errors. + with override_config('DUMP_ASSEMBLY', True): + with captured_stdout() as out: + cfunc = jit((types.int32,), nopython=True)(outer_multiple) + self.assertPreciseEqual(cfunc(1), 6) + asm = out.getvalue() + self.assert_has_pattern('%s.outer_multiple' % prefix, asm) + self.assert_not_has_pattern('%s.more' % prefix, asm) + self.assert_not_has_pattern('%s.inner' % prefix, asm) + + @skip_parfors_unsupported + def test_inline_call_after_parfor(self): + from numba.tests.inlining_usecases import __dummy__ + # replace the call to make sure inlining doesn't cause label conflict + # with parfor body + def test_impl(A): + __dummy__() + return A.sum() + j_func = njit(parallel=True, pipeline_class=InlineTestPipeline)( + test_impl) + A = np.arange(10) + self.assertEqual(test_impl(A), j_func(A)) + + @skip_parfors_unsupported + def test_inline_update_target_def(self): + + def test_impl(a): + if a == 1: + b = 2 + else: + b = 3 + return b + + func_ir = compiler.run_frontend(test_impl) + blocks = list(func_ir.blocks.values()) + for block in blocks: + for i, stmt in enumerate(block.body): + # match b = 2 and replace with lambda: 2 + if (isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Var) + and guard(find_const, func_ir, stmt.value) == 2): + # replace expr with a dummy call + func_ir._definitions[stmt.target.name].remove(stmt.value) + stmt.value = ir.Expr.call(ir.Var(block.scope, "myvar", loc=stmt.loc), (), (), stmt.loc) + func_ir._definitions[stmt.target.name].append(stmt.value) + #func = g.py_func# + inline_closure_call(func_ir, {}, block, i, lambda: 2) + break + + self.assertEqual(len(func_ir._definitions['b']), 2) + + @skip_parfors_unsupported + def test_inline_var_dict_ret(self): + # make sure inline_closure_call returns the variable replacement dict + # and it contains the original variable name used in locals + @njit(locals={'b': types.float64}) + def g(a): + b = a + 1 + return b + + def test_impl(): + return g(1) + + func_ir = compiler.run_frontend(test_impl) + blocks = list(func_ir.blocks.values()) + for block in blocks: + for i, stmt in enumerate(block.body): + if (isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == 'call'): + func_def = guard(get_definition, func_ir, stmt.value.func) + if (isinstance(func_def, (ir.Global, ir.FreeVar)) + and isinstance(func_def.value, CPUDispatcher)): + py_func = func_def.value.py_func + _, var_map = inline_closure_call( + func_ir, py_func.__globals__, block, i, py_func) + break + + self.assertTrue('b' in var_map) + + @skip_parfors_unsupported + def test_inline_call_branch_pruning(self): + # branch pruning pass should run properly in inlining to enable + # functions with type checks + @njit + def foo(A=None): + if A is None: + return 2 + else: + return A + + def test_impl(A=None): + return foo(A) + + @register_pass(analysis_only=False, mutates_CFG=True) + class PruningInlineTestPass(FunctionPass): + _name = "pruning_inline_test_pass" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + # assuming the function has one block with one call inside + assert len(state.func_ir.blocks) == 1 + block = list(state.func_ir.blocks.values())[0] + for i, stmt in enumerate(block.body): + if (guard(find_callname, state.func_ir, stmt.value) + is not None): + inline_closure_call(state.func_ir, {}, block, i, + foo.py_func, state.typingctx, state.targetctx, + (state.typemap[stmt.value.args[0].name],), + state.typemap, state.calltypes) + break + return True + + class InlineTestPipelinePrune(compiler.CompilerBase): + + def define_pipelines(self): + pm = gen_pipeline(self.state, PruningInlineTestPass) + pm.finalize() + return [pm] + + # make sure inline_closure_call runs in full pipeline + j_func = njit(pipeline_class=InlineTestPipelinePrune)(test_impl) + A = 3 + self.assertEqual(test_impl(A), j_func(A)) + self.assertEqual(test_impl(), j_func()) + + # make sure IR doesn't have branches + fir = j_func.overloads[(types.Omitted(None),)].metadata['preserved_ir'] + fir.blocks = simplify_CFG(fir.blocks) + self.assertEqual(len(fir.blocks), 1) + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_interpreter.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_interpreter.py new file mode 100644 index 0000000000000000000000000000000000000000..fef9ddaa91b2e7a40162475e627afd89244b8c0b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_interpreter.py @@ -0,0 +1,1154 @@ +""" +Test bytecode fixes provided in interpreter.py +""" +import unittest +from numba import jit, njit, objmode, typeof, literally +from numba.extending import overload +from numba.core import types +from numba.core.errors import UnsupportedBytecodeError +from numba.tests.support import ( + TestCase, + MemoryLeakMixin, + skip_unless_py10_or_later, +) + + +@njit +def sum_jit_func( + arg0=0, + arg1=0, + arg2=0, + arg3=0, + arg4=0, + arg5=0, + arg6=0, + arg7=0, + arg8=0, + arg9=0, + arg10=0, + arg11=0, + arg12=0, + arg13=0, + arg14=0, + arg15=0, + arg16=0, + arg17=0, + arg18=0, + arg19=0, + arg20=0, + arg21=0, + arg22=0, + arg23=0, + arg24=0, + arg25=0, + arg26=0, + arg27=0, + arg28=0, + arg29=0, + arg30=0, + arg31=0, + arg32=0, + arg33=0, + arg34=0, + arg35=0, + arg36=0, + arg37=0, + arg38=0, + arg39=0, + arg40=0, + arg41=0, + arg42=0, + arg43=0, + arg44=0, + arg45=0, + arg46=0, +): + return ( + arg0 + + arg1 + + arg2 + + arg3 + + arg4 + + arg5 + + arg6 + + arg7 + + arg8 + + arg9 + + arg10 + + arg11 + + arg12 + + arg13 + + arg14 + + arg15 + + arg16 + + arg17 + + arg18 + + arg19 + + arg20 + + arg21 + + arg22 + + arg23 + + arg24 + + arg25 + + arg26 + + arg27 + + arg28 + + arg29 + + arg30 + + arg31 + + arg32 + + arg33 + + arg34 + + arg35 + + arg36 + + arg37 + + arg38 + + arg39 + + arg40 + + arg41 + + arg42 + + arg43 + + arg44 + + arg45 + + arg46 + ) + + +class TestCallFunctionExPeepHole(MemoryLeakMixin, TestCase): + """ + gh #7812 + + Tests that check a peephole optimization for Function calls + in Python 3.10. The bytecode changes when + (n_args / 2) + n_kws > 15, which moves the arguments from + the stack into a tuple and dictionary. + + This peephole optimization updates the IR to use the original format. + There are different paths when n_args > 30 and n_args <= 30 and when + n_kws > 15 and n_kws <= 15. + """ + THRESHOLD_ARGS = 31 + THRESHOLD_KWS = 16 + + def gen_func(self, n_args, n_kws): + """ + Generates a function that calls sum_jit_func + with the desired number of args and kws. + """ + param_list = [f"arg{i}" for i in range(n_args + n_kws)] + args_list = [] + for i in range(n_args + n_kws): + # Call a function on every 5th argument to ensure + # we test function calls. + if i % 5 == 0: + arg_val = f"pow(arg{i}, 2)" + else: + arg_val = f"arg{i}" + args_list.append(arg_val) + total_params = ", ".join(param_list) + func_text = f"def impl({total_params}):\n" + func_text += " return sum_jit_func(\n" + for i in range(n_args): + func_text += f" {args_list[i]},\n" + for i in range(n_args, n_args + n_kws): + func_text += f" {param_list[i]}={args_list[i]},\n" + func_text += " )\n" + local_vars = {} + exec(func_text, {"sum_jit_func": sum_jit_func}, local_vars) + return local_vars["impl"] + + @skip_unless_py10_or_later + def test_all_args(self): + """ + Tests calling a function when n_args > 30 and + n_kws = 0. This shouldn't use the peephole, but + it should still succeed. + """ + total_args = [i for i in range(self.THRESHOLD_ARGS)] + f = self.gen_func(self.THRESHOLD_ARGS, 0) + py_func = f + cfunc = njit()(f) + a = py_func(*total_args) + b = cfunc(*total_args) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_all_kws(self): + """ + Tests calling a function when n_kws > 15 and + n_args = 0. + """ + total_args = [i for i in range(self.THRESHOLD_KWS)] + f = self.gen_func(0, self.THRESHOLD_KWS) + py_func = f + cfunc = njit()(f) + a = py_func(*total_args) + b = cfunc(*total_args) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_small_args_small_kws(self): + """ + Tests calling a function when (n_args / 2) + n_kws > 15, + but n_args <= 30 and n_kws <= 15 + """ + used_args = self.THRESHOLD_ARGS - 1 + used_kws = self.THRESHOLD_KWS - 1 + total_args = [i for i in range((used_args) + (used_kws))] + f = self.gen_func(used_args, used_kws) + py_func = f + cfunc = njit()(f) + a = py_func(*total_args) + b = cfunc(*total_args) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_small_args_large_kws(self): + """ + Tests calling a function when (n_args / 2) + n_kws > 15, + but n_args <= 30 and n_kws > 15 + """ + used_args = self.THRESHOLD_ARGS - 1 + used_kws = self.THRESHOLD_KWS + total_args = [i for i in range((used_args) + (used_kws))] + f = self.gen_func(used_args, used_kws) + py_func = f + cfunc = njit()(f) + a = py_func(*total_args) + b = cfunc(*total_args) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_large_args_small_kws(self): + """ + Tests calling a function when (n_args / 2) + n_kws > 15, + but n_args > 30 and n_kws <= 15 + """ + used_args = self.THRESHOLD_ARGS + used_kws = self.THRESHOLD_KWS - 1 + total_args = [i for i in range((used_args) + (used_kws))] + f = self.gen_func(used_args, used_kws) + py_func = f + cfunc = njit()(f) + a = py_func(*total_args) + b = cfunc(*total_args) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_large_args_large_kws(self): + """ + Tests calling a function when (n_args / 2) + n_kws > 15, + but n_args > 30 and n_kws > 15 + """ + used_args = self.THRESHOLD_ARGS + used_kws = self.THRESHOLD_KWS + total_args = [i for i in range((used_args) + (used_kws))] + f = self.gen_func(used_args, used_kws) + py_func = f + cfunc = njit()(f) + a = py_func(*total_args) + b = cfunc(*total_args) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_large_kws_objmode(self): + """ + Tests calling an objectmode function with > 15 return values. + """ + def py_func(): + return ( + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + ) + + @njit + def objmode_func(): + """ + Wrapper to call py_func from objmode. This tests + large kws with objmode. If the definition for the + call is not properly updated this test will fail. + """ + with objmode( + a='int64', + b='int64', + c='int64', + d='int64', + e='int64', + f='int64', + g='int64', + h='int64', + i='int64', + j='int64', + k='int64', + l='int64', + m='int64', + n='int64', + o='int64', + p='int64', + ): + ( + a, + b, + c, + d, + e, + f, + g, + h, + i, + j, + k, + l, + m, + n, + o, + p + ) = py_func() + return ( + a + + b + + c + + d + + e + + f + + g + + h + + i + + j + + k + + l + + m + + n + + o + + p + ) + + a = sum(list(py_func())) + b = objmode_func() + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_large_args_inline_controlflow(self): + """ + Tests generating large args when one of the inputs + has inlined controlflow. + """ + def inline_func(flag): + return sum_jit_func( + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 if flag else 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + arg41=1, + ) + + with self.assertRaises(UnsupportedBytecodeError) as raises: + njit()(inline_func)(False) + self.assertIn( + 'You can resolve this issue by moving the control flow out', + str(raises.exception) + ) + + @skip_unless_py10_or_later + def test_large_args_noninlined_controlflow(self): + """ + Tests generating large args when one of the inputs + has the change suggested in the error message + for inlined control flow. + """ + def inline_func(flag): + a_val = 1 if flag else 2 + return sum_jit_func( + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + a_val, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + arg41=1, + ) + + py_func = inline_func + cfunc = njit()(inline_func) + a = py_func(False) + b = cfunc(False) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_all_args_inline_controlflow(self): + """ + Tests generating only large args when one of the inputs + has inlined controlflow. This requires a special check + inside peep_hole_call_function_ex_to_call_function_kw + because it usually only handles varkwargs. + """ + def inline_func(flag): + return sum_jit_func( + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 if flag else 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + ) + + with self.assertRaises(UnsupportedBytecodeError) as raises: + njit()(inline_func)(False) + self.assertIn( + 'You can resolve this issue by moving the control flow out', + str(raises.exception) + ) + + @skip_unless_py10_or_later + def test_all_args_noninlined_controlflow(self): + """ + Tests generating large args when one of the inputs + has the change suggested in the error message + for inlined control flow. + """ + def inline_func(flag): + a_val = 1 if flag else 2 + return sum_jit_func( + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + a_val, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + ) + + py_func = inline_func + cfunc = njit()(inline_func) + a = py_func(False) + b = cfunc(False) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_large_kws_inline_controlflow(self): + """ + Tests generating large kws when one of the inputs + has inlined controlflow. + """ + def inline_func(flag): + return sum_jit_func( + arg0=1, + arg1=1, + arg2=1, + arg3=1, + arg4=1, + arg5=1, + arg6=1, + arg7=1, + arg8=1, + arg9=1, + arg10=1, + arg11=1, + arg12=1, + arg13=1, + arg14=1, + arg15=1 if flag else 2, + ) + + with self.assertRaises(UnsupportedBytecodeError) as raises: + njit()(inline_func)(False) + self.assertIn( + 'You can resolve this issue by moving the control flow out', + str(raises.exception) + ) + + @skip_unless_py10_or_later + def test_large_kws_noninlined_controlflow(self): + """ + Tests generating large kws when one of the inputs + has the change suggested in the error message + for inlined control flow. + """ + def inline_func(flag): + a_val = 1 if flag else 2 + return sum_jit_func( + arg0=1, + arg1=1, + arg2=1, + arg3=1, + arg4=1, + arg5=1, + arg6=1, + arg7=1, + arg8=1, + arg9=1, + arg10=1, + arg11=1, + arg12=1, + arg13=1, + arg14=1, + arg15=a_val, + ) + + py_func = inline_func + cfunc = njit()(inline_func) + a = py_func(False) + b = cfunc(False) + self.assertEqual(a, b) + + +class TestLargeConstDict(TestCase, MemoryLeakMixin): + """ + gh #7894 + + Tests that check a peephole optimization for constant + dictionaries in Python 3.10. The bytecode changes when + number of elements > 15, which splits the constant dictionary + into multiple dictionaries that are joined by a DICT_UPDATE + bytecode instruction. + + This optimization modifies the IR to rejoin dictionaries + and remove the DICT_UPDATE generated code. This then allows + code that depends on literal dictionaries or literal keys + to succeed. + """ + + @skip_unless_py10_or_later + def test_large_heterogeneous_const_dict(self): + """ + Tests that a function with a large heterogeneous constant + dictionary remains a constant. + """ + def const_func(): + # D is a heterogeneous dictionary + # so this code can only compile if + # d is constant. + d = { + "A": 1, + "B": 1, + "C": 1, + "D": 1, + "E": 1, + "F": 1, + "G": 1, + "H": 1, + "I": 1, + "J": 1, + "K": 1, + "L": 1, + "M": 1, + "N": 1, + "O": 1, + "P": 1, + "Q": 1, + "R": 1, + "S": 'a', + } + return d["S"] + + py_func = const_func + cfunc = njit()(const_func) + a = py_func() + b = cfunc() + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_large_heterogeneous_LiteralStrKeyDict_literal_values(self): + """Check the literal values for a LiteralStrKeyDict requiring + optimizations because it is heterogeneous. + """ + + def bar(d): + ... + + @overload(bar) + def ol_bar(d): + a = { + "A": 1, + "B": 1, + "C": 1, + "D": 1, + "E": 1, + "F": 1, + "G": 1, + "H": 1, + "I": 1, + "J": 1, + "K": 1, + "L": 1, + "M": 1, + "N": 1, + "O": 1, + "P": 1, + "Q": 1, + "R": 1, + "S": 'a', + } + + def specific_ty(z): + return types.literal(z) if types.maybe_literal(z) else typeof(z) + expected = {types.literal(x): specific_ty(y) for x, y in a.items()} + self.assertTrue(isinstance(d, types.LiteralStrKeyDict)) + self.assertEqual(d.literal_value, expected) + self.assertEqual(hasattr(d, 'initial_value'), False) + return lambda d: d + + @njit + def foo(): + # D is a heterogeneous dictionary + # so this code can only compile if + # d has the correct literal values. + d = { + "A": 1, + "B": 1, + "C": 1, + "D": 1, + "E": 1, + "F": 1, + "G": 1, + "H": 1, + "I": 1, + "J": 1, + "K": 1, + "L": 1, + "M": 1, + "N": 1, + "O": 1, + "P": 1, + "Q": 1, + "R": 1, + "S": 'a', + } + bar(d) + + foo() + + @skip_unless_py10_or_later + def test_large_heterogeneous_const_keys_dict(self): + """ + Tests that a function with a large heterogeneous constant + dictionary remains a constant. + """ + def const_keys_func(a): + # D is a heterogeneous dictionary + # so this code can only compile if + # d has constant keys. + d = { + "A": 1, + "B": 1, + "C": 1, + "D": 1, + "E": 1, + "F": 1, + "G": 1, + "H": 1, + "I": 1, + "J": 1, + "K": 1, + "L": 1, + "M": 1, + "N": 1, + "O": 1, + "P": 1, + "Q": 1, + "R": 1, + "S": a, + } + return d["S"] + + py_func = const_keys_func + cfunc = njit()(const_keys_func) + # str to make the dictionary heterogeneous. + value = "a_string" + a = py_func(value) + b = cfunc(value) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_large_dict_mutation_not_carried(self): + """Checks that the optimization for large dictionaries + do not incorrectly update initial values due to other + mutations. + """ + def bar(d): + ... + + @overload(bar) + def ol_bar(d): + a = { + "A": 1, + "B": 1, + "C": 1, + "D": 1, + "E": 1, + "F": 1, + "G": 1, + "H": 1, + "I": 1, + "J": 1, + "K": 1, + "L": 1, + "M": 1, + "N": 1, + "O": 1, + "P": 1, + "Q": 1, + "R": 1, + "S": 7, + } + if d.initial_value is None: + return lambda d: literally(d) + self.assertTrue(isinstance(d, types.DictType)) + self.assertEqual(d.initial_value, a) + return lambda d: d + + @njit + def foo(): + # This dictionary is mutated, check the initial_value carries + # correctly and is not mutated + d = { + "A": 1, + "B": 1, + "C": 1, + "D": 1, + "E": 1, + "F": 1, + "G": 1, + "H": 1, + "I": 1, + "J": 1, + "K": 1, + "L": 1, + "M": 1, + "N": 1, + "O": 1, + "P": 1, + "Q": 1, + "R": 1, + "S": 7, + } + d['X'] = 4 + bar(d) + + foo() + + @skip_unless_py10_or_later + def test_usercode_update_use_d2(self): + """ + Tests an example using a regular update is + not modified by the optimization. + """ + + def check_before(x): + pass + + def check_after(x): + pass + + checked_before = False + checked_after = False + + @overload(check_before, prefer_literal=True) + def ol_check_before(d): + nonlocal checked_before + # Typing iteration from d1.update(d2) + # may reset the initial values to None, + # so we only check on the first iteration. + if not checked_before: + checked_before = True + a = { + "a": 1, + "b": 2, + "c": 3, + } + self.assertTrue(isinstance(d, types.DictType)) + self.assertEqual(d.initial_value, a) + + return lambda d: None + + @overload(check_after, prefer_literal=True) + def ol_check_after(d): + nonlocal checked_after + # Typing iteration from d1.update(d2) + # may reset the initial values to None, + # so we only check on the first iteration. + if not checked_after: + checked_after = True + self.assertTrue(isinstance(d, types.DictType)) + self.assertTrue(d.initial_value is None) + + return lambda d: None + + def const_dict_func(): + """ + Dictionary update between two constant + dictionaries. This verifies d2 doesn't + get incorrectly removed. + """ + d1 = { + "a": 1, + "b": 2, + "c": 3, + } + d2 = { + "d": 4, + "e": 4 + } + check_before(d1) + d1.update(d2) + check_after(d1) + # Create a use of d2 in a new block. + if len(d1) > 4: + return d2 + return d1 + + py_func = const_dict_func + cfunc = njit()(const_dict_func) + a = py_func() + b = cfunc() + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_large_const_dict_inline_controlflow(self): + """ + Tests generating a large dictionary when one of + the inputs requires inline control flow + has the change suggested in the error message + for inlined control flow. + """ + def inline_func(a, flag): + # D is a heterogeneous dictionary + # so this code can only compile if + # d has constant keys. + d = { + "A": 1, + "B": 1, + "C": 1, + "D": 1, + "E": 1, + "F": 1, + "G": 1, + "H": 1 if flag else 2, + "I": 1, + "J": 1, + "K": 1, + "L": 1, + "M": 1, + "N": 1, + "O": 1, + "P": 1, + "Q": 1, + "R": 1, + "S": a, + } + return d["S"] + + with self.assertRaises(UnsupportedBytecodeError) as raises: + njit()(inline_func)("a_string", False) + self.assertIn( + 'You can resolve this issue by moving the control flow out', + str(raises.exception) + ) + + @skip_unless_py10_or_later + def test_large_const_dict_noninline_controlflow(self): + """ + Tests generating large constant dict when one of the + inputs has the change suggested in the error message + for inlined control flow. + """ + def non_inline_func(a, flag): + # D is a heterogeneous dictionary + # so this code can only compile if + # d has constant keys. + val = 1 if flag else 2 + d = { + "A": 1, + "B": 1, + "C": 1, + "D": 1, + "E": 1, + "F": 1, + "G": 1, + "H": val, + "I": 1, + "J": 1, + "K": 1, + "L": 1, + "M": 1, + "N": 1, + "O": 1, + "P": 1, + "Q": 1, + "R": 1, + "S": a, + } + return d["S"] + + py_func = non_inline_func + cfunc = njit()(non_inline_func) + value = "a_string" + a = py_func(value, False) + b = cfunc(value, False) + self.assertEqual(a, b) + + @skip_unless_py10_or_later + def test_fuse_twice_literal_values(self): + """ + Tests that the correct literal values are generated + for a dictionary that produces two DICT_UPDATE + bytecode entries for the same dictionary. + """ + def bar(d): + ... + + @overload(bar) + def ol_bar(d): + a = { + "a1" : 1, + "a2" : 2, + "a3" : 3, + "a4" : 4, + "a5" : 5, + "a6" : 6, + "a7" : 7, + "a8" : 8, + "a9" : 9, + "a10" : 10, + "a11" : 11, + "a12" : 12, + "a13" : 13, + "a14" : 14, + "a15" : 15, + "a16" : 16, + "a17" : 17, + "a18" : 18, + "a19" : 19, + "a20" : 20, + "a21" : 21, + "a22" : 22, + "a23" : 23, + "a24" : 24, + "a25" : 25, + "a26" : 26, + "a27" : 27, + "a28" : 28, + "a29" : 29, + "a30" : 30, + "a31" : 31, + "a32" : 32, + "a33" : 33, + "a34" : 34, # 34 items is the limit of + # (LOAD_CONST + MAP_ADD)^n + DICT_UPDATE + "a35" : 35, # 35 Generates an additional BUILD_MAP + DICT_UPDATE + } + if d.initial_value is None: + return lambda d: literally(d) + self.assertTrue(isinstance(d, types.DictType)) + self.assertEqual(d.initial_value, a) + return lambda d: d + + @njit + def foo(): + # This dictionary is mutated, check the initial_value carries + # correctly and is not mutated + d = { + "a1" : 1, + "a2" : 2, + "a3" : 3, + "a4" : 4, + "a5" : 5, + "a6" : 6, + "a7" : 7, + "a8" : 8, + "a9" : 9, + "a10" : 10, + "a11" : 11, + "a12" : 12, + "a13" : 13, + "a14" : 14, + "a15" : 15, + "a16" : 16, + "a17" : 17, + "a18" : 18, + "a19" : 19, + "a20" : 20, + "a21" : 21, + "a22" : 22, + "a23" : 23, + "a24" : 24, + "a25" : 25, + "a26" : 26, + "a27" : 27, + "a28" : 28, + "a29" : 29, + "a30" : 30, + "a31" : 31, + "a32" : 32, + "a33" : 33, + "a34" : 34, # 34 items is the limit of + # (LOAD_CONST + MAP_ADD)^n + DICT_UPDATE + "a35" : 35, # 35 Generates an additional BUILD_MAP + DICT_UPDATE + } + bar(d) + + foo() + + +class TestListExtendInStarArgNonTupleIterable(MemoryLeakMixin, TestCase): + """Test `fn(pos_arg0, pos_arg1, *args)` where args is a non-tuple iterable. + + Python 3.9+ will generate LIST_EXTEND bytecode to combine the positional + arguments with the `*args`. + + See #8059 + + NOTE: At the moment, there are no meaningful tests for NoPython because the + lack of support for `tuple(iterable)` for most iterable types. + """ + def test_list_extend_forceobj(self): + def consumer(*x): + return x + + @jit(forceobj=True) + def foo(x): + return consumer(1, 2, *x) + + got = foo("ijo") + expect = foo.py_func("ijo") + self.assertEqual(got, (1, 2, "i", "j", "o")) + self.assertEqual(got, expect) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_interproc.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_interproc.py new file mode 100644 index 0000000000000000000000000000000000000000..56265dfbe4c7a7bad85ed863fdef7315121b4a07 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_interproc.py @@ -0,0 +1,47 @@ +import gc + +from numba import jit, int32 +import unittest + + +def foo(a, b): + return a + b + + +def bar(a, b): + return cfoo(a, b) + b + +@jit +def inner(x, y): + return x + y + +@jit(nopython=True) +def outer(x, y): + return inner(x, y) + + +class TestInterProc(unittest.TestCase): + + def test_bar_call_foo(self): + global cfoo + cfoo = jit((int32, int32), nopython=True)(foo) + cbar = jit((int32, int32), nopython=True)(bar) + self.assertEqual(cbar(1, 2), 1 + 2 + 2) + + def test_bar_call_foo_compiled_twice(self): + # When a function is compiled twice, then called from another + # compiled function, check that the right target is called. + # (otherwise, LLVM would assert out or crash) + global cfoo + for i in range(2): + cfoo = jit((int32, int32), nopython=True)(foo) + gc.collect() + cbar = jit((int32, int32), nopython=True)(bar) + self.assertEqual(cbar(1, 2), 1 + 2 + 2) + + def test_callsite_compilation(self): + self.assertEqual(outer(1, 2), 1 + 2) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_intwidth.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_intwidth.py new file mode 100644 index 0000000000000000000000000000000000000000..76c0effebf14364f0001db6736da2b68766f0dfe --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_intwidth.py @@ -0,0 +1,90 @@ +import unittest + +import math +import sys + +from numba import jit +from numba.core import utils +from numba.tests.support import TestCase, tag + + +max_uint64 = 18446744073709551615 + +def usecase_uint64_global(): + return max_uint64 + +def usecase_uint64_constant(): + return 18446744073709551615 + +def usecase_uint64_func(): + return max(18446744073709551614, 18446744073709551615) + +def usecase_int64_pos(): + return 9223372036854775807 + +def usecase_int64_neg(): + return -9223372036854775808 + +def usecase_int64_func(): + return (max(9223372036854775807, -9223372036854775808) + + min(9223372036854775807, -9223372036854775808)) + + +class IntWidthTest(TestCase): + + def check_nullary_func(self, pyfunc, **kwargs): + cfunc = jit(**kwargs)(pyfunc) + self.assertPreciseEqual(cfunc(), pyfunc()) + + def test_global_uint64(self, nopython=False): + pyfunc = usecase_uint64_global + self.check_nullary_func(pyfunc, nopython=nopython) + + def test_global_uint64_npm(self): + self.test_global_uint64(nopython=True) + + def test_constant_uint64(self, nopython=False): + pyfunc = usecase_uint64_constant + self.check_nullary_func(pyfunc, nopython=nopython) + + def test_constant_uint64_npm(self): + self.test_constant_uint64(nopython=True) + + def test_constant_uint64_function_call(self, nopython=False): + pyfunc = usecase_uint64_func + self.check_nullary_func(pyfunc, nopython=nopython) + + def test_constant_uint64_function_call_npm(self): + self.test_constant_uint64_function_call(nopython=True) + + def test_bit_length(self): + f = utils.bit_length + self.assertEqual(f(0x7f), 7) + self.assertEqual(f(-0x7f), 7) + self.assertEqual(f(0x80), 8) + self.assertEqual(f(-0x80), 7) + self.assertEqual(f(0xff), 8) + self.assertEqual(f(-0xff), 8) + self.assertEqual(f(0x100), 9) + self.assertEqual(f(-0x100), 8) + self.assertEqual(f(-0x101), 9) + self.assertEqual(f(0x7fffffff), 31) + self.assertEqual(f(-0x7fffffff), 31) + self.assertEqual(f(-0x80000000), 31) + self.assertEqual(f(0x80000000), 32) + self.assertEqual(f(0xffffffff), 32) + self.assertEqual(f(0xffffffffffffffff), 64) + self.assertEqual(f(0x10000000000000000), 65) + + def test_constant_int64(self, nopython=False): + self.check_nullary_func(usecase_int64_pos, nopython=nopython) + self.check_nullary_func(usecase_int64_neg, nopython=nopython) + self.check_nullary_func(usecase_int64_func, nopython=nopython) + + def test_constant_int64_npm(self): + self.test_constant_int64(nopython=True) + + +if __name__ == '__main__': + unittest.main() + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ir.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ir.py new file mode 100644 index 0000000000000000000000000000000000000000..819c784694df5f7d1747cad1c0558264d32ffb31 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ir.py @@ -0,0 +1,560 @@ +import unittest +from unittest.case import TestCase +import warnings +import numpy as np + +from numba import objmode +from numba.core import ir, compiler +from numba.core import errors +from numba.core.compiler import ( + CompilerBase, + ReconstructSSA, +) +from numba.core.compiler_machinery import ( + FunctionPass, + PassManager, + register_pass, +) +from numba.core.untyped_passes import ( + TranslateByteCode, + IRProcessing, +) +from numba import njit + + +class TestIR(unittest.TestCase): + + def test_IRScope(self): + filename = "" + top = ir.Scope(parent=None, loc=ir.Loc(filename=filename, line=1)) + local = ir.Scope(parent=top, loc=ir.Loc(filename=filename, line=2)) + + apple = local.define('apple', loc=ir.Loc(filename=filename, line=3)) + self.assertIs(local.get('apple'), apple) + self.assertEqual(len(local.localvars), 1) + + orange = top.define('orange', loc=ir.Loc(filename=filename, line=4)) + self.assertEqual(len(local.localvars), 1) + self.assertEqual(len(top.localvars), 1) + self.assertIs(top.get('orange'), orange) + self.assertIs(local.get('orange'), orange) + + more_orange = local.define('orange', loc=ir.Loc(filename=filename, + line=5)) + self.assertIs(top.get('orange'), orange) + self.assertIsNot(local.get('orange'), not orange) + self.assertIs(local.get('orange'), more_orange) + + try: + local.define('orange', loc=ir.Loc(filename=filename, line=5)) + except ir.RedefinedError: + pass + else: + self.fail("Expecting an %s" % ir.RedefinedError) + + +class CheckEquality(unittest.TestCase): + + var_a = ir.Var(None, 'a', ir.unknown_loc) + var_b = ir.Var(None, 'b', ir.unknown_loc) + var_c = ir.Var(None, 'c', ir.unknown_loc) + var_d = ir.Var(None, 'd', ir.unknown_loc) + var_e = ir.Var(None, 'e', ir.unknown_loc) + loc1 = ir.Loc('mock', 1, 0) + loc2 = ir.Loc('mock', 2, 0) + loc3 = ir.Loc('mock', 3, 0) + + def check(self, base, same=[], different=[]): + for s in same: + self.assertTrue(base == s) + for d in different: + self.assertTrue(base != d) + + +class TestIRMeta(CheckEquality): + """ + Tests IR node meta, like Loc and Scope + """ + def test_loc(self): + a = ir.Loc('file', 1, 0) + b = ir.Loc('file', 1, 0) + c = ir.Loc('pile', 1, 0) + d = ir.Loc('file', 2, 0) + e = ir.Loc('file', 1, 1) + self.check(a, same=[b,], different=[c, d, e]) + + f = ir.Loc('file', 1, 0, maybe_decorator=False) + g = ir.Loc('file', 1, 0, maybe_decorator=True) + self.check(a, same=[f, g]) + + def test_scope(self): + parent1 = ir.Scope(None, self.loc1) + parent2 = ir.Scope(None, self.loc1) + parent3 = ir.Scope(None, self.loc2) + self.check(parent1, same=[parent2, parent3,]) + + a = ir.Scope(parent1, self.loc1) + b = ir.Scope(parent1, self.loc1) + c = ir.Scope(parent1, self.loc2) + d = ir.Scope(parent3, self.loc1) + self.check(a, same=[b, c, d]) + + # parent1 and parent2 are equal, so children referring to either parent + # should be equal + e = ir.Scope(parent2, self.loc1) + self.check(a, same=[e,]) + + +class TestIRNodes(CheckEquality): + """ + Tests IR nodes + """ + def test_terminator(self): + # terminator base class inst should always be equal + t1 = ir.Terminator() + t2 = ir.Terminator() + self.check(t1, same=[t2]) + + def test_jump(self): + a = ir.Jump(1, self.loc1) + b = ir.Jump(1, self.loc1) + c = ir.Jump(1, self.loc2) + d = ir.Jump(2, self.loc1) + self.check(a, same=[b, c], different=[d]) + + def test_return(self): + a = ir.Return(self.var_a, self.loc1) + b = ir.Return(self.var_a, self.loc1) + c = ir.Return(self.var_a, self.loc2) + d = ir.Return(self.var_b, self.loc1) + self.check(a, same=[b, c], different=[d]) + + def test_raise(self): + a = ir.Raise(self.var_a, self.loc1) + b = ir.Raise(self.var_a, self.loc1) + c = ir.Raise(self.var_a, self.loc2) + d = ir.Raise(self.var_b, self.loc1) + self.check(a, same=[b, c], different=[d]) + + def test_staticraise(self): + a = ir.StaticRaise(AssertionError, None, self.loc1) + b = ir.StaticRaise(AssertionError, None, self.loc1) + c = ir.StaticRaise(AssertionError, None, self.loc2) + e = ir.StaticRaise(AssertionError, ("str",), self.loc1) + d = ir.StaticRaise(RuntimeError, None, self.loc1) + self.check(a, same=[b, c], different=[d, e]) + + def test_branch(self): + a = ir.Branch(self.var_a, 1, 2, self.loc1) + b = ir.Branch(self.var_a, 1, 2, self.loc1) + c = ir.Branch(self.var_a, 1, 2, self.loc2) + d = ir.Branch(self.var_b, 1, 2, self.loc1) + e = ir.Branch(self.var_a, 2, 2, self.loc1) + f = ir.Branch(self.var_a, 1, 3, self.loc1) + self.check(a, same=[b, c], different=[d, e, f]) + + def test_expr(self): + a = ir.Expr('some_op', self.loc1) + b = ir.Expr('some_op', self.loc1) + c = ir.Expr('some_op', self.loc2) + d = ir.Expr('some_other_op', self.loc1) + self.check(a, same=[b, c], different=[d]) + + def test_setitem(self): + a = ir.SetItem(self.var_a, self.var_b, self.var_c, self.loc1) + b = ir.SetItem(self.var_a, self.var_b, self.var_c, self.loc1) + c = ir.SetItem(self.var_a, self.var_b, self.var_c, self.loc2) + d = ir.SetItem(self.var_d, self.var_b, self.var_c, self.loc1) + e = ir.SetItem(self.var_a, self.var_d, self.var_c, self.loc1) + f = ir.SetItem(self.var_a, self.var_b, self.var_d, self.loc1) + self.check(a, same=[b, c], different=[d, e, f]) + + def test_staticsetitem(self): + a = ir.StaticSetItem(self.var_a, 1, self.var_b, self.var_c, self.loc1) + b = ir.StaticSetItem(self.var_a, 1, self.var_b, self.var_c, self.loc1) + c = ir.StaticSetItem(self.var_a, 1, self.var_b, self.var_c, self.loc2) + d = ir.StaticSetItem(self.var_d, 1, self.var_b, self.var_c, self.loc1) + e = ir.StaticSetItem(self.var_a, 2, self.var_b, self.var_c, self.loc1) + f = ir.StaticSetItem(self.var_a, 1, self.var_d, self.var_c, self.loc1) + g = ir.StaticSetItem(self.var_a, 1, self.var_b, self.var_d, self.loc1) + self.check(a, same=[b, c], different=[d, e, f, g]) + + def test_delitem(self): + a = ir.DelItem(self.var_a, self.var_b, self.loc1) + b = ir.DelItem(self.var_a, self.var_b, self.loc1) + c = ir.DelItem(self.var_a, self.var_b, self.loc2) + d = ir.DelItem(self.var_c, self.var_b, self.loc1) + e = ir.DelItem(self.var_a, self.var_c, self.loc1) + self.check(a, same=[b, c], different=[d, e]) + + def test_del(self): + a = ir.Del(self.var_a.name, self.loc1) + b = ir.Del(self.var_a.name, self.loc1) + c = ir.Del(self.var_a.name, self.loc2) + d = ir.Del(self.var_b.name, self.loc1) + self.check(a, same=[b, c], different=[d]) + + def test_setattr(self): + a = ir.SetAttr(self.var_a, 'foo', self.var_b, self.loc1) + b = ir.SetAttr(self.var_a, 'foo', self.var_b, self.loc1) + c = ir.SetAttr(self.var_a, 'foo', self.var_b, self.loc2) + d = ir.SetAttr(self.var_c, 'foo', self.var_b, self.loc1) + e = ir.SetAttr(self.var_a, 'bar', self.var_b, self.loc1) + f = ir.SetAttr(self.var_a, 'foo', self.var_c, self.loc1) + self.check(a, same=[b, c], different=[d, e, f]) + + def test_delattr(self): + a = ir.DelAttr(self.var_a, 'foo', self.loc1) + b = ir.DelAttr(self.var_a, 'foo', self.loc1) + c = ir.DelAttr(self.var_a, 'foo', self.loc2) + d = ir.DelAttr(self.var_c, 'foo', self.loc1) + e = ir.DelAttr(self.var_a, 'bar', self.loc1) + self.check(a, same=[b, c], different=[d, e]) + + def test_assign(self): + a = ir.Assign(self.var_a, self.var_b, self.loc1) + b = ir.Assign(self.var_a, self.var_b, self.loc1) + c = ir.Assign(self.var_a, self.var_b, self.loc2) + d = ir.Assign(self.var_c, self.var_b, self.loc1) + e = ir.Assign(self.var_a, self.var_c, self.loc1) + self.check(a, same=[b, c], different=[d, e]) + + def test_print(self): + a = ir.Print((self.var_a,), self.var_b, self.loc1) + b = ir.Print((self.var_a,), self.var_b, self.loc1) + c = ir.Print((self.var_a,), self.var_b, self.loc2) + d = ir.Print((self.var_c,), self.var_b, self.loc1) + e = ir.Print((self.var_a,), self.var_c, self.loc1) + self.check(a, same=[b, c], different=[d, e]) + + def test_storemap(self): + a = ir.StoreMap(self.var_a, self.var_b, self.var_c, self.loc1) + b = ir.StoreMap(self.var_a, self.var_b, self.var_c, self.loc1) + c = ir.StoreMap(self.var_a, self.var_b, self.var_c, self.loc2) + d = ir.StoreMap(self.var_d, self.var_b, self.var_c, self.loc1) + e = ir.StoreMap(self.var_a, self.var_d, self.var_c, self.loc1) + f = ir.StoreMap(self.var_a, self.var_b, self.var_d, self.loc1) + self.check(a, same=[b, c], different=[d, e, f]) + + def test_yield(self): + a = ir.Yield(self.var_a, self.loc1, 0) + b = ir.Yield(self.var_a, self.loc1, 0) + c = ir.Yield(self.var_a, self.loc2, 0) + d = ir.Yield(self.var_b, self.loc1, 0) + e = ir.Yield(self.var_a, self.loc1, 1) + self.check(a, same=[b, c], different=[d, e]) + + def test_enterwith(self): + a = ir.EnterWith(self.var_a, 0, 1, self.loc1) + b = ir.EnterWith(self.var_a, 0, 1, self.loc1) + c = ir.EnterWith(self.var_a, 0, 1, self.loc2) + d = ir.EnterWith(self.var_b, 0, 1, self.loc1) + e = ir.EnterWith(self.var_a, 1, 1, self.loc1) + f = ir.EnterWith(self.var_a, 0, 2, self.loc1) + self.check(a, same=[b, c], different=[d, e, f]) + + def test_arg(self): + a = ir.Arg('foo', 0, self.loc1) + b = ir.Arg('foo', 0, self.loc1) + c = ir.Arg('foo', 0, self.loc2) + d = ir.Arg('bar', 0, self.loc1) + e = ir.Arg('foo', 1, self.loc1) + self.check(a, same=[b, c], different=[d, e]) + + def test_const(self): + a = ir.Const(1, self.loc1) + b = ir.Const(1, self.loc1) + c = ir.Const(1, self.loc2) + d = ir.Const(2, self.loc1) + self.check(a, same=[b, c], different=[d]) + + def test_global(self): + a = ir.Global('foo', 0, self.loc1) + b = ir.Global('foo', 0, self.loc1) + c = ir.Global('foo', 0, self.loc2) + d = ir.Global('bar', 0, self.loc1) + e = ir.Global('foo', 1, self.loc1) + self.check(a, same=[b, c], different=[d, e]) + + def test_var(self): + a = ir.Var(None, 'foo', self.loc1) + b = ir.Var(None, 'foo', self.loc1) + c = ir.Var(None, 'foo', self.loc2) + d = ir.Var(ir.Scope(None, ir.unknown_loc), 'foo', self.loc1) + e = ir.Var(None, 'bar', self.loc1) + self.check(a, same=[b, c, d], different=[e]) + + def test_undefinedtype(self): + a = ir.UndefinedType() + b = ir.UndefinedType() + self.check(a, same=[b]) + + def test_loop(self): + a = ir.Loop(1, 3) + b = ir.Loop(1, 3) + c = ir.Loop(2, 3) + d = ir.Loop(1, 4) + self.check(a, same=[b], different=[c, d]) + + def test_with(self): + a = ir.With(1, 3) + b = ir.With(1, 3) + c = ir.With(2, 3) + d = ir.With(1, 4) + self.check(a, same=[b], different=[c, d]) + + +# used later +_GLOBAL = 1234 + + +class TestIRCompounds(CheckEquality): + """ + Tests IR concepts that have state + """ + def test_varmap(self): + a = ir.VarMap() + a.define(self.var_a, 'foo') + a.define(self.var_b, 'bar') + + b = ir.VarMap() + b.define(self.var_a, 'foo') + b.define(self.var_b, 'bar') + + c = ir.VarMap() + c.define(self.var_a, 'foo') + c.define(self.var_c, 'bar') + + self.check(a, same=[b], different=[c]) + + def test_block(self): + def gen_block(): + parent = ir.Scope(None, self.loc1) + tmp = ir.Block(parent, self.loc2) + assign1 = ir.Assign(self.var_a, self.var_b, self.loc3) + assign2 = ir.Assign(self.var_a, self.var_c, self.loc3) + assign3 = ir.Assign(self.var_c, self.var_b, self.loc3) + tmp.append(assign1) + tmp.append(assign2) + tmp.append(assign3) + return tmp + + a = gen_block() + b = gen_block() + c = gen_block().append(ir.Assign(self.var_a, self.var_b, self.loc3)) + + self.check(a, same=[b], different=[c]) + + def test_functionir(self): + + def run_frontend(x): + return compiler.run_frontend(x, emit_dels=True) + + # this creates a function full of all sorts of things to ensure the IR + # is pretty involved, it then compares two instances of the compiled + # function IR to check the IR is the same invariant of objects, and then + # a tiny mutation is made to the IR in the second function and detection + # of this change is checked. + def gen(): + _FREEVAR = 0xCAFE + + def foo(a, b, c=12, d=1j, e=None): + f = a + b + a += _FREEVAR + g = np.zeros(c, dtype=np.complex64) + h = f + g + i = 1j / d + if np.abs(i) > 0: + k = h / i + l = np.arange(1, c + 1) + with objmode(): + print(e, k) + m = np.sqrt(l - g) + if np.abs(m[0]) < 1: + n = 0 + for o in range(a): + n += 0 + if np.abs(n) < 3: + break + n += m[2] + p = g / l + q = [] + for r in range(len(p)): + q.append(p[r]) + if r > 4 + 1: + with objmode(s='intp', t='complex128'): + s = 123 + t = 5 + if s > 122: + t += s + t += q[0] + _GLOBAL + + return f + o + r + t + r + a + n + + return foo + + x = gen() + y = gen() + x_ir = run_frontend(x) + y_ir = run_frontend(y) + + self.assertTrue(x_ir.equal_ir(y_ir)) + + def check_diffstr(string, pointing_at=[]): + lines = string.splitlines() + for item in pointing_at: + for l in lines: + if l.startswith('->'): + if item in l: + break + else: + raise AssertionError("Could not find %s " % item) + + self.assertIn("IR is considered equivalent", x_ir.diff_str(y_ir)) + + # minor mutation, simply switch branch targets on last branch + for label in reversed(list(y_ir.blocks.keys())): + blk = y_ir.blocks[label] + if isinstance(blk.body[-1], ir.Branch): + ref = blk.body[-1] + ref.truebr, ref.falsebr = ref.falsebr, ref.truebr + break + + check_diffstr(x_ir.diff_str(y_ir), ['branch']) + + z = gen() + self.assertFalse(x_ir.equal_ir(y_ir)) + + z_ir = run_frontend(z) + + change_set = set() + for label in reversed(list(z_ir.blocks.keys())): + blk = z_ir.blocks[label] + ref = blk.body[:-1] + idx = None + for i in range(len(ref) - 1): + # look for two adjacent Del + if (isinstance(ref[i], ir.Del) and + isinstance(ref[i + 1], ir.Del)): + idx = i + break + if idx is not None: + b = blk.body + change_set.add(str(b[idx + 1])) + change_set.add(str(b[idx])) + b[idx], b[idx + 1] = b[idx + 1], b[idx] + break + + # ensure that a mutation occurred. + self.assertTrue(change_set) + + self.assertFalse(x_ir.equal_ir(z_ir)) + self.assertEqual(len(change_set), 2) + for item in change_set: + self.assertTrue(item.startswith('del ')) + check_diffstr(x_ir.diff_str(z_ir), change_set) + + def foo(a, b): + c = a * 2 + d = c + b + e = np.sqrt(d) + return e + + def bar(a, b): # same as foo + c = a * 2 + d = c + b + e = np.sqrt(d) + return e + + def baz(a, b): + c = a * 2 + d = b + c + e = np.sqrt(d + 1) + return e + + foo_ir = run_frontend(foo) + bar_ir = run_frontend(bar) + self.assertTrue(foo_ir.equal_ir(bar_ir)) + self.assertIn("IR is considered equivalent", foo_ir.diff_str(bar_ir)) + + baz_ir = run_frontend(baz) + self.assertFalse(foo_ir.equal_ir(baz_ir)) + tmp = foo_ir.diff_str(baz_ir) + self.assertIn("Other block contains more statements", tmp) + check_diffstr(tmp, ["c + b", "b + c"]) + + +class TestIRPedanticChecks(TestCase): + def test_var_in_scope_assumption(self): + # Create a pass that clears ir.Scope in ir.Block + @register_pass(mutates_CFG=False, analysis_only=False) + class RemoveVarInScope(FunctionPass): + _name = "_remove_var_in_scope" + + def __init__(self): + FunctionPass.__init__(self) + + # implement method to do the work, "state" is the internal compiler + # state from the CompilerBase instance. + def run_pass(self, state): + func_ir = state.func_ir + # walk the blocks + for blk in func_ir.blocks.values(): + oldscope = blk.scope + # put in an empty Scope + blk.scope = ir.Scope(parent=oldscope.parent, + loc=oldscope.loc) + return True + + # Create a pass that always fails, to stop the compiler + @register_pass(mutates_CFG=False, analysis_only=False) + class FailPass(FunctionPass): + _name = "_fail" + + def __init__(self, *args, **kwargs): + FunctionPass.__init__(self) + + def run_pass(self, state): + # This is unreachable. SSA pass should have raised before this + # pass when run with `error.NumbaPedanticWarning`s raised as + # errors. + raise AssertionError("unreachable") + + class MyCompiler(CompilerBase): + def define_pipelines(self): + pm = PassManager("testing pm") + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(IRProcessing, "processing IR") + pm.add_pass(RemoveVarInScope, "_remove_var_in_scope") + pm.add_pass(ReconstructSSA, "ssa") + pm.add_pass(FailPass, "_fail") + pm.finalize() + return [pm] + + @njit(pipeline_class=MyCompiler) + def dummy(x): + # To trigger SSA and the pedantic check, this function must have + # multiple assignments to the same variable in different blocks. + a = 1 + b = 2 + if a < b: + a = 2 + else: + b = 3 + return a, b + + with warnings.catch_warnings(): + # Make NumbaPedanticWarning an error + warnings.simplefilter("error", errors.NumbaPedanticWarning) + # Catch NumbaIRAssumptionWarning + with self.assertRaises(errors.NumbaIRAssumptionWarning) as raises: + dummy(1) + # Verify the error message + self.assertRegex( + str(raises.exception), + r"variable '[a-z]' is not in scope", + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ir_inlining.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ir_inlining.py new file mode 100644 index 0000000000000000000000000000000000000000..40dc4316f8dc9443bd9f9b0a16dce46cc8daaee5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ir_inlining.py @@ -0,0 +1,1524 @@ +""" +This tests the inline kwarg to @jit and @overload etc, it has nothing to do with +LLVM or low level inlining. +""" + +import operator +import warnings +from itertools import product +import numpy as np + +from numba import njit, typeof, literally, prange +from numba.core import types, ir, ir_utils, cgutils, errors, utils +from numba.core.extending import ( + overload, + overload_method, + overload_attribute, + register_model, + models, + make_attribute_wrapper, + intrinsic, + register_jitable, +) +from numba.core.cpu import InlineOptions +from numba.core.compiler import DefaultPassBuilder, CompilerBase +from numba.core.typed_passes import InlineOverloads +from numba.core.typing import signature +from numba.tests.support import (TestCase, unittest, + MemoryLeakMixin, IRPreservingTestPipeline, + skip_parfors_unsupported, + ignore_internal_warnings) + + +# this global has the same name as the global in inlining_usecases.py, it +# is here to check that inlined functions bind to their own globals +_GLOBAL1 = -50 + + +@njit(inline='always') +def _global_func(x): + return x + 1 + + +# to be overloaded +def _global_defn(x): + return x + 1 + + +@overload(_global_defn, inline='always') +def _global_overload(x): + return _global_defn + + +class InliningBase(TestCase): + + _DEBUG = False + + inline_opt_as_bool = {'always': True, 'never': False} + + # -------------------------------------------------------------------------- + # Example cost model + + def sentinel_17_cost_model(self, func_ir): + # sentinel 17 cost model, this is a fake cost model that will return + # True (i.e. inline) if the ir.FreeVar(17) is found in the func_ir, + for blk in func_ir.blocks.values(): + for stmt in blk.body: + if isinstance(stmt, ir.Assign): + if isinstance(stmt.value, ir.FreeVar): + if stmt.value.value == 17: + return True + return False + + # -------------------------------------------------------------------------- + + def check(self, test_impl, *args, **kwargs): + inline_expect = kwargs.pop('inline_expect', None) + assert inline_expect + block_count = kwargs.pop('block_count', 1) + assert not kwargs + for k, v in inline_expect.items(): + assert isinstance(k, str) + assert isinstance(v, bool) + + j_func = njit(pipeline_class=IRPreservingTestPipeline)(test_impl) + + # check they produce the same answer first! + self.assertEqual(test_impl(*args), j_func(*args)) + + # make sure IR doesn't have branches + fir = j_func.overloads[j_func.signatures[0]].metadata['preserved_ir'] + fir.blocks = ir_utils.simplify_CFG(fir.blocks) + if self._DEBUG: + print("FIR".center(80, "-")) + fir.dump() + if block_count != 'SKIP': + self.assertEqual(len(fir.blocks), block_count) + block = next(iter(fir.blocks.values())) + + # if we don't expect the function to be inlined then make sure there is + # 'call' present still + exprs = [x for x in block.find_exprs()] + assert exprs + for k, v in inline_expect.items(): + found = False + for expr in exprs: + if getattr(expr, 'op', False) == 'call': + func_defn = fir.get_definition(expr.func) + found |= func_defn.name == k + elif ir_utils.is_operator_or_getitem(expr): + found |= expr.fn.__name__ == k + self.assertFalse(found == v) + + return fir # for use in further analysis + + +# used in _gen_involved +_GLOBAL = 1234 + + +def _gen_involved(): + _FREEVAR = 0xCAFE + + def foo(a, b, c=12, d=1j, e=None): + f = a + b + a += _FREEVAR + g = np.zeros(c, dtype=np.complex64) + h = f + g + i = 1j / d + # For SSA, zero init, n and t + n = 0 + t = 0 + if np.abs(i) > 0: + k = h / i + l = np.arange(1, c + 1) + m = np.sqrt(l - g) + e * k + if np.abs(m[0]) < 1: + for o in range(a): + n += 0 + if np.abs(n) < 3: + break + n += m[2] + p = g / l + q = [] + for r in range(len(p)): + q.append(p[r]) + if r > 4 + 1: + s = 123 + t = 5 + if s > 122 - c: + t += s + t += q[0] + _GLOBAL + + return f + o + r + t + r + a + n + + return foo + + +class TestFunctionInlining(MemoryLeakMixin, InliningBase): + + def test_basic_inline_never(self): + @njit(inline='never') + def foo(): + return + + def impl(): + return foo() + self.check(impl, inline_expect={'foo': False}) + + def test_basic_inline_always(self): + @njit(inline='always') + def foo(): + return + + def impl(): + return foo() + self.check(impl, inline_expect={'foo': True}) + + def test_basic_inline_combos(self): + + def impl(): + x = foo() + y = bar() + z = baz() + return x, y, z + + opts = (('always'), ('never')) + + for inline_foo, inline_bar, inline_baz in product(opts, opts, opts): + + @njit(inline=inline_foo) + def foo(): + return + + @njit(inline=inline_bar) + def bar(): + return + + @njit(inline=inline_baz) + def baz(): + return + + inline_expect = {'foo': self.inline_opt_as_bool[inline_foo], + 'bar': self.inline_opt_as_bool[inline_bar], + 'baz': self.inline_opt_as_bool[inline_baz]} + self.check(impl, inline_expect=inline_expect) + + @unittest.skip("Need to work out how to prevent this") + def test_recursive_inline(self): + + @njit(inline='always') + def foo(x): + if x == 0: + return 12 + else: + foo(x - 1) + + a = 3 + + def impl(): + b = 0 + if a > 1: + b += 1 + foo(5) + if b < a: + b -= 1 + + self.check(impl, inline_expect={'foo': True}) + + def test_freevar_bindings(self): + + def factory(inline, x, y): + z = x + 12 + + @njit(inline=inline) + def func(): + return (x, y + 3, z) + return func + + def impl(): + x = foo() + y = bar() + z = baz() + return x, y, z + + opts = (('always'), ('never')) + + for inline_foo, inline_bar, inline_baz in product(opts, opts, opts): + + foo = factory(inline_foo, 10, 20) + bar = factory(inline_bar, 30, 40) + baz = factory(inline_baz, 50, 60) + + inline_expect = {'foo': self.inline_opt_as_bool[inline_foo], + 'bar': self.inline_opt_as_bool[inline_bar], + 'baz': self.inline_opt_as_bool[inline_baz]} + self.check(impl, inline_expect=inline_expect) + + def test_global_binding(self): + + def impl(): + x = 19 + return _global_func(x) + + self.check(impl, inline_expect={'_global_func': True}) + + def test_inline_from_another_module(self): + + from .inlining_usecases import bar + + def impl(): + z = _GLOBAL1 + 2 + return bar(), z + + self.check(impl, inline_expect={'bar': True}) + + def test_inline_from_another_module_w_getattr(self): + + import numba.tests.inlining_usecases as iuc + + def impl(): + z = _GLOBAL1 + 2 + return iuc.bar(), z + + self.check(impl, inline_expect={'bar': True}) + + def test_inline_from_another_module_w_2_getattr(self): + + import numba.tests.inlining_usecases # noqa forces registration + import numba.tests as nt + + def impl(): + z = _GLOBAL1 + 2 + return nt.inlining_usecases.bar(), z + + self.check(impl, inline_expect={'bar': True}) + + def test_inline_from_another_module_as_freevar(self): + + def factory(): + from .inlining_usecases import bar + + @njit(inline='always') + def tmp(): + return bar() + return tmp + + baz = factory() + + def impl(): + z = _GLOBAL1 + 2 + return baz(), z + + self.check(impl, inline_expect={'bar': True}) + + def test_inline_w_freevar_from_another_module(self): + + from .inlining_usecases import baz_factory + + def gen(a, b): + bar = baz_factory(a) + + def impl(): + z = _GLOBAL1 + a * b + return bar(), z, a + return impl + + impl = gen(10, 20) + self.check(impl, inline_expect={'bar': True}) + + def test_inlining_models(self): + + def s17_caller_model(expr, caller_info, callee_info): + self.assertIsInstance(expr, ir.Expr) + self.assertEqual(expr.op, "call") + return self.sentinel_17_cost_model(caller_info) + + def s17_callee_model(expr, caller_info, callee_info): + self.assertIsInstance(expr, ir.Expr) + self.assertEqual(expr.op, "call") + return self.sentinel_17_cost_model(callee_info) + + # caller has sentinel + for caller, callee in ((11, 17), (17, 11)): + + @njit(inline=s17_caller_model) + def foo(): + return callee + + def impl(z): + x = z + caller + y = foo() + return y + 3, x + + self.check(impl, 10, inline_expect={'foo': caller == 17}) + + # callee has sentinel + for caller, callee in ((11, 17), (17, 11)): + + @njit(inline=s17_callee_model) + def bar(): + return callee + + def impl(z): + x = z + caller + y = bar() + return y + 3, x + + self.check(impl, 10, inline_expect={'bar': callee == 17}) + + def test_inline_inside_loop(self): + @njit(inline='always') + def foo(): + return 12 + + def impl(): + acc = 0.0 + for i in range(5): + acc += foo() + return acc + + self.check(impl, inline_expect={'foo': True}, block_count=4) + + def test_inline_inside_closure_inside_loop(self): + @njit(inline='always') + def foo(): + return 12 + + def impl(): + acc = 0.0 + for i in range(5): + def bar(): + return foo() + 7 + acc += bar() + return acc + + self.check(impl, inline_expect={'foo': True}, block_count=4) + + def test_inline_closure_inside_inlinable_inside_closure(self): + @njit(inline='always') + def foo(a): + def baz(): + return 12 + a + return baz() + 8 + + def impl(): + z = 9 + + def bar(x): + return foo(z) + 7 + x + return bar(z + 2) + + self.check(impl, inline_expect={'foo': True}, block_count=1) + + def test_inline_involved(self): + + fortran = njit(inline='always')(_gen_involved()) + + @njit(inline='always') + def boz(j): + acc = 0 + + def biz(t): + return t + acc + for x in range(j): + acc += biz(8 + acc) + fortran(2., acc, 1, 12j, biz(acc)) + return acc + + @njit(inline='always') + def foo(a): + acc = 0 + for p in range(12): + tmp = fortran(1, 1, 1, 1, 1) + + def baz(x): + return 12 + a + x + tmp + acc += baz(p) + 8 + boz(p) + tmp + return acc + baz(2) + + def impl(): + z = 9 + + def bar(x): + return foo(z) + 7 + x + return bar(z + 2) + + # block count changes with Python version due to bytecode differences. + if utils.PYVERSION in ((3, 12), (3, 13)): + bc = 39 + elif utils.PYVERSION in ((3, 10), (3, 11)): + bc = 35 + else: + raise NotImplementedError(utils.PYVERSION) + + self.check(impl, inline_expect={'foo': True, 'boz': True, + 'fortran': True}, block_count=bc) + + def test_inline_renaming_scheme(self): + # See #7380, this checks that inlined variables have a name derived from + # the function they were defined in. + + @njit(inline="always") + def bar(z): + x = 5 + y = 10 + return x + y + z + + @njit(pipeline_class=IRPreservingTestPipeline) + def foo(a, b): + return bar(a), bar(b) + + self.assertEqual(foo(10, 20), (25, 35)) + + # check IR. Look for the `x = 5`... there should be + # Two lots of `const(int, 5)`, one for each inline + # The LHS of the assignment will have a name like: + # TestFunctionInlining_test_inline_renaming_scheme__locals__bar_v2.x + # Ensure that this is the case! + func_ir = foo.overloads[foo.signatures[0]].metadata['preserved_ir'] + store = [] + for blk in func_ir.blocks.values(): + for stmt in blk.body: + if isinstance(stmt, ir.Assign): + if isinstance(stmt.value, ir.Const): + if stmt.value.value == 5: + store.append(stmt) + + self.assertEqual(len(store), 2) + for i in store: + name = i.target.name + basename = self.id().lstrip(self.__module__) + regex = rf'{basename}__locals__bar_v[0-9]+.x' + self.assertRegex(name, regex) + + +class TestRegisterJitableInlining(MemoryLeakMixin, InliningBase): + + def test_register_jitable_inlines(self): + + @register_jitable(inline='always') + def foo(): + return 1 + + def impl(): + foo() + + self.check(impl, inline_expect={'foo': True}) + + +class TestOverloadInlining(MemoryLeakMixin, InliningBase): + + def test_basic_inline_never(self): + def foo(): + pass + + @overload(foo, inline='never') + def foo_overload(): + def foo_impl(): + pass + return foo_impl + + def impl(): + return foo() + + self.check(impl, inline_expect={'foo': False}) + + def test_basic_inline_always(self): + + def foo(): + pass + + @overload(foo, inline='always') + def foo_overload(): + def impl(): + pass + return impl + + def impl(): + return foo() + + self.check(impl, inline_expect={'foo': True}) + + def test_inline_always_kw_no_default(self): + # pass call arg by name that doesn't have default value + def foo(a, b): + return a + b + + @overload(foo, inline='always') + def overload_foo(a, b): + return lambda a, b: a + b + + def impl(): + return foo(3, b=4) + + self.check(impl, inline_expect={'foo': True}) + + def test_inline_operators_unary(self): + + def impl_inline(x): + return -x + + def impl_noinline(x): + return +x + + dummy_unary_impl = lambda x: True + Dummy, DummyType = self.make_dummy_type() + setattr(Dummy, '__neg__', dummy_unary_impl) + setattr(Dummy, '__pos__', dummy_unary_impl) + + @overload(operator.neg, inline='always') + def overload_dummy_neg(x): + if isinstance(x, DummyType): + return dummy_unary_impl + + @overload(operator.pos, inline='never') + def overload_dummy_pos(x): + if isinstance(x, DummyType): + return dummy_unary_impl + + self.check(impl_inline, Dummy(), inline_expect={'neg': True}) + self.check(impl_noinline, Dummy(), inline_expect={'pos': False}) + + def test_inline_operators_binop(self): + + def impl_inline(x): + return x == 1 + + def impl_noinline(x): + return x != 1 + + Dummy, DummyType = self.make_dummy_type() + + dummy_binop_impl = lambda a, b: True + setattr(Dummy, '__eq__', dummy_binop_impl) + setattr(Dummy, '__ne__', dummy_binop_impl) + + @overload(operator.eq, inline='always') + def overload_dummy_eq(a, b): + if isinstance(a, DummyType): + return dummy_binop_impl + + @overload(operator.ne, inline='never') + def overload_dummy_ne(a, b): + if isinstance(a, DummyType): + return dummy_binop_impl + + self.check(impl_inline, Dummy(), inline_expect={'eq': True}) + self.check(impl_noinline, Dummy(), inline_expect={'ne': False}) + + def test_inline_operators_inplace_binop(self): + + def impl_inline(x): + x += 1 + + def impl_noinline(x): + x -= 1 + + Dummy, DummyType = self.make_dummy_type() + + dummy_inplace_binop_impl = lambda a, b: True + setattr(Dummy, '__iadd__', dummy_inplace_binop_impl) + setattr(Dummy, '__isub__', dummy_inplace_binop_impl) + + @overload(operator.iadd, inline='always') + def overload_dummy_iadd(a, b): + if isinstance(a, DummyType): + return dummy_inplace_binop_impl + + @overload(operator.isub, inline='never') + def overload_dummy_isub(a, b): + if isinstance(a, DummyType): + return dummy_inplace_binop_impl + + # DummyType is not mutable, so lowering 'inplace_binop' Expr + # re-uses (requires) copying function definition + @overload(operator.add, inline='always') + def overload_dummy_add(a, b): + if isinstance(a, DummyType): + return dummy_inplace_binop_impl + + @overload(operator.sub, inline='never') + def overload_dummy_sub(a, b): + if isinstance(a, DummyType): + return dummy_inplace_binop_impl + + self.check(impl_inline, Dummy(), inline_expect={'iadd': True}) + self.check(impl_noinline, Dummy(), inline_expect={'isub': False}) + + def test_inline_always_operators_getitem(self): + + def impl(x, idx): + return x[idx] + + def impl_static_getitem(x): + return x[1] + + Dummy, DummyType = self.make_dummy_type() + + dummy_getitem_impl = lambda obj, idx: None + setattr(Dummy, '__getitem__', dummy_getitem_impl) + + @overload(operator.getitem, inline='always') + def overload_dummy_getitem(obj, idx): + if isinstance(obj, DummyType): + return dummy_getitem_impl + + # note getitem and static_getitem Exprs refer to operator.getitem + # hence they are checked using the same expected key + self.check(impl, Dummy(), 1, inline_expect={'getitem': True}) + self.check(impl_static_getitem, Dummy(), + inline_expect={'getitem': True}) + + def test_inline_never_operators_getitem(self): + + def impl(x, idx): + return x[idx] + + def impl_static_getitem(x): + return x[1] + + Dummy, DummyType = self.make_dummy_type() + + dummy_getitem_impl = lambda obj, idx: None + setattr(Dummy, '__getitem__', dummy_getitem_impl) + + @overload(operator.getitem, inline='never') + def overload_dummy_getitem(obj, idx): + if isinstance(obj, DummyType): + return dummy_getitem_impl + + # both getitem and static_getitem Exprs refer to operator.getitem + # hence they are checked using the same expect key + self.check(impl, Dummy(), 1, inline_expect={'getitem': False}) + self.check(impl_static_getitem, Dummy(), + inline_expect={'getitem': False}) + + def test_inline_stararg_error(self): + def foo(a, *b): + return a + b[0] + + @overload(foo, inline='always') + def overload_foo(a, *b): + return lambda a, *b: a + b[0] + + def impl(): + return foo(3, 3, 5) + + with self.assertRaises(NotImplementedError) as e: + self.check(impl, inline_expect={'foo': True}) + + self.assertIn("Stararg not supported in inliner for arg 1 *b", + str(e.exception)) + + def test_basic_inline_combos(self): + + def impl(): + x = foo() + y = bar() + z = baz() + return x, y, z + + opts = (('always'), ('never')) + + for inline_foo, inline_bar, inline_baz in product(opts, opts, opts): + + def foo(): + pass + + def bar(): + pass + + def baz(): + pass + + @overload(foo, inline=inline_foo) + def foo_overload(): + def impl(): + return + return impl + + @overload(bar, inline=inline_bar) + def bar_overload(): + def impl(): + return + return impl + + @overload(baz, inline=inline_baz) + def baz_overload(): + def impl(): + return + return impl + + inline_expect = {'foo': self.inline_opt_as_bool[inline_foo], + 'bar': self.inline_opt_as_bool[inline_bar], + 'baz': self.inline_opt_as_bool[inline_baz]} + self.check(impl, inline_expect=inline_expect) + + def test_freevar_bindings(self): + + def impl(): + x = foo() + y = bar() + z = baz() + return x, y, z + + opts = (('always'), ('never')) + + for inline_foo, inline_bar, inline_baz in product(opts, opts, opts): + # need to repeatedly clobber definitions of foo, bar, baz so + # @overload binds to the right instance WRT inlining + + def foo(): + x = 10 + y = 20 + z = x + 12 + return (x, y + 3, z) + + def bar(): + x = 30 + y = 40 + z = x + 12 + return (x, y + 3, z) + + def baz(): + x = 60 + y = 80 + z = x + 12 + return (x, y + 3, z) + + def factory(target, x, y, inline=None): + z = x + 12 + + @overload(target, inline=inline) + def func(): + def impl(): + return (x, y + 3, z) + return impl + + factory(foo, 10, 20, inline=inline_foo) + factory(bar, 30, 40, inline=inline_bar) + factory(baz, 60, 80, inline=inline_baz) + + inline_expect = {'foo': self.inline_opt_as_bool[inline_foo], + 'bar': self.inline_opt_as_bool[inline_bar], + 'baz': self.inline_opt_as_bool[inline_baz]} + + self.check(impl, inline_expect=inline_expect) + + def test_global_overload_binding(self): + + def impl(): + z = 19 + return _global_defn(z) + + self.check(impl, inline_expect={'_global_defn': True}) + + def test_inline_from_another_module(self): + + from .inlining_usecases import baz + + def impl(): + z = _GLOBAL1 + 2 + return baz(), z + + self.check(impl, inline_expect={'baz': True}) + + def test_inline_from_another_module_w_getattr(self): + + import numba.tests.inlining_usecases as iuc + + def impl(): + z = _GLOBAL1 + 2 + return iuc.baz(), z + + self.check(impl, inline_expect={'baz': True}) + + def test_inline_from_another_module_w_2_getattr(self): + + import numba.tests.inlining_usecases # noqa forces registration + import numba.tests as nt + + def impl(): + z = _GLOBAL1 + 2 + return nt.inlining_usecases.baz(), z + + self.check(impl, inline_expect={'baz': True}) + + def test_inline_from_another_module_as_freevar(self): + + def factory(): + from .inlining_usecases import baz + + @njit(inline='always') + def tmp(): + return baz() + return tmp + + bop = factory() + + def impl(): + z = _GLOBAL1 + 2 + return bop(), z + + self.check(impl, inline_expect={'baz': True}) + + def test_inline_w_freevar_from_another_module(self): + + from .inlining_usecases import bop_factory + + def gen(a, b): + bar = bop_factory(a) + + def impl(): + z = _GLOBAL1 + a * b + return bar(), z, a + return impl + + impl = gen(10, 20) + self.check(impl, inline_expect={'bar': True}) + + def test_inlining_models(self): + + def s17_caller_model(expr, caller_info, callee_info): + self.assertIsInstance(expr, ir.Expr) + self.assertEqual(expr.op, "call") + return self.sentinel_17_cost_model(caller_info.func_ir) + + def s17_callee_model(expr, caller_info, callee_info): + self.assertIsInstance(expr, ir.Expr) + self.assertEqual(expr.op, "call") + return self.sentinel_17_cost_model(callee_info.func_ir) + + # caller has sentinel + for caller, callee in ((10, 11), (17, 11)): + + def foo(): + return callee + + @overload(foo, inline=s17_caller_model) + def foo_ol(): + def impl(): + return callee + return impl + + def impl(z): + x = z + caller + y = foo() + return y + 3, x + + self.check(impl, 10, inline_expect={'foo': caller == 17}) + + # callee has sentinel + for caller, callee in ((11, 17), (11, 10)): + + def bar(): + return callee + + @overload(bar, inline=s17_callee_model) + def bar_ol(): + def impl(): + return callee + return impl + + def impl(z): + x = z + caller + y = bar() + return y + 3, x + + self.check(impl, 10, inline_expect={'bar': callee == 17}) + + def test_multiple_overloads_with_different_inline_characteristics(self): + # check that having different inlining options for different overloads + # of the same function works ok + + # this is the Python equiv of the overloads below + def bar(x): + if isinstance(typeof(x), types.Float): + return x + 1234 + else: + return x + 1 + + @overload(bar, inline='always') + def bar_int_ol(x): + if isinstance(x, types.Integer): + def impl(x): + return x + 1 + return impl + + @overload(bar, inline='never') + def bar_float_ol(x): + if isinstance(x, types.Float): + def impl(x): + return x + 1234 + return impl + + def always_inline_cost_model(*args): + return True + + @overload(bar, inline=always_inline_cost_model) + def bar_complex_ol(x): + if isinstance(x, types.Complex): + def impl(x): + return x + 1 + return impl + + def impl(): + a = bar(1) # integer literal, should inline + b = bar(2.3) # float literal, should not inline + # complex literal, should inline by virtue of cost model + c = bar(3j) + return a + b + c + + # there should still be a `bar` not inlined + fir = self.check(impl, inline_expect={'bar': False}, block_count=1) + + # check there is one call left in the IR + block = next(iter(fir.blocks.items()))[1] + calls = [x for x in block.find_exprs(op='call')] + self.assertTrue(len(calls) == 1) + + # check that the constant "1234" is not in the IR + consts = [x.value for x in block.find_insts(ir.Assign) + if isinstance(getattr(x, 'value', None), ir.Const)] + for val in consts: + self.assertNotEqual(val.value, 1234) + + def test_overload_inline_always_with_literally_in_inlinee(self): + # See issue #5887 + + def foo_ovld(dtype): + + if not isinstance(dtype, types.StringLiteral): + def foo_noop(dtype): + return literally(dtype) + return foo_noop + + if dtype.literal_value == 'str': + def foo_as_str_impl(dtype): + return 10 + return foo_as_str_impl + + if dtype.literal_value in ('int64', 'float64'): + def foo_as_num_impl(dtype): + return 20 + return foo_as_num_impl + + # define foo for literal str 'str' + def foo(dtype): + return 10 + + overload(foo, inline='always')(foo_ovld) + + def test_impl(dtype): + return foo(dtype) + + # check literal dispatch on 'str' + dtype = 'str' + self.check(test_impl, dtype, inline_expect={'foo': True}) + + # redefine foo to be correct for literal str 'int64' + def foo(dtype): + return 20 + overload(foo, inline='always')(foo_ovld) + + # check literal dispatch on 'int64' + dtype = 'int64' + self.check(test_impl, dtype, inline_expect={'foo': True}) + + def test_inline_always_ssa(self): + # Make sure IR inlining uses SSA properly. Test for #6721. + + dummy_true = True + + def foo(A): + return True + + @overload(foo, inline="always") + def foo_overload(A): + + def impl(A): + s = dummy_true + for i in range(len(A)): + dummy = dummy_true + if A[i]: + dummy = A[i] + s *= dummy + return s + return impl + + def impl(): + return foo(np.array([True, False, True])) + + self.check(impl, block_count='SKIP', inline_expect={'foo': True}) + + def test_inline_always_ssa_scope_validity(self): + # Make sure IR inlining correctly updates the scope(s). See #7802 + + def bar(): + b = 5 + while b > 1: + b //= 2 + + return 10 + + @overload(bar, inline="always") + def bar_impl(): + return bar + + @njit + def foo(): + bar() + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', errors.NumbaIRAssumptionWarning) + ignore_internal_warnings() + self.assertEqual(foo(), foo.py_func()) + + # There should be no warnings as the IR scopes should be consistent with + # the IR involved. + self.assertEqual(len(w), 0) + + +class TestOverloadMethsAttrsInlining(InliningBase): + def setUp(self): + self.make_dummy_type() + super(TestOverloadMethsAttrsInlining, self).setUp() + + def check_method(self, test_impl, args, expected, block_count, + expects_inlined=True): + j_func = njit(pipeline_class=IRPreservingTestPipeline)(test_impl) + # check they produce the same answer first! + self.assertEqual(j_func(*args), expected) + + # make sure IR doesn't have branches + fir = j_func.overloads[j_func.signatures[0]].metadata['preserved_ir'] + fir.blocks = fir.blocks + self.assertEqual(len(fir.blocks), block_count) + if expects_inlined: + # assert no calls + for block in fir.blocks.values(): + calls = list(block.find_exprs('call')) + self.assertFalse(calls) + else: + # assert has call + allcalls = [] + for block in fir.blocks.values(): + allcalls += list(block.find_exprs('call')) + self.assertTrue(allcalls) + + def check_getattr(self, test_impl, args, expected, block_count, + expects_inlined=True): + j_func = njit(pipeline_class=IRPreservingTestPipeline)(test_impl) + # check they produce the same answer first! + self.assertEqual(j_func(*args), expected) + + # make sure IR doesn't have branches + fir = j_func.overloads[j_func.signatures[0]].metadata['preserved_ir'] + fir.blocks = fir.blocks + self.assertEqual(len(fir.blocks), block_count) + if expects_inlined: + # assert no getattr + for block in fir.blocks.values(): + getattrs = list(block.find_exprs('getattr')) + self.assertFalse(getattrs) + else: + # assert has getattr + allgetattrs = [] + for block in fir.blocks.values(): + allgetattrs += list(block.find_exprs('getattr')) + self.assertTrue(allgetattrs) + + def test_overload_method_default_args_always(self): + Dummy, DummyType = self.make_dummy_type() + + @overload_method(DummyType, "inline_method", inline='always') + def _get_inlined_method(obj, val=None, val2=None): + def get(obj, val=None, val2=None): + return ("THIS IS INLINED", val, val2) + return get + + def foo(obj): + return obj.inline_method(123), obj.inline_method(val2=321) + + self.check_method( + test_impl=foo, + args=[Dummy()], + expected=(("THIS IS INLINED", 123, None), + ("THIS IS INLINED", None, 321)), + block_count=1, + ) + + def make_overload_method_test(self, costmodel, should_inline): + def costmodel(*args): + return should_inline + + Dummy, DummyType = self.make_dummy_type() + + @overload_method(DummyType, "inline_method", inline=costmodel) + def _get_inlined_method(obj, val): + def get(obj, val): + return ("THIS IS INLINED!!!", val) + return get + + def foo(obj): + return obj.inline_method(123) + + self.check_method( + test_impl=foo, + args=[Dummy()], + expected=("THIS IS INLINED!!!", 123), + block_count=1, + expects_inlined=should_inline, + ) + + def test_overload_method_cost_driven_always(self): + self.make_overload_method_test( + costmodel='always', + should_inline=True, + ) + + def test_overload_method_cost_driven_never(self): + self.make_overload_method_test( + costmodel='never', + should_inline=False, + ) + + def test_overload_method_cost_driven_must_inline(self): + self.make_overload_method_test( + costmodel=lambda *args: True, + should_inline=True, + ) + + def test_overload_method_cost_driven_no_inline(self): + self.make_overload_method_test( + costmodel=lambda *args: False, + should_inline=False, + ) + + def make_overload_attribute_test(self, costmodel, should_inline): + Dummy, DummyType = self.make_dummy_type() + + @overload_attribute(DummyType, "inlineme", inline=costmodel) + def _get_inlineme(obj): + def get(obj): + return "MY INLINED ATTRS" + return get + + def foo(obj): + return obj.inlineme + + self.check_getattr( + test_impl=foo, + args=[Dummy()], + expected="MY INLINED ATTRS", + block_count=1, + expects_inlined=should_inline, + ) + + def test_overload_attribute_always(self): + self.make_overload_attribute_test( + costmodel='always', + should_inline=True, + ) + + def test_overload_attribute_never(self): + self.make_overload_attribute_test( + costmodel='never', + should_inline=False, + ) + + def test_overload_attribute_costmodel_must_inline(self): + self.make_overload_attribute_test( + costmodel=lambda *args: True, + should_inline=True, + ) + + def test_overload_attribute_costmodel_no_inline(self): + self.make_overload_attribute_test( + costmodel=lambda *args: False, + should_inline=False, + ) + + +class TestGeneralInlining(MemoryLeakMixin, InliningBase): + + def test_with_inlined_and_noninlined_variants(self): + # This test is contrived and was to demonstrate fixing a bug in the + # template walking logic where inlinable and non-inlinable definitions + # would not mix. + + @overload(len, inline='always') + def overload_len(A): + if False: + return lambda A: 10 + + def impl(): + return len([2, 3, 4]) + + # len(list) won't be inlined because the overload above doesn't apply + self.check(impl, inline_expect={'len': False}) + + def test_with_kwargs(self): + + def foo(a, b=3, c=5): + return a + b + c + + @overload(foo, inline='always') + def overload_foo(a, b=3, c=5): + def impl(a, b=3, c=5): + return a + b + c + return impl + + def impl(): + return foo(3, c=10) + + self.check(impl, inline_expect={'foo': True}) + + def test_with_kwargs2(self): + + @njit(inline='always') + def bar(a, b=12, c=9): + return a + b + + def impl(a, b=7, c=5): + return bar(a + b, c=19) + + self.check(impl, 3, 4, inline_expect={'bar': True}) + + def test_inlining_optional_constant(self): + # This testcase causes `b` to be a Optional(bool) constant once it is + # inlined into foo(). + @njit(inline='always') + def bar(a=None, b=None): + if b is None: + b = 123 # this changes the type of `b` due to lack of SSA + return (a, b) + + def impl(): + return bar(), bar(123), bar(b=321) + + self.check(impl, block_count='SKIP', inline_expect={'bar': True}) + + +class TestInlineOptions(TestCase): + + def test_basic(self): + always = InlineOptions('always') + self.assertTrue(always.is_always_inline) + self.assertFalse(always.is_never_inline) + self.assertFalse(always.has_cost_model) + self.assertEqual(always.value, 'always') + + never = InlineOptions('never') + self.assertFalse(never.is_always_inline) + self.assertTrue(never.is_never_inline) + self.assertFalse(never.has_cost_model) + self.assertEqual(never.value, 'never') + + def cost_model(x): + return x + model = InlineOptions(cost_model) + self.assertFalse(model.is_always_inline) + self.assertFalse(model.is_never_inline) + self.assertTrue(model.has_cost_model) + self.assertIs(model.value, cost_model) + + +class TestInlineMiscIssues(TestCase): + + def test_issue4691(self): + def output_factory(array, dtype): + pass + + @overload(output_factory, inline='always') + def ol_output_factory(array, dtype): + if isinstance(array, types.npytypes.Array): + def impl(array, dtype): + shape = array.shape[3:] + return np.zeros(shape, dtype=dtype) + + return impl + + @njit(nogil=True) + def fn(array): + out = output_factory(array, array.dtype) + return out + + @njit(nogil=True) + def fn2(array): + return np.zeros(array.shape[3:], dtype=array.dtype) + + fn(np.ones((10, 20, 30, 40, 50))) + fn2(np.ones((10, 20, 30, 40, 50))) + + def test_issue4693(self): + + @njit(inline='always') + def inlining(array): + if array.ndim != 1: + raise ValueError("Invalid number of dimensions") + + return array + + @njit + def fn(array): + return inlining(array) + + fn(np.zeros(10)) + + def test_issue5476(self): + # Actual issue has the ValueError passed as an arg to `inlining` so is + # a constant inference error + @njit(inline='always') + def inlining(): + msg = 'Something happened' + raise ValueError(msg) + + @njit + def fn(): + return inlining() + + with self.assertRaises(ValueError) as raises: + fn() + + self.assertIn("Something happened", str(raises.exception)) + + def test_issue5792(self): + # Issue is that overloads cache their IR and closure inliner was + # manipulating the cached IR in a way that broke repeated inlines. + + class Dummy: + def __init__(self, data): + self.data = data + + def div(self, other): + return data / other.data + + class DummyType(types.Type): + def __init__(self, data): + self.data = data + super().__init__(name=f'Dummy({self.data})') + + @register_model(DummyType) + class DummyTypeModel(models.StructModel): + def __init__(self, dmm, fe_type): + members = [ + ('data', fe_type.data), + ] + super().__init__(dmm, fe_type, members) + + make_attribute_wrapper(DummyType, 'data', '_data') + + @intrinsic + def init_dummy(typingctx, data): + def codegen(context, builder, sig, args): + typ = sig.return_type + data, = args + dummy = cgutils.create_struct_proxy(typ)(context, builder) + dummy.data = data + + if context.enable_nrt: + context.nrt.incref(builder, sig.args[0], data) + + return dummy._getvalue() + + ret_typ = DummyType(data) + sig = signature(ret_typ, data) + + return sig, codegen + + @overload(Dummy, inline='always') + def dummy_overload(data): + def ctor(data): + return init_dummy(data) + + return ctor + + @overload_method(DummyType, 'div', inline='always') + def div_overload(self, other): + def impl(self, other): + return self._data / other._data + + return impl + + @njit + def test_impl(data, other_data): + dummy = Dummy(data) # ctor inlined once + other = Dummy(other_data) # ctor inlined again + + return dummy.div(other) + + data = 1. + other_data = 2. + res = test_impl(data, other_data) + self.assertEqual(res, data / other_data) + + def test_issue5824(self): + """ Similar to the above test_issue5792, checks mutation of the inlinee + IR is local only""" + + class CustomCompiler(CompilerBase): + + def define_pipelines(self): + pm = DefaultPassBuilder.define_nopython_pipeline(self.state) + # Run the inliner twice! + pm.add_pass_after(InlineOverloads, InlineOverloads) + pm.finalize() + return [pm] + + def bar(x): + ... + + @overload(bar, inline='always') + def ol_bar(x): + if isinstance(x, types.Integer): + def impl(x): + return x + 1.3 + return impl + + @njit(pipeline_class=CustomCompiler) + def foo(z): + return bar(z), bar(z) + + self.assertEqual(foo(10), (11.3, 11.3)) + + @skip_parfors_unsupported + def test_issue7380(self): + # This checks that inlining a function containing a loop into another + # loop where the induction variable in both loops is the same doesn't + # end up with a name collision. Parfors can detect this so it is used. + # See: https://github.com/numba/numba/issues/7380 + + # Check Numba inlined function passes + + @njit(inline="always") + def bar(x): + for i in range(x.size): + x[i] += 1 + + @njit(parallel=True) + def foo(a): + for i in prange(a.shape[0]): + bar(a[i]) + + a = np.ones((10, 10)) + foo(a) # run + # check mutation of data is correct + self.assertPreciseEqual(a, 2 * np.ones_like(a)) + + # Check manually inlined equivalent function fails + @njit(parallel=True) + def foo_bad(a): + for i in prange(a.shape[0]): + x = a[i] + for i in range(x.size): + x[i] += 1 + + with self.assertRaises(errors.UnsupportedRewriteError) as e: + foo_bad(a) + + self.assertIn("Overwrite of parallel loop index", str(e.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ir_utils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ir_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..96deeaca0e3f60037938c61d03838f5c22451ddc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ir_utils.py @@ -0,0 +1,273 @@ +import numba +from numba.tests.support import TestCase, unittest +from numba.core.registry import cpu_target +from numba.core.compiler import CompilerBase, Flags +from numba.core.compiler_machinery import PassManager +from numba.core import types, ir, bytecode, compiler, ir_utils, registry +from numba.core.untyped_passes import (ExtractByteCode, TranslateByteCode, + FixupArgs, IRProcessing,) + +from numba.core.typed_passes import (NopythonTypeInference, + type_inference_stage, DeadCodeElimination) +from numba.experimental import jitclass + +# global constant for testing find_const +GLOBAL_B = 11 + + +@jitclass([('val', numba.core.types.List(numba.intp))]) +class Dummy(object): + def __init__(self, val): + self.val = val + + +class TestIrUtils(TestCase): + """ + Tests ir handling utility functions like find_callname. + """ + + def test_obj_func_match(self): + """Test matching of an object method (other than Array see #3449) + """ + + def test_func(): + d = Dummy([1]) + d.val.append(2) + + test_ir = compiler.run_frontend(test_func) + typingctx = cpu_target.typing_context + targetctx = cpu_target.target_context + typing_res = type_inference_stage( + typingctx, targetctx, test_ir, (), None) + matched_call = ir_utils.find_callname( + test_ir, test_ir.blocks[0].body[7].value, typing_res.typemap) + self.assertTrue(isinstance(matched_call, tuple) and + len(matched_call) == 2 and + matched_call[0] == 'append') + + def test_dead_code_elimination(self): + + class Tester(CompilerBase): + + @classmethod + def mk_pipeline(cls, args, return_type=None, flags=None, locals={}, + library=None, typing_context=None, + target_context=None): + if not flags: + flags = Flags() + flags.nrt = True + if typing_context is None: + typing_context = registry.cpu_target.typing_context + if target_context is None: + target_context = registry.cpu_target.target_context + return cls(typing_context, target_context, library, args, + return_type, flags, locals) + + def compile_to_ir(self, func, DCE=False): + """ + Compile and return IR + """ + func_id = bytecode.FunctionIdentity.from_function(func) + self.state.func_id = func_id + ExtractByteCode().run_pass(self.state) + state = self.state + + name = "DCE_testing" + pm = PassManager(name) + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(FixupArgs, "fix up args") + pm.add_pass(IRProcessing, "processing IR") + pm.add_pass(NopythonTypeInference, "nopython frontend") + if DCE is True: + pm.add_pass(DeadCodeElimination, "DCE after typing") + pm.finalize() + pm.run(state) + return state.func_ir + + def check_initial_ir(the_ir): + # dead stuff: + # a const int value 0xdead + # an assign of above into to variable `dead` + # a const int above 0xdeaddead + # an assign of said int to variable `deaddead` + # this is 2 statements to remove + + self.assertEqual(len(the_ir.blocks), 1) + block = the_ir.blocks[0] + deads = [] + for x in block.find_insts(ir.Assign): + if isinstance(getattr(x, 'target', None), ir.Var): + if 'dead' in getattr(x.target, 'name', ''): + deads.append(x) + + self.assertEqual(len(deads), 2) + for d in deads: + # check the ir.Const is the definition and the value is expected + const_val = the_ir.get_definition(d.value) + self.assertTrue(int('0x%s' % d.target.name, 16), + const_val.value) + + return deads + + def check_dce_ir(the_ir): + self.assertEqual(len(the_ir.blocks), 1) + block = the_ir.blocks[0] + deads = [] + consts = [] + for x in block.find_insts(ir.Assign): + if isinstance(getattr(x, 'target', None), ir.Var): + if 'dead' in getattr(x.target, 'name', ''): + deads.append(x) + if isinstance(getattr(x, 'value', None), ir.Const): + consts.append(x) + self.assertEqual(len(deads), 0) + + # check the consts to make sure there's no reference to 0xdead or + # 0xdeaddead + for x in consts: + self.assertTrue(x.value.value not in [0xdead, 0xdeaddead]) + + def foo(x): + y = x + 1 + dead = 0xdead # noqa + z = y + 2 + deaddead = 0xdeaddead # noqa + ret = z * z + return ret + + test_pipeline = Tester.mk_pipeline((types.intp,)) + no_dce = test_pipeline.compile_to_ir(foo) + removed = check_initial_ir(no_dce) + + test_pipeline = Tester.mk_pipeline((types.intp,)) + w_dce = test_pipeline.compile_to_ir(foo, DCE=True) + check_dce_ir(w_dce) + + # check that the count of initial - removed = dce + self.assertEqual(len(no_dce.blocks[0].body) - len(removed), + len(w_dce.blocks[0].body)) + + def test_find_const_global(self): + """ + Test find_const() for values in globals (ir.Global) and freevars + (ir.FreeVar) that are considered constants for compilation. + """ + FREEVAR_C = 12 + + def foo(a): + b = GLOBAL_B + c = FREEVAR_C + return a + b + c + + f_ir = compiler.run_frontend(foo) + block = f_ir.blocks[0] + const_b = None + const_c = None + + for inst in block.body: + if isinstance(inst, ir.Assign) and inst.target.name == 'b': + const_b = ir_utils.guard( + ir_utils.find_const, f_ir, inst.target) + if isinstance(inst, ir.Assign) and inst.target.name == 'c': + const_c = ir_utils.guard( + ir_utils.find_const, f_ir, inst.target) + + self.assertEqual(const_b, GLOBAL_B) + self.assertEqual(const_c, FREEVAR_C) + + def test_flatten_labels(self): + """ tests flatten_labels """ + def foo(a): + acc = 0 + if a > 3: + acc += 1 + if a > 19: + return 53 + elif a < 1000: + if a >= 12: + acc += 1 + for x in range(10): + acc -= 1 + if acc < 2: + break + else: + acc += 7 + else: + raise ValueError("some string") + # prevents inline of return on py310 + py310_defeat1 = 1 # noqa + py310_defeat2 = 2 # noqa + py310_defeat3 = 3 # noqa + py310_defeat4 = 4 # noqa + return acc + + def bar(a): + acc = 0 + z = 12 + if a > 3: + acc += 1 + z += 12 + if a > 19: + z += 12 + return 53 + elif a < 1000: + if a >= 12: + z += 12 + acc += 1 + for x in range(10): + z += 12 + acc -= 1 + if acc < 2: + break + else: + z += 12 + acc += 7 + else: + raise ValueError("some string") + py310_defeat1 = 1 # noqa + py310_defeat2 = 2 # noqa + py310_defeat3 = 3 # noqa + py310_defeat4 = 4 # noqa + return acc + + def baz(a): + acc = 0 + if a > 3: + acc += 1 + if a > 19: + return 53 + else: # extra control flow in comparison to foo + return 55 + elif a < 1000: + if a >= 12: + acc += 1 + for x in range(10): + acc -= 1 + if acc < 2: + break + else: + acc += 7 + else: + raise ValueError("some string") + py310_defeat1 = 1 # noqa + py310_defeat2 = 2 # noqa + py310_defeat3 = 3 # noqa + py310_defeat4 = 4 # noqa + return acc + + def get_flat_cfg(func): + func_ir = ir_utils.compile_to_numba_ir(func, dict()) + flat_blocks = ir_utils.flatten_labels(func_ir.blocks) + self.assertEqual(max(flat_blocks.keys()) + 1, len(func_ir.blocks)) + return ir_utils.compute_cfg_from_blocks(flat_blocks) + + foo_cfg = get_flat_cfg(foo) + bar_cfg = get_flat_cfg(bar) + baz_cfg = get_flat_cfg(baz) + + self.assertEqual(foo_cfg, bar_cfg) + self.assertNotEqual(foo_cfg, baz_cfg) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_itanium_mangler.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_itanium_mangler.py new file mode 100644 index 0000000000000000000000000000000000000000..2737b88e31856d3a88b7a31b2aa585fe52acb683 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_itanium_mangler.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +from numba import int32, int64, uint32, uint64, float32, float64 +from numba.core.types import range_iter32_type +from numba.core import itanium_mangler +import unittest + + +class TestItaniumManager(unittest.TestCase): + def test_ident(self): + got = itanium_mangler.mangle_identifier("apple") + expect = "5apple" + self.assertEqual(expect, got) + + got = itanium_mangler.mangle_identifier("ap_ple") + expect = "6ap_ple" + self.assertEqual(expect, got) + + got = itanium_mangler.mangle_identifier("apple213") + expect = "8apple213" + self.assertEqual(expect, got) + + def test_types(self): + got = itanium_mangler.mangle_type(int32) + expect = "i" + self.assertEqual(expect, got) + + got = itanium_mangler.mangle_type(int64) + expect = "x" + self.assertEqual(expect, got) + + got = itanium_mangler.mangle_type(uint32) + expect = "j" + self.assertEqual(expect, got) + + got = itanium_mangler.mangle_type(uint64) + expect = "y" + self.assertEqual(expect, got) + + got = itanium_mangler.mangle_type(float32) + expect = "f" + self.assertEqual(expect, got) + + got = itanium_mangler.mangle_type(float64) + expect = "d" + self.assertEqual(expect, got) + + def test_function(self): + got = itanium_mangler.mangle("what", [int32, float32]) + expect = "_Z4whatif" + self.assertEqual(expect, got) + + got = itanium_mangler.mangle("a_little_brown_fox", [uint64, + uint32, + float64]) + expect = "_Z18a_little_brown_foxyjd" + self.assertEqual(expect, got) + + def test_custom_type(self): + got = itanium_mangler.mangle_type(range_iter32_type) + name = str(range_iter32_type) + expect = "{n}{name}".format(n=len(name), name=name) + self.assertEqual(expect, got) + + def test_mangle_literal(self): + # check int + got = itanium_mangler.mangle_value(123) + expect = "Li123E" + self.assertEqual(expect, got) + # check float (not handled using standard) + got = itanium_mangler.mangle_value(12.3) + self.assertRegex(got, r'^\d+_12_[0-9a-z][0-9a-z]3$') + + def test_mangle_unicode(self): + name = u'f∂ƒ©z' + got = itanium_mangler.mangle_identifier(name) + self.assertRegex(got, r'^\d+f(_[a-z0-9][a-z0-9])+z$') + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_iteration.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_iteration.py new file mode 100644 index 0000000000000000000000000000000000000000..aea9869e9cc3d55a1e763f6870cb2873b4823680 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_iteration.py @@ -0,0 +1,241 @@ +import unittest +import numpy as np + +from numba import jit, njit +from numba.core import types, errors +from numba.tests.support import TestCase, MemoryLeakMixin +from numba.np import numpy_support + + +force_pyobj_flags = {'forceobj': True} +no_pyobj_flags = {'nopython': True} + + +def int_tuple_iter_usecase(): + res = 0 + for i in (1, 2, 99, 3): + res += i + return res + +def float_tuple_iter_usecase(): + res = 0.0 + for i in (1.5, 2.0, 99.3, 3.4): + res += i + return res + +def tuple_tuple_iter_usecase(): + # Recursively homogeneous tuple type + res = 0.0 + for i in ((1.5, 2.0), (99.3, 3.4), (1.8, 2.5)): + for j in i: + res += j + res = res * 2 + return res + +def enumerate_nested_tuple_usecase(): + res = 0.0 + for i, j in enumerate(((1.5, 2.0), (99.3, 3.4), (1.8, 2.5))): + for l in j: + res += i * l + res = res * 2 + return res + +def nested_enumerate_usecase(): + res = 0.0 + for i, (j, k) in enumerate(enumerate(((1.5, 2.0), (99.3, 3.4), (1.8, 2.5)))): + for l in k: + res += i * j * l + res = res * 2 + return res + + +def enumerate_array_usecase(): + res = 0 + arrays = (np.ones(4), np.ones(5)) + for i, v in enumerate(arrays): + res += v.sum() + return res + + +def scalar_iter_usecase(iterable): + res = 0.0 + for x in iterable: + res += x + return res + +def record_iter_usecase(iterable): + res = 0.0 + for x in iterable: + res += x.a * x.b + return res + +def record_iter_mutate_usecase(iterable): + for x in iterable: + x.a = x.a + x.b + + +record_dtype = np.dtype([('a', np.float64), + ('b', np.int32), + ]) + + +class IterationTest(MemoryLeakMixin, TestCase): + + def run_nullary_func(self, pyfunc, flags): + cfunc = jit((), **flags)(pyfunc) + expected = pyfunc() + self.assertPreciseEqual(cfunc(), expected) + + def test_int_tuple_iter(self, flags=force_pyobj_flags): + self.run_nullary_func(int_tuple_iter_usecase, flags) + + def test_int_tuple_iter_npm(self): + self.test_int_tuple_iter(flags=no_pyobj_flags) + + # Type inference on tuples used to be hardcoded for ints, check + # that it works for other types. + + def test_float_tuple_iter(self, flags=force_pyobj_flags): + self.run_nullary_func(float_tuple_iter_usecase, flags) + + def test_float_tuple_iter_npm(self): + self.test_float_tuple_iter(flags=no_pyobj_flags) + + def test_tuple_tuple_iter(self, flags=force_pyobj_flags): + self.run_nullary_func(tuple_tuple_iter_usecase, flags) + + def test_tuple_tuple_iter_npm(self): + self.test_tuple_tuple_iter(flags=no_pyobj_flags) + + def test_enumerate_nested_tuple(self, flags=force_pyobj_flags): + self.run_nullary_func(enumerate_nested_tuple_usecase, flags) + + def test_enumerate_nested_tuple_npm(self): + self.test_enumerate_nested_tuple(flags=no_pyobj_flags) + + def test_nested_enumerate(self, flags=force_pyobj_flags): + self.run_nullary_func(nested_enumerate_usecase, flags) + + def test_nested_enumerate_npm(self): + self.test_nested_enumerate(flags=no_pyobj_flags) + + def test_enumerate_refct(self): + # Test issue 3473 + pyfunc = enumerate_array_usecase + cfunc = njit((),)(pyfunc) + expected = pyfunc() + self.assertPreciseEqual(cfunc(), expected) + + def run_array_1d(self, item_type, arg, flags): + # Iteration over a 1d numpy array + pyfunc = scalar_iter_usecase + cfunc = jit(item_type(types.Array(item_type, 1, 'A'),), **flags)(pyfunc) + self.assertPreciseEqual(cfunc(arg), pyfunc(arg)) + + def test_array_1d_float(self, flags=force_pyobj_flags): + self.run_array_1d(types.float64, np.arange(5.0), flags) + + def test_array_1d_float_npm(self): + self.test_array_1d_float(no_pyobj_flags) + + def test_array_1d_complex(self, flags=force_pyobj_flags): + self.run_array_1d(types.complex128, np.arange(5.0) * 1.0j, flags) + + def test_array_1d_complex_npm(self): + self.test_array_1d_complex(no_pyobj_flags) + + def test_array_1d_record(self, flags=force_pyobj_flags): + pyfunc = record_iter_usecase + item_type = numpy_support.from_dtype(record_dtype) + cfunc = jit((types.Array(item_type, 1, 'A'),), **flags)(pyfunc) + arr = np.recarray(3, dtype=record_dtype) + for i in range(3): + arr[i].a = float(i * 2) + arr[i].b = i + 2 + got = pyfunc(arr) + self.assertPreciseEqual(cfunc(arr), got) + + def test_array_1d_record_npm(self): + self.test_array_1d_record(no_pyobj_flags) + + def test_array_1d_record_mutate_npm(self, flags=no_pyobj_flags): + pyfunc = record_iter_mutate_usecase + item_type = numpy_support.from_dtype(record_dtype) + cfunc = jit((types.Array(item_type, 1, 'A'),), **flags)(pyfunc) + arr = np.recarray(3, dtype=record_dtype) + for i in range(3): + arr[i].a = float(i * 2) + arr[i].b = i + 2 + expected = arr.copy() + pyfunc(expected) + got = arr.copy() + cfunc(got) + self.assertPreciseEqual(expected, got) + + def test_array_1d_record_mutate(self): + self.test_array_1d_record_mutate_npm(flags=force_pyobj_flags) + + def test_array_0d_raises(self): + + def foo(x): + for i in x: + pass + + # 0d is typing error + with self.assertRaises(errors.TypingError) as raises: + aryty = types.Array(types.int32, 0, 'C') + njit((aryty,))(foo) + + self.assertIn("0-d array", str(raises.exception)) + + def test_tuple_iter_issue1504(self): + # The issue is due to `row` being typed as heterogeneous tuple. + def bar(x, y): + total = 0 + for row in zip(x, y): + total += row[0] + row[1] + + return total + + x = y = np.arange(3, dtype=np.int32) + aryty = types.Array(types.int32, 1, 'C') + cfunc = njit((aryty, aryty))(bar) + + expect = bar(x, y) + got = cfunc(x, y) + self.assertEqual(expect, got) + + def test_tuple_of_arrays_iter(self): + # We used to leak a reference to each element of the tuple + def bar(arrs): + total = 0 + for arr in arrs: + total += arr[0] + + return total + + x = y = np.arange(3, dtype=np.int32) + aryty = types.Array(types.int32, 1, 'C') + cfunc = njit((types.containers.UniTuple(aryty, 2),))(bar) + + expect = bar((x, y)) + got = cfunc((x, y)) + self.assertEqual(expect, got) + + + +class TestIterationRefct(MemoryLeakMixin, TestCase): + def test_zip_with_arrays(self): + @njit + def foo(sequence): + c = 0 + for a, b in zip(range(len(sequence)), sequence): + c += (a + 1) * b.sum() + return + + sequence = [np.arange(1 + i) for i in range(10)] + self.assertEqual(foo(sequence), foo.py_func(sequence)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_jit_module.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_jit_module.py new file mode 100644 index 0000000000000000000000000000000000000000..eb9697aecd49ce4e15494a484f46c41d8d82e9f8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_jit_module.py @@ -0,0 +1,146 @@ +import os +import sys +import inspect +import contextlib +import numpy as np +import logging +from io import StringIO + +import unittest +from numba.tests.support import SerialMixin, create_temp_module +from numba.core import dispatcher + + +@contextlib.contextmanager +def captured_logs(l): + try: + buffer = StringIO() + handler = logging.StreamHandler(buffer) + l.addHandler(handler) + yield buffer + finally: + l.removeHandler(handler) + + +class TestJitModule(SerialMixin, unittest.TestCase): + + source_lines = """ +from numba import jit_module + +def inc(x): + return x + 1 + +def add(x, y): + return x + y + +def inc_add(x): + y = inc(x) + return add(x, y) + +import numpy as np +mean = np.mean + +class Foo(object): + pass + +jit_module({jit_options}) +""" + + def test_create_temp_jitted_module(self): + sys_path_original = list(sys.path) + sys_modules_original = dict(sys.modules) + with create_temp_module(self.source_lines) as test_module: + temp_module_dir = os.path.dirname(test_module.__file__) + self.assertEqual(temp_module_dir, sys.path[0]) + self.assertEqual(sys.path[1:], sys_path_original) + self.assertTrue(test_module.__name__ in sys.modules) + # Test that modifications to sys.path / sys.modules are reverted + self.assertEqual(sys.path, sys_path_original) + self.assertEqual(sys.modules, sys_modules_original) + + def test_create_temp_jitted_module_with_exception(self): + try: + sys_path_original = list(sys.path) + sys_modules_original = dict(sys.modules) + with create_temp_module(self.source_lines): + raise ValueError("Something went wrong!") + except ValueError: + # Test that modifications to sys.path / sys.modules are reverted + self.assertEqual(sys.path, sys_path_original) + self.assertEqual(sys.modules, sys_modules_original) + + def test_jit_module(self): + with create_temp_module(self.source_lines) as test_module: + self.assertIsInstance(test_module.inc, dispatcher.Dispatcher) + self.assertIsInstance(test_module.add, dispatcher.Dispatcher) + self.assertIsInstance(test_module.inc_add, dispatcher.Dispatcher) + self.assertTrue(test_module.mean is np.mean) + self.assertTrue(inspect.isclass(test_module.Foo)) + + # Test output of jitted functions is as expected + x, y = 1.7, 2.3 + self.assertEqual(test_module.inc(x), + test_module.inc.py_func(x)) + self.assertEqual(test_module.add(x, y), + test_module.add.py_func(x, y)) + self.assertEqual(test_module.inc_add(x), + test_module.inc_add.py_func(x)) + + def test_jit_module_jit_options(self): + jit_options = {"nopython": True, + "nogil": False, + "error_model": "numpy", + "boundscheck": False, + } + with create_temp_module(self.source_lines, + **jit_options) as test_module: + self.assertEqual(test_module.inc.targetoptions, jit_options) + + def test_jit_module_jit_options_override(self): + source_lines = """ +from numba import jit, jit_module + +@jit(nogil=True, forceobj=True) +def inc(x): + return x + 1 + +def add(x, y): + return x + y + +jit_module({jit_options}) +""" + jit_options = {"nopython": True, + "error_model": "numpy", + "boundscheck": False, + } + with create_temp_module(source_lines=source_lines, + **jit_options) as test_module: + self.assertEqual(test_module.add.targetoptions, jit_options) + # Test that manual jit-wrapping overrides jit_module options, + # `forceobj` will automatically apply `nopython=False`. + self.assertEqual(test_module.inc.targetoptions, + {'nogil': True, 'forceobj': True, + 'boundscheck': None, 'nopython': False}) + + def test_jit_module_logging_output(self): + logger = logging.getLogger('numba.core.decorators') + logger.setLevel(logging.DEBUG) + jit_options = {"nopython": True, + "error_model": "numpy", + } + with captured_logs(logger) as logs: + with create_temp_module(self.source_lines, + **jit_options) as test_module: + logs = logs.getvalue() + expected = ["Auto decorating function", + "from module {}".format(test_module.__name__), + "with jit and options: {}".format(jit_options)] + self.assertTrue(all(i in logs for i in expected)) + + def test_jit_module_logging_level(self): + logger = logging.getLogger('numba.core.decorators') + # Test there's no logging for INFO level + logger.setLevel(logging.INFO) + with captured_logs(logger) as logs: + with create_temp_module(self.source_lines): + self.assertEqual(logs.getvalue(), '') diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_jitclasses.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_jitclasses.py new file mode 100644 index 0000000000000000000000000000000000000000..2f224af9e58b9f636e65d43aed66f39b17707fa8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_jitclasses.py @@ -0,0 +1,2020 @@ +import ctypes +import itertools +import pickle +import random +import typing as pt +import unittest + +from collections import OrderedDict + +import numpy as np +from numba import (boolean, deferred_type, float32, float64, int16, int32, + njit, optional, typeof) +from numba.core import errors, types +from numba.core.dispatcher import Dispatcher +from numba.core.errors import LoweringError, TypingError +from numba.core.runtime.nrt import MemInfo +from numba.experimental import jitclass +from numba.experimental.jitclass import _box +from numba.experimental.jitclass.base import JitClassType +from numba.tests.support import MemoryLeakMixin, TestCase, skip_if_typeguard +from numba.tests.support import skip_unless_scipy + + +class TestClass1(object): + def __init__(self, x, y, z=1, *, a=5): + self.x = x + self.y = y + self.z = z + self.a = a + + +class TestClass2(object): + def __init__(self, x, y, z=1, *args, a=5): + self.x = x + self.y = y + self.z = z + self.args = args + self.a = a + + +def _get_meminfo(box): + ptr = _box.box_get_meminfoptr(box) + mi = MemInfo(ptr) + mi.acquire() + return mi + + +class TestJitClass(TestCase, MemoryLeakMixin): + + def _check_spec(self, spec=None, test_cls=None, all_expected=None): + if test_cls is None: + @jitclass(spec) + class Test(object): + + def __init__(self): + pass + test_cls = Test + + clsty = test_cls.class_type.instance_type + names = list(clsty.struct.keys()) + values = list(clsty.struct.values()) + + if all_expected is None: + if isinstance(spec, OrderedDict): + all_expected = spec.items() + else: + all_expected = spec + + assert all_expected is not None + + self.assertEqual(len(names), len(all_expected)) + for got, expected in zip(zip(names, values), all_expected): + self.assertEqual(got[0], expected[0]) + self.assertEqual(got[1], expected[1]) + + def test_ordereddict_spec(self): + spec = OrderedDict() + spec["x"] = int32 + spec["y"] = float32 + self._check_spec(spec) + + def test_list_spec(self): + spec = [("x", int32), + ("y", float32)] + self._check_spec(spec) + + def test_type_annotations(self): + spec = [("x", int32)] + + @jitclass(spec) + class Test1(object): + x: int + y: pt.List[float] + + def __init__(self): + pass + + self._check_spec(spec, Test1, spec + [("y", types.ListType(float64))]) + + def test_type_annotation_inheritance(self): + + class Foo: + x: int + + @jitclass + class Bar(Foo): + y: float + + def __init__(self, value: float) -> None: + self.x = int(value) + self.y = value + + self._check_spec( + test_cls=Bar, all_expected=[("x", typeof(0)), ("y", typeof(0.0))] + ) + + def test_spec_errors(self): + spec1 = [("x", int), ("y", float32[:])] + spec2 = [(1, int32), ("y", float32[:])] + + class Test(object): + + def __init__(self): + pass + + with self.assertRaises(TypeError) as raises: + jitclass(Test, spec1) + self.assertIn("spec values should be Numba type instances", + str(raises.exception)) + with self.assertRaises(TypeError) as raises: + jitclass(Test, spec2) + self.assertEqual(str(raises.exception), + "spec keys should be strings, got 1") + + def test_init_errors(self): + + @jitclass([]) + class Test: + def __init__(self): + return 7 + + with self.assertRaises(errors.TypingError) as raises: + Test() + + self.assertIn("__init__() should return None, not", + str(raises.exception)) + + def _make_Float2AndArray(self): + spec = OrderedDict() + spec["x"] = float32 + spec["y"] = float32 + spec["arr"] = float32[:] + + @jitclass(spec) + class Float2AndArray(object): + + def __init__(self, x, y, arr): + self.x = x + self.y = y + self.arr = arr + + def add(self, val): + self.x += val + self.y += val + return val + + return Float2AndArray + + def _make_Vector2(self): + spec = OrderedDict() + spec["x"] = int32 + spec["y"] = int32 + + @jitclass(spec) + class Vector2(object): + + def __init__(self, x, y): + self.x = x + self.y = y + + return Vector2 + + def test_jit_class_1(self): + Float2AndArray = self._make_Float2AndArray() + Vector2 = self._make_Vector2() + + @njit + def bar(obj): + return obj.x + obj.y + + @njit + def foo(a): + obj = Float2AndArray(1, 2, a) + obj.add(123) + + vec = Vector2(3, 4) + return bar(obj), bar(vec), obj.arr + + inp = np.ones(10, dtype=np.float32) + a, b, c = foo(inp) + self.assertEqual(a, 123 + 1 + 123 + 2) + self.assertEqual(b, 3 + 4) + self.assertPreciseEqual(c, inp) + + def test_jitclass_usage_from_python(self): + Float2AndArray = self._make_Float2AndArray() + + @njit + def identity(obj): + return obj + + @njit + def retrieve_attributes(obj): + return obj.x, obj.y, obj.arr + + arr = np.arange(10, dtype=np.float32) + obj = Float2AndArray(1, 2, arr) + obj_meminfo = _get_meminfo(obj) + self.assertEqual(obj_meminfo.refcount, 2) + self.assertEqual(obj_meminfo.data, _box.box_get_dataptr(obj)) + self.assertEqual(obj._numba_type_.class_type, + Float2AndArray.class_type) + # Use jit class instance in numba + other = identity(obj) + other_meminfo = _get_meminfo(other) # duplicates MemInfo object to obj + self.assertEqual(obj_meminfo.refcount, 4) + self.assertEqual(other_meminfo.refcount, 4) + self.assertEqual(other_meminfo.data, _box.box_get_dataptr(other)) + self.assertEqual(other_meminfo.data, obj_meminfo.data) + + # Check dtor + del other, other_meminfo + self.assertEqual(obj_meminfo.refcount, 2) + + # Check attributes + out_x, out_y, out_arr = retrieve_attributes(obj) + self.assertEqual(out_x, 1) + self.assertEqual(out_y, 2) + self.assertIs(out_arr, arr) + + # Access attributes from python + self.assertEqual(obj.x, 1) + self.assertEqual(obj.y, 2) + self.assertIs(obj.arr, arr) + + # Access methods from python + self.assertEqual(obj.add(123), 123) + self.assertEqual(obj.x, 1 + 123) + self.assertEqual(obj.y, 2 + 123) + + # Setter from python + obj.x = 333 + obj.y = 444 + obj.arr = newarr = np.arange(5, dtype=np.float32) + self.assertEqual(obj.x, 333) + self.assertEqual(obj.y, 444) + self.assertIs(obj.arr, newarr) + + def test_jitclass_datalayout(self): + spec = OrderedDict() + # Boolean has different layout as value vs data + spec["val"] = boolean + + @jitclass(spec) + class Foo(object): + + def __init__(self, val): + self.val = val + + self.assertTrue(Foo(True).val) + self.assertFalse(Foo(False).val) + + def test_deferred_type(self): + node_type = deferred_type() + + spec = OrderedDict() + spec["data"] = float32 + spec["next"] = optional(node_type) + + @njit + def get_data(node): + return node.data + + @jitclass(spec) + class LinkedNode(object): + + def __init__(self, data, next): + self.data = data + self.next = next + + def get_next_data(self): + # use deferred type as argument + return get_data(self.next) + + def append_to_tail(self, other): + cur = self + while cur.next is not None: + cur = cur.next + cur.next = other + + node_type.define(LinkedNode.class_type.instance_type) + + first = LinkedNode(123, None) + self.assertEqual(first.data, 123) + self.assertIsNone(first.next) + + second = LinkedNode(321, first) + + first_meminfo = _get_meminfo(first) + second_meminfo = _get_meminfo(second) + self.assertEqual(first_meminfo.refcount, 3) + self.assertEqual(second.next.data, first.data) + self.assertEqual(first_meminfo.refcount, 3) + self.assertEqual(second_meminfo.refcount, 2) + + # Test using deferred type as argument + first_val = second.get_next_data() + self.assertEqual(first_val, first.data) + + # Check setattr (issue #2606) + self.assertIsNone(first.next) + second.append_to_tail(LinkedNode(567, None)) + self.assertIsNotNone(first.next) + self.assertEqual(first.next.data, 567) + self.assertIsNone(first.next.next) + second.append_to_tail(LinkedNode(678, None)) + self.assertIsNotNone(first.next.next) + self.assertEqual(first.next.next.data, 678) + + # Check ownership + self.assertEqual(first_meminfo.refcount, 3) + del second, second_meminfo + self.assertEqual(first_meminfo.refcount, 2) + + def test_c_structure(self): + spec = OrderedDict() + spec["a"] = int32 + spec["b"] = int16 + spec["c"] = float64 + + @jitclass(spec) + class Struct(object): + + def __init__(self, a, b, c): + self.a = a + self.b = b + self.c = c + + st = Struct(0xabcd, 0xef, 3.1415) + + class CStruct(ctypes.Structure): + _fields_ = [ + ("a", ctypes.c_int32), + ("b", ctypes.c_int16), + ("c", ctypes.c_double), + ] + + ptr = ctypes.c_void_p(_box.box_get_dataptr(st)) + cstruct = ctypes.cast(ptr, ctypes.POINTER(CStruct))[0] + self.assertEqual(cstruct.a, st.a) + self.assertEqual(cstruct.b, st.b) + self.assertEqual(cstruct.c, st.c) + + def test_is(self): + Vector = self._make_Vector2() + vec_a = Vector(1, 2) + + @njit + def do_is(a, b): + return a is b + + with self.assertRaises(LoweringError) as raises: + # trigger compilation + do_is(vec_a, vec_a) + self.assertIn("no default `is` implementation", str(raises.exception)) + + def test_isinstance(self): + Vector2 = self._make_Vector2() + vec = Vector2(1, 2) + self.assertIsInstance(vec, Vector2) + + def test_subclassing(self): + Vector2 = self._make_Vector2() + with self.assertRaises(TypeError) as raises: + class SubV(Vector2): + pass + self.assertEqual(str(raises.exception), + "cannot subclass from a jitclass") + + def test_base_class(self): + class Base(object): + + def what(self): + return self.attr + + @jitclass([("attr", int32)]) + class Test(Base): + + def __init__(self, attr): + self.attr = attr + + obj = Test(123) + self.assertEqual(obj.what(), 123) + + def test_globals(self): + + class Mine(object): + constant = 123 + + def __init__(self): + pass + + with self.assertRaises(TypeError) as raises: + jitclass(Mine) + + self.assertEqual(str(raises.exception), + "class members are not yet supported: constant") + + def test_user_getter_setter(self): + @jitclass([("attr", int32)]) + class Foo(object): + + def __init__(self, attr): + self.attr = attr + + @property + def value(self): + return self.attr + 1 + + @value.setter + def value(self, val): + self.attr = val - 1 + + foo = Foo(123) + self.assertEqual(foo.attr, 123) + # Getter + self.assertEqual(foo.value, 123 + 1) + # Setter + foo.value = 789 + self.assertEqual(foo.attr, 789 - 1) + self.assertEqual(foo.value, 789) + + # Test nopython mode usage of getter and setter + @njit + def bar(foo, val): + a = foo.value + foo.value = val + b = foo.value + c = foo.attr + return a, b, c + + a, b, c = bar(foo, 567) + self.assertEqual(a, 789) + self.assertEqual(b, 567) + self.assertEqual(c, 567 - 1) + + def test_user_deleter_error(self): + class Foo(object): + + def __init__(self): + pass + + @property + def value(self): + return 1 + + @value.deleter + def value(self): + pass + + with self.assertRaises(TypeError) as raises: + jitclass(Foo) + self.assertEqual(str(raises.exception), + "deleter is not supported: value") + + def test_name_shadowing_error(self): + class Foo(object): + + def __init__(self): + pass + + @property + def my_property(self): + pass + + def my_method(self): + pass + + with self.assertRaises(NameError) as raises: + jitclass(Foo, [("my_property", int32)]) + self.assertEqual(str(raises.exception), "name shadowing: my_property") + + with self.assertRaises(NameError) as raises: + jitclass(Foo, [("my_method", int32)]) + self.assertEqual(str(raises.exception), "name shadowing: my_method") + + def test_distinct_classes(self): + # Different classes with the same names shouldn't confuse the compiler + @jitclass([("x", int32)]) + class Foo(object): + + def __init__(self, x): + self.x = x + 2 + + def run(self): + return self.x + 1 + + FirstFoo = Foo + + @jitclass([("x", int32)]) + class Foo(object): + + def __init__(self, x): + self.x = x - 2 + + def run(self): + return self.x - 1 + + SecondFoo = Foo + foo = FirstFoo(5) + self.assertEqual(foo.x, 7) + self.assertEqual(foo.run(), 8) + foo = SecondFoo(5) + self.assertEqual(foo.x, 3) + self.assertEqual(foo.run(), 2) + + def test_parameterized(self): + class MyClass(object): + + def __init__(self, value): + self.value = value + + def create_my_class(value): + cls = jitclass(MyClass, [("value", typeof(value))]) + return cls(value) + + a = create_my_class(123) + self.assertEqual(a.value, 123) + + b = create_my_class(12.3) + self.assertEqual(b.value, 12.3) + + c = create_my_class(np.array([123])) + np.testing.assert_equal(c.value, [123]) + + d = create_my_class(np.array([12.3])) + np.testing.assert_equal(d.value, [12.3]) + + def test_protected_attrs(self): + spec = { + "value": int32, + "_value": float32, + "__value": int32, + "__value__": int32, + } + + @jitclass(spec) + class MyClass(object): + + def __init__(self, value): + self.value = value + self._value = value / 2 + self.__value = value * 2 + self.__value__ = value - 1 + + @property + def private_value(self): + return self.__value + + @property + def _inner_value(self): + return self._value + + @_inner_value.setter + def _inner_value(self, v): + self._value = v + + @property + def __private_value(self): + return self.__value + + @__private_value.setter + def __private_value(self, v): + self.__value = v + + def swap_private_value(self, new): + old = self.__private_value + self.__private_value = new + return old + + def _protected_method(self, factor): + return self._value * factor + + def __private_method(self, factor): + return self.__value * factor + + def check_private_method(self, factor): + return self.__private_method(factor) + + value = 123 + inst = MyClass(value) + # test attributes + self.assertEqual(inst.value, value) + self.assertEqual(inst._value, value / 2) + self.assertEqual(inst.private_value, value * 2) + # test properties + self.assertEqual(inst._inner_value, inst._value) + freeze_inst_value = inst._value + inst._inner_value -= 1 + self.assertEqual(inst._inner_value, freeze_inst_value - 1) + + self.assertEqual(inst.swap_private_value(321), value * 2) + self.assertEqual(inst.swap_private_value(value * 2), 321) + # test methods + self.assertEqual(inst._protected_method(3), inst._value * 3) + self.assertEqual(inst.check_private_method(3), inst.private_value * 3) + # test special + self.assertEqual(inst.__value__, value - 1) + inst.__value__ -= 100 + self.assertEqual(inst.__value__, value - 101) + + # test errors + @njit + def access_dunder(inst): + return inst.__value + + with self.assertRaises(errors.TypingError) as raises: + access_dunder(inst) + # It will appear as "_TestJitClass__value" because the `access_dunder` + # is under the scope of "TestJitClass". + self.assertIn("_TestJitClass__value", str(raises.exception)) + + with self.assertRaises(AttributeError) as raises: + access_dunder.py_func(inst) + self.assertIn("_TestJitClass__value", str(raises.exception)) + + @skip_if_typeguard + def test_annotations(self): + """ + Methods with annotations should compile fine (issue #1911). + """ + from .annotation_usecases import AnnotatedClass + + spec = {"x": int32} + cls = jitclass(AnnotatedClass, spec) + + obj = cls(5) + self.assertEqual(obj.x, 5) + self.assertEqual(obj.add(2), 7) + + def test_docstring(self): + + @jitclass + class Apple(object): + "Class docstring" + + def __init__(self): + "init docstring" + + def foo(self): + "foo method docstring" + + @property + def aval(self): + "aval property docstring" + + self.assertEqual(Apple.__doc__, "Class docstring") + self.assertEqual(Apple.__init__.__doc__, "init docstring") + self.assertEqual(Apple.foo.__doc__, "foo method docstring") + self.assertEqual(Apple.aval.__doc__, "aval property docstring") + + def test_kwargs(self): + spec = [("a", int32), + ("b", float64)] + + @jitclass(spec) + class TestClass(object): + def __init__(self, x, y, z): + self.a = x * y + self.b = z + + x = 2 + y = 2 + z = 1.1 + kwargs = {"y": y, "z": z} + tc = TestClass(x=2, **kwargs) + self.assertEqual(tc.a, x * y) + self.assertEqual(tc.b, z) + + def test_default_args(self): + spec = [("x", int32), + ("y", int32), + ("z", int32)] + + @jitclass(spec) + class TestClass(object): + def __init__(self, x, y, z=1): + self.x = x + self.y = y + self.z = z + + tc = TestClass(1, 2, 3) + self.assertEqual(tc.x, 1) + self.assertEqual(tc.y, 2) + self.assertEqual(tc.z, 3) + + tc = TestClass(1, 2) + self.assertEqual(tc.x, 1) + self.assertEqual(tc.y, 2) + self.assertEqual(tc.z, 1) + + tc = TestClass(y=2, z=5, x=1) + self.assertEqual(tc.x, 1) + self.assertEqual(tc.y, 2) + self.assertEqual(tc.z, 5) + + def test_default_args_keyonly(self): + spec = [("x", int32), + ("y", int32), + ("z", int32), + ("a", int32)] + + TestClass = jitclass(TestClass1, spec) + + tc = TestClass(2, 3) + self.assertEqual(tc.x, 2) + self.assertEqual(tc.y, 3) + self.assertEqual(tc.z, 1) + self.assertEqual(tc.a, 5) + + tc = TestClass(y=4, x=2, a=42, z=100) + self.assertEqual(tc.x, 2) + self.assertEqual(tc.y, 4) + self.assertEqual(tc.z, 100) + self.assertEqual(tc.a, 42) + + tc = TestClass(y=4, x=2, a=42) + self.assertEqual(tc.x, 2) + self.assertEqual(tc.y, 4) + self.assertEqual(tc.z, 1) + self.assertEqual(tc.a, 42) + + tc = TestClass(y=4, x=2) + self.assertEqual(tc.x, 2) + self.assertEqual(tc.y, 4) + self.assertEqual(tc.z, 1) + self.assertEqual(tc.a, 5) + + def test_default_args_starargs_and_keyonly(self): + spec = [("x", int32), + ("y", int32), + ("z", int32), + ("args", types.UniTuple(int32, 2)), + ("a", int32)] + + with self.assertRaises(errors.UnsupportedError) as raises: + jitclass(TestClass2, spec) + + msg = "VAR_POSITIONAL argument type unsupported" + self.assertIn(msg, str(raises.exception)) + + def test_generator_method(self): + spec = [] + + @jitclass(spec) + class TestClass(object): + def __init__(self): + pass + + def gen(self, niter): + for i in range(niter): + yield np.arange(i) + + def expected_gen(niter): + for i in range(niter): + yield np.arange(i) + + for niter in range(10): + for expect, got in zip(expected_gen(niter), TestClass().gen(niter)): + self.assertPreciseEqual(expect, got) + + def test_getitem(self): + spec = [("data", int32[:])] + + @jitclass(spec) + class TestClass(object): + def __init__(self): + self.data = np.zeros(10, dtype=np.int32) + + def __setitem__(self, key, data): + self.data[key] = data + + def __getitem__(self, key): + return self.data[key] + + @njit + def create_and_set_indices(): + t = TestClass() + t[1] = 1 + t[2] = 2 + t[3] = 3 + return t + + @njit + def get_index(t, n): + return t[n] + + t = create_and_set_indices() + self.assertEqual(get_index(t, 1), 1) + self.assertEqual(get_index(t, 2), 2) + self.assertEqual(get_index(t, 3), 3) + + def test_getitem_unbox(self): + spec = [("data", int32[:])] + + @jitclass(spec) + class TestClass(object): + def __init__(self): + self.data = np.zeros(10, dtype=np.int32) + + def __setitem__(self, key, data): + self.data[key] = data + + def __getitem__(self, key): + return self.data[key] + + t = TestClass() + t[1] = 10 + + @njit + def set2return1(t): + t[2] = 20 + return t[1] + + t_1 = set2return1(t) + self.assertEqual(t_1, 10) + self.assertEqual(t[2], 20) + + def test_getitem_complex_key(self): + spec = [("data", int32[:, :])] + + @jitclass(spec) + class TestClass(object): + def __init__(self): + self.data = np.zeros((10, 10), dtype=np.int32) + + def __setitem__(self, key, data): + self.data[int(key.real), int(key.imag)] = data + + def __getitem__(self, key): + return self.data[int(key.real), int(key.imag)] + + t = TestClass() + + t[complex(1, 1)] = 3 + + @njit + def get_key(t, real, imag): + return t[complex(real, imag)] + + @njit + def set_key(t, real, imag, data): + t[complex(real, imag)] = data + + self.assertEqual(get_key(t, 1, 1), 3) + set_key(t, 2, 2, 4) + self.assertEqual(t[complex(2, 2)], 4) + + def test_getitem_tuple_key(self): + spec = [("data", int32[:, :])] + + @jitclass(spec) + class TestClass(object): + def __init__(self): + self.data = np.zeros((10, 10), dtype=np.int32) + + def __setitem__(self, key, data): + self.data[key[0], key[1]] = data + + def __getitem__(self, key): + return self.data[key[0], key[1]] + + t = TestClass() + t[1, 1] = 11 + + @njit + def get11(t): + return t[1, 1] + + @njit + def set22(t, data): + t[2, 2] = data + + self.assertEqual(get11(t), 11) + set22(t, 22) + self.assertEqual(t[2, 2], 22) + + def test_getitem_slice_key(self): + spec = [("data", int32[:])] + + @jitclass(spec) + class TestClass(object): + def __init__(self): + self.data = np.zeros(10, dtype=np.int32) + + def __setitem__(self, slc, data): + self.data[slc.start] = data + self.data[slc.stop] = data + slc.step + + def __getitem__(self, slc): + return self.data[slc.start] + + t = TestClass() + # set t.data[1] = 1 and t.data[5] = 2 + t[1:5:1] = 1 + + self.assertEqual(t[1:1:1], 1) + self.assertEqual(t[5:5:5], 2) + + @njit + def get5(t): + return t[5:6:1] + + self.assertEqual(get5(t), 2) + + # sets t.data[2] = data, and t.data[6] = data + 1 + @njit + def set26(t, data): + t[2:6:1] = data + + set26(t, 2) + self.assertEqual(t[2:2:1], 2) + self.assertEqual(t[6:6:1], 3) + + def test_jitclass_longlabel_not_truncated(self): + # See issue #3872, llvm 7 introduced a max label length of 1024 chars + # Numba ships patched llvm 7.1 (ppc64le) and patched llvm 8 to undo this + # change, this test is here to make sure long labels are ok: + alphabet = [chr(ord("a") + x) for x in range(26)] + + spec = [(letter * 10, float64) for letter in alphabet] + spec.extend([(letter.upper() * 10, float64) for letter in alphabet]) + + @jitclass(spec) + class TruncatedLabel(object): + def __init__(self,): + self.aaaaaaaaaa = 10. + + def meth1(self): + self.bbbbbbbbbb = random.gauss(self.aaaaaaaaaa, self.aaaaaaaaaa) + + def meth2(self): + self.meth1() + + # unpatched LLVMs will raise here... + TruncatedLabel().meth2() + + def test_pickling(self): + @jitclass + class PickleTestSubject(object): + def __init__(self): + pass + + inst = PickleTestSubject() + ty = typeof(inst) + self.assertIsInstance(ty, types.ClassInstanceType) + pickled = pickle.dumps(ty) + self.assertIs(pickle.loads(pickled), ty) + + def test_static_methods(self): + @jitclass([("x", int32)]) + class Test1: + def __init__(self, x): + self.x = x + + def increase(self, y): + self.x = self.add(self.x, y) + return self.x + + @staticmethod + def add(a, b): + return a + b + + @staticmethod + def sub(a, b): + return a - b + + @jitclass([("x", int32)]) + class Test2: + def __init__(self, x): + self.x = x + + def increase(self, y): + self.x = self.add(self.x, y) + return self.x + + @staticmethod + def add(a, b): + return a - b + + self.assertIsInstance(Test1.add, Dispatcher) + self.assertIsInstance(Test1.sub, Dispatcher) + self.assertIsInstance(Test2.add, Dispatcher) + self.assertNotEqual(Test1.add, Test2.add) + + self.assertEqual(3, Test1.add(1, 2)) + self.assertEqual(-1, Test2.add(1, 2)) + self.assertEqual(4, Test1.sub(6, 2)) + + t1 = Test1(0) + t2 = Test2(0) + self.assertEqual(1, t1.increase(1)) + self.assertEqual(-1, t2.increase(1)) + self.assertEqual(2, t1.add(1, 1)) + self.assertEqual(0, t1.sub(1, 1)) + self.assertEqual(0, t2.add(1, 1)) + self.assertEqual(2j, t1.add(1j, 1j)) + self.assertEqual(1j, t1.sub(2j, 1j)) + self.assertEqual("foobar", t1.add("foo", "bar")) + + with self.assertRaises(AttributeError) as raises: + Test2.sub(3, 1) + self.assertIn("has no attribute 'sub'", + str(raises.exception)) + + with self.assertRaises(TypeError) as raises: + Test1.add(3) + self.assertIn("not enough arguments: expected 2, got 1", + str(raises.exception)) + + # Check error message for calling a static method as a class attr from + # another method (currently unsupported). + + @jitclass([]) + class Test3: + def __init__(self): + pass + + @staticmethod + def a_static_method(a, b): + pass + + def call_static(self): + return Test3.a_static_method(1, 2) + + invalid = Test3() + with self.assertRaises(errors.TypingError) as raises: + invalid.call_static() + + self.assertIn("Unknown attribute 'a_static_method'", + str(raises.exception)) + + def test_jitclass_decorator_usecases(self): + spec = OrderedDict(x=float64) + + @jitclass() + class Test1: + x: float + + def __init__(self): + self.x = 0 + + self.assertIsInstance(Test1, JitClassType) + self.assertDictEqual(Test1.class_type.struct, spec) + + @jitclass(spec=spec) + class Test2: + + def __init__(self): + self.x = 0 + + self.assertIsInstance(Test2, JitClassType) + self.assertDictEqual(Test2.class_type.struct, spec) + + @jitclass + class Test3: + x: float + + def __init__(self): + self.x = 0 + + self.assertIsInstance(Test3, JitClassType) + self.assertDictEqual(Test3.class_type.struct, spec) + + @jitclass(spec) + class Test4: + + def __init__(self): + self.x = 0 + + self.assertIsInstance(Test4, JitClassType) + self.assertDictEqual(Test4.class_type.struct, spec) + + def test_jitclass_function_usecases(self): + spec = OrderedDict(x=float64) + + class AnnotatedTest: + x: float + + def __init__(self): + self.x = 0 + + JitTest1 = jitclass(AnnotatedTest) + self.assertIsInstance(JitTest1, JitClassType) + self.assertDictEqual(JitTest1.class_type.struct, spec) + + class UnannotatedTest: + + def __init__(self): + self.x = 0 + + JitTest2 = jitclass(UnannotatedTest, spec) + self.assertIsInstance(JitTest2, JitClassType) + self.assertDictEqual(JitTest2.class_type.struct, spec) + + def test_jitclass_isinstance(self): + spec = OrderedDict(value=int32) + + @jitclass(spec) + class Foo(object): + def __init__(self, value): + self.value = value + + def getValue(self): + return self.value + + def getValueIncr(self): + return self.value + 1 + + @jitclass(spec) + class Bar(object): + def __init__(self, value): + self.value = value + + def getValue(self): + return self.value + + def test_jitclass_isinstance(obj): + if isinstance(obj, (Foo, Bar)): + # call something that both classes implements + x = obj.getValue() + if isinstance(obj, Foo): # something that only Foo implements + return obj.getValueIncr() + x, 'Foo' + else: + return obj.getValue() + x, 'Bar' + else: + return 'no match' + + pyfunc = test_jitclass_isinstance + cfunc = njit(test_jitclass_isinstance) + + self.assertIsInstance(Foo, JitClassType) + self.assertEqual(pyfunc(Foo(3)), cfunc(Foo(3))) + self.assertEqual(pyfunc(Bar(123)), cfunc(Bar(123))) + self.assertEqual(pyfunc(0), cfunc(0)) + + def test_jitclass_unsupported_dunder(self): + with self.assertRaises(TypeError) as e: + @jitclass + class Foo(object): + def __init__(self): + return + + def __enter__(self): + return None + Foo() + self.assertIn("Method '__enter__' is not supported.", str(e.exception)) + + def test_modulename(self): + @jitclass + class TestModname(object): + def __init__(self): + self.x = 12 + + thisModule = __name__ + classModule = TestModname.__module__ + self.assertEqual(thisModule, classModule) + + +class TestJitClassOverloads(MemoryLeakMixin, TestCase): + + class PyList: + def __init__(self): + self.x = [0] + + def append(self, y): + self.x.append(y) + + def clear(self): + self.x.clear() + + def __abs__(self): + return len(self.x) * 7 + + def __bool__(self): + return len(self.x) % 3 != 0 + + def __complex__(self): + c = complex(2) + if self.x: + c += self.x[0] + return c + + def __contains__(self, y): + return y in self.x + + def __float__(self): + f = 3.1415 + if self.x: + f += self.x[0] + return f + + def __int__(self): + i = 5 + if self.x: + i += self.x[0] + return i + + def __len__(self): + return len(self.x) + 1 + + def __str__(self): + if len(self.x) == 0: + return "PyList empty" + else: + return "PyList non-empty" + + @staticmethod + def get_int_wrapper(): + @jitclass([("x", types.intp)]) + class IntWrapper: + def __init__(self, value): + self.x = value + + def __eq__(self, other): + return self.x == other.x + + def __hash__(self): + return self.x + + def __lshift__(self, other): + return IntWrapper(self.x << other.x) + + def __rshift__(self, other): + return IntWrapper(self.x >> other.x) + + def __and__(self, other): + return IntWrapper(self.x & other.x) + + def __or__(self, other): + return IntWrapper(self.x | other.x) + + def __xor__(self, other): + return IntWrapper(self.x ^ other.x) + + return IntWrapper + + @staticmethod + def get_float_wrapper(): + @jitclass([("x", types.float64)]) + class FloatWrapper: + + def __init__(self, value): + self.x = value + + def __eq__(self, other): + return self.x == other.x + + def __hash__(self): + return self.x + + def __ge__(self, other): + return self.x >= other.x + + def __gt__(self, other): + return self.x > other.x + + def __le__(self, other): + return self.x <= other.x + + def __lt__(self, other): + return self.x < other.x + + def __add__(self, other): + return FloatWrapper(self.x + other.x) + + def __floordiv__(self, other): + return FloatWrapper(self.x // other.x) + + def __mod__(self, other): + return FloatWrapper(self.x % other.x) + + def __mul__(self, other): + return FloatWrapper(self.x * other.x) + + def __neg__(self, other): + return FloatWrapper(-self.x) + + def __pos__(self, other): + return FloatWrapper(+self.x) + + def __pow__(self, other): + return FloatWrapper(self.x ** other.x) + + def __sub__(self, other): + return FloatWrapper(self.x - other.x) + + def __truediv__(self, other): + return FloatWrapper(self.x / other.x) + + return FloatWrapper + + def assertSame(self, first, second, msg=None): + self.assertEqual(type(first), type(second), msg=msg) + self.assertEqual(first, second, msg=msg) + + def test_overloads(self): + # Check that the dunder methods are exposed on ClassInstanceType. + + JitList = jitclass({"x": types.List(types.intp)})(self.PyList) + + py_funcs = [ + lambda x: abs(x), + lambda x: x.__abs__(), + lambda x: bool(x), + lambda x: x.__bool__(), + lambda x: complex(x), + lambda x: x.__complex__(), + lambda x: 0 in x, # contains + lambda x: x.__contains__(0), + lambda x: float(x), + lambda x: x.__float__(), + lambda x: int(x), + lambda x: x.__int__(), + lambda x: len(x), + lambda x: x.__len__(), + lambda x: str(x), + lambda x: x.__str__(), + lambda x: 1 if x else 0, # truth + ] + jit_funcs = [njit(f) for f in py_funcs] + + py_list = self.PyList() + jit_list = JitList() + for py_f, jit_f in zip(py_funcs, jit_funcs): + self.assertSame(py_f(py_list), py_f(jit_list)) + self.assertSame(py_f(py_list), jit_f(jit_list)) + + py_list.append(2) + jit_list.append(2) + for py_f, jit_f in zip(py_funcs, jit_funcs): + self.assertSame(py_f(py_list), py_f(jit_list)) + self.assertSame(py_f(py_list), jit_f(jit_list)) + + py_list.append(-5) + jit_list.append(-5) + for py_f, jit_f in zip(py_funcs, jit_funcs): + self.assertSame(py_f(py_list), py_f(jit_list)) + self.assertSame(py_f(py_list), jit_f(jit_list)) + + py_list.clear() + jit_list.clear() + for py_f, jit_f in zip(py_funcs, jit_funcs): + self.assertSame(py_f(py_list), py_f(jit_list)) + self.assertSame(py_f(py_list), jit_f(jit_list)) + + def test_bool_fallback(self): + + def py_b(x): + return bool(x) + + jit_b = njit(py_b) + + @jitclass([("x", types.List(types.intp))]) + class LenClass: + def __init__(self, x): + self.x = x + + def __len__(self): + return len(self.x) % 4 + + def append(self, y): + self.x.append(y) + + def pop(self): + self.x.pop(0) + + obj = LenClass([1, 2, 3]) + self.assertTrue(py_b(obj)) + self.assertTrue(jit_b(obj)) + + obj.append(4) + self.assertFalse(py_b(obj)) + self.assertFalse(jit_b(obj)) + + obj.pop() + self.assertTrue(py_b(obj)) + self.assertTrue(jit_b(obj)) + + @jitclass([("y", types.float64)]) + class NormalClass: + def __init__(self, y): + self.y = y + + obj = NormalClass(0) + self.assertTrue(py_b(obj)) + self.assertTrue(jit_b(obj)) + + def test_numeric_fallback(self): + def py_c(x): + return complex(x) + + def py_f(x): + return float(x) + + def py_i(x): + return int(x) + + jit_c = njit(py_c) + jit_f = njit(py_f) + jit_i = njit(py_i) + + @jitclass([]) + class FloatClass: + def __init__(self): + pass + + def __float__(self): + return 3.1415 + + obj = FloatClass() + self.assertSame(py_c(obj), complex(3.1415)) + self.assertSame(jit_c(obj), complex(3.1415)) + self.assertSame(py_f(obj), 3.1415) + self.assertSame(jit_f(obj), 3.1415) + + with self.assertRaises(TypeError) as e: + py_i(obj) + self.assertIn("int", str(e.exception)) + with self.assertRaises(TypingError) as e: + jit_i(obj) + self.assertIn("int", str(e.exception)) + + @jitclass([]) + class IntClass: + def __init__(self): + pass + + def __int__(self): + return 7 + + obj = IntClass() + self.assertSame(py_i(obj), 7) + self.assertSame(jit_i(obj), 7) + + with self.assertRaises(TypeError) as e: + py_c(obj) + self.assertIn("complex", str(e.exception)) + with self.assertRaises(TypingError) as e: + jit_c(obj) + self.assertIn("complex", str(e.exception)) + with self.assertRaises(TypeError) as e: + py_f(obj) + self.assertIn("float", str(e.exception)) + with self.assertRaises(TypingError) as e: + jit_f(obj) + self.assertIn("float", str(e.exception)) + + @jitclass([]) + class IndexClass: + def __init__(self): + pass + + def __index__(self): + return 1 + + obj = IndexClass() + + self.assertSame(py_c(obj), complex(1)) + self.assertSame(jit_c(obj), complex(1)) + self.assertSame(py_f(obj), 1.) + self.assertSame(jit_f(obj), 1.) + self.assertSame(py_i(obj), 1) + self.assertSame(jit_i(obj), 1) + + @jitclass([]) + class FloatIntIndexClass: + def __init__(self): + pass + + def __float__(self): + return 3.1415 + + def __int__(self): + return 7 + + def __index__(self): + return 1 + + obj = FloatIntIndexClass() + self.assertSame(py_c(obj), complex(3.1415)) + self.assertSame(jit_c(obj), complex(3.1415)) + self.assertSame(py_f(obj), 3.1415) + self.assertSame(jit_f(obj), 3.1415) + self.assertSame(py_i(obj), 7) + self.assertSame(jit_i(obj), 7) + + def test_arithmetic_logical(self): + IntWrapper = self.get_int_wrapper() + FloatWrapper = self.get_float_wrapper() + + float_py_funcs = [ + lambda x, y: x == y, + lambda x, y: x != y, + lambda x, y: x >= y, + lambda x, y: x > y, + lambda x, y: x <= y, + lambda x, y: x < y, + lambda x, y: x + y, + lambda x, y: x // y, + lambda x, y: x % y, + lambda x, y: x * y, + lambda x, y: x ** y, + lambda x, y: x - y, + lambda x, y: x / y, + ] + int_py_funcs = [ + lambda x, y: x == y, + lambda x, y: x != y, + lambda x, y: x << y, + lambda x, y: x >> y, + lambda x, y: x & y, + lambda x, y: x | y, + lambda x, y: x ^ y, + ] + + test_values = [ + (0.0, 2.0), + (1.234, 3.1415), + (13.1, 1.01), + ] + + def unwrap(value): + return getattr(value, "x", value) + + for jit_f, (x, y) in itertools.product( + map(njit, float_py_funcs), test_values): + + py_f = jit_f.py_func + + expected = py_f(x, y) + jit_x = FloatWrapper(x) + jit_y = FloatWrapper(y) + + check = ( + self.assertEqual + if type(expected) is not float + else self.assertAlmostEqual + ) + check(expected, jit_f(x, y)) + check(expected, unwrap(py_f(jit_x, jit_y))) + check(expected, unwrap(jit_f(jit_x, jit_y))) + + for jit_f, (x, y) in itertools.product( + map(njit, int_py_funcs), test_values): + + py_f = jit_f.py_func + x, y = int(x), int(y) + + expected = py_f(x, y) + jit_x = IntWrapper(x) + jit_y = IntWrapper(y) + + self.assertEqual(expected, jit_f(x, y)) + self.assertEqual(expected, unwrap(py_f(jit_x, jit_y))) + self.assertEqual(expected, unwrap(jit_f(jit_x, jit_y))) + + def test_arithmetic_logical_inplace(self): + + # If __i*__ methods are not defined, should fall back to normal methods. + JitIntWrapper = self.get_int_wrapper() + JitFloatWrapper = self.get_float_wrapper() + + PyIntWrapper = JitIntWrapper.mro()[1] + PyFloatWrapper = JitFloatWrapper.mro()[1] + + @jitclass([("x", types.intp)]) + class JitIntUpdateWrapper(PyIntWrapper): + def __init__(self, value): + self.x = value + + def __ilshift__(self, other): + return JitIntUpdateWrapper(self.x << other.x) + + def __irshift__(self, other): + return JitIntUpdateWrapper(self.x >> other.x) + + def __iand__(self, other): + return JitIntUpdateWrapper(self.x & other.x) + + def __ior__(self, other): + return JitIntUpdateWrapper(self.x | other.x) + + def __ixor__(self, other): + return JitIntUpdateWrapper(self.x ^ other.x) + + @jitclass({"x": types.float64}) + class JitFloatUpdateWrapper(PyFloatWrapper): + + def __init__(self, value): + self.x = value + + def __iadd__(self, other): + return JitFloatUpdateWrapper(self.x + 2.718 * other.x) + + def __ifloordiv__(self, other): + return JitFloatUpdateWrapper(self.x * 2.718 // other.x) + + def __imod__(self, other): + return JitFloatUpdateWrapper(self.x % (other.x + 1)) + + def __imul__(self, other): + return JitFloatUpdateWrapper(self.x * other.x + 1) + + def __ipow__(self, other): + return JitFloatUpdateWrapper(self.x ** other.x + 1) + + def __isub__(self, other): + return JitFloatUpdateWrapper(self.x - 3.1415 * other.x) + + def __itruediv__(self, other): + return JitFloatUpdateWrapper((self.x + 1) / other.x) + + PyIntUpdateWrapper = JitIntUpdateWrapper.mro()[1] + PyFloatUpdateWrapper = JitFloatUpdateWrapper.mro()[1] + + def get_update_func(op): + template = f""" +def f(x, y): + x {op}= y + return x +""" + namespace = {} + exec(template, namespace) + return namespace["f"] + + float_py_funcs = [get_update_func(op) for op in [ + "+", "//", "%", "*", "**", "-", "/", + ]] + int_py_funcs = [get_update_func(op) for op in [ + "<<", ">>", "&", "|", "^", + ]] + + test_values = [ + (0.0, 2.0), + (1.234, 3.1415), + (13.1, 1.01), + ] + + for jit_f, (py_cls, jit_cls), (x, y) in itertools.product( + map(njit, float_py_funcs), + [ + (PyFloatWrapper, JitFloatWrapper), + (PyFloatUpdateWrapper, JitFloatUpdateWrapper) + ], + test_values): + py_f = jit_f.py_func + + expected = py_f(py_cls(x), py_cls(y)).x + self.assertAlmostEqual(expected, py_f(jit_cls(x), jit_cls(y)).x) + self.assertAlmostEqual(expected, jit_f(jit_cls(x), jit_cls(y)).x) + + for jit_f, (py_cls, jit_cls), (x, y) in itertools.product( + map(njit, int_py_funcs), + [ + (PyIntWrapper, JitIntWrapper), + (PyIntUpdateWrapper, JitIntUpdateWrapper) + ], + test_values): + x, y = int(x), int(y) + py_f = jit_f.py_func + + expected = py_f(py_cls(x), py_cls(y)).x + self.assertEqual(expected, py_f(jit_cls(x), jit_cls(y)).x) + self.assertEqual(expected, jit_f(jit_cls(x), jit_cls(y)).x) + + def test_hash_eq_ne(self): + + class HashEqTest: + x: int + + def __init__(self, x): + self.x = x + + def __hash__(self): + return self.x % 10 + + def __eq__(self, o): + return (self.x - o.x) % 20 == 0 + + class HashEqNeTest(HashEqTest): + def __ne__(self, o): + return (self.x - o.x) % 20 > 1 + + def py_hash(x): + return hash(x) + + def py_eq(x, y): + return x == y + + def py_ne(x, y): + return x != y + + def identity_decorator(f): + return f + + comparisons = [ + (0, 1), # Will give different ne results. + (2, 22), + (7, 10), + (3, 3), + ] + + for base_cls, use_jit in itertools.product( + [HashEqTest, HashEqNeTest], [False, True] + ): + decorator = njit if use_jit else identity_decorator + hash_func = decorator(py_hash) + eq_func = decorator(py_eq) + ne_func = decorator(py_ne) + + jit_cls = jitclass(base_cls) + + for v in [0, 2, 10, 24, -8]: + self.assertEqual(hash_func(jit_cls(v)), v % 10) + + for x, y in comparisons: + self.assertEqual( + eq_func(jit_cls(x), jit_cls(y)), + base_cls(x) == base_cls(y), + ) + self.assertEqual( + ne_func(jit_cls(x), jit_cls(y)), + base_cls(x) != base_cls(y), + ) + + def test_bool_fallback_len(self): + # Check that the fallback to using len(obj) to determine truth of an + # object is implemented correctly as per + # https://docs.python.org/3/library/stdtypes.html#truth-value-testing + # + # Relevant points: + # + # "By default, an object is considered true unless its class defines + # either a __bool__() method that returns False or a __len__() method + # that returns zero, when called with the object." + # + # and: + # + # "Operations and built-in functions that have a Boolean result always + # return 0 or False for false and 1 or True for true, unless otherwise + # stated." + + class NoBoolHasLen: + def __init__(self, val): + self.val = val + + def __len__(self): + return self.val + + def get_bool(self): + return bool(self) + + py_class = NoBoolHasLen + jitted_class = jitclass([('val', types.int64)])(py_class) + + py_class_0_bool = py_class(0).get_bool() + py_class_2_bool = py_class(2).get_bool() + jitted_class_0_bool = jitted_class(0).get_bool() + jitted_class_2_bool = jitted_class(2).get_bool() + + # Truth values from bool(obj) should be equal + self.assertEqual(py_class_0_bool, jitted_class_0_bool) + self.assertEqual(py_class_2_bool, jitted_class_2_bool) + + # Truth values from bool(obj) should be the same type + self.assertEqual(type(py_class_0_bool), type(jitted_class_0_bool)) + self.assertEqual(type(py_class_2_bool), type(jitted_class_2_bool)) + + def test_bool_fallback_default(self): + # Similar to test_bool_fallback, but checks the case where there is no + # __bool__() or __len__() defined, so the object should always be True. + + class NoBoolNoLen: + def __init__(self): + pass + + def get_bool(self): + return bool(self) + + py_class = NoBoolNoLen + jitted_class = jitclass([])(py_class) + + py_class_bool = py_class().get_bool() + jitted_class_bool = jitted_class().get_bool() + + # Truth values from bool(obj) should be equal + self.assertEqual(py_class_bool, jitted_class_bool) + + # Truth values from bool(obj) should be the same type + self.assertEqual(type(py_class_bool), type(jitted_class_bool)) + + def test_operator_reflection(self): + class OperatorsDefined: + def __init__(self, x): + self.x = x + + def __eq__(self, other): + return self.x == other.x + + def __le__(self, other): + return self.x <= other.x + + def __lt__(self, other): + return self.x < other.x + + def __ge__(self, other): + return self.x >= other.x + + def __gt__(self, other): + return self.x > other.x + + class NoOperatorsDefined: + def __init__(self, x): + self.x = x + + spec = [('x', types.int32)] + JitOperatorsDefined = jitclass(spec)(OperatorsDefined) + JitNoOperatorsDefined = jitclass(spec)(NoOperatorsDefined) + + py_ops_defined = OperatorsDefined(2) + py_ops_not_defined = NoOperatorsDefined(3) + + jit_ops_defined = JitOperatorsDefined(2) + jit_ops_not_defined = JitNoOperatorsDefined(3) + + self.assertEqual(py_ops_not_defined == py_ops_defined, + jit_ops_not_defined == jit_ops_defined) + + self.assertEqual(py_ops_not_defined <= py_ops_defined, + jit_ops_not_defined <= jit_ops_defined) + + self.assertEqual(py_ops_not_defined < py_ops_defined, + jit_ops_not_defined < jit_ops_defined) + + self.assertEqual(py_ops_not_defined >= py_ops_defined, + jit_ops_not_defined >= jit_ops_defined) + + self.assertEqual(py_ops_not_defined > py_ops_defined, + jit_ops_not_defined > jit_ops_defined) + + @skip_unless_scipy + def test_matmul_operator(self): + class ArrayAt: + def __init__(self, array): + self.arr = array + + def __matmul__(self, other): + return self.arr @ other.arr + + def __rmatmul__(self, other): + return other.arr @ self.arr + + def __imatmul__(self, other): + self.arr = self.arr @ other.arr + return self + + class ArrayNoAt: + def __init__(self, array): + self.arr = array + + n = 3 + np.random.seed(1) + vec = np.random.random(size=(n,)) + mat = np.random.random(size=(n, n)) + + vector_noat = ArrayNoAt(vec) + vector_at = ArrayAt(vec) + jit_vector_noat = jitclass(ArrayNoAt, spec={"arr": float64[::1]})(vec) + jit_vector_at = jitclass(ArrayAt, spec={"arr": float64[::1]})(vec) + + matrix_noat = ArrayNoAt(mat) + matrix_at = ArrayAt(mat) + jit_matrix_noat = jitclass(ArrayNoAt, spec={"arr": float64[:,::1]})(mat) + jit_matrix_at = jitclass(ArrayAt, spec={"arr": float64[:,::1]})(mat) + + # __matmul__ + np.testing.assert_allclose(vector_at @ vector_noat, + jit_vector_at @ jit_vector_noat) + np.testing.assert_allclose(vector_at @ matrix_noat, + jit_vector_at @ jit_matrix_noat) + np.testing.assert_allclose(matrix_at @ vector_noat, + jit_matrix_at @ jit_vector_noat) + np.testing.assert_allclose(matrix_at @ matrix_noat, + jit_matrix_at @ jit_matrix_noat) + + # __rmatmul__ + np.testing.assert_allclose(vector_noat @ vector_at, + jit_vector_noat @ jit_vector_at) + np.testing.assert_allclose(vector_noat @ matrix_at, + jit_vector_noat @ jit_matrix_at) + np.testing.assert_allclose(matrix_noat @ vector_at, + jit_matrix_noat @ jit_vector_at) + np.testing.assert_allclose(matrix_noat @ matrix_at, + jit_matrix_noat @ jit_matrix_at) + + # __imatmul__ + vector_at @= matrix_noat + matrix_at @= matrix_noat + jit_vector_at @= jit_matrix_noat + jit_matrix_at @= jit_matrix_noat + + np.testing.assert_allclose(vector_at.arr, jit_vector_at.arr) + np.testing.assert_allclose(matrix_at.arr, jit_matrix_at.arr) + + def test_arithmetic_logical_reflection(self): + class OperatorsDefined: + def __init__(self, x): + self.x = x + + def __radd__(self, other): + return other.x + self.x + + def __rsub__(self, other): + return other.x - self.x + + def __rmul__(self, other): + return other.x * self.x + + def __rtruediv__(self, other): + return other.x / self.x + + def __rfloordiv__(self, other): + return other.x // self.x + + def __rmod__(self, other): + return other.x % self.x + + def __rpow__(self, other): + return other.x ** self.x + + def __rlshift__(self, other): + return other.x << self.x + + def __rrshift__(self, other): + return other.x >> self.x + + def __rand__(self, other): + return other.x & self.x + + def __rxor__(self, other): + return other.x ^ self.x + + def __ror__(self, other): + return other.x | self.x + + class NoOperatorsDefined: + def __init__(self, x): + self.x = x + + float_op = ["+", "-", "*", "**", "/", "//", "%"] + int_op = [*float_op, "<<", ">>" , "&", "^", "|"] + + for test_type, test_op, test_value in [ + (int32, int_op, (2, 4)), + (float64, float_op, (2., 4.)), + (float64[::1], float_op, + (np.array([1., 2., 4.]), np.array([20., -24., 1.]))) + ]: + spec = {"x": test_type} + JitOperatorsDefined = jitclass(OperatorsDefined, spec) + JitNoOperatorsDefined = jitclass(NoOperatorsDefined, spec) + + py_ops_defined = OperatorsDefined(test_value[0]) # noqa: F841 + py_ops_not_defined = NoOperatorsDefined(test_value[1]) # noqa: F841 + + jit_ops_defined = JitOperatorsDefined(test_value[0]) # noqa: F841 + jit_ops_not_defined = JitNoOperatorsDefined(test_value[1]) # noqa: F841 E501 + + for op in test_op: + if not ("array" in str(test_type)): + self.assertEqual( + eval(f"py_ops_not_defined {op} py_ops_defined"), + eval(f"jit_ops_not_defined {op} jit_ops_defined") + ) + else: + self.assertTupleEqual( + tuple(eval(f"py_ops_not_defined {op} py_ops_defined")), + tuple(eval(f"jit_ops_not_defined {op} jit_ops_defined")) + ) + + def test_implicit_hash_compiles(self): + # Ensure that classes with __hash__ implicitly defined as None due to + # the presence of __eq__ are correctly handled by ignoring the __hash__ + # class member. + class ImplicitHash: + def __init__(self): + pass + + def __eq__(self, other): + return False + + jitted = jitclass([])(ImplicitHash) + instance = jitted() + + self.assertFalse(instance == instance) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_jitmethod.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_jitmethod.py new file mode 100644 index 0000000000000000000000000000000000000000..437c45b6bbdf00b490b49b569e8ebbe05ce63ad3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_jitmethod.py @@ -0,0 +1,70 @@ +import unittest + +import numpy as np + +from numba import jit +from numba.tests.support import override_config + + +class TestJITMethod(unittest.TestCase): + def test_bound_jit_method_with_loop_lift(self): + class Something(object): + def __init__(self, x0): + self.x0 = x0 + + @jit(forceobj=True) + def method(self, x): + a = np.empty(shape=5, dtype=np.float32) + x0 = self.x0 + + for i in range(a.shape[0]): + a[i] = x0 * x + + return a + + something = Something(3) + np.testing.assert_array_equal(something.method(5), + np.array([15, 15, 15, 15, 15], dtype=np.float32)) + + # Check that loop lifting in nopython mode was successful + [cres] = something.method.overloads.values() + jitloop = cres.lifted[0] + [loopcres] = jitloop.overloads.values() + self.assertTrue(loopcres.fndesc.native) + + def test_unbound_jit_method(self): + class Something(object): + def __init__(self, x0): + self.x0 = x0 + + @jit(forceobj=True) + def method(self): + return self.x0 + + something = Something(3) + self.assertEqual(Something.method(something), 3) + + +class TestDisabledJIT(unittest.TestCase): + def test_decorated_function(self): + with override_config('DISABLE_JIT', True): + def method(x): + return x + jitted = jit(method) + + self.assertEqual(jitted, method) + self.assertEqual(10, method(10)) + self.assertEqual(10, jitted(10)) + + def test_decorated_function_with_kwargs(self): + with override_config('DISABLE_JIT', True): + def method(x): + return x + jitted = jit(nopython=True)(method) + + self.assertEqual(jitted, method) + self.assertEqual(10, method(10)) + self.assertEqual(10, jitted(10)) + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_linalg.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_linalg.py new file mode 100644 index 0000000000000000000000000000000000000000..2eb80ae08d1071bb61af49b7068f3a629d179549 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_linalg.py @@ -0,0 +1,2696 @@ +import contextlib +import gc +from itertools import product, cycle +import sys +import warnings +from numbers import Number, Integral +import platform + +import numpy as np + +from numba import jit, njit, typeof +from numba.core import errors +from numba.tests.support import (TestCase, tag, needs_lapack, needs_blas, + _is_armv7l, EnableNRTStatsMixin) +from .matmul_usecase import matmul_usecase +import unittest + + +def dot2(a, b): + return np.dot(a, b) + + +def dot3(a, b, out): + return np.dot(a, b, out=out) + + +def vdot(a, b): + return np.vdot(a, b) + + +class TestProduct(EnableNRTStatsMixin, TestCase): + """ + Tests for dot products. + """ + + dtypes = (np.float64, np.float32, np.complex128, np.complex64) + + def setUp(self): + # Collect leftovers from previous test cases before checking for leaks + gc.collect() + super(TestProduct, self).setUp() + + def sample_vector(self, n, dtype): + # Be careful to generate only exactly representable float values, + # to avoid rounding discrepancies between Numpy and Numba + base = np.arange(n) + if issubclass(dtype, np.complexfloating): + return (base * (1 - 0.5j) + 2j).astype(dtype) + else: + return (base * 0.5 - 1).astype(dtype) + + def sample_matrix(self, m, n, dtype): + return self.sample_vector(m * n, dtype).reshape((m, n)) + + @contextlib.contextmanager + def check_contiguity_warning(self, pyfunc): + """ + Check performance warning(s) for non-contiguity. + """ + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', errors.NumbaPerformanceWarning) + yield + self.assertGreaterEqual(len(w), 1) + self.assertIs(w[0].category, errors.NumbaPerformanceWarning) + self.assertIn("faster on contiguous arrays", str(w[0].message)) + self.assertEqual(w[0].filename, pyfunc.__code__.co_filename) + # This works because our functions are one-liners + self.assertEqual(w[0].lineno, pyfunc.__code__.co_firstlineno + 1) + + def check_func(self, pyfunc, cfunc, args): + with self.assertNoNRTLeak(): + expected = pyfunc(*args) + got = cfunc(*args) + self.assertPreciseEqual(got, expected, ignore_sign_on_zero=True) + del got, expected + + + def _aligned_copy(self, arr): + # This exists for armv7l because NumPy wants aligned arrays for the + # `out` arg of functions, but np.empty/np.copy doesn't seem to always + # produce them, in particular for complex dtypes + size = (arr.size + 1) * arr.itemsize + 1 + datasize = arr.size * arr.itemsize + tmp = np.empty(size, dtype=np.uint8) + for i in range(arr.itemsize + 1): + new = tmp[i : i + datasize].view(dtype=arr.dtype) + if new.flags.aligned: + break + else: + raise Exception("Could not obtain aligned array") + if arr.flags.c_contiguous: + new = np.reshape(new, arr.shape, order='C') + else: + new = np.reshape(new, arr.shape, order='F') + new[:] = arr[:] + assert new.flags.aligned + return new + + def check_func_out(self, pyfunc, cfunc, args, out): + copier = self._aligned_copy if _is_armv7l else np.copy + with self.assertNoNRTLeak(): + expected = copier(out) + got = copier(out) + self.assertIs(pyfunc(*args, out=expected), expected) + self.assertIs(cfunc(*args, out=got), got) + self.assertPreciseEqual(got, expected, ignore_sign_on_zero=True) + del got, expected + + def assert_mismatching_sizes(self, cfunc, args, is_out=False): + with self.assertRaises(ValueError) as raises: + cfunc(*args) + msg = ("incompatible output array size" if is_out else + "incompatible array sizes") + self.assertIn(msg, str(raises.exception)) + + def assert_mismatching_dtypes(self, cfunc, args, func_name="np.dot()"): + with self.assertRaises(errors.TypingError) as raises: + cfunc(*args) + self.assertIn("%s arguments must all have the same dtype" + % (func_name,), + str(raises.exception)) + + def check_dot_vv(self, pyfunc, func_name): + n = 3 + cfunc = jit(nopython=True)(pyfunc) + for dtype in self.dtypes: + a = self.sample_vector(n, dtype) + b = self.sample_vector(n, dtype) + self.check_func(pyfunc, cfunc, (a, b)) + # Non-contiguous + self.check_func(pyfunc, cfunc, (a[::-1], b[::-1])) + + # Mismatching sizes + a = self.sample_vector(n - 1, np.float64) + b = self.sample_vector(n, np.float64) + self.assert_mismatching_sizes(cfunc, (a, b)) + # Mismatching dtypes + a = self.sample_vector(n, np.float32) + b = self.sample_vector(n, np.float64) + self.assert_mismatching_dtypes(cfunc, (a, b), func_name=func_name) + + @needs_blas + def test_dot_vv(self): + """ + Test vector * vector np.dot() + """ + self.check_dot_vv(dot2, "np.dot()") + + @needs_blas + def test_vdot(self): + """ + Test np.vdot() + """ + self.check_dot_vv(vdot, "np.vdot()") + + def check_dot_vm(self, pyfunc2, pyfunc3, func_name): + + def samples(m, n): + for order in 'CF': + a = self.sample_matrix(m, n, np.float64).copy(order=order) + b = self.sample_vector(n, np.float64) + yield a, b + for dtype in self.dtypes: + a = self.sample_matrix(m, n, dtype) + b = self.sample_vector(n, dtype) + yield a, b + # Non-contiguous + yield a[::-1], b[::-1] + + cfunc2 = jit(nopython=True)(pyfunc2) + if pyfunc3 is not None: + cfunc3 = jit(nopython=True)(pyfunc3) + + for m, n in [(2, 3), + (3, 0), + (0, 3) + ]: + for a, b in samples(m, n): + self.check_func(pyfunc2, cfunc2, (a, b)) + self.check_func(pyfunc2, cfunc2, (b, a.T)) + if pyfunc3 is not None: + for a, b in samples(m, n): + out = np.empty(m, dtype=a.dtype) + self.check_func_out(pyfunc3, cfunc3, (a, b), out) + self.check_func_out(pyfunc3, cfunc3, (b, a.T), out) + + # Mismatching sizes + m, n = 2, 3 + a = self.sample_matrix(m, n - 1, np.float64) + b = self.sample_vector(n, np.float64) + self.assert_mismatching_sizes(cfunc2, (a, b)) + self.assert_mismatching_sizes(cfunc2, (b, a.T)) + if pyfunc3 is not None: + out = np.empty(m, np.float64) + self.assert_mismatching_sizes(cfunc3, (a, b, out)) + self.assert_mismatching_sizes(cfunc3, (b, a.T, out)) + a = self.sample_matrix(m, m, np.float64) + b = self.sample_vector(m, np.float64) + out = np.empty(m - 1, np.float64) + self.assert_mismatching_sizes(cfunc3, (a, b, out), is_out=True) + self.assert_mismatching_sizes(cfunc3, (b, a.T, out), is_out=True) + # Mismatching dtypes + a = self.sample_matrix(m, n, np.float32) + b = self.sample_vector(n, np.float64) + self.assert_mismatching_dtypes(cfunc2, (a, b), func_name) + if pyfunc3 is not None: + a = self.sample_matrix(m, n, np.float64) + b = self.sample_vector(n, np.float64) + out = np.empty(m, np.float32) + self.assert_mismatching_dtypes(cfunc3, (a, b, out), func_name) + + @needs_blas + def test_dot_vm(self): + """ + Test vector * matrix and matrix * vector np.dot() + """ + self.check_dot_vm(dot2, dot3, "np.dot()") + + def check_dot_mm(self, pyfunc2, pyfunc3, func_name): + + def samples(m, n, k): + for order_a, order_b in product('CF', 'CF'): + a = self.sample_matrix(m, k, np.float64).copy(order=order_a) + b = self.sample_matrix(k, n, np.float64).copy(order=order_b) + yield a, b + for dtype in self.dtypes: + a = self.sample_matrix(m, k, dtype) + b = self.sample_matrix(k, n, dtype) + yield a, b + # Non-contiguous + yield a[::-1], b[::-1] + + cfunc2 = jit(nopython=True)(pyfunc2) + if pyfunc3 is not None: + cfunc3 = jit(nopython=True)(pyfunc3) + + # Test generic matrix * matrix as well as "degenerate" cases + # where one of the outer dimensions is 1 (i.e. really represents + # a vector, which may select a different implementation), + # one of the matrices is empty, or both matrices are empty. + for m, n, k in [(2, 3, 4), # Generic matrix * matrix + (1, 3, 4), # 2d vector * matrix + (1, 1, 4), # 2d vector * 2d vector + (0, 3, 2), # Empty matrix * matrix, empty output + (3, 0, 2), # Matrix * empty matrix, empty output + (0, 0, 3), # Both arguments empty, empty output + (3, 2, 0), # Both arguments empty, nonempty output + ]: + for a, b in samples(m, n, k): + self.check_func(pyfunc2, cfunc2, (a, b)) + self.check_func(pyfunc2, cfunc2, (b.T, a.T)) + if pyfunc3 is not None: + for a, b in samples(m, n, k): + out = np.empty((m, n), dtype=a.dtype) + self.check_func_out(pyfunc3, cfunc3, (a, b), out) + out = np.empty((n, m), dtype=a.dtype) + self.check_func_out(pyfunc3, cfunc3, (b.T, a.T), out) + + # Mismatching sizes + m, n, k = 2, 3, 4 + a = self.sample_matrix(m, k - 1, np.float64) + b = self.sample_matrix(k, n, np.float64) + self.assert_mismatching_sizes(cfunc2, (a, b)) + if pyfunc3 is not None: + out = np.empty((m, n), np.float64) + self.assert_mismatching_sizes(cfunc3, (a, b, out)) + a = self.sample_matrix(m, k, np.float64) + b = self.sample_matrix(k, n, np.float64) + out = np.empty((m, n - 1), np.float64) + self.assert_mismatching_sizes(cfunc3, (a, b, out), is_out=True) + # Mismatching dtypes + a = self.sample_matrix(m, k, np.float32) + b = self.sample_matrix(k, n, np.float64) + self.assert_mismatching_dtypes(cfunc2, (a, b), func_name) + if pyfunc3 is not None: + a = self.sample_matrix(m, k, np.float64) + b = self.sample_matrix(k, n, np.float64) + out = np.empty((m, n), np.float32) + self.assert_mismatching_dtypes(cfunc3, (a, b, out), func_name) + + @needs_blas + def test_dot_mm(self): + """ + Test matrix * matrix np.dot() + """ + self.check_dot_mm(dot2, dot3, "np.dot()") + + @needs_blas + def test_matmul_vv(self): + """ + Test vector @ vector + """ + self.check_dot_vv(matmul_usecase, "'@'") + + @needs_blas + def test_matmul_vm(self): + """ + Test vector @ matrix and matrix @ vector + """ + self.check_dot_vm(matmul_usecase, None, "'@'") + + @needs_blas + def test_matmul_mm(self): + """ + Test matrix @ matrix + """ + self.check_dot_mm(matmul_usecase, None, "'@'") + + @needs_blas + def test_contiguity_warnings(self): + m, k, n = 2, 3, 4 + dtype = np.float64 + a = self.sample_matrix(m, k, dtype)[::-1] + b = self.sample_matrix(k, n, dtype)[::-1] + out = np.empty((m, n), dtype) + + cfunc = jit(nopython=True)(dot2) + with self.check_contiguity_warning(cfunc.py_func): + cfunc(a, b) + cfunc = jit(nopython=True)(dot3) + with self.check_contiguity_warning(cfunc.py_func): + cfunc(a, b, out) + + a = self.sample_vector(n, dtype)[::-1] + b = self.sample_vector(n, dtype)[::-1] + + cfunc = jit(nopython=True)(vdot) + with self.check_contiguity_warning(cfunc.py_func): + cfunc(a, b) + + +# Implementation definitions for the purpose of jitting. + +def invert_matrix(a): + return np.linalg.inv(a) + + +def cholesky_matrix(a): + return np.linalg.cholesky(a) + + +def eig_matrix(a): + return np.linalg.eig(a) + + +def eigvals_matrix(a): + return np.linalg.eigvals(a) + + +def eigh_matrix(a): + return np.linalg.eigh(a) + + +def eigvalsh_matrix(a): + return np.linalg.eigvalsh(a) + + +def svd_matrix(a, full_matrices=1): + return np.linalg.svd(a, full_matrices) + + +def qr_matrix(a): + return np.linalg.qr(a) + + +def lstsq_system(A, B, rcond=-1): + return np.linalg.lstsq(A, B, rcond) + + +def solve_system(A, B): + return np.linalg.solve(A, B) + + +def pinv_matrix(A, rcond=1e-15): # 1e-15 from numpy impl + return np.linalg.pinv(A) + + +def slogdet_matrix(a): + return np.linalg.slogdet(a) + + +def det_matrix(a): + return np.linalg.det(a) + + +def norm_matrix(a, ord=None): + return np.linalg.norm(a, ord) + + +def cond_matrix(a, p=None): + return np.linalg.cond(a, p) + + +def matrix_rank_matrix(a, tol=None): + return np.linalg.matrix_rank(a, tol) + + +def matrix_power_matrix(a, n): + return np.linalg.matrix_power(a, n) + + +def trace_matrix(a, offset=0): + return np.trace(a, offset) + + +def trace_matrix_no_offset(a): + return np.trace(a) + + +def outer_matrix(a, b, out=None): + return np.outer(a, b, out=out) + + +def kron_matrix(a, b): + return np.kron(a, b) + + +class TestLinalgBase(EnableNRTStatsMixin, TestCase): + """ + Provides setUp and common data/error modes for testing np.linalg functions. + """ + + # supported dtypes + dtypes = (np.float64, np.float32, np.complex128, np.complex64) + + def setUp(self): + # Collect leftovers from previous test cases before checking for leaks + gc.collect() + super(TestLinalgBase, self).setUp() + + def sample_vector(self, n, dtype): + # Be careful to generate only exactly representable float values, + # to avoid rounding discrepancies between Numpy and Numba + base = np.arange(n) + if issubclass(dtype, np.complexfloating): + return (base * (1 - 0.5j) + 2j).astype(dtype) + else: + return (base * 0.5 + 1).astype(dtype) + + def specific_sample_matrix( + self, size, dtype, order, rank=None, condition=None): + """ + Provides a sample matrix with an optionally specified rank or condition + number. + + size: (rows, columns), the dimensions of the returned matrix. + dtype: the dtype for the returned matrix. + order: the memory layout for the returned matrix, 'F' or 'C'. + rank: the rank of the matrix, an integer value, defaults to full rank. + condition: the condition number of the matrix (defaults to 1.) + + NOTE: Only one of rank or condition may be set. + """ + + # default condition + d_cond = 1. + + if len(size) != 2: + raise ValueError("size must be a length 2 tuple.") + + if order not in ['F', 'C']: + raise ValueError("order must be one of 'F' or 'C'.") + + if dtype not in [np.float32, np.float64, np.complex64, np.complex128]: + raise ValueError("dtype must be a numpy floating point type.") + + if rank is not None and condition is not None: + raise ValueError("Only one of rank or condition can be specified.") + + if condition is None: + condition = d_cond + + if condition < 1: + raise ValueError("Condition number must be >=1.") + + np.random.seed(0) # repeatable seed + m, n = size + + if m < 0 or n < 0: + raise ValueError("Negative dimensions given for matrix shape.") + + minmn = min(m, n) + if rank is None: + rv = minmn + else: + if rank <= 0: + raise ValueError("Rank must be greater than zero.") + if not isinstance(rank, Integral): + raise ValueError("Rank must an integer.") + rv = rank + if rank > minmn: + raise ValueError("Rank given greater than full rank.") + + if m == 1 or n == 1: + # vector, must be rank 1 (enforced above) + # condition of vector is also 1 + if condition != d_cond: + raise ValueError( + "Condition number was specified for a vector (always 1.).") + maxmn = max(m, n) + Q = self.sample_vector(maxmn, dtype).reshape(m, n) + else: + # Build a sample matrix via combining SVD like inputs. + + # Create matrices of left and right singular vectors. + # This could use Modified Gram-Schmidt and perhaps be quicker, + # at present it uses QR decompositions to obtain orthonormal + # matrices. + tmp = self.sample_vector(m * m, dtype).reshape(m, m) + U, _ = np.linalg.qr(tmp) + # flip the second array, else for m==n the identity matrix appears + tmp = self.sample_vector(n * n, dtype)[::-1].reshape(n, n) + V, _ = np.linalg.qr(tmp) + # create singular values. + sv = np.linspace(d_cond, condition, rv) + S = np.zeros((m, n)) + idx = np.nonzero(np.eye(m, n)) + S[idx[0][:rv], idx[1][:rv]] = sv + Q = np.dot(np.dot(U, S), V.T) # construct + Q = np.array(Q, dtype=dtype, order=order) # sort out order/type + + return Q + + def assert_error(self, cfunc, args, msg, err=ValueError): + with self.assertRaises(err) as raises: + cfunc(*args) + self.assertIn(msg, str(raises.exception)) + + def assert_non_square(self, cfunc, args): + msg = "Last 2 dimensions of the array must be square." + self.assert_error(cfunc, args, msg, np.linalg.LinAlgError) + + def assert_wrong_dtype(self, name, cfunc, args): + msg = "np.linalg.%s() only supported on float and complex arrays" % name + self.assert_error(cfunc, args, msg, errors.TypingError) + + def assert_wrong_dimensions(self, name, cfunc, args, la_prefix=True): + prefix = "np.linalg" if la_prefix else "np" + msg = "%s.%s() only supported on 2-D arrays" % (prefix, name) + self.assert_error(cfunc, args, msg, errors.TypingError) + + def assert_no_nan_or_inf(self, cfunc, args): + msg = "Array must not contain infs or NaNs." + self.assert_error(cfunc, args, msg, np.linalg.LinAlgError) + + def assert_contig_sanity(self, got, expected_contig): + """ + This checks that in a computed result from numba (array, possibly tuple + of arrays) all the arrays are contiguous in memory and that they are + all at least one of "C_CONTIGUOUS" or "F_CONTIGUOUS". The computed + result of the contiguousness is then compared against a hardcoded + expected result. + + got: is the computed results from numba + expected_contig: is "C" or "F" and is the expected type of + contiguousness across all input values + (and therefore tests). + """ + + if isinstance(got, tuple): + # tuple present, check all results + for a in got: + self.assert_contig_sanity(a, expected_contig) + else: + if not isinstance(got, Number): + # else a single array is present + c_contig = got.flags.c_contiguous + f_contig = got.flags.f_contiguous + + # check that the result (possible set of) is at least one of + # C or F contiguous. + msg = "Results are not at least one of all C or F contiguous." + self.assertTrue(c_contig | f_contig, msg) + + msg = "Computed contiguousness does not match expected." + if expected_contig == "C": + self.assertTrue(c_contig, msg) + elif expected_contig == "F": + self.assertTrue(f_contig, msg) + else: + raise ValueError("Unknown contig") + + def assert_raise_on_singular(self, cfunc, args): + msg = "Matrix is singular to machine precision." + self.assert_error(cfunc, args, msg, err=np.linalg.LinAlgError) + + def assert_is_identity_matrix(self, got, rtol=None, atol=None): + """ + Checks if a matrix is equal to the identity matrix. + """ + # check it is square + self.assertEqual(got.shape[-1], got.shape[-2]) + # create identity matrix + eye = np.eye(got.shape[-1], dtype=got.dtype) + resolution = 5 * np.finfo(got.dtype).resolution + if rtol is None: + rtol = 10 * resolution + if atol is None: + atol = 100 * resolution # zeros tend to be fuzzy + # check it matches + np.testing.assert_allclose(got, eye, rtol, atol) + + def assert_invalid_norm_kind(self, cfunc, args): + """ + For use in norm() and cond() tests. + """ + msg = "Invalid norm order for matrices." + self.assert_error(cfunc, args, msg, ValueError) + + def assert_raise_on_empty(self, cfunc, args): + msg = 'Arrays cannot be empty' + self.assert_error(cfunc, args, msg, np.linalg.LinAlgError) + + +class TestTestLinalgBase(TestCase): + """ + The sample matrix code TestLinalgBase.specific_sample_matrix() + is a bit involved, this class tests it works as intended. + """ + + def test_specific_sample_matrix(self): + + # add a default test to the ctor, it never runs so doesn't matter + inst = TestLinalgBase('specific_sample_matrix') + + sizes = [(7, 1), (11, 5), (5, 11), (3, 3), (1, 7)] + + # test loop + for size, dtype, order in product(sizes, inst.dtypes, 'FC'): + + m, n = size + minmn = min(m, n) + + # test default full rank + A = inst.specific_sample_matrix(size, dtype, order) + self.assertEqual(A.shape, size) + self.assertEqual(np.linalg.matrix_rank(A), minmn) + + # test reduced rank if a reduction is possible + if minmn > 1: + rank = minmn - 1 + A = inst.specific_sample_matrix(size, dtype, order, rank=rank) + self.assertEqual(A.shape, size) + self.assertEqual(np.linalg.matrix_rank(A), rank) + + resolution = 5 * np.finfo(dtype).resolution + + # test default condition + A = inst.specific_sample_matrix(size, dtype, order) + self.assertEqual(A.shape, size) + np.testing.assert_allclose(np.linalg.cond(A), + 1., + rtol=resolution, + atol=resolution) + + # test specified condition if matrix is > 1D + if minmn > 1: + condition = 10. + A = inst.specific_sample_matrix( + size, dtype, order, condition=condition) + self.assertEqual(A.shape, size) + np.testing.assert_allclose(np.linalg.cond(A), + 10., + rtol=resolution, + atol=resolution) + + # check errors are raised appropriately + def check_error(args, msg, err=ValueError): + with self.assertRaises(err) as raises: + inst.specific_sample_matrix(*args) + self.assertIn(msg, str(raises.exception)) + + # check the checker runs ok + with self.assertRaises(AssertionError) as raises: + msg = "blank" + check_error(((2, 3), np.float64, 'F'), msg, err=ValueError) + + # check invalid inputs... + + # bad size + msg = "size must be a length 2 tuple." + check_error(((1,), np.float64, 'F'), msg, err=ValueError) + + # bad order + msg = "order must be one of 'F' or 'C'." + check_error(((2, 3), np.float64, 'z'), msg, err=ValueError) + + # bad type + msg = "dtype must be a numpy floating point type." + check_error(((2, 3), np.int32, 'F'), msg, err=ValueError) + + # specifying both rank and condition + msg = "Only one of rank or condition can be specified." + check_error(((2, 3), np.float64, 'F', 1, 1), msg, err=ValueError) + + # specifying negative condition + msg = "Condition number must be >=1." + check_error(((2, 3), np.float64, 'F', None, -1), msg, err=ValueError) + + # specifying negative matrix dimension + msg = "Negative dimensions given for matrix shape." + check_error(((2, -3), np.float64, 'F'), msg, err=ValueError) + + # specifying negative rank + msg = "Rank must be greater than zero." + check_error(((2, 3), np.float64, 'F', -1), msg, err=ValueError) + + # specifying a rank greater than maximum rank + msg = "Rank given greater than full rank." + check_error(((2, 3), np.float64, 'F', 4), msg, err=ValueError) + + # specifying a condition number for a vector + msg = "Condition number was specified for a vector (always 1.)." + check_error(((1, 3), np.float64, 'F', None, 10), msg, err=ValueError) + + # specifying a non integer rank + msg = "Rank must an integer." + check_error(((2, 3), np.float64, 'F', 1.5), msg, err=ValueError) + + +class TestLinalgInv(TestLinalgBase): + """ + Tests for np.linalg.inv. + """ + + @needs_lapack + def test_linalg_inv(self): + """ + Test np.linalg.inv + """ + n = 10 + cfunc = jit(nopython=True)(invert_matrix) + + def check(a, **kwargs): + expected = invert_matrix(a) + got = cfunc(a) + self.assert_contig_sanity(got, "F") + + use_reconstruction = False + + # try strict + try: + np.testing.assert_array_almost_equal_nulp(got, expected, + nulp=10) + except AssertionError: + # fall back to reconstruction + use_reconstruction = True + + if use_reconstruction: + rec = np.dot(got, a) + self.assert_is_identity_matrix(rec) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a) + + for dtype, order in product(self.dtypes, 'CF'): + a = self.specific_sample_matrix((n, n), dtype, order) + check(a) + + # 0 dimensioned matrix + check(np.empty((0, 0))) + + # Non square matrix + self.assert_non_square(cfunc, (np.ones((2, 3)),)) + + # Wrong dtype + self.assert_wrong_dtype("inv", cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue + self.assert_wrong_dimensions("inv", cfunc, (np.ones(10),)) + + # Singular matrix + self.assert_raise_on_singular(cfunc, (np.zeros((2, 2)),)) + + @needs_lapack + def test_no_input_mutation(self): + X = np.array([[1., 3, 2, 7,], + [-5, 4, 2, 3,], + [9, -3, 1, 1,], + [2, -2, 2, 8,]], order='F') + + X_orig = np.copy(X) + + @jit(nopython=True) + def ainv(X, test): + if test: + # not executed, but necessary to trigger A ordering in X + X = X[1:2, :] + return np.linalg.inv(X) + + expected = ainv.py_func(X, False) + np.testing.assert_allclose(X, X_orig) + + got = ainv(X, False) + np.testing.assert_allclose(X, X_orig) + + np.testing.assert_allclose(expected, got) + + +class TestLinalgCholesky(TestLinalgBase): + """ + Tests for np.linalg.cholesky. + """ + + def sample_matrix(self, m, dtype, order): + # pd. (positive definite) matrix has eigenvalues in Z+ + np.random.seed(0) # repeatable seed + A = np.random.rand(m, m) + # orthonormal q needed to form up q^{-1}*D*q + # no "orth()" in numpy + q, _ = np.linalg.qr(A) + L = np.arange(1, m + 1) # some positive eigenvalues + Q = np.dot(np.dot(q.T, np.diag(L)), q) # construct + Q = np.array(Q, dtype=dtype, order=order) # sort out order/type + return Q + + def assert_not_pd(self, cfunc, args): + msg = "Matrix is not positive definite." + self.assert_error(cfunc, args, msg, np.linalg.LinAlgError) + + @needs_lapack + def test_linalg_cholesky(self): + """ + Test np.linalg.cholesky + """ + n = 10 + cfunc = jit(nopython=True)(cholesky_matrix) + + def check(a): + expected = cholesky_matrix(a) + got = cfunc(a) + use_reconstruction = False + # check that the computed results are contig and in the same way + self.assert_contig_sanity(got, "C") + + # try strict + try: + np.testing.assert_array_almost_equal_nulp(got, expected, + nulp=10) + except AssertionError: + # fall back to reconstruction + use_reconstruction = True + + # try via reconstruction + if use_reconstruction: + rec = np.dot(got, np.conj(got.T)) + resolution = 5 * np.finfo(a.dtype).resolution + np.testing.assert_allclose( + a, + rec, + rtol=resolution, + atol=resolution + ) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a) + + for dtype, order in product(self.dtypes, 'FC'): + a = self.sample_matrix(n, dtype, order) + check(a) + + # 0 dimensioned matrix + check(np.empty((0, 0))) + + rn = "cholesky" + # Non square matrices + self.assert_non_square(cfunc, (np.ones((2, 3), dtype=np.float64),)) + + # Wrong dtype + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue + self.assert_wrong_dimensions(rn, cfunc, + (np.ones(10, dtype=np.float64),)) + + # not pd + self.assert_not_pd(cfunc, + (np.ones(4, dtype=np.float64).reshape(2, 2),)) + + +class TestLinalgEigenSystems(TestLinalgBase): + """ + Tests for np.linalg.eig/eigvals. + """ + + def sample_matrix(self, m, dtype, order): + # This is a tridiag with the same but skewed values on the diagonals + v = self.sample_vector(m, dtype) + Q = np.diag(v) + idx = np.nonzero(np.eye(Q.shape[0], Q.shape[1], 1)) + Q[idx] = v[1:] + idx = np.nonzero(np.eye(Q.shape[0], Q.shape[1], -1)) + Q[idx] = v[:-1] + Q = np.array(Q, dtype=dtype, order=order) + return Q + + def assert_no_domain_change(self, name, cfunc, args): + msg = name + "() argument must not cause a domain change." + self.assert_error(cfunc, args, msg) + + def _check_worker(self, cfunc, name, expected_res_len, + check_for_domain_change): + def check(*args): + expected = cfunc.py_func(*args) + got = cfunc(*args) + a = args[0] + # check that the returned tuple is same length + self.assertEqual(len(expected), len(got)) + # and that dimension is correct + res_is_tuple = False + if isinstance(got, tuple): + res_is_tuple = True + self.assertEqual(len(got), expected_res_len) + else: # its an array + self.assertEqual(got.ndim, expected_res_len) + + # and that the computed results are contig and in the same way + self.assert_contig_sanity(got, "F") + + use_reconstruction = False + # try plain match of each array to np first + for k in range(len(expected)): + try: + np.testing.assert_array_almost_equal_nulp( + got[k], expected[k], nulp=10) + except AssertionError: + # plain match failed, test by reconstruction + use_reconstruction = True + + # If plain match fails then reconstruction is used. + # this checks that A*V ~== V*diag(W) + # i.e. eigensystem ties out + # this is required as numpy uses only double precision lapack + # routines and computation of eigenvectors is numerically + # sensitive, numba uses the type specific routines therefore + # sometimes comes out with a different (but entirely + # valid) answer (eigenvectors are not unique etc.). + # This is only applicable if eigenvectors are computed + # along with eigenvalues i.e. result is a tuple. + resolution = 5 * np.finfo(a.dtype).resolution + if use_reconstruction: + if res_is_tuple: + w, v = got + # modify 'a' if hermitian eigensystem functionality is + # being tested. 'L' for use lower part is default and + # the only thing used at present so we conjugate transpose + # the lower part into the upper for use in the + # reconstruction. By construction the sample matrix is + # tridiag so this is just a question of copying the lower + # diagonal into the upper and conjugating on the way. + if name[-1] == 'h': + idxl = np.nonzero(np.eye(a.shape[0], a.shape[1], -1)) + idxu = np.nonzero(np.eye(a.shape[0], a.shape[1], 1)) + cfunc(*args) + # upper idx must match lower for default uplo="L" + # if complex, conjugate + a[idxu] = np.conj(a[idxl]) + # also, only the real part of the diagonals is + # considered in the calculation so the imag is zeroed + # out for the purposes of use in reconstruction. + a[np.diag_indices(a.shape[0])] = np.real(np.diag(a)) + + lhs = np.dot(a, v) + rhs = np.dot(v, np.diag(w)) + + np.testing.assert_allclose( + lhs.real, + rhs.real, + rtol=resolution, + atol=resolution + ) + if np.iscomplexobj(v): + np.testing.assert_allclose( + lhs.imag, + rhs.imag, + rtol=resolution, + atol=resolution + ) + else: + # This isn't technically reconstruction but is here to + # deal with that the order of the returned eigenvalues + # may differ in the case of routines just returning + # eigenvalues and there's no true reconstruction + # available with which to perform a check. + np.testing.assert_allclose( + np.sort(expected), + np.sort(got), + rtol=resolution, + atol=resolution + ) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(*args) + return check + + def checker_for_linalg_eig( + self, name, func, expected_res_len, check_for_domain_change=None): + """ + Test np.linalg.eig + """ + n = 10 + cfunc = jit(nopython=True)(func) + check = self._check_worker(cfunc, name, expected_res_len, + check_for_domain_change) + + + # The main test loop + for dtype, order in product(self.dtypes, 'FC'): + a = self.sample_matrix(n, dtype, order) + check(a) + + # Test both a real and complex type as the impls are different + for ty in [np.float32, np.complex64]: + + # 0 dimensioned matrix + check(np.empty((0, 0), dtype=ty)) + + # Non square matrices + self.assert_non_square(cfunc, (np.ones((2, 3), dtype=ty),)) + + # Wrong dtype + self.assert_wrong_dtype(name, cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue + self.assert_wrong_dimensions(name, cfunc, (np.ones(10, dtype=ty),)) + + # no nans or infs + self.assert_no_nan_or_inf(cfunc, + (np.array([[1., 2., ], [np.inf, np.nan]], + dtype=ty),)) + + if check_for_domain_change: + # By design numba does not support dynamic return types, numpy does + # and uses this in the case of returning eigenvalues/vectors of + # a real matrix. The return type of np.linalg.eig(), when + # operating on a matrix in real space depends on the values present + # in the matrix itself (recalling that eigenvalues are the roots of the + # characteristic polynomial of the system matrix, which will by + # construction depend on the values present in the system matrix). + # This test asserts that if a domain change is required on the return + # type, i.e. complex eigenvalues from a real input, an error is raised. + # For complex types, regardless of the value of the imaginary part of + # the returned eigenvalues, a complex type will be returned, this + # follows numpy and fits in with numba. + + # First check that the computation is valid (i.e. in complex space) + A = np.array([[1, -2], [2, 1]]) + check(A.astype(np.complex128)) + # and that the imaginary part is nonzero + l, _ = func(A) + self.assertTrue(np.any(l.imag)) + + # Now check that the computation fails in real space + for ty in [np.float32, np.float64]: + self.assert_no_domain_change(name, cfunc, (A.astype(ty),)) + + @needs_lapack + def test_linalg_eig(self): + self.checker_for_linalg_eig("eig", eig_matrix, 2, True) + + @needs_lapack + def test_linalg_eigvals(self): + self.checker_for_linalg_eig("eigvals", eigvals_matrix, 1, True) + + @needs_lapack + def test_linalg_eigh(self): + self.checker_for_linalg_eig("eigh", eigh_matrix, 2, False) + + @needs_lapack + def test_linalg_eigvalsh(self): + self.checker_for_linalg_eig("eigvalsh", eigvalsh_matrix, 1, False) + + @needs_lapack + def test_no_input_mutation(self): + # checks inputs are not mutated + + for c in (('eig', 2, True), + ('eigvals', 1, True), + ('eigh', 2, False), + ('eigvalsh', 1, False)): + + m, nout, domain_change = c + + meth = getattr(np.linalg, m) + + @jit(nopython=True) + def func(X, test): + if test: + # not executed, but necessary to trigger A ordering in X + X = X[1:2, :] + return meth(X) + + check = self._check_worker(func, m, nout, domain_change) + + for dtype in (np.float64, np.complex128): + with self.subTest(meth=meth, dtype=dtype): + # trivial system, doesn't matter, just checking if it gets + # mutated + X = np.array([[10., 1, 0, 1], + [1, 9, 0, 0], + [0, 0, 8, 0], + [1, 0, 0, 7], + ], order='F', dtype=dtype) + + X_orig = np.copy(X) + + expected = func.py_func(X, False) + np.testing.assert_allclose(X, X_orig) + + got = func(X, False) + np.testing.assert_allclose(X, X_orig) + + check(X, False) + + +class TestLinalgSvd(TestLinalgBase): + """ + Tests for np.linalg.svd. + """ + + # This checks that A ~= U*S*V**H, i.e. SV decomposition ties out. This is + # required as NumPy uses only double precision LAPACK routines and + # computation of SVD is numerically sensitive. Numba uses type-specific + # routines and therefore sometimes comes out with a different answer to + # NumPy (orthonormal bases are not unique, etc.). + + def check_reconstruction(self, a, got, expected): + u, sv, vt = got + + # Check they are dimensionally correct + for k in range(len(expected)): + self.assertEqual(got[k].shape, expected[k].shape) + + # Columns in u and rows in vt dictates the working size of s + s = np.zeros((u.shape[1], vt.shape[0])) + np.fill_diagonal(s, sv) + + rec = np.dot(np.dot(u, s), vt) + resolution = np.finfo(a.dtype).resolution + np.testing.assert_allclose( + a, + rec, + rtol=10 * resolution, + atol=100 * resolution # zeros tend to be fuzzy + ) + + @needs_lapack + def test_linalg_svd(self): + """ + Test np.linalg.svd + """ + cfunc = jit(nopython=True)(svd_matrix) + + def check(a, **kwargs): + expected = svd_matrix(a, **kwargs) + got = cfunc(a, **kwargs) + # check that the returned tuple is same length + self.assertEqual(len(expected), len(got)) + # and that length is 3 + self.assertEqual(len(got), 3) + # and that the computed results are contig and in the same way + self.assert_contig_sanity(got, "F") + + use_reconstruction = False + # try plain match of each array to np first + for k in range(len(expected)): + + try: + np.testing.assert_array_almost_equal_nulp( + got[k], expected[k], nulp=10) + except AssertionError: + # plain match failed, test by reconstruction + use_reconstruction = True + + if use_reconstruction: + self.check_reconstruction(a, got, expected) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + # test: column vector, tall, wide, square, row vector + # prime sizes + sizes = [(7, 1), (7, 5), (5, 7), (3, 3), (1, 7)] + + # flip on reduced or full matrices + full_matrices = (True, False) + + # test loop + for size, dtype, fmat, order in \ + product(sizes, self.dtypes, full_matrices, 'FC'): + + a = self.specific_sample_matrix(size, dtype, order) + check(a, full_matrices=fmat) + + rn = "svd" + + # Wrong dtype + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue + self.assert_wrong_dimensions(rn, cfunc, + (np.ones(10, dtype=np.float64),)) + + # no nans or infs + self.assert_no_nan_or_inf(cfunc, + (np.array([[1., 2., ], [np.inf, np.nan]], + dtype=np.float64),)) + # empty + for sz in [(0, 1), (1, 0), (0, 0)]: + args = (np.empty(sz), True) + self.assert_raise_on_empty(cfunc, args) + + @needs_lapack + def test_no_input_mutation(self): + X = np.array([[1., 3, 2, 7,], + [-5, 4, 2, 3,], + [9, -3, 1, 1,], + [2, -2, 2, 8,]], order='F') + + X_orig = np.copy(X) + + @jit(nopython=True) + def func(X, test): + if test: + # not executed, but necessary to trigger A ordering in X + X = X[1:2, :] + return np.linalg.svd(X) + + expected = func.py_func(X, False) + np.testing.assert_allclose(X, X_orig) + + got = func(X, False) + np.testing.assert_allclose(X, X_orig) + + try: + for e_a, g_a in zip(expected, got): + np.testing.assert_allclose(e_a, g_a) + except AssertionError: + self.check_reconstruction(X, got, expected) + + +class TestLinalgQr(TestLinalgBase): + """ + Tests for np.linalg.qr. + """ + + @needs_lapack + def test_linalg_qr(self): + """ + Test np.linalg.qr + """ + cfunc = jit(nopython=True)(qr_matrix) + + def check(a, **kwargs): + expected = qr_matrix(a, **kwargs) + got = cfunc(a, **kwargs) + + # check that the returned tuple is same length + self.assertEqual(len(expected), len(got)) + # and that length is 2 + self.assertEqual(len(got), 2) + # and that the computed results are contig and in the same way + self.assert_contig_sanity(got, "F") + + use_reconstruction = False + # try plain match of each array to np first + for k in range(len(expected)): + try: + np.testing.assert_array_almost_equal_nulp( + got[k], expected[k], nulp=10) + except AssertionError: + # plain match failed, test by reconstruction + use_reconstruction = True + + # if plain match fails then reconstruction is used. + # this checks that A ~= Q*R and that (Q^H)*Q = I + # i.e. QR decomposition ties out + # this is required as numpy uses only double precision lapack + # routines and computation of qr is numerically + # sensitive, numba using the type specific routines therefore + # sometimes comes out with a different answer (orthonormal bases + # are not unique etc.). + if use_reconstruction: + q, r = got + + # check they are dimensionally correct + for k in range(len(expected)): + self.assertEqual(got[k].shape, expected[k].shape) + + # check A=q*r + rec = np.dot(q, r) + resolution = np.finfo(a.dtype).resolution + np.testing.assert_allclose( + a, + rec, + rtol=10 * resolution, + atol=100 * resolution # zeros tend to be fuzzy + ) + + # check q is orthonormal + self.assert_is_identity_matrix(np.dot(np.conjugate(q.T), q)) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + # test: column vector, tall, wide, square, row vector + # prime sizes + sizes = [(7, 1), (11, 5), (5, 11), (3, 3), (1, 7)] + + # test loop + for size, dtype, order in \ + product(sizes, self.dtypes, 'FC'): + a = self.specific_sample_matrix(size, dtype, order) + check(a) + + rn = "qr" + + # Wrong dtype + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue + self.assert_wrong_dimensions(rn, cfunc, + (np.ones(10, dtype=np.float64),)) + + # no nans or infs + self.assert_no_nan_or_inf(cfunc, + (np.array([[1., 2., ], [np.inf, np.nan]], + dtype=np.float64),)) + + # empty + for sz in [(0, 1), (1, 0), (0, 0)]: + self.assert_raise_on_empty(cfunc, (np.empty(sz),)) + + @needs_lapack + def test_no_input_mutation(self): + X = np.array([[1., 3, 2, 7,], + [-5, 4, 2, 3,], + [9, -3, 1, 1,], + [2, -2, 2, 8,]], order='F') + + X_orig = np.copy(X) + + @jit(nopython=True) + def func(X, test): + if test: + # not executed, but necessary to trigger A ordering in X + X = X[1:2, :] + return np.linalg.qr(X) + + expected = func.py_func(X, False) + np.testing.assert_allclose(X, X_orig) + + got = func(X, False) + np.testing.assert_allclose(X, X_orig) + + for e_a, g_a in zip(expected, got): + np.testing.assert_allclose(e_a, g_a) + + +class TestLinalgSystems(TestLinalgBase): + """ + Base class for testing "system" solvers from np.linalg. + Namely np.linalg.solve() and np.linalg.lstsq(). + """ + + # check for RHS with dimension > 2 raises + def assert_wrong_dimensions_1D(self, name, cfunc, args, la_prefix=True): + prefix = "np.linalg" if la_prefix else "np" + msg = "%s.%s() only supported on 1 and 2-D arrays" % (prefix, name) + self.assert_error(cfunc, args, msg, errors.TypingError) + + # check that a dimensionally invalid system raises + def assert_dimensionally_invalid(self, cfunc, args): + msg = "Incompatible array sizes, system is not dimensionally valid." + self.assert_error(cfunc, args, msg, np.linalg.LinAlgError) + + # check that args with differing dtypes raise + def assert_homogeneous_dtypes(self, name, cfunc, args): + msg = "np.linalg.%s() only supports inputs that have homogeneous dtypes." % name + self.assert_error(cfunc, args, msg, errors.TypingError) + + +class TestLinalgLstsq(TestLinalgSystems): + """ + Tests for np.linalg.lstsq. + """ + + # NOTE: The testing of this routine is hard as it has to handle numpy + # using double precision routines on single precision input, this has + # a knock on effect especially in rank deficient cases and cases where + # conditioning is generally poor. As a result computed ranks can differ + # and consequently the calculated residual can differ. + # The tests try and deal with this as best as they can through the use + # of reconstruction and measures like residual norms. + # Suggestions for improvements are welcomed! + + @needs_lapack + def test_linalg_lstsq(self): + """ + Test np.linalg.lstsq + """ + cfunc = jit(nopython=True)(lstsq_system) + + def check(A, B, **kwargs): + expected = lstsq_system(A, B, **kwargs) + got = cfunc(A, B, **kwargs) + + # check that the returned tuple is same length + self.assertEqual(len(expected), len(got)) + # and that length is 4 + self.assertEqual(len(got), 4) + # and that the computed results are contig and in the same way + self.assert_contig_sanity(got, "C") + + use_reconstruction = False + + # check the ranks are the same and continue to a standard + # match if that is the case (if ranks differ, then output + # in e.g. residual array is of different size!). + try: + self.assertEqual(got[2], expected[2]) + # try plain match of each array to np first + for k in range(len(expected)): + try: + np.testing.assert_array_almost_equal_nulp( + got[k], expected[k], nulp=10) + except AssertionError: + # plain match failed, test by reconstruction + use_reconstruction = True + except AssertionError: + use_reconstruction = True + + if use_reconstruction: + x, res, rank, s = got + + # indicies in the output which are ndarrays + out_array_idx = [0, 1, 3] + + try: + # check the ranks are the same + self.assertEqual(rank, expected[2]) + # check they are dimensionally correct, skip [2] = rank. + for k in out_array_idx: + if isinstance(expected[k], np.ndarray): + self.assertEqual(got[k].shape, expected[k].shape) + except AssertionError: + # check the rank differs by 1. (numerical fuzz) + self.assertTrue(abs(rank - expected[2]) < 2) + + # check if A*X = B + resolution = np.finfo(A.dtype).resolution + try: + # this will work so long as the conditioning is + # ok and the rank is full + rec = np.dot(A, x) + np.testing.assert_allclose( + B, + rec, + rtol=10 * resolution, + atol=10 * resolution + ) + except AssertionError: + # system is probably under/over determined and/or + # poorly conditioned. Check slackened equality + # and that the residual norm is the same. + for k in out_array_idx: + try: + np.testing.assert_allclose( + expected[k], + got[k], + rtol=100 * resolution, + atol=100 * resolution + ) + except AssertionError: + # check the fail is likely due to bad conditioning + c = np.linalg.cond(A) + self.assertGreater(10 * c, (1. / resolution)) + + # make sure the residual 2-norm is ok + # if this fails its probably due to numpy using double + # precision LAPACK routines for singles. + res_expected = np.linalg.norm( + B - np.dot(A, expected[0])) + res_got = np.linalg.norm(B - np.dot(A, x)) + # rtol = 10. as all the systems are products of orthonormals + # and on the small side (rows, cols) < 100. + np.testing.assert_allclose( + res_expected, res_got, rtol=10.) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(A, B, **kwargs) + + # test: column vector, tall, wide, square, row vector + # prime sizes, the A's + sizes = [(7, 1), (11, 5), (5, 11), (3, 3), (1, 7)] + # compatible B's for Ax=B must have same number of rows and 1 or more + # columns + + # This test takes ages! So combinations are trimmed via cycling + + # gets a dtype + cycle_dt = cycle(self.dtypes) + + orders = ['F', 'C'] + # gets a memory order flag + cycle_order = cycle(orders) + + # a specific condition number to use in the following tests + # there is nothing special about it other than it is not magic + specific_cond = 10. + + # inner test loop, extracted as there's additional logic etc required + # that'd end up with this being repeated a lot + def inner_test_loop_fn(A, dt, **kwargs): + # test solve Ax=B for (column, matrix) B, same dtype as A + b_sizes = (1, 13) + + for b_size in b_sizes: + + # check 2D B + b_order = next(cycle_order) + B = self.specific_sample_matrix( + (A.shape[0], b_size), dt, b_order) + check(A, B, **kwargs) + + # check 1D B + b_order = next(cycle_order) + tmp = B[:, 0].copy(order=b_order) + check(A, tmp, **kwargs) + + # test loop + for a_size in sizes: + + dt = next(cycle_dt) + a_order = next(cycle_order) + + # A full rank, well conditioned system + A = self.specific_sample_matrix(a_size, dt, a_order) + + # run the test loop + inner_test_loop_fn(A, dt) + + m, n = a_size + minmn = min(m, n) + + # operations that only make sense with a 2D matrix system + if m != 1 and n != 1: + + # Test a rank deficient system + r = minmn - 1 + A = self.specific_sample_matrix( + a_size, dt, a_order, rank=r) + # run the test loop + inner_test_loop_fn(A, dt) + + # Test a system with a given condition number for use in + # testing the rcond parameter. + # This works because the singular values in the + # specific_sample_matrix code are linspace (1, cond, [0... if + # rank deficient]) + A = self.specific_sample_matrix( + a_size, dt, a_order, condition=specific_cond) + # run the test loop + rcond = 1. / specific_cond + approx_half_rank_rcond = minmn * rcond + inner_test_loop_fn(A, dt, + rcond=approx_half_rank_rcond) + + # check empty arrays + empties = [ + [(0, 1), (1,)], # empty A, valid b + [(1, 0), (1,)], # empty A, valid b + [(1, 1), (0,)], # valid A, empty 1D b + [(1, 1), (1, 0)], # valid A, empty 2D b + ] + + for A, b in empties: + args = (np.empty(A), np.empty(b)) + self.assert_raise_on_empty(cfunc, args) + + # Test input validation + ok = np.array([[1., 2.], [3., 4.]], dtype=np.float64) + + # check ok input is ok + cfunc, (ok, ok) + + # check bad inputs + rn = "lstsq" + + # Wrong dtype + bad = np.array([[1, 2], [3, 4]], dtype=np.int32) + self.assert_wrong_dtype(rn, cfunc, (ok, bad)) + self.assert_wrong_dtype(rn, cfunc, (bad, ok)) + + # different dtypes + bad = np.array([[1, 2], [3, 4]], dtype=np.float32) + self.assert_homogeneous_dtypes(rn, cfunc, (ok, bad)) + self.assert_homogeneous_dtypes(rn, cfunc, (bad, ok)) + + # Dimension issue + bad = np.array([1, 2], dtype=np.float64) + self.assert_wrong_dimensions(rn, cfunc, (bad, ok)) + + # no nans or infs + bad = np.array([[1., 2., ], [np.inf, np.nan]], dtype=np.float64) + self.assert_no_nan_or_inf(cfunc, (ok, bad)) + self.assert_no_nan_or_inf(cfunc, (bad, ok)) + + # check 1D is accepted for B (2D is done previously) + # and then that anything of higher dimension raises + oneD = np.array([1., 2.], dtype=np.float64) + cfunc, (ok, oneD) + bad = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], dtype=np.float64) + self.assert_wrong_dimensions_1D(rn, cfunc, (ok, bad)) + + # check a dimensionally invalid system raises (1D and 2D cases + # checked) + bad1D = np.array([1.], dtype=np.float64) + bad2D = np.array([[1.], [2.], [3.]], dtype=np.float64) + self.assert_dimensionally_invalid(cfunc, (ok, bad1D)) + self.assert_dimensionally_invalid(cfunc, (ok, bad2D)) + + @needs_lapack + def test_issue3368(self): + X = np.array([[1., 7.54, 6.52], + [1., 2.70, 4.00], + [1., 2.50, 3.80], + [1., 1.15, 5.64], + [1., 4.22, 3.27], + [1., 1.41, 5.70],], order='F') + + X_orig = np.copy(X) + y = np.array([1., 2., 3., 4., 5., 6.]) + + @jit(nopython=True) + def f2(X, y, test): + if test: + # never executed, but necessary to trigger the bug + X = X[1:2, :] + return np.linalg.lstsq(X, y) + + f2(X, y, False) + np.testing.assert_allclose(X, X_orig) + + +class TestLinalgSolve(TestLinalgSystems): + """ + Tests for np.linalg.solve. + """ + + @needs_lapack + def test_linalg_solve(self): + """ + Test np.linalg.solve + """ + cfunc = jit(nopython=True)(solve_system) + + def check(a, b, **kwargs): + expected = solve_system(a, b, **kwargs) + got = cfunc(a, b, **kwargs) + + # check that the computed results are contig and in the same way + self.assert_contig_sanity(got, "F") + + use_reconstruction = False + # try plain match of the result first + try: + np.testing.assert_array_almost_equal_nulp( + got, expected, nulp=10) + except AssertionError: + # plain match failed, test by reconstruction + use_reconstruction = True + + # If plain match fails then reconstruction is used, + # this checks that AX ~= B. + # Plain match can fail due to numerical fuzziness associated + # with system size and conditioning, or more simply from + # numpy using double precision routines for computation that + # could be done in single precision (which is what numba does). + # Therefore minor differences in results can appear due to + # e.g. numerical roundoff being different between two precisions. + if use_reconstruction: + # check they are dimensionally correct + self.assertEqual(got.shape, expected.shape) + + # check AX=B + rec = np.dot(a, got) + resolution = np.finfo(a.dtype).resolution + np.testing.assert_allclose( + b, + rec, + rtol=10 * resolution, + atol=100 * resolution # zeros tend to be fuzzy + ) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, b, **kwargs) + + # test: prime size squares + sizes = [(1, 1), (3, 3), (7, 7)] + + # test loop + for size, dtype, order in \ + product(sizes, self.dtypes, 'FC'): + A = self.specific_sample_matrix(size, dtype, order) + + b_sizes = (1, 13) + + for b_size, b_order in product(b_sizes, 'FC'): + # check 2D B + B = self.specific_sample_matrix( + (A.shape[0], b_size), dtype, b_order) + check(A, B) + + # check 1D B + tmp = B[:, 0].copy(order=b_order) + check(A, tmp) + + # check empty + cfunc(np.empty((0, 0)), np.empty((0,))) + + # Test input validation + ok = np.array([[1., 0.], [0., 1.]], dtype=np.float64) + + # check ok input is ok + cfunc(ok, ok) + + # check bad inputs + rn = "solve" + + # Wrong dtype + bad = np.array([[1, 0], [0, 1]], dtype=np.int32) + self.assert_wrong_dtype(rn, cfunc, (ok, bad)) + self.assert_wrong_dtype(rn, cfunc, (bad, ok)) + + # different dtypes + bad = np.array([[1, 2], [3, 4]], dtype=np.float32) + self.assert_homogeneous_dtypes(rn, cfunc, (ok, bad)) + self.assert_homogeneous_dtypes(rn, cfunc, (bad, ok)) + + # Dimension issue + bad = np.array([1, 0], dtype=np.float64) + self.assert_wrong_dimensions(rn, cfunc, (bad, ok)) + + # no nans or infs + bad = np.array([[1., 0., ], [np.inf, np.nan]], dtype=np.float64) + self.assert_no_nan_or_inf(cfunc, (ok, bad)) + self.assert_no_nan_or_inf(cfunc, (bad, ok)) + + # check 1D is accepted for B (2D is done previously) + # and then that anything of higher dimension raises + ok_oneD = np.array([1., 2.], dtype=np.float64) + cfunc(ok, ok_oneD) + bad = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], dtype=np.float64) + self.assert_wrong_dimensions_1D(rn, cfunc, (ok, bad)) + + # check an invalid system raises (1D and 2D cases checked) + bad1D = np.array([1.], dtype=np.float64) + bad2D = np.array([[1.], [2.], [3.]], dtype=np.float64) + self.assert_dimensionally_invalid(cfunc, (ok, bad1D)) + self.assert_dimensionally_invalid(cfunc, (ok, bad2D)) + + # check that a singular system raises + bad2D = self.specific_sample_matrix((2, 2), np.float64, 'C', rank=1) + self.assert_raise_on_singular(cfunc, (bad2D, ok)) + + @needs_lapack + def test_no_input_mutation(self): + X = np.array([[1., 1, 1, 1], + [0., 1, 1, 1], + [0., 0, 1, 1], + [1., 0, 0, 1],], order='F') + + X_orig = np.copy(X) + y = np.array([1., 2., 3., 4]) + y_orig = np.copy(y) + + @jit(nopython=True) + def func(X, y, test): + if test: + # not executed, triggers A order in X + X = X[1:2, :] + return np.linalg.solve(X, y) + + expected = func.py_func(X, y, False) + np.testing.assert_allclose(X, X_orig) + np.testing.assert_allclose(y, y_orig) + + got = func(X, y, False) + np.testing.assert_allclose(X, X_orig) + np.testing.assert_allclose(y, y_orig) + + np.testing.assert_allclose(expected, got) + + +class TestLinalgPinv(TestLinalgBase): + """ + Tests for np.linalg.pinv. + """ + + @needs_lapack + def test_linalg_pinv(self): + """ + Test np.linalg.pinv + """ + cfunc = jit(nopython=True)(pinv_matrix) + + def check(a, **kwargs): + expected = pinv_matrix(a, **kwargs) + got = cfunc(a, **kwargs) + + # check that the computed results are contig and in the same way + self.assert_contig_sanity(got, "F") + + use_reconstruction = False + # try plain match of each array to np first + + try: + np.testing.assert_array_almost_equal_nulp( + got, expected, nulp=10) + except AssertionError: + # plain match failed, test by reconstruction + use_reconstruction = True + + # If plain match fails then reconstruction is used. + # This can occur due to numpy using double precision + # LAPACK when single can be used, this creates round off + # problems. Also, if the matrix has machine precision level + # zeros in its singular values then the singular vectors are + # likely to vary depending on round off. + if use_reconstruction: + + # check they are dimensionally correct + self.assertEqual(got.shape, expected.shape) + + # check pinv(A)*A~=eye + # if the problem is numerical fuzz then this will probably + # work, if the problem is rank deficiency then it won't! + rec = np.dot(got, a) + try: + self.assert_is_identity_matrix(rec) + except AssertionError: + # check A=pinv(pinv(A)) + resolution = 5 * np.finfo(a.dtype).resolution + rec = cfunc(got) + np.testing.assert_allclose( + rec, + a, + rtol=10 * resolution, + atol=100 * resolution # zeros tend to be fuzzy + ) + if a.shape[0] >= a.shape[1]: + # if it is overdetermined or fully determined + # use numba lstsq function (which is type specific) to + # compute the inverse and check against that. + lstsq = jit(nopython=True)(lstsq_system) + lstsq_pinv = lstsq( + a, np.eye( + a.shape[0]).astype( + a.dtype), **kwargs)[0] + np.testing.assert_allclose( + got, + lstsq_pinv, + rtol=10 * resolution, + atol=100 * resolution # zeros tend to be fuzzy + ) + # check the 2 norm of the difference is small + self.assertLess(np.linalg.norm(got - expected), resolution) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + # test: column vector, tall, wide, square, row vector + # prime sizes + sizes = [(7, 1), (11, 5), (5, 11), (3, 3), (1, 7)] + + # When required, a specified condition number + specific_cond = 10. + + # test loop + for size, dtype, order in \ + product(sizes, self.dtypes, 'FC'): + # check a full rank matrix + a = self.specific_sample_matrix(size, dtype, order) + check(a) + + m, n = size + if m != 1 and n != 1: + # check a rank deficient matrix + minmn = min(m, n) + a = self.specific_sample_matrix(size, dtype, order, + condition=specific_cond) + rcond = 1. / specific_cond + approx_half_rank_rcond = minmn * rcond + check(a, rcond=approx_half_rank_rcond) + + # check empty + for sz in [(0, 1), (1, 0)]: + check(np.empty(sz)) + + rn = "pinv" + + # Wrong dtype + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue + self.assert_wrong_dimensions(rn, cfunc, + (np.ones(10, dtype=np.float64),)) + + # no nans or infs + self.assert_no_nan_or_inf(cfunc, + (np.array([[1., 2., ], [np.inf, np.nan]], + dtype=np.float64),)) + + @needs_lapack + def test_issue5870(self): + # testing for mutation of input matrix + @jit(nopython=True) + def some_fn(v): + return np.linalg.pinv(v[0]) + + v_data = np.array([[1., 3, 2, 7,], + [-5, 4, 2, 3,], + [9, -3, 1, 1,], + [2, -2, 2, 8,]], order='F') + + v_orig = np.copy(v_data) + reshaped_v = v_data.reshape((1, 4, 4)) + + expected = some_fn.py_func(reshaped_v) + np.testing.assert_allclose(v_data, v_orig) + + got = some_fn(reshaped_v) + np.testing.assert_allclose(v_data, v_orig) + + np.testing.assert_allclose(expected, got) + + +class TestLinalgDetAndSlogdet(TestLinalgBase): + """ + Tests for np.linalg.det. and np.linalg.slogdet. + Exactly the same inputs are used for both tests as + det() is a trivial function of slogdet(), the tests + are therefore combined. + """ + + def check_det(self, cfunc, a, **kwargs): + expected = det_matrix(a, **kwargs) + got = cfunc(a, **kwargs) + + resolution = 5 * np.finfo(a.dtype).resolution + + # check the determinants are the same + np.testing.assert_allclose(got, expected, rtol=resolution) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + def check_slogdet(self, cfunc, a, **kwargs): + expected = slogdet_matrix(a, **kwargs) + got = cfunc(a, **kwargs) + + # As numba returns python floats types and numpy returns + # numpy float types, some more adjustment and different + # types of comparison than those used with array based + # results is required. + + # check that the returned tuple is same length + self.assertEqual(len(expected), len(got)) + # and that length is 2 + self.assertEqual(len(got), 2) + + # check that the domain of the results match + for k in range(2): + self.assertEqual( + np.iscomplexobj(got[k]), + np.iscomplexobj(expected[k])) + + # turn got[0] into the same dtype as `a` + # this is so checking with nulp will work + got_conv = a.dtype.type(got[0]) + np.testing.assert_array_almost_equal_nulp( + got_conv, expected[0], nulp=10) + # compare log determinant magnitude with a more fuzzy value + # as numpy values come from higher precision lapack routines + resolution = 5 * np.finfo(a.dtype).resolution + np.testing.assert_allclose( + got[1], expected[1], rtol=resolution, atol=resolution) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + def do_test(self, rn, check, cfunc): + + # test: 1x1 as it is unusual, 4x4 as it is even and 7x7 as is it odd! + sizes = [(1, 1), (4, 4), (7, 7)] + + # test loop + for size, dtype, order in \ + product(sizes, self.dtypes, 'FC'): + # check a full rank matrix + a = self.specific_sample_matrix(size, dtype, order) + check(cfunc, a) + + # use a matrix of zeros to trip xgetrf U(i,i)=0 singular test + for dtype, order in product(self.dtypes, 'FC'): + a = np.zeros((3, 3), dtype=dtype) + check(cfunc, a) + + # check empty + check(cfunc, np.empty((0, 0))) + + # Wrong dtype + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue + self.assert_wrong_dimensions(rn, cfunc, + (np.ones(10, dtype=np.float64),)) + + # no nans or infs + self.assert_no_nan_or_inf(cfunc, + (np.array([[1., 2., ], [np.inf, np.nan]], + dtype=np.float64),)) + + @needs_lapack + def test_linalg_det(self): + cfunc = jit(nopython=True)(det_matrix) + self.do_test("det", self.check_det, cfunc) + + @needs_lapack + def test_linalg_slogdet(self): + cfunc = jit(nopython=True)(slogdet_matrix) + self.do_test("slogdet", self.check_slogdet, cfunc) + + @needs_lapack + def test_no_input_mutation(self): + X = np.array([[1., 3, 2, 7,], + [-5, 4, 2, 3,], + [9, -3, 1, 1,], + [2, -2, 2, 8,]], order='F') + + X_orig = np.copy(X) + + @jit(nopython=True) + def func(X, test): + if test: + # not executed, but necessary to trigger A ordering in X + X = X[1:2, :] + return np.linalg.slogdet(X) + + expected = func.py_func(X, False) + np.testing.assert_allclose(X, X_orig) + + got = func(X, False) + np.testing.assert_allclose(X, X_orig) + + np.testing.assert_allclose(expected, got) + +# Use TestLinalgSystems as a base to get access to additional +# testing for 1 and 2D inputs. + + +class TestLinalgNorm(TestLinalgSystems): + """ + Tests for np.linalg.norm. + """ + + @needs_lapack + def test_linalg_norm(self): + """ + Test np.linalg.norm + """ + cfunc = jit(nopython=True)(norm_matrix) + + def check(a, **kwargs): + expected = norm_matrix(a, **kwargs) + got = cfunc(a, **kwargs) + + # All results should be in the real domain + self.assertTrue(not np.iscomplexobj(got)) + + resolution = 5 * np.finfo(a.dtype).resolution + + # check the norms are the same to the arg `a` precision + np.testing.assert_allclose(got, expected, rtol=resolution) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + # Check 1D inputs + sizes = [1, 4, 7] + nrm_types = [None, np.inf, -np.inf, 0, 1, -1, 2, -2, 5, 6.7, -4.3] + + # standard 1D input + for size, dtype, nrm_type in \ + product(sizes, self.dtypes, nrm_types): + a = self.sample_vector(size, dtype) + check(a, ord=nrm_type) + + # sliced 1D input + for dtype, nrm_type in \ + product(self.dtypes, nrm_types): + a = self.sample_vector(10, dtype)[::3] + check(a, ord=nrm_type) + + # Check 2D inputs: + # test: column vector, tall, wide, square, row vector + # prime sizes + sizes = [(7, 1), (11, 5), (5, 11), (3, 3), (1, 7)] + nrm_types = [None, np.inf, -np.inf, 1, -1, 2, -2] + + # standard 2D input + for size, dtype, order, nrm_type in \ + product(sizes, self.dtypes, 'FC', nrm_types): + # check a full rank matrix + a = self.specific_sample_matrix(size, dtype, order) + check(a, ord=nrm_type) + + # check 2D slices work for the case where xnrm2 is called from + # BLAS (ord=None) to make sure it is working ok. + nrm_types = [None] + for dtype, nrm_type, order in \ + product(self.dtypes, nrm_types, 'FC'): + a = self.specific_sample_matrix((17, 13), dtype, order) + # contig for C order + check(a[:3], ord=nrm_type) + + # contig for Fortran order + check(a[:, 3:], ord=nrm_type) + + # contig for neither order + check(a[1, 4::3], ord=nrm_type) + + # check that numba returns zero for empty arrays. Numpy returns zero + # for most norm types and raises ValueError for +/-np.inf. + # there is not a great deal of consistency in Numpy's response so + # it is not being emulated in Numba + for dtype, nrm_type, order in \ + product(self.dtypes, nrm_types, 'FC'): + a = np.empty((0,), dtype=dtype, order=order) + self.assertEqual(cfunc(a, nrm_type), 0.0) + a = np.empty((0, 0), dtype=dtype, order=order) + self.assertEqual(cfunc(a, nrm_type), 0.0) + + rn = "norm" + + # Wrong dtype + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue, reuse the test from the TestLinalgSystems class + self.assert_wrong_dimensions_1D( + rn, cfunc, (np.ones( + 12, dtype=np.float64).reshape( + 2, 2, 3),)) + + # no nans or infs for 2d case when SVD is used (e.g 2-norm) + self.assert_no_nan_or_inf(cfunc, + (np.array([[1., 2.], [np.inf, np.nan]], + dtype=np.float64), 2)) + + # assert 2D input raises for an invalid norm kind kwarg + self.assert_invalid_norm_kind(cfunc, (np.array([[1., 2.], [3., 4.]], + dtype=np.float64), 6)) + + +class TestLinalgCond(TestLinalgBase): + """ + Tests for np.linalg.cond. + """ + + @needs_lapack + def test_linalg_cond(self): + """ + Test np.linalg.cond + """ + + cfunc = jit(nopython=True)(cond_matrix) + + def check(a, **kwargs): + expected = cond_matrix(a, **kwargs) + got = cfunc(a, **kwargs) + + # All results should be in the real domain + self.assertTrue(not np.iscomplexobj(got)) + + resolution = 5 * np.finfo(a.dtype).resolution + + # check the cond is the same to the arg `a` precision + np.testing.assert_allclose(got, expected, rtol=resolution) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + # valid p values (used to indicate norm type) + ps = [None, np.inf, -np.inf, 1, -1, 2, -2] + sizes = [(3, 3), (7, 7)] + + for size, dtype, order, p in \ + product(sizes, self.dtypes, 'FC', ps): + a = self.specific_sample_matrix(size, dtype, order) + check(a, p=p) + + # When p=None non-square matrices are accepted. + sizes = [(7, 1), (11, 5), (5, 11), (1, 7)] + for size, dtype, order in \ + product(sizes, self.dtypes, 'FC'): + a = self.specific_sample_matrix(size, dtype, order) + check(a) + + # empty + for sz in [(0, 1), (1, 0), (0, 0)]: + self.assert_raise_on_empty(cfunc, (np.empty(sz),)) + + # singular systems to trip divide-by-zero + x = np.array([[1, 0], [0, 0]], dtype=np.float64) + check(x) + check(x, p=2) + x = np.array([[0, 0], [0, 0]], dtype=np.float64) + check(x, p=-2) + + # try an ill-conditioned system with 2-norm, make sure np raises an + # overflow warning as the result is `+inf` and that the result from + # numba matches. + with warnings.catch_warnings(): + a = np.array([[1.e308, 0], [0, 0.1]], dtype=np.float64) + warnings.simplefilter("ignore", RuntimeWarning) + check(a) + + rn = "cond" + + # Wrong dtype + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue + self.assert_wrong_dimensions(rn, cfunc, + (np.ones(10, dtype=np.float64),)) + + # no nans or infs when p="None" (default for kwarg). + self.assert_no_nan_or_inf(cfunc, + (np.array([[1., 2., ], [np.inf, np.nan]], + dtype=np.float64),)) + + # assert raises for an invalid norm kind kwarg + self.assert_invalid_norm_kind(cfunc, (np.array([[1., 2.], [3., 4.]], + dtype=np.float64), 6)) + + +class TestLinalgMatrixRank(TestLinalgSystems): + """ + Tests for np.linalg.matrix_rank. + """ + + @needs_lapack + def test_linalg_matrix_rank(self): + """ + Test np.linalg.matrix_rank + """ + + cfunc = jit(nopython=True)(matrix_rank_matrix) + + def check(a, **kwargs): + expected = matrix_rank_matrix(a, **kwargs) + got = cfunc(a, **kwargs) + + # Ranks are integral so comparison should be trivial. + # check the rank is the same + np.testing.assert_allclose(got, expected) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + sizes = [(7, 1), (11, 5), (5, 11), (3, 3), (1, 7)] + + for size, dtype, order in \ + product(sizes, self.dtypes, 'FC'): + # check full rank system + a = self.specific_sample_matrix(size, dtype, order) + check(a) + + # If the system is a matrix, check rank deficiency is reported + # correctly. Check all ranks from 0 to (full rank - 1). + tol = 1e-13 + # first check 1 to (full rank - 1) + for k in range(1, min(size) - 1): + # check rank k + a = self.specific_sample_matrix(size, dtype, order, rank=k) + self.assertEqual(cfunc(a), k) + check(a) + # check provision of a tolerance works as expected + # create a (m x n) diagonal matrix with a singular value + # guaranteed below the tolerance 1e-13 + m, n = a.shape + a[:, :] = 0. # reuse `a`'s memory + idx = np.nonzero(np.eye(m, n)) + if np.iscomplexobj(a): + b = 1. + np.random.rand(k) + 1.j +\ + 1.j * np.random.rand(k) + # min singular value is sqrt(2)*1e-14 + b[0] = 1e-14 + 1e-14j + else: + b = 1. + np.random.rand(k) + b[0] = 1e-14 # min singular value is 1e-14 + a[idx[0][:k], idx[1][:k]] = b.astype(dtype) + # rank should be k-1 (as tol is present) + self.assertEqual(cfunc(a, tol), k - 1) + check(a, tol=tol) + # then check zero rank + a[:, :] = 0. + self.assertEqual(cfunc(a), 0) + check(a) + # add in a singular value that is small + if np.iscomplexobj(a): + a[-1, -1] = 1e-14 + 1e-14j + else: + a[-1, -1] = 1e-14 + # check the system has zero rank to a given tolerance + self.assertEqual(cfunc(a, tol), 0) + check(a, tol=tol) + + # check the zero vector returns rank 0 and a nonzero vector + # returns rank 1. + for dt in self.dtypes: + a = np.zeros((5), dtype=dt) + self.assertEqual(cfunc(a), 0) + check(a) + # make it a nonzero vector + a[0] = 1. + self.assertEqual(cfunc(a), 1) + check(a) + + # empty + for sz in [(0, 1), (1, 0), (0, 0)]: + for tol in [None, 1e-13]: + self.assert_raise_on_empty(cfunc, (np.empty(sz), tol)) + + rn = "matrix_rank" + + # Wrong dtype + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32),)) + + # Dimension issue + self.assert_wrong_dimensions_1D( + rn, cfunc, (np.ones( + 12, dtype=np.float64).reshape( + 2, 2, 3),)) + + # no nans or infs for 2D case + self.assert_no_nan_or_inf(cfunc, + (np.array([[1., 2., ], [np.inf, np.nan]], + dtype=np.float64),)) + + @needs_lapack + def test_no_input_mutation(self): + # this is here to test no input mutation by + # numba.np.linalg._compute_singular_values + # which is the workhorse for norm with 2d input, rank and cond. + + X = np.array([[1., 3, 2, 7,], + [-5, 4, 2, 3,], + [9, -3, 1, 1,], + [2, -2, 2, 8,]], order='F') + + X_orig = np.copy(X) + + @jit(nopython=True) + def func(X, test): + if test: + # not executed, but necessary to trigger A ordering in X + X = X[1:2, :] + return np.linalg.matrix_rank(X) + + expected = func.py_func(X, False) + np.testing.assert_allclose(X, X_orig) + + got = func(X, False) + np.testing.assert_allclose(X, X_orig) + + np.testing.assert_allclose(expected, got) + + +class TestLinalgMatrixPower(TestLinalgBase): + """ + Tests for np.linalg.matrix_power. + """ + + def assert_int_exponenent(self, cfunc, args): + # validate first arg is ok + cfunc(args[0], 1) + # pass in both args and assert fail + with self.assertRaises(errors.TypingError): + cfunc(*args) + + @needs_lapack + def test_linalg_matrix_power(self): + cfunc = jit(nopython=True)(matrix_power_matrix) + + def check(a, pwr): + expected = matrix_power_matrix(a, pwr) + got = cfunc(a, pwr) + + # check that the computed results are contig and in the same way + self.assert_contig_sanity(got, "C") + + res = 7 * np.finfo(a.dtype).resolution + np.testing.assert_allclose(got, expected, rtol=res, atol=res) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, pwr) + + sizes = [(1, 1), (5, 5), (7, 7)] + powers = [-33, -17] + list(range(-10, 10)) + [17, 33] + + for size, pwr, dtype, order in \ + product(sizes, powers, self.dtypes, 'FC'): + a = self.specific_sample_matrix(size, dtype, order) + check(a, pwr) + a = np.empty((0, 0), dtype=dtype, order=order) + check(a, pwr) + + rn = "matrix_power" + + # Wrong dtype + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32), 1)) + + # not an int power + self.assert_wrong_dtype(rn, cfunc, + (np.ones((2, 2), dtype=np.int32), 1)) + + # non square system + args = (np.ones((3, 5)), 1) + msg = 'input must be a square array' + self.assert_error(cfunc, args, msg) + + # Dimension issue + self.assert_wrong_dimensions(rn, cfunc, + (np.ones(10, dtype=np.float64), 1)) + + # non-integer supplied as exponent + self.assert_int_exponenent(cfunc, (np.ones((2, 2)), 1.2)) + + # singular matrix is not invertible + self.assert_raise_on_singular(cfunc, (np.array([[0., 0], [1, 1]]), -1)) + + +class TestTrace(TestLinalgBase): + """ + Tests for np.trace. + """ + + def setUp(self): + super(TestTrace, self).setUp() + # compile two versions, one with and one without the offset kwarg + self.cfunc_w_offset = jit(nopython=True)(trace_matrix) + self.cfunc_no_offset = jit(nopython=True)(trace_matrix_no_offset) + + def assert_int_offset(self, cfunc, a, **kwargs): + # validate first arg is ok + cfunc(a) + # pass in kwarg and assert fail + with self.assertRaises(errors.TypingError): + cfunc(a, **kwargs) + + def test_trace(self): + + def check(a, **kwargs): + if 'offset' in kwargs: + expected = trace_matrix(a, **kwargs) + cfunc = self.cfunc_w_offset + else: + expected = trace_matrix_no_offset(a, **kwargs) + cfunc = self.cfunc_no_offset + + got = cfunc(a, **kwargs) + + res = 5 * np.finfo(a.dtype).resolution + np.testing.assert_allclose(got, expected, rtol=res, atol=res) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + # test: column vector, tall, wide, square, row vector + # prime sizes + sizes = [(7, 1), (11, 5), (5, 11), (3, 3), (1, 7)] + + # offsets to cover the range of the matrix sizes above + offsets = [-13, -12, -11] + list(range(-10, 10)) + [11, 12, 13] + + for size, offset, dtype, order in \ + product(sizes, offsets, self.dtypes, 'FC'): + a = self.specific_sample_matrix(size, dtype, order) + check(a, offset=offset) + if offset == 0: + check(a) + a = np.empty((0, 0), dtype=dtype, order=order) + check(a, offset=offset) + if offset == 0: + check(a) + + rn = "trace" + + # Dimension issue + self.assert_wrong_dimensions(rn, self.cfunc_w_offset, + (np.ones(10, dtype=np.float64), 1), False) + self.assert_wrong_dimensions(rn, self.cfunc_no_offset, + (np.ones(10, dtype=np.float64),), False) + + # non-integer supplied as exponent + self.assert_int_offset( + self.cfunc_w_offset, np.ones( + (2, 2)), offset=1.2) + + def test_trace_w_optional_input(self): + "Issue 2314" + @jit("(optional(float64[:,:]),)", nopython=True) + def tested(a): + return np.trace(a) + + a = np.ones((5, 5), dtype=np.float64) + tested(a) + + with self.assertRaises(TypeError) as raises: + tested(None) + + errmsg = str(raises.exception) + self.assertEqual('expected array(float64, 2d, A), got None', errmsg) + + +class TestBasics(TestLinalgSystems): # TestLinalgSystems for 1d test + + order1 = cycle(['F', 'C', 'C', 'F']) + order2 = cycle(['C', 'F', 'C', 'F']) + + # test: column vector, matrix, row vector, 1d sizes + # (7, 1, 3) and two scalars + sizes = [(7, 1), (3, 3), (1, 7), (7,), (1,), (3,), 3., 5.] + + def _assert_wrong_dim(self, rn, cfunc): + # Dimension issue + self.assert_wrong_dimensions_1D( + rn, cfunc, (np.array([[[1]]], dtype=np.float64), np.ones(1)), False) + self.assert_wrong_dimensions_1D( + rn, cfunc, (np.ones(1), np.array([[[1]]], dtype=np.float64)), False) + + def _gen_input(self, size, dtype, order): + if not isinstance(size, tuple): + return size + else: + if len(size) == 1: + return self.sample_vector(size[0], dtype) + else: + return self.sample_vector( + size[0] * size[1], + dtype).reshape( + size, order=order) + + def _get_input(self, size1, size2, dtype): + a = self._gen_input(size1, dtype, next(self.order1)) + b = self._gen_input(size2, dtype, next(self.order2)) + # force domain consistency as underlying ufuncs require it + if np.iscomplexobj(a): + b = b + 1j + if np.iscomplexobj(b): + a = a + 1j + return (a, b) + + def test_outer(self): + cfunc = jit(nopython=True)(outer_matrix) + + def check(a, b, **kwargs): + + # check without kwargs + expected = outer_matrix(a, b) + got = cfunc(a, b) + + res = 5 * np.finfo(np.asarray(a).dtype).resolution + np.testing.assert_allclose(got, expected, rtol=res, atol=res) + + # if kwargs present check with them too + if 'out' in kwargs: + got = cfunc(a, b, **kwargs) + np.testing.assert_allclose(got, expected, rtol=res, + atol=res) + np.testing.assert_allclose(kwargs['out'], expected, + rtol=res, atol=res) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, b, **kwargs) + + dts = cycle(self.dtypes) + for size1, size2 in product(self.sizes, self.sizes): + dtype = next(dts) + (a, b) = self._get_input(size1, size2, dtype) + check(a, b) + c = np.empty((np.asarray(a).size, np.asarray(b).size), + dtype=np.asarray(a).dtype) + check(a, b, out=c) + + self._assert_wrong_dim("outer", cfunc) + + def test_kron(self): + cfunc = jit(nopython=True)(kron_matrix) + + def check(a, b, **kwargs): + + expected = kron_matrix(a, b) + got = cfunc(a, b) + + res = 5 * np.finfo(np.asarray(a).dtype).resolution + np.testing.assert_allclose(got, expected, rtol=res, atol=res) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, b) + + for size1, size2, dtype in \ + product(self.sizes, self.sizes, self.dtypes): + (a, b) = self._get_input(size1, size2, dtype) + check(a, b) + + self._assert_wrong_dim("kron", cfunc) + + args = (np.empty(10)[::2], np.empty(10)[::2]) + msg = "only supports 'C' or 'F' layout" + self.assert_error(cfunc, args, msg, err=errors.TypingError) + + +class TestHelpers(TestCase): + def test_copy_to_fortran_order(self): + from numba.np.linalg import _copy_to_fortran_order + + def check(udt, expectfn, shapes, dtypes, orders): + for shape, dtype, order in product(shapes, dtypes, orders): + a = np.arange(np.prod(shape)).reshape(shape, order=order) + + r = udt(a) + # check correct operation + self.assertPreciseEqual(expectfn(a), r) + # check new copy has made + self.assertNotEqual(a.ctypes.data, r.ctypes.data) + + @njit + def direct_call(a): + return _copy_to_fortran_order(a) + + shapes = [(3, 4), (3, 2, 5)] + dtypes = [np.intp] + orders = ['C', 'F'] + check(direct_call, np.asfortranarray, shapes, dtypes, orders) + + + @njit + def slice_to_any(a): + # make a 'any' layout slice + sliced = a[::2][0] + return _copy_to_fortran_order(sliced) + + shapes = [(3, 3, 4), (3, 3, 2, 5)] + dtypes = [np.intp] + orders = ['C', 'F'] + + def expected_slice_to_any(a): + # make a 'any' layout slice + sliced = a[::2][0] + return np.asfortranarray(sliced) + + check(slice_to_any, expected_slice_to_any, shapes, dtypes, orders) + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_listimpl.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_listimpl.py new file mode 100644 index 0000000000000000000000000000000000000000..f55e2369a4208903951ea1b5d2e910028cd1a2a9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_listimpl.py @@ -0,0 +1,527 @@ +""" +Testing C implementation of the numba typed-list +""" + +import ctypes +import struct + +from numba.tests.support import TestCase +from numba import _helperlib + + +LIST_OK = 0 +LIST_ERR_INDEX = -1 +LIST_ERR_NO_MEMORY = -2 +LIST_ERR_MUTATED = -3 +LIST_ERR_ITER_EXHAUSTED = -4 +LIST_ERR_IMMUTABLE = -5 + + +class List(object): + """A wrapper around the C-API to provide a minimal list object for + testing. + """ + def __init__(self, tc, item_size, allocated): + """ + Parameters + ---------- + tc : TestCase instance + item_size : int + byte size for the items + allocated : int + number of items to allocate for + """ + self.tc = tc + self.item_size = item_size + self.lp = self.list_new(item_size, allocated) + + # The following methods implement part of the list API + + def __del__(self): + self.tc.numba_list_free(self.lp) + + def __len__(self): + return self.list_length() + + def __setitem__(self, i, item): + return self.list_setitem(i, item) + + def __getitem__(self, i): + return self.list_getitem(i) + + def __iter__(self): + return ListIter(self) + + def __delitem__(self, i): + self.list_delitem(i) + + def handle_index(self, i): + # handling negative indices is done at the compiler level, so we only + # support -1 to be last element of the list here + if i < -1 or len(self) == 0: + IndexError("list index out of range") + elif i == -1: + i = len(self) - 1 + return i + + @property + def allocated(self): + return self.list_allocated() + + @property + def is_mutable(self): + return self.list_is_mutable() + + def set_mutable(self): + return self.list_set_is_mutable(1) + + def set_immutable(self): + return self.list_set_is_mutable(0) + + def append(self, item): + self.list_append(item) + + def pop(self, i=-1): + return self.list_pop(i) + + # The methods below are higher-level wrappers for the C-API wrappers + + def list_new(self, item_size, allocated): + lp = ctypes.c_void_p() + status = self.tc.numba_list_new( + ctypes.byref(lp), item_size, allocated, + ) + self.tc.assertEqual(status, LIST_OK) + return lp + + def list_length(self): + return self.tc.numba_list_length(self.lp) + + def list_allocated(self): + return self.tc.numba_list_allocated(self.lp) + + def list_is_mutable(self): + return self.tc.numba_list_is_mutable(self.lp) + + def list_set_is_mutable(self, is_mutable): + return self.tc.numba_list_set_is_mutable(self.lp, is_mutable) + + def list_setitem(self, i, item): + status = self.tc.numba_list_setitem(self.lp, i, item) + if status == LIST_ERR_INDEX: + raise IndexError("list index out of range") + elif status == LIST_ERR_IMMUTABLE: + raise ValueError("list is immutable") + else: + self.tc.assertEqual(status, LIST_OK) + + def list_getitem(self, i): + i = self.handle_index(i) + item_out_buffer = ctypes.create_string_buffer(self.item_size) + status = self.tc.numba_list_getitem(self.lp, i, item_out_buffer) + if status == LIST_ERR_INDEX: + raise IndexError("list index out of range") + else: + self.tc.assertEqual(status, LIST_OK) + return item_out_buffer.raw + + def list_append(self, item): + status = self.tc.numba_list_append(self.lp, item) + if status == LIST_ERR_IMMUTABLE: + raise ValueError("list is immutable") + self.tc.assertEqual(status, LIST_OK) + + def list_pop(self, i): + # pop is getitem and delitem + i = self.handle_index(i) + item = self.list_getitem(i) + self.list_delitem(i) + return item + + def list_delitem(self, i): + # special case slice + if isinstance(i, slice): + status = self.tc.numba_list_delete_slice(self.lp, + i.start, + i.stop, + i.step) + if status == LIST_ERR_IMMUTABLE: + raise ValueError("list is immutable") + self.tc.assertEqual(status, LIST_OK) + # must be an integer, defer to delitem + else: + i = self.handle_index(i) + status = self.tc.numba_list_delitem(self.lp, i) + if status == LIST_ERR_INDEX: + raise IndexError("list index out of range") + elif status == LIST_ERR_IMMUTABLE: + raise ValueError("list is immutable") + self.tc.assertEqual(status, LIST_OK) + + def list_iter(self, itptr): + self.tc.numba_list_iter(itptr, self.lp) + + def list_iter_next(self, itptr): + bi = ctypes.c_void_p(0) + status = self.tc.numba_list_iter_next( + itptr, ctypes.byref(bi), + ) + if status == LIST_ERR_MUTATED: + raise ValueError('list mutated') + elif status == LIST_ERR_ITER_EXHAUSTED: + raise StopIteration + else: + self.tc.assertGreaterEqual(status, 0) + item = (ctypes.c_char * self.item_size).from_address(bi.value) + return item.value + + +class ListIter(object): + """An iterator for the `List`. + """ + def __init__(self, parent): + self.parent = parent + itsize = self.parent.tc.numba_list_iter_sizeof() + self.it_state_buf = (ctypes.c_char_p * itsize)(0) + self.it = ctypes.cast(self.it_state_buf, ctypes.c_void_p) + self.parent.list_iter(self.it) + + def __iter__(self): + return self + + def __next__(self): + return self.parent.list_iter_next(self.it) + + next = __next__ # needed for py2 only + + +class TestListImpl(TestCase): + def setUp(self): + """Bind to the c_helper library and provide the ctypes wrapper. + """ + list_t = ctypes.c_void_p + iter_t = ctypes.c_void_p + + def wrap(name, restype, argtypes=()): + proto = ctypes.CFUNCTYPE(restype, *argtypes) + return proto(_helperlib.c_helpers[name]) + + # numba_test_list() + self.numba_test_list = wrap( + 'test_list', + ctypes.c_int, + ) + + # numba_list_new(NB_List *l, Py_ssize_t item_size, Py_ssize_t allocated) + self.numba_list_new = wrap( + 'list_new', + ctypes.c_int, + [ctypes.POINTER(list_t), ctypes.c_ssize_t, ctypes.c_ssize_t], + ) + # numba_list_free(NB_List *l) + self.numba_list_free = wrap( + 'list_free', + None, + [list_t], + ) + # numba_list_length(NB_List *l) + self.numba_list_length = wrap( + 'list_length', + ctypes.c_int, + [list_t], + ) + # numba_list_allocated(NB_List *l) + self.numba_list_allocated = wrap( + 'list_allocated', + ctypes.c_int, + [list_t], + ) + # numba_list_is_mutable(NB_List *lp) + self.numba_list_is_mutable = wrap( + 'list_is_mutable', + ctypes.c_int, + [list_t], + ) + # numba_list_set_is_mutable(NB_List *lp, int is_mutable) + self.numba_list_set_is_mutable = wrap( + 'list_set_is_mutable', + None, + [list_t, ctypes.c_int], + ) + # numba_list_setitem(NB_List *l, Py_ssize_t i, const char *item) + self.numba_list_setitem = wrap( + 'list_setitem', + ctypes.c_int, + [list_t, ctypes.c_ssize_t, ctypes.c_char_p], + ) + # numba_list_append(NB_List *l, const char *item) + self.numba_list_append = wrap( + 'list_append', + ctypes.c_int, + [list_t, ctypes.c_char_p], + ) + # numba_list_getitem(NB_List *l, Py_ssize_t i, char *out) + self.numba_list_getitem = wrap( + 'list_getitem', + ctypes.c_int, + [list_t, ctypes.c_ssize_t, ctypes.c_char_p], + ) + # numba_list_delitem(NB_List *l, Py_ssize_t i) + self.numba_list_delitem = wrap( + 'list_delitem', + ctypes.c_int, + [list_t, ctypes.c_ssize_t], + ) + # numba_list_delete_slice(NB_List *l, + # Py_ssize_t start, + # Py_ssize_t stop, + # Py_ssize_t step) + self.numba_list_delete_slice = wrap( + 'list_delete_slice', + ctypes.c_int, + [list_t, ctypes.c_ssize_t, ctypes.c_ssize_t, ctypes.c_ssize_t], + ) + # numba_list_iter_sizeof() + self.numba_list_iter_sizeof = wrap( + 'list_iter_sizeof', + ctypes.c_size_t, + ) + # numba_list_iter(NB_ListIter *it, NB_List *l) + self.numba_list_iter = wrap( + 'list_iter', + None, + [ + iter_t, + list_t, + ], + ) + # numba_list_iter_next(NB_ListIter *it, const char **item_ptr) + self.numba_list_iter_next = wrap( + 'list_iter_next', + ctypes.c_int, + [ + iter_t, # it + ctypes.POINTER(ctypes.c_void_p), # item_ptr + ], + ) + + def test_simple_c_test(self): + # Runs the basic test in C. + ret = self.numba_test_list() + self.assertEqual(ret, 0) + + def test_length(self): + l = List(self, 8, 0) + self.assertEqual(len(l), 0) + + def test_allocation(self): + for i in range(16): + l = List(self, 8, i) + self.assertEqual(len(l), 0) + self.assertEqual(l.allocated, i) + + def test_append_get_string(self): + l = List(self, 8, 1) + l.append(b"abcdefgh") + self.assertEqual(len(l), 1) + r = l[0] + self.assertEqual(r, b"abcdefgh") + + def test_append_get_int(self): + l = List(self, 8, 1) + l.append(struct.pack("q", 1)) + self.assertEqual(len(l), 1) + r = struct.unpack("q", l[0])[0] + self.assertEqual(r, 1) + + def test_append_get_string_realloc(self): + l = List(self, 8, 1) + l.append(b"abcdefgh") + self.assertEqual(len(l), 1) + l.append(b"hijklmno") + self.assertEqual(len(l), 2) + r = l[1] + self.assertEqual(r, b"hijklmno") + + def test_set_item_getitem_index_error(self): + l = List(self, 8, 0) + with self.assertRaises(IndexError): + l[0] + with self.assertRaises(IndexError): + l[0] = b"abcdefgh" + + def test_iter(self): + l = List(self, 1, 0) + values = [b'a', b'b', b'c', b'd', b'e', b'f', b'g', b'h'] + for i in values: + l.append(i) + received = [] + for j in l: + received.append(j) + self.assertEqual(values, received) + + def test_pop(self): + l = List(self, 1, 0) + values = [b'a', b'b', b'c', b'd', b'e', b'f', b'g', b'h'] + for i in values: + l.append(i) + self.assertEqual(len(l), 8) + + received = l.pop() + self.assertEqual(b'h', received) + self.assertEqual(len(l), 7) + received = [j for j in l] + self.assertEqual(received, values[:-1]) + + received = l.pop(0) + self.assertEqual(b'a', received) + self.assertEqual(len(l), 6) + + received = l.pop(2) + self.assertEqual(b'd', received) + self.assertEqual(len(l), 5) + + expected = [b'b', b'c', b'e', b'f', b'g'] + received = [j for j in l] + self.assertEqual(received, expected) + + def test_pop_index_error(self): + l = List(self, 8, 0) + with self.assertRaises(IndexError): + l.pop() + + def test_pop_byte(self): + l = List(self, 4, 0) + values = [b'aaaa', b'bbbb', b'cccc', b'dddd', + b'eeee', b'ffff', b'gggg', b'hhhhh'] + for i in values: + l.append(i) + self.assertEqual(len(l), 8) + + received = l.pop() + self.assertEqual(b'hhhh', received) + self.assertEqual(len(l), 7) + received = [j for j in l] + self.assertEqual(received, values[:-1]) + + received = l.pop(0) + self.assertEqual(b'aaaa', received) + self.assertEqual(len(l), 6) + + received = l.pop(2) + self.assertEqual(b'dddd', received) + self.assertEqual(len(l), 5) + + expected = [b'bbbb', b'cccc', b'eeee', b'ffff', b'gggg'] + received = [j for j in l] + self.assertEqual(received, expected) + + def test_delitem(self): + l = List(self, 1, 0) + values = [b'a', b'b', b'c', b'd', b'e', b'f', b'g', b'h'] + for i in values: + l.append(i) + self.assertEqual(len(l), 8) + + # delete first item + del l[0] + self.assertEqual(len(l), 7) + self.assertEqual(list(l), values[1:]) + # delete last item + del l[-1] + self.assertEqual(len(l), 6) + self.assertEqual(list(l), values[1:-1]) + # delete item from middle + del l[2] + self.assertEqual(len(l), 5) + self.assertEqual(list(l), [b'b', b'c', b'e', b'f', b'g']) + + def test_delete_slice(self): + l = List(self, 1, 0) + values = [b'a', b'b', b'c', b'd', b'e', b'f', b'g', b'h'] + for i in values: + l.append(i) + self.assertEqual(len(l), 8) + + # delete every second item + # no slice default normalization here, be explicit about start anb stop + del l[0:8:2] + self.assertEqual(len(l), 4) + self.assertEqual(list(l), values[1:8:2]) + + # delete first item + del l[0:1:1] + self.assertEqual(len(l), 3) + self.assertEqual(list(l), [b'd', b'f', b'h']) + + # delete last item + del l[2:3:1] + self.assertEqual(len(l), 2) + self.assertEqual(list(l), [b'd', b'f']) + + # delete all left items + del l[0:2:1] + self.assertEqual(len(l), 0) + self.assertEqual(list(l), []) + + def check_sizing(self, item_size, nmax): + # Helper to verify different item_sizes + l = List(self, item_size, 0) + + def make_item(v): + tmp = "{:0{}}".format(nmax - v - 1, item_size).encode("latin-1") + return tmp[:item_size] + + for i in range(nmax): + l.append(make_item(i)) + + self.assertEqual(len(l), nmax) + + for i in range(nmax): + self.assertEqual(l[i], make_item(i)) + + def test_sizing(self): + # Check different sizes of the key & value. + for i in range(1, 16): + self.check_sizing(item_size=i, nmax=2**i) + + def test_mutability(self): + # setup and populate a singleton + l = List(self, 8, 1) + one = struct.pack("q", 1) + l.append(one) + self.assertTrue(l.is_mutable) + self.assertEqual(len(l), 1) + r = struct.unpack("q", l[0])[0] + self.assertEqual(r, 1) + + # set to immutable and test guards + l.set_immutable() + self.assertFalse(l.is_mutable) + # append + with self.assertRaises(ValueError) as raises: + l.append(one) + self.assertIn("list is immutable", str(raises.exception)) + # setitem + with self.assertRaises(ValueError) as raises: + l[0] = one + self.assertIn("list is immutable", str(raises.exception)) + # pop + with self.assertRaises(ValueError) as raises: + l.pop() + self.assertIn("list is immutable", str(raises.exception)) + # delitem with index + with self.assertRaises(ValueError) as raises: + del l[0] + self.assertIn("list is immutable", str(raises.exception)) + # delitem with slice + with self.assertRaises(ValueError) as raises: + del l[0:1:1] + self.assertIn("list is immutable", str(raises.exception)) + l.set_mutable() + + # check that nothing has changed + self.assertTrue(l.is_mutable) + self.assertEqual(len(l), 1) + r = struct.unpack("q", l[0])[0] + self.assertEqual(r, 1) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_listobject.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_listobject.py new file mode 100644 index 0000000000000000000000000000000000000000..1d3d8b3aa6c984f9c234764e0b810e3c1c98b9b0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_listobject.py @@ -0,0 +1,1652 @@ +""" Tests for the compiler components of the Numba typed-list. + +The tests here should exercise everything within an `@njit` context. +Importantly, the tests should not return a typed list from within such a +context as this would require code from numba/typed/typedlist.py (this is +tested separately). Tests in this file build on each other in the order of +writing. For example, the first test, tests the creation, append and len of the +list. These are the barebones to do anything useful with a list. The subsequent +test for getitem assumes makes use of these three operations and therefore +assumes that they work. + +""" + +from textwrap import dedent + +from numba import njit +from numba import int32 +from numba.extending import register_jitable +from numba.core import types +from numba.core.errors import TypingError +from numba.tests.support import (TestCase, MemoryLeakMixin, override_config, + forbid_codegen) +from numba.typed import listobject, List + + +class TestCreateAppendLength(MemoryLeakMixin, TestCase): + """Test list creation, append and len. """ + + def test_list_create(self): + @njit + def foo(n): + l = listobject.new_list(int32) + for i in range(n): + l.append(i) + return len(l) + + for i in (0, 1, 2, 100): + self.assertEqual(foo(i), i) + + def test_list_create_no_jit(self): + with override_config('DISABLE_JIT', True): + with forbid_codegen(): + l = listobject.new_list(int32) + self.assertEqual(type(l), list) + + def test_nonempty_list_create_no_jit(self): + # See Issue #6001: https://github.com/numba/numba/issues/6001 + with override_config('DISABLE_JIT', True): + with forbid_codegen(): + l = List([1, 2, 3]) + self.assertEqual(type(l), list) + self.assertEqual(l, [1, 2, 3]) + + +class TestBool(MemoryLeakMixin, TestCase): + """Test list bool.""" + + def test_list_bool(self): + @njit + def foo(n): + l = listobject.new_list(int32) + for i in range(n): + l.append(i) + return bool(l) + + for i in (0, 1, 2, 100): + self.assertEqual(foo(i), i > 0) + + +class TestAllocation(MemoryLeakMixin, TestCase): + + def test_list_allocation(self): + @njit + def foo_kwarg(n): + l = listobject.new_list(int32, allocated=n) + return l._allocated() + + for i in range(16): + self.assertEqual(foo_kwarg(i), i) + + @njit + def foo_posarg(n): + l = listobject.new_list(int32, n) + return l._allocated() + for i in range(16): + self.assertEqual(foo_posarg(i), i) + + def test_list_allocation_negative(self): + @njit + def foo(): + l = listobject.new_list(int32, -1) + return l._allocated() + + with self.assertRaises(RuntimeError) as raises: + self.assertEqual(foo(), -1) + self.assertIn( + "expecting *allocated* to be >= 0", + str(raises.exception), + ) + + +class TestToFromMeminfo(MemoryLeakMixin, TestCase): + + def test_list_to_from_meminfo(self): + """ + Exercise listobject.{_as_meminfo, _from_meminfo} + """ + + @njit + def boxer(): + l = listobject.new_list(int32) + for i in range(10, 20): + l.append(i) + return listobject._as_meminfo(l) + + lsttype = types.ListType(int32) + + @njit + def unboxer(mi): + l = listobject._from_meminfo(mi, lsttype) + return l[0], l[1], l[2], l[3], l[4], l[5], l[6], l[7], l[8], l[9] + + mi = boxer() + self.assertEqual(mi.refcount, 1) + + received = list(unboxer(mi)) + expected = list(range(10, 20)) + self.assertEqual(received, expected) + + +class TestGetitem(MemoryLeakMixin, TestCase): + """Test list getitem. """ + + def test_list_getitem_singleton(self): + @njit + def foo(n): + l = listobject.new_list(int32) + l.append(n) + return l[0] + + self.assertEqual(foo(0), 0) + + def test_list_getitem_singleton_negtive_index(self): + @njit + def foo(n): + l = listobject.new_list(int32) + l.append(n) + return l[-1] + + self.assertEqual(foo(0), 0) + + def test_list_getitem_multiple(self): + @njit + def foo(i): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + return l[i] + + for i,j in ((0, 10), (9, 19), (4, 14), (-5, 15), (-1, 19), (-10, 10)): + self.assertEqual(foo(i), j) + + def test_list_getitem_empty_index_error(self): + self.disable_leak_check() + + @njit + def foo(i): + l = listobject.new_list(int32) + return l[i] + + for i in (1, 0, -1): + with self.assertRaises(IndexError) as raises: + foo(i) + self.assertIn( + "list index out of range", + str(raises.exception), + ) + + def test_list_getitem_multiple_index_error(self): + self.disable_leak_check() + + @njit + def foo(i): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + return l[i] + + for i in (10, -11): + with self.assertRaises(IndexError) as raises: + foo(i) + self.assertIn( + "list index out of range", + str(raises.exception), + ) + + def test_list_getitem_empty_typing_error(self): + self.disable_leak_check() + + @njit + def foo(i): + l = listobject.new_list(int32) + return l[i] + + for i in "xyz", 1.0, 1j: + with self.assertRaises(TypingError) as raises: + foo(i) + self.assertIn( + "list indices must be integers or slices", + str(raises.exception), + ) + + def test_list_getitem_integer_types_as_index(self): + + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(0) + return l[i] + + # try all signed integers and make sure they are cast + for t in (types.signed_domain + ): + self.assertEqual(foo((t(0))), 0) + + def test_list_getitem_different_sized_uint_index(self): + # Checks that the index type cast and ext/trunc to the + # type of the length is correct, both wraparound and + # direct index is tested via -1/0. + + for ty in types.unsigned_domain: + @njit + def foo(): + l = listobject.new_list(int32) + l.append(7) + return l[ty(0)] + + self.assertEqual(foo(), 7) + + def test_list_getitem_different_sized_int_index(self): + # Checks that the index type cast and ext/trunc to the + # type of the length is correct, both wraparound and + # direct index is tested via -1/0. + + for ty in types.signed_domain: + @njit + def foo(): + l = listobject.new_list(int32) + l.append(7) + return l[ty(0)], l[ty(-1)] + + self.assertEqual(foo(), (7, 7)) + + +class TestGetitemSlice(MemoryLeakMixin, TestCase): + """Test list getitem when indexing with slices. """ + + def test_list_getitem_empty_slice_defaults(self): + @njit + def foo(): + l = listobject.new_list(int32) + n = l[:] + return len(n) + + self.assertEqual(foo(), 0) + + def test_list_getitem_singleton_slice_defaults(self): + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + n = l[:] + return len(n) + + self.assertEqual(foo(), 1) + + def test_list_getitem_multiple_slice_defaults(self): + @njit + def foo(i): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[:] + return n[i] + + for i,j in ((0, 10), (9, 19), (4, 14), (-5, 15), (-1, 19), (-10, 10)): + self.assertEqual(foo(i), j) + + def test_list_getitem_multiple_slice_pos_start(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[5:] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (15, 16, 17, 18, 19)) + + def test_list_getitem_multiple_slice_pos_stop(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[:5] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (10, 11, 12, 13, 14)) + + def test_list_getitem_multiple_slice_pos_start_pos_stop(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[2:7] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (12, 13, 14, 15, 16)) + + def test_list_getitem_multiple_slice_pos_start_pos_stop_pos_step(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[1:9:2] + return len(n), (n[0], n[1], n[2], n[3]) + + length, items = foo() + self.assertEqual(length, 4) + self.assertEqual(items, (11, 13, 15, 17)) + + def test_list_getitem_multiple_slice_neg_start(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[-5:] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (15, 16, 17, 18, 19)) + + def test_list_getitem_multiple_slice_neg_stop(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[:-5] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (10, 11, 12, 13, 14)) + + def test_list_getitem_multiple_slice_neg_step(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[::-2] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (19, 17, 15, 13, 11)) + + def test_list_getitem_multiple_slice_pos_start_neg_step(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[4::-1] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (14, 13, 12, 11, 10)) + + def test_list_getitem_multiple_slice_neg_start_neg_step(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[-6::-1] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (14, 13, 12, 11, 10)) + + def test_list_getitem_multiple_slice_pos_stop_neg_step(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[:4:-1] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (19, 18, 17, 16, 15)) + + def test_list_getitem_multiple_slice_neg_stop_neg_step(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[:-6:-1] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (19, 18, 17, 16, 15)) + + def test_list_getitem_multiple_slice_pos_start_pos_stop_neg_step(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[8:3:-1] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (18, 17, 16, 15, 14)) + + def test_list_getitem_multiple_slice_neg_start_neg_stop_neg_step(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[-2:-7:-1] + return len(n), (n[0], n[1], n[2], n[3], n[4]) + + length, items = foo() + self.assertEqual(length, 5) + self.assertEqual(items, (18, 17, 16, 15, 14)) + + def test_list_getitem_multiple_slice_start_out_of_range(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[10:] + return len(n) + + self.assertEqual(foo(), 0) + + def test_list_getitem_multiple_slice_stop_zero(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + n = l[:0] + return len(n) + + self.assertEqual(foo(), 0) + + def test_list_getitem_multiple_slice_zero_step_index_error(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + l[::0] + + with self.assertRaises(ValueError) as raises: + foo() + self.assertIn( + "slice step cannot be zero", + str(raises.exception), + ) + + +class TestSetitem(MemoryLeakMixin, TestCase): + """Test list setitem. """ + + def test_list_setitem_singleton(self): + @njit + def foo(n): + l = listobject.new_list(int32) + l.append(0) + l[0] = n + return l[0] + + for i in (0, 1, 2, 100): + self.assertEqual(foo(i), i) + + def test_list_setitem_singleton_negative_index(self): + @njit + def foo(n): + l = listobject.new_list(int32) + l.append(0) + l[0] = n + return l[-1] + + for i in (0, 1, 2, 100): + self.assertEqual(foo(i), i) + + def test_list_setitem_singleton_index_error(self): + self.disable_leak_check() + + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(0) + l[i] = 1 + + with self.assertRaises(IndexError): + foo(1) + + with self.assertRaises(IndexError): + foo(-2) + + def test_list_setitem_multiple(self): + + @njit + def foo(i, n): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + l[i] = n + return l[i] + + for i,n in zip(range(0,10), range(20,30)): + self.assertEqual(foo(i, n), n) + + def test_list_setitem_multiple_index_error(self): + self.disable_leak_check() + + @njit + def foo(i): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + l[i] = 0 + + with self.assertRaises(IndexError): + foo(10) + + with self.assertRaises(IndexError): + foo(-11) + + def test_list_setitem_singleton_typing_error_on_index(self): + self.disable_leak_check() + + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(0) + # slice with a non-{integer,slice} + l[i] = 1 + + for i in "xyz", 1.0, 1j: + with self.assertRaises(TypingError) as raises: + foo(i) + self.assertIn( + "list indices must be integers or slices", + str(raises.exception), + ) + + def test_list_setitem_singleton_typing_error_on_item(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + # assign a non-iterable to a slice + l[:] = 1 + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "can only assign an iterable when using a slice " + "with assignment/setitem", + str(raises.exception), + ) + + def test_list_setitem_integer_types_as_index(self): + + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(0) + l[i] = 1 + return l[i] + + # try all signed integers and make sure they are cast + for t in (types.signed_domain + ): + self.assertEqual(foo((t(0))), 1) + + +class TestPop(MemoryLeakMixin, TestCase): + """Test list pop. """ + + def test_list_pop_singleton(self): + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + return l.pop(), len(l) + + self.assertEqual(foo(), (0, 0)) + + def test_list_pop_singleton_index(self): + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(0) + return l.pop(i), len(l) + + self.assertEqual(foo(0), (0, 0)) + self.assertEqual(foo(-1), (0, 0)) + + def test_list_pop_multiple(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in (10, 11, 12): + l.append(j) + return l.pop(), len(l) + + self.assertEqual(foo(), (12, 2)) + + def test_list_pop_multiple_index(self): + @njit + def foo(i): + l = listobject.new_list(int32) + for j in (10, 11, 12): + l.append(j) + return l.pop(i), len(l) + + for i, n in ((0, 10), (1, 11), (2, 12)): + self.assertEqual(foo(i), (n, 2)) + + for i, n in ((-3, 10), (-2, 11), (-1, 12)): + self.assertEqual(foo(i), (n, 2)) + + def test_list_pop_integer_types_as_index(self): + + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(0) + return l.pop(i) + + # try all signed integers and make sure they are cast + for t in (types.signed_domain + ): + self.assertEqual(foo((t(0))), 0) + + def test_list_pop_empty_index_error_no_index(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.pop() + + with self.assertRaises(IndexError) as raises: + foo() + self.assertIn( + "pop from empty list", + str(raises.exception), + ) + + def test_list_pop_empty_index_error_with_index(self): + self.disable_leak_check() + + @njit + def foo(i): + l = listobject.new_list(int32) + l.pop(i) + + with self.assertRaises(IndexError) as raises: + foo(-1) + self.assertIn( + "pop from empty list", + str(raises.exception), + ) + + with self.assertRaises(IndexError) as raises: + foo(0) + self.assertIn( + "pop from empty list", + str(raises.exception), + ) + + with self.assertRaises(IndexError) as raises: + foo(1) + self.assertIn( + "pop from empty list", + str(raises.exception), + ) + + def test_list_pop_mutiple_index_error_with_index(self): + self.disable_leak_check() + + @njit + def foo(i): + l = listobject.new_list(int32) + for j in (10, 11, 12): + l.append(j) + l.pop(i) + + with self.assertRaises(IndexError) as raises: + foo(-4) + self.assertIn( + "list index out of range", + str(raises.exception), + ) + + with self.assertRaises(IndexError) as raises: + foo(3) + self.assertIn( + "list index out of range", + str(raises.exception), + ) + + def test_list_pop_singleton_typing_error_on_index(self): + self.disable_leak_check() + + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(0) + # slice with a non-{integer,slice} + return l.pop(i) + + for i in "xyz", 1.0, 1j: + with self.assertRaises(TypingError) as raises: + foo(i) + self.assertIn( + "argument for pop must be an integer", + str(raises.exception), + ) + + +class TestListObjectDelitem(MemoryLeakMixin, TestCase): + """Test list delitem. + """ + + def test_list_singleton_delitem_index(self): + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + del l[0] + return len(l) + self.assertEqual(foo(), 0) + + def test_list_singleton_delitem_slice_defaults(self): + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + del l[:] + return len(l) + self.assertEqual(foo(), 0) + + def test_list_singleton_delitem_slice_start(self): + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + del l[0:] + return len(l) + self.assertEqual(foo(), 0) + + def test_list_singleton_delitem_slice_stop(self): + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + del l[:1] + return len(l) + self.assertEqual(foo(), 0) + + def test_list_singleton_delitem_slice_start_stop(self): + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + del l[0:1] + return len(l) + self.assertEqual(foo(), 0) + + def test_list_singleton_delitem_slice_start_step(self): + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + del l[0::1] + return len(l) + self.assertEqual(foo(), 0) + + def test_list_singleton_delitem_slice_start_stop_step(self): + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + del l[0:1:1] + return len(l) + self.assertEqual(foo(), 0) + + def test_list_multiple_delitem(self): + + @njit + def foo(): + l = listobject.new_list(int32) + for j in (10, 11, 12): + l.append(j) + del l[0] + return len(l), l[0], l[1] + self.assertEqual(foo(), (2, 11, 12)) + + def test_list_multiple_delitem_slice(self): + + @njit + def foo(): + l = listobject.new_list(int32) + for j in (10, 11, 12): + l.append(j) + del l[:] + return len(l) + self.assertEqual(foo(), 0) + + def test_list_multiple_delitem_off_by_one(self): + # this was exposing a nasty off-by-one error, leaving it in to detect + # and regressions + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + k = listobject.new_list(int32) + for j in range(10, 20): + k.append(j) + # should be a no-op + del l[-9:-20] + return k == l + self.assertTrue(foo()) + + +class TestContains(MemoryLeakMixin, TestCase): + """Test list contains. """ + + def test_list_contains_empty(self): + @njit + def foo(i): + l = listobject.new_list(int32) + return i in l + + self.assertFalse(foo(0)) + self.assertFalse(foo(1)) + + def test_list_contains_singleton(self): + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(0) + return i in l + + self.assertTrue(foo(0)) + self.assertFalse(foo(1)) + + def test_list_contains_multiple(self): + @njit + def foo(i): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + return i in l + + for i in range(10, 20): + self.assertTrue(foo(i)) + + for i in range(20, 30): + self.assertFalse(foo(i)) + + +class TestCount(MemoryLeakMixin, TestCase): + """Test list count. """ + + def test_list_count_empty(self): + @njit + def foo(i): + l = listobject.new_list(int32) + return l.count(i) + + self.assertEqual(foo(10), 0) + + def test_list_count_singleton(self): + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(10) + return l.count(i) + + self.assertEqual(foo(1), 0) + self.assertEqual(foo(10), 1) + + def test_list_count_mutiple(self): + @njit + def foo(i): + l = listobject.new_list(int32) + for j in [11, 12, 12, 13, 13, 13]: + l.append(j) + return l.count(i) + + self.assertEqual(foo(10), 0) + self.assertEqual(foo(11), 1) + self.assertEqual(foo(12), 2) + self.assertEqual(foo(13), 3) + + +class TestExtend(MemoryLeakMixin, TestCase): + """Test list extend. """ + + def test_list_extend_empty(self): + @njit + def foo(items): + l = listobject.new_list(int32) + l.extend(items) + return len(l) + + self.assertEqual(foo((1,)), 1) + self.assertEqual(foo((1,2)), 2) + self.assertEqual(foo((1,2,3)), 3) + + def test_list_extend_typing_error_non_iterable(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.extend(1) + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "extend argument must be iterable", + str(raises.exception), + ) + + +class TestInsert(MemoryLeakMixin, TestCase): + """Test list insert. """ + + def test_list_insert_empty(self): + @njit + def foo(i): + l = listobject.new_list(int32) + l.insert(i, 1) + return len(l), l[0] + + for i in (-10, -5, -1, 0, 1, 4, 9): + self.assertEqual(foo(i), (1, 1)) + + def test_list_insert_singleton(self): + @njit + def foo(i): + l = listobject.new_list(int32) + l.append(0) + l.insert(i, 1) + return len(l), l[0], l[1] + + # insert before + for i in (-10, -3, -2, -1, 0): + self.assertEqual(foo(i), (2, 1, 0)) + + # insert after + for i in (1, 2, 3, 10): + self.assertEqual(foo(i), (2, 0, 1)) + + def test_list_insert_multiple(self): + @njit + def foo(i): + l = listobject.new_list(int32) + for j in range(10): + l.append(0) + l.insert(i, 1) + return len(l), l[i] + + for i in (0, 4, 9): + self.assertEqual(foo(i), (11, 1)) + + def test_list_insert_multiple_before(self): + @njit + def foo(i): + l = listobject.new_list(int32) + for j in range(10): + l.append(0) + l.insert(i, 1) + return len(l), l[0] + + for i in (-12, -11, -10, 0): + self.assertEqual(foo(i), (11, 1)) + + def test_list_insert_multiple_after(self): + @njit + def foo(i): + l = listobject.new_list(int32) + for j in range(10): + l.append(0) + l.insert(i, 1) + return len(l), l[10] + + for i in (10, 11, 12): + self.assertEqual(foo(i), (11, 1)) + + def test_list_insert_typing_error(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.insert("a", 0) + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "list insert indices must be integers", + str(raises.exception), + ) + + +class TestRemove(MemoryLeakMixin, TestCase): + """Test list remove. """ + + def test_list_remove_empty(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.remove(0) + + with self.assertRaises(ValueError): + foo() + + def test_list_remove_singleton(self): + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + l.remove(0) + return len(l) + + self.assertEqual(foo(), 0) + + def test_list_remove_singleton_value_error(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(1) + l.remove(0) + + with self.assertRaises(ValueError): + foo() + + def test_list_remove_multiple(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + l.remove(13) + l.remove(19) + return len(l) + + self.assertEqual(foo(), 8) + + def test_list_remove_multiple_value_error(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + l.remove(23) + + with self.assertRaises(ValueError): + foo() + + +class TestClear(MemoryLeakMixin, TestCase): + """Test list clear. """ + + def test_list_clear_empty(self): + @njit + def foo(): + l = listobject.new_list(int32) + l.clear() + return len(l) + + self.assertEqual(foo(), 0) + + def test_list_clear_singleton(self): + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + l.clear() + return len(l) + + self.assertEqual(foo(), 0) + + def test_list_clear_multiple(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10): + l.append(0) + l.clear() + return len(l) + self.assertEqual(foo(), 0) + + +class TestReverse(MemoryLeakMixin, TestCase): + """Test list reverse. """ + + def test_list_reverse_empty(self): + @njit + def foo(): + l = listobject.new_list(int32) + l.reverse() + return len(l) + + self.assertEqual(foo(), 0) + + def test_list_reverse_singleton(self): + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + l.reverse() + return len(l), l[0] + + self.assertEqual(foo(), (1, 0)) + + def test_list_reverse_multiple(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 13): + l.append(j) + l.reverse() + return len(l), l[0], l[1], l[2] + self.assertEqual(foo(), (3, 12, 11, 10)) + + +class TestCopy(MemoryLeakMixin, TestCase): + """Test list copy. """ + + def test_list_copy_empty(self): + @njit + def foo(): + l = listobject.new_list(int32) + n = l.copy() + return len(l), len(n) + + self.assertEqual(foo(), (0, 0)) + + def test_list_copy_singleton(self): + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + n = l.copy() + return len(l), len(n), l[0], n[0] + + self.assertEqual(foo(), (1, 1, 0, 0)) + + def test_list_copy_multiple(self): + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 13): + l.append(j) + n = l.copy() + return len(l), len(n), l[0], l[1], l[2], l[0], l[1], l[2] + + self.assertEqual(foo(), (3, 3, 10, 11, 12, 10, 11, 12)) + + +class TestIndex(MemoryLeakMixin, TestCase): + + def test_index_singleton(self): + @njit + def foo(): + l = listobject.new_list(int32) + l.append(1) + return l.index(1) + + self.assertEqual(foo(), 0) + + def test_index_multiple(self): + @njit + def foo(i): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + return l.index(i) + + for i,v in zip(range(10), range(10,20)): + self.assertEqual(foo(v), i) + + def test_index_duplicate(self): + @njit + def foo(): + l = listobject.new_list(int32) + for _ in range(10, 20): + l.append(1) + return l.index(1) + + self.assertEqual(foo(), 0) + + def test_index_duplicate_with_start(self): + @njit + def foo(start): + l = listobject.new_list(int32) + for _ in range(10, 20): + l.append(1) + return l.index(1, start) + + for i in range(10): + self.assertEqual(foo(i), i) + + def test_index_singleton_value_error(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + return l.index(1) + + with self.assertRaises(ValueError) as raises: + foo() + self.assertIn( + "item not in list", + str(raises.exception), + ) + + def test_index_multiple_value_error(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + return l.index(23) + + with self.assertRaises(ValueError) as raises: + foo() + self.assertIn( + "item not in list", + str(raises.exception), + ) + + def test_index_multiple_value_error_start(self): + self.disable_leak_check() + + @njit + def foo(start): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + return l.index(10, start) + + self.assertEqual(foo(0), 0) + for i in range(1,10): + with self.assertRaises(ValueError) as raises: + foo(i) + self.assertIn( + "item not in list", + str(raises.exception), + ) + + def test_index_multiple_value_error_end(self): + self.disable_leak_check() + + @njit + def foo(end): + l = listobject.new_list(int32) + for j in range(10, 20): + l.append(j) + return l.index(19, 0, end) + + self.assertEqual(foo(10), 9) + for i in range(0,9): + with self.assertRaises(ValueError) as raises: + foo(i) + self.assertIn( + "item not in list", + str(raises.exception), + ) + + def test_index_typing_error_start(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + return l.index(0, start="a") + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "start argument for index must be an integer", + str(raises.exception), + ) + + def test_index_typing_error_end(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.append(0) + return l.index(0, end="a") + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "end argument for index must be an integer", + str(raises.exception), + ) + + +class TestEqualNotEqual(MemoryLeakMixin, TestCase): + """Test list equal and not equal. """ + + def test_list_empty_equal(self): + @njit + def foo(): + t = listobject.new_list(int32) + o = listobject.new_list(int32) + return t == o, t != o + + self.assertEqual(foo(), (True, False)) + + def test_list_singleton_equal(self): + @njit + def foo(): + t = listobject.new_list(int32) + t.append(0) + o = listobject.new_list(int32) + o.append(0) + return t == o, t != o + + self.assertEqual(foo(), (True, False)) + + def test_list_singleton_not_equal(self): + @njit + def foo(): + t = listobject.new_list(int32) + t.append(0) + o = listobject.new_list(int32) + o.append(1) + return t == o, t != o + + self.assertEqual(foo(), (False, True)) + + def test_list_length_mismatch(self): + @njit + def foo(): + t = listobject.new_list(int32) + t.append(0) + o = listobject.new_list(int32) + return t == o, t != o + + self.assertEqual(foo(), (False, True)) + + def test_list_multiple_equal(self): + @njit + def foo(): + t = listobject.new_list(int32) + o = listobject.new_list(int32) + for i in range(10): + t.append(i) + o.append(i) + return t == o, t != o + + self.assertEqual(foo(), (True, False)) + + def test_list_multiple_not_equal(self): + @njit + def foo(): + t = listobject.new_list(int32) + o = listobject.new_list(int32) + for i in range(10): + t.append(i) + o.append(i) + o[-1] = 42 + return t == o, t != o + + self.assertEqual(foo(), (False, True)) + + +class TestIter(MemoryLeakMixin, TestCase): + """Test list iter. """ + + def test_list_iter(self): + @njit + def foo(items): + l = listobject.new_list(int32) + l.extend(items) + # use a simple sum to check this w/o having to return a list + r = 0 + for j in l: + r += j + return r + + items = (1, 2, 3, 4) + + self.assertEqual( + foo(items), + sum(items) + ) + + def test_list_iter_self_mutation(self): + self.disable_leak_check() + + @njit + def foo(): + l = listobject.new_list(int32) + l.extend((1, 2, 3, 4)) + for i in l: + l.append(i) + + with self.assertRaises(RuntimeError) as raises: + foo() + self.assertIn( + 'list was mutated during iteration'.format(**locals()), + str(raises.exception), + ) + + +class TestStringItem(MemoryLeakMixin, TestCase): + """Test list can take strings as items. """ + + def test_string_item(self): + @njit + def foo(): + l = listobject.new_list(types.unicode_type) + l.append('a') + l.append('b') + l.append('c') + l.append('d') + return l[0], l[1], l[2], l[3] + + items = foo() + self.assertEqual(['a', 'b', 'c', 'd'], list(items)) + + +class TestItemCasting(TestCase): + + @njit + def foo(fromty, toty): + l = listobject.new_list(toty) + l.append(fromty(0)) + + def check_good(self, fromty, toty): + TestItemCasting.foo(fromty, toty) + + def check_bad(self, fromty, toty): + with self.assertRaises(TypingError) as raises: + TestItemCasting.foo(fromty, toty) + self.assertIn( + 'cannot safely cast {fromty} to {toty}'.format(**locals()), + str(raises.exception), + ) + + def test_cast_int_to(self): + self.check_good(types.int32, types.float32) + self.check_good(types.int32, types.float64) + self.check_good(types.int32, types.complex128) + self.check_good(types.int64, types.complex128) + self.check_bad(types.int32, types.complex64) + self.check_good(types.int8, types.complex64) + + def test_cast_float_to(self): + self.check_good(types.float32, types.float64) + self.check_good(types.float32, types.complex64) + self.check_good(types.float64, types.complex128) + + def test_cast_bool_to(self): + self.check_good(types.boolean, types.int32) + self.check_good(types.boolean, types.float64) + self.check_good(types.boolean, types.complex128) + + def test_cast_fail_unicode_int(self): + + @njit + def foo(): + l = listobject.new_list(int32) + l.append("xyz") + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + 'cannot safely cast unicode_type to int32', + str(raises.exception), + ) + + def test_cast_fail_int_unicode(self): + + @njit + def foo(): + l = listobject.new_list(types.unicode_type) + l.append(int32(0)) + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + 'Cannot cast int32 to unicode_type', + str(raises.exception), + ) + + +@register_jitable +def make_test_list(): + l = listobject.new_list(int32) + l.append(int32(1)) + return l + + +class TestImmutable(MemoryLeakMixin, TestCase): + + def test_is_immutable(self): + @njit + def foo(): + l = make_test_list() + return l._is_mutable() + self.assertTrue(foo()) + + def test_make_immutable_is_immutable(self): + @njit + def foo(): + l = make_test_list() + l._make_immutable() + return l._is_mutable() + self.assertFalse(foo()) + + def test_length_still_works_when_immutable(self): + @njit + def foo(): + l = make_test_list() + l._make_immutable() + return len(l),l._is_mutable() + length, mutable = foo() + self.assertEqual(length, 1) + self.assertFalse(mutable) + + def test_getitem_still_works_when_immutable(self): + @njit + def foo(): + l = make_test_list() + l._make_immutable() + return l[0], l._is_mutable() + test_item, mutable = foo() + self.assertEqual(test_item, 1) + self.assertFalse(mutable) + + def test_append_fails(self): + self.disable_leak_check() + + @njit + def foo(): + l = make_test_list() + l._make_immutable() + l.append(int32(1)) + with self.assertRaises(ValueError) as raises: + foo() + self.assertIn( + 'list is immutable', + str(raises.exception), + ) + + def test_mutation_fails(self): + """ Test that any attempt to mutate an immutable typed list fails. """ + self.disable_leak_check() + + def generate_function(line): + context = {} + exec(dedent(""" + from numba.typed import listobject + from numba import int32 + def bar(): + lst = listobject.new_list(int32) + lst.append(int32(1)) + lst._make_immutable() + zero = int32(0) + {} + """.format(line)), context) + return njit(context["bar"]) + for line in ("lst.append(zero)", + "lst[0] = zero", + "lst.pop()", + "del lst[0]", + "lst.extend((zero,))", + "lst.insert(0, zero)", + "lst.clear()", + "lst.reverse()", + "lst.sort()", + ): + foo = generate_function(line) + with self.assertRaises(ValueError) as raises: + foo() + self.assertIn( + "list is immutable", + str(raises.exception), + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_lists.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_lists.py new file mode 100644 index 0000000000000000000000000000000000000000..33eade4617cf139bdb6367af36de0206cfb338e8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_lists.py @@ -0,0 +1,1836 @@ +from collections import namedtuple +import contextlib +import itertools +import math +import sys +import ctypes as ct +import numpy as np + +from numba import jit, typeof, njit, literal_unroll, literally +import unittest +from numba.core import types, errors +from numba.tests.support import TestCase, MemoryLeakMixin +from numba.experimental import jitclass +from numba.core.extending import overload + + +Point = namedtuple('Point', ('a', 'b')) + + +def noop(x): + pass + +def unbox_usecase(x): + """ + Expect a list of numbers + """ + res = 0 + for v in x: + res += v + return res + +def unbox_usecase2(x): + """ + Expect a list of tuples + """ + res = 0 + for v in x: + res += len(v) + return res + +def unbox_usecase3(x): + """ + Expect a (number, list of numbers) tuple. + """ + a, b = x + res = a + for v in b: + res += v + return res + +def unbox_usecase4(x): + """ + Expect a (number, list of tuples) tuple. + """ + a, b = x + res = a + for v in b: + res += len(v) + return res + + +def create_list(x, y, z): + return [x, y, z] + +def create_nested_list(x, y, z, a, b, c): + return [[x, y, z], [a, b, c]] + +def list_comprehension1(): + return sum([x**2 for x in range(10)]) + +def list_comprehension2(): + return sum([x for x in range(10) if x % 2 == 0]) + +def list_comprehension3(): + return sum([math.pow(x, 2) for x in range(10)]) + +def list_comprehension4(): + return sum([x * y for x in range(10) for y in range(10)]) + +def list_comprehension5(): + return [x * 2 for x in range(10)] + +def list_comprehension6(): + return [[x for x in range(y)] for y in range(3)] + + +def list_constructor(n): + return list(range(n)) + +def list_constructor_empty(): + # cannot be typed, list is empty and no typing information is present to + # infer a type + return list() + +def list_constructor_empty_but_typeable(n): + # can be typed, list is empty but later append has typing info that allows + # for inference + y = list() + return y.append(n) + +def list_append(n): + l = [] + l.append(42) + for i in range(n): + l.append(i) + return l + +def list_append_heterogeneous(n): + l = [] + l.append(42.0) + for i in range(n): + l.append(i) + return l + +def list_extend(n): + l = [] + # A non-list iterable and a list + l.extend(range(n)) + l.extend(l[:-1]) + l.extend(range(n, 0, -1)) + return l + +def list_extend_heterogeneous(n): + l = [] + # Extend with various iterables, including lists, with different types + l.extend(range(n)) + l.extend(l[:-1]) + l.extend((5, 42)) + l.extend([123.0]) + return l + +def list_pop0(n): + l = list(range(n)) + res = 0 + while len(l) > 0: + res += len(l) * l.pop() + return res + +def list_pop1(n, i): + l = list(range(n)) + x = l.pop(i) + return x, l + +def list_len(n): + l = list(range(n)) + return len(l) + +def list_getitem(n): + l = list(range(n)) + res = 0 + # Positive indices + for i in range(len(l)): + res += i * l[i] + # Negative indices + for i in range(-len(l), 0): + res -= i * l[i] + return res + +def list_setitem(n): + l = list(range(n)) + res = 0 + # Positive indices + for i in range(len(l)): + l[i] = i * l[i] + # Negative indices + for i in range(-len(l), 0): + l[i] = i * l[i] + for i in range(len(l)): + res += l[i] + return res + +def list_getslice2(n, start, stop): + l = list(range(n)) + return l[start:stop] + +def list_getslice3(n, start, stop, step): + l = list(range(n)) + return l[start:stop:step] + +def list_setslice2(n, n_source, start, stop): + # Generic setslice with size change + l = list(range(n)) + v = list(range(100, 100 + n_source)) + l[start:stop] = v + return l + +def list_setslice3(n, start, stop, step): + l = list(range(n)) + v = l[start:stop:step] + for i in range(len(v)): + v[i] += 100 + l[start:stop:step] = v + return l + +def list_setslice3_arbitrary(n, n_src, start, stop, step): + l = list(range(n)) + l[start:stop:step] = list(range(100, 100 + n_src)) + return l + +def list_delslice0(n): + l = list(range(n)) + del l[:] + return l + +def list_delslice1(n, start, stop): + l = list(range(n)) + del l[start:] + del l[:stop] + return l + +def list_delslice2(n, start, stop): + l = list(range(n)) + del l[start:stop] + return l + +def list_clear(n): + l = list(range(n)) + l.clear() + return l + +def list_copy(n): + l = list(range(n)) + ll = l.copy() + l.append(42) + return l, ll + +def list_iteration(n): + l = list(range(n)) + res = 0 + for i, v in enumerate(l): + res += i * v + return res + +def list_contains(n): + l = list(range(n)) + return (0 in l, 1 in l, n - 1 in l, n in l, + 0 not in l, 1 not in l, n - 1 not in l, n not in l, + ) + +def list_index1(n, v): + l = list(range(n, 0, -1)) + return l.index(v) + +def list_index2(n, v, start): + l = list(range(n, 0, -1)) + return l.index(v, start) + +def list_index3(n, v, start, stop): + l = list(range(n, 0, -1)) + return l.index(v, start, stop) + +def list_remove(n, v): + l = list(range(n - 1, -1, -1)) + l.remove(v) + return l + +def list_insert(n, pos, v): + l = list(range(0, n)) + l.insert(pos, v) + return l + +def list_count(n, v): + l = [] + for x in range(n): + l.append(x & 3) + return l.count(v) + +def list_reverse(n): + l = list(range(n)) + l.reverse() + return l + +def list_add(m, n): + a = list(range(0, m)) + b = list(range(100, 100 + n)) + res = a + b + res.append(42) # check result is a copy + return a, b, res + +def list_add_heterogeneous(): + a = [1] + b = [2.0] + c = a + b + d = b + a + # check result is a copy + a.append(3) + b.append(4.0) + return a, b, c, d + +def list_add_inplace(m, n): + a = list(range(0, m)) + b = list(range(100, 100 + n)) + a += b + return a, b + +def list_add_inplace_heterogeneous(): + a = [1] + b = [2.0] + a += b + b += a + return a, b + +def list_mul(n, v): + a = list(range(n)) + return a * v + +def list_mul2(n, v): + a = list(range(n)) + return v * a + +def list_mul_inplace(n, v): + a = list(range(n)) + a *= v + return a + +def list_bool(n): + a = list(range(n)) + return bool(a), (True if a else False) + +def eq_usecase(a, b): + return list(a) == list(b) + +def ne_usecase(a, b): + return list(a) != list(b) + +def gt_usecase(a, b): + return list(a) > list(b) + +def ge_usecase(a, b): + return list(a) >= list(b) + +def lt_usecase(a, b): + return list(a) < list(b) + +def le_usecase(a, b): + return list(a) <= list(b) + +def identity_usecase(n): + a = list(range(n)) + b = a + c = a[:] + return (a is b), (a is not b), (a is c), (a is not c) + +def bool_list_usecase(): + # Exercise getitem, setitem, iteration with bool values (issue #1373) + l = [False] + l[0] = True + x = False + for v in l: + x = x ^ v + return l, x + +def reflect_simple(l, ll): + x = l.pop() + y = l.pop() + l[0] = 42. + l.extend(ll) + return l, x, y + +def reflect_conditional(l, ll): + # `l` may or may not actually reflect a Python list + if ll[0]: + l = [11., 22., 33., 44.] + x = l.pop() + y = l.pop() + l[0] = 42. + l.extend(ll) + return l, x, y + +def reflect_exception(l): + l.append(42) + raise ZeroDivisionError + +def reflect_dual(l, ll): + l.append(ll.pop()) + return l is ll + + +class TestLists(MemoryLeakMixin, TestCase): + + def test_create_list(self): + pyfunc = create_list + cfunc = njit((types.int32, types.int32, types.int32))(pyfunc) + self.assertEqual(cfunc(1, 2, 3), pyfunc(1, 2, 3)) + + def test_create_nested_list(self): + pyfunc = create_nested_list + cfunc = njit((types.int32, types.int32, types.int32, + types.int32, types.int32, types.int32))(pyfunc) + self.assertEqual(cfunc(1, 2, 3, 4, 5, 6), pyfunc(1, 2, 3, 4, 5, 6)) + + def check_unary_with_size(self, pyfunc, precise=True): + cfunc = jit(nopython=True)(pyfunc) + # Use various sizes, to stress the allocation algorithm + for n in [0, 3, 16, 70, 400]: + eq = self.assertPreciseEqual if precise else self.assertEqual + eq(cfunc(n), pyfunc(n)) + + def test_constructor(self): + self.check_unary_with_size(list_constructor) + + def test_constructor_empty(self): + self.disable_leak_check() + cfunc = jit(nopython=True)(list_constructor_empty) + with self.assertRaises(errors.TypingError) as raises: + cfunc() + errmsg = str(raises.exception) + self.assertIn("Cannot infer the type of variable", errmsg) + self.assertIn("list(undefined)", errmsg) + # check error message went in + self.assertIn("For Numba to be able to compile a list", errmsg) + + def test_constructor_empty_but_typeable(self): + args = [np.int32(1), 10., 1 + 3j, [7], [17., 14.], np.array([10])] + pyfunc = list_constructor_empty_but_typeable + for arg in args: + cfunc = jit(nopython=True)(pyfunc) + expected = pyfunc(arg) + got = cfunc(arg) + self.assertPreciseEqual(got, expected) + + def test_append(self): + self.check_unary_with_size(list_append) + + def test_append_heterogeneous(self): + self.check_unary_with_size(list_append_heterogeneous, precise=False) + + def test_extend(self): + self.check_unary_with_size(list_extend) + + def test_extend_heterogeneous(self): + self.check_unary_with_size(list_extend_heterogeneous, precise=False) + + def test_pop0(self): + self.check_unary_with_size(list_pop0) + + def test_pop1(self): + pyfunc = list_pop1 + cfunc = jit(nopython=True)(pyfunc) + for n in [5, 40]: + for i in [0, 1, n - 2, n - 1, -1, -2, -n + 3, -n + 1]: + expected = pyfunc(n, i) + self.assertPreciseEqual(cfunc(n, i), expected) + + def test_pop_errors(self): + # XXX References are leaked when an exception is raised + self.disable_leak_check() + cfunc = jit(nopython=True)(list_pop1) + with self.assertRaises(IndexError) as cm: + cfunc(0, 5) + self.assertEqual(str(cm.exception), "pop from empty list") + with self.assertRaises(IndexError) as cm: + cfunc(1, 5) + self.assertEqual(str(cm.exception), "pop index out of range") + + def test_insert(self): + pyfunc = list_insert + cfunc = jit(nopython=True)(pyfunc) + for n in [5, 40]: + indices = [0, 1, n - 2, n - 1, n + 1, -1, -2, -n + 3, -n - 1] + for i in indices: + expected = pyfunc(n, i, 42) + self.assertPreciseEqual(cfunc(n, i, 42), expected) + + def test_len(self): + self.check_unary_with_size(list_len) + + def test_getitem(self): + self.check_unary_with_size(list_getitem) + + def test_setitem(self): + self.check_unary_with_size(list_setitem) + + def check_slicing2(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + sizes = [5, 40] + for n in sizes: + indices = [0, 1, n - 2, -1, -2, -n + 3, -n - 1, -n] + for start, stop in itertools.product(indices, indices): + expected = pyfunc(n, start, stop) + self.assertPreciseEqual(cfunc(n, start, stop), expected) + + def test_getslice2(self): + self.check_slicing2(list_getslice2) + + def test_setslice2(self): + pyfunc = list_setslice2 + cfunc = jit(nopython=True)(pyfunc) + sizes = [5, 40] + for n, n_src in itertools.product(sizes, sizes): + indices = [0, 1, n - 2, -1, -2, -n + 3, -n - 1, -n] + for start, stop in itertools.product(indices, indices): + expected = pyfunc(n, n_src, start, stop) + self.assertPreciseEqual(cfunc(n, n_src, start, stop), expected) + + def test_getslice3(self): + pyfunc = list_getslice3 + cfunc = jit(nopython=True)(pyfunc) + for n in [10]: + indices = [0, 1, n - 2, -1, -2, -n + 3, -n - 1, -n] + steps = [4, 1, -1, 2, -3] + for start, stop, step in itertools.product(indices, indices, steps): + expected = pyfunc(n, start, stop, step) + self.assertPreciseEqual(cfunc(n, start, stop, step), expected) + + def test_setslice3(self): + pyfunc = list_setslice3 + cfunc = jit(nopython=True)(pyfunc) + for n in [10]: + indices = [0, 1, n - 2, -1, -2, -n + 3, -n - 1, -n] + steps = [4, 1, -1, 2, -3] + for start, stop, step in itertools.product(indices, indices, steps): + expected = pyfunc(n, start, stop, step) + self.assertPreciseEqual(cfunc(n, start, stop, step), expected) + + def test_setslice3_resize(self): + # XXX References are leaked when an exception is raised + self.disable_leak_check() + pyfunc = list_setslice3_arbitrary + cfunc = jit(nopython=True)(pyfunc) + # step == 1 => can resize + cfunc(5, 10, 0, 2, 1) + # step != 1 => cannot resize + with self.assertRaises(ValueError) as cm: + cfunc(5, 100, 0, 3, 2) + self.assertIn("cannot resize", str(cm.exception)) + + def test_delslice0(self): + self.check_unary_with_size(list_delslice0) + + def test_delslice1(self): + self.check_slicing2(list_delslice1) + + def test_delslice2(self): + self.check_slicing2(list_delslice2) + + def test_invalid_slice(self): + self.disable_leak_check() + pyfunc = list_getslice3 + cfunc = jit(nopython=True)(pyfunc) + with self.assertRaises(ValueError) as cm: + cfunc(10, 1, 2, 0) + self.assertEqual(str(cm.exception), "slice step cannot be zero") + + def test_iteration(self): + self.check_unary_with_size(list_iteration) + + def test_reverse(self): + self.check_unary_with_size(list_reverse) + + def test_contains(self): + self.check_unary_with_size(list_contains) + + def check_index_result(self, pyfunc, cfunc, args): + try: + expected = pyfunc(*args) + except ValueError: + with self.assertRaises(ValueError): + cfunc(*args) + else: + self.assertPreciseEqual(cfunc(*args), expected) + + def test_index1(self): + self.disable_leak_check() + pyfunc = list_index1 + cfunc = jit(nopython=True)(pyfunc) + for v in (0, 1, 5, 10, 99999999): + self.check_index_result(pyfunc, cfunc, (16, v)) + + def test_index2(self): + self.disable_leak_check() + pyfunc = list_index2 + cfunc = jit(nopython=True)(pyfunc) + n = 16 + for v in (0, 1, 5, 10, 99999999): + indices = [0, 1, n - 2, n - 1, n + 1, -1, -2, -n + 3, -n - 1] + for start in indices: + self.check_index_result(pyfunc, cfunc, (16, v, start)) + + def test_index3(self): + self.disable_leak_check() + pyfunc = list_index3 + cfunc = jit(nopython=True)(pyfunc) + n = 16 + for v in (0, 1, 5, 10, 99999999): + indices = [0, 1, n - 2, n - 1, n + 1, -1, -2, -n + 3, -n - 1] + for start, stop in itertools.product(indices, indices): + self.check_index_result(pyfunc, cfunc, (16, v, start, stop)) + + def test_index_exception1(self): + pyfunc = list_index3 + cfunc = jit(nopython=True)(pyfunc) + msg = 'arg "start" must be an Integer.' + with self.assertRaisesRegex(errors.TypingError, msg): + cfunc(10, 0, 'invalid', 5) + + def test_index_exception2(self): + pyfunc = list_index3 + cfunc = jit(nopython=True)(pyfunc) + msg = 'arg "stop" must be an Integer.' + with self.assertRaisesRegex(errors.TypingError, msg): + cfunc(10, 0, 0, 'invalid') + + def test_remove(self): + pyfunc = list_remove + cfunc = jit(nopython=True)(pyfunc) + n = 16 + for v in (0, 1, 5, 15): + expected = pyfunc(n, v) + self.assertPreciseEqual(cfunc(n, v), expected) + + def test_remove_error(self): + self.disable_leak_check() + pyfunc = list_remove + cfunc = jit(nopython=True)(pyfunc) + with self.assertRaises(ValueError) as cm: + cfunc(10, 42) + self.assertEqual(str(cm.exception), "list.remove(x): x not in list") + + def test_count(self): + pyfunc = list_count + cfunc = jit(nopython=True)(pyfunc) + for v in range(5): + self.assertPreciseEqual(cfunc(18, v), pyfunc(18, v)) + + def test_clear(self): + self.check_unary_with_size(list_clear) + + def test_copy(self): + self.check_unary_with_size(list_copy) + + def check_add(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + sizes = [0, 3, 50, 300] + for m, n in itertools.product(sizes, sizes): + expected = pyfunc(m, n) + self.assertPreciseEqual(cfunc(m, n), expected) + + def test_add(self): + self.check_add(list_add) + + def test_add_heterogeneous(self): + pyfunc = list_add_heterogeneous + cfunc = jit(nopython=True)(pyfunc) + expected = pyfunc() + self.assertEqual(cfunc(), expected) + + def test_add_inplace(self): + self.check_add(list_add_inplace) + + def test_add_inplace_heterogeneous(self): + pyfunc = list_add_inplace_heterogeneous + cfunc = jit(nopython=True)(pyfunc) + expected = pyfunc() + self.assertEqual(cfunc(), expected) + + def check_mul(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + for n in [0, 3, 50, 300]: + for v in [1, 2, 3, 0, -1, -42]: + expected = pyfunc(n, v) + self.assertPreciseEqual(cfunc(n, v), expected) + + def test_mul(self): + self.check_mul(list_mul) + + def test_mul2(self): + self.check_mul(list_mul2) + + def test_mul_inplace(self): + self.check_mul(list_mul_inplace) + + @unittest.skipUnless(sys.maxsize >= 2**32, + "need a 64-bit system to test for MemoryError") + def test_mul_error(self): + self.disable_leak_check() + pyfunc = list_mul + cfunc = jit(nopython=True)(pyfunc) + # Fail in malloc() + with self.assertRaises(MemoryError): + cfunc(1, 2**58) + if sys.platform.startswith('darwin'): + libc = ct.CDLL('libc.dylib') + libc.printf("###Please ignore the above error message i.e. \ +can't allocate region. It is in fact the purpose of this test to \ +request more memory than can be provided###\n".encode("UTF-8")) + # Overflow size computation when multiplying by item size + with self.assertRaises(MemoryError): + cfunc(1, 2**62) + + def test_bool(self): + pyfunc = list_bool + cfunc = jit(nopython=True)(pyfunc) + for n in [0, 1, 3]: + expected = pyfunc(n) + self.assertPreciseEqual(cfunc(n), expected) + + def test_list_passing(self): + # Check one can pass a list from a Numba function to another + @jit(nopython=True) + def inner(lst): + return len(lst), lst[-1] + + @jit(nopython=True) + def outer(n): + l = list(range(n)) + return inner(l) + + self.assertPreciseEqual(outer(5), (5, 4)) + + def _test_compare(self, pyfunc): + def eq(args): + self.assertIs(cfunc(*args), pyfunc(*args), + "mismatch for arguments %s" % (args,)) + + cfunc = jit(nopython=True)(pyfunc) + eq(((1, 2), (1, 2))) + eq(((1, 2, 3), (1, 2))) + eq(((1, 2), (1, 2, 3))) + eq(((1, 2, 4), (1, 2, 3))) + eq(((1.0, 2.0, 3.0), (1, 2, 3))) + eq(((1.0, 2.0, 3.5), (1, 2, 3))) + + def test_eq(self): + self._test_compare(eq_usecase) + + def test_ne(self): + self._test_compare(ne_usecase) + + def test_le(self): + self._test_compare(le_usecase) + + def test_lt(self): + self._test_compare(lt_usecase) + + def test_ge(self): + self._test_compare(ge_usecase) + + def test_gt(self): + self._test_compare(gt_usecase) + + def test_identity(self): + pyfunc = identity_usecase + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(3), pyfunc(3)) + + def test_bool_list(self): + # Check lists of bools compile and run successfully + pyfunc = bool_list_usecase + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(), pyfunc()) + + +class TestUnboxing(MemoryLeakMixin, TestCase): + """ + Test unboxing of Python lists into native Numba lists. + """ + + @contextlib.contextmanager + def assert_type_error(self, msg): + with self.assertRaises(TypeError) as raises: + yield + if msg is not None: + self.assertRegex(str(raises.exception), msg) + + def check_unary(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + def check(arg): + expected = pyfunc(arg) + got = cfunc(arg) + self.assertPreciseEqual(got, expected) + return check + + def test_numbers(self): + check = self.check_unary(unbox_usecase) + check([1, 2]) + check([1j, 2.5j]) + + def test_tuples(self): + check = self.check_unary(unbox_usecase2) + check([(1, 2), (3, 4)]) + check([(1, 2j), (3, 4j)]) + check([(), (), ()]) + + def test_list_inside_tuple(self): + check = self.check_unary(unbox_usecase3) + check((1, [2, 3, 4])) + + def test_list_of_tuples_inside_tuple(self): + check = self.check_unary(unbox_usecase4) + check((1, [(2,), (3,)])) + + def test_errors(self): + # See #1545 and #1594: error checking should ensure the list is + # homogeneous + msg = "can't unbox heterogeneous list" + pyfunc = noop + cfunc = jit(nopython=True)(pyfunc) + lst = [1, 2.5] + with self.assert_type_error(msg): + cfunc(lst) + # The list hasn't been changed (bogus reflecting) + self.assertEqual(lst, [1, 2.5]) + with self.assert_type_error(msg): + cfunc([1, 2j]) + # Same when the list is nested in a tuple or namedtuple + with self.assert_type_error(msg): + cfunc((1, [1, 2j])) + with self.assert_type_error(msg): + cfunc(Point(1, [1, 2j])) + # Issue #1638: tuples of different size. + # Note the check is really on the tuple side. + lst = [(1,), (2, 3)] + with self.assertRaises(TypeError) as raises: + cfunc(lst) + msg = ("can't unbox heterogeneous list: " + "UniTuple({0} x 1) != UniTuple({0} x 2)") + self.assertEqual(str(raises.exception), msg.format(types.intp)) + + + +class TestListReflection(MemoryLeakMixin, TestCase): + """ + Test reflection of native Numba lists on Python list objects. + """ + + def check_reflection(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + samples = [([1., 2., 3., 4.], [0.]), + ([1., 2., 3., 4.], [5., 6., 7., 8., 9.]), + ] + for dest, src in samples: + expected = list(dest) + got = list(dest) + pyres = pyfunc(expected, src) + with self.assertRefCount(got, src): + cres = cfunc(got, src) + self.assertPreciseEqual(cres, pyres) + self.assertPreciseEqual(expected, got) + self.assertEqual(pyres[0] is expected, cres[0] is got) + del pyres, cres + + def test_reflect_simple(self): + self.check_reflection(reflect_simple) + + def test_reflect_conditional(self): + self.check_reflection(reflect_conditional) + + def test_reflect_exception(self): + """ + When the function exits with an exception, lists should still be + reflected. + """ + pyfunc = reflect_exception + cfunc = jit(nopython=True)(pyfunc) + l = [1, 2, 3] + with self.assertRefCount(l): + with self.assertRaises(ZeroDivisionError): + cfunc(l) + self.assertPreciseEqual(l, [1, 2, 3, 42]) + + def test_reflect_same_list(self): + """ + When the same list object is reflected twice, behaviour should + be consistent. + """ + pyfunc = reflect_dual + cfunc = jit(nopython=True)(pyfunc) + pylist = [1, 2, 3] + clist = pylist[:] + expected = pyfunc(pylist, pylist) + got = cfunc(clist, clist) + self.assertPreciseEqual(expected, got) + self.assertPreciseEqual(pylist, clist) + self.assertRefCountEqual(pylist, clist) + + def test_reflect_clean(self): + """ + When the list wasn't mutated, no reflection should take place. + """ + cfunc = jit(nopython=True)(noop) + # Use a complex, as Python integers can be cached + l = [12.5j] + ids = [id(x) for x in l] + cfunc(l) + self.assertEqual([id(x) for x in l], ids) + + +class ManagedListTestCase(MemoryLeakMixin, TestCase): + + def assert_list_element_precise_equal(self, expect, got): + self.assertEqual(len(expect), len(got)) + for a, b in zip(expect, got): + self.assertPreciseEqual(a, b) + + +class TestListManagedElements(ManagedListTestCase): + "Test list containing objects that need refct" + + def _check_element_equal(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + con = [np.arange(3).astype(np.intp), np.arange(5).astype(np.intp)] + expect = list(con) + pyfunc(expect) + got = list(con) + cfunc(got) + self.assert_list_element_precise_equal( + expect=expect, got=got + ) + + def test_reflect_passthru(self): + def pyfunc(con): + pass + self._check_element_equal(pyfunc) + + def test_reflect_appended(self): + def pyfunc(con): + con.append(np.arange(10).astype(np.intp)) + + self._check_element_equal(pyfunc) + + def test_reflect_setitem(self): + def pyfunc(con): + con[1] = np.arange(10) + + self._check_element_equal(pyfunc) + + def test_reflect_popped(self): + def pyfunc(con): + con.pop() + + self._check_element_equal(pyfunc) + + def test_reflect_insert(self): + """make sure list.insert() doesn't crash for refcounted objects (see #7553) + """ + + def pyfunc(con): + con.insert(1, np.arange(4).astype(np.intp)) + + self._check_element_equal(pyfunc) + + def test_append(self): + def pyfunc(): + con = [] + for i in range(300): + con.append(np.arange(i, ).astype(np.intp)) + return con + + cfunc = jit(nopython=True)(pyfunc) + expect = pyfunc() + got = cfunc() + + self.assert_list_element_precise_equal( + expect=expect, got=got + ) + + def test_append_noret(self): + # This test make sure local dtor works + def pyfunc(): + con = [] + for i in range(300): + con.append(np.arange(i)) + c = 0.0 + for arr in con: + c += arr.sum() / (1 + arr.size) + return c + + cfunc = jit(nopython=True)(pyfunc) + expect = pyfunc() + got = cfunc() + + self.assertEqual(expect, got) + + def test_reassign_refct(self): + def pyfunc(): + con = [] + for i in range(5): + con.append(np.arange(2)) + con[0] = np.arange(4) + return con + + cfunc = jit(nopython=True)(pyfunc) + expect = pyfunc() + got = cfunc() + + self.assert_list_element_precise_equal( + expect=expect, got=got + ) + + def test_get_slice(self): + def pyfunc(): + con = [] + for i in range(5): + con.append(np.arange(2)) + return con[2:4] + + cfunc = jit(nopython=True)(pyfunc) + expect = pyfunc() + got = cfunc() + + self.assert_list_element_precise_equal( + expect=expect, got=got + ) + + def test_set_slice(self): + def pyfunc(): + con = [] + for i in range(5): + con.append(np.arange(2)) + con[1:3] = con[2:4] + return con + + cfunc = jit(nopython=True)(pyfunc) + expect = pyfunc() + got = cfunc() + + self.assert_list_element_precise_equal( + expect=expect, got=got + ) + + def test_pop(self): + def pyfunc(): + con = [] + for i in range(20): + con.append(np.arange(i + 1)) + while len(con) > 2: + con.pop() + return con + + cfunc = jit(nopython=True)(pyfunc) + expect = pyfunc() + got = cfunc() + + self.assert_list_element_precise_equal( + expect=expect, got=got + ) + + def test_pop_loc(self): + def pyfunc(): + con = [] + for i in range(1000): + con.append(np.arange(i + 1)) + while len(con) > 2: + con.pop(1) + return con + + cfunc = jit(nopython=True)(pyfunc) + expect = pyfunc() + got = cfunc() + + self.assert_list_element_precise_equal( + expect=expect, got=got + ) + + def test_del_range(self): + def pyfunc(): + con = [] + for i in range(20): + con.append(np.arange(i + 1)) + del con[3:10] + return con + + cfunc = jit(nopython=True)(pyfunc) + expect = pyfunc() + got = cfunc() + + self.assert_list_element_precise_equal( + expect=expect, got=got + ) + + def test_list_of_list(self): + def pyfunc(): + con = [] + for i in range(10): + con.append([0] * i) + return con + + cfunc = jit(nopython=True)(pyfunc) + expect = pyfunc() + got = cfunc() + + self.assertEqual(expect, got) + + + +def expect_reflection_failure(fn): + def wrapped(self, *args, **kwargs): + self.disable_leak_check() + with self.assertRaises(TypeError) as raises: + fn(self, *args, **kwargs) + expect_msg = 'cannot reflect element of reflected container' + self.assertIn(expect_msg, str(raises.exception)) + + return wrapped + + +class TestListOfList(ManagedListTestCase): + + def compile_and_test(self, pyfunc, *args): + from copy import deepcopy + expect_args = deepcopy(args) + expect = pyfunc(*expect_args) + + njit_args = deepcopy(args) + cfunc = jit(nopython=True)(pyfunc) + got = cfunc(*njit_args) + + self.assert_list_element_precise_equal( + expect=expect, got=got + ) + # Check reflection + self.assert_list_element_precise_equal( + expect=expect_args, got=njit_args + ) + + def test_returning_list_of_list(self): + def pyfunc(): + a = [[np.arange(i)] for i in range(4)] + return a + + self.compile_and_test(pyfunc) + + @expect_reflection_failure + def test_heterogeneous_list_error(self): + def pyfunc(x): + return x[1] + + cfunc = jit(nopython=True)(pyfunc) + l2 = [[np.zeros(i) for i in range(5)], + [np.ones(i)+1j for i in range(5)]] + l3 = [[np.zeros(i) for i in range(5)], [(1,)]] + l4 = [[1], [{1}]] + l5 = [[1], [{'a': 1}]] + + # TODO: this triggers a reflection error. + # Remove this line when nested reflection is supported + cfunc(l2) + + # error_cases + with self.assertRaises(TypeError) as raises: + cfunc(l2) + + self.assertIn( + ("reflected list(array(float64, 1d, C)) != " + "reflected list(array(complex128, 1d, C))"), + str(raises.exception) + ) + + with self.assertRaises(TypeError) as raises: + cfunc(l3) + + self.assertIn( + ("reflected list(array(float64, 1d, C)) != " + "reflected list((int64 x 1))"), + str(raises.exception) + ) + + with self.assertRaises(TypeError) as raises: + cfunc(l4) + self.assertIn( + "reflected list(int64) != reflected list(reflected set(int64))", + str(raises.exception) + ) + + with self.assertRaises(ValueError) as raises: + cfunc(l5) + self.assertIn( + "Cannot type list element of ", + str(raises.exception) + ) + + @expect_reflection_failure + def test_list_of_list_reflected(self): + def pyfunc(l1, l2): + l1.append(l2) + l1[-1].append(123) + + cfunc = jit(nopython=True)(pyfunc) + l1 = [[0, 1], [2, 3]] + l2 = [4, 5] + expect = list(l1), list(l2) + got = list(l1), list(l2) + pyfunc(*expect) + cfunc(*got) + self.assertEqual(expect, got) + + @expect_reflection_failure + def test_heterogeneous_list(self): + def pyfunc(x): + return x[1] + + l1 = [[np.zeros(i) for i in range(5)], [np.ones(i) for i in range(5)]] + + cfunc = jit(nopython=True)(pyfunc) + l1_got = cfunc(l1) + self.assertPreciseEqual(pyfunc(l1), l1_got) + + @expect_reflection_failure + def test_c01(self): + def bar(x): + return x.pop() + + r = [[np.zeros(0)], [np.zeros(10)*1j]] + # TODO: this triggers a reflection error. + # Remove this line when nested reflection is supported + self.compile_and_test(bar, r) + + with self.assertRaises(TypeError) as raises: + self.compile_and_test(bar, r) + self.assertIn( + ("reflected list(array(float64, 1d, C)) != " + "reflected list(array(complex128, 1d, C))"), + str(raises.exception), + ) + + def test_c02(self): + def bar(x): + x.append(x) + return x + + r = [[np.zeros(0)]] + + with self.assertRaises(errors.TypingError) as raises: + self.compile_and_test(bar, r) + self.assertIn( + "Invalid use of BoundFunction(list.append", + str(raises.exception), + ) + + def test_c03(self): + def bar(x): + f = x + f[0] = 1 + return f + + r = [[np.arange(3)]] + + with self.assertRaises(errors.TypingError) as raises: + self.compile_and_test(bar, r) + self.assertIn( + "invalid setitem with value of {} to element of {}".format( + typeof(1), + typeof(r[0]), + ), + str(raises.exception), + ) + + def test_c04(self): + def bar(x): + f = x + f[0][0] = 10 + return f + + r = [[np.arange(3)]] + with self.assertRaises(errors.TypingError) as raises: + self.compile_and_test(bar, r) + self.assertIn( + "invalid setitem with value of {} to element of {}".format( + typeof(10), + typeof(r[0][0]), + ), + str(raises.exception), + ) + + @expect_reflection_failure + def test_c05(self): + def bar(x): + f = x + f[0][0] = np.array([x for x in np.arange(10).astype(np.intp)]) + return f + + r = [[np.arange(3).astype(np.intp)]] + self.compile_and_test(bar, r) + + def test_c06(self): + def bar(x): + f = x + f[0][0] = np.array([x + 1j for x in np.arange(10)]) + return f + + r = [[np.arange(3)]] + with self.assertRaises(errors.TypingError) as raises: + self.compile_and_test(bar, r) + self.assertIn("invalid setitem with value", str(raises.exception)) + + @expect_reflection_failure + def test_c07(self): + self.disable_leak_check() + + def bar(x): + return x[-7] + + r = [[np.arange(3)]] + cfunc = jit(nopython=True)(bar) + with self.assertRaises(IndexError) as raises: + cfunc(r) + self.assertIn("getitem out of range", str(raises.exception)) + + def test_c08(self): + self.disable_leak_check() + + def bar(x): + x[5] = 7 + return x + + r = [1, 2, 3] + cfunc = jit(nopython=True)(bar) + with self.assertRaises(IndexError) as raises: + cfunc(r) + self.assertIn("setitem out of range", str(raises.exception)) + + def test_c09(self): + def bar(x): + x[-2] = 7j + return x + + r = [1, 2, 3] + with self.assertRaises(errors.TypingError) as raises: + self.compile_and_test(bar, r) + self.assertIn("invalid setitem with value", str(raises.exception)) + + @expect_reflection_failure + def test_c10(self): + def bar(x): + x[0], x[1] = x[1], x[0] + return x + + r = [[1, 2, 3], [4, 5, 6]] + self.compile_and_test(bar, r) + + @expect_reflection_failure + def test_c11(self): + def bar(x): + x[:] = x[::-1] + return x + + r = [[1, 2, 3], [4, 5, 6]] + self.compile_and_test(bar, r) + + def test_c12(self): + def bar(x): + del x[-1] + return x + + r = [x for x in range(10)] + self.compile_and_test(bar, r) + + +class Item(object): + def __init__(self, many, scalar): + self.many = many + self.scalar = scalar + + +class Container(object): + def __init__(self, n): + self.data = [[np.arange(i).astype(np.float64)] for i in range(n)] + + def more(self, n): + for i in range(n): + self.data.append([np.arange(i).astype(np.float64)]) + + +class TestListAndJitClasses(ManagedListTestCase): + def make_jitclass_element(self): + spec = [ + ('many', types.float64[:]), + ('scalar', types.float64), + ] + JCItem = jitclass(spec)(Item) + return JCItem + + def make_jitclass_container(self): + spec = { + 'data': types.List(dtype=types.List(types.float64[::1])), + } + JCContainer = jitclass(spec)(Container) + return JCContainer + + def assert_list_element_with_tester(self, tester, expect, got): + for x, y in zip(expect, got): + tester(x, y) + + def test_jitclass_instance_elements(self): + JCItem = self.make_jitclass_element() + + def pyfunc(xs): + xs[1], xs[0] = xs[0], xs[1] + return xs + + def eq(x, y): + self.assertPreciseEqual(x.many, y.many) + self.assertPreciseEqual(x.scalar, y.scalar) + + cfunc = jit(nopython=True)(pyfunc) + + arg = [JCItem(many=np.random.random(n + 1), scalar=n * 1.2) + for n in range(5)] + + expect_arg = list(arg) + got_arg = list(arg) + + expect_res = pyfunc(expect_arg) + got_res = cfunc(got_arg) + + self.assert_list_element_with_tester(eq, expect_arg, got_arg) + self.assert_list_element_with_tester(eq, expect_res, got_res) + + def test_jitclass_containing_list(self): + JCContainer = self.make_jitclass_container() + + expect = Container(n=4) + got = JCContainer(n=4) + self.assert_list_element_precise_equal(got.data, expect.data) + expect.more(3) + got.more(3) + self.assert_list_element_precise_equal(got.data, expect.data) + + +class TestListInitialValues(MemoryLeakMixin, TestCase): + """Tests that lists carry their initial value if present""" + + def test_homogeneous_and_literal(self): + def bar(l): + ... + + @overload(bar) + def ol_bar(l): + if l.initial_value is None: + return lambda l: literally(l) + self.assertTrue(isinstance(l, types.List)) + self.assertEqual(l.initial_value, [1, 2, 3]) + self.assertEqual(hasattr(l, 'literal_value'), False) + return lambda l: l + + @njit + def foo(): + # keys and values all have literal representation + x = [1, 2, 3] + bar(x) + + foo() + + def test_heterogeneous_but_castable_to_homogeneous(self): + def bar(l): + ... + + @overload(bar) + def ol_bar(l): + self.assertTrue(isinstance(l, types.List)) + self.assertEqual(l.initial_value, None) + self.assertEqual(hasattr(l, 'literal_value'), False) + return lambda l: l + + @njit + def foo(): + # This list will be typed based on 1j, i.e. complex128 + # as the values are not all literals, there's no "initial_value" + # available irrespective of whether it's possible to rip this + # information out of the bytecode. + x = [1j, 2, 3] + bar(x) + + foo() + + def test_mutation_not_carried(self): + def bar(d): + ... + + @overload(bar) + def ol_bar(d): + if d.initial_value is None: + return lambda d: literally(d) + self.assertTrue(isinstance(d, types.List)) + self.assertEqual(d.initial_value, [1, 2, 3]) + return lambda d: d + + @njit + def foo(): + # This list is mutated, check the initial_value carries + # correctly and is not mutated + x = [1, 2, 3] + x.append(4) + bar(x) + + foo() + + def test_mutation_not_carried_single_function(self): + # this is another pattern for using literally + + @njit + def nop(*args): + pass + + for fn, iv in (nop, None), (literally, [1, 2, 3]): + @njit + def baz(x): + pass + + def bar(z): + pass + + @overload(bar) + def ol_bar(z): + def impl(z): + fn(z) + baz(z) + return impl + + @njit + def foo(): + x = [1, 2, 3] + bar(x) + x.append(2) + return x + + foo() + # baz should be specialised based on literally being invoked and + # the literal/unliteral arriving at the call site + larg = baz.signatures[0][0] + self.assertEqual(larg.initial_value, iv) + + def test_list_of_list_ctor(self): + # see issue 6082 + @njit + def bar(x): + pass + + @njit + def foo(): + x = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 6]] + bar(x) + + foo() + larg = bar.signatures[0][0] + self.assertEqual(larg.initial_value, None) + self.assertEqual(larg.dtype.initial_value, None) + + +class TestLiteralLists(MemoryLeakMixin, TestCase): + + def test_basic_compile(self): + @njit + def foo(): + l = [1, 'a'] + + foo() + + def test_literal_value_passthrough(self): + + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + self.assertTrue(isinstance(x, types.LiteralList)) + lv = x.literal_value + self.assertTrue(isinstance(lv, list)) + self.assertEqual(lv[0], types.literal(1)) + self.assertEqual(lv[1], types.literal('a')) + self.assertEqual(lv[2], types.Array(types.float64, 1, 'C')) + self.assertEqual(lv[3], types.List(types.intp, reflected=False, + initial_value=[1, 2, 3])) + self.assertTrue(isinstance(lv[4], types.LiteralList)) + self.assertEqual(lv[4].literal_value[0], types.literal('cat')) + self.assertEqual(lv[4].literal_value[1], types.literal(10)) + return lambda x: x + + @njit + def foo(): + otherhomogeneouslist = [1, 2, 3] + otherheterogeneouslist = ['cat', 10] + zeros = np.zeros(5) + l = [1, 'a', zeros, otherhomogeneouslist, otherheterogeneouslist] + bar(l) + + foo() + + def test_literal_value_involved_passthrough(self): + + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + self.assertTrue(isinstance(x, types.LiteralStrKeyDict)) + dlv = x.literal_value + inner_literal = {types.literal('g'): types.literal('h'), + types.literal('i'): + types.Array(types.float64, 1, 'C')} + inner_dict = types.LiteralStrKeyDict(inner_literal) + outer_literal = {types.literal('a'): + types.LiteralList([types.literal(1), + types.literal('a'), + types.DictType( + types.unicode_type, + types.intp, + initial_value={'f': 1}), + inner_dict]), + types.literal('b'): types.literal(2), + types.literal('c'): types.List(types.complex128, + reflected=False)} + def check_same(a, b): + if (isinstance(a, types.LiteralList) and + isinstance(b, types.LiteralList)): + for i, j in zip(a.literal_value, b.literal_value): + check_same(a.literal_value, b.literal_value) + elif (isinstance(a, list) and + isinstance(b, list)): + for i, j in zip(a, b): + check_same(i, j) + elif (isinstance(a, types.LiteralStrKeyDict) and + isinstance(b, types.LiteralStrKeyDict)): + for (ki, vi), (kj, vj) in zip(a.literal_value.items(), + b.literal_value.items()): + check_same(ki, kj) + check_same(vi, vj) + elif (isinstance(a, dict) and + isinstance(b, dict)): + for (ki, vi), (kj, vj) in zip(a.items(), b.items()): + check_same(ki, kj) + check_same(vi, vj) + else: + self.assertEqual(a, b) + check_same(dlv, outer_literal) + return lambda x: x + + @njit + def foo(): + # this stretches what's possible with LiteralStrKeyDict and + # LiteralList, it's nested and contains typed.Dict and np arrays + # as well as more constant type things. + l = {'a': [1, 'a', {'f': 1}, {'g': 'h', 'i': np.zeros(5)}], 'b': 2, + 'c': [1j, 2j, 3j]} + bar(l) + + foo() + + def test_mutation_failure(self): + + def staticsetitem(): + l = ['a', 1] + l[0] = 'b' + + def delitem(): + l = ['a', 1] + del l[0] + + def append(): + l = ['a', 1] + l.append(2j) + + def extend(): + l = ['a', 1] + l.extend([2j, 3j]) + + def insert(): + l = ['a', 1] + l.insert(0, 2j) + + def remove(): + l = ['a', 1] + l.remove('a') + + def pop(): + l = ['a', 1] + l.pop() + + def clear(): + l = ['a', 1] + l.clear() + + def sort(): + l = ['a', 1] + l.sort() + + def reverse(): + l = ['a', 1] + l.reverse() + + illegals = (staticsetitem, delitem, append, extend, insert, remove, pop, + clear, sort, reverse) + + for test in illegals: + with self.subTest(test.__name__): + with self.assertRaises(errors.TypingError) as raises: + njit(test)() + expect = "Cannot mutate a literal list" + self.assertIn(expect, str(raises.exception)) + + def test_count(self): + @njit + def foo(): + l = ['a', 1, 'a', 2, 'a', 3, 'b', 4, 'b', 5, 'c'] + r = [] + for x in 'abc': + r.append(l.count(x)) + return r + + self.assertEqual(foo.py_func(), foo()) + + def test_len(self): + @njit + def foo(): + l = ['a', 1, 'a', 2, 'a', 3, 'b', 4, 'b', 5, 'c'] + return len(l) + + self.assertEqual(foo.py_func(), foo()) + + def test_contains(self): + @njit + def foo(): + l = ['a', 1, 'a', 2, 'a', 3, 'b', 4, 'b', 5, 'c'] + r = [] + for x in literal_unroll(('a', 'd', 2, 6)): + r.append(x in l) + return r + + self.assertEqual(foo.py_func(), foo()) + + def test_getitem(self): + + @njit + def foo(x): + l = ['a', 1] + return l[x] + + with self.assertRaises(errors.TypingError) as raises: + foo(0) + expect = "Cannot __getitem__ on a literal list" + self.assertIn(expect, str(raises.exception)) + + def test_staticgetitem(self): + + @njit + def foo(): + l = ['a', 1] + return l[0], l[1] + + self.assertEqual(foo.py_func(), foo()) + + def test_staticgetitem_slice(self): + # this is forbidden by typing as there's no way to serialize a list of + # any kind as required by returning a (static) slice of a LiteralList + @njit + def foo(): + l = ['a', 'b', 1] + return l[:2] + + with self.assertRaises(errors.TypingError) as raises: + foo() + expect = "Cannot __getitem__ on a literal list" + self.assertIn(expect, str(raises.exception)) + + def test_setitem(self): + + @njit + def foo(x): + l = ['a', 1] + l[x] = 'b' + + with self.assertRaises(errors.TypingError) as raises: + foo(0) + expect = "Cannot mutate a literal list" + self.assertIn(expect, str(raises.exception)) + + def test_unify(self): + + @njit + def foo(x): + if x + 1 > 3: + l = ['a', 1] + else: + l = ['b', 2] + return l[0] + + for x in (-100, 100): + self.assertEqual(foo.py_func(x), foo(x)) + + def test_not_unify(self): + + @njit + def foo(x): + if x + 1 > 3: + l = ['a', 1, 2j] + else: + l = ['b', 2] + return l[0], l[1], l[0], l[1] # defeat py310 inliner + + with self.assertRaises(errors.TypingError) as raises: + foo(100) + expect = "Cannot unify LiteralList" + self.assertIn(expect, str(raises.exception)) + + def test_index(self): + @njit + def foo(): + l = ['a', 1] + l.index('a') + + with self.assertRaises(errors.TypingError) as raises: + foo() + expect = "list.index is unsupported for literal lists" + self.assertIn(expect, str(raises.exception)) + + def test_copy(self): + @njit + def foo(): + l = ['a', 1].copy() + return l[0], l[1] + + self.assertEqual(foo(), foo.py_func()) + + def test_tuple_not_in_mro(self): + # Related to #6094, make sure that LiteralList does not inherit from + # types.BaseTuple as this breaks isinstance checks. + def bar(x): + pass + + @overload(bar) + def ol_bar(x): + self.assertFalse(isinstance(x, types.BaseTuple)) + self.assertTrue(isinstance(x, types.LiteralList)) + return lambda x: ... + + @njit + def foo(): + l = ['a', 1] + bar(l) + + foo() + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_literal_dispatch.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_literal_dispatch.py new file mode 100644 index 0000000000000000000000000000000000000000..6d759f06e70c66ac50b3e5359dc9c9d7013f75c5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_literal_dispatch.py @@ -0,0 +1,400 @@ +import numpy as np + +import numba +import unittest +from numba.tests.support import TestCase +from numba import njit +from numba.core import types, errors, cgutils +from numba.core.typing import signature +from numba.core.datamodel import models +from numba.core.extending import ( + overload, SentryLiteralArgs, overload_method, register_model, intrinsic, +) +from numba.misc.special import literally + + +class TestLiteralDispatch(TestCase): + def check_literal_basic(self, literal_args): + @njit + def foo(x): + return literally(x) + + # Test with int + for lit in literal_args: + self.assertEqual(foo(lit), lit) + + for lit, sig in zip(literal_args, foo.signatures): + self.assertEqual(sig[0].literal_value, lit) + + def test_literal_basic(self): + self.check_literal_basic([123, 321]) + self.check_literal_basic(["abc", "cb123"]) + + def test_literal_nested(self): + @njit + def foo(x): + return literally(x) * 2 + + @njit + def bar(y, x): + return foo(y) + x + + y, x = 3, 7 + self.assertEqual(bar(y, x), y * 2 + x) + [foo_sig] = foo.signatures + self.assertEqual(foo_sig[0], types.literal(y)) + [bar_sig] = bar.signatures + self.assertEqual(bar_sig[0], types.literal(y)) + self.assertNotIsInstance(bar_sig[1], types.Literal) + + def test_literally_freevar(self): + # Try referring to numba.literally not in the globals + import numba + + @njit + def foo(x): + return numba.literally(x) + + self.assertEqual(foo(123), 123) + self.assertEqual(foo.signatures[0][0], types.literal(123)) + + def test_mutual_recursion_literal(self): + def get_functions(decor): + @decor + def outer_fac(n, value): + if n < 1: + return value + return n * inner_fac(n - 1, value) + + @decor + def inner_fac(n, value): + if n < 1: + return literally(value) + return n * outer_fac(n - 1, value) + + return outer_fac, inner_fac + + ref_outer_fac, ref_inner_fac = get_functions(lambda x: x) + outer_fac, inner_fac = get_functions(njit) + + self.assertEqual(outer_fac(10, 12), ref_outer_fac(10, 12)) + self.assertEqual(outer_fac.signatures[0][1].literal_value, 12) + self.assertEqual(inner_fac.signatures[0][1].literal_value, 12) + + self.assertEqual(inner_fac(11, 13), ref_inner_fac(11, 13)) + self.assertEqual(outer_fac.signatures[1][1].literal_value, 13) + self.assertEqual(inner_fac.signatures[1][1].literal_value, 13) + + def test_literal_nested_multi_arg(self): + @njit + def foo(a, b, c): + return inner(a, c) + + @njit + def inner(x, y): + return x + literally(y) + + kwargs = dict(a=1, b=2, c=3) + got = foo(**kwargs) + expect = (lambda a, b, c: a + c)(**kwargs) + self.assertEqual(got, expect) + [foo_sig] = foo.signatures + self.assertEqual(foo_sig[2], types.literal(3)) + + def test_unsupported_literal_type(self): + @njit + def foo(a, b, c): + return inner(a, c) + + @njit + def inner(x, y): + return x + literally(y) + + arr = np.arange(10) + with self.assertRaises(errors.LiteralTypingError) as raises: + foo(a=1, b=2, c=arr) + self.assertIn("numpy.ndarray", str(raises.exception)) + + def test_biliteral(self): + # Test usecase with more than one literal call + @njit + def foo(a, b, c): + return inner(a, b) + inner(b, c) + + @njit + def inner(x, y): + return x + literally(y) + + kwargs = dict(a=1, b=2, c=3) + got = foo(**kwargs) + expect = (lambda a, b, c: a + b + b + c)(**kwargs) + self.assertEqual(got, expect) + [(type_a, type_b, type_c)] = foo.signatures + self.assertNotIsInstance(type_a, types.Literal) + self.assertIsInstance(type_b, types.Literal) + self.assertEqual(type_b.literal_value, 2) + self.assertIsInstance(type_c, types.Literal) + self.assertEqual(type_c.literal_value, 3) + + def test_literally_varargs(self): + @njit + def foo(a, *args): + return literally(args) + + with self.assertRaises(errors.LiteralTypingError): + foo(1, 2, 3) + + @njit + def bar(a, b): + foo(a, b) + + with self.assertRaises(errors.TypingError) as raises: + bar(1, 2) + self.assertIn( + "Cannot request literal type", + str(raises.exception), + ) + + @unittest.expectedFailure + def test_literally_defaults(self): + # Problem with OmittedArg + @njit + def foo(a, b=1): + return (a, literally(b)) + foo(a=1) + + @unittest.expectedFailure + def test_literally_defaults_inner(self): + # Problem with Omitted + @njit + def foo(a, b=1): + return (a, literally(b)) + + @njit + def bar(a): + return foo(a) + 1 + + bar(1) + + def test_literally_from_module(self): + # Problem with Omitted + @njit + def foo(x): + return numba.literally(x) + + got = foo(123) + self.assertEqual(got, foo.py_func(123)) + self.assertIsInstance(foo.signatures[0][0], types.Literal) + + def test_non_literal(self): + @njit + def foo(a, b): + return literally(1 + a) + + with self.assertRaises(errors.TypingError) as raises: + foo(1, 2) + self.assertIn( + "Invalid use of non-Literal type", + str(raises.exception), + ) + + def test_inlined_literal(self): + # Check that literally accepts inlined literal + @njit + def foo(a, b): + v = 1000 + return a + literally(v) + literally(b) + + got = foo(1, 2) + self.assertEqual(got, foo.py_func(1, 2)) + + @njit + def bar(): + a = 100 + b = 9 + return foo(a=b, b=a) + + got = bar() + self.assertEqual(got, bar.py_func()) + + def test_aliased_variable(self): + @njit + def foo(a, b, c): + def closure(d): + return literally(d) + 10 * inner(a, b) + # The inlining of the closure will create an alias to c + return closure(c) + + @njit + def inner(x, y): + return x + literally(y) + + kwargs = dict(a=1, b=2, c=3) + got = foo(**kwargs) + expect = (lambda a, b, c: c + 10 * (a + b))(**kwargs) + self.assertEqual(got, expect) + [(type_a, type_b, type_c)] = foo.signatures + self.assertNotIsInstance(type_a, types.Literal) + self.assertIsInstance(type_b, types.Literal) + self.assertEqual(type_b.literal_value, 2) + self.assertIsInstance(type_c, types.Literal) + self.assertEqual(type_c.literal_value, 3) + + def test_overload_explicit(self): + # This test represents a more controlled usage with ensuring literal + # typing for an argument. + def do_this(x, y): + return x + y + + @overload(do_this) + def ov_do_this(x, y): + SentryLiteralArgs(['x']).for_function(ov_do_this).bind(x, y) + return lambda x, y: x + y + + @njit + def foo(a, b): + return do_this(a, b) + + a = 123 + b = 321 + r = foo(a, b) + self.assertEqual(r, a + b) + [type_a, type_b] = foo.signatures[0] + self.assertIsInstance(type_a, types.Literal) + self.assertEqual(type_a.literal_value, a) + self.assertNotIsInstance(type_b, types.Literal) + + def test_overload_implicit(self): + # This test represents the preferred usage style for using literally + # in overload. Here, literally() is used inside the "implementation" + # function of the overload. + def do_this(x, y): + return x + y + + @njit + def hidden(x, y): + return literally(x) + y + + @overload(do_this) + def ov_do_this(x, y): + if isinstance(x, types.Integer): + # At this point, `x` can be a literal or not + return lambda x, y: hidden(x, y) + + @njit + def foo(a, b): + return do_this(a, b) + + a = 123 + b = 321 + r = foo(a, b) + self.assertEqual(r, a + b) + [type_a, type_b] = foo.signatures[0] + self.assertIsInstance(type_a, types.Literal) + self.assertEqual(type_a.literal_value, a) + self.assertNotIsInstance(type_b, types.Literal) + + def test_overload_error_loop(self): + # Test a case where a infinite compiling loop is caused because a + # literal type is requested but an error would raise for the + # literal-ized code path. This causes the overload resolution to + # retry by "de-literal-izing" the values. + def do_this(x, y): + return x + y + + @njit + def hidden(x, y): + return literally(x) + y + + @overload(do_this) + def ov_do_this(x, y): + if isinstance(y, types.IntegerLiteral): + # This error is however suppressed because a non-literal + # version is valid. + raise errors.NumbaValueError("oops") + else: + def impl(x, y): + return hidden(x, y) + return impl + + @njit + def foo(a, b): + return do_this(a, literally(b)) + + # Expect raising CompilerError to stop re-compiling with duplicated + # literal typing request. + with self.assertRaises(errors.CompilerError) as raises: + foo(a=123, b=321) + self.assertIn("Repeated literal typing request", + str(raises.exception)) + + +class TestLiteralDispatchWithCustomType(TestCase): + def make_dummy_type(self): + class Dummy(object): + def lit(self, a): + return a + + class DummyType(types.Type): + def __init__(self): + super(DummyType, self).__init__(name="dummy") + + @register_model(DummyType) + class DummyTypeModel(models.StructModel): + def __init__(self, dmm, fe_type): + members = [] + super(DummyTypeModel, self).__init__(dmm, fe_type, members) + + @intrinsic + def init_dummy(typingctx): + def codegen(context, builder, signature, args): + dummy = cgutils.create_struct_proxy( + signature.return_type)(context, builder) + + return dummy._getvalue() + + sig = signature(DummyType()) + return sig, codegen + + @overload(Dummy) + def dummy_overload(): + def ctor(): + return init_dummy() + + return ctor + + return (DummyType, Dummy) + + def test_overload_method(self): + # from issue #5011 + DummyType, Dummy = self.make_dummy_type() + + @overload_method(DummyType, 'lit') + def lit_overload(self, a): + def impl(self, a): + return literally(a) # <-- using literally here + + return impl + + @njit + def test_impl(a): + d = Dummy() + + return d.lit(a) + + # Successful case + self.assertEqual(test_impl(5), 5) + + # Failing case + @njit + def inside(a): + return test_impl(a + 1) + + with self.assertRaises(errors.TypingError) as raises: + inside(4) + + self.assertIn("Cannot request literal type.", str(raises.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_llvm_pass_timings.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_llvm_pass_timings.py new file mode 100644 index 0000000000000000000000000000000000000000..cdb128fb303ee70ff83fb835e5c135b62b4cb4fe --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_llvm_pass_timings.py @@ -0,0 +1,124 @@ +import unittest + +from numba import njit +from numba.tests.support import TestCase, override_config +from numba.misc import llvm_pass_timings as lpt + + +timings_raw1 = """ +===-------------------------------------------------------------------------=== + ... Pass execution timing report ... +===-------------------------------------------------------------------------=== + Total Execution Time: 0.0001 seconds (0.0001 wall clock) + + ---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- + 0.0001 ( 90.1%) 0.0001 ( 90.1%) 0.0001 ( 90.1%) 0.0001 ( 90.1%) A1 + 0.0000 ( 9.9%) 0.0000 ( 9.9%) 0.0000 ( 9.9%) 0.0000 ( 9.9%) A2 + 0.0001 (100.0%) 0.0001 (100.0%) 0.0001 (100.0%) 0.0001 (100.0%) Total + +""" # noqa: E501 + +timings_raw2 = """ +===-------------------------------------------------------------------------=== + ... Pass execution timing report ... +===-------------------------------------------------------------------------=== + Total Execution Time: 0.0001 seconds (0.0001 wall clock) + + ---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- + 0.0001 ( 90.1%) ----- 0.0001 ( 90.1%) 0.0001 ( 90.1%) A1 + 0.0000 ( 9.9%) ----- 0.0000 ( 9.9%) 0.0000 ( 9.9%) A2 + 0.0001 (100.0%) ----- 0.0001 (100.0%) 0.0001 (100.0%) Total + +""" # noqa: E501 + + +class TestLLVMPassTimings(TestCase): + + def test_usage(self): + @njit + def foo(n): + c = 0 + for i in range(n): + c += i + return c + + with override_config('LLVM_PASS_TIMINGS', True): + foo(10) + + md = foo.get_metadata(foo.signatures[0]) + timings = md['llvm_pass_timings'] + # Check: timing is of correct type + self.assertIsInstance(timings, lpt.PassTimingsCollection) + # Check: basic for __str__ + text = str(timings) + self.assertIn("Module passes (full optimization)", text) + # Check: there must be more than one record + self.assertGreater(len(timings), 0) + # Check: __getitem__ + last = timings[-1] + self.assertIsInstance(last, lpt.NamedTimings) + # Check: NamedTimings + self.assertIsInstance(last.name, str) + self.assertIsInstance(last.timings, lpt.ProcessedPassTimings) + + def test_analyze(self): + @njit + def foo(n): + c = 0 + for i in range(n): + for j in range(i): + c += j + return c + + with override_config('LLVM_PASS_TIMINGS', True): + foo(10) + + md = foo.get_metadata(foo.signatures[0]) + timings_collection = md['llvm_pass_timings'] + # Check: get_total_time() + self.assertIsInstance(timings_collection.get_total_time(), float) + # Check: summary() + self.assertIsInstance(timings_collection.summary(), str) + # Check: list_longest_first() ordering + longest_first = timings_collection.list_longest_first() + self.assertEqual(len(longest_first), len(timings_collection)) + last = longest_first[0].timings.get_total_time() + for rec in longest_first[1:]: + cur = rec.timings.get_total_time() + self.assertGreaterEqual(last, cur) + cur = last + + def test_parse_raw(self): + timings1 = lpt.ProcessedPassTimings(timings_raw1) + self.assertAlmostEqual(timings1.get_total_time(), 0.0001) + self.assertIsInstance(timings1.summary(), str) + + timings2 = lpt.ProcessedPassTimings(timings_raw2) + self.assertAlmostEqual(timings2.get_total_time(), 0.0001) + self.assertIsInstance(timings2.summary(), str) + + +class TestLLVMPassTimingsDisabled(TestCase): + def test_disabled_behavior(self): + @njit + def foo(n): + c = 0 + for i in range(n): + c += i + return c + + with override_config('LLVM_PASS_TIMINGS', False): + foo(10) + + md = foo.get_metadata(foo.signatures[0]) + timings = md['llvm_pass_timings'] + # Check that the right message is returned + self.assertEqual(timings.summary(), "No pass timings were recorded") + # Check that None is returned + self.assertIsNone(timings.get_total_time()) + # Check that empty list is returned + self.assertEqual(timings.list_longest_first(), []) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_llvm_version_check.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_llvm_version_check.py new file mode 100644 index 0000000000000000000000000000000000000000..bea99fed9550a250075811cd8531f6c0b048dd66 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_llvm_version_check.py @@ -0,0 +1,42 @@ +import importlib +import sys + +import unittest + + +class TestLlvmVersion(unittest.TestCase): + + def test_llvmlite_version(self): + # test the system it's running on + import llvmlite + import numba + self.assertTrue(numba.__version__) + + llvmlite_version = llvmlite.__version__ + def cleanup(): + llvmlite.__version__ = llvmlite_version + self.addCleanup(cleanup) + + # explicitly test all 3 cases of version string + ver = numba._min_llvmlite_version + version_pass = '%d.%d.%d' % ver + git_version_pass = '%d.%d.%d-10-g92584ed' % ver + rc_version_pass = '%d.%d.%drc1' % (ver[0], ver[1], ver[2] + 1) + version_fail = '%d.%d.0' % (ver[0], ver[1] - 1) + git_version_fail = '%d.%d.9-10-g92584ed' % (ver[0], ver[1] - 1) + + ver_pass = (version_pass, git_version_pass, rc_version_pass) + ver_fail = (version_fail, git_version_fail) + for v in ver_pass: + llvmlite.__version__ = v + importlib.reload(numba) + self.assertTrue(numba.__version__) + + for v in ver_fail: + with self.assertRaises(ImportError): + llvmlite.__version__ = v + importlib.reload(numba) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_locals.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_locals.py new file mode 100644 index 0000000000000000000000000000000000000000..9546f58c1e6dfea5138996e7debcdb0b5a3828eb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_locals.py @@ -0,0 +1,18 @@ +from numba import float32, njit +import unittest + + +def foo(): + x = 123 + return x + + +class TestLocals(unittest.TestCase): + + def test_seed_types(self): + cfunc = njit((), locals={'x': float32})(foo) + self.assertEqual(cfunc.nopython_signatures[0].return_type, float32) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_looplifting.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_looplifting.py new file mode 100644 index 0000000000000000000000000000000000000000..cd04b74874bfad2b3f252a17a218d74cc7ca5739 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_looplifting.py @@ -0,0 +1,560 @@ +from io import StringIO +import numpy as np + +from numba.core import types +from numba.core.compiler import compile_extra, Flags +from numba.tests.support import TestCase, tag, MemoryLeakMixin +import unittest + + +looplift_flags = Flags() +looplift_flags.force_pyobject = True +looplift_flags.enable_looplift = True + +pyobject_looplift_flags = looplift_flags.copy() +pyobject_looplift_flags.enable_pyobject_looplift = True + + +def compile_isolated(pyfunc, argtypes, **kwargs): + from numba.core.registry import cpu_target + + kwargs.setdefault('return_type', None) + kwargs.setdefault('locals', {}) + return compile_extra( + cpu_target.typing_context, + cpu_target.target_context, + pyfunc, + argtypes, + **kwargs, + ) + + +def lift1(x): + # Outer needs object mode because of np.empty() + a = np.empty(3) + for i in range(a.size): + # Inner is nopython-compliant + a[i] = x + return a + + +def lift2(x): + # Outer needs object mode because of np.empty() + a = np.empty((3, 4)) + for i in range(a.shape[0]): + for j in range(a.shape[1]): + # Inner is nopython-compliant + a[i, j] = x + return a + + +def lift3(x): + # Output variable from the loop + _ = object() + a = np.arange(5, dtype=np.int64) + c = 0 + for i in range(a.shape[0]): + c += a[i] * x + return c + +def lift4(x): + # Output two variables from the loop + _ = object() + a = np.arange(5, dtype=np.int64) + c = 0 + d = 0 + for i in range(a.shape[0]): + c += a[i] * x + d += c + return c + d + +def lift5(x): + _ = object() + a = np.arange(4) + for i in range(a.shape[0]): + # Inner has a break statement + if i > 2: + break + return a + +def lift_gen1(x): + # Outer needs object mode because of np.empty() + a = np.empty(3) + yield 0 + for i in range(a.size): + # Inner is nopython-compliant + a[i] = x + yield np.sum(a) + +def lift_issue2561(): + np.empty(1) # This forces objectmode because no nrt + for i in range(10): + for j in range(10): + return 1 + return 2 + +def reject1(x): + a = np.arange(4) + for i in range(a.shape[0]): + # Inner returns a variable from outer "scope" => cannot loop-lift + return a + return a + + +def reject_gen1(x): + _ = object() + a = np.arange(4) + for i in range(a.shape[0]): + # Inner is a generator => cannot loop-lift + yield a[i] + +def reject_gen2(x): + _ = object() + a = np.arange(3) + for i in range(a.size): + # Middle has a yield => cannot loop-lift + res = a[i] + x + for j in range(i): + # Inner is nopython-compliant, but the current algorithm isn't + # able to separate it. + res = res ** 2 + yield res + +def reject_npm1(x): + a = np.empty(3, dtype=np.int32) + for i in range(a.size): + # Inner uses object() => cannot loop-lift + _ = object() + a[i] = np.arange(i + 1)[i] + + return a + + +class TestLoopLifting(MemoryLeakMixin, TestCase): + + def try_lift(self, pyfunc, argtypes): + from numba.core.registry import cpu_target + + cres = compile_extra( + cpu_target.typing_context, + cpu_target.target_context, + pyfunc, argtypes, + return_type=None, flags=looplift_flags, locals={}, + ) + # One lifted loop + self.assertEqual(len(cres.lifted), 1) + return cres + + def assert_lifted_native(self, cres): + # Check if we have lifted in nopython mode + jitloop = cres.lifted[0] + [loopcres] = jitloop.overloads.values() + self.assertTrue(loopcres.fndesc.native) # Lifted function is native + + def check_lift_ok(self, pyfunc, argtypes, args): + """ + Check that pyfunc can loop-lift even in nopython mode. + """ + cres = self.try_lift(pyfunc, argtypes) + expected = pyfunc(*args) + got = cres.entry_point(*args) + self.assert_lifted_native(cres) + # Check return values + self.assertPreciseEqual(expected, got) + + def check_lift_generator_ok(self, pyfunc, argtypes, args): + """ + Check that pyfunc (a generator function) can loop-lift even in + nopython mode. + """ + cres = self.try_lift(pyfunc, argtypes) + expected = list(pyfunc(*args)) + got = list(cres.entry_point(*args)) + self.assert_lifted_native(cres) + # Check return values + self.assertPreciseEqual(expected, got) + + def check_no_lift(self, pyfunc, argtypes, args): + """ + Check that pyfunc can't loop-lift. + """ + cres = compile_isolated(pyfunc, argtypes, + flags=looplift_flags) + self.assertFalse(cres.lifted) + expected = pyfunc(*args) + got = cres.entry_point(*args) + # Check return values + self.assertPreciseEqual(expected, got) + + def check_no_lift_generator(self, pyfunc, argtypes, args): + """ + Check that pyfunc (a generator function) can't loop-lift. + """ + cres = compile_isolated(pyfunc, argtypes, + flags=looplift_flags) + self.assertFalse(cres.lifted) + expected = list(pyfunc(*args)) + got = list(cres.entry_point(*args)) + self.assertPreciseEqual(expected, got) + + def test_lift1(self): + self.check_lift_ok(lift1, (types.intp,), (123,)) + + def test_lift2(self): + self.check_lift_ok(lift2, (types.intp,), (123,)) + + def test_lift3(self): + self.check_lift_ok(lift3, (types.intp,), (123,)) + + def test_lift4(self): + self.check_lift_ok(lift4, (types.intp,), (123,)) + + def test_lift5(self): + self.check_lift_ok(lift5, (types.intp,), (123,)) + + def test_lift_issue2561(self): + self.check_lift_ok(lift_issue2561, (), ()) + + def test_lift_gen1(self): + self.check_lift_generator_ok(lift_gen1, (types.intp,), (123,)) + + def test_reject1(self): + self.check_no_lift(reject1, (types.intp,), (123,)) + + def test_reject_gen1(self): + self.check_no_lift_generator(reject_gen1, (types.intp,), (123,)) + + def test_reject_gen2(self): + self.check_no_lift_generator(reject_gen2, (types.intp,), (123,)) + + +class TestLoopLiftingAnnotate(TestCase): + def test_annotate_1(self): + """ + Verify that annotation works as expected with one lifted loop + """ + from numba import jit + + # dummy function to force objmode + def bar(): + pass + + def foo(x): + bar() # force obj + for i in range(x.size): + x[i] += 1 + + return x + + cfoo = jit(forceobj=True)(foo) + + x = np.arange(10) + xcopy = x.copy() + r = cfoo(x) + np.testing.assert_equal(r, xcopy + 1) + + buf = StringIO() + cfoo.inspect_types(file=buf) + annotation = buf.getvalue() + buf.close() + + self.assertIn("The function contains lifted loops", annotation) + line = foo.__code__.co_firstlineno + 2 # 2 lines down from func head + self.assertIn("Loop at line {line}".format(line=line), annotation) + self.assertIn("Has 1 overloads", annotation) + + def test_annotate_2(self): + """ + Verify that annotation works as expected with two lifted loops + """ + from numba import jit + + # dummy function to force objmode + def bar(): + pass + + def foo(x): + bar() # force obj + # first lifted loop + for i in range(x.size): + x[i] += 1 + # second lifted loop + for j in range(x.size): + x[j] *= 2 + return x + + cfoo = jit(forceobj=True)(foo) + + x = np.arange(10) + xcopy = x.copy() + r = cfoo(x) + np.testing.assert_equal(r, (xcopy + 1) * 2) + + buf = StringIO() + cfoo.inspect_types(file=buf) + annotation = buf.getvalue() + buf.close() + + self.assertIn("The function contains lifted loops", annotation) + line1 = foo.__code__.co_firstlineno + 3 # 3 lines down from func head + line2 = foo.__code__.co_firstlineno + 6 # 6 lines down from func head + self.assertIn("Loop at line {line}".format(line=line1), annotation) + self.assertIn("Loop at line {line}".format(line=line2), annotation) + + +class TestLoopLiftingInAction(MemoryLeakMixin, TestCase): + def assert_has_lifted(self, jitted, loopcount): + lifted = jitted.overloads[jitted.signatures[0]].lifted + self.assertEqual(len(lifted), loopcount) + + def test_issue_734(self): + from numba import jit, void, int32, double + + @jit(void(int32, double[:]), forceobj=True) + def forloop_with_if(u, a): + if u == 0: + for i in range(a.shape[0]): + a[i] = a[i] * 2.0 + else: + for i in range(a.shape[0]): + a[i] = a[i] + 1.0 + + for u in (0, 1): + nb_a = np.arange(10, dtype='int32') + np_a = np.arange(10, dtype='int32') + forloop_with_if(u, nb_a) + forloop_with_if.py_func(u, np_a) + self.assertPreciseEqual(nb_a, np_a) + + def test_issue_812(self): + from numba import jit + + @jit('f8[:](f8[:])', forceobj=True) + def test(x): + res = np.zeros(len(x)) + ind = 0 + for ii in range(len(x)): + ind += 1 + res[ind] = x[ind] + if x[ind] >= 10: + break + + # Invalid loopjitting will miss the usage of `ind` in the + # following loop. + for ii in range(ind + 1, len(x)): + res[ii] = 0 + return res + + x = np.array([1., 4, 2, -3, 5, 2, 10, 5, 2, 6]) + np.testing.assert_equal(test.py_func(x), test(x)) + + def test_issue_2368(self): + from numba import jit + + def lift_issue2368(a, b): + s = 0 + for e in a: + s += e + h = b.__hash__() + return s, h + + a = np.ones(10) + b = object() + jitted = jit(forceobj=True)(lift_issue2368) + + expected = lift_issue2368(a, b) + got = jitted(a, b) + + self.assertEqual(expected[0], got[0]) + self.assertEqual(expected[1], got[1]) + + jitloop = jitted.overloads[jitted.signatures[0]].lifted[0] + [loopcres] = jitloop.overloads.values() + # assert lifted function is native + self.assertTrue(loopcres.fndesc.native) + + def test_no_iteration_w_redef(self): + # redefinition of res in the loop with no use of res should not + # prevent lifting + from numba import jit + + @jit(forceobj=True) + def test(n): + res = 0 + for i in range(n): + res = i + return res + + # loop count = 1, loop lift but loop body not execute + self.assertEqual(test.py_func(-1), test(-1)) + self.assert_has_lifted(test, loopcount=1) + # loop count = 1, loop will lift and will execute + self.assertEqual(test.py_func(1), test(1)) + self.assert_has_lifted(test, loopcount=1) + + def test_no_iteration(self): + from numba import jit + + @jit(forceobj=True) + def test(n): + res = 0 + for i in range(n): + res += i + return res + + # loop count = 1 + self.assertEqual(test.py_func(-1), test(-1)) + self.assert_has_lifted(test, loopcount=1) + # loop count = 1 + self.assertEqual(test.py_func(1), test(1)) + self.assert_has_lifted(test, loopcount=1) + + def test_define_in_loop_body(self): + # tests a definition in a loop that leaves the loop is liftable + from numba import jit + + @jit(forceobj=True) + def test(n): + for i in range(n): + res = i + return res + + # loop count = 1 + self.assertEqual(test.py_func(1), test(1)) + self.assert_has_lifted(test, loopcount=1) + + def test_invalid_argument(self): + """Test a problem caused by invalid discovery of loop argument + when a variable is used afterwards but not before. + + Before the fix, this will result in:: + + numba.ir.NotDefinedError: 'i' is not defined + """ + from numba import jit + + @jit(forceobj=True) + def test(arg): + if type(arg) == np.ndarray: # force object mode + if arg.ndim == 1: + result = 0.0 + j = 0 + for i in range(arg.shape[0]): + pass + else: + raise Exception + else: + result = 0.0 + i, j = 0, 0 + return result + + arg = np.arange(10) + self.assertEqual(test.py_func(arg), test(arg)) + + def test_conditionally_defined_in_loop(self): + from numba import jit + @jit(forceobj=True) + def test(): + x = 5 + y = 0 + for i in range(2): + if i > 0: + x = 6 + y += x + return y, x + + self.assertEqual(test.py_func(), test()) + self.assert_has_lifted(test, loopcount=1) + + def test_stack_offset_error_when_has_no_return(self): + from numba import jit + import warnings + + def pyfunc(a): + if a: + for i in range(10): + pass + + with warnings.catch_warnings(): + warnings.simplefilter("error") + + cfunc = jit(forceobj=True)(pyfunc) + self.assertEqual(pyfunc(True), cfunc(True)) + + def test_variable_scope_bug(self): + """ + https://github.com/numba/numba/issues/2179 + + Looplifting transformation is using the wrong version of variable `h`. + """ + from numba import jit + + def bar(x): + return x + + def foo(x): + h = 0. + for k in range(x): + h = h + k + h = h - bar(x) + return h + + cfoo = jit(forceobj=True)(foo) + self.assertEqual(foo(10), cfoo(10)) + + def test_recompilation_loop(self): + """ + https://github.com/numba/numba/issues/2481 + """ + from numba import jit + + def foo(x, y): + # slicing to make array `x` into different layout + # to cause a new compilation of the lifted loop + A = x[::y] + c = 1 + for k in range(A.size): + object() # to force objectmode and looplifting + c = c * A[::-1][k] # the slice that is failing in static_getitem + return c + + cfoo = jit(forceobj=True)(foo) + # First run just works + args = np.arange(10), 1 + self.assertEqual(foo(*args), cfoo(*args)) + # Exactly 1 lifted loop so far + self.assertEqual(len(cfoo.overloads[cfoo.signatures[0]].lifted), 1) + lifted = cfoo.overloads[cfoo.signatures[0]].lifted[0] + # The lifted loop has 1 signature + self.assertEqual(len(lifted.signatures), 1) + # Use different argument to trigger a new compilation of the lifted loop + args = np.arange(10), -1 + self.assertEqual(foo(*args), cfoo(*args)) + # Ensure that is really a new overload for the lifted loop + self.assertEqual(len(lifted.signatures), 2) + + + def test_lift_objectmode_issue_4223(self): + from numba import jit + + @jit(forceobj=True) + def foo(a, b, c, d, x0, y0, n): + xs, ys = np.zeros(n), np.zeros(n) + xs[0], ys[0] = x0, y0 + for i in np.arange(n-1): + xs[i+1] = np.sin(a * ys[i]) + c * np.cos(a * xs[i]) + ys[i+1] = np.sin(b * xs[i]) + d * np.cos(b * ys[i]) + object() # ensure object mode + return xs, ys + + kwargs = dict(a=1.7, b=1.7, c=0.6, d=1.2, x0=0, y0=0, n=200) + got = foo(**kwargs) + expected = foo.py_func(**kwargs) + self.assertPreciseEqual(got[0], expected[0]) + self .assertPreciseEqual(got[1], expected[1]) + [lifted] = foo.overloads[foo.signatures[0]].lifted + self.assertEqual(len(lifted.nopython_signatures), 1) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_make_function_to_jit_function.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_make_function_to_jit_function.py new file mode 100644 index 0000000000000000000000000000000000000000..29161fff594545fffceee89dbe9390cb349f1dc4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_make_function_to_jit_function.py @@ -0,0 +1,284 @@ +from numba import njit +from numba.core import errors +from numba.core.extending import overload +import numpy as np + +import unittest + + +@njit +def consumer(func, *args): + return func(*args) + + +@njit +def consumer2arg(func1, func2): + return func2(func1) + + +_global = 123 + + +class TestMakeFunctionToJITFunction(unittest.TestCase): + """ + This tests the pass that converts ir.Expr.op == make_function (i.e. closure) + into a JIT function. + """ + # NOTE: testing this is a bit tricky. The function receiving a JIT'd closure + # must also be under JIT control so as to handle the JIT'd closure + # correctly, however, in the case of running the test implementations in the + # interpreter, the receiving function cannot be JIT'd else it will receive + # the Python closure and then complain about pyobjects as arguments. + # The way around this is to use a factory function to close over either the + # jitted or standard python function as the consumer depending on context. + + def test_escape(self): + + def impl_factory(consumer_func): + def impl(): + def inner(): + return 10 + return consumer_func(inner) + return impl + + cfunc = njit(impl_factory(consumer)) + impl = impl_factory(consumer.py_func) + + self.assertEqual(impl(), cfunc()) + + def test_nested_escape(self): + + def impl_factory(consumer_func): + def impl(): + def inner(): + return 10 + + def innerinner(x): + return x() + return consumer_func(inner, innerinner) + return impl + + cfunc = njit(impl_factory(consumer2arg)) + impl = impl_factory(consumer2arg.py_func) + + self.assertEqual(impl(), cfunc()) + + def test_closure_in_escaper(self): + + def impl_factory(consumer_func): + def impl(): + def callinner(): + def inner(): + return 10 + return inner() + return consumer_func(callinner) + return impl + + cfunc = njit(impl_factory(consumer)) + impl = impl_factory(consumer.py_func) + + self.assertEqual(impl(), cfunc()) + + def test_close_over_consts(self): + + def impl_factory(consumer_func): + def impl(): + y = 10 + + def callinner(z): + return y + z + _global + return consumer_func(callinner, 6) + return impl + + cfunc = njit(impl_factory(consumer)) + impl = impl_factory(consumer.py_func) + + self.assertEqual(impl(), cfunc()) + + def test_close_over_consts_w_args(self): + + def impl_factory(consumer_func): + def impl(x): + y = 10 + + def callinner(z): + return y + z + _global + return consumer_func(callinner, x) + return impl + + cfunc = njit(impl_factory(consumer)) + impl = impl_factory(consumer.py_func) + + a = 5 + self.assertEqual(impl(a), cfunc(a)) + + def test_with_overload(self): + + def foo(func, *args): + nargs = len(args) + if nargs == 1: + return func(*args) + elif nargs == 2: + return func(func(*args)) + + @overload(foo) + def foo_ol(func, *args): + # specialise on the number of args, as per `foo` + nargs = len(args) + if nargs == 1: + def impl(func, *args): + return func(*args) + return impl + elif nargs == 2: + def impl(func, *args): + return func(func(*args)) + return impl + + def impl_factory(consumer_func): + def impl(x): + y = 10 + + def callinner(*z): + return y + np.sum(np.asarray(z)) + _global + # run both specialisations, 1 arg, and 2 arg. + return foo(callinner, x), foo(callinner, x, x) + return impl + + cfunc = njit(impl_factory(consumer)) + impl = impl_factory(consumer.py_func) + + a = 5 + self.assertEqual(impl(a), cfunc(a)) + + def test_basic_apply_like_case(self): + def apply(array, func): + return func(array) + + @overload(apply) + def ov_apply(array, func): + return lambda array, func: func(array) + + def impl(array): + def mul10(x): + return x * 10 + return apply(array, mul10) + + cfunc = njit(impl) + + a = np.arange(10) + np.testing.assert_allclose(impl(a), cfunc(a)) + + @unittest.skip("Needs option/flag inheritance to work") + def test_jit_option_inheritance(self): + + def impl_factory(consumer_func): + def impl(x): + def inner(val): + return 1 / val + return consumer_func(inner, x) + return impl + + cfunc = njit(error_model='numpy')(impl_factory(consumer)) + impl = impl_factory(consumer.py_func) + + a = 0 + self.assertEqual(impl(a), cfunc(a)) + + # this needs true SSA to be able to work correctly, check error for now + def test_multiply_defined_freevar(self): + + @njit + def impl(c): + if c: + x = 3 + + def inner(y): + return y + x + + r = consumer(inner, 1) + else: + x = 6 + + def inner(y): + return y + x + + r = consumer(inner, 2) + return r + + with self.assertRaises(errors.TypingError) as e: + impl(1) + + self.assertIn("Cannot capture a constant value for variable", + str(e.exception)) + + def test_non_const_in_escapee(self): + + @njit + def impl(x): + z = np.arange(x) + + def inner(val): + return 1 + z + val # z is non-const freevar + return consumer(inner, x) + + with self.assertRaises(errors.TypingError) as e: + impl(1) + + self.assertIn("Cannot capture the non-constant value associated", + str(e.exception)) + + def test_escape_with_kwargs(self): + + def impl_factory(consumer_func): + def impl(): + t = 12 + + def inner(a, b, c, mydefault1=123, mydefault2=456): + z = 4 + return mydefault1 + mydefault2 + z + t + a + b + c + # this is awkward, top and tail closure inlining with a escapees + # in the middle that do/don't have defaults. + return (inner(1, 2, 5, 91, 53), + consumer_func(inner, 1, 2, 3, 73), + consumer_func(inner, 1, 2, 3,), + inner(1, 2, 4)) + return impl + + cfunc = njit(impl_factory(consumer)) + impl = impl_factory(consumer.py_func) + + np.testing.assert_allclose(impl(), cfunc()) + + def test_escape_with_kwargs_override_kwargs(self): + + @njit + def specialised_consumer(func, *args): + x, y, z = args # unpack to avoid `CALL_FUNCTION_EX` + a = func(x, y, z, mydefault1=1000) + b = func(x, y, z, mydefault2=1000) + c = func(x, y, z, mydefault1=1000, mydefault2=1000) + return a + b + c + + def impl_factory(consumer_func): + def impl(): + t = 12 + + def inner(a, b, c, mydefault1=123, mydefault2=456): + z = 4 + return mydefault1 + mydefault2 + z + t + a + b + c + # this is awkward, top and tail closure inlining with a escapees + # in the middle that get defaults specified in the consumer + return (inner(1, 2, 5, 91, 53), + consumer_func(inner, 1, 2, 11), + consumer_func(inner, 1, 2, 3,), + inner(1, 2, 4)) + return impl + + cfunc = njit(impl_factory(specialised_consumer)) + impl = impl_factory(specialised_consumer.py_func) + + np.testing.assert_allclose(impl(), cfunc()) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mandelbrot.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mandelbrot.py new file mode 100644 index 0000000000000000000000000000000000000000..7a9fc2dd1411e6f52c77654e9dd51e87a612b0a0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mandelbrot.py @@ -0,0 +1,28 @@ +import unittest +from numba import njit +from numba.core import types + + +def is_in_mandelbrot(c): + i = 0 + z = 0.0j + for i in range(100): + z = z ** 2 + c + if (z.real * z.real + z.imag * z.imag) >= 4: + return False + return True + + +class TestMandelbrot(unittest.TestCase): + + def test_mandelbrot(self): + pyfunc = is_in_mandelbrot + cfunc = njit((types.complex64,))(pyfunc) + + points = [0+0j, 1+0j, 0+1j, 1+1j, 0.1+0.1j] + for p in points: + self.assertEqual(cfunc(p), pyfunc(p)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mangling.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mangling.py new file mode 100644 index 0000000000000000000000000000000000000000..ad1ff95c8f4115cb53fa7cfc111d9dead2bb2bc3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mangling.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +""" +Test function name mangling. +The mangling affects the ABI of numba compiled binaries. +""" +from numba.core import types +from numba.core.funcdesc import default_mangler +from numba.tests.support import unittest, TestCase + + +class TestMangling(TestCase): + def test_one_args(self): + fname = 'foo' + argtypes = types.int32, + name = default_mangler(fname, argtypes) + self.assertEqual(name, '_Z3fooi') + + def test_two_args(self): + fname = 'foo' + argtypes = types.int32, types.float32 + name = default_mangler(fname, argtypes) + self.assertEqual(name, '_Z3fooif') + + def test_unicode_fname(self): + fname = u'foಠ' + argtypes = types.int32, types.float32 + name = default_mangler(fname, argtypes) + self.assertIsInstance(name, str) + # manually encode it + unichar = fname[2] + enc = ''.join('_{:02x}'.format(c) + for c in unichar.encode('utf8')) + text = 'fo' + enc + expect = '_Z{}{}if'.format(len(text), text) + self.assertEqual(name, expect) + # ensure result chars are in the right charset + self.assertRegex(name, r'^_Z[a-zA-Z0-9_\$]+$') + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_map_filter_reduce.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_map_filter_reduce.py new file mode 100644 index 0000000000000000000000000000000000000000..c6f46a156f04f804030e2c391fc022b9b1d8aefb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_map_filter_reduce.py @@ -0,0 +1,91 @@ +from numba import njit + +from functools import reduce +import unittest + + +class TestMap(unittest.TestCase): + + def test_basic_map_external_func(self): + func = njit(lambda x: x + 10) + + def impl(): + return [y for y in map(func, range(10))] + + cfunc = njit(impl) + + self.assertEqual(impl(), cfunc()) + + def test_basic_map_closure(self): + def impl(): + return [y for y in map(lambda x: x + 10, range(10))] + + cfunc = njit(impl) + + self.assertEqual(impl(), cfunc()) + + def test_basic_map_closure_multiple_iterator(self): + def impl(): + args = range(10), range(10, 20) + return [y for y in map(lambda a, b: (a + 10, b + 5), *args)] + + cfunc = njit(impl) + + self.assertEqual(impl(), cfunc()) + + +class TestFilter(unittest.TestCase): + + def test_basic_filter_external_func(self): + func = njit(lambda x: x > 0) + + def impl(): + return [y for y in filter(func, range(-10, 10))] + + cfunc = njit(impl) + + self.assertEqual(impl(), cfunc()) + + def test_basic_filter_closure(self): + def impl(): + return [y for y in filter(lambda x: x > 0, range(-10, 10))] + + cfunc = njit(impl) + + self.assertEqual(impl(), cfunc()) + + def test_basic_filter_none_func(self): + def impl(): + return [y for y in filter(None, range(-10, 10))] + + cfunc = njit(impl) + + self.assertEqual(impl(), cfunc()) + + +class TestReduce(unittest.TestCase): + + def test_basic_reduce_external_func(self): + func = njit(lambda x, y: x + y) + + def impl(): + return reduce(func, range(-10, 10)) + + cfunc = njit(impl) + + self.assertEqual(impl(), cfunc()) + + def test_basic_reduce_closure(self): + + def impl(): + def func(x, y): + return x + y + return reduce(func, range(-10, 10), 100) + + cfunc = njit(impl) + + self.assertEqual(impl(), cfunc()) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mathlib.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mathlib.py new file mode 100644 index 0000000000000000000000000000000000000000..82863574ef40d4ef75decb7dfe3e4a814e29e568 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mathlib.py @@ -0,0 +1,559 @@ +import itertools +import math +import sys +import unittest +import warnings + +import numpy as np + +from numba import njit, types +from numba.tests.support import TestCase +from numba.np import numpy_support + + +def sin(x): + return math.sin(x) + + +def cos(x): + return math.cos(x) + + +def tan(x): + return math.tan(x) + + +def sinh(x): + return math.sinh(x) + + +def cosh(x): + return math.cosh(x) + + +def tanh(x): + return math.tanh(x) + + +def asin(x): + return math.asin(x) + + +def acos(x): + return math.acos(x) + + +def atan(x): + return math.atan(x) + + +def atan2(y, x): + return math.atan2(y, x) + + +def asinh(x): + return math.asinh(x) + + +def acosh(x): + return math.acosh(x) + + +def atanh(x): + return math.atanh(x) + + +def sqrt(x): + return math.sqrt(x) + + +def npy_sqrt(x): + return np.sqrt(x) + + +def exp(x): + return math.exp(x) + + +def expm1(x): + return math.expm1(x) + + +def log(x): + return math.log(x) + + +def log1p(x): + return math.log1p(x) + + +def log10(x): + return math.log10(x) + + +def log2(x): + return math.log2(x) + + +def floor(x): + return math.floor(x) + + +def ceil(x): + return math.ceil(x) + + +def trunc(x): + return math.trunc(x) + + +def isnan(x): + return math.isnan(x) + + +def isinf(x): + return math.isinf(x) + + +def isfinite(x): + return math.isfinite(x) + + +def hypot(x, y): + return math.hypot(x, y) + + +def nextafter(x, y): + return math.nextafter(x, y) + + +def degrees(x): + return math.degrees(x) + + +def radians(x): + return math.radians(x) + + +def erf(x): + return math.erf(x) + + +def erfc(x): + return math.erfc(x) + + +def gamma(x): + return math.gamma(x) + + +def lgamma(x): + return math.lgamma(x) + + +def pow(x, y): + return math.pow(x, y) + +def gcd(x, y): + return math.gcd(x, y) + +def copysign(x, y): + return math.copysign(x, y) + + +def frexp(x): + return math.frexp(x) + + +def ldexp(x, e): + return math.ldexp(x, e) + + +def get_constants(): + return math.pi, math.e + + +class TestMathLib(TestCase): + + def test_constants(self): + cfunc = njit(get_constants) + self.assertPreciseEqual(cfunc(), cfunc.py_func()) + + def run_unary(self, pyfunc, x_types, x_values, prec='exact', **kwargs): + cfunc = njit(pyfunc) + for tx, vx in zip(x_types, x_values): + got = cfunc(vx) + expected = pyfunc(vx) + actual_prec = 'single' if tx is types.float32 else prec + msg = 'for input %r' % (vx,) + self.assertPreciseEqual(got, expected, prec=actual_prec, msg=msg, + **kwargs) + + def run_binary(self, pyfunc, x_types, x_values, y_values, prec='exact'): + cfunc = njit(pyfunc) + for ty, x, y in zip(x_types, x_values, y_values): + got = cfunc(x, y) + expected = pyfunc(x, y) + actual_prec = 'single' if ty is types.float32 else prec + msg = 'for inputs (%r, %r)' % (x, y) + self.assertPreciseEqual(got, expected, prec=actual_prec, msg=msg) + + def check_predicate_func(self, pyfunc): + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float32, types.float32, + types.float64, types.float64, types.float64] + x_values = [0, 0, 0, 0, 0, 0, + float('inf'), 0.0, float('nan'), + float('inf'), 0.0, float('nan')] + self.run_unary(pyfunc, x_types, x_values) + + def test_sin(self): + pyfunc = sin + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [-2, -1, -2, 2, 1, 2, .1, .2] + self.run_unary(pyfunc, x_types, x_values) + + @unittest.skipIf(sys.platform == 'win32', + "not exactly equal on win32 (issue #597)") + def test_cos(self): + pyfunc = cos + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [-2, -1, -2, 2, 1, 2, .1, .2] + self.run_unary(pyfunc, x_types, x_values) + + def test_tan(self): + pyfunc = tan + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [-2, -1, -2, 2, 1, 2, .1, .2] + self.run_unary(pyfunc, x_types, x_values) + + def test_sqrt(self): + pyfunc = sqrt + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [2, 1, 2, 2, 1, 2, .1, .2] + self.run_unary(pyfunc, x_types, x_values) + + def test_npy_sqrt(self): + pyfunc = npy_sqrt + x_values = [2, 1, 2, 2, 1, 2, .1, .2] + # XXX poor precision for int16 inputs + x_types = [types.int16, types.uint16] + self.run_unary(pyfunc, x_types, x_values, prec='single') + x_types = [types.int32, types.int64, + types.uint32, types.uint64, + types.float32, types.float64] + self.run_unary(pyfunc, x_types, x_values) + + def test_exp(self): + pyfunc = exp + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [-2, -1, -2, 2, 1, 2, .1, .2] + self.run_unary(pyfunc, x_types, x_values) + + def test_expm1(self): + pyfunc = expm1 + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [-2, -1, -2, 2, 1, 2, .1, .2] + self.run_unary(pyfunc, x_types, x_values) + + def test_log(self): + pyfunc = log + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 10, 100, 1000, 100000, 1000000, 0.1, 1.1] + self.run_unary(pyfunc, x_types, x_values) + + def test_log1p(self): + pyfunc = log1p + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 10, 100, 1000, 100000, 1000000, 0.1, 1.1] + self.run_unary(pyfunc, x_types, x_values) + + def test_log10(self): + pyfunc = log10 + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 10, 100, 1000, 100000, 1000000, 0.1, 1.1] + self.run_unary(pyfunc, x_types, x_values) + + def test_log2(self): + pyfunc = log2 + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 10, 100, 1000, 100000, 1000000, 0.1, 1.1] + self.run_unary(pyfunc, x_types, x_values) + + def test_asin(self): + pyfunc = asin + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 1, 1, 1, 1, 1, 1., 1.] + self.run_unary(pyfunc, x_types, x_values) + + def test_acos(self): + pyfunc = acos + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 1, 1, 1, 1, 1, 1., 1.] + self.run_unary(pyfunc, x_types, x_values) + + def test_atan(self): + pyfunc = atan + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [-2, -1, -2, 2, 1, 2, .1, .2] + self.run_unary(pyfunc, x_types, x_values) + + def test_atan2(self): + pyfunc = atan2 + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [-2, -1, -2, 2, 1, 2, .1, .2] + y_values = [x * 2 for x in x_values] + self.run_binary(pyfunc, x_types, x_values, y_values) + + def test_asinh(self): + pyfunc = asinh + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 1, 1, 1, 1, 1, 1., 1.] + self.run_unary(pyfunc, x_types, x_values, prec='double') + + def test_acosh(self): + pyfunc = acosh + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 1, 1, 1, 1, 1, 1., 1.] + self.run_unary(pyfunc, x_types, x_values) + + def test_atanh(self): + pyfunc = atanh + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [0, 0, 0, 0, 0, 0, 0.1, 0.1] + self.run_unary(pyfunc, x_types, x_values, prec='double') + + def test_sinh(self): + pyfunc = sinh + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 1, 1, 1, 1, 1, 1., 1.] + self.run_unary(pyfunc, x_types, x_values) + + def test_cosh(self): + pyfunc = cosh + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 1, 1, 1, 1, 1, 1., 1.] + self.run_unary(pyfunc, x_types, x_values) + + def test_tanh(self): + pyfunc = tanh + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [0, 0, 0, 0, 0, 0, 0.1, 0.1] + self.run_unary(pyfunc, x_types, x_values) + + def test_floor(self): + pyfunc = floor + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [0, 0, 0, 0, 0, 0, 0.1, 1.9] + self.run_unary(pyfunc, x_types, x_values) + + def test_ceil(self): + pyfunc = ceil + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [0, 0, 0, 0, 0, 0, 0.1, 1.9] + self.run_unary(pyfunc, x_types, x_values) + + def test_trunc(self): + pyfunc = trunc + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [0, 0, 0, 0, 0, 0, 0.1, 1.9] + self.run_unary(pyfunc, x_types, x_values) + + def test_isnan(self): + self.check_predicate_func(isnan) + + def test_isinf(self): + self.check_predicate_func(isinf) + + def test_isfinite(self): + self.check_predicate_func(isfinite) + + def test_hypot(self): + pyfunc = hypot + x_types = [types.int64, types.uint64, + types.float32, types.float64] + x_values = [1, 2, 3, 4, 5, 6, .21, .34] + y_values = [x + 2 for x in x_values] + # Issue #563: precision issues with math.hypot() under Windows. + prec = 'single' + self.run_binary(pyfunc, x_types, x_values, y_values, prec) + # Check that values that overflow in naive implementations do not + # in the numba impl + + def naive_hypot(x, y): + return math.sqrt(x * x + y * y) + + cfunc = njit(pyfunc) + for fltty in (types.float32, types.float64): + dt = numpy_support.as_dtype(fltty).type + val = dt(np.finfo(dt).max / 30.) + nb_ans = cfunc(val, val) + self.assertPreciseEqual(nb_ans, pyfunc(val, val), prec='single') + self.assertTrue(np.isfinite(nb_ans)) + + with warnings.catch_warnings(): + warnings.simplefilter("error", RuntimeWarning) + self.assertRaisesRegex(RuntimeWarning, + 'overflow encountered in .*scalar', + naive_hypot, val, val) + + def test_nextafter(self): + pyfunc = nextafter + x_types = [types.float32, types.float64, + types.int32, types.int64, + types.uint32, types.uint64] + x_values = [0.0, .21, .34, 1005382.042, -25.328] + y1_values = [x + 2 for x in x_values] + y2_values = [x - 2 for x in x_values] + + self.run_binary(pyfunc, x_types, x_values, y1_values) + self.run_binary(pyfunc, x_types, x_values, y2_values) + + # Test using pos/neg inf + self.run_binary(pyfunc, x_types, [0.0, -.5, .5], [math.inf]*3) + self.run_binary(pyfunc, x_types, [0.0, -.5, .5], [-math.inf]*3) + + # if both args to nextafter are equal, then it is returned unchanged. + self.run_binary(pyfunc, x_types, x_values, x_values) + + def test_degrees(self): + pyfunc = degrees + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 1, 1, 1, 1, 1, 1., 1.] + self.run_unary(pyfunc, x_types, x_values) + + def test_radians(self): + pyfunc = radians + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [1, 1, 1, 1, 1, 1, 1., 1.] + self.run_unary(pyfunc, x_types, x_values) + + def test_erf(self): + pyfunc = erf + x_values = [1., 1., -1., -0.0, 0.0, 0.5, 5, float('inf')] + x_types = [types.float32, types.float64] * (len(x_values) // 2) + self.run_unary(pyfunc, x_types, x_values, prec='double', ulps=2) + + def test_erfc(self): + pyfunc = erfc + x_values = [1., 1., -1., -0.0, 0.0, 0.5, 5, float('inf')] + x_types = [types.float32, types.float64] * (len(x_values) // 2) + self.run_unary(pyfunc, x_types, x_values, prec='double', ulps=4) + + def test_gamma(self): + pyfunc = gamma + x_values = [1., -0.9, -0.5, 0.5] + x_types = [types.float32, types.float64] * (len(x_values) // 2) + self.run_unary(pyfunc, x_types, x_values, prec='double', ulps=3) + x_values = [-0.1, 0.1, 2.5, 10.1, 50., float('inf')] + x_types = [types.float64] * len(x_values) + self.run_unary(pyfunc, x_types, x_values, prec='double', ulps=8) + + def test_lgamma(self): + pyfunc = lgamma + x_values = [1., -0.9, -0.1, 0.1, 200., 1e10, 1e30, float('inf')] + x_types = [types.float32, types.float64] * (len(x_values) // 2) + self.run_unary(pyfunc, x_types, x_values, prec='double') + + def test_pow(self): + pyfunc = pow + x_types = [types.int16, types.int32, types.int64, + types.uint16, types.uint32, types.uint64, + types.float32, types.float64] + x_values = [-2, -1, -2, 2, 1, 2, .1, .2] + y_values = [x * 2 for x in x_values] + self.run_binary(pyfunc, x_types, x_values, y_values) + + def test_gcd(self): + from itertools import product, repeat, chain + pyfunc = gcd + signed_args = product( + sorted(types.signed_domain), *repeat((-2, -1, 0, 1, 2, 7, 10), 2) + ) + unsigned_args = product( + sorted(types.unsigned_domain), *repeat((0, 1, 2, 7, 9, 16), 2) + ) + x_types, x_values, y_values = zip(*chain(signed_args, unsigned_args)) + self.run_binary(pyfunc, x_types, x_values, y_values) + + def test_copysign(self): + pyfunc = copysign + value_types = [types.float32, types.float64] + values = [-2, -1, -0.0, 0.0, 1, 2, float('-inf'), float('inf'), + float('nan')] + x_types, x_values, y_values = list(zip( + *itertools.product(value_types, values, values))) + self.run_binary(pyfunc, x_types, x_values, y_values) + + def test_frexp(self): + pyfunc = frexp + x_types = [types.float32, types.float64] + x_values = [-2.5, -0.0, 0.0, 3.5, + float('-inf'), float('inf'), float('nan')] + self.run_unary(pyfunc, x_types, x_values, prec='exact') + + def test_ldexp(self): + pyfunc = ldexp + cfunc = njit(pyfunc) + for fltty in (types.float32, types.float64): + for args in [(2.5, -2), (2.5, 1), (0.0, 0), (0.0, 1), + (-0.0, 0), (-0.0, 1), + (float('inf'), 0), (float('-inf'), 0), + (float('nan'), 0)]: + msg = 'for input %r' % (args,) + self.assertPreciseEqual(cfunc(*args), pyfunc(*args)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_maxmin.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_maxmin.py new file mode 100644 index 0000000000000000000000000000000000000000..ae62681328e0de5a6e69c9ea38ad79bea7de299d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_maxmin.py @@ -0,0 +1,39 @@ +from numba import njit +from numba.core import types +import unittest + + +def domax3(a, b, c): + return max(a, b, c) + + +def domin3(a, b, c): + return min(a, b, c) + + +class TestMaxMin(unittest.TestCase): + def test_max3(self): + pyfunc = domax3 + argtys = (types.int32, types.float32, types.double) + cfunc = njit(argtys)(pyfunc) + + a = 1 + b = 2 + c = 3 + + self.assertEqual(pyfunc(a, b, c), cfunc(a, b, c)) + + def test_min3(self): + pyfunc = domin3 + argtys = (types.int32, types.float32, types.double) + cfunc = njit(argtys)(pyfunc) + + a = 1 + b = 2 + c = 3 + + self.assertEqual(pyfunc(a, b, c), cfunc(a, b, c)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_misc_coverage_support.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_misc_coverage_support.py new file mode 100644 index 0000000000000000000000000000000000000000..7dee5cdd5054dddbefffee8775fda191e46ab01b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_misc_coverage_support.py @@ -0,0 +1,75 @@ +import unittest +from unittest.mock import patch + +from numba.tests.support import TestCase + +from numba import njit +from numba.core import ir +from numba.misc.coverage_support import NotifyLocBase, _the_registry + + +class TestMiscCoverageSupport(TestCase): + @TestCase.run_test_in_subprocess(envvars={"NUMBA_JIT_COVERAGE": "1"}) + def test_custom_loc_notifier(self): + class MyNotify(NotifyLocBase): + records = [] + + def notify(self, loc): + self.records.append(("NOTIFY", loc)) + + def close(self): + self.records.append(("CLOSE", None)) + + # Patch to install registry for testing + new_the_registry = _the_registry + [MyNotify] + gv = "numba.misc.coverage_support._the_registry" + with patch(gv, new_the_registry): + + @njit + def foo(): + return 123 + + res = foo() + + self.assertEqual(res, 123) + + # offset by +2 because: + # +1 for the decorator + # +1 for the `def` line + first_offset = 2 + offset = foo.__code__.co_firstlineno + first_offset + loc = ir.Loc(__file__, 1) + self.assertIn(("NOTIFY", loc.with_lineno(offset)), MyNotify.records) + self.assertIn(("CLOSE", None), MyNotify.records) + + # Test dead branch pruned + with patch(gv, new_the_registry): + cond = False + + @njit + def foo(): + if cond: + return 321 + return 123 + + res = foo() + + self.assertEqual(res, 123) + + # `if cond` line is compiled + offset = foo.__code__.co_firstlineno + first_offset + self.assertIn(("NOTIFY", loc.with_lineno(offset)), MyNotify.records) + + # ` return 321` line is not compiled + self.assertNotIn( + ("NOTIFY", loc.with_lineno(offset + 1)), MyNotify.records + ) + + # ` return 123` line is compiled + self.assertIn(("NOTIFY", loc.with_lineno(offset + 2)), MyNotify.records) + + self.assertIn(("CLOSE", None), MyNotify.records) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mixed_tuple_unroller.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mixed_tuple_unroller.py new file mode 100644 index 0000000000000000000000000000000000000000..455169def76ad17b350af73e445c847fbbe37708 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_mixed_tuple_unroller.py @@ -0,0 +1,2047 @@ +from collections import namedtuple +import numpy as np + +from numba.tests.support import (TestCase, MemoryLeakMixin, + skip_parfors_unsupported, captured_stdout) +from numba import njit, typed, literal_unroll, prange +from numba.core import types, errors, ir +from numba.testing import unittest +from numba.core.extending import overload +from numba.core.compiler_machinery import (PassManager, register_pass, + FunctionPass, AnalysisPass) +from numba.core.compiler import CompilerBase +from numba.core.untyped_passes import (FixupArgs, TranslateByteCode, + IRProcessing, InlineClosureLikes, + SimplifyCFG, IterLoopCanonicalization, + LiteralUnroll, PreserveIR) +from numba.core.typed_passes import (NopythonTypeInference, IRLegalization, + NoPythonBackend, PartialTypeInference, + NativeLowering) +from numba.core.ir_utils import (compute_cfg_from_blocks, flatten_labels) +from numba.core.types.functions import _header_lead + +_X_GLOBAL = (10, 11) + + +class TestLiteralTupleInterpretation(MemoryLeakMixin, TestCase): + + def check(self, func, var): + cres = func.overloads[func.signatures[0]] + ty = cres.fndesc.typemap[var] + self.assertTrue(isinstance(ty, types.Tuple)) + for subty in ty: + self.assertTrue(isinstance(subty, types.Literal), "non literal") + + def test_homogeneous_literal(self): + @njit + def foo(): + x = (1, 2, 3) + return x[1] + + self.assertEqual(foo(), foo.py_func()) + self.check(foo, 'x') + + def test_heterogeneous_literal(self): + @njit + def foo(): + x = (1, 2, 3, 'a') + return x[3] + + self.assertEqual(foo(), foo.py_func()) + self.check(foo, 'x') + + def test_non_literal(self): + @njit + def foo(): + x = (1, 2, 3, 'a', 1j) + return x[4] + + self.assertEqual(foo(), foo.py_func()) + with self.assertRaises(AssertionError) as e: + self.check(foo, 'x') + + self.assertIn("non literal", str(e.exception)) + + +@register_pass(mutates_CFG=False, analysis_only=False) +class ResetTypeInfo(FunctionPass): + _name = "reset_the_type_information" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + state.typemap = None + state.return_type = None + state.calltypes = None + return True + + +class TestLoopCanonicalisation(MemoryLeakMixin, TestCase): + + def get_pipeline(use_canonicaliser, use_partial_typing=False): + class NewCompiler(CompilerBase): + + def define_pipelines(self): + pm = PassManager("custom_pipeline") + + # untyped + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(IRProcessing, "processing IR") + pm.add_pass(InlineClosureLikes, + "inline calls to locally defined closures") + if use_partial_typing: + pm.add_pass(PartialTypeInference, "do partial typing") + if use_canonicaliser: + pm.add_pass(IterLoopCanonicalization, "Canonicalise loops") + pm.add_pass(SimplifyCFG, "Simplify the CFG") + + # typed + if use_partial_typing: + pm.add_pass(ResetTypeInfo, "resets the type info state") + + pm.add_pass(NopythonTypeInference, "nopython frontend") + + # legalise + pm.add_pass(IRLegalization, "ensure IR is legal") + + # preserve + pm.add_pass(PreserveIR, "save IR for later inspection") + + # lower + pm.add_pass(NativeLowering, "native lowering") + pm.add_pass(NoPythonBackend, "nopython mode backend") + + # finalise the contents + pm.finalize() + + return [pm] + return NewCompiler + + # generate variants + LoopIgnoringCompiler = get_pipeline(False) + LoopCanonicalisingCompiler = get_pipeline(True) + TypedLoopCanonicalisingCompiler = get_pipeline(True, True) + + def test_simple_loop_in_depth(self): + """ This heavily checks a simple loop transform """ + + def get_info(pipeline): + @njit(pipeline_class=pipeline) + def foo(tup): + acc = 0 + for i in tup: + acc += i + return acc + + x = (1, 2, 3) + self.assertEqual(foo(x), foo.py_func(x)) + cres = foo.overloads[foo.signatures[0]] + func_ir = cres.metadata['preserved_ir'] + return func_ir, cres.fndesc + + ignore_loops_ir, ignore_loops_fndesc = \ + get_info(self.LoopIgnoringCompiler) + canonicalise_loops_ir, canonicalise_loops_fndesc = \ + get_info(self.LoopCanonicalisingCompiler) + + # check CFG is the same + def compare_cfg(a, b): + a_cfg = compute_cfg_from_blocks(flatten_labels(a.blocks)) + b_cfg = compute_cfg_from_blocks(flatten_labels(b.blocks)) + self.assertEqual(a_cfg, b_cfg) + + compare_cfg(ignore_loops_ir, canonicalise_loops_ir) + + # check there's three more call types in the canonicalised one: + # len(tuple arg) + # range(of the len() above) + # getitem(tuple arg, index) + self.assertEqual(len(ignore_loops_fndesc.calltypes) + 3, + len(canonicalise_loops_fndesc.calltypes)) + + def find_getX(fd, op): + return [x for x in fd.calltypes.keys() + if isinstance(x, ir.Expr) and x.op == op] + + il_getiters = find_getX(ignore_loops_fndesc, "getiter") + self.assertEqual(len(il_getiters), 1) # tuple iterator + + cl_getiters = find_getX(canonicalise_loops_fndesc, "getiter") + self.assertEqual(len(cl_getiters), 1) # loop range iterator + + cl_getitems = find_getX(canonicalise_loops_fndesc, "getitem") + self.assertEqual(len(cl_getitems), 1) # tuple getitem induced by loop + + # check the value of the untransformed IR getiter is now the value of + # the transformed getitem + self.assertEqual(il_getiters[0].value.name, cl_getitems[0].value.name) + + # check the type of the transformed IR getiter is a range iter + range_inst = canonicalise_loops_fndesc.calltypes[cl_getiters[0]].args[0] + self.assertTrue(isinstance(range_inst, types.RangeType)) + + def test_transform_scope(self): + """ This checks the transform, when there's no typemap, will happily + transform a loop on something that's not tuple-like + """ + def get_info(pipeline): + @njit(pipeline_class=pipeline) + def foo(): + acc = 0 + for i in [1, 2, 3]: + acc += i + return acc + + self.assertEqual(foo(), foo.py_func()) + cres = foo.overloads[foo.signatures[0]] + func_ir = cres.metadata['preserved_ir'] + return func_ir, cres.fndesc + + ignore_loops_ir, ignore_loops_fndesc = \ + get_info(self.LoopIgnoringCompiler) + canonicalise_loops_ir, canonicalise_loops_fndesc = \ + get_info(self.LoopCanonicalisingCompiler) + + # check CFG is the same + def compare_cfg(a, b): + a_cfg = compute_cfg_from_blocks(flatten_labels(a.blocks)) + b_cfg = compute_cfg_from_blocks(flatten_labels(b.blocks)) + self.assertEqual(a_cfg, b_cfg) + + compare_cfg(ignore_loops_ir, canonicalise_loops_ir) + + # check there's three more call types in the canonicalised one: + # len(literal list) + # range(of the len() above) + # getitem(literal list arg, index) + self.assertEqual(len(ignore_loops_fndesc.calltypes) + 3, + len(canonicalise_loops_fndesc.calltypes)) + + def find_getX(fd, op): + return [x for x in fd.calltypes.keys() + if isinstance(x, ir.Expr) and x.op == op] + + il_getiters = find_getX(ignore_loops_fndesc, "getiter") + self.assertEqual(len(il_getiters), 1) # list iterator + + cl_getiters = find_getX(canonicalise_loops_fndesc, "getiter") + self.assertEqual(len(cl_getiters), 1) # loop range iterator + + cl_getitems = find_getX(canonicalise_loops_fndesc, "getitem") + self.assertEqual(len(cl_getitems), 1) # list getitem induced by loop + + # check the value of the untransformed IR getiter is now the value of + # the transformed getitem + self.assertEqual(il_getiters[0].value.name, cl_getitems[0].value.name) + + # check the type of the transformed IR getiter is a range iter + range_inst = canonicalise_loops_fndesc.calltypes[cl_getiters[0]].args[0] + self.assertTrue(isinstance(range_inst, types.RangeType)) + + @unittest.skip("Waiting for pass to be enabled for all tuples") + def test_influence_of_typed_transform(self): + """ This heavily checks a typed transformation only impacts tuple + induced loops""" + + def get_info(pipeline): + @njit(pipeline_class=pipeline) + def foo(tup): + acc = 0 + for i in range(4): + for y in tup: + for j in range(3): + acc += 1 + return acc + + x = (1, 2, 3) + self.assertEqual(foo(x), foo.py_func(x)) + cres = foo.overloads[foo.signatures[0]] + func_ir = cres.metadata['func_ir'] + return func_ir, cres.fndesc + + ignore_loops_ir, ignore_loops_fndesc = \ + get_info(self.LoopIgnoringCompiler) + canonicalise_loops_ir, canonicalise_loops_fndesc = \ + get_info(self.TypedLoopCanonicalisingCompiler) + + # check CFG is the same + def compare_cfg(a, b): + a_cfg = compute_cfg_from_blocks(flatten_labels(a.blocks)) + b_cfg = compute_cfg_from_blocks(flatten_labels(b.blocks)) + self.assertEqual(a_cfg, b_cfg) + + compare_cfg(ignore_loops_ir, canonicalise_loops_ir) + + # check there's three more call types in the canonicalised one: + # len(tuple arg) + # range(of the len() above) + # getitem(tuple arg, index) + self.assertEqual(len(ignore_loops_fndesc.calltypes) + 3, + len(canonicalise_loops_fndesc.calltypes)) + + def find_getX(fd, op): + return [x for x in fd.calltypes.keys() + if isinstance(x, ir.Expr) and x.op == op] + + il_getiters = find_getX(ignore_loops_fndesc, "getiter") + self.assertEqual(len(il_getiters), 3) # 1 * tuple + 2 * loop range + + cl_getiters = find_getX(canonicalise_loops_fndesc, "getiter") + self.assertEqual(len(cl_getiters), 3) # 3 * loop range iterator + + cl_getitems = find_getX(canonicalise_loops_fndesc, "getitem") + self.assertEqual(len(cl_getitems), 1) # tuple getitem induced by loop + + # check the value of the untransformed IR getiter is now the value of + # the transformed getitem + self.assertEqual(il_getiters[1].value.name, cl_getitems[0].value.name) + + # check the type of the transformed IR getiter's are all range iter + for x in cl_getiters: + range_inst = canonicalise_loops_fndesc.calltypes[x].args[0] + self.assertTrue(isinstance(range_inst, types.RangeType)) + + def test_influence_of_typed_transform_literal_unroll(self): + """ This heavily checks a typed transformation only impacts loops with + literal_unroll marker""" + + def get_info(pipeline): + @njit(pipeline_class=pipeline) + def foo(tup): + acc = 0 + for i in range(4): + for y in literal_unroll(tup): + for j in range(3): + acc += 1 + return acc + + x = (1, 2, 3) + self.assertEqual(foo(x), foo.py_func(x)) + cres = foo.overloads[foo.signatures[0]] + func_ir = cres.metadata['preserved_ir'] + return func_ir, cres.fndesc + + ignore_loops_ir, ignore_loops_fndesc = \ + get_info(self.LoopIgnoringCompiler) + canonicalise_loops_ir, canonicalise_loops_fndesc = \ + get_info(self.TypedLoopCanonicalisingCompiler) + + # check CFG is the same + def compare_cfg(a, b): + a_cfg = compute_cfg_from_blocks(flatten_labels(a.blocks)) + b_cfg = compute_cfg_from_blocks(flatten_labels(b.blocks)) + self.assertEqual(a_cfg, b_cfg) + + compare_cfg(ignore_loops_ir, canonicalise_loops_ir) + + # check there's three more call types in the canonicalised one: + # len(tuple arg) + # range(of the len() above) + # getitem(tuple arg, index) + self.assertEqual(len(ignore_loops_fndesc.calltypes) + 3, + len(canonicalise_loops_fndesc.calltypes)) + + def find_getX(fd, op): + return [x for x in fd.calltypes.keys() + if isinstance(x, ir.Expr) and x.op == op] + + il_getiters = find_getX(ignore_loops_fndesc, "getiter") + self.assertEqual(len(il_getiters), 3) # 1 * tuple + 2 * loop range + + cl_getiters = find_getX(canonicalise_loops_fndesc, "getiter") + self.assertEqual(len(cl_getiters), 3) # 3 * loop range iterator + + cl_getitems = find_getX(canonicalise_loops_fndesc, "getitem") + self.assertEqual(len(cl_getitems), 1) # tuple getitem induced by loop + + # check the value of the untransformed IR getiter is now the value of + # the transformed getitem + self.assertEqual(il_getiters[1].value.name, cl_getitems[0].value.name) + + # check the type of the transformed IR getiter's are all range iter + for x in cl_getiters: + range_inst = canonicalise_loops_fndesc.calltypes[x].args[0] + self.assertTrue(isinstance(range_inst, types.RangeType)) + + @unittest.skip("Waiting for pass to be enabled for all tuples") + def test_lots_of_loops(self): + """ This heavily checks a simple loop transform """ + + def get_info(pipeline): + @njit(pipeline_class=pipeline) + def foo(tup): + acc = 0 + for i in tup: + acc += i + for j in tup + (4, 5, 6): + acc += 1 - j + if j > 5: + break + else: + acc -= 2 + for i in tup: + acc -= i % 2 + + return acc + + x = (1, 2, 3) + self.assertEqual(foo(x), foo.py_func(x)) + cres = foo.overloads[foo.signatures[0]] + func_ir = cres.metadata['preserved_ir'] + return func_ir, cres.fndesc + + ignore_loops_ir, ignore_loops_fndesc = \ + get_info(self.LoopIgnoringCompiler) + canonicalise_loops_ir, canonicalise_loops_fndesc = \ + get_info(self.LoopCanonicalisingCompiler) + + # check CFG is the same + def compare_cfg(a, b): + a_cfg = compute_cfg_from_blocks(flatten_labels(a.blocks)) + b_cfg = compute_cfg_from_blocks(flatten_labels(b.blocks)) + self.assertEqual(a_cfg, b_cfg) + + compare_cfg(ignore_loops_ir, canonicalise_loops_ir) + + # check there's three * N more call types in the canonicalised one: + # len(tuple arg) + # range(of the len() above) + # getitem(tuple arg, index) + self.assertEqual(len(ignore_loops_fndesc.calltypes) + 3 * 3, + len(canonicalise_loops_fndesc.calltypes)) + + def test_inlined_loops(self): + """ Checks a loop appearing from a closure """ + + def get_info(pipeline): + @njit(pipeline_class=pipeline) + def foo(tup): + def bar(n): + acc = 0 + for i in range(n): + acc += 1 + return acc + + acc = 0 + for i in tup: + acc += i + acc += bar(i) + + return acc + + x = (1, 2, 3) + self.assertEqual(foo(x), foo.py_func(x)) + cres = foo.overloads[foo.signatures[0]] + func_ir = cres.metadata['preserved_ir'] + return func_ir, cres.fndesc + + ignore_loops_ir, ignore_loops_fndesc = \ + get_info(self.LoopIgnoringCompiler) + canonicalise_loops_ir, canonicalise_loops_fndesc = \ + get_info(self.LoopCanonicalisingCompiler) + + # check CFG is the same + def compare_cfg(a, b): + a_cfg = compute_cfg_from_blocks(flatten_labels(a.blocks)) + b_cfg = compute_cfg_from_blocks(flatten_labels(b.blocks)) + self.assertEqual(a_cfg, b_cfg) + + compare_cfg(ignore_loops_ir, canonicalise_loops_ir) + + # check there's 2 * N - 1 more call types in the canonicalised one: + # The -1 comes from the closure being inlined and and the call removed. + # len(tuple arg) + # range(of the len() above) + # getitem(tuple arg, index) + self.assertEqual(len(ignore_loops_fndesc.calltypes) + 5, + len(canonicalise_loops_fndesc.calltypes)) + + +class TestMixedTupleUnroll(MemoryLeakMixin, TestCase): + + def test_01(self): + # test a case which is already in loop canonical form + @njit + def foo(idx, z): + a = (12, 12.7, 3j, 4, z, 2 * z) + acc = 0 + for i in range(len(literal_unroll(a))): + acc += a[i] + if acc.real < 26: + acc -= 1 + else: + break + return acc + + f = 9 + k = f + + self.assertEqual(foo(2, k), foo.py_func(2, k)) + + def test_02(self): + # same as test_1 but without the explicit loop canonicalisation + + @njit + def foo(idx, z): + x = (12, 12.7, 3j, 4, z, 2 * z) + acc = 0 + for a in literal_unroll(x): + acc += a + if acc.real < 26: + acc -= 1 + else: + break + return acc + + f = 9 + k = f + + self.assertEqual(foo(2, k), foo.py_func(2, k)) + + def test_03(self): + # two unrolls + @njit + def foo(idx, z): + x = (12, 12.7, 3j, 4, z, 2 * z) + y = ('foo', z, 2 * z) + acc = 0 + for a in literal_unroll(x): + acc += a + if acc.real < 26: + acc -= 1 + else: + for t in literal_unroll(y): + acc += t is False + break + return acc + + f = 9 + k = f + + self.assertEqual(foo(2, k), foo.py_func(2, k)) + + def test_04(self): + # mixed ref counted types + @njit + def foo(tup): + acc = 0 + for a in literal_unroll(tup): + acc += a.sum() + return acc + + n = 10 + tup = (np.ones((n,)), np.ones((n, n)), np.ones((n, n, n))) + self.assertEqual(foo(tup), foo.py_func(tup)) + + def test_05(self): + # mix unroll and static_getitem + @njit + def foo(tup1, tup2): + acc = 0 + for a in literal_unroll(tup1): + if a == 'a': + acc += tup2[0].sum() + elif a == 'b': + acc += tup2[1].sum() + elif a == 'c': + acc += tup2[2].sum() + elif a == 12: + acc += tup2[3].sum() + elif a == 3j: + acc += tup2[4].sum() + else: + raise RuntimeError("Unreachable") + return acc + + n = 10 + tup1 = ('a', 'b', 'c', 12, 3j,) + tup2 = (np.ones((n,)), np.ones((n, n)), np.ones((n, n, n)), + np.ones((n, n, n, n)), np.ones((n, n, n, n, n))) + self.assertEqual(foo(tup1, tup2), foo.py_func(tup1, tup2)) + + @unittest.skip("needs more clever branch prune") + def test_06(self): + # This wont work because both sides of the branch need typing as neither + # can be pruned by the current pruner + @njit + def foo(tup): + acc = 0 + str_buf = typed.List.empty_list(types.unicode_type) + for a in literal_unroll(tup): + if a == 'a': + str_buf.append(a) + else: + acc += a + return acc + + tup = ('a', 12) + self.assertEqual(foo(tup), foo.py_func(tup)) + + def test_07(self): + # A mix bag of stuff as an arg to a function that unifies as `intp`. + @njit + def foo(tup): + acc = 0 + for a in literal_unroll(tup): + acc += len(a) + return acc + + n = 10 + tup = (np.ones((n,)), np.ones((n, n)), "ABCDEFGHJI", (1, 2, 3), + (1, 'foo', 2, 'bar'), {3, 4, 5, 6, 7}) + self.assertEqual(foo(tup), foo.py_func(tup)) + + def test_08(self): + # dispatch to functions + + @njit + def foo(tup1, tup2): + acc = 0 + for a in literal_unroll(tup1): + if a == 'a': + acc += tup2[0]() + elif a == 'b': + acc += tup2[1]() + elif a == 'c': + acc += tup2[2]() + return acc + + def gen(x): + def impl(): + return x + return njit(impl) + + tup1 = ('a', 'b', 'c', 12, 3j, ('f',)) + tup2 = (gen(1), gen(2), gen(3)) + self.assertEqual(foo(tup1, tup2), foo.py_func(tup1, tup2)) + + def test_09(self): + # illegal RHS, has a mixed tuple being index dynamically + + @njit + def foo(tup1, tup2): + acc = 0 + idx = 0 + for a in literal_unroll(tup1): + if a == 'a': + acc += tup2[idx] + elif a == 'b': + acc += tup2[idx] + elif a == 'c': + acc += tup2[idx] + idx += 1 + return idx, acc + + @njit + def func1(): + return 1 + + @njit + def func2(): + return 2 + + @njit + def func3(): + return 3 + + tup1 = ('a', 'b', 'c') + tup2 = (1j, 1, 2) + + with self.assertRaises(errors.TypingError) as raises: + foo(tup1, tup2) + + self.assertIn(_header_lead, str(raises.exception)) + + def test_10(self): + # dispatch on literals triggering @overload resolution + + def dt(value): + if value == "apple": + return 1 + elif value == "orange": + return 2 + elif value == "banana": + return 3 + elif value == 0xca11ab1e: + return 0x5ca1ab1e + value + + @overload(dt, inline='always') + def ol_dt(li): + if isinstance(li, types.StringLiteral): + value = li.literal_value + if value == "apple": + def impl(li): + return 1 + elif value == "orange": + def impl(li): + return 2 + elif value == "banana": + def impl(li): + return 3 + return impl + elif isinstance(li, types.IntegerLiteral): + value = li.literal_value + if value == 0xca11ab1e: + def impl(li): + # close over the dispatcher :) + return 0x5ca1ab1e + value + return impl + + @njit + def foo(): + acc = 0 + for t in literal_unroll(('apple', 'orange', 'banana', 3390155550)): + acc += dt(t) + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_11(self): + + @njit + def foo(): + x = [] + z = ('apple', 'orange', 'banana') + for i in range(len(literal_unroll(z))): + t = z[i] + if t == "apple": + x.append("0") + elif t == "orange": + x.append(t) + elif t == "banana": + x.append("2.0") + return x + + self.assertEqual(foo(), foo.py_func()) + + def test_11a(self): + + @njit + def foo(): + x = typed.List() + z = ('apple', 'orange', 'banana') + for i in range(len(literal_unroll(z))): + t = z[i] + if t == "apple": + x.append("0") + elif t == "orange": + x.append(t) + elif t == "banana": + x.append("2.0") + return x + + self.assertEqual(foo(), foo.py_func()) + + def test_12(self): + # unroll the same target twice + @njit + def foo(idx, z): + a = (12, 12.7, 3j, 4, z, 2 * z) + acc = 0 + for i in literal_unroll(a): + acc += i + if acc.real < 26: + acc -= 1 + else: + for x in literal_unroll(a): + acc += x + break + if a[0] < 23: + acc += 2 + return acc + + f = 9 + k = f + + self.assertEqual(foo(2, k), foo.py_func(2, k)) + + def test_13(self): + # nesting unrolls is illegal + @njit + def foo(idx, z): + a = (12, 12.7, 3j, 4, z, 2 * z) + acc = 0 + for i in literal_unroll(a): + acc += i + if acc.real < 26: + acc -= 1 + else: + for x in literal_unroll(a): + for j in literal_unroll(a): + acc += j + acc += x + for x in literal_unroll(a): + acc += x + for x in literal_unroll(a): + acc += x + if a[0] < 23: + acc += 2 + return acc + + f = 9 + k = f + + with self.assertRaises(errors.UnsupportedError) as raises: + foo(2, k) + + self.assertIn("Nesting of literal_unroll is unsupported", + str(raises.exception)) + + def test_14(self): + # unituple unroll can return derivative of the induction var + + @njit + def foo(): + x = (1, 2, 3, 4) + acc = 0 + for a in literal_unroll(x): + acc += a + return a + + self.assertEqual(foo(), foo.py_func()) + + def test_15(self): + # mixed tuple unroll cannot return derivative of the induction var + + @njit + def foo(x): + acc = 0 + for a in literal_unroll(x): + acc += len(a) + return a + + n = 5 + tup = (np.ones((n,)), np.ones((n, n)), "ABCDEFGHJI", (1, 2, 3), + (1, 'foo', 2, 'bar'), {3, 4, 5, 6, 7}) + + with self.assertRaises(errors.TypingError) as raises: + foo(tup) + + self.assertIn("Cannot unify", str(raises.exception)) + + def test_16(self): + # unituple slice and unroll is ok + + def dt(value): + if value == 1000: + return "a" + elif value == 2000: + return "b" + elif value == 3000: + return "c" + elif value == 4000: + return "d" + + @overload(dt, inline='always') + def ol_dt(li): + if isinstance(li, types.IntegerLiteral): + value = li.literal_value + if value == 1000: + def impl(li): + return "a" + elif value == 2000: + def impl(li): + return "b" + elif value == 3000: + def impl(li): + return "c" + elif value == 4000: + def impl(li): + return "d" + return impl + + @njit + def foo(): + x = (1000, 2000, 3000, 4000) + acc = "" + for a in literal_unroll(x[:2]): + acc += dt(a) + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_17(self): + # mixed tuple slice and unroll is ok + + def dt(value): + if value == 1000: + return "a" + elif value == 2000: + return "b" + elif value == 3000: + return "c" + elif value == 4000: + return "d" + elif value == 'f': + return "EFF" + + @overload(dt, inline='always') + def ol_dt(li): + if isinstance(li, types.IntegerLiteral): + value = li.literal_value + if value == 1000: + def impl(li): + return "a" + elif value == 2000: + def impl(li): + return "b" + elif value == 3000: + def impl(li): + return "c" + elif value == 4000: + def impl(li): + return "d" + return impl + elif isinstance(li, types.StringLiteral): + value = li.literal_value + if value == 'f': + def impl(li): + return "EFF" + return impl + + @njit + def foo(): + x = (1000, 2000, 3000, 'f') + acc = "" + for a in literal_unroll(x[1:]): + acc += dt(a) + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_18(self): + # unituple backwards slice + @njit + def foo(): + x = (1000, 2000, 3000, 4000, 5000, 6000) + count = 0 + for a in literal_unroll(x[::-1]): + count += 1 + if a < 3000: + break + return count + + self.assertEqual(foo(), foo.py_func()) + + def test_19(self): + # mixed bag of refcounted + @njit + def foo(): + acc = 0 + l1 = [1, 2, 3, 4] + l2 = [10, 20] + tup = (l1, l2) + a1 = np.arange(20) + a2 = np.ones(5, dtype=np.complex128) + tup = (l1, a1, l2, a2) + for t in literal_unroll(tup): + acc += len(t) + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_20(self): + # testing partial type inference survives as the list append in the + # unrolled version is full inferable + @njit + def foo(): + l = [] + a1 = np.arange(20) + a2 = np.ones(5, dtype=np.complex128) + tup = (a1, a2) + for t in literal_unroll(tup): + l.append(t.sum()) + return l + + self.assertEqual(foo(), foo.py_func()) + + def test_21(self): + # unroll in closure that gets inlined + @njit + def foo(z): + b = (23, 23.9, 6j, 8) + + def bar(): + acc = 0 + for j in literal_unroll(b): + acc += j + return acc + outer_acc = 0 + for x in (1, 2, 3, 4): + outer_acc += bar() + x + + return outer_acc + + f = 9 + k = f + self.assertEqual(foo(k), foo.py_func(k)) + + def test_22(self): + # NOTE: This test "worked" as a side effect of a bug that was discovered + # during work that added support for Python 3.12. In the literal_unroll + # transform, there was an accidental overwrite of a dictionary key that + # could occur if nested unrolls happened to have the conditions: + # + # 1. outer unroll induction varible not used in the induced loop. + # 2. the `max_label` from numba.core.ir_utils was in a specific state + # such that a collision occurred. + # 3. the bug existed in the algorithm that checked for getitem access. + # + # This exceedingly rare usecase is now considered illegal as a result, + # by banning this behaviour the analysis is considerably more simple. + # Further there is no loss of functionality as the outer loop can be + # trivially replaced (in the following) by using a `range(len())` based + # iteration over `a` as there's no need for the loop in `a` to be + # versioned! + + @njit + def foo(z): + a = (12, 12.7, 3j, 4, z, 2 * z, 'a') + b = (23, 23.9, 6j, 8) + + def bar(): + acc = 0 + for j in literal_unroll(b): + acc += j + return acc + acc = 0 + # this loop is induced in `x` but `x` is not used, there is a nest + # here by virtue of inlining + for x in literal_unroll(a): + acc += bar() + + return acc + + f = 9 + k = f + + with self.assertRaises(errors.UnsupportedError) as raises: + foo(k) + + self.assertIn("Nesting of literal_unroll is unsupported", + str(raises.exception)) + + def test_23(self): + # unroll from closure that ends up banned as it leads to nesting + @njit + def foo(z): + b = (23, 23.9, 6j, 8) + + def bar(): + acc = 0 + for j in literal_unroll(b): + acc += j + return acc + outer_acc = 0 + # this drives an inlined literal_unroll loop but also has access to + # the induction variable, this is a nested literal_unroll so is + # banned + for x in literal_unroll(b): + outer_acc += bar() + x + + return outer_acc + + f = 9 + k = f + + with self.assertRaises(errors.UnsupportedError) as raises: + foo(k) + + self.assertIn("Nesting of literal_unroll is unsupported", + str(raises.exception)) + + def test_24(self): + # unroll something unsupported + @njit + def foo(): + for x in literal_unroll("ABCDE"): + print(x) + + with self.assertRaises(errors.UnsupportedError) as raises: + foo() + + msg = "argument should be a tuple or a list of constant values" + self.assertIn(msg, str(raises.exception)) + + def test_25(self): + # use unroll by reference/alias + @njit + def foo(): + val = literal_unroll(((1, 2, 3), (2j, 3j), [1, 2], "xyz")) + alias1 = val + alias2 = alias1 + lens = [] + for x in alias2: + lens.append(len(x)) + return lens + + self.assertEqual(foo(), foo.py_func()) + + def test_26(self): + # var defined in unrolled body escapes + # untouched variable is untouched + # read only variable is only read + # mutated is muted correctly + @njit + def foo(z): + a = (12, 12.7, 3j, 4, z, 2 * z) + acc = 0 + count = 0 + untouched = 54 + read_only = 17 + mutated = np.empty((len(a),), dtype=np.complex128) + for x in literal_unroll(a): + acc += x + mutated[count] = x + count += 1 + escape = count + read_only + return escape, acc, untouched, read_only, mutated + + f = 9 + k = f + + self.assertPreciseEqual(foo(k), foo.py_func(k)) + + @skip_parfors_unsupported + def test_27(self): + # parfors loop in unrolled loop + @njit(parallel=True) + def foo(z): + a = (12, 12.7, 3j, 4, z, 2 * z) + acc = 0 + for x in literal_unroll(a): + for k in prange(10): + acc += 1 + return acc + + f = 9 + k = f + + self.assertEqual(foo(k), foo.py_func(k)) + + @skip_parfors_unsupported + def test_28(self): + # parfors reducing on the unrolled induction var + @njit(parallel=True) + def foo(z): + a = (12, 12.7, 3j, 4, z, 2 * z) + acc = 0 + for x in literal_unroll(a): + for k in prange(10): + acc += x + return acc + + f = 9 + k = f + + # summation is unstable + np.testing.assert_allclose(foo(k), foo.py_func(k)) + + @skip_parfors_unsupported + def test_29(self): + # This "works" but parfors is not producing a parallel loop + # TODO: fix + @njit(parallel=True) + def foo(z): + a = (12, 12.7, 3j, 4, z, 2 * z) + acc = 0 + for k in prange(10): + for x in literal_unroll(a): + acc += x + return acc + + f = 9 + k = f + + self.assertEqual(foo(k), foo.py_func(k)) + + def test_30(self): + # function escaping containing an unroll + @njit + def foo(): + const = 1234 + + def bar(t): + acc = 0 + a = (12, 12.7, 3j, 4) + for x in literal_unroll(a): + acc += x + const + return acc, t + return [x for x in map(bar, (1, 2))] + + self.assertEqual(foo(), foo.py_func()) + + def test_31(self): + # this is testing that generators can survive partial typing + # invalid function escaping, map uses zip which can't handle the mixed + # tuple + @njit + def foo(): + const = 1234 + + def bar(t): + acc = 0 + a = (12, 12.7, 3j, 4) + for x in literal_unroll(a): + acc += x + const + return acc, t + return [x for x in map(bar, (1, 2j))] + + with self.assertRaises(errors.TypingError) as raises: + foo() + + self.assertIn(_header_lead, str(raises.exception)) + self.assertIn("zip", str(raises.exception)) + + def test_32(self): + # test yielding from an unroll + @njit + def gen(a): + for x in literal_unroll(a): + yield x + + @njit + def foo(): + return [x for x in gen((1, 2.3, 4j,))] + + self.assertEqual(foo(), foo.py_func()) + + def test_33(self): + # test yielding from unroll in escaping function that is consumed and + # yields + + @njit + def consumer(func, arg): + yield func(arg) + + def get(cons): + @njit + def foo(): + def gen(a): + for x in literal_unroll(a): + yield x + return [next(x) for x in cons(gen, (1, 2.3, 4j,))] + return foo + + cfunc = get(consumer) + pyfunc = get(consumer.py_func).py_func + + self.assertEqual(cfunc(), pyfunc()) + + def test_34(self): + # mixed bag, redefinition of tuple + @njit + def foo(): + acc = 0 + l1 = [1, 2, 3, 4] + l2 = [10, 20] + if acc - 2 > 3: + tup = (l1, l2) + else: + a1 = np.arange(20) + a2 = np.ones(5, dtype=np.complex128) + tup = (l1, a1, l2, a2) + for t in literal_unroll(tup): + acc += len(t) + return acc + + with self.assertRaises(errors.UnsupportedError) as raises: + foo() + + self.assertIn("Invalid use of", str(raises.exception)) + self.assertIn("found multiple definitions of variable", + str(raises.exception)) + + +class TestConstListUnroll(MemoryLeakMixin, TestCase): + + def test_01(self): + + @njit + def foo(): + a = [12, 12.7, 3j, 4] + acc = 0 + for i in range(len(literal_unroll(a))): + acc += a[i] + if acc.real < 26: + acc -= 1 + else: + break + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_02(self): + # same as test_1 but without the explicit loop canonicalisation + + @njit + def foo(): + x = [12, 12.7, 3j, 4] + acc = 0 + for a in literal_unroll(x): + acc += a + if acc.real < 26: + acc -= 1 + else: + break + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_03(self): + # two unrolls + @njit + def foo(): + x = [12, 12.7, 3j, 4] + y = ['foo', 8] + acc = 0 + for a in literal_unroll(x): + acc += a + if acc.real < 26: + acc -= 1 + else: + for t in literal_unroll(y): + acc += t is False + break + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_04(self): + # two unrolls, one is a const list, one is a tuple + @njit + def foo(): + x = [12, 12.7, 3j, 4] + y = ('foo', 8) + acc = 0 + for a in literal_unroll(x): + acc += a + if acc.real < 26: + acc -= 1 + else: + for t in literal_unroll(y): + acc += t is False + break + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_05(self): + # illegal, list has to be const + @njit + def foo(tup1, tup2): + acc = 0 + for a in literal_unroll(tup1): + if a[0] > 1: + acc += tup2[0].sum() + return acc + + n = 10 + tup1 = [np.zeros(10), np.zeros(10)] + tup2 = (np.ones((n,)), np.ones((n, n)), np.ones((n, n, n)), + np.ones((n, n, n, n)), np.ones((n, n, n, n, n))) + + with self.assertRaises(errors.UnsupportedError) as raises: + foo(tup1, tup2) + + msg = "Invalid use of literal_unroll with a function argument" + self.assertIn(msg, str(raises.exception)) + + def test_06(self): + # illegal: list containing non const + @njit + def foo(): + n = 10 + tup = [np.ones((n,)), np.ones((n, n)), "ABCDEFGHJI", (1, 2, 3), + (1, 'foo', 2, 'bar'), {3, 4, 5, 6, 7}] + acc = 0 + for a in literal_unroll(tup): + acc += len(a) + return acc + + with self.assertRaises(errors.UnsupportedError) as raises: + foo() + + self.assertIn("Found non-constant value at position 0", + str(raises.exception)) + + def test_7(self): + # dispatch on literals triggering @overload resolution + + def dt(value): + if value == "apple": + return 1 + elif value == "orange": + return 2 + elif value == "banana": + return 3 + elif value == 0xca11ab1e: + return 0x5ca1ab1e + value + + @overload(dt, inline='always') + def ol_dt(li): + if isinstance(li, types.StringLiteral): + value = li.literal_value + if value == "apple": + def impl(li): + return 1 + elif value == "orange": + def impl(li): + return 2 + elif value == "banana": + def impl(li): + return 3 + return impl + elif isinstance(li, types.IntegerLiteral): + value = li.literal_value + if value == 0xca11ab1e: + def impl(li): + # close over the dispatcher :) + return 0x5ca1ab1e + value + return impl + + @njit + def foo(): + acc = 0 + for t in literal_unroll(['apple', 'orange', 'banana', 3390155550]): + acc += dt(t) + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_8(self): + + @njit + def foo(): + x = [] + z = ['apple', 'orange', 'banana'] + for i in range(len(literal_unroll(z))): + t = z[i] + if t == "apple": + x.append("0") + elif t == "orange": + x.append(t) + elif t == "banana": + x.append("2.0") + return x + + self.assertEqual(foo(), foo.py_func()) + + def test_9(self): + # unroll the same target twice + @njit + def foo(idx, z): + a = [12, 12.7, 3j, 4] + acc = 0 + for i in literal_unroll(a): + acc += i + if acc.real < 26: + acc -= 1 + else: + for x in literal_unroll(a): + acc += x + break + if a[0] < 23: + acc += 2 + return acc + + f = 9 + k = f + + self.assertEqual(foo(2, k), foo.py_func(2, k)) + + def test_10(self): + # nesting unrolls is illegal + @njit + def foo(idx, z): + a = (12, 12.7, 3j, 4, z, 2 * z) + b = [12, 12.7, 3j, 4] + acc = 0 + for i in literal_unroll(a): + acc += i + if acc.real < 26: + acc -= 1 + else: + for x in literal_unroll(a): + for j in literal_unroll(b): + acc += j + acc += x + for x in literal_unroll(a): + acc += x + for x in literal_unroll(a): + acc += x + if a[0] < 23: + acc += 2 + return acc + + f = 9 + k = f + + with self.assertRaises(errors.UnsupportedError) as raises: + foo(2, k) + + self.assertIn("Nesting of literal_unroll is unsupported", + str(raises.exception)) + + def test_11(self): + # homogeneous const list unroll can return derivative of the induction + # var + + @njit + def foo(): + x = [1, 2, 3, 4] + acc = 0 + for a in literal_unroll(x): + acc += a + return a + + self.assertEqual(foo(), foo.py_func()) + + def test_12(self): + # mixed unroll cannot return derivative of the induction var + @njit + def foo(): + acc = 0 + x = [1, 2, 'a'] + for a in literal_unroll(x): + acc += bool(a) + return a + + with self.assertRaises(errors.TypingError) as raises: + foo() + + self.assertIn("Cannot unify", str(raises.exception)) + + def test_13(self): + # list slice is illegal + + @njit + def foo(): + x = [1000, 2000, 3000, 4000] + acc = 0 + for a in literal_unroll(x[:2]): + acc += a + return acc + + with self.assertRaises(errors.UnsupportedError) as raises: + foo() + + self.assertIn("Invalid use of literal_unroll", str(raises.exception)) + + def test_14(self): + # list mutate is illegal + + @njit + def foo(): + x = [1000, 2000, 3000, 4000] + acc = 0 + for a in literal_unroll(x): + acc += a + x.append(10) + return acc + + with self.assertRaises(errors.TypingError) as raises: + foo() + + self.assertIn("Unknown attribute 'append' of type Tuple", + str(raises.exception)) + + +class TestMore(TestCase): + def test_invalid_use_of_unroller(self): + @njit + def foo(): + x = (10, 20) + r = 0 + for a in literal_unroll(x, x): + r += a + return r + + with self.assertRaises(errors.UnsupportedError) as raises: + foo() + self.assertIn( + "literal_unroll takes one argument, found 2", + str(raises.exception), + ) + + def test_non_constant_list(self): + + @njit + def foo(y): + x = [10, y] + r = 0 + for a in literal_unroll(x): + r += a + return r + + with self.assertRaises(errors.UnsupportedError) as raises: + foo(10) + self.assertIn( + ("Found non-constant value at position 1 in a list argument to " + "literal_unroll"), + str(raises.exception) + ) + + @unittest.skip("numba.literally not supported yet") + def test_literally_constant_list(self): + # FAIL. May need to consider it in a future PR + from numba import literally + + @njit + def foo(y): + x = [10, literally(y)] + r = 0 + for a in literal_unroll(x): + r += a + return r + + # Found non-constant value at position 1 in a list argument to + # literal_unroll + foo(12) + + @njit + def bar(): + return foo(12) + + # Found non-constant value at position 1 in a list argument to + # literal_unroll + bar() + + @unittest.skip("inlining of foo doesn't have const prop so y isn't const") + def test_inlined_unroll_list(self): + @njit(inline='always') + def foo(y): + x = [10, y] + r = 0 + for a in literal_unroll(x): + r += a + return r + + @njit + def bar(): + return foo(12) + + self.assertEqual(bar(), 10 + 12) + + def test_unroll_tuple_arg(self): + @njit + def foo(y): + x = (10, y) + r = 0 + for a in literal_unroll(x): + r += a + return r + + self.assertEqual(foo(12), foo.py_func(12)) + self.assertEqual(foo(1.2), foo.py_func(1.2)) + + def test_unroll_tuple_arg2(self): + @njit + def foo(x): + r = 0 + for a in literal_unroll(x): + r += a + return r + + self.assertEqual(foo((12, 1.2)), foo.py_func((12, 1.2))) + self.assertEqual(foo((12, 1.2)), foo.py_func((12, 1.2))) + + def test_unroll_tuple_alias(self): + @njit + def foo(): + x = (10, 1.2) + out = 0 + for i in literal_unroll(x): + j = i + k = j + out += j + k + i + return out + + self.assertEqual(foo(), foo.py_func()) + + def test_unroll_tuple_nested(self): + + @njit + def foo(): + x = ((10, 1.2), (1j, 3.)) + out = 0 + for i in literal_unroll(x): + for j in (i): + out += j + return out + + with self.assertRaises(errors.TypingError) as raises: + foo() + + self.assertIn("getiter", str(raises.exception)) + re = r".*Tuple\(int[0-9][0-9], float64\).*" + self.assertRegex(str(raises.exception), re) + + def test_unroll_tuple_of_dict(self): + + @njit + def foo(): + x = {} + x["a"] = 1 + x["b"] = 2 + y = {} + y[3] = "c" + y[4] = "d" + + for it in literal_unroll((x, y)): + for k, v in it.items(): + print(k, v) + + with captured_stdout() as stdout: + foo() + lines = stdout.getvalue().splitlines() + self.assertEqual( + lines, + ['a 1', 'b 2', '3 c', '4 d'], + ) + + def test_unroll_named_tuple(self): + ABC = namedtuple('ABC', ['a', 'b', 'c']) + + @njit + def foo(): + abc = ABC(1, 2j, 3.4) + out = 0 + for i in literal_unroll(abc): + out += i + return out + + self.assertEqual(foo(), foo.py_func()) + + def test_unroll_named_tuple_arg(self): + ABC = namedtuple('ABC', ['a', 'b', 'c']) + + @njit + def foo(x): + out = 0 + for i in literal_unroll(x): + out += i + return out + + abc = ABC(1, 2j, 3.4) + + self.assertEqual(foo(abc), foo.py_func(abc)) + + def test_unroll_named_unituple(self): + ABC = namedtuple('ABC', ['a', 'b', 'c']) + + @njit + def foo(): + abc = ABC(1, 2, 3) + out = 0 + for i in literal_unroll(abc): + out += i + return out + + self.assertEqual(foo(), foo.py_func()) + + def test_unroll_named_unituple_arg(self): + ABC = namedtuple('ABC', ['a', 'b', 'c']) + + @njit + def foo(x): + out = 0 + for i in literal_unroll(x): + out += i + return out + + abc = ABC(1, 2, 3) + + self.assertEqual(foo(abc), foo.py_func(abc)) + + def test_unroll_global_tuple(self): + + @njit + def foo(): + out = 0 + for i in literal_unroll(_X_GLOBAL): + out += i + return out + + self.assertEqual(foo(), foo.py_func()) + + def test_unroll_freevar_tuple(self): + x = (10, 11) + + @njit + def foo(): + out = 0 + for i in literal_unroll(x): + out += i + return out + + self.assertEqual(foo(), foo.py_func()) + + def test_unroll_function_tuple(self): + @njit + def a(): + return 1 + + @njit + def b(): + return 2 + + x = (a, b) + + @njit + def foo(): + out = 0 + for f in literal_unroll(x): + out += f() + return out + + self.assertEqual(foo(), foo.py_func()) + + def test_unroll_indexing_list(self): + # See issue #5477 + @njit + def foo(cont): + i = 0 + acc = 0 + normal_list = [a for a in cont] + heter_tuple = ('a', 25, 0.23, None) + for item in literal_unroll(heter_tuple): + acc += normal_list[i] + i += 1 + print(item) + return i, acc + + data = [j for j in range(4)] + + # send stdout to nowhere, just check return values + with captured_stdout(): + self.assertEqual(foo(data), foo.py_func(data)) + + # now capture stdout for jit function and check + with captured_stdout() as stdout: + foo(data) + lines = stdout.getvalue().splitlines() + self.assertEqual( + lines, + ['a', '25', '0.23', 'None'], + ) + + def test_unroller_as_freevar(self): + mixed = (np.ones((1,)), np.ones((1, 1)), np.ones((1, 1, 1))) + from numba import literal_unroll as freevar_unroll + + @njit + def foo(): + out = 0 + for i in freevar_unroll(mixed): + out += i.ndim + return out + + self.assertEqual(foo(), foo.py_func()) + + def test_unroll_with_non_conformant_loops_present(self): + # See issue #8311 + + @njit('(Tuple((int64, float64)),)') + def foo(tup): + for t in literal_unroll(tup): + pass + + x = 1 + while x == 1: + x = 0 + + def test_literal_unroll_legalize_var_names01(self): + # See issue #8939 + test = np.array([(1, 2), (2, 3)], dtype=[("a1", "f8"), ("a2", "f8")]) + fields = tuple(test.dtype.fields.keys()) + + @njit + def foo(arr): + res = 0 + for k in literal_unroll(fields): + res = res + np.abs(arr[k]).sum() + return res + + self.assertEqual(foo(test), 8.0) + + def test_literal_unroll_legalize_var_names02(self): + # See issue #8939 + test = np.array([(1, 2), (2, 3)], + dtype=[("a1[0]", "f8"), ("a2[1]", "f8")]) + fields = tuple(test.dtype.fields.keys()) + + @njit + def foo(arr): + res = 0 + for k in literal_unroll(fields): + res = res + np.abs(arr[k]).sum() + return res + + self.assertEqual(foo(test), 8.0) + + +def capture(real_pass): + """ Returns a compiler pass that captures the mutation state reported + by the pass used in the argument""" + @register_pass(mutates_CFG=False, analysis_only=True) + class ResultCapturer(AnalysisPass): + _name = "capture_%s" % real_pass._name + _real_pass = real_pass + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + result = real_pass().run_pass(state) + mutation_results = state.metadata.setdefault('mutation_results', {}) + mutation_results[real_pass] = result + return result + + return ResultCapturer + + +class CapturingCompiler(CompilerBase): + """ Simple pipeline that wraps passes with the ResultCapturer pass""" + + def define_pipelines(self): + pm = PassManager("Capturing Compiler") + + def add_pass(x, y): + return pm.add_pass(capture(x), y) + + add_pass(TranslateByteCode, "analyzing bytecode") + add_pass(FixupArgs, "fix up args") + add_pass(IRProcessing, "processing IR") + add_pass(LiteralUnroll, "handles literal_unroll") + + # typing + add_pass(NopythonTypeInference, "nopython frontend") + + # legalise + add_pass(IRLegalization, + "ensure IR is legal prior to lowering") + + # lower + add_pass(NativeLowering, "native lowering") + add_pass(NoPythonBackend, "nopython mode backend") + pm.finalize() + return [pm] + + +class TestLiteralUnrollPassTriggering(TestCase): + + def test_literal_unroll_not_invoked(self): + @njit(pipeline_class=CapturingCompiler) + def foo(): + acc = 0 + for i in (1, 2, 3): + acc += i + return acc + + foo() + cres = foo.overloads[foo.signatures[0]] + self.assertFalse(cres.metadata['mutation_results'][LiteralUnroll]) + + def test_literal_unroll_is_invoked(self): + @njit(pipeline_class=CapturingCompiler) + def foo(): + acc = 0 + for i in literal_unroll((1, 2, 3)): + acc += i + return acc + + foo() + cres = foo.overloads[foo.signatures[0]] + self.assertTrue(cres.metadata['mutation_results'][LiteralUnroll]) + + def test_literal_unroll_is_invoked_via_alias(self): + alias = literal_unroll + + @njit(pipeline_class=CapturingCompiler) + def foo(): + acc = 0 + for i in alias((1, 2, 3)): + acc += i + return acc + + foo() + cres = foo.overloads[foo.signatures[0]] + self.assertTrue(cres.metadata['mutation_results'][LiteralUnroll]) + + def test_literal_unroll_assess_empty_function(self): + @njit(pipeline_class=CapturingCompiler) + def foo(): + pass + + foo() + cres = foo.overloads[foo.signatures[0]] + self.assertFalse(cres.metadata['mutation_results'][LiteralUnroll]) + + def test_literal_unroll_not_in_globals(self): + f = """def foo():\n\tpass""" + l = {} + exec(f, {}, l) + foo = njit(pipeline_class=CapturingCompiler)(l['foo']) + foo() + cres = foo.overloads[foo.signatures[0]] + self.assertFalse(cres.metadata['mutation_results'][LiteralUnroll]) + + def test_literal_unroll_globals_and_locals(self): + f = """def foo():\n\tfor x in literal_unroll((1,)):\n\t\tpass""" + l = {} + exec(f, {}, l) + foo = njit(pipeline_class=CapturingCompiler)(l['foo']) + with self.assertRaises(errors.TypingError) as raises: + foo() + self.assertIn("Untyped global name 'literal_unroll'", + str(raises.exception)) + + # same as above but now add literal_unroll to globals + l = {} + exec(f, {'literal_unroll': literal_unroll}, l) + foo = njit(pipeline_class=CapturingCompiler)(l['foo']) + foo() + cres = foo.overloads[foo.signatures[0]] + self.assertTrue(cres.metadata['mutation_results'][LiteralUnroll]) + + # same as above, but now with import + from textwrap import dedent + f = """ + def gen(): + from numba import literal_unroll + def foo(): + for x in literal_unroll((1,)): + pass + return foo + bar = gen() + """ + l = {} + exec(dedent(f), {}, l) + foo = njit(pipeline_class=CapturingCompiler)(l['bar']) + foo() + cres = foo.overloads[foo.signatures[0]] + self.assertTrue(cres.metadata['mutation_results'][LiteralUnroll]) + + # same as above, but now with import as something else + from textwrap import dedent + f = """ + def gen(): + from numba import literal_unroll as something_else + def foo(): + for x in something_else((1,)): + pass + return foo + bar = gen() + """ + l = {} + exec(dedent(f), {}, l) + foo = njit(pipeline_class=CapturingCompiler)(l['bar']) + foo() + cres = foo.overloads[foo.signatures[0]] + self.assertTrue(cres.metadata['mutation_results'][LiteralUnroll]) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_moved_modules.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_moved_modules.py new file mode 100644 index 0000000000000000000000000000000000000000..4ccaa06c9a4d4b7b81d291681ebb382fdd8769be --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_moved_modules.py @@ -0,0 +1,30 @@ +"""Tests for moved modules and their redirection from old path +""" +from numba.tests.support import TestCase + + +class TestMovedModule(TestCase): + """Testing moved modules in Q1 2020 but were decided to kept as public API + """ + def tests_numba_types(self): + import numba.types + import numba.core.types as types + # The old module IS NOT the new module + self.assertIsNot(numba.types, types) + # Attribute access are there + self.assertIs(numba.types.intp, types.intp) + self.assertIs(numba.types.float64, types.float64) + self.assertIs(numba.types.Array, types.Array) + # Submodule access through old import path is possible + import numba.types.misc + self.assertIs(types.misc, numba.types.misc) + self.assertIs(types.misc.Optional, numba.types.misc.Optional) + # Import time code could be executed twice and causes the following to + # fail. + self.assertIs(types.StringLiteral, numba.types.misc.StringLiteral) + # Check numba.types.container + from numba.types import containers + self.assertIs(types.containers, containers) + self.assertIs(types.containers.Sequence, containers.Sequence) + from numba.types.containers import Sequence + self.assertIs(Sequence, containers.Sequence) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_multi3.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_multi3.py new file mode 100644 index 0000000000000000000000000000000000000000..018637922ac9dfc54a3b76ce1212df183c724d75 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_multi3.py @@ -0,0 +1,43 @@ +import random + +import numpy as np + +from numba import njit +from numba.core import types +import unittest + +class TestMulti3(unittest.TestCase): + """ + This test is only relevant for 32-bit architectures. + + Test __multi3 implementation in _helperlib.c. + The symbol defines a i128 multiplication. + It is necessary for working around an issue in LLVM (see issue #969). + The symbol does not exist in 32-bit platform, and should not be used by + LLVM. However, optimization passes will create i65 multiplication that + is then lowered to __multi3. + """ + def test_multi3(self): + @njit("(int64,)") + def func(x): + res = 0 + for i in range(x): + res += i + return res + + x_cases = [-1, 0, 1, 3, 4, 8, + 0xffffffff - 1, 0xffffffff, 0xffffffff + 1, + 0x123456789abcdef, -0x123456789abcdef] + for _ in range(500): + x_cases.append(random.randint(0, 0xffffffff)) + + def expected(x): + if x <= 0: return 0 + return ((x * (x - 1)) // 2) & (2**64 - 1) + + for x in x_cases: + self.assertEqual(expected(x), func(x)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nan.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nan.py new file mode 100644 index 0000000000000000000000000000000000000000..a38a486c1a635b20ff3e2ead149ce8b2f9786b12 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nan.py @@ -0,0 +1,37 @@ +import unittest +from numba import jit +from numba.core import types + +enable_pyobj_flags = {'forceobj': True} +no_pyobj_flags = {'nopython': True} + + +def isnan(x): + return x != x + + +def isequal(x): + return x == x + + +class TestNaN(unittest.TestCase): + + def test_nans(self, flags=enable_pyobj_flags): + pyfunc = isnan + cfunc = jit((types.float64,), **flags)(pyfunc) + + self.assertTrue(cfunc(float('nan'))) + self.assertFalse(cfunc(1.0)) + + pyfunc = isequal + cfunc = jit((types.float64,), **flags)(pyfunc) + + self.assertFalse(cfunc(float('nan'))) + self.assertTrue(cfunc(1.0)) + + def test_nans_npm(self): + self.test_nans(flags=no_pyobj_flags) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ndarray_subclasses.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ndarray_subclasses.py new file mode 100644 index 0000000000000000000000000000000000000000..944d314e7112024ff7bb22022d040847a1162c2f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ndarray_subclasses.py @@ -0,0 +1,346 @@ +""" +Test NumPy Subclassing features +""" + +import builtins +import unittest +from numbers import Number +from functools import wraps + +import numpy as np +from llvmlite import ir + +import numba +from numba import njit, typeof, objmode +from numba.core import cgutils, types, typing +from numba.core.pythonapi import box +from numba.core.errors import TypingError +from numba.core.registry import cpu_target +from numba.extending import (intrinsic, lower_builtin, overload_classmethod, + register_model, type_callable, typeof_impl, + register_jitable) +from numba.np import numpy_support + +from numba.tests.support import TestCase, MemoryLeakMixin + +# A quick util to allow logging within jit code + +_logger = None + + +def _do_log(*args): + if _logger is not None: + _logger.append(args) + + +@register_jitable +def log(*args): + with objmode(): + _do_log(*args) + + +def use_logger(fn): + @wraps(fn) + def core(*args, **kwargs): + global _logger + _logger = [] + return fn(*args, **kwargs) + return core + + +class MyArray(np.ndarray): + # Tell Numba to not seamlessly treat this type as a regular ndarray. + __numba_array_subtype_dispatch__ = True + + # __array__ is not needed given that this is a ndarray subclass + # + # def __array__(self, dtype=None): + # return self + + # Interoperate with NumPy outside of Numba. + def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): + if method == "__call__": + N = None + scalars = [] + for inp in inputs: + if isinstance(inp, Number): + scalars.append(inp) + elif isinstance(inp, (type(self), np.ndarray)): + if isinstance(inp, type(self)): + scalars.append(np.ndarray(inp.shape, inp.dtype, inp)) + else: + scalars.append(inp) + if N is not None: + if N != inp.shape: + raise TypeError("inconsistent sizes") + else: + N = inp.shape + else: + return NotImplemented + ret = ufunc(*scalars, **kwargs) + return self.__class__(ret.shape, ret.dtype, ret) + else: + return NotImplemented + + +class MyArrayType(types.Array): + def __init__(self, dtype, ndim, layout, readonly=False, aligned=True): + name = f"MyArray({ndim}, {dtype}, {layout})" + super().__init__(dtype, ndim, layout, readonly=readonly, + aligned=aligned, name=name) + + def copy(self, *args, **kwargs): + # This is here to future-proof. + # The test here never uses this. + raise NotImplementedError + + # Tell Numba typing how to combine MyArrayType with other ndarray types. + def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): + if method == "__call__": + for inp in inputs: + if not isinstance(inp, (types.Array, types.Number)): + return NotImplemented + # Ban if all arguments are MyArrayType + if all(isinstance(inp, MyArrayType) for inp in inputs): + return NotImplemented + return MyArrayType + else: + return NotImplemented + + @property + def box_type(self): + return MyArray + + +@typeof_impl.register(MyArray) +def typeof_ta_ndarray(val, c): + try: + dtype = numpy_support.from_dtype(val.dtype) + except NotImplementedError: + raise ValueError("Unsupported array dtype: %s" % (val.dtype,)) + layout = numpy_support.map_layout(val) + readonly = not val.flags.writeable + return MyArrayType(dtype, val.ndim, layout, readonly=readonly) + + +@register_model(MyArrayType) +class MyArrayTypeModel(numba.core.datamodel.models.StructModel): + def __init__(self, dmm, fe_type): + ndim = fe_type.ndim + members = [ + ('meminfo', types.MemInfoPointer(fe_type.dtype)), + ('parent', types.pyobject), + ('nitems', types.intp), + ('itemsize', types.intp), + ('data', types.CPointer(fe_type.dtype)), + ('shape', types.UniTuple(types.intp, ndim)), + ('strides', types.UniTuple(types.intp, ndim)), + ('extra_field', types.intp), + ] + super(MyArrayTypeModel, self).__init__(dmm, fe_type, members) + + +@type_callable(MyArray) +def type_myarray(context): + def typer(shape, dtype, buf): + out = MyArrayType( + dtype=buf.dtype, ndim=len(shape), layout=buf.layout + ) + return out + + return typer + + +@lower_builtin(MyArray, types.UniTuple, types.DType, types.Array) +def impl_myarray(context, builder, sig, args): + from numba.np.arrayobj import make_array, populate_array + + srcaryty = sig.args[-1] + shape, dtype, buf = args + + srcary = make_array(srcaryty)(context, builder, value=buf) + # Copy source array and remove the parent field to avoid boxer re-using + # the original ndarray instance. + retary = make_array(sig.return_type)(context, builder) + populate_array(retary, + data=srcary.data, + shape=srcary.shape, + strides=srcary.strides, + itemsize=srcary.itemsize, + meminfo=srcary.meminfo) + + ret = retary._getvalue() + context.nrt.incref(builder, sig.return_type, ret) + return ret + + +@box(MyArrayType) +def box_array(typ, val, c): + assert c.context.enable_nrt + np_dtype = numpy_support.as_dtype(typ.dtype) + dtypeptr = c.env_manager.read_const(c.env_manager.add_const(np_dtype)) + newary = c.pyapi.nrt_adapt_ndarray_to_python(typ, val, dtypeptr) + # Steals NRT ref + c.context.nrt.decref(c.builder, typ, val) + return newary + + +@overload_classmethod(MyArrayType, "_allocate") +def _ol_array_allocate(cls, allocsize, align): + """Implements a Numba-only classmethod on the array type. + """ + def impl(cls, allocsize, align): + log("LOG _ol_array_allocate", allocsize, align) + return allocator_MyArray(allocsize, align) + + return impl + + +@intrinsic +def allocator_MyArray(typingctx, allocsize, align): + def impl(context, builder, sig, args): + context.nrt._require_nrt() + size, align = args + + mod = builder.module + u32 = ir.IntType(32) + voidptr = cgutils.voidptr_t + + get_alloc_fnty = ir.FunctionType(voidptr, ()) + get_alloc_fn = cgutils.get_or_insert_function( + mod, get_alloc_fnty, name="_nrt_get_sample_external_allocator" + ) + ext_alloc = builder.call(get_alloc_fn, ()) + + fnty = ir.FunctionType(voidptr, [cgutils.intp_t, u32, voidptr]) + fn = cgutils.get_or_insert_function( + mod, fnty, name="NRT_MemInfo_alloc_safe_aligned_external" + ) + fn.return_value.add_attribute("noalias") + if isinstance(align, builtins.int): + align = context.get_constant(types.uint32, align) + else: + assert align.type == u32, "align must be a uint32" + call = builder.call(fn, [size, align, ext_alloc]) + call.name = "allocate_MyArray" + return call + + mip = types.MemInfoPointer(types.voidptr) # return untyped pointer + sig = typing.signature(mip, allocsize, align) + return sig, impl + + +class TestNdarraySubclasses(MemoryLeakMixin, TestCase): + + def test_myarray_return(self): + """This tests the path to `MyArrayType.box_type` + """ + @njit + def foo(a): + return a + 1 + + buf = np.arange(4) + a = MyArray(buf.shape, buf.dtype, buf) + expected = foo.py_func(a) + got = foo(a) + self.assertIsInstance(got, MyArray) + self.assertIs(type(expected), type(got)) + self.assertPreciseEqual(expected, got) + + def test_myarray_passthru(self): + @njit + def foo(a): + return a + + buf = np.arange(4) + a = MyArray(buf.shape, buf.dtype, buf) + expected = foo.py_func(a) + got = foo(a) + self.assertIsInstance(got, MyArray) + self.assertIs(type(expected), type(got)) + self.assertPreciseEqual(expected, got) + + def test_myarray_convert(self): + @njit + def foo(buf): + return MyArray(buf.shape, buf.dtype, buf) + + buf = np.arange(4) + expected = foo.py_func(buf) + got = foo(buf) + self.assertIsInstance(got, MyArray) + self.assertIs(type(expected), type(got)) + self.assertPreciseEqual(expected, got) + + def test_myarray_asarray_non_jit(self): + def foo(buf): + converted = MyArray(buf.shape, buf.dtype, buf) + return np.asarray(converted) + buf + + buf = np.arange(4) + got = foo(buf) + self.assertIs(type(got), np.ndarray) + self.assertPreciseEqual(got, buf + buf) + + @unittest.expectedFailure + def test_myarray_asarray(self): + self.disable_leak_check() + + @njit + def foo(buf): + converted = MyArray(buf.shape, buf.dtype, buf) + return np.asarray(converted) + + buf = np.arange(4) + got = foo(buf) + # the following fails because our np.asarray is returning the source + # array type + self.assertIs(type(got), np.ndarray) + + def test_myarray_ufunc_unsupported(self): + @njit + def foo(buf): + converted = MyArray(buf.shape, buf.dtype, buf) + return converted + converted + + buf = np.arange(4, dtype=np.float32) + with self.assertRaises(TypingError) as raises: + foo(buf) + + msg = ("No implementation of function", + "add(MyArray(1, float32, C), MyArray(1, float32, C))") + for m in msg: + self.assertIn(m, str(raises.exception)) + + @use_logger + def test_myarray_allocator_override(self): + """ + Checks that our custom allocator is used + """ + @njit + def foo(a): + b = a + np.arange(a.size, dtype=np.float64) + c = a + 1j + return b, c + + buf = np.arange(4, dtype=np.float64) + a = MyArray(buf.shape, buf.dtype, buf) + + expected = foo.py_func(a) + got = foo(a) + + self.assertPreciseEqual(got, expected) + + logged_lines = _logger + + targetctx = cpu_target.target_context + nb_dtype = typeof(buf.dtype) + align = targetctx.get_preferred_array_alignment(nb_dtype) + self.assertEqual(logged_lines, [ + ("LOG _ol_array_allocate", expected[0].nbytes, align), + ("LOG _ol_array_allocate", expected[1].nbytes, align), + ]) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nested_calls.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nested_calls.py new file mode 100644 index 0000000000000000000000000000000000000000..679bc4af98680e389fc911f544c18b103b468bbe --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nested_calls.py @@ -0,0 +1,153 @@ +""" +Test problems in nested calls. +Usually due to invalid type conversion between function boundaries. +""" + + +from numba import int32, int64 +from numba import jit +from numba.core import types +from numba.extending import overload +from numba.tests.support import TestCase, tag +import unittest + + +@jit(nopython=True) +def f_inner(a, b, c): + return a, b, c + +def f(x, y, z): + return f_inner(x, c=y, b=z) + +@jit(nopython=True) +def g_inner(a, b=2, c=3): + return a, b, c + +def g(x, y, z): + return g_inner(x, b=y), g_inner(a=z, c=x) + +@jit(nopython=True) +def star_inner(a=5, *b): + return a, b + +def star(x, y, z): + return star_inner(a=x), star_inner(x, y, z) + +def star_call(x, y, z): + return star_inner(x, *y), star_inner(*z) + +@jit(nopython=True) +def argcast_inner(a, b): + if b: + # Here `a` is unified to int64 (from int32 originally) + a = int64(0) + return a + +def argcast(a, b): + return argcast_inner(int32(a), b) + + +def generated_inner(x, y=5, z=6): + assert 0, "unreachable" + + +@overload(generated_inner) +def ol_generated_inner(x, y=5, z=6): + if isinstance(x, types.Complex): + def impl(x, y=5, z=6): + return x + y, z + else: + def impl(x, y=5, z=6): + return x - y, z + return impl + + +def call_generated(a, b): + return generated_inner(a, z=b) + + +class TestNestedCall(TestCase): + + def compile_func(self, pyfunc, objmode=False): + def check(*args, **kwargs): + expected = pyfunc(*args, **kwargs) + result = f(*args, **kwargs) + self.assertPreciseEqual(result, expected) + flags = dict(forceobj=True) if objmode else dict(nopython=True) + f = jit(**flags)(pyfunc) + return f, check + + def test_boolean_return(self): + @jit(nopython=True) + def inner(x): + return not x + + @jit(nopython=True) + def outer(x): + if inner(x): + return True + else: + return False + + self.assertFalse(outer(True)) + self.assertTrue(outer(False)) + + def test_named_args(self, objmode=False): + """ + Test a nested function call with named (keyword) arguments. + """ + cfunc, check = self.compile_func(f, objmode) + check(1, 2, 3) + check(1, y=2, z=3) + + def test_named_args_objmode(self): + self.test_named_args(objmode=True) + + def test_default_args(self, objmode=False): + """ + Test a nested function call using default argument values. + """ + cfunc, check = self.compile_func(g, objmode) + check(1, 2, 3) + check(1, y=2, z=3) + + def test_default_args_objmode(self): + self.test_default_args(objmode=True) + + def test_star_args(self): + """ + Test a nested function call to a function with *args in its signature. + """ + cfunc, check = self.compile_func(star) + check(1, 2, 3) + + def test_star_call(self, objmode=False): + """ + Test a function call with a *args. + """ + cfunc, check = self.compile_func(star_call, objmode) + check(1, (2,), (3,)) + + def test_star_call_objmode(self): + self.test_star_call(objmode=True) + + def test_argcast(self): + """ + Issue #1488: implicitly casting an argument variable should not + break nested calls. + """ + cfunc, check = self.compile_func(argcast) + check(1, 0) + check(1, 1) + + def test_call_generated(self): + """ + Test a nested function call to a generated jit function. + """ + cfunc = jit(nopython=True)(call_generated) + self.assertPreciseEqual(cfunc(1, 2), (-4, 2)) + self.assertPreciseEqual(cfunc(1j, 2), (1j + 5, 2)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_new_type_system.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_new_type_system.py new file mode 100644 index 0000000000000000000000000000000000000000..fe1a198b9514b8742076e2ac9fa83b49946ac6d1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_new_type_system.py @@ -0,0 +1,37 @@ +import numpy as np + +from numba import njit, config +from numba.tests.support import TestCase + + +class TestTypes(TestCase): + + def setUp(self) -> None: + if config.USE_LEGACY_TYPE_SYSTEM: + self.skipTest("This test is only for the new type system") + return super().setUp() + + def test_return_types(self): + @njit + def foo(x): + return x + + cases = [ + # Python types + 1, + 1.2, + (1 + 2j), + True, + # NumPy types + np.int32(1), + np.float64(1.2), + np.complex64(1 + 2j), + np.complex128(1 + 2j), + np.bool_(True), + np.datetime64('2020-01-01'), + np.timedelta64(1, 'D'), + ] + + for case in cases: + self.assertEqual(foo(case), case) + self.assertEqual(type(foo(case)), type(case)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_np_functions.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_np_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..6f95735348ffbbe7d79e1d888264abc1ac1aed89 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_np_functions.py @@ -0,0 +1,6875 @@ +# Tests numpy methods of + +import itertools +import math +import platform +from functools import partial +from itertools import product +from textwrap import dedent + +import numpy as np + +from numba import jit, njit, typeof +from numba.core import types +from numba.typed import List, Dict +from numba.np.numpy_support import numpy_version +from numba.core.errors import TypingError +from numba.core.config import IS_32BITS +from numba.core.utils import pysignature +from numba.np.extensions import cross2d +from numba.tests.support import (TestCase, MemoryLeakMixin, + needs_blas, run_in_subprocess, + skip_if_numpy_2, IS_NUMPY_2, + IS_MACOS_ARM64) +import unittest + + +def sinc(x): + return np.sinc(x) + + +def angle1(x): + return np.angle(x) + + +def angle2(x, deg): + return np.angle(x, deg) + + +def array_equal(a, b): + return np.array_equal(a, b) + + +def intersect1d_2(a, b): + return np.intersect1d(a, b) + + +def intersect1d_3(a, b, assume_unique=False): + return np.intersect1d(a, b, assume_unique) + + +def append(arr, values, axis): + return np.append(arr, values, axis=axis) + + +def count_nonzero(arr, axis): + return np.count_nonzero(arr, axis=axis) + + +def delete(arr, obj): + return np.delete(arr, obj) + + +def diff1(a): + return np.diff(a) + + +def diff2(a, n): + return np.diff(a, n) + + +def bincount1(a): + return np.bincount(a) + + +def bincount2(a, w): + return np.bincount(a, weights=w) + + +def bincount3(a, w=None, minlength=0): + return np.bincount(a, w, minlength) + + +def searchsorted(a, v): + return np.searchsorted(a, v) + + +def searchsorted_left(a, v): + return np.searchsorted(a, v, side='left') + + +def searchsorted_right(a, v): + return np.searchsorted(a, v, side='right') + + +def digitize(*args): + return np.digitize(*args) + + +def histogram(*args): + return np.histogram(*args) + + +def machar(*args): + return np.MachAr() + + +def iscomplex(x): + return np.iscomplex(x) + + +def iscomplexobj(x): + return np.iscomplexobj(x) + + +def isscalar(x): + return np.isscalar(x) + + +def isreal(x): + return np.isreal(x) + + +def isrealobj(x): + return np.isrealobj(x) + + +def isneginf(x, out=None): + return np.isneginf(x, out) + + +def isposinf(x, out=None): + return np.isposinf(x, out) + + +def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + return np.isclose(a, b, rtol, atol, equal_nan) + + +def isnat(x): + return np.isnat(x) + + +def iinfo(*args): + return np.iinfo(*args) + + +def finfo(*args): + return np.finfo(*args) + + +def finfo_machar(*args): + return np.finfo(*args).machar + + +def fliplr(a): + return np.fliplr(a) + + +def flipud(a): + return np.flipud(a) + + +def flip(a): + return np.flip(a) + + +def logspace2(start, stop): + return np.logspace(start, stop) + + +def logspace3(start, stop, num=50): + return np.logspace(start, stop, num=num) + + +def geomspace2(start, stop): + return np.geomspace(start, stop) + + +def geomspace3(start, stop, num=50): + return np.geomspace(start, stop, num=num) + + +def rot90(a): + return np.rot90(a) + + +def rot90_k(a, k=1): + return np.rot90(a, k) + + +def array_split(a, indices, axis=0): + return np.array_split(a, indices, axis=axis) + + +def split(a, indices, axis=0): + return np.split(a, indices, axis=axis) + + +def vsplit(a, ind_or_sec): + return np.vsplit(a, ind_or_sec) + + +def hsplit(a, ind_or_sec): + return np.hsplit(a, ind_or_sec) + + +def dsplit(a, ind_or_sec): + return np.dsplit(a, ind_or_sec) + + +def correlate(a, v, mode="valid"): + return np.correlate(a, v, mode=mode) + + +def convolve(a, v, mode="full"): + return np.convolve(a, v, mode=mode) + + +def tri_n(N): + return np.tri(N) + + +def tri_n_m(N, M=None): + return np.tri(N, M) + + +def tri_n_k(N, k=0): + return np.tri(N, k) + + +def tri_n_m_k(N, M=None, k=0): + return np.tri(N, M, k) + + +def tril_m(m): + return np.tril(m) + + +def tril_m_k(m, k=0): + return np.tril(m, k) + + +def tril_indices_n(n): + return np.tril_indices(n) + + +def tril_indices_n_k(n, k=0): + return np.tril_indices(n, k) + + +def tril_indices_n_m(n, m=None): + return np.tril_indices(n, m=m) + + +def tril_indices_n_k_m(n, k=0, m=None): + return np.tril_indices(n, k, m) + + +def tril_indices_from_arr(arr): + return np.tril_indices_from(arr) + + +def tril_indices_from_arr_k(arr, k=0): + return np.tril_indices_from(arr, k) + + +def triu_m(m): + return np.triu(m) + + +def triu_m_k(m, k=0): + return np.triu(m, k) + + +def triu_indices_n(n): + return np.triu_indices(n) + + +def triu_indices_n_k(n, k=0): + return np.triu_indices(n, k) + + +def triu_indices_n_m(n, m=None): + return np.triu_indices(n, m=m) + + +def triu_indices_n_k_m(n, k=0, m=None): + return np.triu_indices(n, k, m) + + +def triu_indices_from_arr(arr): + return np.triu_indices_from(arr) + + +def triu_indices_from_arr_k(arr, k=0): + return np.triu_indices_from(arr, k) + + +def vander(x, N=None, increasing=False): + return np.vander(x, N, increasing) + + +def partition(a, kth): + return np.partition(a, kth) + + +def argpartition(a, kth): + return np.argpartition(a, kth) + + +def cov(m, y=None, rowvar=True, bias=False, ddof=None): + return np.cov(m, y, rowvar, bias, ddof) + + +def corrcoef(x, y=None, rowvar=True): + return np.corrcoef(x, y, rowvar) + + +def ediff1d(ary, to_end=None, to_begin=None): + return np.ediff1d(ary, to_end, to_begin) + + +def roll(a, shift): + return np.roll(a, shift) + + +def asarray(a): + return np.asarray(a) + + +def asarray_kws(a, dtype): + return np.asarray(a, dtype=dtype) + + +def asfarray(a, dtype=np.float64): + return np.asfarray(a, dtype=dtype) + + +def asfarray_default_kwarg(a): + return np.asfarray(a) + + +def extract(condition, arr): + return np.extract(condition, arr) + + +def np_trapz(y): + return np.trapz(y) + + +def np_trapz_x(y, x): + return np.trapz(y, x) + + +def np_trapz_dx(y, dx): + return np.trapz(y, dx=dx) + + +def np_trapz_x_dx(y, x, dx): + return np.trapz(y, x, dx) + + +def np_trapezoid(y): + return np.trapezoid(y) + + +def np_trapezoid_x(y, x): + return np.trapezoid(y, x) + + +def np_trapezoid_dx(y, dx): + return np.trapezoid(y, dx=dx) + + +def np_trapezoid_x_dx(y, x, dx): + return np.trapezoid(y, x, dx) + + +def np_allclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): + return np.allclose(a, b, rtol, atol, equal_nan) + + +def np_average(a, axis=None, weights=None): + return np.average(a, axis=axis, weights=weights) + + +def interp(x, xp, fp): + return np.interp(x, xp, fp) + + +def np_repeat(a, repeats): + return np.repeat(a, repeats) + + +def array_repeat(a, repeats): + return np.asarray(a).repeat(repeats) + + +def np_select(condlist, choicelist, default=0): + return np.select(condlist, choicelist, default=default) + + +def np_select_defaults(condlist, choicelist): + return np.select(condlist, choicelist) + + +def np_bartlett(M): + return np.bartlett(M) + + +def np_blackman(M): + return np.blackman(M) + + +def np_hamming(M): + return np.hamming(M) + + +def np_hanning(M): + return np.hanning(M) + + +def np_kaiser(M, beta): + return np.kaiser(M, beta) + + +def np_cross(a, b): + return np.cross(a, b) + + +def np_trim_zeros(a, trim='fb'): + return np.trim_zeros(a, trim) + + +def nb_cross2d(a, b): + return cross2d(a, b) + + +def flip_lr(a): + return np.fliplr(a) + + +def flip_ud(a): + return np.flipud(a) + + +def np_union1d(a, b): + return np.union1d(a,b) + + +def np_asarray_chkfinite(a, dtype=None): + return np.asarray_chkfinite(a, dtype) + + +def unwrap(p, discont=None, axis=-1, period=6.283185307179586): + return np.unwrap(p, discont, axis, period=period) + + +def unwrap1(p): + return np.unwrap(p) + + +def unwrap13(p, period): + return np.unwrap(p, period=period) + + +def unwrap123(p, period, discont): + return np.unwrap(p, period=period, discont=discont) + + +def array_contains(a, key): + return key in a + + +def swapaxes(a, a1, a2): + return np.swapaxes(a, a1, a2) + + +def nan_to_num(X, copy=True, nan=0.0): + return np.nan_to_num(X, copy=copy, nan=nan) + + +def np_indices(dimensions): + return np.indices(dimensions) + + +def diagflat1(v): + return np.diagflat(v) + + +def diagflat2(v, k=0): + return np.diagflat(v, k) + + +def np_setxor1d_2(a, b): + return np.setxor1d(a, b) + + +def np_setxor1d_3(a, b, assume_unique=False): + return np.setxor1d(a, b, assume_unique) + + +def np_setdiff1d_2(a, b): + return np.setdiff1d(a, b) + + +def np_setdiff1d_3(a, b, assume_unique=False): + return np.setdiff1d(a, b, assume_unique) + + +def np_in1d_2(a, b): + return np.in1d(a, b) + + +def np_in1d_3a(a, b, assume_unique=False): + return np.in1d(a, b, assume_unique=assume_unique) + + +def np_in1d_3b(a, b, invert=False): + return np.in1d(a, b, invert=invert) + + +def np_in1d_4(a, b, assume_unique=False, invert=False): + return np.in1d(a, b, assume_unique, invert) + + +def np_isin_2(a, b): + return np.isin(a, b) + + +def np_isin_3a(a, b, assume_unique=False): + return np.isin(a, b, assume_unique=assume_unique) + + +def np_isin_3b(a, b, invert=False): + return np.isin(a, b, invert=invert) + + +def np_isin_4(a, b, assume_unique=False, invert=False): + return np.isin(a, b, assume_unique, invert) + + +class TestNPFunctions(MemoryLeakMixin, TestCase): + """ + Tests for various Numpy functions. + """ + + def setUp(self): + super(TestNPFunctions, self).setUp() + self.rnd = np.random.RandomState(42) + + def run_unary(self, pyfunc, x_types, x_values, func_extra_types=None, + func_extra_args=None, ignore_sign_on_zero=False, abs_tol=None, + **kwargs): + """ + Runs tests for a unary function operating in the numerical real space. + + Parameters + ---------- + pyfunc : a python function definition holding that calls the numpy + functions to be tested. + x_types: the types of the values being tested, see numba.types + x_values: the numerical values of the values to be tested + func_extra_types: the types of additional arguments to the numpy + function + func_extra_args: additional arguments to the numpy function + ignore_sign_on_zero: boolean as to whether to allow zero values + with incorrect signs to be considered equal + prec: the required precision match, see assertPreciseEqual + + Notes: + ------ + x_types and x_values must have the same length + + """ + for tx, vx in zip(x_types, x_values): + if func_extra_args is None: + func_extra_types = func_extra_args = [()] + for xtypes, xargs in zip(func_extra_types, func_extra_args): + cfunc = njit((tx,) + xtypes,)(pyfunc) + got = cfunc(vx, *xargs) + expected = pyfunc(vx, *xargs) + try: + scalty = tx.dtype + except AttributeError: + scalty = tx + prec = ('single' + if scalty in (types.float32, types.complex64) + else 'double') + msg = 'for input %r with prec %r' % (vx, prec) + self.assertPreciseEqual(got, expected, + prec=prec, + msg=msg, + ignore_sign_on_zero=ignore_sign_on_zero, + abs_tol=abs_tol, **kwargs) + + def test_sinc(self): + """ + Tests the sinc() function. + This test is purely to assert numerical computations are correct. + """ + + # Ignore sign of zeros, this will need masking depending on numpy + # version once the fix to numpy complex division is in upstream + # See: https://github.com/numpy/numpy/pull/6699 + isoz = True + + # Testing sinc(1.) leads to sin(pi)/pi, which is below machine + # precision in practice on most machines. Small floating point + # differences in sin() etc. may lead to large differences in the result + # that are at a range that is inaccessible using standard width + # floating point representations. + # e.g. Assume float64 type. + # sin(pi) ~= 1e-16, but should be zero + # sin(pi)/pi ~= 1e-17, should be zero, error carried from above + # float64 has log10(2^53)~=15.9 digits of precision and the magnitude + # change in the alg is > 16 digits (1.0...0 -> 0.0...0), + # so comparison via ULP is invalid. + # We therefore opt to assume that values under machine precision are + # equal in this case. + tol = "eps" + + pyfunc = sinc + + def check(x_types, x_values, **kwargs): + self.run_unary(pyfunc, x_types, x_values, + ignore_sign_on_zero=isoz, abs_tol=tol, + **kwargs) + + # real domain scalar context + x_values = [1., -1., 0.0, -0.0, 0.5, -0.5, 5, -5, 5e-21, -5e-21] + x_types = [types.float32, types.float64] * (len(x_values) // 2) + check(x_types, x_values) + + # real domain vector context + x_values = [np.array(x_values, dtype=np.float64)] + x_types = [typeof(v) for v in x_values] + check(x_types, x_values) + + # complex domain scalar context + x_values = [1.+0j, -1+0j, 0.0+0.0j, -0.0+0.0j, 0+1j, 0-1j, 0.5+0.0j, # noqa + -0.5+0.0j, 0.5+0.5j, -0.5-0.5j, 5+5j, -5-5j, # noqa + # the following are to test sin(x)/x for small x + 5e-21+0j, -5e-21+0j, 5e-21j, +(0-5e-21j) # noqa + ] + x_types = [types.complex64, types.complex128] * (len(x_values) // 2) + check(x_types, x_values, ulps=2) + + # complex domain vector context + x_values = [np.array(x_values, dtype=np.complex128)] + x_types = [typeof(v) for v in x_values] + check(x_types, x_values, ulps=2) + + def test_sinc_exceptions(self): + pyfunc = sinc + cfunc = jit(nopython=True)(pyfunc) + + with self.assertRaises(TypingError) as raises: + cfunc('str') + self.assertIn('Argument "x" must be a Number or array-like', + str(raises.exception)) + # Exceptions leak references + self.disable_leak_check() + + def test_contains(self): + def arrs(): + a_0 = np.arange(10, 50) + k_0 = 20 + + yield a_0, k_0 + + a_1 = np.arange(6) + k_1 = 10 + + yield a_1, k_1 + + single_val_a = np.asarray([20]) + k_in = 20 + k_out = 13 + + yield single_val_a, k_in + yield single_val_a, k_out + + empty_arr = np.asarray([]) + yield empty_arr, k_out + + # np scalars + + bool_arr = np.array([True, False]) + yield bool_arr, True + yield bool_arr, k_0 + + np.random.seed(2) + float_arr = np.random.rand(10) + np.random.seed(2) + rand_k = np.random.rand() + present_k = float_arr[0] + + yield float_arr, rand_k + yield float_arr, present_k + + complx_arr = float_arr.view(np.complex128) + yield complx_arr, complx_arr[0] + yield complx_arr, rand_k + + np.random.seed(2) + uint_arr = np.random.randint(10, size=15, dtype=np.uint8) + yield uint_arr, 5 + yield uint_arr, 25 + + pyfunc = array_contains + + cfunc = jit(nopython=True)(pyfunc) + + for arr, key in arrs(): + expected = pyfunc(arr, key) + received = cfunc(arr, key) + + self.assertPreciseEqual(expected, received) + + def test_angle(self): + """ + Tests the angle() function. + This test is purely to assert numerical computations are correct. + """ + pyfunc1 = angle1 + pyfunc2 = angle2 + + def check(x_types, x_values): + # angle(x) + self.run_unary(pyfunc1, x_types, x_values) + # angle(x, deg) + xtra_values = [(True,), (False,)] + xtra_types = [(types.bool_,)] * len(xtra_values) + self.run_unary(pyfunc2, x_types, x_values, + func_extra_types=xtra_types, + func_extra_args=xtra_values,) + + # real domain scalar context + x_values = [1., -1., 0.0, -0.0, 0.5, -0.5, 5, -5] + x_types = [types.float32, types.float64] * (len(x_values) // 2 + 1) + check(x_types, x_values) + + # real domain vector context + x_values = [np.array(x_values, dtype=np.float64)] + x_types = [typeof(v) for v in x_values] + check(x_types, x_values) + + # complex domain scalar context + x_values = [1.+0j, -1+0j, 0.0+0.0j, -0.0+0.0j, 1j, -1j, 0.5+0.0j, # noqa + -0.5+0.0j, 0.5+0.5j, -0.5-0.5j, 5+5j, -5-5j] # noqa + x_types = [types.complex64, types.complex128] * (len(x_values) // 2 + 1) + check(x_types, x_values) + + # complex domain vector context + x_values = np.array(x_values) + x_types = [types.complex64, types.complex128] + check(x_types, x_values) + + def test_angle_return_type(self): + # see issue #8949 + def numba_angle(x): + r = np.angle(x) + return r.dtype + + pyfunc = numba_angle + x_values = [1., -1., 1. + 0j, -5 - 5j] + x_types = ['f4', 'f8', 'c8', 'c16'] + for val, typ in zip(x_values, x_types): + x = np.array([val], dtype=typ) + cfunc = jit(nopython=True)(pyfunc) + expected = pyfunc(x) + got = cfunc(x) + self.assertEqual(expected, got) + + def test_angle_exceptions(self): + pyfunc = angle1 + cfunc = jit(nopython=True)(pyfunc) + + with self.assertRaises(TypingError) as raises: + cfunc('hello') + self.assertIn('Argument "z" must be a complex or Array[complex]', + str(raises.exception)) + # Exceptions leak references + self.disable_leak_check() + + def test_array_equal(self): + def arrays(): + yield np.array([]), np.array([]) + yield np.array([1, 2]), np.array([1, 2]) + yield np.array([]), np.array([1]) + x = np.arange(10).reshape(5, 2) + x[1][1] = 30 + yield np.arange(10).reshape(5, 2), x + yield x, x + yield (1, 2, 3), (1, 2, 3) + yield 2, 2 + yield 3, 2 + yield True, True + yield True, False + yield True, 2 + yield True, 1 + yield False, 0 + + pyfunc = array_equal + cfunc = jit(nopython=True)(pyfunc) + + for arr, obj in arrays(): + expected = pyfunc(arr, obj) + got = cfunc(arr, obj) + self.assertPreciseEqual(expected, got) + + def test_array_equal_exception(self): + pyfunc = array_equal + cfunc = jit(nopython=True)(pyfunc) + + with self.assertRaises(TypingError) as raises: + cfunc(np.arange(3 * 4).reshape(3, 4), None) + self.assertIn( + 'Both arguments to "array_equals" must be array-like', + str(raises.exception) + ) + + def test_intersect1d_2(self): + + def arrays(): + yield (List.empty_list(types.float64), + List.empty_list(types.float64)) # two empty arrays + yield [1], List.empty_list(types.float64) # empty right + yield List.empty_list(types.float64), [1] # empty left + yield [1], [2] # singletons no intersection + yield [1], [1] # singletons one intersection + yield [1, 2], [1] + yield [1, 2, 2], [2, 2] + yield [1, 2], [2, 1] + yield [1, 2, 3], [1, 2, 3] + # from numpy: + # https://github.com/numpy/numpy/blob/b0371ef240560e78b651a5d7c9407ae3212a3d56/numpy/lib/tests/test_arraysetops.py#L17 # noqa: E501 + yield [5, 7, 1, 2], [2, 4, 3, 1, 5] + yield [5, 5, 7, 1, 2], [2, 1, 4, 3, 3, 1, 5] + + pyfunc = intersect1d_2 + cfunc = jit(nopython=True)(pyfunc) + + for a, b in arrays(): + # a = np.array(a) + # b = np.array(b) + if isinstance(a, list): + a = List(a) + if isinstance(b, list): + b = List(b) + expected = pyfunc(a, b) + got = cfunc(a, b) + self.assertPreciseEqual(expected, got) + + def test_intersect1d_3(self): + + def arrays(): + yield (List.empty_list(types.float64), + List.empty_list(types.float64)) # two empty arrays + yield [1], List.empty_list(types.float64) # empty right + yield List.empty_list(types.float64), [1] # empty left + yield [1], [2] # singletons no intersection + yield [1], [1] # singletons one intersection + yield [1, 2], [1] + yield [1, 2, 2], [2, 2] + yield [1, 2], [2, 1] + yield [1, 2, 3], [1, 2, 3] + # from numpy: + # https://github.com/numpy/numpy/blob/b0371ef240560e78b651a5d7c9407ae3212a3d56/numpy/lib/tests/test_arraysetops.py#L17 # noqa: E501 + yield [5, 7, 1, 2], [2, 4, 3, 1, 5] + yield [5, 5, 7, 1, 2], [2, 1, 4, 3, 3, 1, 5] + + pyfunc = intersect1d_3 + cfunc = jit(nopython=True)(pyfunc) + + for a, b in arrays(): + if isinstance(a, list): + a = List(a) + if isinstance(b, list): + b = List(b) + expected = pyfunc(a, b, assume_unique=False) + got = cfunc(a, b, assume_unique=False) + self.assertPreciseEqual(expected, got) + if len(np.unique(a)) == len(a) and len(np.unique(b)) == len(b): + expected = pyfunc(a, b, assume_unique=True) + got = cfunc(a, b, assume_unique=True) + self.assertPreciseEqual(expected, got) + + def test_intersect1d_errors(self): + np_pyfunc = intersect1d_3 + np_nbfunc = njit(np_pyfunc) + + a = np.array([1]) + b = np.array([2]) + self.disable_leak_check() + with self.assertRaises(TypingError): + np_nbfunc(a, b, "foo") + with self.assertRaises(TypingError): + np_nbfunc("foo", b, True) + with self.assertRaises(TypingError): + np_nbfunc(a, "foo", True) + + def test_count_nonzero(self): + + def arrays(): + yield np.array([]), None + yield np.zeros(10), None + yield np.arange(10), None + yield np.ones(10, dtype=np.bool_), 0 + yield np.arange(3 * 4 * 5).reshape(3, 4, 5), None + yield np.arange(3 * 4).reshape(3, 4), 0 + yield np.arange(3 * 4).reshape(3, 4), 1 + + pyfunc = count_nonzero + cfunc = jit(nopython=True)(pyfunc) + + for arr, axis in arrays(): + expected = pyfunc(arr, axis) + got = cfunc(arr, axis) + self.assertPreciseEqual(expected, got) + + def test_np_append(self): + def arrays(): + yield 2, 2, None + yield np.arange(10), 3, None + yield np.arange(10), np.arange(3), None + yield np.arange(10).reshape(5, 2), np.arange(3), None + yield np.array([[1, 2, 3], [4, 5, 6]]), np.array([[7, 8, 9]]), 0 + arr = np.array([[1, 2, 3], [4, 5, 6]]) + yield arr, arr, 1 + + pyfunc = append + cfunc = jit(nopython=True)(pyfunc) + + for arr, obj, axis in arrays(): + expected = pyfunc(arr, obj, axis) + got = cfunc(arr, obj, axis) + self.assertPreciseEqual(expected, got) + + def test_np_append_exceptions(self): + pyfunc = append + cfunc = jit(nopython=True)(pyfunc) + arr = np.array([[1, 2, 3], [4, 5, 6]]) + values = np.array([[7, 8, 9]]) + axis = 0 + + # first argument must be array-like + with self.assertRaises(TypingError) as raises: + cfunc(None, values, axis) + self.assertIn( + 'The first argument "arr" must be array-like', + str(raises.exception) + ) + + # second argument must also be array-like + with self.assertRaises(TypingError) as raises: + cfunc(arr, None, axis) + self.assertIn( + 'The second argument "values" must be array-like', + str(raises.exception) + ) + + # third argument must be either nonelike or an integer + with self.assertRaises(TypingError) as raises: + cfunc(arr, values, axis=0.0) + self.assertIn( + 'The third argument "axis" must be an integer', + str(raises.exception) + ) + # Exceptions leak references + self.disable_leak_check() + + def test_delete(self): + + def arrays(): + # array, obj + # + # an array-like type + yield [1, 2, 3, 4, 5], 3 + yield [1, 2, 3, 4, 5], [2, 3] + # 1d array, scalar + yield np.arange(10), 3 + yield np.arange(10), -3 # Negative obj + # 1d array, list + yield np.arange(10), [3, 5, 6] + yield np.arange(10), [2, 3, 4, 5] + # 3d array, scalar + yield np.arange(3 * 4 * 5).reshape(3, 4, 5), 2 + # 3d array, list + yield np.arange(3 * 4 * 5).reshape(3, 4, 5), [5, 30, 27, 8] + # slices + yield [1, 2, 3, 4], slice(1, 3, 1) + yield np.arange(10), slice(10) + + pyfunc = delete + cfunc = jit(nopython=True)(pyfunc) + + for arr, obj in arrays(): + expected = pyfunc(arr, obj) + got = cfunc(arr, obj) + self.assertPreciseEqual(expected, got) + + def test_delete_exceptions(self): + pyfunc = delete + cfunc = jit(nopython=True)(pyfunc) + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc([1, 2], 3.14) + self.assertIn( + 'obj should be of Integer dtype', + str(raises.exception) + ) + + with self.assertRaises(TypingError) as raises: + cfunc(np.arange(10), [3.5, 5.6, 6.2]) + self.assertIn( + 'obj should be of Integer dtype', + str(raises.exception) + ) + + with self.assertRaises(TypingError) as raises: + cfunc(2, 3) + self.assertIn( + 'arr must be either an Array or a Sequence', + str(raises.exception) + ) + + with self.assertRaises(IndexError) as raises: + cfunc([1, 2], 3) + self.assertIn( + 'obj must be less than the len(arr)', + str(raises.exception), + ) + # Exceptions leak references + self.disable_leak_check() + + def diff_arrays(self): + """ + Some test arrays for np.diff() + """ + a = np.arange(12) ** 3 + yield a + b = a.reshape((3, 4)) + yield b + c = np.arange(24).reshape((3, 2, 4)) ** 3 + yield c + + def test_diff1(self): + pyfunc = diff1 + cfunc = jit(nopython=True)(pyfunc) + for arr in self.diff_arrays(): + expected = pyfunc(arr) + got = cfunc(arr) + self.assertPreciseEqual(expected, got) + + # 0-dim array + a = np.array(42) + with self.assertTypingError(): + cfunc(a) + + def test_diff2(self): + pyfunc = diff2 + cfunc = jit(nopython=True)(pyfunc) + for arr in self.diff_arrays(): + size = arr.shape[-1] + for n in (0, 1, 2, 3, size - 1, size, size + 1, 421): + expected = pyfunc(arr, n) + got = cfunc(arr, n) + self.assertPreciseEqual(expected, got) + + def test_diff2_exceptions(self): + pyfunc = diff2 + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + # 0-dim array + arr = np.array(42) + with self.assertTypingError(): + cfunc(arr, 1) + + # Invalid `n` + arr = np.arange(10) + for n in (-1, -2, -42): + with self.assertRaises(ValueError) as raises: + cfunc(arr, n) + self.assertIn("order must be non-negative", str(raises.exception)) + # Exceptions leak references + self.disable_leak_check() + + def test_isscalar(self): + def values(): + yield 3 + yield np.asarray([3]) + yield (3,) + yield 3j + yield 'numba' + yield int(10) + yield np.int16(12345) + yield 4.234 + yield True + yield None + yield np.timedelta64(10, 'Y') + yield np.datetime64('nat') + yield np.datetime64(1, 'Y') + + pyfunc = isscalar + cfunc = jit(nopython=True)(pyfunc) + for x in values(): + expected = pyfunc(x) + got = cfunc(x) + self.assertEqual(expected, got, x) + + def test_isobj_functions(self): + def values(): + yield 1 + yield 1 + 0j + yield np.asarray([3, 1 + 0j, True]) + yield "hello world" + + @jit(nopython=True) + def optional_fn(x, cond, cfunc): + y = x if cond else None + return cfunc(y) + + pyfuncs = [iscomplexobj, isrealobj] + for pyfunc in pyfuncs: + cfunc = jit(nopython=True)(pyfunc) + for x in values(): + expected = pyfunc(x) + got = cfunc(x) + self.assertEqual(expected, got) + + # optional type + expected_optional = optional_fn.py_func(x, True, pyfunc) + got_optional = optional_fn(x, True, cfunc) + self.assertEqual(expected_optional, got_optional) + + # none type + expected_none = optional_fn.py_func(x, False, pyfunc) + got_none = optional_fn(x, False, cfunc) + self.assertEqual(expected_none, got_none) + + self.assertEqual(len(cfunc.signatures), 8) + + def test_is_real_or_complex(self): + def values(): + yield np.array([1 + 1j, 1 + 0j, 4.5, 3, 2, 2j]) + yield np.array([1, 2, 3]) + yield 3 + yield 12j + yield 1 + 4j + yield 10 + 0j + yield (1 + 4j, 2 + 0j) + yield np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) + + pyfuncs = [iscomplex, isreal] + for pyfunc in pyfuncs: + cfunc = jit(nopython=True)(pyfunc) + for x in values(): + expected = pyfunc(x) + got = cfunc(x) + self.assertPreciseEqual(expected, got) + + def test_isneg_or_ispos_inf(self): + def values(): + yield -np.inf, None + yield np.inf, None + yield np.inf, None + yield np.asarray([-np.inf, 0., np.inf]), None + yield -np.inf, np.zeros(1, dtype=np.bool_) + yield np.inf, np.zeros(1, dtype=np.bool_) + yield np.inf, np.zeros(1, dtype=np.bool_) + yield -np.inf, np.empty(12) + yield np.asarray([-np.inf, 0., np.inf]), np.zeros(3, dtype=np.bool_) + + pyfuncs = [isneginf, isposinf] + for pyfunc in pyfuncs: + cfunc = jit(nopython=True)(pyfunc) + for x, out in values(): + expected = pyfunc(x, out) + got = cfunc(x, out) + self.assertPreciseEqual(expected, got) + + def test_isclose(self): + rtol = 1e-5 + atol = 1e-8 + arr = np.array([100, 1000]) + aran = np.arange(8).reshape((2, 2, 2)) + kw = {'rtol': rtol, 'atol': atol} + + def values(): + yield 1e10, 1.00001e10, {} + yield 1e10, np.nan, {} + yield np.array([1e-8, 1e-7]), np.array([0.0, 0.0]), {} + yield np.array([1e10, 1e-7]), np.array([1.00001e10, 1e-8]), {} + yield np.array([1e10, 1e-8]), np.array([1.00001e10, 1e-9]), {} + yield np.array([1e10, 1e-8]), np.array([1.0001e10, 1e-9]), {} + yield np.array([1.0, np.nan]), np.array([1.0, np.nan]), {} + yield np.array([1.0, np.nan]), np.array([1.0, np.nan]), {'equal_nan': True} # noqa + yield np.array([np.nan, np.nan]), np.array([1.0, np.nan]), {'equal_nan': True} # noqa + yield np.array([1e-100, 1e-7]), np.array([0.0, 0.0]), {'atol': 0.0} + yield np.array([1e-10, 1e-10]), np.array([1e-20, 0.0]), {} + yield np.array([1e-10, 1e-10]), np.array([1e-20, 0.999999e-10]), {'atol': 0.0} # noqa + yield np.array([1, np.inf, 2]), np.array([3, np.inf, 4]), kw + yield np.array([atol, np.inf, -np.inf, np.nan]), np.array([0]), kw + yield np.array([atol, np.inf, -np.inf, np.nan]), 0, kw + yield 0, np.array([atol, np.inf, -np.inf, np.nan]), kw + + # tests taken from + # https://github.com/numpy/numpy/blob/aac965af6032b69d5cb515ad785cc9a331e816f4/numpy/core/tests/test_numeric.py#L2298-L2335 # noqa: E501 + + # all close tests + yield np.array([0, 1]), np.array([1, 0]), kw + yield arr, arr, kw + yield np.array([1]), np.array([1 + rtol + atol]), kw + yield arr, arr + arr * rtol, kw + yield arr, arr + arr * rtol + atol, kw + yield aran, aran + aran * rtol, kw + yield np.inf, np.inf, kw + yield -np.inf, np.inf, kw + yield np.inf, np.array([np.inf]), kw + yield np.array([np.inf, -np.inf]), np.array([np.inf, -np.inf]), kw + + # none close tests + yield np.array([np.inf, 0]), np.array([1, np.inf]), kw + yield np.array([np.inf, -np.inf]), np.array([1, 0]), kw + yield np.array([np.inf, np.inf]), np.array([1, -np.inf]), kw + yield np.array([np.inf, np.inf]), np.array([1, 0]), kw + yield np.array([np.nan, 0]), np.array([np.nan, -np.inf]), kw + yield np.array([atol * 2]), np.array([0]), kw + yield np.array([1]), np.array([1 + rtol + atol * 2]), kw + yield aran, aran + rtol * 1.1 * aran + atol * 1.1, kw + yield np.array(np.array([np.inf, 1])), np.array(np.array([0, np.inf])), kw # noqa + + # some close tests + yield np.array([np.inf, 0]), np.array([atol * 2, atol * 2]), kw + yield np.array([np.inf, 0]), np.array([np.inf, atol * 2]), kw + yield np.array([atol, 1, 1e6 * (1 + 2 * rtol) + atol]), np.array([0, np.nan, 1e6]), kw # noqa + yield np.arange(3), np.array([0, 1, 2.1]), kw + yield np.nan, np.array([np.nan, np.nan, np.nan]), kw + yield np.array([0]), np.array([atol, np.inf, -np.inf, np.nan]), kw + yield 0, np.array([atol, np.inf, -np.inf, np.nan]), kw + + pyfunc = isclose + cfunc = jit(nopython=True)(pyfunc) + for a, b, kwargs in values(): + expected = pyfunc(a, b, **kwargs) + got = cfunc(a, b, **kwargs) + if isinstance(expected, np.bool_): + self.assertEqual(expected, got) + else: + self.assertTrue(np.array_equal(expected, got)) + + def isclose_exception(self): + pyfunc = isclose + cfunc = jit(nopython=True)(pyfunc) + inps = [ + (np.asarray([1e10, 1e-9, np.nan]), + np.asarray([1.0001e10, 1e-9]), + 1e-05, 1e-08, False, + "shape mismatch: objects cannot be broadcast to a single shape", + ValueError), + ('hello', 3, False, 1e-08, False, + 'The first argument "a" must be array-like', + TypingError), + (3, 'hello', False, 1e-08, False, + 'The second argument "b" must be array-like', + TypingError), + (2, 3, False, 1e-08, False, + 'The third argument "rtol" must be a floating point', + TypingError), + (2, 3, 1e-05, False, False, + 'The fourth argument "atol" must be a floating point', + TypingError), + (2, 3, 1e-05, 1e-08, 1, + 'The fifth argument "equal_nan" must be a boolean', + TypingError), + ] + + for a, b, rtol, atol, equal_nan, exc_msg, exc in inps: + with self.assertRaisesRegex(exc, exc_msg): + cfunc(a, b, rtol, atol, equal_nan) + + def bincount_sequences(self): + """ + Some test sequences for np.bincount() + """ + a = [1, 2, 5, 2, 3, 20] + b = np.array([5, 8, 42, 5]) + c = self.rnd.randint(0, 100, size=300).astype(np.int8) + return (a, b, c) + + def test_bincount1(self): + pyfunc = bincount1 + cfunc = jit(nopython=True)(pyfunc) + for seq in self.bincount_sequences(): + expected = pyfunc(seq) + got = cfunc(seq) + self.assertPreciseEqual(expected, got) + + def test_bincount1_exceptions(self): + pyfunc = bincount1 + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + # Negative input + with self.assertRaises(ValueError) as raises: + cfunc([2, -1]) + self.assertIn("first argument must be non-negative", + str(raises.exception)) + # Exceptions leak references + self.disable_leak_check() + + def test_bincount2(self): + pyfunc = bincount2 + cfunc = jit(nopython=True)(pyfunc) + for seq in self.bincount_sequences(): + w = [math.sqrt(x) - 2 for x in seq] + # weights as list, then array, mixed types, check upcast is ok + for weights in (w, np.array(w), seq, np.array(seq)): + expected = pyfunc(seq, weights) + got = cfunc(seq, weights) + self.assertPreciseEqual(expected, got) + + def test_bincount2_exceptions(self): + pyfunc = bincount2 + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + # Negative input + with self.assertRaises(ValueError) as raises: + cfunc([2, -1], [0, 0]) + self.assertIn("first argument must be non-negative", + str(raises.exception)) + + # Mismatching input sizes + with self.assertRaises(ValueError) as raises: + cfunc([2, -1], [0]) + self.assertIn("weights and list don't have the same length", + str(raises.exception)) + + def test_bincount3(self): + pyfunc = bincount3 + cfunc = jit(nopython=True)(pyfunc) + for seq in self.bincount_sequences(): + a_max = max(seq) + # Length should be a_max in the first case, minlength in the second + for minlength in (a_max, a_max + 2): + expected = pyfunc(seq, None, minlength) + got = cfunc(seq, None, minlength) + self.assertEqual(len(expected), len(got)) + self.assertPreciseEqual(expected, got) + + def test_bincount3_exceptions(self): + pyfunc = bincount3 + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + # Negative input + with self.assertRaises(ValueError) as raises: + cfunc([2, -1], [0, 0]) + self.assertIn("first argument must be non-negative", + str(raises.exception)) + + # Negative minlength + with self.assertRaises(ValueError) as raises: + cfunc([17, 38], None, -1) + self.assertIn("'minlength' must not be negative", + str(raises.exception)) + + def test_searchsorted(self): + pyfunc = searchsorted + cfunc = jit(nopython=True)(pyfunc) + + pyfunc_left = searchsorted_left + cfunc_left = jit(nopython=True)(pyfunc_left) + + pyfunc_right = searchsorted_right + cfunc_right = jit(nopython=True)(pyfunc_right) + + def check(a, v): + expected = pyfunc(a, v) + got = cfunc(a, v) + self.assertPreciseEqual(expected, got) + + expected = pyfunc_left(a, v) + got = cfunc_left(a, v) + self.assertPreciseEqual(expected, got) + + expected = pyfunc_right(a, v) + got = cfunc_right(a, v) + self.assertPreciseEqual(expected, got) + + # First with integer values (no NaNs) + bins = np.arange(5) ** 2 + values = np.arange(20) - 1 + + for a in (bins, list(bins)): + # Scalar values + for v in values: + check(a, v) + # Array values + for v in (values, values.reshape((4, 5))): + check(a, v) + # Sequence values + check(a, list(values)) + + # Second with float values (including NaNs) + bins = np.float64(list(bins) + [float('nan')] * 7) / 2.0 + values = np.arange(20) - 0.5 + + for a in (bins, list(bins)): + # Scalar values + for v in values: + check(a, v) + # Array values + for v in (values, values.reshape((4, 5))): + check(a, v) + # Sequence values + check(a, list(values)) + + # nonsense value for 'side' raises TypingError + def bad_side(a, v): + return np.searchsorted(a, v, side='nonsense') + cfunc = jit(nopython=True)(bad_side) + with self.assertTypingError(): + cfunc([1,2], 1) + + # non-constant value for 'side' raises TypingError + def nonconst_side(a, v, side='left'): + return np.searchsorted(a, v, side=side) + cfunc = jit(nopython=True)(nonconst_side) + with self.assertTypingError(): + cfunc([1,2], 1, side='right') + + # Test unordered values + a = np.array([1, 2, 0]) + v = np.array( + [ + [5, 4], + [6, 7], + [2, 1], + [0, 3], + ] + ) + check(a, v) + + a = np.array([9, 1, 4, 2, 0, 3, 7, 6, 8]) + v = np.array( + [ + [5, 10], + [10, 5], + [-1, 5], + ] + ) + check(a, v) + + def test_searchsorted_supplemental(self): + pyfunc = searchsorted + cfunc = jit(nopython=True)(pyfunc) + + pyfunc_left = searchsorted_left + cfunc_left = jit(nopython=True)(pyfunc_left) + + pyfunc_right = searchsorted_right + cfunc_right = jit(nopython=True)(pyfunc_right) + + def check(a, v): + expected = pyfunc(a, v) + got = cfunc(a, v) + self.assertPreciseEqual(expected, got) + + expected = pyfunc_left(a, v) + got = cfunc_left(a, v) + self.assertPreciseEqual(expected, got) + + expected = pyfunc_right(a, v) + got = cfunc_right(a, v) + self.assertPreciseEqual(expected, got) + + element_pool = list(range(-5, 50)) + element_pool += [np.nan] * 5 + [np.inf] * 3 + [-np.inf] * 3 + + for i in range(1000): + sample_size = self.rnd.choice([5, 10, 25]) + + # `a` and `v` not sorted; either may have repeating values + a = self.rnd.choice(element_pool, sample_size) + v = self.rnd.choice(element_pool, sample_size + (i % 3 - 1)) + + # output should match numpy regardless of whether `a` is sorted + check(a, v) + check(np.sort(a), v) + + ones = np.ones(5) + nans = np.full(len(ones), fill_value=np.nan) + check(ones, ones) + + # `a` and / or `v` full of nans + check(ones, nans) + check(nans, ones) + check(nans, nans) + + # `v` is zero size + a = np.arange(1) + v = np.arange(0) + check(a, v) + + # `a` and `v` booleans + a = np.array([False, False, True, True]) + v = np.array([False, True]) + check(a, v) + + # `v` is a (scalar) boolean + a = [1, 2, 3] + v = True + check(a, v) + + # `a` and `v` arrays of strings + a = np.array(['1', '2', '3']) + v = np.array(['2', '4']) + check(a, v) + + def test_searchsorted_complex(self): + pyfunc = searchsorted + cfunc = jit(nopython=True)(pyfunc) + + pyfunc_left = searchsorted_left + cfunc_left = jit(nopython=True)(pyfunc_left) + + pyfunc_right = searchsorted_right + cfunc_right = jit(nopython=True)(pyfunc_right) + + def check(a, v): + expected = pyfunc(a, v) + got = cfunc(a, v) + self.assertPreciseEqual(expected, got) + + expected = pyfunc_left(a, v) + got = cfunc_left(a, v) + self.assertPreciseEqual(expected, got) + + expected = pyfunc_right(a, v) + got = cfunc_right(a, v) + self.assertPreciseEqual(expected, got) + + pool = [0, 1, np.nan] + element_pool = [complex(*c) for c in itertools.product(pool, pool)] + + for i in range(100): + sample_size = self.rnd.choice([3, 5, len(element_pool)]) + + # `a` and `v` not sorted; either may have repeating values + a = self.rnd.choice(element_pool, sample_size) + v = self.rnd.choice(element_pool, sample_size + (i % 3 - 1)) + + # output should match numpy regardless of whether `a` is sorted + check(a, v) + check(np.sort(a), v) + + # check type promotion (a complex; v not so much) + check(a=np.array(element_pool), v=np.arange(2)) + + def test_digitize(self): + pyfunc = digitize + cfunc = jit(nopython=True)(pyfunc) + + def check(*args): + expected = pyfunc(*args) + got = cfunc(*args) + self.assertPreciseEqual(expected, got) + + values = np.float64((0, 0.99, 1, 4.4, 4.5, 7, 8, 9, 9.5, + float('inf'), float('-inf'), float('nan'))) + assert len(values) == 12 + self.rnd.shuffle(values) + + bins1 = np.float64([1, 3, 4.5, 8]) + bins2 = np.float64([1, 3, 4.5, 8, float('inf'), float('-inf')]) + bins3 = np.float64([1, 3, 4.5, 8, float('inf'), float('-inf')] + + [float('nan')] * 10) + + all_bins = [bins1, bins2, bins3] + xs = [values, values.reshape((3, 4))] + + # 2-ary digitize() + for bins in all_bins: + bins.sort() + for x in xs: + check(x, bins) + check(x, bins[::-1]) + + # 3-ary digitize() + for bins in all_bins: + for right in (True, False): + check(values, bins, right) + check(values, bins[::-1], right) + + # Sequence input + check(list(values), bins1) + + # per https://github.com/numba/numba/issues/8768 + check(np.array([np.nan, 1]), np.array([1.5, np.nan])) + + def test_digitize_non_monotonic_bins(self): + # Exceptions leak references + self.disable_leak_check() + + pyfunc = digitize + cfunc = jit(nopython=True)(pyfunc) + + def check_error(*args): + for fn in (pyfunc, cfunc): + with self.assertRaises(ValueError) as raises: + fn(*args) + + msg = 'bins must be monotonically increasing or decreasing' + self.assertIn(msg, str(raises.exception)) + + x = np.array([np.nan, 1]) + bins = np.array([np.nan, 1.5, 2.3, np.nan]) + check_error(x, bins) + + x = [-1, 0, 1, 2] + bins = [0, 0, 1, 0] + check_error(x, bins) + + bins = [1, 1, 0, 1] + check_error(x, bins) + + def test_digitize_supplemental(self): + # inspired by the tests in + # https://github.com/numpy/numpy/blob/a277f62/numpy/lib/tests/test_function_base.py + + pyfunc = digitize + cfunc = jit(nopython=True)(pyfunc) + + def check(*args): + expected = pyfunc(*args) + got = cfunc(*args) + self.assertPreciseEqual(expected, got) + + # forward + x = np.arange(-6, 5) + bins = np.arange(-5, 5) + check(x, bins) + + # reverse + x = np.arange(5, -6, -1) + bins = np.arange(5, -5, -1) + check(x, bins) + + # random + x = self.rnd.rand(10) + bins = np.linspace(x.min(), x.max(), 10) + check(x, bins) + + # right_basic + x = [1, 5, 4, 10, 8, 11, 0] + bins = [1, 5, 10] + check(x, bins) + + # right_open + x = np.arange(-6, 5) + bins = np.arange(-6, 4) + check(x, bins, True) + + # right_open_reverse + x = np.arange(5, -6, -1) + bins = np.arange(4, -6, -1) + check(x, bins, True) + + # right_open_random + x = self.rnd.rand(10) + bins = np.linspace(x.min(), x.max(), 10) + check(x, bins, True) + + # monotonic + x = [-1, 0, 1, 2] + bins = [0, 0, 1] + check(x, bins) + + bins = [1, 1, 0] + check(x, bins) + + bins = [1, 1, 1, 1] + check(x, bins) + + # large_integers_increasing + x = 2 ** 54 # loses precision in a float + check([x], [x - 1, x + 1]) + + def test_digitize_raise_if_x_complex(self): + # Exceptions leak references + self.disable_leak_check() + + pyfunc = digitize + cfunc = jit(nopython=True)(pyfunc) + + x = np.array([1 + 1j]) + y = np.array([1., 3., 4.5, 8.]) + msg = 'x may not be complex' + + for func in pyfunc, cfunc: + with self.assertTypingError() as raises: + func(x, y) + self.assertIn(msg, str(raises.exception)) + + def test_histogram(self): + pyfunc = histogram + cfunc = jit(nopython=True)(pyfunc) + + def check(*args): + pyhist, pybins = pyfunc(*args) + chist, cbins = cfunc(*args) + self.assertPreciseEqual(pyhist, chist) + # There can be a slight discrepancy in the linspace() result + # when `bins` is an integer... + self.assertPreciseEqual(pybins, cbins, prec='double', ulps=2) + + def check_values(values): + # Explicit bins array + # (note Numpy seems to not support NaN bins) + bins = np.float64([1, 3, 4.5, 8]) + check(values, bins) + check(values.reshape((3, 4)), bins) + + # Explicit number of bins + check(values, 7) + + # Explicit number of bins and bins range + check(values, 7, (1.0, 13.5)) + + # Implicit bins=10 + check(values) + + values = np.float64((0, 0.99, 1, 4.4, 4.5, 7, 8, + 9, 9.5, 42.5, -1.0, -0.0)) + assert len(values) == 12 + self.rnd.shuffle(values) + + check_values(values) + + def _test_correlate_convolve(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + # only 1d arrays are accepted, test varying lengths + # and varying dtype + lengths = (1, 2, 3, 7) + dts = [np.int8, np.int32, np.int64, np.float32, np.float64, + np.complex64, np.complex128] + modes = ["full", "valid", "same"] + + for dt1, dt2, n, m, mode in itertools.product( + dts, dts, lengths, lengths, modes + ): + a = np.arange(n, dtype=dt1) + v = np.arange(m, dtype=dt2) + + if np.issubdtype(dt1, np.complexfloating): + a = (a + 1j * a).astype(dt1) + if np.issubdtype(dt2, np.complexfloating): + v = (v + 1j * v).astype(dt2) + + expected = pyfunc(a, v, mode=mode) + got = cfunc(a, v, mode=mode) + + self.assertPreciseEqual(expected, got) + + _a = np.arange(12).reshape(4, 3) + _b = np.arange(12) + for x, y in [(_a, _b), (_b, _a)]: + with self.assertRaises(TypingError) as raises: + cfunc(x, y) + msg = 'only supported on 1D arrays' + self.assertIn(msg, str(raises.exception)) + + def test_correlate(self): + self._test_correlate_convolve(correlate) + + def _test_correlate_convolve_exceptions(self, fn): + # Exceptions leak references + self.disable_leak_check() + + # convolve raises if either array has a 0 dimension + _a = np.ones(shape=(0,)) + _b = np.arange(5) + cfunc = jit(nopython=True)(fn) + for x, y in [(_a, _b), (_b, _a)]: + with self.assertRaises(ValueError) as raises: + cfunc(x, y) + if len(x) == 0: + self.assertIn("'a' cannot be empty", str(raises.exception)) + else: + self.assertIn("'v' cannot be empty", str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc(_b, _b, mode="invalid mode") + + self.assertIn("Invalid 'mode'", str(raises.exception)) + + def test_correlate_exceptions(self): + # correlate supported 0 dimension arrays until 1.18 + self._test_correlate_convolve_exceptions(correlate) + + def test_convolve(self): + self._test_correlate_convolve(convolve) + + def test_convolve_exceptions(self): + self._test_correlate_convolve_exceptions(convolve) + + def _check_output(self, pyfunc, cfunc, params, abs_tol=None): + expected = pyfunc(**params) + got = cfunc(**params) + self.assertPreciseEqual(expected, got, abs_tol=abs_tol) + + def test_vander_basic(self): + pyfunc = vander + cfunc = jit(nopython=True)(pyfunc) + _check_output = partial(self._check_output, pyfunc, cfunc) + + def _check(x): + n_choices = [None, 0, 1, 2, 3, 4] + increasing_choices = [True, False] + + # N and increasing defaulted + params = {'x': x} + _check_output(params) + + # N provided and increasing defaulted + for n in n_choices: + params = {'x': x, 'N': n} + _check_output(params) + + # increasing provided and N defaulted: + for increasing in increasing_choices: + params = {'x': x, 'increasing': increasing} + _check_output(params) + + # both n and increasing supplied + for n in n_choices: + for increasing in increasing_choices: + params = {'x': x, 'N': n, 'increasing': increasing} + _check_output(params) + + _check(np.array([1, 2, 3, 5])) + _check(np.arange(7) - 10.5) + _check(np.linspace(3, 10, 5)) + _check(np.array([1.2, np.nan, np.inf, -np.inf])) + _check(np.array([])) + _check(np.arange(-5, 5) - 0.3) + + # # boolean array + _check(np.array([True] * 5 + [False] * 4)) + + # cycle through dtypes to check type promotion a la numpy + for dtype in np.int32, np.int64, np.float32, np.float64: + _check(np.arange(10, dtype=dtype)) + + # non array inputs + _check([0, 1, 2, 3]) + _check((4, 5, 6, 7)) + _check((0.0, 1.0, 2.0)) + _check(()) + + # edge cases + _check((3, 4.444, 3.142)) + _check((True, False, 4)) + + def test_vander_exceptions(self): + pyfunc = vander + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + x = np.arange(5) - 0.5 + + def _check_n(N): + with self.assertTypingError() as raises: + cfunc(x, N=N) + self.assertIn("Second argument N must be None or an integer", + str(raises.exception)) + + for N in 1.1, True, np.inf, [1, 2]: + _check_n(N) + + with self.assertRaises(ValueError) as raises: + cfunc(x, N=-1) + self.assertIn("Negative dimensions are not allowed", + str(raises.exception)) + + def _check_1d(x): + with self.assertRaises(ValueError) as raises: + cfunc(x) + self.assertEqual("x must be a one-dimensional array or sequence.", + str(raises.exception)) + + x = np.arange(27).reshape((3, 3, 3)) + _check_1d(x) + + x = ((2, 3), (4, 5)) + _check_1d(x) + + def test_tri_n_basic(self): + pyfunc = tri_n + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + def n_variations(): + return np.arange(-4, 8) # number of rows + + # N supplied, M and k defaulted + for n in n_variations(): + params = {'N': n} + _check(params) + + def test_tri_n_m_basic(self): + pyfunc = tri_n_m + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + def n_variations(): + return np.arange(-4, 8) # number of rows + + def m_variations(): + # number of columns + return itertools.chain.from_iterable(([None], range(-5, 9))) + + # N supplied, M and k defaulted + for n in n_variations(): + params = {'N': n} + _check(params) + + # N and M supplied, k defaulted + for n in n_variations(): + for m in m_variations(): + params = {'N': n, 'M': m} + _check(params) + + def test_tri_n_k_basic(self): + pyfunc = tri_n_k + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + def n_variations(): + return np.arange(-4, 8) # number of rows + + def k_variations(): + return np.arange(-10, 10) # offset + + # N supplied, M and k defaulted + for n in n_variations(): + params = {'N': n} + _check(params) + + # N and k supplied, M defaulted + for n in n_variations(): + for k in k_variations(): + params = {'N': n, 'k': k} + _check(params) + + def test_tri_n_m_k_basic(self): + pyfunc = tri_n_m_k + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + def n_variations(): + return np.arange(-4, 8) # number of rows + + def m_variations(): + # number of columns + return itertools.chain.from_iterable(([None], range(-5, 9))) + + def k_variations(): + return np.arange(-10, 10) # offset + + # N supplied, M and k defaulted + for n in n_variations(): + params = {'N': n} + _check(params) + + # N and M supplied, k defaulted + for n in n_variations(): + for m in m_variations(): + params = {'N': n, 'M': m} + _check(params) + + # N and k supplied, M defaulted + for n in n_variations(): + for k in k_variations(): + params = {'N': n, 'k': k} + _check(params) + + # N, M and k supplied + for n in n_variations(): + for k in k_variations(): + for m in m_variations(): + params = {'N': n, 'M': m, 'k': k} + _check(params) + + def test_tri_exceptions(self): + pyfunc = tri_n_m_k + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check(k): + with self.assertTypingError() as raises: + cfunc(5, 6, k=k) + assert "k must be an integer" in str(raises.exception) + + for k in 1.5, True, np.inf, [1, 2]: + _check(k) + + def _triangular_matrix_tests_m(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + def _check(arr): + expected = pyfunc(arr) + got = cfunc(arr) + # TODO: Contiguity of result not consistent with numpy + self.assertEqual(got.dtype, expected.dtype) + np.testing.assert_array_equal(got, expected) + + return self._triangular_matrix_tests_inner(self, pyfunc, _check) + + def _triangular_matrix_tests_m_k(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + def _check(arr): + for k in itertools.chain.from_iterable(([None], range(-10, 10))): + if k is None: + params = {} + else: + params = {'k': k} + expected = pyfunc(arr, **params) + got = cfunc(arr, **params) + # TODO: Contiguity of result not consistent with numpy + self.assertEqual(got.dtype, expected.dtype) + np.testing.assert_array_equal(got, expected) + + return self._triangular_matrix_tests_inner(self, pyfunc, _check) + + @staticmethod + def _triangular_matrix_tests_inner(self, pyfunc, _check): + + def check_odd(a): + _check(a) + a = a.reshape((9, 7)) + _check(a) + a = a.reshape((7, 1, 3, 3)) + _check(a) + _check(a.T) + + def check_even(a): + _check(a) + a = a.reshape((4, 16)) + _check(a) + a = a.reshape((4, 2, 2, 4)) + _check(a) + _check(a.T) + + check_odd(np.arange(63) + 10.5) + check_even(np.arange(64) - 10.5) + + # edge cases + _check(np.arange(360).reshape(3, 4, 5, 6)) + _check(np.array([])) + _check(np.arange(9).reshape((3, 3))[::-1]) + _check(np.arange(9).reshape((3, 3), order='F')) + + arr = (np.arange(64) - 10.5).reshape((4, 2, 2, 4)) + _check(arr) + _check(np.asfortranarray(arr)) + + def _triangular_matrix_exceptions(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + a = np.ones((5, 6)) + with self.assertTypingError() as raises: + cfunc(a, k=1.5) + self.assertIn("k must be an integer", str(raises.exception)) + + def _triangular_indices_tests_base(self, pyfunc, args): + cfunc = jit(nopython=True)(pyfunc) + + for x in args: + expected = pyfunc(*x) + got = cfunc(*x) + self.assertEqual(type(expected), type(got)) + self.assertEqual(len(expected), len(got)) + for e, g in zip(expected, got): + np.testing.assert_array_equal(e, g) + + def _triangular_indices_tests_n(self, pyfunc): + self._triangular_indices_tests_base( + pyfunc, + [[n] for n in range(10)] + ) + + def _triangular_indices_tests_n_k(self, pyfunc): + self._triangular_indices_tests_base( + pyfunc, + [[n, k] for n in range(10) for k in range(-n - 1, n + 2)] + ) + + def _triangular_indices_tests_n_m(self, pyfunc): + self._triangular_indices_tests_base( + pyfunc, + [[n, m] for n in range(10) for m in range(2 * n)] + ) + + def _triangular_indices_tests_n_k_m(self, pyfunc): + self._triangular_indices_tests_base( + pyfunc, + [[n, k, m] for n in range(10) + for k in range(-n - 1, n + 2) + for m in range(2 * n)] + ) + + # Check jitted version works with default values for kwargs + cfunc = jit(nopython=True)(pyfunc) + cfunc(1) + + def _triangular_indices_from_tests_arr(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + for dtype in [int, float, bool]: + for n,m in itertools.product(range(10), range(10)): + arr = np.ones((n, m), dtype) + expected = pyfunc(arr) + got = cfunc(arr) + self.assertEqual(type(expected), type(got)) + self.assertEqual(len(expected), len(got)) + for e, g in zip(expected, got): + np.testing.assert_array_equal(e, g) + + def _triangular_indices_from_tests_arr_k(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + + for dtype in [int, float, bool]: + for n,m in itertools.product(range(10), range(10)): + arr = np.ones((n, m), dtype) + for k in range(-10, 10): + expected = pyfunc(arr) + got = cfunc(arr) + self.assertEqual(type(expected), type(got)) + self.assertEqual(len(expected), len(got)) + for e, g in zip(expected, got): + np.testing.assert_array_equal(e, g) + + def _triangular_indices_exceptions(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + parameters = pysignature(pyfunc).parameters + + with self.assertTypingError() as raises: + cfunc(1.0) + self.assertIn("n must be an integer", str(raises.exception)) + + if 'k' in parameters: + with self.assertTypingError() as raises: + cfunc(1, k=1.0) + self.assertIn("k must be an integer", str(raises.exception)) + + if 'm' in parameters: + with self.assertTypingError() as raises: + cfunc(1, m=1.0) + self.assertIn("m must be an integer", str(raises.exception)) + + def _triangular_indices_from_exceptions(self, pyfunc, test_k=True): + cfunc = jit(nopython=True)(pyfunc) + + for ndims in [0, 1, 3]: + a = np.ones([5] * ndims) + with self.assertTypingError() as raises: + cfunc(a) + self.assertIn("input array must be 2-d", str(raises.exception)) + + if test_k: + a = np.ones([5, 5]) + with self.assertTypingError() as raises: + cfunc(a, k=0.5) + self.assertIn("k must be an integer", str(raises.exception)) + + def test_tril_basic(self): + self._triangular_matrix_tests_m(tril_m) + self._triangular_matrix_tests_m_k(tril_m_k) + + def test_tril_exceptions(self): + self._triangular_matrix_exceptions(tril_m_k) + + def test_tril_indices(self): + self._triangular_indices_tests_n(tril_indices_n) + self._triangular_indices_tests_n_k(tril_indices_n_k) + self._triangular_indices_tests_n_m(tril_indices_n_m) + self._triangular_indices_tests_n_k_m(tril_indices_n_k_m) + self._triangular_indices_exceptions(tril_indices_n) + self._triangular_indices_exceptions(tril_indices_n_k) + self._triangular_indices_exceptions(tril_indices_n_m) + self._triangular_indices_exceptions(tril_indices_n_k_m) + + def test_tril_indices_from(self): + self._triangular_indices_from_tests_arr(tril_indices_from_arr) + self._triangular_indices_from_tests_arr_k(tril_indices_from_arr_k) + self._triangular_indices_from_exceptions(tril_indices_from_arr, False) + self._triangular_indices_from_exceptions(tril_indices_from_arr_k, True) + + def test_triu_basic(self): + self._triangular_matrix_tests_m(triu_m) + self._triangular_matrix_tests_m_k(triu_m_k) + + def test_triu_exceptions(self): + self._triangular_matrix_exceptions(triu_m_k) + + def test_triu_indices(self): + self._triangular_indices_tests_n(triu_indices_n) + self._triangular_indices_tests_n_k(triu_indices_n_k) + self._triangular_indices_tests_n_m(triu_indices_n_m) + self._triangular_indices_tests_n_k_m(triu_indices_n_k_m) + self._triangular_indices_exceptions(triu_indices_n) + self._triangular_indices_exceptions(triu_indices_n_k) + self._triangular_indices_exceptions(triu_indices_n_m) + self._triangular_indices_exceptions(triu_indices_n_k_m) + + def test_triu_indices_from(self): + self._triangular_indices_from_tests_arr(triu_indices_from_arr) + self._triangular_indices_from_tests_arr_k(triu_indices_from_arr_k) + self._triangular_indices_from_exceptions(triu_indices_from_arr, False) + self._triangular_indices_from_exceptions(triu_indices_from_arr_k, True) + + def test_indices_basic(self): + pyfunc = np_indices + cfunc = njit(np_indices) + + def inputs(): + # Taken from https://github.com/numpy/numpy/blob/db4f43983cb938f12c311e1f5b7165e270c393b4/numpy/core/tests/test_numeric.py#L3383-L3407 # noqa: E501 + yield (4, 3) + yield (4,) + yield (0,) + yield (2, 2, 3, 5) + + for dims in inputs(): + self.assertPreciseEqual(pyfunc(dims), cfunc(dims)) + + def test_indices_exception(self): + cfunc = njit(np_indices) + + self.disable_leak_check() + + errmsg = 'The argument "dimensions" must be a tuple of integers' + with self.assertRaises(TypingError) as raises: + cfunc("abc") + self.assertIn(errmsg, + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc((2.0, 3.0)) + self.assertIn(errmsg, + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc((2, 3.0)) + self.assertIn(errmsg, + str(raises.exception)) + + def partition_sanity_check(self, pyfunc, cfunc, a, kth): + # as NumPy uses a different algorithm, we do not expect to + # match outputs exactly... + expected = pyfunc(a, kth) + got = cfunc(a, kth) + + # but we do expect the unordered collection of elements up to the + # kth to tie out + self.assertPreciseEqual(np.unique(expected[:kth]), np.unique(got[:kth])) + + # likewise the unordered collection of elements from the kth onwards + self.assertPreciseEqual(np.unique(expected[kth:]), np.unique(got[kth:])) + + def argpartition_sanity_check(self, pyfunc, cfunc, a, kth): + # as NumPy uses a different algorithm, we do not expect to + # match outputs exactly... + expected = pyfunc(a, kth) + got = cfunc(a, kth) + + # but we do expect the unordered collection of elements up to the + # kth to tie out + self.assertPreciseEqual(np.unique(a[expected[:kth]]), + np.unique(a[got[:kth]])) + + # likewise the unordered collection of elements from the kth onwards + self.assertPreciseEqual(np.unique(a[expected[kth:]]), + np.unique(a[got[kth:]])) + + def test_partition_fuzz(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + for j in range(10, 30): + for i in range(1, j - 2): + d = np.arange(j) + self.rnd.shuffle(d) + d = d % self.rnd.randint(2, 30) + idx = self.rnd.randint(d.size) + kth = [0, idx, i, i + 1, -idx, -i] # include negative kth's + tgt = np.sort(d)[kth] + self.assertPreciseEqual(cfunc(d, kth)[kth], + tgt) # a -> array + self.assertPreciseEqual(cfunc(d.tolist(), kth)[kth], + tgt) # a -> list + self.assertPreciseEqual(cfunc(tuple(d.tolist()), kth)[kth], + tgt) # a -> tuple + + for k in kth: + self.partition_sanity_check(pyfunc, cfunc, d, k) + + def test_argpartition_fuzz(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + for j in range(10, 30): + for i in range(1, j - 2): + d = np.arange(j) + self.rnd.shuffle(d) + d = d % self.rnd.randint(2, 30) + idx = self.rnd.randint(d.size) + kth = [0, idx, i, i + 1, -idx, -i] # include negative kth's + tgt = np.argsort(d)[kth] + self.assertPreciseEqual(d[cfunc(d, kth)[kth]], + d[tgt]) # a -> array + self.assertPreciseEqual(d[cfunc(d.tolist(), kth)[kth]], + d[tgt]) # a -> list + self.assertPreciseEqual(d[cfunc(tuple(d.tolist()), kth)[kth]], + d[tgt]) # a -> tuple + + for k in kth: + self.argpartition_sanity_check(pyfunc, cfunc, d, k) + + def test_partition_exception_out_of_range(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + # Test out of range values in kth raise an error + a = np.arange(10) + + def _check(a, kth): + with self.assertRaises(ValueError) as e: + cfunc(a, kth) + assert str(e.exception) == "kth out of bounds" + + _check(a, 10) + _check(a, -11) + _check(a, (3, 30)) + + def test_argpartition_exception_out_of_range(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + # Test out of range values in kth raise an error + a = np.arange(10) + + def _check(a, kth): + with self.assertRaises(ValueError) as e: + cfunc(a, kth) + assert str(e.exception) == "kth out of bounds" + + _check(a, 10) + _check(a, -11) + _check(a, (3, 30)) + + def test_partition_exception_non_integer_kth(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check(a, kth): + with self.assertTypingError() as raises: + cfunc(a, kth) + self.assertIn("Partition index must be integer", + str(raises.exception)) + + a = np.arange(10) + _check(a, 9.0) + _check(a, (3.3, 4.4)) + _check(a, np.array((1, 2, np.nan))) + + def test_argpartition_exception_non_integer_kth(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check(a, kth): + with self.assertTypingError() as raises: + cfunc(a, kth) + self.assertIn("Partition index must be integer", + str(raises.exception)) + + a = np.arange(10) + _check(a, 9.0) + _check(a, (3.3, 4.4)) + _check(a, np.array((1, 2, np.nan))) + + def test_partition_exception_a_not_array_like(self): + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check(a, kth): + with self.assertTypingError() as raises: + cfunc(a, kth) + self.assertIn('The first argument must be an array-like', + str(raises.exception)) + + _check(4, 0) + _check('Sausages', 0) + + def test_argpartition_exception_a_not_array_like(self): + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check(a, kth): + with self.assertTypingError() as raises: + cfunc(a, kth) + self.assertIn('The first argument must be an array-like', + str(raises.exception)) + + _check(4, 0) + _check('Sausages', 0) + + def test_partition_exception_a_zero_dim(self): + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check(a, kth): + with self.assertTypingError() as raises: + cfunc(a, kth) + self.assertIn('The first argument must be at least 1-D (found 0-D)', + str(raises.exception)) + + _check(np.array(1), 0) + + def test_argpartition_exception_a_zero_dim(self): + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check(a, kth): + with self.assertTypingError() as raises: + cfunc(a, kth) + self.assertIn('The first argument must be at least 1-D (found 0-D)', + str(raises.exception)) + + _check(np.array(1), 0) + + def test_partition_exception_kth_multi_dimensional(self): + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check(a, kth): + with self.assertRaises(ValueError) as raises: + cfunc(a, kth) + self.assertIn('kth must be scalar or 1-D', str(raises.exception)) + + _check(np.arange(10), kth=np.arange(6).reshape(3, 2)) + + def test_argpartition_exception_kth_multi_dimensional(self): + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check(a, kth): + with self.assertRaises(ValueError) as raises: + cfunc(a, kth) + self.assertIn('kth must be scalar or 1-D', str(raises.exception)) + + _check(np.arange(10), kth=np.arange(6).reshape(3, 2)) + + def test_partition_empty_array(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + def check(a, kth=0): + expected = pyfunc(a, kth) + got = cfunc(a, kth) + self.assertPreciseEqual(expected, got) + + # check axis handling for multidimensional empty arrays + a = np.array([]) + a.shape = (3, 2, 1, 0) + + # include this with some other empty data structures + for arr in a, (), np.array([]): + check(arr) + + def test_argpartition_empty_array(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + def check(a, kth=0): + expected = pyfunc(a, kth) + got = cfunc(a, kth) + self.assertPreciseEqual(expected, got) + + # check axis handling for multidimensional empty arrays + a = np.array([]) + a.shape = (3, 2, 1, 0) + + # include this with some other empty data structures + for arr in a, (), np.array([]): + check(arr) + + def test_partition_basic(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + d = np.array([]) + got = cfunc(d, 0) + self.assertPreciseEqual(d, got) + + d = np.ones(1) + got = cfunc(d, 0) + self.assertPreciseEqual(d, got) + + # kth not modified + kth = np.array([30, 15, 5]) + okth = kth.copy() + cfunc(np.arange(40), kth) + self.assertPreciseEqual(kth, okth) + + for r in ([2, 1], [1, 2], [1, 1]): + d = np.array(r) + tgt = np.sort(d) + for k in 0, 1: + self.assertPreciseEqual(cfunc(d, k)[k], tgt[k]) + self.partition_sanity_check(pyfunc, cfunc, d, k) + + for r in ([3, 2, 1], [1, 2, 3], [2, 1, 3], [2, 3, 1], + [1, 1, 1], [1, 2, 2], [2, 2, 1], [1, 2, 1]): + d = np.array(r) + tgt = np.sort(d) + for k in 0, 1, 2: + self.assertPreciseEqual(cfunc(d, k)[k], tgt[k]) + self.partition_sanity_check(pyfunc, cfunc, d, k) + + d = np.ones(50) + self.assertPreciseEqual(cfunc(d, 0), d) + + # sorted + d = np.arange(49) + for k in 5, 15: + self.assertEqual(cfunc(d, k)[k], k) + self.partition_sanity_check(pyfunc, cfunc, d, k) + + # rsorted, with input flavours: array, list and tuple + d = np.arange(47)[::-1] + for a in d, d.tolist(), tuple(d.tolist()): + self.assertEqual(cfunc(a, 6)[6], 6) + self.assertEqual(cfunc(a, 16)[16], 16) + self.assertPreciseEqual(cfunc(a, -6), cfunc(a, 41)) + self.assertPreciseEqual(cfunc(a, -16), cfunc(a, 31)) + self.partition_sanity_check(pyfunc, cfunc, d, -16) + + # median of 3 killer, O(n^2) on pure median 3 pivot quickselect + # exercises the median of median of 5 code used to keep O(n) + d = np.arange(1000000) + x = np.roll(d, d.size // 2) + mid = x.size // 2 + 1 + self.assertEqual(cfunc(x, mid)[mid], mid) + d = np.arange(1000001) + x = np.roll(d, d.size // 2 + 1) + mid = x.size // 2 + 1 + self.assertEqual(cfunc(x, mid)[mid], mid) + + # max + d = np.ones(10) + d[1] = 4 + self.assertEqual(cfunc(d, (2, -1))[-1], 4) + self.assertEqual(cfunc(d, (2, -1))[2], 1) + d[1] = np.nan + assert np.isnan(cfunc(d, (2, -1))[-1]) + + # equal elements + d = np.arange(47) % 7 + tgt = np.sort(np.arange(47) % 7) + self.rnd.shuffle(d) + for i in range(d.size): + self.assertEqual(cfunc(d, i)[i], tgt[i]) + self.partition_sanity_check(pyfunc, cfunc, d, i) + + d = np.array([0, 1, 2, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 9]) + kth = [0, 3, 19, 20] + self.assertEqual(tuple(cfunc(d, kth)[kth]), (0, 3, 7, 7)) + + td = [(dt, s) for dt in [np.int32, np.float32] for s in (9, 16)] + for dt, s in td: + d = np.arange(s, dtype=dt) + self.rnd.shuffle(d) + d1 = np.tile(np.arange(s, dtype=dt), (4, 1)) + map(self.rnd.shuffle, d1) + for i in range(d.size): + p = cfunc(d, i) + self.assertEqual(p[i], i) + # all before are smaller + np.testing.assert_array_less(p[:i], p[i]) + # all after are larger + np.testing.assert_array_less(p[i], p[i + 1:]) + # sanity check + self.partition_sanity_check(pyfunc, cfunc, d, i) + + def test_argpartition_basic(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py # noqa: E501 + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + d = np.array([], dtype=np.int64) + expected = pyfunc(d, 0) + got = cfunc(d, 0) + self.assertPreciseEqual(expected, got) + + d = np.ones(1, dtype=np.int64) + expected = pyfunc(d, 0) + got = cfunc(d, 0) + self.assertPreciseEqual(expected, got) + + # kth not modified + kth = np.array([30, 15, 5]) + okth = kth.copy() + cfunc(np.arange(40), kth) + self.assertPreciseEqual(kth, okth) + + for r in ([2, 1], [1, 2], [1, 1]): + d = np.array(r) + tgt = np.argsort(d) + for k in 0, 1: + self.assertPreciseEqual(d[cfunc(d, k)[k]], d[tgt[k]]) + self.argpartition_sanity_check(pyfunc, cfunc, d, k) + + for r in ([3, 2, 1], [1, 2, 3], [2, 1, 3], [2, 3, 1], + [1, 1, 1], [1, 2, 2], [2, 2, 1], [1, 2, 1]): + d = np.array(r) + tgt = np.argsort(d) + for k in 0, 1, 2: + self.assertPreciseEqual(d[cfunc(d, k)[k]], d[tgt[k]]) + self.argpartition_sanity_check(pyfunc, cfunc, d, k) + + d = np.ones(50) + self.assertPreciseEqual(d[cfunc(d, 0)], d) + + # sorted + d = np.arange(49) + for k in 5, 15: + self.assertEqual(cfunc(d, k)[k], k) + self.partition_sanity_check(pyfunc, cfunc, d, k) + + # rsorted, with input flavours: array, list and tuple + d = np.arange(47)[::-1] + for a in d, d.tolist(), tuple(d.tolist()): + self.assertEqual(cfunc(a, 6)[6], 40) + self.assertEqual(cfunc(a, 16)[16], 30) + self.assertPreciseEqual(cfunc(a, -6), cfunc(a, 41)) + self.assertPreciseEqual(cfunc(a, -16), cfunc(a, 31)) + self.argpartition_sanity_check(pyfunc, cfunc, d, -16) + + # median of 3 killer, O(n^2) on pure median 3 pivot quickselect + # exercises the median of median of 5 code used to keep O(n) + d = np.arange(1000000) + x = np.roll(d, d.size // 2) + mid = x.size // 2 + 1 + self.assertEqual(x[cfunc(x, mid)[mid]], mid) + d = np.arange(1000001) + x = np.roll(d, d.size // 2 + 1) + mid = x.size // 2 + 1 + self.assertEqual(x[cfunc(x, mid)[mid]], mid) + + # max + d = np.ones(10) + d[1] = 4 + self.assertEqual(d[cfunc(d, (2, -1))[-1]], 4) + self.assertEqual(d[cfunc(d, (2, -1))[2]], 1) + d[1] = np.nan + assert np.isnan(d[cfunc(d, (2, -1))[-1]]) + + # equal elements + d = np.arange(47) % 7 + tgt = np.sort(np.arange(47) % 7) + self.rnd.shuffle(d) + for i in range(d.size): + self.assertEqual(d[cfunc(d, i)[i]], tgt[i]) + self.argpartition_sanity_check(pyfunc, cfunc, d, i) + + d = np.array([0, 1, 2, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 9]) + kth = [0, 3, 19, 20] + self.assertEqual(tuple(d[cfunc(d, kth)[kth]]), (0, 3, 7, 7)) + + td = [(dt, s) for dt in [np.int32, np.float32] for s in (9, 16)] + for dt, s in td: + d = np.arange(s, dtype=dt) + self.rnd.shuffle(d) + d1 = np.tile(np.arange(s, dtype=dt), (4, 1)) + map(self.rnd.shuffle, d1) + for i in range(d.size): + p = d[cfunc(d, i)] + self.assertEqual(p[i], i) + # all before are smaller + np.testing.assert_array_less(p[:i], p[i]) + # all after are larger + np.testing.assert_array_less(p[i], p[i + 1:]) + # sanity check + self.argpartition_sanity_check(pyfunc, cfunc, d, i) + + def assert_partitioned(self, pyfunc, cfunc, d, kth): + prev = 0 + for k in np.sort(kth): + np.testing.assert_array_less(d[prev:k], d[k], + err_msg='kth %d' % k) + self.assertTrue((d[k:] >= d[k]).all(), + msg=("kth %d, %r not greater equal " + "%d" % (k, d[k:], d[k]))) + prev = k + 1 + self.partition_sanity_check(pyfunc, cfunc, d, k) + + def assert_argpartitioned(self, pyfunc, cfunc, d, kth): + prev = 0 + for k in np.sort(kth): + np.testing.assert_array_less(d[prev:k], d[k], + err_msg='kth %d' % k) + self.assertTrue((d[k:] >= d[k]).all(), + msg=("kth %d, %r not greater equal " + "%d" % (k, d[k:], d[k]))) + prev = k + 1 + self.argpartition_sanity_check(pyfunc, cfunc, d, k) + + def test_partition_iterative(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + assert_partitioned = partial(self.assert_partitioned, pyfunc, cfunc) + + d = np.array([3, 4, 2, 1]) + p = cfunc(d, (0, 3)) + assert_partitioned(p, (0, 3)) + assert_partitioned(d[np.argpartition(d, (0, 3))], (0, 3)) + + self.assertPreciseEqual(p, cfunc(d, (-3, -1))) + + d = np.arange(17) + self.rnd.shuffle(d) + self.assertPreciseEqual(np.arange(17), cfunc(d, list(range(d.size)))) + + # test unsorted kth + d = np.arange(17) + self.rnd.shuffle(d) + keys = np.array([1, 3, 8, -2]) + self.rnd.shuffle(d) + p = cfunc(d, keys) + assert_partitioned(p, keys) + self.rnd.shuffle(keys) + self.assertPreciseEqual(cfunc(d, keys), p) + + # equal kth + d = np.arange(20)[::-1] + assert_partitioned(cfunc(d, [5] * 4), [5]) + assert_partitioned(cfunc(d, [5] * 4 + [6, 13]), [5] * 4 + [6, 13]) + + def test_argpartition_iterative(self): + # inspired by the test of the same name in: + # https://github.com/numpy/numpy/blob/043a840/numpy/core/tests/test_multiarray.py + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + assert_argpartitioned = partial(self.assert_argpartitioned, + pyfunc, + cfunc) + + d = np.array([3, 4, 2, 1]) + p = d[cfunc(d, (0, 3))] + assert_argpartitioned(p, (0, 3)) + assert_argpartitioned(d[np.argpartition(d, (0, 3))], (0, 3)) + + self.assertPreciseEqual(p, d[cfunc(d, (-3, -1))]) + + d = np.arange(17) + self.rnd.shuffle(d) + self.assertPreciseEqual(np.arange(17), d[cfunc(d, list(range(d.size)))]) + + # test unsorted kth + d = np.arange(17) + self.rnd.shuffle(d) + keys = np.array([1, 3, 8, -2]) + self.rnd.shuffle(d) + p = d[cfunc(d, keys)] + assert_argpartitioned(p, keys) + self.rnd.shuffle(keys) + self.assertPreciseEqual(d[cfunc(d, keys)], p) + + # equal kth + d = np.arange(20)[::-1] + assert_argpartitioned(d[cfunc(d, [5] * 4)], [5]) + assert_argpartitioned(d[cfunc(d, [5] * 4 + [6, 13])], [5] * 4 + [6, 13]) + + def test_partition_multi_dim(self): + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + def check(a, kth): + expected = pyfunc(a, kth) + got = cfunc(a, kth) + self.assertPreciseEqual(expected[:, :, kth], got[:, :, kth]) + + for s in np.ndindex(expected.shape[:-1]): + self.assertPreciseEqual(np.unique(expected[s][:kth]), + np.unique(got[s][:kth])) + self.assertPreciseEqual(np.unique(expected[s][kth:]), + np.unique(got[s][kth:])) + + def a_variations(a): + yield a + yield a.T + yield np.asfortranarray(a) + yield np.full_like(a, fill_value=np.nan) + yield np.full_like(a, fill_value=np.inf) + # multi-dimensional tuple input + yield (((1.0, 3.142, -np.inf, 3),),) + + a = np.linspace(1, 10, 48) + a[4:7] = np.nan + a[8] = -np.inf + a[9] = np.inf + a = a.reshape((4, 3, 4)) + + for arr in a_variations(a): + for k in range(-3, 3): + check(arr, k) + + def test_argpartition_multi_dim(self): + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + def check(a, kth): + expected = pyfunc(a, kth) + got = cfunc(a, kth) + a = np.asarray(a) + idx = np.ndindex(a.shape[:-1]) + for s in idx: + self.assertPreciseEqual(a[s][expected[s][kth]], + a[s][got[s][kth]]) + + for s in np.ndindex(expected.shape[:-1]): + self.assertPreciseEqual(np.unique(a[s][expected[s][:kth]]), + np.unique(a[s][got[s][:kth]])) + self.assertPreciseEqual(np.unique(a[s][expected[s][kth:]]), + np.unique(a[s][got[s][kth:]])) + + def a_variations(a): + yield a + yield a.T + yield np.asfortranarray(a) + yield np.full_like(a, fill_value=np.nan) + yield np.full_like(a, fill_value=np.inf) + # multi-dimensional tuple input + yield (((1.0, 3.142, -np.inf, 3),),) + + a = np.linspace(1, 10, 48) + a[4:7] = np.nan + a[8] = -np.inf + a[9] = np.inf + a = a.reshape((4, 3, 4)) + + for arr in a_variations(a): + for k in range(-3, 3): + check(arr, k) + + def test_partition_boolean_inputs(self): + pyfunc = partition + cfunc = jit(nopython=True)(pyfunc) + + for d in np.linspace(1, 10, 17), np.array((True, False, True)): + for kth in True, False, -1, 0, 1: + self.partition_sanity_check(pyfunc, cfunc, d, kth) + + def test_argpartition_boolean_inputs(self): + pyfunc = argpartition + cfunc = jit(nopython=True)(pyfunc) + + for d in np.linspace(1, 10, 17), np.array((True, False, True)): + for kth in True, False, -1, 0, 1: + self.argpartition_sanity_check(pyfunc, cfunc, d, kth) + + @needs_blas + def test_cov_invalid_ddof(self): + pyfunc = cov + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + m = np.array([[0, 2], [1, 1], [2, 0]]).T + + for ddof in np.arange(4), 4j: + with self.assertTypingError() as raises: + cfunc(m, ddof=ddof) + self.assertIn('ddof must be a real numerical scalar type', + str(raises.exception)) + + for ddof in np.nan, np.inf: + with self.assertRaises(ValueError) as raises: + cfunc(m, ddof=ddof) + self.assertIn('Cannot convert non-finite ddof to integer', + str(raises.exception)) + + for ddof in 1.1, -0.7: + with self.assertRaises(ValueError) as raises: + cfunc(m, ddof=ddof) + self.assertIn('ddof must be integral value', str(raises.exception)) + + def corr_corrcoef_basic(self, pyfunc, first_arg_name): + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc, abs_tol=1e-14) + + def input_variations(): + # array inputs + yield np.array([[0, 2], [1, 1], [2, 0]]).T + yield self.rnd.randn(100).reshape(5, 20) + yield np.asfortranarray(np.array([[0, 2], [1, 1], [2, 0]]).T) + yield self.rnd.randn(100).reshape(5, 20)[:, ::2] + yield np.array([0.3942, 0.5969, 0.7730, 0.9918, 0.7964]) + yield np.full((4, 5), fill_value=True) + yield np.array([np.nan, 0.5969, -np.inf, 0.9918, 0.7964]) + yield np.linspace(-3, 3, 33).reshape(33, 1) + + # non-array inputs + yield ((0.1, 0.2), (0.11, 0.19), (0.09, 0.21)) # UniTuple + yield ((0.1, 0.2), (0.11, 0.19), (0.09j, 0.21j)) # Tuple + yield (-2.1, -1, 4.3) + yield (1, 2, 3) + yield [4, 5, 6] + yield ((0.1, 0.2, 0.3), (0.1, 0.2, 0.3)) + yield [(1, 2, 3), (1, 3, 2)] + yield 3.142 + yield ((1.1, 2.2, 1.5),) + + # empty data structures + yield np.array([]) + yield np.array([]).reshape(0, 2) + yield np.array([]).reshape(2, 0) + yield () + + # all inputs other than the first are defaulted + for input_arr in input_variations(): + _check({first_arg_name: input_arr}) + + @needs_blas + def test_corrcoef_basic(self): + pyfunc = corrcoef + self.corr_corrcoef_basic(pyfunc, first_arg_name='x') + + @needs_blas + def test_cov_basic(self): + pyfunc = cov + self.corr_corrcoef_basic(pyfunc, first_arg_name='m') + + @needs_blas + def test_cov_explicit_arguments(self): + pyfunc = cov + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc, abs_tol=1e-14) + + m = self.rnd.randn(105).reshape(15, 7) + y_choices = None, m[::-1] + rowvar_choices = False, True + bias_choices = False, True + ddof_choice = None, -1, 0, 1, 3.0, True + + products = itertools.product(y_choices, rowvar_choices, + bias_choices, ddof_choice) + for y, rowvar, bias, ddof in products: + params = {'m': m, 'y': y, 'ddof': ddof, + 'bias': bias, 'rowvar': rowvar} + _check(params) + + @needs_blas + def test_corrcoef_explicit_arguments(self): + pyfunc = corrcoef + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc, abs_tol=1e-14) + + x = self.rnd.randn(105).reshape(15, 7) + y_choices = None, x[::-1] + rowvar_choices = False, True + + for y, rowvar in itertools.product(y_choices, rowvar_choices): + params = {'x': x, 'y': y, 'rowvar': rowvar} + _check(params) + + def cov_corrcoef_edge_cases(self, pyfunc, first_arg_name): + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc, abs_tol=1e-14) + + # some of these examples borrowed from numpy doc string examples: + # https://github.com/numpy/numpy/blob/v1.15.0/numpy/lib/function_base.py#L2199-L2231 # noqa: E501 + # some borrowed from TestCov and TestCorrCoef: + # https://github.com/numpy/numpy/blob/80d3a7a/numpy/lib/tests/test_function_base.py # noqa: E501 + m = np.array([-2.1, -1, 4.3]) + y = np.array([3, 1.1, 0.12]) + params = {first_arg_name: m, 'y': y} + _check(params) + + m = np.array([1, 2, 3]) # test case modified such that m is 1D + y = np.array([[1j, 2j, 3j]]) + params = {first_arg_name: m, 'y': y} + _check(params) + + m = np.array([1, 2, 3]) + y = (1j, 2j, 3j) + params = {first_arg_name: m, 'y': y} + _check(params) + params = {first_arg_name: y, 'y': m} # flip real and complex inputs + _check(params) + + m = np.array([1, 2, 3]) + y = (1j, 2j, 3) # note last item is not complex + params = {first_arg_name: m, 'y': y} + _check(params) + params = {first_arg_name: y, 'y': m} # flip real and complex inputs + _check(params) + + m = np.array([]) + y = np.array([]) + params = {first_arg_name: m, 'y': y} + _check(params) + + m = 1.1 + y = 2.2 + params = {first_arg_name: m, 'y': y} + _check(params) + + m = self.rnd.randn(10, 3) + y = np.array([-2.1, -1, 4.3]).reshape(1, 3) / 10 + params = {first_arg_name: m, 'y': y} + _check(params) + + m = np.array([-2.1, -1, 4.3]) + y = np.array([[3, 1.1, 0.12], [3, 1.1, 0.12]]) + params = {first_arg_name: m, 'y': y} + _check(params) + + for rowvar in False, True: + m = np.array([-2.1, -1, 4.3]) + y = np.array([[3, 1.1, 0.12], [3, 1.1, 0.12], [4, 1.1, 0.12]]) + params = {first_arg_name: m, 'y': y, 'rowvar': rowvar} + _check(params) + # swap m and y + params = {first_arg_name: y, 'y': m, 'rowvar': rowvar} + _check(params) + + @needs_blas + def test_corrcoef_edge_cases(self): + pyfunc = corrcoef + self.cov_corrcoef_edge_cases(pyfunc, first_arg_name='x') + + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc, abs_tol=1e-14) + + for x in (np.nan, -np.inf, 3.142, 0): + params = {'x': x} + _check(params) + + @needs_blas + def test_corrcoef_edge_case_extreme_values(self): + pyfunc = corrcoef + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc, abs_tol=1e-14) + + # extreme values + x = ((1e-100, 1e100), (1e100, 1e-100)) + params = {'x': x} + _check(params) + + @needs_blas + def test_cov_edge_cases(self): + pyfunc = cov + self.cov_corrcoef_edge_cases(pyfunc, first_arg_name='m') + + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc, abs_tol=1e-14) + + # invalid ddof + m = np.array([[0, 2], [1, 1], [2, 0]]).T + params = {'m': m, 'ddof': 5} + _check(params) + + @needs_blas + def test_cov_exceptions(self): + pyfunc = cov + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def _check_m(m): + with self.assertTypingError() as raises: + cfunc(m) + self.assertIn('m has more than 2 dimensions', str(raises.exception)) + + m = np.ones((5, 6, 7)) + _check_m(m) + + m = ((((1, 2, 3), (2, 2, 2)),),) + _check_m(m) + + m = [[[5, 6, 7]]] + _check_m(m) + + def _check_y(m, y): + with self.assertTypingError() as raises: + cfunc(m, y=y) + self.assertIn('y has more than 2 dimensions', str(raises.exception)) + + m = np.ones((5, 6)) + y = np.ones((5, 6, 7)) + _check_y(m, y) + + m = np.array((1.1, 2.2, 1.1)) + y = (((1.2, 2.2, 2.3),),) + _check_y(m, y) + + m = np.arange(3) + y = np.arange(4) + with self.assertRaises(ValueError) as raises: + cfunc(m, y=y) + self.assertIn('m and y have incompatible dimensions', + str(raises.exception)) + # Numpy raises ValueError: all the input array dimensions except for the + # concatenation axis must match exactly. + + m = np.array([-2.1, -1, 4.3]).reshape(1, 3) + with self.assertRaises(RuntimeError) as raises: + cfunc(m) + self.assertIn('2D array containing a single row is unsupported', + str(raises.exception)) + + def test_ediff1d_basic(self): + pyfunc = ediff1d + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + def to_variations(a): + yield None + yield a + yield a.astype(np.int16) + + def ary_variations(a): + yield a + yield a.reshape(3, 2, 2) + yield a.astype(np.int32) + + for ary in ary_variations(np.linspace(-2, 7, 12)): + params = {'ary': ary} + _check(params) + + for a in to_variations(ary): + params = {'ary': ary, 'to_begin': a} + _check(params) + + params = {'ary': ary, 'to_end': a} + _check(params) + + for b in to_variations(ary): + params = {'ary': ary, 'to_begin': a, 'to_end': b} + _check(params) + + def test_ediff1d_exceptions(self): + pyfunc = ediff1d + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertTypingError() as e: + cfunc(np.array((True, True, False))) + + msg = "Boolean dtype is unsupported (as per NumPy)" + assert msg in str(e.exception) + + def test_fliplr_basic(self): + pyfunc = fliplr + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield np.arange(10).reshape(5, 2) + yield np.arange(20).reshape(5, 2, 2) + yield ((1, 2),) + yield ([1, 2], [3, 4],) + + for a in a_variations(): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + with self.assertRaises(TypingError) as raises: + cfunc("abc") + + self.assertIn("Cannot np.fliplr on %s type" % types.unicode_type, + str(raises.exception)) + + def test_fliplr_exception(self): + pyfunc = fliplr + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc(np.arange(3)) + + self.assertIn("cannot index array", str(raises.exception)) + self.assertIn("with 2 indices", str(raises.exception)) + + def test_flipud_basic(self): + pyfunc = flipud + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield [1] + yield np.arange(10) + yield np.arange(10).reshape(5, 2) + yield np.arange(20).reshape(5, 2, 2) + yield ((1, 2),) + yield ([1, 2], [3, 4],) + + for a in a_variations(): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + with self.assertRaises(TypingError) as raises: + cfunc("abc") + + self.assertIn("Cannot np.flipud on %s type" % types.unicode_type, + str(raises.exception)) + + def test_flipud_exception(self): + pyfunc = flipud + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc(1) + + self.assertIn("cannot index array", str(raises.exception)) + self.assertIn("with 1 indices", str(raises.exception)) + + def test_flip_basic(self): + pyfunc = flip + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield np.array(1) + yield np.arange(10) + yield np.arange(10).reshape(5, 2) + yield np.arange(20).reshape(5, 2, 2) + + for a in a_variations(): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + with self.assertRaises(TypingError) as raises: + cfunc((1, 2, 3)) + + self.assertIn("Cannot np.flip on UniTuple", str(raises.exception)) + + def test_logspace2_basic(self): + + def inputs(): + #start, stop + yield 1, 60 + yield -1, 60 + yield -60, -1 + yield -1, -60 + yield 60, -1 + yield 1.0, 60.0 + yield -60.0, -1.0 + yield -1.0, 60.0 + yield 0.0, np.e + yield 0.0, np.pi + if numpy_version < (2, 0): + yield np.complex64(1), np.complex64(2) + yield np.complex64(2j), np.complex64(4j) + yield np.complex64(2), np.complex64(4j) + yield np.complex64(1 + 2j), np.complex64(3 + 4j) + yield np.complex64(1 - 2j), np.complex64(3 - 4j) + yield np.complex64(-1 + 2j), np.complex64(3 + 4j) + + pyfunc = logspace2 + cfunc = jit(nopython=True)(pyfunc) + + for start, stop in inputs(): + np.testing.assert_allclose(pyfunc(start, stop), cfunc(start, stop)) + + def test_logspace2_exception(self): + cfunc = jit(nopython=True)(logspace2) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc", 5) + self.assertIn('The first argument "start" must be a number', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(5, "abc") + self.assertIn('The second argument "stop" must be a number', + str(raises.exception)) + + def test_logspace3_basic(self): + + def inputs(): + #start, stop + yield 1, 60 + yield -1, 60 + yield -60, -1 + yield -1, -60 + yield 60, -1 + yield 1.0, 60.0 + yield -60.0, -1.0 + yield -1.0, 60.0 + yield 0.0, np.e + yield 0.0, np.pi + if numpy_version < (2, 0): + yield np.complex64(1), np.complex64(2) + yield np.complex64(2j), np.complex64(4j) + yield np.complex64(2), np.complex64(4j) + yield np.complex64(1 + 2j), np.complex64(3 + 4j) + yield np.complex64(1 - 2j), np.complex64(3 - 4j) + yield np.complex64(-1 + 2j), np.complex64(3 + 4j) + + pyfunc = logspace3 + cfunc = jit(nopython=True)(pyfunc) + + for start, stop in inputs(): + np.testing.assert_allclose(pyfunc(start, stop), cfunc(start, stop)) + + def test_logspace3_with_num_basic(self): + + def inputs(): + #start, stop, num + yield 1, 60, 20 + yield -1, 60, 30 + yield -60, -1, 40 + yield -1, -60, 50 + yield 60, -1, 60 + yield 1.0, 60.0, 70 + yield -60.0, -1.0, 80 + yield -1.0, 60.0, 90 + yield 0.0, np.e, 20 + yield 0.0, np.pi, 30 + if numpy_version < (2, 0): + yield np.complex64(1), np.complex64(2), 40 + yield np.complex64(2j), np.complex64(4j), 50 + yield np.complex64(2), np.complex64(4j), 60 + yield np.complex64(1 + 2j), np.complex64(3 + 4j), 70 + yield np.complex64(1 - 2j), np.complex64(3 - 4j), 80 + yield np.complex64(-1 + 2j), np.complex64(3 + 4j), 90 + + pyfunc = logspace3 + cfunc = jit(nopython=True)(pyfunc) + + for start, stop, num in inputs(): + np.testing.assert_allclose(pyfunc(start, stop, num), + cfunc(start, stop, num)) + + def test_logspace3_exception(self): + cfunc = jit(nopython=True)(logspace3) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc", 5) + self.assertIn('The first argument "start" must be a number', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(5, "abc") + self.assertIn('The second argument "stop" must be a number', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(0, 5, "abc") + self.assertIn('The third argument "num" must be an integer', + str(raises.exception)) + + def test_geomspace2_basic(self): + + def inputs(): + #start, stop + yield -1, -60 + yield 1.0, 60.0 + yield -60.0, -1.0 + yield 1, 1000 + yield 1000, 1 + yield 1, 256 + yield -1000, -1 + yield -1, np.complex64(2j) + yield np.complex64(2j), -1 + yield -1.0, np.complex64(2j) + yield np.complex64(1j), np.complex64(1000j) + yield np.complex64(-1 + 0j), np.complex64(1 + 0j) + yield np.complex64(1), np.complex64(2) + yield np.complex64(2j), np.complex64(4j) + yield np.complex64(2), np.complex64(4j) + yield np.complex64(1 + 2j), np.complex64(3 + 4j) + yield np.complex64(1 - 2j), np.complex64(3 - 4j) + yield np.complex64(-1 + 2j), np.complex64(3 + 4j) + + pyfunc = geomspace2 + cfunc = jit(nopython=True)(pyfunc) + + for start, stop in inputs(): + self.assertPreciseEqual(pyfunc(start, stop), + cfunc(start, stop), + abs_tol=1e-12) + + def test_geomspace2_exception(self): + cfunc = jit(nopython=True)(geomspace2) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc", 5) + self.assertIn('The argument "start" must be a number', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(5, "abc") + self.assertIn('The argument "stop" must be a number', + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc(0, 5) + self.assertIn('Geometric sequence cannot include zero', + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc(5, 0) + self.assertIn('Geometric sequence cannot include zero', + str(raises.exception)) + + def test_geomspace3_basic(self): + + def inputs(): + #start, stop, num + yield -1, -60, 50 + yield 1.0, 60.0, 70 + yield -60.0, -1.0, 80 + yield 1, 1000, 4 + yield 1, 1000, 3 + yield 1000, 1, 4 + yield 1, 256, 9 + yield -1000, -1, 4 + yield -1, np.complex64(2j), 10 + yield np.complex64(2j), -1, 20 + yield -1.0, np.complex64(2j), 30 + yield np.complex64(1j), np.complex64(1000j), 4 + yield np.complex64(-1 + 0j), np.complex64(1 + 0j), 5 + yield np.complex64(1), np.complex64(2), 40 + yield np.complex64(2j), np.complex64(4j), 50 + yield np.complex64(2), np.complex64(4j), 60 + yield np.complex64(1 + 2j), np.complex64(3 + 4j), 70 + yield np.complex64(1 - 2j), np.complex64(3 - 4j), 80 + yield np.complex64(-1 + 2j), np.complex64(3 + 4j), 90 + + pyfunc = geomspace3 + cfunc = jit(nopython=True)(pyfunc) + + for start, stop, num in inputs(): + self.assertPreciseEqual(pyfunc(start, stop, num), + cfunc(start, stop, num), + abs_tol=1e-14) + + def test_geomspace3_exception(self): + cfunc = jit(nopython=True)(geomspace3) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc", 5, 10) + self.assertIn('The argument "start" must be a number', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(5, "abc", 10) + self.assertIn('The argument "stop" must be a number', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(5, 10, "abc") + self.assertIn('The argument "num" must be an integer', + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc(0, 5, 5) + self.assertIn('Geometric sequence cannot include zero', + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc(5, 0, 5) + self.assertIn('Geometric sequence cannot include zero', + str(raises.exception)) + + def test_geomspace_numpy(self): + cfunc2 = jit(nopython=True)(geomspace2) + cfunc3 = jit(nopython=True)(geomspace3) + pfunc3 = geomspace3 + + # https://github.com/numpy/numpy/blob/ab2178b47c0ee834180c318db196976623710691/numpy/core/tests/test_function_base.py#L122C3-L142 + # test_basic + y = cfunc2(1, 1e6) + self.assertEqual(len(y), 50) + y = cfunc3(1, 1e6, num=100) + self.assertEqual(y[-1], 10 ** 6) + y = cfunc3(1, 1e6, num=7) + self.assertPreciseEqual(y, pfunc3(1,1e6, num=7)) + + y = cfunc3(8, 2, num=3) + self.assertPreciseEqual(y, pfunc3(8, 2, num=3)) + self.assertTrue([x == 0 for x in y.imag]) + + y = cfunc3(-1, -100, num=3) + self.assertPreciseEqual(y, pfunc3(-1, -100, num=3)) + self.assertTrue([x == 0 for x in y.imag]) + + y = cfunc3(-100, -1, num=3) + self.assertPreciseEqual(y, pfunc3(-100, -1, num=3)) + self.assertTrue([x == 0 for x in y.imag]) + + # test_boundaries_match_start_and_stop_exactly + start = 0.3 + stop = 20.3 + + y = cfunc3(start, stop, num=1) + self.assertPreciseEqual(y[0], start) + + y = cfunc3(start, stop, num=3) + self.assertPreciseEqual(y[0], start) + self.assertPreciseEqual(y[-1], stop) + + # test_nan_interior + with np.errstate(invalid='ignore'): + y = cfunc3(-3, 3, num=4) + + self.assertPreciseEqual(y[0], -3.0) + self.assertTrue(np.isnan(y[1:-1]).all()) + self.assertPreciseEqual(y[3], 3.0) + + # test_complex + # Purely imaginary + y = cfunc3(1j, 16j, num=5) + self.assertPreciseEqual(y, pfunc3(1j, 16j, num=5), abs_tol=1e-14) + self.assertTrue([x == 0 for x in y.real]) + + y = cfunc3(-4j, -324j, num=5) + self.assertPreciseEqual(y, pfunc3(-4j, -324j, num=5), abs_tol=1e-13) + self.assertTrue([x == 0 for x in y.real]) + + y = cfunc3(1 + 1j, 1000 + 1000j, num=4) + self.assertPreciseEqual(y, + pfunc3(1 + 1j, 1000 + 1000j, num=4), + abs_tol=1e-13) + + y = cfunc3(-1 + 1j, -1000 + 1000j, num=4) + self.assertPreciseEqual(y, + pfunc3(-1 + 1j, -1000 + 1000j, num=4), + abs_tol=1e-13) + + # Logarithmic spirals + if numpy_version < (2, 0): + y = cfunc3(-1 + 0j, 1 + 0j, num=3) + self.assertPreciseEqual(y, pfunc3(-1 + 0j, 1 + 0j, num=3)) + + y = cfunc3(0 + 3j, -3 + 0j, 3) + self.assertPreciseEqual(y, pfunc3(0 + 3j, -3 + 0j, 3), abs_tol=1e-15) + y = cfunc3(0 + 3j, 3 + 0j, 3) + self.assertPreciseEqual(y, pfunc3(0 + 3j, 3 + 0j, 3), abs_tol=1e-15) + y = cfunc3(-3 + 0j, 0 - 3j, 3) + self.assertPreciseEqual(y, pfunc3(-3 + 0j, 0 - 3j, 3), abs_tol=1e-15) + y = cfunc3(0 + 3j, -3 + 0j, 3) + self.assertPreciseEqual(y, pfunc3(0 + 3j, -3 + 0j, 3), abs_tol=1e-15) + y = cfunc3(-2 - 3j, 5 + 7j, 7) + self.assertPreciseEqual(y, pfunc3(-2 - 3j, 5 + 7j, 7), abs_tol=1e-14) + + y = cfunc3(3j, -5, 2) + self.assertPreciseEqual(y, pfunc3(3j, -5, 2)) + y = cfunc3(-5, 3j, 2) + self.assertPreciseEqual(y, pfunc3(-5, 3j, 2)) + + def test_rot90_basic(self): + pyfunc = rot90 + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield np.arange(10).reshape(5, 2) + yield np.arange(20).reshape(5, 2, 2) + yield np.arange(64).reshape(2, 2, 2, 2, 2, 2) + + for a in a_variations(): + expected = pyfunc(a) + got = cfunc(a) + self.assertPreciseEqual(expected, got) + + def test_rot90_with_k_basic(self): + pyfunc = rot90_k + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield np.arange(10).reshape(5, 2) + yield np.arange(20).reshape(5, 2, 2) + yield np.arange(64).reshape(2, 2, 2, 2, 2, 2) + + for a in a_variations(): + for k in range(-5, 6): + expected = pyfunc(a, k) + got = cfunc(a, k) + self.assertPreciseEqual(expected, got) + + def test_rot90_exception(self): + pyfunc = rot90_k + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc") + + self.assertIn('The first argument "m" must be an array', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(np.arange(4).reshape(2, 2), k="abc") + + self.assertIn('The second argument "k" must be an integer', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(np.arange(3)) + + self.assertIn("Input must be >= 2-d.", str(raises.exception)) + + def _check_split(self, func): + # Since np.split and np.array_split are very similar + pyfunc = func + cfunc = jit(nopython=True)(pyfunc) + + def args_variations(): + a = np.arange(100) + yield a, 2 + yield a, 2, 0 + yield a, [1, 4, 72] + yield list(a), [1, 4, 72] + yield tuple(a), [1, 4, 72] + yield a, [1, 4, 72], 0 + yield list(a), [1, 4, 72], 0 + yield tuple(a), [1, 4, 72], 0 + + a = np.arange(64).reshape(4, 4, 4) + yield a, 2 + yield a, 2, 0 + yield a, 2, 1 + yield a, [2, 1, 5] + yield a, [2, 1, 5], 1 + yield a, [2, 1, 5], 2 + yield a, [1, 3] + yield a, [1, 3], 1 + yield a, [1, 3], 2 + yield a, [1], -1 + yield a, [1], -2 + yield a, [1], -3 + yield a, np.array([], dtype=np.int64), 0 + + a = np.arange(100).reshape(2, -1) + yield a, 1 + yield a, 1, 0 + yield a, [1], 0 + yield a, 50, 1 + yield a, np.arange(10, 50, 10), 1 + yield a, (1,) + yield a, (np.int32(4), 10) + + a = np.array([]) + yield a, 1 + yield a, 2 + yield a, (2, 3), 0 + yield a, 1, 0 + + a = np.array([[]]) + yield a, 1 + yield a, (2, 3), 1 + yield a, 1, 0 + yield a, 1, 1 + + for args in args_variations(): + expected = pyfunc(*args) + got = cfunc(*args) + + np.testing.assert_equal(expected, list(got)) + + def _check_array_split(self, func): + # array_split specific checks, mainly dealing with `int`s + pyfunc = func + cfunc = jit(nopython=True)(pyfunc) + + def args_variations(): + yield np.arange(8), 3 + yield list(np.arange(8)), 3 + yield tuple(np.arange(8)), 3 + yield np.arange(24).reshape(12, 2), 5 + + for args in args_variations(): + expected = pyfunc(*args) + got = cfunc(*args) + + np.testing.assert_equal(expected, list(got)) + + def test_array_split_basic(self): + self._check_split(array_split) + self._check_array_split(array_split) + + def test_split_basic(self): + self._check_split(split) + + self.disable_leak_check() # The exception leaks + with self.assertRaises(ValueError) as raises: + njit(split)(np.ones(5), 2) + self.assertIn( + "array split does not result in an equal division", + str(raises.exception) + ) + + with self.assertRaises(ValueError) as raises: + njit(split)(np.ones(5), [3], axis=-3) + self.assertIn("np.split: Argument axis out of bounds", + str(raises.exception)) + + def test_vhdsplit_basic(self): + # split and array_split have more comprehensive tests of splitting. + # only do simple tests on vsplit, hsplit and dsplit + # Based on tests from https://github.com/numpy/numpy/blob/f0befec40376fc46fdaceac2c49c7349ad671bde/numpy/lib/tests/test_shape_base.py#L538-L624 # noqa: E501 + def inputs1D(): + # test_1D_array + yield np.array([1, 2, 3, 4]), 2 + yield np.array([1., 2., 3., 4.]), 2 + + def inputs2D(): + # test_2D_array + yield np.array([[1, 2, 3, 4], [1, 2, 3, 4]]), 2 + yield np.array([[1., 2., 3., 4.], [1., 2., 3., 4.]]), 2 + yield np.arange(16.0).reshape(4, 4), 2 + yield np.arange(16.0).reshape(4, 4), np.array([3, 6]) + yield np.arange(16.0).reshape(4, 4), [3, 6] + yield np.arange(16.0).reshape(4, 4), (3, 6) + yield np.arange(8.0).reshape(2, 2, 2), 2 + + def inputs3D(): + # test_3D_array + np.array([[[1, 2, 3, 4], + [1, 2, 3, 4]], + [[1, 2, 3, 4], + [1, 2, 3, 4]]]), 2 + yield np.arange(16.0).reshape(2, 2, 4), 2 + yield np.arange(16.0).reshape(2, 2, 4), np.array([3, 6]) + yield np.arange(16.0).reshape(2, 2, 4), [3, 6] + yield np.arange(16.0).reshape(2, 2, 4), (3, 6) + yield np.arange(8.0).reshape(2, 2, 2), 2 + + inputs = [inputs1D(), inputs2D(), inputs3D()] + for (f, mindim, name) in [(vsplit, 2, "vsplit"), + (hsplit, 1, "hsplit"), + (dsplit, 3, "dsplit")]: + pyfunc = f + cfunc = njit(pyfunc) + for i in range(mindim, 4): + for a, ind_or_sec in inputs[i - 1]: + self.assertPreciseEqual(pyfunc(a, ind_or_sec), + cfunc(a, ind_or_sec)) + + def test_vhdsplit_exception(self): + # Single test method for vsplit, hsplit and dsplit exceptions + for (f, mindim, name) in [(vsplit, 2, "vsplit"), + (hsplit, 1, "hsplit"), + (dsplit, 3, "dsplit")]: + cfunc = jit(nopython=True)(f) + self.disable_leak_check() + with self.assertRaises(TypingError) as raises: + cfunc(1, 2) + self.assertIn('The argument "ary" must be an array', + str(raises.exception)) + with self.assertRaises(TypingError) as raises: + cfunc("abc", 2) + self.assertIn('The argument "ary" must be an array', + str(raises.exception)) + with self.assertRaises(TypingError) as raises: + cfunc(np.array([[1, 2, 3, 4], [1, 2, 3, 4]]), "abc") + self.assertIn(('The argument "indices_or_sections" must be int or ' + '1d-array'), + str(raises.exception)) + with self.assertRaises(ValueError) as raises: + cfunc(np.array(1), 2) + self.assertIn(name + ' only works on arrays of ' + str(mindim) + + ' or more dimensions', + str(raises.exception)) + + def test_roll_basic(self): + pyfunc = roll + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield np.arange(7) + yield np.arange(3 * 4 * 5).reshape(3, 4, 5) + yield [1.1, 2.2, 3.3] + yield (True, False, True) + yield False + yield 4 + yield (9,) + yield np.asfortranarray(np.array([[1.1, np.nan], [np.inf, 7.8]])) + yield np.array([]) + yield () + + def shift_variations(): + return itertools.chain.from_iterable(((True, False), + range(-10, 10))) + + for a in a_variations(): + for shift in shift_variations(): + expected = pyfunc(a, shift) + got = cfunc(a, shift) + self.assertPreciseEqual(expected, got) + + def test_roll_exceptions(self): + pyfunc = roll + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + for shift in 1.1, (1, 2): + with self.assertTypingError() as e: + cfunc(np.arange(10), shift) + + msg = "shift must be an integer" + assert msg in str(e.exception) + + def test_extract_basic(self): + pyfunc = extract + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + a = np.arange(10) + self.rnd.shuffle(a) + for threshold in range(-3, 13): + cond = a > threshold + _check({'condition': cond, 'arr': a}) + + a = np.arange(60).reshape(4, 5, 3) + cond = a > 11.2 + _check({'condition': cond, 'arr': a}) + + a = ((1, 2, 3), (3, 4, 5), (4, 5, 6)) + cond = np.eye(3).flatten() + _check({'condition': cond, 'arr': a}) + + a = [1.1, 2.2, 3.3, 4.4] + cond = [1, 1, 0, 1] + _check({'condition': cond, 'arr': a}) + + a = np.linspace(-2, 10, 6) + element_pool = (True, False, np.nan, -1, -1.0, -1.2, 1, 1.0, 1.5j) + for cond in itertools.combinations_with_replacement(element_pool, 4): + _check({'condition': cond, 'arr': a}) + _check({'condition': np.array(cond).reshape(2, 2), 'arr': a}) + + a = np.array([1, 2, 3]) + cond = np.array([]) + _check({'condition': cond, 'arr': a}) + + a = np.array([1, 2, 3]) + cond = np.array([1, 0, 1, 0]) # but [1, 0, 1, 0, 1] raises + _check({'condition': cond, 'arr': a}) + + a = np.array([[1, 2, 3], [4, 5, 6]]) + cond = [1, 0, 1, 0, 1, 0] # but [1, 0, 1, 0, 1, 0, 1] raises + _check({'condition': cond, 'arr': a}) + + a = np.array([[1, 2, 3], [4, 5, 6]]) + cond = np.array([1, 0, 1, 0, 1, 0, 0, 0]).reshape(2, 2, 2) + _check({'condition': cond, 'arr': a}) + + a = np.asfortranarray(np.arange(60).reshape(3, 4, 5)) + cond = np.repeat((0, 1), 30) + _check({'condition': cond, 'arr': a}) + _check({'condition': cond, 'arr': a[::-1]}) + + a = np.array(4) + for cond in 0, 1: + _check({'condition': cond, 'arr': a}) + + a = 1 + cond = 1 + _check({'condition': cond, 'arr': a}) + + a = np.array(1) + cond = np.array([True, False]) + _check({'condition': cond, 'arr': a}) + + a = np.arange(4) + cond = np.array([1, 0, 1, 0, 0, 0]).reshape(2, 3) * 1j + _check({'condition': cond, 'arr': a}) + + def test_extract_exceptions(self): + pyfunc = extract + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + a = np.array([]) + cond = np.array([1, 2, 3]) + + with self.assertRaises(ValueError) as e: + cfunc(cond, a) + self.assertIn('Cannot extract from an empty array', str(e.exception)) + + def _check(cond, a): + msg = 'condition shape inconsistent with arr shape' + with self.assertRaises(ValueError) as e: + cfunc(cond, a) + self.assertIn(msg, str(e.exception)) + + a = np.array([[1, 2, 3], [1, 2, 3]]) + cond = [1, 0, 1, 0, 1, 0, 1] + _check(cond, a) + + a = np.array([1, 2, 3]) + cond = np.array([1, 0, 1, 0, 1]) + _check(cond, a) + + a = np.array(60) # note, this is 0D + cond = 0, 1 + _check(cond, a) + + a = np.arange(4) + cond = np.array([True, False, False, False, True]) + _check(cond, a) + + a = np.arange(4) + cond = np.array([True, False, True, False, False, True, False]) + _check(cond, a) + + @unittest.skipUnless(IS_NUMPY_2, "New in numpy 2.0+") + def test_np_trapezoid_basic(self): + self.test_np_trapz_basic(pyfunc=np_trapezoid) + + def test_np_trapz_basic(self, pyfunc=np_trapz): + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + y = [1, 2, 3] + _check({'y': y}) + + y = (3, 1, 2, 2, 2) + _check({'y': y}) + + y = np.arange(15).reshape(3, 5) + _check({'y': y}) + + y = np.linspace(-10, 10, 60).reshape(4, 3, 5) + _check({'y': y}, abs_tol=1e-13) + + self.rnd.shuffle(y) + _check({'y': y}, abs_tol=1e-13) + + y = np.array([]) + _check({'y': y}) + + y = np.array([3.142, np.nan, np.inf, -np.inf, 5]) + _check({'y': y}) + + y = np.arange(20) + np.linspace(0, 10, 20) * 1j + _check({'y': y}) + + y = np.array([], dtype=np.complex128) + _check({'y': y}) + + y = (True, False, True) + _check({'y': y}) + + @unittest.skipUnless(IS_NUMPY_2, "New in numpy 2.0+") + def test_np_trapezoid_x_basic(self): + self.test_np_trapz_x_basic(pyfunc=np_trapezoid_x) + + def test_np_trapz_x_basic(self, pyfunc=np_trapz_x): + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + y = [1, 2, 3] + x = [4, 6, 8] + _check({'y': y, 'x': x}) + + y = [1, 2, 3, 4, 5] + x = (4, 6) + _check({'y': y, 'x': x}) + + y = (1, 2, 3, 4, 5) + x = [4, 5, 6, 7, 8] + _check({'y': y, 'x': x}) + + y = np.array([1, 2, 3, 4, 5]) + x = [4, 4] + _check({'y': y, 'x': x}) + + y = np.array([]) + x = np.array([2, 3]) + _check({'y': y, 'x': x}) + + y = (1, 2, 3, 4, 5) + x = None + _check({'y': y, 'x': x}) + + y = np.arange(20).reshape(5, 4) + x = np.array([4, 5]) + _check({'y': y, 'x': x}) + + y = np.arange(20).reshape(5, 4) + x = np.array([4, 5, 6, 7]) + _check({'y': y, 'x': x}) + + y = np.arange(60).reshape(5, 4, 3) + x = np.array([4, 5]) + _check({'y': y, 'x': x}) + + y = np.arange(60).reshape(5, 4, 3) + x = np.array([4, 5, 7]) + _check({'y': y, 'x': x}) + + y = np.arange(60).reshape(5, 4, 3) + self.rnd.shuffle(y) + x = y + 1.1 + self.rnd.shuffle(x) + _check({'y': y, 'x': x}) + + y = np.arange(20) + x = y + np.linspace(0, 10, 20) * 1j + _check({'y': y, 'x': x}) + + y = np.array([1, 2, 3]) + x = np.array([1 + 1j, 1 + 2j]) + _check({'y': y, 'x': x}) + + @unittest.skipUnless(IS_NUMPY_2, "New in numpy 2.0+") + def test_trapezoid_numpy_questionable(self): + self.test_trapz_numpy_questionable(pyfunc=np_trapezoid) + + @unittest.skip('NumPy behaviour questionable') + def test_trapz_numpy_questionable(self, pyfunc=np_trapz): + # https://github.com/numpy/numpy/issues/12858 + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + # passes (NumPy and Numba return 2.0) + y = np.array([True, False, True, True]).astype(int) + _check({'y': y}) + + # fails (NumPy returns 1.5; Numba returns 2.0) + y = np.array([True, False, True, True]) + _check({'y': y}) + + @unittest.skipUnless(IS_NUMPY_2, "New in numpy 2.0+") + def test_np_trapezoid_dx_basic(self): + self.test_np_trapz_dx_basic(pyfunc=np_trapezoid_dx) + + def test_np_trapz_dx_basic(self, pyfunc=np_trapz_dx): + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + y = [1, 2, 3] + dx = 2 + _check({'y': y, 'dx': dx}) + + y = [1, 2, 3, 4, 5] + dx = [1, 4, 5, 6] + _check({'y': y, 'dx': dx}) + + y = [1, 2, 3, 4, 5] + dx = [1, 4, 5, 6] + _check({'y': y, 'dx': dx}) + + y = np.linspace(-2, 5, 10) + dx = np.nan + _check({'y': y, 'dx': dx}) + + y = np.linspace(-2, 5, 10) + dx = np.inf + _check({'y': y, 'dx': dx}) + + y = np.linspace(-2, 5, 10) + dx = np.linspace(-2, 5, 9) + _check({'y': y, 'dx': dx}, abs_tol=1e-13) + + y = np.arange(60).reshape(4, 5, 3) * 1j + dx = np.arange(40).reshape(4, 5, 2) + _check({'y': y, 'dx': dx}) + + x = np.arange(-10, 10, .1) + r = cfunc(np.exp(-.5 * x ** 2) / np.sqrt(2 * np.pi), dx=0.1) + # check integral of normal equals 1 + np.testing.assert_almost_equal(r, 1, 7) + + y = np.arange(20) + dx = 1j + _check({'y': y, 'dx': dx}) + + y = np.arange(20) + dx = np.array([5]) + _check({'y': y, 'dx': dx}) + + @unittest.skipUnless(IS_NUMPY_2, "New in numpy 2.0+") + def test_np_trapezoid_x_dx_basic(self): + self.test_np_trapz_x_dx_basic(pyfunc=np_trapezoid_x_dx) + + def test_np_trapz_x_dx_basic(self, pyfunc=np_trapz_x_dx): + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + # dx should be ignored + for dx in (None, 2, np.array([1, 2, 3, 4, 5])): + y = [1, 2, 3] + x = [4, 6, 8] + _check({'y': y, 'x': x, 'dx': dx}) + + y = [1, 2, 3, 4, 5] + x = [4, 6] + _check({'y': y, 'x': x, 'dx': dx}) + + y = [1, 2, 3, 4, 5] + x = [4, 5, 6, 7, 8] + _check({'y': y, 'x': x, 'dx': dx}) + + y = np.arange(60).reshape(4, 5, 3) + self.rnd.shuffle(y) + x = y * 1.1 + x[2, 2, 2] = np.nan + _check({'y': y, 'x': x, 'dx': dx}) + + @unittest.skipUnless(IS_NUMPY_2, "New in numpy 2.0+") + def test_np_trapezoid_x_dx_exceptions(self): + self.test_np_trapz_x_dx_exceptions(pyfunc=np_trapezoid_x_dx) + + def test_np_trapz_x_dx_exceptions(self, pyfunc=np_trapz_x_dx): + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + def check_not_ok(params): + with self.assertRaises(ValueError) as e: + cfunc(*params) + + self.assertIn('unable to broadcast', str(e.exception)) + + y = [1, 2, 3, 4, 5] + for x in [4, 5, 6, 7, 8, 9], [4, 5, 6]: + check_not_ok((y, x, 1.0)) + + y = np.arange(60).reshape(3, 4, 5) + x = np.arange(36).reshape(3, 4, 3) + check_not_ok((y, x, 1.0)) + + y = np.arange(60).reshape(3, 4, 5) + x = np.array([4, 5, 6, 7]) + check_not_ok((y, x, 1.0)) + + y = [1, 2, 3, 4, 5] + dx = np.array([1.0, 2.0]) + check_not_ok((y, None, dx)) + + y = np.arange(60).reshape(3, 4, 5) + dx = np.arange(60).reshape(3, 4, 5) + check_not_ok((y, None, dx)) + + with self.assertTypingError() as e: + y = np.array(4) + check_not_ok((y, None, 1.0)) + + self.assertIn('y cannot be 0D', str(e.exception)) + + for y in 5, False, np.nan: + with self.assertTypingError() as e: + cfunc(y, None, 1.0) + + self.assertIn('y cannot be a scalar', str(e.exception)) + + def test_average(self): + + #array of random numbers + N = 100 + a = np.random.ranf(N) * 100 + w = np.random.ranf(N) * 100 + w0 = np.zeros(N) + + #boolean array and weights + a_bool = np.random.ranf(N) > 0.5 + w_bool = np.random.ranf(N) > 0.5 + + #array of random ints + a_int = np.random.randint(101, size=N) + w_int = np.random.randint(101, size=N) + + #3D array of random numbers + d0 = 100 + d1 = 50 + d2 = 25 + a_3d = np.random.rand(d0,d1,d2) * 100 + w_3d = np.random.rand(d0,d1,d2) * 100 + + pyfunc = np_average + cfunc = jit(nopython=True)(pyfunc) + + #test case for average with weights + #(number of elements in array and weight array are equal) + self.assertAlmostEqual( pyfunc(a,weights=w), + cfunc(a,weights=w), places=10) + self.assertAlmostEqual( pyfunc(a_3d,weights=w_3d), + cfunc(a_3d,weights=w_3d), places=10) + + #test case for average with array and weights with + #int datatype (number of elements in array and weight array are equal) + self.assertAlmostEqual( pyfunc(a_int,weights=w_int), + cfunc(a_int,weights=w_int), places=10) + + #test case for average with boolean weights + self.assertAlmostEqual( pyfunc(a,weights=w_bool), + cfunc(a,weights=w_bool), places=10) + self.assertAlmostEqual( pyfunc(a_bool,weights=w), + cfunc(a_bool,weights=w), places=10) + self.assertAlmostEqual( pyfunc(a_bool, weights=w_bool), + cfunc(a_bool, weights=w_bool), places=10) + + #test case for average without weights + self.assertAlmostEqual(pyfunc(a), cfunc(a), places=10) + self.assertAlmostEqual(pyfunc(a_3d), cfunc(a_3d), places=10) + + def test_weights_zero_sum(data, weights): + with self.assertRaises(ZeroDivisionError) as e: + cfunc(data, weights=weights) + err = e.exception + self.assertEqual(str(err), + "Weights sum to zero, can't be normalized.") + + #test case when sum of weights is zero + test_weights_zero_sum(a, weights=w0) + + def test_1D_weights(data, weights): + with self.assertRaises(TypeError) as e: + cfunc(data, weights=weights) + err = e.exception + self.assertEqual(str(err), + "Numba does not support average when shapes of " + "a and weights differ.") + + def test_1D_weights_axis(data, axis, weights): + with self.assertRaises(TypeError) as e: + cfunc(data,axis=axis, weights=weights) + err = e.exception + self.assertEqual(str(err), + "Numba does not support average with axis.") + + #small case to test exceptions for 2D array and 1D weights + data = np.arange(6).reshape((3,2,1)) + w = np.asarray([1. / 4, 3. / 4]) + + #test without axis argument + test_1D_weights(data, weights=w) + + #test with axis argument + test_1D_weights_axis(data, axis=1, weights=w) + + def test_allclose(self): + + pyfunc = np_allclose + cfunc = jit(nopython=True)(pyfunc) + + min_int = np.iinfo(np.int_).min + a = np.array([min_int], dtype=np.int_) + + simple_data = [ + (np.asarray([1e10, 1e-7]), np.asarray([1.00001e10, 1e-8])), + (np.asarray([1e10, 1e-8]), np.asarray([1.00001e10, 1e-9])), + (np.asarray([1e10, 1e-8]), np.asarray([1.0001e10, 1e-9])), + (np.asarray([1e10]), np.asarray([1.0001e10, 1e-9])), + (1.0, 1.0), + (np.array([np.inf, 1]), np.array([0, np.inf])), + (a, a) + ] + + for a, b in simple_data: + py_result = pyfunc(a, b) + c_result = cfunc(a, b) + self.assertEqual(py_result, c_result) + + a = np.asarray([1.0, np.nan]) + b = np.asarray([1.0, np.nan]) + self.assertFalse(cfunc(a, b)) + self.assertEqual(pyfunc(a, b, equal_nan=True), + cfunc(a, b, equal_nan=True)) + + b = np.asarray([np.nan, 1.0]) + self.assertEqual(pyfunc(a, b), cfunc(a, b)) + + noise_levels = [1.0, 1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6, 0.0] + zero_array = np.zeros((25, 4)) + a = np.random.ranf((25, 4)) + for noise in noise_levels: + for rtol in noise_levels: + for atol in noise_levels: + py_result = pyfunc(zero_array, noise, + atol=atol, rtol=rtol) + c_result = cfunc(zero_array, noise, + atol=atol, rtol=rtol) + self.assertEqual(py_result, c_result) + + py_result = pyfunc(noise, zero_array, + atol=atol, rtol=rtol) + c_result = cfunc(noise, zero_array, + atol=atol, rtol=rtol) + self.assertEqual(py_result, c_result) + + py_result = pyfunc(np.asarray([noise]), zero_array, + atol=atol, rtol=rtol) + c_result = cfunc(np.asarray([noise]), zero_array, + atol=atol, rtol=rtol) + self.assertEqual(py_result, c_result) + + py_result = pyfunc(a, a + noise, atol=atol, rtol=rtol) + c_result = cfunc(a, a + noise, atol=atol, rtol=rtol) + self.assertEqual(py_result, c_result) + + py_result = pyfunc(a + noise, a, atol=atol, rtol=rtol) + c_result = cfunc(a + noise, a, atol=atol, rtol=rtol) + self.assertEqual(py_result, c_result) + + def test_ip_allclose_numpy(self): + # https://github.com/numpy/numpy/blob/4adc87dff15a247e417d50f10cc4def8e1c17a03/numpy/core/tests/test_numeric.py#L2402-L2420 # noqa: E501 + pyfunc = np_allclose + cfunc = jit(nopython=True)(pyfunc) + + arr = np.array([100.0, 1000.0]) + aran = np.arange(125).astype(dtype=np.float64).reshape((5, 5, 5)) + + atol = 1e-8 + rtol = 1e-5 + + numpy_data = [ + (np.asarray([1, 0]), np.asarray([1, 0])), + (np.asarray([atol]), np.asarray([0.0])), + (np.asarray([1.0]), np.asarray([1 + rtol + atol])), + (arr, arr + arr * rtol), + (arr, arr + arr * rtol + atol * 2), + (aran, aran + aran * rtol), + (np.inf, np.inf), + (np.inf, np.asarray([np.inf])) + ] + + for (x, y) in numpy_data: + self.assertEqual(pyfunc(x, y), cfunc(x, y)) + + def test_ip_not_allclose_numpy(self): + # https://github.com/numpy/numpy/blob/4adc87dff15a247e417d50f10cc4def8e1c17a03/numpy/core/tests/test_numeric.py#L2422-L2441 # noqa: E501 + + pyfunc = np_allclose + cfunc = jit(nopython=True)(pyfunc) + + aran = np.arange(125).astype(dtype=np.float64).reshape((5, 5, 5)) + + atol = 1e-8 + rtol = 1e-5 + + numpy_data = [ + (np.asarray([np.inf, 0]), np.asarray([1.0, np.inf])), + (np.asarray([np.inf, 0]), np.asarray([1.0, 0])), + (np.asarray([np.inf, np.inf]), np.asarray([1.0, np.inf])), + (np.asarray([np.inf, np.inf]), np.asarray([1.0, 0.0])), + (np.asarray([-np.inf, 0.0]), np.asarray([np.inf, 0.0])), + (np.asarray([np.nan, 0.0]), np.asarray([np.nan, 0.0])), + (np.asarray([atol * 2]), np.asarray([0.0])), + (np.asarray([1.0]), np.asarray([1 + rtol + atol * 2])), + (aran, aran + aran * atol + atol * 2), + (np.array([np.inf, 1.0]), np.array([0.0, np.inf])) + ] + + for (x, y) in numpy_data: + self.assertEqual(pyfunc(x, y), cfunc(x, y)) + + def test_return_class_is_ndarray_numpy(self): + # https://github.com/numpy/numpy/blob/4adc87dff15a247e417d50f10cc4def8e1c17a03/numpy/core/tests/test_numeric.py#L2460-L2468 # noqa: E501 + + pyfunc = np_allclose + cfunc = jit(nopython=True)(pyfunc) + + class Foo(np.ndarray): + def __new__(cls, *args, **kwargs): + return np.array(*args, **kwargs).view(cls) + + a = Foo([1]) + self.assertTrue(type(cfunc(a, a)) is bool) + + def test_equalnan_numpy(self): + # https://github.com/numpy/numpy/blob/4adc87dff15a247e417d50f10cc4def8e1c17a03/numpy/core/tests/test_numeric.py#L2456-L2458 # noqa: E501 + pyfunc = np_allclose + cfunc = jit(nopython=True)(pyfunc) + + x = np.array([1.0, np.nan]) + + self.assertEqual(pyfunc(x, x, equal_nan=True), + cfunc(x, x, equal_nan=True)) + + def test_no_parameter_modification_numpy(self): + # https://github.com/numpy/numpy/blob/4adc87dff15a247e417d50f10cc4def8e1c17a03/numpy/core/tests/test_numeric.py#L2443-L2448 # noqa: E501 + + pyfunc = np_allclose + cfunc = jit(nopython=True)(pyfunc) + + x = np.array([np.inf, 1]) + y = np.array([0, np.inf]) + + cfunc(x, y) + np.testing.assert_array_equal(x, np.array([np.inf, 1])) + np.testing.assert_array_equal(y, np.array([0, np.inf])) + + def test_min_int_numpy(self): + # https://github.com/numpy/numpy/blob/4adc87dff15a247e417d50f10cc4def8e1c17a03/numpy/core/tests/test_numeric.py#L2450-L2454 # noqa: E501 + + pyfunc = np_allclose + cfunc = jit(nopython=True)(pyfunc) + + min_int = np.iinfo(np.int_).min + a = np.array([min_int], dtype=np.int_) + + self.assertEqual(pyfunc(a, a), cfunc(a, a)) + + def test_allclose_exception(self): + self.disable_leak_check() + + pyfunc = np_allclose + cfunc = jit(nopython=True)(pyfunc) + + inps = [ + (np.asarray([1e10, 1e-9, np.nan]), + np.asarray([1.0001e10, 1e-9]), + 1e-05, 1e-08, False, + "shape mismatch: objects cannot be broadcast to a single shape", + ValueError), + ('hello', 3, False, 1e-08, False, + 'The first argument "a" must be array-like', + TypingError), + (3, 'hello', False, 1e-08, False, + 'The second argument "b" must be array-like', + TypingError), + (2, 3, False, 1e-08, False, + 'The third argument "rtol" must be a floating point', + TypingError), + (2, 3, 1e-05, False, False, + 'The fourth argument "atol" must be a floating point', + TypingError), + (2, 3, 1e-05, 1e-08, 1, + 'The fifth argument "equal_nan" must be a boolean', + TypingError), + ] + + for a, b, rtol, atol, equal_nan, exc_msg, exc in inps: + with self.assertRaisesRegex(exc, exc_msg): + cfunc(a, b, rtol, atol, equal_nan) + + def test_interp_basic(self): + pyfunc = interp + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc, abs_tol=1e-10) + + x = np.linspace(-5, 5, 25) + xp = np.arange(-4, 8) + fp = xp + 1.5 + _check(params={'x': x, 'xp': xp, 'fp': fp}) + self.rnd.shuffle(x) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + self.rnd.shuffle(fp) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x[:5] = np.nan + x[-5:] = np.inf + self.rnd.shuffle(x) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + fp[:5] = np.nan + fp[-5:] = -np.inf + self.rnd.shuffle(fp) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = np.arange(-4, 8) + xp = x + 1 + fp = x + 2 + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = (2.2, 3.3, -5.0) + xp = (2, 3, 4) + fp = (5, 6, 7) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = ((2.2, 3.3, -5.0), (1.2, 1.3, 4.0)) + xp = np.linspace(-4, 4, 10) + fp = np.arange(-5, 5) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = np.array([1.4, np.nan, np.inf, -np.inf, 0.0, -9.1]) + x = x.reshape(3, 2, order='F') + xp = np.linspace(-4, 4, 10) + fp = np.arange(-5, 5) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + for x in range(-2, 4): + xp = [0, 1, 2] + fp = (3, 4, 5) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = np.array([]) + xp = [0, 1, 2] + fp = (3, 4, 5) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = np.linspace(0, 25, 60).reshape(3, 4, 5) + xp = np.arange(20) + fp = xp - 10 + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = np.nan + xp = np.arange(5) + fp = np.full(5, np.nan) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = np.nan + xp = [3] + fp = [4] + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = np.arange(-4, 8) + xp = x + fp = x + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = [True, False] + xp = np.arange(-4, 8) + fp = xp + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = [-np.inf, -1.0, 0.0, 1.0, np.inf] + xp = np.arange(-4, 8) + fp = xp * 2.2 + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = np.linspace(-10, 10, 10) + xp = np.array([-np.inf, -1.0, 0.0, 1.0, np.inf]) + fp = xp * 2.2 + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = self.rnd.randn(100) + xp = np.linspace(-3, 3, 100) + fp = np.full(100, fill_value=3.142) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + for factor in 1, -1: + x = np.array([5, 6, 7]) * factor + xp = [1, 2] + fp = [3, 4] + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = 1 + xp = [1] + fp = [True] + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + x = np.linspace(0, 1, 5) + y = np.linspace(0, 1, 5) + x0 = np.linspace(0, 1, 50) + out = cfunc(x0, x, y) + np.testing.assert_almost_equal(out, x0) + + x = np.array([1, 2, 3, 4]) + xp = np.array([1, 2, 3, 4]) + fp = np.array([1, 2, 3.01, 4]) + _check(params={'x': x, 'xp': xp, 'fp': fp}) + + xp = [1] + fp = [np.inf] + _check(params={'x': 1, 'xp': xp, 'fp': fp}) + + x = np.array([1, 2, 2.5, 3, 4]) + xp = np.array([1, 2, 3, 4]) + fp = np.array([1, 2, np.nan, 4]) + _check({'x': x, 'xp': xp, 'fp': fp}) + + x = np.array([1, 1.5, 2, 2.5, 3, 4, 4.5, 5, 5.5]) + xp = np.array([1, 2, 3, 4, 5]) + fp = np.array([np.nan, 2, np.nan, 4, np.nan]) + _check({'x': x, 'xp': xp, 'fp': fp}) + + x = np.array([1, 2, 2.5, 3, 4]) + xp = np.array([1, 2, 3, 4]) + fp = np.array([1, 2, np.inf, 4]) + _check({'x': x, 'xp': xp, 'fp': fp}) + + x = np.array([1, 1.5, np.nan, 2.5, -np.inf, 4, 4.5, 5, np.inf, 0, 7]) + xp = np.array([1, 2, 3, 4, 5, 6]) + fp = np.array([1, 2, np.nan, 4, 3, np.inf]) + _check({'x': x, 'xp': xp, 'fp': fp}) + + x = np.array([3.10034867, 3.0999066, 3.10001529]) + xp = np.linspace(0, 10, 1 + 20000) + fp = np.sin(xp / 2.0) + _check({'x': x, 'xp': xp, 'fp': fp}) + + x = self.rnd.uniform(0, 2 * np.pi, (100,)) + xp = np.linspace(0, 2 * np.pi, 1000) + fp = np.cos(xp) + exact = np.cos(x) + got = cfunc(x, xp, fp) + np.testing.assert_allclose(exact, got, atol=1e-5) + + # very dense calibration + x = self.rnd.randn(10) + xp = np.linspace(-10, 10, 1000) + fp = np.ones_like(xp) + _check({'x': x, 'xp': xp, 'fp': fp}) + + # very sparse calibration + x = self.rnd.randn(1000) + xp = np.linspace(-10, 10, 10) + fp = np.ones_like(xp) + _check({'x': x, 'xp': xp, 'fp': fp}) + + def _make_some_values_non_finite(self, a): + p = a.size // 100 + np.put(a, self.rnd.choice(range(a.size), p, replace=False), np.nan) + np.put(a, self.rnd.choice(range(a.size), p, replace=False), -np.inf) + np.put(a, self.rnd.choice(range(a.size), p, replace=False), np.inf) + + def arrays(self, ndata): + # much_finer_grid + yield np.linspace(2.0, 7.0, 1 + ndata * 5) + # finer_grid + yield np.linspace(2.0, 7.0, 1 + ndata) + # similar_grid + yield np.linspace(2.1, 6.8, 1 + ndata // 2) + # coarser_grid + yield np.linspace(2.1, 7.5, 1 + ndata // 2) + # much_coarser_grid + yield np.linspace(1.1, 9.5, 1 + ndata // 5) + # finer_stretched_grid + yield np.linspace(3.1, 5.3, 1 + ndata) * 1.09 + # similar_stretched_grid + yield np.linspace(3.1, 8.3, 1 + ndata // 2) * 1.09 + # finer_compressed_grid + yield np.linspace(3.1, 5.3, 1 + ndata) * 0.91 + # similar_compressed_grid + yield np.linspace(3.1, 8.3, 1 + ndata // 2) * 0.91 + # warped_grid + yield np.linspace(3.1, 5.3, 1 + ndata // 2) + 0.3 * np.sin( + np.arange(1 + ndata / 2) * np.pi / (1 + ndata / 2)) + # very_low_noise_grid + yield np.linspace(3.1, 5.3, 1 + ndata) + self.rnd.normal( + size=1 + ndata, scale=0.5 / ndata) + # low_noise_grid + yield np.linspace(3.1, 5.3, 1 + ndata) + self.rnd.normal( + size=1 + ndata, scale=2.0 / ndata) + # med_noise_grid + yield np.linspace(3.1, 5.3, 1 + ndata) + self.rnd.normal( + size=1 + ndata, scale=5.0 / ndata) + # high_noise_grid + yield np.linspace(3.1, 5.3, 1 + ndata) + self.rnd.normal( + size=1 + ndata, scale=20.0 / ndata) + # very_high_noise_grid + yield np.linspace(3.1, 5.3, 1 + ndata) + self.rnd.normal( + size=1 + ndata, scale=50.0 / ndata) + # extreme_noise_grid + yield np.linspace(3.1, 5.3, 1 + ndata) + self.rnd.normal( + size=1 + ndata, scale=200.0 / ndata) + # random_fine_grid + yield self.rnd.rand(1 + ndata) * 9.0 + 0.6 + # random_grid + yield self.rnd.rand(1 + ndata * 2) * 4.0 + 1.3 + + def test_interp_stress_tests(self): + pyfunc = interp + cfunc = jit(nopython=True)(pyfunc) + + ndata = 20000 + xp = np.linspace(0, 10, 1 + ndata) + fp = np.sin(xp / 2.0) + + for x in self.arrays(ndata): + atol = 1e-14 # using abs_tol as otherwise fails on 32bit builds + + expected = pyfunc(x, xp, fp) + got = cfunc(x, xp, fp) + self.assertPreciseEqual(expected, got, abs_tol=atol) + + # no longer require xp to be monotonically increasing + # (in keeping with numpy) even if the output might not + # be meaningful; shuffle all inputs + self.rnd.shuffle(x) + expected = pyfunc(x, xp, fp) + got = cfunc(x, xp, fp) + self.assertPreciseEqual(expected, got, abs_tol=atol) + + self.rnd.shuffle(xp) + expected = pyfunc(x, xp, fp) + got = cfunc(x, xp, fp) + self.assertPreciseEqual(expected, got, abs_tol=atol) + + self.rnd.shuffle(fp) + expected = pyfunc(x, xp, fp) + got = cfunc(x, xp, fp) + self.assertPreciseEqual(expected, got, abs_tol=atol) + + # add some values non finite + self._make_some_values_non_finite(x) + expected = pyfunc(x, xp, fp) + got = cfunc(x, xp, fp) + self.assertPreciseEqual(expected, got, abs_tol=atol) + + self._make_some_values_non_finite(xp) + expected = pyfunc(x, xp, fp) + got = cfunc(x, xp, fp) + self.assertPreciseEqual(expected, got, abs_tol=atol) + + self._make_some_values_non_finite(fp) + expected = pyfunc(x, xp, fp) + got = cfunc(x, xp, fp) + self.assertPreciseEqual(expected, got, abs_tol=atol) + + @unittest.skipIf(IS_NUMPY_2 and IS_MACOS_ARM64, "NEP 50 interaction issue.") + def test_interp_complex_stress_tests(self): + pyfunc = interp + cfunc = jit(nopython=True)(pyfunc) + + ndata = 2000 + xp = np.linspace(0, 10, 1 + ndata) + + real = np.sin(xp / 2.0) + real[:200] = self.rnd.choice([np.inf, -np.inf, np.nan], 200) + self.rnd.shuffle(real) + + imag = np.cos(xp / 2.0) + imag[:200] = self.rnd.choice([np.inf, -np.inf, np.nan], 200) + self.rnd.shuffle(imag) + + fp = real + 1j * imag + + for x in self.arrays(ndata): + expected = pyfunc(x, xp, fp) + got = cfunc(x, xp, fp) + np.testing.assert_allclose(expected, got, equal_nan=True) + + self.rnd.shuffle(x) + self.rnd.shuffle(xp) + self.rnd.shuffle(fp) + np.testing.assert_allclose(expected, got, equal_nan=True) + + def test_interp_exceptions(self): + pyfunc = interp + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + x = np.array([1, 2, 3]) + xp = np.array([]) + fp = np.array([]) + + with self.assertRaises(ValueError) as e: + cfunc(x, xp, fp) + + msg = "array of sample points is empty" + self.assertIn(msg, str(e.exception)) + + x = 1 + xp = np.array([1, 2, 3]) + fp = np.array([1, 2]) + + with self.assertRaises(ValueError) as e: + cfunc(x, xp, fp) + + msg = "fp and xp are not of the same size." + self.assertIn(msg, str(e.exception)) + + x = 1 + xp = np.arange(6).reshape(3, 2) + fp = np.arange(6) + + with self.assertTypingError() as e: + cfunc(x, xp, fp) + + msg = "xp must be 1D" + self.assertIn(msg, str(e.exception)) + + x = 1 + xp = np.arange(6) + fp = np.arange(6).reshape(3, 2) + + with self.assertTypingError() as e: + cfunc(x, xp, fp) + + msg = "fp must be 1D" + self.assertIn(msg, str(e.exception)) + + x = 1 + 1j + xp = np.arange(6) + fp = np.arange(6) + + with self.assertTypingError() as e: + cfunc(x, xp, fp) + + complex_dtype_msg = ( + "Cannot cast array data from complex dtype " + "to float64 dtype" + ) + self.assertIn(complex_dtype_msg, str(e.exception)) + + x = 1 + xp = (np.arange(6) + 1j).astype(np.complex64) + fp = np.arange(6) + + with self.assertTypingError() as e: + cfunc(x, xp, fp) + + self.assertIn(complex_dtype_msg, str(e.exception)) + + def test_interp_non_finite_calibration(self): + # examples from + # https://github.com/numpy/numpy/issues/12951 + pyfunc = interp + cfunc = jit(nopython=True)(pyfunc) + _check = partial(self._check_output, pyfunc, cfunc) + + xp = np.array([0, 1, 9, 10]) + fp = np.array([-np.inf, 0.1, 0.9, np.inf]) + x = np.array([0.2, 9.5]) + params = {'x': x, 'xp': xp, 'fp': fp} + _check(params) + + xp = np.array([-np.inf, 1, 9, np.inf]) + fp = np.array([0, 0.1, 0.9, 1]) + x = np.array([0.2, 9.5]) + params = {'x': x, 'xp': xp, 'fp': fp} + _check(params) + + def test_interp_supplemental_tests(self): + # inspired by class TestInterp + # https://github.com/numpy/numpy/blob/f5b6850f231/numpy/lib/tests/test_function_base.py # noqa: E501 + pyfunc = interp + cfunc = jit(nopython=True)(pyfunc) + + for size in range(1, 10): + xp = np.arange(size, dtype=np.double) + yp = np.ones(size, dtype=np.double) + incpts = np.array([-1, 0, size - 1, size], dtype=np.double) + decpts = incpts[::-1] + + incres = cfunc(incpts, xp, yp) + decres = cfunc(decpts, xp, yp) + inctgt = np.array([1, 1, 1, 1], dtype=float) + dectgt = inctgt[::-1] + np.testing.assert_almost_equal(incres, inctgt) + np.testing.assert_almost_equal(decres, dectgt) + + x = np.linspace(0, 1, 5) + y = np.linspace(0, 1, 5) + x0 = 0 + np.testing.assert_almost_equal(cfunc(x0, x, y), x0) + x0 = 0.3 + np.testing.assert_almost_equal(cfunc(x0, x, y), x0) + x0 = np.float32(0.3) + np.testing.assert_almost_equal(cfunc(x0, x, y), x0) + x0 = np.float64(0.3) + np.testing.assert_almost_equal(cfunc(x0, x, y), x0) + x0 = np.nan + np.testing.assert_almost_equal(cfunc(x0, x, y), x0) + + x = np.linspace(0, 1, 5) + y = np.linspace(0, 1, 5) + x0 = np.array(0.3) + np.testing.assert_almost_equal(cfunc(x0, x, y), x0) + + xp = np.arange(0, 10, 0.0001) + fp = np.sin(xp) + np.testing.assert_almost_equal(cfunc(np.pi, xp, fp), 0.0) + + def test_interp_supplemental_complex_tests(self): + # inspired by class TestInterp + # https://github.com/numpy/numpy/blob/f5b6850f231/numpy/lib/tests/test_function_base.py # noqa: E501 + pyfunc = interp + cfunc = jit(nopython=True)(pyfunc) + + x = np.linspace(0, 1, 5) + y = np.linspace(0, 1, 5) + (1 + np.linspace(0, 1, 5)) * 1.0j + x0 = 0.3 + y0 = x0 + (1 + x0) * 1.0j + np.testing.assert_almost_equal(cfunc(x0, x, y), y0) + + def test_interp_float_precision_handled_per_numpy(self): + # test cases from https://github.com/numba/numba/issues/4890 + pyfunc = interp + cfunc = jit(nopython=True)(pyfunc) + dtypes = [np.float32, np.float64, np.int32, np.int64] + + for combo in itertools.combinations_with_replacement(dtypes, 3): + xp_dtype, fp_dtype, x_dtype = combo + xp = np.arange(10, dtype=xp_dtype) + fp = (xp ** 2).astype(fp_dtype) + x = np.linspace(2, 3, 10, dtype=x_dtype) + + expected = pyfunc(x, xp, fp) + got = cfunc(x, xp, fp) + self.assertPreciseEqual(expected, got) + + def test_isnat(self): + def values(): + yield np.datetime64("2016-01-01") + yield np.datetime64("NaT") + yield np.datetime64('NaT', 'ms') + yield np.datetime64('NaT', 'ns') + yield np.datetime64('2038-01-19T03:14:07') + + yield np.timedelta64('NaT', "ms") + yield np.timedelta64(34, "ms") + + for unit in ['Y', 'M', 'W', 'D', + 'h', 'm', 's', 'ms', 'us', + 'ns', 'ps', 'fs', 'as']: + yield np.array([123, -321, "NaT"], + dtype=' 5], [x, x ** 2], 0)) + # test with two tuples + test_cases.append(((x < 3, x > 5), (x, x ** 2), 0)) + # test with one list and one tuple + test_cases.append(([x < 3, x > 5], (x, x ** 2), 0)) + # test with one tuple and one list + test_cases.append(((x < 3, x > 5), [x, x ** 2], 0)) + + for condlist, choicelist, default in test_cases: + self.assertPreciseEqual(np_pyfunc(condlist, choicelist, default), + np_nbfunc(condlist, choicelist, default)) + + np_pyfunc_defaults = np_select_defaults + np_nbfunc_defaults = njit(np_select_defaults) + # check the defaults work, using whatever the last input was + self.assertPreciseEqual(np_pyfunc_defaults(condlist, choicelist), + np_nbfunc_defaults(condlist, choicelist)) + + def test_select_exception(self): + np_nbfunc = njit(np_select) + x = np.arange(10) + self.disable_leak_check() + for condlist, choicelist, default, expected_error, expected_text in [ + # Each test case below is one tuple. + # Each tuple is separated by the description of the intended error + + # passing condlist of dim zero + ([np.array(True), np.array([False, True, False])], + [np.array(1), np.arange(12).reshape(4, 3)], 0, + TypingError, "condlist arrays must be of at least dimension 1"), + # condlist and choicelist with different dimensions + ([np.array(True), np.array(False)], [np.array([1]), np.array([2])], + 0, TypingError, "condlist and choicelist elements must have the " + "same number of dimensions"), + # condlist and choicelist with different dimensions + ([np.array([True]), np.array([False])], + [np.array([[1]]), np.array([[2]])], 0, TypingError, + "condlist and choicelist elements must have the " + "same number of dimensions"), + # passing choicelist of dim zero + ([np.array(True), np.array(False)], [np.array(1), np.array(2)], 0, + TypingError, "condlist arrays must be of at least dimension 1"), + # passing an array as condlist instead of a list or tuple + (np.isnan(np.array([1, 2, 3, np.nan, 5, 7])), + np.array([1, 2, 3, np.nan, 5, 7]), 0, TypingError, + "condlist must be a List or a Tuple"), + # default is a list + ([True], [0], [0], TypingError, + "default must be a scalar"), + # condlist with ints instead of booleans + ([(x < 3).astype(int), (x > 5).astype(int)], [x, x ** 2], 0, + TypingError, "condlist arrays must contain booleans"), + # condlist and choicelist of different length + ([x > 9, x > 8, x > 7, x > 6], [x, x**2, x], 0, ValueError, + "list of cases must be same length as list of conditions"), + + # condlist contains tuples instead of arrays + # if in the future numba's np.where accepts tuples, the + # implementation of np.select should also accept them and + # the following two test cases should be normal tests + # instead of negative tests + + # test with lists of length 100 of tuples of length 1 for condlist + ([(False,)] * 100, [np.array([1])] * 100, 0, TypingError, + 'items of condlist must be arrays'), + # test with lists of length 100 of tuples of length 1 for choicelist + ([np.array([False])] * 100, [(1,)] * 100, 0, TypingError, + 'items of choicelist must be arrays'), + ]: + with self.assertRaises(expected_error) as e: + np_nbfunc(condlist, choicelist, default) + self.assertIn(expected_text, str(e.exception)) + + def test_windowing(self): + def check_window(func): + np_pyfunc = func + np_nbfunc = njit(func) + + for M in [0, 1, 5, 12]: + expected = np_pyfunc(M) + got = np_nbfunc(M) + self.assertPreciseEqual(expected, got, prec='double') + + for M in ['a', 1.1, 1j]: + with self.assertRaises(TypingError) as raises: + np_nbfunc(1.1) + self.assertIn("M must be an integer", str(raises.exception)) + + check_window(np_bartlett) + check_window(np_blackman) + check_window(np_hamming) + check_window(np_hanning) + + # Test np.kaiser separately + np_pyfunc = np_kaiser + np_nbfunc = njit(np_kaiser) + + for M in [0, 1, 5, 12]: + for beta in [0.0, 5.0, 14.0]: + expected = np_pyfunc(M, beta) + got = np_nbfunc(M, beta) + + if IS_32BITS or platform.machine() in ['ppc64le', 'aarch64']: + self.assertPreciseEqual(expected, + got, prec='double', ulps=2) + else: + self.assertPreciseEqual(expected, got, prec='double', + ulps=2) + + for M in ['a', 1.1, 1j]: + with self.assertRaises(TypingError) as raises: + np_nbfunc(M, 1.0) + self.assertIn("M must be an integer", str(raises.exception)) + + for beta in ['a', 1j]: + with self.assertRaises(TypingError) as raises: + np_nbfunc(5, beta) + self.assertIn("beta must be an integer or float", + str(raises.exception)) + + def test_cross(self): + pyfunc = np_cross + cfunc = jit(nopython=True)(pyfunc) + pairs = [ + # 3x3 (n-dims) + ( + np.array([[1, 2, 3], [4, 5, 6]]), + np.array([[4, 5, 6], [1, 2, 3]]) + ), + # 2x3 array-like (n-dims) + ( + np.array([[1, 2, 3], [4, 5, 6]]), + ((4, 5), (1, 2)) + ), + # 3x3 (1-dim) with type promotion + ( + np.array([1, 2, 3], dtype=np.int64), + np.array([4, 5, 6], dtype=np.float64) + ), + # 3x3 array-like (1-dim) + ( + (1, 2, 3), + (4, 5, 6) + ), + # 2x3 (1-dim) + ( + np.array([1, 2]), + np.array([4, 5, 6]) + ), + # 3x3 (with broadcasting 1d x 2d) + ( + np.array([1, 2, 3]), + np.array([[4, 5, 6], [1, 2, 3]]) + ), + # 3x3 (with broadcasting 2d x 1d) + ( + np.array([[1, 2, 3], [4, 5, 6]]), + np.array([1, 2, 3]) + ), + # 3x2 (with higher order broadcasting) + ( + np.arange(36).reshape(6, 2, 3), + np.arange(4).reshape(2, 2) + ) + ] + + for x, y in pairs: + expected = pyfunc(x, y) + got = cfunc(x, y) + self.assertPreciseEqual(expected, got) + + def test_cross_exceptions(self): + pyfunc = np_cross + cfunc = jit(nopython=True)(pyfunc) + self.disable_leak_check() + + # test incompatible dimensions for ndim == 1 + with self.assertRaises(ValueError) as raises: + cfunc( + np.arange(4), + np.arange(3) + ) + self.assertIn( + 'Incompatible dimensions for cross product', + str(raises.exception) + ) + + # test 2d cross product error for ndim == 1 + with self.assertRaises(ValueError) as raises: + cfunc( + np.array((1, 2)), + np.array((3, 4)) + ) + self.assertIn( + 'Dimensions for both inputs is 2.', + str(raises.exception) + ) + + self.assertIn( + '`cross2d(a, b)` from `numba.np.extensions`.', + str(raises.exception) + ) + + # test incompatible dimensions for ndim > 1 + with self.assertRaises(ValueError) as raises: + cfunc( + np.arange(8).reshape((2, 4)), + np.arange(6)[::-1].reshape((2, 3)) + ) + self.assertIn( + 'Incompatible dimensions for cross product', + str(raises.exception) + ) + + # test 2d cross product error for ndim == 1 + with self.assertRaises(ValueError) as raises: + cfunc( + np.arange(8).reshape((4, 2)), + np.arange(8)[::-1].reshape((4, 2)) + ) + self.assertIn( + 'Dimensions for both inputs is 2', + str(raises.exception) + ) + + # test non-array-like input + with self.assertRaises(TypingError) as raises: + cfunc( + set([1, 2, 3]), + set([4, 5, 6]) + ) + self.assertIn( + 'Inputs must be array-like.', + str(raises.exception) + ) + + def test_cross2d(self): + pyfunc = np_cross + cfunc = njit(nb_cross2d) + pairs = [ + # 2x2 (n-dims) + ( + np.array([[1, 2], [4, 5]]), + np.array([[4, 5], [1, 2]]) + ), + # 2x2 array-like (n-dims) + ( + np.array([[1, 2], [4, 5]]), + ((4, 5), (1, 2)) + ), + # 2x2 (1-dim) with type promotion + ( + np.array([1, 2], dtype=np.int64), + np.array([4, 5], dtype=np.float64) + ), + # 2x2 array-like (1-dim) + ( + (1, 2), + (4, 5) + ), + # 2x2 (with broadcasting 1d x 2d) + ( + np.array([1, 2]), + np.array([[4, 5], [1, 2]]) + ), + # 2x2 (with broadcasting 2d x 1d) + ( + np.array([[1, 2], [4, 5]]), + np.array([1, 2]) + ), + # 2x2 (with higher order broadcasting) + ( + np.arange(36).reshape(6, 3, 2), + np.arange(6).reshape(3, 2) + ) + ] + + for x, y in pairs: + expected = pyfunc(x, y) + got = cfunc(x, y) + self.assertPreciseEqual(expected, got) + + def test_cross2d_exceptions(self): + cfunc = njit(nb_cross2d) + self.disable_leak_check() + + # test incompatible dimensions for ndim == 1 + with self.assertRaises(ValueError) as raises: + cfunc( + np.array((1, 2, 3)), + np.array((4, 5, 6)) + ) + self.assertIn( + 'Incompatible dimensions for 2D cross product', + str(raises.exception) + ) + + # test incompatible dimensions for ndim > 1 + with self.assertRaises(ValueError) as raises: + cfunc( + np.arange(6).reshape((2, 3)), + np.arange(6)[::-1].reshape((2, 3)) + ) + self.assertIn( + 'Incompatible dimensions for 2D cross product', + str(raises.exception) + ) + + # test non-array-like input + with self.assertRaises(TypingError) as raises: + cfunc( + set([1, 2]), + set([4, 5]) + ) + self.assertIn( + 'Inputs must be array-like.', + str(raises.exception) + ) + + def test_trim_zeros(self): + + def arrays(): + yield np.array([]) + yield np.zeros(5) + yield np.zeros(1) + yield np.array([1, 2, 3]) + yield np.array([0, 1, 2, 3]) + yield np.array([0., 1., 2., np.nan, 0.]) + yield np.array(['0', 'Hello', 'world']) + + def explicit_trim(): + yield np.array([0, 1, 2, 0, 0]), 'FB' + yield np.array([0, 1, 2]), 'B' + yield np.array([np.nan, 0., 1.2, 2.3, 0.]), 'b' + yield np.array([0, 0, 1, 2, 5]), 'f' + if numpy_version < (2, 2): + # abf and d are not supported in numpy >= 2.2 + yield np.array([0, 1, 2, 0]), 'abf' + yield np.array([0, 4, 0]), 'd' + + yield np.array(['\0', '1', '2']), 'f' + + pyfunc = np_trim_zeros + cfunc = jit(nopython=True)(pyfunc) + + for arr in arrays(): + expected = pyfunc(arr) + got = cfunc(arr) + self.assertPreciseEqual(expected, got) + + for arr, trim in explicit_trim(): + expected = pyfunc(arr, trim) + got = cfunc(arr, trim) + self.assertPreciseEqual(expected, got) + + def test_trim_zeros_numpy(self): + # https://github.com/numpy/numpy/blob/9d8d46ad615a7e13256b930146ac369f651016c0/numpy/lib/tests/test_function_base.py#L1251-L1313 + a = np.array([0, 0, 1, 0, 2, 3, 4, 0]) + b = a.astype(float) + c = a.astype(complex) + # d = a.astype(object) + values = [a, b, c] + + # test_basic + slc = np.s_[2:-1] + for arr in values: + res = np_trim_zeros(arr) + self.assertPreciseEqual(res, arr[slc]) + + # test_leading_skip + slc = np.s_[:-1] + for arr in values: + res = np_trim_zeros(arr, trim='b') + self.assertPreciseEqual(res, arr[slc]) + + # test_trailing_skip + slc = np.s_[2:] + for arr in values: + res = np_trim_zeros(arr, trim='F') + self.assertPreciseEqual(res, arr[slc]) + + # test_all_zero + for _arr in values: + arr = np.zeros_like(_arr, dtype=_arr.dtype) + + res1 = np_trim_zeros(arr, trim='B') + assert len(res1) == 0 + + res2 = np_trim_zeros(arr, trim='f') + assert len(res2) == 0 + + # test_size_zero + arr = np.zeros(0) + res = np_trim_zeros(arr) + self.assertPreciseEqual(arr, res) + + # test_overflow + for arr in [np.array([0, 2**62, 0]), np.array([0, 2**63, 0]), + np.array([0, 2**64, 0])]: + slc = np.s_[1:2] + res = np_trim_zeros(arr) + self.assertPreciseEqual(res, arr[slc]) + + # test_no_trim + arr = np.array([None, 1, None]) + res = np_trim_zeros(arr) + self.assertPreciseEqual(arr, res) + + # test_list_to_list + res = np_trim_zeros(a.tolist()) + assert isinstance(res, list) + + def test_trim_zeros_exceptions(self): + self.disable_leak_check() + cfunc = jit(nopython=True)(np_trim_zeros) + + with self.assertRaises(TypingError) as raises: + cfunc(np.array([[1, 2, 3], [4, 5, 6]])) + self.assertIn( + 'array must be 1D', + str(raises.exception) + ) + + with self.assertRaises(TypingError) as raises: + cfunc(3) + self.assertIn( + 'The first argument must be an array', + str(raises.exception) + ) + + with self.assertRaises(TypingError) as raises: + cfunc({0, 1, 2}) + self.assertIn( + 'The first argument must be an array', + str(raises.exception) + ) + + with self.assertRaises(TypingError) as raises: + cfunc(np.array([0, 1, 2]), 1) + self.assertIn( + 'The second argument must be a string', + str(raises.exception) + ) + + def test_union1d(self): + pyfunc = np_union1d + cfunc = jit(nopython=True)(pyfunc) + arrays = [ + # Test 1d arrays + ( + np.array([1, 2, 3]), + np.array([2, 3, 4]) + ), + # Test 2d with 1d array + ( + np.array([[1, 2, 3], [2, 3, 4]]), + np.array([2, 5, 6]) + ), + # Test 3d with 1d array + ( + np.arange(0, 20).reshape(2,2,5), + np.array([1, 20, 21]) + ), + # Test 2d with 3d array + ( + np.arange(0, 10).reshape(2,5), + np.arange(0, 20).reshape(2,5,2) + ), + # Test other array-like + ( + np.array([False, True, 7]), + np.array([1, 2, 3]) + ) + ] + + for a, b in arrays: + expected = pyfunc(a,b) + got = cfunc(a,b) + self.assertPreciseEqual(expected, got) + + def test_union1d_exceptions(self): + cfunc = jit(nopython=True)(np_union1d) + self.disable_leak_check() + + # Test inputs not array-like + with self.assertRaises(TypingError) as raises: + cfunc("Hello", np.array([1,2])) + self.assertIn( + "The arguments to np.union1d must be array-like", + str(raises.exception) + ) + with self.assertRaises(TypingError) as raises: + cfunc(np.array([1,2]), "Hello") + self.assertIn( + "The arguments to np.union1d must be array-like", + str(raises.exception) + ) + with self.assertRaises(TypingError) as raises: + cfunc("Hello", "World") + self.assertIn( + "The arguments to np.union1d must be array-like", + str(raises.exception) + ) + + # Test Unicode array exceptions + with self.assertRaises(TypingError) as raises: + cfunc(np.array(['hello', 'world']), np.array(['a', 'b'])) + self.assertIn( + "For Unicode arrays, arrays must have same dtype", + str(raises.exception) + ) + with self.assertRaises(TypingError) as raises: + cfunc(np.array(['c', 'd']), np.array(['foo', 'bar'])) + self.assertIn( + "For Unicode arrays, arrays must have same dtype", + str(raises.exception) + ) + with self.assertRaises(TypingError) as raises: + cfunc(np.array(['c', 'd']), np.array([1, 2])) + self.assertIn( + "For Unicode arrays, arrays must have same dtype", + str(raises.exception) + ) + with self.assertRaises(TypingError) as raises: + cfunc(np.array(['c', 'd']), np.array([1.1, 2.5])) + self.assertIn( + "For Unicode arrays, arrays must have same dtype", + str(raises.exception) + ) + + def test_asarray_chkfinite(self): + pyfunc = np_asarray_chkfinite + cfunc = jit(nopython=True)(pyfunc) + self.disable_leak_check() + + pairs = [ + #1D array with all args + ( + np.array([1, 2, 3]), + np.float32, + ), + #1D array + ( + np.array([1, 2, 3]), + ), + #1D array-like + ( + [1, 2, 3, 4], + ), + # 2x2 (n-dims) + ( + np.array([[1, 2], [3, 4]]), + np.float32, + ), + # 2x2 array-like (n-dims) + ( + ((1, 2), (3, 4)), + np.int64 + ), + # 2x2 (1-dim) with type promotion + ( + np.array([1, 2], dtype=np.int64), + ), + # 3x2 (with higher order broadcasting) + ( + np.arange(36).reshape(6, 2, 3), + ), + ] + + for pair in pairs: + expected = pyfunc(*pair) + got = cfunc(*pair) + self.assertPreciseEqual(expected, got) + + def test_asarray_chkfinite_exceptions(self): + cfunc = jit(nopython=True)(np_asarray_chkfinite) + self.disable_leak_check() + + #test for single value + with self.assertRaises(TypingError) as e: + cfunc(2) + msg = "The argument to np.asarray_chkfinite must be array-like" + self.assertIn(msg, str(e.exception)) + + #test for NaNs + with self.assertRaises(ValueError) as e: + cfunc(np.array([2, 4, np.nan, 5])) + self.assertIn("array must not contain infs or NaNs", str(e.exception)) + + #test for infs + with self.assertRaises(ValueError) as e: + cfunc(np.array([1, 2, np.inf, 4])) + self.assertIn("array must not contain infs or NaNs", str(e.exception)) + + #test for dtype + with self.assertRaises(TypingError) as e: + cfunc(np.array([1, 2, 3, 4]), 'float32') + self.assertIn("dtype must be a valid Numpy dtype", str(e.exception)) + + def test_unwrap_basic(self): + pyfunc = unwrap + cfunc = njit(pyfunc) + + pyfunc1 = unwrap1 + cfunc1 = njit(pyfunc1) + + pyfunc13 = unwrap13 + cfunc13 = njit(pyfunc13) + + pyfunc123 = unwrap123 + cfunc123 = njit(pyfunc123) + # Based on tests from https://github.com/numpy/numpy/blob/3032e84ff34f20def2ef4ebf9f8695947af3fd24/numpy/lib/tests/test_function_base.py#L1979-L2003 # noqa: E501 + # Additional tests are included to ensure proper support for + # higher dimensional arrays + + # p only + def inputs1(): + yield np.array([1, 1 + 2 * np.pi]) + phase = np.linspace(0, np.pi, num=5) + phase[3:] += np.pi + yield phase + yield np.arange(16).reshape((4,4)) + yield np.arange(160, step=10).reshape((4,4)) + yield np.arange(240, step=10).reshape((2,3,4)) + + for p in inputs1(): + self.assertPreciseEqual(pyfunc1(p), cfunc1(p)) + + uneven_seq = np.array([0, 75, 150, 225, 300, 430]) + wrap_uneven = np.mod(uneven_seq, 250) + + # p and period only + def inputs13(): + yield np.array([1, 1 + 256]), 255 + yield np.array([0, 75, 150, 225, 300]), 255 + yield np.array([0, 1, 2, -1, 0]), 4 + yield np.array([2, 3, 4, 5, 2, 3, 4, 5]), 4 + yield wrap_uneven, 250 + + # check that you can set axis=-1 without errors + self.assertPreciseEqual(pyfunc(wrap_uneven, axis=-1, period=250), + cfunc(wrap_uneven, axis=-1, period=250)) + + for p, period in inputs13(): + self.assertPreciseEqual(pyfunc13(p, period=period), + cfunc13(p, period=period)) + + # p, period and discont + def inputs123(): + yield wrap_uneven, 250, 140 + + for p, period, discont in inputs123(): + self.assertPreciseEqual(pyfunc123(p, period=period, + discont=discont), + cfunc123(p, period=period, + discont=discont)) + + def test_unwrap_exception(self): + cfunc = njit(unwrap) + self.disable_leak_check() + + with self.assertRaises(TypingError) as e: + cfunc('abc') + self.assertIn('The argument "p" must be array-like', + str(e.exception)) + + with self.assertRaises(TypingError) as e: + cfunc(np.array([1, 2]), 'abc') + self.assertIn('The argument "discont" must be a scalar', + str(e.exception)) + + with self.assertRaises(TypingError) as e: + cfunc(np.array([1, 2]), 3, period='abc') + self.assertIn('The argument "period" must be a scalar', + str(e.exception)) + + with self.assertRaises(TypingError) as e: + cfunc(np.array([1, 2]), 3, axis='abc') + self.assertIn('The argument "axis" must be an integer', + str(e.exception)) + + with self.assertRaises(ValueError) as e: + cfunc(np.array([1, 2]), 3, axis=2) + self.assertIn('Value for argument "axis" is not supported', + str(e.exception)) + + def test_swapaxes_basic(self): + pyfunc = swapaxes + cfunc = jit(nopython=True)(pyfunc) + + def a_variations(): + yield np.arange(10) + yield np.arange(10).reshape(2, 5) + yield np.arange(60).reshape(5, 4, 3) + + for a in a_variations(): + for a1 in range(-a.ndim, a.ndim): + for a2 in range(-a.ndim, a.ndim): + expected = pyfunc(a, a1, a2) + got = cfunc(a, a1, a2) + self.assertPreciseEqual(expected, got) + + def test_swapaxes_exception(self): + pyfunc = swapaxes + cfunc = jit(nopython=True)(pyfunc) + + # Exceptions leak references + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc('abc', 0, 0) + + self.assertIn('The first argument "a" must be an array', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(np.arange(4), 'abc', 0) + + self.assertIn('The second argument "axis1" must be an integer', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(np.arange(4), 0, 'abc') + + self.assertIn('The third argument "axis2" must be an integer', + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc(np.arange(4), 1, 0) + + self.assertIn('np.swapaxes: Argument axis1 out of bounds', + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc(np.arange(8).reshape(2, 4), 0, -3) + + self.assertIn('np.swapaxes: Argument axis2 out of bounds', + str(raises.exception)) + + def test_take_along_axis(self): + a = np.arange(24).reshape((3, 1, 4, 2)) + + # For now axis must be literal, test explicitly defined implementations + @njit + def axis_none(a, i): + return np.take_along_axis(a, i, axis=None) + + indices = np.array([1, 2], dtype=np.uint64) + self.assertPreciseEqual(axis_none(a, indices), + axis_none.py_func(a, indices)) + + def gen(axis): + @njit + def impl(a, i): + return np.take_along_axis(a, i, axis) + return impl + + for i in range(-1, a.ndim): + jfunc = gen(i) + ai = np.argsort(a, axis=i) + self.assertPreciseEqual(jfunc(a, ai), jfunc.py_func(a, ai)) + + def test_take_along_axis_broadcasting(self): + # Based on + # https://github.com/numpy/numpy/blob/v1.21.0/numpy/lib/tests/test_shape_base.py#L74-L79 + # This demonstrates that arrays are broadcast before the algorithm is + # applied. + arr = np.ones((3, 4, 1)) + ai = np.ones((1, 2, 5), dtype=np.intp) + + def gen(axis): + @njit + def impl(a, i): + return np.take_along_axis(a, i, axis) + return impl + + # Check same axis but expressed as positive/negative value + for i in (1, -2): + check = gen(i) + expected = check.py_func(arr, ai) + actual = check(arr, ai) + self.assertPreciseEqual(expected, actual) + self.assertEqual(actual.shape, (3, 2, 5)) + + def test_take_along_axis_exceptions(self): + arr2d = np.arange(8).reshape(2, 4) + # Valid indices when axis=None is passed to take_along_axis: + indices_none = np.array([0, 1], dtype=np.uint64) + indices = np.ones((2, 4), dtype=np.uint64) + + # For now axis must be literal, so we need to construct functions with + # explicit axis: + def gen(axis): + @njit + def impl(a, i): + return np.take_along_axis(a, i, axis) + return impl + + with self.assertRaises(TypingError) as raises: + gen("a")(arr2d, indices) + self.assertIn("axis must be an integer", str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + gen(-3)(arr2d, indices) + self.assertIn("axis is out of bounds", str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + gen(2)(arr2d, indices) + self.assertIn("axis is out of bounds", str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + gen(None)(12, indices_none) + self.assertIn('"arr" must be an array', str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + gen(None)(arr2d, 5) + self.assertIn('"indices" must be an array', str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + gen(None)(arr2d, np.array([0.0, 1.0])) + self.assertIn( + 'indices array must contain integers', + str(raises.exception) + ) + + @njit + def not_literal_axis(a, i, axis): + return np.take_along_axis(a, i, axis) + + with self.assertRaises(TypingError) as raises: + not_literal_axis(arr2d, indices, 0) + self.assertIn("axis must be a literal value", str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + gen(0)(arr2d, np.array([0, 1], dtype=np.uint64)) + self.assertIn("must have the same number of dimensions", + str(raises.exception)) + + # With axis None, array's ndim is implicitly 1. + with self.assertRaises(TypingError) as raises: + gen(None)(arr2d, arr2d) + self.assertIn("must have the same number of dimensions", + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + gen(0)(arr2d, np.ones((2, 3), dtype=np.uint64)) + self.assertIn("dimensions don't match", str(raises.exception)) + # Exceptions leak references + self.disable_leak_check() + + def test_nan_to_num(self): + # Test cases are from + # https://github.com/numpy/numpy/blob/8ff45c5bb520db04af8720bf1d34a392a8d2561a/numpy/lib/tests/test_type_check.py#L350-L452 + values = [ + np.nan, + 1, + 1.1, + 1 + 1j, + complex(-np.inf, np.nan), + complex(np.nan, np.nan), + np.array([1], dtype=int), + np.array([complex(-np.inf, np.inf), complex(1, np.nan), + complex(np.nan, 1), complex(np.inf, -np.inf)]), + np.array([0.1, 1.0, 0.4]), + np.array([1, 2, 3]), + np.array([[0.1, 1.0, 0.4], [0.4, 1.2, 4.0]]), + np.array([0.1, np.nan, 0.4]), + np.array([[0.1, np.nan, 0.4], [np.nan, 1.2, 4.0]]), + np.array([-np.inf, np.nan, np.inf]), + np.array([-np.inf, np.nan, np.inf], dtype=np.float32) + ] + nans = [0.0, 10] + + pyfunc = nan_to_num + cfunc = njit(nan_to_num) + + for value, nan in product(values, nans): + expected = pyfunc(value, nan=nan) + got = cfunc(value, nan=nan) + self.assertPreciseEqual(expected, got) + + def test_nan_to_num_copy_false(self): + # Check that copy=False operates in-place. + cfunc = njit(nan_to_num) + + x = np.array([0.1, 0.4, np.nan]) + expected = 1.0 + cfunc(x, copy=False, nan=expected) + self.assertPreciseEqual(x[-1], expected) + + x_complex = np.array([0.1, 0.4, complex(np.nan, np.nan)]) + cfunc(x_complex, copy=False, nan=expected) + self.assertPreciseEqual(x_complex[-1], 1. + 1.j) + + def test_nan_to_num_invalid_argument(self): + cfunc = njit(nan_to_num) + + with self.assertTypingError() as raises: + cfunc("invalid_input") + self.assertIn("The first argument must be a scalar or an array-like", + str(raises.exception)) + + def test_diagflat_basic(self): + pyfunc1 = diagflat1 + cfunc1 = njit(pyfunc1) + pyfunc2 = diagflat2 + cfunc2 = njit(pyfunc2) + + def inputs(): + yield np.array([1,2]), 1 + yield np.array([[1,2],[3,4]]), -2 + yield np.arange(8).reshape((2,2,2)), 2 + yield [1, 2], 1 + yield np.array([]), 1 + + for v, k in inputs(): + self.assertPreciseEqual(pyfunc1(v), cfunc1(v)) + self.assertPreciseEqual(pyfunc2(v, k), cfunc2(v, k)) + + def test_diagflat1_exception(self): + pyfunc = diagflat1 + cfunc = njit(pyfunc) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc") + self.assertIn('The argument "v" must be array-like', + str(raises.exception)) + + def test_diagflat2_exception(self): + pyfunc = diagflat2 + cfunc = njit(pyfunc) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc", 2) + self.assertIn('The argument "v" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc([1, 2], "abc") + self.assertIn('The argument "k" must be an integer', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc([1, 2], 3.0) + self.assertIn('The argument "k" must be an integer', + str(raises.exception)) + + @staticmethod + def _setxor_arrays(): + yield (List.empty_list(types.float64), + List.empty_list(types.float64)) # two empty arrays + yield [1], List.empty_list(types.float64) # empty right + yield List.empty_list(types.float64), [1] # empty left + yield [1], [2] # singletons - xor == union + yield [1], [1] # singletons - xor == nothing + yield [1, 2], [1] + yield [1, 2, 2], [2, 2] + yield [1, 2, 2], [2, 2, 3] + yield [1, 2], [2, 1] + yield [1, 2, 3], [1, 2, 3] + yield [2, 3, 4, 0], [1, 3] + # from numpy: + # https://github.com/numpy/numpy/blob/b0371ef240560e78b651a5d7c9407ae3212a3d56/numpy/lib/tests/test_arraysetops.py#L86 # noqa: E501 + yield [5, 7, 1, 2], [2, 4, 3, 1, 5] + yield [1, 2, 3], [6, 5, 4] + yield [1, 8, 2, 3], [1, 2, 3, 4, 5, 6] + + def test_setxor1d_2(self): + np_pyfunc = np_setxor1d_2 + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2): + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + expected = np_pyfunc(ar1, ar2) + got = np_nbfunc(ar1, ar2) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._setxor_arrays(): + check(a, b) + + def test_setxor1d_3(self): + np_pyfunc = np_setxor1d_3 + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2, assume_unique=False): + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + expected = np_pyfunc(ar1, ar2, assume_unique) + got = np_nbfunc(ar1, ar2, assume_unique) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._setxor_arrays(): + check(a, b) + if len(np.unique(a)) == len(a) and len(np.unique(b)) == len(b): + check(a, b, True) + + def test_setxor1d_errors(self): + np_pyfunc = np_setxor1d_3 + np_nbfunc = njit(np_pyfunc) + + a = np.array([1]) + b = np.array([2]) + self.disable_leak_check() + with self.assertRaises(TypingError): + np_nbfunc(a, b, "foo") + with self.assertRaises(TypingError): + np_nbfunc("foo", b, True) + with self.assertRaises(TypingError): + np_nbfunc(a, "foo", True) + + @staticmethod + def _setdiff_arrays(): + yield (List.empty_list(types.float64), + List.empty_list(types.float64)) # two empty arrays + yield [1], List.empty_list(types.float64) # empty right + yield List.empty_list(types.float64), [1] # empty left + yield [1], [2] # singletons - diff == [1] + yield [1], [1] # singletons - diff == nothing + yield [1, 2], [1] + yield [1, 2, 2], [2, 2] + yield [1, 2, 2], [2, 2, 3] + yield [1, 2], [2, 1] + yield [1, 2, 3], [1, 2, 3] + yield [2, 3, 4, 0], [1, 3] + + # https://github.com/numpy/numpy/blob/b0371ef240560e78b651a5d7c9407ae3212a3d56/numpy/lib/tests/test_arraysetops.py#L558 # noqa: E501 + yield (np.array([6, 5, 4, 7, 1, 2, 7, 4]), + np.array([2, 4, 3, 3, 2, 1, 5])) + yield np.arange(21), np.arange(19) + yield np.array([3, 2, 1]), np.array([7, 5, 2]) + + def test_setdiff1d_2(self): + np_pyfunc = np_setdiff1d_2 + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2): + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + expected = np_pyfunc(ar1, ar2) + got = np_nbfunc(ar1, ar2) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._setdiff_arrays(): + check(a, b) + + def test_setdiff1d_3(self): + np_pyfunc = np_setdiff1d_3 + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2, assume_unique=False): + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + expected = np_pyfunc(ar1, ar2, assume_unique) + got = np_nbfunc(ar1, ar2, assume_unique) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._setdiff_arrays(): + check(a, b) + if len(np.unique(a)) == len(a) and len(np.unique(b)) == len(b): + check(a, b, True) + + def test_setdiff1d_errors(self): + np_pyfunc = np_setdiff1d_3 + np_nbfunc = njit(np_pyfunc) + + a = np.array([1]) + b = np.array([2]) + self.disable_leak_check() + with self.assertRaises(TypingError): + np_nbfunc(a, b, "foo") + with self.assertRaises(TypingError): + np_nbfunc("foo", b, True) + with self.assertRaises(TypingError): + np_nbfunc(a, "foo", True) + + @staticmethod + def _in1d_arrays(): + yield (List.empty_list(types.float64), + List.empty_list(types.float64)) # two empty arrays + yield [1], List.empty_list(types.float64) # empty right + yield List.empty_list(types.float64), [1] # empty left + yield [1], [2] # singletons - False + yield [1], [1] # singletons - True + yield [1, 2], [1] + yield [1, 2, 2], [2, 2] + yield [1, 2, 2], [2, 2, 3] + yield [1, 2], [2, 1] + yield [1, 2, 3], [1, 2, 3] + yield [2, 3, 4, 0], [3, 1] + yield [2, 3], np.arange(20) # Test the "sorting" method. + yield [2, 3], np.tile(np.arange(5), 4) + + def test_in1d_2(self): + np_pyfunc = np_in1d_2 + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2): + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + expected = np_pyfunc(ar1, ar2) + got = np_nbfunc(ar1, ar2) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._in1d_arrays(): + check(a, b) + + def test_in1d_3a(self): + np_pyfunc = np_in1d_3a + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2, assume_unique=False): + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + expected = np_pyfunc(ar1, ar2, assume_unique) + got = np_nbfunc(ar1, ar2, assume_unique) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._in1d_arrays(): + check(a, b) + if len(np.unique(a)) == len(a) and len(np.unique(b)) == len(b): + check(a, b, assume_unique=True) + + def test_in1d_3b(self): + np_pyfunc = np_in1d_3b + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2, invert=False): + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + expected = np_pyfunc(ar1, ar2, invert) + got = np_nbfunc(ar1, ar2, invert) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._in1d_arrays(): + check(a, b, invert=False) + check(a, b, invert=True) + + def test_in1d_4(self): + np_pyfunc = np_in1d_4 + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2, assume_unique=False, invert=False): + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + expected = np_pyfunc(ar1, ar2, assume_unique, invert) + got = np_nbfunc(ar1, ar2, assume_unique, invert) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._in1d_arrays(): + check(a, b, invert=False) + check(a, b, invert=True) + if len(np.unique(a)) == len(a) and len(np.unique(b)) == len(b): + check(a, b, assume_unique=True, invert=False) + check(a, b, assume_unique=True, invert=True) + + def test_in1d_errors(self): + np_pyfunc = np_in1d_4 + np_nbfunc = njit(np_pyfunc) + + a = np.array([1]) + b = np.array([2]) + x = np_nbfunc(a, b) + self.assertPreciseEqual(x, np.array([False])) + + self.disable_leak_check() + with self.assertRaises(TypingError): + np_nbfunc(a, b, "foo", False) + with self.assertRaises(TypingError): + np_nbfunc(a, b, False, "foo") + with self.assertRaises(TypingError): + np_nbfunc("foo", b, True, False) + with self.assertRaises(TypingError): + np_nbfunc(a, "foo", True, False) + + @njit() + def np_in1d_kind(a, b, kind): + return np.in1d(a, b, kind=kind) + + with self.assertRaises(TypingError): + np_in1d_kind(a, b, kind=None) + with self.assertRaises(TypingError): + np_in1d_kind(a, b, kind="table") + + @staticmethod + def _isin_arrays(): + yield (List.empty_list(types.float64), + List.empty_list(types.float64)) # two empty arrays + yield (np.zeros((1, 0), dtype=np.int64), + List.empty_list(types.int64)) # two-dim array - shape (1, 0) + yield (np.zeros((0, 0), dtype=np.int64), + List.empty_list(types.int64)) + yield (np.zeros((0, 1), dtype=np.int64), + List.empty_list(types.int64)) + yield [1], List.empty_list(types.float64) # empty right + yield List.empty_list(types.float64), [1] # empty left + yield [1], [2] # singletons - False + yield [1], [1] # singletons - True + yield [1, 2], [1] + yield [1, 2, 2], [2, 2] + yield [1, 2, 2], [2, 2, 3] + yield [1, 2], [2, 1] + yield [2, 3], np.arange(20) # Test the "sorting" method. + yield [2, 3], np.tile(np.arange(5), 4) + yield np.arange(30).reshape(2, 3, 5), [5, 7, 10, 15] # 3d + + # from numpy + # https://github.com/numpy/numpy/blob/b0371ef240560e78b651a5d7c9407ae3212a3d56/numpy/lib/tests/test_arraysetops.py#L200 # noqa: E501 + a = np.arange(24).reshape([2, 3, 4]) + b = np.array([[10, 20, 30], [0, 1, 3], [11, 22, 33]]) + yield a, b + yield np.array(3), b + yield a, np.array(3) + yield np.array(3), np.array(3) + yield 5, b + yield a, 6 + yield 5, 6 + yield List.empty_list(types.int64), b + yield a, List.empty_list(types.int64) + + for dtype in [bool, np.int64, np.float64]: + if dtype in {np.int64, np.float64}: + ar = np.array([10, 20, 30], dtype=dtype) + elif dtype in {bool}: + ar = np.array([True, False, False]) + + empty_array = np.array([], dtype=dtype) + + yield empty_array, ar + yield ar, empty_array + yield empty_array, empty_array + + for mult in (1, 10): + yield [5, 7, 1, 2], [2, 4, 3, 1, 5] * mult + yield [8, 7, 1, 2], [2, 4, 3, 1, 5] * mult + yield [4, 7, 1, 8], [2, 4, 3, 1, 5] * mult + a = [5, 4, 5, 3, 4, 4, 3, 4, 3, 5, 2, 1, 5, 5] + yield a, [2, 3, 4] * mult + yield a, [2, 3, 4] * mult + [5, 5, 4] * mult + yield np.array([5, 7, 1, 2]), np.array([2, 4, 3, 1, 5] * mult) + yield np.array([5, 7, 1, 1, 2]), np.array([2, 4, 3, 3, 1, 5] * mult) + yield np.array([5, 5]), np.array([2, 2] * mult) + + yield np.array([5]), np.array([2]) + yield np.array([True, False]), np.array([False, False, False]) + + for dtype1, dtype2 in [ + (np.int8, np.int16), + (np.int16, np.int8), + (np.uint8, np.uint16), + (np.uint16, np.uint8), + (np.uint8, np.int16), + (np.int16, np.uint8), + ]: + is_dtype2_signed = np.issubdtype(dtype2, np.signedinteger) + ar1 = np.array([0, 0, 1, 1], dtype=dtype1) + + if is_dtype2_signed: + ar2 = np.array([-128, 0, 127], dtype=dtype2) + else: + ar2 = np.array([127, 0, 255], dtype=dtype2) + + yield ar1, ar2 + + for dtype in np.typecodes["AllInteger"]: + a = np.array([True, False, False], dtype=bool) + b = np.array([0, 0, 0, 0], dtype=dtype) + yield a, b + yield b, a + + def test_isin_2(self): + np_pyfunc = np_isin_2 + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2): + expected = np_pyfunc(ar1, ar2) + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + got = np_nbfunc(ar1, ar2) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._isin_arrays(): + check(a, b) + + def test_isin_3a(self): + np_pyfunc = np_isin_3a + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2, assume_unique=False): + expected = np_pyfunc(ar1, ar2, assume_unique) + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + got = np_nbfunc(ar1, ar2, assume_unique) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._isin_arrays(): + check(a, b) + + try: + len_a = len(a) + except TypeError: + len_a = 1 + try: + len_b = len(b) + except TypeError: + len_b = 1 + if len(np.unique(a)) == len_a and len(np.unique(b)) == len_b: + check(a, b, assume_unique=True) + + def test_isin_3b(self): + np_pyfunc = np_isin_3b + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2, invert=False): + expected = np_pyfunc(ar1, ar2, invert) + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + got = np_nbfunc(ar1, ar2, invert) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._isin_arrays(): + check(a, b, invert=False) + check(a, b, invert=True) + + def test_isin_4(self): + np_pyfunc = np_isin_4 + np_nbfunc = njit(np_pyfunc) + + def check(ar1, ar2, assume_unique=False, invert=False): + expected = np_pyfunc(ar1, ar2, assume_unique, invert) + if isinstance(ar1, list): + ar1 = List(ar1) + if isinstance(ar2, list): + ar2 = List(ar2) + got = np_nbfunc(ar1, ar2, assume_unique, invert) + self.assertPreciseEqual(expected, got, msg=f"ar1={ar1}, ar2={ar2}") + + for a, b in self._isin_arrays(): + check(a, b, invert=False) + check(a, b, invert=True) + + try: + len_a = len(a) + except TypeError: + len_a = 1 + try: + len_b = len(b) + except TypeError: + len_b = 1 + if len(np.unique(a)) == len_a and len(np.unique(b)) == len_b: + check(a, b, assume_unique=True, invert=False) + check(a, b, assume_unique=True, invert=True) + + def test_isin_errors(self): + np_pyfunc = np_isin_4 + np_nbfunc = njit(np_pyfunc) + + a = np.array([1]) + b = np.array([2]) + x = np_nbfunc(a, b) + self.assertPreciseEqual(x, np.array([False])) + + self.disable_leak_check() + with self.assertRaises(TypingError): + np_nbfunc(a, b, "foo", False) + with self.assertRaises(TypingError): + np_nbfunc(a, b, False, "foo") + with self.assertRaises(TypingError): + np_nbfunc("foo", b, True, False) + with self.assertRaises(TypingError): + np_nbfunc(a, "foo", True, False) + + @njit() + def np_isin_kind(a, b, kind): + return np.isin(a, b, kind=kind) + + with self.assertRaises(TypingError): + np_isin_kind(a, b, kind=None) + with self.assertRaises(TypingError): + np_isin_kind(a, b, kind="table") + + def test_setops_manyways(self): + # https://github.com/numpy/numpy/blob/b0371ef240560e78b651a5d7c9407ae3212a3d56/numpy/lib/tests/test_arraysetops.py#L588 # noqa: E501 + nb_setxor1d = njit(np_setxor1d_2) + nb_intersect1d = njit(intersect1d_2) + nb_union1d = njit(np_union1d) + nb_setdiff1d = njit(np_setdiff1d_2) + + a = np.array([5, 7, 1, 2, 8]) + b = np.array([9, 8, 2, 4, 3, 1, 5]) + + c1 = nb_setxor1d(a, b) + aux1 = nb_intersect1d(a, b) + aux2 = nb_union1d(a, b) + c2 = nb_setdiff1d(aux2, aux1) + self.assertPreciseEqual(c1, c2) + + +class TestNPMachineParameters(TestCase): + # tests np.finfo, np.iinfo, np.MachAr + + template = ''' +def foo(): + ty = np.%s + return np.%s(ty) +''' + + def check(self, func, attrs, *args): + pyfunc = func + cfunc = jit(nopython=True)(pyfunc) + + expected = pyfunc(*args) + got = cfunc(*args) + + # check result + for attr in attrs: + self.assertPreciseEqual(getattr(expected, attr), + getattr(got, attr)) + + def create_harcoded_variant(self, basefunc, ty): + #create an instance of using the function with a hardcoded type + #and eval it into existence, return the function for use + tystr = ty.__name__ + basestr = basefunc.__name__ + funcstr = self.template % (tystr, basestr) + dct = {} + exec(compile(funcstr, '', 'exec'), globals(), dct) + return dct['foo'] + + def test_finfo(self): + types = [np.float32, np.float64, np.complex64, np.complex128] + attrs = ('eps', 'epsneg', 'iexp', 'machep', 'max', 'maxexp', 'negep', + 'nexp', 'nmant', 'precision', 'resolution', 'tiny', 'bits',) + for ty in types: + self.check(finfo, attrs, ty(1)) + hc_func = self.create_harcoded_variant(np.finfo, ty) + self.check(hc_func, attrs) + + # check unsupported attr raises + with self.assertRaises(TypingError) as raises: + cfunc = jit(nopython=True)(finfo_machar) + cfunc(7.) + msg = "Unknown attribute 'machar' of type finfo" + self.assertIn(msg, str(raises.exception)) + + # check invalid type raises + with self.assertTypingError(): + cfunc = jit(nopython=True)(finfo) + cfunc(np.int32(7)) + + def test_iinfo(self): + # check types and instances of types + types = [np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, + np.uint32, np.uint64] + attrs = ('min', 'max', 'bits',) + for ty in types: + self.check(iinfo, attrs, ty(1)) + hc_func = self.create_harcoded_variant(np.iinfo, ty) + self.check(hc_func, attrs) + + # check invalid type raises + with self.assertTypingError(): + cfunc = jit(nopython=True)(iinfo) + cfunc(np.float64(7)) + + +class TestRegistryImports(TestCase): + + def test_unsafe_import_in_registry(self): + # See 8940 + # This should not fail + code = dedent(""" + import numba + import numpy as np + @numba.njit + def foo(): + np.array([1 for _ in range(1)]) + foo() + print("OK") + """) + result, error = run_in_subprocess(code) + # Assert that the bytestring "OK" was printed to stdout + self.assertEqual(b"OK", result.strip()) + self.assertEqual(b"", error.strip(), msg=f"--ERROR--\n{error}\n") + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_np_randomgen.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_np_randomgen.py new file mode 100644 index 0000000000000000000000000000000000000000..1f66590eefaa6c00cb86ca4b6c1bc5def5077687 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_np_randomgen.py @@ -0,0 +1,1273 @@ +import numba +import numpy as np +import sys +import itertools +import gc +import re + +from numba import types +from numba.tests.support import TestCase, MemoryLeakMixin +from numba.np.random.generator_methods import _get_proper_func +from numba.np.random.generator_core import next_uint32, next_uint64, next_double +from numpy.random import MT19937, Generator +from numba.core.errors import TypingError +from numba.tests.support import run_in_new_process_caching, SerialMixin + + +# TODO: Following testing tolerance adjustments should be reduced +# once NumPy Generator's fmadd issue described below is resolved: +# https://github.com/numba/numba/pull/8038#issuecomment-1165571368 +# The progress is being tracked as one of the tasks in: +# https://github.com/numba/numba/issues/8519 +adjusted_ulp_prec = 2048 + + +class TestHelperFuncs(TestCase): + def test_proper_func_provider(self): + def test_32bit_func(): + return 32 + + def test_64bit_func(): + return 64 + + self.assertEqual(_get_proper_func(test_32bit_func, test_64bit_func, + np.float64)[0](), 64) + self.assertEqual(_get_proper_func(test_32bit_func, test_64bit_func, + np.float32)[0](), 32) + + # With any other datatype it should return a TypingError + with self.assertRaises(TypingError) as raises: + _get_proper_func(test_32bit_func, test_64bit_func, np.int32) + self.assertIn( + 'Argument dtype is not one of the expected type(s)', + str(raises.exception) + ) + with self.assertRaises(TypingError) as raises: + _get_proper_func(test_32bit_func, test_64bit_func, types.float64) + self.assertIn( + 'Argument dtype is not one of the expected type(s)', + str(raises.exception) + ) + + def test_check_types(self): + rng = np.random.default_rng(1) + py_func = lambda x: x.normal(loc=(0,)) + numba_func = numba.njit(cache=True)(py_func) + with self.assertRaises(TypingError) as raises: + numba_func(rng) + + expected_pattern = ( + r"Argument loc is not one of the expected type\(s\): " + r"\[, " + r", " + r", \]" + ) + + self.assertTrue( + re.search(expected_pattern, str(raises.exception)) is not None, + "Expected pattern not found in exception message." + + f" Found {str(raises.exception)}" + ) + + def test_integers_arg_check(self): + rng = np.random.default_rng(1) + py_func = lambda x, low, high, dtype: \ + x.integers(low=low, high=high, dtype=dtype, endpoint=True) + numba_func = numba.njit()(py_func) + numba_func_low = numba.njit()(py_func) + + py_func = lambda x, low, high, dtype: \ + x.integers(low=low, high=high, dtype=dtype, endpoint=False) + numba_func_endpoint_false = numba.njit()(py_func) + + cases = [ + # low, high, dtype + (np.iinfo(np.uint8).min, np.iinfo(np.uint8).max, np.uint8), + (np.iinfo(np.int8).min, np.iinfo(np.int8).max, np.int8), + (np.iinfo(np.uint16).min, np.iinfo(np.uint16).max, np.uint16), + (np.iinfo(np.int16).min, np.iinfo(np.int16).max, np.int16), + (np.iinfo(np.uint32).min, np.iinfo(np.uint32).max, np.uint32), + (np.iinfo(np.int32).min, np.iinfo(np.int32).max, np.int32), + ] + for low, high, dtype in cases: + with self.subTest(low=low, high=high, dtype=dtype): + with self.assertRaises(ValueError) as raises: + # min - 1 + numba_func_low(rng, low - 1, high, dtype) + self.assertIn( + 'low is out of bounds', + str(raises.exception) + ) + + with self.assertRaises(ValueError) as raises: + # max + 1, endpoint=True + numba_func(rng, low, high + 1, dtype) + self.assertIn( + 'high is out of bounds', + str(raises.exception) + ) + + with self.assertRaises(ValueError) as raises: + # max + 2, endpoint=False + numba_func_endpoint_false(rng, low, high + 2, dtype) + self.assertIn( + 'high is out of bounds', + str(raises.exception) + ) + + low, high, dtype = (np.iinfo(np.uint64).min, + np.iinfo(np.uint64).max, np.uint64) + with self.assertRaises(ValueError) as raises: + # min - 1 + numba_func_low(rng, low - 1, high, dtype) + self.assertIn( + 'low is out of bounds', + str(raises.exception) + ) + + low, high, dtype = (np.iinfo(np.int64).min, + np.iinfo(np.int64).max, np.int64) + with self.assertRaises(ValueError) as raises: + # max + 1, endpoint=True + numba_func(rng, low, high + 1, dtype) + self.assertIn( + 'high is out of bounds', + str(raises.exception) + ) + + with self.assertRaises(ValueError) as raises: + # max + 2, endpoint=False + numba_func_endpoint_false(rng, low, high + 2, dtype) + self.assertIn( + 'high is out of bounds', + str(raises.exception) + ) + + with self.assertRaises(ValueError) as raises: + numba_func(rng, 105, 100, np.uint32) + self.assertIn( + 'low is greater than high in given interval', + str(raises.exception) + ) + + +def test_generator_caching(): + nb_rng = np.random.default_rng(1) + np_rng = np.random.default_rng(1) + py_func = lambda x: x.random(10) + numba_func = numba.njit(cache=True)(py_func) + assert np.allclose(np_rng.random(10), numba_func(nb_rng)) + + +class TestRandomGenerators(MemoryLeakMixin, TestCase): + def check_numpy_parity(self, distribution_func, + bitgen_type=None, seed=None, + test_size=None, test_dtype=None, + ulp_prec=5): + + distribution_func = numba.njit(distribution_func) + if seed is None: + seed = 1 + if bitgen_type is None: + numba_rng_instance = np.random.default_rng(seed=seed) + numpy_rng_instance = np.random.default_rng(seed=seed) + else: + numba_rng_instance = Generator(bitgen_type(seed)) + numpy_rng_instance = Generator(bitgen_type(seed)) + + # Check parity for different size cases + numba_res = distribution_func(numba_rng_instance, + test_size, test_dtype) + numpy_res = distribution_func.py_func(numpy_rng_instance, + test_size, test_dtype) + + if (isinstance(numba_res, np.ndarray) and + np.issubdtype(numba_res.dtype, np.floating)) \ + or isinstance(numba_res, float): + # Float scalars and arrays + np.testing.assert_array_max_ulp(numpy_res, numba_res, + maxulp=ulp_prec, dtype=test_dtype) + else: + # Bool/int scalars and arrays + np.testing.assert_equal(numba_res, numpy_res) + + # Check if the end state of both BitGenerators is same + # after drawing the distributions + numba_gen_state = numba_rng_instance.bit_generator.state['state'] + numpy_gen_state = numpy_rng_instance.bit_generator.state['state'] + + for _state_key in numpy_gen_state: + self.assertPreciseEqual(numba_gen_state[_state_key], + numpy_gen_state[_state_key]) + + def _test_bitgen_func_parity(self, func_name, bitgen_func, seed=1): + numba_rng_instance = np.random.default_rng(seed=seed) + numpy_rng_instance = np.random.default_rng(seed=seed) + + numpy_func = getattr(numpy_rng_instance.bit_generator.ctypes, func_name) + numpy_res = numpy_func(numpy_rng_instance.bit_generator.ctypes.state) + + numba_func = numba.njit(lambda x: bitgen_func(x.bit_generator)) + numba_res = numba_func(numba_rng_instance) + + self.assertPreciseEqual(numba_res, numpy_res) + + def _check_invalid_types(self, dist_func, arg_list, + valid_args, invalid_args): + rng = np.random.default_rng() + for idx, _arg in enumerate(arg_list): + curr_args = valid_args.copy() + curr_args[idx] = invalid_args[idx] + curr_args = [rng] + curr_args + nb_dist_func = numba.njit(dist_func) + with self.assertRaises(TypingError) as raises: + nb_dist_func(*curr_args) + self.assertIn( + f'Argument {_arg} is not one of the expected type(s):', + str(raises.exception) + ) + + def test_npgen_boxing_unboxing(self): + rng_instance = np.random.default_rng() + numba_func = numba.njit(lambda x: x) + self.assertEqual(rng_instance, numba_func(rng_instance)) + self.assertEqual(id(rng_instance), id(numba_func(rng_instance))) + + def test_npgen_boxing_refcount(self): + rng_instance = np.random.default_rng() + no_box = numba.njit(lambda x:x.random()) + do_box = numba.njit(lambda x:x) + + y = do_box(rng_instance) + gc.collect() + ref_1 = sys.getrefcount(rng_instance) + del y + no_box(rng_instance) + gc.collect() + ref_2 = sys.getrefcount(rng_instance) + + self.assertEqual(ref_1, ref_2 + 1) + + def test_bitgen_funcs(self): + func_names = ["next_uint32", "next_uint64", "next_double"] + funcs = [next_uint32, next_uint64, next_double] + + for _func, _func_name in zip(funcs, func_names): + with self.subTest(_func=_func, _func_name=_func_name): + self._test_bitgen_func_parity(_func_name, _func) + + def test_integers(self): + test_sizes = [None, (), (100,), (10, 20, 30)] + test_dtypes = [np.int64, np.int32, np.int16, np.int8, + np.uint64, np.uint32, np.uint16, np.uint8] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.integers(0, 100) + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None, ulp_prec=0) + + dist_func = lambda x, size, dtype:\ + x.integers(5, 10, size=size, dtype=dtype) + for _size in test_sizes: + for _dtype in test_dtypes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _dtype=_dtype, + _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, _dtype, 0) + + # Checking dtype = bool seperately + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:\ + x.integers(False, True, size=size, dtype=np.bool_) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, + _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, np.bool_, 0) + + # Test dtype casting for high and low + dist_func = lambda x, size, dtype: \ + x.integers(np.uint8(0), np.int64(100)) + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None) + + dist_func = lambda x, low, high, size, dtype, endpoint:\ + x.integers(low=low, high=high, size=size, + dtype=dtype, endpoint=endpoint) + self._check_invalid_types(dist_func, + ['low', 'high', 'size', 'dtype', 'endpoint'], + [1, 5, (1,), np.int64, True], + ['x', 'x', ('x',), np.float64, 'x']) + + # Testing .integers() dtype wise + def test_integers_cases(self): + cases = [ + # low, high, dtype + (5, 6, np.uint64), # rng == 0 (rng stands for range) + (5, 100, np.uint64), # rng <= 0xFFFFFFFF + (0, 0xFFFFFFFFFF, np.uint64), # rng > 0xFFFFFFFF + (0, 0xFFFFFFFFFFFFFFFF - 1, np.uint64),# rng == 0xFFFFFFFFFFFFFFFF-1 + (0, 0xFFFFFFFFFFFFFFFF, np.uint64), # rng == 0xFFFFFFFFFFFFFFFF + + (5, 6, np.int64), # rng == 0 + (5, 100, np.int64), # rng <= 0xFFFFFFFF + (0, 0xFFFFFFFFFF, np.int64), # rng > 0xFFFFFFFF + (0, 0xFFFFFFFFFFFFFFF - 1, np.int64), # rng == 0xFFFFFFFFFFFFFFF - 1 + (0, 0xFFFFFFFFFFFFFFF, np.int64), # rng == 0xFFFFFFFFFFFFFFF + (-0xFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFF, np.int64), # min/max + + (5, 6, np.uint32), # rng == 0 + (5, 100, np.uint32), # rng < 0xFFFFFFFF + (0, 0xFFFFFFFF - 1, np.uint32), # rng == 0xFFFFFFFF - 1 + (0, 0xFFFFFFFF, np.uint32), # rng == 0xFFFFFFFF + + (5, 6, np.int32), # rng == 0 + (5, 100, np.int32), # rng < 0xFFFFFFFF + (0, 0xFFFFFFF - 1, np.int32), # rng == 0xFFFFFFF - 1 + (0, 0xFFFFFFF, np.int32), # rng == 0xFFFFFFF + (-0xFFFFFFF, 0xFFFFFFF, np.int32), + + (5, 6, np.uint16), # rng == 0 + (5, 100, np.uint16), # rng < 0xFFFF + (0, 0xFFFF - 1, np.uint16), # rng == 0xFFFF - 1 + (0, 0xFFFF, np.uint16), # rng == 0xFFFF + + (5, 6, np.int16), # rng == 0 + (5, 10, np.int16), # rng < 0xFFF + (0, 0xFFF - 1, np.int16), # rng == 0xFFF - 1 + (0, 0xFFF, np.int16), # rng == 0xFFF + (-0xFFF, 0xFFF, np.int16), + + (5, 6, np.uint8), # rng == 0 + (5, 10, np.uint8), # rng < 0xFF + (0, 0xFF - 1, np.uint8), # rng == 0xFF - 1 + (0, 0xFF, np.uint8), # rng == 0xFF + + (5, 6, np.int8), # rng == 0 + (5, 10, np.int8), # rng < 0xF + (0, 0xF - 1, np.int8), # rng == 0xF-1 + (0, 0xF, np.int8), # rng == 0xF + (-0xF, 0xF, np.int8), + ] + size = (2, 3) + + for low, high, dtype in cases: + with self.subTest(low=low, high=high, dtype=dtype): + dist_func = lambda x, size, dtype:\ + x.integers(low, high, size=size, dtype=dtype) + self.check_numpy_parity(dist_func, None, + None, size, dtype, 0) + + def test_random(self): + test_sizes = [None, (), (100,), (10, 20, 30)] + test_dtypes = [np.float32, np.float64] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.random() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None) + + dist_func = lambda x, size, dtype:x.random(size=size, dtype=dtype) + + for _size in test_sizes: + for _dtype in test_dtypes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _dtype=_dtype, + _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, _dtype) + dist_func = lambda x, size, dtype:\ + x.random(size=size, dtype=dtype) + self._check_invalid_types(dist_func, ['size', 'dtype'], + [(1,), np.float64], [('x',), 0.]) + + def test_standard_normal(self): + test_sizes = [None, (), (100,), (10, 20, 30)] + test_dtypes = [np.float32, np.float64] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.standard_normal() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None) + + dist_func = lambda x, size, dtype:\ + x.standard_normal(size=size, dtype=dtype) + + for _size in test_sizes: + for _dtype in test_dtypes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _dtype=_dtype, + _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, _dtype) + dist_func = lambda x, size, dtype:\ + x.standard_normal(size=size, dtype=dtype) + self._check_invalid_types(dist_func, ['size', 'dtype'], + [(1,), np.float32], [('x',), 0]) + + def test_standard_exponential(self): + test_sizes = [None, (), (100,), (10, 20, 30)] + test_dtypes = [np.float32, np.float64] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.standard_exponential() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None) + + dist_func = lambda x, size, dtype:\ + x.standard_exponential(size=size, dtype=dtype) + + for _size in test_sizes: + for _dtype in test_dtypes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _dtype=_dtype, + _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, _dtype) + + dist_func = lambda x, method, size, dtype:\ + x.standard_exponential(method=method, size=size, dtype=dtype) + self._check_invalid_types(dist_func, ['method', 'size', 'dtype'], + ['zig', (1,), np.float32], [0, ('x',), 0]) + + def test_standard_exponential_inv(self): + test_sizes = [None, (), (100,), (10, 20, 30)] + test_dtypes = [np.float32, np.float64] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:\ + x.standard_exponential(size=size, dtype=dtype, method='inv') + for _size in test_sizes: + for _dtype in test_dtypes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _dtype=_dtype, + _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, _dtype) + + def test_standard_gamma(self): + test_sizes = [None, (), (100,), (10, 20, 30)] + test_dtypes = [np.float32, np.float64] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype: \ + x.standard_gamma(shape=5.0, size=size, dtype=dtype) + for _size in test_sizes: + for _dtype in test_dtypes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _dtype=_dtype, + _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, _dtype, + adjusted_ulp_prec) + dist_func = lambda x, shape, size, dtype:\ + x.standard_gamma(shape=shape, size=size, dtype=dtype) + self._check_invalid_types(dist_func, ['shape', 'size', 'dtype'], + [5.0, (1,), np.float32], ['x', ('x',), 0]) + + def test_normal(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.normal() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None, + ulp_prec=adjusted_ulp_prec) + + dist_func = lambda x, size, dtype:x.normal(loc=1.5, scale=3, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + dist_func = lambda x, loc, scale, size:\ + x.normal(loc=loc, scale=scale, size=size) + self._check_invalid_types(dist_func, ['loc', 'scale', 'size'], + [1.5, 3, (1,)], ['x', 'x', ('x',)]) + + def test_uniform(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.uniform() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None, + ulp_prec=adjusted_ulp_prec) + + dist_func = lambda x, size, dtype:x.uniform(low=1.5, high=3, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + dist_func = lambda x, low, high, size:\ + x.uniform(low=low, high=high, size=size) + self._check_invalid_types(dist_func, ['low', 'high', 'size'], + [1.5, 3, (1,)], ['x', 'x', ('x',)]) + + def test_exponential(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.exponential() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None) + + dist_func = lambda x, size, dtype:x.exponential(scale=1.5, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + dist_func = lambda x, scale, size:\ + x.exponential(scale=scale, size=size) + self._check_invalid_types(dist_func, ['scale', 'size'], + [1.5, (1,)], ['x', ('x',)]) + + def test_gamma(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.gamma(shape=5.0, scale=1.5, + size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + dist_func = lambda x, shape, scale, size:\ + x.gamma(shape=shape, scale=scale, size=size) + self._check_invalid_types(dist_func, ['shape', 'scale', 'size'], + [5.0, 1.5, (1,)], ['x', 'x', ('x',)]) + + def test_beta(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.beta(a=1.5, b=2.5, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, a, b, size:x.beta(a=a, b=b, size=size) + self._check_invalid_types(dist_func, ['a', 'b', 'size'], + [5.0, 1.5, (1,)], ['x', 'x', ('x',)]) + + def test_f(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.f(dfnum=2, dfden=3, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, dfnum, dfden, size:\ + x.f(dfnum=dfnum, dfden=dfden, size=size) + self._check_invalid_types(dist_func, ['dfnum', 'dfden', 'size'], + [5, 1, (1,)], ['x', 'x', ('x',)]) + + def test_chisquare(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.chisquare(df=2, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, df, size:\ + x.chisquare(df=df, size=size) + self._check_invalid_types(dist_func, ['df', 'size'], + [2, (1,)], ['x', ('x',)]) + + def test_standard_cauchy(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.standard_cauchy() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None) + + dist_func = lambda x, size, dtype:x.standard_cauchy(size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + + dist_func = lambda x, size:x.standard_cauchy(size=size) + self._check_invalid_types(dist_func, ['size'], + [(1,)], [('x',)]) + + def test_pareto(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.pareto(a=1.0, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + + dist_func = lambda x, a, size:x.pareto(a=a, size=size) + self._check_invalid_types(dist_func, ['a', 'size'], + [1, (1,)], ['x', ('x',)]) + + def test_weibull(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.weibull(a=1.0, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + + dist_func = lambda x, a, size:x.weibull(a=a, size=size) + self._check_invalid_types(dist_func, ['a', 'size'], + [1, (1,)], ['x', ('x',)]) + + def test_power(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.power(a=0.75, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + + dist_func = lambda x, a, size:x.power(a=a, size=size) + self._check_invalid_types(dist_func, ['a', 'size'], + [0.75, (1,)], ['x', ('x',)]) + + def test_laplace(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.laplace() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None, + ulp_prec=adjusted_ulp_prec) + + dist_func = lambda x, size, dtype:\ + x.laplace(loc=1.0, scale=1.5, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, loc, scale, size:\ + x.laplace(loc=loc, scale=scale, size=size) + self._check_invalid_types(dist_func, ['loc', 'scale', 'size'], + [1.0, 1.5, (1,)], ['x', 'x', ('x',)]) + + def test_logistic(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.logistic() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None, + ulp_prec=adjusted_ulp_prec) + + dist_func = lambda x, size, dtype:\ + x.logistic(loc=1.0,scale=1.5, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, loc, scale, size:\ + x.logistic(loc=loc, scale=scale, size=size) + self._check_invalid_types(dist_func, ['loc', 'scale', 'size'], + [1.0, 1.5, (1,)], ['x', 'x', ('x',)]) + + def test_lognormal(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.lognormal() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None, + ulp_prec=adjusted_ulp_prec) + + dist_func = lambda x, size, dtype:\ + x.lognormal(mean=5.0, sigma=1.5, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, mean, sigma, size:\ + x.lognormal(mean=mean, sigma=sigma, size=size) + self._check_invalid_types(dist_func, ['mean', 'sigma', 'size'], + [1.0, 1.5, (1,)], ['x', 'x', ('x',)]) + + def test_rayleigh(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + # Test with no arguments + dist_func = lambda x, size, dtype:x.rayleigh() + with self.subTest(): + self.check_numpy_parity(dist_func, test_size=None, + test_dtype=None) + + dist_func = lambda x, size, dtype:x.rayleigh(scale=1.5, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + + dist_func = lambda x, scale, size:x.rayleigh(scale=scale, size=size) + self._check_invalid_types(dist_func, ['scale', 'size'], + [1.5, (1,)], ['x', ('x',)]) + + def test_standard_t(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.standard_t(df=2, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, df, size:x.standard_t(df=df, size=size) + self._check_invalid_types(dist_func, ['df', 'size'], + [2, (1,)], ['x', ('x',)]) + + def test_wald(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.wald(mean=5.0, scale=1.5, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, mean, scale, size:\ + x.wald(mean=mean, scale=scale, size=size) + self._check_invalid_types(dist_func, ['mean', 'scale', 'size'], + [1.0, 1.5, (1,)], ['x', 'x', ('x',)]) + + def test_geometric(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.geometric(p=0.75, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, p, size:x.geometric(p=p, size=size) + self._check_invalid_types(dist_func, ['p', 'size'], + [0.75, (1,)], ['x', ('x',)]) + + def test_zipf(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.zipf(a=1.5, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + + dist_func = lambda x, a, size:x.zipf(a=a, size=size) + self._check_invalid_types(dist_func, ['a', 'size'], + [1, (1,)], ['x', ('x',)]) + + def test_triangular(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:\ + x.triangular(left=0, mode=3, right=5, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + + dist_func = lambda x, left, mode, right, size:\ + x.triangular(left=left, mode=mode, right=right, size=size) + self._check_invalid_types(dist_func, ['left', 'mode', 'right', 'size'], + [0, 3, 5, (1,)], ['x', 'x', 'x', ('x',)]) + + def test_poisson(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:x.poisson(lam=15, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, lam, size:x.poisson(lam=lam, size=size) + self._check_invalid_types(dist_func, ['lam', 'size'], + [15, (1,)], ['x', ('x',)]) + + def test_negative_binomial(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:\ + x.negative_binomial(n=1, p=0.1, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, n, p, size:\ + x.negative_binomial(n=n, p=p, size=size) + self._check_invalid_types(dist_func, ['n', 'p', 'size'], + [1, 0.75, (1,)], ['x', 'x', ('x',)]) + + # NumPy tests at: + # https://github.com/numpy/numpy/blob/95e3e7f445407e4f355b23d6a9991d8774f0eb0c/numpy/random/tests/test_generator_mt19937.py#L936 + # Written in following format for semblance with existing Generator tests. + def test_shuffle(self): + test_sizes = [(10, 20, 30)] + bitgen_types = [None, MT19937] + axes = [0, 1, 2] + + for _size, _bitgen, _axis in itertools.product(test_sizes, + bitgen_types, + axes): + with self.subTest(_size=_size, _bitgen=_bitgen, _axis=_axis): + def dist_func(x, size, dtype): + arr = x.random(size=size) + x.shuffle(arr, axis=_axis) + return arr + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + 0) + + def test_shuffle_empty(self): + a = np.array([]) + b = np.array([]) + + def dist_func(x, arr): + x.shuffle(arr) + return arr + + nb_func = numba.njit(dist_func) + rng = lambda: np.random.default_rng(1) + + self.assertPreciseEqual(dist_func(rng(), a), nb_func(rng(), b)) + + def test_shuffle_check(self): + self.disable_leak_check() + + def dist_func(x, arr, axis): + x.shuffle(arr, axis=axis) + return arr + + self._check_invalid_types(dist_func, ['x', 'axis'], + [np.array([3,4,5]), 0], ['x', 'x']) + + rng = np.random.default_rng(1) + with self.assertRaises(IndexError) as raises: + numba.njit(dist_func)(rng, np.array([3,4,5]), 2) + self.assertIn( + 'Axis is out of bounds for the given array', + str(raises.exception) + ) + + # NumPy tests at: + # https://github.com/numpy/numpy/blob/95e3e7f445407e4f355b23d6a9991d8774f0eb0c/numpy/random/tests/test_generator_mt19937.py#L1030 + # Written in following format for semblance with existing Generator tests. + def test_permutation(self): + test_sizes = [(10, 20, 30)] + bitgen_types = [None, MT19937] + axes = [0, 1, 2, -1, -2] + + for _size, _bitgen, _axis in itertools.product(test_sizes, + bitgen_types, + axes): + with self.subTest(_size=_size, _bitgen=_bitgen, _axis=_axis): + def dist_func(x, size, dtype): + arr = x.random(size=size) + return x.permutation(arr, axis=1) + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + 0) + + # Test that permutation is actually done on a copy of the array + dist_func = numba.njit(lambda rng, arr: rng.permutation(arr)) + rng = np.random.default_rng() + arr = rng.random(size=(10, 20)) + arr_cpy = arr.copy() + dist_func(rng, arr) + self.assertPreciseEqual(arr, arr_cpy) + + def test_permutation_exception(self): + self.disable_leak_check() + + def dist_func(x, arr, axis): + return x.permutation(arr, axis=axis) + + self._check_invalid_types(dist_func, ['x', 'axis'], + [np.array([3,4,5]), 0], ['x', 'x']) + + rng = np.random.default_rng(1) + with self.assertRaises(IndexError) as raises: + numba.njit(dist_func)(rng, np.array([3,4,5]), 2) + self.assertIn( + 'Axis is out of bounds for the given array', + str(raises.exception) + ) + with self.assertRaises(IndexError) as raises: + numba.njit(dist_func)(rng, np.array([3,4,5]), -2) + self.assertIn( + 'Axis is out of bounds for the given array', + str(raises.exception) + ) + + def test_permutation_empty(self): + a = np.array([]) + b = np.array([]) + + def dist_func(x, arr): + return x.permutation(arr) + + nb_func = numba.njit(dist_func) + rng = lambda: np.random.default_rng(1) + + self.assertPreciseEqual(dist_func(rng(), a), nb_func(rng(), b)) + + def test_noncentral_chisquare(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:\ + x.noncentral_chisquare(3.0, 20.0, size=size) + for _size, _bitgen in itertools.product(test_sizes, bitgen_types): + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + + dist_func = lambda x, df, nonc, size:\ + x.noncentral_chisquare(df=df, nonc=nonc, size=size) + valid_args = [3.0, 5.0, (1,)] + self._check_invalid_types(dist_func, ['df', 'nonc', 'size'], + valid_args, ['x', 'x', ('x',)]) + + # Test argument bounds + rng = np.random.default_rng() + valid_args = [rng] + valid_args + nb_dist_func = numba.njit(dist_func) + with self.assertRaises(ValueError) as raises: + curr_args = valid_args.copy() + # Change df to an invalid value + curr_args[1] = 0 + nb_dist_func(*curr_args) + self.assertIn('df <= 0', str(raises.exception)) + with self.assertRaises(ValueError) as raises: + curr_args = valid_args.copy() + # Change nonc to an invalid value + curr_args[2] = -1 + nb_dist_func(*curr_args) + self.assertIn('nonc < 0', str(raises.exception)) + # Exceptions leak references + self.disable_leak_check() + + def test_noncentral_f(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:\ + x.noncentral_f(3.0, 20.0, 3.0, size=size) + for _size, _bitgen in itertools.product(test_sizes, bitgen_types): + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, dfnum, dfden, nonc, size:\ + x.noncentral_f(dfnum=dfnum, dfden=dfden, nonc=nonc, size=size) + valid_args = [3.0, 5.0, 3.0, (1,)] + self._check_invalid_types(dist_func, ['dfnum', 'dfden', 'nonc', 'size'], + valid_args, ['x', 'x', 'x', ('x',)]) + + # Test argument bounds + rng = np.random.default_rng() + valid_args = [rng] + valid_args + nb_dist_func = numba.njit(dist_func) + with self.assertRaises(ValueError) as raises: + curr_args = valid_args.copy() + # Change dfnum to an invalid value + curr_args[1] = 0 + nb_dist_func(*curr_args) + self.assertIn('dfnum <= 0', str(raises.exception)) + with self.assertRaises(ValueError) as raises: + curr_args = valid_args.copy() + # Change dfden to an invalid value + curr_args[2] = 0 + nb_dist_func(*curr_args) + self.assertIn('dfden <= 0', str(raises.exception)) + with self.assertRaises(ValueError) as raises: + curr_args = valid_args.copy() + # Change nonc to an invalid value + curr_args[3] = -1 + nb_dist_func(*curr_args) + self.assertIn('nonc < 0', str(raises.exception)) + # Exceptions leak references + self.disable_leak_check() + + def test_logseries(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:\ + x.logseries(0.3, size=size) + for _size, _bitgen in itertools.product(test_sizes, bitgen_types): + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None) + + dist_func = lambda x, p, size:\ + x.logseries(p=p, size=size) + valid_args = [0.3, (1,)] + self._check_invalid_types(dist_func, ['p', 'size'], + valid_args, ['x', ('x',)]) + + # Test argument bounds + rng = np.random.default_rng(1) + valid_args = [rng] + valid_args + nb_dist_func = numba.njit(dist_func) + for _p in [-0.1, 1, np.nan]: + with self.assertRaises(ValueError) as raises: + curr_args = valid_args.copy() + # Change p to an invalid negative, positive and nan value + curr_args[1] = _p + nb_dist_func(*curr_args) + self.assertIn('p < 0, p >= 1 or p is NaN', str(raises.exception)) + # Exceptions leak references + self.disable_leak_check() + + def test_binomial(self): + # For this test dtype argument is never used, so we pass [None] as dtype + # to make sure it runs only once with default system type. + + test_sizes = [None, (), (100,), (10, 20, 30)] + bitgen_types = [None, MT19937] + + dist_func = lambda x, size, dtype:\ + x.binomial(n=1, p=0.1, size=size) + for _size in test_sizes: + for _bitgen in bitgen_types: + with self.subTest(_size=_size, _bitgen=_bitgen): + self.check_numpy_parity(dist_func, _bitgen, + None, _size, None, + adjusted_ulp_prec) + + dist_func = lambda x, n, p, size:\ + x.binomial(n=n, p=p, size=size) + self._check_invalid_types(dist_func, ['n', 'p', 'size'], + [1, 0.75, (1,)], ['x', 'x', ('x',)]) + + def test_binomial_cases(self): + cases = [ + (1, 0.1), # p <= 0.5 && n * p <= 30 + (50, 0.9), # p > 0.5 && n * p <= 30 + (100, 0.4), # p <= 0.5 && n * p > 30 + (100, 0.9) # p > 0.5 && n * p > 30 + ] + size = None + + for n, p in cases: + with self.subTest(n=n, p=p): + dist_func = lambda x, size, dtype:\ + x.binomial(n, p, size=size) + self.check_numpy_parity(dist_func, None, + None, size, None, 0) + + def test_binomial_specific_issues(self): + # The algorithm for "binomial" is quite involved. This test contains + # subtests for specific issues reported on the issue tracker. + + # testing specific bugs found in binomial. + with self.subTest("infinite loop issue #9493"): + # This specific generator state caused a "hang" as noted in #9493 + + gen1 = np.random.default_rng(0) + gen2 = np.random.default_rng(0) + + @numba.jit + def foo(gen): + return gen.binomial(700, 0.1, 100) + + got = foo(gen1) + expected = foo.py_func(gen2) + self.assertPreciseEqual(got, expected) + + with self.subTest("issue with midrange value branch #9493/#9734"): + # The use of 301 is specific to trigger use of random_binomial_btpe + # with an input state that caused incorrect values to be computed. + + gen1 = np.random.default_rng(0) + gen2 = np.random.default_rng(0) + + @numba.jit + def foo(gen): + return gen.binomial(301, 0.1, 100) + + got = foo(gen1) + expected = foo.py_func(gen2) + self.assertPreciseEqual(got, expected) + + +class TestGeneratorCaching(TestCase, SerialMixin): + def test_randomgen_caching(self): + nb_rng = np.random.default_rng(1) + np_rng = np.random.default_rng(1) + + numba_func = numba.njit(lambda x: x.random(10), cache=True) + self.assertPreciseEqual(np_rng.random(10), numba_func(nb_rng)) + # Run the function twice to make sure caching doesn't break anything. + self.assertPreciseEqual(np_rng.random(10), numba_func(nb_rng)) + # Check that the function can be retrieved successfully from the cache. + res = run_in_new_process_caching(test_generator_caching) + self.assertEqual(res['exitcode'], 0) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_npdatetime.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_npdatetime.py new file mode 100644 index 0000000000000000000000000000000000000000..794e2340b323928ebd8eb02213e30aaba24e2d57 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_npdatetime.py @@ -0,0 +1,1201 @@ +""" +Test np.datetime64 and np.timedelta64 support. +""" + +# NOTE: datetime64 and timedelta64 ufuncs are tested in test_ufuncs. + + +import contextlib +import itertools +import re +import unittest +import warnings + +import numpy as np + +from numba import jit, vectorize, njit +from numba.np.numpy_support import numpy_version +from numba.core import types, config +from numba.core.errors import TypingError +from numba.tests.support import TestCase, tag, skip_parfors_unsupported +from numba.np import npdatetime_helpers, numpy_support + +TIMEDELTA_M = np.dtype('timedelta64[M]') +TIMEDELTA_Y = np.dtype('timedelta64[Y]') + +def value_unit(val): + ty = numpy_support.from_dtype(val.dtype) + return ty.unit + + +date_units = ('Y', 'M') +time_units = ('W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', 'ps', 'fs', 'as') +# All except generic ("") +all_units = date_units + time_units + + +def add_usecase(x, y): + return x + y + +def sub_usecase(x, y): + return x - y + +def mul_usecase(x, y): + return x * y + +def div_usecase(x, y): + return x / y + +def floordiv_usecase(x, y): + return x // y + +def eq_usecase(x, y): + return x == y + +def ne_usecase(x, y): + return x != y + +def lt_usecase(x, y): + return x < y + +def le_usecase(x, y): + return x <= y + +def gt_usecase(x, y): + return x > y + +def ge_usecase(x, y): + return x >= y + +def pos_usecase(x): + return +x + +def neg_usecase(x): + return -x + +def abs_usecase(x): + return abs(x) + +def hash_usecase(x): + return hash(x) + +def min_usecase(x, y): + return min(x, y) + +def max_usecase(x, y): + return max(x, y) + +def int_cast_usecase(x): + return int(x) + +def make_add_constant(const): + def add_constant(x): + return x + const + return add_constant + + +class TestModuleHelpers(TestCase): + """ + Test the various helpers in numba.npdatetime_helpers. + """ + + def test_can_cast_timedelta(self): + f = npdatetime_helpers.can_cast_timedelta_units + for a, b in itertools.product(date_units, time_units): + self.assertFalse(f(a, b), (a, b)) + self.assertFalse(f(b, a), (a, b)) + for unit in all_units: + self.assertFalse(f(unit, '')) + self.assertTrue(f('', unit)) + for unit in all_units + ('',): + self.assertTrue(f(unit, unit)) + + def check_units_group(group): + for i, a in enumerate(group): + for b in group[:i]: + # large into smaller is ok + self.assertTrue(f(b, a)) + # small into larger is not + self.assertFalse(f(a, b)) + + check_units_group(date_units) + check_units_group(time_units) + + def test_timedelta_conversion(self): + f = npdatetime_helpers.get_timedelta_conversion_factor + for unit in all_units + ('',): + self.assertEqual(f(unit, unit), 1) + for unit in all_units: + self.assertEqual(f('', unit), 1) + for a, b in itertools.product(time_units, date_units): + self.assertIs(f(a, b), None) + self.assertIs(f(b, a), None) + + def check_units_group(group): + for i, a in enumerate(group): + for b in group[:i]: + self.assertGreater(f(b, a), 1, (b, a)) + self.assertIs(f(a, b), None) + + check_units_group(date_units) + check_units_group(time_units) + + # Check some hand-picked values + self.assertEqual(f('Y', 'M'), 12) + self.assertEqual(f('W', 'h'), 24 * 7) + self.assertEqual(f('W', 'm'), 24 * 7 * 60) + self.assertEqual(f('W', 'us'), 24 * 7 * 3600 * 1000 * 1000) + + def test_datetime_timedelta_scaling(self): + f = npdatetime_helpers.get_datetime_timedelta_conversion + def check_error(dt_unit, td_unit): + with self.assertRaises(RuntimeError): + f(dt_unit, td_unit) + # Cannot combine a Y or M timedelta64 with a finer-grained datetime64 + for dt_unit, td_unit in itertools.product(time_units, date_units): + check_error(dt_unit, td_unit) + # Sanity check that all other unit pairs can be converted, we'll + # check individual results below + for dt_unit, td_unit in itertools.product(time_units, time_units): + f(dt_unit, td_unit) + for dt_unit, td_unit in itertools.product(date_units, time_units): + f(dt_unit, td_unit) + for dt_unit, td_unit in itertools.product(date_units, date_units): + f(dt_unit, td_unit) + # No-op conversions + for unit in all_units: + self.assertEqual(f(unit, unit), (unit, 1, 1)) + self.assertEqual(f(unit, ''), (unit, 1, 1)) + self.assertEqual(f('', unit), ('', 1, 1)) + self.assertEqual(f('', ''), ('', 1, 1)) + # "Regular" values + self.assertEqual(f('Y', 'M'), ('M', 12, 1)) + self.assertEqual(f('M', 'Y'), ('M', 1, 12)) + self.assertEqual(f('W', 'D'), ('D', 7, 1)) + self.assertEqual(f('D', 'W'), ('D', 1, 7)) + self.assertEqual(f('W', 's'), ('s', 7 * 24 * 3600, 1)) + self.assertEqual(f('s', 'W'), ('s', 1, 7 * 24 * 3600)) + self.assertEqual(f('s', 'as'), ('as', 1000 ** 6, 1)) + self.assertEqual(f('as', 's'), ('as', 1, 1000 ** 6)) + # "Interesting" values + self.assertEqual(f('Y', 'D'), ('D', 97 + 400 * 365, 400)) + self.assertEqual(f('Y', 'W'), ('W', 97 + 400 * 365, 400 * 7)) + self.assertEqual(f('M', 'D'), ('D', 97 + 400 * 365, 400 * 12)) + self.assertEqual(f('M', 'W'), ('W', 97 + 400 * 365, 400 * 12 * 7)) + self.assertEqual(f('Y', 's'), ('s', (97 + 400 * 365) * 24 * 3600, 400)) + self.assertEqual(f('M', 's'), ('s', (97 + 400 * 365) * 24 * 3600, 400 * 12)) + + def test_combine_datetime_timedelta_units(self): + f = npdatetime_helpers.combine_datetime_timedelta_units + for unit in all_units: + self.assertEqual(f(unit, unit), unit) + self.assertEqual(f('', unit), unit) + self.assertEqual(f(unit, ''), unit) + self.assertEqual(f('', ''), '') + for dt_unit, td_unit in itertools.product(time_units, date_units): + self.assertIs(f(dt_unit, td_unit), None) + for dt_unit, td_unit in itertools.product(date_units, time_units): + self.assertEqual(f(dt_unit, td_unit), td_unit) + + def test_same_kind(self): + f = npdatetime_helpers.same_kind + for u in all_units: + self.assertTrue(f(u, u)) + A = ('Y', 'M', 'W', 'D') + B = ('h', 'm', 's', 'ms', 'us', 'ns', 'ps', 'fs', 'as') + for a, b in itertools.product(A, A): + self.assertTrue(f(a, b)) + for a, b in itertools.product(B, B): + self.assertTrue(f(a, b)) + for a, b in itertools.product(A, B): + self.assertFalse(f(a, b)) + self.assertFalse(f(b, a)) + + +TD = np.timedelta64 +DT = np.datetime64 + + +class TestMiscCompiling(TestCase): + + def test_jit_explicit_signature(self): + def _check_explicit_signature(sig): + f = jit(sig, nopython=True)(add_usecase) + # Just a sanity check + args = DT(1, 'ms'), TD(2, 'us') + expected = add_usecase(*args) + self.assertPreciseEqual(f(*args), expected) + + # Test passing the signature in object form + sig = types.NPDatetime('us')(types.NPDatetime('ms'), types.NPTimedelta('us')) + _check_explicit_signature(sig) + # Same with the signature in string form + sig = "NPDatetime('us')(NPDatetime('ms'), NPTimedelta('us'))" + _check_explicit_signature(sig) + + def test_vectorize_explicit_signature(self): + def _check_explicit_signature(sig): + f = vectorize([sig], nopython=True)(mul_usecase) + # This isn't really right but we can't do better than this, + # since Numpy's ufuncs don't store the metadata of return types. + # Related to https://github.com/numpy/numpy/issues/5429 + self.assertPreciseEqual(f(TD(2), 3), TD(6)) + + # Test passing the signature in object form (issue #917) + sig = types.NPTimedelta('s')(types.NPTimedelta('s'), types.int64) + _check_explicit_signature(sig) + # Same with the signature in string form + sig = "NPTimedelta('s')(NPTimedelta('s'), int64)" + _check_explicit_signature(sig) + + def test_constant_datetime(self): + def check(const): + pyfunc = make_add_constant(const) + f = jit(nopython=True)(pyfunc) + x = TD(4, 'D') + expected = pyfunc(x) + self.assertPreciseEqual(f(x), expected) + check(DT('2001-01-01')) + check(DT('NaT', 'D')) + + def test_constant_timedelta(self): + def check(const): + pyfunc = make_add_constant(const) + f = jit(nopython=True)(pyfunc) + x = TD(4, 'D') + expected = pyfunc(x) + self.assertPreciseEqual(f(x), expected) + check(TD(4, 'D')) + check(TD(-4, 'D')) + check(TD('NaT', 'D')) + + +class TestTimedeltaArithmetic(TestCase): + + jitargs = dict(forceobj=True) + + def jit(self, pyfunc): + return jit(**self.jitargs)(pyfunc) + + def test_add(self): + f = self.jit(add_usecase) + def check(a, b, expected): + self.assertPreciseEqual(f(a, b), expected) + self.assertPreciseEqual(f(b, a), expected) + + check(TD(1), TD(2), TD(3)) + check(TD(1, 's'), TD(2, 's'), TD(3, 's')) + # Implicit unit promotion + check(TD(1, 's'), TD(2, 'us'), TD(1000002, 'us')) + check(TD(1, 'W'), TD(2, 'D'), TD(9, 'D')) + # NaTs + check(TD('NaT'), TD(1), TD('NaT')) + check(TD('NaT', 's'), TD(1, 'D'), TD('NaT', 's')) + check(TD('NaT', 's'), TD(1, 'ms'), TD('NaT', 'ms')) + # Cannot add days and months + with self.assertRaises((TypeError, TypingError)): + f(TD(1, 'M'), TD(1, 'D')) + + def test_sub(self): + f = self.jit(sub_usecase) + def check(a, b, expected): + self.assertPreciseEqual(f(a, b), expected) + self.assertPreciseEqual(f(b, a), -expected) + + check(TD(3), TD(2), TD(1)) + check(TD(3, 's'), TD(2, 's'), TD(1, 's')) + # Implicit unit promotion + check(TD(3, 's'), TD(2, 'us'), TD(2999998, 'us')) + check(TD(1, 'W'), TD(2, 'D'), TD(5, 'D')) + # NaTs + check(TD('NaT'), TD(1), TD('NaT')) + check(TD('NaT', 's'), TD(1, 'D'), TD('NaT', 's')) + check(TD('NaT', 's'), TD(1, 'ms'), TD('NaT', 'ms')) + # Cannot sub days to months + with self.assertRaises((TypeError, TypingError)): + f(TD(1, 'M'), TD(1, 'D')) + + def test_mul(self): + f = self.jit(mul_usecase) + def check(a, b, expected): + self.assertPreciseEqual(f(a, b), expected) + self.assertPreciseEqual(f(b, a), expected) + + # non-int64 int * timedelta64 + check(TD(3), np.uint32(2), TD(6)) + # int * timedelta64 + check(TD(3), 2, TD(6)) + check(TD(3, 'ps'), 2, TD(6, 'ps')) + check(TD('NaT', 'ps'), 2, TD('NaT', 'ps')) + # float * timedelta64 + check(TD(7), 1.5, TD(10)) + check(TD(-7), 1.5, TD(-10)) + check(TD(7, 'ps'), -1.5, TD(-10, 'ps')) + check(TD(-7), -1.5, TD(10)) + check(TD('NaT', 'ps'), -1.5, TD('NaT', 'ps')) + check(TD(7, 'ps'), float('nan'), TD('NaT', 'ps')) + # wraparound on overflow + check(TD(2**62, 'ps'), 16, TD(0, 'ps')) + + def test_div(self): + div = self.jit(div_usecase) + floordiv = self.jit(floordiv_usecase) + def check(a, b, expected): + self.assertPreciseEqual(div(a, b), expected) + self.assertPreciseEqual(floordiv(a, b), expected) + + # timedelta64 / non-int64 int + check(TD(-3, 'ps'), np.uint32(2), TD(-1, 'ps')) + # timedelta64 / int + check(TD(3), 2, TD(1)) + check(TD(-3, 'ps'), 2, TD(-1, 'ps')) + check(TD('NaT', 'ps'), 2, TD('NaT', 'ps')) + check(TD(3, 'ps'), 0, TD('NaT', 'ps')) + check(TD('NaT', 'ps'), 0, TD('NaT', 'ps')) + # timedelta64 / float + check(TD(7), 0.5, TD(14)) + check(TD(-7, 'ps'), 1.5, TD(-4, 'ps')) + check(TD('NaT', 'ps'), 2.5, TD('NaT', 'ps')) + check(TD(3, 'ps'), 0.0, TD('NaT', 'ps')) + check(TD('NaT', 'ps'), 0.0, TD('NaT', 'ps')) + check(TD(3, 'ps'), float('nan'), TD('NaT', 'ps')) + check(TD('NaT', 'ps'), float('nan'), TD('NaT', 'ps')) + + def test_homogeneous_div(self): + div = self.jit(div_usecase) + def check(a, b, expected): + self.assertPreciseEqual(div(a, b), expected) + + # timedelta64 / timedelta64 + check(TD(7), TD(3), 7. / 3.) + check(TD(7, 'us'), TD(3, 'ms'), 7. / 3000.) + check(TD(7, 'ms'), TD(3, 'us'), 7000. / 3.) + check(TD(7), TD(0), float('+inf')) + check(TD(-7), TD(0), float('-inf')) + check(TD(0), TD(0), float('nan')) + # NaTs + check(TD('nat'), TD(3), float('nan')) + check(TD(3), TD('nat'), float('nan')) + check(TD('nat'), TD(0), float('nan')) + # Cannot div months with days + with self.assertRaises((TypeError, TypingError)): + div(TD(1, 'M'), TD(1, 'D')) + + def test_eq_ne(self): + eq = self.jit(eq_usecase) + ne = self.jit(ne_usecase) + def check(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # all NaT comparisons are False, including NaT==NaT, + # conversely != is True + if np.isnat(a) or np.isnat(a): + expected_val = False + not_expected_val = True + + self.assertPreciseEqual(eq(a, b), expected_val) + self.assertPreciseEqual(eq(b, a), expected_val) + self.assertPreciseEqual(ne(a, b), not_expected_val) + self.assertPreciseEqual(ne(b, a), not_expected_val) + + check(TD(1), TD(2), False) + check(TD(1), TD(1), True) + check(TD(1, 's'), TD(2, 's'), False) + check(TD(1, 's'), TD(1, 's'), True) + check(TD(2000, 's'), TD(2, 's'), False) + check(TD(2000, 'ms'), TD(2, 's'), True) + check(TD(1, 'Y'), TD(12, 'M'), True) + # NaTs + check(TD('Nat'), TD('Nat'), True) + check(TD('Nat', 'ms'), TD('Nat', 's'), True) + check(TD('Nat'), TD(1), False) + # Incompatible units => timedeltas compare unequal + if numpy_version < (1, 25): + check(TD(1, 'Y'), TD(365, 'D'), False) + check(TD(1, 'Y'), TD(366, 'D'), False) + # ... except when both are NaT! + check(TD('NaT', 'W'), TD('NaT', 'D'), True) + else: + # incompatible units raise + # The exception is different depending on Python mode + with self.assertRaises((TypeError, TypingError)): + eq(TD(1, 'Y'), TD(365, 'D')) + with self.assertRaises((TypeError, TypingError)): + ne(TD(1, 'Y'), TD(365, 'D')) + + def test_lt_ge(self): + lt = self.jit(lt_usecase) + ge = self.jit(ge_usecase) + def check(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # since np 1.16 all NaT magnitude comparisons including equality + # are False (as NaT == NaT is now False) + if np.isnat(a) or np.isnat(a): + expected_val = False + not_expected_val = False + + self.assertPreciseEqual(lt(a, b), expected_val) + self.assertPreciseEqual(ge(a, b), not_expected_val) + + check(TD(1), TD(2), True) + check(TD(1), TD(1), False) + check(TD(2), TD(1), False) + check(TD(1, 's'), TD(2, 's'), True) + check(TD(1, 's'), TD(1, 's'), False) + check(TD(2, 's'), TD(1, 's'), False) + check(TD(1, 'm'), TD(61, 's'), True) + check(TD(1, 'm'), TD(60, 's'), False) + # NaTs + check(TD('Nat'), TD('Nat'), False) + check(TD('Nat', 'ms'), TD('Nat', 's'), False) + check(TD('Nat'), TD(-(2**63)+1), True) + # Incompatible units => exception raised + with self.assertRaises((TypeError, TypingError)): + lt(TD(1, 'Y'), TD(365, 'D')) + with self.assertRaises((TypeError, TypingError)): + ge(TD(1, 'Y'), TD(365, 'D')) + # ... even when both are NaT + with self.assertRaises((TypeError, TypingError)): + lt(TD('NaT', 'Y'), TD('NaT', 'D')) + with self.assertRaises((TypeError, TypingError)): + ge(TD('NaT', 'Y'), TD('NaT', 'D')) + + def test_le_gt(self): + le = self.jit(le_usecase) + gt = self.jit(gt_usecase) + def check(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # since np 1.16 all NaT magnitude comparisons including equality + # are False (as NaT == NaT is now False) + if np.isnat(a) or np.isnat(a): + expected_val = False + not_expected_val = False + self.assertPreciseEqual(le(a, b), expected_val) + self.assertPreciseEqual(gt(a, b), not_expected_val) + + check(TD(1), TD(2), True) + check(TD(1), TD(1), True) + check(TD(2), TD(1), False) + check(TD(1, 's'), TD(2, 's'), True) + check(TD(1, 's'), TD(1, 's'), True) + check(TD(2, 's'), TD(1, 's'), False) + check(TD(1, 'm'), TD(61, 's'), True) + check(TD(1, 'm'), TD(60, 's'), True) + check(TD(1, 'm'), TD(59, 's'), False) + # NaTs + check(TD('Nat'), TD('Nat'), True) + check(TD('Nat', 'ms'), TD('Nat', 's'), True) + check(TD('Nat'), TD(-(2**63)+1), True) + # Incompatible units => exception raised + with self.assertRaises((TypeError, TypingError)): + le(TD(1, 'Y'), TD(365, 'D')) + with self.assertRaises((TypeError, TypingError)): + gt(TD(1, 'Y'), TD(365, 'D')) + # ... even when both are NaT + with self.assertRaises((TypeError, TypingError)): + le(TD('NaT', 'Y'), TD('NaT', 'D')) + with self.assertRaises((TypeError, TypingError)): + gt(TD('NaT', 'Y'), TD('NaT', 'D')) + + def test_pos(self): + pos = self.jit(pos_usecase) + def check(a): + self.assertPreciseEqual(pos(a), +a) + + check(TD(3)) + check(TD(-4)) + check(TD(3, 'ms')) + check(TD(-4, 'ms')) + check(TD('NaT')) + check(TD('NaT', 'ms')) + + def test_neg(self): + neg = self.jit(neg_usecase) + def check(a): + self.assertPreciseEqual(neg(a), -a) + + check(TD(3)) + check(TD(-4)) + check(TD(3, 'ms')) + check(TD(-4, 'ms')) + check(TD('NaT')) + check(TD('NaT', 'ms')) + + def test_abs(self): + f = self.jit(abs_usecase) + def check(a): + self.assertPreciseEqual(f(a), abs(a)) + + check(TD(3)) + check(TD(-4)) + check(TD(3, 'ms')) + check(TD(-4, 'ms')) + check(TD('NaT')) + check(TD('NaT', 'ms')) + + def test_hash(self): + f = self.jit(hash_usecase) + def check(a): + if numpy_version >= (2, 2): + # Generic timedeltas (those without a unit) + # are no longer hashable beyond NumPy 2.2 + # Non-generic timedeltas will have dtype name + # as timedelta64[] + if a.dtype.name == 'timedelta64': + return + + # If the function is not being compiled in objmode + # then the hash should be equal to the hash of the + # integer representation of the timedelta + if self.jitargs.get('nopython', False): + self.assertPreciseEqual(f(a), a.astype(int)) + else: + self.assertPreciseEqual(f(a), hash(a)) + else: + self.assertPreciseEqual(f(a), hash(a)) + + TD_CASES = ((3,), (-4,), (3, 'ms'), (-4, 'ms'), (27, 'D'), + (2, 'D'), (2, 'W'), (2, 'Y'), (3, 'W'), + (365, 'D'), (10000, 'D'), (-10000, 'D'), + ('NaT',), ('NaT', 'ms'), ('NaT', 'D'), (-1,)) + DT_CASES = (('2014',), ('2016',), ('2000',), ('2014-02',), + ('2014-03',), ('2014-04',), ('2016-02',), ('2000-12-31',), + ('2014-01-16',), ('2014-01-05',), ('2014-01-07',), + ('2014-01-06',), ('2014-02-02',), ('2014-02-27',), + ('2014-02-16',), ('2014-03-01',), ('2000-01-01T01:02:03.002Z',), + ('2000-01-01T01:02:03Z',), ('NaT',)) + + for case, typ in zip(TD_CASES + DT_CASES, + (TD,) * len(TD_CASES) + (DT,) * len(TD_CASES)): + check(typ(*case)) + + if numpy_version >= (2, 2): + with self.assertRaises(ValueError) as raises: + f(TD(3)) + self.assertIn("Can't hash generic timedelta64", str(raises.exception)) + + def _test_min_max(self, usecase): + f = self.jit(usecase) + def check(a, b): + self.assertPreciseEqual(f(a, b), usecase(a, b)) + + for cases in ( + (TD(0), TD(1), TD(2), TD('NaT')), + (TD(0, 's'), TD(1, 's'), TD(2, 's'), TD('NaT', 's')), + ): + for a, b in itertools.product(cases, cases): + check(a, b) + + def test_min(self): + self._test_min_max(min_usecase) + + def test_max(self): + self._test_min_max(max_usecase) + + +class TestTimedeltaArithmeticNoPython(TestTimedeltaArithmetic): + + jitargs = dict(nopython=True) + + def test_int_cast(self): + f = self.jit(int_cast_usecase) + def check(a): + self.assertPreciseEqual(f(a), int(a)) + + for (delta, unit) in ((3, 'ns'), (-4, 'ns'), (30000, 'ns'), + (-40000000, 'ns'), (1, 'Y')): + check(TD(delta, unit).astype('timedelta64[ns]')) + + for time in ('2014', '2016', '2000', '2014-02', '2014-03', '2014-04', + '2016-02', '2000-12-31', '2014-01-16', '2014-01-05', + '2014-01-07', '2014-01-06', '2014-02-02', '2014-02-27', + '2014-02-16', '2014-03-01', '2000-01-01T01:02:03.002Z', + '2000-01-01T01:02:03Z'): + check(DT(time).astype('datetime64[ns]')) + + with self.assertRaises(TypingError, msg=('Only datetime64[ns] can be ' + + 'converted, but got ' + + 'datetime64[y]')): + f(DT('2014')) + + +class TestDatetimeArithmetic(TestCase): + + jitargs = dict(forceobj=True) + + def jit(self, pyfunc): + return jit(**self.jitargs)(pyfunc) + + @contextlib.contextmanager + def silence_numpy_warnings(self): + # Numpy can raise warnings when combining e.g. a generic timedelta64 + # with a non-generic datetime64. + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', + message='Implicitly casting between incompatible kinds', + category=DeprecationWarning) + yield + + def test_add_sub_timedelta(self): + """ + Test `datetime64 + timedelta64` and `datetime64 - timedelta64`. + """ + add = self.jit(add_usecase) + sub = self.jit(sub_usecase) + def check(a, b, expected): + with self.silence_numpy_warnings(): + self.assertPreciseEqual(add(a, b), expected, (a, b)) + self.assertPreciseEqual(add(b, a), expected, (a, b)) + self.assertPreciseEqual(sub(a, -b), expected, (a, b)) + # Did we get it right? + self.assertPreciseEqual(a + b, expected) + + # Y + ... + check(DT('2014'), TD(2, 'Y'), DT('2016')) + check(DT('2014'), TD(2, 'M'), DT('2014-03')) + check(DT('2014'), TD(3, 'W'), DT('2014-01-16', 'W')) + check(DT('2014'), TD(4, 'D'), DT('2014-01-05')) + check(DT('2000'), TD(365, 'D'), DT('2000-12-31')) + # M + ... + check(DT('2014-02'), TD(2, 'Y'), DT('2016-02')) + check(DT('2014-02'), TD(2, 'M'), DT('2014-04')) + check(DT('2014-02'), TD(2, 'D'), DT('2014-02-03')) + # W + ... + check(DT('2014-01-07', 'W'), TD(2, 'W'), DT('2014-01-16', 'W')) + # D + ... + check(DT('2014-02-02'), TD(27, 'D'), DT('2014-03-01')) + check(DT('2012-02-02'), TD(27, 'D'), DT('2012-02-29')) + check(DT('2012-02-02'), TD(2, 'W'), DT('2012-02-16')) + # s + ... + check(DT('2000-01-01T01:02:03Z'), TD(2, 'h'), DT('2000-01-01T03:02:03Z')) + check(DT('2000-01-01T01:02:03Z'), TD(2, 'ms'), DT('2000-01-01T01:02:03.002Z')) + # More thorough checking with leap years and faraway years + for dt_str in ('600', '601', '604', '801', + '1900', '1904', '2200', '2300', '2304', + '2400', '6001'): + for dt_suffix in ('', '-01', '-12'): + dt = DT(dt_str + dt_suffix) + for td in [TD(2, 'D'), TD(2, 'W'), + TD(100, 'D'), TD(10000, 'D'), + TD(-100, 'D'), TD(-10000, 'D'), + TD(100, 'W'), TD(10000, 'W'), + TD(-100, 'W'), TD(-10000, 'W'), + TD(100, 'M'), TD(10000, 'M'), + TD(-100, 'M'), TD(-10000, 'M')]: + self.assertEqual(add(dt, td), dt + td, (dt, td)) + self.assertEqual(add(td, dt), dt + td, (dt, td)) + self.assertEqual(sub(dt, -td), dt + td, (dt, td)) + + # NaTs + check(DT('NaT'), TD(2), DT('NaT')) + check(DT('NaT', 's'), TD(2, 'h'), DT('NaT', 's')) + check(DT('NaT', 's'), TD(2, 'ms'), DT('NaT', 'ms')) + check(DT('2014'), TD('NaT', 'W'), DT('NaT', 'W')) + check(DT('2014-01-01'), TD('NaT', 'W'), DT('NaT', 'D')) + check(DT('NaT', 's'), TD('NaT', 'ms'), DT('NaT', 'ms')) + + # Cannot add datetime days and timedelta months or years + for f in (add, sub): + with self.assertRaises((TypeError, TypingError)): + f(DT(1, '2014-01-01'), TD(1, 'Y')) + with self.assertRaises((TypeError, TypingError)): + f(DT(1, '2014-01-01'), TD(1, 'M')) + + def datetime_samples(self): + dt_years = ['600', '601', '604', '1968', '1969', '1973', + '2000', '2004', '2005', '2100', '2400', '2401'] + dt_suffixes = ['', '-01', '-12', '-02-28', '-12-31', + '-01-05T12:30:56Z', '-01-05T12:30:56.008Z'] + dts = [DT(a + b) for (a, b) in itertools.product(dt_years, dt_suffixes)] + dts += [DT(s, 'W') for s in dt_years] + return dts + + def test_datetime_difference(self): + """ + Test `datetime64 - datetime64`. + """ + sub = self.jit(sub_usecase) + def check(a, b, expected=None): + with self.silence_numpy_warnings(): + self.assertPreciseEqual(sub(a, b), a - b, (a, b)) + self.assertPreciseEqual(sub(b, a), b - a, (a, b)) + # Did we get it right? + self.assertPreciseEqual(a - b, expected) + + check(DT('2014'), DT('2017'), TD(-3, 'Y')) + check(DT('2014-02'), DT('2017-01'), TD(-35, 'M')) + check(DT('2014-02-28'), DT('2015-03-01'), TD(-366, 'D')) + # NaTs + check(DT('NaT', 'M'), DT('2000'), TD('NaT', 'M')) + check(DT('NaT', 'M'), DT('2000-01-01'), TD('NaT', 'D')) + check(DT('NaT'), DT('NaT'), TD('NaT')) + # Test many more values + with self.silence_numpy_warnings(): + dts = self.datetime_samples() + for a, b in itertools.product(dts, dts): + if (not npdatetime_helpers.same_kind(value_unit(a), value_unit(b))): + continue + self.assertPreciseEqual(sub(a, b), a - b, (a, b)) + + def test_comparisons(self): + # Test all datetime comparisons all at once + eq = self.jit(eq_usecase) + ne = self.jit(ne_usecase) + lt = self.jit(lt_usecase) + le = self.jit(le_usecase) + gt = self.jit(gt_usecase) + ge = self.jit(ge_usecase) + + def check_eq(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # since np 1.16 all NaT comparisons bar != are False, including + # NaT==NaT + if np.isnat(a) or np.isnat(b): + expected_val = False + not_expected_val = True + self.assertFalse(le(a, b), (a, b)) + self.assertFalse(ge(a, b), (a, b)) + self.assertFalse(le(b, a), (a, b)) + self.assertFalse(ge(b, a), (a, b)) + self.assertFalse(lt(a, b), (a, b)) + self.assertFalse(gt(a, b), (a, b)) + self.assertFalse(lt(b, a), (a, b)) + self.assertFalse(gt(b, a), (a, b)) + + with self.silence_numpy_warnings(): + self.assertPreciseEqual(eq(a, b), expected_val, (a, b, expected)) + self.assertPreciseEqual(eq(b, a), expected_val, (a, b, expected)) + self.assertPreciseEqual(ne(a, b), not_expected_val, (a, b, expected)) + self.assertPreciseEqual(ne(b, a), not_expected_val, (a, b, expected)) + if expected_val: + # If equal, then equal-ordered comparisons are true + self.assertTrue(le(a, b), (a, b)) + self.assertTrue(ge(a, b), (a, b)) + self.assertTrue(le(b, a), (a, b)) + self.assertTrue(ge(b, a), (a, b)) + # and strictly ordered comparisons are false + self.assertFalse(lt(a, b), (a, b)) + self.assertFalse(gt(a, b), (a, b)) + self.assertFalse(lt(b, a), (a, b)) + self.assertFalse(gt(b, a), (a, b)) + # Did we get it right? + self.assertPreciseEqual(a == b, expected_val) + + def check_lt(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # since np 1.16 all NaT magnitude comparisons including equality + # are False (as NaT == NaT is now False) + if np.isnat(a) or np.isnat(b): + expected_val = False + not_expected_val = False + + with self.silence_numpy_warnings(): + lt = self.jit(lt_usecase) + self.assertPreciseEqual(lt(a, b), expected_val, (a, b, expected)) + self.assertPreciseEqual(gt(b, a), expected_val, (a, b, expected)) + self.assertPreciseEqual(ge(a, b), not_expected_val, (a, b, expected)) + self.assertPreciseEqual(le(b, a), not_expected_val, (a, b, expected)) + if expected_val: + # If true, then values are not equal + check_eq(a, b, False) + # Did we get it right? + self.assertPreciseEqual(a < b, expected_val) + + check_eq(DT('2014'), DT('2017'), False) + check_eq(DT('2014'), DT('2014-01'), True) + check_eq(DT('2014'), DT('2014-01-01'), True) + check_eq(DT('2014'), DT('2014-01-01', 'W'), True) + check_eq(DT('2014-01'), DT('2014-01-01', 'W'), True) + # Yes, it's not transitive + check_eq(DT('2014-01-01'), DT('2014-01-01', 'W'), False) + check_eq(DT('2014-01-02'), DT('2014-01-06', 'W'), True) + # with times + check_eq(DT('2014-01-01T00:01:00Z', 's'), + DT('2014-01-01T00:01Z', 'm'), True) + check_eq(DT('2014-01-01T00:01:01Z', 's'), + DT('2014-01-01T00:01Z', 'm'), False) + # NaTs + check_lt(DT('NaT', 'Y'), DT('2017'), True) + check_eq(DT('NaT'), DT('NaT'), True) + + # Check comparison between various units + dts = self.datetime_samples() + for a in dts: + # Take a number of smaller units + a_unit = a.dtype.str.split('[')[1][:-1] + i = all_units.index(a_unit) + units = all_units[i:i+6] + for unit in units: + # Force conversion + b = a.astype('M8[%s]' % unit) + if (not npdatetime_helpers.same_kind(value_unit(a), + value_unit(b))): + continue + check_eq(a, b, True) + check_lt(a, b + np.timedelta64(1, unit), True) + check_lt(b - np.timedelta64(1, unit), a, True) + + def _test_min_max(self, usecase): + f = self.jit(usecase) + def check(a, b): + self.assertPreciseEqual(f(a, b), usecase(a, b)) + + for cases in ( + (DT(0, 'ns'), DT(1, 'ns'), DT(2, 'ns'), DT('NaT', 'ns')), + (DT(0, 's'), DT(1, 's'), DT(2, 's'), DT('NaT', 's')), + ): + for a, b in itertools.product(cases, cases): + check(a, b) + + def test_min(self): + self._test_min_max(min_usecase) + + def test_max(self): + self._test_min_max(max_usecase) + +class TestDatetimeArithmeticNoPython(TestDatetimeArithmetic): + + jitargs = dict(nopython=True) + + +class TestMetadataScalingFactor(TestCase): + """ + Tests than non-1 scaling factors are not supported in datetime64 + and timedelta64 dtypes. + """ + + def test_datetime(self, jitargs={'forceobj':True}): + eq = jit(**jitargs)(eq_usecase) + self.assertTrue(eq(DT('2014', '10Y'), DT('2010'))) + + def test_datetime_npm(self): + with self.assertTypingError(): + self.test_datetime(jitargs={'nopython':True}) + + def test_timedelta(self, jitargs={'forceobj':True}): + eq = jit(**jitargs)(eq_usecase) + self.assertTrue(eq(TD(2, '10Y'), TD(20, 'Y'))) + + def test_timedelta_npm(self): + with self.assertTypingError(): + self.test_timedelta(jitargs={'nopython':True}) + + +class TestDatetimeDeltaOps(TestCase): + def test_div(self): + """ + Test the division of a timedelta by numeric types + """ + def arr_div(a, b): + return a / b + + py_func = arr_div + cfunc = njit(arr_div) + test_cases = [ + (np.ones(3, TIMEDELTA_M), np.ones(3, TIMEDELTA_M)), + (np.ones(3, TIMEDELTA_M), np.ones(3, TIMEDELTA_Y)), + (np.ones(3, TIMEDELTA_Y), np.ones(3, TIMEDELTA_M)), + (np.ones(3, TIMEDELTA_Y), np.ones(3, TIMEDELTA_Y)), + (np.ones(3, TIMEDELTA_M), 1), + (np.ones(3, TIMEDELTA_M), np.ones(3, np.int64)), + (np.ones(3, TIMEDELTA_M), np.ones(3, np.float64)), + ] + for a, b in test_cases: + self.assertTrue(np.array_equal(py_func(a, b), cfunc(a, b))) + + +class TestDatetimeArrayOps(TestCase): + + def _test_td_add_or_sub(self, operation, parallel): + """ + Test the addition/subtraction of a datetime array with a timedelta type + """ + def impl(a, b): + return operation(a, b) + + arr_one = np.array([ + np.datetime64("2011-01-01"), + np.datetime64("1971-02-02"), + np.datetime64("2021-03-03"), + np.datetime64("2004-12-07"), + ], dtype="datetime64[ns]") + arr_two = np.array([ + np.datetime64("2011-01-01"), + np.datetime64("1971-02-02"), + np.datetime64("2021-03-03"), + np.datetime64("2004-12-07"), + ], dtype="datetime64[D]") + py_func = impl + cfunc = njit(parallel=parallel)(impl) + test_cases = [ + (arr_one, np.timedelta64(1000)), + (arr_two, np.timedelta64(1000)), + (arr_one, np.timedelta64(-54557)), + (arr_two, np.timedelta64(-54557)), + ] + # np.add is commutative so test the reversed order + if operation is np.add: + test_cases.extend([ + (np.timedelta64(1000), arr_one), + (np.timedelta64(1000), arr_two), + (np.timedelta64(-54557), arr_one), + (np.timedelta64(-54557), arr_two), + ]) + for a, b in test_cases: + self.assertTrue(np.array_equal(py_func(a, b), cfunc(a, b))) + + def test_add_td(self): + self._test_td_add_or_sub(np.add, False) + + @skip_parfors_unsupported + def test_add_td_parallel(self): + self._test_td_add_or_sub(np.add, True) + + def test_sub_td(self): + self._test_td_add_or_sub(np.subtract, False) + + @skip_parfors_unsupported + def test_sub_td_parallel(self): + self._test_td_add_or_sub(np.subtract, True) + + def _test_add_sub_td_no_match(self, operation): + """ + Tests that attempting to add/sub a datetime64 and timedelta64 + with types that cannot be cast raises a reasonable exception. + """ + @njit + def impl(a, b): + return operation(a, b) + + fname = operation.__name__ + expected = re.escape((f"ufunc '{fname}' is not supported between " + "datetime64[ns] and timedelta64[M]")) + with self.assertRaisesRegex((TypingError, TypeError), expected): + impl( + np.array([np.datetime64("2011-01-01"),], + dtype="datetime64[ns]"), + np.timedelta64(1000,'M') + ) + + def test_add_td_no_match(self): + self._test_add_sub_td_no_match(np.add) + + def test_sub_td_no_match(self): + self._test_add_sub_td_no_match(np.subtract) + + def _get_testcases(self): + test_cases = [ + np.array([ + DT(0, "ns"), + DT(1, "ns"), + DT(2, "ns"), + DT(3, "ns"), + ]), + np.array([ + DT("2011-01-01", "ns"), + DT("1971-02-02", "ns"), + DT("1900-01-01", "ns"), + DT("2021-03-03", "ns"), + DT("2004-12-07", "ns"), + ]), + np.array([ + DT("2011-01-01", "D"), + DT("1971-02-02", "D"), + DT("1900-01-01", "D"), + DT("2021-03-03", "D"), + DT("2004-12-07", "D"), + ]), + np.array([ + DT("2011-01-01", "ns"), + DT("1971-02-02", "ns"), + DT("1900-01-01", "ns"), + DT("2021-03-03", "ns"), + DT("2004-12-07", "ns"), + DT("NaT", "ns"), + ]), + np.array([ + DT("NaT", "ns"), + DT("2011-01-01", "ns"), + DT("1971-02-02", "ns"), + DT("1900-01-01", "ns"), + DT("2021-03-03", "ns"), + DT("2004-12-07", "ns"), + ]), + np.array([ + DT("1971-02-02", "ns"), + DT("NaT", "ns"), + ]), + np.array([ + DT("NaT", "ns"), + DT("NaT", "ns"), + DT("NaT", "ns"), + ]), + np.array([ + TD(1, "ns"), + TD(2, "ns"), + TD(3, "ns"), + TD(4, "ns"), + ]), + np.array([ + TD(1, "D"), + TD(2, "D"), + TD(3, "D"), + TD(4, "D"), + ]), + np.array([ + TD("NaT", "ns"), + TD(1, "ns"), + TD(2, "ns"), + TD(3, "ns"), + TD(4, "ns"), + ]), + np.array([ + TD(1, "ns"), + TD(2, "ns"), + TD(3, "ns"), + TD(4, "ns"), + TD("NaT", "ns"), + ]), + np.array([ + TD("NaT", "ns"), + ]), + np.array([ + TD("NaT", "ns"), + TD("NaT", "ns"), + TD("NaT", "ns"), + ]), + ] + return test_cases + + def _test_min_max(self, operation, parallel, method): + if method: + if operation is np.min: + def impl(arr): + return arr.min() + else: + def impl(arr): + return arr.max() + else: + def impl(arr): + return operation(arr) + + py_func = impl + cfunc = njit(parallel=parallel)(impl) + + test_cases = self._get_testcases() + for arr in test_cases: + py_res = py_func(arr) + c_res = cfunc(arr) + if np.isnat(py_res) or np.isnat(c_res): + self.assertTrue(np.isnat(py_res)) + self.assertTrue(np.isnat(c_res)) + else: + self.assertEqual(py_res, c_res) + + def test_min_func(self): + self._test_min_max(min, False, False) + + def test_np_min_func(self): + self._test_min_max(np.min, False, False) + + def test_min_method(self): + self._test_min_max(np.min, False, True) + + def test_max_func(self): + self._test_min_max(max, False, False) + + def test_np_max_func(self): + self._test_min_max(np.max, False, False) + + def test_max_method(self): + self._test_min_max(np.max, False, True) + + @skip_parfors_unsupported + def test_min_func_parallel(self): + self._test_min_max(np.min, True, False) + + @skip_parfors_unsupported + def test_min_method_parallel(self): + self._test_min_max(np.min, True, True) + + @skip_parfors_unsupported + def test_max_func_parallel(self): + self._test_min_max(np.max, True, False) + + @skip_parfors_unsupported + def test_max_method_parallel(self): + self._test_min_max(np.max, True, True) + + def test_searchsorted_datetime(self): + from .test_np_functions import ( + searchsorted, searchsorted_left, searchsorted_right, + ) + pyfunc_list = [searchsorted, searchsorted_left, searchsorted_right] + cfunc_list = [jit(fn) for fn in pyfunc_list] + + def check(pyfunc, cfunc, a, v): + expected = pyfunc(a, v) + got = cfunc(a, v) + self.assertPreciseEqual(expected, got) + + cases = self._get_testcases() + for pyfunc, cfunc in zip(pyfunc_list, cfunc_list): + for arr in cases: + arr = np.sort(arr) + for n in range(1, min(3, arr.size) + 1): + idx = np.random.randint(0, arr.size, n) + vs = arr[idx] + if n == 1: + [v] = vs + check(pyfunc, cfunc, arr, v) + check(pyfunc, cfunc, arr, vs) + + + +class TestDatetimeTypeOps(TestCase): + def test_isinstance_datetime(self): + @njit + def is_complex(a): + return isinstance(a, complex) + @njit + def is_datetime(a): + return isinstance(a, np.datetime64) + @njit + def is_timedelta(a): + return isinstance(a, np.timedelta64) + + dt_a = np.datetime64(1, 'ns') + dt_b = np.datetime64(2, 'ns') + td_c = dt_b - dt_a + + def check(jit_func, x): + with self.subTest(f'{jit_func.__name__}({type(x).__name__})'): + got = jit_func(x) + expect = jit_func.py_func(x) + self.assertEqual(got, expect) + + fns = [ + is_complex, + is_datetime, + is_timedelta, + ] + args = [ + dt_a, + dt_b, + td_c, + ] + for fn, arg in itertools.product(fns, args): + check(fn, arg) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nrt.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nrt.py new file mode 100644 index 0000000000000000000000000000000000000000..f02b48cb711caa7d8c3866c2813342f18d49252e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nrt.py @@ -0,0 +1,857 @@ +import math +import os +import platform +import sys +import re + +import numpy as np + +from numba import njit +from numba.core import types +from numba.core.runtime import ( + rtsys, + nrtopt, + _nrt_python, + nrt, +) +from numba.core.extending import intrinsic, include_path +from numba.core.typing import signature +from numba.core.imputils import impl_ret_untracked +from llvmlite import ir +import llvmlite.binding as llvm +from numba.core.unsafe.nrt import NRT_get_api + +from numba.tests.support import (EnableNRTStatsMixin, TestCase, temp_directory, + import_dynamic, skip_if_32bit, + skip_unless_cffi, run_in_subprocess) +from numba.core.registry import cpu_target +import unittest + + +linux_only = unittest.skipIf(not sys.platform.startswith('linux'), + 'linux only test') +x86_only = unittest.skipIf(platform.machine() not in ('i386', 'x86_64'), + 'x86 only test') + + +class Dummy(object): + alive = 0 + + def __init__(self): + type(self).alive += 1 + + def __del__(self): + type(self).alive -= 1 + + +class TestNrtMemInfoNotInitialized(unittest.TestCase): + """ + Unit test for checking the use of the NRT fails if the + initialization sequence has not been run. + """ + _numba_parallel_test_ = False + + def test_init_fail(self): + methods = {'library': (), + 'meminfo_new': ((), ()), + 'meminfo_alloc': ((),), + } + + for meth, args in methods.items(): + try: + with self.assertRaises(RuntimeError) as raises: + rtsys._init = False + fn = getattr(rtsys, meth) + fn(*args) + + msg = "Runtime must be initialized before use." + self.assertIn(msg, str(raises.exception)) + finally: + rtsys._init = True + + +class TestNrtMemInfo(unittest.TestCase): + """ + Unit test for core MemInfo functionality + """ + + def setUp(self): + # Reset the Dummy class + Dummy.alive = 0 + # initialize the NRT (in case the tests are run in isolation) + rtsys.initialize(cpu_target.target_context) + super(TestNrtMemInfo, self).setUp() + + def test_meminfo_refct_1(self): + d = Dummy() + self.assertEqual(Dummy.alive, 1) + addr = 0xdeadcafe # some made up location + + mi = rtsys.meminfo_new(addr, d) + self.assertEqual(mi.refcount, 1) + del d + self.assertEqual(Dummy.alive, 1) + mi.acquire() + self.assertEqual(mi.refcount, 2) + self.assertEqual(Dummy.alive, 1) + mi.release() + self.assertEqual(mi.refcount, 1) + del mi + self.assertEqual(Dummy.alive, 0) + + def test_meminfo_refct_2(self): + d = Dummy() + self.assertEqual(Dummy.alive, 1) + addr = 0xdeadcafe # some made up location + + mi = rtsys.meminfo_new(addr, d) + self.assertEqual(mi.refcount, 1) + del d + self.assertEqual(Dummy.alive, 1) + for ct in range(100): + mi.acquire() + self.assertEqual(mi.refcount, 1 + 100) + self.assertEqual(Dummy.alive, 1) + for _ in range(100): + mi.release() + self.assertEqual(mi.refcount, 1) + del mi + self.assertEqual(Dummy.alive, 0) + + def test_fake_memoryview(self): + d = Dummy() + self.assertEqual(Dummy.alive, 1) + addr = 0xdeadcafe # some made up location + + mi = rtsys.meminfo_new(addr, d) + self.assertEqual(mi.refcount, 1) + mview = memoryview(mi) + self.assertEqual(mi.refcount, 1) + self.assertEqual(addr, mi.data) + self.assertFalse(mview.readonly) + self.assertIs(mi, mview.obj) + self.assertTrue(mview.c_contiguous) + self.assertEqual(mview.itemsize, 1) + self.assertEqual(mview.ndim, 1) + del d + del mi + + self.assertEqual(Dummy.alive, 1) + del mview + self.assertEqual(Dummy.alive, 0) + + def test_memoryview(self): + from ctypes import c_uint32, c_void_p, POINTER, cast + + dtype = np.dtype(np.uint32) + bytesize = dtype.itemsize * 10 + mi = rtsys.meminfo_alloc(bytesize, safe=True) + addr = mi.data + c_arr = cast(c_void_p(mi.data), POINTER(c_uint32 * 10)) + # Check 0xCB-filling + for i in range(10): + self.assertEqual(c_arr.contents[i], 0xcbcbcbcb) + + # Init array with ctypes + for i in range(10): + c_arr.contents[i] = i + 1 + mview = memoryview(mi) + self.assertEqual(mview.nbytes, bytesize) + self.assertFalse(mview.readonly) + self.assertIs(mi, mview.obj) + self.assertTrue(mview.c_contiguous) + self.assertEqual(mview.itemsize, 1) + self.assertEqual(mview.ndim, 1) + del mi + arr = np.ndarray(dtype=dtype, shape=mview.nbytes // dtype.itemsize, + buffer=mview) + del mview + # Modify array with NumPy + np.testing.assert_equal(np.arange(arr.size) + 1, arr) + + arr += 1 + + # Check value reflected in ctypes + for i in range(10): + self.assertEqual(c_arr.contents[i], i + 2) + + self.assertEqual(arr.ctypes.data, addr) + del arr + # At this point the memory is zero filled + # We can't check this deterministically because the memory could be + # consumed by another thread. + + def test_buffer(self): + from ctypes import c_uint32, c_void_p, POINTER, cast + + dtype = np.dtype(np.uint32) + bytesize = dtype.itemsize * 10 + mi = rtsys.meminfo_alloc(bytesize, safe=True) + self.assertEqual(mi.refcount, 1) + addr = mi.data + c_arr = cast(c_void_p(addr), POINTER(c_uint32 * 10)) + # Check 0xCB-filling + for i in range(10): + self.assertEqual(c_arr.contents[i], 0xcbcbcbcb) + + # Init array with ctypes + for i in range(10): + c_arr.contents[i] = i + 1 + + arr = np.ndarray(dtype=dtype, shape=bytesize // dtype.itemsize, + buffer=mi) + self.assertEqual(mi.refcount, 1) + del mi + # Modify array with NumPy + np.testing.assert_equal(np.arange(arr.size) + 1, arr) + + arr += 1 + + # Check value reflected in ctypes + for i in range(10): + self.assertEqual(c_arr.contents[i], i + 2) + + self.assertEqual(arr.ctypes.data, addr) + del arr + # At this point the memory is zero filled + # We can't check this deterministically because the memory could be + # consumed by another thread. + + @skip_if_32bit + def test_allocate_invalid_size(self): + # Checks that attempting to allocate too big a region fails gracefully. + size = types.size_t.maxval // 8 // 2 + for pred in (True, False): + with self.assertRaises(MemoryError) as raises: + rtsys.meminfo_alloc(size, safe=pred) + self.assertIn(f"Requested allocation of {size} bytes failed.", + str(raises.exception)) + + def test_allocate_negative_size(self): + # Checks that attempting to allocate negative number of bytes fails + # gracefully. + size = -10 + for pred in (True, False): + with self.assertRaises(ValueError) as raises: + rtsys.meminfo_alloc(size, safe=pred) + msg = f"Cannot allocate a negative number of bytes: {size}." + self.assertIn(msg, str(raises.exception)) + + +class TestTracemalloc(unittest.TestCase): + """ + Test NRT-allocated memory can be tracked by tracemalloc. + """ + + def measure_memory_diff(self, func): + try: + import tracemalloc + except ImportError: + self.skipTest("tracemalloc not available") + tracemalloc.start() + try: + before = tracemalloc.take_snapshot() + # Keep the result and only delete it after taking a snapshot + res = func() + after = tracemalloc.take_snapshot() + del res + return after.compare_to(before, 'lineno') + finally: + tracemalloc.stop() + + def test_snapshot(self): + N = 1000000 + dtype = np.int8 + + @njit + def alloc_nrt_memory(): + """ + Allocate and return a large array. + """ + return np.empty(N, dtype) + + def keep_memory(): + return alloc_nrt_memory() + + def release_memory(): + alloc_nrt_memory() + + alloc_lineno = keep_memory.__code__.co_firstlineno + 1 + + # Warmup JIT + alloc_nrt_memory() + + # The large NRT-allocated array should appear topmost in the diff + diff = self.measure_memory_diff(keep_memory) + stat = diff[0] + # There is a slight overhead, so the allocated size won't exactly be N + self.assertGreaterEqual(stat.size, N) + self.assertLess(stat.size, N * 1.015, + msg=("Unexpected allocation overhead encountered. " + "May be due to difference in CPython " + "builds or running under coverage")) + frame = stat.traceback[0] + self.assertEqual(os.path.basename(frame.filename), "test_nrt.py") + self.assertEqual(frame.lineno, alloc_lineno) + + # If NRT memory is released before taking a snapshot, it shouldn't + # appear. + diff = self.measure_memory_diff(release_memory) + stat = diff[0] + # Something else appears, but nothing the magnitude of N + self.assertLess(stat.size, N * 0.01) + + +class TestNRTIssue(TestCase): + def test_issue_with_refct_op_pruning(self): + """ + GitHub Issue #1244 https://github.com/numba/numba/issues/1244 + """ + @njit + def calculate_2D_vector_mag(vector): + x, y = vector + + return math.sqrt(x ** 2 + y ** 2) + + @njit + def normalize_2D_vector(vector): + normalized_vector = np.empty(2, dtype=np.float64) + + mag = calculate_2D_vector_mag(vector) + x, y = vector + + normalized_vector[0] = x / mag + normalized_vector[1] = y / mag + + return normalized_vector + + @njit + def normalize_vectors(num_vectors, vectors): + normalized_vectors = np.empty((num_vectors, 2), dtype=np.float64) + + for i in range(num_vectors): + vector = vectors[i] + + normalized_vector = normalize_2D_vector(vector) + + normalized_vectors[i, 0] = normalized_vector[0] + normalized_vectors[i, 1] = normalized_vector[1] + + return normalized_vectors + + num_vectors = 10 + test_vectors = np.random.random((num_vectors, 2)) + got = normalize_vectors(num_vectors, test_vectors) + expected = normalize_vectors.py_func(num_vectors, test_vectors) + + np.testing.assert_almost_equal(expected, got) + + def test_incref_after_cast(self): + # Issue #1427: when casting a value before returning it, the + # cast result should be incref'ed, not the original value. + def f(): + return 0.0, np.zeros(1, dtype=np.int32) + + # Note the return type isn't the same as the tuple type above: + # the first element is a complex rather than a float. + cfunc = njit((types.Tuple((types.complex128, + types.Array(types.int32, 1, 'C') )))())(f) + z, arr = cfunc() + self.assertPreciseEqual(z, 0j) + self.assertPreciseEqual(arr, np.zeros(1, dtype=np.int32)) + + def test_refct_pruning_issue_1511(self): + @njit + def f(): + a = np.ones(10, dtype=np.float64) + b = np.ones(10, dtype=np.float64) + return a, b[:] + + a, b = f() + np.testing.assert_equal(a, b) + np.testing.assert_equal(a, np.ones(10, dtype=np.float64)) + + def test_refct_pruning_issue_1526(self): + @njit + def udt(image, x, y): + next_loc = np.where(image == 1) + + if len(next_loc[0]) == 0: + y_offset = 1 + x_offset = 1 + else: + y_offset = next_loc[0][0] + x_offset = next_loc[1][0] + + next_loc_x = (x - 1) + x_offset + next_loc_y = (y - 1) + y_offset + + return next_loc_x, next_loc_y + + a = np.array([[1, 0, 1, 0, 1, 0, 0, 1, 0, 0]]) + expect = udt.py_func(a, 1, 6) + got = udt(a, 1, 6) + + self.assertEqual(expect, got) + + @TestCase.run_test_in_subprocess + def test_no_nrt_on_njit_decoration(self): + # Checks that the NRT is not initialized/compiled as a result of + # decorating a function with `@njit`. + from numba import njit + + # check the NRT is not initialized. + self.assertFalse(rtsys._init) + + # decorate + @njit + def foo(): + return 123 + + # check the NRT is still not initialized + self.assertFalse(rtsys._init) + + # execute + self.assertEqual(foo(), foo.py_func()) + + # check the NRT is still now initialized as execution has definitely + # occurred. + self.assertTrue(rtsys._init) + + +class TestRefCtPruning(unittest.TestCase): + + sample_llvm_ir = ''' +define i32 @"MyFunction"(i8** noalias nocapture %retptr, { i8*, i32 }** noalias nocapture %excinfo, i8* noalias nocapture readnone %env, double %arg.vt.0, double %arg.vt.1, double %arg.vt.2, double %arg.vt.3, double %arg.bounds.0, double %arg.bounds.1, double %arg.bounds.2, double %arg.bounds.3, i8* %arg.xs.0, i8* nocapture readnone %arg.xs.1, i64 %arg.xs.2, i64 %arg.xs.3, double* nocapture readonly %arg.xs.4, i64 %arg.xs.5.0, i64 %arg.xs.6.0, i8* %arg.ys.0, i8* nocapture readnone %arg.ys.1, i64 %arg.ys.2, i64 %arg.ys.3, double* nocapture readonly %arg.ys.4, i64 %arg.ys.5.0, i64 %arg.ys.6.0, i8* %arg.aggs_and_cols.0.0, i8* nocapture readnone %arg.aggs_and_cols.0.1, i64 %arg.aggs_and_cols.0.2, i64 %arg.aggs_and_cols.0.3, i32* nocapture %arg.aggs_and_cols.0.4, i64 %arg.aggs_and_cols.0.5.0, i64 %arg.aggs_and_cols.0.5.1, i64 %arg.aggs_and_cols.0.6.0, i64 %arg.aggs_and_cols.0.6.1) local_unnamed_addr { +entry: +tail call void @NRT_incref(i8* %arg.xs.0) +tail call void @NRT_incref(i8* %arg.ys.0) +tail call void @NRT_incref(i8* %arg.aggs_and_cols.0.0) +%.251 = icmp sgt i64 %arg.xs.5.0, 0 +br i1 %.251, label %B42.preheader, label %B160 + +B42.preheader: ; preds = %entry +%0 = add i64 %arg.xs.5.0, 1 +br label %B42 + +B42: ; preds = %B40.backedge, %B42.preheader +%lsr.iv3 = phi i64 [ %lsr.iv.next, %B40.backedge ], [ %0, %B42.preheader ] +%lsr.iv1 = phi double* [ %scevgep2, %B40.backedge ], [ %arg.xs.4, %B42.preheader ] +%lsr.iv = phi double* [ %scevgep, %B40.backedge ], [ %arg.ys.4, %B42.preheader ] +%.381 = load double, double* %lsr.iv1, align 8 +%.420 = load double, double* %lsr.iv, align 8 +%.458 = fcmp ole double %.381, %arg.bounds.1 +%not..432 = fcmp oge double %.381, %arg.bounds.0 +%"$phi82.1.1" = and i1 %.458, %not..432 +br i1 %"$phi82.1.1", label %B84, label %B40.backedge + +B84: ; preds = %B42 +%.513 = fcmp ole double %.420, %arg.bounds.3 +%not..487 = fcmp oge double %.420, %arg.bounds.2 +%"$phi106.1.1" = and i1 %.513, %not..487 +br i1 %"$phi106.1.1", label %B108.endif.endif.endif, label %B40.backedge + +B160: ; preds = %B40.backedge, %entry +tail call void @NRT_decref(i8* %arg.ys.0) +tail call void @NRT_decref(i8* %arg.xs.0) +tail call void @NRT_decref(i8* %arg.aggs_and_cols.0.0) +store i8* null, i8** %retptr, align 8 +ret i32 0 + +B108.endif.endif.endif: ; preds = %B84 +%.575 = fmul double %.381, %arg.vt.0 +%.583 = fadd double %.575, %arg.vt.1 +%.590 = fptosi double %.583 to i64 +%.630 = fmul double %.420, %arg.vt.2 +%.638 = fadd double %.630, %arg.vt.3 +%.645 = fptosi double %.638 to i64 +tail call void @NRT_incref(i8* %arg.aggs_and_cols.0.0) ; GONE 1 +tail call void @NRT_decref(i8* null) ; GONE 2 +tail call void @NRT_incref(i8* %arg.aggs_and_cols.0.0), !noalias !0 ; GONE 3 +%.62.i.i = icmp slt i64 %.645, 0 +%.63.i.i = select i1 %.62.i.i, i64 %arg.aggs_and_cols.0.5.0, i64 0 +%.64.i.i = add i64 %.63.i.i, %.645 +%.65.i.i = icmp slt i64 %.590, 0 +%.66.i.i = select i1 %.65.i.i, i64 %arg.aggs_and_cols.0.5.1, i64 0 +%.67.i.i = add i64 %.66.i.i, %.590 +%.84.i.i = mul i64 %.64.i.i, %arg.aggs_and_cols.0.5.1 +%.87.i.i = add i64 %.67.i.i, %.84.i.i +%.88.i.i = getelementptr i32, i32* %arg.aggs_and_cols.0.4, i64 %.87.i.i +%.89.i.i = load i32, i32* %.88.i.i, align 4, !noalias !3 +%.99.i.i = add i32 %.89.i.i, 1 +store i32 %.99.i.i, i32* %.88.i.i, align 4, !noalias !3 +tail call void @NRT_decref(i8* %arg.aggs_and_cols.0.0), !noalias !0 ; GONE 4 +tail call void @NRT_decref(i8* %arg.aggs_and_cols.0.0) ; GONE 5 +br label %B40.backedge + +B40.backedge: ; preds = %B108.endif.endif.endif, %B84, %B42 +%scevgep = getelementptr double, double* %lsr.iv, i64 1 +%scevgep2 = getelementptr double, double* %lsr.iv1, i64 1 +%lsr.iv.next = add i64 %lsr.iv3, -1 +%.294 = icmp sgt i64 %lsr.iv.next, 1 +br i1 %.294, label %B42, label %B160 +} + ''' # noqa + + def test_refct_pruning_op_recognize(self): + input_ir = self.sample_llvm_ir + input_lines = list(input_ir.splitlines()) + before_increfs = [ln for ln in input_lines if 'NRT_incref' in ln] + before_decrefs = [ln for ln in input_lines if 'NRT_decref' in ln] + + # prune + output_ir = nrtopt._remove_redundant_nrt_refct(input_ir) + output_lines = list(output_ir.splitlines()) + after_increfs = [ln for ln in output_lines if 'NRT_incref' in ln] + after_decrefs = [ln for ln in output_lines if 'NRT_decref' in ln] + + # check + self.assertNotEqual(before_increfs, after_increfs) + self.assertNotEqual(before_decrefs, after_decrefs) + + pruned_increfs = set(before_increfs) - set(after_increfs) + pruned_decrefs = set(before_decrefs) - set(after_decrefs) + + # the symm difference == or-combined + combined = pruned_increfs | pruned_decrefs + self.assertEqual(combined, pruned_increfs ^ pruned_decrefs) + pruned_lines = '\n'.join(combined) + + # all GONE lines are pruned + for i in [1, 2, 3, 4, 5]: + gone = '; GONE {}'.format(i) + self.assertIn(gone, pruned_lines) + # no other lines + self.assertEqual(len(list(pruned_lines.splitlines())), len(combined)) + + @unittest.skip("Pass removed as it was buggy. Re-enable when fixed.") + def test_refct_pruning_with_branches(self): + '''testcase from #2350''' + @njit + def _append_non_na(x, y, agg, field): + if not np.isnan(field): + agg[y, x] += 1 + + @njit + def _append(x, y, agg, field): + if not np.isnan(field): + if np.isnan(agg[y, x]): + agg[y, x] = field + else: + agg[y, x] += field + + @njit + def append(x, y, agg, field): + _append_non_na(x, y, agg, field) + _append(x, y, agg, field) + + # Disable python wrapper to avoid detecting necessary + # refcount inside it + @njit(no_cpython_wrapper=True) + def extend(arr, field): + for i in range(arr.shape[0]): + for j in range(arr.shape[1]): + append(j, i, arr, field) + + # Compile + extend.compile("(f4[:,::1], f4)") + + # Test there are no reference count operations + llvmir = str(extend.inspect_llvm(extend.signatures[0])) + refops = list(re.finditer(r'(NRT_incref|NRT_decref)\([^\)]+\)', llvmir)) + self.assertEqual(len(refops), 0) + + @linux_only + @x86_only + def test_inline_asm(self): + """The InlineAsm class from llvmlite.ir has no 'name' attr the refcount + pruning pass should be tolerant to this""" + llvm.initialize() + llvm.initialize_native_target() + llvm.initialize_native_asmprinter() + llvm.initialize_native_asmparser() + + @intrinsic + def bar(tyctx, x, y): + def codegen(cgctx, builder, sig, args): + (arg_0, arg_1) = args + fty = ir.FunctionType(ir.IntType(32), [ir.IntType(32), + ir.IntType(32)]) + mul = builder.asm(fty, "mov $2, $0; imul $1, $0", "=&r,r,r", + (arg_0, arg_1), name="asm_mul", + side_effect=False) + return impl_ret_untracked(cgctx, builder, sig.return_type, mul) + return signature(types.int32, types.int32, types.int32), codegen + + @njit(['int32(int32)']) + def foo(x): + x += 1 + z = bar(x, 2) + return z + + self.assertEqual(foo(10), 22) # expect (10 + 1) * 2 = 22 + + +@skip_unless_cffi +class TestNrtExternalCFFI(EnableNRTStatsMixin, TestCase): + """Testing the use of externally compiled C code that use NRT + """ + def setUp(self): + # initialize the NRT (in case the tests are run in isolation) + cpu_target.target_context + super(TestNrtExternalCFFI, self).setUp() + + def compile_cffi_module(self, name, source, cdef): + from cffi import FFI + + ffi = FFI() + ffi.set_source(name, source, include_dirs=[include_path()]) + ffi.cdef(cdef) + tmpdir = temp_directory("cffi_test_{}".format(name)) + ffi.compile(tmpdir=tmpdir) + sys.path.append(tmpdir) + try: + mod = import_dynamic(name) + finally: + sys.path.remove(tmpdir) + + return ffi, mod + + def get_nrt_api_table(self): + from cffi import FFI + + ffi = FFI() + nrt_get_api = ffi.cast("void* (*)()", _nrt_python.c_helpers['get_api']) + table = nrt_get_api() + return table + + def test_manage_memory(self): + name = "{}_test_manage_memory".format(self.__class__.__name__) + source = r""" +#include +#include "numba/core/runtime/nrt_external.h" + +int status = 0; + +void my_dtor(void *ptr) { + free(ptr); + status = 0xdead; +} + +NRT_MemInfo* test_nrt_api(NRT_api_functions *nrt) { + void * data = malloc(10); + NRT_MemInfo *mi = nrt->manage_memory(data, my_dtor); + nrt->acquire(mi); + nrt->release(mi); + status = 0xa110c; + return mi; +} + """ + cdef = """ +void* test_nrt_api(void *nrt); +extern int status; + """ + + ffi, mod = self.compile_cffi_module(name, source, cdef) + # Init status is 0 + self.assertEqual(mod.lib.status, 0) + table = self.get_nrt_api_table() + out = mod.lib.test_nrt_api(table) + # status is now 0xa110c + self.assertEqual(mod.lib.status, 0xa110c) + mi_addr = int(ffi.cast("size_t", out)) + mi = nrt.MemInfo(mi_addr) + self.assertEqual(mi.refcount, 1) + del mi # force deallocation on mi + # status is now 0xdead + self.assertEqual(mod.lib.status, 0xdead) + + def test_allocate(self): + name = "{}_test_allocate".format(self.__class__.__name__) + source = r""" +#include +#include "numba/core/runtime/nrt_external.h" + +NRT_MemInfo* test_nrt_api(NRT_api_functions *nrt, size_t n) { + size_t *data = NULL; + NRT_MemInfo *mi = nrt->allocate(n); + data = nrt->get_data(mi); + data[0] = 0xded; + data[1] = 0xabc; + data[2] = 0xdef; + return mi; +} + """ + cdef = "void* test_nrt_api(void *nrt, size_t n);" + ffi, mod = self.compile_cffi_module(name, source, cdef) + + table = self.get_nrt_api_table() + + numbytes = 3 * np.dtype(np.intp).itemsize + out = mod.lib.test_nrt_api(table, numbytes) + + mi_addr = int(ffi.cast("size_t", out)) + mi = nrt.MemInfo(mi_addr) + self.assertEqual(mi.refcount, 1) + + buffer = ffi.buffer(ffi.cast("char [{}]".format(numbytes), mi.data)) + arr = np.ndarray(shape=(3,), dtype=np.intp, buffer=buffer) + np.testing.assert_equal(arr, [0xded, 0xabc, 0xdef]) + + def test_get_api(self): + from cffi import FFI + + @njit + def test_nrt_api(): + return NRT_get_api() + + ffi = FFI() + expect = int(ffi.cast('size_t', self.get_nrt_api_table())) + got = test_nrt_api() + self.assertEqual(expect, got) + + +class TestNrtStatistics(TestCase): + + def setUp(self): + # Store the current stats state + self.__stats_state = _nrt_python.memsys_stats_enabled() + + def tearDown(self): + # Set stats state back to whatever it was before the test ran + if self.__stats_state: + _nrt_python.memsys_enable_stats() + else: + _nrt_python.memsys_disable_stats() + + def test_stats_env_var_explicit_on(self): + # Checks that explicitly turning the stats on via the env var works. + src = """if 1: + from numba import njit + import numpy as np + from numba.core.runtime import rtsys, _nrt_python + from numba.core.registry import cpu_target + + @njit + def foo(): + return np.arange(10)[0] + + # initialize the NRT before use + rtsys.initialize(cpu_target.target_context) + assert _nrt_python.memsys_stats_enabled() + orig_stats = rtsys.get_allocation_stats() + foo() + new_stats = rtsys.get_allocation_stats() + total_alloc = new_stats.alloc - orig_stats.alloc + total_free = new_stats.free - orig_stats.free + total_mi_alloc = new_stats.mi_alloc - orig_stats.mi_alloc + total_mi_free = new_stats.mi_free - orig_stats.mi_free + + expected = 1 + assert total_alloc == expected + assert total_free == expected + assert total_mi_alloc == expected + assert total_mi_free == expected + """ + # Check env var explicitly being set works + env = os.environ.copy() + env['NUMBA_NRT_STATS'] = "1" + run_in_subprocess(src, env=env) + + def check_env_var_off(self, env): + + src = """if 1: + from numba import njit + import numpy as np + from numba.core.runtime import rtsys, _nrt_python + + @njit + def foo(): + return np.arange(10)[0] + + assert _nrt_python.memsys_stats_enabled() == False + try: + rtsys.get_allocation_stats() + except RuntimeError as e: + assert "NRT stats are disabled." in str(e) + """ + run_in_subprocess(src, env=env) + + def test_stats_env_var_explicit_off(self): + # Checks that explicitly turning the stats off via the env var works. + env = os.environ.copy() + env['NUMBA_NRT_STATS'] = "0" + self.check_env_var_off(env) + + def test_stats_env_var_default_off(self): + # Checks that the env var not being set is the same as "off", i.e. + # default for Numba is off. + env = os.environ.copy() + env.pop('NUMBA_NRT_STATS', None) + self.check_env_var_off(env) + + def test_stats_status_toggle(self): + + @njit + def foo(): + tmp = np.ones(3) + return np.arange(5 * tmp[0]) + + # Switch on stats + _nrt_python.memsys_enable_stats() + # check the stats are on + self.assertTrue(_nrt_python.memsys_stats_enabled()) + + for i in range(2): + # capture the stats state + stats_1 = rtsys.get_allocation_stats() + # Switch off stats + _nrt_python.memsys_disable_stats() + # check the stats are off + self.assertFalse(_nrt_python.memsys_stats_enabled()) + # run something that would move the counters were they enabled + foo() + # Switch on stats + _nrt_python.memsys_enable_stats() + # check the stats are on + self.assertTrue(_nrt_python.memsys_stats_enabled()) + # capture the stats state (should not have changed) + stats_2 = rtsys.get_allocation_stats() + # run something that will move the counters + foo() + # capture the stats state (should have changed) + stats_3 = rtsys.get_allocation_stats() + # check stats_1 == stats_2 + self.assertEqual(stats_1, stats_2) + # check stats_2 < stats_3 + self.assertLess(stats_2, stats_3) + + def test_rtsys_stats_query_raises_exception_when_disabled(self): + # Checks that the standard rtsys.get_allocation_stats() query raises + # when stats counters are turned off. + + _nrt_python.memsys_disable_stats() + self.assertFalse(_nrt_python.memsys_stats_enabled()) + + with self.assertRaises(RuntimeError) as raises: + rtsys.get_allocation_stats() + + self.assertIn("NRT stats are disabled.", str(raises.exception)) + + def test_nrt_explicit_stats_query_raises_exception_when_disabled(self): + # Checks the various memsys_get_stats functions raise if queried when + # the stats counters are disabled. + method_variations = ('alloc', 'free', 'mi_alloc', 'mi_free') + for meth in method_variations: + stats_func = getattr(_nrt_python, f'memsys_get_stats_{meth}') + with self.subTest(stats_func=stats_func): + # Turn stats off + _nrt_python.memsys_disable_stats() + self.assertFalse(_nrt_python.memsys_stats_enabled()) + with self.assertRaises(RuntimeError) as raises: + stats_func() + self.assertIn("NRT stats are disabled.", str(raises.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nrt_refct.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nrt_refct.py new file mode 100644 index 0000000000000000000000000000000000000000..3049c7a3b3cb7239394b02d75f4d14f3bf2abd8b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_nrt_refct.py @@ -0,0 +1,115 @@ +""" +Tests issues or edge cases for producing invalid NRT refct +""" + + +import gc + +import numpy as np + +import unittest +from numba import njit +from numba.core.runtime import rtsys +from numba.tests.support import TestCase, EnableNRTStatsMixin + + +class TestNrtRefCt(EnableNRTStatsMixin, TestCase): + + def setUp(self): + # Clean up any NRT-backed objects hanging in a dead reference cycle + gc.collect() + super(TestNrtRefCt, self).setUp() + + def test_no_return(self): + """ + Test issue #1291 + """ + + @njit + def foo(n): + for i in range(n): + temp = np.zeros(2) + return 0 + + n = 10 + init_stats = rtsys.get_allocation_stats() + foo(n) + cur_stats = rtsys.get_allocation_stats() + self.assertEqual(cur_stats.alloc - init_stats.alloc, n) + self.assertEqual(cur_stats.free - init_stats.free, n) + + def test_escaping_var_init_in_loop(self): + """ + Test issue #1297 + """ + + @njit + def g(n): + + x = np.zeros((n, 2)) + + for i in range(n): + y = x[i] + + for i in range(n): + y = x[i] + + return 0 + + init_stats = rtsys.get_allocation_stats() + g(10) + cur_stats = rtsys.get_allocation_stats() + self.assertEqual(cur_stats.alloc - init_stats.alloc, 1) + self.assertEqual(cur_stats.free - init_stats.free, 1) + + def test_invalid_computation_of_lifetime(self): + """ + Test issue #1573 + """ + @njit + def if_with_allocation_and_initialization(arr1, test1): + tmp_arr = np.zeros_like(arr1) + + for i in range(tmp_arr.shape[0]): + pass + + if test1: + np.zeros_like(arr1) + + return tmp_arr + + arr = np.random.random((5, 5)) # the values are not consumed + + init_stats = rtsys.get_allocation_stats() + if_with_allocation_and_initialization(arr, False) + cur_stats = rtsys.get_allocation_stats() + self.assertEqual(cur_stats.alloc - init_stats.alloc, + cur_stats.free - init_stats.free) + + def test_del_at_beginning_of_loop(self): + """ + Test issue #1734 + """ + @njit + def f(arr): + res = 0 + + for i in (0, 1): + # `del t` is issued here before defining t. It must be + # correctly handled by the lowering phase. + t = arr[i] + if t[i] > 1: + res += t[i] + + return res + + arr = np.ones((2, 2)) + init_stats = rtsys.get_allocation_stats() + f(arr) + cur_stats = rtsys.get_allocation_stats() + self.assertEqual(cur_stats.alloc - init_stats.alloc, + cur_stats.free - init_stats.free) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_num_threads.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_num_threads.py new file mode 100644 index 0000000000000000000000000000000000000000..fdd51ac3dda7056919d9fe1218ffe33c1b97cdbb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_num_threads.py @@ -0,0 +1,632 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, absolute_import, division + +import sys +import os +import re +import multiprocessing +import unittest + +import numpy as np + +from numba import (njit, set_num_threads, get_num_threads, prange, config, + threading_layer, guvectorize) +from numba.np.ufunc.parallel import get_thread_id +from numba.core.errors import TypingError +from numba.tests.support import TestCase, skip_parfors_unsupported, tag +from numba.tests.test_parallel_backend import TestInSubprocess + + +class TestNumThreads(TestCase): + _numba_parallel_test_ = False + + def setUp(self): + # Make sure the num_threads is set to the max. This also makes sure + # the threads are launched. + set_num_threads(config.NUMBA_NUM_THREADS) + + def check_mask(self, expected, result): + # There's no guarantee that TBB will use a full mask worth of + # threads if it deems it inefficient to do so + if threading_layer() == 'tbb': + self.assertTrue(np.all(result <= expected)) + elif threading_layer() in ('omp', 'workqueue'): + np.testing.assert_equal(expected, result) + else: + assert 0, 'unreachable' + + @skip_parfors_unsupported + def test_set_num_threads_type(self): + + @njit + def foo(): + set_num_threads('wrong_type') + + expected = "The number of threads specified must be an integer" + for fn, errty in ((foo, TypingError), (foo.py_func, TypeError)): + with self.assertRaises(errty) as raises: + fn() + self.assertIn(expected, str(raises.exception)) + + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_set_num_threads_basic(self): + max_threads = config.NUMBA_NUM_THREADS + + self.assertEqual(get_num_threads(), max_threads) + set_num_threads(2) + self.assertEqual(get_num_threads(), 2) + set_num_threads(max_threads) + self.assertEqual(get_num_threads(), max_threads) + + with self.assertRaises(ValueError): + set_num_threads(0) + + with self.assertRaises(ValueError): + set_num_threads(max_threads + 1) + + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_set_num_threads_basic_jit(self): + max_threads = config.NUMBA_NUM_THREADS + + @njit + def get_n(): + return get_num_threads() + + self.assertEqual(get_n(), max_threads) + set_num_threads(2) + self.assertEqual(get_n(), 2) + set_num_threads(max_threads) + self.assertEqual(get_n(), max_threads) + + @njit + def set_get_n(n): + set_num_threads(n) + return get_num_threads() + + self.assertEqual(set_get_n(2), 2) + self.assertEqual(set_get_n(max_threads), max_threads) + + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_set_num_threads_basic_guvectorize(self): + max_threads = config.NUMBA_NUM_THREADS + + @guvectorize(['void(int64[:])'], + '(n)', + nopython=True, + target='parallel') + def get_n(x): + x[:] = get_num_threads() + + x = np.zeros((5000000,), dtype=np.int64) + get_n(x) + np.testing.assert_equal(x, max_threads) + set_num_threads(2) + x = np.zeros((5000000,), dtype=np.int64) + get_n(x) + np.testing.assert_equal(x, 2) + set_num_threads(max_threads) + x = np.zeros((5000000,), dtype=np.int64) + get_n(x) + np.testing.assert_equal(x, max_threads) + + @guvectorize(['void(int64[:])'], + '(n)', + nopython=True, + target='parallel') + def set_get_n(n): + set_num_threads(n[0]) + n[:] = get_num_threads() + + x = np.zeros((5000000,), dtype=np.int64) + x[0] = 2 + set_get_n(x) + np.testing.assert_equal(x, 2) + x = np.zeros((5000000,), dtype=np.int64) + x[0] = max_threads + set_get_n(x) + np.testing.assert_equal(x, max_threads) + + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_set_num_threads_outside_jit(self): + + # Test set_num_threads outside a jitted function + set_num_threads(2) + + @njit(parallel=True) + def test_func(): + x = 5 + buf = np.empty((x,)) + for i in prange(x): + buf[i] = get_num_threads() + return buf + + @guvectorize(['void(int64[:])'], + '(n)', + nopython=True, + target='parallel') + def test_gufunc(x): + x[:] = get_num_threads() + + out = test_func() + np.testing.assert_equal(out, 2) + + x = np.zeros((5000000,), dtype=np.int64) + test_gufunc(x) + np.testing.assert_equal(x, 2) + + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_set_num_threads_inside_jit(self): + # Test set_num_threads inside a jitted function + @njit(parallel=True) + def test_func(nthreads): + x = 5 + buf = np.empty((x,)) + set_num_threads(nthreads) + for i in prange(x): + buf[i] = get_num_threads() + return buf + + mask = 2 + out = test_func(mask) + np.testing.assert_equal(out, mask) + + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_set_num_threads_inside_guvectorize(self): + # Test set_num_threads inside a jitted guvectorize function + @guvectorize(['void(int64[:])'], + '(n)', + nopython=True, + target='parallel') + def test_func(x): + set_num_threads(x[0]) + x[:] = get_num_threads() + + x = np.zeros((5000000,), dtype=np.int64) + mask = 2 + x[0] = mask + test_func(x) + np.testing.assert_equal(x, mask) + + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_get_num_threads_truth_outside_jit(self): + + for mask in range(2, min(6, config.NUMBA_NUM_THREADS + 1)): + set_num_threads(mask) + + # a lot of work, hopefully will trigger "mask" count of threads to + # join the parallel region (for those backends with dynamic threads) + @njit(parallel=True) + def test_func(): + x = 5000000 + buf = np.empty((x,)) + for i in prange(x): + buf[i] = get_thread_id() + return len(np.unique(buf)), get_num_threads() + + out = test_func() + self.check_mask((mask, mask), out) + + @guvectorize(['void(int64[:], int64[:])'], + '(n), (m)', + nopython=True, + target='parallel') + def test_gufunc(x, out): + x[:] = get_thread_id() + out[0] = get_num_threads() + + # Reshape to force parallelism + x = np.full((5000000,), -1, dtype=np.int64).reshape((100, 50000)) + out = np.zeros((1,), dtype=np.int64) + test_gufunc(x, out) + self.check_mask(mask, out) + self.check_mask(mask, len(np.unique(x))) + + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_get_num_threads_truth_inside_jit(self): + + for mask in range(2, min(6, config.NUMBA_NUM_THREADS + 1)): + + # a lot of work, hopefully will trigger "mask" count of threads to + # join the parallel region (for those backends with dynamic threads) + @njit(parallel=True) + def test_func(): + set_num_threads(mask) + x = 5000000 + buf = np.empty((x,)) + for i in prange(x): + buf[i] = get_thread_id() + return len(np.unique(buf)), get_num_threads() + + out = test_func() + self.check_mask((mask, mask), out) + + @guvectorize(['void(int64[:], int64[:])'], + '(n), (m)', + nopython=True, + target='parallel') + def test_gufunc(x, out): + set_num_threads(mask) + x[:] = get_thread_id() + out[0] = get_num_threads() + + # Reshape to force parallelism + x = np.full((5000000,), -1, dtype=np.int64).reshape((100, 50000)) + out = np.zeros((1,), dtype=np.int64) + test_gufunc(x, out) + self.check_mask(mask, out) + self.check_mask(mask, len(np.unique(x))) + + # this test can only run on OpenMP (providing OMP_MAX_ACTIVE_LEVELS is not + # set or >= 2) and TBB backends + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_nested_parallelism_1(self): + if threading_layer() == 'workqueue': + self.skipTest("workqueue is not threadsafe") + + # check that get_num_threads is ok in nesting + mask = config.NUMBA_NUM_THREADS - 1 + + N = config.NUMBA_NUM_THREADS + M = 2 * config.NUMBA_NUM_THREADS + + @njit(parallel=True) + def child_func(buf, fid): + M, N = buf.shape + for i in prange(N): + buf[fid, i] = get_num_threads() + + def get_test(test_type): + if test_type == 'njit': + def test_func(nthreads, py_func=False): + @njit(parallel=True) + def _test_func(nthreads): + acc = 0 + buf = np.zeros((M, N)) + set_num_threads(nthreads) + for i in prange(M): + local_mask = 1 + i % mask + # set threads in parent function + set_num_threads(local_mask) + if local_mask < N: + child_func(buf, local_mask) + acc += get_num_threads() + return acc, buf + if py_func: + return _test_func.py_func(nthreads) + else: + return _test_func(nthreads) + + elif test_type == 'guvectorize': + def test_func(nthreads, py_func=False): + def _test_func(acc, buf, local_mask): + set_num_threads(nthreads) + # set threads in parent function + set_num_threads(local_mask[0]) + if local_mask[0] < N: + child_func(buf, local_mask[0]) + acc[0] += get_num_threads() + + buf = np.zeros((M, N), dtype=np.int64) + acc = np.zeros((M, 1), dtype=np.int64) + local_mask = (1 + np.arange(M) % mask).reshape((M, 1)) + sig = ['void(int64[:], int64[:, :], int64[:])'] + layout = '(p), (n, m), (p)' + if not py_func: + _test_func = guvectorize(sig, layout, nopython=True, + target='parallel')(_test_func) + else: + _test_func = guvectorize(sig, layout, + forceobj=True)(_test_func) + _test_func(acc, buf, local_mask) + return acc, buf + + return test_func + + for test_type in ['njit', 'guvectorize']: + test_func = get_test(test_type) + got_acc, got_arr = test_func(mask) + exp_acc, exp_arr = test_func(mask, py_func=True) + np.testing.assert_equal(exp_acc, got_acc) + np.testing.assert_equal(exp_arr, got_arr) + + # check the maths reconciles, guvectorize does not reduce, njit does + math_acc_exp = 1 + np.arange(M) % mask + if test_type == 'guvectorize': + math_acc = math_acc_exp.reshape((M, 1)) + else: + math_acc = np.sum(math_acc_exp) + + np.testing.assert_equal(math_acc, got_acc) + + math_arr = np.zeros((M, N)) + for i in range(1, N): + # there's branches on 1, ..., num_threads - 1 + math_arr[i, :] = i + np.testing.assert_equal(math_arr, got_arr) + + # this test can only run on OpenMP (providing OMP_MAX_ACTIVE_LEVELS is not + # set or >= 2) and TBB backends + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + def _test_nested_parallelism_2(self): + if threading_layer() == 'workqueue': + self.skipTest("workqueue is not threadsafe") + + # check that get_num_threads is ok in nesting + + N = config.NUMBA_NUM_THREADS + 1 + M = 4 * config.NUMBA_NUM_THREADS + 1 + + def get_impl(child_type, test_type): + + if child_type == 'parallel': + child_dec = njit(parallel=True) + elif child_type == 'njit': + child_dec = njit(parallel=False) + elif child_type == 'none': + def child_dec(x): + return x + + @child_dec + def child(buf, fid): + M, N = buf.shape + set_num_threads(fid) # set threads in child function + for i in prange(N): + buf[fid, i] = get_num_threads() + + if test_type in ['parallel', 'njit', 'none']: + if test_type == 'parallel': + test_dec = njit(parallel=True) + elif test_type == 'njit': + test_dec = njit(parallel=False) + elif test_type == 'none': + def test_dec(x): + return x + + @test_dec + def test_func(nthreads): + buf = np.zeros((M, N)) + set_num_threads(nthreads) + for i in prange(M): + local_mask = 1 + i % mask + # when the threads exit the child functions they should + # have a TLS slot value of the local mask as it was set + # in child + if local_mask < config.NUMBA_NUM_THREADS: + child(buf, local_mask) + assert get_num_threads() == local_mask + return buf + else: + if test_type == 'guvectorize': + test_dec = guvectorize(['int64[:,:], int64[:]'], + '(n, m), (k)', nopython=True, + target='parallel') + elif test_type == 'guvectorize-obj': + test_dec = guvectorize(['int64[:,:], int64[:]'], + '(n, m), (k)', forceobj=True) + + def test_func(nthreads): + @test_dec + def _test_func(buf, local_mask): + set_num_threads(nthreads) + # when the threads exit the child functions they should + # have a TLS slot value of the local mask as it was set + # in child + if local_mask[0] < config.NUMBA_NUM_THREADS: + child(buf, local_mask[0]) + assert get_num_threads() == local_mask[0] + + buf = np.zeros((M, N), dtype=np.int64) + local_mask = (1 + np.arange(M) % mask).reshape((M, 1)) + _test_func(buf, local_mask) + return buf + + return test_func + + mask = config.NUMBA_NUM_THREADS - 1 + + res_arrays = {} + for test_type in ['parallel', 'njit', 'none', + 'guvectorize', 'guvectorize-obj']: + for child_type in ['parallel', 'njit', 'none']: + if child_type == 'none' and test_type != 'none': + continue + set_num_threads(mask) + res_arrays[test_type, child_type] = get_impl( + child_type, test_type)(mask) + + py_arr = res_arrays['none', 'none'] + for arr in res_arrays.values(): + np.testing.assert_equal(arr, py_arr) + + # check the maths reconciles + math_arr = np.zeros((M, N)) + # there's branches on modulo mask but only NUMBA_NUM_THREADS funcs + for i in range(1, config.NUMBA_NUM_THREADS): + math_arr[i, :] = i + + np.testing.assert_equal(math_arr, py_arr) + + # this test can only run on OpenMP (providing OMP_MAX_ACTIVE_LEVELS is not + # set or >= 2) and TBB backends + # This test needs at least 3 threads to run, N>=2 for the launch, M>=N+1 for + # the nested function + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 3, "Not enough CPU cores") + def _test_nested_parallelism_3(self): + if threading_layer() == 'workqueue': + self.skipTest("workqueue is not threadsafe") + + # check that the right number of threads are present in nesting + # this relies on there being a load of cores present + BIG = 1000000 + + @njit(parallel=True) + def work(local_nt): # arg is value 3 + tid = np.zeros(BIG) + acc = 0 + set_num_threads(local_nt) # set to 3 threads + for i in prange(BIG): + acc += 1 + tid[i] = get_thread_id() + return acc, np.unique(tid) + + @njit(parallel=True) + def test_func_jit(nthreads): + set_num_threads(nthreads) # set to 2 threads + lens = np.zeros(nthreads) + total = 0 + for i in prange(nthreads): + my_acc, tids = work(nthreads + 1) # call with value 3 + lens[i] = len(tids) + total += my_acc + return total, np.unique(lens) + + NT = 2 + expected_acc = BIG * NT + expected_thread_count = NT + 1 + + got_acc, got_tc = test_func_jit(NT) + self.assertEqual(expected_acc, got_acc) + self.check_mask(expected_thread_count, got_tc) + + def test_guvectorize(nthreads): + @guvectorize(['int64[:], int64[:]'], + '(n), (n)', + nopython=True, + target='parallel') + def test_func_guvectorize(total, lens): + my_acc, tids = work(nthreads + 1) + lens[0] = len(tids) + total[0] += my_acc + + total = np.zeros((nthreads, 1), dtype=np.int64) + lens = np.zeros(nthreads, dtype=np.int64).reshape((nthreads, 1)) + + test_func_guvectorize(total, lens) + # vectorize does not reduce, so total is summed + return total.sum(), np.unique(lens) + + got_acc, got_tc = test_guvectorize(NT) + + self.assertEqual(expected_acc, got_acc) + self.check_mask(expected_thread_count, got_tc) + + @skip_parfors_unsupported + @unittest.skipIf(config.NUMBA_NUM_THREADS < 2, "Not enough CPU cores") + @unittest.skipIf(not sys.platform.startswith('linux'), "Linux only") + def _test_threadmask_across_fork(self): + forkctx = multiprocessing.get_context('fork') + + @njit + def foo(): + return get_num_threads() + + def wrap(queue): + queue.put(foo()) + + mask = 1 + self.assertEqual(foo(), config.NUMBA_NUM_THREADS) + set_num_threads(mask) + self.assertEqual(foo(), mask) + shared_queue = forkctx.Queue() + # check TLS slot inheritance in fork + p = forkctx.Process(target=wrap, args=(shared_queue,)) + p.start() + p.join() + self.assertEqual(shared_queue.get(), mask) + + def tearDown(self): + set_num_threads(config.NUMBA_NUM_THREADS) + + @skip_parfors_unsupported + def _test_get_thread_id_not_parallel(self): + python_get_thread_id = get_thread_id() + check_array_size = 8 + + @njit(parallel=False) + def par_false(size): + njit_par_false_tid = get_thread_id() + res = np.ones(size) + for i in prange(size): + res[i] = get_thread_id() + return njit_par_false_tid, res + + @njit(parallel=True) + def par_true(size): + njit_par_true_tid = get_thread_id() + res = np.ones(size) + for i in range(size): + res[i] = get_thread_id() + return njit_par_true_tid, res + + self.assertEqual(python_get_thread_id, 0) + njit_par_false_tid, njit_par_false_arr = par_false(check_array_size) + self.assertEqual(njit_par_false_tid, 0) + np.testing.assert_equal(njit_par_false_arr, 0) + njit_par_true_tid, njit_par_true_arr = par_true(check_array_size) + self.assertEqual(njit_par_true_tid, 0) + np.testing.assert_equal(njit_par_true_arr, 0) + + +class TestNumThreadsBackends(TestInSubprocess, TestCase): + _class = TestNumThreads + _DEBUG = False + + # 1 is mainly here to ensure tests skip correctly + num_threads = [i for i in [1, 2, 4, 8, 16] if i <= config.NUMBA_NUM_THREADS] + + def run_test_in_separate_process(self, test, threading_layer, num_threads): + env_copy = os.environ.copy() + env_copy['NUMBA_THREADING_LAYER'] = str(threading_layer) + env_copy['NUMBA_NUM_THREADS'] = str(num_threads) + cmdline = [sys.executable, "-m", "numba.runtests", "-v", test] + return self.run_cmd(cmdline, env_copy) + + @classmethod + def _inject(cls, name, backend, backend_guard, num_threads): + themod = cls.__module__ + thecls = cls._class.__name__ + injected_method = '%s.%s.%s' % (themod, thecls, name) + + def test_template(self): + o, e = self.run_test_in_separate_process(injected_method, backend, + num_threads) + if self._DEBUG: + print('stdout:\n "%s"\n stderr:\n "%s"' % (o, e)) + # If the test was skipped in the subprocess, then mark this as a + # skipped test. + m = re.search(r"\.\.\. skipped '(.*?)'", e) + if m is not None: + self.skipTest(m.group(1)) + self.assertIn('OK', e) + self.assertTrue('FAIL' not in e) + self.assertTrue('ERROR' not in e) + + injected_test = "%s_%s_%s_threads" % (name[1:], backend, num_threads) + setattr(cls, injected_test, + tag('long_running')(backend_guard(test_template))) + + @classmethod + def generate(cls): + for name in cls._class.__dict__.copy(): + for backend, backend_guard in cls.backends.items(): + for num_threads in cls.num_threads: + if not name.startswith('_test_'): + continue + cls._inject(name, backend, backend_guard, num_threads) + + +TestNumThreadsBackends.generate() + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numberctor.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numberctor.py new file mode 100644 index 0000000000000000000000000000000000000000..fd074bef5f7b4436589f0b9262f8c4fabf290c55 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numberctor.py @@ -0,0 +1,241 @@ +import numpy as np + +from numba import jit, njit +from numba.core import types + +from numba.tests.support import TestCase, tag +import unittest + + +def dobool(a): + return bool(a) + + +def doint(a): + return int(a) + + +def dofloat(a): + return float(a) + + +def docomplex(a): + return complex(a) + + +def docomplex2(a, b): + return complex(a, b) + + +def complex_calc(a): + z = complex(a) + return z.real ** 2 + z.imag ** 2 + + +def complex_calc2(a, b): + z = complex(a, b) + return z.real ** 2 + z.imag ** 2 + + +def converter(tp): + def f(a): + return tp(a) + return f + + +def real_np_types(): + for tp_name in ('int8', 'int16', 'int32', 'int64', + 'uint8', 'uint16', 'uint32', 'uint64', + 'intc', 'uintc', 'intp', 'uintp', + 'float32', 'float64', 'bool_'): + yield tp_name + +def complex_np_types(): + for tp_name in ('complex64', 'complex128'): + yield tp_name + + +class TestScalarNumberCtor(TestCase): + """ + Test (some scalar) + """ + + def check_int_constructor(self, pyfunc): + x_types = [ + types.boolean, types.int32, types.int64, types.float32, types.float64 + ] + x_values = [1, 0, 1000, 12.2, 23.4] + + for ty, x in zip(x_types, x_values): + cfunc = njit((ty,))(pyfunc) + self.assertPreciseEqual(pyfunc(x), cfunc(x)) + + def test_bool(self): + self.check_int_constructor(dobool) + + def test_int(self): + self.check_int_constructor(doint) + + def test_float(self): + pyfunc = dofloat + + x_types = [ + types.int32, types.int64, types.float32, types.float64 + ] + x_values = [1, 1000, 12.2, 23.4] + + for ty, x in zip(x_types, x_values): + cfunc = njit((ty,))(pyfunc) + self.assertPreciseEqual(pyfunc(x), cfunc(x), + prec='single' if ty is types.float32 else 'exact') + + def test_complex(self): + pyfunc = docomplex + + x_types = [ + types.int32, types.int64, types.float32, types.float64, + types.complex64, types.complex128, + ] + x_values = [1, 1000, 12.2, 23.4, 1.5-5j, 1-4.75j] + + for ty, x in zip(x_types, x_values): + cfunc = njit((ty,))(pyfunc) + got = cfunc(x) + expected = pyfunc(x) + self.assertPreciseEqual(pyfunc(x), cfunc(x), + prec='single' if ty is types.float32 else 'exact') + + # Check that complex(float32) really creates a complex64, + # by checking the accuracy of computations. + pyfunc = complex_calc + x = 1.0 + 2**-50 + cfunc = njit((types.float32,))(pyfunc) + self.assertPreciseEqual(cfunc(x), 1.0) + # Control (complex128) + cfunc = njit((types.float64,))(pyfunc) + self.assertGreater(cfunc(x), 1.0) + + def test_complex2(self): + pyfunc = docomplex2 + + x_types = [ + types.int32, types.int64, types.float32, types.float64 + ] + x_values = [1, 1000, 12.2, 23.4] + y_values = [x - 3 for x in x_values] + + for ty, x, y in zip(x_types, x_values, y_values): + cfunc = njit((ty, ty))(pyfunc) + self.assertPreciseEqual(pyfunc(x, y), cfunc(x, y), + prec='single' if ty is types.float32 else 'exact') + + # Check that complex(float32, float32) really creates a complex64, + # by checking the accuracy of computations. + pyfunc = complex_calc2 + x = 1.0 + 2**-50 + cfunc = njit((types.float32, types.float32))(pyfunc) + self.assertPreciseEqual(cfunc(x, x), 2.0) + # Control (complex128) + cfunc = njit((types.float64, types.float32))(pyfunc) + self.assertGreater(cfunc(x, x), 2.0) + + def check_type_converter(self, tp, np_type, values): + pyfunc = converter(tp) + cfunc = jit(nopython=True)(pyfunc) + if issubclass(np_type, np.integer): + # Converting from a Python int to a small Numpy int on 32-bit + # builds can raise "OverflowError: Python int too large to + # convert to C long". Work around by going through a large + # Numpy int first. + np_converter = lambda x: np_type(np.int64(x)) + else: + np_converter = np_type + dtype = np.dtype(np_type) + for val in values: + if dtype.kind == 'u' and isinstance(val, float) and val < 0.0: + # Converting negative float to unsigned int yields undefined + # behaviour (and concretely different on ARM vs. x86) + continue + expected = np_converter(val) + got = cfunc(val) + self.assertPreciseEqual(got, expected, + msg="for type %s with arg %s" % (np_type, val)) + + def check_number_types(self, tp_factory): + values = [0, 1, -1, 100003, 10000000000007, -100003, -10000000000007, + 1.5, -3.5] + for tp_name in real_np_types(): + np_type = getattr(np, tp_name) + tp = tp_factory(tp_name) + self.check_type_converter(tp, np_type, values) + values.append(1.5+3j) + for tp_name in complex_np_types(): + np_type = getattr(np, tp_name) + tp = tp_factory(tp_name) + self.check_type_converter(tp, np_type, values) + + def test_numba_types(self): + """ + Test explicit casting to Numba number types. + """ + def tp_factory(tp_name): + return getattr(types, tp_name) + self.check_number_types(tp_factory) + + def test_numpy_types(self): + """ + Test explicit casting to Numpy number types. + """ + def tp_factory(tp_name): + return getattr(np, tp_name) + self.check_number_types(tp_factory) + + +class TestArrayNumberCtor(TestCase): + """ + Test (some sequence) + """ + + def check_type_constructor(self, np_type, values): + pyfunc = converter(np_type) + cfunc = jit(nopython=True)(pyfunc) + for val in values: + expected = np_type(val) + got = cfunc(val) + self.assertPreciseEqual(got, expected) + + def test_1d(self): + values = [ + (1.0, 2.5), + (1, 2.5), + [1.0, 2.5], + (), + ] + for tp_name in real_np_types(): + np_type = getattr(np, tp_name) + self.check_type_constructor(np_type, values) + values = [ + (1j, 2.5), + [1.0, 2.5], + ] + for tp_name in complex_np_types(): + np_type = getattr(np, tp_name) + self.check_type_constructor(np_type, values) + + def test_2d(self): + values = [ + ((1.0, 2.5), (3.5, 4)), + [(1.0, 2.5), (3.5, 4.0)], + ([1.0, 2.5], [3.5, 4.0]), + [(), ()], + ] + for tp_name in real_np_types(): + np_type = getattr(np, tp_name) + self.check_type_constructor(np_type, values) + for tp_name in complex_np_types(): + np_type = getattr(np, tp_name) + self.check_type_constructor(np_type, values) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numbers.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numbers.py new file mode 100644 index 0000000000000000000000000000000000000000..1f7c6d4c6e23d8044c6e7374ad893f9896ba19bd --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numbers.py @@ -0,0 +1,90 @@ +# (Some) Tests for targets/numbers.py + +import numpy as np + +from numba import njit +from numba.core import types +from numba.core.errors import TypingError +from numba.tests.support import TestCase + + +def gen_view(a,b): + def impl(x): + return a(x).view(b) + return impl + + +class TestViewIntFloat(TestCase): + """ This tests the 'view' method on NumPy scalars. """ + + def do_testing(self, inputs, dtypes): + for value, initial_type, expected in inputs: + for target_type, result in zip(dtypes, expected): + view = njit(gen_view(initial_type, target_type)) + if not np.isnan(result): + # check against predefined value + self.assertEqual(view(value), target_type(result)) + # check against numpy + self.assertEqual(view(value), + view.py_func(value)) + else: + # check that our implementation results in nan + self.assertTrue(np.isnan(view(value))) + # check that numpy results in nan + self.assertTrue(np.isnan(view.py_func(value))) + + def test_8_bits(self): + dtypes = (np.uint8, np.int8) + # Value Initial Type Expected answers using dtypes + inputs = ((1, np.uint8, (1, 1)), + (-1, np.int8, (255, -1))) + self.do_testing(inputs, dtypes) + + def test_32_bits(self): + dtypes = (np.uint32, np.int32, np.float32) + # Value Initial Type Expected answers using dtypes + inputs = ((1, np.uint32, (1, 1, 1.401298464324817e-45)), + (-1, np.int32, (4294967295, -1, np.nan)), + (1.0, np.float32, (1065353216, 1065353216, 1.0))) + self.do_testing(inputs, dtypes) + + def test_64_bits(self): + dtypes = (np.uint64, np.int64, np.float64) + # Value Initial Type Expected answers using dtypes + inputs = ((1, np.uint64, (1, 1, 5e-324)), + (-1, np.int64, (18446744073709551615, -1, np.nan)), + (1.0, np.float64, (4607182418800017408, + 4607182418800017408, + 1.0)) + ) + self.do_testing(inputs, dtypes) + + def test_python_scalar_exception(self): + intty = getattr(np, 'int{}'.format(types.intp.bitwidth)) + + @njit + def myview(): + a = 1 + a.view(intty) + + with self.assertRaises(TypingError) as e: + myview() + self.assertIn("'view' can only be called on NumPy dtypes, " + "try wrapping the variable 'a' with 'np.()'", + str(e.exception)) + + def do_testing_exceptions(self, pair): + with self.assertRaises(TypingError) as e: + view = njit(gen_view(pair[0], pair[1])) + view(1) + self.assertIn("Changing the dtype of a 0d array is only supported " + "if the itemsize is unchanged", + str(e.exception)) + + def test_exceptions32(self): + for pair in ((np.int32, np.int8), (np.int8, np.int32)): + self.do_testing_exceptions(pair) + + def test_exceptions64(self): + for pair in ((np.int32, np.int64), (np.int64, np.int32)): + self.do_testing_exceptions(pair) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numconv.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numconv.py new file mode 100644 index 0000000000000000000000000000000000000000..16679e886ebb0bae0318c7f4853037fd0966536d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numconv.py @@ -0,0 +1,38 @@ +import itertools +import unittest +from numba import njit +from numba.core import types + + +def template(fromty, toty): + def closure(self): + def cast(x): + y = x + return y + + cfunc = njit(toty(fromty))(cast) + self.assertAlmostEqual(cfunc(1), 1) + + return closure + + +class TestNumberConversion(unittest.TestCase): + """ + Test all int/float numeric conversion to ensure we have all the external + dependencies to perform these conversions. + """ + # NOTE: more implicit tests are in test_numberctor + + @classmethod + def automatic_populate(cls): + tys = types.integer_domain | types.real_domain + for fromty, toty in itertools.permutations(tys, r=2): + test_name = "test_{fromty}_to_{toty}".format(fromty=fromty, + toty=toty) + setattr(cls, test_name, template(fromty, toty)) + + +TestNumberConversion.automatic_populate() + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numpy_support.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numpy_support.py new file mode 100644 index 0000000000000000000000000000000000000000..bf77dfbccfd81272a7bdbdd542058cca5e88659d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numpy_support.py @@ -0,0 +1,437 @@ +""" +Test helper functions from numba.numpy_support. +""" + + +import sys +from itertools import product + +import numpy as np + +import unittest +from numba.core import types +from numba.core.errors import NumbaNotImplementedError +from numba.tests.support import TestCase +from numba.tests.enum_usecases import Shake, RequestError +from numba.np import numpy_support + + +class TestFromDtype(TestCase): + + def test_number_types(self): + """ + Test from_dtype() and as_dtype() with the various scalar number types. + """ + f = numpy_support.from_dtype + + def check(typechar, numba_type): + # Only native ordering and alignment is supported + dtype = np.dtype(typechar) + self.assertIs(f(dtype), numba_type) + self.assertIs(f(np.dtype('=' + typechar)), numba_type) + self.assertEqual(dtype, numpy_support.as_dtype(numba_type)) + + check('?', types.bool_) + check('f', types.float32) + check('f4', types.float32) + check('d', types.float64) + check('f8', types.float64) + + check('F', types.complex64) + check('c8', types.complex64) + check('D', types.complex128) + check('c16', types.complex128) + + check('O', types.pyobject) + + check('b', types.int8) + check('i1', types.int8) + check('B', types.uint8) + check('u1', types.uint8) + + check('h', types.int16) + check('i2', types.int16) + check('H', types.uint16) + check('u2', types.uint16) + + check('i', types.int32) + check('i4', types.int32) + check('I', types.uint32) + check('u4', types.uint32) + + check('q', types.int64) + check('Q', types.uint64) + for name in ('int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', + 'int64', 'uint64', 'intp', 'uintp'): + self.assertIs(f(np.dtype(name)), getattr(types, name)) + + # Non-native alignments are unsupported (except for 1-byte types) + foreign_align = '>' if sys.byteorder == 'little' else '<' + for letter in 'hHiIlLqQfdFD': + self.assertRaises(NumbaNotImplementedError, f, + np.dtype(foreign_align + letter)) + + def test_string_types(self): + """ + Test from_dtype() and as_dtype() with the character string types. + """ + def check(typestring, numba_type): + # Only native ordering and alignment is supported + dtype = np.dtype(typestring) + self.assertEqual(numpy_support.from_dtype(dtype), numba_type) + self.assertEqual(dtype, numpy_support.as_dtype(numba_type)) + + check('S10', types.CharSeq(10)) + check('a11', types.CharSeq(11)) + check('U12', types.UnicodeCharSeq(12)) + + def check_datetime_types(self, letter, nb_class): + def check(dtype, numba_type, code): + tp = numpy_support.from_dtype(dtype) + self.assertEqual(tp, numba_type) + self.assertEqual(tp.unit_code, code) + self.assertEqual(numpy_support.as_dtype(numba_type), dtype) + self.assertEqual(numpy_support.as_dtype(tp), dtype) + + # Unit-less ("generic") type + check(np.dtype(letter), nb_class(''), 14) + + def test_datetime_types(self): + """ + Test from_dtype() and as_dtype() with the datetime types. + """ + self.check_datetime_types('M', types.NPDatetime) + + def test_timedelta_types(self): + """ + Test from_dtype() and as_dtype() with the timedelta types. + """ + self.check_datetime_types('m', types.NPTimedelta) + + def test_struct_types(self): + def check(dtype, fields, size, aligned): + tp = numpy_support.from_dtype(dtype) + self.assertIsInstance(tp, types.Record) + # Only check for dtype equality, as the Numba type may be interned + self.assertEqual(tp.dtype, dtype) + self.assertEqual(tp.fields, fields) + self.assertEqual(tp.size, size) + self.assertEqual(tp.aligned, aligned) + + dtype = np.dtype([('a', np.int16), ('b', np.int32)]) + check(dtype, + fields={'a': (types.int16, 0, None, None), + 'b': (types.int32, 2, None, None)}, + size=6, aligned=False) + + dtype = np.dtype([('a', np.int16), ('b', np.int32)], align=True) + check(dtype, + fields={'a': (types.int16, 0, None, None), + 'b': (types.int32, 4, None, None)}, + size=8, aligned=True) + + dtype = np.dtype([('m', np.int32), ('n', 'S5')]) + check(dtype, + fields={'m': (types.int32, 0, None, None), + 'n': (types.CharSeq(5), 4, None, None)}, + size=9, aligned=False) + + def test_enum_type(self): + + def check(base_inst, enum_def, type_class): + np_dt = np.dtype(base_inst) + nb_ty = numpy_support.from_dtype(np_dt) + inst = type_class(enum_def, nb_ty) + recovered = numpy_support.as_dtype(inst) + self.assertEqual(np_dt, recovered) + + dts = [np.float64, np.int32, np.complex128, np.bool_] + enums = [Shake, RequestError] + + for dt, enum in product(dts, enums): + check(dt, enum, types.EnumMember) + + for dt, enum in product(dts, enums): + check(dt, enum, types.IntEnumMember) + + +class ValueTypingTestBase(object): + """ + Common tests for the typing of values. Also used by test_special. + """ + + def check_number_values(self, func): + """ + Test *func*() with scalar numeric values. + """ + f = func + # Standard Python types get inferred by numpy + self.assertIn(f(1), (types.int32, types.int64)) + self.assertIn(f(2**31 - 1), (types.int32, types.int64)) + self.assertIn(f(-2**31), (types.int32, types.int64)) + self.assertIs(f(1.0), types.float64) + self.assertIs(f(1.0j), types.complex128) + self.assertIs(f(True), types.bool_) + self.assertIs(f(False), types.bool_) + # Numpy scalar types get converted by from_dtype() + for name in ('int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', + 'int64', 'uint64', 'intc', 'uintc', 'intp', 'uintp', + 'float32', 'float64', 'complex64', 'complex128', + 'bool_'): + val = getattr(np, name)() + self.assertIs(f(val), getattr(types, name)) + + def _base_check_datetime_values(self, func, np_type, nb_type): + f = func + for unit in [ + '', 'Y', 'M', 'D', 'h', 'm', 's', + 'ms', 'us', 'ns', 'ps', 'fs', 'as', + ]: + if unit: + t = np_type(3, unit) + else: + # "generic" datetime / timedelta + t = np_type('Nat') + tp = f(t) + # This ensures the unit hasn't been lost + self.assertEqual(tp, nb_type(unit)) + + def check_datetime_values(self, func): + """ + Test *func*() with np.datetime64 values. + """ + self._base_check_datetime_values(func, np.datetime64, types.NPDatetime) + + def check_timedelta_values(self, func): + """ + Test *func*() with np.timedelta64 values. + """ + self._base_check_datetime_values(func, np.timedelta64, + types.NPTimedelta) + + +class TestArrayScalars(ValueTypingTestBase, TestCase): + + def test_number_values(self): + """ + Test map_arrayscalar_type() with scalar number values. + """ + self.check_number_values(numpy_support.map_arrayscalar_type) + + def test_datetime_values(self): + """ + Test map_arrayscalar_type() with np.datetime64 values. + """ + f = numpy_support.map_arrayscalar_type + self.check_datetime_values(f) + # datetime64s with a non-one factor shouldn't be supported + t = np.datetime64('2014', '10Y') + with self.assertRaises(NumbaNotImplementedError): + f(t) + + def test_timedelta_values(self): + """ + Test map_arrayscalar_type() with np.timedelta64 values. + """ + f = numpy_support.map_arrayscalar_type + self.check_timedelta_values(f) + # timedelta64s with a non-one factor shouldn't be supported + t = np.timedelta64(10, '10Y') + with self.assertRaises(NumbaNotImplementedError): + f(t) + + +class FakeUFunc(object): + __slots__ = ('nin', 'nout', 'types', 'ntypes') + __name__ = "fake ufunc" + + def __init__(self, types): + self.types = types + in_, out = self.types[0].split('->') + self.nin = len(in_) + self.nout = len(out) + self.ntypes = len(types) + for tp in types: + in_, out = self.types[0].split('->') + assert len(in_) == self.nin + assert len(out) == self.nout + + +# Typical types for np.add, np.multiply, np.isnan +_add_types = ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', + 'll->l', 'LL->L', 'qq->q', 'QQ->Q', 'ee->e', 'ff->f', 'dd->d', + 'gg->g', 'FF->F', 'DD->D', 'GG->G', 'Mm->M', 'mm->m', 'mM->M', + 'OO->O'] + +_mul_types = ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', + 'll->l', 'LL->L', 'qq->q', 'QQ->Q', 'ee->e', 'ff->f', 'dd->d', + 'gg->g', 'FF->F', 'DD->D', 'GG->G', 'mq->m', 'qm->m', 'md->m', + 'dm->m', 'OO->O'] + +# Those ones only have floating-point loops +_isnan_types = ['e->?', 'f->?', 'd->?', 'g->?', 'F->?', 'D->?', 'G->?'] +_sqrt_types = ['e->e', 'f->f', 'd->d', 'g->g', 'F->F', 'D->D', 'G->G', 'O->O'] + + +class TestUFuncs(TestCase): + """ + Test ufunc helpers. + """ + + def test_ufunc_find_matching_loop(self): + f = numpy_support.ufunc_find_matching_loop + np_add = FakeUFunc(_add_types) + np_mul = FakeUFunc(_mul_types) + np_isnan = FakeUFunc(_isnan_types) + np_sqrt = FakeUFunc(_sqrt_types) + + def check(ufunc, input_types, sigs, output_types=()): + """ + Check that ufunc_find_matching_loop() finds one of the given + *sigs* for *ufunc*, *input_types* and optional *output_types*. + """ + loop = f(ufunc, input_types + output_types) + self.assertTrue(loop) + if isinstance(sigs, str): + sigs = (sigs,) + self.assertIn(loop.ufunc_sig, sigs, + "inputs=%s and outputs=%s should have selected " + "one of %s, got %s" + % (input_types, output_types, sigs, loop.ufunc_sig)) + self.assertEqual(len(loop.numpy_inputs), len(loop.inputs)) + self.assertEqual(len(loop.numpy_outputs), len(loop.outputs)) + if not output_types: + # Add explicit outputs and check the result is the same + loop_explicit = f(ufunc, list(input_types) + loop.outputs) + self.assertEqual(loop_explicit, loop) + else: + self.assertEqual(loop.outputs, list(output_types)) + # Round-tripping inputs and outputs + loop_rt = f(ufunc, loop.inputs + loop.outputs) + self.assertEqual(loop_rt, loop) + return loop + + def check_exact(ufunc, input_types, sigs, output_types=()): + """ + Like check(), but also ensure no casting of inputs occurred. + """ + loop = check(ufunc, input_types, sigs, output_types) + self.assertEqual(loop.inputs, list(input_types)) + + def check_no_match(ufunc, input_types): + loop = f(ufunc, input_types) + self.assertIs(loop, None) + + # Exact matching for number types + check_exact(np_add, (types.bool_, types.bool_), '??->?') + check_exact(np_add, (types.int8, types.int8), 'bb->b') + check_exact(np_add, (types.uint8, types.uint8), 'BB->B') + check_exact(np_add, (types.int64, types.int64), ('ll->l', 'qq->q')) + check_exact(np_add, (types.uint64, types.uint64), ('LL->L', 'QQ->Q')) + check_exact(np_add, (types.float32, types.float32), 'ff->f') + check_exact(np_add, (types.float64, types.float64), 'dd->d') + check_exact(np_add, (types.complex64, types.complex64), 'FF->F') + check_exact(np_add, (types.complex128, types.complex128), 'DD->D') + + # Exact matching for datetime64 and timedelta64 types + check_exact(np_add, (types.NPTimedelta('s'), types.NPTimedelta('s')), + 'mm->m', output_types=(types.NPTimedelta('s'),)) + check_exact(np_add, (types.NPTimedelta('ms'), types.NPDatetime('s')), + 'mM->M', output_types=(types.NPDatetime('ms'),)) + check_exact(np_add, (types.NPDatetime('s'), types.NPTimedelta('s')), + 'Mm->M', output_types=(types.NPDatetime('s'),)) + check_exact(np_add, (types.NPDatetime('s'), types.NPTimedelta('')), + 'Mm->M', output_types=(types.NPDatetime('s'),)) + check_exact(np_add, (types.NPDatetime('ns'), types.NPTimedelta('')), + 'Mm->M', output_types=(types.NPDatetime('ns'),)) + check_exact(np_add, (types.NPTimedelta(''), types.NPDatetime('s')), + 'mM->M', output_types=(types.NPDatetime('s'),)) + check_exact(np_add, (types.NPTimedelta(''), types.NPDatetime('ns')), + 'mM->M', output_types=(types.NPDatetime('ns'),)) + check_exact(np_mul, (types.NPTimedelta('s'), types.int64), + 'mq->m', output_types=(types.NPTimedelta('s'),)) + check_exact(np_mul, (types.float64, types.NPTimedelta('s')), + 'dm->m', output_types=(types.NPTimedelta('s'),)) + + # Mix and match number types, with casting + check(np_add, (types.bool_, types.int8), 'bb->b') + check(np_add, (types.uint8, types.bool_), 'BB->B') + check(np_add, (types.int16, types.uint16), 'ii->i') + check(np_add, (types.complex64, types.float64), 'DD->D') + check(np_add, (types.float64, types.complex64), 'DD->D') + # Integers, when used together with floating-point numbers, + # should cast to any real or complex (see #2006) + int_types = [types.int32, types.uint32, types.int64, types.uint64] + for intty in int_types: + check(np_add, (types.float32, intty), 'ff->f') + check(np_add, (types.float64, intty), 'dd->d') + check(np_add, (types.complex64, intty), 'FF->F') + check(np_add, (types.complex128, intty), 'DD->D') + # However, when used alone, they should cast only to + # floating-point types of sufficient precision + # (typical use case: np.sqrt(2) should give an accurate enough value) + for intty in int_types: + check(np_sqrt, (intty,), 'd->d') + check(np_isnan, (intty,), 'd->?') + + # With some timedelta64 arguments as well + check(np_mul, (types.NPTimedelta('s'), types.int32), + 'mq->m', output_types=(types.NPTimedelta('s'),)) + check(np_mul, (types.NPTimedelta('s'), types.uint32), + 'mq->m', output_types=(types.NPTimedelta('s'),)) + check(np_mul, (types.NPTimedelta('s'), types.float32), + 'md->m', output_types=(types.NPTimedelta('s'),)) + check(np_mul, (types.float32, types.NPTimedelta('s')), + 'dm->m', output_types=(types.NPTimedelta('s'),)) + + # No match + check_no_match(np_add, (types.NPDatetime('s'), types.NPDatetime('s'))) + # No implicit casting from int64 to timedelta64 (Numpy would allow + # this). + check_no_match(np_add, (types.NPTimedelta('s'), types.int64)) + + def test_layout_checker(self): + def check_arr(arr): + dims = arr.shape + strides = arr.strides + itemsize = arr.dtype.itemsize + is_c = numpy_support.is_contiguous(dims, strides, itemsize) + is_f = numpy_support.is_fortran(dims, strides, itemsize) + expect_c = arr.flags['C_CONTIGUOUS'] + expect_f = arr.flags['F_CONTIGUOUS'] + self.assertEqual(is_c, expect_c) + self.assertEqual(is_f, expect_f) + + arr = np.arange(24) + # 1D + check_arr(arr) + # 2D + check_arr(arr.reshape((3, 8))) + check_arr(arr.reshape((3, 8)).T) + check_arr(arr.reshape((3, 8))[::2]) + # 3D + check_arr(arr.reshape((2, 3, 4))) + check_arr(arr.reshape((2, 3, 4)).T) + # middle axis is shape 1 + check_arr(arr.reshape((2, 3, 4))[:, ::3]) + check_arr(arr.reshape((2, 3, 4)).T[:, ::3]) + + # leading axis is shape 1 + check_arr(arr.reshape((2, 3, 4))[::2]) + check_arr(arr.reshape((2, 3, 4)).T[:, :, ::2]) + # 2 leading axis are shape 1 + check_arr(arr.reshape((2, 3, 4))[::2, ::3]) + check_arr(arr.reshape((2, 3, 4)).T[:, ::3, ::2]) + # single item slices for all axis + check_arr(arr.reshape((2, 3, 4))[::2, ::3, ::4]) + check_arr(arr.reshape((2, 3, 4)).T[::4, ::3, ::2]) + # 4D + check_arr(arr.reshape((2, 2, 3, 2))[::2, ::2, ::3]) + check_arr(arr.reshape((2, 2, 3, 2)).T[:, ::3, ::2, ::2]) + # outer zero dims + check_arr(arr.reshape((2, 2, 3, 2))[::5, ::2, ::3]) + check_arr(arr.reshape((2, 2, 3, 2)).T[:, ::3, ::2, ::5]) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numpyadapt.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numpyadapt.py new file mode 100644 index 0000000000000000000000000000000000000000..8df1f028813cee233e67c610e7feddcc8bc14ce2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_numpyadapt.py @@ -0,0 +1,43 @@ +from ctypes import * + +import numpy as np + +import unittest +from numba import _helperlib + + +class ArrayStruct3D(Structure): + # Mimic the structure defined in numba.targets.arrayobj's make_array() + _fields_ = [ + ("meminfo", c_void_p), + ("parent", c_void_p), + ("nitems", c_ssize_t), + ("itemsize", c_ssize_t), + ("data", c_void_p), + ("shape", (c_ssize_t * 3)), + ("strides", (c_ssize_t * 3)), + ] + + +class TestArrayAdaptor(unittest.TestCase): + def test_array_adaptor(self): + arystruct = ArrayStruct3D() + + adaptorptr = _helperlib.c_helpers['adapt_ndarray'] + adaptor = PYFUNCTYPE(c_int, py_object, c_void_p)(adaptorptr) + + ary = np.arange(60).reshape(2, 3, 10) + status = adaptor(ary, byref(arystruct)) + self.assertEqual(status, 0) + self.assertEqual(arystruct.data, ary.ctypes.data) + self.assertNotEqual(arystruct.meminfo, 0) + self.assertEqual(arystruct.parent, id(ary)) + self.assertEqual(arystruct.nitems, 60) + self.assertEqual(arystruct.itemsize, ary.itemsize) + for i in range(3): + self.assertEqual(arystruct.shape[i], ary.ctypes.shape[i]) + self.assertEqual(arystruct.strides[i], ary.ctypes.strides[i]) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_obj_lifetime.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_obj_lifetime.py new file mode 100644 index 0000000000000000000000000000000000000000..4c46559fa81ba38bbd9e04fba727be4c2b647f82 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_obj_lifetime.py @@ -0,0 +1,494 @@ +import collections +import weakref +import gc +import operator +from itertools import takewhile + +import unittest +from numba import njit, jit +from numba.core.compiler import CompilerBase, DefaultPassBuilder +from numba.core.untyped_passes import PreserveIR +from numba.core.typed_passes import IRLegalization +from numba.core import types, ir +from numba.tests.support import TestCase, override_config, SerialMixin + + +class _Dummy(object): + + def __init__(self, recorder, name): + self.recorder = recorder + self.name = name + recorder._add_dummy(self) + + def __add__(self, other): + assert isinstance(other, _Dummy) + return _Dummy(self.recorder, "%s + %s" % (self.name, other.name)) + + def __iter__(self): + return _DummyIterator(self.recorder, "iter(%s)" % self.name) + + +class _DummyIterator(_Dummy): + + count = 0 + + def __next__(self): + if self.count >= 3: + raise StopIteration + self.count += 1 + return _Dummy(self.recorder, "%s#%s" % (self.name, self.count)) + + next = __next__ + + +class RefRecorder(object): + """ + An object which records events when instances created through it + are deleted. Custom events can also be recorded to aid in + diagnosis. + """ + + def __init__(self): + self._counts = collections.defaultdict(int) + self._events = [] + self._wrs = {} + + def make_dummy(self, name): + """ + Make an object whose deletion will be recorded as *name*. + """ + return _Dummy(self, name) + + def _add_dummy(self, dummy): + wr = weakref.ref(dummy, self._on_disposal) + self._wrs[wr] = dummy.name + + __call__ = make_dummy + + def mark(self, event): + """ + Manually append *event* to the recorded events. + *event* can be formatted using format(). + """ + count = self._counts[event] + 1 + self._counts[event] = count + self._events.append(event.format(count=count)) + + def _on_disposal(self, wr): + name = self._wrs.pop(wr) + self._events.append(name) + + @property + def alive(self): + """ + A list of objects which haven't been deleted yet. + """ + return [wr() for wr in self._wrs] + + @property + def recorded(self): + """ + A list of recorded events. + """ + return self._events + + +def simple_usecase1(rec): + a = rec('a') + b = rec('b') + c = rec('c') + a = b + c + rec.mark('--1--') + d = a + a # b + c + b + c + rec.mark('--2--') + return d + +def simple_usecase2(rec): + a = rec('a') + b = rec('b') + rec.mark('--1--') + x = a + y = x + a = None + return y + +def looping_usecase1(rec): + a = rec('a') + b = rec('b') + c = rec('c') + x = b + for y in a: + x = x + y + rec.mark('--loop bottom--') + rec.mark('--loop exit--') + x = x + c + return x + +def looping_usecase2(rec): + a = rec('a') + b = rec('b') + cum = rec('cum') + for x in a: + rec.mark('--outer loop top--') + cum = cum + x + z = x + x + rec.mark('--inner loop entry #{count}--') + for y in b: + rec.mark('--inner loop top #{count}--') + cum = cum + y + rec.mark('--inner loop bottom #{count}--') + rec.mark('--inner loop exit #{count}--') + if cum: + cum = y + z + else: + # Never gets here, but let the Numba compiler see a `break` opcode + break + rec.mark('--outer loop bottom #{count}--') + else: + rec.mark('--outer loop else--') + rec.mark('--outer loop exit--') + return cum + +def generator_usecase1(rec): + a = rec('a') + b = rec('b') + yield a + yield b + +def generator_usecase2(rec): + a = rec('a') + b = rec('b') + for x in a: + yield x + yield b + + +class MyError(RuntimeError): + pass + +def do_raise(x): + raise MyError(x) + +def raising_usecase1(rec): + a = rec('a') + b = rec('b') + d = rec('d') + if a: + do_raise("foo") + c = rec('c') + c + a + c + b + +def raising_usecase2(rec): + a = rec('a') + b = rec('b') + if a: + c = rec('c') + do_raise(b) + a + c + +def raising_usecase3(rec): + a = rec('a') + b = rec('b') + if a: + raise MyError(b) + + +def del_before_definition(rec): + """ + This test reveal a bug that there is a del on uninitialized variable + """ + n = 5 + for i in range(n): + rec.mark(str(i)) + n = 0 + for j in range(n): + return 0 + else: + if i < 2: + continue + elif i == 2: + for j in range(i): + return i + rec.mark('FAILED') + rec.mark('FAILED') + rec.mark('FAILED') + rec.mark('OK') + return -1 + + +def inf_loop_multiple_back_edge(rec): + """ + test to reveal bug of invalid liveness when infinite loop has multiple + backedge. + """ + while True: + rec.mark("yield") + yield + p = rec('p') + if p: + rec.mark('bra') + pass + + +class TestObjLifetime(TestCase): + """ + Test lifetime of Python objects inside jit-compiled functions. + """ + + def compile(self, pyfunc): + # Note: looplift must be disabled. The test require the function + # control-flow to be unchanged. + cfunc = jit((types.pyobject,), forceobj=True, looplift=False)(pyfunc) + return cfunc + + def compile_and_record(self, pyfunc, raises=None): + rec = RefRecorder() + cfunc = self.compile(pyfunc) + if raises is not None: + with self.assertRaises(raises): + cfunc(rec) + else: + cfunc(rec) + return rec + + def assertRecordOrder(self, rec, expected): + """ + Check that the *expected* markers occur in that order in *rec*'s + recorded events. + """ + actual = [] + recorded = rec.recorded + remaining = list(expected) + # Find out in which order, if any, the expected events were recorded + for d in recorded: + if d in remaining: + actual.append(d) + # User may or may not expect duplicates, handle them properly + remaining.remove(d) + self.assertEqual(actual, expected, + "the full list of recorded events is: %r" % (recorded,)) + + def test_simple1(self): + rec = self.compile_and_record(simple_usecase1) + self.assertFalse(rec.alive) + self.assertRecordOrder(rec, ['a', 'b', '--1--']) + self.assertRecordOrder(rec, ['a', 'c', '--1--']) + self.assertRecordOrder(rec, ['--1--', 'b + c', '--2--']) + + def test_simple2(self): + rec = self.compile_and_record(simple_usecase2) + self.assertFalse(rec.alive) + self.assertRecordOrder(rec, ['b', '--1--', 'a']) + + def test_looping1(self): + rec = self.compile_and_record(looping_usecase1) + self.assertFalse(rec.alive) + # a and b are unneeded after the loop, check they were disposed of + self.assertRecordOrder(rec, ['a', 'b', '--loop exit--', 'c']) + # check disposal order of iterator items and iterator + self.assertRecordOrder(rec, ['iter(a)#1', '--loop bottom--', + 'iter(a)#2', '--loop bottom--', + 'iter(a)#3', '--loop bottom--', + 'iter(a)', '--loop exit--', + ]) + + def test_looping2(self): + rec = self.compile_and_record(looping_usecase2) + self.assertFalse(rec.alive) + # `a` is disposed of after its iterator is taken + self.assertRecordOrder(rec, ['a', '--outer loop top--']) + # Check disposal of iterators + self.assertRecordOrder(rec, ['iter(a)', '--outer loop else--', + '--outer loop exit--']) + self.assertRecordOrder(rec, ['iter(b)', '--inner loop exit #1--', + 'iter(b)', '--inner loop exit #2--', + 'iter(b)', '--inner loop exit #3--', + ]) + # Disposal of in-loop variable `x` + self.assertRecordOrder(rec, ['iter(a)#1', '--inner loop entry #1--', + 'iter(a)#2', '--inner loop entry #2--', + 'iter(a)#3', '--inner loop entry #3--', + ]) + # Disposal of in-loop variable `z` + self.assertRecordOrder(rec, ['iter(a)#1 + iter(a)#1', + '--outer loop bottom #1--', + ]) + + def exercise_generator(self, genfunc): + cfunc = self.compile(genfunc) + # Exhaust the generator + rec = RefRecorder() + with self.assertRefCount(rec): + gen = cfunc(rec) + next(gen) + self.assertTrue(rec.alive) + list(gen) + self.assertFalse(rec.alive) + # Instantiate the generator but never iterate + rec = RefRecorder() + with self.assertRefCount(rec): + gen = cfunc(rec) + del gen + gc.collect() + self.assertFalse(rec.alive) + # Stop iterating before exhaustion + rec = RefRecorder() + with self.assertRefCount(rec): + gen = cfunc(rec) + next(gen) + self.assertTrue(rec.alive) + del gen + gc.collect() + self.assertFalse(rec.alive) + + def test_generator1(self): + self.exercise_generator(generator_usecase1) + + def test_generator2(self): + self.exercise_generator(generator_usecase2) + + def test_del_before_definition(self): + rec = self.compile_and_record(del_before_definition) + self.assertEqual(rec.recorded, ['0', '1', '2']) + + def test_raising1(self): + with self.assertRefCount(do_raise): + rec = self.compile_and_record(raising_usecase1, raises=MyError) + self.assertFalse(rec.alive) + + def test_raising2(self): + with self.assertRefCount(do_raise): + rec = self.compile_and_record(raising_usecase2, raises=MyError) + self.assertFalse(rec.alive) + + def test_raising3(self): + with self.assertRefCount(MyError): + rec = self.compile_and_record(raising_usecase3, raises=MyError) + self.assertFalse(rec.alive) + + def test_inf_loop_multiple_back_edge(self): + cfunc = self.compile(inf_loop_multiple_back_edge) + rec = RefRecorder() + iterator = iter(cfunc(rec)) + next(iterator) + self.assertEqual(rec.alive, []) + next(iterator) + self.assertEqual(rec.alive, []) + next(iterator) + self.assertEqual(rec.alive, []) + self.assertEqual(rec.recorded, + ['yield', 'p', 'bra', 'yield', 'p', 'bra', 'yield']) + + +class TestExtendingVariableLifetimes(SerialMixin, TestCase): + # Test for `numba.config.EXTEND_VARIABLE_LIFETIMES` which moves the ir.Del + # nodes to just before a block's terminator, i.e. their lifetime is extended + # beyond the point of last use. + + def test_lifetime_basic(self): + + def get_ir(extend_lifetimes): + class IRPreservingCompiler(CompilerBase): + + def define_pipelines(self): + pm = DefaultPassBuilder.define_nopython_pipeline(self.state) + pm.add_pass_after(PreserveIR, IRLegalization) + pm.finalize() + return [pm] + + @njit(pipeline_class=IRPreservingCompiler) + def foo(): + a = 10 + b = 20 + c = a + b + # a and b are now unused, standard behaviour is ir.Del for them here + d = c / c + return d + + with override_config('EXTEND_VARIABLE_LIFETIMES', extend_lifetimes): + foo() + cres = foo.overloads[foo.signatures[0]] + func_ir = cres.metadata['preserved_ir'] + + return func_ir + + + def check(func_ir, expect): + # assert single block + self.assertEqual(len(func_ir.blocks), 1) + blk = next(iter(func_ir.blocks.values())) + + # check sequencing + for expect_class, got_stmt in zip(expect, blk.body): + self.assertIsInstance(got_stmt, expect_class) + + del_after_use_ir = get_ir(False) + # should be 3 assigns (a, b, c), 2 del (a, b), assign (d), del (c) + # assign for cast d to return, del (d), return + expect = [*((ir.Assign,) * 3), ir.Del, ir.Del, ir.Assign, ir.Del, + ir.Assign, ir.Del, ir.Return] + check(del_after_use_ir, expect) + + del_at_block_end_ir = get_ir(True) + # should be 4 assigns (a, b, c, d), assign for cast d to return, + # 4 dels (a, b, c, d) then the return. + expect = [*((ir.Assign,) * 4), ir.Assign, *((ir.Del,) * 4), ir.Return] + check(del_at_block_end_ir, expect) + + def test_dbg_extend_lifetimes(self): + + def get_ir(**options): + class IRPreservingCompiler(CompilerBase): + + def define_pipelines(self): + pm = DefaultPassBuilder.define_nopython_pipeline(self.state) + pm.add_pass_after(PreserveIR, IRLegalization) + pm.finalize() + return [pm] + + @njit(pipeline_class=IRPreservingCompiler, **options) + def foo(): + a = 10 + b = 20 + c = a + b + # a and b are now unused, standard behaviour is ir.Del for them here + d = c / c + return d + + foo() + cres = foo.overloads[foo.signatures[0]] + func_ir = cres.metadata['preserved_ir'] + + return func_ir + + # _dbg_extend_lifetimes is on when debug=True + ir_debug = get_ir(debug=True) + # explicitly turn on _dbg_extend_lifetimes + ir_debug_ext = get_ir(debug=True, _dbg_extend_lifetimes=True) + # explicitly turn off _dbg_extend_lifetimes + ir_debug_no_ext = get_ir(debug=True, _dbg_extend_lifetimes=False) + + def is_del_grouped_at_the_end(fir): + [blk] = fir.blocks.values() + # Mark all statements that are ir.Del + inst_is_del = [isinstance(stmt, ir.Del) for stmt in blk.body] + # Get the leading segment that are not dels + not_dels = list(takewhile(operator.not_, inst_is_del)) + # Compute the starting position of the dels + begin = len(not_dels) + # Get the remaining segment that are all dels + all_dels = list(takewhile(operator.truth, inst_is_del[begin:])) + # Compute the ending position of the dels + end = begin + len(all_dels) + # If the dels are all grouped at the end (before the terminator), + # the end position will be the last position of the list + return end == len(inst_is_del) - 1 + + self.assertTrue(is_del_grouped_at_the_end(ir_debug)) + self.assertTrue(is_del_grouped_at_the_end(ir_debug_ext)) + self.assertFalse(is_del_grouped_at_the_end(ir_debug_no_ext)) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_object_mode.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_object_mode.py new file mode 100644 index 0000000000000000000000000000000000000000..63c4d877381462387a20d5014228820f5ec2e999 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_object_mode.py @@ -0,0 +1,204 @@ +""" +Testing object mode specifics. + +""" + +import numpy as np + +import unittest +from numba import jit, types +from numba.core import utils +from numba.tests.support import TestCase + + +def complex_constant(n): + tmp = n + 4 + return tmp + 3j + + +def long_constant(n): + return n + 100000000000000000000000000000000000000000000000 + + +def delitem_usecase(x): + del x[:] + + +def loop_nest_3(x, y): + n = 0 + for i in range(x): + for j in range(y): + for k in range(x + y): + n += i * j + + return n + + +def array_of_object(x): + return x + + +class TestObjectMode(TestCase): + + def test_complex_constant(self): + pyfunc = complex_constant + cfunc = jit((), forceobj=True)(pyfunc) + self.assertPreciseEqual(pyfunc(12), cfunc(12)) + + def test_long_constant(self): + pyfunc = long_constant + cfunc = jit((), forceobj=True)(pyfunc) + self.assertPreciseEqual(pyfunc(12), cfunc(12)) + + def test_loop_nest(self): + """ + Test bug that decref the iterator early. + If the bug occurs, a segfault should occur + """ + pyfunc = loop_nest_3 + cfunc = jit((), forceobj=True)(pyfunc) + self.assertEqual(pyfunc(5, 5), cfunc(5, 5)) + + def bm_pyfunc(): + pyfunc(5, 5) + + def bm_cfunc(): + cfunc(5, 5) + + utils.benchmark(bm_pyfunc) + utils.benchmark(bm_cfunc) + + def test_array_of_object(self): + cfunc = jit(forceobj=True)(array_of_object) + objarr = np.array([object()] * 10) + self.assertIs(cfunc(objarr), objarr) + + def test_sequence_contains(self): + """ + Test handling of the `in` comparison + """ + @jit(forceobj=True) + def foo(x, y): + return x in y + + self.assertTrue(foo(1, [0, 1])) + self.assertTrue(foo(0, [0, 1])) + self.assertFalse(foo(2, [0, 1])) + + with self.assertRaises(TypeError) as raises: + foo(None, None) + + self.assertIn("is not iterable", str(raises.exception)) + + def test_delitem(self): + pyfunc = delitem_usecase + cfunc = jit((), forceobj=True)(pyfunc) + + l = [3, 4, 5] + cfunc(l) + self.assertPreciseEqual(l, []) + with self.assertRaises(TypeError): + cfunc(42) + + def test_starargs_non_tuple(self): + def consumer(*x): + return x + + @jit(forceobj=True) + def foo(x): + return consumer(*x) + + arg = "ijo" + got = foo(arg) + expect = foo.py_func(arg) + self.assertEqual(got, tuple(arg)) + self.assertEqual(got, expect) + + def test_expr_undef(self): + @jit(forceobj=True) + def foo(): + # In Py3.12, this will emit a Expr.undef. + return [x for x in (1, 2)] + + self.assertEqual(foo(), foo.py_func()) + + +class TestObjectModeInvalidRewrite(TestCase): + """ + Tests to ensure that rewrite passes didn't affect objmode lowering. + """ + + def _ensure_objmode(self, disp): + self.assertTrue(disp.signatures) + self.assertFalse(disp.nopython_signatures) + return disp + + def test_static_raise_in_objmode_fallback(self): + """ + Test code based on user submitted issue at + https://github.com/numba/numba/issues/2159 + """ + def test0(n): + return n + + def test1(n): + if n == 0: + # static raise will fail in objmode if the IR is modified by + # rewrite pass + raise ValueError() + return test0(n) # trigger objmode fallback + + compiled = jit(forceobj=True)(test1) + self.assertEqual(test1(10), compiled(10)) + self._ensure_objmode(compiled) + + def test_static_setitem_in_objmode_fallback(self): + """ + Test code based on user submitted issue at + https://github.com/numba/numba/issues/2169 + """ + + def test0(n): + return n + + def test(a1, a2): + a1 = np.asarray(a1) + # static setitem here will fail in objmode if the IR is modified by + # rewrite pass + a2[0] = 1 + return test0(a1.sum() + a2.sum()) # trigger objmode fallback + + compiled = jit(forceobj=True)(test) + args = np.array([3]), np.array([4]) + self.assertEqual(test(*args), compiled(*args)) + self._ensure_objmode(compiled) + + def test_dynamic_func_objmode(self): + """ + Test issue https://github.com/numba/numba/issues/3355 + """ + func_text = "def func():\n" + func_text += " np.array([1,2,3])\n" + loc_vars = {} + custom_globals = {'np': np} + exec(func_text, custom_globals, loc_vars) + func = loc_vars['func'] + jitted = jit(forceobj=True)(func) + jitted() + + def test_issue_9725_label_renaming(self): + # Test issue https://github.com/numba/numba/issues/9725 + # this should compile via fallback + @jit(forceobj=True) + def f(): + for _ in (): # cannot lift this loop as a nopython loop + [0 for k in (None,)] + f() + self._ensure_objmode(f) + lifted = f.overloads[f.signatures[0]].lifted[0] + self.assertFalse(lifted.nopython_signatures) + self.assertEqual(lifted.signatures, [(types.Tuple(()),)]) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_objects.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_objects.py new file mode 100644 index 0000000000000000000000000000000000000000..a47f9ca00877ec2dcfc203e7df25b4ddd5da3003 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_objects.py @@ -0,0 +1,57 @@ +""" +Test generic manipulation of objects. +""" + + +import unittest +from numba import jit +from numba.core import types +from numba.tests.support import TestCase + + +class C(object): + pass + + +def setattr_usecase(o, v): + o.x = v + + +def delattr_usecase(o): + del o.x + + +class TestAttributes(TestCase): + def test_setattr(self): + pyfunc = setattr_usecase + cfunc = jit((types.pyobject, types.int32), forceobj=True)(pyfunc) + c = C() + cfunc(c, 123) + self.assertEqual(c.x, 123) + + def test_setattr_attribute_error(self): + pyfunc = setattr_usecase + cfunc = jit((types.pyobject, types.int32), forceobj=True)(pyfunc) + # Can't set undeclared slot + with self.assertRaises(AttributeError): + cfunc(object(), 123) + + def test_delattr(self): + pyfunc = delattr_usecase + cfunc = jit((types.pyobject,), forceobj=True)(pyfunc) + c = C() + c.x = 123 + cfunc(c) + with self.assertRaises(AttributeError): + c.x + + def test_delattr_attribute_error(self): + pyfunc = delattr_usecase + cfunc = jit((types.pyobject,), forceobj=True)(pyfunc) + # Can't delete non-existing attribute + with self.assertRaises(AttributeError): + cfunc(C()) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_operators.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_operators.py new file mode 100644 index 0000000000000000000000000000000000000000..17f6c4915263519754edc20b22f0357f56b43bc8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_operators.py @@ -0,0 +1,1622 @@ +import copy +import itertools +import operator +import unittest + +import numpy as np + +from numba import jit, njit +from numba.core import types, utils, errors +from numba.core.types.functions import _header_lead +from numba.tests.support import TestCase, tag, needs_blas +from numba.tests.matmul_usecase import (matmul_usecase, imatmul_usecase, + DumbMatrix,) + +Noflags = {'nopython': True} + +force_pyobj_flags = {'forceobj': True} + + +def make_static_power(exp): + def pow_usecase(x): + return x ** exp + return pow_usecase + + +class LiteralOperatorImpl(object): + + @staticmethod + def add_usecase(x, y): + return x + y + + @staticmethod + def iadd_usecase(x, y): + x += y + return x + + @staticmethod + def sub_usecase(x, y): + return x - y + + @staticmethod + def isub_usecase(x, y): + x -= y + return x + + @staticmethod + def mul_usecase(x, y): + return x * y + + @staticmethod + def imul_usecase(x, y): + x *= y + return x + + @staticmethod + def floordiv_usecase(x, y): + return x // y + + @staticmethod + def ifloordiv_usecase(x, y): + x //= y + return x + + @staticmethod + def truediv_usecase(x, y): + return x / y + + @staticmethod + def itruediv_usecase(x, y): + x /= y + return x + + if matmul_usecase: + matmul_usecase = staticmethod(matmul_usecase) + imatmul_usecase = staticmethod(imatmul_usecase) + + @staticmethod + def mod_usecase(x, y): + return x % y + + @staticmethod + def imod_usecase(x, y): + x %= y + return x + + @staticmethod + def pow_usecase(x, y): + return x ** y + + @staticmethod + def ipow_usecase(x, y): + x **= y + return x + + @staticmethod + def bitshift_left_usecase(x, y): + return x << y + + @staticmethod + def bitshift_ileft_usecase(x, y): + x <<= y + return x + + @staticmethod + def bitshift_right_usecase(x, y): + return x >> y + + @staticmethod + def bitshift_iright_usecase(x, y): + x >>= y + return x + + @staticmethod + def bitwise_and_usecase(x, y): + return x & y + + @staticmethod + def bitwise_iand_usecase(x, y): + x &= y + return x + + @staticmethod + def bitwise_or_usecase(x, y): + return x | y + + @staticmethod + def bitwise_ior_usecase(x, y): + x |= y + return x + + @staticmethod + def bitwise_xor_usecase(x, y): + return x ^ y + + @staticmethod + def bitwise_ixor_usecase(x, y): + x ^= y + return x + + @staticmethod + def bitwise_not_usecase_binary(x, _unused): + return ~x + + @staticmethod + def bitwise_not_usecase(x): + return ~x + + @staticmethod + def not_usecase(x): + return not(x) + + @staticmethod + def negate_usecase(x): + return -x + + @staticmethod + def unary_positive_usecase(x): + return +x + + @staticmethod + def lt_usecase(x, y): + return x < y + + @staticmethod + def le_usecase(x, y): + return x <= y + + @staticmethod + def gt_usecase(x, y): + return x > y + + @staticmethod + def ge_usecase(x, y): + return x >= y + + @staticmethod + def eq_usecase(x, y): + return x == y + + @staticmethod + def ne_usecase(x, y): + return x != y + + @staticmethod + def in_usecase(x, y): + return x in y + + @staticmethod + def not_in_usecase(x, y): + return x not in y + + @staticmethod + def is_usecase(x, y): + return x is y + + +class FunctionalOperatorImpl(object): + + @staticmethod + def add_usecase(x, y): + return operator.add(x, y) + + @staticmethod + def iadd_usecase(x, y): + return operator.iadd(x, y) + + @staticmethod + def sub_usecase(x, y): + return operator.sub(x, y) + + @staticmethod + def isub_usecase(x, y): + return operator.isub(x, y) + + @staticmethod + def mul_usecase(x, y): + return operator.mul(x, y) + + @staticmethod + def imul_usecase(x, y): + return operator.imul(x, y) + + @staticmethod + def floordiv_usecase(x, y): + return operator.floordiv(x, y) + + @staticmethod + def ifloordiv_usecase(x, y): + return operator.ifloordiv(x, y) + + @staticmethod + def truediv_usecase(x, y): + return operator.truediv(x, y) + + @staticmethod + def itruediv_usecase(x, y): + return operator.itruediv(x, y) + + @staticmethod + def mod_usecase(x, y): + return operator.mod(x, y) + + @staticmethod + def imod_usecase(x, y): + return operator.imod(x, y) + + @staticmethod + def pow_usecase(x, y): + return operator.pow(x, y) + + @staticmethod + def ipow_usecase(x, y): + return operator.ipow(x, y) + + @staticmethod + def matmul_usecase(x, y): + return operator.matmul(x, y) + + @staticmethod + def imatmul_usecase(x, y): + return operator.imatmul(x, y) + + @staticmethod + def bitshift_left_usecase(x, y): + return operator.lshift(x, y) + + @staticmethod + def bitshift_ileft_usecase(x, y): + return operator.ilshift(x, y) + + @staticmethod + def bitshift_right_usecase(x, y): + return operator.rshift(x, y) + + @staticmethod + def bitshift_iright_usecase(x, y): + return operator.irshift(x, y) + + @staticmethod + def bitwise_and_usecase(x, y): + return operator.and_(x, y) + + @staticmethod + def bitwise_iand_usecase(x, y): + return operator.iand(x, y) + + @staticmethod + def bitwise_or_usecase(x, y): + return operator.or_(x, y) + + @staticmethod + def bitwise_ior_usecase(x, y): + return operator.ior(x, y) + + @staticmethod + def bitwise_xor_usecase(x, y): + return operator.xor(x, y) + + @staticmethod + def bitwise_ixor_usecase(x, y): + return operator.ixor(x, y) + + @staticmethod + def bitwise_not_usecase_binary(x, _unused): + return operator.invert(x) + + @staticmethod + def bitwise_not_usecase(x): + return operator.invert(x) + + @staticmethod + def not_usecase(x): + return operator.not_(x) + + @staticmethod + def negate_usecase(x): + return operator.neg(x) + + @staticmethod + def unary_positive_usecase(x): + return operator.pos(x) + + @staticmethod + def lt_usecase(x, y): + return operator.lt(x, y) + + @staticmethod + def le_usecase(x, y): + return operator.le(x, y) + + @staticmethod + def gt_usecase(x, y): + return operator.gt(x, y) + + @staticmethod + def ge_usecase(x, y): + return operator.ge(x, y) + + @staticmethod + def eq_usecase(x, y): + return operator.eq(x, y) + + @staticmethod + def ne_usecase(x, y): + return operator.ne(x, y) + + @staticmethod + def in_usecase(x, y): + return operator.contains(y, x) + + @staticmethod + def not_in_usecase(x, y): + return not operator.contains(y, x) + + @staticmethod + def is_usecase(x, y): + return operator.is_(x, y) + + +class TestOperators(TestCase): + """ + Test standard Python operators on scalars. + + NOTE: operators on array are generally tested in test_ufuncs. + """ + + op = LiteralOperatorImpl + + _bitwise_opnames = { + 'bitshift_left_usecase': operator.lshift, + 'bitshift_ileft_usecase': operator.ilshift, + 'bitshift_right_usecase': operator.rshift, + 'bitshift_iright_usecase': operator.irshift, + 'bitwise_and_usecase': operator.and_, + 'bitwise_iand_usecase': operator.iand, + 'bitwise_or_usecase': operator.or_, + 'bitwise_ior_usecase': operator.ior, + 'bitwise_xor_usecase': operator.xor, + 'bitwise_ixor_usecase': operator.ixor, + 'bitwise_not_usecase_binary': operator.invert, + } + + def run_test_ints(self, pyfunc, x_operands, y_operands, types_list, + flags=force_pyobj_flags): + for arg_types in types_list: + cfunc = jit(arg_types, **flags)(pyfunc) + for x, y in itertools.product(x_operands, y_operands): + # For inplace ops, we check that the first operand + # was correctly mutated. + x_got = copy.copy(x) + x_expected = copy.copy(x) + got = cfunc(x_got, y) + expected = pyfunc(x_expected, y) + self.assertPreciseEqual( + got, expected, + msg="mismatch for (%r, %r) with types %s: %r != %r" + % (x, y, arg_types, got, expected)) + self.assertPreciseEqual( + x_got, x_expected, + msg="mismatch for (%r, %r) with types %s: %r != %r" + % (x, y, arg_types, x_got, x_expected)) + + def run_test_floats(self, pyfunc, x_operands, y_operands, types_list, + flags=force_pyobj_flags): + for arg_types in types_list: + cfunc = jit(arg_types, **flags)(pyfunc) + for x, y in itertools.product(x_operands, y_operands): + # For inplace ops, we check that the first operand + # was correctly mutated. + x_got = copy.copy(x) + x_expected = copy.copy(x) + got = cfunc(x_got, y) + expected = pyfunc(x_expected, y) + np.testing.assert_allclose(got, expected, rtol=1e-5) + np.testing.assert_allclose(x_got, x_expected, rtol=1e-5) + + def coerce_operand(self, op, numba_type): + if hasattr(op, "dtype"): + return numba_type.cast_python_value(op) + elif numba_type in types.unsigned_domain: + return abs(int(op.real)) + elif numba_type in types.integer_domain: + return int(op.real) + elif numba_type in types.real_domain: + return float(op.real) + else: + return op + + def run_test_scalar_compare(self, pyfunc, flags=force_pyobj_flags, + ordered=True): + ops = self.compare_scalar_operands + types_list = self.compare_types + if not ordered: + types_list = types_list + self.compare_unordered_types + for typ in types_list: + cfunc = jit((typ, typ), **flags)(pyfunc) + for x, y in itertools.product(ops, ops): + x = self.coerce_operand(x, typ) + y = self.coerce_operand(y, typ) + expected = pyfunc(x, y) + got = cfunc(x, y) + # Scalar ops => scalar result + self.assertIs(type(got), type(expected)) + self.assertEqual(got, expected, + "mismatch with %r (%r, %r)" + % (typ, x, y)) + + + # + # Comparison operators + # + + compare_scalar_operands = [-0.5, -1.0 + 1j, -1.0 + 2j, -0.5 + 1j, 1.5] + compare_types = [types.int32, types.int64, + types.uint32, types.uint64, + types.float32, types.float64] + compare_unordered_types = [types.complex64, types.complex128] + + def test_lt_scalar(self, flags=force_pyobj_flags): + self.run_test_scalar_compare(self.op.lt_usecase, flags) + + def test_lt_scalar_npm(self): + self.test_lt_scalar(flags=Noflags) + + def test_le_scalar(self, flags=force_pyobj_flags): + self.run_test_scalar_compare(self.op.le_usecase, flags) + + def test_le_scalar_npm(self): + self.test_le_scalar(flags=Noflags) + + def test_gt_scalar(self, flags=force_pyobj_flags): + self.run_test_scalar_compare(self.op.gt_usecase, flags) + + def test_gt_scalar_npm(self): + self.test_gt_scalar(flags=Noflags) + + def test_ge_scalar(self, flags=force_pyobj_flags): + self.run_test_scalar_compare(self.op.ge_usecase, flags) + + def test_ge_scalar_npm(self): + self.test_ge_scalar(flags=Noflags) + + def test_eq_scalar(self, flags=force_pyobj_flags): + self.run_test_scalar_compare(self.op.eq_usecase, flags, ordered=False) + + def test_eq_scalar_npm(self): + self.test_eq_scalar(flags=Noflags) + + def test_ne_scalar(self, flags=force_pyobj_flags): + self.run_test_scalar_compare(self.op.ne_usecase, flags, ordered=False) + + def test_ne_scalar_npm(self): + self.test_ne_scalar(flags=Noflags) + + def test_is_ellipsis(self): + cfunc = njit((types.ellipsis, types.ellipsis))(self.op.is_usecase) + self.assertTrue(cfunc(Ellipsis, Ellipsis)) + + def test_is_void_ptr(self): + # can't call this directly from python, as void cannot be unboxed + cfunc_void = jit( + (types.voidptr, types.voidptr), nopython=True + )(self.op.is_usecase) + + # this wrapper performs the casts from int to voidptr for us + @jit(nopython=True) + def cfunc(x, y): + return cfunc_void(x, y) + + self.assertTrue(cfunc(1, 1)) + self.assertFalse(cfunc(1, 2)) + + # + # Arithmetic operators + # + + def run_binop_bools(self, pyfunc, flags=force_pyobj_flags): + x_operands = [False, False, True, True] + y_operands = [False, True, False, True] + + types_list = [(types.boolean, types.boolean)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + def run_binop_ints(self, pyfunc, flags=force_pyobj_flags): + x_operands = [-5, 0, 1, 2] + y_operands = [-3, -1, 1, 3] + + types_list = [(types.int32, types.int32), + (types.int64, types.int64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = [2, 3] + y_operands = [1, 2] + + types_list = [(types.byte, types.byte), + (types.uint32, types.uint32), + (types.uint64, types.uint64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + def run_binop_floats(self, pyfunc, flags=force_pyobj_flags): + x_operands = [-1.1, 0.0, 1.1] + y_operands = [-1.5, 0.8, 2.1] + + types_list = [(types.float32, types.float32), + (types.float64, types.float64)] + + self.run_test_floats(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + def run_binop_floats_floordiv(self, pyfunc, flags=force_pyobj_flags): + self.run_binop_floats(pyfunc, flags=flags) + + def run_binop_complex(self, pyfunc, flags=force_pyobj_flags): + x_operands = [-1.1 + 0.3j, 0.0 + 0.0j, 1.1j] + y_operands = [-1.5 - 0.7j, 0.8j, 2.1 - 2.0j] + + types_list = [(types.complex64, types.complex64), + (types.complex128, types.complex128)] + + self.run_test_floats(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + def generate_binop_tests(ns, usecases, tp_runners, npm_array=False): + for usecase in usecases: + for tp_name, runner_name in tp_runners.items(): + for nopython in (False, True): + test_name = "test_%s_%s" % (usecase, tp_name) + if nopython: + test_name += "_npm" + flags = Noflags if nopython else force_pyobj_flags + usecase_name = "%s_usecase" % usecase + + def inner(self, runner_name=runner_name, + usecase_name=usecase_name, flags=flags): + runner = getattr(self, runner_name) + op_usecase = getattr(self.op, usecase_name) + runner(op_usecase, flags) + + if nopython and 'array' in tp_name and not npm_array: + def test_meth(self): + with self.assertTypingError(): + inner() + else: + test_meth = inner + + test_meth.__name__ = test_name + + if nopython: + test_meth = tag('important')(test_meth) + + ns[test_name] = test_meth + + + generate_binop_tests(locals(), + ('add', 'iadd', 'sub', 'isub', 'mul', 'imul'), + {'ints': 'run_binop_ints', + 'floats': 'run_binop_floats', + 'complex': 'run_binop_complex', + }) + + generate_binop_tests(locals(), + ('truediv', 'itruediv'), + {'ints': 'run_binop_ints', + 'floats': 'run_binop_floats', + 'complex': 'run_binop_complex', + }) + + # NOTE: floordiv and mod unsupported for complex numbers + generate_binop_tests(locals(), + ('floordiv', 'ifloordiv', 'mod', 'imod'), + {'ints': 'run_binop_ints', + 'floats': 'run_binop_floats_floordiv', + }) + + def check_div_errors(self, usecase_name, msg, flags=force_pyobj_flags, + allow_complex=False): + pyfunc = getattr(self.op, usecase_name) + # Signed and unsigned division can take different code paths, + # test them both. + arg_types = [types.int32, types.uint32, types.float64] + if allow_complex: + arg_types.append(types.complex128) + for tp in arg_types: + cfunc = jit((tp, tp), **flags)(pyfunc) + with self.assertRaises(ZeroDivisionError) as cm: + cfunc(1, 0) + # Test exception message if not in object mode + if flags is not force_pyobj_flags: + self.assertIn(msg, str(cm.exception)) + + def test_truediv_errors(self, flags=force_pyobj_flags): + self.check_div_errors("truediv_usecase", "division by zero", flags=flags, + allow_complex=True) + + def test_truediv_errors_npm(self): + self.test_truediv_errors(flags=Noflags) + + def test_floordiv_errors(self, flags=force_pyobj_flags): + self.check_div_errors("floordiv_usecase", "division by zero", flags=flags) + + def test_floordiv_errors_npm(self): + self.test_floordiv_errors(flags=Noflags) + + def test_mod_errors(self, flags=force_pyobj_flags): + self.check_div_errors("mod_usecase", "modulo by zero", flags=flags) + + def test_mod_errors_npm(self): + self.test_mod_errors(flags=Noflags) + + def run_pow_ints(self, pyfunc, flags=force_pyobj_flags): + x_operands = [-2, -1, 0, 1, 2] + y_operands = [0, 1, 2] + + types_list = [(types.int32, types.int32), + (types.int64, types.int64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = [0, 1, 2] + y_operands = [0, 1, 2] + + types_list = [(types.byte, types.byte), + (types.uint32, types.uint32), + (types.uint64, types.uint64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + def run_pow_floats(self, pyfunc, flags=force_pyobj_flags): + x_operands = [-222.222, -111.111, 111.111, 222.222] + y_operands = [-2, -1, 0, 1, 2] + + types_list = [(types.float32, types.float32), + (types.float64, types.float64)] + + self.run_test_floats(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = [0.0] + y_operands = [0, 1, 2] # TODO native handling of 0 ** negative power + + types_list = [(types.float32, types.float32), + (types.float64, types.float64)] + + self.run_test_floats(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + # XXX power operator is unsupported on complex numbers (see issue #488) + generate_binop_tests(locals(), + ('pow', 'ipow'), + {'ints': 'run_pow_ints', + 'floats': 'run_pow_floats', + }) + + def test_add_complex(self, flags=force_pyobj_flags): + pyfunc = self.op.add_usecase + + x_operands = [1+0j, 1j, -1-1j] + y_operands = x_operands + + types_list = [(types.complex64, types.complex64), + (types.complex128, types.complex128),] + + self.run_test_floats(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + def test_add_complex_npm(self): + self.test_add_complex(flags=Noflags) + + def test_sub_complex(self, flags=force_pyobj_flags): + pyfunc = self.op.sub_usecase + + x_operands = [1+0j, 1j, -1-1j] + y_operands = [1, 2, 3] + + types_list = [(types.complex64, types.complex64), + (types.complex128, types.complex128),] + + self.run_test_floats(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + def test_sub_complex_npm(self): + self.test_sub_complex(flags=Noflags) + + def test_mul_complex(self, flags=force_pyobj_flags): + pyfunc = self.op.mul_usecase + + x_operands = [1+0j, 1j, -1-1j] + y_operands = [1, 2, 3] + + types_list = [(types.complex64, types.complex64), + (types.complex128, types.complex128),] + + self.run_test_floats(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + def test_mul_complex_npm(self): + self.test_mul_complex(flags=Noflags) + + def test_truediv_complex(self, flags=force_pyobj_flags): + pyfunc = self.op.truediv_usecase + + x_operands = [1+0j, 1j, -1-1j] + y_operands = [1, 2, 3] + + types_list = [(types.complex64, types.complex64), + (types.complex128, types.complex128),] + + self.run_test_floats(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + def test_truediv_complex_npm(self): + self.test_truediv_complex(flags=Noflags) + + def test_mod_complex(self, flags=force_pyobj_flags): + pyfunc = self.op.mod_usecase + cres = jit((types.complex64, types.complex64), **flags)(pyfunc) + with self.assertRaises(TypeError) as raises: + cres(4j, 2j) + + # error message depends on Python version. + if utils.PYVERSION in ((3, 10), (3, 11), (3, 12), (3, 13)): + msg = "unsupported operand type(s) for %" + else: + raise NotImplementedError(utils.PYVERSION) + + self.assertIn(msg, str(raises.exception)) + + def test_mod_complex_npm(self): + pyfunc = self.op.mod_usecase + with self.assertTypingError(): + njit((types.complex64, types.complex64))(pyfunc) + + # + # Matrix multiplication + # (just check with simple values; computational tests are in test_linalg) + # + + def check_matmul_objmode(self, pyfunc, inplace): + # Use dummy objects, to work with any NumPy / SciPy version + cfunc = jit((), **force_pyobj_flags)(pyfunc) + a = DumbMatrix(3) + b = DumbMatrix(4) + got = cfunc(a, b) + self.assertEqual(got.value, 12) + if inplace: + self.assertIs(got, a) + else: + self.assertIsNot(got, a) + self.assertIsNot(got, b) + + def test_matmul(self): + self.check_matmul_objmode(self.op.matmul_usecase, inplace=False) + + def test_imatmul(self): + self.check_matmul_objmode(self.op.imatmul_usecase, inplace=True) + + @needs_blas + def check_matmul_npm(self, pyfunc): + arrty = types.Array(types.float32, 1, 'C') + cfunc = njit((arrty, arrty))(pyfunc) + a = np.float32([1, 2]) + b = np.float32([3, 4]) + got = cfunc(a, b) + self.assertPreciseEqual(got, np.dot(a, b)) + # Never inplace + self.assertIsNot(got, a) + self.assertIsNot(got, b) + + def test_matmul_npm(self): + self.check_matmul_npm(self.op.matmul_usecase) + + def test_imatmul_npm(self): + with self.assertTypingError() as raises: + self.check_matmul_npm(self.op.imatmul_usecase) + + # + # Bitwise operators + # + + def run_bitshift_left(self, pyfunc, flags=force_pyobj_flags): + x_operands = [0, 1] + y_operands = [0, 1, 2, 4, 8, 16, 31] + + types_list = [(types.uint32, types.uint32)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = [0, 1] + y_operands = [0, 1, 2, 4, 8, 16, 32, 63] + + types_list = [(types.uint64, types.uint64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = [0, -1] + y_operands = [0, 1, 2, 4, 8, 16, 31] + + types_list = [(types.int32, types.int32)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = [0, -1] + y_operands = [0, 1, 2, 4, 8, 16, 32, 63] + + types_list = [(types.int64, types.int64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + generate_binop_tests(locals(), + ('bitshift_left', 'bitshift_ileft'), + {'ints': 'run_bitshift_left', + }) + + def run_bitshift_right(self, pyfunc, flags=force_pyobj_flags): + x_operands = [0, 1, 2**32 - 1] + y_operands = [0, 1, 2, 4, 8, 16, 31] + + types_list = [(types.uint32, types.uint32)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = [0, 1, 2**64 - 1] + y_operands = [0, 1, 2, 4, 8, 16, 32, 63] + + types_list = [(types.uint64, types.uint64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = [0, 1, -(2**31)] + y_operands = [0, 1, 2, 4, 8, 16, 31] + + types_list = [(types.int32, types.int32)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = [0, -1, -(2**31)] + y_operands = [0, 1, 2, 4, 8, 16, 32, 63] + + types_list = [(types.int64, types.int64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + generate_binop_tests(locals(), + ('bitshift_right', 'bitshift_iright'), + {'ints': 'run_bitshift_right', + }) + + def run_logical(self, pyfunc, flags=force_pyobj_flags): + x_operands = list(range(0, 8)) + [2**32 - 1] + y_operands = list(range(0, 8)) + [2**32 - 1] + + types_list = [(types.uint32, types.uint32)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = list(range(0, 8)) + [2**64 - 1] + y_operands = list(range(0, 8)) + [2**64 - 1] + + types_list = [(types.uint64, types.uint64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = list(range(-4, 4)) + [-(2**31), 2**31 - 1] + y_operands = list(range(-4, 4)) + [-(2**31), 2**31 - 1] + + types_list = [(types.int32, types.int32)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = list(range(-4, 4)) + [-(2**63), 2**63 - 1] + y_operands = list(range(-4, 4)) + [-(2**63), 2**63 - 1] + + types_list = [(types.int64, types.int64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + generate_binop_tests(locals(), + ('bitwise_and', 'bitwise_iand', + 'bitwise_or', 'bitwise_ior', + 'bitwise_xor', 'bitwise_ixor'), + {'ints': 'run_logical', + 'bools': 'run_binop_bools', + }) + + # + # Unary operators + # + + def test_bitwise_not(self, flags=force_pyobj_flags): + pyfunc = self.op.bitwise_not_usecase_binary + + x_operands = list(range(0, 8)) + [2**32 - 1] + x_operands = [np.uint32(x) for x in x_operands] + y_operands = [0] + + types_list = [(types.uint32, types.uint32)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = list(range(-4, 4)) + [-(2**31), 2**31 - 1] + y_operands = [0] + + types_list = [(types.int32, types.int32)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = list(range(0, 8)) + [2**64 - 1] + x_operands = [np.uint64(x) for x in x_operands] + y_operands = [0] + + types_list = [(types.uint64, types.uint64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + x_operands = list(range(-4, 4)) + [-(2**63), 2**63 - 1] + y_operands = [0] + + types_list = [(types.int64, types.int64)] + + self.run_test_ints(pyfunc, x_operands, y_operands, types_list, + flags=flags) + + # For booleans, we follow Numpy semantics (i.e. ~True == False, + # not ~True == -2) + values = [False, False, True, True] + values = list(map(np.bool_, values)) + + pyfunc = self.op.bitwise_not_usecase + cfunc = jit((types.boolean,), **flags)(pyfunc) + for val in values: + self.assertPreciseEqual(pyfunc(val), cfunc(val)) + + def test_bitwise_not_npm(self): + self.test_bitwise_not(flags=Noflags) + + def test_bitwise_float(self): + """ + Make sure that bitwise float operations are not allowed + """ + def assert_reject_compile(pyfunc, argtypes, opname): + msg = 'expecting TypingError when compiling {}'.format(pyfunc) + with self.assertRaises(errors.TypingError, msg=msg) as raises: + njit(argtypes)(pyfunc) + # check error message + fmt = _header_lead + ' {}' + expecting = fmt.format(opname + if isinstance(opname, str) + else 'Function({})'.format(opname)) + self.assertIn(expecting, str(raises.exception)) + + methods = [ + 'bitshift_left_usecase', + 'bitshift_ileft_usecase', + 'bitshift_right_usecase', + 'bitshift_iright_usecase', + 'bitwise_and_usecase', + 'bitwise_iand_usecase', + 'bitwise_or_usecase', + 'bitwise_ior_usecase', + 'bitwise_xor_usecase', + 'bitwise_ixor_usecase', + 'bitwise_not_usecase_binary', + ] + + for name in methods: + pyfunc = getattr(self.op, name) + assert_reject_compile(pyfunc, (types.float32, types.float32), + opname=self._bitwise_opnames[name]) + + def test_not(self): + pyfunc = self.op.not_usecase + + values = [ + 1, + 2, + 3, + 1.2, + 3.4j, + ] + + cfunc = jit((), **force_pyobj_flags)(pyfunc) + for val in values: + self.assertEqual(pyfunc(val), cfunc(val)) + + def test_not_npm(self): + pyfunc = self.op.not_usecase + # test native mode + argtys = [ + types.int8, + types.int32, + types.int64, + types.float32, + types.complex128, + ] + values = [ + 1, + 2, + 3, + 1.2, + 3.4j, + ] + for ty, val in zip(argtys, values): + cfunc = njit((ty,))(pyfunc) + self.assertEqual(cfunc.nopython_signatures[0].return_type, + types.boolean) + self.assertEqual(pyfunc(val), cfunc(val)) + + # XXX test_negate should check for negative and positive zeros and infinities + + def test_negate_npm(self): + pyfunc = self.op.negate_usecase + # test native mode + argtys = [ + types.int8, + types.int32, + types.int64, + types.float32, + types.float64, + types.complex128, + types.boolean, + types.boolean, + ] + values = [ + 1, + 2, + 3, + 1.2, + 2.4, + 3.4j, + True, + False, + ] + for ty, val in zip(argtys, values): + cfunc = njit((ty,))(pyfunc) + self.assertAlmostEqual(pyfunc(val), cfunc(val)) + + + def test_negate(self): + pyfunc = self.op.negate_usecase + values = [ + 1, + 2, + 3, + 1.2, + 3.4j, + True, + False, + ] + cfunc = jit((), **force_pyobj_flags)(pyfunc) + for val in values: + self.assertEqual(pyfunc(val), cfunc(val)) + + def test_unary_positive_npm(self): + pyfunc = self.op.unary_positive_usecase + # test native mode + argtys = [ + types.int8, + types.int32, + types.int64, + types.float32, + types.float64, + types.complex128, + types.boolean, + types.boolean, + ] + values = [ + 1, + 2, + 3, + 1.2, + 2.4, + 3.4j, + True, + False + ] + for ty, val in zip(argtys, values): + cfunc = njit((ty,))(pyfunc) + self.assertAlmostEqual(pyfunc(val), cfunc(val)) + + def test_unary_positive(self): + pyfunc = self.op.unary_positive_usecase + values = [ + 1, + 2, + 3, + 1.2, + 3.4j, + True, + False, + ] + cfunc = jit((), **force_pyobj_flags)(pyfunc) + for val in values: + self.assertEqual(pyfunc(val), cfunc(val)) + + def _check_in(self, pyfunc, flags): + dtype = types.int64 + cfunc = jit((dtype, types.UniTuple(dtype, 3)), **flags)(pyfunc) + for i in (3, 4, 5, 6, 42): + tup = (3, 42, 5) + self.assertPreciseEqual(pyfunc(i, tup), cfunc(i, tup)) + + def test_in(self, flags=force_pyobj_flags): + self._check_in(self.op.in_usecase, flags) + + def test_in_npm(self): + self.test_in(flags=Noflags) + + def test_not_in(self, flags=force_pyobj_flags): + self._check_in(self.op.not_in_usecase, flags) + + def test_not_in_npm(self): + self.test_not_in(flags=Noflags) + + +class TestOperatorModule(TestOperators): + + op = FunctionalOperatorImpl + + _bitwise_opnames = { + 'bitshift_left_usecase': operator.lshift, + 'bitshift_ileft_usecase': operator.ilshift, + 'bitshift_right_usecase': operator.rshift, + 'bitshift_iright_usecase': operator.irshift, + 'bitwise_and_usecase': operator.and_, + 'bitwise_iand_usecase': operator.iand, + 'bitwise_or_usecase': operator.or_, + 'bitwise_ior_usecase': operator.ior, + 'bitwise_xor_usecase': operator.xor, + 'bitwise_ixor_usecase': operator.ixor, + 'bitwise_not_usecase_binary': operator.invert, + } + + +class TestMixedInts(TestCase): + """ + Tests for operator calls with mixed integer types. + """ + + op = LiteralOperatorImpl + + int_samples = [0, 1, 3, 10, 42, 127, 10000, -1, -3, -10, -42, -127, -10000] + + int_types = [types.int8, types.uint8, types.int64, types.uint64] + signed_types = [tp for tp in int_types if tp.signed] + unsigned_types = [tp for tp in int_types if not tp.signed] + type_pairs = list(itertools.product(int_types, int_types)) + signed_pairs = [(u, v) for u, v in type_pairs + if u.signed or v.signed] + unsigned_pairs = [(u, v) for u, v in type_pairs + if not (u.signed or v.signed)] + + def int_in_dtype_range(self, val, tp): + tp_info = np.iinfo(tp.key) + return tp_info.min <= val <= tp_info.max + + def get_numpy_signed_upcast(self, *vals): + bitwidth = max(v.dtype.itemsize * 8 for v in vals) + bitwidth = max(bitwidth, types.intp.bitwidth) + return getattr(np, "int%d" % bitwidth) + + def get_numpy_unsigned_upcast(self, *vals): + bitwidth = max(v.dtype.itemsize * 8 for v in vals) + bitwidth = max(bitwidth, types.intp.bitwidth) + return getattr(np, "uint%d" % bitwidth) + + def get_typed_int(self, typ, val): + return getattr(np, typ.name)(val) + + def get_control_signed(self, opname): + op = getattr(operator, opname) + def control_signed(a, b): + tp = self.get_numpy_signed_upcast(a, b) + return op(tp(a), tp(b)) + return control_signed + + def get_control_unsigned(self, opname): + op = getattr(operator, opname) + def control_unsigned(a, b): + tp = self.get_numpy_unsigned_upcast(a, b) + return op(tp(a), tp(b)) + return control_unsigned + + def run_binary(self, pyfunc, control_func, operands, types, + expected_type=int, force_type=lambda x: x, + **assertPreciseEqualArgs): + for xt, yt in types: + cfunc = njit((xt, yt))(pyfunc) + for x, y in itertools.product(operands, operands): + # Check if xt and yt are values with range of dtype x and y + if not self.int_in_dtype_range(x, xt) or not self.int_in_dtype_range(y, yt): + continue + # Get Numpy typed scalars for the given types and values + x = self.get_typed_int(xt, x) + y = self.get_typed_int(yt, y) + expected = control_func(x, y) + got = cfunc(x, y) + self.assertIsInstance(got, expected_type) + msg = ("mismatch for (%r, %r) with types %s" + % (x, y, (xt, yt))) + got, expected = force_type(got), force_type(expected) + self.assertPreciseEqual(got, expected, msg=msg, + **assertPreciseEqualArgs) + + def run_unary(self, pyfunc, control_func, operands, types, + expected_type=int): + for xt in types: + cfunc = njit((xt,))(pyfunc) + for x in operands: + if not self.int_in_dtype_range(x, xt): + continue + x = self.get_typed_int(xt, x) + expected = control_func(x) + got = cfunc(x) + self.assertIsInstance(got, expected_type) + self.assertPreciseEqual( + got, expected, + msg="mismatch for %r with type %s: %r != %r" + % (x, xt, got, expected)) + + def run_arith_binop(self, pyfunc, opname, samples, + expected_type=int, force_type=lambda x: x, + **assertPreciseEqualArgs): + self.run_binary(pyfunc, self.get_control_signed(opname), + samples, self.signed_pairs, expected_type, + force_type=force_type, + **assertPreciseEqualArgs) + self.run_binary(pyfunc, self.get_control_unsigned(opname), + samples, self.unsigned_pairs, expected_type, + force_type=force_type, + **assertPreciseEqualArgs) + + def test_add(self): + self.run_arith_binop(self.op.add_usecase, 'add', self.int_samples) + + def test_sub(self): + self.run_arith_binop(self.op.sub_usecase, 'sub', self.int_samples) + + def test_mul(self): + self.run_arith_binop(self.op.mul_usecase, 'mul', self.int_samples) + + def test_floordiv(self): + samples = [x for x in self.int_samples if x != 0] + self.run_arith_binop(self.op.floordiv_usecase, 'floordiv', samples) + + def test_mod(self): + samples = [x for x in self.int_samples if x != 0] + self.run_arith_binop(self.op.mod_usecase, 'mod', samples) + + def test_pow(self): + extra_cast = {} + if utils.PYVERSION == (3, 11): + extra_cast["force_type"] = float + pyfunc = self.op.pow_usecase + # Only test with positive values, as otherwise trying to write the + # control function in terms of Python or Numpy power turns out insane. + samples = [x for x in self.int_samples if x >= 0] + self.run_arith_binop(pyfunc, 'pow', samples, **extra_cast) + + # Now test all non-zero values, but only with signed types + def control_signed(a, b): + tp = self.get_numpy_signed_upcast(a, b) + if b >= 0: + return tp(a) ** tp(b) + else: + inv = tp(a) ** tp(-b) + if inv == 0: + # Overflow + return 0 + return np.intp(1.0 / inv) + samples = [x for x in self.int_samples if x != 0] + signed_pairs = [(u, v) for u, v in self.type_pairs + if u.signed and v.signed] + self.run_binary(pyfunc, control_signed, + samples, signed_pairs, **extra_cast) + + def test_truediv(self): + + def control(a, b): + return float(a) / float(b) + samples = [x for x in self.int_samples if x != 0] + pyfunc = self.op.truediv_usecase + + # Note: there can be precision issues on x87 + # e.g. for `1 / 18446744073709541616` + # -> 0x1.0000000000002p-64 vs. 0x1.0000000000003p-64. + self.run_binary(pyfunc, control, samples, self.signed_pairs, + expected_type=float, prec='double') + self.run_binary(pyfunc, control, samples, self.unsigned_pairs, + expected_type=float, prec='double') + + def test_and(self): + self.run_arith_binop(self.op.bitwise_and_usecase, 'and_', self.int_samples) + + def test_or(self): + self.run_arith_binop(self.op.bitwise_or_usecase, 'or_', self.int_samples) + + def test_xor(self): + self.run_arith_binop(self.op.bitwise_xor_usecase, 'xor', self.int_samples) + + def run_shift_binop(self, pyfunc, opname): + opfunc = getattr(operator, opname) + def control_signed(a, b): + tp = self.get_numpy_signed_upcast(a, b) + return opfunc(tp(a), tp(b)) + def control_unsigned(a, b): + tp = self.get_numpy_unsigned_upcast(a, b) + return opfunc(tp(a), tp(b)) + + samples = self.int_samples + + def check(xt, yt, control_func): + cfunc = njit((xt, yt))(pyfunc) + for x in samples: + # Avoid shifting by more than the shiftand's bitwidth, as + # we would hit undefined behaviour. + maxshift = xt.bitwidth - 1 + for y in (0, 1, 3, 5, maxshift - 1, maxshift): + if not self.int_in_dtype_range(x, xt) or not self.int_in_dtype_range(y, yt): + continue + # Get Numpy typed scalars for the given types and values + x = self.get_typed_int(xt, x) + y = self.get_typed_int(yt, y) + expected = control_func(x, y) + got = cfunc(x, y) + msg = ("mismatch for (%r, %r) with types %s" + % (x, y, (xt, yt))) + self.assertPreciseEqual(got, expected, msg=msg) + + # For bitshifts, only the first operand's signedness matters + # to choose the operation's signedness. + signed_pairs = [(u, v) for u, v in self.type_pairs + if u.signed] + unsigned_pairs = [(u, v) for u, v in self.type_pairs + if not u.signed] + + for xt, yt in signed_pairs: + check(xt, yt, control_signed) + for xt, yt in unsigned_pairs: + check(xt, yt, control_unsigned) + + def test_lshift(self): + self.run_shift_binop(self.op.bitshift_left_usecase, 'lshift') + + def test_rshift(self): + self.run_shift_binop(self.op.bitshift_right_usecase, 'rshift') + + def test_unary_positive(self): + def control(a): + return a + samples = self.int_samples + pyfunc = self.op.unary_positive_usecase + + self.run_unary(pyfunc, control, samples, self.int_types) + + def test_unary_negative(self): + def control_signed(a): + tp = self.get_numpy_signed_upcast(a) + return tp(-a) + def control_unsigned(a): + tp = self.get_numpy_unsigned_upcast(a) + return tp(-a) + samples = self.int_samples + pyfunc = self.op.negate_usecase + + self.run_unary(pyfunc, control_signed, samples, self.signed_types) + self.run_unary(pyfunc, control_unsigned, samples, self.unsigned_types) + + def test_invert(self): + def control_signed(a): + tp = self.get_numpy_signed_upcast(a) + return tp(~a) + def control_unsigned(a): + tp = self.get_numpy_unsigned_upcast(a) + return tp(~a) + samples = self.int_samples + pyfunc = self.op.bitwise_not_usecase + + self.run_unary(pyfunc, control_signed, samples, self.signed_types) + self.run_unary(pyfunc, control_unsigned, samples, self.unsigned_types) + + +class TestMixedIntsOperatorModule(TestMixedInts): + + op = FunctionalOperatorImpl + + +class TestStaticPower(TestCase): + """ + Test the ** operator with a static exponent, to exercise a + dedicated optimization. + """ + + def _check_pow(self, exponents, values): + for exp in exponents: + # test against non-static version of the @jit-ed function + regular_func = LiteralOperatorImpl.pow_usecase + static_func = make_static_power(exp) + + static_cfunc = jit(nopython=True)(static_func) + regular_cfunc = jit(nopython=True)(regular_func) + for v in values: + try: + expected = regular_cfunc(v, exp) + except ZeroDivisionError: + with self.assertRaises(ZeroDivisionError): + static_cfunc(v) + else: + got = static_cfunc(v) + self.assertPreciseEqual(expected, got, prec='double') + + def test_int_values(self): + exponents = [1, 2, 3, 5, 17, 0, -1, -2, -3] + vals = [0, 1, 3, -1, -4, np.int8(-3), np.uint16(4)] + + self._check_pow(exponents, vals) + + def test_real_values(self): + exponents = [1, 2, 3, 5, 17, 0, -1, -2, -3, 0x111111, -0x111112] + vals = [1.5, 3.25, -1.25, np.float32(-2.0), float('inf'), float('nan')] + + self._check_pow(exponents, vals) + +class TestStringConstComparison(TestCase): + """ + Test comparison of string constants + """ + def test_eq(self): + def test_impl1(): + s = 'test' + return s == 'test' + + def test_impl2(): + s = 'test1' + return s == 'test' + + cfunc1 = jit(nopython=True)(test_impl1) + cfunc2 = jit(nopython=True)(test_impl2) + self.assertEqual(test_impl1(), cfunc1()) + self.assertEqual(test_impl2(), cfunc2()) + + def test_neq(self): + def test_impl1(): + s = 'test' + return s != 'test' + + def test_impl2(): + s = 'test1' + return s != 'test' + + cfunc1 = jit(nopython=True)(test_impl1) + cfunc2 = jit(nopython=True)(test_impl2) + self.assertEqual(test_impl1(), cfunc1()) + self.assertEqual(test_impl2(), cfunc2()) + +class TestBooleanLiteralOperators(TestCase): + """ + Test operators with Boolean constants + """ + def test_eq(self): + + def test_impl1(b): + return a_val == b + + def test_impl2(a): + return a == b_val + + def test_impl3(): + r1 = True == True + r2 = True == False + r3 = False == True + r4 = False == False + return (r1, r2, r3, r4) + + for a_val, b in itertools.product([True, False], repeat=2): + cfunc1 = jit(nopython=True)(test_impl1) + self.assertEqual(test_impl1(b), cfunc1(b)) + + for a, b_val in itertools.product([True, False], repeat=2): + cfunc2 = jit(nopython=True)(test_impl2) + self.assertEqual(test_impl2(a), cfunc2(a)) + + cfunc3 = jit(nopython=True)(test_impl3) + self.assertEqual(test_impl3(), cfunc3()) + + def test_ne(self): + + def test_impl1(b): + return a_val != b + + def test_impl2(a): + return a != b_val + + def test_impl3(): + r1 = True != True + r2 = True != False + r3 = False != True + r4 = False != False + return (r1, r2, r3, r4) + + for a_val, b in itertools.product([True, False], repeat=2): + cfunc1 = jit(nopython=True)(test_impl1) + self.assertEqual(test_impl1(b), cfunc1(b)) + + for a, b_val in itertools.product([True, False], repeat=2): + cfunc2 = jit(nopython=True)(test_impl2) + self.assertEqual(test_impl2(a), cfunc2(a)) + + cfunc3 = jit(nopython=True)(test_impl3) + self.assertEqual(test_impl3(), cfunc3()) + + def test_is(self): + + def test_impl1(b): + return a_val is b + + def test_impl2(): + r1 = True is True + r2 = True is False + r3 = False is True + r4 = False is False + return (r1, r2, r3, r4) + + for a_val, b in itertools.product([True, False], repeat=2): + cfunc1 = jit(nopython=True)(test_impl1) + self.assertEqual(test_impl1(b), cfunc1(b)) + + cfunc2 = jit(nopython=True)(test_impl2) + self.assertEqual(test_impl2(), cfunc2()) + + def test_not(self): + + def test_impl(): + a, b = False, True + return (not a, not b) + + cfunc = jit(nopython=True)(test_impl) + self.assertEqual(test_impl(), cfunc()) + + def test_bool(self): + + def test_impl(): + a, b = False, True + return (bool(a), bool(b)) + + cfunc = jit(nopython=True)(test_impl) + self.assertEqual(test_impl(), cfunc()) + + def test_bool_to_str(self): + + def test_impl(): + a, b = False, True + return (str(a), str(b)) + + cfunc = jit(nopython=True)(test_impl) + self.assertEqual(test_impl(), cfunc()) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_optimisation_pipelines.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_optimisation_pipelines.py new file mode 100644 index 0000000000000000000000000000000000000000..a11e6632442d907c3a4dc9c3588a40cc2b518c34 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_optimisation_pipelines.py @@ -0,0 +1,58 @@ +import unittest + +from numba.tests.support import (TestCase, override_config) +from numba import njit +from numba.core import types +import llvmlite.binding as llvm + + +class TestPassManagerOptimization(TestCase): + """ Tests that pass manager is not overriding the intended + optimization level. + """ + + def _get_llvmir(self, fn, sig): + with override_config('OPT', 0): + fn.compile(sig) + return fn.inspect_llvm(sig) + + def test_override_config(self): + @njit(debug=True, error_model='numpy') + def foo(a): + b = a + 1.23 + c = b * 2.34 + d = b / c + print(d) + return d + + sig = (types.float64,) + full_ir = self._get_llvmir(foo, sig=sig) + + module = llvm.parse_assembly(full_ir) + + name = foo.overloads[foo.signatures[0]].fndesc.mangled_name + funcs = [x for x in module.functions if x.name == name] + self.assertEqual(len(funcs), 1) + func = funcs[0] + blocks = [x for x in func.blocks] + self.assertGreater(len(blocks), 1) + block = blocks[0] + + # Find sequence with non-debug instructions + instrs = [x for x in block.instructions if x.opcode != 'call'] + op_expect = {'fadd', 'fmul', 'fdiv'} + started = False + for x in instrs: + if x.opcode in op_expect: + op_expect.remove(x.opcode) + if not started: + started = True + elif op_expect and started: + break + + self.assertGreater(len(op_expect), 0, + "Function was optimized unexpectedly") + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_optional.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_optional.py new file mode 100644 index 0000000000000000000000000000000000000000..f043cebee22b050c24afdb9b2af0827cccd41fe8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_optional.py @@ -0,0 +1,254 @@ +import itertools + +import numpy as np + +import unittest +from numba import jit, njit +from numba.core import types +from numba.tests.support import TestCase + + +def return_double_or_none(x): + if x: + ret = None + else: + ret = 1.2 + return ret + + +def return_different_statement(x): + if x: + return None + else: + return 1.2 + + +def return_bool_optional_or_none(x, y): + if y: + z = False + else: + z = None + if x == 2: + # A boolean + return True + elif x == 1: + # A runtime optional + return z + else: + # None + return None + + +def is_this_a_none(x): + if x: + val_or_none = None + else: + val_or_none = x + + if val_or_none is None: + return x - 1 + + if val_or_none is not None: + return x + 1 + + +def a_is_b(a, b): + """ + Note in nopython mode, this operation does not make much sense. + Because we don't have objects anymore. + `a is b` is always False if not operating on None and Optional type + """ + return a is b + + +def a_is_not_b(a, b): + """ + This is `not (a is b)` + """ + return a is not b + + +class TestOptional(TestCase): + + _numba_parallel_test_ = False + + def test_return_double_or_none(self): + pyfunc = return_double_or_none + cfunc = njit((types.boolean,))(pyfunc) + + for v in [True, False]: + self.assertPreciseEqual(pyfunc(v), cfunc(v)) + + def test_return_different_statement(self): + pyfunc = return_different_statement + cfunc = njit((types.boolean,))(pyfunc) + + for v in [True, False]: + self.assertPreciseEqual(pyfunc(v), cfunc(v)) + + def test_return_bool_optional_or_none(self): + pyfunc = return_bool_optional_or_none + cfunc = njit((types.int32, types.int32,))(pyfunc) + + for x, y in itertools.product((0, 1, 2), (0, 1)): + self.assertPreciseEqual(pyfunc(x, y), cfunc(x, y)) + + def test_is_this_a_none(self): + pyfunc = is_this_a_none + cfunc = njit((types.intp,))(pyfunc) + + for v in [-1, 0, 1, 2]: + self.assertPreciseEqual(pyfunc(v), cfunc(v)) + + def test_is_this_a_none_objmode(self): + pyfunc = is_this_a_none + cfunc = jit((types.intp,), forceobj=True)(pyfunc) + self.assertTrue(cfunc.overloads[cfunc.signatures[0]].objectmode) + for v in [-1, 0, 1, 2]: + self.assertPreciseEqual(pyfunc(v), cfunc(v)) + + def test_a_is_b_intp(self): + pyfunc = a_is_b + cfunc = njit((types.intp, types.intp))(pyfunc) + # integer identity relies on `==` + self.assertTrue(cfunc(1, 1)) + self.assertFalse(cfunc(1, 2)) + + def test_a_is_not_b_intp(self): + pyfunc = a_is_not_b + cfunc = njit((types.intp, types.intp))(pyfunc) + # integer identity relies on `==` + self.assertFalse(cfunc(1, 1)) + self.assertTrue(cfunc(1, 2)) + + def test_optional_float(self): + def pyfunc(x, y): + if y is None: + return x + else: + return x + y + + cfunc = njit("(float64, optional(float64))")(pyfunc) + self.assertAlmostEqual(pyfunc(1., 12.3), cfunc(1., 12.3)) + self.assertAlmostEqual(pyfunc(1., None), cfunc(1., None)) + + def test_optional_array(self): + def pyfunc(x, y): + if y is None: + return x + else: + y[0] += x + return y[0] + + cfunc = njit("(float32, optional(float32[:]))")(pyfunc) + cy = np.array([12.3], dtype=np.float32) + py = cy.copy() + self.assertAlmostEqual(pyfunc(1., py), cfunc(1., cy)) + np.testing.assert_almost_equal(py, cy) + self.assertAlmostEqual(pyfunc(1., None), cfunc(1., None)) + + def test_optional_array_error(self): + def pyfunc(y): + return y[0] + + cfunc = njit("(optional(int32[:]),)")(pyfunc) + with self.assertRaises(TypeError) as raised: + cfunc(None) + self.assertIn('expected array(int32, 1d, A), got None', + str(raised.exception)) + + y = np.array([0xabcd], dtype=np.int32) + self.assertEqual(cfunc(y), pyfunc(y)) + + def test_optional_array_attribute(self): + """ + Check that we can access attribute of an optional + """ + def pyfunc(arr, do_it): + opt = None + if do_it: # forces `opt` to be an optional of arr + opt = arr + return opt.shape[0] + + cfunc = njit(pyfunc) + arr = np.arange(5) + self.assertEqual(pyfunc(arr, True), cfunc(arr, True)) + + def test_assign_to_optional(self): + """ + Check that we can assign to a variable of optional type + """ + @njit + def make_optional(val, get_none): + if get_none: + ret = None + else: + ret = val + return ret + + @njit + def foo(val, run_second): + a = make_optional(val, True) + if run_second: + a = make_optional(val, False) + return a + + self.assertIsNone(foo(123, False)) + self.assertEqual(foo(231, True), 231) + + def test_optional_thru_omitted_arg(self): + """ + Issue 1868 + """ + + def pyfunc(x=None): + if x is None: + x = 1 + return x + + cfunc = njit(pyfunc) + self.assertEqual(pyfunc(), cfunc()) + self.assertEqual(pyfunc(3), cfunc(3)) + + def test_optional_unpack(self): + """ + Issue 2171 + """ + def pyfunc(x): + if x is None: + return + else: + a, b = x + return a, b + + tup = types.Tuple([types.intp] * 2) + opt_tup = types.Optional(tup) + sig = (opt_tup,) + cfunc = njit(sig)(pyfunc) + self.assertEqual(pyfunc(None), cfunc(None)) + self.assertEqual(pyfunc((1, 2)), cfunc((1, 2))) + + def test_many_optional_none_returns(self): + """ + Issue #4058 + """ + @njit + def foo(maybe): + lx = None + if maybe: + lx = 10 + return 1, lx + + def work(): + tmp = [] + for _ in range(20000): + maybe = False + _ = foo(maybe) + + # this caused "Fatal Python error: deallocating None" as there was no + # incref being made on the returned None. + work() + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_overlap.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_overlap.py new file mode 100644 index 0000000000000000000000000000000000000000..eecf77c099ce9359a5ed298f84c5eefaa7076883 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_overlap.py @@ -0,0 +1,134 @@ +import numpy as np + +from numba import jit +from numba.core import types +from numba.tests.support import TestCase, tag +import unittest + + +# Array overlaps involving a displacement + +def array_overlap1(src, dest, k=1): + assert src.shape == dest.shape + dest[k:] = src[:-k] + +def array_overlap2(src, dest, k=1): + assert src.shape == dest.shape + dest[:-k] = src[k:] + +def array_overlap3(src, dest, k=1): + assert src.shape == dest.shape + dest[:,:-k] = src[:,k:] + +def array_overlap4(src, dest, k=1): + assert src.shape == dest.shape + dest[:,k:] = src[:,:-k] + +def array_overlap5(src, dest, k=1): + assert src.shape == dest.shape + dest[...,:-k] = src[...,k:] + +def array_overlap6(src, dest, k=1): + assert src.shape == dest.shape + dest[...,k:] = src[...,:-k] + +# Array overlaps involving an in-place reversal + +def array_overlap11(src, dest): + assert src.shape == dest.shape + dest[::-1] = src + +def array_overlap12(src, dest): + assert src.shape == dest.shape + dest[:] = src[::-1] + +def array_overlap13(src, dest): + assert src.shape == dest.shape + dest[:,::-1] = src + +def array_overlap14(src, dest): + assert src.shape == dest.shape + dest[:] = src[:,::-1] + +def array_overlap15(src, dest): + assert src.shape == dest.shape + dest[...,::-1] = src + +def array_overlap16(src, dest): + assert src.shape == dest.shape + dest[:] = src[...,::-1] + + +class TestArrayOverlap(TestCase): + + def check_overlap(self, pyfunc, min_ndim, have_k_argument=False): + N = 4 + + def vary_layouts(orig): + yield orig.copy(order='C') + yield orig.copy(order='F') + a = orig[::-1].copy()[::-1] + assert not a.flags.c_contiguous and not a.flags.f_contiguous + yield a + + def check(pyfunc, cfunc, pydest, cdest, kwargs): + pyfunc(pydest, pydest, **kwargs) + cfunc(cdest, cdest, **kwargs) + self.assertPreciseEqual(pydest, cdest) + + cfunc = jit(nopython=True)(pyfunc) + # Check for up to 3d arrays + for ndim in range(min_ndim, 4): + shape = (N,) * ndim + orig = np.arange(0, N**ndim).reshape(shape) + # Note we cannot copy a 'A' layout array exactly (bitwise), + # so instead we call vary_layouts() twice + for pydest, cdest in zip(vary_layouts(orig), vary_layouts(orig)): + if have_k_argument: + for k in range(1, N): + check(pyfunc, cfunc, pydest, cdest, dict(k=k)) + else: + check(pyfunc, cfunc, pydest, cdest, {}) + + def check_overlap_with_k(self, pyfunc, min_ndim): + self.check_overlap(pyfunc, min_ndim=min_ndim, have_k_argument=True) + + def test_overlap1(self): + self.check_overlap_with_k(array_overlap1, min_ndim=1) + + def test_overlap2(self): + self.check_overlap_with_k(array_overlap2, min_ndim=1) + + def test_overlap3(self): + self.check_overlap_with_k(array_overlap3, min_ndim=2) + + def test_overlap4(self): + self.check_overlap_with_k(array_overlap4, min_ndim=2) + + def test_overlap5(self): + self.check_overlap_with_k(array_overlap5, min_ndim=1) + + def test_overlap6(self): + self.check_overlap_with_k(array_overlap6, min_ndim=1) + + def test_overlap11(self): + self.check_overlap(array_overlap11, min_ndim=1) + + def test_overlap12(self): + self.check_overlap(array_overlap12, min_ndim=1) + + def test_overlap13(self): + self.check_overlap(array_overlap13, min_ndim=2) + + def test_overlap14(self): + self.check_overlap(array_overlap14, min_ndim=2) + + def test_overlap15(self): + self.check_overlap(array_overlap15, min_ndim=1) + + def test_overlap16(self): + self.check_overlap(array_overlap16, min_ndim=1) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parallel_backend.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parallel_backend.py new file mode 100644 index 0000000000000000000000000000000000000000..e8da3ba65ccf9e2e224ca5adfb163f745b3756c9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parallel_backend.py @@ -0,0 +1,1253 @@ +# -*- coding: utf-8 -*- + +""" +Tests the parallel backend +""" +import faulthandler +import itertools +import multiprocessing +import os +import random +import re +import subprocess +import sys +import textwrap +import threading +import unittest + +import numpy as np + +from numba import jit, vectorize, guvectorize, set_num_threads +from numba.tests.support import (temp_directory, override_config, TestCase, tag, + skip_parfors_unsupported, linux_only) + +import queue as t_queue +from numba.testing.main import _TIMEOUT as _RUNNER_TIMEOUT +from numba.core import config + + +_TEST_TIMEOUT = _RUNNER_TIMEOUT - 60. + + +# Check which backends are available +# TODO: Put this in a subprocess so the address space is kept clean +try: + # Check it's a compatible TBB before loading it + from numba.np.ufunc.parallel import _check_tbb_version_compatible + _check_tbb_version_compatible() + from numba.np.ufunc import tbbpool # noqa: F401 + _HAVE_TBB_POOL = True +except ImportError: + _HAVE_TBB_POOL = False + +try: + from numba.np.ufunc import omppool + _HAVE_OMP_POOL = True +except ImportError: + _HAVE_OMP_POOL = False + +try: + import scipy.linalg.cython_lapack # noqa: F401 + _HAVE_LAPACK = True +except ImportError: + _HAVE_LAPACK = False + +# test skipping decorators +skip_no_omp = unittest.skipUnless(_HAVE_OMP_POOL, "OpenMP threadpool required") +skip_no_tbb = unittest.skipUnless(_HAVE_TBB_POOL, "TBB threadpool required") + +_gnuomp = _HAVE_OMP_POOL and omppool.openmp_vendor == "GNU" +skip_unless_gnu_omp = unittest.skipUnless(_gnuomp, "GNU OpenMP only tests") + +_windows = sys.platform.startswith('win') +_osx = sys.platform.startswith('darwin') +_32bit = sys.maxsize <= 2 ** 32 +_parfors_unsupported = _32bit + +_HAVE_OS_FORK = not _windows + + +# some functions to jit + +def foo(n, v): + return np.ones(n) + v + + +if _HAVE_LAPACK: + def linalg(n, v): + x = np.dot(np.ones((n, n)), np.ones((n, n))) + return x + np.arange(n) + v +else: + def linalg(n, v): + # no way to trigger MKL without the lapack bindings. + return np.arange(n) + v + + +def ufunc_foo(a, b): + return a + b + + +def gufunc_foo(a, b, out): + out[0] = a + b + + +class runnable(object): + def __init__(self, **options): + self._options = options + + +class jit_runner(runnable): + + def __call__(self): + cfunc = jit(**self._options)(foo) + a = 4 + b = 10 + expected = foo(a, b) + got = cfunc(a, b) + np.testing.assert_allclose(expected, got) + + +class mask_runner(object): + def __init__(self, runner, mask, **options): + self.runner = runner + self.mask = mask + + def __call__(self): + if self.mask: + # Tests are all run in isolated subprocesses, so we + # don't have to worry about this affecting other tests + set_num_threads(self.mask) + self.runner() + + +class linalg_runner(runnable): + + def __call__(self): + cfunc = jit(**self._options)(linalg) + a = 4 + b = 10 + expected = linalg(a, b) + got = cfunc(a, b) + np.testing.assert_allclose(expected, got) + + +class vectorize_runner(runnable): + + def __call__(self): + cfunc = vectorize(['(f4, f4)'], **self._options)(ufunc_foo) + a = b = np.random.random(10).astype(np.float32) + expected = ufunc_foo(a, b) + got = cfunc(a, b) + np.testing.assert_allclose(expected, got) + + +class guvectorize_runner(runnable): + + def __call__(self): + sig = ['(f4, f4, f4[:])'] + cfunc = guvectorize(sig, '(),()->()', **self._options)(gufunc_foo) + a = b = np.random.random(10).astype(np.float32) + expected = ufunc_foo(a, b) + got = cfunc(a, b) + np.testing.assert_allclose(expected, got) + + +def chooser(fnlist, **kwargs): + q = kwargs.get('queue') + try: + faulthandler.enable() + for _ in range(int(len(fnlist) * 1.5)): + fn = random.choice(fnlist) + fn() + except Exception as e: + q.put(e) + + +def compile_factory(parallel_class, queue_impl): + def run_compile(fnlist): + q = queue_impl() + kws = {'queue': q} + ths = [parallel_class(target=chooser, args=(fnlist,), kwargs=kws) + for i in range(4)] + for th in ths: + th.start() + for th in ths: + th.join() + if not q.empty(): + errors = [] + while not q.empty(): + errors.append(q.get(False)) + _msg = "Error(s) occurred in delegated runner:\n%s" + raise RuntimeError(_msg % '\n'.join([repr(x) for x in errors])) + return run_compile + + +# workers +_thread_class = threading.Thread + + +class _proc_class_impl(object): + + def __init__(self, method): + self._method = method + + def __call__(self, *args, **kwargs): + ctx = multiprocessing.get_context(self._method) + return ctx.Process(*args, **kwargs) + + +def _get_mp_classes(method): + if method == 'default': + method = None + ctx = multiprocessing.get_context(method) + proc = _proc_class_impl(method) + queue = ctx.Queue + return proc, queue + + +thread_impl = compile_factory(_thread_class, t_queue.Queue) +spawn_proc_impl = compile_factory(*_get_mp_classes('spawn')) +if not _windows: + fork_proc_impl = compile_factory(*_get_mp_classes('fork')) + forkserver_proc_impl = compile_factory(*_get_mp_classes('forkserver')) + +# this is duplication as Py27, linux uses fork, windows uses spawn, it however +# is kept like this so that when tests fail it's less confusing! +default_proc_impl = compile_factory(*_get_mp_classes('default')) + + +class TestParallelBackendBase(TestCase): + """ + Base class for testing the parallel backends + """ + + all_impls = [ + jit_runner(nopython=True), + jit_runner(nopython=True, cache=True), + jit_runner(nopython=True, nogil=True), + linalg_runner(nopython=True), + linalg_runner(nopython=True, nogil=True), + vectorize_runner(nopython=True), + vectorize_runner(nopython=True, target='parallel'), + vectorize_runner(nopython=True, target='parallel', cache=True), + guvectorize_runner(nopython=True), + guvectorize_runner(nopython=True, target='parallel'), + guvectorize_runner(nopython=True, target='parallel', cache=True), + ] + + if not _parfors_unsupported: + parfor_impls = [ + jit_runner(nopython=True, parallel=True), + jit_runner(nopython=True, parallel=True, cache=True), + linalg_runner(nopython=True, parallel=True), + linalg_runner(nopython=True, parallel=True, cache=True), + ] + all_impls.extend(parfor_impls) + + if config.NUMBA_NUM_THREADS < 2: + # Not enough cores + masks = [] + else: + masks = [1, 2] + + mask_impls = [] + for impl in all_impls: + for mask in masks: + mask_impls.append(mask_runner(impl, mask)) + + parallelism = ['threading', 'random'] + parallelism.append('multiprocessing_spawn') + if _HAVE_OS_FORK: + parallelism.append('multiprocessing_fork') + parallelism.append('multiprocessing_forkserver') + + runners = { + 'concurrent_jit': [ + jit_runner(nopython=True, parallel=(not _parfors_unsupported)), + ], + 'concurrent_vectorize': [ + vectorize_runner(nopython=True, target='parallel'), + ], + 'concurrent_guvectorize': [ + guvectorize_runner(nopython=True, target='parallel'), + ], + 'concurrent_mix_use': all_impls, + 'concurrent_mix_use_masks': mask_impls, + } + + safe_backends = {'omp', 'tbb'} + + def run_compile(self, fnlist, parallelism='threading'): + self._cache_dir = temp_directory(self.__class__.__name__) + with override_config('CACHE_DIR', self._cache_dir): + if parallelism == 'threading': + thread_impl(fnlist) + elif parallelism == 'multiprocessing_fork': + fork_proc_impl(fnlist) + elif parallelism == 'multiprocessing_forkserver': + forkserver_proc_impl(fnlist) + elif parallelism == 'multiprocessing_spawn': + spawn_proc_impl(fnlist) + elif parallelism == 'multiprocessing_default': + default_proc_impl(fnlist) + elif parallelism == 'random': + ps = [thread_impl, spawn_proc_impl] + if _HAVE_OS_FORK: + ps.append(fork_proc_impl) + ps.append(forkserver_proc_impl) + + random.shuffle(ps) + for impl in ps: + impl(fnlist) + else: + raise ValueError( + 'Unknown parallelism supplied %s' % parallelism) + + +_specific_backends = config.THREADING_LAYER in ('omp', 'tbb', 'workqueue') + + +@unittest.skipUnless(_specific_backends, "Threading layer not explicit") +class TestParallelBackend(TestParallelBackendBase): + """ These are like the numba.tests.test_threadsafety tests but designed + instead to torture the parallel backend. + If a suitable backend is supplied via NUMBA_THREADING_LAYER these tests + can be run directly. This test class cannot be run using the multiprocessing + option to the test runner (i.e. `./runtests -m`) as daemon processes cannot + have children. + """ + + # NOTE: All tests are generated based on what a platform supports concurrent + # execution wise from Python, irrespective of whether the native libraries + # can actually handle the behaviour present. + @classmethod + def generate(cls): + for p in cls.parallelism: + for name, impl in cls.runners.items(): + methname = "test_" + p + '_' + name + + def methgen(impl, p): + def test_method(self): + selfproc = multiprocessing.current_process() + # daemonized processes cannot have children + if selfproc.daemon: + _msg = 'daemonized processes cannot have children' + self.skipTest(_msg) + else: + self.run_compile(impl, parallelism=p) + return test_method + fn = methgen(impl, p) + fn.__name__ = methname + setattr(cls, methname, fn) + + +TestParallelBackend.generate() + + +class TestInSubprocess(object): + backends = {'tbb': skip_no_tbb, + 'omp': skip_no_omp, + 'workqueue': unittest.skipIf(False, '')} + + def run_cmd(self, cmdline, env): + popen = subprocess.Popen(cmdline, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=env) + # finish in _TEST_TIMEOUT seconds or kill it + timeout = threading.Timer(_TEST_TIMEOUT, popen.kill) + try: + timeout.start() + out, err = popen.communicate() + if popen.returncode != 0: + raise AssertionError( + "process failed with code %s: stderr follows\n%s\n" % + (popen.returncode, err.decode())) + return out.decode(), err.decode() + finally: + timeout.cancel() + return None, None + + def run_test_in_separate_process(self, test, threading_layer): + env_copy = os.environ.copy() + env_copy['NUMBA_THREADING_LAYER'] = str(threading_layer) + cmdline = [sys.executable, "-m", "numba.runtests", test] + return self.run_cmd(cmdline, env_copy) + + +class TestSpecificBackend(TestInSubprocess, TestParallelBackendBase): + """ + This is quite contrived, for each test in the TestParallelBackend tests it + generates a test that will run the TestParallelBackend test in a new python + process with an environment modified to ensure a specific threadsafe backend + is used. This is with view of testing the backends independently and in an + isolated manner such that if they hang/crash/have issues, it doesn't kill + the test suite. + """ + _DEBUG = False + + @classmethod + def _inject(cls, p, name, backend, backend_guard): + themod = cls.__module__ + thecls = TestParallelBackend.__name__ + methname = "test_" + p + '_' + name + injected_method = '%s.%s.%s' % (themod, thecls, methname) + + def test_template(self): + o, e = self.run_test_in_separate_process(injected_method, backend) + if self._DEBUG: + print('stdout:\n "%s"\n stderr:\n "%s"' % (o, e)) + # If the test was skipped in the subprocess, then mark this as a + # skipped test. + m = re.search(r"\.\.\. skipped '(.*?)'", e) + if m is not None: + self.skipTest(m.group(1)) + self.assertIn('OK', e) + self.assertTrue('FAIL' not in e) + self.assertTrue('ERROR' not in e) + injected_test = "test_%s_%s_%s" % (p, name, backend) + # Mark as long_running + setattr(cls, injected_test, + tag('long_running')(backend_guard(test_template))) + + @classmethod + def generate(cls): + for backend, backend_guard in cls.backends.items(): + for p in cls.parallelism: + for name in cls.runners.keys(): + # handle known problem cases... + + # GNU OpenMP is not fork safe + if (p in ('multiprocessing_fork', 'random') and + backend == 'omp' and + sys.platform.startswith('linux')): + continue + + # workqueue is not thread safe + if (p in ('threading', 'random') and + backend == 'workqueue'): + continue + + cls._inject(p, name, backend, backend_guard) + + +TestSpecificBackend.generate() + + +class ThreadLayerTestHelper(TestCase): + """ + Helper class for running an isolated piece of code based on a template + """ + # sys path injection and separate usecase module to make sure everything + # is importable by children of multiprocessing + _here = "%r" % os.path.dirname(__file__) + + template = """if 1: + import sys + sys.path.insert(0, "%(here)r") + import multiprocessing + import numpy as np + from numba import njit + import numba + try: + import threading_backend_usecases + except ImportError as e: + print("DEBUG:", sys.path) + raise e + import os + + sigterm_handler = threading_backend_usecases.sigterm_handler + busy_func = threading_backend_usecases.busy_func + + def the_test(): + %%s + + if __name__ == "__main__": + the_test() + """ % {'here': _here} + + def run_cmd(self, cmdline, env=None): + if env is None: + env = os.environ.copy() + env['NUMBA_THREADING_LAYER'] = str("omp") + popen = subprocess.Popen(cmdline, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=env) + # finish in _TEST_TIMEOUT seconds or kill it + timeout = threading.Timer(_TEST_TIMEOUT, popen.kill) + try: + timeout.start() + out, err = popen.communicate() + if popen.returncode != 0: + raise AssertionError( + "process failed with code %s: stderr follows\n%s\n" % + (popen.returncode, err.decode())) + finally: + timeout.cancel() + return out.decode(), err.decode() + + +@skip_parfors_unsupported +class TestThreadingLayerSelection(ThreadLayerTestHelper): + """ + Checks that numba.threading_layer() reports correctly. + """ + _DEBUG = False + + backends = {'tbb': skip_no_tbb, + 'omp': skip_no_omp, + 'workqueue': unittest.skipIf(False, '')} + + @classmethod + def _inject(cls, backend, backend_guard): + + def test_template(self): + body = """if 1: + X = np.arange(1000000.) + Y = np.arange(1000000.) + Z = busy_func(X, Y) + assert numba.threading_layer() == '%s' + """ + runme = self.template % (body % backend) + cmdline = [sys.executable, '-c', runme] + env = os.environ.copy() + env['NUMBA_THREADING_LAYER'] = str(backend) + out, err = self.run_cmd(cmdline, env=env) + if self._DEBUG: + print(out, err) + injected_test = "test_threading_layer_selector_%s" % backend + setattr(cls, injected_test, + tag("important")(backend_guard(test_template))) + + @classmethod + def generate(cls): + for backend, backend_guard in cls.backends.items(): + cls._inject(backend, backend_guard) + + +TestThreadingLayerSelection.generate() + + +@skip_parfors_unsupported +class TestThreadingLayerPriority(ThreadLayerTestHelper): + + def each_env_var(self, env_var: str): + """Test setting priority via env var NUMBA_THREADING_LAYER_PRIORITY. + """ + env = os.environ.copy() + env['NUMBA_THREADING_LAYER'] = 'default' + env['NUMBA_THREADING_LAYER_PRIORITY'] = env_var + + code = f""" + import numba + + # trigger threading layer decision + # hence catching invalid THREADING_LAYER_PRIORITY + @numba.jit( + 'float64[::1](float64[::1], float64[::1])', + nopython=True, + parallel=True, + ) + def plus(x, y): + return x + y + + captured_envvar = list("{env_var}".split()) + assert numba.config.THREADING_LAYER_PRIORITY == \ + captured_envvar, "priority mismatch" + assert numba.threading_layer() == captured_envvar[0],\ + "selected backend mismatch" + """ + cmd = [ + sys.executable, + '-c', + textwrap.dedent(code), + ] + self.run_cmd(cmd, env=env) + + @skip_no_omp + @skip_no_tbb + def test_valid_env_var(self): + default = ['tbb', 'omp', 'workqueue'] + for p in itertools.permutations(default): + env_var = ' '.join(p) + self.each_env_var(env_var) + + @skip_no_omp + @skip_no_tbb + def test_invalid_env_var(self): + env_var = 'tbb omp workqueue notvalidhere' + with self.assertRaises(AssertionError) as raises: + self.each_env_var(env_var) + for msg in ( + "THREADING_LAYER_PRIORITY invalid:", + "It must be a permutation of" + ): + self.assertIn(f"{msg}", str(raises.exception)) + + @skip_no_omp + def test_omp(self): + for env_var in ("omp tbb workqueue", "omp workqueue tbb"): + self.each_env_var(env_var) + + @skip_no_tbb + def test_tbb(self): + for env_var in ("tbb omp workqueue", "tbb workqueue omp"): + self.each_env_var(env_var) + + def test_workqueue(self): + for env_var in ("workqueue tbb omp", "workqueue omp tbb"): + self.each_env_var(env_var) + + +@skip_parfors_unsupported +class TestMiscBackendIssues(ThreadLayerTestHelper): + """ + Checks fixes for the issues with threading backends implementation + """ + _DEBUG = False + + @skip_no_omp + def test_omp_stack_overflow(self): + """ + Tests that OMP does not overflow stack + """ + runme = """if 1: + from numba import vectorize, threading_layer + import numpy as np + + @vectorize(['f4(f4,f4,f4,f4,f4,f4,f4,f4)'], target='parallel') + def foo(a, b, c, d, e, f, g, h): + return a+b+c+d+e+f+g+h + + x = np.ones(2**20, np.float32) + foo(*([x]*8)) + assert threading_layer() == "omp", "omp not found" + """ + cmdline = [sys.executable, '-c', runme] + env = os.environ.copy() + env['NUMBA_THREADING_LAYER'] = "omp" + env['OMP_STACKSIZE'] = "100K" + self.run_cmd(cmdline, env=env) + + @skip_no_tbb + def test_single_thread_tbb(self): + """ + Tests that TBB works well with single thread + https://github.com/numba/numba/issues/3440 + """ + runme = """if 1: + from numba import njit, prange, threading_layer + + @njit(parallel=True) + def foo(n): + acc = 0 + for i in prange(n): + acc += i + return acc + + foo(100) + assert threading_layer() == "tbb", "tbb not found" + """ + cmdline = [sys.executable, '-c', runme] + env = os.environ.copy() + env['NUMBA_THREADING_LAYER'] = "tbb" + env['NUMBA_NUM_THREADS'] = "1" + self.run_cmd(cmdline, env=env) + + def test_workqueue_aborts_on_nested_parallelism(self): + """ + Tests workqueue raises sigabrt if a nested parallel call is performed + """ + runme = """if 1: + from numba import njit, prange + import numpy as np + + @njit(parallel=True) + def nested(x): + for i in prange(len(x)): + x[i] += 1 + + + @njit(parallel=True) + def main(): + Z = np.zeros((5, 10)) + for i in prange(Z.shape[0]): + nested(Z[i]) + return Z + + main() + """ + cmdline = [sys.executable, '-c', runme] + env = os.environ.copy() + env['NUMBA_THREADING_LAYER'] = "workqueue" + env['NUMBA_NUM_THREADS'] = "4" + + try: + out, err = self.run_cmd(cmdline, env=env) + except AssertionError as e: + if self._DEBUG: + print(out, err) + e_msg = str(e) + self.assertIn("failed with code", e_msg) + # raised a SIGABRT, but the value is platform specific so just check + # the error message + expected = ("Numba workqueue threading layer is terminating: " + "Concurrent access has been detected.") + self.assertIn(expected, e_msg) + + @unittest.skipUnless(_HAVE_OS_FORK, "Test needs fork(2)") + def test_workqueue_handles_fork_from_non_main_thread(self): + # For context see #7872, but essentially the multiprocessing pool + # implementation has a number of Python threads for handling the worker + # processes, one of which calls fork(2), this results in a fork from a + # non-main thread. + + runme = """if 1: + from numba import njit, prange, threading_layer + import numpy as np + import multiprocessing + + if __name__ == "__main__": + # Need for force fork context (OSX default is "spawn") + multiprocessing.set_start_method('fork') + + @njit(parallel=True) + def func(x): + return 10. * x + + arr = np.arange(2.) + + # run in single process to start Numba's thread pool + np.testing.assert_allclose(func(arr), func.py_func(arr)) + + # now run in a multiprocessing pool to get a fork from a + # non-main thread + with multiprocessing.Pool(10) as p: + result = p.map(func, [arr]) + np.testing.assert_allclose(result, + func.py_func(np.expand_dims(arr, 0))) + + assert threading_layer() == "workqueue" + """ + cmdline = [sys.executable, '-c', runme] + env = os.environ.copy() + env['NUMBA_THREADING_LAYER'] = "workqueue" + env['NUMBA_NUM_THREADS'] = "4" + + self.run_cmd(cmdline, env=env) + + +# 32bit or windows py27 (not that this runs on windows) +@skip_parfors_unsupported +@skip_unless_gnu_omp +class TestForkSafetyIssues(ThreadLayerTestHelper): + """ + Checks Numba's behaviour in various situations involving GNU OpenMP and fork + """ + _DEBUG = False + + def test_check_threading_layer_is_gnu(self): + runme = """if 1: + from numba.np.ufunc import omppool + assert omppool.openmp_vendor == 'GNU' + """ + cmdline = [sys.executable, '-c', runme] + out, err = self.run_cmd(cmdline) + + def test_par_parent_os_fork_par_child(self): + """ + Whilst normally valid, this actually isn't for Numba invariant of OpenMP + Checks SIGABRT is received. + """ + body = """if 1: + X = np.arange(1000000.) + Y = np.arange(1000000.) + Z = busy_func(X, Y) + pid = os.fork() + if pid == 0: + Z = busy_func(X, Y) + else: + os.wait() + """ + runme = self.template % body + cmdline = [sys.executable, '-c', runme] + try: + out, err = self.run_cmd(cmdline) + except AssertionError as e: + self.assertIn("failed with code -6", str(e)) + + def test_par_parent_implicit_mp_fork_par_child(self): + """ + Implicit use of multiprocessing fork context. + Does this: + 1. Start with OpenMP + 2. Fork to processes using OpenMP (this is invalid) + 3. Joins fork + 4. Check the exception pushed onto the queue that is a result of + catching SIGTERM coming from the C++ aborting on illegal fork + pattern for GNU OpenMP + """ + body = """if 1: + mp = multiprocessing.get_context('fork') + X = np.arange(1000000.) + Y = np.arange(1000000.) + q = mp.Queue() + + # Start OpenMP runtime on parent via parallel function + Z = busy_func(X, Y, q) + + # fork() underneath with no exec, will abort + proc = mp.Process(target = busy_func, args=(X, Y, q)) + proc.start() + + err = q.get() + assert "Caught SIGTERM" in str(err) + """ + runme = self.template % body + cmdline = [sys.executable, '-c', runme] + out, err = self.run_cmd(cmdline) + if self._DEBUG: + print(out, err) + + @linux_only + def test_par_parent_explicit_mp_fork_par_child(self): + """ + Explicit use of multiprocessing fork context. + Does this: + 1. Start with OpenMP + 2. Fork to processes using OpenMP (this is invalid) + 3. Joins fork + 4. Check the exception pushed onto the queue that is a result of + catching SIGTERM coming from the C++ aborting on illegal fork + pattern for GNU OpenMP + """ + body = """if 1: + X = np.arange(1000000.) + Y = np.arange(1000000.) + ctx = multiprocessing.get_context('fork') + q = ctx.Queue() + + # Start OpenMP runtime on parent via parallel function + Z = busy_func(X, Y, q) + + # fork() underneath with no exec, will abort + proc = ctx.Process(target = busy_func, args=(X, Y, q)) + proc.start() + proc.join() + + err = q.get() + assert "Caught SIGTERM" in str(err) + """ + runme = self.template % body + cmdline = [sys.executable, '-c', runme] + out, err = self.run_cmd(cmdline) + if self._DEBUG: + print(out, err) + + def test_par_parent_mp_spawn_par_child_par_parent(self): + """ + Explicit use of multiprocessing spawn, this is safe. + Does this: + 1. Start with OpenMP + 2. Spawn to processes using OpenMP + 3. Join spawns + 4. Run some more OpenMP + """ + body = """if 1: + X = np.arange(1000000.) + Y = np.arange(1000000.) + ctx = multiprocessing.get_context('spawn') + q = ctx.Queue() + + # Start OpenMP runtime and run on parent via parallel function + Z = busy_func(X, Y, q) + procs = [] + for x in range(20): # start a lot to try and get overlap + ## fork() + exec() to run some OpenMP on children + proc = ctx.Process(target = busy_func, args=(X, Y, q)) + procs.append(proc) + sys.stdout.flush() + sys.stderr.flush() + proc.start() + + [p.join() for p in procs] + + try: + q.get(False) + except multiprocessing.queues.Empty: + pass + else: + raise RuntimeError("Queue was not empty") + + # Run some more OpenMP on parent + Z = busy_func(X, Y, q) + """ + runme = self.template % body + cmdline = [sys.executable, '-c', runme] + out, err = self.run_cmd(cmdline) + if self._DEBUG: + print(out, err) + + def test_serial_parent_implicit_mp_fork_par_child_then_par_parent(self): + """ + Implicit use of multiprocessing (will be fork, but cannot declare that + in Py2.7 as there's no process launch context). + Does this: + 1. Start with no OpenMP + 2. Fork to processes using OpenMP + 3. Join forks + 4. Run some OpenMP + """ + body = """if 1: + X = np.arange(1000000.) + Y = np.arange(1000000.) + q = multiprocessing.Queue() + + # this is ok + procs = [] + for x in range(10): + # fork() underneath with but no OpenMP in parent, this is ok + proc = multiprocessing.Process(target = busy_func, + args=(X, Y, q)) + procs.append(proc) + proc.start() + + [p.join() for p in procs] + + # and this is still ok as the OpenMP happened in forks + Z = busy_func(X, Y, q) + try: + q.get(False) + except multiprocessing.queues.Empty: + pass + else: + raise RuntimeError("Queue was not empty") + """ + runme = self.template % body + cmdline = [sys.executable, '-c', runme] + out, err = self.run_cmd(cmdline) + if self._DEBUG: + print(out, err) + + @linux_only + def test_serial_parent_explicit_mp_fork_par_child_then_par_parent(self): + """ + Explicit use of multiprocessing 'fork'. + Does this: + 1. Start with no OpenMP + 2. Fork to processes using OpenMP + 3. Join forks + 4. Run some OpenMP + """ + body = """if 1: + X = np.arange(1000000.) + Y = np.arange(1000000.) + ctx = multiprocessing.get_context('fork') + q = ctx.Queue() + + # this is ok + procs = [] + for x in range(10): + # fork() underneath with but no OpenMP in parent, this is ok + proc = ctx.Process(target = busy_func, args=(X, Y, q)) + procs.append(proc) + proc.start() + + [p.join() for p in procs] + + # and this is still ok as the OpenMP happened in forks + Z = busy_func(X, Y, q) + try: + q.get(False) + except multiprocessing.queues.Empty: + pass + else: + raise RuntimeError("Queue was not empty") + """ + runme = self.template % body + cmdline = [sys.executable, '-c', runme] + out, err = self.run_cmd(cmdline) + if self._DEBUG: + print(out, err) + + +@skip_parfors_unsupported +@skip_no_tbb +class TestTBBSpecificIssues(ThreadLayerTestHelper): + + _DEBUG = False + + @linux_only # os.fork required. + def test_fork_from_non_main_thread(self): + # See issue #5973 and PR #6208 for original context. + # See issue #6963 for context on the following comments: + # + # Important things to note: + # 1. Compilation of code containing an objmode block will result in the + # use of and `ObjModeLiftedWith` as the dispatcher. This inherits + # from `LiftedCode` which handles the serialization. In that + # serialization is a call to uuid.uuid1() which causes a fork_exec in + # CPython internals. + # 2. The selected parallel backend thread pool is started during the + # compilation of a function that has `parallel=True`. + # 3. The TBB backend can handle forks from the main thread, it will + # safely reinitialise after so doing. If a fork occurs from a + # non-main thread it will warn and the state is invalid in the child + # process. + # + # Due to 1. and 2. the `obj_mode_func` function separated out and is + # `njit` decorated. This means during type inference of `work` it will + # trigger a standard compilation of the function and the thread pools + # won't have started yet as the parallelisation compiler passes for + # `work` won't yet have run. This mitigates the fork() call from 1. + # occurring after 2. The result of this is that 3. can be tested using + # the threading etc herein with the state being known as the above + # described, i.e. the TBB threading layer has not experienced a fork(). + + runme = """if 1: + import threading + import numba + numba.config.THREADING_LAYER='tbb' + from numba import njit, prange, objmode + from numba.core.serialize import PickleCallableByPath + import os + + e_running = threading.Event() + e_proceed = threading.Event() + + def indirect_core(): + e_running.set() + # wait for forker() to have forked + while not e_proceed.isSet(): + pass + + indirect = PickleCallableByPath(indirect_core) + + @njit + def obj_mode_func(): + with objmode(): + indirect() + + @njit(parallel=True, nogil=True) + def work(): + acc = 0 + for x in prange(10): + acc += x + obj_mode_func() + return acc + + def runner(): + work() + + def forker(): + # wait for the jit function to say it's running + while not e_running.isSet(): + pass + # then fork + os.fork() + # now fork is done signal the runner to proceed to exit + e_proceed.set() + + numba_runner = threading.Thread(target=runner,) + fork_runner = threading.Thread(target=forker,) + + threads = (numba_runner, fork_runner) + for t in threads: + t.start() + for t in threads: + t.join() + """ + + cmdline = [sys.executable, '-c', runme] + out, err = self.run_cmd(cmdline) + # assert error message printed on stderr + msg_head = "Attempted to fork from a non-main thread, the TBB library" + self.assertIn(msg_head, err) + + if self._DEBUG: + print("OUT:", out) + print("ERR:", err) + + @linux_only # fork required. + def test_lifetime_of_task_scheduler_handle(self): + + self.skip_if_no_external_compiler() # external compiler needed + + # See PR #7280 for context. + BROKEN_COMPILERS = 'SKIP: COMPILATION FAILED' + runme = """if 1: + import ctypes + import sys + import multiprocessing as mp + from tempfile import TemporaryDirectory, NamedTemporaryFile + from numba.pycc.platform import Toolchain, external_compiler_works + from numba import njit, prange, threading_layer + import faulthandler + faulthandler.enable() + if not external_compiler_works(): + raise AssertionError('External compilers are not found.') + with TemporaryDirectory() as tmpdir: + with NamedTemporaryFile(dir=tmpdir) as tmpfile: + try: + src = \"\"\" + #define TBB_PREVIEW_WAITING_FOR_WORKERS 1 + #include + static tbb::task_scheduler_handle tsh; + extern "C" + { + void launch(void) + { + tsh = tbb::task_scheduler_handle::get(); + } + } + \"\"\" + cxxfile = f"{tmpfile.name}.cxx" + with open(cxxfile, 'wt') as f: + f.write(src) + tc = Toolchain() + object_files = tc.compile_objects([cxxfile,], + output_dir=tmpdir) + dso_name = f"{tmpfile.name}.so" + tc.link_shared(dso_name, object_files, + libraries=['tbb',], + export_symbols=['launch']) + # Load into the process, it doesn't matter whether the + # DSO exists on disk once it's loaded in. + DLL = ctypes.CDLL(dso_name) + except Exception as e: + # Something is broken in compilation, could be one of + # many things including, but not limited to: missing tbb + # headers, incorrect permissions, compilers that don't + # work for the above + print(e) + print('BROKEN_COMPILERS') + sys.exit(0) + + # Do the test, launch this library and also execute a + # function with the TBB threading layer. + + DLL.launch() + + @njit(parallel=True) + def foo(n): + acc = 0 + for i in prange(n): + acc += i + return acc + + foo(1) + + # Check the threading layer used was TBB + assert threading_layer() == 'tbb' + + # Use mp context for a controlled version of fork, this triggers the + # reported bug. + + ctx = mp.get_context('fork') + def nowork(): + pass + p = ctx.Process(target=nowork) + p.start() + p.join(10) + print("SUCCESS") + """.replace('BROKEN_COMPILERS', BROKEN_COMPILERS) + + cmdline = [sys.executable, '-c', runme] + env = os.environ.copy() + env['NUMBA_THREADING_LAYER'] = 'tbb' + out, err = self.run_cmd(cmdline, env=env) + + if BROKEN_COMPILERS in out: + self.skipTest("Compilation of DSO failed. Check output for details") + else: + self.assertIn("SUCCESS", out) + + if self._DEBUG: + print("OUT:", out) + print("ERR:", err) + + +@skip_parfors_unsupported +class TestInitSafetyIssues(TestCase): + + _DEBUG = False + + def run_cmd(self, cmdline): + popen = subprocess.Popen(cmdline, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE,) + # finish in _TEST_TIMEOUT seconds or kill it + timeout = threading.Timer(_TEST_TIMEOUT, popen.kill) + try: + timeout.start() + out, err = popen.communicate() + if popen.returncode != 0: + raise AssertionError( + "process failed with code %s: stderr follows\n%s\n" % + (popen.returncode, err.decode())) + finally: + timeout.cancel() + return out.decode(), err.decode() + + @linux_only # only linux can leak semaphores + def test_orphaned_semaphore(self): + # sys path injection and separate usecase module to make sure everything + # is importable by children of multiprocessing + + test_file = os.path.join(os.path.dirname(__file__), + "orphaned_semaphore_usecase.py") + cmdline = [sys.executable, test_file] + out, err = self.run_cmd(cmdline) + + # assert no semaphore leaks reported on stderr + self.assertNotIn("leaked semaphore", err) + + if self._DEBUG: + print("OUT:", out) + print("ERR:", err) + + def test_lazy_lock_init(self): + # checks based on https://github.com/numba/numba/pull/5724 + # looking for "lazy" process lock initialisation so as to avoid setting + # a multiprocessing context as part of import. + for meth in ('fork', 'spawn', 'forkserver'): + # if a context is available on the host check it can be set as the + # start method in a separate process + try: + multiprocessing.get_context(meth) + except ValueError: + continue + cmd = ("import numba; import multiprocessing;" + "multiprocessing.set_start_method('{}');" + "print(multiprocessing.get_context().get_start_method())") + cmdline = [sys.executable, "-c", cmd.format(meth)] + out, err = self.run_cmd(cmdline) + if self._DEBUG: + print("OUT:", out) + print("ERR:", err) + self.assertIn(meth, out) + + +@skip_parfors_unsupported +@skip_no_omp +class TestOpenMPVendors(TestCase): + + def test_vendors(self): + """ + Checks the OpenMP vendor strings are correct + """ + expected = dict() + expected['win32'] = "MS" + expected['darwin'] = "Intel" + expected['linux'] = "GNU" + + # only check OS that are supported, custom toolchains may well work as + # may other OS + for k in expected.keys(): + if sys.platform.startswith(k): + self.assertEqual(expected[k], omppool.openmp_vendor) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parfors.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parfors.py new file mode 100644 index 0000000000000000000000000000000000000000..4233ad69ecfa2eb2d0edcf0d2b09abe19669de97 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parfors.py @@ -0,0 +1,4969 @@ +# +# Copyright (c) 2017 Intel Corporation +# SPDX-License-Identifier: BSD-2-Clause +# + + +import math +import os +import re +import dis +import numbers +import platform +import sys +import subprocess +import types as pytypes +import warnings +from functools import reduce +import numpy as np +from numpy.random import randn +import operator +from collections import defaultdict, namedtuple +import copy +from itertools import cycle, chain +import subprocess as subp + +import numba.parfors.parfor +from numba import (njit, prange, parallel_chunksize, + get_parallel_chunksize, set_parallel_chunksize, + set_num_threads, get_num_threads, typeof) +from numba.core import (types, errors, ir, rewrites, + typed_passes, inline_closurecall, config, compiler, cpu) +from numba.typed import Dict, List + +from numba.extending import (overload_method, register_model, + typeof_impl, unbox, NativeValue, models) +from numba.core.registry import cpu_target +from numba.core.annotations import type_annotations +from numba.core.ir_utils import (find_callname, guard, build_definitions, + get_definition, is_getitem, is_setitem, + index_var_of_get_setitem) +from numba.np.unsafe.ndarray import empty_inferred as unsafe_empty +from numba.core.compiler import (CompilerBase, DefaultPassBuilder) +from numba.core.compiler_machinery import register_pass, AnalysisPass +from numba.core.typed_passes import IRLegalization +from numba.tests.support import (TestCase, captured_stdout, MemoryLeakMixin, + override_env_config, linux_only, tag, + skip_parfors_unsupported, _32bit, needs_blas, + needs_lapack, disabled_test, skip_unless_scipy, + needs_subprocess, + skip_ppc64le_invalid_ctr_loop) +from numba.core.extending import register_jitable +from numba.core.bytecode import _fix_LOAD_GLOBAL_arg +from numba.core import utils + +import cmath +import unittest + +# NOTE: Each parfors test class is run in separate subprocess, this is to reduce +# memory pressure in CI settings. The environment variable "SUBPROC_TEST" is +# used to determine whether a test is skipped or not, such that if you want to +# run any parfors test directly this environment variable can be set. The +# subprocesses running the test classes set this environment variable as the new +# process starts which enables the tests within the process. The decorator +# @needs_subprocess is used to ensure the appropriate test skips are made. + + +@skip_parfors_unsupported +class TestParforsRunner(TestCase): + + _numba_parallel_test_ = False + + # Each test class can run for 30 minutes before time out. Extend this to an + # hour on aarch64 (some public CI systems were timing out). + _TIMEOUT = 1800 if platform.machine() != 'aarch64' else 3600 + + """This is the test runner for all the parfors tests, it runs them in + subprocesses as described above. The convention for the test method naming + is: `test_` where is the name of the test class in + this module. + """ + def runner(self): + themod = self.__module__ + test_clazz_name = self.id().split('.')[-1].split('_')[-1] + # don't specify a given test, it's an entire class that needs running + self.subprocess_test_runner(test_module=themod, + test_class=test_clazz_name, + timeout=self._TIMEOUT) + + def test_TestParforBasic(self): + self.runner() + + def test_TestParforNumericalMisc(self): + self.runner() + + def test_TestParforNumPy(self): + self.runner() + + def test_TestParfors(self): + self.runner() + + def test_TestParforsBitMask(self): + self.runner() + + def test_TestParforsDiagnostics(self): + self.runner() + + def test_TestParforsLeaks(self): + self.runner() + + def test_TestParforsMisc(self): + self.runner() + + def test_TestParforsOptions(self): + self.runner() + + def test_TestParforsSlice(self): + self.runner() + + def test_TestParforsVectorizer(self): + self.runner() + + def test_TestPrangeBasic(self): + self.runner() + + def test_TestPrangeSpecific(self): + self.runner() + + +x86_only = unittest.skipIf(platform.machine() not in ('i386', 'x86_64'), 'x86 only test') + +_GLOBAL_INT_FOR_TESTING1 = 17 +_GLOBAL_INT_FOR_TESTING2 = 5 + +TestNamedTuple = namedtuple('TestNamedTuple', ('part0', 'part1')) + + +def null_comparer(a, b): + """ + Used with check_arq_equality to indicate that we do not care + whether the value of the parameter at the end of the function + has a particular value. + """ + pass + + +@needs_subprocess +class TestParforsBase(TestCase): + """ + Base class for testing parfors. + Provides functions for compilation and three way comparison between + python functions, njit'd functions and parfor njit'd functions. + """ + + _numba_parallel_test_ = False + + def _compile_this(self, func, sig, **flags): + # This method originally used `compile_isolated` which returns a + # "CompileResult", hence this does the same. + return njit(sig, **flags)(func).overloads[sig] + + def compile_parallel(self, func, sig): + return self._compile_this(func, sig, parallel=True) + + def compile_parallel_fastmath(self, func, sig): + return self._compile_this(func, sig, parallel=True, fastmath=True) + + def compile_njit(self, func, sig): + return self._compile_this(func, sig) + + def compile_all(self, pyfunc, *args, **kwargs): + sig = tuple([numba.typeof(x) for x in args]) + + # compile the prange injected function + cpfunc = self.compile_parallel(pyfunc, sig) + + # compile a standard njit of the original function + cfunc = self.compile_njit(pyfunc, sig) + + return cfunc, cpfunc + + def check_parfors_vs_others(self, pyfunc, cfunc, cpfunc, *args, **kwargs): + """ + Checks python, njit and parfor impls produce the same result. + + Arguments: + pyfunc - the python function to test + cfunc - CompilerResult from njit of pyfunc + cpfunc - CompilerResult from njit(parallel=True) of pyfunc + args - arguments for the function being tested + Keyword Arguments: + scheduler_type - 'signed', 'unsigned' or None, default is None. + Supply in cases where the presence of a specific + scheduler is to be asserted. + fastmath_pcres - a fastmath parallel compile result, if supplied + will be run to make sure the result is correct + check_arg_equality - some functions need to check that a + parameter is modified rather than a certain + value returned. If this keyword argument + is supplied, it should be a list of + comparison functions such that the i'th + function in the list is used to compare the + i'th parameter of the njit and parallel=True + functions against the i'th parameter of the + standard Python function, asserting if they + differ. The length of this list must be equal + to the number of parameters to the function. + The null comparator is available for use + when you do not desire to test if some + particular parameter is changed. + Remaining kwargs are passed to np.testing.assert_almost_equal + """ + scheduler_type = kwargs.pop('scheduler_type', None) + check_fastmath = kwargs.pop('check_fastmath', None) + fastmath_pcres = kwargs.pop('fastmath_pcres', None) + check_scheduling = kwargs.pop('check_scheduling', True) + check_args_for_equality = kwargs.pop('check_arg_equality', None) + + def copy_args(*args): + if not args: + return tuple() + new_args = [] + for x in args: + if isinstance(x, np.ndarray): + new_args.append(x.copy('k')) + elif isinstance(x, np.number): + new_args.append(x.copy()) + elif isinstance(x, numbers.Number): + new_args.append(x) + elif x is None: + new_args.append(x) + elif isinstance(x, tuple): + new_args.append(copy.deepcopy(x)) + elif isinstance(x, list): + new_args.append(x[:]) + elif isinstance(x, Dict): + new_args.append(copy.copy(x)) + elif isinstance(x, List): + new_args.append(copy.copy(x)) + else: + raise ValueError('Unsupported argument type encountered') + return tuple(new_args) + + # python result + py_args = copy_args(*args) + py_expected = pyfunc(*py_args) + + # njit result + njit_args = copy_args(*args) + njit_output = cfunc.entry_point(*njit_args) + + # parfor result + parfor_args = copy_args(*args) + parfor_output = cpfunc.entry_point(*parfor_args) + + if check_args_for_equality is None: + np.testing.assert_almost_equal(njit_output, py_expected, **kwargs) + np.testing.assert_almost_equal(parfor_output, py_expected, **kwargs) + self.assertEqual(type(njit_output), type(parfor_output)) + else: + assert(len(py_args) == len(check_args_for_equality)) + for pyarg, njitarg, parforarg, argcomp in zip( + py_args, njit_args, parfor_args, check_args_for_equality): + argcomp(njitarg, pyarg, **kwargs) + argcomp(parforarg, pyarg, **kwargs) + + if check_scheduling: + self.check_scheduling(cpfunc, scheduler_type) + + # if requested check fastmath variant + if fastmath_pcres is not None: + parfor_fastmath_output = fastmath_pcres.entry_point(*copy_args(*args)) + np.testing.assert_almost_equal(parfor_fastmath_output, py_expected, + **kwargs) + + def check(self, pyfunc, *args, **kwargs): + """Checks that pyfunc compiles for *args under parallel=True and njit + and asserts that all version execute and produce the same result""" + cfunc, cpfunc = self.compile_all(pyfunc, *args) + self.check_parfors_vs_others(pyfunc, cfunc, cpfunc, *args, **kwargs) + + def check_variants(self, impl, arg_gen, **kwargs): + """Run self.check(impl, ...) on array data generated from arg_gen. + """ + for args in arg_gen(): + with self.subTest(list(map(typeof, args))): + self.check(impl, *args, **kwargs) + + def count_parfors_variants(self, impl, arg_gen, **kwargs): + """Run self.countParfors(impl, ...) on array types generated from + arg_gen. + """ + for args in arg_gen(): + with self.subTest(list(map(typeof, args))): + argtys = tuple(map(typeof, args)) + # At least one parfors + self.assertGreaterEqual(countParfors(impl, argtys), 1) + + def check_scheduling(self, cres, scheduler_type): + # make sure parfor set up scheduling + scheduler_str = '@do_scheduling' + if scheduler_type is not None: + if scheduler_type in ['signed', 'unsigned']: + scheduler_str += '_' + scheduler_type + else: + msg = "Unknown scheduler_type specified: %s" + raise ValueError(msg % scheduler_type) + + self.assertIn(scheduler_str, cres.library.get_llvm_str()) + + def gen_linspace(self, n, ct): + """Make *ct* sample 1D arrays of length *n* using np.linspace(). + """ + def gen(): + yield np.linspace(0, 1, n) + yield np.linspace(2, 1, n) + yield np.linspace(1, 2, n) + + src = cycle(gen()) + return [next(src) for i in range(ct)] + + def gen_linspace_variants(self, ct): + """Make 1D, 2D, 3D variants of the data in C and F orders + """ + # 1D + yield self.gen_linspace(10, ct=ct) + + # 2D + arr2ds = [x.reshape((2, 3)) + for x in self.gen_linspace(n=2 * 3, ct=ct)] + yield arr2ds + # Fortran order + yield [np.asfortranarray(x) for x in arr2ds] + + # 3D + arr3ds = [x.reshape((2, 3, 4)) + for x in self.gen_linspace(n=2 * 3 * 4, ct=ct)] + yield arr3ds + # Fortran order + yield [np.asfortranarray(x) for x in arr3ds] + + def _filter_mod(self, mod, magicstr, checkstr=None): + """ helper function to filter out modules by name""" + filt = [x for x in mod if magicstr in x.name] + if checkstr is not None: + for x in filt: + assert checkstr in str(x) + return filt + + def _get_gufunc_modules(self, cres, magicstr, checkstr=None): + """ gets the gufunc LLVM Modules""" + _modules = [x for x in cres.library._codegen._engine._ee._modules] + # make sure to only use modules that are actually used by cres and + # aren't just in the EE by virtue of shared compilation context. + potential_matches = self._filter_mod(_modules, magicstr, + checkstr=checkstr) + + lib_asm = cres.library.get_asm_str() + ret = [] + for mod in potential_matches: + if mod.name in lib_asm: + ret.append(mod) + return ret + + def _get_gufunc_info(self, cres, fn): + """ helper for gufunc IR/asm generation""" + # get the gufunc modules + magicstr = '__numba_parfor_gufunc' + gufunc_mods = self._get_gufunc_modules(cres, magicstr) + x = dict() + for mod in gufunc_mods: + x[mod.name] = fn(mod) + return x + + def _get_gufunc_ir(self, cres): + """ + Returns the IR of the gufuncs used as parfor kernels + as a dict mapping the gufunc name to its IR. + + Arguments: + cres - a CompileResult from `njit(parallel=True, ...)` + """ + return self._get_gufunc_info(cres, str) + + def _get_gufunc_asm(self, cres): + """ + Returns the assembly of the gufuncs used as parfor kernels + as a dict mapping the gufunc name to its assembly. + + Arguments: + cres - a CompileResult from `njit(parallel=True, ...)` + """ + tm = cres.library._codegen._tm + def emit_asm(mod): + return str(tm.emit_assembly(mod)) + return self._get_gufunc_info(cres, emit_asm) + + def assert_fastmath(self, pyfunc, sig): + """ + Asserts that the fastmath flag has some effect in that suitable + instructions are now labelled as `fast`. Whether LLVM can actually do + anything to optimise better now the derestrictions are supplied is + another matter! + + Arguments: + pyfunc - a function that contains operations with parallel semantics + sig - the type signature of pyfunc + """ + + cres = self.compile_parallel_fastmath(pyfunc, sig) + _ir = self._get_gufunc_ir(cres) + + def _get_fast_instructions(ir): + splitted = ir.splitlines() + fast_inst = [] + for x in splitted: + m = re.search(r'\bfast\b', x) # \b for wholeword + if m is not None: + fast_inst.append(x) + return fast_inst + + def _assert_fast(instrs): + ops = ('fadd', 'fsub', 'fmul', 'fdiv', 'frem', 'fcmp', 'call') + for inst in instrs: + count = 0 + for op in ops: + match = op + ' fast' + if match in inst: + count += 1 + self.assertTrue(count > 0) + + for name, guir in _ir.items(): + inst = _get_fast_instructions(guir) + _assert_fast(inst) + + +def blackscholes_impl(sptprice, strike, rate, volatility, timev): + # blackscholes example + logterm = np.log(sptprice / strike) + powterm = 0.5 * volatility * volatility + den = volatility * np.sqrt(timev) + d1 = (((rate + powterm) * timev) + logterm) / den + d2 = d1 - den + NofXd1 = 0.5 + 0.5 * 2.0 * d1 + NofXd2 = 0.5 + 0.5 * 2.0 * d2 + futureValue = strike * np.exp(- rate * timev) + c1 = futureValue * NofXd2 + call = sptprice * NofXd1 - c1 + put = call - futureValue + sptprice + return put + + +def lr_impl(Y, X, w, iterations): + # logistic regression example + for i in range(iterations): + w -= np.dot(((1.0 / (1.0 + np.exp(-Y * np.dot(X, w))) - 1.0) * Y), X) + return w + +def example_kmeans_test(A, numCenter, numIter, init_centroids): + centroids = init_centroids + N, D = A.shape + + for l in range(numIter): + dist = np.array([[math.sqrt(np.sum((A[i,:]-centroids[j,:])**2)) + for j in range(numCenter)] for i in range(N)]) + labels = np.array([dist[i,:].argmin() for i in range(N)]) + + centroids = np.array([[np.sum(A[labels==i, j])/np.sum(labels==i) + for j in range(D)] for i in range(numCenter)]) + + return centroids + +def get_optimized_numba_ir(test_func, args, **kws): + typingctx = cpu_target.typing_context + targetctx = cpu_target.target_context + test_ir = compiler.run_frontend(test_func) + if kws: + options = cpu.ParallelOptions(kws) + else: + options = cpu.ParallelOptions(True) + + tp = TestPipeline(typingctx, targetctx, args, test_ir) + + typingctx.refresh() + targetctx.refresh() + + inline_pass = inline_closurecall.InlineClosureCallPass(tp.state.func_ir, + options, + typed=True) + inline_pass.run() + + rewrites.rewrite_registry.apply('before-inference', tp.state) + + tp.state.typemap, tp.state.return_type, tp.state.calltypes, _ = \ + typed_passes.type_inference_stage(tp.state.typingctx, + tp.state.targetctx, tp.state.func_ir, tp.state.args, None) + + type_annotations.TypeAnnotation( + func_ir=tp.state.func_ir, + typemap=tp.state.typemap, + calltypes=tp.state.calltypes, + lifted=(), + lifted_from=None, + args=tp.state.args, + return_type=tp.state.return_type, + html_output=config.HTML) + + diagnostics = numba.parfors.parfor.ParforDiagnostics() + + preparfor_pass = numba.parfors.parfor.PreParforPass( + tp.state.func_ir, tp.state.typemap, tp.state.calltypes, + tp.state.typingctx, tp.state.targetctx, options, + swapped=diagnostics.replaced_fns) + preparfor_pass.run() + + rewrites.rewrite_registry.apply('after-inference', tp.state) + + flags = compiler.Flags() + parfor_pass = numba.parfors.parfor.ParforPass( + tp.state.func_ir, tp.state.typemap, tp.state.calltypes, + tp.state.return_type, tp.state.typingctx, tp.state.targetctx, + options, flags, tp.state.metadata, diagnostics=diagnostics) + parfor_pass.run() + parfor_pass = numba.parfors.parfor.ParforFusionPass( + tp.state.func_ir, tp.state.typemap, tp.state.calltypes, + tp.state.return_type, tp.state.typingctx, tp.state.targetctx, + options, flags, tp.state.metadata, diagnostics=diagnostics) + parfor_pass.run() + parfor_pass = numba.parfors.parfor.ParforPreLoweringPass( + tp.state.func_ir, tp.state.typemap, tp.state.calltypes, + tp.state.return_type, tp.state.typingctx, tp.state.targetctx, + options, flags, tp.state.metadata, diagnostics=diagnostics) + parfor_pass.run() + test_ir._definitions = build_definitions(test_ir.blocks) + + return test_ir, tp + +def countParfors(test_func, args, **kws): + test_ir, tp = get_optimized_numba_ir(test_func, args, **kws) + ret_count = 0 + + for label, block in test_ir.blocks.items(): + for i, inst in enumerate(block.body): + if isinstance(inst, numba.parfors.parfor.Parfor): + ret_count += 1 + + return ret_count + + +def countArrays(test_func, args, **kws): + test_ir, tp = get_optimized_numba_ir(test_func, args, **kws) + return _count_arrays_inner(test_ir.blocks, tp.state.typemap) + +def get_init_block_size(test_func, args, **kws): + test_ir, tp = get_optimized_numba_ir(test_func, args, **kws) + blocks = test_ir.blocks + + ret_count = 0 + + for label, block in blocks.items(): + for i, inst in enumerate(block.body): + if isinstance(inst, numba.parfors.parfor.Parfor): + ret_count += len(inst.init_block.body) + + return ret_count + +def _count_arrays_inner(blocks, typemap): + ret_count = 0 + arr_set = set() + + for label, block in blocks.items(): + for i, inst in enumerate(block.body): + if isinstance(inst, numba.parfors.parfor.Parfor): + parfor_blocks = inst.loop_body.copy() + parfor_blocks[0] = inst.init_block + ret_count += _count_arrays_inner(parfor_blocks, typemap) + if (isinstance(inst, ir.Assign) + and isinstance(typemap[inst.target.name], + types.ArrayCompatible)): + arr_set.add(inst.target.name) + + ret_count += len(arr_set) + return ret_count + +def countArrayAllocs(test_func, args, **kws): + test_ir, tp = get_optimized_numba_ir(test_func, args, **kws) + ret_count = 0 + + for block in test_ir.blocks.values(): + ret_count += _count_array_allocs_inner(test_ir, block) + + return ret_count + +def _count_array_allocs_inner(func_ir, block): + ret_count = 0 + for inst in block.body: + if isinstance(inst, numba.parfors.parfor.Parfor): + ret_count += _count_array_allocs_inner(func_ir, inst.init_block) + for b in inst.loop_body.values(): + ret_count += _count_array_allocs_inner(func_ir, b) + + if (isinstance(inst, ir.Assign) and isinstance(inst.value, ir.Expr) + and inst.value.op == 'call' + and (guard(find_callname, func_ir, inst.value) == ('empty', 'numpy') + or guard(find_callname, func_ir, inst.value) + == ('empty_inferred', 'numba.np.unsafe.ndarray'))): + ret_count += 1 + + return ret_count + +def countNonParforArrayAccesses(test_func, args, **kws): + test_ir, tp = get_optimized_numba_ir(test_func, args, **kws) + return _count_non_parfor_array_accesses_inner(test_ir, test_ir.blocks, + tp.state.typemap) + +def _count_non_parfor_array_accesses_inner(f_ir, blocks, typemap, parfor_indices=None): + ret_count = 0 + if parfor_indices is None: + parfor_indices = set() + + for label, block in blocks.items(): + for stmt in block.body: + if isinstance(stmt, numba.parfors.parfor.Parfor): + parfor_indices.add(stmt.index_var.name) + parfor_blocks = stmt.loop_body.copy() + parfor_blocks[0] = stmt.init_block + ret_count += _count_non_parfor_array_accesses_inner( + f_ir, parfor_blocks, typemap, parfor_indices) + + # getitem + elif (is_getitem(stmt) and isinstance(typemap[stmt.value.value.name], + types.ArrayCompatible) and not _uses_indices( + f_ir, index_var_of_get_setitem(stmt), parfor_indices)): + ret_count += 1 + + # setitem + elif (is_setitem(stmt) and isinstance(typemap[stmt.target.name], + types.ArrayCompatible) and not _uses_indices( + f_ir, index_var_of_get_setitem(stmt), parfor_indices)): + ret_count += 1 + + # find parfor_index aliases + elif (isinstance(stmt, ir.Assign) and + isinstance(stmt.value, ir.Var) and + stmt.value.name in parfor_indices): + parfor_indices.add(stmt.target.name) + + return ret_count + +def _uses_indices(f_ir, index, index_set): + if index.name in index_set: + return True + + ind_def = guard(get_definition, f_ir, index) + if isinstance(ind_def, ir.Expr) and ind_def.op == 'build_tuple': + varnames = set(v.name for v in ind_def.items) + return len(varnames & index_set) != 0 + + return False + + +class TestPipeline(object): + def __init__(self, typingctx, targetctx, args, test_ir): + self.state = compiler.StateDict() + self.state.typingctx = typingctx + self.state.targetctx = targetctx + self.state.args = args + self.state.func_ir = test_ir + self.state.typemap = None + self.state.return_type = None + self.state.calltypes = None + self.state.metadata = {} + + +@skip_parfors_unsupported +class TestParforBasic(TestParforsBase): + """Smoke tests for the parfors transforms. These tests check the most basic + functionality""" + + def __init__(self, *args): + TestParforsBase.__init__(self, *args) + # these are used in the mass of simple tests + m = np.reshape(np.arange(12.), (3, 4)) + self.simple_args = [np.arange(3.), np.arange(4.), m, m.T] + + def test_simple01(self): + def test_impl(): + return np.ones(()) + with self.assertRaises(AssertionError) as raises: + self.check(test_impl) + self.assertIn("\'@do_scheduling\' not found", str(raises.exception)) + + def test_simple02(self): + def test_impl(): + return np.ones((1,)) + self.check(test_impl) + + def test_simple03(self): + def test_impl(): + return np.ones((1, 2)) + self.check(test_impl) + + def test_simple04(self): + def test_impl(): + return np.ones(1) + self.check(test_impl) + + def test_simple07(self): + def test_impl(): + return np.ones((1, 2), dtype=np.complex128) + self.check(test_impl) + + def test_simple08(self): + def test_impl(): + return np.ones((1, 2)) + np.ones((1, 2)) + self.check(test_impl) + + def test_simple09(self): + def test_impl(): + return np.ones((1, 1)) + self.check(test_impl) + + def test_simple10(self): + def test_impl(): + return np.ones((0, 0)) + self.check(test_impl) + + def test_simple11(self): + def test_impl(): + return np.ones((10, 10)) + 1. + self.check(test_impl) + + def test_simple12(self): + def test_impl(): + return np.ones((10, 10)) + np.complex128(1.) + self.check(test_impl) + + def test_simple13(self): + def test_impl(): + return np.complex128(1.) + with self.assertRaises(AssertionError) as raises: + self.check(test_impl) + self.assertIn("\'@do_scheduling\' not found", str(raises.exception)) + + def test_simple14(self): + def test_impl(): + return np.ones((10, 10))[0::20] + self.check(test_impl) + + def test_simple15(self): + def test_impl(v1, v2, m1, m2): + return v1 + v1 + self.check(test_impl, *self.simple_args) + + def test_simple16(self): + def test_impl(v1, v2, m1, m2): + return m1 + m1 + self.check(test_impl, *self.simple_args) + + def test_simple17(self): + def test_impl(v1, v2, m1, m2): + return m2 + v1 + self.check(test_impl, *self.simple_args) + + @needs_lapack + def test_simple18(self): + def test_impl(v1, v2, m1, m2): + return m1.T + np.linalg.svd(m2)[1] + self.check(test_impl, *self.simple_args) + + @needs_blas + def test_simple19(self): + def test_impl(v1, v2, m1, m2): + return np.dot(m1, v2) + self.check(test_impl, *self.simple_args) + + @needs_blas + def test_simple20(self): + def test_impl(v1, v2, m1, m2): + return np.dot(m1, m2) + # gemm is left to BLAS + with self.assertRaises(AssertionError) as raises: + self.check(test_impl, *self.simple_args) + self.assertIn("\'@do_scheduling\' not found", str(raises.exception)) + + @needs_blas + def test_simple21(self): + def test_impl(v1, v2, m1, m2): + return np.dot(v1, v1) + self.check(test_impl, *self.simple_args) + + def test_simple22(self): + def test_impl(v1, v2, m1, m2): + return np.sum(v1 + v1) + self.check(test_impl, *self.simple_args) + + def test_simple23(self): + def test_impl(v1, v2, m1, m2): + x = 2 * v1 + y = 2 * v1 + return 4 * np.sum(x**2 + y**2 < 1) / 10 + self.check(test_impl, *self.simple_args) + + def test_simple24(self): + def test_impl(): + n = 20 + A = np.ones((n, n)) + b = np.arange(n) + return np.sum(A[:, b]) + self.check(test_impl) + + @disabled_test + def test_simple_operator_15(self): + """same as corresponding test_simple_ case but using operator.add""" + def test_impl(v1, v2, m1, m2): + return operator.add(v1, v1) + + self.check(test_impl, *self.simple_args) + + @disabled_test + def test_simple_operator_16(self): + def test_impl(v1, v2, m1, m2): + return operator.add(m1, m1) + + self.check(test_impl, *self.simple_args) + + @disabled_test + def test_simple_operator_17(self): + def test_impl(v1, v2, m1, m2): + return operator.add(m2, v1) + + self.check(test_impl, *self.simple_args) + + def test_inplace_alias(self): + # issue7201 + def test_impl(a): + a += 1 + a[:] = 3 + + def comparer(a, b): + np.testing.assert_equal(a, b) + + x = np.ones(1) + self.check(test_impl, x, check_arg_equality=[comparer]) + + +@skip_parfors_unsupported +class TestParforNumericalMisc(TestParforsBase): + """ Miscellaneous 'classical' numerical tests """ + + def test_pi(self): + def test_impl(n): + x = 2 * np.random.ranf(n) - 1 + y = 2 * np.random.ranf(n) - 1 + return 4 * np.sum(x**2 + y**2 < 1) / n + + self.check(test_impl, 100000, decimal=1) + self.assertEqual(countParfors(test_impl, (types.int64, )), 1) + self.assertEqual(countArrays(test_impl, (types.intp,)), 0) + + def test_blackscholes(self): + # blackscholes takes 5 1D float array args + args = (numba.float64[:], ) * 5 + self.assertEqual(countParfors(blackscholes_impl, args), 1) + + @needs_blas + def test_logistic_regression(self): + args = (numba.float64[:], numba.float64[:,:], numba.float64[:], + numba.int64) + self.assertEqual(countParfors(lr_impl, args), 2) + self.assertEqual(countArrayAllocs(lr_impl, args), 1) + + def test_kmeans(self): + np.random.seed(0) + N = 1024 + D = 10 + centers = 3 + A = np.random.ranf((N, D)) + init_centroids = np.random.ranf((centers, D)) + self.check(example_kmeans_test, A, centers, 3, init_centroids, + decimal=1) + # TODO: count parfors after k-means fusion is working + # requires recursive parfor counting + arg_typs = (types.Array(types.float64, 2, 'C'), types.intp, types.intp, + types.Array(types.float64, 2, 'C')) + self.assertEqual( + countNonParforArrayAccesses(example_kmeans_test, arg_typs), 0) + + +@skip_parfors_unsupported +class TestParforNumPy(TestParforsBase): + """Tests NumPy functionality under parfors""" + + @needs_blas + def test_mvdot(self): + def test_impl(a, v): + return np.dot(a, v) + + A = np.linspace(0, 1, 20).reshape(2, 10) + v = np.linspace(2, 1, 10) + + self.check(test_impl, A, v) + + def test_fuse_argmin_argmax_max_min(self): + for op in [np.argmin, np.argmax, np.min, np.max]: + def test_impl(n): + A = np.ones(n) + C = op(A) + B = A.sum() + return B + C + self.check(test_impl, 256) + self.assertEqual(countParfors(test_impl, (types.int64, )), 1) + self.assertEqual(countArrays(test_impl, (types.intp,)), 0) + + def test_np_random_func_direct_import(self): + def test_impl(n): + A = randn(n) + return A[0] + self.assertEqual(countParfors(test_impl, (types.int64, )), 1) + + def test_arange(self): + # test with stop only + def test_impl1(n): + return np.arange(n) + # start and stop + def test_impl2(s, n): + return np.arange(s, n) + # start, step, stop + def test_impl3(s, n, t): + return np.arange(s, n, t) + + for arg in [11, 128, 30.0, complex(4,5), complex(5,4)]: + self.check(test_impl1, arg) + self.check(test_impl2, 2, arg) + self.check(test_impl3, 2, arg, 2) + + def test_arange_dtype(self): + # test with stop only + def test_impl1(n): + return np.arange(n, dtype=np.float32) + # start and stop + def test_impl2(s, n): + return np.arange(s, n, dtype=np.float32) + # start, step, stop + def test_impl3(s, n, t): + return np.arange(s, n, t, dtype=np.float32) + + for arg in [11, 128, 30.0]: + self.check(test_impl1, arg) + self.check(test_impl2, 2, arg) + self.check(test_impl3, 2, arg, 2) + + def test_linspace(self): + # without num + def test_impl1(start, stop): + return np.linspace(start, stop) + # with num + def test_impl2(start, stop, num): + return np.linspace(start, stop, num) + + for arg in [11, 128, 30.0, complex(4,5), complex(5,4)]: + self.check(test_impl1, 2, arg) + self.check(test_impl2, 2, arg, 30) + + def test_mean(self): + def test_impl(A): + return A.mean() + N = 100 + A = np.random.ranf(N) + B = np.random.randint(10, size=(N, 3)) + self.check(test_impl, A) + self.check(test_impl, B) + self.assertEqual(countParfors(test_impl, (types.Array(types.float64, 1, 'C'), )), 1) + self.assertEqual(countParfors(test_impl, (types.Array(types.float64, 2, 'C'), )), 1) + + # Test variants + data_gen = lambda: self.gen_linspace_variants(1) + self.check_variants(test_impl, data_gen) + self.count_parfors_variants(test_impl, data_gen) + + def test_var(self): + def test_impl(A): + return A.var() + N = 100 + A = np.random.ranf(N) + B = np.random.randint(10, size=(N, 3)) + C = A + 1j * A + self.check(test_impl, A) + self.check(test_impl, B) + self.check(test_impl, C) + self.assertEqual(countParfors(test_impl, (types.Array(types.float64, 1, 'C'), )), 2) + self.assertEqual(countParfors(test_impl, (types.Array(types.float64, 2, 'C'), )), 2) + + # Test variants + data_gen = lambda: self.gen_linspace_variants(1) + self.check_variants(test_impl, data_gen) + self.count_parfors_variants(test_impl, data_gen) + + def test_std(self): + def test_impl(A): + return A.std() + N = 100 + A = np.random.ranf(N) + B = np.random.randint(10, size=(N, 3)) + C = A + 1j * A + self.check(test_impl, A) + self.check(test_impl, B) + self.check(test_impl, C) + argty = (types.Array(types.float64, 1, 'C'),) + self.assertEqual(countParfors(test_impl, argty), 2) + self.assertEqual(countParfors(test_impl, argty), 2) + + # Test variants + data_gen = lambda: self.gen_linspace_variants(1) + self.check_variants(test_impl, data_gen) + self.count_parfors_variants(test_impl, data_gen) + + def test_random_parfor(self): + """ + Test function with only a random call to make sure a random function + like ranf is actually translated to a parfor. + """ + def test_impl(n): + A = np.random.ranf((n, n)) + return A + self.assertEqual(countParfors(test_impl, (types.int64, )), 1) + + def test_randoms(self): + def test_impl(n): + A = np.random.standard_normal(size=(n, n)) + B = np.random.randn(n, n) + C = np.random.normal(0.0, 1.0, (n, n)) + D = np.random.chisquare(1.0, (n, n)) + E = np.random.randint(1, high=3, size=(n, n)) + F = np.random.triangular(1, 2, 3, (n, n)) + return np.sum(A+B+C+D+E+F) + + n = 128 + cpfunc = self.compile_parallel(test_impl, (numba.typeof(n),)) + parfor_output = cpfunc.entry_point(n) + py_output = test_impl(n) + # check results within 5% since random numbers generated in parallel + np.testing.assert_allclose(parfor_output, py_output, rtol=0.05) + self.assertEqual(countParfors(test_impl, (types.int64, )), 1) + + def test_dead_randoms(self): + def test_impl(n): + A = np.random.standard_normal(size=(n, n)) + B = np.random.randn(n, n) + C = np.random.normal(0.0, 1.0, (n, n)) + D = np.random.chisquare(1.0, (n, n)) + E = np.random.randint(1, high=3, size=(n, n)) + F = np.random.triangular(1, 2, 3, (n, n)) + return 3 + + n = 128 + cpfunc = self.compile_parallel(test_impl, (numba.typeof(n),)) + parfor_output = cpfunc.entry_point(n) + py_output = test_impl(n) + self.assertEqual(parfor_output, py_output) + self.assertEqual(countParfors(test_impl, (types.int64, )), 0) + + def test_min(self): + def test_impl1(A): + return A.min() + + def test_impl2(A): + return np.min(A) + + n = 211 + A = np.random.ranf(n) + B = np.random.randint(10, size=n).astype(np.int32) + C = np.random.ranf((n, n)) # test multi-dimensional array + D = np.array([np.inf, np.inf]) + self.check(test_impl1, A) + self.check(test_impl1, B) + self.check(test_impl1, C) + self.check(test_impl1, D) + self.check(test_impl2, A) + self.check(test_impl2, B) + self.check(test_impl2, C) + self.check(test_impl2, D) + + # checks that 0d array input raises + msg = ("zero-size array to reduction operation " + "minimum which has no identity") + for impl in (test_impl1, test_impl2): + pcfunc = self.compile_parallel(impl, (types.int64[:],)) + with self.assertRaises(ValueError) as e: + pcfunc.entry_point(np.array([], dtype=np.int64)) + self.assertIn(msg, str(e.exception)) + + # Test variants + data_gen = lambda: self.gen_linspace_variants(1) + self.check_variants(test_impl1, data_gen) + self.count_parfors_variants(test_impl1, data_gen) + self.check_variants(test_impl2, data_gen) + self.count_parfors_variants(test_impl2, data_gen) + + def test_max(self): + def test_impl1(A): + return A.max() + + def test_impl2(A): + return np.max(A) + + n = 211 + A = np.random.ranf(n) + B = np.random.randint(10, size=n).astype(np.int32) + C = np.random.ranf((n, n)) # test multi-dimensional array + D = np.array([-np.inf, -np.inf]) + self.check(test_impl1, A) + self.check(test_impl1, B) + self.check(test_impl1, C) + self.check(test_impl1, D) + self.check(test_impl2, A) + self.check(test_impl2, B) + self.check(test_impl2, C) + self.check(test_impl2, D) + + # checks that 0d array input raises + msg = ("zero-size array to reduction operation " + "maximum which has no identity") + for impl in (test_impl1, test_impl2): + pcfunc = self.compile_parallel(impl, (types.int64[:],)) + with self.assertRaises(ValueError) as e: + pcfunc.entry_point(np.array([], dtype=np.int64)) + self.assertIn(msg, str(e.exception)) + + # Test variants + data_gen = lambda: self.gen_linspace_variants(1) + self.check_variants(test_impl1, data_gen) + self.count_parfors_variants(test_impl1, data_gen) + self.check_variants(test_impl2, data_gen) + self.count_parfors_variants(test_impl2, data_gen) + + def test_argmax(self): + def test_impl1(A): + return A.argmax() + + def test_impl2(A): + return np.argmax(A) + + n = 211 + A = np.array([1., 0., 3., 2., 3.]) + B = np.random.randint(10, size=n).astype(np.int32) + C = np.random.ranf((n, n)) # test multi-dimensional array + D = np.array([1., 0., np.nan, 2., 3.]) + self.check(test_impl1, A) + self.check(test_impl1, B) + self.check(test_impl1, C) + self.check(test_impl1, D) + self.check(test_impl2, A) + self.check(test_impl2, B) + self.check(test_impl2, C) + self.check(test_impl2, D) + + # checks that 0d array input raises + msg = 'attempt to get argmax of an empty sequence' + for impl in (test_impl1, test_impl2): + pcfunc = self.compile_parallel(impl, (types.int64[:],)) + with self.assertRaises(ValueError) as e: + pcfunc.entry_point(np.array([], dtype=np.int64)) + self.assertIn(msg, str(e.exception)) + + # Test variants + data_gen = lambda: self.gen_linspace_variants(1) + self.check_variants(test_impl1, data_gen) + self.count_parfors_variants(test_impl1, data_gen) + self.check_variants(test_impl2, data_gen) + self.count_parfors_variants(test_impl2, data_gen) + + def test_argmin(self): + def test_impl1(A): + return A.argmin() + + def test_impl2(A): + return np.argmin(A) + + n = 211 + A = np.array([1., 0., 2., 0., 3.]) + B = np.random.randint(10, size=n).astype(np.int32) + C = np.random.ranf((n, n)) # test multi-dimensional array + D = np.array([1., 0., np.nan, 0., 3.]) + self.check(test_impl1, A) + self.check(test_impl1, B) + self.check(test_impl1, C) + self.check(test_impl1, D) + self.check(test_impl2, A) + self.check(test_impl2, B) + self.check(test_impl2, C) + self.check(test_impl2, D) + + # checks that 0d array input raises + msg = 'attempt to get argmin of an empty sequence' + for impl in (test_impl1, test_impl2): + pcfunc = self.compile_parallel(impl, (types.int64[:],)) + with self.assertRaises(ValueError) as e: + pcfunc.entry_point(np.array([], dtype=np.int64)) + self.assertIn(msg, str(e.exception)) + + # Test variants + data_gen = lambda: self.gen_linspace_variants(1) + self.check_variants(test_impl1, data_gen) + self.count_parfors_variants(test_impl1, data_gen) + self.check_variants(test_impl2, data_gen) + self.count_parfors_variants(test_impl2, data_gen) + + def test_ndarray_fill(self): + def test_impl(x): + x.fill(7.0) + return x + x = np.zeros(10) + self.check(test_impl, x) + argty = (types.Array(types.float64, 1, 'C'),) + self.assertEqual(countParfors(test_impl, argty), 1) + + def test_ndarray_fill2d(self): + def test_impl(x): + x.fill(7.0) + return x + x = np.zeros((2,2)) + self.check(test_impl, x) + argty = (types.Array(types.float64, 2, 'C'),) + self.assertEqual(countParfors(test_impl, argty), 1) + + def test_reshape_with_neg_one(self): + # issue3314 + def test_impl(a, b): + result_matrix = np.zeros((b, b, 1), dtype=np.float64) + sub_a = a[0:b] + a = sub_a.size + b = a / 1 + z = sub_a.reshape(-1, 1) + result_data = sub_a / z + result_matrix[:,:,0] = result_data + return result_matrix + + a = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, + 7.0, 8.0, 9.0, 10.0, 11.0, 12.0]) + b = 3 + + self.check(test_impl, a, b) + + def test_reshape_with_large_neg(self): + # issue3314 + def test_impl(a, b): + result_matrix = np.zeros((b, b, 1), dtype=np.float64) + sub_a = a[0:b] + a = sub_a.size + b = a / 1 + z = sub_a.reshape(-1307, 1) + result_data = sub_a / z + result_matrix[:,:,0] = result_data + return result_matrix + + a = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, + 7.0, 8.0, 9.0, 10.0, 11.0, 12.0]) + b = 3 + + self.check(test_impl, a, b) + + def test_reshape_with_too_many_neg_one(self): + # issue3314 + with self.assertRaises(errors.UnsupportedRewriteError) as raised: + @njit(parallel=True) + def test_impl(a, b): + rm = np.zeros((b, b, 1), dtype=np.float64) + sub_a = a[0:b] + a = sub_a.size + b = a / 1 + z = sub_a.reshape(-1, -1) + result_data = sub_a / z + rm[:,:,0] = result_data + return rm + + a = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, + 7.0, 8.0, 9.0, 10.0, 11.0, 12.0]) + b = 3 + test_impl(a, b) + + msg = ("The reshape API may only include one negative argument.") + self.assertIn(msg, str(raised.exception)) + + def test_0d_array(self): + def test_impl(n): + return np.sum(n) + np.prod(n) + np.min(n) + np.max(n) + np.var(n) + self.check(test_impl, np.array(7), check_scheduling=False) + + def test_real_imag_attr(self): + # See issue 8012 + def test_impl(z): + return np.sum(z.real ** 2 + z.imag ** 2) + + z = np.arange(5) * (1 + 1j) + self.check(test_impl, z) + self.assertEqual(countParfors(test_impl, (types.complex128[::1],)), 1) + + +class TestParforsUnsupported(TestCase): + """Tests for unsupported use of parfors""" + @unittest.skipIf(not _32bit, "Only impacts 32 bit hardware") + @needs_blas + def test_unsupported_combination_raises(self): + """ + This test is in place until issues with the 'parallel' + target on 32 bit hardware are fixed. + """ + with self.assertRaises(errors.UnsupportedParforsError) as raised: + @njit(parallel=True) + def ddot(a, v): + return np.dot(a, v) + + A = np.linspace(0, 1, 20).reshape(2, 10) + v = np.linspace(2, 1, 10) + ddot(A, v) + + msg = ("The 'parallel' target is not currently supported on 32 bit " + "hardware") + self.assertIn(msg, str(raised.exception)) + +@skip_parfors_unsupported +class TestParfors(TestParforsBase): + """ Tests cpython, reduction and various parfors features""" + + def test_arraymap(self): + def test_impl(a, x, y): + return a * x + y + + self.check_variants(test_impl, lambda: self.gen_linspace_variants(3)) + + def test_0d_broadcast(self): + def test_impl(): + X = np.array(1) + Y = np.ones((10, 12)) + return np.sum(X + Y) + self.check(test_impl) + self.assertEqual(countParfors(test_impl, ()), 1) + + def test_2d_parfor(self): + def test_impl(): + X = np.ones((10, 12)) + Y = np.zeros((10, 12)) + return np.sum(X + Y) + self.check(test_impl) + self.assertEqual(countParfors(test_impl, ()), 1) + + def test_nd_parfor(self): + def case1(): + X = np.ones((10, 12)) + Y = np.zeros((10, 12)) + yield (X, Y) + + data_gen = lambda: chain(case1(), self.gen_linspace_variants(2)) + + def test_impl(X, Y): + return np.sum(X + Y) + + self.check_variants(test_impl, data_gen) + self.count_parfors_variants(test_impl, data_gen) + + def test_np_func_direct_import(self): + from numpy import ones # import here becomes FreeVar + def test_impl(n): + A = ones(n) + return A[0] + n = 111 + self.check(test_impl, n) + + def test_size_assertion(self): + def test_impl(m, n): + A = np.ones(m) + B = np.ones(n) + return np.sum(A + B) + + self.check(test_impl, 10, 10) + with self.assertRaises(AssertionError) as raises: + cfunc = njit(parallel=True)(test_impl) + cfunc(10, 9) + msg = "Sizes of A, B do not match" + self.assertIn(msg, str(raises.exception)) + + def test_cfg(self): + # from issue #2477 + def test_impl(x, is_positive, N): + for i in numba.prange(2): + for j in range( i*N//2, (i+1)*N//2 ): + is_positive[j] = 0 + if x[j] > 0: + is_positive[j] = 1 + + return is_positive + + N = 100 + x = np.random.rand(N) + is_positive = np.zeros(N) + self.check(test_impl, x, is_positive, N) + + def test_reduce(self): + def test_impl(A): + init_val = 10 + return reduce(lambda a,b: min(a, b), A, init_val) + + n = 211 + A = np.random.ranf(n) + self.check(test_impl, A) + A = np.random.randint(10, size=n).astype(np.int32) + self.check(test_impl, A) + + # test checking the number of arguments for the reduce function + def test_impl(): + g = lambda x: x ** 2 + return reduce(g, np.array([1, 2, 3, 4, 5]), 2) + with self.assertTypingError(): + self.check(test_impl) + + # test checking reduction over bitarray masked arrays + n = 160 + A = np.random.randint(10, size=n).astype(np.int32) + def test_impl(A): + return np.sum(A[A>=3]) + self.check(test_impl, A) + # TODO: this should fuse + # self.assertTrue(countParfors(test_impl, (numba.float64[:],)) == 1) + + def test_impl(A): + B = A[:,0] + return np.sum(A[B>=3,1]) + self.check(test_impl, A.reshape((16,10))) + # TODO: this should also fuse + #self.assertTrue(countParfors(test_impl, (numba.float64[:,:],)) == 1) + + def test_impl(A): + B = A[:,0] + return np.sum(A[B>=3,1:2]) + self.check(test_impl, A.reshape((16,10))) + # this doesn't fuse due to mixed indices + self.assertEqual(countParfors(test_impl, (numba.float64[:,:],)), 2) + + def test_impl(A): + min_val = np.amin(A) + return A - min_val + self.check(test_impl, A) + # this doesn't fuse due to use of reduction variable + self.assertEqual(countParfors(test_impl, (numba.float64[:],)), 2) + + def test_use_of_reduction_var1(self): + def test_impl(): + acc = 0 + for i in prange(1): + acc = cmath.sqrt(acc) + return acc + + # checks that invalid use of reduction variable is detected + msg = ("Use of reduction variable acc in an unsupported reduction function.") + with self.assertRaises(ValueError) as e: + pcfunc = self.compile_parallel(test_impl, ()) + self.assertIn(msg, str(e.exception)) + + def test_unsupported_floordiv1(self): + def test_impl(): + acc = 100 + for i in prange(2): + acc //= 2 + return acc + + # checks that invalid use of ifloordiv reduction operator is detected + msg = ("Parallel floordiv reductions are not supported. " + "If all divisors are integers then a floordiv " + "reduction can in some cases be parallelized as " + "a multiply reduction followed by a floordiv of " + "the resulting product.") + with self.assertRaises(errors.NumbaValueError) as e: + pcfunc = self.compile_parallel(test_impl, ()) + self.assertIn(msg, str(e.exception)) + + def test_unsupported_xor1(self): + def test_impl(): + acc = 100 + for i in prange(2): + acc ^= i + 2 + return acc + + msg = ("Use of reduction variable acc in an unsupported reduction function.") + with self.assertRaises(ValueError) as e: + pcfunc = self.compile_parallel(test_impl, ()) + self.assertIn(msg, str(e.exception)) + + def test_parfor_array_access1(self): + # signed index of the prange generated by sum() should be replaced + # resulting in array A to be eliminated (see issue #2846) + def test_impl(n): + A = np.ones(n) + return A.sum() + + n = 211 + self.check(test_impl, n) + self.assertEqual(countArrays(test_impl, (types.intp,)), 0) + + def test_parfor_array_access2(self): + # in this test, the prange index has the same name (i) in two loops + # thus, i has multiple definitions and is harder to replace + def test_impl(n): + A = np.ones(n) + m = 0 + n = 0 + for i in numba.prange(len(A)): + m += A[i] + + for i in numba.prange(len(A)): + if m == n: # access in another block + n += A[i] + + return m + n + + n = 211 + self.check(test_impl, n) + self.assertEqual(countNonParforArrayAccesses(test_impl, (types.intp,)), 0) + + def test_parfor_array_access3(self): + def test_impl(n): + A = np.ones(n, np.int64) + m = 0 + for i in numba.prange(len(A)): + m += A[i] + if m==2: + i = m + + n = 211 + with self.assertRaises(errors.UnsupportedRewriteError) as raises: + self.check(test_impl, n) + self.assertIn("Overwrite of parallel loop index", str(raises.exception)) + + @needs_blas + def test_parfor_array_access4(self): + # in this test, one index of a multi-dim access should be replaced + # np.dot parallel implementation produces this case + def test_impl(A, b): + return np.dot(A, b) + + n = 211 + d = 4 + A = np.random.ranf((n, d)) + b = np.random.ranf(d) + self.check(test_impl, A, b) + # make sure the parfor index is replaced in build_tuple of access to A + test_ir, tp = get_optimized_numba_ir( + test_impl, (types.Array(types.float64, 2, 'C'), + types.Array(types.float64, 1, 'C'))) + # this code should have one basic block after optimization + self.assertTrue(len(test_ir.blocks) == 1 and 0 in test_ir.blocks) + block = test_ir.blocks[0] + parfor_found = False + parfor = None + for stmt in block.body: + if isinstance(stmt, numba.parfors.parfor.Parfor): + parfor_found = True + parfor = stmt + + self.assertTrue(parfor_found) + build_tuple_found = False + # there should be only one build_tuple + for bl in parfor.loop_body.values(): + for stmt in bl.body: + if (isinstance(stmt, ir.Assign) + and isinstance(stmt.value, ir.Expr) + and stmt.value.op == 'build_tuple'): + build_tuple_found = True + self.assertTrue(parfor.index_var in stmt.value.items) + + self.assertTrue(build_tuple_found) + + def test_parfor_dtype_type(self): + # test array type replacement creates proper type + def test_impl(a): + for i in numba.prange(len(a)): + a[i] = a.dtype.type(0) + return a[4] + + a = np.ones(10) + self.check(test_impl, a) + + def test_parfor_array_access5(self): + # one dim is slice in multi-dim access + def test_impl(n): + X = np.ones((n, 3)) + y = 0 + for i in numba.prange(n): + y += X[i,:].sum() + return y + + n = 211 + self.check(test_impl, n) + self.assertEqual(countNonParforArrayAccesses(test_impl, (types.intp,)), 0) + + @disabled_test # Test itself is problematic, see #3155 + def test_parfor_hoist_setitem(self): + # Make sure that read of out is not hoisted. + def test_impl(out): + for i in prange(10): + out[0] = 2 * out[0] + return out[0] + + out = np.ones(1) + self.check(test_impl, out) + + @needs_blas + def test_parfor_generate_fuse(self): + # issue #2857 + def test_impl(N, D): + w = np.ones(D) + X = np.ones((N, D)) + Y = np.ones(N) + for i in range(3): + B = (-Y * np.dot(X, w)) + + return B + + n = 211 + d = 3 + self.check(test_impl, n, d) + self.assertEqual(countArrayAllocs(test_impl, (types.intp, types.intp)), 4) + self.assertEqual(countParfors(test_impl, (types.intp, types.intp)), 4) + + def test_ufunc_expr(self): + # issue #2885 + def test_impl(A, B): + return np.bitwise_and(A, B) + + A = np.ones(3, np.uint8) + B = np.ones(3, np.uint8) + B[1] = 0 + self.check(test_impl, A, B) + + def test_find_callname_intrinsic(self): + def test_impl(n): + A = unsafe_empty((n,)) + for i in range(n): + A[i] = i + 2.0 + return A + + # the unsafe allocation should be found even though it is imported + # as a different name + self.assertEqual(countArrayAllocs(test_impl, (types.intp,)), 1) + + def test_reduction_var_reuse(self): + # issue #3139 + def test_impl(n): + acc = 0 + for i in prange(n): + acc += 1 + + for i in prange(n): + acc += 2 + + return acc + self.check(test_impl, 16) + + def test_non_identity_initial(self): + # issue #7344 + def test_impl(A, cond): + s = 1 + for i in prange(A.shape[0]): + if cond[i]: + s += 1 + return s + self.check(test_impl, np.ones(10), np.ones(10).astype('bool')) + + def test_if_not_else_reduction(self): + # issue #7344 + def test_impl(A, cond): + s = 1 + t = 10 + for i in prange(A.shape[0]): + if cond[i]: + s += 1 + t += 1 + else: + s += 2 + return s + t + self.check(test_impl, np.ones(10), np.ones(10).astype('bool')) + + def test_two_d_array_reduction_reuse(self): + def test_impl(n): + shp = (13, 17) + size = shp[0] * shp[1] + result1 = np.zeros(shp, np.int_) + tmp = np.arange(size).reshape(shp) + + for i in numba.prange(n): + result1 += tmp + + for i in numba.prange(n): + result1 += tmp + + return result1 + + self.check(test_impl, 100) + + def test_one_d_array_reduction(self): + def test_impl(n): + result = np.zeros(1, np.int_) + + for i in numba.prange(n): + result += np.array([i], np.int_) + + return result + + self.check(test_impl, 100) + + def test_two_d_array_reduction(self): + def test_impl(n): + shp = (13, 17) + size = shp[0] * shp[1] + result1 = np.zeros(shp, np.int_) + tmp = np.arange(size).reshape(shp) + + for i in numba.prange(n): + result1 += tmp + + return result1 + + self.check(test_impl, 100) + + def test_two_d_array_reduction_with_float_sizes(self): + # result1 is float32 and tmp is float64. + # Tests reduction with differing dtypes. + def test_impl(n): + shp = (2, 3) + result1 = np.zeros(shp, np.float32) + tmp = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]).reshape(shp) + + for i in numba.prange(n): + result1 += tmp + + return result1 + + self.check(test_impl, 100) + + def test_two_d_array_reduction_prod(self): + def test_impl(n): + shp = (13, 17) + result1 = 2 * np.ones(shp, np.int_) + tmp = 2 * np.ones_like(result1) + + for i in numba.prange(n): + result1 *= tmp + + return result1 + + self.check(test_impl, 100) + + def test_three_d_array_reduction(self): + def test_impl(n): + shp = (3, 2, 7) + result1 = np.zeros(shp, np.int_) + + for i in numba.prange(n): + result1 += np.ones(shp, np.int_) + + return result1 + + self.check(test_impl, 100) + + def test_preparfor_canonicalize_kws(self): + # test canonicalize_array_math typing for calls with kw args + def test_impl(A): + return A.argsort() + 1 + + n = 211 + A = np.arange(n) + self.check(test_impl, A) + + def test_preparfor_datetime64(self): + # test array.dtype transformation for datetime64 + def test_impl(A): + return A.dtype + + A = np.empty(1, np.dtype('datetime64[ns]')) + cpfunc = self.compile_parallel(test_impl, (numba.typeof(A),)) + self.assertEqual(cpfunc.entry_point(A), test_impl(A)) + + def test_no_hoisting_with_member_function_call(self): + def test_impl(X): + n = X.shape[0] + acc = 0 + for i in prange(n): + R = {1, 2, 3} + R.add(i) + tmp = 0 + for x in R: + tmp += x + acc += tmp + return acc + + self.check(test_impl, np.random.ranf(128)) + + def test_array_compare_scalar(self): + """ issue3671: X != 0 becomes an arrayexpr with operator.ne. + That is turned into a parfor by devectorizing. Make sure + the return type of the devectorized operator.ne + on integer types works properly. + """ + def test_impl(): + X = np.zeros(10, dtype=np.int_) + return X != 0 + + self.check(test_impl) + + def test_array_analysis_optional_def(self): + def test_impl(x, half): + size = len(x) + parr = x[0:size] + + if half: + parr = x[0:size//2] + + return parr.sum() + x = np.ones(20) + self.check(test_impl, x, True, check_scheduling=False) + + def test_prange_side_effects(self): + def test_impl(a, b): + data = np.empty(len(a), dtype=np.float64) + size = len(data) + for i in numba.prange(size): + data[i] = a[i] + for i in numba.prange(size): + data[i] = data[i] + b[i] + return data + + x = np.arange(10 ** 2, dtype=float) + y = np.arange(10 ** 2, dtype=float) + + self.check(test_impl, x, y) + self.assertEqual(countParfors(test_impl, + (types.Array(types.float64, 1, 'C'), + types.Array(types.float64, 1, 'C'))), 1) + + def test_tuple1(self): + def test_impl(a): + atup = (3, 4) + b = 7 + for i in numba.prange(len(a)): + a[i] += atup[0] + atup[1] + b + return a + + x = np.arange(10) + self.check(test_impl, x) + + def test_tuple2(self): + def test_impl(a): + atup = a.shape + b = 7 + for i in numba.prange(len(a)): + a[i] += atup[0] + b + return a + + x = np.arange(10) + self.check(test_impl, x) + + def test_tuple3(self): + def test_impl(a): + atup = (np.arange(10), 4) + b = 7 + for i in numba.prange(len(a)): + a[i] += atup[0][5] + atup[1] + b + return a + + x = np.arange(10) + self.check(test_impl, x) + + def test_namedtuple1(self): + def test_impl(a): + antup = TestNamedTuple(part0=3, part1=4) + b = 7 + for i in numba.prange(len(a)): + a[i] += antup.part0 + antup.part1 + b + return a + + x = np.arange(10) + self.check(test_impl, x) + + def test_namedtuple2(self): + TestNamedTuple2 = namedtuple('TestNamedTuple2', ('part0', 'part1')) + def test_impl(a): + antup = TestNamedTuple2(part0=3, part1=4) + b = 7 + for i in numba.prange(len(a)): + a[i] += antup.part0 + antup.part1 + b + return a + + x = np.arange(10) + self.check(test_impl, x) + + def test_namedtuple3(self): + # issue5872: test that a.y[:] = 5 is not removed as + # deadcode. + TestNamedTuple3 = namedtuple(f'TestNamedTuple3',['y']) + + def test_impl(a): + a.y[:] = 5 + + def comparer(a, b): + np.testing.assert_almost_equal(a.y, b.y) + + x = TestNamedTuple3(y=np.zeros(10)) + self.check(test_impl, x, check_arg_equality=[comparer]) + + def test_inplace_binop(self): + def test_impl(a, b): + b += a + return b + + X = np.arange(10) + 10 + Y = np.arange(10) + 100 + self.check(test_impl, X, Y) + self.assertEqual(countParfors(test_impl, + (types.Array(types.float64, 1, 'C'), + types.Array(types.float64, 1, 'C'))), 1) + + def test_tuple_concat(self): + # issue5383 + def test_impl(a): + n = len(a) + array_shape = n, n + indices = np.zeros(((1,) + array_shape + (1,)), dtype=np.uint64) + k_list = indices[0, :] + + for i, g in enumerate(a): + k_list[i, i] = i + return k_list + + x = np.array([1, 1]) + self.check(test_impl, x) + + def test_tuple_concat_with_reverse_slice(self): + # issue5383 + def test_impl(a): + n = len(a) + array_shape = n, n + indices = np.zeros(((1,) + array_shape + (1,))[:-1], + dtype=np.uint64) + k_list = indices[0, :] + + for i, g in enumerate(a): + k_list[i, i] = i + return k_list + + x = np.array([1, 1]) + self.check(test_impl, x) + + def test_array_tuple_concat(self): + # issue6399 + def test_impl(a): + S = (a,) + (a, a) + return S[0].sum() + + x = np.ones((3,3)) + self.check(test_impl, x) + + def test_high_dimension1(self): + # issue6749 + def test_impl(x): + return x * 5.0 + x = np.ones((2, 2, 2, 2, 2, 15)) + self.check(test_impl, x) + + def test_tuple_arg(self): + def test_impl(x, sz): + for i in numba.pndindex(sz): + x[i] = 1 + return x + sz = (10, 5) + self.check(test_impl, np.empty(sz), sz) + + def test_tuple_arg_not_whole_array(self): + def test_impl(x, sz): + for i in numba.pndindex(sz): + x[i] = 1 + return x + sz = (10, 5) + self.check(test_impl, np.zeros(sz), (10, 3)) + + def test_tuple_for_pndindex(self): + def test_impl(x): + sz = (10, 5) + for i in numba.pndindex(sz): + x[i] = 1 + return x + sz = (10, 5) + self.check(test_impl, np.zeros(sz)) + + def test_tuple_arg_literal(self): + def test_impl(x, first): + sz = (first, 5) + for i in numba.pndindex(sz): + x[i] = 1 + return x + sz = (10, 5) + self.check(test_impl, np.zeros(sz), 10) + + def test_tuple_of_literal_nonliteral(self): + # This test has to be done manually as the self.check uses + # compile_isolated and one function cannot "see" the other + + def test_impl(x, sz): + for i in numba.pndindex(sz): + x[i] = 1 + return x + + def call(x, fn): + return fn(x, (10, 3)) # Only want to iterate to the 3rd + + get_input = lambda: np.zeros((10, 10)) + expected = call(get_input(), test_impl) + + def check(dec): + f1 = dec(test_impl) + f2 = njit(call) # no parallel semantics in the caller + got = f2(get_input(), f1) + self.assertPreciseEqual(expected, got) + + for d in (njit, njit(parallel=True)): + check(d) + + def test_tuple_arg_1d(self): + def test_impl(x, sz): + for i in numba.pndindex(sz): + x[i] = 1 + return x + sz = (10,) + self.check(test_impl, np.zeros(sz), sz) + + def test_tuple_arg_1d_literal(self): + def test_impl(x): + sz = (10,) + for i in numba.pndindex(sz): + x[i] = 1 + return x + sz = (10,) + self.check(test_impl, np.zeros(sz)) + + def test_int_arg_pndindex(self): + def test_impl(x, sz): + for i in numba.pndindex(sz): + x[i] = 1 + return x + self.check(test_impl, np.zeros((10, 10)), 3) + + def test_prange_unknown_call1(self): + @register_jitable + def issue7854_proc(u, i, even, size): + for j in range((even + i + 1) % 2 + 1, size - 1, 2): + u[i, j] = u[i + 1, j] + 1 + + # issue7854 + # Forbid fusion in unanalyzable call inside prange. + def test_impl(u, size): + for i in numba.prange(1, size - 1): + issue7854_proc(u, i, 0, size) + for i in numba.prange(1, size - 1): + issue7854_proc(u, i, 1, size) + return u + + size = 4 + u = np.zeros((size, size)) + cptypes = (numba.float64[:, ::1], types.int64) + self.assertEqual(countParfors(test_impl, cptypes), 2) + self.check(test_impl, u, size) + + def test_prange_index_calc1(self): + # Should forbid fusion due to cross-iteration dependency as + # detected by loop index calcuation (i+1) as array index. + def test_impl(u, size): + for i in numba.prange(1, size - 1): + for j in range((i + 1) % 2 + 1, size - 1, 2): + u[i, j] = u[i + 1, j] + 1 + for i in numba.prange(1, size - 1): + for j in range(i % 2 + 1, size - 1, 2): + u[i, j] = u[i + 1, j] + 1 + return u + + size = 4 + u = np.zeros((size, size)) + cptypes = (numba.float64[:, ::1], types.int64) + self.assertEqual(countParfors(test_impl, cptypes), 2) + self.check(test_impl, u, size) + + def test_prange_reverse_order1(self): + # Testing if reversed loop index usage as array index + # prevents fusion. + def test_impl(a, b, size): + for i in numba.prange(size): + for j in range(size): + a[i, j] = b[i, j] + 1 + for i in numba.prange(size): + for j in range(size): + b[j, i] = 3 + return a[0, 0] + b[0, 0] + + size = 10 + a = np.zeros((size, size)) + b = np.zeros((size, size)) + cptypes = (numba.float64[:, ::1], numba.float64[:, ::1], types.int64) + self.assertEqual(countParfors(test_impl, cptypes), 2) + self.check(test_impl, a, b, size) + + def test_prange_parfor_index_then_not(self): + # Testing if accessing an array first with a parfor index then + # without will prevent fusion. + def test_impl(a, size): + b = 0 + for i in numba.prange(size): + a[i] = i + for i in numba.prange(size): + b += a[5] + return b + + size = 10 + a = np.zeros(size) + cptypes = (numba.float64[:], types.int64) + self.assertEqual(countParfors(test_impl, cptypes), 2) + self.check(test_impl, a, size) + + def test_prange_parfor_index_const_tuple_fusion(self): + # Testing if accessing a tuple with prange index + # and later with a constant will not prevent fusion. + def test_impl(a, tup, size): + acc = 0 + for i in numba.prange(size): + a[i] = i + tup[i] + for i in numba.prange(size): + acc += a[i] + tup[1] + return acc + + size = 10 + a = np.zeros(size) + b = tuple(a) + cptypes = (numba.float64[:], + types.containers.UniTuple(types.float64, size), + types.intp) + self.assertEqual(countParfors(test_impl, cptypes), 1) + self.check(test_impl, a, b, size) + + def test_prange_non_parfor_index_then_opposite(self): + # Testing if accessing an array first without a parfor index then + # with will prevent fusion. + def test_impl(a, b, size): + for i in numba.prange(size): + b[i] = a[5] + for i in numba.prange(size): + a[i] = i + # Need this to stop previous prange from being optimized away. + b[0] += a[0] + return b + + size = 10 + a = np.zeros(size) + b = np.zeros(size) + cptypes = (numba.float64[:], numba.float64[:], types.int64) + self.assertEqual(countParfors(test_impl, cptypes), 2) + self.check(test_impl, a, b, size) + + def test_prange_optional(self): + def test_impl(arr, pred=None): + for i in prange(1): + if pred is not None: + arr[i] = 0.0 + + arr = np.ones(10) + self.check(test_impl, arr, None, + check_arg_equality=[np.testing.assert_almost_equal, + lambda x, y: x == y]) + self.assertEqual(arr.sum(), 10.0) + + def test_untraced_value_tuple(self): + # This is a test for issue #6478. + def test_impl(): + a = (1.2, 1.3) + return a[0] + + with self.assertRaises(AssertionError) as raises: + self.check(test_impl) + self.assertIn("\'@do_scheduling\' not found", str(raises.exception)) + + def test_recursive_untraced_value_tuple(self): + # This is a test for issue #6478. + def test_impl(): + a = ((1.2, 1.3),) + return a[0][0] + + with self.assertRaises(AssertionError) as raises: + self.check(test_impl) + self.assertIn("\'@do_scheduling\' not found", str(raises.exception)) + + def test_untraced_value_parfor(self): + # This is a test for issue #6478. + def test_impl(arr): + a = (1.2, 1.3) + n1 = len(arr) + arr2 = np.empty(n1, np.float64) + for i in prange(n1): + arr2[i] = arr[i] * a[0] + n2 = len(arr2) + arr3 = np.empty(n2, np.float64) + for j in prange(n2): + arr3[j] = arr2[j] - a[1] + total = 0.0 + n3 = len(arr3) + for k in prange(n3): + total += arr3[k] + return total + a[0] + + arg = (types.Array(types.int64, 1, 'C'), ) + self.assertEqual(countParfors(test_impl, arg), 1) + + arr = np.arange(10, dtype=np.int64) + self.check(test_impl, arr) + + def test_setitem_2d_one_replaced(self): + # issue7843 + def test_impl(x): + count = 0 + for n in range(x.shape[0]): + # Useless "if" necessary to trigger bug. + if n: + n + x[count, :] = 1 + count += 1 + return x + + self.check(test_impl, np.zeros((3, 1))) + + def test_1array_control_flow(self): + # issue8146 + def test_impl(arr, flag1, flag2): + inv = np.arange(arr.size) + if flag1: + return inv.astype(np.float64) + if flag2: + ret = inv[inv] + else: + ret = inv[inv - 1] + return ret / arr.size + + arr = np.arange(100) + self.check(test_impl, arr, True, False) + self.check(test_impl, arr, True, True) + self.check(test_impl, arr, False, False) + + def test_2array_1_control_flow(self): + # issue8146 + def test_impl(arr, l, flag): + inv1 = np.arange(arr.size) + inv2 = np.arange(l, arr.size + l) + if flag: + ret = inv1[inv1] + else: + ret = inv1[inv1 - 1] + return ret / inv2 + + arr = np.arange(100) + self.check(test_impl, arr, 10, True) + self.check(test_impl, arr, 10, False) + + def test_2array_2_control_flow(self): + # issue8146 + def test_impl(arr, l, flag): + inv1 = np.arange(arr.size) + inv2 = np.arange(l, arr.size + l) + if flag: + ret1 = inv1[inv1] + ret2 = inv2[inv1] + else: + ret1 = inv1[inv1 - 1] + ret2 = inv2[inv1 - 1] + return ret1 / ret2 + + arr = np.arange(100) + self.check(test_impl, arr, 10, True) + self.check(test_impl, arr, 10, False) + + def test_issue8515(self): + # issue8515: an array is filled in the first prange and + # then accessed with c[i - 1] in the next prange which + # should prevent fusion with the previous prange. + def test_impl(n): + r = np.zeros(n, dtype=np.intp) + c = np.zeros(n, dtype=np.intp) + for i in prange(n): + for j in range(i): + c[i] += 1 + + for i in prange(n): + if i == 0: + continue + r[i] = c[i] - c[i - 1] + return r[1:] + + self.check(test_impl, 15) + self.assertEqual(countParfors(test_impl, (types.int64, )), 2) + + def test_issue9029(self): + # issue9029: too many parfors executed in one function + # overflowed the stack. + def test_impl(i1, i2): + N = 30 + S = 3 + a = np.empty((N,N)) + # The stack should overflow if there are 30*30*2 (# of parfors) + # iterations. + for y in range(N): + for x in range(N): + values = np.ones(S) + v = values[0] + + p2 = np.empty(S) + for i in prange(i1, i2): + p2[i] = 1 + j = p2[0] + + a[y,x] = v + j + return a + + # We pass in 0 and 3 so that the function can't analyze the loop + # bounds on the prange to generate a signed loop whereas the + # np.ones will be an unsigned loop. + self.check(test_impl, 0, 3) + + def test_fusion_no_side_effects(self): + def test_impl(a, b): + X = np.ones(100) + b = math.ceil(b) + Y = np.ones(100) + c = int(max(a, b)) + return X + Y + c + self.check(test_impl, 3.7, 4.3) + self.assertEqual(countParfors(test_impl, (types.float64, types.float64)), 1) + + def test_issue9256_lower_sroa_conflict(self): + @njit(parallel=True) + def def_in_loop(x): + c = 0 + set_num_threads(1) + for i in prange(x): + c = i + return c + + self.assertEqual(def_in_loop(10), def_in_loop.py_func(10)) + + def test_issue9256_lower_sroa_conflict_variant1(self): + def def_in_loop(x): + c = x + set_num_threads(1) + for _i in prange(x): + if c: # forces 3 SSA versions + d = x + 4 + return c, d > 0 + + expected = def_in_loop(4) + self.assertEqual(expected, njit(parallel=False)(def_in_loop)(4)) + self.assertEqual(expected, njit(parallel=True)(def_in_loop)(4)) + + def test_issue9256_lower_sroa_conflict_variant2(self): + def def_in_loop(x): + c = x + set_num_threads(1) + for _i in prange(x): + if c: + for _j in range(x): # forces 4 SSA versions + d = x + 4 + return c, d > 0 + + expected = def_in_loop(4) + self.assertEqual(expected, njit(parallel=False)(def_in_loop)(4)) + self.assertEqual(expected, njit(parallel=True)(def_in_loop)(4)) + + @needs_lapack # use of np.linalg.solve + @skip_ppc64le_invalid_ctr_loop + def test_issue9490_non_det_ssa_problem(self): + # Test modified to include https://github.com/numba/numba/issues/9581 + # which is an issue with hoisting + cmd = [ + sys.executable, + "-m", + "numba.tests.parfor_iss9490_usecase", + ] + envs = { + **os.environ, + # Reproducer consistently fail with the following hashseed. + "PYTHONHASHSEED": "1", + # See https://github.com/numba/numba/issues/9501 + # for details of why num-thread pinning is needed. + "NUMBA_NUM_THREADS": "1", + } + try: + subp.check_output(cmd, env=envs, + stderr=subp.STDOUT, + encoding='utf-8') + except subp.CalledProcessError as e: + msg = f"subprocess failed with output:\n{e.output}" + self.fail(msg=msg) + + +@skip_parfors_unsupported +class TestParforsLeaks(MemoryLeakMixin, TestParforsBase): + def check(self, pyfunc, *args, **kwargs): + cfunc, cpfunc = self.compile_all(pyfunc, *args) + self.check_parfors_vs_others(pyfunc, cfunc, cpfunc, *args, **kwargs) + + def test_reduction(self): + # issue4299 + def test_impl(arr): + return arr.sum() + + arr = np.arange(10).astype(np.float64) + self.check(test_impl, arr) + + def test_multiple_reduction_vars(self): + + def test_impl(arr): + a = 0. + b = 1. + for i in prange(arr.size): + a += arr[i] + b += 1. / (arr[i] + 1) + return a * b + arr = np.arange(10).astype(np.float64) + self.check(test_impl, arr) + + +@skip_parfors_unsupported +class TestParforsSlice(TestParforsBase): + + def test_parfor_slice1(self): + def test_impl(a): + (n,) = a.shape + b = a[0:n-2] + a[1:n-1] + return b + + self.check(test_impl, np.ones(10)) + + def test_parfor_slice2(self): + def test_impl(a, m): + (n,) = a.shape + b = a[0:n-2] + a[1:m] + return b + + # runtime assertion should succeed + self.check(test_impl, np.ones(10), 9) + # next we expect failure + with self.assertRaises(AssertionError) as raises: + njit(parallel=True)(test_impl)(np.ones(10),10) + self.assertIn("do not match", str(raises.exception)) + + def test_parfor_slice3(self): + def test_impl(a): + (m,n) = a.shape + b = a[0:m-1,0:n-1] + a[1:m,1:n] + return b + + self.check(test_impl, np.ones((4,3))) + + def test_parfor_slice4(self): + def test_impl(a): + (m,n) = a.shape + b = a[:,0:n-1] + a[:,1:n] + return b + + self.check(test_impl, np.ones((4,3))) + + def test_parfor_slice5(self): + def test_impl(a): + (m,n) = a.shape + b = a[0:m-1,:] + a[1:m,:] + return b + + self.check(test_impl, np.ones((4,3))) + + def test_parfor_slice6(self): + def test_impl(a): + b = a.transpose() + c = a[1,:] + b[:,1] + return c + + self.check(test_impl, np.ones((4,3))) + + def test_parfor_slice7(self): + def test_impl(a): + b = a.transpose() + c = a[1,:] + b[1,:] + return c + + # runtime check should succeed + self.check(test_impl, np.ones((3,3))) + # next we expect failure + with self.assertRaises(AssertionError) as raises: + njit(parallel=True)(test_impl)(np.ones((3,4))) + self.assertIn("do not match", str(raises.exception)) + + @disabled_test + def test_parfor_slice8(self): + def test_impl(a): + (m,n) = a.shape + b = a.transpose() + b[1:m,1:n] = a[1:m,1:n] + return b + + self.check(test_impl, np.arange(9).reshape((3,3))) + + @disabled_test + def test_parfor_slice9(self): + def test_impl(a): + (m,n) = a.shape + b = a.transpose() + b[1:n,1:m] = a[:,1:m] + return b + + self.check(test_impl, np.arange(12).reshape((3,4))) + + @disabled_test + def test_parfor_slice10(self): + def test_impl(a): + (m,n) = a.shape + b = a.transpose() + b[2,1:m] = a[2,1:m] + return b + + self.check(test_impl, np.arange(9).reshape((3,3))) + + def test_parfor_slice11(self): + def test_impl(a): + (m,n,l) = a.shape + b = a.copy() + b[:,1,1:l] = a[:,2,1:l] + return b + + self.check(test_impl, np.arange(27).reshape((3,3,3))) + + def test_parfor_slice12(self): + def test_impl(a): + (m,n) = a.shape + b = a.copy() + b[1,1:-1] = a[0,:-2] + return b + + self.check(test_impl, np.arange(12).reshape((3,4))) + + def test_parfor_slice13(self): + def test_impl(a): + (m,n) = a.shape + b = a.copy() + c = -1 + b[1,1:c] = a[0,-n:c-1] + return b + + self.check(test_impl, np.arange(12).reshape((3,4))) + + def test_parfor_slice14(self): + def test_impl(a): + (m,n) = a.shape + b = a.copy() + b[1,:-1] = a[0,-3:4] + return b + + self.check(test_impl, np.arange(12).reshape((3,4))) + + def test_parfor_slice15(self): + def test_impl(a): + (m,n) = a.shape + b = a.copy() + b[1,-(n-1):] = a[0,-3:4] + return b + + self.check(test_impl, np.arange(12).reshape((3,4))) + + @disabled_test + def test_parfor_slice16(self): + """ This test is disabled because if n is larger than the array size + then n and n-1 will both be the end of the array and thus the + slices will in fact be of different sizes and unable to fuse. + """ + def test_impl(a, b, n): + assert(a.shape == b.shape) + a[1:n] = 10 + b[0:(n-1)] = 10 + return a * b + + self.check(test_impl, np.ones(10), np.zeros(10), 8) + args = (numba.float64[:], numba.float64[:], numba.int64) + self.assertEqual(countParfors(test_impl, args), 2) + + def test_parfor_slice17(self): + def test_impl(m, A): + B = np.zeros(m) + n = len(A) + B[-n:] = A + return B + + self.check(test_impl, 10, np.ones(10)) + + def test_parfor_slice18(self): + # issue 3534 + def test_impl(): + a = np.zeros(10) + a[1:8] = np.arange(0, 7) + y = a[3] + return y + + self.check(test_impl) + + def test_parfor_slice19(self): + # issues #3561 and #3554, empty slice binop + def test_impl(X): + X[:0] += 1 + return X + + self.check(test_impl, np.ones(10)) + + def test_parfor_slice20(self): + # issue #4075, slice size + def test_impl(): + a = np.ones(10) + c = a[1:] + s = len(c) + return s + + self.check(test_impl, check_scheduling=False) + + def test_parfor_slice21(self): + def test_impl(x1, x2): + x1 = x1.reshape(x1.size, 1) + x2 = x2.reshape(x2.size, 1) + return x1 >= x2[:-1, :] + + x1 = np.random.rand(5) + x2 = np.random.rand(6) + self.check(test_impl, x1, x2) + + def test_parfor_slice22(self): + def test_impl(x1, x2): + b = np.zeros((10,)) + for i in prange(1): + b += x1[:, x2] + return b + + x1 = np.zeros((10,7)) + x2 = np.array(4) + self.check(test_impl, x1, x2) + + def test_parfor_slice23(self): + # issue #4630 + def test_impl(x): + x[:0] = 2 + return x + + self.check(test_impl, np.ones(10)) + + def test_parfor_slice24(self): + def test_impl(m, A, n): + B = np.zeros(m) + C = B[n:] + C = A[:len(C)] + return B + + for i in range(-15, 15): + self.check(test_impl, 10, np.ones(10), i) + + def test_parfor_slice25(self): + def test_impl(m, A, n): + B = np.zeros(m) + C = B[:n] + C = A[:len(C)] + return B + + for i in range(-15, 15): + self.check(test_impl, 10, np.ones(10), i) + + def test_parfor_slice26(self): + def test_impl(a): + (n,) = a.shape + b = a.copy() + b[-(n-1):] = a[-3:4] + return b + + self.check(test_impl, np.arange(4)) + + def test_parfor_slice27(self): + # issue5601: tests array analysis of the slice with + # n_valid_vals of unknown size. + def test_impl(a): + n_valid_vals = 0 + + for i in prange(a.shape[0]): + if a[i] != 0: + n_valid_vals += 1 + + if n_valid_vals: + unused = a[:n_valid_vals] + + return 0 + + self.check(test_impl, np.arange(3)) + + def test_parfor_array_access_lower_slice(self): + for ts in [slice(1, 3, None), slice(2, None, None), slice(None, 2, -1), + slice(None, None, None), slice(None, None, -2)]: + + def test_impl(n): + X = np.arange(n * 4).reshape((n, 4)) + y = 0 + for i in numba.prange(n): + y += X[i, ts].sum() + return y + + n = 10 + self.check(test_impl, n) + + X = np.arange(n * 4).reshape((n, 4)) + + def test_impl(X): + y = 0 + for i in numba.prange(X.shape[0]): + y += X[i, ts].sum() + return y + + self.check(test_impl, X) + + +@skip_parfors_unsupported +class TestParforsOptions(TestParforsBase): + + def test_parfor_options(self): + def test_impl(a): + n = a.shape[0] + b = np.ones(n) + c = np.array([ i for i in range(n) ]) + b[:n] = a + b * c + for i in prange(n): + c[i] = b[i] * a[i] + return reduce(lambda x,y:x+y, c, 0) + + self.check(test_impl, np.ones(10)) + args = (numba.float64[:],) + # everything should fuse with default option + self.assertEqual(countParfors(test_impl, args), 1) + # with no fusion + self.assertEqual(countParfors(test_impl, args, fusion=False), 6) + # with no fusion, comprehension + self.assertEqual(countParfors(test_impl, args, fusion=False, + comprehension=False), 5) + #with no fusion, comprehension, setitem + self.assertEqual(countParfors(test_impl, args, fusion=False, + comprehension=False, setitem=False), 4) + # with no fusion, comprehension, prange + self.assertEqual(countParfors(test_impl, args, fusion=False, + comprehension=False, setitem=False, prange=False), 3) + # with no fusion, comprehension, prange, reduction + self.assertEqual(countParfors(test_impl, args, fusion=False, + comprehension=False, setitem=False, prange=False, + reduction=False), 2) + # with no fusion, comprehension, prange, reduction, numpy + self.assertEqual(countParfors(test_impl, args, fusion=False, + comprehension=False, setitem=False, prange=False, + reduction=False, numpy=False), 0) + + +@skip_parfors_unsupported +class TestParforsBitMask(TestParforsBase): + + def test_parfor_bitmask1(self): + def test_impl(a, n): + b = a > n + a[b] = 0 + return a + + self.check(test_impl, np.arange(10), 5) + + def test_parfor_bitmask2(self): + def test_impl(a, b): + a[b] = 0 + return a + + a = np.arange(10) + b = a > 5 + self.check(test_impl, a, b) + + def test_parfor_bitmask3(self): + def test_impl(a, b): + a[b] = a[b] + return a + + a = np.arange(10) + b = a > 5 + self.check(test_impl, a, b) + + def test_parfor_bitmask4(self): + def test_impl(a, b): + a[b] = (2 * a)[b] + return a + + a = np.arange(10) + b = a > 5 + self.check(test_impl, a, b) + + def test_parfor_bitmask5(self): + def test_impl(a, b): + a[b] = a[b] * a[b] + return a + + a = np.arange(10) + b = a > 5 + self.check(test_impl, a, b) + + def test_parfor_bitmask6(self): + def test_impl(a, b, c): + a[b] = c + return a + + a = np.arange(10) + b = a > 5 + c = np.zeros(sum(b)) + + # expect failure due to lack of parallelism + with self.assertRaises(AssertionError) as raises: + self.check(test_impl, a, b, c) + self.assertIn("\'@do_scheduling\' not found", str(raises.exception)) + + +@skip_parfors_unsupported +class TestParforsMisc(TestParforsBase): + """ + Tests miscellaneous parts of ParallelAccelerator use. + """ + def test_no_warn_if_cache_set(self): + + def pyfunc(): + arr = np.ones(100) + for i in prange(arr.size): + arr[i] += i + return arr + + cfunc = njit(parallel=True, cache=True)(pyfunc) + + with warnings.catch_warnings(record=True) as raised_warnings: + warnings.simplefilter('always') + warnings.filterwarnings(action="ignore", + module="typeguard") + # Filter out warnings about TBB interface mismatch + warnings.filterwarnings(action='ignore', + message=r".*TBB_INTERFACE_VERSION.*", + category=numba.errors.NumbaWarning, + module=r'numba\.np\.ufunc\.parallel.*') + cfunc() + + self.assertEqual(len(raised_warnings), 0) + + # Make sure the dynamic globals flag is set + has_dynamic_globals = [cres.library.has_dynamic_globals + for cres in cfunc.overloads.values()] + self.assertEqual(has_dynamic_globals, [False]) + + def test_statement_reordering_respects_aliasing(self): + def impl(): + a = np.zeros(10) + a[1:8] = np.arange(0, 7) + print('a[3]:', a[3]) + print('a[3]:', a[3]) + return a + + cres = self.compile_parallel(impl, ()) + with captured_stdout() as stdout: + cres.entry_point() + for line in stdout.getvalue().splitlines(): + self.assertEqual('a[3]: 2.0', line) + + def test_parfor_ufunc_typing(self): + def test_impl(A): + return np.isinf(A) + + A = np.array([np.inf, 0.0]) + cfunc = njit(parallel=True)(test_impl) + # save global state + old_seq_flag = numba.parfors.parfor.sequential_parfor_lowering + try: + numba.parfors.parfor.sequential_parfor_lowering = True + np.testing.assert_array_equal(test_impl(A), cfunc(A)) + finally: + # recover global state + numba.parfors.parfor.sequential_parfor_lowering = old_seq_flag + + def test_init_block_dce(self): + # issue4690 + def test_impl(): + res = 0 + arr = [1,2,3,4,5] + numba.parfors.parfor.init_prange() + dummy = arr + for i in numba.prange(5): + res += arr[i] + return res + dummy[2] + + self.assertEqual(get_init_block_size(test_impl, ()), 0) + + def test_alias_analysis_for_parfor1(self): + def test_impl(): + acc = 0 + for _ in range(4): + acc += 1 + + data = np.zeros((acc,)) + return data + + self.check(test_impl) + + def test_no_state_change_in_gufunc_lowering_on_error(self): + # tests #5098, if there's an exception arising in gufunc lowering the + # sequential_parfor_lowering global variable should remain as False on + # stack unwind. + + BROKEN_MSG = 'BROKEN_MSG' + + @register_pass(mutates_CFG=True, analysis_only=False) + class BreakParfors(AnalysisPass): + _name = "break_parfors" + + def __init__(self): + AnalysisPass.__init__(self) + + def run_pass(self, state): + for blk in state.func_ir.blocks.values(): + for stmt in blk.body: + if isinstance(stmt, numba.parfors.parfor.Parfor): + # races should be a set(), that list is iterable + # permits it to get through to the + # _create_gufunc_for_parfor_body routine at which + # point it needs to be a set so e.g. set.difference + # can be computed, this therefore creates an error + # in the right location. + class Broken(list): + + def difference(self, other): + raise errors.LoweringError(BROKEN_MSG) + + stmt.races = Broken() + return True + + + class BreakParforsCompiler(CompilerBase): + + def define_pipelines(self): + pm = DefaultPassBuilder.define_nopython_pipeline(self.state) + pm.add_pass_after(BreakParfors, IRLegalization) + pm.finalize() + return [pm] + + + @njit(parallel=True, pipeline_class=BreakParforsCompiler) + def foo(): + x = 1 + for _ in prange(1): + x += 1 + return x + + # assert default state for global + self.assertFalse(numba.parfors.parfor.sequential_parfor_lowering) + + with self.assertRaises(errors.LoweringError) as raises: + foo() + + self.assertIn(BROKEN_MSG, str(raises.exception)) + + # assert state has not changed + self.assertFalse(numba.parfors.parfor.sequential_parfor_lowering) + + def test_issue_5098(self): + class DummyType(types.Opaque): + pass + + dummy_type = DummyType("my_dummy") + register_model(DummyType)(models.OpaqueModel) + + class Dummy(object): + pass + + @typeof_impl.register(Dummy) + def typeof_Dummy(val, c): + return dummy_type + + @unbox(DummyType) + def unbox_index(typ, obj, c): + return NativeValue(c.context.get_dummy_value()) + + @overload_method(DummyType, "method1", jit_options={"parallel":True}) + def _get_method1(obj, arr, func): + def _foo(obj, arr, func): + def baz(a, f): + c = a.copy() + c[np.isinf(a)] = np.nan + return f(c) + + length = len(arr) + output_arr = np.empty(length, dtype=np.float64) + for i in prange(length): + output_arr[i] = baz(arr[i], func) + for i in prange(length - 1): + output_arr[i] += baz(arr[i], func) + return output_arr + return _foo + + @njit + def bar(v): + return v.mean() + + @njit + def test1(d): + return d.method1(np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]), bar) + + save_state = numba.parfors.parfor.sequential_parfor_lowering + self.assertFalse(save_state) + try: + test1(Dummy()) + self.assertFalse(numba.parfors.parfor.sequential_parfor_lowering) + finally: + # always set the sequential_parfor_lowering state back to the + # original state + numba.parfors.parfor.sequential_parfor_lowering = save_state + + def test_oversized_tuple_as_arg_to_kernel(self): + + @njit(parallel=True) + def oversize_tuple(idx): + big_tup = (1,2,3,4) + z = 0 + for x in prange(10): + z += big_tup[idx] + return z + + with override_env_config('NUMBA_PARFOR_MAX_TUPLE_SIZE', '3'): + with self.assertRaises(errors.UnsupportedParforsError) as raises: + oversize_tuple(0) + + errstr = str(raises.exception) + self.assertIn("Use of a tuple", errstr) + self.assertIn("in a parallel region", errstr) + + def test_issue5167(self): + + def ndvi_njit(img_nir, img_red): + fillvalue = 0 + out_img = np.full(img_nir.shape, fillvalue, dtype=img_nir.dtype) + dims = img_nir.shape + for y in prange(dims[0]): + for x in prange(dims[1]): + out_img[y, x] = ((img_nir[y, x] - img_red[y, x]) / + (img_nir[y, x] + img_red[y, x])) + return out_img + + tile_shape = (4, 4) + array1 = np.random.uniform(low=1.0, high=10000.0, size=tile_shape) + array2 = np.random.uniform(low=1.0, high=10000.0, size=tile_shape) + self.check(ndvi_njit, array1, array2) + + def test_issue5065(self): + + def reproducer(a, dist, dist_args): + result = np.zeros((a.shape[0], a.shape[0]), dtype=np.float32) + for i in prange(a.shape[0]): + for j in range(i + 1, a.shape[0]): + d = dist(a[i], a[j], *dist_args) + result[i, j] = d + result[j, i] = d + return result + + @njit + def euclidean(x, y): + result = 0.0 + for i in range(x.shape[0]): + result += (x[i] - y[i]) ** 2 + return np.sqrt(result) + + a = np.random.random(size=(5, 2)) + + got = njit(parallel=True)(reproducer)(a.copy(), euclidean,()) + expected = reproducer(a.copy(), euclidean,()) + + np.testing.assert_allclose(got, expected) + + def test_issue5001(self): + + def test_numba_parallel(myarray): + result = [0] * len(myarray) + for i in prange(len(myarray)): + result[i] = len(myarray[i]) + return result + + myarray = (np.empty(100),np.empty(50)) + self.check(test_numba_parallel, myarray) + + def test_issue3169(self): + + @njit + def foo(grids): + pass + + @njit(parallel=True) + def bar(grids): + for x in prange(1): + foo(grids) + + # returns nothing, just check it compiles + bar(([1],) * 2) + + @disabled_test + def test_issue4846(self): + + mytype = namedtuple("mytype", ("a", "b")) + + def outer(mydata): + for k in prange(3): + inner(k, mydata) + return mydata.a + + @njit(nogil=True) + def inner(k, mydata): + f = (k, mydata.a) + g = (k, mydata.b) + + mydata = mytype(a="a", b="b") + + self.check(outer, mydata) + + def test_issue3748(self): + + def test1b(): + x = (1, 2, 3, 4, 5) + a = 0 + for i in prange(len(x)): + a += x[i] + return a + + self.check(test1b,) + + def test_issue5277(self): + + def parallel_test(size, arr): + for x in prange(size[0]): + for y in prange(size[1]): + arr[y][x] = x * 4.5 + y + return arr + + size = (10, 10) + arr = np.zeros(size, dtype=int) + + self.check(parallel_test, size, arr) + + def test_issue5570_ssa_races(self): + @njit(parallel=True) + def foo(src, method, out): + for i in prange(1): + for j in range(1): + out[i, j] = 1 + if method: + out += 1 + return out + + src = np.zeros((5,5)) + method = 57 + out = np.zeros((2, 2)) + + self.assertPreciseEqual( + foo(src, method, out), + foo.py_func(src, method, out) + ) + + def test_issue6095_numpy_max(self): + @njit(parallel=True) + def find_maxima_3D_jit(args): + package = args + for index in range(0, 10): + z_stack = package[index, :, :] + return np.max(z_stack) + + np.random.seed(0) + args = np.random.random((10, 10, 10)) + self.assertPreciseEqual( + find_maxima_3D_jit(args), + find_maxima_3D_jit.py_func(args), + ) + + def test_issue5942_1(self): + # issue5942: tests statement reordering of + # aliased arguments. + def test_impl(gg, gg_next): + gs = gg.shape + d = gs[0] + for i_gg in prange(d): + gg_next[i_gg, :] = gg[i_gg, :] + gg_next[i_gg, 0] += 1 + + return gg_next + + d = 4 + k = 2 + + gg = np.zeros((d, k), dtype = np.int32) + gg_next = np.zeros((d, k), dtype = np.int32) + self.check(test_impl, gg, gg_next) + + def test_issue5942_2(self): + # issue5942: tests statement reordering + def test_impl(d, k): + gg = np.zeros((d, k), dtype = np.int32) + gg_next = np.zeros((d, k), dtype = np.int32) + + for i_gg in prange(d): + for n in range(k): + gg[i_gg, n] = i_gg + gg_next[i_gg, :] = gg[i_gg, :] + gg_next[i_gg, 0] += 1 + + return gg_next + + d = 4 + k = 2 + + self.check(test_impl, d, k) + + @skip_unless_scipy + def test_issue6102(self): + # The problem is originally observed on Python3.8 because of the + # changes in how loops are represented in 3.8 bytecode. + @njit(parallel=True) + def f(r): + for ir in prange(r.shape[0]): + dist = np.inf + tr = np.array([0, 0, 0], dtype=np.float32) + for i in [1, 0, -1]: + dist_t = np.linalg.norm(r[ir, :] + i) + if dist_t < dist: + dist = dist_t + tr = np.array([i, i, i], dtype=np.float32) + r[ir, :] += tr + return r + + r = np.array([[0., 0., 0.], [0., 0., 1.]]) + self.assertPreciseEqual(f(r), f.py_func(r)) + + def test_issue6774(self): + + def test_impl(): + n = 5 + na_mask = np.ones((n,)) + result = np.empty((n - 1,)) + for i in prange(len(result)): + result[i] = np.sum(na_mask[i:i + 1]) + return result + + self.check(test_impl) + + def test_issue4963_globals(self): + def test_impl(): + buf = np.zeros((_GLOBAL_INT_FOR_TESTING1, _GLOBAL_INT_FOR_TESTING2)) + return buf + self.check(test_impl) + + def test_issue4963_freevars(self): + _FREEVAR_INT_FOR_TESTING1 = 17 + _FREEVAR_INT_FOR_TESTING2 = 5 + def test_impl(): + buf = np.zeros((_FREEVAR_INT_FOR_TESTING1, _FREEVAR_INT_FOR_TESTING2)) + return buf + self.check(test_impl) + + def test_issue_9182_recursion_error(self): + from numba.types import ListType, Tuple, intp + + @numba.njit + def _sink(x): + pass + + + @numba.njit(cache=False, parallel=True) + def _ground_node_rule( + clauses, + nodes, + ): + for piter in prange(len(nodes)): + for clause in clauses: + clause_type = clause[0] + clause_variables = clause[2] + if clause_type == 0: + clause_var_1 = clause_variables[0] + elif len(clause_variables) == 2: + clause_var_1, clause_var_2 = ( + clause_variables[0], + clause_variables[1], + ) + + elif len(clause_variables) == 4: + pass + + if clause_type == 1: + _sink(clause_var_1) + _sink(clause_var_2) + + _ground_node_rule.compile( + ( + ListType(Tuple([intp, intp, ListType(intp)])), + ListType(intp), + ) + ) + + def test_lookup_cycle_detection(self): + # This test is added due to a bug discovered in the PR 9244 patch. + # The cyclic detection was incorrectly flagging cycles. + @njit(parallel=True) + def foo(): + # The following `acc` variable is used in the `lookup()` function + # in parfor's reduction code. + acc = 0 + for n in prange(1): + for i in range(1): + for j in range(1): + acc += 1 + return acc + + self.assertEqual(foo(), foo.py_func()) + + def test_issue_9678_build_map(self): + def issue_9678(num_nodes): + out = 0 + for inode_uint in numba.prange(num_nodes): + inode = numba.int64(inode_uint) + p = {inode: 0.0} # mainly this build_map bytecode here + for _ in range(5): + p[inode] += 1 # and here + out += p[inode] + return out + + num_nodes = 12 + issue_9678_serial = numba.jit(parallel=False)(issue_9678) + issue_9678_parallel = numba.jit(parallel=True)(issue_9678) + self.assertEqual(issue_9678_serial(num_nodes), + issue_9678_parallel(num_nodes)) + + +@skip_parfors_unsupported +class TestParforsDiagnostics(TestParforsBase): + + def check(self, pyfunc, *args, **kwargs): + cfunc, cpfunc = self.compile_all(pyfunc, *args) + self.check_parfors_vs_others(pyfunc, cfunc, cpfunc, *args, **kwargs) + + def assert_fusion_equivalence(self, got, expected): + a = self._fusion_equivalent(got) + b = self._fusion_equivalent(expected) + self.assertEqual(a, b) + + def _fusion_equivalent(self, thing): + # parfors indexes the Parfors class instance id's from wherever the + # internal state happens to be. To assert fusion equivalence we just + # check that the relative difference between fusion adjacency lists + # is the same. For example: + # {3: [2, 1]} is the same as {13: [12, 11]} + # this function strips the indexing etc out returning something suitable + # for checking equivalence + new = defaultdict(list) + min_key = min(thing.keys()) + for k in sorted(thing.keys()): + new[k - min_key] = [x - min_key for x in thing[k]] + return new + + def assert_diagnostics(self, diagnostics, parfors_count=None, + fusion_info=None, nested_fusion_info=None, + replaced_fns=None, hoisted_allocations=None): + if parfors_count is not None: + self.assertEqual(parfors_count, diagnostics.count_parfors()) + if fusion_info is not None: + self.assert_fusion_equivalence(fusion_info, diagnostics.fusion_info) + if nested_fusion_info is not None: + self.assert_fusion_equivalence(nested_fusion_info, + diagnostics.nested_fusion_info) + if replaced_fns is not None: + repl = diagnostics.replaced_fns.values() + for x in replaced_fns: + for replaced in repl: + if replaced[0] == x: + break + else: + msg = "Replacement for %s was not found. Had %s" % (x, repl) + raise AssertionError(msg) + + if hoisted_allocations is not None: + hoisted_allocs = diagnostics.hoisted_allocations() + self.assertEqual(hoisted_allocations, len(hoisted_allocs)) + + # just make sure that the dump() function doesn't have an issue! + with captured_stdout(): + for x in range(1, 5): + diagnostics.dump(x) + + def test_array_expr(self): + def test_impl(): + n = 10 + a = np.ones(n) + b = np.zeros(n) + return a + b + + self.check(test_impl,) + cpfunc = self.compile_parallel(test_impl, ()) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + self.assert_diagnostics(diagnostics, parfors_count=1, + fusion_info = {3: [4, 5]}) + + def test_prange(self): + def test_impl(): + n = 10 + a = np.empty(n) + for i in prange(n): + a[i] = i * 10 + return a + + self.check(test_impl,) + cpfunc = self.compile_parallel(test_impl, ()) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + self.assert_diagnostics(diagnostics, parfors_count=1) + + def test_user_varname(self): + """make sure original user variable name is used in fusion info + """ + def test_impl(): + n = 10 + x = np.ones(n) + a = np.sin(x) + b = np.cos(a * a) + acc = 0 + for i in prange(n - 2): + for j in prange(n - 1): + acc += b[i] + b[j + 1] + return acc + + self.check(test_impl,) + cpfunc = self.compile_parallel(test_impl, ()) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + # make sure original 'n' variable name is used in fusion report for loop + # dimension mismatch + self.assertTrue( + any("slice(0, n, 1)" in r.message for r in diagnostics.fusion_reports)) + + def test_nested_prange(self): + def test_impl(): + n = 10 + a = np.empty((n, n)) + for i in prange(n): + for j in prange(n): + a[i, j] = i * 10 + j + return a + + self.check(test_impl,) + cpfunc = self.compile_parallel(test_impl, ()) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + self.assert_diagnostics(diagnostics, parfors_count=2, + nested_fusion_info={2: [1]}) + + def test_function_replacement(self): + def test_impl(): + n = 10 + a = np.ones(n) + b = np.argmin(a) + return b + + self.check(test_impl,) + cpfunc = self.compile_parallel(test_impl, ()) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + self.assert_diagnostics(diagnostics, parfors_count=1, + fusion_info={2: [3]}, + replaced_fns = [('argmin', 'numpy'),]) + + def test_reduction(self): + def test_impl(): + n = 10 + a = np.ones(n + 1) # prevent fusion + acc = 0 + for i in prange(n): + acc += a[i] + return acc + + self.check(test_impl,) + cpfunc = self.compile_parallel(test_impl, ()) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + self.assert_diagnostics(diagnostics, parfors_count=2) + + def test_reduction_binop(self): + def test_impl(): + n = 10 + a = np.ones(n + 1) # prevent fusion + acc = 0 + for i in prange(n): + acc = acc - a[i] + return acc + + self.check(test_impl,) + cpfunc = self.compile_parallel(test_impl, ()) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + self.assert_diagnostics(diagnostics, parfors_count=2) + + def test_setitem(self): + def test_impl(): + n = 10 + a = np.ones(n) + a[:] = 7 + return a + + self.check(test_impl,) + cpfunc = self.compile_parallel(test_impl, ()) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + self.assert_diagnostics(diagnostics, parfors_count=1) + + def test_allocation_hoisting(self): + def test_impl(): + n = 10 + m = 5 + acc = 0 + for i in prange(n): + temp = np.zeros((m,)) # the np.empty call should get hoisted + for j in range(m): + temp[j] = i + acc += temp[-1] + return acc + + self.check(test_impl,) + cpfunc = self.compile_parallel(test_impl, ()) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + self.assert_diagnostics(diagnostics, hoisted_allocations=1) + + +class TestPrangeBase(TestParforsBase): + + def generate_prange_func(self, pyfunc, patch_instance): + """ + This function does the actual code augmentation to enable the explicit + testing of `prange` calls in place of `range`. + """ + pyfunc_code = pyfunc.__code__ + + prange_names = list(pyfunc_code.co_names) + + if patch_instance is None: + # patch all instances, cheat by just switching + # range for prange + assert 'range' in pyfunc_code.co_names + prange_names = tuple([x if x != 'range' else 'prange' + for x in pyfunc_code.co_names]) + new_code = bytes(pyfunc_code.co_code) + else: + # patch specified instances... + # find where 'range' is in co_names + range_idx = pyfunc_code.co_names.index('range') + range_locations = [] + # look for LOAD_GLOBALs that point to 'range' + for instr in dis.Bytecode(pyfunc_code): + if instr.opname == 'LOAD_GLOBAL': + if _fix_LOAD_GLOBAL_arg(instr.arg) == range_idx: + range_locations.append(instr.offset + 1) + # add in 'prange' ref + prange_names.append('prange') + prange_names = tuple(prange_names) + prange_idx = len(prange_names) - 1 + if utils.PYVERSION in ((3, 11), (3, 12), (3, 13)): + # this is the inverse of _fix_LOAD_GLOBAL_arg + prange_idx = 1 + (prange_idx << 1) + elif utils.PYVERSION in ((3, 10),): + pass + else: + raise NotImplementedError(utils.PYVERSION) + new_code = bytearray(pyfunc_code.co_code) + assert len(patch_instance) <= len(range_locations) + # patch up the new byte code + for i in patch_instance: + idx = range_locations[i] + new_code[idx] = prange_idx + new_code = bytes(new_code) + + # create code object with prange mutation + prange_code = pyfunc_code.replace(co_code=new_code, + co_names=prange_names) + + # get function + pfunc = pytypes.FunctionType(prange_code, globals()) + + return pfunc + + def prange_tester(self, pyfunc, *args, **kwargs): + """ + The `prange` tester + This is a hack. It basically switches out range calls for prange. + It does this by copying the live code object of a function + containing 'range' then copying the .co_names and mutating it so + that 'range' is replaced with 'prange'. It then creates a new code + object containing the mutation and instantiates a function to contain + it. At this point three results are created: + 1. The result of calling the original python function. + 2. The result of calling a njit compiled version of the original + python function. + 3. The result of calling a njit(parallel=True) version of the mutated + function containing `prange`. + The three results are then compared and the `prange` based function's + llvm_ir is inspected to ensure the scheduler code is present. + + Arguments: + pyfunc - the python function to test + args - data arguments to pass to the pyfunc under test + + Keyword Arguments: + patch_instance - iterable containing which instances of `range` to + replace. If not present all instance of `range` are + replaced. + scheduler_type - 'signed', 'unsigned' or None, default is None. + Supply in cases where the presence of a specific + scheduler is to be asserted. + check_fastmath - if True then a check will be performed to ensure the + IR contains instructions labelled with 'fast' + check_fastmath_result - if True then a check will be performed to + ensure the result of running with fastmath + on matches that of the pyfunc + Remaining kwargs are passed to np.testing.assert_almost_equal + + + Example: + def foo(): + acc = 0 + for x in range(5): + for y in range(10): + acc +=1 + return acc + + # calling as + prange_tester(foo) + # will test code equivalent to + # def foo(): + # acc = 0 + # for x in prange(5): # <- changed + # for y in prange(10): # <- changed + # acc +=1 + # return acc + + # calling as + prange_tester(foo, patch_instance=[1]) + # will test code equivalent to + # def foo(): + # acc = 0 + # for x in range(5): # <- outer loop (0) unchanged + # for y in prange(10): # <- inner loop (1) changed + # acc +=1 + # return acc + + """ + patch_instance = kwargs.pop('patch_instance', None) + check_fastmath = kwargs.pop('check_fastmath', False) + check_fastmath_result = kwargs.pop('check_fastmath_result', False) + + pfunc = self.generate_prange_func(pyfunc, patch_instance) + + # Compile functions + # compile a standard njit of the original function + sig = tuple([numba.typeof(x) for x in args]) + cfunc = self.compile_njit(pyfunc, sig) + + # compile the prange injected function + with warnings.catch_warnings(record=True) as raised_warnings: + warnings.simplefilter('always') + cpfunc = self.compile_parallel(pfunc, sig) + + # if check_fastmath is True then check fast instructions + if check_fastmath: + self.assert_fastmath(pfunc, sig) + + # if check_fastmath_result is True then compile a function + # so that the parfors checker can assert the result is ok. + if check_fastmath_result: + fastcpfunc = self.compile_parallel_fastmath(pfunc, sig) + kwargs = dict({'fastmath_pcres': fastcpfunc}, **kwargs) + + self.check_parfors_vs_others(pyfunc, cfunc, cpfunc, *args, **kwargs) + return raised_warnings + + +@skip_parfors_unsupported +class TestPrangeBasic(TestPrangeBase): + """ Tests Prange """ + + def test_prange01(self): + def test_impl(): + n = 4 + A = np.zeros(n) + for i in range(n): + A[i] = 2.0 * i + return A + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange02(self): + def test_impl(): + n = 4 + A = np.zeros(n - 1) + for i in range(1, n): + A[i - 1] = 2.0 * i + return A + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange03(self): + def test_impl(): + s = 10 + for i in range(10): + s += 2 + return s + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange03mul(self): + def test_impl(): + s = 3 + for i in range(10): + s *= 2 + return s + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange03sub(self): + def test_impl(): + s = 100 + for i in range(10): + s -= 2 + return s + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange03div(self): + def test_impl(): + s = 10 + for i in range(10): + s /= 2 + return s + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange04(self): + def test_impl(): + a = 2 + b = 3 + A = np.empty(4) + for i in range(4): + if i == a: + A[i] = b + else: + A[i] = 0 + return A + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange05(self): + def test_impl(): + n = 4 + A = np.ones((n), dtype=np.float64) + s = 0 + for i in range(1, n - 1, 1): + s += A[i] + return s + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange06(self): + def test_impl(): + n = 4 + A = np.ones((n), dtype=np.float64) + s = 0 + for i in range(1, 1, 1): + s += A[i] + return s + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange07(self): + def test_impl(): + n = 4 + A = np.ones((n), dtype=np.float64) + s = 0 + for i in range(n, 1): + s += A[i] + return s + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange08(self): + def test_impl(): + n = 4 + A = np.ones((n)) + acc = 0 + for i in range(len(A)): + for j in range(len(A)): + acc += A[i] + return acc + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange08_1(self): + def test_impl(): + n = 4 + A = np.ones((n)) + acc = 0 + for i in range(4): + for j in range(4): + acc += A[i] + return acc + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange09(self): + def test_impl(): + n = 4 + acc = 0 + for i in range(n): + for j in range(n): + acc += 1 + return acc + # patch inner loop to 'prange' + self.prange_tester(test_impl, patch_instance=[1], + scheduler_type='unsigned', + check_fastmath=True) + + def test_prange10(self): + def test_impl(): + n = 4 + acc2 = 0 + for j in range(n): + acc1 = 0 + for i in range(n): + acc1 += 1 + acc2 += acc1 + return acc2 + # patch outer loop to 'prange' + self.prange_tester(test_impl, patch_instance=[0], + scheduler_type='unsigned', + check_fastmath=True) + + @unittest.skip("list append is not thread-safe yet (#2391, #2408)") + def test_prange11(self): + def test_impl(): + n = 4 + return [np.sin(j) for j in range(n)] + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange12(self): + def test_impl(): + acc = 0 + n = 4 + X = np.ones(n) + for i in range(-len(X)): + acc += X[i] + return acc + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + + def test_prange13(self): + def test_impl(n): + acc = 0 + for i in range(n): + acc += 1 + return acc + self.prange_tester(test_impl, np.int32(4), scheduler_type='unsigned', + check_fastmath=True) + + def test_prange14(self): + def test_impl(A): + s = 3 + for i in range(len(A)): + s += A[i]*2 + return s + # this tests reduction detection well since the accumulated variable + # is initialized before the parfor and the value accessed from the array + # is updated before accumulation + self.prange_tester(test_impl, np.random.ranf(4), + scheduler_type='unsigned', + check_fastmath=True) + + def test_prange15(self): + # from issue 2587 + # test parfor type inference when there is multi-dimensional indexing + def test_impl(N): + acc = 0 + for i in range(N): + x = np.ones((1, 1)) + acc += x[0, 0] + return acc + self.prange_tester(test_impl, 1024, scheduler_type='unsigned', + check_fastmath=True) + + # Tests for negative ranges + def test_prange16(self): + def test_impl(N): + acc = 0 + for i in range(-N, N): + acc += 2 + return acc + self.prange_tester(test_impl, 1024, scheduler_type='signed', + check_fastmath=True) + + def test_prange17(self): + def test_impl(N): + acc = 0 + X = np.ones(N) + for i in range(-N, N): + acc += X[i] + return acc + self.prange_tester(test_impl, 9, scheduler_type='signed', + check_fastmath=True) + + def test_prange18(self): + def test_impl(N): + acc = 0 + X = np.ones(N) + for i in range(-N, 5): + acc += X[i] + for j in range(-4, N): + acc += X[j] + return acc + self.prange_tester(test_impl, 9, scheduler_type='signed', + check_fastmath=True) + + def test_prange19(self): + def test_impl(N): + acc = 0 + M = N + 4 + X = np.ones((N, M)) + for i in range(-N, N): + for j in range(-M, M): + acc += X[i, j] + return acc + self.prange_tester(test_impl, 9, scheduler_type='signed', + check_fastmath=True) + + def test_prange20(self): + def test_impl(N): + acc = 0 + X = np.ones(N) + for i in range(-1, N): + acc += X[i] + return acc + self.prange_tester(test_impl, 9, scheduler_type='signed', + check_fastmath=True) + + def test_prange21(self): + def test_impl(N): + acc = 0 + for i in range(-3, -1): + acc += 3 + return acc + self.prange_tester(test_impl, 9, scheduler_type='signed', + check_fastmath=True) + + def test_prange22(self): + def test_impl(): + a = 0 + b = 3 + A = np.empty(4) + for i in range(-2, 2): + if i == a: + A[i] = b + elif i < 1: + A[i] = -1 + else: + A[i] = 7 + return A + self.prange_tester(test_impl, scheduler_type='signed', + check_fastmath=True, check_fastmath_result=True) + + def test_prange23(self): + # test non-contig input + def test_impl(A): + for i in range(len(A)): + A[i] = i + return A + A = np.zeros(32)[::2] + self.prange_tester(test_impl, A, scheduler_type='unsigned', + check_fastmath=True, check_fastmath_result=True) + + def test_prange24(self): + # test non-contig input, signed range + def test_impl(A): + for i in range(-len(A), 0): + A[i] = i + return A + A = np.zeros(32)[::2] + self.prange_tester(test_impl, A, scheduler_type='signed', + check_fastmath=True, check_fastmath_result=True) + + def test_prange25(self): + def test_impl(A): + n = len(A) + buf = [np.zeros_like(A) for _ in range(n)] + for i in range(n): + buf[i] = A + i + return buf + A = np.ones((10,)) + self.prange_tester(test_impl, A, patch_instance=[1], + scheduler_type='unsigned', check_fastmath=True, + check_fastmath_result=True) + + cpfunc = self.compile_parallel(test_impl, (numba.typeof(A),)) + diagnostics = cpfunc.metadata['parfor_diagnostics'] + hoisted_allocs = diagnostics.hoisted_allocations() + self.assertEqual(len(hoisted_allocs), 0) + + def test_prange26(self): + def test_impl(A): + B = A[::3] + for i in range(len(B)): + B[i] = i + return A + A = np.zeros(32)[::2] + self.prange_tester(test_impl, A, scheduler_type='unsigned', + check_fastmath=True, check_fastmath_result=True) + + def test_prange27(self): + # issue5597: usedef error in parfor + def test_impl(a, b, c): + for j in range(b[0]-1): + for k in range(2): + z = np.abs(a[c-1:c+1]) + return 0 + + # patch inner loop to 'prange' + self.prange_tester(test_impl, + np.arange(20), + np.asarray([4,4,4,4,4,4,4,4,4,4]), + 0, + patch_instance=[1], + scheduler_type='unsigned', + check_fastmath=True) + + def test_prange28(self): + # issue7105: label conflict in nested parfor + def test_impl(x, y): + out = np.zeros(len(y)) + for idx in range(0, len(y)): + i0 = y[idx, 0] + i1 = y[idx, 1] + Pt1 = x[i0] + Pt2 = x[i1] + v = Pt1 - Pt2 + vl2 = v[0] + v[1] + out[idx] = vl2 + return out + + X = np.array([[-1., -1.], + [-1., 1.], + [ 0., 0.], + [ 1., -1.], + [ 1., 0.], + [ 1., 1.]]) + + Y = np.array([[0, 1], + [1, 2], + [2, 3], + [3, 4], + [4, 5]]) + + self.prange_tester(test_impl, X, Y, scheduler_type='unsigned', + check_fastmath=True, check_fastmath_result=True) + + def test_prange29(self): + # issue7630: SSA renaming in prange header + def test_impl(flag): + result = 0 + if flag: + for i in range(1): + result += 1 + else: + for i in range(1): + result -= 3 + return result + + self.prange_tester(test_impl, True) + self.prange_tester(test_impl, False) + + def test_prange30(self): + # issue7675: broadcast setitem + def test_impl(x, par, numthreads): + n_par = par.shape[0] + n_x = len(x) + result = np.zeros((n_par, n_x), dtype=np.float64) + chunklen = (len(x) + numthreads - 1) // numthreads + + for i in range(numthreads): + start = i * chunklen + stop = (i + 1) * chunklen + result[:, start:stop] = x[start:stop] * par[:] + + return result + + x = np.array(np.arange(0, 6, 1.0)) + par = np.array([1.0, 2.0, 3.0]) + + self.prange_tester(test_impl, x, par, 2) + + +@register_jitable +def test_call_hoisting_outcall(a,b): + return (a, b) + + +@skip_parfors_unsupported +class TestPrangeSpecific(TestPrangeBase): + """ Tests specific features/problems found under prange""" + + def test_prange_two_instances_same_reduction_var(self): + # issue4922 - multiple uses of same reduction variable + def test_impl(n): + c = 0 + for i in range(n): + c += 1 + if i > 10: + c += 1 + return c + self.prange_tester(test_impl, 9) + + def test_prange_conflicting_reduction_ops(self): + def test_impl(n): + c = 0 + for i in range(n): + c += 1 + if i > 10: + c *= 1 + return c + + with self.assertRaises(errors.UnsupportedError) as raises: + self.prange_tester(test_impl, 9) + msg = ('Reduction variable c has multiple conflicting reduction ' + 'operators.') + self.assertIn(msg, str(raises.exception)) + + def test_prange_two_conditional_reductions(self): + # issue6414 + def test_impl(): + A = B = 0 + for k in range(1): + if k == 2: + A += 1 + else: + x = np.zeros((1, 1)) + if x[0, 0]: + B += 1 + return A, B + self.prange_tester(test_impl) + + def test_prange_nested_reduction1(self): + def test_impl(): + A = 0 + for k in range(1): + for i in range(1): + if i == 0: + A += 1 + return A + self.prange_tester(test_impl) + + @disabled_test + def test_check_error_model(self): + def test_impl(): + n = 32 + A = np.zeros(n) + for i in range(n): + A[i] = 1 / i # div-by-zero when i = 0 + return A + + with self.assertRaises(ZeroDivisionError) as raises: + test_impl() + + # compile parallel functions + pfunc = self.generate_prange_func(test_impl, None) + pcres = self.compile_parallel(pfunc, ()) + pfcres = self.compile_parallel_fastmath(pfunc, ()) + + # should raise + with self.assertRaises(ZeroDivisionError) as raises: + pcres.entry_point() + + # should not raise + result = pfcres.entry_point() + self.assertEqual(result[0], np.inf) + + def test_check_alias_analysis(self): + # check alias analysis reports ok + def test_impl(A): + for i in range(len(A)): + B = A[i] + B[:] = 1 + return A + A = np.zeros(32).reshape(4, 8) + self.prange_tester(test_impl, A, scheduler_type='unsigned', + check_fastmath=True, check_fastmath_result=True) + pfunc = self.generate_prange_func(test_impl, None) + sig = tuple([numba.typeof(A)]) + cres = self.compile_parallel_fastmath(pfunc, sig) + _ir = self._get_gufunc_ir(cres) + for k, v in _ir.items(): + for line in v.splitlines(): + # get the fn definition line + if 'define' in line and k in line: + # there should only be 2x noalias, one on each of the first + # 2 args (retptr, excinfo). + # Note: used to be 3x no noalias, but env arg is dropped. + self.assertEqual(line.count('noalias'), 2) + break + + def test_prange_raises_invalid_step_size(self): + def test_impl(N): + acc = 0 + for i in range(0, N, 2): + acc += 2 + return acc + + with self.assertRaises(errors.UnsupportedRewriteError) as raises: + self.prange_tester(test_impl, 1024) + msg = 'Only constant step size of 1 is supported for prange' + self.assertIn(msg, str(raises.exception)) + + def test_prange_fastmath_check_works(self): + # this function will benefit from `fastmath`, the div will + # get optimised to a multiply by reciprocal and the accumulator + # then becomes an fmadd: A = A + i * 0.5 + def test_impl(): + n = 128 + A = 0 + for i in range(n): + A += i / 2.0 + return A + self.prange_tester(test_impl, scheduler_type='unsigned', + check_fastmath=True) + pfunc = self.generate_prange_func(test_impl, None) + cres = self.compile_parallel_fastmath(pfunc, ()) + ir = self._get_gufunc_ir(cres) + _id = '%[A-Z_0-9]?(.[0-9]+)+[.]?[i]?' + recipr_str = r'\s+%s = fmul fast double %s, 5.000000e-01' + reciprocal_inst = re.compile(recipr_str % (_id, _id)) + fadd_inst = re.compile(r'\s+%s = fadd fast double %s, %s' + % (_id, _id, _id)) + # check there is something like: + # %.329 = fmul fast double %.325, 5.000000e-01 + # %.337 = fadd fast double %A.07, %.329 + found = False + for name, kernel in ir.items(): + # make sure to look at the kernel corresponding to the cres/pfunc + if name in cres.library.get_llvm_str(): + splitted = kernel.splitlines() + for i, x in enumerate(splitted): + if reciprocal_inst.match(x): + self.assertTrue(fadd_inst.match(splitted[i + 1])) + found = True + break + + self.assertTrue(found, "fast instruction pattern was not found.") + + def test_parfor_alias1(self): + def test_impl(n): + b = np.zeros((n, n)) + a = b[0] + for j in range(n): + a[j] = j + 1 + return b.sum() + self.prange_tester(test_impl, 4) + + def test_parfor_alias2(self): + def test_impl(n): + b = np.zeros((n, n)) + for i in range(n): + a = b[i] + for j in range(n): + a[j] = i + j + return b.sum() + self.prange_tester(test_impl, 4) + + def test_parfor_alias3(self): + def test_impl(n): + b = np.zeros((n, n, n)) + for i in range(n): + a = b[i] + for j in range(n): + c = a[j] + for k in range(n): + c[k] = i + j + k + return b.sum() + self.prange_tester(test_impl, 4) + + def test_parfor_race_1(self): + def test_impl(x, y): + for j in range(y): + k = x + return k + raised_warnings = self.prange_tester(test_impl, 10, 20) + warning_obj = raised_warnings[0] + expected_msg = ("Variable k used in parallel loop may be written to " + "simultaneously by multiple workers and may result " + "in non-deterministic or unintended results.") + self.assertIn(expected_msg, str(warning_obj.message)) + + def test_nested_parfor_push_call_vars(self): + """ issue 3686: if a prange has something inside it that causes + a nested parfor to be generated and both the inner and outer + parfor use the same call variable defined outside the parfors + then ensure that when that call variable is pushed into the + parfor that the call variable isn't duplicated with the same + name resulting in a redundant type lock. + """ + def test_impl(): + B = 0 + f = np.negative + for i in range(1): + this_matters = f(1.) + B += f(np.zeros(1,))[0] + for i in range(2): + this_matters = f(1.) + B += f(np.zeros(1,))[0] + + return B + self.prange_tester(test_impl) + + def test_copy_global_for_parfor(self): + """ issue4903: a global is copied next to a parfor so that + it can be inlined into the parfor and thus not have to be + passed to the parfor (i.e., an unsupported function type). + This global needs to be renamed in the block into which + it is copied. + """ + def test_impl(zz, tc): + lh = np.zeros(len(tc)) + lc = np.zeros(len(tc)) + for i in range(1): + nt = tc[i] + for t in range(nt): + lh += np.exp(zz[i, t]) + for t in range(nt): + lc += np.exp(zz[i, t]) + return lh, lc + + m = 2 + zz = np.ones((m, m, m)) + tc = np.ones(m, dtype=np.int_) + self.prange_tester(test_impl, zz, tc, patch_instance=[0]) + + def test_multiple_call_getattr_object(self): + def test_impl(n): + B = 0 + f = np.negative + for i in range(1): + this_matters = f(1.0) + B += f(n) + + return B + self.prange_tester(test_impl, 1.0) + + def test_argument_alias_recarray_field(self): + # Test for issue4007. + def test_impl(n): + for i in range(len(n)): + n.x[i] = 7.0 + return n + X1 = np.zeros(10, dtype=[('x', float), ('y', int), ]) + X2 = np.zeros(10, dtype=[('x', float), ('y', int), ]) + X3 = np.zeros(10, dtype=[('x', float), ('y', int), ]) + v1 = X1.view(np.recarray) + v2 = X2.view(np.recarray) + v3 = X3.view(np.recarray) + + # Numpy doesn't seem to support almost equal on recarray. + # So, we convert to list and use assertEqual instead. + python_res = list(test_impl(v1)) + njit_res = list(njit(test_impl)(v2)) + pa_func = njit(test_impl, parallel=True) + pa_res = list(pa_func(v3)) + self.assertEqual(python_res, njit_res) + self.assertEqual(python_res, pa_res) + + def test_mutable_list_param(self): + """ issue3699: test that mutable variable to call in loop + is not hoisted. The call in test_impl forces a manual + check here rather than using prange_tester. + """ + @njit + def list_check(X): + """ If the variable X is hoisted in the test_impl prange + then subsequent list_check calls would return increasing + values. + """ + ret = X[-1] + a = X[-1] + 1 + X.append(a) + return ret + def test_impl(n): + for i in prange(n): + X = [100] + a = list_check(X) + return a + python_res = test_impl(10) + njit_res = njit(test_impl)(10) + pa_func = njit(test_impl, parallel=True) + pa_res = pa_func(10) + self.assertEqual(python_res, njit_res) + self.assertEqual(python_res, pa_res) + + def test_list_comprehension_prange(self): + # issue4569 + def test_impl(x): + return np.array([len(x[i]) for i in range(len(x))]) + x = [np.array([1,2,3], dtype=int),np.array([1,2], dtype=int)] + self.prange_tester(test_impl, x) + + def test_ssa_false_reduction(self): + # issue5698 + # SSA for h creates assignments to h that make it look like a + # reduction variable except that it lacks an associated + # reduction operator. Test here that h is excluded as a + # reduction variable. + def test_impl(image, a, b): + empty = np.zeros(image.shape) + for i in range(image.shape[0]): + r = image[i][0] / 255.0 + if a == 0: + h = 0 + if b == 0: + h = 0 + empty[i] = [h, h, h] + return empty + + image = np.zeros((3, 3), dtype=np.int32) + self.prange_tester(test_impl, image, 0, 0) + + def test_list_setitem_hoisting(self): + # issue5979 + # Don't hoist list initialization if list item set. + def test_impl(): + n = 5 + a = np.empty(n, dtype=np.int64) + for k in range(5): + X = [0] + X[0] = 1 + a[k] = X[0] + return a + + self.prange_tester(test_impl) + + def test_tuple_hoisting(self): + # issue9529 + def test_impl(inputs): + outputs = [(Dict.empty(key_type=types.int64, value_type=types.float64), np.zeros(1)) for _ in range(len(inputs))] + for i in range(len(inputs)): + y = inputs[i] + out = np.zeros(1) + out[0] = i + outputs[i] = (inputs[i], out) + return outputs[0][1][0] + + N = config.NUMBA_NUM_THREADS + 1 + self.prange_tester(test_impl, [Dict.empty(key_type=types.int64, value_type=types.float64) for i in range(N)], patch_instance=[1]) + + def test_call_hoisting(self): + # issue9529 + def test_impl(inputs): + outputs = [(Dict.empty(key_type=types.int64, value_type=types.float64), np.zeros(1)) for _ in range(len(inputs))] + for i in range(len(inputs)): + y = inputs[i] + out = np.zeros(1) + out[0] = i + outputs[i] = test_call_hoisting_outcall(inputs[i], out) + return outputs[0][1][0] + + N = config.NUMBA_NUM_THREADS + 1 + self.prange_tester(test_impl, [Dict.empty(key_type=types.int64, value_type=types.float64) for i in range(N)], patch_instance=[1]) + + def test_record_array_setitem(self): + # issue6704 + state_dtype = np.dtype([('var', np.int32)]) + + def test_impl(states): + for i in range(1): + states[i]['var'] = 1 + + def comparer(a, b): + assert(a[0]['var'] == b[0]['var']) + + self.prange_tester(test_impl, + np.zeros(shape=1, dtype=state_dtype), + check_arg_equality=[comparer]) + + def test_record_array_setitem_yield_array(self): + state_dtype = np.dtype([('x', np.intp)]) + + def test_impl(states): + n = states.size + for i in range(states.size): + states["x"][i] = 7 + i + return states + + states = np.zeros(10, dtype=state_dtype) + + def comparer(a, b): + np.testing.assert_equal(a, b) + + self.prange_tester(test_impl, + states, + check_arg_equality=[comparer]) + + def test_issue7501(self): + def test_impl(size, case): + result = np.zeros((size,)) + if case == 1: + for i in range(size): + result[i] += 1 + else: + for i in range(size): + result[i] += 2 + return result[0] + + self.prange_tester(test_impl, 3, 1) + + def test_kde_example(self): + def test_impl(X): + # KDE example + b = 0.5 + points = np.array([-1.0, 2.0, 5.0]) + N = points.shape[0] + n = X.shape[0] + exps = 0 + for i in range(n): + p = X[i] + d = (-(p - points)**2) / (2 * b**2) + m = np.min(d) + exps += m - np.log(b * N) + np.log(np.sum(np.exp(d - m))) + return exps + + n = 128 + X = np.random.ranf(n) + self.prange_tester(test_impl, X) + + @skip_parfors_unsupported + def test_issue7578(self): + def test_impl(x): + A = np.zeros_like(x) + tmp = np.cos(x) # this can be any 1-arity ufunc + + for i in range(len(x)): + A[i] = tmp.sum() + + return A + + x = np.arange(10.) + self.prange_tester(test_impl, x) + +@skip_parfors_unsupported +class TestParforChunksizing(TestCase): + """ + Tests chunksize handling in ParallelAccelerator. + """ + _numba_parallel_test_ = False + + def setUp(self): + set_parallel_chunksize(0) + + def tearDown(self): + set_parallel_chunksize(0) + + def test_python_parallel_chunksize_basic(self): + # Test basic chunksize operations outside njit. + self.assertEqual(get_parallel_chunksize(), 0) + set_parallel_chunksize(8) + self.assertEqual(get_parallel_chunksize(), 8) + set_parallel_chunksize(0) + self.assertEqual(get_parallel_chunksize(), 0) + + def test_python_with_chunksize(self): + # Test "with parallel_chunksize" outside njit. + self.assertEqual(get_parallel_chunksize(), 0) + with parallel_chunksize(8): + self.assertEqual(get_parallel_chunksize(), 8) + self.assertEqual(get_parallel_chunksize(), 0) + + def test_njit_parallel_chunksize_basic(self): + # Test basic chunksize operations inside njit. + @njit + def get_cs(): + return get_parallel_chunksize() + + @njit + def set_cs(x): + return set_parallel_chunksize(x) + + self.assertEqual(get_cs(), 0) + set_cs(8) + self.assertEqual(get_cs(), 8) + set_cs(0) + self.assertEqual(get_cs(), 0) + + def test_njit_with_chunksize(self): + # Test "with parallel_chunksize" inside njit. + @njit + def test_impl(x): + cs1 = get_parallel_chunksize() + with parallel_chunksize(8): + cs2 = get_parallel_chunksize() + cs3 = get_parallel_chunksize() + return cs1, cs2, cs3 + + cs1, cs2, cs3 = test_impl(8) + + self.assertEqual(cs1, 0) + self.assertEqual(cs2, 8) + self.assertEqual(cs3, 0) + + def test_all_iterations_reset_chunksize(self): + """ Test that all the iterations get run if you set the + chunksize. Also check that the chunksize that each + worker thread sees has been reset to 0. """ + + @njit(parallel=True) + def test_impl(cs, n): + res = np.zeros(n) + inner_cs = np.full(n, -13) + with numba.parallel_chunksize(cs): + for i in numba.prange(n): + inner_cs[i] = numba.get_parallel_chunksize() + res[i] = 13 + return res, inner_cs + + # Test a variety of array and chunk sizes. + # 1000 is a round number, 997 is prime, 943 is product of two + # primes, 961 is square of a prime. + for j in [1000, 997, 943, 961]: + for i in range(15): + res, inner_cs = test_impl(i+1, j) + self.assertTrue(np.all(res == 13)) + self.assertTrue(np.all(inner_cs == 0)) + + def test_njit_parallel_chunksize_negative(self): + # Test negative set_parallel_chunksize inside njit. + with self.assertRaises(ValueError) as raised: + @njit + def neg_test(): + set_parallel_chunksize(-1) + + neg_test() + + msg = "chunksize must be greater than or equal to zero" + self.assertIn(msg, str(raised.exception)) + + def test_python_parallel_chunksize_negative(self): + # Test negative set_parallel_chunksize outside njit. + with self.assertRaises(ValueError) as raised: + set_parallel_chunksize(-1) + + msg = "chunksize must be greater than or equal to zero" + self.assertIn(msg, str(raised.exception)) + + def test_njit_parallel_chunksize_invalid_type(self): + with self.assertRaises(errors.TypingError) as raised: + @njit + def impl(): + set_parallel_chunksize('invalid_type') + + impl() + + msg = "The parallel chunksize must be an integer" + self.assertIn(msg, str(raised.exception)) + + def test_python_parallel_chunksize_invalid_type(self): + with self.assertRaises(TypeError) as raised: + set_parallel_chunksize('invalid_type') + + msg = "The parallel chunksize must be an integer" + self.assertIn(msg, str(raised.exception)) + + +@skip_parfors_unsupported +@x86_only +class TestParforsVectorizer(TestPrangeBase): + + # env mutating test + _numba_parallel_test_ = False + + def get_gufunc_asm(self, func, schedule_type, *args, **kwargs): + + fastmath = kwargs.pop('fastmath', False) + cpu_name = kwargs.pop('cpu_name', 'skylake-avx512') + assertions = kwargs.pop('assertions', True) + # force LLVM to use zmm registers for vectorization + # https://reviews.llvm.org/D67259 + cpu_features = kwargs.pop('cpu_features', '-prefer-256-bit') + + env_opts = {'NUMBA_CPU_NAME': cpu_name, + 'NUMBA_CPU_FEATURES': cpu_features, + } + + overrides = [] + for k, v in env_opts.items(): + overrides.append(override_env_config(k, v)) + + with overrides[0], overrides[1]: + sig = tuple([numba.typeof(x) for x in args]) + pfunc_vectorizable = self.generate_prange_func(func, None) + if fastmath == True: + cres = self.compile_parallel_fastmath(pfunc_vectorizable, sig) + else: + cres = self.compile_parallel(pfunc_vectorizable, sig) + + # get the gufunc asm + asm = self._get_gufunc_asm(cres) + + if assertions: + schedty = re.compile(r'call\s+\w+\*\s+@do_scheduling_(\w+)\(') + matches = schedty.findall(cres.library.get_llvm_str()) + self.assertGreaterEqual(len(matches), 1) # at least 1 parfor call + self.assertEqual(matches[0], schedule_type) + self.assertNotEqual(asm, {}) + + return asm + + @linux_only + @TestCase.run_test_in_subprocess + def test_vectorizer_fastmath_asm(self): + """ This checks that if fastmath is set and the underlying hardware + is suitable, and the function supplied is amenable to fastmath based + vectorization, that the vectorizer actually runs. + """ + + # This function will benefit from `fastmath` if run on a suitable + # target. The vectorizer should unwind the loop and generate + # packed dtype=double add and sqrt instructions. + def will_vectorize(A): + n = len(A) + acc = 0 + for i in range(n): + acc += np.sqrt(i) + return acc + + arg = np.zeros(10) + + fast_asm = self.get_gufunc_asm(will_vectorize, 'unsigned', arg, + fastmath=True) + slow_asm = self.get_gufunc_asm(will_vectorize, 'unsigned', arg, + fastmath=False) + for v in fast_asm.values(): + # should unwind and call vector sqrt then vector add + # all on packed doubles using zmm's + self.assertTrue('vaddpd' in v) + self.assertTrue('vsqrtpd' in v or '__svml_sqrt' in v) + self.assertTrue('zmm' in v) + + for v in slow_asm.values(): + # vector variants should not be present + self.assertTrue('vaddpd' not in v) + self.assertTrue('vsqrtpd' not in v) + # check scalar variant is present + self.assertTrue('vsqrtsd' in v and '__svml_sqrt' not in v) + self.assertTrue('vaddsd' in v) + # check no zmm addressing is present + self.assertTrue('zmm' not in v) + + @linux_only + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': '0'}) + def test_unsigned_refusal_to_vectorize(self): + """ This checks that if fastmath is set and the underlying hardware + is suitable, and the function supplied is amenable to fastmath based + vectorization, that the vectorizer actually runs. + """ + + def will_not_vectorize(A): + n = len(A) + for i in range(-n, 0): + A[i] = np.sqrt(A[i]) + return A + + def will_vectorize(A): + n = len(A) + for i in range(n): + A[i] = np.sqrt(A[i]) + return A + + arg = np.zeros(10) + + # Boundschecking breaks vectorization + self.assertFalse(config.BOUNDSCHECK) + novec_asm = self.get_gufunc_asm(will_not_vectorize, 'signed', arg, + fastmath=True) + + vec_asm = self.get_gufunc_asm(will_vectorize, 'unsigned', arg, + fastmath=True) + + for v in novec_asm.values(): + # vector variant should not be present + self.assertTrue('vsqrtpd' not in v) + # check scalar variant is present + self.assertTrue('vsqrtsd' in v) + # check no zmm addressing is present + self.assertTrue('zmm' not in v) + + for v in vec_asm.values(): + # should unwind and call vector sqrt then vector mov + # all on packed doubles using zmm's + self.assertTrue('vsqrtpd' in v or '__svml_sqrt' in v) + self.assertTrue('vmovupd' in v) + self.assertTrue('zmm' in v) + + @linux_only + # needed as 32bit doesn't have equivalent signed/unsigned instruction + # generation for this function + @TestCase.run_test_in_subprocess(envvars={'NUMBA_BOUNDSCHECK': '0'}) + def test_signed_vs_unsigned_vec_asm(self): + """ This checks vectorization for signed vs unsigned variants of a + trivial accumulator, the only meaningful difference should be the + presence of signed vs. unsigned unpack instructions (for the + induction var). + """ + def signed_variant(): + n = 4096 + A = 0. + for i in range(-n, 0): + A += i + return A + + def unsigned_variant(): + n = 4096 + A = 0. + for i in range(n): + A += i + return A + + # Boundschecking breaks the diff check below because of the pickled exception + self.assertFalse(config.BOUNDSCHECK) + signed_asm = self.get_gufunc_asm(signed_variant, 'signed', + fastmath=True) + unsigned_asm = self.get_gufunc_asm(unsigned_variant, 'unsigned', + fastmath=True) + + def strip_instrs(asm): + acc = [] + for x in asm.splitlines(): + spd = x.strip() + # filter out anything that isn't a trivial instruction + # and anything with the gufunc id as it contains an address + if spd != '' and not (spd.startswith('.') + or spd.startswith('_') + or spd.startswith('"') + or '__numba_parfor_gufunc' in spd): + acc.append(re.sub('[\t]', '', spd)) + return acc + + for k, v in signed_asm.items(): + signed_instr = strip_instrs(v) + break + + for k, v in unsigned_asm.items(): + unsigned_instr = strip_instrs(v) + break + + from difflib import SequenceMatcher as sm + # make sure that the only difference in instruction (if there is a + # difference) is the char 'u'. For example: + # vcvtsi2sdq vs. vcvtusi2sdq + self.assertEqual(len(signed_instr), len(unsigned_instr)) + for a, b in zip(signed_instr, unsigned_instr): + if a == b: + continue + else: + s = sm(lambda x: x == '\t', a, b) + ops = s.get_opcodes() + for op in ops: + if op[0] == 'insert': + self.assertEqual(b[op[-2]:op[-1]], 'u') + + +@skip_parfors_unsupported +class TestParforReductionSetNumThreads(TestCase): + """Test execution correctness on reductions with set_num_threads. + """ + def test_add(self): + N = config.NUMBA_NUM_THREADS + M = 2 * N + mask = N - 1 + + @njit(parallel=True) + def udt(nthreads): + acc = 0 + set_num_threads(nthreads) + for i in prange(M): + local_mask = 1 + i % mask + set_num_threads(local_mask) + gnt = get_num_threads() + acc += gnt + return acc + + expect = udt.py_func(mask) + got = udt(mask) + self.assertPreciseEqual(expect, got) + + def test_mul(self): + # This min will prevent larger thread counts from generating + # overflow in the loop below. + N = min(4, config.NUMBA_NUM_THREADS) + M = 2 * N + mask = N - 1 + + @njit(parallel=True) + def udt(nthreads): + acc = 1 + set_num_threads(nthreads) + for i in prange(M): + local_mask = 1 + i % mask + set_num_threads(local_mask) + gnt = get_num_threads() + acc *= gnt + return acc + + expect = udt.py_func(mask) + got = udt(mask) + self.assertPreciseEqual(expect, got) + + def test_max(self): + N = config.NUMBA_NUM_THREADS + M = 2 * N + mask = N - 1 + + @njit(parallel=True) + def udt(nthreads): + acc = 1 + set_num_threads(nthreads) + for i in prange(M): + local_mask = 1 + i % mask + set_num_threads(local_mask) + gnt = get_num_threads() + acc = max(acc, gnt) + return acc + + expect = udt.py_func(mask) + got = udt(mask) + self.assertPreciseEqual(expect, got) + + +@skip_parfors_unsupported +class TestDiagnosticEnvVar(TestCase): + @TestCase.run_test_in_subprocess() + def test_diagnostics_env_var1(self): + os.environ['NUMBA_PARALLEL_DIAGNOSTICS']='4' + with captured_stdout() as stdout: + @njit(parallel=True) + def impl(): + n = 100 + b = np.zeros((n), dtype=np.float64) + for i in prange(n): + b[i] = 1 + return b + + impl() + the_output = stdout.getvalue() + self.assertIn("Parallel Accelerator Optimizing", the_output) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parfors_caching.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parfors_caching.py new file mode 100644 index 0000000000000000000000000000000000000000..87ee3c0e1a2deb35ce4ef84f4aa67ff313f3d973 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parfors_caching.py @@ -0,0 +1,83 @@ +import os.path +import subprocess +import sys + +import numpy as np + +from numba.tests.support import skip_parfors_unsupported +from .test_caching import DispatcherCacheUsecasesTest + + +@skip_parfors_unsupported +class TestParforsCache(DispatcherCacheUsecasesTest): + here = os.path.dirname(__file__) + usecases_file = os.path.join(here, "parfors_cache_usecases.py") + modname = "parfors_caching_test_fodder" + + def run_test(self, fname, num_funcs=1): + mod = self.import_module() + self.check_pycache(0) + f = getattr(mod, fname) + ary = np.ones(10) + # The result of these functions is derived from e.g. out of order + # accumulation so allclose should be fine. + np.testing.assert_allclose(f(ary), f.py_func(ary)) + + dynamic_globals = [cres.library.has_dynamic_globals + for cres in f.overloads.values()] + [cres] = f.overloads.values() + self.assertEqual(dynamic_globals, [False]) + # For each cached func, there're 2 entries (index + data) + self.check_pycache(num_funcs * 2) + + self.run_in_separate_process() + + def test_arrayexprs(self): + f = 'arrayexprs_case' + self.run_test(f) + + def test_prange(self): + f = 'prange_case' + self.run_test(f) + + def test_caller(self): + f = 'caller_case' + # num_funcs=3 because, there's the `caller_case()` which calls + # the `prange_case()` and `arrayexprs_case()` + self.run_test(f, num_funcs=3) + + +@skip_parfors_unsupported +class TestParforsCacheChangingThreads(DispatcherCacheUsecasesTest): + # NOTE: This test is checking issue #7518, that thread counts are not + # baked into cached objects. + + here = os.path.dirname(__file__) + usecases_file = os.path.join(here, "parfors_cache_usecases.py") + modname = "parfors_caching_test_fodder" + + def run_in_separate_process(self, thread_count): + # Cached functions can be run from a distinct process. + code = """if 1: + import sys + + sys.path.insert(0, %(tempdir)r) + mod = __import__(%(modname)r) + mod.self_run() + """ % dict(tempdir=self.tempdir, modname=self.modname) + + new_env = {**os.environ, "NUMBA_NUM_THREADS" : str(thread_count)} + popen = subprocess.Popen([sys.executable, "-c", code], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + env=new_env) + out, err = popen.communicate() + if popen.returncode != 0: + raise AssertionError(f"process failed with code {popen.returncode}:" + f"stderr follows\n{err.decode()}\n") + + def test_caching(self): + self.check_pycache(0) + self.run_in_separate_process(1) + self.check_pycache(3 * 2) # ran 3 functions, 2 entries each + self.run_in_separate_process(2) + self.check_pycache(3 * 2) # ran 3 functions, 2 entries each diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parfors_passes.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parfors_passes.py new file mode 100644 index 0000000000000000000000000000000000000000..2e8c23fe6ca75236b1acd5faf9bf76953d8840dd --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_parfors_passes.py @@ -0,0 +1,676 @@ +""" +Tests for sub-components of parfors. +These tests are aimed to produce a good-enough coverage of parfor passes +so that refactoring on these passes are easier with faster testing turnaround. +""" +import unittest +from functools import reduce + +import numpy as np + +from numba import njit, typeof, prange, pndindex +import numba.parfors.parfor +from numba.core import ( + rewrites, + typed_passes, + untyped_passes, + inline_closurecall, + compiler, + cpu, + errors +) +from numba.core.registry import cpu_target +from numba.tests.support import (TestCase, is_parfors_unsupported) + + +class MyPipeline(object): + def __init__(self, typingctx, targetctx, args, test_ir): + self.state = compiler.StateDict() + self.state.typingctx = typingctx + self.state.targetctx = targetctx + self.state.args = args + self.state.func_ir = test_ir + self.state.typemap = None + self.state.return_type = None + self.state.calltypes = None + self.state.metadata = {} + + +class BaseTest(TestCase): + @classmethod + def _run_parfor(cls, test_func, args, swap_map=None): + # TODO: refactor this with get_optimized_numba_ir() where this is + # copied from + typingctx = cpu_target.typing_context + targetctx = cpu_target.target_context + test_ir = compiler.run_frontend(test_func) + options = cpu.ParallelOptions(True) + + tp = MyPipeline(typingctx, targetctx, args, test_ir) + + typingctx.refresh() + targetctx.refresh() + + inline_pass = inline_closurecall.InlineClosureCallPass( + tp.state.func_ir, options, typed=True + ) + inline_pass.run() + + rewrites.rewrite_registry.apply("before-inference", tp.state) + + untyped_passes.ReconstructSSA().run_pass(tp.state) + + ( + tp.state.typemap, + tp.state.return_type, + tp.state.calltypes, + _ + ) = typed_passes.type_inference_stage( + tp.state.typingctx, tp.state.targetctx, tp.state.func_ir, + tp.state.args, None + ) + + typed_passes.PreLowerStripPhis().run_pass(tp.state) + + diagnostics = numba.parfors.parfor.ParforDiagnostics() + + preparfor_pass = numba.parfors.parfor.PreParforPass( + tp.state.func_ir, + tp.state.typemap, + tp.state.calltypes, + tp.state.typingctx, + tp.state.targetctx, + options, + swapped=diagnostics.replaced_fns, + replace_functions_map=swap_map, + ) + preparfor_pass.run() + + rewrites.rewrite_registry.apply("after-inference", tp.state) + return tp, options, diagnostics, preparfor_pass + + @classmethod + def run_parfor_sub_pass(cls, test_func, args): + tp, options, diagnostics, _ = cls._run_parfor(test_func, args) + + flags = compiler.Flags() + parfor_pass = numba.parfors.parfor.ParforPass( + tp.state.func_ir, + tp.state.typemap, + tp.state.calltypes, + tp.state.return_type, + tp.state.typingctx, + tp.state.targetctx, + options, + flags, + tp.state.metadata, + diagnostics=diagnostics, + ) + parfor_pass._pre_run() + # Run subpass + sub_pass = cls.sub_pass_class(parfor_pass) + sub_pass.run(parfor_pass.func_ir.blocks) + + return sub_pass + + @classmethod + def run_parfor_pre_pass(cls, test_func, args, swap_map=None): + tp, options, diagnostics, preparfor_pass = cls._run_parfor( + test_func, args, swap_map + ) + return preparfor_pass + + def _run_parallel(self, func, *args, **kwargs): + cfunc = njit(parallel=True)(func) + expect = func(*args, **kwargs) + got = cfunc(*args, **kwargs) + return expect, got + + def run_parallel(self, func, *args, **kwargs): + if is_parfors_unsupported: + # Skip + return + expect, got = self._run_parallel(func, *args, **kwargs) + self.assertPreciseEqual(expect, got) + + def run_parallel_check_output_array(self, func, *args, **kwargs): + if is_parfors_unsupported: + # Skip + return + expect, got = self._run_parallel(func, *args, **kwargs) + # Don't match the value, just the return type. must return array + self.assertIsInstance(expect, np.ndarray) + self.assertIsInstance(got, np.ndarray) + self.assertEqual(expect.shape, got.shape) + + def check_records(self, records): + for rec in records: + self.assertIsInstance(rec["new"], numba.parfors.parfor.Parfor) + + +class TestConvertSetItemPass(BaseTest): + sub_pass_class = numba.parfors.parfor.ConvertSetItemPass + + def test_setitem_full_slice(self): + def test_impl(): + n = 10 + a = np.ones(n) + a[:] = 7 + return a + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "slice") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + def test_setitem_slice_stop_bound(self): + def test_impl(): + n = 10 + a = np.ones(n) + a[:5] = 7 + return a + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "slice") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + def test_setitem_slice_start_bound(self): + def test_impl(): + n = 10 + a = np.ones(n) + a[4:] = 7 + return a + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "slice") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + def test_setitem_gather_if_scalar(self): + def test_impl(): + n = 10 + a = np.ones(n) + b = np.ones_like(a, dtype=np.bool_) + a[b] = 7 + return a + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "masked_assign_broadcast_scalar") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + def test_setitem_gather_if_array(self): + def test_impl(): + n = 10 + a = np.ones(n) + b = np.ones_like(a, dtype=np.bool_) + c = np.ones_like(a) + a[b] = c[b] + return a + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "masked_assign_array") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + +class TestConvertNumpyPass(BaseTest): + sub_pass_class = numba.parfors.parfor.ConvertNumpyPass + + def check_numpy_allocators(self, fn): + def test_impl(): + n = 10 + a = fn(n) + return a + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "numpy_allocator") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + def check_numpy_random(self, fn): + def test_impl(): + n = 10 + a = fn(n) + return a + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "numpy_allocator") + self.check_records(sub_pass.rewritten) + + self.run_parallel_check_output_array(test_impl) + + def test_numpy_allocators(self): + fns = [np.ones, np.zeros] + for fn in fns: + with self.subTest(fn.__name__): + self.check_numpy_allocators(fn) + + def test_numpy_random(self): + fns = [np.random.random] + for fn in fns: + with self.subTest(fn.__name__): + self.check_numpy_random(fn) + + def test_numpy_arrayexpr(self): + def test_impl(a, b): + return a + b + + a = b = np.ones(10) + + args = (a, b) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "arrayexpr") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl, *args) + + def test_numpy_arrayexpr_ufunc(self): + def test_impl(a, b): + return np.sin(-a) + np.float64(1) / np.sqrt(b) + + a = b = np.ones(10) + + args = (a, b) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "arrayexpr") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl, *args) + + def test_numpy_arrayexpr_boardcast(self): + def test_impl(a, b): + return a + b + np.array(1) + + a = np.ones(10) + b = np.ones((3, 10)) + + args = (a, b) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "arrayexpr") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl, *args) + + def test_numpy_arrayexpr_reshaped(self): + def test_impl(a, b): + a = a.reshape(1, a.size) # shape[0] is now constant + return a + b + + a = np.ones(10) + b = np.ones(10) + + args = (a, b) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "arrayexpr") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl, *args) + + +class TestConvertReducePass(BaseTest): + sub_pass_class = numba.parfors.parfor.ConvertReducePass + + def test_reduce_max_basic(self): + def test_impl(arr): + return reduce(lambda x, y: max(x, y), arr, 0.0) + + x = np.ones(10) + args = (x,) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "reduce") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl, *args) + + def test_reduce_max_masked(self): + def test_impl(arr): + return reduce(lambda x, y: max(x, y), arr[arr > 5], 0.0) + + x = np.ones(10) + args = (x,) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "reduce") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl, *args) + + +class TestConvertLoopPass(BaseTest): + sub_pass_class = numba.parfors.parfor.ConvertLoopPass + + def test_prange_reduce_simple(self): + def test_impl(): + n = 20 + c = 0 + for i in prange(n): + c += i + return c + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + def test_prange_map_simple(self): + def test_impl(): + n = 20 + arr = np.ones(n) + for i in prange(n): + arr[i] += i + return arr + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + def test_prange_two_args(self): + def test_impl(): + n = 20 + arr = np.ones(n) + for i in prange(3, n): + arr[i] += i + return arr + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + def test_prange_three_args(self): + def test_impl(): + n = 20 + arr = np.ones(n) + for i in prange(3, n, 2): + arr[i] += i + return arr + + with self.assertRaises(errors.UnsupportedRewriteError) as raises: + self.run_parfor_sub_pass(test_impl, ()) + self.assertIn( + "Only constant step size of 1 is supported for prange", + str(raises.exception), + ) + + def test_prange_map_inner_loop(self): + def test_impl(): + n = 20 + arr = np.ones((n, n)) + for i in prange(n): + for j in range(i): + arr[i, j] += i + j * n + return arr + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + self.check_records(sub_pass.rewritten) + + self.run_parallel(test_impl) + + def test_prange_map_nested_prange(self): + def test_impl(): + n = 20 + arr = np.ones((n, n)) + for i in prange(n): + for j in prange(i): + arr[i, j] += i + j * n + return arr + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 2) + self.check_records(sub_pass.rewritten) + for record in sub_pass.rewritten: + self.assertEqual(record["reason"], "loop") + + self.run_parallel(test_impl) + + def test_prange_map_none_index(self): + def test_impl(): + n = 20 + arr = np.ones(n) + for i in prange(n): + inner = arr[i : i + 1] + inner[()] += 1 + return arr + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + self.check_records(sub_pass.rewritten) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + + self.run_parallel(test_impl) + + def test_prange_map_overwrite_index(self): + def test_impl(): + n = 20 + arr = np.ones(n) + for i in prange(n): + i += 1 + arr[i - 1] = i + return arr + + with self.assertRaises(errors.UnsupportedRewriteError) as raises: + self.run_parfor_sub_pass(test_impl, ()) + self.assertIn( + "Overwrite of parallel loop index", + str(raises.exception), + ) + + def test_init_prange(self): + def test_impl(): + n = 20 + arr = np.ones(n) + numba.parfors.parfor.init_prange() + val = 0 + for i in numba.parfors.parfor.internal_prange(len(arr)): + val += arr[i] + return val + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + self.check_records(sub_pass.rewritten) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + + self.run_parallel(test_impl) + + def test_pndindex(self): + def test_impl(): + n = 20 + arr = np.ones((n, n)) + val = 0 + for idx in pndindex(arr.shape): + val += idx[0] * idx[1] + return val + + sub_pass = self.run_parfor_sub_pass(test_impl, ()) + self.assertEqual(len(sub_pass.rewritten), 1) + self.check_records(sub_pass.rewritten) + + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + + self.run_parallel(test_impl) + + def test_numpy_sum(self): + def test_impl(arr): + return np.sum(arr) + + shape = 11, 13 + arr = np.arange(np.prod(shape)).reshape(shape) + args = (arr,) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + self.check_records(sub_pass.rewritten) + self.run_parallel(test_impl, *args) + + def test_numpy_sum_bool_array_masked(self): + def test_impl(arr): + sliced = arr[:, 0] + return np.sum(arr[sliced >= 3, 1:2]) + + shape = 11, 13 + arr = np.arange(np.prod(shape)).reshape(shape) + args = (arr,) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + self.check_records(sub_pass.rewritten) + self.run_parallel(test_impl, *args) + + def test_numpy_sum_int_array_masked(self): + def test_impl(arr): + sel = np.arange(arr.shape[1]) + return np.sum(arr[:, sel]) + + shape = 11, 13 + arr = np.arange(np.prod(shape)).reshape(shape) + args = (arr,) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + # 1 for arange; 1 for sum + self.assertEqual(len(sub_pass.rewritten), 2) + for record in sub_pass.rewritten: + self.assertEqual(record["reason"], "loop") + self.check_records(sub_pass.rewritten) + self.run_parallel(test_impl, *args) + + def test_numpy_fill_method(self): + def test_impl(arr): + arr.fill(3) + return arr + + shape = 11, 13 + arr = np.arange(np.prod(shape)).reshape(shape) + args = (arr,) + argtypes = [typeof(x) for x in args] + + sub_pass = self.run_parfor_sub_pass(test_impl, argtypes) + # 1 for arange; 1 for sum + self.assertEqual(len(sub_pass.rewritten), 1) + [record] = sub_pass.rewritten + self.assertEqual(record["reason"], "loop") + self.check_records(sub_pass.rewritten) + self.run_parallel(test_impl, *args) + + +class TestPreParforPass(BaseTest): + class sub_pass_class: + def __init__(self, pass_states): + pass + + def run(self, blocks): + pass + + def test_dtype_conversion(self): + # array.dtype are converted to np.dtype(array) in the PreParforPass + def test_impl(a): + b = np.ones(20, dtype=a.dtype) + return b + + arr = np.arange(10) + args = (arr,) + argtypes = [typeof(x) for x in args] + + pre_pass = self.run_parfor_pre_pass(test_impl, argtypes) + self.assertEqual(pre_pass.stats["replaced_func"], 0) + self.assertEqual(pre_pass.stats["replaced_dtype"], 1) + self.run_parallel(test_impl, *args) + + def test_sum_replacement(self): + def test_impl(a): + return np.sum(a) + + arr = np.arange(10) + args = (arr,) + argtypes = [typeof(x) for x in args] + + pre_pass = self.run_parfor_pre_pass(test_impl, argtypes) + self.assertEqual(pre_pass.stats["replaced_func"], 1) + self.assertEqual(pre_pass.stats["replaced_dtype"], 0) + self.run_parallel(test_impl, *args) + + def test_replacement_map(self): + def test_impl(a): + return np.sum(a) + + arr = np.arange(10) + args = (arr,) + argtypes = [typeof(x) for x in args] + + swap_map = numba.parfors.parfor.swap_functions_map.copy() + swap_map.pop(("sum", "numpy")) + pre_pass = self.run_parfor_pre_pass(test_impl, argtypes, swap_map) + self.assertEqual(pre_pass.stats["replaced_func"], 0) + self.assertEqual(pre_pass.stats["replaced_dtype"], 0) + self.run_parallel(test_impl, *args) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_pipeline.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_pipeline.py new file mode 100644 index 0000000000000000000000000000000000000000..5a04da1bb69bc2c71c711452c4438a3337e2a779 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_pipeline.py @@ -0,0 +1,143 @@ +from numba.core.compiler import Compiler, DefaultPassBuilder +from numba.core.compiler_machinery import (FunctionPass, AnalysisPass, + register_pass) +from numba.core.untyped_passes import InlineInlinables +from numba.core.typed_passes import IRLegalization +from numba import jit, objmode, njit, cfunc +from numba.core import types, postproc, errors +from numba.core.ir import FunctionIR +from numba.tests.support import TestCase + + +class TestCustomPipeline(TestCase): + def setUp(self): + super(TestCustomPipeline, self).setUp() + + # Define custom pipeline class + class CustomPipeline(Compiler): + custom_pipeline_cache = [] + + def compile_extra(self, func): + # Store the compiled function + self.custom_pipeline_cache.append(func) + return super(CustomPipeline, self).compile_extra(func) + + def compile_ir(self, func_ir, *args, **kwargs): + # Store the compiled function + self.custom_pipeline_cache.append(func_ir) + return super(CustomPipeline, self).compile_ir( + func_ir, *args, **kwargs) + + self.pipeline_class = CustomPipeline + + def test_jit_custom_pipeline(self): + self.assertListEqual(self.pipeline_class.custom_pipeline_cache, []) + + @jit(pipeline_class=self.pipeline_class) + def foo(x): + return x + + self.assertEqual(foo(4), 4) + self.assertListEqual(self.pipeline_class.custom_pipeline_cache, + [foo.py_func]) + + def test_cfunc_custom_pipeline(self): + self.assertListEqual(self.pipeline_class.custom_pipeline_cache, []) + + @cfunc(types.int64(types.int64), pipeline_class=self.pipeline_class) + def foo(x): + return x + + self.assertEqual(foo(4), 4) + self.assertListEqual(self.pipeline_class.custom_pipeline_cache, + [foo.__wrapped__]) + + def test_objmode_custom_pipeline(self): + self.assertListEqual(self.pipeline_class.custom_pipeline_cache, []) + + @jit(pipeline_class=self.pipeline_class) + def foo(x): + with objmode(x="intp"): + x += int(0x1) + return x + + arg = 123 + self.assertEqual(foo(arg), arg + 1) + # Two items in the list. + self.assertEqual(len(self.pipeline_class.custom_pipeline_cache), 2) + # First item is the `foo` function + first = self.pipeline_class.custom_pipeline_cache[0] + self.assertIs(first, foo.py_func) + # Second item is a FunctionIR of the obj-lifted function + second = self.pipeline_class.custom_pipeline_cache[1] + self.assertIsInstance(second, FunctionIR) + + +class TestPassManagerFunctionality(TestCase): + + def _create_pipeline_w_del(self, base=None, inject_after=None): + """ + Creates a new compiler pipeline with the _InjectDelsPass injected after + the pass supplied in kwarg 'inject_after'. + """ + self.assertTrue(inject_after is not None) + self.assertTrue(base is not None) + + @register_pass(mutates_CFG=False, analysis_only=False) + class _InjectDelsPass(base): + """ + This pass injects ir.Del nodes into the IR + """ + _name = "inject_dels_%s" % str(base) + + def __init__(self): + base.__init__(self) + + def run_pass(self, state): + pp = postproc.PostProcessor(state.func_ir) + pp.run(emit_dels=True) + return True + + class TestCompiler(Compiler): + + def define_pipelines(self): + pm = DefaultPassBuilder.define_nopython_pipeline(self.state) + pm.add_pass_after(_InjectDelsPass, inject_after) + pm.finalize() + return [pm] + + return TestCompiler + + def test_compiler_error_on_ir_del_from_functionpass(self): + new_compiler = self._create_pipeline_w_del(FunctionPass, + InlineInlinables) + + @njit(pipeline_class=new_compiler) + def foo(x): + return x + 1 + + with self.assertRaises(errors.CompilerError) as raises: + foo(10) + + errstr = str(raises.exception) + + self.assertIn("Illegal IR, del found at:", errstr) + self.assertIn("del x", errstr) + + def test_no_compiler_error_on_ir_del_after_legalization(self): + # Legalization should be the last FunctionPass to execute so it's fine + # for it to emit ir.Del nodes as no further FunctionPasses will run and + # therefore the checking routine in the PassManager won't execute. + # This test adds a new pass that is an AnalysisPass into the pipeline + # after legalisation, this pass will return with already existing dels + # in the IR but by virtue of it being an AnalysisPass the checking + # routine won't execute. + + new_compiler = self._create_pipeline_w_del(AnalysisPass, + IRLegalization) + + @njit(pipeline_class=new_compiler) + def foo(x): + return x + 1 + + self.assertTrue(foo(10), foo.py_func(10)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_polynomial.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_polynomial.py new file mode 100644 index 0000000000000000000000000000000000000000..ecc8291f0502df6893a7216aede5195fec503f16 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_polynomial.py @@ -0,0 +1,577 @@ +import gc +from itertools import product + +import numpy as np +from numpy.polynomial import polynomial as poly +from numpy.polynomial import polyutils as pu + +from numba import jit, njit +from numba.tests.support import (TestCase, needs_lapack, + EnableNRTStatsMixin, MemoryLeakMixin) +from numba.core.errors import TypingError + + +def roots_fn(p): + return np.roots(p) + + +def polyadd(c1,c2): + return poly.polyadd(c1,c2) + + +def polysub(c1,c2): + return poly.polysub(c1,c2) + + +def polymul(c1,c2): + return poly.polymul(c1,c2) + + +def trimseq(seq): + return pu.trimseq(seq) + + +def polyasseries1(a): + res = pu.as_series(a) + return res + + +def polyasseries2(a, trim): + res = pu.as_series(a, trim) + return res + + +def polydiv(c1, c2): + res = poly.polydiv(c1, c2) + return res + + +def polyval2(x, c): + res = poly.polyval(x, c) + return res + + +def polyval3T(x, c): + res = poly.polyval(x, c, True) + return res + + +def polyval3F(x, c): + res = poly.polyval(x, c, False) + return res + + +def polyint(c, m=1): + res = poly.polyint(c, m) + return res + + +class TestPolynomialBase(EnableNRTStatsMixin, TestCase): + """ + Provides setUp and common data/error modes for testing polynomial functions. + """ + + # supported dtypes + dtypes = (np.float64, np.float32, np.complex128, np.complex64) + + def setUp(self): + # Collect leftovers from previous test cases before checking for leaks + gc.collect() + super(TestPolynomialBase, self).setUp() + + def assert_error(self, cfunc, args, msg, err=ValueError): + with self.assertRaises(err) as raises: + cfunc(*args) + self.assertIn(msg, str(raises.exception)) + + def assert_1d_input(self, cfunc, args): + msg = "Input must be a 1d array." + self.assert_error(cfunc, args, msg) + + +class TestPoly1D(TestPolynomialBase): + + def assert_no_domain_change(self, name, cfunc, args): + msg = name + "() argument must not cause a domain change." + self.assert_error(cfunc, args, msg) + + @needs_lapack + def test_roots(self): + + cfunc = jit(nopython=True)(roots_fn) + + default_resolution = np.finfo(np.float64).resolution + + def check(a, **kwargs): + expected = roots_fn(a, **kwargs) + got = cfunc(a, **kwargs) + + # eigen decomposition used so type specific impl + # will be used in numba whereas a wide type impl + # will be used in numpy, so compare using a more + # fuzzy comparator + + if a.dtype in self.dtypes: + resolution = np.finfo(a.dtype).resolution + else: + # this is for integer types when roots() will cast to float64 + resolution = default_resolution + + np.testing.assert_allclose( + expected, + got, + rtol=10 * resolution, + atol=100 * resolution # zeros tend to be fuzzy + ) + + # Ensure proper resource management + with self.assertNoNRTLeak(): + cfunc(a, **kwargs) + + # test vectors in real space + # contrived examples to trip branches + r_vectors = ( + np.array([1]), + np.array([1, 3, 2]), + np.array([0, 0, 0]), + np.array([1, 6, 11, 6]), + np.array([0, 0, 0, 1, 3, 2]), + np.array([1, 1, 0, 0, 0]), + np.array([0, 0, 1, 0, 0, 0]) + ) + + # test loop real space + for v, dtype in \ + product(r_vectors, [np.int32, np.int64] + list(self.dtypes)): + a = v.astype(dtype) + check(a) + + c_vectors = ( + np.array([1 + 1j]), + np.array([1, 3 + 1j, 2]), + np.array([0, 0 + 0j, 0]), + np.array([1, 6 + 1j, 11, 6]), + np.array([0, 0, 0, 1 + 1j, 3, 2]), + np.array([1 + 1j, 1, 0, 0, 0]), + np.array([0, 0, 1 + 1j, 0, 0, 0]) + ) + + # test loop complex space + for v, dtype in product(c_vectors, self.dtypes[2:]): + a = v.astype(dtype) + check(a) + + # check input with dimension > 1 raises + self.assert_1d_input(cfunc, (np.arange(4.).reshape(2, 2),)) + + # check real input with complex roots raises + x = np.array([7., 2., 0., 1.]) + self.assert_no_domain_change("eigvals", cfunc, (x,)) + # but works fine if type conv to complex first + cfunc(x.astype(np.complex128)) + + +class TestPolynomial(MemoryLeakMixin, TestCase): + + # + # tests for Polyutils functions + # + + def test_trimseq_basic(self): + pyfunc = trimseq + cfunc = njit(trimseq) + + def inputs(): + for i in range(5): + yield np.array([1] + [0] * i) + + for coefs in inputs(): + self.assertPreciseEqual(pyfunc(coefs), cfunc(coefs)) + + def test_trimseq_exception(self): + cfunc = njit(trimseq) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc") + self.assertIn('The argument "seq" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as e: + cfunc(np.arange(10).reshape(5, 2)) + self.assertIn('Coefficient array is not 1-d', + str(e.exception)) + + with self.assertRaises(TypingError) as e: + cfunc((1, 2, 3, 0)) + self.assertIn('Unsupported type UniTuple(int64, 4) for argument "seq"', + str(e.exception)) + + def test_pu_as_series_basic(self): + pyfunc1 = polyasseries1 + cfunc1 = njit(polyasseries1) + pyfunc2 = polyasseries2 + cfunc2 = njit(polyasseries2) + + def inputs(): + yield np.arange(4) + yield np.arange(6).reshape((2,3)) + yield (1, np.arange(3), np.arange(2, dtype=np.float32)) + yield ([1, 2, 3, 4, 0], [1, 2, 3]) + yield ((0, 0, 1e-3, 0, 1e-5, 0, 0), (1, 2, 3, 4, 5, 6, 7)) + yield ((0, 0, 1e-3, 0, 1e-5, 0, 0), (1j, 2, 3j, 4j, 5, 6j, 7)) + yield (2, [1.1, 0.]) + yield ([1, 2, 3, 0], ) + yield ((1, 2, 3, 0), ) + yield (np.array([1, 2, 3, 0]), ) + yield [np.array([1, 2, 3, 0]), np.array([1, 2, 3, 0])] + yield [np.array([1,2,3]), ] + + for input in inputs(): + self.assertPreciseEqual(pyfunc1(input), cfunc1(input)) + self.assertPreciseEqual(pyfunc2(input, False), cfunc2(input, False)) + self.assertPreciseEqual(pyfunc2(input, True), cfunc2(input, True)) + + def test_pu_as_series_exception(self): + cfunc1 = njit(polyasseries1) + cfunc2 = njit(polyasseries2) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc1("abc") + self.assertIn('The argument "alist" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc2("abc", True) + self.assertIn('The argument "alist" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc2(np.arange(4), "abc") + self.assertIn('The argument "trim" must be boolean', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc1(([1, 2, 3], np.arange(16).reshape(4,4))) + self.assertIn('Coefficient array is not 1-d', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc1(np.arange(8).reshape((2, 2, 2))) + self.assertIn('Coefficient array is not 1-d', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc1([np.array([[1,2,3],[1,2,3]]), ]) + self.assertIn('Coefficient array is not 1-d', + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc1(np.array([[]], dtype=np.float64)) + self.assertIn('Coefficient array is empty', + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc1(([1, 2, 3], np.array([], dtype=np.float64), + np.array([1,2,1]))) + self.assertIn('Coefficient array is empty', + str(raises.exception)) + + def _test_polyarithm_basic(self, pyfunc, ignore_sign_on_zero=False): + # test suite containing tests for polyadd, polysub, polymul, polydiv + cfunc = njit(pyfunc) + + def inputs(): + # basic, taken from https://github.com/numpy/numpy/blob/48a8277855849be094a5979c48d9f5f1778ee4de/numpy/polynomial/tests/test_polynomial.py#L58-L123 # noqa: E501 + for i in range(5): + for j in range(5): + p1 = np.array([0] * i + [1]) + p2 = np.array([0] * j + [1]) + yield p1, p2 + # test lists, tuples, scalars + yield [1, 2, 3], [1, 2, 3] + yield [1, 2, 3], (1, 2, 3) + yield (1, 2, 3), [1, 2, 3] + yield [1, 2, 3], 3 + yield 3, (1, 2, 3) + # test different dtypes + yield np.array([1, 2, 3]), np.array([1.0, 2.0, 3.0]) + yield np.array([1j, 2j, 3j]), np.array([1.0, 2.0, 3.0]) + yield np.array([1, 2, 3]), np.array([1j, 2j, 3j]) + yield (1, 2, 3), 3.0 + yield (1, 2, 3), 3j + yield (1, 1e-3, 3), (1, 2, 3) + + for p1, p2 in inputs(): + self.assertPreciseEqual(pyfunc(p1,p2), cfunc(p1,p2), + ignore_sign_on_zero=ignore_sign_on_zero) + + def _test_polyarithm_exception(self, pyfunc): + # test suite containing tests for polyadd, polysub, polymul, polydiv + cfunc = njit(pyfunc) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc", np.array([1,2,3])) + self.assertIn('The argument "c1" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(np.array([1,2,3]), "abc") + self.assertIn('The argument "c2" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as e: + cfunc(np.arange(10).reshape(5, 2), np.array([1, 2, 3])) + self.assertIn('Coefficient array is not 1-d', + str(e.exception)) + + with self.assertRaises(TypingError) as e: + cfunc(np.array([1, 2, 3]), np.arange(10).reshape(5, 2)) + self.assertIn('Coefficient array is not 1-d', + str(e.exception)) + + def test_polyadd_basic(self): + self._test_polyarithm_basic(polyadd) + + def test_polyadd_exception(self): + self._test_polyarithm_exception(polyadd) + + def test_polysub_basic(self): + self._test_polyarithm_basic(polysub, ignore_sign_on_zero=True) + + def test_polysub_exception(self): + self._test_polyarithm_exception(polysub) + + def test_polymul_basic(self): + self._test_polyarithm_basic(polymul) + + def test_polymul_exception(self): + self._test_polyarithm_exception(polymul) + + def test_poly_polydiv_basic(self): + pyfunc = polydiv + cfunc = njit(polydiv) + self._test_polyarithm_basic(polydiv) + + def inputs(): + # Based on https://github.com/numpy/numpy/blob/160c16f055d4d2fce072004e286d8075b31955cd/numpy/polynomial/tests/test_polynomial.py#L99-L114 # noqa: E501 + # check scalar division + yield [2], [2] + yield [2, 2], [2] + # check rest. + for i in range(5): + for j in range(5): + ci = [0] * i + [1, 2] + cj = [0] * j + [1, 2] + tgt = poly.polyadd(ci, cj) + yield tgt, ci + yield np.array([1,0,0,0,0,0,-1]), np.array([1,0,0,-1]) + + for c1, c2 in inputs(): + self.assertPreciseEqual(pyfunc(c1, c2), cfunc(c1, c2)) + + def test_poly_polydiv_exception(self): + self._test_polyarithm_exception(polydiv) + cfunc = njit(polydiv) + # Based on https://github.com/numpy/numpy/blob/160c16f055d4d2fce072004e286d8075b31955cd/numpy/polynomial/tests/test_polynomial.py#L97 # noqa: E501 + # check zero division + with self.assertRaises(ZeroDivisionError) as _: + cfunc([1], [0]) + + def test_poly_polyval_basic(self): + pyfunc2 = polyval2 + cfunc2 = njit(polyval2) + pyfunc3T = polyval3T + cfunc3T = njit(polyval3T) + pyfunc3F = polyval3F + cfunc3F = njit(polyval3F) + + def inputs(): + # Based on https://github.com/numpy/numpy/blob/160c16f055d4d2fce072004e286d8075b31955cd/numpy/polynomial/tests/test_polynomial.py#L137-L157 # noqa: E501 + # check empty input + yield np.array([], dtype=np.float64), [1] + yield 1, [1,2,3] + yield np.arange(4).reshape(2,2), [1,2,3] + # check normal input + for i in range(5): + yield np.linspace(-1, 1), [0] * i + [1] + yield np.linspace(-1, 1), [0, -1, 0, 1] + # check that shape is preserved + for i in range(3): + dims = [2] * i + x = np.zeros(dims) + yield x, [1] + yield x, [1, 0] + yield x, [1, 0, 0] + # Check that behaviour corresponds to tensor = False + yield np.array([1, 2]), np.arange(4).reshape(2,2) + yield [1, 2], np.arange(4).reshape(2,2) + + for x, c in inputs(): + self.assertPreciseEqual(pyfunc2(x, c), cfunc2(x, c)) + # test tensor argument + self.assertPreciseEqual(pyfunc3T(x, c), cfunc3T(x, c)) + self.assertPreciseEqual(pyfunc3F(x, c), cfunc3F(x, c)) + + def test_poly_polyval_exception(self): + cfunc2 = njit(polyval2) + cfunc3T = njit(polyval3T) + cfunc3F = njit(polyval3F) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc2(3, "abc") + self.assertIn('The argument "c" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc2("abc", 3) + self.assertIn('The argument "x" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc2("abc", "def") + self.assertIn('The argument "x" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc3T(3, "abc") + self.assertIn('The argument "c" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc3T("abc", 3) + self.assertIn('The argument "x" must be array-like', + str(raises.exception)) + + @njit + def polyval3(x, c, tensor): + res = poly.polyval(x, c, tensor) + return res + with self.assertRaises(TypingError) as raises: + polyval3(3, 3, "abc") + self.assertIn('The argument "tensor" must be boolean', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc3F("abc", "def") + self.assertIn('The argument "x" must be array-like', + str(raises.exception)) + + def test_poly_polyint_basic(self): + pyfunc = polyint + cfunc = njit(polyint) + # basic + self.assertPreciseEqual(pyfunc([1,2,3]), cfunc([1,2,3])) + # Based on https://github.com/numpy/numpy/blob/160c16f055d4d2fce072004e286d8075b31955cd/numpy/polynomial/tests/test_polynomial.py#L314-L381 # noqa: E501 + # test integration of zero polynomial + for i in range(2, 5): + self.assertPreciseEqual(pyfunc([0], m=i), cfunc([0], m=i)) + + # check single integration with integration constant + for i in range(5): + pol = [0] * i + [1] + self.assertPreciseEqual(pyfunc(pol, m=1), pyfunc(pol, m=1)) + + # check multiple integrations with default k + for i in range(5): + for j in range(2, 5): + pol = [0] * i + [1] + self.assertPreciseEqual(pyfunc(pol, m=j), cfunc(pol, m=j)) + + # test multidimensional arrays + c2 = np.array([[0,1], [0,2]]) + self.assertPreciseEqual(pyfunc(c2), cfunc(c2)) + c3 = np.arange(8).reshape((2,2,2)) + self.assertPreciseEqual(pyfunc(c3), cfunc(c3)) + + def test_poly_polyint_exception(self): + cfunc = njit(polyint) + + self.disable_leak_check() + + with self.assertRaises(TypingError) as raises: + cfunc("abc") + self.assertIn('The argument "c" must be array-like', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(np.array([1,2,3]), "abc") + self.assertIn('The argument "m" must be an integer', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(['a', 'b', 'c'], 1) + self.assertIn('Input dtype must be scalar.', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc(('a', 'b', 'c'), 1) + self.assertIn('Input dtype must be scalar.', + str(raises.exception)) + + # + # tests for Polynomial class + # + + def test_Polynomial_constructor(self): + + def pyfunc3(c, dom, win): + p = poly.Polynomial(c, dom, win) + return p + cfunc3 = njit(pyfunc3) + + def pyfunc1(c): + p = poly.Polynomial(c) + return p + cfunc1 = njit(pyfunc1) + list1 = (np.array([0, 1]), np.array([0., 1.])) + list2 = (np.array([0, 1]), np.array([0., 1.])) + list3 = (np.array([0, 1]), np.array([0., 1.])) + for c in list1: + for dom in list2: + for win in list3: + p1 = pyfunc3(c, dom, win) + p2 = cfunc3(c, dom, win) + q1 = pyfunc1(c) + q2 = cfunc1(c) + self.assertPreciseEqual(p1, p2) + self.assertPreciseEqual(p1.coef, p2.coef) + self.assertPreciseEqual(p1.domain, p2.domain) + self.assertPreciseEqual(p1.window, p2.window) + self.assertPreciseEqual(q1.coef, q2.coef) + self.assertPreciseEqual(q1.domain, q2.domain) + self.assertPreciseEqual(q1.window, q2.window) + + def test_Polynomial_exeption(self): + def pyfunc3(c, dom, win): + p = poly.Polynomial(c, dom, win) + return p + cfunc3 = njit(pyfunc3) + + self.disable_leak_check() + + input2 = np.array([1, 2]) + input3 = np.array([1, 2, 3]) + input2D = np.arange(4).reshape((2, 2)) + + with self.assertRaises(ValueError) as raises: + cfunc3(input2, input3, input2) + self.assertIn("Domain has wrong number of elements.", + str(raises.exception)) + + with self.assertRaises(ValueError) as raises: + cfunc3(input2, input2, input3) + self.assertIn("Window has wrong number of elements.", + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc3(input2D, input2, input2) + self.assertIn("Coefficient array is not 1-d", + str(raises.exception)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_practical_lowering_issues.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_practical_lowering_issues.py new file mode 100644 index 0000000000000000000000000000000000000000..a069591946a845e3456d4499ca94845025e165c8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_practical_lowering_issues.py @@ -0,0 +1,212 @@ +""" +Tests for practical lowering specific errors. +""" + +import numpy as np +from numba import njit +from numba.core import types, ir +from numba.core.compiler import CompilerBase, DefaultPassBuilder +from numba.core.typed_passes import NopythonTypeInference +from numba.core.compiler_machinery import register_pass, FunctionPass + +from numba.tests.support import MemoryLeakMixin, TestCase + + +def issue7507_lround(a): + """Dummy function used in test""" + pass + + +class TestLowering(MemoryLeakMixin, TestCase): + def test_issue4156_loop_vars_leak(self): + """Test issues with zero-filling of refct'ed variables inside loops. + + Before the fix, the in-loop variables are always zero-filled at their + definition location. As a result, their state from the previous + iteration is erased. No decref is applied. To fix this, the + zero-filling must only happen once after the alloca at the function + entry block. The loop variables are technically defined once per + function (one alloca per definition per function), but semantically + defined once per assignment. Semantically, their lifetime stop only + when the variable is re-assigned or when the function ends. + """ + @njit + def udt(N): + sum_vec = np.zeros(3) + for n in range(N): + if n >= 0: + # `vec` would leak without the fix. + vec = np.ones(1) + if n >= 0: + sum_vec += vec[0] + + return sum_vec + + got = udt(4) + expect = udt.py_func(4) + self.assertPreciseEqual(got, expect) + + def test_issue4156_loop_vars_leak_variant1(self): + """Variant of test_issue4156_loop_vars_leak. + + Adding an outer loop. + """ + @njit + def udt(N): + sum_vec = np.zeros(3) + for x in range(N): + for y in range(N): + n = x + y + if n >= 0: + # `vec` would leak without the fix. + vec = np.ones(1) + if n >= 0: + sum_vec += vec[0] + + return sum_vec + + got = udt(4) + expect = udt.py_func(4) + self.assertPreciseEqual(got, expect) + + def test_issue4156_loop_vars_leak_variant2(self): + """Variant of test_issue4156_loop_vars_leak. + + Adding deeper outer loop. + """ + @njit + def udt(N): + sum_vec = np.zeros(3) + for z in range(N): + for x in range(N): + for y in range(N): + n = x + y + z + if n >= 0: + # `vec` would leak without the fix. + vec = np.ones(1) + if n >= 0: + sum_vec += vec[0] + + return sum_vec + + got = udt(4) + expect = udt.py_func(4) + self.assertPreciseEqual(got, expect) + + def test_issue4156_loop_vars_leak_variant3(self): + """Variant of test_issue4156_loop_vars_leak. + + Adding inner loop around allocation + """ + @njit + def udt(N): + sum_vec = np.zeros(3) + for z in range(N): + for x in range(N): + n = x + z + if n >= 0: + for y in range(N): + # `vec` would leak without the fix. + vec = np.ones(y) + if n >= 0: + sum_vec += vec[0] + + return sum_vec + + got = udt(4) + expect = udt.py_func(4) + self.assertPreciseEqual(got, expect) + + def test_issue4156_loop_vars_leak_variant4(self): + """Variant of test_issue4156_loop_vars_leak. + + Interleaves loops and allocations + """ + @njit + def udt(N): + sum_vec = 0 + + for n in range(N): + vec = np.zeros(7) + for n in range(N): + z = np.zeros(7) + sum_vec += vec[0] + z[0] + + return sum_vec + + got = udt(4) + expect = udt.py_func(4) + self.assertPreciseEqual(got, expect) + + def test_issue_with_literal_in_static_getitem(self): + """Test an issue with literal type used as index of static_getitem + """ + + @register_pass(mutates_CFG=False, analysis_only=False) + class ForceStaticGetitemLiteral(FunctionPass): + + _name = "force_static_getitem_literal" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + repl = {} + # Force the static_getitem to have a literal type as + # index to replicate the problem. + for inst, sig in state.calltypes.items(): + if (isinstance(inst, ir.Expr) and + inst.op == 'static_getitem'): + [obj, idx] = sig.args + new_sig = sig.replace(args=(obj, + types.literal(inst.index))) + repl[inst] = new_sig + state.calltypes.update(repl) + return True + + class CustomPipeline(CompilerBase): + def define_pipelines(self): + pm = DefaultPassBuilder.define_nopython_pipeline(self.state) + pm.add_pass_after(ForceStaticGetitemLiteral, + NopythonTypeInference) + pm.finalize() + return [pm] + + @njit(pipeline_class=CustomPipeline) + def foo(arr): + return arr[4] # force static_getitem + + arr = np.arange(10) + got = foo(arr) + expect = foo.py_func(arr) + self.assertEqual(got, expect) + + def test_issue7507(self): + """ + Test a problem with BaseContext.get_function() because of changes + related to the new style error handling. + """ + from numba.core.typing.templates import AbstractTemplate, infer_global + from numba.core.imputils import lower_builtin + + @infer_global(issue7507_lround) + class lroundTemplate(AbstractTemplate): + key = issue7507_lround + + def generic(self, args, kws): + signature = types.int64(types.float64) + + # insert a new builtin during the compilation process + @lower_builtin(issue7507_lround, types.float64) + def codegen(context, builder, sig, args): + # Simply truncate with the cast to integer. + return context.cast(builder, args[0], sig.args[0], + sig.return_type) + + return signature + + @njit('int64(float64)') + def foo(a): + return issue7507_lround(a) + + self.assertEqual(foo(3.4), 3) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_print.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_print.py new file mode 100644 index 0000000000000000000000000000000000000000..01b51145bc0dcc17b6d1f9728c837288d4076af3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_print.py @@ -0,0 +1,189 @@ +import sys + +import numpy as np + +import unittest +from numba import jit, njit +from numba.core import types, errors, utils +from numba.tests.support import (captured_stdout, TestCase, EnableNRTStatsMixin) + + +def print_value(x): + print(x) + +def print_array_item(arr, i): + print(arr[i].x) + +def print_values(a, b, c): + print(a, b, c) + +def print_empty(): + print() + +def print_string(x): + print(x, "hop!", 3.5) + +def print_vararg(a, b, c): + print(a, b, *c) + +def print_string_vararg(a, b, c): + print(a, "hop!", b, *c) + +def make_print_closure(x): + def print_closure(): + return x + return jit(nopython=True)(x) + + +class TestPrint(EnableNRTStatsMixin, TestCase): + + def check_values(self, typ, values): + cfunc = njit((typ,))(print_value) + for val in values: + with captured_stdout(): + cfunc(val) + self.assertEqual(sys.stdout.getvalue(), str(val) + '\n') + + def test_print_values(self): + """ + Test printing a single argument value. + """ + # Various scalars + self.check_values(types.int32, (1, -234)) + self.check_values(types.int64, (1, -234, + 123456789876543210, + -123456789876543210)) + self.check_values(types.uint64, (1, 234, + 123456789876543210, 2**63 + 123)) + self.check_values(types.boolean, (True, False)) + self.check_values(types.float64, (1.5, 100.0**10.0, float('nan'))) + self.check_values(types.complex64, (1+1j,)) + self.check_values(types.NPTimedelta('ms'), (np.timedelta64(100, 'ms'),)) + + cfunc = njit((types.float32,))(print_value) + with captured_stdout(): + cfunc(1.1) + # Float32 will lose precision + got = sys.stdout.getvalue() + expect = '1.10000002384' + self.assertTrue(got.startswith(expect)) + self.assertTrue(got.endswith('\n')) + + # Test array + arraytype = types.Array(types.int32, 1, 'C') + cfunc = njit((arraytype,))(print_value) + with captured_stdout(): + cfunc(np.arange(10, dtype=np.int32)) + self.assertEqual(sys.stdout.getvalue(), + '[0 1 2 3 4 5 6 7 8 9]\n') + + @unittest.skip("Issue with intermittent NRT leak, see #9355.") + def test_print_nrt_type(self): + # NOTE: this check is extracted from the above as it started + # intermittently leaking since the merge of #9330 (compile_isolated + # removal patch). It's not clear why this happens, see #9355 for + # thoughts/details. This test is skipped until it is resolved. + + # NRT-enabled type + with self.assertNoNRTLeak(): + x = [1, 3, 5, 7] + with self.assertRefCount(x): + self.check_values(types.List(types.intp, reflected=True), (x,)) + + def test_print_array_item(self): + """ + Test printing a Numpy character sequence + """ + dtype = np.dtype([('x', 'S4')]) + arr = np.frombuffer(bytearray(range(1, 9)), dtype=dtype) + + pyfunc = print_array_item + cfunc = jit(nopython=True)(pyfunc) + for i in range(len(arr)): + with captured_stdout(): + cfunc(arr, i) + self.assertEqual(sys.stdout.getvalue(), str(arr[i]['x']) + '\n') + + def test_print_multiple_values(self): + pyfunc = print_values + cfunc = njit((types.intp,) * 3)(pyfunc) + with captured_stdout(): + cfunc(1, 2, 3) + self.assertEqual(sys.stdout.getvalue(), '1 2 3\n') + + def test_print_nogil(self): + pyfunc = print_values + cfunc = jit(nopython=True, nogil=True)(pyfunc) + with captured_stdout(): + cfunc(1, 2, 3) + self.assertEqual(sys.stdout.getvalue(), '1 2 3\n') + + def test_print_empty(self): + pyfunc = print_empty + cfunc = njit((),)(pyfunc) + with captured_stdout(): + cfunc() + self.assertEqual(sys.stdout.getvalue(), '\n') + + def test_print_strings(self): + pyfunc = print_string + cfunc = njit((types.intp,))(pyfunc) + with captured_stdout(): + cfunc(1) + self.assertEqual(sys.stdout.getvalue(), '1 hop! 3.5\n') + + def test_print_vararg(self): + # Test *args support for print(). This is desired since + # print() can use a dedicated IR node. + pyfunc = print_vararg + cfunc = jit(nopython=True)(pyfunc) + with captured_stdout(): + cfunc(1, (2, 3), (4, 5j)) + self.assertEqual(sys.stdout.getvalue(), '1 (2, 3) 4 5j\n') + + pyfunc = print_string_vararg + cfunc = jit(nopython=True)(pyfunc) + with captured_stdout(): + cfunc(1, (2, 3), (4, 5j)) + self.assertEqual(sys.stdout.getvalue(), '1 hop! (2, 3) 4 5j\n') + + def test_inner_fn_print(self): + @jit(nopython=True) + def foo(x): + print(x) + + @jit(nopython=True) + def bar(x): + foo(x) + foo('hello') + + # Printing an array requires the Env. + # We need to make sure the inner function can obtain the Env. + x = np.arange(5) + with captured_stdout(): + bar(x) + self.assertEqual(sys.stdout.getvalue(), '[0 1 2 3 4]\nhello\n') + + def test_print_w_kwarg_raises(self): + @jit(nopython=True) + def print_kwarg(): + print('x', flush=True) + + with self.assertRaises(errors.UnsupportedError) as raises: + print_kwarg() + expected = ("Numba's print() function implementation does not support " + "keyword arguments.") + self.assertIn(raises.exception.msg, expected) + + def test_print_no_truncation(self): + ''' See: https://github.com/numba/numba/issues/3811 + ''' + @jit(nopython=True) + def foo(): + print(''.join(['a'] * 10000)) + with captured_stdout(): + foo() + self.assertEqual(sys.stdout.getvalue(), ''.join(['a'] * 10000) + '\n') + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_profiler.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_profiler.py new file mode 100644 index 0000000000000000000000000000000000000000..727abb2775c76415e7e8df04b50b0e0c83511d60 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_profiler.py @@ -0,0 +1,142 @@ +import cProfile as profiler +import os +import pstats +import subprocess +import sys + +import numpy as np + +from numba import jit, types +from numba.tests.support import needs_blas +import unittest + + +def generate_standard_dot_case(): + + @jit((types.float32[::1], types.float32[::1],)) + def dot(a, b): + sum = 0 + for i in range(len(a)): + sum += a[i]*b[i] + return sum + + dot._enable_sysmon = True + return dot, dot + + +def generate_raising_dot_case(): + + @jit((types.float32[::1], types.float32[::1],)) + def raising_dot(a, b): + # this is like dot above, it does all the work, but the raises + sum = 0 + for i in range(len(a)): + sum += a[i]*b[i] + raise ValueError("problem with dot") + + raising_dot._enable_sysmon = True + + def call_raising_dot(a, b): + try: + raising_dot(a, b) + except ValueError: + pass + + return raising_dot, call_raising_dot + + +def np_dot(a, b): + return np.dot(a, b) + + +class TestProfiler(unittest.TestCase): + + def check_profiler_dot(self, caller, cfunc): + """ + Make sure the jit-compiled function shows up in the profile stats + as a regular Python function. + """ + a = np.arange(16, dtype=np.float32) + b = np.arange(16, dtype=np.float32) + n_calls = 123 + p = profiler.Profile() + p.enable() + try: + for _ in range(n_calls): + caller(a, b) + finally: + p.disable() + stats = pstats.Stats(p).strip_dirs() + + def check_stats_for_key(stats, code, n_calls): + expected_key = (os.path.basename(code.co_filename), + code.co_firstlineno, + code.co_name, + ) + # check the key is in the stats + self.assertIn(expected_key, stats.stats) + # check that call for the key has been made `n_calls` times. + func_stats = stats.stats[expected_key] + self.assertEqual(func_stats[:2], (n_calls, n_calls)) + + # check the JIT compiled function + check_stats_for_key(stats, cfunc.py_func.__code__, n_calls) + + # check the caller if it's not the same as the cfunc + if caller is not cfunc: + check_stats_for_key(stats, caller.__code__, n_calls) + + def test_profiler(self): + dot, _ = generate_standard_dot_case() + self.check_profiler_dot(dot, dot) + + def test_profiler_for_raising_function(self): + raising_dot, call_raising_dot = generate_raising_dot_case() + self.check_profiler_dot(call_raising_dot, raising_dot) + + @needs_blas + def test_profiler_np_dot(self): + # Issue #1786: initializing BLAS would crash when profiling + code = """if 1: + import cProfile as profiler + + import numpy as np + + from numba import jit + from numba.tests.test_profiler import np_dot + + cfunc = jit(nopython=True)(np_dot) + + a = np.arange(16, dtype=np.float32) + b = np.arange(16, dtype=np.float32) + + p = profiler.Profile() + p.enable() + cfunc(a, b) + cfunc(a, b) + p.disable() + """ + subprocess.check_call([sys.executable, "-c", code]) + + def test_issue_3229(self): + # Issue #3229: Seemingly random segfaults when profiling due to + # frame injection. + # numba.tests.npyufunc.test_dufunc.TestDUFunc.test_npm_call is the + # first test case crashing when profiling. Fingers crossed fixing + # this is sufficient proof for the general case. + + code = """if 1: + import cProfile as profiler + p = profiler.Profile() + p.enable() + + from numba.tests.npyufunc.test_dufunc import TestDUFunc + t = TestDUFunc('test_npm_call') + t.test_npm_call() + + p.disable() + """ + subprocess.check_call([sys.executable, "-c", code]) + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_pycc.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_pycc.py new file mode 100644 index 0000000000000000000000000000000000000000..4541b3c10ae5e0c7412040e30a9ca25cb0f2346c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_pycc.py @@ -0,0 +1,361 @@ +import contextlib +import importlib +import os +import shutil +import subprocess +import sys +import tempfile +from unittest import skip +from ctypes import * + +import numpy as np + +import llvmlite.binding as ll + +from numba.core import utils +from numba.tests.support import (TestCase, tag, import_dynamic, temp_directory, + has_blas, needs_setuptools, skip_if_py313_on_windows) + +import unittest + + +_skip_reason = 'windows only' +_windows_only = unittest.skipIf(not sys.platform.startswith('win'), + _skip_reason) + + +base_path = os.path.dirname(os.path.abspath(__file__)) + + +def unset_macosx_deployment_target(): + """Unset MACOSX_DEPLOYMENT_TARGET because we are not building portable + libraries + """ + if 'MACOSX_DEPLOYMENT_TARGET' in os.environ: + del os.environ['MACOSX_DEPLOYMENT_TARGET'] + + +@needs_setuptools +class TestCompilerChecks(TestCase): + + # NOTE: THIS TEST MUST ALWAYS RUN ON WINDOWS, DO NOT SKIP + @_windows_only + def test_windows_compiler_validity(self): + # When inside conda-build VSINSTALLDIR should be set and windows should + # have a valid compiler available, `external_compiler_works()` should + # agree with this. If this is not the case then error out to alert devs. + + # This is a local import to avoid deprecation warnings being generated + # through the use of the numba.pycc module. + from numba.pycc.platform import external_compiler_works + is_running_conda_build = os.environ.get('CONDA_BUILD', None) is not None + if is_running_conda_build: + if os.environ.get('VSINSTALLDIR', None) is not None: + self.assertTrue(external_compiler_works()) + + +class BasePYCCTest(TestCase): + + def setUp(self): + unset_macosx_deployment_target() + + self.tmpdir = temp_directory('test_pycc') + # Make sure temporary files and directories created by + # distutils don't clutter the top-level /tmp + tempfile.tempdir = self.tmpdir + + def tearDown(self): + tempfile.tempdir = None + # Since we're executing the module-under-test several times + # from the same process, we must clear the exports registry + # between invocations. + + # This is a local import to avoid deprecation warnings being generated + # through the use of the numba.pycc module. + from numba.pycc.decorators import clear_export_registry + clear_export_registry() + + @contextlib.contextmanager + def check_c_ext(self, extdir, name): + sys.path.append(extdir) + try: + lib = import_dynamic(name) + yield lib + finally: + sys.path.remove(extdir) + sys.modules.pop(name, None) + + +@needs_setuptools +@skip_if_py313_on_windows +class TestCC(BasePYCCTest): + + def setUp(self): + super(TestCC, self).setUp() + self.skip_if_no_external_compiler() # external compiler needed + from numba.tests import compile_with_pycc + self._test_module = compile_with_pycc + importlib.reload(self._test_module) + + @contextlib.contextmanager + def check_cc_compiled(self, cc): + #cc.verbose = True + cc.output_dir = self.tmpdir + cc.compile() + + with self.check_c_ext(self.tmpdir, cc.name) as lib: + yield lib + + def check_cc_compiled_in_subprocess(self, lib, code): + prolog = """if 1: + import sys + import types + # to disable numba package + sys.modules['numba'] = types.ModuleType('numba') + try: + from numba import njit + except ImportError: + pass + else: + raise RuntimeError('cannot disable numba package') + + sys.path.insert(0, %(path)r) + import %(name)s as lib + """ % {'name': lib.__name__, + 'path': os.path.dirname(lib.__file__)} + code = prolog.strip(' ') + code + subprocess.check_call([sys.executable, '-c', code]) + + def test_cc_properties(self): + cc = self._test_module.cc + self.assertEqual(cc.name, 'pycc_test_simple') + + # Inferred output directory + d = self._test_module.cc.output_dir + self.assertTrue(os.path.isdir(d), d) + + # Inferred output filename + f = self._test_module.cc.output_file + self.assertFalse(os.path.exists(f), f) + self.assertTrue(os.path.basename(f).startswith('pycc_test_simple.'), f) + if sys.platform.startswith('linux'): + self.assertTrue(f.endswith('.so'), f) + # This is a local import to avoid deprecation warnings being + # generated through the use of the numba.pycc module. + from numba.pycc.platform import find_pyext_ending + self.assertIn(find_pyext_ending(), f) + + def test_compile(self): + with self.check_cc_compiled(self._test_module.cc) as lib: + res = lib.multi(123, 321) + self.assertPreciseEqual(res, 123 * 321) + res = lib.multf(987, 321) + self.assertPreciseEqual(res, 987.0 * 321.0) + res = lib.square(5) + self.assertPreciseEqual(res, 25) + self.assertIs(lib.get_none(), None) + with self.assertRaises(ZeroDivisionError): + lib.div(1, 0) + + def check_compile_for_cpu(self, cpu_name): + cc = self._test_module.cc + cc.target_cpu = cpu_name + + with self.check_cc_compiled(cc) as lib: + res = lib.multi(123, 321) + self.assertPreciseEqual(res, 123 * 321) + self.assertEqual(lib.multi.__module__, 'pycc_test_simple') + + def test_compile_for_cpu(self): + # Compiling for the host CPU should always succeed + self.check_compile_for_cpu(ll.get_host_cpu_name()) + + def test_compile_for_cpu_host(self): + # Compiling for the host CPU should always succeed + self.check_compile_for_cpu("host") + + def test_compile_helperlib(self): + with self.check_cc_compiled(self._test_module.cc_helperlib) as lib: + res = lib.power(2, 7) + self.assertPreciseEqual(res, 128) + for val in (-1, -1 + 0j, np.complex128(-1)): + res = lib.sqrt(val) + self.assertPreciseEqual(res, 1j) + for val in (4, 4.0, np.float64(4)): + res = lib.np_sqrt(val) + self.assertPreciseEqual(res, 2.0) + res = lib.spacing(1.0) + self.assertPreciseEqual(res, 2**-52) + # Implicit seeding at startup should guarantee a non-pathological + # start state. + self.assertNotEqual(lib.random(-1), lib.random(-1)) + res = lib.random(42) + expected = np.random.RandomState(42).random_sample() + self.assertPreciseEqual(res, expected) + res = lib.size(np.float64([0] * 3)) + self.assertPreciseEqual(res, 3) + + code = """if 1: + from numpy.testing import assert_equal, assert_allclose + res = lib.power(2, 7) + assert res == 128 + res = lib.random(42) + assert_allclose(res, %(expected)s) + res = lib.spacing(1.0) + assert_allclose(res, 2**-52) + """ % {'expected': expected} + self.check_cc_compiled_in_subprocess(lib, code) + + def test_compile_nrt(self): + with self.check_cc_compiled(self._test_module.cc_nrt) as lib: + # Sanity check + self.assertPreciseEqual(lib.zero_scalar(1), 0.0) + res = lib.zeros(3) + self.assertEqual(list(res), [0, 0, 0]) + if has_blas: + res = lib.vector_dot(4) + self.assertPreciseEqual(res, 30.0) + # test argsort + val = np.float64([2., 5., 1., 3., 4.]) + res = lib.np_argsort(val) + expected = np.argsort(val) + self.assertPreciseEqual(res, expected) + + code = """if 1: + from numpy.testing import assert_equal + from numpy import float64, argsort + res = lib.zero_scalar(1) + assert res == 0.0 + res = lib.zeros(3) + assert list(res) == [0, 0, 0] + if %(has_blas)s: + res = lib.vector_dot(4) + assert res == 30.0 + val = float64([2., 5., 1., 3., 4.]) + res = lib.np_argsort(val) + expected = argsort(val) + assert_equal(res, expected) + """ % dict(has_blas=has_blas) + self.check_cc_compiled_in_subprocess(lib, code) + + def test_hashing(self): + with self.check_cc_compiled(self._test_module.cc_nrt) as lib: + res = lib.hash_literal_str_A() + self.assertPreciseEqual(res, hash("A")) + res = lib.hash_str("A") + self.assertPreciseEqual(res, hash("A")) + + code = """if 1: + from numpy.testing import assert_equal + res = lib.hash_literal_str_A() + assert_equal(res, hash("A")) + res = lib.hash_str("A") + assert_equal(res, hash("A")) + """ + self.check_cc_compiled_in_subprocess(lib, code) + + def test_c_extension_usecase(self): + # Test C-extensions + with self.check_cc_compiled(self._test_module.cc_nrt) as lib: + arr = np.arange(128, dtype=np.intp) + got = lib.dict_usecase(arr) + expect = arr * arr + self.assertPreciseEqual(got, expect) + + +@needs_setuptools +@skip_if_py313_on_windows +class TestDistutilsSupport(TestCase): + + def setUp(self): + super().setUp() + self.skip_if_no_external_compiler() # external compiler needed + + unset_macosx_deployment_target() + + # Copy the test project into a temp directory to avoid + # keeping any build leftovers in the source tree + self.tmpdir = temp_directory('test_pycc_distutils') + source_dir = os.path.join(base_path, 'pycc_distutils_usecase') + self.usecase_dir = os.path.join(self.tmpdir, 'work') + shutil.copytree(source_dir, self.usecase_dir) + + def check_setup_py(self, setup_py_file): + # Compute PYTHONPATH to ensure the child processes see this Numba + import numba + numba_path = os.path.abspath(os.path.dirname( + os.path.dirname(numba.__file__))) + env = dict(os.environ) + if env.get('PYTHONPATH', ''): + env['PYTHONPATH'] = numba_path + os.pathsep + env['PYTHONPATH'] + else: + env['PYTHONPATH'] = numba_path + + def run_python(args): + p = subprocess.Popen([sys.executable] + args, + cwd=self.usecase_dir, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + env=env) + out, _ = p.communicate() + rc = p.wait() + if rc != 0: + self.fail("python failed with the following output:\n%s" + % out.decode('utf-8', 'ignore')) + + run_python([setup_py_file, "build_ext", "--inplace"]) + code = """if 1: + import pycc_compiled_module as lib + assert lib.get_const() == 42 + res = lib.ones(3) + assert list(res) == [1.0, 1.0, 1.0] + """ + run_python(["-c", code]) + + def check_setup_nested_py(self, setup_py_file): + # Compute PYTHONPATH to ensure the child processes see this Numba + import numba + numba_path = os.path.abspath(os.path.dirname( + os.path.dirname(numba.__file__))) + env = dict(os.environ) + if env.get('PYTHONPATH', ''): + env['PYTHONPATH'] = numba_path + os.pathsep + env['PYTHONPATH'] + else: + env['PYTHONPATH'] = numba_path + + def run_python(args): + p = subprocess.Popen([sys.executable] + args, + cwd=self.usecase_dir, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + env=env) + out, _ = p.communicate() + rc = p.wait() + if rc != 0: + self.fail("python failed with the following output:\n%s" + % out.decode('utf-8', 'ignore')) + + run_python([setup_py_file, "build_ext", "--inplace"]) + code = """if 1: + import nested.pycc_compiled_module as lib + assert lib.get_const() == 42 + res = lib.ones(3) + assert list(res) == [1.0, 1.0, 1.0] + """ + run_python(["-c", code]) + + def test_setup_py_distutils(self): + self.check_setup_py("setup_distutils.py") + + def test_setup_py_distutils_nested(self): + self.check_setup_nested_py("setup_distutils_nested.py") + + def test_setup_py_setuptools(self): + self.check_setup_py("setup_setuptools.py") + + def test_setup_py_setuptools_nested(self): + self.check_setup_nested_py("setup_setuptools_nested.py") + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_python_int.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_python_int.py new file mode 100644 index 0000000000000000000000000000000000000000..19405ca7f3ae46390e6b364187c679f3d24e6a14 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_python_int.py @@ -0,0 +1,51 @@ +import unittest +from numba import jit +from numba.core import types + + +force_pyobj_flags = {'forceobj': True} +no_pyobj_flags = {'nopython': True} + + +def return_int(a, b): + return a + b + + +class TestPythonInt(unittest.TestCase): + + # Issue #474: ints should be returned rather than longs under Python 2, + # as much as possible. + + def test_int_return_type(self, flags=force_pyobj_flags, + int_type=types.int64, operands=(3, 4)): + pyfunc = return_int + cfunc = jit((int_type, int_type), **flags)(pyfunc) + expected = pyfunc(*operands) + got = cfunc(*operands) + self.assertIs(type(got), type(expected)) + self.assertEqual(got, expected) + + def test_int_return_type_npm(self): + self.test_int_return_type(flags=no_pyobj_flags) + + def test_unsigned_int_return_type(self, flags=force_pyobj_flags): + self.test_int_return_type(int_type=types.uint64, flags=flags) + + def test_unsigned_int_return_type_npm(self): + self.test_unsigned_int_return_type(flags=no_pyobj_flags) + + def test_long_int_return_type(self, flags=force_pyobj_flags): + # Same but returning a 64-bit integer. The return type should be + # `int` on 64-bit builds, `long` on 32-bit ones (or Windows). + self.test_int_return_type(flags=flags, operands=(2**33, 2**40)) + + def test_long_int_return_type_npm(self): + self.test_long_int_return_type(flags=no_pyobj_flags) + + def test_longer_int_return_type(self, flags=force_pyobj_flags): + # This won't be supported in nopython mode. + self.test_int_return_type(flags=flags, operands=(2**70, 2**75)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_pythonapi.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_pythonapi.py new file mode 100644 index 0000000000000000000000000000000000000000..297b6e3394473edf896dcb427ebf2c494fc772f5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_pythonapi.py @@ -0,0 +1,123 @@ +import ctypes +import unittest +from numba.core import types +from numba.core.extending import intrinsic +from numba import jit, njit +from numba.tests.support import captured_stdout + + +@intrinsic +def _pyapi_bytes_as_string(typingctx, csrc, size): + sig = types.voidptr(csrc, size) # cstring == void* + + def codegen(context, builder, sig, args): + [csrc, size] = args + api = context.get_python_api(builder) + b = api.bytes_from_string_and_size(csrc, size) + return api.bytes_as_string(b) + return sig, codegen + + +def PyBytes_AsString(uni): + # test_PyBytes_AsString will call this function with a unicode type. + # We then use the underlying buffer to create a PyBytes object and call the + # PyBytes_AsString function with PyBytes object as argument + return _pyapi_bytes_as_string(uni._data, uni._length) + + +@intrinsic +def _pyapi_bytes_as_string_and_size(typingctx, csrc, size): + # return a tuple containing the c-string and size + retty = types.Tuple.from_types((csrc, size)) + sig = retty(csrc, size) + + def codegen(context, builder, sig, args): + [csrc, size] = args + pyapi = context.get_python_api(builder) + b = pyapi.bytes_from_string_and_size(csrc, size) + p_cstr = builder.alloca(pyapi.cstring) + p_size = builder.alloca(pyapi.py_ssize_t) + pyapi.bytes_as_string_and_size(b, p_cstr, p_size) + + cstr = builder.load(p_cstr) + size = builder.load(p_size) + tup = context.make_tuple(builder, sig.return_type, (cstr, size)) + return tup + return sig, codegen + + +def PyBytes_AsStringAndSize(uni): + return _pyapi_bytes_as_string_and_size(uni._data, uni._length) + + +class TestPythonAPI(unittest.TestCase): + + def test_PyBytes_AsString(self): + cfunc = jit(nopython=True)(PyBytes_AsString) + cstr = cfunc('hello') # returns a cstring + + fn = ctypes.pythonapi.PyBytes_FromString + fn.argtypes = [ctypes.c_void_p] + fn.restype = ctypes.py_object + obj = fn(cstr) + + # Use the cstring created from bytes_as_string to create a python + # bytes object + self.assertEqual(obj, b'hello') + + def test_PyBytes_AsStringAndSize(self): + cfunc = jit(nopython=True)(PyBytes_AsStringAndSize) + tup = cfunc('hello\x00world') # returns a tuple: cstring and its size + + fn = ctypes.pythonapi.PyBytes_FromStringAndSize + fn.argtypes = [ctypes.c_void_p, ctypes.c_size_t] + fn.restype = ctypes.py_object + obj = fn(tup[0], tup[1]) + + # Use the cstring created from bytes_from_string_and_size to create + # a python bytes object + self.assertEqual(obj, b'hello\x00world') + + +class PythonAPIEmptyArgs(unittest.TestCase): + def test_empty_args(self): + def callme(**kwargs): + print("callme", kwargs) + + @intrinsic + def py_call(tyctx): + def codegen(context, builder, sig, args): + pyapi = context.get_python_api(builder) + gil = pyapi.gil_ensure() + + num = pyapi.long_from_longlong( + context.get_constant(types.intp, 0xCAFE) + ) + kwds = pyapi.dict_pack({"key": num}.items()) + fn_print = pyapi.unserialize(pyapi.serialize_object(callme)) + # segfault: https://github.com/numba/numba/issues/5871 + res = pyapi.call(fn_print, None, kwds) + + pyapi.decref(res) + pyapi.decref(fn_print) + pyapi.decref(kwds) + pyapi.decref(num) + + pyapi.gil_release(gil) + return res + + return types.none(), codegen + + @njit + def foo(): + py_call() + + with captured_stdout() as out: + foo() + d = {"key": 0xCAFE} + expected = f"callme {d}\n" + self.assertEqual(out.getvalue(), expected) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_random.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_random.py new file mode 100644 index 0000000000000000000000000000000000000000..8127ef44dff60f4b00c66cbd61dd524d1c7052e0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_random.py @@ -0,0 +1,1965 @@ +import collections +import functools +import math +import multiprocessing +import os +import random +import subprocess +import sys +import threading +import itertools +from textwrap import dedent + +import numpy as np + +import unittest + +import numba +from numba import jit, _helperlib, njit +from numba.core import types +from numba.tests.support import TestCase, compile_function, tag +from numba.core.errors import TypingError + + +# State size of the Mersenne Twister +N = 624 + + +def get_py_state_ptr(): + return _helperlib.rnd_get_py_state_ptr() + +def get_np_state_ptr(): + return _helperlib.rnd_get_np_state_ptr() + + +def numpy_randint1(a): + return np.random.randint(a) + +def numpy_randint2(a, b): + return np.random.randint(a, b) + +def random_randint(a, b): + return random.randint(a, b) + +def random_randrange1(a): + return random.randrange(a) + +def random_randrange2(a, b): + return random.randrange(a, b) + +def random_randrange3(a, b, c): + return random.randrange(a, b, c) + +def numpy_choice1(a): + return np.random.choice(a) + +def numpy_choice2(a, size): + return np.random.choice(a, size=size) + +def numpy_choice3(a, size, replace): + return np.random.choice(a, size=size, replace=replace) + +def numpy_multinomial2(n, pvals): + return np.random.multinomial(n, pvals) + +def numpy_multinomial3(n, pvals, size): + return np.random.multinomial(n, pvals=pvals, size=size) + +def numpy_dirichlet(alpha, size): + return np.random.dirichlet(alpha, size=size) + +def numpy_dirichlet_default(alpha): + return np.random.dirichlet(alpha) + +def numpy_noncentral_chisquare(df, nonc, size): + return np.random.noncentral_chisquare(df, nonc, size=size) + +def numpy_noncentral_chisquare_default(df, nonc): + return np.random.noncentral_chisquare(df, nonc) + +def numpy_check_rand(seed, a, b): + np.random.seed(seed) + expected = np.random.random((a, b)) + np.random.seed(seed) + got = np.random.rand(a, b) + return expected, got + +def numpy_check_randn(seed, a, b): + np.random.seed(seed) + expected = np.random.standard_normal((a, b)) + np.random.seed(seed) + got = np.random.randn(a, b) + return expected, got + +def jit_with_args(name, argstring): + code = """def func(%(argstring)s): + return %(name)s(%(argstring)s) +""" % locals() + pyfunc = compile_function("func", code, globals()) + return jit(nopython=True)(pyfunc) + +def jit_with_kwargs(name, kwarg_list): + # Similar to jit_with_args, but uses keyword arguments + call_args_with_kwargs = ','.join([f'{kw}={kw}' for kw in kwarg_list]) + signature = ','.join(kwarg_list) + code = f"""def func({signature}): + return {name}({call_args_with_kwargs}) +""" + pyfunc = compile_function("func", code, globals()) + return jit(nopython=True)(pyfunc) + +def jit_nullary(name): + return jit_with_args(name, "") + +def jit_unary(name): + return jit_with_args(name, "a") + +def jit_binary(name): + return jit_with_args(name, "a, b") + +def jit_ternary(name): + return jit_with_args(name, "a, b, c") + + +random_gauss = jit_binary("random.gauss") +random_random = jit_nullary("random.random") +random_seed = jit_unary("random.seed") + +numpy_normal = jit_binary("np.random.normal") +numpy_random = jit_nullary("np.random.random") +numpy_seed = jit_unary("np.random.seed") + + +def _copy_py_state(r, ptr): + """ + Copy state of Python random *r* to Numba state *ptr*. + """ + mt = r.getstate()[1] + ints, index = mt[:-1], mt[-1] + _helperlib.rnd_set_state(ptr, (index, list(ints))) + return ints, index + +def _copy_np_state(r, ptr): + """ + Copy state of Numpy random *r* to Numba state *ptr*. + """ + ints, index = r.get_state()[1:3] + _helperlib.rnd_set_state(ptr, (index, [int(x) for x in ints])) + return ints, index + +def sync_to_numpy(r): + _ver, mt_st, _gauss_next = r.getstate() + mt_pos = mt_st[-1] + mt_ints = mt_st[:-1] + assert len(mt_ints) == 624 + + np_st = ('MT19937', np.array(mt_ints, dtype='uint32'), mt_pos) + if _gauss_next is None: + np_st += (0, 0.0) + else: + np_st += (1, _gauss_next) + + np.random.set_state(np_st) + +# Pure Python equivalents of some of the Numpy distributions, using +# Python's basic generators. + +def py_chisquare(r, df): + return 2.0 * r.gammavariate(df / 2.0, 1.0) + +def py_f(r, num, denom): + return ((py_chisquare(r, num) * denom) / + (py_chisquare(r, denom) * num)) + + +class BaseTest(TestCase): + + def _follow_cpython(self, ptr, seed=2): + r = random.Random(seed) + _copy_py_state(r, ptr) + return r + + def _follow_numpy(self, ptr, seed=2): + r = np.random.RandomState(seed) + _copy_np_state(r, ptr) + return r + + +class TestInternals(BaseTest): + """ + Test low-level internals of the implementation. + """ + + def _check_get_set_state(self, ptr): + state = _helperlib.rnd_get_state(ptr) + i, ints = state + self.assertIsInstance(i, int) + self.assertIsInstance(ints, list) + self.assertEqual(len(ints), N) + j = (i * 100007) % N + ints = [i * 3 for i in range(N)] + # Roundtrip + _helperlib.rnd_set_state(ptr, (j, ints)) + self.assertEqual(_helperlib.rnd_get_state(ptr), (j, ints)) + + def _check_shuffle(self, ptr): + # We test shuffling against CPython + r = random.Random() + ints, index = _copy_py_state(r, ptr) + # Force shuffling in CPython generator + for i in range(index, N + 1, 2): + r.random() + _helperlib.rnd_shuffle(ptr) + # Check new integer keys + mt = r.getstate()[1] + ints, index = mt[:-1], mt[-1] + self.assertEqual(_helperlib.rnd_get_state(ptr)[1], list(ints)) + + def _check_init(self, ptr): + # We use the same integer seeding as Numpy + # (CPython is different: it treats the integer as a byte array) + r = np.random.RandomState() + for i in [0, 1, 125, 2**32 - 5]: + # Need to cast to a C-sized int (for Numpy <= 1.7) + r.seed(np.uint32(i)) + st = r.get_state() + ints = list(st[1]) + index = st[2] + assert index == N # sanity check + _helperlib.rnd_seed(ptr, i) + self.assertEqual(_helperlib.rnd_get_state(ptr), (index, ints)) + + def _check_perturb(self, ptr): + states = [] + for i in range(10): + # Initialize with known state + _helperlib.rnd_seed(ptr, 0) + # Perturb with entropy + _helperlib.rnd_seed(ptr, os.urandom(512)) + states.append(tuple(_helperlib.rnd_get_state(ptr)[1])) + # No two identical states + self.assertEqual(len(set(states)), len(states)) + + def test_get_set_state(self): + self._check_get_set_state(get_py_state_ptr()) + + def test_shuffle(self): + self._check_shuffle(get_py_state_ptr()) + + def test_init(self): + self._check_init(get_py_state_ptr()) + + def test_perturb(self): + self._check_perturb(get_py_state_ptr()) + + +class TestRandom(BaseTest): + + # NOTE: there may be cascading imprecision issues (e.g. between x87-using + # C code and SSE-using LLVM code), which is especially brutal for some + # iterative algorithms with sensitive exit conditions. + # Therefore we stick to hardcoded integers for seed values. + + def _check_random_seed(self, seedfunc, randomfunc): + """ + Check seed()- and random()-like functions. + """ + # Our seed() mimics NumPy's. + r = np.random.RandomState() + for i in [0, 1, 125, 2**32 - 1]: + # Need to cast to a C-sized int (for Numpy <= 1.7) + r.seed(np.uint32(i)) + seedfunc(i) + # Be sure to trigger a reshuffle + for j in range(N + 10): + self.assertPreciseEqual(randomfunc(), r.uniform(0.0, 1.0)) + + def test_random_random(self): + self._check_random_seed(random_seed, random_random) + + def test_numpy_random(self): + self._check_random_seed(numpy_seed, numpy_random) + # Test aliases + self._check_random_seed(numpy_seed, jit_nullary("np.random.random_sample")) + self._check_random_seed(numpy_seed, jit_nullary("np.random.ranf")) + self._check_random_seed(numpy_seed, jit_nullary("np.random.sample")) + self._check_random_seed(numpy_seed, jit_nullary("np.random.rand")) + + def _check_random_sized(self, seedfunc, randomfunc): + # Our seed() mimics NumPy's. + r = np.random.RandomState() + for i in [0, 1, 125, 2**32 - 1]: + # Need to cast to a C-sized int (for Numpy <= 1.7) + r.seed(np.uint32(i)) + seedfunc(i) + for n in range(10): + self.assertPreciseEqual(randomfunc(n), r.uniform(0.0, 1.0, n)) + + def test_numpy_random_sized(self): + self._check_random_sized(numpy_seed, jit_unary("np.random.random_sample")) + self._check_random_sized(numpy_seed, jit_unary("np.random.ranf")) + self._check_random_sized(numpy_seed, jit_unary("np.random.sample")) + self._check_random_sized(numpy_seed, jit_unary("np.random.rand")) + + def test_independent_generators(self): + # PRNGs for Numpy and Python are independent. + N = 10 + random_seed(1) + py_numbers = [random_random() for i in range(N)] + numpy_seed(2) + np_numbers = [numpy_random() for i in range(N)] + random_seed(1) + numpy_seed(2) + pairs = [(random_random(), numpy_random()) for i in range(N)] + self.assertPreciseEqual([p[0] for p in pairs], py_numbers) + self.assertPreciseEqual([p[1] for p in pairs], np_numbers) + + def _check_getrandbits(self, func, ptr): + """ + Check a getrandbits()-like function. + """ + # Our implementation follows CPython's for bits <= 64. + r = self._follow_cpython(ptr) + for nbits in range(1, 65): + expected = r.getrandbits(nbits) + got = func(nbits) + self.assertPreciseEqual(expected, got) + self.assertRaises(OverflowError, func, 65) + self.assertRaises(OverflowError, func, 9999999) + self.assertRaises(OverflowError, func, -1) + + def test_random_getrandbits(self): + self._check_getrandbits(jit_unary("random.getrandbits"), get_py_state_ptr()) + + # Explanation for the large ulps value: on 32-bit platforms, our + # LLVM-compiled functions use SSE but they are compared against + # C functions which use x87. + # On some distributions, the errors seem to accumulate dramatically. + + def _check_dist(self, func, pyfunc, argslist, niters=3, + prec='double', ulps=12, pydtype=None): + assert len(argslist) + for args in argslist: + results = [func(*args) for i in range(niters)] + pyresults = [(pyfunc(*args, dtype=pydtype) if pydtype else pyfunc(*args)) + for i in range(niters)] + self.assertPreciseEqual(results, pyresults, prec=prec, ulps=ulps, + msg="for arguments %s" % (args,)) + + def _check_dist_kwargs(self, func, pyfunc, kwargslist, niters=3, + prec='double', ulps=12, pydtype=None): + assert len(kwargslist) + for kwargs in kwargslist: + results = [func(**kwargs) for i in range(niters)] + pyresults = [(pyfunc(**kwargs, dtype=pydtype) if pydtype else pyfunc(**kwargs)) + for i in range(niters)] + self.assertPreciseEqual(results, pyresults, prec=prec, ulps=ulps, + msg="for arguments %s" % (kwargs,)) + + def _check_gauss(self, func2, func1, func0, ptr): + """ + Check a gauss()-like function. + """ + # Our implementation follows Numpy's. + r = self._follow_numpy(ptr) + if func2 is not None: + self._check_dist(func2, r.normal, + [(1.0, 1.0), (2.0, 0.5), (-2.0, 0.5)], + niters=N // 2 + 10) + if func1 is not None: + self._check_dist(func1, r.normal, [(0.5,)]) + if func0 is not None: + self._check_dist(func0, r.normal, [()]) + + def test_random_gauss(self): + self._check_gauss(jit_binary("random.gauss"), None, None, get_py_state_ptr()) + + def test_random_normalvariate(self): + # normalvariate() is really an alias to gauss() in Numba + # (not in Python, though - they use different algorithms) + self._check_gauss(jit_binary("random.normalvariate"), None, None, + get_py_state_ptr()) + + def test_numpy_normal(self): + self._check_gauss(jit_binary("np.random.normal"), + jit_unary("np.random.normal"), + jit_nullary("np.random.normal"), + get_np_state_ptr()) + + def test_numpy_standard_normal(self): + self._check_gauss(None, None, jit_nullary("np.random.standard_normal"), + get_np_state_ptr()) + + def test_numpy_randn(self): + self._check_gauss(None, None, jit_nullary("np.random.randn"), + get_np_state_ptr()) + + def _check_lognormvariate(self, func2, func1, func0, ptr): + """ + Check a lognormvariate()-like function. + """ + # Our implementation follows Numpy's. + r = self._follow_numpy(ptr) + if func2 is not None: + self._check_dist(func2, r.lognormal, + [(1.0, 1.0), (2.0, 0.5), (-2.0, 0.5)], + niters=N // 2 + 10) + if func1 is not None: + self._check_dist(func1, r.lognormal, [(0.5,)]) + if func0 is not None: + self._check_dist(func0, r.lognormal, [()]) + + def test_random_lognormvariate(self): + self._check_lognormvariate(jit_binary("random.lognormvariate"), + None, None, get_py_state_ptr()) + + def test_numpy_lognormal(self): + self._check_lognormvariate(jit_binary("np.random.lognormal"), + jit_unary("np.random.lognormal"), + jit_nullary("np.random.lognormal"), + get_np_state_ptr()) + + def _check_randrange(self, func1, func2, func3, ptr, max_width, is_numpy, tp=None): + """ + Check a randrange()-like function. + """ + # Sanity check + ints = [] + for i in range(10): + ints.append(func1(500000000)) + ints.append(func2(5, 500000000)) + if func3 is not None: + ints.append(func3(5, 500000000, 3)) + if is_numpy: + rr = self._follow_numpy(ptr).randint + else: + rr = self._follow_cpython(ptr).randrange + widths = [w for w in [1, 5, 8, 5000, 2**40, 2**62 + 2**61] if w < max_width] + pydtype = tp if is_numpy else None + for width in widths: + self._check_dist(func1, rr, [(width,)], niters=10, + pydtype=pydtype) + self._check_dist(func2, rr, [(-2, 2 +width)], niters=10, + pydtype=pydtype) + if func3 is not None: + self.assertPreciseEqual(func3(-2, 2 + width, 6), + rr(-2, 2 + width, 6)) + self.assertPreciseEqual(func3(2 + width, 2, -3), + rr(2 + width, 2, -3)) + # Empty ranges + self.assertRaises(ValueError, func1, 0) + self.assertRaises(ValueError, func1, -5) + self.assertRaises(ValueError, func2, 5, 5) + self.assertRaises(ValueError, func2, 5, 2) + if func3 is not None: + self.assertRaises(ValueError, func3, 5, 7, -1) + self.assertRaises(ValueError, func3, 7, 5, 1) + + def test_random_randrange(self): + for tp, max_width in [(types.int64, 2**63), (types.int32, 2**31)]: + cf1 = njit((tp,))(random_randrange1) + cf2 = njit((tp, tp,),)(random_randrange2) + cf3 = njit((tp, tp, tp,))(random_randrange3) + self._check_randrange(cf1, cf2, cf3, get_py_state_ptr(), + max_width, False) + + def test_numpy_randint(self): + for tp, np_tp, max_width in [(types.int64, np.int64, 2**63), + (types.int32, np.int32, 2**31)]: + cf1 = njit((tp,))(numpy_randint1) + cf2 = njit((tp, tp,))(numpy_randint2) + self._check_randrange(cf1, cf2, None, get_np_state_ptr(), max_width, + True, np_tp) + + def _check_randint(self, func, ptr, max_width): + """ + Check a randint()-like function. + """ + # Sanity check + ints = [] + for i in range(10): + ints.append(func(5, 500000000)) + self.assertEqual(len(ints), len(set(ints)), ints) + + r = self._follow_cpython(ptr) + for args in [(1, 5), (13, 5000), (20, 2**62 + 2**61)]: + if args[1] > max_width: + continue + self._check_dist(func, r.randint, [args], niters=10) + # Empty ranges + self.assertRaises(ValueError, func, 5, 4) + self.assertRaises(ValueError, func, 5, 2) + + def test_random_randint(self): + for tp, max_width in [(types.int64, 2**63), (types.int32, 2**31)]: + cf = njit((tp, tp,))(random_randint) + self._check_randint(cf, get_py_state_ptr(), max_width) + + def _check_uniform(self, func, ptr): + """ + Check a uniform()-like function. + """ + # Our implementation follows Python's. + r = self._follow_cpython(ptr) + self._check_dist(func, r.uniform, + [(1.5, 1e6), (-2.5, 1e3), (1.5, -2.5)]) + + def _check_any_distrib_kwargs(self, func, ptr, distrib, paramlist): + """ + Check any numpy distribution function. Does Numba use the same keyword + argument names as Numpy? + And given a fixed seed, do they both return the same samples? + """ + # Our implementation follows Numpy's (not Python's) + r = self._follow_numpy(ptr) + distrib_method_of_numpy = getattr(r, distrib) + self._check_dist_kwargs(func, distrib_method_of_numpy, paramlist) + + + def test_random_uniform(self): + self._check_uniform(jit_binary("random.uniform"), get_py_state_ptr()) + + def test_numpy_uniform(self): + self._check_uniform(jit_binary("np.random.uniform"), get_np_state_ptr()) + + def test_numpy_uniform_kwargs(self): + self._check_any_distrib_kwargs( + jit_with_kwargs("np.random.uniform", ['low', 'high']), + get_np_state_ptr(), + 'uniform', + paramlist=[{'low': 1.5, 'high': 1e6}, + {'low': -2.5, 'high': 1e3}, + {'low': 1.5, 'high': -2.5}]) + + def test_numpy_uniform_empty_size(self): + self._check_any_distrib_kwargs( + jit_with_kwargs("np.random.uniform", ['low', 'high', 'size']), + get_np_state_ptr(), + 'uniform', + paramlist=[{'low': 1.5, 'high': 1e6, 'size': ()}, + {'low': -2.5, 'high': 1e3, 'size': ()}, + {'low': 1.5, 'high': -2.5, 'size': ()}, + {'low': 1.5, 'high': 1e6, 'size': None}, + {'low': -2.5, 'high': 1e3, 'size': None}, + {'low': 1.5, 'high': -2.5, 'size': None},]) + + def _check_triangular(self, func2, func3, ptr): + """ + Check a triangular()-like function. + """ + # Our implementation follows Python's. + r = self._follow_cpython(ptr) + if func2 is not None: + self._check_dist(func2, r.triangular, + [(1.5, 3.5), (-2.5, 1.5), (1.5, 1.5)]) + self._check_dist(func3, r.triangular, [(1.5, 3.5, 2.2)]) + + def test_random_triangular(self): + self._check_triangular(jit_binary("random.triangular"), + jit_ternary("random.triangular"), + get_py_state_ptr()) + + def test_numpy_triangular(self): + triangular = jit_ternary("np.random.triangular") + fixed_triangular = lambda l, r, m: triangular(l, m, r) + self._check_triangular(None, fixed_triangular, get_np_state_ptr()) + + def _check_gammavariate(self, func2, func1, ptr): + """ + Check a gammavariate()-like function. + """ + # Our implementation follows Python's. + r = self._follow_cpython(ptr) + if func2 is not None: + self._check_dist(func2, r.gammavariate, + [(0.5, 2.5), (1.0, 1.5), (1.5, 3.5)]) + if func1 is not None: + self.assertPreciseEqual(func1(1.5), r.gammavariate(1.5, 1.0)) + # Invalid inputs + if func2 is not None: + self.assertRaises(ValueError, func2, 0.0, 1.0) + self.assertRaises(ValueError, func2, 1.0, 0.0) + self.assertRaises(ValueError, func2, -0.5, 1.0) + self.assertRaises(ValueError, func2, 1.0, -0.5) + if func1 is not None: + self.assertRaises(ValueError, func1, 0.0) + self.assertRaises(ValueError, func1, -0.5) + + def test_random_gammavariate(self): + self._check_gammavariate(jit_binary("random.gammavariate"), None, + get_py_state_ptr()) + + def test_numpy_gamma(self): + self._check_gammavariate(jit_binary("np.random.gamma"), + jit_unary("np.random.gamma"), + get_np_state_ptr()) + self._check_gammavariate(None, + jit_unary("np.random.standard_gamma"), + get_np_state_ptr()) + + def _check_betavariate(self, func, ptr): + """ + Check a betavariate()-like function. + """ + # Our implementation follows Python's. + r = self._follow_cpython(ptr) + self._check_dist(func, r.betavariate, [(0.5, 2.5)]) + # Invalid inputs + self.assertRaises(ValueError, func, 0.0, 1.0) + self.assertRaises(ValueError, func, 1.0, 0.0) + self.assertRaises(ValueError, func, -0.5, 1.0) + self.assertRaises(ValueError, func, 1.0, -0.5) + + def test_random_betavariate(self): + self._check_betavariate(jit_binary("random.betavariate"), get_py_state_ptr()) + + def test_numpy_beta(self): + self._check_betavariate(jit_binary("np.random.beta"), get_np_state_ptr()) + + def _check_vonmisesvariate(self, func, ptr): + """ + Check a vonmisesvariate()-like function. + """ + r = self._follow_cpython(ptr) + self._check_dist(func, r.vonmisesvariate, [(0.5, 2.5)]) + + def test_random_vonmisesvariate(self): + self._check_vonmisesvariate(jit_binary("random.vonmisesvariate"), + get_py_state_ptr()) + + def test_numpy_vonmises(self): + self._check_vonmisesvariate(jit_binary("np.random.vonmises"), + get_np_state_ptr()) + + def _check_expovariate(self, func, ptr): + """ + Check a expovariate()-like function. Note the second argument + is inversed compared to np.random.exponential(). + """ + r = self._follow_numpy(ptr) + for lambd in (0.2, 0.5, 1.5): + for i in range(3): + self.assertPreciseEqual(func(lambd), r.exponential(1 / lambd), + prec='double') + + def test_random_expovariate(self): + self._check_expovariate(jit_unary("random.expovariate"), get_py_state_ptr()) + + def _check_exponential(self, func1, func0, ptr): + """ + Check a exponential()-like function. + """ + r = self._follow_numpy(ptr) + if func1 is not None: + self._check_dist(func1, r.exponential, [(0.5,), (1.0,), (1.5,)]) + if func0 is not None: + self._check_dist(func0, r.exponential, [()]) + + def test_numpy_exponential(self): + self._check_exponential(jit_unary("np.random.exponential"), + jit_nullary("np.random.exponential"), + get_np_state_ptr()) + + def test_numpy_standard_exponential(self): + self._check_exponential(None, + jit_nullary("np.random.standard_exponential"), + get_np_state_ptr()) + + def _check_paretovariate(self, func, ptr): + """ + Check a paretovariate()-like function. + """ + # Our implementation follows Python's. + r = self._follow_cpython(ptr) + self._check_dist(func, r.paretovariate, [(0.5,), (3.5,)]) + + def test_random_paretovariate(self): + self._check_paretovariate(jit_unary("random.paretovariate"), get_py_state_ptr()) + + def test_numpy_pareto(self): + pareto = jit_unary("np.random.pareto") + fixed_pareto = lambda a: pareto(a) + 1.0 + self._check_paretovariate(fixed_pareto, get_np_state_ptr()) + + def _check_weibullvariate(self, func2, func1, ptr): + """ + Check a weibullvariate()-like function. + """ + # Our implementation follows Python's. + r = self._follow_cpython(ptr) + if func2 is not None: + self._check_dist(func2, r.weibullvariate, [(0.5, 2.5)]) + if func1 is not None: + for i in range(3): + self.assertPreciseEqual(func1(2.5), + r.weibullvariate(1.0, 2.5)) + + def test_random_weibullvariate(self): + self._check_weibullvariate(jit_binary("random.weibullvariate"), + None, get_py_state_ptr()) + + def test_numpy_weibull(self): + self._check_weibullvariate(None, jit_unary("np.random.weibull"), + get_np_state_ptr()) + + def test_numpy_binomial(self): + # We follow Numpy's algorithm up to n*p == 30 + binomial = jit_binary("np.random.binomial") + r = self._follow_numpy(get_np_state_ptr(), 0) + self._check_dist(binomial, r.binomial, [(18, 0.25)]) + # Sanity check many values + for n in (100, 1000, 10000): + self.assertEqual(binomial(n, 0.0), 0) + self.assertEqual(binomial(n, 1.0), n) + for p in (0.0001, 0.1, 0.4, 0.49999, 0.5, 0.50001, 0.8, 0.9, 0.9999): + r = binomial(n, p) + if p > 0.5: + r = n - r + p = 1 - p + self.assertGreaterEqual(r, 0) + self.assertLessEqual(r, n) + expected = p * n + tol = 3 * n / math.sqrt(n) + self.assertGreaterEqual(r, expected - tol, (p, n, r)) + self.assertLessEqual(r, expected + tol, (p, n, r)) + # Invalid values + self.assertRaises(ValueError, binomial, -1, 0.5) + self.assertRaises(ValueError, binomial, 10, -0.1) + self.assertRaises(ValueError, binomial, 10, 1.1) + + def test_numpy_chisquare(self): + chisquare = jit_unary("np.random.chisquare") + r = self._follow_cpython(get_np_state_ptr()) + self._check_dist(chisquare, + functools.partial(py_chisquare, r), + [(1.5,), (2.5,)]) + + def test_numpy_f(self): + f = jit_binary("np.random.f") + r = self._follow_cpython(get_np_state_ptr()) + self._check_dist(f, functools.partial(py_f, r), + [(0.5, 1.5), (1.5, 0.8)]) + + def test_numpy_geometric(self): + geom = jit_unary("np.random.geometric") + # p out of domain + self.assertRaises(ValueError, geom, -1.0) + self.assertRaises(ValueError, geom, 0.0) + self.assertRaises(ValueError, geom, 1.001) + # Some basic checks + N = 200 + r = [geom(1.0) for i in range(N)] + self.assertPreciseEqual(r, [1] * N) + r = [geom(0.9) for i in range(N)] + n = r.count(1) + self.assertGreaterEqual(n, N // 2) + self.assertLess(n, N) + self.assertFalse([i for i in r if i > 1000]) # unlikely + r = [geom(0.4) for i in range(N)] + self.assertTrue([i for i in r if i > 4]) # likely + r = [geom(0.01) for i in range(N)] + self.assertTrue([i for i in r if i > 50]) # likely + r = [geom(1e-15) for i in range(N)] + self.assertTrue([i for i in r if i > 2**32]) # likely + + def test_numpy_gumbel(self): + gumbel = jit_binary("np.random.gumbel") + r = self._follow_numpy(get_np_state_ptr()) + self._check_dist(gumbel, r.gumbel, [(0.0, 1.0), (-1.5, 3.5)]) + + def test_numpy_gumbel_kwargs(self): + self._check_any_distrib_kwargs( + jit_with_kwargs("np.random.gumbel", ['loc', 'scale']), + get_np_state_ptr(), + distrib="gumbel", + paramlist=[{'loc': 0.0, 'scale': 1.0}, + {'loc': -1.5, 'scale': 3.5}]) + + + def test_numpy_hypergeometric(self): + # Our implementation follows Numpy's up to nsamples = 10. + hg = jit_ternary("np.random.hypergeometric") + r = self._follow_numpy(get_np_state_ptr()) + self._check_dist(hg, r.hypergeometric, + [(1000, 5000, 10), (5000, 1000, 10)], + niters=30) + # Sanity checks + r = [hg(1000, 1000, 100) for i in range(100)] + self.assertTrue(all(x >= 0 and x <= 100 for x in r), r) + self.assertGreaterEqual(np.mean(r), 40.0) + self.assertLessEqual(np.mean(r), 60.0) + r = [hg(1000, 100000, 100) for i in range(100)] + self.assertTrue(all(x >= 0 and x <= 100 for x in r), r) + self.assertLessEqual(np.mean(r), 10.0) + r = [hg(100000, 1000, 100) for i in range(100)] + self.assertTrue(all(x >= 0 and x <= 100 for x in r), r) + self.assertGreaterEqual(np.mean(r), 90.0) + + def test_numpy_laplace(self): + r = self._follow_numpy(get_np_state_ptr()) + self._check_dist(jit_binary("np.random.laplace"), r.laplace, + [(0.0, 1.0), (-1.5, 3.5)]) + self._check_dist(jit_unary("np.random.laplace"), r.laplace, + [(0.0,), (-1.5,)]) + self._check_dist(jit_nullary("np.random.laplace"), r.laplace, [()]) + + def test_numpy_logistic(self): + r = self._follow_numpy(get_np_state_ptr()) + self._check_dist(jit_binary("np.random.logistic"), r.logistic, + [(0.0, 1.0), (-1.5, 3.5)]) + self._check_dist(jit_unary("np.random.logistic"), r.logistic, + [(0.0,), (-1.5,)]) + self._check_dist(jit_nullary("np.random.logistic"), r.logistic, [()]) + + def test_numpy_logseries(self): + r = self._follow_numpy(get_np_state_ptr()) + logseries = jit_unary("np.random.logseries") + self._check_dist(logseries, r.logseries, + [(0.1,), (0.99,), (0.9999,)], + niters=50) + # Numpy's logseries overflows on 32-bit builds, so instead + # hardcode Numpy's (correct) output on 64-bit builds. + r = self._follow_numpy(get_np_state_ptr(), seed=1) + self.assertEqual([logseries(0.9999999999999) for i in range(10)], + [2022733531, 77296, 30, 52204, 9341294, 703057324, + 413147702918, 1870715907, 16009330, 738]) + self.assertRaises(ValueError, logseries, 0.0) + self.assertRaises(ValueError, logseries, -0.1) + self.assertRaises(ValueError, logseries, 1.1) + + def test_numpy_poisson(self): + r = self._follow_numpy(get_np_state_ptr()) + poisson = jit_unary("np.random.poisson") + # Our implementation follows Numpy's. + self._check_dist(poisson, r.poisson, + [(0.0,), (0.5,), (2.0,), (10.0,), (900.5,)], + niters=50) + self.assertRaises(ValueError, poisson, -0.1) + + def test_numpy_negative_binomial(self): + self._follow_numpy(get_np_state_ptr(), 0) + negbin = jit_binary("np.random.negative_binomial") + self.assertEqual([negbin(10, 0.9) for i in range(10)], + [2, 3, 1, 5, 2, 1, 0, 1, 0, 0]) + self.assertEqual([negbin(10, 0.1) for i in range(10)], + [55, 71, 56, 57, 56, 56, 34, 55, 101, 67]) + self.assertEqual([negbin(1000, 0.1) for i in range(10)], + [9203, 8640, 9081, 9292, 8938, + 9165, 9149, 8774, 8886, 9117]) + m = np.mean([negbin(1000000000, 0.1) + for i in range(50)]) + self.assertGreater(m, 9e9 * 0.99) + self.assertLess(m, 9e9 * 1.01) + self.assertRaises(ValueError, negbin, 0, 0.5) + self.assertRaises(ValueError, negbin, -1, 0.5) + self.assertRaises(ValueError, negbin, 10, -0.1) + self.assertRaises(ValueError, negbin, 10, 1.1) + + def test_numpy_power(self): + r = self._follow_numpy(get_np_state_ptr()) + power = jit_unary("np.random.power") + self._check_dist(power, r.power, + [(0.1,), (0.5,), (0.9,), (6.0,)]) + self.assertRaises(ValueError, power, 0.0) + self.assertRaises(ValueError, power, -0.1) + + def test_numpy_rayleigh(self): + r = self._follow_numpy(get_np_state_ptr()) + rayleigh1 = jit_unary("np.random.rayleigh") + rayleigh0 = jit_nullary("np.random.rayleigh") + self._check_dist(rayleigh1, r.rayleigh, + [(0.1,), (0.8,), (25.,), (1e3,)]) + self._check_dist(rayleigh0, r.rayleigh, [()]) + self.assertRaises(ValueError, rayleigh1, 0.0) + self.assertRaises(ValueError, rayleigh1, -0.1) + + def test_numpy_standard_cauchy(self): + r = self._follow_numpy(get_np_state_ptr()) + cauchy = jit_nullary("np.random.standard_cauchy") + self._check_dist(cauchy, r.standard_cauchy, [()]) + + def test_numpy_standard_t(self): + # We use CPython's algorithm for the gamma dist and numpy's + # for the normal dist. Standard T calls both so we can't check + # against either generator's output. + r = self._follow_cpython(get_np_state_ptr()) + standard_t = jit_unary("np.random.standard_t") + avg = np.mean([standard_t(5) for i in range(5000)]) + # Sanity check + self.assertLess(abs(avg), 0.5) + + def test_numpy_wald(self): + r = self._follow_numpy(get_np_state_ptr()) + wald = jit_binary("np.random.wald") + self._check_dist(wald, r.wald, [(1.0, 1.0), (2.0, 5.0)]) + self.assertRaises(ValueError, wald, 0.0, 1.0) + self.assertRaises(ValueError, wald, -0.1, 1.0) + self.assertRaises(ValueError, wald, 1.0, 0.0) + self.assertRaises(ValueError, wald, 1.0, -0.1) + + def test_numpy_wald_kwargs(self): + numba_version = jit_with_kwargs("np.random.wald", ['mean', 'scale']) + self._check_any_distrib_kwargs(numba_version, + get_np_state_ptr(), + distrib="wald", + paramlist=[{'mean': 1.0, 'scale': 1.0}, + {'mean': 2.0, 'scale': 5.0}]) + self.assertRaises(ValueError, numba_version, 0.0, 1.0) + self.assertRaises(ValueError, numba_version, -0.1, 1.0) + self.assertRaises(ValueError, numba_version, 1.0, 0.0) + self.assertRaises(ValueError, numba_version, 1.0, -0.1) + + def test_numpy_zipf(self): + r = self._follow_numpy(get_np_state_ptr()) + zipf = jit_unary("np.random.zipf") + self._check_dist(zipf, r.zipf, [(1.5,), (2.5,)], niters=100) + for val in (1.0, 0.5, 0.0, -0.1): + self.assertRaises(ValueError, zipf, val) + + def _check_shuffle(self, func, ptr, is_numpy): + """ + Check a shuffle()-like function for arrays. + """ + arrs = [np.arange(20), np.arange(32).reshape((8, 4))] + if is_numpy: + r = self._follow_numpy(ptr) + else: + r = self._follow_cpython(ptr) + for a in arrs: + for i in range(3): + got = a.copy() + expected = a.copy() + func(got) + if is_numpy or len(a.shape) == 1: + r.shuffle(expected) + self.assertPreciseEqual(got, expected) + # Test with an arbitrary buffer-providing object + a = arrs[0] + b = a.copy() + func(memoryview(b)) + self.assertNotEqual(list(a), list(b)) + self.assertEqual(sorted(a), sorted(b)) + # Read-only object + with self.assertTypingError(): + func(memoryview(b"xyz")) + + def test_random_shuffle(self): + self._check_shuffle(jit_unary("random.shuffle"), get_py_state_ptr(), False) + + def test_numpy_shuffle(self): + self._check_shuffle(jit_unary("np.random.shuffle"), get_np_state_ptr(), True) + + def _check_startup_randomness(self, func_name, func_args): + """ + Check that the state is properly randomized at startup. + """ + code = """if 1: + from numba.tests import test_random + func = getattr(test_random, %(func_name)r) + print(func(*%(func_args)r)) + """ % (locals()) + numbers = set() + for i in range(3): + popen = subprocess.Popen([sys.executable, "-c", code], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = popen.communicate() + if popen.returncode != 0: + raise AssertionError("process failed with code %s: stderr follows\n%s\n" + % (popen.returncode, err.decode())) + numbers.add(float(out.strip())) + self.assertEqual(len(numbers), 3, numbers) + + def test_random_random_startup(self): + self._check_startup_randomness("random_random", ()) + + def test_random_gauss_startup(self): + self._check_startup_randomness("random_gauss", (1.0, 1.0)) + + def test_numpy_random_startup(self): + self._check_startup_randomness("numpy_random", ()) + + def test_numpy_gauss_startup(self): + self._check_startup_randomness("numpy_normal", (1.0, 1.0)) + + def test_numpy_random_permutation(self): + func = jit_unary("np.random.permutation") + r = self._follow_numpy(get_np_state_ptr()) + for s in [5, 10, 15, 20]: + a = np.arange(s) + b = a.copy() + # Test array version + self.assertPreciseEqual(func(a), r.permutation(a)) + # Test int version + self.assertPreciseEqual(func(s), r.permutation(s)) + # Permutation should not modify its argument + self.assertPreciseEqual(a, b) + # Check multi-dimensional arrays + arrs = [np.arange(10).reshape(2, 5), + np.arange(27).reshape(3, 3, 3), + np.arange(36).reshape(2, 3, 3, 2)] + for a in arrs: + b = a.copy() + self.assertPreciseEqual(func(a), r.permutation(a)) + self.assertPreciseEqual(a, b) + + +class TestRandomArrays(BaseTest): + """ + Test array-producing variants of np.random.* functions. + """ + + def _compile_array_dist(self, funcname, nargs): + qualname = "np.random.%s" % (funcname,) + argstring = ', '.join('abcd'[:nargs]) + return jit_with_args(qualname, argstring) + + def _check_array_dist(self, funcname, scalar_args): + """ + Check returning an array according to a given distribution. + """ + cfunc = self._compile_array_dist(funcname, len(scalar_args) + 1) + r = self._follow_numpy(get_np_state_ptr()) + pyfunc = getattr(r, funcname) + for size in (8, (2, 3)): + args = scalar_args + (size,) + expected = pyfunc(*args) + got = cfunc(*args) + # Numpy may return int32s where we return int64s, adjust + if (expected.dtype == np.dtype('int32') + and got.dtype == np.dtype('int64')): + expected = expected.astype(got.dtype) + self.assertPreciseEqual(expected, got, prec='double', ulps=5) + args = scalar_args + (None,) + expected = pyfunc(*args) + got = cfunc(*args) + self.assertPreciseEqual(expected, got, prec='double', ulps=5) + + def _check_array_dist_gamma(self, funcname, scalar_args, extra_pyfunc_args): + """ + Check returning an array according to a given gamma distribution, + where we use CPython's implementation rather than NumPy's. + """ + cfunc = self._compile_array_dist(funcname, len(scalar_args) + 1) + r = self._follow_cpython(get_np_state_ptr()) + pyfunc = getattr(r, "gammavariate") + pyfunc_args = scalar_args + extra_pyfunc_args + pyrandom = lambda *_args: pyfunc(*pyfunc_args) + + args = scalar_args + (None,) + expected = pyrandom() + got = cfunc(*args) + self.assertPreciseEqual(expected, got, prec='double', ulps=5) + for size in (8, (2, 3)): + args = scalar_args + (size,) + expected = np.empty(size) + expected_flat = expected.flat + for idx in range(expected.size): + expected_flat[idx] = pyrandom() + got = cfunc(*args) + self.assertPreciseEqual(expected, got, prec='double', ulps=5) + + def _check_array_dist_self(self, funcname, scalar_args): + """ + Check function returning an array against its scalar implementation. + Because we use the CPython gamma distribution rather than the NumPy one, + distributions which use the gamma distribution vary in ways that are + difficult to compare. Instead, we compile both the array and scalar + versions and check that the array is filled with the same values as + we would expect from the scalar version. + """ + @numba.njit + def reset(): + np.random.seed(1234) + + array_func = self._compile_array_dist(funcname, len(scalar_args) + 1) + + qualname = "np.random.%s" % (funcname,) + argstring = ', '.join('abcd'[:len(scalar_args)]) + scalar_func = jit_with_args(qualname, argstring) + + for size in (8, (2, 3)): + args = scalar_args + (size,) + reset() + got = array_func(*args) + reset() + # We're just going to go with whatever type the array version + # gives us and hope it's not Boolean or something useless. + expected = np.empty(size, dtype=got.dtype) + flat = expected.flat + for idx in range(expected.size): + flat[idx] = scalar_func(*scalar_args) + self.assertPreciseEqual(expected, got, prec='double', ulps=5) + + reset() + args = scalar_args + (None,) + expected = scalar_func(*scalar_args) + reset() + got = array_func(*args) + self.assertPreciseEqual(expected, got, prec='double', ulps=5) + + def test_numpy_randint(self): + cfunc = self._compile_array_dist("randint", 3) + low, high = 1000, 10000 + size = (30, 30) + res = cfunc(low, high, size) + self.assertIsInstance(res, np.ndarray) + self.assertEqual(res.shape, size) + self.assertIn(res.dtype, (np.dtype('int32'), np.dtype('int64'))) + self.assertTrue(np.all(res >= low)) + self.assertTrue(np.all(res < high)) + # Crude statistical tests + mean = (low + high) / 2 + tol = (high - low) / 20 + self.assertGreaterEqual(res.mean(), mean - tol) + self.assertLessEqual(res.mean(), mean + tol) + + def test_numpy_random_random(self): + cfunc = self._compile_array_dist("random", 1) + size = (30, 30) + res = cfunc(size) + self.assertIsInstance(res, np.ndarray) + self.assertEqual(res.shape, size) + self.assertEqual(res.dtype, np.dtype('float64')) + # Results are within expected bounds + self.assertTrue(np.all(res >= 0.0)) + self.assertTrue(np.all(res < 1.0)) + # Crude statistical tests + self.assertTrue(np.any(res <= 0.1)) + self.assertTrue(np.any(res >= 0.9)) + mean = res.mean() + self.assertGreaterEqual(mean, 0.45) + self.assertLessEqual(mean, 0.55) + + # Sanity-check various distributions. For convenience, we only check + # those distributions that produce the exact same values as Numpy's. + + def test_numpy_beta(self): + self._check_array_dist_self("beta", (0.5, 2.5)) + + def test_numpy_binomial(self): + self._check_array_dist("binomial", (20, 0.5)) + + def test_numpy_chisquare(self): + self._check_array_dist_self("chisquare", (1.5,)) + + def test_numpy_exponential(self): + self._check_array_dist("exponential", (1.5,)) + + def test_numpy_f(self): + self._check_array_dist_self("f", (0.5, 1.5)) + + def test_numpy_gamma(self): + self._check_array_dist_gamma("gamma", (2.0, 1.0), ()) + + def test_numpy_geometric(self): + self._check_array_dist("geometric", (1.0,)) + + def test_numpy_gumbel(self): + self._check_array_dist("gumbel", (1.5, 0.5)) + + def test_numpy_hypergeometric(self): + self._check_array_dist("hypergeometric", (1000, 5000, 10)) + + def test_numpy_laplace(self): + self._check_array_dist("laplace", (1.5, 0.5)) + + def test_numpy_logistic(self): + self._check_array_dist("logistic", (1.5, 0.5)) + + def test_numpy_lognormal(self): + self._check_array_dist("lognormal", (1.5, 2.0)) + + def test_numpy_logseries(self): + self._check_array_dist("logseries", (0.8,)) + + def test_numpy_normal(self): + self._check_array_dist("normal", (0.5, 2.0)) + + def test_numpy_pareto(self): + self._check_array_dist("pareto", (0.5,)) + + def test_numpy_poisson(self): + self._check_array_dist("poisson", (0.8,)) + + def test_numpy_power(self): + self._check_array_dist("power", (0.8,)) + + def test_numpy_rand(self): + cfunc = jit(nopython=True)(numpy_check_rand) + expected, got = cfunc(42, 2, 3) + self.assertEqual(got.shape, (2, 3)) + self.assertPreciseEqual(expected, got) + + def test_numpy_randn(self): + cfunc = jit(nopython=True)(numpy_check_randn) + expected, got = cfunc(42, 2, 3) + self.assertEqual(got.shape, (2, 3)) + self.assertPreciseEqual(expected, got) + + def test_numpy_rayleigh(self): + self._check_array_dist("rayleigh", (0.8,)) + + def test_numpy_standard_cauchy(self): + self._check_array_dist("standard_cauchy", ()) + + def test_numpy_standard_exponential(self): + self._check_array_dist("standard_exponential", ()) + + def test_numpy_standard_gamma(self): + self._check_array_dist_gamma("standard_gamma", (2.0,), (1.0,)) + + def test_numpy_standard_normal(self): + self._check_array_dist("standard_normal", ()) + + def test_numpy_triangular(self): + self._check_array_dist("triangular", (1.5, 2.2, 3.5)) + + def test_numpy_uniform(self): + self._check_array_dist("uniform", (0.1, 0.4)) + + def test_numpy_wald(self): + self._check_array_dist("wald", (0.1, 0.4)) + + def test_numpy_vonmises(self): + self._check_array_dist_self("vonmises", (0.5, 2.5)) + + def test_numpy_zipf(self): + self._check_array_dist("zipf", (2.5,)) + + +class TestRandomChoice(BaseTest): + """ + Test np.random.choice. + """ + + def _check_results(self, pop, res, replace=True): + """ + Check basic expectations about a batch of samples. + """ + spop = set(pop) + sres = set(res) + # All results are in the population + self.assertLessEqual(sres, spop) + # Sorted results are unlikely + self.assertNotEqual(sorted(res), list(res)) + if replace: + # Duplicates are likely + self.assertLess(len(sres), len(res), res) + else: + # No duplicates + self.assertEqual(len(sres), len(res), res) + + def _check_dist(self, pop, samples): + """ + Check distribution of some samples. + """ + # Sanity check that we have enough samples + self.assertGreaterEqual(len(samples), len(pop) * 100) + # Check equidistribution of samples + expected_frequency = len(samples) / len(pop) + c = collections.Counter(samples) + for value in pop: + n = c[value] + self.assertGreaterEqual(n, expected_frequency * 0.5) + self.assertLessEqual(n, expected_frequency * 2.0) + + def _accumulate_array_results(self, func, nresults): + """ + Accumulate array results produced by *func* until they reach + *nresults* elements. + """ + res = [] + while len(res) < nresults: + res += list(func().flat) + return res[:nresults] + + def _check_choice_1(self, a, pop): + """ + Check choice(a) against pop. + """ + cfunc = jit(nopython=True)(numpy_choice1) + n = len(pop) + res = [cfunc(a) for i in range(n)] + self._check_results(pop, res) + dist = [cfunc(a) for i in range(n * 100)] + self._check_dist(pop, dist) + + def test_choice_scalar_1(self): + """ + Test choice(int) + """ + n = 50 + pop = list(range(n)) + self._check_choice_1(n, pop) + + def test_choice_array_1(self): + """ + Test choice(array) + """ + pop = np.arange(50) * 2 + 100 + self._check_choice_1(pop, pop) + + def _check_array_results(self, func, pop, replace=True): + """ + Check array results produced by *func* and their distribution. + """ + n = len(pop) + res = list(func().flat) + self._check_results(pop, res, replace) + dist = self._accumulate_array_results(func, n * 100) + self._check_dist(pop, dist) + + def _check_choice_2(self, a, pop): + """ + Check choice(a, size) against pop. + """ + cfunc = jit(nopython=True)(numpy_choice2) + n = len(pop) + # Final sizes should be large enough, so as to stress + # replacement + sizes = [n - 10, (3, (n - 1) // 3), n * 10] + + for size in sizes: + # Check result shape + res = cfunc(a, size) + expected_shape = size if isinstance(size, tuple) else (size,) + self.assertEqual(res.shape, expected_shape) + # Check results and their distribution + self._check_array_results(lambda: cfunc(a, size), pop) + + def test_choice_scalar_2(self): + """ + Test choice(int, size) + """ + n = 50 + pop = np.arange(n) + self._check_choice_2(n, pop) + + def test_choice_array_2(self): + """ + Test choice(array, size) + """ + pop = np.arange(50) * 2 + 100 + self._check_choice_2(pop, pop) + + def _check_choice_3(self, a, pop): + """ + Check choice(a, size, replace) against pop. + """ + cfunc = jit(nopython=True)(numpy_choice3) + n = len(pop) + # Final sizes should be close but slightly <= n, so as to stress + # replacement (or not) + sizes = [n - 10, (3, (n - 1) // 3)] + replaces = [True, False] + + # Check result shapes + for size in sizes: + for replace in [True, False]: + res = cfunc(a, size, replace) + expected_shape = size if isinstance(size, tuple) else (size,) + self.assertEqual(res.shape, expected_shape) + + # Check results for replace=True + for size in sizes: + self._check_array_results(lambda: cfunc(a, size, True), pop) + # Check results for replace=False + for size in sizes: + self._check_array_results(lambda: cfunc(a, size, False), pop, False) + + # Can't ask for more samples than population size with replace=False + for size in [n + 1, (3, n // 3 + 1)]: + with self.assertRaises(ValueError): + cfunc(a, size, False) + + def test_choice_scalar_3(self): + """ + Test choice(int, size, replace) + """ + n = 50 + pop = np.arange(n) + self._check_choice_3(n, pop) + + def test_choice_array_3(self): + """ + Test choice(array, size, replace) + """ + pop = np.arange(50) * 2 + 100 + self._check_choice_3(pop, pop) + + def test_choice_follows_seed(self): + # See issue #3888, np.random.choice must acknowledge the seed + + @jit(nopython=True) + def numba_rands(n_to_return, choice_array): + np.random.seed(1337) + out = np.empty((n_to_return, 2), np.int32) + for i in range(n_to_return): + out[i] = np.random.choice(choice_array, 2, False) + return out + + choice_array = np.random.randint(300, size=1000).astype(np.int32) + tmp_np = choice_array.copy() + expected = numba_rands.py_func(5, tmp_np) + tmp_nb = choice_array.copy() + got = numba_rands(5, tmp_nb) + np.testing.assert_allclose(expected, got) + # check no mutation + np.testing.assert_allclose(choice_array, tmp_np) + np.testing.assert_allclose(choice_array, tmp_nb) + + +class TestRandomMultinomial(BaseTest): + """ + Test np.random.multinomial. + """ + # A biased dice + pvals = np.array([1, 1, 1, 2, 3, 1], dtype=np.float64) + pvals /= pvals.sum() + + def _check_sample(self, n, pvals, sample): + """ + Check distribution of some samples. + """ + self.assertIsInstance(sample, np.ndarray) + self.assertEqual(sample.shape, (len(pvals),)) + self.assertIn(sample.dtype, (np.dtype('int32'), np.dtype('int64'))) + # Statistical properties + self.assertEqual(sample.sum(), n) + for p, nexp in zip(pvals, sample): + self.assertGreaterEqual(nexp, 0) + self.assertLessEqual(nexp, n) + pexp = float(nexp) / n + self.assertGreaterEqual(pexp, p * 0.5) + self.assertLessEqual(pexp, p * 2.0) + + def test_multinomial_2(self): + """ + Test multinomial(n, pvals) + """ + cfunc = jit(nopython=True)(numpy_multinomial2) + n, pvals = 1000, self.pvals + res = cfunc(n, pvals) + self._check_sample(n, pvals, res) + # pvals as list + pvals = list(pvals) + res = cfunc(n, pvals) + self._check_sample(n, pvals, res) + # A case with extreme probabilities + n = 1000000 + pvals = np.array([1, 0, n // 100, 1], dtype=np.float64) + pvals /= pvals.sum() + res = cfunc(n, pvals) + self._check_sample(n, pvals, res) + + def test_multinomial_3_int(self): + """ + Test multinomial(n, pvals, size: int) + """ + cfunc = jit(nopython=True)(numpy_multinomial3) + n, pvals = 1000, self.pvals + k = 10 + res = cfunc(n, pvals, k) + self.assertEqual(res.shape[0], k) + for sample in res: + self._check_sample(n, pvals, sample) + + def test_multinomial_3_tuple(self): + """ + Test multinomial(n, pvals, size: tuple) + """ + cfunc = jit(nopython=True)(numpy_multinomial3) + n, pvals = 1000, self.pvals + k = (3, 4) + res = cfunc(n, pvals, k) + self.assertEqual(res.shape[:-1], k) + for sample in res.reshape((-1, res.shape[-1])): + self._check_sample(n, pvals, sample) + + +class TestRandomDirichlet(BaseTest): + alpha = np.array([1, 1, 1, 2], dtype=np.float64) + + def _check_sample(self, alpha, size, sample): + + """Check output structure""" + self.assertIsInstance(sample, np.ndarray) + self.assertEqual(sample.dtype, np.float64) + if size is None: + self.assertEqual(sample.size, len(alpha)) + elif type(size) is int: + self.assertEqual(sample.shape, (size, len(alpha))) + else: + self.assertEqual(sample.shape, size + (len(alpha),)) + + """Check statistical properties""" + for val in np.nditer(sample): + self.assertGreaterEqual(val, 0) + self.assertLessEqual(val, 1) + if size is None: + self.assertAlmostEqual(sample.sum(), 1, places=5) + else: + for totals in np.nditer(sample.sum(axis=-1)): + self.assertAlmostEqual(totals, 1, places=5) + + def test_dirichlet_default(self): + """ + Test dirichlet(alpha, size=None) + """ + cfunc = jit(nopython=True)(numpy_dirichlet_default) + alphas = ( + self.alpha, + tuple(self.alpha), + np.array([1, 1, 10000, 1], dtype=np.float64), + np.array([1, 1, 1.5, 1], dtype=np.float64), + ) + for alpha in alphas: + res = cfunc(alpha) + self._check_sample(alpha, None, res) + + def test_dirichlet(self): + """ + Test dirichlet(alpha, size=None) + """ + cfunc = jit(nopython=True)(numpy_dirichlet) + sizes = (None, (10,), (10, 10)) + alphas = ( + self.alpha, + tuple(self.alpha), + np.array([1, 1, 10000, 1], dtype=np.float64), + np.array([1, 1, 1.5, 1], dtype=np.float64), + ) + + for alpha, size in itertools.product(alphas, sizes): + res = cfunc(alpha, size) + self._check_sample(alpha, size, res) + + def test_dirichlet_exceptions(self): + cfunc = jit(nopython=True)(numpy_dirichlet) + alpha = tuple((0, 1, 1)) + with self.assertRaises(ValueError) as raises: + cfunc(alpha, 1) + self.assertIn("dirichlet: alpha must be > 0.0", str(raises.exception)) + + alpha = self.alpha + sizes = (True, 3j, 1.5, (1.5, 1), (3j, 1), (3j, 3j), (np.int8(3), np.int64(7))) + for size in sizes: + with self.assertRaises(TypingError) as raises: + cfunc(alpha, size) + self.assertIn( + "np.random.dirichlet(): size should be int or " + "tuple of ints or None, got", + str(raises.exception), + ) + +class TestRandomNoncentralChiSquare(BaseTest): + + def _check_sample(self, size, sample): + + # Check output structure + if size is not None: + self.assertIsInstance(sample, np.ndarray) + self.assertEqual(sample.dtype, np.float64) + + if isinstance(size, int): + self.assertEqual(sample.shape, (size,)) + else: + self.assertEqual(sample.shape, size) + else: + self.assertIsInstance(sample, float) + + # Check statistical properties + for val in np.nditer(sample): + self.assertGreaterEqual(val, 0) + + def test_noncentral_chisquare_default(self): + """ + Test noncentral_chisquare(df, nonc, size=None) + """ + cfunc = jit(nopython=True)(numpy_noncentral_chisquare_default) + inputs = ( + (0.5, 1), # test branch when df < 1 + (1, 5), + (5, 1), + (100000, 1), + (1, 10000), + ) + for df, nonc in inputs: + res = cfunc(df, nonc) + self._check_sample(None, res) + res = cfunc(df, np.nan) # test branch when nonc is nan + self.assertTrue(np.isnan(res)) + + + def test_noncentral_chisquare(self): + """ + Test noncentral_chisquare(df, nonc, size) + """ + cfunc = jit(nopython=True)(numpy_noncentral_chisquare) + sizes = (None, 10, (10,), (10, 10)) + inputs = ( + (0.5, 1), + (1, 5), + (5, 1), + (100000, 1), + (1, 10000), + ) + + for (df, nonc), size in itertools.product(inputs, sizes): + res = cfunc(df, nonc, size) + self._check_sample(size, res) + res = cfunc(df, np.nan, size) # test branch when nonc is nan + self.assertTrue(np.isnan(res).all()) + + def test_noncentral_chisquare_exceptions(self): + cfunc = jit(nopython=True)(numpy_noncentral_chisquare) + df, nonc = 0, 1 + with self.assertRaises(ValueError) as raises: + cfunc(df, nonc, 1) + self.assertIn("df <= 0", str(raises.exception)) + + df, nonc = 1, -1 + with self.assertRaises(ValueError) as raises: + cfunc(df, nonc, 1) + self.assertIn("nonc < 0", str(raises.exception)) + + df, nonc = 1, 1 + sizes = (True, 3j, 1.5, (1.5, 1), (3j, 1), (3j, 3j), (np.int8(3), np.int64(7))) + for size in sizes: + with self.assertRaises(TypingError) as raises: + cfunc(df, nonc, size) + self.assertIn( + "np.random.noncentral_chisquare(): size should be int or " + "tuple of ints or None, got", + str(raises.exception), + ) + +@jit(nopython=True, nogil=True) +def py_extract_randomness(seed, out): + if seed != 0: + random.seed(seed) + for i in range(out.size): + out[i] = random.getrandbits(32) + +_randint_limit = 1 << 32 + +@jit(nopython=True, nogil=True) +def np_extract_randomness(seed, out): + if seed != 0: + np.random.seed(seed) + s = 0 + for i in range(out.size): + out[i] = np.random.randint(_randint_limit) + + + +class ConcurrencyBaseTest(TestCase): + + # Enough iterations for: + # 1. Mersenne-Twister state shuffles to occur (once every 624) + # 2. Race conditions to be plausible + # 3. Nice statistical properties to emerge + _extract_iterations = 100000 + + def setUp(self): + # Warm up, to avoid compiling in the threads + args = (42, self._get_output(1)) + py_extract_randomness(*args) + np_extract_randomness(*args) + + def _get_output(self, size): + return np.zeros(size, dtype=np.uint32) + + def check_output(self, out): + """ + Check statistical properties of output. + """ + # Output should follow a uniform distribution in [0, 1<<32) + expected_avg = 1 << 31 + expected_std = (1 << 32) / np.sqrt(12) + rtol = 0.05 # given enough iterations + np.testing.assert_allclose(out.mean(), expected_avg, rtol=rtol) + np.testing.assert_allclose(out.std(), expected_std, rtol=rtol) + + def check_several_outputs(self, results, same_expected): + # Outputs should have the expected statistical properties + # (an uninitialized PRNG or a PRNG whose internal state was + # corrupted by a race condition could produce bogus randomness) + for out in results: + self.check_output(out) + + # Check all threads gave either the same sequence or + # distinct sequences + if same_expected: + expected_distinct = 1 + else: + expected_distinct = len(results) + + heads = {tuple(out[:5]) for out in results} + tails = {tuple(out[-5:]) for out in results} + sums = {out.sum() for out in results} + self.assertEqual(len(heads), expected_distinct, heads) + self.assertEqual(len(tails), expected_distinct, tails) + self.assertEqual(len(sums), expected_distinct, sums) + + +class TestThreads(ConcurrencyBaseTest): + """ + Check the PRNG behaves well with threads. + """ + + def extract_in_threads(self, nthreads, extract_randomness, seed): + """ + Run *nthreads* threads extracting randomness with the given *seed* + (no seeding if 0). + """ + results = [self._get_output(self._extract_iterations) + for i in range(nthreads + 1)] + + def target(i): + # The PRNG will be seeded in thread + extract_randomness(seed=seed, out=results[i]) + + threads = [threading.Thread(target=target, args=(i,)) + for i in range(nthreads)] + + for th in threads: + th.start() + # Exercise main thread as well + target(nthreads) + for th in threads: + th.join() + + return results + + def check_thread_safety(self, extract_randomness): + """ + When initializing the PRNG the same way, each thread + should produce the same sequence of random numbers, + using independent states, regardless of parallel + execution. + """ + # Note the seed value doesn't matter, as long as it's + # the same for all threads + results = self.extract_in_threads(15, extract_randomness, seed=42) + + # All threads gave the same sequence + self.check_several_outputs(results, same_expected=True) + + def check_implicit_initialization(self, extract_randomness): + """ + The PRNG in new threads should be implicitly initialized with + system entropy, if seed() wasn't called. + """ + results = self.extract_in_threads(4, extract_randomness, seed=0) + + # All threads gave a different, valid random sequence + self.check_several_outputs(results, same_expected=False) + + def test_py_thread_safety(self): + self.check_thread_safety(py_extract_randomness) + + def test_np_thread_safety(self): + self.check_thread_safety(np_extract_randomness) + + def test_py_implicit_initialization(self): + self.check_implicit_initialization(py_extract_randomness) + + def test_np_implicit_initialization(self): + self.check_implicit_initialization(np_extract_randomness) + + +@unittest.skipIf(os.name == 'nt', "Windows is not affected by fork() issues") +class TestProcesses(ConcurrencyBaseTest): + """ + Check the PRNG behaves well in child processes. + """ + + # Avoid nested multiprocessing AssertionError + # ("daemonic processes are not allowed to have children") + _numba_parallel_test_ = False + + + def extract_in_processes(self, nprocs, extract_randomness): + """ + Run *nprocs* processes extracting randomness + without explicit seeding. + """ + q = multiprocessing.Queue() + results = [] + + def target_inner(): + out = self._get_output(self._extract_iterations) + extract_randomness(seed=0, out=out) + return out + + def target(): + try: + out = target_inner() + q.put(out) + except Exception as e: + # Ensure an exception in a child gets reported + # in the parent. + q.put(e) + raise + + if hasattr(multiprocessing, 'get_context'): + # The test works only in fork context. + mpc = multiprocessing.get_context('fork') + else: + mpc = multiprocessing + procs = [mpc.Process(target=target) + for i in range(nprocs)] + for p in procs: + p.start() + # Need to dequeue before joining, otherwise the large size of the + # enqueued objects will lead to deadlock. + for i in range(nprocs): + results.append(q.get(timeout=5)) + for p in procs: + p.join() + + # Exercise parent process as well; this will detect if the + # same state was reused for one of the children. + results.append(target_inner()) + for res in results: + if isinstance(res, Exception): + self.fail("Exception in child: %s" % (res,)) + + return results + + def check_implicit_initialization(self, extract_randomness): + """ + The PRNG in new processes should be implicitly initialized + with system entropy, to avoid reproducing the same sequences. + """ + results = self.extract_in_processes(2, extract_randomness) + + # All processes gave a different, valid random sequence + self.check_several_outputs(results, same_expected=False) + + def test_py_implicit_initialization(self): + self.check_implicit_initialization(py_extract_randomness) + + def test_np_implicit_initialization(self): + self.check_implicit_initialization(np_extract_randomness) + + +class TestNumPyRandomAPI(TestCase): + API_CALL_TESTS = {"np.random.beta": {'a': 1., 'b': 2., 'size': 3}, + "np.random.binomial": {'n': 1, 'p': 0.3, 'size': 3}, + "np.random.chisquare": {'df': 2., 'size': 3}, + "np.random.choice": {'a': 2, 'size': 3}, + "np.random.dirichlet": {'alpha': (2,), 'size': 3}, + "np.random.exponential": {'scale': 1., 'size': 3}, + "np.random.f": {'dfnum': 1., 'dfden': 2., 'size': 3}, + "np.random.gamma": {'shape': 2, 'scale': 2.0, 'size': 3}, + "np.random.geometric": {'p': 1., 'size': 3}, + "np.random.gumbel": {'loc': 0., 'scale': 1., 'size': 3}, + "np.random.hypergeometric": {'ngood': 1, 'nbad': 1, + 'nsample': 1, 'size': 3}, + "np.random.laplace": {'loc': 0., 'scale': 1., 'size': 3}, + "np.random.logistic": {'loc': 0., 'scale': 1., 'size': 3}, + "np.random.lognormal": {'mean': 0., 'sigma': 1., 'size': 3}, + "np.random.logseries": {'p': 0.5, 'size': 3}, + "np.random.multinomial": {'n': 1, 'pvals': (1,), 'size': 3}, + "np.random.negative_binomial": {'n': 1, 'p': 0.5}, + "np.random.noncentral_chisquare": {'df': 1., 'nonc': 1., + 'size': 3}, + "np.random.normal": {'loc': 0., 'scale': 1., 'size': 3}, + "np.random.pareto": {'a': 2., 'size': 3}, + # NOTE: The NumPy impl of permutation "takes no keyword + # arguments". + # "np.random.permutation": {'x': (1, 2, 3)}, + "np.random.poisson": {'lam': 1., 'size': 3}, + "np.random.power": {'a': 2., 'size': 3}, + # NOTE: The NumPy impl of rand essentially takes *args so kwargs + # are unsupported. + # "np.random.rand": {'d0': 1, 'd1': 2, ...}} + "np.random.randint": {'low': 1, 'high': 2, 'size': 3}, + # NOTE: The NumPy impl of randn essentially takes *args so + # kwargs are unsupported. + # "np.random.randn": {'d0': 1, 'd1': 2, ...}} + "np.random.random": {'size': 3}, + "np.random.random_sample": {'size': 3}, + "np.random.ranf": {'size': 3}, + "np.random.rayleigh": {'scale': 1., 'size': 3}, + "np.random.sample": {'size': 3}, + "np.random.seed": {'seed': 4}, + # NOTE: The NumPy impl of shuffle "takes no keyword arguments". + # "np.random.shuffle" + "np.random.standard_cauchy": {'size': 3}, + "np.random.standard_exponential": {'size': 3}, + "np.random.standard_gamma": {'shape': 2., 'size': 3}, + "np.random.standard_normal": {'size': 3}, + "np.random.standard_t": {'df': 2., 'size': 3}, + "np.random.triangular": {'left': 1., 'mode': 2., 'right': 3., + 'size': 3}, + "np.random.uniform": {'low': 1., 'high': 2., 'size': 3}, + "np.random.vonmises": {'mu': 1., 'kappa': 2., 'size': 3}, + "np.random.wald": {'mean': 1., 'scale': 2., 'size': 3}, + "np.random.weibull": {'a': 1., 'size': 3}, + "np.random.zipf": {'a': 2., 'size': 3},} + + def test_call_by_name(self): + # Checks that the NumPy impls in Numba can be used via call-by-name + # args, see issue numba#9053. + # + # Checking call-by-name has to be done somewhat manually as the NumPy + # numpy.random.* functions do not have signatures, see numpy#8734. + + # Herein, it doesn't matter what the values are, the names and types + # just have to make sense. + + for fn, args in self.API_CALL_TESTS.items(): + argstr = ', '.join([f'{k}={v}' for k, v in args.items()]) + template = dedent(f""" + def foo(): + return {fn}({argstr}) + """) + l = {} + exec(template, {'np': np}, l) + # The answer doesn't matter, these are tested in the tests above, + # the purpose of this test is to ensure that the code compiles with + # the args presented via name, i.e. the overloads are defined + # correctly with respect to the public API of the function. + func = l['foo'] + func() + njit(func).compile(()) + + def test_call_distributions_with_empty_size(self): + # Check that the distributions can be called with size=() as per the + # NumPy API, see issue numba#8975. + for fn, args in self.API_CALL_TESTS.items(): + if 'size' not in args: + continue + + args['size'] = () + argstr = ', '.join([f'{k}={v}' for k, v in args.items()]) + template = dedent(f""" + def foo(): + return {fn}({argstr}) + """) + l = {} + exec(template, {'np': np}, l) + + # Store result obtained by calling the np and nb functions. + # We are not interested by the values, they were tested above + # but we want to ensure that the function compiles, and that + # the shapes and types are the same between numpy and numba. + func = l['foo'] + np_val = func() + + nb_func = njit(func).compile(()) + nb_val = nb_func() + + if isinstance(nb_val, np.ndarray): + self.assertEqual(nb_val.shape, np_val.shape) + else: + self.assertIsInstance(nb_val, np_val.__class__) + + + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_range.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_range.py new file mode 100644 index 0000000000000000000000000000000000000000..b97e36fd4edc2afaceed5f13736cd3b340ac2993 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_range.py @@ -0,0 +1,187 @@ +import unittest + +import sys + +import numpy + +from numba import jit, njit +from numba.core import types, utils +from numba.tests.support import tag + +from numba.core.inline_closurecall import length_of_iterator + +def loop1(n): + s = 0 + for i in range(n): + s += i + return s + + +def loop2(a, b): + s = 0 + for i in range(a, b): + s += i + return s + + +def loop3(a, b, c): + s = 0 + for i in range(a, b, c): + s += i + return s + + +def range_len1(n): + return len(range(n)) + +def range_len2(a, b): + return len(range(a, b)) + +def range_len3(a, b, c): + return len(range(a, b, c)) +def range_iter_len1(a): + return length_of_iterator(iter(range(a))) + +def range_iter_len2(a): + return length_of_iterator(iter(a)) + +def range_attrs(start, stop, step): + r1 = range(start) + r2 = range(start, stop) + r3 = range(start, stop, step) + tmp = [] + for r in (r1, r2, r3): + tmp.append((r.start, r.stop, r.step)) + return tmp + +def range_contains(val, start, stop, step): + r1 = range(start) + r2 = range(start, stop) + r3 = range(start, stop, step) + return [val in r for r in (r1, r2, r3)] + + +class TestRange(unittest.TestCase): + + def test_loop1_int16(self): + pyfunc = loop1 + cfunc = njit((types.int16,))(pyfunc) + self.assertTrue(cfunc(5), pyfunc(5)) + + def test_loop2_int16(self): + pyfunc = loop2 + cfunc = njit((types.int16, types.int16))(pyfunc) + self.assertTrue(cfunc(1, 6), pyfunc(1, 6)) + + def test_loop3_int32(self): + pyfunc = loop3 + cfunc = njit((types.int32, types.int32, types.int32))(pyfunc) + arglist = [ + (1, 2, 1), + (2, 8, 3), + (-10, -11, -10), + (-10, -10, -2), + ] + for args in arglist: + self.assertEqual(cfunc(*args), pyfunc(*args)) + + def test_range_len1(self): + pyfunc = range_len1 + typelist = [types.int16, types.int32, types.int64] + arglist = [5, 0, -5] + for typ in typelist: + cfunc = njit((typ,))(pyfunc) + for arg in arglist: + self.assertEqual(cfunc(typ(arg)), pyfunc(typ(arg))) + + def test_range_len2(self): + pyfunc = range_len2 + typelist = [types.int16, types.int32, types.int64] + arglist = [(1,6), (6,1), (-5, -1)] + for typ in typelist: + cfunc = njit((typ, typ))(pyfunc) + for args in arglist: + args_ = tuple(typ(x) for x in args) + self.assertEqual(cfunc(*args_), pyfunc(*args_)) + + def test_range_len3(self): + pyfunc = range_len3 + typelist = [types.int16, types.int32, types.int64] + arglist = [ + (1, 2, 1), + (2, 8, 3), + (-10, -11, -10), + (-10, -10, -2), + ] + for typ in typelist: + cfunc = njit((typ, typ, typ))(pyfunc) + for args in arglist: + args_ = tuple(typ(x) for x in args) + self.assertEqual(cfunc(*args_), pyfunc(*args_)) + + def test_range_iter_len1(self): + range_func = range_len1 + range_iter_func = range_iter_len1 + typelist = [types.int16, types.int32, types.int64] + arglist = [5, 0, -5] + for typ in typelist: + cfunc = njit((typ,))(range_iter_func) + for arg in arglist: + self.assertEqual(cfunc(typ(arg)), range_func(typ(arg))) + + def test_range_iter_list(self): + range_iter_func = range_iter_len2 + cfunc = njit((types.List(types.intp, reflected=True),))(range_iter_func) + arglist = [1, 2, 3, 4, 5] + self.assertEqual(cfunc(arglist), len(arglist)) + + def test_range_attrs(self): + pyfunc = range_attrs + arglist = [(0, 0, 1), + (0, -1, 1), + (-1, 1, 1), + (-1, 4, 1), + (-1, 4, 10), + (5, -5, -2),] + + cfunc = njit((types.int64, types.int64, types.int64),)(pyfunc) + for arg in arglist: + self.assertEqual(cfunc(*arg), pyfunc(*arg)) + + def test_range_contains(self): + pyfunc = range_contains + arglist = [(0, 0, 1), + (-1, 0, 1), + (1, 0, -1), + (0, -1, 1), + (0, 1, -1), + (-1, 1, 1), + (-1, 4, 1), + (-1, 4, 10), + (5, -5, -2),] + + bool_vals = [True, False] + int_vals = [-10, -6, -5, -4, -2, -1, 0, + 1, 2, 4, 5, 6, 10] + float_vals = [-1.1, -1.0, 0.0, 1.0, 1.1] + complex_vals = [1 + 0j, 1 + 1j, 1.1 + 0j, 1.0 + 1.1j] + + vallist = (bool_vals + int_vals + float_vals + + complex_vals) + + cfunc = njit(pyfunc) + for arg in arglist: + for val in vallist: + self.assertEqual(cfunc(val, *arg), pyfunc(val, *arg)) + + non_numeric_vals = [{'a': 1}, [1, ], 'abc', (1,)] + + cfunc_obj = jit(pyfunc, forceobj=True) + for arg in arglist: + for val in non_numeric_vals: + self.assertEqual(cfunc_obj(val, *arg), pyfunc(val, *arg)) + + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_recarray_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_recarray_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..06464b470f3ee56dd6435b9218cc4ae63c596fa4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_recarray_usecases.py @@ -0,0 +1,146 @@ +import sys +import unittest + +import numpy as np + +from numba import njit +from numba.core import types +from numba.tests.support import captured_stdout, TestCase +from numba.np import numpy_support + + +def usecase1(arr1, arr2): + """Base on https://github.com/numba/numba/issues/370 + + Modified to add test-able side effect. + """ + n1 = arr1.size + n2 = arr2.size + + for i1 in range(n1): + st1 = arr1[i1] + for i2 in range(n2): + st2 = arr2[i2] + st2.row += st1.p * st2.p + st1.row - st1.col + + st1.p += st2.p + st1.col -= st2.col + + +def usecase2(x, N): + """ + Base on test1 of https://github.com/numba/numba/issues/381 + """ + for k in range(N): + y = x[k] + print(y.f1, y.s1, y.f2) + + +def usecase3(x, N): + """ + Base on test2 of https://github.com/numba/numba/issues/381 + """ + for k in range(N): + print(x.f1[k], x.s1[k], x.f2[k]) + + +def usecase4(x, N): + """ + Base on test3 of https://github.com/numba/numba/issues/381 + """ + for k in range(N): + y = x[k] + print(y.f1, x.s1[k], y.f2) + + +def usecase5(x, N): + """ + Base on test4 of https://github.com/numba/numba/issues/381 + """ + for k in range(N): + print(x[k].f1, x.s1[k], x[k].f2) + + +class TestRecordUsecase(TestCase): + + def setUp(self): + fields = [('f1', '0 (True). + + Note: The exact statistic varies across platform. + + NOTE: Tests using this `check` method need to run in subprocesses as + `njit` sets up the module pass manager etc once and the overrides have + no effect else. + """ + + with override_config('LLVM_REFPRUNE_PASS', '1'): + cres = njit((*argtys,))(func).overloads[(*argtys,)] + + pstats = cres.metadata.get('prune_stats', None) + self.assertIsNotNone(pstats) + + for k, v in prune_types.items(): + stat = getattr(pstats, k, None) + self.assertIsNotNone(stat) + msg = f'failed checking {k}' + if v: + self.assertGreater(stat, 0, msg=msg) + else: + self.assertEqual(stat, 0, msg=msg) + + @TestCase.run_test_in_subprocess + def test_basic_block_1(self): + # some nominally involved control flow and ops, there's only basic_block + # opportunities present here. + def func(n): + a = np.zeros(n) + acc = 0 + if n > 4: + b = a[1:] + acc += b[1] + else: + c = a[:-1] + acc += c[0] + return acc + + self.check(func, (types.intp), basicblock=True) + + @TestCase.run_test_in_subprocess + def test_diamond_1(self): + # most basic?! diamond + def func(n): + a = np.ones(n) + x = 0 + if n > 2: + x = a.sum() + return x + 1 + + # disable fanout pruning + with set_refprune_flags('per_bb,diamond'): + self.check(func, (types.intp), basicblock=True, diamond=True, + fanout=False, fanout_raise=False) + + @TestCase.run_test_in_subprocess + def test_diamond_2(self): + # more complex diamonds + def func(n): + con = [] + for i in range(n): + con.append(np.arange(i)) + c = 0.0 + for arr in con: + c += arr.sum() / (1 + arr.size) + return c + + # disable fanout pruning + with set_refprune_flags('per_bb,diamond'): + self.check(func, (types.intp), basicblock=True, diamond=True, + fanout=False, fanout_raise=False) + + @TestCase.run_test_in_subprocess + def test_fanout_1(self): + # most basic?! fan-out + def func(n): + a = np.zeros(n) + b = np.zeros(n) + x = (a, b) + acc = 0. + for i in x: + acc += i[0] + return acc + + self.check(func, (types.intp), basicblock=True, fanout=True) + + @TestCase.run_test_in_subprocess + def test_fanout_2(self): + # fanout with raise + def func(n): + a = np.zeros(n) + b = np.zeros(n) + x = (a, b) + for i in x: + if n: + raise ValueError + return x + + with set_refprune_flags('per_bb,fanout'): + self.check(func, (types.intp), basicblock=True, diamond=False, + fanout=True, fanout_raise=False) + + @TestCase.run_test_in_subprocess + def test_fanout_3(self): + # fanout with raise + def func(n): + ary = np.arange(n) + # basically an impl of array.sum + c = 0 + # The raise is from StopIteration of next(iterator) implicit in + # the for loop + for v in np.nditer(ary): + c += v.item() + return 1 + + with set_refprune_flags('per_bb,fanout_raise'): + self.check(func, (types.intp), basicblock=True, diamond=False, + fanout=False, fanout_raise=True) + + +class TestRefPruneFlags(TestCase): + def setUp(self): + warnings.simplefilter('error', NumbaInvalidConfigWarning) + + def tearDown(self): + warnings.resetwarnings() + + def test_warn_invalid_flags(self): + with set_refprune_flags('abc,per_bb,cde'): + with self.assertWarns(NumbaInvalidConfigWarning) as cm: + optval = _parse_refprune_flags() + self.assertEqual(len(cm.warnings), 2) + self.assertIn('abc', str(cm.warnings[0].message)) + self.assertIn('cde', str(cm.warnings[1].message)) + self.assertEqual(optval, llvm.RefPruneSubpasses.PER_BB) + + def test_valid_flag(self): + with set_refprune_flags('per_bb, diamond, fanout,fanout_raise'): + optval = _parse_refprune_flags() + self.assertEqual(optval, llvm.RefPruneSubpasses.ALL) + + def test_the_all_flag(self): + with set_refprune_flags('all'): + optval = _parse_refprune_flags() + self.assertEqual(optval, llvm.RefPruneSubpasses.ALL) + + def test_some_flags(self): + with set_refprune_flags('per_bb, fanout'): + optval = _parse_refprune_flags() + enumcls = llvm.RefPruneSubpasses + self.assertEqual(optval, enumcls.PER_BB | enumcls.FANOUT) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_remove_dead.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_remove_dead.py new file mode 100644 index 0000000000000000000000000000000000000000..b1ab55ce2d5e38d36bfffcf05fceb07be1567efc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_remove_dead.py @@ -0,0 +1,436 @@ +# +# Copyright (c) 2017 Intel Corporation +# SPDX-License-Identifier: BSD-2-Clause +# + +import numba +import numba.parfors.parfor +from numba import njit, jit +from numba.core import ir_utils +from numba.core import types, ir, compiler +from numba.core.registry import cpu_target +from numba.core.ir_utils import (copy_propagate, apply_copy_propagate, + get_name_var_table, remove_dels, remove_dead, + remove_call_handlers, alias_func_extensions) +from numba.core.typed_passes import type_inference_stage +from numba.core.compiler_machinery import FunctionPass, register_pass, PassManager +from numba.core.untyped_passes import (ExtractByteCode, TranslateByteCode, FixupArgs, + IRProcessing, DeadBranchPrune, + RewriteSemanticConstants, GenericRewrites, + WithLifting, PreserveIR, InlineClosureLikes) + +from numba.core.typed_passes import (NopythonTypeInference, AnnotateTypes, + NopythonRewrites, PreParforPass, ParforPass, + DumpParforDiagnostics, NativeLowering, + IRLegalization, NoPythonBackend, NativeLowering) +import numpy as np +from numba.tests.support import skip_parfors_unsupported, needs_blas, TestCase +import unittest + + +def test_will_propagate(b, z, w): + x1 = 3 + x = x1 + if b > 0: + y = z + w + else: + y = 0 + a = 2 * x + return a < b + +def null_func(a,b,c,d): + False + +@numba.njit +def dummy_aliased_func(A): + return A + +def alias_ext_dummy_func(lhs_name, args, alias_map, arg_aliases): + ir_utils._add_alias(lhs_name, args[0].name, alias_map, arg_aliases) + +def findLhsAssign(func_ir, var): + for label, block in func_ir.blocks.items(): + for i, inst in enumerate(block.body): + if isinstance(inst, ir.Assign) and inst.target.name==var: + return True + + return False + +class TestRemoveDead(TestCase): + + _numba_parallel_test_ = False + + def compile_parallel(self, func, arg_types): + return njit(arg_types, parallel=True, fastmath=True)(func) + + def test1(self): + typingctx = cpu_target.typing_context + targetctx = cpu_target.target_context + test_ir = compiler.run_frontend(test_will_propagate) + + typingctx.refresh() + targetctx.refresh() + args = (types.int64, types.int64, types.int64) + typemap, _, calltypes, _ = type_inference_stage(typingctx, targetctx, test_ir, args, None) + remove_dels(test_ir.blocks) + in_cps, out_cps = copy_propagate(test_ir.blocks, typemap) + apply_copy_propagate(test_ir.blocks, in_cps, get_name_var_table(test_ir.blocks), typemap, calltypes) + + remove_dead(test_ir.blocks, test_ir.arg_names, test_ir) + self.assertFalse(findLhsAssign(test_ir, "x")) + + def test2(self): + def call_np_random_seed(): + np.random.seed(2) + + def seed_call_exists(func_ir): + for inst in func_ir.blocks[0].body: + if (isinstance(inst, ir.Assign) and + isinstance(inst.value, ir.Expr) and + inst.value.op == 'call' and + func_ir.get_definition(inst.value.func).attr == 'seed'): + return True + return False + + test_ir = compiler.run_frontend(call_np_random_seed) + remove_dead(test_ir.blocks, test_ir.arg_names, test_ir) + self.assertTrue(seed_call_exists(test_ir)) + + def run_array_index_test(self, func): + A1 = np.arange(6).reshape(2,3) + A2 = A1.copy() + i = 0 + pfunc = self.compile_parallel(func, (numba.typeof(A1), numba.typeof(i))) + + func(A1, i) + pfunc(A2, i) + np.testing.assert_array_equal(A1, A2) + + def test_alias_ravel(self): + def func(A, i): + B = A.ravel() + B[i] = 3 + + self.run_array_index_test(func) + + def test_alias_flat(self): + def func(A, i): + B = A.flat + B[i] = 3 + + self.run_array_index_test(func) + + def test_alias_transpose1(self): + def func(A, i): + B = A.T + B[i,0] = 3 + + self.run_array_index_test(func) + + def test_alias_transpose2(self): + def func(A, i): + B = A.transpose() + B[i,0] = 3 + + self.run_array_index_test(func) + + def test_alias_transpose3(self): + def func(A, i): + B = np.transpose(A) + B[i,0] = 3 + + self.run_array_index_test(func) + + @skip_parfors_unsupported + @needs_blas + def test_alias_ctypes(self): + # use xxnrm2 to test call a C function with ctypes + from numba.np.linalg import _BLAS + xxnrm2 = _BLAS().numba_xxnrm2(types.float64) + + def remove_dead_xxnrm2(rhs, lives, call_list): + if call_list == [xxnrm2]: + return rhs.args[4].name not in lives + return False + + # adding this handler has no-op effect since this function won't match + # anything else but it's a bit cleaner to save the state and recover + old_remove_handlers = remove_call_handlers[:] + remove_call_handlers.append(remove_dead_xxnrm2) + + def func(ret): + a = np.ones(4) + xxnrm2(100, 4, a.ctypes, 1, ret.ctypes) + + A1 = np.zeros(1) + A2 = A1.copy() + + try: + pfunc = self.compile_parallel(func, (numba.typeof(A1),)) + numba.njit(func)(A1) + pfunc(A2) + finally: + # recover global state + remove_call_handlers[:] = old_remove_handlers + + self.assertEqual(A1[0], A2[0]) + + def test_alias_reshape1(self): + def func(A, i): + B = np.reshape(A, (3,2)) + B[i,0] = 3 + + self.run_array_index_test(func) + + def test_alias_reshape2(self): + def func(A, i): + B = A.reshape(3,2) + B[i,0] = 3 + + self.run_array_index_test(func) + + def test_alias_func_ext(self): + def func(A, i): + B = dummy_aliased_func(A) + B[i, 0] = 3 + + # save global state + old_ext_handlers = alias_func_extensions.copy() + try: + alias_func_extensions[('dummy_aliased_func', + 'numba.tests.test_remove_dead')] = alias_ext_dummy_func + self.run_array_index_test(func) + finally: + # recover global state + ir_utils.alias_func_extensions = old_ext_handlers + + def test_rm_dead_rhs_vars(self): + """make sure lhs variable of assignment is considered live if used in + rhs (test for #6715). + """ + def func(): + for i in range(3): + a = (lambda j: j)(i) + a = np.array(a) + return a + + self.assertEqual(func(), numba.njit(func)()) + + @skip_parfors_unsupported + def test_alias_parfor_extension(self): + """Make sure aliases are considered in remove dead extension for + parfors. + """ + def func(): + n = 11 + numba.parfors.parfor.init_prange() + A = np.empty(n) + B = A # create alias to A + for i in numba.prange(n): + A[i] = i + + return B + + @register_pass(analysis_only=False, mutates_CFG=True) + class LimitedParfor(FunctionPass): + _name = "limited_parfor" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + parfor_pass = numba.parfors.parfor.ParforPass( + state.func_ir, + state.typemap, + state.calltypes, + state.return_type, + state.typingctx, + state.flags.auto_parallel, + state.flags, + state.metadata, + state.parfor_diagnostics + ) + remove_dels(state.func_ir.blocks) + parfor_pass.array_analysis.run(state.func_ir.blocks) + parfor_pass._convert_loop(state.func_ir.blocks) + remove_dead(state.func_ir.blocks, + state.func_ir.arg_names, + state.func_ir, + state.typemap) + numba.parfors.parfor.get_parfor_params(state.func_ir.blocks, + parfor_pass.options.fusion, + parfor_pass.nested_fusion_info) + return True + + class TestPipeline(compiler.Compiler): + """Test pipeline that just converts prange() to parfor and calls + remove_dead(). Copy propagation can replace B in the example code + which this pipeline avoids. + """ + def define_pipelines(self): + name = 'test parfor aliasing' + pm = PassManager(name) + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(FixupArgs, "fix up args") + pm.add_pass(IRProcessing, "processing IR") + pm.add_pass(WithLifting, "Handle with contexts") + # pre typing + if not self.state.flags.no_rewrites: + pm.add_pass(GenericRewrites, "nopython rewrites") + pm.add_pass(RewriteSemanticConstants, "rewrite semantic constants") + pm.add_pass(DeadBranchPrune, "dead branch pruning") + pm.add_pass(InlineClosureLikes, + "inline calls to locally defined closures") + # typing + pm.add_pass(NopythonTypeInference, "nopython frontend") + + # lower + pm.add_pass(NativeLowering, "native lowering") + pm.add_pass(NoPythonBackend, "nopython mode backend") + pm.finalize() + return [pm] + + test_res = numba.jit(pipeline_class=TestPipeline)(func)() + py_res = func() + np.testing.assert_array_equal(test_res, py_res) + + +class TestSSADeadBranchPrune(TestCase): + """ + Test issues that required dead-branch-prune on SSA IR + """ + def test_issue_9706(self): + @njit + def foo(x, y=None): + if y is not None: + return x + y + else: + y = x + return x + y + + @njit + def foo_manual_ssa(x, y=None): + if y is not None: + return x + y + else: + # avoid changing type of `y` + y_ = x + return x + y_ + + self.assertEqual(foo(3, None), foo_manual_ssa(3, None)) + self.assertEqual(foo(3, 10), foo_manual_ssa(3, 10)) + + def test_issue_6541(self): + @njit + def f(xs, out=None): + N, = xs.shape + if out is None: + out = np.arange(N) + else: + assert np.all((0 <= out) & (out < N)) + out[:] = N + return out + + expected = f(np.array([3, 1, 2])) + out = np.arange(3, dtype='i8') + got = f(np.array([3, 1, 2]), out=out) + self.assertIs(got, out) + self.assertPreciseEqual(got, expected) + out = None + got = f(np.array([3, 1, 2]), out=out) + self.assertPreciseEqual(got, expected) + + def test_issue_7482(self): + @njit + def compute(smth, weights, default=0.0): + if weights is None: + return None + + if len(weights) == 0: + return default + + idx = smth > weights + weights = weights[idx] + + return default * weights + + self.assertIsNone(compute(smth=1, weights=None)) + kwargs = dict(smth=1, weights=np.arange(5), default=np.zeros(1)) + self.assertEqual(compute(**kwargs), + compute.py_func(**kwargs)) + + def test_issue_5661(self): + @njit + def foo(a, b=None): + if b is None: + b = 1 + elif b < a: + b += 1 + + return a + b + + args_list = [ + (1, 2), + (2, 1), + (1,), + ] + for args in args_list: + self.assertEqual(foo(*args), foo.py_func(*args)) + + # Variation + # https://github.com/numba/numba/issues/5661#issuecomment-697902475 + def make(decor=njit): + @decor + def inner(state): + if state is None: + state = 0 + else: + state += 1 + return state + + @decor + def fn(): + state = None + for i in range(10): + state = inner(state) + return state + + return fn() + + self.assertEqual(make(), make(lambda x: x)) + + def test_issue_9742(self): + CONST = 32 + + @jit + def foo(): + # This is a prune by value case, conditional is a compile time + # evaluatable constant. + conditional = CONST // 2 + collect = [] + while conditional: + collect.append(conditional) + conditional //= 2 + + return collect + + self.assertEqual(foo(), foo.py_func()) + + def test_issue_9742_variant(self): + CONST = 32 + + @jit + def foo(): + collect = [] + # This is a prune by value case, conditional is a compile time + # evaluatable constant. + x = CONST + 1 + if x: + collect.append(x) + return collect + + self.assertEqual(foo(), foo.py_func()) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_repr.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_repr.py new file mode 100644 index 0000000000000000000000000000000000000000..29e4b9104dc07582c4579c95ef125861e99e05b8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_repr.py @@ -0,0 +1,63 @@ +import unittest +import numpy as np + +from numba.tests.support import TestCase +from numba import typeof +from numba.core import types +from numba.typed import List, Dict + +NB_TYPES = [ + types.Array, + types.NestedArray, + types.bool_, + types.unicode_type, + types.Record, + types.UnicodeCharSeq, + types.UniTuple, + types.List, + types.Tuple, + types.DictType, + types.ListType, + types.Set, +] + list(types.number_domain) + + +class TestRepr(TestCase): + def setUp(self) -> None: + tys_ns = {ty.__name__: ty for ty in NB_TYPES if hasattr(ty, "__name__")} + tys_ns.update({ty.name: ty for ty in NB_TYPES if hasattr(ty, "name")}) + self.tys_ns = tys_ns + + def check_repr(self, val): + ty = typeof(val) + ty2 = eval(repr(ty), self.tys_ns) + self.assertEqual(ty, ty2) + + def test_types(self): + # define some values for the test cases + rec_dtype = [("a", "f8"), ("b", "U8"), ("c", "i8", (2, 3))] + nb_dict = Dict() + nb_dict['a'] = 1 + # tests cases: list of different types + list comp of number types + val_types_cases = [ + True, + "a", + (1, 2), + (1, "a"), + [1, "a"], + ([1, "a"], [2, "b"]), + ((1, 2), (3, "b")), + ((1, 2), (3, [1, 2])), + np.ones(3), + np.array([(1, "a", np.ones((2, 3)))], dtype=rec_dtype), + nb_dict, + List([1, 2]), + {1, 2}, + ] + [number(1.1) for number in types.number_domain] + + for val in val_types_cases: + self.check_repr(val) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_return_values.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_return_values.py new file mode 100644 index 0000000000000000000000000000000000000000..b3496d28311319bd5327c65d5dc4067392830e6a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_return_values.py @@ -0,0 +1,74 @@ +""" +Test return values +""" + + +import math + +import unittest +from numba import jit +from numba.core import types +from numba.core.errors import TypingError, NumbaTypeError + + +enable_pyobj_flags = {'forceobj': True} +no_pyobj_flags = {'nopython': True} + + +def get_nopython_func(): + return abs + +def get_pyobj_func(): + return open + +def get_module_func(): + return math.floor + + +class TestReturnValues(unittest.TestCase): + + def test_nopython_func(self, flags=enable_pyobj_flags): + # Test returning func that is supported in nopython mode + pyfunc = get_nopython_func + cfunc = jit((), **flags)(pyfunc) + if flags == enable_pyobj_flags: + result = cfunc() + self.assertEqual(result, abs) + else: + self.fail("Unexpected successful compilation.") + + def test_nopython_func_npm(self): + with self.assertRaises(NumbaTypeError): + self.test_nopython_func(flags=no_pyobj_flags) + + def test_pyobj_func(self, flags=enable_pyobj_flags): + # Test returning func that is only supported in object mode + pyfunc = get_pyobj_func + cfunc = jit((), **flags)(pyfunc) + if flags == enable_pyobj_flags: + result = cfunc() + self.assertEqual(result, open) + else: + self.fail("Unexpected successful compilation.") + + def test_pyobj_func_npm(self): + with self.assertRaises(TypingError): + self.test_pyobj_func(flags=no_pyobj_flags) + + def test_module_func(self, flags=enable_pyobj_flags): + # Test returning imported func that is only supported in object mode + pyfunc = get_module_func + cfunc = jit((), **flags)(pyfunc) + if flags == enable_pyobj_flags: + result = cfunc() + self.assertEqual(result, math.floor) + else: + self.fail("Unexpected successful compilation.") + + def test_module_func_npm(self): + with self.assertRaises(NumbaTypeError): + self.test_module_func(flags=no_pyobj_flags) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_runtests.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_runtests.py new file mode 100644 index 0000000000000000000000000000000000000000..9695cc51ca47687e502419d974a21e05d82116e0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_runtests.py @@ -0,0 +1,284 @@ +import os +import sys +import subprocess + +from numba import cuda +import unittest +import itertools + +try: + import git # noqa: F401 from gitpython package +except ImportError: + has_gitpython = False +else: + has_gitpython = True + +try: + import yaml # from pyyaml package +except ImportError: + has_pyyaml = False +else: + has_pyyaml = True + + +class TestCase(unittest.TestCase): + """These test cases are meant to test the Numba test infrastructure itself. + Therefore, the logic used here shouldn't use numba.testing, but only the + upstream unittest, and run the numba test suite only in a subprocess.""" + + def get_testsuite_listing(self, args, *, subp_kwargs=None): + """ + Use `subp_kwargs` to pass extra argument to `subprocess.check_output`. + """ + subp_kwargs = subp_kwargs or {} + cmd = [sys.executable, '-m', 'numba.runtests', '-l'] + list(args) + out_bytes = subprocess.check_output(cmd, **subp_kwargs) + lines = out_bytes.decode('UTF-8').splitlines() + lines = [line for line in lines if line.strip()] + return lines + + def check_listing_prefix(self, prefix): + listing = self.get_testsuite_listing([prefix]) + for ln in listing[:-1]: + errmsg = '{!r} not startswith {!r}'.format(ln, prefix) + self.assertTrue(ln.startswith(prefix), msg=errmsg) + + def check_testsuite_size(self, args, minsize): + """ + Check that the reported numbers of tests are at least *minsize*. + """ + lines = self.get_testsuite_listing(args) + last_line = lines[-1] + self.assertTrue('tests found' in last_line) + number = int(last_line.split(' ')[0]) + # There may be some "skipped" messages at the beginning, + # so do an approximate check. + self.assertIn(len(lines), range(number + 1, number + 20)) + self.assertGreaterEqual(number, minsize) + return lines + + def check_all(self, ids): + lines = self.check_testsuite_size(ids, 5000) + # CUDA should be included by default + self.assertTrue(any('numba.cuda.tests.' in line for line in lines)) + # As well as subpackage + self.assertTrue(any('numba.tests.npyufunc.test_' in line + for line in lines),) + + def _get_numba_tests_from_listing(self, listing): + """returns a filter on strings starting with 'numba.', useful for + selecting the 'numba' test names from a test listing.""" + return filter(lambda x: x.startswith('numba.'), listing) + + def test_default(self): + self.check_all([]) + + def test_all(self): + self.check_all(['numba.tests']) + + def test_cuda(self): + # Even without CUDA enabled, there is at least one test + # (in numba.cuda.tests.nocuda) + minsize = 100 if cuda.is_available() else 1 + self.check_testsuite_size(['numba.cuda.tests'], minsize) + + @unittest.skipIf(not cuda.is_available(), "NO CUDA") + def test_cuda_submodules(self): + self.check_listing_prefix('numba.cuda.tests.cudadrv') + self.check_listing_prefix('numba.cuda.tests.cudapy') + self.check_listing_prefix('numba.cuda.tests.nocuda') + self.check_listing_prefix('numba.cuda.tests.cudasim') + + def test_module(self): + self.check_testsuite_size(['numba.tests.test_storeslice'], 2) + self.check_testsuite_size(['numba.tests.test_nested_calls'], 10) + # Several modules + self.check_testsuite_size(['numba.tests.test_nested_calls', + 'numba.tests.test_storeslice'], 12) + + def test_subpackage(self): + self.check_testsuite_size(['numba.tests.npyufunc'], 50) + + def test_random(self): + self.check_testsuite_size( + ['--random', '0.1', 'numba.tests.npyufunc'], 5) + + def test_include_exclude_tags(self): + def get_count(arg_list): + lines = self.get_testsuite_listing(arg_list) + self.assertIn('tests found', lines[-1]) + count = int(lines[-1].split()[0]) + self.assertTrue(count > 0) + return count + + tags = ['long_running', 'long_running, important'] + + total = get_count(['numba.tests']) + + for tag in tags: + included = get_count(['--tags', tag, 'numba.tests']) + excluded = get_count(['--exclude-tags', tag, 'numba.tests']) + self.assertEqual(total, included + excluded) + + # check syntax with `=` sign in + included = get_count(['--tags=%s' % tag, 'numba.tests']) + excluded = get_count(['--exclude-tags=%s' % tag, 'numba.tests']) + self.assertEqual(total, included + excluded) + + def test_check_shard(self): + tmpAll = self.get_testsuite_listing([]) + tmp1 = self.get_testsuite_listing(['-j', '0:2']) + tmp2 = self.get_testsuite_listing(['-j', '1:2']) + + lAll = set(self._get_numba_tests_from_listing(tmpAll)) + l1 = set(self._get_numba_tests_from_listing(tmp1)) + l2 = set(self._get_numba_tests_from_listing(tmp2)) + + # The difference between two adjacent shards should be less than 5% of + # the total + self.assertLess(abs(len(l2) - len(l1)), len(lAll) / 20) + self.assertLess(len(l1), len(lAll)) + self.assertLess(len(l2), len(lAll)) + + def test_check_sharding_equivalent(self): + # get some shards + sharded = list() + for i in range(3): + subset = self.get_testsuite_listing(['-j', '{}:3'.format(i)]) + slist = [*self._get_numba_tests_from_listing(subset)] + sharded.append(slist) + + # get the always running tests + tmp = self.get_testsuite_listing(['--tag', 'always_test']) + always_running = set(self._get_numba_tests_from_listing(tmp)) + + # make sure there is at least one test that always runs + self.assertGreaterEqual(len(always_running), 1) + + # check that each shard contains no repeats + sharded_sets = [set(x) for x in sharded] + for i in range(len(sharded)): + self.assertEqual(len(sharded_sets[i]), len(sharded[i])) + + # check that the always running tests are in every shard, and then + # remove them from the shards + for shard in sharded_sets: + for test in always_running: + self.assertIn(test, shard) + shard.remove(test) + self.assertNotIn(test, shard) + + # check that there is no overlap between the shards + for a, b in itertools.combinations(sharded_sets, 2): + self.assertFalse(a & b) + + # check that the sum of the shards and the always running tests is the + # same as the full listing + + sum_of_parts = set() + for x in sharded_sets: + sum_of_parts.update(x) + sum_of_parts.update(always_running) + + full_listing = set(self._get_numba_tests_from_listing( + self.get_testsuite_listing([]))) + + self.assertEqual(sum_of_parts, full_listing) + + @unittest.skipUnless(has_gitpython, "Requires gitpython") + def test_gitdiff(self): + # Check for git + try: + subprocess.call("git", + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + except FileNotFoundError: + self.skipTest("no git available") + + # default + outs = self.get_testsuite_listing(['-g']) + self.assertNotIn("Git diff by common ancestor", outs) + # using ancestor + outs = self.get_testsuite_listing(['-g=ancestor']) + self.assertIn("Git diff by common ancestor", outs) + # misspelled ancestor + subp_kwargs = dict(stderr=subprocess.DEVNULL) + with self.assertRaises(subprocess.CalledProcessError): + self.get_testsuite_listing(['-g=ancest'], subp_kwargs=subp_kwargs) + + @unittest.skipUnless(has_pyyaml, "Requires pyyaml") + def test_azure_config(self): + from yaml import Loader + base_path = os.path.dirname(os.path.abspath(__file__)) + azure_pipe = os.path.join(base_path, '..', '..', 'azure-pipelines.yml') + if not os.path.isfile(azure_pipe): + self.skipTest("'azure-pipelines.yml' is not available") + with open(os.path.abspath(azure_pipe), 'rt') as f: + data = f.read() + pipe_yml = yaml.load(data, Loader=Loader) + + templates = pipe_yml['jobs'] + # first look at the items in the first two templates, this is osx/linux + start_indexes = [] + for tmplt in templates[:2]: + matrix = tmplt['parameters']['matrix'] + for setup in matrix.values(): + start_indexes.append(setup['TEST_START_INDEX']) + + # next look at the items in the windows only template + winpath = ['..', '..', 'buildscripts', 'azure', 'azure-windows.yml'] + azure_windows = os.path.join(base_path, *winpath) + if not os.path.isfile(azure_windows): + self.skipTest("'azure-windows.yml' is not available") + with open(os.path.abspath(azure_windows), 'rt') as f: + data = f.read() + windows_yml = yaml.load(data, Loader=Loader) + + # There's only one template in windows and its keyed differently to the + # above, get its matrix. + matrix = windows_yml['jobs'][0]['strategy']['matrix'] + for setup in matrix.values(): + start_indexes.append(setup['TEST_START_INDEX']) + + # sanity checks + # 1. That the TEST_START_INDEX is unique + self.assertEqual(len(start_indexes), len(set(start_indexes))) + # 2. That the TEST_START_INDEX is a complete range + lim_start_index = max(start_indexes) + 1 + expected = [*range(lim_start_index)] + self.assertEqual(sorted(start_indexes), expected) + # 3. That the number of indexes matches the declared test count + self.assertEqual(lim_start_index, pipe_yml['variables']['TEST_COUNT']) + + def test_no_compilation_on_list(self): + # Checks that the test suite doesn't do any CPU-side compilation on + # listing of tests. + code = """if 1: + from unittest import mock + from llvmlite import binding as llvm + error = RuntimeError("Detected compilation during test listing") + with mock.patch.object(llvm.ExecutionEngine, 'finalize_object', + side_effect=error): + import numba + {0} + """ + + # Run with a jit function in the test to demonstrate failure + with self.assertRaises(subprocess.CalledProcessError) as raises: + cmd = [sys.executable, "-c", code.format("numba.njit(lambda:0)()")] + subprocess.check_output(cmd, + stderr=subprocess.STDOUT, + timeout=60) + self.assertIn("Detected compilation during test listing", + raises.exception.stdout.decode('UTF-8')) + + # Run to validate the test suite does not trigger compilation during + # listing. + cmd = [sys.executable, "-c", code.format("numba.test('-l')")] + subprocess.check_call(cmd, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL,) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_serialize.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_serialize.py new file mode 100644 index 0000000000000000000000000000000000000000..5aa99e439fcc84d31dd62ca719a0a669d4ef6225 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_serialize.py @@ -0,0 +1,331 @@ +import contextlib +import gc +import pickle +import runpy +import subprocess +import sys +import unittest +from multiprocessing import get_context + +import numba +from numba.core.errors import TypingError +from numba.tests.support import TestCase +from numba.core.target_extension import resolve_dispatcher_from_str +from numba.cloudpickle import dumps, loads + + +class TestDispatcherPickling(TestCase): + + def run_with_protocols(self, meth, *args, **kwargs): + for proto in range(pickle.HIGHEST_PROTOCOL + 1): + meth(proto, *args, **kwargs) + + @contextlib.contextmanager + def simulate_fresh_target(self): + hwstr = 'cpu' + dispatcher_cls = resolve_dispatcher_from_str(hwstr) + old_descr = dispatcher_cls.targetdescr + # Simulate fresh targetdescr + dispatcher_cls.targetdescr = type(dispatcher_cls.targetdescr)(hwstr) + try: + yield + finally: + # Be sure to reinstantiate old descriptor, otherwise other + # objects may be out of sync. + dispatcher_cls.targetdescr = old_descr + + def check_call(self, proto, func, expected_result, args): + def check_result(func): + if (isinstance(expected_result, type) + and issubclass(expected_result, Exception)): + self.assertRaises(expected_result, func, *args) + else: + self.assertPreciseEqual(func(*args), expected_result) + + # Control + check_result(func) + pickled = pickle.dumps(func, proto) + with self.simulate_fresh_target(): + new_func = pickle.loads(pickled) + check_result(new_func) + + def test_call_with_sig(self): + from .serialize_usecases import add_with_sig + self.run_with_protocols(self.check_call, add_with_sig, 5, (1, 4)) + # Compilation has been disabled => float inputs will be coerced to int + self.run_with_protocols(self.check_call, add_with_sig, 5, (1.2, 4.2)) + + def test_call_without_sig(self): + from .serialize_usecases import add_without_sig + self.run_with_protocols(self.check_call, add_without_sig, 5, (1, 4)) + self.run_with_protocols(self.check_call, add_without_sig, 5.5, (1.2, 4.3)) + # Object mode is enabled + self.run_with_protocols(self.check_call, add_without_sig, "abc", ("a", "bc")) + + def test_call_nopython(self): + from .serialize_usecases import add_nopython + self.run_with_protocols(self.check_call, add_nopython, 5.5, (1.2, 4.3)) + # Object mode is disabled + self.run_with_protocols(self.check_call, add_nopython, TypingError, (object(), object())) + + def test_call_nopython_fail(self): + from .serialize_usecases import add_nopython_fail + # Compilation fails + self.run_with_protocols(self.check_call, add_nopython_fail, TypingError, (1, 2)) + + def test_call_objmode_with_global(self): + from .serialize_usecases import get_global_objmode + self.run_with_protocols(self.check_call, get_global_objmode, 7.5, (2.5,)) + + def test_call_closure(self): + from .serialize_usecases import closure + inner = closure(1) + self.run_with_protocols(self.check_call, inner, 6, (2, 3)) + + def check_call_closure_with_globals(self, **jit_args): + from .serialize_usecases import closure_with_globals + inner = closure_with_globals(3.0, **jit_args) + self.run_with_protocols(self.check_call, inner, 7.0, (4.0,)) + + def test_call_closure_with_globals_nopython(self): + self.check_call_closure_with_globals(nopython=True) + + def test_call_closure_with_globals_objmode(self): + self.check_call_closure_with_globals(forceobj=True) + + def test_call_closure_calling_other_function(self): + from .serialize_usecases import closure_calling_other_function + inner = closure_calling_other_function(3.0) + self.run_with_protocols(self.check_call, inner, 11.0, (4.0, 6.0)) + + def test_call_closure_calling_other_closure(self): + from .serialize_usecases import closure_calling_other_closure + inner = closure_calling_other_closure(3.0) + self.run_with_protocols(self.check_call, inner, 8.0, (4.0,)) + + def test_call_dyn_func(self): + from .serialize_usecases import dyn_func + # Check serializing a dynamically-created function + self.run_with_protocols(self.check_call, dyn_func, 36, (6,)) + + def test_call_dyn_func_objmode(self): + from .serialize_usecases import dyn_func_objmode + # Same with an object mode function + self.run_with_protocols(self.check_call, dyn_func_objmode, 36, (6,)) + + def test_renamed_module(self): + from .serialize_usecases import get_renamed_module + # Issue #1559: using a renamed module (e.g. `import numpy as np`) + # should not fail serializing + expected = get_renamed_module(0.0) + self.run_with_protocols(self.check_call, get_renamed_module, + expected, (0.0,)) + + def test_other_process(self): + """ + Check that reconstructing doesn't depend on resources already + instantiated in the original process. + """ + from .serialize_usecases import closure_calling_other_closure + func = closure_calling_other_closure(3.0) + pickled = pickle.dumps(func) + code = """if 1: + import pickle + + data = {pickled!r} + func = pickle.loads(data) + res = func(4.0) + assert res == 8.0, res + """.format(**locals()) + subprocess.check_call([sys.executable, "-c", code]) + + def test_reuse(self): + """ + Check that deserializing the same function multiple times re-uses + the same dispatcher object. + + Note that "same function" is intentionally under-specified. + """ + from .serialize_usecases import closure + func = closure(5) + pickled = pickle.dumps(func) + func2 = closure(6) + pickled2 = pickle.dumps(func2) + + f = pickle.loads(pickled) + g = pickle.loads(pickled) + h = pickle.loads(pickled2) + self.assertIs(f, g) + self.assertEqual(f(2, 3), 10) + g.disable_compile() + self.assertEqual(g(2, 4), 11) + + self.assertIsNot(f, h) + self.assertEqual(h(2, 3), 11) + + # Now make sure the original object doesn't exist when deserializing + func = closure(7) + func(42, 43) + pickled = pickle.dumps(func) + del func + gc.collect() + + f = pickle.loads(pickled) + g = pickle.loads(pickled) + self.assertIs(f, g) + self.assertEqual(f(2, 3), 12) + g.disable_compile() + self.assertEqual(g(2, 4), 13) + + def test_imp_deprecation(self): + """ + The imp module was deprecated in v3.4 in favour of importlib + """ + code = """if 1: + import pickle + import warnings + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', DeprecationWarning) + from numba import njit + @njit + def foo(x): + return x + 1 + foo(1) + serialized_foo = pickle.dumps(foo) + for x in w: + if 'serialize.py' in x.filename: + assert "the imp module is deprecated" not in x.msg + """ + subprocess.check_call([sys.executable, "-c", code]) + + +class TestSerializationMisc(TestCase): + def test_numba_unpickle(self): + # Test that _numba_unpickle is memorizing its output + from numba.core.serialize import _numba_unpickle + + random_obj = object() + bytebuf = pickle.dumps(random_obj) + hashed = hash(random_obj) + + got1 = _numba_unpickle(id(random_obj), bytebuf, hashed) + # not the original object + self.assertIsNot(got1, random_obj) + got2 = _numba_unpickle(id(random_obj), bytebuf, hashed) + # unpickled results are the same objects + self.assertIs(got1, got2) + + +class TestCloudPickleIssues(TestCase): + """This test case includes issues specific to the cloudpickle implementation. + """ + _numba_parallel_test_ = False + + def test_dynamic_class_reset_on_unpickle(self): + # a dynamic class + class Klass: + classvar = None + + def mutator(): + Klass.classvar = 100 + + def check(): + self.assertEqual(Klass.classvar, 100) + + saved = dumps(Klass) + mutator() + check() + loads(saved) + # Without the patch, each `loads(saved)` will reset `Klass.classvar` + check() + loads(saved) + check() + + @unittest.skipIf(__name__ == "__main__", + "Test cannot run as when module is __main__") + def test_main_class_reset_on_unpickle(self): + mp = get_context('spawn') + proc = mp.Process(target=check_main_class_reset_on_unpickle) + proc.start() + proc.join(timeout=60) + self.assertEqual(proc.exitcode, 0) + + def test_dynamic_class_reset_on_unpickle_new_proc(self): + # a dynamic class + class Klass: + classvar = None + + # serialize Klass in this process + saved = dumps(Klass) + + # Check the reset problem in a new process + mp = get_context('spawn') + proc = mp.Process(target=check_unpickle_dyn_class_new_proc, args=(saved,)) + proc.start() + proc.join(timeout=60) + self.assertEqual(proc.exitcode, 0) + + def test_dynamic_class_issue_7356(self): + cfunc = numba.njit(issue_7356) + self.assertEqual(cfunc(), (100, 100)) + + +class DynClass(object): + # For testing issue #7356 + a = None + + +def issue_7356(): + with numba.objmode(before="intp"): + DynClass.a = 100 + before = DynClass.a + with numba.objmode(after="intp"): + after = DynClass.a + return before, after + + +def check_main_class_reset_on_unpickle(): + # Load module and get its global dictionary + glbs = runpy.run_module( + "numba.tests.cloudpickle_main_class", + run_name="__main__", + ) + # Get the Klass and check it is from __main__ + Klass = glbs['Klass'] + assert Klass.__module__ == "__main__" + assert Klass.classvar != 100 + saved = dumps(Klass) + # mutate + Klass.classvar = 100 + # check + _check_dyn_class(Klass, saved) + + +def check_unpickle_dyn_class_new_proc(saved): + Klass = loads(saved) + assert Klass.classvar != 100 + # mutate + Klass.classvar = 100 + # check + _check_dyn_class(Klass, saved) + + +def _check_dyn_class(Klass, saved): + def check(): + if Klass.classvar != 100: + raise AssertionError("Check failed. Klass reset.") + + check() + loaded = loads(saved) + if loaded is not Klass: + raise AssertionError("Expected reuse") + # Without the patch, each `loads(saved)` will reset `Klass.classvar` + check() + loaded = loads(saved) + if loaded is not Klass: + raise AssertionError("Expected reuse") + check() + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sets.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sets.py new file mode 100644 index 0000000000000000000000000000000000000000..2d5af8204c4f02254c2fd7dcd1d4e4c5aac9a413 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sets.py @@ -0,0 +1,868 @@ +import unittest + +from collections import namedtuple +import contextlib +import itertools +import random +from numba.core.errors import TypingError + +import numpy as np + +from numba import jit, njit +from numba.tests.support import (TestCase, enable_pyobj_flags, MemoryLeakMixin, + compile_function) + + +Point = namedtuple('Point', ('a', 'b')) + + +def _build_set_literal_usecase(code, args): + code = code % {'initializer': ', '.join(repr(arg) for arg in args)} + return compile_function('build_set', code, globals()) + +def set_literal_return_usecase(args): + code = """if 1: + def build_set(): + return {%(initializer)s} + """ + return _build_set_literal_usecase(code, args) + +def set_literal_convert_usecase(args): + code = """if 1: + def build_set(): + my_set = {%(initializer)s} + return list(my_set) + """ + return _build_set_literal_usecase(code, args) + + +def empty_constructor_usecase(): + s = set() + s.add(1) + return len(s) + +def constructor_usecase(arg): + s = set(arg) + return len(s) + +def iterator_usecase(arg): + s = set(arg) + l = [] + for v in s: + l.append(v) + return l + +def update_usecase(a, b, c): + s = set() + s.update(a) + s.update(b) + s.update(c) + return list(s) + +def bool_usecase(arg): + # Remove one element to allow for empty sets. + s = set(arg[1:]) + return bool(s) + +def remove_usecase(a, b): + s = set(a) + for v in b: + s.remove(v) + return list(s) + +def discard_usecase(a, b): + s = set(a) + for v in b: + s.discard(v) + return list(s) + +def add_discard_usecase(a, u, v): + s = set(a) + for i in range(1000): + s.add(u) + s.discard(v) + return list(s) + +def pop_usecase(a): + s = set(a) + l = [] + while len(s) > 0: + l.append(s.pop()) + return l + +def contains_usecase(a, b): + s = set(a) + l = [] + for v in b: + l.append(v in s) + return l + +def difference_update_usecase(a, b): + s = set(a) + s.difference_update(set(b)) + return list(s) + +def intersection_update_usecase(a, b): + s = set(a) + s.intersection_update(set(b)) + return list(s) + +def symmetric_difference_update_usecase(a, b): + s = set(a) + s.symmetric_difference_update(set(b)) + return list(s) + +def isdisjoint_usecase(a, b): + return set(a).isdisjoint(set(b)) + +def issubset_usecase(a, b): + return set(a).issubset(set(b)) + +def issuperset_usecase(a, b): + return set(a).issuperset(set(b)) + +def clear_usecase(a): + s = set(a) + s.clear() + return len(s), list(s) + +def copy_usecase(a): + s = set(a) + ss = s.copy() + s.pop() + return len(ss), list(ss) + +def copy_usecase_empty(a): + s = set(a) + s.clear() + ss = s.copy() + s.add(a[0]) + return len(ss), list(ss) + +def copy_usecase_deleted(a, b): + s = set(a) + s.remove(b) + ss = s.copy() + s.pop() + return len(ss), list(ss) + +def difference_usecase(a, b): + sa = set(a) + s = sa.difference(set(b)) + return list(s) + +def intersection_usecase(a, b): + sa = set(a) + s = sa.intersection(set(b)) + return list(s) + +def symmetric_difference_usecase(a, b): + sa = set(a) + s = sa.symmetric_difference(set(b)) + return list(s) + +def union_usecase(a, b): + sa = set(a) + s = sa.union(set(b)) + return list(s) + +def set_return_usecase(a): + s = set(a) + return s + + +def noop(x): + pass + +def unbox_usecase(x): + """ + Expect a set of numbers + """ + res = 0 + for v in x: + res += v + return res + +def unbox_usecase2(x): + """ + Expect a set of tuples + """ + res = 0 + for v in x: + res += len(v) + return res + +def unbox_usecase3(x): + """ + Expect a (number, set of numbers) tuple. + """ + a, b = x + res = a + for v in b: + res += v + return res + +def unbox_usecase4(x): + """ + Expect a (number, set of tuples) tuple. + """ + a, b = x + res = a + for v in b: + res += len(v) + return res + + +def reflect_simple(sa, sb): + sa.add(42) + sa.update(sb) + return sa, len(sa), len(sb) + +def reflect_conditional(sa, sb): + # `sa` may or may not actually reflect a Python set + if len(sb) > 1: + sa = set((11., 22., 33., 44.)) + sa.add(42.) + sa.update(sb) + # Combine with a non-reflected set (to check method typing) + sc = set((55., 66.)) + sa.symmetric_difference_update(sc) + return sa, len(sa), len(sb) + +def reflect_exception(s): + s.add(42) + raise ZeroDivisionError + +def reflect_dual(sa, sb): + sa.add(sb.pop()) + return sa is sb + + +def unique_usecase(src): + seen = set() + res = [] + for v in src: + if v not in seen: + seen.add(v) + res.append(v) + return res + + +class BaseTest(MemoryLeakMixin, TestCase): + + def setUp(self): + super(BaseTest, self).setUp() + self.rnd = random.Random(42) + + def _range(self, stop): + return np.arange(int(stop)).tolist() + + def _random_choice(self, seq, n): + """ + Choose *n* possibly duplicate items from sequence. + """ + l = [self.rnd.choice(list(seq)) for i in range(n)] + if isinstance(seq, np.ndarray): + return np.array(l, dtype=seq.dtype) + else: + return l + + def duplicates_array(self, n): + """ + Get a 1d array with many duplicate values. + """ + a = self._range(np.sqrt(n)) + return self._random_choice(a, n) + + def sparse_array(self, n): + """ + Get a 1d array with values spread around. + """ + # Note two calls to sparse_array() should generate reasonable overlap + a = self._range(n ** 1.3) + return self._random_choice(a, n) + + def _assert_equal_unordered(self, a, b): + if isinstance(a, tuple): + self.assertIsInstance(b, tuple) + for u, v in zip(a, b): + self._assert_equal_unordered(u, v) + elif isinstance(a, list): + self.assertIsInstance(b, list) + self.assertPreciseEqual(sorted(a), sorted(b)) + else: + self.assertPreciseEqual(a, b) + + def unordered_checker(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + def check(*args): + expected = pyfunc(*args) + got = cfunc(*args) + self._assert_equal_unordered(expected, got) + return check + + +class TestSetLiterals(BaseTest): + + def check(self, pyfunc): + cfunc = njit(pyfunc) + expected = pyfunc() + got = cfunc() + self.assertPreciseEqual(expected, got) + return got, expected + + def test_build_set(self): + pyfunc = set_literal_return_usecase((1, 2, 3, 2)) + self.check(pyfunc) + + def test_build_heterogeneous_set(self, flags=enable_pyobj_flags): + pyfunc = set_literal_return_usecase((1, 2.0, 3j, 2)) + self.check(pyfunc) + pyfunc = set_literal_return_usecase((2.0, 2)) + got, expected = self.check(pyfunc) + self.assertIs(type(got.pop()), type(expected.pop())) + + def test_build_set_nopython(self): + arg = list(self.sparse_array(50)) + pyfunc = set_literal_convert_usecase(arg) + cfunc = jit(nopython=True)(pyfunc) + + expected = pyfunc() + got = cfunc() + self.assertPreciseEqual(sorted(expected), sorted(got)) + + +class TestSets(BaseTest): + + def test_constructor(self): + pyfunc = empty_constructor_usecase + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(), pyfunc()) + + pyfunc = constructor_usecase + cfunc = jit(nopython=True)(pyfunc) + def check(arg): + self.assertPreciseEqual(pyfunc(arg), cfunc(arg)) + + check(self.duplicates_array(200)) + check(self.sparse_array(200)) + + def test_set_return(self): + pyfunc = set_return_usecase + cfunc = jit(nopython=True)(pyfunc) + + arg = self.duplicates_array(200) + self.assertEqual(cfunc(arg), set(arg)) + + def test_iterator(self): + pyfunc = iterator_usecase + check = self.unordered_checker(pyfunc) + + check(self.duplicates_array(200)) + check(self.sparse_array(200)) + + def test_update(self): + pyfunc = update_usecase + check = self.unordered_checker(pyfunc) + + a = self.sparse_array(50) + b = self.duplicates_array(50) + c = self.sparse_array(50) + check(a, b, c) + + def test_remove(self): + pyfunc = remove_usecase + check = self.unordered_checker(pyfunc) + + a = self.sparse_array(50) + b = a[::10] + check(a, b) + + def test_remove_error(self): + # References are leaked on exception + self.disable_leak_check() + + pyfunc = remove_usecase + cfunc = jit(nopython=True)(pyfunc) + + # ensure that there will be a key error + items = tuple(set(self.sparse_array(3))) + a = items[1:] + b = (items[0],) + with self.assertRaises(KeyError): + cfunc(a, b) + + def test_discard(self): + pyfunc = discard_usecase + check = self.unordered_checker(pyfunc) + + a = self.sparse_array(50) + b = self.sparse_array(50) + check(a, b) + + def test_add_discard(self): + """ + Check that the insertion logic does not create an infinite lookup + chain with deleted entries (insertion should happen at the first + deleted entry, not at the free entry at the end of the chain). + See issue #1913. + """ + pyfunc = add_discard_usecase + check = self.unordered_checker(pyfunc) + + # ensure a and b are different + a = b = None + while a == b: + a, b = self.sparse_array(2) + check((a,), b, b) + + def test_pop(self): + pyfunc = pop_usecase + check = self.unordered_checker(pyfunc) + + check(self.sparse_array(50)) + + def test_contains(self): + pyfunc = contains_usecase + cfunc = jit(nopython=True)(pyfunc) + def check(a, b): + self.assertPreciseEqual(pyfunc(a, b), cfunc(a, b)) + + a = self.sparse_array(50) + b = self.sparse_array(50) + check(a, b) + + def _test_xxx_update(self, pyfunc): + check = self.unordered_checker(pyfunc) + + sizes = (1, 50, 500) + for na, nb in itertools.product(sizes, sizes): + a = self.sparse_array(na) + b = self.sparse_array(nb) + check(a, b) + + def test_difference_update(self): + self._test_xxx_update(difference_update_usecase) + + def test_intersection_update(self): + self._test_xxx_update(intersection_update_usecase) + + def test_symmetric_difference_update(self): + self._test_xxx_update(symmetric_difference_update_usecase) + + def _test_comparator(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + def check(a, b): + self.assertPreciseEqual(pyfunc(a, b), cfunc(a, b)) + + a, b = map(set, [self.sparse_array(10), self.sparse_array(15)]) + args = [a & b, a - b, a | b, a ^ b] + args = [tuple(x) for x in args] + for a, b in itertools.product(args, args): + check(a, b) + + def test_isdisjoint(self): + self._test_comparator(isdisjoint_usecase) + + def test_issubset(self): + self._test_comparator(issubset_usecase) + + def test_issuperset(self): + self._test_comparator(issuperset_usecase) + + def test_clear(self): + pyfunc = clear_usecase + check = self.unordered_checker(pyfunc) + + check(self.sparse_array(50)) + + def test_copy(self): + # Source set doesn't have any deleted entries + pyfunc = copy_usecase + check = self.unordered_checker(pyfunc) + check(self.sparse_array(50)) + + pyfunc = copy_usecase_empty + check = self.unordered_checker(pyfunc) + a = self.sparse_array(1) + check(a) + + # Source set has deleted entries + pyfunc = copy_usecase_deleted + check = self.unordered_checker(pyfunc) + check((1, 2, 4, 11), 2) + a = self.sparse_array(50) + check(a, a[len(a) // 2]) + + def test_bool(self): + pyfunc = bool_usecase + check = self.unordered_checker(pyfunc) + + check(self.sparse_array(1)) + check(self.sparse_array(2)) + + def _test_set_operator(self, pyfunc): + check = self.unordered_checker(pyfunc) + + a, b = (1, 2, 4, 11), (2, 3, 5, 11, 42) + check(a, b) + + sizes = (1, 50, 500) + for na, nb in itertools.product(sizes, sizes): + a = self.sparse_array(na) + b = self.sparse_array(nb) + check(a, b) + + def make_operator_usecase(self, op): + code = """if 1: + def operator_usecase(a, b): + s = set(a) %(op)s set(b) + return list(s) + """ % dict(op=op) + return compile_function('operator_usecase', code, globals()) + + def make_inplace_operator_usecase(self, op): + code = """if 1: + def inplace_operator_usecase(a, b): + sa = set(a) + sb = set(b) + sc = sa + sc %(op)s sb + return list(sc), list(sa) + """ % dict(op=op) + return compile_function('inplace_operator_usecase', code, globals()) + + def make_comparison_usecase(self, op): + code = """if 1: + def comparison_usecase(a, b): + return set(a) %(op)s set(b) + """ % dict(op=op) + return compile_function('comparison_usecase', code, globals()) + + def test_difference(self): + self._test_set_operator(difference_usecase) + + def test_intersection(self): + self._test_set_operator(intersection_usecase) + + def test_symmetric_difference(self): + self._test_set_operator(symmetric_difference_usecase) + + def test_union(self): + self._test_set_operator(union_usecase) + + def test_and(self): + self._test_set_operator(self.make_operator_usecase('&')) + + def test_or(self): + self._test_set_operator(self.make_operator_usecase('|')) + + def test_sub(self): + self._test_set_operator(self.make_operator_usecase('-')) + + def test_xor(self): + self._test_set_operator(self.make_operator_usecase('^')) + + def test_eq(self): + self._test_set_operator(self.make_comparison_usecase('==')) + + def test_ne(self): + self._test_set_operator(self.make_comparison_usecase('!=')) + + def test_le(self): + self._test_set_operator(self.make_comparison_usecase('<=')) + + def test_lt(self): + self._test_set_operator(self.make_comparison_usecase('<')) + + def test_ge(self): + self._test_set_operator(self.make_comparison_usecase('>=')) + + def test_gt(self): + self._test_set_operator(self.make_comparison_usecase('>')) + + def test_iand(self): + self._test_set_operator(self.make_inplace_operator_usecase('&=')) + + def test_ior(self): + self._test_set_operator(self.make_inplace_operator_usecase('|=')) + + def test_isub(self): + self._test_set_operator(self.make_inplace_operator_usecase('-=')) + + def test_ixor(self): + self._test_set_operator(self.make_inplace_operator_usecase('^=')) + + +class TestFloatSets(TestSets): + """ + Test sets with floating-point keys. + """ + # Only a few basic tests here, as the sanity of most operations doesn't + # depend on the key type. + + def _range(self, stop): + return np.arange(stop, dtype=np.float32) * np.float32(0.1) + + +class TestTupleSets(TestSets): + """ + Test sets with tuple keys. + """ + def _range(self, stop): + a = np.arange(stop, dtype=np.int64) + b = a & 0x5555555555555555 + c = (a & 0xaaaaaaaa).astype(np.int32) + d = ((a >> 32) & 1).astype(np.bool_) + return list(zip(b, c, d)) + + +class TestUnicodeSets(TestSets): + """ + Test sets with unicode keys. For the purpose of testing refcounted sets. + """ + def _range(self, stop): + return ['A{}'.format(i) for i in range(int(stop))] + + +class TestSetsInvalidDtype(TestSets): + + def _test_set_operator(self, pyfunc): + # it is invalid to apply some set operations on + # sets with different dtype + cfunc = jit(nopython=True)(pyfunc) + + a = set([1, 2, 4, 11]) + b = set(['a', 'b', 'c']) + msg = 'All Sets must be of the same type' + with self.assertRaisesRegex(TypingError, msg): + cfunc(a, b) + + +class TestSetsInvalid(TestSets): + + def symmetric_difference_usecase(a, b): + s = a.symmetric_difference(b) + return list(s) + + def difference_usecase(a, b): + s = a.difference(b) + return list(s) + + def intersection_usecase(a, b): + s = a.intersection(b) + return list(s) + + def union_usecase(a, b): + s = a.union(b) + return list(s) + + def _test_set_operator(self, pyfunc): + # it is invalid to apply some set operations on + # sets with different dtype + cfunc = jit(nopython=True)(pyfunc) + + a = set([1, 2, 4, 11]) + b = (1, 2, 3) + msg = 'All arguments must be Sets' + with self.assertRaisesRegex(TypingError, msg): + cfunc(a, b) + + def test_difference(self): + self._test_set_operator(TestSetsInvalid.difference_usecase) + + def test_intersection(self): + self._test_set_operator(TestSetsInvalid.intersection_usecase) + + def test_symmetric_difference(self): + self._test_set_operator(TestSetsInvalid.symmetric_difference_usecase) + + def test_union(self): + self._test_set_operator(TestSetsInvalid.union_usecase) + + def make_operator_usecase(self, op): + code = """if 1: + def operator_usecase(a, b): + s = a %(op)s b + return list(s) + """ % dict(op=op) + return compile_function('operator_usecase', code, globals()) + + def make_inplace_operator_usecase(self, op): + code = """if 1: + def inplace_operator_usecase(a, b): + sa = a + sb = b + sc = sa + sc %(op)s sb + return list(sc), list(sa) + """ % dict(op=op) + return compile_function('inplace_operator_usecase', code, globals()) + + def make_comparison_usecase(self, op): + code = """if 1: + def comparison_usecase(a, b): + return set(a) %(op)s b + """ % dict(op=op) + return compile_function('comparison_usecase', code, globals()) + + +class TestUnboxing(BaseTest): + """ + Test unboxing of Python sets into native Numba sets. + """ + + @contextlib.contextmanager + def assert_type_error(self, msg): + with self.assertRaises(TypeError) as raises: + yield + if msg is not None: + self.assertRegex(str(raises.exception), msg) + + def check_unary(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + def check(arg): + expected = pyfunc(arg) + got = cfunc(arg) + self.assertPreciseEqual(got, expected) + return check + + def test_numbers(self): + check = self.check_unary(unbox_usecase) + check(set([1, 2])) + check(set([1j, 2.5j])) + # Check allocation and sizing + check(set(range(100))) + + def test_tuples(self): + check = self.check_unary(unbox_usecase2) + check(set([(1, 2), (3, 4)])) + check(set([(1, 2j), (3, 4j)])) + + def test_set_inside_tuple(self): + check = self.check_unary(unbox_usecase3) + check((1, set([2, 3, 4]))) + + def test_set_of_tuples_inside_tuple(self): + check = self.check_unary(unbox_usecase4) + check((1, set([(2,), (3,)]))) + + def test_errors(self): + # Error checking should ensure the set is homogeneous + msg = "can't unbox heterogeneous set" + pyfunc = noop + cfunc = jit(nopython=True)(pyfunc) + val = set([1, 2.5]) + with self.assert_type_error(msg): + cfunc(val) + # The set hasn't been changed (bogus reflecting) + self.assertEqual(val, set([1, 2.5])) + with self.assert_type_error(msg): + cfunc(set([1, 2j])) + # Same when the set is nested in a tuple or namedtuple + with self.assert_type_error(msg): + cfunc((1, set([1, 2j]))) + with self.assert_type_error(msg): + cfunc(Point(1, set([1, 2j]))) + # Tuples of different size. + # Note the check is really on the tuple side. + lst = set([(1,), (2, 3)]) + # Depending on which tuple is examined first, we could get + # a IndexError or a ValueError. + with self.assertRaises((IndexError, ValueError)) as raises: + cfunc(lst) + + +class TestSetReflection(BaseTest): + """ + Test reflection of native Numba sets on Python set objects. + """ + + def check_reflection(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + samples = [(set([1., 2., 3., 4.]), set([0.])), + (set([1., 2., 3., 4.]), set([5., 6., 7., 8., 9.])), + ] + for dest, src in samples: + expected = set(dest) + got = set(dest) + pyres = pyfunc(expected, src) + with self.assertRefCount(got, src): + cres = cfunc(got, src) + self.assertPreciseEqual(cres, pyres) + self.assertPreciseEqual(expected, got) + self.assertEqual(pyres[0] is expected, cres[0] is got) + del pyres, cres + + def test_reflect_simple(self): + self.check_reflection(reflect_simple) + + def test_reflect_conditional(self): + self.check_reflection(reflect_conditional) + + def test_reflect_exception(self): + """ + When the function exits with an exception, sets should still be + reflected. + """ + pyfunc = reflect_exception + cfunc = jit(nopython=True)(pyfunc) + s = set([1, 2, 3]) + with self.assertRefCount(s): + with self.assertRaises(ZeroDivisionError): + cfunc(s) + self.assertPreciseEqual(s, set([1, 2, 3, 42])) + + def test_reflect_same_set(self): + """ + When the same set object is reflected twice, behaviour should + be consistent. + """ + pyfunc = reflect_dual + cfunc = jit(nopython=True)(pyfunc) + pyset = set([1, 2, 3]) + cset = pyset.copy() + expected = pyfunc(pyset, pyset) + got = cfunc(cset, cset) + self.assertPreciseEqual(expected, got) + self.assertPreciseEqual(pyset, cset) + self.assertRefCountEqual(pyset, cset) + + def test_reflect_clean(self): + """ + When the set wasn't mutated, no reflection should take place. + """ + cfunc = jit(nopython=True)(noop) + # Use a complex, as Python integers can be cached + s = set([12.5j]) + ids = [id(x) for x in s] + cfunc(s) + self.assertEqual([id(x) for x in s], ids) + + +class TestExamples(BaseTest): + """ + Examples of using sets. + """ + + def test_unique(self): + pyfunc = unique_usecase + check = self.unordered_checker(pyfunc) + + check(self.duplicates_array(200)) + check(self.sparse_array(200)) + + def test_type_coercion_from_update(self): + # see issue #6621 + def impl(): + i = np.uint64(1) + R = set() + R.update({1, 2, 3}) + R.add(i) + return R + check = self.unordered_checker(impl) + check() + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_slices.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_slices.py new file mode 100644 index 0000000000000000000000000000000000000000..a6badd1ac2adf38f989674a4d15c57b7c83731c7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_slices.py @@ -0,0 +1,259 @@ +from functools import partial +import itertools +from itertools import chain, product, starmap +import sys + +import numpy as np + +from numba import jit, literally, njit, typeof, TypingError +from numba.core import utils, types +from numba.tests.support import TestCase, MemoryLeakMixin +from numba.core.types.functions import _header_lead +import unittest + + +def slice_passing(sl): + return sl.start, sl.stop, sl.step + +def slice_constructor(*args): + sl = slice(*args) + return sl.start, sl.stop, sl.step + +def slice_construct_and_use(args, l): + sl = slice(*args) + return l[sl] + +def slice_indices(s, *indargs): + return s.indices(*indargs) + +class TestSlices(MemoryLeakMixin, TestCase): + + def test_slice_passing(self): + """ + Check passing a slice object to a Numba function. + """ + # NOTE this also checks slice attributes + def check(a, b, c, d, e, f): + sl = slice(a, b, c) + got = cfunc(sl) + self.assertPreciseEqual(got, (d, e, f)) + + maxposint = sys.maxsize + maxnegint = -maxposint - 1 + cfunc = jit(nopython=True)(slice_passing) + + # Positive steps + start_cases = [(None, 0), (42, 42), (-1, -1)] + stop_cases = [(None, maxposint), (9, 9), (-11, -11)] + step_cases = [(None, 1), (12, 12)] + for (a, d), (b, e), (c, f) in itertools.product(start_cases, + stop_cases, + step_cases): + check(a, b, c, d, e, f) + + # Negative steps + start_cases = [(None, maxposint), (42, 42), (-1, -1)] + stop_cases = [(None, maxnegint), (9, 9), (-11, -11)] + step_cases = [(-1, -1), (-12, -12)] + for (a, d), (b, e), (c, f) in itertools.product(start_cases, + stop_cases, + step_cases): + check(a, b, c, d, e, f) + + # Some member is neither integer nor None + with self.assertRaises(TypeError): + cfunc(slice(1.5, 1, 1)) + + def test_slice_constructor(self): + """ + Test the 'happy path' for slice() constructor in nopython mode. + """ + maxposint = sys.maxsize + maxnegint = -maxposint - 1 + a = np.arange(10) + cfunc = jit(nopython=True)(slice_constructor) + cfunc_use = jit(nopython=True)(slice_construct_and_use) + for args, expected in [ + ((None,), (0, maxposint, 1)), + ((5,), (0, 5, 1)), + ((None, None), (0, maxposint, 1)), + ((1, None), (1, maxposint, 1)), + ((None, 2), (0, 2, 1)), + ((1, 2), (1, 2, 1)), + ((None, None, 3), (0, maxposint, 3)), + ((None, 2, 3), (0, 2, 3)), + ((1, None, 3), (1, maxposint, 3)), + ((1, 2, 3), (1, 2, 3)), + ((None, None, -1), (maxposint, maxnegint, -1)), + ((10, None, -1), (10, maxnegint, -1)), + ((None, 5, -1), (maxposint, 5, -1)), + ((10, 5, -1), (10, 5, -1)), + ]: + got = cfunc(*args) + self.assertPreciseEqual(got, expected) + usage = slice_construct_and_use(args, a) + cusage = cfunc_use(args, a) + self.assertPreciseEqual(usage, cusage) + + def test_slice_constructor_cases(self): + """ + Test that slice constructor behaves same in python and compiled code. + """ + options = (None, -1, 0, 1) + arg_cases = chain.from_iterable( + product(options, repeat=n) for n in range(5) + ) + array = np.arange(10) + + cfunc = jit(nopython=True)(slice_construct_and_use) + + self.disable_leak_check() + for args in arg_cases: + try: + expected = slice_construct_and_use(args, array) + except TypeError as py_type_e: + # Catch cases of 0, or more than 3 arguments. + # This becomes a typing error in numba + n_args = len(args) + self.assertRegex( + str(py_type_e), + r"slice expected at (most|least) (3|1) arguments?, got {}" + .format(n_args) + ) + with self.assertRaises(TypingError) as numba_e: + cfunc(args, array) + self.assertIn( + _header_lead, + str(numba_e.exception) + ) + self.assertIn( + ", ".join(str(typeof(arg)) for arg in args), + str(numba_e.exception) + ) + except Exception as py_e: + with self.assertRaises(type(py_e)) as numba_e: + cfunc(args, array) + self.assertIn( + str(py_e), + str(numba_e.exception) + ) + else: + self.assertPreciseEqual(expected, cfunc(args, array)) + + def test_slice_indices(self): + """Test that a numba slice returns same result for .indices as a python one.""" + slices = starmap( + slice, + product( + chain(range(-5, 5), (None,)), + chain(range(-5, 5), (None,)), + chain(range(-5, 5), (None,)) + ) + ) + lengths = range(-2, 3) + + cfunc = jit(nopython=True)(slice_indices) + + for s, l in product(slices, lengths): + try: + expected = slice_indices(s, l) + except Exception as py_e: + with self.assertRaises(type(py_e)) as numba_e: + cfunc(s, l) + self.assertIn( + str(py_e), + str(numba_e.exception) + ) + else: + self.assertPreciseEqual(expected, cfunc(s, l)) + + def test_slice_indices_examples(self): + """Tests for specific error cases.""" + cslice_indices = jit(nopython=True)(slice_indices) + + with self.assertRaises(TypingError) as e: + cslice_indices(slice(None), 1, 2, 3) + self.assertIn( + "indices() takes exactly one argument (3 given)", + str(e.exception) + ) + + with self.assertRaises(TypingError) as e: + cslice_indices(slice(None, None, 0), 1.2) + self.assertIn( + "'%s' object cannot be interpreted as an integer" % typeof(1.2), + str(e.exception) + ) + + def test_slice_from_constant(self): + test_tuple = (1, 2, 3, 4) + + for ts in itertools.product( + [None, 1, 2, 3], [None, 1, 2, 3], [None, 1, 2, -1, -2] + ): + ts = slice(*ts) + + @jit(nopython=True) + def test_fn(): + return test_tuple[ts] + + self.assertEqual(test_fn(), test_fn.py_func()) + + def test_literal_slice_distinct(self): + sl1 = types.misc.SliceLiteral(slice(1, None, None)) + sl2 = types.misc.SliceLiteral(slice(None, None, None)) + sl3 = types.misc.SliceLiteral(slice(1, None, None)) + + self.assertNotEqual(sl1, sl2) + self.assertEqual(sl1, sl3) + + def test_literal_slice_boxing(self): + # Tests that a literal slice can be + # returned from a JIT function. + @njit + def f(x): + return literally(x) + + slices = ( + slice(1, 4, 2), + slice(1, 2), + slice(1), + slice(None, 1, 1), + slice(1, None, 1), + slice(None, None, 1), + slice(None), + slice(None, None, None) + ) + for sl in slices: + self.assertEqual(sl, f(sl)) + + + def test_literal_slice_freevar(self): + # Tests passing a literal slice as a freevar + # in a closure. + z = slice(1, 2, 3) + @njit + def foo(): + return z + + self.assertEqual(z, foo()) + + def test_literal_slice_maxint(self): + # Tests that passing a slice with an integer + # that exceeds the maxint size throws a reasonable + # error message. + @njit() + def foo(z): + return literally(z) + + maxval = int(2**63) + with self.assertRaises(ValueError) as e: + foo(slice(None, None, -maxval-1)) + self.assertIn( + "Int value is too large", + str(e.exception) + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sort.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sort.py new file mode 100644 index 0000000000000000000000000000000000000000..5a63c775984af1890f97b3ef5985d6bcb865c24b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sort.py @@ -0,0 +1,1256 @@ +import copy +import itertools +import math +import random +import sys +import unittest + +import numpy as np + +from numba import jit, njit +from numba.core import utils, errors +from numba.tests.support import TestCase, MemoryLeakMixin + +from numba.misc.quicksort import make_py_quicksort, make_jit_quicksort +from numba.misc.mergesort import make_jit_mergesort +from numba.misc.timsort import make_py_timsort, make_jit_timsort, MergeRun + + +def make_temp_list(keys, n): + return [keys[0]] * n + +def make_temp_array(keys, n): + return np.empty(n, keys.dtype) + + +py_list_timsort = make_py_timsort(make_temp_list) + +py_array_timsort = make_py_timsort(make_temp_array) + +jit_list_timsort = make_jit_timsort(make_temp_list) + +jit_array_timsort = make_jit_timsort(make_temp_array) + +py_quicksort = make_py_quicksort() + +jit_quicksort = make_jit_quicksort() + + +def sort_usecase(val): + val.sort() + +def argsort_usecase(val): + return val.argsort() + +def argsort_kind_usecase(val, is_stable=False): + if is_stable: + return val.argsort(kind='mergesort') + else: + return val.argsort(kind='quicksort') + +def sorted_usecase(val): + return sorted(val) + +def sorted_reverse_usecase(val, b): + return sorted(val, reverse=b) + +def np_sort_usecase(val): + return np.sort(val) + +def np_argsort_usecase(val): + return np.argsort(val) + +def np_argsort_kind_usecase(val, is_stable=False): + if is_stable: + return np.argsort(val, kind='mergesort') + else: + return np.argsort(val, kind='quicksort') + +def list_sort_usecase(n): + np.random.seed(42) + l = [] + for i in range(n): + l.append(np.random.random()) + ll = l[:] + ll.sort() + return l, ll + +def list_sort_reverse_usecase(n, b): + np.random.seed(42) + l = [] + for i in range(n): + l.append(np.random.random()) + ll = l[:] + ll.sort(reverse=b) + return l, ll + + +class BaseSortingTest(object): + + def random_list(self, n, offset=10): + random.seed(42) + l = list(range(offset, offset + n)) + random.shuffle(l) + return l + + def sorted_list(self, n, offset=10): + return list(range(offset, offset + n)) + + def revsorted_list(self, n, offset=10): + return list(range(offset, offset + n))[::-1] + + def initially_sorted_list(self, n, m=None, offset=10): + if m is None: + m = n // 2 + l = self.sorted_list(m, offset) + l += self.random_list(n - m, offset=l[-1] + offset) + return l + + def duprandom_list(self, n, factor=None, offset=10): + random.seed(42) + if factor is None: + factor = int(math.sqrt(n)) + l = (list(range(offset, offset + (n // factor) + 1)) * (factor + 1))[:n] + assert len(l) == n + random.shuffle(l) + return l + + def dupsorted_list(self, n, factor=None, offset=10): + if factor is None: + factor = int(math.sqrt(n)) + l = (list(range(offset, offset + (n // factor) + 1)) * (factor + 1))[:n] + assert len(l) == n, (len(l), n) + l.sort() + return l + + def assertSorted(self, orig, result): + self.assertEqual(len(result), len(orig)) + # sorted() returns a list, so make sure we compare to another list + self.assertEqual(list(result), sorted(orig)) + + def assertSortedValues(self, orig, orig_values, result, result_values): + self.assertEqual(len(result), len(orig)) + self.assertEqual(list(result), sorted(orig)) + zip_sorted = sorted(zip(orig, orig_values), key=lambda x: x[0]) + zip_result = list(zip(result, result_values)) + self.assertEqual(zip_sorted, zip_result) + # Check stability + for i in range(len(zip_result) - 1): + (k1, v1), (k2, v2) = zip_result[i], zip_result[i + 1] + if k1 == k2: + # Assuming values are unique, which is enforced by the tests + self.assertLess(orig_values.index(v1), orig_values.index(v2)) + + def fibo(self): + a = 1 + b = 1 + while True: + yield a + a, b = b, a + b + + def make_sample_sorted_lists(self, n): + lists = [] + for offset in (20, 120): + lists.append(self.sorted_list(n, offset)) + lists.append(self.dupsorted_list(n, offset)) + return lists + + def make_sample_lists(self, n): + lists = [] + for offset in (20, 120): + lists.append(self.sorted_list(n, offset)) + lists.append(self.dupsorted_list(n, offset)) + lists.append(self.revsorted_list(n, offset)) + lists.append(self.duprandom_list(n, offset)) + return lists + + +class BaseTimsortTest(BaseSortingTest): + + def merge_init(self, keys): + f = self.timsort.merge_init + return f(keys) + + def test_binarysort(self): + n = 20 + def check(l, n, start=0): + res = self.array_factory(l) + f(res, res, 0, n, start) + self.assertSorted(l, res) + + f = self.timsort.binarysort + l = self.sorted_list(n) + check(l, n) + check(l, n, n//2) + l = self.revsorted_list(n) + check(l, n) + l = self.initially_sorted_list(n, n//2) + check(l, n) + check(l, n, n//2) + l = self.revsorted_list(n) + check(l, n) + l = self.random_list(n) + check(l, n) + l = self.duprandom_list(n) + check(l, n) + + def test_binarysort_with_values(self): + n = 20 + v = list(range(100, 100+n)) + + def check(l, n, start=0): + res = self.array_factory(l) + res_v = self.array_factory(v) + f(res, res_v, 0, n, start) + self.assertSortedValues(l, v, res, res_v) + + f = self.timsort.binarysort + l = self.sorted_list(n) + check(l, n) + check(l, n, n//2) + l = self.revsorted_list(n) + check(l, n) + l = self.initially_sorted_list(n, n//2) + check(l, n) + check(l, n, n//2) + l = self.revsorted_list(n) + check(l, n) + l = self.random_list(n) + check(l, n) + l = self.duprandom_list(n) + check(l, n) + + def test_count_run(self): + n = 16 + f = self.timsort.count_run + + def check(l, lo, hi): + n, desc = f(self.array_factory(l), lo, hi) + # Fully check invariants + if desc: + for k in range(lo, lo + n - 1): + a, b = l[k], l[k + 1] + self.assertGreater(a, b) + if lo + n < hi: + self.assertLessEqual(l[lo + n - 1], l[lo + n]) + else: + for k in range(lo, lo + n - 1): + a, b = l[k], l[k + 1] + self.assertLessEqual(a, b) + if lo + n < hi: + self.assertGreater(l[lo + n - 1], l[lo + n], l) + + + l = self.sorted_list(n, offset=100) + check(l, 0, n) + check(l, 1, n - 1) + check(l, 1, 2) + l = self.revsorted_list(n, offset=100) + check(l, 0, n) + check(l, 1, n - 1) + check(l, 1, 2) + l = self.random_list(n, offset=100) + for i in range(len(l) - 1): + check(l, i, n) + l = self.duprandom_list(n, offset=100) + for i in range(len(l) - 1): + check(l, i, n) + + def test_gallop_left(self): + n = 20 + f = self.timsort.gallop_left + + def check(l, key, start, stop, hint): + k = f(key, l, start, stop, hint) + # Fully check invariants + self.assertGreaterEqual(k, start) + self.assertLessEqual(k, stop) + if k > start: + self.assertLess(l[k - 1], key) + if k < stop: + self.assertGreaterEqual(l[k], key) + + def check_all_hints(l, key, start, stop): + for hint in range(start, stop): + check(l, key, start, stop, hint) + + def check_sorted_list(l): + l = self.array_factory(l) + for key in (l[5], l[15], l[0], -1000, l[-1], 1000): + check_all_hints(l, key, 0, n) + check_all_hints(l, key, 1, n - 1) + check_all_hints(l, key, 8, n - 8) + + l = self.sorted_list(n, offset=100) + check_sorted_list(l) + l = self.dupsorted_list(n, offset=100) + check_sorted_list(l) + + def test_gallop_right(self): + n = 20 + f = self.timsort.gallop_right + + def check(l, key, start, stop, hint): + k = f(key, l, start, stop, hint) + # Fully check invariants + self.assertGreaterEqual(k, start) + self.assertLessEqual(k, stop) + if k > start: + self.assertLessEqual(l[k - 1], key) + if k < stop: + self.assertGreater(l[k], key) + + def check_all_hints(l, key, start, stop): + for hint in range(start, stop): + check(l, key, start, stop, hint) + + def check_sorted_list(l): + l = self.array_factory(l) + for key in (l[5], l[15], l[0], -1000, l[-1], 1000): + check_all_hints(l, key, 0, n) + check_all_hints(l, key, 1, n - 1) + check_all_hints(l, key, 8, n - 8) + + l = self.sorted_list(n, offset=100) + check_sorted_list(l) + l = self.dupsorted_list(n, offset=100) + check_sorted_list(l) + + def test_merge_compute_minrun(self): + f = self.timsort.merge_compute_minrun + + for i in range(0, 64): + self.assertEqual(f(i), i) + for i in range(6, 63): + if 2**i > sys.maxsize: + break + self.assertEqual(f(2**i), 32) + for i in self.fibo(): + if i < 64: + continue + if i >= sys.maxsize: + break + k = f(i) + self.assertGreaterEqual(k, 32) + self.assertLessEqual(k, 64) + if i > 500: + # i/k is close to, but strictly less than, an exact power of 2 + quot = i // k + p = 2 ** utils.bit_length(quot) + self.assertLess(quot, p) + self.assertGreaterEqual(quot, 0.9 * p) + + def check_merge_lo_hi(self, func, a, b): + na = len(a) + nb = len(b) + + # Add sentinels at start and end, to check they weren't moved + orig_keys = [42] + a + b + [-42] + keys = self.array_factory(orig_keys) + ms = self.merge_init(keys) + ssa = 1 + ssb = ssa + na + + #new_ms = func(ms, keys, [], ssa, na, ssb, nb) + new_ms = func(ms, keys, keys, ssa, na, ssb, nb) + self.assertEqual(keys[0], orig_keys[0]) + self.assertEqual(keys[-1], orig_keys[-1]) + self.assertSorted(orig_keys[1:-1], keys[1:-1]) + # Check the MergeState result + self.assertGreaterEqual(len(new_ms.keys), len(ms.keys)) + self.assertGreaterEqual(len(new_ms.values), len(ms.values)) + self.assertIs(new_ms.pending, ms.pending) + self.assertGreaterEqual(new_ms.min_gallop, 1) + + def test_merge_lo_hi(self): + f_lo = self.timsort.merge_lo + f_hi = self.timsort.merge_hi + + # The larger sizes exercise galloping + for (na, nb) in [(12, 16), (40, 40), (100, 110), (1000, 1100)]: + for a, b in itertools.product(self.make_sample_sorted_lists(na), + self.make_sample_sorted_lists(nb)): + self.check_merge_lo_hi(f_lo, a, b) + self.check_merge_lo_hi(f_hi, b, a) + + def check_merge_at(self, a, b): + f = self.timsort.merge_at + # Prepare the array to be sorted + na = len(a) + nb = len(b) + # Add sentinels at start and end, to check they weren't moved + orig_keys = [42] + a + b + [-42] + ssa = 1 + ssb = ssa + na + + stack_sentinel = MergeRun(-42, -42) + + def run_merge_at(ms, keys, i): + new_ms = f(ms, keys, keys, i) + self.assertEqual(keys[0], orig_keys[0]) + self.assertEqual(keys[-1], orig_keys[-1]) + self.assertSorted(orig_keys[1:-1], keys[1:-1]) + # Check stack state + self.assertIs(new_ms.pending, ms.pending) + self.assertEqual(ms.pending[i], (ssa, na + nb)) + self.assertEqual(ms.pending[0], stack_sentinel) + return new_ms + + # First check with i == len(stack) - 2 + keys = self.array_factory(orig_keys) + ms = self.merge_init(keys) + # Push sentinel on stack, to check it wasn't touched + ms = self.timsort.merge_append(ms, stack_sentinel) + i = ms.n + ms = self.timsort.merge_append(ms, MergeRun(ssa, na)) + ms = self.timsort.merge_append(ms, MergeRun(ssb, nb)) + ms = run_merge_at(ms, keys, i) + self.assertEqual(ms.n, i + 1) + + # Now check with i == len(stack) - 3 + keys = self.array_factory(orig_keys) + ms = self.merge_init(keys) + # Push sentinel on stack, to check it wasn't touched + ms = self.timsort.merge_append(ms, stack_sentinel) + i = ms.n + ms = self.timsort.merge_append(ms, MergeRun(ssa, na)) + ms = self.timsort.merge_append(ms, MergeRun(ssb, nb)) + # A last run (trivial here) + last_run = MergeRun(ssb + nb, 1) + ms = self.timsort.merge_append(ms, last_run) + ms = run_merge_at(ms, keys, i) + self.assertEqual(ms.n, i + 2) + self.assertEqual(ms.pending[ms.n - 1], last_run) + + def test_merge_at(self): + # The larger sizes exercise galloping + for (na, nb) in [(12, 16), (40, 40), (100, 110), (500, 510)]: + for a, b in itertools.product(self.make_sample_sorted_lists(na), + self.make_sample_sorted_lists(nb)): + self.check_merge_at(a, b) + self.check_merge_at(b, a) + + def test_merge_force_collapse(self): + f = self.timsort.merge_force_collapse + + # Test with runs of ascending sizes, then descending sizes + sizes_list = [(8, 10, 15, 20)] + sizes_list.append(sizes_list[0][::-1]) + + for sizes in sizes_list: + for chunks in itertools.product(*(self.make_sample_sorted_lists(n) + for n in sizes)): + # Create runs of the given sizes + orig_keys = sum(chunks, []) + keys = self.array_factory(orig_keys) + ms = self.merge_init(keys) + pos = 0 + for c in chunks: + ms = self.timsort.merge_append(ms, MergeRun(pos, len(c))) + pos += len(c) + # Sanity check + self.assertEqual(sum(ms.pending[ms.n - 1]), len(keys)) + # Now merge the runs + ms = f(ms, keys, keys) + # Remaining run is the whole list + self.assertEqual(ms.n, 1) + self.assertEqual(ms.pending[0], MergeRun(0, len(keys))) + # The list is now sorted + self.assertSorted(orig_keys, keys) + + def test_run_timsort(self): + f = self.timsort.run_timsort + + for size_factor in (1, 10): + # Make lists to be sorted from three chunks of different kinds. + sizes = (15, 30, 20) + + all_lists = [self.make_sample_lists(n * size_factor) for n in sizes] + for chunks in itertools.product(*all_lists): + orig_keys = sum(chunks, []) + keys = self.array_factory(orig_keys) + f(keys) + # The list is now sorted + self.assertSorted(orig_keys, keys) + + def test_run_timsort_with_values(self): + # Run timsort, but also with a values array + f = self.timsort.run_timsort_with_values + + for size_factor in (1, 5): + chunk_size = 80 * size_factor + a = self.dupsorted_list(chunk_size) + b = self.duprandom_list(chunk_size) + c = self.revsorted_list(chunk_size) + orig_keys = a + b + c + orig_values = list(range(1000, 1000 + len(orig_keys))) + + keys = self.array_factory(orig_keys) + values = self.array_factory(orig_values) + f(keys, values) + # This checks sort stability + self.assertSortedValues(orig_keys, orig_values, keys, values) + + +class TestTimsortPurePython(BaseTimsortTest, TestCase): + + timsort = py_list_timsort + + # Much faster than a Numpy array in pure Python + array_factory = list + + +class TestTimsortArraysPurePython(BaseTimsortTest, TestCase): + + timsort = py_array_timsort + + def array_factory(self, lst): + return np.array(lst, dtype=np.int32) + + +class JITTimsortMixin(object): + + timsort = jit_array_timsort + + test_merge_at = None + test_merge_force_collapse = None + + def wrap_with_mergestate(self, timsort, func, _cache={}): + """ + Wrap *func* into another compiled function inserting a runtime-created + mergestate as the first function argument. + """ + key = timsort, func + if key in _cache: + return _cache[key] + + merge_init = timsort.merge_init + + @timsort.compile + def wrapper(keys, values, *args): + ms = merge_init(keys) + res = func(ms, keys, values, *args) + return res + + _cache[key] = wrapper + return wrapper + + +class TestTimsortArrays(JITTimsortMixin, BaseTimsortTest, TestCase): + + def array_factory(self, lst): + return np.array(lst, dtype=np.int32) + + def check_merge_lo_hi(self, func, a, b): + na = len(a) + nb = len(b) + + func = self.wrap_with_mergestate(self.timsort, func) + + # Add sentinels at start and end, to check they weren't moved + orig_keys = [42] + a + b + [-42] + keys = self.array_factory(orig_keys) + ssa = 1 + ssb = ssa + na + + new_ms = func(keys, keys, ssa, na, ssb, nb) + self.assertEqual(keys[0], orig_keys[0]) + self.assertEqual(keys[-1], orig_keys[-1]) + self.assertSorted(orig_keys[1:-1], keys[1:-1]) + + + +class BaseQuicksortTest(BaseSortingTest): + + # NOTE these tests assume a non-argsort quicksort. + + def test_insertion_sort(self): + n = 20 + def check(l, n): + res = self.array_factory([9999] + l + [-9999]) + f(res, res, 1, n) + self.assertEqual(res[0], 9999) + self.assertEqual(res[-1], -9999) + self.assertSorted(l, res[1:-1]) + + f = self.quicksort.insertion_sort + l = self.sorted_list(n) + check(l, n) + l = self.revsorted_list(n) + check(l, n) + l = self.initially_sorted_list(n, n//2) + check(l, n) + l = self.revsorted_list(n) + check(l, n) + l = self.random_list(n) + check(l, n) + l = self.duprandom_list(n) + check(l, n) + + def test_partition(self): + n = 20 + def check(l, n): + res = self.array_factory([9999] + l + [-9999]) + index = f(res, res, 1, n) + self.assertEqual(res[0], 9999) + self.assertEqual(res[-1], -9999) + pivot = res[index] + for i in range(1, index): + self.assertLessEqual(res[i], pivot) + for i in range(index + 1, n): + self.assertGreaterEqual(res[i], pivot) + + f = self.quicksort.partition + l = self.sorted_list(n) + check(l, n) + l = self.revsorted_list(n) + check(l, n) + l = self.initially_sorted_list(n, n//2) + check(l, n) + l = self.revsorted_list(n) + check(l, n) + l = self.random_list(n) + check(l, n) + l = self.duprandom_list(n) + check(l, n) + + def test_partition3(self): + # Test the unused partition3() function + n = 20 + def check(l, n): + res = self.array_factory([9999] + l + [-9999]) + lt, gt = f(res, 1, n) + self.assertEqual(res[0], 9999) + self.assertEqual(res[-1], -9999) + pivot = res[lt] + for i in range(1, lt): + self.assertLessEqual(res[i], pivot) + for i in range(lt, gt + 1): + self.assertEqual(res[i], pivot) + for i in range(gt + 1, n): + self.assertGreater(res[i], pivot) + + f = self.quicksort.partition3 + l = self.sorted_list(n) + check(l, n) + l = self.revsorted_list(n) + check(l, n) + l = self.initially_sorted_list(n, n//2) + check(l, n) + l = self.revsorted_list(n) + check(l, n) + l = self.random_list(n) + check(l, n) + l = self.duprandom_list(n) + check(l, n) + + def test_run_quicksort(self): + f = self.quicksort.run_quicksort + + for size_factor in (1, 5): + # Make lists to be sorted from two chunks of different kinds. + sizes = (15, 20) + + all_lists = [self.make_sample_lists(n * size_factor) for n in sizes] + for chunks in itertools.product(*all_lists): + orig_keys = sum(chunks, []) + keys = self.array_factory(orig_keys) + f(keys) + # The list is now sorted + self.assertSorted(orig_keys, keys) + + def test_run_quicksort_lt(self): + def lt(a, b): + return a > b + + f = self.make_quicksort(lt=lt).run_quicksort + + for size_factor in (1, 5): + # Make lists to be sorted from two chunks of different kinds. + sizes = (15, 20) + + all_lists = [self.make_sample_lists(n * size_factor) for n in sizes] + for chunks in itertools.product(*all_lists): + orig_keys = sum(chunks, []) + keys = self.array_factory(orig_keys) + f(keys) + # The list is now rev-sorted + self.assertSorted(orig_keys, keys[::-1]) + + # An imperfect comparison function, as LT(a, b) does not imply not LT(b, a). + # The sort should handle it gracefully. + def lt_floats(a, b): + return math.isnan(b) or a < b + + f = self.make_quicksort(lt=lt_floats).run_quicksort + + np.random.seed(42) + for size in (5, 20, 50, 500): + orig = np.random.random(size=size) * 100 + orig[np.random.random(size=size) < 0.1] = float('nan') + orig_keys = list(orig) + keys = self.array_factory(orig_keys) + f(keys) + non_nans = orig[~np.isnan(orig)] + # Non-NaNs are sorted at the front + self.assertSorted(non_nans, keys[:len(non_nans)]) + + +class TestQuicksortPurePython(BaseQuicksortTest, TestCase): + + quicksort = py_quicksort + make_quicksort = staticmethod(make_py_quicksort) + + # Much faster than a Numpy array in pure Python + array_factory = list + + +class TestQuicksortArrays(BaseQuicksortTest, TestCase): + + quicksort = jit_quicksort + make_quicksort = staticmethod(make_jit_quicksort) + + def array_factory(self, lst): + return np.array(lst, dtype=np.float64) + +class TestQuicksortMultidimensionalArrays(BaseSortingTest, TestCase): + + quicksort = make_jit_quicksort(is_np_array=True) + make_quicksort = staticmethod(make_jit_quicksort) + + def assertSorted(self, orig, result): + self.assertEqual(orig.shape, result.shape) + self.assertPreciseEqual(orig, result) + + def array_factory(self, lst, shape=None): + array = np.array(lst, dtype=np.float64) + if shape is None: + return array.reshape(-1, array.shape[0]) + else: + return array.reshape(shape) + + def get_shapes(self, n): + shapes = [] + if n == 1: + return shapes + + for i in range(2, int(math.sqrt(n)) + 1): + if n % i == 0: + shapes.append((n // i, i)) + shapes.append((i, n // i)) + _shapes = self.get_shapes(n // i) + for _shape in _shapes: + shapes.append((i,) + _shape) + shapes.append(_shape + (i,)) + + return shapes + + def test_run_quicksort(self): + f = self.quicksort.run_quicksort + + for size_factor in (1, 5): + # Make lists to be sorted from two chunks of different kinds. + sizes = (15, 20) + + all_lists = [self.make_sample_lists(n * size_factor) for n in sizes] + for chunks in itertools.product(*all_lists): + orig_keys = sum(chunks, []) + shape_list = self.get_shapes(len(orig_keys)) + shape_list.append(None) + for shape in shape_list: + keys = self.array_factory(orig_keys, shape=shape) + keys_copy = self.array_factory(orig_keys, shape=shape) + f(keys) + keys_copy.sort() + # The list is now sorted + self.assertSorted(keys_copy, keys) + + def test_run_quicksort_lt(self): + def lt(a, b): + return a > b + + f = self.make_quicksort(lt=lt, is_np_array=True).run_quicksort + + for size_factor in (1, 5): + # Make lists to be sorted from two chunks of different kinds. + sizes = (15, 20) + + all_lists = [self.make_sample_lists(n * size_factor) for n in sizes] + for chunks in itertools.product(*all_lists): + orig_keys = sum(chunks, []) + shape_list = self.get_shapes(len(orig_keys)) + shape_list.append(None) + for shape in shape_list: + keys = self.array_factory(orig_keys, shape=shape) + keys_copy = -self.array_factory(orig_keys, shape=shape) + f(keys) + # The list is now rev-sorted + keys_copy.sort() + keys_copy = -keys_copy + self.assertSorted(keys_copy, keys) + + # An imperfect comparison function, as LT(a, b) does not imply not LT(b, a). + # The sort should handle it gracefully. + def lt_floats(a, b): + return math.isnan(b) or a < b + + f = self.make_quicksort(lt=lt_floats, is_np_array=True).run_quicksort + + np.random.seed(42) + for size in (5, 20, 50, 500): + orig = np.random.random(size=size) * 100 + orig[np.random.random(size=size) < 0.1] = float('nan') + orig_keys = list(orig) + shape_list = self.get_shapes(len(orig_keys)) + shape_list.append(None) + for shape in shape_list: + keys = self.array_factory(orig_keys, shape=shape) + keys_copy = self.array_factory(orig_keys, shape=shape) + f(keys) + keys_copy.sort() + # Non-NaNs are sorted at the front + self.assertSorted(keys_copy, keys) + +class TestNumpySort(TestCase): + + def setUp(self): + np.random.seed(42) + + def int_arrays(self): + for size in (5, 20, 50, 500): + yield np.random.randint(99, size=size) + + def float_arrays(self): + for size in (5, 20, 50, 500): + yield np.random.random(size=size) * 100 + # Now with NaNs. Numpy sorts them at the end. + for size in (5, 20, 50, 500): + orig = np.random.random(size=size) * 100 + orig[np.random.random(size=size) < 0.1] = float('nan') + yield orig + # 90% of values are NaNs. + for size in (50, 500): + orig = np.random.random(size=size) * 100 + orig[np.random.random(size=size) < 0.9] = float('nan') + yield orig + + def has_duplicates(self, arr): + """ + Whether the array has duplicates. Takes NaNs into account. + """ + if np.count_nonzero(np.isnan(arr)) > 1: + return True + if np.unique(arr).size < arr.size: + return True + return False + + def check_sort_inplace(self, pyfunc, cfunc, val): + expected = copy.copy(val) + got = copy.copy(val) + pyfunc(expected) + cfunc(got) + self.assertPreciseEqual(got, expected) + + def check_sort_copy(self, pyfunc, cfunc, val): + orig = copy.copy(val) + expected = pyfunc(val) + got = cfunc(val) + self.assertPreciseEqual(got, expected) + # The original wasn't mutated + self.assertPreciseEqual(val, orig) + + def check_argsort(self, pyfunc, cfunc, val, kwargs={}): + orig = copy.copy(val) + expected = pyfunc(val, **kwargs) + got = cfunc(val, **kwargs) + self.assertPreciseEqual(orig[got], np.sort(orig), + msg="the array wasn't argsorted") + # Numba and Numpy results may differ if there are duplicates + # in the array + if not self.has_duplicates(orig): + self.assertPreciseEqual(got, expected) + # The original wasn't mutated + self.assertPreciseEqual(val, orig) + + def test_array_sort_int(self): + pyfunc = sort_usecase + cfunc = jit(nopython=True)(pyfunc) + + for orig in self.int_arrays(): + self.check_sort_inplace(pyfunc, cfunc, orig) + + def test_array_sort_float(self): + pyfunc = sort_usecase + cfunc = jit(nopython=True)(pyfunc) + + for orig in self.float_arrays(): + self.check_sort_inplace(pyfunc, cfunc, orig) + + def test_array_sort_complex(self): + pyfunc = sort_usecase + cfunc = jit(nopython=True)(pyfunc) + + for real in self.float_arrays(): + imag = real[::] + np.random.shuffle(imag) + orig = np.array([complex(*x) for x in zip(real, imag)]) + self.check_sort_inplace(pyfunc, cfunc, orig) + + def test_np_sort_int(self): + pyfunc = np_sort_usecase + cfunc = jit(nopython=True)(pyfunc) + + for orig in self.int_arrays(): + self.check_sort_copy(pyfunc, cfunc, orig) + + def test_np_sort_float(self): + pyfunc = np_sort_usecase + cfunc = jit(nopython=True)(pyfunc) + + for size in (5, 20, 50, 500): + orig = np.random.random(size=size) * 100 + orig[np.random.random(size=size) < 0.1] = float('nan') + self.check_sort_copy(pyfunc, cfunc, orig) + + def test_np_sort_complex(self): + pyfunc = np_sort_usecase + cfunc = jit(nopython=True)(pyfunc) + + for size in (5, 20, 50, 500): + real = np.random.random(size=size) * 100 + imag = np.random.random(size=size) * 100 + real[np.random.random(size=size) < 0.1] = float('nan') + imag[np.random.random(size=size) < 0.1] = float('nan') + orig = np.array([complex(*x) for x in zip(real, imag)]) + self.check_sort_copy(pyfunc, cfunc, orig) + + def test_argsort_int(self): + def check(pyfunc): + cfunc = jit(nopython=True)(pyfunc) + for orig in self.int_arrays(): + self.check_argsort(pyfunc, cfunc, orig) + + check(argsort_usecase) + check(np_argsort_usecase) + + def test_argsort_kind_int(self): + def check(pyfunc, is_stable): + cfunc = jit(nopython=True)(pyfunc) + for orig in self.int_arrays(): + self.check_argsort(pyfunc, cfunc, orig, + dict(is_stable=is_stable)) + + check(argsort_kind_usecase, is_stable=True) + check(np_argsort_kind_usecase, is_stable=True) + check(argsort_kind_usecase, is_stable=False) + check(np_argsort_kind_usecase, is_stable=False) + + def test_argsort_float(self): + def check(pyfunc): + cfunc = jit(nopython=True)(pyfunc) + for orig in self.float_arrays(): + self.check_argsort(pyfunc, cfunc, orig) + + check(argsort_usecase) + check(np_argsort_usecase) + + def test_argsort_float_supplemental(self): + def check(pyfunc, is_stable): + cfunc = jit(nopython=True)(pyfunc) + for orig in self.float_arrays(): + self.check_argsort(pyfunc, cfunc, orig, + dict(is_stable=is_stable)) + + check(argsort_kind_usecase, is_stable=True) + check(np_argsort_kind_usecase, is_stable=True) + check(argsort_kind_usecase, is_stable=False) + check(np_argsort_kind_usecase, is_stable=False) + + def test_argsort_complex(self): + def check(pyfunc): + cfunc = jit(nopython=True)(pyfunc) + for real in self.float_arrays(): + imag = real[::] + np.random.shuffle(imag) + orig = np.array([complex(*x) for x in zip(real, imag)]) + self.check_argsort(pyfunc, cfunc, orig) + + check(argsort_usecase) + check(np_argsort_usecase) + + def test_argsort_complex_supplemental(self): + def check(pyfunc, is_stable): + cfunc = jit(nopython=True)(pyfunc) + for real in self.float_arrays(): + imag = real[::] + np.random.shuffle(imag) + orig = np.array([complex(*x) for x in zip(real, imag)]) + self.check_argsort(pyfunc, cfunc, orig, + dict(is_stable=is_stable)) + + check(argsort_kind_usecase, is_stable=True) + check(np_argsort_kind_usecase, is_stable=True) + check(argsort_kind_usecase, is_stable=False) + check(np_argsort_kind_usecase, is_stable=False) + + def test_bad_array(self): + cfunc = jit(nopython=True)(np_sort_usecase) + msg = '.*Argument "a" must be array-like.*' + with self.assertRaisesRegex(errors.TypingError, msg) as raises: + cfunc(None) + + +class TestPythonSort(TestCase): + + def test_list_sort(self): + pyfunc = list_sort_usecase + cfunc = jit(nopython=True)(pyfunc) + + for size in (20, 50, 500): + orig, ret = cfunc(size) + self.assertEqual(sorted(orig), ret) + self.assertNotEqual(orig, ret) # sanity check + + def test_list_sort_reverse(self): + pyfunc = list_sort_reverse_usecase + cfunc = jit(nopython=True)(pyfunc) + + for size in (20, 50, 500): + for b in (False, True): + orig, ret = cfunc(size, b) + self.assertEqual(sorted(orig, reverse=b), ret) + self.assertNotEqual(orig, ret) # sanity check + + def test_sorted(self): + pyfunc = sorted_usecase + cfunc = jit(nopython=True)(pyfunc) + + for size in (20, 50, 500): + orig = np.random.random(size=size) * 100 + expected = sorted(orig) + got = cfunc(orig) + self.assertPreciseEqual(got, expected) + self.assertNotEqual(list(orig), got) # sanity check + + def test_sorted_reverse(self): + pyfunc = sorted_reverse_usecase + cfunc = jit(nopython=True)(pyfunc) + size = 20 + + orig = np.random.random(size=size) * 100 + for b in (False, True): + expected = sorted(orig, reverse=b) + got = cfunc(orig, b) + self.assertPreciseEqual(got, expected) + self.assertNotEqual(list(orig), got) # sanity check + + +class TestMergeSort(TestCase): + def setUp(self): + np.random.seed(321) + + def check_argsort_stable(self, sorter, low, high, count): + # make data with high possibility of duplicated key + data = np.random.randint(low, high, count) + expect = np.argsort(data, kind='mergesort') + got = sorter(data) + np.testing.assert_equal(expect, got) + + def test_argsort_stable(self): + arglist = [ + (-2, 2, 5), + (-5, 5, 10), + (0, 10, 101), + (0, 100, 1003), + ] + imp = make_jit_mergesort(is_argsort=True) + toplevel = imp.run_mergesort + sorter = njit(lambda arr: toplevel(arr)) + for args in arglist: + self.check_argsort_stable(sorter, *args) + + +nop_compiler = lambda x:x + + +class TestSortSlashSortedWithKey(MemoryLeakMixin, TestCase): + + def test_01(self): + + a = [3, 1, 4, 1, 5, 9] + + @njit + def external_key(z): + return 1. / z + + @njit + def foo(x, key=None): + new_x = x[:] + new_x.sort(key=key) + return sorted(x[:], key=key), new_x + + self.assertPreciseEqual(foo(a[:]), foo.py_func(a[:])) + self.assertPreciseEqual(foo(a[:], external_key), + foo.py_func(a[:], external_key)) + + def test_02(self): + + a = [3, 1, 4, 1, 5, 9] + + @njit + def foo(x): + def closure_key(z): + return 1. / z + new_x = x[:] + new_x.sort(key=closure_key) + return sorted(x[:], key=closure_key), new_x + + self.assertPreciseEqual(foo(a[:]), foo.py_func(a[:])) + + def test_03(self): + + a = [3, 1, 4, 1, 5, 9] + + def gen(compiler): + + @compiler + def bar(x, func): + new_x = x[:] + new_x.sort(key=func) + return sorted(x[:], key=func), new_x + + @compiler + def foo(x): + def closure_escapee_key(z): + return 1. / z + return bar(x, closure_escapee_key) + + return foo + + self.assertPreciseEqual(gen(njit)(a[:]), gen(nop_compiler)(a[:])) + + def test_04(self): + + a = ['a','b','B','b','C','A'] + + @njit + def external_key(z): + return z.upper() + + @njit + def foo(x, key=None): + new_x = x[:] + new_x.sort(key=key) + return sorted(x[:], key=key), new_x + + self.assertPreciseEqual(foo(a[:]), foo.py_func(a[:])) + self.assertPreciseEqual(foo(a[:], external_key), + foo.py_func(a[:], external_key)) + + def test_05(self): + + a = ['a','b','B','b','C','A'] + + @njit + def external_key(z): + return z.upper() + + @njit + def foo(x, key=None, reverse=False): + new_x = x[:] + new_x.sort(key=key, reverse=reverse) + return (sorted(x[:], key=key, reverse=reverse), new_x) + + for key, rev in itertools.product((None, external_key), + (True, False, 1, -12, 0)): + self.assertPreciseEqual(foo(a[:], key, rev), + foo.py_func(a[:], key, rev)) + + def test_optional_on_key(self): + a = [3, 1, 4, 1, 5, 9] + + @njit + def foo(x, predicate): + if predicate: + def closure_key(z): + return 1. / z + else: + closure_key = None + + new_x = x[:] + new_x.sort(key=closure_key) + + return (sorted(x[:], key=closure_key), new_x) + + with self.assertRaises(errors.TypingError) as raises: + TF = True + foo(a[:], TF) + + msg = "Key must concretely be None or a Numba JIT compiled function" + self.assertIn(msg, str(raises.exception)) + + def test_exceptions_sorted(self): + + @njit + def foo_sorted(x, key=None, reverse=False): + return sorted(x[:], key=key, reverse=reverse) + + @njit + def foo_sort(x, key=None, reverse=False): + new_x = x[:] + new_x.sort(key=key, reverse=reverse) + return new_x + + @njit + def external_key(z): + return 1. / z + + a = [3, 1, 4, 1, 5, 9] + + for impl in (foo_sort, foo_sorted): + + # check illegal key + with self.assertRaises(errors.TypingError) as raises: + impl(a, key="illegal") + + expect = "Key must be None or a Numba JIT compiled function" + self.assertIn(expect, str(raises.exception)) + + # check illegal reverse + with self.assertRaises(errors.TypingError) as raises: + impl(a, key=external_key, reverse="go backwards") + + expect = "an integer is required for 'reverse'" + self.assertIn(expect, str(raises.exception)) + + +class TestArrayArgsort(MemoryLeakMixin, TestCase): + """Tests specific to array.argsort""" + + def test_exceptions(self): + + @njit + def nonliteral_kind(kind): + np.arange(5).argsort(kind=kind) + + # check non-literal kind + with self.assertRaises(errors.TypingError) as raises: + # valid spelling but not literal + nonliteral_kind('quicksort') + + expect = '"kind" must be a string literal' + self.assertIn(expect, str(raises.exception)) + + @njit + def unsupported_kwarg(): + np.arange(5).argsort(foo='') + + with self.assertRaises(errors.TypingError) as raises: + unsupported_kwarg() + + expect = "Unsupported keywords: ['foo']" + self.assertIn(expect, str(raises.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ssa.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ssa.py new file mode 100644 index 0000000000000000000000000000000000000000..49e28c05f2aaa6e1aee6411bba6700784da4d01e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ssa.py @@ -0,0 +1,631 @@ +""" +Tests for SSA reconstruction +""" +import sys +import copy +import logging + +import numpy as np + +from numba import njit, jit, types +from numba.core import errors, ir +from numba.core.compiler_machinery import FunctionPass, register_pass +from numba.core.compiler import DefaultPassBuilder, CompilerBase +from numba.core.untyped_passes import ReconstructSSA, PreserveIR +from numba.core.typed_passes import NativeLowering +from numba.extending import overload +from numba.tests.support import MemoryLeakMixin, TestCase, override_config + + +_DEBUG = False + +if _DEBUG: + # Enable debug logger on SSA reconstruction + ssa_logger = logging.getLogger("numba.core.ssa") + ssa_logger.setLevel(level=logging.DEBUG) + ssa_logger.addHandler(logging.StreamHandler(sys.stderr)) + + +class SSABaseTest(TestCase): + + def check_func(self, func, *args): + got = func(*copy.deepcopy(args)) + exp = func.py_func(*copy.deepcopy(args)) + self.assertEqual(got, exp) + + +class TestSSA(SSABaseTest): + """ + Contains tests to help isolate problems in SSA + """ + + def test_argument_name_reused(self): + @njit + def foo(x): + x += 1 + return x + + self.check_func(foo, 123) + + def test_if_else_redefine(self): + @njit + def foo(x, y): + z = x * y + if x < y: + z = x + else: + z = y + return z + + self.check_func(foo, 3, 2) + self.check_func(foo, 2, 3) + + def test_sum_loop(self): + @njit + def foo(n): + c = 0 + for i in range(n): + c += i + return c + + self.check_func(foo, 0) + self.check_func(foo, 10) + + def test_sum_loop_2vars(self): + @njit + def foo(n): + c = 0 + d = n + for i in range(n): + c += i + d += n + return c, d + + self.check_func(foo, 0) + self.check_func(foo, 10) + + def test_sum_2d_loop(self): + @njit + def foo(n): + c = 0 + for i in range(n): + for j in range(n): + c += j + c += i + return c + + self.check_func(foo, 0) + self.check_func(foo, 10) + + def check_undefined_var(self, should_warn): + @njit + def foo(n): + if n: + if n > 0: + c = 0 + return c + else: + # variable c is not defined in this branch + c += 1 + return c + + if should_warn: + with self.assertWarns(errors.NumbaWarning) as warns: + # n=1 so we won't actually run the branch with the uninitialized + self.check_func(foo, 1) + self.assertIn("Detected uninitialized variable c", + str(warns.warning)) + else: + self.check_func(foo, 1) + + with self.assertRaises(UnboundLocalError): + foo.py_func(0) + + def test_undefined_var(self): + with override_config('ALWAYS_WARN_UNINIT_VAR', 0): + self.check_undefined_var(should_warn=False) + with override_config('ALWAYS_WARN_UNINIT_VAR', 1): + self.check_undefined_var(should_warn=True) + + def test_phi_propagation(self): + @njit + def foo(actions): + n = 1 + + i = 0 + ct = 0 + while n > 0 and i < len(actions): + n -= 1 + + while actions[i]: + if actions[i]: + if actions[i]: + n += 10 + actions[i] -= 1 + else: + if actions[i]: + n += 20 + actions[i] += 1 + + ct += n + ct += n + return ct, n + + self.check_func(foo, np.array([1, 2])) + + def test_unhandled_undefined(self): + def function1(arg1, arg2, arg3, arg4, arg5): + # This function is auto-generated. + if arg1: + var1 = arg2 + var2 = arg3 + var3 = var2 + var4 = arg1 + return + else: + if arg2: + if arg4: + var5 = arg4 # noqa: F841 + return + else: + var6 = var4 + return + return var6 + else: + if arg5: + if var1: + if arg5: + var1 = var6 + return + else: + var7 = arg2 # noqa: F841 + return arg2 + return + else: + if var2: + arg5 = arg2 + return arg1 + else: + var6 = var3 + return var4 + return + return + else: + var8 = var1 + return + return var8 + var9 = var3 # noqa: F841 + var10 = arg5 # noqa: F841 + return var1 + + # The argument values is not critical for re-creating the bug + # because the bug is in compile-time. + expect = function1(2, 3, 6, 0, 7) + got = njit(function1)(2, 3, 6, 0, 7) + self.assertEqual(expect, got) + + +class TestReportedSSAIssues(SSABaseTest): + # Tests from issues + # https://github.com/numba/numba/issues?q=is%3Aopen+is%3Aissue+label%3ASSA + + def test_issue2194(self): + + @njit + def foo(): + V = np.empty(1) + s = np.uint32(1) + + for i in range(s): + V[i] = 1 + for i in range(s, 1): + pass + + self.check_func(foo, ) + + def test_issue3094(self): + + @njit + def doit(x): + return x + + @njit + def foo(pred): + if pred: + x = True + else: + x = False + # do something with x + return doit(x) + + self.check_func(foo, False) + + def test_issue3931(self): + + @njit + def foo(arr): + for i in range(1): + arr = arr.reshape(3 * 2) + arr = arr.reshape(3, 2) + return (arr) + + np.testing.assert_allclose(foo(np.zeros((3, 2))), + foo.py_func(np.zeros((3, 2)))) + + def test_issue3976(self): + + def overload_this(a): + return 'dummy' + + @njit + def foo(a): + if a: + s = 5 + s = overload_this(s) + else: + s = 'b' + + return s + + @overload(overload_this) + def ol(a): + return overload_this + + self.check_func(foo, True) + + def test_issue3979(self): + + @njit + def foo(A, B): + x = A[0] + y = B[0] + for i in A: + x = i + for i in B: + y = i + return x, y + + self.check_func(foo, (1, 2), ('A', 'B')) + + def test_issue5219(self): + + def overload_this(a, b=None): + if isinstance(b, tuple): + b = b[0] + return b + + @overload(overload_this) + def ol(a, b=None): + b_is_tuple = isinstance(b, (types.Tuple, types.UniTuple)) + + def impl(a, b=None): + if b_is_tuple is True: + b = b[0] + return b + return impl + + @njit + def test_tuple(a, b): + overload_this(a, b) + + self.check_func(test_tuple, 1, (2, )) + + def test_issue5223(self): + + @njit + def bar(x): + if len(x) == 5: + return x + x = x.copy() + for i in range(len(x)): + x[i] += 1 + return x + + a = np.ones(5) + a.flags.writeable = False + + np.testing.assert_allclose(bar(a), bar.py_func(a)) + + def test_issue5243(self): + + @njit + def foo(q): + lin = np.array((0.1, 0.6, 0.3)) + stencil = np.zeros((3, 3)) + stencil[0, 0] = q[0, 0] + return lin[0] + + self.check_func(foo, np.zeros((2, 2))) + + def test_issue5482_missing_variable_init(self): + # Test error that lowering fails because variable is missing + # a definition before use. + @njit("(intp, intp, intp)") + def foo(x, v, n): + for i in range(n): + if i == 0: + if i == x: + pass + else: + problematic = v + else: + if i == x: + pass + else: + problematic = problematic + v + return problematic + + def test_issue5482_objmode_expr_null_lowering(self): + # Existing pipelines will not have the Expr.null in objmode. + # We have to create a custom pipeline to force a SSA reconstruction + # and stripping. + from numba.core.compiler import CompilerBase, DefaultPassBuilder + from numba.core.untyped_passes import ReconstructSSA, IRProcessing + from numba.core.typed_passes import PreLowerStripPhis + + class CustomPipeline(CompilerBase): + def define_pipelines(self): + pm = DefaultPassBuilder.define_objectmode_pipeline(self.state) + # Force SSA reconstruction and stripping + pm.add_pass_after(ReconstructSSA, IRProcessing) + pm.add_pass_after(PreLowerStripPhis, ReconstructSSA) + pm.finalize() + return [pm] + + @jit("(intp, intp, intp)", looplift=False, + pipeline_class=CustomPipeline) + def foo(x, v, n): + for i in range(n): + if i == n: + if i == x: + pass + else: + problematic = v + else: + if i == x: + pass + else: + problematic = problematic + v + return problematic + + def test_issue5493_unneeded_phi(self): + # Test error that unneeded phi is inserted because variable does not + # have a dominance definition. + data = (np.ones(2), np.ones(2)) + A = np.ones(1) + B = np.ones((1,1)) + + def foo(m, n, data): + if len(data) == 1: + v0 = data[0] + else: + v0 = data[0] + # Unneeded PHI node for `problematic` would be placed here + for _ in range(1, len(data)): + v0 += A + + for t in range(1, m): + for idx in range(n): + t = B + + if idx == 0: + if idx == n - 1: + pass + else: + problematic = t + else: + if idx == n - 1: + pass + else: + problematic = problematic + t + return problematic + + expect = foo(10, 10, data) + res1 = njit(foo)(10, 10, data) + res2 = jit(forceobj=True, looplift=False)(foo)(10, 10, data) + np.testing.assert_array_equal(expect, res1) + np.testing.assert_array_equal(expect, res2) + + def test_issue5623_equal_statements_in_same_bb(self): + + def foo(pred, stack): + i = 0 + c = 1 + + if pred is True: + stack[i] = c + i += 1 + stack[i] = c + i += 1 + + python = np.array([0, 666]) + foo(True, python) + + nb = np.array([0, 666]) + njit(foo)(True, nb) + + expect = np.array([1, 1]) + + np.testing.assert_array_equal(python, expect) + np.testing.assert_array_equal(nb, expect) + + def test_issue5678_non_minimal_phi(self): + # There should be only one phi for variable "i" + + from numba.core.compiler import CompilerBase, DefaultPassBuilder + from numba.core.untyped_passes import ( + ReconstructSSA, FunctionPass, register_pass, + ) + + phi_counter = [] + + @register_pass(mutates_CFG=False, analysis_only=True) + class CheckSSAMinimal(FunctionPass): + # A custom pass to count the number of phis + + _name = self.__class__.__qualname__ + ".CheckSSAMinimal" + + def __init__(self): + super().__init__(self) + + def run_pass(self, state): + ct = 0 + for blk in state.func_ir.blocks.values(): + ct += len(list(blk.find_exprs('phi'))) + phi_counter.append(ct) + return True + + class CustomPipeline(CompilerBase): + def define_pipelines(self): + pm = DefaultPassBuilder.define_nopython_pipeline(self.state) + pm.add_pass_after(CheckSSAMinimal, ReconstructSSA) + pm.finalize() + return [pm] + + @njit(pipeline_class=CustomPipeline) + def while_for(n, max_iter=1): + a = np.empty((n,n)) + i = 0 + while i <= max_iter: + for j in range(len(a)): + for k in range(len(a)): + a[j,k] = j + k + i += 1 + return a + + # Runs fine? + self.assertPreciseEqual(while_for(10), while_for.py_func(10)) + # One phi? + self.assertEqual(phi_counter, [1]) + + def test_issue9242_use_not_dom_def(self): + from numba.core.ir import FunctionIR + from numba.core.compiler_machinery import ( + AnalysisPass, + register_pass, + ) + + def check(fir: FunctionIR): + [blk, *_] = fir.blocks.values() + var = blk.scope.get("d") + defn = fir.get_definition(var) + self.assertEqual(defn.op, "phi") + self.assertIn(ir.UNDEFINED, defn.incoming_values) + + @register_pass(mutates_CFG=False, analysis_only=True) + class SSACheck(AnalysisPass): + """ + Check SSA on variable `d` + """ + + _name = "SSA_Check" + + def __init__(self): + AnalysisPass.__init__(self) + + def run_pass(self, state): + check(state.func_ir) + return False + + class SSACheckPipeline(CompilerBase): + """Inject SSACheck pass into the default pipeline following the SSA + pass + """ + + def define_pipelines(self): + pipeline = DefaultPassBuilder.define_nopython_pipeline( + self.state, "ssa_check_custom_pipeline") + + pipeline._finalized = False + pipeline.add_pass_after(SSACheck, ReconstructSSA) + + pipeline.finalize() + return [pipeline] + + @njit(pipeline_class=SSACheckPipeline) + def py_func(a): + c = a > 0 + if c: + d = a + 5 # d is only defined here; undef in the else branch + + return c and d > 0 + + py_func(10) + + +class TestSROAIssues(MemoryLeakMixin, TestCase): + # This tests issues related to the SROA optimization done in lowering, which + # reduces time spent in the LLVM SROA pass. The optimization is related to + # SSA and tries to reduce the number of alloca statements for variables with + # only a single assignment. + def test_issue7258_multiple_assignment_post_SSA(self): + # This test adds a pass that will duplicate assignment statements to + # variables named "foobar". + # In the reported issue, the bug will cause a memory leak. + cloned = [] + + @register_pass(analysis_only=False, mutates_CFG=True) + class CloneFoobarAssignments(FunctionPass): + # A pass that clones variable assignments into "foobar" + _name = "clone_foobar_assignments_pass" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + mutated = False + for blk in state.func_ir.blocks.values(): + to_clone = [] + # find assignments to "foobar" + for assign in blk.find_insts(ir.Assign): + if assign.target.name == "foobar": + to_clone.append(assign) + # clone + for assign in to_clone: + clone = copy.deepcopy(assign) + blk.insert_after(clone, assign) + mutated = True + # keep track of cloned statements + cloned.append(clone) + return mutated + + class CustomCompiler(CompilerBase): + def define_pipelines(self): + pm = DefaultPassBuilder.define_nopython_pipeline( + self.state, "custom_pipeline", + ) + pm._finalized = False + # Insert the cloning pass after SSA + pm.add_pass_after(CloneFoobarAssignments, ReconstructSSA) + # Capture IR post lowering + pm.add_pass_after(PreserveIR, NativeLowering) + pm.finalize() + return [pm] + + @njit(pipeline_class=CustomCompiler) + def udt(arr): + foobar = arr + 1 # this assignment will be cloned + return foobar + + arr = np.arange(10) + # Verify that the function works as expected + self.assertPreciseEqual(udt(arr), arr + 1) + # Verify that the expected statement is cloned + self.assertEqual(len(cloned), 1) + self.assertEqual(cloned[0].target.name, "foobar") + # Verify in the Numba IR that the expected statement is cloned + nir = udt.overloads[udt.signatures[0]].metadata['preserved_ir'] + self.assertEqual(len(nir.blocks), 1, + "only one block") + [blk] = nir.blocks.values() + assigns = blk.find_insts(ir.Assign) + foobar_assigns = [stmt for stmt in assigns + if stmt.target.name == "foobar"] + self.assertEqual( + len(foobar_assigns), 2, + "expected two assignment statements into 'foobar'", + ) + self.assertEqual( + foobar_assigns[0], foobar_assigns[1], + "expected the two assignment statements to be the same", + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_stencils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_stencils.py new file mode 100644 index 0000000000000000000000000000000000000000..a06a737a944ab58bf4d974f04dcc270e8a00fd24 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_stencils.py @@ -0,0 +1,3223 @@ +# +# Copyright (c) 2017 Intel Corporation +# SPDX-License-Identifier: BSD-2-Clause +# + +import numpy as np +from contextlib import contextmanager + +import numba +from numba import njit, stencil +from numba.core import types, registry +from numba.core.compiler import compile_extra, Flags +from numba.core.cpu import ParallelOptions +from numba.tests.support import skip_parfors_unsupported, _32bit +from numba.core.errors import LoweringError, TypingError, NumbaValueError +import unittest + + +skip_unsupported = skip_parfors_unsupported + + +@stencil +def stencil1_kernel(a): + return 0.25 * (a[0, 1] + a[1, 0] + a[0, -1] + a[-1, 0]) + + +@stencil(neighborhood=((-5, 0), )) +def stencil2_kernel(a): + cum = a[-5] + for i in range(-4, 1): + cum += a[i] + return 0.3 * cum + + +@stencil(cval=1.0) +def stencil3_kernel(a): + return 0.25 * a[-2, 2] + + +@stencil +def stencil_multiple_input_kernel(a, b): + return 0.25 * (a[0, 1] + a[1, 0] + a[0, -1] + a[-1, 0] + + b[0, 1] + b[1, 0] + b[0, -1] + b[-1, 0]) + + +@stencil +def stencil_multiple_input_kernel_var(a, b, w): + return w * (a[0, 1] + a[1, 0] + a[0, -1] + a[-1, 0] + + b[0, 1] + b[1, 0] + b[0, -1] + b[-1, 0]) + + +@stencil +def stencil_multiple_input_mixed_types_2d(a, b, f): + return a[0, 0] if f[0, 0] else b[0, 0] + + +@stencil(standard_indexing=("b",)) +def stencil_with_standard_indexing_1d(a, b): + return a[-1] * b[0] + a[0] * b[1] + + +@stencil(standard_indexing=("b",)) +def stencil_with_standard_indexing_2d(a, b): + return (a[0, 1] * b[0, 1] + a[1, 0] * b[1, 0] + + a[0, -1] * b[0, -1] + a[-1, 0] * b[-1, 0]) + + +@njit +def addone_njit(a): + return a + 1 + + +if not _32bit: # prevent compilation on unsupported 32bit targets + @njit(parallel=True) + def addone_pjit(a): + return a + 1 + + +class TestStencilBase(unittest.TestCase): + + _numba_parallel_test_ = False + + def __init__(self, *args): + # flags for njit() + self.cflags = Flags() + self.cflags.nrt = True + + super(TestStencilBase, self).__init__(*args) + + def _compile_this(self, func, sig, flags): + return compile_extra(registry.cpu_target.typing_context, + registry.cpu_target.target_context, func, sig, + None, flags, {}) + + def compile_parallel(self, func, sig, **kws): + flags = Flags() + flags.nrt = True + options = True if not kws else kws + flags.auto_parallel = ParallelOptions(options) + return self._compile_this(func, sig, flags) + + def compile_njit(self, func, sig): + return self._compile_this(func, sig, flags=self.cflags) + + def compile_all(self, pyfunc, *args, **kwargs): + sig = tuple([numba.typeof(x) for x in args]) + # compile with parallel=True + cpfunc = self.compile_parallel(pyfunc, sig) + # compile a standard njit of the original function + cfunc = self.compile_njit(pyfunc, sig) + return cfunc, cpfunc + + def check(self, no_stencil_func, pyfunc, *args): + cfunc, cpfunc = self.compile_all(pyfunc, *args) + # results without stencil macro + expected = no_stencil_func(*args) + # python result + py_output = pyfunc(*args) + + # njit result + njit_output = cfunc.entry_point(*args) + + # parfor result + parfor_output = cpfunc.entry_point(*args) + + np.testing.assert_almost_equal(py_output, expected, decimal=3) + np.testing.assert_almost_equal(njit_output, expected, decimal=3) + np.testing.assert_almost_equal(parfor_output, expected, decimal=3) + + # make sure parfor set up scheduling + self.assertIn('@do_scheduling', cpfunc.library.get_llvm_str()) + + +class TestStencil(TestStencilBase): + + def __init__(self, *args, **kwargs): + super(TestStencil, self).__init__(*args, **kwargs) + + @skip_unsupported + def test_stencil1(self): + """Tests whether the optional out argument to stencil calls works. + """ + def test_with_out(n): + A = np.arange(n**2).reshape((n, n)) + B = np.zeros(n**2).reshape((n, n)) + B = stencil1_kernel(A, out=B) + return B + + def test_without_out(n): + A = np.arange(n**2).reshape((n, n)) + B = stencil1_kernel(A) + return B + + def test_impl_seq(n): + A = np.arange(n**2).reshape((n, n)) + B = np.zeros(n**2).reshape((n, n)) + for i in range(1, n - 1): + for j in range(1, n - 1): + B[i, j] = 0.25 * (A[i, j + 1] + + A[i + 1, j] + A[i, j - 1] + A[i - 1, j]) + return B + + n = 100 + self.check(test_impl_seq, test_with_out, n) + self.check(test_impl_seq, test_without_out, n) + + @skip_unsupported + def test_stencil2(self): + """Tests whether the optional neighborhood argument to the stencil + decorate works. + """ + def test_seq(n): + A = np.arange(n) + B = stencil2_kernel(A) + return B + + def test_impl_seq(n): + A = np.arange(n) + B = np.zeros(n) + for i in range(5, len(A)): + B[i] = 0.3 * sum(A[i - 5:i + 1]) + return B + + n = 100 + self.check(test_impl_seq, test_seq, n) + # variable length neighborhood in numba.stencil call + # only supported in parallel path + + def test_seq(n, w): + A = np.arange(n) + + def stencil2_kernel(a, w): + cum = a[-w] + for i in range(-w + 1, w + 1): + cum += a[i] + return 0.3 * cum + B = numba.stencil(stencil2_kernel, neighborhood=((-w, w), ))(A, w) + return B + + def test_impl_seq(n, w): + A = np.arange(n) + B = np.zeros(n) + for i in range(w, len(A) - w): + B[i] = 0.3 * sum(A[i - w:i + w + 1]) + return B + n = 100 + w = 5 + cpfunc = self.compile_parallel(test_seq, (types.intp, types.intp)) + expected = test_impl_seq(n, w) + # parfor result + parfor_output = cpfunc.entry_point(n, w) + np.testing.assert_almost_equal(parfor_output, expected, decimal=3) + self.assertIn('@do_scheduling', cpfunc.library.get_llvm_str()) + # test index_offsets + + def test_seq(n, w, offset): + A = np.arange(n) + + def stencil2_kernel(a, w): + cum = a[-w + 1] + for i in range(-w + 1, w + 1): + cum += a[i + 1] + return 0.3 * cum + B = numba.stencil(stencil2_kernel, neighborhood=((-w, w), ), + index_offsets=(-offset, ))(A, w) + return B + + offset = 1 + cpfunc = self.compile_parallel(test_seq, (types.intp, types.intp, + types.intp)) + parfor_output = cpfunc.entry_point(n, w, offset) + np.testing.assert_almost_equal(parfor_output, expected, decimal=3) + self.assertIn('@do_scheduling', cpfunc.library.get_llvm_str()) + # test slice in kernel + + def test_seq(n, w, offset): + A = np.arange(n) + + def stencil2_kernel(a, w): + return 0.3 * np.sum(a[-w + 1:w + 2]) + B = numba.stencil(stencil2_kernel, neighborhood=((-w, w), ), + index_offsets=(-offset, ))(A, w) + return B + + offset = 1 + cpfunc = self.compile_parallel(test_seq, (types.intp, types.intp, + types.intp)) + parfor_output = cpfunc.entry_point(n, w, offset) + np.testing.assert_almost_equal(parfor_output, expected, decimal=3) + self.assertIn('@do_scheduling', cpfunc.library.get_llvm_str()) + + @skip_unsupported + def test_stencil3(self): + """Tests whether a non-zero optional cval argument to the stencil + decorator works. Also tests integer result type. + """ + def test_seq(n): + A = np.arange(n**2).reshape((n, n)) + B = stencil3_kernel(A) + return B + + test_njit = njit(test_seq) + test_par = njit(test_seq, parallel=True) + + n = 5 + seq_res = test_seq(n) + njit_res = test_njit(n) + par_res = test_par(n) + + self.assertTrue(seq_res[0, 0] == 1.0 and seq_res[4, 4] == 1.0) + self.assertTrue(njit_res[0, 0] == 1.0 and njit_res[4, 4] == 1.0) + self.assertTrue(par_res[0, 0] == 1.0 and par_res[4, 4] == 1.0) + + @skip_unsupported + def test_stencil_standard_indexing_1d(self): + """Tests standard indexing with a 1d array. + """ + def test_seq(n): + A = np.arange(n) + B = [3.0, 7.0] + C = stencil_with_standard_indexing_1d(A, B) + return C + + def test_impl_seq(n): + A = np.arange(n) + B = [3.0, 7.0] + C = np.zeros(n) + + for i in range(1, n): + C[i] = A[i - 1] * B[0] + A[i] * B[1] + return C + + n = 100 + self.check(test_impl_seq, test_seq, n) + + @skip_unsupported + def test_stencil_standard_indexing_2d(self): + """Tests standard indexing with a 2d array and multiple stencil calls. + """ + def test_seq(n): + A = np.arange(n**2).reshape((n, n)) + B = np.ones((3, 3)) + C = stencil_with_standard_indexing_2d(A, B) + D = stencil_with_standard_indexing_2d(C, B) + return D + + def test_impl_seq(n): + A = np.arange(n**2).reshape((n, n)) + B = np.ones((3, 3)) + C = np.zeros(n**2).reshape((n, n)) + D = np.zeros(n**2).reshape((n, n)) + + for i in range(1, n - 1): + for j in range(1, n - 1): + C[i, j] = (A[i, j + 1] * B[0, 1] + A[i + 1, j] * B[1, 0] + + A[i, j - 1] * B[0, -1] + A[i - 1, j] * B[-1, 0]) + for i in range(1, n - 1): + for j in range(1, n - 1): + D[i, j] = (C[i, j + 1] * B[0, 1] + C[i + 1, j] * B[1, 0] + + C[i, j - 1] * B[0, -1] + C[i - 1, j] * B[-1, 0]) + return D + + n = 5 + self.check(test_impl_seq, test_seq, n) + + @skip_unsupported + def test_stencil_multiple_inputs(self): + """Tests whether multiple inputs of the same size work. + """ + def test_seq(n): + A = np.arange(n**2).reshape((n, n)) + B = np.arange(n**2).reshape((n, n)) + C = stencil_multiple_input_kernel(A, B) + return C + + def test_impl_seq(n): + A = np.arange(n**2).reshape((n, n)) + B = np.arange(n**2).reshape((n, n)) + C = np.zeros(n**2).reshape((n, n)) + for i in range(1, n - 1): + for j in range(1, n - 1): + C[i, j] = 0.25 * \ + (A[i, j + 1] + A[i + 1, j] + + A[i, j - 1] + A[i - 1, j] + + B[i, j + 1] + B[i + 1, j] + + B[i, j - 1] + B[i - 1, j]) + return C + + n = 3 + self.check(test_impl_seq, test_seq, n) + # test stencil with a non-array input + + def test_seq(n): + A = np.arange(n**2).reshape((n, n)) + B = np.arange(n**2).reshape((n, n)) + w = 0.25 + C = stencil_multiple_input_kernel_var(A, B, w) + return C + self.check(test_impl_seq, test_seq, n) + + @skip_unsupported + def test_stencil_mixed_types(self): + def test_impl_seq(n): + A = np.arange(n ** 2).reshape((n, n)) + B = n ** 2 - np.arange(n ** 2).reshape((n, n)) + S = np.eye(n, dtype=np.bool_) + O = np.zeros((n, n), dtype=A.dtype) + for i in range(0, n): + for j in range(0, n): + O[i, j] = A[i, j] if S[i, j] else B[i, j] + return O + + def test_seq(n): + A = np.arange(n ** 2).reshape((n, n)) + B = n ** 2 - np.arange(n ** 2).reshape((n, n)) + S = np.eye(n, dtype=np.bool_) + O = stencil_multiple_input_mixed_types_2d(A, B, S) + return O + + n = 3 + self.check(test_impl_seq, test_seq, n) + + @skip_unsupported + def test_stencil_call(self): + """Tests 2D numba.stencil calls. + """ + def test_impl1(n): + A = np.arange(n**2).reshape((n, n)) + B = np.zeros(n**2).reshape((n, n)) + numba.stencil(lambda a: 0.25 * (a[0, 1] + a[1, 0] + a[0, -1] + + a[-1, 0]))(A, out=B) + return B + + def test_impl2(n): + A = np.arange(n**2).reshape((n, n)) + B = np.zeros(n**2).reshape((n, n)) + + def sf(a): + return 0.25 * (a[0, 1] + a[1, 0] + a[0, -1] + a[-1, 0]) + B = numba.stencil(sf)(A) + return B + + def test_impl_seq(n): + A = np.arange(n**2).reshape((n, n)) + B = np.zeros(n**2).reshape((n, n)) + for i in range(1, n - 1): + for j in range(1, n - 1): + B[i, j] = 0.25 * (A[i, j + 1] + A[i + 1, j] + + A[i, j - 1] + A[i - 1, j]) + return B + + n = 100 + self.check(test_impl_seq, test_impl1, n) + self.check(test_impl_seq, test_impl2, n) + + @skip_unsupported + def test_stencil_call_1D(self): + """Tests 1D numba.stencil calls. + """ + def test_impl(n): + A = np.arange(n) + B = np.zeros(n) + numba.stencil(lambda a: 0.3 * (a[-1] + a[0] + a[1]))(A, out=B) + return B + + def test_impl_seq(n): + A = np.arange(n) + B = np.zeros(n) + for i in range(1, n - 1): + B[i] = 0.3 * (A[i - 1] + A[i] + A[i + 1]) + return B + + n = 100 + self.check(test_impl_seq, test_impl, n) + + @skip_unsupported + def test_stencil_call_const(self): + """Tests numba.stencil call that has an index that can be inferred as + constant from a unary expr. Otherwise, this would raise an error since + neighborhood length is not specified. + """ + def test_impl1(n): + A = np.arange(n) + B = np.zeros(n) + c = 1 + numba.stencil(lambda a,c : 0.3 * (a[-c] + a[0] + a[c]))(A, c, out=B) + return B + + def test_impl2(n): + A = np.arange(n) + B = np.zeros(n) + c = 2 + numba.stencil( + lambda a,c : 0.3 * (a[1 - c] + a[0] + a[c - 1]))(A, c, out=B) + return B + + # recursive expr case + def test_impl3(n): + A = np.arange(n) + B = np.zeros(n) + c = 2 + numba.stencil( + lambda a,c : 0.3 * (a[-c + 1] + a[0] + a[c - 1]))(A, c, out=B) + return B + + # multi-constant case + def test_impl4(n): + A = np.arange(n) + B = np.zeros(n) + d = 1 + c = 2 + numba.stencil( + lambda a,c,d : 0.3 * (a[-c + d] + a[0] + a[c - d]))(A, c, d, + out=B) + return B + + def test_impl_seq(n): + A = np.arange(n) + B = np.zeros(n) + c = 1 + for i in range(1, n - 1): + B[i] = 0.3 * (A[i - c] + A[i] + A[i + c]) + return B + + n = 100 + # constant inference is only possible in parallel path + cpfunc1 = self.compile_parallel(test_impl1, (types.intp,)) + cpfunc2 = self.compile_parallel(test_impl2, (types.intp,)) + cpfunc3 = self.compile_parallel(test_impl3, (types.intp,)) + cpfunc4 = self.compile_parallel(test_impl4, (types.intp,)) + expected = test_impl_seq(n) + # parfor result + parfor_output1 = cpfunc1.entry_point(n) + parfor_output2 = cpfunc2.entry_point(n) + parfor_output3 = cpfunc3.entry_point(n) + parfor_output4 = cpfunc4.entry_point(n) + np.testing.assert_almost_equal(parfor_output1, expected, decimal=3) + np.testing.assert_almost_equal(parfor_output2, expected, decimal=3) + np.testing.assert_almost_equal(parfor_output3, expected, decimal=3) + np.testing.assert_almost_equal(parfor_output4, expected, decimal=3) + + # check error in regular Python path + with self.assertRaises(NumbaValueError) as e: + test_impl4(4) + + self.assertIn("stencil kernel index is not constant, " + "'neighborhood' option required", str(e.exception)) + # check error in njit path + # TODO: ValueError should be thrown instead of LoweringError + with self.assertRaises((LoweringError, NumbaValueError)) as e: + njit(test_impl4)(4) + + self.assertIn("stencil kernel index is not constant, " + "'neighborhood' option required", str(e.exception)) + + @skip_unsupported + def test_stencil_parallel_off(self): + """Tests 1D numba.stencil calls without parallel translation + turned off. + """ + def test_impl(A): + return numba.stencil(lambda a: 0.3 * (a[-1] + a[0] + a[1]))(A) + + cpfunc = self.compile_parallel(test_impl, (numba.float64[:],), + stencil=False) + self.assertNotIn('@do_scheduling', cpfunc.library.get_llvm_str()) + + @skip_unsupported + def test_stencil_nested1(self): + """Tests whether nested stencil decorator works. + """ + @njit(parallel=True) + def test_impl(n): + @stencil + def fun(a): + c = 2 + return a[-c + 1] + B = fun(n) + return B + + def test_impl_seq(n): + B = np.zeros(len(n), dtype=int) + for i in range(1, len(n)): + B[i] = n[i - 1] + return B + + n = np.arange(10) + np.testing.assert_equal(test_impl(n), test_impl_seq(n)) + + @skip_unsupported + def test_out_kwarg_w_cval(self): + """ Issue #3518, out kwarg did not work with cval.""" + # test const value that matches the arg dtype, and one that can be cast + const_vals = [7, 7.0] + + def kernel(a): + return (a[0, 0] - a[1, 0]) + + for const_val in const_vals: + stencil_fn = numba.stencil(kernel, cval=const_val) + + def wrapped(): + A = np.arange(12).reshape((3, 4)) + ret = np.ones_like(A) + stencil_fn(A, out=ret) + return ret + + # stencil function case + A = np.arange(12).reshape((3, 4)) + expected = np.full_like(A, -4) + expected[-1, :] = const_val + ret = np.ones_like(A) + stencil_fn(A, out=ret) + np.testing.assert_almost_equal(ret, expected) + + # wrapped function case, check njit, then njit(parallel=True) + impls = self.compile_all(wrapped,) + for impl in impls: + got = impl.entry_point() + np.testing.assert_almost_equal(got, expected) + + # now check exceptions for cval dtype mismatch with out kwarg dtype + stencil_fn = numba.stencil(kernel, cval=1j) + + def wrapped(): + A = np.arange(12).reshape((3, 4)) + ret = np.ones_like(A) + stencil_fn(A, out=ret) + return ret + + A = np.arange(12).reshape((3, 4)) + ret = np.ones_like(A) + with self.assertRaises(NumbaValueError) as e: + stencil_fn(A, out=ret) + msg = "cval type does not match stencil return type." + self.assertIn(msg, str(e.exception)) + + for compiler in [self.compile_njit, self.compile_parallel]: + try: + compiler(wrapped,()) + except (NumbaValueError, LoweringError) as e: + self.assertIn(msg, str(e)) + else: + raise AssertionError("Expected error was not raised") + + @skip_unsupported + def test_out_kwarg_w_cval_np_attr(self): + """ Test issue #7286 where the cval is a np attr/string-based numerical + constant""" + for cval in (np.nan, np.inf, -np.inf, float('inf'), -float('inf')): + def kernel(a): + return (a[0, 0] - a[1, 0]) + + stencil_fn = numba.stencil(kernel, cval=cval) + + def wrapped(): + A = np.arange(12.).reshape((3, 4)) + ret = np.ones_like(A) + stencil_fn(A, out=ret) + return ret + + # stencil function case + A = np.arange(12.).reshape((3, 4)) + expected = np.full_like(A, -4) + expected[-1, :] = cval + ret = np.ones_like(A) + stencil_fn(A, out=ret) + np.testing.assert_almost_equal(ret, expected) + + # wrapped function case, check njit, then njit(parallel=True) + impls = self.compile_all(wrapped,) + for impl in impls: + got = impl.entry_point() + np.testing.assert_almost_equal(got, expected) + + +@skip_unsupported +class TestManyStencils(TestStencilBase): + # NOTE: the original implementation of this test used manipulations of the + # Python AST repr of a kernel to create another implementation of the + # stencil being tested so to act as another reference point when + # comparing the various forms of @stencil calls. This implementation was + # based on the cPython 3.7 version of the AST and proved too much effort to + # continuously port to newer python versions. Ahead of dropping Python 3.7 + # support, all the kernel invocations were translated via the ``astor`` + # package ``astor.to_source()`` function to pure python source and this + # source was hardcoded into the tests themselves. In the following tests, + # regions demarked with dashed lines (----) and with the header + # "Autogenerated kernel" correspond to these translations. + + def __init__(self, *args, **kwargs): + super(TestManyStencils, self).__init__(*args, **kwargs) + + def check_against_expected(self, pyfunc, expected, *args, **kwargs): + """ + For a given kernel: + + The expected result is available from argument `expected`. + + The following results are then computed: + * from a pure @stencil decoration of the kernel. + * from the njit of a trivial wrapper function around the pure @stencil + decorated function. + * from the njit(parallel=True) of a trivial wrapper function around + the pure @stencil decorated function. + + The results are then compared. + """ + + options = kwargs.get('options', dict()) + expected_exception = kwargs.get('expected_exception') + + # DEBUG print output arrays + DEBUG_OUTPUT = False + + # collect fails + should_fail = [] + should_not_fail = [] + + # runner that handles fails + @contextmanager + def errorhandler(exty=None, usecase=None): + try: + yield + except Exception as e: + if exty is not None: + lexty = exty if hasattr(exty, '__iter__') else [exty, ] + found = False + for ex in lexty: + found |= isinstance(e, ex) + if not found: + raise + else: + should_not_fail.append( + (usecase, "%s: %s" % + (type(e), str(e)))) + else: + if exty is not None: + should_fail.append(usecase) + + if isinstance(expected_exception, dict): + stencil_ex = expected_exception['stencil'] + njit_ex = expected_exception['njit'] + parfor_ex = expected_exception['parfor'] + else: + stencil_ex = expected_exception + njit_ex = expected_exception + parfor_ex = expected_exception + + stencil_args = {'func_or_mode': pyfunc} + stencil_args.update(options) + + stencilfunc_output = None + with errorhandler(stencil_ex, "@stencil"): + stencil_func_impl = stencil(**stencil_args) + # stencil result + stencilfunc_output = stencil_func_impl(*args) + + # wrapped stencil impl, could this be generated? + if len(args) == 1: + def wrap_stencil(arg0): + return stencil_func_impl(arg0) + elif len(args) == 2: + def wrap_stencil(arg0, arg1): + return stencil_func_impl(arg0, arg1) + elif len(args) == 3: + def wrap_stencil(arg0, arg1, arg2): + return stencil_func_impl(arg0, arg1, arg2) + else: + raise ValueError( + "Up to 3 arguments can be provided, found %s" % + len(args)) + + sig = tuple([numba.typeof(x) for x in args]) + + njit_output = None + with errorhandler(njit_ex, "njit"): + wrapped_cfunc = self.compile_njit(wrap_stencil, sig) + # njit result + njit_output = wrapped_cfunc.entry_point(*args) + + parfor_output = None + with errorhandler(parfor_ex, "parfors"): + wrapped_cpfunc = self.compile_parallel(wrap_stencil, sig) + # parfor result + parfor_output = wrapped_cpfunc.entry_point(*args) + + if DEBUG_OUTPUT: + print("\n@stencil_output:\n", stencilfunc_output) + print("\nnjit_output:\n", njit_output) + print("\nparfor_output:\n", parfor_output) + + try: + if not stencil_ex: + np.testing.assert_almost_equal( + stencilfunc_output, expected, decimal=1) + self.assertEqual(expected.dtype, stencilfunc_output.dtype) + except Exception as e: + should_not_fail.append( + ('@stencil', "%s: %s" % + (type(e), str(e)))) + print("@stencil failed: %s" % str(e)) + + try: + if not njit_ex: + np.testing.assert_almost_equal( + njit_output, expected, decimal=1) + self.assertEqual(expected.dtype, njit_output.dtype) + except Exception as e: + should_not_fail.append(('njit', "%s: %s" % (type(e), str(e)))) + print("@njit failed: %s" % str(e)) + + try: + if not parfor_ex: + np.testing.assert_almost_equal( + parfor_output, expected, decimal=1) + self.assertEqual(expected.dtype, parfor_output.dtype) + try: + self.assertIn( + '@do_scheduling', + wrapped_cpfunc.library.get_llvm_str()) + except AssertionError: + msg = 'Could not find `@do_scheduling` in LLVM IR' + raise AssertionError(msg) + except Exception as e: + should_not_fail.append( + ('parfors', "%s: %s" % + (type(e), str(e)))) + print("@njit(parallel=True) failed: %s" % str(e)) + + if DEBUG_OUTPUT: + print("\n\n") + + if should_fail: + msg = ["%s" % x for x in should_fail] + raise RuntimeError(("The following implementations should have " + "raised an exception but did not:\n%s") % msg) + + if should_not_fail: + impls = ["%s" % x[0] for x in should_not_fail] + errs = ''.join(["%s: Message: %s\n\n" % + x for x in should_not_fail]) + str1 = ("The following implementations should not have raised an " + "exception but did:\n%s\n" % impls) + str2 = "Errors were:\n\n%s" % errs + raise RuntimeError(str1 + str2) + + def check_exceptions(self, pyfunc, *args, **kwargs): + """ + For a given kernel: + + The expected result is computed from a pyStencil version of the + stencil. + + The following results are then computed: + * from a pure @stencil decoration of the kernel. + * from the njit of a trivial wrapper function around the pure @stencil + decorated function. + * from the njit(parallel=True) of a trivial wrapper function around + the pure @stencil decorated function. + + The results are then compared. + """ + options = kwargs.get('options', dict()) + expected_exception = kwargs.get('expected_exception') + + # collect fails + should_fail = [] + should_not_fail = [] + + # runner that handles fails + @contextmanager + def errorhandler(exty=None, usecase=None): + try: + yield + except Exception as e: + if exty is not None: + lexty = exty if hasattr(exty, '__iter__') else [exty, ] + found = False + for ex in lexty: + found |= isinstance(e, ex) + if not found: + raise + else: + should_not_fail.append( + (usecase, "%s: %s" % + (type(e), str(e)))) + else: + if exty is not None: + should_fail.append(usecase) + + if isinstance(expected_exception, dict): + stencil_ex = expected_exception['stencil'] + njit_ex = expected_exception['njit'] + parfor_ex = expected_exception['parfor'] + else: + stencil_ex = expected_exception + njit_ex = expected_exception + parfor_ex = expected_exception + + stencil_args = {'func_or_mode': pyfunc} + stencil_args.update(options) + + with errorhandler(stencil_ex, "@stencil"): + stencil_func_impl = stencil(**stencil_args) + # stencil result + stencil_func_impl(*args) + + # wrapped stencil impl, could this be generated? + if len(args) == 1: + def wrap_stencil(arg0): + return stencil_func_impl(arg0) + elif len(args) == 2: + def wrap_stencil(arg0, arg1): + return stencil_func_impl(arg0, arg1) + elif len(args) == 3: + def wrap_stencil(arg0, arg1, arg2): + return stencil_func_impl(arg0, arg1, arg2) + else: + raise ValueError( + "Up to 3 arguments can be provided, found %s" % + len(args)) + + sig = tuple([numba.typeof(x) for x in args]) + + with errorhandler(njit_ex, "njit"): + wrapped_cfunc = self.compile_njit(wrap_stencil, sig) + # njit result + wrapped_cfunc.entry_point(*args) + + with errorhandler(parfor_ex, "parfors"): + wrapped_cpfunc = self.compile_parallel(wrap_stencil, sig) + # parfor result + wrapped_cpfunc.entry_point(*args) + + if should_fail: + msg = ["%s" % x for x in should_fail] + raise RuntimeError(("The following implementations should have " + "raised an exception but did not:\n%s") % msg) + + if should_not_fail: + impls = ["%s" % x[0] for x in should_not_fail] + errs = ''.join(["%s: Message: %s\n\n" % + x for x in should_not_fail]) + str1 = ("The following implementations should not have raised an " + "exception but did:\n%s\n" % impls) + str2 = "Errors were:\n\n%s" % errs + raise RuntimeError(str1 + str2) + + def exception_dict(self, **kwargs): + d = dict() + d['pyStencil'] = None + d['stencil'] = None + d['njit'] = None + d['parfor'] = None + for k, v in kwargs.items(): + d[k] = v + return d + + def check_stencil_arrays(self, *args, **kwargs): + neighborhood = kwargs.get('neighborhood') + init_shape = args[0].shape + if neighborhood is not None: + if len(init_shape) != len(neighborhood): + raise ValueError('Invalid neighborhood supplied') + for x in args[1:]: + if hasattr(x, 'shape'): + if init_shape != x.shape: + raise ValueError('Input stencil arrays do not commute') + + def test_basic00(self): + """rel index""" + def kernel(a): + return a[0, 0] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 0] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic01(self): + """rel index add const""" + def kernel(a): + return a[0, 1] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 1] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic02(self): + """rel index add const""" + def kernel(a): + return a[0, -1] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1]): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + -1] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic03(self): + """rel index add const""" + def kernel(a): + return a[1, 0] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = a[__a + 1, __b + 0] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic04(self): + """rel index add const""" + def kernel(a): + return a[-1, 0] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(1, a.shape[0]): + __b0[__a, __b] = a[__a + -1, __b + 0] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic05(self): + """rel index add const""" + def kernel(a): + return a[-1, 1] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(1, a.shape[0]): + __b0[__a, __b] = a[__a + -1, __b + 1] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic06(self): + """rel index add const""" + def kernel(a): + return a[1, -1] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1]): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = a[__a + 1, __b + -1] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic07(self): + """rel index add const""" + def kernel(a): + return a[1, 1] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = a[__a + 1, __b + 1] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic08(self): + """rel index add const""" + def kernel(a): + return a[-1, -1] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1]): + for __a in range(1, a.shape[0]): + __b0[__a, __b] = a[__a + -1, __b + -1] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic09(self): + """rel index add const""" + def kernel(a): + return a[-2, 2] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 2): + for __a in range(2, a.shape[0]): + __b0[__a, __b] = a[__a + -2, __b + 2] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic10(self): + """rel index add const""" + def kernel(a): + return a[0, 0] + a[1, 0] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = a[__a + 0, __b + 0] + a[__a + 1, __b + 0] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic11(self): + """rel index add const""" + def kernel(a): + return a[-1, 0] + a[1, 0] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(1, a.shape[0] - 1): + __b0[__a, __b] = a[__a + -1, __b + 0] + a[__a + 1, __b + 0] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic12(self): + """rel index add const""" + def kernel(a): + return a[-1, 1] + a[1, -1] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1] - 1): + for __a in range(1, a.shape[0] - 1): + __b0[__a, __b] = a[__a + -1, __b + 1] + a[__a + 1, __b + -1] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic13(self): + """rel index add const""" + def kernel(a): + return a[-1, -1] + a[1, 1] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1] - 1): + for __a in range(1, a.shape[0] - 1): + __b0[__a, __b] = a[__a + -1, __b + -1] + a[__a + 1, __b + 1] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic14(self): + """rel index add domain change const""" + def kernel(a): + return a[0, 0] + 1j + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 0] + 1.0j + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic14b(self): + """rel index add domain change const""" + def kernel(a): + t = 1.j + return a[0, 0] + t + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0]): + t = 1.0j + __b0[__a, __b] = a[__a + 0, __b + 0] + t + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic15(self): + """two rel index, add const""" + def kernel(a): + return a[0, 0] + a[1, 0] + 1. + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + 0, __b + 0] + + a[__a + 1, __b + 0] + 1.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic17(self): + """two rel index boundary test, add const""" + def kernel(a): + return a[0, 0] + a[2, 0] + 1. + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0] - 2): + __b0[__a, __b] = (a[__a + 0, __b + 0] + + a[__a + 2, __b + 0] + 1.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic18(self): + """two rel index boundary test, add const""" + def kernel(a): + return a[0, 0] + a[-2, 0] + 1. + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(2, a.shape[0]): + __b0[__a, __b] = (a[__a + 0, __b + 0] + + a[__a + -2, __b + 0] + 1.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic19(self): + """two rel index boundary test, add const""" + def kernel(a): + return a[0, 0] + a[0, 3] + 1. + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 3): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = (a[__a + 0, __b + 0] + + a[__a + 0, __b + 3] + 1.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic20(self): + """two rel index boundary test, add const""" + def kernel(a): + return a[0, 0] + a[0, -3] + 1. + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(3, a.shape[1]): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = (a[__a + 0, __b + 0] + + a[__a + 0, __b + -3] + 1.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic21(self): + """same rel, add const""" + def kernel(a): + return a[0, 0] + a[0, 0] + 1. + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = (a[__a + 0, __b + 0] + + a[__a + 0, __b + 0] + 1.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic22(self): + """rel idx const expr folding, add const""" + def kernel(a): + return a[1 + 0, 0] + a[0, 0] + 1. + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + 1, __b + 0] + + a[__a + 0, __b + 0] + 1.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic23(self): + """rel idx, work in body""" + def kernel(a): + x = np.sin(10 + a[2, 1]) + return a[1 + 0, 0] + a[0, 0] + x + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0] - 2): + x = np.sin(10 + a[__a + 2, __b + 1]) + __b0[__a, __b] = (a[__a + 1, __b + 0] + + a[__a + 0, __b + 0] + x) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic23a(self): + """rel idx, dead code should not impact rel idx""" + def kernel(a): + x = np.sin(10 + a[2, 1]) # noqa: F841 # dead code expected + return a[1 + 0, 0] + a[0, 0] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0] - 2): + x = np.sin(10 + a[__a + 2, __b + 1]) # noqa: F841 + __b0[__a, __b] = a[__a + 1, __b + 0] + a[__a + 0, __b + 0] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic24(self): + """1d idx on 2d arr""" + a = np.arange(12).reshape(3, 4) + + def kernel(a): + return a[0] + 1. + + self.check_exceptions(kernel, a, expected_exception=[TypingError,]) + + def test_basic25(self): + """no idx on 2d arr""" + a = np.arange(12).reshape(3, 4) + + def kernel(a): + return 1. + self.check_exceptions(kernel, a, expected_exception=[ValueError, + NumbaValueError,]) + + def test_basic26(self): + """3d arr""" + + def kernel(a): + return a[0, 0, 0] - a[0, 1, 0] + 1. + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __c in range(0, a.shape[2]): + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b, __c] = (a[__a + 0, __b + 0, __c + 0] - + a[__a + 0, __b + 1, __c + 0] + + 1.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(64).reshape(4, 8, 2) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic27(self): + """4d arr""" + def kernel(a): + return a[0, 0, 0, 0] - a[0, 1, 0, -1] + 1. + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __d in range(1, a.shape[3]): + for __c in range(0, a.shape[2]): + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b, __c, __d] = (a[__a + 0, __b + 0, + __c + 0, __d + 0] - + a[__a + 0, __b + 1, + __c + 0, __d + -1] + + 1.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(128).reshape(4, 8, 2, 2) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic28(self): + """type widen """ + def kernel(a): + return a[0, 0] + np.float64(10.) + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 0] + np.float64(10.0) + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12).reshape(3, 4).astype(np.float32) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic29(self): + """const index from func """ + a = np.arange(12.).reshape(3, 4) + + def kernel(a): + return a[0, int(np.cos(0))] + self.check_exceptions(kernel, a, expected_exception=[ValueError, + NumbaValueError, + LoweringError]) + + def test_basic30(self): + """signed zeros""" + def kernel(a): + return a[-0, -0] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + -0, __b + -0] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12).reshape(3, 4).astype(np.float32) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic31(self): + """does a const propagate? 2D""" + def kernel(a): + t = 1 + return a[t, 0] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0] - 1): + t = 1 + __b0[__a, __b] = a[__a + t, __b + 0] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12).reshape(3, 4).astype(np.float32) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + @unittest.skip("constant folding not implemented") + def test_basic31b(self): + """does a const propagate?""" + a = np.arange(12.).reshape(3, 4) # noqa: F841 + + def kernel(a): + s = 1 + t = 1 - s + return a[t, 0] + + #TODO: add check should this be implemented + + def test_basic31c(self): + """does a const propagate? 1D""" + def kernel(a): + t = 1 + return a[t] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __a in range(0, a.shape[0] - 1): + t = 1 + __b0[__a,] = a[__a + t] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic32(self): + """typed int index""" + a = np.arange(12.).reshape(3, 4) + + def kernel(a): + return a[np.int8(1), 0] + self.check_exceptions(kernel, a, expected_exception=[ValueError, + NumbaValueError, + LoweringError]) + + def test_basic33(self): + """add 0d array""" + def kernel(a): + return a[0, 0] + np.array(1) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 0] + np.array(1) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic34(self): + """More complex rel index with dependency on addition rel index""" + def kernel(a): + g = 4. + a[0, 1] + return g + (a[0, 1] + a[1, 0] + a[0, -1] + np.sin(a[-2, 0])) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1] - 1): + for __a in range(2, a.shape[0] - 1): + g = 4.0 + a[__a + 0, __b + 1] + __b0[__a, __b] = g + (a[__a + 0, __b + 1] + + a[__a + 1, __b + 0] + + a[__a + 0, __b + -1] + + np.sin(a[__a + -2, __b + 0])) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(144).reshape(12, 12) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic35(self): + """simple cval where cval is int but castable to dtype of float""" + def kernel(a): + return a[0, 1] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 5, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 1] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a, options={'cval': 5}) + + def test_basic36(self): + """more complex with cval""" + def kernel(a): + return a[0, 1] + a[0, -1] + a[1, -1] + a[1, -1] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 5.0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1] - 1): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + 0, __b + 1] + + a[__a + 0, __b + -1] + + a[__a + 1, __b + -1] + + a[__a + 1, __b + -1]) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a, options={'cval': 5}) + + def test_basic37(self): + """cval is expr""" + def kernel(a): + return a[0, 1] + a[0, -1] + a[1, -1] + a[1, -1] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 68.0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1] - 1): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + 0, __b + 1] + + a[__a + 0, __b + -1] + + a[__a + 1, __b + -1] + + a[__a + 1, __b + -1]) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a, + options={'cval': 5 + 63.}) + + def test_basic38(self): + """cval is complex""" + def kernel(a): + return a[0, 1] + a[0, -1] + a[1, -1] + a[1, -1] + a = np.arange(12.).reshape(3, 4) + ex = self.exception_dict( + stencil=NumbaValueError, + parfor=NumbaValueError, + njit=NumbaValueError) + self.check_exceptions(kernel, a, options={'cval': 1.j}, + expected_exception=ex) + + def test_basic39(self): + """cval is func expr""" + def kernel(a): + return a[0, 1] + a[0, -1] + a[1, -1] + a[1, -1] + + cval = np.sin(3.) + np.cos(2) + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, cval, dtype=type(__retdtype)) + for __b in range(1, a.shape[1] - 1): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + 0, __b + 1] + + a[__a + 0, __b + -1] + + a[__a + 1, __b + -1] + + a[__a + 1, __b + -1]) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a, + options={'cval': cval}) + + def test_basic40(self): + """2 args!""" + def kernel(a, b): + return a[0, 1] + b[0, -2] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, b, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(2, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 1] + b[__a + 0, __b + -2] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, None) + self.check_against_expected(kernel, expected, a, b) + + def test_basic41(self): + """2 args! rel arrays wildly not same size!""" + def kernel(a, b): + return a[0, 1] + b[0, -2] + a = np.arange(12.).reshape(3, 4) + b = np.arange(1.).reshape(1, 1) + self.check_exceptions(kernel, a, b, expected_exception=[ValueError, + AssertionError]) + + def test_basic42(self): + """2 args! rel arrays very close in size""" + def kernel(a, b): + return a[0, 1] + b[0, -2] + a = np.arange(12.).reshape(3, 4) + b = np.arange(9.).reshape(3, 3) + self.check_exceptions(kernel, a, b, expected_exception=[ValueError, + AssertionError]) + + def test_basic43(self): + """2 args more complexity""" + def kernel(a, b): + return a[0, 1] + a[1, 2] + b[-2, 0] + b[0, -1] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, b, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1] - 2): + for __a in range(2, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + 0, __b + 1] + + a[__a + 1, __b + 2] + + b[__a + -2, __b + 0] + + b[__a + 0, __b + -1]) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(30.).reshape(5, 6) + b = np.arange(30.).reshape(5, 6) + expected = __kernel(a, b, None) + self.check_against_expected(kernel, expected, a, b) + + def test_basic44(self): + """2 args, has assignment before use""" + def kernel(a, b): + a[0, 1] = 12 + return a[0, 1] + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + self.check_exceptions(kernel, a, b, expected_exception=[NumbaValueError, + LoweringError]) + + def test_basic45(self): + """2 args, has assignment and then cross dependency""" + def kernel(a, b): + a[0, 1] = 12 + return a[0, 1] + a[1, 0] + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + self.check_exceptions(kernel, a, b, expected_exception=[NumbaValueError, + LoweringError]) + + def test_basic46(self): + """2 args, has cross relidx assignment""" + def kernel(a, b): + a[0, 1] = b[1, 2] + return a[0, 1] + a[1, 0] + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + self.check_exceptions(kernel, a, b, expected_exception=[NumbaValueError, + LoweringError]) + + def test_basic47(self): + """3 args""" + def kernel(a, b, c): + return a[0, 1] + b[1, 0] + c[-1, 0] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, c, neighborhood): + self.check_stencil_arrays(a, b, c, neighborhood=neighborhood) + __retdtype = kernel(a, b, c) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(1, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + 0, __b + 1] + + b[__a + 1, __b + 0] + + c[__a + -1, __b + 0]) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + c = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, c, None) + self.check_against_expected(kernel, expected, a, b, c) + + # matches pyStencil, but all ought to fail + # probably hard to detect? + def test_basic48(self): + """2 args, has assignment before use via memory alias""" + def kernel(a): + c = a.T + c[:, :] = 10 + return a[0, 1] + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a,neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + c = a.T + c[:, :] = 10 + __b0[__a, __b] = a[__a + 0, __b + 1] + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic49(self): + """2 args, standard_indexing on second""" + def kernel(a, b): + return a[0, 1] + b[0, 3] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 1] + b[0, 3] + return __b0 + + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, None) + self.check_against_expected(kernel, expected, a, b, + options={'standard_indexing': 'b'}) + + @unittest.skip("dynamic range checking not implemented") + def test_basic50(self): + """2 args, standard_indexing OOB""" + def kernel(a, b): + return a[0, 1] + b[0, 15] + #TODO: add check should this be implemented + + def test_basic51(self): + """2 args, standard_indexing, no relidx""" + def kernel(a, b): + return a[0, 1] + b[0, 2] + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + self.check_exceptions(kernel, a, b, + options={'standard_indexing': ['a', 'b']}, + expected_exception=[ValueError, NumbaValueError]) + + def test_basic52(self): + """3 args, standard_indexing on middle arg """ + def kernel(a, b, c): + return a[0, 1] + b[0, 1] + c[1, 2] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, c, neighborhood): + self.check_stencil_arrays(a, c, neighborhood=neighborhood) + __retdtype = kernel(a, b, c) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 2): + for __a in range(0, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + 0, __b + 1] + b[0, 1] + + c[__a + 1, __b + 2]) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(4.).reshape(2, 2) + c = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, c, None) + self.check_against_expected(kernel, expected, a, b, c, + options={'standard_indexing': 'b'}) + + def test_basic53(self): + """2 args, standard_indexing on variable that does not exist""" + def kernel(a, b): + return a[0, 1] + b[0, 2] + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + ex = self.exception_dict( + stencil=Exception, + parfor=NumbaValueError, + njit=Exception) + self.check_exceptions(kernel, a, b, options={'standard_indexing': 'c'}, + expected_exception=ex) + + def test_basic54(self): + """2 args, standard_indexing, index from var""" + def kernel(a, b): + t = 2 + return a[0, 1] + b[0, t] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + t = 2 + __b0[__a, __b] = a[__a + 0, __b + 1] + b[0, t] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, None) + self.check_against_expected(kernel, expected, a, b, + options={'standard_indexing': 'b'}) + + def test_basic55(self): + """2 args, standard_indexing, index from more complex var""" + def kernel(a, b): + s = 1 + t = 2 - s + return a[0, 1] + b[0, t] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + s = 1 + t = 2 - s + __b0[__a, __b] = a[__a + 0, __b + 1] + b[0, t] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, None) + self.check_against_expected(kernel, expected, a, b, + options={'standard_indexing': 'b'}) + + def test_basic56(self): + """2 args, standard_indexing, added complexity """ + def kernel(a, b): + s = 1 + acc = 0 + for k in b[0, :]: + acc += k + t = 2 - s - 1 + return a[0, 1] + b[0, t] + acc + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + s = 1 + acc = 0 + for k in b[(0), :]: + acc += k + t = 2 - s - 1 + __b0[__a, __b] = a[__a + 0, __b + 1] + b[0, t] + acc + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, None) + self.check_against_expected(kernel, expected, a, b, + options={'standard_indexing': 'b'}) + + def test_basic57(self): + """2 args, standard_indexing, split index operation """ + def kernel(a, b): + c = b[0] + return a[0, 1] + c[1] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + c = b[0] + __b0[__a, __b] = a[__a + 0, __b + 1] + c[1] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, None) + self.check_against_expected(kernel, expected, a, b, + options={'standard_indexing': 'b'}) + + def test_basic58(self): + """2 args, standard_indexing, split index with broadcast mutation """ + def kernel(a, b): + c = b[0] + 1 + return a[0, 1] + c[1] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + c = b[0] + 1 + __b0[__a, __b] = a[__a + 0, __b + 1] + c[1] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, None) + self.check_against_expected(kernel, expected, a, b, + options={'standard_indexing': 'b'}) + + def test_basic59(self): + """3 args, mix of array, relative and standard indexing and const""" + def kernel(a, b, c): + return a[0, 1] + b[1, 1] + c + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, c, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a, b, c) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 1] + b[1, 1] + c + return __b0 + # ---------------------------------------------------------------------- + + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + c = 10 + expected = __kernel(a, b, c, None) + self.check_against_expected(kernel, expected, a, b, c, + options={'standard_indexing': ['b', 'c']}) + + def test_basic60(self): + """3 args, mix of array, relative and standard indexing, + tuple pass through""" + def kernel(a, b, c): + return a[0, 1] + b[1, 1] + c[0] + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + c = (10,) + # parfors does not support tuple args for stencil kernels + ex = self.exception_dict(parfor=NumbaValueError) + self.check_exceptions(kernel, a, b, c, + options={'standard_indexing': ['b', 'c']}, + expected_exception=ex) + + def test_basic61(self): + """2 args, standard_indexing on first""" + def kernel(a, b): + return a[0, 1] + b[1, 1] + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + self.check_exceptions(kernel, a, b, + options={'standard_indexing': 'a'}, + expected_exception=Exception) + + def test_basic62(self): + """2 args, standard_indexing and cval""" + def kernel(a, b): + return a[0, 1] + b[1, 1] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 10.0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = a[__a + 0, __b + 1] + b[1, 1] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(12.).reshape(3, 4) + b = np.arange(12.).reshape(3, 4) + expected = __kernel(a, b, None) + self.check_against_expected(kernel, expected, a, b, + options={'standard_indexing': 'b', + 'cval': 10.}) + + def test_basic63(self): + """2 args, standard_indexing applied to relative, should fail, + non-const idx""" + def kernel(a, b): + return a[0, b[0, 1]] + a = np.arange(12.).reshape(3, 4) + b = np.arange(12).reshape(3, 4) + ex = self.exception_dict( + stencil=NumbaValueError, + parfor=NumbaValueError, + njit=NumbaValueError) + self.check_exceptions(kernel, a, b, options={'standard_indexing': 'b'}, + expected_exception=ex) + + # stencil, njit, parfors all fail. Does this make sense? + def test_basic64(self): + """1 arg that uses standard_indexing""" + def kernel(a): + return a[0, 0] + a = np.arange(12.).reshape(3, 4) + self.check_exceptions(kernel, a, options={'standard_indexing': 'a'}, + expected_exception=[ValueError, NumbaValueError]) + + def test_basic65(self): + """basic induced neighborhood test""" + def kernel(a): + cumul = 0 + for i in range(-29, 1): + cumul += a[i] + return cumul / 30 + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __an in range(29, a.shape[0]): + cumul = 0 + for i in range(-29, 1): + cumul += a[__an + i] + __b0[__an,] = cumul / 30 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(60.) + nh = ((-29, 0),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + # Should this work? a[0] is out of neighborhood? + def test_basic66(self): + """basic const neighborhood test""" + def kernel(a): + cumul = 0 + for i in range(-29, 1): + cumul += a[0] + return cumul / 30 + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __an in range(29, a.shape[0]): + cumul = 0 + for i in range(-29, 1): + cumul += a[__an + 0] + __b0[__an,] = cumul / 30 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(60.) + nh = ((-29, 0),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic67(self): + """basic 2d induced neighborhood test""" + def kernel(a): + cumul = 0 + for i in range(-5, 1): + for j in range(-10, 1): + cumul += a[i, j] + return cumul / (10 * 5) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(10, a.shape[1]): + for __an in range(5, a.shape[0]): + cumul = 0 + for i in range(-5, 1): + for j in range(-10, 1): + cumul += a[__an + i, __bn + j] + __b0[__an, __bn] = cumul / 50 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + nh = ((-5, 0), (-10, 0),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic67b(self): + """basic 2d induced 1D neighborhood""" + def kernel(a): + cumul = 0 + for j in range(-10, 1): + cumul += a[0, j] + return cumul / (10 * 5) + a = np.arange(10. * 20.).reshape(10, 20) + self.check_exceptions(kernel, a, options={'neighborhood': ((-10, 0),)}, + expected_exception=[TypingError, ValueError]) + + # Should this work or is it UB? a[i, 0] is out of neighborhood? + def test_basic68(self): + """basic 2d one induced, one cost neighborhood test""" + def kernel(a): + cumul = 0 + for i in range(-5, 1): + for j in range(-10, 1): + cumul += a[i, 0] + return cumul / (10 * 5) + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(10, a.shape[1]): + for __an in range(5, a.shape[0]): + cumul = 0 + for i in range(-5, 1): + for j in range(-10, 1): + cumul += a[__an + i, __bn + 0] + __b0[__an, __bn] = cumul / 50 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + nh = ((-5, 0), (-10, 0),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + # Should this work or is it UB? a[0, 0] is out of neighborhood? + def test_basic69(self): + """basic 2d two cost neighborhood test""" + def kernel(a): + cumul = 0 + for i in range(-5, 1): + for j in range(-10, 1): + cumul += a[0, 0] + return cumul / (10 * 5) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(10, a.shape[1]): + for __an in range(5, a.shape[0]): + cumul = 0 + for i in range(-5, 1): + for j in range(-10, 1): + cumul += a[__an + 0, __bn + 0] + __b0[__an, __bn] = cumul / 50 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + nh = ((-5, 0), (-10, 0),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic70(self): + """neighborhood adding complexity""" + def kernel(a): + cumul = 0 + zz = 12. + for i in range(-5, 1): + t = zz + i + for j in range(-10, 1): + cumul += a[i, j] + t + return cumul / (10 * 5) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(10, a.shape[1]): + for __an in range(5, a.shape[0]): + cumul = 0 + zz = 12.0 + for i in range(-5, 1): + t = zz + i + for j in range(-10, 1): + cumul += a[__an + i, __bn + j] + t + __b0[__an, __bn] = cumul / 50 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + nh = ((-5, 0), (-10, 0),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic71(self): + """neighborhood, type change""" + def kernel(a): + cumul = 0 + for i in range(-29, 1): + k = 0. + if i > -15: + k = 1j + cumul += a[i] + k + return cumul / 30 + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __an in range(29, a.shape[0]): + cumul = 0 + for i in range(-29, 1): + k = 0.0 + if i > -15: + k = 1.0j + cumul += a[__an + i] + k + __b0[__an,] = cumul / 30 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(60.) + nh = ((-29, 0),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic72(self): + """neighborhood, narrower range than specified""" + def kernel(a): + cumul = 0 + for i in range(-19, -3): + cumul += a[i] + return cumul / 30 + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __an in range(29, a.shape[0]): + cumul = 0 + for i in range(-19, -3): + cumul += a[__an + i] + __b0[__an,] = cumul / 30 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(60.) + nh = ((-29, 0),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic73(self): + """neighborhood, +ve range""" + def kernel(a): + cumul = 0 + for i in range(5, 11): + cumul += a[i] + return cumul / 30 + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __an in range(0, a.shape[0] - 10): + cumul = 0 + for i in range(5, 11): + cumul += a[__an + i] + __b0[__an,] = cumul / 30 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(60.) + nh = ((5, 10),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic73b(self): + """neighborhood, -ve range""" + def kernel(a): + cumul = 0 + for i in range(-10, -4): + cumul += a[i] + return cumul / 30 + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __an in range(10, a.shape[0]): + cumul = 0 + for i in range(-10, -4): + cumul += a[__an + i] + __b0[__an,] = cumul / 30 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(60.) + nh = ((-10, -5),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic74(self): + """neighborhood, -ve->+ve range span""" + def kernel(a): + cumul = 0 + for i in range(-5, 11): + cumul += a[i] + return cumul / 30 + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __an in range(5, a.shape[0] - 10): + cumul = 0 + for i in range(-5, 11): + cumul += a[__an + i] + __b0[__an,] = cumul / 30 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(60.) + nh = ((-5, 10),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic75(self): + """neighborhood, -ve->-ve range span""" + def kernel(a): + cumul = 0 + for i in range(-10, -1): + cumul += a[i] + return cumul / 30 + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __an in range(10, a.shape[0]): + cumul = 0 + for i in range(-10, -1): + cumul += a[__an + i] + __b0[__an,] = cumul / 30 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(60.) + nh = ((-10, -2),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic76(self): + """neighborhood, mixed range span""" + def kernel(a): + cumul = 0 + zz = 12. + for i in range(-3, 0): + t = zz + i + for j in range(-3, 4): + cumul += a[i, j] + t + return cumul / (10 * 5) + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(3, a.shape[1] - 3): + for __an in range(3, a.shape[0]): + cumul = 0 + zz = 12.0 + for i in range(-3, 0): + t = zz + i + for j in range(-3, 4): + cumul += a[__an + i, __bn + j] + t + __b0[__an, __bn] = cumul / 50 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + nh = ((-3, -1), (-3, 3),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + def test_basic77(self): + """ neighborhood, two args """ + def kernel(a, b): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[i, j] + b[i, j] + return cumul / (9.) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, b, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(3, a.shape[1]): + for __an in range(3, a.shape[0]): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += (a[__an + i, __bn + j] + + b[__an + i, __bn + j]) + __b0[__an, __bn] = cumul / 9.0 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + b = np.arange(10. * 20.).reshape(10, 20) + nh = ((-3, 0), (-3, 0),) + expected = __kernel(a, b, nh) + self.check_against_expected(kernel, expected, a, b, + options={'neighborhood': nh}) + + def test_basic78(self): + """ neighborhood, two args, -ve range, -ve range """ + def kernel(a, b): + cumul = 0 + for i in range(-6, -2): + for j in range(-7, -1): + cumul += a[i, j] + b[i, j] + return cumul / (9.) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, b, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(7, a.shape[1]): + for __an in range(6, a.shape[0]): + cumul = 0 + for i in range(-6, -2): + for j in range(-7, -1): + cumul += (a[__an + i, __bn + j] + + b[__an + i, __bn + j]) + __b0[__an, __bn] = cumul / 9.0 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(15. * 20.).reshape(15, 20) + b = np.arange(15. * 20.).reshape(15, 20) + nh = ((-6, -3), (-7, -2),) + expected = __kernel(a, b, nh) + self.check_against_expected(kernel, expected, a, b, + options={'neighborhood': nh}) + + def test_basic78b(self): + """ neighborhood, two args, -ve range, +ve range """ + def kernel(a, b): + cumul = 0 + for i in range(-6, -2): + for j in range(2, 10): + cumul += a[i, j] + b[i, j] + return cumul / (9.) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, b, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(0, a.shape[1] - 9): + for __an in range(6, a.shape[0]): + cumul = 0 + for i in range(-6, -2): + for j in range(2, 10): + cumul += (a[__an + i, __bn + j] + + b[__an + i, __bn + j]) + __b0[__an, __bn] = cumul / 9.0 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(15. * 20.).reshape(15, 20) + b = np.arange(15. * 20.).reshape(15, 20) + nh = ((-6, -3), (2, 9),) + expected = __kernel(a, b, nh) + self.check_against_expected(kernel, expected, a, b, + options={'neighborhood': nh}) + + def test_basic79(self): + """ neighborhood, two incompatible args """ + def kernel(a, b): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[i, j] + b[i, j] + return cumul / (9.) + a = np.arange(10. * 20.).reshape(10, 20) + b = np.arange(10. * 20.).reshape(10, 10, 2) + ex = self.exception_dict( + stencil=TypingError, + parfor=TypingError, + njit=TypingError) + self.check_exceptions(kernel, a, b, options={'neighborhood': + ((-3, 0), (-3, 0),)}, + expected_exception=ex) + + def test_basic80(self): + """ neighborhood, type change """ + def kernel(a, b): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[i, j] + b + return cumul / (9.) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, b, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(3, a.shape[1]): + for __an in range(3, a.shape[0]): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[__an + i, __bn + j] + b + __b0[__an, __bn] = cumul / 9.0 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + b = 12.j + nh = ((-3, 0), (-3, 0)) + expected = __kernel(a, b, nh) + self.check_against_expected(kernel, expected, a, b, + options={'neighborhood': nh}) + + def test_basic81(self): + """ neighborhood, dimensionally incompatible arrays """ + def kernel(a, b): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[i, j] + b[i] + return cumul / (9.) + a = np.arange(10. * 20.).reshape(10, 20) + b = a[0].copy() + ex = self.exception_dict( + stencil=TypingError, + parfor=AssertionError, + njit=TypingError) + self.check_exceptions(kernel, a, b, + options={'neighborhood': ((-3, 0), (-3, 0))}, + expected_exception=ex) + + def test_basic82(self): + """ neighborhood, with standard_indexing""" + def kernel(a, b): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[i, j] + b[1, 3] + return cumul / (9.) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, b, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(3, a.shape[1]): + for __an in range(3, a.shape[0]): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[__an + i, __bn + j] + b[1, 3] + __b0[__an, __bn] = cumul / 9.0 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + b = a.copy() + nh = ((-3, 0), (-3, 0)) + expected = __kernel(a, b, nh) + self.check_against_expected(kernel, expected, a, b, + options={'neighborhood': nh, + 'standard_indexing': 'b'}) + + def test_basic83(self): + """ neighborhood, with standard_indexing and cval""" + def kernel(a, b): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[i, j] + b[1, 3] + return cumul / (9.) + a = np.arange(10. * 20.).reshape(10, 20) + b = a.copy() + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, b, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 1.5, dtype=type(__retdtype)) + for __bn in range(3, a.shape[1]): + for __an in range(3, a.shape[0]): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[__an + i, __bn + j] + b[1, 3] + __b0[__an, __bn] = cumul / 9.0 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + b = a.copy() + nh = ((-3, 0), (-3, 0)) + expected = __kernel(a, b, nh) + self.check_against_expected(kernel, expected, a, b, + options={'neighborhood': nh, + 'standard_indexing': 'b', + 'cval': 1.5,}) + + def test_basic84(self): + """ kernel calls njit """ + def kernel(a): + return a[0, 0] + addone_njit(a[0, 1]) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = (a[__a + 0, __b + 0] + + addone_njit.py_func(a[__a + 0, __b + 1])) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic85(self): + """ kernel calls njit(parallel=True)""" + def kernel(a): + return a[0, 0] + addone_pjit(a[0, 1]) + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 1): + for __a in range(0, a.shape[0]): + __b0[__a, __b] = (a[__a + 0, __b + 0] + + addone_pjit.py_func(a[__a + 0, __b + 1])) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + # njit/parfors fail correctly, but the error message isn't very informative + def test_basic86(self): + """ bad kwarg """ + def kernel(a): + return a[0, 0] + + a = np.arange(10. * 20.).reshape(10, 20) + self.check_exceptions(kernel, a, options={'bad': 10}, + expected_exception=[ValueError, TypingError]) + + def test_basic87(self): + """ reserved arg name in use """ + def kernel(__sentinel__): + return __sentinel__[0, 0] + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(__sentinel__, neighborhood): + self.check_stencil_arrays(__sentinel__, neighborhood=neighborhood) + __retdtype = kernel(__sentinel__) + __b0 = np.full(__sentinel__.shape, 0, dtype=type(__retdtype)) + for __b in range(0, __sentinel__.shape[1]): + for __a in range(0, __sentinel__.shape[0]): + __b0[__a, __b] = __sentinel__[__a + 0, __b + 0] + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic88(self): + """ use of reserved word """ + def kernel(a, out): + return out * a[0, 1] + a = np.arange(12.).reshape(3, 4) + ex = self.exception_dict( + stencil=NumbaValueError, + parfor=NumbaValueError, + njit=NumbaValueError) + self.check_exceptions(kernel, a, 1.0, options={}, expected_exception=ex) + + def test_basic89(self): + """ basic multiple return""" + def kernel(a): + if a[0, 1] > 10: + return 10. + elif a[0, 3] < 8: + return a[0, 0] + else: + return 7. + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1] - 3): + for __a in range(0, a.shape[0]): + if a[__a + 0, __b + 1] > 10: + __b0[__a, __b] = 10.0 + elif a[__a + 0, __b + 3] < 8: + __b0[__a, __b] = a[__a + 0, __b + 0] + else: + __b0[__a, __b] = 7.0 + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic90(self): + """ neighborhood, with standard_indexing and cval, multiple returns""" + def kernel(a, b): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[i, j] + b[1, 3] + res = cumul / (9.) + if res > 200.0: + return res + 1.0 + else: + return res + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, b, neighborhood): + self.check_stencil_arrays(a, b, neighborhood=neighborhood) + __retdtype = kernel(a, b) + __b0 = np.full(a.shape, 1.5, dtype=type(__retdtype)) + for __bn in range(3, a.shape[1]): + for __an in range(3, a.shape[0]): + cumul = 0 + for i in range(-3, 1): + for j in range(-3, 1): + cumul += a[__an + i, __bn + j] + b[1, 3] + res = cumul / 9.0 + if res > 200.0: + __b0[__an, __bn] = res + 1.0 + else: + __b0[__an, __bn] = res + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + b = a.copy() + nh = ((-3, 0), (-3, 0)) + expected = __kernel(a, b, nh) + self.check_against_expected(kernel, expected, a, b, + options={'neighborhood': nh, + 'standard_indexing': 'b', + 'cval': 1.5,}) + + def test_basic91(self): + """ Issue #3454, const(int) == const(int) evaluating incorrectly. """ + def kernel(a): + b = 0 + if (2 == 0): + b = 2 + return a[0, 0] + b + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(0, a.shape[1]): + for __a in range(0, a.shape[0]): + b = 0 + if 2 == 0: + b = 2 + __b0[__a, __b] = a[__a + 0, __b + 0] + b + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(10. * 20.).reshape(10, 20) + expected = __kernel(a, None) + self.check_against_expected(kernel, expected, a) + + def test_basic92(self): + """ Issue #3497, bool return type evaluating incorrectly. """ + def kernel(a): + return (a[-1, -1] ^ a[-1, 0] ^ a[-1, 1] ^ + a[0, -1] ^ a[0, 0] ^ a[0, 1] ^ + a[1, -1] ^ a[1, 0] ^ a[1, 1]) + + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __b in range(1, a.shape[1] - 1): + for __a in range(1, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + -1, __b + -1] ^ + a[__a + -1, __b + 0] ^ + a[__a + -1, __b + 1] ^ + a[__a + 0, __b + -1] ^ + a[__a + 0, __b + 0] ^ + a[__a + 0, __b + 1] ^ + a[__a + 1, __b + -1] ^ + a[__a + 1, __b + 0] ^ + a[__a + 1, __b + 1]) + return __b0 + # ---------------------------------------------------------------------- + A = np.array(np.arange(20) % 2).reshape(4, 5).astype(np.bool_) + expected = __kernel(A, None) + self.check_against_expected(kernel, expected, A) + + def test_basic93(self): + """ Issue #3497, bool return type evaluating incorrectly. """ + def kernel(a): + return (a[-1, -1] ^ a[-1, 0] ^ a[-1, 1] ^ + a[0, -1] ^ a[0, 0] ^ a[0, 1] ^ + a[1, -1] ^ a[1, 0] ^ a[1, 1]) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 1, dtype=type(__retdtype)) + for __b in range(1, a.shape[1] - 1): + for __a in range(1, a.shape[0] - 1): + __b0[__a, __b] = (a[__a + -1, __b + -1] ^ + a[__a + -1, __b + 0] ^ + a[__a + -1, __b + 1] ^ + a[__a + 0, __b + -1] ^ + a[__a + 0, __b + 0] ^ + a[__a + 0, __b + 1] ^ + a[__a + 1, __b + -1] ^ + a[__a + 1, __b + 0] ^ + a[__a + 1, __b + 1]) + return __b0 + # ---------------------------------------------------------------------- + A = np.array(np.arange(20) % 2).reshape(4, 5).astype(np.bool_) + expected = __kernel(A, None) + self.check_against_expected(kernel, expected, A, options={'cval': True}) + + def test_basic94(self): + """ Issue #3528. Support for slices. """ + def kernel(a): + return np.median(a[-1:2, -1:2]) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __bn in range(1, a.shape[1] - 1): + for __an in range(1, a.shape[0] - 1): + __b0[__an, __bn] = np.median(a[__an + -1:__an + 2, + __bn + -1:__bn + 2]) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(20, dtype=np.uint32).reshape(4, 5) + nh = ((-1, 1), (-1, 1),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + @unittest.skip("not yet supported") + def test_basic95(self): + """ Slice, calculate neighborhood. """ + def kernel(a): + return np.median(a[-1:2, -3:4]) + #TODO: add check should this be implemented + + def test_basic96(self): + """ 1D slice. """ + def kernel(a): + return np.median(a[-1:2]) + # ---------------------------------------------------------------------- + # Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, 0, dtype=type(__retdtype)) + for __an in range(1, a.shape[0] - 1): + __b0[__an,] = np.median(a[__an + -1:__an + 2]) + return __b0 + # ---------------------------------------------------------------------- + a = np.arange(20, dtype=np.uint32) + nh = ((-1, 1),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh}) + + @unittest.skip("not yet supported") + def test_basic97(self): + """ 2D slice and index. """ + def kernel(a): + return np.median(a[-1:2, 3]) + #TODO: add check should this be implemented + + def test_basic98(self): + """ Test issue #7286 where the cval is a np attr/string-based numerical + constant""" + for cval in (np.nan, np.inf, -np.inf, float('inf'), -float('inf')): + def kernel(a): + return a[0, 0] + ## ----------------------------------------------------------------- + ## Autogenerated kernel + + def __kernel(a, neighborhood): + self.check_stencil_arrays(a, neighborhood=neighborhood) + __retdtype = kernel(a) + __b0 = np.full(a.shape, cval, dtype=type(__retdtype)) + for __bn in range(1, a.shape[1] - 1): + for __an in range(1, a.shape[0] - 1): + __b0[__an, __bn] = a[__an + 0, __bn + 0] + return __b0 + + ## ----------------------------------------------------------------- + a = np.arange(6.).reshape((2, 3)) + nh = ((-1, 1), (-1, 1),) + expected = __kernel(a, nh) + self.check_against_expected(kernel, expected, a, + options={'neighborhood': nh, + 'cval':cval}) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_storeslice.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_storeslice.py new file mode 100644 index 0000000000000000000000000000000000000000..34950439b7b91026574e7b25713f23d9202bb5d5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_storeslice.py @@ -0,0 +1,68 @@ +import numpy as np + +import unittest +from numba import njit +from numba.core import types, errors +from numba.tests.support import TestCase + + +def setitem_slice(a, start, stop, step, scalar): + a[start:stop:step] = scalar + + +def usecase(obs, nPoints): + center = nPoints // 2 + obs[0:center] = np.arange(center) + obs[center] = 321 + obs[(center + 1):] = np.arange(nPoints - center - 1) + + +class TestStoreSlice(TestCase): + + def test_usecase(self): + n = 10 + obs_got = np.zeros(n) + obs_expected = obs_got.copy() + + cfunc = njit((types.float64[:], types.intp))(usecase) + cfunc(obs_got, n) + usecase(obs_expected, n) + + self.assertPreciseEqual(obs_got, obs_expected) + + def test_array_slice_setitem(self): + n = 10 + argtys = (types.int64[:], types.int64, types.int64, types.int64, + types.int64) + cfunc = njit(argtys)(setitem_slice) + a = np.arange(n, dtype=np.int64) + # tuple is (start, stop, step, scalar) + tests = ((2, 6, 1, 7), + (2, 6, -1, 7), + (-2, len(a), 2, 77), + (-2, 2 * len(a), 2, 77), + (-2, -6, 3, 88), + (-2, -6, -3, 9999), + (-6, -2, 4, 88), + (-6, -2, -4, 88), + (16, 20, 2, 88), + (16, 20, -2, 88), + ) + + for start, stop, step, scalar in tests: + a = np.arange(n, dtype=np.int64) + b = np.arange(n, dtype=np.int64) + cfunc(a, start, stop, step, scalar) + setitem_slice(b, start, stop, step, scalar) + self.assertPreciseEqual(a, b) + + # test if step = 0 + a = np.arange(n, dtype=np.int64) + with self.assertRaises(ValueError) as cm: + cfunc(a, 3, 6, 0, 88) + self.assertEqual(str(cm.exception), "slice step cannot be zero") + + +if __name__ == '__main__': + unittest.main() + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_struct_ref.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_struct_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..de52fdcf96218af9f3f607ae6fe8078ede521856 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_struct_ref.py @@ -0,0 +1,440 @@ +""" +Test mutable struct, aka, structref +""" +import warnings + +import numpy as np + +from numba import typed, njit, errors, typeof +from numba.core import types +from numba.experimental import structref +from numba.extending import overload_method, overload_attribute +from numba.tests.support import ( + MemoryLeakMixin, TestCase, temp_directory, override_config, +) + + +@structref.register +class MySimplerStructType(types.StructRef): + """ + Test associated with this type represent the lowest level uses of structref. + """ + pass + + +my_struct_ty = MySimplerStructType( + fields=[("values", types.intp[:]), ("counter", types.intp)] +) + +structref.define_boxing(MySimplerStructType, structref.StructRefProxy) + + +class MyStruct(structref.StructRefProxy): + + def __new__(cls, values, counter): + # Define this method to customize the constructor. + # The default takes `*args`. Customizing allow the use of keyword-arg. + # The impl of the method calls `StructRefProxy.__new__` + return structref.StructRefProxy.__new__(cls, values, counter) + + # The below defines wrappers for attributes and methods manually + + @property + def values(self): + return get_values(self) + + @values.setter + def values(self, val): + return set_values(self, val) + + @property + def counter(self): + return get_counter(self) + + def testme(self, arg): + return self.values * arg + self.counter + + @property + def prop(self): + return self.values, self.counter + + def __hash__(self): + return compute_fields(self) + + +@structref.register +class MyStructType(types.StructRef): + """Test associated with this type represent the higher-level uses of + structef. + """ + pass + + +# Call to define_proxy is needed to register the use of `MyStruct` as a +# PyObject proxy for creating a Numba-allocated structref. +# The `MyStruct` class can then be used in both jit-code and interpreted-code. +structref.define_proxy( + MyStruct, + MyStructType, + ['values', 'counter'], +) + + +@njit +def my_struct(values, counter): + st = structref.new(my_struct_ty) + my_struct_init(st, values, counter) + return st + + +@njit +def my_struct_init(self, values, counter): + self.values = values + self.counter = counter + + +@njit +def ctor_by_intrinsic(vs, ctr): + st = my_struct(vs, counter=ctr) + st.values += st.values + st.counter *= ctr + return st + + +@njit +def ctor_by_class(vs, ctr): + return MyStruct(values=vs, counter=ctr) + + +@njit +def get_values(st): + return st.values + + +@njit +def set_values(st, val): + st.values = val + + +@njit +def get_counter(st): + return st.counter + + +@njit +def compute_fields(st): + return st.values + st.counter + + +class TestStructRefBasic(MemoryLeakMixin, TestCase): + def test_structref_type(self): + sr = types.StructRef([('a', types.int64)]) + self.assertEqual(sr.field_dict['a'], types.int64) + sr = types.StructRef([('a', types.int64), ('b', types.float64)]) + self.assertEqual(sr.field_dict['a'], types.int64) + self.assertEqual(sr.field_dict['b'], types.float64) + # bad case + with self.assertRaisesRegex(ValueError, + "expecting a str for field name"): + types.StructRef([(1, types.int64)]) + with self.assertRaisesRegex(ValueError, + "expecting a Numba Type for field type"): + types.StructRef([('a', 123)]) + + def test_invalid_uses(self): + with self.assertRaisesRegex(ValueError, "cannot register"): + structref.register(types.StructRef) + with self.assertRaisesRegex(ValueError, "cannot register"): + structref.define_boxing(types.StructRef, MyStruct) + + def test_MySimplerStructType(self): + vs = np.arange(10, dtype=np.intp) + ctr = 13 + + first_expected = vs + vs + first_got = ctor_by_intrinsic(vs, ctr) + # the returned instance is a structref.StructRefProxy + # but not a MyStruct + self.assertNotIsInstance(first_got, MyStruct) + self.assertPreciseEqual(first_expected, get_values(first_got)) + + second_expected = first_expected + (ctr * ctr) + second_got = compute_fields(first_got) + self.assertPreciseEqual(second_expected, second_got) + + def test_MySimplerStructType_wrapper_has_no_attrs(self): + vs = np.arange(10, dtype=np.intp) + ctr = 13 + wrapper = ctor_by_intrinsic(vs, ctr) + self.assertIsInstance(wrapper, structref.StructRefProxy) + with self.assertRaisesRegex(AttributeError, 'values'): + wrapper.values + with self.assertRaisesRegex(AttributeError, 'counter'): + wrapper.counter + + def test_MyStructType(self): + vs = np.arange(10, dtype=np.float64) + ctr = 11 + + first_expected_arr = vs.copy() + first_got = ctor_by_class(vs, ctr) + self.assertIsInstance(first_got, MyStruct) + self.assertPreciseEqual(first_expected_arr, first_got.values) + + second_expected = first_expected_arr + ctr + second_got = compute_fields(first_got) + self.assertPreciseEqual(second_expected, second_got) + self.assertEqual(first_got.counter, ctr) + + def test_MyStructType_mixed_types(self): + # structref constructor is generic + @njit + def mixed_type(x, y, m, n): + return MyStruct(x, y), MyStruct(m, n) + + a, b = mixed_type(1, 2.3, 3.4j, (4,)) + self.assertEqual(a.values, 1) + self.assertEqual(a.counter, 2.3) + self.assertEqual(b.values, 3.4j) + self.assertEqual(b.counter, (4,)) + + def test_MyStructType_in_dict(self): + td = typed.Dict() + td['a'] = MyStruct(1, 2.3) + self.assertEqual(td['a'].values, 1) + self.assertEqual(td['a'].counter, 2.3) + # overwrite + td['a'] = MyStruct(2, 3.3) + self.assertEqual(td['a'].values, 2) + self.assertEqual(td['a'].counter, 3.3) + # mutate + td['a'].values += 10 + self.assertEqual(td['a'].values, 12) # changed + self.assertEqual(td['a'].counter, 3.3) # unchanged + # insert + td['b'] = MyStruct(4, 5.6) + + def test_MyStructType_in_dict_mixed_type_error(self): + self.disable_leak_check() + + td = typed.Dict() + td['a'] = MyStruct(1, 2.3) + self.assertEqual(td['a'].values, 1) + self.assertEqual(td['a'].counter, 2.3) + + # ERROR: store different types + with self.assertRaisesRegex(errors.TypingError, + r"Cannot cast numba.MyStructType"): + # because first field is not a float; + # the second field is now an integer. + td['b'] = MyStruct(2.3, 1) + + def test_MyStructType_hash_no_typeof_recursion(self): + # Tests that __hash__ is not called prematurely in typeof + # causing infinite recursion (see #8241). + st = MyStruct(1, 2) + typeof(st) + + self.assertEqual(hash(st), 3) + + +@overload_method(MyStructType, "testme") +def _ol_mystructtype_testme(self, arg): + def impl(self, arg): + return self.values * arg + self.counter + return impl + + +@overload_attribute(MyStructType, "prop") +def _ol_mystructtype_prop(self): + def get(self): + return self.values, self.counter + return get + + +class TestStructRefExtending(MemoryLeakMixin, TestCase): + def test_overload_method(self): + @njit + def check(x): + vs = np.arange(10, dtype=np.float64) + ctr = 11 + obj = MyStruct(vs, ctr) + return obj.testme(x) + + x = 3 + got = check(x) + expect = check.py_func(x) + self.assertPreciseEqual(got, expect) + + def test_overload_attribute(self): + @njit + def check(): + vs = np.arange(10, dtype=np.float64) + ctr = 11 + obj = MyStruct(vs, ctr) + return obj.prop + + got = check() + expect = check.py_func() + self.assertPreciseEqual(got, expect) + + +def caching_test_make(x, y): + struct = MyStruct(values=x, counter=y) + return struct + + +def caching_test_use(struct, z): + return struct.testme(z) + + +class TestStructRefCaching(MemoryLeakMixin, TestCase): + def setUp(self): + self._cache_dir = temp_directory(TestStructRefCaching.__name__) + self._cache_override = override_config('CACHE_DIR', self._cache_dir) + self._cache_override.__enter__() + warnings.simplefilter("error") + warnings.filterwarnings(action="ignore", module="typeguard") + + def tearDown(self): + self._cache_override.__exit__(None, None, None) + warnings.resetwarnings() + + def test_structref_caching(self): + def assert_cached(stats): + self.assertEqual(len(stats.cache_hits), 1) + self.assertEqual(len(stats.cache_misses), 0) + + def assert_not_cached(stats): + self.assertEqual(len(stats.cache_hits), 0) + self.assertEqual(len(stats.cache_misses), 1) + + def check(cached): + check_make = njit(cache=True)(caching_test_make) + check_use = njit(cache=True)(caching_test_use) + vs = np.random.random(3) + ctr = 17 + factor = 3 + st = check_make(vs, ctr) + got = check_use(st, factor) + expect = vs * factor + ctr + self.assertPreciseEqual(got, expect) + + if cached: + assert_cached(check_make.stats) + assert_cached(check_use.stats) + else: + assert_not_cached(check_make.stats) + assert_not_cached(check_use.stats) + + check(cached=False) + check(cached=True) + + +@structref.register +class PolygonStructType(types.StructRef): + + def preprocess_fields(self, fields): + # temp name to allow Optional instantiation + self.name = f"numba.PolygonStructType#{id(self)}" + fields = tuple([ + ('value', types.Optional(types.int64)), + ('parent', types.Optional(self)), + ]) + + return fields + + +polygon_struct_type = PolygonStructType(fields=( + ('value', types.Any), + ('parent', types.Any) +)) + + +class PolygonStruct(structref.StructRefProxy): + def __new__(cls, value, parent): + return structref.StructRefProxy.__new__(cls, value, parent) + + @property + def value(self): + return PolygonStruct_get_value(self) + + @property + def parent(self): + return PolygonStruct_get_parent(self) + + +@njit +def PolygonStruct_get_value(self): + return self.value + + +@njit +def PolygonStruct_get_parent(self): + return self.parent + + +structref.define_proxy( + PolygonStruct, + PolygonStructType, + ["value", "parent"] +) + + +@overload_method(PolygonStructType, "flip") +def _ol_polygon_struct_flip(self): + def impl(self): + if self.value is not None: + self.value = -self.value + return impl + + +@overload_attribute(PolygonStructType, "prop") +def _ol_polygon_struct_prop(self): + def get(self): + return self.value, self.parent + return get + + +class TestStructRefForwardTyping(MemoryLeakMixin, TestCase): + def test_same_type_assignment(self): + @njit + def check(x): + poly = PolygonStruct(None, None) + p_poly = PolygonStruct(None, None) + poly.value = x + poly.parent = p_poly + p_poly.value = x + return poly.parent.value + + x = 11 + got = check(x) + expect = x + self.assertPreciseEqual(got, expect) + + def test_overload_method(self): + @njit + def check(x): + poly = PolygonStruct(None, None) + p_poly = PolygonStruct(None, None) + poly.value = x + poly.parent = p_poly + p_poly.value = x + poly.flip() + poly.parent.flip() + return poly.parent.value + + x = 3 + got = check(x) + expect = -x + self.assertPreciseEqual(got, expect) + + def test_overload_attribute(self): + @njit + def check(): + obj = PolygonStruct(5, None) + return obj.prop[0] + + got = check() + expect = 5 + self.assertPreciseEqual(got, expect) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_support.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_support.py new file mode 100644 index 0000000000000000000000000000000000000000..e35eda1ff27ff5a97a5db447a36217cbdbcc47a2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_support.py @@ -0,0 +1,346 @@ +import itertools + +import numpy as np + +from numba import jit +from numba.core import utils +from numba.tests.support import TestCase, forbid_codegen +from .enum_usecases import * +import unittest + +DBL_EPSILON = 2**-52 +FLT_EPSILON = 2**-23 + +INF = float('inf') +NAN = float('nan') + + +class TestAssertPreciseEqual(TestCase): + """ + Tests for TestCase.assertPreciseEqual(). + """ + + int_types = [int] + np_float_types = [np.float32, np.float64] + float_types = [float] + np_float_types + np_complex_types = [np.complex64, np.complex128] + complex_types = [complex] + np_complex_types + bool_types = [bool, np.bool_] + + def eq(self, left, right, **kwargs): + def assert_succeed(left, right): + self.assertPreciseEqual(left, right, **kwargs) + self.assertPreciseEqual(right, left, **kwargs) + assert_succeed(left, right) + assert_succeed((left, left), (right, right)) + assert_succeed([left, left], [right, right]) + + def ne(self, left, right, **kwargs): + def assert_fail(left, right): + try: + self.assertPreciseEqual(left, right, **kwargs) + except AssertionError: + pass + else: + self.fail("%s and %s unexpectedly considered equal" % (left, right)) + assert_fail(left, right) + assert_fail(right, left) + assert_fail((left, left), (right, right)) + assert_fail((right, right), (left, left)) + assert_fail([left, left], [right, right]) + assert_fail([right, right], [left, left]) + + def test_types(self): + # assertPreciseEqual() should test for type compatibility + # int-like, float-like, complex-like are not compatible + for i, f, c in itertools.product(self.int_types, self.float_types, + self.complex_types): + self.ne(i(1), f(1)) + self.ne(f(1), c(1)) + self.ne(i(1), c(1)) + # int and long are compatible between each other + for u, v in itertools.product(self.int_types, self.int_types): + self.eq(u(1), v(1)) + # int and bool are not compatible between each other + for u, v in itertools.product(self.int_types, self.bool_types): + self.ne(u(1), v(1)) + # NumPy float types are not compatible between each other + for u, v in itertools.product(self.np_float_types, self.np_float_types): + if u is v: + self.eq(u(1), v(1)) + else: + self.ne(u(1), v(1)) + # NumPy complex types are not compatible between each other + for u, v in itertools.product(self.np_complex_types, self.np_complex_types): + if u is v: + self.eq(u(1), v(1)) + else: + self.ne(u(1), v(1)) + + def test_int_values(self): + for tp in self.int_types: + for prec in ['exact', 'single', 'double']: + self.eq(tp(0), tp(0), prec=prec) + self.ne(tp(0), tp(1), prec=prec) + self.ne(tp(-1), tp(1), prec=prec) + self.ne(tp(2**80), tp(1+2**80), prec=prec) + + def test_bool_values(self): + for tpa, tpb in itertools.product(self.bool_types, self.bool_types): + self.eq(tpa(True), tpb(True)) + self.eq(tpa(False), tpb(False)) + self.ne(tpa(True), tpb(False)) + + def test_abs_tol_parse(self): + # check invalid values in abs_tol kwarg raises + with self.assertRaises(ValueError): + self.eq(np.float64(1e-17), np.float64(1e-17), abs_tol="invalid") + with self.assertRaises(ValueError): + self.eq(np.float64(1), np.float64(2), abs_tol=int(7)) + + def test_float_values(self): + for tp in self.float_types: + for prec in ['exact', 'single', 'double']: + self.eq(tp(1.5), tp(1.5), prec=prec) + # Signed zeros + self.eq(tp(0.0), tp(0.0), prec=prec) + self.eq(tp(-0.0), tp(-0.0), prec=prec) + self.ne(tp(0.0), tp(-0.0), prec=prec) + self.eq(tp(0.0), tp(-0.0), prec=prec, ignore_sign_on_zero=True) + # Infinities + self.eq(tp(INF), tp(INF), prec=prec) + self.ne(tp(INF), tp(1e38), prec=prec) + self.eq(tp(-INF), tp(-INF), prec=prec) + self.ne(tp(INF), tp(-INF), prec=prec) + # NaNs + self.eq(tp(NAN), tp(NAN), prec=prec) + self.ne(tp(NAN), tp(0), prec=prec) + self.ne(tp(NAN), tp(INF), prec=prec) + self.ne(tp(NAN), tp(-INF), prec=prec) + + def test_float64_values(self): + for tp in [float, np.float64]: + self.ne(tp(1.0 + DBL_EPSILON), tp(1.0)) + + def test_float32_values(self): + tp = np.float32 + self.ne(tp(1.0 + FLT_EPSILON), tp(1.0)) + + def test_float64_values_inexact(self): + for tp in [float, np.float64]: + for scale in [1.0, -2**3, 2**-4, -2**-20]: + a = scale * 1.0 + b = scale * (1.0 + DBL_EPSILON) + c = scale * (1.0 + DBL_EPSILON * 2) + d = scale * (1.0 + DBL_EPSILON * 4) + self.ne(tp(a), tp(b)) + self.ne(tp(a), tp(b), prec='exact') + self.eq(tp(a), tp(b), prec='double') + self.eq(tp(a), tp(b), prec='double', ulps=1) + self.ne(tp(a), tp(c), prec='double') + self.eq(tp(a), tp(c), prec='double', ulps=2) + self.ne(tp(a), tp(d), prec='double', ulps=2) + self.eq(tp(a), tp(c), prec='double', ulps=3) + self.eq(tp(a), tp(d), prec='double', ulps=3) + # test absolute tolerance based on eps + self.eq(tp(1e-16), tp(3e-16), prec='double', abs_tol="eps") + self.ne(tp(1e-16), tp(4e-16), prec='double', abs_tol="eps") + # test absolute tolerance based on value + self.eq(tp(1e-17), tp(1e-18), prec='double', abs_tol=1e-17) + self.ne(tp(1e-17), tp(3e-17), prec='double', abs_tol=1e-17) + + def test_float32_values_inexact(self): + tp = np.float32 + for scale in [1.0, -2**3, 2**-4, -2**-20]: + # About the choice of 0.9: there seem to be issues when + # converting + a = scale * 1.0 + b = scale * (1.0 + FLT_EPSILON) + c = scale * (1.0 + FLT_EPSILON * 2) + d = scale * (1.0 + FLT_EPSILON * 4) + self.ne(tp(a), tp(b)) + self.ne(tp(a), tp(b), prec='exact') + self.ne(tp(a), tp(b), prec='double') + self.eq(tp(a), tp(b), prec='single') + self.ne(tp(a), tp(c), prec='single') + self.eq(tp(a), tp(c), prec='single', ulps=2) + self.ne(tp(a), tp(d), prec='single', ulps=2) + self.eq(tp(a), tp(c), prec='single', ulps=3) + self.eq(tp(a), tp(d), prec='single', ulps=3) + # test absolute tolerance based on eps + self.eq(tp(1e-7), tp(2e-7), prec='single', abs_tol="eps") + self.ne(tp(1e-7), tp(3e-7), prec='single', abs_tol="eps") + # test absolute tolerance based on value + self.eq(tp(1e-7), tp(1e-8), prec='single', abs_tol=1e-7) + self.ne(tp(1e-7), tp(3e-7), prec='single', abs_tol=1e-7) + + def test_complex_values(self): + # Complex literals with signed zeros are confusing, better use + # the explicit constructor. + c_pp, c_pn, c_np, c_nn = [complex(0.0, 0.0), complex(0.0, -0.0), + complex(-0.0, 0.0), complex(-0.0, -0.0)] + for tp in self.complex_types: + for prec in ['exact', 'single', 'double']: + self.eq(tp(1 + 2j), tp(1 + 2j), prec=prec) + self.ne(tp(1 + 1j), tp(1 + 2j), prec=prec) + self.ne(tp(2 + 2j), tp(1 + 2j), prec=prec) + # Signed zeros + self.eq(tp(c_pp), tp(c_pp), prec=prec) + self.eq(tp(c_np), tp(c_np), prec=prec) + self.eq(tp(c_nn), tp(c_nn), prec=prec) + self.ne(tp(c_pp), tp(c_pn), prec=prec) + self.ne(tp(c_pn), tp(c_nn), prec=prec) + # Infinities + self.eq(tp(complex(INF, INF)), tp(complex(INF, INF)), prec=prec) + self.eq(tp(complex(INF, -INF)), tp(complex(INF, -INF)), prec=prec) + self.eq(tp(complex(-INF, -INF)), tp(complex(-INF, -INF)), prec=prec) + self.ne(tp(complex(INF, INF)), tp(complex(INF, -INF)), prec=prec) + self.ne(tp(complex(INF, INF)), tp(complex(-INF, INF)), prec=prec) + self.eq(tp(complex(INF, 0)), tp(complex(INF, 0)), prec=prec) + # NaNs + self.eq(tp(complex(NAN, 0)), tp(complex(NAN, 0)), prec=prec) + self.eq(tp(complex(0, NAN)), tp(complex(0, NAN)), prec=prec) + self.eq(tp(complex(NAN, NAN)), tp(complex(NAN, NAN)), prec=prec) + self.eq(tp(complex(INF, NAN)), tp(complex(INF, NAN)), prec=prec) + self.eq(tp(complex(NAN, -INF)), tp(complex(NAN, -INF)), prec=prec) + # FIXME + #self.ne(tp(complex(NAN, INF)), tp(complex(NAN, -INF))) + #self.ne(tp(complex(NAN, 0)), tp(complex(NAN, 1))) + #self.ne(tp(complex(INF, NAN)), tp(complex(-INF, NAN))) + #self.ne(tp(complex(0, NAN)), tp(complex(1, NAN))) + #self.ne(tp(complex(NAN, 0)), tp(complex(0, NAN))) + # XXX should work with other precisions as well? + self.ne(tp(complex(INF, 0)), tp(complex(INF, 1)), prec='exact') + + def test_complex128_values_inexact(self): + for tp in [complex, np.complex128]: + for scale in [1.0, -2**3, 2**-4, -2**-20]: + a = scale * 1.0 + b = scale * (1.0 + DBL_EPSILON) + c = scale * (1.0 + DBL_EPSILON * 2) + aa = tp(complex(a, a)) + ab = tp(complex(a, b)) + bb = tp(complex(b, b)) + self.ne(tp(aa), tp(ab)) + self.eq(tp(aa), tp(ab), prec='double') + self.eq(tp(ab), tp(bb), prec='double') + self.eq(tp(aa), tp(bb), prec='double') + ac = tp(complex(a, c)) + cc = tp(complex(c, c)) + self.ne(tp(aa), tp(ac), prec='double') + self.ne(tp(ac), tp(cc), prec='double') + self.eq(tp(aa), tp(ac), prec='double', ulps=2) + self.eq(tp(ac), tp(cc), prec='double', ulps=2) + self.eq(tp(aa), tp(cc), prec='double', ulps=2) + self.eq(tp(aa), tp(cc), prec='single') + + def test_complex64_values_inexact(self): + tp = np.complex64 + for scale in [1.0, -2**3, 2**-4, -2**-20]: + a = scale * 1.0 + b = scale * (1.0 + FLT_EPSILON) + c = scale * (1.0 + FLT_EPSILON * 2) + aa = tp(complex(a, a)) + ab = tp(complex(a, b)) + bb = tp(complex(b, b)) + self.ne(tp(aa), tp(ab)) + self.ne(tp(aa), tp(ab), prec='double') + self.eq(tp(aa), tp(ab), prec='single') + self.eq(tp(ab), tp(bb), prec='single') + self.eq(tp(aa), tp(bb), prec='single') + ac = tp(complex(a, c)) + cc = tp(complex(c, c)) + self.ne(tp(aa), tp(ac), prec='single') + self.ne(tp(ac), tp(cc), prec='single') + self.eq(tp(aa), tp(ac), prec='single', ulps=2) + self.eq(tp(ac), tp(cc), prec='single', ulps=2) + self.eq(tp(aa), tp(cc), prec='single', ulps=2) + + def test_enums(self): + values = [Color.red, Color.green, Color.blue, Shake.mint, + Shape.circle, Shape.square, Planet.EARTH, Planet.MERCURY] + for val in values: + self.eq(val, val) + self.ne(val, val.value) + for a, b in itertools.combinations(values, 2): + self.ne(a, b) + + def test_arrays(self): + a = np.arange(1, 7, dtype=np.int16).reshape((2, 3)) + b = a.copy() + self.eq(a, b) + # Different values + self.ne(a, b + 1) + self.ne(a, b[:-1]) + self.ne(a, b.T) + # Different dtypes + self.ne(a, b.astype(np.int32)) + # Different layout + self.ne(a, b.T.copy().T) + # Different ndim + self.ne(a, b.flatten()) + # Different writeability + b.flags.writeable = False + self.ne(a, b) + # Precision + a = np.arange(1, 3, dtype=np.float64) + b = a * (1.0 + DBL_EPSILON) + c = a * (1.0 + DBL_EPSILON * 2) + self.ne(a, b) + self.eq(a, b, prec='double') + self.ne(a, c, prec='double') + + def test_npdatetime(self): + a = np.datetime64('1900', 'Y') + b = np.datetime64('1900', 'Y') + c = np.datetime64('1900-01-01', 'D') + d = np.datetime64('1901', 'Y') + self.eq(a, b) + # Different unit + self.ne(a, c) + # Different value + self.ne(a, d) + + def test_nptimedelta(self): + a = np.timedelta64(1, 'h') + b = np.timedelta64(1, 'h') + c = np.timedelta64(60, 'm') + d = np.timedelta64(2, 'h') + self.eq(a, b) + # Different unit + self.ne(a, c) + # Different value + self.ne(a, d) + + +class TestMisc(TestCase): + + def test_assertRefCount(self): + # Use floats to avoid integer interning + x = 55. + y = 66. + l = [] + with self.assertRefCount(x, y): + pass + with self.assertRaises(AssertionError) as cm: + # y gains a reference + with self.assertRefCount(x, y): + l.append(y) + self.assertIn("66", str(cm.exception)) + + def test_forbid_codegen(self): + """ + Test that forbid_codegen() prevents code generation using the @jit + decorator. + """ + def f(): + return 1 + with forbid_codegen(): + with self.assertRaises(RuntimeError) as raises: + cfunc = jit(nopython=True)(f) + cfunc() + self.assertIn("codegen forbidden by test case", str(raises.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_svml.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_svml.py new file mode 100644 index 0000000000000000000000000000000000000000..a047acea529e1cb72b488df3a7117b6f955893ce --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_svml.py @@ -0,0 +1,411 @@ +import math +import numpy as np +import numbers +import re +import traceback +import multiprocessing as mp + +import numba +from numba import njit, prange +from numba.core import config +from numba.tests.support import TestCase, tag, override_env_config +import unittest + +needs_svml = unittest.skipUnless(config.USING_SVML, + "SVML tests need SVML to be present") + +# a map of float64 vector lengths with corresponding CPU architecture +vlen2cpu = {2: 'nehalem', 4: 'haswell', 8: 'skylake-avx512'} +# force LLVM to use AVX512 registers for vectorization +# https://reviews.llvm.org/D67259 +vlen2cpu_features = {2: '', 4: '', 8: '-prefer-256-bit'} + +# env vars to force CPU as skylake-avx512. +# force LLVM to use AVX512 registers for vectorization +# https://reviews.llvm.org/D67259 +_skylake_axv512_envvars = {'NUMBA_CPU_NAME': 'skylake-avx512', + 'NUMBA_CPU_FEATURES': '-prefer-256-bit'} + +# K: SVML functions, V: python functions which are expected to be SIMD-vectorized +# using SVML, explicit references to Python functions here are mostly for sake of +# instant import checks. +# TODO: [] and comments below mean unused/untested SVML function, it's to be +# either enabled or to be replaced with the explanation why the function +# cannot be used in Numba +# TODO: this test does not support functions with more than 1 arguments yet +# The test logic should be modified if there is an SVML function being used under +# different name or module from Python +svml_funcs = { + "sin": [np.sin, math.sin], + "cos": [np.cos, math.cos], + "pow": [], # pow, math.pow], + "exp": [np.exp, math.exp], + "log": [np.log, math.log], + "acos": [math.acos], + "acosh": [math.acosh], + "asin": [math.asin], + "asinh": [math.asinh], + "atan2": [], # math.atan2], + "atan": [math.atan], + "atanh": [math.atanh], + "cbrt": [], # np.cbrt], + "cdfnorm": [], + "cdfnorminv": [], + "ceil": [], # np.ceil, math.ceil], + "cosd": [], + "cosh": [np.cosh, math.cosh], + "erf": [math.erf], # np.erf is available in Intel Distribution + "erfc": [math.erfc], + "erfcinv": [], + "erfinv": [], + "exp10": [], + "exp2": [], # np.exp2], + "expm1": [np.expm1, math.expm1], + "floor": [], # np.floor, math.floor], + "fmod": [], # np.fmod, math.fmod], + "hypot": [], # np.hypot, math.hypot], + "invsqrt": [], # available in Intel Distribution + "log10": [np.log10, math.log10], + "log1p": [np.log1p, math.log1p], + "log2": [], # np.log2], + "logb": [], + "nearbyint": [], + "rint": [], # np.rint], + "round": [], # round], + "sind": [], + "sinh": [np.sinh, math.sinh], + "tan": [np.tan, math.tan], + "tanh": [np.tanh, math.tanh], + "trunc": [], # np.trunc, math.trunc], +} +# TODO: these functions are not vectorizable with complex types +complex_funcs_exclude = ["tan", "log10", "expm1", "log1p", "tanh", "log"] + +# remove untested entries +svml_funcs = {k: v for k, v in svml_funcs.items() if len(v) > 0} +# lists for functions which belong to numpy and math modules correpondently +numpy_funcs = [f for f, v in svml_funcs.items() if "= (3, 12), "needs Python 3.12+") +class TestMonitoring(TestCase): + # Tests the interaction of the Numba dispatcher with `sys.monitoring`. + # + # Note that it looks like a lot of these try..finally type patterns could + # be written using a context manager, this is true, but it is not written + # like that deliberately as a context manager adds implementation details + # onto the stack which makes it harder to debug tests. + + def setUp(self): + # First... check if there's other monitoring stuff registered (e.g. test + # is running under cProfile or coverage), skip if so. + monitor_kinds = [] + for i in range(6): # there are 5 tool IDs + if sys.monitoring.get_tool(i) is not None: + monitor_kinds.append(TOOL2MONITORTYPE[i]) + + if monitor_kinds: + msg = ("Cannot run monitoring tests when other monitors are " + "active, found monitor(s) of type: " + f"{', '.join(monitor_kinds)}") + self.skipTest(msg) + + # set up some standard functions and answers for use throughout + self.foo, self.call_foo = generate_usecase() + self.arg = 10 + self.foo_result = self.arg + 5 + 1 + self.call_foo_result = 2 * self.foo_result + # pretend to be a profiler in the majority of these unit tests + self.tool_id = sys.monitoring.PROFILER_ID + + def check_py_start_calls(self, allcalls): + # Checks that PY_START calls were correctly captured for a + # `self.call_foo(self.arg)` call. + mockcalls = allcalls[PY_START] + self.assertEqual(mockcalls.call_count, 2) + # Find the resume op, this is where the code for `call_foo` "starts" + inst = [x for x in dis.get_instructions(self.call_foo) + if x.opname == "RESUME"] + offset = inst[0].offset + # Numba always reports the start location as offset 0. + calls = (call(self.call_foo.__code__, offset), + call(self.foo.__code__, 0)) + mockcalls.assert_has_calls(calls) + + def check_py_return_calls(self, allcalls): + # Checks that PY_RETURN calls were correctly captured for a + # `self.call_foo(self.arg)` call. + mockcalls = allcalls[PY_RETURN] + self.assertEqual(mockcalls.call_count, 2) + # These are in the order the returns were encountered. Return from `foo` + # occurred first, followed by return from `call_foo`. + # NOTE: it is a known issue that Numba reports the PY_RETURN event as + # occurring at offset 0. At present there's no information about the + # location that the return occurred propagating from the machine code + # back to the dispatcher (where the monitoring events are handled). + offset = [x for x in dis.get_instructions(self.call_foo)][-1].offset + calls = [call(self.foo.__code__, 0, self.foo_result), + call(self.call_foo.__code__, offset, self.call_foo_result)] + mockcalls.assert_has_calls(calls) + + def run_with_events(self, function, args, events, tool_id=None): + # Runs function with args with monitoring set for events on `tool_id` + # (if present, else just uses the default of "PROFILER_ID") returns a + # dictionary event->callback. + try: + if tool_id is None: + _tool_id = self.tool_id + else: + _tool_id = tool_id + sys.monitoring.use_tool_id(_tool_id, "custom_monitor") + callbacks = {} + event_bitmask = 0 + for event in events: + callback = Mock() + sys.monitoring.register_callback(_tool_id, event, callback) + callbacks[event] = callback + event_bitmask |= event + # only start monitoring once callbacks are registered + sys.monitoring.set_events(_tool_id, event_bitmask) + function(*args) + finally: + # clean up state + for event in events: + sys.monitoring.register_callback(_tool_id, event, None) + sys.monitoring.set_events(_tool_id, NO_EVENTS) + sys.monitoring.free_tool_id(_tool_id) + return callbacks + + def test_start_event(self): + # test event PY_START + cb = self.run_with_events(self.call_foo, (self.arg,), (PY_START,)) + # Check... + self.assertEqual(len(cb), 1) + self.check_py_start_calls(cb) + + def test_return_event(self): + # test event PY_RETURN + cb = self.run_with_events(self.call_foo, (self.arg,), (PY_RETURN,)) + # Check... + self.assertEqual(len(cb), 1) + self.check_py_return_calls(cb) + + def test_call_event_chain(self): + # test event PY_START and PY_RETURN monitored at the same time + cb = self.run_with_events(self.call_foo, (self.arg,), + (PY_START, PY_RETURN)) + # Check... + self.assertEqual(len(cb), 2) + self.check_py_return_calls(cb) + self.check_py_start_calls(cb) + + # -------------------------------------------------------------------------- + # NOTE: About the next two tests... + # Numba doesn't support "local event" level monitoring, it's implemented + # in CPython via adjusting the code object bytecode to use + # "instrumented" opcodes. When the interpreter encounters an + # instrumented opcode it triggers the event handling pathways. As Numba + # doesn't interpret the bytecode instruction-at-a-time there's not + # really any way to support this. Two things to check... + # 1. The an instrumented code object doesn't trigger events in + # the dispatcher. + # 2. That Numba can compile instrumented functions (it should be able + # to without any problem as the instrumented bytecode should not + # leak into `.co_code`.). + + def test_instrumented_code_does_not_trigger_numba_events(self): + # 1. from above. + @jit('int64(int64)',) + def foo(x): + return x + 3 + + try: + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + callbacks = {} + event_bitmask = 0 + events = (PY_START, PY_RETURN) + for event in events: + callback = Mock() + sys.monitoring.register_callback(tool_id, event, callback) + callbacks[event] = callback + event_bitmask |= event + + sys.monitoring.set_local_events(tool_id, foo.__code__, + event_bitmask) + result = foo(self.arg) + finally: + for event in events: + sys.monitoring.register_callback(tool_id, event, None) + sys.monitoring.set_local_events(tool_id, foo.__code__, 0) + sys.monitoring.free_tool_id(tool_id) + + # check + self.assertEqual(result, foo.py_func(self.arg)) + self.assertEqual(len(callbacks), 2) + callbacks[PY_START].assert_not_called() + callbacks[PY_RETURN].assert_not_called() + + def test_instrumented_code_can_be_compiled(self): + # 2. from above. + + def foo(x): + return x + 1 + + try: + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + sys.monitoring.set_local_events(tool_id, foo.__code__, PY_START) + sys.monitoring.register_callback(tool_id, PY_START, Mock()) + # test compile + result = jit(foo)(self.arg) + self.assertEqual(result, foo(self.arg)) + finally: + sys.monitoring.register_callback(tool_id, PY_START, None) + sys.monitoring.set_local_events(tool_id, foo.__code__, 0) + sys.monitoring.free_tool_id(tool_id) + + def test_unhandled_events_are_ignored(self): + # Check an unhandled event e.g. PY_YIELD isn't reported. + def generate(dec): + @dec('void()') + def producer(): + yield 10 + + @dec('int64()') + def consumer(): + p = producer() + return next(p) + + return consumer + + event = sys.monitoring.events.PY_YIELD + # check that pure python reports + wrapper = lambda sig: lambda fn: fn + py_consumer = generate(wrapper) + py_cb = self.run_with_events(py_consumer, (), (event,)) + py_cb[event].assert_called_once() + # check the numba does not report + nb_consumer = generate(jit) + nb_cb = self.run_with_events(nb_consumer, (), (event,)) + nb_cb[event].assert_not_called() + + def test_event_with_no_callback_runs(self): + # This checks the situation where an event is being monitored but + # there's no callback associated with the event. In the dispatcher C + # code the loop over tools will be entered, but nothing will get called + # as the "instrument" is missing (NULL). + try: + event = PY_START + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + sys.monitoring.set_events(tool_id, event) + # NO CALLBACK IS REGISTERED! + active_events = sys.monitoring.get_events(tool_id) + self.assertEqual(active_events, event) + result = self.call_foo(self.arg) + active_events = sys.monitoring.get_events(tool_id) + self.assertEqual(active_events, event) + self.assertEqual(result, self.call_foo_result) + finally: + sys.monitoring.set_events(tool_id, NO_EVENTS) + sys.monitoring.free_tool_id(tool_id) + + def test_disable_from_callback(self): + # Event callbacks can disable a _local_ event at a specific location to + # prevent it triggering in the future by returning + # `sys.monitoring.DISABLE`. As this only applies to local events, doing + # this should have absolutely no impact for the global events that Numba + # supports. + + callback = Mock(return_value=sys.monitoring.DISABLE) + + try: + event = PY_START + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + sys.monitoring.set_events(tool_id, event) + sys.monitoring.register_callback(tool_id, event, callback) + active_events = sys.monitoring.get_events(tool_id) + self.assertEqual(active_events, event) + result = self.call_foo(self.arg) + active_events = sys.monitoring.get_events(tool_id) + self.assertEqual(active_events, event) + self.assertEqual(result, self.call_foo_result) + callback.assert_called() + finally: + # It is necessary to restart events that have been disabled. The + # "disabled" state of the `PY_START` event for the tool + # `self.tool_id` "leaks" into subsequent tests. These subsequent + # tests then end up failing as events that should have been + # triggered are not triggered due to the state leak! It's not really + # clear why this happens, if it is part of the design or a side + # effect of the design, or if this behaviour is simply a bug in + # CPython itself. + sys.monitoring.restart_events() + sys.monitoring.register_callback(tool_id, event, None) + sys.monitoring.set_events(tool_id, NO_EVENTS) + sys.monitoring.free_tool_id(tool_id) + + def test_mutation_from_objmode(self): + try: + # Check that it's possible to enable an event (mutate the event + # state)from an `objmode` block. Monitoring for PY_RETURN is set in + # objmode once the function starts executing. + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + event = PY_RETURN + # register the callback... note that the event isn't switched on yet + callback = Mock() + sys.monitoring.register_callback(tool_id, event, callback) + + def objmode_enable_event(switch_on_event): + if switch_on_event: + sys.monitoring.set_events(tool_id, event) + + @_enable_sysmon + @jit('int64(int64)') + def foo(enable): + with objmode: + objmode_enable_event(enable) + return enable + 7 + + # this should not trigger the return callback + foo(0) + callback.assert_not_called() + + # this should trigger the return callback + foo(1) + # switch off the event so the callback mock is protected from + # mutation. + sys.monitoring.set_events(tool_id, NO_EVENTS) + # check what happened + callback.assert_called() + # 2 calls, 1 is the return from the objmode_enable_event, the other + # is the return from foo. + self.assertEqual(callback.call_count, 2) + finally: + sys.monitoring.set_events(tool_id, NO_EVENTS) + sys.monitoring.register_callback(tool_id, event, None) + sys.monitoring.free_tool_id(tool_id) + + def test_multiple_tool_id(self): + # Check that multiple tools will work across different combinations of + # events that Numba dispatcher supports, namely: + # (NO_EVENTS, PY_START, PY_RETURN). + + # the use of NO_EVENTS is superfluous, it is to demonstrate usage. + tool_ids_2_events = {sys.monitoring.DEBUGGER_ID: (NO_EVENTS,), + sys.monitoring.COVERAGE_ID: (PY_START,), + sys.monitoring.PROFILER_ID: (PY_RETURN,), + sys.monitoring.OPTIMIZER_ID: + (PY_START, PY_RETURN,),} + + all_callbacks = {} + try: + for tool_id, events in tool_ids_2_events.items(): + sys.monitoring.use_tool_id(tool_id, f"custom_monitor_{tool_id}") + event_bitmask = 0 + callbacks = {} + all_callbacks[tool_id] = callbacks + for event in events: + callback = Mock() + # Can't set an event for NO_EVENTS! + if event != NO_EVENTS: + sys.monitoring.register_callback(tool_id, event, + callback) + callbacks[event] = callback + event_bitmask |= event + # only start monitoring once callbacks are registered + for tool_id in tool_ids_2_events.keys(): + sys.monitoring.set_events(tool_id, event_bitmask) + self.call_foo(self.arg) + finally: + # clean up state + for tool_id, events in tool_ids_2_events.items(): + for event in events: + # Can't remove an event for NO_EVENTS! + if event != NO_EVENTS: + sys.monitoring.register_callback(tool_id, event, None) + sys.monitoring.set_events(tool_id, NO_EVENTS) + sys.monitoring.free_tool_id(tool_id) + + # Now check all_callbacks... + + # check debugger tool slot + dbg_tool = all_callbacks[sys.monitoring.DEBUGGER_ID] + self.assertEqual(len(dbg_tool), 1) # one event to capture + callback = dbg_tool[NO_EVENTS] + callback.assert_not_called() + + # check coverage tool slot + cov_tool = all_callbacks[sys.monitoring.COVERAGE_ID] + self.assertEqual(len(cov_tool), 1) # one event to capture + self.check_py_start_calls(cov_tool) + + # check profiler tool slot + prof_tool = all_callbacks[sys.monitoring.PROFILER_ID] + self.assertEqual(len(prof_tool), 1) # one event to capture + self.check_py_return_calls(prof_tool) + + # check optimiser tool slot + opt_tool = all_callbacks[sys.monitoring.OPTIMIZER_ID] + self.assertEqual(len(opt_tool), 2) # two events to capture + self.check_py_start_calls(opt_tool) + self.check_py_return_calls(opt_tool) + + def test_raising_under_monitoring(self): + # Check that Numba can raise an exception whilst monitoring is running + # and that 1. `RAISE` is issued 2. `PY_UNWIND` is issued, 3. that + # `PY_RETURN` is not issued. + + ret_callback = Mock() + raise_callback = Mock() + unwind_callback = Mock() + + msg = 'exception raised' + + @_enable_sysmon + @jit('()') + def foo(): + raise ValueError(msg) + + store_raised = None + try: + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + sys.monitoring.register_callback(tool_id, PY_RETURN, ret_callback) + sys.monitoring.register_callback(tool_id, RAISE, raise_callback) + sys.monitoring.register_callback(tool_id, PY_UNWIND, + unwind_callback) + sys.monitoring.set_events(tool_id, PY_RETURN | RAISE | PY_UNWIND) + try: + foo() + except ValueError as raises: + store_raised = raises + # switch off monitoring + sys.monitoring.set_events(tool_id, NO_EVENTS) + # check that the ret_callback was called once (by Numba unpickle to + # fetch the exception info out of the stored bytes). + ret_callback.assert_called_once() + # and that elements that are feasible to check about the call are + # as expected + the_call = ret_callback.call_args_list[0] + self.assertEqual(the_call.args[0], _numba_unpickle.__code__) + self.assertEqual(the_call.args[2][0], ValueError) + self.assertEqual(the_call.args[2][1][0], msg) + + # check that the RAISE event callback was triggered + raise_callback.assert_called() + numba_unpickle_call = raise_callback.call_args_list[0] + self.assertEqual(numba_unpickle_call.args[0], + _numba_unpickle.__code__) + self.assertIsInstance(numba_unpickle_call.args[2], KeyError) + foo_call = raise_callback.call_args_list[1] + self.assertEqual(foo_call.args[0], foo.py_func.__code__) + self.assertIsInstance(foo_call.args[2], ValueError) + self.assertIn(msg, str(foo_call.args[2])) + + # check that PY_UNWIND event callback was called + unwind_callback.assert_called_once() + unwind_call = unwind_callback.call_args_list[0] + self.assertEqual(unwind_call.args[0], foo.py_func.__code__) + self.assertIsInstance(unwind_call.args[2], ValueError) + self.assertIn(msg, str(unwind_call.args[2])) + finally: + sys.monitoring.set_events(tool_id, NO_EVENTS) + sys.monitoring.register_callback(tool_id, PY_RETURN, None) + sys.monitoring.register_callback(tool_id, RAISE, None) + sys.monitoring.register_callback(tool_id, PY_UNWIND, None) + sys.monitoring.free_tool_id(tool_id) + + self.assertIn(msg, str(store_raised)) + + def test_stop_iteration_under_monitoring(self): + # Check that Numba can raise an StopIteration exception whilst + # monitoring is running and that: + # 1. RAISE is issued for an explicitly raised StopIteration exception. + # 2. PY_RETURN is issued appropriately for the unwinding stack + # 3. STOP_ITERATION is not issued as there is no implicit StopIteration + # raised. + + return_callback = Mock() + raise_callback = Mock() + stopiter_callback = Mock() + + msg = 'exception raised' + + @_enable_sysmon + @jit('()') + def foo(): + raise StopIteration(msg) + + store_raised = None + try: + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + sys.monitoring.register_callback(tool_id, PY_RETURN, + return_callback) + sys.monitoring.register_callback(tool_id, RAISE, + raise_callback) + sys.monitoring.register_callback(tool_id, STOP_ITERATION, + stopiter_callback) + sys.monitoring.set_events(tool_id, + PY_RETURN | STOP_ITERATION | RAISE) + try: + foo() + except StopIteration as raises: + store_raised = raises + # switch off monitoring + sys.monitoring.set_events(tool_id, NO_EVENTS) + # check that the return_callback was called once (by Numba unpickle + # to fetch the exception info out of the stored bytes). + return_callback.assert_called_once() + # and that elements that are feasible to check about the call are + # as expected + the_call = return_callback.call_args_list[0] + self.assertEqual(the_call.args[0], _numba_unpickle.__code__) + self.assertEqual(the_call.args[2][0], StopIteration) + self.assertEqual(the_call.args[2][1][0], msg) + + # check that the RAISE event callback was triggered + raise_callback.assert_called() + # check that it's 3 long (numba unpickle, jit(foo), the test method) + self.assertEqual(raise_callback.call_count, 3) + + # check the numba pickle call + numba_unpickle_call = raise_callback.call_args_list[0] + self.assertEqual(numba_unpickle_call.args[0], + _numba_unpickle.__code__) + self.assertIsInstance(numba_unpickle_call.args[2], KeyError) + + # check the jit(foo) call + foo_call = raise_callback.call_args_list[1] + self.assertEqual(foo_call.args[0], foo.py_func.__code__) + self.assertIsInstance(foo_call.args[2], StopIteration) + self.assertIn(msg, str(foo_call.args[2])) + + # check the test method call + meth_call = raise_callback.call_args_list[2] + test_method_code = sys._getframe().f_code + self.assertEqual(meth_call.args[0], test_method_code) + self.assertIsInstance(meth_call.args[2], StopIteration) + self.assertIn(msg, str(meth_call.args[2])) + + # check that the STOP_ITERATION event was not triggered + stopiter_callback.assert_not_called() + finally: + sys.monitoring.set_events(tool_id, NO_EVENTS) + sys.monitoring.register_callback(tool_id, PY_RETURN, None) + sys.monitoring.register_callback(tool_id, STOP_ITERATION, None) + sys.monitoring.register_callback(tool_id, RAISE, None) + sys.monitoring.free_tool_id(tool_id) + + self.assertIn(msg, str(store_raised)) + + def test_raising_callback_unwinds_from_jit_on_success_path(self): + # An event callback can legitimately raise an exception, this test + # makes sure Numba's dispatcher handles it ok on the "successful path", + # i.e. the JIT compiled function didn't raise an exception at runtime. + + msg = "deliberately broken callback" + + callback = Mock(side_effect=ValueError(msg)) + + store_raised = None + try: + event = PY_START + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + sys.monitoring.set_events(tool_id, event) + sys.monitoring.register_callback(tool_id, event, callback) + self.foo(self.arg) + except ValueError as raises: + store_raised = raises + finally: + sys.monitoring.register_callback(tool_id, event, None) + sys.monitoring.set_events(tool_id, NO_EVENTS) + sys.monitoring.free_tool_id(tool_id) + + callback.assert_called_once() + self.assertIn(msg, str(store_raised)) + + def test_raising_callback_unwinds_from_jit_on_raising_path(self): + # An event callback can legitimately raise an exception, this test + # makes sure Numba's dispatcher handles it ok on the + # "unsuccessful path", i.e. the JIT compiled function raised an + # exception at runtime. This test checks the RAISE event, as the + # callback itself raises, it overrides the exception coming from the + # JIT compiled function. + + msg_callback = "deliberately broken callback" + msg_execution = "deliberately broken execution" + + callback = Mock(side_effect=ValueError(msg_callback)) + + class LocalException(Exception): + pass + + @_enable_sysmon + @jit("()") + def raising(): + raise LocalException(msg_execution) + + store_raised = None + try: + event = RAISE + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + sys.monitoring.set_events(tool_id, event) + sys.monitoring.register_callback(tool_id, event, callback) + raising() + except ValueError as raises: + store_raised = raises + finally: + sys.monitoring.register_callback(tool_id, event, None) + sys.monitoring.set_events(tool_id, NO_EVENTS) + sys.monitoring.free_tool_id(tool_id) + + callback.assert_called() + # Called 3x (numba unpickle, ValueError in callback, the test method) + self.assertEqual(callback.call_count, 3) + + # check the numba unpickle call + numba_unpickle_call = callback.call_args_list[0] + self.assertEqual(numba_unpickle_call.args[0], _numba_unpickle.__code__) + self.assertIsInstance(numba_unpickle_call.args[2], KeyError) + + # check the jit(raising) call + raising_call = callback.call_args_list[1] + self.assertEqual(raising_call.args[0], raising.py_func.__code__) + self.assertIs(raising_call.args[2], callback.side_effect) + + # check the test method call + meth_call = callback.call_args_list[2] + test_method_code = sys._getframe().f_code + self.assertEqual(meth_call.args[0], test_method_code) + self.assertIs(meth_call.args[2], callback.side_effect) + + # check the stored exception is the expected exception + self.assertIs(store_raised, callback.side_effect) + + def test_raising_callback_unwinds_from_jit_on_unwind_path(self): + # An event callback can legitimately raise an exception, this test + # makes sure Numba's dispatcher handles it ok on the + # "unsuccessful path", i.e. the JIT compiled function raised an + # exception at runtime. This test checks the PY_UNWIND event. CPython + # seems to not notice the PY_UNWIND coming from the exception arising + # from the raise in the event callback, it just has the PY_UNWIND from + # the raise in the JIT compiled function. + + msg_callback = "deliberately broken callback" + msg_execution = "deliberately broken execution" + + callback = Mock(side_effect=ValueError(msg_callback)) + + class LocalException(Exception): + pass + + @_enable_sysmon + @jit("()") + def raising(): + raise LocalException(msg_execution) + + store_raised = None + try: + event = PY_UNWIND + tool_id = self.tool_id + sys.monitoring.use_tool_id(tool_id, "custom_monitor") + sys.monitoring.set_events(tool_id, event) + sys.monitoring.register_callback(tool_id, event, callback) + raising() + except ValueError as raises: + store_raised = raises + finally: + sys.monitoring.register_callback(tool_id, event, None) + sys.monitoring.set_events(tool_id, NO_EVENTS) + sys.monitoring.free_tool_id(tool_id) + + callback.assert_called_once() + + # check the jit(raising) call + raising_call = callback.call_args_list[0] + self.assertEqual(raising_call.args[0], raising.py_func.__code__) + self.assertEqual(type(raising_call.args[2]), LocalException) + self.assertEqual(str(raising_call.args[2]), msg_execution) + + # check the stored_raise + self.assertIs(store_raised, callback.side_effect) + + def test_monitoring_multiple_threads(self): + # two threads, different tools and events registered on each thread. + + def t1_work(self, q): + try: + # test event PY_START on a "debugger tool" + cb = self.run_with_events(self.call_foo, (self.arg,), + (PY_START,), + tool_id=sys.monitoring.DEBUGGER_ID) + # Check... + self.assertEqual(len(cb), 1) + self.check_py_start_calls(cb) + except Exception as e: + q.put(e) + + def t2_work(self, q): + try: + # test event PY_RETURN on a "coverage tool" + cb = self.run_with_events(self.call_foo, (self.arg,), + (PY_RETURN,), + tool_id=sys.monitoring.COVERAGE_ID) + # Check... + self.assertEqual(len(cb), 1) + self.check_py_return_calls(cb) + except Exception as e: + q.put(e) + + q1 = queue.Queue() + t1 = threading.Thread(target=t1_work, args=(self, q1)) + q2 = queue.Queue() + t2 = threading.Thread(target=t2_work, args=(self, q2)) + + threads = (t1, t2) + for t in threads: + t.start() + for t in threads: + t.join() + + # make sure there were no exceptions + def assert_empty_queue(q): + if q.qsize() != 0: + while not q.empty(): + print(q.get()) + self.fail("queue supposed to be empty") + + assert_empty_queue(q1) + assert_empty_queue(q2) + + +@unittest.skipUnless(PYVERSION >= (3, 12), "needs Python 3.12+") +class TestMonitoringSelfTest(TestCase): + + def test_skipping_of_tests_if_monitoring_in_use(self): + # check that the unit tests in the TestMonitoring class above will skip + # if there are other monitoring tools registered in the thread (in this + # case cProfile is used to cause that effect). + r = self.subprocess_test_runner(TestMonitoring.__module__, + 'TestMonitoring', + 'test_start_event', + flags={'-m': 'cProfile'}) + self.assertIn("skipped=1", str(r)) + + +@unittest.skipUnless(PYVERSION >= (3, 12), "needs Python 3.12+") +class TestMonitoringEnvVarControl(TestCase): + @TestCase.run_test_in_subprocess( + envvars={"NUMBA_ENABLE_SYS_MONITORING": ''}) + def test_default_off(self): + @jit + def foo(x): + return x + 1 + + self.assertFalse(foo._enable_sysmon) + + @TestCase.run_test_in_subprocess( + envvars={"NUMBA_ENABLE_SYS_MONITORING": '0'}) + def test_override_off(self): + @jit + def foo(x): + return x + 1 + + self.assertFalse(foo._enable_sysmon) + + @TestCase.run_test_in_subprocess( + envvars={"NUMBA_ENABLE_SYS_MONITORING": '1'}) + def test_override_on(self): + @jit + def foo(x): + return x + 1 + + self.assertTrue(foo._enable_sysmon) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sys_stdin_assignment.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sys_stdin_assignment.py new file mode 100644 index 0000000000000000000000000000000000000000..f9d88e23547d098ed5c6ffcaaf4f8585b6bbba89 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sys_stdin_assignment.py @@ -0,0 +1,67 @@ +import sys + +import unittest +from numba import njit + + +@njit +def f0(a, b): + return a + b + + +@njit +def f1(begin1, end1, begin2, end2): + if begin1 > begin2: return f1(begin2, end2, begin1, end1) + return end1 + 1 >= begin2 + + +@njit +def f0_2(a, b): + return a + b + + +@njit +def f1_2(begin1, end1, begin2, end2): + if begin1 > begin2: return f1_2(begin2, end2, begin1, end1) + return end1 + 1 >= begin2 + + +class TestSysStdinAssignment(unittest.TestCase): + + def test_no_reassignment_of_stdout(self): + """ + https://github.com/numba/numba/issues/3027 + Older versions of colorama break stdout/err when recursive functions + are compiled. + + This test should work irrespective of colorama version, or indeed its + presence. If the version is too low, it should be disabled and the test + should work anyway, if it is a sufficiently high version or it is not + present, it should work anyway. + """ + + originally = sys.stdout, sys.stderr + + try: + sys.stdout = None + f0(0, 1) # Not changed stdout? + self.assertEqual(sys.stdout, None) + f1(0, 1, 2, 3) # Not changed stdout? + self.assertEqual(sys.stdout, None) + + sys.stderr = None + f0_2(0, 1) # Not changed stderr? + self.assertEqual(sys.stderr, None) + f1_2(0, 1, 2, 3) # Not changed stderr? + self.assertEqual(sys.stderr, None) + + finally: + sys.stdout, sys.stderr = originally + + self.assertNotEqual(sys.stderr, None) + self.assertNotEqual(sys.stdout, None) + + +if __name__ == '__main__': + unittest.main() + diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sysinfo.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sysinfo.py new file mode 100644 index 0000000000000000000000000000000000000000..b63f601b98c251b30467e789d55f9515a1516316 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_sysinfo.py @@ -0,0 +1,189 @@ +import platform +import unittest +from unittest import skipUnless +from unittest.mock import NonCallableMock +from itertools import chain +from datetime import datetime +from contextlib import redirect_stdout +from io import StringIO + +from numba.tests.support import TestCase +import numba.misc.numba_sysinfo as nsi + + +class TestSysInfo(TestCase): + + def setUp(self): + super(TestSysInfo, self).setUp() + self.info = nsi.get_sysinfo() + self.safe_contents = { + int: ( + nsi._cpu_count, + ), + float: ( + nsi._runtime, + ), + str: ( + nsi._machine, + nsi._cpu_name, + nsi._platform_name, + nsi._os_name, + nsi._os_version, + nsi._python_comp, + nsi._python_impl, + nsi._python_version, + nsi._llvm_version, + nsi._numpy_version, + ), + bool: ( + nsi._cu_dev_init, + nsi._svml_state, + nsi._svml_loaded, + nsi._svml_operational, + nsi._llvm_svml_patched, + nsi._tbb_thread, + nsi._openmp_thread, + nsi._wkq_thread, + nsi._numpy_AVX512_SKX_detected, + ), + list: ( + nsi._errors, + nsi._warnings, + ), + dict: ( + nsi._numba_env_vars, + ), + datetime: ( + nsi._start, + nsi._start_utc, + ), + } + self.safe_keys = chain(*self.safe_contents.values()) + + def tearDown(self): + super(TestSysInfo, self).tearDown() + # System info might contain long strings or lists so delete it. + del self.info + + def test_has_safe_keys(self): + for k in self.safe_keys: + with self.subTest(k=k): + self.assertIn(k, self.info) + + def test_safe_content_type(self): + for t, keys in self.safe_contents.items(): + for k in keys: + with self.subTest(k=k): + self.assertIsInstance(self.info[k], t) + + def test_has_no_error(self): + self.assertFalse(self.info[nsi._errors]) + + def test_display_empty_info(self): + output = StringIO() + with redirect_stdout(output): + res = nsi.display_sysinfo({}) + self.assertIsNone(res) + output.close() + + +class TestSysInfoWithPsutil(TestCase): + + mem_total = 2 * 1024 ** 2 # 2_097_152 + mem_available = 1024 ** 2 # 1_048_576 + cpus_list = [1, 2] + + def setUp(self): + super(TestSysInfoWithPsutil, self).setUp() + self.psutil_orig_state = nsi._psutil_import + # Mocking psutil + nsi._psutil_import = True + nsi.psutil = NonCallableMock() + vm = nsi.psutil.virtual_memory.return_value + vm.total = self.mem_total + vm.available = self.mem_available + if platform.system() in ('Linux', 'Windows',): + # cpu_affiniy only available on Linux and Windows + proc = nsi.psutil.Process.return_value + proc.cpu_affinity.return_value = self.cpus_list + else: + nsi.psutil.Process.return_value = None + + self.info = nsi.get_os_spec_info(platform.system()) + + def tearDown(self): + super(TestSysInfoWithPsutil, self).tearDown() + nsi._psutil_import = self.psutil_orig_state + + def test_has_all_data(self): + keys = (nsi._mem_total, nsi._mem_available) + for k in keys: + with self.subTest(k=k): + self.assertIn(k, self.info.keys()) + self.assertIsInstance(self.info[k], int) + + def test_has_correct_values(self): + self.assertEqual(self.info[nsi._mem_total], self.mem_total) + self.assertEqual(self.info[nsi._mem_available], self.mem_available) + + @skipUnless(platform.system() in ('Linux', 'Windows'), + "CPUs allowed info only available on Linux and Windows") + def test_cpus_list(self): + self.assertEqual(self.info[nsi._cpus_allowed], len(self.cpus_list)) + self.assertEqual(self.info[nsi._cpus_list], + ' '.join(str(n) for n in self.cpus_list)) + + +class TestSysInfoWithoutPsutil(TestCase): + + def setUp(self): + super(TestSysInfoWithoutPsutil, self).setUp() + self.psutil_orig_state = nsi._psutil_import + nsi._psutil_import = False + self.info = nsi.get_os_spec_info(platform.system()) + + def tearDown(self): + super(TestSysInfoWithoutPsutil, self).tearDown() + nsi._psutil_import = self.psutil_orig_state + + def test_has_all_data(self): + keys = (nsi._mem_total, nsi._mem_available) + for k in keys: + with self.subTest(k=k): + self.assertIn(k, self.info.keys()) + self.assertIsInstance(self.info[k], int) + + +class TestPlatformSpecificInfo(TestCase): + + def setUp(self): + self.plat_spec_info = { + 'Linux': { + str: (nsi._libc_version,), + }, + 'Windows': { + str: (nsi._os_spec_version,), + }, + 'Darwin': { + str: (nsi._os_spec_version,), + }, + } + self.os_name = platform.system() + self.contents = self.plat_spec_info.get(self.os_name, {}) + self.info = nsi.get_os_spec_info(self.os_name) + + def test_has_all_data(self): + keys = chain(*self.contents.values()) + for k in keys: + with self.subTest(k=k): + self.assertIn(k, self.info.keys()) + + def test_content_type(self): + for t, keys in self.contents.items(): + for k in keys: + with self.subTest(k=k): + self.assertIsInstance(self.info[k], t) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_target_extension.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_target_extension.py new file mode 100644 index 0000000000000000000000000000000000000000..a78b234b81ef1fdfa258f7b4a32b0afdd01b7ba9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_target_extension.py @@ -0,0 +1,851 @@ +"""This tests the target extension API to ensure that rudimentary expected +behaviours are present and correct. It uses a piece of fake hardware as a +target, the Dummy Processing Unit (DPU), to do this. The DPU borrows a lot from +the CPU but is part of the GPU class of target. The DPU target has deliberately +strange implementations of fundamental operations so as to make it identifiable +in testing.""" + +import unittest +from numba.tests.support import TestCase +import ctypes +import operator +from functools import cached_property +import numpy as np +from numba import njit, types +from numba.extending import (overload, overload_attribute, + overload_classmethod, intrinsic) +from numba.core.target_extension import ( + JitDecorator, + target_registry, + dispatcher_registry, + jit_registry, + target_override, + GPU, + resolve_dispatcher_from_str, +) +from numba.core import utils, fastmathpass, errors +from numba.core.dispatcher import Dispatcher +from numba.core.descriptors import TargetDescriptor +from numba.core import cpu, typing, cgutils +from numba.core.base import BaseContext +from numba.core.compiler_lock import global_compiler_lock +from numba.core import callconv +from numba.core.codegen import CPUCodegen, JITCodeLibrary +from numba.core.callwrapper import PyCallWrapper +from numba.core.imputils import RegistryLoader, Registry +from numba.core.typing.typeof import typeof +from numba import _dynfunc +import llvmlite.binding as ll +from llvmlite import ir as llir +from numba.core.runtime import rtsys + +from numba.core import compiler +from numba.core.compiler import CompilerBase, DefaultPassBuilder +from numba.core.compiler_machinery import FunctionPass, register_pass +from numba.core.typed_passes import PreLowerStripPhis + +# Define a new target, this target extends GPU, this places the DPU in the +# target hierarchy as a type of GPU. + + +class DPU(GPU): + ... + + +# register the dpu target hierarchy token in the target registry, this +# permits lookup and reference in userspace by the string "dpu" +target_registry["dpu"] = DPU + +# Create a JIT DPU codegen for the DPU target + + +class JITDPUCodegen(CPUCodegen): + # This largely rips off the CPU for ease + + _library_class = JITCodeLibrary + + def _customize_tm_options(self, options): + # Customize the target machine options. + options["cpu"] = self._get_host_cpu_name() + arch = ll.Target.from_default_triple().name + if arch.startswith("x86"): + reloc_model = "static" + elif arch.startswith("ppc"): + reloc_model = "pic" + else: + reloc_model = "default" + options["reloc"] = reloc_model + options["codemodel"] = "jitdefault" + + # Set feature attributes (such as ISA extensions) + # This overrides default feature selection by CPU model above + options["features"] = self._tm_features + + # Deal with optional argument to ll.Target.create_target_machine + sig = utils.pysignature(ll.Target.create_target_machine) + if "jit" in sig.parameters: + # Mark that this is making a JIT engine + options["jit"] = True + + def _customize_tm_features(self): + # For JIT target, we will use LLVM to get the feature map + return self._get_host_cpu_features() + + def _add_module(self, module): + self._engine.add_module(module) + + def set_env(self, env_name, env): + """Set the environment address. + + Update the GlobalVariable named *env_name* to the address of *env*. + """ + gvaddr = self._engine.get_global_value_address(env_name) + envptr = (ctypes.c_void_p * 1).from_address(gvaddr) + envptr[0] = ctypes.c_void_p(id(env)) + + +# This is the function registry for the dpu, it just has one registry, this one! +dpu_function_registry = Registry() + +# Implement a new context for the DPU target + + +class DPUContext(BaseContext): + allow_dynamic_globals = True + + # Overrides + def create_module(self, name): + return self._internal_codegen._create_empty_module(name) + + @global_compiler_lock + def init(self): + self._internal_codegen = JITDPUCodegen("numba.exec") + # Initialize NRT runtime + rtsys.initialize(self) + self.refresh() + + def refresh(self): + registry = dpu_function_registry + try: + loader = self._registries[registry] + except KeyError: + loader = RegistryLoader(registry) + self._registries[registry] = loader + self.install_registry(registry) + # Also refresh typing context, since @overload declarations can + # affect it. + self.typing_context.refresh() + + @property + def target_data(self): + return self._internal_codegen.target_data + + def codegen(self): + return self._internal_codegen + + # Borrow the CPU call conv + @cached_property + def call_conv(self): + return callconv.CPUCallConv(self) + + def get_env_body(self, builder, envptr): + """ + From the given *envptr* (a pointer to a _dynfunc.Environment object), + get a EnvBody allowing structured access to environment fields. + """ + body_ptr = cgutils.pointer_add( + builder, envptr, _dynfunc._impl_info["offsetof_env_body"] + ) + return cpu.EnvBody(self, builder, ref=body_ptr, cast_ref=True) + + def get_env_manager(self, builder): + envgv = self.declare_env_global( + builder.module, self.get_env_name(self.fndesc) + ) + envarg = builder.load(envgv) + pyapi = self.get_python_api(builder) + pyapi.emit_environment_sentry( + envarg, debug_msg=self.fndesc.env_name, + ) + env_body = self.get_env_body(builder, envarg) + return pyapi.get_env_manager(self.environment, env_body, envarg) + + def get_generator_state(self, builder, genptr, return_type): + """ + From the given *genptr* (a pointer to a _dynfunc.Generator object), + get a pointer to its state area. + """ + return cgutils.pointer_add( + builder, + genptr, + _dynfunc._impl_info["offsetof_generator_state"], + return_type=return_type, + ) + + def post_lowering(self, mod, library): + if self.fastmath: + fastmathpass.rewrite_module(mod, self.fastmath) + + library.add_linking_library(rtsys.library) + + def create_cpython_wrapper( + self, library, fndesc, env, call_helper, release_gil=False + ): + wrapper_module = self.create_module("wrapper") + fnty = self.call_conv.get_function_type(fndesc.restype, fndesc.argtypes) + wrapper_callee = llir.Function( + wrapper_module, fnty, fndesc.llvm_func_name + ) + builder = PyCallWrapper( + self, + wrapper_module, + wrapper_callee, + fndesc, + env, + call_helper=call_helper, + release_gil=release_gil, + ) + builder.build() + library.add_ir_module(wrapper_module) + + def create_cfunc_wrapper(self, library, fndesc, env, call_helper): + # There's no cfunc wrapper on the dpu + pass + + def get_executable(self, library, fndesc, env): + """ + Returns + ------- + (cfunc, fnptr) + + - cfunc + callable function (Can be None) + - fnptr + callable function address + - env + an execution environment (from _dynfunc) + """ + # Code generation + fnptr = library.get_pointer_to_function( + fndesc.llvm_cpython_wrapper_name + ) + + # Note: we avoid reusing the original docstring to avoid encoding + # issues on Python 2, see issue #1908 + doc = "compiled wrapper for %r" % (fndesc.qualname,) + cfunc = _dynfunc.make_function( + fndesc.lookup_module(), + fndesc.qualname.split(".")[-1], + doc, + fnptr, + env, + # objects to keepalive with the function + (library,), + ) + library.codegen.set_env(self.get_env_name(fndesc), env) + return cfunc + + +# Implement a DPU TargetDescriptor, this one borrows bits from the CPU +class DPUTarget(TargetDescriptor): + options = cpu.CPUTargetOptions + + @cached_property + def _toplevel_target_context(self): + # Lazily-initialized top-level target context, for all threads + return DPUContext(self.typing_context, self._target_name) + + @cached_property + def _toplevel_typing_context(self): + # Lazily-initialized top-level typing context, for all threads + return typing.Context() + + @property + def target_context(self): + """ + The target context for DPU targets. + """ + return self._toplevel_target_context + + @property + def typing_context(self): + """ + The typing context for CPU targets. + """ + return self._toplevel_typing_context + + +# Create a DPU target instance +dpu_target = DPUTarget("dpu") + + +# Declare a dispatcher for the DPU target +class DPUDispatcher(Dispatcher): + targetdescr = dpu_target + + def compile(self, sig): + with target_override('dpu'): + return super().compile(sig) + + +# Register a dispatcher for the DPU target, a lot of the code uses this +# internally to work out what to do RE compilation +dispatcher_registry[target_registry["dpu"]] = DPUDispatcher + +# Implement a dispatcher for the DPU target + + +class djit(JitDecorator): + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + + def __call__(self, *args): + assert len(args) < 2 + if args: + func = args[0] + else: + func = self._args[0] + self.py_func = func + # wrap in dispatcher + return self.dispatcher_wrapper() + + def get_dispatcher(self): + """ + Returns the dispatcher + """ + return dispatcher_registry[target_registry["dpu"]] + + def dispatcher_wrapper(self): + disp = self.get_dispatcher() + # Parse self._kwargs here + topt = {} + if "nopython" in self._kwargs: + topt["nopython"] = True + + # It would be easy to specialise the default compilation pipeline for + # this target here. + pipeline_class = compiler.Compiler + if "pipeline_class" in self._kwargs: + pipeline_class = self._kwargs["pipeline_class"] + return disp( + py_func=self.py_func, + targetoptions=topt, + pipeline_class=pipeline_class, + ) + + +# add it to the decorator registry, this is so e.g. @overload can look up a +# JIT function to do the compilation work. +jit_registry[target_registry["dpu"]] = djit + +# The DPU target "knows" nothing, add in some primitives for basic things... + +# need to register how to lower dummy for @intrinsic + + +@dpu_function_registry.lower_constant(types.Dummy) +def constant_dummy(context, builder, ty, pyval): + return context.get_dummy_value() + + +# and how to deal with IntegerLiteral to Integer casts +@dpu_function_registry.lower_cast(types.IntegerLiteral, types.Integer) +def literal_int_to_number(context, builder, fromty, toty, val): + lit = context.get_constant_generic( + builder, fromty.literal_type, fromty.literal_value, + ) + return context.cast(builder, lit, fromty.literal_type, toty) + + +# and how to lower an Int constant +@dpu_function_registry.lower_constant(types.Integer) +def const_int(context, builder, ty, pyval): + lty = context.get_value_type(ty) + return lty(pyval) + + +# and tell the DPU how to lower a float constant +@dpu_function_registry.lower_constant(types.Float) +def const_float(context, builder, ty, pyval): + lty = context.get_value_type(ty) + return lty(pyval) + + +# The DPU actually subtracts when it's asked to 'add'! +@intrinsic(target="dpu") +def intrin_add(tyctx, x, y): + sig = x(x, y) + + def codegen(cgctx, builder, tyargs, llargs): + return builder.sub(*llargs) + + return sig, codegen + + +# Use extending.overload API to register 'add', call the dpu specific intrinsic +@overload(operator.add, target="dpu") +def ol_add(x, y): + if isinstance(x, types.Integer) and isinstance(y, types.Integer): + + def impl(x, y): + return intrin_add(x, y) + + return impl + + +class TestTargetHierarchySelection(TestCase): + """This tests that the target hierarchy is scanned in the right order, + that appropriate functions are selected based on what's available and that + the DPU target is distinctly different to the CPU""" + + def test_0_dpu_registry(self): + """Checks that the DPU registry only contains the things added + + This test must be first to execute among all tests in this file to + ensure the no lazily loaded entries are added yet. + """ + self.assertFalse(dpu_function_registry.functions) + self.assertFalse(dpu_function_registry.getattrs) + # int literal -> int cast is registered + self.assertEqual(len(dpu_function_registry.casts), 1) + # int, float and dummy constants are registered + self.assertEqual(len(dpu_function_registry.constants), 3) + + def test_specialise_gpu(self): + def my_func(x): + pass + + # Can be used by both CPU and DPU + @overload(my_func, target="generic") + def ol_my_func1(x): + def impl(x): + return 1 + x + + return impl + + # Should be used by the DPU if there's no dpu specific one + @overload(my_func, target="gpu") + def ol_my_func2(x): + def impl(x): + return 10 + x + + return impl + + @djit() + def dpu_foo(): + return my_func(7) + + @njit() + def cpu_foo(): + return my_func(7) + + # DPU chooses the ol_my_func2 as it's most specific, and DPU subtracts + # for addition, so 10 + x -> 10 - 7 -> 3 + self.assertPreciseEqual(dpu_foo(), 3) + # CPU uses the generic one function ol_my_func1 and adds + self.assertPreciseEqual(cpu_foo(), 8) + + def test_specialise_dpu(self): + def my_func(x): + pass + + # Can be used by both CPU and DPU + @overload(my_func, target="generic") + def ol_my_func1(x): + def impl(x): + return 1 + x + + return impl + + # Should be used by the DPU if there's no dpu specific one + @overload(my_func, target="gpu") + def ol_my_func2(x): + def impl(x): + return 10 + x + + return impl + + # Should be used by the DPU only + @overload(my_func, target="dpu") + def ol_my_func3(x): + def impl(x): + return 100 + x + + return impl + + @djit() + def dpu_foo(): + return my_func(7) + + @njit() + def cpu_foo(): + return my_func(7) + + # DPU chooses the ol_my_func3 as it's most specific, and DPU subtracts + # for addition, so 100 + x -> 100 - 7 -> 93 + self.assertPreciseEqual(dpu_foo(), 93) + # CPU uses the generic one function ol_my_func1 and adds + self.assertPreciseEqual(cpu_foo(), 8) + + def test_no_specialisation_found(self): + + def my_func(x): + pass + + # only create a cuda specialisation + @overload(my_func, target='cuda') + def ol_my_func_cuda(x): + return lambda x: None + + @djit(nopython=True) + def dpu_foo(): + my_func(1) + + # new style errors raise UnsupportedError, old style ends up as + # TypingError + accept = (errors.UnsupportedError, errors.TypingError) + with self.assertRaises(accept) as raises: + dpu_foo() + + msgs = ["Function resolution cannot find any matches for function", + "test_no_specialisation_found..my_func", + "for the current target:", + "'numba.tests.test_target_extension.DPU'"] + + for msg in msgs: + self.assertIn(msg, str(raises.exception)) + + def test_invalid_target_jit(self): + + with self.assertRaises(errors.NonexistentTargetError) as raises: + @njit(_target='invalid_silicon') + def foo(): + pass + + foo() + + msg = "No target is registered against 'invalid_silicon'" + self.assertIn(msg, str(raises.exception)) + + def test_invalid_target_overload(self): + + def bar(): + pass + + # This is a typing error at present as it fails during typing when the + # overloads are walked. + with self.assertRaises(errors.NonexistentTargetError) as raises: + @overload(bar, target='invalid_silicon') + def ol_bar(): + return lambda : None + + @njit + def foo(): + bar() + + foo() + + msg = "No target is registered against 'invalid_silicon'" + self.assertIn(msg, str(raises.exception)) + + def test_intrinsic_selection(self): + """ + Test to make sure that targets can share generic implementations and + cannot reach implementations that are not in their target hierarchy. + """ + + # NOTE: The actual operation performed by these functions is irrelevant + @intrinsic(target="generic") + def intrin_math_generic(tyctx, x, y): + sig = x(x, y) + + def codegen(cgctx, builder, tyargs, llargs): + return builder.mul(*llargs) + + return sig, codegen + + @intrinsic(target="dpu") + def intrin_math_dpu(tyctx, x, y): + sig = x(x, y) + + def codegen(cgctx, builder, tyargs, llargs): + return builder.sub(*llargs) + + return sig, codegen + + @intrinsic(target="cpu") + def intrin_math_cpu(tyctx, x, y): + sig = x(x, y) + + def codegen(cgctx, builder, tyargs, llargs): + return builder.add(*llargs) + + return sig, codegen + + # CPU can use the CPU version + @njit + def cpu_foo_specific(): + return intrin_math_cpu(3, 4) + + self.assertEqual(cpu_foo_specific(), 7) + + # CPU can use the 'generic' version + @njit + def cpu_foo_generic(): + return intrin_math_generic(3, 4) + + self.assertEqual(cpu_foo_generic(), 12) + + # CPU cannot use the 'dpu' version + @njit + def cpu_foo_dpu(): + return intrin_math_dpu(3, 4) + + accept = (errors.UnsupportedError, errors.TypingError) + with self.assertRaises(accept) as raises: + cpu_foo_dpu() + + msgs = ["Function resolution cannot find any matches for function", + "intrinsic intrin_math_dpu", + "for the current target",] + for msg in msgs: + self.assertIn(msg, str(raises.exception)) + + # DPU can use the DPU version + @djit(nopython=True) + def dpu_foo_specific(): + return intrin_math_dpu(3, 4) + + self.assertEqual(dpu_foo_specific(), -1) + + # DPU can use the 'generic' version + @djit(nopython=True) + def dpu_foo_generic(): + return intrin_math_generic(3, 4) + + self.assertEqual(dpu_foo_generic(), 12) + + # DPU cannot use the 'cpu' version + @djit(nopython=True) + def dpu_foo_cpu(): + return intrin_math_cpu(3, 4) + + accept = (errors.UnsupportedError, errors.TypingError) + with self.assertRaises(accept) as raises: + dpu_foo_cpu() + + msgs = ["Function resolution cannot find any matches for function", + "intrinsic intrin_math_cpu", + "for the current target",] + for msg in msgs: + self.assertIn(msg, str(raises.exception)) + + def test_overload_allocation(self): + def cast_integer(context, builder, val, fromty, toty): + # XXX Shouldn't require this. + if toty.bitwidth == fromty.bitwidth: + # Just a change of signedness + return val + elif toty.bitwidth < fromty.bitwidth: + # Downcast + return builder.trunc(val, context.get_value_type(toty)) + elif fromty.signed: + # Signed upcast + return builder.sext(val, context.get_value_type(toty)) + else: + # Unsigned upcast + return builder.zext(val, context.get_value_type(toty)) + + @intrinsic(target='dpu') + def intrin_alloc(typingctx, allocsize, align): + """Intrinsic to call into the allocator for Array + """ + def codegen(context, builder, signature, args): + [allocsize, align] = args + + # XXX: error are being eaten. + # example: replace the next line with `align_u32 = align` + align_u32 = cast_integer(context, builder, align, + signature.args[1], types.uint32) + meminfo = context.nrt.meminfo_alloc_aligned(builder, allocsize, + align_u32) + return meminfo + + from numba.core.typing import signature + mip = types.MemInfoPointer(types.voidptr) # return untyped pointer + sig = signature(mip, allocsize, align) + return sig, codegen + + @overload_classmethod(types.Array, '_allocate', target='dpu', + jit_options={'nopython':True}) + def _ol_arr_allocate_dpu(cls, allocsize, align): + def impl(cls, allocsize, align): + return intrin_alloc(allocsize, align) + return impl + + @overload(np.empty, target='dpu', jit_options={'nopython':True}) + def ol_empty_impl(n): + def impl(n): + return types.Array._allocate(n, 7) + return impl + + def buffer_func(): + pass + + @overload(buffer_func, target='dpu', jit_options={'nopython':True}) + def ol_buffer_func_impl(): + def impl(): + return np.empty(10) + return impl + + from numba.core.target_extension import target_override + + # XXX: this should probably go inside the dispatcher + with target_override('dpu'): + @djit(nopython=True) + def foo(): + return buffer_func() + r = foo() + from numba.core.runtime import nrt + self.assertIsInstance(r, nrt.MemInfo) + + def test_overload_attribute_target(self): + MyDummy, MyDummyType = self.make_dummy_type() + mydummy_type = typeof(MyDummy()) + + @overload_attribute(MyDummyType, 'dpu_only', target='dpu') + def ov_dummy_dpu_attr(obj): + def imp(obj): + return 42 + + return imp + + # Ensure that we cannot use the DPU target-specific attribute on the + # CPU, and that an appropriate typing error is raised + with self.assertRaisesRegex(errors.TypingError, + "Unknown attribute 'dpu_only'"): + @njit(types.int64(mydummy_type)) + def illegal_target_attr_use(x): + return x.dpu_only + + # Ensure that the DPU target-specific attribute is usable and works + # correctly when the target is DPU - note eager compilation via + # signature + @djit(types.void(types.int64[::1], mydummy_type)) + def cuda_target_attr_use(res, dummy): + res[0] = dummy.dpu_only + + +class TestTargetOffload(TestCase): + """In this use case the CPU compilation pipeline is extended with a new + compilation pass that runs just prior to lowering. The pass looks for + function calls and when it finds one it sees if there's a DPU function + available that is a valid overload for the function call. If there is one + then it swaps the CPU implementation out for a DPU implementation. This + producing an "offload" effect. + """ + + def test_basic_offload(self): + + _DEBUG = False + + # This is the DPU function for sin, it'll return a pi-like constant + @overload(np.sin, target="dpu") + def ol_np_sin_DPU(x): + def dpu_sin_impl(x): + return 314159.0 + + return dpu_sin_impl + + # Check the DPU reports the correct overload value + @djit(nopython=True) + def foo(x): + return np.sin(x) + + self.assertPreciseEqual(foo(5), 314159.0) + + # Check the CPU call is correct + + @njit + def foo(x): + return np.sin(x) + + self.assertPreciseEqual(foo(5), np.sin(5)) + + @register_pass(mutates_CFG=False, analysis_only=False) + class DispatcherSwitcher(FunctionPass): + _name = "DispatcherSwitcher" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + func_ir = state.func_ir + mutated = False + for blk in func_ir.blocks.values(): + # find the assignment nodes in the block and walk them, if + # there's a DPU version then swap out for a call to that + for call in blk.find_exprs("call"): + function = state.typemap[call.func.name] + tname = "dpu" + + # Note: `target_override` context driven compilation can + # be done here, the DPU target is in use. + with target_override(tname): + try: + sig = function.get_call_type( + state.typingctx, + state.calltypes[call].args, + {}, + ) + disp = resolve_dispatcher_from_str(tname) + # force compile check + hw_ctx = disp.targetdescr.target_context + hw_ctx.get_function(function, sig) + except Exception as e: + if _DEBUG: + msg = ( + f"Failed to find and compile an " + f"overload for {function} for {tname} " + f"due to {e}" + ) + print(msg) + continue + + # This is a necessary hack at present so as to + # generate code into the same library. I.e. the DPU + # target is going to do code gen into the CPUs lib. + hw_ctx._codelib_stack = ( + state.targetctx._codelib_stack + ) + + # All is good, so switch IR node for one targeting + # this target. Should generate this, but for now + # just mutate as: + # ir.Expr.call(call.func, call.args, call.kws, + # call.loc, target='dpu') + call.target = tname + mutated = True + # return True if the IR was mutated, False if not. + return mutated + + # DPU compiler pipeline, compiles with offload to the DPU target + class DPUOffloadCompiler(CompilerBase): + def define_pipelines(self): + pm = DefaultPassBuilder.define_nopython_pipeline(self.state) + pm.add_pass_after(DispatcherSwitcher, PreLowerStripPhis) + pm.finalize() + return [pm] + + # Now compile for CPU, but with the DispatcherSwitcher pass in place + # that switches CPU calls for DPU calls + @njit(pipeline_class=DPUOffloadCompiler) + def foo(x): + return np.sin(x), np.cos(x) # np.sin is DPU, np.cos is CPU + + self.assertPreciseEqual(foo(5), (314159.0, np.cos(5))) + + +if __name__ == "__main__": + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_target_overloadselector.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_target_overloadselector.py new file mode 100644 index 0000000000000000000000000000000000000000..8fa54bccc65057b62b331c24c698d71a8d1caaac --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_target_overloadselector.py @@ -0,0 +1,148 @@ +from itertools import product, permutations +from collections import defaultdict + +import unittest +from numba.core.base import OverloadSelector +from numba.core.registry import cpu_target +from numba.core.imputils import builtin_registry, RegistryLoader +from numba.core import types +from numba.core.errors import NumbaNotImplementedError, NumbaTypeError + + +class TestOverloadSelector(unittest.TestCase): + def test_select_and_sort_1(self): + os = OverloadSelector() + os.append(1, (types.Any, types.Boolean)) + os.append(2, (types.Boolean, types.Integer)) + os.append(3, (types.Boolean, types.Any)) + os.append(4, (types.Boolean, types.Boolean)) + compats = os._select_compatible((types.boolean, types.boolean)) + self.assertEqual(len(compats), 3) + ordered, scoring = os._sort_signatures(compats) + self.assertEqual(len(ordered), 3) + self.assertEqual(len(scoring), 3) + self.assertEqual(ordered[0], (types.Boolean, types.Boolean)) + self.assertEqual(scoring[types.Boolean, types.Boolean], 0) + self.assertEqual(scoring[types.Boolean, types.Any], 1) + self.assertEqual(scoring[types.Any, types.Boolean], 1) + + def test_select_and_sort_2(self): + os = OverloadSelector() + os.append(1, (types.Container,)) + os.append(2, (types.Sequence,)) + os.append(3, (types.MutableSequence,)) + os.append(4, (types.List,)) + compats = os._select_compatible((types.List,)) + self.assertEqual(len(compats), 4) + ordered, scoring = os._sort_signatures(compats) + self.assertEqual(len(ordered), 4) + self.assertEqual(len(scoring), 4) + self.assertEqual(ordered[0], (types.List,)) + self.assertEqual(scoring[(types.List,)], 0) + self.assertEqual(scoring[(types.MutableSequence,)], 1) + self.assertEqual(scoring[(types.Sequence,)], 2) + self.assertEqual(scoring[(types.Container,)], 3) + + def test_match(self): + os = OverloadSelector() + self.assertTrue(os._match(formal=types.Boolean, actual=types.boolean)) + self.assertTrue(os._match(formal=types.Boolean, actual=types.Boolean)) + # test subclass + self.assertTrue(issubclass(types.Sequence, types.Container)) + self.assertTrue(os._match(formal=types.Container, + actual=types.Sequence)) + self.assertFalse(os._match(formal=types.Sequence, + actual=types.Container)) + # test any + self.assertTrue(os._match(formal=types.Any, actual=types.Any)) + self.assertTrue(os._match(formal=types.Any, actual=types.Container)) + self.assertFalse(os._match(formal=types.Container, actual=types.Any)) + + def test_ambiguous_detection(self): + os = OverloadSelector() + # unambiguous signatures + os.append(1, (types.Any, types.Boolean)) + os.append(2, (types.Integer, types.Boolean)) + self.assertEqual(os.find((types.boolean, types.boolean)), 1) + # not implemented + with self.assertRaises(NumbaNotImplementedError) as raises: + os.find((types.boolean, types.int32)) + # generic + os.append(3, (types.Any, types.Any)) + self.assertEqual(os.find((types.boolean, types.int32)), 3) + self.assertEqual(os.find((types.boolean, types.boolean)), 1) + # add ambiguous signature; can match (bool, any) and (any, bool) + os.append(4, (types.Boolean, types.Any)) + with self.assertRaises(NumbaTypeError) as raises: + os.find((types.boolean, types.boolean)) + self.assertIn('2 ambiguous signatures', str(raises.exception)) + # disambiguous + os.append(5, (types.boolean, types.boolean)) + self.assertEqual(os.find((types.boolean, types.boolean)), 5) + + def test_subclass_specialization(self): + os = OverloadSelector() + self.assertTrue(issubclass(types.Sequence, types.Container)) + os.append(1, (types.Container, types.Container,)) + lstty = types.List(types.boolean) + self.assertEqual(os.find((lstty, lstty)), 1) + os.append(2, (types.Container, types.Sequence,)) + self.assertEqual(os.find((lstty, lstty)), 2) + + def test_cache(self): + os = OverloadSelector() + self.assertEqual(len(os._cache), 0) + os.append(1, (types.Any,)) + self.assertEqual(os.find((types.int32,)), 1) + self.assertEqual(len(os._cache), 1) + os.append(2, (types.Integer,)) + self.assertEqual(len(os._cache), 0) + self.assertEqual(os.find((types.int32,)), 2) + self.assertEqual(len(os._cache), 1) + + +class TestAmbiguousOverloads(unittest.TestCase): + + @classmethod + def setUpClass(cls): + # ensure all impls are loaded + cpu_target.target_context.refresh() + + def create_overload_selector(self, kind): + os = OverloadSelector() + loader = RegistryLoader(builtin_registry) + for impl, sig in loader.new_registrations(kind): + os.append(impl, sig) + return os + + def test_ambiguous_casts(self): + os = self.create_overload_selector(kind='casts') + all_types = set(t for sig, impl in os.versions for t in sig) + # ensure there are no ambiguous cast overloads + # note: using permutations to avoid testing cast to the same type + for sig in permutations(all_types, r=2): + try: + os.find(sig) + except NumbaNotImplementedError: + pass # ignore not implemented cast + + def test_ambiguous_functions(self): + loader = RegistryLoader(builtin_registry) + selectors = defaultdict(OverloadSelector) + for impl, fn, sig in loader.new_registrations('functions'): + os = selectors[fn] + os.append(impl, sig) + + for fn, os in selectors.items(): + all_types = set(t for sig, impl in os.versions for t in sig) + # ensure there are no ambiguous overloads + for sig in product(all_types, all_types): + try: + os.find(sig) + except NumbaNotImplementedError: + pass # ignore not implemented cast + + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_threadsafety.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_threadsafety.py new file mode 100644 index 0000000000000000000000000000000000000000..19a974e244fc0e17ee72887089c74e71dde7b575 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_threadsafety.py @@ -0,0 +1,97 @@ +""" +Test threadsafety for compiler. +These tests will cause segfault if fail. +""" +import threading +import random + +import numpy as np + +from numba import jit, vectorize, guvectorize + +from numba.tests.support import temp_directory, override_config +from numba.core import config +import unittest + + +def foo(n, v): + return np.ones(n) + + +def ufunc_foo(a, b): + return a + b + + +def gufunc_foo(a, b, out): + out[0] = a + b + + + +class TestThreadSafety(unittest.TestCase): + + def run_jit(self, **options): + def runner(): + cfunc = jit(**options)(foo) + + return cfunc(4, 10) + return runner + + def run_compile(self, fnlist): + self._cache_dir = temp_directory(self.__class__.__name__) + with override_config('CACHE_DIR', self._cache_dir): + def chooser(): + for _ in range(10): + fn = random.choice(fnlist) + fn() + + ths = [threading.Thread(target=chooser) + for i in range(4)] + for th in ths: + th.start() + for th in ths: + th.join() + + def test_concurrent_jit(self): + self.run_compile([self.run_jit(nopython=True)]) + + def test_concurrent_jit_cache(self): + self.run_compile([self.run_jit(nopython=True, cache=True)]) + + def run_vectorize(self, **options): + def runner(): + cfunc = vectorize(['(f4, f4)'], **options)(ufunc_foo) + a = b = np.random.random(10).astype(np.float32) + return cfunc(a, b) + return runner + + def test_concurrent_vectorize(self): + self.run_compile([self.run_vectorize(nopython=True)]) + + def test_concurrent_vectorize_cache(self): + self.run_compile([self.run_vectorize(nopython=True, cache=True)]) + + def run_guvectorize(self, **options): + def runner(): + sig = ['(f4, f4, f4[:])'] + cfunc = guvectorize(sig, '(),()->()', **options)(gufunc_foo) + a = b = np.random.random(10).astype(np.float32) + return cfunc(a, b) + return runner + + def test_concurrent_guvectorize(self): + self.run_compile([self.run_guvectorize(nopython=True)]) + + def test_concurrent_guvectorize_cache(self): + self.run_compile([self.run_guvectorize(nopython=True, cache=True)]) + + def test_concurrent_mix_use(self): + self.run_compile([self.run_jit(nopython=True, cache=True), + self.run_jit(nopython=True), + self.run_vectorize(nopython=True, cache=True), + self.run_vectorize(nopython=True), + self.run_guvectorize(nopython=True, cache=True), + self.run_guvectorize(nopython=True)]) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_tracing.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_tracing.py new file mode 100644 index 0000000000000000000000000000000000000000..0ab895efa2c73baac757857e568825e25794de03 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_tracing.py @@ -0,0 +1,182 @@ +from io import StringIO +import logging + +import unittest +from numba.core import tracing + +logger = logging.getLogger('trace') +logger.setLevel(logging.INFO) + +# Make sure tracing is enabled +orig_trace = tracing.trace +tracing.trace = tracing.dotrace + +class CapturedTrace: + """Capture the trace temporarily for validation.""" + + def __init__(self): + self.buffer = StringIO() + self.handler = logging.StreamHandler(self.buffer) + def __enter__(self): + self._handlers = logger.handlers + self.buffer = StringIO() + logger.handlers = [logging.StreamHandler(self.buffer)] + def __exit__(self, type, value, traceback): + logger.handlers = self._handlers + def getvalue(self): + + # Depending on how the tests are run, object names may be + # qualified by their containing module. + # Remove that to make the trace output independent from the testing mode. + log = self.buffer.getvalue() + log = log.replace(__name__ + '.','') + return log + +class Class(object): + + @tracing.trace + @classmethod + def class_method(cls): + pass + + @tracing.trace + @staticmethod + def static_method(): + pass + + __test = None + + def _test_get(self): + return self.__test + + def _test_set(self, value): + self.__test = value + + test = tracing.trace(property(_test_get, _test_set)) + + @tracing.trace + def method(self, some, other='value', *args, **kwds): + pass + + def __repr__(self): + """Generate a deterministic string for testing.""" + return '' + +class Class2(object): + @classmethod + def class_method(cls): + pass + + @staticmethod + def static_method(): + pass + + __test = None + @property + def test(self): + return self.__test + @test.setter + def test(self, value): + self.__test = value + + def method(self): + pass + + def __str__(self): + return 'Test(' + str(self.test) + ')' + + def __repr__(self): + """Generate a deterministic string for testing.""" + return '' + + +@tracing.trace +def test(x, y, z = True): + a = x + y + b = x * y + if z: return a + else: return b + +class TestTracing(unittest.TestCase): + + def __init__(self, *args): + super(TestTracing, self).__init__(*args) + + def setUp(self): + self.capture = CapturedTrace() + + def tearDown(self): + del self.capture + + def test_method(self): + + with self.capture: + Class().method('foo', bar='baz') + self.assertEqual(self.capture.getvalue(), + ">> Class.method(self=, some='foo', other='value', bar='baz')\n" + + "<< Class.method\n") + + def test_class_method(self): + + with self.capture: + Class.class_method() + self.assertEqual(self.capture.getvalue(), + ">> Class.class_method(cls=)\n" + + "<< Class.class_method\n") + + def test_static_method(self): + + with self.capture: + Class.static_method() + self.assertEqual(self.capture.getvalue(), + ">> static_method()\n" + + "<< static_method\n") + + + def test_property(self): + + with self.capture: + test = Class() + test.test = 1 + assert 1 == test.test + self.assertEqual(self.capture.getvalue(), + ">> Class._test_set(self=, value=1)\n" + + "<< Class._test_set\n" + + ">> Class._test_get(self=)\n" + + "<< Class._test_get -> 1\n") + + def test_function(self): + + with self.capture: + test(5, 5) + test(5, 5, False) + self.assertEqual(self.capture.getvalue(), + ">> test(x=5, y=5, z=True)\n" + + "<< test -> 10\n" + + ">> test(x=5, y=5, z=False)\n" + + "<< test -> 25\n") + + @unittest.skip("recursive decoration not yet implemented") + def test_injected(self): + + with self.capture: + tracing.trace(Class2, recursive=True) + Class2.class_method() + Class2.static_method() + test = Class2() + test.test = 1 + assert 1 == test.test + test.method() + + self.assertEqual(self.capture.getvalue(), + ">> Class2.class_method(cls=)\n" + + "<< Class2.class_method\n" + ">> static_method()\n" + "<< static_method\n") + + +# Reset tracing to its original value +tracing.trace = orig_trace + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_try_except.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_try_except.py new file mode 100644 index 0000000000000000000000000000000000000000..8239a948a3b0ab52512760b4f73be8044ed9038b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_try_except.py @@ -0,0 +1,849 @@ +import warnings +import dis +from itertools import product + +import numpy as np + +from numba import njit, typed, objmode, prange +from numba.core import ir_utils, ir +from numba.core.errors import ( + CompilerError, NumbaPerformanceWarning, TypingError, + UnsupportedBytecodeError, +) +from numba.tests.support import ( + TestCase, unittest, captured_stdout, MemoryLeakMixin, + skip_parfors_unsupported, skip_unless_scipy, expected_failure_py311, + expected_failure_py312, expected_failure_py313, +) + + +class MyError(Exception): + pass + + +class TestTryBareExcept(TestCase): + """Test the following pattern: + + try: + + except: + + """ + def test_try_inner_raise(self): + @njit + def inner(x): + if x: + raise MyError + + @njit + def udt(x): + try: + inner(x) + return "not raised" + except: # noqa: E722 + return "caught" + + self.assertEqual(udt(False), "not raised") + self.assertEqual(udt(True), "caught") + + def test_try_state_reset(self): + @njit + def inner(x): + if x == 1: + raise MyError("one") + elif x == 2: + raise MyError("two") + + @njit + def udt(x): + try: + inner(x) + res = "not raised" + except: # noqa: E722 + res = "caught" + if x == 0: + inner(2) + return res + + with self.assertRaises(MyError) as raises: + udt(0) + self.assertEqual(str(raises.exception), "two") + self.assertEqual(udt(1), "caught") + self.assertEqual(udt(-1), "not raised") + + def _multi_inner(self): + @njit + def inner(x): + if x == 1: + print("call_one") + raise MyError("one") + elif x == 2: + print("call_two") + raise MyError("two") + elif x == 3: + print("call_three") + raise MyError("three") + else: + print("call_other") + + return inner + + def test_nested_try(self): + inner = self._multi_inner() + + @njit + def udt(x, y, z): + try: + try: + print("A") + inner(x) + print("B") + except: # noqa: E722 + print("C") + inner(y) + print("D") + except: # noqa: E722 + print("E") + inner(z) + print("F") + + # case 1 + with self.assertRaises(MyError) as raises: + with captured_stdout() as stdout: + udt(1, 2, 3) + self.assertEqual( + stdout.getvalue().split(), + ["A", "call_one", "C", "call_two", "E", "call_three"], + ) + self.assertEqual(str(raises.exception), "three") + + # case 2 + with captured_stdout() as stdout: + udt(1, 0, 3) + self.assertEqual( + stdout.getvalue().split(), + ["A", "call_one", "C", "call_other", "D"], + ) + + # case 3 + with captured_stdout() as stdout: + udt(1, 2, 0) + self.assertEqual( + stdout.getvalue().split(), + ["A", "call_one", "C", "call_two", "E", "call_other", "F"], + ) + + def test_loop_in_try(self): + inner = self._multi_inner() + + @njit + def udt(x, n): + try: + print("A") + for i in range(n): + print(i) + if i == x: + inner(i) + except: # noqa: E722 + print("B") + return i + + # case 1 + with captured_stdout() as stdout: + res = udt(3, 5) + self.assertEqual( + stdout.getvalue().split(), + ["A", "0", "1", "2", "3", "call_three", "B"], + ) + self.assertEqual(res, 3) + + # case 2 + with captured_stdout() as stdout: + res = udt(1, 3) + self.assertEqual( + stdout.getvalue().split(), + ["A", "0", "1", "call_one", "B"], + ) + self.assertEqual(res, 1) + + # case 3 + with captured_stdout() as stdout: + res = udt(0, 3) + self.assertEqual( + stdout.getvalue().split(), + ["A", "0", "call_other", "1", "2"], + ) + self.assertEqual(res, 2) + + def test_raise_in_try(self): + @njit + def udt(x): + try: + print("A") + if x: + raise MyError("my_error") + print("B") + except: # noqa: E722 + print("C") + return 321 + return 123 + + # case 1 + with captured_stdout() as stdout: + res = udt(True) + + self.assertEqual( + stdout.getvalue().split(), + ["A", "C"], + ) + self.assertEqual(res, 321) + + # case 2 + with captured_stdout() as stdout: + res = udt(False) + + self.assertEqual( + stdout.getvalue().split(), + ["A", "B"], + ) + self.assertEqual(res, 123) + + def test_recursion(self): + @njit + def foo(x): + if x > 0: + try: + foo(x - 1) + except: # noqa: E722 + print("CAUGHT") + return 12 + if x == 1: + raise ValueError("exception") + + with captured_stdout() as stdout: + res = foo(10) + + self.assertIsNone(res) + self.assertEqual(stdout.getvalue().split(), ["CAUGHT",],) + + def test_yield(self): + @njit + def foo(x): + if x > 0: + try: + yield 7 + raise ValueError("exception") # never hit + except Exception: + print("CAUGHT") + + @njit + def bar(z): + return next(foo(z)) + + with captured_stdout() as stdout: + res = bar(10) + + self.assertEqual(res, 7) + self.assertEqual(stdout.getvalue().split(), []) + + def test_closure2(self): + @njit + def foo(x): + def bar(): + try: + raise ValueError("exception") + except: # noqa: E722 + print("CAUGHT") + return 12 + bar() + + with captured_stdout() as stdout: + foo(10) + + self.assertEqual(stdout.getvalue().split(), ["CAUGHT",],) + + def test_closure3(self): + @njit + def foo(x): + def bar(z): + try: + raise ValueError("exception") + except: # noqa: E722 + print("CAUGHT") + return z + return [x for x in map(bar, [1, 2, 3])] + + with captured_stdout() as stdout: + res = foo(10) + + self.assertEqual(res, [1, 2, 3]) + self.assertEqual(stdout.getvalue().split(), ["CAUGHT",] * 3,) + + def test_closure4(self): + @njit + def foo(x): + def bar(z): + if z < 0: + raise ValueError("exception") + return z + + try: + return [x for x in map(bar, [1, 2, 3, x])] + except: # noqa: E722 + print("CAUGHT") + + with captured_stdout() as stdout: + res = foo(-1) + + self.assertEqual(stdout.getvalue().strip(), "CAUGHT") + self.assertIsNone(res) + + with captured_stdout() as stdout: + res = foo(4) + self.assertEqual(stdout.getvalue(), "") + self.assertEqual(res, [1, 2, 3, 4]) + + @skip_unless_scipy + def test_real_problem(self): + @njit + def foo(): + a = np.zeros((4, 4)) + try: + chol = np.linalg.cholesky(a) + except: # noqa: E722 + print("CAUGHT") + return chol + + with captured_stdout() as stdout: + foo() + + self.assertEqual(stdout.getvalue().split(), ["CAUGHT",]) + + def test_for_loop(self): + @njit + def foo(n): + + for i in range(n): + try: + if i > 5: + raise ValueError + except: # noqa: E722 + print("CAUGHT") + else: + try: + try: + try: + if i > 5: + raise ValueError + except: # noqa: E722 + print("CAUGHT1") + raise ValueError + except: # noqa: E722 + print("CAUGHT2") + raise ValueError + except: # noqa: E722 + print("CAUGHT3") + + with captured_stdout() as stdout: + foo(10) + + self.assertEqual( + stdout.getvalue().split(), + ["CAUGHT",] * 4 + ["CAUGHT%s" % i for i in range(1, 4)], + ) + + def test_try_pass(self): + @njit + def foo(x): + try: + pass + except: # noqa: E722 + pass + return x + + res = foo(123) + self.assertEqual(res, 123) + + def test_try_except_reraise(self): + @njit + def udt(): + try: + raise ValueError("ERROR") + except: # noqa: E722 + raise + + with self.assertRaises(UnsupportedBytecodeError) as raises: + udt() + self.assertIn( + "The re-raising of an exception is not yet supported.", + str(raises.exception), + ) + + +class TestTryExceptCaught(TestCase): + def test_catch_exception(self): + @njit + def udt(x): + try: + print("A") + if x: + raise ZeroDivisionError("321") + print("B") + except Exception: + print("C") + print("D") + + # case 1 + with captured_stdout() as stdout: + udt(True) + + self.assertEqual( + stdout.getvalue().split(), + ["A", "C", "D"], + ) + + # case 2 + with captured_stdout() as stdout: + udt(False) + + self.assertEqual( + stdout.getvalue().split(), + ["A", "B", "D"], + ) + + def test_return_in_catch(self): + @njit + def udt(x): + try: + print("A") + if x: + raise ZeroDivisionError + print("B") + r = 123 + except Exception: + print("C") + r = 321 + return r + print("D") + return r + + # case 1 + with captured_stdout() as stdout: + res = udt(True) + + self.assertEqual( + stdout.getvalue().split(), + ["A", "C"], + ) + self.assertEqual(res, 321) + + # case 2 + with captured_stdout() as stdout: + res = udt(False) + + self.assertEqual( + stdout.getvalue().split(), + ["A", "B", "D"], + ) + self.assertEqual(res, 123) + + def test_save_caught(self): + @njit + def udt(x): + try: + if x: + raise ZeroDivisionError + r = 123 + except Exception as e: # noqa: F841 + r = 321 + return r + return r + + with self.assertRaises(UnsupportedBytecodeError) as raises: + udt(True) + self.assertIn( + "Exception object cannot be stored into variable (e)", + str(raises.exception) + ) + + def test_try_except_reraise(self): + @njit + def udt(): + try: + raise ValueError("ERROR") + except Exception: + raise + + with self.assertRaises(UnsupportedBytecodeError) as raises: + udt() + self.assertIn( + "The re-raising of an exception is not yet supported.", + str(raises.exception), + ) + + def test_try_except_reraise_chain(self): + @njit + def udt(): + try: + raise ValueError("ERROR") + except Exception: + try: + raise + except Exception: + raise + + with self.assertRaises(UnsupportedBytecodeError) as raises: + udt() + self.assertIn( + "The re-raising of an exception is not yet supported.", + str(raises.exception), + ) + + def test_division_operator(self): + # This test that old-style implementation propagate exception + # to the exception handler properly. + @njit + def udt(y): + try: + 1 / y + except Exception: + return 0xdead + else: + return 1 / y + + self.assertEqual(udt(0), 0xdead) + self.assertEqual(udt(2), 0.5) + + +class TestTryExceptNested(TestCase): + "Tests for complicated nesting" + + def check_compare(self, cfunc, pyfunc, *args, **kwargs): + with captured_stdout() as stdout: + pyfunc(*args, **kwargs) + expect = stdout.getvalue() + + with captured_stdout() as stdout: + cfunc(*args, **kwargs) + got = stdout.getvalue() + self.assertEqual( + expect, got, + msg="args={} kwargs={}".format(args, kwargs) + ) + + def test_try_except_else(self): + @njit + def udt(x, y, z, p): + print('A') + if x: + print('B') + try: + print('C') + if y: + print('D') + raise MyError("y") + print('E') + except Exception: # noqa: F722 + print('F') + try: + print('H') + try: + print('I') + if z: + print('J') + raise MyError('z') + print('K') + except Exception: + print('L') + else: + print('M') + except Exception: + print('N') + else: + print('O') + print('P') + else: + print('G') + print('Q') + print('R') + + cases = list(product([True, False], repeat=4)) + self.assertTrue(cases) + for x, y, z, p in cases: + self.check_compare( + udt, udt.py_func, + x=x, y=y, z=z, p=p, + ) + + def test_try_except_finally(self): + @njit + def udt(p, q): + try: + print('A') + if p: + print('B') + raise MyError + print('C') + except: # noqa: E722 + print('D') + finally: + try: + print('E') + if q: + print('F') + raise MyError + except Exception: + print('G') + else: + print('H') + finally: + print('I') + + cases = list(product([True, False], repeat=2)) + self.assertTrue(cases) + for p, q in cases: + self.check_compare( + udt, udt.py_func, + p=p, q=q, + ) + + +class TestTryExceptRefct(MemoryLeakMixin, TestCase): + def test_list_direct_raise(self): + @njit + def udt(n, raise_at): + lst = typed.List() + try: + for i in range(n): + if i == raise_at: + raise IndexError + lst.append(i) + except Exception: + return lst + else: + return lst + + out = udt(10, raise_at=5) + self.assertEqual(list(out), list(range(5))) + out = udt(10, raise_at=10) + self.assertEqual(list(out), list(range(10))) + + def test_list_indirect_raise(self): + @njit + def appender(lst, n, raise_at): + for i in range(n): + if i == raise_at: + raise IndexError + lst.append(i) + return lst + + @njit + def udt(n, raise_at): + lst = typed.List() + lst.append(0xbe11) + try: + appender(lst, n, raise_at) + except Exception: + return lst + else: + return lst + + out = udt(10, raise_at=5) + self.assertEqual(list(out), [0xbe11] + list(range(5))) + out = udt(10, raise_at=10) + self.assertEqual(list(out), [0xbe11] + list(range(10))) + + def test_incompatible_refinement(self): + @njit + def udt(): + try: + lst = typed.List() + print("A") + lst.append(0) + print("B") + lst.append("fda") # invalid type will cause typing error + print("C") + return lst + except Exception: + print("D") + + with self.assertRaises(TypingError) as raises: + udt() + self.assertRegex( + str(raises.exception), + r"Cannot refine type|cannot safely cast unicode_type to int(32|64)" + ) + + +class TestTryExceptOtherControlFlow(TestCase): + def test_yield(self): + @njit + def udt(n, x): + for i in range(n): + try: + if i == x: + raise ValueError + yield i + except Exception: + return + + self.assertEqual(list(udt(10, 5)), list(range(5))) + self.assertEqual(list(udt(10, 10)), list(range(10))) + + @expected_failure_py311 + @expected_failure_py312 + @expected_failure_py313 + def test_objmode(self): + @njit + def udt(): + try: + with objmode(): + print(object()) + except Exception: + return + + with self.assertRaises(CompilerError) as raises: + udt() + msg = ("unsupported control flow: with-context contains branches " + "(i.e. break/return/raise) that can leave the block ") + self.assertIn( + msg, + str(raises.exception), + ) + + @expected_failure_py311 + @expected_failure_py312 + @expected_failure_py313 + def test_objmode_output_type(self): + def bar(x): + return np.asarray(list(reversed(x.tolist()))) + + @njit + def test_objmode(): + x = np.arange(5) + y = np.zeros_like(x) + try: + with objmode(y='intp[:]'): # annotate return type + # this region is executed by object-mode. + y += bar(x) + except Exception: + pass + return y + + with self.assertRaises(CompilerError) as raises: + test_objmode() + msg = ("unsupported control flow: with-context contains branches " + "(i.e. break/return/raise) that can leave the block ") + self.assertIn( + msg, + str(raises.exception), + ) + + def test_reraise_opcode_unreachable(self): + # The opcode RERAISE was added in python 3.9, there should be no + # supported way to actually reach it. This test just checks that an + # exception is present to deal with if it is reached in a case known + # to produce this opcode. + def pyfunc(): + try: + raise Exception + except Exception: + raise ValueError("ERROR") + for inst in dis.get_instructions(pyfunc): + if inst.opname == 'RERAISE': + break + else: + self.fail("expected RERAISE opcode not found") + func_ir = ir_utils.get_ir_of_code({}, pyfunc.__code__) + found = False + for lbl, blk in func_ir.blocks.items(): + for stmt in blk.find_insts(ir.StaticRaise): + # don't worry about guarding this strongly, if the exec_args[0] + # is a string it'll either be "ERROR" or the guard message + # saying unreachable has been reached + msg = "Unreachable condition reached (op code RERAISE executed)" + if stmt.exc_args and msg in stmt.exc_args[0]: + found = True + if not found: + self.fail("expected RERAISE unreachable message not found") + + +@skip_parfors_unsupported +class TestTryExceptParfors(TestCase): + + def test_try_in_prange_reduction(self): + # The try-except is transformed basically into chains of if-else + def udt(n): + c = 0 + for i in prange(n): + try: + c += 1 + except Exception: + c += 1 + return c + + args = [10] + expect = udt(*args) + self.assertEqual(njit(parallel=False)(udt)(*args), expect) + self.assertEqual(njit(parallel=True)(udt)(*args), expect) + + def test_try_outside_prange_reduction(self): + # The try-except is transformed basically into chains of if-else + def udt(n): + c = 0 + try: + for i in prange(n): + c += 1 + except Exception: + return 0xdead + else: + return c + + args = [10] + expect = udt(*args) + self.assertEqual(njit(parallel=False)(udt)(*args), expect) + # Parfors transformation didn't happen + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', NumbaPerformanceWarning) + self.assertEqual(njit(parallel=True)(udt)(*args), expect) + self.assertEqual(len(w), 1) + self.assertIn("no transformation for parallel execution was possible", + str(w[0])) + + def test_try_in_prange_map(self): + def udt(arr, x): + out = arr.copy() + for i in prange(arr.size): + try: + if i == x: + raise ValueError + out[i] = arr[i] + i + except Exception: + out[i] = -1 + return out + + args = [np.arange(10), 6] + expect = udt(*args) + self.assertPreciseEqual(njit(parallel=False)(udt)(*args), expect) + self.assertPreciseEqual(njit(parallel=True)(udt)(*args), expect) + + def test_try_outside_prange_map(self): + def udt(arr, x): + out = arr.copy() + try: + for i in prange(arr.size): + if i == x: + raise ValueError + out[i] = arr[i] + i + except Exception: + out[i] = -1 + return out + + args = [np.arange(10), 6] + expect = udt(*args) + self.assertPreciseEqual(njit(parallel=False)(udt)(*args), expect) + self.assertPreciseEqual(njit(parallel=True)(udt)(*args), expect) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_tuples.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_tuples.py new file mode 100644 index 0000000000000000000000000000000000000000..44145197f16185bea8c661eeabc5813d1685a360 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_tuples.py @@ -0,0 +1,764 @@ +import collections +import itertools + +import numpy as np + +from numba import njit, jit, typeof, literally +from numba.core import types, errors, utils +from numba.tests.support import TestCase, MemoryLeakMixin, tag +import unittest + + +Rect = collections.namedtuple('Rect', ('width', 'height')) + +Point = collections.namedtuple('Point', ('x', 'y', 'z')) + +Point2 = collections.namedtuple('Point2', ('x', 'y', 'z')) + +Empty = collections.namedtuple('Empty', ()) + +def tuple_return_usecase(a, b): + return a, b + +def tuple_first(tup): + a, b = tup + return a + +def tuple_second(tup): + a, b = tup + return b + +def tuple_index(tup, idx): + return tup[idx] + +def tuple_index_static(tup): + # Note the negative index + return tup[-2] + +def tuple_slice2(tup): + return tup[1:-1] + +def tuple_slice3(tup): + return tup[1::2] + +def len_usecase(tup): + return len(tup) + +def add_usecase(a, b): + return a + b + +def eq_usecase(a, b): + return a == b + +def ne_usecase(a, b): + return a != b + +def gt_usecase(a, b): + return a > b + +def ge_usecase(a, b): + return a >= b + +def lt_usecase(a, b): + return a < b + +def le_usecase(a, b): + return a <= b + +def in_usecase(a, b): + return a in b + +def bool_usecase(tup): + return bool(tup), (3 if tup else 2) + +def getattr_usecase(tup): + return tup.z, tup.y, tup.x + +def make_point(a, b, c): + return Point(a, b, c) + +def make_point_kws(a, b, c): + return Point(z=c, y=b, x=a) + +def make_point_nrt(n): + r = Rect(list(range(n)), np.zeros(n + 1)) + # This also exercises attribute access + p = Point(r, len(r.width), len(r.height)) + return p + +def type_usecase(tup, *args): + return type(tup)(*args) + +def identity(tup): + return tup + +def index_method_usecase(tup, value): + return tup.index(value) + +def tuple_unpack_static_getitem_err(): + # see issue3895, `c` is imprecise + a, b, c, d = [], [], [], 0.0 + a.append(1) + b.append(1) + return + + +class TestTupleLengthError(unittest.TestCase): + + def test_tuple_length_error(self): + # issue 2195 + # raise an error on tuples greater than 1000 in length + @njit + def eattuple(tup): + return len(tup) + + with self.assertRaises(errors.UnsupportedError) as raises: + tup = tuple(range(1001)) + eattuple(tup) + + expected = "Tuple 'tup' length must be smaller than 1000" + self.assertIn(expected, str(raises.exception)) + +class TestTupleTypeNotIterable(unittest.TestCase): + ''' + issue 4369 + raise an error if 'type' is not iterable + ''' + def test_namedtuple_types_exception(self): + with self.assertRaises(errors.TypingError) as raises: + types.NamedTuple(types.uint32, 'p') + self.assertIn( + "Argument 'types' is not iterable", + str(raises.exception) + ) + + def test_tuple_types_exception(self): + with self.assertRaises(errors.TypingError) as raises: + types.Tuple((types.uint32)) + self.assertIn( + "Argument 'types' is not iterable", + str(raises.exception) + ) + + +class TestTupleReturn(TestCase): + + def test_array_tuple(self): + aryty = types.Array(types.float64, 1, 'C') + cfunc = njit((aryty, aryty))(tuple_return_usecase) + a = b = np.arange(5, dtype='float64') + ra, rb = cfunc(a, b) + self.assertPreciseEqual(ra, a) + self.assertPreciseEqual(rb, b) + del a, b + self.assertPreciseEqual(ra, rb) + + def test_scalar_tuple(self): + scalarty = types.float32 + cfunc = njit((scalarty, scalarty))(tuple_return_usecase) + a = b = 1 + ra, rb = cfunc(a, b) + self.assertEqual(ra, a) + self.assertEqual(rb, b) + + def test_hetero_tuple(self): + alltypes = [] + allvalues = [] + + alltypes.append((types.int32, types.int64)) + allvalues.append((1, 2)) + + alltypes.append((types.float32, types.float64)) + allvalues.append((1.125, .25)) + + alltypes.append((types.int32, types.float64)) + allvalues.append((1231, .5)) + + for (ta, tb), (a, b) in zip(alltypes, allvalues): + cfunc = njit((ta, tb))(tuple_return_usecase) + ra, rb = cfunc(a, b) + self.assertPreciseEqual((ra, rb), (a, b)) + + +class TestTuplePassing(TestCase): + + def test_unituple(self): + tuple_type = types.UniTuple(types.int32, 2) + cf_first = njit((tuple_type,))(tuple_first) + cf_second = njit((tuple_type,))(tuple_second) + self.assertPreciseEqual(cf_first((4, 5)), 4) + self.assertPreciseEqual(cf_second((4, 5)), 5) + + def test_hetero_tuple(self): + tuple_type = types.Tuple((types.int64, types.float32)) + cf_first = njit((tuple_type,))(tuple_first) + cf_second = njit((tuple_type,))(tuple_second) + self.assertPreciseEqual(cf_first((2**61, 1.5)), 2**61) + self.assertPreciseEqual(cf_second((2**61, 1.5)), 1.5) + + def test_size_mismatch(self): + # Issue #1638: tuple size should be checked when unboxing + tuple_type = types.UniTuple(types.int32, 2) + cfunc = njit((tuple_type,))(tuple_first) + entry_point = cfunc.overloads[cfunc.signatures[0]].entry_point + with self.assertRaises(ValueError) as raises: + entry_point((4, 5, 6)) + self.assertEqual(str(raises.exception), + ("size mismatch for tuple, " + "expected 2 element(s) but got 3")) + + +class TestOperations(TestCase): + + def test_len(self): + pyfunc = len_usecase + cfunc = njit((types.Tuple((types.int64, types.float32)),))(pyfunc) + self.assertPreciseEqual(cfunc((4, 5)), 2) + cfunc = njit((types.UniTuple(types.int64, 3),))(pyfunc) + self.assertPreciseEqual(cfunc((4, 5, 6)), 3) + + def test_index_literal(self): + # issue #6023, test non-static getitem with IntegerLiteral index + def pyfunc(tup, idx): + idx = literally(idx) + return tup[idx] + cfunc = njit(pyfunc) + + tup = (4, 3.1, 'sss') + for i in range(len(tup)): + self.assertPreciseEqual(cfunc(tup, i), tup[i]) + + def test_index(self): + pyfunc = tuple_index + cfunc = njit((types.UniTuple(types.int64, 3), types.int64),)(pyfunc) + tup = (4, 3, 6) + for i in range(len(tup)): + self.assertPreciseEqual(cfunc(tup, i), tup[i]) + + # test negative indexing + for i in range(len(tup) + 1): + self.assertPreciseEqual(cfunc(tup, -i), tup[-i]) + + # oob indexes, +ve then -ve + with self.assertRaises(IndexError) as raises: + cfunc(tup, len(tup)) + self.assertEqual("tuple index out of range", str(raises.exception)) + with self.assertRaises(IndexError) as raises: + cfunc(tup, -(len(tup) + 1)) + self.assertEqual("tuple index out of range", str(raises.exception)) + + # Test empty tuple, this is a bit unusual as `njit` will infer the empty + # tuple arg as a types.Tuple and not match the compiled signature, this + # is essentially because the test originally relied on + # `compile_isolated`. + args = (types.UniTuple(types.int64, 0), types.int64,) + cr = njit(args)(pyfunc).overloads[args] + with self.assertRaises(IndexError) as raises: + cr.entry_point((), 0) + self.assertEqual("tuple index out of range", str(raises.exception)) + + # test uintp indexing (because, e.g., parfor generates unsigned prange) + cfunc = njit((types.UniTuple(types.int64, 3), types.uintp,),)(pyfunc) + for i in range(len(tup)): + self.assertPreciseEqual(cfunc(tup, types.uintp(i)), tup[i]) + + # With a compile-time static index (the code generation path is + # different) + pyfunc = tuple_index_static + for typ in (types.UniTuple(types.int64, 4), + types.Tuple((types.int64, types.int32, types.int64, types.int32))): + cfunc = njit((typ,))(pyfunc) + tup = (4, 3, 42, 6) + self.assertPreciseEqual(cfunc(tup), pyfunc(tup)) + + typ = types.UniTuple(types.int64, 1) + with self.assertTypingError(): + njit((typ,))(pyfunc) + + # test unpack, staticgetitem with imprecise type (issue #3895) + pyfunc = tuple_unpack_static_getitem_err + with self.assertTypingError() as raises: + njit((),)(pyfunc) + msg = ("Cannot infer the type of variable 'c', have imprecise type: " + "list(undefined).") + self.assertIn(msg, str(raises.exception)) + + def test_in(self): + pyfunc = in_usecase + cfunc = njit((types.int64, types.UniTuple(types.int64, 3),),)(pyfunc) + tup = (4, 1, 5) + for i in range(5): + self.assertPreciseEqual(cfunc(i, tup), pyfunc(i, tup)) + + # Test the empty case + cfunc = njit((types.int64, types.Tuple([]),),)(pyfunc) + self.assertPreciseEqual(cfunc(1, ()), pyfunc(1, ())) + + def check_slice(self, pyfunc): + tup = (4, 5, 6, 7) + cfunc = njit((types.UniTuple(types.int64, 4),),)(pyfunc) + self.assertPreciseEqual(cfunc(tup), pyfunc(tup)) + args = types.Tuple((types.int64, types.int32, types.int64, types.int32)) + cfunc = njit((args,))(pyfunc) + self.assertPreciseEqual(cfunc(tup), pyfunc(tup)) + + def test_slice2(self): + self.check_slice(tuple_slice2) + + def test_slice3(self): + self.check_slice(tuple_slice3) + + def test_bool(self): + pyfunc = bool_usecase + cfunc = njit((types.Tuple((types.int64, types.int32)),),)(pyfunc) + args = ((4, 5),) + self.assertPreciseEqual(cfunc(*args), pyfunc(*args)) + cfunc = njit((types.UniTuple(types.int64, 3),),)(pyfunc) + args = ((4, 5, 6),) + self.assertPreciseEqual(cfunc(*args), pyfunc(*args)) + cfunc = njit((types.Tuple(()),),)(pyfunc) + self.assertPreciseEqual(cfunc(()), pyfunc(())) + + def test_add(self): + pyfunc = add_usecase + samples = [(types.Tuple(()), ()), + (types.UniTuple(types.int32, 0), ()), + (types.UniTuple(types.int32, 1), (42,)), + (types.Tuple((types.int64, types.float32)), (3, 4.5)), + ] + for (ta, a), (tb, b) in itertools.product(samples, samples): + cfunc = njit((ta, tb),)(pyfunc) + expected = pyfunc(a, b) + got = cfunc(a, b) + self.assertPreciseEqual(got, expected, msg=(ta, tb)) + + def _test_compare(self, pyfunc): + def eq(pyfunc, cfunc, args): + self.assertIs(cfunc(*args), pyfunc(*args), + "mismatch for arguments %s" % (args,)) + + # Same-sized tuples + argtypes = [types.Tuple((types.int64, types.float32)), + types.UniTuple(types.int32, 2)] + for ta, tb in itertools.product(argtypes, argtypes): + cfunc = njit((ta, tb),)(pyfunc) + for args in [((4, 5), (4, 5)), + ((4, 5), (4, 6)), + ((4, 6), (4, 5)), + ((4, 5), (5, 4))]: + eq(pyfunc, cfunc, args) + # Different-sized tuples + argtypes = [types.Tuple((types.int64, types.float32)), + types.UniTuple(types.int32, 3)] + cfunc = njit(tuple(argtypes),)(pyfunc) + for args in [((4, 5), (4, 5, 6)), + ((4, 5), (4, 4, 6)), + ((4, 5), (4, 6, 7))]: + eq(pyfunc, cfunc, args) + + def test_eq(self): + self._test_compare(eq_usecase) + + def test_ne(self): + self._test_compare(ne_usecase) + + def test_gt(self): + self._test_compare(gt_usecase) + + def test_ge(self): + self._test_compare(ge_usecase) + + def test_lt(self): + self._test_compare(lt_usecase) + + def test_le(self): + self._test_compare(le_usecase) + + +class TestNamedTuple(TestCase, MemoryLeakMixin): + + def test_unpack(self): + def check(p): + for pyfunc in tuple_first, tuple_second: + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check(Rect(4, 5)) + # Heterogeneous + check(Rect(4, 5.5)) + + def test_len(self): + def check(p): + pyfunc = len_usecase + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check(Rect(4, 5)) + check(Point(4, 5, 6)) + # Heterogeneous + check(Rect(4, 5.5)) + check(Point(4, 5.5, 6j)) + + def test_index(self): + pyfunc = tuple_index + cfunc = jit(nopython=True)(pyfunc) + + p = Point(4, 5, 6) + for i in range(len(p)): + self.assertPreciseEqual(cfunc(p, i), pyfunc(p, i)) + + # test uintp indexing (because, e.g., parfor generates unsigned prange) + for i in range(len(p)): + self.assertPreciseEqual(cfunc(p, types.uintp(i)), pyfunc(p, i)) + + def test_bool(self): + def check(p): + pyfunc = bool_usecase + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check(Rect(4, 5)) + # Heterogeneous + check(Rect(4, 5.5)) + check(Empty()) + + def _test_compare(self, pyfunc): + def eq(pyfunc, cfunc, args): + self.assertIs(cfunc(*args), pyfunc(*args), + "mismatch for arguments %s" % (args,)) + + cfunc = jit(nopython=True)(pyfunc) + + # Same-sized named tuples + for a, b in [((4, 5), (4, 5)), + ((4, 5), (4, 6)), + ((4, 6), (4, 5)), + ((4, 5), (5, 4))]: + eq(pyfunc, cfunc, (Rect(*a), Rect(*b))) + + # Different-sized named tuples + for a, b in [((4, 5), (4, 5, 6)), + ((4, 5), (4, 4, 6)), + ((4, 5), (4, 6, 7))]: + eq(pyfunc, cfunc, (Rect(*a), Point(*b))) + + def test_eq(self): + self._test_compare(eq_usecase) + + def test_ne(self): + self._test_compare(ne_usecase) + + def test_gt(self): + self._test_compare(gt_usecase) + + def test_ge(self): + self._test_compare(ge_usecase) + + def test_lt(self): + self._test_compare(lt_usecase) + + def test_le(self): + self._test_compare(le_usecase) + + def test_getattr(self): + pyfunc = getattr_usecase + cfunc = jit(nopython=True)(pyfunc) + + for args in (4, 5, 6), (4, 5.5, 6j): + p = Point(*args) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + def test_construct(self): + def check(pyfunc): + cfunc = jit(nopython=True)(pyfunc) + for args in (4, 5, 6), (4, 5.5, 6j): + expected = pyfunc(*args) + got = cfunc(*args) + self.assertIs(type(got), type(expected)) + self.assertPreciseEqual(got, expected) + + check(make_point) + check(make_point_kws) + + def test_type(self): + # Test the type() built-in on named tuples + pyfunc = type_usecase + cfunc = jit(nopython=True)(pyfunc) + + arg_tuples = [(4, 5, 6), (4, 5.5, 6j)] + for tup_args, args in itertools.product(arg_tuples, arg_tuples): + tup = Point(*tup_args) + expected = pyfunc(tup, *args) + got = cfunc(tup, *args) + self.assertIs(type(got), type(expected)) + self.assertPreciseEqual(got, expected) + + def test_literal_unification(self): + # Test for #3565. + @jit(nopython=True) + def Data1(value): + return Rect(value, -321) + + @jit(nopython=True) + def call(i, j): + if j == 0: + # In the error, `result` is typed to `Rect(int, LiteralInt)` + # because of the `-321` literal. This doesn't match the + # `result` type in the other branch. + result = Data1(i) + else: + # `result` is typed to be `Rect(int, int)` + result = Rect(i, j) + return result + + r = call(123, 1321) + self.assertEqual(r, Rect(width=123, height=1321)) + r = call(123, 0) + self.assertEqual(r, Rect(width=123, height=-321)) + + def test_string_literal_in_ctor(self): + # Test for issue #3813 + + @jit(nopython=True) + def foo(): + return Rect(10, 'somestring') + + r = foo() + self.assertEqual(r, Rect(width=10, height='somestring')) + + def test_dispatcher_mistreat(self): + # Test for issue #5215 that mistreat namedtuple as tuples + @jit(nopython=True) + def foo(x): + return x + + in1 = (1, 2, 3) + out1 = foo(in1) + self.assertEqual(in1, out1) + + in2 = Point(1, 2, 3) + out2 = foo(in2) + self.assertEqual(in2, out2) + + # Check the signatures + self.assertEqual(len(foo.nopython_signatures), 2) + self.assertEqual(foo.nopython_signatures[0].args[0], typeof(in1)) + self.assertEqual(foo.nopython_signatures[1].args[0], typeof(in2)) + + # Differently named + in3 = Point2(1, 2, 3) + out3 = foo(in3) + self.assertEqual(in3, out3) + self.assertEqual(len(foo.nopython_signatures), 3) + self.assertEqual(foo.nopython_signatures[2].args[0], typeof(in3)) + + +class TestTupleNRT(TestCase, MemoryLeakMixin): + def test_tuple_add(self): + def pyfunc(x): + a = np.arange(3) + return (a,) + (x,) + + cfunc = jit(nopython=True)(pyfunc) + x = 123 + expect_a, expect_x = pyfunc(x) + got_a, got_x = cfunc(x) + np.testing.assert_equal(got_a, expect_a) + self.assertEqual(got_x, expect_x) + + +class TestNamedTupleNRT(TestCase, MemoryLeakMixin): + + def test_return(self): + # Check returning a namedtuple with a list inside it + pyfunc = make_point_nrt + cfunc = jit(nopython=True)(pyfunc) + + for arg in (3, 0): + expected = pyfunc(arg) + got = cfunc(arg) + self.assertIs(type(got), type(expected)) + self.assertPreciseEqual(got, expected) + + +class TestConversions(TestCase): + """ + Test implicit conversions between tuple types. + """ + + def check_conversion(self, fromty, toty, val): + pyfunc = identity + cfunc = njit(toty(fromty))(pyfunc) + res = cfunc(val) + self.assertEqual(res, val) + + def test_conversions(self): + check = self.check_conversion + fromty = types.UniTuple(types.int32, 2) + check(fromty, types.UniTuple(types.float32, 2), (4, 5)) + check(fromty, types.Tuple((types.float32, types.int16)), (4, 5)) + aty = types.UniTuple(types.int32, 0) + bty = types.Tuple(()) + check(aty, bty, ()) + check(bty, aty, ()) + + with self.assertRaises(errors.TypingError) as raises: + check(fromty, types.Tuple((types.float32,)), (4, 5)) + msg = "No conversion from UniTuple(int32 x 2) to UniTuple(float32 x 1)" + self.assertIn(msg, str(raises.exception)) + + +class TestMethods(TestCase): + + def test_index(self): + pyfunc = index_method_usecase + cfunc = jit(nopython=True)(pyfunc) + self.assertEqual(cfunc((1, 2, 3), 2), 1) + + with self.assertRaises(ValueError) as raises: + cfunc((1, 2, 3), 4) + msg = 'tuple.index(x): x not in tuple' + self.assertEqual(msg, str(raises.exception)) + + +class TestTupleBuild(TestCase): + + def test_build_unpack(self): + def check(p): + pyfunc = lambda a: (1, *a) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_build_unpack_assign_like(self): + # see #6534 + def check(p): + pyfunc = lambda a: (*a,) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_build_unpack_fail_on_list_assign_like(self): + # see #6534 + def check(p): + pyfunc = lambda a: (*a,) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + with self.assertRaises(errors.TypingError) as raises: + check([4, 5]) + + # Python 3.9 has a peephole rewrite due to large changes in tuple + # unpacking. It results in a tuple + list situation from the above + # so the error message reflects that. Catching this specific and + # seemingly rare sequence in the peephole rewrite is prohibitively + # hard. Should it be reported numerous times, revisit then. + msg1 = "No implementation of function" + self.assertIn(msg1, str(raises.exception)) + msg2 = "tuple(reflected list(" # ignore the rest of reflected list + # part, it's repr is quite volatile. + self.assertIn(msg2, str(raises.exception)) + + def test_build_unpack_more(self): + def check(p): + pyfunc = lambda a: (1, *a, (1, 2), *a) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_build_unpack_call(self): + def check(p): + @jit + def inner(*args): + return args + pyfunc = lambda a: inner(1, *a) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_build_unpack_call_more(self): + def check(p): + @jit + def inner(*args): + return args + pyfunc = lambda a: inner(1, *a, *(1, 2), *a) + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + # Homogeneous + check((4, 5)) + # Heterogeneous + check((4, 5.5)) + + def test_tuple_constructor(self): + def check(pyfunc, arg): + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(arg), pyfunc(arg)) + + # empty + check(lambda _: tuple(), ()) + # Homogeneous + check(lambda a: tuple(a), (4, 5)) + # Heterogeneous + check(lambda a: tuple(a), (4, 5.5)) + + def test_unpack_with_predicate_fails(self): + # this fails as the list_to_tuple/list_extend peephole bytecode + # rewriting needed for Python 3.9+ cannot yet traverse the CFG. + @njit + def foo(): + a = (1,) + b = (3,2, 4) + return (*(b if a[0] else (5, 6)),) + + with self.assertRaises(errors.UnsupportedBytecodeError) as raises: + foo() + msg = "op_LIST_EXTEND at the start of a block" + self.assertIn(msg, str(raises.exception)) + + def test_build_unpack_with_calls_in_unpack(self): + def check(p): + def pyfunc(a): + z = [1, 2] + return (*a, z.append(3), z.extend(a), np.ones(3)), z + + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + check((4, 5)) + + def test_build_unpack_complicated(self): + def check(p): + def pyfunc(a): + z = [1, 2] + return (*a, *(*a, a), *(a, (*(a, (1, 2), *(3,), *a), + (a, 1, (2, 3), *a, 1), (1,))), + *(z.append(4), z.extend(a))), z + + cfunc = jit(nopython=True)(pyfunc) + self.assertPreciseEqual(cfunc(p), pyfunc(p)) + + check((10, 20)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeconv.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeconv.py new file mode 100644 index 0000000000000000000000000000000000000000..4042542b65b8e210f83134ee46959c650715a0da --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeconv.py @@ -0,0 +1,295 @@ +import itertools + +from numba.core import types +from numba.core.typeconv.typeconv import TypeManager, TypeCastingRules +from numba.core.typeconv import rules +from numba.core.typeconv import castgraph, Conversion +import unittest + + +class CompatibilityTestMixin(unittest.TestCase): + + def check_number_compatibility(self, check_compatible): + b = types.boolean + i8 = types.int8 + i16 = types.int16 + i32 = types.int32 + i64 = types.int64 + u8 = types.uint8 + u16 = types.uint16 + u32 = types.uint32 + u64 = types.uint64 + f16 = types.float16 + f32 = types.float32 + f64 = types.float64 + c64 = types.complex64 + c128 = types.complex128 + + self.assertEqual(check_compatible(i32, i32), Conversion.exact) + + self.assertEqual(check_compatible(b, i8), Conversion.safe) + self.assertEqual(check_compatible(b, u8), Conversion.safe) + self.assertEqual(check_compatible(i8, b), Conversion.unsafe) + self.assertEqual(check_compatible(u8, b), Conversion.unsafe) + + self.assertEqual(check_compatible(i32, i64), Conversion.promote) + self.assertEqual(check_compatible(i32, u32), Conversion.unsafe) + self.assertEqual(check_compatible(u32, i32), Conversion.unsafe) + self.assertEqual(check_compatible(u32, i64), Conversion.safe) + + self.assertEqual(check_compatible(i16, f16), Conversion.unsafe) + self.assertEqual(check_compatible(i32, f32), Conversion.unsafe) + self.assertEqual(check_compatible(u32, f32), Conversion.unsafe) + self.assertEqual(check_compatible(i32, f64), Conversion.safe) + self.assertEqual(check_compatible(u32, f64), Conversion.safe) + # Note this is inconsistent with i32 -> f32... + self.assertEqual(check_compatible(i64, f64), Conversion.safe) + self.assertEqual(check_compatible(u64, f64), Conversion.safe) + + self.assertEqual(check_compatible(f32, c64), Conversion.safe) + self.assertEqual(check_compatible(f64, c128), Conversion.safe) + self.assertEqual(check_compatible(f64, c64), Conversion.unsafe) + + # Propagated compatibility relationships + self.assertEqual(check_compatible(i16, f64), Conversion.safe) + self.assertEqual(check_compatible(i16, i64), Conversion.promote) + self.assertEqual(check_compatible(i32, c64), Conversion.unsafe) + self.assertEqual(check_compatible(i32, c128), Conversion.safe) + self.assertEqual(check_compatible(i32, u64), Conversion.unsafe) + + for ta, tb in itertools.product(types.number_domain, + types.number_domain): + if ta in types.complex_domain and tb not in types.complex_domain: + continue + self.assertTrue(check_compatible(ta, tb) is not None, + msg="No cast from %s to %s" % (ta, tb)) + + +class TestTypeConv(CompatibilityTestMixin, unittest.TestCase): + + def test_typeconv(self): + tm = TypeManager() + + i32 = types.int32 + i64 = types.int64 + f32 = types.float32 + + tm.set_promote(i32, i64) + tm.set_unsafe_convert(i32, f32) + + sig = (i32, f32) + ovs = [ + (i32, i32), + (f32, f32), + (i64, i64), + ] + + # allow_unsafe = True => a conversion from i32 to f32 is chosen + sel = tm.select_overload(sig, ovs, True, False) + self.assertEqual(sel, 1) + # allow_unsafe = False => no overload available + with self.assertRaises(TypeError): + sel = tm.select_overload(sig, ovs, False, False) + + def test_default_rules(self): + tm = rules.default_type_manager + self.check_number_compatibility(tm.check_compatible) + + def test_overload1(self): + tm = rules.default_type_manager + + i32 = types.int32 + i64 = types.int64 + + sig = (i64, i32, i32) + ovs = [ + (i32, i32, i32), + (i64, i64, i64), + ] + # The first overload is unsafe, the second is safe => the second + # is always chosen, regardless of allow_unsafe. + self.assertEqual(tm.select_overload(sig, ovs, True, False), 1) + self.assertEqual(tm.select_overload(sig, ovs, False, False), 1) + + def test_overload2(self): + tm = rules.default_type_manager + + i16 = types.int16 + i32 = types.int32 + i64 = types.int64 + + sig = (i32, i16, i32) + ovs = [ + # Three promotes + (i64, i64, i64), + # One promotes, two exact types + (i32, i32, i32), + # Two unsafe converts, one exact type + (i16, i16, i16), + ] + self.assertEqual(tm.select_overload(sig, ovs, allow_unsafe=False, + exact_match_required=False), 1) + self.assertEqual(tm.select_overload(sig, ovs, allow_unsafe=True, + exact_match_required=False), 1) + + # The same in reverse order + ovs.reverse() + self.assertEqual(tm.select_overload(sig, ovs, allow_unsafe=False, + exact_match_required=False), 1) + self.assertEqual(tm.select_overload(sig, ovs, allow_unsafe=True, + exact_match_required=False), 1) + + def test_overload3(self): + # Promotes should be preferred over safe converts + tm = rules.default_type_manager + + i32 = types.int32 + i64 = types.int64 + f64 = types.float64 + + sig = (i32, i32) + ovs = [ + # Two promotes + (i64, i64), + # Two safe converts + (f64, f64), + ] + self.assertEqual(tm.select_overload(sig, ovs, allow_unsafe=False, + exact_match_required=False), 0) + self.assertEqual(tm.select_overload(sig, ovs, allow_unsafe=True, + exact_match_required=False), 0) + + # The same in reverse order + ovs.reverse() + self.assertEqual(tm.select_overload(sig, ovs, allow_unsafe=False, + exact_match_required=False), 1) + self.assertEqual(tm.select_overload(sig, ovs, allow_unsafe=True, + exact_match_required=False), 1) + + def test_overload4(self): + tm = rules.default_type_manager + + i16 = types.int16 + i32 = types.int32 + i64 = types.int64 + f16 = types.float16 + f32 = types.float32 + + sig = (i16, f16, f16) + ovs = [ + # One unsafe, one promote, one exact + (f16, f32, f16), + # Two unsafe, one exact types + (f32, i32, f16), + ] + + self.assertEqual(tm.select_overload(sig, ovs, allow_unsafe=True, + exact_match_required=False), 0) + + def test_type_casting_rules(self): + tm = TypeManager() + tcr = TypeCastingRules(tm) + + i16 = types.int16 + i32 = types.int32 + i64 = types.int64 + f64 = types.float64 + f32 = types.float32 + f16 = types.float16 + made_up = types.Dummy("made_up") + + tcr.promote_unsafe(i32, i64) + tcr.safe_unsafe(i32, f64) + tcr.promote_unsafe(f32, f64) + tcr.promote_unsafe(f16, f32) + tcr.unsafe_unsafe(i16, f16) + + def base_test(): + # As declared + self.assertEqual(tm.check_compatible(i32, i64), Conversion.promote) + self.assertEqual(tm.check_compatible(i32, f64), Conversion.safe) + self.assertEqual(tm.check_compatible(f16, f32), Conversion.promote) + self.assertEqual(tm.check_compatible(f32, f64), Conversion.promote) + self.assertEqual(tm.check_compatible(i64, i32), Conversion.unsafe) + self.assertEqual(tm.check_compatible(f64, i32), Conversion.unsafe) + self.assertEqual(tm.check_compatible(f64, f32), Conversion.unsafe) + + # Propagated + self.assertEqual(tm.check_compatible(i64, f64), Conversion.unsafe) + self.assertEqual(tm.check_compatible(f64, i64), Conversion.unsafe) + self.assertEqual(tm.check_compatible(i64, f32), Conversion.unsafe) + self.assertEqual(tm.check_compatible(i32, f32), Conversion.unsafe) + self.assertEqual(tm.check_compatible(f32, i32), Conversion.unsafe) + self.assertEqual(tm.check_compatible(i16, f16), Conversion.unsafe) + self.assertEqual(tm.check_compatible(f16, i16), Conversion.unsafe) + + # Test base graph + base_test() + + self.assertIsNone(tm.check_compatible(i64, made_up)) + self.assertIsNone(tm.check_compatible(i32, made_up)) + self.assertIsNone(tm.check_compatible(f32, made_up)) + self.assertIsNone(tm.check_compatible(made_up, f64)) + self.assertIsNone(tm.check_compatible(made_up, i64)) + + # Add new test + tcr.promote(f64, made_up) + tcr.unsafe(made_up, i32) + + # Ensure the graph did not change by adding the new type + base_test() + + # To "made up" type + self.assertEqual(tm.check_compatible(i64, made_up), Conversion.unsafe) + self.assertEqual(tm.check_compatible(i32, made_up), Conversion.safe) + self.assertEqual(tm.check_compatible(f32, made_up), Conversion.promote) + self.assertEqual(tm.check_compatible(made_up, f64), Conversion.unsafe) + self.assertEqual(tm.check_compatible(made_up, i64), Conversion.unsafe) + + def test_castgraph_propagate(self): + saved = [] + + def callback(src, dst, rel): + saved.append((src, dst, rel)) + + tg = castgraph.TypeGraph(callback) + + i32 = types.int32 + i64 = types.int64 + f64 = types.float64 + f32 = types.float32 + + tg.insert_rule(i32, i64, Conversion.promote) + tg.insert_rule(i64, i32, Conversion.unsafe) + + saved.append(None) + + tg.insert_rule(i32, f64, Conversion.safe) + tg.insert_rule(f64, i32, Conversion.unsafe) + + saved.append(None) + + tg.insert_rule(f32, f64, Conversion.promote) + tg.insert_rule(f64, f32, Conversion.unsafe) + + self.assertIn((i32, i64, Conversion.promote), saved[0:2]) + self.assertIn((i64, i32, Conversion.unsafe), saved[0:2]) + self.assertIs(saved[2], None) + + self.assertIn((i32, f64, Conversion.safe), saved[3:7]) + self.assertIn((f64, i32, Conversion.unsafe), saved[3:7]) + self.assertIn((i64, f64, Conversion.unsafe), saved[3:7]) + self.assertIn((i64, f64, Conversion.unsafe), saved[3:7]) + self.assertIs(saved[7], None) + + self.assertIn((f32, f64, Conversion.promote), saved[8:14]) + self.assertIn((f64, f32, Conversion.unsafe), saved[8:14]) + self.assertIn((f32, i32, Conversion.unsafe), saved[8:14]) + self.assertIn((i32, f32, Conversion.unsafe), saved[8:14]) + self.assertIn((f32, i64, Conversion.unsafe), saved[8:14]) + self.assertIn((i64, f32, Conversion.unsafe), saved[8:14]) + self.assertEqual(len(saved[14:]), 0) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typedlist.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typedlist.py new file mode 100644 index 0000000000000000000000000000000000000000..79098980158c59ae4930d8b7b885ee04c74aa2d6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typedlist.py @@ -0,0 +1,1689 @@ +import sys +import subprocess +from itertools import product +from textwrap import dedent + +import numpy as np + +from numba import config +from numba import njit +from numba import int32, float32, prange, uint8 +from numba.core import types +from numba import typeof +from numba.typed import List, Dict +from numba.core.errors import TypingError +from numba.tests.support import (TestCase, MemoryLeakMixin, override_config, + forbid_codegen, skip_parfors_unsupported) +from numba.core.unsafe.refcount import get_refcount +from numba.experimental import jitclass + + +def to_tl(l): + """ Convert cpython list to typed-list. """ + tl = List.empty_list(int32) + for k in l: + tl.append(k) + return tl + + +class TestTypedList(MemoryLeakMixin, TestCase): + + def test_basic(self): + l = List.empty_list(int32) + # len + self.assertEqual(len(l), 0) + # append + l.append(0) + # len + self.assertEqual(len(l), 1) + # setitem + l.append(0) + l.append(0) + l[0] = 10 + l[1] = 11 + l[2] = 12 + # getitem + self.assertEqual(l[0], 10) + self.assertEqual(l[1], 11) + self.assertEqual(l[2], 12) + self.assertEqual(l[-3], 10) + self.assertEqual(l[-2], 11) + self.assertEqual(l[-1], 12) + # __iter__ + # the default __iter__ from MutableSequence will raise an IndexError + # via __getitem__ and thus leak an exception, so this shouldn't + for i in l: + pass + # contains + self.assertTrue(10 in l) + self.assertFalse(0 in l) + # count + l.append(12) + self.assertEqual(l.count(0), 0) + self.assertEqual(l.count(10), 1) + self.assertEqual(l.count(12), 2) + # pop + self.assertEqual(len(l), 4) + self.assertEqual(l.pop(), 12) + self.assertEqual(len(l), 3) + self.assertEqual(l.pop(1), 11) + self.assertEqual(len(l), 2) + # extend + l.extend((100, 200, 300)) + self.assertEqual(len(l), 5) + self.assertEqual(list(l), [10, 12, 100, 200, 300]) + # insert + l.insert(0, 0) + self.assertEqual(list(l), [0, 10, 12, 100, 200, 300]) + l.insert(3, 13) + self.assertEqual(list(l), [0, 10, 12, 13, 100, 200, 300]) + l.insert(100, 400) + self.assertEqual(list(l), [0, 10, 12, 13, 100, 200, 300, 400]) + # remove + l.remove(0) + l.remove(400) + l.remove(13) + self.assertEqual(list(l), [10, 12, 100, 200, 300]) + # clear + l.clear() + self.assertEqual(len(l), 0) + self.assertEqual(list(l), []) + # reverse + l.extend(tuple(range(10, 20))) + l.reverse() + self.assertEqual(list(l), list(range(10, 20))[::-1]) + # copy + new = l.copy() + self.assertEqual(list(new), list(range(10, 20))[::-1]) + # equal + self.assertEqual(l, new) + # not equal + new[-1] = 42 + self.assertNotEqual(l, new) + # index + self.assertEqual(l.index(15), 4) + + def test_list_extend_refines_on_unicode_type(self): + @njit + def foo(string): + l = List() + l.extend(string) + return l + + for func in (foo, foo.py_func): + for string in ("a", "abc", "\nabc\t"): + self.assertEqual(list(func(string)), list(string)) + + def test_unsigned_access(self): + L = List.empty_list(int32) + ui32_0 = types.uint32(0) + ui32_1 = types.uint32(1) + ui32_2 = types.uint32(2) + + # insert + L.append(types.uint32(10)) + L.append(types.uint32(11)) + L.append(types.uint32(12)) + self.assertEqual(len(L), 3) + + # getitem + self.assertEqual(L[ui32_0], 10) + self.assertEqual(L[ui32_1], 11) + self.assertEqual(L[ui32_2], 12) + + # setitem + L[ui32_0] = 123 + L[ui32_1] = 456 + L[ui32_2] = 789 + self.assertEqual(L[ui32_0], 123) + self.assertEqual(L[ui32_1], 456) + self.assertEqual(L[ui32_2], 789) + + # index + ui32_123 = types.uint32(123) + ui32_456 = types.uint32(456) + ui32_789 = types.uint32(789) + self.assertEqual(L.index(ui32_123), 0) + self.assertEqual(L.index(ui32_456), 1) + self.assertEqual(L.index(ui32_789), 2) + + # delitem + L.__delitem__(ui32_2) + del L[ui32_1] + self.assertEqual(len(L), 1) + self.assertEqual(L[ui32_0], 123) + + # pop + L.append(2) + L.append(3) + L.append(4) + self.assertEqual(len(L), 4) + self.assertEqual(L.pop(), 4) + self.assertEqual(L.pop(ui32_2), 3) + self.assertEqual(L.pop(ui32_1), 2) + self.assertEqual(L.pop(ui32_0), 123) + + def test_dtype(self): + + L = List.empty_list(int32) + self.assertEqual(L._dtype, int32) + + L = List.empty_list(float32) + self.assertEqual(L._dtype, float32) + + @njit + def foo(): + li, lf = List(), List() + li.append(int32(1)) + lf.append(float32(1.0)) + return li._dtype, lf._dtype + + self.assertEqual(foo(), (np.dtype('int32'), np.dtype('float32'))) + self.assertEqual(foo.py_func(), (int32, float32)) + + def test_dtype_raises_exception_on_untyped_list(self): + + with self.assertRaises(RuntimeError) as raises: + L = List() + L._dtype + self.assertIn( + "invalid operation on untyped list", + str(raises.exception), + ) + + @skip_parfors_unsupported + def test_unsigned_prange(self): + @njit(parallel=True) + def foo(a): + r = types.uint64(3) + s = types.uint64(0) + for i in prange(r): + s = s + a[i] + return s + + a = List.empty_list(types.uint64) + a.append(types.uint64(12)) + a.append(types.uint64(1)) + a.append(types.uint64(7)) + self.assertEqual(foo(a), 20) + + def test_compiled(self): + @njit + def producer(): + l = List.empty_list(int32) + l.append(23) + return l + + @njit + def consumer(l): + return l[0] + + l = producer() + val = consumer(l) + self.assertEqual(val, 23) + + def test_getitem_slice(self): + """ Test getitem using a slice. + + This tests suffers from combinatorial explosion, so we parametrize it + and compare results against the regular list in a quasi fuzzing + approach. + + """ + # initialize regular list + rl = list(range(10, 20)) + # initialize typed list + tl = List.empty_list(int32) + for i in range(10, 20): + tl.append(i) + # define the ranges + start_range = list(range(-20, 30)) + stop_range = list(range(-20, 30)) + step_range = [-5, -4, -3, -2, -1, 1, 2, 3, 4, 5] + + # check that they are the same initially + self.assertEqual(rl, list(tl)) + # check that copy by slice works, no start, no stop, no step + self.assertEqual(rl[:], list(tl[:])) + + # start only + for sa in start_range: + self.assertEqual(rl[sa:], list(tl[sa:])) + # stop only + for so in stop_range: + self.assertEqual(rl[:so], list(tl[:so])) + # step only + for se in step_range: + self.assertEqual(rl[::se], list(tl[::se])) + + # start and stop + for sa, so in product(start_range, stop_range): + self.assertEqual(rl[sa:so], list(tl[sa:so])) + # start and step + for sa, se in product(start_range, step_range): + self.assertEqual(rl[sa::se], list(tl[sa::se])) + # stop and step + for so, se in product(stop_range, step_range): + self.assertEqual(rl[:so:se], list(tl[:so:se])) + + # start, stop and step + for sa, so, se in product(start_range, stop_range, step_range): + self.assertEqual(rl[sa:so:se], list(tl[sa:so:se])) + + def test_setitem_slice(self): + """ Test setitem using a slice. + + This tests suffers from combinatorial explosion, so we parametrize it + and compare results against the regular list in a quasi fuzzing + approach. + + """ + + def setup(start=10, stop=20): + # initialize regular list + rl_ = list(range(start, stop)) + # initialize typed list + tl_ = List.empty_list(int32) + # populate typed list + for i in range(start, stop): + tl_.append(i) + # check they are the same + self.assertEqual(rl_, list(tl_)) + return rl_, tl_ + + ### Simple slicing ### + + # assign to itself + rl, tl = setup() + rl[:], tl[:] = rl, tl + self.assertEqual(rl, list(tl)) + + # extend self + rl, tl = setup() + rl[len(rl):], tl[len(tl):] = rl, tl + self.assertEqual(rl, list(tl)) + # prepend self + rl, tl = setup() + rl[:0], tl[:0] = rl, tl + self.assertEqual(rl, list(tl)) + # partial assign to self, with equal length + rl, tl = setup() + rl[3:5], tl[3:5] = rl[6:8], tl[6:8] + self.assertEqual(rl, list(tl)) + # partial assign to self, with larger slice + rl, tl = setup() + rl[3:5], tl[3:5] = rl[6:9], tl[6:9] + self.assertEqual(rl, list(tl)) + # partial assign to self, with smaller slice + rl, tl = setup() + rl[3:5], tl[3:5] = rl[6:7], tl[6:7] + self.assertEqual(rl, list(tl)) + + # extend + rl, tl = setup() + rl[len(rl):] = list(range(110, 120)) + tl[len(tl):] = to_tl(range(110,120)) + self.assertEqual(rl, list(tl)) + # extend empty + rl, tl = setup(0, 0) + rl[len(rl):] = list(range(110, 120)) + tl[len(tl):] = to_tl(range(110,120)) + self.assertEqual(rl, list(tl)) + # extend singleton + rl, tl = setup(0, 1) + rl[len(rl):] = list(range(110, 120)) + tl[len(tl):] = to_tl(range(110,120)) + self.assertEqual(rl, list(tl)) + + # prepend + rl, tl = setup() + rl[:0], tl[:0] = list(range(110, 120)), to_tl(range(110,120)) + self.assertEqual(rl, list(tl)) + # prepend empty + rl, tl = setup(0,0) + rl[:0], tl[:0] = list(range(110, 120)), to_tl(range(110,120)) + self.assertEqual(rl, list(tl)) + # prepend singleton + rl, tl = setup(0,1) + rl[:0], tl[:0] = list(range(110, 120)), to_tl(range(110,120)) + self.assertEqual(rl, list(tl)) + + # simple equal length assignment, just replace + rl, tl = setup() + rl[1:3], tl[1:3] = [100, 200], to_tl([100, 200]) + self.assertEqual(rl, list(tl)) + + # slice for assignment is larger, need to replace and insert + rl, tl = setup() + rl[1:3], tl[1:3] = [100, 200, 300, 400], to_tl([100, 200, 300, 400]) + self.assertEqual(rl, list(tl)) + + # slice for assignment is smaller, need to replace and delete + rl, tl = setup() + rl[1:3], tl[1:3] = [100], to_tl([100]) + self.assertEqual(rl, list(tl)) + + # slice for assignment is smaller and item is empty, need to delete + rl, tl = setup() + rl[1:3], tl[1:3] = [], to_tl([]) + self.assertEqual(rl, list(tl)) + + # Synonym for clear + rl, tl = setup() + rl[:], tl[:] = [], to_tl([]) + self.assertEqual(rl, list(tl)) + + ### Extended slicing ### + + # replace every second element + rl, tl = setup() + rl[::2], tl[::2] = [100,200,300,400,500], to_tl([100,200,300,400,500]) + self.assertEqual(rl, list(tl)) + # replace every second element, backwards + rl, tl = setup() + rl[::-2], tl[::-2] = [100,200,300,400,500], to_tl([100,200,300,400,500]) + self.assertEqual(rl, list(tl)) + + # reverse assign to itself + rl, tl = setup() + rl[::-1], tl[::-1] = rl, tl + self.assertEqual(rl, list(tl)) + + def test_setitem_slice_value_error(self): + self.disable_leak_check() + + tl = List.empty_list(int32) + for i in range(10,20): + tl.append(i) + + assignment = List.empty_list(int32) + for i in range(1, 4): + assignment.append(i) + + with self.assertRaises(ValueError) as raises: + tl[8:3:-1] = assignment + self.assertIn( + "length mismatch for extended slice and sequence", + str(raises.exception), + ) + + def test_delitem_slice(self): + """ Test delitem using a slice. + + This tests suffers from combinatorial explosion, so we parametrize it + and compare results against the regular list in a quasi fuzzing + approach. + + """ + + def setup(start=10, stop=20): + # initialize regular list + rl_ = list(range(start, stop)) + # initialize typed list + tl_ = List.empty_list(int32) + # populate typed list + for i in range(start, stop): + tl_.append(i) + # check they are the same + self.assertEqual(rl_, list(tl_)) + return rl_, tl_ + + # define the ranges + start_range = list(range(-20, 30)) + stop_range = list(range(-20, 30)) + step_range = [-5, -4, -3, -2, -1, 1, 2, 3, 4, 5] + + rl, tl = setup() + # check that they are the same initially + self.assertEqual(rl, list(tl)) + # check that deletion of the whole list by slice works + del rl[:] + del tl[:] + self.assertEqual(rl, list(tl)) + + # start only + for sa in start_range: + rl, tl = setup() + del rl[sa:] + del tl[sa:] + self.assertEqual(rl, list(tl)) + # stop only + for so in stop_range: + rl, tl = setup() + del rl[:so] + del tl[:so] + self.assertEqual(rl, list(tl)) + # step only + for se in step_range: + rl, tl = setup() + del rl[::se] + del tl[::se] + self.assertEqual(rl, list(tl)) + + # start and stop + for sa, so in product(start_range, stop_range): + rl, tl = setup() + del rl[sa:so] + del tl[sa:so] + self.assertEqual(rl, list(tl)) + # start and step + for sa, se in product(start_range, step_range): + rl, tl = setup() + del rl[sa::se] + del tl[sa::se] + self.assertEqual(rl, list(tl)) + # stop and step + for so, se in product(stop_range, step_range): + rl, tl = setup() + del rl[:so:se] + del tl[:so:se] + self.assertEqual(rl, list(tl)) + + # start, stop and step + for sa, so, se in product(start_range, stop_range, step_range): + rl, tl = setup() + del rl[sa:so:se] + del tl[sa:so:se] + self.assertEqual(rl, list(tl)) + + def test_list_create_no_jit_using_empty_list(self): + with override_config('DISABLE_JIT', True): + with forbid_codegen(): + l = List.empty_list(types.int32) + self.assertEqual(type(l), list) + + def test_list_create_no_jit_using_List(self): + with override_config('DISABLE_JIT', True): + with forbid_codegen(): + l = List() + self.assertEqual(type(l), list) + + def test_catch_global_typed_list(self): + from numba.tests.typedlist_usecases import catch_global + + expected_message = ("The use of a ListType[int32] type, assigned to " + "variable 'global_typed_list' in globals, is not " + "supported as globals are considered compile-time " + "constants and there is no known way to compile " + "a ListType[int32] type as a constant.") + with self.assertRaises(TypingError) as raises: + njit(catch_global)() + self.assertIn( + expected_message, + str(raises.exception), + ) + self.disable_leak_check() + + def test_repr(self): + l = List() + expected = "ListType[Undefined]([])" + self.assertEqual(expected, repr(l)) + + l = List([int32(i) for i in (1, 2, 3)]) + expected = "ListType[int32]([1, 2, 3])" + self.assertEqual(expected, repr(l)) + + def test_repr_long_list(self): + l = List(range(1005)) + expected = f"{typeof(l)}([{', '.join(map(str, l))}])" + self.assertEqual(expected, repr(l)) + + def test_repr_long_list_ipython(self): + + # Test repr of long typed Lists in an IPython session + args = ["-m", "IPython", "--quiet", "--quick", "--no-banner", + "--colors=NoColor", "-c"] + base_cmd = [sys.executable] + args + try: + subprocess.check_output(base_cmd + ["--version"]) + except subprocess.CalledProcessError as e: + self.skipTest("ipython not found: return code %d" % e.returncode) + + def run_repr_cmd(repr_cmd_str): + cmd = base_cmd + [repr_cmd_str] + p = subprocess.Popen( + cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + ) + out, err = p.communicate() + return err + + l = List(range(1000)) + expected = f"{typeof(l)}([{', '.join(map(str, l))}])" + actual = run_repr_cmd(" ".join( + [ + "import sys;", + "from numba.typed import List;", + "res = repr(List(range(1000)));", + "sys.stderr.write(res);" + ] + )) + self.assertEqual(expected, actual) + + l = List(range(1005)) + # Assert that the long list is truncated + expected = f"{typeof(l)}([{', '.join(map(str, l[:1000]))}, ...])" + actual = run_repr_cmd(" ".join( + [ + "import sys;", + "from numba.typed import List;", + "res = repr(List(range(1005)));", + "sys.stderr.write(res);" + ] + )) + self.assertEqual(expected, actual) + + def test_iter_mutates_self(self): + self.disable_leak_check() + + @njit + def foo(x): + count = 0 + for i in x: + if count > 1: + x.append(2.) + count += 1 + + l = List() + l.append(1.) + l.append(1.) + l.append(1.) + with self.assertRaises(RuntimeError) as raises: + foo(l) + + msg = "list was mutated during iteration" + self.assertIn(msg, str(raises.exception)) + + +class TestNoneType(MemoryLeakMixin, TestCase): + + def test_append_none(self): + @njit + def impl(): + l = List() + l.append(None) + return l + + self.assertEqual(impl.py_func(), impl()) + + def test_len_none(self): + @njit + def impl(): + l = List() + l.append(None) + return len(l) + + self.assertEqual(impl.py_func(), impl()) + + def test_getitem_none(self): + @njit + def impl(): + l = List() + l.append(None) + return l[0] + + self.assertEqual(impl.py_func(), impl()) + + def test_setitem_none(self): + @njit + def impl(): + l = List() + l.append(None) + l[0] = None + return l + + self.assertEqual(impl.py_func(), impl()) + + def test_equals_none(self): + @njit + def impl(): + l = List() + l.append(None) + m = List() + m.append(None) + return l == m, l != m, l < m, l <= m, l > m, l >= m + + self.assertEqual(impl.py_func(), impl()) + + def test_not_equals_none(self): + @njit + def impl(): + l = List() + l.append(None) + m = List() + m.append(1) + return l == m, l != m, l < m, l <= m, l > m, l >= m + + self.assertEqual(impl.py_func(), impl()) + + def test_iter_none(self): + @njit + def impl(): + l = List() + l.append(None) + l.append(None) + l.append(None) + count = 0 + for i in l: + count += 1 + return count + + self.assertEqual(impl.py_func(), impl()) + + def test_none_typed_method_fails(self): + """ Test that unsupported operations on List[None] raise. """ + def generate_function(line1, line2): + context = {} + exec(dedent(""" + from numba.typed import List + def bar(): + lst = List() + {} + {} + """.format(line1, line2)), context) + return njit(context["bar"]) + for line1, line2 in ( + ("lst.append(None)", "lst.pop()"), + ("lst.append(None)", "del lst[0]"), + ("lst.append(None)", "lst.count(None)"), + ("lst.append(None)", "lst.index(None)"), + ("lst.append(None)", "lst.insert(0, None)"), + ("" , "lst.insert(0, None)"), + ("lst.append(None)", "lst.clear()"), + ("lst.append(None)", "lst.copy()"), + ("lst.append(None)", "lst.extend([None])"), + ("", "lst.extend([None])"), + ("lst.append(None)", "lst.remove(None)"), + ("lst.append(None)", "lst.reverse()"), + ("lst.append(None)", "None in lst"), + ): + with self.assertRaises(TypingError) as raises: + foo = generate_function(line1, line2) + foo() + self.assertIn( + "method support for List[None] is limited", + str(raises.exception), + ) + + +class TestAllocation(MemoryLeakMixin, TestCase): + + def test_allocation(self): + # kwarg version + for i in range(16): + tl = List.empty_list(types.int32, allocated=i) + self.assertEqual(tl._allocated(), i) + + # posarg version + for i in range(16): + tl = List.empty_list(types.int32, i) + self.assertEqual(tl._allocated(), i) + + def test_allocation_njit(self): + # kwarg version + @njit + def foo(i): + tl = List.empty_list(types.int32, allocated=i) + return tl._allocated() + + for j in range(16): + self.assertEqual(foo(j), j) + + # posarg version + @njit + def foo(i): + tl = List.empty_list(types.int32, i) + return tl._allocated() + + for j in range(16): + self.assertEqual(foo(j), j) + + def test_growth_and_shrinkage(self): + tl = List.empty_list(types.int32) + growth_before = {0: 0, 4:4, 8:8, 16:16} + growth_after = {0: 4, 4:8, 8:16, 16:25} + for i in range(17): + if i in growth_before: + self.assertEqual(growth_before[i], tl._allocated()) + tl.append(i) + if i in growth_after: + self.assertEqual(growth_after[i], tl._allocated()) + + shrink_before = {17: 25, 12:25, 9:18, 6:12, 4:8, 3:6, 2:5, 1:4} + shrink_after = {17: 25, 12:18, 9:12, 6:8, 4:6, 3:5, 2:4, 1:0} + for i in range(17, 0, -1): + if i in shrink_before: + self.assertEqual(shrink_before[i], tl._allocated()) + tl.pop() + if i in shrink_after: + self.assertEqual(shrink_after[i], tl._allocated()) + + +class TestExtend(MemoryLeakMixin, TestCase): + + def test_extend_other(self): + @njit + def impl(other): + l = List.empty_list(types.int32) + for x in range(10): + l.append(x) + l.extend(other) + return l + + other = List.empty_list(types.int32) + for x in range(10): + other.append(x) + + expected = impl.py_func(other) + got = impl(other) + self.assertEqual(expected, got) + + def test_extend_self(self): + @njit + def impl(): + l = List.empty_list(types.int32) + for x in range(10): + l.append(x) + l.extend(l) + return l + + expected = impl.py_func() + got = impl() + self.assertEqual(expected, got) + + def test_extend_tuple(self): + @njit + def impl(): + l = List.empty_list(types.int32) + for x in range(10): + l.append(x) + l.extend((100,200,300)) + return l + + expected = impl.py_func() + got = impl() + self.assertEqual(expected, got) + + def test_extend_single_value_container(self): + @njit + def impl(): + l = List() + l.extend((100,)) + return l + + expected = impl.py_func() + got = impl() + self.assertEqual(expected, got) + + def test_extend_empty_unrefined(self): + # Extending an unrefined list with an empty iterable doesn't work in a + # jit compiled function as the list remains untyped. + l = List() + ret = l.extend(tuple()) + self.assertIsNone(ret) + self.assertEqual(len(l), 0) + self.assertFalse(l._typed) + + def test_extend_empty_refiend(self): + # Extending a refined list with an empty iterable doesn't work in a + # jit compiled function as the (empty) argument can't be typed + l = List((1,)) + l.extend(tuple()) + self.assertEqual(len(l), 1) + self.assertTrue(l._typed) + + +@njit +def cmp(a, b): + return a < b, a <= b, a == b, a != b, a >= b, a > b + + +class TestComparisons(MemoryLeakMixin, TestCase): + + def _cmp_dance(self, expected, pa, pb, na, nb): + # interpreter with regular list + self.assertEqual(cmp.py_func(pa, pb), expected) + + # interpreter with typed-list + py_got = cmp.py_func(na, nb) + self.assertEqual(py_got, expected) + + # compiled with typed-list + jit_got = cmp(na, nb) + self.assertEqual(jit_got, expected) + + def test_empty_vs_empty(self): + pa, pb = [], [] + na, nb = to_tl(pa), to_tl(pb) + expected = False, True, True, False, True, False + self._cmp_dance(expected, pa, pb, na, nb) + + def test_empty_vs_singleton(self): + pa, pb = [], [0] + na, nb = to_tl(pa), to_tl(pb) + expected = True, True, False, True, False, False + self._cmp_dance(expected, pa, pb, na, nb) + + def test_singleton_vs_empty(self): + pa, pb = [0], [] + na, nb = to_tl(pa), to_tl(pb) + expected = False, False, False, True, True, True + self._cmp_dance(expected, pa, pb, na, nb) + + def test_singleton_vs_singleton_equal(self): + pa, pb = [0], [0] + na, nb = to_tl(pa), to_tl(pb) + expected = False, True, True, False, True, False + self._cmp_dance(expected, pa, pb, na, nb) + + def test_singleton_vs_singleton_less_than(self): + pa, pb = [0], [1] + na, nb = to_tl(pa), to_tl(pb) + expected = True, True, False, True, False, False + self._cmp_dance(expected, pa, pb, na, nb) + + def test_singleton_vs_singleton_greater_than(self): + pa, pb = [1], [0] + na, nb = to_tl(pa), to_tl(pb) + expected = False, False, False, True, True, True + self._cmp_dance(expected, pa, pb, na, nb) + + def test_equal(self): + pa, pb = [1, 2, 3], [1, 2, 3] + na, nb = to_tl(pa), to_tl(pb) + expected = False, True, True, False, True, False + self._cmp_dance(expected, pa, pb, na, nb) + + def test_first_shorter(self): + pa, pb = [1, 2], [1, 2, 3] + na, nb = to_tl(pa), to_tl(pb) + expected = True, True, False, True, False, False + self._cmp_dance(expected, pa, pb, na, nb) + + def test_second_shorter(self): + pa, pb = [1, 2, 3], [1, 2] + na, nb = to_tl(pa), to_tl(pb) + expected = False, False, False, True, True, True + self._cmp_dance(expected, pa, pb, na, nb) + + def test_first_less_than(self): + pa, pb = [1, 2, 2], [1, 2, 3] + na, nb = to_tl(pa), to_tl(pb) + expected = True, True, False, True, False, False + self._cmp_dance(expected, pa, pb, na, nb) + + def test_first_greater_than(self): + pa, pb = [1, 2, 3], [1, 2, 2] + na, nb = to_tl(pa), to_tl(pb) + expected = False, False, False, True, True, True + self._cmp_dance(expected, pa, pb, na, nb) + + def test_equals_non_list(self): + l = to_tl([1, 2, 3]) + self.assertFalse(any(cmp.py_func(l, 1))) + self.assertFalse(any(cmp(l, 1))) + + +class TestListInferred(TestCase): + + def test_simple_refine_append(self): + @njit + def foo(): + l = List() + l.append(1) + return l + + expected = foo.py_func() + got = foo() + self.assertEqual(expected, got) + self.assertEqual(list(got), [1]) + self.assertEqual(typeof(got).item_type, typeof(1)) + + def test_simple_refine_insert(self): + @njit + def foo(): + l = List() + l.insert(0, 1) + return l + + expected = foo.py_func() + got = foo() + self.assertEqual(expected, got) + self.assertEqual(list(got), [1]) + self.assertEqual(typeof(got).item_type, typeof(1)) + + def test_refine_extend_list(self): + @njit + def foo(): + a = List() + b = List() + for i in range(3): + b.append(i) + a.extend(b) + return a + + expected = foo.py_func() + got = foo() + self.assertEqual(expected, got) + self.assertEqual(list(got), [0, 1, 2]) + self.assertEqual(typeof(got).item_type, typeof(1)) + + def test_refine_extend_set(self): + @njit + def foo(): + l = List() + l.extend((0, 1, 2)) + return l + + expected = foo.py_func() + got = foo() + self.assertEqual(expected, got) + self.assertEqual(list(got), [0, 1, 2]) + self.assertEqual(typeof(got).item_type, typeof(1)) + + def test_refine_list_extend_iter(self): + @njit + def foo(): + l = List() + d = Dict() + d[0] = 0 + # d.keys() provides a DictKeysIterableType + l.extend(d.keys()) + return l + + got = foo() + self.assertEqual(0, got[0]) + + +class TestListRefctTypes(MemoryLeakMixin, TestCase): + + def test_str_item(self): + @njit + def foo(): + l = List.empty_list(types.unicode_type) + for s in ("a", "ab", "abc", "abcd"): + l.append(s) + return l + + l = foo() + expected = ["a", "ab", "abc", "abcd"] + for i, s in enumerate(expected): + self.assertEqual(l[i], s) + self.assertEqual(list(l), expected) + # Test insert replacement + l[3] = 'uxyz' + self.assertEqual(l[3], 'uxyz') + # Test list growth + nelem = 100 + for i in range(4, nelem): + l.append(str(i)) + self.assertEqual(l[i], str(i)) + + def test_str_item_refcount_replace(self): + @njit + def foo(): + # use some tricks to make ref-counted unicode + i, j = 'ab', 'c' + a = i + j + m, n = 'zy', 'x' + z = m + n + l = List.empty_list(types.unicode_type) + l.append(a) + # This *should* dec' a and inc' z thus tests that items that are + # replaced are also dec'ed. + l[0] = z + ra, rz = get_refcount(a), get_refcount(z) + return l, ra, rz + + l, ra, rz = foo() + self.assertEqual(l[0], "zyx") + self.assertEqual(ra, 1) + self.assertEqual(rz, 2) + + def test_dict_as_item_in_list(self): + @njit + def foo(): + l = List.empty_list(Dict.empty(int32, int32)) + d = Dict.empty(int32, int32) + d[0] = 1 + # This increments the refcount for d + l.append(d) + return get_refcount(d) + + c = foo() + if config.LLVM_REFPRUNE_PASS: + # Because the pruner cleared all other increfs + self.assertEqual(1, c) + else: + self.assertEqual(2, c) + + def test_dict_as_item_in_list_multi_refcount(self): + @njit + def foo(): + l = List.empty_list(Dict.empty(int32, int32)) + d = Dict.empty(int32, int32) + d[0] = 1 + # This increments the refcount for d, twice + l.append(d) + l.append(d) + return get_refcount(d) + + c = foo() + if config.LLVM_REFPRUNE_PASS: + # Because the pruner cleared all other increfs + self.assertEqual(1, c) + else: + self.assertEqual(3, c) + + def test_list_as_value_in_dict(self): + @njit + def foo(): + d = Dict.empty(int32, List.empty_list(int32)) + l = List.empty_list(int32) + l.append(0) + # This increments the refcount for l + d[0] = l + return get_refcount(l) + + c = foo() + if config.LLVM_REFPRUNE_PASS: + # Because the pruner cleared all other increfs + self.assertEqual(1, c) + else: + self.assertEqual(2, c) + + def test_list_as_item_in_list(self): + nested_type = types.ListType(types.int32) + + @njit + def foo(): + la = List.empty_list(nested_type) + lb = List.empty_list(types.int32) + lb.append(1) + la.append(lb) + return la + + expected = foo.py_func() + got = foo() + self.assertEqual(expected, got) + + def test_array_as_item_in_list(self): + nested_type = types.Array(types.float64, 1, 'C') + + @njit + def foo(): + l = List.empty_list(nested_type) + a = np.zeros((1,)) + l.append(a) + return l + + expected = foo.py_func() + got = foo() + # Need to compare the nested arrays + self.assertTrue(np.all(expected[0] == got[0])) + + def test_array_pop_from_single_value_list(self): + @njit + def foo(): + l = List((np.zeros((1,)),)) + l.pop() + return l + + expected, got = foo.py_func(), foo() + # Need to compare the nested arrays + self.assertEqual(len(expected), 0) + self.assertEqual(len(got), 0) + # FIXME comparison of empty array-typed lists fails + # self.assertEqual(expected, got) + + def test_5264(self): + # Test the reproducer from #5264 and make sure it doesn't segfault + float_array = types.float64[:] + l = List.empty_list(float_array) + l.append(np.ones(3,dtype=np.float64)) + l.pop() + self.assertEqual(0, len(l)) + + def test_jitclass_as_item_in_list(self): + + spec = [ + ('value', int32), # a simple scalar field + ('array', float32[:]), # an array field + ] + + @jitclass(spec) + class Bag(object): + def __init__(self, value): + self.value = value + self.array = np.zeros(value, dtype=np.float32) + + @property + def size(self): + return self.array.size + + def increment(self, val): + for i in range(self.size): + self.array[i] += val + return self.array + + @njit + def foo(): + l = List() + l.append(Bag(21)) + l.append(Bag(22)) + l.append(Bag(23)) + return l + + expected = foo.py_func() + got = foo() + + def bag_equal(one, two): + # jitclasses couldn't override __eq__ at time of writing + self.assertEqual(one.value, two.value) + np.testing.assert_allclose(one.array, two.array) + + [bag_equal(a, b) for a, b in zip(expected, got)] + + def test_4960(self): + # Test the reproducer from #4960 and make sure it doesn't segfault + @jitclass([('value', int32)]) + class Simple(object): + def __init__(self, value): + self.value = value + + @njit + def foo(): + l = List((Simple(23),Simple(24))) + l.pop() + return l + + l = foo() + self.assertEqual(1, len(l)) + + def test_storage_model_mismatch(self): + # https://github.com/numba/numba/issues/4520 + # check for storage model mismatch in refcount ops generation + lst = List() + ref = [ + ("a", True, "a"), + ("b", False, "b"), + ("c", False, "c"), + ] + # populate + for x in ref: + lst.append(x) + # test + for i, x in enumerate(ref): + self.assertEqual(lst[i], ref[i]) + + def test_equals_on_list_with_dict_for_equal_lists(self): + # https://github.com/numba/numba/issues/4879 + a, b = List(), Dict() + b["a"] = 1 + a.append(b) + + c, d = List(), Dict() + d["a"] = 1 + c.append(d) + + self.assertEqual(a, c) + + def test_equals_on_list_with_dict_for_unequal_dicts(self): + # https://github.com/numba/numba/issues/4879 + a, b = List(), Dict() + b["a"] = 1 + a.append(b) + + c, d = List(), Dict() + d["a"] = 2 + c.append(d) + + self.assertNotEqual(a, c) + + def test_equals_on_list_with_dict_for_unequal_lists(self): + # https://github.com/numba/numba/issues/4879 + a, b = List(), Dict() + b["a"] = 1 + a.append(b) + + c, d, e = List(), Dict(), Dict() + d["a"] = 1 + e["b"] = 2 + c.append(d) + c.append(e) + + self.assertNotEqual(a, c) + + +class TestListSort(MemoryLeakMixin, TestCase): + def setUp(self): + super(TestListSort, self).setUp() + np.random.seed(0) + + def make(self, ctor, data): + lst = ctor() + lst.extend(data) + return lst + + def make_both(self, data): + return { + 'py': self.make(list, data), + 'nb': self.make(List, data), + } + + def test_sort_no_args(self): + def udt(lst): + lst.sort() + return lst + + for nelem in [13, 29, 127]: + my_lists = self.make_both(np.random.randint(0, nelem, nelem)) + self.assertEqual(list(udt(my_lists['nb'])), udt(my_lists['py'])) + + def test_sort_all_args(self): + def udt(lst, key, reverse): + lst.sort(key=key, reverse=reverse) + return lst + + possible_keys = [ + lambda x: -x, # negative + lambda x: 1 / (1 + x), # make float + lambda x: (x, -x), # tuple + lambda x: x, # identity + ] + possible_reverse = [True, False] + for key, reverse in product(possible_keys, possible_reverse): + my_lists = self.make_both(np.random.randint(0, 100, 23)) + msg = "case for key={} reverse={}".format(key, reverse) + self.assertEqual( + list(udt(my_lists['nb'], key=key, reverse=reverse)), + udt(my_lists['py'], key=key, reverse=reverse), + msg=msg, + ) + + def test_sort_dispatcher_key(self): + def udt(lst, key): + lst.sort(key=key) + return lst + + my_lists = self.make_both(np.random.randint(0, 100, 31)) + py_key = lambda x: x + 1 + nb_key = njit(lambda x: x + 1) + # test typedlist with jitted function + self.assertEqual( + list(udt(my_lists['nb'], key=nb_key)), + udt(my_lists['py'], key=py_key), + ) + # test typedlist with and without jitted function + self.assertEqual( + list(udt(my_lists['nb'], key=nb_key)), + list(udt(my_lists['nb'], key=py_key)), + ) + + def test_sort_in_jit_w_lambda_key(self): + @njit + def udt(lst): + lst.sort(key=lambda x: -x) + return lst + + lst = self.make(List, np.random.randint(0, 100, 31)) + self.assertEqual(udt(lst), udt.py_func(lst)) + + def test_sort_in_jit_w_global_key(self): + @njit + def keyfn(x): + return -x + + @njit + def udt(lst): + lst.sort(key=keyfn) + return lst + + lst = self.make(List, np.random.randint(0, 100, 31)) + self.assertEqual(udt(lst), udt.py_func(lst)) + + def test_sort_on_arrays(self): + @njit + def foo(lst): + lst.sort(key=lambda arr: np.sum(arr)) + return lst + + arrays = [np.random.random(3) for _ in range(10)] + my_lists = self.make_both(arrays) + self.assertEqual( + list(foo(my_lists['nb'])), + foo.py_func(my_lists['py']), + ) + + +class TestImmutable(MemoryLeakMixin, TestCase): + + def test_is_immutable(self): + @njit + def foo(): + l = List() + l.append(1) + return l._is_mutable() + self.assertTrue(foo()) + self.assertTrue(foo.py_func()) + + def test_make_immutable_is_immutable(self): + @njit + def foo(): + l = List() + l.append(1) + l._make_immutable() + return l._is_mutable() + self.assertFalse(foo()) + self.assertFalse(foo.py_func()) + + def test_length_still_works_when_immutable(self): + @njit + def foo(): + l = List() + l.append(1) + l._make_immutable() + return len(l),l._is_mutable() + length, mutable = foo() + self.assertEqual(length, 1) + self.assertFalse(mutable) + + def test_getitem_still_works_when_immutable(self): + @njit + def foo(): + l = List() + l.append(1) + l._make_immutable() + return l[0], l._is_mutable() + test_item, mutable = foo() + self.assertEqual(test_item, 1) + self.assertFalse(mutable) + + def test_append_fails(self): + self.disable_leak_check() + + @njit + def foo(): + l = List() + l.append(1) + l._make_immutable() + l.append(1) + + for func in (foo, foo.py_func): + with self.assertRaises(ValueError) as raises: + func() + self.assertIn( + 'list is immutable', + str(raises.exception), + ) + + def test_mutation_fails(self): + """ Test that any attempt to mutate an immutable typed list fails. """ + self.disable_leak_check() + + def generate_function(line): + context = {} + exec(dedent(""" + from numba.typed import List + def bar(): + lst = List() + lst.append(1) + lst._make_immutable() + {} + """.format(line)), context) + return njit(context["bar"]) + for line in ("lst.append(0)", + "lst[0] = 0", + "lst.pop()", + "del lst[0]", + "lst.extend((0,))", + "lst.insert(0, 0)", + "lst.clear()", + "lst.reverse()", + "lst.sort()", + ): + foo = generate_function(line) + for func in (foo, foo.py_func): + with self.assertRaises(ValueError) as raises: + func() + self.assertIn( + "list is immutable", + str(raises.exception), + ) + + +class TestGetItemIndexType(MemoryLeakMixin, TestCase): + + def test_indexing_with_uint8(self): + """ Test for reproducer at https://github.com/numba/numba/issues/7250 + """ + @njit + def foo(): + l = List.empty_list(uint8) + for i in range(129): + l.append(uint8(i)) + a = uint8(128) + return l[a] + + self.assertEqual(foo(), 128) + + +class TestListFromIter(MemoryLeakMixin, TestCase): + + def test_simple_iterable_types(self): + """Test all simple iterables that a List can be constructed from.""" + + def generate_function(line): + context = {} + code = dedent(""" + from numba.typed import List + def bar(): + {} + return l + """).format(line) + exec(code, context) + return njit(context["bar"]) + for line in ("l = List([0, 1, 2])", + "l = List(range(3))", + "l = List(List([0, 1, 2]))", + "l = List((0, 1, 2))", + "l = List(set([0, 1, 2]))", + ): + foo = generate_function(line) + cf_received, py_received = foo(), foo.py_func() + for result in (cf_received, py_received): + for i in range(3): + self.assertEqual(i, result[i]) + + def test_unicode(self): + """Test that a List can be created from a unicode string.""" + @njit + def foo(): + l = List("abc") + return l + expected = List() + for i in ("a", "b", "c"): + expected.append(i) + self.assertEqual(foo.py_func(), expected) + self.assertEqual(foo(), expected) + + def test_dict_iters(self): + """Test that a List can be created from Dict iterators.""" + + def generate_function(line): + context = {} + code = dedent(""" + from numba.typed import List, Dict + def bar(): + d = Dict() + d[0], d[1], d[2] = "a", "b", "c" + {} + return l + """).format(line) + exec(code, context) + return njit(context["bar"]) + + def generate_expected(values): + expected = List() + for i in values: + expected.append(i) + return expected + + for line, values in ( + ("l = List(d)", (0, 1, 2)), + ("l = List(d.keys())", (0, 1, 2)), + ("l = List(d.values())", ("a", "b", "c")), + ("l = List(d.items())", ((0, "a"), (1, "b"), (2, "c"))), + ): + foo, expected = generate_function(line), generate_expected(values) + for func in (foo, foo.py_func): + self.assertEqual(func(), expected) + + def test_ndarray_scalar(self): + + @njit + def foo(): + return List(np.ones(3)) + + expected = List() + for i in range(3): + expected.append(1) + + self.assertEqual(expected, foo()) + self.assertEqual(expected, foo.py_func()) + + def test_ndarray_oned(self): + + @njit + def foo(): + return List(np.array(1)) + + expected = List() + expected.append(1) + + self.assertEqual(expected, foo()) + self.assertEqual(expected, foo.py_func()) + + def test_ndarray_twod(self): + + @njit + def foo(x): + return List(x) + + carr = np.array([[1, 2], [3, 4]]) + farr = np.asfortranarray(carr) + aarr = np.arange(8).reshape((2, 4))[:, ::2] + + for layout, arr in zip('CFA', (carr, farr, aarr)): + self.assertEqual(typeof(arr).layout, layout) + expected = List() + expected.append(arr[0, :]) + expected.append(arr[1, :]) + received = foo(arr) + + np.testing.assert_equal(expected[0], received[0]) + np.testing.assert_equal(expected[1], received[1]) + + pyreceived = foo.py_func(arr) + + np.testing.assert_equal(expected[0], pyreceived[0]) + np.testing.assert_equal(expected[1], pyreceived[1]) + + def test_exception_on_plain_int(self): + @njit + def foo(): + l = List(23) + return l + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "List() argument must be iterable", + str(raises.exception), + ) + + with self.assertRaises(TypeError) as raises: + List(23) + self.assertIn( + "List() argument must be iterable", + str(raises.exception), + ) + + def test_exception_on_inhomogeneous_tuple(self): + @njit + def foo(): + l = List((1, 1.0)) + return l + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "List() argument must be iterable", + str(raises.exception), + ) + + with self.assertRaises(TypingError) as raises: + List((1, 1.0)) + # FIXME this bails with a length casting error when we attempt to + # append 1.0 to an int typed list. + + def test_exception_on_too_many_args(self): + @njit + def foo(): + l = List((0, 1, 2), (3, 4, 5)) + return l + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "List() expected at most 1 argument, got 2", + str(raises.exception), + ) + + with self.assertRaises(TypeError) as raises: + List((0, 1, 2), (3, 4, 5)) + self.assertIn( + "List() expected at most 1 argument, got 2", + str(raises.exception), + ) + + @njit + def foo(): + l = List((0, 1, 2), (3, 4, 5), (6, 7, 8)) + return l + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "List() expected at most 1 argument, got 3", + str(raises.exception), + ) + + with self.assertRaises(TypeError) as raises: + List((0, 1, 2), (3, 4, 5), (6, 7, 8)) + self.assertIn( + "List() expected at most 1 argument, got 3", + str(raises.exception), + ) + + def test_exception_on_kwargs(self): + @njit + def foo(): + l = List(iterable=(0, 1, 2)) + return l + + with self.assertRaises(TypingError) as raises: + foo() + self.assertIn( + "List() takes no keyword arguments", + str(raises.exception), + ) + + with self.assertRaises(TypeError) as raises: + List(iterable=(0, 1, 2)) + self.assertIn( + "List() takes no keyword arguments", + str(raises.exception), + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typedobjectutils.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typedobjectutils.py new file mode 100644 index 0000000000000000000000000000000000000000..f93d6252db85d83595cbf1ce814b7167a32426d4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typedobjectutils.py @@ -0,0 +1,68 @@ +""" +Unit-tests for `typedobjectutils.py` +""" + +import warnings + + +from numba.core import types +from numba.tests.support import TestCase +from numba.typed.typedobjectutils import _sentry_safe_cast + + +class TestTypedObjectUtils(TestCase): + def test_sentry_safe_cast_warnings(self): + warn_cases = [] + warn_cases += [ + # integer cases + (types.int32, types.int16), + (types.int32, types.uint32), + (types.int64, types.uint32), + # float cases + (types.float64, types.float32), + # complex cases + (types.complex128, types.complex64), + # int to float cases + (types.int32, types.float32), + (types.int64, types.float32), + # tuple-of-ints to tuple-of-floats, + (types.Tuple([types.int32]), types.Tuple([types.float32])), + ] + + for fromty, toty in warn_cases: + with self.subTest(fromty=fromty, toty=toty): + with warnings.catch_warnings(record=True) as w: + _sentry_safe_cast(fromty, toty) + self.assertEqual(len(w), 1) + # Make sure the warning is about unsafe cast + self.assertIn( + "unsafe cast from {} to {}".format(fromty, toty), + str(w[0]), + ) + + def test_sentry_safe_cast_no_warn(self): + ok_cases = [] + ok_cases += [ + # integer cases + (types.int32, types.int64), + (types.uint8, types.int32), + # float cases + (types.float32, types.float64), + # complex cases + (types.complex64, types.complex128), + # int to float cases + (types.int32, types.float64), + (types.uint8, types.float32), + # float to complex cases + (types.float32, types.complex128), + (types.float64, types.complex128), + # tuple-of-ints to tuple-of-ints, + (types.Tuple([types.int32]), types.Tuple([types.int64])), + ] + + for fromty, toty in ok_cases: + with self.subTest(fromty=fromty, toty=toty): + with warnings.catch_warnings(record=True) as w: + _sentry_safe_cast(fromty, toty) + # Expect no warnings + self.assertEqual(len(w), 0) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeguard.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeguard.py new file mode 100644 index 0000000000000000000000000000000000000000..37ab82dd8fc321fe560b87ed10f62fcfba36b277 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeguard.py @@ -0,0 +1,44 @@ +""" +Tests to ensure that typeguard is working as expected. +This mostly contains negative tests as proof that typeguard can catch errors. +""" +import unittest +from numba.tests.support import TestCase, skip_unless_typeguard + + +def guard_args(val: int): + return + + +def guard_ret(val) -> int: + return val + + +@skip_unless_typeguard +class TestTypeGuard(TestCase): + + def setUp(self): + super().setUp() + import typeguard + # This is a test class invariant but the Numba multiprocesses test + # runner doesn't respect `setUpClass` so just use `setUp`. + # typeguard 3+ uses typeguard.TypeCheckError, 2.x uses TypeError + self._exception_type = getattr(typeguard, 'TypeCheckError', TypeError) + + def test_check_args(self): + with self.assertRaises(self._exception_type): + guard_args(float(1.2)) + + def test_check_ret(self): + with self.assertRaises(self._exception_type): + guard_ret(float(1.2)) + + def test_check_does_not_work_with_inner_func(self): + def guard(val: int) -> int: + return + + guard(float(1.2)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeinfer.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeinfer.py new file mode 100644 index 0000000000000000000000000000000000000000..067b803201cc8e8c72658e2f6f7fdf12d45867f0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeinfer.py @@ -0,0 +1,936 @@ +import os, sys, subprocess +import dis +import itertools + +import numpy as np + +import numba +from numba import jit, njit +from numba.core import errors, ir, types, typing, typeinfer, utils +from numba.core.typeconv import Conversion +from numba.extending import overload_method + +from numba.tests.support import TestCase, tag +from numba.tests.test_typeconv import CompatibilityTestMixin +from numba.core.untyped_passes import TranslateByteCode, IRProcessing +from numba.core.typed_passes import PartialTypeInference +from numba.core.compiler_machinery import FunctionPass, register_pass +import unittest + + +i8 = types.int8 +i16 = types.int16 +i32 = types.int32 +i64 = types.int64 +u8 = types.uint8 +u16 = types.uint16 +u32 = types.uint32 +u64 = types.uint64 +f32 = types.float32 +f64 = types.float64 +c64 = types.complex64 +c128 = types.complex128 + +skip_unless_load_fast_and_clear = unittest.skipUnless( + "LOAD_FAST_AND_CLEAR" in dis.opmap, + "Requires LOAD_FAST_AND_CLEAR opcode", +) + + +class TestArgRetCasting(unittest.TestCase): + def test_arg_ret_casting(self): + def foo(x): + return x + + args = (i32,) + return_type = f32 + cfunc = njit(return_type(*args))(foo) + cres = cfunc.overloads[args] + self.assertTrue(isinstance(cfunc(123), float)) + self.assertEqual(cres.signature.args, args) + self.assertEqual(cres.signature.return_type, return_type) + + def test_arg_ret_mismatch(self): + def foo(x): + return x + + args = (types.Array(i32, 1, 'C'),) + return_type = f32 + try: + njit(return_type(*args))(foo) + except errors.TypingError as e: + pass + else: + self.fail("Should complain about array casting to float32") + + def test_invalid_arg_type_forcing(self): + def foo(iters): + a = range(iters) + return iters + + args = (u32,) + return_type = u8 + cfunc = njit(return_type(*args))(foo) + cres = cfunc.overloads[args] + typemap = cres.type_annotation.typemap + # Argument "iters" must be uint32 + self.assertEqual(typemap['iters'], u32) + + +class TestUnify(unittest.TestCase): + """ + Tests for type unification with a typing context. + """ + + int_unify = { + ('uint8', 'uint8'): 'uint8', + ('int8', 'int8'): 'int8', + ('uint16', 'uint16'): 'uint16', + ('int16', 'int16'): 'int16', + ('uint32', 'uint32'): 'uint32', + ('int32', 'int32'): 'int32', + ('uint64', 'uint64'): 'uint64', + ('int64', 'int64'): 'int64', + + ('int8', 'uint8'): 'int16', + ('int8', 'uint16'): 'int32', + ('int8', 'uint32'): 'int64', + + ('uint8', 'int32'): 'int32', + ('uint8', 'uint64'): 'uint64', + + ('int16', 'int8'): 'int16', + ('int16', 'uint8'): 'int16', + ('int16', 'uint16'): 'int32', + ('int16', 'uint32'): 'int64', + ('int16', 'int64'): 'int64', + ('int16', 'uint64'): 'float64', + + ('uint16', 'uint8'): 'uint16', + ('uint16', 'uint32'): 'uint32', + ('uint16', 'int32'): 'int32', + ('uint16', 'uint64'): 'uint64', + + ('int32', 'int8'): 'int32', + ('int32', 'int16'): 'int32', + ('int32', 'uint32'): 'int64', + ('int32', 'int64'): 'int64', + + ('uint32', 'uint8'): 'uint32', + ('uint32', 'int64'): 'int64', + ('uint32', 'uint64'): 'uint64', + + ('int64', 'int8'): 'int64', + ('int64', 'uint8'): 'int64', + ('int64', 'uint16'): 'int64', + + ('uint64', 'int8'): 'float64', + ('uint64', 'int32'): 'float64', + ('uint64', 'int64'): 'float64', + } + + def assert_unify(self, aty, bty, expected): + ctx = typing.Context() + template = "{0}, {1} -> {2} != {3}" + for unify_func in ctx.unify_types, ctx.unify_pairs: + unified = unify_func(aty, bty) + self.assertEqual(unified, expected, + msg=template.format(aty, bty, unified, expected)) + unified = unify_func(bty, aty) + self.assertEqual(unified, expected, + msg=template.format(bty, aty, unified, expected)) + + def assert_unify_failure(self, aty, bty): + self.assert_unify(aty, bty, None) + + def test_integer(self): + ctx = typing.Context() + for aty, bty in itertools.product(types.integer_domain, + types.integer_domain): + key = (str(aty), str(bty)) + try: + expected = self.int_unify[key] + except KeyError: + expected = self.int_unify[key[::-1]] + self.assert_unify(aty, bty, getattr(types, expected)) + + def test_bool(self): + aty = types.boolean + for bty in types.integer_domain: + self.assert_unify(aty, bty, bty) + # Not sure about this one, but it respects transitivity + for cty in types.real_domain: + self.assert_unify(aty, cty, cty) + + def unify_number_pair_test(self, n): + """ + Test all permutations of N-combinations of numeric types and ensure + that the order of types in the sequence is irrelevant. + """ + ctx = typing.Context() + for tys in itertools.combinations(types.number_domain, n): + res = [ctx.unify_types(*comb) + for comb in itertools.permutations(tys)] + first_result = res[0] + # Sanity check + self.assertIsInstance(first_result, types.Number) + # All results must be equal + for other in res[1:]: + self.assertEqual(first_result, other) + + def test_unify_number_pair(self): + self.unify_number_pair_test(2) + self.unify_number_pair_test(3) + + def test_none_to_optional(self): + """ + Test unification of `none` and multiple number types to optional type + """ + ctx = typing.Context() + for tys in itertools.combinations(types.number_domain, 2): + # First unify without none, to provide the control value + tys = list(tys) + expected = types.Optional(ctx.unify_types(*tys)) + results = [ctx.unify_types(*comb) + for comb in itertools.permutations(tys + [types.none])] + # All results must be equal + for res in results: + self.assertEqual(res, expected) + + def test_none(self): + aty = types.none + bty = types.none + self.assert_unify(aty, bty, types.none) + + def test_optional(self): + aty = types.Optional(i32) + bty = types.none + self.assert_unify(aty, bty, aty) + aty = types.Optional(i32) + bty = types.Optional(i64) + self.assert_unify(aty, bty, bty) + aty = types.Optional(i32) + bty = i64 + self.assert_unify(aty, bty, types.Optional(i64)) + # Failure + aty = types.Optional(i32) + bty = types.Optional(types.slice3_type) + self.assert_unify_failure(aty, bty) + + def test_tuple(self): + aty = types.UniTuple(i32, 3) + bty = types.UniTuple(i64, 3) + self.assert_unify(aty, bty, types.UniTuple(i64, 3)) + # (Tuple, UniTuple) -> Tuple + aty = types.UniTuple(i32, 2) + bty = types.Tuple((i16, i64)) + self.assert_unify(aty, bty, types.Tuple((i32, i64))) + aty = types.UniTuple(i64, 0) + bty = types.Tuple(()) + self.assert_unify(aty, bty, bty) + # (Tuple, Tuple) -> Tuple + aty = types.Tuple((i8, i16, i32)) + bty = types.Tuple((i32, i16, i8)) + self.assert_unify(aty, bty, types.Tuple((i32, i16, i32))) + aty = types.Tuple((i8, i32)) + bty = types.Tuple((i32, i8)) + self.assert_unify(aty, bty, types.Tuple((i32, i32))) + aty = types.Tuple((i8, i16)) + bty = types.Tuple((i16, i8)) + self.assert_unify(aty, bty, types.Tuple((i16, i16))) + # Different number kinds + aty = types.UniTuple(f64, 3) + bty = types.UniTuple(c64, 3) + self.assert_unify(aty, bty, types.UniTuple(c128, 3)) + # Tuples of tuples + aty = types.UniTuple(types.Tuple((u32, f32)), 2) + bty = types.UniTuple(types.Tuple((i16, f32)), 2) + self.assert_unify(aty, bty, + types.UniTuple(types.Tuple((i64, f32)), 2)) + # Failures + aty = types.UniTuple(i32, 1) + bty = types.UniTuple(types.slice3_type, 1) + self.assert_unify_failure(aty, bty) + aty = types.UniTuple(i32, 1) + bty = types.UniTuple(i32, 2) + self.assert_unify_failure(aty, bty) + aty = types.Tuple((i8, types.slice3_type)) + bty = types.Tuple((i32, i8)) + self.assert_unify_failure(aty, bty) + + def test_optional_tuple(self): + # Unify to optional tuple + aty = types.none + bty = types.UniTuple(i32, 2) + self.assert_unify(aty, bty, types.Optional(types.UniTuple(i32, 2))) + aty = types.Optional(types.UniTuple(i16, 2)) + bty = types.UniTuple(i32, 2) + self.assert_unify(aty, bty, types.Optional(types.UniTuple(i32, 2))) + # Unify to tuple of optionals + aty = types.Tuple((types.none, i32)) + bty = types.Tuple((i16, types.none)) + self.assert_unify(aty, bty, types.Tuple((types.Optional(i16), + types.Optional(i32)))) + aty = types.Tuple((types.Optional(i32), i64)) + bty = types.Tuple((i16, types.Optional(i8))) + self.assert_unify(aty, bty, types.Tuple((types.Optional(i32), + types.Optional(i64)))) + + def test_arrays(self): + aty = types.Array(i32, 3, "C") + bty = types.Array(i32, 3, "A") + self.assert_unify(aty, bty, bty) + aty = types.Array(i32, 3, "C") + bty = types.Array(i32, 3, "F") + self.assert_unify(aty, bty, types.Array(i32, 3, "A")) + aty = types.Array(i32, 3, "C") + bty = types.Array(i32, 3, "C", readonly=True) + self.assert_unify(aty, bty, bty) + aty = types.Array(i32, 3, "A") + bty = types.Array(i32, 3, "C", readonly=True) + self.assert_unify(aty, bty, + types.Array(i32, 3, "A", readonly=True)) + # Failures + aty = types.Array(i32, 2, "C") + bty = types.Array(i32, 3, "C") + self.assert_unify_failure(aty, bty) + aty = types.Array(i32, 2, "C") + bty = types.Array(u32, 2, "C") + self.assert_unify_failure(aty, bty) + + def test_list(self): + aty = types.List(types.undefined) + bty = types.List(i32) + self.assert_unify(aty, bty, bty) + aty = types.List(i16) + bty = types.List(i32) + self.assert_unify(aty, bty, bty) + aty = types.List(types.Tuple([i32, i16])) + bty = types.List(types.Tuple([i16, i64])) + cty = types.List(types.Tuple([i32, i64])) + self.assert_unify(aty, bty, cty) + # Different reflections + aty = types.List(i16, reflected=True) + bty = types.List(i32) + cty = types.List(i32, reflected=True) + self.assert_unify(aty, bty, cty) + # Incompatible dtypes + aty = types.List(i16) + bty = types.List(types.Tuple([i16])) + self.assert_unify_failure(aty, bty) + + def test_set(self): + # Different reflections + aty = types.Set(i16, reflected=True) + bty = types.Set(i32) + cty = types.Set(i32, reflected=True) + self.assert_unify(aty, bty, cty) + # Incompatible dtypes + aty = types.Set(i16) + bty = types.Set(types.Tuple([i16])) + self.assert_unify_failure(aty, bty) + + def test_range(self): + aty = types.range_state32_type + bty = types.range_state64_type + self.assert_unify(aty, bty, bty) + + +class TestTypeConversion(CompatibilityTestMixin, unittest.TestCase): + """ + Test for conversion between types with a typing context. + """ + + def assert_can_convert(self, aty, bty, expected): + ctx = typing.Context() + got = ctx.can_convert(aty, bty) + self.assertEqual(got, expected) + + def assert_cannot_convert(self, aty, bty): + ctx = typing.Context() + got = ctx.can_convert(aty, bty) + self.assertIsNone(got) + + def test_convert_number_types(self): + # Check that Context.can_convert() is compatible with the default + # number conversion rules registered in the typeconv module + # (which is used internally by the C _Dispatcher object). + ctx = typing.Context() + self.check_number_compatibility(ctx.can_convert) + + def test_tuple(self): + # UniTuple -> UniTuple + aty = types.UniTuple(i32, 3) + bty = types.UniTuple(i64, 3) + self.assert_can_convert(aty, aty, Conversion.exact) + self.assert_can_convert(aty, bty, Conversion.promote) + aty = types.UniTuple(i32, 3) + bty = types.UniTuple(f64, 3) + self.assert_can_convert(aty, bty, Conversion.safe) + # Tuple -> Tuple + aty = types.Tuple((i32, i32)) + bty = types.Tuple((i32, i64)) + self.assert_can_convert(aty, bty, Conversion.promote) + # UniTuple <-> Tuple + aty = types.UniTuple(i32, 2) + bty = types.Tuple((i32, i64)) + self.assert_can_convert(aty, bty, Conversion.promote) + self.assert_can_convert(bty, aty, Conversion.unsafe) + # Empty tuples + aty = types.UniTuple(i64, 0) + bty = types.UniTuple(i32, 0) + cty = types.Tuple(()) + self.assert_can_convert(aty, bty, Conversion.safe) + self.assert_can_convert(bty, aty, Conversion.safe) + self.assert_can_convert(aty, cty, Conversion.safe) + self.assert_can_convert(cty, aty, Conversion.safe) + # Failures + aty = types.UniTuple(i64, 3) + bty = types.UniTuple(types.none, 3) + self.assert_cannot_convert(aty, bty) + aty = types.UniTuple(i64, 2) + bty = types.UniTuple(i64, 3) + + def test_arrays(self): + # Different layouts + aty = types.Array(i32, 3, "C") + bty = types.Array(i32, 3, "A") + self.assert_can_convert(aty, bty, Conversion.safe) + aty = types.Array(i32, 2, "C") + bty = types.Array(i32, 2, "F") + self.assert_cannot_convert(aty, bty) + # Different mutabilities + aty = types.Array(i32, 3, "C") + bty = types.Array(i32, 3, "C", readonly=True) + self.assert_can_convert(aty, aty, Conversion.exact) + self.assert_can_convert(bty, bty, Conversion.exact) + self.assert_can_convert(aty, bty, Conversion.safe) + self.assert_cannot_convert(bty, aty) + # Various failures + aty = types.Array(i32, 2, "C") + bty = types.Array(i32, 3, "C") + self.assert_cannot_convert(aty, bty) + aty = types.Array(i32, 2, "C") + bty = types.Array(i64, 2, "C") + self.assert_cannot_convert(aty, bty) + + def test_optional(self): + aty = types.int32 + bty = types.Optional(i32) + self.assert_can_convert(types.none, bty, Conversion.promote) + self.assert_can_convert(aty, bty, Conversion.promote) + self.assert_cannot_convert(bty, types.none) + self.assert_can_convert(bty, aty, Conversion.safe) # XXX ??? + # Optional array + aty = types.Array(i32, 2, "C") + bty = types.Optional(aty) + self.assert_can_convert(types.none, bty, Conversion.promote) + self.assert_can_convert(aty, bty, Conversion.promote) + self.assert_can_convert(bty, aty, Conversion.safe) + aty = types.Array(i32, 2, "C") + bty = types.Optional(aty.copy(layout="A")) + self.assert_can_convert(aty, bty, Conversion.safe) # C -> A + self.assert_cannot_convert(bty, aty) # A -> C + aty = types.Array(i32, 2, "C") + bty = types.Optional(aty.copy(layout="F")) + self.assert_cannot_convert(aty, bty) + self.assert_cannot_convert(bty, aty) + + +class TestResolveOverload(unittest.TestCase): + """ + Tests for typing.Context.resolve_overload(). + """ + + def assert_resolve_overload(self, cases, args, expected): + ctx = typing.Context() + got = ctx.resolve_overload("foo", cases, args, {}) + self.assertEqual(got, expected) + + def test_non_ambiguous_match(self): + def check(args, expected): + self.assert_resolve_overload(cases, args, expected) + # Order shouldn't matter here + self.assert_resolve_overload(cases[::-1], args, expected) + + cases = [i8(i8, i8), i32(i32, i32), f64(f64, f64)] + # Exact match + check((i8, i8), cases[0]) + check((i32, i32), cases[1]) + check((f64, f64), cases[2]) + # "Promote" conversion + check((i8, i16), cases[1]) + check((i32, i8), cases[1]) + check((i32, i8), cases[1]) + check((f32, f32), cases[2]) + # "Safe" conversion + check((u32, u32), cases[2]) + # "Unsafe" conversion + check((i64, i64), cases[2]) + + def test_ambiguous_match(self): + # When the best match is ambiguous (there is a tie), the first + # best case in original sequence order should be returned. + def check(args, expected, expected_reverse): + self.assert_resolve_overload(cases, args, expected) + self.assert_resolve_overload(cases[::-1], args, expected_reverse) + + cases = [i16(i16, i16), i32(i32, i32), f64(f64, f64)] + # Two "promote" conversions + check((i8, i8), cases[0], cases[1]) + # Two "safe" conversions + check((u16, u16), cases[1], cases[2]) + + cases = [i32(i32, i32), f32(f32, f32)] + # Two "unsafe" conversions + check((u32, u32), cases[0], cases[1]) + + def test_ambiguous_error(self): + ctx = typing.Context() + cases = [i16(i16, i16), i32(i32, i32)] + with self.assertRaises(TypeError) as raises: + ctx.resolve_overload("foo", cases, (i8, i8), {}, + allow_ambiguous=False) + self.assertEqual(str(raises.exception).splitlines(), + ["Ambiguous overloading for foo (int8, int8):", + "(int16, int16) -> int16", + "(int32, int32) -> int32", + ]) + + +class TestUnifyUseCases(unittest.TestCase): + """ + Concrete cases where unification would fail. + """ + + @staticmethod + def _actually_test_complex_unify(): + def pyfunc(a): + res = 0.0 + for i in range(len(a)): + res += a[i] + return res + + argtys = (types.Array(c128, 1, 'C'),) + cfunc = njit(argtys)(pyfunc) + return (pyfunc, cfunc) + + def test_complex_unify_issue599(self): + pyfunc, cfunc = self._actually_test_complex_unify() + arg = np.array([1.0j]) + self.assertEqual(cfunc(arg), pyfunc(arg)) + + def test_complex_unify_issue599_multihash(self): + """ + Test issue #599 for multiple values of PYTHONHASHSEED. + """ + env = os.environ.copy() + for seedval in (1, 2, 1024): + env['PYTHONHASHSEED'] = str(seedval) + subproc = subprocess.Popen( + [sys.executable, '-c', + 'import numba.tests.test_typeinfer as test_mod\n' + + 'test_mod.TestUnifyUseCases._actually_test_complex_unify()'], + env=env) + subproc.wait() + self.assertEqual(subproc.returncode, 0, 'Child process failed.') + + def test_int_tuple_unify(self): + """ + Test issue #493 + """ + def foo(an_int32, an_int64): + a = an_int32, an_int32 + while True: # infinite loop + a = an_int32, an_int64 + return a + + args = (i32, i64) + # Check if compilation is successful + njit(args)(foo) + + +def issue_797(x0, y0, x1, y1, grid): + nrows, ncols = grid.shape + + dx = abs(x1 - x0) + dy = abs(y1 - y0) + + sx = 0 + if x0 < x1: + sx = 1 + else: + sx = -1 + sy = 0 + if y0 < y1: + sy = 1 + else: + sy = -1 + + err = dx - dy + + while True: + if x0 == x1 and y0 == y1: + break + + if 0 <= x0 < nrows and 0 <= y0 < ncols: + grid[x0, y0] += 1 + + e2 = 2 * err + if e2 > -dy: + err -= dy + x0 += sx + if e2 < dx: + err += dx + y0 += sy + + +def issue_1080(a, b): + if not a: + return True + return b + + +def list_unify_usecase1(n): + res = 0 + x = [] + if n < 10: + x.append(np.int32(n)) + else: + for i in range(n): + x.append(np.int64(i)) + x.append(5.0) + + # Note `i` and `j` may have different types (int64 vs. int32) + for j in range(len(x)): + res += j * x[j] + for val in x: + res += int(val) & len(x) + while len(x) > 0: + res += x.pop() + return res + +def list_unify_usecase2(n): + res = [] + for i in range(n): + if i & 1: + res.append((i, 1.0)) + else: + res.append((2.0, i)) + res.append((123j, 42)) + return res + +def range_unify_usecase(v): + if v: + r = range(np.int32(3)) + else: + r = range(np.int64(5)) + for x in r: + return x + +def issue_1394(a): + if a: + for i in range(a): + a += i + i = 1.2 + else: + i = 3 + return a, i + + +class TestMiscIssues(TestCase): + + def test_issue_797(self): + """https://github.com/numba/numba/issues/797#issuecomment-58592401 + + Undeterministic triggering of tuple coercion error + """ + foo = jit(nopython=True)(issue_797) + g = np.zeros(shape=(10, 10), dtype=np.int32) + foo(np.int32(0), np.int32(0), np.int32(1), np.int32(1), g) + + def test_issue_1080(self): + """https://github.com/numba/numba/issues/1080 + + Erroneous promotion of boolean args to int64 + """ + foo = jit(nopython=True)(issue_1080) + foo(True, False) + + def test_list_unify1(self): + """ + Exercise back-propagation of refined list type. + """ + pyfunc = list_unify_usecase1 + cfunc = jit(nopython=True)(pyfunc) + for n in [5, 100]: + res = cfunc(n) + self.assertPreciseEqual(res, pyfunc(n)) + + def test_list_unify2(self): + pyfunc = list_unify_usecase2 + cfunc = jit(nopython=True)(pyfunc) + res = cfunc(3) + # NOTE: the types will differ (Numba returns a homogeneous list with + # converted values). + self.assertEqual(res, pyfunc(3)) + + def test_range_unify(self): + pyfunc = range_unify_usecase + cfunc = jit(nopython=True)(pyfunc) + for v in (0, 1): + res = cfunc(v) + self.assertPreciseEqual(res, pyfunc(v)) + + def test_issue_1394(self): + pyfunc = issue_1394 + cfunc = jit(nopython=True)(pyfunc) + for v in (0, 1, 2): + res = cfunc(v) + self.assertEqual(res, pyfunc(v)) + + def test_issue_6293(self): + """https://github.com/numba/numba/issues/6293 + + Typer does not propagate return type to all return variables + """ + @jit(nopython=True) + def confuse_typer(x): + if x == x: + return int(x) + else: + return x + + confuse_typer.compile((types.float64,)) + cres = confuse_typer.overloads[(types.float64,)] + typemap = cres.type_annotation.typemap + return_vars = {} + + for block in cres.type_annotation.blocks.values(): + for inst in block.body: + if isinstance(inst, ir.Return): + varname = inst.value.name + return_vars[varname] = typemap[varname] + + self.assertTrue(all(vt == types.float64 for vt in return_vars.values())) + + def test_issue_9162(self): + @overload_method(types.Array, "aabbcc") + def ol_aabbcc(self): + + def impl(self): + return self.sum() + + return impl + + @jit + def foo(ar): + return ar.aabbcc() + + ar = np.ones(2) + ret = foo(ar) + + overload = [value for value in foo.overloads.values()][0] + typemap = overload.type_annotation.typemap + calltypes = overload.type_annotation.calltypes + for call_op in calltypes: + name = call_op.list_vars()[0].name + fc_ty = typemap[name] + self.assertIsInstance(fc_ty, types.BoundFunction) + tmplt = fc_ty.template + info = tmplt.get_template_info(tmplt) + py_file = info["filename"] + self.assertIn("test_typeinfer.py", py_file) + + @skip_unless_load_fast_and_clear + def test_load_fast_and_clear(self): + @njit + def foo(a): + [x for x in (0,)] + if a: + # the test code cannot use a constant here due to constant + # propagation issues. + x = 3 + a + x += 10 + return x + + self.assertEqual(foo(True), foo.py_func(True)) + # Interpreted version should raise an exception + with self.assertRaises(UnboundLocalError): + foo.py_func(False) + # Compiled version returns 10 as x is zero initialized. + self.assertEqual(foo(False), 10) + + @skip_unless_load_fast_and_clear + def test_load_fast_and_clear_variant_2(self): + @njit + def foo(): + # The use of a literal False triggers different bytecode generation + # necessary for this test. See test_load_fast_and_clear_variant_4. + if False: + x = 1 + [x for x in (1,)] + # This return uses undefined variable + return x + + with self.assertRaises(errors.TypingError) as raises: + foo() + self.assertIn("return value is undefined", str(raises.exception)) + + @skip_unless_load_fast_and_clear + def test_load_fast_and_clear_variant_3(self): + @njit + def foo(): + # The use of a literal False triggers different bytecode generation + # necessary for this test. See test_load_fast_and_clear_variant_4. + if False: + x = 1 + [x for x in (1,)] + # This print uses undefined variable + print(1, 2, 3, x) + + with self.assertRaises(errors.TypingError) as raises: + foo() + self.assertIn("undefined variable used in call argument #4", str(raises.exception)) + + @skip_unless_load_fast_and_clear + def test_load_fast_and_clear_variant_4(self): + @njit + def foo(a): + # This test variant is to show that non-literal boolean value here + # produces a different behavior. + if a: + x = a + [x for x in (1,)] + return x + self.assertEqual(foo(123), 123) + self.assertEqual(foo(0), 0) + + +class TestFoldArguments(unittest.TestCase): + def check_fold_arguments_list_inputs(self, func, args, kws): + def make_tuple(*args): + return args + + unused_handler = None + + pysig = utils.pysignature(func) + names = list(pysig.parameters) + + with self.subTest(kind='dict'): + folded_dict = typing.fold_arguments( + pysig, args, kws, make_tuple, unused_handler, unused_handler, + ) + # correct ordering + for i, (j, k) in enumerate(zip(folded_dict, names)): + (got_index, got_param, got_name) = j + self.assertEqual(got_index, i) + self.assertEqual(got_name, f'arg.{k}') + + kws = list(kws.items()) + with self.subTest(kind='list'): + folded_list = typing.fold_arguments( + pysig, args, kws, make_tuple, unused_handler, unused_handler, + ) + self.assertEqual(folded_list, folded_dict) + + def test_fold_arguments_list_inputs(self): + cases = [ + dict( + func=lambda a, b, c, d: None, + args=['arg.a', 'arg.b'], + kws=dict(c='arg.c', d='arg.d') + ), + dict( + func=lambda: None, + args=[], + kws=dict(), + ), + dict( + func=lambda a: None, + args=['arg.a'], + kws={}, + ), + dict( + func=lambda a: None, + args=[], + kws=dict(a='arg.a'), + ), + ] + for case in cases: + with self.subTest(**case): + self.check_fold_arguments_list_inputs(**case) + + +@register_pass(mutates_CFG=False, analysis_only=True) +class DummyCR(FunctionPass): + """Dummy pass to add "cr" to compiler state to avoid errors in TyperCompiler since + it doesn't have lowering. + """ + + _name = "dummy_cr" + + def __init__(self): + FunctionPass.__init__(self) + + def run_pass(self, state): + state.cr = 1 # arbitrary non-None value + return True + + +class TyperCompiler(numba.core.compiler.CompilerBase): + """A compiler pipeline that skips passes after typing (provides partial typing info + but not lowering). + """ + + def define_pipelines(self): + pm = numba.core.compiler_machinery.PassManager("custom_pipeline") + pm.add_pass(TranslateByteCode, "analyzing bytecode") + pm.add_pass(IRProcessing, "processing IR") + pm.add_pass(PartialTypeInference, "do partial typing") + pm.add_pass_after(DummyCR, PartialTypeInference) + pm.finalize() + return [pm] + + +def get_func_typing_errs(func, arg_types): + """ + Get typing errors for function 'func'. It creates a pipeline that runs untyped + passes as well as type inference. + """ + typingctx = numba.core.registry.cpu_target.typing_context + targetctx = numba.core.registry.cpu_target.target_context + library = None + return_type = None + _locals = {} + flags = numba.core.compiler.Flags() + flags.nrt = True + + pipeline = TyperCompiler( + typingctx, targetctx, library, arg_types, return_type, flags, _locals + ) + pipeline.compile_extra(func) + return pipeline.state.typing_errors + + +class TestPartialTypingErrors(unittest.TestCase): + """ + Make sure partial typing stores type errors in compiler state properly + """ + def test_partial_typing_error(self): + # example with type unification error + def impl(flag): + if flag: + a = 1 + else: + a = str(1) + return a + + typing_errs = get_func_typing_errs(impl, (types.bool_,)) + self.assertTrue(isinstance(typing_errs, list) and len(typing_errs) == 1) + self.assertTrue(isinstance(typing_errs[0], errors.TypingError) and + "Cannot unify" in typing_errs[0].msg) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typenames.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typenames.py new file mode 100644 index 0000000000000000000000000000000000000000..531a8929747d8d565d71d7594904fc8229d01e0a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typenames.py @@ -0,0 +1,17 @@ +import numpy as np + +from numba.core import types +import unittest + + +class TestTypeNames(unittest.TestCase): + def test_numpy_integers(self): + expect = getattr(types, "int%d" % (np.dtype("int").itemsize * 8)) + self.assertEqual(types.int_, expect) + + expect = getattr(types, "uint%d" % (np.dtype("uint").itemsize * 8)) + self.assertEqual(types.uint, expect) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeof.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeof.py new file mode 100644 index 0000000000000000000000000000000000000000..077af16966037a3edb15f29ad91753669e32e6b9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typeof.py @@ -0,0 +1,601 @@ +""" +Tests for the typeof() machinery. +""" +import array +from collections import namedtuple +import enum +import mmap +import typing as py_typing +import random +import string + +import numpy as np + +import unittest +from numba import jit, _dispatcher +from numba.core import types +from numba.core.errors import NumbaValueError, NumbaTypeError +from numba.misc.special import typeof +from numba.core.dispatcher import OmittedArg +from numba._dispatcher import compute_fingerprint + +from numba.tests.support import TestCase, skip_unless_cffi, tag +from numba.tests.test_numpy_support import ValueTypingTestBase +from numba.tests.ctypes_usecases import * +from numba.tests.enum_usecases import * +from numba.np import numpy_support + + +recordtype = np.dtype([('a', np.float64), + ('b', np.int32), + ('c', np.complex64), + ('d', (np.str_, 5))]) + +recordtype2 = np.dtype([('e', np.int8), + ('f', np.float64)]) + +recordtype3 = np.dtype([('e', np.int8), + ('f', np.float64)], align=True) + +Point = namedtuple('Point', ('x', 'y')) + +Rect = namedtuple('Rect', ('width', 'height')) + + +class Custom(object): + + @property + def _numba_type_(self): + """ + Magic attribute expected by Numba to get the numba type that + represents this object. + """ + return types.UniTuple(types.boolean, 42) + + +class TestTypeof(ValueTypingTestBase, TestCase): + """ + Test typeof() and, implicitly, typing.Context.get_argument_type(). + """ + + def test_number_values(self): + """ + Test special.typeof() with scalar number values. + """ + self.check_number_values(typeof) + # These values mirror Dispatcher semantics + self.assertEqual(typeof(1), types.intp) + self.assertEqual(typeof(-1), types.intp) + self.assertEqual(typeof(2**40), types.int64) + self.assertEqual(typeof(2**63), types.uint64) + self.assertEqual(typeof(2**63 - 1), types.int64) + self.assertEqual(typeof(-2**63), types.int64) + + def test_datetime_values(self): + """ + Test special.typeof() with np.timedelta64 values. + """ + self.check_datetime_values(typeof) + + def test_timedelta_values(self): + """ + Test special.typeof() with np.timedelta64 values. + """ + self.check_timedelta_values(typeof) + + def test_array_values(self): + """ + Test special.typeof() with ndarray values. + """ + def check(arr, ndim, layout, mutable, aligned): + ty = typeof(arr) + self.assertIsInstance(ty, types.Array) + self.assertEqual(ty.ndim, ndim) + self.assertEqual(ty.layout, layout) + self.assertEqual(ty.mutable, mutable) + self.assertEqual(ty.aligned, aligned) + + a1 = np.arange(10) + check(a1, 1, 'C', True, True) + a2 = np.arange(10).reshape(2, 5) + check(a2, 2, 'C', True, True) + check(a2.T, 2, 'F', True, True) + a3 = (np.arange(60))[::2].reshape((2, 5, 3)) + check(a3, 3, 'A', True, True) + a4 = np.arange(1).reshape(()) + check(a4, 0, 'C', True, True) + a4.flags.writeable = False + check(a4, 0, 'C', False, True) + + # Unsupported dtype + a5 = a1.astype(a1.dtype.newbyteorder()) + with self.assertRaises(NumbaValueError) as raises: + typeof(a5) + self.assertIn("Unsupported array dtype: %s" % (a5.dtype,), + str(raises.exception)) + + # Unsupported array type (masked array) + with self.assertRaises(NumbaTypeError) as raises: + masked_arr = np.ma.MaskedArray([1]) + typeof(masked_arr) + self.assertIn(f"Unsupported array type: numpy.ma.MaskedArray", + str(raises.exception)) + + def test_structured_arrays(self): + def check(arr, dtype, ndim, layout, aligned): + ty = typeof(arr) + self.assertIsInstance(ty, types.Array) + self.assertEqual(ty.dtype, dtype) + self.assertEqual(ty.ndim, ndim) + self.assertEqual(ty.layout, layout) + self.assertEqual(ty.aligned, aligned) + + dtype = np.dtype([('m', np.int32), ('n', 'S5')]) + rec_ty = numpy_support.from_struct_dtype(dtype) + + arr = np.empty(4, dtype=dtype) + check(arr, rec_ty, 1, "C", False) + arr = np.recarray(4, dtype=dtype) + check(arr, rec_ty, 1, "C", False) + + dtype = np.dtype([('m', np.int32), ('n', 'S5')], align=True) + rec_ty = numpy_support.from_struct_dtype(dtype) + + arr = np.empty(4, dtype=dtype) + check(arr, rec_ty, 1, "C", True) + arr = np.recarray(4, dtype=dtype) + check(arr, rec_ty, 1, "C", True) + + def test_buffers(self): + b = b"xx" + ty = typeof(b) + self.assertEqual(ty, types.Bytes(types.uint8, 1, "C")) + self.assertFalse(ty.mutable) + ty = typeof(memoryview(b)) + self.assertEqual(ty, types.MemoryView(types.uint8, 1, "C", + readonly=True)) + self.assertFalse(ty.mutable) + ty = typeof(array.array('i', [0, 1, 2])) + self.assertEqual(ty, types.PyArray(types.int32, 1, "C")) + self.assertTrue(ty.mutable) + + b = bytearray(10) + ty = typeof(b) + self.assertEqual(ty, types.ByteArray(types.uint8, 1, "C")) + self.assertTrue(ty.mutable) + + def test_none(self): + ty = typeof(None) + self.assertEqual(ty, types.none) + + def test_ellipsis(self): + ty = typeof(Ellipsis) + self.assertEqual(ty, types.ellipsis) + + def test_str(self): + ty = typeof("abc") + self.assertEqual(ty, types.string) + + def test_slices(self): + for args in [(1,), (1, 2), (1, 2, 1), (1, 2, None)]: + v = slice(*args) + self.assertIs(typeof(v), types.slice2_type) + for args in [(1, 2, 2), (1, 2, -1), (None, None, -2)]: + v = slice(*args) + self.assertIs(typeof(v), types.slice3_type) + + def test_tuples(self): + v = (1, 2) + self.assertEqual(typeof(v), types.UniTuple(types.intp, 2)) + v = (1, (2.0, 3)) + self.assertEqual(typeof(v), + types.Tuple((types.intp, + types.Tuple((types.float64, types.intp)))) + ) + + def test_lists(self): + v = [1.0] * 100 + self.assertEqual(typeof(v), types.List(types.float64, reflected=True)) + + bad_v = [{1: 3}] + with self.assertRaises(ValueError) as raises: + typeof(bad_v) + self.assertIn("Cannot type list element type", str(raises.exception)) + + def test_sets(self): + v = set([1.0, 2.0, 3.0]) + self.assertEqual(typeof(v), types.Set(types.float64, reflected=True)) + v = frozenset(v) + with self.assertRaises(ValueError) as raises: + typeof(v) + self.assertIn("Cannot determine Numba type of", str(raises.exception)) + + def test_namedtuple(self): + v = Point(1, 2) + tp_point = typeof(v) + self.assertEqual(tp_point, + types.NamedUniTuple(types.intp, 2, Point)) + v = Point(1, 2.0) + self.assertEqual(typeof(v), + types.NamedTuple([types.intp, types.float64], Point)) + w = Rect(3, 4) + tp_rect = typeof(w) + self.assertEqual(tp_rect, + types.NamedUniTuple(types.intp, 2, Rect)) + self.assertNotEqual(tp_rect, tp_point) + self.assertNotEqual(tp_rect, types.UniTuple(tp_rect.dtype, tp_rect.count)) + + def test_enum(self): + tp_red = typeof(Color.red) + self.assertEqual(tp_red, types.EnumMember(Color, types.intp)) + self.assertEqual(tp_red, typeof(Color.blue)) + tp_choc = typeof(Shake.chocolate) + self.assertEqual(tp_choc, types.EnumMember(Shake, types.intp)) + self.assertEqual(tp_choc, typeof(Shake.mint)) + self.assertNotEqual(tp_choc, tp_red) + tp_404 = typeof(RequestError.not_found) + self.assertEqual(tp_404, types.IntEnumMember(RequestError, types.intp)) + self.assertEqual(tp_404, typeof(RequestError.internal_error)) + + with self.assertRaises(ValueError) as raises: + typeof(HeterogeneousEnum.red) + self.assertEqual(str(raises.exception), + "Cannot type heterogeneous enum: got value types complex128, float64") + + def test_enum_class(self): + tp_color = typeof(Color) + self.assertEqual(tp_color, types.EnumClass(Color, types.intp)) + tp_shake = typeof(Shake) + self.assertEqual(tp_shake, types.EnumClass(Shake, types.intp)) + self.assertNotEqual(tp_shake, tp_color) + tp_shape = typeof(Shape) + self.assertEqual(tp_shape, types.IntEnumClass(Shape, types.intp)) + tp_error = typeof(RequestError) + self.assertEqual(tp_error, + types.IntEnumClass(RequestError, types.intp)) + self.assertNotEqual(tp_error, tp_shape) + + with self.assertRaises(ValueError) as raises: + typeof(HeterogeneousEnum) + self.assertEqual(str(raises.exception), + "Cannot type heterogeneous enum: got value types complex128, float64") + + def test_dtype(self): + dtype = np.dtype('int64') + self.assertEqual(typeof(dtype), types.DType(types.int64)) + + dtype = np.dtype([('m', np.int32), ('n', 'S5')]) + rec_ty = numpy_support.from_struct_dtype(dtype) + self.assertEqual(typeof(dtype), types.DType(rec_ty)) + + def test_dtype_values(self): + self.assertEqual(typeof(np.int64), types.NumberClass(types.int64)) + self.assertEqual(typeof(np.float64), types.NumberClass(types.float64)) + self.assertEqual(typeof(np.int32), types.NumberClass(types.int32)) + self.assertEqual(typeof(np.int8), types.NumberClass(types.int8)) + + def test_ctypes(self): + ty_cos = typeof(c_cos) + ty_sin = typeof(c_sin) + self.assertIsInstance(ty_cos, types.ExternalFunctionPointer) + self.assertEqual(ty_cos.sig.args, (types.float64,)) + self.assertEqual(ty_cos.sig.return_type, types.float64) + self.assertEqual(ty_cos, ty_sin) + self.assertNotEqual(ty_cos.get_pointer(c_cos), + ty_sin.get_pointer(c_sin)) + + @skip_unless_cffi + def test_cffi(self): + from numba.tests import cffi_usecases as mod + mod.init() + ty_cffi_cos = typeof(mod.cffi_cos) + ty_cffi_sin = typeof(mod.cffi_sin) + ty_cffi_boolean = typeof(mod.cffi_bool) + self.assertIsInstance(ty_cffi_cos, types.ExternalFunctionPointer) + self.assertEqual(ty_cffi_boolean.sig.return_type, types.boolean) + self.assertEqual(ty_cffi_cos.sig.args, (types.float64,)) + self.assertEqual(ty_cffi_cos.sig.return_type, types.float64) + self.assertEqual(ty_cffi_cos, ty_cffi_sin) + ty_ctypes_cos = typeof(c_cos) + self.assertNotEqual(ty_cffi_cos, ty_ctypes_cos) + self.assertNotEqual(ty_cffi_cos.get_pointer(mod.cffi_cos), + ty_cffi_sin.get_pointer(mod.cffi_sin)) + self.assertEqual(ty_cffi_cos.get_pointer(mod.cffi_cos), + ty_ctypes_cos.get_pointer(c_cos)) + + def test_custom(self): + ty = typeof(Custom()) + self.assertEqual(ty, types.UniTuple(types.boolean, 42)) + + def test_omitted_args(self): + ty0 = typeof(OmittedArg(0.0)) + ty1 = typeof(OmittedArg(1)) + ty2 = typeof(OmittedArg(1.0)) + ty3 = typeof(OmittedArg(1.0)) + self.assertEqual(ty0, types.Omitted(0.0)) + self.assertEqual(ty1, types.Omitted(1)) + self.assertEqual(ty2, types.Omitted(1.0)) + self.assertEqual(len({ty0, ty1, ty2}), 3) + self.assertEqual(ty3, ty2) + + def test_np_random(self): + rng = np.random.default_rng() + ty_rng = typeof(rng) + ty_bitgen = typeof(rng.bit_generator) + + self.assertEqual(ty_rng, types.npy_rng) + self.assertEqual(ty_bitgen, types.npy_bitgen) + + +class DistinctChecker(object): + + def __init__(self): + self._distinct = set() + + def add(self, obj): + if obj in self._distinct: + raise AssertionError("%r already in %r" % (obj, self._distinct)) + self._distinct.add(obj) + + +class TestFingerprint(TestCase): + """ + Tests for _dispatcher.compute_fingerprint() + + Each fingerprint must denote values of only one Numba type (this is + the condition for correctness), but values of a Numba type may be + denoted by several distinct fingerprints (it only makes the cache + less efficient). + """ + + def test_floats(self): + s = compute_fingerprint(1.0) + self.assertEqual(compute_fingerprint(2.0), s) + s = compute_fingerprint(np.float32()) + self.assertEqual(compute_fingerprint(np.float32(2.0)), s) + self.assertNotEqual(compute_fingerprint(np.float64()), s) + + def test_ints(self): + s = compute_fingerprint(1) + for v in (-1, 2**60): + self.assertEqual(compute_fingerprint(v), s) + # Different int widths resolve to different fingerprints + distinct = set() + for tp in ('int8', 'int16', 'int32', 'int64', + 'uint8', 'uint16', 'uint32', 'uint64'): + tp = getattr(np, tp) + distinct.add(compute_fingerprint(tp())) + self.assertEqual(len(distinct), 8, distinct) + + def test_bool(self): + s = compute_fingerprint(True) + self.assertEqual(compute_fingerprint(False), s) + self.assertNotEqual(compute_fingerprint(1), s) + + def test_complex(self): + s = compute_fingerprint(1j) + self.assertEqual(s, compute_fingerprint(1+0j)) + s = compute_fingerprint(np.complex64()) + self.assertEqual(compute_fingerprint(np.complex64(2.0)), s) + self.assertNotEqual(compute_fingerprint(np.complex128()), s) + + def test_none(self): + compute_fingerprint(None) + + def test_enums(self): + # Enums should fail fingerprinting, even IntEnums + with self.assertRaises(NotImplementedError): + compute_fingerprint(Color.red) + with self.assertRaises(NotImplementedError): + compute_fingerprint(RequestError.not_found) + + def test_records(self): + d1 = np.dtype([('m', np.int32), ('n', np.int64)]) + d2 = np.dtype([('m', np.int32), ('n', np.int16)]) + v1 = np.empty(1, dtype=d1)[0] + v2 = np.empty(1, dtype=d2)[0] + self.assertNotEqual(compute_fingerprint(v1), + compute_fingerprint(v2)) + + def test_datetime(self): + a = np.datetime64(1, 'Y') + b = np.datetime64(2, 'Y') + c = np.datetime64(2, 's') + d = np.timedelta64(2, 's') + self.assertEqual(compute_fingerprint(a), + compute_fingerprint(b)) + distinct = set(compute_fingerprint(x) for x in (a, c, d)) + self.assertEqual(len(distinct), 3, distinct) + + def test_arrays(self): + distinct = DistinctChecker() + + # 1D + arr = np.empty(4, dtype=np.float64) + s = compute_fingerprint(arr) + distinct.add(s) + self.assertEqual(compute_fingerprint(arr[:1]), s) + # Non-contiguous + distinct.add(compute_fingerprint(arr[::2])) + # Other type + distinct.add(compute_fingerprint(arr.astype(np.complex64))) + # Readonly + arr.setflags(write=False) + distinct.add(compute_fingerprint(arr)) + + # 2D + arr = np.empty((4, 4), dtype=np.float64) + distinct.add(compute_fingerprint(arr)) + # F-contiguous + distinct.add(compute_fingerprint(arr.T)) + # Non-contiguous + distinct.add(compute_fingerprint(arr[::2])) + + # 0D + arr = np.empty((), dtype=np.float64) + distinct.add(compute_fingerprint(arr)) + + # Structured arrays + arr = np.empty(5, dtype=recordtype) + s = compute_fingerprint(arr) + distinct.add(s) + self.assertEqual(compute_fingerprint(arr[:1]), s) + arr = np.empty(5, dtype=recordtype2) + distinct.add(compute_fingerprint(arr)) + arr = np.empty(5, dtype=recordtype3) + distinct.add(compute_fingerprint(arr)) + + # np.recarray() is peculiar: it creates a new dtype instance in + # its constructor; check that the fingerprint remains efficient + a = np.recarray(1, dtype=recordtype) + b = np.recarray(1, dtype=recordtype) + self.assertEqual(compute_fingerprint(a), + compute_fingerprint(b)) + + def test_buffers(self): + distinct = DistinctChecker() + + s = compute_fingerprint(b'') + self.assertEqual(compute_fingerprint(b'xx'), s) + distinct.add(s) + distinct.add(compute_fingerprint(bytearray())) + distinct.add(compute_fingerprint(memoryview(b''))) + m_uint8_1d = compute_fingerprint(memoryview(bytearray())) + distinct.add(m_uint8_1d) + + arr = array.array('B', [42]) + distinct.add(compute_fingerprint(arr)) + self.assertEqual(compute_fingerprint(memoryview(arr)), m_uint8_1d) + for array_code in 'bi': + arr = array.array(array_code, [0, 1, 2]) + distinct.add(compute_fingerprint(arr)) + distinct.add(compute_fingerprint(memoryview(arr))) + + arr = np.empty(16, dtype=np.uint8) + distinct.add(compute_fingerprint(arr)) + self.assertEqual(compute_fingerprint(memoryview(arr)), m_uint8_1d) + arr = arr.reshape((4, 4)) + distinct.add(compute_fingerprint(arr)) + distinct.add(compute_fingerprint(memoryview(arr))) + arr = arr.T + distinct.add(compute_fingerprint(arr)) + distinct.add(compute_fingerprint(memoryview(arr))) + arr = arr[::2] + distinct.add(compute_fingerprint(arr)) + distinct.add(compute_fingerprint(memoryview(arr))) + + m = mmap.mmap(-1, 16384) + distinct.add(compute_fingerprint(m)) + self.assertEqual(compute_fingerprint(memoryview(m)), m_uint8_1d) + + def test_dtype(self): + distinct = DistinctChecker() + + s = compute_fingerprint(np.dtype('int64')) + self.assertEqual(compute_fingerprint(np.dtype('int64')), s) + distinct.add(s) + + for descr in ('int32', 'm8[s]', 'm8[W]', 'M8[s]'): + distinct.add(np.dtype(descr)) + + distinct.add(recordtype) + distinct.add(recordtype2) + + # np.recarray() is peculiar: it creates a new dtype instance in + # its constructor; check that the fingerprint remains efficient + a = np.recarray(1, dtype=recordtype) + b = np.recarray(1, dtype=recordtype) + self.assertEqual(compute_fingerprint(a.dtype), + compute_fingerprint(b.dtype)) + + def test_tuples(self): + distinct = DistinctChecker() + + s = compute_fingerprint((1,)) + self.assertEqual(compute_fingerprint((2,)), s) + distinct.add(s) + + distinct.add(compute_fingerprint(())) + distinct.add(compute_fingerprint((1, 2, 3))) + distinct.add(compute_fingerprint((1j, 2, 3))) + distinct.add(compute_fingerprint((1, (), np.empty(5)))) + distinct.add(compute_fingerprint((1, (), np.empty((5, 1))))) + + def test_lists(self): + distinct = DistinctChecker() + + s = compute_fingerprint([1]) + self.assertEqual(compute_fingerprint([2, 3]), s) + distinct.add(s) + + distinct.add(compute_fingerprint([1j])) + distinct.add(compute_fingerprint([4.5, 6.7])) + distinct.add(compute_fingerprint([(1,)])) + + with self.assertRaises(ValueError): + compute_fingerprint([]) + + def test_sets(self): + distinct = DistinctChecker() + + s = compute_fingerprint(set([1])) + self.assertEqual(compute_fingerprint(set([2, 3])), s) + distinct.add(s) + + distinct.add(compute_fingerprint([1])) + distinct.add(compute_fingerprint(set([1j]))) + distinct.add(compute_fingerprint(set([4.5, 6.7]))) + distinct.add(compute_fingerprint(set([(1,)]))) + + with self.assertRaises(ValueError): + compute_fingerprint(set()) + with self.assertRaises(NotImplementedError): + compute_fingerprint(frozenset([2, 3])) + + def test_omitted_args(self): + distinct = DistinctChecker() + + v0 = OmittedArg(0.0) + v1 = OmittedArg(1.0) + v2 = OmittedArg(1) + + s = compute_fingerprint(v0) + self.assertEqual(compute_fingerprint(v1), s) + distinct.add(s) + distinct.add(compute_fingerprint(v2)) + distinct.add(compute_fingerprint(0.0)) + distinct.add(compute_fingerprint(1)) + + def test_complicated_type(self): + # Generating a large fingerprint + t = None + for i in range(1000): + t = (t,) + s = compute_fingerprint(t) + + +class TestTypeOfMemCpy(TestCase): + + def test_memcpy_typeof_buffer(self): + # https://github.com/numba/numba/issues/9097 + # bug is fixed if the code below compiles + random.seed(0) + chars = string.ascii_letters + n = 256 + field = "".join([chars[random.randint(0, len(chars) - 1)] for x in range(n)]) + for i in range(1, n): + lfield = field[:i] + nt_ty = namedtuple("tuplename", lfield) + nt = nt_ty(1) + fp = _dispatcher.compute_fingerprint(nt) + nt_name = nt.__class__.__name__ + expected = f"{nt_name}({lfield}i)" + self.assertEqual( + expected, + fp.decode(), + f"iteration {i} failed, {expected} != {fp.decode()}" + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_types.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_types.py new file mode 100644 index 0000000000000000000000000000000000000000..ce05fab65a4992a87cfd4b39a6e360b04a150a2c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_types.py @@ -0,0 +1,879 @@ +""" +Tests for numba.types. +""" + + +from collections import namedtuple +import gc +import os +import operator +import sys +import weakref + +import numpy as np + +from numba.core import types, typing, errors, sigutils +from numba.core.types.abstract import _typecache +from numba.core.types.functions import _header_lead +from numba.core.typing.templates import make_overload_template +from numba import jit, njit, typeof +from numba.core.extending import (overload, register_model, models, unbox, + NativeValue, typeof_impl) +from numba.tests.support import TestCase, create_temp_module +from numba.tests.enum_usecases import Color, Shake, Shape +import unittest +from numba.np import numpy_support + + +try: + import cPickle as pickle +except ImportError: + import pickle + + +Point = namedtuple('Point', ('x', 'y')) + +Rect = namedtuple('Rect', ('width', 'height')) + + +def gen(x): + yield x + 1 + + +class Dummy(object): + pass + + +class TestTypes(TestCase): + + def test_equality(self): + self.assertEqual(types.int32, types.int32) + self.assertEqual(types.uint32, types.uint32) + self.assertEqual(types.complex64, types.complex64) + self.assertEqual(types.float32, types.float32) + # Different signedness + self.assertNotEqual(types.int32, types.uint32) + # Different width + self.assertNotEqual(types.int64, types.int32) + self.assertNotEqual(types.float64, types.float32) + self.assertNotEqual(types.complex64, types.complex128) + # Different domain + self.assertNotEqual(types.int64, types.float64) + self.assertNotEqual(types.uint64, types.float64) + self.assertNotEqual(types.complex64, types.float64) + # Same arguments but different return types + get_pointer = None + sig_a = typing.signature(types.intp, types.intp) + sig_b = typing.signature(types.voidptr, types.intp) + a = types.ExternalFunctionPointer(sig=sig_a, get_pointer=get_pointer) + b = types.ExternalFunctionPointer(sig=sig_b, get_pointer=get_pointer) + self.assertNotEqual(a, b) + # Different call convention + a = types.ExternalFunctionPointer(sig=sig_a, get_pointer=get_pointer) + b = types.ExternalFunctionPointer(sig=sig_a, get_pointer=get_pointer, + cconv='stdcall') + self.assertNotEqual(a, b) + # Different get_pointer + a = types.ExternalFunctionPointer(sig=sig_a, get_pointer=get_pointer) + b = types.ExternalFunctionPointer(sig=sig_a, get_pointer=object()) + self.assertNotEqual(a, b) + + # Different template classes bearing the same name + class DummyTemplate(object): + key = "foo" + a = types.BoundFunction(DummyTemplate, types.int32) + + class DummyTemplate(object): + key = "bar" + b = types.BoundFunction(DummyTemplate, types.int32) + self.assertNotEqual(a, b) + + # Different dtypes + self.assertNotEqual(types.DType(types.int32), types.DType(types.int64)) + + # CPointer with same addrspace + self.assertEqual(types.CPointer(types.float32), + types.CPointer(types.float32)) + + # CPointer with different addrspace + self.assertNotEqual(types.CPointer(types.float32, 0), + types.CPointer(types.float32, 1)) + + def test_weaktype(self): + d = Dummy() + e = Dummy() + a = types.Dispatcher(d) + b = types.Dispatcher(d) + c = types.Dispatcher(e) + self.assertIs(a.dispatcher, d) + self.assertIs(b.dispatcher, d) + self.assertIs(c.dispatcher, e) + # Equality of alive references + self.assertTrue(a == b) + self.assertFalse(a != b) + self.assertTrue(a != c) + self.assertFalse(a == c) + z = types.int8 + self.assertFalse(a == z) + self.assertFalse(b == z) + self.assertFalse(c == z) + self.assertTrue(a != z) + self.assertTrue(b != z) + self.assertTrue(c != z) + # Hashing and mappings + s = set([a, b, c]) + self.assertEqual(len(s), 2) + self.assertIn(a, s) + self.assertIn(b, s) + self.assertIn(c, s) + # Kill the references + d = e = None + gc.collect() + with self.assertRaises(ReferenceError): + a.dispatcher + with self.assertRaises(ReferenceError): + b.dispatcher + with self.assertRaises(ReferenceError): + c.dispatcher + # Dead references are always unequal + self.assertFalse(a == b) + self.assertFalse(a == c) + self.assertFalse(b == c) + self.assertFalse(a == z) + self.assertTrue(a != b) + self.assertTrue(a != c) + self.assertTrue(b != c) + self.assertTrue(a != z) + + def test_interning(self): + # Test interning and lifetime of dynamic types. + a = types.Dummy('xyzzyx') + code = a._code + b = types.Dummy('xyzzyx') + self.assertIs(b, a) + wr = weakref.ref(a) + del a + gc.collect() + c = types.Dummy('xyzzyx') + self.assertIs(c, b) + # The code is always the same + self.assertEqual(c._code, code) + del b, c + gc.collect() + self.assertIs(wr(), None) + d = types.Dummy('xyzzyx') + # The original code wasn't reused. + self.assertNotEqual(d._code, code) + + def test_cache_trimming(self): + # Test that the cache doesn't grow in size when types are + # created and disposed of. + cache = _typecache + gc.collect() + # Keep strong references to existing types, to avoid spurious failures + existing_types = [wr() for wr in cache] # noqa: F841 + cache_len = len(cache) + a = types.Dummy('xyzzyx') + b = types.Dummy('foox') + self.assertEqual(len(cache), cache_len + 2) + del a, b + gc.collect() + self.assertEqual(len(cache), cache_len) + + def test_array_notation(self): + def check(arrty, scalar, ndim, layout): + self.assertIs(arrty.dtype, scalar) + self.assertEqual(arrty.ndim, ndim) + self.assertEqual(arrty.layout, layout) + + def check_index_error(callable): + with self.assertRaises(KeyError) as raises: + callable() + self.assertIn( + "Can only index numba types with slices with no start or " + "stop, got", str(raises.exception)) + + scalar = types.int32 + check(scalar[:], scalar, 1, 'A') + check(scalar[::1], scalar, 1, 'C') + check(scalar[:, :], scalar, 2, 'A') + check(scalar[:, ::1], scalar, 2, 'C') + check(scalar[::1, :], scalar, 2, 'F') + + check_index_error(lambda: scalar[0]) + check_index_error(lambda: scalar[:, 4]) + check_index_error(lambda: scalar[::1, 1:]) + check_index_error(lambda: scalar[:2]) + check_index_error(lambda: list(scalar)) + + def test_array_notation_for_dtype(self): + def check(arrty, scalar, ndim, layout): + self.assertIs(arrty.dtype, scalar) + self.assertEqual(arrty.ndim, ndim) + self.assertEqual(arrty.layout, layout) + scalar = types.int32 + dtyped = types.DType(scalar) + check(dtyped[:], scalar, 1, 'A') + check(dtyped[::1], scalar, 1, 'C') + check(dtyped[:, :], scalar, 2, 'A') + check(dtyped[:, ::1], scalar, 2, 'C') + check(dtyped[::1, :], scalar, 2, 'F') + + def test_call_notation(self): + # Function call signature + i = types.int32 + d = types.double + self.assertEqual(i(), typing.signature(i)) + self.assertEqual(i(d), typing.signature(i, d)) + self.assertEqual(i(d, d), typing.signature(i, d, d)) + # Value cast + self.assertPreciseEqual(i(42.5), 42) + self.assertPreciseEqual(d(-5), -5.0) + ty = types.NPDatetime('Y') + self.assertPreciseEqual(ty('1900'), np.datetime64('1900', 'Y')) + self.assertPreciseEqual(ty('NaT'), np.datetime64('NaT', 'Y')) + ty = types.NPTimedelta('s') + self.assertPreciseEqual(ty(5), np.timedelta64(5, 's')) + self.assertPreciseEqual(ty('NaT'), np.timedelta64('NaT', 's')) + ty = types.NPTimedelta('') + self.assertPreciseEqual(ty(5), np.timedelta64(5)) + self.assertPreciseEqual(ty('NaT'), np.timedelta64('NaT')) + + def test_list_type_getitem(self): + for listty in (types.int64, types.Array(types.float64, 1, 'C')): + l_int = types.List(listty) + self.assertTrue(isinstance(l_int, types.List)) + self.assertTrue(isinstance(l_int[0], type(listty))) + + def test_function_incompatible_templates(self): + # issue 4345 + def func_stub(): + pass + + def func_stub2(): + pass + + def ol(): + pass + + template1 = make_overload_template(func_stub, ol, {}, True, 'never') + template2 = make_overload_template(func_stub2, ol, {}, True, 'never') + + with self.assertRaises(ValueError) as raises: + types.Function((template1, template2)) + self.assertIn("incompatible templates:", str(raises.exception)) + + +class TestNumbers(TestCase): + """ + Tests for number types. + """ + + def test_bitwidth(self): + """ + All numeric types have bitwidth attribute + """ + for ty in types.number_domain: + self.assertTrue(hasattr(ty, "bitwidth")) + + def test_minval_maxval(self): + self.assertEqual(types.int8.maxval, 127) + self.assertEqual(types.int8.minval, -128) + self.assertEqual(types.uint8.maxval, 255) + self.assertEqual(types.uint8.minval, 0) + self.assertEqual(types.int64.maxval, (1 << 63) - 1) + self.assertEqual(types.int64.minval, -(1 << 63)) + self.assertEqual(types.uint64.maxval, (1 << 64) - 1) + self.assertEqual(types.uint64.minval, 0) + + def test_from_bidwidth(self): + f = types.Integer.from_bitwidth + self.assertIs(f(32), types.int32) + self.assertIs(f(8, signed=False), types.uint8) + + def test_ordering(self): + def check_order(values): + for i in range(len(values)): + self.assertLessEqual(values[i], values[i]) + self.assertGreaterEqual(values[i], values[i]) + self.assertFalse(values[i] < values[i]) + self.assertFalse(values[i] > values[i]) + for j in range(i): + self.assertLess(values[j], values[i]) + self.assertLessEqual(values[j], values[i]) + self.assertGreater(values[i], values[j]) + self.assertGreaterEqual(values[i], values[j]) + self.assertFalse(values[i] < values[j]) + self.assertFalse(values[i] <= values[j]) + self.assertFalse(values[j] > values[i]) + self.assertFalse(values[j] >= values[i]) + + check_order([types.int8, types.int16, types.int32, types.int64]) + check_order([types.uint8, types.uint16, types.uint32, types.uint64]) + check_order([types.float32, types.float64]) + check_order([types.complex64, types.complex128]) + + with self.assertRaises(TypeError): + types.int8 <= types.uint32 + with self.assertRaises(TypeError): + types.int8 <= types.float32 + with self.assertRaises(TypeError): + types.float64 <= types.complex128 + + +class TestNdIter(TestCase): + + def test_properties(self): + def check(ty, dtypes, ndim, layout, indexers=None): + self.assertEqual(ty.ndim, ndim) + self.assertEqual(ty.layout, layout) + self.assertEqual(ty.dtypes, dtypes) + views = [types.Array(dtype, 0, "C") for dtype in dtypes] + if len(views) > 1: + self.assertEqual( + ty.yield_type, + types.BaseTuple.from_types(views)) + else: + self.assertEqual(ty.yield_type, views[0]) + if indexers is not None: + self.assertEqual(ty.indexers, indexers) + + f32 = types.float32 + c64 = types.complex64 + i16 = types.int16 + a = types.Array(f32, 1, "C") + b = types.Array(f32, 2, "C") + c = types.Array(c64, 2, "F") + d = types.Array(i16, 2, "A") + e = types.Array(i16, 0, "C") + f = types.Array(f32, 1, "A") + g = types.Array(f32, 0, "C") + + # 0-dim iterator + ty = types.NumpyNdIterType((e,)) + check(ty, (i16,), 0, "C", [('0d', 0, 0, [0])]) + self.assertFalse(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((e, g)) + check(ty, (i16, f32), 0, "C", [('0d', 0, 0, [0, 1])]) + self.assertFalse(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((e, c64)) + check(ty, (i16, c64), 0, "C", + [('0d', 0, 0, [0]), ('scalar', 0, 0, [1])]) + self.assertFalse(ty.need_shaped_indexing) + + # 1-dim iterator + ty = types.NumpyNdIterType((a,)) + check(ty, (f32,), 1, "C", + [('flat', 0, 1, [0])]) + self.assertFalse(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((a, a)) + check(ty, (f32, f32), 1, "C", + [('flat', 0, 1, [0, 1])]) + self.assertFalse(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((a, e, e, c64)) + check(ty, (f32, i16, i16, c64), 1, "C", + [('flat', 0, 1, [0]), # a + ('0d', 0, 0, [1, 2]), # e, e + ('scalar', 0, 0, [3]), # c64 + ]) + self.assertFalse(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((a, f)) + check(ty, (f32, f32), 1, "C", + [('flat', 0, 1, [0]), ('indexed', 0, 1, [1])]) + self.assertTrue(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((f,)) + check(ty, (f32,), 1, "C", [('indexed', 0, 1, [0])]) + self.assertTrue(ty.need_shaped_indexing) + + # 2-dim C-order iterator + ty = types.NumpyNdIterType((b,)) + check(ty, (f32,), 2, "C", [('flat', 0, 2, [0])]) + self.assertFalse(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((b, c)) + check( + ty, (f32, c64), 2, "C", [ + ('flat', 0, 2, [0]), ('indexed', 0, 2, [1])]) + self.assertTrue(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((d,)) + check(ty, (i16,), 2, "C", [('indexed', 0, 2, [0])]) + self.assertTrue(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((b, c, d, d, e)) + check(ty, (f32, c64, i16, i16, i16), 2, "C", + [('flat', 0, 2, [0]), # b + ('indexed', 0, 2, [1, 2, 3]), # c, d, d + ('0d', 0, 0, [4]), # e + ]) + self.assertTrue(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((a, b, c, d, d, f)) + check(ty, (f32, f32, c64, i16, i16, f32), 2, "C", + [('flat', 1, 2, [0]), # a + ('flat', 0, 2, [1]), # b + ('indexed', 0, 2, [2, 3, 4]), # c, d, d + ('indexed', 1, 2, [5]), # f + ]) + self.assertTrue(ty.need_shaped_indexing) + + # 2-dim F-order iterator + ty = types.NumpyNdIterType((c,)) + check(ty, (c64,), 2, "F", [('flat', 0, 2, [0])]) + self.assertFalse(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((c, b, c, f)) + check(ty, (c64, f32, c64, f32), 2, "F", + [('flat', 0, 2, [0, 2]), # c, c + ('indexed', 0, 2, [1]), # b + ('indexed', 0, 1, [3]), # f + ]) + self.assertTrue(ty.need_shaped_indexing) + ty = types.NumpyNdIterType((b, c, c, d, d, a, e)) + check(ty, (f32, c64, c64, i16, i16, f32, i16), 2, "F", + [('indexed', 0, 2, [0, 3, 4]), # b, d, d + ('flat', 0, 2, [1, 2]), # c, c + ('flat', 0, 1, [5]), # a + ('0d', 0, 0, [6]), # e + ]) + self.assertTrue(ty.need_shaped_indexing) + + +class TestPickling(TestCase): + """ + Pickling and unpickling should preserve type identity (singleton-ness) + and the _code attribute. This is only a requirement for types that + can be part of function signatures. + """ + + def predefined_types(self): + """ + Yield all predefined type instances + """ + for ty in types.__dict__.values(): + if isinstance(ty, types.Type): + yield ty + + def check_pickling(self, orig): + pickled = pickle.dumps(orig, protocol=-1) + ty = pickle.loads(pickled) + self.assertIs(ty, orig) + self.assertGreaterEqual(ty._code, 0) + + def test_predefined_types(self): + tys = list(self.predefined_types()) + self.assertIn(types.int16, tys) + for ty in tys: + self.check_pickling(ty) + + def test_atomic_types(self): + for unit in ('M', 'ms'): + ty = types.NPDatetime(unit) + self.check_pickling(ty) + ty = types.NPTimedelta(unit) + self.check_pickling(ty) + + def test_arrays(self): + for ndim in (0, 1, 2): + for layout in ('A', 'C', 'F'): + ty = types.Array(types.int16, ndim, layout) + self.check_pickling(ty) + + def test_records(self): + recordtype = np.dtype([('a', np.float64), + ('b', np.int32), + ('c', np.complex64), + ('d', (np.str_, 5))]) + ty = numpy_support.from_dtype(recordtype) + self.check_pickling(ty) + self.check_pickling(types.Array(ty, 1, 'A')) + + def test_optional(self): + ty = types.Optional(types.int32) + self.check_pickling(ty) + + def test_tuples(self): + ty1 = types.UniTuple(types.int32, 3) + self.check_pickling(ty1) + ty2 = types.Tuple((types.int32, ty1)) + self.check_pickling(ty2) + + def test_namedtuples(self): + ty1 = types.NamedUniTuple(types.intp, 2, Point) + self.check_pickling(ty1) + ty2 = types.NamedTuple((types.intp, types.float64), Point) + self.check_pickling(ty2) + + def test_enums(self): + ty1 = types.EnumMember(Color, types.int32) + self.check_pickling(ty1) + ty2 = types.EnumMember(Shake, types.int64) + self.check_pickling(ty2) + ty3 = types.IntEnumMember(Shape, types.int64) + self.check_pickling(ty3) + + def test_lists(self): + ty = types.List(types.int32) + self.check_pickling(ty) + + def test_generator(self): + cfunc = jit("(int32,)", nopython=True)(gen) + sigs = list(cfunc.nopython_signatures) + ty = sigs[0].return_type + self.assertIsInstance(ty, types.Generator) + self.check_pickling(ty) + + # call templates are not picklable + @unittest.expectedFailure + def test_external_function_pointers(self): + from numba.core.typing import ctypes_utils + from numba.tests.ctypes_usecases import c_sin, c_cos + for fnptr in (c_sin, c_cos): + ty = ctypes_utils.make_function_type(fnptr) + self.assertIsInstance(ty, types.ExternalFunctionPointer) + self.check_pickling(ty) + + +class TestSignatures(TestCase): + + def test_normalize_signature(self): + f = sigutils.normalize_signature + + def check(sig, args, return_type): + self.assertEqual(f(sig), (args, return_type)) + + def check_error(sig, msg): + with self.assertRaises(TypeError) as raises: + f(sig) + self.assertIn(msg, str(raises.exception)) + + f32 = types.float32 + c64 = types.complex64 + i16 = types.int16 + a = types.Array(f32, 1, "C") + + check((c64,), (c64,), None) + check((f32, i16), (f32, i16), None) + check(a(i16), (i16,), a) + check("int16(complex64)", (c64,), i16) + check("(complex64, int16)", (c64, i16), None) + check(typing.signature(i16, c64), (c64,), i16) + + msg = "invalid type in signature: expected a type instance" + check_error((types.Integer,), msg) + check_error((None,), msg) + check_error([], "invalid signature") + + +class TestRecordDtype(unittest.TestCase): + def test_record_type_equiv(self): + rec_dt = np.dtype([('a', np.int32), ('b', np.float32)]) + rec_ty = typeof(rec_dt) + art1 = rec_ty[::1] + arr = np.zeros(5, dtype=rec_dt) + art2 = typeof(arr) + self.assertEqual(art2.dtype.dtype, rec_ty) + self.assertEqual(art1, art2) + + def test_user_specified(self): + rec_dt = np.dtype([('a', np.int32), ('b', np.float32)]) + rec_type = typeof(rec_dt) + + @jit((rec_type[:],), nopython=True) + def foo(x): + return x['a'], x['b'] + + arr = np.zeros(1, dtype=rec_dt) + arr[0]['a'] = 123 + arr[0]['b'] = 32.1 + + a, b = foo(arr) + + self.assertEqual(a, arr[0]['a']) + self.assertEqual(b, arr[0]['b']) + + +class TestDType(TestCase): + def test_type_attr(self): + # Test .type attribute of dtype + def conv(arr, val): + return arr.dtype.type(val) + + jit_conv = jit(nopython=True)(conv) + + def assert_matches(arr, val, exact): + expect = conv(arr, val) + got = jit_conv(arr, val) + self.assertPreciseEqual(expect, exact) + self.assertPreciseEqual(typeof(expect), typeof(got)) + self.assertPreciseEqual(expect, got) + + arr = np.zeros(5) + assert_matches(arr.astype(np.intp), 1.2, 1) + assert_matches(arr.astype(np.float64), 1.2, 1.2) + assert_matches(arr.astype(np.complex128), 1.2, (1.2 + 0j)) + assert_matches(arr.astype(np.complex128), 1.2j, 1.2j) + + def test_kind(self): + def tkind(A): + return A.dtype.kind == 'f' + jit_tkind = jit(nopython=True)(tkind) + self.assertEqual(tkind(np.ones(3)), jit_tkind(np.ones(3))) + self.assertEqual(tkind(np.ones(3, dtype=np.intp)), + jit_tkind(np.ones(3, dtype=np.intp))) + + def test_dtype_with_type(self): + def impl(): + a = np.dtype(np.float64) + return a.type(0) + jit_impl = jit(nopython=True)(impl) + self.assertEqual(impl(), jit_impl()) + + def test_dtype_with_string(self): + def impl(): + a = np.dtype('float64') + return a.type(0) + jit_impl = jit(nopython=True)(impl) + self.assertEqual(impl(), jit_impl()) + + +class TestIsInternalTypeMarker(TestCase): + """Tests the use of the Type metaclass init correctly setting the flag on + the `is_internal` attr of a concrete Type class + """ + source_lines = """ +from numba.core import types + +class FooType(types.Type): + def __init__(self): + super(FooType, self).__init__(name='Foo') +""" + + def test_create_temp_module(self): + sys_path_original = list(sys.path) + sys_modules_original = dict(sys.modules) + with create_temp_module(self.source_lines) as test_module: + temp_module_dir = os.path.dirname(test_module.__file__) + self.assertEqual(temp_module_dir, sys.path[0]) + self.assertEqual(sys.path[1:], sys_path_original) + self.assertTrue(test_module.__name__ in sys.modules) + # Test that modifications to sys.path / sys.modules are reverted + self.assertEqual(sys.path, sys_path_original) + self.assertEqual(sys.modules, sys_modules_original) + + def test_create_temp_module_with_exception(self): + try: + sys_path_original = list(sys.path) + sys_modules_original = dict(sys.modules) + with create_temp_module(self.source_lines): + raise ValueError("Something went wrong!") + except ValueError: + # Test that modifications to sys.path / sys.modules are reverted + self.assertEqual(sys.path, sys_path_original) + self.assertEqual(sys.modules, sys_modules_original) + + def test_externally_defined_type_is_external(self): + + with create_temp_module(self.source_lines) as test_module: + FooType = test_module.FooType + self.assertFalse(FooType().is_internal) + + # set up an extension type + class Foo(object): + pass + + register_model(FooType)(models.OpaqueModel) + + @typeof_impl.register(Foo) + def _typ_foo(val, c): + return FooType() + + @unbox(FooType) + def unbox_foo(typ, obj, c): + return NativeValue(c.context.get_dummy_value()) + + # function to overload + def false_if_not_array(a): + pass + + # Set up an overload which will accept all types irrespective of + # whether they are from Numba's closed type system + @overload(false_if_not_array) + def ol_false_if_not_array(a): + if isinstance(a, types.Array): + return lambda a : True + else: + return lambda a : False + + @njit + def call_false_if_not_array(a): + return false_if_not_array(a) + + self.assertTrue(call_false_if_not_array(np.zeros(10))) + self.assertFalse(call_false_if_not_array(10)) + + # The extension type was accepted + self.assertFalse(call_false_if_not_array(Foo())) + + # Now do the same sort of overload but put in a guard based on the + # use of internal types + + def false_if_not_array_closed_system(a): + pass + + @overload(false_if_not_array_closed_system) + def ol_false_if_not_array_closed_system(a): + if a.is_internal: # guard + if isinstance(a, types.Array): + return lambda a : True + else: + return lambda a : False + + @njit + def call_false_if_not_array_closed_system(a): + return false_if_not_array_closed_system(a) + + self.assertTrue(call_false_if_not_array_closed_system(np.zeros(10))) + self.assertFalse(call_false_if_not_array_closed_system(10)) + + with self.assertRaises(errors.TypingError) as raises: + call_false_if_not_array_closed_system(Foo()) + estr = str(raises.exception) + self.assertIn(_header_lead, estr) + self.assertIn("false_if_not_array_closed_system", estr) + self.assertIn("(Foo)", estr) + + def test_mixin_against_real_example(self): + # See issue #4970, this checks that unicode eq/ne now ignores extension + # types. + + with create_temp_module(self.source_lines) as test_module: + FooType = test_module.FooType + self.assertFalse(FooType().is_internal) + + # set up an extension type + class Foo(object): + pass + + register_model(FooType)(models.OpaqueModel) + + @typeof_impl.register(Foo) + def _typ_foo(val, c): + return FooType() + + @unbox(FooType) + def unbox_foo(typ, obj, c): + return NativeValue(c.context.get_dummy_value()) + + @overload(operator.eq) + def foo_eq(a, b): + if a == FooType(): + return lambda a, b: "RAN CUSTOM EQ OVERLOAD" + + @overload(operator.ne) + def foo_ne(a, b): + if a == FooType(): + return lambda a, b: "RAN CUSTOM NE OVERLOAD" + + @njit + def f(a): + return a == "A", a != "A" + + self.assertEqual(("RAN CUSTOM EQ OVERLOAD", + "RAN CUSTOM NE OVERLOAD"), + f(Foo())) + + +class TestIssues(TestCase): + def test_omitted_type(self): + # issue https://github.com/numba/numba/issues/5471 + def inner(a): + pass + + @overload(inner) + def inner_overload(a): + if not isinstance(a, types.Literal): + return + return lambda a: a + + @njit + def my_func(a='a'): + return inner(a) + + @njit + def f(): + return my_func() + + @njit + def g(): + return my_func('b') + + self.assertEqual(f(), 'a') + self.assertEqual(g(), 'b') + + def test_type_of_literal(self): + # type(val) where val is a literal should not give a literal type. + def inner(a): + pass + + @overload(inner) + def inner_overload(a): + if not isinstance(a, types.Literal): + return + self.assertIsInstance(a, types.Literal) + # NOTE: using 1.23 to ensure that the result is indeed an int. + return lambda a: type(a)(a + 1.23) + + @njit + def my_func(a=1): + return inner(a) + + @njit + def f(): + return my_func() + + @njit + def g(): + return my_func(100) + + self.assertEqual(f(), 2) + self.assertEqual(g(), 101) + + def test_issue_typeref_key(self): + # issue https://github.com/numba/numba/issues/6336 + class NoUniqueNameType(types.Dummy): + def __init__(self, param): + super(NoUniqueNameType, self).__init__('NoUniqueNameType') + self.param = param + + @property + def key(self): + return self.param + + no_unique_name_type_1 = NoUniqueNameType(1) + no_unique_name_type_2 = NoUniqueNameType(2) + + for ty1 in (no_unique_name_type_1, no_unique_name_type_2): + for ty2 in (no_unique_name_type_1, no_unique_name_type_2): + self.assertIs( + types.TypeRef(ty1) == types.TypeRef(ty2), ty1 == ty2) + + def test_issue_list_type_key(self): + # https://github.com/numba/numba/issues/6397 + class NoUniqueNameType(types.Dummy): + def __init__(self, param): + super(NoUniqueNameType, self).__init__('NoUniqueNameType') + self.param = param + + @property + def key(self): + return self.param + + no_unique_name_type_1 = NoUniqueNameType(1) + no_unique_name_type_2 = NoUniqueNameType(2) + + for ty1 in (no_unique_name_type_1, no_unique_name_type_2): + for ty2 in (no_unique_name_type_1, no_unique_name_type_2): + self.assertIs( + types.ListType(ty1) == types.ListType(ty2), # noqa: E721 + ty1 == ty2 + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typingerror.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typingerror.py new file mode 100644 index 0000000000000000000000000000000000000000..ce6b6cd3e0e9f6a93e1b508699fbddbe35dd85ab --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_typingerror.py @@ -0,0 +1,236 @@ +import math +import re +import textwrap +import operator + +import numpy as np + +import unittest +from numba import jit, njit +from numba.core import types +from numba.core.errors import TypingError +from numba.core.types.functions import _header_lead +from numba.tests.support import TestCase + + +def what(): + pass + +def foo(): + return what() + +def bar(x): + return x.a + +def issue_868(a): + return a.shape * 2 + +def impossible_return_type(x): + if x > 0: + return () + else: + return 1j + +def bad_hypot_usage(): + return math.hypot(1) + +def imprecise_list(): + l = [] + return len(l) + +def using_imprecise_list(): + a = np.array([]) + return a.astype(np.int32) + +def unknown_module(): + return numpyz.int32(0) + +def nop(x, y, z): + pass + +def array_setitem_invalid_cast(): + arr = np.empty(1, dtype=np.float64) + arr[0] = 1j # invalid cast from complex to float + return arr + + +class Foo(object): + def __repr__(self): + return "" + + +class TestTypingError(unittest.TestCase): + + def test_unknown_function(self): + try: + njit((),)(foo) + except TypingError as e: + self.assertIn("Untyped global name 'what'", str(e)) + else: + self.fail("Should raise error") + + def test_unknown_attrs(self): + try: + njit((types.int32,),)(bar) + except TypingError as e: + self.assertIn("Unknown attribute 'a' of type int32", str(e)) + else: + self.fail("Should raise error") + + def test_unknown_module(self): + # This used to print "'object' object has no attribute 'int32'" + with self.assertRaises(TypingError) as raises: + njit((),)(unknown_module) + self.assertIn("name 'numpyz' is not defined", str(raises.exception)) + + def test_issue_868(self): + ''' + Summary: multiplying a scalar by a non-scalar would cause a crash in + type inference because TimeDeltaMixOp always assumed at least one of + its operands was an NPTimeDelta in its generic() method. + ''' + with self.assertRaises(TypingError) as raises: + njit((types.Array(types.int32, 1, 'C'),))(issue_868) + + expected = ((_header_lead + " Function() found " + "for signature:\n \n >>> mul(UniTuple({} x 1), {})") + .format(str(types.intp), types.IntegerLiteral(2))) + self.assertIn(expected, str(raises.exception)) + self.assertIn("During: typing of", str(raises.exception)) + + def test_return_type_unification(self): + with self.assertRaises(TypingError) as raises: + njit((types.int32,))(impossible_return_type,) + msg = ("Can't unify return type from the following types: Tuple(), " + "complex128") + self.assertIn(msg, str(raises.exception)) + + def test_bad_hypot_usage(self): + with self.assertRaises(TypingError) as raises: + njit((),)(bad_hypot_usage,) + + errmsg = str(raises.exception) + # Make sure it listed the known signatures. + # This is sensitive to the formatting of the error message. + self.assertIn(" * (float64, float64) -> float64", errmsg) + + # find the context lines + ctx_lines = [x for x in errmsg.splitlines() if "During:" in x ] + + # Check contextual msg + self.assertTrue(re.search(r'.*During: resolving callee type: Function.*hypot', ctx_lines[0])) + self.assertTrue(re.search(r'.*During: typing of call .*test_typingerror.py', ctx_lines[1])) + + + def test_imprecise_list(self): + """ + Type inference should catch that a list type's remain imprecise, + instead of letting lowering fail. + """ + with self.assertRaises(TypingError) as raises: + njit((),)(imprecise_list) + + errmsg = str(raises.exception) + msg = ("Cannot infer the type of variable 'l', have imprecise type: " + "list(undefined)") + self.assertIn(msg, errmsg) + # check help message has gone in + self.assertIn("For Numba to be able to compile a list", errmsg) + + def test_using_imprecise_list(self): + """ + Type inference should report informative error about untyped list. + TODO: #2931 + """ + with self.assertRaises(TypingError) as raises: + njit((),)(using_imprecise_list) + + errmsg = str(raises.exception) + self.assertIn("Undecided type", errmsg) + + def test_array_setitem_invalid_cast(self): + with self.assertRaises(TypingError) as raises: + njit((),)(array_setitem_invalid_cast) + + errmsg = str(raises.exception) + self.assertIn( + _header_lead + " Function({})".format(operator.setitem), + errmsg, + ) + self.assertIn( + "(array(float64, 1d, C), Literal[int](0), complex128)", + errmsg, + ) + + def test_template_rejection_error_message_cascade(self): + from numba import njit + @njit + def foo(): + z = 1 + for a, b in enumerate(z): + pass + return z + + with self.assertRaises(TypingError) as raises: + foo() + errmsg = str(raises.exception) + expected = "No match." + self.assertIn(expected, errmsg) + + ctx_lines = [x for x in errmsg.splitlines() if "During:" in x ] + search = [r'.*During: resolving callee type: Function.*enumerate', + r'.*During: typing of call .*test_typingerror.py'] + for i, x in enumerate(search): + self.assertTrue(re.search(x, ctx_lines[i])) + + +class TestArgumentTypingError(unittest.TestCase): + """ + Test diagnostics of typing errors caused by argument inference failure. + """ + + def test_unsupported_array_dtype(self): + # See issue #1943 + cfunc = jit(nopython=True)(nop) + a = np.ones(3) + a = a.astype(a.dtype.newbyteorder()) + with self.assertRaises(TypingError) as raises: + cfunc(1, a, a) + expected = f"Unsupported array dtype: {a.dtype}" + self.assertIn(expected, str(raises.exception)) + + def test_unsupported_type(self): + cfunc = jit(nopython=True)(nop) + foo = Foo() + with self.assertRaises(TypingError) as raises: + cfunc(1, foo, 1) + + expected=re.compile(("This error may have been caused by the following " + r"argument\(s\):\n- argument 1:.*Cannot determine " + "Numba type of " + "")) + self.assertTrue(expected.search(str(raises.exception)) is not None) + + +class TestCallError(unittest.TestCase): + def test_readonly_array(self): + @jit("(f8[:],)", nopython=True) + def inner(x): + return x + + @jit(nopython=True) + def outer(): + return inner(gvalues) + + gvalues = np.ones(10, dtype=np.float64) + + with self.assertRaises(TypingError) as raises: + outer() + + got = str(raises.exception) + pat = r"Invalid use of.*readonly array\(float64, 1d, C\)" + self.assertIsNotNone(re.search(pat, got)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ufuncs.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ufuncs.py new file mode 100644 index 0000000000000000000000000000000000000000..95e56af2ef46e9e5e0f6ea7a1e3efa72315c9da4 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_ufuncs.py @@ -0,0 +1,1906 @@ +import functools +import itertools +import sys +import warnings +import threading +import operator + +import numpy as np + +import unittest +from numba import guvectorize, njit, typeof, vectorize +from numba.core import types +from numba.np.numpy_support import from_dtype +from numba.core.errors import LoweringError, TypingError +from numba.tests.support import TestCase, MemoryLeakMixin +from numba.core.typing.npydecl import supported_ufuncs +from numba.np import numpy_support +from numba.core.registry import cpu_target +from numba.core.base import BaseContext +from numba.np import ufunc_db + +is32bits = tuple.__itemsize__ == 4 +iswindows = sys.platform.startswith('win32') + + +def _unimplemented(func): + """An 'expectedFailure' like decorator that only expects compilation errors + caused by unimplemented functions that fail in no-python mode""" + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + func(*args, **kwargs) + except TypingError: + raise unittest._ExpectedFailure(sys.exc_info()) + raise unittest._UnexpectedSuccess + + +def _make_ufunc_usecase(ufunc): + ldict = {} + arg_str = ','.join(['a{0}'.format(i) for i in range(ufunc.nargs)]) + func_str = 'def fn({0}):\n np.{1}({0})'.format(arg_str, ufunc.__name__) + exec(func_str, globals(), ldict) + fn = ldict['fn'] + fn.__name__ = '{0}_usecase'.format(ufunc.__name__) + return fn + + +def _make_unary_ufunc_op_usecase(ufunc_op): + ldict = {} + exec("def fn(x):\n return {0}(x)".format(ufunc_op), globals(), ldict) + fn = ldict["fn"] + fn.__name__ = "usecase_{0}".format(hash(ufunc_op)) + return fn + + +def _make_binary_ufunc_op_usecase(ufunc_op): + ldict = {} + exec("def fn(x,y):\n return x{0}y".format(ufunc_op), globals(), ldict) + fn = ldict["fn"] + fn.__name__ = "usecase_{0}".format(hash(ufunc_op)) + return fn + + +def _make_inplace_ufunc_op_usecase(ufunc_op): + """Generates a function to be compiled that performs an inplace operation + + ufunc_op can be a string like '+=' or a function like operator.iadd + """ + if isinstance(ufunc_op, str): + ldict = {} + exec("def fn(x,y):\n x{0}y".format(ufunc_op), globals(), ldict) + fn = ldict["fn"] + fn.__name__ = "usecase_{0}".format(hash(ufunc_op)) + else: + def inplace_op(x, y): + ufunc_op(x, y) + fn = inplace_op + return fn + + +def _as_dtype_value(tyargs, args): + """Convert python values into numpy scalar objects. + """ + return [np.dtype(str(ty)).type(val) for ty, val in zip(tyargs, args)] + + +class BaseUFuncTest(MemoryLeakMixin): + + def setUp(self): + super(BaseUFuncTest, self).setUp() + self.inputs = [ + (np.uint32(0), types.uint32), + (np.uint32(1), types.uint32), + (np.int32(-1), types.int32), + (np.int32(0), types.int32), + (np.int32(1), types.int32), + (np.uint64(0), types.uint64), + (np.uint64(1), types.uint64), + (np.int64(-1), types.int64), + (np.int64(0), types.int64), + (np.int64(1), types.int64), + + (np.float32(-0.5), types.float32), + (np.float32(0.0), types.float32), + (np.float32(0.5), types.float32), + + (np.float64(-0.5), types.float64), + (np.float64(0.0), types.float64), + (np.float64(0.5), types.float64), + + (np.array([0,1], dtype='u4'), types.Array(types.uint32, 1, 'C')), + (np.array([0,1], dtype='u8'), types.Array(types.uint64, 1, 'C')), + (np.array([-1,0,1], dtype='i4'), types.Array(types.int32, 1, 'C')), + (np.array([-1,0,1], dtype='i8'), types.Array(types.int64, 1, 'C')), + (np.array([-0.5, 0.0, 0.5], dtype='f4'), + types.Array(types.float32, 1, 'C')), + (np.array([-0.5, 0.0, 0.5], dtype='f8'), + types.Array(types.float64, 1, 'C')), + + (np.array([0,1], dtype=np.int8), types.Array(types.int8, 1, 'C')), + (np.array([0,1], dtype=np.int16), types.Array(types.int16, 1, 'C')), + (np.array([0,1], dtype=np.uint8), types.Array(types.uint8, 1, 'C')), + (np.array([0,1], dtype=np.uint16), + types.Array(types.uint16, 1, 'C')), + ] + + @functools.lru_cache(maxsize=None) + def _compile(self, pyfunc, args, nrt=False): + # NOTE: to test the implementation of Numpy ufuncs, we disable + # rewriting of array expressions. + return njit(args, _nrt=nrt, no_rewrites=True)(pyfunc) + + def _determine_output_type(self, input_type, int_output_type=None, + float_output_type=None): + ty = input_type + if isinstance(ty, types.Array): + ndim = ty.ndim + ty = ty.dtype + else: + ndim = 1 + + if ty in types.signed_domain: + if int_output_type: + output_type = types.Array(int_output_type, ndim, 'C') + else: + output_type = types.Array(ty, ndim, 'C') + elif ty in types.unsigned_domain: + if int_output_type: + output_type = types.Array(int_output_type, ndim, 'C') + else: + output_type = types.Array(ty, ndim, 'C') + else: + if float_output_type: + output_type = types.Array(float_output_type, ndim, 'C') + else: + output_type = types.Array(ty, ndim, 'C') + return output_type + + +class BasicUFuncTest(BaseUFuncTest): + def _make_ufunc_usecase(self, ufunc): + return _make_ufunc_usecase(ufunc) + + def basic_ufunc_test(self, ufunc, skip_inputs=[], additional_inputs=[], + int_output_type=None, float_output_type=None, + kinds='ifc', positive_only=False): + + # Necessary to avoid some Numpy warnings being silenced, despite + # the simplefilter() call below. + self.reset_module_warnings(__name__) + + pyfunc = self._make_ufunc_usecase(ufunc) + + inputs = list(self.inputs) + additional_inputs + + for input_tuple in inputs: + input_operand = input_tuple[0] + input_type = input_tuple[1] + + is_tuple = isinstance(input_operand, tuple) + if is_tuple: + args = input_operand + else: + args = (input_operand,) * ufunc.nin + + if input_type in skip_inputs: + continue + if positive_only and np.any(args[0] < 0): + continue + + # Some ufuncs don't allow all kinds of arguments + if (args[0].dtype.kind not in kinds): + continue + + output_type = self._determine_output_type( + input_type, int_output_type, float_output_type) + + input_types = (input_type,) * ufunc.nin + output_types = (output_type,) * ufunc.nout + argtys = input_types + output_types + cfunc = self._compile(pyfunc, argtys) + + if isinstance(args[0], np.ndarray): + results = [ + np.zeros(args[0].shape, + dtype=out_ty.dtype.name) + for out_ty in output_types + ] + expected = [ + np.zeros(args[0].shape, dtype=out_ty.dtype.name) + for out_ty in output_types + ] + else: + results = [ + np.zeros(1, dtype=out_ty.dtype.name) + for out_ty in output_types + ] + expected = [ + np.zeros(1, dtype=out_ty.dtype.name) + for out_ty in output_types + ] + + invalid_flag = False + with warnings.catch_warnings(record=True) as warnlist: + warnings.simplefilter('always') + pyfunc(*args, *expected) + + warnmsg = "invalid value encountered" + for thiswarn in warnlist: + + if (issubclass(thiswarn.category, RuntimeWarning) + and str(thiswarn.message).startswith(warnmsg)): + invalid_flag = True + + cfunc(*args, *results) + + for expected_i, result_i in zip(expected, results): + msg = '\n'.join(["ufunc '{0}' failed", + "inputs ({1}):", "{2}", + "got({3})", "{4}", + "expected ({5}):", "{6}" + ]).format(ufunc.__name__, + input_type, input_operand, + output_type, result_i, + expected_i.dtype, expected_i) + try: + np.testing.assert_array_almost_equal( + expected_i, result_i, + decimal=5, + err_msg=msg) + except AssertionError: + if invalid_flag: + # Allow output to mismatch for invalid input + print("Output mismatch for invalid input", + input_tuple, result_i, expected_i) + else: + raise + + def signed_unsigned_cmp_test(self, comparison_ufunc): + self.basic_ufunc_test(comparison_ufunc) + + if numpy_support.numpy_version < (1, 25): + return + + # Test additional implementations that specifically handle signed / + # unsigned comparisons added in NumPy 1.25: + # https://github.com/numpy/numpy/pull/23713 + additional_inputs = ( + (np.int64(-1), np.uint64(0)), + (np.int64(-1), np.uint64(1)), + (np.int64(0), np.uint64(0)), + (np.int64(0), np.uint64(1)), + (np.int64(1), np.uint64(0)), + (np.int64(1), np.uint64(1)), + + (np.uint64(0), np.int64(-1)), + (np.uint64(0), np.int64(0)), + (np.uint64(0), np.int64(1)), + (np.uint64(1), np.int64(-1)), + (np.uint64(1), np.int64(0)), + (np.uint64(1), np.int64(1)), + + (np.array([-1, -1, 0, 0, 1, 1], dtype=np.int64), + np.array([0, 1, 0, 1, 0, 1], dtype=np.uint64)), + + (np.array([0, 1, 0, 1, 0, 1], dtype=np.uint64), + np.array([-1, -1, 0, 0, 1, 1], dtype=np.int64)) + ) + + pyfunc = self._make_ufunc_usecase(comparison_ufunc) + + for a, b in additional_inputs: + input_types = (typeof(a), typeof(b)) + output_type = types.Array(types.bool_, 1, 'C') + argtys = input_types + (output_type,) + cfunc = self._compile(pyfunc, argtys) + + if isinstance(a, np.ndarray): + result = np.zeros(a.shape, dtype=np.bool_) + else: + result = np.zeros(1, dtype=np.bool_) + + expected = np.zeros_like(result) + + pyfunc(a, b, expected) + cfunc(a, b, result) + np.testing.assert_equal(expected, result) + + +class TestUFuncs(BasicUFuncTest, TestCase): + def basic_int_ufunc_test(self, name=None): + skip_inputs = [ + types.float32, + types.float64, + types.Array(types.float32, 1, 'C'), + types.Array(types.float64, 1, 'C'), + ] + self.basic_ufunc_test(name, skip_inputs=skip_inputs) + + ############################################################################ + # Math operations + + def test_add_ufunc(self): + self.basic_ufunc_test(np.add) + + def test_subtract_ufunc(self): + self.basic_ufunc_test(np.subtract) + + def test_multiply_ufunc(self): + self.basic_ufunc_test(np.multiply) + + def test_divide_ufunc(self): + # Bear in mind that in python3 divide IS true_divide + # so the out type for int types will be a double + int_out_type = None + int_out_type = types.float64 + + self.basic_ufunc_test(np.divide, + int_output_type=int_out_type) + + def test_logaddexp_ufunc(self): + self.basic_ufunc_test(np.logaddexp, kinds='f') + + def test_logaddexp2_ufunc(self): + self.basic_ufunc_test(np.logaddexp2, kinds='f') + + def test_true_divide_ufunc(self): + self.basic_ufunc_test(np.true_divide, + int_output_type=types.float64) + + def test_floor_divide_ufunc(self): + self.basic_ufunc_test(np.floor_divide) + + def test_negative_ufunc(self): + # NumPy ufunc has bug with uint32 as input and int64 as output, + # so skip uint32 input. + skip_inputs = [types.Array(types.uint32, 1, 'C'), types.uint32] + self.basic_ufunc_test(np.negative, int_output_type=types.int64, + skip_inputs=skip_inputs) + + def test_positive_ufunc(self): + self.basic_ufunc_test(np.positive) + + def test_power_ufunc(self): + self.basic_ufunc_test(np.power, positive_only=True) + + def test_float_power_ufunc(self): + self.basic_ufunc_test(np.float_power, kinds="fc") + + def test_gcd_ufunc(self): + self.basic_ufunc_test(np.gcd, kinds="iu") + + def test_lcm_ufunc(self): + self.basic_ufunc_test(np.lcm, kinds="iu") + + def test_remainder_ufunc(self): + self.basic_ufunc_test(np.remainder) + + def test_mod_ufunc(self): + additional_inputs = [ + ((np.uint64(np.iinfo(np.uint64).max), np.uint64(16)), types.uint64) + ] + self.basic_ufunc_test(np.mod, kinds='ifcu', + additional_inputs=additional_inputs) + + def test_fmod_ufunc(self): + self.basic_ufunc_test(np.fmod) + + def test_abs_ufunc(self, ufunc=np.abs): + additional_inputs = [ + (np.uint32(np.iinfo(np.uint32).max), types.uint32), + (np.uint64(np.iinfo(np.uint64).max), types.uint64), + (np.float32(np.finfo(np.float32).min), types.float32), + (np.float64(np.finfo(np.float64).min), types.float64), + ] + self.basic_ufunc_test(ufunc, + additional_inputs=additional_inputs) + + def test_absolute_ufunc(self): + self.test_abs_ufunc(ufunc=np.absolute) + + def test_fabs_ufunc(self): + self.basic_ufunc_test(np.fabs, kinds='f') + + def test_rint_ufunc(self): + self.basic_ufunc_test(np.rint, kinds='cf') + + def test_sign_ufunc(self): + self.basic_ufunc_test(np.sign) + + def test_conj_ufunc(self): + self.basic_ufunc_test(np.conj) + + def test_exp_ufunc(self): + self.basic_ufunc_test(np.exp, kinds='cf') + + def test_exp2_ufunc(self): + self.basic_ufunc_test(np.exp2, kinds='cf') + + def test_log_ufunc(self): + self.basic_ufunc_test(np.log, kinds='cf') + + def test_log2_ufunc(self): + self.basic_ufunc_test(np.log2, kinds='cf') + + def test_log10_ufunc(self): + self.basic_ufunc_test(np.log10, kinds='cf') + + def test_expm1_ufunc(self): + self.basic_ufunc_test(np.expm1, kinds='cf') + + def test_log1p_ufunc(self): + self.basic_ufunc_test(np.log1p, kinds='cf') + + def test_sqrt_ufunc(self): + self.basic_ufunc_test(np.sqrt, kinds='cf') + + def test_square_ufunc(self): + self.basic_ufunc_test(np.square) + + def test_cbrt_ufunc(self): + self.basic_ufunc_test(np.cbrt, kinds='f') + + def test_reciprocal_ufunc(self): + # reciprocal for integers doesn't make much sense and is problematic + # in the case of division by zero, as an inf will overflow float to + # int conversions, which is undefined behavior. + to_skip = [types.Array(types.uint32, 1, 'C'), types.uint32, + types.Array(types.int32, 1, 'C'), types.int32, + types.Array(types.uint64, 1, 'C'), types.uint64, + types.Array(types.int64, 1, 'C'), types.int64] + self.basic_ufunc_test(np.reciprocal, skip_inputs=to_skip) + + def test_conjugate_ufunc(self): + self.basic_ufunc_test(np.conjugate) + + ############################################################################ + # Trigonometric Functions + + def test_sin_ufunc(self): + self.basic_ufunc_test(np.sin, kinds='cf') + + def test_cos_ufunc(self): + self.basic_ufunc_test(np.cos, kinds='cf') + + def test_tan_ufunc(self): + self.basic_ufunc_test(np.tan, kinds='cf') + + def test_arcsin_ufunc(self): + self.basic_ufunc_test(np.arcsin, kinds='cf') + + def test_arccos_ufunc(self): + self.basic_ufunc_test(np.arccos, kinds='cf') + + def test_arctan_ufunc(self): + self.basic_ufunc_test(np.arctan, kinds='cf') + + def test_arctan2_ufunc(self): + self.basic_ufunc_test(np.arctan2, kinds='cf') + + def test_hypot_ufunc(self): + self.basic_ufunc_test(np.hypot, kinds='f') + + def test_sinh_ufunc(self): + self.basic_ufunc_test(np.sinh, kinds='cf') + + def test_cosh_ufunc(self): + self.basic_ufunc_test(np.cosh, kinds='cf') + + def test_tanh_ufunc(self): + self.basic_ufunc_test(np.tanh, kinds='cf') + + def test_arcsinh_ufunc(self): + self.basic_ufunc_test(np.arcsinh, kinds='cf') + + def test_arccosh_ufunc(self): + self.basic_ufunc_test(np.arccosh, kinds='cf') + + def test_arctanh_ufunc(self): + # arctanh is only valid is only finite in the range ]-1, 1[ + # This means that for any of the integer types it will produce + # conversion from infinity/-infinity to integer. That's undefined + # behavior in C, so the results may vary from implementation to + # implementation. This means that the result from the compiler + # used to compile NumPy may differ from the result generated by + # llvm. Skipping the integer types in this test avoids failed + # tests because of this. + to_skip = [types.Array(types.uint32, 1, 'C'), types.uint32, + types.Array(types.int32, 1, 'C'), types.int32, + types.Array(types.uint64, 1, 'C'), types.uint64, + types.Array(types.int64, 1, 'C'), types.int64] + + self.basic_ufunc_test(np.arctanh, skip_inputs=to_skip, kinds='cf') + + def test_deg2rad_ufunc(self): + self.basic_ufunc_test(np.deg2rad, kinds='f') + + def test_rad2deg_ufunc(self): + self.basic_ufunc_test(np.rad2deg, kinds='f') + + def test_degrees_ufunc(self): + self.basic_ufunc_test(np.degrees, kinds='f') + + def test_radians_ufunc(self): + self.basic_ufunc_test(np.radians, kinds='f') + + ############################################################################ + # Bit-twiddling Functions + + def test_bitwise_and_ufunc(self): + self.basic_int_ufunc_test(np.bitwise_and) + + def test_bitwise_or_ufunc(self): + self.basic_int_ufunc_test(np.bitwise_or) + + def test_bitwise_xor_ufunc(self): + self.basic_int_ufunc_test(np.bitwise_xor) + + def test_invert_ufunc(self): + self.basic_int_ufunc_test(np.invert) + + def test_bitwise_not_ufunc(self): + self.basic_int_ufunc_test(np.bitwise_not) + + # Note: there is no entry for left_shift and right_shift as this harness + # is not valid for them. This is so because left_shift and right + # shift implementation in NumPy has undefined behavior (in C-parlance) + # when the second argument is a negative (or bigger than the number + # of bits) value. + # Also, right_shift for negative first arguments also relies on + # implementation defined behavior, although numba warantees "sane" + # behavior (arithmetic shifts on signed integers, logic shifts on + # unsigned integers). + + ############################################################################ + # Comparison functions + def test_greater_ufunc(self): + self.signed_unsigned_cmp_test(np.greater) + + def test_greater_equal_ufunc(self): + self.signed_unsigned_cmp_test(np.greater_equal) + + def test_less_ufunc(self): + self.signed_unsigned_cmp_test(np.less) + + def test_less_equal_ufunc(self): + self.signed_unsigned_cmp_test(np.less_equal) + + def test_not_equal_ufunc(self): + self.signed_unsigned_cmp_test(np.not_equal) + + def test_equal_ufunc(self): + self.signed_unsigned_cmp_test(np.equal) + + def test_logical_and_ufunc(self): + self.basic_ufunc_test(np.logical_and) + + def test_logical_or_ufunc(self): + self.basic_ufunc_test(np.logical_or) + + def test_logical_xor_ufunc(self): + self.basic_ufunc_test(np.logical_xor) + + def test_logical_not_ufunc(self): + self.basic_ufunc_test(np.logical_not) + + def test_maximum_ufunc(self): + self.basic_ufunc_test(np.maximum) + + def test_minimum_ufunc(self): + self.basic_ufunc_test(np.minimum) + + def test_fmax_ufunc(self): + self.basic_ufunc_test(np.fmax) + + def test_fmin_ufunc(self): + self.basic_ufunc_test(np.fmin) + + ############################################################################ + # Floating functions + + def bool_additional_inputs(self): + return [ + (np.array([True, False], dtype=np.bool_), + types.Array(types.bool_, 1, 'C')), + ] + + def test_isfinite_ufunc(self): + self.basic_ufunc_test( + np.isfinite, kinds='ifcb', + additional_inputs=self.bool_additional_inputs(), + ) + + def test_isinf_ufunc(self): + self.basic_ufunc_test( + np.isinf, kinds='ifcb', + additional_inputs=self.bool_additional_inputs(), + ) + + def test_isnan_ufunc(self): + self.basic_ufunc_test( + np.isnan, kinds='ifcb', + additional_inputs=self.bool_additional_inputs(), + ) + + def test_signbit_ufunc(self): + self.basic_ufunc_test(np.signbit) + + def test_copysign_ufunc(self): + self.basic_ufunc_test(np.copysign, kinds='f') + + def test_nextafter_ufunc(self): + self.basic_ufunc_test(np.nextafter, kinds='f') + + @_unimplemented + def test_modf_ufunc(self): + self.basic_ufunc_test(np.modf, kinds='f') + + # Note: there is no entry for ldexp as this harness isn't valid for this + # ufunc. this is so because ldexp requires heterogeneous inputs. + # However, this ufunc is tested by the TestLoopTypes test classes. + + @_unimplemented + def test_frexp_ufunc(self): + self.basic_ufunc_test(np.frexp, kinds='f') + + def test_floor_ufunc(self): + self.basic_ufunc_test(np.floor, kinds='f') + + def test_ceil_ufunc(self): + self.basic_ufunc_test(np.ceil, kinds='f') + + def test_trunc_ufunc(self): + self.basic_ufunc_test(np.trunc, kinds='f') + + def test_spacing_ufunc(self): + # additional input to check inf behaviour as Numba uses a different alg + # to NumPy + additional = [(np.array([np.inf, -np.inf], dtype=np.float64), + types.Array(types.float64, 1, 'C')),] + self.basic_ufunc_test(np.spacing, kinds='f', + additional_inputs=additional) + + ############################################################################ + # Other tests + + def binary_ufunc_mixed_types_test(self, ufunc): + ufunc_name = ufunc.__name__ + ufunc = _make_ufunc_usecase(ufunc) + inputs1 = [ + (1, types.uint64), + (-1, types.int64), + (0.5, types.float64), + + (np.array([0, 1], dtype='u8'), types.Array(types.uint64, 1, 'C')), + (np.array([-1, 1], dtype='i8'), types.Array(types.int64, 1, 'C')), + (np.array([-0.5, 0.5], dtype='f8'), + types.Array(types.float64, 1, 'C'))] + + inputs2 = inputs1 + + output_types = [types.Array(types.int64, 1, 'C'), + types.Array(types.float64, 1, 'C')] + + pyfunc = ufunc + + for vals in itertools.product(inputs1, inputs2, output_types): + input1, input2, output_type = vals + + input1_operand = input1[0] + input1_type = input1[1] + + input2_operand = input2[0] + input2_type = input2[1] + + # Skip division by unsigned int because of NumPy bugs + if ufunc_name == 'divide' and ( + input2_type == types.Array(types.uint32, 1, 'C') or + input2_type == types.Array(types.uint64, 1, 'C')): + continue + + # Skip some subtraction tests because of NumPy bugs + if (ufunc_name == 'subtract' + and input1_type == types.Array(types.uint32, 1, 'C') + and input2_type == types.uint32 + and types.Array(types.int64, 1, 'C')): + continue + if (ufunc_name == 'subtract' + and input1_type == types.Array(types.uint32, 1, 'C') + and input2_type == types.uint64 + and types.Array(types.int64, 1, 'C')): + continue + + if ((isinstance(input1_type, types.Array) or + isinstance(input2_type, types.Array)) and + not isinstance(output_type, types.Array)): + continue + + args = (input1_type, input2_type, output_type) + cfunc = self._compile(pyfunc, args) + + if isinstance(input1_operand, np.ndarray): + result = np.zeros(input1_operand.size, + dtype=output_type.dtype.name) + expected = np.zeros(input1_operand.size, + dtype=output_type.dtype.name) + elif isinstance(input2_operand, np.ndarray): + result = np.zeros(input2_operand.size, + dtype=output_type.dtype.name) + expected = np.zeros(input2_operand.size, + dtype=output_type.dtype.name) + else: + result = np.zeros(1, dtype=output_type.dtype.name) + expected = np.zeros(1, dtype=output_type.dtype.name) + + cfunc(input1_operand, input2_operand, result) + pyfunc(input1_operand, input2_operand, expected) + + scalar_type = getattr(output_type, 'dtype', output_type) + prec = ('single' + if scalar_type in (types.float32, types.complex64) + else 'double') + self.assertPreciseEqual(expected, result, prec=prec) + + def test_broadcasting(self): + + # Test unary ufunc + pyfunc = _make_ufunc_usecase(np.negative) + + input_operands = [ + np.arange(3, dtype='u8'), + np.arange(3, dtype='u8').reshape(3,1), + np.arange(3, dtype='u8').reshape(1,3), + np.arange(3, dtype='u8').reshape(3,1), + np.arange(3, dtype='u8').reshape(1,3), + np.arange(3 * 3, dtype='u8').reshape(3,3)] + + output_operands = [ + np.zeros(3 * 3, dtype='i8').reshape(3,3), + np.zeros(3 * 3, dtype='i8').reshape(3,3), + np.zeros(3 * 3, dtype='i8').reshape(3,3), + np.zeros(3 * 3 * 3, dtype='i8').reshape(3,3,3), + np.zeros(3 * 3 * 3, dtype='i8').reshape(3,3,3), + np.zeros(3 * 3 * 3, dtype='i8').reshape(3,3,3)] + + for x, result in zip(input_operands, output_operands): + + input_type = types.Array(types.uint64, x.ndim, 'C') + output_type = types.Array(types.int64, result.ndim, 'C') + args = (input_type, output_type) + + cfunc = self._compile(pyfunc, args) + + expected = np.zeros(result.shape, dtype=result.dtype) + np.negative(x, expected) + + cfunc(x, result) + + self.assertPreciseEqual(result, expected) + + # Test binary ufunc + pyfunc = _make_ufunc_usecase(np.add) + + input1_operands = [ + np.arange(3, dtype='u8'), + np.arange(3 * 3, dtype='u8').reshape(3,3), + np.arange(3 * 3 * 3, dtype='u8').reshape(3,3,3), + np.arange(3, dtype='u8').reshape(3,1), + np.arange(3, dtype='u8').reshape(1,3), + np.arange(3, dtype='u8').reshape(3,1,1), + np.arange(3 * 3, dtype='u8').reshape(3,3,1), + np.arange(3 * 3, dtype='u8').reshape(3,1,3), + np.arange(3 * 3, dtype='u8').reshape(1,3,3)] + + input2_operands = input1_operands + + for x, y in itertools.product(input1_operands, input2_operands): + + input1_type = types.Array(types.uint64, x.ndim, 'C') + input2_type = types.Array(types.uint64, y.ndim, 'C') + output_type = types.Array(types.uint64, max(x.ndim, y.ndim), 'C') + args = (input1_type, input2_type, output_type) + + cfunc = self._compile(pyfunc, args) + + expected = np.add(x, y) + result = np.zeros(expected.shape, dtype='u8') + + cfunc(x, y, result) + self.assertPreciseEqual(result, expected) + + def test_implicit_output_npm(self): + # Test for Issue #1078 (https://github.com/numba/numba/issues/1078) - + # ensures that the output of a ufunc is an array. + arr_ty = types.Array(types.uint64, 1, 'C') + sig = (arr_ty, arr_ty) + + @njit((arr_ty, arr_ty)) + def myadd(a0, a1): + return np.add(a0, a1) + + self.assertEqual(myadd.overloads[sig].signature.return_type, arr_ty) + + def test_broadcast_implicit_output_npm_nrt(self): + def pyfunc(a0, a1): + return np.add(a0, a1) + + input1_operands = [ + np.arange(3, dtype='u8'), + np.arange(3 * 3, dtype='u8').reshape(3,3), + np.arange(3 * 3 * 3, dtype='u8').reshape(3,3,3), + np.arange(3, dtype='u8').reshape(3,1), + np.arange(3, dtype='u8').reshape(1,3), + np.arange(3, dtype='u8').reshape(3,1,1), + np.arange(3 * 3, dtype='u8').reshape(3,3,1), + np.arange(3 * 3, dtype='u8').reshape(3,1,3), + np.arange(3 * 3, dtype='u8').reshape(1,3,3)] + + input2_operands = input1_operands + + for x, y in itertools.product(input1_operands, input2_operands): + + input1_type = types.Array(types.uint64, x.ndim, 'C') + input2_type = types.Array(types.uint64, y.ndim, 'C') + args = (input1_type, input2_type) + + cfunc = self._compile(pyfunc, args, nrt=True) + + expected = np.add(x, y) + result = cfunc(x, y) + np.testing.assert_array_equal(expected, result) + + def test_implicit_output_layout_binary(self): + def pyfunc(a0, a1): + return np.add(a0, a1) + + # C layout + X = np.linspace(0, 1, 20).reshape(4, 5) + # F layout + Y = np.array(X, order='F') + # A layout + Z = X.reshape(5, 4).T[0] + + Xty = typeof(X) + assert X.flags.c_contiguous and Xty.layout == 'C' + Yty = typeof(Y) + assert Y.flags.f_contiguous and Yty.layout == 'F' + Zty = typeof(Z) + assert Zty.layout == 'A' + assert not Z.flags.c_contiguous + assert not Z.flags.f_contiguous + + testcases = list(itertools.permutations([X, Y, Z], 2)) + testcases += [(X, X)] + testcases += [(Y, Y)] + testcases += [(Z, Z)] + + for arg0, arg1 in testcases: + args = (typeof(arg0), typeof(arg1)) + cfunc = self._compile(pyfunc, args, nrt=True) + expected = pyfunc(arg0, arg1) + result = cfunc(arg0, arg1) + + self.assertEqual(expected.flags.c_contiguous, + result.flags.c_contiguous) + self.assertEqual(expected.flags.f_contiguous, + result.flags.f_contiguous) + np.testing.assert_array_equal(expected, result) + + def test_implicit_output_layout_unary(self): + def pyfunc(a0): + return np.sqrt(a0) + + # C layout + X = np.linspace(0, 1, 20).reshape(4, 5) + # F layout + Y = np.array(X, order='F') + # A layout + Z = X.reshape(5, 4).T[0] + + Xty = typeof(X) + assert X.flags.c_contiguous and Xty.layout == 'C' + Yty = typeof(Y) + assert Y.flags.f_contiguous and Yty.layout == 'F' + Zty = typeof(Z) + assert Zty.layout == 'A' + assert not Z.flags.c_contiguous + assert not Z.flags.f_contiguous + + for arg0 in [X, Y, Z]: + args = (typeof(arg0),) + cfunc = self._compile(pyfunc, args, nrt=True) + expected = pyfunc(arg0) + result = cfunc(arg0) + + self.assertEqual(expected.flags.c_contiguous, + result.flags.c_contiguous) + self.assertEqual(expected.flags.f_contiguous, + result.flags.f_contiguous) + np.testing.assert_array_equal(expected, result) + + +class TestArrayOperators(BaseUFuncTest, TestCase): + + def _check_results(self, expected, got): + self.assertEqual(expected.dtype.kind, got.dtype.kind) + np.testing.assert_array_almost_equal(expected, got) + + def unary_op_test(self, operator, nrt=True, + skip_inputs=[], additional_inputs=[], + int_output_type=None, float_output_type=None): + operator_func = _make_unary_ufunc_op_usecase(operator) + inputs = list(self.inputs) + inputs.extend(additional_inputs) + pyfunc = operator_func + for input_tuple in inputs: + input_operand, input_type = input_tuple + + if ((input_type in skip_inputs) or + (not isinstance(input_type, types.Array))): + continue + + cfunc = self._compile(pyfunc, (input_type,), nrt=nrt) + expected = pyfunc(input_operand) + got = cfunc(input_operand) + self._check_results(expected, got) + + def binary_op_test(self, operator, nrt=True, + skip_inputs=[], additional_inputs=[], + int_output_type=None, float_output_type=None, + positive_rhs=False): + operator_func = _make_binary_ufunc_op_usecase(operator) + inputs = list(self.inputs) + inputs.extend(additional_inputs) + pyfunc = operator_func + # when generating arbitrary sequences, we use a fixed seed + # for deterministic testing + random_state = np.random.RandomState(1) + for input_tuple in inputs: + input_operand1, input_type = input_tuple + input_dtype = numpy_support.as_dtype( + getattr(input_type, "dtype", input_type)) + input_type1 = input_type + + if input_type in skip_inputs: + continue + + if positive_rhs: + zero = np.zeros(1, dtype=input_dtype)[0] + # If we only use two scalars, the code generator will not + # select the ufunctionalized operator, so we mix it up. + if isinstance(input_type, types.Array): + input_operand0 = input_operand1 + input_type0 = input_type + if positive_rhs and np.any(input_operand1 < zero): + continue + else: + input_operand0 = (random_state.uniform(0, 100, 10)).astype( + input_dtype) + input_type0 = typeof(input_operand0) + if positive_rhs and input_operand1 < zero: + continue + + args = (input_type0, input_type1) + cfunc = self._compile(pyfunc, args, nrt=nrt) + expected = pyfunc(input_operand0, input_operand1) + got = cfunc(input_operand0, input_operand1) + self._check_results(expected, got) + + def bitwise_additional_inputs(self): + # For bitwise operators, we want to check the results for boolean + # arrays (see #1813). + return [ + (True, types.boolean), + (False, types.boolean), + (np.array([True, False]), types.Array(types.boolean, 1, 'C')), + ] + + def binary_int_op_test(self, *args, **kws): + skip_inputs = kws.setdefault('skip_inputs', []) + skip_inputs += [ + types.float32, types.float64, + types.Array(types.float32, 1, 'C'), + types.Array(types.float64, 1, 'C'), + ] + return self.binary_op_test(*args, **kws) + + def binary_bitwise_op_test(self, *args, **kws): + additional_inputs = kws.setdefault('additional_inputs', []) + additional_inputs += self.bitwise_additional_inputs() + return self.binary_int_op_test(*args, **kws) + + def inplace_op_test(self, operator, lhs_values, rhs_values, + lhs_dtypes, rhs_dtypes, precise=True): + operator_func = _make_inplace_ufunc_op_usecase(operator) + pyfunc = operator_func + + if precise: + assertion = self.assertPreciseEqual + else: + assertion = np.testing.assert_allclose + + # The left operand can only be an array, while the right operand + # can be either an array or a scalar + lhs_inputs = [np.array(lhs_values, dtype=dtype) + for dtype in lhs_dtypes] + + rhs_arrays = [np.array(rhs_values, dtype=dtype) + for dtype in rhs_dtypes] + rhs_scalars = [dtype(v) for v in rhs_values for dtype in rhs_dtypes] + rhs_inputs = rhs_arrays + rhs_scalars + + for lhs, rhs in itertools.product(lhs_inputs, rhs_inputs): + lhs_type = typeof(lhs) + rhs_type = typeof(rhs) + args = (lhs_type, rhs_type) + cfunc = self._compile(pyfunc, args) + expected = lhs.copy() + pyfunc(expected, rhs) + got = lhs.copy() + cfunc(got, rhs) + assertion(got, expected) + + def inplace_float_op_test(self, operator, lhs_values, rhs_values, + precise=True): + # Also accept integer inputs for the right operand (they should + # be converted to float). + return self.inplace_op_test(operator, lhs_values, rhs_values, + (np.float32, np.float64), + (np.float32, np.float64, np.int64), + precise=precise) + + def inplace_int_op_test(self, operator, lhs_values, rhs_values): + self.inplace_op_test(operator, lhs_values, rhs_values, + (np.int16, np.int32, np.int64), + (np.int16, np.uint32)) + + def inplace_bitwise_op_test(self, operator, lhs_values, rhs_values): + self.inplace_int_op_test(operator, lhs_values, rhs_values) + self.inplace_op_test(operator, lhs_values, rhs_values, + (np.bool_,), (np.bool_, np.bool_)) + + # ____________________________________________________________ + # Unary operators + + def test_unary_positive_array_op(self): + self.unary_op_test('+') + + def test_unary_negative_array_op(self): + self.unary_op_test('-') + + def test_unary_invert_array_op(self): + self.unary_op_test('~', + skip_inputs=[types.float32, types.float64, + types.Array(types.float32, 1, 'C'), + types.Array(types.float64, 1, 'C')], + additional_inputs=self.bitwise_additional_inputs()) + + # ____________________________________________________________ + # Inplace operators + + def test_inplace_add(self): + self.inplace_float_op_test('+=', [-1, 1.5, 3], [-5, 0, 2.5]) + self.inplace_float_op_test(operator.iadd, [-1, 1.5, 3], [-5, 0, 2.5]) + + def test_inplace_sub(self): + self.inplace_float_op_test('-=', [-1, 1.5, 3], [-5, 0, 2.5]) + self.inplace_float_op_test(operator.isub, [-1, 1.5, 3], [-5, 0, 2.5]) + + def test_inplace_mul(self): + self.inplace_float_op_test('*=', [-1, 1.5, 3], [-5, 0, 2.5]) + self.inplace_float_op_test(operator.imul, [-1, 1.5, 3], [-5, 0, 2.5]) + + def test_inplace_floordiv(self): + self.inplace_float_op_test('//=', [-1, 1.5, 3], [-5, 1.25, 2.5]) + self.inplace_float_op_test(operator.ifloordiv, [-1, 1.5, 3], + [-5, 1.25, 2.5]) + + def test_inplace_div(self): + self.inplace_float_op_test('/=', [-1, 1.5, 3], [-5, 0, 2.5]) + self.inplace_float_op_test(operator.itruediv, [-1, 1.5, 3], + [-5, 1.25, 2.5]) + + def test_inplace_remainder(self): + self.inplace_float_op_test('%=', [-1, 1.5, 3], [-5, 2, 2.5]) + self.inplace_float_op_test(operator.imod, [-1, 1.5, 3], [-5, 2, 2.5]) + + def test_inplace_pow(self): + self.inplace_float_op_test('**=', [-1, 1.5, 3], [-5, 2, 2.5], + precise=False) + self.inplace_float_op_test(operator.ipow, [-1, 1.5, 3], [-5, 2, 2.5], + precise=False) + + def test_inplace_and(self): + self.inplace_bitwise_op_test('&=', [0, 1, 2, 3, 51], + [0, 13, 16, 42, 255]) + self.inplace_bitwise_op_test(operator.iand, [0, 1, 2, 3, 51], + [0, 13, 16, 42, 255]) + + def test_inplace_or(self): + self.inplace_bitwise_op_test('|=', [0, 1, 2, 3, 51], + [0, 13, 16, 42, 255]) + self.inplace_bitwise_op_test(operator.ior, [0, 1, 2, 3, 51], + [0, 13, 16, 42, 255]) + + def test_inplace_xor(self): + self.inplace_bitwise_op_test('^=', [0, 1, 2, 3, 51], + [0, 13, 16, 42, 255]) + self.inplace_bitwise_op_test(operator.ixor, [0, 1, 2, 3, 51], + [0, 13, 16, 42, 255]) + + def test_inplace_lshift(self): + self.inplace_int_op_test('<<=', [0, 5, -10, -51], [0, 1, 4, 14]) + self.inplace_int_op_test(operator.ilshift, [0, 5, -10, -51], + [0, 1, 4, 14]) + + def test_inplace_rshift(self): + self.inplace_int_op_test('>>=', [0, 5, -10, -51], [0, 1, 4, 14]) + self.inplace_int_op_test(operator.irshift, [0, 5, -10, -51], + [0, 1, 4, 14]) + + def test_unary_positive_array_op_2(self): + ''' + Verify that the unary positive operator copies values, and doesn't + just alias to the input array (mirrors normal Numpy/Python + interaction behavior). + ''' + # Test originally from @gmarkall + def f(a1): + a2 = +a1 + a1[0] = 3 + a2[1] = 4 + return a2 + + a1 = np.zeros(10) + a2 = f(a1) + self.assertTrue(a1[0] != a2[0] and a1[1] != a2[1]) + a3 = np.zeros(10) + a4 = njit(f)(a3) + self.assertTrue(a3[0] != a4[0] and a3[1] != a4[1]) + np.testing.assert_array_equal(a1, a3) + np.testing.assert_array_equal(a2, a4) + + # ____________________________________________________________ + # Binary operators + + def test_add_array_op(self): + self.binary_op_test('+') + + def test_subtract_array_op(self): + self.binary_op_test('-') + + def test_multiply_array_op(self): + self.binary_op_test('*') + + def test_divide_array_op(self): + int_out_type = None + int_out_type = types.float64 + self.binary_op_test('/', int_output_type=int_out_type) + + def test_floor_divide_array_op(self): + # Avoid floating-point zeros as x // 0.0 can have varying results + # depending on the algorithm (which changed across Numpy versions) + self.inputs = [ + (np.uint32(1), types.uint32), + (np.int32(-2), types.int32), + (np.int32(0), types.int32), + (np.uint64(4), types.uint64), + (np.int64(-5), types.int64), + (np.int64(0), types.int64), + + (np.float32(-0.5), types.float32), + (np.float32(1.5), types.float32), + + (np.float64(-2.5), types.float64), + (np.float64(3.5), types.float64), + + (np.array([1,2], dtype='u4'), types.Array(types.uint32, 1, 'C')), + (np.array([3,4], dtype='u8'), types.Array(types.uint64, 1, 'C')), + (np.array([-1,1,5], dtype='i4'), types.Array(types.int32, 1, 'C')), + (np.array([-1,1,6], dtype='i8'), types.Array(types.int64, 1, 'C')), + (np.array([-0.5, 1.5], dtype='f4'), + types.Array(types.float32, 1, 'C')), + (np.array([-2.5, 3.5], dtype='f8'), + types.Array(types.float64, 1, 'C')), + ] + self.binary_op_test('//') + + def test_remainder_array_op(self): + self.binary_op_test('%') + + def test_power_array_op(self): + self.binary_op_test('**', positive_rhs=True) + + def test_left_shift_array_op(self): + self.binary_int_op_test('<<', positive_rhs=True) + + def test_right_shift_array_op(self): + self.binary_int_op_test('>>', positive_rhs=True) + + def test_bitwise_and_array_op(self): + self.binary_bitwise_op_test('&') + + def test_bitwise_or_array_op(self): + self.binary_bitwise_op_test('|') + + def test_bitwise_xor_array_op(self): + self.binary_bitwise_op_test('^') + + def test_equal_array_op(self): + self.binary_op_test('==') + + def test_greater_array_op(self): + self.binary_op_test('>') + + def test_greater_equal_array_op(self): + self.binary_op_test('>=') + + def test_less_array_op(self): + self.binary_op_test('<') + + def test_less_equal_array_op(self): + self.binary_op_test('<=') + + def test_not_equal_array_op(self): + self.binary_op_test('!=') + + +class TestScalarUFuncs(TestCase): + """check the machinery of ufuncs works when the result is an scalar. + These are not exhaustive because: + - the machinery to support this case is the same for all the functions of a + given arity. + - the result of the inner function itself is already tested in TestUFuncs + """ + + def run_ufunc(self, pyfunc, arg_types, arg_values): + for tyargs, args in zip(arg_types, arg_values): + cfunc = njit(tyargs)(pyfunc) + got = cfunc(*args) + expected = pyfunc(*_as_dtype_value(tyargs, args)) + + msg = 'for args {0} typed {1}'.format(args, tyargs) + + # note: due to semantics of ufuncs, thing like adding a int32 to a + # uint64 results in doubles (as neither int32 can be cast safely + # to uint64 nor vice-versa, falling back to using the float version. + # Modify in those cases the expected value (the numpy version does + # not use typed integers as inputs so its result is an integer) + special = set([ + (types.int32, types.uint64), + (types.uint64, types.int32), + (types.int64, types.uint64), + (types.uint64, types.int64) + ]) + if tyargs in special: + expected = float(expected) + else: + # The numba version of scalar ufuncs return an actual value that + # gets converted to a Python type, instead of using NumPy + # scalars. although in python 2 NumPy scalars are considered + # and instance of the appropriate python type, in python 3 that + # is no longer the case. This is why the expected result is + # casted to the appropriate Python type (which is actually the + # expected behavior of the ufunc translation) + if np.issubdtype(expected.dtype, np.inexact): + expected = float(expected) + elif np.issubdtype(expected.dtype, np.integer): + expected = int(expected) + elif np.issubdtype(expected.dtype, np.bool_): + expected = bool(expected) + + alltypes = tyargs + (cfunc.overloads[tyargs].signature.return_type,) + + # select the appropriate precision for comparison: note that an + # argument typed at a lower precision can introduce precision + # problems. For this reason the argument types must be taken into + # account. + if any([t == types.float32 for t in alltypes]): + prec = 'single' + elif any([t == types.float64 for t in alltypes]): + prec = 'double' + else: + prec = 'exact' + + self.assertPreciseEqual(got, expected, msg=msg, prec=prec) + + def test_scalar_unary_ufunc(self): + def _func(x): + return np.sqrt(x) + + vals = [(2,), (2,), (1,), (2,), (.1,), (.2,)] + tys = [(types.int32,), (types.uint32,), + (types.int64,), (types.uint64,), + (types.float32,), (types.float64,)] + self.run_ufunc(_func, tys, vals) + + def test_scalar_binary_uniform_ufunc(self): + def _func(x,y): + return np.add(x,y) + + vals = [2, 2, 1, 2, .1, .2] + tys = [types.int32, types.uint32, + types.int64, types.uint64, types.float32, types.float64] + self.run_ufunc(_func, zip(tys, tys), zip(vals, vals)) + + def test_scalar_binary_mixed_ufunc(self): + def _func(x,y): + return np.add(x,y) + + vals = [2, 2, 1, 2, .1, .2] + tys = [types.int32, types.uint32, + types.int64, types.uint64, + types.float32, types.float64] + self.run_ufunc(_func, itertools.product(tys, tys), + itertools.product(vals, vals)) + + +class TestUfuncIssues(TestCase): + + def test_issue_651(self): + # Exercise the code path to make sure this does not fail + @vectorize(["(float64,float64)"]) + def foo(x1, x2): + return np.add(x1, x2) + np.add(x1, x2) + + a = np.arange(10, dtype='f8') + b = np.arange(10, dtype='f8') + self.assertPreciseEqual(foo(a, b), (a + b) + (a + b)) + + def test_issue_2006(self): + """ + should return float32, not float64. + """ + def foo(x, y): + return np.power(x, y) + pyfunc = foo + cfunc = njit(pyfunc) + + def check(x, y): + got = cfunc(x, y) + np.testing.assert_array_almost_equal(got, pyfunc(x, y)) + # Check the power operation conserved the input's dtype + # (this is different from Numpy, whose behaviour depends on + # the *values* of the arguments -- see PyArray_CanCastArrayTo). + self.assertEqual(got.dtype, x.dtype) + + xs = [np.float32([1, 2, 3]), np.complex64([1j, 2, 3 - 3j])] + for x in xs: + check(x, 3) + check(x, np.uint64(3)) + check(x, np.int64([2, 2, 3])) + + +class _LoopTypesTester(TestCase): + """Test code generation for the different loop types defined by ufunc. + + This test relies on class variables to configure the test. Subclasses + of this class can just override some of these variables to check other + ufuncs in a different compilation context. The variables supported are: + + _funcs: the ufuncs to test + _skip_types: letter types that force skipping the loop when testing + if present in the NumPy ufunc signature. + _supported_types: only test loops where all the types in the loop + signature are in this collection. If unset, all. + + Note that both, _skip_types and _supported_types must be met for a loop + to be tested. + + The NumPy ufunc signature has a form like 'ff->f' (for a binary ufunc + loop taking 2 floats and resulting in a float). In a NumPy ufunc object + you can get a list of supported signatures by accessing the attribute + 'types'. + """ + _skip_types = 'OegG' + + # Allowed deviation between Numpy and Numba results + _ulps = {('arccos', 'F'): 2, + ('arcsin', 'D'): 4, + ('arcsin', 'F'): 4, + ('log10', 'D'): 5, + ('tanh', 'F'): 2, + ('cbrt', 'd'): 2, + ('logaddexp2', 'd'): 2, + } + + def _arg_for_type(self, a_letter_type, index=0): + """return a suitable array argument for testing the letter type""" + # Note all possible arrays must have the same size, since they + # may be used as inputs to the same func. + if a_letter_type in 'bhilq': + # an integral + return np.array([1, 4, 0, -2], dtype=a_letter_type) + if a_letter_type in 'BHILQ': + return np.array([1, 2, 4, 0], dtype=a_letter_type) + elif a_letter_type in '?': + # a boolean + return np.array([True, False, False, True], dtype=a_letter_type) + elif a_letter_type[0] == 'm': + # timedelta64 + if len(a_letter_type) == 1: + a_letter_type = 'm8[D]' + return np.array([2, -3, 'NaT', 0], dtype=a_letter_type) + elif a_letter_type[0] == 'M': + # datetime64 + if len(a_letter_type) == 1: + a_letter_type = 'M8[D]' + return np.array(['Nat', 1, 25, 0], dtype=a_letter_type) + elif a_letter_type in 'fd': + # floating point + return np.array([1.5, -3.5, 0.0, float('nan')], + dtype=a_letter_type) + elif a_letter_type in 'FD': + # complex + if sys.platform != 'win32': + # Other platforms have better handling of negative zeros, + # test them + negzero = -(0.0 + 1.0j) + else: + negzero = 0.0 - 1.0j + return np.array([negzero, 1.5 + 1.5j, 1j * float('nan'), 0j], + dtype=a_letter_type) + else: + raise RuntimeError("type %r not understood" % (a_letter_type,)) + + def _check_loop(self, fn, ufunc, loop): + # the letter types for the args + letter_types = loop[:ufunc.nin] + loop[-ufunc.nout:] + + # ignore the loops containing an object argument. They will always + # fail in no python mode. Usually the last loop in ufuncs is an all + # object fallback + supported_types = getattr(self, '_supported_types', []) + if (supported_types and + any(l not in supported_types for l in letter_types)): + return + skip_types = getattr(self, '_skip_types', []) + if any(l in skip_types for l in letter_types): + return + # if the test case requires some types to be present, skip loops + # not involving any of those types. + required_types = getattr(self, '_required_types', []) + if required_types and not any(l in letter_types + for l in required_types): + return + + self._check_ufunc_with_dtypes(fn, ufunc, letter_types) + + def _check_ufunc_with_dtypes(self, fn, ufunc, dtypes): + # Arrays created with datetime and timedelta types (e.g. with np.array) + # will have units, so in order to ensure that the dtypes of arguments + # match the dtypes in the signature, we add units to unitless datetime + # and timedelta types. This corresponds with the addition of units in + # _arg_for_type() above. + dtypes_with_units = [] + for t in dtypes: + if t in ('m', 'M'): + t = t + '8[D]' + dtypes_with_units.append(t) + + arg_dty = [np.dtype(t) for t in dtypes_with_units] + arg_nbty = tuple([types.Array(from_dtype(t), 1, 'C') for t in arg_dty]) + cfunc = njit(arg_nbty)(fn) + + # Ensure a good mix of input values + c_args = [self._arg_for_type(t, index=index).repeat(2) + for index, t in enumerate(dtypes)] + for arr in c_args: + self.random.shuffle(arr) + py_args = [a.copy() for a in c_args] + + cfunc(*c_args) + fn(*py_args) + + # Check each array (including inputs, to ensure they weren't + # mutated). + for dtype, py_arg, c_arg in zip(arg_dty, py_args, c_args): + py_arg, c_arg = self._fixup_results(dtype, py_arg, c_arg) + typechar = c_arg.dtype.char + ulps = self._ulps.get((ufunc.__name__, typechar), 1) + prec = 'single' if typechar in 'fF' else 'exact' + prec = 'double' if typechar in 'dD' else prec + msg = '\n'.join(["ufunc '{0}' arrays differ ({1}):", + "args: {2}", "expected {3}", "got {4}"]) + msg = msg.format(ufunc.__name__, c_args, prec, py_arg, c_arg) + self.assertPreciseEqual(py_arg, c_arg, prec=prec, msg=msg, + ulps=ulps) + + def _fixup_results(self, dtype, py_arg, c_arg): + return py_arg, c_arg + + @classmethod + def _check_ufunc_loops(cls, ufunc): + for loop in ufunc.types: + cls._inject_test(ufunc, loop) + + @classmethod + def _inject_test(cls, ufunc, loop): + def test_template(self): + fn = _make_ufunc_usecase(ufunc) + self._check_loop(fn, ufunc, loop) + setattr(cls, "test_{0}_{1}".format(ufunc.__name__, + loop.replace('->', '_')), + test_template) + + @classmethod + def autogenerate(cls): + for ufunc in cls._ufuncs: + cls._check_ufunc_loops(ufunc) + + +class TestLoopTypesInt(_LoopTypesTester): + _ufuncs = supported_ufuncs[:] + # reciprocal and power need a special test due to issue #757 + _ufuncs.remove(np.power) + _ufuncs.remove(np.reciprocal) + _ufuncs.remove(np.left_shift) # has its own test class + _ufuncs.remove(np.right_shift) # has its own test class + # special test for bool subtract/negative + _ufuncs.remove(np.subtract) + _ufuncs.remove(np.negative) + _required_types = '?bBhHiIlLqQ' + _skip_types = 'fdFDmMO' + _LoopTypesTester._skip_types + + +TestLoopTypesInt.autogenerate() + + +class TestLoopTypesSubtractAndNegative(_LoopTypesTester): + _ufuncs = [np.subtract, np.negative] + _required_types = '?bBhHiIlLqQfdFD' + _skip_types = 'mMO' + _LoopTypesTester._skip_types + '?' + + +TestLoopTypesSubtractAndNegative.autogenerate() + + +class TestLoopTypesReciprocal(_LoopTypesTester): + _ufuncs = [np.reciprocal] # issue #757 + _required_types = 'bBhHiIlLqQfdFD' + _skip_types = 'mMO' + _LoopTypesTester._skip_types + + def _arg_for_type(self, a_letter_type, index=0): + res = super(self.__class__, self)._arg_for_type(a_letter_type, + index=index) + if a_letter_type in 'bBhHiIlLqQ': + # For integer reciprocal, avoid 0 as argument, as it triggers + # undefined behavior that may differ in results from Numba + # to the compiler used to compile NumPy. + res[res == 0] = 42 + return res + + +TestLoopTypesReciprocal.autogenerate() + + +class TestLoopTypesPower(_LoopTypesTester): + _ufuncs = [np.power] # issue #757 + _required_types = 'bBhHiIlLqQfdFD' + _skip_types = 'mMO' + _LoopTypesTester._skip_types + + def _arg_for_type(self, a_letter_type, index=0): + res = super(self.__class__, self)._arg_for_type(a_letter_type, + index=index) + if a_letter_type in 'bBhHiIlLqQ' and index == 1: + # For integer power, avoid a negative exponent, as it triggers + # undefined behavior that may differ in results from Numba + # to the compiler used to compile NumPy + res[res < 0] = 3 + return res + + +TestLoopTypesPower.autogenerate() + + +class TestLoopTypesIntLeftShift(_LoopTypesTester): + _ufuncs = [np.left_shift] + _required_types = 'bBhHiIlLqQ' + _skip_types = 'fdFDmMO' + _LoopTypesTester._skip_types + + def _arg_for_type(self, a_letter_type, index=0): + res = super(self.__class__, self)._arg_for_type(a_letter_type, + index=index) + # Shifting by a negative amount (argument with index 1) is undefined + # behavior in C. It is also undefined behavior in numba. In the same + # sense, it is also undefined behavior when the shift amount is larger + # than the number of bits in the shifted integer. + # To avoid problems in the test, the values are clamped (clipped) so + # that 0 <= shift_amount < bitcount(shifted_integer) + if index == 1: + bit_count = res.dtype.itemsize * 8 + res = np.clip(res, 0, bit_count - 1) + return res + + +TestLoopTypesIntLeftShift.autogenerate() + + +class TestLoopTypesIntRightShift(_LoopTypesTester): + _ufuncs = [np.right_shift] + _required_types = 'bBhHiIlLqQ' + _skip_types = 'fdFDmMO' + _LoopTypesTester._skip_types + + def _arg_for_type(self, a_letter_type, index=0): + res = super(self.__class__, self)._arg_for_type(a_letter_type, + index=index) + # Shifting by a negative amount (argument with index 1) is undefined + # behavior in C. It is also undefined behavior in numba. In the same + # sense, it is also undefined behavior when the shift amount is larger + # than the number of bits in the shifted integer. + # To avoid problems in the test, the values are clamped (clipped) so + # that 0 <= shift_amount < bitcount(shifted_integer) + if index == 1: + bit_count = res.dtype.itemsize * 8 + res = np.clip(res, 0, bit_count - 1) + + # Right shift has "implementation defined behavior" when the number + # shifted is negative (in C). In numba, right shift for signed integers + # is "arithmetic" while for unsigned integers is "logical". + # This test compares against the NumPy implementation, that relies + # on "implementation defined behavior", so the test could be a false + # failure if the compiler used to compile NumPy doesn't follow the same + # policy. + # Hint: do not rely on right shifting negative numbers in NumPy. + if index == 0: + res = np.abs(res) + return res + + +TestLoopTypesIntRightShift.autogenerate() + + +class TestLoopTypesFloorDivide(_LoopTypesTester): + _ufuncs = [np.floor_divide, np.remainder, np.divmod] + _required_types = 'bBhHiIlLqQfdFD' + _skip_types = 'mMO' + _LoopTypesTester._skip_types + + def _fixup_results(self, dtype, py_arg, c_arg): + if dtype.kind == 'f': + # Discrepancies on floating-point floor division and remainder: + # Numpy may return nan where Numba returns inf, e.g. 1. // 0. + pred = (np.isinf(c_arg) & np.isnan(py_arg)) + # Numpy and Numba may differ in signed zeros, e.g. -0. // -1. + pred |= (py_arg == 0.0) & (c_arg == 0.0) + c_arg[pred] = py_arg[pred] + return py_arg, c_arg + + +TestLoopTypesFloorDivide.autogenerate() + + +class TestLoopTypesFloat(_LoopTypesTester): + _ufuncs = supported_ufuncs[:] + if iswindows: + _ufuncs.remove(np.signbit) # TODO: fix issue #758 + _ufuncs.remove(np.floor_divide) # has its own test class + _ufuncs.remove(np.remainder) # has its own test class + _ufuncs.remove(np.divmod) # has its own test class + _ufuncs.remove(np.mod) # same as np.remainder + _required_types = 'fd' + _skip_types = 'FDmMO' + _LoopTypesTester._skip_types + + +TestLoopTypesFloat.autogenerate() + + +class TestLoopTypesComplex(_LoopTypesTester): + _ufuncs = supported_ufuncs[:] + + # Test complex types + # Every loop containing a complex argument must be tested + _required_types = 'FD' + _skip_types = 'mMO' + _LoopTypesTester._skip_types + + +TestLoopTypesComplex.autogenerate() + + +class TestLoopTypesDatetime(_LoopTypesTester): + _ufuncs = supported_ufuncs[:] + + _ufuncs.remove(np.divmod) # not implemented yet + + # NOTE: the full list of ufuncs supporting datetime64 and timedelta64 + # types in Numpy is: + # ['absolute', 'add', 'divide', 'equal', 'floor_divide', 'fmax', 'fmin', + # 'greater', 'greater_equal', 'less', 'less_equal', 'maximum', + # 'minimum', 'multiply', 'negative', 'not_equal', 'sign', 'subtract', + # 'true_divide'] + + # Test datetime64 and timedelta64 types. + _required_types = 'mM' + + # Test various units combinations (TestLoopTypes is only able to test + # homogeneous units). + + def test_add(self): + ufunc = np.add + fn = _make_ufunc_usecase(ufunc) + # heterogeneous inputs + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[s]', 'm8[m]', 'm8[s]']) + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[m]', 'm8[s]', 'm8[s]']) + # heterogeneous inputs, scaled output + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[s]', 'm8[m]', 'm8[ms]']) + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[m]', 'm8[s]', 'm8[ms]']) + # Cannot upscale result (Numpy would accept this) + with self.assertRaises(LoweringError): + self._check_ufunc_with_dtypes(fn, ufunc, + ['m8[m]', 'm8[s]', 'm8[m]']) + + def test_subtract(self): + ufunc = np.subtract + fn = _make_ufunc_usecase(ufunc) + # heterogeneous inputs + self._check_ufunc_with_dtypes(fn, ufunc, ['M8[s]', 'M8[m]', 'm8[s]']) + self._check_ufunc_with_dtypes(fn, ufunc, ['M8[m]', 'M8[s]', 'm8[s]']) + # heterogeneous inputs, scaled output + self._check_ufunc_with_dtypes(fn, ufunc, ['M8[s]', 'M8[m]', 'm8[ms]']) + self._check_ufunc_with_dtypes(fn, ufunc, ['M8[m]', 'M8[s]', 'm8[ms]']) + # Cannot upscale result (Numpy would accept this) + with self.assertRaises(LoweringError): + self._check_ufunc_with_dtypes(fn, ufunc, + ['M8[m]', 'M8[s]', 'm8[m]']) + + def test_multiply(self): + ufunc = np.multiply + fn = _make_ufunc_usecase(ufunc) + # scaled output + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[s]', 'q', 'm8[us]']) + self._check_ufunc_with_dtypes(fn, ufunc, ['q', 'm8[s]', 'm8[us]']) + # Cannot upscale result (Numpy would accept this) + with self.assertRaises(LoweringError): + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[s]', 'q', 'm8[m]']) + + def test_true_divide(self): + ufunc = np.true_divide + fn = _make_ufunc_usecase(ufunc) + # heterogeneous inputs + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[m]', 'm8[s]', 'd']) + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[s]', 'm8[m]', 'd']) + # scaled output + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[m]', 'q', 'm8[s]']) + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[m]', 'd', 'm8[s]']) + # Cannot upscale result (Numpy would accept this) + with self.assertRaises(LoweringError): + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[s]', 'q', 'm8[m]']) + + def test_floor_divide(self): + ufunc = np.floor_divide + fn = _make_ufunc_usecase(ufunc) + # scaled output + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[m]', 'q', 'm8[s]']) + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[m]', 'd', 'm8[s]']) + # Cannot upscale result (Numpy would accept this) + with self.assertRaises(LoweringError): + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[s]', 'q', 'm8[m]']) + + def _check_comparison(self, ufunc): + fn = _make_ufunc_usecase(ufunc) + # timedelta + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[m]', 'm8[s]', '?']) + self._check_ufunc_with_dtypes(fn, ufunc, ['m8[s]', 'm8[m]', '?']) + # datetime + self._check_ufunc_with_dtypes(fn, ufunc, ['M8[m]', 'M8[s]', '?']) + self._check_ufunc_with_dtypes(fn, ufunc, ['M8[s]', 'M8[m]', '?']) + + def test_comparisons(self): + for ufunc in [np.equal, np.not_equal, np.less, np.less_equal, + np.greater, np.greater_equal]: + self._check_comparison(ufunc) + + +TestLoopTypesDatetime.autogenerate() + + +class TestUFuncBadArgs(TestCase): + def test_missing_args(self): + def func(x): + """error: np.add requires two args""" + result = np.add(x) + return result + + with self.assertRaises(TypingError): + njit([types.float64(types.float64)])(func) + + def test_too_many_args(self): + def func(x, out, out2): + """error: too many args""" + result = np.add(x, x, out, out2) + return result + + array_type = types.Array(types.float64, 1, 'C') + sig = array_type(array_type, array_type, array_type) + + with self.assertRaises(TypingError): + njit(sig)(func) + + def test_no_scalar_result_by_reference(self): + def func(x): + """error: scalar as a return value is not supported""" + y = 0 + np.add(x, x, y) + + with self.assertRaises(TypingError): + njit([types.float64(types.float64)])(func) + + +class TestUFuncCompilationThreadSafety(TestCase): + + def test_lock(self): + """ + Test that (lazy) compiling from several threads at once doesn't + produce errors (see issue #2403). + """ + errors = [] + + @vectorize + def foo(x): + return x + 1 + + def wrapper(): + try: + a = np.ones((10,), dtype=np.float64) + expected = np.ones((10,), dtype=np.float64) + 1. + np.testing.assert_array_equal(foo(a), expected) + except Exception as e: + errors.append(e) + + threads = [threading.Thread(target=wrapper) for i in range(16)] + for t in threads: + t.start() + for t in threads: + t.join() + self.assertFalse(errors) + + +class TestUfuncOnContext(TestCase): + def test_cpu_get_ufunc_info(self): + # The CPU context defines get_ufunc_info that is the same as + # ufunc_db.get_ufunc_info. + targetctx = cpu_target.target_context + # Check: get_ufunc_info returns a dict + add_info = targetctx.get_ufunc_info(np.add) + self.assertIsInstance(add_info, dict) + # Check: it is the same as ufunc_db.get_ufunc_info + expected = ufunc_db.get_ufunc_info(np.add) + self.assertEqual(add_info, expected) + # Check: KeyError raised on bad key + badkey = object() + with self.assertRaises(KeyError) as raises: + ufunc_db.get_ufunc_info(badkey) + self.assertEqual(raises.exception.args, (badkey,)) + + def test_base_get_ufunc_info(self): + # The BaseContext always raises NotImplementedError + targetctx = BaseContext(cpu_target.typing_context, 'cpu') + with self.assertRaises(NotImplementedError) as raises: + targetctx.get_ufunc_info(np.add) + self.assertRegex( + str(raises.exception), + r" does not support ufunc", + ) + + +class TestUfuncWriteInput(TestCase): + def test_write_input_arg(self): + @guvectorize(["void(float64[:], uint8[:])"], "(n)->(n)") + def func(x, out): + + for i in range(x.size): + # set every fourth element to 1 + if i % 4 == 0: + out[i] = 1 + + x = np.random.rand(10, 5) + out = np.zeros_like(x, dtype=np.int8) + + func(x, out) + np.testing.assert_array_equal( + np.array([True, False, False, False, True], dtype=np.bool_), + out.any(axis=0)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unicode.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unicode.py new file mode 100644 index 0000000000000000000000000000000000000000..cf0be5093e2a36c2f6edec6e205785e5ef7cf62b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unicode.py @@ -0,0 +1,2717 @@ +# -*- coding: utf-8 -*- +from itertools import product +from itertools import permutations + +from numba import njit, typeof +from numba.core import types +import unittest +from numba.tests.support import (TestCase, no_pyobj_flags, MemoryLeakMixin) +from numba.core.errors import (TypingError, UnsupportedError, + UnsupportedBytecodeError) +from numba.cpython.unicode import _MAX_UNICODE +from numba.core.types.functions import _header_lead +from numba.extending import overload +from numba.core.utils import PYVERSION + + +def isascii(s): + return all(ord(c) < 128 for c in s) + + +def literal_usecase(): + return '大处着眼,小处着手。' + + +def passthrough_usecase(x): + return x + + +def eq_usecase(x, y): + return x == y + + +def len_usecase(x): + return len(x) + + +def bool_usecase(x): + return bool(x) + + +def getitem_usecase(x, i): + return x[i] + + +def getitem_check_kind_usecase(x, i): + return hash(x[i]) + + +def zfill_usecase(x, y): + return x.zfill(y) + + +def concat_usecase(x, y): + return x + y + + +def repeat_usecase(x, y): + return x * y + + +def inplace_concat_usecase(x, y): + x += y + return x + + +def in_usecase(x, y): + return x in y + + +def lt_usecase(x, y): + return x < y + + +def le_usecase(x, y): + return x <= y + + +def gt_usecase(x, y): + return x > y + + +def ge_usecase(x, y): + return x >= y + + +def partition_usecase(s, sep): + return s.partition(sep) + + +def find_usecase(x, y): + return x.find(y) + + +def find_with_start_only_usecase(x, y, start): + return x.find(y, start) + + +def find_with_start_end_usecase(x, y, start, end): + return x.find(y, start, end) + + +def rpartition_usecase(s, sep): + return s.rpartition(sep) + + +def count_usecase(x, y): + return x.count(y) + + +def count_with_start_usecase(x, y, start): + return x.count(y, start) + + +def count_with_start_end_usecase(x, y, start, end): + return x.count(y, start, end) + + +def rfind_usecase(x, y): + return x.rfind(y) + + +def rfind_with_start_only_usecase(x, y, start): + return x.rfind(y, start) + + +def rfind_with_start_end_usecase(x, y, start, end): + return x.rfind(y, start, end) + + +def replace_usecase(s, x, y): + return s.replace(x, y) + + +def replace_with_count_usecase(s, x, y, count): + return s.replace(x, y, count) + + +def rindex_usecase(x, y): + return x.rindex(y) + + +def rindex_with_start_only_usecase(x, y, start): + return x.rindex(y, start) + + +def rindex_with_start_end_usecase(x, y, start, end): + return x.rindex(y, start, end) + + +def index_usecase(x, y): + return x.index(y) + + +def index_with_start_only_usecase(x, y, start): + return x.index(y, start) + + +def index_with_start_end_usecase(x, y, start, end): + return x.index(y, start, end) + + +def startswith_usecase(x, y): + return x.startswith(y) + + +def endswith_usecase(x, y): + return x.endswith(y) + + +def expandtabs_usecase(s): + return s.expandtabs() + + +def expandtabs_with_tabsize_usecase(s, tabsize): + return s.expandtabs(tabsize) + + +def expandtabs_with_tabsize_kwarg_usecase(s, tabsize): + return s.expandtabs(tabsize=tabsize) + + +def startswith_with_start_only_usecase(x, y, start): + return x.startswith(y, start) + + +def startswith_with_start_end_usecase(x, y, start, end): + return x.startswith(y, start, end) + + +def endswith_with_start_only_usecase(x, y, start): + return x.endswith(y, start) + + +def endswith_with_start_end_usecase(x, y, start, end): + return x.endswith(y, start, end) + + +def split_usecase(x, y): + return x.split(y) + + +def split_with_maxsplit_usecase(x, y, maxsplit): + return x.split(y, maxsplit) + + +def split_with_maxsplit_kwarg_usecase(x, y, maxsplit): + return x.split(y, maxsplit=maxsplit) + + +def split_whitespace_usecase(x): + return x.split() + + +def splitlines_usecase(s): + return s.splitlines() + + +def splitlines_with_keepends_usecase(s, keepends): + return s.splitlines(keepends) + + +def splitlines_with_keepends_kwarg_usecase(s, keepends): + return s.splitlines(keepends=keepends) + + +def rsplit_usecase(s, sep): + return s.rsplit(sep) + + +def rsplit_with_maxsplit_usecase(s, sep, maxsplit): + return s.rsplit(sep, maxsplit) + + +def rsplit_with_maxsplit_kwarg_usecase(s, sep, maxsplit): + return s.rsplit(sep, maxsplit=maxsplit) + + +def rsplit_whitespace_usecase(s): + return s.rsplit() + + +def lstrip_usecase(x): + return x.lstrip() + + +def lstrip_usecase_chars(x, chars): + return x.lstrip(chars) + + +def rstrip_usecase(x): + return x.rstrip() + + +def rstrip_usecase_chars(x, chars): + return x.rstrip(chars) + + +def strip_usecase(x): + return x.strip() + + +def strip_usecase_chars(x, chars): + return x.strip(chars) + + +def join_usecase(x, y): + return x.join(y) + + +def join_empty_usecase(x): + # hack to make empty typed list + l = [''] + l.pop() + return x.join(l) + + +def center_usecase(x, y): + return x.center(y) + + +def center_usecase_fillchar(x, y, fillchar): + return x.center(y, fillchar) + + +def ljust_usecase(x, y): + return x.ljust(y) + + +def ljust_usecase_fillchar(x, y, fillchar): + return x.ljust(y, fillchar) + + +def rjust_usecase(x, y): + return x.rjust(y) + + +def rjust_usecase_fillchar(x, y, fillchar): + return x.rjust(y, fillchar) + + +def istitle_usecase(x): + return x.istitle() + + +def iter_usecase(x): + l = [] + for i in x: + l.append(i) + return l + + +def title(x): + return x.title() + + +def literal_iter_usecase(): + l = [] + for i in '大处着眼,小处着手。': + l.append(i) + return l + + +def enumerated_iter_usecase(x): + buf = "" + scan = 0 + for i, s in enumerate(x): + buf += s + scan += 1 + return buf, scan + + +def iter_stopiteration_usecase(x): + n = len(x) + i = iter(x) + for _ in range(n + 1): + next(i) + + +def literal_iter_stopiteration_usecase(): + s = '大处着眼,小处着手。' + i = iter(s) + n = len(s) + for _ in range(n + 1): + next(i) + + +def islower_usecase(x): + return x.islower() + + +def lower_usecase(x): + return x.lower() + + +def ord_usecase(x): + return ord(x) + + +def chr_usecase(x): + return chr(x) + + +class BaseTest(MemoryLeakMixin, TestCase): + def setUp(self): + super(BaseTest, self).setUp() + + +UNICODE_EXAMPLES = [ + '', + 'ascii', + '12345', + '1234567890', + '¡Y tú quién te crees?', + '🐍⚡', + '大处着眼,小处着手。', +] + +UNICODE_ORDERING_EXAMPLES = [ + '', + 'a' + 'aa', + 'aaa', + 'b', + 'aab', + 'ab', + 'asc', + 'ascih', + 'ascii', + 'ascij', + '大处着眼,小处着手', + '大处着眼,小处着手。', + '大处着眼,小处着手。🐍⚡', +] + +UNICODE_COUNT_EXAMPLES = [ + ('', ''), + ('', 'ascii'), + ('ascii', ''), + ('asc ii', ' '), + ('ascii', 'ci'), + ('ascii', 'ascii'), + ('ascii', 'Ă'), + ('ascii', '大处'), + ('ascii', 'étú?'), + ('', '大处 着眼,小处着手。大大大处'), + ('大处 着眼,小处着手。大大大处', ''), + ('大处 着眼,小处着手。大大大处', ' '), + ('大处 着眼,小处着手。大大大处', 'ci'), + ('大处 着眼,小处着手。大大大处', '大处大处'), + ('大处 着眼,小处着手。大大大处', '大处 着眼,小处着手。大大大处'), + ('大处 着眼,小处着手。大大大处', 'Ă'), + ('大处 着眼,小处着手。大大大处', '大处'), + ('大处 着眼,小处着手。大大大处', 'étú?'), + ('', 'tú quién te crees?'), + ('tú quién te crees?', ''), + ('tú quién te crees?', ' '), + ('tú quién te crees?', 'ci'), + ('tú quién te crees?', 'tú quién te crees?'), + ('tú quién te crees?', 'Ă'), + ('tú quién te crees?', '大处'), + ('tú quién te crees?', 'étú?'), + ('abababab', 'a'), + ('abababab', 'ab'), + ('abababab', 'aba'), + ('aaaaaaaaaa', 'aaa'), + ('aaaaaaaaaa', 'aĂ'), + ('aabbaaaabbaa', 'aa') +] + + +class TestUnicode(BaseTest): + + def test_literal(self): + pyfunc = literal_usecase + cfunc = njit(literal_usecase) + self.assertPreciseEqual(pyfunc(), cfunc()) + + def test_passthrough(self, flags=no_pyobj_flags): + pyfunc = passthrough_usecase + cfunc = njit(pyfunc) + for s in UNICODE_EXAMPLES: + self.assertEqual(pyfunc(s), cfunc(s)) + + def test_eq(self, flags=no_pyobj_flags): + pyfunc = eq_usecase + cfunc = njit(pyfunc) + for a in UNICODE_EXAMPLES: + for b in reversed(UNICODE_EXAMPLES): + self.assertEqual(pyfunc(a, b), + cfunc(a, b), '%s, %s' % (a, b)) + # comparing against something that's not unicode + self.assertEqual(pyfunc(a, 1), + cfunc(a, 1), '%s, %s' % (a, 1)) + self.assertEqual(pyfunc(1, b), + cfunc(1, b), '%s, %s' % (1, b)) + + def test_eq_optional(self): + # See issue #7474 + @njit + def foo(pred1, pred2): + if pred1 > 0: + resolved1 = 'concrete' + else: + resolved1 = None + if pred2 < 0: + resolved2 = 'concrete' + else: + resolved2 = None + + # resolved* are Optionals + if resolved1 == resolved2: + return 10 + else: + return 20 + + for (p1, p2) in product(*((-1, 1),) * 2): + self.assertEqual(foo(p1, p2), foo.py_func(p1, p2)) + + def _check_ordering_op(self, usecase): + pyfunc = usecase + cfunc = njit(pyfunc) + + # Check comparison to self + for a in UNICODE_ORDERING_EXAMPLES: + self.assertEqual( + pyfunc(a, a), + cfunc(a, a), + '%s: "%s", "%s"' % (usecase.__name__, a, a), + ) + + # Check comparison to adjacent + for a, b in permutations(UNICODE_ORDERING_EXAMPLES, r=2): + self.assertEqual( + pyfunc(a, b), + cfunc(a, b), + '%s: "%s", "%s"' % (usecase.__name__, a, b), + ) + # and reversed + self.assertEqual( + pyfunc(b, a), + cfunc(b, a), + '%s: "%s", "%s"' % (usecase.__name__, b, a), + ) + + def test_lt(self, flags=no_pyobj_flags): + self._check_ordering_op(lt_usecase) + + def test_le(self, flags=no_pyobj_flags): + self._check_ordering_op(le_usecase) + + def test_gt(self, flags=no_pyobj_flags): + self._check_ordering_op(gt_usecase) + + def test_ge(self, flags=no_pyobj_flags): + self._check_ordering_op(ge_usecase) + + def test_len(self, flags=no_pyobj_flags): + pyfunc = len_usecase + cfunc = njit(pyfunc) + for s in UNICODE_EXAMPLES: + self.assertEqual(pyfunc(s), cfunc(s)) + + def test_bool(self, flags=no_pyobj_flags): + pyfunc = bool_usecase + cfunc = njit(pyfunc) + for s in UNICODE_EXAMPLES: + self.assertEqual(pyfunc(s), cfunc(s)) + + def test_expandtabs(self): + pyfunc = expandtabs_usecase + cfunc = njit(pyfunc) + + cases = ['', '\t', 't\tt\t', 'a\t', '\t⚡', 'a\tbc\nab\tc', + '🐍\t⚡', '🐍⚡\n\t\t🐍\t', 'ab\rab\t\t\tab\r\n\ta'] + + msg = 'Results of "{}".expandtabs() must be equal' + for s in cases: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_expandtabs_with_tabsize(self): + fns = [njit(expandtabs_with_tabsize_usecase), + njit(expandtabs_with_tabsize_kwarg_usecase)] + messages = ['Results of "{}".expandtabs({}) must be equal', + 'Results of "{}".expandtabs(tabsize={}) must be equal'] + + cases = ['', '\t', 't\tt\t', 'a\t', '\t⚡', 'a\tbc\nab\tc', + '🐍\t⚡', '🐍⚡\n\t\t🐍\t', 'ab\rab\t\t\tab\r\n\ta'] + + for s in cases: + for tabsize in range(-1, 10): + for fn, msg in zip(fns, messages): + self.assertEqual(fn.py_func(s, tabsize), fn(s, tabsize), + msg=msg.format(s, tabsize)) + + def test_expandtabs_exception_noninteger_tabsize(self): + pyfunc = expandtabs_with_tabsize_usecase + cfunc = njit(pyfunc) + + accepted_types = (types.Integer, int) + with self.assertRaises(TypingError) as raises: + cfunc('\t', 2.4) + msg = '"tabsize" must be {}, not float'.format(accepted_types) + self.assertIn(msg, str(raises.exception)) + + def test_startswith_default(self): + pyfunc = startswith_usecase + cfunc = njit(pyfunc) + + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for prefix in cpython_subs + default_subs + extra_subs: + self.assertEqual(pyfunc(s, prefix), cfunc(s, prefix)) + + def test_startswith_with_start(self): + pyfunc = startswith_with_start_only_usecase + cfunc = njit(pyfunc) + + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for prefix in cpython_subs + default_subs + extra_subs: + for start in list(range(-20, 20)) + [None]: + self.assertEqual(pyfunc(s, prefix, start), + cfunc(s, prefix, start)) + + def test_startswith_with_start_end(self): + pyfunc = startswith_with_start_end_usecase + cfunc = njit(pyfunc) + + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for prefix in cpython_subs + default_subs + extra_subs: + for start in list(range(-20, 20)) + [None]: + for end in list(range(-20, 20)) + [None]: + self.assertEqual(pyfunc(s, prefix, start, end), + cfunc(s, prefix, start, end)) + + def test_startswith_exception_invalid_args(self): + msg_invalid_prefix = \ + "The arg 'prefix' should be a string or a tuple of strings" + with self.assertRaisesRegex(TypingError, msg_invalid_prefix): + cfunc = njit(startswith_usecase) + cfunc("hello", (1, "he")) + + msg_invalid_start = \ + "When specified, the arg 'start' must be an Integer or None" + with self.assertRaisesRegex(TypingError, msg_invalid_start): + cfunc = njit(startswith_with_start_only_usecase) + cfunc("hello", "he", "invalid start") + + msg_invalid_end = \ + "When specified, the arg 'end' must be an Integer or None" + with self.assertRaisesRegex(TypingError, msg_invalid_end): + cfunc = njit(startswith_with_start_end_usecase) + cfunc("hello", "he", 0, "invalid end") + + def test_startswith_tuple(self): + pyfunc = startswith_usecase + cfunc = njit(pyfunc) + + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for sub_str in cpython_subs + default_subs + extra_subs: + prefix = (sub_str, 'lo') + self.assertEqual(pyfunc(s, prefix), + cfunc(s, prefix)) + + def test_startswith_tuple_args(self): + pyfunc = startswith_with_start_end_usecase + cfunc = njit(pyfunc) + + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for sub_str in cpython_subs + default_subs + extra_subs: + for start in list(range(-20, 20)) + [None]: + for end in list(range(-20, 20)) + [None]: + prefix = (sub_str, 'lo') + self.assertEqual(pyfunc(s, prefix, start, end), + cfunc(s, prefix, start, end)) + + def test_endswith_default(self): + pyfunc = endswith_usecase + cfunc = njit(pyfunc) + + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/865c3b257fe38154a4320c7ee6afb416f665b9c2/Lib/test/string_tests.py#L1049-L1099 # noqa: E501 + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for sub_str in cpython_subs + default_subs + extra_subs: + msg = 'Results "{}".endswith("{}") must be equal' + self.assertEqual(pyfunc(s, sub_str), cfunc(s, sub_str), + msg=msg.format(s, sub_str)) + + def test_endswith_with_start(self): + pyfunc = endswith_with_start_only_usecase + cfunc = njit(pyfunc) + + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/865c3b257fe38154a4320c7ee6afb416f665b9c2/Lib/test/string_tests.py#L1049-L1099 # noqa: E501 + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for sub_str in cpython_subs + default_subs + extra_subs: + for start in list(range(-20, 20)) + [None]: + msg = 'Results "{}".endswith("{}", {}) must be equal' + self.assertEqual(pyfunc(s, sub_str, start), + cfunc(s, sub_str, start), + msg=msg.format(s, sub_str, start)) + + def test_endswith_with_start_end(self): + pyfunc = endswith_with_start_end_usecase + cfunc = njit(pyfunc) + + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/865c3b257fe38154a4320c7ee6afb416f665b9c2/Lib/test/string_tests.py#LL1049-L1099 # noqa: E501 + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for sub_str in cpython_subs + default_subs + extra_subs: + for start in list(range(-20, 20)) + [None]: + for end in list(range(-20, 20)) + [None]: + msg = 'Results "{}".endswith("{}", {}, {})\ + must be equal' + self.assertEqual(pyfunc(s, sub_str, start, end), + cfunc(s, sub_str, start, end), + msg=msg.format(s, sub_str, start, end)) + + def test_endswith_tuple(self): + pyfunc = endswith_usecase + cfunc = njit(pyfunc) + + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/865c3b257fe38154a4320c7ee6afb416f665b9c2/Lib/test/string_tests.py#L1049-L1099 # noqa: E501 + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for sub_str in cpython_subs + default_subs + extra_subs: + msg = 'Results "{}".endswith({}) must be equal' + tuple_subs = (sub_str, 'lo') + self.assertEqual(pyfunc(s, tuple_subs), + cfunc(s, tuple_subs), + msg=msg.format(s, tuple_subs)) + + def test_endswith_tuple_args(self): + pyfunc = endswith_with_start_end_usecase + cfunc = njit(pyfunc) + + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/865c3b257fe38154a4320c7ee6afb416f665b9c2/Lib/test/string_tests.py#L1049-L1099 # noqa: E501 + cpython_str = ['hello', 'helloworld', ''] + cpython_subs = [ + 'he', 'hello', 'helloworld', 'ello', + '', 'lowo', 'lo', 'he', 'lo', 'o', + ] + extra_subs = ['hellohellohello', ' '] + for s in cpython_str + UNICODE_EXAMPLES: + default_subs = ['', 'x', s[:-2], s[3:], s, s + s] + for sub_str in cpython_subs + default_subs + extra_subs: + for start in list(range(-20, 20)) + [None]: + for end in list(range(-20, 20)) + [None]: + msg = 'Results "{}".endswith("{}", {}, {})\ + must be equal' + tuple_subs = (sub_str, 'lo') + self.assertEqual(pyfunc(s, tuple_subs, start, end), + cfunc(s, tuple_subs, start, end), + msg=msg.format(s, tuple_subs, + start, end)) + + def test_in(self, flags=no_pyobj_flags): + pyfunc = in_usecase + cfunc = njit(pyfunc) + for a in UNICODE_EXAMPLES: + extras = ['', 'xx', a[::-1], a[:-2], a[3:], a, a + a] + for substr in extras: + self.assertEqual(pyfunc(substr, a), + cfunc(substr, a), + "'%s' in '%s'?" % (substr, a)) + + def test_partition_exception_invalid_sep(self): + self.disable_leak_check() + + pyfunc = partition_usecase + cfunc = njit(pyfunc) + + # Handle empty separator exception + for func in [pyfunc, cfunc]: + with self.assertRaises(ValueError) as raises: + func('a', '') + self.assertIn('empty separator', str(raises.exception)) + + accepted_types = (types.UnicodeType, types.UnicodeCharSeq) + with self.assertRaises(TypingError) as raises: + cfunc('a', None) + msg = '"sep" must be {}, not none'.format(accepted_types) + self.assertIn(msg, str(raises.exception)) + + def test_partition(self): + pyfunc = partition_usecase + cfunc = njit(pyfunc) + + CASES = [ + ('', '⚡'), + ('abcabc', '⚡'), + ('🐍⚡', '⚡'), + ('🐍⚡🐍', '⚡'), + ('abababa', 'a'), + ('abababa', 'b'), + ('abababa', 'c'), + ('abababa', 'ab'), + ('abababa', 'aba'), + ] + msg = 'Results of "{}".partition("{}") must be equal' + for s, sep in CASES: + self.assertEqual(pyfunc(s, sep), cfunc(s, sep), + msg=msg.format(s, sep)) + + def test_find(self, flags=no_pyobj_flags): + pyfunc = find_usecase + cfunc = njit(pyfunc) + + default_subs = [ + (s, ['', 'xx', s[:-2], s[3:], s]) for s in UNICODE_EXAMPLES + ] + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L202-L231 # noqa: E501 + cpython_subs = [ + ('a' * 100 + '\u0102', ['\u0102', '\u0201', '\u0120', '\u0220']), + ('a' * 100 + '\U00100304', ['\U00100304', '\U00100204', + '\U00102004']), + ('\u0102' * 100 + 'a', ['a']), + ('\U00100304' * 100 + 'a', ['a']), + ('\U00100304' * 100 + '\u0102', ['\u0102']), + ('a' * 100, ['\u0102', '\U00100304', 'a\u0102', 'a\U00100304']), + ('\u0102' * 100, ['\U00100304', '\u0102\U00100304']), + ('\u0102' * 100 + 'a_', ['a_']), + ('\U00100304' * 100 + 'a_', ['a_']), + ('\U00100304' * 100 + '\u0102_', ['\u0102_']), + ] + for s, subs in default_subs + cpython_subs: + for sub_str in subs: + msg = 'Results "{}".find("{}") must be equal' + self.assertEqual(pyfunc(s, sub_str), cfunc(s, sub_str), + msg=msg.format(s, sub_str)) + + def test_find_with_start_only(self): + pyfunc = find_with_start_only_usecase + cfunc = njit(pyfunc) + + for s in UNICODE_EXAMPLES: + for sub_str in ['', 'xx', s[:-2], s[3:], s]: + for start in list(range(-20, 20)) + [None]: + msg = 'Results "{}".find("{}", {}) must be equal' + self.assertEqual(pyfunc(s, sub_str, start), + cfunc(s, sub_str, start), + msg=msg.format(s, sub_str, start)) + + def test_find_with_start_end(self): + pyfunc = find_with_start_end_usecase + cfunc = njit(pyfunc) + + starts = ends = list(range(-20, 20)) + [None] + for s in UNICODE_EXAMPLES: + for sub_str in ['', 'xx', s[:-2], s[3:], s]: + for start, end in product(starts, ends): + msg = 'Results of "{}".find("{}", {}, {}) must be equal' + self.assertEqual(pyfunc(s, sub_str, start, end), + cfunc(s, sub_str, start, end), + msg=msg.format(s, sub_str, start, end)) + + def test_find_exception_noninteger_start_end(self): + pyfunc = find_with_start_end_usecase + cfunc = njit(pyfunc) + + accepted = (types.Integer, types.NoneType) + for start, end, name in [(0.1, 5, 'start'), (0, 0.5, 'end')]: + with self.assertRaises(TypingError) as raises: + cfunc('ascii', 'sci', start, end) + msg = '"{}" must be {}, not float'.format(name, accepted) + self.assertIn(msg, str(raises.exception)) + + def test_rpartition_exception_invalid_sep(self): + self.disable_leak_check() + + pyfunc = rpartition_usecase + cfunc = njit(pyfunc) + + # Handle empty separator exception + for func in [pyfunc, cfunc]: + with self.assertRaises(ValueError) as raises: + func('a', '') + self.assertIn('empty separator', str(raises.exception)) + + accepted_types = (types.UnicodeType, types.UnicodeCharSeq) + with self.assertRaises(TypingError) as raises: + cfunc('a', None) + msg = '"sep" must be {}, not none'.format(accepted_types) + self.assertIn(msg, str(raises.exception)) + + def test_rpartition(self): + pyfunc = rpartition_usecase + cfunc = njit(pyfunc) + + CASES = [ + ('', '⚡'), + ('abcabc', '⚡'), + ('🐍⚡', '⚡'), + ('🐍⚡🐍', '⚡'), + ('abababa', 'a'), + ('abababa', 'b'), + ('abababa', 'c'), + ('abababa', 'ab'), + ('abababa', 'aba'), + ] + msg = 'Results of "{}".rpartition("{}") must be equal' + for s, sep in CASES: + self.assertEqual(pyfunc(s, sep), cfunc(s, sep), + msg=msg.format(s, sep)) + + def test_count(self): + pyfunc = count_usecase + cfunc = njit(pyfunc) + error_msg = "'{0}'.py_count('{1}') = {2}\n'{0}'.c_count('{1}') = {3}" + + for s, sub in UNICODE_COUNT_EXAMPLES: + py_result = pyfunc(s, sub) + c_result = cfunc(s, sub) + self.assertEqual(py_result, c_result, + error_msg.format(s, sub, py_result, c_result)) + + def test_count_with_start(self): + pyfunc = count_with_start_usecase + cfunc = njit(pyfunc) + error_msg = "%s\n%s" % ("'{0}'.py_count('{1}', {2}) = {3}", + "'{0}'.c_count('{1}', {2}) = {4}") + + for s, sub in UNICODE_COUNT_EXAMPLES: + for i in range(-18, 18): + py_result = pyfunc(s, sub, i) + c_result = cfunc(s, sub, i) + self.assertEqual(py_result, c_result, + error_msg.format(s, sub, i, py_result, + c_result)) + + py_result = pyfunc(s, sub, None) + c_result = cfunc(s, sub, None) + self.assertEqual(py_result, c_result, + error_msg.format(s, sub, None, py_result, + c_result)) + + def test_count_with_start_end(self): + pyfunc = count_with_start_end_usecase + cfunc = njit(pyfunc) + error_msg = "%s\n%s" % ("'{0}'.py_count('{1}', {2}, {3}) = {4}", + "'{0}'.c_count('{1}', {2}, {3}) = {5}") + + for s, sub in UNICODE_COUNT_EXAMPLES: + for i, j in product(range(-18, 18), (-18, 18)): + py_result = pyfunc(s, sub, i, j) + c_result = cfunc(s, sub, i, j) + self.assertEqual(py_result, c_result, + error_msg.format(s, sub, i, j, py_result, + c_result)) + + for j in range(-18, 18): + py_result = pyfunc(s, sub, None, j) + c_result = cfunc(s, sub, None, j) + self.assertEqual(py_result, c_result, + error_msg.format(s, sub, None, j, py_result, + c_result)) + + py_result = pyfunc(s, sub, None, None) + c_result = cfunc(s, sub, None, None) + self.assertEqual(py_result, c_result, + error_msg.format(s, sub, None, None, py_result, + c_result)) + + def test_count_arg_type_check(self): + cfunc = njit(count_with_start_end_usecase) + + with self.assertRaises(TypingError) as raises: + cfunc('ascii', 'c', 1, 0.5) + self.assertIn('The slice indices must be an Integer or None', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc('ascii', 'c', 1.2, 7) + self.assertIn('The slice indices must be an Integer or None', + str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc('ascii', 12, 1, 7) + self.assertIn('The substring must be a UnicodeType, not', + str(raises.exception)) + + def test_count_optional_arg_type_check(self): + pyfunc = count_with_start_end_usecase + + def try_compile_bad_optional(*args): + bad_sig = types.int64(types.unicode_type, + types.unicode_type, + types.Optional(types.float64), + types.Optional(types.float64)) + njit([bad_sig])(pyfunc) + + with self.assertRaises(TypingError) as raises: + try_compile_bad_optional('tú quis?', 'tú', 1.1, 1.1) + self.assertIn('The slice indices must be an Integer or None', + str(raises.exception)) + + error_msg = "%s\n%s" % ("'{0}'.py_count('{1}', {2}, {3}) = {4}", + "'{0}'.c_count_op('{1}', {2}, {3}) = {5}") + sig_optional = types.int64(types.unicode_type, + types.unicode_type, + types.Optional(types.int64), + types.Optional(types.int64)) + cfunc_optional = njit([sig_optional])(pyfunc) + + py_result = pyfunc('tú quis?', 'tú', 0, 8) + c_result = cfunc_optional('tú quis?', 'tú', 0, 8) + self.assertEqual(py_result, c_result, + error_msg.format('tú quis?', 'tú', 0, 8, py_result, + c_result)) + + def test_rfind(self): + pyfunc = rfind_usecase + cfunc = njit(pyfunc) + + default_subs = [ + (s, ['', 'xx', s[:-2], s[3:], s]) for s in UNICODE_EXAMPLES + ] + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L233-L259 # noqa: E501 + cpython_subs = [ + ('\u0102' + 'a' * 100, ['\u0102', '\u0201', '\u0120', '\u0220']), + ('\U00100304' + 'a' * 100, ['\U00100304', '\U00100204', + '\U00102004']), + ('abcdefghiabc', ['abc', '']), + ('a' + '\u0102' * 100, ['a']), + ('a' + '\U00100304' * 100, ['a']), + ('\u0102' + '\U00100304' * 100, ['\u0102']), + ('a' * 100, ['\u0102', '\U00100304', '\u0102a', '\U00100304a']), + ('\u0102' * 100, ['\U00100304', '\U00100304\u0102']), + ('_a' + '\u0102' * 100, ['_a']), + ('_a' + '\U00100304' * 100, ['_a']), + ('_\u0102' + '\U00100304' * 100, ['_\u0102']), + ] + for s, subs in default_subs + cpython_subs: + for sub_str in subs: + msg = 'Results "{}".rfind("{}") must be equal' + self.assertEqual(pyfunc(s, sub_str), cfunc(s, sub_str), + msg=msg.format(s, sub_str)) + + def test_rfind_with_start_only(self): + pyfunc = rfind_with_start_only_usecase + cfunc = njit(pyfunc) + + for s in UNICODE_EXAMPLES: + for sub_str in ['', 'xx', s[:-2], s[3:], s]: + for start in list(range(-20, 20)) + [None]: + msg = 'Results "{}".rfind("{}", {}) must be equal' + self.assertEqual(pyfunc(s, sub_str, start), + cfunc(s, sub_str, start), + msg=msg.format(s, sub_str, start)) + + def test_rfind_with_start_end(self): + pyfunc = rfind_with_start_end_usecase + cfunc = njit(pyfunc) + + starts = list(range(-20, 20)) + [None] + ends = list(range(-20, 20)) + [None] + for s in UNICODE_EXAMPLES: + for sub_str in ['', 'xx', s[:-2], s[3:], s]: + for start, end in product(starts, ends): + msg = 'Results of "{}".rfind("{}", {}, {}) must be equal' + self.assertEqual(pyfunc(s, sub_str, start, end), + cfunc(s, sub_str, start, end), + msg=msg.format(s, sub_str, start, end)) + + def test_rfind_wrong_substr(self): + cfunc = njit(rfind_usecase) + + for s in UNICODE_EXAMPLES: + for sub_str in [None, 1, False]: + with self.assertRaises(TypingError) as raises: + cfunc(s, sub_str) + msg = 'must be {}'.format(types.UnicodeType) + self.assertIn(msg, str(raises.exception)) + + def test_rfind_wrong_start_end(self): + cfunc = njit(rfind_with_start_end_usecase) + + accepted_types = (types.Integer, types.NoneType) + for s in UNICODE_EXAMPLES: + for sub_str in ['', 'xx', s[:-2], s[3:], s]: + # test wrong start + for start, end in product([0.1, False], [-1, 1]): + with self.assertRaises(TypingError) as raises: + cfunc(s, sub_str, start, end) + msg = '"start" must be {}'.format(accepted_types) + self.assertIn(msg, str(raises.exception)) + + # test wrong end + for start, end in product([-1, 1], [-0.1, True]): + with self.assertRaises(TypingError) as raises: + cfunc(s, sub_str, start, end) + msg = '"end" must be {}'.format(accepted_types) + self.assertIn(msg, str(raises.exception)) + + def test_rfind_wrong_start_end_optional(self): + s = UNICODE_EXAMPLES[0] + sub_str = s[1:-1] + accepted_types = (types.Integer, types.NoneType) + msg = 'must be {}'.format(accepted_types) + + def try_compile_wrong_start_optional(*args): + wrong_sig_optional = types.int64(types.unicode_type, + types.unicode_type, + types.Optional(types.float64), + types.Optional(types.intp)) + njit([wrong_sig_optional])(rfind_with_start_end_usecase) + + with self.assertRaises(TypingError) as raises: + try_compile_wrong_start_optional(s, sub_str, 0.1, 1) + self.assertIn(msg, str(raises.exception)) + + def try_compile_wrong_end_optional(*args): + wrong_sig_optional = types.int64(types.unicode_type, + types.unicode_type, + types.Optional(types.intp), + types.Optional(types.float64)) + njit([wrong_sig_optional])(rfind_with_start_end_usecase) + + with self.assertRaises(TypingError) as raises: + try_compile_wrong_end_optional(s, sub_str, 1, 0.1) + self.assertIn(msg, str(raises.exception)) + + def test_rindex(self): + pyfunc = rindex_usecase + cfunc = njit(pyfunc) + + default_subs = [ + (s, ['', s[:-2], s[3:], s]) for s in UNICODE_EXAMPLES + ] + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L284-L308 # noqa: E501 + cpython_subs = [ + ('abcdefghiabc', ['', 'def', 'abc']), + ('a' + '\u0102' * 100, ['a']), + ('a' + '\U00100304' * 100, ['a']), + ('\u0102' + '\U00100304' * 100, ['\u0102']), + ('_a' + '\u0102' * 100, ['_a']), + ('_a' + '\U00100304' * 100, ['_a']), + ('_\u0102' + '\U00100304' * 100, ['_\u0102']) + ] + for s, subs in default_subs + cpython_subs: + for sub_str in subs: + msg = 'Results "{}".rindex("{}") must be equal' + self.assertEqual(pyfunc(s, sub_str), cfunc(s, sub_str), + msg=msg.format(s, sub_str)) + + def test_index(self): + pyfunc = index_usecase + cfunc = njit(pyfunc) + + default_subs = [ + (s, ['', s[:-2], s[3:], s]) for s in UNICODE_EXAMPLES + ] + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L260-L282 # noqa: E501 + cpython_subs = [ + ('abcdefghiabc', ['', 'def', 'abc']), + ('\u0102' * 100 + 'a', ['a']), + ('\U00100304' * 100 + 'a', ['a']), + ('\U00100304' * 100 + '\u0102', ['\u0102']), + ('\u0102' * 100 + 'a_', ['a_']), + ('\U00100304' * 100 + 'a_', ['a_']), + ('\U00100304' * 100 + '\u0102_', ['\u0102_']) + ] + for s, subs in default_subs + cpython_subs: + for sub_str in subs: + msg = 'Results "{}".index("{}") must be equal' + self.assertEqual(pyfunc(s, sub_str), cfunc(s, sub_str), + msg=msg.format(s, sub_str)) + + def test_index_rindex_with_start_only(self): + pyfuncs = [index_with_start_only_usecase, + rindex_with_start_only_usecase] + messages = ['Results "{}".index("{}", {}) must be equal', + 'Results "{}".rindex("{}", {}) must be equal'] + unicode_examples = [ + 'ascii', + '12345', + '1234567890', + '¡Y tú quién te crees?', + '大处着眼,小处着手。', + ] + for pyfunc, msg in zip(pyfuncs, messages): + cfunc = njit(pyfunc) + for s in unicode_examples: + l = len(s) + cases = [ + ('', list(range(-10, l + 1))), + (s[:-2], [0] + list(range(-10, 1 - l))), + (s[3:], list(range(4)) + list(range(-10, 4 - l))), + (s, [0] + list(range(-10, 1 - l))), + ] + for sub_str, starts in cases: + for start in starts + [None]: + self.assertEqual(pyfunc(s, sub_str, start), + cfunc(s, sub_str, start), + msg=msg.format(s, sub_str, start)) + + def test_index_rindex_with_start_end(self): + pyfuncs = [index_with_start_end_usecase, rindex_with_start_end_usecase] + messages = ['Results of "{}".index("{}", {}, {}) must be equal', + 'Results of "{}".rindex("{}", {}, {}) must be equal'] + unicode_examples = [ + 'ascii', + '12345', + '1234567890', + '¡Y tú quién te crees?', + '大处着眼,小处着手。', + ] + for pyfunc, msg in zip(pyfuncs, messages): + cfunc = njit(pyfunc) + for s in unicode_examples: + l = len(s) + cases = [ + ('', list(range(-10, l + 1)), list(range(l, 10))), + (s[:-2], [0] + list(range(-10, 1 - l)), + [-2, -1] + list(range(l - 2, 10))), + (s[3:], list(range(4)) + list(range(-10, -1)), + list(range(l, 10))), + (s, [0] + list(range(-10, 1 - l)), list(range(l, 10))), + ] + for sub_str, starts, ends in cases: + for start, end in product(starts + [None], ends): + self.assertEqual(pyfunc(s, sub_str, start, end), + cfunc(s, sub_str, start, end), + msg=msg.format(s, sub_str, start, end)) + + def test_index_rindex_exception_substring_not_found(self): + self.disable_leak_check() + + unicode_examples = [ + 'ascii', + '12345', + '1234567890', + '¡Y tú quién te crees?', + '大处着眼,小处着手。', + ] + pyfuncs = [index_with_start_end_usecase, rindex_with_start_end_usecase] + for pyfunc in pyfuncs: + cfunc = njit(pyfunc) + for s in unicode_examples: + l = len(s) + cases = [ + ('', list(range(l + 1, 10)), [l]), + (s[:-2], [0], list(range(l - 2))), + (s[3:], list(range(4, 10)), [l]), + (s, [None], list(range(l))), + ] + for sub_str, starts, ends in cases: + for start, end in product(starts, ends): + for func in [pyfunc, cfunc]: + with self.assertRaises(ValueError) as raises: + func(s, sub_str, start, end) + msg = 'substring not found' + self.assertIn(msg, str(raises.exception)) + + def test_index_rindex_exception_noninteger_start_end(self): + accepted = (types.Integer, types.NoneType) + pyfuncs = [index_with_start_end_usecase, rindex_with_start_end_usecase] + for pyfunc in pyfuncs: + cfunc = njit(pyfunc) + for start, end, name in [(0.1, 5, 'start'), (0, 0.5, 'end')]: + with self.assertRaises(TypingError) as raises: + cfunc('ascii', 'sci', start, end) + msg = '"{}" must be {}, not float'.format(name, accepted) + self.assertIn(msg, str(raises.exception)) + + def test_getitem(self): + pyfunc = getitem_usecase + cfunc = njit(pyfunc) + + for s in UNICODE_EXAMPLES: + for i in range(-len(s), len(s)): + self.assertEqual(pyfunc(s, i), + cfunc(s, i), + "'%s'[%d]?" % (s, i)) + + def test_getitem_scalar_kind(self): + # See issue #6135, make sure that getitem returns a char of the minimal + # kind required to represent the "got" item, this is done via the use + # of `hash` in the test function as it is sensitive to kind. + pyfunc = getitem_check_kind_usecase + cfunc = njit(pyfunc) + samples = ['a\u1234', '¡着'] + for s in samples: + for i in range(-len(s), len(s)): + self.assertEqual(pyfunc(s, i), + cfunc(s, i), + "'%s'[%d]?" % (s, i)) + + def test_getitem_error(self): + self.disable_leak_check() + + pyfunc = getitem_usecase + cfunc = njit(pyfunc) + + for s in UNICODE_EXAMPLES: + with self.assertRaises(IndexError) as raises: + pyfunc(s, len(s)) + self.assertIn('string index out of range', str(raises.exception)) + + with self.assertRaises(IndexError) as raises: + cfunc(s, len(s)) + self.assertIn('string index out of range', str(raises.exception)) + + def test_slice2(self): + pyfunc = getitem_usecase + cfunc = njit(pyfunc) + + for s in UNICODE_EXAMPLES: + for i in list(range(-len(s), len(s))): + for j in list(range(-len(s), len(s))): + sl = slice(i, j) + self.assertEqual(pyfunc(s, sl), + cfunc(s, sl), + "'%s'[%d:%d]?" % (s, i, j)) + + def test_slice2_error(self): + pyfunc = getitem_usecase + cfunc = njit(pyfunc) + + for s in UNICODE_EXAMPLES: + for i in [-2, -1, len(s), len(s) + 1]: + for j in [-2, -1, len(s), len(s) + 1]: + sl = slice(i, j) + self.assertEqual(pyfunc(s, sl), + cfunc(s, sl), + "'%s'[%d:%d]?" % (s, i, j)) + + def test_getitem_slice2_kind(self): + # See issue #6135. Also see note in test_getitem_scalar_kind regarding + # testing. + pyfunc = getitem_check_kind_usecase + cfunc = njit(pyfunc) + samples = ['abc\u1234\u1234', '¡¡¡着着着'] + for s in samples: + for i in [-2, -1, 0, 1, 2, len(s), len(s) + 1]: + for j in [-2, -1, 0, 1, 2, len(s), len(s) + 1]: + sl = slice(i, j) + self.assertEqual(pyfunc(s, sl), + cfunc(s, sl), + "'%s'[%d:%d]?" % (s, i, j)) + + def test_slice3(self): + pyfunc = getitem_usecase + cfunc = njit(pyfunc) + + for s in UNICODE_EXAMPLES: + for i in range(-len(s), len(s)): + for j in range(-len(s), len(s)): + for k in [-2, -1, 1, 2]: + sl = slice(i, j, k) + self.assertEqual(pyfunc(s, sl), + cfunc(s, sl), + "'%s'[%d:%d:%d]?" % (s, i, j, k)) + + def test_getitem_slice3_kind(self): + # See issue #6135. Also see note in test_getitem_scalar_kind regarding + # testing. + pyfunc = getitem_check_kind_usecase + cfunc = njit(pyfunc) + samples = ['abc\u1234\u1234', + 'a\u1234b\u1234c' + '¡¡¡着着着', + '¡着¡着¡着', + '着a着b着c', + '¡着a¡着b¡着c', + '¡着a着¡c',] + for s in samples: + for i in range(-len(s), len(s)): + for j in range(-len(s), len(s)): + for k in [-2, -1, 1, 2]: + sl = slice(i, j, k) + self.assertEqual(pyfunc(s, sl), + cfunc(s, sl), + "'%s'[%d:%d:%d]?" % (s, i, j, k)) + + def test_slice3_error(self): + pyfunc = getitem_usecase + cfunc = njit(pyfunc) + + for s in UNICODE_EXAMPLES: + for i in [-2, -1, len(s), len(s) + 1]: + for j in [-2, -1, len(s), len(s) + 1]: + for k in [-2, -1, 1, 2]: + sl = slice(i, j, k) + self.assertEqual(pyfunc(s, sl), + cfunc(s, sl), + "'%s'[%d:%d:%d]?" % (s, i, j, k)) + + def test_slice_ascii_flag(self): + """ + Make sure ascii flag is False when ascii and non-ascii characters are + mixed in output of Unicode slicing. + """ + @njit + def f(s): + return s[::2]._is_ascii, s[1::2]._is_ascii + + s = "¿abc¡Y tú, quién te cre\t\tes?" + self.assertEqual(f(s), (0, 1)) + + def test_zfill(self): + pyfunc = zfill_usecase + cfunc = njit(pyfunc) + + ZFILL_INPUTS = [ + 'ascii', + '+ascii', + '-ascii', + '-asc ii-', + '12345', + '-12345', + '+12345', + '', + '¡Y tú crs?', + '🐍⚡', + '+🐍⚡', + '-🐍⚡', + '大眼,小手。', + '+大眼,小手。', + '-大眼,小手。', + ] + + with self.assertRaises(TypingError) as raises: + cfunc(ZFILL_INPUTS[0], 1.1) + self.assertIn(' must be an Integer', str(raises.exception)) + + for s in ZFILL_INPUTS: + for width in range(-3, 20): + self.assertEqual(pyfunc(s, width), + cfunc(s, width)) + + def test_concat(self, flags=no_pyobj_flags): + pyfunc = concat_usecase + cfunc = njit(pyfunc) + for a in UNICODE_EXAMPLES: + for b in UNICODE_EXAMPLES[::-1]: + self.assertEqual(pyfunc(a, b), + cfunc(a, b), + "'%s' + '%s'?" % (a, b)) + + def test_repeat(self, flags=no_pyobj_flags): + pyfunc = repeat_usecase + cfunc = njit(pyfunc) + for a in UNICODE_EXAMPLES: + for b in (-1, 0, 1, 2, 3, 4, 5, 7, 8, 15, 70): + self.assertEqual(pyfunc(a, b), + cfunc(a, b)) + self.assertEqual(pyfunc(b, a), + cfunc(b, a)) + + def test_repeat_exception_float(self): + self.disable_leak_check() + cfunc = njit(repeat_usecase) + with self.assertRaises(TypingError) as raises: + cfunc('hi', 2.5) + self.assertIn(_header_lead + ' Function()', + str(raises.exception)) + + def test_split_exception_empty_sep(self): + self.disable_leak_check() + + pyfunc = split_usecase + cfunc = njit(pyfunc) + + # Handle empty separator exception + for func in [pyfunc, cfunc]: + with self.assertRaises(ValueError) as raises: + func('a', '') + self.assertIn('empty separator', str(raises.exception)) + + def test_split_exception_noninteger_maxsplit(self): + pyfunc = split_with_maxsplit_usecase + cfunc = njit(pyfunc) + + # Handle non-integer maxsplit exception + for sep in [' ', None]: + with self.assertRaises(TypingError) as raises: + cfunc('a', sep, 2.4) + self.assertIn('float64', str(raises.exception), + 'non-integer maxsplit with sep = %s' % sep) + + def test_split(self): + pyfunc = split_usecase + cfunc = njit(pyfunc) + + CASES = [ + (' a ', None), + ('', '⚡'), + ('abcabc', '⚡'), + ('🐍⚡', '⚡'), + ('🐍⚡🐍', '⚡'), + ('abababa', 'a'), + ('abababa', 'b'), + ('abababa', 'c'), + ('abababa', 'ab'), + ('abababa', 'aba'), + ] + + for test_str, splitter in CASES: + self.assertEqual(pyfunc(test_str, splitter), + cfunc(test_str, splitter), + "'%s'.split('%s')?" % (test_str, splitter)) + + def test_split_with_maxsplit(self): + CASES = [ + (' a ', None, 1), + ('', '⚡', 1), + ('abcabc', '⚡', 1), + ('🐍⚡', '⚡', 1), + ('🐍⚡🐍', '⚡', 1), + ('abababa', 'a', 2), + ('abababa', 'b', 1), + ('abababa', 'c', 2), + ('abababa', 'ab', 1), + ('abababa', 'aba', 5), + ] + + for pyfunc, fmt_str in [(split_with_maxsplit_usecase, + "'%s'.split('%s', %d)?"), + (split_with_maxsplit_kwarg_usecase, + "'%s'.split('%s', maxsplit=%d)?")]: + + cfunc = njit(pyfunc) + for test_str, splitter, maxsplit in CASES: + self.assertEqual(pyfunc(test_str, splitter, maxsplit), + cfunc(test_str, splitter, maxsplit), + fmt_str % (test_str, splitter, maxsplit)) + + def test_split_whitespace(self): + # explicit sep=None cases covered in test_split and + # test_split_with_maxsplit + pyfunc = split_whitespace_usecase + cfunc = njit(pyfunc) + + # list copied from + # https://github.com/python/cpython/blob/master/Objects/unicodetype_db.h + all_whitespace = ''.join(map(chr, [ + 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x001C, 0x001D, 0x001E, + 0x001F, 0x0020, 0x0085, 0x00A0, 0x1680, 0x2000, 0x2001, 0x2002, + 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, + 0x2028, 0x2029, 0x202F, 0x205F, 0x3000 + ])) + + CASES = [ + '', + 'abcabc', + '🐍 ⚡', + '🐍 ⚡ 🐍', + '🐍 ⚡ 🐍 ', + ' 🐍 ⚡ 🐍', + ' 🐍' + all_whitespace + '⚡ 🐍 ', + ] + for test_str in CASES: + self.assertEqual(pyfunc(test_str), + cfunc(test_str), + "'%s'.split()?" % (test_str,)) + + def test_split_exception_invalid_keepends(self): + pyfunc = splitlines_with_keepends_usecase + cfunc = njit(pyfunc) + + accepted_types = (types.Integer, int, types.Boolean, bool) + for ty, keepends in (('none', None), ('unicode_type', 'None')): + with self.assertRaises(TypingError) as raises: + cfunc('\n', keepends) + msg = '"keepends" must be {}, not {}'.format(accepted_types, ty) + self.assertIn(msg, str(raises.exception)) + + def test_splitlines(self): + pyfunc = splitlines_usecase + cfunc = njit(pyfunc) + + cases = ['', '\n', 'abc\r\rabc\r\n', '🐍⚡\v', '\f🐍⚡\f\v\v🐍\x85', + '\u2028aba\u2029baba', '\n\r\na\v\fb\x0b\x0cc\x1c\x1d\x1e'] + + msg = 'Results of "{}".splitlines() must be equal' + for s in cases: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_splitlines_with_keepends(self): + pyfuncs = [ + splitlines_with_keepends_usecase, + splitlines_with_keepends_kwarg_usecase + ] + messages = [ + 'Results of "{}".splitlines({}) must be equal', + 'Results of "{}".splitlines(keepends={}) must be equal' + ] + cases = ['', '\n', 'abc\r\rabc\r\n', '🐍⚡\v', '\f🐍⚡\f\v\v🐍\x85', + '\u2028aba\u2029baba', '\n\r\na\v\fb\x0b\x0cc\x1c\x1d\x1e'] + all_keepends = [True, False, 0, 1, -1, 100] + + for pyfunc, msg in zip(pyfuncs, messages): + cfunc = njit(pyfunc) + for s, keepends in product(cases, all_keepends): + self.assertEqual(pyfunc(s, keepends), cfunc(s, keepends), + msg=msg.format(s, keepends)) + + def test_rsplit_exception_empty_sep(self): + self.disable_leak_check() + + pyfunc = rsplit_usecase + cfunc = njit(pyfunc) + + # Handle empty separator exception + for func in [pyfunc, cfunc]: + with self.assertRaises(ValueError) as raises: + func('a', '') + self.assertIn('empty separator', str(raises.exception)) + + def test_rsplit_exception_noninteger_maxsplit(self): + pyfunc = rsplit_with_maxsplit_usecase + cfunc = njit(pyfunc) + + accepted_types = (types.Integer, int) + for sep in [' ', None]: + with self.assertRaises(TypingError) as raises: + cfunc('a', sep, 2.4) + msg = '"maxsplit" must be {}, not float'.format(accepted_types) + self.assertIn(msg, str(raises.exception)) + + def test_rsplit(self): + pyfunc = rsplit_usecase + cfunc = njit(pyfunc) + + CASES = [ + (' a ', None), + ('', '⚡'), + ('abcabc', '⚡'), + ('🐍⚡', '⚡'), + ('🐍⚡🐍', '⚡'), + ('abababa', 'a'), + ('abababa', 'b'), + ('abababa', 'c'), + ('abababa', 'ab'), + ('abababa', 'aba'), + ] + msg = 'Results of "{}".rsplit("{}") must be equal' + for s, sep in CASES: + self.assertEqual(pyfunc(s, sep), cfunc(s, sep), + msg=msg.format(s, sep)) + + def test_rsplit_with_maxsplit(self): + pyfuncs = [rsplit_with_maxsplit_usecase, + rsplit_with_maxsplit_kwarg_usecase] + CASES = [ + (' a ', None, 1), + ('', '⚡', 1), + ('abcabc', '⚡', 1), + ('🐍⚡', '⚡', 1), + ('🐍⚡🐍', '⚡', 1), + ('abababa', 'a', 2), + ('abababa', 'b', 1), + ('abababa', 'c', 2), + ('abababa', 'ab', 1), + ('abababa', 'aba', 5), + ] + messages = [ + 'Results of "{}".rsplit("{}", {}) must be equal', + 'Results of "{}".rsplit("{}", maxsplit={}) must be equal' + ] + + for pyfunc, msg in zip(pyfuncs, messages): + cfunc = njit(pyfunc) + for test_str, sep, maxsplit in CASES: + self.assertEqual(pyfunc(test_str, sep, maxsplit), + cfunc(test_str, sep, maxsplit), + msg=msg.format(test_str, sep, maxsplit)) + + def test_rsplit_whitespace(self): + pyfunc = rsplit_whitespace_usecase + cfunc = njit(pyfunc) + + # list copied from + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Objects/unicodetype_db.h#L5996-L6031 # noqa: E501 + all_whitespace = ''.join(map(chr, [ + 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x001C, 0x001D, 0x001E, + 0x001F, 0x0020, 0x0085, 0x00A0, 0x1680, 0x2000, 0x2001, 0x2002, + 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, + 0x2028, 0x2029, 0x202F, 0x205F, 0x3000 + ])) + + CASES = [ + '', + 'abcabc', + '🐍 ⚡', + '🐍 ⚡ 🐍', + '🐍 ⚡ 🐍 ', + ' 🐍 ⚡ 🐍', + ' 🐍' + all_whitespace + '⚡ 🐍 ', + ] + msg = 'Results of "{}".rsplit() must be equal' + for s in CASES: + self.assertEqual(pyfunc(s), cfunc(s), msg.format(s)) + + def test_join_empty(self): + # Can't pass empty list to nopython mode, so we have to make a + # separate test case + pyfunc = join_empty_usecase + cfunc = njit(pyfunc) + + CASES = [ + '', + '🐍🐍🐍', + ] + + for sep in CASES: + self.assertEqual(pyfunc(sep), + cfunc(sep), + "'%s'.join([])?" % (sep,)) + + def test_join_non_string_exception(self): + # Verify that join of list of integers raises typing exception + pyfunc = join_usecase + cfunc = njit(pyfunc) + + # Handle empty separator exception + with self.assertRaises(TypingError) as raises: + cfunc('', [1, 2, 3]) + # This error message is obscure, but indicates the error was trapped + # in the typing of str.join() + # Feel free to change this as we update error messages. + exc_message = str(raises.exception) + self.assertIn( + "During: resolving callee type: BoundFunction", + exc_message, + ) + # could be int32 or int64 + self.assertIn("reflected list(int", exc_message) + + def test_join(self): + pyfunc = join_usecase + cfunc = njit(pyfunc) + + CASES = [ + ('', ['', '', '']), + ('a', ['', '', '']), + ('', ['a', 'bbbb', 'c']), + ('🐍🐍🐍', ['⚡⚡'] * 5), + ] + + for sep, parts in CASES: + self.assertEqual(pyfunc(sep, parts), + cfunc(sep, parts), + "'%s'.join('%s')?" % (sep, parts)) + + def test_join_interleave_str(self): + # can pass a string as the parts iterable + pyfunc = join_usecase + cfunc = njit(pyfunc) + + CASES = [ + ('abc', '123'), + ('🐍🐍🐍', '⚡⚡'), + ] + + for sep, parts in CASES: + self.assertEqual(pyfunc(sep, parts), + cfunc(sep, parts), + "'%s'.join('%s')?" % (sep, parts)) + + def test_justification(self): + for pyfunc, case_name in [(center_usecase, 'center'), + (ljust_usecase, 'ljust'), + (rjust_usecase, 'rjust')]: + cfunc = njit(pyfunc) + + with self.assertRaises(TypingError) as raises: + cfunc(UNICODE_EXAMPLES[0], 1.1) + self.assertIn('The width must be an Integer', str(raises.exception)) + + for s in UNICODE_EXAMPLES: + for width in range(-3, 20): + self.assertEqual(pyfunc(s, width), + cfunc(s, width), + "'%s'.%s(%d)?" % (s, case_name, width)) + + def test_justification_fillchar(self): + for pyfunc, case_name in [(center_usecase_fillchar, 'center'), + (ljust_usecase_fillchar, 'ljust'), + (rjust_usecase_fillchar, 'rjust')]: + cfunc = njit(pyfunc) + + # allowed fillchar cases + for fillchar in [' ', '+', 'ú', '处']: + with self.assertRaises(TypingError) as raises: + cfunc(UNICODE_EXAMPLES[0], 1.1, fillchar) + self.assertIn('The width must be an Integer', + str(raises.exception)) + + for s in UNICODE_EXAMPLES: + for width in range(-3, 20): + self.assertEqual(pyfunc(s, width, fillchar), + cfunc(s, width, fillchar), + "'%s'.%s(%d, '%s')?" % (s, case_name, + width, + fillchar)) + + def test_justification_fillchar_exception(self): + self.disable_leak_check() + + for pyfunc in [center_usecase_fillchar, + ljust_usecase_fillchar, + rjust_usecase_fillchar]: + cfunc = njit(pyfunc) + + # disallowed fillchar cases + for fillchar in ['', '+0', 'quién', '处着']: + with self.assertRaises(ValueError) as raises: + cfunc(UNICODE_EXAMPLES[0], 20, fillchar) + self.assertIn('The fill character must be exactly one', + str(raises.exception)) + + # forbid fillchar cases with different types + for fillchar in [1, 1.1]: + with self.assertRaises(TypingError) as raises: + cfunc(UNICODE_EXAMPLES[0], 20, fillchar) + self.assertIn('The fillchar must be a UnicodeType', + str(raises.exception)) + + def test_inplace_concat(self, flags=no_pyobj_flags): + pyfunc = inplace_concat_usecase + cfunc = njit(pyfunc) + for a in UNICODE_EXAMPLES: + for b in UNICODE_EXAMPLES[::-1]: + self.assertEqual(pyfunc(a, b), + cfunc(a, b), + "'%s' + '%s'?" % (a, b)) + + def test_isidentifier(self): + def pyfunc(s): + return s.isidentifier() + + cfunc = njit(pyfunc) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L695-L708 # noqa: E501 + cpython = ['a', 'Z', '_', 'b0', 'bc', 'b_', 'µ', + '𝔘𝔫𝔦𝔠𝔬𝔡𝔢', ' ', '[', '©', '0'] + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L742-L749 # noqa: E501 + cpython_extras = ['\uD800', '\uDFFF', '\uD800\uD800', '\uDFFF\uDFFF', + 'a\uD800b\uDFFF', 'a\uDFFFb\uD800', + 'a\uD800b\uDFFFa', 'a\uDFFFb\uD800a'] + + msg = 'Results of "{}".isidentifier() must be equal' + for s in UNICODE_EXAMPLES + [''] + cpython + cpython_extras: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_strip(self): + + STRIP_CASES = [ + ('ass cii', 'ai'), + ('ass cii', None), + ('asscii', 'ai '), + ('asscii ', 'ai '), + (' asscii ', 'ai '), + (' asscii ', 'asci '), + (' asscii ', 's'), + (' ', ' '), + ('', ' '), + ('', ''), + ('', None), + (' ', None), + (' asscii ', 'ai '), + (' asscii ', ''), + (' asscii ', None), + ('tú quién te crees?', 'étú? '), + (' tú quién te crees? ', 'étú? '), + (' tú qrees? ', ''), + (' tú quién te crees? ', None), + ('大处 着眼,小处着手。大大大处', '大处'), + (' 大处大处 ', ''), + ('\t\nabcd\t', '\ta'), + (' 大处大处 ', None), + ('\t abcd \t', None), + ('\n abcd \n', None), + ('\r abcd \r', None), + ('\x0b abcd \x0b', None), + ('\x0c abcd \x0c', None), + ('\u2029abcd\u205F', None), + ('\u0085abcd\u2009', None) + ] + + # form with no parameter + for pyfunc, case_name in [(strip_usecase, 'strip'), + (lstrip_usecase, 'lstrip'), + (rstrip_usecase, 'rstrip')]: + cfunc = njit(pyfunc) + + for string, chars in STRIP_CASES: + self.assertEqual(pyfunc(string), + cfunc(string), + "'%s'.%s()?" % (string, case_name)) + # parametrized form + for pyfunc, case_name in [(strip_usecase_chars, 'strip'), + (lstrip_usecase_chars, 'lstrip'), + (rstrip_usecase_chars, 'rstrip')]: + cfunc = njit(pyfunc) + + sig1 = types.unicode_type(types.unicode_type, + types.Optional(types.unicode_type)) + cfunc_optional = njit([sig1])(pyfunc) + + def try_compile_bad_optional(*args): + bad = types.unicode_type(types.unicode_type, + types.Optional(types.float64)) + njit([bad])(pyfunc) + + for fn in cfunc, try_compile_bad_optional: + with self.assertRaises(TypingError) as raises: + fn('tú quis?', 1.1) + self.assertIn('The arg must be a UnicodeType or None', + str(raises.exception)) + + for fn in cfunc, cfunc_optional: + + for string, chars in STRIP_CASES: + self.assertEqual(pyfunc(string, chars), + fn(string, chars), + "'%s'.%s('%s')?" % (string, case_name, + chars)) + + def test_isspace(self): + def pyfunc(s): + return s.isspace() + + cfunc = njit(pyfunc) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L613-L621 # noqa: E501 + cpython = ['\u2000', '\u200a', '\u2014', '\U00010401', '\U00010427', + '\U00010429', '\U0001044E', '\U0001F40D', '\U0001F46F'] + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L742-L749 # noqa: E501 + cpython_extras = ['\uD800', '\uDFFF', '\uD800\uD800', '\uDFFF\uDFFF', + 'a\uD800b\uDFFF', 'a\uDFFFb\uD800', + 'a\uD800b\uDFFFa', 'a\uDFFFb\uD800a'] + + msg = 'Results of "{}".isspace() must be equal' + for s in UNICODE_EXAMPLES + [''] + cpython + cpython_extras: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_istitle(self): + pyfunc = istitle_usecase + cfunc = njit(pyfunc) + error_msg = "'{0}'.py_istitle() = {1}\n'{0}'.c_istitle() = {2}" + + unicode_title = [x.title() for x in UNICODE_EXAMPLES] + special = [ + '', + ' ', + ' AA ', + ' Ab ', + '1', + 'A123', + 'A12Bcd', + '+abA', + '12Abc', + 'A12abc', + '%^Abc 5 $% Def' + '𐐁𐐩', + '𐐧𐑎', + '𐐩', + '𐑎', + '🐍 Is', + '🐍 NOT', + '👯Is', + 'ῼ', + 'Greek ῼitlecases ...' + ] + ISTITLE_EXAMPLES = UNICODE_EXAMPLES + unicode_title + special + + for s in ISTITLE_EXAMPLES: + py_result = pyfunc(s) + c_result = cfunc(s) + self.assertEqual(py_result, c_result, + error_msg.format(s, py_result, c_result)) + + def test_isprintable(self): + def pyfunc(s): + return s.isprintable() + + cfunc = njit(pyfunc) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L710-L723 # noqa: E501 + cpython = ['', ' ', 'abcdefg', 'abcdefg\n', '\u0374', '\u0378', + '\ud800', '\U0001F46F', '\U000E0020'] + + msg = 'Results of "{}".isprintable() must be equal' + for s in UNICODE_EXAMPLES + cpython: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_pointless_slice(self, flags=no_pyobj_flags): + def pyfunc(a): + return a[:] + cfunc = njit(pyfunc) + args = ['a'] + self.assertEqual(pyfunc(*args), cfunc(*args)) + + def test_walk_backwards(self, flags=no_pyobj_flags): + def pyfunc(a): + return a[::-1] + cfunc = njit(pyfunc) + args = ['a'] + self.assertEqual(pyfunc(*args), cfunc(*args)) + + def test_stride_slice(self, flags=no_pyobj_flags): + def pyfunc(a): + return a[::2] + cfunc = njit(pyfunc) + args = ['a'] + self.assertEqual(pyfunc(*args), cfunc(*args)) + + def test_basic_lt(self, flags=no_pyobj_flags): + def pyfunc(a, b): + return a < b + cfunc = njit(pyfunc) + args = ['ab', 'b'] + self.assertEqual(pyfunc(*args), cfunc(*args)) + + def test_basic_gt(self, flags=no_pyobj_flags): + def pyfunc(a, b): + return a > b + cfunc = njit(pyfunc) + args = ['ab', 'b'] + self.assertEqual(pyfunc(*args), cfunc(*args)) + + def test_comparison(self): + def pyfunc(option, x, y): + if option == '==': + return x == y + elif option == '!=': + return x != y + elif option == '<': + return x < y + elif option == '>': + return x > y + elif option == '<=': + return x <= y + elif option == '>=': + return x >= y + else: + return None + + cfunc = njit(pyfunc) + + for x, y in permutations(UNICODE_ORDERING_EXAMPLES, r=2): + for cmpop in ['==', '!=', '<', '>', '<=', '>=', '']: + args = [cmpop, x, y] + self.assertEqual(pyfunc(*args), cfunc(*args), + msg='failed on {}'.format(args)) + + def test_literal_concat(self): + def pyfunc(x): + abc = 'abc' + if len(x): + return abc + 'b123' + x + 'IO' + else: + return x + abc + '123' + x + + cfunc = njit(pyfunc) + args = ['x'] + self.assertEqual(pyfunc(*args), cfunc(*args)) + args = [''] + self.assertEqual(pyfunc(*args), cfunc(*args)) + + def test_literal_comparison(self): + def pyfunc(option): + x = 'a123' + y = 'aa12' + if option == '==': + return x == y + elif option == '!=': + return x != y + elif option == '<': + return x < y + elif option == '>': + return x > y + elif option == '<=': + return x <= y + elif option == '>=': + return x >= y + else: + return None + + cfunc = njit(pyfunc) + for cmpop in ['==', '!=', '<', '>', '<=', '>=', '']: + args = [cmpop] + self.assertEqual(pyfunc(*args), cfunc(*args), + msg='failed on {}'.format(args)) + + def test_literal_len(self): + def pyfunc(): + return len('abc') + cfunc = njit(pyfunc) + self.assertEqual(pyfunc(), cfunc()) + + def test_literal_getitem(self): + def pyfunc(which): + return 'abc'[which] + cfunc = njit(pyfunc) + for a in [-1, 0, 1, slice(1, None), slice(None, -1)]: + args = [a] + self.assertEqual(pyfunc(*args), cfunc(*args), + msg='failed on {}'.format(args)) + + def test_literal_in(self): + def pyfunc(x): + return x in '9876zabiuh' + + cfunc = njit(pyfunc) + for a in ['a', '9', '1', '', '8uha', '987']: + args = [a] + self.assertEqual(pyfunc(*args), cfunc(*args), + msg='failed on {}'.format(args)) + + def test_literal_xyzwith(self): + def pyfunc(x, y): + return 'abc'.startswith(x), 'cde'.endswith(y) + + cfunc = njit(pyfunc) + for args in permutations('abcdefg', r=2): + self.assertEqual(pyfunc(*args), cfunc(*args), + msg='failed on {}'.format(args)) + + def test_literal_find(self): + def pyfunc(x): + return 'abc'.find(x), x.find('a') + + cfunc = njit(pyfunc) + for a in ['ab']: + args = [a] + self.assertEqual(pyfunc(*args), cfunc(*args), + msg='failed on {}'.format(args)) + + def test_not(self): + def pyfunc(x): + return not x + + cfunc = njit(pyfunc) + for a in UNICODE_EXAMPLES: + args = [a] + self.assertEqual(pyfunc(*args), cfunc(*args), + msg='failed on {}'.format(args)) + + def test_capitalize(self): + def pyfunc(x): + return x.capitalize() + + cfunc = njit(pyfunc) + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L800-L815 # noqa: E501 + cpython = ['\U0001044F', '\U0001044F\U0001044F', '\U00010427\U0001044F', + '\U0001044F\U00010427', 'X\U00010427x\U0001044F', 'h\u0130', + '\u1fd2\u0130', 'finnish', 'A\u0345\u03a3'] + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L926 # noqa: E501 + cpython_extras = ['\U00010000\U00100000'] + + msg = 'Results of "{}".capitalize() must be equal' + for s in UNICODE_EXAMPLES + [''] + cpython + cpython_extras: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_isupper(self): + def pyfunc(x): + return x.isupper() + + cfunc = njit(pyfunc) + uppers = [x.upper() for x in UNICODE_EXAMPLES] + extras = ["AA12A", "aa12a", "大AA12A", "大aa12a", "AAADŽA", "A 1 1 大"] + + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L585-L599 # noqa: E501 + cpython = ['\u2167', '\u2177', '\U00010401', '\U00010427', '\U00010429', + '\U0001044E', '\U0001F40D', '\U0001F46F'] + fourxcpy = [x * 4 for x in cpython] + + for a in UNICODE_EXAMPLES + uppers + extras + cpython + fourxcpy: + args = [a] + self.assertEqual(pyfunc(*args), cfunc(*args), + msg='failed on {}'.format(args)) + + def test_upper(self): + def pyfunc(x): + return x.upper() + + cfunc = njit(pyfunc) + for a in UNICODE_EXAMPLES: + args = [a] + self.assertEqual(pyfunc(*args), cfunc(*args), + msg='failed on {}'.format(args)) + + def test_casefold(self): + def pyfunc(x): + return x.casefold() + + cfunc = njit(pyfunc) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L774-L781 # noqa: E501 + cpython = ['hello', 'hELlo', 'ß', 'fi', '\u03a3', + 'A\u0345\u03a3', '\u00b5'] + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L924 # noqa: E501 + cpython_extras = ['\U00010000\U00100000'] + + msg = 'Results of "{}".casefold() must be equal' + for s in UNICODE_EXAMPLES + [''] + cpython + cpython_extras: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_isalpha(self): + def pyfunc(x): + return x.isalpha() + + cfunc = njit(pyfunc) + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L630-L640 # noqa: E501 + cpython = ['\u1FFc', '\U00010401', '\U00010427', '\U00010429', + '\U0001044E', '\U0001F40D', '\U0001F46F'] + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L738-L745 # noqa: E501 + extras = ['\uD800', '\uDFFF', '\uD800\uD800', '\uDFFF\uDFFF', + 'a\uD800b\uDFFF', 'a\uDFFFb\uD800', + 'a\uD800b\uDFFFa', 'a\uDFFFb\uD800a'] + + msg = 'Results of "{}".isalpha() must be equal' + for s in UNICODE_EXAMPLES + [''] + extras + cpython: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_isascii(self): + def pyfunc(x): + return x.isascii() + + cfunc = njit(pyfunc) + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/865c3b257fe38154a4320c7ee6afb416f665b9c2/Lib/test/string_tests.py#L913-L926 # noqa: E501 + cpython = ['', '\x00', '\x7f', '\x00\x7f', '\x80', '\xe9', ' '] + + msg = 'Results of "{}".isascii() must be equal' + for s in UNICODE_EXAMPLES + cpython: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_title(self): + pyfunc = title + cfunc = njit(pyfunc) + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L813-L828 # noqa: E501 + cpython = ['\U0001044F', '\U0001044F\U0001044F', + '\U0001044F\U0001044F \U0001044F\U0001044F', + '\U00010427\U0001044F \U00010427\U0001044F', + '\U0001044F\U00010427 \U0001044F\U00010427', + 'X\U00010427x\U0001044F X\U00010427x\U0001044F', + 'fiNNISH', 'A\u03a3 \u1fa1xy', 'A\u03a3A'] + + msg = 'Results of "{}".title() must be equal' + for s in UNICODE_EXAMPLES + [''] + cpython: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_swapcase(self): + def pyfunc(x): + return x.swapcase() + + cfunc = njit(pyfunc) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L834-L858 # noqa: E501 + cpython = ['\U0001044F', '\U00010427', '\U0001044F\U0001044F', + '\U00010427\U0001044F', '\U0001044F\U00010427', + 'X\U00010427x\U0001044F', 'fi', '\u0130', '\u03a3', + '\u0345\u03a3', 'A\u0345\u03a3', 'A\u0345\u03a3a', + 'A\u0345\u03a3', 'A\u03a3\u0345', '\u03a3\u0345 ', + '\u03a3', 'ß', '\u1fd2'] + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L928 # noqa: E501 + cpython_extras = ['\U00010000\U00100000'] + + msg = 'Results of "{}".swapcase() must be equal' + for s in UNICODE_EXAMPLES + [''] + cpython + cpython_extras: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_islower(self): + pyfunc = islower_usecase + cfunc = njit(pyfunc) + lowers = [x.lower() for x in UNICODE_EXAMPLES] + extras = ['AA12A', 'aa12a', '大AA12A', '大aa12a', 'AAADŽA', 'A 1 1 大'] + + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L586-L600 # noqa: E501 + cpython = ['\u2167', '\u2177', '\U00010401', '\U00010427', + '\U00010429', '\U0001044E', '\U0001F40D', '\U0001F46F'] + cpython += [x * 4 for x in cpython] + + msg = 'Results of "{}".islower() must be equal' + for s in UNICODE_EXAMPLES + lowers + [''] + extras + cpython: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_isalnum(self): + def pyfunc(x): + return x.isalnum() + + cfunc = njit(pyfunc) + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L624-L628 # noqa: E501 + cpython = ['\U00010401', '\U00010427', '\U00010429', '\U0001044E', + '\U0001D7F6', '\U00011066', '\U000104A0', '\U0001F107'] + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L738-L745 # noqa: E501 + extras = ['\uD800', '\uDFFF', '\uD800\uD800', '\uDFFF\uDFFF', + 'a\uD800b\uDFFF', 'a\uDFFFb\uD800', + 'a\uD800b\uDFFFa', 'a\uDFFFb\uD800a'] + + msg = 'Results of "{}".isalnum() must be equal' + for s in UNICODE_EXAMPLES + [''] + extras + cpython: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_lower(self): + pyfunc = lower_usecase + cfunc = njit(pyfunc) + extras = ['AA12A', 'aa12a', '大AA12A', '大aa12a', 'AAADŽA', 'A 1 1 大'] + + # Samples taken from CPython testing: + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L748-L758 # noqa: E501 + cpython = ['\U00010401', '\U00010427', '\U0001044E', '\U0001F46F', + '\U00010427\U00010427', '\U00010427\U0001044F', + 'X\U00010427x\U0001044F', '\u0130'] + + # special cases for sigma from CPython testing: + # https://github.com/python/cpython/blob/201c8f79450628241574fba940e08107178dc3a5/Lib/test/test_unicode.py#L759-L768 # noqa: E501 + sigma = ['\u03a3', '\u0345\u03a3', 'A\u0345\u03a3', 'A\u0345\u03a3a', + '\u03a3\u0345 ', '\U0008fffe', '\u2177'] + + extra_sigma = 'A\u03a3\u03a2' + sigma.append(extra_sigma) + + msg = 'Results of "{}".lower() must be equal' + for s in UNICODE_EXAMPLES + [''] + extras + cpython + sigma: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_isnumeric(self): + def pyfunc(x): + return x.isnumeric() + + cfunc = njit(pyfunc) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L676-L693 # noqa: E501 + cpython = ['', 'a', '0', '\u2460', '\xbc', '\u0660', '0123456789', + '0123456789a', '\U00010401', '\U00010427', '\U00010429', + '\U0001044E', '\U0001F40D', '\U0001F46F', '\U00011065', + '\U0001D7F6', '\U00011066', '\U000104A0', '\U0001F107'] + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L742-L749 # noqa: E501 + cpython_extras = ['\uD800', '\uDFFF', '\uD800\uD800', '\uDFFF\uDFFF', + 'a\uD800b\uDFFF', 'a\uDFFFb\uD800', 'a\uD800b\uDFFFa', + 'a\uDFFFb\uD800a'] + + msg = 'Results of "{}".isnumeric() must be equal' + for s in UNICODE_EXAMPLES + [''] + cpython + cpython_extras: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_isdigit(self): + def pyfunc(x): + return x.isdigit() + + cfunc = njit(pyfunc) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L664-L674 # noqa: E501 + cpython = ['\u2460', '\xbc', '\u0660', '\U00010401', '\U00010427', + '\U00010429', '\U0001044E', '\U0001F40D', '\U0001F46F', + '\U00011065', '\U0001D7F6', '\U00011066', '\U000104A0', + '\U0001F107'] + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L742-L749 # noqa: E501 + cpython_extras = ['\uD800', '\uDFFF', '\uD800\uD800', '\uDFFF\uDFFF', + 'a\uD800b\uDFFF', 'a\uDFFFb\uD800', + 'a\uD800b\uDFFFa', 'a\uDFFFb\uD800a'] + + msg = 'Results of "{}".isdigit() must be equal' + for s in UNICODE_EXAMPLES + [''] + cpython + cpython_extras: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_isdecimal(self): + def pyfunc(x): + return x.isdecimal() + + cfunc = njit(pyfunc) + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L646-L662 # noqa: E501 + cpython = ['', 'a', '0', '\u2460', '\xbc', '\u0660', '0123456789', + '0123456789a', '\U00010401', '\U00010427', '\U00010429', + '\U0001044E', '\U0001F40D', '\U0001F46F', '\U00011065', + '\U0001F107', '\U0001D7F6', '\U00011066', '\U000104A0'] + # https://github.com/python/cpython/blob/1d4b6ba19466aba0eb91c4ba01ba509acf18c723/Lib/test/test_unicode.py#L742-L749 # noqa: E501 + cpython_extras = ['\uD800', '\uDFFF', '\uD800\uD800', '\uDFFF\uDFFF', + 'a\uD800b\uDFFF', 'a\uDFFFb\uD800', 'a\uD800b\uDFFFa', + 'a\uDFFFb\uD800a'] + + msg = 'Results of "{}".isdecimal() must be equal' + for s in UNICODE_EXAMPLES + [''] + cpython + cpython_extras: + self.assertEqual(pyfunc(s), cfunc(s), msg=msg.format(s)) + + def test_replace(self): + pyfunc = replace_usecase + cfunc = njit(pyfunc) + + CASES = [ + ('abc', '', 'A'), + ('', '⚡', 'A'), + ('abcabc', '⚡', 'A'), + ('🐍⚡', '⚡', 'A'), + ('🐍⚡🐍', '⚡', 'A'), + ('abababa', 'a', 'A'), + ('abababa', 'b', 'A'), + ('abababa', 'c', 'A'), + ('abababa', 'ab', 'A'), + ('abababa', 'aba', 'A'), + ] + + for test_str, old_str, new_str in CASES: + self.assertEqual(pyfunc(test_str, old_str, new_str), + cfunc(test_str, old_str, new_str), + "'%s'.replace('%s', '%s')?" % + (test_str, old_str, new_str)) + + def test_replace_with_count(self): + pyfunc = replace_with_count_usecase + cfunc = njit(pyfunc) + + CASES = [ + ('abc', '', 'A'), + ('', '⚡', 'A'), + ('abcabc', '⚡', 'A'), + ('🐍⚡', '⚡', 'A'), + ('🐍⚡🐍', '⚡', 'A'), + ('abababa', 'a', 'A'), + ('abababa', 'b', 'A'), + ('abababa', 'c', 'A'), + ('abababa', 'ab', 'A'), + ('abababa', 'aba', 'A'), + ] + + count_test = [-1, 1, 0, 5] + + for test_str, old_str, new_str in CASES: + for count in count_test: + self.assertEqual(pyfunc(test_str, old_str, new_str, count), + cfunc(test_str, old_str, new_str, count), + "'%s'.replace('%s', '%s', '%s')?" % + (test_str, old_str, new_str, count)) + + def test_replace_unsupported(self): + def pyfunc(s, x, y, count): + return s.replace(x, y, count) + + cfunc = njit(pyfunc) + + with self.assertRaises(TypingError) as raises: + cfunc('ababababab', 'ba', 'qqq', 3.5) + msg = 'Unsupported parameters. The parameters must be Integer.' + self.assertIn(msg, str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc('ababababab', 0, 'qqq', 3) + msg = 'The object must be a UnicodeType.' + self.assertIn(msg, str(raises.exception)) + + with self.assertRaises(TypingError) as raises: + cfunc('ababababab', 'ba', 0, 3) + msg = 'The object must be a UnicodeType.' + self.assertIn(msg, str(raises.exception)) + + +class TestUnicodeInTuple(BaseTest): + + def test_const_unicode_in_tuple(self): + # Issue 3673 + @njit + def f(): + return ('aa',) < ('bb',) + + self.assertEqual(f.py_func(), f()) + + @njit + def f(): + return ('cc',) < ('bb',) + + self.assertEqual(f.py_func(), f()) + + def test_const_unicode_in_hetero_tuple(self): + @njit + def f(): + return ('aa', 1) < ('bb', 1) + + self.assertEqual(f.py_func(), f()) + + @njit + def f(): + return ('aa', 1) < ('aa', 2) + + self.assertEqual(f.py_func(), f()) + + def test_ascii_flag_unbox(self): + @njit + def f(s): + return s._is_ascii + + for s in UNICODE_EXAMPLES: + self.assertEqual(f(s), isascii(s)) + + def test_ascii_flag_join(self): + @njit + def f(): + s1 = 'abc' + s2 = '123' + s3 = '🐍⚡' + s4 = '大处着眼,小处着手。' + return (",".join([s1, s2])._is_ascii, + "🐍⚡".join([s1, s2])._is_ascii, + ",".join([s1, s3])._is_ascii, + ",".join([s3, s4])._is_ascii) + + self.assertEqual(f(), (1, 0, 0, 0)) + + def test_ascii_flag_getitem(self): + @njit + def f(): + s1 = 'abc123' + s2 = '🐍⚡🐍⚡🐍⚡' + return (s1[0]._is_ascii, s1[2:]._is_ascii, s2[0]._is_ascii, + s2[2:]._is_ascii) + + self.assertEqual(f(), (1, 1, 0, 0)) + + def test_ascii_flag_add_mul(self): + @njit + def f(): + s1 = 'abc' + s2 = '123' + s3 = '🐍⚡' + s4 = '大处着眼,小处着手。' + return ((s1 + s2)._is_ascii, + (s1 + s3)._is_ascii, + (s3 + s4)._is_ascii, + (s1 * 2)._is_ascii, + (s3 * 2)._is_ascii) + + self.assertEqual(f(), (1, 0, 0, 1, 0)) + + +class TestUnicodeIteration(BaseTest): + + def test_unicode_iter(self): + pyfunc = iter_usecase + cfunc = njit(pyfunc) + for a in UNICODE_EXAMPLES: + self.assertPreciseEqual(pyfunc(a), cfunc(a)) + + def test_unicode_literal_iter(self): + pyfunc = literal_iter_usecase + cfunc = njit(pyfunc) + self.assertPreciseEqual(pyfunc(), cfunc()) + + def test_unicode_enumerate_iter(self): + pyfunc = enumerated_iter_usecase + cfunc = njit(pyfunc) + for a in UNICODE_EXAMPLES: + self.assertPreciseEqual(pyfunc(a), cfunc(a)) + + def test_unicode_stopiteration_iter(self): + self.disable_leak_check() + pyfunc = iter_stopiteration_usecase + cfunc = njit(pyfunc) + for f in (pyfunc, cfunc): + for a in UNICODE_EXAMPLES: + with self.assertRaises(StopIteration): + f(a) + + def test_unicode_literal_stopiteration_iter(self): + pyfunc = literal_iter_stopiteration_usecase + cfunc = njit(pyfunc) + for f in (pyfunc, cfunc): + with self.assertRaises(StopIteration): + f() + + +class TestUnicodeAuxillary(BaseTest): + + def test_ord(self): + pyfunc = ord_usecase + cfunc = njit(pyfunc) + for ex in UNICODE_EXAMPLES: + for a in ex: + self.assertPreciseEqual(pyfunc(a), cfunc(a)) + + def test_ord_invalid(self): + self.disable_leak_check() + + pyfunc = ord_usecase + cfunc = njit(pyfunc) + + # wrong number of chars + for func in (pyfunc, cfunc): + for ch in ('', 'abc'): + with self.assertRaises(TypeError) as raises: + func(ch) + self.assertIn('ord() expected a character', + str(raises.exception)) + + # wrong type + with self.assertRaises(TypingError) as raises: + cfunc(1.23) + self.assertIn(_header_lead, str(raises.exception)) + + def test_chr(self): + pyfunc = chr_usecase + cfunc = njit(pyfunc) + for ex in UNICODE_EXAMPLES: + for x in ex: + a = ord(x) + self.assertPreciseEqual(pyfunc(a), cfunc(a)) + # test upper/lower bounds + for a in (0x0, _MAX_UNICODE): + self.assertPreciseEqual(pyfunc(a), cfunc(a)) + + def test_chr_invalid(self): + pyfunc = chr_usecase + cfunc = njit(pyfunc) + + # value negative/>_MAX_UNICODE + for func in (pyfunc, cfunc): + for v in (-2, _MAX_UNICODE + 1): + with self.assertRaises(ValueError) as raises: + func(v) + self.assertIn("chr() arg not in range", str(raises.exception)) + + # wrong type + with self.assertRaises(TypingError) as raises: + cfunc('abc') + self.assertIn(_header_lead, str(raises.exception)) + + def test_unicode_type_mro(self): + # see issue #5635 + def bar(x): + return True + + @overload(bar) + def ol_bar(x): + ok = False + if isinstance(x, types.UnicodeType): + if isinstance(x, types.Hashable): + ok = True + return lambda x: ok + + @njit + def foo(strinst): + return bar(strinst) + + inst = "abc" + self.assertEqual(foo.py_func(inst), foo(inst)) + self.assertIn(types.Hashable, types.unicode_type.__class__.__mro__) + + def test_f_strings(self): + """test f-string support, which requires bytecode handling + """ + # requires formatting (FORMAT_VALUE) and concatenation (BUILD_STRINGS) + def impl1(a): + return f"AA_{a + 3}_B" + + # does not require concatenation + def impl2(a): + return f"{a + 2}" + + # no expression + def impl3(a): + return f"ABC_{a}" + + # format spec not allowed + def impl4(a): + return f"ABC_{a:0}" + + # corner case: empty string + def impl5(): + return f"" # noqa: F541 + + self.assertEqual(impl1(3), njit(impl1)(3)) + self.assertEqual(impl2(2), njit(impl2)(2)) + # string input + self.assertEqual(impl3("DE"), njit(impl3)("DE")) + + # check output when there's no __str__ or __repr__ defined + list_arg = ["A", "B"] + got = njit(impl3)(list_arg) + expected = f"ABC_" + self.assertEqual(got, expected) + + # check error when format spec provided + unsupported_errors = (UnsupportedError, UnsupportedBytecodeError) + with self.assertRaises(unsupported_errors) as raises: + njit(impl4)(["A", "B"]) + if PYVERSION in ((3, 13),): + msg = "Use of unsupported opcode (FORMAT_WITH_SPEC)" + self.assertIn(msg, str(raises.exception)) + elif PYVERSION in ((3, 10), (3, 11), (3, 12)): + msg = "format spec in f-strings not supported yet" + self.assertIn(msg, str(raises.exception)) + else: + raise NotImplementedError(PYVERSION) + self.assertEqual(impl5(), njit(impl5)()) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unicode_array.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unicode_array.py new file mode 100644 index 0000000000000000000000000000000000000000..d291ffd90d14a2325e86cf479af2afde22bcc2bb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unicode_array.py @@ -0,0 +1,889 @@ +import numpy as np + +import unittest +from numba import jit, from_dtype +from numba.core import types +from numba.typed import Dict +from numba.tests.support import (TestCase, skip_ppc64le_issue4563) + + +def getitem(x, i): + return x[i] + + +def getitem2(x, i, j): + return x[i][j] + + +def setitem(x, i, v): + x[i] = v + return x + + +def setitem2(x, i, y, j): + x[i] = y[j] + return x + + +def setitem_literal(x, i): + x[i] = '123' + return x + + +def getitem_key(x, y, j): + x[y[j]] = 123 + + +def return_len(x, i): + return len(x[i]) + + +def return_bool(x, i): + return bool(x[i]) + + +def equal_getitem(x, i, j): + return x[i] == x[j] + + +def notequal_getitem(x, i, j): + return x[i] != x[j] + + +def lessthan_getitem(x, i, j): + return x[i] < x[j] + + +def greaterthan_getitem(x, i, j): + return x[i] > x[j] + + +def lessequal_getitem(x, i, j): + return x[i] <= x[j] + + +def greaterequal_getitem(x, i, j): + return x[i] >= x[j] + + +def contains_getitem2(x, i, y, j): + return x[i] in y[j] + + +def equal_getitem_value(x, i, v): + r1 = x[i] == v + r2 = v == x[i] + if r1 == r2: + return r1 + raise ValueError('x[i] == v and v == x[i] are unequal') + + +def notequal_getitem_value(x, i, v): + r1 = x[i] != v + r2 = v != x[i] + if r1 == r2: + return r1 + raise ValueError('x[i] != v and v != x[i] are unequal') + + +def return_isascii(x, i): + return x[i].isascii() + + +def return_isupper(x, i): + return x[i].isupper() + + +def return_upper(x, i): + return x[i].upper() + + +def return_str(x, i): + return str(x[i]) + + +def return_bytes(x, i): + return bytes(x[i]) + + +def return_hash(x, i): + return hash(x[i]) + + +def return_find(x, i, y, j): + return x[i].find(y[j]) + + +def return_rfind(x, i, y, j): + return x[i].rfind(y[j]) + + +def return_startswith(x, i, y, j): + return x[i].startswith(y[j]) + + +def return_endswith(x, i, y, j): + return x[i].endswith(y[j]) + + +def return_split1(x, i): + return x[i].split() + + +def return_split2(x, i, y, j): + return x[i].split(y[j]) + + +def return_split3(x, i, y, j, maxsplit): + return x[i].split(sep=y[j], maxsplit=maxsplit) + + +# NOT IMPLEMENTED: tests for rsplit + + +def return_center1(x, i, w): + return x[i].center(w) + + +def return_center2(x, i, w, y, j): + return x[i].center(w, y[j]) + + +def return_ljust1(x, i, w): + return x[i].ljust(w) + + +def return_ljust2(x, i, w, y, j): + return x[i].ljust(w, y[j]) + + +def return_rjust1(x, i, w): + return x[i].rjust(w) + + +def return_rjust2(x, i, w, y, j): + return x[i].rjust(w, y[j]) + + +def return_join(x, i, y, j, z, k): + return x[i].join([y[j], z[k]]) + + +def return_zfill(x, i, w): + return x[i].zfill(w) + + +def return_lstrip1(x, i): + return x[i].lstrip() + + +def return_lstrip2(x, i, y, j): + return x[i].lstrip(y[j]) + + +def return_rstrip1(x, i): + return x[i].rstrip() + + +def return_rstrip2(x, i, y, j): + return x[i].rstrip(y[j]) + + +def return_strip1(x, i): + return x[i].strip() + + +def return_strip2(x, i, y, j): + return x[i].strip(y[j]) + + +def return_add(x, i, y, j): + return x[i] + y[j] + + +def return_iadd(x, i, y, j): + x[i] += y[j] + return x[i] + + +def return_mul(x, i, y, j): + return x[i] * y[j] # one of the operants must be integer + + +def return_not(x, i): + return not x[i] + + +def join_string_array(str_arr): + return ",".join(str_arr) + + +@skip_ppc64le_issue4563 +class TestUnicodeArray(TestCase): + + def _test(self, pyfunc, cfunc, *args, **kwargs): + expected = pyfunc(*args, **kwargs) + self.assertPreciseEqual(cfunc(*args, **kwargs), expected) + + def test_getitem2(self): + cgetitem2 = jit(nopython=True)(getitem2) + + arr = np.array(b'12') + self.assertPreciseEqual(cgetitem2(arr, (), 0), getitem2(arr, (), 0)) + with self.assertRaisesRegex(IndexError, 'index out of range'): + cgetitem2(arr, (), 2) + + arr = np.array('12') + self.assertPreciseEqual(cgetitem2(arr, (), 0), getitem2(arr, (), 0)) + with self.assertRaisesRegex(IndexError, 'index out of range'): + cgetitem2(arr, (), 2) + + arr = np.array([b'12', b'3']) + self.assertPreciseEqual(cgetitem2(arr, 0, 0), getitem2(arr, 0, 0)) + self.assertPreciseEqual(cgetitem2(arr, 0, 1), getitem2(arr, 0, 1)) + self.assertPreciseEqual(cgetitem2(arr, 1, 0), getitem2(arr, 1, 0)) + with self.assertRaisesRegex(IndexError, 'index out of range'): + cgetitem2(arr, 1, 1) + + arr = np.array(['12', '3']) + self.assertPreciseEqual(cgetitem2(arr, 0, 0), getitem2(arr, 0, 0)) + self.assertPreciseEqual(cgetitem2(arr, 0, 1), getitem2(arr, 0, 1)) + self.assertPreciseEqual(cgetitem2(arr, 1, 0), getitem2(arr, 1, 0)) + with self.assertRaisesRegex(IndexError, 'index out of range'): + cgetitem2(arr, 1, 1) + + def test_getitem(self): + pyfunc = getitem + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, b'12', 1) + self._test(pyfunc, cfunc, np.array(b'12'), ()) + self._test(pyfunc, cfunc, np.array([b'12', b'3']), 0) + self._test(pyfunc, cfunc, np.array([b'12', b'3']), 1) + + self._test(pyfunc, cfunc, '12', 1) + self._test(pyfunc, cfunc, np.array('12'), ()) + self._test(pyfunc, cfunc, np.array(['12', '3']), 0) + self._test(pyfunc, cfunc, np.array(['12', '3']), 1) + + def test_getitem_key(self): + pyfunc = getitem_key + cfunc = jit(nopython=True)(pyfunc) + + for x, i in [ + (np.array('123'), ()), + (np.array(['123']), 0), + (np.array(b'123'), ()), + (np.array([b'123']), 0) + ]: + d1 = {} + d2 = Dict.empty(from_dtype(x.dtype), types.int64) + pyfunc(d1, x, i) + cfunc(d2, x, i) + self.assertEqual(d1, d2) + # check for charseq to str conversion: + str(d2) + + def test_setitem(self): + pyfunc = setitem + cfunc = jit(nopython=True)(pyfunc) + + x = np.array(12) + self._test(pyfunc, cfunc, x, (), 34) + + x1 = np.array(b'123') + x2 = np.array(b'123') + y1 = pyfunc(x1, (), b'34') + y2 = cfunc(x2, (), b'34') + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + x1 = np.array(['123']) + x2 = np.array(['123']) + y1 = pyfunc(x1, 0, '34') + y2 = cfunc(x2, 0, '34') + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + def test_setitem2(self): + pyfunc = setitem2 + cfunc = jit(nopython=True)(pyfunc) + + x1 = np.array(['123', 'ABC']) + x2 = np.array(['123', 'ABC']) + y1 = pyfunc(x1, 0, x1, 1) + y2 = cfunc(x2, 0, x2, 1) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + x1 = np.array([b'123', b'ABC']) + x2 = np.array([b'123', b'ABC']) + y1 = pyfunc(x1, 0, x1, 1) + y2 = cfunc(x2, 0, x2, 1) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + x1 = np.array('123') + x2 = np.array('123') + z1 = np.array('ABC') + z2 = np.array('ABC') + y1 = pyfunc(x1, (), z1, ()) + y2 = cfunc(x2, (), z2, ()) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + x1 = np.array(123) + x2 = np.array(123) + z1 = 456, + z2 = 456, + y1 = pyfunc(x1, (), z1, 0) + y2 = cfunc(x2, (), z2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + # bytes + x1 = np.array(b'123') + x2 = np.array(b'123') + z1 = b'ABC', + z2 = b'ABC', + y1 = pyfunc(x1, (), z1, 0) + y2 = cfunc(x2, (), z2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + # UTF-8 + x1 = np.array('123') + x2 = np.array('123') + z1 = 'ABC', + z2 = 'ABC', + y1 = pyfunc(x1, (), z1, 0) + y2 = cfunc(x2, (), z2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + # UTF-16 + x1 = np.array('123') + x2 = np.array('123') + z1 = 'AB\u01e9', + z2 = 'AB\u01e9', + y1 = pyfunc(x1, (), z1, 0) + y2 = cfunc(x2, (), z2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + # UTF-32 + x1 = np.array('123') + x2 = np.array('123') + z1 = 'AB\U00108a0e', + z2 = 'AB\U00108a0e', + y1 = pyfunc(x1, (), z1, 0) + y2 = cfunc(x2, (), z2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + # UTF-8, assign longer value (truncates as in numpy) + x1 = np.array('123') + x2 = np.array('123') + z1 = 'ABCD', + z2 = 'ABCD', + y1 = pyfunc(x1, (), z1, 0) + y2 = cfunc(x2, (), z2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + # UTF-8, assign shorter value + x1 = np.array('123') + x2 = np.array('123') + z1 = 'AB', + z2 = 'AB', + y1 = pyfunc(x1, (), z1, 0) + y2 = cfunc(x2, (), z2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + # bytes, assign longer value (truncates as in numpy) + x1 = np.array(b'123') + x2 = np.array(b'123') + z1 = b'ABCD', + z2 = b'ABCD', + y1 = pyfunc(x1, (), z1, 0) + y2 = cfunc(x2, (), z2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + # bytes, assign shorter value + x1 = np.array(b'123') + x2 = np.array(b'123') + z1 = b'AB', + z2 = b'AB', + y1 = pyfunc(x1, (), z1, 0) + y2 = cfunc(x2, (), z2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + def test_setitem_literal(self): + pyfunc = setitem_literal + cfunc = jit(nopython=True)(pyfunc) + + x1 = np.array('ABC') + x2 = np.array('ABC') + y1 = pyfunc(x1, ()) + y2 = cfunc(x2, ()) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + x1 = np.array(['ABC', '5678']) + x2 = np.array(['ABC', '5678']) + y1 = pyfunc(x1, 0) + y2 = cfunc(x2, 0) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + x1 = np.array(['ABC', '5678']) + x2 = np.array(['ABC', '5678']) + y1 = pyfunc(x1, 1) + y2 = cfunc(x2, 1) + self.assertPreciseEqual(x1, x2) + self.assertPreciseEqual(y1, y2) + + def test_return_len(self): + pyfunc = return_len + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array(''), ()) + self._test(pyfunc, cfunc, np.array(b''), ()) + self._test(pyfunc, cfunc, np.array(b'12'), ()) + self._test(pyfunc, cfunc, np.array('12'), ()) + self._test(pyfunc, cfunc, np.array([b'12', b'3']), 0) + self._test(pyfunc, cfunc, np.array(['12', '3']), 0) + self._test(pyfunc, cfunc, np.array([b'12', b'3']), 1) + self._test(pyfunc, cfunc, np.array(['12', '3']), 1) + + def test_return_bool(self): + pyfunc = return_bool + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array(''), ()) + self._test(pyfunc, cfunc, np.array(b''), ()) + self._test(pyfunc, cfunc, np.array(b'12'), ()) + self._test(pyfunc, cfunc, np.array('12'), ()) + self._test(pyfunc, cfunc, np.array([b'12', b'']), 0) + self._test(pyfunc, cfunc, np.array(['12', '']), 0) + self._test(pyfunc, cfunc, np.array([b'12', b'']), 1) + self._test(pyfunc, cfunc, np.array(['12', '']), 1) + + def _test_op_getitem(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array([1, 2]), 0, 1) + self._test(pyfunc, cfunc, '12', 0, 1) + self._test(pyfunc, cfunc, b'12', 0, 1) + self._test(pyfunc, cfunc, np.array(b'12'), (), ()) + self._test(pyfunc, cfunc, np.array('1234'), (), ()) + + self._test(pyfunc, cfunc, np.array([b'1', b'2']), 0, 0) + self._test(pyfunc, cfunc, np.array([b'1', b'2']), 0, 1) + self._test(pyfunc, cfunc, np.array([b'12', b'3']), 0, 0) + self._test(pyfunc, cfunc, np.array([b'12', b'3']), 1, 1) + self._test(pyfunc, cfunc, np.array([b'12', b'3']), 0, 1) + self._test(pyfunc, cfunc, np.array([b'12', b'3']), 1, 0) + + self._test(pyfunc, cfunc, np.array(['1', '2']), 0, 0) + self._test(pyfunc, cfunc, np.array(['1', '2']), 0, 1) + self._test(pyfunc, cfunc, np.array(['12', '3']), 0, 0) + self._test(pyfunc, cfunc, np.array(['12', '3']), 1, 1) + self._test(pyfunc, cfunc, np.array(['12', '3']), 0, 1) + self._test(pyfunc, cfunc, np.array(['12', '3']), 1, 0) + + def test_equal_getitem(self): + self._test_op_getitem(equal_getitem) + + def test_notequal_getitem(self): + self._test_op_getitem(notequal_getitem) + + def test_lessthan_getitem(self): + self._test_op_getitem(lessthan_getitem) + + def test_greaterthan_getitem(self): + self._test_op_getitem(greaterthan_getitem) + + def test_lessequal_getitem(self): + self._test_op_getitem(lessequal_getitem) + + def test_greaterequal_getitem(self): + self._test_op_getitem(greaterequal_getitem) + + def _test_op_getitem_value(self, pyfunc): + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array([1, 2]), 0, 1) + self._test(pyfunc, cfunc, '12', 0, '1') + self._test(pyfunc, cfunc, '12', 1, '3') + self._test(pyfunc, cfunc, np.array('1234'), (), '1234') + self._test(pyfunc, cfunc, np.array(['1234']), 0, '1234') + self._test(pyfunc, cfunc, np.array(['1234']), 0, 'abc') + # fails: No conversion from array(bool, 1d, C) to bool + #self._test(pyfunc, cfunc, b'12', 0, b'1') + self._test(pyfunc, cfunc, np.array(b'12'), (), b'12') + self._test(pyfunc, cfunc, np.array([b'12']), 0, b'12') + self._test(pyfunc, cfunc, np.array([b'12']), 0, b'a') + + def test_equal_getitem_value(self): + self._test_op_getitem_value(equal_getitem_value) + + def test_notequal_getitem_value(self): + self._test_op_getitem_value(notequal_getitem_value) + + def test_contains_getitem2(self): + pyfunc = contains_getitem2 + cfunc = jit(nopython=True)(pyfunc) + + x = np.array('123') + y = np.array('12345') + self._test(pyfunc, cfunc, x, (), y, ()) + self._test(pyfunc, cfunc, y, (), x, ()) + + x = np.array(b'123') + y = np.array(b'12345') + self._test(pyfunc, cfunc, x, (), y, ()) + self._test(pyfunc, cfunc, y, (), x, ()) + + x = ('123',) + y = np.array('12345') + self._test(pyfunc, cfunc, x, 0, y, ()) + self._test(pyfunc, cfunc, y, (), x, 0) + + x = (b'123',) + y = np.array(b'12345') + self._test(pyfunc, cfunc, x, 0, y, ()) + self._test(pyfunc, cfunc, y, (), x, 0) + + def test_return_isascii(self): + pyfunc = return_isascii + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array('1234'), ()) + self._test(pyfunc, cfunc, np.array(['1234']), 0) + self._test(pyfunc, cfunc, np.array('1234\u00e9'), ()) + self._test(pyfunc, cfunc, np.array(['1234\u00e9']), 0) + + def test_return_isupper(self): + pyfunc = return_isupper + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array('abc'), ()) + self._test(pyfunc, cfunc, np.array(['abc']), 0) + + self._test(pyfunc, cfunc, np.array(b'abc'), ()) + self._test(pyfunc, cfunc, np.array([b'abc']), 0) + + def test_return_str(self): + pyfunc = return_str + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array('1234'), ()) + self._test(pyfunc, cfunc, np.array(['1234']), 0) + + def test_return_bytes(self): + pyfunc = return_bytes + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array(b'1234'), ()) + self._test(pyfunc, cfunc, np.array([b'1234']), 0) + + def test_return_upper(self): + pyfunc = return_upper + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array('abc'), ()) + self._test(pyfunc, cfunc, np.array(['abc']), 0) + + self._test(pyfunc, cfunc, np.array(b'abc'), ()) + self._test(pyfunc, cfunc, np.array([b'abc']), 0) + + def test_hash(self): + pyfunc = return_hash + cfunc = jit(nopython=True)(pyfunc) + + hash1 = pyfunc(np.array('123'), ()) + hash2 = hash('123') + hash3 = hash(np.array('123')[()]) + self.assertTrue(hash1 == hash2 == hash3) + + self._test(pyfunc, cfunc, np.array('1234'), ()) + self._test(pyfunc, cfunc, np.array(['1234']), 0) + + self._test(pyfunc, cfunc, np.array('1234\u00e9'), ()) + self._test(pyfunc, cfunc, np.array(['1234u00e9']), 0) + + self._test(pyfunc, cfunc, np.array('1234\U00108a0e'), ()) + self._test(pyfunc, cfunc, np.array(['1234\U00108a0e']), 0) + + self._test(pyfunc, cfunc, np.array(b'1234'), ()) + self._test(pyfunc, cfunc, np.array([b'1234']), 0) + + def test_return_find(self): + pyfunc = return_find + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array('1234'), (), np.array('23'), ()) + self._test(pyfunc, cfunc, np.array('1234'), (), ('23',), 0) + self._test(pyfunc, cfunc, ('1234',), 0, np.array('23'), ()) + self._test(pyfunc, cfunc, np.array(b'1234'), (), np.array(b'23'), ()) + self._test(pyfunc, cfunc, np.array(b'1234'), (), (b'23',), 0) + self._test(pyfunc, cfunc, (b'1234',), 0, np.array(b'23'), ()) + + def test_return_rfind(self): + pyfunc = return_rfind + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array('1234'), (), np.array('23'), ()) + self._test(pyfunc, cfunc, np.array('1234'), (), ('23',), 0) + self._test(pyfunc, cfunc, ('1234',), 0, np.array('23'), ()) + self._test(pyfunc, cfunc, np.array(b'1234'), (), np.array(b'23'), ()) + self._test(pyfunc, cfunc, np.array(b'1234'), (), (b'23',), 0) + self._test(pyfunc, cfunc, (b'1234',), 0, np.array(b'23'), ()) + + def test_return_startswith(self): + pyfunc = return_startswith + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1234'), (), np.array('23'), ()) + self._test(pyfunc, cfunc, np.array('1234'), (), ('23',), 0) + self._test(pyfunc, cfunc, ('1234',), 0, np.array('23'), ()) + self._test(pyfunc, cfunc, np.array(b'1234'), (), np.array(b'23'), ()) + self._test(pyfunc, cfunc, np.array(b'1234'), (), (b'23',), 0) + self._test(pyfunc, cfunc, (b'1234',), 0, np.array(b'23'), ()) + + def test_return_endswith(self): + pyfunc = return_endswith + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1234'), (), np.array('23'), ()) + self._test(pyfunc, cfunc, np.array('1234'), (), ('23',), 0) + self._test(pyfunc, cfunc, ('1234',), 0, np.array('23'), ()) + self._test(pyfunc, cfunc, np.array(b'1234'), (), np.array(b'23'), ()) + self._test(pyfunc, cfunc, np.array(b'1234'), (), (b'23',), 0) + self._test(pyfunc, cfunc, (b'1234',), 0, np.array(b'23'), ()) + + def test_return_split1(self): + pyfunc = return_split1 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('12 34'), ()) + self._test(pyfunc, cfunc, np.array(b'1234'), ()) + + def test_return_split2(self): + pyfunc = return_split2 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('12 34'), (), np.array(' '), ()) + self._test(pyfunc, cfunc, np.array('12 34'), (), (' ',), 0) + self._test(pyfunc, cfunc, ('12 34',), 0, np.array(' '), ()) + self._test(pyfunc, cfunc, np.array(b'12 34'), (), np.array(b' '), ()) + self._test(pyfunc, cfunc, np.array(b'12 34'), (), (b' ',), 0) + self._test(pyfunc, cfunc, (b'12 34',), 0, np.array(b' '), ()) + + def test_return_split3(self): + pyfunc = return_split3 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), + np.array(' '), (), 2) + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), (' ',), 0, 2) + self._test(pyfunc, cfunc, ('1 2 3 4',), 0, np.array(' '), (), 2) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), + np.array(b' '), (), 2) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), (b' ',), 0, 2) + self._test(pyfunc, cfunc, (b'1 2 3 4',), 0, np.array(b' '), (), 2) + + def test_return_ljust1(self): + pyfunc = return_ljust1 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40) + + def test_return_ljust2(self): + pyfunc = return_ljust2 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40, + np.array('='), ()) + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40, ('=',), 0) + self._test(pyfunc, cfunc, ('1 2 3 4',), 0, 40, np.array('='), ()) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40, + np.array(b'='), ()) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40, (b'=',), 0) + self._test(pyfunc, cfunc, (b'1 2 3 4',), 0, 40, np.array(b'='), ()) + + def test_return_rjust1(self): + pyfunc = return_rjust1 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40) + + def test_return_rjust2(self): + pyfunc = return_rjust2 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40, + np.array('='), ()) + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40, ('=',), 0) + self._test(pyfunc, cfunc, ('1 2 3 4',), 0, 40, np.array('='), ()) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40, + np.array(b'='), ()) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40, (b'=',), 0) + self._test(pyfunc, cfunc, (b'1 2 3 4',), 0, 40, np.array(b'='), ()) + + def test_return_center1(self): + pyfunc = return_center1 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40) + + def test_return_center2(self): + pyfunc = return_center2 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40, + np.array('='), ()) + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40, ('=',), 0) + self._test(pyfunc, cfunc, ('1 2 3 4',), 0, 40, np.array('='), ()) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40, + np.array(b'='), ()) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40, (b'=',), 0) + self._test(pyfunc, cfunc, (b'1 2 3 4',), 0, 40, np.array(b'='), ()) + + def test_return_join(self): + pyfunc = return_join + cfunc = jit(nopython=True)(pyfunc) + self._test(pyfunc, cfunc, np.array(','), (), np.array('abc'), (), + np.array('123'), ()) + self._test(pyfunc, cfunc, np.array(','), (), np.array('abc'), (), + ('123',), 0) + self._test(pyfunc, cfunc, (',',), 0, np.array('abc'), (), + np.array('123'), ()) + self._test(pyfunc, cfunc, (',',), 0, np.array('abc'), (), + ('123',), 0) + self._test(pyfunc, cfunc, np.array(b','), (), np.array(b'abc'), (), + np.array(b'123'), ()) + self._test(pyfunc, cfunc, np.array(b','), (), np.array(b'abc'), (), + (b'123',), 0) + self._test(pyfunc, cfunc, (b',',), 0, np.array(b'abc'), (), + np.array(b'123'), ()) + self._test(pyfunc, cfunc, (b',',), 0, np.array(b'abc'), (), + (b'123',), 0) + + def test_return_zfill(self): + pyfunc = return_zfill + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('1 2 3 4'), (), 40) + self._test(pyfunc, cfunc, np.array(b'1 2 3 4'), (), 40) + + def test_return_lstrip1(self): + pyfunc = return_lstrip1 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array(' 123 '), ()) + self._test(pyfunc, cfunc, np.array(b' 123 '), ()) + + def test_return_lstrip2(self): + pyfunc = return_lstrip2 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array(' 123 '), (), np.array(' '), ()) + self._test(pyfunc, cfunc, np.array(' 123 '), (), (' ',), 0) + self._test(pyfunc, cfunc, (' 123 ',), 0, np.array(' '), ()) + + self._test(pyfunc, cfunc, np.array(b' 123 '), (), np.array(b' '), ()) + self._test(pyfunc, cfunc, np.array(b' 123 '), (), (b' ',), 0) + self._test(pyfunc, cfunc, (b' 123 ',), 0, np.array(b' '), ()) + + def test_return_rstrip1(self): + pyfunc = return_rstrip1 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array(' 123 '), ()) + self._test(pyfunc, cfunc, np.array(b' 123 '), ()) + + def test_return_rstrip2(self): + pyfunc = return_rstrip2 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array(' 123 '), (), np.array(' '), ()) + self._test(pyfunc, cfunc, np.array(' 123 '), (), (' ',), 0) + self._test(pyfunc, cfunc, (' 123 ',), 0, np.array(' '), ()) + + self._test(pyfunc, cfunc, np.array(b' 123 '), (), np.array(b' '), ()) + self._test(pyfunc, cfunc, np.array(b' 123 '), (), (b' ',), 0) + self._test(pyfunc, cfunc, (b' 123 ',), 0, np.array(b' '), ()) + + def test_return_strip1(self): + pyfunc = return_strip1 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array(' 123 '), ()) + self._test(pyfunc, cfunc, np.array(b' 123 '), ()) + + def test_return_strip2(self): + pyfunc = return_strip2 + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array(' 123 '), (), np.array(' '), ()) + self._test(pyfunc, cfunc, np.array(' 123 '), (), (' ',), 0) + self._test(pyfunc, cfunc, (' 123 ',), 0, np.array(' '), ()) + + self._test(pyfunc, cfunc, np.array(b' 123 '), (), np.array(b' '), ()) + self._test(pyfunc, cfunc, np.array(b' 123 '), (), (b' ',), 0) + self._test(pyfunc, cfunc, (b' 123 ',), 0, np.array(b' '), ()) + + def test_return_add(self): + pyfunc = return_add + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('ab'), (), np.array('cd'), ()) + self._test(pyfunc, cfunc, np.array('ab'), (), ('cd',), 0) + self._test(pyfunc, cfunc, ('ab',), 0, np.array('cd'), ()) + + self._test(pyfunc, cfunc, np.array(b'ab'), (), np.array(b'cd'), ()) + self._test(pyfunc, cfunc, np.array(b'ab'), (), (b'cd',), 0) + self._test(pyfunc, cfunc, (b'ab',), 0, np.array(b'cd'), ()) + + def test_return_iadd(self): + pyfunc = return_iadd + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('ab'), (), np.array('cd'), ()) + self._test(pyfunc, cfunc, np.array('ab'), (), ('cd',), 0) + expected = pyfunc(['ab'], 0, np.array('cd'), ()) + result = pyfunc(['ab'], 0, np.array('cd'), ()) + self.assertPreciseEqual(result, expected) + + self._test(pyfunc, cfunc, np.array(b'ab'), (), np.array(b'cd'), ()) + self._test(pyfunc, cfunc, np.array(b'ab'), (), (b'cd',), 0) + expected = pyfunc([b'ab'], 0, np.array(b'cd'), ()) + result = pyfunc([b'ab'], 0, np.array(b'cd'), ()) + self.assertPreciseEqual(result, expected) + + def test_return_mul(self): + pyfunc = return_mul + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('ab'), (), (5,), 0) + self._test(pyfunc, cfunc, (5,), 0, np.array('ab'), ()) + self._test(pyfunc, cfunc, np.array(b'ab'), (), (5,), 0) + self._test(pyfunc, cfunc, (5,), 0, np.array(b'ab'), ()) + + def test_return_not(self): + pyfunc = return_not + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array('ab'), ()) + self._test(pyfunc, cfunc, np.array(b'ab'), ()) + self._test(pyfunc, cfunc, (b'ab',), 0) + + self._test(pyfunc, cfunc, np.array(''), ()) + self._test(pyfunc, cfunc, np.array(b''), ()) + self._test(pyfunc, cfunc, (b'',), 0) + + def test_join(self): + pyfunc = join_string_array + cfunc = jit(nopython=True)(pyfunc) + + self._test(pyfunc, cfunc, np.array(["hi", "there"])) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unicode_names.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unicode_names.py new file mode 100644 index 0000000000000000000000000000000000000000..0ed8fb756418ee993989ccded14f9b3cedb2521d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unicode_names.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- + + +from numba import njit, cfunc +from numba.tests.support import TestCase, unittest +from numba.core import cgutils + +unicode_name1 = u""" +def unicode_name1(ಠ_ರೃ, ಠਊಠ): + return (ಠ_ರೃ) + (ಠਊಠ) +""" + +unicode_name2 = u""" +def Ծ_Ծ(ಠ_ರೃ, ಠਊಠ): + return (ಠ_ರೃ) + (ಠਊಠ) +""" + + +class TestUnicodeNames(TestCase): + def make_testcase(self, src, fname): + glb = {} + exec(src, glb) + fn = glb[fname] + return fn + + def test_unicode_name1(self): + fn = self.make_testcase(unicode_name1, 'unicode_name1') + cfn = njit(fn) + self.assertEqual(cfn(1, 2), 3) + + def test_unicode_name2(self): + fn = self.make_testcase(unicode_name2, 'Ծ_Ծ') + cfn = njit(fn) + self.assertEqual(cfn(1, 2), 3) + + def test_cfunc(self): + fn = self.make_testcase(unicode_name2, 'Ծ_Ծ') + cfn = cfunc("int32(int32, int32)")(fn) + self.assertEqual(cfn.ctypes(1, 2), 3) + + +class TestUnicodeUtils(TestCase): + def test_normalize_ir_text(self): + # non-unicode input + out = cgutils.normalize_ir_text('abc') + # str returned + self.assertIsInstance(out, str) + # try encoding to latin + out.encode('latin1') + + def test_normalize_ir_text_unicode(self): + # unicode input + out = cgutils.normalize_ir_text(unicode_name2) + # str returned + self.assertIsInstance(out, str) + # try encoding to latin + out.encode('latin1') + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unpack_sequence.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unpack_sequence.py new file mode 100644 index 0000000000000000000000000000000000000000..55db569682664f4844cd289cc317994e83ad03ba --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unpack_sequence.py @@ -0,0 +1,234 @@ +import numpy as np + +import unittest +from numba import jit, njit +from numba.core import errors, types +from numba import typeof +from numba.tests.support import TestCase, MemoryLeakMixin +from numba.tests.support import no_pyobj_flags as nullary_no_pyobj_flags +from numba.tests.support import force_pyobj_flags as nullary_force_pyobj_flags + +force_pyobj_flags = {'forceobj': True} +no_pyobj_flags = {'nopython': True} + + +def unpack_list(l): + a, b, c = l + return (a, b, c) + + +def unpack_shape(a): + x, y, z = a.shape + return x + y + z + + +def unpack_range(): + a, b, c = range(3) + return a + b + c + + +def unpack_range_too_small(): + a, b, c = range(2) + return a + b + c + + +def unpack_range_too_large(): + a, b, c = range(4) + return a + b + c + + +def unpack_tuple(): + a, b, c = (1, 2, 3) + return a + b + c + + +def unpack_tuple_too_small(): + a, b, c = (1, 2) + return a + b + c + + +def unpack_tuple_too_large(): + a, b, c = (1, 2, 3, 4) + return a + b + c + + +def unpack_heterogeneous_tuple_too_small(): + a, b, c = (1, 2.5j) + return a + b + c + + +def unpack_heterogeneous_tuple_too_large(): + a, b, c = (1, 2.5, 3j, 4) + return a + b + c + + +def unpack_heterogeneous_tuple(): + a, b, c = (1, 2.5, 3j) + return a + b + c + + +def unpack_nested_heterogeneous_tuple(): + a, (b, c) = (1, (2.5, 3j)) + return a + b + c + + +def unpack_arbitrary(seq): + a, b = seq + return b, a + + +def unpack_nrt(): + a = np.zeros(1) + b = np.zeros(2) + tup = b, a + alpha, beta = tup + return alpha, beta + + +def chained_unpack_assign1(x, y): + # Used to fail in object mode (issue #580) + a = (b, c) = (x, y) + (d, e) = a + return d + e + b + c + + +def conditional_swap(x, y): + # Used to produce invalid code (issue #977) + if x > 0: + x, y = y, x + return x, y + + +class TestUnpack(MemoryLeakMixin, TestCase): + + def check_nullary_npm(self, pyfunc): + cfunc = njit(pyfunc) + self.assertPreciseEqual(cfunc(), pyfunc()) + + def check_nullary_objmode(self, pyfunc): + cfunc = jit(forceobj=True)(pyfunc) + self.assertPreciseEqual(cfunc(), pyfunc()) + + def test_unpack_list(self): + pyfunc = unpack_list + cfunc = jit(forceobj=True)(pyfunc) + l = [1, 2, 3] + self.assertEqual(cfunc(l), pyfunc(l)) + + def test_unpack_shape(self): + pyfunc = unpack_shape + cfunc = jit((types.Array(dtype=types.int32, ndim=3, layout='C'),), + forceobj=True)(pyfunc) + a = np.zeros(shape=(1, 2, 3)).astype(np.int32) + self.assertPreciseEqual(cfunc(a), pyfunc(a)) + + def test_unpack_shape_npm(self): + pyfunc = unpack_shape + cfunc = njit((types.Array(dtype=types.int32, ndim=3, layout='C'),), + )(pyfunc) + a = np.zeros(shape=(1, 2, 3)).astype(np.int32) + self.assertPreciseEqual(cfunc(a), pyfunc(a)) + + def test_unpack_range(self): + self.check_nullary_objmode(unpack_range) + + def test_unpack_range_npm(self): + self.check_nullary_npm(unpack_range) + + def test_unpack_tuple(self): + self.check_nullary_objmode(unpack_tuple) + + def test_unpack_tuple_npm(self): + self.check_nullary_npm(unpack_tuple) + + def test_unpack_heterogeneous_tuple(self): + self.check_nullary_objmode(unpack_heterogeneous_tuple) + + def test_unpack_heterogeneous_tuple_npm(self): + self.check_nullary_npm(unpack_heterogeneous_tuple) + + def test_unpack_nested_heterogeneous_tuple(self): + self.check_nullary_objmode(unpack_nested_heterogeneous_tuple) + + def test_unpack_nested_heterogeneous_tuple_npm(self): + self.check_nullary_npm(unpack_nested_heterogeneous_tuple) + + def test_chained_unpack_assign(self, flags=force_pyobj_flags): + pyfunc = chained_unpack_assign1 + cfunc = jit((types.int32, types.int32), **flags)(pyfunc) + args = (4, 5) + self.assertPreciseEqual(cfunc(*args), pyfunc(*args)) + + def test_chained_unpack_assign_npm(self): + self.test_chained_unpack_assign(flags=no_pyobj_flags) + + def check_unpack_error(self, pyfunc, flags=force_pyobj_flags, + exc=ValueError): + with self.assertRaises(exc): + cfunc = jit((), **flags)(pyfunc) + cfunc() + + def test_unpack_tuple_too_small(self): + self.check_unpack_error(unpack_tuple_too_small) + self.check_unpack_error(unpack_heterogeneous_tuple_too_small) + + def test_unpack_tuple_too_small_npm(self): + self.check_unpack_error(unpack_tuple_too_small, no_pyobj_flags, + errors.TypingError) + self.check_unpack_error(unpack_heterogeneous_tuple_too_small, + no_pyobj_flags, errors.TypingError) + + def test_unpack_tuple_too_large(self): + self.check_unpack_error(unpack_tuple_too_large) + self.check_unpack_error(unpack_heterogeneous_tuple_too_large) + + def test_unpack_tuple_too_large_npm(self): + self.check_unpack_error(unpack_tuple_too_large, no_pyobj_flags, + errors.TypingError) + self.check_unpack_error(unpack_heterogeneous_tuple_too_large, + no_pyobj_flags, errors.TypingError) + + def test_unpack_range_too_small(self): + self.check_unpack_error(unpack_range_too_small) + + def test_unpack_range_too_small_npm(self): + self.check_unpack_error(unpack_range_too_small, no_pyobj_flags) + + def test_unpack_range_too_large(self): + self.check_unpack_error(unpack_range_too_large) + + def test_unpack_range_too_large_npm(self): + self.check_unpack_error(unpack_range_too_large, no_pyobj_flags) + + def check_conditional_swap(self, flags=force_pyobj_flags): + cfunc = jit((types.int32, types.int32), **flags)(conditional_swap) + self.assertPreciseEqual(cfunc(4, 5), (5, 4)) + self.assertPreciseEqual(cfunc(0, 5), (0, 5)) + + def test_conditional_swap(self): + self.check_conditional_swap() + + def test_conditional_swap_npm(self): + self.check_conditional_swap(no_pyobj_flags) + + def test_unpack_tuple_of_arrays(self): + tup = tuple(np.zeros(i + 1) for i in range(2)) + tupty = typeof(tup) + pyfunc = unpack_arbitrary + cfunc = njit((tupty,))(pyfunc) + self.assertPreciseEqual(cfunc(tup), pyfunc(tup)) + + def test_unpack_nrt(self): + pyfunc = unpack_nrt + cfunc = njit((),)(pyfunc) + self.assertPreciseEqual(cfunc(), pyfunc()) + + def test_invalid_unpack(self): + pyfunc = unpack_arbitrary + with self.assertRaises(errors.TypingError) as raises: + njit((types.int32,))(pyfunc) + self.assertIn("failed to unpack int32", str(raises.exception)) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unpickle_without_module.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unpickle_without_module.py new file mode 100644 index 0000000000000000000000000000000000000000..ddbfbd7512d75dabe9bfce41f57fbb81fa65d2b2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unpickle_without_module.py @@ -0,0 +1,49 @@ +import unittest +import pickle +import sys +import tempfile +from pathlib import Path + + +class TestUnpickleDeletedModule(unittest.TestCase): + def test_loading_pickle_with_no_module(self): + """Create a module that uses Numba, import a function from it. + Then delete the module and pickle the function. The function + should load from the pickle without a problem. + + Note - This is a simplified version of how Numba might be used + on a distributed system using e.g. dask distributed. With the + pickle being sent to the worker but not the original module. + """ + + # Source code for temporary module we will make + source = "\n".join( + [ + "from numba import vectorize", + "@vectorize(['float64(float64)'])", + "def inc1(x):", + " return x + 1", + ] + ) + + # Create a temporary directory and add it to path. + modname = "tmp_module" + with tempfile.TemporaryDirectory() as tmp_dir: + sys.path.append(tmp_dir) + + # Create tmp_module.py in there with our source code above. + filename = Path(f"{tmp_dir}/{modname}.py") + f = open(filename, "a") + f.write(source) + f.close() + + # Import the temporary module before file is deleted + from tmp_module import inc1 + + # Remove from imported libraries + del sys.modules[modname] + + # Pickle function and assert that it loads correctly + pkl = pickle.dumps(inc1) + f = pickle.loads(pkl) + self.assertEqual(f(2), 3) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unsafe_intrinsics.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unsafe_intrinsics.py new file mode 100644 index 0000000000000000000000000000000000000000..4de35f2c209ff12130e82a68afc409f54881ecbb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_unsafe_intrinsics.py @@ -0,0 +1,232 @@ +import random +import numpy as np + +from numba.tests.support import TestCase, captured_stdout +from numba import njit, literally +from numba.core import types +from numba.cpython.unsafe.tuple import tuple_setitem, build_full_slice_tuple +from numba.np.unsafe.ndarray import to_fixed_tuple, empty_inferred +from numba.core.unsafe.bytes import memcpy_region +from numba.core.unsafe.refcount import dump_refcount +from numba.cpython.unsafe.numbers import trailing_zeros, leading_zeros +from numba.core.errors import TypingError + + +class TestTupleIntrinsic(TestCase): + """Tests for numba.unsafe.tuple + """ + def test_tuple_setitem(self): + @njit + def foo(tup, idxs, vals): + out_tup = tup + for i, v in zip(idxs, vals): + out_tup = tuple_setitem(out_tup, i, v) + return tup, out_tup + + random.seed(123) + for _ in range(20): + # Random data + n = random.randint(1, 10) + tup = tuple([random.randint(0, n) for i in range(n)]) + vals = tuple([random.randint(10, 20) for i in range(n)]) + idxs = list(range(len(vals))) + random.shuffle(idxs) + idxs = tuple(idxs) + # Expect + expect_tup = tuple(tup) + expect_out = np.asarray(expect_tup) + expect_out[np.asarray(idxs)] = vals + # Got + got_tup, got_out = foo(tup, idxs, vals) + # Check + self.assertEqual(got_tup, expect_tup) + self.assertEqual(got_out, tuple(expect_out)) + + def test_slice_tuple(self): + @njit + def full_slice_array(a, n): + # Since numba slices can't be boxed at the moment + return a[build_full_slice_tuple(literally(n))] + + for n in range(1, 3): + a = np.random.random(np.arange(n) + 1) + for i in range(1, n + 1): + np.testing.assert_array_equal(a, full_slice_array(a, i)) + with self.assertRaises(TypingError): + # numpy would throw an IndexError here + full_slice_array(a, n + 1) + + +class TestNdarrayIntrinsic(TestCase): + """Tests for numba.unsafe.ndarray + """ + def test_to_fixed_tuple(self): + const = 3 + + @njit + def foo(array): + a = to_fixed_tuple(array, length=1) + b = to_fixed_tuple(array, 2) + c = to_fixed_tuple(array, const) + d = to_fixed_tuple(array, 0) + return a, b, c, d + + np.random.seed(123) + for _ in range(10): + # Random data + arr = np.random.random(3) + # Run + a, b, c, d = foo(arr) + # Check + self.assertEqual(a, tuple(arr[:1])) + self.assertEqual(b, tuple(arr[:2])) + self.assertEqual(c, tuple(arr[:3])) + self.assertEqual(d, ()) + + # Check error with ndim!=1 + with self.assertRaises(TypingError) as raises: + foo(np.random.random((1, 2))) + self.assertIn("Not supported on array.ndim=2", + str(raises.exception)) + + # Check error with non-constant length + @njit + def tuple_with_length(array, length): + return to_fixed_tuple(array, length) + + with self.assertRaises(TypingError) as raises: + tuple_with_length(np.random.random(3), 1) + expectmsg = "*length* argument must be a constant" + self.assertIn(expectmsg, str(raises.exception)) + + def test_issue_3586_variant1(self): + @njit + def func(): + S = empty_inferred((10,)) + a = 1.1 + for i in range(len(S)): + S[i] = a + 2 + return S + + got = func() + expect = np.asarray([3.1] * 10) + np.testing.assert_array_equal(got, expect) + + def test_issue_3586_variant2(self): + @njit + def func(): + S = empty_inferred((10,)) + a = 1.1 + for i in range(S.size): + S[i] = a + 2 + return S + + got = func() + expect = np.asarray([3.1] * 10) + np.testing.assert_array_equal(got, expect) + + +class TestBytesIntrinsic(TestCase): + """Tests for numba.unsafe.bytes + """ + def test_memcpy_region(self): + @njit + def foo(dst, dst_index, src, src_index, nbytes): + # last arg is assume 1 byte alignment + memcpy_region(dst.ctypes.data, dst_index, + src.ctypes.data, src_index, nbytes, 1) + + d = np.zeros(10, dtype=np.int8) + s = np.arange(10, dtype=np.int8) + + # copy s[1:6] to d[4:9] + foo(d, 4, s, 1, 5) + + expected = [0, 0, 0, 0, 1, 2, 3, 4, 5, 0] + np.testing.assert_array_equal(d, expected) + + +class TestRefCount(TestCase): + def test_dump_refcount(self): + @njit + def use_dump_refcount(): + a = np.ones(10) + b = (a, a) + dump_refcount(a) + dump_refcount(b) + + # Capture output to sys.stdout + with captured_stdout() as stream: + use_dump_refcount() + + output = stream.getvalue() + # Check that it printed + pat = "dump refct of {}" + aryty = types.float64[::1] + tupty = types.Tuple.from_types([aryty] * 2) + self.assertIn(pat.format(aryty), output) + self.assertIn(pat.format(tupty), output) + + +class TestZeroCounts(TestCase): + def test_zero_count(self): + lz = njit(lambda x: leading_zeros(x)) + tz = njit(lambda x: trailing_zeros(x)) + + evens = [2, 42, 126, 128] + + for T in types.unsigned_domain: + self.assertTrue(tz(T(0)) == lz(T(0)) == T.bitwidth) + for i in range(T.bitwidth): + val = T(2 ** i) + self.assertEqual(lz(val) + tz(val) + 1, T.bitwidth) + for n in evens: + self.assertGreater(tz(T(n)), 0) + self.assertEqual(tz(T(n + 1)), 0) + + for T in types.signed_domain: + self.assertTrue(tz(T(0)) == lz(T(0)) == T.bitwidth) + for i in range(T.bitwidth - 1): + val = T(2 ** i) + self.assertEqual(lz(val) + tz(val) + 1, T.bitwidth) + self.assertEqual(lz(-val), 0) + self.assertEqual(tz(val), tz(-val)) + for n in evens: + if not T.minval <= n <= T.maxval: + continue + self.assertGreater(tz(T(n)), 0) + self.assertEqual(tz(T(n + 1)), 0) + + def check_error_msg(self, func): + cfunc = njit(lambda *x: func(*x)) + func_name = func._name + + unsupported_types = filter( + lambda x: not isinstance(x, types.Integer), types.number_domain + ) + for typ in sorted(unsupported_types, key=str): + with self.assertRaises(TypingError) as e: + cfunc(typ(2)) + self.assertIn( + "{} is only defined for integers, but value passed was '{}'." + .format(func_name, typ), + str(e.exception), + ) + + # Testing w/ too many/few arguments + def check(args, string): + with self.assertRaises((TypingError, TypeError)) as e: + cfunc(*args) + self.assertIn( + "{}() ".format(func_name), + str(e.exception) + ) + + check((1, 2), "takes 2 positional arguments but 3 were given") + check((), "missing 1 required positional argument") + + def test_trailing_zeros_error(self): + self.check_error_msg(trailing_zeros) + + def test_leading_zeros_error(self): + self.check_error_msg(leading_zeros) diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_usecases.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_usecases.py new file mode 100644 index 0000000000000000000000000000000000000000..bf58dabe9835c9ee579f751cf8a9478418daf7c7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_usecases.py @@ -0,0 +1,192 @@ +import itertools +import unittest +import numpy as np + +from numba import jit, njit +from numba.core import types +from numba.tests import usecases +from numba.tests.support import TestCase + + +class TestUsecases(TestCase): + # NOTE: All these test cases are run in subprocesses to achieve total + # isolation. + + @TestCase.run_test_in_subprocess + def test_andor(self): + pyfunc = usecases.andor + cfunc = njit((types.int32, types.int32))(pyfunc) + + # Argument boundaries + xs = -1, 0, 1, 9, 10, 11 + ys = -1, 0, 1, 9, 10, 11 + + for args in itertools.product(xs, ys): + self.assertEqual(pyfunc(*args), cfunc(*args), "args %s" % (args,)) + + @TestCase.run_test_in_subprocess + def test_sum1d(self): + pyfunc = usecases.sum1d + cfunc = njit((types.int32, types.int32))(pyfunc) + + ss = -1, 0, 1, 100, 200 + es = -1, 0, 1, 100, 200 + + for args in itertools.product(ss, es): + self.assertEqual(pyfunc(*args), cfunc(*args), args) + + @TestCase.run_test_in_subprocess + def test_sum1d_pyobj(self): + pyfunc = usecases.sum1d + cfunc = jit((types.int32, types.int32), forceobj=True)(pyfunc) + + ss = -1, 0, 1, 100, 200 + es = -1, 0, 1, 100, 200 + + for args in itertools.product(ss, es): + self.assertEqual(pyfunc(*args), cfunc(*args), args) + + @TestCase.run_test_in_subprocess + def test_sum2d(self): + pyfunc = usecases.sum2d + cfunc = njit((types.int32, types.int32))(pyfunc) + + ss = -1, 0, 1, 100, 200 + es = -1, 0, 1, 100, 200 + + for args in itertools.product(ss, es): + self.assertEqual(pyfunc(*args), cfunc(*args), args) + + @TestCase.run_test_in_subprocess + def test_while_count(self): + pyfunc = usecases.while_count + cfunc = njit((types.int32, types.int32))(pyfunc) + + ss = -1, 0, 1, 100, 200 + es = -1, 0, 1, 100, 200 + + for args in itertools.product(ss, es): + self.assertEqual(pyfunc(*args), cfunc(*args), args) + + @TestCase.run_test_in_subprocess + def test_copy_arrays(self): + pyfunc = usecases.copy_arrays + arraytype = types.Array(types.int32, 1, 'A') + cfunc = njit((arraytype, arraytype))(pyfunc) + + nda = 0, 1, 10, 100 + + for nd in nda: + a = np.arange(nd, dtype='int32') + b = np.empty_like(a) + args = a, b + + cfunc(*args) + self.assertPreciseEqual(a, b, msg=str(args)) + + @TestCase.run_test_in_subprocess + def test_copy_arrays2d(self): + pyfunc = usecases.copy_arrays2d + arraytype = types.Array(types.int32, 2, 'A') + cfunc = njit((arraytype, arraytype))(pyfunc) + + nda = (0, 0), (1, 1), (2, 5), (4, 25) + + for nd in nda: + d1, d2 = nd + a = np.arange(d1 * d2, dtype='int32').reshape(d1, d2) + b = np.empty_like(a) + args = a, b + + cfunc(*args) + self.assertPreciseEqual(a, b, msg=str(args)) + + @TestCase.run_test_in_subprocess + def test_string_concat(self): + pyfunc = usecases.string_concat + cfunc = jit((types.int32, types.int32), forceobj=True)(pyfunc) + + xs = -1, 0, 1 + ys = -1, 0, 1 + + for x, y in itertools.product(xs, ys): + args = x, y + self.assertEqual(pyfunc(*args), cfunc(*args), args) + + @TestCase.run_test_in_subprocess + def test_string_len(self): + pyfunc = usecases.string_len + cfunc = jit((types.pyobject,), forceobj=True)(pyfunc) + + test_str = '123456' + self.assertEqual(pyfunc(test_str), cfunc(test_str)) + test_str = '1' + self.assertEqual(pyfunc(test_str), cfunc(test_str)) + test_str = '' + self.assertEqual(pyfunc(test_str), cfunc(test_str)) + + @TestCase.run_test_in_subprocess + def test_string_slicing(self): + pyfunc = usecases.string_slicing + cfunc = jit((types.pyobject,) * 3, forceobj=True)(pyfunc) + + test_str = '123456' + self.assertEqual(pyfunc(test_str, 0, 3), cfunc(test_str, 0, 3)) + self.assertEqual(pyfunc(test_str, 1, 5), cfunc(test_str, 1, 5)) + self.assertEqual(pyfunc(test_str, 2, 3), cfunc(test_str, 2, 3)) + + @TestCase.run_test_in_subprocess + def test_string_conversion(self): + pyfunc = usecases.string_conversion + + cfunc = jit((types.int32,), forceobj=True)(pyfunc) + self.assertEqual(pyfunc(1), cfunc(1)) + + cfunc = jit((types.float32,), forceobj=True)(pyfunc) + self.assertEqual(pyfunc(1.1), cfunc(1.1)) + + @TestCase.run_test_in_subprocess + def test_string_comparisons(self): + import operator + pyfunc = usecases.string_comparison + cfunc = jit((types.pyobject, types.pyobject, types.pyobject), + forceobj=True)(pyfunc) + + test_str1 = '123' + test_str2 = '123' + op = operator.eq + self.assertEqual(pyfunc(test_str1, test_str2, op), + cfunc(test_str1, test_str2, op)) + + test_str1 = '123' + test_str2 = '456' + op = operator.eq + self.assertEqual(pyfunc(test_str1, test_str2, op), + cfunc(test_str1, test_str2, op)) + + test_str1 = '123' + test_str2 = '123' + op = operator.ne + self.assertEqual(pyfunc(test_str1, test_str2, op), + cfunc(test_str1, test_str2, op)) + + test_str1 = '123' + test_str2 = '456' + op = operator.ne + self.assertEqual(pyfunc(test_str1, test_str2, op), + cfunc(test_str1, test_str2, op)) + + @TestCase.run_test_in_subprocess + def test_blackscholes_cnd(self): + pyfunc = usecases.blackscholes_cnd + cfunc = njit((types.float32,))(pyfunc) + + ds = -0.5, 0, 0.5 + + for d in ds: + args = (d,) + self.assertEqual(pyfunc(*args), cfunc(*args), args) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_vectorization.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_vectorization.py new file mode 100644 index 0000000000000000000000000000000000000000..924c8ca61969694b69d11bd960b264abfd3afa1d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_vectorization.py @@ -0,0 +1,87 @@ +import platform +import numpy as np +from numba import types +import unittest +from numba import njit +from numba.core import config +from numba.tests.support import TestCase + +_DEBUG = False +if _DEBUG: + from llvmlite import binding as llvm + # Prints debug info from the LLVMs vectorizer + llvm.set_option("", "--debug-only=loop-vectorize") + + +_skylake_env = { + "NUMBA_CPU_NAME": "skylake-avx512", + "NUMBA_CPU_FEATURES": "", +} + + +@unittest.skipIf(platform.machine() != 'x86_64', 'x86_64 only test') +class TestVectorization(TestCase): + """ + Tests to assert that code which should vectorize does indeed vectorize + """ + def gen_ir(self, func, args_tuple, fastmath=False): + self.assertEqual(config.CPU_NAME, "skylake-avx512") + self.assertEqual(config.CPU_FEATURES, "") + + jitted = njit(args_tuple, fastmath=fastmath)(func) + return jitted.inspect_llvm(args_tuple) + + @TestCase.run_test_in_subprocess(envvars=_skylake_env) + def test_nditer_loop(self): + # see https://github.com/numba/numba/issues/5033 + def do_sum(x): + acc = 0 + for v in np.nditer(x): + acc += v.item() + return acc + + llvm_ir = self.gen_ir(do_sum, (types.float64[::1],), fastmath=True) + self.assertIn("vector.body", llvm_ir) + self.assertIn("llvm.loop.isvectorized", llvm_ir) + + # SLP is off by default due to miscompilations, see #8705. Put this into a + # subprocess to isolate any potential issues. + @TestCase.run_test_in_subprocess( + envvars={'NUMBA_SLP_VECTORIZE': '1', **_skylake_env}, + ) + def test_slp(self): + # Sample translated from: + # https://www.llvm.org/docs/Vectorizers.html#the-slp-vectorizer + + def foo(a1, a2, b1, b2, A): + A[0] = a1 * (a1 + b1) + A[1] = a2 * (a2 + b2) + A[2] = a1 * (a1 + b1) + A[3] = a2 * (a2 + b2) + + ty = types.float64 + llvm_ir = self.gen_ir(foo, ((ty,) * 4 + (ty[::1],)), fastmath=True) + self.assertIn("2 x double", llvm_ir) + + @TestCase.run_test_in_subprocess(envvars=_skylake_env) + def test_instcombine_effect(self): + # Without instcombine running ahead of refprune, the IR has refops that + # are trivially prunable (same BB) but the arguments are obfuscated + # through aliases etc. The follow case triggers this situation as the + # typed.List has a structproxy call for computing `len` and getting the + # base pointer for use in iteration. + + def sum_sqrt_list(lst): + acc = 0.0 + for item in lst: + acc += np.sqrt(item) + return acc + + llvm_ir = self.gen_ir(sum_sqrt_list, (types.ListType(types.float64),), + fastmath=True) + self.assertIn("vector.body", llvm_ir) + self.assertIn("llvm.loop.isvectorized", llvm_ir) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_vectorization_type_inference.py b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_vectorization_type_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..c183bf602015966a6b75cd4fcbb7114f602435c2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/numba/tests/test_vectorization_type_inference.py @@ -0,0 +1,41 @@ +from numba import vectorize, jit, bool_, double, int_, float32, typeof, int8 +import unittest +import numpy as np + + +def add(a, b): + return a + b + + +def func(dtypeA, dtypeB): + A = np.arange(10, dtype=dtypeA) + B = np.arange(10, dtype=dtypeB) + return typeof(vector_add(A, B)) + + +class TestVectTypeInfer(unittest.TestCase): + + def test_type_inference(self): + """This is testing numpy ufunc dispatch machinery + """ + global vector_add + vector_add = vectorize([ + bool_(double, int_), + double(double, double), + float32(double, float32), + ])(add) + + def numba_type_equal(a, b): + self.assertEqual(a.dtype, b.dtype) + self.assertEqual(a.ndim, b.ndim) + + numba_type_equal(func(np.dtype(np.float64), np.dtype('i')), bool_[:]) + numba_type_equal(func(np.dtype(np.float64), np.dtype(np.float64)), + double[:]) + # This is because the double(double, double) matches first + numba_type_equal(func(np.dtype(np.float64), np.dtype(np.float32)), + double[:]) + + +if __name__ == '__main__': + unittest.main() diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/pygments/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/pygments/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..446a1a805c8a949579fb8a9799f2bec7777349dc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/pygments/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2006-2022 by the respective authors (see AUTHORS file). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/pyproject_hooks/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/pyproject_hooks/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b0ae9dbc262b5f7ed4cb6f964cfb5eb5c0d0b0be --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/pyproject_hooks/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Thomas Kluyver + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/requests/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/requests/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..67db8588217f266eb561f75fae738656325deac9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/requests/LICENSE @@ -0,0 +1,175 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/resolvelib/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/resolvelib/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b9077766e9b9bdcae49ea5c8fced750ed13ec8f7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/resolvelib/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2018, Tzu-ping Chung + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/rich/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/rich/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4415505566f261c802b671426be529a31f914137 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/rich/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020 Will McGugan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/tomli/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/tomli/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e859590f886cd78344206af1a8ccb3080d4385e0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/tomli/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Taneli Hukkinen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/tomli/LICENSE-HEADER b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/tomli/LICENSE-HEADER new file mode 100644 index 0000000000000000000000000000000000000000..aba78dd2cfc42c15dc73d0e8841245bd4df89d31 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/tomli/LICENSE-HEADER @@ -0,0 +1,3 @@ +SPDX-License-Identifier: MIT +SPDX-FileCopyrightText: 2021 Taneli Hukkinen +Licensed to PSF under a Contributor Agreement. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/tomli_w/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/tomli_w/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e859590f886cd78344206af1a8ccb3080d4385e0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/tomli_w/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Taneli Hukkinen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/truststore/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/truststore/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7ec568c1136eb8ec86aa05cf7abacfb54c3e5ead --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/truststore/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Seth Michael Larson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/urllib3/LICENSE.txt b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/urllib3/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..429a1767e4476707d2e45ee499e3c834ca4b187f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pip-25.2.dist-info/licenses/src/pip/_vendor/urllib3/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2008-2020 Andrey Petrov and contributors (see CONTRIBUTORS.txt) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa716417374ac77d9744b51d105a0b4a94813121 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/_migration.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/_migration.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8d28e1cd4bd45729133d2db6dac920539cd0bf9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/_migration.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/alias_generators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/alias_generators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2154f7ad6c50157f5c28cdc0df749ce58bd3dc48 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/alias_generators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/aliases.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/aliases.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78577d35af560e795ac59728805445752f9f976f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/aliases.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/annotated_handlers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/annotated_handlers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bdf5bcb06afae5630d9162340ccfe3e82673b6eb Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/annotated_handlers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/class_validators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/class_validators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..efa8f77fdbd16b82d3f5681b53517c042828a30e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/class_validators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/color.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/color.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ec230b5144e2fe87e46696deef06d6c6e059e57 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/color.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/config.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/config.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..149e16ea59f321fd93825ebbb2f46211239b7531 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/config.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/dataclasses.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/dataclasses.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa2d5838d3c77590d565632e6c72bbc5ff7c29d8 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/dataclasses.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/datetime_parse.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/datetime_parse.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..844076a69357fb8bf77a5c9cce95499a159a6474 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/datetime_parse.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/decorator.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/decorator.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..682624241cdb998aef9c1747531bef670ad5c557 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/decorator.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/env_settings.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/env_settings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1590c21ed03d29aaa2b70bcb14981df6be7a691 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/env_settings.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/error_wrappers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/error_wrappers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1238a341ca96e882656374d525ed28ff8ac686e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/error_wrappers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/errors.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/errors.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2499882c05f6f8f9f55e22836f58203690a8afe2 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/errors.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/fields.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/fields.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50c88574241c7687a711009a8f6de6ef014441cc Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/fields.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/functional_serializers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/functional_serializers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68d1ac4dd67fbb060adc230413620fed5a5f0c38 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/functional_serializers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/functional_validators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/functional_validators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..30dc03065df58fc667a6d461ee8d659dc38aeb72 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/functional_validators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/generics.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/generics.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe9c633f94bd869eda498b9eb48cfbc00f861993 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/generics.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/json.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/json.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..481d4f8c50a5338751531dc34f014d73d6701507 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/json.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/json_schema.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/json_schema.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d430263969a02ccb774e044d7b1c12a6bf811f17 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/json_schema.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34e1aba1a929f27b2c264eecf6aa5b609a35b53ad98ac878c95a646784f48807 +size 113873 diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/main.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/main.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..506bf9d2ea506c578c0d48009731e28d10272113 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/main.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/mypy.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/mypy.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9f678ea6d6f3cb3e9d4d3c3f99c0f95edd5d1d5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/mypy.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/networks.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/networks.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aed3fab691b50fa779cfdff75d6c3ece057a94cf Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/networks.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/parse.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/parse.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..61bb06917cb91febfc86cf7a43d8b7fe24cb78cb Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/parse.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/root_model.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/root_model.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..954fd1ad75dd748eebf0fa98a51a5946e78c0c71 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/root_model.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/schema.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/schema.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9872032360e8995c4b16bd8249f03432e99119ab Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/schema.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/tools.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/tools.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a4be8e8f1a6aa980e6dd322d18a3ec905ddf1a8 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/tools.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/type_adapter.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/type_adapter.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b68aaef2d6e5a50834843d823771ac0950e7185a Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/type_adapter.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/types.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/types.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4fd0d75c886f20d864183679b9ca6543e9547fe Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/types.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/typing.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/typing.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a6aac5f263c6b2a9401a8ff97dc308e9cfe40d9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/typing.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8855a44d66f619e28af7a7d35cc7b9e742cfa608 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/validate_call_decorator.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/validate_call_decorator.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17915f93a718e660acda0a2ca76c0120dab46835 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/validate_call_decorator.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/validators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/validators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ea563126f682fb6c6f993c18abcc1832231d309 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/validators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/version.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ea57244aac46c4d543ffbb5894bf030c5692411 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/version.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/warnings.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/warnings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..694876fe761c474bf4ee9abc1546974b740d2195 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/__pycache__/warnings.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de4061feb4f0181313c248cd33bca69b1fbcfaef Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_config.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_config.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc7d57f9f569cc206f281529dd59566c79d08019 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_config.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_core_metadata.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_core_metadata.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..afbf3d50a8f09f57af21cc2b03c404dfbe682827 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_core_metadata.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_core_utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_core_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36ae715f9f275da64350a4b38a76c9ef2f79de17 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_core_utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_dataclasses.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_dataclasses.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0576090ffb5b75330eda8efecb1db81576647209 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_dataclasses.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_decorators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_decorators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9b1b3970c05b59470df1cf7c81ed7529263adcb Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_decorators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_decorators_v1.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_decorators_v1.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68ecd69113fa126dc9347adfe0a189892cbe8c6e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_decorators_v1.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_discriminated_union.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_discriminated_union.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94dce87dd34c36e3151417bcebab836c31c79dc4 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_discriminated_union.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_docs_extraction.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_docs_extraction.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..13731839532731cc6bb590913130ddc9161935a5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_docs_extraction.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_fields.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_fields.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..600682a5498df23756acf5652e61609936565614 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_fields.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_forward_ref.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_forward_ref.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd312f563a5b90ed04b111968789f908946b2dc9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_forward_ref.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generate_schema.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generate_schema.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ad44e2bf31ee94110a5cba7ff234509d561115b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generate_schema.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38ba9cc15c76ce90e0085603abc408a1e6aef30ea6cd26f537ef1b2da3bd84b7 +size 133373 diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generics.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generics.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16ffd0c2fe924a9fb1a27763b731e3cf9c85eaa3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generics.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_git.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_git.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..717c1bfd8e32fcefede5485b6ea9efd2c81d48b3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_git.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_import_utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_import_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10eae2538fdb1dc8f4c7d7160af0ebb5057cc100 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_import_utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_internal_dataclass.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_internal_dataclass.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ed87b09bc784249444b3d8b069035f1c04a2f41 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_internal_dataclass.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_known_annotated_metadata.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_known_annotated_metadata.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd90ff6b233cce2e2c5024cfe3b1ca589a02cfee Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_known_annotated_metadata.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_mock_val_ser.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_mock_val_ser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cafba52861af1343b6ce67a4897fa7451ed6648e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_mock_val_ser.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_model_construction.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_model_construction.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ba65973e8858ead87c7e17ef0fdb4b859c79161 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_model_construction.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_namespace_utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_namespace_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d49d35aa7b5a0d9ddec3ce25f01cc5c10753257 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_namespace_utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_repr.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_repr.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f53f71add6b6773dc4aed01ce54abb17d9672f5f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_repr.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_schema_gather.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_schema_gather.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68c5af127e44139529fcb7bb57046d0d4453a0d9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_schema_gather.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_schema_generation_shared.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_schema_generation_shared.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e2cb32522c7c3187c7cf38dcfcb0904991671a1 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_schema_generation_shared.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_serializers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_serializers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa0567ea65ec069569731ece4de7f1fc50960a90 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_serializers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_signature.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_signature.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b78e310b90abf82d8ba6724d019d6d3af155ce44 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_signature.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_typing_extra.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_typing_extra.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82e34df2c1bb63f9cae3a280818247a25c4819d0 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_typing_extra.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..124e2bc42745280358daf3731c866af12c9d6352 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_validate_call.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_validate_call.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1431b11bbeef6ba35e6baffdcfeca902f3d01589 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_validate_call.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_validators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_validators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f6c3bbd0143a0ca3face27e0d8161ffec895939c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_validators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_config.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_config.py new file mode 100644 index 0000000000000000000000000000000000000000..fe7126463379f6ceec7b860496e16fbfddbab6c9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_config.py @@ -0,0 +1,373 @@ +from __future__ import annotations as _annotations + +import warnings +from contextlib import contextmanager +from re import Pattern +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Literal, + cast, +) + +from pydantic_core import core_schema +from typing_extensions import Self + +from ..aliases import AliasGenerator +from ..config import ConfigDict, ExtraValues, JsonDict, JsonEncoder, JsonSchemaExtraCallable +from ..errors import PydanticUserError +from ..warnings import PydanticDeprecatedSince20, PydanticDeprecatedSince210 + +if not TYPE_CHECKING: + # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915 + # and https://youtrack.jetbrains.com/issue/PY-51428 + DeprecationWarning = PydanticDeprecatedSince20 + +if TYPE_CHECKING: + from .._internal._schema_generation_shared import GenerateSchema + from ..fields import ComputedFieldInfo, FieldInfo + +DEPRECATION_MESSAGE = 'Support for class-based `config` is deprecated, use ConfigDict instead.' + + +class ConfigWrapper: + """Internal wrapper for Config which exposes ConfigDict items as attributes.""" + + __slots__ = ('config_dict',) + + config_dict: ConfigDict + + # all annotations are copied directly from ConfigDict, and should be kept up to date, a test will fail if they + # stop matching + title: str | None + str_to_lower: bool + str_to_upper: bool + str_strip_whitespace: bool + str_min_length: int + str_max_length: int | None + extra: ExtraValues | None + frozen: bool + populate_by_name: bool + use_enum_values: bool + validate_assignment: bool + arbitrary_types_allowed: bool + from_attributes: bool + # whether to use the actual key provided in the data (e.g. alias or first alias for "field required" errors) instead of field_names + # to construct error `loc`s, default `True` + loc_by_alias: bool + alias_generator: Callable[[str], str] | AliasGenerator | None + model_title_generator: Callable[[type], str] | None + field_title_generator: Callable[[str, FieldInfo | ComputedFieldInfo], str] | None + ignored_types: tuple[type, ...] + allow_inf_nan: bool + json_schema_extra: JsonDict | JsonSchemaExtraCallable | None + json_encoders: dict[type[object], JsonEncoder] | None + + # new in V2 + strict: bool + # whether instances of models and dataclasses (including subclass instances) should re-validate, default 'never' + revalidate_instances: Literal['always', 'never', 'subclass-instances'] + ser_json_timedelta: Literal['iso8601', 'float'] + ser_json_bytes: Literal['utf8', 'base64', 'hex'] + val_json_bytes: Literal['utf8', 'base64', 'hex'] + ser_json_inf_nan: Literal['null', 'constants', 'strings'] + # whether to validate default values during validation, default False + validate_default: bool + validate_return: bool + protected_namespaces: tuple[str | Pattern[str], ...] + hide_input_in_errors: bool + defer_build: bool + plugin_settings: dict[str, object] | None + schema_generator: type[GenerateSchema] | None + json_schema_serialization_defaults_required: bool + json_schema_mode_override: Literal['validation', 'serialization', None] + coerce_numbers_to_str: bool + regex_engine: Literal['rust-regex', 'python-re'] + validation_error_cause: bool + use_attribute_docstrings: bool + cache_strings: bool | Literal['all', 'keys', 'none'] + validate_by_alias: bool + validate_by_name: bool + serialize_by_alias: bool + + def __init__(self, config: ConfigDict | dict[str, Any] | type[Any] | None, *, check: bool = True): + if check: + self.config_dict = prepare_config(config) + else: + self.config_dict = cast(ConfigDict, config) + + @classmethod + def for_model(cls, bases: tuple[type[Any], ...], namespace: dict[str, Any], kwargs: dict[str, Any]) -> Self: + """Build a new `ConfigWrapper` instance for a `BaseModel`. + + The config wrapper built based on (in descending order of priority): + - options from `kwargs` + - options from the `namespace` + - options from the base classes (`bases`) + + Args: + bases: A tuple of base classes. + namespace: The namespace of the class being created. + kwargs: The kwargs passed to the class being created. + + Returns: + A `ConfigWrapper` instance for `BaseModel`. + """ + config_new = ConfigDict() + for base in bases: + config = getattr(base, 'model_config', None) + if config: + config_new.update(config.copy()) + + config_class_from_namespace = namespace.get('Config') + config_dict_from_namespace = namespace.get('model_config') + + raw_annotations = namespace.get('__annotations__', {}) + if raw_annotations.get('model_config') and config_dict_from_namespace is None: + raise PydanticUserError( + '`model_config` cannot be used as a model field name. Use `model_config` for model configuration.', + code='model-config-invalid-field-name', + ) + + if config_class_from_namespace and config_dict_from_namespace: + raise PydanticUserError('"Config" and "model_config" cannot be used together', code='config-both') + + config_from_namespace = config_dict_from_namespace or prepare_config(config_class_from_namespace) + + config_new.update(config_from_namespace) + + for k in list(kwargs.keys()): + if k in config_keys: + config_new[k] = kwargs.pop(k) + + return cls(config_new) + + # we don't show `__getattr__` to type checkers so missing attributes cause errors + if not TYPE_CHECKING: # pragma: no branch + + def __getattr__(self, name: str) -> Any: + try: + return self.config_dict[name] + except KeyError: + try: + return config_defaults[name] + except KeyError: + raise AttributeError(f'Config has no attribute {name!r}') from None + + def core_config(self, title: str | None) -> core_schema.CoreConfig: + """Create a pydantic-core config. + + We don't use getattr here since we don't want to populate with defaults. + + Args: + title: The title to use if not set in config. + + Returns: + A `CoreConfig` object created from config. + """ + config = self.config_dict + + if config.get('schema_generator') is not None: + warnings.warn( + 'The `schema_generator` setting has been deprecated since v2.10. This setting no longer has any effect.', + PydanticDeprecatedSince210, + stacklevel=2, + ) + + if (populate_by_name := config.get('populate_by_name')) is not None: + # We include this patch for backwards compatibility purposes, but this config setting will be deprecated in v3.0, and likely removed in v4.0. + # Thus, the above warning and this patch can be removed then as well. + if config.get('validate_by_name') is None: + config['validate_by_alias'] = True + config['validate_by_name'] = populate_by_name + + # We dynamically patch validate_by_name to be True if validate_by_alias is set to False + # and validate_by_name is not explicitly set. + if config.get('validate_by_alias') is False and config.get('validate_by_name') is None: + config['validate_by_name'] = True + + if (not config.get('validate_by_alias', True)) and (not config.get('validate_by_name', False)): + raise PydanticUserError( + 'At least one of `validate_by_alias` or `validate_by_name` must be set to True.', + code='validate-by-alias-and-name-false', + ) + + return core_schema.CoreConfig( + **{ # pyright: ignore[reportArgumentType] + k: v + for k, v in ( + ('title', config.get('title') or title or None), + ('extra_fields_behavior', config.get('extra')), + ('allow_inf_nan', config.get('allow_inf_nan')), + ('str_strip_whitespace', config.get('str_strip_whitespace')), + ('str_to_lower', config.get('str_to_lower')), + ('str_to_upper', config.get('str_to_upper')), + ('strict', config.get('strict')), + ('ser_json_timedelta', config.get('ser_json_timedelta')), + ('ser_json_bytes', config.get('ser_json_bytes')), + ('val_json_bytes', config.get('val_json_bytes')), + ('ser_json_inf_nan', config.get('ser_json_inf_nan')), + ('from_attributes', config.get('from_attributes')), + ('loc_by_alias', config.get('loc_by_alias')), + ('revalidate_instances', config.get('revalidate_instances')), + ('validate_default', config.get('validate_default')), + ('str_max_length', config.get('str_max_length')), + ('str_min_length', config.get('str_min_length')), + ('hide_input_in_errors', config.get('hide_input_in_errors')), + ('coerce_numbers_to_str', config.get('coerce_numbers_to_str')), + ('regex_engine', config.get('regex_engine')), + ('validation_error_cause', config.get('validation_error_cause')), + ('cache_strings', config.get('cache_strings')), + ('validate_by_alias', config.get('validate_by_alias')), + ('validate_by_name', config.get('validate_by_name')), + ('serialize_by_alias', config.get('serialize_by_alias')), + ) + if v is not None + } + ) + + def __repr__(self): + c = ', '.join(f'{k}={v!r}' for k, v in self.config_dict.items()) + return f'ConfigWrapper({c})' + + +class ConfigWrapperStack: + """A stack of `ConfigWrapper` instances.""" + + def __init__(self, config_wrapper: ConfigWrapper): + self._config_wrapper_stack: list[ConfigWrapper] = [config_wrapper] + + @property + def tail(self) -> ConfigWrapper: + return self._config_wrapper_stack[-1] + + @contextmanager + def push(self, config_wrapper: ConfigWrapper | ConfigDict | None): + if config_wrapper is None: + yield + return + + if not isinstance(config_wrapper, ConfigWrapper): + config_wrapper = ConfigWrapper(config_wrapper, check=False) + + self._config_wrapper_stack.append(config_wrapper) + try: + yield + finally: + self._config_wrapper_stack.pop() + + +config_defaults = ConfigDict( + title=None, + str_to_lower=False, + str_to_upper=False, + str_strip_whitespace=False, + str_min_length=0, + str_max_length=None, + # let the model / dataclass decide how to handle it + extra=None, + frozen=False, + populate_by_name=False, + use_enum_values=False, + validate_assignment=False, + arbitrary_types_allowed=False, + from_attributes=False, + loc_by_alias=True, + alias_generator=None, + model_title_generator=None, + field_title_generator=None, + ignored_types=(), + allow_inf_nan=True, + json_schema_extra=None, + strict=False, + revalidate_instances='never', + ser_json_timedelta='iso8601', + ser_json_bytes='utf8', + val_json_bytes='utf8', + ser_json_inf_nan='null', + validate_default=False, + validate_return=False, + protected_namespaces=('model_validate', 'model_dump'), + hide_input_in_errors=False, + json_encoders=None, + defer_build=False, + schema_generator=None, + plugin_settings=None, + json_schema_serialization_defaults_required=False, + json_schema_mode_override=None, + coerce_numbers_to_str=False, + regex_engine='rust-regex', + validation_error_cause=False, + use_attribute_docstrings=False, + cache_strings=True, + validate_by_alias=True, + validate_by_name=False, + serialize_by_alias=False, +) + + +def prepare_config(config: ConfigDict | dict[str, Any] | type[Any] | None) -> ConfigDict: + """Create a `ConfigDict` instance from an existing dict, a class (e.g. old class-based config) or None. + + Args: + config: The input config. + + Returns: + A ConfigDict object created from config. + """ + if config is None: + return ConfigDict() + + if not isinstance(config, dict): + warnings.warn(DEPRECATION_MESSAGE, DeprecationWarning) + config = {k: getattr(config, k) for k in dir(config) if not k.startswith('__')} + + config_dict = cast(ConfigDict, config) + check_deprecated(config_dict) + return config_dict + + +config_keys = set(ConfigDict.__annotations__.keys()) + + +V2_REMOVED_KEYS = { + 'allow_mutation', + 'error_msg_templates', + 'fields', + 'getter_dict', + 'smart_union', + 'underscore_attrs_are_private', + 'json_loads', + 'json_dumps', + 'copy_on_model_validation', + 'post_init_call', +} +V2_RENAMED_KEYS = { + 'allow_population_by_field_name': 'validate_by_name', + 'anystr_lower': 'str_to_lower', + 'anystr_strip_whitespace': 'str_strip_whitespace', + 'anystr_upper': 'str_to_upper', + 'keep_untouched': 'ignored_types', + 'max_anystr_length': 'str_max_length', + 'min_anystr_length': 'str_min_length', + 'orm_mode': 'from_attributes', + 'schema_extra': 'json_schema_extra', + 'validate_all': 'validate_default', +} + + +def check_deprecated(config_dict: ConfigDict) -> None: + """Check for deprecated config keys and warn the user. + + Args: + config_dict: The input config. + """ + deprecated_removed_keys = V2_REMOVED_KEYS & config_dict.keys() + deprecated_renamed_keys = V2_RENAMED_KEYS.keys() & config_dict.keys() + if deprecated_removed_keys or deprecated_renamed_keys: + renamings = {k: V2_RENAMED_KEYS[k] for k in sorted(deprecated_renamed_keys)} + renamed_bullets = [f'* {k!r} has been renamed to {v!r}' for k, v in renamings.items()] + removed_bullets = [f'* {k!r} has been removed' for k in sorted(deprecated_removed_keys)] + message = '\n'.join(['Valid config keys have changed in V2:'] + renamed_bullets + removed_bullets) + warnings.warn(message, UserWarning) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_core_metadata.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_core_metadata.py new file mode 100644 index 0000000000000000000000000000000000000000..9f2510c03429b6de24063bec5937e4334077722d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_core_metadata.py @@ -0,0 +1,97 @@ +from __future__ import annotations as _annotations + +from typing import TYPE_CHECKING, Any, TypedDict, cast +from warnings import warn + +if TYPE_CHECKING: + from ..config import JsonDict, JsonSchemaExtraCallable + from ._schema_generation_shared import ( + GetJsonSchemaFunction, + ) + + +class CoreMetadata(TypedDict, total=False): + """A `TypedDict` for holding the metadata dict of the schema. + + Attributes: + pydantic_js_functions: List of JSON schema functions that resolve refs during application. + pydantic_js_annotation_functions: List of JSON schema functions that don't resolve refs during application. + pydantic_js_prefer_positional_arguments: Whether JSON schema generator will + prefer positional over keyword arguments for an 'arguments' schema. + custom validation function. Only applies to before, plain, and wrap validators. + pydantic_js_updates: key / value pair updates to apply to the JSON schema for a type. + pydantic_js_extra: WIP, either key/value pair updates to apply to the JSON schema, or a custom callable. + pydantic_internal_union_tag_key: Used internally by the `Tag` metadata to specify the tag used for a discriminated union. + pydantic_internal_union_discriminator: Used internally to specify the discriminator value for a discriminated union + when the discriminator was applied to a `'definition-ref'` schema, and that reference was missing at the time + of the annotation application. + + TODO: Perhaps we should move this structure to pydantic-core. At the moment, though, + it's easier to iterate on if we leave it in pydantic until we feel there is a semi-stable API. + + TODO: It's unfortunate how functionally oriented JSON schema generation is, especially that which occurs during + the core schema generation process. It's inevitable that we need to store some json schema related information + on core schemas, given that we generate JSON schemas directly from core schemas. That being said, debugging related + issues is quite difficult when JSON schema information is disguised via dynamically defined functions. + """ + + pydantic_js_functions: list[GetJsonSchemaFunction] + pydantic_js_annotation_functions: list[GetJsonSchemaFunction] + pydantic_js_prefer_positional_arguments: bool + pydantic_js_updates: JsonDict + pydantic_js_extra: JsonDict | JsonSchemaExtraCallable + pydantic_internal_union_tag_key: str + pydantic_internal_union_discriminator: str + + +def update_core_metadata( + core_metadata: Any, + /, + *, + pydantic_js_functions: list[GetJsonSchemaFunction] | None = None, + pydantic_js_annotation_functions: list[GetJsonSchemaFunction] | None = None, + pydantic_js_updates: JsonDict | None = None, + pydantic_js_extra: JsonDict | JsonSchemaExtraCallable | None = None, +) -> None: + from ..json_schema import PydanticJsonSchemaWarning + + """Update CoreMetadata instance in place. When we make modifications in this function, they + take effect on the `core_metadata` reference passed in as the first (and only) positional argument. + + First, cast to `CoreMetadata`, then finish with a cast to `dict[str, Any]` for core schema compatibility. + We do this here, instead of before / after each call to this function so that this typing hack + can be easily removed if/when we move `CoreMetadata` to `pydantic-core`. + + For parameter descriptions, see `CoreMetadata` above. + """ + core_metadata = cast(CoreMetadata, core_metadata) + + if pydantic_js_functions: + core_metadata.setdefault('pydantic_js_functions', []).extend(pydantic_js_functions) + + if pydantic_js_annotation_functions: + core_metadata.setdefault('pydantic_js_annotation_functions', []).extend(pydantic_js_annotation_functions) + + if pydantic_js_updates: + if (existing_updates := core_metadata.get('pydantic_js_updates')) is not None: + core_metadata['pydantic_js_updates'] = {**existing_updates, **pydantic_js_updates} + else: + core_metadata['pydantic_js_updates'] = pydantic_js_updates + + if pydantic_js_extra is not None: + existing_pydantic_js_extra = core_metadata.get('pydantic_js_extra') + if existing_pydantic_js_extra is None: + core_metadata['pydantic_js_extra'] = pydantic_js_extra + if isinstance(existing_pydantic_js_extra, dict): + if isinstance(pydantic_js_extra, dict): + core_metadata['pydantic_js_extra'] = {**existing_pydantic_js_extra, **pydantic_js_extra} + if callable(pydantic_js_extra): + warn( + 'Composing `dict` and `callable` type `json_schema_extra` is not supported.' + 'The `callable` type is being ignored.' + "If you'd like support for this behavior, please open an issue on pydantic.", + PydanticJsonSchemaWarning, + ) + if callable(existing_pydantic_js_extra): + # if ever there's a case of a callable, we'll just keep the last json schema extra spec + core_metadata['pydantic_js_extra'] = pydantic_js_extra diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_core_utils.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_core_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..cf8cf7c5f078536490a3d802cf421daae962971b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_core_utils.py @@ -0,0 +1,182 @@ +from __future__ import annotations + +import inspect +import os +from collections.abc import Mapping, Sequence +from typing import TYPE_CHECKING, Any, Union + +from pydantic_core import CoreSchema, core_schema +from pydantic_core import validate_core_schema as _validate_core_schema +from typing_extensions import TypeGuard, get_args, get_origin +from typing_inspection import typing_objects + +from . import _repr +from ._typing_extra import is_generic_alias + +if TYPE_CHECKING: + from rich.console import Console + +AnyFunctionSchema = Union[ + core_schema.AfterValidatorFunctionSchema, + core_schema.BeforeValidatorFunctionSchema, + core_schema.WrapValidatorFunctionSchema, + core_schema.PlainValidatorFunctionSchema, +] + + +FunctionSchemaWithInnerSchema = Union[ + core_schema.AfterValidatorFunctionSchema, + core_schema.BeforeValidatorFunctionSchema, + core_schema.WrapValidatorFunctionSchema, +] + +CoreSchemaField = Union[ + core_schema.ModelField, core_schema.DataclassField, core_schema.TypedDictField, core_schema.ComputedField +] +CoreSchemaOrField = Union[core_schema.CoreSchema, CoreSchemaField] + +_CORE_SCHEMA_FIELD_TYPES = {'typed-dict-field', 'dataclass-field', 'model-field', 'computed-field'} +_FUNCTION_WITH_INNER_SCHEMA_TYPES = {'function-before', 'function-after', 'function-wrap'} +_LIST_LIKE_SCHEMA_WITH_ITEMS_TYPES = {'list', 'set', 'frozenset'} + + +def is_core_schema( + schema: CoreSchemaOrField, +) -> TypeGuard[CoreSchema]: + return schema['type'] not in _CORE_SCHEMA_FIELD_TYPES + + +def is_core_schema_field( + schema: CoreSchemaOrField, +) -> TypeGuard[CoreSchemaField]: + return schema['type'] in _CORE_SCHEMA_FIELD_TYPES + + +def is_function_with_inner_schema( + schema: CoreSchemaOrField, +) -> TypeGuard[FunctionSchemaWithInnerSchema]: + return schema['type'] in _FUNCTION_WITH_INNER_SCHEMA_TYPES + + +def is_list_like_schema_with_items_schema( + schema: CoreSchema, +) -> TypeGuard[core_schema.ListSchema | core_schema.SetSchema | core_schema.FrozenSetSchema]: + return schema['type'] in _LIST_LIKE_SCHEMA_WITH_ITEMS_TYPES + + +def get_type_ref(type_: Any, args_override: tuple[type[Any], ...] | None = None) -> str: + """Produces the ref to be used for this type by pydantic_core's core schemas. + + This `args_override` argument was added for the purpose of creating valid recursive references + when creating generic models without needing to create a concrete class. + """ + origin = get_origin(type_) or type_ + + args = get_args(type_) if is_generic_alias(type_) else (args_override or ()) + generic_metadata = getattr(type_, '__pydantic_generic_metadata__', None) + if generic_metadata: + origin = generic_metadata['origin'] or origin + args = generic_metadata['args'] or args + + module_name = getattr(origin, '__module__', '') + if typing_objects.is_typealiastype(origin): + type_ref = f'{module_name}.{origin.__name__}:{id(origin)}' + else: + try: + qualname = getattr(origin, '__qualname__', f'') + except Exception: + qualname = getattr(origin, '__qualname__', '') + type_ref = f'{module_name}.{qualname}:{id(origin)}' + + arg_refs: list[str] = [] + for arg in args: + if isinstance(arg, str): + # Handle string literals as a special case; we may be able to remove this special handling if we + # wrap them in a ForwardRef at some point. + arg_ref = f'{arg}:str-{id(arg)}' + else: + arg_ref = f'{_repr.display_as_type(arg)}:{id(arg)}' + arg_refs.append(arg_ref) + if arg_refs: + type_ref = f'{type_ref}[{",".join(arg_refs)}]' + return type_ref + + +def get_ref(s: core_schema.CoreSchema) -> None | str: + """Get the ref from the schema if it has one. + This exists just for type checking to work correctly. + """ + return s.get('ref', None) + + +def validate_core_schema(schema: CoreSchema) -> CoreSchema: + if os.getenv('PYDANTIC_VALIDATE_CORE_SCHEMAS'): + return _validate_core_schema(schema) + return schema + + +def _clean_schema_for_pretty_print(obj: Any, strip_metadata: bool = True) -> Any: # pragma: no cover + """A utility function to remove irrelevant information from a core schema.""" + if isinstance(obj, Mapping): + new_dct = {} + for k, v in obj.items(): + if k == 'metadata' and strip_metadata: + new_metadata = {} + + for meta_k, meta_v in v.items(): + if meta_k in ('pydantic_js_functions', 'pydantic_js_annotation_functions'): + new_metadata['js_metadata'] = '' + else: + new_metadata[meta_k] = _clean_schema_for_pretty_print(meta_v, strip_metadata=strip_metadata) + + if list(new_metadata.keys()) == ['js_metadata']: + new_metadata = {''} + + new_dct[k] = new_metadata + # Remove some defaults: + elif k in ('custom_init', 'root_model') and not v: + continue + else: + new_dct[k] = _clean_schema_for_pretty_print(v, strip_metadata=strip_metadata) + + return new_dct + elif isinstance(obj, Sequence) and not isinstance(obj, str): + return [_clean_schema_for_pretty_print(v, strip_metadata=strip_metadata) for v in obj] + else: + return obj + + +def pretty_print_core_schema( + val: Any, + *, + console: Console | None = None, + max_depth: int | None = None, + strip_metadata: bool = True, +) -> None: # pragma: no cover + """Pretty-print a core schema using the `rich` library. + + Args: + val: The core schema to print, or a Pydantic model/dataclass/type adapter + (in which case the cached core schema is fetched and printed). + console: A rich console to use when printing. Defaults to the global rich console instance. + max_depth: The number of nesting levels which may be printed. + strip_metadata: Whether to strip metadata in the output. If `True` any known core metadata + attributes will be stripped (but custom attributes are kept). Defaults to `True`. + """ + # lazy import: + from rich.pretty import pprint + + # circ. imports: + from pydantic import BaseModel, TypeAdapter + from pydantic.dataclasses import is_pydantic_dataclass + + if (inspect.isclass(val) and issubclass(val, BaseModel)) or is_pydantic_dataclass(val): + val = val.__pydantic_core_schema__ + if isinstance(val, TypeAdapter): + val = val.core_schema + cleaned_schema = _clean_schema_for_pretty_print(val, strip_metadata=strip_metadata) + + pprint(cleaned_schema, console=console, max_depth=max_depth) + + +pps = pretty_print_core_schema diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_dataclasses.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_dataclasses.py new file mode 100644 index 0000000000000000000000000000000000000000..03f156fc79f47f9416e02653bd44008b53f1cc54 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_dataclasses.py @@ -0,0 +1,238 @@ +"""Private logic for creating pydantic dataclasses.""" + +from __future__ import annotations as _annotations + +import dataclasses +import typing +import warnings +from functools import partial, wraps +from typing import Any, ClassVar + +from pydantic_core import ( + ArgsKwargs, + SchemaSerializer, + SchemaValidator, + core_schema, +) +from typing_extensions import TypeGuard + +from ..errors import PydanticUndefinedAnnotation +from ..plugin._schema_validator import PluggableSchemaValidator, create_schema_validator +from ..warnings import PydanticDeprecatedSince20 +from . import _config, _decorators +from ._fields import collect_dataclass_fields +from ._generate_schema import GenerateSchema, InvalidSchemaError +from ._generics import get_standard_typevars_map +from ._mock_val_ser import set_dataclass_mocks +from ._namespace_utils import NsResolver +from ._signature import generate_pydantic_signature +from ._utils import LazyClassAttribute + +if typing.TYPE_CHECKING: + from _typeshed import DataclassInstance as StandardDataclass + + from ..config import ConfigDict + from ..fields import FieldInfo + + class PydanticDataclass(StandardDataclass, typing.Protocol): + """A protocol containing attributes only available once a class has been decorated as a Pydantic dataclass. + + Attributes: + __pydantic_config__: Pydantic-specific configuration settings for the dataclass. + __pydantic_complete__: Whether dataclass building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The pydantic-core schema used to build the SchemaValidator and SchemaSerializer. + __pydantic_decorators__: Metadata containing the decorators defined on the dataclass. + __pydantic_fields__: Metadata about the fields defined on the dataclass. + __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the dataclass. + __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the dataclass. + """ + + __pydantic_config__: ClassVar[ConfigDict] + __pydantic_complete__: ClassVar[bool] + __pydantic_core_schema__: ClassVar[core_schema.CoreSchema] + __pydantic_decorators__: ClassVar[_decorators.DecoratorInfos] + __pydantic_fields__: ClassVar[dict[str, FieldInfo]] + __pydantic_serializer__: ClassVar[SchemaSerializer] + __pydantic_validator__: ClassVar[SchemaValidator | PluggableSchemaValidator] + + @classmethod + def __pydantic_fields_complete__(cls) -> bool: ... + +else: + # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915 + # and https://youtrack.jetbrains.com/issue/PY-51428 + DeprecationWarning = PydanticDeprecatedSince20 + + +def set_dataclass_fields( + cls: type[StandardDataclass], + ns_resolver: NsResolver | None = None, + config_wrapper: _config.ConfigWrapper | None = None, +) -> None: + """Collect and set `cls.__pydantic_fields__`. + + Args: + cls: The class. + ns_resolver: Namespace resolver to use when getting dataclass annotations. + config_wrapper: The config wrapper instance, defaults to `None`. + """ + typevars_map = get_standard_typevars_map(cls) + fields = collect_dataclass_fields( + cls, ns_resolver=ns_resolver, typevars_map=typevars_map, config_wrapper=config_wrapper + ) + + cls.__pydantic_fields__ = fields # type: ignore + + +def complete_dataclass( + cls: type[Any], + config_wrapper: _config.ConfigWrapper, + *, + raise_errors: bool = True, + ns_resolver: NsResolver | None = None, + _force_build: bool = False, +) -> bool: + """Finish building a pydantic dataclass. + + This logic is called on a class which has already been wrapped in `dataclasses.dataclass()`. + + This is somewhat analogous to `pydantic._internal._model_construction.complete_model_class`. + + Args: + cls: The class. + config_wrapper: The config wrapper instance. + raise_errors: Whether to raise errors, defaults to `True`. + ns_resolver: The namespace resolver instance to use when collecting dataclass fields + and during schema building. + _force_build: Whether to force building the dataclass, no matter if + [`defer_build`][pydantic.config.ConfigDict.defer_build] is set. + + Returns: + `True` if building a pydantic dataclass is successfully completed, `False` otherwise. + + Raises: + PydanticUndefinedAnnotation: If `raise_error` is `True` and there is an undefined annotations. + """ + original_init = cls.__init__ + + # dataclass.__init__ must be defined here so its `__qualname__` can be changed since functions can't be copied, + # and so that the mock validator is used if building was deferred: + def __init__(__dataclass_self__: PydanticDataclass, *args: Any, **kwargs: Any) -> None: + __tracebackhide__ = True + s = __dataclass_self__ + s.__pydantic_validator__.validate_python(ArgsKwargs(args, kwargs), self_instance=s) + + __init__.__qualname__ = f'{cls.__qualname__}.__init__' + + cls.__init__ = __init__ # type: ignore + cls.__pydantic_config__ = config_wrapper.config_dict # type: ignore + + set_dataclass_fields(cls, ns_resolver, config_wrapper=config_wrapper) + + if not _force_build and config_wrapper.defer_build: + set_dataclass_mocks(cls) + return False + + if hasattr(cls, '__post_init_post_parse__'): + warnings.warn( + 'Support for `__post_init_post_parse__` has been dropped, the method will not be called', DeprecationWarning + ) + + typevars_map = get_standard_typevars_map(cls) + gen_schema = GenerateSchema( + config_wrapper, + ns_resolver=ns_resolver, + typevars_map=typevars_map, + ) + + # set __signature__ attr only for the class, but not for its instances + # (because instances can define `__call__`, and `inspect.signature` shouldn't + # use the `__signature__` attribute and instead generate from `__call__`). + cls.__signature__ = LazyClassAttribute( + '__signature__', + partial( + generate_pydantic_signature, + # It's important that we reference the `original_init` here, + # as it is the one synthesized by the stdlib `dataclass` module: + init=original_init, + fields=cls.__pydantic_fields__, # type: ignore + validate_by_name=config_wrapper.validate_by_name, + extra=config_wrapper.extra, + is_dataclass=True, + ), + ) + + try: + schema = gen_schema.generate_schema(cls) + except PydanticUndefinedAnnotation as e: + if raise_errors: + raise + set_dataclass_mocks(cls, f'`{e.name}`') + return False + + core_config = config_wrapper.core_config(title=cls.__name__) + + try: + schema = gen_schema.clean_schema(schema) + except InvalidSchemaError: + set_dataclass_mocks(cls) + return False + + # We are about to set all the remaining required properties expected for this cast; + # __pydantic_decorators__ and __pydantic_fields__ should already be set + cls = typing.cast('type[PydanticDataclass]', cls) + # debug(schema) + + cls.__pydantic_core_schema__ = schema + cls.__pydantic_validator__ = validator = create_schema_validator( + schema, cls, cls.__module__, cls.__qualname__, 'dataclass', core_config, config_wrapper.plugin_settings + ) + cls.__pydantic_serializer__ = SchemaSerializer(schema, core_config) + + if config_wrapper.validate_assignment: + + @wraps(cls.__setattr__) + def validated_setattr(instance: Any, field: str, value: str, /) -> None: + validator.validate_assignment(instance, field, value) + + cls.__setattr__ = validated_setattr.__get__(None, cls) # type: ignore + + cls.__pydantic_complete__ = True + return True + + +def is_builtin_dataclass(_cls: type[Any]) -> TypeGuard[type[StandardDataclass]]: + """Returns True if a class is a stdlib dataclass and *not* a pydantic dataclass. + + We check that + - `_cls` is a dataclass + - `_cls` does not inherit from a processed pydantic dataclass (and thus have a `__pydantic_validator__`) + - `_cls` does not have any annotations that are not dataclass fields + e.g. + ```python + import dataclasses + + import pydantic.dataclasses + + @dataclasses.dataclass + class A: + x: int + + @pydantic.dataclasses.dataclass + class B(A): + y: int + ``` + In this case, when we first check `B`, we make an extra check and look at the annotations ('y'), + which won't be a superset of all the dataclass fields (only the stdlib fields i.e. 'x') + + Args: + cls: The class. + + Returns: + `True` if the class is a stdlib dataclass, `False` otherwise. + """ + return ( + dataclasses.is_dataclass(_cls) + and not hasattr(_cls, '__pydantic_validator__') + and set(_cls.__dataclass_fields__).issuperset(set(getattr(_cls, '__annotations__', {}))) + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_decorators.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_decorators.py new file mode 100644 index 0000000000000000000000000000000000000000..92880a49fcced8ae1fb7c8eff6bc9e7e5977cb17 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_decorators.py @@ -0,0 +1,838 @@ +"""Logic related to validators applied to models etc. via the `@field_validator` and `@model_validator` decorators.""" + +from __future__ import annotations as _annotations + +import types +from collections import deque +from collections.abc import Iterable +from dataclasses import dataclass, field +from functools import cached_property, partial, partialmethod +from inspect import Parameter, Signature, isdatadescriptor, ismethoddescriptor, signature +from itertools import islice +from typing import TYPE_CHECKING, Any, Callable, ClassVar, Generic, Literal, TypeVar, Union + +from pydantic_core import PydanticUndefined, PydanticUndefinedType, core_schema +from typing_extensions import TypeAlias, is_typeddict + +from ..errors import PydanticUserError +from ._core_utils import get_type_ref +from ._internal_dataclass import slots_true +from ._namespace_utils import GlobalsNamespace, MappingNamespace +from ._typing_extra import get_function_type_hints +from ._utils import can_be_positional + +if TYPE_CHECKING: + from ..fields import ComputedFieldInfo + from ..functional_validators import FieldValidatorModes + + +@dataclass(**slots_true) +class ValidatorDecoratorInfo: + """A container for data from `@validator` so that we can access it + while building the pydantic-core schema. + + Attributes: + decorator_repr: A class variable representing the decorator string, '@validator'. + fields: A tuple of field names the validator should be called on. + mode: The proposed validator mode. + each_item: For complex objects (sets, lists etc.) whether to validate individual + elements rather than the whole object. + always: Whether this method and other validators should be called even if the value is missing. + check_fields: Whether to check that the fields actually exist on the model. + """ + + decorator_repr: ClassVar[str] = '@validator' + + fields: tuple[str, ...] + mode: Literal['before', 'after'] + each_item: bool + always: bool + check_fields: bool | None + + +@dataclass(**slots_true) +class FieldValidatorDecoratorInfo: + """A container for data from `@field_validator` so that we can access it + while building the pydantic-core schema. + + Attributes: + decorator_repr: A class variable representing the decorator string, '@field_validator'. + fields: A tuple of field names the validator should be called on. + mode: The proposed validator mode. + check_fields: Whether to check that the fields actually exist on the model. + json_schema_input_type: The input type of the function. This is only used to generate + the appropriate JSON Schema (in validation mode) and can only specified + when `mode` is either `'before'`, `'plain'` or `'wrap'`. + """ + + decorator_repr: ClassVar[str] = '@field_validator' + + fields: tuple[str, ...] + mode: FieldValidatorModes + check_fields: bool | None + json_schema_input_type: Any + + +@dataclass(**slots_true) +class RootValidatorDecoratorInfo: + """A container for data from `@root_validator` so that we can access it + while building the pydantic-core schema. + + Attributes: + decorator_repr: A class variable representing the decorator string, '@root_validator'. + mode: The proposed validator mode. + """ + + decorator_repr: ClassVar[str] = '@root_validator' + mode: Literal['before', 'after'] + + +@dataclass(**slots_true) +class FieldSerializerDecoratorInfo: + """A container for data from `@field_serializer` so that we can access it + while building the pydantic-core schema. + + Attributes: + decorator_repr: A class variable representing the decorator string, '@field_serializer'. + fields: A tuple of field names the serializer should be called on. + mode: The proposed serializer mode. + return_type: The type of the serializer's return value. + when_used: The serialization condition. Accepts a string with values `'always'`, `'unless-none'`, `'json'`, + and `'json-unless-none'`. + check_fields: Whether to check that the fields actually exist on the model. + """ + + decorator_repr: ClassVar[str] = '@field_serializer' + fields: tuple[str, ...] + mode: Literal['plain', 'wrap'] + return_type: Any + when_used: core_schema.WhenUsed + check_fields: bool | None + + +@dataclass(**slots_true) +class ModelSerializerDecoratorInfo: + """A container for data from `@model_serializer` so that we can access it + while building the pydantic-core schema. + + Attributes: + decorator_repr: A class variable representing the decorator string, '@model_serializer'. + mode: The proposed serializer mode. + return_type: The type of the serializer's return value. + when_used: The serialization condition. Accepts a string with values `'always'`, `'unless-none'`, `'json'`, + and `'json-unless-none'`. + """ + + decorator_repr: ClassVar[str] = '@model_serializer' + mode: Literal['plain', 'wrap'] + return_type: Any + when_used: core_schema.WhenUsed + + +@dataclass(**slots_true) +class ModelValidatorDecoratorInfo: + """A container for data from `@model_validator` so that we can access it + while building the pydantic-core schema. + + Attributes: + decorator_repr: A class variable representing the decorator string, '@model_validator'. + mode: The proposed serializer mode. + """ + + decorator_repr: ClassVar[str] = '@model_validator' + mode: Literal['wrap', 'before', 'after'] + + +DecoratorInfo: TypeAlias = """Union[ + ValidatorDecoratorInfo, + FieldValidatorDecoratorInfo, + RootValidatorDecoratorInfo, + FieldSerializerDecoratorInfo, + ModelSerializerDecoratorInfo, + ModelValidatorDecoratorInfo, + ComputedFieldInfo, +]""" + +ReturnType = TypeVar('ReturnType') +DecoratedType: TypeAlias = ( + 'Union[classmethod[Any, Any, ReturnType], staticmethod[Any, ReturnType], Callable[..., ReturnType], property]' +) + + +@dataclass # can't use slots here since we set attributes on `__post_init__` +class PydanticDescriptorProxy(Generic[ReturnType]): + """Wrap a classmethod, staticmethod, property or unbound function + and act as a descriptor that allows us to detect decorated items + from the class' attributes. + + This class' __get__ returns the wrapped item's __get__ result, + which makes it transparent for classmethods and staticmethods. + + Attributes: + wrapped: The decorator that has to be wrapped. + decorator_info: The decorator info. + shim: A wrapper function to wrap V1 style function. + """ + + wrapped: DecoratedType[ReturnType] + decorator_info: DecoratorInfo + shim: Callable[[Callable[..., Any]], Callable[..., Any]] | None = None + + def __post_init__(self): + for attr in 'setter', 'deleter': + if hasattr(self.wrapped, attr): + f = partial(self._call_wrapped_attr, name=attr) + setattr(self, attr, f) + + def _call_wrapped_attr(self, func: Callable[[Any], None], *, name: str) -> PydanticDescriptorProxy[ReturnType]: + self.wrapped = getattr(self.wrapped, name)(func) + if isinstance(self.wrapped, property): + # update ComputedFieldInfo.wrapped_property + from ..fields import ComputedFieldInfo + + if isinstance(self.decorator_info, ComputedFieldInfo): + self.decorator_info.wrapped_property = self.wrapped + return self + + def __get__(self, obj: object | None, obj_type: type[object] | None = None) -> PydanticDescriptorProxy[ReturnType]: + try: + return self.wrapped.__get__(obj, obj_type) + except AttributeError: + # not a descriptor, e.g. a partial object + return self.wrapped # type: ignore[return-value] + + def __set_name__(self, instance: Any, name: str) -> None: + if hasattr(self.wrapped, '__set_name__'): + self.wrapped.__set_name__(instance, name) # pyright: ignore[reportFunctionMemberAccess] + + def __getattr__(self, name: str, /) -> Any: + """Forward checks for __isabstractmethod__ and such.""" + return getattr(self.wrapped, name) + + +DecoratorInfoType = TypeVar('DecoratorInfoType', bound=DecoratorInfo) + + +@dataclass(**slots_true) +class Decorator(Generic[DecoratorInfoType]): + """A generic container class to join together the decorator metadata + (metadata from decorator itself, which we have when the + decorator is called but not when we are building the core-schema) + and the bound function (which we have after the class itself is created). + + Attributes: + cls_ref: The class ref. + cls_var_name: The decorated function name. + func: The decorated function. + shim: A wrapper function to wrap V1 style function. + info: The decorator info. + """ + + cls_ref: str + cls_var_name: str + func: Callable[..., Any] + shim: Callable[[Any], Any] | None + info: DecoratorInfoType + + @staticmethod + def build( + cls_: Any, + *, + cls_var_name: str, + shim: Callable[[Any], Any] | None, + info: DecoratorInfoType, + ) -> Decorator[DecoratorInfoType]: + """Build a new decorator. + + Args: + cls_: The class. + cls_var_name: The decorated function name. + shim: A wrapper function to wrap V1 style function. + info: The decorator info. + + Returns: + The new decorator instance. + """ + func = get_attribute_from_bases(cls_, cls_var_name) + if shim is not None: + func = shim(func) + func = unwrap_wrapped_function(func, unwrap_partial=False) + if not callable(func): + # This branch will get hit for classmethod properties + attribute = get_attribute_from_base_dicts(cls_, cls_var_name) # prevents the binding call to `__get__` + if isinstance(attribute, PydanticDescriptorProxy): + func = unwrap_wrapped_function(attribute.wrapped) + return Decorator( + cls_ref=get_type_ref(cls_), + cls_var_name=cls_var_name, + func=func, + shim=shim, + info=info, + ) + + def bind_to_cls(self, cls: Any) -> Decorator[DecoratorInfoType]: + """Bind the decorator to a class. + + Args: + cls: the class. + + Returns: + The new decorator instance. + """ + return self.build( + cls, + cls_var_name=self.cls_var_name, + shim=self.shim, + info=self.info, + ) + + +def get_bases(tp: type[Any]) -> tuple[type[Any], ...]: + """Get the base classes of a class or typeddict. + + Args: + tp: The type or class to get the bases. + + Returns: + The base classes. + """ + if is_typeddict(tp): + return tp.__orig_bases__ # type: ignore + try: + return tp.__bases__ + except AttributeError: + return () + + +def mro(tp: type[Any]) -> tuple[type[Any], ...]: + """Calculate the Method Resolution Order of bases using the C3 algorithm. + + See https://www.python.org/download/releases/2.3/mro/ + """ + # try to use the existing mro, for performance mainly + # but also because it helps verify the implementation below + if not is_typeddict(tp): + try: + return tp.__mro__ + except AttributeError: + # GenericAlias and some other cases + pass + + bases = get_bases(tp) + return (tp,) + mro_for_bases(bases) + + +def mro_for_bases(bases: tuple[type[Any], ...]) -> tuple[type[Any], ...]: + def merge_seqs(seqs: list[deque[type[Any]]]) -> Iterable[type[Any]]: + while True: + non_empty = [seq for seq in seqs if seq] + if not non_empty: + # Nothing left to process, we're done. + return + candidate: type[Any] | None = None + for seq in non_empty: # Find merge candidates among seq heads. + candidate = seq[0] + not_head = [s for s in non_empty if candidate in islice(s, 1, None)] + if not_head: + # Reject the candidate. + candidate = None + else: + break + if not candidate: + raise TypeError('Inconsistent hierarchy, no C3 MRO is possible') + yield candidate + for seq in non_empty: + # Remove candidate. + if seq[0] == candidate: + seq.popleft() + + seqs = [deque(mro(base)) for base in bases] + [deque(bases)] + return tuple(merge_seqs(seqs)) + + +_sentinel = object() + + +def get_attribute_from_bases(tp: type[Any] | tuple[type[Any], ...], name: str) -> Any: + """Get the attribute from the next class in the MRO that has it, + aiming to simulate calling the method on the actual class. + + The reason for iterating over the mro instead of just getting + the attribute (which would do that for us) is to support TypedDict, + which lacks a real __mro__, but can have a virtual one constructed + from its bases (as done here). + + Args: + tp: The type or class to search for the attribute. If a tuple, this is treated as a set of base classes. + name: The name of the attribute to retrieve. + + Returns: + Any: The attribute value, if found. + + Raises: + AttributeError: If the attribute is not found in any class in the MRO. + """ + if isinstance(tp, tuple): + for base in mro_for_bases(tp): + attribute = base.__dict__.get(name, _sentinel) + if attribute is not _sentinel: + attribute_get = getattr(attribute, '__get__', None) + if attribute_get is not None: + return attribute_get(None, tp) + return attribute + raise AttributeError(f'{name} not found in {tp}') + else: + try: + return getattr(tp, name) + except AttributeError: + return get_attribute_from_bases(mro(tp), name) + + +def get_attribute_from_base_dicts(tp: type[Any], name: str) -> Any: + """Get an attribute out of the `__dict__` following the MRO. + This prevents the call to `__get__` on the descriptor, and allows + us to get the original function for classmethod properties. + + Args: + tp: The type or class to search for the attribute. + name: The name of the attribute to retrieve. + + Returns: + Any: The attribute value, if found. + + Raises: + KeyError: If the attribute is not found in any class's `__dict__` in the MRO. + """ + for base in reversed(mro(tp)): + if name in base.__dict__: + return base.__dict__[name] + return tp.__dict__[name] # raise the error + + +@dataclass(**slots_true) +class DecoratorInfos: + """Mapping of name in the class namespace to decorator info. + + note that the name in the class namespace is the function or attribute name + not the field name! + """ + + validators: dict[str, Decorator[ValidatorDecoratorInfo]] = field(default_factory=dict) + field_validators: dict[str, Decorator[FieldValidatorDecoratorInfo]] = field(default_factory=dict) + root_validators: dict[str, Decorator[RootValidatorDecoratorInfo]] = field(default_factory=dict) + field_serializers: dict[str, Decorator[FieldSerializerDecoratorInfo]] = field(default_factory=dict) + model_serializers: dict[str, Decorator[ModelSerializerDecoratorInfo]] = field(default_factory=dict) + model_validators: dict[str, Decorator[ModelValidatorDecoratorInfo]] = field(default_factory=dict) + computed_fields: dict[str, Decorator[ComputedFieldInfo]] = field(default_factory=dict) + + @staticmethod + def build(model_dc: type[Any]) -> DecoratorInfos: # noqa: C901 (ignore complexity) + """We want to collect all DecFunc instances that exist as + attributes in the namespace of the class (a BaseModel or dataclass) + that called us + But we want to collect these in the order of the bases + So instead of getting them all from the leaf class (the class that called us), + we traverse the bases from root (the oldest ancestor class) to leaf + and collect all of the instances as we go, taking care to replace + any duplicate ones with the last one we see to mimic how function overriding + works with inheritance. + If we do replace any functions we put the replacement into the position + the replaced function was in; that is, we maintain the order. + """ + # reminder: dicts are ordered and replacement does not alter the order + res = DecoratorInfos() + for base in reversed(mro(model_dc)[1:]): + existing: DecoratorInfos | None = base.__dict__.get('__pydantic_decorators__') + if existing is None: + existing = DecoratorInfos.build(base) + res.validators.update({k: v.bind_to_cls(model_dc) for k, v in existing.validators.items()}) + res.field_validators.update({k: v.bind_to_cls(model_dc) for k, v in existing.field_validators.items()}) + res.root_validators.update({k: v.bind_to_cls(model_dc) for k, v in existing.root_validators.items()}) + res.field_serializers.update({k: v.bind_to_cls(model_dc) for k, v in existing.field_serializers.items()}) + res.model_serializers.update({k: v.bind_to_cls(model_dc) for k, v in existing.model_serializers.items()}) + res.model_validators.update({k: v.bind_to_cls(model_dc) for k, v in existing.model_validators.items()}) + res.computed_fields.update({k: v.bind_to_cls(model_dc) for k, v in existing.computed_fields.items()}) + + to_replace: list[tuple[str, Any]] = [] + + for var_name, var_value in vars(model_dc).items(): + if isinstance(var_value, PydanticDescriptorProxy): + info = var_value.decorator_info + if isinstance(info, ValidatorDecoratorInfo): + res.validators[var_name] = Decorator.build( + model_dc, cls_var_name=var_name, shim=var_value.shim, info=info + ) + elif isinstance(info, FieldValidatorDecoratorInfo): + res.field_validators[var_name] = Decorator.build( + model_dc, cls_var_name=var_name, shim=var_value.shim, info=info + ) + elif isinstance(info, RootValidatorDecoratorInfo): + res.root_validators[var_name] = Decorator.build( + model_dc, cls_var_name=var_name, shim=var_value.shim, info=info + ) + elif isinstance(info, FieldSerializerDecoratorInfo): + # check whether a serializer function is already registered for fields + for field_serializer_decorator in res.field_serializers.values(): + # check that each field has at most one serializer function. + # serializer functions for the same field in subclasses are allowed, + # and are treated as overrides + if field_serializer_decorator.cls_var_name == var_name: + continue + for f in info.fields: + if f in field_serializer_decorator.info.fields: + raise PydanticUserError( + 'Multiple field serializer functions were defined ' + f'for field {f!r}, this is not allowed.', + code='multiple-field-serializers', + ) + res.field_serializers[var_name] = Decorator.build( + model_dc, cls_var_name=var_name, shim=var_value.shim, info=info + ) + elif isinstance(info, ModelValidatorDecoratorInfo): + res.model_validators[var_name] = Decorator.build( + model_dc, cls_var_name=var_name, shim=var_value.shim, info=info + ) + elif isinstance(info, ModelSerializerDecoratorInfo): + res.model_serializers[var_name] = Decorator.build( + model_dc, cls_var_name=var_name, shim=var_value.shim, info=info + ) + else: + from ..fields import ComputedFieldInfo + + isinstance(var_value, ComputedFieldInfo) + res.computed_fields[var_name] = Decorator.build( + model_dc, cls_var_name=var_name, shim=None, info=info + ) + to_replace.append((var_name, var_value.wrapped)) + if to_replace: + # If we can save `__pydantic_decorators__` on the class we'll be able to check for it above + # so then we don't need to re-process the type, which means we can discard our descriptor wrappers + # and replace them with the thing they are wrapping (see the other setattr call below) + # which allows validator class methods to also function as regular class methods + model_dc.__pydantic_decorators__ = res + for name, value in to_replace: + setattr(model_dc, name, value) + return res + + +def inspect_validator(validator: Callable[..., Any], mode: FieldValidatorModes) -> bool: + """Look at a field or model validator function and determine whether it takes an info argument. + + An error is raised if the function has an invalid signature. + + Args: + validator: The validator function to inspect. + mode: The proposed validator mode. + + Returns: + Whether the validator takes an info argument. + """ + try: + sig = signature(validator) + except (ValueError, TypeError): + # `inspect.signature` might not be able to infer a signature, e.g. with C objects. + # In this case, we assume no info argument is present: + return False + n_positional = count_positional_required_params(sig) + if mode == 'wrap': + if n_positional == 3: + return True + elif n_positional == 2: + return False + else: + assert mode in {'before', 'after', 'plain'}, f"invalid mode: {mode!r}, expected 'before', 'after' or 'plain" + if n_positional == 2: + return True + elif n_positional == 1: + return False + + raise PydanticUserError( + f'Unrecognized field_validator function signature for {validator} with `mode={mode}`:{sig}', + code='validator-signature', + ) + + +def inspect_field_serializer(serializer: Callable[..., Any], mode: Literal['plain', 'wrap']) -> tuple[bool, bool]: + """Look at a field serializer function and determine if it is a field serializer, + and whether it takes an info argument. + + An error is raised if the function has an invalid signature. + + Args: + serializer: The serializer function to inspect. + mode: The serializer mode, either 'plain' or 'wrap'. + + Returns: + Tuple of (is_field_serializer, info_arg). + """ + try: + sig = signature(serializer) + except (ValueError, TypeError): + # `inspect.signature` might not be able to infer a signature, e.g. with C objects. + # In this case, we assume no info argument is present and this is not a method: + return (False, False) + + first = next(iter(sig.parameters.values()), None) + is_field_serializer = first is not None and first.name == 'self' + + n_positional = count_positional_required_params(sig) + if is_field_serializer: + # -1 to correct for self parameter + info_arg = _serializer_info_arg(mode, n_positional - 1) + else: + info_arg = _serializer_info_arg(mode, n_positional) + + if info_arg is None: + raise PydanticUserError( + f'Unrecognized field_serializer function signature for {serializer} with `mode={mode}`:{sig}', + code='field-serializer-signature', + ) + + return is_field_serializer, info_arg + + +def inspect_annotated_serializer(serializer: Callable[..., Any], mode: Literal['plain', 'wrap']) -> bool: + """Look at a serializer function used via `Annotated` and determine whether it takes an info argument. + + An error is raised if the function has an invalid signature. + + Args: + serializer: The serializer function to check. + mode: The serializer mode, either 'plain' or 'wrap'. + + Returns: + info_arg + """ + try: + sig = signature(serializer) + except (ValueError, TypeError): + # `inspect.signature` might not be able to infer a signature, e.g. with C objects. + # In this case, we assume no info argument is present: + return False + info_arg = _serializer_info_arg(mode, count_positional_required_params(sig)) + if info_arg is None: + raise PydanticUserError( + f'Unrecognized field_serializer function signature for {serializer} with `mode={mode}`:{sig}', + code='field-serializer-signature', + ) + else: + return info_arg + + +def inspect_model_serializer(serializer: Callable[..., Any], mode: Literal['plain', 'wrap']) -> bool: + """Look at a model serializer function and determine whether it takes an info argument. + + An error is raised if the function has an invalid signature. + + Args: + serializer: The serializer function to check. + mode: The serializer mode, either 'plain' or 'wrap'. + + Returns: + `info_arg` - whether the function expects an info argument. + """ + if isinstance(serializer, (staticmethod, classmethod)) or not is_instance_method_from_sig(serializer): + raise PydanticUserError( + '`@model_serializer` must be applied to instance methods', code='model-serializer-instance-method' + ) + + sig = signature(serializer) + info_arg = _serializer_info_arg(mode, count_positional_required_params(sig)) + if info_arg is None: + raise PydanticUserError( + f'Unrecognized model_serializer function signature for {serializer} with `mode={mode}`:{sig}', + code='model-serializer-signature', + ) + else: + return info_arg + + +def _serializer_info_arg(mode: Literal['plain', 'wrap'], n_positional: int) -> bool | None: + if mode == 'plain': + if n_positional == 1: + # (input_value: Any, /) -> Any + return False + elif n_positional == 2: + # (model: Any, input_value: Any, /) -> Any + return True + else: + assert mode == 'wrap', f"invalid mode: {mode!r}, expected 'plain' or 'wrap'" + if n_positional == 2: + # (input_value: Any, serializer: SerializerFunctionWrapHandler, /) -> Any + return False + elif n_positional == 3: + # (input_value: Any, serializer: SerializerFunctionWrapHandler, info: SerializationInfo, /) -> Any + return True + + return None + + +AnyDecoratorCallable: TypeAlias = ( + 'Union[classmethod[Any, Any, Any], staticmethod[Any, Any], partialmethod[Any], Callable[..., Any]]' +) + + +def is_instance_method_from_sig(function: AnyDecoratorCallable) -> bool: + """Whether the function is an instance method. + + It will consider a function as instance method if the first parameter of + function is `self`. + + Args: + function: The function to check. + + Returns: + `True` if the function is an instance method, `False` otherwise. + """ + sig = signature(unwrap_wrapped_function(function)) + first = next(iter(sig.parameters.values()), None) + if first and first.name == 'self': + return True + return False + + +def ensure_classmethod_based_on_signature(function: AnyDecoratorCallable) -> Any: + """Apply the `@classmethod` decorator on the function. + + Args: + function: The function to apply the decorator on. + + Return: + The `@classmethod` decorator applied function. + """ + if not isinstance( + unwrap_wrapped_function(function, unwrap_class_static_method=False), classmethod + ) and _is_classmethod_from_sig(function): + return classmethod(function) # type: ignore[arg-type] + return function + + +def _is_classmethod_from_sig(function: AnyDecoratorCallable) -> bool: + sig = signature(unwrap_wrapped_function(function)) + first = next(iter(sig.parameters.values()), None) + if first and first.name == 'cls': + return True + return False + + +def unwrap_wrapped_function( + func: Any, + *, + unwrap_partial: bool = True, + unwrap_class_static_method: bool = True, +) -> Any: + """Recursively unwraps a wrapped function until the underlying function is reached. + This handles property, functools.partial, functools.partialmethod, staticmethod, and classmethod. + + Args: + func: The function to unwrap. + unwrap_partial: If True (default), unwrap partial and partialmethod decorators. + unwrap_class_static_method: If True (default), also unwrap classmethod and staticmethod + decorators. If False, only unwrap partial and partialmethod decorators. + + Returns: + The underlying function of the wrapped function. + """ + # Define the types we want to check against as a single tuple. + unwrap_types = ( + (property, cached_property) + + ((partial, partialmethod) if unwrap_partial else ()) + + ((staticmethod, classmethod) if unwrap_class_static_method else ()) + ) + + while isinstance(func, unwrap_types): + if unwrap_class_static_method and isinstance(func, (classmethod, staticmethod)): + func = func.__func__ + elif isinstance(func, (partial, partialmethod)): + func = func.func + elif isinstance(func, property): + func = func.fget # arbitrary choice, convenient for computed fields + else: + # Make coverage happy as it can only get here in the last possible case + assert isinstance(func, cached_property) + func = func.func # type: ignore + + return func + + +_function_like = ( + partial, + partialmethod, + types.FunctionType, + types.BuiltinFunctionType, + types.MethodType, + types.WrapperDescriptorType, + types.MethodWrapperType, + types.MemberDescriptorType, +) + + +def get_callable_return_type( + callable_obj: Any, + globalns: GlobalsNamespace | None = None, + localns: MappingNamespace | None = None, +) -> Any | PydanticUndefinedType: + """Get the callable return type. + + Args: + callable_obj: The callable to analyze. + globalns: The globals namespace to use during type annotation evaluation. + localns: The locals namespace to use during type annotation evaluation. + + Returns: + The function return type. + """ + if isinstance(callable_obj, type): + # types are callables, and we assume the return type + # is the type itself (e.g. `int()` results in an instance of `int`). + return callable_obj + + if not isinstance(callable_obj, _function_like): + call_func = getattr(type(callable_obj), '__call__', None) # noqa: B004 + if call_func is not None: + callable_obj = call_func + + hints = get_function_type_hints( + unwrap_wrapped_function(callable_obj), + include_keys={'return'}, + globalns=globalns, + localns=localns, + ) + return hints.get('return', PydanticUndefined) + + +def count_positional_required_params(sig: Signature) -> int: + """Get the number of positional (required) arguments of a signature. + + This function should only be used to inspect signatures of validation and serialization functions. + The first argument (the value being serialized or validated) is counted as a required argument + even if a default value exists. + + Returns: + The number of positional arguments of a signature. + """ + parameters = list(sig.parameters.values()) + return sum( + 1 + for param in parameters + if can_be_positional(param) + # First argument is the value being validated/serialized, and can have a default value + # (e.g. `float`, which has signature `(x=0, /)`). We assume other parameters (the info arg + # for instance) should be required, and thus without any default value. + and (param.default is Parameter.empty or param is parameters[0]) + ) + + +def ensure_property(f: Any) -> Any: + """Ensure that a function is a `property` or `cached_property`, or is a valid descriptor. + + Args: + f: The function to check. + + Returns: + The function, or a `property` or `cached_property` instance wrapping the function. + """ + if ismethoddescriptor(f) or isdatadescriptor(f): + return f + else: + return property(f) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_decorators_v1.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_decorators_v1.py new file mode 100644 index 0000000000000000000000000000000000000000..34273779d77666f5cd775f6a2684641092db67ee --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_decorators_v1.py @@ -0,0 +1,174 @@ +"""Logic for V1 validators, e.g. `@validator` and `@root_validator`.""" + +from __future__ import annotations as _annotations + +from inspect import Parameter, signature +from typing import Any, Union, cast + +from pydantic_core import core_schema +from typing_extensions import Protocol + +from ..errors import PydanticUserError +from ._utils import can_be_positional + + +class V1OnlyValueValidator(Protocol): + """A simple validator, supported for V1 validators and V2 validators.""" + + def __call__(self, __value: Any) -> Any: ... + + +class V1ValidatorWithValues(Protocol): + """A validator with `values` argument, supported for V1 validators and V2 validators.""" + + def __call__(self, __value: Any, values: dict[str, Any]) -> Any: ... + + +class V1ValidatorWithValuesKwOnly(Protocol): + """A validator with keyword only `values` argument, supported for V1 validators and V2 validators.""" + + def __call__(self, __value: Any, *, values: dict[str, Any]) -> Any: ... + + +class V1ValidatorWithKwargs(Protocol): + """A validator with `kwargs` argument, supported for V1 validators and V2 validators.""" + + def __call__(self, __value: Any, **kwargs: Any) -> Any: ... + + +class V1ValidatorWithValuesAndKwargs(Protocol): + """A validator with `values` and `kwargs` arguments, supported for V1 validators and V2 validators.""" + + def __call__(self, __value: Any, values: dict[str, Any], **kwargs: Any) -> Any: ... + + +V1Validator = Union[ + V1ValidatorWithValues, V1ValidatorWithValuesKwOnly, V1ValidatorWithKwargs, V1ValidatorWithValuesAndKwargs +] + + +def can_be_keyword(param: Parameter) -> bool: + return param.kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.KEYWORD_ONLY) + + +def make_generic_v1_field_validator(validator: V1Validator) -> core_schema.WithInfoValidatorFunction: + """Wrap a V1 style field validator for V2 compatibility. + + Args: + validator: The V1 style field validator. + + Returns: + A wrapped V2 style field validator. + + Raises: + PydanticUserError: If the signature is not supported or the parameters are + not available in Pydantic V2. + """ + sig = signature(validator) + + needs_values_kw = False + + for param_num, (param_name, parameter) in enumerate(sig.parameters.items()): + if can_be_keyword(parameter) and param_name in ('field', 'config'): + raise PydanticUserError( + 'The `field` and `config` parameters are not available in Pydantic V2, ' + 'please use the `info` parameter instead.', + code='validator-field-config-info', + ) + if parameter.kind is Parameter.VAR_KEYWORD: + needs_values_kw = True + elif can_be_keyword(parameter) and param_name == 'values': + needs_values_kw = True + elif can_be_positional(parameter) and param_num == 0: + # value + continue + elif parameter.default is Parameter.empty: # ignore params with defaults e.g. bound by functools.partial + raise PydanticUserError( + f'Unsupported signature for V1 style validator {validator}: {sig} is not supported.', + code='validator-v1-signature', + ) + + if needs_values_kw: + # (v, **kwargs), (v, values, **kwargs), (v, *, values, **kwargs) or (v, *, values) + val1 = cast(V1ValidatorWithValues, validator) + + def wrapper1(value: Any, info: core_schema.ValidationInfo) -> Any: + return val1(value, values=info.data) + + return wrapper1 + else: + val2 = cast(V1OnlyValueValidator, validator) + + def wrapper2(value: Any, _: core_schema.ValidationInfo) -> Any: + return val2(value) + + return wrapper2 + + +RootValidatorValues = dict[str, Any] +# technically tuple[model_dict, model_extra, fields_set] | tuple[dataclass_dict, init_vars] +RootValidatorFieldsTuple = tuple[Any, ...] + + +class V1RootValidatorFunction(Protocol): + """A simple root validator, supported for V1 validators and V2 validators.""" + + def __call__(self, __values: RootValidatorValues) -> RootValidatorValues: ... + + +class V2CoreBeforeRootValidator(Protocol): + """V2 validator with mode='before'.""" + + def __call__(self, __values: RootValidatorValues, __info: core_schema.ValidationInfo) -> RootValidatorValues: ... + + +class V2CoreAfterRootValidator(Protocol): + """V2 validator with mode='after'.""" + + def __call__( + self, __fields_tuple: RootValidatorFieldsTuple, __info: core_schema.ValidationInfo + ) -> RootValidatorFieldsTuple: ... + + +def make_v1_generic_root_validator( + validator: V1RootValidatorFunction, pre: bool +) -> V2CoreBeforeRootValidator | V2CoreAfterRootValidator: + """Wrap a V1 style root validator for V2 compatibility. + + Args: + validator: The V1 style field validator. + pre: Whether the validator is a pre validator. + + Returns: + A wrapped V2 style validator. + """ + if pre is True: + # mode='before' for pydantic-core + def _wrapper1(values: RootValidatorValues, _: core_schema.ValidationInfo) -> RootValidatorValues: + return validator(values) + + return _wrapper1 + + # mode='after' for pydantic-core + def _wrapper2(fields_tuple: RootValidatorFieldsTuple, _: core_schema.ValidationInfo) -> RootValidatorFieldsTuple: + if len(fields_tuple) == 2: + # dataclass, this is easy + values, init_vars = fields_tuple + values = validator(values) + return values, init_vars + else: + # ugly hack: to match v1 behaviour, we merge values and model_extra, then split them up based on fields + # afterwards + model_dict, model_extra, fields_set = fields_tuple + if model_extra: + fields = set(model_dict.keys()) + model_dict.update(model_extra) + model_dict_new = validator(model_dict) + for k in list(model_dict_new.keys()): + if k not in fields: + model_extra[k] = model_dict_new.pop(k) + else: + model_dict_new = validator(model_dict) + return model_dict_new, model_extra, fields_set + + return _wrapper2 diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_discriminated_union.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_discriminated_union.py new file mode 100644 index 0000000000000000000000000000000000000000..5dd6fdaf4182be93ba9891dec8be54ef0e201bcb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_discriminated_union.py @@ -0,0 +1,479 @@ +from __future__ import annotations as _annotations + +from collections.abc import Hashable, Sequence +from typing import TYPE_CHECKING, Any, cast + +from pydantic_core import CoreSchema, core_schema + +from ..errors import PydanticUserError +from . import _core_utils +from ._core_utils import ( + CoreSchemaField, +) + +if TYPE_CHECKING: + from ..types import Discriminator + from ._core_metadata import CoreMetadata + + +class MissingDefinitionForUnionRef(Exception): + """Raised when applying a discriminated union discriminator to a schema + requires a definition that is not yet defined + """ + + def __init__(self, ref: str) -> None: + self.ref = ref + super().__init__(f'Missing definition for ref {self.ref!r}') + + +def set_discriminator_in_metadata(schema: CoreSchema, discriminator: Any) -> None: + metadata = cast('CoreMetadata', schema.setdefault('metadata', {})) + metadata['pydantic_internal_union_discriminator'] = discriminator + + +def apply_discriminator( + schema: core_schema.CoreSchema, + discriminator: str | Discriminator, + definitions: dict[str, core_schema.CoreSchema] | None = None, +) -> core_schema.CoreSchema: + """Applies the discriminator and returns a new core schema. + + Args: + schema: The input schema. + discriminator: The name of the field which will serve as the discriminator. + definitions: A mapping of schema ref to schema. + + Returns: + The new core schema. + + Raises: + TypeError: + - If `discriminator` is used with invalid union variant. + - If `discriminator` is used with `Union` type with one variant. + - If `discriminator` value mapped to multiple choices. + MissingDefinitionForUnionRef: + If the definition for ref is missing. + PydanticUserError: + - If a model in union doesn't have a discriminator field. + - If discriminator field has a non-string alias. + - If discriminator fields have different aliases. + - If discriminator field not of type `Literal`. + """ + from ..types import Discriminator + + if isinstance(discriminator, Discriminator): + if isinstance(discriminator.discriminator, str): + discriminator = discriminator.discriminator + else: + return discriminator._convert_schema(schema) + + return _ApplyInferredDiscriminator(discriminator, definitions or {}).apply(schema) + + +class _ApplyInferredDiscriminator: + """This class is used to convert an input schema containing a union schema into one where that union is + replaced with a tagged-union, with all the associated debugging and performance benefits. + + This is done by: + * Validating that the input schema is compatible with the provided discriminator + * Introspecting the schema to determine which discriminator values should map to which union choices + * Handling various edge cases such as 'definitions', 'default', 'nullable' schemas, and more + + I have chosen to implement the conversion algorithm in this class, rather than a function, + to make it easier to maintain state while recursively walking the provided CoreSchema. + """ + + def __init__(self, discriminator: str, definitions: dict[str, core_schema.CoreSchema]): + # `discriminator` should be the name of the field which will serve as the discriminator. + # It must be the python name of the field, and *not* the field's alias. Note that as of now, + # all members of a discriminated union _must_ use a field with the same name as the discriminator. + # This may change if/when we expose a way to manually specify the TaggedUnionSchema's choices. + self.discriminator = discriminator + + # `definitions` should contain a mapping of schema ref to schema for all schemas which might + # be referenced by some choice + self.definitions = definitions + + # `_discriminator_alias` will hold the value, if present, of the alias for the discriminator + # + # Note: following the v1 implementation, we currently disallow the use of different aliases + # for different choices. This is not a limitation of pydantic_core, but if we try to handle + # this, the inference logic gets complicated very quickly, and could result in confusing + # debugging challenges for users making subtle mistakes. + # + # Rather than trying to do the most powerful inference possible, I think we should eventually + # expose a way to more-manually control the way the TaggedUnionSchema is constructed through + # the use of a new type which would be placed as an Annotation on the Union type. This would + # provide the full flexibility/power of pydantic_core's TaggedUnionSchema where necessary for + # more complex cases, without over-complicating the inference logic for the common cases. + self._discriminator_alias: str | None = None + + # `_should_be_nullable` indicates whether the converted union has `None` as an allowed value. + # If `None` is an acceptable value of the (possibly-wrapped) union, we ignore it while + # constructing the TaggedUnionSchema, but set the `_should_be_nullable` attribute to True. + # Once we have constructed the TaggedUnionSchema, if `_should_be_nullable` is True, we ensure + # that the final schema gets wrapped as a NullableSchema. This has the same semantics on the + # python side, but resolves the issue that `None` cannot correspond to any discriminator values. + self._should_be_nullable = False + + # `_is_nullable` is used to track if the final produced schema will definitely be nullable; + # we set it to True if the input schema is wrapped in a nullable schema that we know will be preserved + # as an indication that, even if None is discovered as one of the union choices, we will not need to wrap + # the final value in another nullable schema. + # + # This is more complicated than just checking for the final outermost schema having type 'nullable' thanks + # to the possible presence of other wrapper schemas such as DefinitionsSchema, WithDefaultSchema, etc. + self._is_nullable = False + + # `_choices_to_handle` serves as a stack of choices to add to the tagged union. Initially, choices + # from the union in the wrapped schema will be appended to this list, and the recursive choice-handling + # algorithm may add more choices to this stack as (nested) unions are encountered. + self._choices_to_handle: list[core_schema.CoreSchema] = [] + + # `_tagged_union_choices` is built during the call to `apply`, and will hold the choices to be included + # in the output TaggedUnionSchema that will replace the union from the input schema + self._tagged_union_choices: dict[Hashable, core_schema.CoreSchema] = {} + + # `_used` is changed to True after applying the discriminator to prevent accidental reuse + self._used = False + + def apply(self, schema: core_schema.CoreSchema) -> core_schema.CoreSchema: + """Return a new CoreSchema based on `schema` that uses a tagged-union with the discriminator provided + to this class. + + Args: + schema: The input schema. + + Returns: + The new core schema. + + Raises: + TypeError: + - If `discriminator` is used with invalid union variant. + - If `discriminator` is used with `Union` type with one variant. + - If `discriminator` value mapped to multiple choices. + ValueError: + If the definition for ref is missing. + PydanticUserError: + - If a model in union doesn't have a discriminator field. + - If discriminator field has a non-string alias. + - If discriminator fields have different aliases. + - If discriminator field not of type `Literal`. + """ + assert not self._used + schema = self._apply_to_root(schema) + if self._should_be_nullable and not self._is_nullable: + schema = core_schema.nullable_schema(schema) + self._used = True + return schema + + def _apply_to_root(self, schema: core_schema.CoreSchema) -> core_schema.CoreSchema: + """This method handles the outer-most stage of recursion over the input schema: + unwrapping nullable or definitions schemas, and calling the `_handle_choice` + method iteratively on the choices extracted (recursively) from the possibly-wrapped union. + """ + if schema['type'] == 'nullable': + self._is_nullable = True + wrapped = self._apply_to_root(schema['schema']) + nullable_wrapper = schema.copy() + nullable_wrapper['schema'] = wrapped + return nullable_wrapper + + if schema['type'] == 'definitions': + wrapped = self._apply_to_root(schema['schema']) + definitions_wrapper = schema.copy() + definitions_wrapper['schema'] = wrapped + return definitions_wrapper + + if schema['type'] != 'union': + # If the schema is not a union, it probably means it just had a single member and + # was flattened by pydantic_core. + # However, it still may make sense to apply the discriminator to this schema, + # as a way to get discriminated-union-style error messages, so we allow this here. + schema = core_schema.union_schema([schema]) + + # Reverse the choices list before extending the stack so that they get handled in the order they occur + choices_schemas = [v[0] if isinstance(v, tuple) else v for v in schema['choices'][::-1]] + self._choices_to_handle.extend(choices_schemas) + while self._choices_to_handle: + choice = self._choices_to_handle.pop() + self._handle_choice(choice) + + if self._discriminator_alias is not None and self._discriminator_alias != self.discriminator: + # * We need to annotate `discriminator` as a union here to handle both branches of this conditional + # * We need to annotate `discriminator` as list[list[str | int]] and not list[list[str]] due to the + # invariance of list, and because list[list[str | int]] is the type of the discriminator argument + # to tagged_union_schema below + # * See the docstring of pydantic_core.core_schema.tagged_union_schema for more details about how to + # interpret the value of the discriminator argument to tagged_union_schema. (The list[list[str]] here + # is the appropriate way to provide a list of fallback attributes to check for a discriminator value.) + discriminator: str | list[list[str | int]] = [[self.discriminator], [self._discriminator_alias]] + else: + discriminator = self.discriminator + return core_schema.tagged_union_schema( + choices=self._tagged_union_choices, + discriminator=discriminator, + custom_error_type=schema.get('custom_error_type'), + custom_error_message=schema.get('custom_error_message'), + custom_error_context=schema.get('custom_error_context'), + strict=False, + from_attributes=True, + ref=schema.get('ref'), + metadata=schema.get('metadata'), + serialization=schema.get('serialization'), + ) + + def _handle_choice(self, choice: core_schema.CoreSchema) -> None: + """This method handles the "middle" stage of recursion over the input schema. + Specifically, it is responsible for handling each choice of the outermost union + (and any "coalesced" choices obtained from inner unions). + + Here, "handling" entails: + * Coalescing nested unions and compatible tagged-unions + * Tracking the presence of 'none' and 'nullable' schemas occurring as choices + * Validating that each allowed discriminator value maps to a unique choice + * Updating the _tagged_union_choices mapping that will ultimately be used to build the TaggedUnionSchema. + """ + if choice['type'] == 'definition-ref': + if choice['schema_ref'] not in self.definitions: + raise MissingDefinitionForUnionRef(choice['schema_ref']) + + if choice['type'] == 'none': + self._should_be_nullable = True + elif choice['type'] == 'definitions': + self._handle_choice(choice['schema']) + elif choice['type'] == 'nullable': + self._should_be_nullable = True + self._handle_choice(choice['schema']) # unwrap the nullable schema + elif choice['type'] == 'union': + # Reverse the choices list before extending the stack so that they get handled in the order they occur + choices_schemas = [v[0] if isinstance(v, tuple) else v for v in choice['choices'][::-1]] + self._choices_to_handle.extend(choices_schemas) + elif choice['type'] not in { + 'model', + 'typed-dict', + 'tagged-union', + 'lax-or-strict', + 'dataclass', + 'dataclass-args', + 'definition-ref', + } and not _core_utils.is_function_with_inner_schema(choice): + # We should eventually handle 'definition-ref' as well + err_str = f'The core schema type {choice["type"]!r} is not a valid discriminated union variant.' + if choice['type'] == 'list': + err_str += ( + ' If you are making use of a list of union types, make sure the discriminator is applied to the ' + 'union type and not the list (e.g. `list[Annotated[ | , Field(discriminator=...)]]`).' + ) + raise TypeError(err_str) + else: + if choice['type'] == 'tagged-union' and self._is_discriminator_shared(choice): + # In this case, this inner tagged-union is compatible with the outer tagged-union, + # and its choices can be coalesced into the outer TaggedUnionSchema. + subchoices = [x for x in choice['choices'].values() if not isinstance(x, (str, int))] + # Reverse the choices list before extending the stack so that they get handled in the order they occur + self._choices_to_handle.extend(subchoices[::-1]) + return + + inferred_discriminator_values = self._infer_discriminator_values_for_choice(choice, source_name=None) + self._set_unique_choice_for_values(choice, inferred_discriminator_values) + + def _is_discriminator_shared(self, choice: core_schema.TaggedUnionSchema) -> bool: + """This method returns a boolean indicating whether the discriminator for the `choice` + is the same as that being used for the outermost tagged union. This is used to + determine whether this TaggedUnionSchema choice should be "coalesced" into the top level, + or whether it should be treated as a separate (nested) choice. + """ + inner_discriminator = choice['discriminator'] + return inner_discriminator == self.discriminator or ( + isinstance(inner_discriminator, list) + and (self.discriminator in inner_discriminator or [self.discriminator] in inner_discriminator) + ) + + def _infer_discriminator_values_for_choice( # noqa C901 + self, choice: core_schema.CoreSchema, source_name: str | None + ) -> list[str | int]: + """This function recurses over `choice`, extracting all discriminator values that should map to this choice. + + `model_name` is accepted for the purpose of producing useful error messages. + """ + if choice['type'] == 'definitions': + return self._infer_discriminator_values_for_choice(choice['schema'], source_name=source_name) + + elif _core_utils.is_function_with_inner_schema(choice): + return self._infer_discriminator_values_for_choice(choice['schema'], source_name=source_name) + + elif choice['type'] == 'lax-or-strict': + return sorted( + set( + self._infer_discriminator_values_for_choice(choice['lax_schema'], source_name=None) + + self._infer_discriminator_values_for_choice(choice['strict_schema'], source_name=None) + ) + ) + + elif choice['type'] == 'tagged-union': + values: list[str | int] = [] + # Ignore str/int "choices" since these are just references to other choices + subchoices = [x for x in choice['choices'].values() if not isinstance(x, (str, int))] + for subchoice in subchoices: + subchoice_values = self._infer_discriminator_values_for_choice(subchoice, source_name=None) + values.extend(subchoice_values) + return values + + elif choice['type'] == 'union': + values = [] + for subchoice in choice['choices']: + subchoice_schema = subchoice[0] if isinstance(subchoice, tuple) else subchoice + subchoice_values = self._infer_discriminator_values_for_choice(subchoice_schema, source_name=None) + values.extend(subchoice_values) + return values + + elif choice['type'] == 'nullable': + self._should_be_nullable = True + return self._infer_discriminator_values_for_choice(choice['schema'], source_name=None) + + elif choice['type'] == 'model': + return self._infer_discriminator_values_for_choice(choice['schema'], source_name=choice['cls'].__name__) + + elif choice['type'] == 'dataclass': + return self._infer_discriminator_values_for_choice(choice['schema'], source_name=choice['cls'].__name__) + + elif choice['type'] == 'model-fields': + return self._infer_discriminator_values_for_model_choice(choice, source_name=source_name) + + elif choice['type'] == 'dataclass-args': + return self._infer_discriminator_values_for_dataclass_choice(choice, source_name=source_name) + + elif choice['type'] == 'typed-dict': + return self._infer_discriminator_values_for_typed_dict_choice(choice, source_name=source_name) + + elif choice['type'] == 'definition-ref': + schema_ref = choice['schema_ref'] + if schema_ref not in self.definitions: + raise MissingDefinitionForUnionRef(schema_ref) + return self._infer_discriminator_values_for_choice(self.definitions[schema_ref], source_name=source_name) + else: + err_str = f'The core schema type {choice["type"]!r} is not a valid discriminated union variant.' + if choice['type'] == 'list': + err_str += ( + ' If you are making use of a list of union types, make sure the discriminator is applied to the ' + 'union type and not the list (e.g. `list[Annotated[ | , Field(discriminator=...)]]`).' + ) + raise TypeError(err_str) + + def _infer_discriminator_values_for_typed_dict_choice( + self, choice: core_schema.TypedDictSchema, source_name: str | None = None + ) -> list[str | int]: + """This method just extracts the _infer_discriminator_values_for_choice logic specific to TypedDictSchema + for the sake of readability. + """ + source = 'TypedDict' if source_name is None else f'TypedDict {source_name!r}' + field = choice['fields'].get(self.discriminator) + if field is None: + raise PydanticUserError( + f'{source} needs a discriminator field for key {self.discriminator!r}', code='discriminator-no-field' + ) + return self._infer_discriminator_values_for_field(field, source) + + def _infer_discriminator_values_for_model_choice( + self, choice: core_schema.ModelFieldsSchema, source_name: str | None = None + ) -> list[str | int]: + source = 'ModelFields' if source_name is None else f'Model {source_name!r}' + field = choice['fields'].get(self.discriminator) + if field is None: + raise PydanticUserError( + f'{source} needs a discriminator field for key {self.discriminator!r}', code='discriminator-no-field' + ) + return self._infer_discriminator_values_for_field(field, source) + + def _infer_discriminator_values_for_dataclass_choice( + self, choice: core_schema.DataclassArgsSchema, source_name: str | None = None + ) -> list[str | int]: + source = 'DataclassArgs' if source_name is None else f'Dataclass {source_name!r}' + for field in choice['fields']: + if field['name'] == self.discriminator: + break + else: + raise PydanticUserError( + f'{source} needs a discriminator field for key {self.discriminator!r}', code='discriminator-no-field' + ) + return self._infer_discriminator_values_for_field(field, source) + + def _infer_discriminator_values_for_field(self, field: CoreSchemaField, source: str) -> list[str | int]: + if field['type'] == 'computed-field': + # This should never occur as a discriminator, as it is only relevant to serialization + return [] + alias = field.get('validation_alias', self.discriminator) + if not isinstance(alias, str): + raise PydanticUserError( + f'Alias {alias!r} is not supported in a discriminated union', code='discriminator-alias-type' + ) + if self._discriminator_alias is None: + self._discriminator_alias = alias + elif self._discriminator_alias != alias: + raise PydanticUserError( + f'Aliases for discriminator {self.discriminator!r} must be the same ' + f'(got {alias}, {self._discriminator_alias})', + code='discriminator-alias', + ) + return self._infer_discriminator_values_for_inner_schema(field['schema'], source) + + def _infer_discriminator_values_for_inner_schema( + self, schema: core_schema.CoreSchema, source: str + ) -> list[str | int]: + """When inferring discriminator values for a field, we typically extract the expected values from a literal + schema. This function does that, but also handles nested unions and defaults. + """ + if schema['type'] == 'literal': + return schema['expected'] + + elif schema['type'] == 'union': + # Generally when multiple values are allowed they should be placed in a single `Literal`, but + # we add this case to handle the situation where a field is annotated as a `Union` of `Literal`s. + # For example, this lets us handle `Union[Literal['key'], Union[Literal['Key'], Literal['KEY']]]` + values: list[Any] = [] + for choice in schema['choices']: + choice_schema = choice[0] if isinstance(choice, tuple) else choice + choice_values = self._infer_discriminator_values_for_inner_schema(choice_schema, source) + values.extend(choice_values) + return values + + elif schema['type'] == 'default': + # This will happen if the field has a default value; we ignore it while extracting the discriminator values + return self._infer_discriminator_values_for_inner_schema(schema['schema'], source) + + elif schema['type'] == 'function-after': + # After validators don't affect the discriminator values + return self._infer_discriminator_values_for_inner_schema(schema['schema'], source) + + elif schema['type'] in {'function-before', 'function-wrap', 'function-plain'}: + validator_type = repr(schema['type'].split('-')[1]) + raise PydanticUserError( + f'Cannot use a mode={validator_type} validator in the' + f' discriminator field {self.discriminator!r} of {source}', + code='discriminator-validator', + ) + + else: + raise PydanticUserError( + f'{source} needs field {self.discriminator!r} to be of type `Literal`', + code='discriminator-needs-literal', + ) + + def _set_unique_choice_for_values(self, choice: core_schema.CoreSchema, values: Sequence[str | int]) -> None: + """This method updates `self.tagged_union_choices` so that all provided (discriminator) `values` map to the + provided `choice`, validating that none of these values already map to another (different) choice. + """ + for discriminator_value in values: + if discriminator_value in self._tagged_union_choices: + # It is okay if `value` is already in tagged_union_choices as long as it maps to the same value. + # Because tagged_union_choices may map values to other values, we need to walk the choices dict + # until we get to a "real" choice, and confirm that is equal to the one assigned. + existing_choice = self._tagged_union_choices[discriminator_value] + if existing_choice != choice: + raise TypeError( + f'Value {discriminator_value!r} for discriminator ' + f'{self.discriminator!r} mapped to multiple choices' + ) + else: + self._tagged_union_choices[discriminator_value] = choice diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_docs_extraction.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_docs_extraction.py new file mode 100644 index 0000000000000000000000000000000000000000..7b5f310fe2211e5be1706ce11a4ee5c8ad327af8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_docs_extraction.py @@ -0,0 +1,108 @@ +"""Utilities related to attribute docstring extraction.""" + +from __future__ import annotations + +import ast +import inspect +import textwrap +from typing import Any + + +class DocstringVisitor(ast.NodeVisitor): + def __init__(self) -> None: + super().__init__() + + self.target: str | None = None + self.attrs: dict[str, str] = {} + self.previous_node_type: type[ast.AST] | None = None + + def visit(self, node: ast.AST) -> Any: + node_result = super().visit(node) + self.previous_node_type = type(node) + return node_result + + def visit_AnnAssign(self, node: ast.AnnAssign) -> Any: + if isinstance(node.target, ast.Name): + self.target = node.target.id + + def visit_Expr(self, node: ast.Expr) -> Any: + if ( + isinstance(node.value, ast.Constant) + and isinstance(node.value.value, str) + and self.previous_node_type is ast.AnnAssign + ): + docstring = inspect.cleandoc(node.value.value) + if self.target: + self.attrs[self.target] = docstring + self.target = None + + +def _dedent_source_lines(source: list[str]) -> str: + # Required for nested class definitions, e.g. in a function block + dedent_source = textwrap.dedent(''.join(source)) + if dedent_source.startswith((' ', '\t')): + # We are in the case where there's a dedented (usually multiline) string + # at a lower indentation level than the class itself. We wrap our class + # in a function as a workaround. + dedent_source = f'def dedent_workaround():\n{dedent_source}' + return dedent_source + + +def _extract_source_from_frame(cls: type[Any]) -> list[str] | None: + frame = inspect.currentframe() + + while frame: + if inspect.getmodule(frame) is inspect.getmodule(cls): + lnum = frame.f_lineno + try: + lines, _ = inspect.findsource(frame) + except OSError: # pragma: no cover + # Source can't be retrieved (maybe because running in an interactive terminal), + # we don't want to error here. + pass + else: + block_lines = inspect.getblock(lines[lnum - 1 :]) + dedent_source = _dedent_source_lines(block_lines) + try: + block_tree = ast.parse(dedent_source) + except SyntaxError: + pass + else: + stmt = block_tree.body[0] + if isinstance(stmt, ast.FunctionDef) and stmt.name == 'dedent_workaround': + # `_dedent_source_lines` wrapped the class around the workaround function + stmt = stmt.body[0] + if isinstance(stmt, ast.ClassDef) and stmt.name == cls.__name__: + return block_lines + + frame = frame.f_back + + +def extract_docstrings_from_cls(cls: type[Any], use_inspect: bool = False) -> dict[str, str]: + """Map model attributes and their corresponding docstring. + + Args: + cls: The class of the Pydantic model to inspect. + use_inspect: Whether to skip usage of frames to find the object and use + the `inspect` module instead. + + Returns: + A mapping containing attribute names and their corresponding docstring. + """ + if use_inspect: + # Might not work as expected if two classes have the same name in the same source file. + try: + source, _ = inspect.getsourcelines(cls) + except OSError: # pragma: no cover + return {} + else: + source = _extract_source_from_frame(cls) + + if not source: + return {} + + dedent_source = _dedent_source_lines(source) + + visitor = DocstringVisitor() + visitor.visit(ast.parse(dedent_source)) + return visitor.attrs diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_fields.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_fields.py new file mode 100644 index 0000000000000000000000000000000000000000..658be3baaa51b46ad9650434ceead39fae1f73e2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_fields.py @@ -0,0 +1,515 @@ +"""Private logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.""" + +from __future__ import annotations as _annotations + +import dataclasses +import warnings +from collections.abc import Mapping +from copy import copy +from functools import cache +from inspect import Parameter, ismethoddescriptor, signature +from re import Pattern +from typing import TYPE_CHECKING, Any, Callable, TypeVar + +from pydantic_core import PydanticUndefined +from typing_extensions import TypeIs, get_origin +from typing_inspection import typing_objects +from typing_inspection.introspection import AnnotationSource + +from pydantic import PydanticDeprecatedSince211 +from pydantic.errors import PydanticUserError + +from . import _generics, _typing_extra +from ._config import ConfigWrapper +from ._docs_extraction import extract_docstrings_from_cls +from ._import_utils import import_cached_base_model, import_cached_field_info +from ._namespace_utils import NsResolver +from ._repr import Representation +from ._utils import can_be_positional + +if TYPE_CHECKING: + from annotated_types import BaseMetadata + + from ..fields import FieldInfo + from ..main import BaseModel + from ._dataclasses import PydanticDataclass, StandardDataclass + from ._decorators import DecoratorInfos + + +class PydanticMetadata(Representation): + """Base class for annotation markers like `Strict`.""" + + __slots__ = () + + +def pydantic_general_metadata(**metadata: Any) -> BaseMetadata: + """Create a new `_PydanticGeneralMetadata` class with the given metadata. + + Args: + **metadata: The metadata to add. + + Returns: + The new `_PydanticGeneralMetadata` class. + """ + return _general_metadata_cls()(metadata) # type: ignore + + +@cache +def _general_metadata_cls() -> type[BaseMetadata]: + """Do it this way to avoid importing `annotated_types` at import time.""" + from annotated_types import BaseMetadata + + class _PydanticGeneralMetadata(PydanticMetadata, BaseMetadata): + """Pydantic general metadata like `max_digits`.""" + + def __init__(self, metadata: Any): + self.__dict__ = metadata + + return _PydanticGeneralMetadata # type: ignore + + +def _update_fields_from_docstrings(cls: type[Any], fields: dict[str, FieldInfo], use_inspect: bool = False) -> None: + fields_docs = extract_docstrings_from_cls(cls, use_inspect=use_inspect) + for ann_name, field_info in fields.items(): + if field_info.description is None and ann_name in fields_docs: + field_info.description = fields_docs[ann_name] + + +def collect_model_fields( # noqa: C901 + cls: type[BaseModel], + config_wrapper: ConfigWrapper, + ns_resolver: NsResolver | None, + *, + typevars_map: Mapping[TypeVar, Any] | None = None, +) -> tuple[dict[str, FieldInfo], set[str]]: + """Collect the fields and class variables names of a nascent Pydantic model. + + The fields collection process is *lenient*, meaning it won't error if string annotations + fail to evaluate. If this happens, the original annotation (and assigned value, if any) + is stored on the created `FieldInfo` instance. + + The `rebuild_model_fields()` should be called at a later point (e.g. when rebuilding the model), + and will make use of these stored attributes. + + Args: + cls: BaseModel or dataclass. + config_wrapper: The config wrapper instance. + ns_resolver: Namespace resolver to use when getting model annotations. + typevars_map: A dictionary mapping type variables to their concrete types. + + Returns: + A two-tuple containing model fields and class variables names. + + Raises: + NameError: + - If there is a conflict between a field name and protected namespaces. + - If there is a field other than `root` in `RootModel`. + - If a field shadows an attribute in the parent model. + """ + BaseModel = import_cached_base_model() + FieldInfo_ = import_cached_field_info() + + bases = cls.__bases__ + parent_fields_lookup: dict[str, FieldInfo] = {} + for base in reversed(bases): + if model_fields := getattr(base, '__pydantic_fields__', None): + parent_fields_lookup.update(model_fields) + + type_hints = _typing_extra.get_model_type_hints(cls, ns_resolver=ns_resolver) + + # https://docs.python.org/3/howto/annotations.html#accessing-the-annotations-dict-of-an-object-in-python-3-9-and-older + # annotations is only used for finding fields in parent classes + annotations = cls.__dict__.get('__annotations__', {}) + fields: dict[str, FieldInfo] = {} + + class_vars: set[str] = set() + for ann_name, (ann_type, evaluated) in type_hints.items(): + if ann_name == 'model_config': + # We never want to treat `model_config` as a field + # Note: we may need to change this logic if/when we introduce a `BareModel` class with no + # protected namespaces (where `model_config` might be allowed as a field name) + continue + + for protected_namespace in config_wrapper.protected_namespaces: + ns_violation: bool = False + if isinstance(protected_namespace, Pattern): + ns_violation = protected_namespace.match(ann_name) is not None + elif isinstance(protected_namespace, str): + ns_violation = ann_name.startswith(protected_namespace) + + if ns_violation: + for b in bases: + if hasattr(b, ann_name): + if not (issubclass(b, BaseModel) and ann_name in getattr(b, '__pydantic_fields__', {})): + raise NameError( + f'Field "{ann_name}" conflicts with member {getattr(b, ann_name)}' + f' of protected namespace "{protected_namespace}".' + ) + else: + valid_namespaces = () + for pn in config_wrapper.protected_namespaces: + if isinstance(pn, Pattern): + if not pn.match(ann_name): + valid_namespaces += (f're.compile({pn.pattern})',) + else: + if not ann_name.startswith(pn): + valid_namespaces += (pn,) + + warnings.warn( + f'Field "{ann_name}" in {cls.__name__} has conflict with protected namespace "{protected_namespace}".' + '\n\nYou may be able to resolve this warning by setting' + f" `model_config['protected_namespaces'] = {valid_namespaces}`.", + UserWarning, + ) + if _typing_extra.is_classvar_annotation(ann_type): + class_vars.add(ann_name) + continue + + assigned_value = getattr(cls, ann_name, PydanticUndefined) + + if not is_valid_field_name(ann_name): + continue + if cls.__pydantic_root_model__ and ann_name != 'root': + raise NameError( + f"Unexpected field with name {ann_name!r}; only 'root' is allowed as a field of a `RootModel`" + ) + + # when building a generic model with `MyModel[int]`, the generic_origin check makes sure we don't get + # "... shadows an attribute" warnings + generic_origin = getattr(cls, '__pydantic_generic_metadata__', {}).get('origin') + for base in bases: + dataclass_fields = { + field.name for field in (dataclasses.fields(base) if dataclasses.is_dataclass(base) else ()) + } + if hasattr(base, ann_name): + if base is generic_origin: + # Don't warn when "shadowing" of attributes in parametrized generics + continue + + if ann_name in dataclass_fields: + # Don't warn when inheriting stdlib dataclasses whose fields are "shadowed" by defaults being set + # on the class instance. + continue + + if ann_name not in annotations: + # Don't warn when a field exists in a parent class but has not been defined in the current class + continue + + warnings.warn( + f'Field name "{ann_name}" in "{cls.__qualname__}" shadows an attribute in parent ' + f'"{base.__qualname__}"', + UserWarning, + ) + + if assigned_value is PydanticUndefined: # no assignment, just a plain annotation + if ann_name in annotations or ann_name not in parent_fields_lookup: + # field is either: + # - present in the current model's annotations (and *not* from parent classes) + # - not found on any base classes; this seems to be caused by fields bot getting + # generated due to models not being fully defined while initializing recursive models. + # Nothing stops us from just creating a `FieldInfo` for this type hint, so we do this. + field_info = FieldInfo_.from_annotation(ann_type, _source=AnnotationSource.CLASS) + if not evaluated: + field_info._complete = False + # Store the original annotation that should be used to rebuild + # the field info later: + field_info._original_annotation = ann_type + else: + # The field was present on one of the (possibly multiple) base classes + # copy the field to make sure typevar substitutions don't cause issues with the base classes + field_info = copy(parent_fields_lookup[ann_name]) + + else: # An assigned value is present (either the default value, or a `Field()` function) + _warn_on_nested_alias_in_annotation(ann_type, ann_name) + if isinstance(assigned_value, FieldInfo_) and ismethoddescriptor(assigned_value.default): + # `assigned_value` was fetched using `getattr`, which triggers a call to `__get__` + # for descriptors, so we do the same if the `= field(default=...)` form is used. + # Note that we only do this for method descriptors for now, we might want to + # extend this to any descriptor in the future (by simply checking for + # `hasattr(assigned_value.default, '__get__')`). + assigned_value.default = assigned_value.default.__get__(None, cls) + + # The `from_annotated_attribute()` call below mutates the assigned `Field()`, so make a copy: + original_assignment = ( + assigned_value._copy() if not evaluated and isinstance(assigned_value, FieldInfo_) else assigned_value + ) + + field_info = FieldInfo_.from_annotated_attribute(ann_type, assigned_value, _source=AnnotationSource.CLASS) + # Store the original annotation and assignment value that should be used to rebuild the field info later. + # Note that the assignment is always stored as the annotation might contain a type var that is later + # parameterized with an unknown forward reference (and we'll need it to rebuild the field info): + field_info._original_assignment = original_assignment + if not evaluated: + field_info._complete = False + field_info._original_annotation = ann_type + elif 'final' in field_info._qualifiers and not field_info.is_required(): + warnings.warn( + f'Annotation {ann_name!r} is marked as final and has a default value. Pydantic treats {ann_name!r} as a ' + 'class variable, but it will be considered as a normal field in V3 to be aligned with dataclasses. If you ' + f'still want {ann_name!r} to be considered as a class variable, annotate it as: `ClassVar[] = .`', + category=PydanticDeprecatedSince211, + # Incorrect when `create_model` is used, but the chance that final with a default is used is low in that case: + stacklevel=4, + ) + class_vars.add(ann_name) + continue + + # attributes which are fields are removed from the class namespace: + # 1. To match the behaviour of annotation-only fields + # 2. To avoid false positives in the NameError check above + try: + delattr(cls, ann_name) + except AttributeError: + pass # indicates the attribute was on a parent class + + # Use cls.__dict__['__pydantic_decorators__'] instead of cls.__pydantic_decorators__ + # to make sure the decorators have already been built for this exact class + decorators: DecoratorInfos = cls.__dict__['__pydantic_decorators__'] + if ann_name in decorators.computed_fields: + raise TypeError( + f'Field {ann_name!r} of class {cls.__name__!r} overrides symbol of same name in a parent class. ' + 'This override with a computed_field is incompatible.' + ) + fields[ann_name] = field_info + + if typevars_map: + for field in fields.values(): + if field._complete: + field.apply_typevars_map(typevars_map) + + if config_wrapper.use_attribute_docstrings: + _update_fields_from_docstrings(cls, fields) + return fields, class_vars + + +def _warn_on_nested_alias_in_annotation(ann_type: type[Any], ann_name: str) -> None: + FieldInfo = import_cached_field_info() + + args = getattr(ann_type, '__args__', None) + if args: + for anno_arg in args: + if typing_objects.is_annotated(get_origin(anno_arg)): + for anno_type_arg in _typing_extra.get_args(anno_arg): + if isinstance(anno_type_arg, FieldInfo) and anno_type_arg.alias is not None: + warnings.warn( + f'`alias` specification on field "{ann_name}" must be set on outermost annotation to take effect.', + UserWarning, + ) + return + + +def rebuild_model_fields( + cls: type[BaseModel], + *, + ns_resolver: NsResolver, + typevars_map: Mapping[TypeVar, Any], +) -> dict[str, FieldInfo]: + """Rebuild the (already present) model fields by trying to reevaluate annotations. + + This function should be called whenever a model with incomplete fields is encountered. + + Raises: + NameError: If one of the annotations failed to evaluate. + + Note: + This function *doesn't* mutate the model fields in place, as it can be called during + schema generation, where you don't want to mutate other model's fields. + """ + FieldInfo_ = import_cached_field_info() + + rebuilt_fields: dict[str, FieldInfo] = {} + with ns_resolver.push(cls): + for f_name, field_info in cls.__pydantic_fields__.items(): + if field_info._complete: + rebuilt_fields[f_name] = field_info + else: + existing_desc = field_info.description + ann = _typing_extra.eval_type( + field_info._original_annotation, + *ns_resolver.types_namespace, + ) + ann = _generics.replace_types(ann, typevars_map) + + if (assign := field_info._original_assignment) is PydanticUndefined: + new_field = FieldInfo_.from_annotation(ann, _source=AnnotationSource.CLASS) + else: + new_field = FieldInfo_.from_annotated_attribute(ann, assign, _source=AnnotationSource.CLASS) + # The description might come from the docstring if `use_attribute_docstrings` was `True`: + new_field.description = new_field.description if new_field.description is not None else existing_desc + rebuilt_fields[f_name] = new_field + + return rebuilt_fields + + +def collect_dataclass_fields( + cls: type[StandardDataclass], + *, + ns_resolver: NsResolver | None = None, + typevars_map: dict[Any, Any] | None = None, + config_wrapper: ConfigWrapper | None = None, +) -> dict[str, FieldInfo]: + """Collect the fields of a dataclass. + + Args: + cls: dataclass. + ns_resolver: Namespace resolver to use when getting dataclass annotations. + Defaults to an empty instance. + typevars_map: A dictionary mapping type variables to their concrete types. + config_wrapper: The config wrapper instance. + + Returns: + The dataclass fields. + """ + FieldInfo_ = import_cached_field_info() + + fields: dict[str, FieldInfo] = {} + ns_resolver = ns_resolver or NsResolver() + dataclass_fields = cls.__dataclass_fields__ + + # The logic here is similar to `_typing_extra.get_cls_type_hints`, + # although we do it manually as stdlib dataclasses already have annotations + # collected in each class: + for base in reversed(cls.__mro__): + if not dataclasses.is_dataclass(base): + continue + + with ns_resolver.push(base): + for ann_name, dataclass_field in dataclass_fields.items(): + if ann_name not in base.__dict__.get('__annotations__', {}): + # `__dataclass_fields__`contains every field, even the ones from base classes. + # Only collect the ones defined on `base`. + continue + + globalns, localns = ns_resolver.types_namespace + ann_type, evaluated = _typing_extra.try_eval_type(dataclass_field.type, globalns, localns) + + if _typing_extra.is_classvar_annotation(ann_type): + continue + + if ( + not dataclass_field.init + and dataclass_field.default is dataclasses.MISSING + and dataclass_field.default_factory is dataclasses.MISSING + ): + # TODO: We should probably do something with this so that validate_assignment behaves properly + # Issue: https://github.com/pydantic/pydantic/issues/5470 + continue + + if isinstance(dataclass_field.default, FieldInfo_): + if dataclass_field.default.init_var: + if dataclass_field.default.init is False: + raise PydanticUserError( + f'Dataclass field {ann_name} has init=False and init_var=True, but these are mutually exclusive.', + code='clashing-init-and-init-var', + ) + + # TODO: same note as above re validate_assignment + continue + field_info = FieldInfo_.from_annotated_attribute( + ann_type, dataclass_field.default, _source=AnnotationSource.DATACLASS + ) + field_info._original_assignment = dataclass_field.default + else: + field_info = FieldInfo_.from_annotated_attribute( + ann_type, dataclass_field, _source=AnnotationSource.DATACLASS + ) + field_info._original_assignment = dataclass_field + + if not evaluated: + field_info._complete = False + field_info._original_annotation = ann_type + + fields[ann_name] = field_info + + if field_info.default is not PydanticUndefined and isinstance( + getattr(cls, ann_name, field_info), FieldInfo_ + ): + # We need this to fix the default when the "default" from __dataclass_fields__ is a pydantic.FieldInfo + setattr(cls, ann_name, field_info.default) + + if typevars_map: + for field in fields.values(): + # We don't pass any ns, as `field.annotation` + # was already evaluated. TODO: is this method relevant? + # Can't we juste use `_generics.replace_types`? + field.apply_typevars_map(typevars_map) + + if config_wrapper is not None and config_wrapper.use_attribute_docstrings: + _update_fields_from_docstrings( + cls, + fields, + # We can't rely on the (more reliable) frame inspection method + # for stdlib dataclasses: + use_inspect=not hasattr(cls, '__is_pydantic_dataclass__'), + ) + + return fields + + +def rebuild_dataclass_fields( + cls: type[PydanticDataclass], + *, + config_wrapper: ConfigWrapper, + ns_resolver: NsResolver, + typevars_map: Mapping[TypeVar, Any], +) -> dict[str, FieldInfo]: + """Rebuild the (already present) dataclass fields by trying to reevaluate annotations. + + This function should be called whenever a dataclass with incomplete fields is encountered. + + Raises: + NameError: If one of the annotations failed to evaluate. + + Note: + This function *doesn't* mutate the dataclass fields in place, as it can be called during + schema generation, where you don't want to mutate other dataclass's fields. + """ + FieldInfo_ = import_cached_field_info() + + rebuilt_fields: dict[str, FieldInfo] = {} + with ns_resolver.push(cls): + for f_name, field_info in cls.__pydantic_fields__.items(): + if field_info._complete: + rebuilt_fields[f_name] = field_info + else: + existing_desc = field_info.description + ann = _typing_extra.eval_type( + field_info._original_annotation, + *ns_resolver.types_namespace, + ) + ann = _generics.replace_types(ann, typevars_map) + new_field = FieldInfo_.from_annotated_attribute( + ann, + field_info._original_assignment, + _source=AnnotationSource.DATACLASS, + ) + + # The description might come from the docstring if `use_attribute_docstrings` was `True`: + new_field.description = new_field.description if new_field.description is not None else existing_desc + rebuilt_fields[f_name] = new_field + + return rebuilt_fields + + +def is_valid_field_name(name: str) -> bool: + return not name.startswith('_') + + +def is_valid_privateattr_name(name: str) -> bool: + return name.startswith('_') and not name.startswith('__') + + +def takes_validated_data_argument( + default_factory: Callable[[], Any] | Callable[[dict[str, Any]], Any], +) -> TypeIs[Callable[[dict[str, Any]], Any]]: + """Whether the provided default factory callable has a validated data parameter.""" + try: + sig = signature(default_factory) + except (ValueError, TypeError): + # `inspect.signature` might not be able to infer a signature, e.g. with C objects. + # In this case, we assume no data argument is present: + return False + + parameters = list(sig.parameters.values()) + + return len(parameters) == 1 and can_be_positional(parameters[0]) and parameters[0].default is Parameter.empty diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_forward_ref.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_forward_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..231f81d11b87ef05d4765cd61d88d7348eb9e401 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_forward_ref.py @@ -0,0 +1,23 @@ +from __future__ import annotations as _annotations + +from dataclasses import dataclass +from typing import Union + + +@dataclass +class PydanticRecursiveRef: + type_ref: str + + __name__ = 'PydanticRecursiveRef' + __hash__ = object.__hash__ + + def __call__(self) -> None: + """Defining __call__ is necessary for the `typing` module to let you use an instance of + this class as the result of resolving a standard ForwardRef. + """ + + def __or__(self, other): + return Union[self, other] # type: ignore + + def __ror__(self, other): + return Union[other, self] # type: ignore diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py new file mode 100644 index 0000000000000000000000000000000000000000..04512289aced75c1923d2eeefa55b9b8b51ede0a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py @@ -0,0 +1,2904 @@ +"""Convert python types to pydantic-core schema.""" + +from __future__ import annotations as _annotations + +import collections.abc +import dataclasses +import datetime +import inspect +import os +import pathlib +import re +import sys +import typing +import warnings +from collections.abc import Generator, Iterable, Iterator, Mapping +from contextlib import contextmanager +from copy import copy +from decimal import Decimal +from enum import Enum +from fractions import Fraction +from functools import partial +from inspect import Parameter, _ParameterKind, signature +from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network +from itertools import chain +from operator import attrgetter +from types import FunctionType, GenericAlias, LambdaType, MethodType +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Final, + ForwardRef, + Literal, + TypeVar, + Union, + cast, + overload, +) +from uuid import UUID +from warnings import warn +from zoneinfo import ZoneInfo + +import typing_extensions +from pydantic_core import ( + CoreSchema, + MultiHostUrl, + PydanticCustomError, + PydanticSerializationUnexpectedValue, + PydanticUndefined, + Url, + core_schema, + to_jsonable_python, +) +from typing_extensions import TypeAlias, TypeAliasType, TypedDict, get_args, get_origin, is_typeddict +from typing_inspection import typing_objects +from typing_inspection.introspection import AnnotationSource, get_literal_values, is_union_origin + +from ..aliases import AliasChoices, AliasGenerator, AliasPath +from ..annotated_handlers import GetCoreSchemaHandler, GetJsonSchemaHandler +from ..config import ConfigDict, JsonDict, JsonEncoder, JsonSchemaExtraCallable +from ..errors import PydanticSchemaGenerationError, PydanticUndefinedAnnotation, PydanticUserError +from ..functional_validators import AfterValidator, BeforeValidator, FieldValidatorModes, PlainValidator, WrapValidator +from ..json_schema import JsonSchemaValue +from ..version import version_short +from ..warnings import PydanticDeprecatedSince20 +from . import _decorators, _discriminated_union, _known_annotated_metadata, _repr, _typing_extra +from ._config import ConfigWrapper, ConfigWrapperStack +from ._core_metadata import CoreMetadata, update_core_metadata +from ._core_utils import ( + get_ref, + get_type_ref, + is_list_like_schema_with_items_schema, + validate_core_schema, +) +from ._decorators import ( + Decorator, + DecoratorInfos, + FieldSerializerDecoratorInfo, + FieldValidatorDecoratorInfo, + ModelSerializerDecoratorInfo, + ModelValidatorDecoratorInfo, + RootValidatorDecoratorInfo, + ValidatorDecoratorInfo, + get_attribute_from_bases, + inspect_field_serializer, + inspect_model_serializer, + inspect_validator, +) +from ._docs_extraction import extract_docstrings_from_cls +from ._fields import ( + collect_dataclass_fields, + rebuild_dataclass_fields, + rebuild_model_fields, + takes_validated_data_argument, +) +from ._forward_ref import PydanticRecursiveRef +from ._generics import get_standard_typevars_map, replace_types +from ._import_utils import import_cached_base_model, import_cached_field_info +from ._mock_val_ser import MockCoreSchema +from ._namespace_utils import NamespacesTuple, NsResolver +from ._schema_gather import MissingDefinitionError, gather_schemas_for_cleaning +from ._schema_generation_shared import CallbackGetCoreSchemaHandler +from ._utils import lenient_issubclass, smart_deepcopy + +if TYPE_CHECKING: + from ..fields import ComputedFieldInfo, FieldInfo + from ..main import BaseModel + from ..types import Discriminator + from ._dataclasses import StandardDataclass + from ._schema_generation_shared import GetJsonSchemaFunction + +_SUPPORTS_TYPEDDICT = sys.version_info >= (3, 12) + +FieldDecoratorInfo = Union[ValidatorDecoratorInfo, FieldValidatorDecoratorInfo, FieldSerializerDecoratorInfo] +FieldDecoratorInfoType = TypeVar('FieldDecoratorInfoType', bound=FieldDecoratorInfo) +AnyFieldDecorator = Union[ + Decorator[ValidatorDecoratorInfo], + Decorator[FieldValidatorDecoratorInfo], + Decorator[FieldSerializerDecoratorInfo], +] + +ModifyCoreSchemaWrapHandler: TypeAlias = GetCoreSchemaHandler +GetCoreSchemaFunction: TypeAlias = Callable[[Any, ModifyCoreSchemaWrapHandler], core_schema.CoreSchema] +ParametersCallback: TypeAlias = "Callable[[int, str, Any], Literal['skip'] | None]" + +TUPLE_TYPES: list[type] = [typing.Tuple, tuple] # noqa: UP006 +LIST_TYPES: list[type] = [typing.List, list, collections.abc.MutableSequence] # noqa: UP006 +SET_TYPES: list[type] = [typing.Set, set, collections.abc.MutableSet] # noqa: UP006 +FROZEN_SET_TYPES: list[type] = [typing.FrozenSet, frozenset, collections.abc.Set] # noqa: UP006 +DICT_TYPES: list[type] = [typing.Dict, dict] # noqa: UP006 +IP_TYPES: list[type] = [IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network] +SEQUENCE_TYPES: list[type] = [typing.Sequence, collections.abc.Sequence] +ITERABLE_TYPES: list[type] = [typing.Iterable, collections.abc.Iterable, typing.Generator, collections.abc.Generator] +TYPE_TYPES: list[type] = [typing.Type, type] # noqa: UP006 +PATTERN_TYPES: list[type] = [typing.Pattern, re.Pattern] +PATH_TYPES: list[type] = [ + os.PathLike, + pathlib.Path, + pathlib.PurePath, + pathlib.PosixPath, + pathlib.PurePosixPath, + pathlib.PureWindowsPath, +] +MAPPING_TYPES = [ + typing.Mapping, + typing.MutableMapping, + collections.abc.Mapping, + collections.abc.MutableMapping, + collections.OrderedDict, + typing_extensions.OrderedDict, + typing.DefaultDict, # noqa: UP006 + collections.defaultdict, +] +COUNTER_TYPES = [collections.Counter, typing.Counter] +DEQUE_TYPES: list[type] = [collections.deque, typing.Deque] # noqa: UP006 + +# Note: This does not play very well with type checkers. For example, +# `a: LambdaType = lambda x: x` will raise a type error by Pyright. +ValidateCallSupportedTypes = Union[ + LambdaType, + FunctionType, + MethodType, + partial, +] + +VALIDATE_CALL_SUPPORTED_TYPES = get_args(ValidateCallSupportedTypes) + +_mode_to_validator: dict[ + FieldValidatorModes, type[BeforeValidator | AfterValidator | PlainValidator | WrapValidator] +] = {'before': BeforeValidator, 'after': AfterValidator, 'plain': PlainValidator, 'wrap': WrapValidator} + + +def check_validator_fields_against_field_name( + info: FieldDecoratorInfo, + field: str, +) -> bool: + """Check if field name is in validator fields. + + Args: + info: The field info. + field: The field name to check. + + Returns: + `True` if field name is in validator fields, `False` otherwise. + """ + fields = info.fields + return '*' in fields or field in fields + + +def check_decorator_fields_exist(decorators: Iterable[AnyFieldDecorator], fields: Iterable[str]) -> None: + """Check if the defined fields in decorators exist in `fields` param. + + It ignores the check for a decorator if the decorator has `*` as field or `check_fields=False`. + + Args: + decorators: An iterable of decorators. + fields: An iterable of fields name. + + Raises: + PydanticUserError: If one of the field names does not exist in `fields` param. + """ + fields = set(fields) + for dec in decorators: + if '*' in dec.info.fields: + continue + if dec.info.check_fields is False: + continue + for field in dec.info.fields: + if field not in fields: + raise PydanticUserError( + f'Decorators defined with incorrect fields: {dec.cls_ref}.{dec.cls_var_name}' + " (use check_fields=False if you're inheriting from the model and intended this)", + code='decorator-missing-field', + ) + + +def filter_field_decorator_info_by_field( + validator_functions: Iterable[Decorator[FieldDecoratorInfoType]], field: str +) -> list[Decorator[FieldDecoratorInfoType]]: + return [dec for dec in validator_functions if check_validator_fields_against_field_name(dec.info, field)] + + +def apply_each_item_validators( + schema: core_schema.CoreSchema, + each_item_validators: list[Decorator[ValidatorDecoratorInfo]], + field_name: str | None, +) -> core_schema.CoreSchema: + # This V1 compatibility shim should eventually be removed + + # fail early if each_item_validators is empty + if not each_item_validators: + return schema + + # push down any `each_item=True` validators + # note that this won't work for any Annotated types that get wrapped by a function validator + # but that's okay because that didn't exist in V1 + if schema['type'] == 'nullable': + schema['schema'] = apply_each_item_validators(schema['schema'], each_item_validators, field_name) + return schema + elif schema['type'] == 'tuple': + if (variadic_item_index := schema.get('variadic_item_index')) is not None: + schema['items_schema'][variadic_item_index] = apply_validators( + schema['items_schema'][variadic_item_index], + each_item_validators, + field_name, + ) + elif is_list_like_schema_with_items_schema(schema): + inner_schema = schema.get('items_schema', core_schema.any_schema()) + schema['items_schema'] = apply_validators(inner_schema, each_item_validators, field_name) + elif schema['type'] == 'dict': + inner_schema = schema.get('values_schema', core_schema.any_schema()) + schema['values_schema'] = apply_validators(inner_schema, each_item_validators, field_name) + else: + raise TypeError( + f'`@validator(..., each_item=True)` cannot be applied to fields with a schema of {schema["type"]}' + ) + return schema + + +def _extract_json_schema_info_from_field_info( + info: FieldInfo | ComputedFieldInfo, +) -> tuple[JsonDict | None, JsonDict | JsonSchemaExtraCallable | None]: + json_schema_updates = { + 'title': info.title, + 'description': info.description, + 'deprecated': bool(info.deprecated) or info.deprecated == '' or None, + 'examples': to_jsonable_python(info.examples), + } + json_schema_updates = {k: v for k, v in json_schema_updates.items() if v is not None} + return (json_schema_updates or None, info.json_schema_extra) + + +JsonEncoders = dict[type[Any], JsonEncoder] + + +def _add_custom_serialization_from_json_encoders( + json_encoders: JsonEncoders | None, tp: Any, schema: CoreSchema +) -> CoreSchema: + """Iterate over the json_encoders and add the first matching encoder to the schema. + + Args: + json_encoders: A dictionary of types and their encoder functions. + tp: The type to check for a matching encoder. + schema: The schema to add the encoder to. + """ + if not json_encoders: + return schema + if 'serialization' in schema: + return schema + # Check the class type and its superclasses for a matching encoder + # Decimal.__class__.__mro__ (and probably other cases) doesn't include Decimal itself + # if the type is a GenericAlias (e.g. from list[int]) we need to use __class__ instead of .__mro__ + for base in (tp, *getattr(tp, '__mro__', tp.__class__.__mro__)[:-1]): + encoder = json_encoders.get(base) + if encoder is None: + continue + + warnings.warn( + f'`json_encoders` is deprecated. See https://docs.pydantic.dev/{version_short()}/concepts/serialization/#custom-serializers for alternatives', + PydanticDeprecatedSince20, + ) + + # TODO: in theory we should check that the schema accepts a serialization key + schema['serialization'] = core_schema.plain_serializer_function_ser_schema(encoder, when_used='json') + return schema + + return schema + + +def _get_first_non_null(a: Any, b: Any) -> Any: + """Return the first argument if it is not None, otherwise return the second argument. + + Use case: serialization_alias (argument a) and alias (argument b) are both defined, and serialization_alias is ''. + This function will return serialization_alias, which is the first argument, even though it is an empty string. + """ + return a if a is not None else b + + +class InvalidSchemaError(Exception): + """The core schema is invalid.""" + + +class GenerateSchema: + """Generate core schema for a Pydantic model, dataclass and types like `str`, `datetime`, ... .""" + + __slots__ = ( + '_config_wrapper_stack', + '_ns_resolver', + '_typevars_map', + 'field_name_stack', + 'model_type_stack', + 'defs', + ) + + def __init__( + self, + config_wrapper: ConfigWrapper, + ns_resolver: NsResolver | None = None, + typevars_map: Mapping[TypeVar, Any] | None = None, + ) -> None: + # we need a stack for recursing into nested models + self._config_wrapper_stack = ConfigWrapperStack(config_wrapper) + self._ns_resolver = ns_resolver or NsResolver() + self._typevars_map = typevars_map + self.field_name_stack = _FieldNameStack() + self.model_type_stack = _ModelTypeStack() + self.defs = _Definitions() + + def __init_subclass__(cls) -> None: + super().__init_subclass__() + warnings.warn( + 'Subclassing `GenerateSchema` is not supported. The API is highly subject to change in minor versions.', + UserWarning, + stacklevel=2, + ) + + @property + def _config_wrapper(self) -> ConfigWrapper: + return self._config_wrapper_stack.tail + + @property + def _types_namespace(self) -> NamespacesTuple: + return self._ns_resolver.types_namespace + + @property + def _arbitrary_types(self) -> bool: + return self._config_wrapper.arbitrary_types_allowed + + # the following methods can be overridden but should be considered + # unstable / private APIs + def _list_schema(self, items_type: Any) -> CoreSchema: + return core_schema.list_schema(self.generate_schema(items_type)) + + def _dict_schema(self, keys_type: Any, values_type: Any) -> CoreSchema: + return core_schema.dict_schema(self.generate_schema(keys_type), self.generate_schema(values_type)) + + def _set_schema(self, items_type: Any) -> CoreSchema: + return core_schema.set_schema(self.generate_schema(items_type)) + + def _frozenset_schema(self, items_type: Any) -> CoreSchema: + return core_schema.frozenset_schema(self.generate_schema(items_type)) + + def _enum_schema(self, enum_type: type[Enum]) -> CoreSchema: + cases: list[Any] = list(enum_type.__members__.values()) + + enum_ref = get_type_ref(enum_type) + description = None if not enum_type.__doc__ else inspect.cleandoc(enum_type.__doc__) + if ( + description == 'An enumeration.' + ): # This is the default value provided by enum.EnumMeta.__new__; don't use it + description = None + js_updates = {'title': enum_type.__name__, 'description': description} + js_updates = {k: v for k, v in js_updates.items() if v is not None} + + sub_type: Literal['str', 'int', 'float'] | None = None + if issubclass(enum_type, int): + sub_type = 'int' + value_ser_type: core_schema.SerSchema = core_schema.simple_ser_schema('int') + elif issubclass(enum_type, str): + # this handles `StrEnum` (3.11 only), and also `Foobar(str, Enum)` + sub_type = 'str' + value_ser_type = core_schema.simple_ser_schema('str') + elif issubclass(enum_type, float): + sub_type = 'float' + value_ser_type = core_schema.simple_ser_schema('float') + else: + # TODO this is an ugly hack, how do we trigger an Any schema for serialization? + value_ser_type = core_schema.plain_serializer_function_ser_schema(lambda x: x) + + if cases: + + def get_json_schema(schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue: + json_schema = handler(schema) + original_schema = handler.resolve_ref_schema(json_schema) + original_schema.update(js_updates) + return json_schema + + # we don't want to add the missing to the schema if it's the default one + default_missing = getattr(enum_type._missing_, '__func__', None) is Enum._missing_.__func__ # pyright: ignore[reportFunctionMemberAccess] + enum_schema = core_schema.enum_schema( + enum_type, + cases, + sub_type=sub_type, + missing=None if default_missing else enum_type._missing_, + ref=enum_ref, + metadata={'pydantic_js_functions': [get_json_schema]}, + ) + + if self._config_wrapper.use_enum_values: + enum_schema = core_schema.no_info_after_validator_function( + attrgetter('value'), enum_schema, serialization=value_ser_type + ) + + return enum_schema + + else: + + def get_json_schema_no_cases(_, handler: GetJsonSchemaHandler) -> JsonSchemaValue: + json_schema = handler(core_schema.enum_schema(enum_type, cases, sub_type=sub_type, ref=enum_ref)) + original_schema = handler.resolve_ref_schema(json_schema) + original_schema.update(js_updates) + return json_schema + + # Use an isinstance check for enums with no cases. + # The most important use case for this is creating TypeVar bounds for generics that should + # be restricted to enums. This is more consistent than it might seem at first, since you can only + # subclass enum.Enum (or subclasses of enum.Enum) if all parent classes have no cases. + # We use the get_json_schema function when an Enum subclass has been declared with no cases + # so that we can still generate a valid json schema. + return core_schema.is_instance_schema( + enum_type, + metadata={'pydantic_js_functions': [get_json_schema_no_cases]}, + ) + + def _ip_schema(self, tp: Any) -> CoreSchema: + from ._validators import IP_VALIDATOR_LOOKUP, IpType + + ip_type_json_schema_format: dict[type[IpType], str] = { + IPv4Address: 'ipv4', + IPv4Network: 'ipv4network', + IPv4Interface: 'ipv4interface', + IPv6Address: 'ipv6', + IPv6Network: 'ipv6network', + IPv6Interface: 'ipv6interface', + } + + def ser_ip(ip: Any, info: core_schema.SerializationInfo) -> str | IpType: + if not isinstance(ip, (tp, str)): + raise PydanticSerializationUnexpectedValue( + f"Expected `{tp}` but got `{type(ip)}` with value `'{ip}'` - serialized value may not be as expected." + ) + if info.mode == 'python': + return ip + return str(ip) + + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.no_info_plain_validator_function(IP_VALIDATOR_LOOKUP[tp]), + strict_schema=core_schema.json_or_python_schema( + json_schema=core_schema.no_info_after_validator_function(tp, core_schema.str_schema()), + python_schema=core_schema.is_instance_schema(tp), + ), + serialization=core_schema.plain_serializer_function_ser_schema(ser_ip, info_arg=True, when_used='always'), + metadata={ + 'pydantic_js_functions': [lambda _1, _2: {'type': 'string', 'format': ip_type_json_schema_format[tp]}] + }, + ) + + def _path_schema(self, tp: Any, path_type: Any) -> CoreSchema: + if tp is os.PathLike and (path_type not in {str, bytes} and not typing_objects.is_any(path_type)): + raise PydanticUserError( + '`os.PathLike` can only be used with `str`, `bytes` or `Any`', code='schema-for-unknown-type' + ) + + path_constructor = pathlib.PurePath if tp is os.PathLike else tp + strict_inner_schema = ( + core_schema.bytes_schema(strict=True) if (path_type is bytes) else core_schema.str_schema(strict=True) + ) + lax_inner_schema = core_schema.bytes_schema() if (path_type is bytes) else core_schema.str_schema() + + def path_validator(input_value: str | bytes) -> os.PathLike[Any]: # type: ignore + try: + if path_type is bytes: + if isinstance(input_value, bytes): + try: + input_value = input_value.decode() + except UnicodeDecodeError as e: + raise PydanticCustomError('bytes_type', 'Input must be valid bytes') from e + else: + raise PydanticCustomError('bytes_type', 'Input must be bytes') + elif not isinstance(input_value, str): + raise PydanticCustomError('path_type', 'Input is not a valid path') + + return path_constructor(input_value) # type: ignore + except TypeError as e: + raise PydanticCustomError('path_type', 'Input is not a valid path') from e + + def ser_path(path: Any, info: core_schema.SerializationInfo) -> str | os.PathLike[Any]: + if not isinstance(path, (tp, str)): + raise PydanticSerializationUnexpectedValue( + f"Expected `{tp}` but got `{type(path)}` with value `'{path}'` - serialized value may not be as expected." + ) + if info.mode == 'python': + return path + return str(path) + + instance_schema = core_schema.json_or_python_schema( + json_schema=core_schema.no_info_after_validator_function(path_validator, lax_inner_schema), + python_schema=core_schema.is_instance_schema(tp), + ) + + schema = core_schema.lax_or_strict_schema( + lax_schema=core_schema.union_schema( + [ + instance_schema, + core_schema.no_info_after_validator_function(path_validator, strict_inner_schema), + ], + custom_error_type='path_type', + custom_error_message=f'Input is not a valid path for {tp}', + ), + strict_schema=instance_schema, + serialization=core_schema.plain_serializer_function_ser_schema(ser_path, info_arg=True, when_used='always'), + metadata={'pydantic_js_functions': [lambda source, handler: {**handler(source), 'format': 'path'}]}, + ) + return schema + + def _deque_schema(self, items_type: Any) -> CoreSchema: + from ._serializers import serialize_sequence_via_list + from ._validators import deque_validator + + item_type_schema = self.generate_schema(items_type) + + # we have to use a lax list schema here, because we need to validate the deque's + # items via a list schema, but it's ok if the deque itself is not a list + list_schema = core_schema.list_schema(item_type_schema, strict=False) + + check_instance = core_schema.json_or_python_schema( + json_schema=list_schema, + python_schema=core_schema.is_instance_schema(collections.deque, cls_repr='Deque'), + ) + + lax_schema = core_schema.no_info_wrap_validator_function(deque_validator, list_schema) + + return core_schema.lax_or_strict_schema( + lax_schema=lax_schema, + strict_schema=core_schema.chain_schema([check_instance, lax_schema]), + serialization=core_schema.wrap_serializer_function_ser_schema( + serialize_sequence_via_list, schema=item_type_schema, info_arg=True + ), + ) + + def _mapping_schema(self, tp: Any, keys_type: Any, values_type: Any) -> CoreSchema: + from ._validators import MAPPING_ORIGIN_MAP, defaultdict_validator, get_defaultdict_default_default_factory + + mapped_origin = MAPPING_ORIGIN_MAP[tp] + keys_schema = self.generate_schema(keys_type) + values_schema = self.generate_schema(values_type) + dict_schema = core_schema.dict_schema(keys_schema, values_schema, strict=False) + + if mapped_origin is dict: + schema = dict_schema + else: + check_instance = core_schema.json_or_python_schema( + json_schema=dict_schema, + python_schema=core_schema.is_instance_schema(mapped_origin), + ) + + if tp is collections.defaultdict: + default_default_factory = get_defaultdict_default_default_factory(values_type) + coerce_instance_wrap = partial( + core_schema.no_info_wrap_validator_function, + partial(defaultdict_validator, default_default_factory=default_default_factory), + ) + else: + coerce_instance_wrap = partial(core_schema.no_info_after_validator_function, mapped_origin) + + lax_schema = coerce_instance_wrap(dict_schema) + strict_schema = core_schema.chain_schema([check_instance, lax_schema]) + + schema = core_schema.lax_or_strict_schema( + lax_schema=lax_schema, + strict_schema=strict_schema, + serialization=core_schema.wrap_serializer_function_ser_schema( + lambda v, h: h(v), schema=dict_schema, info_arg=False + ), + ) + + return schema + + def _fraction_schema(self) -> CoreSchema: + """Support for [`fractions.Fraction`][fractions.Fraction].""" + from ._validators import fraction_validator + + # TODO: note, this is a fairly common pattern, re lax / strict for attempted type coercion, + # can we use a helper function to reduce boilerplate? + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.no_info_plain_validator_function(fraction_validator), + strict_schema=core_schema.json_or_python_schema( + json_schema=core_schema.no_info_plain_validator_function(fraction_validator), + python_schema=core_schema.is_instance_schema(Fraction), + ), + # use str serialization to guarantee round trip behavior + serialization=core_schema.to_string_ser_schema(when_used='always'), + metadata={'pydantic_js_functions': [lambda _1, _2: {'type': 'string', 'format': 'fraction'}]}, + ) + + def _arbitrary_type_schema(self, tp: Any) -> CoreSchema: + if not isinstance(tp, type): + warn( + f'{tp!r} is not a Python type (it may be an instance of an object),' + ' Pydantic will allow any object with no validation since we cannot even' + ' enforce that the input is an instance of the given type.' + ' To get rid of this error wrap the type with `pydantic.SkipValidation`.', + UserWarning, + ) + return core_schema.any_schema() + return core_schema.is_instance_schema(tp) + + def _unknown_type_schema(self, obj: Any) -> CoreSchema: + raise PydanticSchemaGenerationError( + f'Unable to generate pydantic-core schema for {obj!r}. ' + 'Set `arbitrary_types_allowed=True` in the model_config to ignore this error' + ' or implement `__get_pydantic_core_schema__` on your type to fully support it.' + '\n\nIf you got this error by calling handler() within' + ' `__get_pydantic_core_schema__` then you likely need to call' + ' `handler.generate_schema()` since we do not call' + ' `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.' + ) + + def _apply_discriminator_to_union( + self, schema: CoreSchema, discriminator: str | Discriminator | None + ) -> CoreSchema: + if discriminator is None: + return schema + try: + return _discriminated_union.apply_discriminator( + schema, + discriminator, + self.defs._definitions, + ) + except _discriminated_union.MissingDefinitionForUnionRef: + # defer until defs are resolved + _discriminated_union.set_discriminator_in_metadata( + schema, + discriminator, + ) + return schema + + def clean_schema(self, schema: CoreSchema) -> CoreSchema: + schema = self.defs.finalize_schema(schema) + schema = validate_core_schema(schema) + return schema + + def _add_js_function(self, metadata_schema: CoreSchema, js_function: Callable[..., Any]) -> None: + metadata = metadata_schema.get('metadata', {}) + pydantic_js_functions = metadata.setdefault('pydantic_js_functions', []) + # because of how we generate core schemas for nested generic models + # we can end up adding `BaseModel.__get_pydantic_json_schema__` multiple times + # this check may fail to catch duplicates if the function is a `functools.partial` + # or something like that, but if it does it'll fail by inserting the duplicate + if js_function not in pydantic_js_functions: + pydantic_js_functions.append(js_function) + metadata_schema['metadata'] = metadata + + def generate_schema( + self, + obj: Any, + ) -> core_schema.CoreSchema: + """Generate core schema. + + Args: + obj: The object to generate core schema for. + + Returns: + The generated core schema. + + Raises: + PydanticUndefinedAnnotation: + If it is not possible to evaluate forward reference. + PydanticSchemaGenerationError: + If it is not possible to generate pydantic-core schema. + TypeError: + - If `alias_generator` returns a disallowed type (must be str, AliasPath or AliasChoices). + - If V1 style validator with `each_item=True` applied on a wrong field. + PydanticUserError: + - If `typing.TypedDict` is used instead of `typing_extensions.TypedDict` on Python < 3.12. + - If `__modify_schema__` method is used instead of `__get_pydantic_json_schema__`. + """ + schema = self._generate_schema_from_get_schema_method(obj, obj) + + if schema is None: + schema = self._generate_schema_inner(obj) + + metadata_js_function = _extract_get_pydantic_json_schema(obj) + if metadata_js_function is not None: + metadata_schema = resolve_original_schema(schema, self.defs) + if metadata_schema: + self._add_js_function(metadata_schema, metadata_js_function) + + schema = _add_custom_serialization_from_json_encoders(self._config_wrapper.json_encoders, obj, schema) + + return schema + + def _model_schema(self, cls: type[BaseModel]) -> core_schema.CoreSchema: + """Generate schema for a Pydantic model.""" + BaseModel_ = import_cached_base_model() + + with self.defs.get_schema_or_ref(cls) as (model_ref, maybe_schema): + if maybe_schema is not None: + return maybe_schema + + schema = cls.__dict__.get('__pydantic_core_schema__') + if schema is not None and not isinstance(schema, MockCoreSchema): + if schema['type'] == 'definitions': + schema = self.defs.unpack_definitions(schema) + ref = get_ref(schema) + if ref: + return self.defs.create_definition_reference_schema(schema) + else: + return schema + + config_wrapper = ConfigWrapper(cls.model_config, check=False) + + with self._config_wrapper_stack.push(config_wrapper), self._ns_resolver.push(cls): + core_config = self._config_wrapper.core_config(title=cls.__name__) + + if cls.__pydantic_fields_complete__ or cls is BaseModel_: + fields = getattr(cls, '__pydantic_fields__', {}) + else: + if not hasattr(cls, '__pydantic_fields__'): + # This happens when we have a loop in the schema generation: + # class Base[T](BaseModel): + # t: T + # + # class Other(BaseModel): + # b: 'Base[Other]' + # When we build fields for `Other`, we evaluate the forward annotation. + # At this point, `Other` doesn't have the model fields set. We create + # `Base[Other]`; model fields are successfully built, and we try to generate + # a schema for `t: Other`. As `Other.__pydantic_fields__` aren't set, we abort. + raise PydanticUndefinedAnnotation( + name=cls.__name__, + message=f'Class {cls.__name__!r} is not defined', + ) + try: + fields = rebuild_model_fields( + cls, + ns_resolver=self._ns_resolver, + typevars_map=self._typevars_map or {}, + ) + except NameError as e: + raise PydanticUndefinedAnnotation.from_name_error(e) from e + + decorators = cls.__pydantic_decorators__ + computed_fields = decorators.computed_fields + check_decorator_fields_exist( + chain( + decorators.field_validators.values(), + decorators.field_serializers.values(), + decorators.validators.values(), + ), + {*fields.keys(), *computed_fields.keys()}, + ) + + model_validators = decorators.model_validators.values() + + extras_schema = None + extras_keys_schema = None + if core_config.get('extra_fields_behavior') == 'allow': + assert cls.__mro__[0] is cls + assert cls.__mro__[-1] is object + for candidate_cls in cls.__mro__[:-1]: + extras_annotation = getattr(candidate_cls, '__annotations__', {}).get( + '__pydantic_extra__', None + ) + if extras_annotation is not None: + if isinstance(extras_annotation, str): + extras_annotation = _typing_extra.eval_type_backport( + _typing_extra._make_forward_ref( + extras_annotation, is_argument=False, is_class=True + ), + *self._types_namespace, + ) + tp = get_origin(extras_annotation) + if tp not in DICT_TYPES: + raise PydanticSchemaGenerationError( + 'The type annotation for `__pydantic_extra__` must be `dict[str, ...]`' + ) + extra_keys_type, extra_items_type = self._get_args_resolving_forward_refs( + extras_annotation, + required=True, + ) + if extra_keys_type is not str: + extras_keys_schema = self.generate_schema(extra_keys_type) + if not typing_objects.is_any(extra_items_type): + extras_schema = self.generate_schema(extra_items_type) + if extras_keys_schema is not None or extras_schema is not None: + break + + generic_origin: type[BaseModel] | None = getattr(cls, '__pydantic_generic_metadata__', {}).get('origin') + + if cls.__pydantic_root_model__: + root_field = self._common_field_schema('root', fields['root'], decorators) + inner_schema = root_field['schema'] + inner_schema = apply_model_validators(inner_schema, model_validators, 'inner') + model_schema = core_schema.model_schema( + cls, + inner_schema, + generic_origin=generic_origin, + custom_init=getattr(cls, '__pydantic_custom_init__', None), + root_model=True, + post_init=getattr(cls, '__pydantic_post_init__', None), + config=core_config, + ref=model_ref, + ) + else: + fields_schema: core_schema.CoreSchema = core_schema.model_fields_schema( + {k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()}, + computed_fields=[ + self._computed_field_schema(d, decorators.field_serializers) + for d in computed_fields.values() + ], + extras_schema=extras_schema, + extras_keys_schema=extras_keys_schema, + model_name=cls.__name__, + ) + inner_schema = apply_validators(fields_schema, decorators.root_validators.values(), None) + inner_schema = apply_model_validators(inner_schema, model_validators, 'inner') + + model_schema = core_schema.model_schema( + cls, + inner_schema, + generic_origin=generic_origin, + custom_init=getattr(cls, '__pydantic_custom_init__', None), + root_model=False, + post_init=getattr(cls, '__pydantic_post_init__', None), + config=core_config, + ref=model_ref, + ) + + schema = self._apply_model_serializers(model_schema, decorators.model_serializers.values()) + schema = apply_model_validators(schema, model_validators, 'outer') + return self.defs.create_definition_reference_schema(schema) + + def _resolve_self_type(self, obj: Any) -> Any: + obj = self.model_type_stack.get() + if obj is None: + raise PydanticUserError('`typing.Self` is invalid in this context', code='invalid-self-type') + return obj + + def _generate_schema_from_get_schema_method(self, obj: Any, source: Any) -> core_schema.CoreSchema | None: + BaseModel_ = import_cached_base_model() + + get_schema = getattr(obj, '__get_pydantic_core_schema__', None) + is_base_model_get_schema = ( + getattr(get_schema, '__func__', None) is BaseModel_.__get_pydantic_core_schema__.__func__ # pyright: ignore[reportFunctionMemberAccess] + ) + + if ( + get_schema is not None + # BaseModel.__get_pydantic_core_schema__ is defined for backwards compatibility, + # to allow existing code to call `super().__get_pydantic_core_schema__` in Pydantic + # model that overrides `__get_pydantic_core_schema__`. However, it raises a deprecation + # warning stating that the method will be removed, and during the core schema gen we actually + # don't call the method: + and not is_base_model_get_schema + ): + # Some referenceable types might have a `__get_pydantic_core_schema__` method + # defined on it by users (e.g. on a dataclass). This generally doesn't play well + # as these types are already recognized by the `GenerateSchema` class and isn't ideal + # as we might end up calling `get_schema_or_ref` (expensive) on types that are actually + # not referenceable: + with self.defs.get_schema_or_ref(obj) as (_, maybe_schema): + if maybe_schema is not None: + return maybe_schema + + if obj is source: + ref_mode = 'unpack' + else: + ref_mode = 'to-def' + schema = get_schema( + source, CallbackGetCoreSchemaHandler(self._generate_schema_inner, self, ref_mode=ref_mode) + ) + if schema['type'] == 'definitions': + schema = self.defs.unpack_definitions(schema) + + ref = get_ref(schema) + if ref: + return self.defs.create_definition_reference_schema(schema) + + # Note: if schema is of type `'definition-ref'`, we might want to copy it as a + # safety measure (because these are inlined in place -- i.e. mutated directly) + return schema + + if get_schema is None and (validators := getattr(obj, '__get_validators__', None)) is not None: + from pydantic.v1 import BaseModel as BaseModelV1 + + if issubclass(obj, BaseModelV1): + warn( + f'Mixing V1 models and V2 models (or constructs, like `TypeAdapter`) is not supported. Please upgrade `{obj.__name__}` to V2.', + UserWarning, + ) + else: + warn( + '`__get_validators__` is deprecated and will be removed, use `__get_pydantic_core_schema__` instead.', + PydanticDeprecatedSince20, + ) + return core_schema.chain_schema([core_schema.with_info_plain_validator_function(v) for v in validators()]) + + def _resolve_forward_ref(self, obj: Any) -> Any: + # we assume that types_namespace has the target of forward references in its scope, + # but this could fail, for example, if calling Validator on an imported type which contains + # forward references to other types only defined in the module from which it was imported + # `Validator(SomeImportedTypeAliasWithAForwardReference)` + # or the equivalent for BaseModel + # class Model(BaseModel): + # x: SomeImportedTypeAliasWithAForwardReference + try: + obj = _typing_extra.eval_type_backport(obj, *self._types_namespace) + except NameError as e: + raise PydanticUndefinedAnnotation.from_name_error(e) from e + + # if obj is still a ForwardRef, it means we can't evaluate it, raise PydanticUndefinedAnnotation + if isinstance(obj, ForwardRef): + raise PydanticUndefinedAnnotation(obj.__forward_arg__, f'Unable to evaluate forward reference {obj}') + + if self._typevars_map: + obj = replace_types(obj, self._typevars_map) + + return obj + + @overload + def _get_args_resolving_forward_refs(self, obj: Any, required: Literal[True]) -> tuple[Any, ...]: ... + + @overload + def _get_args_resolving_forward_refs(self, obj: Any) -> tuple[Any, ...] | None: ... + + def _get_args_resolving_forward_refs(self, obj: Any, required: bool = False) -> tuple[Any, ...] | None: + args = get_args(obj) + if args: + if isinstance(obj, GenericAlias): + # PEP 585 generic aliases don't convert args to ForwardRefs, unlike `typing.List/Dict` etc. + args = (_typing_extra._make_forward_ref(a) if isinstance(a, str) else a for a in args) + args = tuple(self._resolve_forward_ref(a) if isinstance(a, ForwardRef) else a for a in args) + elif required: # pragma: no cover + raise TypeError(f'Expected {obj} to have generic parameters but it had none') + return args + + def _get_first_arg_or_any(self, obj: Any) -> Any: + args = self._get_args_resolving_forward_refs(obj) + if not args: + return Any + return args[0] + + def _get_first_two_args_or_any(self, obj: Any) -> tuple[Any, Any]: + args = self._get_args_resolving_forward_refs(obj) + if not args: + return (Any, Any) + if len(args) < 2: + origin = get_origin(obj) + raise TypeError(f'Expected two type arguments for {origin}, got 1') + return args[0], args[1] + + def _generate_schema_inner(self, obj: Any) -> core_schema.CoreSchema: + if typing_objects.is_self(obj): + obj = self._resolve_self_type(obj) + + if typing_objects.is_annotated(get_origin(obj)): + return self._annotated_schema(obj) + + if isinstance(obj, dict): + # we assume this is already a valid schema + return obj # type: ignore[return-value] + + if isinstance(obj, str): + obj = ForwardRef(obj) + + if isinstance(obj, ForwardRef): + return self.generate_schema(self._resolve_forward_ref(obj)) + + BaseModel = import_cached_base_model() + + if lenient_issubclass(obj, BaseModel): + with self.model_type_stack.push(obj): + return self._model_schema(obj) + + if isinstance(obj, PydanticRecursiveRef): + return core_schema.definition_reference_schema(schema_ref=obj.type_ref) + + return self.match_type(obj) + + def match_type(self, obj: Any) -> core_schema.CoreSchema: # noqa: C901 + """Main mapping of types to schemas. + + The general structure is a series of if statements starting with the simple cases + (non-generic primitive types) and then handling generics and other more complex cases. + + Each case either generates a schema directly, calls into a public user-overridable method + (like `GenerateSchema.tuple_variable_schema`) or calls into a private method that handles some + boilerplate before calling into the user-facing method (e.g. `GenerateSchema._tuple_schema`). + + The idea is that we'll evolve this into adding more and more user facing methods over time + as they get requested and we figure out what the right API for them is. + """ + if obj is str: + return core_schema.str_schema() + elif obj is bytes: + return core_schema.bytes_schema() + elif obj is int: + return core_schema.int_schema() + elif obj is float: + return core_schema.float_schema() + elif obj is bool: + return core_schema.bool_schema() + elif obj is complex: + return core_schema.complex_schema() + elif typing_objects.is_any(obj) or obj is object: + return core_schema.any_schema() + elif obj is datetime.date: + return core_schema.date_schema() + elif obj is datetime.datetime: + return core_schema.datetime_schema() + elif obj is datetime.time: + return core_schema.time_schema() + elif obj is datetime.timedelta: + return core_schema.timedelta_schema() + elif obj is Decimal: + return core_schema.decimal_schema() + elif obj is UUID: + return core_schema.uuid_schema() + elif obj is Url: + return core_schema.url_schema() + elif obj is Fraction: + return self._fraction_schema() + elif obj is MultiHostUrl: + return core_schema.multi_host_url_schema() + elif obj is None or obj is _typing_extra.NoneType: + return core_schema.none_schema() + elif obj in IP_TYPES: + return self._ip_schema(obj) + elif obj in TUPLE_TYPES: + return self._tuple_schema(obj) + elif obj in LIST_TYPES: + return self._list_schema(Any) + elif obj in SET_TYPES: + return self._set_schema(Any) + elif obj in FROZEN_SET_TYPES: + return self._frozenset_schema(Any) + elif obj in SEQUENCE_TYPES: + return self._sequence_schema(Any) + elif obj in ITERABLE_TYPES: + return self._iterable_schema(obj) + elif obj in DICT_TYPES: + return self._dict_schema(Any, Any) + elif obj in PATH_TYPES: + return self._path_schema(obj, Any) + elif obj in DEQUE_TYPES: + return self._deque_schema(Any) + elif obj in MAPPING_TYPES: + return self._mapping_schema(obj, Any, Any) + elif obj in COUNTER_TYPES: + return self._mapping_schema(obj, Any, int) + elif typing_objects.is_typealiastype(obj): + return self._type_alias_type_schema(obj) + elif obj is type: + return self._type_schema() + elif _typing_extra.is_callable(obj): + return core_schema.callable_schema() + elif typing_objects.is_literal(get_origin(obj)): + return self._literal_schema(obj) + elif is_typeddict(obj): + return self._typed_dict_schema(obj, None) + elif _typing_extra.is_namedtuple(obj): + return self._namedtuple_schema(obj, None) + elif typing_objects.is_newtype(obj): + # NewType, can't use isinstance because it fails <3.10 + return self.generate_schema(obj.__supertype__) + elif obj in PATTERN_TYPES: + return self._pattern_schema(obj) + elif _typing_extra.is_hashable(obj): + return self._hashable_schema() + elif isinstance(obj, typing.TypeVar): + return self._unsubstituted_typevar_schema(obj) + elif _typing_extra.is_finalvar(obj): + if obj is Final: + return core_schema.any_schema() + return self.generate_schema( + self._get_first_arg_or_any(obj), + ) + elif isinstance(obj, VALIDATE_CALL_SUPPORTED_TYPES): + return self._call_schema(obj) + elif inspect.isclass(obj) and issubclass(obj, Enum): + return self._enum_schema(obj) + elif obj is ZoneInfo: + return self._zoneinfo_schema() + + # dataclasses.is_dataclass coerces dc instances to types, but we only handle + # the case of a dc type here + if dataclasses.is_dataclass(obj): + return self._dataclass_schema(obj, None) # pyright: ignore[reportArgumentType] + + origin = get_origin(obj) + if origin is not None: + return self._match_generic_type(obj, origin) + + if self._arbitrary_types: + return self._arbitrary_type_schema(obj) + return self._unknown_type_schema(obj) + + def _match_generic_type(self, obj: Any, origin: Any) -> CoreSchema: # noqa: C901 + # Need to handle generic dataclasses before looking for the schema properties because attribute accesses + # on _GenericAlias delegate to the origin type, so lose the information about the concrete parametrization + # As a result, currently, there is no way to cache the schema for generic dataclasses. This may be possible + # to resolve by modifying the value returned by `Generic.__class_getitem__`, but that is a dangerous game. + if dataclasses.is_dataclass(origin): + return self._dataclass_schema(obj, origin) # pyright: ignore[reportArgumentType] + if _typing_extra.is_namedtuple(origin): + return self._namedtuple_schema(obj, origin) + + schema = self._generate_schema_from_get_schema_method(origin, obj) + if schema is not None: + return schema + + if typing_objects.is_typealiastype(origin): + return self._type_alias_type_schema(obj) + elif is_union_origin(origin): + return self._union_schema(obj) + elif origin in TUPLE_TYPES: + return self._tuple_schema(obj) + elif origin in LIST_TYPES: + return self._list_schema(self._get_first_arg_or_any(obj)) + elif origin in SET_TYPES: + return self._set_schema(self._get_first_arg_or_any(obj)) + elif origin in FROZEN_SET_TYPES: + return self._frozenset_schema(self._get_first_arg_or_any(obj)) + elif origin in DICT_TYPES: + return self._dict_schema(*self._get_first_two_args_or_any(obj)) + elif origin in PATH_TYPES: + return self._path_schema(origin, self._get_first_arg_or_any(obj)) + elif origin in DEQUE_TYPES: + return self._deque_schema(self._get_first_arg_or_any(obj)) + elif origin in MAPPING_TYPES: + return self._mapping_schema(origin, *self._get_first_two_args_or_any(obj)) + elif origin in COUNTER_TYPES: + return self._mapping_schema(origin, self._get_first_arg_or_any(obj), int) + elif is_typeddict(origin): + return self._typed_dict_schema(obj, origin) + elif origin in TYPE_TYPES: + return self._subclass_schema(obj) + elif origin in SEQUENCE_TYPES: + return self._sequence_schema(self._get_first_arg_or_any(obj)) + elif origin in ITERABLE_TYPES: + return self._iterable_schema(obj) + elif origin in PATTERN_TYPES: + return self._pattern_schema(obj) + + if self._arbitrary_types: + return self._arbitrary_type_schema(origin) + return self._unknown_type_schema(obj) + + def _generate_td_field_schema( + self, + name: str, + field_info: FieldInfo, + decorators: DecoratorInfos, + *, + required: bool = True, + ) -> core_schema.TypedDictField: + """Prepare a TypedDictField to represent a model or typeddict field.""" + common_field = self._common_field_schema(name, field_info, decorators) + return core_schema.typed_dict_field( + common_field['schema'], + required=False if not field_info.is_required() else required, + serialization_exclude=common_field['serialization_exclude'], + validation_alias=common_field['validation_alias'], + serialization_alias=common_field['serialization_alias'], + metadata=common_field['metadata'], + ) + + def _generate_md_field_schema( + self, + name: str, + field_info: FieldInfo, + decorators: DecoratorInfos, + ) -> core_schema.ModelField: + """Prepare a ModelField to represent a model field.""" + common_field = self._common_field_schema(name, field_info, decorators) + return core_schema.model_field( + common_field['schema'], + serialization_exclude=common_field['serialization_exclude'], + validation_alias=common_field['validation_alias'], + serialization_alias=common_field['serialization_alias'], + frozen=common_field['frozen'], + metadata=common_field['metadata'], + ) + + def _generate_dc_field_schema( + self, + name: str, + field_info: FieldInfo, + decorators: DecoratorInfos, + ) -> core_schema.DataclassField: + """Prepare a DataclassField to represent the parameter/field, of a dataclass.""" + common_field = self._common_field_schema(name, field_info, decorators) + return core_schema.dataclass_field( + name, + common_field['schema'], + init=field_info.init, + init_only=field_info.init_var or None, + kw_only=None if field_info.kw_only else False, + serialization_exclude=common_field['serialization_exclude'], + validation_alias=common_field['validation_alias'], + serialization_alias=common_field['serialization_alias'], + frozen=common_field['frozen'], + metadata=common_field['metadata'], + ) + + @staticmethod + def _apply_alias_generator_to_field_info( + alias_generator: Callable[[str], str] | AliasGenerator, field_info: FieldInfo, field_name: str + ) -> None: + """Apply an alias_generator to aliases on a FieldInfo instance if appropriate. + + Args: + alias_generator: A callable that takes a string and returns a string, or an AliasGenerator instance. + field_info: The FieldInfo instance to which the alias_generator is (maybe) applied. + field_name: The name of the field from which to generate the alias. + """ + # Apply an alias_generator if + # 1. An alias is not specified + # 2. An alias is specified, but the priority is <= 1 + if ( + field_info.alias_priority is None + or field_info.alias_priority <= 1 + or field_info.alias is None + or field_info.validation_alias is None + or field_info.serialization_alias is None + ): + alias, validation_alias, serialization_alias = None, None, None + + if isinstance(alias_generator, AliasGenerator): + alias, validation_alias, serialization_alias = alias_generator.generate_aliases(field_name) + elif isinstance(alias_generator, Callable): + alias = alias_generator(field_name) + if not isinstance(alias, str): + raise TypeError(f'alias_generator {alias_generator} must return str, not {alias.__class__}') + + # if priority is not set, we set to 1 + # which supports the case where the alias_generator from a child class is used + # to generate an alias for a field in a parent class + if field_info.alias_priority is None or field_info.alias_priority <= 1: + field_info.alias_priority = 1 + + # if the priority is 1, then we set the aliases to the generated alias + if field_info.alias_priority == 1: + field_info.serialization_alias = _get_first_non_null(serialization_alias, alias) + field_info.validation_alias = _get_first_non_null(validation_alias, alias) + field_info.alias = alias + + # if any of the aliases are not set, then we set them to the corresponding generated alias + if field_info.alias is None: + field_info.alias = alias + if field_info.serialization_alias is None: + field_info.serialization_alias = _get_first_non_null(serialization_alias, alias) + if field_info.validation_alias is None: + field_info.validation_alias = _get_first_non_null(validation_alias, alias) + + @staticmethod + def _apply_alias_generator_to_computed_field_info( + alias_generator: Callable[[str], str] | AliasGenerator, + computed_field_info: ComputedFieldInfo, + computed_field_name: str, + ): + """Apply an alias_generator to alias on a ComputedFieldInfo instance if appropriate. + + Args: + alias_generator: A callable that takes a string and returns a string, or an AliasGenerator instance. + computed_field_info: The ComputedFieldInfo instance to which the alias_generator is (maybe) applied. + computed_field_name: The name of the computed field from which to generate the alias. + """ + # Apply an alias_generator if + # 1. An alias is not specified + # 2. An alias is specified, but the priority is <= 1 + + if ( + computed_field_info.alias_priority is None + or computed_field_info.alias_priority <= 1 + or computed_field_info.alias is None + ): + alias, validation_alias, serialization_alias = None, None, None + + if isinstance(alias_generator, AliasGenerator): + alias, validation_alias, serialization_alias = alias_generator.generate_aliases(computed_field_name) + elif isinstance(alias_generator, Callable): + alias = alias_generator(computed_field_name) + if not isinstance(alias, str): + raise TypeError(f'alias_generator {alias_generator} must return str, not {alias.__class__}') + + # if priority is not set, we set to 1 + # which supports the case where the alias_generator from a child class is used + # to generate an alias for a field in a parent class + if computed_field_info.alias_priority is None or computed_field_info.alias_priority <= 1: + computed_field_info.alias_priority = 1 + + # if the priority is 1, then we set the aliases to the generated alias + # note that we use the serialization_alias with priority over alias, as computed_field + # aliases are used for serialization only (not validation) + if computed_field_info.alias_priority == 1: + computed_field_info.alias = _get_first_non_null(serialization_alias, alias) + + @staticmethod + def _apply_field_title_generator_to_field_info( + config_wrapper: ConfigWrapper, field_info: FieldInfo | ComputedFieldInfo, field_name: str + ) -> None: + """Apply a field_title_generator on a FieldInfo or ComputedFieldInfo instance if appropriate + Args: + config_wrapper: The config of the model + field_info: The FieldInfo or ComputedField instance to which the title_generator is (maybe) applied. + field_name: The name of the field from which to generate the title. + """ + field_title_generator = field_info.field_title_generator or config_wrapper.field_title_generator + + if field_title_generator is None: + return + + if field_info.title is None: + title = field_title_generator(field_name, field_info) # type: ignore + if not isinstance(title, str): + raise TypeError(f'field_title_generator {field_title_generator} must return str, not {title.__class__}') + + field_info.title = title + + def _common_field_schema( # C901 + self, name: str, field_info: FieldInfo, decorators: DecoratorInfos + ) -> _CommonField: + source_type, annotations = field_info.annotation, field_info.metadata + + def set_discriminator(schema: CoreSchema) -> CoreSchema: + schema = self._apply_discriminator_to_union(schema, field_info.discriminator) + return schema + + # Convert `@field_validator` decorators to `Before/After/Plain/WrapValidator` instances: + validators_from_decorators = [] + for decorator in filter_field_decorator_info_by_field(decorators.field_validators.values(), name): + validators_from_decorators.append(_mode_to_validator[decorator.info.mode]._from_decorator(decorator)) + + with self.field_name_stack.push(name): + if field_info.discriminator is not None: + schema = self._apply_annotations( + source_type, annotations + validators_from_decorators, transform_inner_schema=set_discriminator + ) + else: + schema = self._apply_annotations( + source_type, + annotations + validators_from_decorators, + ) + + # This V1 compatibility shim should eventually be removed + # push down any `each_item=True` validators + # note that this won't work for any Annotated types that get wrapped by a function validator + # but that's okay because that didn't exist in V1 + this_field_validators = filter_field_decorator_info_by_field(decorators.validators.values(), name) + if _validators_require_validate_default(this_field_validators): + field_info.validate_default = True + each_item_validators = [v for v in this_field_validators if v.info.each_item is True] + this_field_validators = [v for v in this_field_validators if v not in each_item_validators] + schema = apply_each_item_validators(schema, each_item_validators, name) + + schema = apply_validators(schema, this_field_validators, name) + + # the default validator needs to go outside of any other validators + # so that it is the topmost validator for the field validator + # which uses it to check if the field has a default value or not + if not field_info.is_required(): + schema = wrap_default(field_info, schema) + + schema = self._apply_field_serializers( + schema, filter_field_decorator_info_by_field(decorators.field_serializers.values(), name) + ) + self._apply_field_title_generator_to_field_info(self._config_wrapper, field_info, name) + + pydantic_js_updates, pydantic_js_extra = _extract_json_schema_info_from_field_info(field_info) + core_metadata: dict[str, Any] = {} + update_core_metadata( + core_metadata, pydantic_js_updates=pydantic_js_updates, pydantic_js_extra=pydantic_js_extra + ) + + alias_generator = self._config_wrapper.alias_generator + if alias_generator is not None: + self._apply_alias_generator_to_field_info(alias_generator, field_info, name) + + if isinstance(field_info.validation_alias, (AliasChoices, AliasPath)): + validation_alias = field_info.validation_alias.convert_to_aliases() + else: + validation_alias = field_info.validation_alias + + return _common_field( + schema, + serialization_exclude=True if field_info.exclude else None, + validation_alias=validation_alias, + serialization_alias=field_info.serialization_alias, + frozen=field_info.frozen, + metadata=core_metadata, + ) + + def _union_schema(self, union_type: Any) -> core_schema.CoreSchema: + """Generate schema for a Union.""" + args = self._get_args_resolving_forward_refs(union_type, required=True) + choices: list[CoreSchema] = [] + nullable = False + for arg in args: + if arg is None or arg is _typing_extra.NoneType: + nullable = True + else: + choices.append(self.generate_schema(arg)) + + if len(choices) == 1: + s = choices[0] + else: + choices_with_tags: list[CoreSchema | tuple[CoreSchema, str]] = [] + for choice in choices: + tag = cast(CoreMetadata, choice.get('metadata', {})).get('pydantic_internal_union_tag_key') + if tag is not None: + choices_with_tags.append((choice, tag)) + else: + choices_with_tags.append(choice) + s = core_schema.union_schema(choices_with_tags) + + if nullable: + s = core_schema.nullable_schema(s) + return s + + def _type_alias_type_schema(self, obj: TypeAliasType) -> CoreSchema: + with self.defs.get_schema_or_ref(obj) as (ref, maybe_schema): + if maybe_schema is not None: + return maybe_schema + + origin: TypeAliasType = get_origin(obj) or obj + typevars_map = get_standard_typevars_map(obj) + + with self._ns_resolver.push(origin): + try: + annotation = _typing_extra.eval_type(origin.__value__, *self._types_namespace) + except NameError as e: + raise PydanticUndefinedAnnotation.from_name_error(e) from e + annotation = replace_types(annotation, typevars_map) + schema = self.generate_schema(annotation) + assert schema['type'] != 'definitions' + schema['ref'] = ref # type: ignore + return self.defs.create_definition_reference_schema(schema) + + def _literal_schema(self, literal_type: Any) -> CoreSchema: + """Generate schema for a Literal.""" + expected = list(get_literal_values(literal_type, type_check=False, unpack_type_aliases='eager')) + assert expected, f'literal "expected" cannot be empty, obj={literal_type}' + schema = core_schema.literal_schema(expected) + + if self._config_wrapper.use_enum_values and any(isinstance(v, Enum) for v in expected): + schema = core_schema.no_info_after_validator_function( + lambda v: v.value if isinstance(v, Enum) else v, schema + ) + + return schema + + def _typed_dict_schema(self, typed_dict_cls: Any, origin: Any) -> core_schema.CoreSchema: + """Generate a core schema for a `TypedDict` class. + + To be able to build a `DecoratorInfos` instance for the `TypedDict` class (which will include + validators, serializers, etc.), we need to have access to the original bases of the class + (see https://docs.python.org/3/library/types.html#types.get_original_bases). + However, the `__orig_bases__` attribute was only added in 3.12 (https://github.com/python/cpython/pull/103698). + + For this reason, we require Python 3.12 (or using the `typing_extensions` backport). + """ + FieldInfo = import_cached_field_info() + + with ( + self.model_type_stack.push(typed_dict_cls), + self.defs.get_schema_or_ref(typed_dict_cls) as ( + typed_dict_ref, + maybe_schema, + ), + ): + if maybe_schema is not None: + return maybe_schema + + typevars_map = get_standard_typevars_map(typed_dict_cls) + if origin is not None: + typed_dict_cls = origin + + if not _SUPPORTS_TYPEDDICT and type(typed_dict_cls).__module__ == 'typing': + raise PydanticUserError( + 'Please use `typing_extensions.TypedDict` instead of `typing.TypedDict` on Python < 3.12.', + code='typed-dict-version', + ) + + try: + # if a typed dictionary class doesn't have config, we use the parent's config, hence a default of `None` + # see https://github.com/pydantic/pydantic/issues/10917 + config: ConfigDict | None = get_attribute_from_bases(typed_dict_cls, '__pydantic_config__') + except AttributeError: + config = None + + with self._config_wrapper_stack.push(config): + core_config = self._config_wrapper.core_config(title=typed_dict_cls.__name__) + + required_keys: frozenset[str] = typed_dict_cls.__required_keys__ + + fields: dict[str, core_schema.TypedDictField] = {} + + decorators = DecoratorInfos.build(typed_dict_cls) + + if self._config_wrapper.use_attribute_docstrings: + field_docstrings = extract_docstrings_from_cls(typed_dict_cls, use_inspect=True) + else: + field_docstrings = None + + try: + annotations = _typing_extra.get_cls_type_hints(typed_dict_cls, ns_resolver=self._ns_resolver) + except NameError as e: + raise PydanticUndefinedAnnotation.from_name_error(e) from e + + readonly_fields: list[str] = [] + + for field_name, annotation in annotations.items(): + field_info = FieldInfo.from_annotation(annotation, _source=AnnotationSource.TYPED_DICT) + field_info.annotation = replace_types(field_info.annotation, typevars_map) + + required = ( + field_name in required_keys or 'required' in field_info._qualifiers + ) and 'not_required' not in field_info._qualifiers + if 'read_only' in field_info._qualifiers: + readonly_fields.append(field_name) + + if ( + field_docstrings is not None + and field_info.description is None + and field_name in field_docstrings + ): + field_info.description = field_docstrings[field_name] + self._apply_field_title_generator_to_field_info(self._config_wrapper, field_info, field_name) + fields[field_name] = self._generate_td_field_schema( + field_name, field_info, decorators, required=required + ) + + if readonly_fields: + fields_repr = ', '.join(repr(f) for f in readonly_fields) + plural = len(readonly_fields) >= 2 + warnings.warn( + f'Item{"s" if plural else ""} {fields_repr} on TypedDict class {typed_dict_cls.__name__!r} ' + f'{"are" if plural else "is"} using the `ReadOnly` qualifier. Pydantic will not protect items ' + 'from any mutation on dictionary instances.', + UserWarning, + ) + + td_schema = core_schema.typed_dict_schema( + fields, + cls=typed_dict_cls, + computed_fields=[ + self._computed_field_schema(d, decorators.field_serializers) + for d in decorators.computed_fields.values() + ], + ref=typed_dict_ref, + config=core_config, + ) + + schema = self._apply_model_serializers(td_schema, decorators.model_serializers.values()) + schema = apply_model_validators(schema, decorators.model_validators.values(), 'all') + return self.defs.create_definition_reference_schema(schema) + + def _namedtuple_schema(self, namedtuple_cls: Any, origin: Any) -> core_schema.CoreSchema: + """Generate schema for a NamedTuple.""" + with ( + self.model_type_stack.push(namedtuple_cls), + self.defs.get_schema_or_ref(namedtuple_cls) as ( + namedtuple_ref, + maybe_schema, + ), + ): + if maybe_schema is not None: + return maybe_schema + typevars_map = get_standard_typevars_map(namedtuple_cls) + if origin is not None: + namedtuple_cls = origin + + try: + annotations = _typing_extra.get_cls_type_hints(namedtuple_cls, ns_resolver=self._ns_resolver) + except NameError as e: + raise PydanticUndefinedAnnotation.from_name_error(e) from e + if not annotations: + # annotations is empty, happens if namedtuple_cls defined via collections.namedtuple(...) + annotations: dict[str, Any] = {k: Any for k in namedtuple_cls._fields} + + if typevars_map: + annotations = { + field_name: replace_types(annotation, typevars_map) + for field_name, annotation in annotations.items() + } + + arguments_schema = core_schema.arguments_schema( + [ + self._generate_parameter_schema( + field_name, + annotation, + source=AnnotationSource.NAMED_TUPLE, + default=namedtuple_cls._field_defaults.get(field_name, Parameter.empty), + ) + for field_name, annotation in annotations.items() + ], + metadata={'pydantic_js_prefer_positional_arguments': True}, + ) + schema = core_schema.call_schema(arguments_schema, namedtuple_cls, ref=namedtuple_ref) + return self.defs.create_definition_reference_schema(schema) + + def _generate_parameter_schema( + self, + name: str, + annotation: type[Any], + source: AnnotationSource, + default: Any = Parameter.empty, + mode: Literal['positional_only', 'positional_or_keyword', 'keyword_only'] | None = None, + ) -> core_schema.ArgumentsParameter: + """Generate the definition of a field in a namedtuple or a parameter in a function signature. + + This definition is meant to be used for the `'arguments'` core schema, which will be replaced + in V3 by the `'arguments-v3`'. + """ + FieldInfo = import_cached_field_info() + + if default is Parameter.empty: + field = FieldInfo.from_annotation(annotation, _source=source) + else: + field = FieldInfo.from_annotated_attribute(annotation, default, _source=source) + assert field.annotation is not None, 'field.annotation should not be None when generating a schema' + with self.field_name_stack.push(name): + schema = self._apply_annotations(field.annotation, [field]) + + if not field.is_required(): + schema = wrap_default(field, schema) + + parameter_schema = core_schema.arguments_parameter(name, schema) + if mode is not None: + parameter_schema['mode'] = mode + if field.alias is not None: + parameter_schema['alias'] = field.alias + else: + alias_generator = self._config_wrapper.alias_generator + if isinstance(alias_generator, AliasGenerator) and alias_generator.alias is not None: + parameter_schema['alias'] = alias_generator.alias(name) + elif callable(alias_generator): + parameter_schema['alias'] = alias_generator(name) + return parameter_schema + + def _generate_parameter_v3_schema( + self, + name: str, + annotation: Any, + source: AnnotationSource, + mode: Literal[ + 'positional_only', + 'positional_or_keyword', + 'keyword_only', + 'var_args', + 'var_kwargs_uniform', + 'var_kwargs_unpacked_typed_dict', + ], + default: Any = Parameter.empty, + ) -> core_schema.ArgumentsV3Parameter: + """Generate the definition of a parameter in a function signature. + + This definition is meant to be used for the `'arguments-v3'` core schema, which will replace + the `'arguments`' schema in V3. + """ + FieldInfo = import_cached_field_info() + + if default is Parameter.empty: + field = FieldInfo.from_annotation(annotation, _source=source) + else: + field = FieldInfo.from_annotated_attribute(annotation, default, _source=source) + + with self.field_name_stack.push(name): + schema = self._apply_annotations(field.annotation, [field]) + + if not field.is_required(): + schema = wrap_default(field, schema) + + parameter_schema = core_schema.arguments_v3_parameter( + name=name, + schema=schema, + mode=mode, + ) + if field.alias is not None: + parameter_schema['alias'] = field.alias + else: + alias_generator = self._config_wrapper.alias_generator + if isinstance(alias_generator, AliasGenerator) and alias_generator.alias is not None: + parameter_schema['alias'] = alias_generator.alias(name) + elif callable(alias_generator): + parameter_schema['alias'] = alias_generator(name) + + return parameter_schema + + def _tuple_schema(self, tuple_type: Any) -> core_schema.CoreSchema: + """Generate schema for a Tuple, e.g. `tuple[int, str]` or `tuple[int, ...]`.""" + # TODO: do we really need to resolve type vars here? + typevars_map = get_standard_typevars_map(tuple_type) + params = self._get_args_resolving_forward_refs(tuple_type) + + if typevars_map and params: + params = tuple(replace_types(param, typevars_map) for param in params) + + # NOTE: subtle difference: `tuple[()]` gives `params=()`, whereas `typing.Tuple[()]` gives `params=((),)` + # This is only true for <3.11, on Python 3.11+ `typing.Tuple[()]` gives `params=()` + if not params: + if tuple_type in TUPLE_TYPES: + return core_schema.tuple_schema([core_schema.any_schema()], variadic_item_index=0) + else: + # special case for `tuple[()]` which means `tuple[]` - an empty tuple + return core_schema.tuple_schema([]) + elif params[-1] is Ellipsis: + if len(params) == 2: + return core_schema.tuple_schema([self.generate_schema(params[0])], variadic_item_index=0) + else: + # TODO: something like https://github.com/pydantic/pydantic/issues/5952 + raise ValueError('Variable tuples can only have one type') + elif len(params) == 1 and params[0] == (): + # special case for `tuple[()]` which means `tuple[]` - an empty tuple + # NOTE: This conditional can be removed when we drop support for Python 3.10. + return core_schema.tuple_schema([]) + else: + return core_schema.tuple_schema([self.generate_schema(param) for param in params]) + + def _type_schema(self) -> core_schema.CoreSchema: + return core_schema.custom_error_schema( + core_schema.is_instance_schema(type), + custom_error_type='is_type', + custom_error_message='Input should be a type', + ) + + def _zoneinfo_schema(self) -> core_schema.CoreSchema: + """Generate schema for a zone_info.ZoneInfo object""" + from ._validators import validate_str_is_valid_iana_tz + + metadata = {'pydantic_js_functions': [lambda _1, _2: {'type': 'string', 'format': 'zoneinfo'}]} + return core_schema.no_info_plain_validator_function( + validate_str_is_valid_iana_tz, + serialization=core_schema.to_string_ser_schema(), + metadata=metadata, + ) + + def _union_is_subclass_schema(self, union_type: Any) -> core_schema.CoreSchema: + """Generate schema for `type[Union[X, ...]]`.""" + args = self._get_args_resolving_forward_refs(union_type, required=True) + return core_schema.union_schema([self.generate_schema(type[args]) for args in args]) + + def _subclass_schema(self, type_: Any) -> core_schema.CoreSchema: + """Generate schema for a type, e.g. `type[int]`.""" + type_param = self._get_first_arg_or_any(type_) + + # Assume `type[Annotated[, ...]]` is equivalent to `type[]`: + type_param = _typing_extra.annotated_type(type_param) or type_param + + if typing_objects.is_any(type_param): + return self._type_schema() + elif typing_objects.is_typealiastype(type_param): + return self.generate_schema(type[type_param.__value__]) + elif typing_objects.is_typevar(type_param): + if type_param.__bound__: + if is_union_origin(get_origin(type_param.__bound__)): + return self._union_is_subclass_schema(type_param.__bound__) + return core_schema.is_subclass_schema(type_param.__bound__) + elif type_param.__constraints__: + return core_schema.union_schema([self.generate_schema(type[c]) for c in type_param.__constraints__]) + else: + return self._type_schema() + elif is_union_origin(get_origin(type_param)): + return self._union_is_subclass_schema(type_param) + else: + if typing_objects.is_self(type_param): + type_param = self._resolve_self_type(type_param) + if _typing_extra.is_generic_alias(type_param): + raise PydanticUserError( + 'Subscripting `type[]` with an already parametrized type is not supported. ' + f'Instead of using type[{type_param!r}], use type[{_repr.display_as_type(get_origin(type_param))}].', + code=None, + ) + if not inspect.isclass(type_param): + # when using type[None], this doesn't type convert to type[NoneType], and None isn't a class + # so we handle it manually here + if type_param is None: + return core_schema.is_subclass_schema(_typing_extra.NoneType) + raise TypeError(f'Expected a class, got {type_param!r}') + return core_schema.is_subclass_schema(type_param) + + def _sequence_schema(self, items_type: Any) -> core_schema.CoreSchema: + """Generate schema for a Sequence, e.g. `Sequence[int]`.""" + from ._serializers import serialize_sequence_via_list + + item_type_schema = self.generate_schema(items_type) + list_schema = core_schema.list_schema(item_type_schema) + + json_schema = smart_deepcopy(list_schema) + python_schema = core_schema.is_instance_schema(typing.Sequence, cls_repr='Sequence') + if not typing_objects.is_any(items_type): + from ._validators import sequence_validator + + python_schema = core_schema.chain_schema( + [python_schema, core_schema.no_info_wrap_validator_function(sequence_validator, list_schema)], + ) + + serialization = core_schema.wrap_serializer_function_ser_schema( + serialize_sequence_via_list, schema=item_type_schema, info_arg=True + ) + return core_schema.json_or_python_schema( + json_schema=json_schema, python_schema=python_schema, serialization=serialization + ) + + def _iterable_schema(self, type_: Any) -> core_schema.GeneratorSchema: + """Generate a schema for an `Iterable`.""" + item_type = self._get_first_arg_or_any(type_) + + return core_schema.generator_schema(self.generate_schema(item_type)) + + def _pattern_schema(self, pattern_type: Any) -> core_schema.CoreSchema: + from . import _validators + + metadata = {'pydantic_js_functions': [lambda _1, _2: {'type': 'string', 'format': 'regex'}]} + ser = core_schema.plain_serializer_function_ser_schema( + attrgetter('pattern'), when_used='json', return_schema=core_schema.str_schema() + ) + if pattern_type is typing.Pattern or pattern_type is re.Pattern: + # bare type + return core_schema.no_info_plain_validator_function( + _validators.pattern_either_validator, serialization=ser, metadata=metadata + ) + + param = self._get_args_resolving_forward_refs( + pattern_type, + required=True, + )[0] + if param is str: + return core_schema.no_info_plain_validator_function( + _validators.pattern_str_validator, serialization=ser, metadata=metadata + ) + elif param is bytes: + return core_schema.no_info_plain_validator_function( + _validators.pattern_bytes_validator, serialization=ser, metadata=metadata + ) + else: + raise PydanticSchemaGenerationError(f'Unable to generate pydantic-core schema for {pattern_type!r}.') + + def _hashable_schema(self) -> core_schema.CoreSchema: + return core_schema.custom_error_schema( + schema=core_schema.json_or_python_schema( + json_schema=core_schema.chain_schema( + [core_schema.any_schema(), core_schema.is_instance_schema(collections.abc.Hashable)] + ), + python_schema=core_schema.is_instance_schema(collections.abc.Hashable), + ), + custom_error_type='is_hashable', + custom_error_message='Input should be hashable', + ) + + def _dataclass_schema( + self, dataclass: type[StandardDataclass], origin: type[StandardDataclass] | None + ) -> core_schema.CoreSchema: + """Generate schema for a dataclass.""" + with ( + self.model_type_stack.push(dataclass), + self.defs.get_schema_or_ref(dataclass) as ( + dataclass_ref, + maybe_schema, + ), + ): + if maybe_schema is not None: + return maybe_schema + + schema = dataclass.__dict__.get('__pydantic_core_schema__') + if schema is not None and not isinstance(schema, MockCoreSchema): + if schema['type'] == 'definitions': + schema = self.defs.unpack_definitions(schema) + ref = get_ref(schema) + if ref: + return self.defs.create_definition_reference_schema(schema) + else: + return schema + + typevars_map = get_standard_typevars_map(dataclass) + if origin is not None: + dataclass = origin + + # if (plain) dataclass doesn't have config, we use the parent's config, hence a default of `None` + # (Pydantic dataclasses have an empty dict config by default). + # see https://github.com/pydantic/pydantic/issues/10917 + config = getattr(dataclass, '__pydantic_config__', None) + + from ..dataclasses import is_pydantic_dataclass + + with self._ns_resolver.push(dataclass), self._config_wrapper_stack.push(config): + if is_pydantic_dataclass(dataclass): + if dataclass.__pydantic_fields_complete__(): + # Copy the field info instances to avoid mutating the `FieldInfo` instances + # of the generic dataclass generic origin (e.g. `apply_typevars_map` below). + # Note that we don't apply `deepcopy` on `__pydantic_fields__` because we + # don't want to copy the `FieldInfo` attributes: + fields = { + f_name: copy(field_info) for f_name, field_info in dataclass.__pydantic_fields__.items() + } + if typevars_map: + for field in fields.values(): + field.apply_typevars_map(typevars_map, *self._types_namespace) + else: + try: + fields = rebuild_dataclass_fields( + dataclass, + config_wrapper=self._config_wrapper, + ns_resolver=self._ns_resolver, + typevars_map=typevars_map or {}, + ) + except NameError as e: + raise PydanticUndefinedAnnotation.from_name_error(e) from e + else: + fields = collect_dataclass_fields( + dataclass, + typevars_map=typevars_map, + config_wrapper=self._config_wrapper, + ) + + if self._config_wrapper.extra == 'allow': + # disallow combination of init=False on a dataclass field and extra='allow' on a dataclass + for field_name, field in fields.items(): + if field.init is False: + raise PydanticUserError( + f'Field {field_name} has `init=False` and dataclass has config setting `extra="allow"`. ' + f'This combination is not allowed.', + code='dataclass-init-false-extra-allow', + ) + + decorators = dataclass.__dict__.get('__pydantic_decorators__') or DecoratorInfos.build(dataclass) + # Move kw_only=False args to the start of the list, as this is how vanilla dataclasses work. + # Note that when kw_only is missing or None, it is treated as equivalent to kw_only=True + args = sorted( + (self._generate_dc_field_schema(k, v, decorators) for k, v in fields.items()), + key=lambda a: a.get('kw_only') is not False, + ) + has_post_init = hasattr(dataclass, '__post_init__') + has_slots = hasattr(dataclass, '__slots__') + + args_schema = core_schema.dataclass_args_schema( + dataclass.__name__, + args, + computed_fields=[ + self._computed_field_schema(d, decorators.field_serializers) + for d in decorators.computed_fields.values() + ], + collect_init_only=has_post_init, + ) + + inner_schema = apply_validators(args_schema, decorators.root_validators.values(), None) + + model_validators = decorators.model_validators.values() + inner_schema = apply_model_validators(inner_schema, model_validators, 'inner') + + core_config = self._config_wrapper.core_config(title=dataclass.__name__) + + dc_schema = core_schema.dataclass_schema( + dataclass, + inner_schema, + generic_origin=origin, + post_init=has_post_init, + ref=dataclass_ref, + fields=[field.name for field in dataclasses.fields(dataclass)], + slots=has_slots, + config=core_config, + # we don't use a custom __setattr__ for dataclasses, so we must + # pass along the frozen config setting to the pydantic-core schema + frozen=self._config_wrapper_stack.tail.frozen, + ) + schema = self._apply_model_serializers(dc_schema, decorators.model_serializers.values()) + schema = apply_model_validators(schema, model_validators, 'outer') + return self.defs.create_definition_reference_schema(schema) + + def _call_schema(self, function: ValidateCallSupportedTypes) -> core_schema.CallSchema: + """Generate schema for a Callable. + + TODO support functional validators once we support them in Config + """ + arguments_schema = self._arguments_schema(function) + + return_schema: core_schema.CoreSchema | None = None + config_wrapper = self._config_wrapper + if config_wrapper.validate_return: + sig = signature(function) + return_hint = sig.return_annotation + if return_hint is not sig.empty: + globalns, localns = self._types_namespace + type_hints = _typing_extra.get_function_type_hints( + function, globalns=globalns, localns=localns, include_keys={'return'} + ) + return_schema = self.generate_schema(type_hints['return']) + + return core_schema.call_schema( + arguments_schema, + function, + return_schema=return_schema, + ) + + def _arguments_schema( + self, function: ValidateCallSupportedTypes, parameters_callback: ParametersCallback | None = None + ) -> core_schema.ArgumentsSchema: + """Generate schema for a Signature.""" + mode_lookup: dict[_ParameterKind, Literal['positional_only', 'positional_or_keyword', 'keyword_only']] = { + Parameter.POSITIONAL_ONLY: 'positional_only', + Parameter.POSITIONAL_OR_KEYWORD: 'positional_or_keyword', + Parameter.KEYWORD_ONLY: 'keyword_only', + } + + sig = signature(function) + globalns, localns = self._types_namespace + type_hints = _typing_extra.get_function_type_hints(function, globalns=globalns, localns=localns) + + arguments_list: list[core_schema.ArgumentsParameter] = [] + var_args_schema: core_schema.CoreSchema | None = None + var_kwargs_schema: core_schema.CoreSchema | None = None + var_kwargs_mode: core_schema.VarKwargsMode | None = None + + for i, (name, p) in enumerate(sig.parameters.items()): + if p.annotation is sig.empty: + annotation = typing.cast(Any, Any) + else: + annotation = type_hints[name] + + if parameters_callback is not None: + result = parameters_callback(i, name, annotation) + if result == 'skip': + continue + + parameter_mode = mode_lookup.get(p.kind) + if parameter_mode is not None: + arg_schema = self._generate_parameter_schema( + name, annotation, AnnotationSource.FUNCTION, p.default, parameter_mode + ) + arguments_list.append(arg_schema) + elif p.kind == Parameter.VAR_POSITIONAL: + var_args_schema = self.generate_schema(annotation) + else: + assert p.kind == Parameter.VAR_KEYWORD, p.kind + + unpack_type = _typing_extra.unpack_type(annotation) + if unpack_type is not None: + origin = get_origin(unpack_type) or unpack_type + if not is_typeddict(origin): + raise PydanticUserError( + f'Expected a `TypedDict` class inside `Unpack[...]`, got {unpack_type!r}', + code='unpack-typed-dict', + ) + non_pos_only_param_names = { + name for name, p in sig.parameters.items() if p.kind != Parameter.POSITIONAL_ONLY + } + overlapping_params = non_pos_only_param_names.intersection(origin.__annotations__) + if overlapping_params: + raise PydanticUserError( + f'Typed dictionary {origin.__name__!r} overlaps with parameter' + f'{"s" if len(overlapping_params) >= 2 else ""} ' + f'{", ".join(repr(p) for p in sorted(overlapping_params))}', + code='overlapping-unpack-typed-dict', + ) + + var_kwargs_mode = 'unpacked-typed-dict' + var_kwargs_schema = self._typed_dict_schema(unpack_type, get_origin(unpack_type)) + else: + var_kwargs_mode = 'uniform' + var_kwargs_schema = self.generate_schema(annotation) + + return core_schema.arguments_schema( + arguments_list, + var_args_schema=var_args_schema, + var_kwargs_mode=var_kwargs_mode, + var_kwargs_schema=var_kwargs_schema, + validate_by_name=self._config_wrapper.validate_by_name, + ) + + def _arguments_v3_schema( + self, function: ValidateCallSupportedTypes, parameters_callback: ParametersCallback | None = None + ) -> core_schema.ArgumentsV3Schema: + mode_lookup: dict[ + _ParameterKind, Literal['positional_only', 'positional_or_keyword', 'var_args', 'keyword_only'] + ] = { + Parameter.POSITIONAL_ONLY: 'positional_only', + Parameter.POSITIONAL_OR_KEYWORD: 'positional_or_keyword', + Parameter.VAR_POSITIONAL: 'var_args', + Parameter.KEYWORD_ONLY: 'keyword_only', + } + + sig = signature(function) + globalns, localns = self._types_namespace + type_hints = _typing_extra.get_function_type_hints(function, globalns=globalns, localns=localns) + + parameters_list: list[core_schema.ArgumentsV3Parameter] = [] + + for i, (name, p) in enumerate(sig.parameters.items()): + if parameters_callback is not None: + result = parameters_callback(i, name, p.annotation) + if result == 'skip': + continue + + if p.annotation is Parameter.empty: + annotation = typing.cast(Any, Any) + else: + annotation = type_hints[name] + + parameter_mode = mode_lookup.get(p.kind) + if parameter_mode is None: + assert p.kind == Parameter.VAR_KEYWORD, p.kind + + unpack_type = _typing_extra.unpack_type(annotation) + if unpack_type is not None: + origin = get_origin(unpack_type) or unpack_type + if not is_typeddict(origin): + raise PydanticUserError( + f'Expected a `TypedDict` class inside `Unpack[...]`, got {unpack_type!r}', + code='unpack-typed-dict', + ) + non_pos_only_param_names = { + name for name, p in sig.parameters.items() if p.kind != Parameter.POSITIONAL_ONLY + } + overlapping_params = non_pos_only_param_names.intersection(origin.__annotations__) + if overlapping_params: + raise PydanticUserError( + f'Typed dictionary {origin.__name__!r} overlaps with parameter' + f'{"s" if len(overlapping_params) >= 2 else ""} ' + f'{", ".join(repr(p) for p in sorted(overlapping_params))}', + code='overlapping-unpack-typed-dict', + ) + parameter_mode = 'var_kwargs_unpacked_typed_dict' + annotation = unpack_type + else: + parameter_mode = 'var_kwargs_uniform' + + parameters_list.append( + self._generate_parameter_v3_schema( + name, annotation, AnnotationSource.FUNCTION, parameter_mode, default=p.default + ) + ) + + return core_schema.arguments_v3_schema( + parameters_list, + validate_by_name=self._config_wrapper.validate_by_name, + ) + + def _unsubstituted_typevar_schema(self, typevar: typing.TypeVar) -> core_schema.CoreSchema: + try: + has_default = typevar.has_default() + except AttributeError: + # Happens if using `typing.TypeVar` (and not `typing_extensions`) on Python < 3.13 + pass + else: + if has_default: + return self.generate_schema(typevar.__default__) + + if constraints := typevar.__constraints__: + return self._union_schema(typing.Union[constraints]) + + if bound := typevar.__bound__: + schema = self.generate_schema(bound) + schema['serialization'] = core_schema.wrap_serializer_function_ser_schema( + lambda x, h: h(x), + schema=core_schema.any_schema(), + ) + return schema + + return core_schema.any_schema() + + def _computed_field_schema( + self, + d: Decorator[ComputedFieldInfo], + field_serializers: dict[str, Decorator[FieldSerializerDecoratorInfo]], + ) -> core_schema.ComputedField: + if d.info.return_type is not PydanticUndefined: + return_type = d.info.return_type + else: + try: + # Do not pass in globals as the function could be defined in a different module. + # Instead, let `get_callable_return_type` infer the globals to use, but still pass + # in locals that may contain a parent/rebuild namespace: + return_type = _decorators.get_callable_return_type(d.func, localns=self._types_namespace.locals) + except NameError as e: + raise PydanticUndefinedAnnotation.from_name_error(e) from e + if return_type is PydanticUndefined: + raise PydanticUserError( + 'Computed field is missing return type annotation or specifying `return_type`' + ' to the `@computed_field` decorator (e.g. `@computed_field(return_type=int | str)`)', + code='model-field-missing-annotation', + ) + + return_type = replace_types(return_type, self._typevars_map) + # Create a new ComputedFieldInfo so that different type parametrizations of the same + # generic model's computed field can have different return types. + d.info = dataclasses.replace(d.info, return_type=return_type) + return_type_schema = self.generate_schema(return_type) + # Apply serializers to computed field if there exist + return_type_schema = self._apply_field_serializers( + return_type_schema, + filter_field_decorator_info_by_field(field_serializers.values(), d.cls_var_name), + ) + + alias_generator = self._config_wrapper.alias_generator + if alias_generator is not None: + self._apply_alias_generator_to_computed_field_info( + alias_generator=alias_generator, computed_field_info=d.info, computed_field_name=d.cls_var_name + ) + self._apply_field_title_generator_to_field_info(self._config_wrapper, d.info, d.cls_var_name) + + pydantic_js_updates, pydantic_js_extra = _extract_json_schema_info_from_field_info(d.info) + core_metadata: dict[str, Any] = {} + update_core_metadata( + core_metadata, + pydantic_js_updates={'readOnly': True, **(pydantic_js_updates if pydantic_js_updates else {})}, + pydantic_js_extra=pydantic_js_extra, + ) + return core_schema.computed_field( + d.cls_var_name, return_schema=return_type_schema, alias=d.info.alias, metadata=core_metadata + ) + + def _annotated_schema(self, annotated_type: Any) -> core_schema.CoreSchema: + """Generate schema for an Annotated type, e.g. `Annotated[int, Field(...)]` or `Annotated[int, Gt(0)]`.""" + FieldInfo = import_cached_field_info() + source_type, *annotations = self._get_args_resolving_forward_refs( + annotated_type, + required=True, + ) + schema = self._apply_annotations(source_type, annotations) + # put the default validator last so that TypeAdapter.get_default_value() works + # even if there are function validators involved + for annotation in annotations: + if isinstance(annotation, FieldInfo): + schema = wrap_default(annotation, schema) + return schema + + def _apply_annotations( + self, + source_type: Any, + annotations: list[Any], + transform_inner_schema: Callable[[CoreSchema], CoreSchema] = lambda x: x, + ) -> CoreSchema: + """Apply arguments from `Annotated` or from `FieldInfo` to a schema. + + This gets called by `GenerateSchema._annotated_schema` but differs from it in that it does + not expect `source_type` to be an `Annotated` object, it expects it to be the first argument of that + (in other words, `GenerateSchema._annotated_schema` just unpacks `Annotated`, this process it). + """ + annotations = list(_known_annotated_metadata.expand_grouped_metadata(annotations)) + + pydantic_js_annotation_functions: list[GetJsonSchemaFunction] = [] + + def inner_handler(obj: Any) -> CoreSchema: + schema = self._generate_schema_from_get_schema_method(obj, source_type) + + if schema is None: + schema = self._generate_schema_inner(obj) + + metadata_js_function = _extract_get_pydantic_json_schema(obj) + if metadata_js_function is not None: + metadata_schema = resolve_original_schema(schema, self.defs) + if metadata_schema is not None: + self._add_js_function(metadata_schema, metadata_js_function) + return transform_inner_schema(schema) + + get_inner_schema = CallbackGetCoreSchemaHandler(inner_handler, self) + + for annotation in annotations: + if annotation is None: + continue + get_inner_schema = self._get_wrapped_inner_schema( + get_inner_schema, annotation, pydantic_js_annotation_functions + ) + + schema = get_inner_schema(source_type) + if pydantic_js_annotation_functions: + core_metadata = schema.setdefault('metadata', {}) + update_core_metadata(core_metadata, pydantic_js_annotation_functions=pydantic_js_annotation_functions) + return _add_custom_serialization_from_json_encoders(self._config_wrapper.json_encoders, source_type, schema) + + def _apply_single_annotation(self, schema: core_schema.CoreSchema, metadata: Any) -> core_schema.CoreSchema: + FieldInfo = import_cached_field_info() + + if isinstance(metadata, FieldInfo): + for field_metadata in metadata.metadata: + schema = self._apply_single_annotation(schema, field_metadata) + + if metadata.discriminator is not None: + schema = self._apply_discriminator_to_union(schema, metadata.discriminator) + return schema + + if schema['type'] == 'nullable': + # for nullable schemas, metadata is automatically applied to the inner schema + inner = schema.get('schema', core_schema.any_schema()) + inner = self._apply_single_annotation(inner, metadata) + if inner: + schema['schema'] = inner + return schema + + original_schema = schema + ref = schema.get('ref') + if ref is not None: + schema = schema.copy() + new_ref = ref + f'_{repr(metadata)}' + if (existing := self.defs.get_schema_from_ref(new_ref)) is not None: + return existing + schema['ref'] = new_ref # pyright: ignore[reportGeneralTypeIssues] + elif schema['type'] == 'definition-ref': + ref = schema['schema_ref'] + if (referenced_schema := self.defs.get_schema_from_ref(ref)) is not None: + schema = referenced_schema.copy() + new_ref = ref + f'_{repr(metadata)}' + if (existing := self.defs.get_schema_from_ref(new_ref)) is not None: + return existing + schema['ref'] = new_ref # pyright: ignore[reportGeneralTypeIssues] + + maybe_updated_schema = _known_annotated_metadata.apply_known_metadata(metadata, schema) + + if maybe_updated_schema is not None: + return maybe_updated_schema + return original_schema + + def _apply_single_annotation_json_schema( + self, schema: core_schema.CoreSchema, metadata: Any + ) -> core_schema.CoreSchema: + FieldInfo = import_cached_field_info() + + if isinstance(metadata, FieldInfo): + for field_metadata in metadata.metadata: + schema = self._apply_single_annotation_json_schema(schema, field_metadata) + + pydantic_js_updates, pydantic_js_extra = _extract_json_schema_info_from_field_info(metadata) + core_metadata = schema.setdefault('metadata', {}) + update_core_metadata( + core_metadata, pydantic_js_updates=pydantic_js_updates, pydantic_js_extra=pydantic_js_extra + ) + return schema + + def _get_wrapped_inner_schema( + self, + get_inner_schema: GetCoreSchemaHandler, + annotation: Any, + pydantic_js_annotation_functions: list[GetJsonSchemaFunction], + ) -> CallbackGetCoreSchemaHandler: + annotation_get_schema: GetCoreSchemaFunction | None = getattr(annotation, '__get_pydantic_core_schema__', None) + + def new_handler(source: Any) -> core_schema.CoreSchema: + if annotation_get_schema is not None: + schema = annotation_get_schema(source, get_inner_schema) + else: + schema = get_inner_schema(source) + schema = self._apply_single_annotation(schema, annotation) + schema = self._apply_single_annotation_json_schema(schema, annotation) + + metadata_js_function = _extract_get_pydantic_json_schema(annotation) + if metadata_js_function is not None: + pydantic_js_annotation_functions.append(metadata_js_function) + return schema + + return CallbackGetCoreSchemaHandler(new_handler, self) + + def _apply_field_serializers( + self, + schema: core_schema.CoreSchema, + serializers: list[Decorator[FieldSerializerDecoratorInfo]], + ) -> core_schema.CoreSchema: + """Apply field serializers to a schema.""" + if serializers: + schema = copy(schema) + if schema['type'] == 'definitions': + inner_schema = schema['schema'] + schema['schema'] = self._apply_field_serializers(inner_schema, serializers) + return schema + elif 'ref' in schema: + schema = self.defs.create_definition_reference_schema(schema) + + # use the last serializer to make it easy to override a serializer set on a parent model + serializer = serializers[-1] + is_field_serializer, info_arg = inspect_field_serializer(serializer.func, serializer.info.mode) + + if serializer.info.return_type is not PydanticUndefined: + return_type = serializer.info.return_type + else: + try: + # Do not pass in globals as the function could be defined in a different module. + # Instead, let `get_callable_return_type` infer the globals to use, but still pass + # in locals that may contain a parent/rebuild namespace: + return_type = _decorators.get_callable_return_type( + serializer.func, localns=self._types_namespace.locals + ) + except NameError as e: + raise PydanticUndefinedAnnotation.from_name_error(e) from e + + if return_type is PydanticUndefined: + return_schema = None + else: + return_schema = self.generate_schema(return_type) + + if serializer.info.mode == 'wrap': + schema['serialization'] = core_schema.wrap_serializer_function_ser_schema( + serializer.func, + is_field_serializer=is_field_serializer, + info_arg=info_arg, + return_schema=return_schema, + when_used=serializer.info.when_used, + ) + else: + assert serializer.info.mode == 'plain' + schema['serialization'] = core_schema.plain_serializer_function_ser_schema( + serializer.func, + is_field_serializer=is_field_serializer, + info_arg=info_arg, + return_schema=return_schema, + when_used=serializer.info.when_used, + ) + return schema + + def _apply_model_serializers( + self, schema: core_schema.CoreSchema, serializers: Iterable[Decorator[ModelSerializerDecoratorInfo]] + ) -> core_schema.CoreSchema: + """Apply model serializers to a schema.""" + ref: str | None = schema.pop('ref', None) # type: ignore + if serializers: + serializer = list(serializers)[-1] + info_arg = inspect_model_serializer(serializer.func, serializer.info.mode) + + if serializer.info.return_type is not PydanticUndefined: + return_type = serializer.info.return_type + else: + try: + # Do not pass in globals as the function could be defined in a different module. + # Instead, let `get_callable_return_type` infer the globals to use, but still pass + # in locals that may contain a parent/rebuild namespace: + return_type = _decorators.get_callable_return_type( + serializer.func, localns=self._types_namespace.locals + ) + except NameError as e: + raise PydanticUndefinedAnnotation.from_name_error(e) from e + + if return_type is PydanticUndefined: + return_schema = None + else: + return_schema = self.generate_schema(return_type) + + if serializer.info.mode == 'wrap': + ser_schema: core_schema.SerSchema = core_schema.wrap_serializer_function_ser_schema( + serializer.func, + info_arg=info_arg, + return_schema=return_schema, + when_used=serializer.info.when_used, + ) + else: + # plain + ser_schema = core_schema.plain_serializer_function_ser_schema( + serializer.func, + info_arg=info_arg, + return_schema=return_schema, + when_used=serializer.info.when_used, + ) + schema['serialization'] = ser_schema + if ref: + schema['ref'] = ref # type: ignore + return schema + + +_VALIDATOR_F_MATCH: Mapping[ + tuple[FieldValidatorModes, Literal['no-info', 'with-info']], + Callable[[Callable[..., Any], core_schema.CoreSchema, str | None], core_schema.CoreSchema], +] = { + ('before', 'no-info'): lambda f, schema, _: core_schema.no_info_before_validator_function(f, schema), + ('after', 'no-info'): lambda f, schema, _: core_schema.no_info_after_validator_function(f, schema), + ('plain', 'no-info'): lambda f, _1, _2: core_schema.no_info_plain_validator_function(f), + ('wrap', 'no-info'): lambda f, schema, _: core_schema.no_info_wrap_validator_function(f, schema), + ('before', 'with-info'): lambda f, schema, field_name: core_schema.with_info_before_validator_function( + f, schema, field_name=field_name + ), + ('after', 'with-info'): lambda f, schema, field_name: core_schema.with_info_after_validator_function( + f, schema, field_name=field_name + ), + ('plain', 'with-info'): lambda f, _, field_name: core_schema.with_info_plain_validator_function( + f, field_name=field_name + ), + ('wrap', 'with-info'): lambda f, schema, field_name: core_schema.with_info_wrap_validator_function( + f, schema, field_name=field_name + ), +} + + +# TODO V3: this function is only used for deprecated decorators. It should +# be removed once we drop support for those. +def apply_validators( + schema: core_schema.CoreSchema, + validators: Iterable[Decorator[RootValidatorDecoratorInfo]] + | Iterable[Decorator[ValidatorDecoratorInfo]] + | Iterable[Decorator[FieldValidatorDecoratorInfo]], + field_name: str | None, +) -> core_schema.CoreSchema: + """Apply validators to a schema. + + Args: + schema: The schema to apply validators on. + validators: An iterable of validators. + field_name: The name of the field if validators are being applied to a model field. + + Returns: + The updated schema. + """ + for validator in validators: + info_arg = inspect_validator(validator.func, validator.info.mode) + val_type = 'with-info' if info_arg else 'no-info' + + schema = _VALIDATOR_F_MATCH[(validator.info.mode, val_type)](validator.func, schema, field_name) + return schema + + +def _validators_require_validate_default(validators: Iterable[Decorator[ValidatorDecoratorInfo]]) -> bool: + """In v1, if any of the validators for a field had `always=True`, the default value would be validated. + + This serves as an auxiliary function for re-implementing that logic, by looping over a provided + collection of (v1-style) ValidatorDecoratorInfo's and checking if any of them have `always=True`. + + We should be able to drop this function and the associated logic calling it once we drop support + for v1-style validator decorators. (Or we can extend it and keep it if we add something equivalent + to the v1-validator `always` kwarg to `field_validator`.) + """ + for validator in validators: + if validator.info.always: + return True + return False + + +def apply_model_validators( + schema: core_schema.CoreSchema, + validators: Iterable[Decorator[ModelValidatorDecoratorInfo]], + mode: Literal['inner', 'outer', 'all'], +) -> core_schema.CoreSchema: + """Apply model validators to a schema. + + If mode == 'inner', only "before" validators are applied + If mode == 'outer', validators other than "before" are applied + If mode == 'all', all validators are applied + + Args: + schema: The schema to apply validators on. + validators: An iterable of validators. + mode: The validator mode. + + Returns: + The updated schema. + """ + ref: str | None = schema.pop('ref', None) # type: ignore + for validator in validators: + if mode == 'inner' and validator.info.mode != 'before': + continue + if mode == 'outer' and validator.info.mode == 'before': + continue + info_arg = inspect_validator(validator.func, validator.info.mode) + if validator.info.mode == 'wrap': + if info_arg: + schema = core_schema.with_info_wrap_validator_function(function=validator.func, schema=schema) + else: + schema = core_schema.no_info_wrap_validator_function(function=validator.func, schema=schema) + elif validator.info.mode == 'before': + if info_arg: + schema = core_schema.with_info_before_validator_function(function=validator.func, schema=schema) + else: + schema = core_schema.no_info_before_validator_function(function=validator.func, schema=schema) + else: + assert validator.info.mode == 'after' + if info_arg: + schema = core_schema.with_info_after_validator_function(function=validator.func, schema=schema) + else: + schema = core_schema.no_info_after_validator_function(function=validator.func, schema=schema) + if ref: + schema['ref'] = ref # type: ignore + return schema + + +def wrap_default(field_info: FieldInfo, schema: core_schema.CoreSchema) -> core_schema.CoreSchema: + """Wrap schema with default schema if default value or `default_factory` are available. + + Args: + field_info: The field info object. + schema: The schema to apply default on. + + Returns: + Updated schema by default value or `default_factory`. + """ + if field_info.default_factory: + return core_schema.with_default_schema( + schema, + default_factory=field_info.default_factory, + default_factory_takes_data=takes_validated_data_argument(field_info.default_factory), + validate_default=field_info.validate_default, + ) + elif field_info.default is not PydanticUndefined: + return core_schema.with_default_schema( + schema, default=field_info.default, validate_default=field_info.validate_default + ) + else: + return schema + + +def _extract_get_pydantic_json_schema(tp: Any) -> GetJsonSchemaFunction | None: + """Extract `__get_pydantic_json_schema__` from a type, handling the deprecated `__modify_schema__`.""" + js_modify_function = getattr(tp, '__get_pydantic_json_schema__', None) + + if hasattr(tp, '__modify_schema__'): + BaseModel = import_cached_base_model() + + has_custom_v2_modify_js_func = ( + js_modify_function is not None + and BaseModel.__get_pydantic_json_schema__.__func__ # type: ignore + not in (js_modify_function, getattr(js_modify_function, '__func__', None)) + ) + + if not has_custom_v2_modify_js_func: + cls_name = getattr(tp, '__name__', None) + raise PydanticUserError( + f'The `__modify_schema__` method is not supported in Pydantic v2. ' + f'Use `__get_pydantic_json_schema__` instead{f" in class `{cls_name}`" if cls_name else ""}.', + code='custom-json-schema', + ) + + if (origin := get_origin(tp)) is not None: + # Generic aliases proxy attribute access to the origin, *except* dunder attributes, + # such as `__get_pydantic_json_schema__`, hence the explicit check. + return _extract_get_pydantic_json_schema(origin) + + if js_modify_function is None: + return None + + return js_modify_function + + +class _CommonField(TypedDict): + schema: core_schema.CoreSchema + validation_alias: str | list[str | int] | list[list[str | int]] | None + serialization_alias: str | None + serialization_exclude: bool | None + frozen: bool | None + metadata: dict[str, Any] + + +def _common_field( + schema: core_schema.CoreSchema, + *, + validation_alias: str | list[str | int] | list[list[str | int]] | None = None, + serialization_alias: str | None = None, + serialization_exclude: bool | None = None, + frozen: bool | None = None, + metadata: Any = None, +) -> _CommonField: + return { + 'schema': schema, + 'validation_alias': validation_alias, + 'serialization_alias': serialization_alias, + 'serialization_exclude': serialization_exclude, + 'frozen': frozen, + 'metadata': metadata, + } + + +def resolve_original_schema(schema: CoreSchema, definitions: _Definitions) -> CoreSchema | None: + if schema['type'] == 'definition-ref': + return definitions.get_schema_from_ref(schema['schema_ref']) + elif schema['type'] == 'definitions': + return schema['schema'] + else: + return schema + + +def _inlining_behavior( + def_ref: core_schema.DefinitionReferenceSchema, +) -> Literal['inline', 'keep', 'preserve_metadata']: + """Determine the inlining behavior of the `'definition-ref'` schema. + + - If no `'serialization'` schema and no metadata is attached, the schema can safely be inlined. + - If it has metadata but only related to the deferred discriminator application, it can be inlined + provided that such metadata is kept. + - Otherwise, the schema should not be inlined. Doing so would remove the `'serialization'` schema or metadata. + """ + if 'serialization' in def_ref: + return 'keep' + metadata = def_ref.get('metadata') + if not metadata: + return 'inline' + if len(metadata) == 1 and 'pydantic_internal_union_discriminator' in metadata: + return 'preserve_metadata' + return 'keep' + + +class _Definitions: + """Keeps track of references and definitions.""" + + _recursively_seen: set[str] + """A set of recursively seen references. + + When a referenceable type is encountered, the `get_schema_or_ref` context manager is + entered to compute the reference. If the type references itself by some way (e.g. for + a dataclass a Pydantic model, the class can be referenced as a field annotation), + entering the context manager again will yield a `'definition-ref'` schema that should + short-circuit the normal generation process, as the reference was already in this set. + """ + + _definitions: dict[str, core_schema.CoreSchema] + """A mapping of references to their corresponding schema. + + When a schema for a referenceable type is generated, it is stored in this mapping. If the + same type is encountered again, the reference is yielded by the `get_schema_or_ref` context + manager. + """ + + def __init__(self) -> None: + self._recursively_seen = set() + self._definitions = {} + + @contextmanager + def get_schema_or_ref(self, tp: Any, /) -> Generator[tuple[str, core_schema.DefinitionReferenceSchema | None]]: + """Get a definition for `tp` if one exists. + + If a definition exists, a tuple of `(ref_string, CoreSchema)` is returned. + If no definition exists yet, a tuple of `(ref_string, None)` is returned. + + Note that the returned `CoreSchema` will always be a `DefinitionReferenceSchema`, + not the actual definition itself. + + This should be called for any type that can be identified by reference. + This includes any recursive types. + + At present the following types can be named/recursive: + + - Pydantic model + - Pydantic and stdlib dataclasses + - Typed dictionaries + - Named tuples + - `TypeAliasType` instances + - Enums + """ + ref = get_type_ref(tp) + # return the reference if we're either (1) in a cycle or (2) it the reference was already encountered: + if ref in self._recursively_seen or ref in self._definitions: + yield (ref, core_schema.definition_reference_schema(ref)) + else: + self._recursively_seen.add(ref) + try: + yield (ref, None) + finally: + self._recursively_seen.discard(ref) + + def get_schema_from_ref(self, ref: str) -> CoreSchema | None: + """Resolve the schema from the given reference.""" + return self._definitions.get(ref) + + def create_definition_reference_schema(self, schema: CoreSchema) -> core_schema.DefinitionReferenceSchema: + """Store the schema as a definition and return a `'definition-reference'` schema pointing to it. + + The schema must have a reference attached to it. + """ + ref = schema['ref'] # pyright: ignore + self._definitions[ref] = schema + return core_schema.definition_reference_schema(ref) + + def unpack_definitions(self, schema: core_schema.DefinitionsSchema) -> CoreSchema: + """Store the definitions of the `'definitions'` core schema and return the inner core schema.""" + for def_schema in schema['definitions']: + self._definitions[def_schema['ref']] = def_schema # pyright: ignore + return schema['schema'] + + def finalize_schema(self, schema: CoreSchema) -> CoreSchema: + """Finalize the core schema. + + This traverses the core schema and referenced definitions, replaces `'definition-ref'` schemas + by the referenced definition if possible, and applies deferred discriminators. + """ + definitions = self._definitions + try: + gather_result = gather_schemas_for_cleaning( + schema, + definitions=definitions, + ) + except MissingDefinitionError as e: + raise InvalidSchemaError from e + + remaining_defs: dict[str, CoreSchema] = {} + + # Note: this logic doesn't play well when core schemas with deferred discriminator metadata + # and references are encountered. See the `test_deferred_discriminated_union_and_references()` test. + for ref, inlinable_def_ref in gather_result['collected_references'].items(): + if inlinable_def_ref is not None and (inlining_behavior := _inlining_behavior(inlinable_def_ref)) != 'keep': + if inlining_behavior == 'inline': + # `ref` was encountered, and only once: + # - `inlinable_def_ref` is a `'definition-ref'` schema and is guaranteed to be + # the only one. Transform it into the definition it points to. + # - Do not store the definition in the `remaining_defs`. + inlinable_def_ref.clear() # pyright: ignore[reportAttributeAccessIssue] + inlinable_def_ref.update(self._resolve_definition(ref, definitions)) # pyright: ignore + elif inlining_behavior == 'preserve_metadata': + # `ref` was encountered, and only once, but contains discriminator metadata. + # We will do the same thing as if `inlining_behavior` was `'inline'`, but make + # sure to keep the metadata for the deferred discriminator application logic below. + meta = inlinable_def_ref.pop('metadata') + inlinable_def_ref.clear() # pyright: ignore[reportAttributeAccessIssue] + inlinable_def_ref.update(self._resolve_definition(ref, definitions)) # pyright: ignore + inlinable_def_ref['metadata'] = meta + else: + # `ref` was encountered, at least two times (or only once, but with metadata or a serialization schema): + # - Do not inline the `'definition-ref'` schemas (they are not provided in the gather result anyway). + # - Store the the definition in the `remaining_defs` + remaining_defs[ref] = self._resolve_definition(ref, definitions) + + for cs in gather_result['deferred_discriminator_schemas']: + discriminator: str | None = cs['metadata'].pop('pydantic_internal_union_discriminator', None) # pyright: ignore[reportTypedDictNotRequiredAccess] + if discriminator is None: + # This can happen in rare scenarios, when a deferred schema is present multiple times in the + # gather result (e.g. when using the `Sequence` type -- see `test_sequence_discriminated_union()`). + # In this case, a previous loop iteration applied the discriminator and so we can just skip it here. + continue + applied = _discriminated_union.apply_discriminator(cs.copy(), discriminator, remaining_defs) + # Mutate the schema directly to have the discriminator applied + cs.clear() # pyright: ignore[reportAttributeAccessIssue] + cs.update(applied) # pyright: ignore + + if remaining_defs: + schema = core_schema.definitions_schema(schema=schema, definitions=[*remaining_defs.values()]) + return schema + + def _resolve_definition(self, ref: str, definitions: dict[str, CoreSchema]) -> CoreSchema: + definition = definitions[ref] + if definition['type'] != 'definition-ref': + return definition + + # Some `'definition-ref'` schemas might act as "intermediate" references (e.g. when using + # a PEP 695 type alias (which is referenceable) that references another PEP 695 type alias): + visited: set[str] = set() + while definition['type'] == 'definition-ref' and _inlining_behavior(definition) == 'inline': + schema_ref = definition['schema_ref'] + if schema_ref in visited: + raise PydanticUserError( + f'{ref} contains a circular reference to itself.', code='circular-reference-schema' + ) + visited.add(schema_ref) + definition = definitions[schema_ref] + return {**definition, 'ref': ref} # pyright: ignore[reportReturnType] + + +class _FieldNameStack: + __slots__ = ('_stack',) + + def __init__(self) -> None: + self._stack: list[str] = [] + + @contextmanager + def push(self, field_name: str) -> Iterator[None]: + self._stack.append(field_name) + yield + self._stack.pop() + + def get(self) -> str | None: + if self._stack: + return self._stack[-1] + else: + return None + + +class _ModelTypeStack: + __slots__ = ('_stack',) + + def __init__(self) -> None: + self._stack: list[type] = [] + + @contextmanager + def push(self, type_obj: type) -> Iterator[None]: + self._stack.append(type_obj) + yield + self._stack.pop() + + def get(self) -> type | None: + if self._stack: + return self._stack[-1] + else: + return None diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_generics.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_generics.py new file mode 100644 index 0000000000000000000000000000000000000000..80136766612aefce6293c550acd3044434f2b277 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_generics.py @@ -0,0 +1,547 @@ +from __future__ import annotations + +import sys +import types +import typing +from collections import ChainMap +from collections.abc import Iterator, Mapping +from contextlib import contextmanager +from contextvars import ContextVar +from itertools import zip_longest +from types import prepare_class +from typing import TYPE_CHECKING, Annotated, Any, TypeVar +from weakref import WeakValueDictionary + +import typing_extensions +from typing_inspection import typing_objects +from typing_inspection.introspection import is_union_origin + +from . import _typing_extra +from ._core_utils import get_type_ref +from ._forward_ref import PydanticRecursiveRef +from ._utils import all_identical, is_model_class + +if sys.version_info >= (3, 10): + from typing import _UnionGenericAlias # type: ignore[attr-defined] + +if TYPE_CHECKING: + from ..main import BaseModel + +GenericTypesCacheKey = tuple[Any, Any, tuple[Any, ...]] + +# Note: We want to remove LimitedDict, but to do this, we'd need to improve the handling of generics caching. +# Right now, to handle recursive generics, we some types must remain cached for brief periods without references. +# By chaining the WeakValuesDict with a LimitedDict, we have a way to retain caching for all types with references, +# while also retaining a limited number of types even without references. This is generally enough to build +# specific recursive generic models without losing required items out of the cache. + +KT = TypeVar('KT') +VT = TypeVar('VT') +_LIMITED_DICT_SIZE = 100 + + +class LimitedDict(dict[KT, VT]): + def __init__(self, size_limit: int = _LIMITED_DICT_SIZE) -> None: + self.size_limit = size_limit + super().__init__() + + def __setitem__(self, key: KT, value: VT, /) -> None: + super().__setitem__(key, value) + if len(self) > self.size_limit: + excess = len(self) - self.size_limit + self.size_limit // 10 + to_remove = list(self.keys())[:excess] + for k in to_remove: + del self[k] + + +# weak dictionaries allow the dynamically created parametrized versions of generic models to get collected +# once they are no longer referenced by the caller. +GenericTypesCache = WeakValueDictionary[GenericTypesCacheKey, 'type[BaseModel]'] + +if TYPE_CHECKING: + + class DeepChainMap(ChainMap[KT, VT]): # type: ignore + ... + +else: + + class DeepChainMap(ChainMap): + """Variant of ChainMap that allows direct updates to inner scopes. + + Taken from https://docs.python.org/3/library/collections.html#collections.ChainMap, + with some light modifications for this use case. + """ + + def clear(self) -> None: + for mapping in self.maps: + mapping.clear() + + def __setitem__(self, key: KT, value: VT) -> None: + for mapping in self.maps: + mapping[key] = value + + def __delitem__(self, key: KT) -> None: + hit = False + for mapping in self.maps: + if key in mapping: + del mapping[key] + hit = True + if not hit: + raise KeyError(key) + + +# Despite the fact that LimitedDict _seems_ no longer necessary, I'm very nervous to actually remove it +# and discover later on that we need to re-add all this infrastructure... +# _GENERIC_TYPES_CACHE = DeepChainMap(GenericTypesCache(), LimitedDict()) + +_GENERIC_TYPES_CACHE: ContextVar[GenericTypesCache | None] = ContextVar('_GENERIC_TYPES_CACHE', default=None) + + +class PydanticGenericMetadata(typing_extensions.TypedDict): + origin: type[BaseModel] | None # analogous to typing._GenericAlias.__origin__ + args: tuple[Any, ...] # analogous to typing._GenericAlias.__args__ + parameters: tuple[TypeVar, ...] # analogous to typing.Generic.__parameters__ + + +def create_generic_submodel( + model_name: str, origin: type[BaseModel], args: tuple[Any, ...], params: tuple[Any, ...] +) -> type[BaseModel]: + """Dynamically create a submodel of a provided (generic) BaseModel. + + This is used when producing concrete parametrizations of generic models. This function + only *creates* the new subclass; the schema/validators/serialization must be updated to + reflect a concrete parametrization elsewhere. + + Args: + model_name: The name of the newly created model. + origin: The base class for the new model to inherit from. + args: A tuple of generic metadata arguments. + params: A tuple of generic metadata parameters. + + Returns: + The created submodel. + """ + namespace: dict[str, Any] = {'__module__': origin.__module__} + bases = (origin,) + meta, ns, kwds = prepare_class(model_name, bases) + namespace.update(ns) + created_model = meta( + model_name, + bases, + namespace, + __pydantic_generic_metadata__={ + 'origin': origin, + 'args': args, + 'parameters': params, + }, + __pydantic_reset_parent_namespace__=False, + **kwds, + ) + + model_module, called_globally = _get_caller_frame_info(depth=3) + if called_globally: # create global reference and therefore allow pickling + object_by_reference = None + reference_name = model_name + reference_module_globals = sys.modules[created_model.__module__].__dict__ + while object_by_reference is not created_model: + object_by_reference = reference_module_globals.setdefault(reference_name, created_model) + reference_name += '_' + + return created_model + + +def _get_caller_frame_info(depth: int = 2) -> tuple[str | None, bool]: + """Used inside a function to check whether it was called globally. + + Args: + depth: The depth to get the frame. + + Returns: + A tuple contains `module_name` and `called_globally`. + + Raises: + RuntimeError: If the function is not called inside a function. + """ + try: + previous_caller_frame = sys._getframe(depth) + except ValueError as e: + raise RuntimeError('This function must be used inside another function') from e + except AttributeError: # sys module does not have _getframe function, so there's nothing we can do about it + return None, False + frame_globals = previous_caller_frame.f_globals + return frame_globals.get('__name__'), previous_caller_frame.f_locals is frame_globals + + +DictValues: type[Any] = {}.values().__class__ + + +def iter_contained_typevars(v: Any) -> Iterator[TypeVar]: + """Recursively iterate through all subtypes and type args of `v` and yield any typevars that are found. + + This is inspired as an alternative to directly accessing the `__parameters__` attribute of a GenericAlias, + since __parameters__ of (nested) generic BaseModel subclasses won't show up in that list. + """ + if isinstance(v, TypeVar): + yield v + elif is_model_class(v): + yield from v.__pydantic_generic_metadata__['parameters'] + elif isinstance(v, (DictValues, list)): + for var in v: + yield from iter_contained_typevars(var) + else: + args = get_args(v) + for arg in args: + yield from iter_contained_typevars(arg) + + +def get_args(v: Any) -> Any: + pydantic_generic_metadata: PydanticGenericMetadata | None = getattr(v, '__pydantic_generic_metadata__', None) + if pydantic_generic_metadata: + return pydantic_generic_metadata.get('args') + return typing_extensions.get_args(v) + + +def get_origin(v: Any) -> Any: + pydantic_generic_metadata: PydanticGenericMetadata | None = getattr(v, '__pydantic_generic_metadata__', None) + if pydantic_generic_metadata: + return pydantic_generic_metadata.get('origin') + return typing_extensions.get_origin(v) + + +def get_standard_typevars_map(cls: Any) -> dict[TypeVar, Any] | None: + """Package a generic type's typevars and parametrization (if present) into a dictionary compatible with the + `replace_types` function. Specifically, this works with standard typing generics and typing._GenericAlias. + """ + origin = get_origin(cls) + if origin is None: + return None + if not hasattr(origin, '__parameters__'): + return None + + # In this case, we know that cls is a _GenericAlias, and origin is the generic type + # So it is safe to access cls.__args__ and origin.__parameters__ + args: tuple[Any, ...] = cls.__args__ # type: ignore + parameters: tuple[TypeVar, ...] = origin.__parameters__ + return dict(zip(parameters, args)) + + +def get_model_typevars_map(cls: type[BaseModel]) -> dict[TypeVar, Any]: + """Package a generic BaseModel's typevars and concrete parametrization (if present) into a dictionary compatible + with the `replace_types` function. + + Since BaseModel.__class_getitem__ does not produce a typing._GenericAlias, and the BaseModel generic info is + stored in the __pydantic_generic_metadata__ attribute, we need special handling here. + """ + # TODO: This could be unified with `get_standard_typevars_map` if we stored the generic metadata + # in the __origin__, __args__, and __parameters__ attributes of the model. + generic_metadata = cls.__pydantic_generic_metadata__ + origin = generic_metadata['origin'] + args = generic_metadata['args'] + if not args: + # No need to go into `iter_contained_typevars`: + return {} + return dict(zip(iter_contained_typevars(origin), args)) + + +def replace_types(type_: Any, type_map: Mapping[TypeVar, Any] | None) -> Any: + """Return type with all occurrences of `type_map` keys recursively replaced with their values. + + Args: + type_: The class or generic alias. + type_map: Mapping from `TypeVar` instance to concrete types. + + Returns: + A new type representing the basic structure of `type_` with all + `typevar_map` keys recursively replaced. + + Example: + ```python + from typing import List, Union + + from pydantic._internal._generics import replace_types + + replace_types(tuple[str, Union[List[str], float]], {str: int}) + #> tuple[int, Union[List[int], float]] + ``` + """ + if not type_map: + return type_ + + type_args = get_args(type_) + origin_type = get_origin(type_) + + if typing_objects.is_annotated(origin_type): + annotated_type, *annotations = type_args + annotated_type = replace_types(annotated_type, type_map) + # TODO remove parentheses when we drop support for Python 3.10: + return Annotated[(annotated_type, *annotations)] + + # Having type args is a good indicator that this is a typing special form + # instance or a generic alias of some sort. + if type_args: + resolved_type_args = tuple(replace_types(arg, type_map) for arg in type_args) + if all_identical(type_args, resolved_type_args): + # If all arguments are the same, there is no need to modify the + # type or create a new object at all + return type_ + + if ( + origin_type is not None + and isinstance(type_, _typing_extra.typing_base) + and not isinstance(origin_type, _typing_extra.typing_base) + and getattr(type_, '_name', None) is not None + ): + # In python < 3.9 generic aliases don't exist so any of these like `list`, + # `type` or `collections.abc.Callable` need to be translated. + # See: https://www.python.org/dev/peps/pep-0585 + origin_type = getattr(typing, type_._name) + assert origin_type is not None + + if is_union_origin(origin_type): + if any(typing_objects.is_any(arg) for arg in resolved_type_args): + # `Any | T` ~ `Any`: + resolved_type_args = (Any,) + # `Never | T` ~ `T`: + resolved_type_args = tuple( + arg + for arg in resolved_type_args + if not (typing_objects.is_noreturn(arg) or typing_objects.is_never(arg)) + ) + + # PEP-604 syntax (Ex.: list | str) is represented with a types.UnionType object that does not have __getitem__. + # We also cannot use isinstance() since we have to compare types. + if sys.version_info >= (3, 10) and origin_type is types.UnionType: + return _UnionGenericAlias(origin_type, resolved_type_args) + # NotRequired[T] and Required[T] don't support tuple type resolved_type_args, hence the condition below + return origin_type[resolved_type_args[0] if len(resolved_type_args) == 1 else resolved_type_args] + + # We handle pydantic generic models separately as they don't have the same + # semantics as "typing" classes or generic aliases + + if not origin_type and is_model_class(type_): + parameters = type_.__pydantic_generic_metadata__['parameters'] + if not parameters: + return type_ + resolved_type_args = tuple(replace_types(t, type_map) for t in parameters) + if all_identical(parameters, resolved_type_args): + return type_ + return type_[resolved_type_args] + + # Handle special case for typehints that can have lists as arguments. + # `typing.Callable[[int, str], int]` is an example for this. + if isinstance(type_, list): + resolved_list = [replace_types(element, type_map) for element in type_] + if all_identical(type_, resolved_list): + return type_ + return resolved_list + + # If all else fails, we try to resolve the type directly and otherwise just + # return the input with no modifications. + return type_map.get(type_, type_) + + +def map_generic_model_arguments(cls: type[BaseModel], args: tuple[Any, ...]) -> dict[TypeVar, Any]: + """Return a mapping between the parameters of a generic model and the provided arguments during parameterization. + + Raises: + TypeError: If the number of arguments does not match the parameters (i.e. if providing too few or too many arguments). + + Example: + ```python {test="skip" lint="skip"} + class Model[T, U, V = int](BaseModel): ... + + map_generic_model_arguments(Model, (str, bytes)) + #> {T: str, U: bytes, V: int} + + map_generic_model_arguments(Model, (str,)) + #> TypeError: Too few arguments for ; actual 1, expected at least 2 + + map_generic_model_arguments(Model, (str, bytes, int, complex)) + #> TypeError: Too many arguments for ; actual 4, expected 3 + ``` + + Note: + This function is analogous to the private `typing._check_generic_specialization` function. + """ + parameters = cls.__pydantic_generic_metadata__['parameters'] + expected_len = len(parameters) + typevars_map: dict[TypeVar, Any] = {} + + _missing = object() + for parameter, argument in zip_longest(parameters, args, fillvalue=_missing): + if parameter is _missing: + raise TypeError(f'Too many arguments for {cls}; actual {len(args)}, expected {expected_len}') + + if argument is _missing: + param = typing.cast(TypeVar, parameter) + try: + has_default = param.has_default() + except AttributeError: + # Happens if using `typing.TypeVar` (and not `typing_extensions`) on Python < 3.13. + has_default = False + if has_default: + # The default might refer to other type parameters. For an example, see: + # https://typing.readthedocs.io/en/latest/spec/generics.html#type-parameters-as-parameters-to-generics + typevars_map[param] = replace_types(param.__default__, typevars_map) + else: + expected_len -= sum(hasattr(p, 'has_default') and p.has_default() for p in parameters) + raise TypeError(f'Too few arguments for {cls}; actual {len(args)}, expected at least {expected_len}') + else: + param = typing.cast(TypeVar, parameter) + typevars_map[param] = argument + + return typevars_map + + +_generic_recursion_cache: ContextVar[set[str] | None] = ContextVar('_generic_recursion_cache', default=None) + + +@contextmanager +def generic_recursion_self_type( + origin: type[BaseModel], args: tuple[Any, ...] +) -> Iterator[PydanticRecursiveRef | None]: + """This contextmanager should be placed around the recursive calls used to build a generic type, + and accept as arguments the generic origin type and the type arguments being passed to it. + + If the same origin and arguments are observed twice, it implies that a self-reference placeholder + can be used while building the core schema, and will produce a schema_ref that will be valid in the + final parent schema. + """ + previously_seen_type_refs = _generic_recursion_cache.get() + if previously_seen_type_refs is None: + previously_seen_type_refs = set() + token = _generic_recursion_cache.set(previously_seen_type_refs) + else: + token = None + + try: + type_ref = get_type_ref(origin, args_override=args) + if type_ref in previously_seen_type_refs: + self_type = PydanticRecursiveRef(type_ref=type_ref) + yield self_type + else: + previously_seen_type_refs.add(type_ref) + yield + previously_seen_type_refs.remove(type_ref) + finally: + if token: + _generic_recursion_cache.reset(token) + + +def recursively_defined_type_refs() -> set[str]: + visited = _generic_recursion_cache.get() + if not visited: + return set() # not in a generic recursion, so there are no types + + return visited.copy() # don't allow modifications + + +def get_cached_generic_type_early(parent: type[BaseModel], typevar_values: Any) -> type[BaseModel] | None: + """The use of a two-stage cache lookup approach was necessary to have the highest performance possible for + repeated calls to `__class_getitem__` on generic types (which may happen in tighter loops during runtime), + while still ensuring that certain alternative parametrizations ultimately resolve to the same type. + + As a concrete example, this approach was necessary to make Model[List[T]][int] equal to Model[List[int]]. + The approach could be modified to not use two different cache keys at different points, but the + _early_cache_key is optimized to be as quick to compute as possible (for repeated-access speed), and the + _late_cache_key is optimized to be as "correct" as possible, so that two types that will ultimately be the + same after resolving the type arguments will always produce cache hits. + + If we wanted to move to only using a single cache key per type, we would either need to always use the + slower/more computationally intensive logic associated with _late_cache_key, or would need to accept + that Model[List[T]][int] is a different type than Model[List[T]][int]. Because we rely on subclass relationships + during validation, I think it is worthwhile to ensure that types that are functionally equivalent are actually + equal. + """ + generic_types_cache = _GENERIC_TYPES_CACHE.get() + if generic_types_cache is None: + generic_types_cache = GenericTypesCache() + _GENERIC_TYPES_CACHE.set(generic_types_cache) + return generic_types_cache.get(_early_cache_key(parent, typevar_values)) + + +def get_cached_generic_type_late( + parent: type[BaseModel], typevar_values: Any, origin: type[BaseModel], args: tuple[Any, ...] +) -> type[BaseModel] | None: + """See the docstring of `get_cached_generic_type_early` for more information about the two-stage cache lookup.""" + generic_types_cache = _GENERIC_TYPES_CACHE.get() + if ( + generic_types_cache is None + ): # pragma: no cover (early cache is guaranteed to run first and initialize the cache) + generic_types_cache = GenericTypesCache() + _GENERIC_TYPES_CACHE.set(generic_types_cache) + cached = generic_types_cache.get(_late_cache_key(origin, args, typevar_values)) + if cached is not None: + set_cached_generic_type(parent, typevar_values, cached, origin, args) + return cached + + +def set_cached_generic_type( + parent: type[BaseModel], + typevar_values: tuple[Any, ...], + type_: type[BaseModel], + origin: type[BaseModel] | None = None, + args: tuple[Any, ...] | None = None, +) -> None: + """See the docstring of `get_cached_generic_type_early` for more information about why items are cached with + two different keys. + """ + generic_types_cache = _GENERIC_TYPES_CACHE.get() + if ( + generic_types_cache is None + ): # pragma: no cover (cache lookup is guaranteed to run first and initialize the cache) + generic_types_cache = GenericTypesCache() + _GENERIC_TYPES_CACHE.set(generic_types_cache) + generic_types_cache[_early_cache_key(parent, typevar_values)] = type_ + if len(typevar_values) == 1: + generic_types_cache[_early_cache_key(parent, typevar_values[0])] = type_ + if origin and args: + generic_types_cache[_late_cache_key(origin, args, typevar_values)] = type_ + + +def _union_orderings_key(typevar_values: Any) -> Any: + """This is intended to help differentiate between Union types with the same arguments in different order. + + Thanks to caching internal to the `typing` module, it is not possible to distinguish between + List[Union[int, float]] and List[Union[float, int]] (and similarly for other "parent" origins besides List) + because `typing` considers Union[int, float] to be equal to Union[float, int]. + + However, you _can_ distinguish between (top-level) Union[int, float] vs. Union[float, int]. + Because we parse items as the first Union type that is successful, we get slightly more consistent behavior + if we make an effort to distinguish the ordering of items in a union. It would be best if we could _always_ + get the exact-correct order of items in the union, but that would require a change to the `typing` module itself. + (See https://github.com/python/cpython/issues/86483 for reference.) + """ + if isinstance(typevar_values, tuple): + args_data = [] + for value in typevar_values: + args_data.append(_union_orderings_key(value)) + return tuple(args_data) + elif typing_objects.is_union(typing_extensions.get_origin(typevar_values)): + return get_args(typevar_values) + else: + return () + + +def _early_cache_key(cls: type[BaseModel], typevar_values: Any) -> GenericTypesCacheKey: + """This is intended for minimal computational overhead during lookups of cached types. + + Note that this is overly simplistic, and it's possible that two different cls/typevar_values + inputs would ultimately result in the same type being created in BaseModel.__class_getitem__. + To handle this, we have a fallback _late_cache_key that is checked later if the _early_cache_key + lookup fails, and should result in a cache hit _precisely_ when the inputs to __class_getitem__ + would result in the same type. + """ + return cls, typevar_values, _union_orderings_key(typevar_values) + + +def _late_cache_key(origin: type[BaseModel], args: tuple[Any, ...], typevar_values: Any) -> GenericTypesCacheKey: + """This is intended for use later in the process of creating a new type, when we have more information + about the exact args that will be passed. If it turns out that a different set of inputs to + __class_getitem__ resulted in the same inputs to the generic type creation process, we can still + return the cached type, and update the cache with the _early_cache_key as well. + """ + # The _union_orderings_key is placed at the start here to ensure there cannot be a collision with an + # _early_cache_key, as that function will always produce a BaseModel subclass as the first item in the key, + # whereas this function will always produce a tuple as the first item in the key. + return _union_orderings_key(typevar_values), origin, args diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_git.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_git.py new file mode 100644 index 0000000000000000000000000000000000000000..96dcda28f801cd19989838b029f6f2b250dedc52 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_git.py @@ -0,0 +1,27 @@ +"""Git utilities, adopted from mypy's git utilities (https://github.com/python/mypy/blob/master/mypy/git.py).""" + +from __future__ import annotations + +import subprocess +from pathlib import Path + + +def is_git_repo(dir: Path) -> bool: + """Is the given directory version-controlled with git?""" + return dir.joinpath('.git').exists() + + +def have_git() -> bool: # pragma: no cover + """Can we run the git executable?""" + try: + subprocess.check_output(['git', '--help']) + return True + except subprocess.CalledProcessError: + return False + except OSError: + return False + + +def git_revision(dir: Path) -> str: + """Get the SHA-1 of the HEAD of a git repository.""" + return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], cwd=dir).decode('utf-8').strip() diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_import_utils.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_import_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..638102f771dd674799255cc6ef69cacb2c184d13 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_import_utils.py @@ -0,0 +1,20 @@ +from functools import cache +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from pydantic import BaseModel + from pydantic.fields import FieldInfo + + +@cache +def import_cached_base_model() -> type['BaseModel']: + from pydantic import BaseModel + + return BaseModel + + +@cache +def import_cached_field_info() -> type['FieldInfo']: + from pydantic.fields import FieldInfo + + return FieldInfo diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_internal_dataclass.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_internal_dataclass.py new file mode 100644 index 0000000000000000000000000000000000000000..33e152cc8d178486ef016285855495a86d5991d8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_internal_dataclass.py @@ -0,0 +1,7 @@ +import sys + +# `slots` is available on Python >= 3.10 +if sys.version_info >= (3, 10): + slots_true = {'slots': True} +else: + slots_true = {} diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_known_annotated_metadata.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_known_annotated_metadata.py new file mode 100644 index 0000000000000000000000000000000000000000..c127e27ac16af910d03b4d92934a89b40cb53d3f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_known_annotated_metadata.py @@ -0,0 +1,393 @@ +from __future__ import annotations + +from collections import defaultdict +from collections.abc import Iterable +from copy import copy +from functools import lru_cache, partial +from typing import TYPE_CHECKING, Any + +from pydantic_core import CoreSchema, PydanticCustomError, ValidationError, to_jsonable_python +from pydantic_core import core_schema as cs + +from ._fields import PydanticMetadata +from ._import_utils import import_cached_field_info + +if TYPE_CHECKING: + pass + +STRICT = {'strict'} +FAIL_FAST = {'fail_fast'} +LENGTH_CONSTRAINTS = {'min_length', 'max_length'} +INEQUALITY = {'le', 'ge', 'lt', 'gt'} +NUMERIC_CONSTRAINTS = {'multiple_of', *INEQUALITY} +ALLOW_INF_NAN = {'allow_inf_nan'} + +STR_CONSTRAINTS = { + *LENGTH_CONSTRAINTS, + *STRICT, + 'strip_whitespace', + 'to_lower', + 'to_upper', + 'pattern', + 'coerce_numbers_to_str', +} +BYTES_CONSTRAINTS = {*LENGTH_CONSTRAINTS, *STRICT} + +LIST_CONSTRAINTS = {*LENGTH_CONSTRAINTS, *STRICT, *FAIL_FAST} +TUPLE_CONSTRAINTS = {*LENGTH_CONSTRAINTS, *STRICT, *FAIL_FAST} +SET_CONSTRAINTS = {*LENGTH_CONSTRAINTS, *STRICT, *FAIL_FAST} +DICT_CONSTRAINTS = {*LENGTH_CONSTRAINTS, *STRICT} +GENERATOR_CONSTRAINTS = {*LENGTH_CONSTRAINTS, *STRICT} +SEQUENCE_CONSTRAINTS = {*LENGTH_CONSTRAINTS, *FAIL_FAST} + +FLOAT_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *ALLOW_INF_NAN, *STRICT} +DECIMAL_CONSTRAINTS = {'max_digits', 'decimal_places', *FLOAT_CONSTRAINTS} +INT_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *ALLOW_INF_NAN, *STRICT} +BOOL_CONSTRAINTS = STRICT +UUID_CONSTRAINTS = STRICT + +DATE_TIME_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *STRICT} +TIMEDELTA_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *STRICT} +TIME_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *STRICT} +LAX_OR_STRICT_CONSTRAINTS = STRICT +ENUM_CONSTRAINTS = STRICT +COMPLEX_CONSTRAINTS = STRICT + +UNION_CONSTRAINTS = {'union_mode'} +URL_CONSTRAINTS = { + 'max_length', + 'allowed_schemes', + 'host_required', + 'default_host', + 'default_port', + 'default_path', +} + +TEXT_SCHEMA_TYPES = ('str', 'bytes', 'url', 'multi-host-url') +SEQUENCE_SCHEMA_TYPES = ('list', 'tuple', 'set', 'frozenset', 'generator', *TEXT_SCHEMA_TYPES) +NUMERIC_SCHEMA_TYPES = ('float', 'int', 'date', 'time', 'timedelta', 'datetime') + +CONSTRAINTS_TO_ALLOWED_SCHEMAS: dict[str, set[str]] = defaultdict(set) + +constraint_schema_pairings: list[tuple[set[str], tuple[str, ...]]] = [ + (STR_CONSTRAINTS, TEXT_SCHEMA_TYPES), + (BYTES_CONSTRAINTS, ('bytes',)), + (LIST_CONSTRAINTS, ('list',)), + (TUPLE_CONSTRAINTS, ('tuple',)), + (SET_CONSTRAINTS, ('set', 'frozenset')), + (DICT_CONSTRAINTS, ('dict',)), + (GENERATOR_CONSTRAINTS, ('generator',)), + (FLOAT_CONSTRAINTS, ('float',)), + (INT_CONSTRAINTS, ('int',)), + (DATE_TIME_CONSTRAINTS, ('date', 'time', 'datetime', 'timedelta')), + # TODO: this is a bit redundant, we could probably avoid some of these + (STRICT, (*TEXT_SCHEMA_TYPES, *SEQUENCE_SCHEMA_TYPES, *NUMERIC_SCHEMA_TYPES, 'typed-dict', 'model')), + (UNION_CONSTRAINTS, ('union',)), + (URL_CONSTRAINTS, ('url', 'multi-host-url')), + (BOOL_CONSTRAINTS, ('bool',)), + (UUID_CONSTRAINTS, ('uuid',)), + (LAX_OR_STRICT_CONSTRAINTS, ('lax-or-strict',)), + (ENUM_CONSTRAINTS, ('enum',)), + (DECIMAL_CONSTRAINTS, ('decimal',)), + (COMPLEX_CONSTRAINTS, ('complex',)), +] + +for constraints, schemas in constraint_schema_pairings: + for c in constraints: + CONSTRAINTS_TO_ALLOWED_SCHEMAS[c].update(schemas) + + +def as_jsonable_value(v: Any) -> Any: + if type(v) not in (int, str, float, bytes, bool, type(None)): + return to_jsonable_python(v) + return v + + +def expand_grouped_metadata(annotations: Iterable[Any]) -> Iterable[Any]: + """Expand the annotations. + + Args: + annotations: An iterable of annotations. + + Returns: + An iterable of expanded annotations. + + Example: + ```python + from annotated_types import Ge, Len + + from pydantic._internal._known_annotated_metadata import expand_grouped_metadata + + print(list(expand_grouped_metadata([Ge(4), Len(5)]))) + #> [Ge(ge=4), MinLen(min_length=5)] + ``` + """ + import annotated_types as at + + FieldInfo = import_cached_field_info() + + for annotation in annotations: + if isinstance(annotation, at.GroupedMetadata): + yield from annotation + elif isinstance(annotation, FieldInfo): + yield from annotation.metadata + # this is a bit problematic in that it results in duplicate metadata + # all of our "consumers" can handle it, but it is not ideal + # we probably should split up FieldInfo into: + # - annotated types metadata + # - individual metadata known only to Pydantic + annotation = copy(annotation) + annotation.metadata = [] + yield annotation + else: + yield annotation + + +@lru_cache +def _get_at_to_constraint_map() -> dict[type, str]: + """Return a mapping of annotated types to constraints. + + Normally, we would define a mapping like this in the module scope, but we can't do that + because we don't permit module level imports of `annotated_types`, in an attempt to speed up + the import time of `pydantic`. We still only want to have this dictionary defined in one place, + so we use this function to cache the result. + """ + import annotated_types as at + + return { + at.Gt: 'gt', + at.Ge: 'ge', + at.Lt: 'lt', + at.Le: 'le', + at.MultipleOf: 'multiple_of', + at.MinLen: 'min_length', + at.MaxLen: 'max_length', + } + + +def apply_known_metadata(annotation: Any, schema: CoreSchema) -> CoreSchema | None: # noqa: C901 + """Apply `annotation` to `schema` if it is an annotation we know about (Gt, Le, etc.). + Otherwise return `None`. + + This does not handle all known annotations. If / when it does, it can always + return a CoreSchema and return the unmodified schema if the annotation should be ignored. + + Assumes that GroupedMetadata has already been expanded via `expand_grouped_metadata`. + + Args: + annotation: The annotation. + schema: The schema. + + Returns: + An updated schema with annotation if it is an annotation we know about, `None` otherwise. + + Raises: + PydanticCustomError: If `Predicate` fails. + """ + import annotated_types as at + + from ._validators import NUMERIC_VALIDATOR_LOOKUP, forbid_inf_nan_check + + schema = schema.copy() + schema_update, other_metadata = collect_known_metadata([annotation]) + schema_type = schema['type'] + + chain_schema_constraints: set[str] = { + 'pattern', + 'strip_whitespace', + 'to_lower', + 'to_upper', + 'coerce_numbers_to_str', + } + chain_schema_steps: list[CoreSchema] = [] + + for constraint, value in schema_update.items(): + if constraint not in CONSTRAINTS_TO_ALLOWED_SCHEMAS: + raise ValueError(f'Unknown constraint {constraint}') + allowed_schemas = CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint] + + # if it becomes necessary to handle more than one constraint + # in this recursive case with function-after or function-wrap, we should refactor + # this is a bit challenging because we sometimes want to apply constraints to the inner schema, + # whereas other times we want to wrap the existing schema with a new one that enforces a new constraint. + if schema_type in {'function-before', 'function-wrap', 'function-after'} and constraint == 'strict': + schema['schema'] = apply_known_metadata(annotation, schema['schema']) # type: ignore # schema is function schema + return schema + + # if we're allowed to apply constraint directly to the schema, like le to int, do that + if schema_type in allowed_schemas: + if constraint == 'union_mode' and schema_type == 'union': + schema['mode'] = value # type: ignore # schema is UnionSchema + else: + schema[constraint] = value + continue + + # else, apply a function after validator to the schema to enforce the corresponding constraint + if constraint in chain_schema_constraints: + + def _apply_constraint_with_incompatibility_info( + value: Any, handler: cs.ValidatorFunctionWrapHandler + ) -> Any: + try: + x = handler(value) + except ValidationError as ve: + # if the error is about the type, it's likely that the constraint is incompatible the type of the field + # for example, the following invalid schema wouldn't be caught during schema build, but rather at this point + # with a cryptic 'string_type' error coming from the string validator, + # that we'd rather express as a constraint incompatibility error (TypeError) + # Annotated[list[int], Field(pattern='abc')] + if 'type' in ve.errors()[0]['type']: + raise TypeError( + f"Unable to apply constraint '{constraint}' to supplied value {value} for schema of type '{schema_type}'" # noqa: B023 + ) + raise ve + return x + + chain_schema_steps.append( + cs.no_info_wrap_validator_function( + _apply_constraint_with_incompatibility_info, cs.str_schema(**{constraint: value}) + ) + ) + elif constraint in NUMERIC_VALIDATOR_LOOKUP: + if constraint in LENGTH_CONSTRAINTS: + inner_schema = schema + while inner_schema['type'] in {'function-before', 'function-wrap', 'function-after'}: + inner_schema = inner_schema['schema'] # type: ignore + inner_schema_type = inner_schema['type'] + if inner_schema_type == 'list' or ( + inner_schema_type == 'json-or-python' and inner_schema['json_schema']['type'] == 'list' # type: ignore + ): + js_constraint_key = 'minItems' if constraint == 'min_length' else 'maxItems' + else: + js_constraint_key = 'minLength' if constraint == 'min_length' else 'maxLength' + else: + js_constraint_key = constraint + + schema = cs.no_info_after_validator_function( + partial(NUMERIC_VALIDATOR_LOOKUP[constraint], **{constraint: value}), schema + ) + metadata = schema.get('metadata', {}) + if (existing_json_schema_updates := metadata.get('pydantic_js_updates')) is not None: + metadata['pydantic_js_updates'] = { + **existing_json_schema_updates, + **{js_constraint_key: as_jsonable_value(value)}, + } + else: + metadata['pydantic_js_updates'] = {js_constraint_key: as_jsonable_value(value)} + schema['metadata'] = metadata + elif constraint == 'allow_inf_nan' and value is False: + schema = cs.no_info_after_validator_function( + forbid_inf_nan_check, + schema, + ) + else: + # It's rare that we'd get here, but it's possible if we add a new constraint and forget to handle it + # Most constraint errors are caught at runtime during attempted application + raise RuntimeError(f"Unable to apply constraint '{constraint}' to schema of type '{schema_type}'") + + for annotation in other_metadata: + if (annotation_type := type(annotation)) in (at_to_constraint_map := _get_at_to_constraint_map()): + constraint = at_to_constraint_map[annotation_type] + validator = NUMERIC_VALIDATOR_LOOKUP.get(constraint) + if validator is None: + raise ValueError(f'Unknown constraint {constraint}') + schema = cs.no_info_after_validator_function( + partial(validator, {constraint: getattr(annotation, constraint)}), schema + ) + continue + elif isinstance(annotation, (at.Predicate, at.Not)): + predicate_name = f'{annotation.func.__qualname__}' if hasattr(annotation.func, '__qualname__') else '' + + def val_func(v: Any) -> Any: + predicate_satisfied = annotation.func(v) # noqa: B023 + + # annotation.func may also raise an exception, let it pass through + if isinstance(annotation, at.Predicate): # noqa: B023 + if not predicate_satisfied: + raise PydanticCustomError( + 'predicate_failed', + f'Predicate {predicate_name} failed', # type: ignore # noqa: B023 + ) + else: + if predicate_satisfied: + raise PydanticCustomError( + 'not_operation_failed', + f'Not of {predicate_name} failed', # type: ignore # noqa: B023 + ) + + return v + + schema = cs.no_info_after_validator_function(val_func, schema) + else: + # ignore any other unknown metadata + return None + + if chain_schema_steps: + chain_schema_steps = [schema] + chain_schema_steps + return cs.chain_schema(chain_schema_steps) + + return schema + + +def collect_known_metadata(annotations: Iterable[Any]) -> tuple[dict[str, Any], list[Any]]: + """Split `annotations` into known metadata and unknown annotations. + + Args: + annotations: An iterable of annotations. + + Returns: + A tuple contains a dict of known metadata and a list of unknown annotations. + + Example: + ```python + from annotated_types import Gt, Len + + from pydantic._internal._known_annotated_metadata import collect_known_metadata + + print(collect_known_metadata([Gt(1), Len(42), ...])) + #> ({'gt': 1, 'min_length': 42}, [Ellipsis]) + ``` + """ + annotations = expand_grouped_metadata(annotations) + + res: dict[str, Any] = {} + remaining: list[Any] = [] + + for annotation in annotations: + # isinstance(annotation, PydanticMetadata) also covers ._fields:_PydanticGeneralMetadata + if isinstance(annotation, PydanticMetadata): + res.update(annotation.__dict__) + # we don't use dataclasses.asdict because that recursively calls asdict on the field values + elif (annotation_type := type(annotation)) in (at_to_constraint_map := _get_at_to_constraint_map()): + constraint = at_to_constraint_map[annotation_type] + res[constraint] = getattr(annotation, constraint) + elif isinstance(annotation, type) and issubclass(annotation, PydanticMetadata): + # also support PydanticMetadata classes being used without initialisation, + # e.g. `Annotated[int, Strict]` as well as `Annotated[int, Strict()]` + res.update({k: v for k, v in vars(annotation).items() if not k.startswith('_')}) + else: + remaining.append(annotation) + # Nones can sneak in but pydantic-core will reject them + # it'd be nice to clean things up so we don't put in None (we probably don't _need_ to, it was just easier) + # but this is simple enough to kick that can down the road + res = {k: v for k, v in res.items() if v is not None} + return res, remaining + + +def check_metadata(metadata: dict[str, Any], allowed: Iterable[str], source_type: Any) -> None: + """A small utility function to validate that the given metadata can be applied to the target. + More than saving lines of code, this gives us a consistent error message for all of our internal implementations. + + Args: + metadata: A dict of metadata. + allowed: An iterable of allowed metadata. + source_type: The source type. + + Raises: + TypeError: If there is metadatas that can't be applied on source type. + """ + unknown = metadata.keys() - set(allowed) + if unknown: + raise TypeError( + f'The following constraints cannot be applied to {source_type!r}: {", ".join([f"{k!r}" for k in unknown])}' + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_mock_val_ser.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_mock_val_ser.py new file mode 100644 index 0000000000000000000000000000000000000000..9125ab32e5348b6e873c4b1939a887ebde35d97a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_mock_val_ser.py @@ -0,0 +1,228 @@ +from __future__ import annotations + +from collections.abc import Iterator, Mapping +from typing import TYPE_CHECKING, Any, Callable, Generic, Literal, TypeVar, Union + +from pydantic_core import CoreSchema, SchemaSerializer, SchemaValidator + +from ..errors import PydanticErrorCodes, PydanticUserError +from ..plugin._schema_validator import PluggableSchemaValidator + +if TYPE_CHECKING: + from ..dataclasses import PydanticDataclass + from ..main import BaseModel + from ..type_adapter import TypeAdapter + + +ValSer = TypeVar('ValSer', bound=Union[SchemaValidator, PluggableSchemaValidator, SchemaSerializer]) +T = TypeVar('T') + + +class MockCoreSchema(Mapping[str, Any]): + """Mocker for `pydantic_core.CoreSchema` which optionally attempts to + rebuild the thing it's mocking when one of its methods is accessed and raises an error if that fails. + """ + + __slots__ = '_error_message', '_code', '_attempt_rebuild', '_built_memo' + + def __init__( + self, + error_message: str, + *, + code: PydanticErrorCodes, + attempt_rebuild: Callable[[], CoreSchema | None] | None = None, + ) -> None: + self._error_message = error_message + self._code: PydanticErrorCodes = code + self._attempt_rebuild = attempt_rebuild + self._built_memo: CoreSchema | None = None + + def __getitem__(self, key: str) -> Any: + return self._get_built().__getitem__(key) + + def __len__(self) -> int: + return self._get_built().__len__() + + def __iter__(self) -> Iterator[str]: + return self._get_built().__iter__() + + def _get_built(self) -> CoreSchema: + if self._built_memo is not None: + return self._built_memo + + if self._attempt_rebuild: + schema = self._attempt_rebuild() + if schema is not None: + self._built_memo = schema + return schema + raise PydanticUserError(self._error_message, code=self._code) + + def rebuild(self) -> CoreSchema | None: + self._built_memo = None + if self._attempt_rebuild: + schema = self._attempt_rebuild() + if schema is not None: + return schema + else: + raise PydanticUserError(self._error_message, code=self._code) + return None + + +class MockValSer(Generic[ValSer]): + """Mocker for `pydantic_core.SchemaValidator` or `pydantic_core.SchemaSerializer` which optionally attempts to + rebuild the thing it's mocking when one of its methods is accessed and raises an error if that fails. + """ + + __slots__ = '_error_message', '_code', '_val_or_ser', '_attempt_rebuild' + + def __init__( + self, + error_message: str, + *, + code: PydanticErrorCodes, + val_or_ser: Literal['validator', 'serializer'], + attempt_rebuild: Callable[[], ValSer | None] | None = None, + ) -> None: + self._error_message = error_message + self._val_or_ser = SchemaValidator if val_or_ser == 'validator' else SchemaSerializer + self._code: PydanticErrorCodes = code + self._attempt_rebuild = attempt_rebuild + + def __getattr__(self, item: str) -> None: + __tracebackhide__ = True + if self._attempt_rebuild: + val_ser = self._attempt_rebuild() + if val_ser is not None: + return getattr(val_ser, item) + + # raise an AttributeError if `item` doesn't exist + getattr(self._val_or_ser, item) + raise PydanticUserError(self._error_message, code=self._code) + + def rebuild(self) -> ValSer | None: + if self._attempt_rebuild: + val_ser = self._attempt_rebuild() + if val_ser is not None: + return val_ser + else: + raise PydanticUserError(self._error_message, code=self._code) + return None + + +def set_type_adapter_mocks(adapter: TypeAdapter) -> None: + """Set `core_schema`, `validator` and `serializer` to mock core types on a type adapter instance. + + Args: + adapter: The type adapter instance to set the mocks on + """ + type_repr = str(adapter._type) + undefined_type_error_message = ( + f'`TypeAdapter[{type_repr}]` is not fully defined; you should define `{type_repr}` and all referenced types,' + f' then call `.rebuild()` on the instance.' + ) + + def attempt_rebuild_fn(attr_fn: Callable[[TypeAdapter], T]) -> Callable[[], T | None]: + def handler() -> T | None: + if adapter.rebuild(raise_errors=False, _parent_namespace_depth=5) is not False: + return attr_fn(adapter) + return None + + return handler + + adapter.core_schema = MockCoreSchema( # pyright: ignore[reportAttributeAccessIssue] + undefined_type_error_message, + code='class-not-fully-defined', + attempt_rebuild=attempt_rebuild_fn(lambda ta: ta.core_schema), + ) + adapter.validator = MockValSer( # pyright: ignore[reportAttributeAccessIssue] + undefined_type_error_message, + code='class-not-fully-defined', + val_or_ser='validator', + attempt_rebuild=attempt_rebuild_fn(lambda ta: ta.validator), + ) + adapter.serializer = MockValSer( # pyright: ignore[reportAttributeAccessIssue] + undefined_type_error_message, + code='class-not-fully-defined', + val_or_ser='serializer', + attempt_rebuild=attempt_rebuild_fn(lambda ta: ta.serializer), + ) + + +def set_model_mocks(cls: type[BaseModel], undefined_name: str = 'all referenced types') -> None: + """Set `__pydantic_core_schema__`, `__pydantic_validator__` and `__pydantic_serializer__` to mock core types on a model. + + Args: + cls: The model class to set the mocks on + undefined_name: Name of the undefined thing, used in error messages + """ + undefined_type_error_message = ( + f'`{cls.__name__}` is not fully defined; you should define {undefined_name},' + f' then call `{cls.__name__}.model_rebuild()`.' + ) + + def attempt_rebuild_fn(attr_fn: Callable[[type[BaseModel]], T]) -> Callable[[], T | None]: + def handler() -> T | None: + if cls.model_rebuild(raise_errors=False, _parent_namespace_depth=5) is not False: + return attr_fn(cls) + return None + + return handler + + cls.__pydantic_core_schema__ = MockCoreSchema( # pyright: ignore[reportAttributeAccessIssue] + undefined_type_error_message, + code='class-not-fully-defined', + attempt_rebuild=attempt_rebuild_fn(lambda c: c.__pydantic_core_schema__), + ) + cls.__pydantic_validator__ = MockValSer( # pyright: ignore[reportAttributeAccessIssue] + undefined_type_error_message, + code='class-not-fully-defined', + val_or_ser='validator', + attempt_rebuild=attempt_rebuild_fn(lambda c: c.__pydantic_validator__), + ) + cls.__pydantic_serializer__ = MockValSer( # pyright: ignore[reportAttributeAccessIssue] + undefined_type_error_message, + code='class-not-fully-defined', + val_or_ser='serializer', + attempt_rebuild=attempt_rebuild_fn(lambda c: c.__pydantic_serializer__), + ) + + +def set_dataclass_mocks(cls: type[PydanticDataclass], undefined_name: str = 'all referenced types') -> None: + """Set `__pydantic_validator__` and `__pydantic_serializer__` to `MockValSer`s on a dataclass. + + Args: + cls: The model class to set the mocks on + undefined_name: Name of the undefined thing, used in error messages + """ + from ..dataclasses import rebuild_dataclass + + undefined_type_error_message = ( + f'`{cls.__name__}` is not fully defined; you should define {undefined_name},' + f' then call `pydantic.dataclasses.rebuild_dataclass({cls.__name__})`.' + ) + + def attempt_rebuild_fn(attr_fn: Callable[[type[PydanticDataclass]], T]) -> Callable[[], T | None]: + def handler() -> T | None: + if rebuild_dataclass(cls, raise_errors=False, _parent_namespace_depth=5) is not False: + return attr_fn(cls) + return None + + return handler + + cls.__pydantic_core_schema__ = MockCoreSchema( # pyright: ignore[reportAttributeAccessIssue] + undefined_type_error_message, + code='class-not-fully-defined', + attempt_rebuild=attempt_rebuild_fn(lambda c: c.__pydantic_core_schema__), + ) + cls.__pydantic_validator__ = MockValSer( # pyright: ignore[reportAttributeAccessIssue] + undefined_type_error_message, + code='class-not-fully-defined', + val_or_ser='validator', + attempt_rebuild=attempt_rebuild_fn(lambda c: c.__pydantic_validator__), + ) + cls.__pydantic_serializer__ = MockValSer( # pyright: ignore[reportAttributeAccessIssue] + undefined_type_error_message, + code='class-not-fully-defined', + val_or_ser='serializer', + attempt_rebuild=attempt_rebuild_fn(lambda c: c.__pydantic_serializer__), + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py new file mode 100644 index 0000000000000000000000000000000000000000..fd5d68b37f73060060db2f59bd7e9ed66f09d576 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py @@ -0,0 +1,792 @@ +"""Private logic for creating models.""" + +from __future__ import annotations as _annotations + +import builtins +import operator +import sys +import typing +import warnings +import weakref +from abc import ABCMeta +from functools import cache, partial, wraps +from types import FunctionType +from typing import Any, Callable, Generic, Literal, NoReturn, cast + +from pydantic_core import PydanticUndefined, SchemaSerializer +from typing_extensions import TypeAliasType, dataclass_transform, deprecated, get_args, get_origin +from typing_inspection import typing_objects + +from ..errors import PydanticUndefinedAnnotation, PydanticUserError +from ..plugin._schema_validator import create_schema_validator +from ..warnings import GenericBeforeBaseModelWarning, PydanticDeprecatedSince20 +from ._config import ConfigWrapper +from ._decorators import DecoratorInfos, PydanticDescriptorProxy, get_attribute_from_bases, unwrap_wrapped_function +from ._fields import collect_model_fields, is_valid_field_name, is_valid_privateattr_name +from ._generate_schema import GenerateSchema, InvalidSchemaError +from ._generics import PydanticGenericMetadata, get_model_typevars_map +from ._import_utils import import_cached_base_model, import_cached_field_info +from ._mock_val_ser import set_model_mocks +from ._namespace_utils import NsResolver +from ._signature import generate_pydantic_signature +from ._typing_extra import ( + _make_forward_ref, + eval_type_backport, + is_classvar_annotation, + parent_frame_namespace, +) +from ._utils import LazyClassAttribute, SafeGetItemProxy + +if typing.TYPE_CHECKING: + from ..fields import Field as PydanticModelField + from ..fields import FieldInfo, ModelPrivateAttr + from ..fields import PrivateAttr as PydanticModelPrivateAttr + from ..main import BaseModel +else: + # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915 + # and https://youtrack.jetbrains.com/issue/PY-51428 + DeprecationWarning = PydanticDeprecatedSince20 + PydanticModelField = object() + PydanticModelPrivateAttr = object() + +object_setattr = object.__setattr__ + + +class _ModelNamespaceDict(dict): + """A dictionary subclass that intercepts attribute setting on model classes and + warns about overriding of decorators. + """ + + def __setitem__(self, k: str, v: object) -> None: + existing: Any = self.get(k, None) + if existing and v is not existing and isinstance(existing, PydanticDescriptorProxy): + warnings.warn(f'`{k}` overrides an existing Pydantic `{existing.decorator_info.decorator_repr}` decorator') + + return super().__setitem__(k, v) + + +def NoInitField( + *, + init: Literal[False] = False, +) -> Any: + """Only for typing purposes. Used as default value of `__pydantic_fields_set__`, + `__pydantic_extra__`, `__pydantic_private__`, so they could be ignored when + synthesizing the `__init__` signature. + """ + + +@dataclass_transform(kw_only_default=True, field_specifiers=(PydanticModelField, PydanticModelPrivateAttr, NoInitField)) +class ModelMetaclass(ABCMeta): + def __new__( + mcs, + cls_name: str, + bases: tuple[type[Any], ...], + namespace: dict[str, Any], + __pydantic_generic_metadata__: PydanticGenericMetadata | None = None, + __pydantic_reset_parent_namespace__: bool = True, + _create_model_module: str | None = None, + **kwargs: Any, + ) -> type: + """Metaclass for creating Pydantic models. + + Args: + cls_name: The name of the class to be created. + bases: The base classes of the class to be created. + namespace: The attribute dictionary of the class to be created. + __pydantic_generic_metadata__: Metadata for generic models. + __pydantic_reset_parent_namespace__: Reset parent namespace. + _create_model_module: The module of the class to be created, if created by `create_model`. + **kwargs: Catch-all for any other keyword arguments. + + Returns: + The new class created by the metaclass. + """ + # Note `ModelMetaclass` refers to `BaseModel`, but is also used to *create* `BaseModel`, so we rely on the fact + # that `BaseModel` itself won't have any bases, but any subclass of it will, to determine whether the `__new__` + # call we're in the middle of is for the `BaseModel` class. + if bases: + base_field_names, class_vars, base_private_attributes = mcs._collect_bases_data(bases) + + config_wrapper = ConfigWrapper.for_model(bases, namespace, kwargs) + namespace['model_config'] = config_wrapper.config_dict + private_attributes = inspect_namespace( + namespace, config_wrapper.ignored_types, class_vars, base_field_names + ) + if private_attributes or base_private_attributes: + original_model_post_init = get_model_post_init(namespace, bases) + if original_model_post_init is not None: + # if there are private_attributes and a model_post_init function, we handle both + + @wraps(original_model_post_init) + def wrapped_model_post_init(self: BaseModel, context: Any, /) -> None: + """We need to both initialize private attributes and call the user-defined model_post_init + method. + """ + init_private_attributes(self, context) + original_model_post_init(self, context) + + namespace['model_post_init'] = wrapped_model_post_init + else: + namespace['model_post_init'] = init_private_attributes + + namespace['__class_vars__'] = class_vars + namespace['__private_attributes__'] = {**base_private_attributes, **private_attributes} + + cls = cast('type[BaseModel]', super().__new__(mcs, cls_name, bases, namespace, **kwargs)) + BaseModel_ = import_cached_base_model() + + mro = cls.__mro__ + if Generic in mro and mro.index(Generic) < mro.index(BaseModel_): + warnings.warn( + GenericBeforeBaseModelWarning( + 'Classes should inherit from `BaseModel` before generic classes (e.g. `typing.Generic[T]`) ' + 'for pydantic generics to work properly.' + ), + stacklevel=2, + ) + + cls.__pydantic_custom_init__ = not getattr(cls.__init__, '__pydantic_base_init__', False) + cls.__pydantic_post_init__ = ( + None if cls.model_post_init is BaseModel_.model_post_init else 'model_post_init' + ) + + cls.__pydantic_setattr_handlers__ = {} + + cls.__pydantic_decorators__ = DecoratorInfos.build(cls) + + # Use the getattr below to grab the __parameters__ from the `typing.Generic` parent class + if __pydantic_generic_metadata__: + cls.__pydantic_generic_metadata__ = __pydantic_generic_metadata__ + else: + parent_parameters = getattr(cls, '__pydantic_generic_metadata__', {}).get('parameters', ()) + parameters = getattr(cls, '__parameters__', None) or parent_parameters + if parameters and parent_parameters and not all(x in parameters for x in parent_parameters): + from ..root_model import RootModelRootType + + missing_parameters = tuple(x for x in parameters if x not in parent_parameters) + if RootModelRootType in parent_parameters and RootModelRootType not in parameters: + # This is a special case where the user has subclassed `RootModel`, but has not parametrized + # RootModel with the generic type identifiers being used. Ex: + # class MyModel(RootModel, Generic[T]): + # root: T + # Should instead just be: + # class MyModel(RootModel[T]): + # root: T + parameters_str = ', '.join([x.__name__ for x in missing_parameters]) + error_message = ( + f'{cls.__name__} is a subclass of `RootModel`, but does not include the generic type identifier(s) ' + f'{parameters_str} in its parameters. ' + f'You should parametrize RootModel directly, e.g., `class {cls.__name__}(RootModel[{parameters_str}]): ...`.' + ) + else: + combined_parameters = parent_parameters + missing_parameters + parameters_str = ', '.join([str(x) for x in combined_parameters]) + generic_type_label = f'typing.Generic[{parameters_str}]' + error_message = ( + f'All parameters must be present on typing.Generic;' + f' you should inherit from {generic_type_label}.' + ) + if Generic not in bases: # pragma: no cover + # We raise an error here not because it is desirable, but because some cases are mishandled. + # It would be nice to remove this error and still have things behave as expected, it's just + # challenging because we are using a custom `__class_getitem__` to parametrize generic models, + # and not returning a typing._GenericAlias from it. + bases_str = ', '.join([x.__name__ for x in bases] + [generic_type_label]) + error_message += ( + f' Note: `typing.Generic` must go last: `class {cls.__name__}({bases_str}): ...`)' + ) + raise TypeError(error_message) + + cls.__pydantic_generic_metadata__ = { + 'origin': None, + 'args': (), + 'parameters': parameters, + } + + cls.__pydantic_complete__ = False # Ensure this specific class gets completed + + # preserve `__set_name__` protocol defined in https://peps.python.org/pep-0487 + # for attributes not in `new_namespace` (e.g. private attributes) + for name, obj in private_attributes.items(): + obj.__set_name__(cls, name) + + if __pydantic_reset_parent_namespace__: + cls.__pydantic_parent_namespace__ = build_lenient_weakvaluedict(parent_frame_namespace()) + parent_namespace: dict[str, Any] | None = getattr(cls, '__pydantic_parent_namespace__', None) + if isinstance(parent_namespace, dict): + parent_namespace = unpack_lenient_weakvaluedict(parent_namespace) + + ns_resolver = NsResolver(parent_namespace=parent_namespace) + + set_model_fields(cls, config_wrapper=config_wrapper, ns_resolver=ns_resolver) + + # This is also set in `complete_model_class()`, after schema gen because they are recreated. + # We set them here as well for backwards compatibility: + cls.__pydantic_computed_fields__ = { + k: v.info for k, v in cls.__pydantic_decorators__.computed_fields.items() + } + + if config_wrapper.defer_build: + # TODO we can also stop there if `__pydantic_fields_complete__` is False. + # However, `set_model_fields()` is currently lenient and we don't have access to the `NameError`. + # (which is useful as we can provide the name in the error message: `set_model_mock(cls, e.name)`) + set_model_mocks(cls) + else: + # Any operation that requires accessing the field infos instances should be put inside + # `complete_model_class()`: + complete_model_class( + cls, + config_wrapper, + raise_errors=False, + ns_resolver=ns_resolver, + create_model_module=_create_model_module, + ) + + if config_wrapper.frozen and '__hash__' not in namespace: + set_default_hash_func(cls, bases) + + # using super(cls, cls) on the next line ensures we only call the parent class's __pydantic_init_subclass__ + # I believe the `type: ignore` is only necessary because mypy doesn't realize that this code branch is + # only hit for _proper_ subclasses of BaseModel + super(cls, cls).__pydantic_init_subclass__(**kwargs) # type: ignore[misc] + return cls + else: + # These are instance variables, but have been assigned to `NoInitField` to trick the type checker. + for instance_slot in '__pydantic_fields_set__', '__pydantic_extra__', '__pydantic_private__': + namespace.pop( + instance_slot, + None, # In case the metaclass is used with a class other than `BaseModel`. + ) + namespace.get('__annotations__', {}).clear() + return super().__new__(mcs, cls_name, bases, namespace, **kwargs) + + if not typing.TYPE_CHECKING: # pragma: no branch + # We put `__getattr__` in a non-TYPE_CHECKING block because otherwise, mypy allows arbitrary attribute access + + def __getattr__(self, item: str) -> Any: + """This is necessary to keep attribute access working for class attribute access.""" + private_attributes = self.__dict__.get('__private_attributes__') + if private_attributes and item in private_attributes: + return private_attributes[item] + raise AttributeError(item) + + @classmethod + def __prepare__(cls, *args: Any, **kwargs: Any) -> dict[str, object]: + return _ModelNamespaceDict() + + def __instancecheck__(self, instance: Any) -> bool: + """Avoid calling ABC _abc_instancecheck unless we're pretty sure. + + See #3829 and python/cpython#92810 + """ + return hasattr(instance, '__pydantic_decorators__') and super().__instancecheck__(instance) + + def __subclasscheck__(self, subclass: type[Any]) -> bool: + """Avoid calling ABC _abc_subclasscheck unless we're pretty sure. + + See #3829 and python/cpython#92810 + """ + return hasattr(subclass, '__pydantic_decorators__') and super().__subclasscheck__(subclass) + + @staticmethod + def _collect_bases_data(bases: tuple[type[Any], ...]) -> tuple[set[str], set[str], dict[str, ModelPrivateAttr]]: + BaseModel = import_cached_base_model() + + field_names: set[str] = set() + class_vars: set[str] = set() + private_attributes: dict[str, ModelPrivateAttr] = {} + for base in bases: + if issubclass(base, BaseModel) and base is not BaseModel: + # model_fields might not be defined yet in the case of generics, so we use getattr here: + field_names.update(getattr(base, '__pydantic_fields__', {}).keys()) + class_vars.update(base.__class_vars__) + private_attributes.update(base.__private_attributes__) + return field_names, class_vars, private_attributes + + @property + @deprecated('The `__fields__` attribute is deprecated, use `model_fields` instead.', category=None) + def __fields__(self) -> dict[str, FieldInfo]: + warnings.warn( + 'The `__fields__` attribute is deprecated, use `model_fields` instead.', + PydanticDeprecatedSince20, + stacklevel=2, + ) + return getattr(self, '__pydantic_fields__', {}) + + @property + def __pydantic_fields_complete__(self) -> bool: + """Whether the fields where successfully collected (i.e. type hints were successfully resolves). + + This is a private attribute, not meant to be used outside Pydantic. + """ + if not hasattr(self, '__pydantic_fields__'): + return False + + field_infos = cast('dict[str, FieldInfo]', self.__pydantic_fields__) # pyright: ignore[reportAttributeAccessIssue] + + return all(field_info._complete for field_info in field_infos.values()) + + def __dir__(self) -> list[str]: + attributes = list(super().__dir__()) + if '__fields__' in attributes: + attributes.remove('__fields__') + return attributes + + +def init_private_attributes(self: BaseModel, context: Any, /) -> None: + """This function is meant to behave like a BaseModel method to initialise private attributes. + + It takes context as an argument since that's what pydantic-core passes when calling it. + + Args: + self: The BaseModel instance. + context: The context. + """ + if getattr(self, '__pydantic_private__', None) is None: + pydantic_private = {} + for name, private_attr in self.__private_attributes__.items(): + default = private_attr.get_default() + if default is not PydanticUndefined: + pydantic_private[name] = default + object_setattr(self, '__pydantic_private__', pydantic_private) + + +def get_model_post_init(namespace: dict[str, Any], bases: tuple[type[Any], ...]) -> Callable[..., Any] | None: + """Get the `model_post_init` method from the namespace or the class bases, or `None` if not defined.""" + if 'model_post_init' in namespace: + return namespace['model_post_init'] + + BaseModel = import_cached_base_model() + + model_post_init = get_attribute_from_bases(bases, 'model_post_init') + if model_post_init is not BaseModel.model_post_init: + return model_post_init + + +def inspect_namespace( # noqa C901 + namespace: dict[str, Any], + ignored_types: tuple[type[Any], ...], + base_class_vars: set[str], + base_class_fields: set[str], +) -> dict[str, ModelPrivateAttr]: + """Iterate over the namespace and: + * gather private attributes + * check for items which look like fields but are not (e.g. have no annotation) and warn. + + Args: + namespace: The attribute dictionary of the class to be created. + ignored_types: A tuple of ignore types. + base_class_vars: A set of base class class variables. + base_class_fields: A set of base class fields. + + Returns: + A dict contains private attributes info. + + Raises: + TypeError: If there is a `__root__` field in model. + NameError: If private attribute name is invalid. + PydanticUserError: + - If a field does not have a type annotation. + - If a field on base class was overridden by a non-annotated attribute. + """ + from ..fields import ModelPrivateAttr, PrivateAttr + + FieldInfo = import_cached_field_info() + + all_ignored_types = ignored_types + default_ignored_types() + + private_attributes: dict[str, ModelPrivateAttr] = {} + raw_annotations = namespace.get('__annotations__', {}) + + if '__root__' in raw_annotations or '__root__' in namespace: + raise TypeError("To define root models, use `pydantic.RootModel` rather than a field called '__root__'") + + ignored_names: set[str] = set() + for var_name, value in list(namespace.items()): + if var_name == 'model_config' or var_name == '__pydantic_extra__': + continue + elif ( + isinstance(value, type) + and value.__module__ == namespace['__module__'] + and '__qualname__' in namespace + and value.__qualname__.startswith(namespace['__qualname__']) + ): + # `value` is a nested type defined in this namespace; don't error + continue + elif isinstance(value, all_ignored_types) or value.__class__.__module__ == 'functools': + ignored_names.add(var_name) + continue + elif isinstance(value, ModelPrivateAttr): + if var_name.startswith('__'): + raise NameError( + 'Private attributes must not use dunder names;' + f' use a single underscore prefix instead of {var_name!r}.' + ) + elif is_valid_field_name(var_name): + raise NameError( + 'Private attributes must not use valid field names;' + f' use sunder names, e.g. {"_" + var_name!r} instead of {var_name!r}.' + ) + private_attributes[var_name] = value + del namespace[var_name] + elif isinstance(value, FieldInfo) and not is_valid_field_name(var_name): + suggested_name = var_name.lstrip('_') or 'my_field' # don't suggest '' for all-underscore name + raise NameError( + f'Fields must not use names with leading underscores;' + f' e.g., use {suggested_name!r} instead of {var_name!r}.' + ) + + elif var_name.startswith('__'): + continue + elif is_valid_privateattr_name(var_name): + if var_name not in raw_annotations or not is_classvar_annotation(raw_annotations[var_name]): + private_attributes[var_name] = cast(ModelPrivateAttr, PrivateAttr(default=value)) + del namespace[var_name] + elif var_name in base_class_vars: + continue + elif var_name not in raw_annotations: + if var_name in base_class_fields: + raise PydanticUserError( + f'Field {var_name!r} defined on a base class was overridden by a non-annotated attribute. ' + f'All field definitions, including overrides, require a type annotation.', + code='model-field-overridden', + ) + elif isinstance(value, FieldInfo): + raise PydanticUserError( + f'Field {var_name!r} requires a type annotation', code='model-field-missing-annotation' + ) + else: + raise PydanticUserError( + f'A non-annotated attribute was detected: `{var_name} = {value!r}`. All model fields require a ' + f'type annotation; if `{var_name}` is not meant to be a field, you may be able to resolve this ' + f"error by annotating it as a `ClassVar` or updating `model_config['ignored_types']`.", + code='model-field-missing-annotation', + ) + + for ann_name, ann_type in raw_annotations.items(): + if ( + is_valid_privateattr_name(ann_name) + and ann_name not in private_attributes + and ann_name not in ignored_names + # This condition can be a false negative when `ann_type` is stringified, + # but it is handled in most cases in `set_model_fields`: + and not is_classvar_annotation(ann_type) + and ann_type not in all_ignored_types + and getattr(ann_type, '__module__', None) != 'functools' + ): + if isinstance(ann_type, str): + # Walking up the frames to get the module namespace where the model is defined + # (as the model class wasn't created yet, we unfortunately can't use `cls.__module__`): + frame = sys._getframe(2) + if frame is not None: + try: + ann_type = eval_type_backport( + _make_forward_ref(ann_type, is_argument=False, is_class=True), + globalns=frame.f_globals, + localns=frame.f_locals, + ) + except (NameError, TypeError): + pass + + if typing_objects.is_annotated(get_origin(ann_type)): + _, *metadata = get_args(ann_type) + private_attr = next((v for v in metadata if isinstance(v, ModelPrivateAttr)), None) + if private_attr is not None: + private_attributes[ann_name] = private_attr + continue + private_attributes[ann_name] = PrivateAttr() + + return private_attributes + + +def set_default_hash_func(cls: type[BaseModel], bases: tuple[type[Any], ...]) -> None: + base_hash_func = get_attribute_from_bases(bases, '__hash__') + new_hash_func = make_hash_func(cls) + if base_hash_func in {None, object.__hash__} or getattr(base_hash_func, '__code__', None) == new_hash_func.__code__: + # If `__hash__` is some default, we generate a hash function. + # It will be `None` if not overridden from BaseModel. + # It may be `object.__hash__` if there is another + # parent class earlier in the bases which doesn't override `__hash__` (e.g. `typing.Generic`). + # It may be a value set by `set_default_hash_func` if `cls` is a subclass of another frozen model. + # In the last case we still need a new hash function to account for new `model_fields`. + cls.__hash__ = new_hash_func + + +def make_hash_func(cls: type[BaseModel]) -> Any: + getter = operator.itemgetter(*cls.__pydantic_fields__.keys()) if cls.__pydantic_fields__ else lambda _: 0 + + def hash_func(self: Any) -> int: + try: + return hash(getter(self.__dict__)) + except KeyError: + # In rare cases (such as when using the deprecated copy method), the __dict__ may not contain + # all model fields, which is how we can get here. + # getter(self.__dict__) is much faster than any 'safe' method that accounts for missing keys, + # and wrapping it in a `try` doesn't slow things down much in the common case. + return hash(getter(SafeGetItemProxy(self.__dict__))) + + return hash_func + + +def set_model_fields( + cls: type[BaseModel], + config_wrapper: ConfigWrapper, + ns_resolver: NsResolver | None, +) -> None: + """Collect and set `cls.__pydantic_fields__` and `cls.__class_vars__`. + + Args: + cls: BaseModel or dataclass. + config_wrapper: The config wrapper instance. + ns_resolver: Namespace resolver to use when getting model annotations. + """ + typevars_map = get_model_typevars_map(cls) + fields, class_vars = collect_model_fields(cls, config_wrapper, ns_resolver, typevars_map=typevars_map) + + cls.__pydantic_fields__ = fields + cls.__class_vars__.update(class_vars) + + for k in class_vars: + # Class vars should not be private attributes + # We remove them _here_ and not earlier because we rely on inspecting the class to determine its classvars, + # but private attributes are determined by inspecting the namespace _prior_ to class creation. + # In the case that a classvar with a leading-'_' is defined via a ForwardRef (e.g., when using + # `__future__.annotations`), we want to remove the private attribute which was detected _before_ we knew it + # evaluated to a classvar + + value = cls.__private_attributes__.pop(k, None) + if value is not None and value.default is not PydanticUndefined: + setattr(cls, k, value.default) + + +def complete_model_class( + cls: type[BaseModel], + config_wrapper: ConfigWrapper, + *, + raise_errors: bool = True, + ns_resolver: NsResolver | None = None, + create_model_module: str | None = None, +) -> bool: + """Finish building a model class. + + This logic must be called after class has been created since validation functions must be bound + and `get_type_hints` requires a class object. + + Args: + cls: BaseModel or dataclass. + config_wrapper: The config wrapper instance. + raise_errors: Whether to raise errors. + ns_resolver: The namespace resolver instance to use during schema building. + create_model_module: The module of the class to be created, if created by `create_model`. + + Returns: + `True` if the model is successfully completed, else `False`. + + Raises: + PydanticUndefinedAnnotation: If `PydanticUndefinedAnnotation` occurs in`__get_pydantic_core_schema__` + and `raise_errors=True`. + """ + typevars_map = get_model_typevars_map(cls) + gen_schema = GenerateSchema( + config_wrapper, + ns_resolver, + typevars_map, + ) + + try: + schema = gen_schema.generate_schema(cls) + except PydanticUndefinedAnnotation as e: + if raise_errors: + raise + set_model_mocks(cls, f'`{e.name}`') + return False + + core_config = config_wrapper.core_config(title=cls.__name__) + + try: + schema = gen_schema.clean_schema(schema) + except InvalidSchemaError: + set_model_mocks(cls) + return False + + # This needs to happen *after* model schema generation, as the return type + # of the properties are evaluated and the `ComputedFieldInfo` are recreated: + cls.__pydantic_computed_fields__ = {k: v.info for k, v in cls.__pydantic_decorators__.computed_fields.items()} + + set_deprecated_descriptors(cls) + + cls.__pydantic_core_schema__ = schema + + cls.__pydantic_validator__ = create_schema_validator( + schema, + cls, + create_model_module or cls.__module__, + cls.__qualname__, + 'create_model' if create_model_module else 'BaseModel', + core_config, + config_wrapper.plugin_settings, + ) + cls.__pydantic_serializer__ = SchemaSerializer(schema, core_config) + cls.__pydantic_complete__ = True + + # set __signature__ attr only for model class, but not for its instances + # (because instances can define `__call__`, and `inspect.signature` shouldn't + # use the `__signature__` attribute and instead generate from `__call__`). + cls.__signature__ = LazyClassAttribute( + '__signature__', + partial( + generate_pydantic_signature, + init=cls.__init__, + fields=cls.__pydantic_fields__, + validate_by_name=config_wrapper.validate_by_name, + extra=config_wrapper.extra, + ), + ) + return True + + +def set_deprecated_descriptors(cls: type[BaseModel]) -> None: + """Set data descriptors on the class for deprecated fields.""" + for field, field_info in cls.__pydantic_fields__.items(): + if (msg := field_info.deprecation_message) is not None: + desc = _DeprecatedFieldDescriptor(msg) + desc.__set_name__(cls, field) + setattr(cls, field, desc) + + for field, computed_field_info in cls.__pydantic_computed_fields__.items(): + if ( + (msg := computed_field_info.deprecation_message) is not None + # Avoid having two warnings emitted: + and not hasattr(unwrap_wrapped_function(computed_field_info.wrapped_property), '__deprecated__') + ): + desc = _DeprecatedFieldDescriptor(msg, computed_field_info.wrapped_property) + desc.__set_name__(cls, field) + setattr(cls, field, desc) + + +class _DeprecatedFieldDescriptor: + """Read-only data descriptor used to emit a runtime deprecation warning before accessing a deprecated field. + + Attributes: + msg: The deprecation message to be emitted. + wrapped_property: The property instance if the deprecated field is a computed field, or `None`. + field_name: The name of the field being deprecated. + """ + + field_name: str + + def __init__(self, msg: str, wrapped_property: property | None = None) -> None: + self.msg = msg + self.wrapped_property = wrapped_property + + def __set_name__(self, cls: type[BaseModel], name: str) -> None: + self.field_name = name + + def __get__(self, obj: BaseModel | None, obj_type: type[BaseModel] | None = None) -> Any: + if obj is None: + if self.wrapped_property is not None: + return self.wrapped_property.__get__(None, obj_type) + raise AttributeError(self.field_name) + + warnings.warn(self.msg, builtins.DeprecationWarning, stacklevel=2) + + if self.wrapped_property is not None: + return self.wrapped_property.__get__(obj, obj_type) + return obj.__dict__[self.field_name] + + # Defined to make it a data descriptor and take precedence over the instance's dictionary. + # Note that it will not be called when setting a value on a model instance + # as `BaseModel.__setattr__` is defined and takes priority. + def __set__(self, obj: Any, value: Any) -> NoReturn: + raise AttributeError(self.field_name) + + +class _PydanticWeakRef: + """Wrapper for `weakref.ref` that enables `pickle` serialization. + + Cloudpickle fails to serialize `weakref.ref` objects due to an arcane error related + to abstract base classes (`abc.ABC`). This class works around the issue by wrapping + `weakref.ref` instead of subclassing it. + + See https://github.com/pydantic/pydantic/issues/6763 for context. + + Semantics: + - If not pickled, behaves the same as a `weakref.ref`. + - If pickled along with the referenced object, the same `weakref.ref` behavior + will be maintained between them after unpickling. + - If pickled without the referenced object, after unpickling the underlying + reference will be cleared (`__call__` will always return `None`). + """ + + def __init__(self, obj: Any): + if obj is None: + # The object will be `None` upon deserialization if the serialized weakref + # had lost its underlying object. + self._wr = None + else: + self._wr = weakref.ref(obj) + + def __call__(self) -> Any: + if self._wr is None: + return None + else: + return self._wr() + + def __reduce__(self) -> tuple[Callable, tuple[weakref.ReferenceType | None]]: + return _PydanticWeakRef, (self(),) + + +def build_lenient_weakvaluedict(d: dict[str, Any] | None) -> dict[str, Any] | None: + """Takes an input dictionary, and produces a new value that (invertibly) replaces the values with weakrefs. + + We can't just use a WeakValueDictionary because many types (including int, str, etc.) can't be stored as values + in a WeakValueDictionary. + + The `unpack_lenient_weakvaluedict` function can be used to reverse this operation. + """ + if d is None: + return None + result = {} + for k, v in d.items(): + try: + proxy = _PydanticWeakRef(v) + except TypeError: + proxy = v + result[k] = proxy + return result + + +def unpack_lenient_weakvaluedict(d: dict[str, Any] | None) -> dict[str, Any] | None: + """Inverts the transform performed by `build_lenient_weakvaluedict`.""" + if d is None: + return None + + result = {} + for k, v in d.items(): + if isinstance(v, _PydanticWeakRef): + v = v() + if v is not None: + result[k] = v + else: + result[k] = v + return result + + +@cache +def default_ignored_types() -> tuple[type[Any], ...]: + from ..fields import ComputedFieldInfo + + ignored_types = [ + FunctionType, + property, + classmethod, + staticmethod, + PydanticDescriptorProxy, + ComputedFieldInfo, + TypeAliasType, # from `typing_extensions` + ] + + if sys.version_info >= (3, 12): + ignored_types.append(typing.TypeAliasType) + + return tuple(ignored_types) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_namespace_utils.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_namespace_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..781dfa2d7c489d3a5ec207a63522e771d3cef22a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_namespace_utils.py @@ -0,0 +1,293 @@ +from __future__ import annotations + +import sys +from collections.abc import Generator, Iterator, Mapping +from contextlib import contextmanager +from functools import cached_property +from typing import Any, Callable, NamedTuple, TypeVar + +from typing_extensions import ParamSpec, TypeAlias, TypeAliasType, TypeVarTuple + +GlobalsNamespace: TypeAlias = 'dict[str, Any]' +"""A global namespace. + +In most cases, this is a reference to the `__dict__` attribute of a module. +This namespace type is expected as the `globals` argument during annotations evaluation. +""" + +MappingNamespace: TypeAlias = Mapping[str, Any] +"""Any kind of namespace. + +In most cases, this is a local namespace (e.g. the `__dict__` attribute of a class, +the [`f_locals`][frame.f_locals] attribute of a frame object, when dealing with types +defined inside functions). +This namespace type is expected as the `locals` argument during annotations evaluation. +""" + +_TypeVarLike: TypeAlias = 'TypeVar | ParamSpec | TypeVarTuple' + + +class NamespacesTuple(NamedTuple): + """A tuple of globals and locals to be used during annotations evaluation. + + This datastructure is defined as a named tuple so that it can easily be unpacked: + + ```python {lint="skip" test="skip"} + def eval_type(typ: type[Any], ns: NamespacesTuple) -> None: + return eval(typ, *ns) + ``` + """ + + globals: GlobalsNamespace + """The namespace to be used as the `globals` argument during annotations evaluation.""" + + locals: MappingNamespace + """The namespace to be used as the `locals` argument during annotations evaluation.""" + + +def get_module_ns_of(obj: Any) -> dict[str, Any]: + """Get the namespace of the module where the object is defined. + + Caution: this function does not return a copy of the module namespace, so the result + should not be mutated. The burden of enforcing this is on the caller. + """ + module_name = getattr(obj, '__module__', None) + if module_name: + try: + return sys.modules[module_name].__dict__ + except KeyError: + # happens occasionally, see https://github.com/pydantic/pydantic/issues/2363 + return {} + return {} + + +# Note that this class is almost identical to `collections.ChainMap`, but need to enforce +# immutable mappings here: +class LazyLocalNamespace(Mapping[str, Any]): + """A lazily evaluated mapping, to be used as the `locals` argument during annotations evaluation. + + While the [`eval`][eval] function expects a mapping as the `locals` argument, it only + performs `__getitem__` calls. The [`Mapping`][collections.abc.Mapping] abstract base class + is fully implemented only for type checking purposes. + + Args: + *namespaces: The namespaces to consider, in ascending order of priority. + + Example: + ```python {lint="skip" test="skip"} + ns = LazyLocalNamespace({'a': 1, 'b': 2}, {'a': 3}) + ns['a'] + #> 3 + ns['b'] + #> 2 + ``` + """ + + def __init__(self, *namespaces: MappingNamespace) -> None: + self._namespaces = namespaces + + @cached_property + def data(self) -> dict[str, Any]: + return {k: v for ns in self._namespaces for k, v in ns.items()} + + def __len__(self) -> int: + return len(self.data) + + def __getitem__(self, key: str) -> Any: + return self.data[key] + + def __contains__(self, key: object) -> bool: + return key in self.data + + def __iter__(self) -> Iterator[str]: + return iter(self.data) + + +def ns_for_function(obj: Callable[..., Any], parent_namespace: MappingNamespace | None = None) -> NamespacesTuple: + """Return the global and local namespaces to be used when evaluating annotations for the provided function. + + The global namespace will be the `__dict__` attribute of the module the function was defined in. + The local namespace will contain the `__type_params__` introduced by PEP 695. + + Args: + obj: The object to use when building namespaces. + parent_namespace: Optional namespace to be added with the lowest priority in the local namespace. + If the passed function is a method, the `parent_namespace` will be the namespace of the class + the method is defined in. Thus, we also fetch type `__type_params__` from there (i.e. the + class-scoped type variables). + """ + locals_list: list[MappingNamespace] = [] + if parent_namespace is not None: + locals_list.append(parent_namespace) + + # Get the `__type_params__` attribute introduced by PEP 695. + # Note that the `typing._eval_type` function expects type params to be + # passed as a separate argument. However, internally, `_eval_type` calls + # `ForwardRef._evaluate` which will merge type params with the localns, + # essentially mimicking what we do here. + type_params: tuple[_TypeVarLike, ...] = getattr(obj, '__type_params__', ()) + if parent_namespace is not None: + # We also fetch type params from the parent namespace. If present, it probably + # means the function was defined in a class. This is to support the following: + # https://github.com/python/cpython/issues/124089. + type_params += parent_namespace.get('__type_params__', ()) + + locals_list.append({t.__name__: t for t in type_params}) + + # What about short-cirtuiting to `obj.__globals__`? + globalns = get_module_ns_of(obj) + + return NamespacesTuple(globalns, LazyLocalNamespace(*locals_list)) + + +class NsResolver: + """A class responsible for the namespaces resolving logic for annotations evaluation. + + This class handles the namespace logic when evaluating annotations mainly for class objects. + + It holds a stack of classes that are being inspected during the core schema building, + and the `types_namespace` property exposes the globals and locals to be used for + type annotation evaluation. Additionally -- if no class is present in the stack -- a + fallback globals and locals can be provided using the `namespaces_tuple` argument + (this is useful when generating a schema for a simple annotation, e.g. when using + `TypeAdapter`). + + The namespace creation logic is unfortunately flawed in some cases, for backwards + compatibility reasons and to better support valid edge cases. See the description + for the `parent_namespace` argument and the example for more details. + + Args: + namespaces_tuple: The default globals and locals to use if no class is present + on the stack. This can be useful when using the `GenerateSchema` class + with `TypeAdapter`, where the "type" being analyzed is a simple annotation. + parent_namespace: An optional parent namespace that will be added to the locals + with the lowest priority. For a given class defined in a function, the locals + of this function are usually used as the parent namespace: + + ```python {lint="skip" test="skip"} + from pydantic import BaseModel + + def func() -> None: + SomeType = int + + class Model(BaseModel): + f: 'SomeType' + + # when collecting fields, an namespace resolver instance will be created + # this way: + # ns_resolver = NsResolver(parent_namespace={'SomeType': SomeType}) + ``` + + For backwards compatibility reasons and to support valid edge cases, this parent + namespace will be used for *every* type being pushed to the stack. In the future, + we might want to be smarter by only doing so when the type being pushed is defined + in the same module as the parent namespace. + + Example: + ```python {lint="skip" test="skip"} + ns_resolver = NsResolver( + parent_namespace={'fallback': 1}, + ) + + class Sub: + m: 'Model' + + class Model: + some_local = 1 + sub: Sub + + ns_resolver = NsResolver() + + # This is roughly what happens when we build a core schema for `Model`: + with ns_resolver.push(Model): + ns_resolver.types_namespace + #> NamespacesTuple({'Sub': Sub}, {'Model': Model, 'some_local': 1}) + # First thing to notice here, the model being pushed is added to the locals. + # Because `NsResolver` is being used during the model definition, it is not + # yet added to the globals. This is useful when resolving self-referencing annotations. + + with ns_resolver.push(Sub): + ns_resolver.types_namespace + #> NamespacesTuple({'Sub': Sub}, {'Sub': Sub, 'Model': Model}) + # Second thing to notice: `Sub` is present in both the globals and locals. + # This is not an issue, just that as described above, the model being pushed + # is added to the locals, but it happens to be present in the globals as well + # because it is already defined. + # Third thing to notice: `Model` is also added in locals. This is a backwards + # compatibility workaround that allows for `Sub` to be able to resolve `'Model'` + # correctly (as otherwise models would have to be rebuilt even though this + # doesn't look necessary). + ``` + """ + + def __init__( + self, + namespaces_tuple: NamespacesTuple | None = None, + parent_namespace: MappingNamespace | None = None, + ) -> None: + self._base_ns_tuple = namespaces_tuple or NamespacesTuple({}, {}) + self._parent_ns = parent_namespace + self._types_stack: list[type[Any] | TypeAliasType] = [] + + @cached_property + def types_namespace(self) -> NamespacesTuple: + """The current global and local namespaces to be used for annotations evaluation.""" + if not self._types_stack: + # TODO: should we merge the parent namespace here? + # This is relevant for TypeAdapter, where there are no types on the stack, and we might + # need access to the parent_ns. Right now, we sidestep this in `type_adapter.py` by passing + # locals to both parent_ns and the base_ns_tuple, but this is a bit hacky. + # we might consider something like: + # if self._parent_ns is not None: + # # Hacky workarounds, see class docstring: + # # An optional parent namespace that will be added to the locals with the lowest priority + # locals_list: list[MappingNamespace] = [self._parent_ns, self._base_ns_tuple.locals] + # return NamespacesTuple(self._base_ns_tuple.globals, LazyLocalNamespace(*locals_list)) + return self._base_ns_tuple + + typ = self._types_stack[-1] + + globalns = get_module_ns_of(typ) + + locals_list: list[MappingNamespace] = [] + # Hacky workarounds, see class docstring: + # An optional parent namespace that will be added to the locals with the lowest priority + if self._parent_ns is not None: + locals_list.append(self._parent_ns) + if len(self._types_stack) > 1: + first_type = self._types_stack[0] + locals_list.append({first_type.__name__: first_type}) + + # Adding `__type_params__` *before* `vars(typ)`, as the latter takes priority + # (see https://github.com/python/cpython/pull/120272). + # TODO `typ.__type_params__` when we drop support for Python 3.11: + type_params: tuple[_TypeVarLike, ...] = getattr(typ, '__type_params__', ()) + if type_params: + # Adding `__type_params__` is mostly useful for generic classes defined using + # PEP 695 syntax *and* using forward annotations (see the example in + # https://github.com/python/cpython/issues/114053). For TypeAliasType instances, + # it is way less common, but still required if using a string annotation in the alias + # value, e.g. `type A[T] = 'T'` (which is not necessary in most cases). + locals_list.append({t.__name__: t for t in type_params}) + + # TypeAliasType instances don't have a `__dict__` attribute, so the check + # is necessary: + if hasattr(typ, '__dict__'): + locals_list.append(vars(typ)) + + # The `len(self._types_stack) > 1` check above prevents this from being added twice: + locals_list.append({typ.__name__: typ}) + + return NamespacesTuple(globalns, LazyLocalNamespace(*locals_list)) + + @contextmanager + def push(self, typ: type[Any] | TypeAliasType, /) -> Generator[None]: + """Push a type to the stack.""" + self._types_stack.append(typ) + # Reset the cached property: + self.__dict__.pop('types_namespace', None) + try: + yield + finally: + self._types_stack.pop() + self.__dict__.pop('types_namespace', None) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_repr.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_repr.py new file mode 100644 index 0000000000000000000000000000000000000000..bf3cae53e3dc2083daa85288984b42137fe26848 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_repr.py @@ -0,0 +1,125 @@ +"""Tools to provide pretty/human-readable display of objects.""" + +from __future__ import annotations as _annotations + +import types +import typing +from typing import Any + +import typing_extensions +from typing_inspection import typing_objects +from typing_inspection.introspection import is_union_origin + +from . import _typing_extra + +if typing.TYPE_CHECKING: + ReprArgs: typing_extensions.TypeAlias = 'typing.Iterable[tuple[str | None, Any]]' + RichReprResult: typing_extensions.TypeAlias = ( + 'typing.Iterable[Any | tuple[Any] | tuple[str, Any] | tuple[str, Any, Any]]' + ) + + +class PlainRepr(str): + """String class where repr doesn't include quotes. Useful with Representation when you want to return a string + representation of something that is valid (or pseudo-valid) python. + """ + + def __repr__(self) -> str: + return str(self) + + +class Representation: + # Mixin to provide `__str__`, `__repr__`, and `__pretty__` and `__rich_repr__` methods. + # `__pretty__` is used by [devtools](https://python-devtools.helpmanual.io/). + # `__rich_repr__` is used by [rich](https://rich.readthedocs.io/en/stable/pretty.html). + # (this is not a docstring to avoid adding a docstring to classes which inherit from Representation) + + # we don't want to use a type annotation here as it can break get_type_hints + __slots__ = () # type: typing.Collection[str] + + def __repr_args__(self) -> ReprArgs: + """Returns the attributes to show in __str__, __repr__, and __pretty__ this is generally overridden. + + Can either return: + * name - value pairs, e.g.: `[('foo_name', 'foo'), ('bar_name', ['b', 'a', 'r'])]` + * or, just values, e.g.: `[(None, 'foo'), (None, ['b', 'a', 'r'])]` + """ + attrs_names = self.__slots__ + if not attrs_names and hasattr(self, '__dict__'): + attrs_names = self.__dict__.keys() + attrs = ((s, getattr(self, s)) for s in attrs_names) + return [(a, v if v is not self else self.__repr_recursion__(v)) for a, v in attrs if v is not None] + + def __repr_name__(self) -> str: + """Name of the instance's class, used in __repr__.""" + return self.__class__.__name__ + + def __repr_recursion__(self, object: Any) -> str: + """Returns the string representation of a recursive object.""" + # This is copied over from the stdlib `pprint` module: + return f'' + + def __repr_str__(self, join_str: str) -> str: + return join_str.join(repr(v) if a is None else f'{a}={v!r}' for a, v in self.__repr_args__()) + + def __pretty__(self, fmt: typing.Callable[[Any], Any], **kwargs: Any) -> typing.Generator[Any, None, None]: + """Used by devtools (https://python-devtools.helpmanual.io/) to pretty print objects.""" + yield self.__repr_name__() + '(' + yield 1 + for name, value in self.__repr_args__(): + if name is not None: + yield name + '=' + yield fmt(value) + yield ',' + yield 0 + yield -1 + yield ')' + + def __rich_repr__(self) -> RichReprResult: + """Used by Rich (https://rich.readthedocs.io/en/stable/pretty.html) to pretty print objects.""" + for name, field_repr in self.__repr_args__(): + if name is None: + yield field_repr + else: + yield name, field_repr + + def __str__(self) -> str: + return self.__repr_str__(' ') + + def __repr__(self) -> str: + return f'{self.__repr_name__()}({self.__repr_str__(", ")})' + + +def display_as_type(obj: Any) -> str: + """Pretty representation of a type, should be as close as possible to the original type definition string. + + Takes some logic from `typing._type_repr`. + """ + if isinstance(obj, (types.FunctionType, types.BuiltinFunctionType)): + return obj.__name__ + elif obj is ...: + return '...' + elif isinstance(obj, Representation): + return repr(obj) + elif isinstance(obj, typing.ForwardRef) or typing_objects.is_typealiastype(obj): + return str(obj) + + if not isinstance(obj, (_typing_extra.typing_base, _typing_extra.WithArgsTypes, type)): + obj = obj.__class__ + + if is_union_origin(typing_extensions.get_origin(obj)): + args = ', '.join(map(display_as_type, typing_extensions.get_args(obj))) + return f'Union[{args}]' + elif isinstance(obj, _typing_extra.WithArgsTypes): + if typing_objects.is_literal(typing_extensions.get_origin(obj)): + args = ', '.join(map(repr, typing_extensions.get_args(obj))) + else: + args = ', '.join(map(display_as_type, typing_extensions.get_args(obj))) + try: + return f'{obj.__qualname__}[{args}]' + except AttributeError: + return str(obj).replace('typing.', '').replace('typing_extensions.', '') # handles TypeAliasType in 3.12 + elif isinstance(obj, type): + return obj.__qualname__ + else: + return repr(obj).replace('typing.', '').replace('typing_extensions.', '') diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_schema_gather.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_schema_gather.py new file mode 100644 index 0000000000000000000000000000000000000000..fc2d806ead6554f22919f0827e681b43889378ad --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_schema_gather.py @@ -0,0 +1,209 @@ +# pyright: reportTypedDictNotRequiredAccess=false, reportGeneralTypeIssues=false, reportArgumentType=false, reportAttributeAccessIssue=false +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import TypedDict + +from pydantic_core.core_schema import ComputedField, CoreSchema, DefinitionReferenceSchema, SerSchema +from typing_extensions import TypeAlias + +AllSchemas: TypeAlias = 'CoreSchema | SerSchema | ComputedField' + + +class GatherResult(TypedDict): + """Schema traversing result.""" + + collected_references: dict[str, DefinitionReferenceSchema | None] + """The collected definition references. + + If a definition reference schema can be inlined, it means that there is + only one in the whole core schema. As such, it is stored as the value. + Otherwise, the value is set to `None`. + """ + + deferred_discriminator_schemas: list[CoreSchema] + """The list of core schemas having the discriminator application deferred.""" + + +class MissingDefinitionError(LookupError): + """A reference was pointing to a non-existing core schema.""" + + def __init__(self, schema_reference: str, /) -> None: + self.schema_reference = schema_reference + + +@dataclass +class GatherContext: + """The current context used during core schema traversing. + + Context instances should only be used during schema traversing. + """ + + definitions: dict[str, CoreSchema] + """The available definitions.""" + + deferred_discriminator_schemas: list[CoreSchema] = field(init=False, default_factory=list) + """The list of core schemas having the discriminator application deferred. + + Internally, these core schemas have a specific key set in the core metadata dict. + """ + + collected_references: dict[str, DefinitionReferenceSchema | None] = field(init=False, default_factory=dict) + """The collected definition references. + + If a definition reference schema can be inlined, it means that there is + only one in the whole core schema. As such, it is stored as the value. + Otherwise, the value is set to `None`. + + During schema traversing, definition reference schemas can be added as candidates, or removed + (by setting the value to `None`). + """ + + +def traverse_metadata(schema: AllSchemas, ctx: GatherContext) -> None: + meta = schema.get('metadata') + if meta is not None and 'pydantic_internal_union_discriminator' in meta: + ctx.deferred_discriminator_schemas.append(schema) # pyright: ignore[reportArgumentType] + + +def traverse_definition_ref(def_ref_schema: DefinitionReferenceSchema, ctx: GatherContext) -> None: + schema_ref = def_ref_schema['schema_ref'] + + if schema_ref not in ctx.collected_references: + definition = ctx.definitions.get(schema_ref) + if definition is None: + raise MissingDefinitionError(schema_ref) + + # The `'definition-ref'` schema was only encountered once, make it + # a candidate to be inlined: + ctx.collected_references[schema_ref] = def_ref_schema + traverse_schema(definition, ctx) + if 'serialization' in def_ref_schema: + traverse_schema(def_ref_schema['serialization'], ctx) + traverse_metadata(def_ref_schema, ctx) + else: + # The `'definition-ref'` schema was already encountered, meaning + # the previously encountered schema (and this one) can't be inlined: + ctx.collected_references[schema_ref] = None + + +def traverse_schema(schema: AllSchemas, context: GatherContext) -> None: + # TODO When we drop 3.9, use a match statement to get better type checking and remove + # file-level type ignore. + # (the `'type'` could also be fetched in every `if/elif` statement, but this alters performance). + schema_type = schema['type'] + + if schema_type == 'definition-ref': + traverse_definition_ref(schema, context) + # `traverse_definition_ref` handles the possible serialization and metadata schemas: + return + elif schema_type == 'definitions': + traverse_schema(schema['schema'], context) + for definition in schema['definitions']: + traverse_schema(definition, context) + elif schema_type in {'list', 'set', 'frozenset', 'generator'}: + if 'items_schema' in schema: + traverse_schema(schema['items_schema'], context) + elif schema_type == 'tuple': + if 'items_schema' in schema: + for s in schema['items_schema']: + traverse_schema(s, context) + elif schema_type == 'dict': + if 'keys_schema' in schema: + traverse_schema(schema['keys_schema'], context) + if 'values_schema' in schema: + traverse_schema(schema['values_schema'], context) + elif schema_type == 'union': + for choice in schema['choices']: + if isinstance(choice, tuple): + traverse_schema(choice[0], context) + else: + traverse_schema(choice, context) + elif schema_type == 'tagged-union': + for v in schema['choices'].values(): + traverse_schema(v, context) + elif schema_type == 'chain': + for step in schema['steps']: + traverse_schema(step, context) + elif schema_type == 'lax-or-strict': + traverse_schema(schema['lax_schema'], context) + traverse_schema(schema['strict_schema'], context) + elif schema_type == 'json-or-python': + traverse_schema(schema['json_schema'], context) + traverse_schema(schema['python_schema'], context) + elif schema_type in {'model-fields', 'typed-dict'}: + if 'extras_schema' in schema: + traverse_schema(schema['extras_schema'], context) + if 'computed_fields' in schema: + for s in schema['computed_fields']: + traverse_schema(s, context) + for s in schema['fields'].values(): + traverse_schema(s, context) + elif schema_type == 'dataclass-args': + if 'computed_fields' in schema: + for s in schema['computed_fields']: + traverse_schema(s, context) + for s in schema['fields']: + traverse_schema(s, context) + elif schema_type == 'arguments': + for s in schema['arguments_schema']: + traverse_schema(s['schema'], context) + if 'var_args_schema' in schema: + traverse_schema(schema['var_args_schema'], context) + if 'var_kwargs_schema' in schema: + traverse_schema(schema['var_kwargs_schema'], context) + elif schema_type == 'arguments-v3': + for s in schema['arguments_schema']: + traverse_schema(s['schema'], context) + elif schema_type == 'call': + traverse_schema(schema['arguments_schema'], context) + if 'return_schema' in schema: + traverse_schema(schema['return_schema'], context) + elif schema_type == 'computed-field': + traverse_schema(schema['return_schema'], context) + elif schema_type == 'function-before': + if 'schema' in schema: + traverse_schema(schema['schema'], context) + if 'json_schema_input_schema' in schema: + traverse_schema(schema['json_schema_input_schema'], context) + elif schema_type == 'function-plain': + # TODO duplicate schema types for serializers and validators, needs to be deduplicated. + if 'return_schema' in schema: + traverse_schema(schema['return_schema'], context) + if 'json_schema_input_schema' in schema: + traverse_schema(schema['json_schema_input_schema'], context) + elif schema_type == 'function-wrap': + # TODO duplicate schema types for serializers and validators, needs to be deduplicated. + if 'return_schema' in schema: + traverse_schema(schema['return_schema'], context) + if 'schema' in schema: + traverse_schema(schema['schema'], context) + if 'json_schema_input_schema' in schema: + traverse_schema(schema['json_schema_input_schema'], context) + else: + if 'schema' in schema: + traverse_schema(schema['schema'], context) + + if 'serialization' in schema: + traverse_schema(schema['serialization'], context) + traverse_metadata(schema, context) + + +def gather_schemas_for_cleaning(schema: CoreSchema, definitions: dict[str, CoreSchema]) -> GatherResult: + """Traverse the core schema and definitions and return the necessary information for schema cleaning. + + During the core schema traversing, any `'definition-ref'` schema is: + + - Validated: the reference must point to an existing definition. If this is not the case, a + `MissingDefinitionError` exception is raised. + - Stored in the context: the actual reference is stored in the context. Depending on whether + the `'definition-ref'` schema is encountered more that once, the schema itself is also + saved in the context to be inlined (i.e. replaced by the definition it points to). + """ + context = GatherContext(definitions) + traverse_schema(schema, context) + + return { + 'collected_references': context.collected_references, + 'deferred_discriminator_schemas': context.deferred_discriminator_schemas, + } diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py new file mode 100644 index 0000000000000000000000000000000000000000..b231a82e1969822695bb3680217b66e73c81d017 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py @@ -0,0 +1,125 @@ +"""Types and utility functions used by various other internal tools.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Callable, Literal + +from pydantic_core import core_schema + +from ..annotated_handlers import GetCoreSchemaHandler, GetJsonSchemaHandler + +if TYPE_CHECKING: + from ..json_schema import GenerateJsonSchema, JsonSchemaValue + from ._core_utils import CoreSchemaOrField + from ._generate_schema import GenerateSchema + from ._namespace_utils import NamespacesTuple + + GetJsonSchemaFunction = Callable[[CoreSchemaOrField, GetJsonSchemaHandler], JsonSchemaValue] + HandlerOverride = Callable[[CoreSchemaOrField], JsonSchemaValue] + + +class GenerateJsonSchemaHandler(GetJsonSchemaHandler): + """JsonSchemaHandler implementation that doesn't do ref unwrapping by default. + + This is used for any Annotated metadata so that we don't end up with conflicting + modifications to the definition schema. + + Used internally by Pydantic, please do not rely on this implementation. + See `GetJsonSchemaHandler` for the handler API. + """ + + def __init__(self, generate_json_schema: GenerateJsonSchema, handler_override: HandlerOverride | None) -> None: + self.generate_json_schema = generate_json_schema + self.handler = handler_override or generate_json_schema.generate_inner + self.mode = generate_json_schema.mode + + def __call__(self, core_schema: CoreSchemaOrField, /) -> JsonSchemaValue: + return self.handler(core_schema) + + def resolve_ref_schema(self, maybe_ref_json_schema: JsonSchemaValue) -> JsonSchemaValue: + """Resolves `$ref` in the json schema. + + This returns the input json schema if there is no `$ref` in json schema. + + Args: + maybe_ref_json_schema: The input json schema that may contains `$ref`. + + Returns: + Resolved json schema. + + Raises: + LookupError: If it can't find the definition for `$ref`. + """ + if '$ref' not in maybe_ref_json_schema: + return maybe_ref_json_schema + ref = maybe_ref_json_schema['$ref'] + json_schema = self.generate_json_schema.get_schema_from_definitions(ref) + if json_schema is None: + raise LookupError( + f'Could not find a ref for {ref}.' + ' Maybe you tried to call resolve_ref_schema from within a recursive model?' + ) + return json_schema + + +class CallbackGetCoreSchemaHandler(GetCoreSchemaHandler): + """Wrapper to use an arbitrary function as a `GetCoreSchemaHandler`. + + Used internally by Pydantic, please do not rely on this implementation. + See `GetCoreSchemaHandler` for the handler API. + """ + + def __init__( + self, + handler: Callable[[Any], core_schema.CoreSchema], + generate_schema: GenerateSchema, + ref_mode: Literal['to-def', 'unpack'] = 'to-def', + ) -> None: + self._handler = handler + self._generate_schema = generate_schema + self._ref_mode = ref_mode + + def __call__(self, source_type: Any, /) -> core_schema.CoreSchema: + schema = self._handler(source_type) + if self._ref_mode == 'to-def': + ref = schema.get('ref') + if ref is not None: + return self._generate_schema.defs.create_definition_reference_schema(schema) + return schema + else: # ref_mode = 'unpack' + return self.resolve_ref_schema(schema) + + def _get_types_namespace(self) -> NamespacesTuple: + return self._generate_schema._types_namespace + + def generate_schema(self, source_type: Any, /) -> core_schema.CoreSchema: + return self._generate_schema.generate_schema(source_type) + + @property + def field_name(self) -> str | None: + return self._generate_schema.field_name_stack.get() + + def resolve_ref_schema(self, maybe_ref_schema: core_schema.CoreSchema) -> core_schema.CoreSchema: + """Resolves reference in the core schema. + + Args: + maybe_ref_schema: The input core schema that may contains reference. + + Returns: + Resolved core schema. + + Raises: + LookupError: If it can't find the definition for reference. + """ + if maybe_ref_schema['type'] == 'definition-ref': + ref = maybe_ref_schema['schema_ref'] + definition = self._generate_schema.defs.get_schema_from_ref(ref) + if definition is None: + raise LookupError( + f'Could not find a ref for {ref}.' + ' Maybe you tried to call resolve_ref_schema from within a recursive model?' + ) + return definition + elif maybe_ref_schema['type'] == 'definitions': + return self.resolve_ref_schema(maybe_ref_schema['schema']) + return maybe_ref_schema diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_serializers.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_serializers.py new file mode 100644 index 0000000000000000000000000000000000000000..d0593218fd002acae235f244ef1c61b9d99ea1b8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_serializers.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +import collections +import collections.abc +import typing +from typing import Any + +from pydantic_core import PydanticOmit, core_schema + +SEQUENCE_ORIGIN_MAP: dict[Any, Any] = { + typing.Deque: collections.deque, # noqa: UP006 + collections.deque: collections.deque, + list: list, + typing.List: list, # noqa: UP006 + tuple: tuple, + typing.Tuple: tuple, # noqa: UP006 + set: set, + typing.AbstractSet: set, + typing.Set: set, # noqa: UP006 + frozenset: frozenset, + typing.FrozenSet: frozenset, # noqa: UP006 + typing.Sequence: list, + typing.MutableSequence: list, + typing.MutableSet: set, + # this doesn't handle subclasses of these + # parametrized typing.Set creates one of these + collections.abc.MutableSet: set, + collections.abc.Set: frozenset, +} + + +def serialize_sequence_via_list( + v: Any, handler: core_schema.SerializerFunctionWrapHandler, info: core_schema.SerializationInfo +) -> Any: + items: list[Any] = [] + + mapped_origin = SEQUENCE_ORIGIN_MAP.get(type(v), None) + if mapped_origin is None: + # we shouldn't hit this branch, should probably add a serialization error or something + return v + + for index, item in enumerate(v): + try: + v = handler(item, index) + except PydanticOmit: + pass + else: + items.append(v) + + if info.mode_is_json(): + return items + else: + return mapped_origin(items) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_signature.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_signature.py new file mode 100644 index 0000000000000000000000000000000000000000..977e5d2934016630108499c24c1f6fd5bf30179a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_signature.py @@ -0,0 +1,188 @@ +from __future__ import annotations + +import dataclasses +from inspect import Parameter, Signature, signature +from typing import TYPE_CHECKING, Any, Callable + +from pydantic_core import PydanticUndefined + +from ._utils import is_valid_identifier + +if TYPE_CHECKING: + from ..config import ExtraValues + from ..fields import FieldInfo + + +# Copied over from stdlib dataclasses +class _HAS_DEFAULT_FACTORY_CLASS: + def __repr__(self): + return '' + + +_HAS_DEFAULT_FACTORY = _HAS_DEFAULT_FACTORY_CLASS() + + +def _field_name_for_signature(field_name: str, field_info: FieldInfo) -> str: + """Extract the correct name to use for the field when generating a signature. + + Assuming the field has a valid alias, this will return the alias. Otherwise, it will return the field name. + First priority is given to the alias, then the validation_alias, then the field name. + + Args: + field_name: The name of the field + field_info: The corresponding FieldInfo object. + + Returns: + The correct name to use when generating a signature. + """ + if isinstance(field_info.alias, str) and is_valid_identifier(field_info.alias): + return field_info.alias + if isinstance(field_info.validation_alias, str) and is_valid_identifier(field_info.validation_alias): + return field_info.validation_alias + + return field_name + + +def _process_param_defaults(param: Parameter) -> Parameter: + """Modify the signature for a parameter in a dataclass where the default value is a FieldInfo instance. + + Args: + param (Parameter): The parameter + + Returns: + Parameter: The custom processed parameter + """ + from ..fields import FieldInfo + + param_default = param.default + if isinstance(param_default, FieldInfo): + annotation = param.annotation + # Replace the annotation if appropriate + # inspect does "clever" things to show annotations as strings because we have + # `from __future__ import annotations` in main, we don't want that + if annotation == 'Any': + annotation = Any + + # Replace the field default + default = param_default.default + if default is PydanticUndefined: + if param_default.default_factory is PydanticUndefined: + default = Signature.empty + else: + # this is used by dataclasses to indicate a factory exists: + default = dataclasses._HAS_DEFAULT_FACTORY # type: ignore + return param.replace( + annotation=annotation, name=_field_name_for_signature(param.name, param_default), default=default + ) + return param + + +def _generate_signature_parameters( # noqa: C901 (ignore complexity, could use a refactor) + init: Callable[..., None], + fields: dict[str, FieldInfo], + validate_by_name: bool, + extra: ExtraValues | None, +) -> dict[str, Parameter]: + """Generate a mapping of parameter names to Parameter objects for a pydantic BaseModel or dataclass.""" + from itertools import islice + + present_params = signature(init).parameters.values() + merged_params: dict[str, Parameter] = {} + var_kw = None + use_var_kw = False + + for param in islice(present_params, 1, None): # skip self arg + # inspect does "clever" things to show annotations as strings because we have + # `from __future__ import annotations` in main, we don't want that + if fields.get(param.name): + # exclude params with init=False + if getattr(fields[param.name], 'init', True) is False: + continue + param = param.replace(name=_field_name_for_signature(param.name, fields[param.name])) + if param.annotation == 'Any': + param = param.replace(annotation=Any) + if param.kind is param.VAR_KEYWORD: + var_kw = param + continue + merged_params[param.name] = param + + if var_kw: # if custom init has no var_kw, fields which are not declared in it cannot be passed through + allow_names = validate_by_name + for field_name, field in fields.items(): + # when alias is a str it should be used for signature generation + param_name = _field_name_for_signature(field_name, field) + + if field_name in merged_params or param_name in merged_params: + continue + + if not is_valid_identifier(param_name): + if allow_names: + param_name = field_name + else: + use_var_kw = True + continue + + if field.is_required(): + default = Parameter.empty + elif field.default_factory is not None: + # Mimics stdlib dataclasses: + default = _HAS_DEFAULT_FACTORY + else: + default = field.default + merged_params[param_name] = Parameter( + param_name, + Parameter.KEYWORD_ONLY, + annotation=field.rebuild_annotation(), + default=default, + ) + + if extra == 'allow': + use_var_kw = True + + if var_kw and use_var_kw: + # Make sure the parameter for extra kwargs + # does not have the same name as a field + default_model_signature = [ + ('self', Parameter.POSITIONAL_ONLY), + ('data', Parameter.VAR_KEYWORD), + ] + if [(p.name, p.kind) for p in present_params] == default_model_signature: + # if this is the standard model signature, use extra_data as the extra args name + var_kw_name = 'extra_data' + else: + # else start from var_kw + var_kw_name = var_kw.name + + # generate a name that's definitely unique + while var_kw_name in fields: + var_kw_name += '_' + merged_params[var_kw_name] = var_kw.replace(name=var_kw_name) + + return merged_params + + +def generate_pydantic_signature( + init: Callable[..., None], + fields: dict[str, FieldInfo], + validate_by_name: bool, + extra: ExtraValues | None, + is_dataclass: bool = False, +) -> Signature: + """Generate signature for a pydantic BaseModel or dataclass. + + Args: + init: The class init. + fields: The model fields. + validate_by_name: The `validate_by_name` value of the config. + extra: The `extra` value of the config. + is_dataclass: Whether the model is a dataclass. + + Returns: + The dataclass/BaseModel subclass signature. + """ + merged_params = _generate_signature_parameters(init, fields, validate_by_name, extra) + + if is_dataclass: + merged_params = {k: _process_param_defaults(v) for k, v in merged_params.items()} + + return Signature(parameters=list(merged_params.values()), return_annotation=None) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_typing_extra.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_typing_extra.py new file mode 100644 index 0000000000000000000000000000000000000000..4be1a09cb3214fdacae75ddc01d05746fc8ebc23 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_typing_extra.py @@ -0,0 +1,714 @@ +"""Logic for interacting with type annotations, mostly extensions, shims and hacks to wrap Python's typing module.""" + +from __future__ import annotations + +import collections.abc +import re +import sys +import types +import typing +from functools import partial +from typing import TYPE_CHECKING, Any, Callable, cast + +import typing_extensions +from typing_extensions import deprecated, get_args, get_origin +from typing_inspection import typing_objects +from typing_inspection.introspection import is_union_origin + +from pydantic.version import version_short + +from ._namespace_utils import GlobalsNamespace, MappingNamespace, NsResolver, get_module_ns_of + +if sys.version_info < (3, 10): + NoneType = type(None) + EllipsisType = type(Ellipsis) +else: + from types import EllipsisType as EllipsisType + from types import NoneType as NoneType + +if TYPE_CHECKING: + from pydantic import BaseModel + +# As per https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types, +# always check for both `typing` and `typing_extensions` variants of a typing construct. +# (this is implemented differently than the suggested approach in the `typing_extensions` +# docs for performance). + + +_t_annotated = typing.Annotated +_te_annotated = typing_extensions.Annotated + + +def is_annotated(tp: Any, /) -> bool: + """Return whether the provided argument is a `Annotated` special form. + + ```python {test="skip" lint="skip"} + is_annotated(Annotated[int, ...]) + #> True + ``` + """ + origin = get_origin(tp) + return origin is _t_annotated or origin is _te_annotated + + +def annotated_type(tp: Any, /) -> Any | None: + """Return the type of the `Annotated` special form, or `None`.""" + return tp.__origin__ if typing_objects.is_annotated(get_origin(tp)) else None + + +def unpack_type(tp: Any, /) -> Any | None: + """Return the type wrapped by the `Unpack` special form, or `None`.""" + return get_args(tp)[0] if typing_objects.is_unpack(get_origin(tp)) else None + + +def is_hashable(tp: Any, /) -> bool: + """Return whether the provided argument is the `Hashable` class. + + ```python {test="skip" lint="skip"} + is_hashable(Hashable) + #> True + ``` + """ + # `get_origin` is documented as normalizing any typing-module aliases to `collections` classes, + # hence the second check: + return tp is collections.abc.Hashable or get_origin(tp) is collections.abc.Hashable + + +def is_callable(tp: Any, /) -> bool: + """Return whether the provided argument is a `Callable`, parametrized or not. + + ```python {test="skip" lint="skip"} + is_callable(Callable[[int], str]) + #> True + is_callable(typing.Callable) + #> True + is_callable(collections.abc.Callable) + #> True + ``` + """ + # `get_origin` is documented as normalizing any typing-module aliases to `collections` classes, + # hence the second check: + return tp is collections.abc.Callable or get_origin(tp) is collections.abc.Callable + + +_classvar_re = re.compile(r'((\w+\.)?Annotated\[)?(\w+\.)?ClassVar\[') + + +def is_classvar_annotation(tp: Any, /) -> bool: + """Return whether the provided argument represents a class variable annotation. + + Although not explicitly stated by the typing specification, `ClassVar` can be used + inside `Annotated` and as such, this function checks for this specific scenario. + + Because this function is used to detect class variables before evaluating forward references + (or because evaluation failed), we also implement a naive regex match implementation. This is + required because class variables are inspected before fields are collected, so we try to be + as accurate as possible. + """ + if typing_objects.is_classvar(tp): + return True + + origin = get_origin(tp) + + if typing_objects.is_classvar(origin): + return True + + if typing_objects.is_annotated(origin): + annotated_type = tp.__origin__ + if typing_objects.is_classvar(annotated_type) or typing_objects.is_classvar(get_origin(annotated_type)): + return True + + str_ann: str | None = None + if isinstance(tp, typing.ForwardRef): + str_ann = tp.__forward_arg__ + if isinstance(tp, str): + str_ann = tp + + if str_ann is not None and _classvar_re.match(str_ann): + # stdlib dataclasses do something similar, although a bit more advanced + # (see `dataclass._is_type`). + return True + + return False + + +_t_final = typing.Final +_te_final = typing_extensions.Final + + +# TODO implement `is_finalvar_annotation` as Final can be wrapped with other special forms: +def is_finalvar(tp: Any, /) -> bool: + """Return whether the provided argument is a `Final` special form, parametrized or not. + + ```python {test="skip" lint="skip"} + is_finalvar(Final[int]) + #> True + is_finalvar(Final) + #> True + """ + # Final is not necessarily parametrized: + if tp is _t_final or tp is _te_final: + return True + origin = get_origin(tp) + return origin is _t_final or origin is _te_final + + +_NONE_TYPES: tuple[Any, ...] = (None, NoneType, typing.Literal[None], typing_extensions.Literal[None]) + + +def is_none_type(tp: Any, /) -> bool: + """Return whether the argument represents the `None` type as part of an annotation. + + ```python {test="skip" lint="skip"} + is_none_type(None) + #> True + is_none_type(NoneType) + #> True + is_none_type(Literal[None]) + #> True + is_none_type(type[None]) + #> False + """ + return tp in _NONE_TYPES + + +def is_namedtuple(tp: Any, /) -> bool: + """Return whether the provided argument is a named tuple class. + + The class can be created using `typing.NamedTuple` or `collections.namedtuple`. + Parametrized generic classes are *not* assumed to be named tuples. + """ + from ._utils import lenient_issubclass # circ. import + + return lenient_issubclass(tp, tuple) and hasattr(tp, '_fields') + + +# TODO In 2.12, delete this export. It is currently defined only to not break +# pydantic-settings which relies on it: +origin_is_union = is_union_origin + + +def is_generic_alias(tp: Any, /) -> bool: + return isinstance(tp, (types.GenericAlias, typing._GenericAlias)) # pyright: ignore[reportAttributeAccessIssue] + + +# TODO: Ideally, we should avoid relying on the private `typing` constructs: + +if sys.version_info < (3, 10): + WithArgsTypes: tuple[Any, ...] = (typing._GenericAlias, types.GenericAlias) # pyright: ignore[reportAttributeAccessIssue] +else: + WithArgsTypes: tuple[Any, ...] = (typing._GenericAlias, types.GenericAlias, types.UnionType) # pyright: ignore[reportAttributeAccessIssue] + + +# Similarly, we shouldn't rely on this `_Final` class, which is even more private than `_GenericAlias`: +typing_base: Any = typing._Final # pyright: ignore[reportAttributeAccessIssue] + + +### Annotation evaluations functions: + + +def parent_frame_namespace(*, parent_depth: int = 2, force: bool = False) -> dict[str, Any] | None: + """Fetch the local namespace of the parent frame where this function is called. + + Using this function is mostly useful to resolve forward annotations pointing to members defined in a local namespace, + such as assignments inside a function. Using the standard library tools, it is currently not possible to resolve + such annotations: + + ```python {lint="skip" test="skip"} + from typing import get_type_hints + + def func() -> None: + Alias = int + + class C: + a: 'Alias' + + # Raises a `NameError: 'Alias' is not defined` + get_type_hints(C) + ``` + + Pydantic uses this function when a Pydantic model is being defined to fetch the parent frame locals. However, + this only allows us to fetch the parent frame namespace and not other parents (e.g. a model defined in a function, + itself defined in another function). Inspecting the next outer frames (using `f_back`) is not reliable enough + (see https://discuss.python.org/t/20659). + + Because this function is mostly used to better resolve forward annotations, nothing is returned if the parent frame's + code object is defined at the module level. In this case, the locals of the frame will be the same as the module + globals where the class is defined (see `_namespace_utils.get_module_ns_of`). However, if you still want to fetch + the module globals (e.g. when rebuilding a model, where the frame where the rebuild call is performed might contain + members that you want to use for forward annotations evaluation), you can use the `force` parameter. + + Args: + parent_depth: The depth at which to get the frame. Defaults to 2, meaning the parent frame where this function + is called will be used. + force: Whether to always return the frame locals, even if the frame's code object is defined at the module level. + + Returns: + The locals of the namespace, or `None` if it was skipped as per the described logic. + """ + frame = sys._getframe(parent_depth) + + if frame.f_code.co_name.startswith('`, + # and we need to skip this frame as it is irrelevant. + frame = cast(types.FrameType, frame.f_back) # guaranteed to not be `None` + + # note, we don't copy frame.f_locals here (or during the last return call), because we don't expect the namespace to be + # modified down the line if this becomes a problem, we could implement some sort of frozen mapping structure to enforce this. + if force: + return frame.f_locals + + # If either of the following conditions are true, the class is defined at the top module level. + # To better understand why we need both of these checks, see + # https://github.com/pydantic/pydantic/pull/10113#discussion_r1714981531. + if frame.f_back is None or frame.f_code.co_name == '': + return None + + return frame.f_locals + + +def _type_convert(arg: Any) -> Any: + """Convert `None` to `NoneType` and strings to `ForwardRef` instances. + + This is a backport of the private `typing._type_convert` function. When + evaluating a type, `ForwardRef._evaluate` ends up being called, and is + responsible for making this conversion. However, we still have to apply + it for the first argument passed to our type evaluation functions, similarly + to the `typing.get_type_hints` function. + """ + if arg is None: + return NoneType + if isinstance(arg, str): + # Like `typing.get_type_hints`, assume the arg can be in any context, + # hence the proper `is_argument` and `is_class` args: + return _make_forward_ref(arg, is_argument=False, is_class=True) + return arg + + +def get_model_type_hints( + obj: type[BaseModel], + *, + ns_resolver: NsResolver | None = None, +) -> dict[str, tuple[Any, bool]]: + """Collect annotations from a Pydantic model class, including those from parent classes. + + Args: + obj: The Pydantic model to inspect. + ns_resolver: A namespace resolver instance to use. Defaults to an empty instance. + + Returns: + A dictionary mapping annotation names to a two-tuple: the first element is the evaluated + type or the original annotation if a `NameError` occurred, the second element is a boolean + indicating if whether the evaluation succeeded. + """ + hints: dict[str, Any] | dict[str, tuple[Any, bool]] = {} + ns_resolver = ns_resolver or NsResolver() + + for base in reversed(obj.__mro__): + ann: dict[str, Any] | None = base.__dict__.get('__annotations__') + if not ann or isinstance(ann, types.GetSetDescriptorType): + continue + with ns_resolver.push(base): + globalns, localns = ns_resolver.types_namespace + for name, value in ann.items(): + if name.startswith('_'): + # For private attributes, we only need the annotation to detect the `ClassVar` special form. + # For this reason, we still try to evaluate it, but we also catch any possible exception (on + # top of the `NameError`s caught in `try_eval_type`) that could happen so that users are free + # to use any kind of forward annotation for private fields (e.g. circular imports, new typing + # syntax, etc). + try: + hints[name] = try_eval_type(value, globalns, localns) + except Exception: + hints[name] = (value, False) + else: + hints[name] = try_eval_type(value, globalns, localns) + return hints + + +def get_cls_type_hints( + obj: type[Any], + *, + ns_resolver: NsResolver | None = None, +) -> dict[str, Any]: + """Collect annotations from a class, including those from parent classes. + + Args: + obj: The class to inspect. + ns_resolver: A namespace resolver instance to use. Defaults to an empty instance. + """ + hints: dict[str, Any] | dict[str, tuple[Any, bool]] = {} + ns_resolver = ns_resolver or NsResolver() + + for base in reversed(obj.__mro__): + ann: dict[str, Any] | None = base.__dict__.get('__annotations__') + if not ann or isinstance(ann, types.GetSetDescriptorType): + continue + with ns_resolver.push(base): + globalns, localns = ns_resolver.types_namespace + for name, value in ann.items(): + hints[name] = eval_type(value, globalns, localns) + return hints + + +def try_eval_type( + value: Any, + globalns: GlobalsNamespace | None = None, + localns: MappingNamespace | None = None, +) -> tuple[Any, bool]: + """Try evaluating the annotation using the provided namespaces. + + Args: + value: The value to evaluate. If `None`, it will be replaced by `type[None]`. If an instance + of `str`, it will be converted to a `ForwardRef`. + localns: The global namespace to use during annotation evaluation. + globalns: The local namespace to use during annotation evaluation. + + Returns: + A two-tuple containing the possibly evaluated type and a boolean indicating + whether the evaluation succeeded or not. + """ + value = _type_convert(value) + + try: + return eval_type_backport(value, globalns, localns), True + except NameError: + return value, False + + +def eval_type( + value: Any, + globalns: GlobalsNamespace | None = None, + localns: MappingNamespace | None = None, +) -> Any: + """Evaluate the annotation using the provided namespaces. + + Args: + value: The value to evaluate. If `None`, it will be replaced by `type[None]`. If an instance + of `str`, it will be converted to a `ForwardRef`. + localns: The global namespace to use during annotation evaluation. + globalns: The local namespace to use during annotation evaluation. + """ + value = _type_convert(value) + return eval_type_backport(value, globalns, localns) + + +@deprecated( + '`eval_type_lenient` is deprecated, use `try_eval_type` instead.', + category=None, +) +def eval_type_lenient( + value: Any, + globalns: GlobalsNamespace | None = None, + localns: MappingNamespace | None = None, +) -> Any: + ev, _ = try_eval_type(value, globalns, localns) + return ev + + +def eval_type_backport( + value: Any, + globalns: GlobalsNamespace | None = None, + localns: MappingNamespace | None = None, + type_params: tuple[Any, ...] | None = None, +) -> Any: + """An enhanced version of `typing._eval_type` which will fall back to using the `eval_type_backport` + package if it's installed to let older Python versions use newer typing constructs. + + Specifically, this transforms `X | Y` into `typing.Union[X, Y]` and `list[X]` into `typing.List[X]` + (as well as all the types made generic in PEP 585) if the original syntax is not supported in the + current Python version. + + This function will also display a helpful error if the value passed fails to evaluate. + """ + try: + return _eval_type_backport(value, globalns, localns, type_params) + except TypeError as e: + if 'Unable to evaluate type annotation' in str(e): + raise + + # If it is a `TypeError` and value isn't a `ForwardRef`, it would have failed during annotation definition. + # Thus we assert here for type checking purposes: + assert isinstance(value, typing.ForwardRef) + + message = f'Unable to evaluate type annotation {value.__forward_arg__!r}.' + if sys.version_info >= (3, 11): + e.add_note(message) + raise + else: + raise TypeError(message) from e + except RecursionError as e: + # TODO ideally recursion errors should be checked in `eval_type` above, but `eval_type_backport` + # is used directly in some places. + message = ( + "If you made use of an implicit recursive type alias (e.g. `MyType = list['MyType']), " + 'consider using PEP 695 type aliases instead. For more details, refer to the documentation: ' + f'https://docs.pydantic.dev/{version_short()}/concepts/types/#named-recursive-types' + ) + if sys.version_info >= (3, 11): + e.add_note(message) + raise + else: + raise RecursionError(f'{e.args[0]}\n{message}') + + +def _eval_type_backport( + value: Any, + globalns: GlobalsNamespace | None = None, + localns: MappingNamespace | None = None, + type_params: tuple[Any, ...] | None = None, +) -> Any: + try: + return _eval_type(value, globalns, localns, type_params) + except TypeError as e: + if not (isinstance(value, typing.ForwardRef) and is_backport_fixable_error(e)): + raise + + try: + from eval_type_backport import eval_type_backport + except ImportError: + raise TypeError( + f'Unable to evaluate type annotation {value.__forward_arg__!r}. If you are making use ' + 'of the new typing syntax (unions using `|` since Python 3.10 or builtins subscripting ' + 'since Python 3.9), you should either replace the use of new syntax with the existing ' + '`typing` constructs or install the `eval_type_backport` package.' + ) from e + + return eval_type_backport( + value, + globalns, + localns, # pyright: ignore[reportArgumentType], waiting on a new `eval_type_backport` release. + try_default=False, + ) + + +def _eval_type( + value: Any, + globalns: GlobalsNamespace | None = None, + localns: MappingNamespace | None = None, + type_params: tuple[Any, ...] | None = None, +) -> Any: + if sys.version_info >= (3, 13): + return typing._eval_type( # type: ignore + value, globalns, localns, type_params=type_params + ) + else: + return typing._eval_type( # type: ignore + value, globalns, localns + ) + + +def is_backport_fixable_error(e: TypeError) -> bool: + msg = str(e) + + return sys.version_info < (3, 10) and msg.startswith('unsupported operand type(s) for |: ') + + +def get_function_type_hints( + function: Callable[..., Any], + *, + include_keys: set[str] | None = None, + globalns: GlobalsNamespace | None = None, + localns: MappingNamespace | None = None, +) -> dict[str, Any]: + """Return type hints for a function. + + This is similar to the `typing.get_type_hints` function, with a few differences: + - Support `functools.partial` by using the underlying `func` attribute. + - Do not wrap type annotation of a parameter with `Optional` if it has a default value of `None` + (related bug: https://github.com/python/cpython/issues/90353, only fixed in 3.11+). + """ + try: + if isinstance(function, partial): + annotations = function.func.__annotations__ + else: + annotations = function.__annotations__ + except AttributeError: + # Some functions (e.g. builtins) don't have annotations: + return {} + + if globalns is None: + globalns = get_module_ns_of(function) + type_params: tuple[Any, ...] | None = None + if localns is None: + # If localns was specified, it is assumed to already contain type params. This is because + # Pydantic has more advanced logic to do so (see `_namespace_utils.ns_for_function`). + type_params = getattr(function, '__type_params__', ()) + + type_hints = {} + for name, value in annotations.items(): + if include_keys is not None and name not in include_keys: + continue + if value is None: + value = NoneType + elif isinstance(value, str): + value = _make_forward_ref(value) + + type_hints[name] = eval_type_backport(value, globalns, localns, type_params) + + return type_hints + + +if sys.version_info < (3, 9, 8) or (3, 10) <= sys.version_info < (3, 10, 1): + + def _make_forward_ref( + arg: Any, + is_argument: bool = True, + *, + is_class: bool = False, + ) -> typing.ForwardRef: + """Wrapper for ForwardRef that accounts for the `is_class` argument missing in older versions. + The `module` argument is omitted as it breaks <3.9.8, =3.10.0 and isn't used in the calls below. + + See https://github.com/python/cpython/pull/28560 for some background. + The backport happened on 3.9.8, see: + https://github.com/pydantic/pydantic/discussions/6244#discussioncomment-6275458, + and on 3.10.1 for the 3.10 branch, see: + https://github.com/pydantic/pydantic/issues/6912 + + Implemented as EAFP with memory. + """ + return typing.ForwardRef(arg, is_argument) + +else: + _make_forward_ref = typing.ForwardRef + + +if sys.version_info >= (3, 10): + get_type_hints = typing.get_type_hints + +else: + """ + For older versions of python, we have a custom implementation of `get_type_hints` which is a close as possible to + the implementation in CPython 3.10.8. + """ + + @typing.no_type_check + def get_type_hints( # noqa: C901 + obj: Any, + globalns: dict[str, Any] | None = None, + localns: dict[str, Any] | None = None, + include_extras: bool = False, + ) -> dict[str, Any]: # pragma: no cover + """Taken verbatim from python 3.10.8 unchanged, except: + * type annotations of the function definition above. + * prefixing `typing.` where appropriate + * Use `_make_forward_ref` instead of `typing.ForwardRef` to handle the `is_class` argument. + + https://github.com/python/cpython/blob/aaaf5174241496afca7ce4d4584570190ff972fe/Lib/typing.py#L1773-L1875 + + DO NOT CHANGE THIS METHOD UNLESS ABSOLUTELY NECESSARY. + ====================================================== + + Return type hints for an object. + + This is often the same as obj.__annotations__, but it handles + forward references encoded as string literals, adds Optional[t] if a + default value equal to None is set and recursively replaces all + 'Annotated[T, ...]' with 'T' (unless 'include_extras=True'). + + The argument may be a module, class, method, or function. The annotations + are returned as a dictionary. For classes, annotations include also + inherited members. + + TypeError is raised if the argument is not of a type that can contain + annotations, and an empty dictionary is returned if no annotations are + present. + + BEWARE -- the behavior of globalns and localns is counterintuitive + (unless you are familiar with how eval() and exec() work). The + search order is locals first, then globals. + + - If no dict arguments are passed, an attempt is made to use the + globals from obj (or the respective module's globals for classes), + and these are also used as the locals. If the object does not appear + to have globals, an empty dictionary is used. For classes, the search + order is globals first then locals. + + - If one dict argument is passed, it is used for both globals and + locals. + + - If two dict arguments are passed, they specify globals and + locals, respectively. + """ + if getattr(obj, '__no_type_check__', None): + return {} + # Classes require a special treatment. + if isinstance(obj, type): + hints = {} + for base in reversed(obj.__mro__): + if globalns is None: + base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) + else: + base_globals = globalns + ann = base.__dict__.get('__annotations__', {}) + if isinstance(ann, types.GetSetDescriptorType): + ann = {} + base_locals = dict(vars(base)) if localns is None else localns + if localns is None and globalns is None: + # This is surprising, but required. Before Python 3.10, + # get_type_hints only evaluated the globalns of + # a class. To maintain backwards compatibility, we reverse + # the globalns and localns order so that eval() looks into + # *base_globals* first rather than *base_locals*. + # This only affects ForwardRefs. + base_globals, base_locals = base_locals, base_globals + for name, value in ann.items(): + if value is None: + value = type(None) + if isinstance(value, str): + value = _make_forward_ref(value, is_argument=False, is_class=True) + + value = eval_type_backport(value, base_globals, base_locals) + hints[name] = value + if not include_extras and hasattr(typing, '_strip_annotations'): + return { + k: typing._strip_annotations(t) # type: ignore + for k, t in hints.items() + } + else: + return hints + + if globalns is None: + if isinstance(obj, types.ModuleType): + globalns = obj.__dict__ + else: + nsobj = obj + # Find globalns for the unwrapped object. + while hasattr(nsobj, '__wrapped__'): + nsobj = nsobj.__wrapped__ + globalns = getattr(nsobj, '__globals__', {}) + if localns is None: + localns = globalns + elif localns is None: + localns = globalns + hints = getattr(obj, '__annotations__', None) + if hints is None: + # Return empty annotations for something that _could_ have them. + if isinstance(obj, typing._allowed_types): # type: ignore + return {} + else: + raise TypeError(f'{obj!r} is not a module, class, method, or function.') + defaults = typing._get_defaults(obj) # type: ignore + hints = dict(hints) + for name, value in hints.items(): + if value is None: + value = type(None) + if isinstance(value, str): + # class-level forward refs were handled above, this must be either + # a module-level annotation or a function argument annotation + + value = _make_forward_ref( + value, + is_argument=not isinstance(obj, types.ModuleType), + is_class=False, + ) + value = eval_type_backport(value, globalns, localns) + if name in defaults and defaults[name] is None: + value = typing.Optional[value] + hints[name] = value + return hints if include_extras else {k: typing._strip_annotations(t) for k, t in hints.items()} # type: ignore diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_utils.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..f33464987bc985f1a0deea4ed4653b99f7a8d731 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_utils.py @@ -0,0 +1,431 @@ +"""Bucket of reusable internal utilities. + +This should be reduced as much as possible with functions only used in one place, moved to that place. +""" + +from __future__ import annotations as _annotations + +import dataclasses +import keyword +import sys +import typing +import warnings +import weakref +from collections import OrderedDict, defaultdict, deque +from collections.abc import Mapping +from copy import deepcopy +from functools import cached_property +from inspect import Parameter +from itertools import zip_longest +from types import BuiltinFunctionType, CodeType, FunctionType, GeneratorType, LambdaType, ModuleType +from typing import Any, Callable, Generic, TypeVar, overload + +from typing_extensions import TypeAlias, TypeGuard, deprecated + +from pydantic import PydanticDeprecatedSince211 + +from . import _repr, _typing_extra +from ._import_utils import import_cached_base_model + +if typing.TYPE_CHECKING: + MappingIntStrAny: TypeAlias = 'typing.Mapping[int, Any] | typing.Mapping[str, Any]' + AbstractSetIntStr: TypeAlias = 'typing.AbstractSet[int] | typing.AbstractSet[str]' + from ..main import BaseModel + + +# these are types that are returned unchanged by deepcopy +IMMUTABLE_NON_COLLECTIONS_TYPES: set[type[Any]] = { + int, + float, + complex, + str, + bool, + bytes, + type, + _typing_extra.NoneType, + FunctionType, + BuiltinFunctionType, + LambdaType, + weakref.ref, + CodeType, + # note: including ModuleType will differ from behaviour of deepcopy by not producing error. + # It might be not a good idea in general, but considering that this function used only internally + # against default values of fields, this will allow to actually have a field with module as default value + ModuleType, + NotImplemented.__class__, + Ellipsis.__class__, +} + +# these are types that if empty, might be copied with simple copy() instead of deepcopy() +BUILTIN_COLLECTIONS: set[type[Any]] = { + list, + set, + tuple, + frozenset, + dict, + OrderedDict, + defaultdict, + deque, +} + + +def can_be_positional(param: Parameter) -> bool: + """Return whether the parameter accepts a positional argument. + + ```python {test="skip" lint="skip"} + def func(a, /, b, *, c): + pass + + params = inspect.signature(func).parameters + can_be_positional(params['a']) + #> True + can_be_positional(params['b']) + #> True + can_be_positional(params['c']) + #> False + ``` + """ + return param.kind in (Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD) + + +def sequence_like(v: Any) -> bool: + return isinstance(v, (list, tuple, set, frozenset, GeneratorType, deque)) + + +def lenient_isinstance(o: Any, class_or_tuple: type[Any] | tuple[type[Any], ...] | None) -> bool: # pragma: no cover + try: + return isinstance(o, class_or_tuple) # type: ignore[arg-type] + except TypeError: + return False + + +def lenient_issubclass(cls: Any, class_or_tuple: Any) -> bool: # pragma: no cover + try: + return isinstance(cls, type) and issubclass(cls, class_or_tuple) + except TypeError: + if isinstance(cls, _typing_extra.WithArgsTypes): + return False + raise # pragma: no cover + + +def is_model_class(cls: Any) -> TypeGuard[type[BaseModel]]: + """Returns true if cls is a _proper_ subclass of BaseModel, and provides proper type-checking, + unlike raw calls to lenient_issubclass. + """ + BaseModel = import_cached_base_model() + + return lenient_issubclass(cls, BaseModel) and cls is not BaseModel + + +def is_valid_identifier(identifier: str) -> bool: + """Checks that a string is a valid identifier and not a Python keyword. + :param identifier: The identifier to test. + :return: True if the identifier is valid. + """ + return identifier.isidentifier() and not keyword.iskeyword(identifier) + + +KeyType = TypeVar('KeyType') + + +def deep_update(mapping: dict[KeyType, Any], *updating_mappings: dict[KeyType, Any]) -> dict[KeyType, Any]: + updated_mapping = mapping.copy() + for updating_mapping in updating_mappings: + for k, v in updating_mapping.items(): + if k in updated_mapping and isinstance(updated_mapping[k], dict) and isinstance(v, dict): + updated_mapping[k] = deep_update(updated_mapping[k], v) + else: + updated_mapping[k] = v + return updated_mapping + + +def update_not_none(mapping: dict[Any, Any], **update: Any) -> None: + mapping.update({k: v for k, v in update.items() if v is not None}) + + +T = TypeVar('T') + + +def unique_list( + input_list: list[T] | tuple[T, ...], + *, + name_factory: typing.Callable[[T], str] = str, +) -> list[T]: + """Make a list unique while maintaining order. + We update the list if another one with the same name is set + (e.g. model validator overridden in subclass). + """ + result: list[T] = [] + result_names: list[str] = [] + for v in input_list: + v_name = name_factory(v) + if v_name not in result_names: + result_names.append(v_name) + result.append(v) + else: + result[result_names.index(v_name)] = v + + return result + + +class ValueItems(_repr.Representation): + """Class for more convenient calculation of excluded or included fields on values.""" + + __slots__ = ('_items', '_type') + + def __init__(self, value: Any, items: AbstractSetIntStr | MappingIntStrAny) -> None: + items = self._coerce_items(items) + + if isinstance(value, (list, tuple)): + items = self._normalize_indexes(items, len(value)) # type: ignore + + self._items: MappingIntStrAny = items # type: ignore + + def is_excluded(self, item: Any) -> bool: + """Check if item is fully excluded. + + :param item: key or index of a value + """ + return self.is_true(self._items.get(item)) + + def is_included(self, item: Any) -> bool: + """Check if value is contained in self._items. + + :param item: key or index of value + """ + return item in self._items + + def for_element(self, e: int | str) -> AbstractSetIntStr | MappingIntStrAny | None: + """:param e: key or index of element on value + :return: raw values for element if self._items is dict and contain needed element + """ + item = self._items.get(e) # type: ignore + return item if not self.is_true(item) else None + + def _normalize_indexes(self, items: MappingIntStrAny, v_length: int) -> dict[int | str, Any]: + """:param items: dict or set of indexes which will be normalized + :param v_length: length of sequence indexes of which will be + + >>> self._normalize_indexes({0: True, -2: True, -1: True}, 4) + {0: True, 2: True, 3: True} + >>> self._normalize_indexes({'__all__': True}, 4) + {0: True, 1: True, 2: True, 3: True} + """ + normalized_items: dict[int | str, Any] = {} + all_items = None + for i, v in items.items(): + if not (isinstance(v, typing.Mapping) or isinstance(v, typing.AbstractSet) or self.is_true(v)): + raise TypeError(f'Unexpected type of exclude value for index "{i}" {v.__class__}') + if i == '__all__': + all_items = self._coerce_value(v) + continue + if not isinstance(i, int): + raise TypeError( + 'Excluding fields from a sequence of sub-models or dicts must be performed index-wise: ' + 'expected integer keys or keyword "__all__"' + ) + normalized_i = v_length + i if i < 0 else i + normalized_items[normalized_i] = self.merge(v, normalized_items.get(normalized_i)) + + if not all_items: + return normalized_items + if self.is_true(all_items): + for i in range(v_length): + normalized_items.setdefault(i, ...) + return normalized_items + for i in range(v_length): + normalized_item = normalized_items.setdefault(i, {}) + if not self.is_true(normalized_item): + normalized_items[i] = self.merge(all_items, normalized_item) + return normalized_items + + @classmethod + def merge(cls, base: Any, override: Any, intersect: bool = False) -> Any: + """Merge a `base` item with an `override` item. + + Both `base` and `override` are converted to dictionaries if possible. + Sets are converted to dictionaries with the sets entries as keys and + Ellipsis as values. + + Each key-value pair existing in `base` is merged with `override`, + while the rest of the key-value pairs are updated recursively with this function. + + Merging takes place based on the "union" of keys if `intersect` is + set to `False` (default) and on the intersection of keys if + `intersect` is set to `True`. + """ + override = cls._coerce_value(override) + base = cls._coerce_value(base) + if override is None: + return base + if cls.is_true(base) or base is None: + return override + if cls.is_true(override): + return base if intersect else override + + # intersection or union of keys while preserving ordering: + if intersect: + merge_keys = [k for k in base if k in override] + [k for k in override if k in base] + else: + merge_keys = list(base) + [k for k in override if k not in base] + + merged: dict[int | str, Any] = {} + for k in merge_keys: + merged_item = cls.merge(base.get(k), override.get(k), intersect=intersect) + if merged_item is not None: + merged[k] = merged_item + + return merged + + @staticmethod + def _coerce_items(items: AbstractSetIntStr | MappingIntStrAny) -> MappingIntStrAny: + if isinstance(items, typing.Mapping): + pass + elif isinstance(items, typing.AbstractSet): + items = dict.fromkeys(items, ...) # type: ignore + else: + class_name = getattr(items, '__class__', '???') + raise TypeError(f'Unexpected type of exclude value {class_name}') + return items # type: ignore + + @classmethod + def _coerce_value(cls, value: Any) -> Any: + if value is None or cls.is_true(value): + return value + return cls._coerce_items(value) + + @staticmethod + def is_true(v: Any) -> bool: + return v is True or v is ... + + def __repr_args__(self) -> _repr.ReprArgs: + return [(None, self._items)] + + +if typing.TYPE_CHECKING: + + def LazyClassAttribute(name: str, get_value: Callable[[], T]) -> T: ... + +else: + + class LazyClassAttribute: + """A descriptor exposing an attribute only accessible on a class (hidden from instances). + + The attribute is lazily computed and cached during the first access. + """ + + def __init__(self, name: str, get_value: Callable[[], Any]) -> None: + self.name = name + self.get_value = get_value + + @cached_property + def value(self) -> Any: + return self.get_value() + + def __get__(self, instance: Any, owner: type[Any]) -> None: + if instance is None: + return self.value + raise AttributeError(f'{self.name!r} attribute of {owner.__name__!r} is class-only') + + +Obj = TypeVar('Obj') + + +def smart_deepcopy(obj: Obj) -> Obj: + """Return type as is for immutable built-in types + Use obj.copy() for built-in empty collections + Use copy.deepcopy() for non-empty collections and unknown objects. + """ + obj_type = obj.__class__ + if obj_type in IMMUTABLE_NON_COLLECTIONS_TYPES: + return obj # fastest case: obj is immutable and not collection therefore will not be copied anyway + try: + if not obj and obj_type in BUILTIN_COLLECTIONS: + # faster way for empty collections, no need to copy its members + return obj if obj_type is tuple else obj.copy() # tuple doesn't have copy method # type: ignore + except (TypeError, ValueError, RuntimeError): + # do we really dare to catch ALL errors? Seems a bit risky + pass + + return deepcopy(obj) # slowest way when we actually might need a deepcopy + + +_SENTINEL = object() + + +def all_identical(left: typing.Iterable[Any], right: typing.Iterable[Any]) -> bool: + """Check that the items of `left` are the same objects as those in `right`. + + >>> a, b = object(), object() + >>> all_identical([a, b, a], [a, b, a]) + True + >>> all_identical([a, b, [a]], [a, b, [a]]) # new list object, while "equal" is not "identical" + False + """ + for left_item, right_item in zip_longest(left, right, fillvalue=_SENTINEL): + if left_item is not right_item: + return False + return True + + +@dataclasses.dataclass(frozen=True) +class SafeGetItemProxy: + """Wrapper redirecting `__getitem__` to `get` with a sentinel value as default + + This makes is safe to use in `operator.itemgetter` when some keys may be missing + """ + + # Define __slots__manually for performances + # @dataclasses.dataclass() only support slots=True in python>=3.10 + __slots__ = ('wrapped',) + + wrapped: Mapping[str, Any] + + def __getitem__(self, key: str, /) -> Any: + return self.wrapped.get(key, _SENTINEL) + + # required to pass the object to operator.itemgetter() instances due to a quirk of typeshed + # https://github.com/python/mypy/issues/13713 + # https://github.com/python/typeshed/pull/8785 + # Since this is typing-only, hide it in a typing.TYPE_CHECKING block + if typing.TYPE_CHECKING: + + def __contains__(self, key: str, /) -> bool: + return self.wrapped.__contains__(key) + + +_ModelT = TypeVar('_ModelT', bound='BaseModel') +_RT = TypeVar('_RT') + + +class deprecated_instance_property(Generic[_ModelT, _RT]): + """A decorator exposing the decorated class method as a property, with a warning on instance access. + + This decorator takes a class method defined on the `BaseModel` class and transforms it into + an attribute. The attribute can be accessed on both the class and instances of the class. If accessed + via an instance, a deprecation warning is emitted stating that instance access will be removed in V3. + """ + + def __init__(self, fget: Callable[[type[_ModelT]], _RT], /) -> None: + # Note: fget should be a classmethod: + self.fget = fget + + @overload + def __get__(self, instance: None, objtype: type[_ModelT]) -> _RT: ... + @overload + @deprecated( + 'Accessing this attribute on the instance is deprecated, and will be removed in Pydantic V3. ' + 'Instead, you should access this attribute from the model class.', + category=None, + ) + def __get__(self, instance: _ModelT, objtype: type[_ModelT]) -> _RT: ... + def __get__(self, instance: _ModelT | None, objtype: type[_ModelT]) -> _RT: + if instance is not None: + attr_name = self.fget.__name__ if sys.version_info >= (3, 10) else self.fget.__func__.__name__ + warnings.warn( + f'Accessing the {attr_name!r} attribute on the instance is deprecated. ' + 'Instead, you should access this attribute from the model class.', + category=PydanticDeprecatedSince211, + stacklevel=2, + ) + return self.fget.__get__(instance, objtype)() diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py new file mode 100644 index 0000000000000000000000000000000000000000..ab82832fe4dfb246ee8d06afcbd5b70652f88e27 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py @@ -0,0 +1,140 @@ +from __future__ import annotations as _annotations + +import functools +import inspect +from collections.abc import Awaitable +from functools import partial +from typing import Any, Callable + +import pydantic_core + +from ..config import ConfigDict +from ..plugin._schema_validator import create_schema_validator +from ._config import ConfigWrapper +from ._generate_schema import GenerateSchema, ValidateCallSupportedTypes +from ._namespace_utils import MappingNamespace, NsResolver, ns_for_function + + +def extract_function_name(func: ValidateCallSupportedTypes) -> str: + """Extract the name of a `ValidateCallSupportedTypes` object.""" + return f'partial({func.func.__name__})' if isinstance(func, functools.partial) else func.__name__ + + +def extract_function_qualname(func: ValidateCallSupportedTypes) -> str: + """Extract the qualname of a `ValidateCallSupportedTypes` object.""" + return f'partial({func.func.__qualname__})' if isinstance(func, functools.partial) else func.__qualname__ + + +def update_wrapper_attributes(wrapped: ValidateCallSupportedTypes, wrapper: Callable[..., Any]): + """Update the `wrapper` function with the attributes of the `wrapped` function. Return the updated function.""" + if inspect.iscoroutinefunction(wrapped): + + @functools.wraps(wrapped) + async def wrapper_function(*args, **kwargs): # type: ignore + return await wrapper(*args, **kwargs) + else: + + @functools.wraps(wrapped) + def wrapper_function(*args, **kwargs): + return wrapper(*args, **kwargs) + + # We need to manually update this because `partial` object has no `__name__` and `__qualname__`. + wrapper_function.__name__ = extract_function_name(wrapped) + wrapper_function.__qualname__ = extract_function_qualname(wrapped) + wrapper_function.raw_function = wrapped # type: ignore + + return wrapper_function + + +class ValidateCallWrapper: + """This is a wrapper around a function that validates the arguments passed to it, and optionally the return value.""" + + __slots__ = ( + 'function', + 'validate_return', + 'schema_type', + 'module', + 'qualname', + 'ns_resolver', + 'config_wrapper', + '__pydantic_complete__', + '__pydantic_validator__', + '__return_pydantic_validator__', + ) + + def __init__( + self, + function: ValidateCallSupportedTypes, + config: ConfigDict | None, + validate_return: bool, + parent_namespace: MappingNamespace | None, + ) -> None: + self.function = function + self.validate_return = validate_return + if isinstance(function, partial): + self.schema_type = function.func + self.module = function.func.__module__ + else: + self.schema_type = function + self.module = function.__module__ + self.qualname = extract_function_qualname(function) + + self.ns_resolver = NsResolver( + namespaces_tuple=ns_for_function(self.schema_type, parent_namespace=parent_namespace) + ) + self.config_wrapper = ConfigWrapper(config) + if not self.config_wrapper.defer_build: + self._create_validators() + else: + self.__pydantic_complete__ = False + + def _create_validators(self) -> None: + gen_schema = GenerateSchema(self.config_wrapper, self.ns_resolver) + schema = gen_schema.clean_schema(gen_schema.generate_schema(self.function)) + core_config = self.config_wrapper.core_config(title=self.qualname) + + self.__pydantic_validator__ = create_schema_validator( + schema, + self.schema_type, + self.module, + self.qualname, + 'validate_call', + core_config, + self.config_wrapper.plugin_settings, + ) + if self.validate_return: + signature = inspect.signature(self.function) + return_type = signature.return_annotation if signature.return_annotation is not signature.empty else Any + gen_schema = GenerateSchema(self.config_wrapper, self.ns_resolver) + schema = gen_schema.clean_schema(gen_schema.generate_schema(return_type)) + validator = create_schema_validator( + schema, + self.schema_type, + self.module, + self.qualname, + 'validate_call', + core_config, + self.config_wrapper.plugin_settings, + ) + if inspect.iscoroutinefunction(self.function): + + async def return_val_wrapper(aw: Awaitable[Any]) -> None: + return validator.validate_python(await aw) + + self.__return_pydantic_validator__ = return_val_wrapper + else: + self.__return_pydantic_validator__ = validator.validate_python + else: + self.__return_pydantic_validator__ = None + + self.__pydantic_complete__ = True + + def __call__(self, *args: Any, **kwargs: Any) -> Any: + if not self.__pydantic_complete__: + self._create_validators() + + res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs)) + if self.__return_pydantic_validator__: + return self.__return_pydantic_validator__(res) + else: + return res diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_validators.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_validators.py new file mode 100644 index 0000000000000000000000000000000000000000..803363ca2f34eb9b57702d3f7ed02258fd0c1610 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/_internal/_validators.py @@ -0,0 +1,532 @@ +"""Validator functions for standard library types. + +Import of this module is deferred since it contains imports of many standard library modules. +""" + +from __future__ import annotations as _annotations + +import collections.abc +import math +import re +import typing +from decimal import Decimal +from fractions import Fraction +from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network +from typing import Any, Callable, Union, cast, get_origin +from zoneinfo import ZoneInfo, ZoneInfoNotFoundError + +import typing_extensions +from pydantic_core import PydanticCustomError, core_schema +from pydantic_core._pydantic_core import PydanticKnownError +from typing_inspection import typing_objects + +from pydantic._internal._import_utils import import_cached_field_info +from pydantic.errors import PydanticSchemaGenerationError + + +def sequence_validator( + input_value: typing.Sequence[Any], + /, + validator: core_schema.ValidatorFunctionWrapHandler, +) -> typing.Sequence[Any]: + """Validator for `Sequence` types, isinstance(v, Sequence) has already been called.""" + value_type = type(input_value) + + # We don't accept any plain string as a sequence + # Relevant issue: https://github.com/pydantic/pydantic/issues/5595 + if issubclass(value_type, (str, bytes)): + raise PydanticCustomError( + 'sequence_str', + "'{type_name}' instances are not allowed as a Sequence value", + {'type_name': value_type.__name__}, + ) + + # TODO: refactor sequence validation to validate with either a list or a tuple + # schema, depending on the type of the value. + # Additionally, we should be able to remove one of either this validator or the + # SequenceValidator in _std_types_schema.py (preferably this one, while porting over some logic). + # Effectively, a refactor for sequence validation is needed. + if value_type is tuple: + input_value = list(input_value) + + v_list = validator(input_value) + + # the rest of the logic is just re-creating the original type from `v_list` + if value_type is list: + return v_list + elif issubclass(value_type, range): + # return the list as we probably can't re-create the range + return v_list + elif value_type is tuple: + return tuple(v_list) + else: + # best guess at how to re-create the original type, more custom construction logic might be required + return value_type(v_list) # type: ignore[call-arg] + + +def import_string(value: Any) -> Any: + if isinstance(value, str): + try: + return _import_string_logic(value) + except ImportError as e: + raise PydanticCustomError('import_error', 'Invalid python path: {error}', {'error': str(e)}) from e + else: + # otherwise we just return the value and let the next validator do the rest of the work + return value + + +def _import_string_logic(dotted_path: str) -> Any: + """Inspired by uvicorn — dotted paths should include a colon before the final item if that item is not a module. + (This is necessary to distinguish between a submodule and an attribute when there is a conflict.). + + If the dotted path does not include a colon and the final item is not a valid module, importing as an attribute + rather than a submodule will be attempted automatically. + + So, for example, the following values of `dotted_path` result in the following returned values: + * 'collections': + * 'collections.abc': + * 'collections.abc:Mapping': + * `collections.abc.Mapping`: (though this is a bit slower than the previous line) + + An error will be raised under any of the following scenarios: + * `dotted_path` contains more than one colon (e.g., 'collections:abc:Mapping') + * the substring of `dotted_path` before the colon is not a valid module in the environment (e.g., '123:Mapping') + * the substring of `dotted_path` after the colon is not an attribute of the module (e.g., 'collections:abc123') + """ + from importlib import import_module + + components = dotted_path.strip().split(':') + if len(components) > 2: + raise ImportError(f"Import strings should have at most one ':'; received {dotted_path!r}") + + module_path = components[0] + if not module_path: + raise ImportError(f'Import strings should have a nonempty module name; received {dotted_path!r}') + + try: + module = import_module(module_path) + except ModuleNotFoundError as e: + if '.' in module_path: + # Check if it would be valid if the final item was separated from its module with a `:` + maybe_module_path, maybe_attribute = dotted_path.strip().rsplit('.', 1) + try: + return _import_string_logic(f'{maybe_module_path}:{maybe_attribute}') + except ImportError: + pass + raise ImportError(f'No module named {module_path!r}') from e + raise e + + if len(components) > 1: + attribute = components[1] + try: + return getattr(module, attribute) + except AttributeError as e: + raise ImportError(f'cannot import name {attribute!r} from {module_path!r}') from e + else: + return module + + +def pattern_either_validator(input_value: Any, /) -> typing.Pattern[Any]: + if isinstance(input_value, typing.Pattern): + return input_value + elif isinstance(input_value, (str, bytes)): + # todo strict mode + return compile_pattern(input_value) # type: ignore + else: + raise PydanticCustomError('pattern_type', 'Input should be a valid pattern') + + +def pattern_str_validator(input_value: Any, /) -> typing.Pattern[str]: + if isinstance(input_value, typing.Pattern): + if isinstance(input_value.pattern, str): + return input_value + else: + raise PydanticCustomError('pattern_str_type', 'Input should be a string pattern') + elif isinstance(input_value, str): + return compile_pattern(input_value) + elif isinstance(input_value, bytes): + raise PydanticCustomError('pattern_str_type', 'Input should be a string pattern') + else: + raise PydanticCustomError('pattern_type', 'Input should be a valid pattern') + + +def pattern_bytes_validator(input_value: Any, /) -> typing.Pattern[bytes]: + if isinstance(input_value, typing.Pattern): + if isinstance(input_value.pattern, bytes): + return input_value + else: + raise PydanticCustomError('pattern_bytes_type', 'Input should be a bytes pattern') + elif isinstance(input_value, bytes): + return compile_pattern(input_value) + elif isinstance(input_value, str): + raise PydanticCustomError('pattern_bytes_type', 'Input should be a bytes pattern') + else: + raise PydanticCustomError('pattern_type', 'Input should be a valid pattern') + + +PatternType = typing.TypeVar('PatternType', str, bytes) + + +def compile_pattern(pattern: PatternType) -> typing.Pattern[PatternType]: + try: + return re.compile(pattern) + except re.error: + raise PydanticCustomError('pattern_regex', 'Input should be a valid regular expression') + + +def ip_v4_address_validator(input_value: Any, /) -> IPv4Address: + if isinstance(input_value, IPv4Address): + return input_value + + try: + return IPv4Address(input_value) + except ValueError: + raise PydanticCustomError('ip_v4_address', 'Input is not a valid IPv4 address') + + +def ip_v6_address_validator(input_value: Any, /) -> IPv6Address: + if isinstance(input_value, IPv6Address): + return input_value + + try: + return IPv6Address(input_value) + except ValueError: + raise PydanticCustomError('ip_v6_address', 'Input is not a valid IPv6 address') + + +def ip_v4_network_validator(input_value: Any, /) -> IPv4Network: + """Assume IPv4Network initialised with a default `strict` argument. + + See more: + https://docs.python.org/library/ipaddress.html#ipaddress.IPv4Network + """ + if isinstance(input_value, IPv4Network): + return input_value + + try: + return IPv4Network(input_value) + except ValueError: + raise PydanticCustomError('ip_v4_network', 'Input is not a valid IPv4 network') + + +def ip_v6_network_validator(input_value: Any, /) -> IPv6Network: + """Assume IPv6Network initialised with a default `strict` argument. + + See more: + https://docs.python.org/library/ipaddress.html#ipaddress.IPv6Network + """ + if isinstance(input_value, IPv6Network): + return input_value + + try: + return IPv6Network(input_value) + except ValueError: + raise PydanticCustomError('ip_v6_network', 'Input is not a valid IPv6 network') + + +def ip_v4_interface_validator(input_value: Any, /) -> IPv4Interface: + if isinstance(input_value, IPv4Interface): + return input_value + + try: + return IPv4Interface(input_value) + except ValueError: + raise PydanticCustomError('ip_v4_interface', 'Input is not a valid IPv4 interface') + + +def ip_v6_interface_validator(input_value: Any, /) -> IPv6Interface: + if isinstance(input_value, IPv6Interface): + return input_value + + try: + return IPv6Interface(input_value) + except ValueError: + raise PydanticCustomError('ip_v6_interface', 'Input is not a valid IPv6 interface') + + +def fraction_validator(input_value: Any, /) -> Fraction: + if isinstance(input_value, Fraction): + return input_value + + try: + return Fraction(input_value) + except ValueError: + raise PydanticCustomError('fraction_parsing', 'Input is not a valid fraction') + + +def forbid_inf_nan_check(x: Any) -> Any: + if not math.isfinite(x): + raise PydanticKnownError('finite_number') + return x + + +def _safe_repr(v: Any) -> int | float | str: + """The context argument for `PydanticKnownError` requires a number or str type, so we do a simple repr() coercion for types like timedelta. + + See tests/test_types.py::test_annotated_metadata_any_order for some context. + """ + if isinstance(v, (int, float, str)): + return v + return repr(v) + + +def greater_than_validator(x: Any, gt: Any) -> Any: + try: + if not (x > gt): + raise PydanticKnownError('greater_than', {'gt': _safe_repr(gt)}) + return x + except TypeError: + raise TypeError(f"Unable to apply constraint 'gt' to supplied value {x}") + + +def greater_than_or_equal_validator(x: Any, ge: Any) -> Any: + try: + if not (x >= ge): + raise PydanticKnownError('greater_than_equal', {'ge': _safe_repr(ge)}) + return x + except TypeError: + raise TypeError(f"Unable to apply constraint 'ge' to supplied value {x}") + + +def less_than_validator(x: Any, lt: Any) -> Any: + try: + if not (x < lt): + raise PydanticKnownError('less_than', {'lt': _safe_repr(lt)}) + return x + except TypeError: + raise TypeError(f"Unable to apply constraint 'lt' to supplied value {x}") + + +def less_than_or_equal_validator(x: Any, le: Any) -> Any: + try: + if not (x <= le): + raise PydanticKnownError('less_than_equal', {'le': _safe_repr(le)}) + return x + except TypeError: + raise TypeError(f"Unable to apply constraint 'le' to supplied value {x}") + + +def multiple_of_validator(x: Any, multiple_of: Any) -> Any: + try: + if x % multiple_of: + raise PydanticKnownError('multiple_of', {'multiple_of': _safe_repr(multiple_of)}) + return x + except TypeError: + raise TypeError(f"Unable to apply constraint 'multiple_of' to supplied value {x}") + + +def min_length_validator(x: Any, min_length: Any) -> Any: + try: + if not (len(x) >= min_length): + raise PydanticKnownError( + 'too_short', {'field_type': 'Value', 'min_length': min_length, 'actual_length': len(x)} + ) + return x + except TypeError: + raise TypeError(f"Unable to apply constraint 'min_length' to supplied value {x}") + + +def max_length_validator(x: Any, max_length: Any) -> Any: + try: + if len(x) > max_length: + raise PydanticKnownError( + 'too_long', + {'field_type': 'Value', 'max_length': max_length, 'actual_length': len(x)}, + ) + return x + except TypeError: + raise TypeError(f"Unable to apply constraint 'max_length' to supplied value {x}") + + +def _extract_decimal_digits_info(decimal: Decimal) -> tuple[int, int]: + """Compute the total number of digits and decimal places for a given [`Decimal`][decimal.Decimal] instance. + + This function handles both normalized and non-normalized Decimal instances. + Example: Decimal('1.230') -> 4 digits, 3 decimal places + + Args: + decimal (Decimal): The decimal number to analyze. + + Returns: + tuple[int, int]: A tuple containing the number of decimal places and total digits. + + Though this could be divided into two separate functions, the logic is easier to follow if we couple the computation + of the number of decimals and digits together. + """ + try: + decimal_tuple = decimal.as_tuple() + + assert isinstance(decimal_tuple.exponent, int) + + exponent = decimal_tuple.exponent + num_digits = len(decimal_tuple.digits) + + if exponent >= 0: + # A positive exponent adds that many trailing zeros + # Ex: digit_tuple=(1, 2, 3), exponent=2 -> 12300 -> 0 decimal places, 5 digits + num_digits += exponent + decimal_places = 0 + else: + # If the absolute value of the negative exponent is larger than the + # number of digits, then it's the same as the number of digits, + # because it'll consume all the digits in digit_tuple and then + # add abs(exponent) - len(digit_tuple) leading zeros after the decimal point. + # Ex: digit_tuple=(1, 2, 3), exponent=-2 -> 1.23 -> 2 decimal places, 3 digits + # Ex: digit_tuple=(1, 2, 3), exponent=-4 -> 0.0123 -> 4 decimal places, 4 digits + decimal_places = abs(exponent) + num_digits = max(num_digits, decimal_places) + + return decimal_places, num_digits + except (AssertionError, AttributeError): + raise TypeError(f'Unable to extract decimal digits info from supplied value {decimal}') + + +def max_digits_validator(x: Any, max_digits: Any) -> Any: + try: + _, num_digits = _extract_decimal_digits_info(x) + _, normalized_num_digits = _extract_decimal_digits_info(x.normalize()) + if (num_digits > max_digits) and (normalized_num_digits > max_digits): + raise PydanticKnownError( + 'decimal_max_digits', + {'max_digits': max_digits}, + ) + return x + except TypeError: + raise TypeError(f"Unable to apply constraint 'max_digits' to supplied value {x}") + + +def decimal_places_validator(x: Any, decimal_places: Any) -> Any: + try: + decimal_places_, _ = _extract_decimal_digits_info(x) + if decimal_places_ > decimal_places: + normalized_decimal_places, _ = _extract_decimal_digits_info(x.normalize()) + if normalized_decimal_places > decimal_places: + raise PydanticKnownError( + 'decimal_max_places', + {'decimal_places': decimal_places}, + ) + return x + except TypeError: + raise TypeError(f"Unable to apply constraint 'decimal_places' to supplied value {x}") + + +def deque_validator(input_value: Any, handler: core_schema.ValidatorFunctionWrapHandler) -> collections.deque[Any]: + return collections.deque(handler(input_value), maxlen=getattr(input_value, 'maxlen', None)) + + +def defaultdict_validator( + input_value: Any, handler: core_schema.ValidatorFunctionWrapHandler, default_default_factory: Callable[[], Any] +) -> collections.defaultdict[Any, Any]: + if isinstance(input_value, collections.defaultdict): + default_factory = input_value.default_factory + return collections.defaultdict(default_factory, handler(input_value)) + else: + return collections.defaultdict(default_default_factory, handler(input_value)) + + +def get_defaultdict_default_default_factory(values_source_type: Any) -> Callable[[], Any]: + FieldInfo = import_cached_field_info() + + values_type_origin = get_origin(values_source_type) + + def infer_default() -> Callable[[], Any]: + allowed_default_types: dict[Any, Any] = { + tuple: tuple, + collections.abc.Sequence: tuple, + collections.abc.MutableSequence: list, + list: list, + typing.Sequence: list, + set: set, + typing.MutableSet: set, + collections.abc.MutableSet: set, + collections.abc.Set: frozenset, + typing.MutableMapping: dict, + typing.Mapping: dict, + collections.abc.Mapping: dict, + collections.abc.MutableMapping: dict, + float: float, + int: int, + str: str, + bool: bool, + } + values_type = values_type_origin or values_source_type + instructions = 'set using `DefaultDict[..., Annotated[..., Field(default_factory=...)]]`' + if typing_objects.is_typevar(values_type): + + def type_var_default_factory() -> None: + raise RuntimeError( + 'Generic defaultdict cannot be used without a concrete value type or an' + ' explicit default factory, ' + instructions + ) + + return type_var_default_factory + elif values_type not in allowed_default_types: + # a somewhat subjective set of types that have reasonable default values + allowed_msg = ', '.join([t.__name__ for t in set(allowed_default_types.values())]) + raise PydanticSchemaGenerationError( + f'Unable to infer a default factory for keys of type {values_source_type}.' + f' Only {allowed_msg} are supported, other types require an explicit default factory' + ' ' + instructions + ) + return allowed_default_types[values_type] + + # Assume Annotated[..., Field(...)] + if typing_objects.is_annotated(values_type_origin): + field_info = next((v for v in typing_extensions.get_args(values_source_type) if isinstance(v, FieldInfo)), None) + else: + field_info = None + if field_info and field_info.default_factory: + # Assume the default factory does not take any argument: + default_default_factory = cast(Callable[[], Any], field_info.default_factory) + else: + default_default_factory = infer_default() + return default_default_factory + + +def validate_str_is_valid_iana_tz(value: Any, /) -> ZoneInfo: + if isinstance(value, ZoneInfo): + return value + try: + return ZoneInfo(value) + except (ZoneInfoNotFoundError, ValueError, TypeError): + raise PydanticCustomError('zoneinfo_str', 'invalid timezone: {value}', {'value': value}) + + +NUMERIC_VALIDATOR_LOOKUP: dict[str, Callable] = { + 'gt': greater_than_validator, + 'ge': greater_than_or_equal_validator, + 'lt': less_than_validator, + 'le': less_than_or_equal_validator, + 'multiple_of': multiple_of_validator, + 'min_length': min_length_validator, + 'max_length': max_length_validator, + 'max_digits': max_digits_validator, + 'decimal_places': decimal_places_validator, +} + +IpType = Union[IPv4Address, IPv6Address, IPv4Network, IPv6Network, IPv4Interface, IPv6Interface] + +IP_VALIDATOR_LOOKUP: dict[type[IpType], Callable] = { + IPv4Address: ip_v4_address_validator, + IPv6Address: ip_v6_address_validator, + IPv4Network: ip_v4_network_validator, + IPv6Network: ip_v6_network_validator, + IPv4Interface: ip_v4_interface_validator, + IPv6Interface: ip_v6_interface_validator, +} + +MAPPING_ORIGIN_MAP: dict[Any, Any] = { + typing.DefaultDict: collections.defaultdict, # noqa: UP006 + collections.defaultdict: collections.defaultdict, + typing.OrderedDict: collections.OrderedDict, # noqa: UP006 + collections.OrderedDict: collections.OrderedDict, + typing_extensions.OrderedDict: collections.OrderedDict, + typing.Counter: collections.Counter, + collections.Counter: collections.Counter, + # this doesn't handle subclasses of these + typing.Mapping: dict, + typing.MutableMapping: dict, + # parametrized typing.{Mutable}Mapping creates one of these + collections.abc.Mapping: dict, + collections.abc.MutableMapping: dict, +} diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e0db897b0e9bb553f0c7d3cf7b893382326fdc5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/class_validators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/class_validators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ab6d77533f2292cbb93cd1441135cd097a598bf Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/class_validators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/config.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/config.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8968fd905142f57b1d1a4532af8d7380096e3208 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/config.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/copy_internals.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/copy_internals.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f434c2000caee9c2e8b5be515fb7c651e690731b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/copy_internals.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/decorator.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/decorator.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..79a711a73bc290c19ece9e25a9aa939edf42a0f9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/decorator.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/json.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/json.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee21b3578f97e6edef3563ec65db3a5c07590f63 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/json.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/parse.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/parse.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b944714f5c58cd251042239e19ebe8c46cda6ec Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/parse.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/tools.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/tools.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae12a2b147e64a134d189b22c241aa46c9c55ee2 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/__pycache__/tools.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/class_validators.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/class_validators.py new file mode 100644 index 0000000000000000000000000000000000000000..ad92864c0f5ba6c79d5722f53b02f0932116d531 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/class_validators.py @@ -0,0 +1,256 @@ +"""Old `@validator` and `@root_validator` function validators from V1.""" + +from __future__ import annotations as _annotations + +from functools import partial, partialmethod +from types import FunctionType +from typing import TYPE_CHECKING, Any, Callable, Literal, TypeVar, Union, overload +from warnings import warn + +from typing_extensions import Protocol, TypeAlias, deprecated + +from .._internal import _decorators, _decorators_v1 +from ..errors import PydanticUserError +from ..warnings import PydanticDeprecatedSince20 + +_ALLOW_REUSE_WARNING_MESSAGE = '`allow_reuse` is deprecated and will be ignored; it should no longer be necessary' + + +if TYPE_CHECKING: + + class _OnlyValueValidatorClsMethod(Protocol): + def __call__(self, __cls: Any, __value: Any) -> Any: ... + + class _V1ValidatorWithValuesClsMethod(Protocol): + def __call__(self, __cls: Any, __value: Any, values: dict[str, Any]) -> Any: ... + + class _V1ValidatorWithValuesKwOnlyClsMethod(Protocol): + def __call__(self, __cls: Any, __value: Any, *, values: dict[str, Any]) -> Any: ... + + class _V1ValidatorWithKwargsClsMethod(Protocol): + def __call__(self, __cls: Any, **kwargs: Any) -> Any: ... + + class _V1ValidatorWithValuesAndKwargsClsMethod(Protocol): + def __call__(self, __cls: Any, values: dict[str, Any], **kwargs: Any) -> Any: ... + + class _V1RootValidatorClsMethod(Protocol): + def __call__( + self, __cls: Any, __values: _decorators_v1.RootValidatorValues + ) -> _decorators_v1.RootValidatorValues: ... + + V1Validator = Union[ + _OnlyValueValidatorClsMethod, + _V1ValidatorWithValuesClsMethod, + _V1ValidatorWithValuesKwOnlyClsMethod, + _V1ValidatorWithKwargsClsMethod, + _V1ValidatorWithValuesAndKwargsClsMethod, + _decorators_v1.V1ValidatorWithValues, + _decorators_v1.V1ValidatorWithValuesKwOnly, + _decorators_v1.V1ValidatorWithKwargs, + _decorators_v1.V1ValidatorWithValuesAndKwargs, + ] + + V1RootValidator = Union[ + _V1RootValidatorClsMethod, + _decorators_v1.V1RootValidatorFunction, + ] + + _PartialClsOrStaticMethod: TypeAlias = Union[classmethod[Any, Any, Any], staticmethod[Any, Any], partialmethod[Any]] + + # Allow both a V1 (assumed pre=False) or V2 (assumed mode='after') validator + # We lie to type checkers and say we return the same thing we get + # but in reality we return a proxy object that _mostly_ behaves like the wrapped thing + _V1ValidatorType = TypeVar('_V1ValidatorType', V1Validator, _PartialClsOrStaticMethod) + _V1RootValidatorFunctionType = TypeVar( + '_V1RootValidatorFunctionType', + _decorators_v1.V1RootValidatorFunction, + _V1RootValidatorClsMethod, + _PartialClsOrStaticMethod, + ) +else: + # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915 + # and https://youtrack.jetbrains.com/issue/PY-51428 + DeprecationWarning = PydanticDeprecatedSince20 + + +@deprecated( + 'Pydantic V1 style `@validator` validators are deprecated.' + ' You should migrate to Pydantic V2 style `@field_validator` validators,' + ' see the migration guide for more details', + category=None, +) +def validator( + __field: str, + *fields: str, + pre: bool = False, + each_item: bool = False, + always: bool = False, + check_fields: bool | None = None, + allow_reuse: bool = False, +) -> Callable[[_V1ValidatorType], _V1ValidatorType]: + """Decorate methods on the class indicating that they should be used to validate fields. + + Args: + __field (str): The first field the validator should be called on; this is separate + from `fields` to ensure an error is raised if you don't pass at least one. + *fields (str): Additional field(s) the validator should be called on. + pre (bool, optional): Whether this validator should be called before the standard + validators (else after). Defaults to False. + each_item (bool, optional): For complex objects (sets, lists etc.) whether to validate + individual elements rather than the whole object. Defaults to False. + always (bool, optional): Whether this method and other validators should be called even if + the value is missing. Defaults to False. + check_fields (bool | None, optional): Whether to check that the fields actually exist on the model. + Defaults to None. + allow_reuse (bool, optional): Whether to track and raise an error if another validator refers to + the decorated function. Defaults to False. + + Returns: + Callable: A decorator that can be used to decorate a + function to be used as a validator. + """ + warn( + 'Pydantic V1 style `@validator` validators are deprecated.' + ' You should migrate to Pydantic V2 style `@field_validator` validators,' + ' see the migration guide for more details', + DeprecationWarning, + stacklevel=2, + ) + + if allow_reuse is True: # pragma: no cover + warn(_ALLOW_REUSE_WARNING_MESSAGE, DeprecationWarning) + fields = __field, *fields + if isinstance(fields[0], FunctionType): + raise PydanticUserError( + '`@validator` should be used with fields and keyword arguments, not bare. ' + "E.g. usage should be `@validator('', ...)`", + code='validator-no-fields', + ) + elif not all(isinstance(field, str) for field in fields): + raise PydanticUserError( + '`@validator` fields should be passed as separate string args. ' + "E.g. usage should be `@validator('', '', ...)`", + code='validator-invalid-fields', + ) + + mode: Literal['before', 'after'] = 'before' if pre is True else 'after' + + def dec(f: Any) -> _decorators.PydanticDescriptorProxy[Any]: + if _decorators.is_instance_method_from_sig(f): + raise PydanticUserError( + '`@validator` cannot be applied to instance methods', code='validator-instance-method' + ) + # auto apply the @classmethod decorator + f = _decorators.ensure_classmethod_based_on_signature(f) + wrap = _decorators_v1.make_generic_v1_field_validator + validator_wrapper_info = _decorators.ValidatorDecoratorInfo( + fields=fields, + mode=mode, + each_item=each_item, + always=always, + check_fields=check_fields, + ) + return _decorators.PydanticDescriptorProxy(f, validator_wrapper_info, shim=wrap) + + return dec # type: ignore[return-value] + + +@overload +def root_validator( + *, + # if you don't specify `pre` the default is `pre=False` + # which means you need to specify `skip_on_failure=True` + skip_on_failure: Literal[True], + allow_reuse: bool = ..., +) -> Callable[ + [_V1RootValidatorFunctionType], + _V1RootValidatorFunctionType, +]: ... + + +@overload +def root_validator( + *, + # if you specify `pre=True` then you don't need to specify + # `skip_on_failure`, in fact it is not allowed as an argument! + pre: Literal[True], + allow_reuse: bool = ..., +) -> Callable[ + [_V1RootValidatorFunctionType], + _V1RootValidatorFunctionType, +]: ... + + +@overload +def root_validator( + *, + # if you explicitly specify `pre=False` then you + # MUST specify `skip_on_failure=True` + pre: Literal[False], + skip_on_failure: Literal[True], + allow_reuse: bool = ..., +) -> Callable[ + [_V1RootValidatorFunctionType], + _V1RootValidatorFunctionType, +]: ... + + +@deprecated( + 'Pydantic V1 style `@root_validator` validators are deprecated.' + ' You should migrate to Pydantic V2 style `@model_validator` validators,' + ' see the migration guide for more details', + category=None, +) +def root_validator( + *__args, + pre: bool = False, + skip_on_failure: bool = False, + allow_reuse: bool = False, +) -> Any: + """Decorate methods on a model indicating that they should be used to validate (and perhaps + modify) data either before or after standard model parsing/validation is performed. + + Args: + pre (bool, optional): Whether this validator should be called before the standard + validators (else after). Defaults to False. + skip_on_failure (bool, optional): Whether to stop validation and return as soon as a + failure is encountered. Defaults to False. + allow_reuse (bool, optional): Whether to track and raise an error if another validator + refers to the decorated function. Defaults to False. + + Returns: + Any: A decorator that can be used to decorate a function to be used as a root_validator. + """ + warn( + 'Pydantic V1 style `@root_validator` validators are deprecated.' + ' You should migrate to Pydantic V2 style `@model_validator` validators,' + ' see the migration guide for more details', + DeprecationWarning, + stacklevel=2, + ) + + if __args: + # Ensure a nice error is raised if someone attempts to use the bare decorator + return root_validator()(*__args) # type: ignore + + if allow_reuse is True: # pragma: no cover + warn(_ALLOW_REUSE_WARNING_MESSAGE, DeprecationWarning) + mode: Literal['before', 'after'] = 'before' if pre is True else 'after' + if pre is False and skip_on_failure is not True: + raise PydanticUserError( + 'If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`.' + ' Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.', + code='root-validator-pre-skip', + ) + + wrap = partial(_decorators_v1.make_v1_generic_root_validator, pre=pre) + + def dec(f: Callable[..., Any] | classmethod[Any, Any, Any] | staticmethod[Any, Any]) -> Any: + if _decorators.is_instance_method_from_sig(f): + raise TypeError('`@root_validator` cannot be applied to instance methods') + # auto apply the @classmethod decorator + res = _decorators.ensure_classmethod_based_on_signature(f) + dec_info = _decorators.RootValidatorDecoratorInfo(mode=mode) + return _decorators.PydanticDescriptorProxy(res, dec_info, shim=wrap) + + return dec diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/config.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/config.py new file mode 100644 index 0000000000000000000000000000000000000000..bd4692ace9b4594799974d6ecf8d44357d1d02c5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/config.py @@ -0,0 +1,72 @@ +from __future__ import annotations as _annotations + +import warnings +from typing import TYPE_CHECKING, Any, Literal + +from typing_extensions import deprecated + +from .._internal import _config +from ..warnings import PydanticDeprecatedSince20 + +if not TYPE_CHECKING: + # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915 + # and https://youtrack.jetbrains.com/issue/PY-51428 + DeprecationWarning = PydanticDeprecatedSince20 + +__all__ = 'BaseConfig', 'Extra' + + +class _ConfigMetaclass(type): + def __getattr__(self, item: str) -> Any: + try: + obj = _config.config_defaults[item] + warnings.warn(_config.DEPRECATION_MESSAGE, DeprecationWarning) + return obj + except KeyError as exc: + raise AttributeError(f"type object '{self.__name__}' has no attribute {exc}") from exc + + +@deprecated('BaseConfig is deprecated. Use the `pydantic.ConfigDict` instead.', category=PydanticDeprecatedSince20) +class BaseConfig(metaclass=_ConfigMetaclass): + """This class is only retained for backwards compatibility. + + !!! Warning "Deprecated" + BaseConfig is deprecated. Use the [`pydantic.ConfigDict`][pydantic.ConfigDict] instead. + """ + + def __getattr__(self, item: str) -> Any: + try: + obj = super().__getattribute__(item) + warnings.warn(_config.DEPRECATION_MESSAGE, DeprecationWarning) + return obj + except AttributeError as exc: + try: + return getattr(type(self), item) + except AttributeError: + # re-raising changes the displayed text to reflect that `self` is not a type + raise AttributeError(str(exc)) from exc + + def __init_subclass__(cls, **kwargs: Any) -> None: + warnings.warn(_config.DEPRECATION_MESSAGE, DeprecationWarning) + return super().__init_subclass__(**kwargs) + + +class _ExtraMeta(type): + def __getattribute__(self, __name: str) -> Any: + # The @deprecated decorator accesses other attributes, so we only emit a warning for the expected ones + if __name in {'allow', 'ignore', 'forbid'}: + warnings.warn( + "`pydantic.config.Extra` is deprecated, use literal values instead (e.g. `extra='allow'`)", + DeprecationWarning, + stacklevel=2, + ) + return super().__getattribute__(__name) + + +@deprecated( + "Extra is deprecated. Use literal values instead (e.g. `extra='allow'`)", category=PydanticDeprecatedSince20 +) +class Extra(metaclass=_ExtraMeta): + allow: Literal['allow'] = 'allow' + ignore: Literal['ignore'] = 'ignore' + forbid: Literal['forbid'] = 'forbid' diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/copy_internals.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/copy_internals.py new file mode 100644 index 0000000000000000000000000000000000000000..1b0dc125f196fbdb855bc0f45724a71355cedd51 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/copy_internals.py @@ -0,0 +1,224 @@ +from __future__ import annotations as _annotations + +import typing +from copy import deepcopy +from enum import Enum +from typing import Any + +import typing_extensions + +from .._internal import ( + _model_construction, + _typing_extra, + _utils, +) + +if typing.TYPE_CHECKING: + from .. import BaseModel + from .._internal._utils import AbstractSetIntStr, MappingIntStrAny + + AnyClassMethod = classmethod[Any, Any, Any] + TupleGenerator = typing.Generator[tuple[str, Any], None, None] + Model = typing.TypeVar('Model', bound='BaseModel') + # should be `set[int] | set[str] | dict[int, IncEx] | dict[str, IncEx] | None`, but mypy can't cope + IncEx: typing_extensions.TypeAlias = 'set[int] | set[str] | dict[int, Any] | dict[str, Any] | None' + +_object_setattr = _model_construction.object_setattr + + +def _iter( + self: BaseModel, + to_dict: bool = False, + by_alias: bool = False, + include: AbstractSetIntStr | MappingIntStrAny | None = None, + exclude: AbstractSetIntStr | MappingIntStrAny | None = None, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, +) -> TupleGenerator: + # Merge field set excludes with explicit exclude parameter with explicit overriding field set options. + # The extra "is not None" guards are not logically necessary but optimizes performance for the simple case. + if exclude is not None: + exclude = _utils.ValueItems.merge( + {k: v.exclude for k, v in self.__pydantic_fields__.items() if v.exclude is not None}, exclude + ) + + if include is not None: + include = _utils.ValueItems.merge({k: True for k in self.__pydantic_fields__}, include, intersect=True) + + allowed_keys = _calculate_keys(self, include=include, exclude=exclude, exclude_unset=exclude_unset) # type: ignore + if allowed_keys is None and not (to_dict or by_alias or exclude_unset or exclude_defaults or exclude_none): + # huge boost for plain _iter() + yield from self.__dict__.items() + if self.__pydantic_extra__: + yield from self.__pydantic_extra__.items() + return + + value_exclude = _utils.ValueItems(self, exclude) if exclude is not None else None + value_include = _utils.ValueItems(self, include) if include is not None else None + + if self.__pydantic_extra__ is None: + items = self.__dict__.items() + else: + items = list(self.__dict__.items()) + list(self.__pydantic_extra__.items()) + + for field_key, v in items: + if (allowed_keys is not None and field_key not in allowed_keys) or (exclude_none and v is None): + continue + + if exclude_defaults: + try: + field = self.__pydantic_fields__[field_key] + except KeyError: + pass + else: + if not field.is_required() and field.default == v: + continue + + if by_alias and field_key in self.__pydantic_fields__: + dict_key = self.__pydantic_fields__[field_key].alias or field_key + else: + dict_key = field_key + + if to_dict or value_include or value_exclude: + v = _get_value( + type(self), + v, + to_dict=to_dict, + by_alias=by_alias, + include=value_include and value_include.for_element(field_key), + exclude=value_exclude and value_exclude.for_element(field_key), + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + ) + yield dict_key, v + + +def _copy_and_set_values( + self: Model, + values: dict[str, Any], + fields_set: set[str], + extra: dict[str, Any] | None = None, + private: dict[str, Any] | None = None, + *, + deep: bool, # UP006 +) -> Model: + if deep: + # chances of having empty dict here are quite low for using smart_deepcopy + values = deepcopy(values) + extra = deepcopy(extra) + private = deepcopy(private) + + cls = self.__class__ + m = cls.__new__(cls) + _object_setattr(m, '__dict__', values) + _object_setattr(m, '__pydantic_extra__', extra) + _object_setattr(m, '__pydantic_fields_set__', fields_set) + _object_setattr(m, '__pydantic_private__', private) + + return m + + +@typing.no_type_check +def _get_value( + cls: type[BaseModel], + v: Any, + to_dict: bool, + by_alias: bool, + include: AbstractSetIntStr | MappingIntStrAny | None, + exclude: AbstractSetIntStr | MappingIntStrAny | None, + exclude_unset: bool, + exclude_defaults: bool, + exclude_none: bool, +) -> Any: + from .. import BaseModel + + if isinstance(v, BaseModel): + if to_dict: + return v.model_dump( + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + include=include, # type: ignore + exclude=exclude, # type: ignore + exclude_none=exclude_none, + ) + else: + return v.copy(include=include, exclude=exclude) + + value_exclude = _utils.ValueItems(v, exclude) if exclude else None + value_include = _utils.ValueItems(v, include) if include else None + + if isinstance(v, dict): + return { + k_: _get_value( + cls, + v_, + to_dict=to_dict, + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + include=value_include and value_include.for_element(k_), + exclude=value_exclude and value_exclude.for_element(k_), + exclude_none=exclude_none, + ) + for k_, v_ in v.items() + if (not value_exclude or not value_exclude.is_excluded(k_)) + and (not value_include or value_include.is_included(k_)) + } + + elif _utils.sequence_like(v): + seq_args = ( + _get_value( + cls, + v_, + to_dict=to_dict, + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + include=value_include and value_include.for_element(i), + exclude=value_exclude and value_exclude.for_element(i), + exclude_none=exclude_none, + ) + for i, v_ in enumerate(v) + if (not value_exclude or not value_exclude.is_excluded(i)) + and (not value_include or value_include.is_included(i)) + ) + + return v.__class__(*seq_args) if _typing_extra.is_namedtuple(v.__class__) else v.__class__(seq_args) + + elif isinstance(v, Enum) and getattr(cls.model_config, 'use_enum_values', False): + return v.value + + else: + return v + + +def _calculate_keys( + self: BaseModel, + include: MappingIntStrAny | None, + exclude: MappingIntStrAny | None, + exclude_unset: bool, + update: dict[str, Any] | None = None, # noqa UP006 +) -> typing.AbstractSet[str] | None: + if include is None and exclude is None and exclude_unset is False: + return None + + keys: typing.AbstractSet[str] + if exclude_unset: + keys = self.__pydantic_fields_set__.copy() + else: + keys = set(self.__dict__.keys()) + keys = keys | (self.__pydantic_extra__ or {}).keys() + + if include is not None: + keys &= include.keys() + + if update: + keys -= update.keys() + + if exclude: + keys -= {k for k, v in exclude.items() if _utils.ValueItems.is_true(v)} + + return keys diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/decorator.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/decorator.py new file mode 100644 index 0000000000000000000000000000000000000000..e73ad209ae86b26d6fa892f1eba39cfc28980970 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/decorator.py @@ -0,0 +1,284 @@ +import warnings +from collections.abc import Mapping +from functools import wraps +from typing import TYPE_CHECKING, Any, Callable, Optional, TypeVar, Union, overload + +from typing_extensions import deprecated + +from .._internal import _config, _typing_extra +from ..alias_generators import to_pascal +from ..errors import PydanticUserError +from ..functional_validators import field_validator +from ..main import BaseModel, create_model +from ..warnings import PydanticDeprecatedSince20 + +if not TYPE_CHECKING: + # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915 + # and https://youtrack.jetbrains.com/issue/PY-51428 + DeprecationWarning = PydanticDeprecatedSince20 + +__all__ = ('validate_arguments',) + +if TYPE_CHECKING: + AnyCallable = Callable[..., Any] + + AnyCallableT = TypeVar('AnyCallableT', bound=AnyCallable) + ConfigType = Union[None, type[Any], dict[str, Any]] + + +@overload +def validate_arguments( + func: None = None, *, config: 'ConfigType' = None +) -> Callable[['AnyCallableT'], 'AnyCallableT']: ... + + +@overload +def validate_arguments(func: 'AnyCallableT') -> 'AnyCallableT': ... + + +@deprecated( + 'The `validate_arguments` method is deprecated; use `validate_call` instead.', + category=None, +) +def validate_arguments(func: Optional['AnyCallableT'] = None, *, config: 'ConfigType' = None) -> Any: + """Decorator to validate the arguments passed to a function.""" + warnings.warn( + 'The `validate_arguments` method is deprecated; use `validate_call` instead.', + PydanticDeprecatedSince20, + stacklevel=2, + ) + + def validate(_func: 'AnyCallable') -> 'AnyCallable': + vd = ValidatedFunction(_func, config) + + @wraps(_func) + def wrapper_function(*args: Any, **kwargs: Any) -> Any: + return vd.call(*args, **kwargs) + + wrapper_function.vd = vd # type: ignore + wrapper_function.validate = vd.init_model_instance # type: ignore + wrapper_function.raw_function = vd.raw_function # type: ignore + wrapper_function.model = vd.model # type: ignore + return wrapper_function + + if func: + return validate(func) + else: + return validate + + +ALT_V_ARGS = 'v__args' +ALT_V_KWARGS = 'v__kwargs' +V_POSITIONAL_ONLY_NAME = 'v__positional_only' +V_DUPLICATE_KWARGS = 'v__duplicate_kwargs' + + +class ValidatedFunction: + def __init__(self, function: 'AnyCallable', config: 'ConfigType'): + from inspect import Parameter, signature + + parameters: Mapping[str, Parameter] = signature(function).parameters + + if parameters.keys() & {ALT_V_ARGS, ALT_V_KWARGS, V_POSITIONAL_ONLY_NAME, V_DUPLICATE_KWARGS}: + raise PydanticUserError( + f'"{ALT_V_ARGS}", "{ALT_V_KWARGS}", "{V_POSITIONAL_ONLY_NAME}" and "{V_DUPLICATE_KWARGS}" ' + f'are not permitted as argument names when using the "{validate_arguments.__name__}" decorator', + code=None, + ) + + self.raw_function = function + self.arg_mapping: dict[int, str] = {} + self.positional_only_args: set[str] = set() + self.v_args_name = 'args' + self.v_kwargs_name = 'kwargs' + + type_hints = _typing_extra.get_type_hints(function, include_extras=True) + takes_args = False + takes_kwargs = False + fields: dict[str, tuple[Any, Any]] = {} + for i, (name, p) in enumerate(parameters.items()): + if p.annotation is p.empty: + annotation = Any + else: + annotation = type_hints[name] + + default = ... if p.default is p.empty else p.default + if p.kind == Parameter.POSITIONAL_ONLY: + self.arg_mapping[i] = name + fields[name] = annotation, default + fields[V_POSITIONAL_ONLY_NAME] = list[str], None + self.positional_only_args.add(name) + elif p.kind == Parameter.POSITIONAL_OR_KEYWORD: + self.arg_mapping[i] = name + fields[name] = annotation, default + fields[V_DUPLICATE_KWARGS] = list[str], None + elif p.kind == Parameter.KEYWORD_ONLY: + fields[name] = annotation, default + elif p.kind == Parameter.VAR_POSITIONAL: + self.v_args_name = name + fields[name] = tuple[annotation, ...], None + takes_args = True + else: + assert p.kind == Parameter.VAR_KEYWORD, p.kind + self.v_kwargs_name = name + fields[name] = dict[str, annotation], None + takes_kwargs = True + + # these checks avoid a clash between "args" and a field with that name + if not takes_args and self.v_args_name in fields: + self.v_args_name = ALT_V_ARGS + + # same with "kwargs" + if not takes_kwargs and self.v_kwargs_name in fields: + self.v_kwargs_name = ALT_V_KWARGS + + if not takes_args: + # we add the field so validation below can raise the correct exception + fields[self.v_args_name] = list[Any], None + + if not takes_kwargs: + # same with kwargs + fields[self.v_kwargs_name] = dict[Any, Any], None + + self.create_model(fields, takes_args, takes_kwargs, config) + + def init_model_instance(self, *args: Any, **kwargs: Any) -> BaseModel: + values = self.build_values(args, kwargs) + return self.model(**values) + + def call(self, *args: Any, **kwargs: Any) -> Any: + m = self.init_model_instance(*args, **kwargs) + return self.execute(m) + + def build_values(self, args: tuple[Any, ...], kwargs: dict[str, Any]) -> dict[str, Any]: + values: dict[str, Any] = {} + if args: + arg_iter = enumerate(args) + while True: + try: + i, a = next(arg_iter) + except StopIteration: + break + arg_name = self.arg_mapping.get(i) + if arg_name is not None: + values[arg_name] = a + else: + values[self.v_args_name] = [a] + [a for _, a in arg_iter] + break + + var_kwargs: dict[str, Any] = {} + wrong_positional_args = [] + duplicate_kwargs = [] + fields_alias = [ + field.alias + for name, field in self.model.__pydantic_fields__.items() + if name not in (self.v_args_name, self.v_kwargs_name) + ] + non_var_fields = set(self.model.__pydantic_fields__) - {self.v_args_name, self.v_kwargs_name} + for k, v in kwargs.items(): + if k in non_var_fields or k in fields_alias: + if k in self.positional_only_args: + wrong_positional_args.append(k) + if k in values: + duplicate_kwargs.append(k) + values[k] = v + else: + var_kwargs[k] = v + + if var_kwargs: + values[self.v_kwargs_name] = var_kwargs + if wrong_positional_args: + values[V_POSITIONAL_ONLY_NAME] = wrong_positional_args + if duplicate_kwargs: + values[V_DUPLICATE_KWARGS] = duplicate_kwargs + return values + + def execute(self, m: BaseModel) -> Any: + d = { + k: v + for k, v in m.__dict__.items() + if k in m.__pydantic_fields_set__ or m.__pydantic_fields__[k].default_factory + } + var_kwargs = d.pop(self.v_kwargs_name, {}) + + if self.v_args_name in d: + args_: list[Any] = [] + in_kwargs = False + kwargs = {} + for name, value in d.items(): + if in_kwargs: + kwargs[name] = value + elif name == self.v_args_name: + args_ += value + in_kwargs = True + else: + args_.append(value) + return self.raw_function(*args_, **kwargs, **var_kwargs) + elif self.positional_only_args: + args_ = [] + kwargs = {} + for name, value in d.items(): + if name in self.positional_only_args: + args_.append(value) + else: + kwargs[name] = value + return self.raw_function(*args_, **kwargs, **var_kwargs) + else: + return self.raw_function(**d, **var_kwargs) + + def create_model(self, fields: dict[str, Any], takes_args: bool, takes_kwargs: bool, config: 'ConfigType') -> None: + pos_args = len(self.arg_mapping) + + config_wrapper = _config.ConfigWrapper(config) + + if config_wrapper.alias_generator: + raise PydanticUserError( + 'Setting the "alias_generator" property on custom Config for ' + '@validate_arguments is not yet supported, please remove.', + code=None, + ) + if config_wrapper.extra is None: + config_wrapper.config_dict['extra'] = 'forbid' + + class DecoratorBaseModel(BaseModel): + @field_validator(self.v_args_name, check_fields=False) + @classmethod + def check_args(cls, v: Optional[list[Any]]) -> Optional[list[Any]]: + if takes_args or v is None: + return v + + raise TypeError(f'{pos_args} positional arguments expected but {pos_args + len(v)} given') + + @field_validator(self.v_kwargs_name, check_fields=False) + @classmethod + def check_kwargs(cls, v: Optional[dict[str, Any]]) -> Optional[dict[str, Any]]: + if takes_kwargs or v is None: + return v + + plural = '' if len(v) == 1 else 's' + keys = ', '.join(map(repr, v.keys())) + raise TypeError(f'unexpected keyword argument{plural}: {keys}') + + @field_validator(V_POSITIONAL_ONLY_NAME, check_fields=False) + @classmethod + def check_positional_only(cls, v: Optional[list[str]]) -> None: + if v is None: + return + + plural = '' if len(v) == 1 else 's' + keys = ', '.join(map(repr, v)) + raise TypeError(f'positional-only argument{plural} passed as keyword argument{plural}: {keys}') + + @field_validator(V_DUPLICATE_KWARGS, check_fields=False) + @classmethod + def check_duplicate_kwargs(cls, v: Optional[list[str]]) -> None: + if v is None: + return + + plural = '' if len(v) == 1 else 's' + keys = ', '.join(map(repr, v)) + raise TypeError(f'multiple values for argument{plural}: {keys}') + + model_config = config_wrapper.config_dict + + self.model = create_model(to_pascal(self.raw_function.__name__), __base__=DecoratorBaseModel, **fields) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/json.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/json.py new file mode 100644 index 0000000000000000000000000000000000000000..1e216a765d15d5dd9e379f9de4f8f91ab8063877 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/json.py @@ -0,0 +1,141 @@ +import datetime +import warnings +from collections import deque +from decimal import Decimal +from enum import Enum +from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network +from pathlib import Path +from re import Pattern +from types import GeneratorType +from typing import TYPE_CHECKING, Any, Callable, Union +from uuid import UUID + +from typing_extensions import deprecated + +from .._internal._import_utils import import_cached_base_model +from ..color import Color +from ..networks import NameEmail +from ..types import SecretBytes, SecretStr +from ..warnings import PydanticDeprecatedSince20 + +if not TYPE_CHECKING: + # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915 + # and https://youtrack.jetbrains.com/issue/PY-51428 + DeprecationWarning = PydanticDeprecatedSince20 + +__all__ = 'pydantic_encoder', 'custom_pydantic_encoder', 'timedelta_isoformat' + + +def isoformat(o: Union[datetime.date, datetime.time]) -> str: + return o.isoformat() + + +def decimal_encoder(dec_value: Decimal) -> Union[int, float]: + """Encodes a Decimal as int of there's no exponent, otherwise float. + + This is useful when we use ConstrainedDecimal to represent Numeric(x,0) + where a integer (but not int typed) is used. Encoding this as a float + results in failed round-tripping between encode and parse. + Our Id type is a prime example of this. + + >>> decimal_encoder(Decimal("1.0")) + 1.0 + + >>> decimal_encoder(Decimal("1")) + 1 + """ + exponent = dec_value.as_tuple().exponent + if isinstance(exponent, int) and exponent >= 0: + return int(dec_value) + else: + return float(dec_value) + + +ENCODERS_BY_TYPE: dict[type[Any], Callable[[Any], Any]] = { + bytes: lambda o: o.decode(), + Color: str, + datetime.date: isoformat, + datetime.datetime: isoformat, + datetime.time: isoformat, + datetime.timedelta: lambda td: td.total_seconds(), + Decimal: decimal_encoder, + Enum: lambda o: o.value, + frozenset: list, + deque: list, + GeneratorType: list, + IPv4Address: str, + IPv4Interface: str, + IPv4Network: str, + IPv6Address: str, + IPv6Interface: str, + IPv6Network: str, + NameEmail: str, + Path: str, + Pattern: lambda o: o.pattern, + SecretBytes: str, + SecretStr: str, + set: list, + UUID: str, +} + + +@deprecated( + '`pydantic_encoder` is deprecated, use `pydantic_core.to_jsonable_python` instead.', + category=None, +) +def pydantic_encoder(obj: Any) -> Any: + warnings.warn( + '`pydantic_encoder` is deprecated, use `pydantic_core.to_jsonable_python` instead.', + category=PydanticDeprecatedSince20, + stacklevel=2, + ) + from dataclasses import asdict, is_dataclass + + BaseModel = import_cached_base_model() + + if isinstance(obj, BaseModel): + return obj.model_dump() + elif is_dataclass(obj): + return asdict(obj) # type: ignore + + # Check the class type and its superclasses for a matching encoder + for base in obj.__class__.__mro__[:-1]: + try: + encoder = ENCODERS_BY_TYPE[base] + except KeyError: + continue + return encoder(obj) + else: # We have exited the for loop without finding a suitable encoder + raise TypeError(f"Object of type '{obj.__class__.__name__}' is not JSON serializable") + + +# TODO: Add a suggested migration path once there is a way to use custom encoders +@deprecated( + '`custom_pydantic_encoder` is deprecated, use `BaseModel.model_dump` instead.', + category=None, +) +def custom_pydantic_encoder(type_encoders: dict[Any, Callable[[type[Any]], Any]], obj: Any) -> Any: + warnings.warn( + '`custom_pydantic_encoder` is deprecated, use `BaseModel.model_dump` instead.', + category=PydanticDeprecatedSince20, + stacklevel=2, + ) + # Check the class type and its superclasses for a matching encoder + for base in obj.__class__.__mro__[:-1]: + try: + encoder = type_encoders[base] + except KeyError: + continue + + return encoder(obj) + else: # We have exited the for loop without finding a suitable encoder + return pydantic_encoder(obj) + + +@deprecated('`timedelta_isoformat` is deprecated.', category=None) +def timedelta_isoformat(td: datetime.timedelta) -> str: + """ISO 8601 encoding for Python timedelta object.""" + warnings.warn('`timedelta_isoformat` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2) + minutes, seconds = divmod(td.seconds, 60) + hours, minutes = divmod(minutes, 60) + return f'{"-" if td.days < 0 else ""}P{abs(td.days)}DT{hours:d}H{minutes:d}M{seconds:d}.{td.microseconds:06d}S' diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/parse.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/parse.py new file mode 100644 index 0000000000000000000000000000000000000000..2a92e62b7b2e8dab77cbe0c2dbb79c810af7f452 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/parse.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +import json +import pickle +import warnings +from enum import Enum +from pathlib import Path +from typing import TYPE_CHECKING, Any, Callable + +from typing_extensions import deprecated + +from ..warnings import PydanticDeprecatedSince20 + +if not TYPE_CHECKING: + # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915 + # and https://youtrack.jetbrains.com/issue/PY-51428 + DeprecationWarning = PydanticDeprecatedSince20 + + +class Protocol(str, Enum): + json = 'json' + pickle = 'pickle' + + +@deprecated('`load_str_bytes` is deprecated.', category=None) +def load_str_bytes( + b: str | bytes, + *, + content_type: str | None = None, + encoding: str = 'utf8', + proto: Protocol | None = None, + allow_pickle: bool = False, + json_loads: Callable[[str], Any] = json.loads, +) -> Any: + warnings.warn('`load_str_bytes` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2) + if proto is None and content_type: + if content_type.endswith(('json', 'javascript')): + pass + elif allow_pickle and content_type.endswith('pickle'): + proto = Protocol.pickle + else: + raise TypeError(f'Unknown content-type: {content_type}') + + proto = proto or Protocol.json + + if proto == Protocol.json: + if isinstance(b, bytes): + b = b.decode(encoding) + return json_loads(b) # type: ignore + elif proto == Protocol.pickle: + if not allow_pickle: + raise RuntimeError('Trying to decode with pickle with allow_pickle=False') + bb = b if isinstance(b, bytes) else b.encode() # type: ignore + return pickle.loads(bb) + else: + raise TypeError(f'Unknown protocol: {proto}') + + +@deprecated('`load_file` is deprecated.', category=None) +def load_file( + path: str | Path, + *, + content_type: str | None = None, + encoding: str = 'utf8', + proto: Protocol | None = None, + allow_pickle: bool = False, + json_loads: Callable[[str], Any] = json.loads, +) -> Any: + warnings.warn('`load_file` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2) + path = Path(path) + b = path.read_bytes() + if content_type is None: + if path.suffix in ('.js', '.json'): + proto = Protocol.json + elif path.suffix == '.pkl': + proto = Protocol.pickle + + return load_str_bytes( + b, proto=proto, content_type=content_type, encoding=encoding, allow_pickle=allow_pickle, json_loads=json_loads + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/tools.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/tools.py new file mode 100644 index 0000000000000000000000000000000000000000..5ad7faef2ec69eaa737a58d3587770a612a510d8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/deprecated/tools.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +import json +import warnings +from typing import TYPE_CHECKING, Any, Callable, TypeVar, Union + +from typing_extensions import deprecated + +from ..json_schema import DEFAULT_REF_TEMPLATE, GenerateJsonSchema +from ..type_adapter import TypeAdapter +from ..warnings import PydanticDeprecatedSince20 + +if not TYPE_CHECKING: + # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915 + # and https://youtrack.jetbrains.com/issue/PY-51428 + DeprecationWarning = PydanticDeprecatedSince20 + +__all__ = 'parse_obj_as', 'schema_of', 'schema_json_of' + +NameFactory = Union[str, Callable[[type[Any]], str]] + + +T = TypeVar('T') + + +@deprecated( + '`parse_obj_as` is deprecated. Use `pydantic.TypeAdapter.validate_python` instead.', + category=None, +) +def parse_obj_as(type_: type[T], obj: Any, type_name: NameFactory | None = None) -> T: + warnings.warn( + '`parse_obj_as` is deprecated. Use `pydantic.TypeAdapter.validate_python` instead.', + category=PydanticDeprecatedSince20, + stacklevel=2, + ) + if type_name is not None: # pragma: no cover + warnings.warn( + 'The type_name parameter is deprecated. parse_obj_as no longer creates temporary models', + DeprecationWarning, + stacklevel=2, + ) + return TypeAdapter(type_).validate_python(obj) + + +@deprecated( + '`schema_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.', + category=None, +) +def schema_of( + type_: Any, + *, + title: NameFactory | None = None, + by_alias: bool = True, + ref_template: str = DEFAULT_REF_TEMPLATE, + schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema, +) -> dict[str, Any]: + """Generate a JSON schema (as dict) for the passed model or dynamically generated one.""" + warnings.warn( + '`schema_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.', + category=PydanticDeprecatedSince20, + stacklevel=2, + ) + res = TypeAdapter(type_).json_schema( + by_alias=by_alias, + schema_generator=schema_generator, + ref_template=ref_template, + ) + if title is not None: + if isinstance(title, str): + res['title'] = title + else: + warnings.warn( + 'Passing a callable for the `title` parameter is deprecated and no longer supported', + DeprecationWarning, + stacklevel=2, + ) + res['title'] = title(type_) + return res + + +@deprecated( + '`schema_json_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.', + category=None, +) +def schema_json_of( + type_: Any, + *, + title: NameFactory | None = None, + by_alias: bool = True, + ref_template: str = DEFAULT_REF_TEMPLATE, + schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema, + **dumps_kwargs: Any, +) -> str: + """Generate a JSON schema (as JSON) for the passed model or dynamically generated one.""" + warnings.warn( + '`schema_json_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.', + category=PydanticDeprecatedSince20, + stacklevel=2, + ) + return json.dumps( + schema_of(type_, title=title, by_alias=by_alias, ref_template=ref_template, schema_generator=schema_generator), + **dumps_kwargs, + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4aa58c6a61ca7ac05e399e40ae80e31032aeeb4e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__init__.py @@ -0,0 +1,10 @@ +"""The "experimental" module of pydantic contains potential new features that are subject to change.""" + +import warnings + +from pydantic.warnings import PydanticExperimentalWarning + +warnings.warn( + 'This module is experimental, its contents are subject to change and deprecation.', + category=PydanticExperimentalWarning, +) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78f760b1ca838980c4c011c2c986c9829bd73fe2 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__pycache__/arguments_schema.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__pycache__/arguments_schema.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2495ec2e3d49b7c1b4fc074334414f563d2e9c4f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__pycache__/arguments_schema.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__pycache__/pipeline.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__pycache__/pipeline.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..113eeacced3a333358db3889d3b2403b42d87cfd Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/__pycache__/pipeline.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/arguments_schema.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/arguments_schema.py new file mode 100644 index 0000000000000000000000000000000000000000..af4a8f3be3242519b529668e321dd8393241f7ea --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/arguments_schema.py @@ -0,0 +1,44 @@ +"""Experimental module exposing a function to generate a core schema that validates callable arguments.""" + +from __future__ import annotations + +from collections.abc import Callable +from typing import Any, Literal + +from pydantic_core import CoreSchema + +from pydantic import ConfigDict +from pydantic._internal import _config, _generate_schema, _namespace_utils + + +def generate_arguments_schema( + func: Callable[..., Any], + schema_type: Literal['arguments', 'arguments-v3'] = 'arguments-v3', + parameters_callback: Callable[[int, str, Any], Literal['skip'] | None] | None = None, + config: ConfigDict | None = None, +) -> CoreSchema: + """Generate the schema for the arguments of a function. + + Args: + func: The function to generate the schema for. + schema_type: The type of schema to generate. + parameters_callback: A callable that will be invoked for each parameter. The callback + should take three required arguments: the index, the name and the type annotation + (or [`Parameter.empty`][inspect.Parameter.empty] if not annotated) of the parameter. + The callback can optionally return `'skip'`, so that the parameter gets excluded + from the resulting schema. + config: The configuration to use. + + Returns: + The generated schema. + """ + generate_schema = _generate_schema.GenerateSchema( + _config.ConfigWrapper(config), + ns_resolver=_namespace_utils.NsResolver(namespaces_tuple=_namespace_utils.ns_for_function(func)), + ) + + if schema_type == 'arguments': + schema = generate_schema._arguments_schema(func, parameters_callback) # pyright: ignore[reportArgumentType] + else: + schema = generate_schema._arguments_v3_schema(func, parameters_callback) # pyright: ignore[reportArgumentType] + return generate_schema.clean_schema(schema) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/pipeline.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/pipeline.py new file mode 100644 index 0000000000000000000000000000000000000000..bd63d98c1a3cf62c23662fcaf9953a0bc7ba890e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/experimental/pipeline.py @@ -0,0 +1,667 @@ +"""Experimental pipeline API functionality. Be careful with this API, it's subject to change.""" + +from __future__ import annotations + +import datetime +import operator +import re +import sys +from collections import deque +from collections.abc import Container +from dataclasses import dataclass +from decimal import Decimal +from functools import cached_property, partial +from re import Pattern +from typing import TYPE_CHECKING, Annotated, Any, Callable, Generic, Protocol, TypeVar, Union, overload + +import annotated_types + +if TYPE_CHECKING: + from pydantic_core import core_schema as cs + + from pydantic import GetCoreSchemaHandler + +from pydantic._internal._internal_dataclass import slots_true as _slots_true + +if sys.version_info < (3, 10): + EllipsisType = type(Ellipsis) +else: + from types import EllipsisType + +__all__ = ['validate_as', 'validate_as_deferred', 'transform'] + +_slots_frozen = {**_slots_true, 'frozen': True} + + +@dataclass(**_slots_frozen) +class _ValidateAs: + tp: type[Any] + strict: bool = False + + +@dataclass +class _ValidateAsDefer: + func: Callable[[], type[Any]] + + @cached_property + def tp(self) -> type[Any]: + return self.func() + + +@dataclass(**_slots_frozen) +class _Transform: + func: Callable[[Any], Any] + + +@dataclass(**_slots_frozen) +class _PipelineOr: + left: _Pipeline[Any, Any] + right: _Pipeline[Any, Any] + + +@dataclass(**_slots_frozen) +class _PipelineAnd: + left: _Pipeline[Any, Any] + right: _Pipeline[Any, Any] + + +@dataclass(**_slots_frozen) +class _Eq: + value: Any + + +@dataclass(**_slots_frozen) +class _NotEq: + value: Any + + +@dataclass(**_slots_frozen) +class _In: + values: Container[Any] + + +@dataclass(**_slots_frozen) +class _NotIn: + values: Container[Any] + + +_ConstraintAnnotation = Union[ + annotated_types.Le, + annotated_types.Ge, + annotated_types.Lt, + annotated_types.Gt, + annotated_types.Len, + annotated_types.MultipleOf, + annotated_types.Timezone, + annotated_types.Interval, + annotated_types.Predicate, + # common predicates not included in annotated_types + _Eq, + _NotEq, + _In, + _NotIn, + # regular expressions + Pattern[str], +] + + +@dataclass(**_slots_frozen) +class _Constraint: + constraint: _ConstraintAnnotation + + +_Step = Union[_ValidateAs, _ValidateAsDefer, _Transform, _PipelineOr, _PipelineAnd, _Constraint] + +_InT = TypeVar('_InT') +_OutT = TypeVar('_OutT') +_NewOutT = TypeVar('_NewOutT') + + +class _FieldTypeMarker: + pass + + +# TODO: ultimately, make this public, see https://github.com/pydantic/pydantic/pull/9459#discussion_r1628197626 +# Also, make this frozen eventually, but that doesn't work right now because of the generic base +# Which attempts to modify __orig_base__ and such. +# We could go with a manual freeze, but that seems overkill for now. +@dataclass(**_slots_true) +class _Pipeline(Generic[_InT, _OutT]): + """Abstract representation of a chain of validation, transformation, and parsing steps.""" + + _steps: tuple[_Step, ...] + + def transform( + self, + func: Callable[[_OutT], _NewOutT], + ) -> _Pipeline[_InT, _NewOutT]: + """Transform the output of the previous step. + + If used as the first step in a pipeline, the type of the field is used. + That is, the transformation is applied to after the value is parsed to the field's type. + """ + return _Pipeline[_InT, _NewOutT](self._steps + (_Transform(func),)) + + @overload + def validate_as(self, tp: type[_NewOutT], *, strict: bool = ...) -> _Pipeline[_InT, _NewOutT]: ... + + @overload + def validate_as(self, tp: EllipsisType, *, strict: bool = ...) -> _Pipeline[_InT, Any]: # type: ignore + ... + + def validate_as(self, tp: type[_NewOutT] | EllipsisType, *, strict: bool = False) -> _Pipeline[_InT, Any]: # type: ignore + """Validate / parse the input into a new type. + + If no type is provided, the type of the field is used. + + Types are parsed in Pydantic's `lax` mode by default, + but you can enable `strict` mode by passing `strict=True`. + """ + if isinstance(tp, EllipsisType): + return _Pipeline[_InT, Any](self._steps + (_ValidateAs(_FieldTypeMarker, strict=strict),)) + return _Pipeline[_InT, _NewOutT](self._steps + (_ValidateAs(tp, strict=strict),)) + + def validate_as_deferred(self, func: Callable[[], type[_NewOutT]]) -> _Pipeline[_InT, _NewOutT]: + """Parse the input into a new type, deferring resolution of the type until the current class + is fully defined. + + This is useful when you need to reference the class in it's own type annotations. + """ + return _Pipeline[_InT, _NewOutT](self._steps + (_ValidateAsDefer(func),)) + + # constraints + @overload + def constrain(self: _Pipeline[_InT, _NewOutGe], constraint: annotated_types.Ge) -> _Pipeline[_InT, _NewOutGe]: ... + + @overload + def constrain(self: _Pipeline[_InT, _NewOutGt], constraint: annotated_types.Gt) -> _Pipeline[_InT, _NewOutGt]: ... + + @overload + def constrain(self: _Pipeline[_InT, _NewOutLe], constraint: annotated_types.Le) -> _Pipeline[_InT, _NewOutLe]: ... + + @overload + def constrain(self: _Pipeline[_InT, _NewOutLt], constraint: annotated_types.Lt) -> _Pipeline[_InT, _NewOutLt]: ... + + @overload + def constrain( + self: _Pipeline[_InT, _NewOutLen], constraint: annotated_types.Len + ) -> _Pipeline[_InT, _NewOutLen]: ... + + @overload + def constrain( + self: _Pipeline[_InT, _NewOutT], constraint: annotated_types.MultipleOf + ) -> _Pipeline[_InT, _NewOutT]: ... + + @overload + def constrain( + self: _Pipeline[_InT, _NewOutDatetime], constraint: annotated_types.Timezone + ) -> _Pipeline[_InT, _NewOutDatetime]: ... + + @overload + def constrain(self: _Pipeline[_InT, _OutT], constraint: annotated_types.Predicate) -> _Pipeline[_InT, _OutT]: ... + + @overload + def constrain( + self: _Pipeline[_InT, _NewOutInterval], constraint: annotated_types.Interval + ) -> _Pipeline[_InT, _NewOutInterval]: ... + + @overload + def constrain(self: _Pipeline[_InT, _OutT], constraint: _Eq) -> _Pipeline[_InT, _OutT]: ... + + @overload + def constrain(self: _Pipeline[_InT, _OutT], constraint: _NotEq) -> _Pipeline[_InT, _OutT]: ... + + @overload + def constrain(self: _Pipeline[_InT, _OutT], constraint: _In) -> _Pipeline[_InT, _OutT]: ... + + @overload + def constrain(self: _Pipeline[_InT, _OutT], constraint: _NotIn) -> _Pipeline[_InT, _OutT]: ... + + @overload + def constrain(self: _Pipeline[_InT, _NewOutT], constraint: Pattern[str]) -> _Pipeline[_InT, _NewOutT]: ... + + def constrain(self, constraint: _ConstraintAnnotation) -> Any: + """Constrain a value to meet a certain condition. + + We support most conditions from `annotated_types`, as well as regular expressions. + + Most of the time you'll be calling a shortcut method like `gt`, `lt`, `len`, etc + so you don't need to call this directly. + """ + return _Pipeline[_InT, _OutT](self._steps + (_Constraint(constraint),)) + + def predicate(self: _Pipeline[_InT, _NewOutT], func: Callable[[_NewOutT], bool]) -> _Pipeline[_InT, _NewOutT]: + """Constrain a value to meet a certain predicate.""" + return self.constrain(annotated_types.Predicate(func)) + + def gt(self: _Pipeline[_InT, _NewOutGt], gt: _NewOutGt) -> _Pipeline[_InT, _NewOutGt]: + """Constrain a value to be greater than a certain value.""" + return self.constrain(annotated_types.Gt(gt)) + + def lt(self: _Pipeline[_InT, _NewOutLt], lt: _NewOutLt) -> _Pipeline[_InT, _NewOutLt]: + """Constrain a value to be less than a certain value.""" + return self.constrain(annotated_types.Lt(lt)) + + def ge(self: _Pipeline[_InT, _NewOutGe], ge: _NewOutGe) -> _Pipeline[_InT, _NewOutGe]: + """Constrain a value to be greater than or equal to a certain value.""" + return self.constrain(annotated_types.Ge(ge)) + + def le(self: _Pipeline[_InT, _NewOutLe], le: _NewOutLe) -> _Pipeline[_InT, _NewOutLe]: + """Constrain a value to be less than or equal to a certain value.""" + return self.constrain(annotated_types.Le(le)) + + def len(self: _Pipeline[_InT, _NewOutLen], min_len: int, max_len: int | None = None) -> _Pipeline[_InT, _NewOutLen]: + """Constrain a value to have a certain length.""" + return self.constrain(annotated_types.Len(min_len, max_len)) + + @overload + def multiple_of(self: _Pipeline[_InT, _NewOutDiv], multiple_of: _NewOutDiv) -> _Pipeline[_InT, _NewOutDiv]: ... + + @overload + def multiple_of(self: _Pipeline[_InT, _NewOutMod], multiple_of: _NewOutMod) -> _Pipeline[_InT, _NewOutMod]: ... + + def multiple_of(self: _Pipeline[_InT, Any], multiple_of: Any) -> _Pipeline[_InT, Any]: + """Constrain a value to be a multiple of a certain number.""" + return self.constrain(annotated_types.MultipleOf(multiple_of)) + + def eq(self: _Pipeline[_InT, _OutT], value: _OutT) -> _Pipeline[_InT, _OutT]: + """Constrain a value to be equal to a certain value.""" + return self.constrain(_Eq(value)) + + def not_eq(self: _Pipeline[_InT, _OutT], value: _OutT) -> _Pipeline[_InT, _OutT]: + """Constrain a value to not be equal to a certain value.""" + return self.constrain(_NotEq(value)) + + def in_(self: _Pipeline[_InT, _OutT], values: Container[_OutT]) -> _Pipeline[_InT, _OutT]: + """Constrain a value to be in a certain set.""" + return self.constrain(_In(values)) + + def not_in(self: _Pipeline[_InT, _OutT], values: Container[_OutT]) -> _Pipeline[_InT, _OutT]: + """Constrain a value to not be in a certain set.""" + return self.constrain(_NotIn(values)) + + # timezone methods + def datetime_tz_naive(self: _Pipeline[_InT, datetime.datetime]) -> _Pipeline[_InT, datetime.datetime]: + return self.constrain(annotated_types.Timezone(None)) + + def datetime_tz_aware(self: _Pipeline[_InT, datetime.datetime]) -> _Pipeline[_InT, datetime.datetime]: + return self.constrain(annotated_types.Timezone(...)) + + def datetime_tz( + self: _Pipeline[_InT, datetime.datetime], tz: datetime.tzinfo + ) -> _Pipeline[_InT, datetime.datetime]: + return self.constrain(annotated_types.Timezone(tz)) # type: ignore + + def datetime_with_tz( + self: _Pipeline[_InT, datetime.datetime], tz: datetime.tzinfo | None + ) -> _Pipeline[_InT, datetime.datetime]: + return self.transform(partial(datetime.datetime.replace, tzinfo=tz)) + + # string methods + def str_lower(self: _Pipeline[_InT, str]) -> _Pipeline[_InT, str]: + return self.transform(str.lower) + + def str_upper(self: _Pipeline[_InT, str]) -> _Pipeline[_InT, str]: + return self.transform(str.upper) + + def str_title(self: _Pipeline[_InT, str]) -> _Pipeline[_InT, str]: + return self.transform(str.title) + + def str_strip(self: _Pipeline[_InT, str]) -> _Pipeline[_InT, str]: + return self.transform(str.strip) + + def str_pattern(self: _Pipeline[_InT, str], pattern: str) -> _Pipeline[_InT, str]: + return self.constrain(re.compile(pattern)) + + def str_contains(self: _Pipeline[_InT, str], substring: str) -> _Pipeline[_InT, str]: + return self.predicate(lambda v: substring in v) + + def str_starts_with(self: _Pipeline[_InT, str], prefix: str) -> _Pipeline[_InT, str]: + return self.predicate(lambda v: v.startswith(prefix)) + + def str_ends_with(self: _Pipeline[_InT, str], suffix: str) -> _Pipeline[_InT, str]: + return self.predicate(lambda v: v.endswith(suffix)) + + # operators + def otherwise(self, other: _Pipeline[_OtherIn, _OtherOut]) -> _Pipeline[_InT | _OtherIn, _OutT | _OtherOut]: + """Combine two validation chains, returning the result of the first chain if it succeeds, and the second chain if it fails.""" + return _Pipeline((_PipelineOr(self, other),)) + + __or__ = otherwise + + def then(self, other: _Pipeline[_OutT, _OtherOut]) -> _Pipeline[_InT, _OtherOut]: + """Pipe the result of one validation chain into another.""" + return _Pipeline((_PipelineAnd(self, other),)) + + __and__ = then + + def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> cs.CoreSchema: + from pydantic_core import core_schema as cs + + queue = deque(self._steps) + + s = None + + while queue: + step = queue.popleft() + s = _apply_step(step, s, handler, source_type) + + s = s or cs.any_schema() + return s + + def __supports_type__(self, _: _OutT) -> bool: + raise NotImplementedError + + +validate_as = _Pipeline[Any, Any](()).validate_as +validate_as_deferred = _Pipeline[Any, Any](()).validate_as_deferred +transform = _Pipeline[Any, Any]((_ValidateAs(_FieldTypeMarker),)).transform + + +def _check_func( + func: Callable[[Any], bool], predicate_err: str | Callable[[], str], s: cs.CoreSchema | None +) -> cs.CoreSchema: + from pydantic_core import core_schema as cs + + def handler(v: Any) -> Any: + if func(v): + return v + raise ValueError(f'Expected {predicate_err if isinstance(predicate_err, str) else predicate_err()}') + + if s is None: + return cs.no_info_plain_validator_function(handler) + else: + return cs.no_info_after_validator_function(handler, s) + + +def _apply_step(step: _Step, s: cs.CoreSchema | None, handler: GetCoreSchemaHandler, source_type: Any) -> cs.CoreSchema: + from pydantic_core import core_schema as cs + + if isinstance(step, _ValidateAs): + s = _apply_parse(s, step.tp, step.strict, handler, source_type) + elif isinstance(step, _ValidateAsDefer): + s = _apply_parse(s, step.tp, False, handler, source_type) + elif isinstance(step, _Transform): + s = _apply_transform(s, step.func, handler) + elif isinstance(step, _Constraint): + s = _apply_constraint(s, step.constraint) + elif isinstance(step, _PipelineOr): + s = cs.union_schema([handler(step.left), handler(step.right)]) + else: + assert isinstance(step, _PipelineAnd) + s = cs.chain_schema([handler(step.left), handler(step.right)]) + return s + + +def _apply_parse( + s: cs.CoreSchema | None, + tp: type[Any], + strict: bool, + handler: GetCoreSchemaHandler, + source_type: Any, +) -> cs.CoreSchema: + from pydantic_core import core_schema as cs + + from pydantic import Strict + + if tp is _FieldTypeMarker: + return cs.chain_schema([s, handler(source_type)]) if s else handler(source_type) + + if strict: + tp = Annotated[tp, Strict()] # type: ignore + + if s and s['type'] == 'any': + return handler(tp) + else: + return cs.chain_schema([s, handler(tp)]) if s else handler(tp) + + +def _apply_transform( + s: cs.CoreSchema | None, func: Callable[[Any], Any], handler: GetCoreSchemaHandler +) -> cs.CoreSchema: + from pydantic_core import core_schema as cs + + if s is None: + return cs.no_info_plain_validator_function(func) + + if s['type'] == 'str': + if func is str.strip: + s = s.copy() + s['strip_whitespace'] = True + return s + elif func is str.lower: + s = s.copy() + s['to_lower'] = True + return s + elif func is str.upper: + s = s.copy() + s['to_upper'] = True + return s + + return cs.no_info_after_validator_function(func, s) + + +def _apply_constraint( # noqa: C901 + s: cs.CoreSchema | None, constraint: _ConstraintAnnotation +) -> cs.CoreSchema: + """Apply a single constraint to a schema.""" + if isinstance(constraint, annotated_types.Gt): + gt = constraint.gt + if s and s['type'] in {'int', 'float', 'decimal'}: + s = s.copy() + if s['type'] == 'int' and isinstance(gt, int): + s['gt'] = gt + elif s['type'] == 'float' and isinstance(gt, float): + s['gt'] = gt + elif s['type'] == 'decimal' and isinstance(gt, Decimal): + s['gt'] = gt + else: + + def check_gt(v: Any) -> bool: + return v > gt + + s = _check_func(check_gt, f'> {gt}', s) + elif isinstance(constraint, annotated_types.Ge): + ge = constraint.ge + if s and s['type'] in {'int', 'float', 'decimal'}: + s = s.copy() + if s['type'] == 'int' and isinstance(ge, int): + s['ge'] = ge + elif s['type'] == 'float' and isinstance(ge, float): + s['ge'] = ge + elif s['type'] == 'decimal' and isinstance(ge, Decimal): + s['ge'] = ge + + def check_ge(v: Any) -> bool: + return v >= ge + + s = _check_func(check_ge, f'>= {ge}', s) + elif isinstance(constraint, annotated_types.Lt): + lt = constraint.lt + if s and s['type'] in {'int', 'float', 'decimal'}: + s = s.copy() + if s['type'] == 'int' and isinstance(lt, int): + s['lt'] = lt + elif s['type'] == 'float' and isinstance(lt, float): + s['lt'] = lt + elif s['type'] == 'decimal' and isinstance(lt, Decimal): + s['lt'] = lt + + def check_lt(v: Any) -> bool: + return v < lt + + s = _check_func(check_lt, f'< {lt}', s) + elif isinstance(constraint, annotated_types.Le): + le = constraint.le + if s and s['type'] in {'int', 'float', 'decimal'}: + s = s.copy() + if s['type'] == 'int' and isinstance(le, int): + s['le'] = le + elif s['type'] == 'float' and isinstance(le, float): + s['le'] = le + elif s['type'] == 'decimal' and isinstance(le, Decimal): + s['le'] = le + + def check_le(v: Any) -> bool: + return v <= le + + s = _check_func(check_le, f'<= {le}', s) + elif isinstance(constraint, annotated_types.Len): + min_len = constraint.min_length + max_len = constraint.max_length + + if s and s['type'] in {'str', 'list', 'tuple', 'set', 'frozenset', 'dict'}: + assert ( + s['type'] == 'str' + or s['type'] == 'list' + or s['type'] == 'tuple' + or s['type'] == 'set' + or s['type'] == 'dict' + or s['type'] == 'frozenset' + ) + s = s.copy() + if min_len != 0: + s['min_length'] = min_len + if max_len is not None: + s['max_length'] = max_len + + def check_len(v: Any) -> bool: + if max_len is not None: + return (min_len <= len(v)) and (len(v) <= max_len) + return min_len <= len(v) + + s = _check_func(check_len, f'length >= {min_len} and length <= {max_len}', s) + elif isinstance(constraint, annotated_types.MultipleOf): + multiple_of = constraint.multiple_of + if s and s['type'] in {'int', 'float', 'decimal'}: + s = s.copy() + if s['type'] == 'int' and isinstance(multiple_of, int): + s['multiple_of'] = multiple_of + elif s['type'] == 'float' and isinstance(multiple_of, float): + s['multiple_of'] = multiple_of + elif s['type'] == 'decimal' and isinstance(multiple_of, Decimal): + s['multiple_of'] = multiple_of + + def check_multiple_of(v: Any) -> bool: + return v % multiple_of == 0 + + s = _check_func(check_multiple_of, f'% {multiple_of} == 0', s) + elif isinstance(constraint, annotated_types.Timezone): + tz = constraint.tz + + if tz is ...: + if s and s['type'] == 'datetime': + s = s.copy() + s['tz_constraint'] = 'aware' + else: + + def check_tz_aware(v: object) -> bool: + assert isinstance(v, datetime.datetime) + return v.tzinfo is not None + + s = _check_func(check_tz_aware, 'timezone aware', s) + elif tz is None: + if s and s['type'] == 'datetime': + s = s.copy() + s['tz_constraint'] = 'naive' + else: + + def check_tz_naive(v: object) -> bool: + assert isinstance(v, datetime.datetime) + return v.tzinfo is None + + s = _check_func(check_tz_naive, 'timezone naive', s) + else: + raise NotImplementedError('Constraining to a specific timezone is not yet supported') + elif isinstance(constraint, annotated_types.Interval): + if constraint.ge: + s = _apply_constraint(s, annotated_types.Ge(constraint.ge)) + if constraint.gt: + s = _apply_constraint(s, annotated_types.Gt(constraint.gt)) + if constraint.le: + s = _apply_constraint(s, annotated_types.Le(constraint.le)) + if constraint.lt: + s = _apply_constraint(s, annotated_types.Lt(constraint.lt)) + assert s is not None + elif isinstance(constraint, annotated_types.Predicate): + func = constraint.func + + if func.__name__ == '': + # attempt to extract the source code for a lambda function + # to use as the function name in error messages + # TODO: is there a better way? should we just not do this? + import inspect + + try: + source = inspect.getsource(func).strip() + source = source.removesuffix(')') + lambda_source_code = '`' + ''.join(''.join(source.split('lambda ')[1:]).split(':')[1:]).strip() + '`' + except OSError: + # stringified annotations + lambda_source_code = 'lambda' + + s = _check_func(func, lambda_source_code, s) + else: + s = _check_func(func, func.__name__, s) + elif isinstance(constraint, _NotEq): + value = constraint.value + + def check_not_eq(v: Any) -> bool: + return operator.__ne__(v, value) + + s = _check_func(check_not_eq, f'!= {value}', s) + elif isinstance(constraint, _Eq): + value = constraint.value + + def check_eq(v: Any) -> bool: + return operator.__eq__(v, value) + + s = _check_func(check_eq, f'== {value}', s) + elif isinstance(constraint, _In): + values = constraint.values + + def check_in(v: Any) -> bool: + return operator.__contains__(values, v) + + s = _check_func(check_in, f'in {values}', s) + elif isinstance(constraint, _NotIn): + values = constraint.values + + def check_not_in(v: Any) -> bool: + return operator.__not__(operator.__contains__(values, v)) + + s = _check_func(check_not_in, f'not in {values}', s) + else: + assert isinstance(constraint, Pattern) + if s and s['type'] == 'str': + s = s.copy() + s['pattern'] = constraint.pattern + else: + + def check_pattern(v: object) -> bool: + assert isinstance(v, str) + return constraint.match(v) is not None + + s = _check_func(check_pattern, f'~ {constraint.pattern}', s) + return s + + +class _SupportsRange(annotated_types.SupportsLe, annotated_types.SupportsGe, Protocol): + pass + + +class _SupportsLen(Protocol): + def __len__(self) -> int: ... + + +_NewOutGt = TypeVar('_NewOutGt', bound=annotated_types.SupportsGt) +_NewOutGe = TypeVar('_NewOutGe', bound=annotated_types.SupportsGe) +_NewOutLt = TypeVar('_NewOutLt', bound=annotated_types.SupportsLt) +_NewOutLe = TypeVar('_NewOutLe', bound=annotated_types.SupportsLe) +_NewOutLen = TypeVar('_NewOutLen', bound=_SupportsLen) +_NewOutDiv = TypeVar('_NewOutDiv', bound=annotated_types.SupportsDiv) +_NewOutMod = TypeVar('_NewOutMod', bound=annotated_types.SupportsMod) +_NewOutDatetime = TypeVar('_NewOutDatetime', bound=datetime.datetime) +_NewOutInterval = TypeVar('_NewOutInterval', bound=_SupportsRange) +_OtherIn = TypeVar('_OtherIn') +_OtherOut = TypeVar('_OtherOut') diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..362030584fcc81bbbdb9be82156ab0adb1119609 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__init__.py @@ -0,0 +1,188 @@ +"""!!! abstract "Usage Documentation" + [Build a Plugin](../concepts/plugins.md#build-a-plugin) + +Plugin interface for Pydantic plugins, and related types. +""" + +from __future__ import annotations + +from typing import Any, Callable, Literal, NamedTuple + +from pydantic_core import CoreConfig, CoreSchema, ValidationError +from typing_extensions import Protocol, TypeAlias + +__all__ = ( + 'PydanticPluginProtocol', + 'BaseValidateHandlerProtocol', + 'ValidatePythonHandlerProtocol', + 'ValidateJsonHandlerProtocol', + 'ValidateStringsHandlerProtocol', + 'NewSchemaReturns', + 'SchemaTypePath', + 'SchemaKind', +) + +NewSchemaReturns: TypeAlias = 'tuple[ValidatePythonHandlerProtocol | None, ValidateJsonHandlerProtocol | None, ValidateStringsHandlerProtocol | None]' + + +class SchemaTypePath(NamedTuple): + """Path defining where `schema_type` was defined, or where `TypeAdapter` was called.""" + + module: str + name: str + + +SchemaKind: TypeAlias = Literal['BaseModel', 'TypeAdapter', 'dataclass', 'create_model', 'validate_call'] + + +class PydanticPluginProtocol(Protocol): + """Protocol defining the interface for Pydantic plugins.""" + + def new_schema_validator( + self, + schema: CoreSchema, + schema_type: Any, + schema_type_path: SchemaTypePath, + schema_kind: SchemaKind, + config: CoreConfig | None, + plugin_settings: dict[str, object], + ) -> tuple[ + ValidatePythonHandlerProtocol | None, ValidateJsonHandlerProtocol | None, ValidateStringsHandlerProtocol | None + ]: + """This method is called for each plugin every time a new [`SchemaValidator`][pydantic_core.SchemaValidator] + is created. + + It should return an event handler for each of the three validation methods, or `None` if the plugin does not + implement that method. + + Args: + schema: The schema to validate against. + schema_type: The original type which the schema was created from, e.g. the model class. + schema_type_path: Path defining where `schema_type` was defined, or where `TypeAdapter` was called. + schema_kind: The kind of schema to validate against. + config: The config to use for validation. + plugin_settings: Any plugin settings. + + Returns: + A tuple of optional event handlers for each of the three validation methods - + `validate_python`, `validate_json`, `validate_strings`. + """ + raise NotImplementedError('Pydantic plugins should implement `new_schema_validator`.') + + +class BaseValidateHandlerProtocol(Protocol): + """Base class for plugin callbacks protocols. + + You shouldn't implement this protocol directly, instead use one of the subclasses with adds the correctly + typed `on_error` method. + """ + + on_enter: Callable[..., None] + """`on_enter` is changed to be more specific on all subclasses""" + + def on_success(self, result: Any) -> None: + """Callback to be notified of successful validation. + + Args: + result: The result of the validation. + """ + return + + def on_error(self, error: ValidationError) -> None: + """Callback to be notified of validation errors. + + Args: + error: The validation error. + """ + return + + def on_exception(self, exception: Exception) -> None: + """Callback to be notified of validation exceptions. + + Args: + exception: The exception raised during validation. + """ + return + + +class ValidatePythonHandlerProtocol(BaseValidateHandlerProtocol, Protocol): + """Event handler for `SchemaValidator.validate_python`.""" + + def on_enter( + self, + input: Any, + *, + strict: bool | None = None, + from_attributes: bool | None = None, + context: dict[str, Any] | None = None, + self_instance: Any | None = None, + by_alias: bool | None = None, + by_name: bool | None = None, + ) -> None: + """Callback to be notified of validation start, and create an instance of the event handler. + + Args: + input: The input to be validated. + strict: Whether to validate the object in strict mode. + from_attributes: Whether to validate objects as inputs by extracting attributes. + context: The context to use for validation, this is passed to functional validators. + self_instance: An instance of a model to set attributes on from validation, this is used when running + validation from the `__init__` method of a model. + by_alias: Whether to use the field's alias to match the input data to an attribute. + by_name: Whether to use the field's name to match the input data to an attribute. + """ + pass + + +class ValidateJsonHandlerProtocol(BaseValidateHandlerProtocol, Protocol): + """Event handler for `SchemaValidator.validate_json`.""" + + def on_enter( + self, + input: str | bytes | bytearray, + *, + strict: bool | None = None, + context: dict[str, Any] | None = None, + self_instance: Any | None = None, + by_alias: bool | None = None, + by_name: bool | None = None, + ) -> None: + """Callback to be notified of validation start, and create an instance of the event handler. + + Args: + input: The JSON data to be validated. + strict: Whether to validate the object in strict mode. + context: The context to use for validation, this is passed to functional validators. + self_instance: An instance of a model to set attributes on from validation, this is used when running + validation from the `__init__` method of a model. + by_alias: Whether to use the field's alias to match the input data to an attribute. + by_name: Whether to use the field's name to match the input data to an attribute. + """ + pass + + +StringInput: TypeAlias = 'dict[str, StringInput]' + + +class ValidateStringsHandlerProtocol(BaseValidateHandlerProtocol, Protocol): + """Event handler for `SchemaValidator.validate_strings`.""" + + def on_enter( + self, + input: StringInput, + *, + strict: bool | None = None, + context: dict[str, Any] | None = None, + by_alias: bool | None = None, + by_name: bool | None = None, + ) -> None: + """Callback to be notified of validation start, and create an instance of the event handler. + + Args: + input: The string data to be validated. + strict: Whether to validate the object in strict mode. + context: The context to use for validation, this is passed to functional validators. + by_alias: Whether to use the field's alias to match the input data to an attribute. + by_name: Whether to use the field's name to match the input data to an attribute. + """ + pass diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4daeb76de7625bee48b42b207f71e9dbfb2c2a73 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__pycache__/_loader.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__pycache__/_loader.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3fad8556af50b47296a6bb69e564855385d865e0 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__pycache__/_loader.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__pycache__/_schema_validator.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__pycache__/_schema_validator.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ce05b98d4c9916256e44348a73a90db132880b42 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/__pycache__/_schema_validator.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/_loader.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/_loader.py new file mode 100644 index 0000000000000000000000000000000000000000..7d1f0f29cba8e282e19eb031702251a489b72a7d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/_loader.py @@ -0,0 +1,57 @@ +from __future__ import annotations + +import importlib.metadata as importlib_metadata +import os +import warnings +from collections.abc import Iterable +from typing import TYPE_CHECKING, Final + +if TYPE_CHECKING: + from . import PydanticPluginProtocol + + +PYDANTIC_ENTRY_POINT_GROUP: Final[str] = 'pydantic' + +# cache of plugins +_plugins: dict[str, PydanticPluginProtocol] | None = None +# return no plugins while loading plugins to avoid recursion and errors while import plugins +# this means that if plugins use pydantic +_loading_plugins: bool = False + + +def get_plugins() -> Iterable[PydanticPluginProtocol]: + """Load plugins for Pydantic. + + Inspired by: https://github.com/pytest-dev/pluggy/blob/1.3.0/src/pluggy/_manager.py#L376-L402 + """ + disabled_plugins = os.getenv('PYDANTIC_DISABLE_PLUGINS') + global _plugins, _loading_plugins + if _loading_plugins: + # this happens when plugins themselves use pydantic, we return no plugins + return () + elif disabled_plugins in ('__all__', '1', 'true'): + return () + elif _plugins is None: + _plugins = {} + # set _loading_plugins so any plugins that use pydantic don't themselves use plugins + _loading_plugins = True + try: + for dist in importlib_metadata.distributions(): + for entry_point in dist.entry_points: + if entry_point.group != PYDANTIC_ENTRY_POINT_GROUP: + continue + if entry_point.value in _plugins: + continue + if disabled_plugins is not None and entry_point.name in disabled_plugins.split(','): + continue + try: + _plugins[entry_point.value] = entry_point.load() + except (ImportError, AttributeError) as e: + warnings.warn( + f'{e.__class__.__name__} while loading the `{entry_point.name}` Pydantic plugin, ' + f'this plugin will not be installed.\n\n{e!r}' + ) + finally: + _loading_plugins = False + + return _plugins.values() diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/_schema_validator.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/_schema_validator.py new file mode 100644 index 0000000000000000000000000000000000000000..83f2562b1b117fbeda087edadeb97b314c8b70ce --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/plugin/_schema_validator.py @@ -0,0 +1,140 @@ +"""Pluggable schema validator for pydantic.""" + +from __future__ import annotations + +import functools +from collections.abc import Iterable +from typing import TYPE_CHECKING, Any, Callable, Literal, TypeVar + +from pydantic_core import CoreConfig, CoreSchema, SchemaValidator, ValidationError +from typing_extensions import ParamSpec + +if TYPE_CHECKING: + from . import BaseValidateHandlerProtocol, PydanticPluginProtocol, SchemaKind, SchemaTypePath + + +P = ParamSpec('P') +R = TypeVar('R') +Event = Literal['on_validate_python', 'on_validate_json', 'on_validate_strings'] +events: list[Event] = list(Event.__args__) # type: ignore + + +def create_schema_validator( + schema: CoreSchema, + schema_type: Any, + schema_type_module: str, + schema_type_name: str, + schema_kind: SchemaKind, + config: CoreConfig | None = None, + plugin_settings: dict[str, Any] | None = None, +) -> SchemaValidator | PluggableSchemaValidator: + """Create a `SchemaValidator` or `PluggableSchemaValidator` if plugins are installed. + + Returns: + If plugins are installed then return `PluggableSchemaValidator`, otherwise return `SchemaValidator`. + """ + from . import SchemaTypePath + from ._loader import get_plugins + + plugins = get_plugins() + if plugins: + return PluggableSchemaValidator( + schema, + schema_type, + SchemaTypePath(schema_type_module, schema_type_name), + schema_kind, + config, + plugins, + plugin_settings or {}, + ) + else: + return SchemaValidator(schema, config) + + +class PluggableSchemaValidator: + """Pluggable schema validator.""" + + __slots__ = '_schema_validator', 'validate_json', 'validate_python', 'validate_strings' + + def __init__( + self, + schema: CoreSchema, + schema_type: Any, + schema_type_path: SchemaTypePath, + schema_kind: SchemaKind, + config: CoreConfig | None, + plugins: Iterable[PydanticPluginProtocol], + plugin_settings: dict[str, Any], + ) -> None: + self._schema_validator = SchemaValidator(schema, config) + + python_event_handlers: list[BaseValidateHandlerProtocol] = [] + json_event_handlers: list[BaseValidateHandlerProtocol] = [] + strings_event_handlers: list[BaseValidateHandlerProtocol] = [] + for plugin in plugins: + try: + p, j, s = plugin.new_schema_validator( + schema, schema_type, schema_type_path, schema_kind, config, plugin_settings + ) + except TypeError as e: # pragma: no cover + raise TypeError(f'Error using plugin `{plugin.__module__}:{plugin.__class__.__name__}`: {e}') from e + if p is not None: + python_event_handlers.append(p) + if j is not None: + json_event_handlers.append(j) + if s is not None: + strings_event_handlers.append(s) + + self.validate_python = build_wrapper(self._schema_validator.validate_python, python_event_handlers) + self.validate_json = build_wrapper(self._schema_validator.validate_json, json_event_handlers) + self.validate_strings = build_wrapper(self._schema_validator.validate_strings, strings_event_handlers) + + def __getattr__(self, name: str) -> Any: + return getattr(self._schema_validator, name) + + +def build_wrapper(func: Callable[P, R], event_handlers: list[BaseValidateHandlerProtocol]) -> Callable[P, R]: + if not event_handlers: + return func + else: + on_enters = tuple(h.on_enter for h in event_handlers if filter_handlers(h, 'on_enter')) + on_successes = tuple(h.on_success for h in event_handlers if filter_handlers(h, 'on_success')) + on_errors = tuple(h.on_error for h in event_handlers if filter_handlers(h, 'on_error')) + on_exceptions = tuple(h.on_exception for h in event_handlers if filter_handlers(h, 'on_exception')) + + @functools.wraps(func) + def wrapper(*args: P.args, **kwargs: P.kwargs) -> R: + for on_enter_handler in on_enters: + on_enter_handler(*args, **kwargs) + + try: + result = func(*args, **kwargs) + except ValidationError as error: + for on_error_handler in on_errors: + on_error_handler(error) + raise + except Exception as exception: + for on_exception_handler in on_exceptions: + on_exception_handler(exception) + raise + else: + for on_success_handler in on_successes: + on_success_handler(result) + return result + + return wrapper + + +def filter_handlers(handler_cls: BaseValidateHandlerProtocol, method_name: str) -> bool: + """Filter out handler methods which are not implemented by the plugin directly - e.g. are missing + or are inherited from the protocol. + """ + handler = getattr(handler_cls, method_name, None) + if handler is None: + return False + elif handler.__module__ == 'pydantic.plugin': + # this is the original handler, from the protocol due to runtime inheritance + # we don't want to call it + return False + else: + return True diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ad3f466684df5c377480a8e181971a1b2f0016a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__init__.py @@ -0,0 +1,131 @@ +# flake8: noqa +from pydantic.v1 import dataclasses +from pydantic.v1.annotated_types import create_model_from_namedtuple, create_model_from_typeddict +from pydantic.v1.class_validators import root_validator, validator +from pydantic.v1.config import BaseConfig, ConfigDict, Extra +from pydantic.v1.decorator import validate_arguments +from pydantic.v1.env_settings import BaseSettings +from pydantic.v1.error_wrappers import ValidationError +from pydantic.v1.errors import * +from pydantic.v1.fields import Field, PrivateAttr, Required +from pydantic.v1.main import * +from pydantic.v1.networks import * +from pydantic.v1.parse import Protocol +from pydantic.v1.tools import * +from pydantic.v1.types import * +from pydantic.v1.version import VERSION, compiled + +__version__ = VERSION + +# WARNING __all__ from pydantic.errors is not included here, it will be removed as an export here in v2 +# please use "from pydantic.v1.errors import ..." instead +__all__ = [ + # annotated types utils + 'create_model_from_namedtuple', + 'create_model_from_typeddict', + # dataclasses + 'dataclasses', + # class_validators + 'root_validator', + 'validator', + # config + 'BaseConfig', + 'ConfigDict', + 'Extra', + # decorator + 'validate_arguments', + # env_settings + 'BaseSettings', + # error_wrappers + 'ValidationError', + # fields + 'Field', + 'Required', + # main + 'BaseModel', + 'create_model', + 'validate_model', + # network + 'AnyUrl', + 'AnyHttpUrl', + 'FileUrl', + 'HttpUrl', + 'stricturl', + 'EmailStr', + 'NameEmail', + 'IPvAnyAddress', + 'IPvAnyInterface', + 'IPvAnyNetwork', + 'PostgresDsn', + 'CockroachDsn', + 'AmqpDsn', + 'RedisDsn', + 'MongoDsn', + 'KafkaDsn', + 'validate_email', + # parse + 'Protocol', + # tools + 'parse_file_as', + 'parse_obj_as', + 'parse_raw_as', + 'schema_of', + 'schema_json_of', + # types + 'NoneStr', + 'NoneBytes', + 'StrBytes', + 'NoneStrBytes', + 'StrictStr', + 'ConstrainedBytes', + 'conbytes', + 'ConstrainedList', + 'conlist', + 'ConstrainedSet', + 'conset', + 'ConstrainedFrozenSet', + 'confrozenset', + 'ConstrainedStr', + 'constr', + 'PyObject', + 'ConstrainedInt', + 'conint', + 'PositiveInt', + 'NegativeInt', + 'NonNegativeInt', + 'NonPositiveInt', + 'ConstrainedFloat', + 'confloat', + 'PositiveFloat', + 'NegativeFloat', + 'NonNegativeFloat', + 'NonPositiveFloat', + 'FiniteFloat', + 'ConstrainedDecimal', + 'condecimal', + 'ConstrainedDate', + 'condate', + 'UUID1', + 'UUID3', + 'UUID4', + 'UUID5', + 'FilePath', + 'DirectoryPath', + 'Json', + 'JsonWrapper', + 'SecretField', + 'SecretStr', + 'SecretBytes', + 'StrictBool', + 'StrictBytes', + 'StrictInt', + 'StrictFloat', + 'PaymentCardNumber', + 'PrivateAttr', + 'ByteSize', + 'PastDate', + 'FutureDate', + # version + 'compiled', + 'VERSION', +] diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8d5a70921147072fd87362b618dd7243703f04b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/_hypothesis_plugin.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/_hypothesis_plugin.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b210f365508f327c3df439b6bbe3243a7516e5bd Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/_hypothesis_plugin.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/annotated_types.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/annotated_types.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3a26b5f2a4a39bbde0bc006a360f7ff0052aeaf6 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/annotated_types.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/class_validators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/class_validators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35d350b637745da5688b65e3c6ef8d7597eaf859 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/class_validators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/color.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/color.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d0c741073501a1559efeb26925b04d31d7646671 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/color.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/config.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/config.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27f761c5b4d7166baa57704d65ed41e8c45b362a Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/config.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/dataclasses.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/dataclasses.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e416725caa65ad6b0a188d430f55e5416ede9cd Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/dataclasses.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/datetime_parse.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/datetime_parse.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2a45bb445354a644080e900bf6d1460d2d76358 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/datetime_parse.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/decorator.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/decorator.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88cddf2b6c1733c7ee3106ae6a504b5e79cf7af7 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/decorator.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/env_settings.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/env_settings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c9ea92aadc593e0dd5eaba0ad9ce64abdeb8522 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/env_settings.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/error_wrappers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/error_wrappers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9068927236d7aeb44cea3582588aef1ca77dbc1e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/error_wrappers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/errors.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/errors.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d82188a0c9a409f5a79e9053af2964922a0fd9f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/errors.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/fields.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/fields.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..102fce9641cc733e4cc5d447ef011a04055ed9f9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/fields.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/generics.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/generics.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bbfa1a00da3b6434d0519f07c79528603daad05c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/generics.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/json.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/json.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c44d2210c288a3d4c76b6d74f8b2b0d92387f034 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/json.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/main.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/main.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1231744fd40517cd17ff0a3f708c0cab802e9997 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/main.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/mypy.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/mypy.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7499d10bd7b944c302e153bc0059a4ccf675cf36 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/mypy.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/networks.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/networks.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..202af004fe8343a0b8310ec158fbe19e337c40f6 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/networks.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/parse.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/parse.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..79c60703b023f7a4d47b9edf8bb8a0ceee403248 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/parse.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/schema.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/schema.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f24d9b413a0784f327ce20d864c7e770ff1d12d Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/schema.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/tools.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/tools.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c38cb35d92e55ecf74cef3fab2d05872e2af40b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/tools.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/types.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/types.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6510666eda376ef1c1986bf3c54e46888ae0d97 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/types.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/typing.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/typing.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78dcc689375d4e586afd0e2cecaa34bb24255df5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/typing.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85db7a7aea046868246ac723c0ff23221eeb7805 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/validators.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/validators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7346aac31fa21b9e0dcb476b7648e7adb30cfa87 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/validators.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/version.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..09f33844ff52c46f949c9acad8c4134483894076 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/__pycache__/version.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/_hypothesis_plugin.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/_hypothesis_plugin.py new file mode 100644 index 0000000000000000000000000000000000000000..b62234d50750cbcf6d3ebba02d2ee54afb8c7347 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/_hypothesis_plugin.py @@ -0,0 +1,391 @@ +""" +Register Hypothesis strategies for Pydantic custom types. + +This enables fully-automatic generation of test data for most Pydantic classes. + +Note that this module has *no* runtime impact on Pydantic itself; instead it +is registered as a setuptools entry point and Hypothesis will import it if +Pydantic is installed. See also: + +https://hypothesis.readthedocs.io/en/latest/strategies.html#registering-strategies-via-setuptools-entry-points +https://hypothesis.readthedocs.io/en/latest/data.html#hypothesis.strategies.register_type_strategy +https://hypothesis.readthedocs.io/en/latest/strategies.html#interaction-with-pytest-cov +https://docs.pydantic.dev/usage/types/#pydantic-types + +Note that because our motivation is to *improve user experience*, the strategies +are always sound (never generate invalid data) but sacrifice completeness for +maintainability (ie may be unable to generate some tricky but valid data). + +Finally, this module makes liberal use of `# type: ignore[]` pragmas. +This is because Hypothesis annotates `register_type_strategy()` with +`(T, SearchStrategy[T])`, but in most cases we register e.g. `ConstrainedInt` +to generate instances of the builtin `int` type which match the constraints. +""" + +import contextlib +import datetime +import ipaddress +import json +import math +from fractions import Fraction +from typing import Callable, Dict, Type, Union, cast, overload + +import hypothesis.strategies as st + +import pydantic +import pydantic.color +import pydantic.types +from pydantic.v1.utils import lenient_issubclass + +# FilePath and DirectoryPath are explicitly unsupported, as we'd have to create +# them on-disk, and that's unsafe in general without being told *where* to do so. +# +# URLs are unsupported because it's easy for users to define their own strategy for +# "normal" URLs, and hard for us to define a general strategy which includes "weird" +# URLs but doesn't also have unpredictable performance problems. +# +# conlist() and conset() are unsupported for now, because the workarounds for +# Cython and Hypothesis to handle parametrized generic types are incompatible. +# We are rethinking Hypothesis compatibility in Pydantic v2. + +# Emails +try: + import email_validator +except ImportError: # pragma: no cover + pass +else: + + def is_valid_email(s: str) -> bool: + # Hypothesis' st.emails() occasionally generates emails like 0@A0--0.ac + # that are invalid according to email-validator, so we filter those out. + try: + email_validator.validate_email(s, check_deliverability=False) + return True + except email_validator.EmailNotValidError: # pragma: no cover + return False + + # Note that these strategies deliberately stay away from any tricky Unicode + # or other encoding issues; we're just trying to generate *something* valid. + st.register_type_strategy(pydantic.EmailStr, st.emails().filter(is_valid_email)) # type: ignore[arg-type] + st.register_type_strategy( + pydantic.NameEmail, + st.builds( + '{} <{}>'.format, # type: ignore[arg-type] + st.from_regex('[A-Za-z0-9_]+( [A-Za-z0-9_]+){0,5}', fullmatch=True), + st.emails().filter(is_valid_email), + ), + ) + +# PyObject - dotted names, in this case taken from the math module. +st.register_type_strategy( + pydantic.PyObject, # type: ignore[arg-type] + st.sampled_from( + [cast(pydantic.PyObject, f'math.{name}') for name in sorted(vars(math)) if not name.startswith('_')] + ), +) + +# CSS3 Colors; as name, hex, rgb(a) tuples or strings, or hsl strings +_color_regexes = ( + '|'.join( + ( + pydantic.color.r_hex_short, + pydantic.color.r_hex_long, + pydantic.color.r_rgb, + pydantic.color.r_rgba, + pydantic.color.r_hsl, + pydantic.color.r_hsla, + ) + ) + # Use more precise regex patterns to avoid value-out-of-range errors + .replace(pydantic.color._r_sl, r'(?:(\d\d?(?:\.\d+)?|100(?:\.0+)?)%)') + .replace(pydantic.color._r_alpha, r'(?:(0(?:\.\d+)?|1(?:\.0+)?|\.\d+|\d{1,2}%))') + .replace(pydantic.color._r_255, r'(?:((?:\d|\d\d|[01]\d\d|2[0-4]\d|25[0-4])(?:\.\d+)?|255(?:\.0+)?))') +) +st.register_type_strategy( + pydantic.color.Color, + st.one_of( + st.sampled_from(sorted(pydantic.color.COLORS_BY_NAME)), + st.tuples( + st.integers(0, 255), + st.integers(0, 255), + st.integers(0, 255), + st.none() | st.floats(0, 1) | st.floats(0, 100).map('{}%'.format), + ), + st.from_regex(_color_regexes, fullmatch=True), + ), +) + + +# Card numbers, valid according to the Luhn algorithm + + +def add_luhn_digit(card_number: str) -> str: + # See https://en.wikipedia.org/wiki/Luhn_algorithm + for digit in '0123456789': + with contextlib.suppress(Exception): + pydantic.PaymentCardNumber.validate_luhn_check_digit(card_number + digit) + return card_number + digit + raise AssertionError('Unreachable') # pragma: no cover + + +card_patterns = ( + # Note that these patterns omit the Luhn check digit; that's added by the function above + '4[0-9]{14}', # Visa + '5[12345][0-9]{13}', # Mastercard + '3[47][0-9]{12}', # American Express + '[0-26-9][0-9]{10,17}', # other (incomplete to avoid overlap) +) +st.register_type_strategy( + pydantic.PaymentCardNumber, + st.from_regex('|'.join(card_patterns), fullmatch=True).map(add_luhn_digit), # type: ignore[arg-type] +) + +# UUIDs +st.register_type_strategy(pydantic.UUID1, st.uuids(version=1)) +st.register_type_strategy(pydantic.UUID3, st.uuids(version=3)) +st.register_type_strategy(pydantic.UUID4, st.uuids(version=4)) +st.register_type_strategy(pydantic.UUID5, st.uuids(version=5)) + +# Secrets +st.register_type_strategy(pydantic.SecretBytes, st.binary().map(pydantic.SecretBytes)) +st.register_type_strategy(pydantic.SecretStr, st.text().map(pydantic.SecretStr)) + +# IP addresses, networks, and interfaces +st.register_type_strategy(pydantic.IPvAnyAddress, st.ip_addresses()) # type: ignore[arg-type] +st.register_type_strategy( + pydantic.IPvAnyInterface, + st.from_type(ipaddress.IPv4Interface) | st.from_type(ipaddress.IPv6Interface), # type: ignore[arg-type] +) +st.register_type_strategy( + pydantic.IPvAnyNetwork, + st.from_type(ipaddress.IPv4Network) | st.from_type(ipaddress.IPv6Network), # type: ignore[arg-type] +) + +# We hook into the con***() functions and the ConstrainedNumberMeta metaclass, +# so here we only have to register subclasses for other constrained types which +# don't go via those mechanisms. Then there are the registration hooks below. +st.register_type_strategy(pydantic.StrictBool, st.booleans()) +st.register_type_strategy(pydantic.StrictStr, st.text()) + + +# FutureDate, PastDate +st.register_type_strategy(pydantic.FutureDate, st.dates(min_value=datetime.date.today() + datetime.timedelta(days=1))) +st.register_type_strategy(pydantic.PastDate, st.dates(max_value=datetime.date.today() - datetime.timedelta(days=1))) + + +# Constrained-type resolver functions +# +# For these ones, we actually want to inspect the type in order to work out a +# satisfying strategy. First up, the machinery for tracking resolver functions: + +RESOLVERS: Dict[type, Callable[[type], st.SearchStrategy]] = {} # type: ignore[type-arg] + + +@overload +def _registered(typ: Type[pydantic.types.T]) -> Type[pydantic.types.T]: + pass + + +@overload +def _registered(typ: pydantic.types.ConstrainedNumberMeta) -> pydantic.types.ConstrainedNumberMeta: + pass + + +def _registered( + typ: Union[Type[pydantic.types.T], pydantic.types.ConstrainedNumberMeta] +) -> Union[Type[pydantic.types.T], pydantic.types.ConstrainedNumberMeta]: + # This function replaces the version in `pydantic.types`, in order to + # effect the registration of new constrained types so that Hypothesis + # can generate valid examples. + pydantic.types._DEFINED_TYPES.add(typ) + for supertype, resolver in RESOLVERS.items(): + if issubclass(typ, supertype): + st.register_type_strategy(typ, resolver(typ)) # type: ignore + return typ + raise NotImplementedError(f'Unknown type {typ!r} has no resolver to register') # pragma: no cover + + +def resolves( + typ: Union[type, pydantic.types.ConstrainedNumberMeta] +) -> Callable[[Callable[..., st.SearchStrategy]], Callable[..., st.SearchStrategy]]: # type: ignore[type-arg] + def inner(f): # type: ignore + assert f not in RESOLVERS + RESOLVERS[typ] = f + return f + + return inner + + +# Type-to-strategy resolver functions + + +@resolves(pydantic.JsonWrapper) +def resolve_json(cls): # type: ignore[no-untyped-def] + try: + inner = st.none() if cls.inner_type is None else st.from_type(cls.inner_type) + except Exception: # pragma: no cover + finite = st.floats(allow_infinity=False, allow_nan=False) + inner = st.recursive( + base=st.one_of(st.none(), st.booleans(), st.integers(), finite, st.text()), + extend=lambda x: st.lists(x) | st.dictionaries(st.text(), x), # type: ignore + ) + inner_type = getattr(cls, 'inner_type', None) + return st.builds( + cls.inner_type.json if lenient_issubclass(inner_type, pydantic.BaseModel) else json.dumps, + inner, + ensure_ascii=st.booleans(), + indent=st.none() | st.integers(0, 16), + sort_keys=st.booleans(), + ) + + +@resolves(pydantic.ConstrainedBytes) +def resolve_conbytes(cls): # type: ignore[no-untyped-def] # pragma: no cover + min_size = cls.min_length or 0 + max_size = cls.max_length + if not cls.strip_whitespace: + return st.binary(min_size=min_size, max_size=max_size) + # Fun with regex to ensure we neither start nor end with whitespace + repeats = '{{{},{}}}'.format( + min_size - 2 if min_size > 2 else 0, + max_size - 2 if (max_size or 0) > 2 else '', + ) + if min_size >= 2: + pattern = rf'\W.{repeats}\W' + elif min_size == 1: + pattern = rf'\W(.{repeats}\W)?' + else: + assert min_size == 0 + pattern = rf'(\W(.{repeats}\W)?)?' + return st.from_regex(pattern.encode(), fullmatch=True) + + +@resolves(pydantic.ConstrainedDecimal) +def resolve_condecimal(cls): # type: ignore[no-untyped-def] + min_value = cls.ge + max_value = cls.le + if cls.gt is not None: + assert min_value is None, 'Set `gt` or `ge`, but not both' + min_value = cls.gt + if cls.lt is not None: + assert max_value is None, 'Set `lt` or `le`, but not both' + max_value = cls.lt + s = st.decimals(min_value, max_value, allow_nan=False, places=cls.decimal_places) + if cls.lt is not None: + s = s.filter(lambda d: d < cls.lt) + if cls.gt is not None: + s = s.filter(lambda d: cls.gt < d) + return s + + +@resolves(pydantic.ConstrainedFloat) +def resolve_confloat(cls): # type: ignore[no-untyped-def] + min_value = cls.ge + max_value = cls.le + exclude_min = False + exclude_max = False + + if cls.gt is not None: + assert min_value is None, 'Set `gt` or `ge`, but not both' + min_value = cls.gt + exclude_min = True + if cls.lt is not None: + assert max_value is None, 'Set `lt` or `le`, but not both' + max_value = cls.lt + exclude_max = True + + if cls.multiple_of is None: + return st.floats(min_value, max_value, exclude_min=exclude_min, exclude_max=exclude_max, allow_nan=False) + + if min_value is not None: + min_value = math.ceil(min_value / cls.multiple_of) + if exclude_min: + min_value = min_value + 1 + if max_value is not None: + assert max_value >= cls.multiple_of, 'Cannot build model with max value smaller than multiple of' + max_value = math.floor(max_value / cls.multiple_of) + if exclude_max: + max_value = max_value - 1 + + return st.integers(min_value, max_value).map(lambda x: x * cls.multiple_of) + + +@resolves(pydantic.ConstrainedInt) +def resolve_conint(cls): # type: ignore[no-untyped-def] + min_value = cls.ge + max_value = cls.le + if cls.gt is not None: + assert min_value is None, 'Set `gt` or `ge`, but not both' + min_value = cls.gt + 1 + if cls.lt is not None: + assert max_value is None, 'Set `lt` or `le`, but not both' + max_value = cls.lt - 1 + + if cls.multiple_of is None or cls.multiple_of == 1: + return st.integers(min_value, max_value) + + # These adjustments and the .map handle integer-valued multiples, while the + # .filter handles trickier cases as for confloat. + if min_value is not None: + min_value = math.ceil(Fraction(min_value) / Fraction(cls.multiple_of)) + if max_value is not None: + max_value = math.floor(Fraction(max_value) / Fraction(cls.multiple_of)) + return st.integers(min_value, max_value).map(lambda x: x * cls.multiple_of) + + +@resolves(pydantic.ConstrainedDate) +def resolve_condate(cls): # type: ignore[no-untyped-def] + if cls.ge is not None: + assert cls.gt is None, 'Set `gt` or `ge`, but not both' + min_value = cls.ge + elif cls.gt is not None: + min_value = cls.gt + datetime.timedelta(days=1) + else: + min_value = datetime.date.min + if cls.le is not None: + assert cls.lt is None, 'Set `lt` or `le`, but not both' + max_value = cls.le + elif cls.lt is not None: + max_value = cls.lt - datetime.timedelta(days=1) + else: + max_value = datetime.date.max + return st.dates(min_value, max_value) + + +@resolves(pydantic.ConstrainedStr) +def resolve_constr(cls): # type: ignore[no-untyped-def] # pragma: no cover + min_size = cls.min_length or 0 + max_size = cls.max_length + + if cls.regex is None and not cls.strip_whitespace: + return st.text(min_size=min_size, max_size=max_size) + + if cls.regex is not None: + strategy = st.from_regex(cls.regex) + if cls.strip_whitespace: + strategy = strategy.filter(lambda s: s == s.strip()) + elif cls.strip_whitespace: + repeats = '{{{},{}}}'.format( + min_size - 2 if min_size > 2 else 0, + max_size - 2 if (max_size or 0) > 2 else '', + ) + if min_size >= 2: + strategy = st.from_regex(rf'\W.{repeats}\W') + elif min_size == 1: + strategy = st.from_regex(rf'\W(.{repeats}\W)?') + else: + assert min_size == 0 + strategy = st.from_regex(rf'(\W(.{repeats}\W)?)?') + + if min_size == 0 and max_size is None: + return strategy + elif max_size is None: + return strategy.filter(lambda s: min_size <= len(s)) + return strategy.filter(lambda s: min_size <= len(s) <= max_size) + + +# Finally, register all previously-defined types, and patch in our new function +for typ in list(pydantic.types._DEFINED_TYPES): + _registered(typ) +pydantic.types._registered = _registered +st.register_type_strategy(pydantic.Json, resolve_json) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/annotated_types.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/annotated_types.py new file mode 100644 index 0000000000000000000000000000000000000000..d9eaaafd5b6b2617baf3b3c889659c5bac807ff2 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/annotated_types.py @@ -0,0 +1,72 @@ +import sys +from typing import TYPE_CHECKING, Any, Dict, FrozenSet, NamedTuple, Type + +from pydantic.v1.fields import Required +from pydantic.v1.main import BaseModel, create_model +from pydantic.v1.typing import is_typeddict, is_typeddict_special + +if TYPE_CHECKING: + from typing_extensions import TypedDict + +if sys.version_info < (3, 11): + + def is_legacy_typeddict(typeddict_cls: Type['TypedDict']) -> bool: # type: ignore[valid-type] + return is_typeddict(typeddict_cls) and type(typeddict_cls).__module__ == 'typing' + +else: + + def is_legacy_typeddict(_: Any) -> Any: + return False + + +def create_model_from_typeddict( + # Mypy bug: `Type[TypedDict]` is resolved as `Any` https://github.com/python/mypy/issues/11030 + typeddict_cls: Type['TypedDict'], # type: ignore[valid-type] + **kwargs: Any, +) -> Type['BaseModel']: + """ + Create a `BaseModel` based on the fields of a `TypedDict`. + Since `typing.TypedDict` in Python 3.8 does not store runtime information about optional keys, + we raise an error if this happens (see https://bugs.python.org/issue38834). + """ + field_definitions: Dict[str, Any] + + # Best case scenario: with python 3.9+ or when `TypedDict` is imported from `typing_extensions` + if not hasattr(typeddict_cls, '__required_keys__'): + raise TypeError( + 'You should use `typing_extensions.TypedDict` instead of `typing.TypedDict` with Python < 3.9.2. ' + 'Without it, there is no way to differentiate required and optional fields when subclassed.' + ) + + if is_legacy_typeddict(typeddict_cls) and any( + is_typeddict_special(t) for t in typeddict_cls.__annotations__.values() + ): + raise TypeError( + 'You should use `typing_extensions.TypedDict` instead of `typing.TypedDict` with Python < 3.11. ' + 'Without it, there is no way to reflect Required/NotRequired keys.' + ) + + required_keys: FrozenSet[str] = typeddict_cls.__required_keys__ # type: ignore[attr-defined] + field_definitions = { + field_name: (field_type, Required if field_name in required_keys else None) + for field_name, field_type in typeddict_cls.__annotations__.items() + } + + return create_model(typeddict_cls.__name__, **kwargs, **field_definitions) + + +def create_model_from_namedtuple(namedtuple_cls: Type['NamedTuple'], **kwargs: Any) -> Type['BaseModel']: + """ + Create a `BaseModel` based on the fields of a named tuple. + A named tuple can be created with `typing.NamedTuple` and declared annotations + but also with `collections.namedtuple`, in this case we consider all fields + to have type `Any`. + """ + # With python 3.10+, `__annotations__` always exists but can be empty hence the `getattr... or...` logic + namedtuple_annotations: Dict[str, Type[Any]] = getattr(namedtuple_cls, '__annotations__', None) or { + k: Any for k in namedtuple_cls._fields + } + field_definitions: Dict[str, Any] = { + field_name: (field_type, Required) for field_name, field_type in namedtuple_annotations.items() + } + return create_model(namedtuple_cls.__name__, **kwargs, **field_definitions) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/class_validators.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/class_validators.py new file mode 100644 index 0000000000000000000000000000000000000000..2f68fc8600038d8de10017b0d02a3fde77a06ba6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/class_validators.py @@ -0,0 +1,361 @@ +import warnings +from collections import ChainMap +from functools import partial, partialmethod, wraps +from itertools import chain +from types import FunctionType +from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union, overload + +from pydantic.v1.errors import ConfigError +from pydantic.v1.typing import AnyCallable +from pydantic.v1.utils import ROOT_KEY, in_ipython + +if TYPE_CHECKING: + from pydantic.v1.typing import AnyClassMethod + + +class Validator: + __slots__ = 'func', 'pre', 'each_item', 'always', 'check_fields', 'skip_on_failure' + + def __init__( + self, + func: AnyCallable, + pre: bool = False, + each_item: bool = False, + always: bool = False, + check_fields: bool = False, + skip_on_failure: bool = False, + ): + self.func = func + self.pre = pre + self.each_item = each_item + self.always = always + self.check_fields = check_fields + self.skip_on_failure = skip_on_failure + + +if TYPE_CHECKING: + from inspect import Signature + + from pydantic.v1.config import BaseConfig + from pydantic.v1.fields import ModelField + from pydantic.v1.types import ModelOrDc + + ValidatorCallable = Callable[[Optional[ModelOrDc], Any, Dict[str, Any], ModelField, Type[BaseConfig]], Any] + ValidatorsList = List[ValidatorCallable] + ValidatorListDict = Dict[str, List[Validator]] + +_FUNCS: Set[str] = set() +VALIDATOR_CONFIG_KEY = '__validator_config__' +ROOT_VALIDATOR_CONFIG_KEY = '__root_validator_config__' + + +def validator( + *fields: str, + pre: bool = False, + each_item: bool = False, + always: bool = False, + check_fields: bool = True, + whole: Optional[bool] = None, + allow_reuse: bool = False, +) -> Callable[[AnyCallable], 'AnyClassMethod']: + """ + Decorate methods on the class indicating that they should be used to validate fields + :param fields: which field(s) the method should be called on + :param pre: whether or not this validator should be called before the standard validators (else after) + :param each_item: for complex objects (sets, lists etc.) whether to validate individual elements rather than the + whole object + :param always: whether this method and other validators should be called even if the value is missing + :param check_fields: whether to check that the fields actually exist on the model + :param allow_reuse: whether to track and raise an error if another validator refers to the decorated function + """ + if not fields: + raise ConfigError('validator with no fields specified') + elif isinstance(fields[0], FunctionType): + raise ConfigError( + "validators should be used with fields and keyword arguments, not bare. " # noqa: Q000 + "E.g. usage should be `@validator('', ...)`" + ) + elif not all(isinstance(field, str) for field in fields): + raise ConfigError( + "validator fields should be passed as separate string args. " # noqa: Q000 + "E.g. usage should be `@validator('', '', ...)`" + ) + + if whole is not None: + warnings.warn( + 'The "whole" keyword argument is deprecated, use "each_item" (inverse meaning, default False) instead', + DeprecationWarning, + ) + assert each_item is False, '"each_item" and "whole" conflict, remove "whole"' + each_item = not whole + + def dec(f: AnyCallable) -> 'AnyClassMethod': + f_cls = _prepare_validator(f, allow_reuse) + setattr( + f_cls, + VALIDATOR_CONFIG_KEY, + ( + fields, + Validator(func=f_cls.__func__, pre=pre, each_item=each_item, always=always, check_fields=check_fields), + ), + ) + return f_cls + + return dec + + +@overload +def root_validator(_func: AnyCallable) -> 'AnyClassMethod': + ... + + +@overload +def root_validator( + *, pre: bool = False, allow_reuse: bool = False, skip_on_failure: bool = False +) -> Callable[[AnyCallable], 'AnyClassMethod']: + ... + + +def root_validator( + _func: Optional[AnyCallable] = None, *, pre: bool = False, allow_reuse: bool = False, skip_on_failure: bool = False +) -> Union['AnyClassMethod', Callable[[AnyCallable], 'AnyClassMethod']]: + """ + Decorate methods on a model indicating that they should be used to validate (and perhaps modify) data either + before or after standard model parsing/validation is performed. + """ + if _func: + f_cls = _prepare_validator(_func, allow_reuse) + setattr( + f_cls, ROOT_VALIDATOR_CONFIG_KEY, Validator(func=f_cls.__func__, pre=pre, skip_on_failure=skip_on_failure) + ) + return f_cls + + def dec(f: AnyCallable) -> 'AnyClassMethod': + f_cls = _prepare_validator(f, allow_reuse) + setattr( + f_cls, ROOT_VALIDATOR_CONFIG_KEY, Validator(func=f_cls.__func__, pre=pre, skip_on_failure=skip_on_failure) + ) + return f_cls + + return dec + + +def _prepare_validator(function: AnyCallable, allow_reuse: bool) -> 'AnyClassMethod': + """ + Avoid validators with duplicated names since without this, validators can be overwritten silently + which generally isn't the intended behaviour, don't run in ipython (see #312) or if allow_reuse is False. + """ + f_cls = function if isinstance(function, classmethod) else classmethod(function) + if not in_ipython() and not allow_reuse: + ref = ( + getattr(f_cls.__func__, '__module__', '') + + '.' + + getattr(f_cls.__func__, '__qualname__', f'') + ) + if ref in _FUNCS: + raise ConfigError(f'duplicate validator function "{ref}"; if this is intended, set `allow_reuse=True`') + _FUNCS.add(ref) + return f_cls + + +class ValidatorGroup: + def __init__(self, validators: 'ValidatorListDict') -> None: + self.validators = validators + self.used_validators = {'*'} + + def get_validators(self, name: str) -> Optional[Dict[str, Validator]]: + self.used_validators.add(name) + validators = self.validators.get(name, []) + if name != ROOT_KEY: + validators += self.validators.get('*', []) + if validators: + return {getattr(v.func, '__name__', f''): v for v in validators} + else: + return None + + def check_for_unused(self) -> None: + unused_validators = set( + chain.from_iterable( + ( + getattr(v.func, '__name__', f'') + for v in self.validators[f] + if v.check_fields + ) + for f in (self.validators.keys() - self.used_validators) + ) + ) + if unused_validators: + fn = ', '.join(unused_validators) + raise ConfigError( + f"Validators defined with incorrect fields: {fn} " # noqa: Q000 + f"(use check_fields=False if you're inheriting from the model and intended this)" + ) + + +def extract_validators(namespace: Dict[str, Any]) -> Dict[str, List[Validator]]: + validators: Dict[str, List[Validator]] = {} + for var_name, value in namespace.items(): + validator_config = getattr(value, VALIDATOR_CONFIG_KEY, None) + if validator_config: + fields, v = validator_config + for field in fields: + if field in validators: + validators[field].append(v) + else: + validators[field] = [v] + return validators + + +def extract_root_validators(namespace: Dict[str, Any]) -> Tuple[List[AnyCallable], List[Tuple[bool, AnyCallable]]]: + from inspect import signature + + pre_validators: List[AnyCallable] = [] + post_validators: List[Tuple[bool, AnyCallable]] = [] + for name, value in namespace.items(): + validator_config: Optional[Validator] = getattr(value, ROOT_VALIDATOR_CONFIG_KEY, None) + if validator_config: + sig = signature(validator_config.func) + args = list(sig.parameters.keys()) + if args[0] == 'self': + raise ConfigError( + f'Invalid signature for root validator {name}: {sig}, "self" not permitted as first argument, ' + f'should be: (cls, values).' + ) + if len(args) != 2: + raise ConfigError(f'Invalid signature for root validator {name}: {sig}, should be: (cls, values).') + # check function signature + if validator_config.pre: + pre_validators.append(validator_config.func) + else: + post_validators.append((validator_config.skip_on_failure, validator_config.func)) + return pre_validators, post_validators + + +def inherit_validators(base_validators: 'ValidatorListDict', validators: 'ValidatorListDict') -> 'ValidatorListDict': + for field, field_validators in base_validators.items(): + if field not in validators: + validators[field] = [] + validators[field] += field_validators + return validators + + +def make_generic_validator(validator: AnyCallable) -> 'ValidatorCallable': + """ + Make a generic function which calls a validator with the right arguments. + + Unfortunately other approaches (eg. return a partial of a function that builds the arguments) is slow, + hence this laborious way of doing things. + + It's done like this so validators don't all need **kwargs in their signature, eg. any combination of + the arguments "values", "fields" and/or "config" are permitted. + """ + from inspect import signature + + if not isinstance(validator, (partial, partialmethod)): + # This should be the default case, so overhead is reduced + sig = signature(validator) + args = list(sig.parameters.keys()) + else: + # Fix the generated argument lists of partial methods + sig = signature(validator.func) + args = [ + k + for k in signature(validator.func).parameters.keys() + if k not in validator.args | validator.keywords.keys() + ] + + first_arg = args.pop(0) + if first_arg == 'self': + raise ConfigError( + f'Invalid signature for validator {validator}: {sig}, "self" not permitted as first argument, ' + f'should be: (cls, value, values, config, field), "values", "config" and "field" are all optional.' + ) + elif first_arg == 'cls': + # assume the second argument is value + return wraps(validator)(_generic_validator_cls(validator, sig, set(args[1:]))) + else: + # assume the first argument was value which has already been removed + return wraps(validator)(_generic_validator_basic(validator, sig, set(args))) + + +def prep_validators(v_funcs: Iterable[AnyCallable]) -> 'ValidatorsList': + return [make_generic_validator(f) for f in v_funcs if f] + + +all_kwargs = {'values', 'field', 'config'} + + +def _generic_validator_cls(validator: AnyCallable, sig: 'Signature', args: Set[str]) -> 'ValidatorCallable': + # assume the first argument is value + has_kwargs = False + if 'kwargs' in args: + has_kwargs = True + args -= {'kwargs'} + + if not args.issubset(all_kwargs): + raise ConfigError( + f'Invalid signature for validator {validator}: {sig}, should be: ' + f'(cls, value, values, config, field), "values", "config" and "field" are all optional.' + ) + + if has_kwargs: + return lambda cls, v, values, field, config: validator(cls, v, values=values, field=field, config=config) + elif args == set(): + return lambda cls, v, values, field, config: validator(cls, v) + elif args == {'values'}: + return lambda cls, v, values, field, config: validator(cls, v, values=values) + elif args == {'field'}: + return lambda cls, v, values, field, config: validator(cls, v, field=field) + elif args == {'config'}: + return lambda cls, v, values, field, config: validator(cls, v, config=config) + elif args == {'values', 'field'}: + return lambda cls, v, values, field, config: validator(cls, v, values=values, field=field) + elif args == {'values', 'config'}: + return lambda cls, v, values, field, config: validator(cls, v, values=values, config=config) + elif args == {'field', 'config'}: + return lambda cls, v, values, field, config: validator(cls, v, field=field, config=config) + else: + # args == {'values', 'field', 'config'} + return lambda cls, v, values, field, config: validator(cls, v, values=values, field=field, config=config) + + +def _generic_validator_basic(validator: AnyCallable, sig: 'Signature', args: Set[str]) -> 'ValidatorCallable': + has_kwargs = False + if 'kwargs' in args: + has_kwargs = True + args -= {'kwargs'} + + if not args.issubset(all_kwargs): + raise ConfigError( + f'Invalid signature for validator {validator}: {sig}, should be: ' + f'(value, values, config, field), "values", "config" and "field" are all optional.' + ) + + if has_kwargs: + return lambda cls, v, values, field, config: validator(v, values=values, field=field, config=config) + elif args == set(): + return lambda cls, v, values, field, config: validator(v) + elif args == {'values'}: + return lambda cls, v, values, field, config: validator(v, values=values) + elif args == {'field'}: + return lambda cls, v, values, field, config: validator(v, field=field) + elif args == {'config'}: + return lambda cls, v, values, field, config: validator(v, config=config) + elif args == {'values', 'field'}: + return lambda cls, v, values, field, config: validator(v, values=values, field=field) + elif args == {'values', 'config'}: + return lambda cls, v, values, field, config: validator(v, values=values, config=config) + elif args == {'field', 'config'}: + return lambda cls, v, values, field, config: validator(v, field=field, config=config) + else: + # args == {'values', 'field', 'config'} + return lambda cls, v, values, field, config: validator(v, values=values, field=field, config=config) + + +def gather_all_validators(type_: 'ModelOrDc') -> Dict[str, 'AnyClassMethod']: + all_attributes = ChainMap(*[cls.__dict__ for cls in type_.__mro__]) # type: ignore[arg-type,var-annotated] + return { + k: v + for k, v in all_attributes.items() + if hasattr(v, VALIDATOR_CONFIG_KEY) or hasattr(v, ROOT_VALIDATOR_CONFIG_KEY) + } diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/color.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/color.py new file mode 100644 index 0000000000000000000000000000000000000000..b0bbf78f4367c3e13a5aac0df09b5824d8f7e6ea --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/color.py @@ -0,0 +1,494 @@ +""" +Color definitions are used as per CSS3 specification: +http://www.w3.org/TR/css3-color/#svg-color + +A few colors have multiple names referring to the sames colors, eg. `grey` and `gray` or `aqua` and `cyan`. + +In these cases the LAST color when sorted alphabetically takes preferences, +eg. Color((0, 255, 255)).as_named() == 'cyan' because "cyan" comes after "aqua". +""" +import math +import re +from colorsys import hls_to_rgb, rgb_to_hls +from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union, cast + +from pydantic.v1.errors import ColorError +from pydantic.v1.utils import Representation, almost_equal_floats + +if TYPE_CHECKING: + from pydantic.v1.typing import CallableGenerator, ReprArgs + +ColorTuple = Union[Tuple[int, int, int], Tuple[int, int, int, float]] +ColorType = Union[ColorTuple, str] +HslColorTuple = Union[Tuple[float, float, float], Tuple[float, float, float, float]] + + +class RGBA: + """ + Internal use only as a representation of a color. + """ + + __slots__ = 'r', 'g', 'b', 'alpha', '_tuple' + + def __init__(self, r: float, g: float, b: float, alpha: Optional[float]): + self.r = r + self.g = g + self.b = b + self.alpha = alpha + + self._tuple: Tuple[float, float, float, Optional[float]] = (r, g, b, alpha) + + def __getitem__(self, item: Any) -> Any: + return self._tuple[item] + + +# these are not compiled here to avoid import slowdown, they'll be compiled the first time they're used, then cached +r_hex_short = r'\s*(?:#|0x)?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?\s*' +r_hex_long = r'\s*(?:#|0x)?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?\s*' +_r_255 = r'(\d{1,3}(?:\.\d+)?)' +_r_comma = r'\s*,\s*' +r_rgb = fr'\s*rgb\(\s*{_r_255}{_r_comma}{_r_255}{_r_comma}{_r_255}\)\s*' +_r_alpha = r'(\d(?:\.\d+)?|\.\d+|\d{1,2}%)' +r_rgba = fr'\s*rgba\(\s*{_r_255}{_r_comma}{_r_255}{_r_comma}{_r_255}{_r_comma}{_r_alpha}\s*\)\s*' +_r_h = r'(-?\d+(?:\.\d+)?|-?\.\d+)(deg|rad|turn)?' +_r_sl = r'(\d{1,3}(?:\.\d+)?)%' +r_hsl = fr'\s*hsl\(\s*{_r_h}{_r_comma}{_r_sl}{_r_comma}{_r_sl}\s*\)\s*' +r_hsla = fr'\s*hsl\(\s*{_r_h}{_r_comma}{_r_sl}{_r_comma}{_r_sl}{_r_comma}{_r_alpha}\s*\)\s*' + +# colors where the two hex characters are the same, if all colors match this the short version of hex colors can be used +repeat_colors = {int(c * 2, 16) for c in '0123456789abcdef'} +rads = 2 * math.pi + + +class Color(Representation): + __slots__ = '_original', '_rgba' + + def __init__(self, value: ColorType) -> None: + self._rgba: RGBA + self._original: ColorType + if isinstance(value, (tuple, list)): + self._rgba = parse_tuple(value) + elif isinstance(value, str): + self._rgba = parse_str(value) + elif isinstance(value, Color): + self._rgba = value._rgba + value = value._original + else: + raise ColorError(reason='value must be a tuple, list or string') + + # if we've got here value must be a valid color + self._original = value + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(type='string', format='color') + + def original(self) -> ColorType: + """ + Original value passed to Color + """ + return self._original + + def as_named(self, *, fallback: bool = False) -> str: + if self._rgba.alpha is None: + rgb = cast(Tuple[int, int, int], self.as_rgb_tuple()) + try: + return COLORS_BY_VALUE[rgb] + except KeyError as e: + if fallback: + return self.as_hex() + else: + raise ValueError('no named color found, use fallback=True, as_hex() or as_rgb()') from e + else: + return self.as_hex() + + def as_hex(self) -> str: + """ + Hex string representing the color can be 3, 4, 6 or 8 characters depending on whether the string + a "short" representation of the color is possible and whether there's an alpha channel. + """ + values = [float_to_255(c) for c in self._rgba[:3]] + if self._rgba.alpha is not None: + values.append(float_to_255(self._rgba.alpha)) + + as_hex = ''.join(f'{v:02x}' for v in values) + if all(c in repeat_colors for c in values): + as_hex = ''.join(as_hex[c] for c in range(0, len(as_hex), 2)) + return '#' + as_hex + + def as_rgb(self) -> str: + """ + Color as an rgb(, , ) or rgba(, , , ) string. + """ + if self._rgba.alpha is None: + return f'rgb({float_to_255(self._rgba.r)}, {float_to_255(self._rgba.g)}, {float_to_255(self._rgba.b)})' + else: + return ( + f'rgba({float_to_255(self._rgba.r)}, {float_to_255(self._rgba.g)}, {float_to_255(self._rgba.b)}, ' + f'{round(self._alpha_float(), 2)})' + ) + + def as_rgb_tuple(self, *, alpha: Optional[bool] = None) -> ColorTuple: + """ + Color as an RGB or RGBA tuple; red, green and blue are in the range 0 to 255, alpha if included is + in the range 0 to 1. + + :param alpha: whether to include the alpha channel, options are + None - (default) include alpha only if it's set (e.g. not None) + True - always include alpha, + False - always omit alpha, + """ + r, g, b = (float_to_255(c) for c in self._rgba[:3]) + if alpha is None: + if self._rgba.alpha is None: + return r, g, b + else: + return r, g, b, self._alpha_float() + elif alpha: + return r, g, b, self._alpha_float() + else: + # alpha is False + return r, g, b + + def as_hsl(self) -> str: + """ + Color as an hsl(, , ) or hsl(, , , ) string. + """ + if self._rgba.alpha is None: + h, s, li = self.as_hsl_tuple(alpha=False) # type: ignore + return f'hsl({h * 360:0.0f}, {s:0.0%}, {li:0.0%})' + else: + h, s, li, a = self.as_hsl_tuple(alpha=True) # type: ignore + return f'hsl({h * 360:0.0f}, {s:0.0%}, {li:0.0%}, {round(a, 2)})' + + def as_hsl_tuple(self, *, alpha: Optional[bool] = None) -> HslColorTuple: + """ + Color as an HSL or HSLA tuple, e.g. hue, saturation, lightness and optionally alpha; all elements are in + the range 0 to 1. + + NOTE: this is HSL as used in HTML and most other places, not HLS as used in python's colorsys. + + :param alpha: whether to include the alpha channel, options are + None - (default) include alpha only if it's set (e.g. not None) + True - always include alpha, + False - always omit alpha, + """ + h, l, s = rgb_to_hls(self._rgba.r, self._rgba.g, self._rgba.b) + if alpha is None: + if self._rgba.alpha is None: + return h, s, l + else: + return h, s, l, self._alpha_float() + if alpha: + return h, s, l, self._alpha_float() + else: + # alpha is False + return h, s, l + + def _alpha_float(self) -> float: + return 1 if self._rgba.alpha is None else self._rgba.alpha + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls + + def __str__(self) -> str: + return self.as_named(fallback=True) + + def __repr_args__(self) -> 'ReprArgs': + return [(None, self.as_named(fallback=True))] + [('rgb', self.as_rgb_tuple())] # type: ignore + + def __eq__(self, other: Any) -> bool: + return isinstance(other, Color) and self.as_rgb_tuple() == other.as_rgb_tuple() + + def __hash__(self) -> int: + return hash(self.as_rgb_tuple()) + + +def parse_tuple(value: Tuple[Any, ...]) -> RGBA: + """ + Parse a tuple or list as a color. + """ + if len(value) == 3: + r, g, b = (parse_color_value(v) for v in value) + return RGBA(r, g, b, None) + elif len(value) == 4: + r, g, b = (parse_color_value(v) for v in value[:3]) + return RGBA(r, g, b, parse_float_alpha(value[3])) + else: + raise ColorError(reason='tuples must have length 3 or 4') + + +def parse_str(value: str) -> RGBA: + """ + Parse a string to an RGBA tuple, trying the following formats (in this order): + * named color, see COLORS_BY_NAME below + * hex short eg. `fff` (prefix can be `#`, `0x` or nothing) + * hex long eg. `ffffff` (prefix can be `#`, `0x` or nothing) + * `rgb(, , ) ` + * `rgba(, , , )` + """ + value_lower = value.lower() + try: + r, g, b = COLORS_BY_NAME[value_lower] + except KeyError: + pass + else: + return ints_to_rgba(r, g, b, None) + + m = re.fullmatch(r_hex_short, value_lower) + if m: + *rgb, a = m.groups() + r, g, b = (int(v * 2, 16) for v in rgb) + if a: + alpha: Optional[float] = int(a * 2, 16) / 255 + else: + alpha = None + return ints_to_rgba(r, g, b, alpha) + + m = re.fullmatch(r_hex_long, value_lower) + if m: + *rgb, a = m.groups() + r, g, b = (int(v, 16) for v in rgb) + if a: + alpha = int(a, 16) / 255 + else: + alpha = None + return ints_to_rgba(r, g, b, alpha) + + m = re.fullmatch(r_rgb, value_lower) + if m: + return ints_to_rgba(*m.groups(), None) # type: ignore + + m = re.fullmatch(r_rgba, value_lower) + if m: + return ints_to_rgba(*m.groups()) # type: ignore + + m = re.fullmatch(r_hsl, value_lower) + if m: + h, h_units, s, l_ = m.groups() + return parse_hsl(h, h_units, s, l_) + + m = re.fullmatch(r_hsla, value_lower) + if m: + h, h_units, s, l_, a = m.groups() + return parse_hsl(h, h_units, s, l_, parse_float_alpha(a)) + + raise ColorError(reason='string not recognised as a valid color') + + +def ints_to_rgba(r: Union[int, str], g: Union[int, str], b: Union[int, str], alpha: Optional[float]) -> RGBA: + return RGBA(parse_color_value(r), parse_color_value(g), parse_color_value(b), parse_float_alpha(alpha)) + + +def parse_color_value(value: Union[int, str], max_val: int = 255) -> float: + """ + Parse a value checking it's a valid int in the range 0 to max_val and divide by max_val to give a number + in the range 0 to 1 + """ + try: + color = float(value) + except ValueError: + raise ColorError(reason='color values must be a valid number') + if 0 <= color <= max_val: + return color / max_val + else: + raise ColorError(reason=f'color values must be in the range 0 to {max_val}') + + +def parse_float_alpha(value: Union[None, str, float, int]) -> Optional[float]: + """ + Parse a value checking it's a valid float in the range 0 to 1 + """ + if value is None: + return None + try: + if isinstance(value, str) and value.endswith('%'): + alpha = float(value[:-1]) / 100 + else: + alpha = float(value) + except ValueError: + raise ColorError(reason='alpha values must be a valid float') + + if almost_equal_floats(alpha, 1): + return None + elif 0 <= alpha <= 1: + return alpha + else: + raise ColorError(reason='alpha values must be in the range 0 to 1') + + +def parse_hsl(h: str, h_units: str, sat: str, light: str, alpha: Optional[float] = None) -> RGBA: + """ + Parse raw hue, saturation, lightness and alpha values and convert to RGBA. + """ + s_value, l_value = parse_color_value(sat, 100), parse_color_value(light, 100) + + h_value = float(h) + if h_units in {None, 'deg'}: + h_value = h_value % 360 / 360 + elif h_units == 'rad': + h_value = h_value % rads / rads + else: + # turns + h_value = h_value % 1 + + r, g, b = hls_to_rgb(h_value, l_value, s_value) + return RGBA(r, g, b, alpha) + + +def float_to_255(c: float) -> int: + return int(round(c * 255)) + + +COLORS_BY_NAME = { + 'aliceblue': (240, 248, 255), + 'antiquewhite': (250, 235, 215), + 'aqua': (0, 255, 255), + 'aquamarine': (127, 255, 212), + 'azure': (240, 255, 255), + 'beige': (245, 245, 220), + 'bisque': (255, 228, 196), + 'black': (0, 0, 0), + 'blanchedalmond': (255, 235, 205), + 'blue': (0, 0, 255), + 'blueviolet': (138, 43, 226), + 'brown': (165, 42, 42), + 'burlywood': (222, 184, 135), + 'cadetblue': (95, 158, 160), + 'chartreuse': (127, 255, 0), + 'chocolate': (210, 105, 30), + 'coral': (255, 127, 80), + 'cornflowerblue': (100, 149, 237), + 'cornsilk': (255, 248, 220), + 'crimson': (220, 20, 60), + 'cyan': (0, 255, 255), + 'darkblue': (0, 0, 139), + 'darkcyan': (0, 139, 139), + 'darkgoldenrod': (184, 134, 11), + 'darkgray': (169, 169, 169), + 'darkgreen': (0, 100, 0), + 'darkgrey': (169, 169, 169), + 'darkkhaki': (189, 183, 107), + 'darkmagenta': (139, 0, 139), + 'darkolivegreen': (85, 107, 47), + 'darkorange': (255, 140, 0), + 'darkorchid': (153, 50, 204), + 'darkred': (139, 0, 0), + 'darksalmon': (233, 150, 122), + 'darkseagreen': (143, 188, 143), + 'darkslateblue': (72, 61, 139), + 'darkslategray': (47, 79, 79), + 'darkslategrey': (47, 79, 79), + 'darkturquoise': (0, 206, 209), + 'darkviolet': (148, 0, 211), + 'deeppink': (255, 20, 147), + 'deepskyblue': (0, 191, 255), + 'dimgray': (105, 105, 105), + 'dimgrey': (105, 105, 105), + 'dodgerblue': (30, 144, 255), + 'firebrick': (178, 34, 34), + 'floralwhite': (255, 250, 240), + 'forestgreen': (34, 139, 34), + 'fuchsia': (255, 0, 255), + 'gainsboro': (220, 220, 220), + 'ghostwhite': (248, 248, 255), + 'gold': (255, 215, 0), + 'goldenrod': (218, 165, 32), + 'gray': (128, 128, 128), + 'green': (0, 128, 0), + 'greenyellow': (173, 255, 47), + 'grey': (128, 128, 128), + 'honeydew': (240, 255, 240), + 'hotpink': (255, 105, 180), + 'indianred': (205, 92, 92), + 'indigo': (75, 0, 130), + 'ivory': (255, 255, 240), + 'khaki': (240, 230, 140), + 'lavender': (230, 230, 250), + 'lavenderblush': (255, 240, 245), + 'lawngreen': (124, 252, 0), + 'lemonchiffon': (255, 250, 205), + 'lightblue': (173, 216, 230), + 'lightcoral': (240, 128, 128), + 'lightcyan': (224, 255, 255), + 'lightgoldenrodyellow': (250, 250, 210), + 'lightgray': (211, 211, 211), + 'lightgreen': (144, 238, 144), + 'lightgrey': (211, 211, 211), + 'lightpink': (255, 182, 193), + 'lightsalmon': (255, 160, 122), + 'lightseagreen': (32, 178, 170), + 'lightskyblue': (135, 206, 250), + 'lightslategray': (119, 136, 153), + 'lightslategrey': (119, 136, 153), + 'lightsteelblue': (176, 196, 222), + 'lightyellow': (255, 255, 224), + 'lime': (0, 255, 0), + 'limegreen': (50, 205, 50), + 'linen': (250, 240, 230), + 'magenta': (255, 0, 255), + 'maroon': (128, 0, 0), + 'mediumaquamarine': (102, 205, 170), + 'mediumblue': (0, 0, 205), + 'mediumorchid': (186, 85, 211), + 'mediumpurple': (147, 112, 219), + 'mediumseagreen': (60, 179, 113), + 'mediumslateblue': (123, 104, 238), + 'mediumspringgreen': (0, 250, 154), + 'mediumturquoise': (72, 209, 204), + 'mediumvioletred': (199, 21, 133), + 'midnightblue': (25, 25, 112), + 'mintcream': (245, 255, 250), + 'mistyrose': (255, 228, 225), + 'moccasin': (255, 228, 181), + 'navajowhite': (255, 222, 173), + 'navy': (0, 0, 128), + 'oldlace': (253, 245, 230), + 'olive': (128, 128, 0), + 'olivedrab': (107, 142, 35), + 'orange': (255, 165, 0), + 'orangered': (255, 69, 0), + 'orchid': (218, 112, 214), + 'palegoldenrod': (238, 232, 170), + 'palegreen': (152, 251, 152), + 'paleturquoise': (175, 238, 238), + 'palevioletred': (219, 112, 147), + 'papayawhip': (255, 239, 213), + 'peachpuff': (255, 218, 185), + 'peru': (205, 133, 63), + 'pink': (255, 192, 203), + 'plum': (221, 160, 221), + 'powderblue': (176, 224, 230), + 'purple': (128, 0, 128), + 'red': (255, 0, 0), + 'rosybrown': (188, 143, 143), + 'royalblue': (65, 105, 225), + 'saddlebrown': (139, 69, 19), + 'salmon': (250, 128, 114), + 'sandybrown': (244, 164, 96), + 'seagreen': (46, 139, 87), + 'seashell': (255, 245, 238), + 'sienna': (160, 82, 45), + 'silver': (192, 192, 192), + 'skyblue': (135, 206, 235), + 'slateblue': (106, 90, 205), + 'slategray': (112, 128, 144), + 'slategrey': (112, 128, 144), + 'snow': (255, 250, 250), + 'springgreen': (0, 255, 127), + 'steelblue': (70, 130, 180), + 'tan': (210, 180, 140), + 'teal': (0, 128, 128), + 'thistle': (216, 191, 216), + 'tomato': (255, 99, 71), + 'turquoise': (64, 224, 208), + 'violet': (238, 130, 238), + 'wheat': (245, 222, 179), + 'white': (255, 255, 255), + 'whitesmoke': (245, 245, 245), + 'yellow': (255, 255, 0), + 'yellowgreen': (154, 205, 50), +} + +COLORS_BY_VALUE = {v: k for k, v in COLORS_BY_NAME.items()} diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/config.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/config.py new file mode 100644 index 0000000000000000000000000000000000000000..18f7c999bee0fab95293b2434047fd20532a6446 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/config.py @@ -0,0 +1,191 @@ +import json +from enum import Enum +from typing import TYPE_CHECKING, Any, Callable, Dict, ForwardRef, Optional, Tuple, Type, Union + +from typing_extensions import Literal, Protocol + +from pydantic.v1.typing import AnyArgTCallable, AnyCallable +from pydantic.v1.utils import GetterDict +from pydantic.v1.version import compiled + +if TYPE_CHECKING: + from typing import overload + + from pydantic.v1.fields import ModelField + from pydantic.v1.main import BaseModel + + ConfigType = Type['BaseConfig'] + + class SchemaExtraCallable(Protocol): + @overload + def __call__(self, schema: Dict[str, Any]) -> None: + pass + + @overload + def __call__(self, schema: Dict[str, Any], model_class: Type[BaseModel]) -> None: + pass + +else: + SchemaExtraCallable = Callable[..., None] + +__all__ = 'BaseConfig', 'ConfigDict', 'get_config', 'Extra', 'inherit_config', 'prepare_config' + + +class Extra(str, Enum): + allow = 'allow' + ignore = 'ignore' + forbid = 'forbid' + + +# https://github.com/cython/cython/issues/4003 +# Fixed in Cython 3 and Pydantic v1 won't support Cython 3. +# Pydantic v2 doesn't depend on Cython at all. +if not compiled: + from typing_extensions import TypedDict + + class ConfigDict(TypedDict, total=False): + title: Optional[str] + anystr_lower: bool + anystr_strip_whitespace: bool + min_anystr_length: int + max_anystr_length: Optional[int] + validate_all: bool + extra: Extra + allow_mutation: bool + frozen: bool + allow_population_by_field_name: bool + use_enum_values: bool + fields: Dict[str, Union[str, Dict[str, str]]] + validate_assignment: bool + error_msg_templates: Dict[str, str] + arbitrary_types_allowed: bool + orm_mode: bool + getter_dict: Type[GetterDict] + alias_generator: Optional[Callable[[str], str]] + keep_untouched: Tuple[type, ...] + schema_extra: Union[Dict[str, object], 'SchemaExtraCallable'] + json_loads: Callable[[str], object] + json_dumps: AnyArgTCallable[str] + json_encoders: Dict[Type[object], AnyCallable] + underscore_attrs_are_private: bool + allow_inf_nan: bool + copy_on_model_validation: Literal['none', 'deep', 'shallow'] + # whether dataclass `__post_init__` should be run after validation + post_init_call: Literal['before_validation', 'after_validation'] + +else: + ConfigDict = dict # type: ignore + + +class BaseConfig: + title: Optional[str] = None + anystr_lower: bool = False + anystr_upper: bool = False + anystr_strip_whitespace: bool = False + min_anystr_length: int = 0 + max_anystr_length: Optional[int] = None + validate_all: bool = False + extra: Extra = Extra.ignore + allow_mutation: bool = True + frozen: bool = False + allow_population_by_field_name: bool = False + use_enum_values: bool = False + fields: Dict[str, Union[str, Dict[str, str]]] = {} + validate_assignment: bool = False + error_msg_templates: Dict[str, str] = {} + arbitrary_types_allowed: bool = False + orm_mode: bool = False + getter_dict: Type[GetterDict] = GetterDict + alias_generator: Optional[Callable[[str], str]] = None + keep_untouched: Tuple[type, ...] = () + schema_extra: Union[Dict[str, Any], 'SchemaExtraCallable'] = {} + json_loads: Callable[[str], Any] = json.loads + json_dumps: Callable[..., str] = json.dumps + json_encoders: Dict[Union[Type[Any], str, ForwardRef], AnyCallable] = {} + underscore_attrs_are_private: bool = False + allow_inf_nan: bool = True + + # whether inherited models as fields should be reconstructed as base model, + # and whether such a copy should be shallow or deep + copy_on_model_validation: Literal['none', 'deep', 'shallow'] = 'shallow' + + # whether `Union` should check all allowed types before even trying to coerce + smart_union: bool = False + # whether dataclass `__post_init__` should be run before or after validation + post_init_call: Literal['before_validation', 'after_validation'] = 'before_validation' + + @classmethod + def get_field_info(cls, name: str) -> Dict[str, Any]: + """ + Get properties of FieldInfo from the `fields` property of the config class. + """ + + fields_value = cls.fields.get(name) + + if isinstance(fields_value, str): + field_info: Dict[str, Any] = {'alias': fields_value} + elif isinstance(fields_value, dict): + field_info = fields_value + else: + field_info = {} + + if 'alias' in field_info: + field_info.setdefault('alias_priority', 2) + + if field_info.get('alias_priority', 0) <= 1 and cls.alias_generator: + alias = cls.alias_generator(name) + if not isinstance(alias, str): + raise TypeError(f'Config.alias_generator must return str, not {alias.__class__}') + field_info.update(alias=alias, alias_priority=1) + return field_info + + @classmethod + def prepare_field(cls, field: 'ModelField') -> None: + """ + Optional hook to check or modify fields during model creation. + """ + pass + + +def get_config(config: Union[ConfigDict, Type[object], None]) -> Type[BaseConfig]: + if config is None: + return BaseConfig + + else: + config_dict = ( + config + if isinstance(config, dict) + else {k: getattr(config, k) for k in dir(config) if not k.startswith('__')} + ) + + class Config(BaseConfig): + ... + + for k, v in config_dict.items(): + setattr(Config, k, v) + return Config + + +def inherit_config(self_config: 'ConfigType', parent_config: 'ConfigType', **namespace: Any) -> 'ConfigType': + if not self_config: + base_classes: Tuple['ConfigType', ...] = (parent_config,) + elif self_config == parent_config: + base_classes = (self_config,) + else: + base_classes = self_config, parent_config + + namespace['json_encoders'] = { + **getattr(parent_config, 'json_encoders', {}), + **getattr(self_config, 'json_encoders', {}), + **namespace.get('json_encoders', {}), + } + + return type('Config', base_classes, namespace) + + +def prepare_config(config: Type[BaseConfig], cls_name: str) -> None: + if not isinstance(config.extra, Extra): + try: + config.extra = Extra(config.extra) + except ValueError: + raise ValueError(f'"{cls_name}": {config.extra} is not a valid value for "extra"') diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/dataclasses.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/dataclasses.py new file mode 100644 index 0000000000000000000000000000000000000000..bd1670291d6622a28ecb5b8e9ad68f4bac9305d7 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/dataclasses.py @@ -0,0 +1,500 @@ +""" +The main purpose is to enhance stdlib dataclasses by adding validation +A pydantic dataclass can be generated from scratch or from a stdlib one. + +Behind the scene, a pydantic dataclass is just like a regular one on which we attach +a `BaseModel` and magic methods to trigger the validation of the data. +`__init__` and `__post_init__` are hence overridden and have extra logic to be +able to validate input data. + +When a pydantic dataclass is generated from scratch, it's just a plain dataclass +with validation triggered at initialization + +The tricky part if for stdlib dataclasses that are converted after into pydantic ones e.g. + +```py +@dataclasses.dataclass +class M: + x: int + +ValidatedM = pydantic.dataclasses.dataclass(M) +``` + +We indeed still want to support equality, hashing, repr, ... as if it was the stdlib one! + +```py +assert isinstance(ValidatedM(x=1), M) +assert ValidatedM(x=1) == M(x=1) +``` + +This means we **don't want to create a new dataclass that inherits from it** +The trick is to create a wrapper around `M` that will act as a proxy to trigger +validation without altering default `M` behaviour. +""" +import copy +import dataclasses +import sys +from contextlib import contextmanager +from functools import wraps + +try: + from functools import cached_property +except ImportError: + # cached_property available only for python3.8+ + pass + +from typing import TYPE_CHECKING, Any, Callable, ClassVar, Dict, Generator, Optional, Type, TypeVar, Union, overload + +from typing_extensions import dataclass_transform + +from pydantic.v1.class_validators import gather_all_validators +from pydantic.v1.config import BaseConfig, ConfigDict, Extra, get_config +from pydantic.v1.error_wrappers import ValidationError +from pydantic.v1.errors import DataclassTypeError +from pydantic.v1.fields import Field, FieldInfo, Required, Undefined +from pydantic.v1.main import create_model, validate_model +from pydantic.v1.utils import ClassAttribute + +if TYPE_CHECKING: + from pydantic.v1.main import BaseModel + from pydantic.v1.typing import CallableGenerator, NoArgAnyCallable + + DataclassT = TypeVar('DataclassT', bound='Dataclass') + + DataclassClassOrWrapper = Union[Type['Dataclass'], 'DataclassProxy'] + + class Dataclass: + # stdlib attributes + __dataclass_fields__: ClassVar[Dict[str, Any]] + __dataclass_params__: ClassVar[Any] # in reality `dataclasses._DataclassParams` + __post_init__: ClassVar[Callable[..., None]] + + # Added by pydantic + __pydantic_run_validation__: ClassVar[bool] + __post_init_post_parse__: ClassVar[Callable[..., None]] + __pydantic_initialised__: ClassVar[bool] + __pydantic_model__: ClassVar[Type[BaseModel]] + __pydantic_validate_values__: ClassVar[Callable[['Dataclass'], None]] + __pydantic_has_field_info_default__: ClassVar[bool] # whether a `pydantic.Field` is used as default value + + def __init__(self, *args: object, **kwargs: object) -> None: + pass + + @classmethod + def __get_validators__(cls: Type['Dataclass']) -> 'CallableGenerator': + pass + + @classmethod + def __validate__(cls: Type['DataclassT'], v: Any) -> 'DataclassT': + pass + + +__all__ = [ + 'dataclass', + 'set_validation', + 'create_pydantic_model_from_dataclass', + 'is_builtin_dataclass', + 'make_dataclass_validator', +] + +_T = TypeVar('_T') + +if sys.version_info >= (3, 10): + + @dataclass_transform(field_specifiers=(dataclasses.field, Field)) + @overload + def dataclass( + *, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + config: Union[ConfigDict, Type[object], None] = None, + validate_on_init: Optional[bool] = None, + use_proxy: Optional[bool] = None, + kw_only: bool = ..., + ) -> Callable[[Type[_T]], 'DataclassClassOrWrapper']: + ... + + @dataclass_transform(field_specifiers=(dataclasses.field, Field)) + @overload + def dataclass( + _cls: Type[_T], + *, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + config: Union[ConfigDict, Type[object], None] = None, + validate_on_init: Optional[bool] = None, + use_proxy: Optional[bool] = None, + kw_only: bool = ..., + ) -> 'DataclassClassOrWrapper': + ... + +else: + + @dataclass_transform(field_specifiers=(dataclasses.field, Field)) + @overload + def dataclass( + *, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + config: Union[ConfigDict, Type[object], None] = None, + validate_on_init: Optional[bool] = None, + use_proxy: Optional[bool] = None, + ) -> Callable[[Type[_T]], 'DataclassClassOrWrapper']: + ... + + @dataclass_transform(field_specifiers=(dataclasses.field, Field)) + @overload + def dataclass( + _cls: Type[_T], + *, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + config: Union[ConfigDict, Type[object], None] = None, + validate_on_init: Optional[bool] = None, + use_proxy: Optional[bool] = None, + ) -> 'DataclassClassOrWrapper': + ... + + +@dataclass_transform(field_specifiers=(dataclasses.field, Field)) +def dataclass( + _cls: Optional[Type[_T]] = None, + *, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + config: Union[ConfigDict, Type[object], None] = None, + validate_on_init: Optional[bool] = None, + use_proxy: Optional[bool] = None, + kw_only: bool = False, +) -> Union[Callable[[Type[_T]], 'DataclassClassOrWrapper'], 'DataclassClassOrWrapper']: + """ + Like the python standard lib dataclasses but with type validation. + The result is either a pydantic dataclass that will validate input data + or a wrapper that will trigger validation around a stdlib dataclass + to avoid modifying it directly + """ + the_config = get_config(config) + + def wrap(cls: Type[Any]) -> 'DataclassClassOrWrapper': + should_use_proxy = ( + use_proxy + if use_proxy is not None + else ( + is_builtin_dataclass(cls) + and (cls.__bases__[0] is object or set(dir(cls)) == set(dir(cls.__bases__[0]))) + ) + ) + if should_use_proxy: + dc_cls_doc = '' + dc_cls = DataclassProxy(cls) + default_validate_on_init = False + else: + dc_cls_doc = cls.__doc__ or '' # needs to be done before generating dataclass + if sys.version_info >= (3, 10): + dc_cls = dataclasses.dataclass( + cls, + init=init, + repr=repr, + eq=eq, + order=order, + unsafe_hash=unsafe_hash, + frozen=frozen, + kw_only=kw_only, + ) + else: + dc_cls = dataclasses.dataclass( # type: ignore + cls, init=init, repr=repr, eq=eq, order=order, unsafe_hash=unsafe_hash, frozen=frozen + ) + default_validate_on_init = True + + should_validate_on_init = default_validate_on_init if validate_on_init is None else validate_on_init + _add_pydantic_validation_attributes(cls, the_config, should_validate_on_init, dc_cls_doc) + dc_cls.__pydantic_model__.__try_update_forward_refs__(**{cls.__name__: cls}) + return dc_cls + + if _cls is None: + return wrap + + return wrap(_cls) + + +@contextmanager +def set_validation(cls: Type['DataclassT'], value: bool) -> Generator[Type['DataclassT'], None, None]: + original_run_validation = cls.__pydantic_run_validation__ + try: + cls.__pydantic_run_validation__ = value + yield cls + finally: + cls.__pydantic_run_validation__ = original_run_validation + + +class DataclassProxy: + __slots__ = '__dataclass__' + + def __init__(self, dc_cls: Type['Dataclass']) -> None: + object.__setattr__(self, '__dataclass__', dc_cls) + + def __call__(self, *args: Any, **kwargs: Any) -> Any: + with set_validation(self.__dataclass__, True): + return self.__dataclass__(*args, **kwargs) + + def __getattr__(self, name: str) -> Any: + return getattr(self.__dataclass__, name) + + def __setattr__(self, __name: str, __value: Any) -> None: + return setattr(self.__dataclass__, __name, __value) + + def __instancecheck__(self, instance: Any) -> bool: + return isinstance(instance, self.__dataclass__) + + def __copy__(self) -> 'DataclassProxy': + return DataclassProxy(copy.copy(self.__dataclass__)) + + def __deepcopy__(self, memo: Any) -> 'DataclassProxy': + return DataclassProxy(copy.deepcopy(self.__dataclass__, memo)) + + +def _add_pydantic_validation_attributes( # noqa: C901 (ignore complexity) + dc_cls: Type['Dataclass'], + config: Type[BaseConfig], + validate_on_init: bool, + dc_cls_doc: str, +) -> None: + """ + We need to replace the right method. If no `__post_init__` has been set in the stdlib dataclass + it won't even exist (code is generated on the fly by `dataclasses`) + By default, we run validation after `__init__` or `__post_init__` if defined + """ + init = dc_cls.__init__ + + @wraps(init) + def handle_extra_init(self: 'Dataclass', *args: Any, **kwargs: Any) -> None: + if config.extra == Extra.ignore: + init(self, *args, **{k: v for k, v in kwargs.items() if k in self.__dataclass_fields__}) + + elif config.extra == Extra.allow: + for k, v in kwargs.items(): + self.__dict__.setdefault(k, v) + init(self, *args, **{k: v for k, v in kwargs.items() if k in self.__dataclass_fields__}) + + else: + init(self, *args, **kwargs) + + if hasattr(dc_cls, '__post_init__'): + try: + post_init = dc_cls.__post_init__.__wrapped__ # type: ignore[attr-defined] + except AttributeError: + post_init = dc_cls.__post_init__ + + @wraps(post_init) + def new_post_init(self: 'Dataclass', *args: Any, **kwargs: Any) -> None: + if config.post_init_call == 'before_validation': + post_init(self, *args, **kwargs) + + if self.__class__.__pydantic_run_validation__: + self.__pydantic_validate_values__() + if hasattr(self, '__post_init_post_parse__'): + self.__post_init_post_parse__(*args, **kwargs) + + if config.post_init_call == 'after_validation': + post_init(self, *args, **kwargs) + + setattr(dc_cls, '__init__', handle_extra_init) + setattr(dc_cls, '__post_init__', new_post_init) + + else: + + @wraps(init) + def new_init(self: 'Dataclass', *args: Any, **kwargs: Any) -> None: + handle_extra_init(self, *args, **kwargs) + + if self.__class__.__pydantic_run_validation__: + self.__pydantic_validate_values__() + + if hasattr(self, '__post_init_post_parse__'): + # We need to find again the initvars. To do that we use `__dataclass_fields__` instead of + # public method `dataclasses.fields` + + # get all initvars and their default values + initvars_and_values: Dict[str, Any] = {} + for i, f in enumerate(self.__class__.__dataclass_fields__.values()): + if f._field_type is dataclasses._FIELD_INITVAR: # type: ignore[attr-defined] + try: + # set arg value by default + initvars_and_values[f.name] = args[i] + except IndexError: + initvars_and_values[f.name] = kwargs.get(f.name, f.default) + + self.__post_init_post_parse__(**initvars_and_values) + + setattr(dc_cls, '__init__', new_init) + + setattr(dc_cls, '__pydantic_run_validation__', ClassAttribute('__pydantic_run_validation__', validate_on_init)) + setattr(dc_cls, '__pydantic_initialised__', False) + setattr(dc_cls, '__pydantic_model__', create_pydantic_model_from_dataclass(dc_cls, config, dc_cls_doc)) + setattr(dc_cls, '__pydantic_validate_values__', _dataclass_validate_values) + setattr(dc_cls, '__validate__', classmethod(_validate_dataclass)) + setattr(dc_cls, '__get_validators__', classmethod(_get_validators)) + + if dc_cls.__pydantic_model__.__config__.validate_assignment and not dc_cls.__dataclass_params__.frozen: + setattr(dc_cls, '__setattr__', _dataclass_validate_assignment_setattr) + + +def _get_validators(cls: 'DataclassClassOrWrapper') -> 'CallableGenerator': + yield cls.__validate__ + + +def _validate_dataclass(cls: Type['DataclassT'], v: Any) -> 'DataclassT': + with set_validation(cls, True): + if isinstance(v, cls): + v.__pydantic_validate_values__() + return v + elif isinstance(v, (list, tuple)): + return cls(*v) + elif isinstance(v, dict): + return cls(**v) + else: + raise DataclassTypeError(class_name=cls.__name__) + + +def create_pydantic_model_from_dataclass( + dc_cls: Type['Dataclass'], + config: Type[Any] = BaseConfig, + dc_cls_doc: Optional[str] = None, +) -> Type['BaseModel']: + field_definitions: Dict[str, Any] = {} + for field in dataclasses.fields(dc_cls): + default: Any = Undefined + default_factory: Optional['NoArgAnyCallable'] = None + field_info: FieldInfo + + if field.default is not dataclasses.MISSING: + default = field.default + elif field.default_factory is not dataclasses.MISSING: + default_factory = field.default_factory + else: + default = Required + + if isinstance(default, FieldInfo): + field_info = default + dc_cls.__pydantic_has_field_info_default__ = True + else: + field_info = Field(default=default, default_factory=default_factory, **field.metadata) + + field_definitions[field.name] = (field.type, field_info) + + validators = gather_all_validators(dc_cls) + model: Type['BaseModel'] = create_model( + dc_cls.__name__, + __config__=config, + __module__=dc_cls.__module__, + __validators__=validators, + __cls_kwargs__={'__resolve_forward_refs__': False}, + **field_definitions, + ) + model.__doc__ = dc_cls_doc if dc_cls_doc is not None else dc_cls.__doc__ or '' + return model + + +if sys.version_info >= (3, 8): + + def _is_field_cached_property(obj: 'Dataclass', k: str) -> bool: + return isinstance(getattr(type(obj), k, None), cached_property) + +else: + + def _is_field_cached_property(obj: 'Dataclass', k: str) -> bool: + return False + + +def _dataclass_validate_values(self: 'Dataclass') -> None: + # validation errors can occur if this function is called twice on an already initialised dataclass. + # for example if Extra.forbid is enabled, it would consider __pydantic_initialised__ an invalid extra property + if getattr(self, '__pydantic_initialised__'): + return + if getattr(self, '__pydantic_has_field_info_default__', False): + # We need to remove `FieldInfo` values since they are not valid as input + # It's ok to do that because they are obviously the default values! + input_data = { + k: v + for k, v in self.__dict__.items() + if not (isinstance(v, FieldInfo) or _is_field_cached_property(self, k)) + } + else: + input_data = {k: v for k, v in self.__dict__.items() if not _is_field_cached_property(self, k)} + d, _, validation_error = validate_model(self.__pydantic_model__, input_data, cls=self.__class__) + if validation_error: + raise validation_error + self.__dict__.update(d) + object.__setattr__(self, '__pydantic_initialised__', True) + + +def _dataclass_validate_assignment_setattr(self: 'Dataclass', name: str, value: Any) -> None: + if self.__pydantic_initialised__: + d = dict(self.__dict__) + d.pop(name, None) + known_field = self.__pydantic_model__.__fields__.get(name, None) + if known_field: + value, error_ = known_field.validate(value, d, loc=name, cls=self.__class__) + if error_: + raise ValidationError([error_], self.__class__) + + object.__setattr__(self, name, value) + + +def is_builtin_dataclass(_cls: Type[Any]) -> bool: + """ + Whether a class is a stdlib dataclass + (useful to discriminated a pydantic dataclass that is actually a wrapper around a stdlib dataclass) + + we check that + - `_cls` is a dataclass + - `_cls` is not a processed pydantic dataclass (with a basemodel attached) + - `_cls` is not a pydantic dataclass inheriting directly from a stdlib dataclass + e.g. + ``` + @dataclasses.dataclass + class A: + x: int + + @pydantic.dataclasses.dataclass + class B(A): + y: int + ``` + In this case, when we first check `B`, we make an extra check and look at the annotations ('y'), + which won't be a superset of all the dataclass fields (only the stdlib fields i.e. 'x') + """ + return ( + dataclasses.is_dataclass(_cls) + and not hasattr(_cls, '__pydantic_model__') + and set(_cls.__dataclass_fields__).issuperset(set(getattr(_cls, '__annotations__', {}))) + ) + + +def make_dataclass_validator(dc_cls: Type['Dataclass'], config: Type[BaseConfig]) -> 'CallableGenerator': + """ + Create a pydantic.dataclass from a builtin dataclass to add type validation + and yield the validators + It retrieves the parameters of the dataclass and forwards them to the newly created dataclass + """ + yield from _get_validators(dataclass(dc_cls, config=config, use_proxy=True)) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/datetime_parse.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/datetime_parse.py new file mode 100644 index 0000000000000000000000000000000000000000..a7598fc6c56688c4dd6526fc6e8b8e03682f62e8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/datetime_parse.py @@ -0,0 +1,248 @@ +""" +Functions to parse datetime objects. + +We're using regular expressions rather than time.strptime because: +- They provide both validation and parsing. +- They're more flexible for datetimes. +- The date/datetime/time constructors produce friendlier error messages. + +Stolen from https://raw.githubusercontent.com/django/django/main/django/utils/dateparse.py at +9718fa2e8abe430c3526a9278dd976443d4ae3c6 + +Changed to: +* use standard python datetime types not django.utils.timezone +* raise ValueError when regex doesn't match rather than returning None +* support parsing unix timestamps for dates and datetimes +""" +import re +from datetime import date, datetime, time, timedelta, timezone +from typing import Dict, Optional, Type, Union + +from pydantic.v1 import errors + +date_expr = r'(?P\d{4})-(?P\d{1,2})-(?P\d{1,2})' +time_expr = ( + r'(?P\d{1,2}):(?P\d{1,2})' + r'(?::(?P\d{1,2})(?:\.(?P\d{1,6})\d{0,6})?)?' + r'(?PZ|[+-]\d{2}(?::?\d{2})?)?$' +) + +date_re = re.compile(f'{date_expr}$') +time_re = re.compile(time_expr) +datetime_re = re.compile(f'{date_expr}[T ]{time_expr}') + +standard_duration_re = re.compile( + r'^' + r'(?:(?P-?\d+) (days?, )?)?' + r'((?:(?P-?\d+):)(?=\d+:\d+))?' + r'(?:(?P-?\d+):)?' + r'(?P-?\d+)' + r'(?:\.(?P\d{1,6})\d{0,6})?' + r'$' +) + +# Support the sections of ISO 8601 date representation that are accepted by timedelta +iso8601_duration_re = re.compile( + r'^(?P[-+]?)' + r'P' + r'(?:(?P\d+(.\d+)?)D)?' + r'(?:T' + r'(?:(?P\d+(.\d+)?)H)?' + r'(?:(?P\d+(.\d+)?)M)?' + r'(?:(?P\d+(.\d+)?)S)?' + r')?' + r'$' +) + +EPOCH = datetime(1970, 1, 1) +# if greater than this, the number is in ms, if less than or equal it's in seconds +# (in seconds this is 11th October 2603, in ms it's 20th August 1970) +MS_WATERSHED = int(2e10) +# slightly more than datetime.max in ns - (datetime.max - EPOCH).total_seconds() * 1e9 +MAX_NUMBER = int(3e20) +StrBytesIntFloat = Union[str, bytes, int, float] + + +def get_numeric(value: StrBytesIntFloat, native_expected_type: str) -> Union[None, int, float]: + if isinstance(value, (int, float)): + return value + try: + return float(value) + except ValueError: + return None + except TypeError: + raise TypeError(f'invalid type; expected {native_expected_type}, string, bytes, int or float') + + +def from_unix_seconds(seconds: Union[int, float]) -> datetime: + if seconds > MAX_NUMBER: + return datetime.max + elif seconds < -MAX_NUMBER: + return datetime.min + + while abs(seconds) > MS_WATERSHED: + seconds /= 1000 + dt = EPOCH + timedelta(seconds=seconds) + return dt.replace(tzinfo=timezone.utc) + + +def _parse_timezone(value: Optional[str], error: Type[Exception]) -> Union[None, int, timezone]: + if value == 'Z': + return timezone.utc + elif value is not None: + offset_mins = int(value[-2:]) if len(value) > 3 else 0 + offset = 60 * int(value[1:3]) + offset_mins + if value[0] == '-': + offset = -offset + try: + return timezone(timedelta(minutes=offset)) + except ValueError: + raise error() + else: + return None + + +def parse_date(value: Union[date, StrBytesIntFloat]) -> date: + """ + Parse a date/int/float/string and return a datetime.date. + + Raise ValueError if the input is well formatted but not a valid date. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, date): + if isinstance(value, datetime): + return value.date() + else: + return value + + number = get_numeric(value, 'date') + if number is not None: + return from_unix_seconds(number).date() + + if isinstance(value, bytes): + value = value.decode() + + match = date_re.match(value) # type: ignore + if match is None: + raise errors.DateError() + + kw = {k: int(v) for k, v in match.groupdict().items()} + + try: + return date(**kw) + except ValueError: + raise errors.DateError() + + +def parse_time(value: Union[time, StrBytesIntFloat]) -> time: + """ + Parse a time/string and return a datetime.time. + + Raise ValueError if the input is well formatted but not a valid time. + Raise ValueError if the input isn't well formatted, in particular if it contains an offset. + """ + if isinstance(value, time): + return value + + number = get_numeric(value, 'time') + if number is not None: + if number >= 86400: + # doesn't make sense since the time time loop back around to 0 + raise errors.TimeError() + return (datetime.min + timedelta(seconds=number)).time() + + if isinstance(value, bytes): + value = value.decode() + + match = time_re.match(value) # type: ignore + if match is None: + raise errors.TimeError() + + kw = match.groupdict() + if kw['microsecond']: + kw['microsecond'] = kw['microsecond'].ljust(6, '0') + + tzinfo = _parse_timezone(kw.pop('tzinfo'), errors.TimeError) + kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None} + kw_['tzinfo'] = tzinfo + + try: + return time(**kw_) # type: ignore + except ValueError: + raise errors.TimeError() + + +def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + """ + Parse a datetime/int/float/string and return a datetime.datetime. + + This function supports time zone offsets. When the input contains one, + the output uses a timezone with a fixed offset from UTC. + + Raise ValueError if the input is well formatted but not a valid datetime. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, datetime): + return value + + number = get_numeric(value, 'datetime') + if number is not None: + return from_unix_seconds(number) + + if isinstance(value, bytes): + value = value.decode() + + match = datetime_re.match(value) # type: ignore + if match is None: + raise errors.DateTimeError() + + kw = match.groupdict() + if kw['microsecond']: + kw['microsecond'] = kw['microsecond'].ljust(6, '0') + + tzinfo = _parse_timezone(kw.pop('tzinfo'), errors.DateTimeError) + kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None} + kw_['tzinfo'] = tzinfo + + try: + return datetime(**kw_) # type: ignore + except ValueError: + raise errors.DateTimeError() + + +def parse_duration(value: StrBytesIntFloat) -> timedelta: + """ + Parse a duration int/float/string and return a datetime.timedelta. + + The preferred format for durations in Django is '%d %H:%M:%S.%f'. + + Also supports ISO 8601 representation. + """ + if isinstance(value, timedelta): + return value + + if isinstance(value, (int, float)): + # below code requires a string + value = f'{value:f}' + elif isinstance(value, bytes): + value = value.decode() + + try: + match = standard_duration_re.match(value) or iso8601_duration_re.match(value) + except TypeError: + raise TypeError('invalid type; expected timedelta, string, bytes, int or float') + + if not match: + raise errors.DurationError() + + kw = match.groupdict() + sign = -1 if kw.pop('sign', '+') == '-' else 1 + if kw.get('microseconds'): + kw['microseconds'] = kw['microseconds'].ljust(6, '0') + + if kw.get('seconds') and kw.get('microseconds') and kw['seconds'].startswith('-'): + kw['microseconds'] = '-' + kw['microseconds'] + + kw_ = {k: float(v) for k, v in kw.items() if v is not None} + + return sign * timedelta(**kw_) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/decorator.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/decorator.py new file mode 100644 index 0000000000000000000000000000000000000000..2c7c2c2ffdb45ca50cd2b7e57bde1fc711adb851 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/decorator.py @@ -0,0 +1,264 @@ +from functools import wraps +from typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, TypeVar, Union, overload + +from pydantic.v1 import validator +from pydantic.v1.config import Extra +from pydantic.v1.errors import ConfigError +from pydantic.v1.main import BaseModel, create_model +from pydantic.v1.typing import get_all_type_hints +from pydantic.v1.utils import to_camel + +__all__ = ('validate_arguments',) + +if TYPE_CHECKING: + from pydantic.v1.typing import AnyCallable + + AnyCallableT = TypeVar('AnyCallableT', bound=AnyCallable) + ConfigType = Union[None, Type[Any], Dict[str, Any]] + + +@overload +def validate_arguments(func: None = None, *, config: 'ConfigType' = None) -> Callable[['AnyCallableT'], 'AnyCallableT']: + ... + + +@overload +def validate_arguments(func: 'AnyCallableT') -> 'AnyCallableT': + ... + + +def validate_arguments(func: Optional['AnyCallableT'] = None, *, config: 'ConfigType' = None) -> Any: + """ + Decorator to validate the arguments passed to a function. + """ + + def validate(_func: 'AnyCallable') -> 'AnyCallable': + vd = ValidatedFunction(_func, config) + + @wraps(_func) + def wrapper_function(*args: Any, **kwargs: Any) -> Any: + return vd.call(*args, **kwargs) + + wrapper_function.vd = vd # type: ignore + wrapper_function.validate = vd.init_model_instance # type: ignore + wrapper_function.raw_function = vd.raw_function # type: ignore + wrapper_function.model = vd.model # type: ignore + return wrapper_function + + if func: + return validate(func) + else: + return validate + + +ALT_V_ARGS = 'v__args' +ALT_V_KWARGS = 'v__kwargs' +V_POSITIONAL_ONLY_NAME = 'v__positional_only' +V_DUPLICATE_KWARGS = 'v__duplicate_kwargs' + + +class ValidatedFunction: + def __init__(self, function: 'AnyCallableT', config: 'ConfigType'): # noqa C901 + from inspect import Parameter, signature + + parameters: Mapping[str, Parameter] = signature(function).parameters + + if parameters.keys() & {ALT_V_ARGS, ALT_V_KWARGS, V_POSITIONAL_ONLY_NAME, V_DUPLICATE_KWARGS}: + raise ConfigError( + f'"{ALT_V_ARGS}", "{ALT_V_KWARGS}", "{V_POSITIONAL_ONLY_NAME}" and "{V_DUPLICATE_KWARGS}" ' + f'are not permitted as argument names when using the "{validate_arguments.__name__}" decorator' + ) + + self.raw_function = function + self.arg_mapping: Dict[int, str] = {} + self.positional_only_args = set() + self.v_args_name = 'args' + self.v_kwargs_name = 'kwargs' + + type_hints = get_all_type_hints(function) + takes_args = False + takes_kwargs = False + fields: Dict[str, Tuple[Any, Any]] = {} + for i, (name, p) in enumerate(parameters.items()): + if p.annotation is p.empty: + annotation = Any + else: + annotation = type_hints[name] + + default = ... if p.default is p.empty else p.default + if p.kind == Parameter.POSITIONAL_ONLY: + self.arg_mapping[i] = name + fields[name] = annotation, default + fields[V_POSITIONAL_ONLY_NAME] = List[str], None + self.positional_only_args.add(name) + elif p.kind == Parameter.POSITIONAL_OR_KEYWORD: + self.arg_mapping[i] = name + fields[name] = annotation, default + fields[V_DUPLICATE_KWARGS] = List[str], None + elif p.kind == Parameter.KEYWORD_ONLY: + fields[name] = annotation, default + elif p.kind == Parameter.VAR_POSITIONAL: + self.v_args_name = name + fields[name] = Tuple[annotation, ...], None + takes_args = True + else: + assert p.kind == Parameter.VAR_KEYWORD, p.kind + self.v_kwargs_name = name + fields[name] = Dict[str, annotation], None # type: ignore + takes_kwargs = True + + # these checks avoid a clash between "args" and a field with that name + if not takes_args and self.v_args_name in fields: + self.v_args_name = ALT_V_ARGS + + # same with "kwargs" + if not takes_kwargs and self.v_kwargs_name in fields: + self.v_kwargs_name = ALT_V_KWARGS + + if not takes_args: + # we add the field so validation below can raise the correct exception + fields[self.v_args_name] = List[Any], None + + if not takes_kwargs: + # same with kwargs + fields[self.v_kwargs_name] = Dict[Any, Any], None + + self.create_model(fields, takes_args, takes_kwargs, config) + + def init_model_instance(self, *args: Any, **kwargs: Any) -> BaseModel: + values = self.build_values(args, kwargs) + return self.model(**values) + + def call(self, *args: Any, **kwargs: Any) -> Any: + m = self.init_model_instance(*args, **kwargs) + return self.execute(m) + + def build_values(self, args: Tuple[Any, ...], kwargs: Dict[str, Any]) -> Dict[str, Any]: + values: Dict[str, Any] = {} + if args: + arg_iter = enumerate(args) + while True: + try: + i, a = next(arg_iter) + except StopIteration: + break + arg_name = self.arg_mapping.get(i) + if arg_name is not None: + values[arg_name] = a + else: + values[self.v_args_name] = [a] + [a for _, a in arg_iter] + break + + var_kwargs: Dict[str, Any] = {} + wrong_positional_args = [] + duplicate_kwargs = [] + fields_alias = [ + field.alias + for name, field in self.model.__fields__.items() + if name not in (self.v_args_name, self.v_kwargs_name) + ] + non_var_fields = set(self.model.__fields__) - {self.v_args_name, self.v_kwargs_name} + for k, v in kwargs.items(): + if k in non_var_fields or k in fields_alias: + if k in self.positional_only_args: + wrong_positional_args.append(k) + if k in values: + duplicate_kwargs.append(k) + values[k] = v + else: + var_kwargs[k] = v + + if var_kwargs: + values[self.v_kwargs_name] = var_kwargs + if wrong_positional_args: + values[V_POSITIONAL_ONLY_NAME] = wrong_positional_args + if duplicate_kwargs: + values[V_DUPLICATE_KWARGS] = duplicate_kwargs + return values + + def execute(self, m: BaseModel) -> Any: + d = {k: v for k, v in m._iter() if k in m.__fields_set__ or m.__fields__[k].default_factory} + var_kwargs = d.pop(self.v_kwargs_name, {}) + + if self.v_args_name in d: + args_: List[Any] = [] + in_kwargs = False + kwargs = {} + for name, value in d.items(): + if in_kwargs: + kwargs[name] = value + elif name == self.v_args_name: + args_ += value + in_kwargs = True + else: + args_.append(value) + return self.raw_function(*args_, **kwargs, **var_kwargs) + elif self.positional_only_args: + args_ = [] + kwargs = {} + for name, value in d.items(): + if name in self.positional_only_args: + args_.append(value) + else: + kwargs[name] = value + return self.raw_function(*args_, **kwargs, **var_kwargs) + else: + return self.raw_function(**d, **var_kwargs) + + def create_model(self, fields: Dict[str, Any], takes_args: bool, takes_kwargs: bool, config: 'ConfigType') -> None: + pos_args = len(self.arg_mapping) + + class CustomConfig: + pass + + if not TYPE_CHECKING: # pragma: no branch + if isinstance(config, dict): + CustomConfig = type('Config', (), config) # noqa: F811 + elif config is not None: + CustomConfig = config # noqa: F811 + + if hasattr(CustomConfig, 'fields') or hasattr(CustomConfig, 'alias_generator'): + raise ConfigError( + 'Setting the "fields" and "alias_generator" property on custom Config for ' + '@validate_arguments is not yet supported, please remove.' + ) + + class DecoratorBaseModel(BaseModel): + @validator(self.v_args_name, check_fields=False, allow_reuse=True) + def check_args(cls, v: Optional[List[Any]]) -> Optional[List[Any]]: + if takes_args or v is None: + return v + + raise TypeError(f'{pos_args} positional arguments expected but {pos_args + len(v)} given') + + @validator(self.v_kwargs_name, check_fields=False, allow_reuse=True) + def check_kwargs(cls, v: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]: + if takes_kwargs or v is None: + return v + + plural = '' if len(v) == 1 else 's' + keys = ', '.join(map(repr, v.keys())) + raise TypeError(f'unexpected keyword argument{plural}: {keys}') + + @validator(V_POSITIONAL_ONLY_NAME, check_fields=False, allow_reuse=True) + def check_positional_only(cls, v: Optional[List[str]]) -> None: + if v is None: + return + + plural = '' if len(v) == 1 else 's' + keys = ', '.join(map(repr, v)) + raise TypeError(f'positional-only argument{plural} passed as keyword argument{plural}: {keys}') + + @validator(V_DUPLICATE_KWARGS, check_fields=False, allow_reuse=True) + def check_duplicate_kwargs(cls, v: Optional[List[str]]) -> None: + if v is None: + return + + plural = '' if len(v) == 1 else 's' + keys = ', '.join(map(repr, v)) + raise TypeError(f'multiple values for argument{plural}: {keys}') + + class Config(CustomConfig): + extra = getattr(CustomConfig, 'extra', Extra.forbid) + + self.model = create_model(to_camel(self.raw_function.__name__), __base__=DecoratorBaseModel, **fields) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/env_settings.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/env_settings.py new file mode 100644 index 0000000000000000000000000000000000000000..5f6f217500d8ca1e7717f59ae372ee9a27660fe3 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/env_settings.py @@ -0,0 +1,350 @@ +import os +import warnings +from pathlib import Path +from typing import AbstractSet, Any, Callable, ClassVar, Dict, List, Mapping, Optional, Tuple, Type, Union + +from pydantic.v1.config import BaseConfig, Extra +from pydantic.v1.fields import ModelField +from pydantic.v1.main import BaseModel +from pydantic.v1.types import JsonWrapper +from pydantic.v1.typing import StrPath, display_as_type, get_origin, is_union +from pydantic.v1.utils import deep_update, lenient_issubclass, path_type, sequence_like + +env_file_sentinel = str(object()) + +SettingsSourceCallable = Callable[['BaseSettings'], Dict[str, Any]] +DotenvType = Union[StrPath, List[StrPath], Tuple[StrPath, ...]] + + +class SettingsError(ValueError): + pass + + +class BaseSettings(BaseModel): + """ + Base class for settings, allowing values to be overridden by environment variables. + + This is useful in production for secrets you do not wish to save in code, it plays nicely with docker(-compose), + Heroku and any 12 factor app design. + """ + + def __init__( + __pydantic_self__, + _env_file: Optional[DotenvType] = env_file_sentinel, + _env_file_encoding: Optional[str] = None, + _env_nested_delimiter: Optional[str] = None, + _secrets_dir: Optional[StrPath] = None, + **values: Any, + ) -> None: + # Uses something other than `self` the first arg to allow "self" as a settable attribute + super().__init__( + **__pydantic_self__._build_values( + values, + _env_file=_env_file, + _env_file_encoding=_env_file_encoding, + _env_nested_delimiter=_env_nested_delimiter, + _secrets_dir=_secrets_dir, + ) + ) + + def _build_values( + self, + init_kwargs: Dict[str, Any], + _env_file: Optional[DotenvType] = None, + _env_file_encoding: Optional[str] = None, + _env_nested_delimiter: Optional[str] = None, + _secrets_dir: Optional[StrPath] = None, + ) -> Dict[str, Any]: + # Configure built-in sources + init_settings = InitSettingsSource(init_kwargs=init_kwargs) + env_settings = EnvSettingsSource( + env_file=(_env_file if _env_file != env_file_sentinel else self.__config__.env_file), + env_file_encoding=( + _env_file_encoding if _env_file_encoding is not None else self.__config__.env_file_encoding + ), + env_nested_delimiter=( + _env_nested_delimiter if _env_nested_delimiter is not None else self.__config__.env_nested_delimiter + ), + env_prefix_len=len(self.__config__.env_prefix), + ) + file_secret_settings = SecretsSettingsSource(secrets_dir=_secrets_dir or self.__config__.secrets_dir) + # Provide a hook to set built-in sources priority and add / remove sources + sources = self.__config__.customise_sources( + init_settings=init_settings, env_settings=env_settings, file_secret_settings=file_secret_settings + ) + if sources: + return deep_update(*reversed([source(self) for source in sources])) + else: + # no one should mean to do this, but I think returning an empty dict is marginally preferable + # to an informative error and much better than a confusing error + return {} + + class Config(BaseConfig): + env_prefix: str = '' + env_file: Optional[DotenvType] = None + env_file_encoding: Optional[str] = None + env_nested_delimiter: Optional[str] = None + secrets_dir: Optional[StrPath] = None + validate_all: bool = True + extra: Extra = Extra.forbid + arbitrary_types_allowed: bool = True + case_sensitive: bool = False + + @classmethod + def prepare_field(cls, field: ModelField) -> None: + env_names: Union[List[str], AbstractSet[str]] + field_info_from_config = cls.get_field_info(field.name) + + env = field_info_from_config.get('env') or field.field_info.extra.get('env') + if env is None: + if field.has_alias: + warnings.warn( + 'aliases are no longer used by BaseSettings to define which environment variables to read. ' + 'Instead use the "env" field setting. ' + 'See https://pydantic-docs.helpmanual.io/usage/settings/#environment-variable-names', + FutureWarning, + ) + env_names = {cls.env_prefix + field.name} + elif isinstance(env, str): + env_names = {env} + elif isinstance(env, (set, frozenset)): + env_names = env + elif sequence_like(env): + env_names = list(env) + else: + raise TypeError(f'invalid field env: {env!r} ({display_as_type(env)}); should be string, list or set') + + if not cls.case_sensitive: + env_names = env_names.__class__(n.lower() for n in env_names) + field.field_info.extra['env_names'] = env_names + + @classmethod + def customise_sources( + cls, + init_settings: SettingsSourceCallable, + env_settings: SettingsSourceCallable, + file_secret_settings: SettingsSourceCallable, + ) -> Tuple[SettingsSourceCallable, ...]: + return init_settings, env_settings, file_secret_settings + + @classmethod + def parse_env_var(cls, field_name: str, raw_val: str) -> Any: + return cls.json_loads(raw_val) + + # populated by the metaclass using the Config class defined above, annotated here to help IDEs only + __config__: ClassVar[Type[Config]] + + +class InitSettingsSource: + __slots__ = ('init_kwargs',) + + def __init__(self, init_kwargs: Dict[str, Any]): + self.init_kwargs = init_kwargs + + def __call__(self, settings: BaseSettings) -> Dict[str, Any]: + return self.init_kwargs + + def __repr__(self) -> str: + return f'InitSettingsSource(init_kwargs={self.init_kwargs!r})' + + +class EnvSettingsSource: + __slots__ = ('env_file', 'env_file_encoding', 'env_nested_delimiter', 'env_prefix_len') + + def __init__( + self, + env_file: Optional[DotenvType], + env_file_encoding: Optional[str], + env_nested_delimiter: Optional[str] = None, + env_prefix_len: int = 0, + ): + self.env_file: Optional[DotenvType] = env_file + self.env_file_encoding: Optional[str] = env_file_encoding + self.env_nested_delimiter: Optional[str] = env_nested_delimiter + self.env_prefix_len: int = env_prefix_len + + def __call__(self, settings: BaseSettings) -> Dict[str, Any]: # noqa C901 + """ + Build environment variables suitable for passing to the Model. + """ + d: Dict[str, Any] = {} + + if settings.__config__.case_sensitive: + env_vars: Mapping[str, Optional[str]] = os.environ + else: + env_vars = {k.lower(): v for k, v in os.environ.items()} + + dotenv_vars = self._read_env_files(settings.__config__.case_sensitive) + if dotenv_vars: + env_vars = {**dotenv_vars, **env_vars} + + for field in settings.__fields__.values(): + env_val: Optional[str] = None + for env_name in field.field_info.extra['env_names']: + env_val = env_vars.get(env_name) + if env_val is not None: + break + + is_complex, allow_parse_failure = self.field_is_complex(field) + if is_complex: + if env_val is None: + # field is complex but no value found so far, try explode_env_vars + env_val_built = self.explode_env_vars(field, env_vars) + if env_val_built: + d[field.alias] = env_val_built + else: + # field is complex and there's a value, decode that as JSON, then add explode_env_vars + try: + env_val = settings.__config__.parse_env_var(field.name, env_val) + except ValueError as e: + if not allow_parse_failure: + raise SettingsError(f'error parsing env var "{env_name}"') from e + + if isinstance(env_val, dict): + d[field.alias] = deep_update(env_val, self.explode_env_vars(field, env_vars)) + else: + d[field.alias] = env_val + elif env_val is not None: + # simplest case, field is not complex, we only need to add the value if it was found + d[field.alias] = env_val + + return d + + def _read_env_files(self, case_sensitive: bool) -> Dict[str, Optional[str]]: + env_files = self.env_file + if env_files is None: + return {} + + if isinstance(env_files, (str, os.PathLike)): + env_files = [env_files] + + dotenv_vars = {} + for env_file in env_files: + env_path = Path(env_file).expanduser() + if env_path.is_file(): + dotenv_vars.update( + read_env_file(env_path, encoding=self.env_file_encoding, case_sensitive=case_sensitive) + ) + + return dotenv_vars + + def field_is_complex(self, field: ModelField) -> Tuple[bool, bool]: + """ + Find out if a field is complex, and if so whether JSON errors should be ignored + """ + if lenient_issubclass(field.annotation, JsonWrapper): + return False, False + + if field.is_complex(): + allow_parse_failure = False + elif is_union(get_origin(field.type_)) and field.sub_fields and any(f.is_complex() for f in field.sub_fields): + allow_parse_failure = True + else: + return False, False + + return True, allow_parse_failure + + def explode_env_vars(self, field: ModelField, env_vars: Mapping[str, Optional[str]]) -> Dict[str, Any]: + """ + Process env_vars and extract the values of keys containing env_nested_delimiter into nested dictionaries. + + This is applied to a single field, hence filtering by env_var prefix. + """ + prefixes = [f'{env_name}{self.env_nested_delimiter}' for env_name in field.field_info.extra['env_names']] + result: Dict[str, Any] = {} + for env_name, env_val in env_vars.items(): + if not any(env_name.startswith(prefix) for prefix in prefixes): + continue + # we remove the prefix before splitting in case the prefix has characters in common with the delimiter + env_name_without_prefix = env_name[self.env_prefix_len :] + _, *keys, last_key = env_name_without_prefix.split(self.env_nested_delimiter) + env_var = result + for key in keys: + env_var = env_var.setdefault(key, {}) + env_var[last_key] = env_val + + return result + + def __repr__(self) -> str: + return ( + f'EnvSettingsSource(env_file={self.env_file!r}, env_file_encoding={self.env_file_encoding!r}, ' + f'env_nested_delimiter={self.env_nested_delimiter!r})' + ) + + +class SecretsSettingsSource: + __slots__ = ('secrets_dir',) + + def __init__(self, secrets_dir: Optional[StrPath]): + self.secrets_dir: Optional[StrPath] = secrets_dir + + def __call__(self, settings: BaseSettings) -> Dict[str, Any]: + """ + Build fields from "secrets" files. + """ + secrets: Dict[str, Optional[str]] = {} + + if self.secrets_dir is None: + return secrets + + secrets_path = Path(self.secrets_dir).expanduser() + + if not secrets_path.exists(): + warnings.warn(f'directory "{secrets_path}" does not exist') + return secrets + + if not secrets_path.is_dir(): + raise SettingsError(f'secrets_dir must reference a directory, not a {path_type(secrets_path)}') + + for field in settings.__fields__.values(): + for env_name in field.field_info.extra['env_names']: + path = find_case_path(secrets_path, env_name, settings.__config__.case_sensitive) + if not path: + # path does not exist, we currently don't return a warning for this + continue + + if path.is_file(): + secret_value = path.read_text().strip() + if field.is_complex(): + try: + secret_value = settings.__config__.parse_env_var(field.name, secret_value) + except ValueError as e: + raise SettingsError(f'error parsing env var "{env_name}"') from e + + secrets[field.alias] = secret_value + else: + warnings.warn( + f'attempted to load secret file "{path}" but found a {path_type(path)} instead.', + stacklevel=4, + ) + return secrets + + def __repr__(self) -> str: + return f'SecretsSettingsSource(secrets_dir={self.secrets_dir!r})' + + +def read_env_file( + file_path: StrPath, *, encoding: str = None, case_sensitive: bool = False +) -> Dict[str, Optional[str]]: + try: + from dotenv import dotenv_values + except ImportError as e: + raise ImportError('python-dotenv is not installed, run `pip install pydantic[dotenv]`') from e + + file_vars: Dict[str, Optional[str]] = dotenv_values(file_path, encoding=encoding or 'utf8') + if not case_sensitive: + return {k.lower(): v for k, v in file_vars.items()} + else: + return file_vars + + +def find_case_path(dir_path: Path, file_name: str, case_sensitive: bool) -> Optional[Path]: + """ + Find a file within path's directory matching filename, optionally ignoring case. + """ + for f in dir_path.iterdir(): + if f.name == file_name: + return f + elif not case_sensitive and f.name.lower() == file_name.lower(): + return f + return None diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/error_wrappers.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/error_wrappers.py new file mode 100644 index 0000000000000000000000000000000000000000..bc7f263146ee4f1701391a2436ab38e5e16f0e1a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/error_wrappers.py @@ -0,0 +1,161 @@ +import json +from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Sequence, Tuple, Type, Union + +from pydantic.v1.json import pydantic_encoder +from pydantic.v1.utils import Representation + +if TYPE_CHECKING: + from typing_extensions import TypedDict + + from pydantic.v1.config import BaseConfig + from pydantic.v1.types import ModelOrDc + from pydantic.v1.typing import ReprArgs + + Loc = Tuple[Union[int, str], ...] + + class _ErrorDictRequired(TypedDict): + loc: Loc + msg: str + type: str + + class ErrorDict(_ErrorDictRequired, total=False): + ctx: Dict[str, Any] + + +__all__ = 'ErrorWrapper', 'ValidationError' + + +class ErrorWrapper(Representation): + __slots__ = 'exc', '_loc' + + def __init__(self, exc: Exception, loc: Union[str, 'Loc']) -> None: + self.exc = exc + self._loc = loc + + def loc_tuple(self) -> 'Loc': + if isinstance(self._loc, tuple): + return self._loc + else: + return (self._loc,) + + def __repr_args__(self) -> 'ReprArgs': + return [('exc', self.exc), ('loc', self.loc_tuple())] + + +# ErrorList is something like Union[List[Union[List[ErrorWrapper], ErrorWrapper]], ErrorWrapper] +# but recursive, therefore just use: +ErrorList = Union[Sequence[Any], ErrorWrapper] + + +class ValidationError(Representation, ValueError): + __slots__ = 'raw_errors', 'model', '_error_cache' + + def __init__(self, errors: Sequence[ErrorList], model: 'ModelOrDc') -> None: + self.raw_errors = errors + self.model = model + self._error_cache: Optional[List['ErrorDict']] = None + + def errors(self) -> List['ErrorDict']: + if self._error_cache is None: + try: + config = self.model.__config__ # type: ignore + except AttributeError: + config = self.model.__pydantic_model__.__config__ # type: ignore + self._error_cache = list(flatten_errors(self.raw_errors, config)) + return self._error_cache + + def json(self, *, indent: Union[None, int, str] = 2) -> str: + return json.dumps(self.errors(), indent=indent, default=pydantic_encoder) + + def __str__(self) -> str: + errors = self.errors() + no_errors = len(errors) + return ( + f'{no_errors} validation error{"" if no_errors == 1 else "s"} for {self.model.__name__}\n' + f'{display_errors(errors)}' + ) + + def __repr_args__(self) -> 'ReprArgs': + return [('model', self.model.__name__), ('errors', self.errors())] + + +def display_errors(errors: List['ErrorDict']) -> str: + return '\n'.join(f'{_display_error_loc(e)}\n {e["msg"]} ({_display_error_type_and_ctx(e)})' for e in errors) + + +def _display_error_loc(error: 'ErrorDict') -> str: + return ' -> '.join(str(e) for e in error['loc']) + + +def _display_error_type_and_ctx(error: 'ErrorDict') -> str: + t = 'type=' + error['type'] + ctx = error.get('ctx') + if ctx: + return t + ''.join(f'; {k}={v}' for k, v in ctx.items()) + else: + return t + + +def flatten_errors( + errors: Sequence[Any], config: Type['BaseConfig'], loc: Optional['Loc'] = None +) -> Generator['ErrorDict', None, None]: + for error in errors: + if isinstance(error, ErrorWrapper): + if loc: + error_loc = loc + error.loc_tuple() + else: + error_loc = error.loc_tuple() + + if isinstance(error.exc, ValidationError): + yield from flatten_errors(error.exc.raw_errors, config, error_loc) + else: + yield error_dict(error.exc, config, error_loc) + elif isinstance(error, list): + yield from flatten_errors(error, config, loc=loc) + else: + raise RuntimeError(f'Unknown error object: {error}') + + +def error_dict(exc: Exception, config: Type['BaseConfig'], loc: 'Loc') -> 'ErrorDict': + type_ = get_exc_type(exc.__class__) + msg_template = config.error_msg_templates.get(type_) or getattr(exc, 'msg_template', None) + ctx = exc.__dict__ + if msg_template: + msg = msg_template.format(**ctx) + else: + msg = str(exc) + + d: 'ErrorDict' = {'loc': loc, 'msg': msg, 'type': type_} + + if ctx: + d['ctx'] = ctx + + return d + + +_EXC_TYPE_CACHE: Dict[Type[Exception], str] = {} + + +def get_exc_type(cls: Type[Exception]) -> str: + # slightly more efficient than using lru_cache since we don't need to worry about the cache filling up + try: + return _EXC_TYPE_CACHE[cls] + except KeyError: + r = _get_exc_type(cls) + _EXC_TYPE_CACHE[cls] = r + return r + + +def _get_exc_type(cls: Type[Exception]) -> str: + if issubclass(cls, AssertionError): + return 'assertion_error' + + base_name = 'type_error' if issubclass(cls, TypeError) else 'value_error' + if cls in (TypeError, ValueError): + # just TypeError or ValueError, no extra code + return base_name + + # if it's not a TypeError or ValueError, we just take the lowercase of the exception name + # no chaining or snake case logic, use "code" for more complex error types. + code = getattr(cls, 'code', None) or cls.__name__.replace('Error', '').lower() + return base_name + '.' + code diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/errors.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/errors.py new file mode 100644 index 0000000000000000000000000000000000000000..6e8644258a6ccf999a19f69c359452a109e54ffe --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/errors.py @@ -0,0 +1,646 @@ +from decimal import Decimal +from pathlib import Path +from typing import TYPE_CHECKING, Any, Callable, Sequence, Set, Tuple, Type, Union + +from pydantic.v1.typing import display_as_type + +if TYPE_CHECKING: + from pydantic.v1.typing import DictStrAny + +# explicitly state exports to avoid "from pydantic.v1.errors import *" also importing Decimal, Path etc. +__all__ = ( + 'PydanticTypeError', + 'PydanticValueError', + 'ConfigError', + 'MissingError', + 'ExtraError', + 'NoneIsNotAllowedError', + 'NoneIsAllowedError', + 'WrongConstantError', + 'NotNoneError', + 'BoolError', + 'BytesError', + 'DictError', + 'EmailError', + 'UrlError', + 'UrlSchemeError', + 'UrlSchemePermittedError', + 'UrlUserInfoError', + 'UrlHostError', + 'UrlHostTldError', + 'UrlPortError', + 'UrlExtraError', + 'EnumError', + 'IntEnumError', + 'EnumMemberError', + 'IntegerError', + 'FloatError', + 'PathError', + 'PathNotExistsError', + 'PathNotAFileError', + 'PathNotADirectoryError', + 'PyObjectError', + 'SequenceError', + 'ListError', + 'SetError', + 'FrozenSetError', + 'TupleError', + 'TupleLengthError', + 'ListMinLengthError', + 'ListMaxLengthError', + 'ListUniqueItemsError', + 'SetMinLengthError', + 'SetMaxLengthError', + 'FrozenSetMinLengthError', + 'FrozenSetMaxLengthError', + 'AnyStrMinLengthError', + 'AnyStrMaxLengthError', + 'StrError', + 'StrRegexError', + 'NumberNotGtError', + 'NumberNotGeError', + 'NumberNotLtError', + 'NumberNotLeError', + 'NumberNotMultipleError', + 'DecimalError', + 'DecimalIsNotFiniteError', + 'DecimalMaxDigitsError', + 'DecimalMaxPlacesError', + 'DecimalWholeDigitsError', + 'DateTimeError', + 'DateError', + 'DateNotInThePastError', + 'DateNotInTheFutureError', + 'TimeError', + 'DurationError', + 'HashableError', + 'UUIDError', + 'UUIDVersionError', + 'ArbitraryTypeError', + 'ClassError', + 'SubclassError', + 'JsonError', + 'JsonTypeError', + 'PatternError', + 'DataclassTypeError', + 'CallableError', + 'IPvAnyAddressError', + 'IPvAnyInterfaceError', + 'IPvAnyNetworkError', + 'IPv4AddressError', + 'IPv6AddressError', + 'IPv4NetworkError', + 'IPv6NetworkError', + 'IPv4InterfaceError', + 'IPv6InterfaceError', + 'ColorError', + 'StrictBoolError', + 'NotDigitError', + 'LuhnValidationError', + 'InvalidLengthForBrand', + 'InvalidByteSize', + 'InvalidByteSizeUnit', + 'MissingDiscriminator', + 'InvalidDiscriminator', +) + + +def cls_kwargs(cls: Type['PydanticErrorMixin'], ctx: 'DictStrAny') -> 'PydanticErrorMixin': + """ + For built-in exceptions like ValueError or TypeError, we need to implement + __reduce__ to override the default behaviour (instead of __getstate__/__setstate__) + By default pickle protocol 2 calls `cls.__new__(cls, *args)`. + Since we only use kwargs, we need a little constructor to change that. + Note: the callable can't be a lambda as pickle looks in the namespace to find it + """ + return cls(**ctx) + + +class PydanticErrorMixin: + code: str + msg_template: str + + def __init__(self, **ctx: Any) -> None: + self.__dict__ = ctx + + def __str__(self) -> str: + return self.msg_template.format(**self.__dict__) + + def __reduce__(self) -> Tuple[Callable[..., 'PydanticErrorMixin'], Tuple[Type['PydanticErrorMixin'], 'DictStrAny']]: + return cls_kwargs, (self.__class__, self.__dict__) + + +class PydanticTypeError(PydanticErrorMixin, TypeError): + pass + + +class PydanticValueError(PydanticErrorMixin, ValueError): + pass + + +class ConfigError(RuntimeError): + pass + + +class MissingError(PydanticValueError): + msg_template = 'field required' + + +class ExtraError(PydanticValueError): + msg_template = 'extra fields not permitted' + + +class NoneIsNotAllowedError(PydanticTypeError): + code = 'none.not_allowed' + msg_template = 'none is not an allowed value' + + +class NoneIsAllowedError(PydanticTypeError): + code = 'none.allowed' + msg_template = 'value is not none' + + +class WrongConstantError(PydanticValueError): + code = 'const' + + def __str__(self) -> str: + permitted = ', '.join(repr(v) for v in self.permitted) # type: ignore + return f'unexpected value; permitted: {permitted}' + + +class NotNoneError(PydanticTypeError): + code = 'not_none' + msg_template = 'value is not None' + + +class BoolError(PydanticTypeError): + msg_template = 'value could not be parsed to a boolean' + + +class BytesError(PydanticTypeError): + msg_template = 'byte type expected' + + +class DictError(PydanticTypeError): + msg_template = 'value is not a valid dict' + + +class EmailError(PydanticValueError): + msg_template = 'value is not a valid email address' + + +class UrlError(PydanticValueError): + code = 'url' + + +class UrlSchemeError(UrlError): + code = 'url.scheme' + msg_template = 'invalid or missing URL scheme' + + +class UrlSchemePermittedError(UrlError): + code = 'url.scheme' + msg_template = 'URL scheme not permitted' + + def __init__(self, allowed_schemes: Set[str]): + super().__init__(allowed_schemes=allowed_schemes) + + +class UrlUserInfoError(UrlError): + code = 'url.userinfo' + msg_template = 'userinfo required in URL but missing' + + +class UrlHostError(UrlError): + code = 'url.host' + msg_template = 'URL host invalid' + + +class UrlHostTldError(UrlError): + code = 'url.host' + msg_template = 'URL host invalid, top level domain required' + + +class UrlPortError(UrlError): + code = 'url.port' + msg_template = 'URL port invalid, port cannot exceed 65535' + + +class UrlExtraError(UrlError): + code = 'url.extra' + msg_template = 'URL invalid, extra characters found after valid URL: {extra!r}' + + +class EnumMemberError(PydanticTypeError): + code = 'enum' + + def __str__(self) -> str: + permitted = ', '.join(repr(v.value) for v in self.enum_values) # type: ignore + return f'value is not a valid enumeration member; permitted: {permitted}' + + +class IntegerError(PydanticTypeError): + msg_template = 'value is not a valid integer' + + +class FloatError(PydanticTypeError): + msg_template = 'value is not a valid float' + + +class PathError(PydanticTypeError): + msg_template = 'value is not a valid path' + + +class _PathValueError(PydanticValueError): + def __init__(self, *, path: Path) -> None: + super().__init__(path=str(path)) + + +class PathNotExistsError(_PathValueError): + code = 'path.not_exists' + msg_template = 'file or directory at path "{path}" does not exist' + + +class PathNotAFileError(_PathValueError): + code = 'path.not_a_file' + msg_template = 'path "{path}" does not point to a file' + + +class PathNotADirectoryError(_PathValueError): + code = 'path.not_a_directory' + msg_template = 'path "{path}" does not point to a directory' + + +class PyObjectError(PydanticTypeError): + msg_template = 'ensure this value contains valid import path or valid callable: {error_message}' + + +class SequenceError(PydanticTypeError): + msg_template = 'value is not a valid sequence' + + +class IterableError(PydanticTypeError): + msg_template = 'value is not a valid iterable' + + +class ListError(PydanticTypeError): + msg_template = 'value is not a valid list' + + +class SetError(PydanticTypeError): + msg_template = 'value is not a valid set' + + +class FrozenSetError(PydanticTypeError): + msg_template = 'value is not a valid frozenset' + + +class DequeError(PydanticTypeError): + msg_template = 'value is not a valid deque' + + +class TupleError(PydanticTypeError): + msg_template = 'value is not a valid tuple' + + +class TupleLengthError(PydanticValueError): + code = 'tuple.length' + msg_template = 'wrong tuple length {actual_length}, expected {expected_length}' + + def __init__(self, *, actual_length: int, expected_length: int) -> None: + super().__init__(actual_length=actual_length, expected_length=expected_length) + + +class ListMinLengthError(PydanticValueError): + code = 'list.min_items' + msg_template = 'ensure this value has at least {limit_value} items' + + def __init__(self, *, limit_value: int) -> None: + super().__init__(limit_value=limit_value) + + +class ListMaxLengthError(PydanticValueError): + code = 'list.max_items' + msg_template = 'ensure this value has at most {limit_value} items' + + def __init__(self, *, limit_value: int) -> None: + super().__init__(limit_value=limit_value) + + +class ListUniqueItemsError(PydanticValueError): + code = 'list.unique_items' + msg_template = 'the list has duplicated items' + + +class SetMinLengthError(PydanticValueError): + code = 'set.min_items' + msg_template = 'ensure this value has at least {limit_value} items' + + def __init__(self, *, limit_value: int) -> None: + super().__init__(limit_value=limit_value) + + +class SetMaxLengthError(PydanticValueError): + code = 'set.max_items' + msg_template = 'ensure this value has at most {limit_value} items' + + def __init__(self, *, limit_value: int) -> None: + super().__init__(limit_value=limit_value) + + +class FrozenSetMinLengthError(PydanticValueError): + code = 'frozenset.min_items' + msg_template = 'ensure this value has at least {limit_value} items' + + def __init__(self, *, limit_value: int) -> None: + super().__init__(limit_value=limit_value) + + +class FrozenSetMaxLengthError(PydanticValueError): + code = 'frozenset.max_items' + msg_template = 'ensure this value has at most {limit_value} items' + + def __init__(self, *, limit_value: int) -> None: + super().__init__(limit_value=limit_value) + + +class AnyStrMinLengthError(PydanticValueError): + code = 'any_str.min_length' + msg_template = 'ensure this value has at least {limit_value} characters' + + def __init__(self, *, limit_value: int) -> None: + super().__init__(limit_value=limit_value) + + +class AnyStrMaxLengthError(PydanticValueError): + code = 'any_str.max_length' + msg_template = 'ensure this value has at most {limit_value} characters' + + def __init__(self, *, limit_value: int) -> None: + super().__init__(limit_value=limit_value) + + +class StrError(PydanticTypeError): + msg_template = 'str type expected' + + +class StrRegexError(PydanticValueError): + code = 'str.regex' + msg_template = 'string does not match regex "{pattern}"' + + def __init__(self, *, pattern: str) -> None: + super().__init__(pattern=pattern) + + +class _NumberBoundError(PydanticValueError): + def __init__(self, *, limit_value: Union[int, float, Decimal]) -> None: + super().__init__(limit_value=limit_value) + + +class NumberNotGtError(_NumberBoundError): + code = 'number.not_gt' + msg_template = 'ensure this value is greater than {limit_value}' + + +class NumberNotGeError(_NumberBoundError): + code = 'number.not_ge' + msg_template = 'ensure this value is greater than or equal to {limit_value}' + + +class NumberNotLtError(_NumberBoundError): + code = 'number.not_lt' + msg_template = 'ensure this value is less than {limit_value}' + + +class NumberNotLeError(_NumberBoundError): + code = 'number.not_le' + msg_template = 'ensure this value is less than or equal to {limit_value}' + + +class NumberNotFiniteError(PydanticValueError): + code = 'number.not_finite_number' + msg_template = 'ensure this value is a finite number' + + +class NumberNotMultipleError(PydanticValueError): + code = 'number.not_multiple' + msg_template = 'ensure this value is a multiple of {multiple_of}' + + def __init__(self, *, multiple_of: Union[int, float, Decimal]) -> None: + super().__init__(multiple_of=multiple_of) + + +class DecimalError(PydanticTypeError): + msg_template = 'value is not a valid decimal' + + +class DecimalIsNotFiniteError(PydanticValueError): + code = 'decimal.not_finite' + msg_template = 'value is not a valid decimal' + + +class DecimalMaxDigitsError(PydanticValueError): + code = 'decimal.max_digits' + msg_template = 'ensure that there are no more than {max_digits} digits in total' + + def __init__(self, *, max_digits: int) -> None: + super().__init__(max_digits=max_digits) + + +class DecimalMaxPlacesError(PydanticValueError): + code = 'decimal.max_places' + msg_template = 'ensure that there are no more than {decimal_places} decimal places' + + def __init__(self, *, decimal_places: int) -> None: + super().__init__(decimal_places=decimal_places) + + +class DecimalWholeDigitsError(PydanticValueError): + code = 'decimal.whole_digits' + msg_template = 'ensure that there are no more than {whole_digits} digits before the decimal point' + + def __init__(self, *, whole_digits: int) -> None: + super().__init__(whole_digits=whole_digits) + + +class DateTimeError(PydanticValueError): + msg_template = 'invalid datetime format' + + +class DateError(PydanticValueError): + msg_template = 'invalid date format' + + +class DateNotInThePastError(PydanticValueError): + code = 'date.not_in_the_past' + msg_template = 'date is not in the past' + + +class DateNotInTheFutureError(PydanticValueError): + code = 'date.not_in_the_future' + msg_template = 'date is not in the future' + + +class TimeError(PydanticValueError): + msg_template = 'invalid time format' + + +class DurationError(PydanticValueError): + msg_template = 'invalid duration format' + + +class HashableError(PydanticTypeError): + msg_template = 'value is not a valid hashable' + + +class UUIDError(PydanticTypeError): + msg_template = 'value is not a valid uuid' + + +class UUIDVersionError(PydanticValueError): + code = 'uuid.version' + msg_template = 'uuid version {required_version} expected' + + def __init__(self, *, required_version: int) -> None: + super().__init__(required_version=required_version) + + +class ArbitraryTypeError(PydanticTypeError): + code = 'arbitrary_type' + msg_template = 'instance of {expected_arbitrary_type} expected' + + def __init__(self, *, expected_arbitrary_type: Type[Any]) -> None: + super().__init__(expected_arbitrary_type=display_as_type(expected_arbitrary_type)) + + +class ClassError(PydanticTypeError): + code = 'class' + msg_template = 'a class is expected' + + +class SubclassError(PydanticTypeError): + code = 'subclass' + msg_template = 'subclass of {expected_class} expected' + + def __init__(self, *, expected_class: Type[Any]) -> None: + super().__init__(expected_class=display_as_type(expected_class)) + + +class JsonError(PydanticValueError): + msg_template = 'Invalid JSON' + + +class JsonTypeError(PydanticTypeError): + code = 'json' + msg_template = 'JSON object must be str, bytes or bytearray' + + +class PatternError(PydanticValueError): + code = 'regex_pattern' + msg_template = 'Invalid regular expression' + + +class DataclassTypeError(PydanticTypeError): + code = 'dataclass' + msg_template = 'instance of {class_name}, tuple or dict expected' + + +class CallableError(PydanticTypeError): + msg_template = '{value} is not callable' + + +class EnumError(PydanticTypeError): + code = 'enum_instance' + msg_template = '{value} is not a valid Enum instance' + + +class IntEnumError(PydanticTypeError): + code = 'int_enum_instance' + msg_template = '{value} is not a valid IntEnum instance' + + +class IPvAnyAddressError(PydanticValueError): + msg_template = 'value is not a valid IPv4 or IPv6 address' + + +class IPvAnyInterfaceError(PydanticValueError): + msg_template = 'value is not a valid IPv4 or IPv6 interface' + + +class IPvAnyNetworkError(PydanticValueError): + msg_template = 'value is not a valid IPv4 or IPv6 network' + + +class IPv4AddressError(PydanticValueError): + msg_template = 'value is not a valid IPv4 address' + + +class IPv6AddressError(PydanticValueError): + msg_template = 'value is not a valid IPv6 address' + + +class IPv4NetworkError(PydanticValueError): + msg_template = 'value is not a valid IPv4 network' + + +class IPv6NetworkError(PydanticValueError): + msg_template = 'value is not a valid IPv6 network' + + +class IPv4InterfaceError(PydanticValueError): + msg_template = 'value is not a valid IPv4 interface' + + +class IPv6InterfaceError(PydanticValueError): + msg_template = 'value is not a valid IPv6 interface' + + +class ColorError(PydanticValueError): + msg_template = 'value is not a valid color: {reason}' + + +class StrictBoolError(PydanticValueError): + msg_template = 'value is not a valid boolean' + + +class NotDigitError(PydanticValueError): + code = 'payment_card_number.digits' + msg_template = 'card number is not all digits' + + +class LuhnValidationError(PydanticValueError): + code = 'payment_card_number.luhn_check' + msg_template = 'card number is not luhn valid' + + +class InvalidLengthForBrand(PydanticValueError): + code = 'payment_card_number.invalid_length_for_brand' + msg_template = 'Length for a {brand} card must be {required_length}' + + +class InvalidByteSize(PydanticValueError): + msg_template = 'could not parse value and unit from byte string' + + +class InvalidByteSizeUnit(PydanticValueError): + msg_template = 'could not interpret byte unit: {unit}' + + +class MissingDiscriminator(PydanticValueError): + code = 'discriminated_union.missing_discriminator' + msg_template = 'Discriminator {discriminator_key!r} is missing in value' + + +class InvalidDiscriminator(PydanticValueError): + code = 'discriminated_union.invalid_discriminator' + msg_template = ( + 'No match for discriminator {discriminator_key!r} and value {discriminator_value!r} ' + '(allowed values: {allowed_values})' + ) + + def __init__(self, *, discriminator_key: str, discriminator_value: Any, allowed_values: Sequence[Any]) -> None: + super().__init__( + discriminator_key=discriminator_key, + discriminator_value=discriminator_value, + allowed_values=', '.join(map(repr, allowed_values)), + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/fields.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/fields.py new file mode 100644 index 0000000000000000000000000000000000000000..002b60cde1bf28bbbf20af824638503d598fbc60 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/fields.py @@ -0,0 +1,1253 @@ +import copy +import re +from collections import Counter as CollectionCounter, defaultdict, deque +from collections.abc import Callable, Hashable as CollectionsHashable, Iterable as CollectionsIterable +from typing import ( + TYPE_CHECKING, + Any, + Counter, + DefaultDict, + Deque, + Dict, + ForwardRef, + FrozenSet, + Generator, + Iterable, + Iterator, + List, + Mapping, + Optional, + Pattern, + Sequence, + Set, + Tuple, + Type, + TypeVar, + Union, +) + +from typing_extensions import Annotated, Final + +from pydantic.v1 import errors as errors_ +from pydantic.v1.class_validators import Validator, make_generic_validator, prep_validators +from pydantic.v1.error_wrappers import ErrorWrapper +from pydantic.v1.errors import ConfigError, InvalidDiscriminator, MissingDiscriminator, NoneIsNotAllowedError +from pydantic.v1.types import Json, JsonWrapper +from pydantic.v1.typing import ( + NoArgAnyCallable, + convert_generics, + display_as_type, + get_args, + get_origin, + is_finalvar, + is_literal_type, + is_new_type, + is_none_type, + is_typeddict, + is_typeddict_special, + is_union, + new_type_supertype, +) +from pydantic.v1.utils import ( + PyObjectStr, + Representation, + ValueItems, + get_discriminator_alias_and_values, + get_unique_discriminator_alias, + lenient_isinstance, + lenient_issubclass, + sequence_like, + smart_deepcopy, +) +from pydantic.v1.validators import constant_validator, dict_validator, find_validators, validate_json + +Required: Any = Ellipsis + +T = TypeVar('T') + + +class UndefinedType: + def __repr__(self) -> str: + return 'PydanticUndefined' + + def __copy__(self: T) -> T: + return self + + def __reduce__(self) -> str: + return 'Undefined' + + def __deepcopy__(self: T, _: Any) -> T: + return self + + +Undefined = UndefinedType() + +if TYPE_CHECKING: + from pydantic.v1.class_validators import ValidatorsList + from pydantic.v1.config import BaseConfig + from pydantic.v1.error_wrappers import ErrorList + from pydantic.v1.types import ModelOrDc + from pydantic.v1.typing import AbstractSetIntStr, MappingIntStrAny, ReprArgs + + ValidateReturn = Tuple[Optional[Any], Optional[ErrorList]] + LocStr = Union[Tuple[Union[int, str], ...], str] + BoolUndefined = Union[bool, UndefinedType] + + +class FieldInfo(Representation): + """ + Captures extra information about a field. + """ + + __slots__ = ( + 'default', + 'default_factory', + 'alias', + 'alias_priority', + 'title', + 'description', + 'exclude', + 'include', + 'const', + 'gt', + 'ge', + 'lt', + 'le', + 'multiple_of', + 'allow_inf_nan', + 'max_digits', + 'decimal_places', + 'min_items', + 'max_items', + 'unique_items', + 'min_length', + 'max_length', + 'allow_mutation', + 'repr', + 'regex', + 'discriminator', + 'extra', + ) + + # field constraints with the default value, it's also used in update_from_config below + __field_constraints__ = { + 'min_length': None, + 'max_length': None, + 'regex': None, + 'gt': None, + 'lt': None, + 'ge': None, + 'le': None, + 'multiple_of': None, + 'allow_inf_nan': None, + 'max_digits': None, + 'decimal_places': None, + 'min_items': None, + 'max_items': None, + 'unique_items': None, + 'allow_mutation': True, + } + + def __init__(self, default: Any = Undefined, **kwargs: Any) -> None: + self.default = default + self.default_factory = kwargs.pop('default_factory', None) + self.alias = kwargs.pop('alias', None) + self.alias_priority = kwargs.pop('alias_priority', 2 if self.alias is not None else None) + self.title = kwargs.pop('title', None) + self.description = kwargs.pop('description', None) + self.exclude = kwargs.pop('exclude', None) + self.include = kwargs.pop('include', None) + self.const = kwargs.pop('const', None) + self.gt = kwargs.pop('gt', None) + self.ge = kwargs.pop('ge', None) + self.lt = kwargs.pop('lt', None) + self.le = kwargs.pop('le', None) + self.multiple_of = kwargs.pop('multiple_of', None) + self.allow_inf_nan = kwargs.pop('allow_inf_nan', None) + self.max_digits = kwargs.pop('max_digits', None) + self.decimal_places = kwargs.pop('decimal_places', None) + self.min_items = kwargs.pop('min_items', None) + self.max_items = kwargs.pop('max_items', None) + self.unique_items = kwargs.pop('unique_items', None) + self.min_length = kwargs.pop('min_length', None) + self.max_length = kwargs.pop('max_length', None) + self.allow_mutation = kwargs.pop('allow_mutation', True) + self.regex = kwargs.pop('regex', None) + self.discriminator = kwargs.pop('discriminator', None) + self.repr = kwargs.pop('repr', True) + self.extra = kwargs + + def __repr_args__(self) -> 'ReprArgs': + field_defaults_to_hide: Dict[str, Any] = { + 'repr': True, + **self.__field_constraints__, + } + + attrs = ((s, getattr(self, s)) for s in self.__slots__) + return [(a, v) for a, v in attrs if v != field_defaults_to_hide.get(a, None)] + + def get_constraints(self) -> Set[str]: + """ + Gets the constraints set on the field by comparing the constraint value with its default value + + :return: the constraints set on field_info + """ + return {attr for attr, default in self.__field_constraints__.items() if getattr(self, attr) != default} + + def update_from_config(self, from_config: Dict[str, Any]) -> None: + """ + Update this FieldInfo based on a dict from get_field_info, only fields which have not been set are dated. + """ + for attr_name, value in from_config.items(): + try: + current_value = getattr(self, attr_name) + except AttributeError: + # attr_name is not an attribute of FieldInfo, it should therefore be added to extra + # (except if extra already has this value!) + self.extra.setdefault(attr_name, value) + else: + if current_value is self.__field_constraints__.get(attr_name, None): + setattr(self, attr_name, value) + elif attr_name == 'exclude': + self.exclude = ValueItems.merge(value, current_value) + elif attr_name == 'include': + self.include = ValueItems.merge(value, current_value, intersect=True) + + def _validate(self) -> None: + if self.default is not Undefined and self.default_factory is not None: + raise ValueError('cannot specify both default and default_factory') + + +def Field( + default: Any = Undefined, + *, + default_factory: Optional[NoArgAnyCallable] = None, + alias: Optional[str] = None, + title: Optional[str] = None, + description: Optional[str] = None, + exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny', Any]] = None, + include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny', Any]] = None, + const: Optional[bool] = None, + gt: Optional[float] = None, + ge: Optional[float] = None, + lt: Optional[float] = None, + le: Optional[float] = None, + multiple_of: Optional[float] = None, + allow_inf_nan: Optional[bool] = None, + max_digits: Optional[int] = None, + decimal_places: Optional[int] = None, + min_items: Optional[int] = None, + max_items: Optional[int] = None, + unique_items: Optional[bool] = None, + min_length: Optional[int] = None, + max_length: Optional[int] = None, + allow_mutation: bool = True, + regex: Optional[str] = None, + discriminator: Optional[str] = None, + repr: bool = True, + **extra: Any, +) -> Any: + """ + Used to provide extra information about a field, either for the model schema or complex validation. Some arguments + apply only to number fields (``int``, ``float``, ``Decimal``) and some apply only to ``str``. + + :param default: since this is replacing the field’s default, its first argument is used + to set the default, use ellipsis (``...``) to indicate the field is required + :param default_factory: callable that will be called when a default value is needed for this field + If both `default` and `default_factory` are set, an error is raised. + :param alias: the public name of the field + :param title: can be any string, used in the schema + :param description: can be any string, used in the schema + :param exclude: exclude this field while dumping. + Takes same values as the ``include`` and ``exclude`` arguments on the ``.dict`` method. + :param include: include this field while dumping. + Takes same values as the ``include`` and ``exclude`` arguments on the ``.dict`` method. + :param const: this field is required and *must* take it's default value + :param gt: only applies to numbers, requires the field to be "greater than". The schema + will have an ``exclusiveMinimum`` validation keyword + :param ge: only applies to numbers, requires the field to be "greater than or equal to". The + schema will have a ``minimum`` validation keyword + :param lt: only applies to numbers, requires the field to be "less than". The schema + will have an ``exclusiveMaximum`` validation keyword + :param le: only applies to numbers, requires the field to be "less than or equal to". The + schema will have a ``maximum`` validation keyword + :param multiple_of: only applies to numbers, requires the field to be "a multiple of". The + schema will have a ``multipleOf`` validation keyword + :param allow_inf_nan: only applies to numbers, allows the field to be NaN or infinity (+inf or -inf), + which is a valid Python float. Default True, set to False for compatibility with JSON. + :param max_digits: only applies to Decimals, requires the field to have a maximum number + of digits within the decimal. It does not include a zero before the decimal point or trailing decimal zeroes. + :param decimal_places: only applies to Decimals, requires the field to have at most a number of decimal places + allowed. It does not include trailing decimal zeroes. + :param min_items: only applies to lists, requires the field to have a minimum number of + elements. The schema will have a ``minItems`` validation keyword + :param max_items: only applies to lists, requires the field to have a maximum number of + elements. The schema will have a ``maxItems`` validation keyword + :param unique_items: only applies to lists, requires the field not to have duplicated + elements. The schema will have a ``uniqueItems`` validation keyword + :param min_length: only applies to strings, requires the field to have a minimum length. The + schema will have a ``minLength`` validation keyword + :param max_length: only applies to strings, requires the field to have a maximum length. The + schema will have a ``maxLength`` validation keyword + :param allow_mutation: a boolean which defaults to True. When False, the field raises a TypeError if the field is + assigned on an instance. The BaseModel Config must set validate_assignment to True + :param regex: only applies to strings, requires the field match against a regular expression + pattern string. The schema will have a ``pattern`` validation keyword + :param discriminator: only useful with a (discriminated a.k.a. tagged) `Union` of sub models with a common field. + The `discriminator` is the name of this common field to shorten validation and improve generated schema + :param repr: show this field in the representation + :param **extra: any additional keyword arguments will be added as is to the schema + """ + field_info = FieldInfo( + default, + default_factory=default_factory, + alias=alias, + title=title, + description=description, + exclude=exclude, + include=include, + const=const, + gt=gt, + ge=ge, + lt=lt, + le=le, + multiple_of=multiple_of, + allow_inf_nan=allow_inf_nan, + max_digits=max_digits, + decimal_places=decimal_places, + min_items=min_items, + max_items=max_items, + unique_items=unique_items, + min_length=min_length, + max_length=max_length, + allow_mutation=allow_mutation, + regex=regex, + discriminator=discriminator, + repr=repr, + **extra, + ) + field_info._validate() + return field_info + + +# used to be an enum but changed to int's for small performance improvement as less access overhead +SHAPE_SINGLETON = 1 +SHAPE_LIST = 2 +SHAPE_SET = 3 +SHAPE_MAPPING = 4 +SHAPE_TUPLE = 5 +SHAPE_TUPLE_ELLIPSIS = 6 +SHAPE_SEQUENCE = 7 +SHAPE_FROZENSET = 8 +SHAPE_ITERABLE = 9 +SHAPE_GENERIC = 10 +SHAPE_DEQUE = 11 +SHAPE_DICT = 12 +SHAPE_DEFAULTDICT = 13 +SHAPE_COUNTER = 14 +SHAPE_NAME_LOOKUP = { + SHAPE_LIST: 'List[{}]', + SHAPE_SET: 'Set[{}]', + SHAPE_TUPLE_ELLIPSIS: 'Tuple[{}, ...]', + SHAPE_SEQUENCE: 'Sequence[{}]', + SHAPE_FROZENSET: 'FrozenSet[{}]', + SHAPE_ITERABLE: 'Iterable[{}]', + SHAPE_DEQUE: 'Deque[{}]', + SHAPE_DICT: 'Dict[{}]', + SHAPE_DEFAULTDICT: 'DefaultDict[{}]', + SHAPE_COUNTER: 'Counter[{}]', +} + +MAPPING_LIKE_SHAPES: Set[int] = {SHAPE_DEFAULTDICT, SHAPE_DICT, SHAPE_MAPPING, SHAPE_COUNTER} + + +class ModelField(Representation): + __slots__ = ( + 'type_', + 'outer_type_', + 'annotation', + 'sub_fields', + 'sub_fields_mapping', + 'key_field', + 'validators', + 'pre_validators', + 'post_validators', + 'default', + 'default_factory', + 'required', + 'final', + 'model_config', + 'name', + 'alias', + 'has_alias', + 'field_info', + 'discriminator_key', + 'discriminator_alias', + 'validate_always', + 'allow_none', + 'shape', + 'class_validators', + 'parse_json', + ) + + def __init__( + self, + *, + name: str, + type_: Type[Any], + class_validators: Optional[Dict[str, Validator]], + model_config: Type['BaseConfig'], + default: Any = None, + default_factory: Optional[NoArgAnyCallable] = None, + required: 'BoolUndefined' = Undefined, + final: bool = False, + alias: Optional[str] = None, + field_info: Optional[FieldInfo] = None, + ) -> None: + self.name: str = name + self.has_alias: bool = alias is not None + self.alias: str = alias if alias is not None else name + self.annotation = type_ + self.type_: Any = convert_generics(type_) + self.outer_type_: Any = type_ + self.class_validators = class_validators or {} + self.default: Any = default + self.default_factory: Optional[NoArgAnyCallable] = default_factory + self.required: 'BoolUndefined' = required + self.final: bool = final + self.model_config = model_config + self.field_info: FieldInfo = field_info or FieldInfo(default) + self.discriminator_key: Optional[str] = self.field_info.discriminator + self.discriminator_alias: Optional[str] = self.discriminator_key + + self.allow_none: bool = False + self.validate_always: bool = False + self.sub_fields: Optional[List[ModelField]] = None + self.sub_fields_mapping: Optional[Dict[str, 'ModelField']] = None # used for discriminated union + self.key_field: Optional[ModelField] = None + self.validators: 'ValidatorsList' = [] + self.pre_validators: Optional['ValidatorsList'] = None + self.post_validators: Optional['ValidatorsList'] = None + self.parse_json: bool = False + self.shape: int = SHAPE_SINGLETON + self.model_config.prepare_field(self) + self.prepare() + + def get_default(self) -> Any: + return smart_deepcopy(self.default) if self.default_factory is None else self.default_factory() + + @staticmethod + def _get_field_info( + field_name: str, annotation: Any, value: Any, config: Type['BaseConfig'] + ) -> Tuple[FieldInfo, Any]: + """ + Get a FieldInfo from a root typing.Annotated annotation, value, or config default. + + The FieldInfo may be set in typing.Annotated or the value, but not both. If neither contain + a FieldInfo, a new one will be created using the config. + + :param field_name: name of the field for use in error messages + :param annotation: a type hint such as `str` or `Annotated[str, Field(..., min_length=5)]` + :param value: the field's assigned value + :param config: the model's config object + :return: the FieldInfo contained in the `annotation`, the value, or a new one from the config. + """ + field_info_from_config = config.get_field_info(field_name) + + field_info = None + if get_origin(annotation) is Annotated: + field_infos = [arg for arg in get_args(annotation)[1:] if isinstance(arg, FieldInfo)] + if len(field_infos) > 1: + raise ValueError(f'cannot specify multiple `Annotated` `Field`s for {field_name!r}') + field_info = next(iter(field_infos), None) + if field_info is not None: + field_info = copy.copy(field_info) + field_info.update_from_config(field_info_from_config) + if field_info.default not in (Undefined, Required): + raise ValueError(f'`Field` default cannot be set in `Annotated` for {field_name!r}') + if value is not Undefined and value is not Required: + # check also `Required` because of `validate_arguments` that sets `...` as default value + field_info.default = value + + if isinstance(value, FieldInfo): + if field_info is not None: + raise ValueError(f'cannot specify `Annotated` and value `Field`s together for {field_name!r}') + field_info = value + field_info.update_from_config(field_info_from_config) + elif field_info is None: + field_info = FieldInfo(value, **field_info_from_config) + value = None if field_info.default_factory is not None else field_info.default + field_info._validate() + return field_info, value + + @classmethod + def infer( + cls, + *, + name: str, + value: Any, + annotation: Any, + class_validators: Optional[Dict[str, Validator]], + config: Type['BaseConfig'], + ) -> 'ModelField': + from pydantic.v1.schema import get_annotation_from_field_info + + field_info, value = cls._get_field_info(name, annotation, value, config) + required: 'BoolUndefined' = Undefined + if value is Required: + required = True + value = None + elif value is not Undefined: + required = False + annotation = get_annotation_from_field_info(annotation, field_info, name, config.validate_assignment) + + return cls( + name=name, + type_=annotation, + alias=field_info.alias, + class_validators=class_validators, + default=value, + default_factory=field_info.default_factory, + required=required, + model_config=config, + field_info=field_info, + ) + + def set_config(self, config: Type['BaseConfig']) -> None: + self.model_config = config + info_from_config = config.get_field_info(self.name) + config.prepare_field(self) + new_alias = info_from_config.get('alias') + new_alias_priority = info_from_config.get('alias_priority') or 0 + if new_alias and new_alias_priority >= (self.field_info.alias_priority or 0): + self.field_info.alias = new_alias + self.field_info.alias_priority = new_alias_priority + self.alias = new_alias + new_exclude = info_from_config.get('exclude') + if new_exclude is not None: + self.field_info.exclude = ValueItems.merge(self.field_info.exclude, new_exclude) + new_include = info_from_config.get('include') + if new_include is not None: + self.field_info.include = ValueItems.merge(self.field_info.include, new_include, intersect=True) + + @property + def alt_alias(self) -> bool: + return self.name != self.alias + + def prepare(self) -> None: + """ + Prepare the field but inspecting self.default, self.type_ etc. + + Note: this method is **not** idempotent (because _type_analysis is not idempotent), + e.g. calling it it multiple times may modify the field and configure it incorrectly. + """ + self._set_default_and_type() + if self.type_.__class__ is ForwardRef or self.type_.__class__ is DeferredType: + # self.type_ is currently a ForwardRef and there's nothing we can do now, + # user will need to call model.update_forward_refs() + return + + self._type_analysis() + if self.required is Undefined: + self.required = True + if self.default is Undefined and self.default_factory is None: + self.default = None + self.populate_validators() + + def _set_default_and_type(self) -> None: + """ + Set the default value, infer the type if needed and check if `None` value is valid. + """ + if self.default_factory is not None: + if self.type_ is Undefined: + raise errors_.ConfigError( + f'you need to set the type of field {self.name!r} when using `default_factory`' + ) + return + + default_value = self.get_default() + + if default_value is not None and self.type_ is Undefined: + self.type_ = default_value.__class__ + self.outer_type_ = self.type_ + self.annotation = self.type_ + + if self.type_ is Undefined: + raise errors_.ConfigError(f'unable to infer type for attribute "{self.name}"') + + if self.required is False and default_value is None: + self.allow_none = True + + def _type_analysis(self) -> None: # noqa: C901 (ignore complexity) + # typing interface is horrible, we have to do some ugly checks + if lenient_issubclass(self.type_, JsonWrapper): + self.type_ = self.type_.inner_type + self.parse_json = True + elif lenient_issubclass(self.type_, Json): + self.type_ = Any + self.parse_json = True + elif isinstance(self.type_, TypeVar): + if self.type_.__bound__: + self.type_ = self.type_.__bound__ + elif self.type_.__constraints__: + self.type_ = Union[self.type_.__constraints__] + else: + self.type_ = Any + elif is_new_type(self.type_): + self.type_ = new_type_supertype(self.type_) + + if self.type_ is Any or self.type_ is object: + if self.required is Undefined: + self.required = False + self.allow_none = True + return + elif self.type_ is Pattern or self.type_ is re.Pattern: + # python 3.7 only, Pattern is a typing object but without sub fields + return + elif is_literal_type(self.type_): + return + elif is_typeddict(self.type_): + return + + if is_finalvar(self.type_): + self.final = True + + if self.type_ is Final: + self.type_ = Any + else: + self.type_ = get_args(self.type_)[0] + + self._type_analysis() + return + + origin = get_origin(self.type_) + + if origin is Annotated or is_typeddict_special(origin): + self.type_ = get_args(self.type_)[0] + self._type_analysis() + return + + if self.discriminator_key is not None and not is_union(origin): + raise TypeError('`discriminator` can only be used with `Union` type with more than one variant') + + # add extra check for `collections.abc.Hashable` for python 3.10+ where origin is not `None` + if origin is None or origin is CollectionsHashable: + # field is not "typing" object eg. Union, Dict, List etc. + # allow None for virtual superclasses of NoneType, e.g. Hashable + if isinstance(self.type_, type) and isinstance(None, self.type_): + self.allow_none = True + return + elif origin is Callable: + return + elif is_union(origin): + types_ = [] + for type_ in get_args(self.type_): + if is_none_type(type_) or type_ is Any or type_ is object: + if self.required is Undefined: + self.required = False + self.allow_none = True + if is_none_type(type_): + continue + types_.append(type_) + + if len(types_) == 1: + # Optional[] + self.type_ = types_[0] + # this is the one case where the "outer type" isn't just the original type + self.outer_type_ = self.type_ + # re-run to correctly interpret the new self.type_ + self._type_analysis() + else: + self.sub_fields = [self._create_sub_type(t, f'{self.name}_{display_as_type(t)}') for t in types_] + + if self.discriminator_key is not None: + self.prepare_discriminated_union_sub_fields() + return + elif issubclass(origin, Tuple): # type: ignore + # origin == Tuple without item type + args = get_args(self.type_) + if not args: # plain tuple + self.type_ = Any + self.shape = SHAPE_TUPLE_ELLIPSIS + elif len(args) == 2 and args[1] is Ellipsis: # e.g. Tuple[int, ...] + self.type_ = args[0] + self.shape = SHAPE_TUPLE_ELLIPSIS + self.sub_fields = [self._create_sub_type(args[0], f'{self.name}_0')] + elif args == ((),): # Tuple[()] means empty tuple + self.shape = SHAPE_TUPLE + self.type_ = Any + self.sub_fields = [] + else: + self.shape = SHAPE_TUPLE + self.sub_fields = [self._create_sub_type(t, f'{self.name}_{i}') for i, t in enumerate(args)] + return + elif issubclass(origin, List): + # Create self validators + get_validators = getattr(self.type_, '__get_validators__', None) + if get_validators: + self.class_validators.update( + {f'list_{i}': Validator(validator, pre=True) for i, validator in enumerate(get_validators())} + ) + + self.type_ = get_args(self.type_)[0] + self.shape = SHAPE_LIST + elif issubclass(origin, Set): + # Create self validators + get_validators = getattr(self.type_, '__get_validators__', None) + if get_validators: + self.class_validators.update( + {f'set_{i}': Validator(validator, pre=True) for i, validator in enumerate(get_validators())} + ) + + self.type_ = get_args(self.type_)[0] + self.shape = SHAPE_SET + elif issubclass(origin, FrozenSet): + # Create self validators + get_validators = getattr(self.type_, '__get_validators__', None) + if get_validators: + self.class_validators.update( + {f'frozenset_{i}': Validator(validator, pre=True) for i, validator in enumerate(get_validators())} + ) + + self.type_ = get_args(self.type_)[0] + self.shape = SHAPE_FROZENSET + elif issubclass(origin, Deque): + self.type_ = get_args(self.type_)[0] + self.shape = SHAPE_DEQUE + elif issubclass(origin, Sequence): + self.type_ = get_args(self.type_)[0] + self.shape = SHAPE_SEQUENCE + # priority to most common mapping: dict + elif origin is dict or origin is Dict: + self.key_field = self._create_sub_type(get_args(self.type_)[0], 'key_' + self.name, for_keys=True) + self.type_ = get_args(self.type_)[1] + self.shape = SHAPE_DICT + elif issubclass(origin, DefaultDict): + self.key_field = self._create_sub_type(get_args(self.type_)[0], 'key_' + self.name, for_keys=True) + self.type_ = get_args(self.type_)[1] + self.shape = SHAPE_DEFAULTDICT + elif issubclass(origin, Counter): + self.key_field = self._create_sub_type(get_args(self.type_)[0], 'key_' + self.name, for_keys=True) + self.type_ = int + self.shape = SHAPE_COUNTER + elif issubclass(origin, Mapping): + self.key_field = self._create_sub_type(get_args(self.type_)[0], 'key_' + self.name, for_keys=True) + self.type_ = get_args(self.type_)[1] + self.shape = SHAPE_MAPPING + # Equality check as almost everything inherits form Iterable, including str + # check for Iterable and CollectionsIterable, as it could receive one even when declared with the other + elif origin in {Iterable, CollectionsIterable}: + self.type_ = get_args(self.type_)[0] + self.shape = SHAPE_ITERABLE + self.sub_fields = [self._create_sub_type(self.type_, f'{self.name}_type')] + elif issubclass(origin, Type): # type: ignore + return + elif hasattr(origin, '__get_validators__') or self.model_config.arbitrary_types_allowed: + # Is a Pydantic-compatible generic that handles itself + # or we have arbitrary_types_allowed = True + self.shape = SHAPE_GENERIC + self.sub_fields = [self._create_sub_type(t, f'{self.name}_{i}') for i, t in enumerate(get_args(self.type_))] + self.type_ = origin + return + else: + raise TypeError(f'Fields of type "{origin}" are not supported.') + + # type_ has been refined eg. as the type of a List and sub_fields needs to be populated + self.sub_fields = [self._create_sub_type(self.type_, '_' + self.name)] + + def prepare_discriminated_union_sub_fields(self) -> None: + """ + Prepare the mapping -> and update `sub_fields` + Note that this process can be aborted if a `ForwardRef` is encountered + """ + assert self.discriminator_key is not None + + if self.type_.__class__ is DeferredType: + return + + assert self.sub_fields is not None + sub_fields_mapping: Dict[str, 'ModelField'] = {} + all_aliases: Set[str] = set() + + for sub_field in self.sub_fields: + t = sub_field.type_ + if t.__class__ is ForwardRef: + # Stopping everything...will need to call `update_forward_refs` + return + + alias, discriminator_values = get_discriminator_alias_and_values(t, self.discriminator_key) + all_aliases.add(alias) + for discriminator_value in discriminator_values: + sub_fields_mapping[discriminator_value] = sub_field + + self.sub_fields_mapping = sub_fields_mapping + self.discriminator_alias = get_unique_discriminator_alias(all_aliases, self.discriminator_key) + + def _create_sub_type(self, type_: Type[Any], name: str, *, for_keys: bool = False) -> 'ModelField': + if for_keys: + class_validators = None + else: + # validators for sub items should not have `each_item` as we want to check only the first sublevel + class_validators = { + k: Validator( + func=v.func, + pre=v.pre, + each_item=False, + always=v.always, + check_fields=v.check_fields, + skip_on_failure=v.skip_on_failure, + ) + for k, v in self.class_validators.items() + if v.each_item + } + + field_info, _ = self._get_field_info(name, type_, None, self.model_config) + + return self.__class__( + type_=type_, + name=name, + class_validators=class_validators, + model_config=self.model_config, + field_info=field_info, + ) + + def populate_validators(self) -> None: + """ + Prepare self.pre_validators, self.validators, and self.post_validators based on self.type_'s __get_validators__ + and class validators. This method should be idempotent, e.g. it should be safe to call multiple times + without mis-configuring the field. + """ + self.validate_always = getattr(self.type_, 'validate_always', False) or any( + v.always for v in self.class_validators.values() + ) + + class_validators_ = self.class_validators.values() + if not self.sub_fields or self.shape == SHAPE_GENERIC: + get_validators = getattr(self.type_, '__get_validators__', None) + v_funcs = ( + *[v.func for v in class_validators_ if v.each_item and v.pre], + *(get_validators() if get_validators else list(find_validators(self.type_, self.model_config))), + *[v.func for v in class_validators_ if v.each_item and not v.pre], + ) + self.validators = prep_validators(v_funcs) + + self.pre_validators = [] + self.post_validators = [] + + if self.field_info and self.field_info.const: + self.post_validators.append(make_generic_validator(constant_validator)) + + if class_validators_: + self.pre_validators += prep_validators(v.func for v in class_validators_ if not v.each_item and v.pre) + self.post_validators += prep_validators(v.func for v in class_validators_ if not v.each_item and not v.pre) + + if self.parse_json: + self.pre_validators.append(make_generic_validator(validate_json)) + + self.pre_validators = self.pre_validators or None + self.post_validators = self.post_validators or None + + def validate( + self, v: Any, values: Dict[str, Any], *, loc: 'LocStr', cls: Optional['ModelOrDc'] = None + ) -> 'ValidateReturn': + assert self.type_.__class__ is not DeferredType + + if self.type_.__class__ is ForwardRef: + assert cls is not None + raise ConfigError( + f'field "{self.name}" not yet prepared so type is still a ForwardRef, ' + f'you might need to call {cls.__name__}.update_forward_refs().' + ) + + errors: Optional['ErrorList'] + if self.pre_validators: + v, errors = self._apply_validators(v, values, loc, cls, self.pre_validators) + if errors: + return v, errors + + if v is None: + if is_none_type(self.type_): + # keep validating + pass + elif self.allow_none: + if self.post_validators: + return self._apply_validators(v, values, loc, cls, self.post_validators) + else: + return None, None + else: + return v, ErrorWrapper(NoneIsNotAllowedError(), loc) + + if self.shape == SHAPE_SINGLETON: + v, errors = self._validate_singleton(v, values, loc, cls) + elif self.shape in MAPPING_LIKE_SHAPES: + v, errors = self._validate_mapping_like(v, values, loc, cls) + elif self.shape == SHAPE_TUPLE: + v, errors = self._validate_tuple(v, values, loc, cls) + elif self.shape == SHAPE_ITERABLE: + v, errors = self._validate_iterable(v, values, loc, cls) + elif self.shape == SHAPE_GENERIC: + v, errors = self._apply_validators(v, values, loc, cls, self.validators) + else: + # sequence, list, set, generator, tuple with ellipsis, frozen set + v, errors = self._validate_sequence_like(v, values, loc, cls) + + if not errors and self.post_validators: + v, errors = self._apply_validators(v, values, loc, cls, self.post_validators) + return v, errors + + def _validate_sequence_like( # noqa: C901 (ignore complexity) + self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc'] + ) -> 'ValidateReturn': + """ + Validate sequence-like containers: lists, tuples, sets and generators + Note that large if-else blocks are necessary to enable Cython + optimization, which is why we disable the complexity check above. + """ + if not sequence_like(v): + e: errors_.PydanticTypeError + if self.shape == SHAPE_LIST: + e = errors_.ListError() + elif self.shape in (SHAPE_TUPLE, SHAPE_TUPLE_ELLIPSIS): + e = errors_.TupleError() + elif self.shape == SHAPE_SET: + e = errors_.SetError() + elif self.shape == SHAPE_FROZENSET: + e = errors_.FrozenSetError() + else: + e = errors_.SequenceError() + return v, ErrorWrapper(e, loc) + + loc = loc if isinstance(loc, tuple) else (loc,) + result = [] + errors: List[ErrorList] = [] + for i, v_ in enumerate(v): + v_loc = *loc, i + r, ee = self._validate_singleton(v_, values, v_loc, cls) + if ee: + errors.append(ee) + else: + result.append(r) + + if errors: + return v, errors + + converted: Union[List[Any], Set[Any], FrozenSet[Any], Tuple[Any, ...], Iterator[Any], Deque[Any]] = result + + if self.shape == SHAPE_SET: + converted = set(result) + elif self.shape == SHAPE_FROZENSET: + converted = frozenset(result) + elif self.shape == SHAPE_TUPLE_ELLIPSIS: + converted = tuple(result) + elif self.shape == SHAPE_DEQUE: + converted = deque(result, maxlen=getattr(v, 'maxlen', None)) + elif self.shape == SHAPE_SEQUENCE: + if isinstance(v, tuple): + converted = tuple(result) + elif isinstance(v, set): + converted = set(result) + elif isinstance(v, Generator): + converted = iter(result) + elif isinstance(v, deque): + converted = deque(result, maxlen=getattr(v, 'maxlen', None)) + return converted, None + + def _validate_iterable( + self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc'] + ) -> 'ValidateReturn': + """ + Validate Iterables. + + This intentionally doesn't validate values to allow infinite generators. + """ + + try: + iterable = iter(v) + except TypeError: + return v, ErrorWrapper(errors_.IterableError(), loc) + return iterable, None + + def _validate_tuple( + self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc'] + ) -> 'ValidateReturn': + e: Optional[Exception] = None + if not sequence_like(v): + e = errors_.TupleError() + else: + actual_length, expected_length = len(v), len(self.sub_fields) # type: ignore + if actual_length != expected_length: + e = errors_.TupleLengthError(actual_length=actual_length, expected_length=expected_length) + + if e: + return v, ErrorWrapper(e, loc) + + loc = loc if isinstance(loc, tuple) else (loc,) + result = [] + errors: List[ErrorList] = [] + for i, (v_, field) in enumerate(zip(v, self.sub_fields)): # type: ignore + v_loc = *loc, i + r, ee = field.validate(v_, values, loc=v_loc, cls=cls) + if ee: + errors.append(ee) + else: + result.append(r) + + if errors: + return v, errors + else: + return tuple(result), None + + def _validate_mapping_like( + self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc'] + ) -> 'ValidateReturn': + try: + v_iter = dict_validator(v) + except TypeError as exc: + return v, ErrorWrapper(exc, loc) + + loc = loc if isinstance(loc, tuple) else (loc,) + result, errors = {}, [] + for k, v_ in v_iter.items(): + v_loc = *loc, '__key__' + key_result, key_errors = self.key_field.validate(k, values, loc=v_loc, cls=cls) # type: ignore + if key_errors: + errors.append(key_errors) + continue + + v_loc = *loc, k + value_result, value_errors = self._validate_singleton(v_, values, v_loc, cls) + if value_errors: + errors.append(value_errors) + continue + + result[key_result] = value_result + if errors: + return v, errors + elif self.shape == SHAPE_DICT: + return result, None + elif self.shape == SHAPE_DEFAULTDICT: + return defaultdict(self.type_, result), None + elif self.shape == SHAPE_COUNTER: + return CollectionCounter(result), None + else: + return self._get_mapping_value(v, result), None + + def _get_mapping_value(self, original: T, converted: Dict[Any, Any]) -> Union[T, Dict[Any, Any]]: + """ + When type is `Mapping[KT, KV]` (or another unsupported mapping), we try to avoid + coercing to `dict` unwillingly. + """ + original_cls = original.__class__ + + if original_cls == dict or original_cls == Dict: + return converted + elif original_cls in {defaultdict, DefaultDict}: + return defaultdict(self.type_, converted) + else: + try: + # Counter, OrderedDict, UserDict, ... + return original_cls(converted) # type: ignore + except TypeError: + raise RuntimeError(f'Could not convert dictionary to {original_cls.__name__!r}') from None + + def _validate_singleton( + self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc'] + ) -> 'ValidateReturn': + if self.sub_fields: + if self.discriminator_key is not None: + return self._validate_discriminated_union(v, values, loc, cls) + + errors = [] + + if self.model_config.smart_union and is_union(get_origin(self.type_)): + # 1st pass: check if the value is an exact instance of one of the Union types + # (e.g. to avoid coercing a bool into an int) + for field in self.sub_fields: + if v.__class__ is field.outer_type_: + return v, None + + # 2nd pass: check if the value is an instance of any subclass of the Union types + for field in self.sub_fields: + # This whole logic will be improved later on to support more complex `isinstance` checks + # It will probably be done once a strict mode is added and be something like: + # ``` + # value, error = field.validate(v, values, strict=True) + # if error is None: + # return value, None + # ``` + try: + if isinstance(v, field.outer_type_): + return v, None + except TypeError: + # compound type + if lenient_isinstance(v, get_origin(field.outer_type_)): + value, error = field.validate(v, values, loc=loc, cls=cls) + if not error: + return value, None + + # 1st pass by default or 3rd pass with `smart_union` enabled: + # check if the value can be coerced into one of the Union types + for field in self.sub_fields: + value, error = field.validate(v, values, loc=loc, cls=cls) + if error: + errors.append(error) + else: + return value, None + return v, errors + else: + return self._apply_validators(v, values, loc, cls, self.validators) + + def _validate_discriminated_union( + self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc'] + ) -> 'ValidateReturn': + assert self.discriminator_key is not None + assert self.discriminator_alias is not None + + try: + try: + discriminator_value = v[self.discriminator_alias] + except KeyError: + if self.model_config.allow_population_by_field_name: + discriminator_value = v[self.discriminator_key] + else: + raise + except KeyError: + return v, ErrorWrapper(MissingDiscriminator(discriminator_key=self.discriminator_key), loc) + except TypeError: + try: + # BaseModel or dataclass + discriminator_value = getattr(v, self.discriminator_key) + except (AttributeError, TypeError): + return v, ErrorWrapper(MissingDiscriminator(discriminator_key=self.discriminator_key), loc) + + if self.sub_fields_mapping is None: + assert cls is not None + raise ConfigError( + f'field "{self.name}" not yet prepared so type is still a ForwardRef, ' + f'you might need to call {cls.__name__}.update_forward_refs().' + ) + + try: + sub_field = self.sub_fields_mapping[discriminator_value] + except (KeyError, TypeError): + # KeyError: `discriminator_value` is not in the dictionary. + # TypeError: `discriminator_value` is unhashable. + assert self.sub_fields_mapping is not None + return v, ErrorWrapper( + InvalidDiscriminator( + discriminator_key=self.discriminator_key, + discriminator_value=discriminator_value, + allowed_values=list(self.sub_fields_mapping), + ), + loc, + ) + else: + if not isinstance(loc, tuple): + loc = (loc,) + return sub_field.validate(v, values, loc=(*loc, display_as_type(sub_field.type_)), cls=cls) + + def _apply_validators( + self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc'], validators: 'ValidatorsList' + ) -> 'ValidateReturn': + for validator in validators: + try: + v = validator(cls, v, values, self, self.model_config) + except (ValueError, TypeError, AssertionError) as exc: + return v, ErrorWrapper(exc, loc) + return v, None + + def is_complex(self) -> bool: + """ + Whether the field is "complex" eg. env variables should be parsed as JSON. + """ + from pydantic.v1.main import BaseModel + + return ( + self.shape != SHAPE_SINGLETON + or hasattr(self.type_, '__pydantic_model__') + or lenient_issubclass(self.type_, (BaseModel, list, set, frozenset, dict)) + ) + + def _type_display(self) -> PyObjectStr: + t = display_as_type(self.type_) + + if self.shape in MAPPING_LIKE_SHAPES: + t = f'Mapping[{display_as_type(self.key_field.type_)}, {t}]' # type: ignore + elif self.shape == SHAPE_TUPLE: + t = 'Tuple[{}]'.format(', '.join(display_as_type(f.type_) for f in self.sub_fields)) # type: ignore + elif self.shape == SHAPE_GENERIC: + assert self.sub_fields + t = '{}[{}]'.format( + display_as_type(self.type_), ', '.join(display_as_type(f.type_) for f in self.sub_fields) + ) + elif self.shape != SHAPE_SINGLETON: + t = SHAPE_NAME_LOOKUP[self.shape].format(t) + + if self.allow_none and (self.shape != SHAPE_SINGLETON or not self.sub_fields): + t = f'Optional[{t}]' + return PyObjectStr(t) + + def __repr_args__(self) -> 'ReprArgs': + args = [('name', self.name), ('type', self._type_display()), ('required', self.required)] + + if not self.required: + if self.default_factory is not None: + args.append(('default_factory', f'')) + else: + args.append(('default', self.default)) + + if self.alt_alias: + args.append(('alias', self.alias)) + return args + + +class ModelPrivateAttr(Representation): + __slots__ = ('default', 'default_factory') + + def __init__(self, default: Any = Undefined, *, default_factory: Optional[NoArgAnyCallable] = None) -> None: + self.default = default + self.default_factory = default_factory + + def get_default(self) -> Any: + return smart_deepcopy(self.default) if self.default_factory is None else self.default_factory() + + def __eq__(self, other: Any) -> bool: + return isinstance(other, self.__class__) and (self.default, self.default_factory) == ( + other.default, + other.default_factory, + ) + + +def PrivateAttr( + default: Any = Undefined, + *, + default_factory: Optional[NoArgAnyCallable] = None, +) -> Any: + """ + Indicates that attribute is only used internally and never mixed with regular fields. + + Types or values of private attrs are not checked by pydantic and it's up to you to keep them relevant. + + Private attrs are stored in model __slots__. + + :param default: the attribute’s default value + :param default_factory: callable that will be called when a default value is needed for this attribute + If both `default` and `default_factory` are set, an error is raised. + """ + if default is not Undefined and default_factory is not None: + raise ValueError('cannot specify both default and default_factory') + + return ModelPrivateAttr( + default, + default_factory=default_factory, + ) + + +class DeferredType: + """ + Used to postpone field preparation, while creating recursive generic models. + """ + + +def is_finalvar_with_default_val(type_: Type[Any], val: Any) -> bool: + return is_finalvar(type_) and val is not Undefined and not isinstance(val, FieldInfo) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/generics.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/generics.py new file mode 100644 index 0000000000000000000000000000000000000000..9a69f2b39390cd1221f96b644b8d494597ce205c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/generics.py @@ -0,0 +1,400 @@ +import sys +import types +import typing +from typing import ( + TYPE_CHECKING, + Any, + ClassVar, + Dict, + ForwardRef, + Generic, + Iterator, + List, + Mapping, + Optional, + Tuple, + Type, + TypeVar, + Union, + cast, +) +from weakref import WeakKeyDictionary, WeakValueDictionary + +from typing_extensions import Annotated, Literal as ExtLiteral + +from pydantic.v1.class_validators import gather_all_validators +from pydantic.v1.fields import DeferredType +from pydantic.v1.main import BaseModel, create_model +from pydantic.v1.types import JsonWrapper +from pydantic.v1.typing import display_as_type, get_all_type_hints, get_args, get_origin, typing_base +from pydantic.v1.utils import all_identical, lenient_issubclass + +if sys.version_info >= (3, 10): + from typing import _UnionGenericAlias +if sys.version_info >= (3, 8): + from typing import Literal + +GenericModelT = TypeVar('GenericModelT', bound='GenericModel') +TypeVarType = Any # since mypy doesn't allow the use of TypeVar as a type + +CacheKey = Tuple[Type[Any], Any, Tuple[Any, ...]] +Parametrization = Mapping[TypeVarType, Type[Any]] + +# weak dictionaries allow the dynamically created parametrized versions of generic models to get collected +# once they are no longer referenced by the caller. +if sys.version_info >= (3, 9): # Typing for weak dictionaries available at 3.9 + GenericTypesCache = WeakValueDictionary[CacheKey, Type[BaseModel]] + AssignedParameters = WeakKeyDictionary[Type[BaseModel], Parametrization] +else: + GenericTypesCache = WeakValueDictionary + AssignedParameters = WeakKeyDictionary + +# _generic_types_cache is a Mapping from __class_getitem__ arguments to the parametrized version of generic models. +# This ensures multiple calls of e.g. A[B] return always the same class. +_generic_types_cache = GenericTypesCache() + +# _assigned_parameters is a Mapping from parametrized version of generic models to assigned types of parametrizations +# as captured during construction of the class (not instances). +# E.g., for generic model `Model[A, B]`, when parametrized model `Model[int, str]` is created, +# `Model[int, str]`: {A: int, B: str}` will be stored in `_assigned_parameters`. +# (This information is only otherwise available after creation from the class name string). +_assigned_parameters = AssignedParameters() + + +class GenericModel(BaseModel): + __slots__ = () + __concrete__: ClassVar[bool] = False + + if TYPE_CHECKING: + # Putting this in a TYPE_CHECKING block allows us to replace `if Generic not in cls.__bases__` with + # `not hasattr(cls, "__parameters__")`. This means we don't need to force non-concrete subclasses of + # `GenericModel` to also inherit from `Generic`, which would require changes to the use of `create_model` below. + __parameters__: ClassVar[Tuple[TypeVarType, ...]] + + # Setting the return type as Type[Any] instead of Type[BaseModel] prevents PyCharm warnings + def __class_getitem__(cls: Type[GenericModelT], params: Union[Type[Any], Tuple[Type[Any], ...]]) -> Type[Any]: + """Instantiates a new class from a generic class `cls` and type variables `params`. + + :param params: Tuple of types the class . Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + :return: New model class inheriting from `cls` with instantiated + types described by `params`. If no parameters are given, `cls` is + returned as is. + + """ + + def _cache_key(_params: Any) -> CacheKey: + args = get_args(_params) + # python returns a list for Callables, which is not hashable + if len(args) == 2 and isinstance(args[0], list): + args = (tuple(args[0]), args[1]) + return cls, _params, args + + cached = _generic_types_cache.get(_cache_key(params)) + if cached is not None: + return cached + if cls.__concrete__ and Generic not in cls.__bases__: + raise TypeError('Cannot parameterize a concrete instantiation of a generic model') + if not isinstance(params, tuple): + params = (params,) + if cls is GenericModel and any(isinstance(param, TypeVar) for param in params): + raise TypeError('Type parameters should be placed on typing.Generic, not GenericModel') + if not hasattr(cls, '__parameters__'): + raise TypeError(f'Type {cls.__name__} must inherit from typing.Generic before being parameterized') + + check_parameters_count(cls, params) + # Build map from generic typevars to passed params + typevars_map: Dict[TypeVarType, Type[Any]] = dict(zip(cls.__parameters__, params)) + if all_identical(typevars_map.keys(), typevars_map.values()) and typevars_map: + return cls # if arguments are equal to parameters it's the same object + + # Create new model with original model as parent inserting fields with DeferredType. + model_name = cls.__concrete_name__(params) + validators = gather_all_validators(cls) + + type_hints = get_all_type_hints(cls).items() + instance_type_hints = {k: v for k, v in type_hints if get_origin(v) is not ClassVar} + + fields = {k: (DeferredType(), cls.__fields__[k].field_info) for k in instance_type_hints if k in cls.__fields__} + + model_module, called_globally = get_caller_frame_info() + created_model = cast( + Type[GenericModel], # casting ensures mypy is aware of the __concrete__ and __parameters__ attributes + create_model( + model_name, + __module__=model_module or cls.__module__, + __base__=(cls,) + tuple(cls.__parameterized_bases__(typevars_map)), + __config__=None, + __validators__=validators, + __cls_kwargs__=None, + **fields, + ), + ) + + _assigned_parameters[created_model] = typevars_map + + if called_globally: # create global reference and therefore allow pickling + object_by_reference = None + reference_name = model_name + reference_module_globals = sys.modules[created_model.__module__].__dict__ + while object_by_reference is not created_model: + object_by_reference = reference_module_globals.setdefault(reference_name, created_model) + reference_name += '_' + + created_model.Config = cls.Config + + # Find any typevars that are still present in the model. + # If none are left, the model is fully "concrete", otherwise the new + # class is a generic class as well taking the found typevars as + # parameters. + new_params = tuple( + {param: None for param in iter_contained_typevars(typevars_map.values())} + ) # use dict as ordered set + created_model.__concrete__ = not new_params + if new_params: + created_model.__parameters__ = new_params + + # Save created model in cache so we don't end up creating duplicate + # models that should be identical. + _generic_types_cache[_cache_key(params)] = created_model + if len(params) == 1: + _generic_types_cache[_cache_key(params[0])] = created_model + + # Recursively walk class type hints and replace generic typevars + # with concrete types that were passed. + _prepare_model_fields(created_model, fields, instance_type_hints, typevars_map) + + return created_model + + @classmethod + def __concrete_name__(cls: Type[Any], params: Tuple[Type[Any], ...]) -> str: + """Compute class name for child classes. + + :param params: Tuple of types the class . Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + :return: String representing a the new class where `params` are + passed to `cls` as type variables. + + This method can be overridden to achieve a custom naming scheme for GenericModels. + """ + param_names = [display_as_type(param) for param in params] + params_component = ', '.join(param_names) + return f'{cls.__name__}[{params_component}]' + + @classmethod + def __parameterized_bases__(cls, typevars_map: Parametrization) -> Iterator[Type[Any]]: + """ + Returns unbound bases of cls parameterised to given type variables + + :param typevars_map: Dictionary of type applications for binding subclasses. + Given a generic class `Model` with 2 type variables [S, T] + and a concrete model `Model[str, int]`, + the value `{S: str, T: int}` would be passed to `typevars_map`. + :return: an iterator of generic sub classes, parameterised by `typevars_map` + and other assigned parameters of `cls` + + e.g.: + ``` + class A(GenericModel, Generic[T]): + ... + + class B(A[V], Generic[V]): + ... + + assert A[int] in B.__parameterized_bases__({V: int}) + ``` + """ + + def build_base_model( + base_model: Type[GenericModel], mapped_types: Parametrization + ) -> Iterator[Type[GenericModel]]: + base_parameters = tuple(mapped_types[param] for param in base_model.__parameters__) + parameterized_base = base_model.__class_getitem__(base_parameters) + if parameterized_base is base_model or parameterized_base is cls: + # Avoid duplication in MRO + return + yield parameterized_base + + for base_model in cls.__bases__: + if not issubclass(base_model, GenericModel): + # not a class that can be meaningfully parameterized + continue + elif not getattr(base_model, '__parameters__', None): + # base_model is "GenericModel" (and has no __parameters__) + # or + # base_model is already concrete, and will be included transitively via cls. + continue + elif cls in _assigned_parameters: + if base_model in _assigned_parameters: + # cls is partially parameterised but not from base_model + # e.g. cls = B[S], base_model = A[S] + # B[S][int] should subclass A[int], (and will be transitively via B[int]) + # but it's not viable to consistently subclass types with arbitrary construction + # So don't attempt to include A[S][int] + continue + else: # base_model not in _assigned_parameters: + # cls is partially parameterized, base_model is original generic + # e.g. cls = B[str, T], base_model = B[S, T] + # Need to determine the mapping for the base_model parameters + mapped_types: Parametrization = { + key: typevars_map.get(value, value) for key, value in _assigned_parameters[cls].items() + } + yield from build_base_model(base_model, mapped_types) + else: + # cls is base generic, so base_class has a distinct base + # can construct the Parameterised base model using typevars_map directly + yield from build_base_model(base_model, typevars_map) + + +def replace_types(type_: Any, type_map: Mapping[Any, Any]) -> Any: + """Return type with all occurrences of `type_map` keys recursively replaced with their values. + + :param type_: Any type, class or generic alias + :param type_map: Mapping from `TypeVar` instance to concrete types. + :return: New type representing the basic structure of `type_` with all + `typevar_map` keys recursively replaced. + + >>> replace_types(Tuple[str, Union[List[str], float]], {str: int}) + Tuple[int, Union[List[int], float]] + + """ + if not type_map: + return type_ + + type_args = get_args(type_) + origin_type = get_origin(type_) + + if origin_type is Annotated: + annotated_type, *annotations = type_args + return Annotated[replace_types(annotated_type, type_map), tuple(annotations)] + + if (origin_type is ExtLiteral) or (sys.version_info >= (3, 8) and origin_type is Literal): + return type_map.get(type_, type_) + # Having type args is a good indicator that this is a typing module + # class instantiation or a generic alias of some sort. + if type_args: + resolved_type_args = tuple(replace_types(arg, type_map) for arg in type_args) + if all_identical(type_args, resolved_type_args): + # If all arguments are the same, there is no need to modify the + # type or create a new object at all + return type_ + if ( + origin_type is not None + and isinstance(type_, typing_base) + and not isinstance(origin_type, typing_base) + and getattr(type_, '_name', None) is not None + ): + # In python < 3.9 generic aliases don't exist so any of these like `list`, + # `type` or `collections.abc.Callable` need to be translated. + # See: https://www.python.org/dev/peps/pep-0585 + origin_type = getattr(typing, type_._name) + assert origin_type is not None + # PEP-604 syntax (Ex.: list | str) is represented with a types.UnionType object that does not have __getitem__. + # We also cannot use isinstance() since we have to compare types. + if sys.version_info >= (3, 10) and origin_type is types.UnionType: # noqa: E721 + return _UnionGenericAlias(origin_type, resolved_type_args) + return origin_type[resolved_type_args] + + # We handle pydantic generic models separately as they don't have the same + # semantics as "typing" classes or generic aliases + if not origin_type and lenient_issubclass(type_, GenericModel) and not type_.__concrete__: + type_args = type_.__parameters__ + resolved_type_args = tuple(replace_types(t, type_map) for t in type_args) + if all_identical(type_args, resolved_type_args): + return type_ + return type_[resolved_type_args] + + # Handle special case for typehints that can have lists as arguments. + # `typing.Callable[[int, str], int]` is an example for this. + if isinstance(type_, (List, list)): + resolved_list = list(replace_types(element, type_map) for element in type_) + if all_identical(type_, resolved_list): + return type_ + return resolved_list + + # For JsonWrapperValue, need to handle its inner type to allow correct parsing + # of generic Json arguments like Json[T] + if not origin_type and lenient_issubclass(type_, JsonWrapper): + type_.inner_type = replace_types(type_.inner_type, type_map) + return type_ + + # If all else fails, we try to resolve the type directly and otherwise just + # return the input with no modifications. + new_type = type_map.get(type_, type_) + # Convert string to ForwardRef + if isinstance(new_type, str): + return ForwardRef(new_type) + else: + return new_type + + +def check_parameters_count(cls: Type[GenericModel], parameters: Tuple[Any, ...]) -> None: + actual = len(parameters) + expected = len(cls.__parameters__) + if actual != expected: + description = 'many' if actual > expected else 'few' + raise TypeError(f'Too {description} parameters for {cls.__name__}; actual {actual}, expected {expected}') + + +DictValues: Type[Any] = {}.values().__class__ + + +def iter_contained_typevars(v: Any) -> Iterator[TypeVarType]: + """Recursively iterate through all subtypes and type args of `v` and yield any typevars that are found.""" + if isinstance(v, TypeVar): + yield v + elif hasattr(v, '__parameters__') and not get_origin(v) and lenient_issubclass(v, GenericModel): + yield from v.__parameters__ + elif isinstance(v, (DictValues, list)): + for var in v: + yield from iter_contained_typevars(var) + else: + args = get_args(v) + for arg in args: + yield from iter_contained_typevars(arg) + + +def get_caller_frame_info() -> Tuple[Optional[str], bool]: + """ + Used inside a function to check whether it was called globally + + Will only work against non-compiled code, therefore used only in pydantic.generics + + :returns Tuple[module_name, called_globally] + """ + try: + previous_caller_frame = sys._getframe(2) + except ValueError as e: + raise RuntimeError('This function must be used inside another function') from e + except AttributeError: # sys module does not have _getframe function, so there's nothing we can do about it + return None, False + frame_globals = previous_caller_frame.f_globals + return frame_globals.get('__name__'), previous_caller_frame.f_locals is frame_globals + + +def _prepare_model_fields( + created_model: Type[GenericModel], + fields: Mapping[str, Any], + instance_type_hints: Mapping[str, type], + typevars_map: Mapping[Any, type], +) -> None: + """ + Replace DeferredType fields with concrete type hints and prepare them. + """ + + for key, field in created_model.__fields__.items(): + if key not in fields: + assert field.type_.__class__ is not DeferredType + # https://github.com/nedbat/coveragepy/issues/198 + continue # pragma: no cover + + assert field.type_.__class__ is DeferredType, field.type_.__class__ + + field_type_hint = instance_type_hints[key] + concrete_type = replace_types(field_type_hint, typevars_map) + field.type_ = concrete_type + field.outer_type_ = concrete_type + field.prepare() + created_model.__annotations__[key] = concrete_type diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/json.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/json.py new file mode 100644 index 0000000000000000000000000000000000000000..41d0d5fcae0d946401c2d089b69143f540618b90 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/json.py @@ -0,0 +1,112 @@ +import datetime +from collections import deque +from decimal import Decimal +from enum import Enum +from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network +from pathlib import Path +from re import Pattern +from types import GeneratorType +from typing import Any, Callable, Dict, Type, Union +from uuid import UUID + +from pydantic.v1.color import Color +from pydantic.v1.networks import NameEmail +from pydantic.v1.types import SecretBytes, SecretStr + +__all__ = 'pydantic_encoder', 'custom_pydantic_encoder', 'timedelta_isoformat' + + +def isoformat(o: Union[datetime.date, datetime.time]) -> str: + return o.isoformat() + + +def decimal_encoder(dec_value: Decimal) -> Union[int, float]: + """ + Encodes a Decimal as int of there's no exponent, otherwise float + + This is useful when we use ConstrainedDecimal to represent Numeric(x,0) + where a integer (but not int typed) is used. Encoding this as a float + results in failed round-tripping between encode and parse. + Our Id type is a prime example of this. + + >>> decimal_encoder(Decimal("1.0")) + 1.0 + + >>> decimal_encoder(Decimal("1")) + 1 + """ + if dec_value.as_tuple().exponent >= 0: + return int(dec_value) + else: + return float(dec_value) + + +ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = { + bytes: lambda o: o.decode(), + Color: str, + datetime.date: isoformat, + datetime.datetime: isoformat, + datetime.time: isoformat, + datetime.timedelta: lambda td: td.total_seconds(), + Decimal: decimal_encoder, + Enum: lambda o: o.value, + frozenset: list, + deque: list, + GeneratorType: list, + IPv4Address: str, + IPv4Interface: str, + IPv4Network: str, + IPv6Address: str, + IPv6Interface: str, + IPv6Network: str, + NameEmail: str, + Path: str, + Pattern: lambda o: o.pattern, + SecretBytes: str, + SecretStr: str, + set: list, + UUID: str, +} + + +def pydantic_encoder(obj: Any) -> Any: + from dataclasses import asdict, is_dataclass + + from pydantic.v1.main import BaseModel + + if isinstance(obj, BaseModel): + return obj.dict() + elif is_dataclass(obj): + return asdict(obj) + + # Check the class type and its superclasses for a matching encoder + for base in obj.__class__.__mro__[:-1]: + try: + encoder = ENCODERS_BY_TYPE[base] + except KeyError: + continue + return encoder(obj) + else: # We have exited the for loop without finding a suitable encoder + raise TypeError(f"Object of type '{obj.__class__.__name__}' is not JSON serializable") + + +def custom_pydantic_encoder(type_encoders: Dict[Any, Callable[[Type[Any]], Any]], obj: Any) -> Any: + # Check the class type and its superclasses for a matching encoder + for base in obj.__class__.__mro__[:-1]: + try: + encoder = type_encoders[base] + except KeyError: + continue + + return encoder(obj) + else: # We have exited the for loop without finding a suitable encoder + return pydantic_encoder(obj) + + +def timedelta_isoformat(td: datetime.timedelta) -> str: + """ + ISO 8601 encoding for Python timedelta object. + """ + minutes, seconds = divmod(td.seconds, 60) + hours, minutes = divmod(minutes, 60) + return f'{"-" if td.days < 0 else ""}P{abs(td.days)}DT{hours:d}H{minutes:d}M{seconds:d}.{td.microseconds:06d}S' diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/main.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/main.py new file mode 100644 index 0000000000000000000000000000000000000000..8000967eafc52526b43e451106a15996c46969c9 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/main.py @@ -0,0 +1,1113 @@ +import warnings +from abc import ABCMeta +from copy import deepcopy +from enum import Enum +from functools import partial +from pathlib import Path +from types import FunctionType, prepare_class, resolve_bases +from typing import ( + TYPE_CHECKING, + AbstractSet, + Any, + Callable, + ClassVar, + Dict, + List, + Mapping, + Optional, + Tuple, + Type, + TypeVar, + Union, + cast, + no_type_check, + overload, +) + +from typing_extensions import dataclass_transform + +from pydantic.v1.class_validators import ValidatorGroup, extract_root_validators, extract_validators, inherit_validators +from pydantic.v1.config import BaseConfig, Extra, inherit_config, prepare_config +from pydantic.v1.error_wrappers import ErrorWrapper, ValidationError +from pydantic.v1.errors import ConfigError, DictError, ExtraError, MissingError +from pydantic.v1.fields import ( + MAPPING_LIKE_SHAPES, + Field, + ModelField, + ModelPrivateAttr, + PrivateAttr, + Undefined, + is_finalvar_with_default_val, +) +from pydantic.v1.json import custom_pydantic_encoder, pydantic_encoder +from pydantic.v1.parse import Protocol, load_file, load_str_bytes +from pydantic.v1.schema import default_ref_template, model_schema +from pydantic.v1.types import PyObject, StrBytes +from pydantic.v1.typing import ( + AnyCallable, + get_args, + get_origin, + is_classvar, + is_namedtuple, + is_union, + resolve_annotations, + update_model_forward_refs, +) +from pydantic.v1.utils import ( + DUNDER_ATTRIBUTES, + ROOT_KEY, + ClassAttribute, + GetterDict, + Representation, + ValueItems, + generate_model_signature, + is_valid_field, + is_valid_private_name, + lenient_issubclass, + sequence_like, + smart_deepcopy, + unique_list, + validate_field_name, +) + +if TYPE_CHECKING: + from inspect import Signature + + from pydantic.v1.class_validators import ValidatorListDict + from pydantic.v1.types import ModelOrDc + from pydantic.v1.typing import ( + AbstractSetIntStr, + AnyClassMethod, + CallableGenerator, + DictAny, + DictStrAny, + MappingIntStrAny, + ReprArgs, + SetStr, + TupleGenerator, + ) + + Model = TypeVar('Model', bound='BaseModel') + +__all__ = 'BaseModel', 'create_model', 'validate_model' + +_T = TypeVar('_T') + + +def validate_custom_root_type(fields: Dict[str, ModelField]) -> None: + if len(fields) > 1: + raise ValueError(f'{ROOT_KEY} cannot be mixed with other fields') + + +def generate_hash_function(frozen: bool) -> Optional[Callable[[Any], int]]: + def hash_function(self_: Any) -> int: + return hash(self_.__class__) + hash(tuple(self_.__dict__.values())) + + return hash_function if frozen else None + + +# If a field is of type `Callable`, its default value should be a function and cannot to ignored. +ANNOTATED_FIELD_UNTOUCHED_TYPES: Tuple[Any, ...] = (property, type, classmethod, staticmethod) +# When creating a `BaseModel` instance, we bypass all the methods, properties... added to the model +UNTOUCHED_TYPES: Tuple[Any, ...] = (FunctionType,) + ANNOTATED_FIELD_UNTOUCHED_TYPES +# Note `ModelMetaclass` refers to `BaseModel`, but is also used to *create* `BaseModel`, so we need to add this extra +# (somewhat hacky) boolean to keep track of whether we've created the `BaseModel` class yet, and therefore whether it's +# safe to refer to it. If it *hasn't* been created, we assume that the `__new__` call we're in the middle of is for +# the `BaseModel` class, since that's defined immediately after the metaclass. +_is_base_model_class_defined = False + + +@dataclass_transform(kw_only_default=True, field_specifiers=(Field,)) +class ModelMetaclass(ABCMeta): + @no_type_check # noqa C901 + def __new__(mcs, name, bases, namespace, **kwargs): # noqa C901 + fields: Dict[str, ModelField] = {} + config = BaseConfig + validators: 'ValidatorListDict' = {} + + pre_root_validators, post_root_validators = [], [] + private_attributes: Dict[str, ModelPrivateAttr] = {} + base_private_attributes: Dict[str, ModelPrivateAttr] = {} + slots: SetStr = namespace.get('__slots__', ()) + slots = {slots} if isinstance(slots, str) else set(slots) + class_vars: SetStr = set() + hash_func: Optional[Callable[[Any], int]] = None + + for base in reversed(bases): + if _is_base_model_class_defined and issubclass(base, BaseModel) and base != BaseModel: + fields.update(smart_deepcopy(base.__fields__)) + config = inherit_config(base.__config__, config) + validators = inherit_validators(base.__validators__, validators) + pre_root_validators += base.__pre_root_validators__ + post_root_validators += base.__post_root_validators__ + base_private_attributes.update(base.__private_attributes__) + class_vars.update(base.__class_vars__) + hash_func = base.__hash__ + + resolve_forward_refs = kwargs.pop('__resolve_forward_refs__', True) + allowed_config_kwargs: SetStr = { + key + for key in dir(config) + if not (key.startswith('__') and key.endswith('__')) # skip dunder methods and attributes + } + config_kwargs = {key: kwargs.pop(key) for key in kwargs.keys() & allowed_config_kwargs} + config_from_namespace = namespace.get('Config') + if config_kwargs and config_from_namespace: + raise TypeError('Specifying config in two places is ambiguous, use either Config attribute or class kwargs') + config = inherit_config(config_from_namespace, config, **config_kwargs) + + validators = inherit_validators(extract_validators(namespace), validators) + vg = ValidatorGroup(validators) + + for f in fields.values(): + f.set_config(config) + extra_validators = vg.get_validators(f.name) + if extra_validators: + f.class_validators.update(extra_validators) + # re-run prepare to add extra validators + f.populate_validators() + + prepare_config(config, name) + + untouched_types = ANNOTATED_FIELD_UNTOUCHED_TYPES + + def is_untouched(v: Any) -> bool: + return isinstance(v, untouched_types) or v.__class__.__name__ == 'cython_function_or_method' + + if (namespace.get('__module__'), namespace.get('__qualname__')) != ('pydantic.main', 'BaseModel'): + annotations = resolve_annotations(namespace.get('__annotations__', {}), namespace.get('__module__', None)) + # annotation only fields need to come first in fields + for ann_name, ann_type in annotations.items(): + if is_classvar(ann_type): + class_vars.add(ann_name) + elif is_finalvar_with_default_val(ann_type, namespace.get(ann_name, Undefined)): + class_vars.add(ann_name) + elif is_valid_field(ann_name): + validate_field_name(bases, ann_name) + value = namespace.get(ann_name, Undefined) + allowed_types = get_args(ann_type) if is_union(get_origin(ann_type)) else (ann_type,) + if ( + is_untouched(value) + and ann_type != PyObject + and not any( + lenient_issubclass(get_origin(allowed_type), Type) for allowed_type in allowed_types + ) + ): + continue + fields[ann_name] = ModelField.infer( + name=ann_name, + value=value, + annotation=ann_type, + class_validators=vg.get_validators(ann_name), + config=config, + ) + elif ann_name not in namespace and config.underscore_attrs_are_private: + private_attributes[ann_name] = PrivateAttr() + + untouched_types = UNTOUCHED_TYPES + config.keep_untouched + for var_name, value in namespace.items(): + can_be_changed = var_name not in class_vars and not is_untouched(value) + if isinstance(value, ModelPrivateAttr): + if not is_valid_private_name(var_name): + raise NameError( + f'Private attributes "{var_name}" must not be a valid field name; ' + f'Use sunder or dunder names, e. g. "_{var_name}" or "__{var_name}__"' + ) + private_attributes[var_name] = value + elif config.underscore_attrs_are_private and is_valid_private_name(var_name) and can_be_changed: + private_attributes[var_name] = PrivateAttr(default=value) + elif is_valid_field(var_name) and var_name not in annotations and can_be_changed: + validate_field_name(bases, var_name) + inferred = ModelField.infer( + name=var_name, + value=value, + annotation=annotations.get(var_name, Undefined), + class_validators=vg.get_validators(var_name), + config=config, + ) + if var_name in fields: + if lenient_issubclass(inferred.type_, fields[var_name].type_): + inferred.type_ = fields[var_name].type_ + else: + raise TypeError( + f'The type of {name}.{var_name} differs from the new default value; ' + f'if you wish to change the type of this field, please use a type annotation' + ) + fields[var_name] = inferred + + _custom_root_type = ROOT_KEY in fields + if _custom_root_type: + validate_custom_root_type(fields) + vg.check_for_unused() + if config.json_encoders: + json_encoder = partial(custom_pydantic_encoder, config.json_encoders) + else: + json_encoder = pydantic_encoder + pre_rv_new, post_rv_new = extract_root_validators(namespace) + + if hash_func is None: + hash_func = generate_hash_function(config.frozen) + + exclude_from_namespace = fields | private_attributes.keys() | {'__slots__'} + new_namespace = { + '__config__': config, + '__fields__': fields, + '__exclude_fields__': { + name: field.field_info.exclude for name, field in fields.items() if field.field_info.exclude is not None + } + or None, + '__include_fields__': { + name: field.field_info.include for name, field in fields.items() if field.field_info.include is not None + } + or None, + '__validators__': vg.validators, + '__pre_root_validators__': unique_list( + pre_root_validators + pre_rv_new, + name_factory=lambda v: v.__name__, + ), + '__post_root_validators__': unique_list( + post_root_validators + post_rv_new, + name_factory=lambda skip_on_failure_and_v: skip_on_failure_and_v[1].__name__, + ), + '__schema_cache__': {}, + '__json_encoder__': staticmethod(json_encoder), + '__custom_root_type__': _custom_root_type, + '__private_attributes__': {**base_private_attributes, **private_attributes}, + '__slots__': slots | private_attributes.keys(), + '__hash__': hash_func, + '__class_vars__': class_vars, + **{n: v for n, v in namespace.items() if n not in exclude_from_namespace}, + } + + cls = super().__new__(mcs, name, bases, new_namespace, **kwargs) + # set __signature__ attr only for model class, but not for its instances + cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config)) + + if not _is_base_model_class_defined: + # Cython does not understand the `if TYPE_CHECKING:` condition in the + # BaseModel's body (where annotations are set), so clear them manually: + getattr(cls, '__annotations__', {}).clear() + + if resolve_forward_refs: + cls.__try_update_forward_refs__() + + # preserve `__set_name__` protocol defined in https://peps.python.org/pep-0487 + # for attributes not in `new_namespace` (e.g. private attributes) + for name, obj in namespace.items(): + if name not in new_namespace: + set_name = getattr(obj, '__set_name__', None) + if callable(set_name): + set_name(cls, name) + + return cls + + def __instancecheck__(self, instance: Any) -> bool: + """ + Avoid calling ABC _abc_subclasscheck unless we're pretty sure. + + See #3829 and python/cpython#92810 + """ + return hasattr(instance, '__post_root_validators__') and super().__instancecheck__(instance) + + +object_setattr = object.__setattr__ + + +class BaseModel(Representation, metaclass=ModelMetaclass): + if TYPE_CHECKING: + # populated by the metaclass, defined here to help IDEs only + __fields__: ClassVar[Dict[str, ModelField]] = {} + __include_fields__: ClassVar[Optional[Mapping[str, Any]]] = None + __exclude_fields__: ClassVar[Optional[Mapping[str, Any]]] = None + __validators__: ClassVar[Dict[str, AnyCallable]] = {} + __pre_root_validators__: ClassVar[List[AnyCallable]] + __post_root_validators__: ClassVar[List[Tuple[bool, AnyCallable]]] + __config__: ClassVar[Type[BaseConfig]] = BaseConfig + __json_encoder__: ClassVar[Callable[[Any], Any]] = lambda x: x + __schema_cache__: ClassVar['DictAny'] = {} + __custom_root_type__: ClassVar[bool] = False + __signature__: ClassVar['Signature'] + __private_attributes__: ClassVar[Dict[str, ModelPrivateAttr]] + __class_vars__: ClassVar[SetStr] + __fields_set__: ClassVar[SetStr] = set() + + Config = BaseConfig + __slots__ = ('__dict__', '__fields_set__') + __doc__ = '' # Null out the Representation docstring + + def __init__(__pydantic_self__, **data: Any) -> None: + """ + Create a new model by parsing and validating input data from keyword arguments. + + Raises ValidationError if the input data cannot be parsed to form a valid model. + """ + # Uses something other than `self` the first arg to allow "self" as a settable attribute + values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data) + if validation_error: + raise validation_error + try: + object_setattr(__pydantic_self__, '__dict__', values) + except TypeError as e: + raise TypeError( + 'Model values must be a dict; you may not have returned a dictionary from a root validator' + ) from e + object_setattr(__pydantic_self__, '__fields_set__', fields_set) + __pydantic_self__._init_private_attributes() + + @no_type_check + def __setattr__(self, name, value): # noqa: C901 (ignore complexity) + if name in self.__private_attributes__ or name in DUNDER_ATTRIBUTES: + return object_setattr(self, name, value) + + if self.__config__.extra is not Extra.allow and name not in self.__fields__: + raise ValueError(f'"{self.__class__.__name__}" object has no field "{name}"') + elif not self.__config__.allow_mutation or self.__config__.frozen: + raise TypeError(f'"{self.__class__.__name__}" is immutable and does not support item assignment') + elif name in self.__fields__ and self.__fields__[name].final: + raise TypeError( + f'"{self.__class__.__name__}" object "{name}" field is final and does not support reassignment' + ) + elif self.__config__.validate_assignment: + new_values = {**self.__dict__, name: value} + + for validator in self.__pre_root_validators__: + try: + new_values = validator(self.__class__, new_values) + except (ValueError, TypeError, AssertionError) as exc: + raise ValidationError([ErrorWrapper(exc, loc=ROOT_KEY)], self.__class__) + + known_field = self.__fields__.get(name, None) + if known_field: + # We want to + # - make sure validators are called without the current value for this field inside `values` + # - keep other values (e.g. submodels) untouched (using `BaseModel.dict()` will change them into dicts) + # - keep the order of the fields + if not known_field.field_info.allow_mutation: + raise TypeError(f'"{known_field.name}" has allow_mutation set to False and cannot be assigned') + dict_without_original_value = {k: v for k, v in self.__dict__.items() if k != name} + value, error_ = known_field.validate(value, dict_without_original_value, loc=name, cls=self.__class__) + if error_: + raise ValidationError([error_], self.__class__) + else: + new_values[name] = value + + errors = [] + for skip_on_failure, validator in self.__post_root_validators__: + if skip_on_failure and errors: + continue + try: + new_values = validator(self.__class__, new_values) + except (ValueError, TypeError, AssertionError) as exc: + errors.append(ErrorWrapper(exc, loc=ROOT_KEY)) + if errors: + raise ValidationError(errors, self.__class__) + + # update the whole __dict__ as other values than just `value` + # may be changed (e.g. with `root_validator`) + object_setattr(self, '__dict__', new_values) + else: + self.__dict__[name] = value + + self.__fields_set__.add(name) + + def __getstate__(self) -> 'DictAny': + private_attrs = ((k, getattr(self, k, Undefined)) for k in self.__private_attributes__) + return { + '__dict__': self.__dict__, + '__fields_set__': self.__fields_set__, + '__private_attribute_values__': {k: v for k, v in private_attrs if v is not Undefined}, + } + + def __setstate__(self, state: 'DictAny') -> None: + object_setattr(self, '__dict__', state['__dict__']) + object_setattr(self, '__fields_set__', state['__fields_set__']) + for name, value in state.get('__private_attribute_values__', {}).items(): + object_setattr(self, name, value) + + def _init_private_attributes(self) -> None: + for name, private_attr in self.__private_attributes__.items(): + default = private_attr.get_default() + if default is not Undefined: + object_setattr(self, name, default) + + def dict( + self, + *, + include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None, + exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None, + by_alias: bool = False, + skip_defaults: Optional[bool] = None, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, + ) -> 'DictStrAny': + """ + Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + + """ + if skip_defaults is not None: + warnings.warn( + f'{self.__class__.__name__}.dict(): "skip_defaults" is deprecated and replaced by "exclude_unset"', + DeprecationWarning, + ) + exclude_unset = skip_defaults + + return dict( + self._iter( + to_dict=True, + by_alias=by_alias, + include=include, + exclude=exclude, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + ) + ) + + def json( + self, + *, + include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None, + exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None, + by_alias: bool = False, + skip_defaults: Optional[bool] = None, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, + encoder: Optional[Callable[[Any], Any]] = None, + models_as_dict: bool = True, + **dumps_kwargs: Any, + ) -> str: + """ + Generate a JSON representation of the model, `include` and `exclude` arguments as per `dict()`. + + `encoder` is an optional function to supply as `default` to json.dumps(), other arguments as per `json.dumps()`. + """ + if skip_defaults is not None: + warnings.warn( + f'{self.__class__.__name__}.json(): "skip_defaults" is deprecated and replaced by "exclude_unset"', + DeprecationWarning, + ) + exclude_unset = skip_defaults + encoder = cast(Callable[[Any], Any], encoder or self.__json_encoder__) + + # We don't directly call `self.dict()`, which does exactly this with `to_dict=True` + # because we want to be able to keep raw `BaseModel` instances and not as `dict`. + # This allows users to write custom JSON encoders for given `BaseModel` classes. + data = dict( + self._iter( + to_dict=models_as_dict, + by_alias=by_alias, + include=include, + exclude=exclude, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + ) + ) + if self.__custom_root_type__: + data = data[ROOT_KEY] + return self.__config__.json_dumps(data, default=encoder, **dumps_kwargs) + + @classmethod + def _enforce_dict_if_root(cls, obj: Any) -> Any: + if cls.__custom_root_type__ and ( + not (isinstance(obj, dict) and obj.keys() == {ROOT_KEY}) + and not (isinstance(obj, BaseModel) and obj.__fields__.keys() == {ROOT_KEY}) + or cls.__fields__[ROOT_KEY].shape in MAPPING_LIKE_SHAPES + ): + return {ROOT_KEY: obj} + else: + return obj + + @classmethod + def parse_obj(cls: Type['Model'], obj: Any) -> 'Model': + obj = cls._enforce_dict_if_root(obj) + if not isinstance(obj, dict): + try: + obj = dict(obj) + except (TypeError, ValueError) as e: + exc = TypeError(f'{cls.__name__} expected dict not {obj.__class__.__name__}') + raise ValidationError([ErrorWrapper(exc, loc=ROOT_KEY)], cls) from e + return cls(**obj) + + @classmethod + def parse_raw( + cls: Type['Model'], + b: StrBytes, + *, + content_type: str = None, + encoding: str = 'utf8', + proto: Protocol = None, + allow_pickle: bool = False, + ) -> 'Model': + try: + obj = load_str_bytes( + b, + proto=proto, + content_type=content_type, + encoding=encoding, + allow_pickle=allow_pickle, + json_loads=cls.__config__.json_loads, + ) + except (ValueError, TypeError, UnicodeDecodeError) as e: + raise ValidationError([ErrorWrapper(e, loc=ROOT_KEY)], cls) + return cls.parse_obj(obj) + + @classmethod + def parse_file( + cls: Type['Model'], + path: Union[str, Path], + *, + content_type: str = None, + encoding: str = 'utf8', + proto: Protocol = None, + allow_pickle: bool = False, + ) -> 'Model': + obj = load_file( + path, + proto=proto, + content_type=content_type, + encoding=encoding, + allow_pickle=allow_pickle, + json_loads=cls.__config__.json_loads, + ) + return cls.parse_obj(obj) + + @classmethod + def from_orm(cls: Type['Model'], obj: Any) -> 'Model': + if not cls.__config__.orm_mode: + raise ConfigError('You must have the config attribute orm_mode=True to use from_orm') + obj = {ROOT_KEY: obj} if cls.__custom_root_type__ else cls._decompose_class(obj) + m = cls.__new__(cls) + values, fields_set, validation_error = validate_model(cls, obj) + if validation_error: + raise validation_error + object_setattr(m, '__dict__', values) + object_setattr(m, '__fields_set__', fields_set) + m._init_private_attributes() + return m + + @classmethod + def construct(cls: Type['Model'], _fields_set: Optional['SetStr'] = None, **values: Any) -> 'Model': + """ + Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. + Default values are respected, but no other validation is performed. + Behaves as if `Config.extra = 'allow'` was set since it adds all passed values + """ + m = cls.__new__(cls) + fields_values: Dict[str, Any] = {} + for name, field in cls.__fields__.items(): + if field.alt_alias and field.alias in values: + fields_values[name] = values[field.alias] + elif name in values: + fields_values[name] = values[name] + elif not field.required: + fields_values[name] = field.get_default() + fields_values.update(values) + object_setattr(m, '__dict__', fields_values) + if _fields_set is None: + _fields_set = set(values.keys()) + object_setattr(m, '__fields_set__', _fields_set) + m._init_private_attributes() + return m + + def _copy_and_set_values(self: 'Model', values: 'DictStrAny', fields_set: 'SetStr', *, deep: bool) -> 'Model': + if deep: + # chances of having empty dict here are quite low for using smart_deepcopy + values = deepcopy(values) + + cls = self.__class__ + m = cls.__new__(cls) + object_setattr(m, '__dict__', values) + object_setattr(m, '__fields_set__', fields_set) + for name in self.__private_attributes__: + value = getattr(self, name, Undefined) + if value is not Undefined: + if deep: + value = deepcopy(value) + object_setattr(m, name, value) + + return m + + def copy( + self: 'Model', + *, + include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None, + exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None, + update: Optional['DictStrAny'] = None, + deep: bool = False, + ) -> 'Model': + """ + Duplicate a model, optionally choose which fields to include, exclude and change. + + :param include: fields to include in new model + :param exclude: fields to exclude from new model, as with values this takes precedence over include + :param update: values to change/add in the new model. Note: the data is not validated before creating + the new model: you should trust this data + :param deep: set to `True` to make a deep copy of the model + :return: new model instance + """ + + values = dict( + self._iter(to_dict=False, by_alias=False, include=include, exclude=exclude, exclude_unset=False), + **(update or {}), + ) + + # new `__fields_set__` can have unset optional fields with a set value in `update` kwarg + if update: + fields_set = self.__fields_set__ | update.keys() + else: + fields_set = set(self.__fields_set__) + + return self._copy_and_set_values(values, fields_set, deep=deep) + + @classmethod + def schema(cls, by_alias: bool = True, ref_template: str = default_ref_template) -> 'DictStrAny': + cached = cls.__schema_cache__.get((by_alias, ref_template)) + if cached is not None: + return cached + s = model_schema(cls, by_alias=by_alias, ref_template=ref_template) + cls.__schema_cache__[(by_alias, ref_template)] = s + return s + + @classmethod + def schema_json( + cls, *, by_alias: bool = True, ref_template: str = default_ref_template, **dumps_kwargs: Any + ) -> str: + from pydantic.v1.json import pydantic_encoder + + return cls.__config__.json_dumps( + cls.schema(by_alias=by_alias, ref_template=ref_template), default=pydantic_encoder, **dumps_kwargs + ) + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + + @classmethod + def validate(cls: Type['Model'], value: Any) -> 'Model': + if isinstance(value, cls): + copy_on_model_validation = cls.__config__.copy_on_model_validation + # whether to deep or shallow copy the model on validation, None means do not copy + deep_copy: Optional[bool] = None + if copy_on_model_validation not in {'deep', 'shallow', 'none'}: + # Warn about deprecated behavior + warnings.warn( + "`copy_on_model_validation` should be a string: 'deep', 'shallow' or 'none'", DeprecationWarning + ) + if copy_on_model_validation: + deep_copy = False + + if copy_on_model_validation == 'shallow': + # shallow copy + deep_copy = False + elif copy_on_model_validation == 'deep': + # deep copy + deep_copy = True + + if deep_copy is None: + return value + else: + return value._copy_and_set_values(value.__dict__, value.__fields_set__, deep=deep_copy) + + value = cls._enforce_dict_if_root(value) + + if isinstance(value, dict): + return cls(**value) + elif cls.__config__.orm_mode: + return cls.from_orm(value) + else: + try: + value_as_dict = dict(value) + except (TypeError, ValueError) as e: + raise DictError() from e + return cls(**value_as_dict) + + @classmethod + def _decompose_class(cls: Type['Model'], obj: Any) -> GetterDict: + if isinstance(obj, GetterDict): + return obj + return cls.__config__.getter_dict(obj) + + @classmethod + @no_type_check + def _get_value( + cls, + v: Any, + to_dict: bool, + by_alias: bool, + include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']], + exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']], + exclude_unset: bool, + exclude_defaults: bool, + exclude_none: bool, + ) -> Any: + if isinstance(v, BaseModel): + if to_dict: + v_dict = v.dict( + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + include=include, + exclude=exclude, + exclude_none=exclude_none, + ) + if ROOT_KEY in v_dict: + return v_dict[ROOT_KEY] + return v_dict + else: + return v.copy(include=include, exclude=exclude) + + value_exclude = ValueItems(v, exclude) if exclude else None + value_include = ValueItems(v, include) if include else None + + if isinstance(v, dict): + return { + k_: cls._get_value( + v_, + to_dict=to_dict, + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + include=value_include and value_include.for_element(k_), + exclude=value_exclude and value_exclude.for_element(k_), + exclude_none=exclude_none, + ) + for k_, v_ in v.items() + if (not value_exclude or not value_exclude.is_excluded(k_)) + and (not value_include or value_include.is_included(k_)) + } + + elif sequence_like(v): + seq_args = ( + cls._get_value( + v_, + to_dict=to_dict, + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + include=value_include and value_include.for_element(i), + exclude=value_exclude and value_exclude.for_element(i), + exclude_none=exclude_none, + ) + for i, v_ in enumerate(v) + if (not value_exclude or not value_exclude.is_excluded(i)) + and (not value_include or value_include.is_included(i)) + ) + + return v.__class__(*seq_args) if is_namedtuple(v.__class__) else v.__class__(seq_args) + + elif isinstance(v, Enum) and getattr(cls.Config, 'use_enum_values', False): + return v.value + + else: + return v + + @classmethod + def __try_update_forward_refs__(cls, **localns: Any) -> None: + """ + Same as update_forward_refs but will not raise exception + when forward references are not defined. + """ + update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_encoders, localns, (NameError,)) + + @classmethod + def update_forward_refs(cls, **localns: Any) -> None: + """ + Try to update ForwardRefs on fields based on this Model, globalns and localns. + """ + update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_encoders, localns) + + def __iter__(self) -> 'TupleGenerator': + """ + so `dict(model)` works + """ + yield from self.__dict__.items() + + def _iter( + self, + to_dict: bool = False, + by_alias: bool = False, + include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None, + exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, + ) -> 'TupleGenerator': + # Merge field set excludes with explicit exclude parameter with explicit overriding field set options. + # The extra "is not None" guards are not logically necessary but optimizes performance for the simple case. + if exclude is not None or self.__exclude_fields__ is not None: + exclude = ValueItems.merge(self.__exclude_fields__, exclude) + + if include is not None or self.__include_fields__ is not None: + include = ValueItems.merge(self.__include_fields__, include, intersect=True) + + allowed_keys = self._calculate_keys( + include=include, exclude=exclude, exclude_unset=exclude_unset # type: ignore + ) + if allowed_keys is None and not (to_dict or by_alias or exclude_unset or exclude_defaults or exclude_none): + # huge boost for plain _iter() + yield from self.__dict__.items() + return + + value_exclude = ValueItems(self, exclude) if exclude is not None else None + value_include = ValueItems(self, include) if include is not None else None + + for field_key, v in self.__dict__.items(): + if (allowed_keys is not None and field_key not in allowed_keys) or (exclude_none and v is None): + continue + + if exclude_defaults: + model_field = self.__fields__.get(field_key) + if not getattr(model_field, 'required', True) and getattr(model_field, 'default', _missing) == v: + continue + + if by_alias and field_key in self.__fields__: + dict_key = self.__fields__[field_key].alias + else: + dict_key = field_key + + if to_dict or value_include or value_exclude: + v = self._get_value( + v, + to_dict=to_dict, + by_alias=by_alias, + include=value_include and value_include.for_element(field_key), + exclude=value_exclude and value_exclude.for_element(field_key), + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + ) + yield dict_key, v + + def _calculate_keys( + self, + include: Optional['MappingIntStrAny'], + exclude: Optional['MappingIntStrAny'], + exclude_unset: bool, + update: Optional['DictStrAny'] = None, + ) -> Optional[AbstractSet[str]]: + if include is None and exclude is None and exclude_unset is False: + return None + + keys: AbstractSet[str] + if exclude_unset: + keys = self.__fields_set__.copy() + else: + keys = self.__dict__.keys() + + if include is not None: + keys &= include.keys() + + if update: + keys -= update.keys() + + if exclude: + keys -= {k for k, v in exclude.items() if ValueItems.is_true(v)} + + return keys + + def __eq__(self, other: Any) -> bool: + if isinstance(other, BaseModel): + return self.dict() == other.dict() + else: + return self.dict() == other + + def __repr_args__(self) -> 'ReprArgs': + return [ + (k, v) + for k, v in self.__dict__.items() + if k not in DUNDER_ATTRIBUTES and (k not in self.__fields__ or self.__fields__[k].field_info.repr) + ] + + +_is_base_model_class_defined = True + + +@overload +def create_model( + __model_name: str, + *, + __config__: Optional[Type[BaseConfig]] = None, + __base__: None = None, + __module__: str = __name__, + __validators__: Dict[str, 'AnyClassMethod'] = None, + __cls_kwargs__: Dict[str, Any] = None, + **field_definitions: Any, +) -> Type['BaseModel']: + ... + + +@overload +def create_model( + __model_name: str, + *, + __config__: Optional[Type[BaseConfig]] = None, + __base__: Union[Type['Model'], Tuple[Type['Model'], ...]], + __module__: str = __name__, + __validators__: Dict[str, 'AnyClassMethod'] = None, + __cls_kwargs__: Dict[str, Any] = None, + **field_definitions: Any, +) -> Type['Model']: + ... + + +def create_model( + __model_name: str, + *, + __config__: Optional[Type[BaseConfig]] = None, + __base__: Union[None, Type['Model'], Tuple[Type['Model'], ...]] = None, + __module__: str = __name__, + __validators__: Dict[str, 'AnyClassMethod'] = None, + __cls_kwargs__: Dict[str, Any] = None, + __slots__: Optional[Tuple[str, ...]] = None, + **field_definitions: Any, +) -> Type['Model']: + """ + Dynamically create a model. + :param __model_name: name of the created model + :param __config__: config class to use for the new model + :param __base__: base class for the new model to inherit from + :param __module__: module of the created model + :param __validators__: a dict of method names and @validator class methods + :param __cls_kwargs__: a dict for class creation + :param __slots__: Deprecated, `__slots__` should not be passed to `create_model` + :param field_definitions: fields of the model (or extra fields if a base is supplied) + in the format `=(, )` or `=, e.g. + `foobar=(str, ...)` or `foobar=123`, or, for complex use-cases, in the format + `=` or `=(, )`, e.g. + `foo=Field(datetime, default_factory=datetime.utcnow, alias='bar')` or + `foo=(str, FieldInfo(title='Foo'))` + """ + if __slots__ is not None: + # __slots__ will be ignored from here on + warnings.warn('__slots__ should not be passed to create_model', RuntimeWarning) + + if __base__ is not None: + if __config__ is not None: + raise ConfigError('to avoid confusion __config__ and __base__ cannot be used together') + if not isinstance(__base__, tuple): + __base__ = (__base__,) + else: + __base__ = (cast(Type['Model'], BaseModel),) + + __cls_kwargs__ = __cls_kwargs__ or {} + + fields = {} + annotations = {} + + for f_name, f_def in field_definitions.items(): + if not is_valid_field(f_name): + warnings.warn(f'fields may not start with an underscore, ignoring "{f_name}"', RuntimeWarning) + if isinstance(f_def, tuple): + try: + f_annotation, f_value = f_def + except ValueError as e: + raise ConfigError( + 'field definitions should either be a tuple of (, ) or just a ' + 'default value, unfortunately this means tuples as ' + 'default values are not allowed' + ) from e + else: + f_annotation, f_value = None, f_def + + if f_annotation: + annotations[f_name] = f_annotation + fields[f_name] = f_value + + namespace: 'DictStrAny' = {'__annotations__': annotations, '__module__': __module__} + if __validators__: + namespace.update(__validators__) + namespace.update(fields) + if __config__: + namespace['Config'] = inherit_config(__config__, BaseConfig) + resolved_bases = resolve_bases(__base__) + meta, ns, kwds = prepare_class(__model_name, resolved_bases, kwds=__cls_kwargs__) + if resolved_bases is not __base__: + ns['__orig_bases__'] = __base__ + namespace.update(ns) + return meta(__model_name, resolved_bases, namespace, **kwds) + + +_missing = object() + + +def validate_model( # noqa: C901 (ignore complexity) + model: Type[BaseModel], input_data: 'DictStrAny', cls: 'ModelOrDc' = None +) -> Tuple['DictStrAny', 'SetStr', Optional[ValidationError]]: + """ + validate data against a model. + """ + values = {} + errors = [] + # input_data names, possibly alias + names_used = set() + # field names, never aliases + fields_set = set() + config = model.__config__ + check_extra = config.extra is not Extra.ignore + cls_ = cls or model + + for validator in model.__pre_root_validators__: + try: + input_data = validator(cls_, input_data) + except (ValueError, TypeError, AssertionError) as exc: + return {}, set(), ValidationError([ErrorWrapper(exc, loc=ROOT_KEY)], cls_) + + for name, field in model.__fields__.items(): + value = input_data.get(field.alias, _missing) + using_name = False + if value is _missing and config.allow_population_by_field_name and field.alt_alias: + value = input_data.get(field.name, _missing) + using_name = True + + if value is _missing: + if field.required: + errors.append(ErrorWrapper(MissingError(), loc=field.alias)) + continue + + value = field.get_default() + + if not config.validate_all and not field.validate_always: + values[name] = value + continue + else: + fields_set.add(name) + if check_extra: + names_used.add(field.name if using_name else field.alias) + + v_, errors_ = field.validate(value, values, loc=field.alias, cls=cls_) + if isinstance(errors_, ErrorWrapper): + errors.append(errors_) + elif isinstance(errors_, list): + errors.extend(errors_) + else: + values[name] = v_ + + if check_extra: + if isinstance(input_data, GetterDict): + extra = input_data.extra_keys() - names_used + else: + extra = input_data.keys() - names_used + if extra: + fields_set |= extra + if config.extra is Extra.allow: + for f in extra: + values[f] = input_data[f] + else: + for f in sorted(extra): + errors.append(ErrorWrapper(ExtraError(), loc=f)) + + for skip_on_failure, validator in model.__post_root_validators__: + if skip_on_failure and errors: + continue + try: + values = validator(cls_, values) + except (ValueError, TypeError, AssertionError) as exc: + errors.append(ErrorWrapper(exc, loc=ROOT_KEY)) + + if errors: + return values, fields_set, ValidationError(errors, cls_) + else: + return values, fields_set, None diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/mypy.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/mypy.py new file mode 100644 index 0000000000000000000000000000000000000000..f4e27ab4b707f27c2e49031847b7affb7f49fe2d --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/mypy.py @@ -0,0 +1,949 @@ +import sys +from configparser import ConfigParser +from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type as TypingType, Union + +from mypy.errorcodes import ErrorCode +from mypy.nodes import ( + ARG_NAMED, + ARG_NAMED_OPT, + ARG_OPT, + ARG_POS, + ARG_STAR2, + MDEF, + Argument, + AssignmentStmt, + Block, + CallExpr, + ClassDef, + Context, + Decorator, + EllipsisExpr, + FuncBase, + FuncDef, + JsonDict, + MemberExpr, + NameExpr, + PassStmt, + PlaceholderNode, + RefExpr, + StrExpr, + SymbolNode, + SymbolTableNode, + TempNode, + TypeInfo, + TypeVarExpr, + Var, +) +from mypy.options import Options +from mypy.plugin import ( + CheckerPluginInterface, + ClassDefContext, + FunctionContext, + MethodContext, + Plugin, + ReportConfigContext, + SemanticAnalyzerPluginInterface, +) +from mypy.plugins import dataclasses +from mypy.semanal import set_callable_name # type: ignore +from mypy.server.trigger import make_wildcard_trigger +from mypy.types import ( + AnyType, + CallableType, + Instance, + NoneType, + Overloaded, + ProperType, + Type, + TypeOfAny, + TypeType, + TypeVarId, + TypeVarType, + UnionType, + get_proper_type, +) +from mypy.typevars import fill_typevars +from mypy.util import get_unique_redefinition_name +from mypy.version import __version__ as mypy_version + +from pydantic.v1.utils import is_valid_field + +try: + from mypy.types import TypeVarDef # type: ignore[attr-defined] +except ImportError: # pragma: no cover + # Backward-compatible with TypeVarDef from Mypy 0.910. + from mypy.types import TypeVarType as TypeVarDef + +CONFIGFILE_KEY = 'pydantic-mypy' +METADATA_KEY = 'pydantic-mypy-metadata' +_NAMESPACE = __name__[:-5] # 'pydantic' in 1.10.X, 'pydantic.v1' in v2.X +BASEMODEL_FULLNAME = f'{_NAMESPACE}.main.BaseModel' +BASESETTINGS_FULLNAME = f'{_NAMESPACE}.env_settings.BaseSettings' +MODEL_METACLASS_FULLNAME = f'{_NAMESPACE}.main.ModelMetaclass' +FIELD_FULLNAME = f'{_NAMESPACE}.fields.Field' +DATACLASS_FULLNAME = f'{_NAMESPACE}.dataclasses.dataclass' + + +def parse_mypy_version(version: str) -> Tuple[int, ...]: + return tuple(map(int, version.partition('+')[0].split('.'))) + + +MYPY_VERSION_TUPLE = parse_mypy_version(mypy_version) +BUILTINS_NAME = 'builtins' if MYPY_VERSION_TUPLE >= (0, 930) else '__builtins__' + +# Increment version if plugin changes and mypy caches should be invalidated +__version__ = 2 + + +def plugin(version: str) -> 'TypingType[Plugin]': + """ + `version` is the mypy version string + + We might want to use this to print a warning if the mypy version being used is + newer, or especially older, than we expect (or need). + """ + return PydanticPlugin + + +class PydanticPlugin(Plugin): + def __init__(self, options: Options) -> None: + self.plugin_config = PydanticPluginConfig(options) + self._plugin_data = self.plugin_config.to_data() + super().__init__(options) + + def get_base_class_hook(self, fullname: str) -> 'Optional[Callable[[ClassDefContext], None]]': + sym = self.lookup_fully_qualified(fullname) + if sym and isinstance(sym.node, TypeInfo): # pragma: no branch + # No branching may occur if the mypy cache has not been cleared + if any(get_fullname(base) == BASEMODEL_FULLNAME for base in sym.node.mro): + return self._pydantic_model_class_maker_callback + return None + + def get_metaclass_hook(self, fullname: str) -> Optional[Callable[[ClassDefContext], None]]: + if fullname == MODEL_METACLASS_FULLNAME: + return self._pydantic_model_metaclass_marker_callback + return None + + def get_function_hook(self, fullname: str) -> 'Optional[Callable[[FunctionContext], Type]]': + sym = self.lookup_fully_qualified(fullname) + if sym and sym.fullname == FIELD_FULLNAME: + return self._pydantic_field_callback + return None + + def get_method_hook(self, fullname: str) -> Optional[Callable[[MethodContext], Type]]: + if fullname.endswith('.from_orm'): + return from_orm_callback + return None + + def get_class_decorator_hook(self, fullname: str) -> Optional[Callable[[ClassDefContext], None]]: + """Mark pydantic.dataclasses as dataclass. + + Mypy version 1.1.1 added support for `@dataclass_transform` decorator. + """ + if fullname == DATACLASS_FULLNAME and MYPY_VERSION_TUPLE < (1, 1): + return dataclasses.dataclass_class_maker_callback # type: ignore[return-value] + return None + + def report_config_data(self, ctx: ReportConfigContext) -> Dict[str, Any]: + """Return all plugin config data. + + Used by mypy to determine if cache needs to be discarded. + """ + return self._plugin_data + + def _pydantic_model_class_maker_callback(self, ctx: ClassDefContext) -> None: + transformer = PydanticModelTransformer(ctx, self.plugin_config) + transformer.transform() + + def _pydantic_model_metaclass_marker_callback(self, ctx: ClassDefContext) -> None: + """Reset dataclass_transform_spec attribute of ModelMetaclass. + + Let the plugin handle it. This behavior can be disabled + if 'debug_dataclass_transform' is set to True', for testing purposes. + """ + if self.plugin_config.debug_dataclass_transform: + return + info_metaclass = ctx.cls.info.declared_metaclass + assert info_metaclass, "callback not passed from 'get_metaclass_hook'" + if getattr(info_metaclass.type, 'dataclass_transform_spec', None): + info_metaclass.type.dataclass_transform_spec = None # type: ignore[attr-defined] + + def _pydantic_field_callback(self, ctx: FunctionContext) -> 'Type': + """ + Extract the type of the `default` argument from the Field function, and use it as the return type. + + In particular: + * Check whether the default and default_factory argument is specified. + * Output an error if both are specified. + * Retrieve the type of the argument which is specified, and use it as return type for the function. + """ + default_any_type = ctx.default_return_type + + assert ctx.callee_arg_names[0] == 'default', '"default" is no longer first argument in Field()' + assert ctx.callee_arg_names[1] == 'default_factory', '"default_factory" is no longer second argument in Field()' + default_args = ctx.args[0] + default_factory_args = ctx.args[1] + + if default_args and default_factory_args: + error_default_and_default_factory_specified(ctx.api, ctx.context) + return default_any_type + + if default_args: + default_type = ctx.arg_types[0][0] + default_arg = default_args[0] + + # Fallback to default Any type if the field is required + if not isinstance(default_arg, EllipsisExpr): + return default_type + + elif default_factory_args: + default_factory_type = ctx.arg_types[1][0] + + # Functions which use `ParamSpec` can be overloaded, exposing the callable's types as a parameter + # Pydantic calls the default factory without any argument, so we retrieve the first item + if isinstance(default_factory_type, Overloaded): + if MYPY_VERSION_TUPLE > (0, 910): + default_factory_type = default_factory_type.items[0] + else: + # Mypy0.910 exposes the items of overloaded types in a function + default_factory_type = default_factory_type.items()[0] # type: ignore[operator] + + if isinstance(default_factory_type, CallableType): + ret_type = default_factory_type.ret_type + # mypy doesn't think `ret_type` has `args`, you'd think mypy should know, + # add this check in case it varies by version + args = getattr(ret_type, 'args', None) + if args: + if all(isinstance(arg, TypeVarType) for arg in args): + # Looks like the default factory is a type like `list` or `dict`, replace all args with `Any` + ret_type.args = tuple(default_any_type for _ in args) # type: ignore[attr-defined] + return ret_type + + return default_any_type + + +class PydanticPluginConfig: + __slots__ = ( + 'init_forbid_extra', + 'init_typed', + 'warn_required_dynamic_aliases', + 'warn_untyped_fields', + 'debug_dataclass_transform', + ) + init_forbid_extra: bool + init_typed: bool + warn_required_dynamic_aliases: bool + warn_untyped_fields: bool + debug_dataclass_transform: bool # undocumented + + def __init__(self, options: Options) -> None: + if options.config_file is None: # pragma: no cover + return + + toml_config = parse_toml(options.config_file) + if toml_config is not None: + config = toml_config.get('tool', {}).get('pydantic-mypy', {}) + for key in self.__slots__: + setting = config.get(key, False) + if not isinstance(setting, bool): + raise ValueError(f'Configuration value must be a boolean for key: {key}') + setattr(self, key, setting) + else: + plugin_config = ConfigParser() + plugin_config.read(options.config_file) + for key in self.__slots__: + setting = plugin_config.getboolean(CONFIGFILE_KEY, key, fallback=False) + setattr(self, key, setting) + + def to_data(self) -> Dict[str, Any]: + return {key: getattr(self, key) for key in self.__slots__} + + +def from_orm_callback(ctx: MethodContext) -> Type: + """ + Raise an error if orm_mode is not enabled + """ + model_type: Instance + ctx_type = ctx.type + if isinstance(ctx_type, TypeType): + ctx_type = ctx_type.item + if isinstance(ctx_type, CallableType) and isinstance(ctx_type.ret_type, Instance): + model_type = ctx_type.ret_type # called on the class + elif isinstance(ctx_type, Instance): + model_type = ctx_type # called on an instance (unusual, but still valid) + else: # pragma: no cover + detail = f'ctx.type: {ctx_type} (of type {ctx_type.__class__.__name__})' + error_unexpected_behavior(detail, ctx.api, ctx.context) + return ctx.default_return_type + pydantic_metadata = model_type.type.metadata.get(METADATA_KEY) + if pydantic_metadata is None: + return ctx.default_return_type + orm_mode = pydantic_metadata.get('config', {}).get('orm_mode') + if orm_mode is not True: + error_from_orm(get_name(model_type.type), ctx.api, ctx.context) + return ctx.default_return_type + + +class PydanticModelTransformer: + tracked_config_fields: Set[str] = { + 'extra', + 'allow_mutation', + 'frozen', + 'orm_mode', + 'allow_population_by_field_name', + 'alias_generator', + } + + def __init__(self, ctx: ClassDefContext, plugin_config: PydanticPluginConfig) -> None: + self._ctx = ctx + self.plugin_config = plugin_config + + def transform(self) -> None: + """ + Configures the BaseModel subclass according to the plugin settings. + + In particular: + * determines the model config and fields, + * adds a fields-aware signature for the initializer and construct methods + * freezes the class if allow_mutation = False or frozen = True + * stores the fields, config, and if the class is settings in the mypy metadata for access by subclasses + """ + ctx = self._ctx + info = ctx.cls.info + + self.adjust_validator_signatures() + config = self.collect_config() + fields = self.collect_fields(config) + is_settings = any(get_fullname(base) == BASESETTINGS_FULLNAME for base in info.mro[:-1]) + self.add_initializer(fields, config, is_settings) + self.add_construct_method(fields) + self.set_frozen(fields, frozen=config.allow_mutation is False or config.frozen is True) + info.metadata[METADATA_KEY] = { + 'fields': {field.name: field.serialize() for field in fields}, + 'config': config.set_values_dict(), + } + + def adjust_validator_signatures(self) -> None: + """When we decorate a function `f` with `pydantic.validator(...), mypy sees + `f` as a regular method taking a `self` instance, even though pydantic + internally wraps `f` with `classmethod` if necessary. + + Teach mypy this by marking any function whose outermost decorator is a + `validator()` call as a classmethod. + """ + for name, sym in self._ctx.cls.info.names.items(): + if isinstance(sym.node, Decorator): + first_dec = sym.node.original_decorators[0] + if ( + isinstance(first_dec, CallExpr) + and isinstance(first_dec.callee, NameExpr) + and first_dec.callee.fullname == f'{_NAMESPACE}.class_validators.validator' + ): + sym.node.func.is_class = True + + def collect_config(self) -> 'ModelConfigData': + """ + Collects the values of the config attributes that are used by the plugin, accounting for parent classes. + """ + ctx = self._ctx + cls = ctx.cls + config = ModelConfigData() + for stmt in cls.defs.body: + if not isinstance(stmt, ClassDef): + continue + if stmt.name == 'Config': + for substmt in stmt.defs.body: + if not isinstance(substmt, AssignmentStmt): + continue + config.update(self.get_config_update(substmt)) + if ( + config.has_alias_generator + and not config.allow_population_by_field_name + and self.plugin_config.warn_required_dynamic_aliases + ): + error_required_dynamic_aliases(ctx.api, stmt) + for info in cls.info.mro[1:]: # 0 is the current class + if METADATA_KEY not in info.metadata: + continue + + # Each class depends on the set of fields in its ancestors + ctx.api.add_plugin_dependency(make_wildcard_trigger(get_fullname(info))) + for name, value in info.metadata[METADATA_KEY]['config'].items(): + config.setdefault(name, value) + return config + + def collect_fields(self, model_config: 'ModelConfigData') -> List['PydanticModelField']: + """ + Collects the fields for the model, accounting for parent classes + """ + # First, collect fields belonging to the current class. + ctx = self._ctx + cls = self._ctx.cls + fields = [] # type: List[PydanticModelField] + known_fields = set() # type: Set[str] + for stmt in cls.defs.body: + if not isinstance(stmt, AssignmentStmt): # `and stmt.new_syntax` to require annotation + continue + + lhs = stmt.lvalues[0] + if not isinstance(lhs, NameExpr) or not is_valid_field(lhs.name): + continue + + if not stmt.new_syntax and self.plugin_config.warn_untyped_fields: + error_untyped_fields(ctx.api, stmt) + + # if lhs.name == '__config__': # BaseConfig not well handled; I'm not sure why yet + # continue + + sym = cls.info.names.get(lhs.name) + if sym is None: # pragma: no cover + # This is likely due to a star import (see the dataclasses plugin for a more detailed explanation) + # This is the same logic used in the dataclasses plugin + continue + + node = sym.node + if isinstance(node, PlaceholderNode): # pragma: no cover + # See the PlaceholderNode docstring for more detail about how this can occur + # Basically, it is an edge case when dealing with complex import logic + # This is the same logic used in the dataclasses plugin + continue + if not isinstance(node, Var): # pragma: no cover + # Don't know if this edge case still happens with the `is_valid_field` check above + # but better safe than sorry + continue + + # x: ClassVar[int] is ignored by dataclasses. + if node.is_classvar: + continue + + is_required = self.get_is_required(cls, stmt, lhs) + alias, has_dynamic_alias = self.get_alias_info(stmt) + if ( + has_dynamic_alias + and not model_config.allow_population_by_field_name + and self.plugin_config.warn_required_dynamic_aliases + ): + error_required_dynamic_aliases(ctx.api, stmt) + fields.append( + PydanticModelField( + name=lhs.name, + is_required=is_required, + alias=alias, + has_dynamic_alias=has_dynamic_alias, + line=stmt.line, + column=stmt.column, + ) + ) + known_fields.add(lhs.name) + all_fields = fields.copy() + for info in cls.info.mro[1:]: # 0 is the current class, -2 is BaseModel, -1 is object + if METADATA_KEY not in info.metadata: + continue + + superclass_fields = [] + # Each class depends on the set of fields in its ancestors + ctx.api.add_plugin_dependency(make_wildcard_trigger(get_fullname(info))) + + for name, data in info.metadata[METADATA_KEY]['fields'].items(): + if name not in known_fields: + field = PydanticModelField.deserialize(info, data) + known_fields.add(name) + superclass_fields.append(field) + else: + (field,) = (a for a in all_fields if a.name == name) + all_fields.remove(field) + superclass_fields.append(field) + all_fields = superclass_fields + all_fields + return all_fields + + def add_initializer(self, fields: List['PydanticModelField'], config: 'ModelConfigData', is_settings: bool) -> None: + """ + Adds a fields-aware `__init__` method to the class. + + The added `__init__` will be annotated with types vs. all `Any` depending on the plugin settings. + """ + ctx = self._ctx + typed = self.plugin_config.init_typed + use_alias = config.allow_population_by_field_name is not True + force_all_optional = is_settings or bool( + config.has_alias_generator and not config.allow_population_by_field_name + ) + init_arguments = self.get_field_arguments( + fields, typed=typed, force_all_optional=force_all_optional, use_alias=use_alias + ) + if not self.should_init_forbid_extra(fields, config): + var = Var('kwargs') + init_arguments.append(Argument(var, AnyType(TypeOfAny.explicit), None, ARG_STAR2)) + + if '__init__' not in ctx.cls.info.names: + add_method(ctx, '__init__', init_arguments, NoneType()) + + def add_construct_method(self, fields: List['PydanticModelField']) -> None: + """ + Adds a fully typed `construct` classmethod to the class. + + Similar to the fields-aware __init__ method, but always uses the field names (not aliases), + and does not treat settings fields as optional. + """ + ctx = self._ctx + set_str = ctx.api.named_type(f'{BUILTINS_NAME}.set', [ctx.api.named_type(f'{BUILTINS_NAME}.str')]) + optional_set_str = UnionType([set_str, NoneType()]) + fields_set_argument = Argument(Var('_fields_set', optional_set_str), optional_set_str, None, ARG_OPT) + construct_arguments = self.get_field_arguments(fields, typed=True, force_all_optional=False, use_alias=False) + construct_arguments = [fields_set_argument] + construct_arguments + + obj_type = ctx.api.named_type(f'{BUILTINS_NAME}.object') + self_tvar_name = '_PydanticBaseModel' # Make sure it does not conflict with other names in the class + tvar_fullname = ctx.cls.fullname + '.' + self_tvar_name + if MYPY_VERSION_TUPLE >= (1, 4): + tvd = TypeVarType( + self_tvar_name, + tvar_fullname, + ( + TypeVarId(-1, namespace=ctx.cls.fullname + '.construct') + if MYPY_VERSION_TUPLE >= (1, 11) + else TypeVarId(-1) + ), + [], + obj_type, + AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type] + ) + self_tvar_expr = TypeVarExpr( + self_tvar_name, + tvar_fullname, + [], + obj_type, + AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type] + ) + else: + tvd = TypeVarDef(self_tvar_name, tvar_fullname, -1, [], obj_type) + self_tvar_expr = TypeVarExpr(self_tvar_name, tvar_fullname, [], obj_type) + ctx.cls.info.names[self_tvar_name] = SymbolTableNode(MDEF, self_tvar_expr) + + # Backward-compatible with TypeVarDef from Mypy 0.910. + if isinstance(tvd, TypeVarType): + self_type = tvd + else: + self_type = TypeVarType(tvd) + + add_method( + ctx, + 'construct', + construct_arguments, + return_type=self_type, + self_type=self_type, + tvar_def=tvd, + is_classmethod=True, + ) + + def set_frozen(self, fields: List['PydanticModelField'], frozen: bool) -> None: + """ + Marks all fields as properties so that attempts to set them trigger mypy errors. + + This is the same approach used by the attrs and dataclasses plugins. + """ + ctx = self._ctx + info = ctx.cls.info + for field in fields: + sym_node = info.names.get(field.name) + if sym_node is not None: + var = sym_node.node + if isinstance(var, Var): + var.is_property = frozen + elif isinstance(var, PlaceholderNode) and not ctx.api.final_iteration: + # See https://github.com/pydantic/pydantic/issues/5191 to hit this branch for test coverage + ctx.api.defer() + else: # pragma: no cover + # I don't know whether it's possible to hit this branch, but I've added it for safety + try: + var_str = str(var) + except TypeError: + # This happens for PlaceholderNode; perhaps it will happen for other types in the future.. + var_str = repr(var) + detail = f'sym_node.node: {var_str} (of type {var.__class__})' + error_unexpected_behavior(detail, ctx.api, ctx.cls) + else: + var = field.to_var(info, use_alias=False) + var.info = info + var.is_property = frozen + var._fullname = get_fullname(info) + '.' + get_name(var) + info.names[get_name(var)] = SymbolTableNode(MDEF, var) + + def get_config_update(self, substmt: AssignmentStmt) -> Optional['ModelConfigData']: + """ + Determines the config update due to a single statement in the Config class definition. + + Warns if a tracked config attribute is set to a value the plugin doesn't know how to interpret (e.g., an int) + """ + lhs = substmt.lvalues[0] + if not (isinstance(lhs, NameExpr) and lhs.name in self.tracked_config_fields): + return None + if lhs.name == 'extra': + if isinstance(substmt.rvalue, StrExpr): + forbid_extra = substmt.rvalue.value == 'forbid' + elif isinstance(substmt.rvalue, MemberExpr): + forbid_extra = substmt.rvalue.name == 'forbid' + else: + error_invalid_config_value(lhs.name, self._ctx.api, substmt) + return None + return ModelConfigData(forbid_extra=forbid_extra) + if lhs.name == 'alias_generator': + has_alias_generator = True + if isinstance(substmt.rvalue, NameExpr) and substmt.rvalue.fullname == 'builtins.None': + has_alias_generator = False + return ModelConfigData(has_alias_generator=has_alias_generator) + if isinstance(substmt.rvalue, NameExpr) and substmt.rvalue.fullname in ('builtins.True', 'builtins.False'): + return ModelConfigData(**{lhs.name: substmt.rvalue.fullname == 'builtins.True'}) + error_invalid_config_value(lhs.name, self._ctx.api, substmt) + return None + + @staticmethod + def get_is_required(cls: ClassDef, stmt: AssignmentStmt, lhs: NameExpr) -> bool: + """ + Returns a boolean indicating whether the field defined in `stmt` is a required field. + """ + expr = stmt.rvalue + if isinstance(expr, TempNode): + # TempNode means annotation-only, so only non-required if Optional + value_type = get_proper_type(cls.info[lhs.name].type) + return not PydanticModelTransformer.type_has_implicit_default(value_type) + if isinstance(expr, CallExpr) and isinstance(expr.callee, RefExpr) and expr.callee.fullname == FIELD_FULLNAME: + # The "default value" is a call to `Field`; at this point, the field is + # only required if default is Ellipsis (i.e., `field_name: Annotation = Field(...)`) or if default_factory + # is specified. + for arg, name in zip(expr.args, expr.arg_names): + # If name is None, then this arg is the default because it is the only positional argument. + if name is None or name == 'default': + return arg.__class__ is EllipsisExpr + if name == 'default_factory': + return False + # In this case, default and default_factory are not specified, so we need to look at the annotation + value_type = get_proper_type(cls.info[lhs.name].type) + return not PydanticModelTransformer.type_has_implicit_default(value_type) + # Only required if the "default value" is Ellipsis (i.e., `field_name: Annotation = ...`) + return isinstance(expr, EllipsisExpr) + + @staticmethod + def type_has_implicit_default(type_: Optional[ProperType]) -> bool: + """ + Returns True if the passed type will be given an implicit default value. + + In pydantic v1, this is the case for Optional types and Any (with default value None). + """ + if isinstance(type_, AnyType): + # Annotated as Any + return True + if isinstance(type_, UnionType) and any( + isinstance(item, NoneType) or isinstance(item, AnyType) for item in type_.items + ): + # Annotated as Optional, or otherwise having NoneType or AnyType in the union + return True + return False + + @staticmethod + def get_alias_info(stmt: AssignmentStmt) -> Tuple[Optional[str], bool]: + """ + Returns a pair (alias, has_dynamic_alias), extracted from the declaration of the field defined in `stmt`. + + `has_dynamic_alias` is True if and only if an alias is provided, but not as a string literal. + If `has_dynamic_alias` is True, `alias` will be None. + """ + expr = stmt.rvalue + if isinstance(expr, TempNode): + # TempNode means annotation-only + return None, False + + if not ( + isinstance(expr, CallExpr) and isinstance(expr.callee, RefExpr) and expr.callee.fullname == FIELD_FULLNAME + ): + # Assigned value is not a call to pydantic.fields.Field + return None, False + + for i, arg_name in enumerate(expr.arg_names): + if arg_name != 'alias': + continue + arg = expr.args[i] + if isinstance(arg, StrExpr): + return arg.value, False + else: + return None, True + return None, False + + def get_field_arguments( + self, fields: List['PydanticModelField'], typed: bool, force_all_optional: bool, use_alias: bool + ) -> List[Argument]: + """ + Helper function used during the construction of the `__init__` and `construct` method signatures. + + Returns a list of mypy Argument instances for use in the generated signatures. + """ + info = self._ctx.cls.info + arguments = [ + field.to_argument(info, typed=typed, force_optional=force_all_optional, use_alias=use_alias) + for field in fields + if not (use_alias and field.has_dynamic_alias) + ] + return arguments + + def should_init_forbid_extra(self, fields: List['PydanticModelField'], config: 'ModelConfigData') -> bool: + """ + Indicates whether the generated `__init__` should get a `**kwargs` at the end of its signature + + We disallow arbitrary kwargs if the extra config setting is "forbid", or if the plugin config says to, + *unless* a required dynamic alias is present (since then we can't determine a valid signature). + """ + if not config.allow_population_by_field_name: + if self.is_dynamic_alias_present(fields, bool(config.has_alias_generator)): + return False + if config.forbid_extra: + return True + return self.plugin_config.init_forbid_extra + + @staticmethod + def is_dynamic_alias_present(fields: List['PydanticModelField'], has_alias_generator: bool) -> bool: + """ + Returns whether any fields on the model have a "dynamic alias", i.e., an alias that cannot be + determined during static analysis. + """ + for field in fields: + if field.has_dynamic_alias: + return True + if has_alias_generator: + for field in fields: + if field.alias is None: + return True + return False + + +class PydanticModelField: + def __init__( + self, name: str, is_required: bool, alias: Optional[str], has_dynamic_alias: bool, line: int, column: int + ): + self.name = name + self.is_required = is_required + self.alias = alias + self.has_dynamic_alias = has_dynamic_alias + self.line = line + self.column = column + + def to_var(self, info: TypeInfo, use_alias: bool) -> Var: + name = self.name + if use_alias and self.alias is not None: + name = self.alias + return Var(name, info[self.name].type) + + def to_argument(self, info: TypeInfo, typed: bool, force_optional: bool, use_alias: bool) -> Argument: + if typed and info[self.name].type is not None: + type_annotation = info[self.name].type + else: + type_annotation = AnyType(TypeOfAny.explicit) + return Argument( + variable=self.to_var(info, use_alias), + type_annotation=type_annotation, + initializer=None, + kind=ARG_NAMED_OPT if force_optional or not self.is_required else ARG_NAMED, + ) + + def serialize(self) -> JsonDict: + return self.__dict__ + + @classmethod + def deserialize(cls, info: TypeInfo, data: JsonDict) -> 'PydanticModelField': + return cls(**data) + + +class ModelConfigData: + def __init__( + self, + forbid_extra: Optional[bool] = None, + allow_mutation: Optional[bool] = None, + frozen: Optional[bool] = None, + orm_mode: Optional[bool] = None, + allow_population_by_field_name: Optional[bool] = None, + has_alias_generator: Optional[bool] = None, + ): + self.forbid_extra = forbid_extra + self.allow_mutation = allow_mutation + self.frozen = frozen + self.orm_mode = orm_mode + self.allow_population_by_field_name = allow_population_by_field_name + self.has_alias_generator = has_alias_generator + + def set_values_dict(self) -> Dict[str, Any]: + return {k: v for k, v in self.__dict__.items() if v is not None} + + def update(self, config: Optional['ModelConfigData']) -> None: + if config is None: + return + for k, v in config.set_values_dict().items(): + setattr(self, k, v) + + def setdefault(self, key: str, value: Any) -> None: + if getattr(self, key) is None: + setattr(self, key, value) + + +ERROR_ORM = ErrorCode('pydantic-orm', 'Invalid from_orm call', 'Pydantic') +ERROR_CONFIG = ErrorCode('pydantic-config', 'Invalid config value', 'Pydantic') +ERROR_ALIAS = ErrorCode('pydantic-alias', 'Dynamic alias disallowed', 'Pydantic') +ERROR_UNEXPECTED = ErrorCode('pydantic-unexpected', 'Unexpected behavior', 'Pydantic') +ERROR_UNTYPED = ErrorCode('pydantic-field', 'Untyped field disallowed', 'Pydantic') +ERROR_FIELD_DEFAULTS = ErrorCode('pydantic-field', 'Invalid Field defaults', 'Pydantic') + + +def error_from_orm(model_name: str, api: CheckerPluginInterface, context: Context) -> None: + api.fail(f'"{model_name}" does not have orm_mode=True', context, code=ERROR_ORM) + + +def error_invalid_config_value(name: str, api: SemanticAnalyzerPluginInterface, context: Context) -> None: + api.fail(f'Invalid value for "Config.{name}"', context, code=ERROR_CONFIG) + + +def error_required_dynamic_aliases(api: SemanticAnalyzerPluginInterface, context: Context) -> None: + api.fail('Required dynamic aliases disallowed', context, code=ERROR_ALIAS) + + +def error_unexpected_behavior( + detail: str, api: Union[CheckerPluginInterface, SemanticAnalyzerPluginInterface], context: Context +) -> None: # pragma: no cover + # Can't think of a good way to test this, but I confirmed it renders as desired by adding to a non-error path + link = 'https://github.com/pydantic/pydantic/issues/new/choose' + full_message = f'The pydantic mypy plugin ran into unexpected behavior: {detail}\n' + full_message += f'Please consider reporting this bug at {link} so we can try to fix it!' + api.fail(full_message, context, code=ERROR_UNEXPECTED) + + +def error_untyped_fields(api: SemanticAnalyzerPluginInterface, context: Context) -> None: + api.fail('Untyped fields disallowed', context, code=ERROR_UNTYPED) + + +def error_default_and_default_factory_specified(api: CheckerPluginInterface, context: Context) -> None: + api.fail('Field default and default_factory cannot be specified together', context, code=ERROR_FIELD_DEFAULTS) + + +def add_method( + ctx: ClassDefContext, + name: str, + args: List[Argument], + return_type: Type, + self_type: Optional[Type] = None, + tvar_def: Optional[TypeVarDef] = None, + is_classmethod: bool = False, + is_new: bool = False, + # is_staticmethod: bool = False, +) -> None: + """ + Adds a new method to a class. + + This can be dropped if/when https://github.com/python/mypy/issues/7301 is merged + """ + info = ctx.cls.info + + # First remove any previously generated methods with the same name + # to avoid clashes and problems in the semantic analyzer. + if name in info.names: + sym = info.names[name] + if sym.plugin_generated and isinstance(sym.node, FuncDef): + ctx.cls.defs.body.remove(sym.node) # pragma: no cover + + self_type = self_type or fill_typevars(info) + if is_classmethod or is_new: + first = [Argument(Var('_cls'), TypeType.make_normalized(self_type), None, ARG_POS)] + # elif is_staticmethod: + # first = [] + else: + self_type = self_type or fill_typevars(info) + first = [Argument(Var('__pydantic_self__'), self_type, None, ARG_POS)] + args = first + args + arg_types, arg_names, arg_kinds = [], [], [] + for arg in args: + assert arg.type_annotation, 'All arguments must be fully typed.' + arg_types.append(arg.type_annotation) + arg_names.append(get_name(arg.variable)) + arg_kinds.append(arg.kind) + + function_type = ctx.api.named_type(f'{BUILTINS_NAME}.function') + signature = CallableType(arg_types, arg_kinds, arg_names, return_type, function_type) + if tvar_def: + signature.variables = [tvar_def] + + func = FuncDef(name, args, Block([PassStmt()])) + func.info = info + func.type = set_callable_name(signature, func) + func.is_class = is_classmethod + # func.is_static = is_staticmethod + func._fullname = get_fullname(info) + '.' + name + func.line = info.line + + # NOTE: we would like the plugin generated node to dominate, but we still + # need to keep any existing definitions so they get semantically analyzed. + if name in info.names: + # Get a nice unique name instead. + r_name = get_unique_redefinition_name(name, info.names) + info.names[r_name] = info.names[name] + + if is_classmethod: # or is_staticmethod: + func.is_decorated = True + v = Var(name, func.type) + v.info = info + v._fullname = func._fullname + # if is_classmethod: + v.is_classmethod = True + dec = Decorator(func, [NameExpr('classmethod')], v) + # else: + # v.is_staticmethod = True + # dec = Decorator(func, [NameExpr('staticmethod')], v) + + dec.line = info.line + sym = SymbolTableNode(MDEF, dec) + else: + sym = SymbolTableNode(MDEF, func) + sym.plugin_generated = True + + info.names[name] = sym + info.defn.defs.body.append(func) + + +def get_fullname(x: Union[FuncBase, SymbolNode]) -> str: + """ + Used for compatibility with mypy 0.740; can be dropped once support for 0.740 is dropped. + """ + fn = x.fullname + if callable(fn): # pragma: no cover + return fn() + return fn + + +def get_name(x: Union[FuncBase, SymbolNode]) -> str: + """ + Used for compatibility with mypy 0.740; can be dropped once support for 0.740 is dropped. + """ + fn = x.name + if callable(fn): # pragma: no cover + return fn() + return fn + + +def parse_toml(config_file: str) -> Optional[Dict[str, Any]]: + if not config_file.endswith('.toml'): + return None + + read_mode = 'rb' + if sys.version_info >= (3, 11): + import tomllib as toml_ + else: + try: + import tomli as toml_ + except ImportError: + # older versions of mypy have toml as a dependency, not tomli + read_mode = 'r' + try: + import toml as toml_ # type: ignore[no-redef] + except ImportError: # pragma: no cover + import warnings + + warnings.warn('No TOML parser installed, cannot read configuration from `pyproject.toml`.') + return None + + with open(config_file, read_mode) as rf: + return toml_.load(rf) # type: ignore[arg-type] diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/networks.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/networks.py new file mode 100644 index 0000000000000000000000000000000000000000..ba07b74867b83beaaabc3afe2e19d77d71544338 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/networks.py @@ -0,0 +1,747 @@ +import re +from ipaddress import ( + IPv4Address, + IPv4Interface, + IPv4Network, + IPv6Address, + IPv6Interface, + IPv6Network, + _BaseAddress, + _BaseNetwork, +) +from typing import ( + TYPE_CHECKING, + Any, + Collection, + Dict, + Generator, + List, + Match, + Optional, + Pattern, + Set, + Tuple, + Type, + Union, + cast, + no_type_check, +) + +from pydantic.v1 import errors +from pydantic.v1.utils import Representation, update_not_none +from pydantic.v1.validators import constr_length_validator, str_validator + +if TYPE_CHECKING: + import email_validator + from typing_extensions import TypedDict + + from pydantic.v1.config import BaseConfig + from pydantic.v1.fields import ModelField + from pydantic.v1.typing import AnyCallable + + CallableGenerator = Generator[AnyCallable, None, None] + + class Parts(TypedDict, total=False): + scheme: str + user: Optional[str] + password: Optional[str] + ipv4: Optional[str] + ipv6: Optional[str] + domain: Optional[str] + port: Optional[str] + path: Optional[str] + query: Optional[str] + fragment: Optional[str] + + class HostParts(TypedDict, total=False): + host: str + tld: Optional[str] + host_type: Optional[str] + port: Optional[str] + rebuild: bool + +else: + email_validator = None + + class Parts(dict): + pass + + +NetworkType = Union[str, bytes, int, Tuple[Union[str, bytes, int], Union[str, int]]] + +__all__ = [ + 'AnyUrl', + 'AnyHttpUrl', + 'FileUrl', + 'HttpUrl', + 'stricturl', + 'EmailStr', + 'NameEmail', + 'IPvAnyAddress', + 'IPvAnyInterface', + 'IPvAnyNetwork', + 'PostgresDsn', + 'CockroachDsn', + 'AmqpDsn', + 'RedisDsn', + 'MongoDsn', + 'KafkaDsn', + 'validate_email', +] + +_url_regex_cache = None +_multi_host_url_regex_cache = None +_ascii_domain_regex_cache = None +_int_domain_regex_cache = None +_host_regex_cache = None + +_host_regex = ( + r'(?:' + r'(?P(?:\d{1,3}\.){3}\d{1,3})(?=$|[/:#?])|' # ipv4 + r'(?P\[[A-F0-9]*:[A-F0-9:]+\])(?=$|[/:#?])|' # ipv6 + r'(?P[^\s/:?#]+)' # domain, validation occurs later + r')?' + r'(?::(?P\d+))?' # port +) +_scheme_regex = r'(?:(?P[a-z][a-z0-9+\-.]+)://)?' # scheme https://tools.ietf.org/html/rfc3986#appendix-A +_user_info_regex = r'(?:(?P[^\s:/]*)(?::(?P[^\s/]*))?@)?' +_path_regex = r'(?P/[^\s?#]*)?' +_query_regex = r'(?:\?(?P[^\s#]*))?' +_fragment_regex = r'(?:#(?P[^\s#]*))?' + + +def url_regex() -> Pattern[str]: + global _url_regex_cache + if _url_regex_cache is None: + _url_regex_cache = re.compile( + rf'{_scheme_regex}{_user_info_regex}{_host_regex}{_path_regex}{_query_regex}{_fragment_regex}', + re.IGNORECASE, + ) + return _url_regex_cache + + +def multi_host_url_regex() -> Pattern[str]: + """ + Compiled multi host url regex. + + Additionally to `url_regex` it allows to match multiple hosts. + E.g. host1.db.net,host2.db.net + """ + global _multi_host_url_regex_cache + if _multi_host_url_regex_cache is None: + _multi_host_url_regex_cache = re.compile( + rf'{_scheme_regex}{_user_info_regex}' + r'(?P([^/]*))' # validation occurs later + rf'{_path_regex}{_query_regex}{_fragment_regex}', + re.IGNORECASE, + ) + return _multi_host_url_regex_cache + + +def ascii_domain_regex() -> Pattern[str]: + global _ascii_domain_regex_cache + if _ascii_domain_regex_cache is None: + ascii_chunk = r'[_0-9a-z](?:[-_0-9a-z]{0,61}[_0-9a-z])?' + ascii_domain_ending = r'(?P\.[a-z]{2,63})?\.?' + _ascii_domain_regex_cache = re.compile( + fr'(?:{ascii_chunk}\.)*?{ascii_chunk}{ascii_domain_ending}', re.IGNORECASE + ) + return _ascii_domain_regex_cache + + +def int_domain_regex() -> Pattern[str]: + global _int_domain_regex_cache + if _int_domain_regex_cache is None: + int_chunk = r'[_0-9a-\U00040000](?:[-_0-9a-\U00040000]{0,61}[_0-9a-\U00040000])?' + int_domain_ending = r'(?P(\.[^\W\d_]{2,63})|(\.(?:xn--)[_0-9a-z-]{2,63}))?\.?' + _int_domain_regex_cache = re.compile(fr'(?:{int_chunk}\.)*?{int_chunk}{int_domain_ending}', re.IGNORECASE) + return _int_domain_regex_cache + + +def host_regex() -> Pattern[str]: + global _host_regex_cache + if _host_regex_cache is None: + _host_regex_cache = re.compile( + _host_regex, + re.IGNORECASE, + ) + return _host_regex_cache + + +class AnyUrl(str): + strip_whitespace = True + min_length = 1 + max_length = 2**16 + allowed_schemes: Optional[Collection[str]] = None + tld_required: bool = False + user_required: bool = False + host_required: bool = True + hidden_parts: Set[str] = set() + + __slots__ = ('scheme', 'user', 'password', 'host', 'tld', 'host_type', 'port', 'path', 'query', 'fragment') + + @no_type_check + def __new__(cls, url: Optional[str], **kwargs) -> object: + return str.__new__(cls, cls.build(**kwargs) if url is None else url) + + def __init__( + self, + url: str, + *, + scheme: str, + user: Optional[str] = None, + password: Optional[str] = None, + host: Optional[str] = None, + tld: Optional[str] = None, + host_type: str = 'domain', + port: Optional[str] = None, + path: Optional[str] = None, + query: Optional[str] = None, + fragment: Optional[str] = None, + ) -> None: + str.__init__(url) + self.scheme = scheme + self.user = user + self.password = password + self.host = host + self.tld = tld + self.host_type = host_type + self.port = port + self.path = path + self.query = query + self.fragment = fragment + + @classmethod + def build( + cls, + *, + scheme: str, + user: Optional[str] = None, + password: Optional[str] = None, + host: str, + port: Optional[str] = None, + path: Optional[str] = None, + query: Optional[str] = None, + fragment: Optional[str] = None, + **_kwargs: str, + ) -> str: + parts = Parts( + scheme=scheme, + user=user, + password=password, + host=host, + port=port, + path=path, + query=query, + fragment=fragment, + **_kwargs, # type: ignore[misc] + ) + + url = scheme + '://' + if user: + url += user + if password: + url += ':' + password + if user or password: + url += '@' + url += host + if port and ('port' not in cls.hidden_parts or cls.get_default_parts(parts).get('port') != port): + url += ':' + port + if path: + url += path + if query: + url += '?' + query + if fragment: + url += '#' + fragment + return url + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none(field_schema, minLength=cls.min_length, maxLength=cls.max_length, format='uri') + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + + @classmethod + def validate(cls, value: Any, field: 'ModelField', config: 'BaseConfig') -> 'AnyUrl': + if value.__class__ == cls: + return value + value = str_validator(value) + if cls.strip_whitespace: + value = value.strip() + url: str = cast(str, constr_length_validator(value, field, config)) + + m = cls._match_url(url) + # the regex should always match, if it doesn't please report with details of the URL tried + assert m, 'URL regex failed unexpectedly' + + original_parts = cast('Parts', m.groupdict()) + parts = cls.apply_default_parts(original_parts) + parts = cls.validate_parts(parts) + + if m.end() != len(url): + raise errors.UrlExtraError(extra=url[m.end() :]) + + return cls._build_url(m, url, parts) + + @classmethod + def _build_url(cls, m: Match[str], url: str, parts: 'Parts') -> 'AnyUrl': + """ + Validate hosts and build the AnyUrl object. Split from `validate` so this method + can be altered in `MultiHostDsn`. + """ + host, tld, host_type, rebuild = cls.validate_host(parts) + + return cls( + None if rebuild else url, + scheme=parts['scheme'], + user=parts['user'], + password=parts['password'], + host=host, + tld=tld, + host_type=host_type, + port=parts['port'], + path=parts['path'], + query=parts['query'], + fragment=parts['fragment'], + ) + + @staticmethod + def _match_url(url: str) -> Optional[Match[str]]: + return url_regex().match(url) + + @staticmethod + def _validate_port(port: Optional[str]) -> None: + if port is not None and int(port) > 65_535: + raise errors.UrlPortError() + + @classmethod + def validate_parts(cls, parts: 'Parts', validate_port: bool = True) -> 'Parts': + """ + A method used to validate parts of a URL. + Could be overridden to set default values for parts if missing + """ + scheme = parts['scheme'] + if scheme is None: + raise errors.UrlSchemeError() + + if cls.allowed_schemes and scheme.lower() not in cls.allowed_schemes: + raise errors.UrlSchemePermittedError(set(cls.allowed_schemes)) + + if validate_port: + cls._validate_port(parts['port']) + + user = parts['user'] + if cls.user_required and user is None: + raise errors.UrlUserInfoError() + + return parts + + @classmethod + def validate_host(cls, parts: 'Parts') -> Tuple[str, Optional[str], str, bool]: + tld, host_type, rebuild = None, None, False + for f in ('domain', 'ipv4', 'ipv6'): + host = parts[f] # type: ignore[literal-required] + if host: + host_type = f + break + + if host is None: + if cls.host_required: + raise errors.UrlHostError() + elif host_type == 'domain': + is_international = False + d = ascii_domain_regex().fullmatch(host) + if d is None: + d = int_domain_regex().fullmatch(host) + if d is None: + raise errors.UrlHostError() + is_international = True + + tld = d.group('tld') + if tld is None and not is_international: + d = int_domain_regex().fullmatch(host) + assert d is not None + tld = d.group('tld') + is_international = True + + if tld is not None: + tld = tld[1:] + elif cls.tld_required: + raise errors.UrlHostTldError() + + if is_international: + host_type = 'int_domain' + rebuild = True + host = host.encode('idna').decode('ascii') + if tld is not None: + tld = tld.encode('idna').decode('ascii') + + return host, tld, host_type, rebuild # type: ignore + + @staticmethod + def get_default_parts(parts: 'Parts') -> 'Parts': + return {} + + @classmethod + def apply_default_parts(cls, parts: 'Parts') -> 'Parts': + for key, value in cls.get_default_parts(parts).items(): + if not parts[key]: # type: ignore[literal-required] + parts[key] = value # type: ignore[literal-required] + return parts + + def __repr__(self) -> str: + extra = ', '.join(f'{n}={getattr(self, n)!r}' for n in self.__slots__ if getattr(self, n) is not None) + return f'{self.__class__.__name__}({super().__repr__()}, {extra})' + + +class AnyHttpUrl(AnyUrl): + allowed_schemes = {'http', 'https'} + + __slots__ = () + + +class HttpUrl(AnyHttpUrl): + tld_required = True + # https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers + max_length = 2083 + hidden_parts = {'port'} + + @staticmethod + def get_default_parts(parts: 'Parts') -> 'Parts': + return {'port': '80' if parts['scheme'] == 'http' else '443'} + + +class FileUrl(AnyUrl): + allowed_schemes = {'file'} + host_required = False + + __slots__ = () + + +class MultiHostDsn(AnyUrl): + __slots__ = AnyUrl.__slots__ + ('hosts',) + + def __init__(self, *args: Any, hosts: Optional[List['HostParts']] = None, **kwargs: Any): + super().__init__(*args, **kwargs) + self.hosts = hosts + + @staticmethod + def _match_url(url: str) -> Optional[Match[str]]: + return multi_host_url_regex().match(url) + + @classmethod + def validate_parts(cls, parts: 'Parts', validate_port: bool = True) -> 'Parts': + return super().validate_parts(parts, validate_port=False) + + @classmethod + def _build_url(cls, m: Match[str], url: str, parts: 'Parts') -> 'MultiHostDsn': + hosts_parts: List['HostParts'] = [] + host_re = host_regex() + for host in m.groupdict()['hosts'].split(','): + d: Parts = host_re.match(host).groupdict() # type: ignore + host, tld, host_type, rebuild = cls.validate_host(d) + port = d.get('port') + cls._validate_port(port) + hosts_parts.append( + { + 'host': host, + 'host_type': host_type, + 'tld': tld, + 'rebuild': rebuild, + 'port': port, + } + ) + + if len(hosts_parts) > 1: + return cls( + None if any([hp['rebuild'] for hp in hosts_parts]) else url, + scheme=parts['scheme'], + user=parts['user'], + password=parts['password'], + path=parts['path'], + query=parts['query'], + fragment=parts['fragment'], + host_type=None, + hosts=hosts_parts, + ) + else: + # backwards compatibility with single host + host_part = hosts_parts[0] + return cls( + None if host_part['rebuild'] else url, + scheme=parts['scheme'], + user=parts['user'], + password=parts['password'], + host=host_part['host'], + tld=host_part['tld'], + host_type=host_part['host_type'], + port=host_part.get('port'), + path=parts['path'], + query=parts['query'], + fragment=parts['fragment'], + ) + + +class PostgresDsn(MultiHostDsn): + allowed_schemes = { + 'postgres', + 'postgresql', + 'postgresql+asyncpg', + 'postgresql+pg8000', + 'postgresql+psycopg', + 'postgresql+psycopg2', + 'postgresql+psycopg2cffi', + 'postgresql+py-postgresql', + 'postgresql+pygresql', + } + user_required = True + + __slots__ = () + + +class CockroachDsn(AnyUrl): + allowed_schemes = { + 'cockroachdb', + 'cockroachdb+psycopg2', + 'cockroachdb+asyncpg', + } + user_required = True + + +class AmqpDsn(AnyUrl): + allowed_schemes = {'amqp', 'amqps'} + host_required = False + + +class RedisDsn(AnyUrl): + __slots__ = () + allowed_schemes = {'redis', 'rediss'} + host_required = False + + @staticmethod + def get_default_parts(parts: 'Parts') -> 'Parts': + return { + 'domain': 'localhost' if not (parts['ipv4'] or parts['ipv6']) else '', + 'port': '6379', + 'path': '/0', + } + + +class MongoDsn(AnyUrl): + allowed_schemes = {'mongodb'} + + # TODO: Needed to generic "Parts" for "Replica Set", "Sharded Cluster", and other mongodb deployment modes + @staticmethod + def get_default_parts(parts: 'Parts') -> 'Parts': + return { + 'port': '27017', + } + + +class KafkaDsn(AnyUrl): + allowed_schemes = {'kafka'} + + @staticmethod + def get_default_parts(parts: 'Parts') -> 'Parts': + return { + 'domain': 'localhost', + 'port': '9092', + } + + +def stricturl( + *, + strip_whitespace: bool = True, + min_length: int = 1, + max_length: int = 2**16, + tld_required: bool = True, + host_required: bool = True, + allowed_schemes: Optional[Collection[str]] = None, +) -> Type[AnyUrl]: + # use kwargs then define conf in a dict to aid with IDE type hinting + namespace = dict( + strip_whitespace=strip_whitespace, + min_length=min_length, + max_length=max_length, + tld_required=tld_required, + host_required=host_required, + allowed_schemes=allowed_schemes, + ) + return type('UrlValue', (AnyUrl,), namespace) + + +def import_email_validator() -> None: + global email_validator + try: + import email_validator + except ImportError as e: + raise ImportError('email-validator is not installed, run `pip install pydantic[email]`') from e + + +class EmailStr(str): + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(type='string', format='email') + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + # included here and below so the error happens straight away + import_email_validator() + + yield str_validator + yield cls.validate + + @classmethod + def validate(cls, value: Union[str]) -> str: + return validate_email(value)[1] + + +class NameEmail(Representation): + __slots__ = 'name', 'email' + + def __init__(self, name: str, email: str): + self.name = name + self.email = email + + def __eq__(self, other: Any) -> bool: + return isinstance(other, NameEmail) and (self.name, self.email) == (other.name, other.email) + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(type='string', format='name-email') + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + import_email_validator() + + yield cls.validate + + @classmethod + def validate(cls, value: Any) -> 'NameEmail': + if value.__class__ == cls: + return value + value = str_validator(value) + return cls(*validate_email(value)) + + def __str__(self) -> str: + return f'{self.name} <{self.email}>' + + +class IPvAnyAddress(_BaseAddress): + __slots__ = () + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(type='string', format='ipvanyaddress') + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + + @classmethod + def validate(cls, value: Union[str, bytes, int]) -> Union[IPv4Address, IPv6Address]: + try: + return IPv4Address(value) + except ValueError: + pass + + try: + return IPv6Address(value) + except ValueError: + raise errors.IPvAnyAddressError() + + +class IPvAnyInterface(_BaseAddress): + __slots__ = () + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(type='string', format='ipvanyinterface') + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + + @classmethod + def validate(cls, value: NetworkType) -> Union[IPv4Interface, IPv6Interface]: + try: + return IPv4Interface(value) + except ValueError: + pass + + try: + return IPv6Interface(value) + except ValueError: + raise errors.IPvAnyInterfaceError() + + +class IPvAnyNetwork(_BaseNetwork): # type: ignore + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(type='string', format='ipvanynetwork') + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + + @classmethod + def validate(cls, value: NetworkType) -> Union[IPv4Network, IPv6Network]: + # Assume IP Network is defined with a default value for ``strict`` argument. + # Define your own class if you want to specify network address check strictness. + try: + return IPv4Network(value) + except ValueError: + pass + + try: + return IPv6Network(value) + except ValueError: + raise errors.IPvAnyNetworkError() + + +pretty_email_regex = re.compile(r'([\w ]*?) *<(.*)> *') +MAX_EMAIL_LENGTH = 2048 +"""Maximum length for an email. +A somewhat arbitrary but very generous number compared to what is allowed by most implementations. +""" + + +def validate_email(value: Union[str]) -> Tuple[str, str]: + """ + Email address validation using https://pypi.org/project/email-validator/ + Notes: + * raw ip address (literal) domain parts are not allowed. + * "John Doe " style "pretty" email addresses are processed + * spaces are striped from the beginning and end of addresses but no error is raised + """ + if email_validator is None: + import_email_validator() + + if len(value) > MAX_EMAIL_LENGTH: + raise errors.EmailError() + + m = pretty_email_regex.fullmatch(value) + name: Union[str, None] = None + if m: + name, value = m.groups() + email = value.strip() + try: + parts = email_validator.validate_email(email, check_deliverability=False) + except email_validator.EmailNotValidError as e: + raise errors.EmailError from e + + if hasattr(parts, 'normalized'): + # email-validator >= 2 + email = parts.normalized + assert email is not None + name = name or parts.local_part + return name, email + else: + # email-validator >1, <2 + at_index = email.index('@') + local_part = email[:at_index] # RFC 5321, local part must be case-sensitive. + global_part = email[at_index:].lower() + + return name or local_part, local_part + global_part diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/parse.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/parse.py new file mode 100644 index 0000000000000000000000000000000000000000..431d75a6406f3cf79ae4fcd26a2ad35fb5030526 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/parse.py @@ -0,0 +1,66 @@ +import json +import pickle +from enum import Enum +from pathlib import Path +from typing import Any, Callable, Union + +from pydantic.v1.types import StrBytes + + +class Protocol(str, Enum): + json = 'json' + pickle = 'pickle' + + +def load_str_bytes( + b: StrBytes, + *, + content_type: str = None, + encoding: str = 'utf8', + proto: Protocol = None, + allow_pickle: bool = False, + json_loads: Callable[[str], Any] = json.loads, +) -> Any: + if proto is None and content_type: + if content_type.endswith(('json', 'javascript')): + pass + elif allow_pickle and content_type.endswith('pickle'): + proto = Protocol.pickle + else: + raise TypeError(f'Unknown content-type: {content_type}') + + proto = proto or Protocol.json + + if proto == Protocol.json: + if isinstance(b, bytes): + b = b.decode(encoding) + return json_loads(b) + elif proto == Protocol.pickle: + if not allow_pickle: + raise RuntimeError('Trying to decode with pickle with allow_pickle=False') + bb = b if isinstance(b, bytes) else b.encode() + return pickle.loads(bb) + else: + raise TypeError(f'Unknown protocol: {proto}') + + +def load_file( + path: Union[str, Path], + *, + content_type: str = None, + encoding: str = 'utf8', + proto: Protocol = None, + allow_pickle: bool = False, + json_loads: Callable[[str], Any] = json.loads, +) -> Any: + path = Path(path) + b = path.read_bytes() + if content_type is None: + if path.suffix in ('.js', '.json'): + proto = Protocol.json + elif path.suffix == '.pkl': + proto = Protocol.pickle + + return load_str_bytes( + b, proto=proto, content_type=content_type, encoding=encoding, allow_pickle=allow_pickle, json_loads=json_loads + ) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/py.typed b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/schema.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/schema.py new file mode 100644 index 0000000000000000000000000000000000000000..a91fe2cd4ae12e619a0ca34baf14400ded5f14cf --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/schema.py @@ -0,0 +1,1163 @@ +import re +import warnings +from collections import defaultdict +from dataclasses import is_dataclass +from datetime import date, datetime, time, timedelta +from decimal import Decimal +from enum import Enum +from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network +from pathlib import Path +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Dict, + ForwardRef, + FrozenSet, + Generic, + Iterable, + List, + Optional, + Pattern, + Sequence, + Set, + Tuple, + Type, + TypeVar, + Union, + cast, +) +from uuid import UUID + +from typing_extensions import Annotated, Literal + +from pydantic.v1.fields import ( + MAPPING_LIKE_SHAPES, + SHAPE_DEQUE, + SHAPE_FROZENSET, + SHAPE_GENERIC, + SHAPE_ITERABLE, + SHAPE_LIST, + SHAPE_SEQUENCE, + SHAPE_SET, + SHAPE_SINGLETON, + SHAPE_TUPLE, + SHAPE_TUPLE_ELLIPSIS, + FieldInfo, + ModelField, +) +from pydantic.v1.json import pydantic_encoder +from pydantic.v1.networks import AnyUrl, EmailStr +from pydantic.v1.types import ( + ConstrainedDecimal, + ConstrainedFloat, + ConstrainedFrozenSet, + ConstrainedInt, + ConstrainedList, + ConstrainedSet, + ConstrainedStr, + SecretBytes, + SecretStr, + StrictBytes, + StrictStr, + conbytes, + condecimal, + confloat, + confrozenset, + conint, + conlist, + conset, + constr, +) +from pydantic.v1.typing import ( + all_literal_values, + get_args, + get_origin, + get_sub_types, + is_callable_type, + is_literal_type, + is_namedtuple, + is_none_type, + is_union, +) +from pydantic.v1.utils import ROOT_KEY, get_model, lenient_issubclass + +if TYPE_CHECKING: + from pydantic.v1.dataclasses import Dataclass + from pydantic.v1.main import BaseModel + +default_prefix = '#/definitions/' +default_ref_template = '#/definitions/{model}' + +TypeModelOrEnum = Union[Type['BaseModel'], Type[Enum]] +TypeModelSet = Set[TypeModelOrEnum] + + +def _apply_modify_schema( + modify_schema: Callable[..., None], field: Optional[ModelField], field_schema: Dict[str, Any] +) -> None: + from inspect import signature + + sig = signature(modify_schema) + args = set(sig.parameters.keys()) + if 'field' in args or 'kwargs' in args: + modify_schema(field_schema, field=field) + else: + modify_schema(field_schema) + + +def schema( + models: Sequence[Union[Type['BaseModel'], Type['Dataclass']]], + *, + by_alias: bool = True, + title: Optional[str] = None, + description: Optional[str] = None, + ref_prefix: Optional[str] = None, + ref_template: str = default_ref_template, +) -> Dict[str, Any]: + """ + Process a list of models and generate a single JSON Schema with all of them defined in the ``definitions`` + top-level JSON key, including their sub-models. + + :param models: a list of models to include in the generated JSON Schema + :param by_alias: generate the schemas using the aliases defined, if any + :param title: title for the generated schema that includes the definitions + :param description: description for the generated schema + :param ref_prefix: the JSON Pointer prefix for schema references with ``$ref``, if None, will be set to the + default of ``#/definitions/``. Update it if you want the schemas to reference the definitions somewhere + else, e.g. for OpenAPI use ``#/components/schemas/``. The resulting generated schemas will still be at the + top-level key ``definitions``, so you can extract them from there. But all the references will have the set + prefix. + :param ref_template: Use a ``string.format()`` template for ``$ref`` instead of a prefix. This can be useful + for references that cannot be represented by ``ref_prefix`` such as a definition stored in another file. For + a sibling json file in a ``/schemas`` directory use ``"/schemas/${model}.json#"``. + :return: dict with the JSON Schema with a ``definitions`` top-level key including the schema definitions for + the models and sub-models passed in ``models``. + """ + clean_models = [get_model(model) for model in models] + flat_models = get_flat_models_from_models(clean_models) + model_name_map = get_model_name_map(flat_models) + definitions = {} + output_schema: Dict[str, Any] = {} + if title: + output_schema['title'] = title + if description: + output_schema['description'] = description + for model in clean_models: + m_schema, m_definitions, m_nested_models = model_process_schema( + model, + by_alias=by_alias, + model_name_map=model_name_map, + ref_prefix=ref_prefix, + ref_template=ref_template, + ) + definitions.update(m_definitions) + model_name = model_name_map[model] + definitions[model_name] = m_schema + if definitions: + output_schema['definitions'] = definitions + return output_schema + + +def model_schema( + model: Union[Type['BaseModel'], Type['Dataclass']], + by_alias: bool = True, + ref_prefix: Optional[str] = None, + ref_template: str = default_ref_template, +) -> Dict[str, Any]: + """ + Generate a JSON Schema for one model. With all the sub-models defined in the ``definitions`` top-level + JSON key. + + :param model: a Pydantic model (a class that inherits from BaseModel) + :param by_alias: generate the schemas using the aliases defined, if any + :param ref_prefix: the JSON Pointer prefix for schema references with ``$ref``, if None, will be set to the + default of ``#/definitions/``. Update it if you want the schemas to reference the definitions somewhere + else, e.g. for OpenAPI use ``#/components/schemas/``. The resulting generated schemas will still be at the + top-level key ``definitions``, so you can extract them from there. But all the references will have the set + prefix. + :param ref_template: Use a ``string.format()`` template for ``$ref`` instead of a prefix. This can be useful for + references that cannot be represented by ``ref_prefix`` such as a definition stored in another file. For a + sibling json file in a ``/schemas`` directory use ``"/schemas/${model}.json#"``. + :return: dict with the JSON Schema for the passed ``model`` + """ + model = get_model(model) + flat_models = get_flat_models_from_model(model) + model_name_map = get_model_name_map(flat_models) + model_name = model_name_map[model] + m_schema, m_definitions, nested_models = model_process_schema( + model, by_alias=by_alias, model_name_map=model_name_map, ref_prefix=ref_prefix, ref_template=ref_template + ) + if model_name in nested_models: + # model_name is in Nested models, it has circular references + m_definitions[model_name] = m_schema + m_schema = get_schema_ref(model_name, ref_prefix, ref_template, False) + if m_definitions: + m_schema.update({'definitions': m_definitions}) + return m_schema + + +def get_field_info_schema(field: ModelField, schema_overrides: bool = False) -> Tuple[Dict[str, Any], bool]: + # If no title is explicitly set, we don't set title in the schema for enums. + # The behaviour is the same as `BaseModel` reference, where the default title + # is in the definitions part of the schema. + schema_: Dict[str, Any] = {} + if field.field_info.title or not lenient_issubclass(field.type_, Enum): + schema_['title'] = field.field_info.title or field.alias.title().replace('_', ' ') + + if field.field_info.title: + schema_overrides = True + + if field.field_info.description: + schema_['description'] = field.field_info.description + schema_overrides = True + + if not field.required and field.default is not None and not is_callable_type(field.outer_type_): + schema_['default'] = encode_default(field.default) + schema_overrides = True + + return schema_, schema_overrides + + +def field_schema( + field: ModelField, + *, + by_alias: bool = True, + model_name_map: Dict[TypeModelOrEnum, str], + ref_prefix: Optional[str] = None, + ref_template: str = default_ref_template, + known_models: Optional[TypeModelSet] = None, +) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]: + """ + Process a Pydantic field and return a tuple with a JSON Schema for it as the first item. + Also return a dictionary of definitions with models as keys and their schemas as values. If the passed field + is a model and has sub-models, and those sub-models don't have overrides (as ``title``, ``default``, etc), they + will be included in the definitions and referenced in the schema instead of included recursively. + + :param field: a Pydantic ``ModelField`` + :param by_alias: use the defined alias (if any) in the returned schema + :param model_name_map: used to generate the JSON Schema references to other models included in the definitions + :param ref_prefix: the JSON Pointer prefix to use for references to other schemas, if None, the default of + #/definitions/ will be used + :param ref_template: Use a ``string.format()`` template for ``$ref`` instead of a prefix. This can be useful for + references that cannot be represented by ``ref_prefix`` such as a definition stored in another file. For a + sibling json file in a ``/schemas`` directory use ``"/schemas/${model}.json#"``. + :param known_models: used to solve circular references + :return: tuple of the schema for this field and additional definitions + """ + s, schema_overrides = get_field_info_schema(field) + + validation_schema = get_field_schema_validations(field) + if validation_schema: + s.update(validation_schema) + schema_overrides = True + + f_schema, f_definitions, f_nested_models = field_type_schema( + field, + by_alias=by_alias, + model_name_map=model_name_map, + schema_overrides=schema_overrides, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models or set(), + ) + + # $ref will only be returned when there are no schema_overrides + if '$ref' in f_schema: + return f_schema, f_definitions, f_nested_models + else: + s.update(f_schema) + return s, f_definitions, f_nested_models + + +numeric_types = (int, float, Decimal) +_str_types_attrs: Tuple[Tuple[str, Union[type, Tuple[type, ...]], str], ...] = ( + ('max_length', numeric_types, 'maxLength'), + ('min_length', numeric_types, 'minLength'), + ('regex', str, 'pattern'), +) + +_numeric_types_attrs: Tuple[Tuple[str, Union[type, Tuple[type, ...]], str], ...] = ( + ('gt', numeric_types, 'exclusiveMinimum'), + ('lt', numeric_types, 'exclusiveMaximum'), + ('ge', numeric_types, 'minimum'), + ('le', numeric_types, 'maximum'), + ('multiple_of', numeric_types, 'multipleOf'), +) + + +def get_field_schema_validations(field: ModelField) -> Dict[str, Any]: + """ + Get the JSON Schema validation keywords for a ``field`` with an annotation of + a Pydantic ``FieldInfo`` with validation arguments. + """ + f_schema: Dict[str, Any] = {} + + if lenient_issubclass(field.type_, Enum): + # schema is already updated by `enum_process_schema`; just update with field extra + if field.field_info.extra: + f_schema.update(field.field_info.extra) + return f_schema + + if lenient_issubclass(field.type_, (str, bytes)): + for attr_name, t, keyword in _str_types_attrs: + attr = getattr(field.field_info, attr_name, None) + if isinstance(attr, t): + f_schema[keyword] = attr + if lenient_issubclass(field.type_, numeric_types) and not issubclass(field.type_, bool): + for attr_name, t, keyword in _numeric_types_attrs: + attr = getattr(field.field_info, attr_name, None) + if isinstance(attr, t): + f_schema[keyword] = attr + if field.field_info is not None and field.field_info.const: + f_schema['const'] = field.default + if field.field_info.extra: + f_schema.update(field.field_info.extra) + modify_schema = getattr(field.outer_type_, '__modify_schema__', None) + if modify_schema: + _apply_modify_schema(modify_schema, field, f_schema) + return f_schema + + +def get_model_name_map(unique_models: TypeModelSet) -> Dict[TypeModelOrEnum, str]: + """ + Process a set of models and generate unique names for them to be used as keys in the JSON Schema + definitions. By default the names are the same as the class name. But if two models in different Python + modules have the same name (e.g. "users.Model" and "items.Model"), the generated names will be + based on the Python module path for those conflicting models to prevent name collisions. + + :param unique_models: a Python set of models + :return: dict mapping models to names + """ + name_model_map = {} + conflicting_names: Set[str] = set() + for model in unique_models: + model_name = normalize_name(model.__name__) + if model_name in conflicting_names: + model_name = get_long_model_name(model) + name_model_map[model_name] = model + elif model_name in name_model_map: + conflicting_names.add(model_name) + conflicting_model = name_model_map.pop(model_name) + name_model_map[get_long_model_name(conflicting_model)] = conflicting_model + name_model_map[get_long_model_name(model)] = model + else: + name_model_map[model_name] = model + return {v: k for k, v in name_model_map.items()} + + +def get_flat_models_from_model(model: Type['BaseModel'], known_models: Optional[TypeModelSet] = None) -> TypeModelSet: + """ + Take a single ``model`` and generate a set with itself and all the sub-models in the tree. I.e. if you pass + model ``Foo`` (subclass of Pydantic ``BaseModel``) as ``model``, and it has a field of type ``Bar`` (also + subclass of ``BaseModel``) and that model ``Bar`` has a field of type ``Baz`` (also subclass of ``BaseModel``), + the return value will be ``set([Foo, Bar, Baz])``. + + :param model: a Pydantic ``BaseModel`` subclass + :param known_models: used to solve circular references + :return: a set with the initial model and all its sub-models + """ + known_models = known_models or set() + flat_models: TypeModelSet = set() + flat_models.add(model) + known_models |= flat_models + fields = cast(Sequence[ModelField], model.__fields__.values()) + flat_models |= get_flat_models_from_fields(fields, known_models=known_models) + return flat_models + + +def get_flat_models_from_field(field: ModelField, known_models: TypeModelSet) -> TypeModelSet: + """ + Take a single Pydantic ``ModelField`` (from a model) that could have been declared as a subclass of BaseModel + (so, it could be a submodel), and generate a set with its model and all the sub-models in the tree. + I.e. if you pass a field that was declared to be of type ``Foo`` (subclass of BaseModel) as ``field``, and that + model ``Foo`` has a field of type ``Bar`` (also subclass of ``BaseModel``) and that model ``Bar`` has a field of + type ``Baz`` (also subclass of ``BaseModel``), the return value will be ``set([Foo, Bar, Baz])``. + + :param field: a Pydantic ``ModelField`` + :param known_models: used to solve circular references + :return: a set with the model used in the declaration for this field, if any, and all its sub-models + """ + from pydantic.v1.main import BaseModel + + flat_models: TypeModelSet = set() + + field_type = field.type_ + if lenient_issubclass(getattr(field_type, '__pydantic_model__', None), BaseModel): + field_type = field_type.__pydantic_model__ + + if field.sub_fields and not lenient_issubclass(field_type, BaseModel): + flat_models |= get_flat_models_from_fields(field.sub_fields, known_models=known_models) + elif lenient_issubclass(field_type, BaseModel) and field_type not in known_models: + flat_models |= get_flat_models_from_model(field_type, known_models=known_models) + elif lenient_issubclass(field_type, Enum): + flat_models.add(field_type) + return flat_models + + +def get_flat_models_from_fields(fields: Sequence[ModelField], known_models: TypeModelSet) -> TypeModelSet: + """ + Take a list of Pydantic ``ModelField``s (from a model) that could have been declared as subclasses of ``BaseModel`` + (so, any of them could be a submodel), and generate a set with their models and all the sub-models in the tree. + I.e. if you pass a the fields of a model ``Foo`` (subclass of ``BaseModel``) as ``fields``, and on of them has a + field of type ``Bar`` (also subclass of ``BaseModel``) and that model ``Bar`` has a field of type ``Baz`` (also + subclass of ``BaseModel``), the return value will be ``set([Foo, Bar, Baz])``. + + :param fields: a list of Pydantic ``ModelField``s + :param known_models: used to solve circular references + :return: a set with any model declared in the fields, and all their sub-models + """ + flat_models: TypeModelSet = set() + for field in fields: + flat_models |= get_flat_models_from_field(field, known_models=known_models) + return flat_models + + +def get_flat_models_from_models(models: Sequence[Type['BaseModel']]) -> TypeModelSet: + """ + Take a list of ``models`` and generate a set with them and all their sub-models in their trees. I.e. if you pass + a list of two models, ``Foo`` and ``Bar``, both subclasses of Pydantic ``BaseModel`` as models, and ``Bar`` has + a field of type ``Baz`` (also subclass of ``BaseModel``), the return value will be ``set([Foo, Bar, Baz])``. + """ + flat_models: TypeModelSet = set() + for model in models: + flat_models |= get_flat_models_from_model(model) + return flat_models + + +def get_long_model_name(model: TypeModelOrEnum) -> str: + return f'{model.__module__}__{model.__qualname__}'.replace('.', '__') + + +def field_type_schema( + field: ModelField, + *, + by_alias: bool, + model_name_map: Dict[TypeModelOrEnum, str], + ref_template: str, + schema_overrides: bool = False, + ref_prefix: Optional[str] = None, + known_models: TypeModelSet, +) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]: + """ + Used by ``field_schema()``, you probably should be using that function. + + Take a single ``field`` and generate the schema for its type only, not including additional + information as title, etc. Also return additional schema definitions, from sub-models. + """ + from pydantic.v1.main import BaseModel # noqa: F811 + + definitions = {} + nested_models: Set[str] = set() + f_schema: Dict[str, Any] + if field.shape in { + SHAPE_LIST, + SHAPE_TUPLE_ELLIPSIS, + SHAPE_SEQUENCE, + SHAPE_SET, + SHAPE_FROZENSET, + SHAPE_ITERABLE, + SHAPE_DEQUE, + }: + items_schema, f_definitions, f_nested_models = field_singleton_schema( + field, + by_alias=by_alias, + model_name_map=model_name_map, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + definitions.update(f_definitions) + nested_models.update(f_nested_models) + f_schema = {'type': 'array', 'items': items_schema} + if field.shape in {SHAPE_SET, SHAPE_FROZENSET}: + f_schema['uniqueItems'] = True + + elif field.shape in MAPPING_LIKE_SHAPES: + f_schema = {'type': 'object'} + key_field = cast(ModelField, field.key_field) + regex = getattr(key_field.type_, 'regex', None) + items_schema, f_definitions, f_nested_models = field_singleton_schema( + field, + by_alias=by_alias, + model_name_map=model_name_map, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + definitions.update(f_definitions) + nested_models.update(f_nested_models) + if regex: + # Dict keys have a regex pattern + # items_schema might be a schema or empty dict, add it either way + f_schema['patternProperties'] = {ConstrainedStr._get_pattern(regex): items_schema} + if items_schema: + # The dict values are not simply Any, so they need a schema + f_schema['additionalProperties'] = items_schema + elif field.shape == SHAPE_TUPLE or (field.shape == SHAPE_GENERIC and not issubclass(field.type_, BaseModel)): + sub_schema = [] + sub_fields = cast(List[ModelField], field.sub_fields) + for sf in sub_fields: + sf_schema, sf_definitions, sf_nested_models = field_type_schema( + sf, + by_alias=by_alias, + model_name_map=model_name_map, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + definitions.update(sf_definitions) + nested_models.update(sf_nested_models) + sub_schema.append(sf_schema) + + sub_fields_len = len(sub_fields) + if field.shape == SHAPE_GENERIC: + all_of_schemas = sub_schema[0] if sub_fields_len == 1 else {'type': 'array', 'items': sub_schema} + f_schema = {'allOf': [all_of_schemas]} + else: + f_schema = { + 'type': 'array', + 'minItems': sub_fields_len, + 'maxItems': sub_fields_len, + } + if sub_fields_len >= 1: + f_schema['items'] = sub_schema + else: + assert field.shape in {SHAPE_SINGLETON, SHAPE_GENERIC}, field.shape + f_schema, f_definitions, f_nested_models = field_singleton_schema( + field, + by_alias=by_alias, + model_name_map=model_name_map, + schema_overrides=schema_overrides, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + definitions.update(f_definitions) + nested_models.update(f_nested_models) + + # check field type to avoid repeated calls to the same __modify_schema__ method + if field.type_ != field.outer_type_: + if field.shape == SHAPE_GENERIC: + field_type = field.type_ + else: + field_type = field.outer_type_ + modify_schema = getattr(field_type, '__modify_schema__', None) + if modify_schema: + _apply_modify_schema(modify_schema, field, f_schema) + return f_schema, definitions, nested_models + + +def model_process_schema( + model: TypeModelOrEnum, + *, + by_alias: bool = True, + model_name_map: Dict[TypeModelOrEnum, str], + ref_prefix: Optional[str] = None, + ref_template: str = default_ref_template, + known_models: Optional[TypeModelSet] = None, + field: Optional[ModelField] = None, +) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]: + """ + Used by ``model_schema()``, you probably should be using that function. + + Take a single ``model`` and generate its schema. Also return additional schema definitions, from sub-models. The + sub-models of the returned schema will be referenced, but their definitions will not be included in the schema. All + the definitions are returned as the second value. + """ + from inspect import getdoc, signature + + known_models = known_models or set() + if lenient_issubclass(model, Enum): + model = cast(Type[Enum], model) + s = enum_process_schema(model, field=field) + return s, {}, set() + model = cast(Type['BaseModel'], model) + s = {'title': model.__config__.title or model.__name__} + doc = getdoc(model) + if doc: + s['description'] = doc + known_models.add(model) + m_schema, m_definitions, nested_models = model_type_schema( + model, + by_alias=by_alias, + model_name_map=model_name_map, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + s.update(m_schema) + schema_extra = model.__config__.schema_extra + if callable(schema_extra): + if len(signature(schema_extra).parameters) == 1: + schema_extra(s) + else: + schema_extra(s, model) + else: + s.update(schema_extra) + return s, m_definitions, nested_models + + +def model_type_schema( + model: Type['BaseModel'], + *, + by_alias: bool, + model_name_map: Dict[TypeModelOrEnum, str], + ref_template: str, + ref_prefix: Optional[str] = None, + known_models: TypeModelSet, +) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]: + """ + You probably should be using ``model_schema()``, this function is indirectly used by that function. + + Take a single ``model`` and generate the schema for its type only, not including additional + information as title, etc. Also return additional schema definitions, from sub-models. + """ + properties = {} + required = [] + definitions: Dict[str, Any] = {} + nested_models: Set[str] = set() + for k, f in model.__fields__.items(): + try: + f_schema, f_definitions, f_nested_models = field_schema( + f, + by_alias=by_alias, + model_name_map=model_name_map, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + except SkipField as skip: + warnings.warn(skip.message, UserWarning) + continue + definitions.update(f_definitions) + nested_models.update(f_nested_models) + if by_alias: + properties[f.alias] = f_schema + if f.required: + required.append(f.alias) + else: + properties[k] = f_schema + if f.required: + required.append(k) + if ROOT_KEY in properties: + out_schema = properties[ROOT_KEY] + out_schema['title'] = model.__config__.title or model.__name__ + else: + out_schema = {'type': 'object', 'properties': properties} + if required: + out_schema['required'] = required + if model.__config__.extra == 'forbid': + out_schema['additionalProperties'] = False + return out_schema, definitions, nested_models + + +def enum_process_schema(enum: Type[Enum], *, field: Optional[ModelField] = None) -> Dict[str, Any]: + """ + Take a single `enum` and generate its schema. + + This is similar to the `model_process_schema` function, but applies to ``Enum`` objects. + """ + import inspect + + schema_: Dict[str, Any] = { + 'title': enum.__name__, + # Python assigns all enums a default docstring value of 'An enumeration', so + # all enums will have a description field even if not explicitly provided. + 'description': inspect.cleandoc(enum.__doc__ or 'An enumeration.'), + # Add enum values and the enum field type to the schema. + 'enum': [item.value for item in cast(Iterable[Enum], enum)], + } + + add_field_type_to_schema(enum, schema_) + + modify_schema = getattr(enum, '__modify_schema__', None) + if modify_schema: + _apply_modify_schema(modify_schema, field, schema_) + + return schema_ + + +def field_singleton_sub_fields_schema( + field: ModelField, + *, + by_alias: bool, + model_name_map: Dict[TypeModelOrEnum, str], + ref_template: str, + schema_overrides: bool = False, + ref_prefix: Optional[str] = None, + known_models: TypeModelSet, +) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]: + """ + This function is indirectly used by ``field_schema()``, you probably should be using that function. + + Take a list of Pydantic ``ModelField`` from the declaration of a type with parameters, and generate their + schema. I.e., fields used as "type parameters", like ``str`` and ``int`` in ``Tuple[str, int]``. + """ + sub_fields = cast(List[ModelField], field.sub_fields) + definitions = {} + nested_models: Set[str] = set() + if len(sub_fields) == 1: + return field_type_schema( + sub_fields[0], + by_alias=by_alias, + model_name_map=model_name_map, + schema_overrides=schema_overrides, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + else: + s: Dict[str, Any] = {} + # https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#discriminator-object + field_has_discriminator: bool = field.discriminator_key is not None + if field_has_discriminator: + assert field.sub_fields_mapping is not None + + discriminator_models_refs: Dict[str, Union[str, Dict[str, Any]]] = {} + + for discriminator_value, sub_field in field.sub_fields_mapping.items(): + if isinstance(discriminator_value, Enum): + discriminator_value = str(discriminator_value.value) + # sub_field is either a `BaseModel` or directly an `Annotated` `Union` of many + if is_union(get_origin(sub_field.type_)): + sub_models = get_sub_types(sub_field.type_) + discriminator_models_refs[discriminator_value] = { + model_name_map[sub_model]: get_schema_ref( + model_name_map[sub_model], ref_prefix, ref_template, False + ) + for sub_model in sub_models + } + else: + sub_field_type = sub_field.type_ + if hasattr(sub_field_type, '__pydantic_model__'): + sub_field_type = sub_field_type.__pydantic_model__ + + discriminator_model_name = model_name_map[sub_field_type] + discriminator_model_ref = get_schema_ref(discriminator_model_name, ref_prefix, ref_template, False) + discriminator_models_refs[discriminator_value] = discriminator_model_ref['$ref'] + + s['discriminator'] = { + 'propertyName': field.discriminator_alias if by_alias else field.discriminator_key, + 'mapping': discriminator_models_refs, + } + + sub_field_schemas = [] + for sf in sub_fields: + sub_schema, sub_definitions, sub_nested_models = field_type_schema( + sf, + by_alias=by_alias, + model_name_map=model_name_map, + schema_overrides=schema_overrides, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + definitions.update(sub_definitions) + if schema_overrides and 'allOf' in sub_schema: + # if the sub_field is a referenced schema we only need the referenced + # object. Otherwise we will end up with several allOf inside anyOf/oneOf. + # See https://github.com/pydantic/pydantic/issues/1209 + sub_schema = sub_schema['allOf'][0] + + if sub_schema.keys() == {'discriminator', 'oneOf'}: + # we don't want discriminator information inside oneOf choices, this is dealt with elsewhere + sub_schema.pop('discriminator') + sub_field_schemas.append(sub_schema) + nested_models.update(sub_nested_models) + s['oneOf' if field_has_discriminator else 'anyOf'] = sub_field_schemas + return s, definitions, nested_models + + +# Order is important, e.g. subclasses of str must go before str +# this is used only for standard library types, custom types should use __modify_schema__ instead +field_class_to_schema: Tuple[Tuple[Any, Dict[str, Any]], ...] = ( + (Path, {'type': 'string', 'format': 'path'}), + (datetime, {'type': 'string', 'format': 'date-time'}), + (date, {'type': 'string', 'format': 'date'}), + (time, {'type': 'string', 'format': 'time'}), + (timedelta, {'type': 'number', 'format': 'time-delta'}), + (IPv4Network, {'type': 'string', 'format': 'ipv4network'}), + (IPv6Network, {'type': 'string', 'format': 'ipv6network'}), + (IPv4Interface, {'type': 'string', 'format': 'ipv4interface'}), + (IPv6Interface, {'type': 'string', 'format': 'ipv6interface'}), + (IPv4Address, {'type': 'string', 'format': 'ipv4'}), + (IPv6Address, {'type': 'string', 'format': 'ipv6'}), + (Pattern, {'type': 'string', 'format': 'regex'}), + (str, {'type': 'string'}), + (bytes, {'type': 'string', 'format': 'binary'}), + (bool, {'type': 'boolean'}), + (int, {'type': 'integer'}), + (float, {'type': 'number'}), + (Decimal, {'type': 'number'}), + (UUID, {'type': 'string', 'format': 'uuid'}), + (dict, {'type': 'object'}), + (list, {'type': 'array', 'items': {}}), + (tuple, {'type': 'array', 'items': {}}), + (set, {'type': 'array', 'items': {}, 'uniqueItems': True}), + (frozenset, {'type': 'array', 'items': {}, 'uniqueItems': True}), +) + +json_scheme = {'type': 'string', 'format': 'json-string'} + + +def add_field_type_to_schema(field_type: Any, schema_: Dict[str, Any]) -> None: + """ + Update the given `schema` with the type-specific metadata for the given `field_type`. + + This function looks through `field_class_to_schema` for a class that matches the given `field_type`, + and then modifies the given `schema` with the information from that type. + """ + for type_, t_schema in field_class_to_schema: + # Fallback for `typing.Pattern` and `re.Pattern` as they are not a valid class + if lenient_issubclass(field_type, type_) or field_type is type_ is Pattern: + schema_.update(t_schema) + break + + +def get_schema_ref(name: str, ref_prefix: Optional[str], ref_template: str, schema_overrides: bool) -> Dict[str, Any]: + if ref_prefix: + schema_ref = {'$ref': ref_prefix + name} + else: + schema_ref = {'$ref': ref_template.format(model=name)} + return {'allOf': [schema_ref]} if schema_overrides else schema_ref + + +def field_singleton_schema( # noqa: C901 (ignore complexity) + field: ModelField, + *, + by_alias: bool, + model_name_map: Dict[TypeModelOrEnum, str], + ref_template: str, + schema_overrides: bool = False, + ref_prefix: Optional[str] = None, + known_models: TypeModelSet, +) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]: + """ + This function is indirectly used by ``field_schema()``, you should probably be using that function. + + Take a single Pydantic ``ModelField``, and return its schema and any additional definitions from sub-models. + """ + from pydantic.v1.main import BaseModel + + definitions: Dict[str, Any] = {} + nested_models: Set[str] = set() + field_type = field.type_ + + # Recurse into this field if it contains sub_fields and is NOT a + # BaseModel OR that BaseModel is a const + if field.sub_fields and ( + (field.field_info and field.field_info.const) or not lenient_issubclass(field_type, BaseModel) + ): + return field_singleton_sub_fields_schema( + field, + by_alias=by_alias, + model_name_map=model_name_map, + schema_overrides=schema_overrides, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + if field_type is Any or field_type is object or field_type.__class__ == TypeVar or get_origin(field_type) is type: + return {}, definitions, nested_models # no restrictions + if is_none_type(field_type): + return {'type': 'null'}, definitions, nested_models + if is_callable_type(field_type): + raise SkipField(f'Callable {field.name} was excluded from schema since JSON schema has no equivalent type.') + f_schema: Dict[str, Any] = {} + if field.field_info is not None and field.field_info.const: + f_schema['const'] = field.default + + if is_literal_type(field_type): + values = tuple(x.value if isinstance(x, Enum) else x for x in all_literal_values(field_type)) + + if len({v.__class__ for v in values}) > 1: + return field_schema( + multitypes_literal_field_for_schema(values, field), + by_alias=by_alias, + model_name_map=model_name_map, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + ) + + # All values have the same type + field_type = values[0].__class__ + f_schema['enum'] = list(values) + add_field_type_to_schema(field_type, f_schema) + elif lenient_issubclass(field_type, Enum): + enum_name = model_name_map[field_type] + f_schema, schema_overrides = get_field_info_schema(field, schema_overrides) + f_schema.update(get_schema_ref(enum_name, ref_prefix, ref_template, schema_overrides)) + definitions[enum_name] = enum_process_schema(field_type, field=field) + elif is_namedtuple(field_type): + sub_schema, *_ = model_process_schema( + field_type.__pydantic_model__, + by_alias=by_alias, + model_name_map=model_name_map, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + field=field, + ) + items_schemas = list(sub_schema['properties'].values()) + f_schema.update( + { + 'type': 'array', + 'items': items_schemas, + 'minItems': len(items_schemas), + 'maxItems': len(items_schemas), + } + ) + elif not hasattr(field_type, '__pydantic_model__'): + add_field_type_to_schema(field_type, f_schema) + + modify_schema = getattr(field_type, '__modify_schema__', None) + if modify_schema: + _apply_modify_schema(modify_schema, field, f_schema) + + if f_schema: + return f_schema, definitions, nested_models + + # Handle dataclass-based models + if lenient_issubclass(getattr(field_type, '__pydantic_model__', None), BaseModel): + field_type = field_type.__pydantic_model__ + + if issubclass(field_type, BaseModel): + model_name = model_name_map[field_type] + if field_type not in known_models: + sub_schema, sub_definitions, sub_nested_models = model_process_schema( + field_type, + by_alias=by_alias, + model_name_map=model_name_map, + ref_prefix=ref_prefix, + ref_template=ref_template, + known_models=known_models, + field=field, + ) + definitions.update(sub_definitions) + definitions[model_name] = sub_schema + nested_models.update(sub_nested_models) + else: + nested_models.add(model_name) + schema_ref = get_schema_ref(model_name, ref_prefix, ref_template, schema_overrides) + return schema_ref, definitions, nested_models + + # For generics with no args + args = get_args(field_type) + if args is not None and not args and Generic in field_type.__bases__: + return f_schema, definitions, nested_models + + raise ValueError(f'Value not declarable with JSON Schema, field: {field}') + + +def multitypes_literal_field_for_schema(values: Tuple[Any, ...], field: ModelField) -> ModelField: + """ + To support `Literal` with values of different types, we split it into multiple `Literal` with same type + e.g. `Literal['qwe', 'asd', 1, 2]` becomes `Union[Literal['qwe', 'asd'], Literal[1, 2]]` + """ + literal_distinct_types = defaultdict(list) + for v in values: + literal_distinct_types[v.__class__].append(v) + distinct_literals = (Literal[tuple(same_type_values)] for same_type_values in literal_distinct_types.values()) + + return ModelField( + name=field.name, + type_=Union[tuple(distinct_literals)], # type: ignore + class_validators=field.class_validators, + model_config=field.model_config, + default=field.default, + required=field.required, + alias=field.alias, + field_info=field.field_info, + ) + + +def encode_default(dft: Any) -> Any: + from pydantic.v1.main import BaseModel + + if isinstance(dft, BaseModel) or is_dataclass(dft): + dft = cast('dict[str, Any]', pydantic_encoder(dft)) + + if isinstance(dft, dict): + return {encode_default(k): encode_default(v) for k, v in dft.items()} + elif isinstance(dft, Enum): + return dft.value + elif isinstance(dft, (int, float, str)): + return dft + elif isinstance(dft, (list, tuple)): + t = dft.__class__ + seq_args = (encode_default(v) for v in dft) + return t(*seq_args) if is_namedtuple(t) else t(seq_args) + elif dft is None: + return None + else: + return pydantic_encoder(dft) + + +_map_types_constraint: Dict[Any, Callable[..., type]] = {int: conint, float: confloat, Decimal: condecimal} + + +def get_annotation_from_field_info( + annotation: Any, field_info: FieldInfo, field_name: str, validate_assignment: bool = False +) -> Type[Any]: + """ + Get an annotation with validation implemented for numbers and strings based on the field_info. + :param annotation: an annotation from a field specification, as ``str``, ``ConstrainedStr`` + :param field_info: an instance of FieldInfo, possibly with declarations for validations and JSON Schema + :param field_name: name of the field for use in error messages + :param validate_assignment: default False, flag for BaseModel Config value of validate_assignment + :return: the same ``annotation`` if unmodified or a new annotation with validation in place + """ + constraints = field_info.get_constraints() + used_constraints: Set[str] = set() + if constraints: + annotation, used_constraints = get_annotation_with_constraints(annotation, field_info) + if validate_assignment: + used_constraints.add('allow_mutation') + + unused_constraints = constraints - used_constraints + if unused_constraints: + raise ValueError( + f'On field "{field_name}" the following field constraints are set but not enforced: ' + f'{", ".join(unused_constraints)}. ' + f'\nFor more details see https://docs.pydantic.dev/usage/schema/#unenforced-field-constraints' + ) + + return annotation + + +def get_annotation_with_constraints(annotation: Any, field_info: FieldInfo) -> Tuple[Type[Any], Set[str]]: # noqa: C901 + """ + Get an annotation with used constraints implemented for numbers and strings based on the field_info. + + :param annotation: an annotation from a field specification, as ``str``, ``ConstrainedStr`` + :param field_info: an instance of FieldInfo, possibly with declarations for validations and JSON Schema + :return: the same ``annotation`` if unmodified or a new annotation along with the used constraints. + """ + used_constraints: Set[str] = set() + + def go(type_: Any) -> Type[Any]: + if ( + is_literal_type(type_) + or isinstance(type_, ForwardRef) + or lenient_issubclass(type_, (ConstrainedList, ConstrainedSet, ConstrainedFrozenSet)) + ): + return type_ + origin = get_origin(type_) + if origin is not None: + args: Tuple[Any, ...] = get_args(type_) + if any(isinstance(a, ForwardRef) for a in args): + # forward refs cause infinite recursion below + return type_ + + if origin is Annotated: + return go(args[0]) + if is_union(origin): + return Union[tuple(go(a) for a in args)] # type: ignore + + if issubclass(origin, List) and ( + field_info.min_items is not None + or field_info.max_items is not None + or field_info.unique_items is not None + ): + used_constraints.update({'min_items', 'max_items', 'unique_items'}) + return conlist( + go(args[0]), + min_items=field_info.min_items, + max_items=field_info.max_items, + unique_items=field_info.unique_items, + ) + + if issubclass(origin, Set) and (field_info.min_items is not None or field_info.max_items is not None): + used_constraints.update({'min_items', 'max_items'}) + return conset(go(args[0]), min_items=field_info.min_items, max_items=field_info.max_items) + + if issubclass(origin, FrozenSet) and (field_info.min_items is not None or field_info.max_items is not None): + used_constraints.update({'min_items', 'max_items'}) + return confrozenset(go(args[0]), min_items=field_info.min_items, max_items=field_info.max_items) + + for t in (Tuple, List, Set, FrozenSet, Sequence): + if issubclass(origin, t): # type: ignore + return t[tuple(go(a) for a in args)] # type: ignore + + if issubclass(origin, Dict): + return Dict[args[0], go(args[1])] # type: ignore + + attrs: Optional[Tuple[str, ...]] = None + constraint_func: Optional[Callable[..., type]] = None + if isinstance(type_, type): + if issubclass(type_, (SecretStr, SecretBytes)): + attrs = ('max_length', 'min_length') + + def constraint_func(**kw: Any) -> Type[Any]: # noqa: F811 + return type(type_.__name__, (type_,), kw) + + elif issubclass(type_, str) and not issubclass(type_, (EmailStr, AnyUrl)): + attrs = ('max_length', 'min_length', 'regex') + if issubclass(type_, StrictStr): + + def constraint_func(**kw: Any) -> Type[Any]: + return type(type_.__name__, (type_,), kw) + + else: + constraint_func = constr + elif issubclass(type_, bytes): + attrs = ('max_length', 'min_length', 'regex') + if issubclass(type_, StrictBytes): + + def constraint_func(**kw: Any) -> Type[Any]: + return type(type_.__name__, (type_,), kw) + + else: + constraint_func = conbytes + elif issubclass(type_, numeric_types) and not issubclass( + type_, + ( + ConstrainedInt, + ConstrainedFloat, + ConstrainedDecimal, + ConstrainedList, + ConstrainedSet, + ConstrainedFrozenSet, + bool, + ), + ): + # Is numeric type + attrs = ('gt', 'lt', 'ge', 'le', 'multiple_of') + if issubclass(type_, float): + attrs += ('allow_inf_nan',) + if issubclass(type_, Decimal): + attrs += ('max_digits', 'decimal_places') + numeric_type = next(t for t in numeric_types if issubclass(type_, t)) # pragma: no branch + constraint_func = _map_types_constraint[numeric_type] + + if attrs: + used_constraints.update(set(attrs)) + kwargs = { + attr_name: attr + for attr_name, attr in ((attr_name, getattr(field_info, attr_name)) for attr_name in attrs) + if attr is not None + } + if kwargs: + constraint_func = cast(Callable[..., type], constraint_func) + return constraint_func(**kwargs) + return type_ + + return go(annotation), used_constraints + + +def normalize_name(name: str) -> str: + """ + Normalizes the given name. This can be applied to either a model *or* enum. + """ + return re.sub(r'[^a-zA-Z0-9.\-_]', '_', name) + + +class SkipField(Exception): + """ + Utility exception used to exclude fields from schema. + """ + + def __init__(self, message: str) -> None: + self.message = message diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/tools.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/tools.py new file mode 100644 index 0000000000000000000000000000000000000000..6838a23ecc7419f0478449d9d680c230a99c20e0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/tools.py @@ -0,0 +1,92 @@ +import json +from functools import lru_cache +from pathlib import Path +from typing import TYPE_CHECKING, Any, Callable, Optional, Type, TypeVar, Union + +from pydantic.v1.parse import Protocol, load_file, load_str_bytes +from pydantic.v1.types import StrBytes +from pydantic.v1.typing import display_as_type + +__all__ = ('parse_file_as', 'parse_obj_as', 'parse_raw_as', 'schema_of', 'schema_json_of') + +NameFactory = Union[str, Callable[[Type[Any]], str]] + +if TYPE_CHECKING: + from pydantic.v1.typing import DictStrAny + + +def _generate_parsing_type_name(type_: Any) -> str: + return f'ParsingModel[{display_as_type(type_)}]' + + +@lru_cache(maxsize=2048) +def _get_parsing_type(type_: Any, *, type_name: Optional[NameFactory] = None) -> Any: + from pydantic.v1.main import create_model + + if type_name is None: + type_name = _generate_parsing_type_name + if not isinstance(type_name, str): + type_name = type_name(type_) + return create_model(type_name, __root__=(type_, ...)) + + +T = TypeVar('T') + + +def parse_obj_as(type_: Type[T], obj: Any, *, type_name: Optional[NameFactory] = None) -> T: + model_type = _get_parsing_type(type_, type_name=type_name) # type: ignore[arg-type] + return model_type(__root__=obj).__root__ + + +def parse_file_as( + type_: Type[T], + path: Union[str, Path], + *, + content_type: str = None, + encoding: str = 'utf8', + proto: Protocol = None, + allow_pickle: bool = False, + json_loads: Callable[[str], Any] = json.loads, + type_name: Optional[NameFactory] = None, +) -> T: + obj = load_file( + path, + proto=proto, + content_type=content_type, + encoding=encoding, + allow_pickle=allow_pickle, + json_loads=json_loads, + ) + return parse_obj_as(type_, obj, type_name=type_name) + + +def parse_raw_as( + type_: Type[T], + b: StrBytes, + *, + content_type: str = None, + encoding: str = 'utf8', + proto: Protocol = None, + allow_pickle: bool = False, + json_loads: Callable[[str], Any] = json.loads, + type_name: Optional[NameFactory] = None, +) -> T: + obj = load_str_bytes( + b, + proto=proto, + content_type=content_type, + encoding=encoding, + allow_pickle=allow_pickle, + json_loads=json_loads, + ) + return parse_obj_as(type_, obj, type_name=type_name) + + +def schema_of(type_: Any, *, title: Optional[NameFactory] = None, **schema_kwargs: Any) -> 'DictStrAny': + """Generate a JSON schema (as dict) for the passed model or dynamically generated one""" + return _get_parsing_type(type_, type_name=title).schema(**schema_kwargs) + + +def schema_json_of(type_: Any, *, title: Optional[NameFactory] = None, **schema_json_kwargs: Any) -> str: + """Generate a JSON schema (as JSON) for the passed model or dynamically generated one""" + return _get_parsing_type(type_, type_name=title).schema_json(**schema_json_kwargs) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/types.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/types.py new file mode 100644 index 0000000000000000000000000000000000000000..0cd789a44561ec6885a67b5cc975bdb0cf2f55c1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/types.py @@ -0,0 +1,1205 @@ +import abc +import math +import re +import warnings +from datetime import date +from decimal import Decimal, InvalidOperation +from enum import Enum +from pathlib import Path +from types import new_class +from typing import ( + TYPE_CHECKING, + Any, + Callable, + ClassVar, + Dict, + FrozenSet, + List, + Optional, + Pattern, + Set, + Tuple, + Type, + TypeVar, + Union, + cast, + overload, +) +from uuid import UUID +from weakref import WeakSet + +from pydantic.v1 import errors +from pydantic.v1.datetime_parse import parse_date +from pydantic.v1.utils import import_string, update_not_none +from pydantic.v1.validators import ( + bytes_validator, + constr_length_validator, + constr_lower, + constr_strip_whitespace, + constr_upper, + decimal_validator, + float_finite_validator, + float_validator, + frozenset_validator, + int_validator, + list_validator, + number_multiple_validator, + number_size_validator, + path_exists_validator, + path_validator, + set_validator, + str_validator, + strict_bytes_validator, + strict_float_validator, + strict_int_validator, + strict_str_validator, +) + +__all__ = [ + 'NoneStr', + 'NoneBytes', + 'StrBytes', + 'NoneStrBytes', + 'StrictStr', + 'ConstrainedBytes', + 'conbytes', + 'ConstrainedList', + 'conlist', + 'ConstrainedSet', + 'conset', + 'ConstrainedFrozenSet', + 'confrozenset', + 'ConstrainedStr', + 'constr', + 'PyObject', + 'ConstrainedInt', + 'conint', + 'PositiveInt', + 'NegativeInt', + 'NonNegativeInt', + 'NonPositiveInt', + 'ConstrainedFloat', + 'confloat', + 'PositiveFloat', + 'NegativeFloat', + 'NonNegativeFloat', + 'NonPositiveFloat', + 'FiniteFloat', + 'ConstrainedDecimal', + 'condecimal', + 'UUID1', + 'UUID3', + 'UUID4', + 'UUID5', + 'FilePath', + 'DirectoryPath', + 'Json', + 'JsonWrapper', + 'SecretField', + 'SecretStr', + 'SecretBytes', + 'StrictBool', + 'StrictBytes', + 'StrictInt', + 'StrictFloat', + 'PaymentCardNumber', + 'ByteSize', + 'PastDate', + 'FutureDate', + 'ConstrainedDate', + 'condate', +] + +NoneStr = Optional[str] +NoneBytes = Optional[bytes] +StrBytes = Union[str, bytes] +NoneStrBytes = Optional[StrBytes] +OptionalInt = Optional[int] +OptionalIntFloat = Union[OptionalInt, float] +OptionalIntFloatDecimal = Union[OptionalIntFloat, Decimal] +OptionalDate = Optional[date] +StrIntFloat = Union[str, int, float] + +if TYPE_CHECKING: + from typing_extensions import Annotated + + from pydantic.v1.dataclasses import Dataclass + from pydantic.v1.main import BaseModel + from pydantic.v1.typing import CallableGenerator + + ModelOrDc = Type[Union[BaseModel, Dataclass]] + +T = TypeVar('T') +_DEFINED_TYPES: 'WeakSet[type]' = WeakSet() + + +@overload +def _registered(typ: Type[T]) -> Type[T]: + pass + + +@overload +def _registered(typ: 'ConstrainedNumberMeta') -> 'ConstrainedNumberMeta': + pass + + +def _registered(typ: Union[Type[T], 'ConstrainedNumberMeta']) -> Union[Type[T], 'ConstrainedNumberMeta']: + # In order to generate valid examples of constrained types, Hypothesis needs + # to inspect the type object - so we keep a weakref to each contype object + # until it can be registered. When (or if) our Hypothesis plugin is loaded, + # it monkeypatches this function. + # If Hypothesis is never used, the total effect is to keep a weak reference + # which has minimal memory usage and doesn't even affect garbage collection. + _DEFINED_TYPES.add(typ) + return typ + + +class ConstrainedNumberMeta(type): + def __new__(cls, name: str, bases: Any, dct: Dict[str, Any]) -> 'ConstrainedInt': # type: ignore + new_cls = cast('ConstrainedInt', type.__new__(cls, name, bases, dct)) + + if new_cls.gt is not None and new_cls.ge is not None: + raise errors.ConfigError('bounds gt and ge cannot be specified at the same time') + if new_cls.lt is not None and new_cls.le is not None: + raise errors.ConfigError('bounds lt and le cannot be specified at the same time') + + return _registered(new_cls) # type: ignore + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BOOLEAN TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +if TYPE_CHECKING: + StrictBool = bool +else: + + class StrictBool(int): + """ + StrictBool to allow for bools which are not type-coerced. + """ + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(type='boolean') + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + + @classmethod + def validate(cls, value: Any) -> bool: + """ + Ensure that we only allow bools. + """ + if isinstance(value, bool): + return value + + raise errors.StrictBoolError() + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTEGER TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +class ConstrainedInt(int, metaclass=ConstrainedNumberMeta): + strict: bool = False + gt: OptionalInt = None + ge: OptionalInt = None + lt: OptionalInt = None + le: OptionalInt = None + multiple_of: OptionalInt = None + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none( + field_schema, + exclusiveMinimum=cls.gt, + exclusiveMaximum=cls.lt, + minimum=cls.ge, + maximum=cls.le, + multipleOf=cls.multiple_of, + ) + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield strict_int_validator if cls.strict else int_validator + yield number_size_validator + yield number_multiple_validator + + +def conint( + *, + strict: bool = False, + gt: Optional[int] = None, + ge: Optional[int] = None, + lt: Optional[int] = None, + le: Optional[int] = None, + multiple_of: Optional[int] = None, +) -> Type[int]: + # use kwargs then define conf in a dict to aid with IDE type hinting + namespace = dict(strict=strict, gt=gt, ge=ge, lt=lt, le=le, multiple_of=multiple_of) + return type('ConstrainedIntValue', (ConstrainedInt,), namespace) + + +if TYPE_CHECKING: + PositiveInt = int + NegativeInt = int + NonPositiveInt = int + NonNegativeInt = int + StrictInt = int +else: + + class PositiveInt(ConstrainedInt): + gt = 0 + + class NegativeInt(ConstrainedInt): + lt = 0 + + class NonPositiveInt(ConstrainedInt): + le = 0 + + class NonNegativeInt(ConstrainedInt): + ge = 0 + + class StrictInt(ConstrainedInt): + strict = True + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FLOAT TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +class ConstrainedFloat(float, metaclass=ConstrainedNumberMeta): + strict: bool = False + gt: OptionalIntFloat = None + ge: OptionalIntFloat = None + lt: OptionalIntFloat = None + le: OptionalIntFloat = None + multiple_of: OptionalIntFloat = None + allow_inf_nan: Optional[bool] = None + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none( + field_schema, + exclusiveMinimum=cls.gt, + exclusiveMaximum=cls.lt, + minimum=cls.ge, + maximum=cls.le, + multipleOf=cls.multiple_of, + ) + # Modify constraints to account for differences between IEEE floats and JSON + if field_schema.get('exclusiveMinimum') == -math.inf: + del field_schema['exclusiveMinimum'] + if field_schema.get('minimum') == -math.inf: + del field_schema['minimum'] + if field_schema.get('exclusiveMaximum') == math.inf: + del field_schema['exclusiveMaximum'] + if field_schema.get('maximum') == math.inf: + del field_schema['maximum'] + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield strict_float_validator if cls.strict else float_validator + yield number_size_validator + yield number_multiple_validator + yield float_finite_validator + + +def confloat( + *, + strict: bool = False, + gt: float = None, + ge: float = None, + lt: float = None, + le: float = None, + multiple_of: float = None, + allow_inf_nan: Optional[bool] = None, +) -> Type[float]: + # use kwargs then define conf in a dict to aid with IDE type hinting + namespace = dict(strict=strict, gt=gt, ge=ge, lt=lt, le=le, multiple_of=multiple_of, allow_inf_nan=allow_inf_nan) + return type('ConstrainedFloatValue', (ConstrainedFloat,), namespace) + + +if TYPE_CHECKING: + PositiveFloat = float + NegativeFloat = float + NonPositiveFloat = float + NonNegativeFloat = float + StrictFloat = float + FiniteFloat = float +else: + + class PositiveFloat(ConstrainedFloat): + gt = 0 + + class NegativeFloat(ConstrainedFloat): + lt = 0 + + class NonPositiveFloat(ConstrainedFloat): + le = 0 + + class NonNegativeFloat(ConstrainedFloat): + ge = 0 + + class StrictFloat(ConstrainedFloat): + strict = True + + class FiniteFloat(ConstrainedFloat): + allow_inf_nan = False + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTES TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +class ConstrainedBytes(bytes): + strip_whitespace = False + to_upper = False + to_lower = False + min_length: OptionalInt = None + max_length: OptionalInt = None + strict: bool = False + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none(field_schema, minLength=cls.min_length, maxLength=cls.max_length) + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield strict_bytes_validator if cls.strict else bytes_validator + yield constr_strip_whitespace + yield constr_upper + yield constr_lower + yield constr_length_validator + + +def conbytes( + *, + strip_whitespace: bool = False, + to_upper: bool = False, + to_lower: bool = False, + min_length: Optional[int] = None, + max_length: Optional[int] = None, + strict: bool = False, +) -> Type[bytes]: + # use kwargs then define conf in a dict to aid with IDE type hinting + namespace = dict( + strip_whitespace=strip_whitespace, + to_upper=to_upper, + to_lower=to_lower, + min_length=min_length, + max_length=max_length, + strict=strict, + ) + return _registered(type('ConstrainedBytesValue', (ConstrainedBytes,), namespace)) + + +if TYPE_CHECKING: + StrictBytes = bytes +else: + + class StrictBytes(ConstrainedBytes): + strict = True + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ STRING TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +class ConstrainedStr(str): + strip_whitespace = False + to_upper = False + to_lower = False + min_length: OptionalInt = None + max_length: OptionalInt = None + curtail_length: OptionalInt = None + regex: Optional[Union[str, Pattern[str]]] = None + strict = False + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none( + field_schema, + minLength=cls.min_length, + maxLength=cls.max_length, + pattern=cls.regex and cls._get_pattern(cls.regex), + ) + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield strict_str_validator if cls.strict else str_validator + yield constr_strip_whitespace + yield constr_upper + yield constr_lower + yield constr_length_validator + yield cls.validate + + @classmethod + def validate(cls, value: Union[str]) -> Union[str]: + if cls.curtail_length and len(value) > cls.curtail_length: + value = value[: cls.curtail_length] + + if cls.regex: + if not re.match(cls.regex, value): + raise errors.StrRegexError(pattern=cls._get_pattern(cls.regex)) + + return value + + @staticmethod + def _get_pattern(regex: Union[str, Pattern[str]]) -> str: + return regex if isinstance(regex, str) else regex.pattern + + +def constr( + *, + strip_whitespace: bool = False, + to_upper: bool = False, + to_lower: bool = False, + strict: bool = False, + min_length: Optional[int] = None, + max_length: Optional[int] = None, + curtail_length: Optional[int] = None, + regex: Optional[str] = None, +) -> Type[str]: + # use kwargs then define conf in a dict to aid with IDE type hinting + namespace = dict( + strip_whitespace=strip_whitespace, + to_upper=to_upper, + to_lower=to_lower, + strict=strict, + min_length=min_length, + max_length=max_length, + curtail_length=curtail_length, + regex=regex and re.compile(regex), + ) + return _registered(type('ConstrainedStrValue', (ConstrainedStr,), namespace)) + + +if TYPE_CHECKING: + StrictStr = str +else: + + class StrictStr(ConstrainedStr): + strict = True + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SET TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +# This types superclass should be Set[T], but cython chokes on that... +class ConstrainedSet(set): # type: ignore + # Needed for pydantic to detect that this is a set + __origin__ = set + __args__: Set[Type[T]] # type: ignore + + min_items: Optional[int] = None + max_items: Optional[int] = None + item_type: Type[T] # type: ignore + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.set_length_validator + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none(field_schema, minItems=cls.min_items, maxItems=cls.max_items) + + @classmethod + def set_length_validator(cls, v: 'Optional[Set[T]]') -> 'Optional[Set[T]]': + if v is None: + return None + + v = set_validator(v) + v_len = len(v) + + if cls.min_items is not None and v_len < cls.min_items: + raise errors.SetMinLengthError(limit_value=cls.min_items) + + if cls.max_items is not None and v_len > cls.max_items: + raise errors.SetMaxLengthError(limit_value=cls.max_items) + + return v + + +def conset(item_type: Type[T], *, min_items: Optional[int] = None, max_items: Optional[int] = None) -> Type[Set[T]]: + # __args__ is needed to conform to typing generics api + namespace = {'min_items': min_items, 'max_items': max_items, 'item_type': item_type, '__args__': [item_type]} + # We use new_class to be able to deal with Generic types + return new_class('ConstrainedSetValue', (ConstrainedSet,), {}, lambda ns: ns.update(namespace)) + + +# This types superclass should be FrozenSet[T], but cython chokes on that... +class ConstrainedFrozenSet(frozenset): # type: ignore + # Needed for pydantic to detect that this is a set + __origin__ = frozenset + __args__: FrozenSet[Type[T]] # type: ignore + + min_items: Optional[int] = None + max_items: Optional[int] = None + item_type: Type[T] # type: ignore + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.frozenset_length_validator + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none(field_schema, minItems=cls.min_items, maxItems=cls.max_items) + + @classmethod + def frozenset_length_validator(cls, v: 'Optional[FrozenSet[T]]') -> 'Optional[FrozenSet[T]]': + if v is None: + return None + + v = frozenset_validator(v) + v_len = len(v) + + if cls.min_items is not None and v_len < cls.min_items: + raise errors.FrozenSetMinLengthError(limit_value=cls.min_items) + + if cls.max_items is not None and v_len > cls.max_items: + raise errors.FrozenSetMaxLengthError(limit_value=cls.max_items) + + return v + + +def confrozenset( + item_type: Type[T], *, min_items: Optional[int] = None, max_items: Optional[int] = None +) -> Type[FrozenSet[T]]: + # __args__ is needed to conform to typing generics api + namespace = {'min_items': min_items, 'max_items': max_items, 'item_type': item_type, '__args__': [item_type]} + # We use new_class to be able to deal with Generic types + return new_class('ConstrainedFrozenSetValue', (ConstrainedFrozenSet,), {}, lambda ns: ns.update(namespace)) + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LIST TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +# This types superclass should be List[T], but cython chokes on that... +class ConstrainedList(list): # type: ignore + # Needed for pydantic to detect that this is a list + __origin__ = list + __args__: Tuple[Type[T], ...] # type: ignore + + min_items: Optional[int] = None + max_items: Optional[int] = None + unique_items: Optional[bool] = None + item_type: Type[T] # type: ignore + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.list_length_validator + if cls.unique_items: + yield cls.unique_items_validator + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none(field_schema, minItems=cls.min_items, maxItems=cls.max_items, uniqueItems=cls.unique_items) + + @classmethod + def list_length_validator(cls, v: 'Optional[List[T]]') -> 'Optional[List[T]]': + if v is None: + return None + + v = list_validator(v) + v_len = len(v) + + if cls.min_items is not None and v_len < cls.min_items: + raise errors.ListMinLengthError(limit_value=cls.min_items) + + if cls.max_items is not None and v_len > cls.max_items: + raise errors.ListMaxLengthError(limit_value=cls.max_items) + + return v + + @classmethod + def unique_items_validator(cls, v: 'Optional[List[T]]') -> 'Optional[List[T]]': + if v is None: + return None + + for i, value in enumerate(v, start=1): + if value in v[i:]: + raise errors.ListUniqueItemsError() + + return v + + +def conlist( + item_type: Type[T], *, min_items: Optional[int] = None, max_items: Optional[int] = None, unique_items: bool = None +) -> Type[List[T]]: + # __args__ is needed to conform to typing generics api + namespace = dict( + min_items=min_items, max_items=max_items, unique_items=unique_items, item_type=item_type, __args__=(item_type,) + ) + # We use new_class to be able to deal with Generic types + return new_class('ConstrainedListValue', (ConstrainedList,), {}, lambda ns: ns.update(namespace)) + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PYOBJECT TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +if TYPE_CHECKING: + PyObject = Callable[..., Any] +else: + + class PyObject: + validate_always = True + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + + @classmethod + def validate(cls, value: Any) -> Any: + if isinstance(value, Callable): + return value + + try: + value = str_validator(value) + except errors.StrError: + raise errors.PyObjectError(error_message='value is neither a valid import path not a valid callable') + + try: + return import_string(value) + except ImportError as e: + raise errors.PyObjectError(error_message=str(e)) + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECIMAL TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +class ConstrainedDecimal(Decimal, metaclass=ConstrainedNumberMeta): + gt: OptionalIntFloatDecimal = None + ge: OptionalIntFloatDecimal = None + lt: OptionalIntFloatDecimal = None + le: OptionalIntFloatDecimal = None + max_digits: OptionalInt = None + decimal_places: OptionalInt = None + multiple_of: OptionalIntFloatDecimal = None + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none( + field_schema, + exclusiveMinimum=cls.gt, + exclusiveMaximum=cls.lt, + minimum=cls.ge, + maximum=cls.le, + multipleOf=cls.multiple_of, + ) + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield decimal_validator + yield number_size_validator + yield number_multiple_validator + yield cls.validate + + @classmethod + def validate(cls, value: Decimal) -> Decimal: + try: + normalized_value = value.normalize() + except InvalidOperation: + normalized_value = value + digit_tuple, exponent = normalized_value.as_tuple()[1:] + if exponent in {'F', 'n', 'N'}: + raise errors.DecimalIsNotFiniteError() + + if exponent >= 0: + # A positive exponent adds that many trailing zeros. + digits = len(digit_tuple) + exponent + decimals = 0 + else: + # If the absolute value of the negative exponent is larger than the + # number of digits, then it's the same as the number of digits, + # because it'll consume all of the digits in digit_tuple and then + # add abs(exponent) - len(digit_tuple) leading zeros after the + # decimal point. + if abs(exponent) > len(digit_tuple): + digits = decimals = abs(exponent) + else: + digits = len(digit_tuple) + decimals = abs(exponent) + whole_digits = digits - decimals + + if cls.max_digits is not None and digits > cls.max_digits: + raise errors.DecimalMaxDigitsError(max_digits=cls.max_digits) + + if cls.decimal_places is not None and decimals > cls.decimal_places: + raise errors.DecimalMaxPlacesError(decimal_places=cls.decimal_places) + + if cls.max_digits is not None and cls.decimal_places is not None: + expected = cls.max_digits - cls.decimal_places + if whole_digits > expected: + raise errors.DecimalWholeDigitsError(whole_digits=expected) + + return value + + +def condecimal( + *, + gt: Decimal = None, + ge: Decimal = None, + lt: Decimal = None, + le: Decimal = None, + max_digits: Optional[int] = None, + decimal_places: Optional[int] = None, + multiple_of: Decimal = None, +) -> Type[Decimal]: + # use kwargs then define conf in a dict to aid with IDE type hinting + namespace = dict( + gt=gt, ge=ge, lt=lt, le=le, max_digits=max_digits, decimal_places=decimal_places, multiple_of=multiple_of + ) + return type('ConstrainedDecimalValue', (ConstrainedDecimal,), namespace) + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UUID TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +if TYPE_CHECKING: + UUID1 = UUID + UUID3 = UUID + UUID4 = UUID + UUID5 = UUID +else: + + class UUID1(UUID): + _required_version = 1 + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(type='string', format=f'uuid{cls._required_version}') + + class UUID3(UUID1): + _required_version = 3 + + class UUID4(UUID1): + _required_version = 4 + + class UUID5(UUID1): + _required_version = 5 + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PATH TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +if TYPE_CHECKING: + FilePath = Path + DirectoryPath = Path +else: + + class FilePath(Path): + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(format='file-path') + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield path_validator + yield path_exists_validator + yield cls.validate + + @classmethod + def validate(cls, value: Path) -> Path: + if not value.is_file(): + raise errors.PathNotAFileError(path=value) + + return value + + class DirectoryPath(Path): + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(format='directory-path') + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield path_validator + yield path_exists_validator + yield cls.validate + + @classmethod + def validate(cls, value: Path) -> Path: + if not value.is_dir(): + raise errors.PathNotADirectoryError(path=value) + + return value + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +class JsonWrapper: + pass + + +class JsonMeta(type): + def __getitem__(self, t: Type[Any]) -> Type[JsonWrapper]: + if t is Any: + return Json # allow Json[Any] to replecate plain Json + return _registered(type('JsonWrapperValue', (JsonWrapper,), {'inner_type': t})) + + +if TYPE_CHECKING: + Json = Annotated[T, ...] # Json[list[str]] will be recognized by type checkers as list[str] + +else: + + class Json(metaclass=JsonMeta): + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + field_schema.update(type='string', format='json-string') + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SECRET TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +class SecretField(abc.ABC): + """ + Note: this should be implemented as a generic like `SecretField(ABC, Generic[T])`, + the `__init__()` should be part of the abstract class and the + `get_secret_value()` method should use the generic `T` type. + + However Cython doesn't support very well generics at the moment and + the generated code fails to be imported (see + https://github.com/cython/cython/issues/2753). + """ + + def __eq__(self, other: Any) -> bool: + return isinstance(other, self.__class__) and self.get_secret_value() == other.get_secret_value() + + def __str__(self) -> str: + return '**********' if self.get_secret_value() else '' + + def __hash__(self) -> int: + return hash(self.get_secret_value()) + + @abc.abstractmethod + def get_secret_value(self) -> Any: # pragma: no cover + ... + + +class SecretStr(SecretField): + min_length: OptionalInt = None + max_length: OptionalInt = None + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none( + field_schema, + type='string', + writeOnly=True, + format='password', + minLength=cls.min_length, + maxLength=cls.max_length, + ) + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + yield constr_length_validator + + @classmethod + def validate(cls, value: Any) -> 'SecretStr': + if isinstance(value, cls): + return value + value = str_validator(value) + return cls(value) + + def __init__(self, value: str): + self._secret_value = value + + def __repr__(self) -> str: + return f"SecretStr('{self}')" + + def __len__(self) -> int: + return len(self._secret_value) + + def display(self) -> str: + warnings.warn('`secret_str.display()` is deprecated, use `str(secret_str)` instead', DeprecationWarning) + return str(self) + + def get_secret_value(self) -> str: + return self._secret_value + + +class SecretBytes(SecretField): + min_length: OptionalInt = None + max_length: OptionalInt = None + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none( + field_schema, + type='string', + writeOnly=True, + format='password', + minLength=cls.min_length, + maxLength=cls.max_length, + ) + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + yield constr_length_validator + + @classmethod + def validate(cls, value: Any) -> 'SecretBytes': + if isinstance(value, cls): + return value + value = bytes_validator(value) + return cls(value) + + def __init__(self, value: bytes): + self._secret_value = value + + def __repr__(self) -> str: + return f"SecretBytes(b'{self}')" + + def __len__(self) -> int: + return len(self._secret_value) + + def display(self) -> str: + warnings.warn('`secret_bytes.display()` is deprecated, use `str(secret_bytes)` instead', DeprecationWarning) + return str(self) + + def get_secret_value(self) -> bytes: + return self._secret_value + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PAYMENT CARD TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +class PaymentCardBrand(str, Enum): + # If you add another card type, please also add it to the + # Hypothesis strategy in `pydantic._hypothesis_plugin`. + amex = 'American Express' + mastercard = 'Mastercard' + visa = 'Visa' + other = 'other' + + def __str__(self) -> str: + return self.value + + +class PaymentCardNumber(str): + """ + Based on: https://en.wikipedia.org/wiki/Payment_card_number + """ + + strip_whitespace: ClassVar[bool] = True + min_length: ClassVar[int] = 12 + max_length: ClassVar[int] = 19 + bin: str + last4: str + brand: PaymentCardBrand + + def __init__(self, card_number: str): + self.bin = card_number[:6] + self.last4 = card_number[-4:] + self.brand = self._get_brand(card_number) + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield str_validator + yield constr_strip_whitespace + yield constr_length_validator + yield cls.validate_digits + yield cls.validate_luhn_check_digit + yield cls + yield cls.validate_length_for_brand + + @property + def masked(self) -> str: + num_masked = len(self) - 10 # len(bin) + len(last4) == 10 + return f'{self.bin}{"*" * num_masked}{self.last4}' + + @classmethod + def validate_digits(cls, card_number: str) -> str: + if not card_number.isdigit(): + raise errors.NotDigitError + return card_number + + @classmethod + def validate_luhn_check_digit(cls, card_number: str) -> str: + """ + Based on: https://en.wikipedia.org/wiki/Luhn_algorithm + """ + sum_ = int(card_number[-1]) + length = len(card_number) + parity = length % 2 + for i in range(length - 1): + digit = int(card_number[i]) + if i % 2 == parity: + digit *= 2 + if digit > 9: + digit -= 9 + sum_ += digit + valid = sum_ % 10 == 0 + if not valid: + raise errors.LuhnValidationError + return card_number + + @classmethod + def validate_length_for_brand(cls, card_number: 'PaymentCardNumber') -> 'PaymentCardNumber': + """ + Validate length based on BIN for major brands: + https://en.wikipedia.org/wiki/Payment_card_number#Issuer_identification_number_(IIN) + """ + required_length: Union[None, int, str] = None + if card_number.brand in PaymentCardBrand.mastercard: + required_length = 16 + valid = len(card_number) == required_length + elif card_number.brand == PaymentCardBrand.visa: + required_length = '13, 16 or 19' + valid = len(card_number) in {13, 16, 19} + elif card_number.brand == PaymentCardBrand.amex: + required_length = 15 + valid = len(card_number) == required_length + else: + valid = True + if not valid: + raise errors.InvalidLengthForBrand(brand=card_number.brand, required_length=required_length) + return card_number + + @staticmethod + def _get_brand(card_number: str) -> PaymentCardBrand: + if card_number[0] == '4': + brand = PaymentCardBrand.visa + elif 51 <= int(card_number[:2]) <= 55: + brand = PaymentCardBrand.mastercard + elif card_number[:2] in {'34', '37'}: + brand = PaymentCardBrand.amex + else: + brand = PaymentCardBrand.other + return brand + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTE SIZE TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +BYTE_SIZES = { + 'b': 1, + 'kb': 10**3, + 'mb': 10**6, + 'gb': 10**9, + 'tb': 10**12, + 'pb': 10**15, + 'eb': 10**18, + 'kib': 2**10, + 'mib': 2**20, + 'gib': 2**30, + 'tib': 2**40, + 'pib': 2**50, + 'eib': 2**60, +} +BYTE_SIZES.update({k.lower()[0]: v for k, v in BYTE_SIZES.items() if 'i' not in k}) +byte_string_re = re.compile(r'^\s*(\d*\.?\d+)\s*(\w+)?', re.IGNORECASE) + + +class ByteSize(int): + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield cls.validate + + @classmethod + def validate(cls, v: StrIntFloat) -> 'ByteSize': + try: + return cls(int(v)) + except ValueError: + pass + + str_match = byte_string_re.match(str(v)) + if str_match is None: + raise errors.InvalidByteSize() + + scalar, unit = str_match.groups() + if unit is None: + unit = 'b' + + try: + unit_mult = BYTE_SIZES[unit.lower()] + except KeyError: + raise errors.InvalidByteSizeUnit(unit=unit) + + return cls(int(float(scalar) * unit_mult)) + + def human_readable(self, decimal: bool = False) -> str: + if decimal: + divisor = 1000 + units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'] + final_unit = 'EB' + else: + divisor = 1024 + units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'] + final_unit = 'EiB' + + num = float(self) + for unit in units: + if abs(num) < divisor: + return f'{num:0.1f}{unit}' + num /= divisor + + return f'{num:0.1f}{final_unit}' + + def to(self, unit: str) -> float: + try: + unit_div = BYTE_SIZES[unit.lower()] + except KeyError: + raise errors.InvalidByteSizeUnit(unit=unit) + + return self / unit_div + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DATE TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +if TYPE_CHECKING: + PastDate = date + FutureDate = date +else: + + class PastDate(date): + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield parse_date + yield cls.validate + + @classmethod + def validate(cls, value: date) -> date: + if value >= date.today(): + raise errors.DateNotInThePastError() + + return value + + class FutureDate(date): + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield parse_date + yield cls.validate + + @classmethod + def validate(cls, value: date) -> date: + if value <= date.today(): + raise errors.DateNotInTheFutureError() + + return value + + +class ConstrainedDate(date, metaclass=ConstrainedNumberMeta): + gt: OptionalDate = None + ge: OptionalDate = None + lt: OptionalDate = None + le: OptionalDate = None + + @classmethod + def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: + update_not_none(field_schema, exclusiveMinimum=cls.gt, exclusiveMaximum=cls.lt, minimum=cls.ge, maximum=cls.le) + + @classmethod + def __get_validators__(cls) -> 'CallableGenerator': + yield parse_date + yield number_size_validator + + +def condate( + *, + gt: date = None, + ge: date = None, + lt: date = None, + le: date = None, +) -> Type[date]: + # use kwargs then define conf in a dict to aid with IDE type hinting + namespace = dict(gt=gt, ge=ge, lt=lt, le=le) + return type('ConstrainedDateValue', (ConstrainedDate,), namespace) diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/typing.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/typing.py new file mode 100644 index 0000000000000000000000000000000000000000..3038ccda4c8de6ebaf1b8164a30ef7323ac07e65 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/typing.py @@ -0,0 +1,615 @@ +import sys +import typing +from collections.abc import Callable +from os import PathLike +from typing import ( # type: ignore + TYPE_CHECKING, + AbstractSet, + Any, + Callable as TypingCallable, + ClassVar, + Dict, + ForwardRef, + Generator, + Iterable, + List, + Mapping, + NewType, + Optional, + Sequence, + Set, + Tuple, + Type, + TypeVar, + Union, + _eval_type, + cast, + get_type_hints, +) + +from typing_extensions import ( + Annotated, + Final, + Literal, + NotRequired as TypedDictNotRequired, + Required as TypedDictRequired, +) + +try: + from typing import _TypingBase as typing_base # type: ignore +except ImportError: + from typing import _Final as typing_base # type: ignore + +try: + from typing import GenericAlias as TypingGenericAlias # type: ignore +except ImportError: + # python < 3.9 does not have GenericAlias (list[int], tuple[str, ...] and so on) + TypingGenericAlias = () + +try: + from types import UnionType as TypesUnionType # type: ignore +except ImportError: + # python < 3.10 does not have UnionType (str | int, byte | bool and so on) + TypesUnionType = () + + +if sys.version_info < (3, 9): + + def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any: + return type_._evaluate(globalns, localns) + +elif sys.version_info < (3, 12, 4): + + def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any: + # Even though it is the right signature for python 3.9, mypy complains with + # `error: Too many arguments for "_evaluate" of "ForwardRef"` hence the cast... + # Python 3.13/3.12.4+ made `recursive_guard` a kwarg, so name it explicitly to avoid: + # TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' + return cast(Any, type_)._evaluate(globalns, localns, recursive_guard=set()) + +else: + + def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any: + # Pydantic 1.x will not support PEP 695 syntax, but provide `type_params` to avoid + # warnings: + return cast(Any, type_)._evaluate(globalns, localns, type_params=(), recursive_guard=set()) + + +if sys.version_info < (3, 9): + # Ensure we always get all the whole `Annotated` hint, not just the annotated type. + # For 3.7 to 3.8, `get_type_hints` doesn't recognize `typing_extensions.Annotated`, + # so it already returns the full annotation + get_all_type_hints = get_type_hints + +else: + + def get_all_type_hints(obj: Any, globalns: Any = None, localns: Any = None) -> Any: + return get_type_hints(obj, globalns, localns, include_extras=True) + + +_T = TypeVar('_T') + +AnyCallable = TypingCallable[..., Any] +NoArgAnyCallable = TypingCallable[[], Any] + +# workaround for https://github.com/python/mypy/issues/9496 +AnyArgTCallable = TypingCallable[..., _T] + + +# Annotated[...] is implemented by returning an instance of one of these classes, depending on +# python/typing_extensions version. +AnnotatedTypeNames = {'AnnotatedMeta', '_AnnotatedAlias'} + + +LITERAL_TYPES: Set[Any] = {Literal} +if hasattr(typing, 'Literal'): + LITERAL_TYPES.add(typing.Literal) + + +if sys.version_info < (3, 8): + + def get_origin(t: Type[Any]) -> Optional[Type[Any]]: + if type(t).__name__ in AnnotatedTypeNames: + # weirdly this is a runtime requirement, as well as for mypy + return cast(Type[Any], Annotated) + return getattr(t, '__origin__', None) + +else: + from typing import get_origin as _typing_get_origin + + def get_origin(tp: Type[Any]) -> Optional[Type[Any]]: + """ + We can't directly use `typing.get_origin` since we need a fallback to support + custom generic classes like `ConstrainedList` + It should be useless once https://github.com/cython/cython/issues/3537 is + solved and https://github.com/pydantic/pydantic/pull/1753 is merged. + """ + if type(tp).__name__ in AnnotatedTypeNames: + return cast(Type[Any], Annotated) # mypy complains about _SpecialForm + return _typing_get_origin(tp) or getattr(tp, '__origin__', None) + + +if sys.version_info < (3, 8): + from typing import _GenericAlias + + def get_args(t: Type[Any]) -> Tuple[Any, ...]: + """Compatibility version of get_args for python 3.7. + + Mostly compatible with the python 3.8 `typing` module version + and able to handle almost all use cases. + """ + if type(t).__name__ in AnnotatedTypeNames: + return t.__args__ + t.__metadata__ + if isinstance(t, _GenericAlias): + res = t.__args__ + if t.__origin__ is Callable and res and res[0] is not Ellipsis: + res = (list(res[:-1]), res[-1]) + return res + return getattr(t, '__args__', ()) + +else: + from typing import get_args as _typing_get_args + + def _generic_get_args(tp: Type[Any]) -> Tuple[Any, ...]: + """ + In python 3.9, `typing.Dict`, `typing.List`, ... + do have an empty `__args__` by default (instead of the generic ~T for example). + In order to still support `Dict` for example and consider it as `Dict[Any, Any]`, + we retrieve the `_nparams` value that tells us how many parameters it needs. + """ + if hasattr(tp, '_nparams'): + return (Any,) * tp._nparams + # Special case for `tuple[()]`, which used to return ((),) with `typing.Tuple` + # in python 3.10- but now returns () for `tuple` and `Tuple`. + # This will probably be clarified in pydantic v2 + try: + if tp == Tuple[()] or sys.version_info >= (3, 9) and tp == tuple[()]: # type: ignore[misc] + return ((),) + # there is a TypeError when compiled with cython + except TypeError: # pragma: no cover + pass + return () + + def get_args(tp: Type[Any]) -> Tuple[Any, ...]: + """Get type arguments with all substitutions performed. + + For unions, basic simplifications used by Union constructor are performed. + Examples:: + get_args(Dict[str, int]) == (str, int) + get_args(int) == () + get_args(Union[int, Union[T, int], str][int]) == (int, str) + get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int]) + get_args(Callable[[], T][int]) == ([], int) + """ + if type(tp).__name__ in AnnotatedTypeNames: + return tp.__args__ + tp.__metadata__ + # the fallback is needed for the same reasons as `get_origin` (see above) + return _typing_get_args(tp) or getattr(tp, '__args__', ()) or _generic_get_args(tp) + + +if sys.version_info < (3, 9): + + def convert_generics(tp: Type[Any]) -> Type[Any]: + """Python 3.9 and older only supports generics from `typing` module. + They convert strings to ForwardRef automatically. + + Examples:: + typing.List['Hero'] == typing.List[ForwardRef('Hero')] + """ + return tp + +else: + from typing import _UnionGenericAlias # type: ignore + + from typing_extensions import _AnnotatedAlias + + def convert_generics(tp: Type[Any]) -> Type[Any]: + """ + Recursively searches for `str` type hints and replaces them with ForwardRef. + + Examples:: + convert_generics(list['Hero']) == list[ForwardRef('Hero')] + convert_generics(dict['Hero', 'Team']) == dict[ForwardRef('Hero'), ForwardRef('Team')] + convert_generics(typing.Dict['Hero', 'Team']) == typing.Dict[ForwardRef('Hero'), ForwardRef('Team')] + convert_generics(list[str | 'Hero'] | int) == list[str | ForwardRef('Hero')] | int + """ + origin = get_origin(tp) + if not origin or not hasattr(tp, '__args__'): + return tp + + args = get_args(tp) + + # typing.Annotated needs special treatment + if origin is Annotated: + return _AnnotatedAlias(convert_generics(args[0]), args[1:]) + + # recursively replace `str` instances inside of `GenericAlias` with `ForwardRef(arg)` + converted = tuple( + ForwardRef(arg) if isinstance(arg, str) and isinstance(tp, TypingGenericAlias) else convert_generics(arg) + for arg in args + ) + + if converted == args: + return tp + elif isinstance(tp, TypingGenericAlias): + return TypingGenericAlias(origin, converted) + elif isinstance(tp, TypesUnionType): + # recreate types.UnionType (PEP604, Python >= 3.10) + return _UnionGenericAlias(origin, converted) + else: + try: + setattr(tp, '__args__', converted) + except AttributeError: + pass + return tp + + +if sys.version_info < (3, 10): + + def is_union(tp: Optional[Type[Any]]) -> bool: + return tp is Union + + WithArgsTypes = (TypingGenericAlias,) + +else: + import types + import typing + + def is_union(tp: Optional[Type[Any]]) -> bool: + return tp is Union or tp is types.UnionType # noqa: E721 + + WithArgsTypes = (typing._GenericAlias, types.GenericAlias, types.UnionType) + + +StrPath = Union[str, PathLike] + + +if TYPE_CHECKING: + from pydantic.v1.fields import ModelField + + TupleGenerator = Generator[Tuple[str, Any], None, None] + DictStrAny = Dict[str, Any] + DictAny = Dict[Any, Any] + SetStr = Set[str] + ListStr = List[str] + IntStr = Union[int, str] + AbstractSetIntStr = AbstractSet[IntStr] + DictIntStrAny = Dict[IntStr, Any] + MappingIntStrAny = Mapping[IntStr, Any] + CallableGenerator = Generator[AnyCallable, None, None] + ReprArgs = Sequence[Tuple[Optional[str], Any]] + + MYPY = False + if MYPY: + AnyClassMethod = classmethod[Any] + else: + # classmethod[TargetType, CallableParamSpecType, CallableReturnType] + AnyClassMethod = classmethod[Any, Any, Any] + +__all__ = ( + 'AnyCallable', + 'NoArgAnyCallable', + 'NoneType', + 'is_none_type', + 'display_as_type', + 'resolve_annotations', + 'is_callable_type', + 'is_literal_type', + 'all_literal_values', + 'is_namedtuple', + 'is_typeddict', + 'is_typeddict_special', + 'is_new_type', + 'new_type_supertype', + 'is_classvar', + 'is_finalvar', + 'update_field_forward_refs', + 'update_model_forward_refs', + 'TupleGenerator', + 'DictStrAny', + 'DictAny', + 'SetStr', + 'ListStr', + 'IntStr', + 'AbstractSetIntStr', + 'DictIntStrAny', + 'CallableGenerator', + 'ReprArgs', + 'AnyClassMethod', + 'CallableGenerator', + 'WithArgsTypes', + 'get_args', + 'get_origin', + 'get_sub_types', + 'typing_base', + 'get_all_type_hints', + 'is_union', + 'StrPath', + 'MappingIntStrAny', +) + + +NoneType = None.__class__ + + +NONE_TYPES: Tuple[Any, Any, Any] = (None, NoneType, Literal[None]) + + +if sys.version_info < (3, 8): + # Even though this implementation is slower, we need it for python 3.7: + # In python 3.7 "Literal" is not a builtin type and uses a different + # mechanism. + # for this reason `Literal[None] is Literal[None]` evaluates to `False`, + # breaking the faster implementation used for the other python versions. + + def is_none_type(type_: Any) -> bool: + return type_ in NONE_TYPES + +elif sys.version_info[:2] == (3, 8): + + def is_none_type(type_: Any) -> bool: + for none_type in NONE_TYPES: + if type_ is none_type: + return True + # With python 3.8, specifically 3.8.10, Literal "is" check sare very flakey + # can change on very subtle changes like use of types in other modules, + # hopefully this check avoids that issue. + if is_literal_type(type_): # pragma: no cover + return all_literal_values(type_) == (None,) + return False + +else: + + def is_none_type(type_: Any) -> bool: + return type_ in NONE_TYPES + + +def display_as_type(v: Type[Any]) -> str: + if not isinstance(v, typing_base) and not isinstance(v, WithArgsTypes) and not isinstance(v, type): + v = v.__class__ + + if is_union(get_origin(v)): + return f'Union[{", ".join(map(display_as_type, get_args(v)))}]' + + if isinstance(v, WithArgsTypes): + # Generic alias are constructs like `list[int]` + return str(v).replace('typing.', '') + + try: + return v.__name__ + except AttributeError: + # happens with typing objects + return str(v).replace('typing.', '') + + +def resolve_annotations(raw_annotations: Dict[str, Type[Any]], module_name: Optional[str]) -> Dict[str, Type[Any]]: + """ + Partially taken from typing.get_type_hints. + + Resolve string or ForwardRef annotations into type objects if possible. + """ + base_globals: Optional[Dict[str, Any]] = None + if module_name: + try: + module = sys.modules[module_name] + except KeyError: + # happens occasionally, see https://github.com/pydantic/pydantic/issues/2363 + pass + else: + base_globals = module.__dict__ + + annotations = {} + for name, value in raw_annotations.items(): + if isinstance(value, str): + if (3, 10) > sys.version_info >= (3, 9, 8) or sys.version_info >= (3, 10, 1): + value = ForwardRef(value, is_argument=False, is_class=True) + else: + value = ForwardRef(value, is_argument=False) + try: + if sys.version_info >= (3, 13): + value = _eval_type(value, base_globals, None, type_params=()) + else: + value = _eval_type(value, base_globals, None) + except NameError: + # this is ok, it can be fixed with update_forward_refs + pass + annotations[name] = value + return annotations + + +def is_callable_type(type_: Type[Any]) -> bool: + return type_ is Callable or get_origin(type_) is Callable + + +def is_literal_type(type_: Type[Any]) -> bool: + return Literal is not None and get_origin(type_) in LITERAL_TYPES + + +def literal_values(type_: Type[Any]) -> Tuple[Any, ...]: + return get_args(type_) + + +def all_literal_values(type_: Type[Any]) -> Tuple[Any, ...]: + """ + This method is used to retrieve all Literal values as + Literal can be used recursively (see https://www.python.org/dev/peps/pep-0586) + e.g. `Literal[Literal[Literal[1, 2, 3], "foo"], 5, None]` + """ + if not is_literal_type(type_): + return (type_,) + + values = literal_values(type_) + return tuple(x for value in values for x in all_literal_values(value)) + + +def is_namedtuple(type_: Type[Any]) -> bool: + """ + Check if a given class is a named tuple. + It can be either a `typing.NamedTuple` or `collections.namedtuple` + """ + from pydantic.v1.utils import lenient_issubclass + + return lenient_issubclass(type_, tuple) and hasattr(type_, '_fields') + + +def is_typeddict(type_: Type[Any]) -> bool: + """ + Check if a given class is a typed dict (from `typing` or `typing_extensions`) + In 3.10, there will be a public method (https://docs.python.org/3.10/library/typing.html#typing.is_typeddict) + """ + from pydantic.v1.utils import lenient_issubclass + + return lenient_issubclass(type_, dict) and hasattr(type_, '__total__') + + +def _check_typeddict_special(type_: Any) -> bool: + return type_ is TypedDictRequired or type_ is TypedDictNotRequired + + +def is_typeddict_special(type_: Any) -> bool: + """ + Check if type is a TypedDict special form (Required or NotRequired). + """ + return _check_typeddict_special(type_) or _check_typeddict_special(get_origin(type_)) + + +test_type = NewType('test_type', str) + + +def is_new_type(type_: Type[Any]) -> bool: + """ + Check whether type_ was created using typing.NewType + """ + return isinstance(type_, test_type.__class__) and hasattr(type_, '__supertype__') # type: ignore + + +def new_type_supertype(type_: Type[Any]) -> Type[Any]: + while hasattr(type_, '__supertype__'): + type_ = type_.__supertype__ + return type_ + + +def _check_classvar(v: Optional[Type[Any]]) -> bool: + if v is None: + return False + + return v.__class__ == ClassVar.__class__ and getattr(v, '_name', None) == 'ClassVar' + + +def _check_finalvar(v: Optional[Type[Any]]) -> bool: + """ + Check if a given type is a `typing.Final` type. + """ + if v is None: + return False + + return v.__class__ == Final.__class__ and (sys.version_info < (3, 8) or getattr(v, '_name', None) == 'Final') + + +def is_classvar(ann_type: Type[Any]) -> bool: + if _check_classvar(ann_type) or _check_classvar(get_origin(ann_type)): + return True + + # this is an ugly workaround for class vars that contain forward references and are therefore themselves + # forward references, see #3679 + if ann_type.__class__ == ForwardRef and ann_type.__forward_arg__.startswith('ClassVar['): + return True + + return False + + +def is_finalvar(ann_type: Type[Any]) -> bool: + return _check_finalvar(ann_type) or _check_finalvar(get_origin(ann_type)) + + +def update_field_forward_refs(field: 'ModelField', globalns: Any, localns: Any) -> None: + """ + Try to update ForwardRefs on fields based on this ModelField, globalns and localns. + """ + prepare = False + if field.type_.__class__ == ForwardRef: + prepare = True + field.type_ = evaluate_forwardref(field.type_, globalns, localns or None) + if field.outer_type_.__class__ == ForwardRef: + prepare = True + field.outer_type_ = evaluate_forwardref(field.outer_type_, globalns, localns or None) + if prepare: + field.prepare() + + if field.sub_fields: + for sub_f in field.sub_fields: + update_field_forward_refs(sub_f, globalns=globalns, localns=localns) + + if field.discriminator_key is not None: + field.prepare_discriminated_union_sub_fields() + + +def update_model_forward_refs( + model: Type[Any], + fields: Iterable['ModelField'], + json_encoders: Dict[Union[Type[Any], str, ForwardRef], AnyCallable], + localns: 'DictStrAny', + exc_to_suppress: Tuple[Type[BaseException], ...] = (), +) -> None: + """ + Try to update model fields ForwardRefs based on model and localns. + """ + if model.__module__ in sys.modules: + globalns = sys.modules[model.__module__].__dict__.copy() + else: + globalns = {} + + globalns.setdefault(model.__name__, model) + + for f in fields: + try: + update_field_forward_refs(f, globalns=globalns, localns=localns) + except exc_to_suppress: + pass + + for key in set(json_encoders.keys()): + if isinstance(key, str): + fr: ForwardRef = ForwardRef(key) + elif isinstance(key, ForwardRef): + fr = key + else: + continue + + try: + new_key = evaluate_forwardref(fr, globalns, localns or None) + except exc_to_suppress: # pragma: no cover + continue + + json_encoders[new_key] = json_encoders.pop(key) + + +def get_class(type_: Type[Any]) -> Union[None, bool, Type[Any]]: + """ + Tries to get the class of a Type[T] annotation. Returns True if Type is used + without brackets. Otherwise returns None. + """ + if type_ is type: + return True + + if get_origin(type_) is None: + return None + + args = get_args(type_) + if not args or not isinstance(args[0], type): + return True + else: + return args[0] + + +def get_sub_types(tp: Any) -> List[Any]: + """ + Return all the types that are allowed by type `tp` + `tp` can be a `Union` of allowed types or an `Annotated` type + """ + origin = get_origin(tp) + if origin is Annotated: + return get_sub_types(get_args(tp)[0]) + elif is_union(origin): + return [x for t in get_args(tp) for x in get_sub_types(t)] + else: + return [tp] diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/utils.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..02543fd1370844a58f51c9be0341310a515a8ef6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/utils.py @@ -0,0 +1,806 @@ +import keyword +import warnings +import weakref +from collections import OrderedDict, defaultdict, deque +from copy import deepcopy +from itertools import islice, zip_longest +from types import BuiltinFunctionType, CodeType, FunctionType, GeneratorType, LambdaType, ModuleType +from typing import ( + TYPE_CHECKING, + AbstractSet, + Any, + Callable, + Collection, + Dict, + Generator, + Iterable, + Iterator, + List, + Mapping, + NoReturn, + Optional, + Set, + Tuple, + Type, + TypeVar, + Union, +) + +from typing_extensions import Annotated + +from pydantic.v1.errors import ConfigError +from pydantic.v1.typing import ( + NoneType, + WithArgsTypes, + all_literal_values, + display_as_type, + get_args, + get_origin, + is_literal_type, + is_union, +) +from pydantic.v1.version import version_info + +if TYPE_CHECKING: + from inspect import Signature + from pathlib import Path + + from pydantic.v1.config import BaseConfig + from pydantic.v1.dataclasses import Dataclass + from pydantic.v1.fields import ModelField + from pydantic.v1.main import BaseModel + from pydantic.v1.typing import AbstractSetIntStr, DictIntStrAny, IntStr, MappingIntStrAny, ReprArgs + + RichReprResult = Iterable[Union[Any, Tuple[Any], Tuple[str, Any], Tuple[str, Any, Any]]] + +__all__ = ( + 'import_string', + 'sequence_like', + 'validate_field_name', + 'lenient_isinstance', + 'lenient_issubclass', + 'in_ipython', + 'is_valid_identifier', + 'deep_update', + 'update_not_none', + 'almost_equal_floats', + 'get_model', + 'to_camel', + 'to_lower_camel', + 'is_valid_field', + 'smart_deepcopy', + 'PyObjectStr', + 'Representation', + 'GetterDict', + 'ValueItems', + 'version_info', # required here to match behaviour in v1.3 + 'ClassAttribute', + 'path_type', + 'ROOT_KEY', + 'get_unique_discriminator_alias', + 'get_discriminator_alias_and_values', + 'DUNDER_ATTRIBUTES', +) + +ROOT_KEY = '__root__' +# these are types that are returned unchanged by deepcopy +IMMUTABLE_NON_COLLECTIONS_TYPES: Set[Type[Any]] = { + int, + float, + complex, + str, + bool, + bytes, + type, + NoneType, + FunctionType, + BuiltinFunctionType, + LambdaType, + weakref.ref, + CodeType, + # note: including ModuleType will differ from behaviour of deepcopy by not producing error. + # It might be not a good idea in general, but considering that this function used only internally + # against default values of fields, this will allow to actually have a field with module as default value + ModuleType, + NotImplemented.__class__, + Ellipsis.__class__, +} + +# these are types that if empty, might be copied with simple copy() instead of deepcopy() +BUILTIN_COLLECTIONS: Set[Type[Any]] = { + list, + set, + tuple, + frozenset, + dict, + OrderedDict, + defaultdict, + deque, +} + + +def import_string(dotted_path: str) -> Any: + """ + Stolen approximately from django. Import a dotted module path and return the attribute/class designated by the + last name in the path. Raise ImportError if the import fails. + """ + from importlib import import_module + + try: + module_path, class_name = dotted_path.strip(' ').rsplit('.', 1) + except ValueError as e: + raise ImportError(f'"{dotted_path}" doesn\'t look like a module path') from e + + module = import_module(module_path) + try: + return getattr(module, class_name) + except AttributeError as e: + raise ImportError(f'Module "{module_path}" does not define a "{class_name}" attribute') from e + + +def truncate(v: Union[str], *, max_len: int = 80) -> str: + """ + Truncate a value and add a unicode ellipsis (three dots) to the end if it was too long + """ + warnings.warn('`truncate` is no-longer used by pydantic and is deprecated', DeprecationWarning) + if isinstance(v, str) and len(v) > (max_len - 2): + # -3 so quote + string + … + quote has correct length + return (v[: (max_len - 3)] + '…').__repr__() + try: + v = v.__repr__() + except TypeError: + v = v.__class__.__repr__(v) # in case v is a type + if len(v) > max_len: + v = v[: max_len - 1] + '…' + return v + + +def sequence_like(v: Any) -> bool: + return isinstance(v, (list, tuple, set, frozenset, GeneratorType, deque)) + + +def validate_field_name(bases: Iterable[Type[Any]], field_name: str) -> None: + """ + Ensure that the field's name does not shadow an existing attribute of the model. + """ + for base in bases: + if getattr(base, field_name, None): + raise NameError( + f'Field name "{field_name}" shadows a BaseModel attribute; ' + f'use a different field name with "alias=\'{field_name}\'".' + ) + + +def lenient_isinstance(o: Any, class_or_tuple: Union[Type[Any], Tuple[Type[Any], ...], None]) -> bool: + try: + return isinstance(o, class_or_tuple) # type: ignore[arg-type] + except TypeError: + return False + + +def lenient_issubclass(cls: Any, class_or_tuple: Union[Type[Any], Tuple[Type[Any], ...], None]) -> bool: + try: + return isinstance(cls, type) and issubclass(cls, class_or_tuple) # type: ignore[arg-type] + except TypeError: + if isinstance(cls, WithArgsTypes): + return False + raise # pragma: no cover + + +def in_ipython() -> bool: + """ + Check whether we're in an ipython environment, including jupyter notebooks. + """ + try: + eval('__IPYTHON__') + except NameError: + return False + else: # pragma: no cover + return True + + +def is_valid_identifier(identifier: str) -> bool: + """ + Checks that a string is a valid identifier and not a Python keyword. + :param identifier: The identifier to test. + :return: True if the identifier is valid. + """ + return identifier.isidentifier() and not keyword.iskeyword(identifier) + + +KeyType = TypeVar('KeyType') + + +def deep_update(mapping: Dict[KeyType, Any], *updating_mappings: Dict[KeyType, Any]) -> Dict[KeyType, Any]: + updated_mapping = mapping.copy() + for updating_mapping in updating_mappings: + for k, v in updating_mapping.items(): + if k in updated_mapping and isinstance(updated_mapping[k], dict) and isinstance(v, dict): + updated_mapping[k] = deep_update(updated_mapping[k], v) + else: + updated_mapping[k] = v + return updated_mapping + + +def update_not_none(mapping: Dict[Any, Any], **update: Any) -> None: + mapping.update({k: v for k, v in update.items() if v is not None}) + + +def almost_equal_floats(value_1: float, value_2: float, *, delta: float = 1e-8) -> bool: + """ + Return True if two floats are almost equal + """ + return abs(value_1 - value_2) <= delta + + +def generate_model_signature( + init: Callable[..., None], fields: Dict[str, 'ModelField'], config: Type['BaseConfig'] +) -> 'Signature': + """ + Generate signature for model based on its fields + """ + from inspect import Parameter, Signature, signature + + from pydantic.v1.config import Extra + + present_params = signature(init).parameters.values() + merged_params: Dict[str, Parameter] = {} + var_kw = None + use_var_kw = False + + for param in islice(present_params, 1, None): # skip self arg + if param.kind is param.VAR_KEYWORD: + var_kw = param + continue + merged_params[param.name] = param + + if var_kw: # if custom init has no var_kw, fields which are not declared in it cannot be passed through + allow_names = config.allow_population_by_field_name + for field_name, field in fields.items(): + param_name = field.alias + if field_name in merged_params or param_name in merged_params: + continue + elif not is_valid_identifier(param_name): + if allow_names and is_valid_identifier(field_name): + param_name = field_name + else: + use_var_kw = True + continue + + # TODO: replace annotation with actual expected types once #1055 solved + kwargs = {'default': field.default} if not field.required else {} + merged_params[param_name] = Parameter( + param_name, Parameter.KEYWORD_ONLY, annotation=field.annotation, **kwargs + ) + + if config.extra is Extra.allow: + use_var_kw = True + + if var_kw and use_var_kw: + # Make sure the parameter for extra kwargs + # does not have the same name as a field + default_model_signature = [ + ('__pydantic_self__', Parameter.POSITIONAL_OR_KEYWORD), + ('data', Parameter.VAR_KEYWORD), + ] + if [(p.name, p.kind) for p in present_params] == default_model_signature: + # if this is the standard model signature, use extra_data as the extra args name + var_kw_name = 'extra_data' + else: + # else start from var_kw + var_kw_name = var_kw.name + + # generate a name that's definitely unique + while var_kw_name in fields: + var_kw_name += '_' + merged_params[var_kw_name] = var_kw.replace(name=var_kw_name) + + return Signature(parameters=list(merged_params.values()), return_annotation=None) + + +def get_model(obj: Union[Type['BaseModel'], Type['Dataclass']]) -> Type['BaseModel']: + from pydantic.v1.main import BaseModel + + try: + model_cls = obj.__pydantic_model__ # type: ignore + except AttributeError: + model_cls = obj + + if not issubclass(model_cls, BaseModel): + raise TypeError('Unsupported type, must be either BaseModel or dataclass') + return model_cls + + +def to_camel(string: str) -> str: + return ''.join(word.capitalize() for word in string.split('_')) + + +def to_lower_camel(string: str) -> str: + if len(string) >= 1: + pascal_string = to_camel(string) + return pascal_string[0].lower() + pascal_string[1:] + return string.lower() + + +T = TypeVar('T') + + +def unique_list( + input_list: Union[List[T], Tuple[T, ...]], + *, + name_factory: Callable[[T], str] = str, +) -> List[T]: + """ + Make a list unique while maintaining order. + We update the list if another one with the same name is set + (e.g. root validator overridden in subclass) + """ + result: List[T] = [] + result_names: List[str] = [] + for v in input_list: + v_name = name_factory(v) + if v_name not in result_names: + result_names.append(v_name) + result.append(v) + else: + result[result_names.index(v_name)] = v + + return result + + +class PyObjectStr(str): + """ + String class where repr doesn't include quotes. Useful with Representation when you want to return a string + representation of something that valid (or pseudo-valid) python. + """ + + def __repr__(self) -> str: + return str(self) + + +class Representation: + """ + Mixin to provide __str__, __repr__, and __pretty__ methods. See #884 for more details. + + __pretty__ is used by [devtools](https://python-devtools.helpmanual.io/) to provide human readable representations + of objects. + """ + + __slots__: Tuple[str, ...] = tuple() + + def __repr_args__(self) -> 'ReprArgs': + """ + Returns the attributes to show in __str__, __repr__, and __pretty__ this is generally overridden. + + Can either return: + * name - value pairs, e.g.: `[('foo_name', 'foo'), ('bar_name', ['b', 'a', 'r'])]` + * or, just values, e.g.: `[(None, 'foo'), (None, ['b', 'a', 'r'])]` + """ + attrs = ((s, getattr(self, s)) for s in self.__slots__) + return [(a, v) for a, v in attrs if v is not None] + + def __repr_name__(self) -> str: + """ + Name of the instance's class, used in __repr__. + """ + return self.__class__.__name__ + + def __repr_str__(self, join_str: str) -> str: + return join_str.join(repr(v) if a is None else f'{a}={v!r}' for a, v in self.__repr_args__()) + + def __pretty__(self, fmt: Callable[[Any], Any], **kwargs: Any) -> Generator[Any, None, None]: + """ + Used by devtools (https://python-devtools.helpmanual.io/) to provide a human readable representations of objects + """ + yield self.__repr_name__() + '(' + yield 1 + for name, value in self.__repr_args__(): + if name is not None: + yield name + '=' + yield fmt(value) + yield ',' + yield 0 + yield -1 + yield ')' + + def __str__(self) -> str: + return self.__repr_str__(' ') + + def __repr__(self) -> str: + return f'{self.__repr_name__()}({self.__repr_str__(", ")})' + + def __rich_repr__(self) -> 'RichReprResult': + """Get fields for Rich library""" + for name, field_repr in self.__repr_args__(): + if name is None: + yield field_repr + else: + yield name, field_repr + + +class GetterDict(Representation): + """ + Hack to make object's smell just enough like dicts for validate_model. + + We can't inherit from Mapping[str, Any] because it upsets cython so we have to implement all methods ourselves. + """ + + __slots__ = ('_obj',) + + def __init__(self, obj: Any): + self._obj = obj + + def __getitem__(self, key: str) -> Any: + try: + return getattr(self._obj, key) + except AttributeError as e: + raise KeyError(key) from e + + def get(self, key: Any, default: Any = None) -> Any: + return getattr(self._obj, key, default) + + def extra_keys(self) -> Set[Any]: + """ + We don't want to get any other attributes of obj if the model didn't explicitly ask for them + """ + return set() + + def keys(self) -> List[Any]: + """ + Keys of the pseudo dictionary, uses a list not set so order information can be maintained like python + dictionaries. + """ + return list(self) + + def values(self) -> List[Any]: + return [self[k] for k in self] + + def items(self) -> Iterator[Tuple[str, Any]]: + for k in self: + yield k, self.get(k) + + def __iter__(self) -> Iterator[str]: + for name in dir(self._obj): + if not name.startswith('_'): + yield name + + def __len__(self) -> int: + return sum(1 for _ in self) + + def __contains__(self, item: Any) -> bool: + return item in self.keys() + + def __eq__(self, other: Any) -> bool: + return dict(self) == dict(other.items()) + + def __repr_args__(self) -> 'ReprArgs': + return [(None, dict(self))] + + def __repr_name__(self) -> str: + return f'GetterDict[{display_as_type(self._obj)}]' + + +class ValueItems(Representation): + """ + Class for more convenient calculation of excluded or included fields on values. + """ + + __slots__ = ('_items', '_type') + + def __init__(self, value: Any, items: Union['AbstractSetIntStr', 'MappingIntStrAny']) -> None: + items = self._coerce_items(items) + + if isinstance(value, (list, tuple)): + items = self._normalize_indexes(items, len(value)) + + self._items: 'MappingIntStrAny' = items + + def is_excluded(self, item: Any) -> bool: + """ + Check if item is fully excluded. + + :param item: key or index of a value + """ + return self.is_true(self._items.get(item)) + + def is_included(self, item: Any) -> bool: + """ + Check if value is contained in self._items + + :param item: key or index of value + """ + return item in self._items + + def for_element(self, e: 'IntStr') -> Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']]: + """ + :param e: key or index of element on value + :return: raw values for element if self._items is dict and contain needed element + """ + + item = self._items.get(e) + return item if not self.is_true(item) else None + + def _normalize_indexes(self, items: 'MappingIntStrAny', v_length: int) -> 'DictIntStrAny': + """ + :param items: dict or set of indexes which will be normalized + :param v_length: length of sequence indexes of which will be + + >>> self._normalize_indexes({0: True, -2: True, -1: True}, 4) + {0: True, 2: True, 3: True} + >>> self._normalize_indexes({'__all__': True}, 4) + {0: True, 1: True, 2: True, 3: True} + """ + + normalized_items: 'DictIntStrAny' = {} + all_items = None + for i, v in items.items(): + if not (isinstance(v, Mapping) or isinstance(v, AbstractSet) or self.is_true(v)): + raise TypeError(f'Unexpected type of exclude value for index "{i}" {v.__class__}') + if i == '__all__': + all_items = self._coerce_value(v) + continue + if not isinstance(i, int): + raise TypeError( + 'Excluding fields from a sequence of sub-models or dicts must be performed index-wise: ' + 'expected integer keys or keyword "__all__"' + ) + normalized_i = v_length + i if i < 0 else i + normalized_items[normalized_i] = self.merge(v, normalized_items.get(normalized_i)) + + if not all_items: + return normalized_items + if self.is_true(all_items): + for i in range(v_length): + normalized_items.setdefault(i, ...) + return normalized_items + for i in range(v_length): + normalized_item = normalized_items.setdefault(i, {}) + if not self.is_true(normalized_item): + normalized_items[i] = self.merge(all_items, normalized_item) + return normalized_items + + @classmethod + def merge(cls, base: Any, override: Any, intersect: bool = False) -> Any: + """ + Merge a ``base`` item with an ``override`` item. + + Both ``base`` and ``override`` are converted to dictionaries if possible. + Sets are converted to dictionaries with the sets entries as keys and + Ellipsis as values. + + Each key-value pair existing in ``base`` is merged with ``override``, + while the rest of the key-value pairs are updated recursively with this function. + + Merging takes place based on the "union" of keys if ``intersect`` is + set to ``False`` (default) and on the intersection of keys if + ``intersect`` is set to ``True``. + """ + override = cls._coerce_value(override) + base = cls._coerce_value(base) + if override is None: + return base + if cls.is_true(base) or base is None: + return override + if cls.is_true(override): + return base if intersect else override + + # intersection or union of keys while preserving ordering: + if intersect: + merge_keys = [k for k in base if k in override] + [k for k in override if k in base] + else: + merge_keys = list(base) + [k for k in override if k not in base] + + merged: 'DictIntStrAny' = {} + for k in merge_keys: + merged_item = cls.merge(base.get(k), override.get(k), intersect=intersect) + if merged_item is not None: + merged[k] = merged_item + + return merged + + @staticmethod + def _coerce_items(items: Union['AbstractSetIntStr', 'MappingIntStrAny']) -> 'MappingIntStrAny': + if isinstance(items, Mapping): + pass + elif isinstance(items, AbstractSet): + items = dict.fromkeys(items, ...) + else: + class_name = getattr(items, '__class__', '???') + assert_never( + items, + f'Unexpected type of exclude value {class_name}', + ) + return items + + @classmethod + def _coerce_value(cls, value: Any) -> Any: + if value is None or cls.is_true(value): + return value + return cls._coerce_items(value) + + @staticmethod + def is_true(v: Any) -> bool: + return v is True or v is ... + + def __repr_args__(self) -> 'ReprArgs': + return [(None, self._items)] + + +class ClassAttribute: + """ + Hide class attribute from its instances + """ + + __slots__ = ( + 'name', + 'value', + ) + + def __init__(self, name: str, value: Any) -> None: + self.name = name + self.value = value + + def __get__(self, instance: Any, owner: Type[Any]) -> None: + if instance is None: + return self.value + raise AttributeError(f'{self.name!r} attribute of {owner.__name__!r} is class-only') + + +path_types = { + 'is_dir': 'directory', + 'is_file': 'file', + 'is_mount': 'mount point', + 'is_symlink': 'symlink', + 'is_block_device': 'block device', + 'is_char_device': 'char device', + 'is_fifo': 'FIFO', + 'is_socket': 'socket', +} + + +def path_type(p: 'Path') -> str: + """ + Find out what sort of thing a path is. + """ + assert p.exists(), 'path does not exist' + for method, name in path_types.items(): + if getattr(p, method)(): + return name + + return 'unknown' + + +Obj = TypeVar('Obj') + + +def smart_deepcopy(obj: Obj) -> Obj: + """ + Return type as is for immutable built-in types + Use obj.copy() for built-in empty collections + Use copy.deepcopy() for non-empty collections and unknown objects + """ + + obj_type = obj.__class__ + if obj_type in IMMUTABLE_NON_COLLECTIONS_TYPES: + return obj # fastest case: obj is immutable and not collection therefore will not be copied anyway + try: + if not obj and obj_type in BUILTIN_COLLECTIONS: + # faster way for empty collections, no need to copy its members + return obj if obj_type is tuple else obj.copy() # type: ignore # tuple doesn't have copy method + except (TypeError, ValueError, RuntimeError): + # do we really dare to catch ALL errors? Seems a bit risky + pass + + return deepcopy(obj) # slowest way when we actually might need a deepcopy + + +def is_valid_field(name: str) -> bool: + if not name.startswith('_'): + return True + return ROOT_KEY == name + + +DUNDER_ATTRIBUTES = { + '__annotations__', + '__classcell__', + '__doc__', + '__module__', + '__orig_bases__', + '__orig_class__', + '__qualname__', + '__firstlineno__', + '__static_attributes__', +} + + +def is_valid_private_name(name: str) -> bool: + return not is_valid_field(name) and name not in DUNDER_ATTRIBUTES + + +_EMPTY = object() + + +def all_identical(left: Iterable[Any], right: Iterable[Any]) -> bool: + """ + Check that the items of `left` are the same objects as those in `right`. + + >>> a, b = object(), object() + >>> all_identical([a, b, a], [a, b, a]) + True + >>> all_identical([a, b, [a]], [a, b, [a]]) # new list object, while "equal" is not "identical" + False + """ + for left_item, right_item in zip_longest(left, right, fillvalue=_EMPTY): + if left_item is not right_item: + return False + return True + + +def assert_never(obj: NoReturn, msg: str) -> NoReturn: + """ + Helper to make sure that we have covered all possible types. + + This is mostly useful for ``mypy``, docs: + https://mypy.readthedocs.io/en/latest/literal_types.html#exhaustive-checks + """ + raise TypeError(msg) + + +def get_unique_discriminator_alias(all_aliases: Collection[str], discriminator_key: str) -> str: + """Validate that all aliases are the same and if that's the case return the alias""" + unique_aliases = set(all_aliases) + if len(unique_aliases) > 1: + raise ConfigError( + f'Aliases for discriminator {discriminator_key!r} must be the same (got {", ".join(sorted(all_aliases))})' + ) + return unique_aliases.pop() + + +def get_discriminator_alias_and_values(tp: Any, discriminator_key: str) -> Tuple[str, Tuple[str, ...]]: + """ + Get alias and all valid values in the `Literal` type of the discriminator field + `tp` can be a `BaseModel` class or directly an `Annotated` `Union` of many. + """ + is_root_model = getattr(tp, '__custom_root_type__', False) + + if get_origin(tp) is Annotated: + tp = get_args(tp)[0] + + if hasattr(tp, '__pydantic_model__'): + tp = tp.__pydantic_model__ + + if is_union(get_origin(tp)): + alias, all_values = _get_union_alias_and_all_values(tp, discriminator_key) + return alias, tuple(v for values in all_values for v in values) + elif is_root_model: + union_type = tp.__fields__[ROOT_KEY].type_ + alias, all_values = _get_union_alias_and_all_values(union_type, discriminator_key) + + if len(set(all_values)) > 1: + raise ConfigError( + f'Field {discriminator_key!r} is not the same for all submodels of {display_as_type(tp)!r}' + ) + + return alias, all_values[0] + + else: + try: + t_discriminator_type = tp.__fields__[discriminator_key].type_ + except AttributeError as e: + raise TypeError(f'Type {tp.__name__!r} is not a valid `BaseModel` or `dataclass`') from e + except KeyError as e: + raise ConfigError(f'Model {tp.__name__!r} needs a discriminator field for key {discriminator_key!r}') from e + + if not is_literal_type(t_discriminator_type): + raise ConfigError(f'Field {discriminator_key!r} of model {tp.__name__!r} needs to be a `Literal`') + + return tp.__fields__[discriminator_key].alias, all_literal_values(t_discriminator_type) + + +def _get_union_alias_and_all_values( + union_type: Type[Any], discriminator_key: str +) -> Tuple[str, Tuple[Tuple[str, ...], ...]]: + zipped_aliases_values = [get_discriminator_alias_and_values(t, discriminator_key) for t in get_args(union_type)] + # unzip: [('alias_a',('v1', 'v2)), ('alias_b', ('v3',))] => [('alias_a', 'alias_b'), (('v1', 'v2'), ('v3',))] + all_aliases, all_values = zip(*zipped_aliases_values) + return get_unique_discriminator_alias(all_aliases, discriminator_key), all_values diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/validators.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/validators.py new file mode 100644 index 0000000000000000000000000000000000000000..c0940e8114a47ceacf21f4df946a6401946b9b8f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/validators.py @@ -0,0 +1,768 @@ +import math +import re +from collections import OrderedDict, deque +from collections.abc import Hashable as CollectionsHashable +from datetime import date, datetime, time, timedelta +from decimal import Decimal, DecimalException +from enum import Enum, IntEnum +from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network +from pathlib import Path +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Deque, + Dict, + ForwardRef, + FrozenSet, + Generator, + Hashable, + List, + NamedTuple, + Pattern, + Set, + Tuple, + Type, + TypeVar, + Union, +) +from uuid import UUID +from warnings import warn + +from pydantic.v1 import errors +from pydantic.v1.datetime_parse import parse_date, parse_datetime, parse_duration, parse_time +from pydantic.v1.typing import ( + AnyCallable, + all_literal_values, + display_as_type, + get_class, + is_callable_type, + is_literal_type, + is_namedtuple, + is_none_type, + is_typeddict, +) +from pydantic.v1.utils import almost_equal_floats, lenient_issubclass, sequence_like + +if TYPE_CHECKING: + from typing_extensions import Literal, TypedDict + + from pydantic.v1.config import BaseConfig + from pydantic.v1.fields import ModelField + from pydantic.v1.types import ConstrainedDecimal, ConstrainedFloat, ConstrainedInt + + ConstrainedNumber = Union[ConstrainedDecimal, ConstrainedFloat, ConstrainedInt] + AnyOrderedDict = OrderedDict[Any, Any] + Number = Union[int, float, Decimal] + StrBytes = Union[str, bytes] + + +def str_validator(v: Any) -> Union[str]: + if isinstance(v, str): + if isinstance(v, Enum): + return v.value + else: + return v + elif isinstance(v, (float, int, Decimal)): + # is there anything else we want to add here? If you think so, create an issue. + return str(v) + elif isinstance(v, (bytes, bytearray)): + return v.decode() + else: + raise errors.StrError() + + +def strict_str_validator(v: Any) -> Union[str]: + if isinstance(v, str) and not isinstance(v, Enum): + return v + raise errors.StrError() + + +def bytes_validator(v: Any) -> Union[bytes]: + if isinstance(v, bytes): + return v + elif isinstance(v, bytearray): + return bytes(v) + elif isinstance(v, str): + return v.encode() + elif isinstance(v, (float, int, Decimal)): + return str(v).encode() + else: + raise errors.BytesError() + + +def strict_bytes_validator(v: Any) -> Union[bytes]: + if isinstance(v, bytes): + return v + elif isinstance(v, bytearray): + return bytes(v) + else: + raise errors.BytesError() + + +BOOL_FALSE = {0, '0', 'off', 'f', 'false', 'n', 'no'} +BOOL_TRUE = {1, '1', 'on', 't', 'true', 'y', 'yes'} + + +def bool_validator(v: Any) -> bool: + if v is True or v is False: + return v + if isinstance(v, bytes): + v = v.decode() + if isinstance(v, str): + v = v.lower() + try: + if v in BOOL_TRUE: + return True + if v in BOOL_FALSE: + return False + except TypeError: + raise errors.BoolError() + raise errors.BoolError() + + +# matches the default limit cpython, see https://github.com/python/cpython/pull/96500 +max_str_int = 4_300 + + +def int_validator(v: Any) -> int: + if isinstance(v, int) and not (v is True or v is False): + return v + + # see https://github.com/pydantic/pydantic/issues/1477 and in turn, https://github.com/python/cpython/issues/95778 + # this check should be unnecessary once patch releases are out for 3.7, 3.8, 3.9 and 3.10 + # but better to check here until then. + # NOTICE: this does not fully protect user from the DOS risk since the standard library JSON implementation + # (and other std lib modules like xml) use `int()` and are likely called before this, the best workaround is to + # 1. update to the latest patch release of python once released, 2. use a different JSON library like ujson + if isinstance(v, (str, bytes, bytearray)) and len(v) > max_str_int: + raise errors.IntegerError() + + try: + return int(v) + except (TypeError, ValueError, OverflowError): + raise errors.IntegerError() + + +def strict_int_validator(v: Any) -> int: + if isinstance(v, int) and not (v is True or v is False): + return v + raise errors.IntegerError() + + +def float_validator(v: Any) -> float: + if isinstance(v, float): + return v + + try: + return float(v) + except (TypeError, ValueError): + raise errors.FloatError() + + +def strict_float_validator(v: Any) -> float: + if isinstance(v, float): + return v + raise errors.FloatError() + + +def float_finite_validator(v: 'Number', field: 'ModelField', config: 'BaseConfig') -> 'Number': + allow_inf_nan = getattr(field.type_, 'allow_inf_nan', None) + if allow_inf_nan is None: + allow_inf_nan = config.allow_inf_nan + + if allow_inf_nan is False and (math.isnan(v) or math.isinf(v)): + raise errors.NumberNotFiniteError() + return v + + +def number_multiple_validator(v: 'Number', field: 'ModelField') -> 'Number': + field_type: ConstrainedNumber = field.type_ + if field_type.multiple_of is not None: + mod = float(v) / float(field_type.multiple_of) % 1 + if not almost_equal_floats(mod, 0.0) and not almost_equal_floats(mod, 1.0): + raise errors.NumberNotMultipleError(multiple_of=field_type.multiple_of) + return v + + +def number_size_validator(v: 'Number', field: 'ModelField') -> 'Number': + field_type: ConstrainedNumber = field.type_ + if field_type.gt is not None and not v > field_type.gt: + raise errors.NumberNotGtError(limit_value=field_type.gt) + elif field_type.ge is not None and not v >= field_type.ge: + raise errors.NumberNotGeError(limit_value=field_type.ge) + + if field_type.lt is not None and not v < field_type.lt: + raise errors.NumberNotLtError(limit_value=field_type.lt) + if field_type.le is not None and not v <= field_type.le: + raise errors.NumberNotLeError(limit_value=field_type.le) + + return v + + +def constant_validator(v: 'Any', field: 'ModelField') -> 'Any': + """Validate ``const`` fields. + + The value provided for a ``const`` field must be equal to the default value + of the field. This is to support the keyword of the same name in JSON + Schema. + """ + if v != field.default: + raise errors.WrongConstantError(given=v, permitted=[field.default]) + + return v + + +def anystr_length_validator(v: 'StrBytes', config: 'BaseConfig') -> 'StrBytes': + v_len = len(v) + + min_length = config.min_anystr_length + if v_len < min_length: + raise errors.AnyStrMinLengthError(limit_value=min_length) + + max_length = config.max_anystr_length + if max_length is not None and v_len > max_length: + raise errors.AnyStrMaxLengthError(limit_value=max_length) + + return v + + +def anystr_strip_whitespace(v: 'StrBytes') -> 'StrBytes': + return v.strip() + + +def anystr_upper(v: 'StrBytes') -> 'StrBytes': + return v.upper() + + +def anystr_lower(v: 'StrBytes') -> 'StrBytes': + return v.lower() + + +def ordered_dict_validator(v: Any) -> 'AnyOrderedDict': + if isinstance(v, OrderedDict): + return v + + try: + return OrderedDict(v) + except (TypeError, ValueError): + raise errors.DictError() + + +def dict_validator(v: Any) -> Dict[Any, Any]: + if isinstance(v, dict): + return v + + try: + return dict(v) + except (TypeError, ValueError): + raise errors.DictError() + + +def list_validator(v: Any) -> List[Any]: + if isinstance(v, list): + return v + elif sequence_like(v): + return list(v) + else: + raise errors.ListError() + + +def tuple_validator(v: Any) -> Tuple[Any, ...]: + if isinstance(v, tuple): + return v + elif sequence_like(v): + return tuple(v) + else: + raise errors.TupleError() + + +def set_validator(v: Any) -> Set[Any]: + if isinstance(v, set): + return v + elif sequence_like(v): + return set(v) + else: + raise errors.SetError() + + +def frozenset_validator(v: Any) -> FrozenSet[Any]: + if isinstance(v, frozenset): + return v + elif sequence_like(v): + return frozenset(v) + else: + raise errors.FrozenSetError() + + +def deque_validator(v: Any) -> Deque[Any]: + if isinstance(v, deque): + return v + elif sequence_like(v): + return deque(v) + else: + raise errors.DequeError() + + +def enum_member_validator(v: Any, field: 'ModelField', config: 'BaseConfig') -> Enum: + try: + enum_v = field.type_(v) + except ValueError: + # field.type_ should be an enum, so will be iterable + raise errors.EnumMemberError(enum_values=list(field.type_)) + return enum_v.value if config.use_enum_values else enum_v + + +def uuid_validator(v: Any, field: 'ModelField') -> UUID: + try: + if isinstance(v, str): + v = UUID(v) + elif isinstance(v, (bytes, bytearray)): + try: + v = UUID(v.decode()) + except ValueError: + # 16 bytes in big-endian order as the bytes argument fail + # the above check + v = UUID(bytes=v) + except ValueError: + raise errors.UUIDError() + + if not isinstance(v, UUID): + raise errors.UUIDError() + + required_version = getattr(field.type_, '_required_version', None) + if required_version and v.version != required_version: + raise errors.UUIDVersionError(required_version=required_version) + + return v + + +def decimal_validator(v: Any) -> Decimal: + if isinstance(v, Decimal): + return v + elif isinstance(v, (bytes, bytearray)): + v = v.decode() + + v = str(v).strip() + + try: + v = Decimal(v) + except DecimalException: + raise errors.DecimalError() + + if not v.is_finite(): + raise errors.DecimalIsNotFiniteError() + + return v + + +def hashable_validator(v: Any) -> Hashable: + if isinstance(v, Hashable): + return v + + raise errors.HashableError() + + +def ip_v4_address_validator(v: Any) -> IPv4Address: + if isinstance(v, IPv4Address): + return v + + try: + return IPv4Address(v) + except ValueError: + raise errors.IPv4AddressError() + + +def ip_v6_address_validator(v: Any) -> IPv6Address: + if isinstance(v, IPv6Address): + return v + + try: + return IPv6Address(v) + except ValueError: + raise errors.IPv6AddressError() + + +def ip_v4_network_validator(v: Any) -> IPv4Network: + """ + Assume IPv4Network initialised with a default ``strict`` argument + + See more: + https://docs.python.org/library/ipaddress.html#ipaddress.IPv4Network + """ + if isinstance(v, IPv4Network): + return v + + try: + return IPv4Network(v) + except ValueError: + raise errors.IPv4NetworkError() + + +def ip_v6_network_validator(v: Any) -> IPv6Network: + """ + Assume IPv6Network initialised with a default ``strict`` argument + + See more: + https://docs.python.org/library/ipaddress.html#ipaddress.IPv6Network + """ + if isinstance(v, IPv6Network): + return v + + try: + return IPv6Network(v) + except ValueError: + raise errors.IPv6NetworkError() + + +def ip_v4_interface_validator(v: Any) -> IPv4Interface: + if isinstance(v, IPv4Interface): + return v + + try: + return IPv4Interface(v) + except ValueError: + raise errors.IPv4InterfaceError() + + +def ip_v6_interface_validator(v: Any) -> IPv6Interface: + if isinstance(v, IPv6Interface): + return v + + try: + return IPv6Interface(v) + except ValueError: + raise errors.IPv6InterfaceError() + + +def path_validator(v: Any) -> Path: + if isinstance(v, Path): + return v + + try: + return Path(v) + except TypeError: + raise errors.PathError() + + +def path_exists_validator(v: Any) -> Path: + if not v.exists(): + raise errors.PathNotExistsError(path=v) + + return v + + +def callable_validator(v: Any) -> AnyCallable: + """ + Perform a simple check if the value is callable. + + Note: complete matching of argument type hints and return types is not performed + """ + if callable(v): + return v + + raise errors.CallableError(value=v) + + +def enum_validator(v: Any) -> Enum: + if isinstance(v, Enum): + return v + + raise errors.EnumError(value=v) + + +def int_enum_validator(v: Any) -> IntEnum: + if isinstance(v, IntEnum): + return v + + raise errors.IntEnumError(value=v) + + +def make_literal_validator(type_: Any) -> Callable[[Any], Any]: + permitted_choices = all_literal_values(type_) + + # To have a O(1) complexity and still return one of the values set inside the `Literal`, + # we create a dict with the set values (a set causes some problems with the way intersection works). + # In some cases the set value and checked value can indeed be different (see `test_literal_validator_str_enum`) + allowed_choices = {v: v for v in permitted_choices} + + def literal_validator(v: Any) -> Any: + try: + return allowed_choices[v] + except (KeyError, TypeError): + raise errors.WrongConstantError(given=v, permitted=permitted_choices) + + return literal_validator + + +def constr_length_validator(v: 'StrBytes', field: 'ModelField', config: 'BaseConfig') -> 'StrBytes': + v_len = len(v) + + min_length = field.type_.min_length if field.type_.min_length is not None else config.min_anystr_length + if v_len < min_length: + raise errors.AnyStrMinLengthError(limit_value=min_length) + + max_length = field.type_.max_length if field.type_.max_length is not None else config.max_anystr_length + if max_length is not None and v_len > max_length: + raise errors.AnyStrMaxLengthError(limit_value=max_length) + + return v + + +def constr_strip_whitespace(v: 'StrBytes', field: 'ModelField', config: 'BaseConfig') -> 'StrBytes': + strip_whitespace = field.type_.strip_whitespace or config.anystr_strip_whitespace + if strip_whitespace: + v = v.strip() + + return v + + +def constr_upper(v: 'StrBytes', field: 'ModelField', config: 'BaseConfig') -> 'StrBytes': + upper = field.type_.to_upper or config.anystr_upper + if upper: + v = v.upper() + + return v + + +def constr_lower(v: 'StrBytes', field: 'ModelField', config: 'BaseConfig') -> 'StrBytes': + lower = field.type_.to_lower or config.anystr_lower + if lower: + v = v.lower() + return v + + +def validate_json(v: Any, config: 'BaseConfig') -> Any: + if v is None: + # pass None through to other validators + return v + try: + return config.json_loads(v) # type: ignore + except ValueError: + raise errors.JsonError() + except TypeError: + raise errors.JsonTypeError() + + +T = TypeVar('T') + + +def make_arbitrary_type_validator(type_: Type[T]) -> Callable[[T], T]: + def arbitrary_type_validator(v: Any) -> T: + if isinstance(v, type_): + return v + raise errors.ArbitraryTypeError(expected_arbitrary_type=type_) + + return arbitrary_type_validator + + +def make_class_validator(type_: Type[T]) -> Callable[[Any], Type[T]]: + def class_validator(v: Any) -> Type[T]: + if lenient_issubclass(v, type_): + return v + raise errors.SubclassError(expected_class=type_) + + return class_validator + + +def any_class_validator(v: Any) -> Type[T]: + if isinstance(v, type): + return v + raise errors.ClassError() + + +def none_validator(v: Any) -> 'Literal[None]': + if v is None: + return v + raise errors.NotNoneError() + + +def pattern_validator(v: Any) -> Pattern[str]: + if isinstance(v, Pattern): + return v + + str_value = str_validator(v) + + try: + return re.compile(str_value) + except re.error: + raise errors.PatternError() + + +NamedTupleT = TypeVar('NamedTupleT', bound=NamedTuple) + + +def make_namedtuple_validator( + namedtuple_cls: Type[NamedTupleT], config: Type['BaseConfig'] +) -> Callable[[Tuple[Any, ...]], NamedTupleT]: + from pydantic.v1.annotated_types import create_model_from_namedtuple + + NamedTupleModel = create_model_from_namedtuple( + namedtuple_cls, + __config__=config, + __module__=namedtuple_cls.__module__, + ) + namedtuple_cls.__pydantic_model__ = NamedTupleModel # type: ignore[attr-defined] + + def namedtuple_validator(values: Tuple[Any, ...]) -> NamedTupleT: + annotations = NamedTupleModel.__annotations__ + + if len(values) > len(annotations): + raise errors.ListMaxLengthError(limit_value=len(annotations)) + + dict_values: Dict[str, Any] = dict(zip(annotations, values)) + validated_dict_values: Dict[str, Any] = dict(NamedTupleModel(**dict_values)) + return namedtuple_cls(**validated_dict_values) + + return namedtuple_validator + + +def make_typeddict_validator( + typeddict_cls: Type['TypedDict'], config: Type['BaseConfig'] # type: ignore[valid-type] +) -> Callable[[Any], Dict[str, Any]]: + from pydantic.v1.annotated_types import create_model_from_typeddict + + TypedDictModel = create_model_from_typeddict( + typeddict_cls, + __config__=config, + __module__=typeddict_cls.__module__, + ) + typeddict_cls.__pydantic_model__ = TypedDictModel # type: ignore[attr-defined] + + def typeddict_validator(values: 'TypedDict') -> Dict[str, Any]: # type: ignore[valid-type] + return TypedDictModel.parse_obj(values).dict(exclude_unset=True) + + return typeddict_validator + + +class IfConfig: + def __init__(self, validator: AnyCallable, *config_attr_names: str, ignored_value: Any = False) -> None: + self.validator = validator + self.config_attr_names = config_attr_names + self.ignored_value = ignored_value + + def check(self, config: Type['BaseConfig']) -> bool: + return any(getattr(config, name) not in {None, self.ignored_value} for name in self.config_attr_names) + + +# order is important here, for example: bool is a subclass of int so has to come first, datetime before date same, +# IPv4Interface before IPv4Address, etc +_VALIDATORS: List[Tuple[Type[Any], List[Any]]] = [ + (IntEnum, [int_validator, enum_member_validator]), + (Enum, [enum_member_validator]), + ( + str, + [ + str_validator, + IfConfig(anystr_strip_whitespace, 'anystr_strip_whitespace'), + IfConfig(anystr_upper, 'anystr_upper'), + IfConfig(anystr_lower, 'anystr_lower'), + IfConfig(anystr_length_validator, 'min_anystr_length', 'max_anystr_length'), + ], + ), + ( + bytes, + [ + bytes_validator, + IfConfig(anystr_strip_whitespace, 'anystr_strip_whitespace'), + IfConfig(anystr_upper, 'anystr_upper'), + IfConfig(anystr_lower, 'anystr_lower'), + IfConfig(anystr_length_validator, 'min_anystr_length', 'max_anystr_length'), + ], + ), + (bool, [bool_validator]), + (int, [int_validator]), + (float, [float_validator, IfConfig(float_finite_validator, 'allow_inf_nan', ignored_value=True)]), + (Path, [path_validator]), + (datetime, [parse_datetime]), + (date, [parse_date]), + (time, [parse_time]), + (timedelta, [parse_duration]), + (OrderedDict, [ordered_dict_validator]), + (dict, [dict_validator]), + (list, [list_validator]), + (tuple, [tuple_validator]), + (set, [set_validator]), + (frozenset, [frozenset_validator]), + (deque, [deque_validator]), + (UUID, [uuid_validator]), + (Decimal, [decimal_validator]), + (IPv4Interface, [ip_v4_interface_validator]), + (IPv6Interface, [ip_v6_interface_validator]), + (IPv4Address, [ip_v4_address_validator]), + (IPv6Address, [ip_v6_address_validator]), + (IPv4Network, [ip_v4_network_validator]), + (IPv6Network, [ip_v6_network_validator]), +] + + +def find_validators( # noqa: C901 (ignore complexity) + type_: Type[Any], config: Type['BaseConfig'] +) -> Generator[AnyCallable, None, None]: + from pydantic.v1.dataclasses import is_builtin_dataclass, make_dataclass_validator + + if type_ is Any or type_ is object: + return + type_type = type_.__class__ + if type_type == ForwardRef or type_type == TypeVar: + return + + if is_none_type(type_): + yield none_validator + return + if type_ is Pattern or type_ is re.Pattern: + yield pattern_validator + return + if type_ is Hashable or type_ is CollectionsHashable: + yield hashable_validator + return + if is_callable_type(type_): + yield callable_validator + return + if is_literal_type(type_): + yield make_literal_validator(type_) + return + if is_builtin_dataclass(type_): + yield from make_dataclass_validator(type_, config) + return + if type_ is Enum: + yield enum_validator + return + if type_ is IntEnum: + yield int_enum_validator + return + if is_namedtuple(type_): + yield tuple_validator + yield make_namedtuple_validator(type_, config) + return + if is_typeddict(type_): + yield make_typeddict_validator(type_, config) + return + + class_ = get_class(type_) + if class_ is not None: + if class_ is not Any and isinstance(class_, type): + yield make_class_validator(class_) + else: + yield any_class_validator + return + + for val_type, validators in _VALIDATORS: + try: + if issubclass(type_, val_type): + for v in validators: + if isinstance(v, IfConfig): + if v.check(config): + yield v.validator + else: + yield v + return + except TypeError: + raise RuntimeError(f'error checking inheritance of {type_!r} (type: {display_as_type(type_)})') + + if config.arbitrary_types_allowed: + yield make_arbitrary_type_validator(type_) + else: + if hasattr(type_, '__pydantic_core_schema__'): + warn(f'Mixing V1 and V2 models is not supported. `{type_.__name__}` is a V2 model.', UserWarning) + raise RuntimeError(f'no validator found for {type_}, see `arbitrary_types_allowed` in Config') diff --git a/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/version.py b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/version.py new file mode 100644 index 0000000000000000000000000000000000000000..c77cde126f30c68223b1dc852928d5c2272608de --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/pydantic/v1/version.py @@ -0,0 +1,38 @@ +__all__ = 'compiled', 'VERSION', 'version_info' + +VERSION = '1.10.21' + +try: + import cython # type: ignore +except ImportError: + compiled: bool = False +else: # pragma: no cover + try: + compiled = cython.compiled + except AttributeError: + compiled = False + + +def version_info() -> str: + import platform + import sys + from importlib import import_module + from pathlib import Path + + optional_deps = [] + for p in ('devtools', 'dotenv', 'email-validator', 'typing-extensions'): + try: + import_module(p.replace('-', '_')) + except ImportError: + continue + optional_deps.append(p) + + info = { + 'pydantic version': VERSION, + 'pydantic compiled': compiled, + 'install path': Path(__file__).resolve().parent, + 'python version': sys.version, + 'platform': platform.platform(), + 'optional deps. installed': optional_deps, + } + return '\n'.join('{:>30} {}'.format(k + ':', str(v).replace('\n', ' ')) for k, v in info.items()) diff --git a/tool_server/.venv/lib/python3.12/site-packages/sniffio/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/sniffio/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e0fed5c3854d5037efb13e21fd186d0d51b31ba3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/sniffio/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/sniffio/__pycache__/_impl.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/sniffio/__pycache__/_impl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c06ec075687f3604fc1da6af3ae9f5b6e2264e3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/sniffio/__pycache__/_impl.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/sniffio/__pycache__/_version.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/sniffio/__pycache__/_version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ce4cce5da5f08af4d86d1479d59b014408611e2 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/sniffio/__pycache__/_version.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70918a947140849b3b4ecc2244fafc074723a2fc Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/__pycache__/test_sniffio.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/__pycache__/test_sniffio.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91a9bbe5c1762265394697453a8540d70e64ccb5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/__pycache__/test_sniffio.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/test_sniffio.py b/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/test_sniffio.py new file mode 100644 index 0000000000000000000000000000000000000000..02945a947527a9bfb396d0cd35ffee22eda665bb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/sniffio/_tests/test_sniffio.py @@ -0,0 +1,84 @@ +import os +import sys + +import pytest + +from .. import ( + current_async_library, AsyncLibraryNotFoundError, + current_async_library_cvar, thread_local +) + + +def test_basics_cvar(): + with pytest.raises(AsyncLibraryNotFoundError): + current_async_library() + + token = current_async_library_cvar.set("generic-lib") + try: + assert current_async_library() == "generic-lib" + finally: + current_async_library_cvar.reset(token) + + with pytest.raises(AsyncLibraryNotFoundError): + current_async_library() + + +def test_basics_tlocal(): + with pytest.raises(AsyncLibraryNotFoundError): + current_async_library() + + old_name, thread_local.name = thread_local.name, "generic-lib" + try: + assert current_async_library() == "generic-lib" + finally: + thread_local.name = old_name + + with pytest.raises(AsyncLibraryNotFoundError): + current_async_library() + + +def test_asyncio(): + import asyncio + + with pytest.raises(AsyncLibraryNotFoundError): + current_async_library() + + ran = [] + + async def this_is_asyncio(): + assert current_async_library() == "asyncio" + # Call it a second time to exercise the caching logic + assert current_async_library() == "asyncio" + ran.append(True) + + asyncio.run(this_is_asyncio()) + assert ran == [True] + + with pytest.raises(AsyncLibraryNotFoundError): + current_async_library() + + +@pytest.mark.skipif( + sys.version_info >= (3, 12), + reason= + "curio broken on 3.12 (https://github.com/python-trio/sniffio/pull/42)", +) +def test_curio(): + import curio + + with pytest.raises(AsyncLibraryNotFoundError): + current_async_library() + + ran = [] + + async def this_is_curio(): + assert current_async_library() == "curio" + # Call it a second time to exercise the caching logic + assert current_async_library() == "curio" + ran.append(True) + + curio.run(this_is_curio) + assert ran == [True] + + with pytest.raises(AsyncLibraryNotFoundError): + current_async_library() diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette-0.38.6.dist-info/licenses/LICENSE.md b/tool_server/.venv/lib/python3.12/site-packages/starlette-0.38.6.dist-info/licenses/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..d16a60ec5b9963ef86b35a52ac92227014618e6c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette-0.38.6.dist-info/licenses/LICENSE.md @@ -0,0 +1,27 @@ +Copyright © 2018, [Encode OSS Ltd](https://www.encode.io/). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b0469b619b146101398b99fb5616d218a5af2b09 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/_compat.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/_compat.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f778ceefb5f9f70f5d1805466cde91fac4ca4848 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/_compat.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/_exception_handler.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/_exception_handler.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..507b3d9f514cf7883ce9e3d756c3e4645ab0e542 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/_exception_handler.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/_utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c269a01e004eaecc817ca2ec99e789ee6bf5c70f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/_utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/applications.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/applications.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..65f153f52532f31207fc343bda0b88fac44c8fb4 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/applications.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/authentication.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/authentication.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72bd63b737558ca370b58e658e020ba2d2284d97 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/authentication.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/background.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/background.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f3e5480ca2e0c370f4929b61826fff78ee08202 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/background.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/concurrency.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/concurrency.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..548c3cb7986229e90b15fd0b3a1f301ec634f6f5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/concurrency.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/config.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/config.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b860816ee78117a196aa977a5b4607b2533425c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/config.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/convertors.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/convertors.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45a0fb57d6a733bb83b2e3686371db968ee9b226 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/convertors.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/datastructures.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/datastructures.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..573305ffa5074a1e0de6e8b0c86c2e2bb54c99ab Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/datastructures.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/endpoints.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/endpoints.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2604708689ec8ec7b8b57003fab45382c302173e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/endpoints.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/exceptions.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b67868eb505ffc292986c4b174bce41bd3ad06b4 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/exceptions.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/formparsers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/formparsers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..84d25e461ae790cc71127bc74eff7bd1a9a0587c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/formparsers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/requests.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/requests.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aff86dcd5cb5329160b23b1f25fe06f5dab97309 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/requests.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/responses.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/responses.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f93284398f41f8ec4ca08e028092f7c99885f7c8 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/responses.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/routing.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/routing.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2557faf21e405b3fe4097ed03241936139733c42 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/routing.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/schemas.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/schemas.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d66abbb469e9e69fbfe31da38ac5e6fe3dc1e5ae Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/schemas.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/staticfiles.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/staticfiles.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ef6d94763a855fb4739cd625c8282e9c7e4db5e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/staticfiles.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/status.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/status.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28767855965ba77a61273ddbfa862ca18977d828 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/status.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/templating.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/templating.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a810365ada714988d5951f730ad2f5249c61ea5b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/templating.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/testclient.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/testclient.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c9b012ffc6ebdc592118320d6e0bbb713157ec9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/testclient.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/types.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/types.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a79c76da188ad0fbae3a5fca2690458f22157be9 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/types.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/websockets.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/websockets.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29cb81bfaac810f9955cc8cf2911e43a86c09e82 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/__pycache__/websockets.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8566aac08a6d1bce4d8fd3fdc7457f56f1852f11 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__init__.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +import sys +from typing import Any, Iterator, Protocol + +if sys.version_info >= (3, 10): # pragma: no cover + from typing import ParamSpec +else: # pragma: no cover + from typing_extensions import ParamSpec + +from starlette.types import ASGIApp, Receive, Scope, Send + +P = ParamSpec("P") + + +class _MiddlewareClass(Protocol[P]): + def __init__(self, app: ASGIApp, *args: P.args, **kwargs: P.kwargs) -> None: ... # pragma: no cover + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: ... # pragma: no cover + + +class Middleware: + def __init__( + self, + cls: type[_MiddlewareClass[P]], + *args: P.args, + **kwargs: P.kwargs, + ) -> None: + self.cls = cls + self.args = args + self.kwargs = kwargs + + def __iter__(self) -> Iterator[Any]: + as_tuple = (self.cls, self.args, self.kwargs) + return iter(as_tuple) + + def __repr__(self) -> str: + class_name = self.__class__.__name__ + args_strings = [f"{value!r}" for value in self.args] + option_strings = [f"{key}={value!r}" for key, value in self.kwargs.items()] + args_repr = ", ".join([self.cls.__name__] + args_strings + option_strings) + return f"{class_name}({args_repr})" diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..675a682d512c23987b36ce3cf873350849d1eb80 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/authentication.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/authentication.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6016def5005403a5537b8d80c86dc6f7f74db3fe Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/authentication.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/base.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/base.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f2eb3abe87ad55f6860bd29ccfd2a5d622e5da7d Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/base.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/cors.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/cors.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..657656c6be37606332b28d2b933abe0ce4e23cb1 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/cors.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/errors.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/errors.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4dcc1412009d4ec479e0d1e5229ef5e77a945674 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/errors.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/exceptions.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d58846520f4eef20e75b66b18c7a81d6fcddf1ef Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/exceptions.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/gzip.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/gzip.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..caf09ced6622c6790452bedbd50b9f6730a46b0c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/gzip.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/httpsredirect.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/httpsredirect.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28d8819fd86fc19e0a7245d9a03657e14ef92f2a Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/httpsredirect.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/sessions.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/sessions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..112f690df171d2da54ae505664145f75f22014db Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/sessions.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/trustedhost.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/trustedhost.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89010cbc8648cb7e9325df03d2105451bcf63cab Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/trustedhost.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/wsgi.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/wsgi.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c1263d4dfbe023d1abdc6b52522bab319a1cf73 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/__pycache__/wsgi.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/authentication.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/authentication.py new file mode 100644 index 0000000000000000000000000000000000000000..8555ee0780e98b052eb463d55a1c18e39b257762 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/authentication.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +import typing + +from starlette.authentication import ( + AuthCredentials, + AuthenticationBackend, + AuthenticationError, + UnauthenticatedUser, +) +from starlette.requests import HTTPConnection +from starlette.responses import PlainTextResponse, Response +from starlette.types import ASGIApp, Receive, Scope, Send + + +class AuthenticationMiddleware: + def __init__( + self, + app: ASGIApp, + backend: AuthenticationBackend, + on_error: typing.Callable[[HTTPConnection, AuthenticationError], Response] | None = None, + ) -> None: + self.app = app + self.backend = backend + self.on_error: typing.Callable[[HTTPConnection, AuthenticationError], Response] = ( + on_error if on_error is not None else self.default_on_error + ) + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if scope["type"] not in ["http", "websocket"]: + await self.app(scope, receive, send) + return + + conn = HTTPConnection(scope) + try: + auth_result = await self.backend.authenticate(conn) + except AuthenticationError as exc: + response = self.on_error(conn, exc) + if scope["type"] == "websocket": + await send({"type": "websocket.close", "code": 1000}) + else: + await response(scope, receive, send) + return + + if auth_result is None: + auth_result = AuthCredentials(), UnauthenticatedUser() + scope["auth"], scope["user"] = auth_result + await self.app(scope, receive, send) + + @staticmethod + def default_on_error(conn: HTTPConnection, exc: Exception) -> Response: + return PlainTextResponse(str(exc), status_code=400) diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/base.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/base.py new file mode 100644 index 0000000000000000000000000000000000000000..f51b13f733a9739a0ebd7111b82096bf576a8b87 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/base.py @@ -0,0 +1,228 @@ +from __future__ import annotations + +import typing + +import anyio +from anyio.abc import ObjectReceiveStream, ObjectSendStream + +from starlette._utils import collapse_excgroups +from starlette.requests import ClientDisconnect, Request +from starlette.responses import AsyncContentStream, Response +from starlette.types import ASGIApp, Message, Receive, Scope, Send + +RequestResponseEndpoint = typing.Callable[[Request], typing.Awaitable[Response]] +DispatchFunction = typing.Callable[[Request, RequestResponseEndpoint], typing.Awaitable[Response]] +T = typing.TypeVar("T") + + +class _CachedRequest(Request): + """ + If the user calls Request.body() from their dispatch function + we cache the entire request body in memory and pass that to downstream middlewares, + but if they call Request.stream() then all we do is send an + empty body so that downstream things don't hang forever. + """ + + def __init__(self, scope: Scope, receive: Receive): + super().__init__(scope, receive) + self._wrapped_rcv_disconnected = False + self._wrapped_rcv_consumed = False + self._wrapped_rc_stream = self.stream() + + async def wrapped_receive(self) -> Message: + # wrapped_rcv state 1: disconnected + if self._wrapped_rcv_disconnected: + # we've already sent a disconnect to the downstream app + # we don't need to wait to get another one + # (although most ASGI servers will just keep sending it) + return {"type": "http.disconnect"} + # wrapped_rcv state 1: consumed but not yet disconnected + if self._wrapped_rcv_consumed: + # since the downstream app has consumed us all that is left + # is to send it a disconnect + if self._is_disconnected: + # the middleware has already seen the disconnect + # since we know the client is disconnected no need to wait + # for the message + self._wrapped_rcv_disconnected = True + return {"type": "http.disconnect"} + # we don't know yet if the client is disconnected or not + # so we'll wait until we get that message + msg = await self.receive() + if msg["type"] != "http.disconnect": # pragma: no cover + # at this point a disconnect is all that we should be receiving + # if we get something else, things went wrong somewhere + raise RuntimeError(f"Unexpected message received: {msg['type']}") + self._wrapped_rcv_disconnected = True + return msg + + # wrapped_rcv state 3: not yet consumed + if getattr(self, "_body", None) is not None: + # body() was called, we return it even if the client disconnected + self._wrapped_rcv_consumed = True + return { + "type": "http.request", + "body": self._body, + "more_body": False, + } + elif self._stream_consumed: + # stream() was called to completion + # return an empty body so that downstream apps don't hang + # waiting for a disconnect + self._wrapped_rcv_consumed = True + return { + "type": "http.request", + "body": b"", + "more_body": False, + } + else: + # body() was never called and stream() wasn't consumed + try: + stream = self.stream() + chunk = await stream.__anext__() + self._wrapped_rcv_consumed = self._stream_consumed + return { + "type": "http.request", + "body": chunk, + "more_body": not self._stream_consumed, + } + except ClientDisconnect: + self._wrapped_rcv_disconnected = True + return {"type": "http.disconnect"} + + +class BaseHTTPMiddleware: + def __init__(self, app: ASGIApp, dispatch: DispatchFunction | None = None) -> None: + self.app = app + self.dispatch_func = self.dispatch if dispatch is None else dispatch + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if scope["type"] != "http": + await self.app(scope, receive, send) + return + + request = _CachedRequest(scope, receive) + wrapped_receive = request.wrapped_receive + response_sent = anyio.Event() + + async def call_next(request: Request) -> Response: + app_exc: Exception | None = None + send_stream: ObjectSendStream[typing.MutableMapping[str, typing.Any]] + recv_stream: ObjectReceiveStream[typing.MutableMapping[str, typing.Any]] + send_stream, recv_stream = anyio.create_memory_object_stream() + + async def receive_or_disconnect() -> Message: + if response_sent.is_set(): + return {"type": "http.disconnect"} + + async with anyio.create_task_group() as task_group: + + async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: + result = await func() + task_group.cancel_scope.cancel() + return result + + task_group.start_soon(wrap, response_sent.wait) + message = await wrap(wrapped_receive) + + if response_sent.is_set(): + return {"type": "http.disconnect"} + + return message + + async def close_recv_stream_on_response_sent() -> None: + await response_sent.wait() + recv_stream.close() + + async def send_no_error(message: Message) -> None: + try: + await send_stream.send(message) + except anyio.BrokenResourceError: + # recv_stream has been closed, i.e. response_sent has been set. + return + + async def coro() -> None: + nonlocal app_exc + + async with send_stream: + try: + await self.app(scope, receive_or_disconnect, send_no_error) + except Exception as exc: + app_exc = exc + + task_group.start_soon(close_recv_stream_on_response_sent) + task_group.start_soon(coro) + + try: + message = await recv_stream.receive() + info = message.get("info", None) + if message["type"] == "http.response.debug" and info is not None: + message = await recv_stream.receive() + except anyio.EndOfStream: + if app_exc is not None: + raise app_exc + raise RuntimeError("No response returned.") + + assert message["type"] == "http.response.start" + + async def body_stream() -> typing.AsyncGenerator[bytes, None]: + async with recv_stream: + async for message in recv_stream: + assert message["type"] == "http.response.body" + body = message.get("body", b"") + if body: + yield body + if not message.get("more_body", False): + break + + if app_exc is not None: + raise app_exc + + response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) + response.raw_headers = message["headers"] + return response + + with collapse_excgroups(): + async with anyio.create_task_group() as task_group: + response = await self.dispatch_func(request, call_next) + await response(scope, wrapped_receive, send) + response_sent.set() + + async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: + raise NotImplementedError() # pragma: no cover + + +class _StreamingResponse(Response): + def __init__( + self, + content: AsyncContentStream, + status_code: int = 200, + headers: typing.Mapping[str, str] | None = None, + media_type: str | None = None, + info: typing.Mapping[str, typing.Any] | None = None, + ) -> None: + self.info = info + self.body_iterator = content + self.status_code = status_code + self.media_type = media_type + self.init_headers(headers) + self.background = None + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if self.info is not None: + await send({"type": "http.response.debug", "info": self.info}) + await send( + { + "type": "http.response.start", + "status": self.status_code, + "headers": self.raw_headers, + } + ) + + async for chunk in self.body_iterator: + await send({"type": "http.response.body", "body": chunk, "more_body": True}) + + await send({"type": "http.response.body", "body": b"", "more_body": False}) + + if self.background: + await self.background() diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py new file mode 100644 index 0000000000000000000000000000000000000000..61502691abdcde4ce790cb16c4d28002a6241311 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py @@ -0,0 +1,172 @@ +from __future__ import annotations + +import functools +import re +import typing + +from starlette.datastructures import Headers, MutableHeaders +from starlette.responses import PlainTextResponse, Response +from starlette.types import ASGIApp, Message, Receive, Scope, Send + +ALL_METHODS = ("DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT") +SAFELISTED_HEADERS = {"Accept", "Accept-Language", "Content-Language", "Content-Type"} + + +class CORSMiddleware: + def __init__( + self, + app: ASGIApp, + allow_origins: typing.Sequence[str] = (), + allow_methods: typing.Sequence[str] = ("GET",), + allow_headers: typing.Sequence[str] = (), + allow_credentials: bool = False, + allow_origin_regex: str | None = None, + expose_headers: typing.Sequence[str] = (), + max_age: int = 600, + ) -> None: + if "*" in allow_methods: + allow_methods = ALL_METHODS + + compiled_allow_origin_regex = None + if allow_origin_regex is not None: + compiled_allow_origin_regex = re.compile(allow_origin_regex) + + allow_all_origins = "*" in allow_origins + allow_all_headers = "*" in allow_headers + preflight_explicit_allow_origin = not allow_all_origins or allow_credentials + + simple_headers = {} + if allow_all_origins: + simple_headers["Access-Control-Allow-Origin"] = "*" + if allow_credentials: + simple_headers["Access-Control-Allow-Credentials"] = "true" + if expose_headers: + simple_headers["Access-Control-Expose-Headers"] = ", ".join(expose_headers) + + preflight_headers = {} + if preflight_explicit_allow_origin: + # The origin value will be set in preflight_response() if it is allowed. + preflight_headers["Vary"] = "Origin" + else: + preflight_headers["Access-Control-Allow-Origin"] = "*" + preflight_headers.update( + { + "Access-Control-Allow-Methods": ", ".join(allow_methods), + "Access-Control-Max-Age": str(max_age), + } + ) + allow_headers = sorted(SAFELISTED_HEADERS | set(allow_headers)) + if allow_headers and not allow_all_headers: + preflight_headers["Access-Control-Allow-Headers"] = ", ".join(allow_headers) + if allow_credentials: + preflight_headers["Access-Control-Allow-Credentials"] = "true" + + self.app = app + self.allow_origins = allow_origins + self.allow_methods = allow_methods + self.allow_headers = [h.lower() for h in allow_headers] + self.allow_all_origins = allow_all_origins + self.allow_all_headers = allow_all_headers + self.preflight_explicit_allow_origin = preflight_explicit_allow_origin + self.allow_origin_regex = compiled_allow_origin_regex + self.simple_headers = simple_headers + self.preflight_headers = preflight_headers + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if scope["type"] != "http": # pragma: no cover + await self.app(scope, receive, send) + return + + method = scope["method"] + headers = Headers(scope=scope) + origin = headers.get("origin") + + if origin is None: + await self.app(scope, receive, send) + return + + if method == "OPTIONS" and "access-control-request-method" in headers: + response = self.preflight_response(request_headers=headers) + await response(scope, receive, send) + return + + await self.simple_response(scope, receive, send, request_headers=headers) + + def is_allowed_origin(self, origin: str) -> bool: + if self.allow_all_origins: + return True + + if self.allow_origin_regex is not None and self.allow_origin_regex.fullmatch(origin): + return True + + return origin in self.allow_origins + + def preflight_response(self, request_headers: Headers) -> Response: + requested_origin = request_headers["origin"] + requested_method = request_headers["access-control-request-method"] + requested_headers = request_headers.get("access-control-request-headers") + + headers = dict(self.preflight_headers) + failures = [] + + if self.is_allowed_origin(origin=requested_origin): + if self.preflight_explicit_allow_origin: + # The "else" case is already accounted for in self.preflight_headers + # and the value would be "*". + headers["Access-Control-Allow-Origin"] = requested_origin + else: + failures.append("origin") + + if requested_method not in self.allow_methods: + failures.append("method") + + # If we allow all headers, then we have to mirror back any requested + # headers in the response. + if self.allow_all_headers and requested_headers is not None: + headers["Access-Control-Allow-Headers"] = requested_headers + elif requested_headers is not None: + for header in [h.lower() for h in requested_headers.split(",")]: + if header.strip() not in self.allow_headers: + failures.append("headers") + break + + # We don't strictly need to use 400 responses here, since its up to + # the browser to enforce the CORS policy, but its more informative + # if we do. + if failures: + failure_text = "Disallowed CORS " + ", ".join(failures) + return PlainTextResponse(failure_text, status_code=400, headers=headers) + + return PlainTextResponse("OK", status_code=200, headers=headers) + + async def simple_response(self, scope: Scope, receive: Receive, send: Send, request_headers: Headers) -> None: + send = functools.partial(self.send, send=send, request_headers=request_headers) + await self.app(scope, receive, send) + + async def send(self, message: Message, send: Send, request_headers: Headers) -> None: + if message["type"] != "http.response.start": + await send(message) + return + + message.setdefault("headers", []) + headers = MutableHeaders(scope=message) + headers.update(self.simple_headers) + origin = request_headers["Origin"] + has_cookie = "cookie" in request_headers + + # If request includes any cookie headers, then we must respond + # with the specific origin instead of '*'. + if self.allow_all_origins and has_cookie: + self.allow_explicit_origin(headers, origin) + + # If we only allow specific origins, then we have to mirror back + # the Origin header in the response. + elif not self.allow_all_origins and self.is_allowed_origin(origin=origin): + self.allow_explicit_origin(headers, origin) + + await send(message) + + @staticmethod + def allow_explicit_origin(headers: MutableHeaders, origin: str) -> None: + headers["Access-Control-Allow-Origin"] = origin + headers.add_vary_header("Origin") diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py new file mode 100644 index 0000000000000000000000000000000000000000..76ad776be2272b6ee6ad1e5cd948762465bf0dcc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py @@ -0,0 +1,260 @@ +from __future__ import annotations + +import html +import inspect +import sys +import traceback +import typing + +from starlette._utils import is_async_callable +from starlette.concurrency import run_in_threadpool +from starlette.requests import Request +from starlette.responses import HTMLResponse, PlainTextResponse, Response +from starlette.types import ASGIApp, Message, Receive, Scope, Send + +STYLES = """ +p { + color: #211c1c; +} +.traceback-container { + border: 1px solid #038BB8; +} +.traceback-title { + background-color: #038BB8; + color: lemonchiffon; + padding: 12px; + font-size: 20px; + margin-top: 0px; +} +.frame-line { + padding-left: 10px; + font-family: monospace; +} +.frame-filename { + font-family: monospace; +} +.center-line { + background-color: #038BB8; + color: #f9f6e1; + padding: 5px 0px 5px 5px; +} +.lineno { + margin-right: 5px; +} +.frame-title { + font-weight: unset; + padding: 10px 10px 10px 10px; + background-color: #E4F4FD; + margin-right: 10px; + color: #191f21; + font-size: 17px; + border: 1px solid #c7dce8; +} +.collapse-btn { + float: right; + padding: 0px 5px 1px 5px; + border: solid 1px #96aebb; + cursor: pointer; +} +.collapsed { + display: none; +} +.source-code { + font-family: courier; + font-size: small; + padding-bottom: 10px; +} +""" + +JS = """ + +""" + +TEMPLATE = """ + + + + Starlette Debugger + + +

500 Server Error

+

{error}

+
+

Traceback

+
{exc_html}
+
+ {js} + + +""" + +FRAME_TEMPLATE = """ +
+

File {frame_filename}, + line {frame_lineno}, + in {frame_name} + {collapse_button} +

+
{code_context}
+
+""" # noqa: E501 + +LINE = """ +

+{lineno}. {line}

+""" + +CENTER_LINE = """ +

+{lineno}. {line}

+""" + + +class ServerErrorMiddleware: + """ + Handles returning 500 responses when a server error occurs. + + If 'debug' is set, then traceback responses will be returned, + otherwise the designated 'handler' will be called. + + This middleware class should generally be used to wrap *everything* + else up, so that unhandled exceptions anywhere in the stack + always result in an appropriate 500 response. + """ + + def __init__( + self, + app: ASGIApp, + handler: typing.Callable[[Request, Exception], typing.Any] | None = None, + debug: bool = False, + ) -> None: + self.app = app + self.handler = handler + self.debug = debug + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if scope["type"] != "http": + await self.app(scope, receive, send) + return + + response_started = False + + async def _send(message: Message) -> None: + nonlocal response_started, send + + if message["type"] == "http.response.start": + response_started = True + await send(message) + + try: + await self.app(scope, receive, _send) + except Exception as exc: + request = Request(scope) + if self.debug: + # In debug mode, return traceback responses. + response = self.debug_response(request, exc) + elif self.handler is None: + # Use our default 500 error handler. + response = self.error_response(request, exc) + else: + # Use an installed 500 error handler. + if is_async_callable(self.handler): + response = await self.handler(request, exc) + else: + response = await run_in_threadpool(self.handler, request, exc) + + if not response_started: + await response(scope, receive, send) + + # We always continue to raise the exception. + # This allows servers to log the error, or allows test clients + # to optionally raise the error within the test case. + raise exc + + def format_line(self, index: int, line: str, frame_lineno: int, frame_index: int) -> str: + values = { + # HTML escape - line could contain < or > + "line": html.escape(line).replace(" ", " "), + "lineno": (frame_lineno - frame_index) + index, + } + + if index != frame_index: + return LINE.format(**values) + return CENTER_LINE.format(**values) + + def generate_frame_html(self, frame: inspect.FrameInfo, is_collapsed: bool) -> str: + code_context = "".join( + self.format_line( + index, + line, + frame.lineno, + frame.index, # type: ignore[arg-type] + ) + for index, line in enumerate(frame.code_context or []) + ) + + values = { + # HTML escape - filename could contain < or >, especially if it's a virtual + # file e.g. in the REPL + "frame_filename": html.escape(frame.filename), + "frame_lineno": frame.lineno, + # HTML escape - if you try very hard it's possible to name a function with < + # or > + "frame_name": html.escape(frame.function), + "code_context": code_context, + "collapsed": "collapsed" if is_collapsed else "", + "collapse_button": "+" if is_collapsed else "‒", + } + return FRAME_TEMPLATE.format(**values) + + def generate_html(self, exc: Exception, limit: int = 7) -> str: + traceback_obj = traceback.TracebackException.from_exception(exc, capture_locals=True) + + exc_html = "" + is_collapsed = False + exc_traceback = exc.__traceback__ + if exc_traceback is not None: + frames = inspect.getinnerframes(exc_traceback, limit) + for frame in reversed(frames): + exc_html += self.generate_frame_html(frame, is_collapsed) + is_collapsed = True + + if sys.version_info >= (3, 13): # pragma: no cover + exc_type_str = traceback_obj.exc_type_str + else: # pragma: no cover + exc_type_str = traceback_obj.exc_type.__name__ + + # escape error class and text + error = f"{html.escape(exc_type_str)}: {html.escape(str(traceback_obj))}" + + return TEMPLATE.format(styles=STYLES, js=JS, error=error, exc_html=exc_html) + + def generate_plain_text(self, exc: Exception) -> str: + return "".join(traceback.format_exception(type(exc), exc, exc.__traceback__)) + + def debug_response(self, request: Request, exc: Exception) -> Response: + accept = request.headers.get("accept", "") + + if "text/html" in accept: + content = self.generate_html(exc) + return HTMLResponse(content, status_code=500) + content = self.generate_plain_text(exc) + return PlainTextResponse(content, status_code=500) + + def error_response(self, request: Request, exc: Exception) -> Response: + return PlainTextResponse("Internal Server Error", status_code=500) diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..d708929e3bae38a055885aa9dd4573b25c87aa3e --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +import typing + +from starlette._exception_handler import ( + ExceptionHandlers, + StatusHandlers, + wrap_app_handling_exceptions, +) +from starlette.exceptions import HTTPException, WebSocketException +from starlette.requests import Request +from starlette.responses import PlainTextResponse, Response +from starlette.types import ASGIApp, Receive, Scope, Send +from starlette.websockets import WebSocket + + +class ExceptionMiddleware: + def __init__( + self, + app: ASGIApp, + handlers: typing.Mapping[typing.Any, typing.Callable[[Request, Exception], Response]] | None = None, + debug: bool = False, + ) -> None: + self.app = app + self.debug = debug # TODO: We ought to handle 404 cases if debug is set. + self._status_handlers: StatusHandlers = {} + self._exception_handlers: ExceptionHandlers = { + HTTPException: self.http_exception, + WebSocketException: self.websocket_exception, + } + if handlers is not None: + for key, value in handlers.items(): + self.add_exception_handler(key, value) + + def add_exception_handler( + self, + exc_class_or_status_code: int | type[Exception], + handler: typing.Callable[[Request, Exception], Response], + ) -> None: + if isinstance(exc_class_or_status_code, int): + self._status_handlers[exc_class_or_status_code] = handler + else: + assert issubclass(exc_class_or_status_code, Exception) + self._exception_handlers[exc_class_or_status_code] = handler + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if scope["type"] not in ("http", "websocket"): + await self.app(scope, receive, send) + return + + scope["starlette.exception_handlers"] = ( + self._exception_handlers, + self._status_handlers, + ) + + conn: Request | WebSocket + if scope["type"] == "http": + conn = Request(scope, receive, send) + else: + conn = WebSocket(scope, receive, send) + + await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) + + def http_exception(self, request: Request, exc: Exception) -> Response: + assert isinstance(exc, HTTPException) + if exc.status_code in {204, 304}: + return Response(status_code=exc.status_code, headers=exc.headers) + return PlainTextResponse(exc.detail, status_code=exc.status_code, headers=exc.headers) + + async def websocket_exception(self, websocket: WebSocket, exc: Exception) -> None: + assert isinstance(exc, WebSocketException) + await websocket.close(code=exc.code, reason=exc.reason) # pragma: no cover diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/gzip.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/gzip.py new file mode 100644 index 0000000000000000000000000000000000000000..127b91e7a77b88b8ad1fc12b5ebad8ae46bc1aea --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/gzip.py @@ -0,0 +1,108 @@ +import gzip +import io +import typing + +from starlette.datastructures import Headers, MutableHeaders +from starlette.types import ASGIApp, Message, Receive, Scope, Send + + +class GZipMiddleware: + def __init__(self, app: ASGIApp, minimum_size: int = 500, compresslevel: int = 9) -> None: + self.app = app + self.minimum_size = minimum_size + self.compresslevel = compresslevel + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if scope["type"] == "http": + headers = Headers(scope=scope) + if "gzip" in headers.get("Accept-Encoding", ""): + responder = GZipResponder(self.app, self.minimum_size, compresslevel=self.compresslevel) + await responder(scope, receive, send) + return + await self.app(scope, receive, send) + + +class GZipResponder: + def __init__(self, app: ASGIApp, minimum_size: int, compresslevel: int = 9) -> None: + self.app = app + self.minimum_size = minimum_size + self.send: Send = unattached_send + self.initial_message: Message = {} + self.started = False + self.content_encoding_set = False + self.gzip_buffer = io.BytesIO() + self.gzip_file = gzip.GzipFile(mode="wb", fileobj=self.gzip_buffer, compresslevel=compresslevel) + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + self.send = send + with self.gzip_buffer, self.gzip_file: + await self.app(scope, receive, self.send_with_gzip) + + async def send_with_gzip(self, message: Message) -> None: + message_type = message["type"] + if message_type == "http.response.start": + # Don't send the initial message until we've determined how to + # modify the outgoing headers correctly. + self.initial_message = message + headers = Headers(raw=self.initial_message["headers"]) + self.content_encoding_set = "content-encoding" in headers + elif message_type == "http.response.body" and self.content_encoding_set: + if not self.started: + self.started = True + await self.send(self.initial_message) + await self.send(message) + elif message_type == "http.response.body" and not self.started: + self.started = True + body = message.get("body", b"") + more_body = message.get("more_body", False) + if len(body) < self.minimum_size and not more_body: + # Don't apply GZip to small outgoing responses. + await self.send(self.initial_message) + await self.send(message) + elif not more_body: + # Standard GZip response. + self.gzip_file.write(body) + self.gzip_file.close() + body = self.gzip_buffer.getvalue() + + headers = MutableHeaders(raw=self.initial_message["headers"]) + headers["Content-Encoding"] = "gzip" + headers["Content-Length"] = str(len(body)) + headers.add_vary_header("Accept-Encoding") + message["body"] = body + + await self.send(self.initial_message) + await self.send(message) + else: + # Initial body in streaming GZip response. + headers = MutableHeaders(raw=self.initial_message["headers"]) + headers["Content-Encoding"] = "gzip" + headers.add_vary_header("Accept-Encoding") + del headers["Content-Length"] + + self.gzip_file.write(body) + message["body"] = self.gzip_buffer.getvalue() + self.gzip_buffer.seek(0) + self.gzip_buffer.truncate() + + await self.send(self.initial_message) + await self.send(message) + + elif message_type == "http.response.body": + # Remaining body in streaming GZip response. + body = message.get("body", b"") + more_body = message.get("more_body", False) + + self.gzip_file.write(body) + if not more_body: + self.gzip_file.close() + + message["body"] = self.gzip_buffer.getvalue() + self.gzip_buffer.seek(0) + self.gzip_buffer.truncate() + + await self.send(message) + + +async def unattached_send(message: Message) -> typing.NoReturn: + raise RuntimeError("send awaitable not set") # pragma: no cover diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/httpsredirect.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/httpsredirect.py new file mode 100644 index 0000000000000000000000000000000000000000..a8359067ff7afb80e979042077d5fa0fff119ddf --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/httpsredirect.py @@ -0,0 +1,19 @@ +from starlette.datastructures import URL +from starlette.responses import RedirectResponse +from starlette.types import ASGIApp, Receive, Scope, Send + + +class HTTPSRedirectMiddleware: + def __init__(self, app: ASGIApp) -> None: + self.app = app + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if scope["type"] in ("http", "websocket") and scope["scheme"] in ("http", "ws"): + url = URL(scope=scope) + redirect_scheme = {"http": "https", "ws": "wss"}[url.scheme] + netloc = url.hostname if url.port in (80, 443) else url.netloc + url = url.replace(scheme=redirect_scheme, netloc=netloc) + response = RedirectResponse(url, status_code=307) + await response(scope, receive, send) + else: + await self.app(scope, receive, send) diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/sessions.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/sessions.py new file mode 100644 index 0000000000000000000000000000000000000000..5f9fcd883b69fb960b067f316d49401aba425b4c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/sessions.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +import json +import typing +from base64 import b64decode, b64encode + +import itsdangerous +from itsdangerous.exc import BadSignature + +from starlette.datastructures import MutableHeaders, Secret +from starlette.requests import HTTPConnection +from starlette.types import ASGIApp, Message, Receive, Scope, Send + + +class SessionMiddleware: + def __init__( + self, + app: ASGIApp, + secret_key: str | Secret, + session_cookie: str = "session", + max_age: int | None = 14 * 24 * 60 * 60, # 14 days, in seconds + path: str = "/", + same_site: typing.Literal["lax", "strict", "none"] = "lax", + https_only: bool = False, + domain: str | None = None, + ) -> None: + self.app = app + self.signer = itsdangerous.TimestampSigner(str(secret_key)) + self.session_cookie = session_cookie + self.max_age = max_age + self.path = path + self.security_flags = "httponly; samesite=" + same_site + if https_only: # Secure flag can be used with HTTPS only + self.security_flags += "; secure" + if domain is not None: + self.security_flags += f"; domain={domain}" + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if scope["type"] not in ("http", "websocket"): # pragma: no cover + await self.app(scope, receive, send) + return + + connection = HTTPConnection(scope) + initial_session_was_empty = True + + if self.session_cookie in connection.cookies: + data = connection.cookies[self.session_cookie].encode("utf-8") + try: + data = self.signer.unsign(data, max_age=self.max_age) + scope["session"] = json.loads(b64decode(data)) + initial_session_was_empty = False + except BadSignature: + scope["session"] = {} + else: + scope["session"] = {} + + async def send_wrapper(message: Message) -> None: + if message["type"] == "http.response.start": + if scope["session"]: + # We have session data to persist. + data = b64encode(json.dumps(scope["session"]).encode("utf-8")) + data = self.signer.sign(data) + headers = MutableHeaders(scope=message) + header_value = "{session_cookie}={data}; path={path}; {max_age}{security_flags}".format( + session_cookie=self.session_cookie, + data=data.decode("utf-8"), + path=self.path, + max_age=f"Max-Age={self.max_age}; " if self.max_age else "", + security_flags=self.security_flags, + ) + headers.append("Set-Cookie", header_value) + elif not initial_session_was_empty: + # The session has been cleared. + headers = MutableHeaders(scope=message) + header_value = "{session_cookie}={data}; path={path}; {expires}{security_flags}".format( + session_cookie=self.session_cookie, + data="null", + path=self.path, + expires="expires=Thu, 01 Jan 1970 00:00:00 GMT; ", + security_flags=self.security_flags, + ) + headers.append("Set-Cookie", header_value) + await send(message) + + await self.app(scope, receive, send_wrapper) diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/trustedhost.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/trustedhost.py new file mode 100644 index 0000000000000000000000000000000000000000..2d1c999e25f40929aacd526ad8b737bbd6394e1f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/trustedhost.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +import typing + +from starlette.datastructures import URL, Headers +from starlette.responses import PlainTextResponse, RedirectResponse, Response +from starlette.types import ASGIApp, Receive, Scope, Send + +ENFORCE_DOMAIN_WILDCARD = "Domain wildcard patterns must be like '*.example.com'." + + +class TrustedHostMiddleware: + def __init__( + self, + app: ASGIApp, + allowed_hosts: typing.Sequence[str] | None = None, + www_redirect: bool = True, + ) -> None: + if allowed_hosts is None: + allowed_hosts = ["*"] + + for pattern in allowed_hosts: + assert "*" not in pattern[1:], ENFORCE_DOMAIN_WILDCARD + if pattern.startswith("*") and pattern != "*": + assert pattern.startswith("*."), ENFORCE_DOMAIN_WILDCARD + self.app = app + self.allowed_hosts = list(allowed_hosts) + self.allow_any = "*" in allowed_hosts + self.www_redirect = www_redirect + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if self.allow_any or scope["type"] not in ( + "http", + "websocket", + ): # pragma: no cover + await self.app(scope, receive, send) + return + + headers = Headers(scope=scope) + host = headers.get("host", "").split(":")[0] + is_valid_host = False + found_www_redirect = False + for pattern in self.allowed_hosts: + if host == pattern or (pattern.startswith("*") and host.endswith(pattern[1:])): + is_valid_host = True + break + elif "www." + host == pattern: + found_www_redirect = True + + if is_valid_host: + await self.app(scope, receive, send) + else: + response: Response + if found_www_redirect and self.www_redirect: + url = URL(scope=scope) + redirect_url = url.replace(netloc="www." + url.netloc) + response = RedirectResponse(url=str(redirect_url)) + else: + response = PlainTextResponse("Invalid host header", status_code=400) + await response(scope, receive, send) diff --git a/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/wsgi.py b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/wsgi.py new file mode 100644 index 0000000000000000000000000000000000000000..71f4ab5de93cf36c160f66623f75632a431cbfd0 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/starlette/middleware/wsgi.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +import io +import math +import sys +import typing +import warnings + +import anyio +from anyio.abc import ObjectReceiveStream, ObjectSendStream + +from starlette.types import Receive, Scope, Send + +warnings.warn( + "starlette.middleware.wsgi is deprecated and will be removed in a future release. " + "Please refer to https://github.com/abersheeran/a2wsgi as a replacement.", + DeprecationWarning, +) + + +def build_environ(scope: Scope, body: bytes) -> dict[str, typing.Any]: + """ + Builds a scope and request body into a WSGI environ object. + """ + + script_name = scope.get("root_path", "").encode("utf8").decode("latin1") + path_info = scope["path"].encode("utf8").decode("latin1") + if path_info.startswith(script_name): + path_info = path_info[len(script_name) :] + + environ = { + "REQUEST_METHOD": scope["method"], + "SCRIPT_NAME": script_name, + "PATH_INFO": path_info, + "QUERY_STRING": scope["query_string"].decode("ascii"), + "SERVER_PROTOCOL": f"HTTP/{scope['http_version']}", + "wsgi.version": (1, 0), + "wsgi.url_scheme": scope.get("scheme", "http"), + "wsgi.input": io.BytesIO(body), + "wsgi.errors": sys.stdout, + "wsgi.multithread": True, + "wsgi.multiprocess": True, + "wsgi.run_once": False, + } + + # Get server name and port - required in WSGI, not in ASGI + server = scope.get("server") or ("localhost", 80) + environ["SERVER_NAME"] = server[0] + environ["SERVER_PORT"] = server[1] + + # Get client IP address + if scope.get("client"): + environ["REMOTE_ADDR"] = scope["client"][0] + + # Go through headers and make them into environ entries + for name, value in scope.get("headers", []): + name = name.decode("latin1") + if name == "content-length": + corrected_name = "CONTENT_LENGTH" + elif name == "content-type": + corrected_name = "CONTENT_TYPE" + else: + corrected_name = f"HTTP_{name}".upper().replace("-", "_") + # HTTPbis say only ASCII chars are allowed in headers, but we latin1 just in + # case + value = value.decode("latin1") + if corrected_name in environ: + value = environ[corrected_name] + "," + value + environ[corrected_name] = value + return environ + + +class WSGIMiddleware: + def __init__(self, app: typing.Callable[..., typing.Any]) -> None: + self.app = app + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + assert scope["type"] == "http" + responder = WSGIResponder(self.app, scope) + await responder(receive, send) + + +class WSGIResponder: + stream_send: ObjectSendStream[typing.MutableMapping[str, typing.Any]] + stream_receive: ObjectReceiveStream[typing.MutableMapping[str, typing.Any]] + + def __init__(self, app: typing.Callable[..., typing.Any], scope: Scope) -> None: + self.app = app + self.scope = scope + self.status = None + self.response_headers = None + self.stream_send, self.stream_receive = anyio.create_memory_object_stream(math.inf) + self.response_started = False + self.exc_info: typing.Any = None + + async def __call__(self, receive: Receive, send: Send) -> None: + body = b"" + more_body = True + while more_body: + message = await receive() + body += message.get("body", b"") + more_body = message.get("more_body", False) + environ = build_environ(self.scope, body) + + async with anyio.create_task_group() as task_group: + task_group.start_soon(self.sender, send) + async with self.stream_send: + await anyio.to_thread.run_sync(self.wsgi, environ, self.start_response) + if self.exc_info is not None: + raise self.exc_info[0].with_traceback(self.exc_info[1], self.exc_info[2]) + + async def sender(self, send: Send) -> None: + async with self.stream_receive: + async for message in self.stream_receive: + await send(message) + + def start_response( + self, + status: str, + response_headers: list[tuple[str, str]], + exc_info: typing.Any = None, + ) -> None: + self.exc_info = exc_info + if not self.response_started: + self.response_started = True + status_code_string, _ = status.split(" ", 1) + status_code = int(status_code_string) + headers = [ + (name.strip().encode("ascii").lower(), value.strip().encode("ascii")) + for name, value in response_headers + ] + anyio.from_thread.run( + self.stream_send.send, + { + "type": "http.response.start", + "status": status_code, + "headers": headers, + }, + ) + + def wsgi( + self, + environ: dict[str, typing.Any], + start_response: typing.Callable[..., typing.Any], + ) -> None: + for chunk in self.app(environ, start_response): + anyio.from_thread.run( + self.stream_send.send, + {"type": "http.response.body", "body": chunk, "more_body": True}, + ) + + anyio.from_thread.run(self.stream_send.send, {"type": "http.response.body", "body": b""}) diff --git a/tool_server/.venv/lib/python3.12/site-packages/typing_extensions-4.15.0.dist-info/licenses/LICENSE b/tool_server/.venv/lib/python3.12/site-packages/typing_extensions-4.15.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f26bcf4d2de6eb136e31006ca3ab447d5e488adf --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/typing_extensions-4.15.0.dist-info/licenses/LICENSE @@ -0,0 +1,279 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +Python software and documentation are licensed under the +Python Software Foundation License Version 2. + +Starting with Python 3.8.6, examples, recipes, and other code in +the documentation are dual licensed under the PSF License Version 2 +and the Zero-Clause BSD license. + +Some software incorporated into Python is under different licenses. +The licenses are listed with code falling under that license. + + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION +---------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn-0.30.6.dist-info/licenses/LICENSE.md b/tool_server/.venv/lib/python3.12/site-packages/uvicorn-0.30.6.dist-info/licenses/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..a6bba14552c7673a7db57a5750ddb06508264273 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn-0.30.6.dist-info/licenses/LICENSE.md @@ -0,0 +1,27 @@ +Copyright © 2017-present, [Encode OSS Ltd](https://www.encode.io/). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1551df182d40759e8033c0dd5ebb9af76bcc54f8 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/__main__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/__main__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..caf082145d66b9f4907b4be0e60f51528484843e Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/__main__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/_subprocess.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/_subprocess.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fd5f55d355dffd82c805585810ffd61d0b73348 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/_subprocess.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/_types.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/_types.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd62ada8b5b020131af8fcf5754cc189cd0e68ea Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/_types.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/config.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/config.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..65e36d0053add7b6c9bb86a7bc000f6b0fe57354 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/config.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/importer.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/importer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3599ac413aebebeaa14597f89f59dea36b57b856 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/importer.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/logging.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/logging.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8c685fe2a03f10daa73cb74720603ed22efa058 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/logging.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/main.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/main.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb9cba0277d32a6f1e860a016bb778cea5dc59d0 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/main.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/server.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/server.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6122c4e274b3219b15f98c92c6d620950ca8cfbc Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/server.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/workers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/workers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..05d744cc5258d8ef707bf7c8289aac84c46f533b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/__pycache__/workers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..86f1633e9b48a5c3f3989283d24aea2a8d39965b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__pycache__/off.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__pycache__/off.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..981c1bcc39c3f061b9243ce73f594483b4819b66 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__pycache__/off.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__pycache__/on.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__pycache__/on.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95f1825d13a9c60cd8bca8f800d736c35037f25c Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/__pycache__/on.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/off.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/off.py new file mode 100644 index 0000000000000000000000000000000000000000..74554b1e2a149c37131168fbe283f3e2476a8f75 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/off.py @@ -0,0 +1,17 @@ +from __future__ import annotations + +from typing import Any + +from uvicorn import Config + + +class LifespanOff: + def __init__(self, config: Config) -> None: + self.should_exit = False + self.state: dict[str, Any] = {} + + async def startup(self) -> None: + pass + + async def shutdown(self) -> None: + pass diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/on.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/on.py new file mode 100644 index 0000000000000000000000000000000000000000..09df984ea1b184c0af9666c98d0709364de024c5 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/lifespan/on.py @@ -0,0 +1,137 @@ +from __future__ import annotations + +import asyncio +import logging +from asyncio import Queue +from typing import Any, Union + +from uvicorn import Config +from uvicorn._types import ( + LifespanScope, + LifespanShutdownCompleteEvent, + LifespanShutdownEvent, + LifespanShutdownFailedEvent, + LifespanStartupCompleteEvent, + LifespanStartupEvent, + LifespanStartupFailedEvent, +) + +LifespanReceiveMessage = Union[LifespanStartupEvent, LifespanShutdownEvent] +LifespanSendMessage = Union[ + LifespanStartupFailedEvent, + LifespanShutdownFailedEvent, + LifespanStartupCompleteEvent, + LifespanShutdownCompleteEvent, +] + + +STATE_TRANSITION_ERROR = "Got invalid state transition on lifespan protocol." + + +class LifespanOn: + def __init__(self, config: Config) -> None: + if not config.loaded: + config.load() + + self.config = config + self.logger = logging.getLogger("uvicorn.error") + self.startup_event = asyncio.Event() + self.shutdown_event = asyncio.Event() + self.receive_queue: Queue[LifespanReceiveMessage] = asyncio.Queue() + self.error_occured = False + self.startup_failed = False + self.shutdown_failed = False + self.should_exit = False + self.state: dict[str, Any] = {} + + async def startup(self) -> None: + self.logger.info("Waiting for application startup.") + + loop = asyncio.get_event_loop() + main_lifespan_task = loop.create_task(self.main()) # noqa: F841 + # Keep a hard reference to prevent garbage collection + # See https://github.com/encode/uvicorn/pull/972 + startup_event: LifespanStartupEvent = {"type": "lifespan.startup"} + await self.receive_queue.put(startup_event) + await self.startup_event.wait() + + if self.startup_failed or (self.error_occured and self.config.lifespan == "on"): + self.logger.error("Application startup failed. Exiting.") + self.should_exit = True + else: + self.logger.info("Application startup complete.") + + async def shutdown(self) -> None: + if self.error_occured: + return + self.logger.info("Waiting for application shutdown.") + shutdown_event: LifespanShutdownEvent = {"type": "lifespan.shutdown"} + await self.receive_queue.put(shutdown_event) + await self.shutdown_event.wait() + + if self.shutdown_failed or (self.error_occured and self.config.lifespan == "on"): + self.logger.error("Application shutdown failed. Exiting.") + self.should_exit = True + else: + self.logger.info("Application shutdown complete.") + + async def main(self) -> None: + try: + app = self.config.loaded_app + scope: LifespanScope = { + "type": "lifespan", + "asgi": {"version": self.config.asgi_version, "spec_version": "2.0"}, + "state": self.state, + } + await app(scope, self.receive, self.send) + except BaseException as exc: + self.asgi = None + self.error_occured = True + if self.startup_failed or self.shutdown_failed: + return + if self.config.lifespan == "auto": + msg = "ASGI 'lifespan' protocol appears unsupported." + self.logger.info(msg) + else: + msg = "Exception in 'lifespan' protocol\n" + self.logger.error(msg, exc_info=exc) + finally: + self.startup_event.set() + self.shutdown_event.set() + + async def send(self, message: LifespanSendMessage) -> None: + assert message["type"] in ( + "lifespan.startup.complete", + "lifespan.startup.failed", + "lifespan.shutdown.complete", + "lifespan.shutdown.failed", + ) + + if message["type"] == "lifespan.startup.complete": + assert not self.startup_event.is_set(), STATE_TRANSITION_ERROR + assert not self.shutdown_event.is_set(), STATE_TRANSITION_ERROR + self.startup_event.set() + + elif message["type"] == "lifespan.startup.failed": + assert not self.startup_event.is_set(), STATE_TRANSITION_ERROR + assert not self.shutdown_event.is_set(), STATE_TRANSITION_ERROR + self.startup_event.set() + self.startup_failed = True + if message.get("message"): + self.logger.error(message["message"]) + + elif message["type"] == "lifespan.shutdown.complete": + assert self.startup_event.is_set(), STATE_TRANSITION_ERROR + assert not self.shutdown_event.is_set(), STATE_TRANSITION_ERROR + self.shutdown_event.set() + + elif message["type"] == "lifespan.shutdown.failed": + assert self.startup_event.is_set(), STATE_TRANSITION_ERROR + assert not self.shutdown_event.is_set(), STATE_TRANSITION_ERROR + self.shutdown_event.set() + self.shutdown_failed = True + if message.get("message"): + self.logger.error(message["message"]) + + async def receive(self) -> LifespanReceiveMessage: + return await self.receive_queue.get() diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8104f34c5e9827ef85971b87dc4bb7350fd59aee Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/asyncio.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/asyncio.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe6ab40dd6b98b1931d1bcb9e86dc615ff5166fb Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/asyncio.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/auto.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/auto.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..87919c44a9593eea3cda5c2229003506827e9b06 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/auto.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/uvloop.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/uvloop.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4c32844b486d5ab8264e604e99d9ca0fa78290e4 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/__pycache__/uvloop.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/asyncio.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/asyncio.py new file mode 100644 index 0000000000000000000000000000000000000000..1bead4a061cc0989ffcd999ffeb0a7279ec25b4f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/asyncio.py @@ -0,0 +1,10 @@ +import asyncio +import logging +import sys + +logger = logging.getLogger("uvicorn.error") + + +def asyncio_setup(use_subprocess: bool = False) -> None: + if sys.platform == "win32" and use_subprocess: + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # pragma: full coverage diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/auto.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/auto.py new file mode 100644 index 0000000000000000000000000000000000000000..2285457bf181d31d36b74ba6c368eac604178645 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/auto.py @@ -0,0 +1,11 @@ +def auto_loop_setup(use_subprocess: bool = False) -> None: + try: + import uvloop # noqa + except ImportError: # pragma: no cover + from uvicorn.loops.asyncio import asyncio_setup as loop_setup + + loop_setup(use_subprocess=use_subprocess) + else: # pragma: no cover + from uvicorn.loops.uvloop import uvloop_setup + + uvloop_setup(use_subprocess=use_subprocess) diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/uvloop.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/uvloop.py new file mode 100644 index 0000000000000000000000000000000000000000..0e2fd1eb05efc526f660bcf10e865d2fe781a239 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/loops/uvloop.py @@ -0,0 +1,7 @@ +import asyncio + +import uvloop + + +def uvloop_setup(use_subprocess: bool = False) -> None: + asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ce1066a2640c6c740a5794dfa894cb56460b482 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/asgi2.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/asgi2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1cd879c7a4e1aa8274aff6d8f35f1426948e9e15 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/asgi2.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/message_logger.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/message_logger.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebb8bab913d38dd21816a584a99aea5af0b7e8de Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/message_logger.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/proxy_headers.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/proxy_headers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93b1f9a37e107b0016f46dc38b084c6c4b21ae20 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/proxy_headers.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/wsgi.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/wsgi.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33dff6cb8d5bc4d9fa8963b0fdb82e0fc2775871 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/__pycache__/wsgi.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/asgi2.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/asgi2.py new file mode 100644 index 0000000000000000000000000000000000000000..4e15d1599bab04ac38f56cf271d2ff9b1b9984c8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/asgi2.py @@ -0,0 +1,15 @@ +from uvicorn._types import ( + ASGI2Application, + ASGIReceiveCallable, + ASGISendCallable, + Scope, +) + + +class ASGI2Middleware: + def __init__(self, app: "ASGI2Application"): + self.app = app + + async def __call__(self, scope: "Scope", receive: "ASGIReceiveCallable", send: "ASGISendCallable") -> None: + instance = self.app(scope) + await instance(receive, send) diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/message_logger.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/message_logger.py new file mode 100644 index 0000000000000000000000000000000000000000..0174bcce6d48de946214d59bcae5543d38d89c3a --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/message_logger.py @@ -0,0 +1,87 @@ +import logging +from typing import Any + +from uvicorn._types import ( + ASGI3Application, + ASGIReceiveCallable, + ASGIReceiveEvent, + ASGISendCallable, + ASGISendEvent, + WWWScope, +) +from uvicorn.logging import TRACE_LOG_LEVEL + +PLACEHOLDER_FORMAT = { + "body": "<{length} bytes>", + "bytes": "<{length} bytes>", + "text": "<{length} chars>", + "headers": "<...>", +} + + +def message_with_placeholders(message: Any) -> Any: + """ + Return an ASGI message, with any body-type content omitted and replaced + with a placeholder. + """ + new_message = message.copy() + for attr in PLACEHOLDER_FORMAT.keys(): + if message.get(attr) is not None: + content = message[attr] + placeholder = PLACEHOLDER_FORMAT[attr].format(length=len(content)) + new_message[attr] = placeholder + return new_message + + +class MessageLoggerMiddleware: + def __init__(self, app: "ASGI3Application"): + self.task_counter = 0 + self.app = app + self.logger = logging.getLogger("uvicorn.asgi") + + def trace(message: Any, *args: Any, **kwargs: Any) -> None: + self.logger.log(TRACE_LOG_LEVEL, message, *args, **kwargs) + + self.logger.trace = trace # type: ignore + + async def __call__( + self, + scope: "WWWScope", + receive: "ASGIReceiveCallable", + send: "ASGISendCallable", + ) -> None: + self.task_counter += 1 + + task_counter = self.task_counter + client = scope.get("client") + prefix = "%s:%d - ASGI" % (client[0], client[1]) if client else "ASGI" + + async def inner_receive() -> "ASGIReceiveEvent": + message = await receive() + logged_message = message_with_placeholders(message) + log_text = "%s [%d] Receive %s" + self.logger.trace( # type: ignore + log_text, prefix, task_counter, logged_message + ) + return message + + async def inner_send(message: "ASGISendEvent") -> None: + logged_message = message_with_placeholders(message) + log_text = "%s [%d] Send %s" + self.logger.trace( # type: ignore + log_text, prefix, task_counter, logged_message + ) + await send(message) + + logged_scope = message_with_placeholders(scope) + log_text = "%s [%d] Started scope=%s" + self.logger.trace(log_text, prefix, task_counter, logged_scope) # type: ignore + try: + await self.app(scope, inner_receive, inner_send) + except BaseException as exc: + log_text = "%s [%d] Raised exception" + self.logger.trace(log_text, prefix, task_counter) # type: ignore + raise exc from None + else: + log_text = "%s [%d] Completed" + self.logger.trace(log_text, prefix, task_counter) # type: ignore diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py new file mode 100644 index 0000000000000000000000000000000000000000..fad2b01980277e0692bcb151a2a75a1b08e93031 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py @@ -0,0 +1,70 @@ +""" +This middleware can be used when a known proxy is fronting the application, +and is trusted to be properly setting the `X-Forwarded-Proto` and +`X-Forwarded-For` headers with the connecting client information. + +Modifies the `client` and `scheme` information so that they reference +the connecting client, rather that the connecting proxy. + +https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Proxies +""" + +from __future__ import annotations + +from typing import Union, cast + +from uvicorn._types import ASGI3Application, ASGIReceiveCallable, ASGISendCallable, HTTPScope, Scope, WebSocketScope + + +class ProxyHeadersMiddleware: + def __init__( + self, + app: ASGI3Application, + trusted_hosts: list[str] | str = "127.0.0.1", + ) -> None: + self.app = app + if isinstance(trusted_hosts, str): + self.trusted_hosts = {item.strip() for item in trusted_hosts.split(",")} + else: + self.trusted_hosts = set(trusted_hosts) + self.always_trust = "*" in self.trusted_hosts + + def get_trusted_client_host(self, x_forwarded_for_hosts: list[str]) -> str | None: + if self.always_trust: + return x_forwarded_for_hosts[0] + + for host in reversed(x_forwarded_for_hosts): + if host not in self.trusted_hosts: + return host + + return None # pragma: full coverage + + async def __call__(self, scope: Scope, receive: ASGIReceiveCallable, send: ASGISendCallable) -> None: + if scope["type"] in ("http", "websocket"): + scope = cast(Union["HTTPScope", "WebSocketScope"], scope) + client_addr: tuple[str, int] | None = scope.get("client") + client_host = client_addr[0] if client_addr else None + + if self.always_trust or client_host in self.trusted_hosts: + headers = dict(scope["headers"]) + + if b"x-forwarded-proto" in headers: + # Determine if the incoming request was http or https based on + # the X-Forwarded-Proto header. + x_forwarded_proto = headers[b"x-forwarded-proto"].decode("latin1").strip() + if scope["type"] == "websocket": + scope["scheme"] = x_forwarded_proto.replace("http", "ws") + else: + scope["scheme"] = x_forwarded_proto + + if b"x-forwarded-for" in headers: + # Determine the client address from the last trusted IP in the + # X-Forwarded-For header. We've lost the connecting client's port + # information by now, so only include the host. + x_forwarded_for = headers[b"x-forwarded-for"].decode("latin1") + x_forwarded_for_hosts = [item.strip() for item in x_forwarded_for.split(",")] + host = self.get_trusted_client_host(x_forwarded_for_hosts) + port = 0 + scope["client"] = (host, port) # type: ignore[arg-type] + + return await self.app(scope, receive, send) diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/wsgi.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/wsgi.py new file mode 100644 index 0000000000000000000000000000000000000000..078de1af01579e2020303ad1ee65481f84db0c84 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/middleware/wsgi.py @@ -0,0 +1,200 @@ +from __future__ import annotations + +import asyncio +import concurrent.futures +import io +import sys +import warnings +from collections import deque +from typing import Iterable + +from uvicorn._types import ( + ASGIReceiveCallable, + ASGIReceiveEvent, + ASGISendCallable, + ASGISendEvent, + Environ, + ExcInfo, + HTTPRequestEvent, + HTTPResponseBodyEvent, + HTTPResponseStartEvent, + HTTPScope, + StartResponse, + WSGIApp, +) + + +def build_environ(scope: HTTPScope, message: ASGIReceiveEvent, body: io.BytesIO) -> Environ: + """ + Builds a scope and request message into a WSGI environ object. + """ + script_name = scope.get("root_path", "").encode("utf8").decode("latin1") + path_info = scope["path"].encode("utf8").decode("latin1") + if path_info.startswith(script_name): + path_info = path_info[len(script_name) :] + environ = { + "REQUEST_METHOD": scope["method"], + "SCRIPT_NAME": script_name, + "PATH_INFO": path_info, + "QUERY_STRING": scope["query_string"].decode("ascii"), + "SERVER_PROTOCOL": "HTTP/%s" % scope["http_version"], + "wsgi.version": (1, 0), + "wsgi.url_scheme": scope.get("scheme", "http"), + "wsgi.input": body, + "wsgi.errors": sys.stdout, + "wsgi.multithread": True, + "wsgi.multiprocess": True, + "wsgi.run_once": False, + } + + # Get server name and port - required in WSGI, not in ASGI + server = scope.get("server") + if server is None: + server = ("localhost", 80) + environ["SERVER_NAME"] = server[0] + environ["SERVER_PORT"] = server[1] + + # Get client IP address + client = scope.get("client") + if client is not None: + environ["REMOTE_ADDR"] = client[0] + + # Go through headers and make them into environ entries + for name, value in scope.get("headers", []): + name_str: str = name.decode("latin1") + if name_str == "content-length": + corrected_name = "CONTENT_LENGTH" + elif name_str == "content-type": + corrected_name = "CONTENT_TYPE" + else: + corrected_name = "HTTP_%s" % name_str.upper().replace("-", "_") + # HTTPbis say only ASCII chars are allowed in headers, but we latin1 + # just in case + value_str: str = value.decode("latin1") + if corrected_name in environ: + corrected_name_environ = environ[corrected_name] + assert isinstance(corrected_name_environ, str) + value_str = corrected_name_environ + "," + value_str + environ[corrected_name] = value_str + return environ + + +class _WSGIMiddleware: + def __init__(self, app: WSGIApp, workers: int = 10): + warnings.warn( + "Uvicorn's native WSGI implementation is deprecated, you " + "should switch to a2wsgi (`pip install a2wsgi`).", + DeprecationWarning, + ) + self.app = app + self.executor = concurrent.futures.ThreadPoolExecutor(max_workers=workers) + + async def __call__( + self, + scope: HTTPScope, + receive: ASGIReceiveCallable, + send: ASGISendCallable, + ) -> None: + assert scope["type"] == "http" + instance = WSGIResponder(self.app, self.executor, scope) + await instance(receive, send) + + +class WSGIResponder: + def __init__( + self, + app: WSGIApp, + executor: concurrent.futures.ThreadPoolExecutor, + scope: HTTPScope, + ): + self.app = app + self.executor = executor + self.scope = scope + self.status = None + self.response_headers = None + self.send_event = asyncio.Event() + self.send_queue: deque[ASGISendEvent | None] = deque() + self.loop: asyncio.AbstractEventLoop = asyncio.get_event_loop() + self.response_started = False + self.exc_info: ExcInfo | None = None + + async def __call__(self, receive: ASGIReceiveCallable, send: ASGISendCallable) -> None: + message: HTTPRequestEvent = await receive() # type: ignore[assignment] + body = io.BytesIO(message.get("body", b"")) + more_body = message.get("more_body", False) + if more_body: + body.seek(0, io.SEEK_END) + while more_body: + body_message: HTTPRequestEvent = ( + await receive() # type: ignore[assignment] + ) + body.write(body_message.get("body", b"")) + more_body = body_message.get("more_body", False) + body.seek(0) + environ = build_environ(self.scope, message, body) + self.loop = asyncio.get_event_loop() + wsgi = self.loop.run_in_executor(self.executor, self.wsgi, environ, self.start_response) + sender = self.loop.create_task(self.sender(send)) + try: + await asyncio.wait_for(wsgi, None) + finally: + self.send_queue.append(None) + self.send_event.set() + await asyncio.wait_for(sender, None) + if self.exc_info is not None: + raise self.exc_info[0].with_traceback(self.exc_info[1], self.exc_info[2]) + + async def sender(self, send: ASGISendCallable) -> None: + while True: + if self.send_queue: + message = self.send_queue.popleft() + if message is None: + return + await send(message) + else: + await self.send_event.wait() + self.send_event.clear() + + def start_response( + self, + status: str, + response_headers: Iterable[tuple[str, str]], + exc_info: ExcInfo | None = None, + ) -> None: + self.exc_info = exc_info + if not self.response_started: + self.response_started = True + status_code_str, _ = status.split(" ", 1) + status_code = int(status_code_str) + headers = [(name.encode("ascii"), value.encode("ascii")) for name, value in response_headers] + http_response_start_event: HTTPResponseStartEvent = { + "type": "http.response.start", + "status": status_code, + "headers": headers, + } + self.send_queue.append(http_response_start_event) + self.loop.call_soon_threadsafe(self.send_event.set) + + def wsgi(self, environ: Environ, start_response: StartResponse) -> None: + for chunk in self.app(environ, start_response): # type: ignore + response_body: HTTPResponseBodyEvent = { + "type": "http.response.body", + "body": chunk, + "more_body": True, + } + self.send_queue.append(response_body) + self.loop.call_soon_threadsafe(self.send_event.set) + + empty_body: HTTPResponseBodyEvent = { + "type": "http.response.body", + "body": b"", + "more_body": False, + } + self.send_queue.append(empty_body) + self.loop.call_soon_threadsafe(self.send_event.set) + + +try: + from a2wsgi import WSGIMiddleware +except ModuleNotFoundError: # pragma: no cover + WSGIMiddleware = _WSGIMiddleware # type: ignore[misc, assignment] diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5ccf52e06a4014fd04be502daede790da6838d0 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/__pycache__/utils.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/__pycache__/utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3fa58afe975bc95aebdf250b3f6459435ec1a2c5 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/__pycache__/utils.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..024eea5b955bce1fc6e579628be243273a87cf2f Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/auto.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/auto.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cac9ccd8b82fb5aa48cfc1c64b482d3d834fceba Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/auto.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/flow_control.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/flow_control.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06cb6e9e2c7362c8e9b947c556bbf2b9d6212774 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/flow_control.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/h11_impl.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/h11_impl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1329bdeb97c79072a45103c310f71539d1f15a4 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/h11_impl.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/httptools_impl.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/httptools_impl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c172383ae2a958d92321904b353f1b8c68f31510 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/__pycache__/httptools_impl.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/auto.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/auto.py new file mode 100644 index 0000000000000000000000000000000000000000..a14bec144a97a5e3718a768abe3b6a9e7e93d2c1 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/auto.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +import asyncio + +AutoHTTPProtocol: type[asyncio.Protocol] +try: + import httptools # noqa +except ImportError: # pragma: no cover + from uvicorn.protocols.http.h11_impl import H11Protocol + + AutoHTTPProtocol = H11Protocol +else: # pragma: no cover + from uvicorn.protocols.http.httptools_impl import HttpToolsProtocol + + AutoHTTPProtocol = HttpToolsProtocol diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/flow_control.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/flow_control.py new file mode 100644 index 0000000000000000000000000000000000000000..2d1b5fa2d3366fd6584181a26c8569a0207900cc --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/flow_control.py @@ -0,0 +1,54 @@ +import asyncio + +from uvicorn._types import ASGIReceiveCallable, ASGISendCallable, Scope + +CLOSE_HEADER = (b"connection", b"close") + +HIGH_WATER_LIMIT = 65536 + + +class FlowControl: + def __init__(self, transport: asyncio.Transport) -> None: + self._transport = transport + self.read_paused = False + self.write_paused = False + self._is_writable_event = asyncio.Event() + self._is_writable_event.set() + + async def drain(self) -> None: + await self._is_writable_event.wait() # pragma: full coverage + + def pause_reading(self) -> None: + if not self.read_paused: + self.read_paused = True + self._transport.pause_reading() + + def resume_reading(self) -> None: + if self.read_paused: + self.read_paused = False + self._transport.resume_reading() + + def pause_writing(self) -> None: + if not self.write_paused: # pragma: full coverage + self.write_paused = True + self._is_writable_event.clear() + + def resume_writing(self) -> None: + if self.write_paused: # pragma: full coverage + self.write_paused = False + self._is_writable_event.set() + + +async def service_unavailable(scope: Scope, receive: ASGIReceiveCallable, send: ASGISendCallable) -> None: + await send( + { + "type": "http.response.start", + "status": 503, + "headers": [ + (b"content-type", b"text/plain; charset=utf-8"), + (b"content-length", b"19"), + (b"connection", b"close"), + ], + } + ) + await send({"type": "http.response.body", "body": b"Service Unavailable", "more_body": False}) diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..932ddf62b1094ac640aa237922ccbd2f19d117eb --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py @@ -0,0 +1,546 @@ +from __future__ import annotations + +import asyncio +import http +import logging +from typing import Any, Callable, Literal, cast +from urllib.parse import unquote + +import h11 +from h11._connection import DEFAULT_MAX_INCOMPLETE_EVENT_SIZE + +from uvicorn._types import ( + ASGI3Application, + ASGIReceiveEvent, + ASGISendEvent, + HTTPRequestEvent, + HTTPResponseBodyEvent, + HTTPResponseStartEvent, + HTTPScope, +) +from uvicorn.config import Config +from uvicorn.logging import TRACE_LOG_LEVEL +from uvicorn.protocols.http.flow_control import CLOSE_HEADER, HIGH_WATER_LIMIT, FlowControl, service_unavailable +from uvicorn.protocols.utils import get_client_addr, get_local_addr, get_path_with_query_string, get_remote_addr, is_ssl +from uvicorn.server import ServerState + + +def _get_status_phrase(status_code: int) -> bytes: + try: + return http.HTTPStatus(status_code).phrase.encode() + except ValueError: + return b"" + + +STATUS_PHRASES = {status_code: _get_status_phrase(status_code) for status_code in range(100, 600)} + + +class H11Protocol(asyncio.Protocol): + def __init__( + self, + config: Config, + server_state: ServerState, + app_state: dict[str, Any], + _loop: asyncio.AbstractEventLoop | None = None, + ) -> None: + if not config.loaded: + config.load() + + self.config = config + self.app = config.loaded_app + self.loop = _loop or asyncio.get_event_loop() + self.logger = logging.getLogger("uvicorn.error") + self.access_logger = logging.getLogger("uvicorn.access") + self.access_log = self.access_logger.hasHandlers() + self.conn = h11.Connection( + h11.SERVER, + config.h11_max_incomplete_event_size + if config.h11_max_incomplete_event_size is not None + else DEFAULT_MAX_INCOMPLETE_EVENT_SIZE, + ) + self.ws_protocol_class = config.ws_protocol_class + self.root_path = config.root_path + self.limit_concurrency = config.limit_concurrency + self.app_state = app_state + + # Timeouts + self.timeout_keep_alive_task: asyncio.TimerHandle | None = None + self.timeout_keep_alive = config.timeout_keep_alive + + # Shared server state + self.server_state = server_state + self.connections = server_state.connections + self.tasks = server_state.tasks + + # Per-connection state + self.transport: asyncio.Transport = None # type: ignore[assignment] + self.flow: FlowControl = None # type: ignore[assignment] + self.server: tuple[str, int] | None = None + self.client: tuple[str, int] | None = None + self.scheme: Literal["http", "https"] | None = None + + # Per-request state + self.scope: HTTPScope = None # type: ignore[assignment] + self.headers: list[tuple[bytes, bytes]] = None # type: ignore[assignment] + self.cycle: RequestResponseCycle = None # type: ignore[assignment] + + # Protocol interface + def connection_made( # type: ignore[override] + self, transport: asyncio.Transport + ) -> None: + self.connections.add(self) + + self.transport = transport + self.flow = FlowControl(transport) + self.server = get_local_addr(transport) + self.client = get_remote_addr(transport) + self.scheme = "https" if is_ssl(transport) else "http" + + if self.logger.level <= TRACE_LOG_LEVEL: + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sHTTP connection made", prefix) + + def connection_lost(self, exc: Exception | None) -> None: + self.connections.discard(self) + + if self.logger.level <= TRACE_LOG_LEVEL: + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sHTTP connection lost", prefix) + + if self.cycle and not self.cycle.response_complete: + self.cycle.disconnected = True + if self.conn.our_state != h11.ERROR: + event = h11.ConnectionClosed() + try: + self.conn.send(event) + except h11.LocalProtocolError: + # Premature client disconnect + pass + + if self.cycle is not None: + self.cycle.message_event.set() + if self.flow is not None: + self.flow.resume_writing() + if exc is None: + self.transport.close() + self._unset_keepalive_if_required() + + def eof_received(self) -> None: + pass + + def _unset_keepalive_if_required(self) -> None: + if self.timeout_keep_alive_task is not None: + self.timeout_keep_alive_task.cancel() + self.timeout_keep_alive_task = None + + def _get_upgrade(self) -> bytes | None: + connection = [] + upgrade = None + for name, value in self.headers: + if name == b"connection": + connection = [token.lower().strip() for token in value.split(b",")] + if name == b"upgrade": + upgrade = value.lower() + if b"upgrade" in connection: + return upgrade + return None + + def _should_upgrade_to_ws(self) -> bool: + if self.ws_protocol_class is None: + return False + return True + + def _unsupported_upgrade_warning(self) -> None: + msg = "Unsupported upgrade request." + self.logger.warning(msg) + if not self._should_upgrade_to_ws(): + msg = "No supported WebSocket library detected. Please use \"pip install 'uvicorn[standard]'\", or install 'websockets' or 'wsproto' manually." # noqa: E501 + self.logger.warning(msg) + + def _should_upgrade(self) -> bool: + upgrade = self._get_upgrade() + if upgrade == b"websocket" and self._should_upgrade_to_ws(): + return True + if upgrade is not None: + self._unsupported_upgrade_warning() + return False + + def data_received(self, data: bytes) -> None: + self._unset_keepalive_if_required() + + self.conn.receive_data(data) + self.handle_events() + + def handle_events(self) -> None: + while True: + try: + event = self.conn.next_event() + except h11.RemoteProtocolError: + msg = "Invalid HTTP request received." + self.logger.warning(msg) + self.send_400_response(msg) + return + + if event is h11.NEED_DATA: + break + + elif event is h11.PAUSED: + # This case can occur in HTTP pipelining, so we need to + # stop reading any more data, and ensure that at the end + # of the active request/response cycle we handle any + # events that have been buffered up. + self.flow.pause_reading() + break + + elif isinstance(event, h11.Request): + self.headers = [(key.lower(), value) for key, value in event.headers] + raw_path, _, query_string = event.target.partition(b"?") + path = unquote(raw_path.decode("ascii")) + full_path = self.root_path + path + full_raw_path = self.root_path.encode("ascii") + raw_path + self.scope = { + "type": "http", + "asgi": { + "version": self.config.asgi_version, + "spec_version": "2.4", + }, + "http_version": event.http_version.decode("ascii"), + "server": self.server, + "client": self.client, + "scheme": self.scheme, # type: ignore[typeddict-item] + "method": event.method.decode("ascii"), + "root_path": self.root_path, + "path": full_path, + "raw_path": full_raw_path, + "query_string": query_string, + "headers": self.headers, + "state": self.app_state.copy(), + } + if self._should_upgrade(): + self.handle_websocket_upgrade(event) + return + + # Handle 503 responses when 'limit_concurrency' is exceeded. + if self.limit_concurrency is not None and ( + len(self.connections) >= self.limit_concurrency or len(self.tasks) >= self.limit_concurrency + ): + app = service_unavailable + message = "Exceeded concurrency limit." + self.logger.warning(message) + else: + app = self.app + + # When starting to process a request, disable the keep-alive + # timeout. Normally we disable this when receiving data from + # client and set back when finishing processing its request. + # However, for pipelined requests processing finishes after + # already receiving the next request and thus the timer may + # be set here, which we don't want. + self._unset_keepalive_if_required() + + self.cycle = RequestResponseCycle( + scope=self.scope, + conn=self.conn, + transport=self.transport, + flow=self.flow, + logger=self.logger, + access_logger=self.access_logger, + access_log=self.access_log, + default_headers=self.server_state.default_headers, + message_event=asyncio.Event(), + on_response=self.on_response_complete, + ) + task = self.loop.create_task(self.cycle.run_asgi(app)) + task.add_done_callback(self.tasks.discard) + self.tasks.add(task) + + elif isinstance(event, h11.Data): + if self.conn.our_state is h11.DONE: + continue + self.cycle.body += event.data + if len(self.cycle.body) > HIGH_WATER_LIMIT: + self.flow.pause_reading() + self.cycle.message_event.set() + + elif isinstance(event, h11.EndOfMessage): + if self.conn.our_state is h11.DONE: + self.transport.resume_reading() + self.conn.start_next_cycle() + continue + self.cycle.more_body = False + self.cycle.message_event.set() + if self.conn.their_state == h11.MUST_CLOSE: + break + + def handle_websocket_upgrade(self, event: h11.Request) -> None: + if self.logger.level <= TRACE_LOG_LEVEL: # pragma: full coverage + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sUpgrading to WebSocket", prefix) + + self.connections.discard(self) + output = [event.method, b" ", event.target, b" HTTP/1.1\r\n"] + for name, value in self.headers: + output += [name, b": ", value, b"\r\n"] + output.append(b"\r\n") + protocol = self.ws_protocol_class( # type: ignore[call-arg, misc] + config=self.config, + server_state=self.server_state, + app_state=self.app_state, + ) + protocol.connection_made(self.transport) + protocol.data_received(b"".join(output)) + self.transport.set_protocol(protocol) + + def send_400_response(self, msg: str) -> None: + reason = STATUS_PHRASES[400] + headers: list[tuple[bytes, bytes]] = [ + (b"content-type", b"text/plain; charset=utf-8"), + (b"connection", b"close"), + ] + event = h11.Response(status_code=400, headers=headers, reason=reason) + output = self.conn.send(event) + self.transport.write(output) + + output = self.conn.send(event=h11.Data(data=msg.encode("ascii"))) + self.transport.write(output) + + output = self.conn.send(event=h11.EndOfMessage()) + self.transport.write(output) + + self.transport.close() + + def on_response_complete(self) -> None: + self.server_state.total_requests += 1 + + if self.transport.is_closing(): + return + + # Set a short Keep-Alive timeout. + self._unset_keepalive_if_required() + + self.timeout_keep_alive_task = self.loop.call_later(self.timeout_keep_alive, self.timeout_keep_alive_handler) + + # Unpause data reads if needed. + self.flow.resume_reading() + + # Unblock any pipelined events. + if self.conn.our_state is h11.DONE and self.conn.their_state is h11.DONE: + self.conn.start_next_cycle() + self.handle_events() + + def shutdown(self) -> None: + """ + Called by the server to commence a graceful shutdown. + """ + if self.cycle is None or self.cycle.response_complete: + event = h11.ConnectionClosed() + self.conn.send(event) + self.transport.close() + else: + self.cycle.keep_alive = False + + def pause_writing(self) -> None: + """ + Called by the transport when the write buffer exceeds the high water mark. + """ + self.flow.pause_writing() # pragma: full coverage + + def resume_writing(self) -> None: + """ + Called by the transport when the write buffer drops below the low water mark. + """ + self.flow.resume_writing() # pragma: full coverage + + def timeout_keep_alive_handler(self) -> None: + """ + Called on a keep-alive connection if no new data is received after a short + delay. + """ + if not self.transport.is_closing(): + event = h11.ConnectionClosed() + self.conn.send(event) + self.transport.close() + + +class RequestResponseCycle: + def __init__( + self, + scope: HTTPScope, + conn: h11.Connection, + transport: asyncio.Transport, + flow: FlowControl, + logger: logging.Logger, + access_logger: logging.Logger, + access_log: bool, + default_headers: list[tuple[bytes, bytes]], + message_event: asyncio.Event, + on_response: Callable[..., None], + ) -> None: + self.scope = scope + self.conn = conn + self.transport = transport + self.flow = flow + self.logger = logger + self.access_logger = access_logger + self.access_log = access_log + self.default_headers = default_headers + self.message_event = message_event + self.on_response = on_response + + # Connection state + self.disconnected = False + self.keep_alive = True + self.waiting_for_100_continue = conn.they_are_waiting_for_100_continue + + # Request state + self.body = b"" + self.more_body = True + + # Response state + self.response_started = False + self.response_complete = False + + # ASGI exception wrapper + async def run_asgi(self, app: ASGI3Application) -> None: + try: + result = await app( # type: ignore[func-returns-value] + self.scope, self.receive, self.send + ) + except BaseException as exc: + msg = "Exception in ASGI application\n" + self.logger.error(msg, exc_info=exc) + if not self.response_started: + await self.send_500_response() + else: + self.transport.close() + else: + if result is not None: + msg = "ASGI callable should return None, but returned '%s'." + self.logger.error(msg, result) + self.transport.close() + elif not self.response_started and not self.disconnected: + msg = "ASGI callable returned without starting response." + self.logger.error(msg) + await self.send_500_response() + elif not self.response_complete and not self.disconnected: + msg = "ASGI callable returned without completing response." + self.logger.error(msg) + self.transport.close() + finally: + self.on_response = lambda: None + + async def send_500_response(self) -> None: + response_start_event: HTTPResponseStartEvent = { + "type": "http.response.start", + "status": 500, + "headers": [ + (b"content-type", b"text/plain; charset=utf-8"), + (b"connection", b"close"), + ], + } + await self.send(response_start_event) + response_body_event: HTTPResponseBodyEvent = { + "type": "http.response.body", + "body": b"Internal Server Error", + "more_body": False, + } + await self.send(response_body_event) + + # ASGI interface + async def send(self, message: ASGISendEvent) -> None: + message_type = message["type"] + + if self.flow.write_paused and not self.disconnected: + await self.flow.drain() # pragma: full coverage + + if self.disconnected: + return # pragma: full coverage + + if not self.response_started: + # Sending response status line and headers + if message_type != "http.response.start": + msg = "Expected ASGI message 'http.response.start', but got '%s'." + raise RuntimeError(msg % message_type) + message = cast("HTTPResponseStartEvent", message) + + self.response_started = True + self.waiting_for_100_continue = False + + status = message["status"] + headers = self.default_headers + list(message.get("headers", [])) + + if CLOSE_HEADER in self.scope["headers"] and CLOSE_HEADER not in headers: + headers = headers + [CLOSE_HEADER] + + if self.access_log: + self.access_logger.info( + '%s - "%s %s HTTP/%s" %d', + get_client_addr(self.scope), + self.scope["method"], + get_path_with_query_string(self.scope), + self.scope["http_version"], + status, + ) + + # Write response status line and headers + reason = STATUS_PHRASES[status] + response = h11.Response(status_code=status, headers=headers, reason=reason) + output = self.conn.send(event=response) + self.transport.write(output) + + elif not self.response_complete: + # Sending response body + if message_type != "http.response.body": + msg = "Expected ASGI message 'http.response.body', but got '%s'." + raise RuntimeError(msg % message_type) + message = cast("HTTPResponseBodyEvent", message) + + body = message.get("body", b"") + more_body = message.get("more_body", False) + + # Write response body + data = b"" if self.scope["method"] == "HEAD" else body + output = self.conn.send(event=h11.Data(data=data)) + self.transport.write(output) + + # Handle response completion + if not more_body: + self.response_complete = True + self.message_event.set() + output = self.conn.send(event=h11.EndOfMessage()) + self.transport.write(output) + + else: + # Response already sent + msg = "Unexpected ASGI message '%s' sent, after response already completed." + raise RuntimeError(msg % message_type) + + if self.response_complete: + if self.conn.our_state is h11.MUST_CLOSE or not self.keep_alive: + self.conn.send(event=h11.ConnectionClosed()) + self.transport.close() + self.on_response() + + async def receive(self) -> ASGIReceiveEvent: + if self.waiting_for_100_continue and not self.transport.is_closing(): + headers: list[tuple[str, str]] = [] + event = h11.InformationalResponse(status_code=100, headers=headers, reason="Continue") + output = self.conn.send(event=event) + self.transport.write(output) + self.waiting_for_100_continue = False + + if not self.disconnected and not self.response_complete: + self.flow.resume_reading() + await self.message_event.wait() + self.message_event.clear() + + if self.disconnected or self.response_complete: + return {"type": "http.disconnect"} + + message: HTTPRequestEvent = { + "type": "http.request", + "body": self.body, + "more_body": self.more_body, + } + self.body = b"" + return message diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..00f1fb720756628fb1daf30cab68624a598e09a6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py @@ -0,0 +1,562 @@ +from __future__ import annotations + +import asyncio +import http +import logging +import re +import urllib +from asyncio.events import TimerHandle +from collections import deque +from typing import Any, Callable, Literal, cast + +import httptools + +from uvicorn._types import ( + ASGI3Application, + ASGIReceiveEvent, + ASGISendEvent, + HTTPRequestEvent, + HTTPResponseStartEvent, + HTTPScope, +) +from uvicorn.config import Config +from uvicorn.logging import TRACE_LOG_LEVEL +from uvicorn.protocols.http.flow_control import CLOSE_HEADER, HIGH_WATER_LIMIT, FlowControl, service_unavailable +from uvicorn.protocols.utils import get_client_addr, get_local_addr, get_path_with_query_string, get_remote_addr, is_ssl +from uvicorn.server import ServerState + +HEADER_RE = re.compile(b'[\x00-\x1f\x7f()<>@,;:[]={} \t\\"]') +HEADER_VALUE_RE = re.compile(b"[\x00-\x08\x0a-\x1f\x7f]") + + +def _get_status_line(status_code: int) -> bytes: + try: + phrase = http.HTTPStatus(status_code).phrase.encode() + except ValueError: + phrase = b"" + return b"".join([b"HTTP/1.1 ", str(status_code).encode(), b" ", phrase, b"\r\n"]) + + +STATUS_LINE = {status_code: _get_status_line(status_code) for status_code in range(100, 600)} + + +class HttpToolsProtocol(asyncio.Protocol): + def __init__( + self, + config: Config, + server_state: ServerState, + app_state: dict[str, Any], + _loop: asyncio.AbstractEventLoop | None = None, + ) -> None: + if not config.loaded: + config.load() + + self.config = config + self.app = config.loaded_app + self.loop = _loop or asyncio.get_event_loop() + self.logger = logging.getLogger("uvicorn.error") + self.access_logger = logging.getLogger("uvicorn.access") + self.access_log = self.access_logger.hasHandlers() + self.parser = httptools.HttpRequestParser(self) + self.ws_protocol_class = config.ws_protocol_class + self.root_path = config.root_path + self.limit_concurrency = config.limit_concurrency + self.app_state = app_state + + # Timeouts + self.timeout_keep_alive_task: TimerHandle | None = None + self.timeout_keep_alive = config.timeout_keep_alive + + # Global state + self.server_state = server_state + self.connections = server_state.connections + self.tasks = server_state.tasks + + # Per-connection state + self.transport: asyncio.Transport = None # type: ignore[assignment] + self.flow: FlowControl = None # type: ignore[assignment] + self.server: tuple[str, int] | None = None + self.client: tuple[str, int] | None = None + self.scheme: Literal["http", "https"] | None = None + self.pipeline: deque[tuple[RequestResponseCycle, ASGI3Application]] = deque() + + # Per-request state + self.scope: HTTPScope = None # type: ignore[assignment] + self.headers: list[tuple[bytes, bytes]] = None # type: ignore[assignment] + self.expect_100_continue = False + self.cycle: RequestResponseCycle = None # type: ignore[assignment] + + # Protocol interface + def connection_made( # type: ignore[override] + self, transport: asyncio.Transport + ) -> None: + self.connections.add(self) + + self.transport = transport + self.flow = FlowControl(transport) + self.server = get_local_addr(transport) + self.client = get_remote_addr(transport) + self.scheme = "https" if is_ssl(transport) else "http" + + if self.logger.level <= TRACE_LOG_LEVEL: + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sHTTP connection made", prefix) + + def connection_lost(self, exc: Exception | None) -> None: + self.connections.discard(self) + + if self.logger.level <= TRACE_LOG_LEVEL: + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sHTTP connection lost", prefix) + + if self.cycle and not self.cycle.response_complete: + self.cycle.disconnected = True + if self.cycle is not None: + self.cycle.message_event.set() + if self.flow is not None: + self.flow.resume_writing() + if exc is None: + self.transport.close() + self._unset_keepalive_if_required() + + self.parser = None + + def eof_received(self) -> None: + pass + + def _unset_keepalive_if_required(self) -> None: + if self.timeout_keep_alive_task is not None: + self.timeout_keep_alive_task.cancel() + self.timeout_keep_alive_task = None + + def _get_upgrade(self) -> bytes | None: + connection = [] + upgrade = None + for name, value in self.headers: + if name == b"connection": + connection = [token.lower().strip() for token in value.split(b",")] + if name == b"upgrade": + upgrade = value.lower() + if b"upgrade" in connection: + return upgrade + return None # pragma: full coverage + + def _should_upgrade_to_ws(self) -> bool: + if self.ws_protocol_class is None: + return False + return True + + def _unsupported_upgrade_warning(self) -> None: + self.logger.warning("Unsupported upgrade request.") + if not self._should_upgrade_to_ws(): + msg = "No supported WebSocket library detected. Please use \"pip install 'uvicorn[standard]'\", or install 'websockets' or 'wsproto' manually." # noqa: E501 + self.logger.warning(msg) + + def _should_upgrade(self) -> bool: + upgrade = self._get_upgrade() + return upgrade == b"websocket" and self._should_upgrade_to_ws() + + def data_received(self, data: bytes) -> None: + self._unset_keepalive_if_required() + + try: + self.parser.feed_data(data) + except httptools.HttpParserError: + msg = "Invalid HTTP request received." + self.logger.warning(msg) + self.send_400_response(msg) + return + except httptools.HttpParserUpgrade: + if self._should_upgrade(): + self.handle_websocket_upgrade() + else: + self._unsupported_upgrade_warning() + + def handle_websocket_upgrade(self) -> None: + if self.logger.level <= TRACE_LOG_LEVEL: + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sUpgrading to WebSocket", prefix) + + self.connections.discard(self) + method = self.scope["method"].encode() + output = [method, b" ", self.url, b" HTTP/1.1\r\n"] + for name, value in self.scope["headers"]: + output += [name, b": ", value, b"\r\n"] + output.append(b"\r\n") + protocol = self.ws_protocol_class( # type: ignore[call-arg, misc] + config=self.config, + server_state=self.server_state, + app_state=self.app_state, + ) + protocol.connection_made(self.transport) + protocol.data_received(b"".join(output)) + self.transport.set_protocol(protocol) + + def send_400_response(self, msg: str) -> None: + content = [STATUS_LINE[400]] + for name, value in self.server_state.default_headers: + content.extend([name, b": ", value, b"\r\n"]) # pragma: full coverage + content.extend( + [ + b"content-type: text/plain; charset=utf-8\r\n", + b"content-length: " + str(len(msg)).encode("ascii") + b"\r\n", + b"connection: close\r\n", + b"\r\n", + msg.encode("ascii"), + ] + ) + self.transport.write(b"".join(content)) + self.transport.close() + + def on_message_begin(self) -> None: + self.url = b"" + self.expect_100_continue = False + self.headers = [] + self.scope = { # type: ignore[typeddict-item] + "type": "http", + "asgi": {"version": self.config.asgi_version, "spec_version": "2.4"}, + "http_version": "1.1", + "server": self.server, + "client": self.client, + "scheme": self.scheme, # type: ignore[typeddict-item] + "root_path": self.root_path, + "headers": self.headers, + "state": self.app_state.copy(), + } + + # Parser callbacks + def on_url(self, url: bytes) -> None: + self.url += url + + def on_header(self, name: bytes, value: bytes) -> None: + name = name.lower() + if name == b"expect" and value.lower() == b"100-continue": + self.expect_100_continue = True + self.headers.append((name, value)) + + def on_headers_complete(self) -> None: + http_version = self.parser.get_http_version() + method = self.parser.get_method() + self.scope["method"] = method.decode("ascii") + if http_version != "1.1": + self.scope["http_version"] = http_version + if self.parser.should_upgrade() and self._should_upgrade(): + return + parsed_url = httptools.parse_url(self.url) + raw_path = parsed_url.path + path = raw_path.decode("ascii") + if "%" in path: + path = urllib.parse.unquote(path) + full_path = self.root_path + path + full_raw_path = self.root_path.encode("ascii") + raw_path + self.scope["path"] = full_path + self.scope["raw_path"] = full_raw_path + self.scope["query_string"] = parsed_url.query or b"" + + # Handle 503 responses when 'limit_concurrency' is exceeded. + if self.limit_concurrency is not None and ( + len(self.connections) >= self.limit_concurrency or len(self.tasks) >= self.limit_concurrency + ): + app = service_unavailable + message = "Exceeded concurrency limit." + self.logger.warning(message) + else: + app = self.app + + existing_cycle = self.cycle + self.cycle = RequestResponseCycle( + scope=self.scope, + transport=self.transport, + flow=self.flow, + logger=self.logger, + access_logger=self.access_logger, + access_log=self.access_log, + default_headers=self.server_state.default_headers, + message_event=asyncio.Event(), + expect_100_continue=self.expect_100_continue, + keep_alive=http_version != "1.0", + on_response=self.on_response_complete, + ) + if existing_cycle is None or existing_cycle.response_complete: + # Standard case - start processing the request. + task = self.loop.create_task(self.cycle.run_asgi(app)) + task.add_done_callback(self.tasks.discard) + self.tasks.add(task) + else: + # Pipelined HTTP requests need to be queued up. + self.flow.pause_reading() + self.pipeline.appendleft((self.cycle, app)) + + def on_body(self, body: bytes) -> None: + if (self.parser.should_upgrade() and self._should_upgrade()) or self.cycle.response_complete: + return + self.cycle.body += body + if len(self.cycle.body) > HIGH_WATER_LIMIT: + self.flow.pause_reading() + self.cycle.message_event.set() + + def on_message_complete(self) -> None: + if (self.parser.should_upgrade() and self._should_upgrade()) or self.cycle.response_complete: + return + self.cycle.more_body = False + self.cycle.message_event.set() + + def on_response_complete(self) -> None: + # Callback for pipelined HTTP requests to be started. + self.server_state.total_requests += 1 + + if self.transport.is_closing(): + return + + self._unset_keepalive_if_required() + + # Unpause data reads if needed. + self.flow.resume_reading() + + # Unblock any pipelined events. If there are none, arm the + # Keep-Alive timeout instead. + if self.pipeline: + cycle, app = self.pipeline.pop() + task = self.loop.create_task(cycle.run_asgi(app)) + task.add_done_callback(self.tasks.discard) + self.tasks.add(task) + else: + self.timeout_keep_alive_task = self.loop.call_later( + self.timeout_keep_alive, self.timeout_keep_alive_handler + ) + + def shutdown(self) -> None: + """ + Called by the server to commence a graceful shutdown. + """ + if self.cycle is None or self.cycle.response_complete: + self.transport.close() + else: + self.cycle.keep_alive = False + + def pause_writing(self) -> None: + """ + Called by the transport when the write buffer exceeds the high water mark. + """ + self.flow.pause_writing() # pragma: full coverage + + def resume_writing(self) -> None: + """ + Called by the transport when the write buffer drops below the low water mark. + """ + self.flow.resume_writing() # pragma: full coverage + + def timeout_keep_alive_handler(self) -> None: + """ + Called on a keep-alive connection if no new data is received after a short + delay. + """ + if not self.transport.is_closing(): + self.transport.close() + + +class RequestResponseCycle: + def __init__( + self, + scope: HTTPScope, + transport: asyncio.Transport, + flow: FlowControl, + logger: logging.Logger, + access_logger: logging.Logger, + access_log: bool, + default_headers: list[tuple[bytes, bytes]], + message_event: asyncio.Event, + expect_100_continue: bool, + keep_alive: bool, + on_response: Callable[..., None], + ): + self.scope = scope + self.transport = transport + self.flow = flow + self.logger = logger + self.access_logger = access_logger + self.access_log = access_log + self.default_headers = default_headers + self.message_event = message_event + self.on_response = on_response + + # Connection state + self.disconnected = False + self.keep_alive = keep_alive + self.waiting_for_100_continue = expect_100_continue + + # Request state + self.body = b"" + self.more_body = True + + # Response state + self.response_started = False + self.response_complete = False + self.chunked_encoding: bool | None = None + self.expected_content_length = 0 + + # ASGI exception wrapper + async def run_asgi(self, app: ASGI3Application) -> None: + try: + result = await app( # type: ignore[func-returns-value] + self.scope, self.receive, self.send + ) + except BaseException as exc: + msg = "Exception in ASGI application\n" + self.logger.error(msg, exc_info=exc) + if not self.response_started: + await self.send_500_response() + else: + self.transport.close() + else: + if result is not None: + msg = "ASGI callable should return None, but returned '%s'." + self.logger.error(msg, result) + self.transport.close() + elif not self.response_started and not self.disconnected: + msg = "ASGI callable returned without starting response." + self.logger.error(msg) + await self.send_500_response() + elif not self.response_complete and not self.disconnected: + msg = "ASGI callable returned without completing response." + self.logger.error(msg) + self.transport.close() + finally: + self.on_response = lambda: None + + async def send_500_response(self) -> None: + await self.send( + { + "type": "http.response.start", + "status": 500, + "headers": [ + (b"content-type", b"text/plain; charset=utf-8"), + (b"content-length", b"21"), + (b"connection", b"close"), + ], + } + ) + await self.send({"type": "http.response.body", "body": b"Internal Server Error", "more_body": False}) + + # ASGI interface + async def send(self, message: ASGISendEvent) -> None: + message_type = message["type"] + + if self.flow.write_paused and not self.disconnected: + await self.flow.drain() # pragma: full coverage + + if self.disconnected: + return # pragma: full coverage + + if not self.response_started: + # Sending response status line and headers + if message_type != "http.response.start": + msg = "Expected ASGI message 'http.response.start', but got '%s'." + raise RuntimeError(msg % message_type) + message = cast("HTTPResponseStartEvent", message) + + self.response_started = True + self.waiting_for_100_continue = False + + status_code = message["status"] + headers = self.default_headers + list(message.get("headers", [])) + + if CLOSE_HEADER in self.scope["headers"] and CLOSE_HEADER not in headers: + headers = headers + [CLOSE_HEADER] + + if self.access_log: + self.access_logger.info( + '%s - "%s %s HTTP/%s" %d', + get_client_addr(self.scope), + self.scope["method"], + get_path_with_query_string(self.scope), + self.scope["http_version"], + status_code, + ) + + # Write response status line and headers + content = [STATUS_LINE[status_code]] + + for name, value in headers: + if HEADER_RE.search(name): + raise RuntimeError("Invalid HTTP header name.") # pragma: full coverage + if HEADER_VALUE_RE.search(value): + raise RuntimeError("Invalid HTTP header value.") + + name = name.lower() + if name == b"content-length" and self.chunked_encoding is None: + self.expected_content_length = int(value.decode()) + self.chunked_encoding = False + elif name == b"transfer-encoding" and value.lower() == b"chunked": + self.expected_content_length = 0 + self.chunked_encoding = True + elif name == b"connection" and value.lower() == b"close": + self.keep_alive = False + content.extend([name, b": ", value, b"\r\n"]) + + if self.chunked_encoding is None and self.scope["method"] != "HEAD" and status_code not in (204, 304): + # Neither content-length nor transfer-encoding specified + self.chunked_encoding = True + content.append(b"transfer-encoding: chunked\r\n") + + content.append(b"\r\n") + self.transport.write(b"".join(content)) + + elif not self.response_complete: + # Sending response body + if message_type != "http.response.body": + msg = "Expected ASGI message 'http.response.body', but got '%s'." + raise RuntimeError(msg % message_type) + + body = cast(bytes, message.get("body", b"")) + more_body = message.get("more_body", False) + + # Write response body + if self.scope["method"] == "HEAD": + self.expected_content_length = 0 + elif self.chunked_encoding: + if body: + content = [b"%x\r\n" % len(body), body, b"\r\n"] + else: + content = [] + if not more_body: + content.append(b"0\r\n\r\n") + self.transport.write(b"".join(content)) + else: + num_bytes = len(body) + if num_bytes > self.expected_content_length: + raise RuntimeError("Response content longer than Content-Length") + else: + self.expected_content_length -= num_bytes + self.transport.write(body) + + # Handle response completion + if not more_body: + if self.expected_content_length != 0: + raise RuntimeError("Response content shorter than Content-Length") + self.response_complete = True + self.message_event.set() + if not self.keep_alive: + self.transport.close() + self.on_response() + + else: + # Response already sent + msg = "Unexpected ASGI message '%s' sent, after response already completed." + raise RuntimeError(msg % message_type) + + async def receive(self) -> ASGIReceiveEvent: + if self.waiting_for_100_continue and not self.transport.is_closing(): + self.transport.write(b"HTTP/1.1 100 Continue\r\n\r\n") + self.waiting_for_100_continue = False + + if not self.disconnected and not self.response_complete: + self.flow.resume_reading() + await self.message_event.wait() + self.message_event.clear() + + if self.disconnected or self.response_complete: + return {"type": "http.disconnect"} + message: HTTPRequestEvent = {"type": "http.request", "body": self.body, "more_body": self.more_body} + self.body = b"" + return message diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/utils.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..e1d6f01d53b33f0cba9d61b8f7ba2e8c079e101f --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/utils.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +import asyncio +import urllib.parse + +from uvicorn._types import WWWScope + + +class ClientDisconnected(OSError): ... + + +def get_remote_addr(transport: asyncio.Transport) -> tuple[str, int] | None: + socket_info = transport.get_extra_info("socket") + if socket_info is not None: + try: + info = socket_info.getpeername() + return (str(info[0]), int(info[1])) if isinstance(info, tuple) else None + except OSError: # pragma: no cover + # This case appears to inconsistently occur with uvloop + # bound to a unix domain socket. + return None + + info = transport.get_extra_info("peername") + if info is not None and isinstance(info, (list, tuple)) and len(info) == 2: + return (str(info[0]), int(info[1])) + return None + + +def get_local_addr(transport: asyncio.Transport) -> tuple[str, int] | None: + socket_info = transport.get_extra_info("socket") + if socket_info is not None: + info = socket_info.getsockname() + + return (str(info[0]), int(info[1])) if isinstance(info, tuple) else None + info = transport.get_extra_info("sockname") + if info is not None and isinstance(info, (list, tuple)) and len(info) == 2: + return (str(info[0]), int(info[1])) + return None + + +def is_ssl(transport: asyncio.Transport) -> bool: + return bool(transport.get_extra_info("sslcontext")) + + +def get_client_addr(scope: WWWScope) -> str: + client = scope.get("client") + if not client: + return "" + return "%s:%d" % client + + +def get_path_with_query_string(scope: WWWScope) -> str: + path_with_query_string = urllib.parse.quote(scope["path"]) + if scope["query_string"]: + path_with_query_string = "{}?{}".format(path_with_query_string, scope["query_string"].decode("ascii")) + return path_with_query_string diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eedc707f62fbc1c31ef6b770fa191be5ee95cb69 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/auto.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/auto.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a24e3b96dbb55bcf740dde6d89efc87a5a522aab Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/auto.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/websockets_impl.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/websockets_impl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..297059d46b1da104d8a4a537c3e92c3962e917f3 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/websockets_impl.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/wsproto_impl.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/wsproto_impl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..abf603add5eaa19e821ea8d8a2c36fa4c4ef2711 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/__pycache__/wsproto_impl.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/auto.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/auto.py new file mode 100644 index 0000000000000000000000000000000000000000..08fd13678a1c4dffe3e126acf0167c17d62c2ed8 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/auto.py @@ -0,0 +1,21 @@ +from __future__ import annotations + +import asyncio +import typing + +AutoWebSocketsProtocol: typing.Callable[..., asyncio.Protocol] | None +try: + import websockets # noqa +except ImportError: # pragma: no cover + try: + import wsproto # noqa + except ImportError: + AutoWebSocketsProtocol = None + else: + from uvicorn.protocols.websockets.wsproto_impl import WSProtocol + + AutoWebSocketsProtocol = WSProtocol +else: + from uvicorn.protocols.websockets.websockets_impl import WebSocketProtocol + + AutoWebSocketsProtocol = WebSocketProtocol diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/websockets_impl.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/websockets_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..c0700d4d3300ad46f6788e095f63ac63f5f4b108 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/websockets_impl.py @@ -0,0 +1,389 @@ +from __future__ import annotations + +import asyncio +import http +import logging +from typing import Any, Literal, Optional, Sequence, cast +from urllib.parse import unquote + +import websockets +import websockets.legacy.handshake +from websockets.datastructures import Headers +from websockets.exceptions import ConnectionClosed +from websockets.extensions.base import ServerExtensionFactory +from websockets.extensions.permessage_deflate import ServerPerMessageDeflateFactory +from websockets.legacy.server import HTTPResponse +from websockets.server import WebSocketServerProtocol +from websockets.typing import Subprotocol + +from uvicorn._types import ( + ASGI3Application, + ASGISendEvent, + WebSocketAcceptEvent, + WebSocketCloseEvent, + WebSocketConnectEvent, + WebSocketDisconnectEvent, + WebSocketReceiveEvent, + WebSocketResponseBodyEvent, + WebSocketResponseStartEvent, + WebSocketScope, + WebSocketSendEvent, +) +from uvicorn.config import Config +from uvicorn.logging import TRACE_LOG_LEVEL +from uvicorn.protocols.utils import ( + ClientDisconnected, + get_local_addr, + get_path_with_query_string, + get_remote_addr, + is_ssl, +) +from uvicorn.server import ServerState + + +class Server: + closing = False + + def register(self, ws: WebSocketServerProtocol) -> None: + pass + + def unregister(self, ws: WebSocketServerProtocol) -> None: + pass + + def is_serving(self) -> bool: + return not self.closing + + +class WebSocketProtocol(WebSocketServerProtocol): + extra_headers: list[tuple[str, str]] + logger: logging.Logger | logging.LoggerAdapter[Any] + + def __init__( + self, + config: Config, + server_state: ServerState, + app_state: dict[str, Any], + _loop: asyncio.AbstractEventLoop | None = None, + ): + if not config.loaded: + config.load() + + self.config = config + self.app = cast(ASGI3Application, config.loaded_app) + self.loop = _loop or asyncio.get_event_loop() + self.root_path = config.root_path + self.app_state = app_state + + # Shared server state + self.connections = server_state.connections + self.tasks = server_state.tasks + + # Connection state + self.transport: asyncio.Transport = None # type: ignore[assignment] + self.server: tuple[str, int] | None = None + self.client: tuple[str, int] | None = None + self.scheme: Literal["wss", "ws"] = None # type: ignore[assignment] + + # Connection events + self.scope: WebSocketScope + self.handshake_started_event = asyncio.Event() + self.handshake_completed_event = asyncio.Event() + self.closed_event = asyncio.Event() + self.initial_response: HTTPResponse | None = None + self.connect_sent = False + self.lost_connection_before_handshake = False + self.accepted_subprotocol: Subprotocol | None = None + + self.ws_server: Server = Server() # type: ignore[assignment] + + extensions: list[ServerExtensionFactory] = [] + if self.config.ws_per_message_deflate: + extensions.append(ServerPerMessageDeflateFactory()) + + super().__init__( + ws_handler=self.ws_handler, + ws_server=self.ws_server, # type: ignore[arg-type] + max_size=self.config.ws_max_size, + max_queue=self.config.ws_max_queue, + ping_interval=self.config.ws_ping_interval, + ping_timeout=self.config.ws_ping_timeout, + extensions=extensions, + logger=logging.getLogger("uvicorn.error"), + ) + self.server_header = None + self.extra_headers = [ + (name.decode("latin-1"), value.decode("latin-1")) for name, value in server_state.default_headers + ] + + def connection_made( # type: ignore[override] + self, transport: asyncio.Transport + ) -> None: + self.connections.add(self) + self.transport = transport + self.server = get_local_addr(transport) + self.client = get_remote_addr(transport) + self.scheme = "wss" if is_ssl(transport) else "ws" + + if self.logger.isEnabledFor(TRACE_LOG_LEVEL): + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sWebSocket connection made", prefix) + + super().connection_made(transport) + + def connection_lost(self, exc: Exception | None) -> None: + self.connections.remove(self) + + if self.logger.isEnabledFor(TRACE_LOG_LEVEL): + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sWebSocket connection lost", prefix) + + self.lost_connection_before_handshake = not self.handshake_completed_event.is_set() + self.handshake_completed_event.set() + super().connection_lost(exc) + if exc is None: + self.transport.close() + + def shutdown(self) -> None: + self.ws_server.closing = True + if self.handshake_completed_event.is_set(): + self.fail_connection(1012) + else: + self.send_500_response() + self.transport.close() + + def on_task_complete(self, task: asyncio.Task[None]) -> None: + self.tasks.discard(task) + + async def process_request(self, path: str, request_headers: Headers) -> HTTPResponse | None: + """ + This hook is called to determine if the websocket should return + an HTTP response and close. + + Our behavior here is to start the ASGI application, and then wait + for either `accept` or `close` in order to determine if we should + close the connection. + """ + path_portion, _, query_string = path.partition("?") + + websockets.legacy.handshake.check_request(request_headers) + + subprotocols: list[str] = [] + for header in request_headers.get_all("Sec-WebSocket-Protocol"): + subprotocols.extend([token.strip() for token in header.split(",")]) + + asgi_headers = [ + (name.encode("ascii"), value.encode("ascii", errors="surrogateescape")) + for name, value in request_headers.raw_items() + ] + path = unquote(path_portion) + full_path = self.root_path + path + full_raw_path = self.root_path.encode("ascii") + path_portion.encode("ascii") + + self.scope = { + "type": "websocket", + "asgi": {"version": self.config.asgi_version, "spec_version": "2.4"}, + "http_version": "1.1", + "scheme": self.scheme, + "server": self.server, + "client": self.client, + "root_path": self.root_path, + "path": full_path, + "raw_path": full_raw_path, + "query_string": query_string.encode("ascii"), + "headers": asgi_headers, + "subprotocols": subprotocols, + "state": self.app_state.copy(), + "extensions": {"websocket.http.response": {}}, + } + task = self.loop.create_task(self.run_asgi()) + task.add_done_callback(self.on_task_complete) + self.tasks.add(task) + await self.handshake_started_event.wait() + return self.initial_response + + def process_subprotocol( + self, headers: Headers, available_subprotocols: Sequence[Subprotocol] | None + ) -> Subprotocol | None: + """ + We override the standard 'process_subprotocol' behavior here so that + we return whatever subprotocol is sent in the 'accept' message. + """ + return self.accepted_subprotocol + + def send_500_response(self) -> None: + msg = b"Internal Server Error" + content = [ + b"HTTP/1.1 500 Internal Server Error\r\n" b"content-type: text/plain; charset=utf-8\r\n", + b"content-length: " + str(len(msg)).encode("ascii") + b"\r\n", + b"connection: close\r\n", + b"\r\n", + msg, + ] + self.transport.write(b"".join(content)) + # Allow handler task to terminate cleanly, as websockets doesn't cancel it by + # itself (see https://github.com/encode/uvicorn/issues/920) + self.handshake_started_event.set() + + async def ws_handler( # type: ignore[override] + self, protocol: WebSocketServerProtocol, path: str + ) -> Any: + """ + This is the main handler function for the 'websockets' implementation + to call into. We just wait for close then return, and instead allow + 'send' and 'receive' events to drive the flow. + """ + self.handshake_completed_event.set() + await self.wait_closed() + + async def run_asgi(self) -> None: + """ + Wrapper around the ASGI callable, handling exceptions and unexpected + termination states. + """ + try: + result = await self.app(self.scope, self.asgi_receive, self.asgi_send) # type: ignore[func-returns-value] + except ClientDisconnected: # pragma: full coverage + self.closed_event.set() + self.transport.close() + except BaseException: + self.closed_event.set() + self.logger.exception("Exception in ASGI application\n") + if not self.handshake_started_event.is_set(): + self.send_500_response() + else: + await self.handshake_completed_event.wait() + self.transport.close() + else: + self.closed_event.set() + if not self.handshake_started_event.is_set(): + self.logger.error("ASGI callable returned without sending handshake.") + self.send_500_response() + self.transport.close() + elif result is not None: + self.logger.error("ASGI callable should return None, but returned '%s'.", result) + await self.handshake_completed_event.wait() + self.transport.close() + + async def asgi_send(self, message: ASGISendEvent) -> None: + message_type = message["type"] + + if not self.handshake_started_event.is_set(): + if message_type == "websocket.accept": + message = cast("WebSocketAcceptEvent", message) + self.logger.info( + '%s - "WebSocket %s" [accepted]', + self.scope["client"], + get_path_with_query_string(self.scope), + ) + self.initial_response = None + self.accepted_subprotocol = cast(Optional[Subprotocol], message.get("subprotocol")) + if "headers" in message: + self.extra_headers.extend( + # ASGI spec requires bytes + # But for compatibility we need to convert it to strings + (name.decode("latin-1"), value.decode("latin-1")) + for name, value in message["headers"] + ) + self.handshake_started_event.set() + + elif message_type == "websocket.close": + message = cast("WebSocketCloseEvent", message) + self.logger.info( + '%s - "WebSocket %s" 403', + self.scope["client"], + get_path_with_query_string(self.scope), + ) + self.initial_response = (http.HTTPStatus.FORBIDDEN, [], b"") + self.handshake_started_event.set() + self.closed_event.set() + + elif message_type == "websocket.http.response.start": + message = cast("WebSocketResponseStartEvent", message) + self.logger.info( + '%s - "WebSocket %s" %d', + self.scope["client"], + get_path_with_query_string(self.scope), + message["status"], + ) + # websockets requires the status to be an enum. look it up. + status = http.HTTPStatus(message["status"]) + headers = [ + (name.decode("latin-1"), value.decode("latin-1")) for name, value in message.get("headers", []) + ] + self.initial_response = (status, headers, b"") + self.handshake_started_event.set() + + else: + msg = ( + "Expected ASGI message 'websocket.accept', 'websocket.close', " + "or 'websocket.http.response.start' but got '%s'." + ) + raise RuntimeError(msg % message_type) + + elif not self.closed_event.is_set() and self.initial_response is None: + await self.handshake_completed_event.wait() + + try: + if message_type == "websocket.send": + message = cast("WebSocketSendEvent", message) + bytes_data = message.get("bytes") + text_data = message.get("text") + data = text_data if bytes_data is None else bytes_data + await self.send(data) # type: ignore[arg-type] + + elif message_type == "websocket.close": + message = cast("WebSocketCloseEvent", message) + code = message.get("code", 1000) + reason = message.get("reason", "") or "" + await self.close(code, reason) + self.closed_event.set() + + else: + msg = "Expected ASGI message 'websocket.send' or 'websocket.close'," " but got '%s'." + raise RuntimeError(msg % message_type) + except ConnectionClosed as exc: + raise ClientDisconnected from exc + + elif self.initial_response is not None: + if message_type == "websocket.http.response.body": + message = cast("WebSocketResponseBodyEvent", message) + body = self.initial_response[2] + message["body"] + self.initial_response = self.initial_response[:2] + (body,) + if not message.get("more_body", False): + self.closed_event.set() + else: + msg = "Expected ASGI message 'websocket.http.response.body' " "but got '%s'." + raise RuntimeError(msg % message_type) + + else: + msg = "Unexpected ASGI message '%s', after sending 'websocket.close' " "or response already completed." + raise RuntimeError(msg % message_type) + + async def asgi_receive( + self, + ) -> WebSocketDisconnectEvent | WebSocketConnectEvent | WebSocketReceiveEvent: + if not self.connect_sent: + self.connect_sent = True + return {"type": "websocket.connect"} + + await self.handshake_completed_event.wait() + + if self.lost_connection_before_handshake: + # If the handshake failed or the app closed before handshake completion, + # use 1006 Abnormal Closure. + return {"type": "websocket.disconnect", "code": 1006} + + if self.closed_event.is_set(): + return {"type": "websocket.disconnect", "code": 1005} + + try: + data = await self.recv() + except ConnectionClosed as exc: + self.closed_event.set() + if self.ws_server.closing: + return {"type": "websocket.disconnect", "code": 1012} + return {"type": "websocket.disconnect", "code": exc.code, "reason": exc.reason} + + if isinstance(data, str): + return {"type": "websocket.receive", "text": data} + return {"type": "websocket.receive", "bytes": data} diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/wsproto_impl.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/wsproto_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..072dec942d7c1358b1d78787b0451ff020955b98 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/wsproto_impl.py @@ -0,0 +1,376 @@ +from __future__ import annotations + +import asyncio +import logging +import typing +from typing import Literal, cast +from urllib.parse import unquote + +import wsproto +from wsproto import ConnectionType, events +from wsproto.connection import ConnectionState +from wsproto.extensions import Extension, PerMessageDeflate +from wsproto.utilities import LocalProtocolError, RemoteProtocolError + +from uvicorn._types import ( + ASGI3Application, + ASGISendEvent, + WebSocketAcceptEvent, + WebSocketCloseEvent, + WebSocketEvent, + WebSocketResponseBodyEvent, + WebSocketResponseStartEvent, + WebSocketScope, + WebSocketSendEvent, +) +from uvicorn.config import Config +from uvicorn.logging import TRACE_LOG_LEVEL +from uvicorn.protocols.utils import ( + ClientDisconnected, + get_local_addr, + get_path_with_query_string, + get_remote_addr, + is_ssl, +) +from uvicorn.server import ServerState + + +class WSProtocol(asyncio.Protocol): + def __init__( + self, + config: Config, + server_state: ServerState, + app_state: dict[str, typing.Any], + _loop: asyncio.AbstractEventLoop | None = None, + ) -> None: + if not config.loaded: + config.load() # pragma: full coverage + + self.config = config + self.app = cast(ASGI3Application, config.loaded_app) + self.loop = _loop or asyncio.get_event_loop() + self.logger = logging.getLogger("uvicorn.error") + self.root_path = config.root_path + self.app_state = app_state + + # Shared server state + self.connections = server_state.connections + self.tasks = server_state.tasks + self.default_headers = server_state.default_headers + + # Connection state + self.transport: asyncio.Transport = None # type: ignore[assignment] + self.server: tuple[str, int] | None = None + self.client: tuple[str, int] | None = None + self.scheme: Literal["wss", "ws"] = None # type: ignore[assignment] + + # WebSocket state + self.queue: asyncio.Queue[WebSocketEvent] = asyncio.Queue() + self.handshake_complete = False + self.close_sent = False + + # Rejection state + self.response_started = False + + self.conn = wsproto.WSConnection(connection_type=ConnectionType.SERVER) + + self.read_paused = False + self.writable = asyncio.Event() + self.writable.set() + + # Buffers + self.bytes = b"" + self.text = "" + + # Protocol interface + + def connection_made( # type: ignore[override] + self, transport: asyncio.Transport + ) -> None: + self.connections.add(self) + self.transport = transport + self.server = get_local_addr(transport) + self.client = get_remote_addr(transport) + self.scheme = "wss" if is_ssl(transport) else "ws" + + if self.logger.level <= TRACE_LOG_LEVEL: + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sWebSocket connection made", prefix) + + def connection_lost(self, exc: Exception | None) -> None: + code = 1005 if self.handshake_complete else 1006 + self.queue.put_nowait({"type": "websocket.disconnect", "code": code}) + self.connections.remove(self) + + if self.logger.level <= TRACE_LOG_LEVEL: + prefix = "%s:%d - " % self.client if self.client else "" + self.logger.log(TRACE_LOG_LEVEL, "%sWebSocket connection lost", prefix) + + self.handshake_complete = True + if exc is None: + self.transport.close() + + def eof_received(self) -> None: + pass + + def data_received(self, data: bytes) -> None: + try: + self.conn.receive_data(data) + except RemoteProtocolError as err: + # TODO: Remove `type: ignore` when wsproto fixes the type annotation. + self.transport.write(self.conn.send(err.event_hint)) # type: ignore[arg-type] # noqa: E501 + self.transport.close() + else: + self.handle_events() + + def handle_events(self) -> None: + for event in self.conn.events(): + if isinstance(event, events.Request): + self.handle_connect(event) + elif isinstance(event, events.TextMessage): + self.handle_text(event) + elif isinstance(event, events.BytesMessage): + self.handle_bytes(event) + elif isinstance(event, events.CloseConnection): + self.handle_close(event) + elif isinstance(event, events.Ping): + self.handle_ping(event) + + def pause_writing(self) -> None: + """ + Called by the transport when the write buffer exceeds the high water mark. + """ + self.writable.clear() # pragma: full coverage + + def resume_writing(self) -> None: + """ + Called by the transport when the write buffer drops below the low water mark. + """ + self.writable.set() # pragma: full coverage + + def shutdown(self) -> None: + if self.handshake_complete: + self.queue.put_nowait({"type": "websocket.disconnect", "code": 1012}) + output = self.conn.send(wsproto.events.CloseConnection(code=1012)) + self.transport.write(output) + else: + self.send_500_response() + self.transport.close() + + def on_task_complete(self, task: asyncio.Task[None]) -> None: + self.tasks.discard(task) + + # Event handlers + + def handle_connect(self, event: events.Request) -> None: + headers = [(b"host", event.host.encode())] + headers += [(key.lower(), value) for key, value in event.extra_headers] + raw_path, _, query_string = event.target.partition("?") + path = unquote(raw_path) + full_path = self.root_path + path + full_raw_path = self.root_path.encode("ascii") + raw_path.encode("ascii") + self.scope: WebSocketScope = { + "type": "websocket", + "asgi": {"version": self.config.asgi_version, "spec_version": "2.4"}, + "http_version": "1.1", + "scheme": self.scheme, + "server": self.server, + "client": self.client, + "root_path": self.root_path, + "path": full_path, + "raw_path": full_raw_path, + "query_string": query_string.encode("ascii"), + "headers": headers, + "subprotocols": event.subprotocols, + "state": self.app_state.copy(), + "extensions": {"websocket.http.response": {}}, + } + self.queue.put_nowait({"type": "websocket.connect"}) + task = self.loop.create_task(self.run_asgi()) + task.add_done_callback(self.on_task_complete) + self.tasks.add(task) + + def handle_text(self, event: events.TextMessage) -> None: + self.text += event.data + if event.message_finished: + self.queue.put_nowait({"type": "websocket.receive", "text": self.text}) + self.text = "" + if not self.read_paused: + self.read_paused = True + self.transport.pause_reading() + + def handle_bytes(self, event: events.BytesMessage) -> None: + self.bytes += event.data + # todo: we may want to guard the size of self.bytes and self.text + if event.message_finished: + self.queue.put_nowait({"type": "websocket.receive", "bytes": self.bytes}) + self.bytes = b"" + if not self.read_paused: + self.read_paused = True + self.transport.pause_reading() + + def handle_close(self, event: events.CloseConnection) -> None: + if self.conn.state == ConnectionState.REMOTE_CLOSING: + self.transport.write(self.conn.send(event.response())) + self.queue.put_nowait({"type": "websocket.disconnect", "code": event.code, "reason": event.reason}) + self.transport.close() + + def handle_ping(self, event: events.Ping) -> None: + self.transport.write(self.conn.send(event.response())) + + def send_500_response(self) -> None: + if self.response_started or self.handshake_complete: + return # we cannot send responses anymore + headers: list[tuple[bytes, bytes]] = [ + (b"content-type", b"text/plain; charset=utf-8"), + (b"connection", b"close"), + ] + output = self.conn.send(wsproto.events.RejectConnection(status_code=500, headers=headers, has_body=True)) + output += self.conn.send(wsproto.events.RejectData(data=b"Internal Server Error")) + self.transport.write(output) + + async def run_asgi(self) -> None: + try: + result = await self.app(self.scope, self.receive, self.send) # type: ignore[func-returns-value] + except ClientDisconnected: + self.transport.close() # pragma: full coverage + except BaseException: + self.logger.exception("Exception in ASGI application\n") + self.send_500_response() + self.transport.close() + else: + if not self.handshake_complete: + self.logger.error("ASGI callable returned without completing handshake.") + self.send_500_response() + self.transport.close() + elif result is not None: + self.logger.error("ASGI callable should return None, but returned '%s'.", result) + self.transport.close() + + async def send(self, message: ASGISendEvent) -> None: + await self.writable.wait() + + message_type = message["type"] + + if not self.handshake_complete: + if message_type == "websocket.accept": + message = typing.cast(WebSocketAcceptEvent, message) + self.logger.info( + '%s - "WebSocket %s" [accepted]', + self.scope["client"], + get_path_with_query_string(self.scope), + ) + subprotocol = message.get("subprotocol") + extra_headers = self.default_headers + list(message.get("headers", [])) + extensions: list[Extension] = [] + if self.config.ws_per_message_deflate: + extensions.append(PerMessageDeflate()) + if not self.transport.is_closing(): + self.handshake_complete = True + output = self.conn.send( + wsproto.events.AcceptConnection( + subprotocol=subprotocol, + extensions=extensions, + extra_headers=extra_headers, + ) + ) + self.transport.write(output) + + elif message_type == "websocket.close": + self.queue.put_nowait({"type": "websocket.disconnect", "code": 1006}) + self.logger.info( + '%s - "WebSocket %s" 403', + self.scope["client"], + get_path_with_query_string(self.scope), + ) + self.handshake_complete = True + self.close_sent = True + event = events.RejectConnection(status_code=403, headers=[]) + output = self.conn.send(event) + self.transport.write(output) + self.transport.close() + + elif message_type == "websocket.http.response.start": + message = typing.cast(WebSocketResponseStartEvent, message) + # ensure status code is in the valid range + if not (100 <= message["status"] < 600): + msg = "Invalid HTTP status code '%d' in response." + raise RuntimeError(msg % message["status"]) + self.logger.info( + '%s - "WebSocket %s" %d', + self.scope["client"], + get_path_with_query_string(self.scope), + message["status"], + ) + self.handshake_complete = True + event = events.RejectConnection( + status_code=message["status"], + headers=list(message["headers"]), + has_body=True, + ) + output = self.conn.send(event) + self.transport.write(output) + self.response_started = True + + else: + msg = ( + "Expected ASGI message 'websocket.accept', 'websocket.close' " + "or 'websocket.http.response.start' " + "but got '%s'." + ) + raise RuntimeError(msg % message_type) + + elif not self.close_sent and not self.response_started: + try: + if message_type == "websocket.send": + message = typing.cast(WebSocketSendEvent, message) + bytes_data = message.get("bytes") + text_data = message.get("text") + data = text_data if bytes_data is None else bytes_data + output = self.conn.send(wsproto.events.Message(data=data)) # type: ignore + if not self.transport.is_closing(): + self.transport.write(output) + + elif message_type == "websocket.close": + message = typing.cast(WebSocketCloseEvent, message) + self.close_sent = True + code = message.get("code", 1000) + reason = message.get("reason", "") or "" + self.queue.put_nowait({"type": "websocket.disconnect", "code": code, "reason": reason}) + output = self.conn.send(wsproto.events.CloseConnection(code=code, reason=reason)) + if not self.transport.is_closing(): + self.transport.write(output) + self.transport.close() + + else: + msg = "Expected ASGI message 'websocket.send' or 'websocket.close'," " but got '%s'." + raise RuntimeError(msg % message_type) + except LocalProtocolError as exc: + raise ClientDisconnected from exc + elif self.response_started: + if message_type == "websocket.http.response.body": + message = typing.cast("WebSocketResponseBodyEvent", message) + body_finished = not message.get("more_body", False) + reject_data = events.RejectData(data=message["body"], body_finished=body_finished) + output = self.conn.send(reject_data) + self.transport.write(output) + + if body_finished: + self.queue.put_nowait({"type": "websocket.disconnect", "code": 1006}) + self.close_sent = True + self.transport.close() + + else: + msg = "Expected ASGI message 'websocket.http.response.body' " "but got '%s'." + raise RuntimeError(msg % message_type) + + else: + msg = "Unexpected ASGI message '%s', after sending 'websocket.close'." + raise RuntimeError(msg % message_type) + + async def receive(self) -> WebSocketEvent: + message = await self.queue.get() + if self.read_paused and self.queue.empty(): + self.read_paused = False + self.transport.resume_reading() + return message diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__init__.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c90f24e4acbf48142b34ae0fe6f137d967cad7e6 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__init__.py @@ -0,0 +1,23 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +from uvicorn.supervisors.basereload import BaseReload +from uvicorn.supervisors.multiprocess import Multiprocess + +if TYPE_CHECKING: + ChangeReload: type[BaseReload] +else: + try: + from uvicorn.supervisors.watchfilesreload import ( + WatchFilesReload as ChangeReload, + ) + except ImportError: # pragma: no cover + try: + from uvicorn.supervisors.watchgodreload import ( + WatchGodReload as ChangeReload, + ) + except ImportError: + from uvicorn.supervisors.statreload import StatReload as ChangeReload + +__all__ = ["Multiprocess", "ChangeReload"] diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/__init__.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d026975c6350c1dc3b6f677409cb4169180b6732 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/__init__.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/basereload.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/basereload.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7202484c736a1ed8a59b2c9d08be495b89b6423b Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/basereload.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/multiprocess.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/multiprocess.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..524a867917b711b1ee949114dedc770a2b24e737 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/multiprocess.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/statreload.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/statreload.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..62720848417307ee29454301184e8e76cbea6cdd Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/statreload.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/watchfilesreload.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/watchfilesreload.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c24ec72eb05c515751419fc921d8ce394c55555a Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/watchfilesreload.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/watchgodreload.cpython-312.pyc b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/watchgodreload.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..628dbe5ffc6ed85c53de86949dd2ec910879eed4 Binary files /dev/null and b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/__pycache__/watchgodreload.cpython-312.pyc differ diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/basereload.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/basereload.py new file mode 100644 index 0000000000000000000000000000000000000000..f07ca391249c4551f9f0a0ccaf1abd56d32c6473 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/basereload.py @@ -0,0 +1,121 @@ +from __future__ import annotations + +import logging +import os +import signal +import sys +import threading +from pathlib import Path +from socket import socket +from types import FrameType +from typing import Callable, Iterator + +import click + +from uvicorn._subprocess import get_subprocess +from uvicorn.config import Config + +HANDLED_SIGNALS = ( + signal.SIGINT, # Unix signal 2. Sent by Ctrl+C. + signal.SIGTERM, # Unix signal 15. Sent by `kill `. +) + +logger = logging.getLogger("uvicorn.error") + + +class BaseReload: + def __init__( + self, + config: Config, + target: Callable[[list[socket] | None], None], + sockets: list[socket], + ) -> None: + self.config = config + self.target = target + self.sockets = sockets + self.should_exit = threading.Event() + self.pid = os.getpid() + self.is_restarting = False + self.reloader_name: str | None = None + + def signal_handler(self, sig: int, frame: FrameType | None) -> None: # pragma: full coverage + """ + A signal handler that is registered with the parent process. + """ + if sys.platform == "win32" and self.is_restarting: + self.is_restarting = False + else: + self.should_exit.set() + + def run(self) -> None: + self.startup() + for changes in self: + if changes: + logger.warning( + "%s detected changes in %s. Reloading...", + self.reloader_name, + ", ".join(map(_display_path, changes)), + ) + self.restart() + + self.shutdown() + + def pause(self) -> None: + if self.should_exit.wait(self.config.reload_delay): + raise StopIteration() + + def __iter__(self) -> Iterator[list[Path] | None]: + return self + + def __next__(self) -> list[Path] | None: + return self.should_restart() + + def startup(self) -> None: + message = f"Started reloader process [{self.pid}] using {self.reloader_name}" + color_message = "Started reloader process [{}] using {}".format( + click.style(str(self.pid), fg="cyan", bold=True), + click.style(str(self.reloader_name), fg="cyan", bold=True), + ) + logger.info(message, extra={"color_message": color_message}) + + for sig in HANDLED_SIGNALS: + signal.signal(sig, self.signal_handler) + + self.process = get_subprocess(config=self.config, target=self.target, sockets=self.sockets) + self.process.start() + + def restart(self) -> None: + if sys.platform == "win32": # pragma: py-not-win32 + self.is_restarting = True + assert self.process.pid is not None + os.kill(self.process.pid, signal.CTRL_C_EVENT) + else: # pragma: py-win32 + self.process.terminate() + self.process.join() + + self.process = get_subprocess(config=self.config, target=self.target, sockets=self.sockets) + self.process.start() + + def shutdown(self) -> None: + if sys.platform == "win32": + self.should_exit.set() # pragma: py-not-win32 + else: + self.process.terminate() # pragma: py-win32 + self.process.join() + + for sock in self.sockets: + sock.close() + + message = f"Stopping reloader process [{str(self.pid)}]" + color_message = "Stopping reloader process [{}]".format(click.style(str(self.pid), fg="cyan", bold=True)) + logger.info(message, extra={"color_message": color_message}) + + def should_restart(self) -> list[Path] | None: + raise NotImplementedError("Reload strategies should override should_restart()") + + +def _display_path(path: Path) -> str: + try: + return f"'{path.relative_to(Path.cwd())}'" + except ValueError: + return f"'{path}'" diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/multiprocess.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/multiprocess.py new file mode 100644 index 0000000000000000000000000000000000000000..e198fe780bf5d24f7eba828a28a279d98133361c --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/multiprocess.py @@ -0,0 +1,222 @@ +from __future__ import annotations + +import logging +import os +import signal +import threading +from multiprocessing import Pipe +from socket import socket +from typing import Any, Callable + +import click + +from uvicorn._subprocess import get_subprocess +from uvicorn.config import Config + +SIGNALS = { + getattr(signal, f"SIG{x}"): x + for x in "INT TERM BREAK HUP QUIT TTIN TTOU USR1 USR2 WINCH".split() + if hasattr(signal, f"SIG{x}") +} + +logger = logging.getLogger("uvicorn.error") + + +class Process: + def __init__( + self, + config: Config, + target: Callable[[list[socket] | None], None], + sockets: list[socket], + ) -> None: + self.real_target = target + + self.parent_conn, self.child_conn = Pipe() + self.process = get_subprocess(config, self.target, sockets) + + def ping(self, timeout: float = 5) -> bool: + self.parent_conn.send(b"ping") + if self.parent_conn.poll(timeout): + self.parent_conn.recv() + return True + return False + + def pong(self) -> None: + self.child_conn.recv() + self.child_conn.send(b"pong") + + def always_pong(self) -> None: + while True: + self.pong() + + def target(self, sockets: list[socket] | None = None) -> Any: # pragma: no cover + if os.name == "nt": # pragma: py-not-win32 + # Windows doesn't support SIGTERM, so we use SIGBREAK instead. + # And then we raise SIGTERM when SIGBREAK is received. + # https://learn.microsoft.com/zh-cn/cpp/c-runtime-library/reference/signal?view=msvc-170 + signal.signal( + signal.SIGBREAK, # type: ignore[attr-defined] + lambda sig, frame: signal.raise_signal(signal.SIGTERM), + ) + + threading.Thread(target=self.always_pong, daemon=True).start() + return self.real_target(sockets) + + def is_alive(self, timeout: float = 5) -> bool: + if not self.process.is_alive(): + return False # pragma: full coverage + + return self.ping(timeout) + + def start(self) -> None: + self.process.start() + + def terminate(self) -> None: + if self.process.exitcode is None: # Process is still running + assert self.process.pid is not None + if os.name == "nt": # pragma: py-not-win32 + # Windows doesn't support SIGTERM. + # So send SIGBREAK, and then in process raise SIGTERM. + os.kill(self.process.pid, signal.CTRL_BREAK_EVENT) # type: ignore[attr-defined] + else: + os.kill(self.process.pid, signal.SIGTERM) + logger.info(f"Terminated child process [{self.process.pid}]") + + self.parent_conn.close() + self.child_conn.close() + + def kill(self) -> None: + # In Windows, the method will call `TerminateProcess` to kill the process. + # In Unix, the method will send SIGKILL to the process. + self.process.kill() + + def join(self) -> None: + logger.info(f"Waiting for child process [{self.process.pid}]") + self.process.join() + + @property + def pid(self) -> int | None: + return self.process.pid + + +class Multiprocess: + def __init__( + self, + config: Config, + target: Callable[[list[socket] | None], None], + sockets: list[socket], + ) -> None: + self.config = config + self.target = target + self.sockets = sockets + + self.processes_num = config.workers + self.processes: list[Process] = [] + + self.should_exit = threading.Event() + + self.signal_queue: list[int] = [] + for sig in SIGNALS: + signal.signal(sig, lambda sig, frame: self.signal_queue.append(sig)) + + def init_processes(self) -> None: + for _ in range(self.processes_num): + process = Process(self.config, self.target, self.sockets) + process.start() + self.processes.append(process) + + def terminate_all(self) -> None: + for process in self.processes: + process.terminate() + + def join_all(self) -> None: + for process in self.processes: + process.join() + + def restart_all(self) -> None: + for idx, process in enumerate(self.processes): + process.terminate() + process.join() + new_process = Process(self.config, self.target, self.sockets) + new_process.start() + self.processes[idx] = new_process + + def run(self) -> None: + message = f"Started parent process [{os.getpid()}]" + color_message = "Started parent process [{}]".format(click.style(str(os.getpid()), fg="cyan", bold=True)) + logger.info(message, extra={"color_message": color_message}) + + self.init_processes() + + while not self.should_exit.wait(0.5): + self.handle_signals() + self.keep_subprocess_alive() + + self.terminate_all() + self.join_all() + + message = f"Stopping parent process [{os.getpid()}]" + color_message = "Stopping parent process [{}]".format(click.style(str(os.getpid()), fg="cyan", bold=True)) + logger.info(message, extra={"color_message": color_message}) + + def keep_subprocess_alive(self) -> None: + if self.should_exit.is_set(): + return # parent process is exiting, no need to keep subprocess alive + + for idx, process in enumerate(self.processes): + if process.is_alive(): + continue + + process.kill() # process is hung, kill it + process.join() + + if self.should_exit.is_set(): + return # pragma: full coverage + + logger.info(f"Child process [{process.pid}] died") + process = Process(self.config, self.target, self.sockets) + process.start() + self.processes[idx] = process + + def handle_signals(self) -> None: + for sig in tuple(self.signal_queue): + self.signal_queue.remove(sig) + sig_name = SIGNALS[sig] + sig_handler = getattr(self, f"handle_{sig_name.lower()}", None) + if sig_handler is not None: + sig_handler() + else: # pragma: no cover + logger.debug(f"Received signal {sig_name}, but no handler is defined for it.") + + def handle_int(self) -> None: + logger.info("Received SIGINT, exiting.") + self.should_exit.set() + + def handle_term(self) -> None: + logger.info("Received SIGTERM, exiting.") + self.should_exit.set() + + def handle_break(self) -> None: # pragma: py-not-win32 + logger.info("Received SIGBREAK, exiting.") + self.should_exit.set() + + def handle_hup(self) -> None: # pragma: py-win32 + logger.info("Received SIGHUP, restarting processes.") + self.restart_all() + + def handle_ttin(self) -> None: # pragma: py-win32 + logger.info("Received SIGTTIN, increasing the number of processes.") + self.processes_num += 1 + process = Process(self.config, self.target, self.sockets) + process.start() + self.processes.append(process) + + def handle_ttou(self) -> None: # pragma: py-win32 + logger.info("Received SIGTTOU, decreasing number of processes.") + if self.processes_num <= 1: + logger.info("Already reached one process, cannot decrease the number of processes anymore.") + return + self.processes_num -= 1 + process = self.processes.pop() + process.terminate() + process.join() diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/statreload.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/statreload.py new file mode 100644 index 0000000000000000000000000000000000000000..70d0a6d5caecf32027a3ebe14dbe52a125208d4b --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/statreload.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +import logging +from pathlib import Path +from socket import socket +from typing import Callable, Iterator + +from uvicorn.config import Config +from uvicorn.supervisors.basereload import BaseReload + +logger = logging.getLogger("uvicorn.error") + + +class StatReload(BaseReload): + def __init__( + self, + config: Config, + target: Callable[[list[socket] | None], None], + sockets: list[socket], + ) -> None: + super().__init__(config, target, sockets) + self.reloader_name = "StatReload" + self.mtimes: dict[Path, float] = {} + + if config.reload_excludes or config.reload_includes: + logger.warning("--reload-include and --reload-exclude have no effect unless " "watchfiles is installed.") + + def should_restart(self) -> list[Path] | None: + self.pause() + + for file in self.iter_py_files(): + try: + mtime = file.stat().st_mtime + except OSError: # pragma: nocover + continue + + old_time = self.mtimes.get(file) + if old_time is None: + self.mtimes[file] = mtime + continue + elif mtime > old_time: + return [file] + return None + + def restart(self) -> None: + self.mtimes = {} + return super().restart() + + def iter_py_files(self) -> Iterator[Path]: + for reload_dir in self.config.reload_dirs: + for path in list(reload_dir.rglob("*.py")): + yield path.resolve() diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/watchfilesreload.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/watchfilesreload.py new file mode 100644 index 0000000000000000000000000000000000000000..0d3b9b77e611d2d861fdaaa2940a78b03aee8a91 --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/watchfilesreload.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from pathlib import Path +from socket import socket +from typing import Callable + +from watchfiles import watch + +from uvicorn.config import Config +from uvicorn.supervisors.basereload import BaseReload + + +class FileFilter: + def __init__(self, config: Config): + default_includes = ["*.py"] + self.includes = [default for default in default_includes if default not in config.reload_excludes] + self.includes.extend(config.reload_includes) + self.includes = list(set(self.includes)) + + default_excludes = [".*", ".py[cod]", ".sw.*", "~*"] + self.excludes = [default for default in default_excludes if default not in config.reload_includes] + self.exclude_dirs = [] + for e in config.reload_excludes: + p = Path(e) + try: + is_dir = p.is_dir() + except OSError: # pragma: no cover + # gets raised on Windows for values like "*.py" + is_dir = False + + if is_dir: + self.exclude_dirs.append(p) + else: + self.excludes.append(e) # pragma: full coverage + self.excludes = list(set(self.excludes)) + + def __call__(self, path: Path) -> bool: + for include_pattern in self.includes: + if path.match(include_pattern): + if str(path).endswith(include_pattern): + return True # pragma: full coverage + + for exclude_dir in self.exclude_dirs: + if exclude_dir in path.parents: + return False + + for exclude_pattern in self.excludes: + if path.match(exclude_pattern): + return False # pragma: full coverage + + return True + return False + + +class WatchFilesReload(BaseReload): + def __init__( + self, + config: Config, + target: Callable[[list[socket] | None], None], + sockets: list[socket], + ) -> None: + super().__init__(config, target, sockets) + self.reloader_name = "WatchFiles" + self.reload_dirs = [] + for directory in config.reload_dirs: + if Path.cwd() not in directory.parents: + self.reload_dirs.append(directory) + if Path.cwd() not in self.reload_dirs: + self.reload_dirs.append(Path.cwd()) + + self.watch_filter = FileFilter(config) + self.watcher = watch( + *self.reload_dirs, + watch_filter=None, + stop_event=self.should_exit, + # using yield_on_timeout here mostly to make sure tests don't + # hang forever, won't affect the class's behavior + yield_on_timeout=True, + ) + + def should_restart(self) -> list[Path] | None: + self.pause() + + changes = next(self.watcher) + if changes: + unique_paths = {Path(c[1]) for c in changes} + return [p for p in unique_paths if self.watch_filter(p)] + return None diff --git a/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/watchgodreload.py b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/watchgodreload.py new file mode 100644 index 0000000000000000000000000000000000000000..6f248faa7e194e571740b27b1ee56b99e9189cbf --- /dev/null +++ b/tool_server/.venv/lib/python3.12/site-packages/uvicorn/supervisors/watchgodreload.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +import logging +import warnings +from pathlib import Path +from socket import socket +from typing import TYPE_CHECKING, Callable + +from watchgod import DefaultWatcher + +from uvicorn.config import Config +from uvicorn.supervisors.basereload import BaseReload + +if TYPE_CHECKING: + import os + + DirEntry = os.DirEntry[str] + +logger = logging.getLogger("uvicorn.error") + + +class CustomWatcher(DefaultWatcher): + def __init__(self, root_path: Path, config: Config): + default_includes = ["*.py"] + self.includes = [default for default in default_includes if default not in config.reload_excludes] + self.includes.extend(config.reload_includes) + self.includes = list(set(self.includes)) + + default_excludes = [".*", ".py[cod]", ".sw.*", "~*"] + self.excludes = [default for default in default_excludes if default not in config.reload_includes] + self.excludes.extend(config.reload_excludes) + self.excludes = list(set(self.excludes)) + + self.watched_dirs: dict[str, bool] = {} + self.watched_files: dict[str, bool] = {} + self.dirs_includes = set(config.reload_dirs) + self.dirs_excludes = set(config.reload_dirs_excludes) + self.resolved_root = root_path + super().__init__(str(root_path)) + + def should_watch_file(self, entry: DirEntry) -> bool: + cached_result = self.watched_files.get(entry.path) + if cached_result is not None: + return cached_result + + entry_path = Path(entry) + + # cwd is not verified through should_watch_dir, so we need to verify here + if entry_path.parent == Path.cwd() and Path.cwd() not in self.dirs_includes: + self.watched_files[entry.path] = False + return False + for include_pattern in self.includes: + if str(entry_path).endswith(include_pattern): + self.watched_files[entry.path] = True + return True + if entry_path.match(include_pattern): + for exclude_pattern in self.excludes: + if entry_path.match(exclude_pattern): + self.watched_files[entry.path] = False + return False + self.watched_files[entry.path] = True + return True + self.watched_files[entry.path] = False + return False + + def should_watch_dir(self, entry: DirEntry) -> bool: + cached_result = self.watched_dirs.get(entry.path) + if cached_result is not None: + return cached_result + + entry_path = Path(entry) + + if entry_path in self.dirs_excludes: + self.watched_dirs[entry.path] = False + return False + + for exclude_pattern in self.excludes: + if entry_path.match(exclude_pattern): + is_watched = False + if entry_path in self.dirs_includes: + is_watched = True + + for directory in self.dirs_includes: + if directory in entry_path.parents: + is_watched = True + + if is_watched: + logger.debug( + "WatchGodReload detected a new excluded dir '%s' in '%s'; " "Adding to exclude list.", + entry_path.relative_to(self.resolved_root), + str(self.resolved_root), + ) + self.watched_dirs[entry.path] = False + self.dirs_excludes.add(entry_path) + return False + + if entry_path in self.dirs_includes: + self.watched_dirs[entry.path] = True + return True + + for directory in self.dirs_includes: + if directory in entry_path.parents: + self.watched_dirs[entry.path] = True + return True + + for include_pattern in self.includes: + if entry_path.match(include_pattern): + logger.info( + "WatchGodReload detected a new reload dir '%s' in '%s'; " "Adding to watch list.", + str(entry_path.relative_to(self.resolved_root)), + str(self.resolved_root), + ) + self.dirs_includes.add(entry_path) + self.watched_dirs[entry.path] = True + return True + + self.watched_dirs[entry.path] = False + return False + + +class WatchGodReload(BaseReload): + def __init__( + self, + config: Config, + target: Callable[[list[socket] | None], None], + sockets: list[socket], + ) -> None: + warnings.warn( + '"watchgod" is deprecated, you should switch ' "to watchfiles (`pip install watchfiles`).", + DeprecationWarning, + ) + super().__init__(config, target, sockets) + self.reloader_name = "WatchGod" + self.watchers = [] + reload_dirs = [] + for directory in config.reload_dirs: + if Path.cwd() not in directory.parents: + reload_dirs.append(directory) + if Path.cwd() not in reload_dirs: + reload_dirs.append(Path.cwd()) + for w in reload_dirs: + self.watchers.append(CustomWatcher(w.resolve(), self.config)) + + def should_restart(self) -> list[Path] | None: + self.pause() + + for watcher in self.watchers: + change = watcher.check() + if change != set(): + return list({Path(c[1]) for c in change}) + + return None